From c5e9bcaefd188d9121199d26c1cd51d30e7847df Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Wed, 24 Jan 2018 10:40:49 +0100 Subject: [PATCH 01/50] Add opt-in MT-safety support; refactor existing interfaces; address various concerns reported by user; add support for AMD_shader_info and EXT_shader_stencil_export --- CMakeLists.txt | 20 +- deps/VulkanMemoryAllocator/vk_mem_alloc.h | 2 - examples/DynamicBuffers/CMakeLists.txt | 6 +- examples/DynamicBuffers/include/app.h | 4 +- examples/DynamicBuffers/src/app.cpp | 243 +- examples/MultiViewport/include/app.h | 2 +- examples/MultiViewport/src/app.cpp | 189 +- examples/OcclusionQuery/include/app.h | 8 +- examples/OcclusionQuery/src/app.cpp | 397 +- .../OutOfOrderRasterization/include/app.h | 16 +- examples/OutOfOrderRasterization/src/app.cpp | 460 ++- examples/PushConstants/include/app.h | 10 +- examples/PushConstants/src/app.cpp | 206 +- include/misc/base_pipeline_info.h | 148 + include/misc/base_pipeline_manager.h | 507 +-- include/misc/callbacks.h | 31 +- include/misc/compute_pipeline_info.h | 70 + include/misc/descriptor_set_info.h | 157 + include/misc/formats.h | 10 + include/misc/glsl_to_spirv.h | 6 + include/misc/graphics_pipeline_info.h | 947 +++++ include/misc/memory_allocator.h | 43 +- include/misc/mt_safety.h | 85 + include/misc/object_tracker.h | 51 +- include/misc/page_tracker.h | 10 +- include/misc/render_pass_info.h | 772 ++++ include/misc/shader_module_cache.h | 8 +- include/misc/types.h | 142 +- include/vulkan/vulkan.h | 576 ++- include/wrappers/buffer.h | 34 +- include/wrappers/buffer_view.h | 10 +- include/wrappers/command_buffer.h | 41 +- include/wrappers/command_pool.h | 12 +- include/wrappers/compute_pipeline_manager.h | 164 +- include/wrappers/descriptor_pool.h | 21 +- include/wrappers/descriptor_set.h | 13 +- include/wrappers/descriptor_set_group.h | 127 +- include/wrappers/descriptor_set_layout.h | 158 +- include/wrappers/device.h | 57 +- include/wrappers/event.h | 10 +- include/wrappers/fence.h | 10 +- include/wrappers/framebuffer.h | 12 +- include/wrappers/graphics_pipeline_manager.h | 1546 +------ include/wrappers/image.h | 56 +- include/wrappers/image_view.h | 31 +- include/wrappers/instance.h | 45 +- include/wrappers/memory_block.h | 40 +- include/wrappers/physical_device.h | 4 +- include/wrappers/pipeline_cache.h | 13 +- include/wrappers/pipeline_layout.h | 130 +- include/wrappers/pipeline_layout_manager.h | 37 +- include/wrappers/query_pool.h | 16 +- include/wrappers/queue.h | 48 +- include/wrappers/render_pass.h | 829 +--- include/wrappers/rendering_surface.h | 9 +- include/wrappers/sampler.h | 10 +- include/wrappers/semaphore.h | 10 +- include/wrappers/shader_module.h | 26 +- include/wrappers/swapchain.h | 11 +- src/misc/base_pipeline_info.cpp | 245 ++ src/misc/base_pipeline_manager.cpp | 720 ++-- src/misc/compute_pipeline_info.cpp | 92 + src/misc/debug_marker.cpp | 17 +- src/misc/descriptor_set_info.cpp | 145 + src/misc/dummy_window.cpp | 32 +- src/misc/formats.cpp | 208 +- src/misc/glsl_to_spirv.cpp | 9 +- src/misc/graphics_pipeline_info.cpp | 1094 +++++ .../memalloc_backends/backend_oneshot.cpp | 13 +- src/misc/memory_allocator.cpp | 349 +- src/misc/object_tracker.cpp | 28 +- src/misc/page_tracker.cpp | 39 +- src/misc/render_pass_info.cpp | 1079 +++++ src/misc/shader_module_cache.cpp | 54 +- src/misc/types.cpp | 83 +- src/wrappers/buffer.cpp | 180 +- src/wrappers/buffer_view.cpp | 22 +- src/wrappers/command_buffer.cpp | 1047 +++-- src/wrappers/command_pool.cpp | 61 +- src/wrappers/compute_pipeline_manager.cpp | 201 +- src/wrappers/descriptor_pool.cpp | 66 +- src/wrappers/descriptor_set.cpp | 78 +- src/wrappers/descriptor_set_group.cpp | 381 +- src/wrappers/descriptor_set_layout.cpp | 187 +- src/wrappers/device.cpp | 138 +- src/wrappers/event.cpp | 40 +- src/wrappers/fence.cpp | 51 +- src/wrappers/framebuffer.cpp | 89 +- src/wrappers/graphics_pipeline_manager.cpp | 3631 ++++------------- src/wrappers/image.cpp | 161 +- src/wrappers/image_view.cpp | 80 +- src/wrappers/instance.cpp | 73 +- src/wrappers/memory_block.cpp | 52 +- src/wrappers/physical_device.cpp | 47 +- src/wrappers/pipeline_cache.cpp | 27 +- src/wrappers/pipeline_layout.cpp | 172 +- src/wrappers/pipeline_layout_manager.cpp | 139 +- src/wrappers/query_pool.cpp | 38 +- src/wrappers/queue.cpp | 511 ++- src/wrappers/render_pass.cpp | 1293 +----- src/wrappers/rendering_surface.cpp | 370 +- src/wrappers/sampler.cpp | 23 +- src/wrappers/semaphore.cpp | 22 +- src/wrappers/shader_module.cpp | 135 +- src/wrappers/swapchain.cpp | 225 +- 105 files changed, 11622 insertions(+), 10781 deletions(-) create mode 100644 include/misc/base_pipeline_info.h create mode 100644 include/misc/compute_pipeline_info.h create mode 100644 include/misc/descriptor_set_info.h create mode 100644 include/misc/graphics_pipeline_info.h create mode 100644 include/misc/mt_safety.h create mode 100644 include/misc/render_pass_info.h create mode 100644 src/misc/base_pipeline_info.cpp create mode 100644 src/misc/compute_pipeline_info.cpp create mode 100644 src/misc/descriptor_set_info.cpp create mode 100644 src/misc/graphics_pipeline_info.cpp create mode 100644 src/misc/render_pass_info.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index e7a70d9f..9fe5a7b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,13 +9,11 @@ option(ANVIL_LINK_WITH_GLSLANG "Links with glslang, instead # Do not modify anything after this line, unless you know what you're doing. configure_file("include/config.h.in" "${Anvil_SOURCE_DIR}/include/config.h") -include_directories("$(Anvil_SOURCE_DIR)/deps" +include_directories("$(Anvil_SOURCE_DIR)" + "$(Anvil_SOURCE_DIR)/deps" "$(Anvil_SOURCE_DIR)/include") if (WIN32) - include_directories($ENV{VK_SDK_PATH}/Include - $ENV{VULKAN_SDK}/Include) - if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") link_directories ($ENV{VK_SDK_PATH}/Bin $ENV{VK_SDK_PATH}/Lib @@ -28,9 +26,6 @@ if (WIN32) $ENV{VULKAN_SDK}/Lib32) endif() else() - include_directories($ENV{VK_SDK_PATH}/x86_64/include - $ENV{VULKAN_SDK}/include - $ENV{VULKAN_SDK}/x86_64/include) link_directories ($ENV{VK_SDK_PATH}/x86_64/lib $ENV{VULKAN_SDK}/lib $ENV{VULKAN_SDK}/x86_64/lib) @@ -38,20 +33,26 @@ endif() SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_oneshot.h" "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_vma.h" + "${Anvil_SOURCE_DIR}/include/misc/base_pipeline_info.h" "${Anvil_SOURCE_DIR}/include/misc/base_pipeline_manager.h" "${Anvil_SOURCE_DIR}/include/misc/callbacks.h" + "${Anvil_SOURCE_DIR}/include/misc/compute_pipeline_info.h" "${Anvil_SOURCE_DIR}/include/misc/debug.h" "${Anvil_SOURCE_DIR}/include/misc/debug_marker.h" + "${Anvil_SOURCE_DIR}/include/misc/descriptor_set_info.h" "${Anvil_SOURCE_DIR}/include/misc/dummy_window.h" "${Anvil_SOURCE_DIR}/include/misc/formats.h" "${Anvil_SOURCE_DIR}/include/misc/fp16.h" "${Anvil_SOURCE_DIR}/include/misc/glsl_to_spirv.h" + "${Anvil_SOURCE_DIR}/include/misc/graphics_pipeline_info.h" "${Anvil_SOURCE_DIR}/include/misc/io.h" "${Anvil_SOURCE_DIR}/include/misc/memory_allocator.h" + "${Anvil_SOURCE_DIR}/include/misc/mt_safety.h" "${Anvil_SOURCE_DIR}/include/misc/object_tracker.h" "${Anvil_SOURCE_DIR}/include/misc/page_tracker.h" "${Anvil_SOURCE_DIR}/include/misc/pools.h" "${Anvil_SOURCE_DIR}/include/misc/ref_counter.h" + "${Anvil_SOURCE_DIR}/include/misc/render_pass_info.h" "${Anvil_SOURCE_DIR}/include/misc/shader_module_cache.h" "${Anvil_SOURCE_DIR}/include/misc/time.h" "${Anvil_SOURCE_DIR}/include/misc/types.h" @@ -90,18 +91,23 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/src/misc/memalloc_backends/backend_oneshot.cpp" "${Anvil_SOURCE_DIR}/src/misc/memalloc_backends/backend_vma.cpp" + "${Anvil_SOURCE_DIR}/src/misc/base_pipeline_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/base_pipeline_manager.cpp" + "${Anvil_SOURCE_DIR}/src/misc/compute_pipeline_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/debug.cpp" "${Anvil_SOURCE_DIR}/src/misc/debug_marker.cpp" + "${Anvil_SOURCE_DIR}/src/misc/descriptor_set_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/dummy_window.cpp" "${Anvil_SOURCE_DIR}/src/misc/formats.cpp" "${Anvil_SOURCE_DIR}/src/misc/fp16.cpp" "${Anvil_SOURCE_DIR}/src/misc/glsl_to_spirv.cpp" + "${Anvil_SOURCE_DIR}/src/misc/graphics_pipeline_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/io.cpp" "${Anvil_SOURCE_DIR}/src/misc/memory_allocator.cpp" "${Anvil_SOURCE_DIR}/src/misc/object_tracker.cpp" "${Anvil_SOURCE_DIR}/src/misc/page_tracker.cpp" "${Anvil_SOURCE_DIR}/src/misc/pools.cpp" + "${Anvil_SOURCE_DIR}/src/misc/render_pass_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/shader_module_cache.cpp" "${Anvil_SOURCE_DIR}/src/misc/time.cpp" "${Anvil_SOURCE_DIR}/src/misc/types.cpp" diff --git a/deps/VulkanMemoryAllocator/vk_mem_alloc.h b/deps/VulkanMemoryAllocator/vk_mem_alloc.h index ef00fb4a..669e383c 100644 --- a/deps/VulkanMemoryAllocator/vk_mem_alloc.h +++ b/deps/VulkanMemoryAllocator/vk_mem_alloc.h @@ -1486,8 +1486,6 @@ template class VmaList { public: - class const_iterator; - class iterator { public: diff --git a/examples/DynamicBuffers/CMakeLists.txt b/examples/DynamicBuffers/CMakeLists.txt index 5551a655..37aa1b73 100644 --- a/examples/DynamicBuffers/CMakeLists.txt +++ b/examples/DynamicBuffers/CMakeLists.txt @@ -49,11 +49,11 @@ endif() # Create the DynamicBuffers project. add_executable (DynamicBuffers include/app.h - include/app.h - src/app.cpp) + include/app.h + src/app.cpp) # Add linking dependencies for the example projects -add_dependencies(DynamicBuffers Anvil) +add_dependencies (DynamicBuffers Anvil) if (WIN32) target_link_libraries(DynamicBuffers Anvil) diff --git a/examples/DynamicBuffers/include/app.h b/examples/DynamicBuffers/include/app.h index fbd46c51..dc358ca0 100644 --- a/examples/DynamicBuffers/include/app.h +++ b/examples/DynamicBuffers/include/app.h @@ -82,9 +82,9 @@ class App std::shared_ptr m_consumer_vs_ptr; std::shared_ptr m_producer_cs_ptr; - Anvil::GraphicsPipelineID m_consumer_pipeline_id; + Anvil::PipelineID m_consumer_pipeline_id; std::shared_ptr m_consumer_render_pass_ptr; - Anvil::ComputePipelineID m_producer_pipeline_id; + Anvil::PipelineID m_producer_pipeline_id; std::shared_ptr m_command_buffers [N_SWAPCHAIN_IMAGES]; std::shared_ptr m_depth_images [N_SWAPCHAIN_IMAGES]; diff --git a/examples/DynamicBuffers/src/app.cpp b/examples/DynamicBuffers/src/app.cpp index a586d1b0..70accf98 100644 --- a/examples/DynamicBuffers/src/app.cpp +++ b/examples/DynamicBuffers/src/app.cpp @@ -26,13 +26,17 @@ /* Uncomment the #define below to enable validation */ // #define ENABLE_VALIDATION + #include #include #include "config.h" +#include "misc/compute_pipeline_info.h" #include "misc/glsl_to_spirv.h" +#include "misc/graphics_pipeline_info.h" #include "misc/io.h" #include "misc/memory_allocator.h" #include "misc/object_tracker.h" +#include "misc/render_pass_info.h" #include "misc/time.h" #include "misc/window_factory.h" #include "wrappers/buffer.h" @@ -67,7 +71,6 @@ #endif #endif - /* Low-level #defines follow.. */ #define APP_NAME "Dynamic buffers example" @@ -517,7 +520,7 @@ void App::init_command_buffers() VkImageSubresourceRange subresource_range; std::shared_ptr universal_queue_ptr (device_locked_ptr->get_universal_queue(0) ); - producer_pipeline_layout_ptr = device_locked_ptr->get_compute_pipeline_manager()->get_compute_pipeline_layout(m_producer_pipeline_id); + producer_pipeline_layout_ptr = device_locked_ptr->get_compute_pipeline_manager()->get_pipeline_layout(m_producer_pipeline_id); subresource_range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; subresource_range.baseArrayLayer = 0; @@ -702,7 +705,7 @@ void App::init_command_buffers() std::shared_ptr renderer_pipeline_layout_ptr; static const VkDeviceSize sine_color_buffer_start_offset = 0; - renderer_pipeline_layout_ptr = gfx_pipeline_manager_ptr->get_graphics_pipeline_layout(m_consumer_pipeline_id); + renderer_pipeline_layout_ptr = gfx_pipeline_manager_ptr->get_pipeline_layout(m_consumer_pipeline_id); draw_cmd_buffer_ptr->record_bind_pipeline (VK_PIPELINE_BIND_POINT_GRAPHICS, m_consumer_pipeline_id); @@ -773,20 +776,17 @@ void App::init_compute_pipelines() bool result; /* Create & configure the compute pipeline */ - result = compute_manager_ptr->add_regular_pipeline(false, /* disable_optimizations */ - false, /* allow_derivatives */ - *m_producer_cs_ptr, - &m_producer_pipeline_id); - anvil_assert(result); - - result = compute_manager_ptr->attach_push_constant_range_to_pipeline(m_producer_pipeline_id, - 0, /* offset */ - 4, /* size */ - VK_SHADER_STAGE_COMPUTE_BIT); - anvil_assert(result); - - result = compute_manager_ptr->set_pipeline_dsg(m_producer_pipeline_id, - m_producer_dsg_ptr); + auto producer_pipeline_info_ptr = Anvil::ComputePipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ + false, /* in_allow_derivatives */ + *m_producer_cs_ptr); + + producer_pipeline_info_ptr->attach_push_constant_range(0, /* offset */ + 4, /* size */ + VK_SHADER_STAGE_COMPUTE_BIT); + producer_pipeline_info_ptr->set_dsg (m_producer_dsg_ptr); + + result = compute_manager_ptr->add_pipeline(std::move(producer_pipeline_info_ptr), + &m_producer_pipeline_id); anvil_assert(result); result = compute_manager_ptr->bake(); @@ -795,26 +795,41 @@ void App::init_compute_pipelines() void App::init_dsgs() { + auto consumer_dsg_info_ptrs = std::vector >(2); + auto producer_dsg_info_ptrs = std::vector >(2); + + consumer_dsg_info_ptrs[0] = Anvil::DescriptorSetInfo::create(); + consumer_dsg_info_ptrs[1] = Anvil::DescriptorSetInfo::create(); + producer_dsg_info_ptrs[0] = Anvil::DescriptorSetInfo::create(); + producer_dsg_info_ptrs[1] = Anvil::DescriptorSetInfo::create(); + + consumer_dsg_info_ptrs[0]->add_binding(0, /* binding */ + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, + 1, /* n_elements */ + VK_SHADER_STAGE_VERTEX_BIT); + consumer_dsg_info_ptrs[1]->add_binding(0, /* binding */ + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, + 1, /* n_elements */ + VK_SHADER_STAGE_VERTEX_BIT); + + producer_dsg_info_ptrs[0]->add_binding(0, /* binding */ + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, + 1, /* n_elements */ + VK_SHADER_STAGE_COMPUTE_BIT); + producer_dsg_info_ptrs[0]->add_binding(1, /* binding */ + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, + 1, /* n_elements */ + VK_SHADER_STAGE_COMPUTE_BIT); + producer_dsg_info_ptrs[1]->add_binding(0, /* binding */ + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, + 1, /* n_elements */ + VK_SHADER_STAGE_COMPUTE_BIT); + /* Create the descriptor set layouts for the generator program. */ m_producer_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr, - false, /* releaseable_sets */ - 2 /* n_sets */); - - m_producer_dsg_ptr->add_binding(0, /* n_set */ - 0, /* binding */ - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, - 1, /* n_elements */ - VK_SHADER_STAGE_COMPUTE_BIT); - m_producer_dsg_ptr->add_binding(0, /* n_set */ - 1, /* binding */ - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, - 1, /* n_elements */ - VK_SHADER_STAGE_COMPUTE_BIT); - m_producer_dsg_ptr->add_binding(1, /* n_set */ - 0, /* binding */ - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, - 1, /* n_elements */ - VK_SHADER_STAGE_COMPUTE_BIT); + producer_dsg_info_ptrs, + false); /* releaseable_sets */ + m_producer_dsg_ptr->set_binding_item(0, /* n_set */ 0, /* binding_index */ @@ -834,21 +849,10 @@ void App::init_dsgs() /* Set up the descriptor set layout for the renderer program. */ m_consumer_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr, - false, /* releaseable_sets */ - 2 /* n_sets */); + consumer_dsg_info_ptrs, + false); /* releaseable_sets */ - m_consumer_dsg_ptr->add_binding(0, /* n_set */ - 0, /* binding */ - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, - 1, /* n_elements */ - VK_SHADER_STAGE_VERTEX_BIT); - m_consumer_dsg_ptr->add_binding(1, /* n_set */ - 0, /* binding */ - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, - 1, /* n_elements */ - VK_SHADER_STAGE_VERTEX_BIT); - m_consumer_dsg_ptr->set_binding_item(0, /* n_set */ 0, /* binding_index */ Anvil::DescriptorSet::DynamicStorageBufferBindingElement(m_sine_data_buffer_ptr, @@ -863,6 +867,7 @@ void App::init_dsgs() void App::init_events() { + /* Stub */ } void App::init_framebuffers() @@ -896,9 +901,9 @@ void App::init_framebuffers() void App::init_gfx_pipelines() { - std::shared_ptr device_locked_ptr(m_device_ptr); - std::shared_ptr gfx_manager_ptr (device_locked_ptr->get_graphics_pipeline_manager() ); - bool result; + auto device_locked_ptr = m_device_ptr.lock (); + auto gfx_manager_ptr = device_locked_ptr->get_graphics_pipeline_manager(); + auto renderpass_info_ptr = std::unique_ptr(new Anvil::RenderPassInfo(device_locked_ptr) ); /* Create a renderpass instance */ #ifdef ENABLE_OFFSCREEN_RENDERING @@ -911,79 +916,73 @@ void App::init_gfx_pipelines() Anvil::RenderPassAttachmentID render_pass_depth_attachment_id = -1; Anvil::SubPassID render_pass_subpass_id = -1; - m_consumer_render_pass_ptr = Anvil::RenderPass::create(m_device_ptr, + renderpass_info_ptr->add_color_attachment(m_swapchain_ptr->get_image_format(), + VK_SAMPLE_COUNT_1_BIT, + VK_ATTACHMENT_LOAD_OP_CLEAR, + VK_ATTACHMENT_STORE_OP_STORE, + VK_IMAGE_LAYOUT_UNDEFINED, + final_layout, + false, /* may_alias */ + &render_pass_color_attachment_id); + + renderpass_info_ptr->add_depth_stencil_attachment(m_depth_images[0]->get_image_format(), + m_depth_images[0]->get_image_sample_count(), + VK_ATTACHMENT_LOAD_OP_CLEAR, /* depth_load_op */ + VK_ATTACHMENT_STORE_OP_DONT_CARE, /* depth_store_op */ + VK_ATTACHMENT_LOAD_OP_DONT_CARE, /* stencil_load_op */ + VK_ATTACHMENT_STORE_OP_DONT_CARE, /* stencil_store_op */ + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* initial_layout */ + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* final_layout */ + false, /* may_alias */ + &render_pass_depth_attachment_id); + + renderpass_info_ptr->add_subpass(&render_pass_subpass_id); + + renderpass_info_ptr->add_subpass_color_attachment (render_pass_subpass_id, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + render_pass_color_attachment_id, + 0, /* location */ + nullptr); /* opt_attachment_resolve_id_ptr */ + renderpass_info_ptr->add_subpass_depth_stencil_attachment(render_pass_subpass_id, + render_pass_depth_attachment_id, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); + + m_consumer_render_pass_ptr = Anvil::RenderPass::create(std::move(renderpass_info_ptr), m_swapchain_ptr); m_consumer_render_pass_ptr->set_name("Consumer renderpass"); - result = m_consumer_render_pass_ptr->add_color_attachment(m_swapchain_ptr->get_image_format(), - VK_SAMPLE_COUNT_1_BIT, - VK_ATTACHMENT_LOAD_OP_CLEAR, - VK_ATTACHMENT_STORE_OP_STORE, - VK_IMAGE_LAYOUT_UNDEFINED, - final_layout, - false, /* may_alias */ - &render_pass_color_attachment_id); - anvil_assert(result); - - result = m_consumer_render_pass_ptr->add_depth_stencil_attachment(m_depth_images[0]->get_image_format(), - m_depth_images[0]->get_image_sample_count(), - VK_ATTACHMENT_LOAD_OP_CLEAR, /* depth_load_op */ - VK_ATTACHMENT_STORE_OP_DONT_CARE, /* depth_store_op */ - VK_ATTACHMENT_LOAD_OP_DONT_CARE, /* stencil_load_op */ - VK_ATTACHMENT_STORE_OP_DONT_CARE, /* stencil_store_op */ - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* initial_layout */ - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* final_layout */ - false, /* may_alias */ - &render_pass_depth_attachment_id); - anvil_assert(result); - - result = m_consumer_render_pass_ptr->add_subpass(*m_consumer_fs_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader */ - *m_consumer_vs_ptr, - &render_pass_subpass_id); - anvil_assert(result); - - result = m_consumer_render_pass_ptr->add_subpass_color_attachment (render_pass_subpass_id, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - render_pass_color_attachment_id, - 0, /* location */ - nullptr); /* opt_attachment_resolve_id_ptr */ - result &= m_consumer_render_pass_ptr->add_subpass_depth_stencil_attachment(render_pass_subpass_id, - render_pass_depth_attachment_id, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); - anvil_assert(result); /* Set up the graphics pipeline for the main subpass */ - result = m_consumer_render_pass_ptr->get_subpass_graphics_pipeline_id(render_pass_subpass_id, - &m_consumer_pipeline_id); - anvil_assert(result); - - gfx_manager_ptr->add_vertex_attribute (m_consumer_pipeline_id, - 0, /* location */ - VK_FORMAT_R8G8_UNORM, - 0, /* offset_in_bytes */ - sizeof(char) * 2, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_INSTANCE); - gfx_manager_ptr->set_pipeline_dsg (m_consumer_pipeline_id, - m_consumer_dsg_ptr); - gfx_manager_ptr->set_input_assembly_properties(m_consumer_pipeline_id, - VK_PRIMITIVE_TOPOLOGY_LINE_STRIP); - gfx_manager_ptr->set_rasterization_properties (m_consumer_pipeline_id, - VK_POLYGON_MODE_FILL, - VK_CULL_MODE_NONE, - VK_FRONT_FACE_COUNTER_CLOCKWISE, - 1.0f /* line_width */); - gfx_manager_ptr->toggle_depth_test (m_consumer_pipeline_id, - true, /* should_enable */ - VK_COMPARE_OP_LESS_OR_EQUAL); - gfx_manager_ptr->toggle_depth_writes (m_consumer_pipeline_id, - true); /* should_enable */ - gfx_manager_ptr->toggle_dynamic_states (m_consumer_pipeline_id, - true, /* should_enable */ - Anvil::GraphicsPipelineManager::DYNAMIC_STATE_LINE_WIDTH_BIT); + auto consumer_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ + false, /* in_allow_derivatives */ + m_consumer_render_pass_ptr, + render_pass_subpass_id, + *m_consumer_fs_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader */ + *m_consumer_vs_ptr); + + consumer_pipeline_info_ptr->add_vertex_attribute (0, /* location */ + VK_FORMAT_R8G8_UNORM, + 0, /* offset_in_bytes */ + sizeof(char) * 2, /* stride_in_bytes */ + VK_VERTEX_INPUT_RATE_INSTANCE); + consumer_pipeline_info_ptr->set_dsg (m_consumer_dsg_ptr); + consumer_pipeline_info_ptr->set_primitive_topology (VK_PRIMITIVE_TOPOLOGY_LINE_STRIP); + consumer_pipeline_info_ptr->set_rasterization_properties (VK_POLYGON_MODE_FILL, + VK_CULL_MODE_NONE, + VK_FRONT_FACE_COUNTER_CLOCKWISE, + 1.0f /* line_width */); + consumer_pipeline_info_ptr->toggle_depth_test (true, /* should_enable */ + VK_COMPARE_OP_LESS_OR_EQUAL); + consumer_pipeline_info_ptr->toggle_depth_writes (true); /* should_enable */ + consumer_pipeline_info_ptr->toggle_dynamic_states (true, /* should_enable */ + Anvil::DYNAMIC_STATE_LINE_WIDTH_BIT); + + gfx_manager_ptr->add_pipeline(std::move(consumer_pipeline_info_ptr), + &m_consumer_pipeline_id); } void App::init_images() @@ -1161,7 +1160,8 @@ void App::init_window() 720, true, /* in_closable */ std::bind(&App::draw_frame, - this) ); + this) + ); } void App::init_vulkan() @@ -1175,10 +1175,11 @@ void App::init_vulkan() std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, - std::placeholders::_4) ); + std::placeholders::_4), #else - nullptr); + Anvil::DebugCallbackFunction(), #endif + false); /* in_mt_safe */ m_physical_device_ptr = m_instance_ptr->get_physical_device(0); diff --git a/examples/MultiViewport/include/app.h b/examples/MultiViewport/include/app.h index 510105ed..f99c1548 100644 --- a/examples/MultiViewport/include/app.h +++ b/examples/MultiViewport/include/app.h @@ -83,7 +83,7 @@ class App std::shared_ptr m_fbos [N_SWAPCHAIN_IMAGES]; std::shared_ptr m_fs_ptr; std::shared_ptr m_gs_ptr; - Anvil::GraphicsPipelineID m_pipeline_id; + Anvil::PipelineID m_pipeline_id; std::shared_ptr m_renderpass_ptr; std::shared_ptr m_vs_ptr; diff --git a/examples/MultiViewport/src/app.cpp b/examples/MultiViewport/src/app.cpp index e3c038cb..c2b4ae62 100644 --- a/examples/MultiViewport/src/app.cpp +++ b/examples/MultiViewport/src/app.cpp @@ -30,7 +30,9 @@ #include #include "config.h" #include "misc/glsl_to_spirv.h" +#include "misc/graphics_pipeline_info.h" #include "misc/object_tracker.h" +#include "misc/render_pass_info.h" #include "misc/time.h" #include "misc/window_factory.h" #include "wrappers/buffer.h" @@ -586,7 +588,7 @@ void App::init_command_buffers() /* Change the swap-chain image's layout to presentable */ { Anvil::ImageBarrier image_barrier(VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, /* source_access_mask */ - 0, /* destination_access_mask */ + VK_ACCESS_MEMORY_READ_BIT, /* destination_access_mask */ false, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, /* old_image_layout */ #ifdef ENABLE_OFFSCREEN_RENDERING @@ -600,7 +602,7 @@ void App::init_command_buffers() subresource_range); cmd_buffer_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, + VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_FALSE, /* in_by_region */ 0, /* in_memory_barrier_count */ nullptr, /* in_memory_barrier_ptrs */ @@ -649,116 +651,106 @@ void App::init_gfx_pipelines() const VkFormat mesh_vertex_data_format (get_mesh_vertex_data_format ()); const uint32_t n_mesh_color_components (get_mesh_color_data_n_components ()); const uint32_t n_mesh_vertex_components(get_mesh_vertex_data_n_components()); - bool result; /* Create a render pass for the pipeline */ - Anvil::RenderPassAttachmentID render_pass_color_attachment_id; - Anvil::SubPassID render_pass_subpass_id; - VkRect2D scissors[4]; + std::unique_ptr gfx_pipeline_info_ptr; + Anvil::RenderPassAttachmentID render_pass_color_attachment_id; + Anvil::SubPassID render_pass_subpass_id; + VkRect2D scissors[4]; get_scissor_viewport_info(scissors, nullptr); /* viewports */ - m_renderpass_ptr = Anvil::RenderPass::create( - m_device_ptr, - m_swapchain_ptr); + { + std::unique_ptr render_pass_info_ptr(new Anvil::RenderPassInfo(m_device_ptr) ); + + render_pass_info_ptr->add_color_attachment (m_swapchain_ptr->get_image_format(), + VK_SAMPLE_COUNT_1_BIT, + VK_ATTACHMENT_LOAD_OP_CLEAR, + VK_ATTACHMENT_STORE_OP_STORE, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + false, /* may_alias */ + &render_pass_color_attachment_id); + render_pass_info_ptr->add_subpass (&render_pass_subpass_id); + render_pass_info_ptr->add_subpass_color_attachment(render_pass_subpass_id, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + render_pass_color_attachment_id, + 0, /* in_location */ + nullptr); /* in_opt_attachment_resolve_id_ptr */ + + m_renderpass_ptr = Anvil::RenderPass::create(std::move(render_pass_info_ptr), + m_swapchain_ptr); + } m_renderpass_ptr->set_name("Main renderpass"); - result = m_renderpass_ptr->add_color_attachment(m_swapchain_ptr->get_image_format(), - VK_SAMPLE_COUNT_1_BIT, - VK_ATTACHMENT_LOAD_OP_CLEAR, - VK_ATTACHMENT_STORE_OP_STORE, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - false, /* may_alias */ - &render_pass_color_attachment_id); - anvil_assert(result); - - result = m_renderpass_ptr->add_subpass(*m_fs_ptr, - *m_gs_ptr, - Anvil::ShaderModuleStageEntryPoint(), - Anvil::ShaderModuleStageEntryPoint(), - *m_vs_ptr, - &render_pass_subpass_id); - anvil_assert(result); - - result = m_renderpass_ptr->get_subpass_graphics_pipeline_id(render_pass_subpass_id, - &m_pipeline_id); - anvil_assert(result); - - result = m_renderpass_ptr->add_subpass_color_attachment(render_pass_subpass_id, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - render_pass_color_attachment_id, - 0, /* location */ - nullptr); /* opt_attachment_resolve_id_ptr */ - anvil_assert(result); - /* Configure the graphics pipeline */ - gfx_pipeline_manager_ptr->set_dynamic_viewport_state_properties(m_pipeline_id, - sizeof(scissors) / sizeof(scissors[0]) ); - gfx_pipeline_manager_ptr->set_input_assembly_properties (m_pipeline_id, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN); - gfx_pipeline_manager_ptr->set_rasterization_properties (m_pipeline_id, - VK_POLYGON_MODE_FILL, - VK_CULL_MODE_NONE, - VK_FRONT_FACE_COUNTER_CLOCKWISE, - 1.0f /* line_width */); - gfx_pipeline_manager_ptr->toggle_dynamic_states (m_pipeline_id, - true, /* should_enable */ - Anvil::GraphicsPipelineManager::DYNAMIC_STATE_VIEWPORT_BIT); - gfx_pipeline_manager_ptr->toggle_primitive_restart (m_pipeline_id, - true /* should_enable */); - - result = gfx_pipeline_manager_ptr->add_vertex_attribute(m_pipeline_id, - g_vertex_attribute_location, - mesh_vertex_data_format, - 0, /* offset_in_bytes */ - sizeof(float) * n_mesh_vertex_components, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX, - g_vertex_attribute_binding); - result &= gfx_pipeline_manager_ptr->add_vertex_attribute(m_pipeline_id, - g_color1_attribute_location, - mesh_color_data_format, - 0, /* offset_in_bytes */ - sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX, - g_color1_attribute_binding); - result &= gfx_pipeline_manager_ptr->add_vertex_attribute(m_pipeline_id, - g_color2_attribute_location, - mesh_color_data_format, - 0, /* offset_in_bytes */ - sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX, - g_color2_attribute_binding); - result &= gfx_pipeline_manager_ptr->add_vertex_attribute(m_pipeline_id, - g_color3_attribute_location, - mesh_color_data_format, - 0, /* offset_in_bytes */ - sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX, - g_color3_attribute_binding); - result &= gfx_pipeline_manager_ptr->add_vertex_attribute(m_pipeline_id, - g_color4_attribute_location, - mesh_color_data_format, - 0, /* offset_in_bytes */ - sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX, - g_color4_attribute_binding); - - anvil_assert(result); + gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ + false, /* in_allow_derivatives */ + m_renderpass_ptr, + render_pass_subpass_id, + *m_fs_ptr, + *m_gs_ptr, + Anvil::ShaderModuleStageEntryPoint(), + Anvil::ShaderModuleStageEntryPoint(), + *m_vs_ptr); + + gfx_pipeline_info_ptr->set_n_dynamic_viewports (sizeof(scissors) / sizeof(scissors[0]) ); + gfx_pipeline_info_ptr->set_primitive_topology (VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN); + gfx_pipeline_info_ptr->set_rasterization_properties(VK_POLYGON_MODE_FILL, + VK_CULL_MODE_NONE, + VK_FRONT_FACE_COUNTER_CLOCKWISE, + 1.0f /* line_width */); + gfx_pipeline_info_ptr->toggle_dynamic_states (true, /* should_enable */ + Anvil::DYNAMIC_STATE_VIEWPORT_BIT); + gfx_pipeline_info_ptr->toggle_primitive_restart (true /* should_enable */); + + gfx_pipeline_info_ptr->add_vertex_attribute(g_vertex_attribute_location, + mesh_vertex_data_format, + 0, /* offset_in_bytes */ + sizeof(float) * n_mesh_vertex_components, /* stride_in_bytes */ + VK_VERTEX_INPUT_RATE_VERTEX, + g_vertex_attribute_binding); + gfx_pipeline_info_ptr->add_vertex_attribute(g_color1_attribute_location, + mesh_color_data_format, + 0, /* offset_in_bytes */ + sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ + VK_VERTEX_INPUT_RATE_VERTEX, + g_color1_attribute_binding); + gfx_pipeline_info_ptr->add_vertex_attribute(g_color2_attribute_location, + mesh_color_data_format, + 0, /* offset_in_bytes */ + sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ + VK_VERTEX_INPUT_RATE_VERTEX, + g_color2_attribute_binding); + gfx_pipeline_info_ptr->add_vertex_attribute(g_color3_attribute_location, + mesh_color_data_format, + 0, /* offset_in_bytes */ + sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ + VK_VERTEX_INPUT_RATE_VERTEX, + g_color3_attribute_binding); + gfx_pipeline_info_ptr->add_vertex_attribute(g_color4_attribute_location, + mesh_color_data_format, + 0, /* offset_in_bytes */ + sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ + VK_VERTEX_INPUT_RATE_VERTEX, + g_color4_attribute_binding); for (uint32_t n_scissor_box = 0; n_scissor_box < sizeof(scissors) / sizeof(scissors[0]); ++n_scissor_box) { - gfx_pipeline_manager_ptr->set_scissor_box_properties(m_pipeline_id, - n_scissor_box, - scissors[n_scissor_box].offset.x, - scissors[n_scissor_box].offset.y, - scissors[n_scissor_box].extent.width, - scissors[n_scissor_box].extent.height); + gfx_pipeline_info_ptr->set_scissor_box_properties(n_scissor_box, + scissors[n_scissor_box].offset.x, + scissors[n_scissor_box].offset.y, + scissors[n_scissor_box].extent.width, + scissors[n_scissor_box].extent.height); } + + + gfx_pipeline_manager_ptr->add_pipeline(std::move(gfx_pipeline_info_ptr), + &m_pipeline_id); } void App::init_semaphores() @@ -900,10 +892,11 @@ void App::init_vulkan() std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, - std::placeholders::_4) ); + std::placeholders::_4), #else - nullptr); + Anvil::DebugCallbackFunction(), #endif + false); /* in_mt_safe */ m_physical_device_ptr = m_instance_ptr->get_physical_device(0); diff --git a/examples/OcclusionQuery/include/app.h b/examples/OcclusionQuery/include/app.h index 951ae2df..688dc090 100644 --- a/examples/OcclusionQuery/include/app.h +++ b/examples/OcclusionQuery/include/app.h @@ -93,10 +93,10 @@ class App std::shared_ptr m_render_tri1_and_generate_ot_data_cmd_buffers[N_SWAPCHAIN_IMAGES]; std::shared_ptr m_render_tri2_and_quad_cmd_buffers [N_SWAPCHAIN_IMAGES]; - Anvil::GraphicsPipelineID m_1stpass_depth_test_always_pipeline_id; - Anvil::GraphicsPipelineID m_1stpass_depth_test_equal_pipeline_id; - Anvil::GraphicsPipelineID m_2ndpass_depth_test_off_quad_pipeline_id; - Anvil::GraphicsPipelineID m_2ndpass_depth_test_off_tri_pipeline_id; + Anvil::PipelineID m_1stpass_depth_test_always_pipeline_id; + Anvil::PipelineID m_1stpass_depth_test_equal_pipeline_id; + Anvil::PipelineID m_2ndpass_depth_test_off_quad_pipeline_id; + Anvil::PipelineID m_2ndpass_depth_test_off_tri_pipeline_id; std::shared_ptr m_fbos[N_SWAPCHAIN_IMAGES]; diff --git a/examples/OcclusionQuery/src/app.cpp b/examples/OcclusionQuery/src/app.cpp index a2f5c29f..06ee3ae2 100644 --- a/examples/OcclusionQuery/src/app.cpp +++ b/examples/OcclusionQuery/src/app.cpp @@ -29,8 +29,10 @@ #include "config.h" #include #include "misc/glsl_to_spirv.h" +#include "misc/graphics_pipeline_info.h" #include "misc/io.h" #include "misc/object_tracker.h" +#include "misc/render_pass_info.h" #include "misc/time.h" #include "misc/window_factory.h" #include "wrappers/buffer.h" @@ -390,7 +392,7 @@ void App::init_command_buffers() render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_bind_pipeline (VK_PIPELINE_BIND_POINT_GRAPHICS, m_1stpass_depth_test_always_pipeline_id); render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_bind_descriptor_sets(VK_PIPELINE_BIND_POINT_GRAPHICS, - gfx_pipeline_manager_ptr->get_graphics_pipeline_layout(m_1stpass_depth_test_always_pipeline_id), + gfx_pipeline_manager_ptr->get_pipeline_layout(m_1stpass_depth_test_always_pipeline_id), 0, /* in_first_set */ 1, /* in_set_count */ &tri_1stpass_ds0_ptr, @@ -492,7 +494,7 @@ void App::init_command_buffers() render_tri2_and_quad_cmd_buffer_ptr->record_bind_pipeline (VK_PIPELINE_BIND_POINT_GRAPHICS, m_2ndpass_depth_test_off_tri_pipeline_id); render_tri2_and_quad_cmd_buffer_ptr->record_bind_descriptor_sets(VK_PIPELINE_BIND_POINT_GRAPHICS, - gfx_pipeline_manager_ptr->get_graphics_pipeline_layout(m_2ndpass_depth_test_off_tri_pipeline_id), + gfx_pipeline_manager_ptr->get_pipeline_layout(m_2ndpass_depth_test_off_tri_pipeline_id), 0, /* in_first_set */ 1, /* in_set_count */ &tri_2ndpass_ds0_ptr, @@ -510,7 +512,7 @@ void App::init_command_buffers() render_tri2_and_quad_cmd_buffer_ptr->record_bind_pipeline (VK_PIPELINE_BIND_POINT_GRAPHICS, m_2ndpass_depth_test_off_quad_pipeline_id); render_tri2_and_quad_cmd_buffer_ptr->record_bind_descriptor_sets(VK_PIPELINE_BIND_POINT_GRAPHICS, - gfx_pipeline_manager_ptr->get_graphics_pipeline_layout(m_2ndpass_depth_test_off_quad_pipeline_id), + gfx_pipeline_manager_ptr->get_pipeline_layout(m_2ndpass_depth_test_off_quad_pipeline_id), 0, /* in_first_set */ 1, /* in_set_count */ &quad_2ndpass_ds0_ptr, @@ -535,43 +537,48 @@ void App::init_command_buffers() void App::init_dsgs() { - m_2ndpass_quad_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr, - false, /* releaseable_sets */ - 1); /* n_sets */ - m_2ndpass_tri_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr, - false, /* releaseable_sets */ - 1); /* n_sets */ + std::vector > dsg_1stpass_info_ptrs (1); + std::vector > quad_dsg_2ndpass_info_ptrs(1); + std::vector > tri_dsg_2ndpass_info_ptrs (1); + + dsg_1stpass_info_ptrs [0] = Anvil::DescriptorSetInfo::create(); + quad_dsg_2ndpass_info_ptrs[0] = Anvil::DescriptorSetInfo::create(); + tri_dsg_2ndpass_info_ptrs [0] = Anvil::DescriptorSetInfo::create(); + + + dsg_1stpass_info_ptrs[0]->add_binding (0, /* binding */ + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, + 1, /* n_elements */ + VK_SHADER_STAGE_VERTEX_BIT); + tri_dsg_2ndpass_info_ptrs[0]->add_binding (0, /* binding */ + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, + 1, /* n_elements */ + VK_SHADER_STAGE_VERTEX_BIT); + quad_dsg_2ndpass_info_ptrs[0]->add_binding(0, /* binding */ + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, + 1, /* n_elements */ + VK_SHADER_STAGE_VERTEX_BIT); + m_1stpass_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr, - false, /* releaseable_sets */ - 1); /* n_sets */ - - m_1stpass_dsg_ptr->add_binding (0, /* n_set */ - 0, /* binding */ - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, - 1, /* n_elements */ - VK_SHADER_STAGE_VERTEX_BIT); - m_1stpass_dsg_ptr->set_binding_item(0, /* n_set */ - 0, /* binding_index */ - Anvil::DescriptorSet::DynamicUniformBufferBindingElement(m_time_bo_ptr, - 0, /* in_start_offset */ - m_time_n_bytes_per_swapchain_image) ); - - m_2ndpass_tri_dsg_ptr->add_binding (0, /* n_set */ - 0, /* binding */ - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, - 1, /* n_elements */ - VK_SHADER_STAGE_VERTEX_BIT); - m_2ndpass_tri_dsg_ptr->set_binding_item(0, /* n_set */ - 0, /* binding_index */ - Anvil::DescriptorSet::DynamicUniformBufferBindingElement(m_time_bo_ptr, - 0, /* in_start_offset */ - m_time_n_bytes_per_swapchain_image) ); - - m_2ndpass_quad_dsg_ptr->add_binding (0, /* n_set */ - 0, /* binding */ - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, - 1, /* n_elements */ - VK_SHADER_STAGE_VERTEX_BIT); + dsg_1stpass_info_ptrs, + false); /* in_releaseable_sets */ + m_2ndpass_tri_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr, + tri_dsg_2ndpass_info_ptrs, + false); /* in_releaseable_sets */ + m_2ndpass_quad_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr, + quad_dsg_2ndpass_info_ptrs, + false); /* in_releaseable_sets */ + + m_1stpass_dsg_ptr->set_binding_item (0, /* n_set */ + 0, /* binding_index */ + Anvil::DescriptorSet::DynamicUniformBufferBindingElement(m_time_bo_ptr, + 0, /* in_start_offset */ + m_time_n_bytes_per_swapchain_image) ); + m_2ndpass_tri_dsg_ptr->set_binding_item (0, /* n_set */ + 0, /* binding_index */ + Anvil::DescriptorSet::DynamicUniformBufferBindingElement(m_time_bo_ptr, + 0, /* in_start_offset */ + m_time_n_bytes_per_swapchain_image) ); m_2ndpass_quad_dsg_ptr->set_binding_item(0, /* n_set */ 0, /* binding_index */ Anvil::DescriptorSet::DynamicUniformBufferBindingElement(m_query_bo_ptr, @@ -663,158 +670,176 @@ void App::init_renderpasses() Anvil::RenderPassAttachmentID ds_attachment_id; const bool is_2nd_renderpass = (n_renderpass == 1); std::shared_ptr renderpass_ptr; - - renderpass_ptr = Anvil::RenderPass::create(m_device_ptr, - m_swapchain_ptr); - - renderpass_ptr->set_name( (n_renderpass == 0) ? "Quad renderpass" - : "Triangle renderpass"); - renderpass_ptr->add_color_attachment(m_swapchain_ptr->get_image_format(), - VK_SAMPLE_COUNT_1_BIT, - (!is_2nd_renderpass) ? VK_ATTACHMENT_LOAD_OP_CLEAR - : VK_ATTACHMENT_LOAD_OP_LOAD, - VK_ATTACHMENT_STORE_OP_STORE, - VK_IMAGE_LAYOUT_UNDEFINED, + { + std::unique_ptr renderpass_info_ptr(new Anvil::RenderPassInfo(m_device_ptr) ); + + renderpass_info_ptr->add_color_attachment(m_swapchain_ptr->get_image_format(), + VK_SAMPLE_COUNT_1_BIT, + (!is_2nd_renderpass) ? VK_ATTACHMENT_LOAD_OP_CLEAR + : VK_ATTACHMENT_LOAD_OP_LOAD, + VK_ATTACHMENT_STORE_OP_STORE, + VK_IMAGE_LAYOUT_UNDEFINED, #ifdef ENABLE_OFFSCREEN_RENDERING - VK_IMAGE_LAYOUT_GENERAL, + VK_IMAGE_LAYOUT_GENERAL, #else - VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, -#endif - false, /* may_alias */ - &color_attachment_id); - - renderpass_ptr->add_depth_stencil_attachment(m_depth_image_ptr->get_image_format(), - VK_SAMPLE_COUNT_1_BIT, - (!is_2nd_renderpass) ? VK_ATTACHMENT_LOAD_OP_CLEAR - : VK_ATTACHMENT_LOAD_OP_LOAD, - VK_ATTACHMENT_STORE_OP_STORE, - VK_ATTACHMENT_LOAD_OP_DONT_CARE, /* stencil_load_op */ - VK_ATTACHMENT_STORE_OP_DONT_CARE, /* stencil_store_op */ - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, - false, /* may_alias */ - &ds_attachment_id); + VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, + #endif + false, /* may_alias */ + &color_attachment_id); + + renderpass_info_ptr->add_depth_stencil_attachment(m_depth_image_ptr->get_image_format(), + VK_SAMPLE_COUNT_1_BIT, + (!is_2nd_renderpass) ? VK_ATTACHMENT_LOAD_OP_CLEAR + : VK_ATTACHMENT_LOAD_OP_LOAD, + VK_ATTACHMENT_STORE_OP_STORE, + VK_ATTACHMENT_LOAD_OP_DONT_CARE, /* stencil_load_op */ + VK_ATTACHMENT_STORE_OP_DONT_CARE, /* stencil_store_op */ + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + false, /* may_alias */ + &ds_attachment_id); + + if (is_2nd_renderpass) + { + renderpass_info_ptr->add_subpass(&m_renderpass_2ndpass_depth_test_off_tri_subpass_id); + renderpass_info_ptr->add_subpass(&m_renderpass_2ndpass_depth_test_off_quad_subpass_id); + + renderpass_info_ptr->add_subpass_color_attachment(m_renderpass_2ndpass_depth_test_off_tri_subpass_id, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + color_attachment_id, + 0, /* location */ + nullptr); /* opt_attachment_resolve_ptr */ + renderpass_info_ptr->add_subpass_color_attachment(m_renderpass_2ndpass_depth_test_off_quad_subpass_id, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + color_attachment_id, + 0, /* location */ + nullptr); /* opt_attachment_resolve_ptr */ + + /* Vulkan requires applications to synchronize subpass execution via subpass dependencies. + * Even though technically we would be fine with both subpasses being executed in parallel, + * as the rasterized geometry never overlaps, we have to define a dependency .. */ + renderpass_info_ptr->add_subpass_to_subpass_dependency(m_renderpass_2ndpass_depth_test_off_tri_subpass_id, + m_renderpass_2ndpass_depth_test_off_quad_subpass_id, + VK_PIPELINE_STAGE_VERTEX_SHADER_BIT, /* in_source_stage_mask */ + VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, /* in_destination_stage_mask */ + 0, /* in_source_access_mask */ + 0, /* in_destination_access_mask */ + VK_TRUE); /* in_by_region */ + } + else + { + renderpass_info_ptr->add_subpass(&m_renderpass_1stpass_depth_test_always_subpass_id); + renderpass_info_ptr->add_subpass(&m_renderpass_1stpass_depth_test_equal_ot_subpass_id); + + renderpass_info_ptr->add_subpass_color_attachment(m_renderpass_1stpass_depth_test_always_subpass_id, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + color_attachment_id, + 0, /* location */ + nullptr); /* opt_attachment_resolve_ptr */ + renderpass_info_ptr->add_subpass_color_attachment(m_renderpass_1stpass_depth_test_equal_ot_subpass_id, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + color_attachment_id, + 0, /* location */ + nullptr); /* opt_attachment_resolve_ptr */ + + renderpass_info_ptr->add_subpass_depth_stencil_attachment(m_renderpass_1stpass_depth_test_always_subpass_id, + ds_attachment_id, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); + renderpass_info_ptr->add_subpass_depth_stencil_attachment(m_renderpass_1stpass_depth_test_equal_ot_subpass_id, + ds_attachment_id, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); + + + /* depth_test_equal_ot subpass must not start before depth_test_always subpass finishes rasterizing */ + renderpass_info_ptr->add_subpass_to_subpass_dependency(m_renderpass_1stpass_depth_test_always_subpass_id, + m_renderpass_1stpass_depth_test_equal_ot_subpass_id, + VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, /* in_source_stage_mask */ + VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT, /* in_destination_stage_mask */ + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT, + VK_TRUE); /* in_by_region */ + } + + renderpass_ptr = Anvil::RenderPass::create(std::move(renderpass_info_ptr), + m_swapchain_ptr); + } + + renderpass_ptr->set_name( (n_renderpass == 0) ? "Quad renderpass" + : "Triangle renderpass"); if (is_2nd_renderpass) { - renderpass_ptr->add_subpass(*m_tri_fs_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader_entrypoint */ - *m_tri_vs_ptr, - &m_renderpass_2ndpass_depth_test_off_tri_subpass_id); - renderpass_ptr->add_subpass(*m_quad_fs_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader_entrypoint */ - *m_quad_vs_ptr, - &m_renderpass_2ndpass_depth_test_off_quad_subpass_id); - - - renderpass_ptr->add_subpass_color_attachment(m_renderpass_2ndpass_depth_test_off_tri_subpass_id, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - color_attachment_id, - 0, /* location */ - nullptr); /* opt_attachment_resolve_ptr */ - renderpass_ptr->add_subpass_color_attachment(m_renderpass_2ndpass_depth_test_off_quad_subpass_id, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - color_attachment_id, - 0, /* location */ - nullptr); /* opt_attachment_resolve_ptr */ - - - renderpass_ptr->get_subpass_graphics_pipeline_id(m_renderpass_2ndpass_depth_test_off_tri_subpass_id, - &m_2ndpass_depth_test_off_tri_pipeline_id); - renderpass_ptr->get_subpass_graphics_pipeline_id(m_renderpass_2ndpass_depth_test_off_quad_subpass_id, - &m_2ndpass_depth_test_off_quad_pipeline_id); - - - gfx_pipeline_manager_ptr->set_pipeline_dsg(m_2ndpass_depth_test_off_tri_pipeline_id, - m_2ndpass_tri_dsg_ptr); - - gfx_pipeline_manager_ptr->set_pipeline_dsg (m_2ndpass_depth_test_off_quad_pipeline_id, - m_2ndpass_quad_dsg_ptr); - gfx_pipeline_manager_ptr->set_input_assembly_properties(m_2ndpass_depth_test_off_quad_pipeline_id, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP); - - /* Vulkan requires applications to synchronize subpass execution via subpass dependencies. - * Even though technically we would be fine with both subpasses being executed in parallel, - * as the rasterized geometry never overlaps, we have to define a dependency .. */ - renderpass_ptr->add_subpass_to_subpass_dependency(m_renderpass_2ndpass_depth_test_off_tri_subpass_id, - m_renderpass_2ndpass_depth_test_off_quad_subpass_id, - VK_PIPELINE_STAGE_VERTEX_SHADER_BIT, /* source_stage_mask */ - VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, /* destination_stage_mask */ - 0, /* source_access_mask */ - 0, /* destination_access_mask */ - VK_TRUE); /* by_region */ + auto depth_test_off_tri_subpass_gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ + false, /* in_allow_derivatives */ + renderpass_ptr, + m_renderpass_2ndpass_depth_test_off_tri_subpass_id, + *m_tri_fs_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* in_geometry_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* in_tess_control_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* in_tess_evaluation_shader_entrypoint */ + *m_tri_vs_ptr); + auto depth_test_off_quad_subpass_gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ + false, /* in_allow_derivatives */ + renderpass_ptr, + m_renderpass_2ndpass_depth_test_off_quad_subpass_id, + *m_quad_fs_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader_entrypoint */ + *m_quad_vs_ptr); + + + + depth_test_off_tri_subpass_gfx_pipeline_info_ptr->set_dsg(m_2ndpass_tri_dsg_ptr); + + depth_test_off_quad_subpass_gfx_pipeline_info_ptr->set_dsg (m_2ndpass_quad_dsg_ptr); + depth_test_off_quad_subpass_gfx_pipeline_info_ptr->set_primitive_topology(VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP); + + + gfx_pipeline_manager_ptr->add_pipeline(std::move(depth_test_off_quad_subpass_gfx_pipeline_info_ptr), + &m_2ndpass_depth_test_off_quad_pipeline_id); + gfx_pipeline_manager_ptr->add_pipeline(std::move(depth_test_off_tri_subpass_gfx_pipeline_info_ptr), + &m_2ndpass_depth_test_off_tri_pipeline_id); m_renderpass_quad_ptr = renderpass_ptr; } else { - renderpass_ptr->add_subpass(*m_tri_fs_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader_entrypoint */ - *m_tri_vs_ptr, - &m_renderpass_1stpass_depth_test_always_subpass_id); - renderpass_ptr->add_subpass(*m_tri_fs_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader_entrypoint */ - *m_tri_vs_ptr, - &m_renderpass_1stpass_depth_test_equal_ot_subpass_id); - - - renderpass_ptr->add_subpass_color_attachment(m_renderpass_1stpass_depth_test_always_subpass_id, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - color_attachment_id, - 0, /* location */ - nullptr); /* opt_attachment_resolve_ptr */ - renderpass_ptr->add_subpass_color_attachment(m_renderpass_1stpass_depth_test_equal_ot_subpass_id, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - color_attachment_id, - 0, /* location */ - nullptr); /* opt_attachment_resolve_ptr */ - - renderpass_ptr->add_subpass_depth_stencil_attachment(m_renderpass_1stpass_depth_test_always_subpass_id, - ds_attachment_id, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); - renderpass_ptr->add_subpass_depth_stencil_attachment(m_renderpass_1stpass_depth_test_equal_ot_subpass_id, - ds_attachment_id, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); - - - renderpass_ptr->get_subpass_graphics_pipeline_id(m_renderpass_1stpass_depth_test_always_subpass_id, - &m_1stpass_depth_test_always_pipeline_id); - renderpass_ptr->get_subpass_graphics_pipeline_id(m_renderpass_1stpass_depth_test_equal_ot_subpass_id, - &m_1stpass_depth_test_equal_pipeline_id); - - gfx_pipeline_manager_ptr->set_pipeline_dsg (m_1stpass_depth_test_always_pipeline_id, - m_1stpass_dsg_ptr); - gfx_pipeline_manager_ptr->toggle_depth_test (m_1stpass_depth_test_always_pipeline_id, - true, /* should_enable */ - VK_COMPARE_OP_ALWAYS); - gfx_pipeline_manager_ptr->toggle_depth_writes(m_1stpass_depth_test_always_pipeline_id, - true); /* should_enable */ - - gfx_pipeline_manager_ptr->set_pipeline_dsg (m_1stpass_depth_test_equal_pipeline_id, - m_1stpass_dsg_ptr); - gfx_pipeline_manager_ptr->toggle_depth_test (m_1stpass_depth_test_equal_pipeline_id, - true, /* should_enable */ - VK_COMPARE_OP_EQUAL); - gfx_pipeline_manager_ptr->toggle_depth_writes(m_1stpass_depth_test_equal_pipeline_id, - true); /* should_enable */ - - /* depth_test_equal_ot subpass must not start before depth_test_always subpass finishes rasterizing */ - renderpass_ptr->add_subpass_to_subpass_dependency(m_renderpass_1stpass_depth_test_always_subpass_id, - m_renderpass_1stpass_depth_test_equal_ot_subpass_id, - VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, /* source_stage_mask */ - VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT, /* destination_stage_mask */ - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT, - VK_TRUE); /* by_region */ + auto depth_test_always_subpass_gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ + false, /* in_allow_derivatives */ + renderpass_ptr, + m_renderpass_1stpass_depth_test_always_subpass_id, + *m_tri_fs_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader_entrypoint */ + *m_tri_vs_ptr); + auto depth_test_equal_ot_subpass_gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ + false, /* in_allow_derivatives */ + renderpass_ptr, + m_renderpass_1stpass_depth_test_equal_ot_subpass_id, + *m_tri_fs_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader_entrypoint */ + *m_tri_vs_ptr); + + depth_test_always_subpass_gfx_pipeline_info_ptr->set_dsg (m_1stpass_dsg_ptr); + depth_test_always_subpass_gfx_pipeline_info_ptr->toggle_depth_test (true, /* in_should_enable */ + VK_COMPARE_OP_ALWAYS); + depth_test_always_subpass_gfx_pipeline_info_ptr->toggle_depth_writes(true); /* in_should_enable */ + + depth_test_equal_ot_subpass_gfx_pipeline_info_ptr->set_dsg (m_1stpass_dsg_ptr); + depth_test_equal_ot_subpass_gfx_pipeline_info_ptr->toggle_depth_test (true, /* in_should_enable */ + VK_COMPARE_OP_EQUAL); + depth_test_equal_ot_subpass_gfx_pipeline_info_ptr->toggle_depth_writes(true); /* in_should_enable */ + + + gfx_pipeline_manager_ptr->add_pipeline(std::move(depth_test_always_subpass_gfx_pipeline_info_ptr), + &m_1stpass_depth_test_always_pipeline_id); + gfx_pipeline_manager_ptr->add_pipeline(std::move(depth_test_equal_ot_subpass_gfx_pipeline_info_ptr), + &m_1stpass_depth_test_equal_pipeline_id); m_renderpass_tris_ptr = renderpass_ptr; } @@ -965,24 +990,26 @@ void App::init_window() 720, true, /* in_closable */ std::bind(&App::draw_frame, - this) ); + this) + ); } void App::init_vulkan() { /* Create a Vulkan instance */ - m_instance_ptr = Anvil::Instance::create(APP_NAME, /* app_name */ - APP_NAME, /* engine_name */ + m_instance_ptr = Anvil::Instance::create(APP_NAME, /* in_app_name */ + APP_NAME, /* in_engine_name */ #ifdef ENABLE_VALIDATION std::bind(&App::on_validation_callback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, - std::placeholders::_4) ); + std::placeholders::_4), #else - nullptr); + Anvil::DebugCallbackFunction(), #endif + false); /* in_mt_safe */ m_physical_device_ptr = m_instance_ptr->get_physical_device(0); diff --git a/examples/OutOfOrderRasterization/include/app.h b/examples/OutOfOrderRasterization/include/app.h index 2755cd35..bcdc770d 100644 --- a/examples/OutOfOrderRasterization/include/app.h +++ b/examples/OutOfOrderRasterization/include/app.h @@ -21,7 +21,7 @@ // #include -#define N_SWAPCHAIN_IMAGES (3) +#define N_SWAPCHAIN_IMAGES (2) class App @@ -60,7 +60,7 @@ class App void update_teapot_props(uint32_t n_current_swapchain_image); void draw_frame (); - void on_keypress_event (Anvil::CallbackArgument* callback_data_raw_ptr); + void on_keypress_event (Anvil::CallbackArgument* in_callback_data_raw_ptr); VkBool32 on_validation_callback(VkDebugReportFlagsEXT message_flags, VkDebugReportObjectTypeEXT object_type, const char* layer_prefix, @@ -79,8 +79,10 @@ class App std::shared_ptr m_depth_image_view_ptr; std::vector > m_framebuffers; std::shared_ptr m_fs_entrypoint_ptr; - std::vector > m_render_cmdbuffers_ooo_on; + std::vector > m_render_cmdbuffers_ooo_off; + std::vector > m_render_cmdbuffers_ooo_on; + std::vector > m_renderpasses; std::shared_ptr m_vs_entrypoint_ptr; @@ -101,10 +103,10 @@ class App std::vector m_frame_signal_semaphore_bundles; std::vector m_frame_wait_semaphore_bundles; - bool m_frame_drawn_status[N_SWAPCHAIN_IMAGES]; - Anvil::GraphicsPipelineID m_general_pipeline_id; - Anvil::GraphicsPipelineID m_ooo_disabled_pipeline_id; - Anvil::GraphicsPipelineID m_ooo_enabled_pipeline_id; + bool m_frame_drawn_status[N_SWAPCHAIN_IMAGES]; + Anvil::PipelineID m_general_pipeline_id; + Anvil::PipelineID m_ooo_disabled_pipeline_id; + Anvil::PipelineID m_ooo_enabled_pipeline_id; std::shared_ptr m_index_buffer_ptr; std::shared_ptr m_query_results_buffer_ptr; diff --git a/examples/OutOfOrderRasterization/src/app.cpp b/examples/OutOfOrderRasterization/src/app.cpp index 2486417b..283fa1f7 100644 --- a/examples/OutOfOrderRasterization/src/app.cpp +++ b/examples/OutOfOrderRasterization/src/app.cpp @@ -30,9 +30,11 @@ #include #include "config.h" #include "misc/glsl_to_spirv.h" +#include "misc/graphics_pipeline_info.h" #include "misc/io.h" #include "misc/memory_allocator.h" #include "misc/object_tracker.h" +#include "misc/render_pass_info.h" #include "misc/time.h" #include "misc/window_factory.h" #include "wrappers/buffer.h" @@ -163,15 +165,15 @@ static const char* vs_body = App::App() - :m_general_pipeline_id (-1), - m_n_frames_drawn ( 0), - m_n_indices ( 0), - m_n_last_semaphore_used (-1), - m_n_swapchain_images (N_SWAPCHAIN_IMAGES), - m_ooo_disabled_pipeline_id(-1), - m_ooo_enabled (false), - m_ooo_enabled_pipeline_id (-1), - m_should_rotate (true) + :m_general_pipeline_id (-1), + m_n_frames_drawn ( 0), + m_n_indices ( 0), + m_n_last_semaphore_used (-1), + m_n_swapchain_images (N_SWAPCHAIN_IMAGES), + m_ooo_disabled_pipeline_id (-1), + m_ooo_enabled (false), + m_ooo_enabled_pipeline_id (-1), + m_should_rotate (true) { memset(m_frame_drawn_status, 0, @@ -207,7 +209,7 @@ void App::deinit() vkDeviceWaitIdle(m_device_ptr.lock()->get_device_vk() ); - const Anvil::GraphicsPipelineID gfx_pipeline_ids[] = + const Anvil::PipelineID gfx_pipeline_ids[] = { m_general_pipeline_id, m_ooo_disabled_pipeline_id, @@ -223,7 +225,7 @@ void App::deinit() n_gfx_pipeline_id < n_gfx_pipeline_ids; ++n_gfx_pipeline_id) { - const Anvil::GraphicsPipelineID& pipeline_id = gfx_pipeline_ids[n_gfx_pipeline_id]; + const Anvil::PipelineID& pipeline_id = gfx_pipeline_ids[n_gfx_pipeline_id]; gfx_pipeline_manager_ptr->delete_pipeline(pipeline_id); } @@ -262,28 +264,57 @@ void App::deinit() void App::draw_frame() { - std::shared_ptr device_locked_ptr = m_device_ptr.lock(); - std::shared_ptr sgpu_device_locked_ptr = std::dynamic_pointer_cast(device_locked_ptr); - static const VkPipelineStageFlags dst_stage_mask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; - const uint32_t n_physical_devices = 1; + std::shared_ptr device_locked_ptr = m_device_ptr.lock(); + const Anvil::DeviceType device_type = device_locked_ptr->get_type(); + static const VkPipelineStageFlags dst_stage_mask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; + std::shared_ptr frame_ready_for_present_semaphore_ptr; + std::shared_ptr frame_ready_for_render_semaphore_ptr; + uint32_t n_physical_devices; uint32_t n_swapchain_image; - std::weak_ptr physical_device_ptr = sgpu_device_locked_ptr->get_physical_device(); - std::weak_ptr* physical_devices_ptr = &physical_device_ptr; + std::weak_ptr physical_device_ptr; std::shared_ptr render_cmdbuffer_ptr; - const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; + const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; + + switch (device_type) + { + case Anvil::DEVICE_TYPE_SINGLE_GPU: + { + std::shared_ptr sgpu_device_locked_ptr(std::dynamic_pointer_cast(device_locked_ptr) ); + + n_physical_devices = 1; + physical_device_ptr = sgpu_device_locked_ptr->get_physical_device(); + + break; + } + + default: + { + anvil_assert(false); + } + } /* Determine the signal + wait semaphores to use for drawing this frame */ m_n_last_semaphore_used = (m_n_last_semaphore_used + 1) % m_n_swapchain_images; - auto& curr_frame_signal_semaphores = m_frame_signal_semaphore_bundles.at (m_n_last_semaphore_used); - const auto& curr_frame_wait_semaphores = m_frame_wait_semaphore_bundles.at (m_n_last_semaphore_used); - const auto& curr_frame_acqusition_wait_semaphore_ptr = curr_frame_wait_semaphores.semaphores.at(0); - auto& curr_frame_present_wait_semaphore_ptr = curr_frame_signal_semaphores.semaphores.at(0); + auto& curr_frame_signal_semaphores = m_frame_signal_semaphore_bundles.at (m_n_last_semaphore_used); + auto& curr_frame_wait_semaphores = m_frame_wait_semaphore_bundles.at (m_n_last_semaphore_used); + auto& curr_frame_acqusition_wait_semaphore_ptr = curr_frame_wait_semaphores.semaphores.at(0); + + const auto& present_wait_semaphores = curr_frame_signal_semaphores; /* Determine the semaphore which the swapchain image */ n_swapchain_image = m_swapchain_ptr->acquire_image(curr_frame_acqusition_wait_semaphore_ptr, true); /* in_should_block */ + /* Set up semaphores we're going to use to render this frame. */ + for (uint32_t n_signal_sem = 0; + n_signal_sem < n_physical_devices; + ++n_signal_sem) + { + frame_ready_for_present_semaphore_ptr = curr_frame_signal_semaphores.semaphores[n_signal_sem]; + frame_ready_for_render_semaphore_ptr = curr_frame_wait_semaphores.semaphores [n_signal_sem]; + } + /* if the frame has already been rendered to in the past, then given the fact we use FIFO presentation mode, * we should be safe to extract the timestamps which must have been written by now. */ @@ -300,8 +331,6 @@ void App::draw_frame() n_iteration < n_iterations; ++n_iteration) { - auto current_physical_device_ptr = physical_devices_ptr[n_iteration]; - m_query_results_buffer_ptr->read(n_swapchain_image * sizeof(uint64_t) * 2, /* top of pipe, bottom of pipe */ sizeof(timestamps), timestamps); @@ -330,18 +359,22 @@ void App::draw_frame() render_cmdbuffer_ptr = m_render_cmdbuffers_ooo_off.at(n_swapchain_image); } - m_present_queue_ptr->submit_command_buffer_with_signal_wait_semaphores(render_cmdbuffer_ptr, - 1, /* n_semaphores_to_signal */ - &curr_frame_present_wait_semaphore_ptr, - 1, /* n_semaphores_to_wait_on */ - &curr_frame_acqusition_wait_semaphore_ptr, - &wait_stage_mask, - false /* should_block */); + { + m_present_queue_ptr->submit_command_buffer_with_signal_wait_semaphores(render_cmdbuffer_ptr, + 1, /* n_semaphores_to_signal */ + &frame_ready_for_present_semaphore_ptr, + 1, /* n_semaphores_to_wait_on */ + &frame_ready_for_render_semaphore_ptr, + &wait_stage_mask, + false /* should_block */); + } - m_present_queue_ptr->present(m_swapchain_ptr, - n_swapchain_image, - 1, /* n_wait_semaphores */ - &curr_frame_present_wait_semaphore_ptr); + { + m_present_queue_ptr->present(m_swapchain_ptr, + n_swapchain_image, + 1, /* n_wait_semaphores */ + &frame_ready_for_present_semaphore_ptr); + } ++m_n_frames_drawn; @@ -381,10 +414,10 @@ void App::init_buffers() TeapotData data (U_GRANULARITY, V_GRANULARITY); const Anvil::DeviceType device_type (m_device_ptr.lock()->get_type() ); - const VkDeviceSize index_data_size = data.get_index_data_size(); - const VkDeviceSize properties_data_size = N_TEAPOTS * sizeof(float) * 8; /* rot_xyzX + pos_xyzX */ - const VkDeviceSize vertex_data_size = data.get_vertex_data_size(); - + const VkDeviceSize index_data_size = data.get_index_data_size(); + const VkDeviceSize properties_data_size = N_TEAPOTS * sizeof(float) * 8; /* rot_xyzX + pos_xyzX */ + const Anvil::MemoryFeatureFlags required_feature_flags = 0; + const VkDeviceSize vertex_data_size = data.get_vertex_data_size(); allocator_ptr = Anvil::MemoryAllocator::create_oneshot(m_device_ptr); @@ -411,12 +444,12 @@ void App::init_buffers() m_vertex_buffer_ptr->set_name ("Teapot vertex buffer"); allocator_ptr->add_buffer(m_query_results_buffer_ptr, - Anvil::MEMORY_FEATURE_FLAG_MAPPABLE); + /* Anvil::MEMORY_FEATURE_FLAG_MAPPABLE | */ required_feature_flags); allocator_ptr->add_buffer(m_index_buffer_ptr, - 0); /* in_required_memory_features */ + required_feature_flags); allocator_ptr->add_buffer(m_vertex_buffer_ptr, - 0); /* in_required_memory_features */ + required_feature_flags); for (uint32_t n_swapchain_image = 0; n_swapchain_image < m_n_swapchain_images; @@ -433,7 +466,7 @@ void App::init_buffers() new_buffer_ptr->set_name("Properties buffer"); allocator_ptr->add_buffer(new_buffer_ptr, - 0); /* in_required_memory_features */ + required_feature_flags); /* in_required_memory_features */ m_properties_buffer_ptrs.push_back(new_buffer_ptr); } @@ -499,7 +532,7 @@ void App::init_command_buffers() const bool is_ooo_enabled = (n_ooo_iteration == 1); const Anvil::PipelineID pipeline_id = (is_ooo_enabled) ? m_ooo_enabled_pipeline_id : m_ooo_disabled_pipeline_id; - std::shared_ptr pipeline_layout_ptr = gfx_manager_ptr->get_graphics_pipeline_layout(pipeline_id); + std::shared_ptr pipeline_layout_ptr = gfx_manager_ptr->get_pipeline_layout(pipeline_id); std::vector >& render_cmdbuffers = (is_ooo_enabled) ? m_render_cmdbuffers_ooo_on : m_render_cmdbuffers_ooo_off; @@ -553,12 +586,14 @@ void App::init_command_buffers() m_query_pool_ptr, n_render_cmdbuffer * 2 /* top of pipe, bottom of pipe*/ + 0); - cmdbuffer_ptr->record_begin_render_pass(sizeof(clear_values) / sizeof(clear_values[0]), - clear_values, - framebuffer_ptr, - render_area, - renderpass_ptr, - VK_SUBPASS_CONTENTS_INLINE); + { + cmdbuffer_ptr->record_begin_render_pass(sizeof(clear_values) / sizeof(clear_values[0]), + clear_values, + framebuffer_ptr, + render_area, + renderpass_ptr, + VK_SUBPASS_CONTENTS_INLINE); + } { const uint32_t n_physical_devices(1); @@ -634,15 +669,21 @@ void App::init_dsgs() { std::shared_ptr new_dsg_ptr; - new_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr, - false, /* releaseable_sets */ - 1); /* n_sets */ + { + std::vector > new_dsg_info_ptr(1); + + new_dsg_info_ptr[0] = Anvil::DescriptorSetInfo::create(); + + new_dsg_info_ptr[0]->add_binding(0, /* in_binding */ + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, + 1, /* in_n_elements */ + VK_SHADER_STAGE_VERTEX_BIT); + + new_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr, + new_dsg_info_ptr, + false); /* in_releaseable_sets */ + } - new_dsg_ptr->add_binding (0, /* n_set */ - 0, /* binding */ - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, - 1, /* n_elements */ - VK_SHADER_STAGE_VERTEX_BIT); new_dsg_ptr->set_binding_item(0, /* n_set */ 0, /* binding_index */ Anvil::DescriptorSet::StorageBufferBindingElement(m_properties_buffer_ptrs[n_swapchain_image])); @@ -653,6 +694,7 @@ void App::init_dsgs() void App::init_events() { + /* Stub */ } void App::init_gfx_pipelines() @@ -664,62 +706,60 @@ void App::init_gfx_pipelines() n_pipeline < 2 /* ooo on, ooo off */; ++n_pipeline) { - bool is_ooo_disabled = (n_pipeline == 0); - Anvil::GraphicsPipelineID* pipeline_id_ptr = (is_ooo_disabled) ? &m_ooo_disabled_pipeline_id - : &m_ooo_enabled_pipeline_id; - - gfx_manager_ptr->add_regular_pipeline(false, /* disable_optimizations */ - false, /* allow_derivatives */ - m_renderpasses[0], - 0, /* subpass_id */ - *m_fs_entrypoint_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* gs_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tc_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* te_entrypoint */ - *m_vs_entrypoint_ptr, - pipeline_id_ptr); - - gfx_manager_ptr->add_vertex_attribute(*pipeline_id_ptr, - 0, /* location */ - VK_FORMAT_R32G32B32_SFLOAT, - 0, /* offset_in_bytes */ - sizeof(float) * 3, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX); - - gfx_manager_ptr->set_pipeline_dsg(*pipeline_id_ptr, - m_dsg_ptrs[0]); - - gfx_manager_ptr->set_input_assembly_properties(*pipeline_id_ptr, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST); - gfx_manager_ptr->set_rasterization_properties (*pipeline_id_ptr, - VK_POLYGON_MODE_FILL, - VK_CULL_MODE_BACK_BIT, - VK_FRONT_FACE_CLOCKWISE, - 4.0f); /* line_width */ - gfx_manager_ptr->toggle_depth_test (*pipeline_id_ptr, - true, /* should_enable */ - VK_COMPARE_OP_LESS); - gfx_manager_ptr->toggle_depth_writes (*pipeline_id_ptr, - true); - - if (!is_ooo_disabled) + bool is_ooo_disabled = (n_pipeline == 0); + Anvil::PipelineID* pipeline_id_ptr = (is_ooo_disabled) ? &m_ooo_disabled_pipeline_id + : &m_ooo_enabled_pipeline_id; + { - if (device_locked_ptr->is_extension_enabled("VK_AMD_rasterization_order") ) + auto pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ + false, /* in_allow_derivatives */ + m_renderpasses[0], + 0, /* in_subpass_id */ + *m_fs_entrypoint_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* in_gs_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* in_tc_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* in_te_entrypoint */ + *m_vs_entrypoint_ptr); + + pipeline_info_ptr->add_vertex_attribute(0, /* location */ + VK_FORMAT_R32G32B32_SFLOAT, + 0, /* offset_in_bytes */ + sizeof(float) * 3, /* stride_in_bytes */ + VK_VERTEX_INPUT_RATE_VERTEX); + + pipeline_info_ptr->set_dsg(m_dsg_ptrs[0]); + + pipeline_info_ptr->set_primitive_topology (VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST); + pipeline_info_ptr->set_rasterization_properties(VK_POLYGON_MODE_FILL, + VK_CULL_MODE_BACK_BIT, + VK_FRONT_FACE_CLOCKWISE, + 4.0f); /* line_width */ + pipeline_info_ptr->toggle_depth_test (true, /* should_enable */ + VK_COMPARE_OP_LESS); + pipeline_info_ptr->toggle_depth_writes (true); + + if (!is_ooo_disabled) { - gfx_manager_ptr->set_rasterization_order(*pipeline_id_ptr, - VK_RASTERIZATION_ORDER_RELAXED_AMD); + if (device_locked_ptr->is_extension_enabled("VK_AMD_rasterization_order") ) + { + pipeline_info_ptr->set_rasterization_order(VK_RASTERIZATION_ORDER_RELAXED_AMD); + } } - } - else - { - gfx_manager_ptr->set_rasterization_order(*pipeline_id_ptr, - VK_RASTERIZATION_ORDER_STRICT_AMD); + else + { + pipeline_info_ptr->set_rasterization_order(VK_RASTERIZATION_ORDER_STRICT_AMD); + } + + gfx_manager_ptr->add_pipeline(std::move(pipeline_info_ptr), + pipeline_id_ptr); } } } void App::init_images() { + std::shared_ptr device_locked_ptr(m_device_ptr); + m_depth_image_ptr = Anvil::Image::create_nonsparse(m_device_ptr, VK_IMAGE_TYPE_2D, VK_FORMAT_D32_SFLOAT, @@ -772,57 +812,52 @@ void App::init_renderpasses() std::shared_ptr renderpass_ptr; Anvil::SubPassID subpass_id; - /* Set up a renderpass instance first */ - renderpass_ptr = Anvil::RenderPass::create(m_device_ptr, - m_swapchain_ptr); - - renderpass_ptr->set_name_formatted("Renderpass for swapchain image [%d]", - n_swapchain_image); + { + std::unique_ptr renderpass_info_ptr(new Anvil::RenderPassInfo(m_device_ptr) ); - renderpass_ptr->add_color_attachment(m_swapchain_ptr->get_image_format(), - VK_SAMPLE_COUNT_1_BIT, - VK_ATTACHMENT_LOAD_OP_CLEAR, - VK_ATTACHMENT_STORE_OP_STORE, + renderpass_info_ptr->add_color_attachment(m_swapchain_ptr->get_image_format(), + VK_SAMPLE_COUNT_1_BIT, + VK_ATTACHMENT_LOAD_OP_CLEAR, + VK_ATTACHMENT_STORE_OP_STORE, #ifndef ENABLE_OFFSCREEN_RENDERING - VK_IMAGE_LAYOUT_UNDEFINED, - VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, + VK_IMAGE_LAYOUT_UNDEFINED, + VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, #else - VK_IMAGE_LAYOUT_GENERAL, - VK_IMAGE_LAYOUT_GENERAL, + VK_IMAGE_LAYOUT_GENERAL, + VK_IMAGE_LAYOUT_GENERAL, #endif - false, /* may_alias */ - &color_attachment_id); - - renderpass_ptr->add_depth_stencil_attachment(m_depth_image_ptr->get_image_format(), - VK_SAMPLE_COUNT_1_BIT, - VK_ATTACHMENT_LOAD_OP_CLEAR, - VK_ATTACHMENT_STORE_OP_STORE, - VK_ATTACHMENT_LOAD_OP_DONT_CARE, - VK_ATTACHMENT_STORE_OP_DONT_CARE, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, - false, /* may_alias */ - &depth_attachment_id); - - /* Define the only subpass we're going to use there */ - renderpass_ptr->add_subpass(*m_fs_entrypoint_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* gs_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tc_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* te_entrypoint */ - *m_vs_entrypoint_ptr, - &subpass_id, - m_general_pipeline_id); - - renderpass_ptr->add_subpass_color_attachment(subpass_id, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - color_attachment_id, - 0, /* location */ - nullptr); /* opt_attachment_resolve_id_ptr */ - - renderpass_ptr->add_subpass_depth_stencil_attachment(subpass_id, - depth_attachment_id, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); + false, /* may_alias */ + &color_attachment_id); + + renderpass_info_ptr->add_depth_stencil_attachment(m_depth_image_ptr->get_image_format(), + VK_SAMPLE_COUNT_1_BIT, + VK_ATTACHMENT_LOAD_OP_CLEAR, + VK_ATTACHMENT_STORE_OP_STORE, + VK_ATTACHMENT_LOAD_OP_DONT_CARE, + VK_ATTACHMENT_STORE_OP_DONT_CARE, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + false, /* may_alias */ + &depth_attachment_id); + + /* Define the only subpass we're going to use there */ + renderpass_info_ptr->add_subpass (&subpass_id); + renderpass_info_ptr->add_subpass_color_attachment (subpass_id, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + color_attachment_id, + 0, /* in_location */ + nullptr); /* in_opt_attachment_resolve_id_ptr */ + renderpass_info_ptr->add_subpass_depth_stencil_attachment(subpass_id, + depth_attachment_id, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); + + renderpass_ptr = Anvil::RenderPass::create(std::move(renderpass_info_ptr), + m_swapchain_ptr); + } + + renderpass_ptr->set_name_formatted("Renderpass for swapchain image [%d]", + n_swapchain_image); m_renderpasses.push_back(renderpass_ptr); @@ -833,20 +868,26 @@ void App::init_renderpasses() **/ if (m_general_pipeline_id == -1) { - std::shared_ptr gfx_manager_ptr = device_locked_ptr->get_graphics_pipeline_manager(); - - renderpass_ptr->get_subpass_graphics_pipeline_id(subpass_id, - &m_general_pipeline_id); - - gfx_manager_ptr->add_vertex_attribute(m_general_pipeline_id, - 0, /* location */ - VK_FORMAT_R32G32B32_SFLOAT, - 0, /* offset_in_bytes */ - sizeof(float) * 3, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX); - - gfx_manager_ptr->set_pipeline_dsg(m_general_pipeline_id, - m_dsg_ptrs[0]); + std::shared_ptr gfx_manager_ptr = device_locked_ptr->get_graphics_pipeline_manager (); + auto gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ + false, /* in_allow_derivatives */ + renderpass_ptr, + subpass_id, + *m_fs_entrypoint_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* in_gs_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* in_tc_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* in_te_entrypoint */ + *m_vs_entrypoint_ptr); + + gfx_pipeline_info_ptr->add_vertex_attribute(0, /* location */ + VK_FORMAT_R32G32B32_SFLOAT, + 0, /* offset_in_bytes */ + sizeof(float) * 3, /* stride_in_bytes */ + VK_VERTEX_INPUT_RATE_VERTEX); + gfx_pipeline_info_ptr->set_dsg (m_dsg_ptrs[0]); + + gfx_manager_ptr->add_pipeline(std::move(gfx_pipeline_info_ptr), + &m_general_pipeline_id); } /* Set up a framebuffer we will use for the renderpass */ @@ -871,7 +912,22 @@ void App::init_renderpasses() void App::init_semaphores() { std::shared_ptr base_device_locked_ptr(m_device_ptr); - uint32_t n_physical_devices (1); + uint32_t n_physical_devices (0); + + switch (base_device_locked_ptr->get_type() ) + { + case Anvil::DEVICE_TYPE_SINGLE_GPU: + { + n_physical_devices = 1; + + break; + } + + default: + { + anvil_assert(false); + } + } for (uint32_t n_swapchain_image = 0; n_swapchain_image < m_n_swapchain_images; @@ -952,7 +1008,6 @@ void App::init_swapchain() static const VkFormat swapchain_format (VK_FORMAT_B8G8R8A8_UNORM); static const VkPresentModeKHR swapchain_present_mode(VK_PRESENT_MODE_FIFO_KHR); static const VkImageUsageFlags swapchain_usage (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT); - std::shared_ptr sgpu_device_locked_ptr(std::dynamic_pointer_cast(m_device_ptr.lock() ) ); m_rendering_surface_ptr = Anvil::RenderingSurface::create(m_instance_ptr, m_device_ptr, @@ -961,26 +1016,39 @@ void App::init_swapchain() m_rendering_surface_ptr->set_name("Main rendering surface"); - m_swapchain_ptr = sgpu_device_locked_ptr->create_swapchain(m_rendering_surface_ptr, - m_window_ptr, - swapchain_format, - swapchain_present_mode, - swapchain_usage, - m_n_swapchain_images); + switch (device_locked_ptr->get_type() ) + { + case Anvil::DEVICE_TYPE_SINGLE_GPU: + { + std::shared_ptr sgpu_device_locked_ptr(std::dynamic_pointer_cast(device_locked_ptr) ); - m_swapchain_ptr->set_name("Main swapchain"); + m_swapchain_ptr = sgpu_device_locked_ptr->create_swapchain(m_rendering_surface_ptr, + m_window_ptr, + swapchain_format, + swapchain_present_mode, + swapchain_usage, + m_n_swapchain_images); - /* Cache the queue we are going to use for presentation */ - const std::vector* present_queue_fams_ptr = nullptr; + /* Cache the queue we are going to use for presentation */ + const std::vector* present_queue_fams_ptr = nullptr; - if (!m_rendering_surface_ptr->get_queue_families_with_present_support(sgpu_device_locked_ptr->get_physical_device(), - &present_queue_fams_ptr) ) - { - anvil_assert_fail(); - } + if (!m_rendering_surface_ptr->get_queue_families_with_present_support(sgpu_device_locked_ptr->get_physical_device(), + &present_queue_fams_ptr) ) + { + anvil_assert_fail(); + } + + m_present_queue_ptr = device_locked_ptr->get_queue(present_queue_fams_ptr->at(0), + 0); /* in_n_queue */ - m_present_queue_ptr = device_locked_ptr->get_queue(present_queue_fams_ptr->at(0), - 0); /* in_n_queue */ + break; + } + + default: + { + anvil_assert(false); + } + } } void App::init_window() @@ -1009,8 +1077,7 @@ void App::init_window() std::bind(&App::on_keypress_event, this, std::placeholders::_1), - this - ); + this); } void App::init_vulkan() @@ -1024,26 +1091,29 @@ void App::init_vulkan() std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, - std::placeholders::_4) ); + std::placeholders::_4), #else - nullptr); + Anvil::DebugCallbackFunction(), #endif + false); /* in_mt_safe */ /* Determine which extensions we need to request for */ std::shared_ptr physical_device_locked_ptr(m_instance_ptr->get_physical_device(0) ); - /* Create a Vulkan device */ - m_device_ptr = Anvil::SGPUDevice::create(physical_device_locked_ptr, - Anvil::DeviceExtensionConfiguration(), - std::vector(), /* layers */ - false, /* transient_command_buffer_allocs_only */ - false); /* support_resettable_command_buffers */ + { + /* Create a Vulkan device */ + m_device_ptr = Anvil::SGPUDevice::create(physical_device_locked_ptr, + Anvil::DeviceExtensionConfiguration(), + std::vector(), /* layers */ + false, /* transient_command_buffer_allocs_only */ + false); /* support_resettable_command_buffers */ + } } void App::on_keypress_event(Anvil::CallbackArgument* callback_data_raw_ptr) { - Anvil::OnKeypressReleasedCallbackArgument* callback_data_ptr = static_cast(callback_data_raw_ptr); - std::shared_ptr device_locked_ptr = m_device_ptr.lock(); + auto callback_data_ptr = static_cast(callback_data_raw_ptr); + auto device_locked_ptr = m_device_ptr.lock(); #ifndef ENABLE_OFFSCREEN_RENDERING { diff --git a/examples/PushConstants/include/app.h b/examples/PushConstants/include/app.h index 6235ec22..ad92e06c 100644 --- a/examples/PushConstants/include/app.h +++ b/examples/PushConstants/include/app.h @@ -54,10 +54,10 @@ class App void init_vulkan (); void draw_frame (); - VkBool32 on_validation_callback(VkDebugReportFlagsEXT message_flags, - VkDebugReportObjectTypeEXT object_type, - const char* layer_prefix, - const char* message); + VkBool32 on_validation_callback(VkDebugReportFlagsEXT in_message_flags, + VkDebugReportObjectTypeEXT in_object_type, + const char* in_layer_prefix, + const char* in_message); void get_luminance_data(std::shared_ptr* out_result_ptr, uint32_t* out_result_size_ptr) const; @@ -92,7 +92,7 @@ class App std::shared_ptr m_fbos[N_SWAPCHAIN_IMAGES]; std::shared_ptr m_fs_ptr; std::shared_ptr m_mesh_data_buffer_ptr; - Anvil::GraphicsPipelineID m_pipeline_id; + Anvil::PipelineID m_pipeline_id; std::shared_ptr m_renderpass_ptr; std::shared_ptr m_vs_ptr; diff --git a/examples/PushConstants/src/app.cpp b/examples/PushConstants/src/app.cpp index d69bc033..bc199451 100644 --- a/examples/PushConstants/src/app.cpp +++ b/examples/PushConstants/src/app.cpp @@ -26,13 +26,16 @@ /* Uncomment the #define below to enable validation */ // #define ENABLE_VALIDATION + #include #include #include "config.h" #include "misc/glsl_to_spirv.h" +#include "misc/graphics_pipeline_info.h" #include "misc/io.h" #include "misc/memory_allocator.h" #include "misc/object_tracker.h" +#include "misc/render_pass_info.h" #include "misc/time.h" #include "misc/window_factory.h" #include "wrappers/buffer.h" @@ -527,7 +530,7 @@ void App::init_command_buffers() const uint32_t data_ub_offset = static_cast(m_ub_data_size_per_swapchain_image * n_command_buffer); std::shared_ptr ds_ptr = m_dsg_ptr->get_descriptor_set (0 /* n_set */); const VkDeviceSize mesh_data_buffer_offset = 0; - std::shared_ptr pipeline_layout_ptr = gfx_pipeline_manager_ptr->get_graphics_pipeline_layout(m_pipeline_id); + std::shared_ptr pipeline_layout_ptr = gfx_pipeline_manager_ptr->get_pipeline_layout(m_pipeline_id); cmd_buffer_ptr->record_bind_pipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, m_pipeline_id); @@ -567,15 +570,21 @@ void App::init_command_buffers() void App::init_dsgs() { - m_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr, - false, /* releaseable_sets */ - 1 /* n_sets */); + { + auto dsg_info_ptrs = std::vector >(1); + + dsg_info_ptrs[0] = Anvil::DescriptorSetInfo::create(); + + dsg_info_ptrs[0]->add_binding(0, /* n_binding */ + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, + 1, /* n_elements */ + VK_SHADER_STAGE_VERTEX_BIT); + + m_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr, + dsg_info_ptrs, + false); /* releaseable_sets */ + } - m_dsg_ptr->add_binding (0, /* n_set */ - 0, /* n_binding */ - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, - 1, /* n_elements */ - VK_SHADER_STAGE_VERTEX_BIT); m_dsg_ptr->set_binding_item(0, /* n_set */ 0, /* n_binding */ Anvil::DescriptorSet::DynamicUniformBufferBindingElement(m_data_buffer_ptr, @@ -585,6 +594,7 @@ void App::init_dsgs() void App::init_events() { + /* Stub */ } void App::init_framebuffers() @@ -620,100 +630,93 @@ void App::init_framebuffers() void App::init_gfx_pipelines() { std::shared_ptr device_locked_ptr (m_device_ptr); + std::unique_ptr gfx_pipeline_info_ptr; std::shared_ptr gfx_pipeline_manager_ptr(device_locked_ptr->get_graphics_pipeline_manager() ); - bool result; /* Create a renderpass for the pipeline */ Anvil::RenderPassAttachmentID render_pass_color_attachment_id; Anvil::SubPassID render_pass_subpass_id; - m_renderpass_ptr = Anvil::RenderPass::create(m_device_ptr, - m_swapchain_ptr); - - m_renderpass_ptr->set_name("Main renderpass"); + { + std::unique_ptr render_pass_info_ptr(new Anvil::RenderPassInfo(m_device_ptr) ); - result = m_renderpass_ptr->add_color_attachment(m_swapchain_ptr->get_image_format(), - VK_SAMPLE_COUNT_1_BIT, - VK_ATTACHMENT_LOAD_OP_CLEAR, - VK_ATTACHMENT_STORE_OP_STORE, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + render_pass_info_ptr->add_color_attachment(m_swapchain_ptr->get_image_format(), + VK_SAMPLE_COUNT_1_BIT, + VK_ATTACHMENT_LOAD_OP_CLEAR, + VK_ATTACHMENT_STORE_OP_STORE, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, #ifdef ENABLE_OFFSCREEN_RENDERING - VK_IMAGE_LAYOUT_GENERAL, + VK_IMAGE_LAYOUT_GENERAL, #else - VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, + VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, #endif - false, /* may_alias */ - &render_pass_color_attachment_id); - anvil_assert(result); - - - result = m_renderpass_ptr->add_subpass(*m_fs_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader */ - *m_vs_ptr, - &render_pass_subpass_id); - anvil_assert(result); - - - result = m_renderpass_ptr->get_subpass_graphics_pipeline_id(render_pass_subpass_id, - &m_pipeline_id); - anvil_assert(result); - - - result = m_renderpass_ptr->add_subpass_color_attachment(render_pass_subpass_id, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - render_pass_color_attachment_id, - 0, /* location */ - nullptr); /* opt_attachment_resolve_id_ptr */ - anvil_assert(result); - - - result = gfx_pipeline_manager_ptr->set_pipeline_dsg (m_pipeline_id, - m_dsg_ptr); - result &= gfx_pipeline_manager_ptr->attach_push_constant_range_to_pipeline(m_pipeline_id, - 0, /* offset */ - sizeof(float) * 4 /* vec4 */ * 4 /* vec4 values */, - VK_SHADER_STAGE_FRAGMENT_BIT | VK_SHADER_STAGE_VERTEX_BIT); - - anvil_assert(result); - - - gfx_pipeline_manager_ptr->set_rasterization_properties (m_pipeline_id, - VK_POLYGON_MODE_FILL, - VK_CULL_MODE_NONE, - VK_FRONT_FACE_COUNTER_CLOCKWISE, - 1.0f); /* line_width */ - gfx_pipeline_manager_ptr->set_color_blend_attachment_properties(m_pipeline_id, - 0, /* attachment_id */ - true, /* blending_enabled */ - VK_BLEND_OP_ADD, - VK_BLEND_OP_ADD, - VK_BLEND_FACTOR_SRC_ALPHA, - VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, - VK_BLEND_FACTOR_SRC_ALPHA, - VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, - VK_COLOR_COMPONENT_A_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_R_BIT); - - result = gfx_pipeline_manager_ptr->add_vertex_attribute(m_pipeline_id, - 0, /* location */ - get_mesh_data_position_format(), - get_mesh_data_position_start_offset(), - get_mesh_data_position_stride(), - VK_VERTEX_INPUT_RATE_VERTEX); - anvil_assert(result); - - result = gfx_pipeline_manager_ptr->add_vertex_attribute(m_pipeline_id, - 1, /* location */ - get_mesh_data_color_format(), - get_mesh_data_color_start_offset(), - get_mesh_data_color_stride(), - VK_VERTEX_INPUT_RATE_VERTEX); - anvil_assert(result); + false, /* may_alias */ + &render_pass_color_attachment_id); + + + render_pass_info_ptr->add_subpass (&render_pass_subpass_id); + render_pass_info_ptr->add_subpass_color_attachment(render_pass_subpass_id, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + render_pass_color_attachment_id, + 0, /* location */ + nullptr); /* opt_attachment_resolve_id_ptr */ + + + m_renderpass_ptr = Anvil::RenderPass::create(std::move(render_pass_info_ptr), + m_swapchain_ptr); + } + + m_renderpass_ptr->set_name("Main renderpass"); + + gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ + false, /* in_allow_derivatives */ + m_renderpass_ptr, + render_pass_subpass_id, + *m_fs_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* in_geometry_shader */ + Anvil::ShaderModuleStageEntryPoint(), /* in_tess_control_shader */ + Anvil::ShaderModuleStageEntryPoint(), /* in_tess_evaluation_shader */ + *m_vs_ptr); + + + + gfx_pipeline_info_ptr->set_dsg (m_dsg_ptr); + gfx_pipeline_info_ptr->attach_push_constant_range (0, /* in_offset */ + sizeof(float) * 4 /* vec4 */ * 4 /* vec4 values */, + VK_SHADER_STAGE_FRAGMENT_BIT | VK_SHADER_STAGE_VERTEX_BIT); + gfx_pipeline_info_ptr->set_rasterization_properties (VK_POLYGON_MODE_FILL, + VK_CULL_MODE_NONE, + VK_FRONT_FACE_COUNTER_CLOCKWISE, + 1.0f); /* in_line_width */ + gfx_pipeline_info_ptr->set_color_blend_attachment_properties(0, /* in_attachment_id */ + true, /* in_blending_enabled */ + VK_BLEND_OP_ADD, + VK_BLEND_OP_ADD, + VK_BLEND_FACTOR_SRC_ALPHA, + VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, + VK_BLEND_FACTOR_SRC_ALPHA, + VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, + VK_COLOR_COMPONENT_A_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_R_BIT); + + gfx_pipeline_info_ptr->add_vertex_attribute(0, /* in_location */ + get_mesh_data_position_format(), + get_mesh_data_position_start_offset(), + get_mesh_data_position_stride(), + VK_VERTEX_INPUT_RATE_VERTEX); + gfx_pipeline_info_ptr->add_vertex_attribute(1, /* location */ + get_mesh_data_color_format (), + get_mesh_data_color_start_offset(), + get_mesh_data_color_stride (), + VK_VERTEX_INPUT_RATE_VERTEX); + + + gfx_pipeline_manager_ptr->add_pipeline(std::move(gfx_pipeline_info_ptr), + &m_pipeline_id); } void App::init_images() { + /* Stub */ } void App::init_semaphores() @@ -838,22 +841,25 @@ void App::init_window() void App::init_vulkan() { /* Create a Vulkan instance */ - m_instance_ptr = Anvil::Instance::create(APP_NAME, /* app_name */ - APP_NAME, /* engine_name */ + m_instance_ptr = Anvil::Instance::create(APP_NAME, /* in_app_name */ + APP_NAME, /* in_engine_name */ #ifdef ENABLE_VALIDATION std::bind(&App::on_validation_callback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, - std::placeholders::_4) ); - + std::placeholders::_4), #else - nullptr); + Anvil::DebugCallbackFunction(), #endif + false); /* in_mt_safe */ m_physical_device_ptr = m_instance_ptr->get_physical_device(0); + /* Determine which extensions we need to request for */ + std::shared_ptr physical_device_locked_ptr(m_instance_ptr->get_physical_device(0) ); + /* Create a Vulkan device */ m_device_ptr = Anvil::SGPUDevice::create(m_physical_device_ptr, Anvil::DeviceExtensionConfiguration(), @@ -862,16 +868,16 @@ void App::init_vulkan() false); /* support_resettable_command_buffers */ } -VkBool32 App::on_validation_callback(VkDebugReportFlagsEXT message_flags, - VkDebugReportObjectTypeEXT object_type, - const char* layer_prefix, - const char* message) +VkBool32 App::on_validation_callback(VkDebugReportFlagsEXT in_message_flags, + VkDebugReportObjectTypeEXT in_object_type, + const char* in_layer_prefix, + const char* in_message) { - if ((message_flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) != 0) + if ((in_message_flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) != 0) { fprintf(stderr, "[!] %s\n", - message); + in_message); } return false; diff --git a/include/misc/base_pipeline_info.h b/include/misc/base_pipeline_info.h new file mode 100644 index 00000000..028210f6 --- /dev/null +++ b/include/misc/base_pipeline_info.h @@ -0,0 +1,148 @@ +// +// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef ANVIL_BASE_PIPELINE_INFO_H +#define ANVIL_BASE_PIPELINE_INFO_H + +#include "misc/mt_safety.h" +#include "misc/types.h" + +namespace Anvil +{ + class BasePipelineInfo + { + public: + /* Public functions */ + + virtual ~BasePipelineInfo(); + + bool allows_derivatives() const + { + return m_allow_derivatives; + } + + bool attach_push_constant_range(uint32_t in_offset, + uint32_t in_size, + VkShaderStageFlags in_stages); + + /* Returns != UINT32_MAX if this pipeline is a derivative pipeline, or UINT32_MAX otherwise. */ + Anvil::PipelineID get_base_pipeline_id() const + { + return m_base_pipeline_id; + } + + std::shared_ptr get_dsg() const + { + return m_dsg_ptr; + } + + const PushConstantRanges& get_push_constant_ranges() const + { + return m_push_constant_ranges; + } + + /** Returns shader stage information for each stage, as specified at creation time */ + bool get_shader_stage_properties(Anvil::ShaderStage in_shader_stage, + const ShaderModuleStageEntryPoint** out_opt_result_ptr_ptr) const; + + bool get_specialization_constants(Anvil::ShaderStage in_shader_stage, + const SpecializationConstants** out_opt_spec_constants_ptr, + const unsigned char** out_opt_spec_constants_data_buffer_ptr) const; + + bool has_optimizations_disabled() const + { + return m_disable_optimizations; + } + + bool is_proxy() const + { + return m_is_proxy; + } + + void set_dsg(std::shared_ptr in_dsg_ptr); + + protected: + /* Protected functions */ + + BasePipelineInfo(); + + /** Adds a new specialization constant. + * + * @param in_shader_stage Shader stage, with which the new specialization constant should be + * associated. + * @param in_constant_id ID of the specialization constant to assign data for. + * @param in_n_data_bytes Number of bytes under @param in_data_ptr to assign to the specialization constant. + * @param in_data_ptr A buffer holding the data to be assigned to the constant. Must hold at least + * @param in_n_data_bytes bytes that will be read by the function. + * + * @return true if successful, false otherwise. + **/ + virtual bool add_specialization_constant(Anvil::ShaderStage in_shader_stage, + uint32_t in_constant_id, + uint32_t in_n_data_bytes, + const void* in_data_ptr); + + void init_derivative_pipeline_info(bool in_disable_optimizations, + bool in_allow_derivatives, + uint32_t in_n_shader_module_stage_entrypoints, + const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, + Anvil::PipelineID in_base_pipeline_id, + std::shared_ptr in_opt_dsg_ptr = std::shared_ptr() ); + void init_proxy_pipeline_info (); + void init_regular_pipeline_info (bool in_disable_optimizations, + bool in_allow_derivatives, + uint32_t in_n_shader_module_stage_entrypoints, + const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, + std::shared_ptr in_opt_dsg_ptr = std::shared_ptr() ); + + void copy_state_from(const BasePipelineInfo* in_src_pipeline_info_ptr); + + + /* Protected type definitions */ + typedef std::map ShaderStageToSpecializationConstantsMap; + + /* Protected variables */ + Anvil::PipelineID m_base_pipeline_id; + + std::shared_ptr m_dsg_ptr; + PushConstantRanges m_push_constant_ranges; + std::vector m_specialization_constants_data_buffer; + ShaderStageToSpecializationConstantsMap m_specialization_constants_map; + + bool m_allow_derivatives; + bool m_disable_optimizations; + bool m_is_proxy; + std::map m_shader_stages; + + private: + /* Private type definitions */ + + /* Private functions */ + void init_shader_modules(uint32_t in_n_shader_module_stage_entrypoints, + const Anvil::ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs); + + /* Private variables */ + }; + +}; + +#endif /* ANVIL_BASE_PIPELINE_INFO_H */ + diff --git a/include/misc/base_pipeline_manager.h b/include/misc/base_pipeline_manager.h index 96b87f35..e1a9373d 100644 --- a/include/misc/base_pipeline_manager.h +++ b/include/misc/base_pipeline_manager.h @@ -37,26 +37,40 @@ #ifndef MISC_BASE_PIPELINE_MANAGER_H #define MISC_BASE_PIPELINE_MANAGER_H +#include "misc/base_pipeline_info.h" +#include "misc/callbacks.h" #include "misc/debug.h" +#include "misc/mt_safety.h" #include "misc/types.h" #include #include namespace Anvil { - - class BasePipelineManager + enum BasePipelineManagerCallbackID { - public: - /* Public type definitions */ + /* Call-back issued whenever a new pipeline is created. + * + * NOTE: Only base pipeline-level properties are available for querying at the time of the call-back! + * + * callback_arg: OnNewPipelineCreatedCallbackData instance. + */ + BASE_PIPELINE_MANAGER_CALLBACK_ID_ON_NEW_PIPELINE_CREATED, - typedef uint32_t ShaderIndex; + /* Always last */ + BASE_PIPELINE_MANAGER_CALLBACK_ID_COUNT + }; + class BasePipelineManager : public CallbacksSupportProvider, + public MTSafetySupportProvider + { + public: /* Public functions */ /** Constructor. Initializes base layer of a pipeline manager. * * @param in_device_ptr Device to use. + * @param in_mt_safe True if more than one thread at a time is going to be issuing calls against the pipeline manager. * @param in_use_pipeline_cache true if a pipeline cache should be used to spawn new pipeline objects. * What pipeline cache ends up being used depends on @param in_pipeline_cache_to_reuse_ptr - * if a nullptr object is passed via this argument, a new pipeline cache instance will @@ -65,418 +79,127 @@ namespace Anvil * @param in_pipeline_cache_to_reuse_ptr Please see above. **/ explicit BasePipelineManager(std::weak_ptr in_device_ptr, - bool in_use_pipeline_cache = false, - std::shared_ptr in_pipeline_cache_to_reuse_ptr = std::shared_ptr() ); + bool in_mt_safe, + bool in_use_pipeline_cache, + std::shared_ptr in_pipeline_cache_to_reuse_ptr); /** Destructor. Releases internally managed objects. */ virtual ~BasePipelineManager(); - /** Appends a new push constant range description to a pipeline object. The actual data needs to be specified - * when creating a command buffer. - * - * The function marks the specified pipeline as dirty, meaning it will be re-baked at the next get_() call time. - * - * @param in_pipeline_id ID of the pipeline to append the push constant range to. Must not describe a proxy - * pipeline. - * @param in_offset Start offset, at which the push constant data will start. - * @param in_size Size of the push constant data. - * @param in_stages Pipeline stages the push constant data should be accessible to. - * - * @return true if successful, false otherwise. - **/ - bool attach_push_constant_range_to_pipeline(PipelineID in_pipeline_id, - uint32_t in_offset, - uint32_t in_size, - VkShaderStageFlags in_stages); + /** TODO */ + bool add_pipeline(std::unique_ptr in_pipeline_info_ptr, + PipelineID* out_pipeline_id_ptr); + /** TODO */ virtual bool bake() = 0; - /** Assigns DSes encapsulated in the user-specified DSG to the pipeline. This is later used to obtain - * a pipeline layout, which is then specified at pipeline creation time. - * - * This function marks the pipeline as dirty, meaning it will be re-baked at the next get_*() call. + /** Deletes an existing pipeline. * - * @param in_pipeline_id ID of the compute pipeline to attach the descriptor sets defined by the group to. - * @param in_dsg_ptr Descriptor set group instance, whose descriptor sets should be appended. + * @param in_pipeline_id ID of a pipeline to delete. * * @return true if successful, false otherwise. **/ - bool set_pipeline_dsg(PipelineID in_pipeline_id, - std::shared_ptr in_dsg_ptr); + bool delete_pipeline(PipelineID in_pipeline_id); - /** Retrieves general properties of a pipeline. + /** Retrieves a VkPipeline instance associated with the specified pipeline ID. * - * @param out_opt_has_optimizations_disabled_ptr If not NULL, deref will be set to true if the pipeline - * has been created with enabled optimizations, or false - * if optimizations have been explicitly disabled. - * @param out_opt_allows_derivatives_ptr If not NULL, deref will be set to true if the pipeline - * has been created with support for derivative pipelines, - * or false otherwise. - * @param out_opt_is_a_derivative_ptr If not NULL, deref will be set to true if the specified - * pipeline is a derivative pipeline, or to false otherwise. + * The function will bake a pipeline object (and, possibly, a pipeline layout object, too) if + * the specified pipeline is marked as dirty. * - * @return true if successful, false otherwise. - */ - bool get_general_pipeline_properties(PipelineID in_pipeline_id, - bool* out_opt_has_optimizations_disabled_ptr, - bool* out_opt_allows_derivatives_ptr, - bool* out_opt_is_a_derivative_ptr) const; + * @param in_pipeline_id ID of the pipeline to return the raw Vulkan pipeline handle for. Must not + * describe a proxy pipeline. + * + * @return VkPipeline handle or nullptr if the function failed. + **/ + VkPipeline get_pipeline(PipelineID in_pipeline_id); - /** Returns the number of created pipelines */ - uint32_t get_n_pipelines() const - { - return static_cast(m_pipelines.size() ); - } + const Anvil::BasePipelineInfo* get_pipeline_info(PipelineID in_pipeline_id) const; - /** Returns ID of a pipeline at user-specified index. + /** Retrieves a PipelineLayout instance associated with the specified pipeline ID. * - * @param in_n_pipeline Index of the pipeline to return ID of. - * @param out_pipeline_id_ptr TODO + * The function will bake a pipeline object (and, possibly, a pipeline layout object, too) if + * the specified pipeline is marked as dirty. * - * @return true if successful, false otherwise. + * @param in_pipeline_id ID of the pipeline to return the wrapper instance for. + * Must not describe a proxy pipeline. + * + * @return Ptr to a PipelineLayout instance or nullptr if the function failed. **/ - bool get_pipeline_id_at_index(uint32_t in_n_pipeline, - PipelineID* out_pipeline_id_ptr) const; + std::shared_ptr get_pipeline_layout(PipelineID in_pipeline_id); - /** Returns shader stage information for each stage, as specified at creation time */ - bool get_shader_stage_properties(PipelineID in_pipeline_id, - Anvil::ShaderStage in_shader_stage, - ShaderModuleStageEntryPoint* out_opt_result_ptr) const; + /** Returns various post-compile information about compute and graphics pipeline shaders like + * compiled binary or optionally shader disassembly. + * Requires support for VK_AMD_shader_info extension. + * + * @param in_pipeline_id ID of the pipeline. + * @param in_shader_stage The shader stage to collect post-compile information for. + * @param in_info_type the type of information to collect - compiled binary code or shader disassembly. + * @param out_data_ptr pointer to a vector of bytes where the post-compile information + * is going to be stored. Pointer must be null. If the vector is empty + * it is going to be resized to match the size required to store + * the post-compile information. + * + * @return true if successful and *out_data_ptr has been updated to store the data returned by the + * device, false otherwise. + **/ + bool get_shader_info(PipelineID in_pipeline_id, + Anvil::ShaderStage in_shader_stage, + Anvil::ShaderInfoType in_info_type, + std::vector* out_data_ptr); - /** By default, a pipeline is bakeable which means it may be baked even when the pipeline manager is - * requested to provide a Vulkan pipeline handle for another pipeline. In such cases, the manager - * will try to bake Vulkan pipelines for all pipelines marked as dirty, which - in cases like when - * we are dealing with a graphics pipeline, where the pipeline stage resources, defined in shaders, - * need to be paired with actual descriptors at baking time - can result in dire crashes. + /** Returns post-compile GPU statistics about compute and graphics pipeline shaders like GPU register usage. + * Requires support for VK_AMD_shader_info extension. * - * Therefore, some manager users may mark certain pipelines as unbakeable and defer baking as long - * as needed. This needs to be done *explicitly*. + * @param in_pipeline_id ID of the pipeline. + * @param in_shader_stage The shader stage to collect post-compile information for. + * @param out_shader_statistics_ptr Pointer to VkShaderStatisticsInfoAMD struct to be filled in + * with statistics about requested shader stage. + * Pointer cannot be null. + * + * @return true if successful, false otherwise. **/ - bool set_pipeline_bakeability(PipelineID in_pipeline_id, - bool in_bakeable); + bool get_shader_statistics(PipelineID in_pipeline_id, + Anvil::ShaderStage in_shader_stage, + VkShaderStatisticsInfoAMD* out_shader_statistics_ptr); protected: /* Protected type declarations */ - struct SpecializationConstant - { - uint32_t constant_id; - uint32_t n_bytes; - uint32_t start_offset; - - /** Dummy constructor. Should only be used by STL containers. */ - SpecializationConstant() - { - constant_id = UINT32_MAX; - n_bytes = UINT32_MAX; - start_offset = UINT32_MAX; - } - - /** Constructor. - * - * @param in_constant_id Specialization constant ID. - * @param in_n_bytes Number of bytes consumed by the constant. - * @param in_start_offset Start offset, at which the constant data starts. - */ - SpecializationConstant(uint32_t in_constant_id, - uint32_t in_n_bytes, - uint32_t in_start_offset) - { - constant_id = in_constant_id; - n_bytes = in_n_bytes; - start_offset = in_start_offset; - } - }; - - typedef std::vector SpecializationConstants; - typedef std::map ShaderIndexToSpecializationConstantsMap; /** Internal pipeline object descriptor */ - typedef struct Pipeline + typedef struct Pipeline : public MTSafetySupportProvider { - VkPipeline base_pipeline; - std::shared_ptr base_pipeline_ptr; - std::weak_ptr device_ptr; - - std::shared_ptr dsg_ptr; - PushConstantRanges push_constant_ranges; - std::vector specialization_constant_data_buffer; - ShaderIndexToSpecializationConstantsMap specialization_constants_map; - - std::vector shader_stages; - - bool layout_dirty; - std::shared_ptr layout_ptr; - - bool allow_derivatives; - VkPipeline baked_pipeline; - bool dirty; - bool disable_optimizations; - bool is_bakeable; - bool is_derivative; - bool is_proxy; - - /** Stores the specified shader modules and associates an empty specialization constant map for each - * shader. - * - * @param in_n_shader_module_stage_entrypoints Number of shader module stage entrypoint descriptors available under - * @param in_shader_module_stage_entrypoint_ptrs. Must be >= 1. - * @param in_shader_module_stage_entrypoint_ptrs Array of shader module stage entrypoint descriptors. Must hold - * @param in_n_shader_module_stage_entrypoints elements. Must not be nullptr. - **/ - void init_shader_modules(uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs) - { - shader_stages.reserve(in_n_shader_module_stage_entrypoints); - - for (uint32_t n_shader_module_stage_entrypoint = 0; - n_shader_module_stage_entrypoint < in_n_shader_module_stage_entrypoints; - ++n_shader_module_stage_entrypoint) - { - shader_stages.push_back(in_shader_module_stage_entrypoint_ptrs[n_shader_module_stage_entrypoint]); - - specialization_constants_map[n_shader_module_stage_entrypoint] = SpecializationConstants(); - } - } - - /** Releases pipeline & pipeline layout instances **/ - void release_vulkan_objects(); - - /** Constructor. Should be used to initialize a derivative pipeline object from an existing - * pipeline object managed by the pipeline manager. - * - * @param in_device_ptr Device to use. - * @param in_disable_optimizations If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT flag. - * @param in_allow_derivatives If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT flag. - * @param in_base_pipeline_ptr Pointer to the internal Pipeline descriptor. Must not be nullptr. - * Must not refer to a proxy pipeline. - * @param in_n_shader_module_stage_entrypoints Number of shader module stage entrypoint descriptors available under - * @param in_shader_module_stage_entrypoint_ptrs. Must be >= 1. - * @param in_shader_module_stage_entrypoint_ptrs Array of shader module stage entrypoint descriptors. Must hold - * @param in_n_shader_module_stage_entrypoints elements. Must not be nullptr. - **/ - Pipeline(std::weak_ptr in_device_ptr, - bool in_disable_optimizations, - bool in_allow_derivatives, - std::shared_ptr in_base_pipeline_ptr, - uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs) - { - allow_derivatives = in_allow_derivatives; - baked_pipeline = VK_NULL_HANDLE; - base_pipeline = VK_NULL_HANDLE; - base_pipeline_ptr = in_base_pipeline_ptr; - device_ptr = in_device_ptr; - dirty = true; - disable_optimizations = in_disable_optimizations; - is_bakeable = true; - is_derivative = true; - is_proxy = false; - layout_dirty = true; - - init_shader_modules(in_n_shader_module_stage_entrypoints, - in_shader_module_stage_entrypoint_ptrs); - - anvil_assert(!base_pipeline_ptr->is_proxy); - } - - /** Constructor. Should be used to initialize a derivative pipeline object from an existing - * raw Vulkan pipeline handle. - * - * @param in_device_ptr Device to use. - * @param in_disable_optimizations If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT flag. - * @param in_allow_derivatives If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT flag. - * @param in_base_pipeline Vulkan Pipeline handle. - * @param in_n_shader_module_stage_entrypoints Number of shader module stage entrypoint descriptors available under - * @param in_shader_module_stage_entrypoint_ptrs. Must be >= 1. - * @param in_shader_module_stage_entrypoint_ptrs Array of shader module stage entrypoint descriptors. Must hold - * @param in_n_shader_module_stage_entrypoints elements. Must not be nullptr. - **/ - Pipeline(std::weak_ptr in_device_ptr, - bool in_disable_optimizations, - bool in_allow_derivatives, - VkPipeline in_base_pipeline, - uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs) + VkPipeline baked_pipeline; + std::weak_ptr device_ptr; + std::shared_ptr layout_ptr; + std::unique_ptr pipeline_info_ptr; + + Pipeline(std::weak_ptr in_device_ptr, + std::unique_ptr in_pipeline_info_ptr, + bool in_mt_safe) + :MTSafetySupportProvider(in_mt_safe) { - allow_derivatives = in_allow_derivatives; - baked_pipeline = VK_NULL_HANDLE; - base_pipeline = in_base_pipeline; - device_ptr = in_device_ptr; - dirty = true; - disable_optimizations = in_disable_optimizations; - is_bakeable = true; - is_derivative = true; - is_proxy = false; - layout_dirty = true; - - init_shader_modules(in_n_shader_module_stage_entrypoints, - in_shader_module_stage_entrypoint_ptrs); - } - - /** Constructor. Should be used to initialize a regular pipeline object. - * - * @param in_device_ptr Device to use. - * @param in_disable_optimizations If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT flag. - * @param in_allow_derivatives If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT flag. - * @param in_n_shader_module_stage_entrypoints Number of shader module stage entrypoint descriptors available under - * @param in_shader_module_stage_entrypoint_ptrs. Must be >= 1. - * @param in_shader_module_stage_entrypoint_ptrs Array of shader module stage entrypoint descriptors. Must hold - * @param in_n_shader_module_stage_entrypoints elements. Must not be nullptr. - * @param in_is_proxy true if the created pipeline is a proxy pipeline; false otherwise. - * - **/ - Pipeline(std::weak_ptr in_device_ptr, - bool in_disable_optimizations, - bool in_allow_derivatives, - uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, - bool in_is_proxy) - { - allow_derivatives = in_allow_derivatives; - baked_pipeline = VK_NULL_HANDLE; - base_pipeline = VK_NULL_HANDLE; - device_ptr = in_device_ptr; - dirty = true; - disable_optimizations = in_disable_optimizations; - is_bakeable = true; - is_derivative = false; - is_proxy = in_is_proxy; - layout_dirty = true; - - init_shader_modules(in_n_shader_module_stage_entrypoints, - in_shader_module_stage_entrypoint_ptrs); - - anvil_assert(!is_proxy || - is_proxy && in_n_shader_module_stage_entrypoints == 0); + baked_pipeline = VK_NULL_HANDLE; + device_ptr = in_device_ptr; + pipeline_info_ptr = std::move(in_pipeline_info_ptr); } /** Destrutor. Releases the internally managed Vulkan objects. */ ~Pipeline() { - release_vulkan_objects(); + release_pipeline(); } private: Pipeline(); + /** Releases pipeline & pipeline layout instances **/ + void release_pipeline(); } Pipeline; - typedef std::map > Pipelines; + typedef std::map > Pipelines; /* Protected functions */ - /** Registers a new derivative pipeline which is going to inherit state from another pipeline object, - * which has already been added to the pipeline manager. - * - * The function does not automatically bake the new pipeline. This action can either be explicitly - * requested by calling bake(), or by calling one of the get_*() functions. - * - * @param in_disable_optimizations If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT flag. - * @param in_allow_derivatives If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT flag. - * @param in_n_shader_module_stage_entrypoints Number of shader module stage entrypoint descriptors available under - * @param in_shader_module_stage_entrypoint_ptrs. Must be >= 1. - * @param in_shader_module_stage_entrypoint_ptrs Array of shader module stage entrypoint descriptors. Must hold - * @param in_n_shader_module_stage_entrypoints elements. Must not be nullptr. - * @param in_base_pipeline_id ID of the pipeline, which should be used as base for the new pipeline - * object. Must be an ID earlier returned by one of the other add_() functions. - * @param out_pipeline_id_ptr Deref will be set to the ID of the result pipeline object. Must not be nullptr. - * - * @return true if the function executed successfully, false otherwise. - **/ - bool add_derivative_pipeline_from_sibling_pipeline(bool in_disable_optimizations, - bool in_allow_derivatives, - uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, - PipelineID in_base_pipeline_id, - PipelineID* out_pipeline_id_ptr); - - /** Registers a new derivative pipeline which is going to inherit its state from another Vulkan pipeline object. - * - * The function does not automatically bake the new pipeline. This action can either be explicitly - * requested by calling bake(), or by calling one of the get_*() functions. - * - * @param in_disable_optimizations If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT flag. - * @param in_allow_derivatives If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT flag. - * @param in_n_shader_module_stage_entrypoints Number of shader module stage entrypoint descriptors available under - * @param in_shader_module_stage_entrypoint_ptrs. Must be >= 1. - * @param in_shader_module_stage_entrypoint_ptrs Array of shader module stage entrypoint descriptors. Must hold - * @param in_n_shader_module_stage_entrypoints elements. Must not be nullptr. - * @param in_base_pipeline Handle of the pipeline, which should be used as base for the new pipeline - * object. Must not be nullptr. - * @param out_pipeline_id_ptr Deref will be set to the ID of the result pipeline object. Must not be nullptr. - * - * @return true if the function executed successfully, false otherwise. - **/ - bool add_derivative_pipeline_from_pipeline(bool in_disable_optimizations, - bool in_allow_derivatives, - uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, - VkPipeline in_base_pipeline, - PipelineID* out_pipeline_id_ptr); - - /** Registers a new proxy pipeline. A proxy pipeline cannot be baked, but it can hold state data and act - * as a parent for other pipelines, which inherit their state at creation time. - * - * @param out_pipeline_id_ptr Deref will be set to the ID of the result pipeline object. Must not be nullptr. - * - * @return true if successful, false otherwise. - **/ - bool add_proxy_pipeline(PipelineID* out_pipeline_id_ptr); - - /** Registers a new pipeline object. - * - * The function does not automatically bake the new pipeline. This action can either be explicitly - * requested by calling bake(), or by calling one of the get_*() functions. - * - * @param in_disable_optimizations If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT flag. - * @param in_allow_derivatives If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT flag. - * @param in_n_shader_module_stage_entrypoints Number of shader module stage entrypoint descriptors available under - * @param in_shader_module_stage_entrypoint_ptrs. Must be >= 1. - * @param in_shader_module_stage_entrypoint_ptrs Array of shader module stage entrypoint descriptors. Must hold - * @param in_n_shader_module_stage_entrypoints elements. Must not be nullptr. - * @param out_pipeline_id_ptr Deref will be set to the ID of the result pipeline object. Must not be nullptr. - * - * @return true if the function executed successfully, false otherwise. - **/ - bool add_regular_pipeline(bool in_disable_optimizations, - bool in_allow_derivatives, - uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, - PipelineID* out_pipeline_id_ptr); - - /** Adds a new specialization constant to the specified pipeline object. - * - * This function marks the pipeline as dirty, meaning it will be rebaked at the next get_() call. - * - * @param in_pipeline_id ID of the pipeline to add the constant to. Must be an ID returned - * by one of the add_() functions. Must not describe a proxy pipeline. - * @param in_shader_index Index of the shader, with which the new specialization constant should be - * associated. - * @param in_constant_id ID of the specialization constant to assign data for. - * @param in_n_data_bytes Number of bytes under @param in_data_ptr to assign to the specialization constant. - * @param in_data_ptr A buffer holding the data to be assigned to the constant. Must hold at least - * @param in_n_data_bytes bytes that will be read by the function. - * - * @return true if successful, false otherwise. - **/ - bool add_specialization_constant_to_pipeline(PipelineID in_pipeline_id, - ShaderIndex in_shader_index, - uint32_t in_constantID, - uint32_t in_n_data_bytes, - const void* in_data_ptr); - /** Fills & returns a VkSpecializationInfo descriptor. Any sub-descriptors, to which the baked descriptor * is going to point at, are stored in a vector provided by the caller. It is caller's responsibility to * ensure the vector is not released before pipeline baking occurs. @@ -492,42 +215,12 @@ namespace Anvil std::vector* out_specialization_map_entry_vk_vector, VkSpecializationInfo* out_specialization_info_ptr); - /** Deletes an existing pipeline. - * - * @param in_pipeline_id ID of a pipeline to delete. - * - * @return true if successful, false otherwise. - **/ - bool delete_pipeline(PipelineID in_pipeline_id); - - /** Retrieves a VkPipeline instance associated with the specified pipeline ID. - * - * The function will bake a pipeline object (and, possibly, a pipeline layout object, too) if - * the specified pipeline is marked as dirty. - * - * @param in_pipeline_id ID of the pipeline to return the raw Vulkan pipeline handle for. Must not - * describe a proxy pipeline. - * - * @return VkPipeline handle or nullptr if the function failed. - **/ - VkPipeline get_pipeline(PipelineID in_pipeline_id); - - /** Retrieves a PipelineLayout instance associated with the specified pipeline ID. - * - * The function will bake a pipeline object (and, possibly, a pipeline layout object, too) if - * the specified pipeline is marked as dirty. - * - * @param in_pipeline_id ID of the pipeline to return the wrapper instance for. - * Must not describe a proxy pipeline. - * - * @return Ptr to a PipelineLayout instance or nullptr if the function failed. - **/ - std::shared_ptr get_pipeline_layout(PipelineID in_pipeline_id); - /* Protected members */ - std::weak_ptr m_device_ptr; - uint32_t m_pipeline_counter; - Pipelines m_pipelines; + std::weak_ptr m_device_ptr; + std::atomic m_pipeline_counter; + + Pipelines m_baked_pipelines; + Pipelines m_outstanding_pipelines; std::shared_ptr m_pipeline_cache_ptr; std::shared_ptr m_pipeline_layout_manager_ptr; diff --git a/include/misc/callbacks.h b/include/misc/callbacks.h index a2f0079a..b66c4806 100644 --- a/include/misc/callbacks.h +++ b/include/misc/callbacks.h @@ -120,6 +120,8 @@ namespace Anvil } } OnGLSLToSPIRVConversionAboutToBeStartedCallbackArgument; + typedef OnGLSLToSPIRVConversionAboutToBeStartedCallbackArgument OnGLSLToSPIRVConversionFinishedCallbackArgument; + typedef struct OnKeypressReleasedCallbackArgument : public Anvil::CallbackArgument { KeyID released_key_id; @@ -175,6 +177,16 @@ namespace Anvil } } OnNewBindingAddedToDescriptorSetLayoutCallbackArgument; + typedef struct OnNewPipelineCreatedCallbackData : public Anvil::CallbackArgument + { + PipelineID new_pipeline_id; + + explicit OnNewPipelineCreatedCallbackData(PipelineID in_new_pipeline_id) + { + new_pipeline_id = in_new_pipeline_id; + } + } OnNewPipelineCreatedCallbackData; + typedef struct OnObjectRegisteredCallbackArgument : Anvil::CallbackArgument { void* object_raw_ptr; @@ -313,6 +325,8 @@ namespace Anvil CallbackFunction in_callback_function, void* in_callback_function_owner_ptr) const { + std::unique_lock mutex_lock(m_mutex); + anvil_assert(in_callback_id < m_callback_id_count); return std::find(m_callbacks[in_callback_id].begin(), @@ -339,6 +353,8 @@ namespace Anvil CallbackFunction in_callback_function, void* in_callback_owner_ptr) { + std::unique_lock mutex_lock(m_mutex); + anvil_assert(in_callback_id < m_callback_id_count); anvil_assert(in_callback_function != nullptr); anvil_assert(in_callback_owner_ptr != nullptr); @@ -375,6 +391,8 @@ namespace Anvil CallbackFunction in_callback_function, void* in_callback_function_owner_ptr) { + std::unique_lock mutex_lock(m_mutex); + anvil_assert(in_callback_id < m_callback_id_count); anvil_assert(in_callback_function != nullptr); anvil_assert(!m_callbacks_locked); @@ -408,6 +426,8 @@ namespace Anvil void callback(CallbackID in_callback_id, CallbackArgument* in_callback_arg_ptr) { + std::unique_lock mutex_lock(m_mutex); + anvil_assert(in_callback_id < m_callback_id_count); anvil_assert(!m_callbacks_locked); @@ -446,6 +466,8 @@ namespace Anvil void callback_safe(CallbackID in_callback_id, CallbackArgument* in_callback_arg_ptr) { + std::unique_lock mutex_lock(m_mutex); + anvil_assert(in_callback_id < m_callback_id_count); anvil_assert(!m_callbacks_locked); @@ -494,6 +516,8 @@ namespace Anvil if (in_callback_id < m_callback_id_count) { + std::unique_lock mutex_lock(m_mutex); + result = static_cast(m_callbacks[in_callback_id].size() ); } @@ -531,9 +555,10 @@ namespace Anvil typedef std::vector Callbacks; /* Private variables */ - CallbackID m_callback_id_count; - Callbacks* m_callbacks; - volatile bool m_callbacks_locked; + CallbackID m_callback_id_count; + Callbacks* m_callbacks; + volatile bool m_callbacks_locked; + mutable std::recursive_mutex m_mutex; }; } /* namespace Anvil */ diff --git a/include/misc/compute_pipeline_info.h b/include/misc/compute_pipeline_info.h new file mode 100644 index 00000000..9c89acea --- /dev/null +++ b/include/misc/compute_pipeline_info.h @@ -0,0 +1,70 @@ +// +// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#ifndef ANVIL_COMPUTE_PIPELINE_INFO_H +#define ANVIL_COMPUTE_PIPELINE_INFO_H + +#include "misc/base_pipeline_info.h" + + +namespace Anvil +{ + class ComputePipelineInfo : public BasePipelineInfo + { + public: + /* Public functions */ + static std::unique_ptr create_derivative_pipeline_info(bool in_disable_optimizations, + bool in_allow_derivatives, + const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info, + Anvil::PipelineID in_base_pipeline_id); + static std::unique_ptr create_proxy_pipeline_info (); + static std::unique_ptr create_regular_pipeline_info (bool in_disable_optimizations, + bool in_allow_derivatives, + const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info); + + /** Adds a new specialization constant. + * + * @param in_constant_id ID of the specialization constant to assign data for. + * @param in_n_data_bytes Number of bytes under @param in_data_ptr to assign to the specialization constant. + * @param in_data_ptr A buffer holding the data to be assigned to the constant. Must hold at least + * @param in_n_data_bytes bytes that will be read by the function. + * + * @return true if successful, false otherwise. + **/ + bool add_specialization_constant(uint32_t in_constant_id, + uint32_t in_n_data_bytes, + const void* in_data_ptr) + { + return BasePipelineInfo::add_specialization_constant(Anvil::SHADER_STAGE_COMPUTE, + in_constant_id, + in_n_data_bytes, + in_data_ptr); + } + + ~ComputePipelineInfo(); + + private: + ComputePipelineInfo(); + }; +}; + +#endif /* ANVIL_COMPUTE_PIPELINE_INFO_H */ diff --git a/include/misc/descriptor_set_info.h b/include/misc/descriptor_set_info.h new file mode 100644 index 00000000..8e8ba2fe --- /dev/null +++ b/include/misc/descriptor_set_info.h @@ -0,0 +1,157 @@ +// +// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#ifndef MISC_DESCRIPTOR_SET_INFO_H +#define MISC_DESCRIPTOR_SET_INFO_H + +#include "misc/types.h" + +namespace Anvil +{ + class DescriptorSetInfo + { + public: + /* Public functions */ + + /** Destructor. */ + ~DescriptorSetInfo(); + + /** Adds a new binding. + * + * It is an error to attempt to add a binding at an index, for which another binding has + * already been specified. + * + * It is an error to attempt to define immutable samplers for descriptors of type other than + * sampler or combined image+sampler. + * + * @param in_binding_index Index of the binding to configure. + * @param in_descriptor_type Type of the descriptor to use for the binding. + * @param in_descriptor_array_size Size of the descriptor array to use for the binding. + * @param in_stage_flags Rendering stages which are going to use the binding. + * @param in_opt_immutable_sampler_ptrs If not nullptr, an array of @param in_descriptor_array_size samplers should + * be passed. The binding will then be considered immutable, as per spec language. + * May be nullptr. + * + * @return true if successful, false otherwise. + **/ + bool add_binding(uint32_t in_binding_index, + VkDescriptorType in_descriptor_type, + uint32_t in_descriptor_array_size, + VkShaderStageFlags in_stage_flags, + const std::shared_ptr* in_opt_immutable_sampler_ptrs = nullptr); + + /** Creates a new DescriptorSetInfo instance. **/ + static std::unique_ptr create(); + + /** Retrieves properties of a single defined binding. + * + * @param in_n_binding Index number of the binding to retrieve properties of. + * @param out_opt_binding_index_ptr May be nullptr. If not, deref will be set to the index of the + * binding. This does NOT need to be equal to @param in_n_binding. + * @param out_opt_descriptor_type_ptr May be nullptr. If not, deref will be set to the descriptor type + * for the specified binding. + * @param out_opt_descriptor_array_size_ptr May be nullptr. If not, deref will be set to size of the descriptor + * array, associated with the specified binding. + * @param out_opt_stage_flags_ptr May be nullptr. If not, deref will be set to stage flags, + * as configured for the specified binding. + * @param out_opt_immutable_samplers_enabled_ptr May be nullptr. If not, deref will be set to true if immutable samplers + * have been defined for the specified binding; otherwise, it will be + * set to false. + * + * @return true if successful, false otherwise. + **/ + bool get_binding_properties(uint32_t in_n_binding, + uint32_t* out_opt_binding_index_ptr, + VkDescriptorType* out_opt_descriptor_type_ptr, + uint32_t* out_opt_descriptor_array_size_ptr, + VkShaderStageFlags* out_opt_stage_flags_ptr, + bool* out_opt_immutable_samplers_enabled_ptr) const; + + /** Returns the number of bindings defined for the layout. */ + uint32_t get_n_bindings() const + { + return static_cast(m_bindings.size() ); + } + + private: + /* Private type definitions */ + + /** Describes a single descriptor set layout binding */ + typedef struct Binding + { + uint32_t descriptor_array_size; + VkDescriptorType descriptor_type; + std::vector > immutable_samplers; + + VkShaderStageFlagsVariable(stage_flags); + + /** Dummy constructor. Do not use. */ + Binding() + { + descriptor_array_size = 0; + descriptor_type = VK_DESCRIPTOR_TYPE_MAX_ENUM; + stage_flags = static_cast(0); + } + + /** Constructor. + * + * For argument discussion, please see Anvil::DescriptorSetLayout::add_binding() documentation. + **/ + Binding(uint32_t in_descriptor_array_size, + VkDescriptorType in_descriptor_type, + VkShaderStageFlags in_stage_flags, + const std::shared_ptr* in_immutable_sampler_ptrs) + { + descriptor_array_size = in_descriptor_array_size; + descriptor_type = in_descriptor_type; + stage_flags = static_cast(in_stage_flags); + + if (in_immutable_sampler_ptrs != nullptr) + { + for (uint32_t n_sampler = 0; + n_sampler < descriptor_array_size; + ++n_sampler) + { + immutable_samplers.push_back(in_immutable_sampler_ptrs[n_sampler]); + } + } + } + } Binding; + + typedef std::map BindingIndexToBindingMap; + + /* Private functions */ + + /* Please see create() documentation for more details */ + DescriptorSetInfo(); + + /* Private variables */ + BindingIndexToBindingMap m_bindings; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(DescriptorSetInfo); + ANVIL_DISABLE_COPY_CONSTRUCTOR(DescriptorSetInfo); + + friend class Anvil::DescriptorSetLayout; + }; +}; /* namespace Anvil */ + +#endif /* MISC_DESCRIPTOR_SET_INFO */ \ No newline at end of file diff --git a/include/misc/formats.h b/include/misc/formats.h index 738abad0..ad81b672 100644 --- a/include/misc/formats.h +++ b/include/misc/formats.h @@ -32,6 +32,10 @@ namespace Anvil class Formats { public: + static bool get_compressed_format_block_size(VkFormat in_format, + uint32_t* out_block_size_uvec2_ptr, + uint32_t* out_n_bytes_per_block_ptr); + /** Returns a VkFormat which meets the user-specified criteria. * * This function does not support block formats. @@ -100,6 +104,12 @@ namespace Anvil /** Tells the format type used by @param in_format. */ static FormatType get_format_type(VkFormat in_format); + /** Tells whether @param in_format includes a depth aspect */ + static bool has_depth_aspect(VkFormat in_format); + + /** Tells whether @param in_format includes a stencil aspect */ + static bool has_stencil_aspect(VkFormat in_format); + /** Tells whether @param in_format format is a block format. */ static bool is_format_compressed(VkFormat in_format); }; diff --git a/include/misc/glsl_to_spirv.h b/include/misc/glsl_to_spirv.h index 8c10639d..4193a286 100644 --- a/include/misc/glsl_to_spirv.h +++ b/include/misc/glsl_to_spirv.h @@ -91,6 +91,12 @@ namespace Anvil */ GLSL_SHADER_TO_SPIRV_GENERATOR_CALLBACK_ID_CONVERSION_ABOUT_TO_START, + /* Call-back issued right after the conversion ends. + * + * @param callback_arg OnGLSLToSPIRVConversionFinishedCallbackArgument instance. + */ + GLSL_SHADER_TO_SPIRV_GENERATOR_CALLBACK_ID_CONVERSION_FINISHED, + GLSL_SHADER_TO_SPIRV_GENERATOR_CALLBACK_ID_COUNT } GLSLShaderToSPIRVGeneratorCallbackID; diff --git a/include/misc/graphics_pipeline_info.h b/include/misc/graphics_pipeline_info.h new file mode 100644 index 00000000..f8edb146 --- /dev/null +++ b/include/misc/graphics_pipeline_info.h @@ -0,0 +1,947 @@ +// +// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef ANVIL_GRAPHICS_PIPELINE_INFO_H +#define ANVIL_GRAPHICS_PIPELINE_INFO_H + +#include "misc/base_pipeline_info.h" + + +namespace Anvil +{ + class GraphicsPipelineInfo : public BasePipelineInfo + { + public: + /* Public functions */ + static std::unique_ptr create_derivative_pipeline_info(bool in_disable_optimizations, + bool in_allow_derivatives, + std::shared_ptr in_renderpass_ptr, + SubPassID in_subpass_id, + const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, + Anvil::PipelineID in_base_pipeline_id); + static std::unique_ptr create_proxy_pipeline_info (); + static std::unique_ptr create_regular_pipeline_info (bool in_disable_optimizations, + bool in_allow_derivatives, + std::shared_ptr in_renderpass_ptr, + SubPassID in_subpass_id, + const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, + const Anvil::GraphicsPipelineInfo* in_opt_reference_pipeline_info_ptr = nullptr); + + ~GraphicsPipelineInfo(); + + /** Adds a new specialization constant. + * + * @param in_shader_stage Shader stage, with which the new specialization constant should be + * associated. Must be one of the graphics shader + * @param in_constant_id ID of the specialization constant to assign data for. + * @param in_n_data_bytes Number of bytes under @param in_data_ptr to assign to the specialization constant. + * @param in_data_ptr A buffer holding the data to be assigned to the constant. Must hold at least + * @param in_n_data_bytes bytes that will be read by the function. + * + * @return true if successful, false otherwise. + **/ + bool add_specialization_constant(Anvil::ShaderStage in_shader_stage, + uint32_t in_constant_id, + uint32_t in_n_data_bytes, + const void* in_data_ptr) final + { + if (in_shader_stage != Anvil::SHADER_STAGE_FRAGMENT && + in_shader_stage != Anvil::SHADER_STAGE_GEOMETRY && + in_shader_stage != Anvil::SHADER_STAGE_TESSELLATION_CONTROL && + in_shader_stage != Anvil::SHADER_STAGE_TESSELLATION_EVALUATION && + in_shader_stage != Anvil::SHADER_STAGE_VERTEX) + { + anvil_assert(in_shader_stage == Anvil::SHADER_STAGE_FRAGMENT || + in_shader_stage == Anvil::SHADER_STAGE_GEOMETRY || + in_shader_stage == Anvil::SHADER_STAGE_TESSELLATION_CONTROL || + in_shader_stage == Anvil::SHADER_STAGE_TESSELLATION_EVALUATION || + in_shader_stage == Anvil::SHADER_STAGE_VERTEX); + + return false; + } + + return BasePipelineInfo::add_specialization_constant(in_shader_stage, + in_constant_id, + in_n_data_bytes, + in_data_ptr); + } + + /** Adds a new vertex attribute descriptor to the specified graphics pipeline. This data will be used + * at baking time to configure input vertex attribute & bindings for the Vulkan pipeline object. + * + * By default, Anvil only assigns a unique binding to those vertex attributes, whose characteristics + * are unique (ie. whose input rate & stride match). This works well for most of the use cases, the + * only exception being when you need to associate a unique offset to a specific vertex binding. In + * this case, you need to set @param in_explicit_binding_index to an index, under which your exclusive + * binding is going to be stored. + * When preparing the binding array, Anvil will not reuse user-specified "explicit" bindings for + * attributes, for which "explicit" bindings have not been requested, even if their properties match. + * + * + * @param in_location Vertex attribute location + * @param in_format Vertex attribute format. + * @param in_offset_in_bytes Start offset of the vertex attribute data. + * @param in_stride_in_bytes Stride of the vertex attribute data. + * @param in_step_rate Step rate to use for the vertex attribute data. + * @param in_explicit_binding_index Please see general description of the function for more details. + * + * @return true if successful, false otherwise. + **/ + bool add_vertex_attribute(uint32_t in_location, + VkFormat in_format, + uint32_t in_offset_in_bytes, + uint32_t in_stride_in_bytes, + VkVertexInputRate in_step_rate, + uint32_t in_explicit_binding_index = UINT32_MAX); + + /** Tells whether depth writes have been enabled. **/ + bool are_depth_writes_enabled() const; + + /** Retrieves blending properties defined. + * + * @param out_opt_blend_constant_vec4_ptr If not NULL, deref will be assigned to a ptr holding four float values + * representing the blend constant. + * @param out_opt_n_blend_attachments_ptr If not NULL, deref will be set to the number of blend + * attachments the graphics pipeline supports. + **/ + void get_blending_properties(const float** out_opt_blend_constant_vec4_ptr_ptr, + uint32_t* out_opt_n_blend_attachments_ptr) const; + + /** Retrieves color blend attachment properties specified for a given subpass attachment. + * + * @param in_attachment_id ID of the attachment the query is being made for. + * @param out_opt_blending_enabled_ptr If not null, deref will be set to true if blending has been + * enabled for this pipeline, or to false otherwise. + * @param out_opt_blend_op_color_ptr If not null, deref will be set to the specified attachment's + * color blend op. + * @param out_opt_blend_op_alpha_ptr If not null, deref will be set to the specified attachment's + * alpha blend op. + * @param out_opt_src_color_blend_factor_ptr If not null, deref will be set to the specified attachment's + * source color blend factor. + * @param out_opt_dst_color_blend_factor_ptr If not null, deref will be set to the specified attachment's + * destination color blend factor. + * @param out_opt_src_alpha_blend_factor_ptr If not null, deref will be set to the specified attachment's + * source alpha blend factor. + * @param out_opt_dst_alpha_blend_factor_ptr If not null, deref will be set to the specified attachment's + * destination alpha blend factor. + * @param out_opt_channel_write_mask_ptr If not null, deref will be set to the specified attachment's + * write mask. + * + * @return true if successful, false otherwise. + */ + bool get_color_blend_attachment_properties(SubPassAttachmentID in_attachment_id, + bool* out_opt_blending_enabled_ptr, + VkBlendOp* out_opt_blend_op_color_ptr, + VkBlendOp* out_opt_blend_op_alpha_ptr, + VkBlendFactor* out_opt_src_color_blend_factor_ptr, + VkBlendFactor* out_opt_dst_color_blend_factor_ptr, + VkBlendFactor* out_opt_src_alpha_blend_factor_ptr, + VkBlendFactor* out_opt_dst_alpha_blend_factor_ptr, + VkColorComponentFlags* out_opt_channel_write_mask_ptr) const; + + /** Retrieves depth bias-related state configuration. + * + * @param out_opt_is_enabled_ptr If not null, deref will be set to true if depth bias has + * been enabled for the pipeline, or to false otherwise. + * @param out_opt_depth_bias_constant_factor_ptr If not null, deref will be set to the depth bias constant factor + * assigned to the pipeline. + * @param out_opt_depth_bias_clamp_ptr If not null, deref will be set to the depth bias clamp value, as + * assigned to the pipeline. + * @param out_opt_depth_bias_slope_factor_ptr If not null, deref will be set to the depth bias slope factor, as + * configured for the pipeline. + **/ + void get_depth_bias_state(bool* out_opt_is_enabled_ptr, + float* out_opt_depth_bias_constant_factor_ptr, + float* out_opt_depth_bias_clamp_ptr, + float* out_opt_depth_bias_slope_factor_ptr) const; + + /** Retrieves depth bounds-related state configuration. + * + * @param out_opt_is_enabled_ptr If not null, deref will be set to true if depth bounds mode + * has been enabled for the pipeline, or to false otherwise. + * @param out_opt_min_depth_bounds_ptr If not null, deref will be set to the minimum depth bound value + * assigned to the pipeline. + * @param out_opt_max_depth_bounds_ptr If not null, deref will be set to the maximum depth bound value + * assigned to the pipeline. + **/ + void get_depth_bounds_state(bool* out_opt_is_enabled_ptr, + float* out_opt_min_depth_bounds_ptr, + float* out_opt_max_depth_bounds_ptr) const; + + /** Retrieves depth test-related state configuration. + * + * @param out_opt_is_enabled_ptr If not null, deref will be set to true if depth test has been + * enabled for the pipeline, or to false otherwise. + * @param out_opt_compare_op_ptr If not null, deref will be set to the depth compare op assigned + * to the pipeline. + **/ + void get_depth_test_state(bool* out_opt_is_enabled_ptr, + VkCompareOp* out_opt_compare_op_ptr) const; + + /** Tells what dynamic states have been enabled. **/ + DynamicStateBitfield get_enabled_dynamic_states() const; + + /** Retrieves general properties. + * + * @param out_opt_n_scissors_ptr If not null, deref will be set to the number of scissors used + * by the pipeline. + * @param out_opt_n_viewports_ptr If not null, deref will be set to the number of viewports used + * by the pipeline. + * @param out_opt_n_vertex_attributes_ptr If not null, deref will be set to the number of vertex + * attributes specified by the owner. + * @param out_opt_renderpass_ptr If not null, deref will be set to the renderpass assigned to + * the pipeline. + * @param out_opt_subpass_id_ptr If not null, deref will be set to the ID of the subpass the pipeline + * has been created for. + * + * @return true if successful, false otherwise. + **/ + void get_graphics_pipeline_properties(uint32_t* out_opt_n_scissors_ptr, + uint32_t* out_opt_n_viewports_ptr, + uint32_t* out_opt_n_vertex_attributes_ptr, + std::shared_ptr* out_opt_renderpass_ptr, + SubPassID* out_opt_subpass_id_ptr) const; + + /** Retrieves logic op-related state configuration. + * + * @param out_opt_is_enabled_ptr If not null, deref will be set to true if the logic op has + * been enabled for the pipeline, or to false otherwise. + * @param out_opt_logic_op_ptr If not null, deref will be set to the logic op enum, specified + * at creation time. + **/ + void get_logic_op_state(bool* out_opt_is_enabled_ptr, + VkLogicOp* out_opt_logic_op_ptr) const; + + /** Retrieves multisampling-related state configuration. + * + * @param out_opt_sample_count_ptr If not null, deref will be set to the enum value telling + * the sample count assigned to the pipeline. + * @param out_opt_sample_mask_ptr If not null, deref will be set to the sample mask assigned + * to the pipeline. + **/ + void get_multisampling_properties(VkSampleCountFlags* out_opt_sample_count_ptr, + VkSampleMask* out_opt_sample_mask_ptr) const; + + /** Tells the number of dynamic scissor boxes. **/ + uint32_t get_n_dynamic_scissor_boxes() const; + + /** Tells the number of dynamic viewports. **/ + uint32_t get_n_dynamic_viewports() const; + + uint32_t get_n_scissor_boxes() const; + + uint32_t get_n_viewports() const; + + bool get_pipeline_color_blend_attachment_state(uint32_t in_n_subpass_color_attachment, + VkPipelineColorBlendAttachmentState* out_result_ptr) const; + + /** Tells what primitive topology has been specified for this instance. **/ + VkPrimitiveTopology get_primitive_topology() const; + + /** Tells what rasterization order has been specified for this instance. **/ + VkRasterizationOrderAMD get_rasterization_order() const; + + /** Retrieves various rasterization properties of the graphics pipeline. + * + * @param out_opt_polygon_mode_ptr If not null, deref will be set to polygon mode used by the + * pipeline. + * @param out_opt_cull_mode_ptr If not null, deref will be set to cull mode used by the + * pipeline. + * @param out_opt_front_face_ptr If not null, deref will be set to front face setting, used + * by the pipeline. + * @param out_opt_line_width_ptr If not null, deref will be set to line width setting, as used + * by the pipeline. + * + * @return true if successful, false otherwise. + **/ + void get_rasterization_properties(VkPolygonMode* out_opt_polygon_mode_ptr, + VkCullModeFlags* out_opt_cull_mode_ptr, + VkFrontFace* out_opt_front_face_ptr, + float* out_opt_line_width_ptr) const; + + std::shared_ptr get_renderpass() const + { + return m_renderpass_ptr; + } + + /** Retrieves state configuration related to per-sample shading. + * + * @param out_opt_is_enabled_ptr If not null, deref will be set to true if per-sample shading + * is enabled for the pipeline. + * @param out_opt_min_sample_shading_ptr If not null, deref will be set to the minimum sample shading value, + * as specified at creation time. + * + * @return true if successful, false otherwise. + **/ + void get_sample_shading_state(bool* out_opt_is_enabled_ptr, + float* out_opt_min_sample_shading_ptr) const; + + /** Retrieves properties of a scissor box at a given index. + * + * @param in_n_scissor_box Index of the scissor box to retrieve data of. + * @param out_opt_x_ptr If not null, deref will be set to X offset of the scissor box. + * @param out_opt_y_ptr If not null, deref will be set to Y offset of the scissor box. + * @param out_opt_width_ptr If not null, deref will be set to width of the scissor box. + * @param out_opt_height_ptr If not null, deref will be set to height of the scissor box. + * + * @return true if successful, false otherwise. + **/ + bool get_scissor_box_properties(uint32_t in_n_scissor_box, + int32_t* out_opt_x_ptr, + int32_t* out_opt_y_ptr, + uint32_t* out_opt_width_ptr, + uint32_t* out_opt_height_ptr) const; + + /** Retrieves stencil test-related state configuration. + * + * @param out_opt_is_enabled_ptr If not null, deref will be set to true if stencil test + * has been enabled for the pipeline. + * @param out_opt_front_stencil_fail_op_ptr If not null, deref will be set to "front stencil fail operation" + * setting, as specified at creation time. + * @param out_opt_front_stencil_pass_op_ptr If not null, deref will be set to "front stencil pass operation" + * setting, as specified at creation time. + * @param out_opt_front_stencil_depth_fail_op_ptr If not null, deref will be set to "front stencil depth fail operation" + * setting, as specified at creation time. + * @param out_opt_front_stencil_compare_op_ptr If not null, deref will be set to "front stencil compare operation" + * setting, as specified at creation time. + * @param out_opt_front_stencil_compare_mask_ptr If not null, deref will be set to front stencil compare mask, as + * specified at creation time. + * @param out_opt_front_stencil_write_mask_ptr If not null, deref will be set to front stencil write mask, as + * specified at creation time. + * @param out_opt_front_stencil_reference_ptr If not null, deref will be set to front stencil reference value, as + * specified at creation time. + * @param out_opt_back_stencil_fail_op_ptr If not null, deref will be set to "back stencil fail operation" + * setting, as specified at creation time. + * @param out_opt_back_stencil_pass_op_ptr If not null, deref will be set to "back stencil pass operation" + * setting, as specified at creation time. + * @param out_opt_back_stencil_depth_fail_op_ptr If not null, deref will be set to "back stencil depth fail operation" + * setting, as specified at creation time. + * @param out_opt_back_stencil_compare_op_ptr If not null, deref will be set to "back stencil compare operation" + * setting, as specified at creation time. + * @param out_opt_back_stencil_compare_mask_ptr If not null, deref will be set to back stencil compare mask, as + * specified at creation time. + * @param out_opt_back_stencil_write_mask_ptr If not null, deref will be set to back stencil write mask, as + * specified at creation time. + * @param out_opt_back_stencil_reference_ptr If not null, deref will be set to back stencil reference value, as + * specified at creation time. + * + * @return true if successful, false otherwise. + **/ + void get_stencil_test_properties(bool* out_opt_is_enabled_ptr, + VkStencilOp* out_opt_front_stencil_fail_op_ptr, + VkStencilOp* out_opt_front_stencil_pass_op_ptr, + VkStencilOp* out_opt_front_stencil_depth_fail_op_ptr, + VkCompareOp* out_opt_front_stencil_compare_op_ptr, + uint32_t* out_opt_front_stencil_compare_mask_ptr, + uint32_t* out_opt_front_stencil_write_mask_ptr, + uint32_t* out_opt_front_stencil_reference_ptr, + VkStencilOp* out_opt_back_stencil_fail_op_ptr, + VkStencilOp* out_opt_back_stencil_pass_op_ptr, + VkStencilOp* out_opt_back_stencil_depth_fail_op_ptr, + VkCompareOp* out_opt_back_stencil_compare_op_ptr, + uint32_t* out_opt_back_stencil_compare_mask_ptr, + uint32_t* out_opt_back_stencil_write_mask_ptr, + uint32_t* out_opt_back_stencil_reference_ptr) const; + + const SubPassID& get_subpass_id() const + { + return m_subpass_id; + } + + /** Tells the number of patch control points associated with this instance. **/ + uint32_t get_n_patch_control_points() const; + + /** Returns properties of a vertex attribute at a given index. These properties are as specified by the owner. + * + * This means the binding ultimately assigned by graphics pipeline manager does not necessarily have to match + * @param out_opt_binding_ptr. + * + * @param in_n_vertex_input_attribute Index of the vertex attribute to retrieve info of. + * @param out_opt_location_ptr If not null, deref will be set to the specified attribute's location. + * @param out_opt_format_ptr If not null, deref will be set to the specified attribute's format. + * @param out_opt_offset_ptr If not null, deref will be set to the specified attribute's start offset. + * @param out_opt_explicit_vertex_binding_index_ptr If not null, deref will be set to the specified attribute's explicit vertex binding index. + * @param out_opt_stride_ptr If not null, deref will be set to the specified attribute's stride. + * @param out_opt_rate_ptr If not null, deref will be set to the specified attribute's step rate. + * + * @return true if successful, false otherwise. + **/ + bool get_vertex_attribute_properties(uint32_t in_n_vertex_input_attribute, + uint32_t* out_opt_location_ptr, + VkFormat* out_opt_format_ptr, + uint32_t* out_opt_offset_ptr, + uint32_t* out_opt_explicit_vertex_binding_index_ptr, + uint32_t* out_opt_stride_ptr, + VkVertexInputRate* out_opt_rate_ptr) const; + + /** Retrieves properties of a viewport at a given index. + * + * @param in_n_viewport Index of the viewport to retrieve properties of. + * @param out_opt_origin_x_ptr If not null, deref will be set to the viewport's X origin. + * @param out_opt_origin_y_ptr If not null, deref will be set to the viewport's Y origin. + * @param out_opt_width_ptr If not null, deref will be set to the viewport's width. + * @param out_opt_height_ptr If not null, deref will be set to the viewport's height. + * @param out_opt_min_depth_ptr If not null, deref will be set to the viewport's minimum depth value. + * @param out_opt_max_depth_ptr If not null, deref will be set to the viewport's maximum depth value. + * + * @return true if successful, false otherwise. + **/ + bool get_viewport_properties(uint32_t in_n_viewport, + float* out_opt_origin_x_ptr, + float* out_opt_origin_y_ptr, + float* out_opt_width_ptr, + float* out_opt_height_ptr, + float* out_opt_min_depth_ptr, + float* out_opt_max_depth_ptr) const; + + /** Tells if alpha-to-coverage mode has been enabled. **/ + bool is_alpha_to_coverage_enabled() const; + + /** Tells if alpha-to-one mode has been enabled. **/ + bool is_alpha_to_one_enabled() const; + + /** Tells whether depth clamping has been enabled. **/ + bool is_depth_clamp_enabled() const; + + /** Tells whether primitive restart mode has been enabled. **/ + bool is_primitive_restart_enabled() const; + + /** Tells whether rasterizer discard has been enabled. */ + bool is_rasterizer_discard_enabled() const; + + /** Tells whether sample mask has been enabled. */ + bool is_sample_mask_enabled() const; + + /** Sets a new blend constant. + * + * @param in_blend_constant_vec4 4 floats, specifying the constant. Must not be nullptr. + * + **/ + void set_blending_properties(const float* in_blend_constant_vec4); + + /** Updates color blend properties for the specified sub-pass attachment. + * + * @param in_attachment_id ID of the subpass attachment, for which the color blend properties should be applied. + * @param in_blending_enabled true if blending should be enabled for the specified attachment, false otherwise. + * @param in_blend_op_color Blend operation color to use for the attachment. + * @param in_blend_op_alpha Blend operation alpha to use for the attachment. + * @param in_src_color_blend_factor Source blend factor for color components. + * @param in_dst_color_blend_factor Destination blend factor for color components. + * @param in_src_alpha_blend_factor Source blend factor for the alpha component. + * @param in_dst_alpha_blend_factor Destination blend factor for the alpha component. + * @param in_channel_write_mask Component write mask to use for the attachment. + * + **/ + void set_color_blend_attachment_properties(SubPassAttachmentID in_attachment_id, + bool in_blending_enabled, + VkBlendOp in_blend_op_color, + VkBlendOp in_blend_op_alpha, + VkBlendFactor in_src_color_blend_factor, + VkBlendFactor in_dst_color_blend_factor, + VkBlendFactor in_src_alpha_blend_factor, + VkBlendFactor in_dst_alpha_blend_factor, + VkColorComponentFlags in_channel_write_mask); + + /** Updates multisampling properties. + * + * @param in_sample_count Number of rasterization samples to be used (expressed as one of the enum values). + * @param in_min_sample_shading Minimum number of unique samples to shade for each fragment. + * @param in_sample_mask Sample mask to use. + */ + void set_multisampling_properties(VkSampleCountFlagBits in_sample_count, + float in_min_sample_shading, + const VkSampleMask in_sample_mask); + + /** Updates the number of scissor boxes to be used, when dynamic scissor state is enabled. + * + * @param in_n_dynamic_scissor_boxes As per description. + */ + void set_n_dynamic_scissor_boxes(uint32_t in_n_dynamic_scissor_boxes); + + /** Updates the number of viewports to be used, when dynamic viewport state is enabled. + * + * @param in_n_dynamic_viewports As per description. + */ + void set_n_dynamic_viewports(uint32_t in_n_dynamic_viewports); + + /** Updates the number of tessellation patch points. + * + * @param in_n_patch_control_points As per description. + **/ + void set_n_patch_control_points(uint32_t in_n_patch_control_points); + + /** Sets primitive topology. */ + void set_primitive_topology(VkPrimitiveTopology in_primitive_topology); + + /** Configures the rasterization order for the pipeline if the VK_AMD_rasterization_order extension + * is supported by the device, for which the pipeline has been created. + * + * On drivers which do not support the extension, the setting will be ignored. + * + * @param in_rasterization_order Rasterization order to use. + **/ + void set_rasterization_order(VkRasterizationOrderAMD in_rasterization_order); + + /** Sets a number of rasterization properties to be used for the pipeline. + * + * @param in_polygon_mode Polygon mode to use. + * @param in_cull_mode Cull mode to use. + * @param in_front_face Front face to use. + * @param in_line_width Line width to use. + **/ + void set_rasterization_properties(VkPolygonMode in_polygon_mode, + VkCullModeFlags in_cull_mode, + VkFrontFace in_front_face, + float in_line_width); + + /** Sets properties of a scissor box at the specified index. + * + * If @param n_scissor_box is larger than 1, all previous scissor boxes must also be defined + * prior to creating a pipeline. Number of scissor boxes must match the number of viewports + * defined for the pipeline. + * + * @param in_n_scissor_box Index of the scissor box to be updated. + * @param in_x X offset of the scissor box. + * @param in_y Y offset of the scissor box. + * @param in_width Width of the scissor box. + * @param in_height Height of the scissor box. + **/ + void set_scissor_box_properties(uint32_t in_n_scissor_box, + int32_t in_x, + int32_t in_y, + uint32_t in_width, + uint32_t in_height); + + /** Sets a number of stencil test properties. + * + * @param in_update_front_face_state true if the front face stencil states should be updated; false to update the + * back stencil states instead. + * @param in_stencil_fail_op Stencil fail operation to use. + * @param in_stencil_pass_op Stencil pass operation to use. + * @param in_stencil_depth_fail_op Stencil depth fail operation to use. + * @param in_stencil_compare_op Stencil compare operation to use. + * @param in_stencil_compare_mask Stencil compare mask to use. + * @param in_stencil_write_mask Stencil write mask to use. + * @param in_stencil_reference Stencil reference value to use. + **/ + void set_stencil_test_properties(bool in_update_front_face_state, + VkStencilOp in_stencil_fail_op, + VkStencilOp in_stencil_pass_op, + VkStencilOp in_stencil_depth_fail_op, + VkCompareOp in_stencil_compare_op, + uint32_t in_stencil_compare_mask, + uint32_t in_stencil_write_mask, + uint32_t in_stencil_reference); + + /** Sets properties of a viewport at the specified index. + * + * If @param in_n_viewport is larger than 1, all previous viewports must also be defined + * prior to creating a pipeline. Number of scissor boxes must match the number of viewports + * defined for the pipeline. + * + * @param in_n_viewport Index of the viewport, whose properties should be changed. + * @param in_origin_x X offset to use for the viewport's origin. + * @param in_origin_y Y offset to use for the viewport's origin. + * @param in_width Width of the viewport. + * @param in_height Height of the viewport. + * @param in_min_depth Minimum depth value to use for the viewport. + * @param in_max_depth Maximum depth value to use for the viewport. + **/ + void set_viewport_properties(uint32_t in_n_viewport, + float in_origin_x, + float in_origin_y, + float in_width, + float in_height, + float in_min_depth, + float in_max_depth); + + /** Enables or disables the "alpha to coverage" test. + * + * @param in_should_enable true to enable the test; false to disable it. + */ + void toggle_alpha_to_coverage(bool in_should_enable); + + /** Enables or disables the "alpha to one" test. + * + * @param in_should_enable true to enable the test; false to disable it. + */ + void toggle_alpha_to_one(bool in_should_enable); + + /** Enables or disables the "depth bias" mode and updates related state values. + * + * @param in_should_enable true to enable the mode; false to disable it. + * @param in_depth_bias_constant_factor Depth bias constant factor to use for the mode. + * @param in_depth_bias_clamp Depth bias clamp to use for the mode. + * @param in_depth_bias_slope_factor Slope scale for the depth bias to use for the mode. + */ + void toggle_depth_bias(bool in_should_enable, + float in_depth_bias_constant_factor, + float in_depth_bias_clamp, + float in_depth_bias_slope_factor); + + /** Enables or disables the "depth bounds" test and updates related state values. + * + * @param in_should_enable true to enable the test; false to disable it. + * @param in_min_depth_bounds Minimum boundary value to use for the test. + * @param in_max_depth_bounds Maximum boundary value to use for the test. + */ + void toggle_depth_bounds_test(bool in_should_enable, + float in_min_depth_bounds, + float in_max_depth_bounds); + + /** Enables or disables the "depth clamp" test. + * + * @param in_should_enable true to enable the test; false to disable it. + */ + void toggle_depth_clamp(bool in_should_enable); + + /** Enables or disables the depth test and updates related state values. + * + * @param in_should_enable true to enable the mode; false to disable it. + * @param in_compare_op Compare operation to use for the test. + */ + void toggle_depth_test(bool in_should_enable, + VkCompareOp in_compare_op); + + /** Enables or disables depth writes. + * + * @param in_should_enable true to enable the writes; false to disable them. + */ + void toggle_depth_writes(bool in_should_enable); + + /** Enables or disables the specified dynamic states. + * + * @param in_should_enable true to enable the dynamic state(s) specified by @param in_dynamic_state_bits, false + * disable them if already enabled. + * @param in_dynamic_state_bits An integer whose individual bits correspond to dynamic states which should either + * be enabled or disabled. + **/ + void toggle_dynamic_states(bool in_should_enable, + DynamicStateBitfield in_dynamic_state_bits); + + /** Enables or disables logic ops and specifies which logic op should be used. + * + * @param in_should_enable true to enable the mode; false to disable it. + * @param in_logic_op Logic operation type to use. + */ + void toggle_logic_op(bool in_should_enable, + VkLogicOp in_logic_op); + + /** Enables or disables the "primitive restart" mode. + * + * @param in_should_enable true to enable the mode; false to disable it. + */ + void toggle_primitive_restart(bool in_should_enable); + + /** Enables or disables the "rasterizer discard" mode. + * + * @param in_should_enable true to enable the test; false to disable it. + */ + void toggle_rasterizer_discard(bool in_should_enable); + + /** Enables or disables the sample mask. + * + * Note: make sure to configure the sample mask using set_multisampling_properties() if you intend to use it. + * + * Note: disabling sample mask will make the manager set VkPipelineMultisampleStateCreateInfo::pSampleMask to a non-null + * value at pipeline creation time. + * + * @param in_should_enable true to enable sample mask; false to disable it. + */ + void toggle_sample_mask(bool in_should_enable); + + /** Enables or disables the "per-sample shading" mode. + * + * @param in_should_enable true to enable the test; false to disable it. + */ + void toggle_sample_shading(bool in_should_enable); + + /** Enables or disables the stencil test. + * + * @param in_should_enable true to enable the test; false to disable it. + */ + void toggle_stencil_test(bool in_should_enable); + + private: + /* Private type definitions */ + + /* Defines blending properties for a single subpass attachment. */ + typedef struct BlendingProperties + { + VkColorComponentFlagsVariable(channel_write_mask); + + bool blend_enabled; + VkBlendOp blend_op_alpha; + VkBlendOp blend_op_color; + VkBlendFactor dst_alpha_blend_factor; + VkBlendFactor dst_color_blend_factor; + VkBlendFactor src_alpha_blend_factor; + VkBlendFactor src_color_blend_factor; + + /** Constructor. */ + BlendingProperties() + { + blend_enabled = false; + blend_op_alpha = VK_BLEND_OP_ADD; + blend_op_color = VK_BLEND_OP_ADD; + channel_write_mask = VK_COLOR_COMPONENT_A_BIT | + VK_COLOR_COMPONENT_B_BIT | + VK_COLOR_COMPONENT_G_BIT | + VK_COLOR_COMPONENT_R_BIT; + dst_alpha_blend_factor = VK_BLEND_FACTOR_ONE; + dst_color_blend_factor = VK_BLEND_FACTOR_ONE; + src_alpha_blend_factor = VK_BLEND_FACTOR_ONE; + src_color_blend_factor = VK_BLEND_FACTOR_ONE; + } + + /** Comparison operator + * + * @param in Object to compare against. + * + * @return true if all states match, false otherwise. + **/ + bool operator==(const BlendingProperties& in) const + { + return (in.blend_enabled == blend_enabled && + in.blend_op_alpha == blend_op_alpha && + in.blend_op_color == blend_op_color && + in.channel_write_mask == channel_write_mask && + in.dst_alpha_blend_factor == dst_alpha_blend_factor && + in.dst_color_blend_factor == dst_color_blend_factor && + in.src_alpha_blend_factor == src_alpha_blend_factor && + in.src_color_blend_factor == src_color_blend_factor); + } + } BlendingProperties; + + typedef std::map SubPassAttachmentToBlendingPropertiesMap; + + /** Defines a single scissor box + * + * This descriptor is not exposed to the Vulkan implementation. It is used to form Vulkan-specific + * descriptors at baking time instead. + */ + struct InternalScissorBox + { + int32_t x; + int32_t y; + uint32_t width; + uint32_t height; + + /* Constructor. Should only be used by STL. */ + InternalScissorBox() + { + x = 0; + y = 0; + width = 32u; + height = 32u; + } + + /* Constructor + * + * @param in_x X offset of the scissor box + * @param in_y Y offset of the scissor box + * @param in_width Width of the scissor box + * @param in_height Height of the scissor box + **/ + InternalScissorBox(int32_t in_x, + int32_t in_y, + uint32_t in_width, + uint32_t in_height) + { + height = in_height; + width = in_width; + x = in_x; + y = in_y; + } + }; + + /** Defines a single viewport + * + * This descriptor is not exposed to the Vulkan implementation. It is used to form Vulkan-specific + * descriptors at baking time instead. + */ + typedef struct InternalViewport + { + float height; + float max_depth; + float min_depth; + float origin_x; + float origin_y; + float width; + + /* Constructor. Should only be used by STL */ + InternalViewport() + { + height = 32.0f; + max_depth = 1.0f; + min_depth = 0.0f; + origin_x = 0.0f; + origin_y = 0.0f; + width = 32.0f; + } + + /* Constructor. + * + * @param in_origin_x Origin X of the viewport. + * @param in_origin_y Origin Y of the viewport. + * @param in_width Width of the viewport. + * @param in_height Height of the viewport. + * @param in_min_depth Minimum depth value the viewport should use. + * @param in_max_depth Maximum depth value the viewport should use. + **/ + InternalViewport(float in_origin_x, + float in_origin_y, + float in_width, + float in_height, + float in_min_depth, + float in_max_depth) + { + height = in_height; + max_depth = in_max_depth; + min_depth = in_min_depth; + origin_x = in_origin_x; + origin_y = in_origin_y; + width = in_width; + } + } InternalViewport; + + /** A vertex attribute descriptor. This descriptor is not exposed to the Vulkan implementation. Instead, + * its members are used to create Vulkan input attribute & binding descriptors at baking time. + */ + typedef struct InternalVertexAttribute + { + uint32_t explicit_binding_index; + VkFormat format; + uint32_t location; + uint32_t offset_in_bytes; + VkVertexInputRate rate; + uint32_t stride_in_bytes; + + /** Dummy constructor. Should only be used by STL. */ + InternalVertexAttribute() + { + explicit_binding_index = UINT32_MAX; + format = VK_FORMAT_UNDEFINED; + location = UINT32_MAX; + offset_in_bytes = UINT32_MAX; + rate = VK_VERTEX_INPUT_RATE_MAX_ENUM; + stride_in_bytes = UINT32_MAX; + } + + /** Constructor. + * + * @param in_format Attribute format. + * @param in_location Attribute location. + * @param in_offset_in_bytes Start offset in bytes. + * @param in_rate Step rate. + * @param in_stride_in_bytes Stride in bytes. + **/ + InternalVertexAttribute(uint32_t in_explicit_binding_index, + VkFormat in_format, + uint32_t in_location, + uint32_t in_offset_in_bytes, + VkVertexInputRate in_rate, + uint32_t in_stride_in_bytes) + { + explicit_binding_index = in_explicit_binding_index; + format = in_format; + location = in_location; + offset_in_bytes = in_offset_in_bytes; + rate = in_rate; + stride_in_bytes = in_stride_in_bytes; + } + } InternalVertexAttribute; + + typedef std::map InternalScissorBoxes; + typedef std::vector InternalVertexAttributes; + typedef std::map InternalViewports; + + /* Private functions */ + explicit GraphicsPipelineInfo(std::shared_ptr in_renderpass_ptr, + SubPassID in_subpass_id); + + bool copy_gfx_state_from(const Anvil::GraphicsPipelineInfo* in_src_pipeline_info_ptr); + + /* Private variables */ + bool m_depth_bounds_test_enabled; + float m_max_depth_bounds; + float m_min_depth_bounds; + + bool m_depth_bias_enabled; + float m_depth_bias_clamp; + float m_depth_bias_constant_factor; + float m_depth_bias_slope_factor; + + bool m_depth_test_enabled; + VkCompareOp m_depth_test_compare_op; + + DynamicStateBitfield m_enabled_dynamic_states; + + bool m_alpha_to_coverage_enabled; + bool m_alpha_to_one_enabled; + bool m_depth_clamp_enabled; + bool m_depth_writes_enabled; + bool m_logic_op_enabled; + bool m_primitive_restart_enabled; + bool m_rasterizer_discard_enabled; + bool m_sample_mask_enabled; + bool m_sample_shading_enabled; + + bool m_stencil_test_enabled; + VkStencilOpState m_stencil_state_back_face; + VkStencilOpState m_stencil_state_front_face; + + VkRasterizationOrderAMD m_rasterization_order; + + InternalVertexAttributes m_attributes; + float m_blend_constant[4]; + VkPolygonMode m_polygon_mode; + VkFrontFace m_front_face; + float m_line_width; + VkLogicOp m_logic_op; + float m_min_sample_shading; + uint32_t m_n_dynamic_scissor_boxes; + uint32_t m_n_dynamic_viewports; + uint32_t m_n_patch_control_points; + VkPrimitiveTopology m_primitive_topology; + VkSampleMask m_sample_mask; + InternalScissorBoxes m_scissor_boxes; + SubPassAttachmentToBlendingPropertiesMap m_subpass_attachment_blending_properties; + InternalViewports m_viewports; + + VkCullModeFlagsVariable (m_cull_mode); + VkSampleCountFlagsVariable(m_sample_count); + + std::shared_ptr m_renderpass_ptr; + SubPassID m_subpass_id; + }; + +}; + +#endif /* ANVIL_GRAPHICS_PIPELINE_INFO_H */ diff --git a/include/misc/memory_allocator.h b/include/misc/memory_allocator.h index 461985b4..10ab3a3a 100644 --- a/include/misc/memory_allocator.h +++ b/include/misc/memory_allocator.h @@ -24,13 +24,13 @@ * objects. At baking time, non-overlapping regions of memory storage are distributed to the objects, * respect to object-specific alignment requirements. * - * The allocator uses a single memory heap for all allocations, so it may not work in all cases. - * This will be improved at some point in the future. + * MT-safe at an opt-in basis. **/ #ifndef MISC_MEMORY_ALLOCATOR_H #define MISC_MEMORY_ALLOCATOR_H #include "misc/debug.h" +#include "misc/mt_safety.h" #include "misc/types.h" #include @@ -39,8 +39,8 @@ namespace Anvil { typedef std::function MemoryAllocatorBakeCallbackFunction; - /** Implements a simple memory allocator. For more details, please see the header. */ - class MemoryAllocator : public std::enable_shared_from_this + class MemoryAllocator : public MTSafetySupportProvider, + public std::enable_shared_from_this { public: /* Public type definitions */ @@ -49,6 +49,7 @@ namespace Anvil ITEM_TYPE_BUFFER, ITEM_TYPE_IMAGE_WHOLE, + ITEM_TYPE_SPARSE_BUFFER_REGION, ITEM_TYPE_SPARSE_IMAGE_MIPTAIL, ITEM_TYPE_SPARSE_IMAGE_SUBRESOURCE, } ItemType; @@ -74,6 +75,7 @@ namespace Anvil MemoryFeatureFlags alloc_memory_required_features; uint32_t alloc_memory_supported_memory_types; uint32_t alloc_memory_types; + VkDeviceSize alloc_offset; VkDeviceSize alloc_size; VkExtent3D extent; @@ -91,6 +93,15 @@ namespace Anvil MemoryFeatureFlags in_alloc_required_memory_features, uint32_t in_alloc_supported_memory_types); + Item(std::shared_ptr in_memory_allocator_ptr, + std::shared_ptr in_buffer_ptr, + VkDeviceSize in_alloc_offset, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types); + Item(std::shared_ptr in_memory_allocator_ptr, std::shared_ptr in_image_ptr, uint32_t in_n_layer, @@ -189,6 +200,20 @@ namespace Anvil std::shared_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features); + /** TODO + * + * @param in_buffer_ptr TODO + * @param in_offset TODO. Must be divisible by VkMemoryRequirements::alignment + * @param in_size TODO. + * @param in_required_memory_features TODO + * + * @return TODO + */ + bool add_sparse_buffer_region(std::shared_ptr in_buffer_ptr, + VkDeviceSize in_offset, + VkDeviceSize in_size, + MemoryFeatureFlags in_required_memory_features); + /** Adds an Image object which should be assigned storage coming from memory objects * maintained by the Memory Allocator. At baking time, all subresources of the image, * as well as all miptails (in case of resident images) will be assigned memory regions. @@ -260,7 +285,8 @@ namespace Anvil * * @param in_device_ptr Device to use. **/ - static std::shared_ptr create_oneshot(std::weak_ptr in_device_ptr); + static std::shared_ptr create_oneshot(std::weak_ptr in_device_ptr, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Creates a new VMA memory allocator instance. * @@ -268,7 +294,8 @@ namespace Anvil * * @param in_device_ptr Device to use. **/ - static std::shared_ptr create_vma(std::weak_ptr in_device_ptr); + static std::shared_ptr create_vma(std::weak_ptr in_device_ptr, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Assigns a func pointer which will be called by the allocator after all added objects * have been assigned memory blocks. @@ -288,7 +315,6 @@ namespace Anvil ~MemoryAllocator(); private: - /* Private functions */ bool add_buffer_internal(std::shared_ptr in_buffer_ptr, MemoryFeatureFlags in_required_memory_features); @@ -304,7 +330,8 @@ namespace Anvil * * Please see create() documentation for specification. */ MemoryAllocator(std::weak_ptr in_device_ptr, - std::shared_ptr in_backend_ptr); + std::shared_ptr in_backend_ptr, + bool in_mt_safe); MemoryAllocator (const MemoryAllocator&); MemoryAllocator& operator=(const MemoryAllocator&); diff --git a/include/misc/mt_safety.h b/include/misc/mt_safety.h new file mode 100644 index 00000000..fe7c1772 --- /dev/null +++ b/include/misc/mt_safety.h @@ -0,0 +1,85 @@ +// +// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#ifndef MISC_MT_SAFETY_H +#define MISC_MT_SAFETY_H + +#include "misc/types.h" + + +namespace Anvil +{ + class MTSafetySupportProvider + { + public: + explicit MTSafetySupportProvider(const bool& in_enable) + { + if (in_enable) + { + m_mutex_ptr.reset( + new std::recursive_mutex() + ); + + anvil_assert(m_mutex_ptr != nullptr); + } + } + + virtual ~MTSafetySupportProvider() + { + /* Stub */ + } + + inline bool is_mt_safe() const + { + return (m_mutex_ptr != nullptr); + } + + inline void lock() + { + if (m_mutex_ptr != nullptr) + { + m_mutex_ptr->lock(); + } + } + + inline void unlock() + { + if (m_mutex_ptr != nullptr) + { + m_mutex_ptr->unlock(); + } + } + + protected: + std::recursive_mutex* get_mutex() const + { + return m_mutex_ptr.get(); + } + + private: + std::unique_ptr m_mutex_ptr; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(MTSafetySupportProvider); + ANVIL_DISABLE_COPY_CONSTRUCTOR (MTSafetySupportProvider); + }; +}; /* namespace Anvil */ + +#endif /* MISC_MT_SAFETY_H */ diff --git a/include/misc/object_tracker.h b/include/misc/object_tracker.h index 0202c223..9ba25087 100644 --- a/include/misc/object_tracker.h +++ b/include/misc/object_tracker.h @@ -45,14 +45,20 @@ namespace Anvil { typedef enum { - /* Callback issued when a new Anvil object is instantiated + /* Callback issued when a new GLSLShaderToSPIRVGenerator object is instantiated * * @param callback_arg OnObjectRegisteredCallbackArgument structure instance - **/ - OBJECT_TRACKER_CALLBACK_ID_ON_OBJECT_REGISTERED, + */ + OBJECT_TRACKER_CALLBACK_ID_ON_GLSL_SHADER_TO_SPIRV_GENERATOR_OBJECT_REGISTERED, + /* Callback issued when a new ShaderModule object is instantiated + * + * @param callback_arg OnObjectRegisteredCallbackArgument structure instance + */ + OBJECT_TRACKER_CALLBACK_ID_ON_SHADER_MODULE_OBJECT_REGISTERED, - /* Callback issued when an existing Anvil object instance is about to go out of scope. + + /* Callback issued when an existing Device object instance is about to go out of scope. * * This callback IS issued BEFORE a corresponding Vulkan handle is destroyed. * @@ -61,20 +67,41 @@ namespace Anvil * * @param callback_arg OnObjectAboutToBeUnregisteredCallbackArgument structure instance **/ - OBJECT_TRACKER_CALLBACK_ID_ON_OBJECT_ABOUT_TO_BE_UNREGISTERED, + OBJECT_TRACKER_CALLBACK_ID_ON_DEVICE_OBJECT_ABOUT_TO_BE_UNREGISTERED, - /* Specialized case of OBJECT_TRACKER_CALLBACK_ID_ON_OBJECT_ABOUT_TO_BE_UNREGISTERED. + /* Callback issued when an existing GLSLShaderToSPIRVGenerator object instance is about to go out of scope. * - * Uses the same callback argument. - */ - OBJECT_TRACKER_CALLBACK_ID_ON_DEVICE_OBJECT_ABOUT_TO_BE_UNREGISTERED, + * This callback IS issued BEFORE a corresponding Vulkan handle is destroyed. + * + * This callback MAY be issued FROM WITHIN the object's destructor, implying all WEAK POINTERS pointing + * to the wrapper instance will have been expired at the time of the callback. + * + * @param callback_arg OnObjectAboutToBeUnregisteredCallbackArgument structure instance + **/ + OBJECT_TRACKER_CALLBACK_ID_ON_GLSL_SHADER_TO_SPIRV_GENERATOR_OBJECT_ABOUT_TO_BE_UNREGISTERED, - /* Specialized case of OBJECT_TRACKER_CALLBACK_ID_ON_OBJECT_ABOUT_TO_BE_UNREGISTERED. + /* Callback issued when an existing PipelineLayout object instance is about to go out of scope. * - * Uses the same callback argument. - */ + * This callback IS issued BEFORE a corresponding Vulkan handle is destroyed. + * + * This callback MAY be issued FROM WITHIN the object's destructor, implying all WEAK POINTERS pointing + * to the wrapper instance will have been expired at the time of the callback. + * + * @param callback_arg OnObjectAboutToBeUnregisteredCallbackArgument structure instance + **/ OBJECT_TRACKER_CALLBACK_ID_ON_PIPELINE_LAYOUT_OBJECT_ABOUT_TO_BE_UNREGISTERED, + /* Callback issued when an existing ShaderModule object instance is about to go out of scope. + * + * This callback IS issued BEFORE a corresponding Vulkan handle is destroyed. + * + * This callback MAY be issued FROM WITHIN the object's destructor, implying all WEAK POINTERS pointing + * to the wrapper instance will have been expired at the time of the callback. + * + * @param callback_arg OnObjectAboutToBeUnregisteredCallbackArgument structure instance + **/ + OBJECT_TRACKER_CALLBACK_ID_ON_SHADER_MODULE_OBJECT_ABOUT_TO_BE_UNREGISTERED, + OBJECT_TRACKER_CALLBACK_ID_COUNT, } ObjectTrackerCallbackID; diff --git a/include/misc/page_tracker.h b/include/misc/page_tracker.h index fdda511c..16b02ad9 100644 --- a/include/misc/page_tracker.h +++ b/include/misc/page_tracker.h @@ -42,19 +42,21 @@ namespace Anvil explicit PageTracker(VkDeviceSize in_region_size, VkDeviceSize in_page_size); - /** Retrieves a memory block assigned to the region . + /** Retrieves a memory block assigned to the region . * + * NOTE: in_size must not be larger than page size of the memory block. * NOTE: The caller should NOT assume subsequent pages are assigned the same memory block, unless the application never binds * more than one memory block to a sparsely-bound buffer / image. * - * @param in_start_offset_page_aligned Start offset of the page. Must be page size-aligned. - * @param out_memory_region_start_offset_ptr Deref will be set to the start offset, which corresponds to @param in_start_offset_page_aligned + * @param in_start_offset Start offset of the page.. + * @param out_memory_region_start_offset_ptr Deref will be set to the start offset, which corresponds to @param in_start_offset * from the returned memory object's PoV. Must not be NULL. * * @return Memory block instance bound to the specified page OR null, if no memory block has been assigned to the memory region. */ std::shared_ptr get_memory_block(VkDeviceSize in_start_offset_page_aligned, - VkDeviceSize* out_memory_region_start_offset_ptr); + VkDeviceSize in_size, + VkDeviceSize* out_memory_region_start_offset_ptr) const; /** The same memory block is often bound to more than just one page. PageTracker * coalesces such occurences into a single descriptor. diff --git a/include/misc/render_pass_info.h b/include/misc/render_pass_info.h new file mode 100644 index 00000000..7270eb87 --- /dev/null +++ b/include/misc/render_pass_info.h @@ -0,0 +1,772 @@ +// +// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef MISC_RENDERPASS_INFO_H +#define MISC_RENDERPASS_INFO_H + +#include "misc/types.h" + +namespace Anvil +{ + class RenderPassInfo + { + public: + RenderPassInfo(std::weak_ptr in_device_ptr); + ~RenderPassInfo(); + + /** Adds a new render-pass color attachment to the internal data model. + * + * This function does NOT re-create the internal VkRenderPass instance. Instead, + * it marks the RenderPass as dirty, which will cause the object to be re-created + * at next bake() or get_render_pass() request. + * + * @param in_format Image format to use for the color attachment. + * @param in_sample_count Number of samples to use for the color attachment (expressed as enum value). + * @param in_load_op Load operation to use for the color attachment. + * @param in_store_op Store operation to use for the color attachment. + * @param in_initial_layout Initial layout to use for the color attachment. + * @param in_final_layout Final layout to use for the color attachment. + * @param in_may_alias true if the memory backing of the image that will be attached may + * overlap with the backing of another attachment within the same + * subpass. + * @param out_attachment_id_ptr Deref will be set to a unique ID assigned to the new color attachment. + * Must not be nullptr. + * + * @return true if the function executed successfully, false otherwise. + **/ + bool add_color_attachment(VkFormat in_format, + VkSampleCountFlags in_sample_count, + VkAttachmentLoadOp in_load_op, + VkAttachmentStoreOp in_store_op, + VkImageLayout in_initial_layout, + VkImageLayout in_final_layout, + bool in_may_alias, + RenderPassAttachmentID* out_attachment_id_ptr); + + /** Adds a new render-pass depth/stencil attachment to the internal data model. + * + * This function does NOT re-create the internal VkRenderPass instance. Instead, + * it marks the RenderPass as dirty, which will cause the object to be re-created + * at next bake() or get_render_pass() request. + * + * @param in_format Image format to use for the color attachment. + * @param in_sample_count Number of samples to use for the depth-stencil attachment (expressed as enum value). + * @param in_depth_load_op Load operation to use for the depth data. + * @param in_depth_store_op Store operation to use for the depth data. + * @param in_stencil_load_op Load operation to use for the stencil data. + * @param in_stencil_store_op Store operation to use for the stencil data. + * @param in_initial_layout Initial layout to use for the color attachment. + * @param in_final_layout Final layout to use for the color attachment. + * @param in_may_alias true if the memory backing of the image that will be attached may + * overlap with the backing of another attachment within the same + * subpass. + * @param out_attachment_id_ptr Deref will be set to a unique ID assigned to the new color attachment. + * Must not be nullptr. + * + * @return true if the function executed successfully, false otherwise. + **/ + bool add_depth_stencil_attachment(VkFormat in_format, + VkSampleCountFlags in_sample_count, + VkAttachmentLoadOp in_depth_load_op, + VkAttachmentStoreOp in_depth_store_op, + VkAttachmentLoadOp in_stencil_load_op, + VkAttachmentStoreOp in_stencil_store_op, + VkImageLayout in_initial_layout, + VkImageLayout in_final_layout, + bool in_may_alias, + RenderPassAttachmentID* out_attachment_id_ptr); + + /** Adds a new subpass to the internal data model. + * + * This function does NOT re-create the internal VkRenderPass instance. Instead, + * it marks the RenderPass as dirty, which will cause the object to be re-created + * at next bake() or get_render_pass() request. + * + * @param out_subpass_id_ptr Deref will be set to a unique ID of the created subpass. + * Must not be nullptr. + * + * @return true if the function executed successfully, false otherwise. + **/ + bool add_subpass(SubPassID* out_subpass_id_ptr); + + /** Adds a new color attachment to the RenderPass instance's specified subpass. + * + * This function does NOT re-create the internal VkRenderPass instance. Instead, + * it marks the RenderPass as dirty, which will cause the object to be re-created + * at next bake() or get_render_pass() request. + * + * @param in_subpass_id ID of the render-pass subpass to update. + * @param in_layout Layout to use for the attachment when executing the subpass. + * Driver takes care of transforming the attachment to the requested layout + * before subpass commands starts executing. + * @param in_attachment_id ID of the render-pass attachment the new sub-pass color attachment + * should refer to. + * @param in_location Location, under which the specified attachment should be accessible to + * the fragment shader. + * @param in_attachment_resolve_id_ptr Must be nullptr if the new color attachment should be single-sample. + * For multi-sample, this argument can optionally point to a render-pass + * attachment descriptor, to which the MS attachment should be resolved to. + * + * @return true if the function executed successfully, false otherwise. + **/ + bool add_subpass_color_attachment(SubPassID in_subpass_id, + VkImageLayout in_layout, + RenderPassAttachmentID in_attachment_id, + uint32_t in_location, + const RenderPassAttachmentID* in_opt_attachment_resolve_id_ptr); + + /** Configures the depth+stencil attachment the subpass should use. + * + * Note that only up to one depth/stencil attachment may be added for each subpass. + * Any attempt to add more such attachments will results in an assertion failure. + * + * This function does NOT re-create the internal VkRenderPass instance. Instead, + * it marks the RenderPass as dirty, which will cause the object to be re-created + * at next bake() or get_render_pass() request. + * + * @param in_subpass_id ID of the subpass to update the depth+stencil attachment for. + * The subpass must have been earlier created with an add_subpass() call. + * @param in_attachment_id ID of the render-pass attachment the depth-stencil attachment should refer to. + * @param in_layout Layout to use for the attachment when executing the subpass. + * Driver takes care of transforming the attachment to the requested layout + * before subpass commands starts executing. + * + * @return true if the function executed successfully, false otherwise. + * + */ + bool add_subpass_depth_stencil_attachment(SubPassID in_subpass_id, + RenderPassAttachmentID in_attachment_id, + VkImageLayout in_layout); + + /** Adds a new input attachment to the RenderPass instance's specified subpass. + * + * This function does NOT re-create the internal VkRenderPass instance. Instead, + * it marks the RenderPass as dirty, which will cause the object to be re-created + * at next bake() or get_render_pass() request. + * + * @param in_subpass_id ID of the render-pass subpass to update. + * @param in_layout Layout to use for the attachment when executing the subpass. + * Driver takes care of transforming the attachment to the requested layout + * before subpass commands starts executing. + * @param in_attachment_id ID of the render-pass attachment the new sub-pass input attachment + * should refer to. + * @param in_attachment_index The "input attachment index", under which the specified attachment should + * be accessible to the fragment shader. Do not forget the image view also + * needs to be bound to the descriptor set for the input attachment to work! + * + * @return true if the function executed successfully, false otherwise. + **/ + bool add_subpass_input_attachment(SubPassID in_subpass_id, + VkImageLayout in_layout, + RenderPassAttachmentID in_attachment_id, + uint32_t in_attachment_index); + + /** Adds a new external->subpass dependency to the internal data model. + * + * This function does NOT re-create the internal VkRenderPass instance. Instead, + * it marks the RenderPass as dirty, which will cause the object to be re-created + * at next bake() or get_render_pass() request. + * + * @param in_destination_subpass_id ID of the destination subpass. The subpass must have been + * created earlier with an add_subpass() call. + * @param in_source_stage_mask Source pipeline stage mask. + * @param in_destination_stage_mask Destination pipeline stage mask. + * @param in_source_access_mask Source access mask. + * @param in_destination_access_mask Destination access mask. + * @param in_by_region true if a "by-region" dependency is requested; false otherwise. + * + * @return true if the dependency was added successfully; false otherwise. + * + **/ + bool add_external_to_subpass_dependency(SubPassID in_destination_subpass_id, + VkPipelineStageFlags in_source_stage_mask, + VkPipelineStageFlags in_destination_stage_mask, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region); + + /** Adds a new self-subpass dependency to the internal data model. + * + * This function does NOT re-create the internal VkRenderPass instance. Instead, + * it marks the RenderPass as dirty, which will cause the object to be re-created + * at next bake() or get_render_pass() request. + * + * @param in_destination_subpass_id ID of the subpass to create the dep for. The subpass must have been + * created earlier with an add_subpass() call. + * @param in_source_stage_mask Source pipeline stage mask. + * @param in_destination_stage_mask Destination pipeline stage mask. + * @param in_source_access_mask Source access mask. + * @param in_destination_access_mask Destination access mask. + * @param in_by_region true if a "by-region" dependency is requested; false otherwise. + * + * @return true if the dependency was added successfully; false otherwise. + * + **/ + bool add_self_subpass_dependency(SubPassID in_destination_subpass_id, + VkPipelineStageFlags in_source_stage_mask, + VkPipelineStageFlags in_destination_stage_mask, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region); + + /** Adds a new subpass->external dependency to the internal data model. + * + * This function does NOT re-create the internal VkRenderPass instance. Instead, + * it marks the RenderPass as dirty, which will cause the object to be re-created + * at next bake() or get_render_pass() request. + * + * @param in_source_subpass_id ID of the source subpass. The subpass must have been + * created earlier with an add_subpass() call. + * @param in_source_stage_mask Source pipeline stage mask. + * @param in_destination_stage_mask Destination pipeline stage mask. + * @param in_source_access_mask Source access mask. + * @param in_destination_access_mask Destination access mask. + * @param in_by_region true if a "by-region" dependency is requested; false otherwise. + * + * @return true if the dependency was added successfully; false otherwise. + **/ + bool add_subpass_to_external_dependency(SubPassID in_source_subpass_id, + VkPipelineStageFlags in_source_stage_mask, + VkPipelineStageFlags in_destination_stage_mask, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region); + + /** Adds a new subpass->subpass dependency to the internal data model. + * + * This function does NOT re-create the internal VkRenderPass instance. Instead, + * it marks the RenderPass as dirty, which will cause the object to be re-created + * at next bake() or get_render_pass() request. + * + * @param in_source_subpass_id ID of the source subpass. The subpass must have been + * created earlier with an add_subpass() call. + * @param in_destination_subpass_id ID of the source subpass. The subpass must have been + * created earlier with an add_subpass() call. + * @param in_source_stage_mask Source pipeline stage mask. + * @param in_destination_stage_mask Destination pipeline stage mask. + * @param in_source_access_mask Source access mask. + * @param in_destination_access_mask Destination access mask. + * @param in_by_region true if a "by-region" dependency is requested; false otherwise. + * + * @return true if the dependency was added successfully; false otherwise. + **/ + bool add_subpass_to_subpass_dependency(SubPassID in_source_subpass_id, + SubPassID in_destination_subpass_id, + VkPipelineStageFlags in_source_stage_mask, + VkPipelineStageFlags in_destination_stage_mask, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region); + + /** Tells what type an attachment with user-specified ID has. + * + * @return true if successful, false otherwise + */ + bool get_attachment_type(RenderPassAttachmentID in_attachment_id, + AttachmentType* out_attachment_type_ptr) const; + + /** Retrieves properties of the render pass color attachment with the user-specified ID + * + * @param in_attachment_id ID of the attachment to retrieve properties of. + * @param out_opt_sample_count_ptr If not nullptr, deref will be set to the sample count, specified + * at attachment creation time. May be nullptr. + * @param out_opt_load_op_ptr If not nullptr, deref will be set to the load op, specified at + * attachment creation time. May be nullptr. + * @param out_opt_store_op_ptr If not nullptr, deref will be set to the store op, specified at + * attachment creation time. May be nullptr. + * @param out_opt_initial_layout_ptr If not nullptr, deref will be set to the initial layout, specified + * at attachment creation time. May be nullptr. + * @param out_opt_final_layout_ptr If not nullptr, deref will be set to the final layout, specified at + * attachment creation time. May be nullptr. + * @param out_opt_may_alias_ptr If not nullptr, deref will be set to set to true, if the attachment + * can alias other attachments. Otherwise, it will be set to false. + * May be nullptr. + * + * @return true if successful, false otherwise. + **/ + bool get_color_attachment_properties(RenderPassAttachmentID in_attachment_id, + VkSampleCountFlagBits* out_opt_sample_count_ptr = nullptr, + VkAttachmentLoadOp* out_opt_load_op_ptr = nullptr, + VkAttachmentStoreOp* out_opt_store_op_ptr = nullptr, + VkImageLayout* out_opt_initial_layout_ptr = nullptr, + VkImageLayout* out_opt_final_layout_ptr = nullptr, + bool* out_opt_may_alias_ptr = nullptr) const; + + /** Retrieves properties of a dependency at user-specified index. + * + * @param in_n_dependency Index of the dependency to retrieve properties of. + * @param out_destination_subpass_id_ptr Deref will be set to the ID of the dependency's destination, + * or to UINT32_MAX, if the destination of the dependency is external. + * Must not be null. + * @param out_source_subpass_id_ptr Deref will be set to the ID of the dependency's source, + * or to UINT32_MAX, if the source of the dependency is external. + * Must not be null. + * @param out_destination_stage_mask_ptr Deref will be set to the destination stage mask set for the dependency. + * Must not be null. + * @param out_source_stage_mask_ptr Deref will be set to the source stage mask set for the dependency. + * Must not be null. + * @param out_destination_access_mask_ptr Deref will be set to the destination access mask set for the dependency. + * Must not be null. + * @param out_source_access_mask_ptr Deref will be set to the source access mask set for the dependency. + * Must not be null. + * @param out_by_region_ptr Deref will be set to true, if the dependency is a by-region dependency. + * If it is not, deref will be set to false. Must not be null. + * + * @return true if successful, false otherwise + */ + bool get_dependency_properties(uint32_t in_n_dependency, + SubPassID* out_destination_subpass_id_ptr, + SubPassID* out_source_subpass_id_ptr, + VkPipelineStageFlags* out_destination_stage_mask_ptr, + VkPipelineStageFlags* out_source_stage_mask_ptr, + VkAccessFlags* out_destination_access_mask_ptr, + VkAccessFlags* out_source_access_mask_ptr, + bool* out_by_region_ptr) const; + + /** Retrieves properties of the render pass color attachment with the user-specified ID + * + * @param in_attachment_id ID of the attachment to retrieve properties of. + * @param out_opt_depth_load_op_ptr If not nullptr, deref will be set to the depth-specific load op, specified at + * attachment creation time. May be nullptr. + * @param out_opt_depth_store_op_ptr If not nullptr, deref will be set to the depth-specific store op, specified at + * attachment creation time. May be nullptr. + * @param out_opt_stencil_load_op_ptr If not nullptr, deref will be set to the stencil-specific load op, specified at + * attachment creation time. May be nullptr. + * @param out_opt_stencil_store_op_ptr If not nullptr, deref will be set to the stencil-specific store op, specified at + * attachment creation time. May be nullptr. + * @param out_opt_initial_layout_ptr If not nullptr, deref will be set to the initial layout, specified + * at attachment creation time. May be nullptr. + * @param out_opt_final_layout_ptr If not nullptr, deref will be set to the final layout, specified at + * attachment creation time. May be nullptr. + * @param out_opt_may_alias_ptr If not nullptr, deref will be set to set to true, if the attachment + * can alias other attachments. Otherwise, it will be set to false. + * May be nullptr. + * + * @return true if successful, false otherwise. + **/ + bool get_depth_stencil_attachment_properties(RenderPassAttachmentID in_attachment_id, + VkAttachmentLoadOp* out_opt_depth_load_op_ptr = nullptr, + VkAttachmentStoreOp* out_opt_depth_store_op_ptr = nullptr, + VkAttachmentLoadOp* out_opt_stencil_load_op_ptr = nullptr, + VkAttachmentStoreOp* out_opt_stencil_store_op_ptr = nullptr, + VkImageLayout* out_opt_initial_layout_ptr = nullptr, + VkImageLayout* out_opt_final_layout_ptr = nullptr, + bool* out_opt_may_alias_ptr = nullptr) const; + + std::weak_ptr get_device() const + { + return m_device_ptr; + } + + /** Returns the number of added attachments */ + uint32_t get_n_attachments() const + { + return static_cast(m_attachments.size() ); + } + + /** Returns the number of added dependencies */ + uint32_t get_n_dependencies() const + { + return static_cast(m_subpass_dependencies.size() ); + } + + /** Returns the number of added subpasses */ + uint32_t get_n_subpasses() const + { + return static_cast(m_subpasses.size() ); + } + + /** Retrieves subpass attachment properties, as specified at creation time. + * + * Triggers baking process if the renderpass is marked as dirty. + * + * @param in_subpass_id ID of the subpass to use for the query. + * @param in_attachment_type Type of the attachment to use for the query. Must not be ATTACHMENT_TYPE_PRESERVE. + * @param out_renderpass_attachment_id_ptr Deref will be set to the ID of the renderpass attachment this subpass + * attachment uses. + * @param out_layout_ptr Deref will be set to the image layout assigned to the attachment for the specific + * subpass. Must be NULL if @param in_attachment_type is ATTACHMENT_TYPE_PRESERVE. + * + * @return true if successful, false otherwise. + */ + bool get_subpass_attachment_properties(SubPassID in_subpass_id, + AttachmentType in_attachment_type, + uint32_t in_n_subpass_attachment, + RenderPassAttachmentID* out_renderpass_attachment_id_ptr, + VkImageLayout* out_layout_ptr); + + /** Returns the number of attachments of user-specified type, defined for the specified subpass. + * + * This function may trigger renderpass bake process, if the renderpass is marked as dirty + * at the query time, and @param in_attachment_type is set to ATTACHMENT_TYPE_PRESERVE. + * + * @param in_subpass_id As per description. + * @param in_attachment_type Type of the attachment to use for the query. + * @param out_n_attachments_ptr Deref will be set to the value above. Must not be nullptr. + * Will only be touched if the function returns true. + * + * @return true if the function was successful, false otherwise. + **/ + bool get_subpass_n_attachments(SubPassID in_subpass_id, + AttachmentType in_attachment_type, + uint32_t* out_n_attachments_ptr); + + private: + /* Private type definitions */ + + /** Holds properties of a single render-pass attachment. **/ + typedef struct RenderPassAttachment + { + VkAttachmentLoadOp color_depth_load_op; + VkAttachmentStoreOp color_depth_store_op; + VkImageLayout final_layout; + VkFormat format; + uint32_t index; + VkImageLayout initial_layout; + bool may_alias; + VkAttachmentLoadOp stencil_load_op; + VkAttachmentStoreOp stencil_store_op; + AttachmentType type; + + VkSampleCountFlagsVariable(sample_count); + + /** Constructor. Should only be used for color attachments. + * + * @param in_format Format that will be used by the render-pass attachment. + * @param in_sample_count Number of samples of the render-pass attachment (expressed as enum value) + * @param in_load_op Load operation to use for the render-pass attachment. + * @param in_store_op Store operation to use for the render-pass attachment. + * @param in_initial_layout Initial layout fo the render-pass attachment. + * @param in_final_layout Layout to transfer the render-pass attachment to, after + * the render-pass finishes. + * @param in_may_alias true if the attachment's memory backing may alias with + * memory region of another attachment; false otherwise. + * @param in_index Index of the created render-pass attachment. + ***/ + RenderPassAttachment(VkFormat in_format, + VkSampleCountFlags in_sample_count, + VkAttachmentLoadOp in_load_op, + VkAttachmentStoreOp in_store_op, + VkImageLayout in_initial_layout, + VkImageLayout in_final_layout, + bool in_may_alias, + uint32_t in_index) + { + color_depth_load_op = in_load_op; + color_depth_store_op = in_store_op; + final_layout = in_final_layout; + format = in_format; + index = in_index; + initial_layout = in_initial_layout; + may_alias = in_may_alias; + sample_count = in_sample_count; + stencil_load_op = VK_ATTACHMENT_LOAD_OP_DONT_CARE; + stencil_store_op = VK_ATTACHMENT_STORE_OP_DONT_CARE; + type = ATTACHMENT_TYPE_COLOR; + } + + /** Constructor. Should only be used for depth/stencil attachments + * + * @param in_format Format that will be used by the render-pass attachment. + * @param in_sample_count Number of samples of the render-pass attachment (expressed as enum value) + * @param in_depth_load_op Load operation to use for the render-pass attachment's depth data. + * @param in_depth_store_op Store operation to use for the render-pass attachment's depth data. + * @param in_stencil_load_op Load operation to use for the render-pass attachment's stencil data. + * @param in_stencil_store_op Store operation to use for the render-pass attachment's stencil data. + * @param in_initial_layout Initial layout fo the render-pass attachment. + * @param in_final_layout Layout to transfer the render-pass attachment to, after + * the render-pass finishes. + * @param in_may_alias true if the attachment's memory backing may alias with + * memory region of another attachment; false otherwise. + * @param in_index Index of the created render-pass attachment. + **/ + RenderPassAttachment(VkFormat in_format, + VkSampleCountFlags in_sample_count, + VkAttachmentLoadOp in_depth_load_op, + VkAttachmentStoreOp in_depth_store_op, + VkAttachmentLoadOp in_stencil_load_op, + VkAttachmentStoreOp in_stencil_store_op, + VkImageLayout in_initial_layout, + VkImageLayout in_final_layout, + bool in_may_alias, + uint32_t in_index) + { + color_depth_load_op = in_depth_load_op; + color_depth_store_op = in_depth_store_op; + final_layout = in_final_layout; + format = in_format; + index = in_index; + initial_layout = in_initial_layout; + may_alias = in_may_alias; + sample_count = in_sample_count; + stencil_load_op = in_stencil_load_op; + stencil_store_op = in_stencil_store_op; + type = ATTACHMENT_TYPE_DEPTH_STENCIL; + } + + /** Dummy constructor. This should only be used by STL containers. */ + RenderPassAttachment() + { + color_depth_load_op = VK_ATTACHMENT_LOAD_OP_MAX_ENUM; + color_depth_store_op = VK_ATTACHMENT_STORE_OP_MAX_ENUM; + final_layout = VK_IMAGE_LAYOUT_MAX_ENUM; + format = VK_FORMAT_MAX_ENUM; + index = UINT32_MAX; + initial_layout = VK_IMAGE_LAYOUT_MAX_ENUM; + may_alias = false; + sample_count = static_cast(0); + stencil_load_op = VK_ATTACHMENT_LOAD_OP_MAX_ENUM; + stencil_store_op = VK_ATTACHMENT_STORE_OP_MAX_ENUM; + type = ATTACHMENT_TYPE_UNKNOWN; + } + } RenderPassAttachment; + + typedef std::vector RenderPassAttachments; + + /* Holds properties of a sub-pass attachment */ + typedef struct SubPassAttachment + { + RenderPassAttachment* attachment_ptr; + uint32_t highest_subpass_index; + VkImageLayout layout; + uint32_t lowest_subpass_index; + RenderPassAttachment* resolve_attachment_ptr; + + /* Dummy constructor. Should only be used by STL containers */ + SubPassAttachment() + { + attachment_ptr = nullptr; + highest_subpass_index = UINT32_MAX; + layout = VK_IMAGE_LAYOUT_MAX_ENUM; + lowest_subpass_index = UINT32_MAX; + resolve_attachment_ptr = nullptr; + } + + /** Constructor. + * + * @param in_attachment_ptr Render-pass attachment that this sub-pass attachment should reference. + * Must not be nullptr. + * @param in_layout Layout to use for the attachment when executing the subpass. + * Driver takes care of transforming the attachment to the requested layout + * before subpass commands starts executing. + * @param in_resolve_attachment_ptr If not nullptr, this should point to the render-pass attachment, to which + * MS data of @param in_attachment_ptr should be resolved. If nullptr, it is + * assumed the sub-pass should not resolve the MS data. + **/ + SubPassAttachment(RenderPassAttachment* in_attachment_ptr, + VkImageLayout in_layout, + RenderPassAttachment* in_opt_resolve_attachment_ptr) + { + attachment_ptr = in_attachment_ptr; + highest_subpass_index = UINT32_MAX; + layout = in_layout; + lowest_subpass_index = UINT32_MAX; + resolve_attachment_ptr = in_opt_resolve_attachment_ptr; + } + } SubPassAttachment; + + typedef std::map LocationToSubPassAttachmentMap; + typedef LocationToSubPassAttachmentMap::const_iterator LocationToSubPassAttachmentMapConstIterator; + typedef std::vector SubPassAttachmentVector; + + /** Holds properties of a single sub-pass */ + typedef struct SubPass + { + LocationToSubPassAttachmentMap color_attachments_map; + SubPassAttachment depth_stencil_attachment; + uint32_t index; + LocationToSubPassAttachmentMap input_attachments_map; + SubPassAttachmentVector preserved_attachments; + LocationToSubPassAttachmentMap resolved_attachments_map; + + SubPassAttachment* get_color_attachment_at_index(uint32_t in_index) + { + return get_attachment_at_index(color_attachments_map, + in_index); + } + + SubPassAttachment* get_input_attachment_at_index(uint32_t in_index) + { + return get_attachment_at_index(input_attachments_map, + in_index); + } + + SubPassAttachment* get_resolved_attachment_at_index(uint32_t in_index) + { + return get_attachment_at_index(resolved_attachments_map, + in_index); + } + + /** Dummy constructor. This should only be used by STL containers */ + SubPass() + { + index = UINT32_MAX; + } + + /** Constructor. + * + * @param in_index Index of the sub-pass + * + **/ + SubPass(uint32_t in_index) + { + index = in_index; + } + + /* Destructor */ + ~SubPass(); + + private: + /** Returns a pointer to the SubPassAttachment instance, assigned to the index specified + * under @param index in @param in_map. + **/ + SubPassAttachment* get_attachment_at_index(LocationToSubPassAttachmentMap& in_map, + uint32_t in_index) + { + uint32_t current_index = 0; + SubPassAttachment* result_ptr = nullptr; + + for (auto attachment_iterator = in_map.begin(); + attachment_iterator != in_map.end(); + ++attachment_iterator, ++current_index) + { + if (current_index == in_index) + { + result_ptr = &attachment_iterator->second; + + break; + } + } + + return result_ptr; + } + + SubPass (const SubPass&); + SubPass& operator=(const SubPass&); + } SubPass; + + typedef std::vector > SubPasses; + typedef SubPasses::const_iterator SubPassesConstIterator; + + /** Holds properties of a single subpass<->subpass dependency. */ + typedef struct SubPassDependency + { + VkAccessFlagsVariable (destination_access_mask); + VkPipelineStageFlagsVariable(destination_stage_mask); + VkAccessFlagsVariable (source_access_mask); + VkPipelineStageFlagsVariable(source_stage_mask); + + bool by_region; + const SubPass* destination_subpass_ptr; + const SubPass* source_subpass_ptr; + + /** Constructor. + * + * @param in_destination_stage_mask Destination pipeline stage mask. + * @param in_destination_subpass_ptr Pointer to the descriptor of the destination subpass. + * If nullptr, it is assumed an external destination is requested. + * @param in_source_stage_mask Source pipeline stage mask. + * @param in_source_subpass_ptr Pointer to the descriptor of the source subpass. + * If nullptr, it is assumed an external source is requested. + * @param in_source_access_mask Source access mask. + * @param in_destination_access_mask Destination access mask. + * @param in_by_region true if a "by-region" dependency is requested; false otherwise. + **/ + SubPassDependency(VkPipelineStageFlags in_destination_stage_mask, + const SubPass* in_destination_subpass_ptr, + VkPipelineStageFlags in_source_stage_mask, + const SubPass* in_source_subpass_ptr, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region) + { + by_region = in_by_region; + destination_stage_mask = static_cast(in_destination_stage_mask); + destination_subpass_ptr = in_destination_subpass_ptr; + destination_access_mask = static_cast (in_destination_access_mask); + source_access_mask = static_cast (in_source_access_mask); + source_stage_mask = static_cast(in_source_stage_mask); + source_subpass_ptr = in_source_subpass_ptr; + } + + /** Dummy constructor. Should only be used by STL containers */ + SubPassDependency() + { + destination_access_mask = static_cast (0); + destination_stage_mask = static_cast(0); + destination_subpass_ptr = nullptr; + source_access_mask = static_cast (0); + source_stage_mask = static_cast(0); + source_subpass_ptr = nullptr; + } + + /** Comparator operator */ + bool operator==(const SubPassDependency& in) + { + return in.by_region == by_region && + in.destination_access_mask == destination_access_mask && + in.destination_stage_mask == destination_stage_mask && + in.destination_subpass_ptr == destination_subpass_ptr && + in.source_access_mask == source_access_mask && + in.source_stage_mask == source_stage_mask && + in.source_subpass_ptr == source_subpass_ptr; + } + } SubPassDependency; + + typedef std::vector SubPassDependencies; + + + /* Private functions */ + + bool add_dependency (SubPass* in_destination_subpass_ptr, + SubPass* in_source_subpass_ptr, + VkPipelineStageFlags in_source_stage_mask, + VkPipelineStageFlags in_destination_stage_mask, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region); + bool add_subpass_attachment(SubPassID in_subpass_id, + bool in_is_color_attachment, + VkImageLayout in_input_layout, + RenderPassAttachmentID in_attachment_id, + uint32_t in_attachment_location, + bool in_should_resolve, + RenderPassAttachmentID in_resolve_attachment_id); + + VkAttachmentReference get_attachment_reference_from_renderpass_attachment(const RenderPassAttachment& in_renderpass_attachment) const; + VkAttachmentReference get_attachment_reference_from_subpass_attachment (const SubPassAttachment& in_subpass_attachment) const; + VkAttachmentReference get_attachment_reference_for_resolve_attachment (const SubPassesConstIterator& in_subpass_iterator, + const LocationToSubPassAttachmentMapConstIterator& in_location_to_subpass_att_map_iterator) const; + void update_preserved_attachments (); + + + /* Private variables */ + RenderPassAttachments m_attachments; + std::weak_ptr m_device_ptr; + SubPasses m_subpasses; + SubPassDependencies m_subpass_dependencies; + bool m_update_preserved_attachments; + + friend class Anvil::RenderPass; + }; +}; + +#endif /* MISC_RENDERPASS_INFO_H */ diff --git a/include/misc/shader_module_cache.h b/include/misc/shader_module_cache.h index 6ec82d08..86dbe19b 100644 --- a/include/misc/shader_module_cache.h +++ b/include/misc/shader_module_cache.h @@ -23,6 +23,7 @@ #ifndef WRAPPERS_SHADER_MODULE_CACHE_H #define WRAPPERS_SHADER_MODULE_CACHE_H +#include "misc/mt_safety.h" #include "misc/types.h" namespace Anvil @@ -33,7 +34,7 @@ namespace Anvil * * Shader module cache is thread-safe. */ - class ShaderModuleCache + class ShaderModuleCache : public MTSafetySupportProvider { public: /* Public functions */ @@ -148,11 +149,10 @@ namespace Anvil const std::string& in_te_entrypoint_name, const std::string& in_vs_entrypoint_name) const; - void on_object_about_to_be_released(CallbackArgument* in_callback_arg_ptr); - void on_object_registered (CallbackArgument* in_callback_arg_ptr); + void on_shader_module_object_about_to_be_released(CallbackArgument* in_callback_arg_ptr); + void on_shader_module_object_registered (CallbackArgument* in_callback_arg_ptr); /* Private variables */ - std::mutex m_cs; std::map m_items; ANVIL_DISABLE_ASSIGNMENT_OPERATOR(ShaderModuleCache); diff --git a/include/misc/types.h b/include/misc/types.h index d4ec02c8..d7ac967c 100644 --- a/include/misc/types.h +++ b/include/misc/types.h @@ -228,7 +228,9 @@ struct \ { \ uint8_t VK_DEPENDENCY_BY_REGION_BIT : 1; \ - uint32_t OTHER: 31; \ + uint8_t VK_DEPENDENCY_VIEW_LOCAL_BIT_KHX : 1; \ + uint8_t VK_DEPENDENCY_DEVICE_GROUP_BIT_KHX : 1; \ + uint32_t OTHER: 29; \ } name##_flags; \ }; @@ -523,20 +525,24 @@ namespace Anvil { /* Forward declarations */ class BaseDevice; + class BasePipelineInfo; class Buffer; class BufferView; struct CallbackArgument; class CommandBufferBase; class CommandPool; + class ComputePipelineInfo; class ComputePipelineManager; class DescriptorPool; class DescriptorSet; class DescriptorSetGroup; + class DescriptorSetInfo; class DescriptorSetLayout; class Event; class Fence; class Framebuffer; class GLSLShaderToSPIRVGenerator; + class GraphicsPipelineInfo; class GraphicsPipelineManager; class Image; class ImageView; @@ -555,6 +561,7 @@ namespace Anvil class Queue; class RenderingSurface; class RenderPass; + class RenderPassInfo; class Sampler; class SecondaryCommandBuffer; class Semaphore; @@ -579,6 +586,21 @@ namespace Anvil ATTACHMENT_TYPE_UNKNOWN = ATTACHMENT_TYPE_COUNT }; + typedef enum + { + DYNAMIC_STATE_BLEND_CONSTANTS_BIT = 1 << 0, + DYNAMIC_STATE_DEPTH_BIAS_BIT = 1 << 1, + DYNAMIC_STATE_DEPTH_BOUNDS_BIT = 1 << 2, + DYNAMIC_STATE_LINE_WIDTH_BIT = 1 << 3, + DYNAMIC_STATE_SCISSOR_BIT = 1 << 4, + DYNAMIC_STATE_STENCIL_COMPARE_MASK_BIT = 1 << 5, + DYNAMIC_STATE_STENCIL_REFERENCE_BIT = 1 << 6, + DYNAMIC_STATE_STENCIL_WRITE_MASK_BIT = 1 << 7, + DYNAMIC_STATE_VIEWPORT_BIT = 1 << 8, + } DynamicStateBits; + + typedef uint32_t DynamicStateBitfield; + /** Describes a buffer memory barrier. */ typedef struct BufferBarrier { @@ -694,9 +716,12 @@ namespace Anvil ExtensionAvailability amd_rasterization_order; ExtensionAvailability amd_shader_ballot; ExtensionAvailability amd_shader_explicit_vertex_parameter; + ExtensionAvailability amd_shader_info; ExtensionAvailability amd_shader_trinary_minmax; ExtensionAvailability amd_texture_gather_bias_lod; + ExtensionAvailability ext_debug_marker; + ExtensionAvailability ext_shader_stencil_export; ExtensionAvailability ext_shader_subgroup_ballot; ExtensionAvailability ext_shader_subgroup_vote; ExtensionAvailability khr_16bit_storage; @@ -720,7 +745,6 @@ namespace Anvil { /* BaseDevice is implemented by SGPUDevice class */ DEVICE_TYPE_SINGLE_GPU, - } DeviceType; /** Holds properties of a single Vulkan Extension */ @@ -760,6 +784,16 @@ namespace Anvil } } ExtensionAMDDrawIndirectCountEntrypoints; + typedef struct ExtensionAMDShaderInfoEntrypoints + { + PFN_vkGetShaderInfoAMD vkGetShaderInfoAMD; + + ExtensionAMDShaderInfoEntrypoints() + { + vkGetShaderInfoAMD = nullptr; + } + } ExtensionAMDShaderInfoEntrypoints; + typedef struct ExtensionEXTDebugMarkerEntrypoints { PFN_vkCmdDebugMarkerBeginEXT vkCmdDebugMarkerBeginEXT; @@ -1515,6 +1549,13 @@ namespace Anvil uint32_t in_row_size); } MipmapRawData; + typedef enum + { + MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + MT_SAFETY_ENABLED, + MT_SAFETY_DISABLED + } MTSafety; + /* Dummy delete functor */ template struct NullDeleter @@ -1626,23 +1667,14 @@ namespace Anvil typedef std::pair BindingElementArrayRange; typedef std::vector PushConstantRanges; - /** A bitmask defining one or more queue family usage.*/ - typedef enum - { - QUEUE_FAMILY_COMPUTE_BIT = 1 << 0, - QUEUE_FAMILY_DMA_BIT = 1 << 1, - QUEUE_FAMILY_GRAPHICS_BIT = 1 << 2, - } QueueFamily; - typedef int QueueFamilyBits; - /** Holds information about a single Vulkan Queue Family. */ typedef struct QueueFamilyInfo { VkQueueFlagsVariable(flags); - VkExtent3D min_image_transfer_granularity; - uint32_t n_queues; - uint32_t n_timestamp_bits; + VkExtent3D min_image_transfer_granularity; + uint32_t n_queues; + uint32_t n_timestamp_bits; /** Constructor. Initializes the instance using data provided by the driver. * @@ -1678,14 +1710,14 @@ namespace Anvil /** Base pipeline ID. Internal type, used to represent compute / graphics pipeline IDs */ typedef uint32_t PipelineID; - /** Pipeline layout ID */ - typedef uint32_t PipelineLayoutID; - - /** Compute Pipeline ID */ - typedef PipelineID ComputePipelineID; - - /** Graphics Pipeline ID */ - typedef PipelineID GraphicsPipelineID; + /** A bitmask defining one or more queue family usage.*/ + typedef enum + { + QUEUE_FAMILY_COMPUTE_BIT = 1 << 0, + QUEUE_FAMILY_DMA_BIT = 1 << 1, + QUEUE_FAMILY_GRAPHICS_BIT = 1 << 2, + } QueueFamily; + typedef int QueueFamilyBits; /* Used internally by Buffer and Image to track page occupancy status */ typedef union @@ -1759,6 +1791,17 @@ namespace Anvil SHADER_STAGE_UNKNOWN = SHADER_STAGE_COUNT } ShaderStage; + /* Specifies the type of query for post-compile information about pipeline shaders */ + typedef enum + { + SHADER_INFO_FIRST, + + SHADER_INFO_TYPE_BINARY = SHADER_INFO_FIRST, + SHADER_INFO_TYPE_DISASSEMBLY, + SHADER_INFO_COUNT, + SHADER_INFO_UNKNOWN = SHADER_INFO_COUNT + } ShaderInfoType; + /** Holds all information related to a specific shader module stage entry-point. */ typedef struct ShaderModuleStageEntryPoint { @@ -1836,6 +1879,38 @@ namespace Anvil SPARSE_RESIDENCY_SCOPE_UNDEFINED } SparseResidencyScope; + typedef struct SpecializationConstant + { + uint32_t constant_id; + uint32_t n_bytes; + uint32_t start_offset; + + /** Dummy constructor. Should only be used by STL containers. */ + SpecializationConstant() + { + constant_id = UINT32_MAX; + n_bytes = UINT32_MAX; + start_offset = UINT32_MAX; + } + + /** Constructor. + * + * @param in_constant_id Specialization constant ID. + * @param in_n_bytes Number of bytes consumed by the constant. + * @param in_start_offset Start offset, at which the constant data starts. + */ + SpecializationConstant(uint32_t in_constant_id, + uint32_t in_n_bytes, + uint32_t in_start_offset) + { + constant_id = in_constant_id; + n_bytes = in_n_bytes; + start_offset = in_start_offset; + } + } SpecializationConstant; + + typedef std::vector SpecializationConstants; + /* Holds 16-bit storage features */ typedef struct StorageFeatures16Bit { @@ -1893,6 +1968,13 @@ namespace Anvil namespace Utils { + MTSafety convert_boolean_to_mt_safety_enum(bool in_mt_safe); + + bool convert_mt_safety_enum_to_boolean(MTSafety in_mt_safety, + std::weak_ptr in_device_ptr); + + Anvil::QueueFamilyBits get_queue_family_bits_from_queue_family_type(Anvil::QueueFamilyType in_queue_family_type); + /** Converts a Anvil::QueueFamilyBits bitfield value to an array of queue family indices. * * @param in_queue_families Input value to convert from. @@ -1926,6 +2008,14 @@ namespace Anvil Anvil::MemoryFeatureFlags get_memory_feature_flags_from_vk_property_flags(VkMemoryPropertyFlags in_opt_mem_type_flags, VkMemoryHeapFlags in_opt_mem_heap_flags); + /** Converts the specified queue family type to a raw string + * + * @param in_queue_family_type Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(Anvil::QueueFamilyType in_queue_family_type); + /** Converts the specified VkAttachmentLoadOp value to a raw string * * @param in_load_op Input value. @@ -2452,14 +2542,6 @@ namespace Anvil VkStructureType type; const void* next_ptr; } VkStructHeader; - - /* Describes recognized subpass attachment types */ - enum Result - { - RESULT_SUCCESS, - RESULT_ERROR, - RESULT_NOT_SUPPORTED - }; }; /* Anvil namespace */ #endif /* MISC_TYPES_H */ diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h index ae039725..d3e2e246 100644 --- a/include/vulkan/vulkan.h +++ b/include/vulkan/vulkan.h @@ -6,7 +6,7 @@ extern "C" { #endif /* -** Copyright (c) 2015-2017 The Khronos Group Inc. +** Copyright (c) 2015-2018 The Khronos Group Inc. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ extern "C" { #define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) #define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff) // Version of this file -#define VK_HEADER_VERSION 57 +#define VK_HEADER_VERSION 68 #define VK_NULL_HANDLE 0 @@ -147,6 +147,7 @@ typedef enum VkResult { VK_ERROR_INVALID_SHADER_NV = -1000012000, VK_ERROR_OUT_OF_POOL_MEMORY_KHR = -1000069000, VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR = -1000072003, + VK_ERROR_NOT_PERMITTED_EXT = -1000174001, VK_RESULT_BEGIN_RANGE = VK_ERROR_FRAGMENTED_POOL, VK_RESULT_END_RANGE = VK_INCOMPLETE, VK_RESULT_RANGE_SIZE = (VK_INCOMPLETE - VK_ERROR_FRAGMENTED_POOL + 1), @@ -245,14 +246,14 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHX = 1000060004, VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHX = 1000060005, VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHX = 1000060006, + VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHX = 1000060010, + VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO_KHX = 1000060013, + VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHX = 1000060014, VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHX = 1000060007, VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHX = 1000060008, VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHX = 1000060009, - VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHX = 1000060010, VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHX = 1000060011, VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHX = 1000060012, - VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO_KHX = 1000060013, - VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHX = 1000060014, VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000, VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN = 1000062000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHX = 1000070000, @@ -293,17 +294,18 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004, VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005, VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV = 1000087000, - VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT = 1000090000, + VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT = 1000090000, VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT = 1000091000, VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT = 1000091001, VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT = 1000091002, VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT = 1000091003, VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE = 1000092000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES_KHX = 1000093000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX = 1000097000, VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV = 1000098000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT = 1000099000, VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT = 1000099001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT = 1000101000, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT = 1000101001, VK_STRUCTURE_TYPE_HDR_METADATA_EXT = 1000105000, VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR = 1000111000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO_KHR = 1000112000, @@ -322,20 +324,17 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR = 1000119001, VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR = 1000119002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR = 1000120000, - VK_STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR = 1000121000, - VK_STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR = 1000121001, - VK_STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR = 1000121002, - VK_STRUCTURE_TYPE_DISPLAY_PLANE_INFO_2_KHR = 1000121003, - VK_STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR = 1000121004, VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK = 1000122000, VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000123000, VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR = 1000127000, VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR = 1000127001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT = 1000130000, VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT = 1000130001, - VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO_KHR = 1000145000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES_KHR = 1000145001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES_KHR = 1000145002, + VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT = 1000143000, + VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT = 1000143001, + VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT = 1000143002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT = 1000143003, + VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT = 1000143004, VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR = 1000146000, VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR = 1000146001, VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2_KHR = 1000146002, @@ -355,6 +354,12 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES_KHR = 1000156005, VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR = 1000157000, VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR = 1000157001, + VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160000, + VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160001, + VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT = 1000174000, + VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT = 1000178000, + VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT = 1000178001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT = 1000178002, VK_STRUCTURE_TYPE_BEGIN_RANGE = VK_STRUCTURE_TYPE_APPLICATION_INFO, VK_STRUCTURE_TYPE_END_RANGE = VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO, VK_STRUCTURE_TYPE_RANGE_SIZE = (VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO - VK_STRUCTURE_TYPE_APPLICATION_INFO + 1), @@ -909,6 +914,7 @@ typedef enum VkDynamicState { VK_DYNAMIC_STATE_STENCIL_REFERENCE = 8, VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV = 1000087000, VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT = 1000099000, + VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT = 1000143000, VK_DYNAMIC_STATE_BEGIN_RANGE = VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_END_RANGE = VK_DYNAMIC_STATE_STENCIL_REFERENCE, VK_DYNAMIC_STATE_RANGE_SIZE = (VK_DYNAMIC_STATE_STENCIL_REFERENCE - VK_DYNAMIC_STATE_VIEWPORT + 1), @@ -1068,6 +1074,7 @@ typedef enum VkObjectType { VK_OBJECT_TYPE_OBJECT_TABLE_NVX = 1000086000, VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX = 1000086001, VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR = 1000156000, + VK_OBJECT_TYPE_VALIDATION_CACHE_EXT = 1000160000, VK_OBJECT_TYPE_BEGIN_RANGE = VK_OBJECT_TYPE_UNKNOWN, VK_OBJECT_TYPE_END_RANGE = VK_OBJECT_TYPE_COMMAND_POOL, VK_OBJECT_TYPE_RANGE_SIZE = (VK_OBJECT_TYPE_COMMAND_POOL - VK_OBJECT_TYPE_UNKNOWN + 1), @@ -1128,7 +1135,7 @@ typedef enum VkImageCreateFlagBits { VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = 0x00000020, VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR = 0x00000080, VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR = 0x00000100, - VK_IMAGE_CREATE_PROTECTED_BIT_KHR = 0x00000800, + VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT = 0x00001000, VK_IMAGE_CREATE_DISJOINT_BIT_KHR = 0x00000200, VK_IMAGE_CREATE_ALIAS_BIT_KHR = 0x00000400, VK_IMAGE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF @@ -1152,7 +1159,6 @@ typedef enum VkQueueFlagBits { VK_QUEUE_COMPUTE_BIT = 0x00000002, VK_QUEUE_TRANSFER_BIT = 0x00000004, VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, - VK_QUEUE_PROTECTED_BIT_KHR = 0x00000010, VK_QUEUE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkQueueFlagBits; typedef VkFlags VkQueueFlags; @@ -1163,7 +1169,6 @@ typedef enum VkMemoryPropertyFlagBits { VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004, VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008, VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010, - VK_MEMORY_PROPERTY_PROTECTED_BIT_KHR = 0x00000020, VK_MEMORY_PROPERTY_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkMemoryPropertyFlagBits; typedef VkFlags VkMemoryPropertyFlags; @@ -1175,11 +1180,6 @@ typedef enum VkMemoryHeapFlagBits { } VkMemoryHeapFlagBits; typedef VkFlags VkMemoryHeapFlags; typedef VkFlags VkDeviceCreateFlags; - -typedef enum VkDeviceQueueCreateFlagBits { - VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT_KHR = 0x00000001, - VK_DEVICE_QUEUE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkDeviceQueueCreateFlagBits; typedef VkFlags VkDeviceQueueCreateFlags; typedef enum VkPipelineStageFlagBits { @@ -1270,7 +1270,6 @@ typedef enum VkBufferCreateFlagBits { VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, - VK_BUFFER_CREATE_PROTECTED_BIT_KHR = 0x00000008, VK_BUFFER_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkBufferCreateFlagBits; typedef VkFlags VkBufferCreateFlags; @@ -1410,7 +1409,6 @@ typedef VkFlags VkDependencyFlags; typedef enum VkCommandPoolCreateFlagBits { VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, - VK_COMMAND_POOL_CREATE_PROTECTED_BIT_KHR = 0x00000004, VK_COMMAND_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkCommandPoolCreateFlagBits; typedef VkFlags VkCommandPoolCreateFlags; @@ -2555,7 +2553,6 @@ typedef struct VkDrawIndirectCommand { } VkDrawIndirectCommand; -typedef VkResult (VKAPI_PTR *PFN_vkEnumerateInstanceVersion)(uint32_t* pApiVersion); typedef VkResult (VKAPI_PTR *PFN_vkCreateInstance)(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance); typedef void (VKAPI_PTR *PFN_vkDestroyInstance)(VkInstance instance, const VkAllocationCallbacks* pAllocator); typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDevices)(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices); @@ -2695,9 +2692,6 @@ typedef void (VKAPI_PTR *PFN_vkCmdEndRenderPass)(VkCommandBuffer commandBuffer); typedef void (VKAPI_PTR *PFN_vkCmdExecuteCommands)(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers); #ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceVersion( - uint32_t* pApiVersion); - VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance( const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, @@ -3627,7 +3621,6 @@ VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) typedef enum VkSwapchainCreateFlagBitsKHR { VK_SWAPCHAIN_CREATE_BIND_SFR_BIT_KHX = 0x00000001, - VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR = 0x00000002, VK_SWAPCHAIN_CREATE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF } VkSwapchainCreateFlagBitsKHR; typedef VkFlags VkSwapchainCreateFlagsKHR; @@ -4207,6 +4200,9 @@ typedef enum VkExternalMemoryHandleTypeFlagBitsKHR { VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR = 0x00000010, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR = 0x00000020, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR = 0x00000040, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT = 0x00000200, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT = 0x00000080, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT = 0x00000100, VK_EXTERNAL_MEMORY_HANDLE_TYPE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF } VkExternalMemoryHandleTypeFlagBitsKHR; typedef VkFlags VkExternalMemoryHandleTypeFlagsKHR; @@ -4970,72 +4966,8 @@ typedef struct VkPhysicalDeviceVariablePointerFeaturesKHR { -#define VK_KHR_get_display_properties2 1 -#define VK_KHR_GET_DISPLAY_PROPERTIES_2_SPEC_VERSION 1 -#define VK_KHR_GET_DISPLAY_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_display_properties2" - -typedef struct VkDisplayProperties2KHR { - VkStructureType sType; - void* pNext; - VkDisplayPropertiesKHR displayProperties; -} VkDisplayProperties2KHR; - -typedef struct VkDisplayPlaneProperties2KHR { - VkStructureType sType; - void* pNext; - VkDisplayPlanePropertiesKHR displayPlaneProperties; -} VkDisplayPlaneProperties2KHR; - -typedef struct VkDisplayModeProperties2KHR { - VkStructureType sType; - void* pNext; - VkDisplayModePropertiesKHR displayModeProperties; -} VkDisplayModeProperties2KHR; - -typedef struct VkDisplayPlaneInfo2KHR { - VkStructureType sType; - const void* pNext; - VkDisplayModeKHR mode; - uint32_t planeIndex; -} VkDisplayPlaneInfo2KHR; - -typedef struct VkDisplayPlaneCapabilities2KHR { - VkStructureType sType; - void* pNext; - VkDisplayPlaneCapabilitiesKHR capabilities; -} VkDisplayPlaneCapabilities2KHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceDisplayProperties2KHR)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayProperties2KHR* pProperties); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceDisplayPlaneProperties2KHR)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPlaneProperties2KHR* pProperties); -typedef VkResult (VKAPI_PTR *PFN_vkGetDisplayModeProperties2KHR)(VkPhysicalDevice physicalDevice, VkDisplayKHR display, uint32_t* pPropertyCount, VkDisplayModeProperties2KHR* pProperties); -typedef VkResult (VKAPI_PTR *PFN_vkGetDisplayPlaneCapabilities2KHR)(VkPhysicalDevice physicalDevice, const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo, VkDisplayPlaneCapabilities2KHR* pCapabilities); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceDisplayProperties2KHR( - VkPhysicalDevice physicalDevice, - uint32_t* pPropertyCount, - VkDisplayProperties2KHR* pProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceDisplayPlaneProperties2KHR( - VkPhysicalDevice physicalDevice, - uint32_t* pPropertyCount, - VkDisplayPlaneProperties2KHR* pProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayModeProperties2KHR( - VkPhysicalDevice physicalDevice, - VkDisplayKHR display, - uint32_t* pPropertyCount, - VkDisplayModeProperties2KHR* pProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayPlaneCapabilities2KHR( - VkPhysicalDevice physicalDevice, - const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo, - VkDisplayPlaneCapabilities2KHR* pCapabilities); -#endif - #define VK_KHR_dedicated_allocation 1 -#define VK_KHR_DEDICATED_ALLOCATION_SPEC_VERSION 1 +#define VK_KHR_DEDICATED_ALLOCATION_SPEC_VERSION 3 #define VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_KHR_dedicated_allocation" typedef struct VkMemoryDedicatedRequirementsKHR { @@ -5064,30 +4996,6 @@ typedef struct VkMemoryDedicatedAllocateInfoKHR { #define VK_KHR_RELAXED_BLOCK_LAYOUT_EXTENSION_NAME "VK_KHR_relaxed_block_layout" -#define VK_KHR_protected_memory 1 -#define VK_KHR_PROTECTED_MEMORY_SPEC_VERSION 2 -#define VK_KHR_PROTECTED_MEMORY_EXTENSION_NAME "VK_KHR_protected_memory" - -typedef struct VkProtectedSubmitInfoKHR { - VkStructureType sType; - const void* pNext; - VkBool32 protectedSubmit; -} VkProtectedSubmitInfoKHR; - -typedef struct VkPhysicalDeviceProtectedMemoryFeaturesKHR { - VkStructureType sType; - void* pNext; - VkBool32 protectedMemory; -} VkPhysicalDeviceProtectedMemoryFeaturesKHR; - -typedef struct VkPhysicalDeviceProtectedMemoryPropertiesKHR { - VkStructureType sType; - void* pNext; - VkBool32 protectedNoFault; -} VkPhysicalDeviceProtectedMemoryPropertiesKHR; - - - #define VK_KHR_get_memory_requirements2 1 #define VK_KHR_GET_MEMORY_REQUIREMENTS_2_SPEC_VERSION 1 #define VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME "VK_KHR_get_memory_requirements2" @@ -5178,12 +5086,11 @@ typedef enum VkSamplerYcbcrModelConversionKHR { } VkSamplerYcbcrModelConversionKHR; typedef enum VkSamplerYcbcrRangeKHR { - VK_SAMPLER_YCBCR_RANGE_KHRONOS_KHR = 0, - VK_SAMPLER_YCBCR_RANGE_ITU_FULL_KHR = 1, - VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR = 2, - VK_SAMPLER_YCBCR_RANGE_BEGIN_RANGE_KHR = VK_SAMPLER_YCBCR_RANGE_KHRONOS_KHR, + VK_SAMPLER_YCBCR_RANGE_ITU_FULL_KHR = 0, + VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR = 1, + VK_SAMPLER_YCBCR_RANGE_BEGIN_RANGE_KHR = VK_SAMPLER_YCBCR_RANGE_ITU_FULL_KHR, VK_SAMPLER_YCBCR_RANGE_END_RANGE_KHR = VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR, - VK_SAMPLER_YCBCR_RANGE_RANGE_SIZE_KHR = (VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR - VK_SAMPLER_YCBCR_RANGE_KHRONOS_KHR + 1), + VK_SAMPLER_YCBCR_RANGE_RANGE_SIZE_KHR = (VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR - VK_SAMPLER_YCBCR_RANGE_ITU_FULL_KHR + 1), VK_SAMPLER_YCBCR_RANGE_MAX_ENUM_KHR = 0x7FFFFFFF } VkSamplerYcbcrRangeKHR; @@ -5200,8 +5107,8 @@ typedef struct VkSamplerYcbcrConversionCreateInfoKHR { VkStructureType sType; const void* pNext; VkFormat format; - VkSamplerYcbcrModelConversionKHR YcbcrModel; - VkSamplerYcbcrRangeKHR YcbcrRange; + VkSamplerYcbcrModelConversionKHR ycbcrModel; + VkSamplerYcbcrRangeKHR ycbcrRange; VkComponentMapping components; VkChromaLocationKHR xChromaOffset; VkChromaLocationKHR yChromaOffset; @@ -5241,7 +5148,7 @@ typedef struct VkSamplerYcbcrConversionImageFormatPropertiesKHR { typedef VkResult (VKAPI_PTR *PFN_vkCreateSamplerYcbcrConversionKHR)(VkDevice device, const VkSamplerYcbcrConversionCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversionKHR* pYcbcrConversion); -typedef void (VKAPI_PTR *PFN_vkDestroySamplerYcbcrConversionKHR)(VkDevice device, VkSamplerYcbcrConversionKHR YcbcrConversion, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkDestroySamplerYcbcrConversionKHR)(VkDevice device, VkSamplerYcbcrConversionKHR ycbcrConversion, const VkAllocationCallbacks* pAllocator); #ifndef VK_NO_PROTOTYPES VKAPI_ATTR VkResult VKAPI_CALL vkCreateSamplerYcbcrConversionKHR( @@ -5252,7 +5159,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateSamplerYcbcrConversionKHR( VKAPI_ATTR void VKAPI_CALL vkDestroySamplerYcbcrConversionKHR( VkDevice device, - VkSamplerYcbcrConversionKHR YcbcrConversion, + VkSamplerYcbcrConversionKHR ycbcrConversion, const VkAllocationCallbacks* pAllocator); #endif @@ -5295,7 +5202,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory2KHR( #define VK_EXT_debug_report 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) -#define VK_EXT_DEBUG_REPORT_SPEC_VERSION 8 +#define VK_EXT_DEBUG_REPORT_SPEC_VERSION 9 #define VK_EXT_DEBUG_REPORT_EXTENSION_NAME "VK_EXT_debug_report" #define VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT #define VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT @@ -5335,11 +5242,12 @@ typedef enum VkDebugReportObjectTypeEXT { VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30, VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31, VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32, + VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT = 33, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT = 1000085000, VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR_EXT = 1000156000, VK_DEBUG_REPORT_OBJECT_TYPE_BEGIN_RANGE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_END_RANGE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_RANGE_SIZE_EXT = (VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT - VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT + 1), + VK_DEBUG_REPORT_OBJECT_TYPE_END_RANGE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_RANGE_SIZE_EXT = (VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT - VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT + 1), VK_DEBUG_REPORT_OBJECT_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF } VkDebugReportObjectTypeEXT; @@ -5588,6 +5496,57 @@ typedef struct VkTextureLODGatherFormatPropertiesAMD { +#define VK_AMD_shader_info 1 +#define VK_AMD_SHADER_INFO_SPEC_VERSION 1 +#define VK_AMD_SHADER_INFO_EXTENSION_NAME "VK_AMD_shader_info" + + +typedef enum VkShaderInfoTypeAMD { + VK_SHADER_INFO_TYPE_STATISTICS_AMD = 0, + VK_SHADER_INFO_TYPE_BINARY_AMD = 1, + VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD = 2, + VK_SHADER_INFO_TYPE_BEGIN_RANGE_AMD = VK_SHADER_INFO_TYPE_STATISTICS_AMD, + VK_SHADER_INFO_TYPE_END_RANGE_AMD = VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD, + VK_SHADER_INFO_TYPE_RANGE_SIZE_AMD = (VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD - VK_SHADER_INFO_TYPE_STATISTICS_AMD + 1), + VK_SHADER_INFO_TYPE_MAX_ENUM_AMD = 0x7FFFFFFF +} VkShaderInfoTypeAMD; + +typedef struct VkShaderResourceUsageAMD { + uint32_t numUsedVgprs; + uint32_t numUsedSgprs; + uint32_t ldsSizePerLocalWorkGroup; + size_t ldsUsageSizeInBytes; + size_t scratchMemUsageInBytes; +} VkShaderResourceUsageAMD; + +typedef struct VkShaderStatisticsInfoAMD { + VkShaderStageFlags shaderStageMask; + VkShaderResourceUsageAMD resourceUsage; + uint32_t numPhysicalVgprs; + uint32_t numPhysicalSgprs; + uint32_t numAvailableVgprs; + uint32_t numAvailableSgprs; + uint32_t computeWorkGroupSize[3]; +} VkShaderStatisticsInfoAMD; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetShaderInfoAMD)(VkDevice device, VkPipeline pipeline, VkShaderStageFlagBits shaderStage, VkShaderInfoTypeAMD infoType, size_t* pInfoSize, void* pInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetShaderInfoAMD( + VkDevice device, + VkPipeline pipeline, + VkShaderStageFlagBits shaderStage, + VkShaderInfoTypeAMD infoType, + size_t* pInfoSize, + void* pInfo); +#endif + +#define VK_AMD_shader_image_load_store_lod 1 +#define VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_SPEC_VERSION 1 +#define VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_EXTENSION_NAME "VK_AMD_shader_image_load_store_lod" + + #define VK_KHX_multiview 1 #define VK_KHX_MULTIVIEW_SPEC_VERSION 1 #define VK_KHX_MULTIVIEW_EXTENSION_NAME "VK_KHX_multiview" @@ -5739,9 +5698,9 @@ typedef struct VkWin32KeyedMutexAcquireReleaseInfoNV { #endif /* VK_USE_PLATFORM_WIN32_KHR */ #define VK_KHX_device_group 1 -#define VK_MAX_DEVICE_GROUP_SIZE_KHX 32 #define VK_KHX_DEVICE_GROUP_SPEC_VERSION 2 #define VK_KHX_DEVICE_GROUP_EXTENSION_NAME "VK_KHX_device_group" +#define VK_MAX_DEVICE_GROUP_SIZE_KHX 32 typedef enum VkPeerMemoryFeatureFlagBitsKHX { @@ -5807,19 +5766,6 @@ typedef struct VkDeviceGroupBindSparseInfoKHX { uint32_t memoryDeviceIndex; } VkDeviceGroupBindSparseInfoKHX; -typedef struct VkDeviceGroupPresentCapabilitiesKHX { - VkStructureType sType; - const void* pNext; - uint32_t presentMask[VK_MAX_DEVICE_GROUP_SIZE_KHX]; - VkDeviceGroupPresentModeFlagsKHX modes; -} VkDeviceGroupPresentCapabilitiesKHX; - -typedef struct VkImageSwapchainCreateInfoKHX { - VkStructureType sType; - const void* pNext; - VkSwapchainKHR swapchain; -} VkImageSwapchainCreateInfoKHX; - typedef struct VkBindBufferMemoryDeviceGroupInfoKHX { VkStructureType sType; const void* pNext; @@ -5836,6 +5782,19 @@ typedef struct VkBindImageMemoryDeviceGroupInfoKHX { const VkRect2D* pSFRRects; } VkBindImageMemoryDeviceGroupInfoKHX; +typedef struct VkDeviceGroupPresentCapabilitiesKHX { + VkStructureType sType; + const void* pNext; + uint32_t presentMask[VK_MAX_DEVICE_GROUP_SIZE_KHX]; + VkDeviceGroupPresentModeFlagsKHX modes; +} VkDeviceGroupPresentCapabilitiesKHX; + +typedef struct VkImageSwapchainCreateInfoKHX { + VkStructureType sType; + const void* pNext; + VkSwapchainKHR swapchain; +} VkImageSwapchainCreateInfoKHX; + typedef struct VkBindImageMemorySwapchainInfoKHX { VkStructureType sType; const void* pNext; @@ -5870,11 +5829,11 @@ typedef struct VkDeviceGroupSwapchainCreateInfoKHX { typedef void (VKAPI_PTR *PFN_vkGetDeviceGroupPeerMemoryFeaturesKHX)(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlagsKHX* pPeerMemoryFeatures); typedef void (VKAPI_PTR *PFN_vkCmdSetDeviceMaskKHX)(VkCommandBuffer commandBuffer, uint32_t deviceMask); +typedef void (VKAPI_PTR *PFN_vkCmdDispatchBaseKHX)(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupPresentCapabilitiesKHX)(VkDevice device, VkDeviceGroupPresentCapabilitiesKHX* pDeviceGroupPresentCapabilities); typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupSurfacePresentModesKHX)(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHX* pModes); -typedef VkResult (VKAPI_PTR *PFN_vkAcquireNextImage2KHX)(VkDevice device, const VkAcquireNextImageInfoKHX* pAcquireInfo, uint32_t* pImageIndex); -typedef void (VKAPI_PTR *PFN_vkCmdDispatchBaseKHX)(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDevicePresentRectanglesKHX)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pRectCount, VkRect2D* pRects); +typedef VkResult (VKAPI_PTR *PFN_vkAcquireNextImage2KHX)(VkDevice device, const VkAcquireNextImageInfoKHX* pAcquireInfo, uint32_t* pImageIndex); #ifndef VK_NO_PROTOTYPES VKAPI_ATTR void VKAPI_CALL vkGetDeviceGroupPeerMemoryFeaturesKHX( @@ -5888,20 +5847,6 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetDeviceMaskKHX( VkCommandBuffer commandBuffer, uint32_t deviceMask); -VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupPresentCapabilitiesKHX( - VkDevice device, - VkDeviceGroupPresentCapabilitiesKHX* pDeviceGroupPresentCapabilities); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModesKHX( - VkDevice device, - VkSurfaceKHR surface, - VkDeviceGroupPresentModeFlagsKHX* pModes); - -VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImage2KHX( - VkDevice device, - const VkAcquireNextImageInfoKHX* pAcquireInfo, - uint32_t* pImageIndex); - VKAPI_ATTR void VKAPI_CALL vkCmdDispatchBaseKHX( VkCommandBuffer commandBuffer, uint32_t baseGroupX, @@ -5911,11 +5856,25 @@ VKAPI_ATTR void VKAPI_CALL vkCmdDispatchBaseKHX( uint32_t groupCountY, uint32_t groupCountZ); +VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupPresentCapabilitiesKHX( + VkDevice device, + VkDeviceGroupPresentCapabilitiesKHX* pDeviceGroupPresentCapabilities); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModesKHX( + VkDevice device, + VkSurfaceKHR surface, + VkDeviceGroupPresentModeFlagsKHX* pModes); + VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDevicePresentRectanglesKHX( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pRectCount, VkRect2D* pRects); + +VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImage2KHX( + VkDevice device, + const VkAcquireNextImageInfoKHX* pAcquireInfo, + uint32_t* pImageIndex); #endif #define VK_EXT_validation_flags 1 @@ -6010,7 +5969,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDeviceGroupsKHX( VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkObjectTableNVX) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkIndirectCommandsLayoutNVX) -#define VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 1 +#define VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 3 #define VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NVX_device_generated_commands" @@ -6300,6 +6259,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetRandROutputDisplayEXT( #define VK_EXT_display_surface_counter 1 #define VK_EXT_DISPLAY_SURFACE_COUNTER_SPEC_VERSION 1 #define VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME "VK_EXT_display_surface_counter" +#define VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT typedef enum VkSurfaceCounterFlagBitsEXT { @@ -6466,35 +6426,6 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPastPresentationTimingGOOGLE( VkPastPresentationTimingGOOGLE* pPresentationTimings); #endif -#define VK_KHX_subgroup 1 -#define VK_KHX_SUBGROUP_SPEC_VERSION 1 -#define VK_KHX_SUBGROUP_EXTENSION_NAME "VK_KHX_subgroup" - - -typedef enum VkSubgroupFeatureFlagBitsKHX { - VK_SUBGROUP_FEATURE_BIT_BASIC = 0x00000001, - VK_SUBGROUP_FEATURE_BIT_VOTE = 0x00000002, - VK_SUBGROUP_FEATURE_BIT_ARITHMETIC = 0x00000004, - VK_SUBGROUP_FEATURE_BIT_BALLOT = 0x00000008, - VK_SUBGROUP_FEATURE_BIT_SHUFFLE = 0x00000010, - VK_SUBGROUP_FEATURE_BIT_SHUFFLE_RELATIVE = 0x00000020, - VK_SUBGROUP_FEATURE_BIT_CLUSTERED = 0x00000040, - VK_SUBGROUP_FEATURE_BIT_QUAD = 0x00000080, - VK_SUBGROUP_FEATURE_FLAG_BITS_MAX_ENUM_KHX = 0x7FFFFFFF -} VkSubgroupFeatureFlagBitsKHX; -typedef VkFlags VkSubgroupFeatureFlagsKHX; - -typedef struct VkPhysicalDeviceSubgroupPropertiesKHX { - VkStructureType sType; - void* pNext; - uint32_t subgroupSize; - VkShaderStageFlags supportedStages; - VkSubgroupFeatureFlagsKHX supportedOperations; - VkBool32 quadOperationsInAllStages; -} VkPhysicalDeviceSubgroupPropertiesKHX; - - - #define VK_NV_sample_mask_override_coverage 1 #define VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_SPEC_VERSION 1 #define VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_EXTENSION_NAME "VK_NV_sample_mask_override_coverage" @@ -6603,6 +6534,47 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetDiscardRectangleEXT( const VkRect2D* pDiscardRectangles); #endif +#define VK_EXT_conservative_rasterization 1 +#define VK_EXT_CONSERVATIVE_RASTERIZATION_SPEC_VERSION 1 +#define VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME "VK_EXT_conservative_rasterization" + + +typedef enum VkConservativeRasterizationModeEXT { + VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT = 0, + VK_CONSERVATIVE_RASTERIZATION_MODE_OVERESTIMATE_EXT = 1, + VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT = 2, + VK_CONSERVATIVE_RASTERIZATION_MODE_BEGIN_RANGE_EXT = VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT, + VK_CONSERVATIVE_RASTERIZATION_MODE_END_RANGE_EXT = VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT, + VK_CONSERVATIVE_RASTERIZATION_MODE_RANGE_SIZE_EXT = (VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT - VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT + 1), + VK_CONSERVATIVE_RASTERIZATION_MODE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkConservativeRasterizationModeEXT; + +typedef VkFlags VkPipelineRasterizationConservativeStateCreateFlagsEXT; + +typedef struct VkPhysicalDeviceConservativeRasterizationPropertiesEXT { + VkStructureType sType; + void* pNext; + float primitiveOverestimationSize; + float maxExtraPrimitiveOverestimationSize; + float extraPrimitiveOverestimationSizeGranularity; + VkBool32 primitiveUnderestimation; + VkBool32 conservativePointAndLineRasterization; + VkBool32 degenerateTrianglesRasterized; + VkBool32 degenerateLinesRasterized; + VkBool32 fullyCoveredFragmentShaderInputVariable; + VkBool32 conservativeRasterizationPostDepthCoverage; +} VkPhysicalDeviceConservativeRasterizationPropertiesEXT; + +typedef struct VkPipelineRasterizationConservativeStateCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkPipelineRasterizationConservativeStateCreateFlagsEXT flags; + VkConservativeRasterizationModeEXT conservativeRasterizationMode; + float extraPrimitiveOverestimationSize; +} VkPipelineRasterizationConservativeStateCreateInfoEXT; + + + #define VK_EXT_swapchain_colorspace 1 #define VK_EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION 3 #define VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME "VK_EXT_swapchain_colorspace" @@ -6693,6 +6665,17 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateMacOSSurfaceMVK( #endif #endif /* VK_USE_PLATFORM_MACOS_MVK */ +#define VK_EXT_external_memory_dma_buf 1 +#define VK_EXT_EXTERNAL_MEMORY_DMA_BUF_SPEC_VERSION 1 +#define VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME "VK_EXT_external_memory_dma_buf" + + +#define VK_EXT_queue_family_foreign 1 +#define VK_EXT_QUEUE_FAMILY_FOREIGN_SPEC_VERSION 1 +#define VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME "VK_EXT_queue_family_foreign" +#define VK_QUEUE_FAMILY_FOREIGN_EXT (~0U-2) + + #define VK_EXT_sampler_filter_minmax 1 #define VK_EXT_SAMPLER_FILTER_MINMAX_SPEC_VERSION 1 #define VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME "VK_EXT_sampler_filter_minmax" @@ -6733,6 +6716,91 @@ typedef struct VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT { #define VK_AMD_MIXED_ATTACHMENT_SAMPLES_EXTENSION_NAME "VK_AMD_mixed_attachment_samples" +#define VK_AMD_shader_fragment_mask 1 +#define VK_AMD_SHADER_FRAGMENT_MASK_SPEC_VERSION 1 +#define VK_AMD_SHADER_FRAGMENT_MASK_EXTENSION_NAME "VK_AMD_shader_fragment_mask" + + +#define VK_EXT_shader_stencil_export 1 +#define VK_EXT_SHADER_STENCIL_EXPORT_SPEC_VERSION 1 +#define VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME "VK_EXT_shader_stencil_export" + + +#define VK_EXT_sample_locations 1 +#define VK_EXT_SAMPLE_LOCATIONS_SPEC_VERSION 1 +#define VK_EXT_SAMPLE_LOCATIONS_EXTENSION_NAME "VK_EXT_sample_locations" + +typedef struct VkSampleLocationEXT { + float x; + float y; +} VkSampleLocationEXT; + +typedef struct VkSampleLocationsInfoEXT { + VkStructureType sType; + const void* pNext; + VkSampleCountFlagBits sampleLocationsPerPixel; + VkExtent2D sampleLocationGridSize; + uint32_t sampleLocationsCount; + const VkSampleLocationEXT* pSampleLocations; +} VkSampleLocationsInfoEXT; + +typedef struct VkAttachmentSampleLocationsEXT { + uint32_t attachmentIndex; + VkSampleLocationsInfoEXT sampleLocationsInfo; +} VkAttachmentSampleLocationsEXT; + +typedef struct VkSubpassSampleLocationsEXT { + uint32_t subpassIndex; + VkSampleLocationsInfoEXT sampleLocationsInfo; +} VkSubpassSampleLocationsEXT; + +typedef struct VkRenderPassSampleLocationsBeginInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t attachmentInitialSampleLocationsCount; + const VkAttachmentSampleLocationsEXT* pAttachmentInitialSampleLocations; + uint32_t postSubpassSampleLocationsCount; + const VkSubpassSampleLocationsEXT* pPostSubpassSampleLocations; +} VkRenderPassSampleLocationsBeginInfoEXT; + +typedef struct VkPipelineSampleLocationsStateCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkBool32 sampleLocationsEnable; + VkSampleLocationsInfoEXT sampleLocationsInfo; +} VkPipelineSampleLocationsStateCreateInfoEXT; + +typedef struct VkPhysicalDeviceSampleLocationsPropertiesEXT { + VkStructureType sType; + void* pNext; + VkSampleCountFlags sampleLocationSampleCounts; + VkExtent2D maxSampleLocationGridSize; + float sampleLocationCoordinateRange[2]; + uint32_t sampleLocationSubPixelBits; + VkBool32 variableSampleLocations; +} VkPhysicalDeviceSampleLocationsPropertiesEXT; + +typedef struct VkMultisamplePropertiesEXT { + VkStructureType sType; + void* pNext; + VkExtent2D maxSampleLocationGridSize; +} VkMultisamplePropertiesEXT; + + +typedef void (VKAPI_PTR *PFN_vkCmdSetSampleLocationsEXT)(VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT* pSampleLocationsInfo); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT)(VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT* pMultisampleProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetSampleLocationsEXT( + VkCommandBuffer commandBuffer, + const VkSampleLocationsInfoEXT* pSampleLocationsInfo); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMultisamplePropertiesEXT( + VkPhysicalDevice physicalDevice, + VkSampleCountFlagBits samples, + VkMultisamplePropertiesEXT* pMultisampleProperties); +#endif + #define VK_EXT_blend_operation_advanced 1 #define VK_EXT_BLEND_OPERATION_ADVANCED_SPEC_VERSION 2 #define VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME "VK_EXT_blend_operation_advanced" @@ -6831,6 +6899,132 @@ typedef struct VkPipelineCoverageModulationStateCreateInfoNV { #define VK_EXT_POST_DEPTH_COVERAGE_EXTENSION_NAME "VK_EXT_post_depth_coverage" +#define VK_EXT_validation_cache 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkValidationCacheEXT) + +#define VK_EXT_VALIDATION_CACHE_SPEC_VERSION 1 +#define VK_EXT_VALIDATION_CACHE_EXTENSION_NAME "VK_EXT_validation_cache" +#define VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT + + +typedef enum VkValidationCacheHeaderVersionEXT { + VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT = 1, + VK_VALIDATION_CACHE_HEADER_VERSION_BEGIN_RANGE_EXT = VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT, + VK_VALIDATION_CACHE_HEADER_VERSION_END_RANGE_EXT = VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT, + VK_VALIDATION_CACHE_HEADER_VERSION_RANGE_SIZE_EXT = (VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT - VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT + 1), + VK_VALIDATION_CACHE_HEADER_VERSION_MAX_ENUM_EXT = 0x7FFFFFFF +} VkValidationCacheHeaderVersionEXT; + +typedef VkFlags VkValidationCacheCreateFlagsEXT; + +typedef struct VkValidationCacheCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkValidationCacheCreateFlagsEXT flags; + size_t initialDataSize; + const void* pInitialData; +} VkValidationCacheCreateInfoEXT; + +typedef struct VkShaderModuleValidationCacheCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkValidationCacheEXT validationCache; +} VkShaderModuleValidationCacheCreateInfoEXT; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateValidationCacheEXT)(VkDevice device, const VkValidationCacheCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkValidationCacheEXT* pValidationCache); +typedef void (VKAPI_PTR *PFN_vkDestroyValidationCacheEXT)(VkDevice device, VkValidationCacheEXT validationCache, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkMergeValidationCachesEXT)(VkDevice device, VkValidationCacheEXT dstCache, uint32_t srcCacheCount, const VkValidationCacheEXT* pSrcCaches); +typedef VkResult (VKAPI_PTR *PFN_vkGetValidationCacheDataEXT)(VkDevice device, VkValidationCacheEXT validationCache, size_t* pDataSize, void* pData); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateValidationCacheEXT( + VkDevice device, + const VkValidationCacheCreateInfoEXT* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkValidationCacheEXT* pValidationCache); + +VKAPI_ATTR void VKAPI_CALL vkDestroyValidationCacheEXT( + VkDevice device, + VkValidationCacheEXT validationCache, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkMergeValidationCachesEXT( + VkDevice device, + VkValidationCacheEXT dstCache, + uint32_t srcCacheCount, + const VkValidationCacheEXT* pSrcCaches); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetValidationCacheDataEXT( + VkDevice device, + VkValidationCacheEXT validationCache, + size_t* pDataSize, + void* pData); +#endif + +#define VK_EXT_shader_viewport_index_layer 1 +#define VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_SPEC_VERSION 1 +#define VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME "VK_EXT_shader_viewport_index_layer" + + +#define VK_EXT_global_priority 1 +#define VK_EXT_GLOBAL_PRIORITY_SPEC_VERSION 2 +#define VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME "VK_EXT_global_priority" + + +typedef enum VkQueueGlobalPriorityEXT { + VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT = 128, + VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT = 256, + VK_QUEUE_GLOBAL_PRIORITY_HIGH_EXT = 512, + VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT = 1024, + VK_QUEUE_GLOBAL_PRIORITY_BEGIN_RANGE_EXT = VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT, + VK_QUEUE_GLOBAL_PRIORITY_END_RANGE_EXT = VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT, + VK_QUEUE_GLOBAL_PRIORITY_RANGE_SIZE_EXT = (VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT - VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT + 1), + VK_QUEUE_GLOBAL_PRIORITY_MAX_ENUM_EXT = 0x7FFFFFFF +} VkQueueGlobalPriorityEXT; + +typedef struct VkDeviceQueueGlobalPriorityCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkQueueGlobalPriorityEXT globalPriority; +} VkDeviceQueueGlobalPriorityCreateInfoEXT; + + + +#define VK_EXT_external_memory_host 1 +#define VK_EXT_EXTERNAL_MEMORY_HOST_SPEC_VERSION 1 +#define VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME "VK_EXT_external_memory_host" + +typedef struct VkImportMemoryHostPointerInfoEXT { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagBitsKHR handleType; + void* pHostPointer; +} VkImportMemoryHostPointerInfoEXT; + +typedef struct VkMemoryHostPointerPropertiesEXT { + VkStructureType sType; + void* pNext; + uint32_t memoryTypeBits; +} VkMemoryHostPointerPropertiesEXT; + +typedef struct VkPhysicalDeviceExternalMemoryHostPropertiesEXT { + VkStructureType sType; + void* pNext; + VkDeviceSize minImportedHostPointerAlignment; +} VkPhysicalDeviceExternalMemoryHostPropertiesEXT; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryHostPointerPropertiesEXT)(VkDevice device, VkExternalMemoryHandleTypeFlagBitsKHR handleType, const void* pHostPointer, VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryHostPointerPropertiesEXT( + VkDevice device, + VkExternalMemoryHandleTypeFlagBitsKHR handleType, + const void* pHostPointer, + VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties); +#endif + #ifdef __cplusplus } #endif diff --git a/include/wrappers/buffer.h b/include/wrappers/buffer.h index aa8c316b..49eb88bf 100644 --- a/include/wrappers/buffer.h +++ b/include/wrappers/buffer.h @@ -35,6 +35,7 @@ #include "misc/callbacks.h" #include "misc/debug_marker.h" +#include "misc/mt_safety.h" #include "misc/types.h" #include "misc/page_tracker.h" @@ -71,7 +72,8 @@ namespace Anvil class Buffer : public std::enable_shared_from_this, public CallbacksSupportProvider, - public DebugMarkerSupportProvider + public DebugMarkerSupportProvider, + public MTSafetySupportProvider { public: /* Public functions */ @@ -94,7 +96,8 @@ namespace Anvil VkDeviceSize in_size, QueueFamilyBits in_queue_families, VkSharingMode in_queue_sharing_mode, - VkBufferUsageFlags in_usage_flags); + VkBufferUsageFlags in_usage_flags, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Initializes a new NON-SPARSE buffer object using user-specified parameters. * @@ -121,7 +124,8 @@ namespace Anvil VkSharingMode in_queue_sharing_mode, VkBufferUsageFlags in_usage_flags, Anvil::MemoryFeatureFlags in_memory_features, - const void* in_opt_client_data); + const void* in_opt_client_data, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Creates a new Buffer wrapper instance. The new NON-SPARSE buffer will reuse a region of the specified * buffer's storage, instead of creating one's own. @@ -158,7 +162,8 @@ namespace Anvil QueueFamilyBits in_queue_families, VkSharingMode in_queue_sharing_mode, VkBufferUsageFlags in_usage_flags, - Anvil::SparseResidencyScope in_residency_scope); + Anvil::SparseResidencyScope in_residency_scope, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destroys the Vulkan objects and unregister the Buffer instance from Object Tracker. */ virtual ~Buffer(); @@ -221,6 +226,11 @@ namespace Anvil } } + const Anvil::PageTracker* get_page_tracker() const + { + return m_page_tracker_ptr.get(); + } + /** Returns a pointer to the parent buffer, if one was specified at creation time */ std::shared_ptr get_parent_buffer_ptr() const { @@ -283,8 +293,6 @@ namespace Anvil * executed either on the transfer queue (if available), or on the universal queue. Afterward, the staging buffer * will be released. * - * This function must not be used to read data from buffers, whose memory backing comes from a multi-instance heap. - * * This function blocks until the transfer completes. * * @param in_start_offset As per description. Must be smaller than the underlying memory object's size. @@ -296,7 +304,7 @@ namespace Anvil **/ bool read(VkDeviceSize in_start_offset, VkDeviceSize in_size, - void* out_result_ptr); + void* in_out_result_ptr); /** Attaches a memory block to the buffer object. * @@ -312,6 +320,7 @@ namespace Anvil **/ bool set_nonsparse_memory(std::shared_ptr in_memory_block_ptr); + /** Writes @param in_size bytes, starting from @param in_start_offset, into the wrapped memory object. * * If the buffer object uses mappable storage memory, the affected region will be mapped into process space, @@ -323,8 +332,6 @@ namespace Anvil * transfer the new contents to the target buffer. The operation will be submitted via a transfer queue, if one * is available, or a universal queue otherwise. * - * This function must not be used to read data from buffers, whose memory backing comes from a multi-instance heap. - * * If the buffer instance uses an exclusive sharing mode and supports more than just one queue family type AND memory * backing the buffer is not mappable, you MUST specify a queue instance that should be used to perform a buffer->buffer * copy op. The queue MUST support transfer ops. @@ -335,8 +342,7 @@ namespace Anvil * @param in_size As per description. @param in_start_offset + @param in_size must be lower than or * equal to the underlying memory object's size. * @param in_data Data to store. Must not be nullptr. - * @param in_opt_queue_ptr See documentation above. May be nullptr. - + * * @return true if the operation was successful, false otherwise. **/ bool write(VkDeviceSize in_start_offset, @@ -351,13 +357,15 @@ namespace Anvil QueueFamilyBits in_queue_families, VkSharingMode in_queue_sharing_mode, VkBufferUsageFlags in_usage_flags, - Anvil::SparseResidencyScope in_residency_scope); + Anvil::SparseResidencyScope in_residency_scope, + bool in_mt_safe); explicit Buffer(std::weak_ptr in_device_ptr, VkDeviceSize in_size, QueueFamilyBits in_queue_families, VkSharingMode in_queue_sharing_mode, VkBufferUsageFlags in_usage_flags, - MemoryFeatureFlags in_memory_features); + MemoryFeatureFlags in_memory_features, + bool in_mt_safe); explicit Buffer(std::shared_ptr in_parent_buffer_ptr, VkDeviceSize in_start_offset, VkDeviceSize in_size); diff --git a/include/wrappers/buffer_view.h b/include/wrappers/buffer_view.h index e91027ac..91f25eb4 100644 --- a/include/wrappers/buffer_view.h +++ b/include/wrappers/buffer_view.h @@ -30,12 +30,14 @@ #ifndef WRAPPERS_BUFFER_VIEW_H #define WRAPPERS_BUFFER_VIEW_H +#include "misc/mt_safety.h" #include "misc/types.h" namespace Anvil { /** Wrapper class for Vulkan buffer views */ - class BufferView : public DebugMarkerSupportProvider + class BufferView : public DebugMarkerSupportProvider, + public MTSafetySupportProvider { public: /* Public functions */ @@ -46,7 +48,8 @@ namespace Anvil std::shared_ptr in_buffer_ptr, VkFormat in_format, VkDeviceSize in_start_offset, - VkDeviceSize in_size); + VkDeviceSize in_size, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destructor */ virtual ~BufferView(); @@ -93,7 +96,8 @@ namespace Anvil std::shared_ptr in_buffer_ptr, VkFormat in_format, VkDeviceSize in_start_offset, - VkDeviceSize in_size); + VkDeviceSize in_size, + bool in_mt_safe); BufferView (const BufferView&); BufferView& operator=(const BufferView&); diff --git a/include/wrappers/command_buffer.h b/include/wrappers/command_buffer.h index cde8a545..90885fb5 100644 --- a/include/wrappers/command_buffer.h +++ b/include/wrappers/command_buffer.h @@ -38,6 +38,7 @@ #include "misc/callbacks.h" #include "misc/debug_marker.h" #include "misc/io.h" +#include "misc/mt_safety.h" #include "misc/types.h" #ifdef _DEBUG @@ -161,12 +162,11 @@ namespace Anvil */ typedef struct BeginRenderPassCommand : public Command { - std::vector clear_values; - VkSubpassContents contents; - std::shared_ptr fbo_ptr; - std::vector > physical_devices; - std::vector render_areas; - std::shared_ptr render_pass_ptr; + std::vector clear_values; + VkSubpassContents contents; + std::shared_ptr fbo_ptr; + VkRect2D render_area; + std::shared_ptr render_pass_ptr; /** Constructor. * @@ -174,14 +174,12 @@ namespace Anvil * * Arguments as per Vulkan API. **/ - explicit BeginRenderPassCommand(uint32_t in_n_clear_values, - const VkClearValue* in_clear_value_ptrs, - std::shared_ptr in_fbo_ptr, - uint32_t in_n_physical_devices, - const std::weak_ptr* in_physical_devices, - const VkRect2D* in_render_areas, - std::shared_ptr in_render_pass_ptr, - VkSubpassContents in_contents); + explicit BeginRenderPassCommand(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + std::shared_ptr in_fbo_ptr, + const VkRect2D& in_render_area, + std::shared_ptr in_render_pass_ptr, + VkSubpassContents in_contents); /** Destructor. * @@ -297,7 +295,8 @@ namespace Anvil * * Provides core functionality for the PrimaryCommandBuffer and SecondaryCommandBuffer classes. */ - class CommandBufferBase : public DebugMarkerSupportProvider, + class CommandBufferBase : public MTSafetySupportProvider, + public DebugMarkerSupportProvider, public CallbacksSupportProvider { public: @@ -1544,6 +1543,7 @@ namespace Anvil ClearDepthStencilImageCommand& operator=(const ClearDepthStencilImageCommand& in); } ClearDepthStencilImageCommand; + /** Holds all arguments passed to a vkCmdCopyBuffer() command. */ typedef struct CopyBufferCommand : public Command { @@ -2115,7 +2115,6 @@ namespace Anvil ResolveImageCommand& operator=(const ResolveImageCommand&); } ResolveImageCommand; - /** Holds all arguments passed to a vkCmdSetBlendConstants() command. **/ typedef struct SetBlendConstantsCommand : public Command { @@ -2393,7 +2392,8 @@ namespace Anvil /* Protected functions */ explicit CommandBufferBase(std::weak_ptr in_device_ptr, std::shared_ptr in_parent_command_pool_ptr, - CommandBufferType in_type); + CommandBufferType in_type, + bool in_mt_safe); virtual ~CommandBufferBase(); @@ -2422,6 +2422,7 @@ namespace Anvil bool m_is_renderpass_active; std::weak_ptr m_parent_command_pool_ptr; bool m_recording_in_progress; + uint32_t m_renderpass_device_mask; CommandBufferType m_type; static bool m_command_stashing_disabled; @@ -2548,7 +2549,8 @@ namespace Anvil * **/ PrimaryCommandBuffer(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_command_pool_ptr); + std::shared_ptr in_parent_command_pool_ptr, + bool in_mt_safe); private: friend class Anvil::CommandPool; @@ -2610,7 +2612,8 @@ namespace Anvil * **/ SecondaryCommandBuffer(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_command_pool_ptr); + std::shared_ptr in_parent_command_pool_ptr, + bool in_mt_safe); private: friend class Anvil::CommandPool; diff --git a/include/wrappers/command_pool.h b/include/wrappers/command_pool.h index 37685da6..6138ff15 100644 --- a/include/wrappers/command_pool.h +++ b/include/wrappers/command_pool.h @@ -30,13 +30,15 @@ #define WRAPPERS_COMMAND_POOL_H #include "misc/debug_marker.h" +#include "misc/mt_safety.h" #include "misc/types.h" namespace Anvil { /** Implements a command pool wrapper */ - class CommandPool : public DebugMarkerSupportProvider, + class CommandPool : public MTSafetySupportProvider, + public DebugMarkerSupportProvider, public std::enable_shared_from_this { public: @@ -69,11 +71,14 @@ namespace Anvil * @param in_support_per_cmdbuf_reset_ops Set to true if the command pool should be created with the * VK_COMMAND_POOL_RESET_COMMAND_BUFFER_BIT flag set on. * @param in_queue_family Index of the queue family the command pool should be created for. + * @param in_mt_safe Enable if your application is going to be calling any of the + * alloc_*() functions from more than one thread at a time. **/ static std::shared_ptr create(std::weak_ptr in_device_ptr, bool in_transient_allocations_friendly, bool in_support_per_cmdbuf_reset_ops, - Anvil::QueueFamilyType in_queue_family); + Anvil::QueueFamilyType in_queue_family, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Retrieves the raw Vulkan handle for the encapsulated command pool */ VkCommandPool get_command_pool() const @@ -124,7 +129,8 @@ namespace Anvil explicit CommandPool(std::weak_ptr in_device_ptr, bool in_transient_allocations_friendly, bool in_support_per_cmdbuf_reset_ops, - Anvil::QueueFamilyType in_queue_family); + Anvil::QueueFamilyType in_queue_family, + bool in_mt_safe); CommandPool (const CommandPool&); CommandPool& operator=(const CommandPool&); diff --git a/include/wrappers/compute_pipeline_manager.h b/include/wrappers/compute_pipeline_manager.h index 05185769..858d1bd4 100644 --- a/include/wrappers/compute_pipeline_manager.h +++ b/include/wrappers/compute_pipeline_manager.h @@ -36,180 +36,28 @@ namespace Anvil { - typedef PipelineID ComputePipelineID; - class ComputePipelineManager : public BasePipelineManager { public: + using BasePipelineManager::bake; + /* Public functions */ static std::shared_ptr create(std::weak_ptr in_device_ptr, - bool in_use_pipeline_cache = false, - std::shared_ptr in_pipeline_cache_to_reuse_ptr = nullptr); + bool in_mt_safe, + bool in_use_pipeline_cache, + std::shared_ptr in_pipeline_cache_to_reuse_ptr); virtual ~ComputePipelineManager(); - - /** Registers a new derivative pipeline which is going to inherit state from another compute pipeline object, - * which has already been added to the compute pipeline manager. - * - * The function does not automatically bake the new pipeline. This action can either be explicitly - * requested by calling bake(), or by calling one of the get_*() functions. - * - * @param in_disable_optimizations If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT flag. - * @param in_allow_derivatives If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT flag. - * @param in_compute_shader_stage_entrypoint_info Compute shader stage entrypoint info. - * @param in_base_pipeline_id ID of the pipeline, which should be used as base for the new pipeline - * object. Must be an ID earlier returned by one of the other add_() functions. - * @param out_pipeline_id_ptr Deref will be set to the ID of the result pipeline object. Must not be nullptr. - * - * @return true if the function executed successfully, false otherwise. - **/ - bool add_derivative_pipeline_from_sibling_pipeline(bool in_disable_optimizations, - bool in_allow_derivatives, - const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info, - ComputePipelineID in_base_pipeline_id, - ComputePipelineID* out_pipeline_id_ptr) - { - return BasePipelineManager::add_derivative_pipeline_from_sibling_pipeline(in_disable_optimizations, - in_allow_derivatives, - 1, /* n_pipeline_stage_shader_info_items */ - &in_compute_shader_stage_entrypoint_info, - in_base_pipeline_id, - out_pipeline_id_ptr); - } - - /** Registers a new derivative pipeline which is going to inherit its state from another Vulkan pipeline object. - * - * The function does not automatically bake the new pipeline. This action can either be explicitly - * requested by calling bake(), or by calling one of the get_*() functions. - * - * @param in_disable_optimizations If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT flag. - * @param in_allow_derivatives If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT flag. - * @param in_compute_shader_stage_info Compute shader stage entrypoint info. - * @param in_base_pipeline Handle of the pipeline, which should be used as base for the new pipeline - * object. Must not be nullptr. - * @param out_pipeline_id_ptr Deref will be set to the ID of the result pipeline object. Must not be nullptr. - * - * @return true if the function executed successfully, false otherwise. - **/ - bool add_derivative_pipeline_from_pipeline(bool in_disable_optimizations, - bool in_allow_derivatives, - const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info, - VkPipeline in_base_pipeline, - ComputePipelineID* out_compute_pipeline_id_ptr) - { - return BasePipelineManager::add_derivative_pipeline_from_pipeline(in_disable_optimizations, - in_allow_derivatives, - 1, /* n_pipeline_stage_shader_info_items */ - &in_compute_shader_stage_entrypoint_info, - in_base_pipeline, - out_compute_pipeline_id_ptr); - } - - /** Registers a new pipeline object. - * - * The function does not automatically bake the new pipeline. This action can either be explicitly - * requested by calling bake(), or by calling one of the get_*() functions. - * - * @param in_disable_optimizations If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT flag. - * @param in_allow_derivatives If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT flag. - * @param in_compute_shader_stage_entrypoint_info Compute shader stage info. - * @param out_compute_pipeline_id_ptr Deref will be set to the ID of the result pipeline object. Must not be nullptr. - * - * @return true if the function executed successfully, false otherwise. - **/ - bool add_regular_pipeline(bool in_disable_optimizations, - bool in_allow_derivatives, - const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info, - ComputePipelineID* out_compute_pipeline_id_ptr) - { - return BasePipelineManager::add_regular_pipeline(in_disable_optimizations, - in_allow_derivatives, - 1, /* n_pipeline_stage_shader_info_items */ - &in_compute_shader_stage_entrypoint_info, - out_compute_pipeline_id_ptr); - } - - /** Adds a new specialization constant to the specified pipeline object. - * - * This function marks the pipeline as dirty, meaning it will be rebaked at the next get_() call. - * - * @param in_pipeline_id ID of the pipeline to add the constant to. Must be an ID returned - * by one of the add_() functions. - * @param in_constant_id ID of the specialization constant to assign data for. - * @param in_n_data_bytes Number of bytes under @param in_data_ptr to assign to the specialization constant. - * @param in_data_ptr A buffer holding the data to be assigned to the constant. Must hold at least - * @param in_n_data_bytes bytes that will be read by the function. - * - * @return true if successful, false otherwise. - **/ - bool add_specialization_constant_to_pipeline(ComputePipelineID in_pipeline_id, - uint32_t in_constant_id, - uint32_t in_n_data_bytes, - const void* in_data_ptr) - { - return BasePipelineManager::add_specialization_constant_to_pipeline(in_pipeline_id, - 0, /* shader_index */ - in_constant_id, - in_n_data_bytes, - in_data_ptr); - } - bool bake(); - /** Deletes an existing pipeline. - * - * @param in_pipeline_id ID of a pipeline to delete. - * - * @return true if successful, false otherwise. - **/ - bool delete_pipeline(ComputePipelineID in_pipeline_id) - { - return BasePipelineManager::delete_pipeline(in_pipeline_id); - } - - /** Retrieves a VkPipeline instance associated with the specified pipeline ID. - * - * The function will bake a pipeline object (and, possibly, a pipeline layout object, too) if - * the specified pipeline is marked as dirty. - * - * @param in_pipeline_id ID of the pipeline to return the raw Vulkan pipeline handle for. - * - * @return VkPipeline handle or nullptr if the function failed. - **/ - VkPipeline get_compute_pipeline(ComputePipelineID in_pipeline_id) - { - return BasePipelineManager::get_pipeline(in_pipeline_id); - } - - /** Retrieves a PipelineLayout instance associated with the specified pipeline ID. - * - * The function will bake a pipeline object (and, possibly, a pipeline layout object, too) if - * the specified pipeline is marked as dirty. - * - * @param in_pipeline_id ID of the pipeline to return the wrapper instance for. - * Must not describe a proxy pipeline. - * - * @return Ptr to a PipelineLayout instance or nullptr if the function failed. - **/ - std::shared_ptr get_compute_pipeline_layout(ComputePipelineID in_pipeline_id) - { - return BasePipelineManager::get_pipeline_layout(in_pipeline_id); - } - private: /* Constructor */ explicit ComputePipelineManager(std::weak_ptr in_device_ptr, + bool in_mt_safe, bool in_use_pipeline_cache = false, std::shared_ptr in_pipeline_cache_to_reuse_ptr = nullptr); - ANVIL_DISABLE_ASSIGNMENT_OPERATOR(ComputePipelineManager); ANVIL_DISABLE_COPY_CONSTRUCTOR (ComputePipelineManager); }; diff --git a/include/wrappers/descriptor_pool.h b/include/wrappers/descriptor_pool.h index 7098034c..e43d6352 100644 --- a/include/wrappers/descriptor_pool.h +++ b/include/wrappers/descriptor_pool.h @@ -31,6 +31,7 @@ #include "misc/callbacks.h" #include "misc/debug_marker.h" +#include "misc/mt_safety.h" #include "misc/types.h" namespace Anvil @@ -49,6 +50,7 @@ namespace Anvil class DescriptorPool : public CallbacksSupportProvider, public DebugMarkerSupportProvider, + public MTSafetySupportProvider, public std::enable_shared_from_this { public: @@ -65,7 +67,8 @@ namespace Anvil **/ static std::shared_ptr create(std::weak_ptr in_device_ptr, uint32_t in_n_max_sets, - bool in_releaseable_sets); + bool in_releaseable_sets, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destructor. Releases the Vulkan pool object if instantiated. */ virtual ~DescriptorPool(); @@ -124,6 +127,11 @@ namespace Anvil return m_pool; } + uint32_t get_n_maximum_sets() const + { + return m_n_max_sets; + } + /** Resets the pool. * * @return true if successful, false otherwise @@ -178,7 +186,8 @@ namespace Anvil /** Constructor */ DescriptorPool(std::weak_ptr in_device_ptr, uint32_t in_n_max_sets, - bool in_releaseable_sets); + bool in_releaseable_sets, + bool in_mt_safe); DescriptorPool (const DescriptorPool&); DescriptorPool& operator=(const DescriptorPool&); @@ -191,12 +200,8 @@ namespace Anvil uint32_t m_descriptor_count[VK_DESCRIPTOR_TYPE_RANGE_SIZE]; uint32_t m_n_max_sets; - /* The instances stored in this vector are owned by alloc() callers - do not release - * unless Vulkan object goes out of scope. - */ - std::vector > m_alloced_dses; - std::vector m_ds_cache; - std::vector m_ds_layout_cache; + std::vector m_ds_cache; + std::vector m_ds_layout_cache; const bool m_releaseable_sets; }; diff --git a/include/wrappers/descriptor_set.h b/include/wrappers/descriptor_set.h index 7ade5c53..cf1e5743 100644 --- a/include/wrappers/descriptor_set.h +++ b/include/wrappers/descriptor_set.h @@ -35,11 +35,13 @@ #define WRAPPERS_DESCRIPTOR_SET_H #include "misc/debug_marker.h" +#include "misc/mt_safety.h" #include "misc/types.h" namespace Anvil { - class DescriptorSet : public DebugMarkerSupportProvider + class DescriptorSet : public DebugMarkerSupportProvider, + public MTSafetySupportProvider { public: /** Represents a single buffer object, which can be bound to a specific descriptor set slot */ @@ -464,7 +466,8 @@ namespace Anvil static std::shared_ptr create(std::weak_ptr in_device_ptr, std::shared_ptr in_parent_pool_ptr, std::shared_ptr in_layout_ptr, - VkDescriptorSet in_descriptor_set); + VkDescriptorSet in_descriptor_set, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Tells how many array items have been declared for a binding at a given index * @@ -875,13 +878,13 @@ namespace Anvil DescriptorSet(std::weak_ptr in_device_ptr, std::shared_ptr in_parent_pool_ptr, std::shared_ptr in_layout_ptr, - VkDescriptorSet in_descriptor_set); + VkDescriptorSet in_descriptor_set, + bool in_mt_safe); DescriptorSet (const DescriptorSet&); DescriptorSet& operator=(const DescriptorSet&); - void on_binding_added_to_layout(); - void on_parent_pool_reset (); + void on_parent_pool_reset(); void alloc_bindings(); diff --git a/include/wrappers/descriptor_set_group.h b/include/wrappers/descriptor_set_group.h index 5e66f669..2f09488d 100644 --- a/include/wrappers/descriptor_set_group.h +++ b/include/wrappers/descriptor_set_group.h @@ -51,12 +51,33 @@ #ifndef WRAPPERS_DESCRIPTOR_SET_GROUP_H #define WRAPPERS_DESCRIPTOR_SET_GROUP_H +#include "misc/descriptor_set_info.h" +#include "misc/mt_safety.h" #include "misc/types.h" #include "wrappers/descriptor_set.h" namespace Anvil { - class DescriptorSetGroup + typedef struct OverheadAllocation + { + VkDescriptorType descriptor_type; + uint32_t n_overhead_allocations; + + OverheadAllocation() + { + descriptor_type = VK_DESCRIPTOR_TYPE_MAX_ENUM; + n_overhead_allocations = UINT32_MAX; + } + + OverheadAllocation(VkDescriptorType in_descriptor_type, + uint32_t in_n_overhead_allocations) + { + descriptor_type = in_descriptor_type; + n_overhead_allocations = in_n_overhead_allocations; + } + } OverheadAllocation; + + class DescriptorSetGroup : public MTSafetySupportProvider { public: /* Public functions */ @@ -64,33 +85,6 @@ namespace Anvil /** Destructor */ virtual ~DescriptorSetGroup(); - /** Adds a new descriptor set binding to the DSG. This lets you attach one or more descriptors - * to the binding's individual array items by calling set_binding() later on. - * - * This call invalidates internally-maintained Vulkan DS and DS layout instances. - * - * @param in_n_set Index of the descriptor set the new binding should be created for. - * This number must not be equal to or larger than the number of sets - * specified for the DSG at creation time. - * @param in_binding Index of the binding to create. This index must not have been used earlier - * to create another binding. - * @param in_type Type of descriptor(s), which are going to be used to configure the binding. - * @param in_n_elements Binding array's size. Must be at least 1. - * @param in_shader_stages A bitfield combination of shader stage bits, telling which shader stages - * this binding is going to be used for. - * @param in_opt_immutable_sampler_ptrs If not nullptr, an array of @param in_n_elements samplers should - * be passed. The binding will then be considered immutable, as per spec language. - * May be nullptr. - * - * @return true if the function executed successfully, false otherwise. - ***/ - bool add_binding(uint32_t in_n_set, - uint32_t in_binding, - VkDescriptorType in_type, - uint32_t in_n_elements, - VkShaderStageFlags in_shader_stages, - const std::shared_ptr* in_opt_immutable_sampler_ptrs = nullptr); - /** Creates a new DescriptorSetGroup instance. * * Apart from the usual stuff, this function also preallocates memory for a number of @@ -102,15 +96,14 @@ namespace Anvil * takes a ptr to DescriptorSetGroup instance, causing objects created in such fashion to treat the * specified DescriptorSetGroup instance as a parent. * - * @param in_device_ptr Device to use. - * @param in_releaseable_sets true if the created VkDescriptorSet instances should be releaseable - * to the internal descriptor pool by invoking vkFreeDescriptorSets(). - * false otherwise. - * @param in_n_sets Number of descriptor sets this instance should store information for. + * @param in_device_ptr Device to use. + * @param in_ds_info_ptrs TODO. */ - static std::shared_ptr create(std::weak_ptr in_device_ptr, - bool in_releaseable_sets, - uint32_t in_n_sets); + static std::shared_ptr create(std::weak_ptr in_device_ptr, + std::vector >& in_ds_info_ptrs, + bool in_releaseable_sets, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + const std::vector& in_opt_overhead_allocations = std::vector() ); /** Creates a new DescriptorSetGroup instance. * @@ -134,10 +127,7 @@ namespace Anvil * * @return Pointer to the requested Anvil::DescriptorSet instance. **/ - std::shared_ptr get_descriptor_set(uint32_t in_n_set); - - /** Returns a descriptor set binding index for a descriptor set at index @param in_n_set. */ - uint32_t get_descriptor_set_binding_index(uint32_t in_n_set) const; + std::shared_ptr get_descriptor_set(uint32_t in_n_set) const; /** Retrieves a Vulkan instace of the descriptor set layout, as configured for the DSG instance's * set at index @param in_n_set. @@ -146,19 +136,18 @@ namespace Anvil * * @return Requested Anvil::DescriptorSetLayout instance. */ - std::shared_ptr get_descriptor_set_layout(uint32_t in_n_set); + std::shared_ptr get_descriptor_set_layout(uint32_t in_n_set) const; /** Returns the total number of added descriptor sets. * - * Bear in mind that descriptor set bindings may not form a continuous range set. - * For example, if this function returns 2, it doesn't mean that the defined DS bindings - * can only use indices 0, and 1. What binding indices are used specifically for descriptor - * sets at a given index can be checked by calling get_descriptor_set_binding_index() for - * a value of <0, (value returned by this func - 1)>. + * NOTE: Descriptor set bindings need not form a continuous range set. For instance, even if + * this function returns 3, get_descriptor_set() may return nullptr for set at index 1, + * if no layout info has been provided for this set index at creation time. + * **/ - uint32_t get_n_of_descriptor_sets() const + uint32_t get_n_descriptor_sets() const { - return (uint32_t) m_descriptor_sets.size(); + return static_cast(m_ds_info_ptrs.size() ); } /** This function should be set to assign physical Vulkan objects to a descriptor binding @@ -227,14 +216,6 @@ namespace Anvil &in_element); } - /** Configures how many overhead allocations should be requested from the descriptor pool. - * - * @param in_descriptor_type Descriptor type to increase the number of requested descriptor allocations for. - * @param in_n_overhead_allocations Value specifying how many additional allocations should be made. 0 by default. - **/ - void set_descriptor_pool_overhead_allocations(VkDescriptorType in_descriptor_type, - uint32_t in_n_overhead_allocations); - private: /* Private type declarations */ @@ -274,37 +255,31 @@ namespace Anvil /* Private functions */ /** Please see create() documentation for more details. */ - DescriptorSetGroup(std::weak_ptr in_device_ptr, - bool in_releaseable_sets, - uint32_t in_n_sets); + DescriptorSetGroup(std::weak_ptr in_device_ptr, + std::vector > in_ds_info_ptrs, + bool in_releaseable_sets, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + const std::vector& in_opt_overhead_allocations = std::vector() ); /** Please see create() documentation for more details. */ DescriptorSetGroup(std::shared_ptr in_parent_dsg_ptr, bool in_releaseable_sets); - DescriptorSetGroup (const DescriptorSetGroup&); - DescriptorSetGroup& operator=(const DescriptorSetGroup&); - void bake_descriptor_pool(); bool bake_descriptor_sets(); /* Private members */ - std::vector > m_cached_ds; - std::vector > m_cached_ds_layouts; - std::vector m_cached_ds_vk; - - bool m_descriptor_pool_dirty; - std::shared_ptr m_descriptor_pool_ptr; - std::map m_descriptor_sets; - std::weak_ptr m_device_ptr; - uint32_t m_overhead_allocations[VK_DESCRIPTOR_TYPE_RANGE_SIZE]; + mutable std::shared_ptr m_descriptor_pool_ptr; + mutable std::map m_descriptor_sets; + std::weak_ptr m_device_ptr; + std::vector > m_ds_info_ptrs; + uint32_t m_overhead_allocations[VK_DESCRIPTOR_TYPE_RANGE_SIZE]; - uint32_t m_n_instantiated_sets; - uint32_t m_n_sets; - bool m_releaseable_sets; - - bool m_layout_modifications_blocked; std::shared_ptr m_parent_dsg_ptr; + bool m_releaseable_sets; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(DescriptorSetGroup); + ANVIL_DISABLE_COPY_CONSTRUCTOR(DescriptorSetGroup); }; } /* Vulkan namespace */ diff --git a/include/wrappers/descriptor_set_layout.h b/include/wrappers/descriptor_set_layout.h index a90e37b1..63be9291 100644 --- a/include/wrappers/descriptor_set_layout.h +++ b/include/wrappers/descriptor_set_layout.h @@ -32,27 +32,16 @@ #include "misc/callbacks.h" #include "misc/debug_marker.h" +#include "misc/mt_safety.h" #include "misc/types.h" #include "wrappers/sampler.h" #include namespace Anvil { - enum - { - /* Notification fired whenever a new binding is added to the layout. - * - * callback argument: pointer to OnNewBindingAddedToDescriptorSetLayoutCallbackArgument instance. - **/ - DESCRIPTOR_SET_LAYOUT_CALLBACK_ID_BINDING_ADDED, - - /* Always last */ - DESCRIPTOR_SET_LAYOUT_CALLBACK_ID_COUNT - }; - /* Descriptor Set Layout wrapper */ - class DescriptorSetLayout : public CallbacksSupportProvider, - public DebugMarkerSupportProvider + class DescriptorSetLayout : public DebugMarkerSupportProvider, + public MTSafetySupportProvider { public: /* Public functions */ @@ -64,39 +53,6 @@ namespace Anvil **/ virtual ~DescriptorSetLayout(); - /** Adds a new binding to the layout instance. - * - * It is an error to attempt to add a binding at an index, for which another binding has - * already been specified. - * - * It is an error to attempt to define immutable samplers for descriptors of type other than - * sampler or combined image+sampler. - * - * @param in_binding_index Index of the binding to configure. - * @param in_descriptor_type Type of the descriptor to use for the binding. - * @param in_descriptor_array_size Size of the descriptor array to use for the binding. - * @param in_stage_flags Rendering stages which are going to use the binding. - * @param in_opt_immutable_sampler_ptrs If not nullptr, an array of @param in_descriptor_array_size samplers should - * be passed. The binding will then be considered immutable, as per spec language. - * May be nullptr. - * - * @return true if successful, false otherwise. - **/ - bool add_binding(uint32_t in_binding_index, - VkDescriptorType in_descriptor_type, - uint32_t in_descriptor_array_size, - VkShaderStageFlags in_stage_flags, - const std::shared_ptr* in_opt_immutable_sampler_ptrs = nullptr); - - /** Converts internal layout representation to a Vulkan object. - * - * The baking will only occur if the object is internally marked as dirty. If it is not, - * the function does nothing. - * - * @return true if successful, false otherwise. - **/ - bool bake(); - /** Creates a new DescriptorSetLayout instance. * * No Vulkan Descriptor Set Layout is instantiated at creation time. One will only be created @@ -105,31 +61,14 @@ namespace Anvil * @param in_device_ptr Device the layout will be created for. * **/ - static std::shared_ptr create(std::weak_ptr in_device_ptr); + static std::shared_ptr create(std::unique_ptr in_ds_info_ptr, + std::weak_ptr in_device_ptr, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); - /** Retrieves properties of a single defined binding. - * - * @param in_n_binding Index number of the binding to retrieve properties of. - * @param out_opt_binding_index_ptr May be nullptr. If not, deref will be set to the index of the - * binding. This does NOT need to be equal to @param in_n_binding. - * @param out_opt_descriptor_type_ptr May be nullptr. If not, deref will be set to the descriptor type - * for the specified binding. - * @param out_opt_descriptor_array_size_ptr May be nullptr. If not, deref will be set to size of the descriptor - * array, associated with the specified binding. - * @param out_opt_stage_flags_ptr May be nullptr. If not, deref will be set to stage flags, - * as configured for the specified binding. - * @param out_opt_immutable_samplers_enabled_ptr May be nullptr. If not, deref will be set to true if immutable samplers - * have been defined for the specified binding; otherwise, it will be - * set to false. - * - * @return true if successful, false otherwise. - **/ - bool get_binding_properties(uint32_t in_n_binding, - uint32_t* out_opt_binding_index_ptr, - VkDescriptorType* out_opt_descriptor_type_ptr, - uint32_t* out_opt_descriptor_array_size_ptr, - VkShaderStageFlags* out_opt_stage_flags_ptr, - bool* out_opt_immutable_samplers_enabled_ptr); + const Anvil::DescriptorSetInfo* get_info() const + { + return m_info_ptr.get(); + } /** Bakes a Vulkan object, if one is needed, and returns Vulkan DS layout handle. * @@ -140,80 +79,35 @@ namespace Anvil **/ VkDescriptorSetLayout get_layout() { - if (m_dirty) - { - bake(); - } + anvil_assert(m_layout != VK_NULL_HANDLE); return m_layout; } - /** Returns the number of bindings defined for the layout. */ - uint32_t get_n_bindings() const - { - return static_cast(m_bindings.size() ); - } - private: - /* Private type definitions */ - - /** Describes a single descriptor set layout binding */ - typedef struct Binding - { - uint32_t descriptor_array_size; - VkDescriptorType descriptor_type; - std::vector > immutable_samplers; - - VkShaderStageFlagsVariable(stage_flags); - - /** Dummy constructor. Do not use. */ - Binding() - { - descriptor_array_size = 0; - descriptor_type = VK_DESCRIPTOR_TYPE_MAX_ENUM; - stage_flags = static_cast(0); - } - - /** Constructor. - * - * For argument discussion, please see Anvil::DescriptorSetLayout::add_binding() documentation. - **/ - Binding(uint32_t in_descriptor_array_size, - VkDescriptorType in_descriptor_type, - VkShaderStageFlags in_stage_flags, - const std::shared_ptr* in_immutable_sampler_ptrs) - { - descriptor_array_size = in_descriptor_array_size; - descriptor_type = in_descriptor_type; - stage_flags = static_cast(in_stage_flags); - - if (in_immutable_sampler_ptrs != nullptr) - { - for (uint32_t n_sampler = 0; - n_sampler < descriptor_array_size; - ++n_sampler) - { - immutable_samplers.push_back(in_immutable_sampler_ptrs[n_sampler]); - } - } - } - } Binding; - - typedef std::map BindingIndexToBindingMap; - /* Private functions */ + /** Converts internal layout representation to a Vulkan object. + * + * The baking will only occur if the object is internally marked as dirty. If it is not, + * the function does nothing. + * + * @return true if successful, false otherwise. + **/ + bool init(); + /* Please see create() documentation for more details */ - DescriptorSetLayout(std::weak_ptr in_device_ptr); + DescriptorSetLayout(std::unique_ptr in_ds_info_ptr, + std::weak_ptr in_device_ptr, + bool in_mt_safe); DescriptorSetLayout (const DescriptorSetLayout&); DescriptorSetLayout& operator=(const DescriptorSetLayout&); /* Private variables */ - BindingIndexToBindingMap m_bindings; - std::weak_ptr m_device_ptr; - bool m_dirty; - VkDescriptorSetLayout m_layout; + std::weak_ptr m_device_ptr; + std::unique_ptr m_info_ptr; + VkDescriptorSetLayout m_layout; friend class std::shared_ptr; }; diff --git a/include/wrappers/device.h b/include/wrappers/device.h index 08bbca1a..820b1f1d 100644 --- a/include/wrappers/device.h +++ b/include/wrappers/device.h @@ -26,24 +26,27 @@ * - encapsulate all logic required to manipulate devices. * - let ObjectTracker detect leaking device instances. * - * The wrapper is NOT thread-safe. + * The wrapper is thread-safe (on an opt-in basis). **/ #ifndef WRAPPERS_DEVICE_H #define WRAPPERS_DEVICE_H #include "misc/debug.h" +#include "misc/mt_safety.h" #include "misc/types.h" #include namespace Anvil { - class BaseDevice : public std::enable_shared_from_this + class BaseDevice : public Anvil::MTSafetySupportProvider, + public std::enable_shared_from_this { public: /* Public functions */ /* Constructor */ - BaseDevice(std::weak_ptr in_parent_instance_ptr); + BaseDevice(std::weak_ptr in_parent_instance_ptr, + bool in_mt_safe); /** Releases all children queues and unregisters itself from the owning physical device. */ virtual void destroy(); @@ -108,7 +111,7 @@ namespace Anvil **/ std::shared_ptr get_dummy_descriptor_set_layout() const; - /** Returns a container with entry-points to functions introduced by VK_AMD_draw_indirect_count extension. + /** Returns a container with entry-points to functions introduced by VK_AMD_draw_indirect_count extension. * * Will fire an assertion failure if the extension was not requested at device creation time. **/ @@ -119,6 +122,17 @@ namespace Anvil return m_amd_draw_indirect_count_extension_entrypoints; } + /** Returns a container with entry-points to functions introduced by VK_AMD_shader_info extension. + * + * Will fire an assertion failure if the extension was not requested at device creation time. + **/ + const ExtensionAMDShaderInfoEntrypoints& get_extension_amd_shader_info_entrypoints() const + { + anvil_assert(m_amd_shader_info_enabled); + + return m_amd_shader_info_extension_entrypoints; + } + /** Returns a container with entry-points to functions introduced by VK_EXT_debug_marker extension. * * Will fire an assertion failure if the extension is not supported. @@ -182,9 +196,9 @@ namespace Anvil switch (in_family_type) { - case QUEUE_FAMILY_TYPE_COMPUTE: result = static_cast(m_compute_queues.size() ); break; - case QUEUE_FAMILY_TYPE_TRANSFER: result = static_cast(m_transfer_queues.size() ); break; - case QUEUE_FAMILY_TYPE_UNIVERSAL: result = static_cast(m_universal_queues.size() ); break; + case QUEUE_FAMILY_TYPE_COMPUTE: result = static_cast(m_compute_queues.size() ); break; + case QUEUE_FAMILY_TYPE_TRANSFER: result = static_cast(m_transfer_queues.size() ); break; + case QUEUE_FAMILY_TYPE_UNIVERSAL: result = static_cast(m_universal_queues.size() ); break; default: { @@ -480,6 +494,11 @@ namespace Anvil return m_amd_shader_explicit_vertex_parameter_enabled; } + bool is_amd_shader_info_extension_enabled() const + { + return m_amd_shader_info_enabled; + } + bool is_amd_shader_trinary_minmax_extension_enabled() const { return m_amd_shader_trinary_minmax_enabled; @@ -490,6 +509,11 @@ namespace Anvil return m_amd_texture_gather_bias_lod_enabled; } + bool is_ext_shader_stencil_export_extension_enabled() const + { + return m_ext_shader_stencil_export_enabled; + } + /* Tells whether the device has been created with the specified extension enabled. * * @param in_extension_name Null-terminated name of the extension. Must not be null. @@ -543,6 +567,8 @@ namespace Anvil return m_khr_swapchain_enabled; } + bool wait_idle(); + protected: /* Protected type definitions */ typedef struct @@ -564,7 +590,7 @@ namespace Anvil BaseDevice& operator=(const BaseDevice&); BaseDevice (const BaseDevice&); - /** Retrieves family indices of compute, DMA, graphics, transfer queue families for the specified physical device. + /** Retrieves family indices of compute, DMA, graphics and transfer queue families for the specified physical device. * * @param in_physical_device_ptr Physical device to use for the query. * @param out_device_queue_family_info_ptr Deref will be used to store the result info. Must not be null. @@ -595,6 +621,7 @@ namespace Anvil VkDevice m_device; ExtensionAMDDrawIndirectCountEntrypoints m_amd_draw_indirect_count_extension_entrypoints; + ExtensionAMDShaderInfoEntrypoints m_amd_shader_info_extension_entrypoints; ExtensionEXTDebugMarkerEntrypoints m_ext_debug_marker_extension_entrypoints; ExtensionKHRMaintenance1Entrypoints m_khr_maintenance1_extension_entrypoints; ExtensionKHRSurfaceEntrypoints m_khr_surface_extension_entrypoints; @@ -610,9 +637,11 @@ namespace Anvil bool m_amd_rasterization_order_enabled; bool m_amd_shader_ballot_enabled; bool m_amd_shader_explicit_vertex_parameter_enabled; + bool m_amd_shader_info_enabled; bool m_amd_shader_trinary_minmax_enabled; bool m_amd_texture_gather_bias_lod_enabled; bool m_ext_debug_marker_enabled; + bool m_ext_shader_stencil_export_enabled; bool m_ext_shader_subgroup_ballot_enabled; bool m_ext_shader_subgroup_vote_enabled; bool m_khr_16bit_storage_enabled; @@ -621,6 +650,7 @@ namespace Anvil bool m_khr_surface_enabled; bool m_khr_swapchain_enabled; + std::shared_ptr m_compute_pipeline_manager_ptr; std::shared_ptr m_dummy_dsg_ptr; std::vector m_enabled_extensions; @@ -654,6 +684,9 @@ namespace Anvil * support. * @param in_support_resettable_command_buffer_allocs True if the command pools should be configured for resettable command * buffer support. + * @param in_mt_safe True if command buffer creation and queue submissions should be automatically serialized. + * Set to false if your app is never going to use more than one thread at a time for + * command buffer creation or submission. * * @return A new Device instance. **/ @@ -661,7 +694,8 @@ namespace Anvil const DeviceExtensionConfiguration& in_extensions, const std::vector& in_layers, bool in_transient_command_buffer_allocs_only, - bool in_support_resettable_command_buffer_allocs); + bool in_support_resettable_command_buffer_allocs, + bool in_mt_safe = false); /** Creates a new swapchain instance for the device. * @@ -762,11 +796,12 @@ namespace Anvil virtual ~SGPUDevice(); /** Private constructor. Please use create() instead. */ - SGPUDevice(std::weak_ptr in_physical_device_ptr); + SGPUDevice(std::weak_ptr in_physical_device_ptr, + bool in_mt_safe); /* Private variables */ std::weak_ptr m_parent_physical_device_ptr; }; }; /* namespace Anvil */ -#endif /* WRAPPERS_DEVICE_H */ \ No newline at end of file +#endif /* WRAPPERS_DEVICE_H */ diff --git a/include/wrappers/event.h b/include/wrappers/event.h index 54357354..027e590c 100644 --- a/include/wrappers/event.h +++ b/include/wrappers/event.h @@ -32,12 +32,14 @@ #define WRAPPERS_EVENT_H #include "misc/debug_marker.h" +#include "misc/mt_safety.h" #include "misc/types.h" namespace Anvil { /** Wrapper class for Vulkan events */ - class Event : public DebugMarkerSupportProvider + class Event : public DebugMarkerSupportProvider, + public MTSafetySupportProvider { public: /* Public functions */ @@ -48,7 +50,8 @@ namespace Anvil * * @param in_device_ptr Device to use. */ - static std::shared_ptr create(std::weak_ptr in_device_ptr); + static std::shared_ptr create(std::weak_ptr in_device_ptr, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destructor. * @@ -89,7 +92,8 @@ namespace Anvil /* Private functions */ /* Constructor. */ - Event(std::weak_ptr in_device_ptr); + Event(std::weak_ptr in_device_ptr, + bool in_mt_safe); Event (const Event&); Event& operator=(const Event&); diff --git a/include/wrappers/fence.h b/include/wrappers/fence.h index 4e631221..e1120cbf 100644 --- a/include/wrappers/fence.h +++ b/include/wrappers/fence.h @@ -32,12 +32,14 @@ #define WRAPPERS_FENCE_H #include "misc/debug_marker.h" +#include "misc/mt_safety.h" #include "misc/types.h" namespace Anvil { /* Wrapper class for Vulkan fences */ - class Fence : public DebugMarkerSupportProvider + class Fence : public DebugMarkerSupportProvider, + public MTSafetySupportProvider { public: /* Public functions */ @@ -57,7 +59,8 @@ namespace Anvil * False to make it unsignalled at creation time. */ static std::shared_ptr create(std::weak_ptr in_device_ptr, - bool in_create_signalled); + bool in_create_signalled, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Retrieves a raw handle to the underlying Vulkan fence instance */ VkFence get_fence() const @@ -107,7 +110,8 @@ namespace Anvil * Please see documentation of create() for specification */ Fence(std::weak_ptr in_device_ptr, - bool in_create_signalled); + bool in_create_signalled, + bool in_mt_safe); Fence (const Fence&); Fence& operator=(const Fence&); diff --git a/include/wrappers/framebuffer.h b/include/wrappers/framebuffer.h index f3c6e032..90033be0 100644 --- a/include/wrappers/framebuffer.h +++ b/include/wrappers/framebuffer.h @@ -30,11 +30,13 @@ #define WRAPPERS_FRAMEBUFFER_H #include "misc/debug_marker.h" +#include "misc/mt_safety.h" #include "misc/types.h" namespace Anvil { - class Framebuffer : public DebugMarkerSupportProvider + class Framebuffer : public DebugMarkerSupportProvider, + public MTSafetySupportProvider { public: /* Public functions */ @@ -51,7 +53,8 @@ namespace Anvil static std::shared_ptr create(std::weak_ptr in_device_ptr, uint32_t in_width, uint32_t in_height, - uint32_t in_n_layers); + uint32_t in_n_layers, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destructor. * @@ -186,13 +189,12 @@ namespace Anvil Framebuffer(std::weak_ptr in_device_ptr, uint32_t in_width, uint32_t in_height, - uint32_t in_n_layers); + uint32_t in_n_layers, + bool in_mt_safe); Framebuffer& operator=(const Framebuffer&); Framebuffer (const Framebuffer&); - void on_renderpass_changed(Anvil::CallbackArgument* in_callback_argument_ptr); - /* Private members */ FramebufferAttachments m_attachments; BakedFramebufferMap m_baked_framebuffers; diff --git a/include/wrappers/graphics_pipeline_manager.h b/include/wrappers/graphics_pipeline_manager.h index 62f14cc2..ee6ec647 100644 --- a/include/wrappers/graphics_pipeline_manager.h +++ b/include/wrappers/graphics_pipeline_manager.h @@ -48,7 +48,7 @@ * Min depth boundary: 0.0 * Min sample shading: 1.0 * Number of raster samples: 1 - * Number of tessellation patches: 0 + * Number of tessellation patches: 1 * Primitive topology: VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST * Sample mask: 0xFFFFFFFF * Slope scaled depth bias: 0.0 @@ -81,40 +81,19 @@ namespace Anvil { public: /* Public type definitions */ - typedef enum - { - DYNAMIC_STATE_BLEND_CONSTANTS_BIT = 1 << 0, - DYNAMIC_STATE_DEPTH_BIAS_BIT = 1 << 1, - DYNAMIC_STATE_DEPTH_BOUNDS_BIT = 1 << 2, - DYNAMIC_STATE_LINE_WIDTH_BIT = 1 << 3, - DYNAMIC_STATE_SCISSOR_BIT = 1 << 4, - DYNAMIC_STATE_STENCIL_COMPARE_MASK_BIT = 1 << 5, - DYNAMIC_STATE_STENCIL_REFERENCE_BIT = 1 << 6, - DYNAMIC_STATE_STENCIL_WRITE_MASK_BIT = 1 << 7, - DYNAMIC_STATE_VIEWPORT_BIT = 1 << 8, - } DynamicStateBits; - - typedef uint32_t DynamicStateBitfield; - /* Prototype for a call-back function, invoked right after vkCreateGraphicsPipelines() call returns. **/ - typedef std::function in_device_ptr, - GraphicsPipelineID in_pipeline_id)> PipelinePostBakeFunction; + /* Public functions */ - /* Prototype for a call-back function, invoked before a Vulkan graphics pipeline is created. + /** Generates a VkPipeline instance for each outstanding pipeline object. * - * The caller can adjust any of the VkGraphicsPipelineCreateInfo fields, with an assumption - * Anvil::GraphicsPipelineManager will not adjust its internal state to sync with user-modified - * fields. + * @return true if successful, false otherwise. **/ - typedef std::function in_device_ptr, - GraphicsPipelineID in_pipeline_id, - VkGraphicsPipelineCreateInfo* in_graphics_pipeline_create_info_ptr)> PipelinePreBakeFunction; - - /* Public functions */ + bool bake(); /** Creates a new GraphicsPipelineManager instance. * * @param in_device_ptr Device to use. + * @param in_mt_safe True if more than one thread at a time is going to be issuing calls against the pipeline manager. * @param in_use_pipeline_cache true if the manager should use a pipeline cache instance. false * to pass nullptr whenever a Vulkan descriptor requires us to specify * one. @@ -124,1533 +103,48 @@ namespace Anvil * a new pipeline cache with size 0 will be allocated. **/ static std::shared_ptr create(std::weak_ptr in_device_ptr, + bool in_mt_safe, bool in_use_pipeline_cache = false, std::shared_ptr in_pipeline_cache_to_reuse_ptr = std::shared_ptr() ); /** Destructor. */ virtual ~GraphicsPipelineManager(); - /** Adds a new derivative pipeline, to be used the specified renderpass' subpass. All states of the base pipeline - * will be copied to the new pipeline. - * - * @param in_disable_optimizations If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT flag. - * @param in_allow_derivatives If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT flag. - * @param in_renderpass_ptr Renderpass instance the pipeline is to be created for. Must not be nullptr. - * The renderpass instance will be implicitly retained. - * @param in_subpass_id ID of the subpass the pipeline is to be created for. - * @param in_fragment_shader_stage_entrypoint_info Fragment shader to use for the pipeline. Pass an instance initialized with - * dummy constructor if the stage is irrelevant. - * @param in_geometry_shader_stage_entrypoint_info Geometry shader to use for the pipeline. Pass an instance initialized with - * dummy constructor if the stage is irrelevant. - * @param in_tess_control_shader_stage_entrypoint_info Tessellation control shader to use for the pipeline. Pass an instance initialized with - * dummy constructor if the stage is irrelevant. - * @param in_tess_evaluation_shader_stage_entrypoint_info Tessellation evaluation shader to use for the pipeline. Pass an instance initialized - * with dummy constructor if the stage is irrelevant. - * @param in_vertex_shader_stage_entrypoint_info Vertex shader to use for the pipeline. Must not be a dummy shader stage entrypoint - * descriptor. - * @param in_base_pipeline_id Graphics pipeline ID of the base graphics pipeline. The ID must have been returned - * by one of the preceding add_() calls, issued against the same GraphicsPipelineManager - * instance. Must not refer to a proxy pipeline. - * @param out_graphics_pipeline_id_ptr Deref will be set to the new graphics pipeline's ID. Must not be nullptr. - **/ - bool add_derivative_pipeline_from_sibling_pipeline(bool in_disable_optimizations, - bool in_allow_derivatives, - std::shared_ptr in_renderpass_ptr, - SubPassID in_subpass_id, - const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, - GraphicsPipelineID in_base_pipeline_id, - GraphicsPipelineID* out_graphics_pipeline_id_ptr); - - /** Adds a new derivative pipeline, to be used the specified renderpass' subpass. Since the base pipeline is - * a Vulkan object, its state values are NOT automatically copied to the new derivative pipeline. - * - * @param in_disable_optimizations If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT flag. - * @param in_allow_derivatives If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT flag. - * @param in_renderpass_ptr Renderpass instance the pipeline is to be created for. Must not be nullptr. - * The renderpass instance will be implicitly retained. - * @param in_subpass_id ID of the subpass the pipeline is to be created for. - * @param in_fragment_shader_stage_entrypoint_info Fragment shader to use for the pipeline. Pass an instance initialized with - * dummy constructor if the stage is irrelevant. - * @param in_geometry_shader_stage_entrypoint_info Geometry shader to use for the pipeline. Pass an instance initialized with - * dummy constructor if the stage is irrelevant. - * @param in_tess_control_shader_stage_entrypoint_info Tessellation control shader to use for the pipeline. Pass an instance initialized with - * dummy constructor if the stage is irrelevant. - * @param in_tess_evaluation_shader_stage_entrypoint_info Tessellation evaluation shader to use for the pipeline. Pass an instance initialized - * with dummy constructor if the stage is irrelevant. - * @param in_vertex_shader_stage_entrypoint_info Vertex shader to use for the pipeline. Must not be a dummy shader stage descriptor. - * @param in_base_pipeline Base graphics pipeline. Must not be nullptr. - * @param out_graphics_pipeline_id_ptr Deref will be set to the new graphics pipeline's ID. Must not be nullptr. - **/ - bool add_derivative_pipeline_from_pipeline(bool in_disable_optimizations, - bool in_allow_derivatives, - std::shared_ptr in_renderpass_ptr, - SubPassID in_subpass_id, - const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, - VkPipeline in_base_pipeline, - GraphicsPipelineID* out_graphics_pipeline_id_ptr); - - /** Registers a new proxy pipeline. A proxy pipeline cannot be baked, but it can hold state data and act - * as a parent for other pipelines, which inherit their state at creation time. - * - * @param out_proxy_graphics_pipeline_id_ptr Deref will be set to the ID of the result pipeline object. - * Must not be nullptr. - * - * @return true if successful, false otherwise. - **/ - bool add_proxy_pipeline(GraphicsPipelineID* out_proxy_graphics_pipeline_id_ptr); - - /** Adds a new non-derivative pipeline, to be used the specified renderpass' subpass. - * - * @param in_disable_optimizations If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT flag. - * @param in_allow_derivatives If true, the pipeline will be created with the - * VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT flag. - * @param in_renderpass_ptr Renderpass instance the pipeline is to be created for. Must not be nullptr. - * The renderpass instance will be implicitly retained. - * @param in_subpass_id ID of the subpass the pipeline is to be created for. - * @param in_fragment_shader_stage_entrypoint_info Fragment shader to use for the pipeline. Pass an instance initialized with - * dummy constructor if the stage is irrelevant. - * @param in_geometry_shader_stage_entrypoint_info Geometry shader to use for the pipeline. Pass an instance initialized with - * dummy constructor if the stage is irrelevant. - * @param in_tess_control_shader_stage_entrypoint_info Tessellation control shader to use for the pipeline. Pass an instance initialized with - * dummy constructor if the stage is irrelevant. - * @param in_tess_evaluation_shader_stage_entrypoint_info Tessellation evaluation shader to use for the pipeline. Pass an instance initialized - * with dummy constructor if the stage is irrelevant. - * @param in_vertex_shader_stage_entrypoint_info Vertex shader to use for the pipeline. Must not be a dummy shader stage descriptor. - * @param out_graphics_pipeline_id_ptr Deref will be set to the new graphics pipeline's ID. Must not be nullptr. - **/ - bool add_regular_pipeline(bool in_disable_optimizations, - bool in_allow_derivatives, - std::shared_ptr in_renderpass_ptr, - SubPassID in_subpass_id, - const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, - GraphicsPipelineID* out_graphics_pipeline_id_ptr); - - /** Deletes an existing pipeline. - * - * @param in_graphics_pipeline_id ID of a pipeline to delete. - * - * @return true if successful, false otherwise. - **/ - bool delete_pipeline(GraphicsPipelineID in_graphics_pipeline_id); - - /** Adds a new vertex attribute descriptor to the specified graphics pipeline. This data will be used - * at baking time to configure input vertex attribute & bindings for the Vulkan pipeline object. - * - * By default, Anvil only assigns a unique binding to those vertex attributes, whose characteristics - * are unique (ie. whose input rate & stride match). This works well for most of the use cases, the - * only exception being when you need to associate a unique offset to a specific vertex binding. In - * this case, you need to set @param in_explicit_binding_index to an index, under which your exclusive - * binding is going to be stored. - * When preparing the binding array, Anvil will not reuse user-specified "explicit" bindings for - * attributes, for which "explicit" bindings have not been requested, even if their properties match. - * - * - * @param in_graphics_pipeine_id ID of the graphics pipeline object, whose state should be changed. The ID - * must have been returned by one of the add_() functions, issued against the - * same GraphicsPipelineManager instance. - * @param in_location Vertex attribute location - * @param in_format Vertex attribute format. - * @param in_offset_in_bytes Start offset of the vertex attribute data. - * @param in_stride_in_bytes Stride of the vertex attribute data. - * @param in_step_rate Step rate to use for the vertex attribute data. - * @param in_explicit_binding_index Please see general description of the function for more details. - * - * @return true if successful, false otherwise. - **/ - bool add_vertex_attribute(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_location, - VkFormat in_format, - uint32_t in_offset_in_bytes, - uint32_t in_stride_in_bytes, - VkVertexInputRate in_step_rate, - uint32_t in_explicit_binding_index = UINT32_MAX); - - /** Generates a VkPipeline instance for each pipeline object marked as dirty. If a dirty pipeline - * has already been baked in the past, the former object instance is released. - * - * @return true if successful, false otherwise. - **/ - bool bake(); - - /** Tells whether the graphics pipeline has been created with enabled alpha-to-coverage mode. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param out_opt_is_enabled_ptr If not NULL, deref will be set to true if the mode has been - * enabled for the pipeline, or to false otherwise. - * - * @return true if successful, false otherwise. - **/ - bool get_alpha_to_coverage_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr) const; - - /** Tells whether the graphics pipeline has been created with enabled alpha-to-one mode. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param out_opt_is_enabled_ptr If not NULL, deref will be set to true if the mode has been - * enabled for the pipeline, or to false otherwise. - * - * @return true if successful, false otherwise. - **/ - bool get_alpha_to_one_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr) const; - - /** Retrieves blending properties of the specified graphics pipeline. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param out_opt_blend_constant_vec4_ptr If not NULL, deref will be assigned four float values - * representing the blend constant. - * @param out_opt_n_blend_attachments_ptr If not NULL, deref will be set to the number of blend - * attachments the graphics pipeline supports. - * - * @return true if successful, false otherwise - **/ - bool get_blending_properties(GraphicsPipelineID in_graphics_pipeline_id, - float* out_opt_blend_constant_vec4_ptr, - uint32_t* out_opt_n_blend_attachments_ptr) const; - - /** Retrieves color blend attachment properties for the specified graphics pipeline and subpass - * attachment. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param in_attachment_id ID of the attachment the query is being made for. - * @param out_opt_blending_enabled_ptr If not null, deref will be set to true if blending has been - * enabled for this pipeline, or to false otherwise. - * @param out_opt_blend_op_color_ptr If not null, deref will be set to the specified attachment's - * color blend op. - * @param out_opt_blend_op_alpha_ptr If not null, deref will be set to the specified attachment's - * alpha blend op. - * @param out_opt_src_color_blend_factor_ptr If not null, deref will be set to the specified attachment's - * source color blend factor. - * @param out_opt_dst_color_blend_factor_ptr If not null, deref will be set to the specified attachment's - * destination color blend factor. - * @param out_opt_src_alpha_blend_factor_ptr If not null, deref will be set to the specified attachment's - * source alpha blend factor. - * @param out_opt_dst_alpha_blend_factor_ptr If not null, deref will be set to the specified attachment's - * destination alpha blend factor. - * @param out_opt_channel_write_mask_ptr If not null, deref will be set to the specified attachment's - * write mask. - * - * @return true if successful, false otherwise. - */ - bool get_color_blend_attachment_properties(GraphicsPipelineID in_graphics_pipeline_id, - SubPassAttachmentID in_attachment_id, - bool* out_opt_blending_enabled_ptr, - VkBlendOp* out_opt_blend_op_color_ptr, - VkBlendOp* out_opt_blend_op_alpha_ptr, - VkBlendFactor* out_opt_src_color_blend_factor_ptr, - VkBlendFactor* out_opt_dst_color_blend_factor_ptr, - VkBlendFactor* out_opt_src_alpha_blend_factor_ptr, - VkBlendFactor* out_opt_dst_alpha_blend_factor_ptr, - VkColorComponentFlags* out_opt_channel_write_mask_ptr) const; - - /** Retrieves depth bias-related state configuration for the specified graphics pipeline. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param out_opt_is_enabled_ptr If not null, deref will be set to true if depth bias has - * been enabled for the pipeline, or to false otherwise. - * @param out_opt_depth_bias_constant_factor_ptr If not null, deref will be set to the depth bias constant factor - * assigned to the pipeline. - * @param out_opt_depth_bias_clamp_ptr If not null, deref will be set to the depth bias clamp value, as - * assigned to the pipeline. - * @param out_opt_depth_bias_slope_factor_ptr If not null, deref will be set to the depth bias slope factor, as - * configured for the pipeline. - * - * @return true if successful, false otherwise. - **/ - bool get_depth_bias_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr, - float* out_opt_depth_bias_constant_factor_ptr, - float* out_opt_depth_bias_clamp_ptr, - float* out_opt_depth_bias_slope_factor_ptr) const; - - /** Retrieves depth bounds-related state configuration for the specified graphics pipeline. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param out_opt_is_enabled_ptr If not null, deref will be set to true if depth bounds mode - * has been enabled for the pipeline, or to false otherwise. - * @param out_opt_min_depth_bounds_ptr If not null, deref will be set to the minimum depth bound value - * assigned to the pipeline. - * @param out_opt_max_depth_bounds_ptr If not null, deref will be set to the maximum depth bound value - * assigned to the pipeline. - * - * @return true if successful, false otherwise. - **/ - bool get_depth_bounds_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr, - float* out_opt_min_depth_bounds_ptr, - float* out_opt_max_depth_bounds_ptr) const; - - /** Tells whether the graphics pipeline has been created with enabled depth clamping. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param out_opt_is_enabled_ptr If not NULL, deref will be set to true if depth clampnig has - * been enabled for the pipeline, or to false otherwise. - * - * @return true if successful, false otherwise. - **/ - bool get_depth_clamp_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr) const; - - /** Retrieves depth test-related state configuration for the specified graphics pipeline. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param out_opt_is_enabled_ptr If not null, deref will be set to true if depth test has been - * enabled for the pipeline, or to false otherwise. - * @param out_opt_compare_op_ptr If not null, deref will be set to the depth compare op assigned - * to the pipeline. - * - * @return true if successful, false otherwise. - **/ - bool get_depth_test_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr, - VkCompareOp* out_opt_compare_op_ptr) const; - - /** Tells whether the graphics pipeline has been created with enabled depth writes. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param out_opt_is_enabled_ptr If not NULL, deref will be set to true if depth writes have - * been enabled for the pipeline, or to false otherwise. - * - * @return true if successful, false otherwise. - **/ - bool get_depth_write_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr) const; - - /** Tells the number of dynamic scissor boxes, as specified at graphics pipeline instantiation time - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param out_opt_n_dynamic_scissor_boxes_ptr If not null, deref will be set to the number of dynamic - * scissor boxes used by the pipeline. - * - * @return true if successful, false otherwise. - * - **/ - bool get_dynamic_scissor_state_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t* out_opt_n_dynamic_scissor_boxes_ptr) const; - - /** Tells what dynamic states have been enabled for the specified graphics pipeline. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param out_opt_enabled_dynamic_states_ptr If not null, deref will be updated with a bitfield value, - * telling which dynamic states have been enabled for the pipeline. - * - * @return true if successful, false otherwise. - **/ - bool get_dynamic_states(GraphicsPipelineID in_graphics_pipeline_id, - DynamicStateBitfield* out_opt_enabled_dynamic_states_ptr) const; - - /** Tells the number of dynamic viewports, as specified at graphics pipeline instantiation time - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param out_opt_n_dynamic_viewports_ptr If not null, deref will be set to the number of dynamic viewports - * used by the pipeline. - * - * @return true if successful, false otherwise. - * - **/ - bool get_dynamic_viewport_state_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t* out_n_dynamic_viewports_ptr) const; - - /** Retrieves general pipeline properties - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param out_opt_n_scissors_ptr If not null, deref will be set to the number of scissors used - * by the pipeline. - * @param out_opt_n_viewports_ptr If not null, deref will be set to the number of viewports used - * by the pipeline. - * @param out_opt_n_vertex_input_attributes_ptr If not null, deref will be set to the number of vertex - * attributes used by the pipeline. - * @param out_opt_n_vertex_input_bindings_ptr If not null, deref will be set to the number of vertex bindings - * defined for the pipeline. - * @param out_opt_renderpass_ptr If not null, deref will be set to the renderpass assigned to - * the pipeline. - * @param out_opt_subpass_id_ptr If not null, deref will be set to the ID of the subpass the pipeline - * has been created for. - * - * @return true if successful, false otherwise. - **/ - bool get_graphics_pipeline_properties(Anvil::GraphicsPipelineID in_graphics_pipeline_id, - uint32_t* out_opt_n_scissors_ptr, - uint32_t* out_opt_n_viewports_ptr, - uint32_t* out_opt_n_vertex_input_attributes_ptr, - uint32_t* out_opt_n_vertex_input_bindings_ptr, - std::shared_ptr* out_opt_renderpass_ptr, - SubPassID* out_opt_subpass_id_ptr) const; - - /** Returns a VkPipeline instance for the specified graphics pipeline ID. If the pipeline is marked as dirty, - * the Vulkan object will be created before returning after former instance is released. - * - * @param in_pipeline_id ID of the pipeline to return the VkPipeline instance for. Must not describe - * a proxy pipeline. - * - * @return As per description. - **/ - VkPipeline get_graphics_pipeline(GraphicsPipelineID in_pipeline_id); - - /** Retrieves a PipelineLayout instance associated with the specified pipeline ID. - * - * The function will bake a pipeline object (and, possibly, a pipeline layout object, too) if - * the specified pipeline is marked as dirty. - * - * @param in_pipeline_id ID of the pipeline to return the wrapper instance for. - * Must not describe a proxy pipeline. - * - * @return Ptr to a PipelineLayout instance or nullptr if the function failed. - **/ - std::shared_ptr get_graphics_pipeline_layout(GraphicsPipelineID in_pipeline_id); - - /** Tells what primitive topology the specified graphics pipeline has been created for. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param out_opt_primitive_topology_ptr If not null, deref will be set to primitive topology, as specified - * at creation time. - * - * @return true if successful, false otherwise. - **/ - bool get_input_assembly_properties(GraphicsPipelineID in_graphics_pipeline_id, - VkPrimitiveTopology* out_opt_primitive_topology_ptr) const; - - /** Retrieves logic op-related state configuration for the specified graphics pipeline. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param out_opt_is_enabled_ptr If not null, deref will be set to true if the logic op has - * been enabled for the pipeline, or to false otherwise. - * @param out_opt_logic_op_ptr If not null, deref will be set to the logic op enum, specified - * at creation time. - * - * @return true if successful, false otherwise. - **/ - bool get_logic_op_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr, - VkLogicOp* out_opt_logic_op_ptr) const; - - /** Retrieves multisampling-related state configuration for the specified graphics pipeline. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param out_opt_sample_count_ptr If not null, deref will be set to the enum value telling - * the sample count assigned to the pipeline. - * @param out_opt_sample_mask_ptr If not null, deref will be set to the sample mask assigned - * to the pipeline. - * - * @return true if successful, false otherwise. - **/ - bool get_multisampling_properties(GraphicsPipelineID in_graphics_pipeline_id, - VkSampleCountFlags* out_opt_sample_count_ptr, - VkSampleMask* out_opt_sample_mask_ptr) const; - - /** Tells whether the graphics pipeline has been created with enabled primitive restart mode. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param out_opt_is_enabled_ptr If not NULL, deref will be set to true if primitive restart has - * been enabled for the pipeline, or to false otherwise. - * - * @return true if successful, false otherwise. - **/ - bool get_primitive_restart_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr) const; - - /** Tells what rasterization order the graphics pipeline has been created for. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param out_opt_rasterization_order_ptr If not null, deref will be set to the rasterization order - * assigned to the pipeline. - * - * @return true if successful, false otherwise. - **/ - bool get_rasterization_order(GraphicsPipelineID in_graphics_pipeline_id, - VkRasterizationOrderAMD* out_opt_rasterization_order_ptr) const; - - /** Tells whether the graphics pipeline has been created with enabled rasterizer discard mode. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param out_opt_is_enabled_ptr If not NULL, deref will be set to true if the mode has been - * enabled for the pipeline, or to false otherwise. - * - * @return true if successful, false otherwise. - **/ - bool get_rasterizer_discard_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr) const; - - /** Retrieves various properties of the specified graphics pipeline which are related to - * rasterization. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param out_opt_polygon_mode_ptr If not null, deref will be set to polygon mode used by the - * pipeline. - * @param out_opt_cull_mode_ptr If not null, deref will be set to cull mode used by the - * pipeline. - * @param out_opt_front_face_ptr If not null, deref will be set to front face setting, used - * by the pipeline. - * @param out_opt_line_width_ptr If not null, deref will be set to line width setting, as used - * by the pipeline. - * - * @return true if successful, false otherwise. - **/ - bool get_rasterization_properties(GraphicsPipelineID in_graphics_pipeline_id, - VkPolygonMode* out_opt_polygon_mode_ptr, - VkCullModeFlags* out_opt_cull_mode_ptr, - VkFrontFace* out_opt_front_face_ptr, - float* out_opt_line_width_ptr) const; - - /** Retrieves state configuration related to per-sample shading for the specified graphics pipeline. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param out_opt_is_enabled_ptr If not null, deref will be set to true if per-sample shading - * is enabled for the pipeline. - * @param out_opt_min_sample_shading_ptr If not null, deref will be set to the minimum sample shading value, - * as specified at creation time. - * - * @return true if successful, false otherwise. - **/ - bool get_sample_shading_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr, - float* out_opt_min_sample_shading_ptr) const; - - /** Retrieves properties of a scissor box at a given index for the specified graphics pipeline. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param in_n_scissor_box Index of the scissor box to retrieve data of. - * @param out_opt_x_ptr If not null, deref will be set to X offset of the scissor box. - * @param out_opt_y_ptr If not null, deref will be set to Y offset of the scissor box. - * @param out_opt_width_ptr If not null, deref will be set to width of the scissor box. - * @param out_opt_height_ptr If not null, deref will be set to height of the scissor box. - * - * @return true if successful, false otherwise. - **/ - bool get_scissor_box_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_n_scissor_box, - int32_t* out_opt_x_ptr, - int32_t* out_opt_y_ptr, - uint32_t* out_opt_width_ptr, - uint32_t* out_opt_height_ptr) const; - - /** Retrieves stencil test-related state configuration for the specified graphics pipeline. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being - * made for. - * @param out_opt_is_enabled_ptr If not null, deref will be set to true if stencil test - * has been enabled for the pipeline. - * @param out_opt_front_stencil_fail_op_ptr If not null, deref will be set to "front stencil fail operation" - * setting, as specified at creation time. - * @param out_opt_front_stencil_pass_op_ptr If not null, deref will be set to "front stencil pass operation" - * setting, as specified at creation time. - * @param out_opt_front_stencil_depth_fail_op_ptr If not null, deref will be set to "front stencil depth fail operation" - * setting, as specified at creation time. - * @param out_opt_front_stencil_compare_op_ptr If not null, deref will be set to "front stencil compare operation" - * setting, as specified at creation time. - * @param out_opt_front_stencil_compare_mask_ptr If not null, deref will be set to front stencil compare mask, as - * specified at creation time. - * @param out_opt_front_stencil_write_mask_ptr If not null, deref will be set to front stencil write mask, as - * specified at creation time. - * @param out_opt_front_stencil_reference_ptr If not null, deref will be set to front stencil reference value, as - * specified at creation time. - * @param out_opt_back_stencil_fail_op_ptr If not null, deref will be set to "back stencil fail operation" - * setting, as specified at creation time. - * @param out_opt_back_stencil_pass_op_ptr If not null, deref will be set to "back stencil pass operation" - * setting, as specified at creation time. - * @param out_opt_back_stencil_depth_fail_op_ptr If not null, deref will be set to "back stencil depth fail operation" - * setting, as specified at creation time. - * @param out_opt_back_stencil_compare_op_ptr If not null, deref will be set to "back stencil compare operation" - * setting, as specified at creation time. - * @param out_opt_back_stencil_compare_mask_ptr If not null, deref will be set to back stencil compare mask, as - * specified at creation time. - * @param out_opt_back_stencil_write_mask_ptr If not null, deref will be set to back stencil write mask, as - * specified at creation time. - * @param out_opt_back_stencil_reference_ptr If not null, deref will be set to back stencil reference value, as - * specified at creation time. - * - * @return true if successful, false otherwise. - **/ - bool get_stencil_test_properties(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr, - VkStencilOp* out_opt_front_stencil_fail_op_ptr, - VkStencilOp* out_opt_front_stencil_pass_op_ptr, - VkStencilOp* out_opt_front_stencil_depth_fail_op_ptr, - VkCompareOp* out_opt_front_stencil_compare_op_ptr, - uint32_t* out_opt_front_stencil_compare_mask_ptr, - uint32_t* out_opt_front_stencil_write_mask_ptr, - uint32_t* out_opt_front_stencil_reference_ptr, - VkStencilOp* out_opt_back_stencil_fail_op_ptr, - VkStencilOp* out_opt_back_stencil_pass_op_ptr, - VkStencilOp* out_opt_back_stencil_depth_fail_op_ptr, - VkCompareOp* out_opt_back_stencil_compare_op_ptr, - uint32_t* out_opt_back_stencil_compare_mask_ptr, - uint32_t* out_opt_back_stencil_write_mask_ptr, - uint32_t* out_opt_back_stencil_reference_ptr) const; - - /** Tells the number of patch control points, as specified at creation time for the specified - * graphics pipeline. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param out_opt_n_patch_control_points_ptr If not null, deref will be set to the number of patch control points, - * as specified at creation time. - * - * @return true if successful, false otherwise. - **/ - bool get_tessellation_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t* out_opt_n_patch_control_points_ptr) const; - - /** Returns properties of a vertex attribute at a given index for the specified graphics pipeline. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param in_n_vertex_input_attribute Index of the vertex attribute to retrieve info of. - * @param out_opt_location_ptr If not null, deref will be set to the specified attribute's location. - * @param out_opt_binding_ptr If not null, deref will be set to the specified attribute's binding index. - * @param out_opt_format_ptr If not null, deref will be set to the specified attribute's format. - * @param out_opt_offset_ptr If not null, deref will be set to the specified attribute's start offset. - * - * @return true if successful, false otherwise. - **/ - bool get_vertex_input_attribute_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_n_vertex_input_attribute, - uint32_t* out_opt_location_ptr, - uint32_t* out_opt_binding_ptr, - VkFormat* out_opt_format_ptr, - uint32_t* out_opt_offset_ptr) const; - - /** Tells which binding has been assigned to a vertex attribute at location @param input_vertex_attribute_location. - * - * This function may trigger baking of one or more graphics pipelines, if the user-specified graphics pipeline - * is marked as dirty. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param in_input_vertex_attribute_location Location of the queried vertex attribute. - * @param out_input_vertex_attribute_binding_ptr Deref will be set to the index of the input vertex binding, - * assigned to the vertex attribute. Must not be null. - * - * @return true if successful, false otherwise. - */ - bool get_vertex_input_binding_for_attribute_location(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_input_vertex_attribute_location, - uint32_t* out_input_vertex_binding_ptr); - - /** Returns properties of a vertex binding at a given index for the specified graphics pipeline. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param in_n_vertex_input_binding Index of the vertex binding to retrieve info of. - * @param out_opt_binding_ptr If not null, deref will be set to the specified binding's index. - * @param out_opt_stride_ptr If not null, deref will be set to the specified binding's stride. - * @param out_opt_input_rate_ptr If not null, deref will be set to the specified binding's input rate. - * - * @return true if successful, false otherwise. - **/ - bool get_vertex_input_binding_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_n_vertex_input_binding, - uint32_t* out_opt_binding_ptr, - uint32_t* out_opt_stride_ptr, - VkVertexInputRate* out_opt_input_rate_ptr) const; - - /** Retrieves properties of a viewport at a given index for the specified graphics pipeline. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline the query is being made for. - * @param in_n_viewport Index of the viewport to retrieve properties of. - * @param out_opt_origin_x_ptr If not null, deref will be set to the viewport's X origin. - * @param out_opt_origin_y_ptr If not null, deref will be set to the viewport's Y origin. - * @param out_opt_width_ptr If not null, deref will be set to the viewport's width. - * @param out_opt_height_ptr If not null, deref will be set to the viewport's height. - * @param out_opt_min_depth_ptr If not null, deref will be set to the viewport's minimum depth value. - * @param out_opt_max_depth_ptr If not null, deref will be set to the viewport's maximum depth value. - * - * @return true if successful, false otherwise. - **/ - bool get_viewport_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_n_viewport, - float* out_opt_origin_x_ptr, - float* out_opt_origin_y_ptr, - float* out_opt_width_ptr, - float* out_opt_height_ptr, - float* out_opt_min_depth_ptr, - float* out_opt_max_depth_ptr) const; - - /** Sets a new blend constant for the specified graphics pipeline and marks the pipeline as dirty. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_blend_constant_vec4 4 floats, specifying the constant. Must not be nullptr. - * - **/ - void set_blending_properties(GraphicsPipelineID in_graphics_pipeline_id, - const float* in_blend_constant_vec4); - - /** Updates color blend properties for the specified sub-pass attachment, and marks the pipeline as dirty. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_attachment_id ID of the subpass attachment, for which the color blend properties should be applied. - * @param in_blending_enabled true if blending should be enabled for the specified attachment, false otherwise. - * @param in_blend_op_color Blend operation color to use for the attachment. - * @param in_blend_op_alpha Blend operation alpha to use for the attachment. - * @param in_src_color_blend_factor Source blend factor for color components. - * @param in_dst_color_blend_factor Destination blend factor for color components. - * @param in_src_alpha_blend_factor Source blend factor for the alpha component. - * @param in_dst_alpha_blend_factor Destination blend factor for the alpha component. - * @param in_channel_write_mask Component write mask to use for the attachment. - * - **/ - void set_color_blend_attachment_properties(GraphicsPipelineID in_graphics_pipeline_id, - SubPassAttachmentID in_attachment_id, - bool in_blending_enabled, - VkBlendOp in_blend_op_color, - VkBlendOp in_blend_op_alpha, - VkBlendFactor in_src_color_blend_factor, - VkBlendFactor in_dst_color_blend_factor, - VkBlendFactor in_src_alpha_blend_factor, - VkBlendFactor in_dst_alpha_blend_factor, - VkColorComponentFlags in_channel_write_mask); - - /** Updates the number of scissor boxes to be used, when dynamic scissor state is enabled. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_n_dynamic_scissor_boxes As per description. - */ - void set_dynamic_scissor_state_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_n_dynamic_scissor_boxes); - - /** Updates the number of viewports to be used, when dynamic viewport state is enabled. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_n_dynamic_viewports As per description. - */ - void set_dynamic_viewport_state_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_n_dynamic_viewports); - - /** Sets the primitive topology to be used for the pipeline, and marks the pipeline as dirty. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_primitive_topology As per description. - */ - void set_input_assembly_properties(GraphicsPipelineID in_graphics_pipeline_id, - VkPrimitiveTopology in_primitive_topology); - - /** Sets a number of multisampling properties to be used for the pipeline, and marks the pipeline as dirty. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_sample_count Number of rasterization samples to be used (expressed as one of the enum values). - * @param in_min_sample_shading Minimum number of unique samples to shade for each fragment. - * @param in_sample_mask Sample mask to use. - */ - void set_multisampling_properties(GraphicsPipelineID in_graphics_pipeline_id, - VkSampleCountFlagBits in_sample_count, - float in_min_sample_shading, - const VkSampleMask in_sample_mask); - - /** Sets a call-back, which GFX pipeline manager will invoke right after a vkCreateGraphicsPipeline() call is made. - * - * The call-back will be issued right before the vkCreateGraphicsPipelines() call is issued. - * - * This call overwrites any previous set_pipeline_post_bake_callback() calls. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to set the call-back for. - * @param in_pipeline_post_bake_function Function to call back. Must not be nullptr. - * - * @return true if successful, false otherwise. - **/ - bool set_pipeline_post_bake_callback(GraphicsPipelineID in_graphics_pipeline_id, - PipelinePostBakeFunction in_pipeline_post_bake_function); - - /** Sets a call-back, which GFX pipeline manager will invoke right before a vkCreateGraphicsPipeline() call is made. - * This allows the callee to adjust the VkGraphicsPipelineCreateInfo instance, eg. by modifying pNext to user-defined - * chain of structures. - * - * The call-back will be issued right before the vkCreateGraphicsPipelines() call is issued. - * - * This call overwrites any previous set_pipeline_pre_bake_callback() calls. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to set the call-back for. - * @param in_pfn_pipeline_pre_bake_proc Function to call back. Must not be nullptr. - * @param in_user_arg User argument to pass with the call-back. May be nullptr. - * - * @return true if successful, false otherwise. - **/ - bool set_pipeline_pre_bake_callback(GraphicsPipelineID in_graphics_pipeline_id, - PipelinePreBakeFunction in_pfn_pipeline_pre_bake_function); - - /** Copies graphics state from @param in_source_pipeline_id to @param in_target_pipeline_id, leaving - * the originally assigned renderpass, as well as the subpass ID, unaffected. - * - * @param in_target_pipeline_id ID of a graphics pipeline, to which state should be copied. - * @param in_source_pipeline_id ID of a graphics pipeline, from which state should be copied. - * - * @return true if successful, false otherwise. - **/ - bool set_pipeline_state_from_pipeline(GraphicsPipelineID in_target_pipeline_id, - GraphicsPipelineID in_source_pipeline_id); - - /** Configures the rasterization order for the pipeline if the VK_AMD_rasterization_order extension - * is supported by the device, for which the pipeline has been created. - * - * On drivers which do not support the extension, the call has no effect. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_rasterization_order Rasterization order to use. - **/ - void set_rasterization_order(GraphicsPipelineID in_graphics_pipeline_id, - VkRasterizationOrderAMD in_rasterization_order); - - /** Sets a number of rasterization properties to be used for the pipeline, and marks the pipeline as dirty. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_polygon_mode Polygon mode to use. - * @param in_cull_mode Cull mode to use. - * @param in_front_face Front face to use. - * @param in_line_width Line width to use. - **/ - void set_rasterization_properties(GraphicsPipelineID in_graphics_pipeline_id, - VkPolygonMode in_polygon_mode, - VkCullModeFlags in_cull_mode, - VkFrontFace in_front_face, - float in_line_width); - - /** Sets properties of a scissor box at the specified index, and marks the pipeline as dirty. - * - * If @param n_scissor_box is larger than 1, all previous scissor boxes must also be defined - * prior to baking. Number of scissor boxes must match the number of viewports defined for the - * pipeline. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_n_scissor_box Index of the scissor box to be updated. - * @param in_x X offset of the scissor box. - * @param in_y Y offset of the scissor box. - * @param in_width Width of the scissor box. - * @param in_height Height of the scissor box. - **/ - void set_scissor_box_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_n_scissor_box, - int32_t in_x, - int32_t in_y, - uint32_t in_width, - uint32_t in_height); - - /** Sets a number of stencil test properties to be used for the pipeline, and marks the pipeline as dirty. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_update_front_face_state true if the front face stencil states should be updated; false to update the - * back stencil states instead. - * @param in_stencil_fail_op Stencil fail operation to use. - * @param in_stencil_pass_op Stencil pass operation to use. - * @param in_stencil_depth_fail_op Stencil depth fail operation to use. - * @param in_stencil_compare_op Stencil compare operation to use. - * @param in_stencil_compare_mask Stencil compare mask to use. - * @param in_stencil_write_mask Stencil write mask to use. - * @param in_stencil_reference Stencil reference value to use. - **/ - void set_stencil_test_properties(GraphicsPipelineID in_graphics_pipeline_id, - bool in_update_front_face_state, - VkStencilOp in_stencil_fail_op, - VkStencilOp in_stencil_pass_op, - VkStencilOp in_stencil_depth_fail_op, - VkCompareOp in_stencil_compare_op, - uint32_t in_stencil_compare_mask, - uint32_t in_stencil_write_mask, - uint32_t in_stencil_reference); - - /** Updates the number of tessellation patch points to be used for the pipeline, and marks the pipeline as dirty. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_n_patch_control_points As per description. - **/ - void set_tessellation_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_n_patch_control_points); - - /** Sets properties of a viewport at the specified index, and marks the pipeline as dirty. - * - * If @param in_n_viewport is larger than 1, all previous viewports must also be defined - * prior to baking. Number of scissor boxes must match the number of viewports defined for the - * pipeline. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_n_viewport Index of the viewport, whose properties should be changed. - * @param in_origin_x X offset to use for the viewport's origin. - * @param in_origin_y Y offset to use for the viewport's origin. - * @param in_width Width of the viewport. - * @param in_height Height of the viewport. - * @param in_min_depth Minimum depth value to use for the viewport. - * @param in_max_depth Maximum depth value to use for the viewport. - **/ - void set_viewport_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_n_viewport, - float in_origin_x, - float in_origin_y, - float in_width, - float in_height, - float in_min_depth, - float in_max_depth); - - /** Enables or disables the "alpha to coverage" test, and marks the pipeline as dirty. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_should_enable true to enable the test; false to disable it. - */ - void toggle_alpha_to_coverage(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable); - - /** Enables or disables the "alpha to one" test, and marks the pipeline as dirty. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_should_enable true to enable the test; false to disable it. - */ - void toggle_alpha_to_one(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable); - - /** Enables or disables the "depth bias" mode, updates related state values, and marks - * the pipeline as dirty. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_should_enable true to enable the mode; false to disable it. - * @param in_depth_bias_constant_factor Depth bias constant factor to use for the mode. - * @param in_depth_bias_clamp Depth bias clamp to use for the mode. - * @param in_depth_bias_slope_factor Slope scale for the depth bias to use for the mode. - */ - void toggle_depth_bias(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable, - float in_depth_bias_constant_factor, - float in_depth_bias_clamp, - float in_depth_bias_slope_factor); - - /** Enables or disables the "depth bounds" test, updates related state values, and marks - * the pipeline as dirty. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_should_enable true to enable the test; false to disable it. - * @param in_min_depth_bounds Minimum boundary value to use for the test. - * @param in_max_depth_bounds Maximum boundary value to use for the test. - */ - void toggle_depth_bounds_test(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable, - float in_min_depth_bounds, - float in_max_depth_bounds); - - /** Enables or disables the "depth clamp" test, and marks the pipeline as dirty. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_should_enable true to enable the test; false to disable it. - */ - void toggle_depth_clamp(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable); - - /** Enables or disables the depth test, updates related state values, and marks the - * pipeline as dirty. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_should_enable true to enable the mode; false to disable it. - * @param in_compare_op Compare operation to use for the test. - */ - void toggle_depth_test(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable, - VkCompareOp in_compare_op); - - /** Enables or disables depth writes, and marks the pipeline as dirty. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_should_enable true to enable the writes; false to disable them. - */ - void toggle_depth_writes(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable); - - /** Enables or disables the specified dynamic states, and marks the pipeline as dirty. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_should_enable true to enable the dynamic state(s) specified by @param in_dynamic_state_bits, false - * disable them if already enabled. - * @param in_dynamic_state_bits An integer whose individual bits correspond to dynamic states which should either - * be enabled or disabled. - **/ - void toggle_dynamic_states (GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable, - DynamicStateBitfield in_dynamic_state_bits); - - /** Enables or disables logic ops, specifies which logic op should be used, and marks the pipeline as dirty. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_should_enable true to enable the mode; false to disable it. - * @param in_logic_op Logic operation type to use. - */ - void toggle_logic_op(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable, - VkLogicOp in_logic_op); - - /** Enables or disables the "primitive restart" mode, and marks the pipeline as dirty. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_should_enable true to enable the mode; false to disable it. - */ - void toggle_primitive_restart(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable); - - /** Enables or disables the "rasterizer discard" mode, and marks the pipeline as dirty. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_should_enable true to enable the test; false to disable it. - */ - void toggle_rasterizer_discard(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable); - - /** Enables or disables the sample mask, and marks the pipeline as dirty. - * - * Note: make sure to configure the sample mask using set_multisampling_properties() if you intend to use it. - * - * Note: disabling sample mask will make the manager set VkPipelineMultisampleStateCreateInfo::pSampleMask to a non-null - * value at pipeline creation time. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_should_enable true to enable sample mask; false to disable it. - */ - void toggle_sample_mask(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable); - - /** Enables or disables the "per-sample shading" mode, and marks the pipeline as dirty. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_should_enable true to enable the test; false to disable it. - */ - void toggle_sample_shading(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable); - - /** Enables or disables the stencil test test, and marks the pipeline as dirty. - * - * @param in_graphics_pipeline_id ID of the graphics pipeline to update. The ID must come from a preceding add_() - * call, issued against the same GraphicsPipelineManager instance. - * @param in_should_enable true to enable the test; false to disable it. - */ - void toggle_stencil_test(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable); - private: /* Private type declarations */ + typedef std::map AttributeLocationToBindingIndexMap; - /* Defines blending properties for a single subpass attachment. - * - * This descriptor is not exposed to the Vulkan implementation. It is used to form Vulkan-specific - * descriptors at baking time instead. - */ - typedef struct BlendingProperties - { - VkColorComponentFlagsVariable(channel_write_mask); - - bool blend_enabled; - VkBlendOp blend_op_alpha; - VkBlendOp blend_op_color; - VkBlendFactor dst_alpha_blend_factor; - VkBlendFactor dst_color_blend_factor; - VkBlendFactor src_alpha_blend_factor; - VkBlendFactor src_color_blend_factor; - - /** Constructor. */ - BlendingProperties() - { - blend_enabled = false; - blend_op_alpha = VK_BLEND_OP_ADD; - blend_op_color = VK_BLEND_OP_ADD; - channel_write_mask = VK_COLOR_COMPONENT_A_BIT | - VK_COLOR_COMPONENT_B_BIT | - VK_COLOR_COMPONENT_G_BIT | - VK_COLOR_COMPONENT_R_BIT; - dst_alpha_blend_factor = VK_BLEND_FACTOR_ONE; - dst_color_blend_factor = VK_BLEND_FACTOR_ONE; - src_alpha_blend_factor = VK_BLEND_FACTOR_ONE; - src_color_blend_factor = VK_BLEND_FACTOR_ONE; - } - - /** Forms a VkPipelineColorBlendAttachmentState instance from the stored state values. */ - VkPipelineColorBlendAttachmentState get_vk_descriptor() const - { - VkPipelineColorBlendAttachmentState result; - - result.alphaBlendOp = blend_op_alpha; - result.blendEnable = static_cast((blend_enabled) ? VK_TRUE : VK_FALSE); - result.colorBlendOp = blend_op_color; - result.colorWriteMask = channel_write_mask; - result.dstAlphaBlendFactor = dst_alpha_blend_factor; - result.dstColorBlendFactor = dst_color_blend_factor; - result.srcAlphaBlendFactor = src_alpha_blend_factor; - result.srcColorBlendFactor = src_color_blend_factor; - - return result; - } - - /** Comparison operator - * - * @param in Object to compare against. - * - * @return true if all states match, false otherwise. - **/ - bool operator==(const BlendingProperties& in) const - { - return (in.blend_enabled == blend_enabled && - in.blend_op_alpha == blend_op_alpha && - in.blend_op_color == blend_op_color && - in.channel_write_mask == channel_write_mask && - in.dst_alpha_blend_factor == dst_alpha_blend_factor && - in.dst_color_blend_factor == dst_color_blend_factor && - in.src_alpha_blend_factor == src_alpha_blend_factor && - in.src_color_blend_factor == src_color_blend_factor); - } - } BlendingProperties; - - typedef std::map SubPassAttachmentToBlendingPropertiesMap; - - typedef enum - { - GRAPHICS_SHADER_STAGE_FRAGMENT, - GRAPHICS_SHADER_STAGE_GEOMETRY, - GRAPHICS_SHADER_STAGE_TESSELLATION_CONTROL, - GRAPHICS_SHADER_STAGE_TESSELLATION_EVALUATION, - GRAPHICS_SHADER_STAGE_VERTEX, - - /* Always last */ - GRAPHICS_SHADER_STAGE_COUNT - } GraphicsShaderStage; - - /** Defines a single scissor box - * - * This descriptor is not exposed to the Vulkan implementation. It is used to form Vulkan-specific - * descriptors at baking time instead. - */ - struct InternalScissorBox - { - int32_t x; - int32_t y; - uint32_t width; - uint32_t height; - - /* Constructor. Should only be used by STL. */ - InternalScissorBox() - { - x = 0; - y = 0; - width = 32u; - height = 32u; - } - - /* Constructor - * - * @param in_x X offset of the scissor box - * @param in_y Y offset of the scissor box - * @param in_width Width of the scissor box - * @param in_height Height of the scissor box - **/ - InternalScissorBox(int32_t in_x, - int32_t in_y, - uint32_t in_width, - uint32_t in_height) - { - height = in_height; - width = in_width; - x = in_x; - y = in_y; - } - - /* Converts the internal descriptor to the Vulkan equivalent structure */ - VkRect2D get_vk_descriptor() const - { - VkRect2D result; - - result.extent.height = height; - result.extent.width = width; - result.offset.x = x; - result.offset.y = y; - - return result; - } - }; - - /** Defines a single viewport - * - * This descriptor is not exposed to the Vulkan implementation. It is used to form Vulkan-specific - * descriptors at baking time instead. - */ - typedef struct InternalViewport - { - float height; - float max_depth; - float min_depth; - float origin_x; - float origin_y; - float width; - - /* Constructor. Should only be used by STL */ - InternalViewport() - { - height = 32.0f; - max_depth = 1.0f; - min_depth = 0.0f; - origin_x = 0.0f; - origin_y = 0.0f; - width = 32.0f; - } - - /* Constructor. - * - * @param in_origin_x Origin X of the viewport. - * @param in_origin_y Origin Y of the viewport. - * @param in_width Width of the viewport. - * @param in_height Height of the viewport. - * @param in_min_depth Minimum depth value the viewport should use. - * @param in_max_depth Maximum depth value the viewport should use. - **/ - InternalViewport(float in_origin_x, - float in_origin_y, - float in_width, - float in_height, - float in_min_depth, - float in_max_depth) - { - height = in_height; - max_depth = in_max_depth; - min_depth = in_min_depth; - origin_x = in_origin_x; - origin_y = in_origin_y; - width = in_width; - } - - /* Returns a Vulkan viewport descriptor, using this object's properties. */ - VkViewport get_vk_descriptor() const - { - VkViewport result; - - result.height = height; - result.maxDepth = max_depth; - result.minDepth = min_depth; - result.x = origin_x; - result.y = origin_y; - result.width = width; - - return result; - } - } InternalViewport; - - /** A vertex attribute descriptor. This descriptor is not exposed to the Vulkan implementation. Instead, - * its members are used to create Vulkan input attribute & binding descriptors at baking time. - */ - typedef struct InternalVertexAttribute - { - uint32_t explicit_binding_index; - VkFormat format; - uint32_t location; - uint32_t offset_in_bytes; - VkVertexInputRate rate; - uint32_t stride_in_bytes; - - /** Dummy constructor. Should only be used by STL. */ - InternalVertexAttribute() - { - explicit_binding_index = UINT32_MAX; - format = VK_FORMAT_UNDEFINED; - location = UINT32_MAX; - offset_in_bytes = UINT32_MAX; - rate = VK_VERTEX_INPUT_RATE_MAX_ENUM; - stride_in_bytes = UINT32_MAX; - } - - /** Constructor. - * - * @param in_format Attribute format. - * @param in_location Attribute location. - * @param in_offset_in_bytes Start offset in bytes. - * @param in_rate Step rate. - * @param in_stride_in_bytes Stride in bytes. - **/ - InternalVertexAttribute(uint32_t in_explicit_binding_index, - VkFormat in_format, - uint32_t in_location, - uint32_t in_offset_in_bytes, - VkVertexInputRate in_rate, - uint32_t in_stride_in_bytes) - { - explicit_binding_index = in_explicit_binding_index; - format = in_format; - location = in_location; - offset_in_bytes = in_offset_in_bytes; - rate = in_rate; - stride_in_bytes = in_stride_in_bytes; - } - } InternalVertexAttribute; - - typedef std::map AttributeLocationToBindingIndexMap; - typedef std::map InternalScissorBoxes; - typedef std::vector InternalVertexAttributes; - typedef std::map InternalViewports; - - /** Descriptor which encapsulates all state of a single graphics pipeline. - * - * This descriptor is not exposed to the Vulkan implementation. It is used to form Vulkan-specific - * descriptors at baking time instead. - * - * A single unique graphics pipeline descriptor should be assigned to each subpass. - */ - struct GraphicsPipelineConfiguration + typedef struct GraphicsPipelineData { AttributeLocationToBindingIndexMap attribute_location_to_binding_index_map; + const Anvil::GraphicsPipelineInfo* pipeline_info_ptr; std::vector vk_input_attributes; std::vector vk_input_bindings; - bool depth_bounds_test_enabled; - float max_depth_bounds; - float min_depth_bounds; - - bool depth_bias_enabled; - float depth_bias_clamp; - float depth_bias_constant_factor; - float depth_bias_slope_factor; - - bool depth_test_enabled; - VkCompareOp depth_test_compare_op; - - DynamicStateBitfield enabled_dynamic_states; - - bool alpha_to_coverage_enabled; - bool alpha_to_one_enabled; - bool depth_clamp_enabled; - bool depth_writes_enabled; - bool logic_op_enabled; - bool primitive_restart_enabled; - bool rasterizer_discard_enabled; - bool sample_mask_enabled; - bool sample_shading_enabled; - - bool stencil_test_enabled; - VkStencilOpState stencil_state_back_face; - VkStencilOpState stencil_state_front_face; - - VkRasterizationOrderAMD rasterization_order; - - InternalVertexAttributes attributes; - float blend_constant[4]; - VkPolygonMode polygon_mode; - VkFrontFace front_face; - float line_width; - VkLogicOp logic_op; - float min_sample_shading; - uint32_t n_dynamic_scissor_boxes; - uint32_t n_dynamic_viewports; - uint32_t n_patch_control_points; - VkPrimitiveTopology primitive_topology; - VkSampleMask sample_mask; - InternalScissorBoxes scissor_boxes; - SubPassAttachmentToBlendingPropertiesMap subpass_attachment_blending_properties; - InternalViewports viewports; - - VkCullModeFlagsVariable (cull_mode); - VkSampleCountFlagsVariable(sample_count); - - PipelinePostBakeFunction post_bake_function; - PipelinePreBakeFunction pre_bake_function; - - std::shared_ptr renderpass_ptr; - SubPassID subpass_id; - - /** Constructor. - * - * @param in_renderpass_ptr RenderPass instance the graphics pipeline will be used for. - * The instance is retained. May be nullptr for proxy pipelines, - * must not be nullptr for all other pipeline types. - * @param in_subpass_id ID of the subpass the graphics pipeline descriptor is created - * for. - **/ - explicit GraphicsPipelineConfiguration(std::shared_ptr in_renderpass_ptr, - SubPassID in_subpass_id) + explicit GraphicsPipelineData(const Anvil::GraphicsPipelineInfo* in_pipeline_info_ptr) { - alpha_to_coverage_enabled = false; - alpha_to_one_enabled = false; - depth_bias_clamp = 0.0f; - depth_bias_constant_factor = 0.0f; - depth_bias_enabled = false; - depth_bias_slope_factor = 1.0f; - depth_bounds_test_enabled = false; - depth_clamp_enabled = false; - depth_test_compare_op = VK_COMPARE_OP_ALWAYS; - depth_test_enabled = false; - depth_writes_enabled = false; - enabled_dynamic_states = 0; - front_face = VK_FRONT_FACE_COUNTER_CLOCKWISE; - logic_op = VK_LOGIC_OP_NO_OP; - logic_op_enabled = false; - max_depth_bounds = 1.0f; - min_depth_bounds = 0.0f; - n_dynamic_scissor_boxes = 0; - n_dynamic_viewports = 0; - n_patch_control_points = 0; - primitive_restart_enabled = false; - rasterizer_discard_enabled = false; - sample_mask_enabled = false; - sample_shading_enabled = false; - stencil_test_enabled = false; - - renderpass_ptr = in_renderpass_ptr; - subpass_id = in_subpass_id; - - stencil_state_back_face.compareMask = ~0u; - stencil_state_back_face.compareOp = VK_COMPARE_OP_ALWAYS; - stencil_state_back_face.depthFailOp = VK_STENCIL_OP_KEEP; - stencil_state_back_face.failOp = VK_STENCIL_OP_KEEP; - stencil_state_back_face.passOp = VK_STENCIL_OP_KEEP; - stencil_state_back_face.reference = 0; - stencil_state_back_face.writeMask = ~0u; - stencil_state_front_face = stencil_state_back_face; - - rasterization_order = VK_RASTERIZATION_ORDER_STRICT_AMD; - - memset(blend_constant, - 0, - sizeof(blend_constant) ); + pipeline_info_ptr = in_pipeline_info_ptr; - cull_mode = VK_CULL_MODE_BACK_BIT; - line_width = 1.0f; - min_sample_shading = 1.0f; - sample_count = VK_SAMPLE_COUNT_1_BIT; - polygon_mode = VK_POLYGON_MODE_FILL; - primitive_topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; - sample_mask = ~0u; + bake_vk_attributes_and_bindings(); } - /** Constructor. Copies all state from the specified base pipeline configuration, replacing - * the renderpass instance & subpass ID with the argument values. - * - * @param in_base_pipeline_config_ptr As per description. Must not be nullptr. - * @param in_renderpass_ptr RenderPass instance the graphics pipeline will be used for. - * The instance is retained. May be nullptr for proxy pipelines. - * Must not be nullptr for all other pipeline types. - * @param in_subpass_id ID of the subpass the graphics pipeline descriptor is created - * for. - **/ - explicit GraphicsPipelineConfiguration(std::shared_ptr in_base_pipeline_config_ptr, - std::shared_ptr in_renderpass_ptr, - SubPassID in_subpass_id) - { - /* Copy all state from the base config.. */ - *this = *in_base_pipeline_config_ptr; - - /* Override the renderpass & the subpass with the data we've been provided */ - renderpass_ptr = in_renderpass_ptr; - subpass_id = in_subpass_id; - } - - /** Destructor. */ - ~GraphicsPipelineConfiguration() - { - /* Stub */ - } - - /** Copy assignment operator. */ - GraphicsPipelineConfiguration& operator=(const GraphicsPipelineConfiguration& in) - { - /* NOTE: We leave window, renderpass & subpass ID intact. */ - attribute_location_to_binding_index_map = in.attribute_location_to_binding_index_map; - vk_input_attributes = in.vk_input_attributes; - vk_input_bindings = in.vk_input_bindings; - - depth_bounds_test_enabled = in.depth_bounds_test_enabled; - max_depth_bounds = in.max_depth_bounds; - min_depth_bounds = in.min_depth_bounds; - - depth_bias_enabled = in.depth_bias_enabled; - depth_bias_clamp = in.depth_bias_clamp; - depth_bias_constant_factor = in.depth_bias_constant_factor; - depth_bias_slope_factor = in.depth_bias_slope_factor; - - depth_test_enabled = in.depth_test_enabled; - depth_test_compare_op = in.depth_test_compare_op; + private: + void bake_vk_attributes_and_bindings(); + } GraphicsPipelineData; - enabled_dynamic_states = in.enabled_dynamic_states; - - alpha_to_coverage_enabled = in.alpha_to_coverage_enabled; - alpha_to_one_enabled = in.alpha_to_one_enabled; - depth_clamp_enabled = in.depth_clamp_enabled; - depth_writes_enabled = in.depth_writes_enabled; - logic_op_enabled = in.logic_op_enabled; - primitive_restart_enabled = in.primitive_restart_enabled; - rasterizer_discard_enabled = in.rasterizer_discard_enabled; - sample_shading_enabled = in.sample_shading_enabled; - - stencil_test_enabled = in.stencil_test_enabled; - stencil_state_back_face = in.stencil_state_back_face; - stencil_state_front_face = in.stencil_state_front_face; - - rasterization_order = in.rasterization_order; - - attributes = in.attributes; - cull_mode = in.cull_mode; - front_face = in.front_face; - line_width = in.line_width; - logic_op = in.logic_op; - min_sample_shading = in.min_sample_shading; - n_dynamic_scissor_boxes = in.n_dynamic_scissor_boxes; - n_dynamic_viewports = in.n_dynamic_viewports; - n_patch_control_points = in.n_patch_control_points; - polygon_mode = in.polygon_mode; - primitive_topology = in.primitive_topology; - sample_count = in.sample_count; - sample_mask = in.sample_mask; - scissor_boxes = in.scissor_boxes; - subpass_attachment_blending_properties = in.subpass_attachment_blending_properties; - viewports = in.viewports; - - post_bake_function = in.post_bake_function; - pre_bake_function = in.pre_bake_function; - - memcpy(blend_constant, - in.blend_constant, - sizeof(blend_constant) ); - - return *this; - } - - }; - - typedef std::map > GraphicsPipelineConfigurations; + typedef std::map > GraphicsPipelineDataMap; /* Private functions */ explicit GraphicsPipelineManager(std::weak_ptr in_device_ptr, + bool in_mt_safe, bool in_use_pipeline_cache, std::shared_ptr in_pipeline_cache_to_reuse_ptr); - void bake_vk_attributes_and_bindings(std::shared_ptr inout_pipeline_config_ptr); - ANVIL_DISABLE_ASSIGNMENT_OPERATOR(GraphicsPipelineManager); ANVIL_DISABLE_COPY_CONSTRUCTOR (GraphicsPipelineManager); - /* Private members */ - GraphicsPipelineConfigurations m_pipeline_configurations; + /* Private variables */ + GraphicsPipelineDataMap m_pipeline_id_to_gfx_pipeline_data; }; }; /* Vulkan namespace */ diff --git a/include/wrappers/image.h b/include/wrappers/image.h index 11489911..15c6ac18 100644 --- a/include/wrappers/image.h +++ b/include/wrappers/image.h @@ -31,6 +31,7 @@ #include "misc/callbacks.h" #include "misc/debug_marker.h" +#include "misc/mt_safety.h" #include "misc/types.h" #include "misc/page_tracker.h" @@ -68,6 +69,7 @@ namespace Anvil /** A wrapper class for a VkImage and the bound VkMemory object. */ class Image : public CallbacksSupportProvider, public DebugMarkerSupportProvider, + public MTSafetySupportProvider, public std::enable_shared_from_this { public: @@ -158,7 +160,8 @@ namespace Anvil bool in_use_full_mipmap_chain, ImageCreateFlags in_flags, VkImageLayout in_post_create_image_layout, - const std::vector* in_opt_mipmaps_ptr); + const std::vector* in_opt_mipmaps_ptr, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Initializes a new non-sparse Image instance, along with a memory backing. * @@ -207,7 +210,8 @@ namespace Anvil MemoryFeatureFlags in_memory_features, ImageCreateFlags in_create_flags, VkImageLayout in_post_create_image_layout, - const std::vector* in_mipmaps_ptr); + const std::vector* in_opt_mipmaps_ptr, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Wrapper constructor for existing VkImage instances, as reported for * swapchain images. Object instantiated with this constructor will NOT @@ -219,7 +223,8 @@ namespace Anvil **/ static std::shared_ptr create_nonsparse(std::weak_ptr in_device_ptr, const VkSwapchainCreateInfoKHR& in_swapchain_create_info, - VkImage in_image); + VkImage in_image, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Initializes a new sparse Image instance *without* physical memory backing. Memory region(s) * should be bound to the object by calling Image::set_memory_block() before using the object @@ -270,7 +275,8 @@ namespace Anvil bool in_use_full_mipmap_chain, ImageCreateFlags in_create_flags, Anvil::SparseResidencyScope in_residency_scope, - VkImageLayout in_initial_layout = VK_IMAGE_LAYOUT_UNDEFINED); + VkImageLayout in_initial_layout = VK_IMAGE_LAYOUT_UNDEFINED, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destructor */ virtual ~Image(); @@ -382,6 +388,11 @@ namespace Anvil return static_cast(m_sample_count); } + SparseResidencyScope get_image_residency_scope() const + { + return m_residency_scope; + } + /** Returns image tiling */ VkImageTiling get_image_tiling() const { @@ -433,6 +444,12 @@ namespace Anvil return m_memory_reqs; } + /** Returns swapchain, from which the image has been created. */ + std::shared_ptr get_parent_swapchain() const + { + return m_swapchain_ptr; + } + /** Returns a structure filled with details required to correctly bind tiles to a sparse image. * * This function can only be called against sparse images with ALIASED or NONALIASED residency. @@ -654,6 +671,11 @@ namespace Anvil } AspectPageOccupancyData; /* Private functions */ + /** See corresponding create_nonsparse() function for specification */ + Image(std::weak_ptr in_device_ptr, + std::weak_ptr in_swapchain_ptr, + bool in_mt_safe); + /** See corresponding create_nonsparse() function for specification */ Image(std::weak_ptr in_device_ptr, VkImageType in_type, @@ -670,7 +692,8 @@ namespace Anvil ImageCreateFlags in_create_flags, Anvil::QueueFamilyBits in_queue_families, VkImageLayout in_post_create_image_layout, - const std::vector* in_opt_mipmaps_ptr); + const std::vector* in_opt_mipmaps_ptr, + bool in_mt_safe); /** See corresponding create_nonsparse() function for specification **/ Image(std::weak_ptr in_device_ptr, @@ -688,7 +711,8 @@ namespace Anvil bool in_use_full_mipmap_chain, ImageCreateFlags in_create_flags, VkImageLayout in_post_create_image_layout, - const std::vector* in_opt_mipmaps_ptr); + const std::vector* in_opt_mipmaps_ptr, + bool in_mt_safe); /** See corresponding create_nonsparse() function for specification **/ Image(std::weak_ptr in_device_ptr, @@ -705,7 +729,8 @@ namespace Anvil VkSampleCountFlagBits in_sample_count, uint32_t in_n_slices, Anvil::ImageCreateFlags in_create_flags, - Anvil::QueueFamilyBits in_queue_families); + Anvil::QueueFamilyBits in_queue_families, + bool in_mt_safe); /** See corresponding create_sparse() function for specification **/ Image(std::weak_ptr in_device_ptr, @@ -722,7 +747,8 @@ namespace Anvil VkSharingMode in_sharing_mode, bool in_use_full_mipmap_chain, ImageCreateFlags in_create_flags, - Anvil::SparseResidencyScope in_residency_scope); + Anvil::SparseResidencyScope in_residency_scope, + bool in_mt_safe); Image (const Image&); Image& operator=(const Image&); @@ -731,7 +757,7 @@ namespace Anvil MemoryFeatureFlags in_memory_features, const VkImageLayout* in_start_image_layout_ptr); void init_mipmap_props (); - void init_page_occupancy(const std::vector& memory_reqs); + void init_page_occupancy(const std::vector& in_memory_reqs); void on_memory_backing_update (const VkImageSubresource& in_subresource, VkOffset3D in_offset, @@ -743,16 +769,6 @@ namespace Anvil std::shared_ptr in_memory_block_ptr, VkDeviceSize in_memory_block_start_offset); - void set_memory_sparse(VkDeviceSize in_resource_offset, - VkDeviceSize in_size, - std::shared_ptr in_memory_block_ptr, - VkDeviceSize in_memory_block_start_offset); - void set_memory_sparse(const VkImageSubresource& in_subresource, - VkOffset3D in_offset, - VkExtent3D in_extent, - std::shared_ptr in_memory_block_ptr, - VkDeviceSize in_memory_block_start_offset); - void transition_to_post_create_image_layout(VkAccessFlags in_src_access_mask, VkImageLayout in_src_layout); @@ -793,6 +809,8 @@ namespace Anvil Anvil::SparseResidencyScope m_residency_scope; VkSharingMode m_sharing_mode; VkDeviceSize m_storage_size; + bool m_swapchain_memory_assigned; /* only used for images which can be bound swapchain memory */ + std::shared_ptr m_swapchain_ptr; /* only used for images which can be bound a swapchain */ VkImageTiling m_tiling; VkImageType m_type; bool m_uses_full_mipmap_chain; diff --git a/include/wrappers/image_view.h b/include/wrappers/image_view.h index ab6529bc..46011fb0 100644 --- a/include/wrappers/image_view.h +++ b/include/wrappers/image_view.h @@ -29,11 +29,13 @@ #define WRAPPERS_IMAGE_VIEW_H #include "misc/debug_marker.h" +#include "misc/mt_safety.h" #include "misc/types.h" namespace Anvil { - class ImageView : public DebugMarkerSupportProvider + class ImageView : public DebugMarkerSupportProvider, + public MTSafetySupportProvider { public: /* Public functions */ @@ -65,7 +67,8 @@ namespace Anvil VkComponentSwizzle in_swizzle_red, VkComponentSwizzle in_swizzle_green, VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha); + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Creates a single-sample 1D array image view wrapper instance. * @@ -96,7 +99,9 @@ namespace Anvil VkComponentSwizzle in_swizzle_red, VkComponentSwizzle in_swizzle_green, VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha); + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + /** Creates a single-sample or a multi-sample 2D image view wrapper instance. The view will be * single-sample if @param in_image_ptr uses 1 sample per texel, and multi-sample otherwise. @@ -126,7 +131,8 @@ namespace Anvil VkComponentSwizzle in_swizzle_red, VkComponentSwizzle in_swizzle_green, VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha); + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Creates a single-sample or a multi-sample 2D array image view wrapper instance. The view will be * single-sample if @param in_image_ptr uses 1 sample per texel, and multi-sample otherwise. @@ -158,7 +164,8 @@ namespace Anvil VkComponentSwizzle in_swizzle_red, VkComponentSwizzle in_swizzle_green, VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha); + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Creates a single-sample 3D image view wrapper instance. * @@ -189,7 +196,8 @@ namespace Anvil VkComponentSwizzle in_swizzle_red, VkComponentSwizzle in_swizzle_green, VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha); + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Creates a cube-map image view wrapper instance. * @@ -218,7 +226,8 @@ namespace Anvil VkComponentSwizzle in_swizzle_red, VkComponentSwizzle in_swizzle_green, VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha); + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Creates a cube-map array image view wrapper instance. * @@ -250,7 +259,8 @@ namespace Anvil VkComponentSwizzle in_swizzle_red, VkComponentSwizzle in_swizzle_green, VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha); + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destructor. Should only be called when the reference counter drops to zero. * @@ -333,7 +343,7 @@ namespace Anvil result.aspectMask = m_aspect_mask; result.baseArrayLayer = m_n_base_layer; result.baseMipLevel = m_n_base_mipmap_level; - result.layerCount = (m_type == VK_IMAGE_VIEW_TYPE_3D) ? m_n_slices : m_n_layers; + result.layerCount = m_n_layers; /* TODO: do NOT use m_n_slices here, subresource ranges never describe number of slices via .layerCount */ result.levelCount = m_n_mipmaps; return result; @@ -370,7 +380,8 @@ namespace Anvil ImageView& operator=(const ImageView&); ImageView(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_image_ptr); + std::shared_ptr in_parent_image_ptr, + bool in_mt_safe); bool init(VkImageViewType in_image_view_type, uint32_t in_n_base_layer, diff --git a/include/wrappers/instance.h b/include/wrappers/instance.h index 23768f1e..61e82a96 100644 --- a/include/wrappers/instance.h +++ b/include/wrappers/instance.h @@ -31,6 +31,7 @@ #ifndef WRAPPERS_INSTANCE_H #define WRAPPERS_INSTANCE_H +#include "misc/mt_safety.h" #include "misc/types.h" namespace Anvil @@ -41,7 +42,8 @@ namespace Anvil const char* in_layer_prefix, const char* in_message)> DebugCallbackFunction; - class Instance : public std::enable_shared_from_this + class Instance : public Anvil::MTSafetySupportProvider, + public std::enable_shared_from_this { public: /** Destructor */ @@ -62,17 +64,26 @@ namespace Anvil * destroyed correctly. * * - * @param in_app_name Name of the application, to be passed in VkCreateInstanceInfo - * structure. - * @param in_engine_name Name of the engine, to be passed in VkCreateInstanceInfo - * structure. - * @param in_opt_validation_callback_function If not nullptr, the specified function will be called whenever - * a call-back from any of the validation layers is received. - * Ignored otherwise. + * @param in_app_name Name of the application, to be passed in VkCreateInstanceInfo + * structure. + * @param in_engine_name Name of the engine, to be passed in VkCreateInstanceInfo + * structure. + * @param in_opt_validation_callback_function If not nullptr, the specified function will be called whenever + * a call-back from any of the validation layers is received. + * Ignored otherwise. + * @param in_mt_safe True if all instance-based operations where external host synchronization + * is required should be automatically synchronized by Anvil. + * @param in_opt_disallowed_instance_level_extensions Optional vector holding instance-level extension names that must NOT be + * requested at creation time. + * @param in_opt_enable_shader_module_cache True if all spawned shader modules should be cached throughout instance lifetime. + * False if they should be released as soon as all shared pointers go out of scope. **/ - static std::shared_ptr create(const std::string& in_app_name, - const std::string& in_engine_name, - DebugCallbackFunction in_opt_validation_callback_proc); + static std::shared_ptr create(const std::string& in_app_name, + const std::string& in_engine_name, + DebugCallbackFunction in_opt_validation_callback_proc, + bool in_mt_safe, + const std::vector& in_opt_disallowed_instance_level_extensions = std::vector(), + bool in_opt_enable_shader_module_cache = true); void destroy(); @@ -137,6 +148,12 @@ namespace Anvil return m_shader_module_cache_ptr; } + bool is_instance_extension_enabled(const char* in_extension_name) const; + bool is_instance_extension_enabled(const std::string& in_extension_name) const + { + return is_instance_extension_enabled(in_extension_name.c_str() ); + } + /** Tells whether the specified instance extension is supported. * * @param in_extension_name Name of the extension to use for the query. @@ -161,7 +178,8 @@ namespace Anvil /** Private constructor. Please use create() function instead. */ Instance(const std::string& in_app_name, const std::string& in_engine_name, - DebugCallbackFunction in_opt_validation_callback_function); + DebugCallbackFunction in_opt_validation_callback_function, + bool in_mt_safe); Instance& operator=(const Instance&); Instance (const Instance&); @@ -172,7 +190,8 @@ namespace Anvil void enumerate_instance_layers (); void enumerate_layer_extensions(Anvil::Layer* layer_ptr); void enumerate_physical_devices(); - void init (); + void init (const std::vector& in_disallowed_instance_level_extensions, + bool in_enable_shader_module_cache); void init_debug_callbacks (); void init_func_pointers (); diff --git a/include/wrappers/memory_block.h b/include/wrappers/memory_block.h index 2c1b385b..f2c3d4e5 100644 --- a/include/wrappers/memory_block.h +++ b/include/wrappers/memory_block.h @@ -36,6 +36,7 @@ #ifndef WRAPPERS_MEMORY_BLOCK_H #define WRAPPERS_MEMORY_BLOCK_H +#include "misc/mt_safety.h" #include "misc/types.h" @@ -45,22 +46,24 @@ namespace Anvil typedef std::function OnMemoryBlockReleaseCallbackFunction; /** Wrapper class for memory objects. Please see header for more details */ - class MemoryBlock : public std::enable_shared_from_this + class MemoryBlock : public MTSafetySupportProvider, + public std::enable_shared_from_this { public: /* Public functions */ /** Create and bind a new device memory object to the instantiated MemoryBlock object. * - * @param in_device_ptr Device to use. - * @param in_allowed_memory_bits Memory type bits which meet the allocation requirements. - * @param in_size Required allocation size. - * @param in_memory_features Required memory features. + * @param in_device_ptr Device to use. + * @param in_allowed_memory_bits Memory type bits which meet the allocation requirements. + * @param in_size Required allocation size. + * @param in_memory_features Required memory features. **/ static std::shared_ptr create(std::weak_ptr in_device_ptr, uint32_t in_allowed_memory_bits, VkDeviceSize in_size, - Anvil::MemoryFeatureFlags in_memory_features); + Anvil::MemoryFeatureFlags in_memory_features, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Create a memory block whose storage space is maintained by another MemoryBlock instance. * @@ -236,10 +239,11 @@ namespace Anvil bool init(); /** Please see create() for documentation */ - MemoryBlock(std::weak_ptr in_device_ptr, - uint32_t in_allowed_memory_bits, - VkDeviceSize in_size, - Anvil::MemoryFeatureFlags in_memory_features); + MemoryBlock(std::weak_ptr in_device_ptr, + uint32_t in_allowed_memory_bits, + VkDeviceSize in_size, + Anvil::MemoryFeatureFlags in_memory_features, + bool in_mt_safe); /** Please see create() for documentation */ MemoryBlock(std::shared_ptr in_parent_memory_block_ptr, @@ -247,14 +251,14 @@ namespace Anvil VkDeviceSize in_size); /** Please see create_derived_with_custom_delete_proc() for documentation */ - MemoryBlock(std::weak_ptr in_device_ptr, - VkDeviceMemory in_memory, - uint32_t in_allowed_memory_bits, - Anvil::MemoryFeatureFlags in_memory_features, - uint32_t in_memory_type_index, - VkDeviceSize in_size, - VkDeviceSize in_start_offset, - OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function); + MemoryBlock(std::weak_ptr in_device_ptr, + VkDeviceMemory in_memory, + uint32_t in_allowed_memory_bits, + Anvil::MemoryFeatureFlags in_memory_features, + uint32_t in_memory_type_index, + VkDeviceSize in_size, + VkDeviceSize in_start_offset, + OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function); MemoryBlock (const MemoryBlock&); MemoryBlock& operator=(const MemoryBlock&); diff --git a/include/wrappers/physical_device.h b/include/wrappers/physical_device.h index 9617e3d4..403ffd1e 100644 --- a/include/wrappers/physical_device.h +++ b/include/wrappers/physical_device.h @@ -308,11 +308,11 @@ namespace Anvil void unregister_device(std::shared_ptr in_device_ptr); /* Private variables */ - bool m_destroyed; - FormatProperties m_dummy; + bool m_destroyed; StorageFeatures16Bit m_16bit_storage_features; bool m_16bit_storage_features_available; + FormatProperties m_dummy; Anvil::Extensions m_extensions; uint32_t m_index; std::shared_ptr m_instance_ptr; diff --git a/include/wrappers/pipeline_cache.h b/include/wrappers/pipeline_cache.h index 68a4ecf5..a66ebd6e 100644 --- a/include/wrappers/pipeline_cache.h +++ b/include/wrappers/pipeline_cache.h @@ -32,12 +32,14 @@ #define WRAPPERS_PIPELINE_CACHE_H #include "misc/debug_marker.h" +#include "misc/mt_safety.h" #include "misc/types.h" namespace Anvil { - class PipelineCache : public DebugMarkerSupportProvider + class PipelineCache : public DebugMarkerSupportProvider, + public MTSafetySupportProvider { public: /* Public functions */ @@ -45,11 +47,14 @@ namespace Anvil /** Constructor. * * @param in_device_ptr Vulkan device to initialize the pipeline cache with. + * @param in_mt_safe True if MT-safety should be enforced for functions that operate on the + * underlying Vulkan handle. * @param in_initial_data_size Number of bytes available under @param in_initial_data. Can be 0. * @param in_initial_data Initial data to initialize the new pipeline cache instance with. * May be nullptr if @param in_initial_data_size is 0. **/ static std::shared_ptr create(std::weak_ptr in_device_ptr, + bool in_mt_safe, size_t in_initial_data_size = 0, const void* in_initial_data = nullptr); @@ -67,7 +72,10 @@ namespace Anvil bool get_data(size_t* out_n_data_bytes_ptr, const void** out_data_ptr); - /** Retrieves raw Vulkan pipeline cache handle */ + /** Retrieves raw Vulkan pipeline cache handle. + * + * NOTE: Clients must guarantee MT-safety when operating directly with the Vulkan handle. + */ const VkPipelineCache& get_pipeline_cache() const { return m_pipeline_cache; @@ -88,6 +96,7 @@ namespace Anvil /* Constructor. See create() for specification */ PipelineCache(std::weak_ptr in_device_ptr, + bool in_mt_safe, size_t in_initial_data_size, const void* in_initial_data); diff --git a/include/wrappers/pipeline_layout.h b/include/wrappers/pipeline_layout.h index 1a755248..c627165f 100644 --- a/include/wrappers/pipeline_layout.h +++ b/include/wrappers/pipeline_layout.h @@ -25,87 +25,35 @@ * - encapsulate all state related to a single ipeline layout. * - let ObjectTracker detect leaking pipeline layout wrapper instances. * - * The wrapper is NOT thread-safe. + * The wrapper is thread-safe on an opt-in basis. **/ #ifndef WRAPPERS_PIPELINE_LAYOUT_H #define WRAPPERS_PIPELINE_LAYOUT_H #include "misc/callbacks.h" #include "misc/debug_marker.h" +#include "misc/mt_safety.h" #include "misc/types.h" namespace Anvil { - /* Forward declarations */ - class DescriptorSetGroup; - typedef std::vector PushConstantRanges; /** Vulkan Pipeline Layout wrapper */ - class PipelineLayout : public DebugMarkerSupportProvider + class PipelineLayout : public DebugMarkerSupportProvider, + public MTSafetySupportProvider, + public std::enable_shared_from_this { public: /* Public functions */ - /** Initializes a new wrapper instance with no descriptor sets or push constant ranges - * defined. - * - * Layouts initialized with this constructor are mutable - dsgs and new PC ranges can - * be attached anytime. - * - * @param in_device_ptr Device the layout is being created for. Must not be nullptr. - */ - static std::shared_ptr create(std::weak_ptr in_device_ptr); - - /** Initializes a new wrapper instance with user-specified descriptor set groups (appended - * one after another, in the user-defined order) defined at creation time. - * - * This constructor can be used to initialize immutable pipeline layouts. If @param in_is_immutable - * is set to true, attach_dsg() and attach_push_constant_range() calls invoked for such object - * will result in a failure. - * - * @param in_device_ptr Device to use. Must not be nullptr. - * @param in_dsg_ptr Descriptor set group to use for the pipeline layout. - * @param in_push_constant_ranges Push constant ranges to define for the pipeline layout. - * @param in_is_immutable true if the wrapper instance should be made immutable; false otherwise. - * - **/ - static std::shared_ptr create(std::weak_ptr in_device_ptr, - std::shared_ptr in_dsg_ptr, - const PushConstantRanges& in_push_constant_ranges, - bool in_is_immutable); - /** Destructor. Releases all attached descriptor set groups, as well as * the Vulkan pipeline layout object. **/ virtual ~PipelineLayout(); - /** Appends a new push constant range to the list of push constant ranges that will be used - * when baking the layout object. - * - * This function will fail if the instance is defined as immutable. - * - * @param in_layout_id ID of the pipeline layout to perform the operation on. The ID must have - * been returned by a preceding create_layout() call. - * @param in_offset Start offset of the new range. - * @param in_size Size of the new range. - * - * @return true if the function succeeded, false otherwise. - **/ - bool attach_push_constant_range(uint32_t in_offset, - uint32_t in_size, - VkShaderStageFlags in_stages); - - /** Bakes a Vulkan VkPipelineLayout instance from the object. - * - * Bake requests for wrappers not marked as dirty will be ignored. - * - * @return true if successful, false otherwise. - **/ - bool bake(); - /** Retrieves a descriptor set group, as assigned to the pipeline layout. */ - std::shared_ptr get_attached_dsg() const + std::shared_ptr get_attached_dsg() const { return m_dsg_ptr; } @@ -116,12 +64,6 @@ namespace Anvil return m_push_constant_ranges; } - /** Returns unique ID assigned to the pipeline layout instance */ - PipelineLayoutID get_id() const - { - return m_id; - } - /** Retrieves a raw Vulkan pipeline layout handle. * * This getter will automatically invoke bake(), if the wrapper instance is marked as dirty. @@ -138,44 +80,50 @@ namespace Anvil return m_layout_vk; } - /** Assigns the specified Descriptor Set Group to the pipeline layout. - * - * This function will fail if the instance is defined as immutable. - * - * This function marks the pipeline layout as dirty, meaning it will be re-baked at - * the next get_() call. - * - * @param in_dsg_ptr Pointer to the DescriptorSetGroup instance to use for the operation. - * This object will be retained. - * - * @return true if the operation was successful, false otherwise. - **/ - bool set_dsg(std::shared_ptr in_dsg_ptr); - private: /* Private functions */ /* Constructor. Please see create() for specification */ - PipelineLayout(std::weak_ptr in_device_ptr); - - /* Constructor. Please see create() for specification */ - PipelineLayout(std::weak_ptr in_device_ptr, - std::shared_ptr in_dsg_ptr, - const PushConstantRanges& in_push_constant_ranges, - bool in_is_immutable); + PipelineLayout(std::weak_ptr in_device_ptr, + std::shared_ptr in_dsg_ptr, + const PushConstantRanges& in_push_constant_ranges, + bool in_mt_safe); PipelineLayout (const PipelineLayout&); PipelineLayout& operator=(const PipelineLayout&); + /** Bakes a Vulkan VkPipelineLayout instance from the object. + * + * @return true if successful, false otherwise. + **/ + bool bake(); + + /** Initializes a new wrapper instance with user-specified descriptor set groups (appended + * one after another, in the user-defined order) defined at creation time. + * + * This constructor can be used to initialize immutable pipeline layouts. If @param in_is_immutable + * is set to true, attach_dsg() and attach_push_constant_range() calls invoked for such object + * will result in a failure. + * + * @param in_device_ptr Device to use. Must not be nullptr. + * @param in_dsg_ptr Descriptor set group to use for the pipeline layout. + * @param in_push_constant_ranges Push constant ranges to define for the pipeline layout. + * + **/ + static std::shared_ptr create(std::weak_ptr in_device_ptr, + std::shared_ptr in_dsg_ptr, + const PushConstantRanges& in_push_constant_ranges, + bool in_mt_safe); + /* Private variables */ std::weak_ptr m_device_ptr; - bool m_is_immutable; - bool m_dirty; - std::shared_ptr m_dsg_ptr; - Anvil::PipelineLayoutID m_id; - VkPipelineLayout m_layout_vk; - PushConstantRanges m_push_constant_ranges; + bool m_dirty; + std::shared_ptr m_dsg_ptr; + VkPipelineLayout m_layout_vk; + PushConstantRanges m_push_constant_ranges; + + friend class PipelineLayoutManager; }; }; /* namespace Anvil */ diff --git a/include/wrappers/pipeline_layout_manager.h b/include/wrappers/pipeline_layout_manager.h index eb2f3e2e..248486b9 100644 --- a/include/wrappers/pipeline_layout_manager.h +++ b/include/wrappers/pipeline_layout_manager.h @@ -25,16 +25,18 @@ * - caches all pipeline layout wrappers and re-uses already instantiated wrappers, * if user-requested one is already available. * + * Opt-in MT-safety available. **/ #ifndef PIPELINE_LAYOUT_MANAGER_H #define PIPELINE_LAYOUT_MANAGER_H +#include "misc/mt_safety.h" #include "misc/types.h" #include namespace Anvil { - class PipelineLayoutManager + class PipelineLayoutManager : public MTSafetySupportProvider { public: /* Public functions */ @@ -57,32 +59,23 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool get_layout(std::shared_ptr in_dsg_ptr, - const PushConstantRanges& in_push_constant_ranges, - std::shared_ptr* out_pipeline_layout_ptr); - - /** Retrieves a PipelineLayout instance, assigned to the specific pipeline layout ID */ - std::shared_ptr get_layout_by_id(Anvil::PipelineLayoutID in_id) const; + bool get_layout(std::shared_ptr in_dsg_ptr, + const PushConstantRanges& in_push_constant_ranges, + std::shared_ptr* out_pipeline_layout_ptr); protected: /* Protected functions */ - /** Marks specified pipeline layout ID as used. - * - * NOTE: This function should only be used by PipelineLayout. - **/ - PipelineLayoutID reserve_pipeline_layout_id(); - private: /* Private type declarations */ /* NOTE: We do NOT own pipeline layouts. As soon as all wrapper instances are out of scope, - * we drop the ID. - */ - typedef std::map > PipelineLayouts; + * we drop the entry. */ + typedef std::vector PipelineLayouts; /* Private functions */ - PipelineLayoutManager(std::weak_ptr in_device_ptr); + PipelineLayoutManager(std::weak_ptr in_device_ptr, + bool in_mt_safe); PipelineLayoutManager (const PipelineLayoutManager&); PipelineLayoutManager& operator=(const PipelineLayoutManager&); @@ -92,21 +85,21 @@ namespace Anvil * NOTE: This function should only be used by Device. * * @param in_device_ptr Device to initialize the manager for. + * @param in_mt_safe Set to true if the instance should provide multi-threaded access safety. * * @return PipelineLayoutManager instance, or nullptr if the function failed. **/ - static std::shared_ptr create(std::weak_ptr in_device_ptr); + static std::shared_ptr create(std::weak_ptr in_device_ptr, + bool in_mt_safe); - void on_pipeline_layout_dropped(); - void update_subscriptions (bool in_should_init); + void on_pipeline_layout_dropped(CallbackArgument* in_callback_arg_raw_ptr); + void update_subscriptions (bool in_should_init); /* Private members */ std::weak_ptr m_device_ptr; PipelineLayouts m_pipeline_layouts; - Anvil::PipelineLayoutID m_pipeline_layouts_created; friend class BaseDevice; - friend class PipelineLayout; }; }; /* Vulkan namespace */ diff --git a/include/wrappers/query_pool.h b/include/wrappers/query_pool.h index 35c9ab4c..44ae55b4 100644 --- a/include/wrappers/query_pool.h +++ b/include/wrappers/query_pool.h @@ -24,6 +24,7 @@ #define WRAPPERS_QUERY_POOL_H #include "misc/debug_marker.h" +#include "misc/mt_safety.h" #include "misc/ref_counter.h" #include "misc/pools.h" #include "misc/types.h" @@ -32,7 +33,8 @@ namespace Anvil { /* Implements a query pool wrapper. */ - class QueryPool : public DebugMarkerSupportProvider + class QueryPool : public DebugMarkerSupportProvider, + public MTSafetySupportProvider { public: /* Public functions */ @@ -52,7 +54,8 @@ namespace Anvil **/ static std::shared_ptr create_non_ps_query_pool(std::weak_ptr in_device_ptr, VkQueryType in_query_type, - uint32_t in_n_max_concurrent_queries); + uint32_t in_n_max_concurrent_queries, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Creates a new pipeline statistics query pool. * @@ -66,7 +69,8 @@ namespace Anvil **/ static std::shared_ptr create_ps_query_pool(std::weak_ptr in_device_ptr, VkQueryPipelineStatisticFlags in_pipeline_statistics, - uint32_t in_n_max_concurrent_queries); + uint32_t in_n_max_concurrent_queries, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destructor */ virtual ~QueryPool(); @@ -88,13 +92,15 @@ namespace Anvil /* Constructor. Please see corresponding create() for specification */ explicit QueryPool(std::weak_ptr in_device_ptr, VkQueryType in_query_type, - uint32_t in_n_max_concurrent_queries); + uint32_t in_n_max_concurrent_queries, + bool in_mt_safe); /* Constructor. Please see corresponding create() for specification */ explicit QueryPool(std::weak_ptr in_device_ptr, VkQueryType in_query_type, VkFlags in_query_flags, - uint32_t in_n_max_concurrent_queries); + uint32_t in_n_max_concurrent_queries, + bool in_mt_safe); /** Initializes the Vulkan counterpart. * diff --git a/include/wrappers/queue.h b/include/wrappers/queue.h index 4e1d05dc..0a481178 100644 --- a/include/wrappers/queue.h +++ b/include/wrappers/queue.h @@ -33,6 +33,7 @@ #include "misc/callbacks.h" #include "misc/debug.h" #include "misc/debug_marker.h" +#include "misc/mt_safety.h" #include "misc/types.h" namespace Anvil @@ -41,7 +42,7 @@ namespace Anvil { /* Notification fired right after vkQueuePresentKHR() has been issued for a swapchain. * - * callback_arg: Pointer to PresentRequestIssuedCallbackArgument instance. + * callback_arg: Pointer to OnPresentRequestIssuedCallbackArgument instance. */ QUEUE_CALLBACK_ID_PRESENT_REQUEST_ISSUED, @@ -49,7 +50,8 @@ namespace Anvil } QueueCallbacKID; class Queue : public CallbacksSupportProvider, - public DebugMarkerSupportProvider + public DebugMarkerSupportProvider, + public MTSafetySupportProvider { public: /* Public functions */ @@ -63,10 +65,14 @@ namespace Anvil * @param in_device_ptr Device to retrieve the queue from. * @param in_queue_family_index Index of the queue family to retrieve the queue from. * @param in_queue_index Index of the queue to retrieve. + * @param in_mt_safe True if queue submissions should be protected by a mutex, guaranteeing + * no more than one thread at a time will ever submit a cmd buffer to the + * same cmd queue. **/ static std::shared_ptr create(std::weak_ptr in_device_ptr, uint32_t in_queue_family_index, - uint32_t in_queue_index); + uint32_t in_queue_index, + bool in_mt_safe); /** Destructor */ virtual ~Queue(); @@ -105,6 +111,7 @@ namespace Anvil * for the swapchain's rendering surface in order for this call to succeed. * * This function will only succeed if supports_presentation() returns true. + * This function will only succeed if used for a single-GPU device instance. * * NOTE: If you are presenting to an off-screen window, make sure to transition * the image to VK_IMAGE_LAYOUT_GENERAL, instead of VK_IMAGE_LAYOUT_PRESENT_SRC_KHR. @@ -135,7 +142,7 @@ namespace Anvil * If @param in_should_block is true and @param in_opt_fence_ptr is nullptr, the function will create * a new fence, wait on it, and then release it prior to leaving. This may come at a performance cost. * - * @param in_n_command_buffers Number of command buffers under @param opt_cmd_buffer_ptrs + * @param in_n_command_buffers Number of command buffers under @param in_opt_cmd_buffer_ptrs * which should be executed. May be 0. * @param in_opt_cmd_buffer_ptrs Array of command buffers to execute. Can be nullptr if * @param n_command_buffers is 0. @@ -146,15 +153,15 @@ namespace Anvil * @param in_n_semaphores_to_wait_on Number of semaphores to wait on before executing command buffers. * May be 0. * @param in_opt_semaphore_to_wait_on_ptr_ptrs Array of semaphores to wait on prior to execution. May be nullptr - * if @param n_semaphores_to_wait_on is 0. - * @param in_opt_dst_stage_masks_to_wait_on_ptrs Array of size @param n_semaphores_to_wait_on, specifying stages + * if @param in_n_semaphores_to_wait_on is 0. + * @param in_opt_dst_stage_masks_to_wait_on_ptrs Array of size @param in_n_semaphores_to_wait_on, specifying stages * at which the wait ops should be performed. May be nullptr if * @param n_semaphores_to_wait_on is 0. * @param in_should_block true if the function should wait for the scheduled commands to * finish executing, false otherwise. * @param in_opt_fence_ptr Fence to use when submitting the comamnd buffers to the queue. - * The fence will be waited on if @param should_block is true. - * If @param should_block is false, the fence will be passed at + * The fence will be waited on if @param in_should_block is true. + * If @param in_should_block is false, the fence will be passed at * submit call time, but will not be waited on. **/ void submit_command_buffers(uint32_t in_n_command_buffers, @@ -270,11 +277,34 @@ namespace Anvil private: /* Private functions */ + VkResult present_internal (uint32_t in_n_swapchains, + const std::shared_ptr* in_swapchains, + const uint32_t* in_swapchain_image_indices, + const uint32_t* in_device_masks, + uint32_t in_n_wait_semaphores, + std::shared_ptr* in_wait_semaphore_ptrs); + void present_lock_unlock(uint32_t in_n_swapchains, + const std::shared_ptr* in_swapchains, + uint32_t in_n_wait_semaphores, + std::shared_ptr* in_wait_semaphore_ptrs, + bool in_should_lock); + + void bind_sparse_memory_lock_unlock (Anvil::Utils::SparseMemoryBindingUpdateInfo& in_update, + bool in_should_lock); + void submit_command_buffers_lock_unlock(uint32_t in_n_command_buffers, + std::shared_ptr const* in_opt_cmd_buffer_ptrs, + uint32_t in_n_semaphores_to_signal, + std::shared_ptr const* in_opt_semaphore_to_signal_ptr_ptrs, + uint32_t in_n_semaphores_to_wait_on, + std::shared_ptr const* in_opt_semaphore_to_wait_on_ptr_ptrs, + std::shared_ptr in_opt_fence_ptr, + bool in_should_lock); /* Constructor. Please see create() for specification */ Queue(std::weak_ptr in_device_ptr, uint32_t in_queue_family_index, - uint32_t in_queue_index); + uint32_t in_queue_index, + bool in_mt_safe); Queue (const Queue&); Queue operator=(const Queue&); diff --git a/include/wrappers/render_pass.h b/include/wrappers/render_pass.h index 13be594c..c225b525 100644 --- a/include/wrappers/render_pass.h +++ b/include/wrappers/render_pass.h @@ -20,37 +20,17 @@ // THE SOFTWARE. // -/** Defines a render pass wrapper class which simplifies the following processes: - * - * - Attachment configuration & management - * - Life-time management - * - Render pass initialization and tear-down. - * - Subpass configuration & management - * - Support for adding new renderpass/subpass attachments or subpasses with automatic Vulkan FB object re-creation. - **/ #ifndef WRAPPERS_RENDER_PASS_H #define WRAPPERS_RENDER_PASS_H #include "misc/callbacks.h" #include "misc/debug_marker.h" +#include "misc/mt_safety.h" #include "misc/types.h" namespace Anvil { - enum RenderPassCallbackID - { - /* Call-back issued whenever the originating renderpass becomes dirty - * - * callback_arg: Pointer to OnRenderPassBakeNeededCallbackArgument instance. - */ - RENDER_PASS_CALLBACK_ID_BAKING_NEEDED, - - /* Always last */ - RENDER_PASS_CALLBACK_ID_COUNT - }; - - class RenderPass : public CallbacksSupportProvider, - public DebugMarkerSupportProvider, + class RenderPass : public DebugMarkerSupportProvider, public std::enable_shared_from_this { public: @@ -66,13 +46,13 @@ namespace Anvil * throw a NPE if it ever needs to deduce the window size. * * - * @param in_device_ptr Device which will consume the renderpass. Must not be nullptr. - * @param in_opt_swapchain_ptr Swapchain, that the render-pass will render to. See brief for more information. - * May be nullptr. + * @param in_renderpass_info_ptr TODO + * @param in_opt_swapchain_ptr Swapchain, that the render-pass will render to. See brief for more information. + * May be nullptr. * **/ - static std::shared_ptr create(std::weak_ptr in_device_ptr, - std::shared_ptr in_opt_swapchain_ptr); + static std::shared_ptr create(std::unique_ptr in_renderpass_info_ptr, + std::shared_ptr in_opt_swapchain_ptr); /** Destructor. * @@ -80,812 +60,43 @@ namespace Anvil **/ virtual ~RenderPass(); - /** Adds a new render-pass color attachment to the internal data model. - * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. - * - * @param in_format Image format to use for the color attachment. - * @param in_sample_count Number of samples to use for the color attachment (expressed as enum value). - * @param in_load_op Load operation to use for the color attachment. - * @param in_store_op Store operation to use for the color attachment. - * @param in_initial_layout Initial layout to use for the color attachment. - * @param in_final_layout Final layout to use for the color attachment. - * @param in_may_alias true if the memory backing of the image that will be attached may - * overlap with the backing of another attachment within the same - * subpass. - * @param out_attachment_id_ptr Deref will be set to a unique ID assigned to the new color attachment. - * Must not be nullptr. - * - * @return true if the function executed successfully, false otherwise. - **/ - bool add_color_attachment(VkFormat in_format, - VkSampleCountFlags in_sample_count, - VkAttachmentLoadOp in_load_op, - VkAttachmentStoreOp in_store_op, - VkImageLayout in_initial_layout, - VkImageLayout in_final_layout, - bool in_may_alias, - RenderPassAttachmentID* out_attachment_id_ptr); - - /** Adds a new render-pass depth/stencil attachment to the internal data model. - * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. - * - * @param in_format Image format to use for the color attachment. - * @param in_sample_count Number of samples to use for the depth-stencil attachment (expressed as enum value). - * @param in_depth_load_op Load operation to use for the depth data. - * @param in_depth_store_op Store operation to use for the depth data. - * @param in_stencil_load_op Load operation to use for the stencil data. - * @param in_stencil_store_op Store operation to use for the stencil data. - * @param in_initial_layout Initial layout to use for the color attachment. - * @param in_final_layout Final layout to use for the color attachment. - * @param in_may_alias true if the memory backing of the image that will be attached may - * overlap with the backing of another attachment within the same - * subpass. - * @param out_attachment_id_ptr Deref will be set to a unique ID assigned to the new color attachment. - * Must not be nullptr. - * - * @return true if the function executed successfully, false otherwise. - **/ - bool add_depth_stencil_attachment(VkFormat in_format, - VkSampleCountFlags in_sample_count, - VkAttachmentLoadOp in_depth_load_op, - VkAttachmentStoreOp in_depth_store_op, - VkAttachmentLoadOp in_stencil_load_op, - VkAttachmentStoreOp in_stencil_store_op, - VkImageLayout in_initial_layout, - VkImageLayout in_final_layout, - bool in_may_alias, - RenderPassAttachmentID* out_attachment_id_ptr); - - /** Adds a new subpass to the internal data model. - * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. - * - * @param in_fragment_shader_entrypoint Shader module stage entrypoint descriptor for the fragment stage. - * Please pass an instance created by a dummy constructor if the stage - * is irrelevant. - * @param in_geometry_shader_entrypoint Shader module stage entrypoint descriptor for the geometry stage. - * Please pass an instance created by a dummy constructor if the stage - * is irrelevant. - * @param in_tess_control_shader_entrypoint Shader module stage entrypoint descriptor for the tessellation control stage. - * Please pass an instance created by a dummy constructor if the stage - * is irrelevant. - * @param in_tess_evaluation_shader_entrypoint Shader module stage entrypoint descriptor for the tessellation - * evaluation stage. Please pass an instance created by a dummy constructor - * if the stage is irrelevant. - * @param in_vertex_shader_entrypoint Shader module stage entrypoint descriptor for the vertex stage. - * Must NOT be a dummy instance. - * @param out_subpass_id_ptr Deref will be set to a unique ID of the created subpass. - * Must not be nullptr. - * @param in_opt_pipeline_id (optional) ID of a graphics pipeline to use for the graphics pipeline. - * If not specified, a new pipeline wil be created from scratch. - * - * @return true if the function executed successfully, false otherwise. - **/ - bool add_subpass(const ShaderModuleStageEntryPoint& in_fragment_shader_entrypoint, - const ShaderModuleStageEntryPoint& in_geometry_shader_entrypoint, - const ShaderModuleStageEntryPoint& in_tess_control_shader_entrypoint, - const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_entrypoint, - const ShaderModuleStageEntryPoint& in_vertex_shader_entrypoint, - SubPassID* out_subpass_id_ptr, - const Anvil::PipelineID in_opt_pipeline_id = UINT32_MAX); - - /** Adds a new color attachment to the RenderPass instance's specified subpass. - * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. - * - * @param in_subpass_id ID of the render-pass subpass to update. - * @param in_layout Layout to use for the attachment when executing the subpass. - * Driver takes care of transforming the attachment to the requested layout - * before subpass commands starts executing. - * @param in_attachment_id ID of the render-pass attachment the new sub-pass color attachment - * should refer to. - * @param in_location Location, under which the specified attachment should be accessible to - * the fragment shader. - * @param in_attachment_resolve_id_ptr Must be nullptr if the new color attachment should be single-sample. - * For multi-sample, this argument can optionally point to a render-pass - * attachment descriptor, to which the MS attachment should be resolved to. - * - * @return true if the function executed successfully, false otherwise. - **/ - bool add_subpass_color_attachment(SubPassID in_subpass_id, - VkImageLayout in_layout, - RenderPassAttachmentID in_attachment_id, - uint32_t in_location, - const RenderPassAttachmentID* in_opt_attachment_resolve_id_ptr); - - /** Configures the depth+stencil attachment the subpass should use. - * - * Note that only up to one depth/stencil attachment may be added for each subpass. - * Any attempt to add more such attachments will results in an assertion failure. - * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. - * - * @param in_subpass_id ID of the subpass to update the depth+stencil attachment for. - * The subpass must have been earlier created with an add_subpass() call. - * @param in_attachment_id ID of the render-pass attachment the depth-stencil attachment should refer to. - * @param in_layout Layout to use for the attachment when executing the subpass. - * Driver takes care of transforming the attachment to the requested layout - * before subpass commands starts executing. - * - * @return true if the function executed successfully, false otherwise. - * - */ - bool add_subpass_depth_stencil_attachment(SubPassID in_subpass_id, - RenderPassAttachmentID in_attachment_id, - VkImageLayout in_layout); - - /** Adds a new input attachment to the RenderPass instance's specified subpass. - * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. - * - * @param in_subpass_id ID of the render-pass subpass to update. - * @param in_layout Layout to use for the attachment when executing the subpass. - * Driver takes care of transforming the attachment to the requested layout - * before subpass commands starts executing. - * @param in_attachment_id ID of the render-pass attachment the new sub-pass input attachment - * should refer to. - * @param in_attachment_index The "input attachment index", under which the specified attachment should - * be accessible to the fragment shader. Do not forget the image view also - * needs to be bound to the descriptor set for the input attachment to work! - * - * @return true if the function executed successfully, false otherwise. - **/ - bool add_subpass_input_attachment(SubPassID in_subpass_id, - VkImageLayout in_layout, - RenderPassAttachmentID in_attachment_id, - uint32_t in_attachment_index); - - /** Adds a new external->subpass dependency to the internal data model. - * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. - * - * @param in_destination_subpass_id ID of the destination subpass. The subpass must have been - * created earlier with an add_subpass() call. - * @param in_source_stage_mask Source pipeline stage mask. - * @param in_destination_stage_mask Destination pipeline stage mask. - * @param in_source_access_mask Source access mask. - * @param in_destination_access_mask Destination access mask. - * @param in_by_region true if a "by-region" dependency is requested; false otherwise. - * - * @return true if the dependency was added successfully; false otherwise. - * - **/ - bool add_external_to_subpass_dependency(SubPassID in_destination_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region); - - /** Adds a new self-subpass dependency to the internal data model. - * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. - * - * @param in_destination_subpass_id ID of the subpass to create the dep for. The subpass must have been - * created earlier with an add_subpass() call. - * @param in_source_stage_mask Source pipeline stage mask. - * @param in_destination_stage_mask Destination pipeline stage mask. - * @param in_source_access_mask Source access mask. - * @param in_destination_access_mask Destination access mask. - * @param in_by_region true if a "by-region" dependency is requested; false otherwise. - * - * @return true if the dependency was added successfully; false otherwise. - * - **/ - bool add_self_subpass_dependency(SubPassID in_destination_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region); - - /** Adds a new subpass->external dependency to the internal data model. - * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. - * - * @param in_source_subpass_id ID of the source subpass. The subpass must have been - * created earlier with an add_subpass() call. - * @param in_source_stage_mask Source pipeline stage mask. - * @param in_destination_stage_mask Destination pipeline stage mask. - * @param in_source_access_mask Source access mask. - * @param in_destination_access_mask Destination access mask. - * @param in_by_region true if a "by-region" dependency is requested; false otherwise. - * - * @return true if the dependency was added successfully; false otherwise. - **/ - bool add_subpass_to_external_dependency(SubPassID in_source_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region); - - /** Adds a new subpass->subpass dependency to the internal data model. - * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. - * - * @param in_source_subpass_id ID of the source subpass. The subpass must have been - * created earlier with an add_subpass() call. - * @param in_destination_subpass_id ID of the source subpass. The subpass must have been - * created earlier with an add_subpass() call. - * @param in_source_stage_mask Source pipeline stage mask. - * @param in_destination_stage_mask Destination pipeline stage mask. - * @param in_source_access_mask Source access mask. - * @param in_destination_access_mask Destination access mask. - * @param in_by_region true if a "by-region" dependency is requested; false otherwise. - * - * @return true if the dependency was added successfully; false otherwise. - **/ - bool add_subpass_to_subpass_dependency(SubPassID in_source_subpass_id, - SubPassID in_destination_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region); - - /** Re-creates the internal VkRenderPass object. - * - * This function should be considered expensive. - * - * @return true if successful, false otherwise. - **/ - bool bake(); - - /** Tells what type an attachment with user-specified ID has. - * - * @return true if successful, false otherwise - */ - bool get_attachment_type(RenderPassAttachmentID in_attachment_id, - AttachmentType* out_attachment_type_ptr) const; - - /** Retrieves properties of the render pass color attachment with the user-specified ID - * - * @param in_attachment_id ID of the attachment to retrieve properties of. - * @param out_opt_sample_count_ptr If not nullptr, deref will be set to the sample count, specified - * at attachment creation time. May be nullptr. - * @param out_opt_load_op_ptr If not nullptr, deref will be set to the load op, specified at - * attachment creation time. May be nullptr. - * @param out_opt_store_op_ptr If not nullptr, deref will be set to the store op, specified at - * attachment creation time. May be nullptr. - * @param out_opt_initial_layout_ptr If not nullptr, deref will be set to the initial layout, specified - * at attachment creation time. May be nullptr. - * @param out_opt_final_layout_ptr If not nullptr, deref will be set to the final layout, specified at - * attachment creation time. May be nullptr. - * @param out_opt_may_alias_ptr If not nullptr, deref will be set to set to true, if the attachment - * can alias other attachments. Otherwise, it will be set to false. - * May be nullptr. - * - * @return true if successful, false otherwise. - **/ - bool get_color_attachment_properties(RenderPassAttachmentID in_attachment_id, - VkSampleCountFlagBits* out_opt_sample_count_ptr = nullptr, - VkAttachmentLoadOp* out_opt_load_op_ptr = nullptr, - VkAttachmentStoreOp* out_opt_store_op_ptr = nullptr, - VkImageLayout* out_opt_initial_layout_ptr = nullptr, - VkImageLayout* out_opt_final_layout_ptr = nullptr, - bool* out_opt_may_alias_ptr = nullptr) const; - - /** Retrieves properties of a dependency at user-specified index. - * - * @param in_n_dependency Index of the dependency to retrieve properties of. - * @param out_destination_subpass_id_ptr Deref will be set to the ID of the dependency's destination, - * or to UINT32_MAX, if the destination of the dependency is external. - * Must not be null. - * @param out_source_subpass_id_ptr Deref will be set to the ID of the dependency's source, - * or to UINT32_MAX, if the source of the dependency is external. - * Must not be null. - * @param out_destination_stage_mask_ptr Deref will be set to the destination stage mask set for the dependency. - * Must not be null. - * @param out_source_stage_mask_ptr Deref will be set to the source stage mask set for the dependency. - * Must not be null. - * @param out_destination_access_mask_ptr Deref will be set to the destination access mask set for the dependency. - * Must not be null. - * @param out_source_access_mask_ptr Deref will be set to the source access mask set for the dependency. - * Must not be null. - * @param out_by_region_ptr Deref will be set to true, if the dependency is a by-region dependency. - * If it is not, deref will be set to false. Must not be null. - * - * @return true if successful, false otherwise - */ - bool get_dependency_properties(uint32_t in_n_dependency, - SubPassID* out_destination_subpass_id_ptr, - SubPassID* out_source_subpass_id_ptr, - VkPipelineStageFlags* out_destination_stage_mask_ptr, - VkPipelineStageFlags* out_source_stage_mask_ptr, - VkAccessFlags* out_destination_access_mask_ptr, - VkAccessFlags* out_source_access_mask_ptr, - bool* out_by_region_ptr) const; - - /** Retrieves properties of the render pass color attachment with the user-specified ID - * - * @param in_attachment_id ID of the attachment to retrieve properties of. - * @param out_opt_depth_load_op_ptr If not nullptr, deref will be set to the depth-specific load op, specified at - * attachment creation time. May be nullptr. - * @param out_opt_depth_store_op_ptr If not nullptr, deref will be set to the depth-specific store op, specified at - * attachment creation time. May be nullptr. - * @param out_opt_stencil_load_op_ptr If not nullptr, deref will be set to the stencil-specific load op, specified at - * attachment creation time. May be nullptr. - * @param out_opt_stencil_store_op_ptr If not nullptr, deref will be set to the stencil-specific store op, specified at - * attachment creation time. May be nullptr. - * @param out_opt_initial_layout_ptr If not nullptr, deref will be set to the initial layout, specified - * at attachment creation time. May be nullptr. - * @param out_opt_final_layout_ptr If not nullptr, deref will be set to the final layout, specified at - * attachment creation time. May be nullptr. - * @param out_opt_may_alias_ptr If not nullptr, deref will be set to set to true, if the attachment - * can alias other attachments. Otherwise, it will be set to false. - * May be nullptr. - * - * @return true if successful, false otherwise. - **/ - bool get_depth_stencil_attachment_properties(RenderPassAttachmentID in_attachment_id, - VkAttachmentLoadOp* out_opt_depth_load_op_ptr = nullptr, - VkAttachmentStoreOp* out_opt_depth_store_op_ptr = nullptr, - VkAttachmentLoadOp* out_opt_stencil_load_op_ptr = nullptr, - VkAttachmentStoreOp* out_opt_stencil_store_op_ptr = nullptr, - VkImageLayout* out_opt_initial_layout_ptr = nullptr, - VkImageLayout* out_opt_final_layout_ptr = nullptr, - bool* out_opt_may_alias_ptr = nullptr) const; - - /** Returns the number of added attachments */ - uint32_t get_n_attachments() const + + VkRenderPass get_render_pass() const { - return static_cast(m_attachments.size() ); - } + anvil_assert(m_render_pass != VK_NULL_HANDLE); - /** Returns the number of added dependencies */ - uint32_t get_n_dependencies() const - { - return static_cast(m_subpass_dependencies.size() ); + return m_render_pass; } - /** Returns the number of added subpasses */ - uint32_t get_n_subpasses() const + Anvil::RenderPassInfo* get_render_pass_info() const { - return static_cast(m_subpasses.size() ); + return m_render_pass_info_ptr.get(); } - /** Bakes the VkRenderPass object if the RenderPass instance is marked as dirty, and returns it. - * - * @return The requested object. - **/ - VkRenderPass get_render_pass(bool allow_rebaking = true); - - /** Retrieves subpass attachment properties, as specified at creation time. - * - * Triggers baking process if the renderpass is marked as dirty. - * - * @param in_subpass_id ID of the subpass to use for the query. - * @param in_attachment_type Type of the attachment to use for the query. Must not be ATTACHMENT_TYPE_PRESERVE. - * @param out_renderpass_attachment_id_ptr Deref will be set to the ID of the renderpass attachment this subpass - * attachment uses. - * @param out_layout_ptr Deref will be set to the image layout assigned to the attachment for the specific - * subpass. Must be NULL if @param in_attachment_type is ATTACHMENT_TYPE_PRESERVE. - * - * @return true if successful, false otherwise. - */ - bool get_subpass_attachment_properties(SubPassID in_subpass_id, - AttachmentType in_attachment_type, - uint32_t in_n_subpass_attachment, - RenderPassAttachmentID* out_renderpass_attachment_id_ptr, - VkImageLayout* out_layout_ptr); - - /** Returns the graphics pipeline ID, associated with the specified subpass. - * - * @param in_subpass_id As per description. - * @param out_graphics_pipeline_id_ptr Deref will be set to the aforementioned ID. Must not be nullptr. - * Will only be touched if the function returns true. - * - * @return true if the function was successful, false otherwise. - **/ - bool get_subpass_graphics_pipeline_id(SubPassID in_subpass_id, - GraphicsPipelineID* out_graphics_pipeline_id_ptr) const; - - /** Returns the number of attachments of user-specified type, defined for the specified subpass. - * - * This function may trigger renderpass bake process, if the renderpass is marked as dirty - * at the query time, and @param in_attachment_type is set to ATTACHMENT_TYPE_PRESERVE. - * - * @param in_subpass_id As per description. - * @param in_attachment_type Type of the attachment to use for the query. - * @param out_n_attachments_ptr Deref will be set to the value above. Must not be nullptr. - * Will only be touched if the function returns true. - * - * @return true if the function was successful, false otherwise. - **/ - bool get_subpass_n_attachments(SubPassID in_subpass_id, - AttachmentType in_attachment_type, - uint32_t* out_n_attachments_ptr); - /** Returns the Swapchain instance, associated with the RenderPass wrapper instance at creation time. */ std::shared_ptr get_swapchain() const { return m_swapchain_ptr; } - /* Releases the graphics pipeline, as used by the specified subpass at the time of the call, - * and assigns the user-specified one. - * - * @param in_subpass_id ID of the subpass, whose graphics pipeline should be changed. - * @param in_new_graphics_pipeline_id ID of the graphics pipeline to start using. - * - * @return true if successful, false otherwise. - **/ - bool set_subpass_graphics_pipeline_id(SubPassID in_subpass_id, - GraphicsPipelineID in_new_graphics_pipeline_id); - private: /* Private type definitions */ - /** Holds properties of a single render-pass attachment. **/ - typedef struct RenderPassAttachment - { - VkAttachmentLoadOp color_depth_load_op; - VkAttachmentStoreOp color_depth_store_op; - VkImageLayout final_layout; - VkFormat format; - uint32_t index; - VkImageLayout initial_layout; - bool may_alias; - VkAttachmentLoadOp stencil_load_op; - VkAttachmentStoreOp stencil_store_op; - AttachmentType type; - - VkSampleCountFlagsVariable(sample_count); - - /** Constructor. Should only be used for color attachments. - * - * @param in_format Format that will be used by the render-pass attachment. - * @param in_sample_count Number of samples of the render-pass attachment (expressed as enum value) - * @param in_load_op Load operation to use for the render-pass attachment. - * @param in_store_op Store operation to use for the render-pass attachment. - * @param in_initial_layout Initial layout fo the render-pass attachment. - * @param in_final_layout Layout to transfer the render-pass attachment to, after - * the render-pass finishes. - * @param in_may_alias true if the attachment's memory backing may alias with - * memory region of another attachment; false otherwise. - * @param in_index Index of the created render-pass attachment. - ***/ - RenderPassAttachment(VkFormat in_format, - VkSampleCountFlags in_sample_count, - VkAttachmentLoadOp in_load_op, - VkAttachmentStoreOp in_store_op, - VkImageLayout in_initial_layout, - VkImageLayout in_final_layout, - bool in_may_alias, - uint32_t in_index) - { - color_depth_load_op = in_load_op; - color_depth_store_op = in_store_op; - final_layout = in_final_layout; - format = in_format; - index = in_index; - initial_layout = in_initial_layout; - may_alias = in_may_alias; - sample_count = in_sample_count; - stencil_load_op = VK_ATTACHMENT_LOAD_OP_DONT_CARE; - stencil_store_op = VK_ATTACHMENT_STORE_OP_DONT_CARE; - type = ATTACHMENT_TYPE_COLOR; - } - - /** Constructor. Should only be used for depth/stencil attachments - * - * @param in_format Format that will be used by the render-pass attachment. - * @param in_sample_count Number of samples of the render-pass attachment (expressed as enum value) - * @param in_depth_load_op Load operation to use for the render-pass attachment's depth data. - * @param in_depth_store_op Store operation to use for the render-pass attachment's depth data. - * @param in_stencil_load_op Load operation to use for the render-pass attachment's stencil data. - * @param in_stencil_store_op Store operation to use for the render-pass attachment's stencil data. - * @param in_initial_layout Initial layout fo the render-pass attachment. - * @param in_final_layout Layout to transfer the render-pass attachment to, after - * the render-pass finishes. - * @param in_may_alias true if the attachment's memory backing may alias with - * memory region of another attachment; false otherwise. - * @param in_index Index of the created render-pass attachment. - **/ - RenderPassAttachment(VkFormat in_format, - VkSampleCountFlags in_sample_count, - VkAttachmentLoadOp in_depth_load_op, - VkAttachmentStoreOp in_depth_store_op, - VkAttachmentLoadOp in_stencil_load_op, - VkAttachmentStoreOp in_stencil_store_op, - VkImageLayout in_initial_layout, - VkImageLayout in_final_layout, - bool in_may_alias, - uint32_t in_index) - { - color_depth_load_op = in_depth_load_op; - color_depth_store_op = in_depth_store_op; - final_layout = in_final_layout; - format = in_format; - index = in_index; - initial_layout = in_initial_layout; - may_alias = in_may_alias; - sample_count = in_sample_count; - stencil_load_op = in_stencil_load_op; - stencil_store_op = in_stencil_store_op; - type = ATTACHMENT_TYPE_DEPTH_STENCIL; - } - - /** Dummy constructor. This should only be used by STL containers. */ - RenderPassAttachment() - { - color_depth_load_op = VK_ATTACHMENT_LOAD_OP_MAX_ENUM; - color_depth_store_op = VK_ATTACHMENT_STORE_OP_MAX_ENUM; - final_layout = VK_IMAGE_LAYOUT_MAX_ENUM; - format = VK_FORMAT_MAX_ENUM; - index = UINT32_MAX; - initial_layout = VK_IMAGE_LAYOUT_MAX_ENUM; - may_alias = false; - sample_count = static_cast(0); - stencil_load_op = VK_ATTACHMENT_LOAD_OP_MAX_ENUM; - stencil_store_op = VK_ATTACHMENT_STORE_OP_MAX_ENUM; - type = ATTACHMENT_TYPE_UNKNOWN; - } - } RenderPassAttachment; - - typedef std::vector RenderPassAttachments; - - /* Holds properties of a sub-pass attachment */ - typedef struct SubPassAttachment - { - RenderPassAttachment* attachment_ptr; - uint32_t highest_subpass_index; - VkImageLayout layout; - uint32_t lowest_subpass_index; - RenderPassAttachment* resolve_attachment_ptr; - - /* Dummy constructor. Should only be used by STL containers */ - SubPassAttachment() - { - attachment_ptr = nullptr; - highest_subpass_index = UINT32_MAX; - layout = VK_IMAGE_LAYOUT_MAX_ENUM; - lowest_subpass_index = UINT32_MAX; - resolve_attachment_ptr = nullptr; - } - - /** Constructor. - * - * @param in_attachment_ptr Render-pass attachment that this sub-pass attachment should reference. - * Must not be nullptr. - * @param in_layout Layout to use for the attachment when executing the subpass. - * Driver takes care of transforming the attachment to the requested layout - * before subpass commands starts executing. - * @param in_resolve_attachment_ptr If not nullptr, this should point to the render-pass attachment, to which - * MS data of @param in_attachment_ptr should be resolved. If nullptr, it is - * assumed the sub-pass should not resolve the MS data. - **/ - SubPassAttachment(RenderPassAttachment* in_attachment_ptr, - VkImageLayout in_layout, - RenderPassAttachment* in_opt_resolve_attachment_ptr) - { - attachment_ptr = in_attachment_ptr; - highest_subpass_index = UINT32_MAX; - layout = in_layout; - lowest_subpass_index = UINT32_MAX; - resolve_attachment_ptr = in_opt_resolve_attachment_ptr; - } - } SubPassAttachment; - - typedef std::map LocationToSubPassAttachmentMap; - typedef LocationToSubPassAttachmentMap::const_iterator LocationToSubPassAttachmentMapConstIterator; - typedef std::vector SubPassAttachmentVector; - - /** Holds properties of a single sub-pass */ - typedef struct SubPass - { - LocationToSubPassAttachmentMap color_attachments_map; - SubPassAttachment depth_stencil_attachment; - std::weak_ptr device_ptr; - uint32_t index; - LocationToSubPassAttachmentMap input_attachments_map; - GraphicsPipelineID pipeline_id; - SubPassAttachmentVector preserved_attachments; - LocationToSubPassAttachmentMap resolved_attachments_map; - - SubPassAttachment* get_color_attachment_at_index(uint32_t in_index) - { - return get_attachment_at_index(color_attachments_map, - in_index); - } - - SubPassAttachment* get_input_attachment_at_index(uint32_t in_index) - { - return get_attachment_at_index(input_attachments_map, - in_index); - } - - SubPassAttachment* get_resolved_attachment_at_index(uint32_t in_index) - { - return get_attachment_at_index(resolved_attachments_map, - in_index); - } - - /** Dummy constructor. This should only be used by STL containers */ - SubPass() - { - index = UINT32_MAX; - pipeline_id = UINT32_MAX; - } - - /** Constructor. - * - * @param in_index Index of the sub-pass - * @param in_pipeline_id ID of the graphics pipeline which is associated with the subpass. - * - **/ - SubPass(std::weak_ptr in_device_ptr, - uint32_t in_index, - GraphicsPipelineID in_pipeline_id) - { - device_ptr = in_device_ptr; - index = in_index; - pipeline_id = in_pipeline_id; - } - - /* Destructor */ - ~SubPass(); - - private: - /** Returns a pointer to the SubPassAttachment instance, assigned to the index specified - * under @param index in @param in_map. - **/ - SubPassAttachment* get_attachment_at_index(LocationToSubPassAttachmentMap& in_map, - uint32_t in_index) - { - uint32_t current_index = 0; - SubPassAttachment* result_ptr = nullptr; - - for (auto attachment_iterator = in_map.begin(); - attachment_iterator != in_map.end(); - ++attachment_iterator, ++current_index) - { - if (current_index == in_index) - { - result_ptr = &attachment_iterator->second; - - break; - } - } - - return result_ptr; - } - - SubPass (const SubPass&); - SubPass& operator=(const SubPass&); - } SubPass; - - typedef std::vector SubPasses; - typedef SubPasses::const_iterator SubPassesConstIterator; - - /** Holds properties of a single subpass<->subpass dependency. */ - typedef struct SubPassDependency - { - VkAccessFlagsVariable (destination_access_mask); - VkPipelineStageFlagsVariable(destination_stage_mask); - VkAccessFlagsVariable (source_access_mask); - VkPipelineStageFlagsVariable(source_stage_mask); - - bool by_region; - const SubPass* destination_subpass_ptr; - const SubPass* source_subpass_ptr; - - /** Constructor. - * - * @param in_destination_stage_mask Destination pipeline stage mask. - * @param in_destination_subpass_ptr Pointer to the descriptor of the destination subpass. - * If nullptr, it is assumed an external destination is requested. - * @param in_source_stage_mask Source pipeline stage mask. - * @param in_source_subpass_ptr Pointer to the descriptor of the source subpass. - * If nullptr, it is assumed an external source is requested. - * @param in_source_access_mask Source access mask. - * @param in_destination_access_mask Destination access mask. - * @param in_by_region true if a "by-region" dependency is requested; false otherwise. - **/ - SubPassDependency(VkPipelineStageFlags in_destination_stage_mask, - const SubPass* in_destination_subpass_ptr, - VkPipelineStageFlags in_source_stage_mask, - const SubPass* in_source_subpass_ptr, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) - { - by_region = in_by_region; - destination_stage_mask = static_cast(in_destination_stage_mask); - destination_subpass_ptr = in_destination_subpass_ptr; - destination_access_mask = static_cast (in_destination_access_mask); - source_access_mask = static_cast (in_source_access_mask); - source_stage_mask = static_cast(in_source_stage_mask); - source_subpass_ptr = in_source_subpass_ptr; - } - - /** Dummy constructor. Should only be used by STL containers */ - SubPassDependency() - { - destination_access_mask = static_cast (0); - destination_stage_mask = static_cast(0); - destination_subpass_ptr = nullptr; - source_access_mask = static_cast (0); - source_stage_mask = static_cast(0); - source_subpass_ptr = nullptr; - } - - /** Comparator operator */ - bool operator==(const SubPassDependency& in) - { - return in.by_region == by_region && - in.destination_access_mask == destination_access_mask && - in.destination_stage_mask == destination_stage_mask && - in.destination_subpass_ptr == destination_subpass_ptr && - in.source_access_mask == source_access_mask && - in.source_stage_mask == source_stage_mask && - in.source_subpass_ptr == source_subpass_ptr; - } - } SubPassDependency; - - typedef std::vector SubPassDependencies; - /* Private functions */ + bool init(); + /* Constructor. Please see create() for specification */ - RenderPass(std::weak_ptr in_device_ptr, - std::shared_ptr in_opt_swapchain_ptr); + RenderPass(std::unique_ptr in_renderpass_info_ptr, + std::shared_ptr in_opt_swapchain_ptr); RenderPass& operator=(const RenderPass&); RenderPass (const RenderPass&); - bool add_dependency (SubPass* in_destination_subpass_ptr, - SubPass* in_source_subpass_ptr, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region); - bool add_subpass_attachment(SubPassID in_subpass_id, - bool in_is_color_attachment, - VkImageLayout in_input_layout, - RenderPassAttachmentID in_attachment_id, - uint32_t in_attachment_location, - bool in_should_resolve, - RenderPassAttachmentID in_resolve_attachment_id); - - VkAttachmentReference get_attachment_reference_from_renderpass_attachment(const RenderPassAttachment& in_renderpass_attachment) const; - VkAttachmentReference get_attachment_reference_from_subpass_attachment (const SubPassAttachment& in_subpass_attachment) const; - VkAttachmentReference get_attachment_reference_for_resolve_attachment (const SubPassesConstIterator& in_subpass_iterator, - const LocationToSubPassAttachmentMapConstIterator& in_location_to_subpass_att_map_iterator) const; - void update_preserved_attachments (); - /* Private members */ - RenderPassAttachments m_attachments; - std::weak_ptr m_device_ptr; - bool m_dirty; - VkRenderPass m_render_pass; - SubPasses m_subpasses; - SubPassDependencies m_subpass_dependencies; - std::shared_ptr m_swapchain_ptr; + VkRenderPass m_render_pass; + std::unique_ptr m_render_pass_info_ptr; + std::shared_ptr m_swapchain_ptr; }; }; diff --git a/include/wrappers/rendering_surface.h b/include/wrappers/rendering_surface.h index b51ea53b..07c00bf8 100644 --- a/include/wrappers/rendering_surface.h +++ b/include/wrappers/rendering_surface.h @@ -31,6 +31,7 @@ #define WRAPPERS_RENDERING_SURFACE_H #include "misc/debug_marker.h" +#include "misc/mt_safety.h" #include "misc/types.h" #include "wrappers/device.h" #include "wrappers/physical_device.h" @@ -40,7 +41,8 @@ namespace Anvil { /* Wrapper class for Vulkan rendering surfaces */ - class RenderingSurface : public DebugMarkerSupportProvider + class RenderingSurface : public DebugMarkerSupportProvider, + public MTSafetySupportProvider { public: /* Public type definitions */ @@ -75,7 +77,8 @@ namespace Anvil * Object Tracker. */ static std::shared_ptr create(std::weak_ptr in_instance_ptr, std::weak_ptr in_device_ptr, - std::shared_ptr in_window_ptr); + std::shared_ptr in_window_ptr, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destructor * @@ -185,6 +188,7 @@ namespace Anvil RenderingSurface(std::weak_ptr in_instance_ptr, std::weak_ptr in_device_ptr, std::shared_ptr in_window_ptr, + bool in_mt_safe, bool* out_safe_to_use_ptr); RenderingSurface (const RenderingSurface&); @@ -199,6 +203,7 @@ namespace Anvil uint32_t m_height; std::map m_physical_device_capabilities; + uint32_t m_stream_index; VkSurfaceKHR m_surface; RenderingSurfaceType m_type; uint32_t m_width; diff --git a/include/wrappers/sampler.h b/include/wrappers/sampler.h index bde522e5..672b2bc0 100644 --- a/include/wrappers/sampler.h +++ b/include/wrappers/sampler.h @@ -31,13 +31,15 @@ #define WRAPPERS_SAMPLER_H #include "misc/debug_marker.h" +#include "misc/mt_safety.h" #include "misc/types.h" namespace Anvil { /** Wrapper class for Vulkan samplers */ - class Sampler : public DebugMarkerSupportProvider + class Sampler : public DebugMarkerSupportProvider, + public MTSafetySupportProvider { public: /* Public functions */ @@ -62,7 +64,8 @@ namespace Anvil float in_min_lod, float in_max_lod, VkBorderColor in_border_color, - bool in_use_unnormalized_coordinates); + bool in_use_unnormalized_coordinates, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destructor. * @@ -171,7 +174,8 @@ namespace Anvil float in_min_lod, float in_max_lod, VkBorderColor in_border_color, - bool in_use_unnormalized_coordinates); + bool in_use_unnormalized_coordinates, + bool in_mt_safe); Sampler (const Sampler&); Sampler& operator=(const Sampler&); diff --git a/include/wrappers/semaphore.h b/include/wrappers/semaphore.h index 259e1ef7..599d23d4 100644 --- a/include/wrappers/semaphore.h +++ b/include/wrappers/semaphore.h @@ -32,18 +32,21 @@ #define WRAPPERS_SEMAPHORE_H #include "misc/debug_marker.h" +#include "misc/mt_safety.h" #include "misc/types.h" namespace Anvil { /* Wrapper class for Vulkan semaphores */ - class Semaphore : public DebugMarkerSupportProvider + class Semaphore : public DebugMarkerSupportProvider, + public MTSafetySupportProvider { public: /* Public functions */ /** Creates a single Vulkan semaphore instance and registers the object in Object Tracker. */ - static std::shared_ptr create(std::weak_ptr in_device_ptr); + static std::shared_ptr create(std::weak_ptr in_device_ptr, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destructor. * @@ -71,7 +74,8 @@ namespace Anvil /* Private functions */ /* Constructor. Please see create() for specification */ - Semaphore(std::weak_ptr in_device_ptr); + Semaphore(std::weak_ptr in_device_ptr, + bool in_mt_safe); Semaphore (const Semaphore&); Semaphore& operator=(const Semaphore&); diff --git a/include/wrappers/shader_module.h b/include/wrappers/shader_module.h index 167d645f..1dc72128 100644 --- a/include/wrappers/shader_module.h +++ b/include/wrappers/shader_module.h @@ -31,6 +31,7 @@ #define WRAPPERS_SHADER_MODULE_H #include "misc/debug_marker.h" +#include "misc/mt_safety.h" #include "misc/types.h" namespace Anvil @@ -39,6 +40,7 @@ namespace Anvil class GLSLShaderToSPIRVGenerator; class ShaderModule : public DebugMarkerSupportProvider, + public MTSafetySupportProvider, public std::enable_shared_from_this { public: @@ -54,7 +56,8 @@ namespace Anvil * @param in_spirv_generator_ptr SPIR-V generator, initialized with a GLSL shader body. **/ static std::shared_ptr create_from_spirv_generator(std::weak_ptr in_device_ptr, - std::shared_ptr in_spirv_generator_ptr); + std::shared_ptr in_spirv_generator_ptr, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Creates a new shader module instance from a raw SPIR-V blob. * @@ -85,7 +88,8 @@ namespace Anvil const char* in_opt_gs_entrypoint_name, const char* in_opt_tc_entrypoint_name, const char* in_opt_te_entrypoint_name, - const char* in_opt_vs_entrypoint_name); + const char* in_opt_vs_entrypoint_name, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); static std::shared_ptr create_from_spirv_blob(std::weak_ptr in_device_ptr, const char* in_spirv_blob, uint32_t in_n_spirv_blob_bytes, @@ -94,7 +98,8 @@ namespace Anvil const std::string& in_opt_gs_entrypoint_name, const std::string& in_opt_tc_entrypoint_name, const std::string& in_opt_te_entrypoint_name, - const std::string& in_opt_vs_entrypoint_name) + const std::string& in_opt_vs_entrypoint_name, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) { return create_from_spirv_blob(in_device_ptr, in_spirv_blob, @@ -104,7 +109,8 @@ namespace Anvil in_opt_gs_entrypoint_name.c_str(), in_opt_tc_entrypoint_name.c_str(), in_opt_te_entrypoint_name.c_str(), - in_opt_vs_entrypoint_name.c_str() ); + in_opt_vs_entrypoint_name.c_str(), + in_mt_safety); } static std::shared_ptr create_from_spirv_blob(std::weak_ptr in_device_ptr, const uint32_t* in_spirv_blob, @@ -114,7 +120,8 @@ namespace Anvil const std::string& in_opt_gs_entrypoint_name, const std::string& in_opt_tc_entrypoint_name, const std::string& in_opt_te_entrypoint_name, - const std::string& in_opt_vs_entrypoint_name) + const std::string& in_opt_vs_entrypoint_name, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) { return create_from_spirv_blob(in_device_ptr, reinterpret_cast(in_spirv_blob), @@ -124,7 +131,8 @@ namespace Anvil in_opt_gs_entrypoint_name.c_str(), in_opt_tc_entrypoint_name.c_str(), in_opt_te_entrypoint_name.c_str(), - in_opt_vs_entrypoint_name.c_str() ); + in_opt_vs_entrypoint_name.c_str(), + in_mt_safety); } /** Destructor. Releases internally maintained Vulkan shader module instance. */ @@ -231,7 +239,8 @@ namespace Anvil /* Constructor. Please see create() for specification */ explicit ShaderModule(std::weak_ptr in_device_ptr, - std::shared_ptr in_spirv_generator_ptr); + std::shared_ptr in_spirv_generator_ptr, + bool in_mt_safe); explicit ShaderModule(std::weak_ptr in_device_ptr, const char* in_spirv_blob, uint32_t in_n_spirv_blob_bytes, @@ -240,7 +249,8 @@ namespace Anvil const std::string& in_opt_gs_entrypoint_name, const std::string& in_opt_tc_entrypoint_name, const std::string& in_opt_te_entrypoint_name, - const std::string& in_opt_vs_entrypoint_name); + const std::string& in_opt_vs_entrypoint_name, + bool in_mt_safe); ShaderModule (const ShaderModule&); ShaderModule& operator=(const ShaderModule&); diff --git a/include/wrappers/swapchain.h b/include/wrappers/swapchain.h index 36c51036..b3afff28 100644 --- a/include/wrappers/swapchain.h +++ b/include/wrappers/swapchain.h @@ -33,6 +33,7 @@ #define WRAPPERS_SWAPCHAIN_H #include "misc/debug_marker.h" +#include "misc/mt_safety.h" #include "misc/types.h" #include "wrappers/device.h" #include "wrappers/fence.h" @@ -43,7 +44,8 @@ namespace Anvil { /* Wrapper class for a Vulkan Swapchain */ - class Swapchain : public DebugMarkerSupportProvider + class Swapchain : public DebugMarkerSupportProvider, + public MTSafetySupportProvider { public: /* Public functions */ @@ -62,7 +64,6 @@ namespace Anvil * @param in_flags Swapchain create flags to pass, when creating the swapchain. * */ - static std::shared_ptr create(std::weak_ptr in_device_ptr, std::shared_ptr in_parent_surface_ptr, std::shared_ptr in_window_ptr, @@ -71,6 +72,7 @@ namespace Anvil VkImageUsageFlags in_usage_flags, uint32_t in_n_images, const ExtensionKHRSwapchainEntrypoints& in_khr_swapchain_entrypoints, + MTSafety in_mt_safety, VkSwapchainCreateFlagsKHR in_flags = 0); /** Destructor. @@ -215,7 +217,8 @@ namespace Anvil VkImageUsageFlags in_usage_flags, uint32_t in_n_images, VkSwapchainCreateFlagsKHR in_flags, - const ExtensionKHRSwapchainEntrypoints& in_khr_swapchain_entrypoints); + const ExtensionKHRSwapchainEntrypoints& in_khr_swapchain_entrypoints, + bool in_mt_safe); Swapchain (const Swapchain&); Swapchain& operator=(const Swapchain&); @@ -224,7 +227,7 @@ namespace Anvil void init (); void on_parent_window_about_to_close(); - void on_present_request_issued (); + void on_present_request_issued (Anvil::CallbackArgument* in_callback_raw_ptr); /* Private variables */ bool m_destroy_swapchain_before_parent_window_closes; diff --git a/src/misc/base_pipeline_info.cpp b/src/misc/base_pipeline_info.cpp new file mode 100644 index 00000000..23e30320 --- /dev/null +++ b/src/misc/base_pipeline_info.cpp @@ -0,0 +1,245 @@ +// +// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#include "misc/base_pipeline_info.h" +#include + + +Anvil::BasePipelineInfo::BasePipelineInfo() +{ + /* Stub */ +} + +Anvil::BasePipelineInfo::~BasePipelineInfo() +{ + /* Stub */ +} + +bool Anvil::BasePipelineInfo::add_specialization_constant(Anvil::ShaderStage in_shader_stage, + uint32_t in_constant_id, + uint32_t in_n_data_bytes, + const void* in_data_ptr) +{ + uint32_t data_buffer_size = 0; + bool result = false; + + if (in_n_data_bytes == 0) + { + anvil_assert(!(in_n_data_bytes == 0) ); + + goto end; + } + + if (in_data_ptr == nullptr) + { + anvil_assert(!(in_data_ptr == nullptr) ); + + goto end; + } + + /* Append specialization constant data and add a new descriptor. */ + data_buffer_size = static_cast(m_specialization_constants_data_buffer.size() ); + + + anvil_assert(m_specialization_constants_map.find(in_shader_stage) != m_specialization_constants_map.end() ); + + m_specialization_constants_map[in_shader_stage].push_back( + SpecializationConstant( + in_constant_id, + in_n_data_bytes, + data_buffer_size) + ); + + m_specialization_constants_data_buffer.resize(data_buffer_size + in_n_data_bytes); + + + memcpy(&m_specialization_constants_data_buffer.at(data_buffer_size), + in_data_ptr, + in_n_data_bytes); + + /* All done */ + result = true; +end: + return result; +} + +/* Please see header for specification */ +bool Anvil::BasePipelineInfo::attach_push_constant_range(uint32_t in_offset, + uint32_t in_size, + VkShaderStageFlags in_stages) +{ + bool result = false; + + /* Retrieve pipeline's descriptor and add the specified push constant range */ + const auto new_descriptor = Anvil::PushConstantRange(in_offset, + in_size, + in_stages); + + if (std::find(m_push_constant_ranges.begin(), + m_push_constant_ranges.end(), + new_descriptor) != m_push_constant_ranges.end() ) + { + anvil_assert_fail(); + + goto end; + } + + m_push_constant_ranges.push_back(new_descriptor); + + /* All done */ + result = true; + +end: + return result; +} + +void Anvil::BasePipelineInfo::copy_state_from(const BasePipelineInfo* in_src_pipeline_info_ptr) +{ + m_base_pipeline_id = in_src_pipeline_info_ptr->m_base_pipeline_id; + + m_dsg_ptr = in_src_pipeline_info_ptr->m_dsg_ptr; + m_push_constant_ranges = in_src_pipeline_info_ptr->m_push_constant_ranges; + + m_allow_derivatives = in_src_pipeline_info_ptr->m_allow_derivatives; + m_disable_optimizations = in_src_pipeline_info_ptr->m_disable_optimizations; + m_shader_stages = in_src_pipeline_info_ptr->m_shader_stages; + + m_specialization_constants_data_buffer = in_src_pipeline_info_ptr->m_specialization_constants_data_buffer; + m_specialization_constants_map = in_src_pipeline_info_ptr->m_specialization_constants_map; +} + +bool Anvil::BasePipelineInfo::get_shader_stage_properties(Anvil::ShaderStage in_shader_stage, + const ShaderModuleStageEntryPoint** out_opt_result_ptr_ptr) const +{ + bool result = false; + auto shader_stage_iterator = m_shader_stages.find(in_shader_stage); + + if (shader_stage_iterator != m_shader_stages.end() ) + { + if (out_opt_result_ptr_ptr != nullptr) + { + *out_opt_result_ptr_ptr = &shader_stage_iterator->second; + } + + result = true; + } + + return result; +} + +bool Anvil::BasePipelineInfo::get_specialization_constants(Anvil::ShaderStage in_shader_stage, + const SpecializationConstants** out_opt_spec_constants_ptr, + const unsigned char** out_opt_spec_constants_data_buffer_ptr) const +{ + bool result = false; + const auto sc_map_iterator = m_specialization_constants_map.find(in_shader_stage); + + if (sc_map_iterator != m_specialization_constants_map.end() ) + { + if (out_opt_spec_constants_ptr != nullptr) + { + *out_opt_spec_constants_ptr = &sc_map_iterator->second; + } + + if (out_opt_spec_constants_data_buffer_ptr != nullptr) + { + *out_opt_spec_constants_data_buffer_ptr = (m_specialization_constants_data_buffer.size() > 0) ? &m_specialization_constants_data_buffer.at(0) + : nullptr; + } + + result = true; + } + + return result; +} + +void Anvil::BasePipelineInfo::init_derivative_pipeline_info(bool in_disable_optimizations, + bool in_allow_derivatives, + uint32_t in_n_shader_module_stage_entrypoints, + const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, + Anvil::PipelineID in_base_pipeline_id, + std::shared_ptr in_opt_dsg_ptr) +{ + m_allow_derivatives = in_allow_derivatives; + m_base_pipeline_id = in_base_pipeline_id; + m_disable_optimizations = in_disable_optimizations; + m_is_proxy = false; + + if (in_opt_dsg_ptr != nullptr) + { + m_dsg_ptr = in_opt_dsg_ptr; + } + + init_shader_modules(in_n_shader_module_stage_entrypoints, + in_shader_module_stage_entrypoint_ptrs); +} + +void Anvil::BasePipelineInfo::init_proxy_pipeline_info() +{ + m_allow_derivatives = false; + m_base_pipeline_id = UINT32_MAX; + m_disable_optimizations = false; + m_is_proxy = true; +} + +void Anvil::BasePipelineInfo::init_regular_pipeline_info(bool in_disable_optimizations, + bool in_allow_derivatives, + uint32_t in_n_shader_module_stage_entrypoints, + const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, + std::shared_ptr in_opt_dsg_ptr) +{ + m_allow_derivatives = in_allow_derivatives; + m_base_pipeline_id = UINT32_MAX; + m_disable_optimizations = in_disable_optimizations; + m_is_proxy = false; + + if (in_opt_dsg_ptr != nullptr) + { + m_dsg_ptr = in_opt_dsg_ptr; + } + + init_shader_modules(in_n_shader_module_stage_entrypoints, + in_shader_module_stage_entrypoint_ptrs); +} + +void Anvil::BasePipelineInfo::init_shader_modules(uint32_t in_n_shader_module_stage_entrypoints, + const Anvil::ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs) +{ + for (uint32_t n_shader_module_stage_entrypoint = 0; + n_shader_module_stage_entrypoint < in_n_shader_module_stage_entrypoints; + ++n_shader_module_stage_entrypoint) + { + const auto& shader_module_stage_entrypoint = in_shader_module_stage_entrypoint_ptrs[n_shader_module_stage_entrypoint]; + + if (shader_module_stage_entrypoint.stage == Anvil::SHADER_STAGE_UNKNOWN) + { + continue; + } + + m_shader_stages [shader_module_stage_entrypoint.stage] = shader_module_stage_entrypoint; + m_specialization_constants_map[shader_module_stage_entrypoint.stage] = SpecializationConstants(); + } +} + +void Anvil::BasePipelineInfo::set_dsg(std::shared_ptr in_dsg_ptr) +{ + m_dsg_ptr = in_dsg_ptr; +} \ No newline at end of file diff --git a/src/misc/base_pipeline_manager.cpp b/src/misc/base_pipeline_manager.cpp index 73ddda85..ddb5730d 100644 --- a/src/misc/base_pipeline_manager.cpp +++ b/src/misc/base_pipeline_manager.cpp @@ -20,6 +20,7 @@ // THE SOFTWARE. // +#include "misc/base_pipeline_info.h" #include "misc/base_pipeline_manager.h" #include "misc/debug.h" #include "wrappers/descriptor_set_group.h" @@ -31,10 +32,13 @@ /** Please see header for specification */ Anvil::BasePipelineManager::BasePipelineManager(std::weak_ptr in_device_ptr, + bool in_mt_safe, bool in_use_pipeline_cache, std::shared_ptr in_pipeline_cache_to_reuse_ptr) - :m_device_ptr (in_device_ptr), - m_pipeline_counter(0) + :CallbacksSupportProvider(BASE_PIPELINE_MANAGER_CALLBACK_ID_COUNT), + MTSafetySupportProvider (in_mt_safe), + m_device_ptr (in_device_ptr), + m_pipeline_counter (0) { anvil_assert(!in_use_pipeline_cache && in_pipeline_cache_to_reuse_ptr == nullptr || in_use_pipeline_cache); @@ -51,7 +55,12 @@ Anvil::BasePipelineManager::BasePipelineManager(std::weak_ptr { if (in_use_pipeline_cache) { - m_pipeline_cache_ptr = Anvil::PipelineCache::create(m_device_ptr); + m_pipeline_cache_ptr = Anvil::PipelineCache::create( + m_device_ptr, + in_mt_safe, + 0, /* in_initial_data_size */ + nullptr /* in_initial_data */ + ); } m_use_pipeline_cache = in_use_pipeline_cache; @@ -61,9 +70,9 @@ Anvil::BasePipelineManager::BasePipelineManager(std::weak_ptr /** Please see header for specification */ Anvil::BasePipelineManager::~BasePipelineManager() { - anvil_assert(m_pipelines.size() == 0); + anvil_assert(m_baked_pipelines.size() == 0); - m_pipeline_layout_manager_ptr.reset(); + m_pipeline_layout_manager_ptr.reset(); } @@ -71,301 +80,106 @@ Anvil::BasePipelineManager::~BasePipelineManager() * * The function does NOT release the layout object, since it's owned by the Pipeline Layout manager. *s*/ -void Anvil::BasePipelineManager::Pipeline::release_vulkan_objects() +void Anvil::BasePipelineManager::Pipeline::release_pipeline() { if (baked_pipeline != VK_NULL_HANDLE) { std::shared_ptr device_locked_ptr(device_ptr); - vkDestroyPipeline(device_locked_ptr->get_device_vk(), - baked_pipeline, - nullptr /* pAllocator */); + device_locked_ptr->get_pipeline_cache()->lock(); + lock(); + { + vkDestroyPipeline(device_locked_ptr->get_device_vk(), + baked_pipeline, + nullptr /* pAllocator */); + } + unlock(); + device_locked_ptr->get_pipeline_cache()->unlock(); baked_pipeline = VK_NULL_HANDLE; } } -/* Please see header for specification */ -bool Anvil::BasePipelineManager::add_derivative_pipeline_from_sibling_pipeline(bool in_disable_optimizations, - bool in_allow_derivatives, - uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, - PipelineID in_base_pipeline_id, - PipelineID* out_pipeline_id_ptr) -{ - std::shared_ptr base_pipeline_ptr; - PipelineID new_pipeline_id = 0; - std::shared_ptr new_pipeline_ptr; - bool result = false; - - /* Retrieve base pipeline's descriptor */ - if (m_pipelines.size() <= in_base_pipeline_id) - { - anvil_assert(!(m_pipelines.size() <= in_base_pipeline_id) ); - - goto end; - } - else - { - base_pipeline_ptr = m_pipelines.at(in_base_pipeline_id); - - anvil_assert(base_pipeline_ptr != nullptr); - } - - /* Create & store the new descriptor */ - anvil_assert(base_pipeline_ptr->allow_derivatives); - - new_pipeline_id = (m_pipeline_counter++); - new_pipeline_ptr = std::shared_ptr(new Pipeline(m_device_ptr, - in_disable_optimizations, - in_allow_derivatives, - base_pipeline_ptr, - in_n_shader_module_stage_entrypoints, - in_shader_module_stage_entrypoint_ptrs) ); - - anvil_assert(m_pipelines.find(new_pipeline_id) == m_pipelines.end() ); - - m_pipelines[new_pipeline_id] = new_pipeline_ptr; - *out_pipeline_id_ptr = new_pipeline_id; - - /* All done */ - result = true; -end: - return result; -} /* Please see header for specification */ -bool Anvil::BasePipelineManager::add_derivative_pipeline_from_pipeline(bool in_disable_optimizations, - bool in_allow_derivatives, - uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, - VkPipeline in_base_pipeline, - PipelineID* out_pipeline_id_ptr) +bool Anvil::BasePipelineManager::add_pipeline(std::unique_ptr in_pipeline_info_ptr, + PipelineID* out_pipeline_id_ptr) { - PipelineID new_pipeline_id = 0; - std::shared_ptr new_pipeline_ptr; - bool result = false; - - if (in_base_pipeline == VK_NULL_HANDLE) - { - anvil_assert(!(in_base_pipeline != VK_NULL_HANDLE)); - - goto end; - } - - /* Create & store the new descriptor */ - new_pipeline_id = (m_pipeline_counter++); - new_pipeline_ptr = std::shared_ptr(new Pipeline(m_device_ptr, - in_disable_optimizations, - in_allow_derivatives, - in_base_pipeline, - in_n_shader_module_stage_entrypoints, - in_shader_module_stage_entrypoint_ptrs) ); - - *out_pipeline_id_ptr = new_pipeline_id; - m_pipelines[new_pipeline_id] = new_pipeline_ptr; - - /* All done */ - result = true; -end: - return result; -} - -/* Please see header for specification */ -bool Anvil::BasePipelineManager::add_proxy_pipeline(PipelineID* out_pipeline_id_ptr) -{ - PipelineID new_pipeline_id = 0; - std::shared_ptr new_pipeline_ptr; - - /* Create & store the new descriptor */ - new_pipeline_id = (m_pipeline_counter++); - new_pipeline_ptr = std::shared_ptr(new Pipeline(m_device_ptr, - false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - 0, /* in_n_shaders */ - nullptr, /* in_shaders */ - true) ); /* in_is_proxy */ - - *out_pipeline_id_ptr = new_pipeline_id; - m_pipelines[new_pipeline_id] = new_pipeline_ptr; - - /* All done */ - return true; -} - -/* Please see header for specification */ -bool Anvil::BasePipelineManager::add_regular_pipeline(bool in_disable_optimizations, - bool in_allow_derivatives, - uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, - PipelineID* out_pipeline_id_ptr) -{ - PipelineID new_pipeline_id = 0; - std::shared_ptr new_pipeline_ptr; - - /* Create & store the new descriptor */ - new_pipeline_id = (m_pipeline_counter++); - new_pipeline_ptr = std::shared_ptr(new Pipeline(m_device_ptr, - in_disable_optimizations, - in_allow_derivatives, - in_n_shader_module_stage_entrypoints, - in_shader_module_stage_entrypoint_ptrs, - false /* in_is_proxy */) ); - - *out_pipeline_id_ptr = new_pipeline_id; - m_pipelines[new_pipeline_id] = new_pipeline_ptr; - - /* All done */ - return true; -} - - -bool Anvil::BasePipelineManager::add_specialization_constant_to_pipeline(PipelineID in_pipeline_id, - ShaderIndex in_shader_index, - uint32_t in_constant_id, - uint32_t in_n_data_bytes, - const void* in_data_ptr) -{ - Pipelines::iterator pipeline_iterator; - std::shared_ptr pipeline_ptr; - uint32_t data_buffer_size = 0; - bool result = false; - - if (in_n_data_bytes == 0) - { - anvil_assert(!(in_n_data_bytes == 0) ); - - goto end; - } - - if (in_data_ptr == nullptr) - { - anvil_assert(!(in_data_ptr == nullptr) ); - - goto end; - } - - /* Retrieve the pipeline's descriptor */ - pipeline_iterator = m_pipelines.find(in_pipeline_id); + const Anvil::PipelineID base_pipeline_id = in_pipeline_info_ptr->get_base_pipeline_id(); + std::shared_ptr base_pipeline_ptr; + auto callback_arg = Anvil::OnNewPipelineCreatedCallbackData(UINT32_MAX); + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + PipelineID new_pipeline_id = 0; + std::unique_ptr new_pipeline_ptr; + bool result = false; - if (pipeline_iterator == m_pipelines.end() ) + if (mutex_ptr != nullptr) { - anvil_assert(pipeline_iterator != m_pipelines.end() ) - - goto end; + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); } - else - { - pipeline_ptr = pipeline_iterator->second; - } - - if (pipeline_ptr->is_proxy) - { - anvil_assert(!pipeline_ptr->is_proxy); - - goto end; - } - - /* Append specialization constant data and add a new descriptor. */ - data_buffer_size = static_cast(pipeline_ptr->specialization_constant_data_buffer.size() ); - - - anvil_assert(pipeline_ptr->specialization_constants_map.find(in_shader_index) != pipeline_ptr->specialization_constants_map.end() ); - - pipeline_ptr->specialization_constants_map[in_shader_index].push_back(SpecializationConstant(in_constant_id, - in_n_data_bytes, - data_buffer_size)); - - pipeline_ptr->specialization_constant_data_buffer.resize(data_buffer_size + in_n_data_bytes); - - memcpy(&pipeline_ptr->specialization_constant_data_buffer.at(data_buffer_size), - in_data_ptr, - in_n_data_bytes); - - /* All done */ - result = true; -end: - return result; -} - -/* Please see header for specification */ -bool Anvil::BasePipelineManager::set_pipeline_dsg(PipelineID in_pipeline_id, - std::shared_ptr in_dsg_ptr) -{ - std::shared_ptr pipeline_ptr; - bool result = false; - - if (in_dsg_ptr == nullptr) + if (base_pipeline_id != UINT32_MAX) { - anvil_assert(!(in_dsg_ptr == nullptr) ); - - goto end; - } + auto base_pipeline_iterator = m_baked_pipelines.find(base_pipeline_id); + Anvil::BasePipelineInfo* base_pipeline_info_ptr = nullptr; - /* Retrieve pipeline's descriptor and attach the specified DSG */ - if (m_pipelines.find(in_pipeline_id) == m_pipelines.end() ) - { - anvil_assert(!(m_pipelines.find(in_pipeline_id) == m_pipelines.end() )); + if (base_pipeline_iterator == m_baked_pipelines.end() ) + { + base_pipeline_iterator = m_outstanding_pipelines.find(base_pipeline_id); - goto end; - } - else - { - pipeline_ptr = m_pipelines.at(in_pipeline_id); - } + if (base_pipeline_iterator != m_outstanding_pipelines.end() ) + { + base_pipeline_info_ptr = base_pipeline_iterator->second->pipeline_info_ptr.get(); + } + } + else + { + base_pipeline_info_ptr = base_pipeline_iterator->second->pipeline_info_ptr.get(); + } - /* Make sure the DSG has not already been attached */ - if (pipeline_ptr->dsg_ptr == in_dsg_ptr) - { - anvil_assert_fail(); + if (base_pipeline_info_ptr != nullptr) + { + anvil_assert(base_pipeline_ptr->pipeline_info_ptr->allows_derivatives() ); + } + else + { + /* Base pipeline ID is invalid */ + anvil_assert(base_pipeline_info_ptr != nullptr); - goto end; + goto end; + } } - /* If we reached this place, we can update the DSG */ - pipeline_ptr->dirty = true; - pipeline_ptr->dsg_ptr = in_dsg_ptr; - pipeline_ptr->layout_dirty = true; - - /* All done */ - result = true; -end: - return result; -} + /* Create & store the new descriptor */ + new_pipeline_id = (m_pipeline_counter.fetch_add(1) ); -/* Please see header for specification */ -bool Anvil::BasePipelineManager::attach_push_constant_range_to_pipeline(PipelineID in_pipeline_id, - uint32_t in_offset, - uint32_t in_size, - VkShaderStageFlags in_stages) -{ - const auto new_descriptor = Anvil::PushConstantRange(in_offset, - in_size, - in_stages); - std::shared_ptr pipeline_ptr; - bool result = false; + /* NOTE: in_pipeline_info_ptr becomes NULL after the call below */ + new_pipeline_ptr.reset( + new Pipeline( + m_device_ptr, + std::move(in_pipeline_info_ptr), + is_mt_safe() ) + ); - /* Retrieve pipeline's descriptor and add the specified push constant range */ - if (m_pipelines.find(in_pipeline_id) == m_pipelines.end() ) + if (new_pipeline_ptr->pipeline_info_ptr->is_proxy() ) { - anvil_assert(!(m_pipelines.find(in_pipeline_id) == m_pipelines.end())); - - goto end; + m_baked_pipelines[new_pipeline_id] = std::move(new_pipeline_ptr); } else { - pipeline_ptr = m_pipelines.at(in_pipeline_id); + m_outstanding_pipelines[new_pipeline_id] = std::move(new_pipeline_ptr); } - pipeline_ptr->dirty = true; - pipeline_ptr->layout_dirty = true; + *out_pipeline_id_ptr = new_pipeline_id; - anvil_assert(std::find(pipeline_ptr->push_constant_ranges.begin(), - pipeline_ptr->push_constant_ranges.end(), - new_descriptor) == pipeline_ptr->push_constant_ranges.end()); + /* Inform subscribers about the new pipeline. */ + callback_arg.new_pipeline_id = new_pipeline_id; - pipeline_ptr->push_constant_ranges.push_back(new_descriptor); + callback(BASE_PIPELINE_MANAGER_CALLBACK_ID_ON_NEW_PIPELINE_CREATED, + &callback_arg); /* All done */ result = true; @@ -415,49 +229,37 @@ void Anvil::BasePipelineManager::bake_specialization_info_vk(const Specializatio /* Please see header for specification */ bool Anvil::BasePipelineManager::delete_pipeline(PipelineID in_pipeline_id) { - auto pipeline_iterator = m_pipelines.find(in_pipeline_id); bool result = false; - if (pipeline_iterator == m_pipelines.end() ) { - goto end; - } - - m_pipelines.erase(pipeline_iterator); - - /* All done */ - result = true; -end: - return result; -} + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + Pipelines::iterator pipeline_iterator; -/* Please see header for specification */ -bool Anvil::BasePipelineManager::get_general_pipeline_properties(PipelineID in_pipeline_id, - bool* out_opt_has_optimizations_disabled_ptr, - bool* out_opt_allows_derivatives_ptr, - bool* out_opt_is_a_derivative_ptr) const -{ - auto pipeline_iterator = m_pipelines.find(in_pipeline_id); - bool result = false; + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } - if (pipeline_iterator == m_pipelines.end() ) - { - goto end; - } + pipeline_iterator = m_baked_pipelines.find(in_pipeline_id); - if (out_opt_has_optimizations_disabled_ptr != nullptr) - { - *out_opt_has_optimizations_disabled_ptr = pipeline_iterator->second->disable_optimizations; - } + if (pipeline_iterator != m_baked_pipelines.end() ) + { + m_baked_pipelines.erase(pipeline_iterator); + } + else + { + pipeline_iterator = m_outstanding_pipelines.find(in_pipeline_id); - if (out_opt_allows_derivatives_ptr != nullptr) - { - *out_opt_allows_derivatives_ptr = pipeline_iterator->second->allow_derivatives; - } + if (pipeline_iterator == m_outstanding_pipelines.end() ) + { + goto end; + } - if (out_opt_is_a_derivative_ptr != nullptr) - { - *out_opt_is_a_derivative_ptr = pipeline_iterator->second->is_derivative; + m_outstanding_pipelines.erase(pipeline_iterator); + } } /* All done */ @@ -469,95 +271,127 @@ bool Anvil::BasePipelineManager::get_general_pipeline_properties(PipelineID in_p /* Please see header for specification */ VkPipeline Anvil::BasePipelineManager::get_pipeline(PipelineID in_pipeline_id) { - std::shared_ptr pipeline_ptr; - VkPipeline result = VK_NULL_HANDLE; + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + Pipelines::const_iterator pipeline_iterator; + Pipeline* pipeline_ptr = nullptr; + VkPipeline result = VK_NULL_HANDLE; - if (m_pipelines.find(in_pipeline_id) == m_pipelines.end() ) + if (mutex_ptr != nullptr) { - anvil_assert(!(m_pipelines.find(in_pipeline_id) == m_pipelines.end()) ); - - goto end; + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); } - else + + if (m_outstanding_pipelines.size() > 0) { - pipeline_ptr = m_pipelines.at(in_pipeline_id); + bake(); } - if (pipeline_ptr->is_proxy) + pipeline_iterator = m_baked_pipelines.find(in_pipeline_id); + + if (pipeline_iterator == m_baked_pipelines.end() ) { - anvil_assert(!pipeline_ptr->is_proxy); + anvil_assert(!(pipeline_iterator == m_baked_pipelines.end()) ); goto end; } - if (pipeline_ptr->dirty) + pipeline_ptr = pipeline_iterator->second.get(); + + if (pipeline_ptr->pipeline_info_ptr->is_proxy() ) { - bake(); + anvil_assert(!pipeline_ptr->pipeline_info_ptr->is_proxy() ); - anvil_assert( pipeline_ptr->baked_pipeline != VK_NULL_HANDLE); - anvil_assert(!pipeline_ptr->dirty); + goto end; } - result = m_pipelines.at(in_pipeline_id)->baked_pipeline; + result = pipeline_ptr->baked_pipeline; + anvil_assert(result != VK_NULL_HANDLE); end: return result; } -/* Please see header for specification */ -bool Anvil::BasePipelineManager::get_pipeline_id_at_index(uint32_t in_n_pipeline, - PipelineID* out_pipeline_id_ptr) const +const Anvil::BasePipelineInfo* Anvil::BasePipelineManager::get_pipeline_info(PipelineID in_pipeline_id) const { - Pipelines::const_iterator current_pipeline_it = m_pipelines.cbegin(); - uint32_t n_current_pipeline = 0; - bool result = false; + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + Pipelines::const_iterator pipeline_iterator; + Pipeline* pipeline_ptr = nullptr; + const Anvil::BasePipelineInfo* result_ptr = nullptr; - if (m_pipelines.size() <= in_n_pipeline) + if (mutex_ptr != nullptr) { - goto end; + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); } - while (n_current_pipeline != in_n_pipeline) + pipeline_iterator = m_baked_pipelines.find(in_pipeline_id); + + if (pipeline_iterator == m_baked_pipelines.end() ) { - current_pipeline_it++; - n_current_pipeline ++; + pipeline_iterator = m_outstanding_pipelines.find(in_pipeline_id); + + if (pipeline_iterator == m_outstanding_pipelines.end() ) + { + anvil_assert(!(pipeline_iterator == m_outstanding_pipelines.end() )); + + goto end; + } } - *out_pipeline_id_ptr = current_pipeline_it->first; - result = true; + pipeline_ptr = pipeline_iterator->second.get(); + result_ptr = pipeline_ptr->pipeline_info_ptr.get(); + end: - return result; + return result_ptr; } /* Please see header for specification */ std::shared_ptr Anvil::BasePipelineManager::get_pipeline_layout(PipelineID in_pipeline_id) { - std::shared_ptr pipeline_ptr; + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + Pipelines::iterator pipeline_iterator; + Pipeline* pipeline_ptr = nullptr; std::shared_ptr result_ptr; - if (m_pipelines.find(in_pipeline_id) == m_pipelines.end() ) + if (mutex_ptr != nullptr) { - anvil_assert(!(m_pipelines.find(in_pipeline_id) == m_pipelines.end()) ); - - goto end; + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); } - else + + pipeline_iterator = m_baked_pipelines.find(in_pipeline_id); + + if (pipeline_iterator == m_baked_pipelines.end() ) { - pipeline_ptr = m_pipelines.at(in_pipeline_id); + pipeline_iterator = m_outstanding_pipelines.find(in_pipeline_id); + + if (pipeline_iterator == m_outstanding_pipelines.end() ) + { + anvil_assert(!(pipeline_iterator == m_outstanding_pipelines.end() )); + + goto end; + } } - if (pipeline_ptr->is_proxy) + pipeline_ptr = pipeline_iterator->second.get(); + + if (pipeline_ptr->pipeline_info_ptr->is_proxy() ) { - anvil_assert(!pipeline_ptr->is_proxy); + anvil_assert(!pipeline_ptr->pipeline_info_ptr->is_proxy() ); goto end; } - if (pipeline_ptr->layout_dirty) + if (pipeline_ptr->layout_ptr == nullptr) { - pipeline_ptr->layout_ptr.reset(); - - if (!m_pipeline_layout_manager_ptr->get_layout(pipeline_ptr->dsg_ptr, - pipeline_ptr->push_constant_ranges, + if (!m_pipeline_layout_manager_ptr->get_layout(pipeline_ptr->pipeline_info_ptr->get_dsg (), + pipeline_ptr->pipeline_info_ptr->get_push_constant_ranges(), &pipeline_ptr->layout_ptr) ) { anvil_assert_fail(); @@ -565,7 +399,12 @@ std::shared_ptr Anvil::BasePipelineManager::get_pipeline_ goto end; } - pipeline_ptr->layout_dirty = false; + if (pipeline_ptr->layout_ptr == nullptr) + { + anvil_assert(!(pipeline_ptr->layout_ptr == nullptr) ); + + goto end; + } } result_ptr = pipeline_ptr->layout_ptr; @@ -575,61 +414,204 @@ std::shared_ptr Anvil::BasePipelineManager::get_pipeline_ } /* Please see header for specification */ -bool Anvil::BasePipelineManager::get_shader_stage_properties(PipelineID in_pipeline_id, - Anvil::ShaderStage in_shader_stage, - ShaderModuleStageEntryPoint* out_opt_result_ptr) const +bool Anvil::BasePipelineManager::get_shader_info(PipelineID in_pipeline_id, + Anvil::ShaderStage in_shader_stage, + Anvil::ShaderInfoType in_info_type, + std::vector* out_data_ptr) { - auto pipeline_iterator = m_pipelines.find(in_pipeline_id); - bool result = false; + std::shared_ptr device_ptr = m_device_ptr.lock();; + Anvil::ExtensionAMDShaderInfoEntrypoints entrypoints = device_ptr->get_extension_amd_shader_info_entrypoints(); + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + Pipelines::const_iterator pipeline_iterator; + Pipeline* pipeline_ptr = nullptr; + size_t out_data_size = out_data_ptr->size(); + bool result = false; + const VkShaderStageFlagBits shader_stage_vk = Anvil::Utils::get_shader_stage_flag_bits_from_shader_stage(in_shader_stage); + VkShaderInfoTypeAMD vk_info_type; + VkResult vk_result; + + if (entrypoints.vkGetShaderInfoAMD == nullptr) + { + anvil_assert(!(entrypoints.vkGetShaderInfoAMD == nullptr)); + + goto end; + } + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } + + if (m_outstanding_pipelines.size() > 0) + { + bake(); + } - if (pipeline_iterator == m_pipelines.end() ) + pipeline_iterator = m_baked_pipelines.find(in_pipeline_id); + if (pipeline_iterator == m_baked_pipelines.end()) { - anvil_assert(!(pipeline_iterator == m_pipelines.end()) ); + anvil_assert(!(pipeline_iterator == m_baked_pipelines.end())); goto end; } - for (const auto& current_stage : pipeline_iterator->second->shader_stages) + pipeline_ptr = pipeline_iterator->second.get(); + + if (pipeline_ptr->baked_pipeline == VK_NULL_HANDLE) { - if (current_stage.stage == in_shader_stage) + bake(); + + anvil_assert(!pipeline_ptr->baked_pipeline != VK_NULL_HANDLE); + } + + switch (in_info_type) + { + case SHADER_INFO_TYPE_BINARY: { - if (out_opt_result_ptr != nullptr) - { - *out_opt_result_ptr = current_stage; - } + vk_info_type = VK_SHADER_INFO_TYPE_BINARY_AMD; - result = true; + break; + } + + case SHADER_INFO_TYPE_DISASSEMBLY: + { + vk_info_type = VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD; break; } + + default: + { + anvil_assert(!"Unknown shader info type"); + + goto end; + } } - /* All done */ + if (out_data_size == 0) + { + vk_result = entrypoints.vkGetShaderInfoAMD( + device_ptr->get_device_vk(), + pipeline_ptr->baked_pipeline, + shader_stage_vk, + vk_info_type, + &out_data_size, + nullptr); + + if (vk_result == VK_ERROR_FEATURE_NOT_PRESENT) + { + goto end; + } + + if (!is_vk_call_successful(vk_result) || + out_data_size == 0) + { + goto end; + } + + out_data_ptr->resize(out_data_size); + } + + vk_result = entrypoints.vkGetShaderInfoAMD( + device_ptr->get_device_vk(), + pipeline_ptr->baked_pipeline, + shader_stage_vk, + vk_info_type, + &out_data_size, + &(*out_data_ptr).at(0)); + + if (vk_result == VK_ERROR_FEATURE_NOT_PRESENT) + { + goto end; + } + + if (!is_vk_call_successful(vk_result) || + out_data_size == 0) + { + goto end; + } + + result = true; end: return result; } /* Please see header for specification */ -bool Anvil::BasePipelineManager::set_pipeline_bakeability(PipelineID in_pipeline_id, - bool in_bakeable) +bool Anvil::BasePipelineManager::get_shader_statistics(PipelineID in_pipeline_id, + Anvil::ShaderStage in_shader_stage, + VkShaderStatisticsInfoAMD* out_shader_statistics_ptr) { - std::shared_ptr pipeline_ptr; - bool result = false; + std::shared_ptr device_ptr = m_device_ptr.lock(); + Anvil::ExtensionAMDShaderInfoEntrypoints entrypoints = device_ptr->get_extension_amd_shader_info_entrypoints(); + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + Pipelines::const_iterator pipeline_iterator; + Pipeline* pipeline_ptr = nullptr; + bool result = false; + const VkShaderStageFlagBits shader_stage_vk = Anvil::Utils::get_shader_stage_flag_bits_from_shader_stage(in_shader_stage); + size_t shader_statistics_size = sizeof(VkShaderStatisticsInfoAMD); + VkResult vk_result; - if (m_pipelines.find(in_pipeline_id) == m_pipelines.end() ) + if (entrypoints.vkGetShaderInfoAMD == nullptr) { - anvil_assert(!(m_pipelines.find(in_pipeline_id) == m_pipelines.end()) ); + anvil_assert(!(entrypoints.vkGetShaderInfoAMD == nullptr)); goto end; } - else + + if (mutex_ptr != nullptr) { - pipeline_ptr = m_pipelines.at(in_pipeline_id); + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); } - pipeline_ptr->is_bakeable = in_bakeable; + if (m_outstanding_pipelines.size() > 0) + { + bake(); + } + + pipeline_iterator = m_baked_pipelines.find(in_pipeline_id); + if (pipeline_iterator == m_baked_pipelines.end()) + { + anvil_assert(!(pipeline_iterator == m_baked_pipelines.end())); + + goto end; + } + + pipeline_ptr = pipeline_iterator->second.get(); + + if (pipeline_ptr->baked_pipeline == VK_NULL_HANDLE) + { + bake(); + + anvil_assert(!pipeline_ptr->baked_pipeline != VK_NULL_HANDLE); + } + + vk_result = entrypoints.vkGetShaderInfoAMD( + device_ptr->get_device_vk(), + pipeline_ptr->baked_pipeline, + shader_stage_vk, + VK_SHADER_INFO_TYPE_STATISTICS_AMD, + &shader_statistics_size, + out_shader_statistics_ptr); + + if (vk_result == VK_ERROR_FEATURE_NOT_PRESENT) + { + goto end; + } + + if (!is_vk_call_successful(vk_result) || + shader_statistics_size != sizeof(VkShaderStatisticsInfoAMD)) + { + goto end; + } result = true; + end: return result; } diff --git a/src/misc/compute_pipeline_info.cpp b/src/misc/compute_pipeline_info.cpp new file mode 100644 index 00000000..1ae93de5 --- /dev/null +++ b/src/misc/compute_pipeline_info.cpp @@ -0,0 +1,92 @@ +// +// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#include "misc/compute_pipeline_info.h" + +Anvil::ComputePipelineInfo::ComputePipelineInfo() +{ + /* Stub */ +} + +Anvil::ComputePipelineInfo::~ComputePipelineInfo() +{ + /* Stub */ +} + +std::unique_ptr Anvil::ComputePipelineInfo::create_derivative_pipeline_info(bool in_disable_optimizations, + bool in_allow_derivatives, + const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info, + Anvil::PipelineID in_base_pipeline_id) +{ + std::unique_ptr result_ptr; + + result_ptr.reset( + new ComputePipelineInfo() + ); + + if (result_ptr != nullptr) + { + result_ptr->init_derivative_pipeline_info(in_disable_optimizations, + in_allow_derivatives, + 1, /* in_n_shader_module_stage_entrypoints */ + &in_compute_shader_stage_entrypoint_info, + in_base_pipeline_id); + } + + return result_ptr; +} + +std::unique_ptr Anvil::ComputePipelineInfo::create_proxy_pipeline_info() +{ + std::unique_ptr result_ptr; + + result_ptr.reset( + new ComputePipelineInfo() + ); + + if (result_ptr != nullptr) + { + result_ptr->init_proxy_pipeline_info(); + } + + return result_ptr; +} + +std::unique_ptr Anvil::ComputePipelineInfo::create_regular_pipeline_info(bool in_disable_optimizations, + bool in_allow_derivatives, + const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info) +{ + std::unique_ptr result_ptr; + + result_ptr.reset( + new ComputePipelineInfo() + ); + + if (result_ptr != nullptr) + { + result_ptr->init_regular_pipeline_info(in_disable_optimizations, + in_allow_derivatives, + 1, /* in_n_shader_module_stage_entrypoints */ + &in_compute_shader_stage_entrypoint_info); + } + + return result_ptr; +} \ No newline at end of file diff --git a/src/misc/debug_marker.cpp b/src/misc/debug_marker.cpp index 4219f5ff..54f01d02 100644 --- a/src/misc/debug_marker.cpp +++ b/src/misc/debug_marker.cpp @@ -21,6 +21,7 @@ // #include "misc/debug_marker.h" +#include "misc/mt_safety.h" #include "wrappers/device.h" /** Please see header for specification */ @@ -61,8 +62,12 @@ void Anvil::DebugMarkerSupportProviderWorker::set_name_internal(const std::strin name_info.pObjectName = in_object_name.c_str(); name_info.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT; - result_vk = entrypoints.vkDebugMarkerSetObjectNameEXT(device_locked_ptr->get_device_vk(), - &name_info); + /* TODO: Host synchronization */ + { + result_vk = entrypoints.vkDebugMarkerSetObjectNameEXT(device_locked_ptr->get_device_vk(), + &name_info); + } + anvil_assert_vk_call_succeeded(result_vk); ANVIL_REDUNDANT_VARIABLE(result_vk); @@ -119,8 +124,12 @@ void Anvil::DebugMarkerSupportProviderWorker::set_tag_internal(const uint64_t in tag_info.tagName = m_object_tag_name; tag_info.tagSize = in_tag_size; - result_vk = entrypoints.vkDebugMarkerSetObjectTagEXT(device_locked_ptr->get_device_vk(), - &tag_info); + /* TODO: Host synchronization */ + { + result_vk = entrypoints.vkDebugMarkerSetObjectTagEXT(device_locked_ptr->get_device_vk(), + &tag_info); + } + anvil_assert_vk_call_succeeded(result_vk); ANVIL_REDUNDANT_VARIABLE(result_vk); diff --git a/src/misc/descriptor_set_info.cpp b/src/misc/descriptor_set_info.cpp new file mode 100644 index 00000000..a8ac8b0a --- /dev/null +++ b/src/misc/descriptor_set_info.cpp @@ -0,0 +1,145 @@ +// +// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#include "misc/descriptor_set_info.h" + +/** Please see header for specification */ +Anvil::DescriptorSetInfo::DescriptorSetInfo() +{ + /* Stub */ +} + +/** Please see header for specification */ +Anvil::DescriptorSetInfo::~DescriptorSetInfo() +{ + /* Stub */ +} + +/** Please see header for specification */ +bool Anvil::DescriptorSetInfo::add_binding(uint32_t in_binding_index, + VkDescriptorType in_descriptor_type, + uint32_t in_descriptor_array_size, + VkShaderStageFlags in_stage_flags, + const std::shared_ptr* in_immutable_sampler_ptrs) +{ + bool result = false; + + /* Make sure the binding is not already defined */ + if (m_bindings.find(in_binding_index) != m_bindings.end() ) + { + anvil_assert_fail(); + + goto end; + } + + /* Make sure the sampler array can actually be specified for this descriptor type. */ + if (in_immutable_sampler_ptrs != nullptr) + { + if (in_descriptor_type != VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER && + in_descriptor_type != VK_DESCRIPTOR_TYPE_SAMPLER) + { + anvil_assert_fail(); + + goto end; + } + } + + /* Add a new binding entry and mark the layout as dirty, so that it is re-baked next time + * the user calls the getter func */ + m_bindings[in_binding_index] = Binding(in_descriptor_array_size, + in_descriptor_type, + in_stage_flags, + in_immutable_sampler_ptrs); + + result = true; +end: + return result; +} + +/** Please see header for specification */ +std::unique_ptr Anvil::DescriptorSetInfo::create() +{ + std::unique_ptr result_ptr; + + result_ptr.reset( + new Anvil::DescriptorSetInfo() + ); + + return result_ptr; +} + +/** Please see header for specification */ +bool Anvil::DescriptorSetInfo::get_binding_properties(uint32_t in_n_binding, + uint32_t* out_opt_binding_index_ptr, + VkDescriptorType* out_opt_descriptor_type_ptr, + uint32_t* out_opt_descriptor_array_size_ptr, + VkShaderStageFlags* out_opt_stage_flags_ptr, + bool* out_opt_immutable_samplers_enabled_ptr) const +{ + auto binding_iterator = m_bindings.begin(); + bool result = false; + + if (m_bindings.size() <= in_n_binding) + { + goto end; + } + + for (uint32_t n_current_binding = 0; + n_current_binding < in_n_binding; + ++n_current_binding) + { + binding_iterator ++; + } + + if (binding_iterator != m_bindings.end() ) + { + if (out_opt_binding_index_ptr != nullptr) + { + *out_opt_binding_index_ptr = binding_iterator->first; + } + + if (out_opt_descriptor_array_size_ptr != nullptr) + { + *out_opt_descriptor_array_size_ptr = binding_iterator->second.descriptor_array_size; + } + + if (out_opt_descriptor_type_ptr != nullptr) + { + *out_opt_descriptor_type_ptr = binding_iterator->second.descriptor_type; + } + + if (out_opt_immutable_samplers_enabled_ptr != nullptr) + { + *out_opt_immutable_samplers_enabled_ptr = (binding_iterator->second.immutable_samplers.size() != 0); + } + + if (out_opt_stage_flags_ptr != nullptr) + { + *out_opt_stage_flags_ptr = binding_iterator->second.stage_flags; + } + + result = true; + } + +end: + return result; +} diff --git a/src/misc/dummy_window.cpp b/src/misc/dummy_window.cpp index 005730bf..f15ac42a 100644 --- a/src/misc/dummy_window.cpp +++ b/src/misc/dummy_window.cpp @@ -27,6 +27,7 @@ #include "wrappers/semaphore.h" #include "wrappers/swapchain.h" #include +#include #include "miniz/miniz.c" @@ -88,16 +89,24 @@ bool Anvil::DummyWindow::init() /* Please see header for specification */ void Anvil::DummyWindow::run() { - bool running = true; - - while (running && !m_window_should_close) + if (m_present_callback_func) { - if (m_present_callback_func) + bool running = true; + + while (running && !m_window_should_close) { m_present_callback_func(); - } - running = !m_window_should_close; + running = !m_window_should_close; + } + } + else + { + do + { + std::this_thread::sleep_for(std::chrono::milliseconds(30) ); + } + while (!m_window_should_close); } m_window_close_finished = true; @@ -175,7 +184,10 @@ std::shared_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain raw_image_size = 4 /* RGBA8 */ * swapchain_image_width * swapchain_image_height; - result_ptr.reset(new unsigned char[raw_image_size]); + result_ptr.reset( + new unsigned char[raw_image_size], + std::default_delete() + ); raw_image_buffer_ptr = Anvil::Buffer::create_nonsparse(device_locked_ptr, raw_image_size, @@ -183,7 +195,8 @@ std::shared_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain VK_SHARING_MODE_EXCLUSIVE, VK_BUFFER_USAGE_TRANSFER_DST_BIT, Anvil::MEMORY_FEATURE_FLAG_MAPPABLE, - nullptr); /* opt_client_data */ + nullptr, /* opt_client_data */ + MT_SAFETY_DISABLED); /* 2. Create the intermediate image */ VkImageBlit intermediate_image_blit; @@ -206,7 +219,8 @@ std::shared_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain 0, /* in_memory_features */ 0, /* in_create_flags */ VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, - nullptr); /* in_ mipmaps_ptr */ + nullptr, /* in_ mipmaps_ptr */ + MT_SAFETY_DISABLED); /* 3. Set up the command buffer */ std::shared_ptr command_buffer_ptr; diff --git a/src/misc/formats.cpp b/src/misc/formats.cpp index bca190e0..96efdb3d 100644 --- a/src/misc/formats.cpp +++ b/src/misc/formats.cpp @@ -262,6 +262,198 @@ static uint32_t layout_to_n_components[] = 2, }; +/** Please see header for specification */ +bool Anvil::Formats::get_compressed_format_block_size(VkFormat in_format, + uint32_t* out_block_size_uvec2_ptr, + uint32_t* out_n_bytes_per_block_ptr) +{ + bool result = true; + + switch (in_format) + { + case VK_FORMAT_ASTC_4x4_UNORM_BLOCK: + case VK_FORMAT_ASTC_4x4_SRGB_BLOCK: + case VK_FORMAT_BC2_UNORM_BLOCK: + case VK_FORMAT_BC2_SRGB_BLOCK: + case VK_FORMAT_BC3_UNORM_BLOCK: + case VK_FORMAT_BC3_SRGB_BLOCK: + case VK_FORMAT_BC5_UNORM_BLOCK: + case VK_FORMAT_BC5_SNORM_BLOCK: + case VK_FORMAT_BC6H_UFLOAT_BLOCK: + case VK_FORMAT_BC6H_SFLOAT_BLOCK: + case VK_FORMAT_BC7_UNORM_BLOCK: + case VK_FORMAT_BC7_SRGB_BLOCK: + case VK_FORMAT_EAC_R11G11_UNORM_BLOCK: + case VK_FORMAT_EAC_R11G11_SNORM_BLOCK: + case VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK: + case VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK: + { + out_block_size_uvec2_ptr[0] = 4; + out_block_size_uvec2_ptr[1] = 4; + *out_n_bytes_per_block_ptr = 128 / 8; + + break; + } + + case VK_FORMAT_BC1_RGB_UNORM_BLOCK: + case VK_FORMAT_BC1_RGB_SRGB_BLOCK: + case VK_FORMAT_BC1_RGBA_UNORM_BLOCK: + case VK_FORMAT_BC1_RGBA_SRGB_BLOCK: + case VK_FORMAT_BC4_UNORM_BLOCK: + case VK_FORMAT_BC4_SNORM_BLOCK: + case VK_FORMAT_EAC_R11_UNORM_BLOCK: + case VK_FORMAT_EAC_R11_SNORM_BLOCK: + case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK: + case VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK: + case VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK: + case VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK: + { + out_block_size_uvec2_ptr[0] = 4; + out_block_size_uvec2_ptr[1] = 4; + *out_n_bytes_per_block_ptr = 64 / 8; + + break; + } + + case VK_FORMAT_ASTC_5x4_UNORM_BLOCK: + case VK_FORMAT_ASTC_5x4_SRGB_BLOCK: + { + out_block_size_uvec2_ptr[0] = 5; + out_block_size_uvec2_ptr[1] = 4; + *out_n_bytes_per_block_ptr = 128 / 8; + + break; + } + + case VK_FORMAT_ASTC_5x5_UNORM_BLOCK: + case VK_FORMAT_ASTC_5x5_SRGB_BLOCK: + { + out_block_size_uvec2_ptr[0] = 5; + out_block_size_uvec2_ptr[1] = 5; + *out_n_bytes_per_block_ptr = 128 / 8; + + break; + } + + case VK_FORMAT_ASTC_6x5_UNORM_BLOCK: + case VK_FORMAT_ASTC_6x5_SRGB_BLOCK: + { + out_block_size_uvec2_ptr[0] = 6; + out_block_size_uvec2_ptr[1] = 5; + *out_n_bytes_per_block_ptr = 128 / 8; + + break; + } + + case VK_FORMAT_ASTC_6x6_UNORM_BLOCK: + case VK_FORMAT_ASTC_6x6_SRGB_BLOCK: + { + out_block_size_uvec2_ptr[0] = 6; + out_block_size_uvec2_ptr[1] = 6; + *out_n_bytes_per_block_ptr = 128 / 8; + + break; + } + + case VK_FORMAT_ASTC_8x5_UNORM_BLOCK: + case VK_FORMAT_ASTC_8x5_SRGB_BLOCK: + { + out_block_size_uvec2_ptr[0] = 8; + out_block_size_uvec2_ptr[1] = 5; + *out_n_bytes_per_block_ptr = 128 / 8; + + break; + } + + case VK_FORMAT_ASTC_8x6_UNORM_BLOCK: + case VK_FORMAT_ASTC_8x6_SRGB_BLOCK: + { + out_block_size_uvec2_ptr[0] = 8; + out_block_size_uvec2_ptr[1] = 6; + *out_n_bytes_per_block_ptr = 128 / 8; + + break; + } + + case VK_FORMAT_ASTC_8x8_UNORM_BLOCK: + case VK_FORMAT_ASTC_8x8_SRGB_BLOCK: + { + out_block_size_uvec2_ptr[0] = 8; + out_block_size_uvec2_ptr[1] = 8; + *out_n_bytes_per_block_ptr = 128 / 8; + + break; + } + + case VK_FORMAT_ASTC_10x5_UNORM_BLOCK: + case VK_FORMAT_ASTC_10x5_SRGB_BLOCK: + { + out_block_size_uvec2_ptr[0] = 10; + out_block_size_uvec2_ptr[1] = 5; + *out_n_bytes_per_block_ptr = 128 / 8; + + break; + } + + case VK_FORMAT_ASTC_10x6_UNORM_BLOCK: + case VK_FORMAT_ASTC_10x6_SRGB_BLOCK: + { + out_block_size_uvec2_ptr[0] = 10; + out_block_size_uvec2_ptr[1] = 6; + *out_n_bytes_per_block_ptr = 128 / 8; + + break; + } + + case VK_FORMAT_ASTC_10x8_UNORM_BLOCK: + case VK_FORMAT_ASTC_10x8_SRGB_BLOCK: + { + out_block_size_uvec2_ptr[0] = 10; + out_block_size_uvec2_ptr[1] = 8; + *out_n_bytes_per_block_ptr = 128 / 8; + + break; + } + + case VK_FORMAT_ASTC_10x10_UNORM_BLOCK: + case VK_FORMAT_ASTC_10x10_SRGB_BLOCK: + { + out_block_size_uvec2_ptr[0] = 10; + out_block_size_uvec2_ptr[1] = 10; + *out_n_bytes_per_block_ptr = 128 / 8; + + break; + } + + case VK_FORMAT_ASTC_12x10_UNORM_BLOCK: + case VK_FORMAT_ASTC_12x10_SRGB_BLOCK: + { + out_block_size_uvec2_ptr[0] = 12; + out_block_size_uvec2_ptr[1] = 10; + *out_n_bytes_per_block_ptr = 128 / 8; + + break; + } + + case VK_FORMAT_ASTC_12x12_UNORM_BLOCK: + case VK_FORMAT_ASTC_12x12_SRGB_BLOCK: + { + out_block_size_uvec2_ptr[0] = 12; + out_block_size_uvec2_ptr[1] = 12; + *out_n_bytes_per_block_ptr = 128 / 8; + + break; + } + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + /** Please see header for specification */ VkFormat Anvil::Formats::get_format(ComponentLayout in_component_layout, FormatType in_format_type, @@ -333,7 +525,6 @@ bool Anvil::Formats::get_format_aspects(VkFormat in_form } result = true; - return result; } @@ -392,6 +583,21 @@ Anvil::FormatType Anvil::Formats::get_format_type(VkFormat in_format) return formats[in_format].format_type; } +/** Please see header for specification */ +bool Anvil::Formats::has_depth_aspect(VkFormat in_format) +{ + return (formats[in_format].component_layout == Anvil::COMPONENT_LAYOUT_D) || + (formats[in_format].component_layout == Anvil::COMPONENT_LAYOUT_DS) || + (formats[in_format].component_layout == Anvil::COMPONENT_LAYOUT_XD); +} + +/** Please see header for specification */ +bool Anvil::Formats::has_stencil_aspect(VkFormat in_format) +{ + return (formats[in_format].component_layout == Anvil::COMPONENT_LAYOUT_S) || + (formats[in_format].component_layout == Anvil::COMPONENT_LAYOUT_DS); +} + /** Please see header for specification */ bool Anvil::Formats::is_format_compressed(VkFormat in_format) { diff --git a/src/misc/glsl_to_spirv.cpp b/src/misc/glsl_to_spirv.cpp index 1d60cb7e..7980df36 100644 --- a/src/misc/glsl_to_spirv.cpp +++ b/src/misc/glsl_to_spirv.cpp @@ -249,7 +249,6 @@ Anvil::GLSLShaderToSPIRVGenerator::GLSLShaderToSPIRVGenerator(std::weak_ptr in_renderpass_ptr, + SubPassID in_subpass_id) +{ + m_alpha_to_coverage_enabled = false; + m_alpha_to_one_enabled = false; + m_depth_bias_clamp = 0.0f; + m_depth_bias_constant_factor = 0.0f; + m_depth_bias_enabled = false; + m_depth_bias_slope_factor = 1.0f; + m_depth_bounds_test_enabled = false; + m_depth_clamp_enabled = false; + m_depth_test_compare_op = VK_COMPARE_OP_ALWAYS; + m_depth_test_enabled = false; + m_depth_writes_enabled = false; + m_enabled_dynamic_states = 0; + m_front_face = VK_FRONT_FACE_COUNTER_CLOCKWISE; + m_logic_op = VK_LOGIC_OP_NO_OP; + m_logic_op_enabled = false; + m_max_depth_bounds = 1.0f; + m_min_depth_bounds = 0.0f; + m_n_dynamic_scissor_boxes = 0; + m_n_dynamic_viewports = 0; + m_n_patch_control_points = 1; + m_primitive_restart_enabled = false; + m_rasterizer_discard_enabled = false; + m_sample_mask_enabled = false; + m_sample_shading_enabled = false; + m_stencil_test_enabled = false; + + m_renderpass_ptr = in_renderpass_ptr; + m_subpass_id = in_subpass_id; + + m_stencil_state_back_face.compareMask = ~0u; + m_stencil_state_back_face.compareOp = VK_COMPARE_OP_ALWAYS; + m_stencil_state_back_face.depthFailOp = VK_STENCIL_OP_KEEP; + m_stencil_state_back_face.failOp = VK_STENCIL_OP_KEEP; + m_stencil_state_back_face.passOp = VK_STENCIL_OP_KEEP; + m_stencil_state_back_face.reference = 0; + m_stencil_state_back_face.writeMask = ~0u; + m_stencil_state_front_face = m_stencil_state_back_face; + + m_rasterization_order = VK_RASTERIZATION_ORDER_STRICT_AMD; + + memset(m_blend_constant, + 0, + sizeof(m_blend_constant) ); + + m_cull_mode = VK_CULL_MODE_BACK_BIT; + m_line_width = 1.0f; + m_min_sample_shading = 1.0f; + m_sample_count = VK_SAMPLE_COUNT_1_BIT; + m_polygon_mode = VK_POLYGON_MODE_FILL; + m_primitive_topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; + m_sample_mask = ~0u; +} + +Anvil::GraphicsPipelineInfo::~GraphicsPipelineInfo() +{ + /* Stub */ +} + +bool Anvil::GraphicsPipelineInfo::add_vertex_attribute(uint32_t in_location, + VkFormat in_format, + uint32_t in_offset_in_bytes, + uint32_t in_stride_in_bytes, + VkVertexInputRate in_step_rate, + uint32_t in_explicit_binding_index) +{ + bool result = false; + + #ifdef _DEBUG + { + /* Make sure the location is not already referred to by already added attributes */ + for (auto attribute_iterator = m_attributes.cbegin(); + attribute_iterator != m_attributes.cend(); + ++attribute_iterator) + { + anvil_assert(attribute_iterator->location != in_location); + } + + /* If an explicit binding has been requested for the new attribute, we need to make sure that any user-specified attributes + * that refer to this binding specify the same stride and input rate. */ + if (in_explicit_binding_index != UINT32_MAX) + { + for (auto attribute_iterator = m_attributes.cbegin(); + attribute_iterator != m_attributes.cend(); + ++attribute_iterator) + { + const auto& current_attribute = *attribute_iterator; + + if (current_attribute.explicit_binding_index == in_explicit_binding_index) + { + anvil_assert(current_attribute.rate == in_step_rate); + anvil_assert(current_attribute.stride_in_bytes == in_stride_in_bytes); + } + } + } + } + #endif + + /* Add a new vertex attribute descriptor. At this point, we do not differentiate between + * attributes and bindings. Actual Vulkan attributes and bindings will be created at baking + * time. */ + m_attributes.push_back( + InternalVertexAttribute( + in_explicit_binding_index, + in_format, + in_location, + in_offset_in_bytes, + in_step_rate, + in_stride_in_bytes) + ); + + /* All done */ + result = true; + + return result; +} + +bool Anvil::GraphicsPipelineInfo::are_depth_writes_enabled() const +{ + return m_depth_writes_enabled; +} + +bool Anvil::GraphicsPipelineInfo::copy_gfx_state_from(const Anvil::GraphicsPipelineInfo* in_src_pipeline_info_ptr) +{ + bool result = false; + + if (in_src_pipeline_info_ptr == nullptr) + { + anvil_assert(in_src_pipeline_info_ptr != nullptr); + + goto end; + } + + /* GFX pipeline info-level data */ + m_max_depth_bounds = in_src_pipeline_info_ptr->m_max_depth_bounds; + m_min_depth_bounds = in_src_pipeline_info_ptr->m_min_depth_bounds; + + m_depth_bias_enabled = in_src_pipeline_info_ptr->m_depth_bias_enabled; + m_depth_bias_clamp = in_src_pipeline_info_ptr->m_depth_bias_clamp; + m_depth_bias_constant_factor = in_src_pipeline_info_ptr->m_depth_bias_constant_factor; + m_depth_bias_slope_factor = in_src_pipeline_info_ptr->m_depth_bias_slope_factor; + m_depth_test_enabled = in_src_pipeline_info_ptr->m_depth_test_enabled; + m_depth_test_compare_op = in_src_pipeline_info_ptr->m_depth_test_compare_op; + + m_enabled_dynamic_states = in_src_pipeline_info_ptr->m_enabled_dynamic_states; + + m_alpha_to_coverage_enabled = in_src_pipeline_info_ptr->m_alpha_to_coverage_enabled; + m_alpha_to_one_enabled = in_src_pipeline_info_ptr->m_alpha_to_one_enabled; + m_depth_clamp_enabled = in_src_pipeline_info_ptr->m_depth_clamp_enabled; + m_depth_writes_enabled = in_src_pipeline_info_ptr->m_depth_writes_enabled; + m_logic_op_enabled = in_src_pipeline_info_ptr->m_logic_op_enabled; + m_primitive_restart_enabled = in_src_pipeline_info_ptr->m_primitive_restart_enabled; + m_rasterizer_discard_enabled = in_src_pipeline_info_ptr->m_rasterizer_discard_enabled; + m_sample_mask_enabled = in_src_pipeline_info_ptr->m_sample_mask_enabled; + m_sample_shading_enabled = in_src_pipeline_info_ptr->m_sample_shading_enabled; + + m_stencil_test_enabled = in_src_pipeline_info_ptr->m_stencil_test_enabled; + m_stencil_state_back_face = in_src_pipeline_info_ptr->m_stencil_state_back_face; + m_stencil_state_front_face = in_src_pipeline_info_ptr->m_stencil_state_front_face; + + m_rasterization_order = in_src_pipeline_info_ptr->m_rasterization_order; + + m_attributes = in_src_pipeline_info_ptr->m_attributes; + m_blend_constant[0] = in_src_pipeline_info_ptr->m_blend_constant[0]; + m_blend_constant[1] = in_src_pipeline_info_ptr->m_blend_constant[1]; + m_blend_constant[2] = in_src_pipeline_info_ptr->m_blend_constant[2]; + m_blend_constant[3] = in_src_pipeline_info_ptr->m_blend_constant[3]; + m_polygon_mode = in_src_pipeline_info_ptr->m_polygon_mode; + m_front_face = in_src_pipeline_info_ptr->m_front_face; + m_line_width = in_src_pipeline_info_ptr->m_line_width; + m_logic_op = in_src_pipeline_info_ptr->m_logic_op; + m_min_sample_shading = in_src_pipeline_info_ptr->m_min_sample_shading; + m_n_dynamic_scissor_boxes = in_src_pipeline_info_ptr->m_n_dynamic_scissor_boxes; + m_n_dynamic_viewports = in_src_pipeline_info_ptr->m_n_dynamic_viewports; + m_n_patch_control_points = in_src_pipeline_info_ptr->m_n_patch_control_points; + m_primitive_topology = in_src_pipeline_info_ptr->m_primitive_topology; + m_sample_mask = in_src_pipeline_info_ptr->m_sample_mask; + m_scissor_boxes = in_src_pipeline_info_ptr->m_scissor_boxes; + m_subpass_attachment_blending_properties = in_src_pipeline_info_ptr->m_subpass_attachment_blending_properties; + m_viewports = in_src_pipeline_info_ptr->m_viewports; + + m_cull_mode = in_src_pipeline_info_ptr->m_cull_mode; + m_sample_count = in_src_pipeline_info_ptr->m_sample_count; + + BasePipelineInfo::copy_state_from(in_src_pipeline_info_ptr); + + result = true; +end: + return result; +} + +std::unique_ptr Anvil::GraphicsPipelineInfo::create_derivative_pipeline_info(bool in_disable_optimizations, + bool in_allow_derivatives, + std::shared_ptr in_renderpass_ptr, + SubPassID in_subpass_id, + const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, + Anvil::PipelineID in_base_pipeline_id) +{ + std::unique_ptr result_ptr; + + result_ptr.reset( + new GraphicsPipelineInfo(in_renderpass_ptr, + in_subpass_id) + ); + + if (result_ptr != nullptr) + { + const ShaderModuleStageEntryPoint stages[] = + { + in_fragment_shader_stage_entrypoint_info, + in_geometry_shader_stage_entrypoint_info, + in_tess_control_shader_stage_entrypoint_info, + in_tess_evaluation_shader_stage_entrypoint_info, + in_vertex_shader_shader_stage_entrypoint_info + }; + + result_ptr->init_derivative_pipeline_info(in_disable_optimizations, + in_allow_derivatives, + sizeof(stages) / sizeof(stages[0]), + stages, + in_base_pipeline_id); + } + + return result_ptr; +} + +std::unique_ptr Anvil::GraphicsPipelineInfo::create_proxy_pipeline_info() +{ + std::unique_ptr result_ptr; + + result_ptr.reset( + new GraphicsPipelineInfo(std::shared_ptr(), + UINT32_MAX) + ); + + if (result_ptr != nullptr) + { + result_ptr->init_proxy_pipeline_info(); + } + + return result_ptr; +} + +std::unique_ptr Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(bool in_disable_optimizations, + bool in_allow_derivatives, + std::shared_ptr in_renderpass_ptr, + SubPassID in_subpass_id, + const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, + const Anvil::GraphicsPipelineInfo* in_opt_reference_pipeline_info_ptr) +{ + std::unique_ptr result_ptr; + + result_ptr.reset( + new GraphicsPipelineInfo(in_renderpass_ptr, + in_subpass_id) + ); + + if (result_ptr != nullptr) + { + const ShaderModuleStageEntryPoint stages[] = + { + in_fragment_shader_stage_entrypoint_info, + in_geometry_shader_stage_entrypoint_info, + in_tess_control_shader_stage_entrypoint_info, + in_tess_evaluation_shader_stage_entrypoint_info, + in_vertex_shader_shader_stage_entrypoint_info + }; + + if (in_opt_reference_pipeline_info_ptr != nullptr) + { + if (!result_ptr->copy_gfx_state_from(in_opt_reference_pipeline_info_ptr) ) + { + anvil_assert_fail(); + + result_ptr.reset(); + } + } + + result_ptr->init_regular_pipeline_info(in_disable_optimizations, + in_allow_derivatives, + sizeof(stages) / sizeof(stages[0]), + stages); + } + + return result_ptr; +} + +void Anvil::GraphicsPipelineInfo::get_blending_properties(const float** out_opt_blend_constant_vec4_ptr_ptr, + uint32_t* out_opt_n_blend_attachments_ptr) const +{ + if (out_opt_blend_constant_vec4_ptr_ptr != nullptr) + { + *out_opt_blend_constant_vec4_ptr_ptr = m_blend_constant; + } + + if (out_opt_n_blend_attachments_ptr != nullptr) + { + *out_opt_n_blend_attachments_ptr = static_cast(m_subpass_attachment_blending_properties.size() ); + } +} + +bool Anvil::GraphicsPipelineInfo::get_color_blend_attachment_properties(SubPassAttachmentID in_attachment_id, + bool* out_opt_blending_enabled_ptr, + VkBlendOp* out_opt_blend_op_color_ptr, + VkBlendOp* out_opt_blend_op_alpha_ptr, + VkBlendFactor* out_opt_src_color_blend_factor_ptr, + VkBlendFactor* out_opt_dst_color_blend_factor_ptr, + VkBlendFactor* out_opt_src_alpha_blend_factor_ptr, + VkBlendFactor* out_opt_dst_alpha_blend_factor_ptr, + VkColorComponentFlags* out_opt_channel_write_mask_ptr) const +{ + SubPassAttachmentToBlendingPropertiesMap::const_iterator props_iterator; + bool result = false; + + props_iterator = m_subpass_attachment_blending_properties.find(in_attachment_id); + + if (props_iterator == m_subpass_attachment_blending_properties.end() ) + { + goto end; + } + + if (out_opt_blending_enabled_ptr != nullptr) + { + *out_opt_blending_enabled_ptr = props_iterator->second.blend_enabled; + } + + if (out_opt_blend_op_color_ptr != nullptr) + { + *out_opt_blend_op_color_ptr = props_iterator->second.blend_op_color; + } + + if (out_opt_blend_op_alpha_ptr != nullptr) + { + *out_opt_blend_op_alpha_ptr = props_iterator->second.blend_op_alpha; + } + + if (out_opt_src_color_blend_factor_ptr != nullptr) + { + *out_opt_src_color_blend_factor_ptr = props_iterator->second.src_color_blend_factor; + } + + if (out_opt_dst_color_blend_factor_ptr != nullptr) + { + *out_opt_dst_color_blend_factor_ptr = props_iterator->second.dst_color_blend_factor; + } + + if (out_opt_src_alpha_blend_factor_ptr != nullptr) + { + *out_opt_src_alpha_blend_factor_ptr = props_iterator->second.src_alpha_blend_factor; + } + + if (out_opt_dst_alpha_blend_factor_ptr != nullptr) + { + *out_opt_dst_alpha_blend_factor_ptr = props_iterator->second.dst_alpha_blend_factor; + } + + if (out_opt_channel_write_mask_ptr != nullptr) + { + *out_opt_channel_write_mask_ptr = props_iterator->second.channel_write_mask; + } + + result = true; +end: + return result; +} + +void Anvil::GraphicsPipelineInfo::get_depth_bias_state(bool* out_opt_is_enabled_ptr, + float* out_opt_depth_bias_constant_factor_ptr, + float* out_opt_depth_bias_clamp_ptr, + float* out_opt_depth_bias_slope_factor_ptr) const +{ + + if (out_opt_is_enabled_ptr != nullptr) + { + *out_opt_is_enabled_ptr = m_depth_bias_enabled; + } + + if (out_opt_depth_bias_constant_factor_ptr != nullptr) + { + *out_opt_depth_bias_constant_factor_ptr = m_depth_bias_constant_factor; + } + + if (out_opt_depth_bias_clamp_ptr != nullptr) + { + *out_opt_depth_bias_clamp_ptr = m_depth_bias_clamp; + } + + if (out_opt_depth_bias_slope_factor_ptr != nullptr) + { + *out_opt_depth_bias_slope_factor_ptr = m_depth_bias_slope_factor; + } +} + +void Anvil::GraphicsPipelineInfo::get_depth_bounds_state(bool* out_opt_is_enabled_ptr, + float* out_opt_min_depth_bounds_ptr, + float* out_opt_max_depth_bounds_ptr) const +{ + if (out_opt_is_enabled_ptr != nullptr) + { + *out_opt_is_enabled_ptr = m_depth_bounds_test_enabled; + } + + if (out_opt_min_depth_bounds_ptr != nullptr) + { + *out_opt_min_depth_bounds_ptr = m_min_depth_bounds; + } + + if (out_opt_max_depth_bounds_ptr != nullptr) + { + *out_opt_max_depth_bounds_ptr = m_max_depth_bounds; + } +} + +void Anvil::GraphicsPipelineInfo::get_depth_test_state(bool* out_opt_is_enabled_ptr, + VkCompareOp* out_opt_compare_op_ptr) const +{ + if (out_opt_is_enabled_ptr != nullptr) + { + *out_opt_is_enabled_ptr = m_depth_test_enabled; + } + + if (out_opt_compare_op_ptr != nullptr) + { + *out_opt_compare_op_ptr = m_depth_test_compare_op; + } +} + +Anvil::DynamicStateBitfield Anvil::GraphicsPipelineInfo::get_enabled_dynamic_states() const +{ + return m_enabled_dynamic_states; +} + +void Anvil::GraphicsPipelineInfo::get_graphics_pipeline_properties(uint32_t* out_opt_n_scissors_ptr, + uint32_t* out_opt_n_viewports_ptr, + uint32_t* out_opt_n_vertex_attributes_ptr, + std::shared_ptr* out_opt_renderpass_ptr, + SubPassID* out_opt_subpass_id_ptr) const +{ + if (out_opt_n_scissors_ptr != nullptr) + { + *out_opt_n_scissors_ptr = static_cast(m_scissor_boxes.size() ); + } + + if (out_opt_n_viewports_ptr != nullptr) + { + *out_opt_n_viewports_ptr = static_cast(m_viewports.size() ); + } + + if (out_opt_n_vertex_attributes_ptr != nullptr) + { + *out_opt_n_vertex_attributes_ptr = static_cast(m_attributes.size() ); + } + + if (out_opt_renderpass_ptr != nullptr) + { + *out_opt_renderpass_ptr = m_renderpass_ptr; + } + + if (out_opt_subpass_id_ptr != nullptr) + { + *out_opt_subpass_id_ptr = m_subpass_id; + } +} + +void Anvil::GraphicsPipelineInfo::get_logic_op_state(bool* out_opt_is_enabled_ptr, + VkLogicOp* out_opt_logic_op_ptr) const +{ + if (out_opt_is_enabled_ptr != nullptr) + { + *out_opt_is_enabled_ptr = m_logic_op_enabled; + } + + if (out_opt_logic_op_ptr != nullptr) + { + *out_opt_logic_op_ptr = m_logic_op; + } +} + +void Anvil::GraphicsPipelineInfo::get_multisampling_properties(VkSampleCountFlags* out_opt_sample_count_ptr, + VkSampleMask* out_opt_sample_mask_ptr) const +{ + if (out_opt_sample_count_ptr != nullptr) + { + *out_opt_sample_count_ptr = m_sample_count; + } + + if (out_opt_sample_mask_ptr != nullptr) + { + *out_opt_sample_mask_ptr = m_sample_mask; + } +} + +uint32_t Anvil::GraphicsPipelineInfo::get_n_dynamic_scissor_boxes() const +{ + return m_n_dynamic_scissor_boxes; +} + +uint32_t Anvil::GraphicsPipelineInfo::get_n_dynamic_viewports() const +{ + return m_n_dynamic_viewports; +} + +uint32_t Anvil::GraphicsPipelineInfo::get_n_scissor_boxes() const +{ + return static_cast(m_scissor_boxes.size() ); +} + +uint32_t Anvil::GraphicsPipelineInfo::get_n_viewports() const +{ + return static_cast(m_viewports.size() ); +} + +VkPrimitiveTopology Anvil::GraphicsPipelineInfo::get_primitive_topology() const +{ + return m_primitive_topology; +} + +VkRasterizationOrderAMD Anvil::GraphicsPipelineInfo::get_rasterization_order() const +{ + return m_rasterization_order; +} + +void Anvil::GraphicsPipelineInfo::get_rasterization_properties(VkPolygonMode* out_opt_polygon_mode_ptr, + VkCullModeFlags* out_opt_cull_mode_ptr, + VkFrontFace* out_opt_front_face_ptr, + float* out_opt_line_width_ptr) const +{ + if (out_opt_polygon_mode_ptr != nullptr) + { + *out_opt_polygon_mode_ptr = m_polygon_mode; + } + + if (out_opt_cull_mode_ptr != nullptr) + { + *out_opt_cull_mode_ptr = m_cull_mode; + } + + if (out_opt_front_face_ptr != nullptr) + { + *out_opt_front_face_ptr = m_front_face; + } + + if (out_opt_line_width_ptr != nullptr) + { + *out_opt_line_width_ptr = m_line_width; + } +} + +void Anvil::GraphicsPipelineInfo::get_sample_shading_state(bool* out_opt_is_enabled_ptr, + float* out_opt_min_sample_shading_ptr) const +{ + if (out_opt_is_enabled_ptr != nullptr) + { + *out_opt_is_enabled_ptr = m_sample_shading_enabled; + } + + if (out_opt_min_sample_shading_ptr != nullptr) + { + *out_opt_min_sample_shading_ptr = m_min_sample_shading; + } +} + +bool Anvil::GraphicsPipelineInfo::get_scissor_box_properties(uint32_t in_n_scissor_box, + int32_t* out_opt_x_ptr, + int32_t* out_opt_y_ptr, + uint32_t* out_opt_width_ptr, + uint32_t* out_opt_height_ptr) const +{ + bool result = false; + const InternalScissorBox* scissor_box_props_ptr = nullptr; + + if (m_scissor_boxes.find(in_n_scissor_box) == m_scissor_boxes.end() ) + { + anvil_assert(!(m_scissor_boxes.find(in_n_scissor_box) == m_scissor_boxes.end()) ); + + goto end; + } + else + { + scissor_box_props_ptr = &m_scissor_boxes.at(in_n_scissor_box); + } + + if (out_opt_x_ptr != nullptr) + { + *out_opt_x_ptr = scissor_box_props_ptr->x; + } + + if (out_opt_y_ptr != nullptr) + { + *out_opt_y_ptr = scissor_box_props_ptr->y; + } + + if (out_opt_width_ptr != nullptr) + { + *out_opt_width_ptr = scissor_box_props_ptr->width; + } + + if (out_opt_height_ptr != nullptr) + { + *out_opt_height_ptr = scissor_box_props_ptr->height; + } + + result = true; +end: + return result; +} + +void Anvil::GraphicsPipelineInfo::get_stencil_test_properties(bool* out_opt_is_enabled_ptr, + VkStencilOp* out_opt_front_stencil_fail_op_ptr, + VkStencilOp* out_opt_front_stencil_pass_op_ptr, + VkStencilOp* out_opt_front_stencil_depth_fail_op_ptr, + VkCompareOp* out_opt_front_stencil_compare_op_ptr, + uint32_t* out_opt_front_stencil_compare_mask_ptr, + uint32_t* out_opt_front_stencil_write_mask_ptr, + uint32_t* out_opt_front_stencil_reference_ptr, + VkStencilOp* out_opt_back_stencil_fail_op_ptr, + VkStencilOp* out_opt_back_stencil_pass_op_ptr, + VkStencilOp* out_opt_back_stencil_depth_fail_op_ptr, + VkCompareOp* out_opt_back_stencil_compare_op_ptr, + uint32_t* out_opt_back_stencil_compare_mask_ptr, + uint32_t* out_opt_back_stencil_write_mask_ptr, + uint32_t* out_opt_back_stencil_reference_ptr) const +{ + if (out_opt_is_enabled_ptr != nullptr) + { + *out_opt_is_enabled_ptr = m_stencil_test_enabled; + } + + if (out_opt_front_stencil_fail_op_ptr != nullptr) + { + *out_opt_front_stencil_fail_op_ptr = m_stencil_state_front_face.failOp; + } + + if (out_opt_front_stencil_pass_op_ptr != nullptr) + { + *out_opt_front_stencil_pass_op_ptr = m_stencil_state_front_face.passOp; + } + + if (out_opt_front_stencil_depth_fail_op_ptr != nullptr) + { + *out_opt_front_stencil_depth_fail_op_ptr = m_stencil_state_front_face.depthFailOp; + } + + if (out_opt_front_stencil_compare_op_ptr != nullptr) + { + *out_opt_front_stencil_compare_op_ptr = m_stencil_state_front_face.compareOp; + } + + if (out_opt_front_stencil_compare_mask_ptr != nullptr) + { + *out_opt_front_stencil_compare_mask_ptr = m_stencil_state_front_face.compareMask; + } + + if (out_opt_front_stencil_write_mask_ptr != nullptr) + { + *out_opt_front_stencil_write_mask_ptr = m_stencil_state_front_face.writeMask; + } + + if (out_opt_front_stencil_reference_ptr != nullptr) + { + *out_opt_front_stencil_reference_ptr = m_stencil_state_front_face.reference; + } + + if (out_opt_back_stencil_fail_op_ptr != nullptr) + { + *out_opt_back_stencil_fail_op_ptr = m_stencil_state_back_face.failOp; + } + + if (out_opt_back_stencil_pass_op_ptr != nullptr) + { + *out_opt_back_stencil_pass_op_ptr = m_stencil_state_back_face.passOp; + } + + if (out_opt_back_stencil_depth_fail_op_ptr != nullptr) + { + *out_opt_back_stencil_depth_fail_op_ptr = m_stencil_state_back_face.depthFailOp; + } + + if (out_opt_back_stencil_compare_op_ptr != nullptr) + { + *out_opt_back_stencil_compare_op_ptr = m_stencil_state_back_face.compareOp; + } + + if (out_opt_back_stencil_compare_mask_ptr != nullptr) + { + *out_opt_back_stencil_compare_mask_ptr = m_stencil_state_back_face.compareMask; + } + + if (out_opt_back_stencil_write_mask_ptr != nullptr) + { + *out_opt_back_stencil_write_mask_ptr = m_stencil_state_back_face.writeMask; + } + + if (out_opt_back_stencil_reference_ptr != nullptr) + { + *out_opt_back_stencil_reference_ptr = m_stencil_state_back_face.reference; + } +} + +uint32_t Anvil::GraphicsPipelineInfo::get_n_patch_control_points() const +{ + return m_n_patch_control_points; +} + +bool Anvil::GraphicsPipelineInfo::get_vertex_attribute_properties(uint32_t in_n_vertex_input_attribute, + uint32_t* out_opt_location_ptr, + VkFormat* out_opt_format_ptr, + uint32_t* out_opt_offset_ptr, + uint32_t* out_opt_explicit_vertex_binding_index_ptr, + uint32_t* out_opt_stride_ptr, + VkVertexInputRate* out_opt_rate_ptr) const +{ + const InternalVertexAttribute* attribute_ptr = nullptr; + bool result = false; + + if (m_attributes.size() < in_n_vertex_input_attribute) + { + goto end; + } + else + { + attribute_ptr = &m_attributes.at(in_n_vertex_input_attribute); + } + + if (out_opt_location_ptr != nullptr) + { + *out_opt_location_ptr = attribute_ptr->location; + } + + if (out_opt_format_ptr != nullptr) + { + *out_opt_format_ptr = attribute_ptr->format; + } + + if (out_opt_offset_ptr != nullptr) + { + *out_opt_offset_ptr = attribute_ptr->offset_in_bytes; + } + + if (out_opt_explicit_vertex_binding_index_ptr != nullptr) + { + *out_opt_explicit_vertex_binding_index_ptr = attribute_ptr->explicit_binding_index; + } + + if (out_opt_stride_ptr != nullptr) + { + *out_opt_stride_ptr = attribute_ptr->stride_in_bytes; + } + + if (out_opt_rate_ptr != nullptr) + { + *out_opt_rate_ptr = attribute_ptr->rate; + } + + /* All done */ + result = true; +end: + return result; +} + +bool Anvil::GraphicsPipelineInfo::get_viewport_properties(uint32_t in_n_viewport, + float* out_opt_origin_x_ptr, + float* out_opt_origin_y_ptr, + float* out_opt_width_ptr, + float* out_opt_height_ptr, + float* out_opt_min_depth_ptr, + float* out_opt_max_depth_ptr) const +{ + bool result = false; + const InternalViewport* viewport_props_ptr; + + if (m_viewports.find(in_n_viewport) == m_viewports.end() ) + { + anvil_assert(!(m_viewports.find(in_n_viewport) == m_viewports.end()) ); + + goto end; + } + else + { + viewport_props_ptr = &m_viewports.at(in_n_viewport); + } + + if (out_opt_origin_x_ptr != nullptr) + { + *out_opt_origin_x_ptr = viewport_props_ptr->origin_x; + } + + if (out_opt_origin_y_ptr != nullptr) + { + *out_opt_origin_y_ptr = viewport_props_ptr->origin_y; + } + + if (out_opt_width_ptr != nullptr) + { + *out_opt_width_ptr = viewport_props_ptr->width; + } + + if (out_opt_height_ptr != nullptr) + { + *out_opt_height_ptr = viewport_props_ptr->height; + } + + if (out_opt_min_depth_ptr != nullptr) + { + *out_opt_min_depth_ptr = viewport_props_ptr->min_depth; + } + + if (out_opt_max_depth_ptr != nullptr) + { + *out_opt_max_depth_ptr = viewport_props_ptr->max_depth; + } + + result = true; +end: + return result; +} + +bool Anvil::GraphicsPipelineInfo::is_alpha_to_coverage_enabled() const +{ + return m_alpha_to_coverage_enabled; +} + +bool Anvil::GraphicsPipelineInfo::is_alpha_to_one_enabled() const +{ + return m_alpha_to_one_enabled; +} + +bool Anvil::GraphicsPipelineInfo::is_depth_clamp_enabled() const +{ + return m_depth_clamp_enabled; +} + +bool Anvil::GraphicsPipelineInfo::is_primitive_restart_enabled() const +{ + return m_primitive_restart_enabled; +} + +bool Anvil::GraphicsPipelineInfo::is_rasterizer_discard_enabled() const +{ + return m_rasterizer_discard_enabled; +} + +bool Anvil::GraphicsPipelineInfo::is_sample_mask_enabled() const +{ + return m_sample_mask_enabled; +} + +void Anvil::GraphicsPipelineInfo::set_blending_properties(const float* in_blend_constant_vec4) +{ + memcpy(m_blend_constant, + in_blend_constant_vec4, + sizeof(m_blend_constant) ); +} + +void Anvil::GraphicsPipelineInfo::set_color_blend_attachment_properties(SubPassAttachmentID in_attachment_id, + bool in_blending_enabled, + VkBlendOp in_blend_op_color, + VkBlendOp in_blend_op_alpha, + VkBlendFactor in_src_color_blend_factor, + VkBlendFactor in_dst_color_blend_factor, + VkBlendFactor in_src_alpha_blend_factor, + VkBlendFactor in_dst_alpha_blend_factor, + VkColorComponentFlags in_channel_write_mask) +{ + BlendingProperties* attachment_blending_props_ptr = &m_subpass_attachment_blending_properties[in_attachment_id]; + + attachment_blending_props_ptr->blend_enabled = in_blending_enabled; + attachment_blending_props_ptr->blend_op_alpha = in_blend_op_alpha; + attachment_blending_props_ptr->blend_op_color = in_blend_op_color; + attachment_blending_props_ptr->channel_write_mask = in_channel_write_mask; + attachment_blending_props_ptr->dst_alpha_blend_factor = in_dst_alpha_blend_factor; + attachment_blending_props_ptr->dst_color_blend_factor = in_dst_color_blend_factor; + attachment_blending_props_ptr->src_alpha_blend_factor = in_src_alpha_blend_factor; + attachment_blending_props_ptr->src_color_blend_factor = in_src_color_blend_factor; +} + +void Anvil::GraphicsPipelineInfo::set_multisampling_properties(VkSampleCountFlagBits in_sample_count, + float in_min_sample_shading, + const VkSampleMask in_sample_mask) +{ + m_min_sample_shading = in_min_sample_shading; + m_sample_count = in_sample_count; + m_sample_mask = in_sample_mask; +} + +void Anvil::GraphicsPipelineInfo::set_n_dynamic_scissor_boxes(uint32_t in_n_dynamic_scissor_boxes) +{ + m_n_dynamic_scissor_boxes = in_n_dynamic_scissor_boxes; +} + +void Anvil::GraphicsPipelineInfo::set_n_dynamic_viewports(uint32_t in_n_dynamic_viewports) +{ + m_n_dynamic_viewports = in_n_dynamic_viewports; +} + +void Anvil::GraphicsPipelineInfo::set_n_patch_control_points(uint32_t in_n_patch_control_points) +{ + m_n_patch_control_points = in_n_patch_control_points; +} + +void Anvil::GraphicsPipelineInfo::set_primitive_topology(VkPrimitiveTopology in_primitive_topology) +{ + m_primitive_topology = in_primitive_topology; +} + +void Anvil::GraphicsPipelineInfo::set_rasterization_order(VkRasterizationOrderAMD in_rasterization_order) +{ + m_rasterization_order = in_rasterization_order; +} + +void Anvil::GraphicsPipelineInfo::set_rasterization_properties(VkPolygonMode in_polygon_mode, + VkCullModeFlags in_cull_mode, + VkFrontFace in_front_face, + float in_line_width) +{ + m_cull_mode = in_cull_mode; + m_front_face = in_front_face; + m_line_width = in_line_width; + m_polygon_mode = in_polygon_mode; +} + +void Anvil::GraphicsPipelineInfo::set_scissor_box_properties(uint32_t in_n_scissor_box, + int32_t in_x, + int32_t in_y, + uint32_t in_width, + uint32_t in_height) +{ + m_scissor_boxes[in_n_scissor_box] = InternalScissorBox(in_x, + in_y, + in_width, + in_height); +} + +void Anvil::GraphicsPipelineInfo::set_stencil_test_properties(bool in_update_front_face_state, + VkStencilOp in_stencil_fail_op, + VkStencilOp in_stencil_pass_op, + VkStencilOp in_stencil_depth_fail_op, + VkCompareOp in_stencil_compare_op, + uint32_t in_stencil_compare_mask, + uint32_t in_stencil_write_mask, + uint32_t in_stencil_reference) +{ + VkStencilOpState* const stencil_op_state_ptr = (in_update_front_face_state) ? &m_stencil_state_front_face + : &m_stencil_state_back_face; + + stencil_op_state_ptr->compareMask = in_stencil_compare_mask; + stencil_op_state_ptr->compareOp = in_stencil_compare_op; + stencil_op_state_ptr->depthFailOp = in_stencil_depth_fail_op; + stencil_op_state_ptr->failOp = in_stencil_fail_op; + stencil_op_state_ptr->passOp = in_stencil_pass_op; + stencil_op_state_ptr->reference = in_stencil_reference; + stencil_op_state_ptr->writeMask = in_stencil_write_mask; +} + +void Anvil::GraphicsPipelineInfo::set_viewport_properties(uint32_t in_n_viewport, + float in_origin_x, + float in_origin_y, + float in_width, + float in_height, + float in_min_depth, + float in_max_depth) +{ + m_viewports[in_n_viewport] = InternalViewport(in_origin_x, + in_origin_y, + in_width, + in_height, + in_min_depth, + in_max_depth); +} + +void Anvil::GraphicsPipelineInfo::toggle_alpha_to_coverage(bool in_should_enable) +{ + m_alpha_to_coverage_enabled = in_should_enable; +} + +void Anvil::GraphicsPipelineInfo::toggle_alpha_to_one(bool in_should_enable) +{ + m_alpha_to_one_enabled = in_should_enable; +} + +void Anvil::GraphicsPipelineInfo::toggle_depth_bias(bool in_should_enable, + float in_depth_bias_constant_factor, + float in_depth_bias_clamp, + float in_depth_bias_slope_factor) +{ + m_depth_bias_constant_factor = in_depth_bias_constant_factor; + m_depth_bias_clamp = in_depth_bias_clamp; + m_depth_bias_enabled = in_should_enable; + m_depth_bias_slope_factor = in_depth_bias_slope_factor; +} + +void Anvil::GraphicsPipelineInfo::toggle_depth_bounds_test(bool in_should_enable, + float in_min_depth_bounds, + float in_max_depth_bounds) +{ + m_depth_bounds_test_enabled = in_should_enable; + m_max_depth_bounds = in_max_depth_bounds; + m_min_depth_bounds = in_min_depth_bounds; +} + +void Anvil::GraphicsPipelineInfo::toggle_depth_clamp(bool in_should_enable) +{ + m_depth_clamp_enabled = in_should_enable; +} + +void Anvil::GraphicsPipelineInfo::toggle_depth_test(bool in_should_enable, + VkCompareOp in_compare_op) +{ + m_depth_test_enabled = in_should_enable; + m_depth_test_compare_op = in_compare_op; +} + +void Anvil::GraphicsPipelineInfo::toggle_depth_writes(bool in_should_enable) +{ + m_depth_writes_enabled = in_should_enable; +} + +void Anvil::GraphicsPipelineInfo::toggle_dynamic_states(bool in_should_enable, + DynamicStateBitfield in_dynamic_state_bits) +{ + if (in_should_enable) + { + m_enabled_dynamic_states |= in_dynamic_state_bits; + } + else + { + m_enabled_dynamic_states &= ~in_dynamic_state_bits; + } +} + +void Anvil::GraphicsPipelineInfo::toggle_logic_op(bool in_should_enable, + VkLogicOp in_logic_op) +{ + m_logic_op = in_logic_op; + m_logic_op_enabled = in_should_enable; +} + +void Anvil::GraphicsPipelineInfo::toggle_primitive_restart(bool in_should_enable) +{ + m_primitive_restart_enabled = in_should_enable; +} + +void Anvil::GraphicsPipelineInfo::toggle_rasterizer_discard(bool in_should_enable) +{ + m_rasterizer_discard_enabled = in_should_enable; +} + +void Anvil::GraphicsPipelineInfo::toggle_sample_mask(bool in_should_enable) +{ + m_sample_mask_enabled = in_should_enable; +} + +void Anvil::GraphicsPipelineInfo::toggle_sample_shading(bool in_should_enable) +{ + m_sample_shading_enabled = in_should_enable; +} + +void Anvil::GraphicsPipelineInfo::toggle_stencil_test(bool in_should_enable) +{ + m_stencil_test_enabled = in_should_enable; +} diff --git a/src/misc/memalloc_backends/backend_oneshot.cpp b/src/misc/memalloc_backends/backend_oneshot.cpp index 5a9c3eed..1979074e 100644 --- a/src/misc/memalloc_backends/backend_oneshot.cpp +++ b/src/misc/memalloc_backends/backend_oneshot.cpp @@ -76,11 +76,19 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items ++item_iterator) { /* Assign the item to supported memory types */ + const auto& required_memory_features = ((*item_iterator)->alloc_memory_required_features); + const auto& supported_memory_types = (*item_iterator)->alloc_memory_supported_memory_types; + for (uint32_t n_memory_type = 0; (1u << n_memory_type) <= (*item_iterator)->alloc_memory_supported_memory_types; ++n_memory_type) { - if (!((*item_iterator)->alloc_memory_supported_memory_types & (1 << n_memory_type)) ) + if (!(supported_memory_types & (1 << n_memory_type)) ) + { + continue; + } + + if ((memory_props.types.at(n_memory_type).features & required_memory_features) != required_memory_features) { continue; } @@ -121,7 +129,8 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items new_memory_block_ptr = Anvil::MemoryBlock::create(m_device_ptr, 1u << current_memory_type_index, n_bytes_required, - (memory_props.types[current_memory_type_index].features)); + (memory_props.types[current_memory_type_index].features), + Anvil::Utils::convert_boolean_to_mt_safety_enum(device_locked_ptr->is_mt_safe()) ); if (new_memory_block_ptr == nullptr) { diff --git a/src/misc/memory_allocator.cpp b/src/misc/memory_allocator.cpp index 243f1f64..86c1429e 100644 --- a/src/misc/memory_allocator.cpp +++ b/src/misc/memory_allocator.cpp @@ -30,8 +30,6 @@ #include "wrappers/image.h" #include "wrappers/memory_block.h" #include "wrappers/queue.h" -#include - /* Please see header for specification */ Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_memory_allocator_ptr, @@ -59,6 +57,33 @@ Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_me register_for_callbacks(); } +Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_memory_allocator_ptr, + std::shared_ptr in_buffer_ptr, + VkDeviceSize in_alloc_offset, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types) +{ + anvil_assert(in_alloc_supported_memory_types != 0); + anvil_assert(in_memory_allocator_ptr != nullptr); + + alloc_memory_final_type = UINT32_MAX; + alloc_memory_required_alignment = in_alloc_alignment; + alloc_memory_required_features = in_alloc_required_memory_features; + alloc_memory_supported_memory_types = in_alloc_supported_memory_types; + alloc_memory_types = in_alloc_memory_types; + alloc_offset = in_alloc_offset; + alloc_size = in_alloc_size; + buffer_ptr = in_buffer_ptr; + is_baked = false; + memory_allocator_ptr = in_memory_allocator_ptr; + type = ITEM_TYPE_SPARSE_BUFFER_REGION; + + register_for_callbacks(); +} + /* Please see header for specification */ Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_memory_allocator_ptr, std::shared_ptr in_image_ptr, @@ -78,6 +103,7 @@ Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_me alloc_memory_required_features = in_alloc_required_memory_features; alloc_memory_supported_memory_types = in_alloc_supported_memory_types; alloc_memory_types = in_alloc_memory_types; + alloc_offset = UINT64_MAX; alloc_size = in_alloc_size; image_ptr = in_image_ptr; is_baked = false; @@ -109,6 +135,7 @@ Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_me alloc_memory_required_alignment = in_alloc_alignment; alloc_memory_required_features = in_alloc_required_memory_features; alloc_memory_supported_memory_types = in_alloc_supported_memory_types; + alloc_offset = UINT64_MAX; alloc_size = in_alloc_size; extent = in_extent; image_ptr = in_image_ptr; @@ -138,6 +165,7 @@ Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_me alloc_memory_required_features = in_alloc_required_memory_features; alloc_memory_supported_memory_types = in_alloc_supported_memory_types; alloc_memory_types = in_alloc_memory_types; + alloc_offset = UINT64_MAX; alloc_size = in_alloc_size; image_ptr = in_image_ptr; is_baked = false; @@ -168,6 +196,7 @@ Anvil::MemoryAllocator::Item& Anvil::MemoryAllocator::Item::operator=(const Anvi alloc_memory_required_features = in.alloc_memory_required_features; alloc_memory_supported_memory_types = in.alloc_memory_supported_memory_types; alloc_memory_types = in.alloc_memory_types; + alloc_offset = in.alloc_offset; alloc_size = in.alloc_size; extent = in.extent; @@ -203,6 +232,7 @@ Anvil::MemoryAllocator::Item::Item(const Anvil::MemoryAllocator::Item& in) alloc_memory_required_features = in.alloc_memory_required_features; alloc_memory_supported_memory_types = in.alloc_memory_supported_memory_types; alloc_memory_types = in.alloc_memory_types; + alloc_offset = in.alloc_offset; alloc_size = in.alloc_size; extent = in.extent; @@ -355,9 +385,11 @@ void Anvil::MemoryAllocator::Item::unregister_from_callbacks() /* Please see header for specification */ Anvil::MemoryAllocator::MemoryAllocator(std::weak_ptr in_device_ptr, - std::shared_ptr in_backend_ptr) - :m_backend_ptr(in_backend_ptr), - m_device_ptr (in_device_ptr) + std::shared_ptr in_backend_ptr, + bool in_mt_safe) + :MTSafetySupportProvider(in_mt_safe), + m_backend_ptr (in_backend_ptr), + m_device_ptr (in_device_ptr) { /* Stub */ } @@ -365,8 +397,8 @@ Anvil::MemoryAllocator::MemoryAllocator(std::weak_ptr /* Please see header for specification */ Anvil::MemoryAllocator::~MemoryAllocator() { - if (m_backend_ptr->supports_baking() && - m_items.size() > 0) + if (m_items.size() > 0 && + m_backend_ptr->supports_baking() ) { bake(); } @@ -377,6 +409,16 @@ Anvil::MemoryAllocator::~MemoryAllocator() bool Anvil::MemoryAllocator::add_buffer(std::shared_ptr in_buffer_ptr, MemoryFeatureFlags in_required_memory_features) { + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } + return add_buffer_internal(in_buffer_ptr, in_required_memory_features); } @@ -444,8 +486,19 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(std: std::shared_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features) { - bool result = add_buffer_internal(in_buffer_ptr, - in_required_memory_features); + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + bool result; + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } + + result = add_buffer_internal(in_buffer_ptr, + in_required_memory_features); if (result) { @@ -460,10 +513,21 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi std::shared_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features) { + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + bool result; + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } + anvil_assert(in_data_vector_ptr->size() * sizeof(float) == in_buffer_ptr->get_size() ); - bool result = add_buffer_internal(in_buffer_ptr, - in_required_memory_features); + result = add_buffer_internal(in_buffer_ptr, + in_required_memory_features); if (result) { @@ -478,8 +542,19 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(std std::shared_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features) { - bool result = add_buffer_internal(in_buffer_ptr, - in_required_memory_features); + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + bool result; + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } + + result = add_buffer_internal(in_buffer_ptr, + in_required_memory_features); if (result) { @@ -494,10 +569,21 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_vector_ptr_based_post_f std::shared_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features) { + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + bool result; + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } + anvil_assert(in_data_vector_ptr->size() == in_buffer_ptr->get_size() ); - bool result = add_buffer_internal(in_buffer_ptr, - in_required_memory_features); + result = add_buffer_internal(in_buffer_ptr, + in_required_memory_features); if (result) { @@ -512,8 +598,19 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(std std::shared_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features) { - bool result = add_buffer_internal(in_buffer_ptr, - in_required_memory_features); + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + bool result; + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } + + result = add_buffer_internal(in_buffer_ptr, + in_required_memory_features); if (result) { @@ -528,10 +625,21 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f std::shared_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features) { + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + bool result; + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } + anvil_assert(in_data_vector_ptr->size() * sizeof(uint32_t) == in_buffer_ptr->get_size() ); - bool result = add_buffer_internal(in_buffer_ptr, - in_required_memory_features); + result = add_buffer_internal(in_buffer_ptr, + in_required_memory_features); if (result) { @@ -545,12 +653,21 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f bool Anvil::MemoryAllocator::add_image_whole(std::shared_ptr in_image_ptr, MemoryFeatureFlags in_required_memory_features) { - uint32_t filtered_memory_types = 0; - VkDeviceSize image_alignment = 0; - uint32_t image_memory_types = 0; - VkDeviceSize image_storage_size = 0; - std::shared_ptr new_item_ptr; - bool result = true; + uint32_t filtered_memory_types = 0; + VkDeviceSize image_alignment = 0; + uint32_t image_memory_types = 0; + VkDeviceSize image_storage_size = 0; + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + std::shared_ptr new_item_ptr; + bool result = true; + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } /* Sanity checks */ anvil_assert(m_backend_ptr->supports_baking() ); @@ -589,6 +706,68 @@ bool Anvil::MemoryAllocator::add_image_whole(std::shared_ptr in_im return result; } +/** Please see header for specification */ +bool Anvil::MemoryAllocator::add_sparse_buffer_region(std::shared_ptr in_buffer_ptr, + VkDeviceSize in_offset, + VkDeviceSize in_size, + MemoryFeatureFlags in_required_memory_features) +{ + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + std::shared_ptr new_item_ptr; + bool result = true; + + /* Sanity checks */ + anvil_assert(in_buffer_ptr != nullptr); + anvil_assert(m_backend_ptr->supports_baking () ); + anvil_assert(in_buffer_ptr->is_sparse () ); + anvil_assert(in_buffer_ptr->get_memory_requirements().size >= in_offset + in_size); + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } + + /* Determine how much space we're going to need, what alignment we need + * to consider, and so on. */ + uint32_t filtered_memory_types = 0; + const auto& memory_reqs = in_buffer_ptr->get_memory_requirements(); + + anvil_assert((in_offset % memory_reqs.alignment) == 0); + + if (!is_alloc_supported(memory_reqs.memoryTypeBits, + in_required_memory_features, + &filtered_memory_types) ) + { + result = false; + + goto end; + } + + /* Store a new block item descriptor. */ + new_item_ptr.reset( + new Item(shared_from_this(), + in_buffer_ptr, + in_offset, + in_size, + memory_reqs.memoryTypeBits, + memory_reqs.alignment, + in_required_memory_features, + filtered_memory_types) + ); + + m_items.push_back(new_item_ptr); + + m_per_object_pending_alloc_status[in_buffer_ptr.get()] = true; + +end: + anvil_assert(result); + + return result; +} + /** Please see header for specification */ bool Anvil::MemoryAllocator::add_sparse_image_miptail(std::shared_ptr in_image_ptr, VkImageAspectFlagBits in_aspect, @@ -597,6 +776,8 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(std::shared_ptr mutex_lock; + auto mutex_ptr = get_mutex(); std::shared_ptr new_item_ptr; uint32_t miptail_memory_types = 0; VkDeviceSize miptail_offset = static_cast(UINT64_MAX); @@ -606,13 +787,19 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(std::shared_ptrsupports_baking () ); anvil_assert(in_image_ptr->is_sparse () ); - anvil_assert(in_image_ptr->get_image_n_layers() > in_n_layer); + anvil_assert(in_image_ptr->get_image_n_layers() > in_n_layer); anvil_assert(in_image_ptr->has_aspects (in_aspect) ); + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } + /* Extract aspect-specific properties which includes all the miptail data we're going to need */ result = in_image_ptr->get_sparse_image_aspect_properties(in_aspect, &aspect_props_ptr); @@ -667,10 +854,12 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(std::shared_ptr mutex_lock; + auto mutex_ptr = get_mutex(); std::shared_ptr new_item_ptr; bool result = true; VkDeviceSize total_region_size_in_bytes = 0; @@ -692,6 +881,12 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(std::shared_ptrget_image_format() )); // TODO anvil_assert((Anvil::Utils::is_pow2 (static_cast(in_subresource.aspectMask)) != 0)); // only permit a single aspect + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } /* Extract image properties needed for calculations below. */ result = in_image_ptr->get_sparse_image_aspect_properties(static_cast(in_subresource.aspectMask), @@ -802,12 +997,21 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(std::shared_ptr device_locked_ptr = std::shared_ptr(m_device_ptr); + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); bool needs_sparse_memory_binding = false; bool result = false; Anvil::SparseMemoryBindInfoID sparse_memory_bind_info_id = UINT32_MAX; Anvil::Utils::SparseMemoryBindingUpdateInfo sparse_memory_binding; std::shared_ptr this_ptr; + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } + if (!m_backend_ptr->supports_baking() ) { result = (m_items.size() == 0); @@ -830,6 +1034,7 @@ bool Anvil::MemoryAllocator::bake() switch ((*item_iterator)->type) { case Anvil::MemoryAllocator::ITEM_TYPE_BUFFER: + case Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_BUFFER_REGION: { needs_sparse_memory_binding |= (*item_iterator)->buffer_ptr->is_sparse(); @@ -855,7 +1060,8 @@ bool Anvil::MemoryAllocator::bake() if (needs_sparse_memory_binding) { std::shared_ptr wait_fence_ptr = Anvil::Fence::create(m_device_ptr, - false); /* create_signalled */ + false, /* create_signalled */ + MT_SAFETY_DISABLED); sparse_memory_binding.set_fence(wait_fence_ptr); @@ -901,6 +1107,20 @@ bool Anvil::MemoryAllocator::bake() break; } + case Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_BUFFER_REGION: + { + anvil_assert(item_ptr->buffer_ptr->is_sparse() ); + + sparse_memory_binding.append_buffer_memory_update(sparse_memory_bind_info_id, + item_ptr->buffer_ptr, + item_ptr->alloc_offset, + item_ptr->alloc_memory_block_ptr, + 0, /* opt_memory_block_start_offset */ + item_ptr->alloc_size); + + break; + } + case Anvil::MemoryAllocator::ITEM_TYPE_IMAGE_WHOLE: { if (!item_ptr->image_ptr->is_sparse() ) @@ -994,10 +1214,12 @@ bool Anvil::MemoryAllocator::bake() switch (item_ptr->type) { - case ITEM_TYPE_BUFFER: alloc_status_map_iterator = m_per_object_pending_alloc_status.find(item_ptr->buffer_ptr.get() ); break; + case ITEM_TYPE_BUFFER: /* fall-through */ + case ITEM_TYPE_SPARSE_BUFFER_REGION: alloc_status_map_iterator = m_per_object_pending_alloc_status.find(item_ptr->buffer_ptr.get() ); break; + case ITEM_TYPE_IMAGE_WHOLE: /* fall-through */ case ITEM_TYPE_SPARSE_IMAGE_MIPTAIL: /* fall-through */ - case ITEM_TYPE_SPARSE_IMAGE_SUBRESOURCE: alloc_status_map_iterator = m_per_object_pending_alloc_status.find(item_ptr->image_ptr.get() ); break; + case ITEM_TYPE_SPARSE_IMAGE_SUBRESOURCE: alloc_status_map_iterator = m_per_object_pending_alloc_status.find(item_ptr->image_ptr.get() ); break; default: { @@ -1080,13 +1302,21 @@ bool Anvil::MemoryAllocator::bake() } end: + if (mutex_lock.owns_lock() ) + { + mutex_lock.unlock(); + } + return result; } /* Please see header for specification */ -std::shared_ptr Anvil::MemoryAllocator::create_oneshot(std::weak_ptr in_device_ptr) +std::shared_ptr Anvil::MemoryAllocator::create_oneshot(std::weak_ptr in_device_ptr, + MTSafety in_mt_safety) { std::shared_ptr backend_ptr; + const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); std::shared_ptr result_ptr; backend_ptr.reset( @@ -1097,7 +1327,8 @@ std::shared_ptr Anvil::MemoryAllocator::create_oneshot(s { result_ptr.reset( new Anvil::MemoryAllocator(in_device_ptr, - backend_ptr) + backend_ptr, + mt_safe) ); } @@ -1105,9 +1336,12 @@ std::shared_ptr Anvil::MemoryAllocator::create_oneshot(s } /* Please see header for specification */ -std::shared_ptr Anvil::MemoryAllocator::create_vma(std::weak_ptr in_device_ptr) +std::shared_ptr Anvil::MemoryAllocator::create_vma(std::weak_ptr in_device_ptr, + MTSafety in_mt_safety) { std::shared_ptr backend_ptr; + const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); std::shared_ptr result_ptr; backend_ptr = Anvil::MemoryAllocatorBackends::VMA::create(in_device_ptr); @@ -1116,7 +1350,8 @@ std::shared_ptr Anvil::MemoryAllocator::create_vma(std:: { result_ptr.reset( new Anvil::MemoryAllocator(in_device_ptr, - backend_ptr) + backend_ptr, + mt_safe) ); } @@ -1142,11 +1377,11 @@ bool Anvil::MemoryAllocator::is_alloc_supported(uint32_t in_mem (1u << n_memory_type) <= in_memory_types; ++n_memory_type) { - if ((is_coherent_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)) || - (is_device_local_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) || - (is_host_cached_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT)) || - (is_lazily_allocated_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT)) || - (is_mappable_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)) ) + if ((is_coherent_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)) || + (is_device_local_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) || + (is_host_cached_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT)) || + (is_lazily_allocated_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT)) || + (is_mappable_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)) ) { in_memory_types &= ~(1 << n_memory_type); } @@ -1174,6 +1409,15 @@ void Anvil::MemoryAllocator::on_is_alloc_pending_for_buffer_query(CallbackArgume { IsBufferMemoryAllocPendingQueryCallbackArgument* query_ptr = dynamic_cast(in_callback_arg_ptr); auto alloc_status_map_iterator = m_per_object_pending_alloc_status.find (query_ptr->buffer_ptr.get() ); + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } if (alloc_status_map_iterator != m_per_object_pending_alloc_status.end() ) { @@ -1186,6 +1430,15 @@ void Anvil::MemoryAllocator::on_is_alloc_pending_for_image_query(CallbackArgumen { IsImageMemoryAllocPendingQueryCallbackArgument* query_ptr = dynamic_cast(in_callback_arg_ptr); auto alloc_status_map_iterator = m_per_object_pending_alloc_status.find (query_ptr->image_ptr.get() ); + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } if (alloc_status_map_iterator != m_per_object_pending_alloc_status.end() ) { @@ -1205,6 +1458,16 @@ void Anvil::MemoryAllocator::on_implicit_bake_needed() /* Please see header for specification */ void Anvil::MemoryAllocator::set_post_bake_callback(MemoryAllocatorBakeCallbackFunction in_post_bake_callback_function) { + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } + anvil_assert(m_post_bake_callback_function == nullptr); if (m_post_bake_callback_function == nullptr) diff --git a/src/misc/object_tracker.cpp b/src/misc/object_tracker.cpp index 932885d0..d28b958b 100644 --- a/src/misc/object_tracker.cpp +++ b/src/misc/object_tracker.cpp @@ -178,8 +178,17 @@ void Anvil::ObjectTracker::register_object(ObjectType in_object_type, OnObjectRegisteredCallbackArgument callback_arg(in_object_type, in_object_ptr); - callback_safe(OBJECT_TRACKER_CALLBACK_ID_ON_OBJECT_REGISTERED, - &callback_arg); + if (in_object_type == OBJECT_TYPE_GLSL_SHADER_TO_SPIRV_GENERATOR) + { + callback_safe(OBJECT_TRACKER_CALLBACK_ID_ON_GLSL_SHADER_TO_SPIRV_GENERATOR_OBJECT_REGISTERED, + &callback_arg); + } + else + if (in_object_type == OBJECT_TYPE_SHADER_MODULE) + { + callback_safe(OBJECT_TRACKER_CALLBACK_ID_ON_SHADER_MODULE_OBJECT_REGISTERED, + &callback_arg); + } } /* Please see header for specification */ @@ -212,14 +221,23 @@ void Anvil::ObjectTracker::unregister_object(ObjectType in_object_type, &callback_arg); } else + if (in_object_type == OBJECT_TYPE_GLSL_SHADER_TO_SPIRV_GENERATOR) + { + callback_safe(OBJECT_TRACKER_CALLBACK_ID_ON_GLSL_SHADER_TO_SPIRV_GENERATOR_OBJECT_ABOUT_TO_BE_UNREGISTERED, + &callback_arg); + } + else if (in_object_type == OBJECT_TYPE_PIPELINE_LAYOUT) { callback_safe(OBJECT_TRACKER_CALLBACK_ID_ON_PIPELINE_LAYOUT_OBJECT_ABOUT_TO_BE_UNREGISTERED, &callback_arg); } - - callback_safe(OBJECT_TRACKER_CALLBACK_ID_ON_OBJECT_ABOUT_TO_BE_UNREGISTERED, - &callback_arg); + else + if (in_object_type == OBJECT_TYPE_SHADER_MODULE) + { + callback_safe(OBJECT_TRACKER_CALLBACK_ID_ON_SHADER_MODULE_OBJECT_ABOUT_TO_BE_UNREGISTERED, + &callback_arg); + } end: ; diff --git a/src/misc/page_tracker.cpp b/src/misc/page_tracker.cpp index 573e1955..86098b33 100644 --- a/src/misc/page_tracker.cpp +++ b/src/misc/page_tracker.cpp @@ -38,22 +38,15 @@ Anvil::PageTracker::PageTracker(VkDeviceSize in_region_size, } /** Please see header for specification */ -std::shared_ptr Anvil::PageTracker::get_memory_block(VkDeviceSize in_start_offset_page_aligned, - VkDeviceSize* out_memory_region_start_offset_ptr) +std::shared_ptr Anvil::PageTracker::get_memory_block(VkDeviceSize in_start_offset, + VkDeviceSize in_size, + VkDeviceSize* out_memory_region_start_offset_ptr) const { std::shared_ptr result_ptr; - /* Sanity checks */ - if ((in_start_offset_page_aligned % m_page_size) != 0) - { - anvil_assert( (in_start_offset_page_aligned % m_page_size) == 0); - - goto end; - } - - if (in_start_offset_page_aligned + m_page_size > m_n_total_pages * m_page_size) + if (in_size > m_page_size) { - anvil_assert(!(in_start_offset_page_aligned + m_page_size > m_n_total_pages * m_page_size) ); + anvil_assert(!(in_size > m_page_size) ); goto end; } @@ -61,11 +54,11 @@ std::shared_ptr Anvil::PageTracker::get_memory_block(VkDevic /* Handle the request */ for (const auto& current_memory_block : m_memory_blocks) { - if (current_memory_block.start_offset <= in_start_offset_page_aligned && - current_memory_block.start_offset + current_memory_block.size >= in_start_offset_page_aligned + m_page_size) + if (current_memory_block.start_offset <= in_start_offset && + current_memory_block.start_offset + current_memory_block.size >= in_start_offset + in_size) { result_ptr = current_memory_block.memory_block_ptr; - *out_memory_region_start_offset_ptr = current_memory_block.start_offset + in_start_offset_page_aligned; + *out_memory_region_start_offset_ptr = in_start_offset - current_memory_block.start_offset; break; } @@ -81,10 +74,12 @@ bool Anvil::PageTracker::set_binding(std::shared_ptr in_memory_bloc VkDeviceSize in_start_offset, VkDeviceSize in_size) { - uint32_t n_pages; - uint32_t occupancy_item_start_index; - uint32_t occupancy_vec_start_index; - bool result = false; + const auto end_offset_page_aligned = Anvil::Utils::round_up(in_start_offset + in_size, + m_page_size); + uint32_t n_pages; + uint32_t occupancy_item_start_index; + uint32_t occupancy_vec_start_index; + bool result = false; /* Sanity checks */ if (in_start_offset + in_size > m_region_size) @@ -101,9 +96,11 @@ bool Anvil::PageTracker::set_binding(std::shared_ptr in_memory_bloc goto end; } - if ((in_size % m_page_size) != 0) + if (((in_start_offset + in_size) % m_page_size) != 0 && + end_offset_page_aligned != m_region_size) { - anvil_assert(!(in_size % m_page_size) != 0); + anvil_assert(!((in_start_offset + in_size) % m_page_size) != 0 && + end_offset_page_aligned != m_region_size); goto end; } diff --git a/src/misc/render_pass_info.cpp b/src/misc/render_pass_info.cpp new file mode 100644 index 00000000..54d8b75a --- /dev/null +++ b/src/misc/render_pass_info.cpp @@ -0,0 +1,1079 @@ +// +// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#include "misc/render_pass_info.h" +#include "wrappers/device.h" +#include +#include + + +Anvil::RenderPassInfo::RenderPassInfo(std::weak_ptr in_device_ptr) + :m_device_ptr (in_device_ptr), + m_update_preserved_attachments(false) +{ + anvil_assert(in_device_ptr.lock() != nullptr); +} + +Anvil::RenderPassInfo::~RenderPassInfo() +{ + /* Stub */ +} + +/* Please see haeder for specification */ +bool Anvil::RenderPassInfo::add_color_attachment(VkFormat in_format, + VkSampleCountFlags in_sample_count, + VkAttachmentLoadOp in_load_op, + VkAttachmentStoreOp in_store_op, + VkImageLayout in_initial_layout, + VkImageLayout in_final_layout, + bool in_may_alias, + RenderPassAttachmentID* out_attachment_id_ptr) +{ + uint32_t new_attachment_index = UINT32_MAX; + bool result = false; + + if (out_attachment_id_ptr == nullptr) + { + anvil_assert(out_attachment_id_ptr != nullptr); + + goto end; + } + + new_attachment_index = static_cast(m_attachments.size() ); + *out_attachment_id_ptr = new_attachment_index; + + m_attachments.push_back(RenderPassAttachment(in_format, + in_sample_count, + in_load_op, + in_store_op, + in_initial_layout, + in_final_layout, + in_may_alias, + new_attachment_index) ); + + result = true; + +end: + return result; +} + +/** Adds a new dependency to the internal data model. + * + * @param in_destination_subpass_ptr Pointer to the descriptor of the destination subpass. + * If nullptr, it is assumed an external destination is requested. + * @param in_source_subpass_ptr Pointer to the descriptor of the source subpass. + * If nullptr, it is assumed an external source is requested. + * @param in_source_stage_mask Source pipeline stage mask. + * @param in_destination_stage_mask Destination pipeline stage mask. + * @param in_source_access_mask Source access mask. + * @param in_destination_access_mask Destination access mask. + * @param in_by_region true if a "by-region" dependency is requested; false otherwise. + * + * @return true if the dependency was added successfully; false otherwise. + * + **/ +bool Anvil::RenderPassInfo::add_dependency(SubPass* in_destination_subpass_ptr, + SubPass* in_source_subpass_ptr, + VkPipelineStageFlags in_source_stage_mask, + VkPipelineStageFlags in_destination_stage_mask, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region) +{ + auto new_dep = SubPassDependency(in_destination_stage_mask, + in_destination_subpass_ptr, + in_source_stage_mask, + in_source_subpass_ptr, + in_source_access_mask, + in_destination_access_mask, + in_by_region); + + if (std::find(m_subpass_dependencies.begin(), + m_subpass_dependencies.end(), + new_dep) == m_subpass_dependencies.end() ) + { + m_subpass_dependencies.push_back(new_dep); + } + + return true; +} + +/* Please see header for specification */ +bool Anvil::RenderPassInfo::add_depth_stencil_attachment(VkFormat in_format, + VkSampleCountFlags in_sample_count, + VkAttachmentLoadOp in_depth_load_op, + VkAttachmentStoreOp in_depth_store_op, + VkAttachmentLoadOp in_stencil_load_op, + VkAttachmentStoreOp in_stencil_store_op, + VkImageLayout in_initial_layout, + VkImageLayout in_final_layout, + bool in_may_alias, + RenderPassAttachmentID* out_attachment_id_ptr) +{ + uint32_t new_attachment_index = UINT32_MAX; + bool result = false; + + if (out_attachment_id_ptr == nullptr) + { + anvil_assert(out_attachment_id_ptr != nullptr); + + goto end; + } + + new_attachment_index = static_cast(m_attachments.size() ); + *out_attachment_id_ptr = new_attachment_index; + + m_attachments.push_back(RenderPassAttachment(in_format, + in_sample_count, + in_depth_load_op, + in_depth_store_op, + in_stencil_load_op, + in_stencil_store_op, + in_initial_layout, + in_final_layout, + in_may_alias, + new_attachment_index) ); + + result = true; +end: + return result; +} + +/* Please see header for specification */ +bool Anvil::RenderPassInfo::add_external_to_subpass_dependency(SubPassID in_destination_subpass_id, + VkPipelineStageFlags in_source_stage_mask, + VkPipelineStageFlags in_destination_stage_mask, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region) +{ + SubPass* destination_subpass_ptr = nullptr; + bool result = false; + + if (m_subpasses.size() <= in_destination_subpass_id) + { + anvil_assert(!(m_subpasses.size() <= in_destination_subpass_id) ); + + goto end; + } + + destination_subpass_ptr = m_subpasses[in_destination_subpass_id].get(); + + result = add_dependency(destination_subpass_ptr, + nullptr, /* source_subpass_ptr */ + in_source_stage_mask, + in_destination_stage_mask, + in_source_access_mask, + in_destination_access_mask, + in_by_region); +end: + return result; +} + +/* Please see header for specification */ +bool Anvil::RenderPassInfo::add_self_subpass_dependency(SubPassID in_destination_subpass_id, + VkPipelineStageFlags in_source_stage_mask, + VkPipelineStageFlags in_destination_stage_mask, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region) +{ + SubPass* destination_subpass_ptr = nullptr; + bool result = false; + + if (m_subpasses.size() <= in_destination_subpass_id) + { + anvil_assert(!(m_subpasses.size() <= in_destination_subpass_id) ); + + goto end; + } + + destination_subpass_ptr = m_subpasses[in_destination_subpass_id].get(); + result = add_dependency(destination_subpass_ptr, + destination_subpass_ptr, + in_source_stage_mask, + in_destination_stage_mask, + in_source_access_mask, + in_destination_access_mask, + in_by_region); +end: + return result; +} + +/* Please see header for specification */ +bool Anvil::RenderPassInfo::add_subpass(SubPassID* out_subpass_id_ptr) + +{ + uint32_t new_subpass_index = UINT32_MAX; + bool result = false; + + if (out_subpass_id_ptr == nullptr) + { + anvil_assert(out_subpass_id_ptr != nullptr); + + goto end; + } + + new_subpass_index = static_cast(m_subpasses.size() ); + + /* Spawn a new descriptor */ + { + std::unique_ptr new_subpass_ptr( + new SubPass(new_subpass_index) + ); + + m_subpasses.push_back( + std::move(new_subpass_ptr) + ); + + *out_subpass_id_ptr = new_subpass_index; + } + + result = true; +end: + return result; +} + +/** Adds a new attachment to the specified subpass. + * + * @param in_subpass_id ID of the subpass to update. The subpass must have been earlier + * created with an add_subpass() call. + * @param in_is_color_attachment true if the added attachment is a color attachment;false if it's + * an input attachment. + * @param in_layout Layout to use for the attachment when executing the subpass. + * Driver takes care of transforming the attachment to the requested layout + * before subpass commands starts executing. + * @param in_attachment_id ID of a render-pass attachment ID this sub-pass attachment should + * refer to. + * @param in_attachment_location Location, under which the specified attachment should be accessible. + * @param in_should_resolve true if the specified attachment is multisample and should be + * resolved at the end of the sub-pass. + * @parma in_resolve_attachment_id If @param should_resolve is true, this argument should specify the + * ID of a render-pass attachment, to which the resolved data should + * written to. + * + * @return true if the function executed successfully, false otherwise. + * + **/ +bool Anvil::RenderPassInfo::add_subpass_attachment(SubPassID in_subpass_id, + bool in_is_color_attachment, + VkImageLayout in_layout, + RenderPassAttachmentID in_attachment_id, + uint32_t in_attachment_location, + bool in_should_resolve, + RenderPassAttachmentID in_resolve_attachment_id) +{ + RenderPassAttachment* renderpass_attachment_ptr = nullptr; + RenderPassAttachment* resolve_attachment_ptr = nullptr; + bool result = false; + LocationToSubPassAttachmentMap* subpass_attachments_ptr = nullptr; + SubPass* subpass_ptr = nullptr; + + /* Retrieve the subpass descriptor */ + if (in_subpass_id >= m_subpasses.size() ) + { + anvil_assert(!(in_subpass_id >= m_subpasses.size() )); + + goto end; + } + else + { + subpass_ptr = m_subpasses.at(in_subpass_id).get(); + } + + /* Retrieve the renderpass attachment descriptor */ + if (in_attachment_id >= m_attachments.size() ) + { + anvil_assert(!(in_attachment_id >= m_attachments.size()) ); + + goto end; + } + else + { + renderpass_attachment_ptr = &m_attachments.at(in_attachment_id); + } + + /* Retrieve the resolve attachment descriptor, if one was requested */ + if (in_should_resolve) + { + if (in_resolve_attachment_id >= m_attachments.size() ) + { + anvil_assert(!(in_resolve_attachment_id >= m_attachments.size()) ); + + goto end; + } + else + { + resolve_attachment_ptr = &m_attachments.at(in_resolve_attachment_id); + } + } + + /* Make sure the attachment location is not already assigned an attachment */ + subpass_attachments_ptr = (in_is_color_attachment) ? &subpass_ptr->color_attachments_map + : &subpass_ptr->input_attachments_map; + + if (subpass_attachments_ptr->find(in_attachment_location) != subpass_attachments_ptr->end() ) + { + anvil_assert(!(subpass_attachments_ptr->find(in_attachment_location) != subpass_attachments_ptr->end()) ); + + goto end; + } + + /* Add the attachment */ + (*subpass_attachments_ptr)[in_attachment_location] = SubPassAttachment(renderpass_attachment_ptr, + in_layout, + resolve_attachment_ptr); + + if (in_should_resolve) + { + anvil_assert(resolve_attachment_ptr != nullptr); + + subpass_ptr->resolved_attachments_map[in_attachment_location] = SubPassAttachment(resolve_attachment_ptr, + in_layout, + nullptr); + } + + m_update_preserved_attachments = true; + result = true; + +end: + return result; +} + +/* Please see header for specification */ +bool Anvil::RenderPassInfo::add_subpass_color_attachment(SubPassID in_subpass_id, + VkImageLayout in_input_layout, + RenderPassAttachmentID in_attachment_id, + uint32_t in_location, + const RenderPassAttachmentID* in_attachment_resolve_id_ptr) +{ + return add_subpass_attachment(in_subpass_id, + true, /* is_color_attachment */ + in_input_layout, + in_attachment_id, + in_location, + (in_attachment_resolve_id_ptr != nullptr), + (in_attachment_resolve_id_ptr != nullptr) ? *in_attachment_resolve_id_ptr + : UINT32_MAX); +} + +/* Please see header for specification */ +bool Anvil::RenderPassInfo::add_subpass_depth_stencil_attachment(SubPassID in_subpass_id, + RenderPassAttachmentID in_attachment_id, + VkImageLayout in_layout) +{ + RenderPassAttachment* ds_attachment_ptr = nullptr; + RenderPassAttachment* resolve_attachment_ptr = nullptr; + bool result = false; + SubPass* subpass_ptr = nullptr; + + /* Retrieve the subpass descriptor */ + if (m_subpasses.size() <= in_subpass_id) + { + anvil_assert(!(m_subpasses.size() <= in_subpass_id) ); + + goto end; + } + else + { + subpass_ptr = m_subpasses.at(in_subpass_id).get(); + } + + /* Retrieve the attachment descriptors */ + if (m_attachments.size() <= in_attachment_id) + { + anvil_assert(!(m_attachments.size() <= in_attachment_id) ); + + goto end; + } + else + { + ds_attachment_ptr = &m_attachments.at(in_attachment_id); + } + + /* Update the depth/stencil attachment for the subpass */ + if (subpass_ptr->depth_stencil_attachment.attachment_ptr != nullptr) + { + anvil_assert(!(subpass_ptr->depth_stencil_attachment.attachment_ptr != nullptr) ); + + goto end; + } + + subpass_ptr->depth_stencil_attachment = SubPassAttachment(ds_attachment_ptr, + in_layout, + resolve_attachment_ptr); + + m_update_preserved_attachments = true; + result = true; +end: + return result; +} + +/* Please see header for specification */ +bool Anvil::RenderPassInfo::add_subpass_input_attachment(SubPassID in_subpass_id, + VkImageLayout in_layout, + RenderPassAttachmentID in_attachment_id, + uint32_t in_attachment_index) +{ + return add_subpass_attachment(in_subpass_id, + false, /* is_color_attachment */ + in_layout, + in_attachment_id, + in_attachment_index, + false, /* should_resolve */ + UINT32_MAX); /* resolve_attachment_id */ +} + +/* Please see header for specification */ +bool Anvil::RenderPassInfo::add_subpass_to_external_dependency(SubPassID in_source_subpass_id, + VkPipelineStageFlags in_source_stage_mask, + VkPipelineStageFlags in_destination_stage_mask, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region) +{ + bool result = false; + SubPass* source_subpass_ptr = nullptr; + + if (m_subpasses.size() <= in_source_subpass_id) + { + anvil_assert(!(m_subpasses.size() <= in_source_subpass_id) ); + + goto end; + } + + source_subpass_ptr = m_subpasses[in_source_subpass_id].get(); + + result = add_dependency(nullptr, /* destination_subpass_ptr */ + source_subpass_ptr, + in_source_stage_mask, + in_destination_stage_mask, + in_source_access_mask, + in_destination_access_mask, + in_by_region); +end: + return result; +} + +/* Please see header for specification */ +bool Anvil::RenderPassInfo::add_subpass_to_subpass_dependency(SubPassID in_source_subpass_id, + SubPassID in_destination_subpass_id, + VkPipelineStageFlags in_source_stage_mask, + VkPipelineStageFlags in_destination_stage_mask, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region) +{ + SubPass* destination_subpass_ptr = nullptr; + bool result = false; + SubPass* source_subpass_ptr = nullptr; + + if (m_subpasses.size() <= in_destination_subpass_id) + { + anvil_assert(!(m_subpasses.size() <= in_destination_subpass_id) ); + + goto end; + } + + if (m_subpasses.size() <= in_source_subpass_id) + { + anvil_assert(!(m_subpasses.size() <= in_source_subpass_id) ); + + goto end; + } + + destination_subpass_ptr = m_subpasses[in_destination_subpass_id].get(); + source_subpass_ptr = m_subpasses[in_source_subpass_id].get(); + + result = add_dependency(destination_subpass_ptr, + source_subpass_ptr, + in_source_stage_mask, + in_destination_stage_mask, + in_source_access_mask, + in_destination_access_mask, + in_by_region); +end: + return result; +} + +/** Creates a VkAttachmentReference descriptor from the specified RenderPassAttachment instance. + * + * @param in_renderpass_attachment Renderpass attachment descriptor to create the Vulkan descriptor from. + * + * @return As per description. + **/ +VkAttachmentReference Anvil::RenderPassInfo::get_attachment_reference_from_renderpass_attachment(const RenderPassAttachment& in_renderpass_attachment) const +{ + VkAttachmentReference attachment_vk; + + attachment_vk.attachment = in_renderpass_attachment.index; + attachment_vk.layout = in_renderpass_attachment.initial_layout; + + return attachment_vk; +} + +/** Creates a VkAttachmentReference descriptor from the specified SubPassAttachment instance. + * + * @param in_renderpass_attachment Subpass attachment descriptor to create the Vulkan descriptor from. + * + * @return As per description. + **/ +VkAttachmentReference Anvil::RenderPassInfo::get_attachment_reference_from_subpass_attachment(const SubPassAttachment& in_subpass_attachment) const +{ + VkAttachmentReference attachment_vk; + + attachment_vk.attachment = in_subpass_attachment.attachment_ptr->index; + attachment_vk.layout = in_subpass_attachment.layout; + + return attachment_vk; +} + +/** Creates a VkAttachmentReference descriptor for a resolve attachment for a color attachment specified by the user. + * + * @param in_subpass_iterator Iterator pointing at the subpass which uses the color attachment of interest. + * @param in_location_to_subpass_att_map_iterator Iterator pointing at a color attachment which has a resolve attachment attached. + * + * @return As per description. + **/ +VkAttachmentReference Anvil::RenderPassInfo::get_attachment_reference_for_resolve_attachment(const SubPassesConstIterator& in_subpass_iterator, + const LocationToSubPassAttachmentMapConstIterator& in_location_to_subpass_att_map_iterator) const +{ + VkAttachmentReference result; + + anvil_assert((*in_subpass_iterator)->resolved_attachments_map.find(in_location_to_subpass_att_map_iterator->first) != (*in_subpass_iterator)->resolved_attachments_map.end() ); + + result.attachment = in_location_to_subpass_att_map_iterator->second.resolve_attachment_ptr->index; + result.layout = (*in_subpass_iterator)->resolved_attachments_map.at(in_location_to_subpass_att_map_iterator->first).layout; + + return result; +} + +/* Please see header for specification */ +bool Anvil::RenderPassInfo::get_attachment_type(RenderPassAttachmentID in_attachment_id, + AttachmentType* out_attachment_type_ptr) const +{ + bool result = false; + + if (m_attachments.size() <= in_attachment_id) + { + anvil_assert(m_attachments.size() > in_attachment_id); + + goto end; + } + + *out_attachment_type_ptr = m_attachments[in_attachment_id].type; + + /* All done */ + result = true; +end: + return result; +} + +/* Please see header for specification */ +bool Anvil::RenderPassInfo::get_color_attachment_properties(RenderPassAttachmentID in_attachment_id, + VkSampleCountFlagBits* out_opt_sample_count_ptr, + VkAttachmentLoadOp* out_opt_load_op_ptr, + VkAttachmentStoreOp* out_opt_store_op_ptr, + VkImageLayout* out_opt_initial_layout_ptr, + VkImageLayout* out_opt_final_layout_ptr, + bool* out_opt_may_alias_ptr) const +{ + bool result = false; + + if (m_attachments.size() <= in_attachment_id) + { + goto end; + } + + if (out_opt_sample_count_ptr != nullptr) + { + *out_opt_sample_count_ptr = static_cast(m_attachments[in_attachment_id].sample_count); + } + + if (out_opt_load_op_ptr != nullptr) + { + *out_opt_load_op_ptr = m_attachments[in_attachment_id].color_depth_load_op; + } + + if (out_opt_store_op_ptr != nullptr) + { + *out_opt_store_op_ptr = m_attachments[in_attachment_id].color_depth_store_op; + } + + if (out_opt_initial_layout_ptr != nullptr) + { + *out_opt_initial_layout_ptr = m_attachments[in_attachment_id].initial_layout; + } + + if (out_opt_final_layout_ptr != nullptr) + { + *out_opt_final_layout_ptr = m_attachments[in_attachment_id].final_layout; + } + + if (out_opt_may_alias_ptr != nullptr) + { + *out_opt_may_alias_ptr = m_attachments[in_attachment_id].may_alias; + } + + result = true; +end: + return result; +} + +/** Please see header for specification */ +bool Anvil::RenderPassInfo::get_dependency_properties(uint32_t in_n_dependency, + SubPassID* out_destination_subpass_id_ptr, + SubPassID* out_source_subpass_id_ptr, + VkPipelineStageFlags* out_destination_stage_mask_ptr, + VkPipelineStageFlags* out_source_stage_mask_ptr, + VkAccessFlags* out_destination_access_mask_ptr, + VkAccessFlags* out_source_access_mask_ptr, + bool* out_by_region_ptr) const +{ + const Anvil::RenderPassInfo::SubPassDependency* dep_ptr = nullptr; + bool result = false; + + if (m_subpass_dependencies.size() <= in_n_dependency) + { + anvil_assert_fail(); + + goto end; + } + + dep_ptr = &m_subpass_dependencies[in_n_dependency]; + + *out_destination_subpass_id_ptr = (dep_ptr->destination_subpass_ptr != nullptr) ? dep_ptr->destination_subpass_ptr->index + : UINT32_MAX; + *out_source_subpass_id_ptr = (dep_ptr->source_subpass_ptr != nullptr) ? dep_ptr->source_subpass_ptr->index + : UINT32_MAX; + *out_destination_stage_mask_ptr = dep_ptr->destination_stage_mask; + *out_source_stage_mask_ptr = dep_ptr->source_stage_mask; + *out_destination_access_mask_ptr = dep_ptr->destination_access_mask; + *out_source_access_mask_ptr = dep_ptr->source_access_mask; + *out_by_region_ptr = dep_ptr->by_region; + + /* All done */ + result = true; +end: + return result; +} + +/** Please see header for specification */ +bool Anvil::RenderPassInfo::get_depth_stencil_attachment_properties(RenderPassAttachmentID in_attachment_id, + VkAttachmentLoadOp* out_opt_depth_load_op_ptr, + VkAttachmentStoreOp* out_opt_depth_store_op_ptr, + VkAttachmentLoadOp* out_opt_stencil_load_op_ptr, + VkAttachmentStoreOp* out_opt_stencil_store_op_ptr, + VkImageLayout* out_opt_initial_layout_ptr, + VkImageLayout* out_opt_final_layout_ptr, + bool* out_opt_may_alias_ptr) const +{ + bool result = false; + + if (m_attachments.size() <= in_attachment_id) + { + goto end; + } + + if (out_opt_depth_load_op_ptr != nullptr) + { + *out_opt_depth_load_op_ptr = m_attachments[in_attachment_id].color_depth_load_op; + } + + if (out_opt_depth_store_op_ptr != nullptr) + { + *out_opt_depth_store_op_ptr = m_attachments[in_attachment_id].color_depth_store_op; + } + + if (out_opt_stencil_load_op_ptr != nullptr) + { + *out_opt_stencil_load_op_ptr = m_attachments[in_attachment_id].stencil_load_op; + } + + if (out_opt_stencil_store_op_ptr != nullptr) + { + *out_opt_stencil_store_op_ptr = m_attachments[in_attachment_id].stencil_store_op; + } + + if (out_opt_initial_layout_ptr != nullptr) + { + *out_opt_initial_layout_ptr = m_attachments[in_attachment_id].initial_layout; + } + + if (out_opt_final_layout_ptr != nullptr) + { + *out_opt_final_layout_ptr = m_attachments[in_attachment_id].final_layout; + } + + if (out_opt_may_alias_ptr != nullptr) + { + *out_opt_may_alias_ptr = m_attachments[in_attachment_id].may_alias; + } + + result = true; +end: + return result; +} + +/* Please see header for specification */ +bool Anvil::RenderPassInfo::get_subpass_n_attachments(SubPassID in_subpass_id, + AttachmentType in_attachment_type, + uint32_t* out_n_attachments_ptr) +{ + bool result = false; + + if (m_subpasses.size() <= in_subpass_id) + { + anvil_assert(!(m_subpasses.size() <= in_subpass_id) ); + + goto end; + } + else + { + result = true; + + if (in_attachment_type == ATTACHMENT_TYPE_PRESERVE && + m_update_preserved_attachments) + { + update_preserved_attachments(); + + anvil_assert(!m_update_preserved_attachments); + } + + switch (in_attachment_type) + { + case ATTACHMENT_TYPE_COLOR: *out_n_attachments_ptr = static_cast(m_subpasses[in_subpass_id]->color_attachments_map.size() ); break; + case ATTACHMENT_TYPE_INPUT: *out_n_attachments_ptr = static_cast(m_subpasses[in_subpass_id]->input_attachments_map.size() ); break; + case ATTACHMENT_TYPE_PRESERVE: *out_n_attachments_ptr = static_cast(m_subpasses[in_subpass_id]->preserved_attachments.size() ); break; + case ATTACHMENT_TYPE_RESOLVE: *out_n_attachments_ptr = static_cast(m_subpasses[in_subpass_id]->resolved_attachments_map.size() ); break; + + case ATTACHMENT_TYPE_DEPTH_STENCIL: + { + *out_n_attachments_ptr = (m_subpasses[in_subpass_id]->depth_stencil_attachment.attachment_ptr != nullptr) ? 1u : 0u; + + break; + } + + default: + { + anvil_assert_fail(); + + result = false; + } + } + } + +end: + return result; +} + +/* Please see header for specification */ +bool Anvil::RenderPassInfo::get_subpass_attachment_properties(SubPassID in_subpass_id, + AttachmentType in_attachment_type, + uint32_t in_n_subpass_attachment, + RenderPassAttachmentID* out_renderpass_attachment_id_ptr, + VkImageLayout* out_layout_ptr) +{ + SubPassAttachment attachment; + bool result = false; + LocationToSubPassAttachmentMap* subpass_attachments_ptr = nullptr; + SubPass* subpass_ptr = nullptr; + + /* Sanity checks */ + if (in_attachment_type == ATTACHMENT_TYPE_PRESERVE && + out_layout_ptr != nullptr) + { + anvil_assert(!(in_attachment_type == ATTACHMENT_TYPE_PRESERVE && + out_layout_ptr != nullptr) ); + + goto end; + } + + if (m_subpasses.size() <= in_subpass_id) + { + anvil_assert(!(m_subpasses.size() <= in_subpass_id) ); + + goto end; + } + + subpass_ptr = m_subpasses[in_subpass_id].get(); + + /* Even more sanity checks.. */ + switch (in_attachment_type) + { + case ATTACHMENT_TYPE_COLOR: /* Fall-through */ + case ATTACHMENT_TYPE_INPUT: /* Fall-through */ + case ATTACHMENT_TYPE_RESOLVE: + { + subpass_attachments_ptr = (in_attachment_type == ATTACHMENT_TYPE_COLOR) ? &subpass_ptr->color_attachments_map + : (in_attachment_type == ATTACHMENT_TYPE_INPUT) ? &subpass_ptr->input_attachments_map + : &subpass_ptr->resolved_attachments_map; + + auto iterator = subpass_attachments_ptr->find(in_n_subpass_attachment); + + if (iterator == subpass_attachments_ptr->end() ) + { + anvil_assert_fail(); + + goto end; + } + + *out_layout_ptr = iterator->second.layout; + *out_renderpass_attachment_id_ptr = iterator->second.attachment_ptr->index; + + break; + } + + case ATTACHMENT_TYPE_DEPTH_STENCIL: + { + if (in_n_subpass_attachment > 0) + { + anvil_assert(in_n_subpass_attachment == 0); + + goto end; + } + + *out_layout_ptr = subpass_ptr->depth_stencil_attachment.layout; + *out_renderpass_attachment_id_ptr = subpass_ptr->depth_stencil_attachment.attachment_ptr->index; + + break; + } + + case ATTACHMENT_TYPE_PRESERVE: + { + if (subpass_ptr->preserved_attachments.size() <= in_n_subpass_attachment) + { + anvil_assert(subpass_ptr->preserved_attachments.size() > in_n_subpass_attachment); + + goto end; + } + + const auto& attachment_props = subpass_ptr->preserved_attachments[in_n_subpass_attachment]; + + *out_renderpass_attachment_id_ptr = attachment_props.attachment_ptr->index; + break; + } + + default: + { + anvil_assert_fail(); + + goto end; + } + } + + /* All done */ + result = true; + +end: + return result; +} + +/** Initializes the vector of preserved attachments for all defined attachments. The algorithm + * used is as follows: + * + * For each subpass: + * + * 1. Check what the highest subpass index that the attachment is preserved/used in is. + * 2. For all previous subpasses, determine which subpasses do not use it. For each subpass, preserve + * the attachment. + * + * This approach may need to be changed or extended in the future. + * + * This function should be considered expensive. + **/ +void Anvil::RenderPassInfo::update_preserved_attachments() +{ + anvil_assert(m_update_preserved_attachments); + + /* Cache color, depth+stencil, resolve attachments, as used by all defined subpasses. + * Make sure not to insert duplicate items. */ + std::vector unique_attachments; + + for (auto subpass_iterator = m_subpasses.begin(); + subpass_iterator != m_subpasses.end(); + ++subpass_iterator) + { + SubPass* current_subpass_ptr = subpass_iterator->get(); + + for (uint32_t n_attachment_type = 0; + n_attachment_type < 3; /* color, depth+stencil, resolve */ + ++n_attachment_type) + { + const uint32_t n_attachments = (n_attachment_type == 0) ? static_cast(current_subpass_ptr->color_attachments_map.size() ) + : (n_attachment_type == 1) ? ((current_subpass_ptr->depth_stencil_attachment.attachment_ptr != nullptr) ? 1 : 0) + : static_cast(current_subpass_ptr->resolved_attachments_map.size() ); + + for (uint32_t n_attachment = 0; + n_attachment < n_attachments; + ++n_attachment) + { + SubPassAttachment* current_attachment_ptr = (n_attachment_type == 0) ? current_subpass_ptr->get_color_attachment_at_index(n_attachment) + : (n_attachment_type == 1) ? ¤t_subpass_ptr->depth_stencil_attachment + : current_subpass_ptr->get_resolved_attachment_at_index(n_attachment); + + if (std::find(unique_attachments.begin(), + unique_attachments.end(), + current_attachment_ptr) == unique_attachments.end() ) + { + unique_attachments.push_back(current_attachment_ptr); + } + } + } + + /* Clean subpass's preserved attachments vector along the way.. */ + current_subpass_ptr->preserved_attachments.clear(); + } + + /* Determine what the index of the subpass which uses each unique attachment for the first, and for the last time, is. */ + for (std::vector::iterator unique_attachment_iterator = unique_attachments.begin(); + unique_attachment_iterator != unique_attachments.end(); + ++unique_attachment_iterator) + { + uint32_t current_subpass_index = 0; + const SubPassAttachment* current_unique_attachment_ptr = *unique_attachment_iterator; + uint32_t lowest_subpass_index = static_cast(m_subpasses.size() - 1); + uint32_t highest_subpass_index = 0; + + for (auto subpass_iterator = m_subpasses.begin(); + subpass_iterator != m_subpasses.end(); + ++subpass_iterator, ++current_subpass_index) + { + SubPass* current_subpass_ptr = subpass_iterator->get(); + bool subpass_processed = false; + + for (uint32_t n_attachment_type = 0; + n_attachment_type < 3 /* color, depth+stencil, resolve */ && !subpass_processed; + ++n_attachment_type) + { + const uint32_t n_attachments = (n_attachment_type == 0) ? static_cast(current_subpass_ptr->color_attachments_map.size() ) + : (n_attachment_type == 1) ? ((current_subpass_ptr->depth_stencil_attachment.attachment_ptr != nullptr) ? 1 : 0) + : static_cast(current_subpass_ptr->resolved_attachments_map.size() ); + + for (uint32_t n_attachment = 0; + n_attachment < n_attachments && !subpass_processed; + ++n_attachment) + { + SubPassAttachment* current_attachment_ptr = (n_attachment_type == 0) ? current_subpass_ptr->get_color_attachment_at_index(n_attachment) + : (n_attachment_type == 1) ? ¤t_subpass_ptr->depth_stencil_attachment + : current_subpass_ptr->get_resolved_attachment_at_index(n_attachment); + + if (current_attachment_ptr == current_unique_attachment_ptr) + { + if (lowest_subpass_index > current_subpass_index) + { + lowest_subpass_index = current_subpass_index; + } + + highest_subpass_index = current_subpass_index; + subpass_processed = true; + } + } + } + } + + (*unique_attachment_iterator)->highest_subpass_index = highest_subpass_index; + (*unique_attachment_iterator)->lowest_subpass_index = lowest_subpass_index; + } + + /* For each unique attachment, add it to the list of preserved attachments for all subpasses that precede the + * one at the highest subpass index and follow the one at the lowest subpass index, as long as the + * attachment is not used by a subpass. */ + for (std::vector::iterator unique_attachment_iterator = unique_attachments.begin(); + unique_attachment_iterator != unique_attachments.end(); + ++unique_attachment_iterator) + { + const SubPassAttachment* current_unique_attachment_ptr = *unique_attachment_iterator; + + if ((*unique_attachment_iterator)->highest_subpass_index == (*unique_attachment_iterator)->lowest_subpass_index) + { + /* There is only one producer subpass and no consumer subpasses defined for this renderpass. + *No need to create any preserve attachments. */ + continue; + } + + for (auto subpass_iterator = (m_subpasses.begin() + static_cast(current_unique_attachment_ptr->lowest_subpass_index) ); + subpass_iterator != (m_subpasses.begin() + static_cast(current_unique_attachment_ptr->highest_subpass_index) ) + 1; + ++subpass_iterator) + { + SubPass* current_subpass_ptr = subpass_iterator->get(); + bool is_subpass_attachment = false; + + for (uint32_t n_attachment_type = 0; + n_attachment_type < 3 /* color, depth+stencil, resolve */ && !is_subpass_attachment; + ++n_attachment_type) + { + const uint32_t n_attachments = (n_attachment_type == 0) ? static_cast(current_subpass_ptr->color_attachments_map.size() ) + : (n_attachment_type == 1) ? ((current_subpass_ptr->depth_stencil_attachment.attachment_ptr != nullptr) ? 1 : 0) + : static_cast(current_subpass_ptr->resolved_attachments_map.size() ); + + for (uint32_t n_attachment = 0; + n_attachment < n_attachments && !is_subpass_attachment; + ++n_attachment) + { + SubPassAttachment* current_attachment_ptr = (n_attachment_type == 0) ? current_subpass_ptr->get_color_attachment_at_index(n_attachment) + : (n_attachment_type == 1) ? ¤t_subpass_ptr->depth_stencil_attachment + : current_subpass_ptr->get_resolved_attachment_at_index(n_attachment); + + if (current_attachment_ptr == current_unique_attachment_ptr) + { + is_subpass_attachment = true; + } + } + } + + if (!is_subpass_attachment) + { + #ifdef _DEBUG + { + bool is_already_preserved = false; + const uint32_t n_preserved_attachments = static_cast(current_subpass_ptr->preserved_attachments.size() ); + + for (uint32_t n_preserved_attachment = 0; + n_preserved_attachment < n_preserved_attachments; + ++n_preserved_attachment) + { + if (¤t_subpass_ptr->preserved_attachments[n_preserved_attachment] == current_unique_attachment_ptr) + { + is_already_preserved = true; + + break; + } + } + + anvil_assert(!is_already_preserved); + } + #endif + + current_subpass_ptr->preserved_attachments.push_back(*current_unique_attachment_ptr); + } + } + } + + m_update_preserved_attachments = false; +} + +/** Please see header for specification */ +Anvil::RenderPassInfo::SubPass::~SubPass() +{ + /* Stub */ +} diff --git a/src/misc/shader_module_cache.cpp b/src/misc/shader_module_cache.cpp index 017746c8..a53f868c 100644 --- a/src/misc/shader_module_cache.cpp +++ b/src/misc/shader_module_cache.cpp @@ -26,6 +26,7 @@ /** Please see header for documentation */ Anvil::ShaderModuleCache::ShaderModuleCache() + :MTSafetySupportProvider(true) { update_subscriptions(true); } @@ -33,10 +34,7 @@ Anvil::ShaderModuleCache::ShaderModuleCache() /** Please see header for documentation */ Anvil::ShaderModuleCache::~ShaderModuleCache() { - std::unique_lock lock(m_cs); - { - update_subscriptions(false); - } + update_subscriptions(false); } /** TODO */ @@ -63,7 +61,7 @@ void Anvil::ShaderModuleCache::cache(std::shared_ptr in_sha anvil_assert(in_shader_module_ptr != nullptr); { - std::unique_lock lock(m_cs); + std::unique_lock mutex_lock(*get_mutex() ); auto items_map_iterator = m_items.find(hash); bool should_store_new_item = false; @@ -146,7 +144,7 @@ std::shared_ptr Anvil::ShaderModuleCache::get_cached_shader std::shared_ptr result_ptr; { - std::unique_lock lock(m_cs); + std::unique_lock mutex_lock(*get_mutex() ); const auto hash (get_hash(in_spirv_blob, in_n_spirv_blob_bytes, @@ -220,64 +218,56 @@ size_t Anvil::ShaderModuleCache::get_hash(const char* in_spirv_blob, } /** TODO */ -void Anvil::ShaderModuleCache::on_object_about_to_be_released(CallbackArgument* in_callback_arg_ptr) +void Anvil::ShaderModuleCache::on_shader_module_object_about_to_be_released(CallbackArgument* in_callback_arg_ptr) { - const Anvil::OnObjectAboutToBeUnregisteredCallbackArgument* callback_arg_ptr = dynamic_cast(in_callback_arg_ptr); - - anvil_assert(callback_arg_ptr != nullptr); - - if (callback_arg_ptr->object_type == OBJECT_TYPE_SHADER_MODULE) - { - /* Technically we should never reach this place, as shader module cache does not implement - * any sort of GC mechanism. - * - * Please investigate if this assertion check fires. - */ - anvil_assert_fail(); - } + /* Technically we should never reach this place, as shader module cache does not implement + * any sort of GC mechanism. + * + * Please investigate if this assertion check fires. + */ + ANVIL_REDUNDANT_ARGUMENT(in_callback_arg_ptr); + + anvil_assert_fail(); } /** TODO */ -void Anvil::ShaderModuleCache::on_object_registered(CallbackArgument* in_callback_arg_ptr) +void Anvil::ShaderModuleCache::on_shader_module_object_registered(CallbackArgument* in_callback_arg_ptr) { const auto callback_arg_ptr = dynamic_cast(in_callback_arg_ptr); anvil_assert(callback_arg_ptr != nullptr); - if (callback_arg_ptr->object_type == OBJECT_TYPE_SHADER_MODULE) - { - auto shader_module_ptr = static_cast(callback_arg_ptr->object_raw_ptr); + auto shader_module_ptr = static_cast(callback_arg_ptr->object_raw_ptr); - cache(shader_module_ptr->shared_from_this() ); - } + cache(shader_module_ptr->shared_from_this() ); } void Anvil::ShaderModuleCache::update_subscriptions(bool in_should_init) { auto object_tracker_ptr = Anvil::ObjectTracker::get(); - auto on_object_about_to_be_released_func = std::bind(&ShaderModuleCache::on_object_about_to_be_released, + auto on_object_about_to_be_released_func = std::bind(&ShaderModuleCache::on_shader_module_object_about_to_be_released, this, std::placeholders::_1); - auto on_object_registered_func = std::bind(&ShaderModuleCache::on_object_registered, + auto on_object_registered_func = std::bind(&ShaderModuleCache::on_shader_module_object_registered, this, std::placeholders::_1); if (in_should_init) { - object_tracker_ptr->register_for_callbacks(OBJECT_TRACKER_CALLBACK_ID_ON_OBJECT_ABOUT_TO_BE_UNREGISTERED, + object_tracker_ptr->register_for_callbacks(OBJECT_TRACKER_CALLBACK_ID_ON_SHADER_MODULE_OBJECT_ABOUT_TO_BE_UNREGISTERED, on_object_about_to_be_released_func, this); - object_tracker_ptr->register_for_callbacks(OBJECT_TRACKER_CALLBACK_ID_ON_OBJECT_REGISTERED, + object_tracker_ptr->register_for_callbacks(OBJECT_TRACKER_CALLBACK_ID_ON_SHADER_MODULE_OBJECT_REGISTERED, on_object_registered_func, this); } else { - object_tracker_ptr->unregister_from_callbacks(OBJECT_TRACKER_CALLBACK_ID_ON_OBJECT_ABOUT_TO_BE_UNREGISTERED, + object_tracker_ptr->unregister_from_callbacks(OBJECT_TRACKER_CALLBACK_ID_ON_SHADER_MODULE_OBJECT_ABOUT_TO_BE_UNREGISTERED, on_object_about_to_be_released_func, this); - object_tracker_ptr->unregister_from_callbacks(OBJECT_TRACKER_CALLBACK_ID_ON_OBJECT_REGISTERED, + object_tracker_ptr->unregister_from_callbacks(OBJECT_TRACKER_CALLBACK_ID_ON_SHADER_MODULE_OBJECT_REGISTERED, on_object_registered_func, this); } diff --git a/src/misc/types.cpp b/src/misc/types.cpp index daba6c09..55a2dc55 100644 --- a/src/misc/types.cpp +++ b/src/misc/types.cpp @@ -94,8 +94,10 @@ Anvil::DeviceExtensionConfiguration::DeviceExtensionConfiguration() amd_rasterization_order = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; amd_shader_ballot = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; amd_shader_explicit_vertex_parameter = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; + amd_shader_info = EXTENSION_AVAILABILITY_IGNORE; amd_shader_trinary_minmax = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; amd_texture_gather_bias_lod = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; + ext_shader_stencil_export = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; ext_shader_subgroup_ballot = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; ext_shader_subgroup_vote = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; khr_16bit_storage = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; @@ -151,9 +153,11 @@ bool Anvil::DeviceExtensionConfiguration::is_supported_by_physical_device(std::w ExtensionItem(VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME, amd_rasterization_order == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem(VK_AMD_SHADER_BALLOT_EXTENSION_NAME, amd_shader_ballot == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem(VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME, amd_shader_explicit_vertex_parameter == Anvil::EXTENSION_AVAILABILITY_REQUIRE), + ExtensionItem(VK_AMD_SHADER_INFO_EXTENSION_NAME, amd_shader_info == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem(VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME, amd_shader_trinary_minmax == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem(VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME, amd_texture_gather_bias_lod == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem(VK_EXT_DEBUG_MARKER_EXTENSION_NAME, ext_debug_marker == Anvil::EXTENSION_AVAILABILITY_REQUIRE), + ExtensionItem("VK_EXT_shader_stencil_export", ext_shader_stencil_export == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem(VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME, ext_shader_subgroup_vote == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem(VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME, ext_shader_subgroup_vote == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem(VK_KHR_16BIT_STORAGE_EXTENSION_NAME, khr_16bit_storage == Anvil::EXTENSION_AVAILABILITY_REQUIRE), @@ -212,6 +216,7 @@ bool Anvil::DeviceExtensionConfiguration::operator==(const Anvil::DeviceExtensio (amd_rasterization_order == in_config.amd_rasterization_order) && (amd_shader_ballot == in_config.amd_shader_ballot) && (amd_shader_explicit_vertex_parameter == in_config.amd_shader_explicit_vertex_parameter) && + (amd_shader_info == in_config.amd_shader_info) && (amd_shader_trinary_minmax == in_config.amd_shader_trinary_minmax) && (amd_texture_gather_bias_lod == in_config.amd_texture_gather_bias_lod) && (ext_debug_marker == in_config.ext_debug_marker) && @@ -1332,7 +1337,8 @@ bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_bind_info_properties(Spars *out_opt_n_signal_semaphores_ptr = static_cast(binding_iterator->signal_semaphores.size() ); } - if (out_opt_signal_semaphores_ptr_ptr != nullptr) + if (out_opt_signal_semaphores_ptr_ptr != nullptr && + binding_iterator->signal_semaphores.size() > 0) { *out_opt_signal_semaphores_ptr_ptr = &binding_iterator->signal_semaphores[0]; } @@ -1342,7 +1348,8 @@ bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_bind_info_properties(Spars *out_opt_n_wait_semaphores_ptr = static_cast(binding_iterator->wait_semaphores.size() ); } - if (out_opt_wait_semaphores_ptr_ptr != nullptr) + if (out_opt_wait_semaphores_ptr_ptr != nullptr && + binding_iterator->wait_semaphores.size() > 0) { *out_opt_wait_semaphores_ptr_ptr = &binding_iterator->wait_semaphores[0]; } @@ -1634,7 +1641,7 @@ Anvil::MemoryFeatureFlags Anvil::Utils::get_memory_feature_flags_from_vk_propert { Anvil::MemoryFeatureFlags result = 0; - ANVIL_REDUNDANT_ARGUMENT(in_mem_heap_flags); + ANVIL_REDUNDANT_ARGUMENT_CONST(in_mem_heap_flags); if ((in_mem_type_flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0) { @@ -1664,6 +1671,40 @@ Anvil::MemoryFeatureFlags Anvil::Utils::get_memory_feature_flags_from_vk_propert return result; } +Anvil::MTSafety Anvil::Utils::convert_boolean_to_mt_safety_enum(bool in_mt_safe) +{ + return (in_mt_safe) ? MT_SAFETY_ENABLED + : MT_SAFETY_DISABLED; +} + +bool Anvil::Utils::convert_mt_safety_enum_to_boolean(Anvil::MTSafety in_mt_safety, + std::weak_ptr in_device_ptr) +{ + bool result = false; + + switch (in_mt_safety) + { + case MT_SAFETY_DISABLED: result = false; break; + case MT_SAFETY_ENABLED: result = true; break; + + case MT_SAFETY_INHERIT_FROM_PARENT_DEVICE: + { + anvil_assert(!in_device_ptr.expired() ); + anvil_assert( in_device_ptr.lock () != nullptr); + + result = in_device_ptr.lock()->is_mt_safe(); + break; + } + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + /** Please see header for specification */ void Anvil::Utils::convert_queue_family_bits_to_family_indices(std::weak_ptr in_device_ptr, Anvil::QueueFamilyBits in_queue_families, @@ -1900,6 +1941,42 @@ VkAccessFlags Anvil::Utils::get_access_mask_from_image_layout(VkImageLayout return result; } +/* Please see header for specification */ +Anvil::QueueFamilyBits Anvil::Utils::get_queue_family_bits_from_queue_family_type(Anvil::QueueFamilyType in_queue_family_type) +{ + Anvil::QueueFamilyBits result = 0; + + switch (in_queue_family_type) + { + case Anvil::QUEUE_FAMILY_TYPE_COMPUTE: result = Anvil::QUEUE_FAMILY_COMPUTE_BIT; break; + case Anvil::QUEUE_FAMILY_TYPE_TRANSFER: result = Anvil::QUEUE_FAMILY_DMA_BIT; break; + case Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL: result = Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT; break; + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(Anvil::QueueFamilyType in_queue_family_type) +{ + static const char* result_strings[] = + { + "Compute", + "Transfer", + "Universal", + }; + static const uint32_t n_result_strings = sizeof(result_strings) / sizeof(result_strings[0]); + + static_assert(n_result_strings == QUEUE_FAMILY_TYPE_COUNT, ""); + + return result_strings[in_queue_family_type]; +} + /* Please see header for specification */ const char* Anvil::Utils::get_raw_string(VkAttachmentLoadOp in_load_op) { diff --git a/src/wrappers/buffer.cpp b/src/wrappers/buffer.cpp index b9780725..737e9cfb 100644 --- a/src/wrappers/buffer.cpp +++ b/src/wrappers/buffer.cpp @@ -37,20 +37,22 @@ Anvil::Buffer::Buffer(std::weak_ptr in_device_ptr, QueueFamilyBits in_queue_families, VkSharingMode in_queue_sharing_mode, VkBufferUsageFlags in_usage_flags, - Anvil::SparseResidencyScope in_residency_scope) + Anvil::SparseResidencyScope in_residency_scope, + bool in_mt_safe) :CallbacksSupportProvider (BUFFER_CALLBACK_ID_COUNT), DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT), - m_buffer (VK_NULL_HANDLE), - m_buffer_size (in_size), - m_create_flags (0), - m_device_ptr (in_device_ptr), - m_is_sparse (true), - m_parent_buffer_ptr(0), - m_queue_families (in_queue_families), - m_residency_scope (in_residency_scope), - m_sharing_mode (in_queue_sharing_mode), - m_start_offset (0) + MTSafetySupportProvider (in_mt_safe), + m_buffer (VK_NULL_HANDLE), + m_buffer_size (in_size), + m_create_flags (0), + m_device_ptr (in_device_ptr), + m_is_sparse (true), + m_parent_buffer_ptr (0), + m_queue_families (in_queue_families), + m_residency_scope (in_residency_scope), + m_sharing_mode (in_queue_sharing_mode), + m_start_offset (0) { switch (in_residency_scope) { @@ -78,21 +80,23 @@ Anvil::Buffer::Buffer(std::weak_ptr in_device_ptr, Anvil::QueueFamilyBits in_queue_families, VkSharingMode in_queue_sharing_mode, VkBufferUsageFlags in_usage_flags, - Anvil::MemoryFeatureFlags in_memory_features) + Anvil::MemoryFeatureFlags in_memory_features, + bool in_mt_safe) :CallbacksSupportProvider (BUFFER_CALLBACK_ID_COUNT), DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT), - m_buffer (VK_NULL_HANDLE), - m_buffer_size (in_size), - m_create_flags (0), - m_device_ptr (in_device_ptr), - m_is_sparse (false), - m_parent_buffer_ptr(0), - m_queue_families (in_queue_families), - m_residency_scope (Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED), - m_sharing_mode (in_queue_sharing_mode), - m_start_offset (0), - m_usage_flags (static_cast(in_usage_flags) ) + MTSafetySupportProvider (in_mt_safe), + m_buffer (VK_NULL_HANDLE), + m_buffer_size (in_size), + m_create_flags (0), + m_device_ptr (in_device_ptr), + m_is_sparse (false), + m_parent_buffer_ptr (0), + m_queue_families (in_queue_families), + m_residency_scope (Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED), + m_sharing_mode (in_queue_sharing_mode), + m_start_offset (0), + m_usage_flags (static_cast(in_usage_flags) ) { /* Sanity checks */ if ((in_memory_features & MEMORY_FEATURE_FLAG_MAPPABLE) == 0) @@ -114,14 +118,15 @@ Anvil::Buffer::Buffer(std::shared_ptr in_parent_buffer_ptr, :CallbacksSupportProvider (BUFFER_CALLBACK_ID_COUNT), DebugMarkerSupportProvider(in_parent_buffer_ptr->m_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT), - m_buffer (VK_NULL_HANDLE), - m_buffer_size (in_size), - m_create_flags (0), - m_is_sparse (false), - m_parent_buffer_ptr(in_parent_buffer_ptr), - m_residency_scope (Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED), - m_sharing_mode (VK_SHARING_MODE_MAX_ENUM), - m_start_offset (in_start_offset) + MTSafetySupportProvider (false), + m_buffer (VK_NULL_HANDLE), + m_buffer_size (in_size), + m_create_flags (0), + m_is_sparse (false), + m_parent_buffer_ptr (in_parent_buffer_ptr), + m_residency_scope (Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED), + m_sharing_mode (VK_SHARING_MODE_MAX_ENUM), + m_start_offset (in_start_offset) { /* Sanity checks */ anvil_assert(in_parent_buffer_ptr != nullptr); @@ -146,9 +151,13 @@ Anvil::Buffer::~Buffer() { std::shared_ptr device_locked_ptr(m_device_ptr); - vkDestroyBuffer(device_locked_ptr->get_device_vk(), - m_buffer, - nullptr /* pAllocator */); + lock(); + { + vkDestroyBuffer(device_locked_ptr->get_device_vk(), + m_buffer, + nullptr /* pAllocator */); + } + unlock(); m_buffer = VK_NULL_HANDLE; } @@ -161,8 +170,11 @@ std::shared_ptr Anvil::Buffer::create_nonsparse(std::weak_ptr new_buffer_ptr; new_buffer_ptr.reset( @@ -171,7 +183,8 @@ std::shared_ptr Anvil::Buffer::create_nonsparse(std::weak_ptr Anvil::Buffer::create_nonsparse(std::weak_ptr new_buffer_ptr; new_buffer_ptr.reset( @@ -203,7 +219,8 @@ std::shared_ptr Anvil::Buffer::create_nonsparse(std::weak_ptr Anvil::Buffer::create_nonsparse(std::weak_ptrm_buffer_memory_reqs.memoryTypeBits, new_buffer_ptr->m_buffer_memory_reqs.size, - in_memory_features); + in_memory_features, + in_mt_safety); new_buffer_ptr->set_nonsparse_memory(memory_block_ptr); @@ -284,9 +302,12 @@ std::shared_ptr Anvil::Buffer::create_sparse(std::weak_ptr device_locked_ptr (in_device_ptr); + const auto is_mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); const VkPhysicalDeviceFeatures& physical_device_features (device_locked_ptr->get_physical_device_features() ); std::shared_ptr result_ptr; @@ -324,7 +345,8 @@ std::shared_ptr Anvil::Buffer::create_sparse(std::weak_ptr Anvil::Buffer::create_sparse(std::weak_ptr device_locked_ptr(m_device_ptr); + const Anvil::DeviceType device_type (device_locked_ptr->get_type() ); auto memory_block_ptr (get_memory_block(0 /* in_n_memory_block */) ); bool result (false); @@ -528,7 +553,8 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, VK_SHARING_MODE_CONCURRENT, VK_BUFFER_USAGE_TRANSFER_DST_BIT, MEMORY_FEATURE_FLAG_MAPPABLE, - nullptr); + nullptr, + MT_SAFETY_DISABLED); /* in_mt_safe */ if (staging_buffer_ptr == nullptr) { @@ -537,8 +563,15 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, goto end; } - copy_cmdbuf_ptr->start_recording(true, /* one_time_submit */ - false); /* simultaneous_use_allowed */ + if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) + { + copy_cmdbuf_ptr->start_recording(true, /* one_time_submit */ + false); /* simultaneous_use_allowed */ + } + else + { + anvil_assert_fail(); + } { Anvil::BufferBarrier buffer_barrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, @@ -569,8 +602,15 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, } copy_cmdbuf_ptr->stop_recording(); - queue_ptr->submit_command_buffer(copy_cmdbuf_ptr, - true /* should_block */); + if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) + { + queue_ptr->submit_command_buffer(copy_cmdbuf_ptr, + true /* should_block */); + } + else + { + anvil_assert_fail(); + } result = staging_buffer_ptr->read(0, in_size, @@ -587,7 +627,6 @@ bool Anvil::Buffer::set_nonsparse_memory(std::shared_ptr in_ std::shared_ptr device_locked_ptr(m_device_ptr); bool result (false); VkResult result_vk; - std::shared_ptr sgpu_device_locked_ptr; std::weak_ptr sgpu_physical_device_ptr; if (in_memory_block_ptr == nullptr) @@ -611,14 +650,23 @@ bool Anvil::Buffer::set_nonsparse_memory(std::shared_ptr in_ goto end; } - sgpu_device_locked_ptr = std::shared_ptr(std::dynamic_pointer_cast(device_locked_ptr) ); - sgpu_physical_device_ptr = sgpu_device_locked_ptr->get_physical_device(); + { + std::shared_ptr sgpu_device_locked_ptr(std::dynamic_pointer_cast(device_locked_ptr) ); + + sgpu_physical_device_ptr = sgpu_device_locked_ptr->get_physical_device(); + } /* Bind the memory object to the buffer object */ - result_vk = vkBindBufferMemory(device_locked_ptr->get_device_vk(), - m_buffer, - in_memory_block_ptr->get_memory (), - in_memory_block_ptr->get_start_offset() ); + { + lock(); + { + result_vk = vkBindBufferMemory(device_locked_ptr->get_device_vk(), + m_buffer, + in_memory_block_ptr->get_memory (), + in_memory_block_ptr->get_start_offset() ); + } + unlock(); + } if (!is_vk_call_successful(result_vk) ) { @@ -655,6 +703,7 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, std::shared_ptr in_opt_queue_ptr) { std::shared_ptr base_device_locked_ptr(m_device_ptr); + const Anvil::DeviceType device_type (base_device_locked_ptr->get_type() ); bool result (false); /** TODO: Support for sparse-resident buffers whose n_memory_blocks > 1 */ @@ -768,7 +817,8 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, VK_SHARING_MODE_CONCURRENT, VK_BUFFER_USAGE_TRANSFER_SRC_BIT, Anvil::MEMORY_FEATURE_FLAG_MAPPABLE, - in_data); + in_data, + MT_SAFETY_DISABLED); if (staging_buffer_ptr == nullptr) { @@ -777,8 +827,15 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, goto end; } - copy_cmdbuf_ptr->start_recording(true, /* one_time_submit */ - false); /* simultaneous_use_allowed */ + if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) + { + copy_cmdbuf_ptr->start_recording(true, /* one_time_submit */ + false); /* simultaneous_use_allowed */ + } + else + { + anvil_assert_fail(); + } { BufferBarrier buffer_barrier(VK_ACCESS_HOST_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT, @@ -809,8 +866,15 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, } copy_cmdbuf_ptr->stop_recording(); - queue_ptr->submit_command_buffer(copy_cmdbuf_ptr, - true /* should_block */); + if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) + { + queue_ptr->submit_command_buffer(copy_cmdbuf_ptr, + true /* should_block */); + } + else + { + anvil_assert_fail(); + } result = true; } diff --git a/src/wrappers/buffer_view.cpp b/src/wrappers/buffer_view.cpp index 91874b05..d27e2484 100644 --- a/src/wrappers/buffer_view.cpp +++ b/src/wrappers/buffer_view.cpp @@ -31,9 +31,11 @@ Anvil::BufferView::BufferView(std::weak_ptr in_device_ptr, std::shared_ptr in_buffer_ptr, VkFormat in_format, VkDeviceSize in_start_offset, - VkDeviceSize in_size) + VkDeviceSize in_size, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT), + MTSafetySupportProvider (in_mt_safe), m_buffer_ptr (in_buffer_ptr), m_device_ptr (in_device_ptr), m_format (in_format), @@ -80,9 +82,13 @@ Anvil::BufferView::~BufferView() Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_BUFFER_VIEW, this); - vkDestroyBufferView(device_locked_ptr->get_device_vk(), - m_buffer_view, - nullptr /* pAllocator */); + lock(); + { + vkDestroyBufferView(device_locked_ptr->get_device_vk(), + m_buffer_view, + nullptr /* pAllocator */); + } + unlock(); m_buffer_view = VK_NULL_HANDLE; } @@ -92,8 +98,11 @@ std::shared_ptr Anvil::BufferView::create(std::weak_ptr in_buffer_ptr, VkFormat in_format, VkDeviceSize in_start_offset, - VkDeviceSize in_size) + VkDeviceSize in_size, + MTSafety in_mt_safety) { + const bool is_mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); std::shared_ptr result_ptr; /* Instantiate the object */ @@ -103,7 +112,8 @@ std::shared_ptr Anvil::BufferView::create(std::weak_ptr in_fbo_ptr, - uint32_t in_n_physical_devices, - const std::weak_ptr* in_physical_devices, - const VkRect2D* in_render_areas, + const VkRect2D& in_render_area, std::shared_ptr in_render_pass_ptr, VkSubpassContents in_contents) :Command(COMMAND_TYPE_BEGIN_RENDER_PASS) { contents = in_contents; fbo_ptr = in_fbo_ptr; + render_area = in_render_area; render_pass_ptr = in_render_pass_ptr; for (uint32_t n_clear_value = 0; @@ -77,14 +77,6 @@ Anvil::BeginRenderPassCommand::BeginRenderPassCommand(uint32_t { clear_values.push_back(in_clear_value_ptrs[n_clear_value]); } - - for (uint32_t n_physical_device = 0; - n_physical_device < in_n_physical_devices; - ++n_physical_device) - { - physical_devices.push_back(in_physical_devices[n_physical_device]); - render_areas.push_back (in_render_areas [n_physical_device]); - } } /** Please see header for specification */ @@ -869,8 +861,10 @@ Anvil::CommandBufferBase::WriteTimestampCommand::WriteTimestampCommand(VkPipelin **/ Anvil::CommandBufferBase::CommandBufferBase(std::weak_ptr in_device_ptr, std::shared_ptr in_parent_command_pool_ptr, - Anvil::CommandBufferType in_type) - :DebugMarkerSupportProvider(in_device_ptr, + Anvil::CommandBufferType in_type, + bool in_mt_safe) + :MTSafetySupportProvider (in_mt_safe), + DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT), CallbacksSupportProvider (COMMAND_BUFFER_CALLBACK_ID_COUNT), m_command_buffer (VK_NULL_HANDLE), @@ -878,6 +872,7 @@ Anvil::CommandBufferBase::CommandBufferBase(std::weak_ptr m_is_renderpass_active (false), m_parent_command_pool_ptr (in_parent_command_pool_ptr), m_recording_in_progress (false), + m_renderpass_device_mask (0), m_type (in_type) { anvil_assert(in_parent_command_pool_ptr != nullptr); @@ -900,10 +895,16 @@ Anvil::CommandBufferBase::~CommandBufferBase() std::shared_ptr device_locked_ptr (m_device_ptr); /* Physically free the command buffer we own */ - vkFreeCommandBuffers(device_locked_ptr->get_device_vk(), - command_pool_locked_ptr->get_command_pool(), - 1, /* commandBufferCount */ - &m_command_buffer); + command_pool_locked_ptr->lock(); + lock(); + { + vkFreeCommandBuffers(device_locked_ptr->get_device_vk(), + command_pool_locked_ptr->get_command_pool(), + 1, /* commandBufferCount */ + &m_command_buffer); + } + unlock(); + command_pool_locked_ptr->unlock(); m_command_buffer = VK_NULL_HANDLE; } @@ -1331,7 +1332,8 @@ bool Anvil::CommandBufferBase::record_begin_query(std::shared_ptrget_query_pool(), - in_entry, - in_flags); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdBeginQuery(m_command_buffer, + in_query_pool_ptr->get_query_pool(), + in_entry, + in_flags); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -1374,7 +1382,8 @@ bool Anvil::CommandBufferBase::record_bind_descriptor_sets(VkPipelineBindPoint { /* Note: Command supported inside and outside the renderpass. */ VkDescriptorSet dss_vk[100]; - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; anvil_assert(in_set_count < sizeof(dss_vk) / sizeof(dss_vk[0]) ); @@ -1414,14 +1423,20 @@ bool Anvil::CommandBufferBase::record_bind_descriptor_sets(VkPipelineBindPoint cache_referenced_descriptor_set(in_descriptor_set_ptrs[n_ds]); } - vkCmdBindDescriptorSets(m_command_buffer, - in_pipeline_bind_point, - in_layout_ptr->get_pipeline_layout(), - in_first_set, - in_set_count, - dss_vk, - in_dynamic_offset_count, - in_dynamic_offset_ptrs); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdBindDescriptorSets(m_command_buffer, + in_pipeline_bind_point, + in_layout_ptr->get_pipeline_layout(), + in_first_set, + in_set_count, + dss_vk, + in_dynamic_offset_count, + in_dynamic_offset_ptrs); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -1434,7 +1449,8 @@ bool Anvil::CommandBufferBase::record_bind_index_buffer(std::shared_ptrget_buffer(), - in_offset, - in_index_type); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdBindIndexBuffer(m_command_buffer, + in_buffer_ptr->get_buffer(), + in_offset, + in_index_type); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -1471,9 +1493,10 @@ bool Anvil::CommandBufferBase::record_bind_pipeline(VkPipelineBindPoint in_pipel Anvil::PipelineID in_pipeline_id) { /* Command supported inside and outside the renderpass. */ - std::shared_ptr device_locked_ptr(m_device_ptr); - VkPipeline pipeline_vk = VK_NULL_HANDLE; - bool result = false; + std::shared_ptr device_locked_ptr (m_device_ptr); + auto parent_command_pool_locked_ptr(m_parent_command_pool_ptr.lock() ); + VkPipeline pipeline_vk (VK_NULL_HANDLE); + bool result (false); if (!m_recording_in_progress) { @@ -1482,9 +1505,11 @@ bool Anvil::CommandBufferBase::record_bind_pipeline(VkPipelineBindPoint in_pipel goto end; } - pipeline_vk = (in_pipeline_bind_point == VK_PIPELINE_BIND_POINT_COMPUTE) ? device_locked_ptr->get_compute_pipeline_manager()->get_compute_pipeline (in_pipeline_id) - : (in_pipeline_bind_point == VK_PIPELINE_BIND_POINT_GRAPHICS) ? device_locked_ptr->get_graphics_pipeline_manager()->get_graphics_pipeline(in_pipeline_id) - : VK_NULL_HANDLE; + anvil_assert(in_pipeline_bind_point == VK_PIPELINE_BIND_POINT_COMPUTE || + in_pipeline_bind_point == VK_PIPELINE_BIND_POINT_GRAPHICS); + + pipeline_vk = (in_pipeline_bind_point == VK_PIPELINE_BIND_POINT_COMPUTE) ? device_locked_ptr->get_compute_pipeline_manager()->get_pipeline (in_pipeline_id) + : device_locked_ptr->get_graphics_pipeline_manager()->get_pipeline(in_pipeline_id); #ifdef STORE_COMMAND_BUFFER_COMMANDS { @@ -1496,9 +1521,15 @@ bool Anvil::CommandBufferBase::record_bind_pipeline(VkPipelineBindPoint in_pipel } #endif - vkCmdBindPipeline(m_command_buffer, - in_pipeline_bind_point, - pipeline_vk); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdBindPipeline(m_command_buffer, + in_pipeline_bind_point, + pipeline_vk); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -1513,7 +1544,8 @@ bool Anvil::CommandBufferBase::record_bind_vertex_buffers(uint32_t { /* Note: Command supported inside and outside the renderpass. */ VkBuffer buffers[100]; - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; anvil_assert(in_binding_count < sizeof(buffers) / sizeof(buffers[0]) ); @@ -1545,11 +1577,17 @@ bool Anvil::CommandBufferBase::record_bind_vertex_buffers(uint32_t cache_referenced_buffer(in_buffer_ptrs[n_binding]); } - vkCmdBindVertexBuffers(m_command_buffer, - in_start_binding, - in_binding_count, - buffers, - in_offset_ptrs); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdBindVertexBuffers(m_command_buffer, + in_start_binding, + in_binding_count, + buffers, + in_offset_ptrs); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -1565,7 +1603,8 @@ bool Anvil::CommandBufferBase::record_blit_image(std::shared_ptr i const VkImageBlit* in_region_ptrs, VkFilter in_filter) { - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (m_is_renderpass_active) { @@ -1599,14 +1638,20 @@ bool Anvil::CommandBufferBase::record_blit_image(std::shared_ptr i cache_referenced_image(in_src_image_ptr); cache_referenced_image(in_dst_image_ptr); - vkCmdBlitImage(m_command_buffer, - in_src_image_ptr->get_image(), - in_src_image_layout, - in_dst_image_ptr->get_image(), - in_dst_image_layout, - in_region_count, - in_region_ptrs, - in_filter); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdBlitImage(m_command_buffer, + in_src_image_ptr->get_image(), + in_src_image_layout, + in_dst_image_ptr->get_image(), + in_dst_image_layout, + in_region_count, + in_region_ptrs, + in_filter); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -1619,7 +1664,8 @@ bool Anvil::CommandBufferBase::record_clear_attachments(uint32_t uint32_t in_n_rects, const VkClearRect* in_rect_ptrs) { - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (!m_is_renderpass_active) { @@ -1647,11 +1693,17 @@ bool Anvil::CommandBufferBase::record_clear_attachments(uint32_t } #endif - vkCmdClearAttachments(m_command_buffer, - in_n_attachments, - in_attachment_ptrs, - in_n_rects, - in_rect_ptrs); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdClearAttachments(m_command_buffer, + in_n_attachments, + in_attachment_ptrs, + in_n_rects, + in_rect_ptrs); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -1665,7 +1717,8 @@ bool Anvil::CommandBufferBase::record_clear_color_image(std::shared_ptrget_image(), - in_image_layout, - in_color_ptr, - in_range_count, - in_range_ptrs); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdClearColorImage(m_command_buffer, + in_image_ptr->get_image(), + in_image_layout, + in_color_ptr, + in_range_count, + in_range_ptrs); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -1715,7 +1774,8 @@ bool Anvil::CommandBufferBase::record_clear_depth_stencil_image(std::shared_ptr< uint32_t in_range_count, const VkImageSubresourceRange* in_range_ptrs) { - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (m_is_renderpass_active) { @@ -1746,12 +1806,18 @@ bool Anvil::CommandBufferBase::record_clear_depth_stencil_image(std::shared_ptr< cache_referenced_image(in_image_ptr); - vkCmdClearDepthStencilImage(m_command_buffer, - in_image_ptr->get_image(), - in_image_layout, - in_depth_stencil_ptr, - in_range_count, - in_range_ptrs); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdClearDepthStencilImage(m_command_buffer, + in_image_ptr->get_image(), + in_image_layout, + in_depth_stencil_ptr, + in_range_count, + in_range_ptrs); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -1764,7 +1830,8 @@ bool Anvil::CommandBufferBase::record_copy_buffer(std::shared_ptr uint32_t in_region_count, const VkBufferCopy* in_region_ptrs) { - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (m_is_renderpass_active) { @@ -1795,11 +1862,17 @@ bool Anvil::CommandBufferBase::record_copy_buffer(std::shared_ptr cache_referenced_buffer(in_src_buffer_ptr); cache_referenced_buffer(in_dst_buffer_ptr); - vkCmdCopyBuffer(m_command_buffer, - in_src_buffer_ptr->get_buffer(), - in_dst_buffer_ptr->get_buffer(), - in_region_count, - in_region_ptrs); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdCopyBuffer(m_command_buffer, + in_src_buffer_ptr->get_buffer(), + in_dst_buffer_ptr->get_buffer(), + in_region_count, + in_region_ptrs); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -1813,7 +1886,8 @@ bool Anvil::CommandBufferBase::record_copy_buffer_to_image(std::shared_ptrget_buffer(), - in_dst_image_ptr->get_image(), - in_dst_image_layout, - in_region_count, - in_region_ptrs); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdCopyBufferToImage(m_command_buffer, + in_src_buffer_ptr->get_buffer(), + in_dst_image_ptr->get_image(), + in_dst_image_layout, + in_region_count, + in_region_ptrs); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -1865,7 +1945,8 @@ bool Anvil::CommandBufferBase::record_copy_image(std::shared_ptr i uint32_t in_region_count, const VkImageCopy* in_region_ptrs) { - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (m_is_renderpass_active) { @@ -1898,13 +1979,19 @@ bool Anvil::CommandBufferBase::record_copy_image(std::shared_ptr i cache_referenced_image(in_src_image_ptr); cache_referenced_image(in_dst_image_ptr); - vkCmdCopyImage(m_command_buffer, - in_src_image_ptr->get_image(), - in_src_image_layout, - in_dst_image_ptr->get_image(), - in_dst_image_layout, - in_region_count, - in_region_ptrs); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdCopyImage(m_command_buffer, + in_src_image_ptr->get_image(), + in_src_image_layout, + in_dst_image_ptr->get_image(), + in_dst_image_layout, + in_region_count, + in_region_ptrs); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -1918,7 +2005,8 @@ bool Anvil::CommandBufferBase::record_copy_image_to_buffer(std::shared_ptrget_image(), - in_src_image_layout, - in_dst_buffer_ptr->get_buffer(), - in_region_count, - in_region_ptrs); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdCopyImageToBuffer(m_command_buffer, + in_src_image_ptr->get_image(), + in_src_image_layout, + in_dst_buffer_ptr->get_buffer(), + in_region_count, + in_region_ptrs); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -1971,7 +2065,8 @@ bool Anvil::CommandBufferBase::record_copy_query_pool_results(std::shared_ptrget_query_pool(), - in_start_query, - in_query_count, - in_dst_buffer_ptr->get_buffer(), - in_dst_offset, - in_dst_stride, - in_flags); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdCopyQueryPoolResults(m_command_buffer, + in_query_pool_ptr->get_query_pool(), + in_start_query, + in_query_count, + in_dst_buffer_ptr->get_buffer(), + in_dst_offset, + in_dst_stride, + in_flags); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -2024,7 +2125,8 @@ bool Anvil::CommandBufferBase::record_dispatch(uint32_t in_x, uint32_t in_y, uint32_t in_z) { - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (m_is_renderpass_active) { @@ -2051,10 +2153,16 @@ bool Anvil::CommandBufferBase::record_dispatch(uint32_t in_x, } #endif - vkCmdDispatch(m_command_buffer, - in_x, - in_y, - in_z); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdDispatch(m_command_buffer, + in_x, + in_y, + in_z); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -2065,10 +2173,11 @@ bool Anvil::CommandBufferBase::record_dispatch(uint32_t in_x, bool Anvil::CommandBufferBase::record_debug_marker_begin_EXT(const std::string& in_marker_name, const float* in_opt_color) { - std::shared_ptr device_locked_ptr(m_device_ptr); - const auto& entrypoints (device_locked_ptr->get_extension_ext_debug_marker_entrypoints() ); + std::shared_ptr device_locked_ptr (m_device_ptr); + const auto& entrypoints (device_locked_ptr->get_extension_ext_debug_marker_entrypoints() ); VkDebugMarkerMarkerInfoEXT marker_info; - bool result = false; + auto parent_command_pool_locked_ptr(m_parent_command_pool_ptr.lock() ); + bool result (false); if (!m_recording_in_progress) { @@ -2107,8 +2216,12 @@ bool Anvil::CommandBufferBase::record_debug_marker_begin_EXT(const std::string& marker_info.pNext = nullptr; marker_info.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT; - entrypoints.vkCmdDebugMarkerBeginEXT(m_command_buffer, - &marker_info); + parent_command_pool_locked_ptr->lock(); + { + entrypoints.vkCmdDebugMarkerBeginEXT(m_command_buffer, + &marker_info); + } + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -2118,9 +2231,10 @@ bool Anvil::CommandBufferBase::record_debug_marker_begin_EXT(const std::string& /* Please see header for specification */ bool Anvil::CommandBufferBase::record_debug_marker_end_EXT() { - std::shared_ptr device_locked_ptr(m_device_ptr); - const auto& entrypoints (device_locked_ptr->get_extension_ext_debug_marker_entrypoints() ); - bool result (false); + std::shared_ptr device_locked_ptr (m_device_ptr); + const auto& entrypoints (device_locked_ptr->get_extension_ext_debug_marker_entrypoints() ); + auto parent_command_pool_locked_ptr(m_parent_command_pool_ptr.lock() ); + bool result (false); if (!m_recording_in_progress) { @@ -2141,7 +2255,11 @@ bool Anvil::CommandBufferBase::record_debug_marker_end_EXT() } #endif - entrypoints.vkCmdDebugMarkerEndEXT(m_command_buffer); + parent_command_pool_locked_ptr->lock(); + { + entrypoints.vkCmdDebugMarkerEndEXT(m_command_buffer); + } + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -2152,10 +2270,11 @@ bool Anvil::CommandBufferBase::record_debug_marker_end_EXT() bool Anvil::CommandBufferBase::record_debug_marker_insert_EXT(const std::string& in_marker_name, const float* in_opt_color) { - std::shared_ptr device_locked_ptr(m_device_ptr); - const auto& entrypoints (device_locked_ptr->get_extension_ext_debug_marker_entrypoints() ); + std::shared_ptr device_locked_ptr (m_device_ptr); + const auto& entrypoints (device_locked_ptr->get_extension_ext_debug_marker_entrypoints() ); VkDebugMarkerMarkerInfoEXT marker_info; - bool result (false); + auto parent_command_pool_locked_ptr(m_parent_command_pool_ptr.lock() ); + bool result (false); if (!m_recording_in_progress) { @@ -2195,8 +2314,12 @@ bool Anvil::CommandBufferBase::record_debug_marker_insert_EXT(const std::string& marker_info.pNext = nullptr; marker_info.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT; - entrypoints.vkCmdDebugMarkerInsertEXT(m_command_buffer, - &marker_info); + parent_command_pool_locked_ptr->lock(); + { + entrypoints.vkCmdDebugMarkerInsertEXT(m_command_buffer, + &marker_info); + } + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -2207,7 +2330,8 @@ bool Anvil::CommandBufferBase::record_debug_marker_insert_EXT(const std::string& bool Anvil::CommandBufferBase::record_dispatch_indirect(std::shared_ptr in_buffer_ptr, VkDeviceSize in_offset) { - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (m_is_renderpass_active) { @@ -2235,9 +2359,15 @@ bool Anvil::CommandBufferBase::record_dispatch_indirect(std::shared_ptrget_buffer(), - in_offset); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdDispatchIndirect(m_command_buffer, + in_buffer_ptr->get_buffer(), + in_offset); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -2250,7 +2380,8 @@ bool Anvil::CommandBufferBase::record_draw(uint32_t in_vertex_count, uint32_t in_first_vertex, uint32_t in_first_instance) { - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (!m_is_renderpass_active) { @@ -2278,11 +2409,17 @@ bool Anvil::CommandBufferBase::record_draw(uint32_t in_vertex_count, } #endif - vkCmdDraw(m_command_buffer, - in_vertex_count, - in_instance_count, - in_first_vertex, - in_first_instance); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdDraw(m_command_buffer, + in_vertex_count, + in_instance_count, + in_first_vertex, + in_first_instance); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -2296,7 +2433,8 @@ bool Anvil::CommandBufferBase::record_draw_indexed(uint32_t in_index_count, int32_t in_vertex_offset, uint32_t in_first_instance) { - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (!m_is_renderpass_active) { @@ -2325,12 +2463,18 @@ bool Anvil::CommandBufferBase::record_draw_indexed(uint32_t in_index_count, } #endif - vkCmdDrawIndexed(m_command_buffer, - in_index_count, - in_instance_count, - in_first_index, - in_vertex_offset, - in_first_instance); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdDrawIndexed(m_command_buffer, + in_index_count, + in_instance_count, + in_first_index, + in_vertex_offset, + in_first_instance); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -2343,7 +2487,8 @@ bool Anvil::CommandBufferBase::record_draw_indexed_indirect(std::shared_ptrget_buffer(), - in_offset, - in_count, - in_stride); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdDrawIndexedIndirect(m_command_buffer, + in_buffer_ptr->get_buffer(), + in_offset, + in_count, + in_stride); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -2392,9 +2543,10 @@ bool Anvil::CommandBufferBase::record_draw_indexed_indirect_count_AMD(std::share uint32_t in_max_draw_count, uint32_t in_stride) { - std::shared_ptr device_locked_ptr(m_device_ptr); + std::shared_ptr device_locked_ptr (m_device_ptr); Anvil::ExtensionAMDDrawIndirectCountEntrypoints entrypoints; - bool result (false); + auto parent_command_pool_locked_ptr(m_parent_command_pool_ptr.lock() ); + bool result (false); if (!m_is_renderpass_active) { @@ -2432,13 +2584,19 @@ bool Anvil::CommandBufferBase::record_draw_indexed_indirect_count_AMD(std::share cache_referenced_buffer(in_buffer_ptr); cache_referenced_buffer(in_count_buffer_ptr); - entrypoints.vkCmdDrawIndexedIndirectCountAMD(m_command_buffer, - in_buffer_ptr->get_buffer(), - in_offset, - in_count_buffer_ptr->get_buffer(), - in_count_offset, - in_max_draw_count, - in_stride); + parent_command_pool_locked_ptr->lock(); + lock(); + { + entrypoints.vkCmdDrawIndexedIndirectCountAMD(m_command_buffer, + in_buffer_ptr->get_buffer(), + in_offset, + in_count_buffer_ptr->get_buffer(), + in_count_offset, + in_max_draw_count, + in_stride); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -2451,7 +2609,8 @@ bool Anvil::CommandBufferBase::record_draw_indirect(std::shared_ptrget_buffer(), - in_offset, - in_count, - in_stride); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdDrawIndirect(m_command_buffer, + in_buffer_ptr->get_buffer(), + in_offset, + in_count, + in_stride); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -2500,9 +2665,10 @@ bool Anvil::CommandBufferBase::record_draw_indirect_count_AMD(std::shared_ptr device_locked_ptr(m_device_ptr); + std::shared_ptr device_locked_ptr (m_device_ptr); Anvil::ExtensionAMDDrawIndirectCountEntrypoints entrypoints; - bool result (false); + auto parent_command_pool_locked_ptr(m_parent_command_pool_ptr.lock() ); + bool result (false); if (!m_is_renderpass_active) { @@ -2540,13 +2706,19 @@ bool Anvil::CommandBufferBase::record_draw_indirect_count_AMD(std::shared_ptrget_buffer(), - in_offset, - in_count_buffer_ptr->get_buffer(), - in_count_offset, - in_max_draw_count, - in_stride); + parent_command_pool_locked_ptr->lock(); + lock(); + { + entrypoints.vkCmdDrawIndirectCountAMD(m_command_buffer, + in_buffer_ptr->get_buffer(), + in_offset, + in_count_buffer_ptr->get_buffer(), + in_count_offset, + in_max_draw_count, + in_stride); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -2558,7 +2730,8 @@ bool Anvil::CommandBufferBase::record_end_query(std::shared_ptrget_query_pool(), - in_entry); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdEndQuery(m_command_buffer, + in_query_pool_ptr->get_query_pool(), + in_entry); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -2594,7 +2773,8 @@ bool Anvil::CommandBufferBase::record_fill_buffer(std::shared_ptr VkDeviceSize in_size, uint32_t in_data) { - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (m_is_renderpass_active) { @@ -2624,11 +2804,17 @@ bool Anvil::CommandBufferBase::record_fill_buffer(std::shared_ptr cache_referenced_buffer(in_dst_buffer_ptr); - vkCmdFillBuffer(m_command_buffer, - in_dst_buffer_ptr->get_buffer(), - in_dst_offset, - in_size, - in_data); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdFillBuffer(m_command_buffer, + in_dst_buffer_ptr->get_buffer(), + in_dst_offset, + in_size, + in_data); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -2650,7 +2836,8 @@ bool Anvil::CommandBufferBase::record_pipeline_barrier(VkPipelineStageFlags VkBufferMemoryBarrier buffer_barriers_vk[100]; VkImageMemoryBarrier image_barriers_vk [100]; VkMemoryBarrier memory_barriers_vk[100]; - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (!m_recording_in_progress) { @@ -2723,16 +2910,22 @@ bool Anvil::CommandBufferBase::record_pipeline_barrier(VkPipelineStageFlags memory_barriers_vk[n_memory_barrier] = in_memory_barriers_ptr[n_memory_barrier].get_barrier_vk(); } - vkCmdPipelineBarrier(m_command_buffer, - in_src_stage_mask, - in_dst_stage_mask, - in_by_region, - in_memory_barrier_count, - memory_barriers_vk, - in_buffer_memory_barrier_count, - buffer_barriers_vk, - in_image_memory_barrier_count, - image_barriers_vk); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdPipelineBarrier(m_command_buffer, + in_src_stage_mask, + in_dst_stage_mask, + in_by_region, + in_memory_barrier_count, + memory_barriers_vk, + in_buffer_memory_barrier_count, + buffer_barriers_vk, + in_image_memory_barrier_count, + image_barriers_vk); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -2747,7 +2940,8 @@ bool Anvil::CommandBufferBase::record_push_constants(std::shared_ptrget_pipeline_layout(), - in_stage_flags, - in_offset, - in_size, - in_values); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdPushConstants(m_command_buffer, + in_layout_ptr->get_pipeline_layout(), + in_stage_flags, + in_offset, + in_size, + in_values); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -2785,7 +2985,8 @@ bool Anvil::CommandBufferBase::record_push_constants(std::shared_ptr in_event_ptr, VkPipelineStageFlags in_stage_mask) { - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (m_is_renderpass_active) { @@ -2813,9 +3014,15 @@ bool Anvil::CommandBufferBase::record_reset_event(std::shared_ptr cache_referenced_event(in_event_ptr); - vkCmdResetEvent(m_command_buffer, - in_event_ptr->get_event(), - in_stage_mask); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdResetEvent(m_command_buffer, + in_event_ptr->get_event(), + in_stage_mask); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -2827,7 +3034,8 @@ bool Anvil::CommandBufferBase::record_reset_query_pool(std::shared_ptrget_query_pool(), - in_start_query, - in_query_count); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdResetQueryPool(m_command_buffer, + in_query_pool_ptr->get_query_pool(), + in_start_query, + in_query_count); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -2874,7 +3088,8 @@ bool Anvil::CommandBufferBase::record_resolve_image(std::shared_ptrget_image(), - in_src_image_layout, - in_dst_image_ptr->get_image(), - in_dst_image_layout, - in_region_count, - in_region_ptrs); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdResolveImage(m_command_buffer, + in_src_image_ptr->get_image(), + in_src_image_layout, + in_dst_image_ptr->get_image(), + in_dst_image_layout, + in_region_count, + in_region_ptrs); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: return result; } + /* Please see header for specification */ bool Anvil::CommandBufferBase::record_set_blend_constants(const float in_blend_constants[4]) { /* Note: Command supported inside and outside the renderpass. */ - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (!m_recording_in_progress) { @@ -2942,8 +3165,14 @@ bool Anvil::CommandBufferBase::record_set_blend_constants(const float in_blend_c } #endif - vkCmdSetBlendConstants(m_command_buffer, - in_blend_constants); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdSetBlendConstants(m_command_buffer, + in_blend_constants); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -2956,7 +3185,8 @@ bool Anvil::CommandBufferBase::record_set_depth_bias(float in_depth_bias_constan float in_slope_scaled_depth_bias) { /* Note: Command supported inside and outside the renderpass. */ - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (!m_recording_in_progress) { @@ -2976,10 +3206,16 @@ bool Anvil::CommandBufferBase::record_set_depth_bias(float in_depth_bias_constan } #endif - vkCmdSetDepthBias(m_command_buffer, - in_depth_bias_constant_factor, - in_depth_bias_clamp, - in_slope_scaled_depth_bias); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdSetDepthBias(m_command_buffer, + in_depth_bias_constant_factor, + in_depth_bias_clamp, + in_slope_scaled_depth_bias); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -2991,7 +3227,8 @@ bool Anvil::CommandBufferBase::record_set_depth_bounds(float in_min_depth_bounds float in_max_depth_bounds) { /* Note: Command supported inside and outside the renderpass. */ - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (!m_recording_in_progress) { @@ -3010,9 +3247,15 @@ bool Anvil::CommandBufferBase::record_set_depth_bounds(float in_min_depth_bounds } #endif - vkCmdSetDepthBounds(m_command_buffer, - in_min_depth_bounds, - in_max_depth_bounds); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdSetDepthBounds(m_command_buffer, + in_min_depth_bounds, + in_max_depth_bounds); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -3023,7 +3266,8 @@ bool Anvil::CommandBufferBase::record_set_depth_bounds(float in_min_depth_bounds bool Anvil::CommandBufferBase::record_set_event(std::shared_ptr in_event_ptr, VkPipelineStageFlags in_stage_mask) { - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (m_is_renderpass_active) { @@ -3051,9 +3295,15 @@ bool Anvil::CommandBufferBase::record_set_event(std::shared_ptr in cache_referenced_event(in_event_ptr); - vkCmdSetEvent(m_command_buffer, - in_event_ptr->get_event(), - in_stage_mask); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdSetEvent(m_command_buffer, + in_event_ptr->get_event(), + in_stage_mask); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -3064,7 +3314,8 @@ bool Anvil::CommandBufferBase::record_set_event(std::shared_ptr in bool Anvil::CommandBufferBase::record_set_line_width(float in_line_width) { /* Note: Command supported inside and outside the renderpass. */ - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (!m_recording_in_progress) { @@ -3082,8 +3333,14 @@ bool Anvil::CommandBufferBase::record_set_line_width(float in_line_width) } #endif - vkCmdSetLineWidth(m_command_buffer, - in_line_width); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdSetLineWidth(m_command_buffer, + in_line_width); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -3096,7 +3353,8 @@ bool Anvil::CommandBufferBase::record_set_scissor(uint32_t in_first_sciss const VkRect2D* in_scissor_ptrs) { /* Note: Command supported inside and outside the renderpass. */ - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (!m_recording_in_progress) { @@ -3116,10 +3374,16 @@ bool Anvil::CommandBufferBase::record_set_scissor(uint32_t in_first_sciss } #endif - vkCmdSetScissor(m_command_buffer, - in_first_scissor, - in_scissor_count, - in_scissor_ptrs); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdSetScissor(m_command_buffer, + in_first_scissor, + in_scissor_count, + in_scissor_ptrs); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -3131,7 +3395,8 @@ bool Anvil::CommandBufferBase::record_set_stencil_compare_mask(VkStencilFaceFlag uint32_t in_stencil_compare_mask) { /* Note: Command supported inside and outside the renderpass. */ - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (!m_recording_in_progress) { @@ -3150,9 +3415,15 @@ bool Anvil::CommandBufferBase::record_set_stencil_compare_mask(VkStencilFaceFlag } #endif - vkCmdSetStencilCompareMask(m_command_buffer, - in_face_mask, - in_stencil_compare_mask); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdSetStencilCompareMask(m_command_buffer, + in_face_mask, + in_stencil_compare_mask); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -3164,7 +3435,8 @@ bool Anvil::CommandBufferBase::record_set_stencil_reference(VkStencilFaceFlags i uint32_t in_stencil_reference) { /* Note: Command supported inside and outside the renderpass. */ - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (!m_recording_in_progress) { @@ -3183,9 +3455,15 @@ bool Anvil::CommandBufferBase::record_set_stencil_reference(VkStencilFaceFlags i } #endif - vkCmdSetStencilReference(m_command_buffer, - in_face_mask, - in_stencil_reference); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdSetStencilReference(m_command_buffer, + in_face_mask, + in_stencil_reference); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -3197,7 +3475,8 @@ bool Anvil::CommandBufferBase::record_set_stencil_write_mask(VkStencilFaceFlags uint32_t in_stencil_write_mask) { /* Note: Command supported inside and outside the renderpass. */ - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (!m_recording_in_progress) { @@ -3216,9 +3495,15 @@ bool Anvil::CommandBufferBase::record_set_stencil_write_mask(VkStencilFaceFlags } #endif - vkCmdSetStencilWriteMask(m_command_buffer, - in_face_mask, - in_stencil_write_mask); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdSetStencilWriteMask(m_command_buffer, + in_face_mask, + in_stencil_write_mask); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -3231,7 +3516,8 @@ bool Anvil::CommandBufferBase::record_set_viewport(uint32_t in_first_vi const VkViewport* in_viewport_ptrs) { /* Note: Command supported inside and outside the renderpass. */ - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (!m_recording_in_progress) { @@ -3251,10 +3537,16 @@ bool Anvil::CommandBufferBase::record_set_viewport(uint32_t in_first_vi } #endif - vkCmdSetViewport(m_command_buffer, - in_first_viewport, - in_viewport_count, - in_viewport_ptrs); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdSetViewport(m_command_buffer, + in_first_viewport, + in_viewport_count, + in_viewport_ptrs); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -3267,7 +3559,8 @@ bool Anvil::CommandBufferBase::record_update_buffer(std::shared_ptrget_buffer(), - in_dst_offset, - in_data_size, - in_data_ptr); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdUpdateBuffer(m_command_buffer, + in_dst_buffer_ptr->get_buffer(), + in_dst_offset, + in_data_size, + in_data_ptr); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -3326,7 +3625,8 @@ bool Anvil::CommandBufferBase::record_wait_events(uint32_t VkBufferMemoryBarrier buffer_barriers_vk[100]; VkImageMemoryBarrier image_barriers_vk [100]; VkMemoryBarrier memory_barriers_vk[100]; - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; anvil_assert(in_event_count > 0); /* as per spec - easy to miss */ anvil_assert(in_event_count < sizeof(events) / sizeof(events [0]) ); @@ -3393,17 +3693,23 @@ bool Anvil::CommandBufferBase::record_wait_events(uint32_t memory_barriers_vk[n_memory_barrier] = in_memory_barriers_ptr[n_memory_barrier].get_barrier_vk(); } - vkCmdWaitEvents(m_command_buffer, - in_event_count, - events, - in_src_stage_mask, - in_dst_stage_mask, - in_memory_barrier_count, - memory_barriers_vk, - in_buffer_memory_barrier_count, - buffer_barriers_vk, - in_image_memory_barrier_count, - image_barriers_vk); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdWaitEvents(m_command_buffer, + in_event_count, + events, + in_src_stage_mask, + in_dst_stage_mask, + in_memory_barrier_count, + memory_barriers_vk, + in_buffer_memory_barrier_count, + buffer_barriers_vk, + in_image_memory_barrier_count, + image_barriers_vk); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -3416,7 +3722,8 @@ bool Anvil::CommandBufferBase::record_write_timestamp(VkPipelineStageFlagBits Anvil::QueryIndex in_query_index) { /* NOTE: The command can be executed both inside and outside a renderpass */ - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (!m_recording_in_progress) { @@ -3438,10 +3745,16 @@ bool Anvil::CommandBufferBase::record_write_timestamp(VkPipelineStageFlagBits cache_referenced_query_pool(in_query_pool_ptr); - vkCmdWriteTimestamp(m_command_buffer, - in_pipeline_stage, - in_query_pool_ptr->get_query_pool(), - in_query_index); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdWriteTimestamp(m_command_buffer, + in_pipeline_stage, + in_query_pool_ptr->get_query_pool(), + in_query_index); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -3461,8 +3774,12 @@ bool Anvil::CommandBufferBase::reset(bool in_should_release_resources) goto end; } - result_vk = vkResetCommandBuffer(m_command_buffer, - (in_should_release_resources) ? VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT : 0u); + lock(); + { + result_vk = vkResetCommandBuffer(m_command_buffer, + (in_should_release_resources) ? VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT : 0u); + } + unlock(); if (!is_vk_call_successful(result_vk) ) { @@ -3485,7 +3802,8 @@ bool Anvil::CommandBufferBase::reset(bool in_should_release_resources) /* Please see header for specification */ bool Anvil::CommandBufferBase::stop_recording() { - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; VkResult result_vk; if (!m_recording_in_progress) @@ -3495,7 +3813,13 @@ bool Anvil::CommandBufferBase::stop_recording() goto end; } - result_vk = vkEndCommandBuffer(m_command_buffer); + parent_command_pool_locked_ptr->lock(); + lock(); + { + result_vk = vkEndCommandBuffer(m_command_buffer); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); if (!is_vk_call_successful(result_vk)) { @@ -3512,11 +3836,12 @@ bool Anvil::CommandBufferBase::stop_recording() /* Please see header for specification */ Anvil::PrimaryCommandBuffer::PrimaryCommandBuffer(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_command_pool_ptr) + std::shared_ptr in_parent_command_pool_ptr, + bool in_mt_safe) :CommandBufferBase(in_device_ptr, in_parent_command_pool_ptr, - COMMAND_BUFFER_TYPE_PRIMARY) - + COMMAND_BUFFER_TYPE_PRIMARY, + in_mt_safe) { VkCommandBufferAllocateInfo alloc_info; std::shared_ptr device_locked_ptr(in_device_ptr); @@ -3530,12 +3855,15 @@ Anvil::PrimaryCommandBuffer::PrimaryCommandBuffer(std::weak_ptrget_device_vk(), - &alloc_info, - &m_command_buffer); + in_parent_command_pool_ptr->lock(); + { + result_vk = vkAllocateCommandBuffers(device_locked_ptr->get_device_vk(), + &alloc_info, + &m_command_buffer); + } + in_parent_command_pool_ptr->unlock(); anvil_assert_vk_call_succeeded(result_vk); - } /* Please see header for specification */ @@ -3546,10 +3874,11 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t std::shared_ptr in_render_pass_ptr, VkSubpassContents in_contents) { - std::weak_ptr physical_device_ptr; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); VkRenderPassBeginInfo render_pass_begin_info; - bool result = false; - std::shared_ptr sgpu_device_locked_ptr(std::dynamic_pointer_cast(m_device_ptr.lock() ) ); + bool result = false; + auto sgpu_device_locked_ptr = std::shared_ptr(std::dynamic_pointer_cast(m_device_ptr.lock() ) ); + std::weak_ptr physical_device_ptr = sgpu_device_locked_ptr->get_physical_device(); if (m_is_renderpass_active) { @@ -3565,11 +3894,6 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t goto end; } - - anvil_assert(sgpu_device_locked_ptr != nullptr); /* User attempted to call this function prototype with in_n_physical_devices set to 0 */ - - physical_device_ptr = sgpu_device_locked_ptr->get_physical_device(); - #ifdef STORE_COMMAND_BUFFER_COMMANDS { if (!m_command_stashing_disabled) @@ -3577,9 +3901,7 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t m_commands.push_back(BeginRenderPassCommand(in_n_clear_values, in_clear_value_ptrs, in_fbo_ptr, - 1, /* in_n_physical_devices */ - &physical_device_ptr, - &in_render_area, + in_render_area, in_render_pass_ptr, in_contents) ); } @@ -3597,9 +3919,15 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t cache_referenced_framebuffer(in_fbo_ptr); cache_referenced_renderpass (in_render_pass_ptr); - vkCmdBeginRenderPass(m_command_buffer, - &render_pass_begin_info, - in_contents); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdBeginRenderPass(m_command_buffer, + &render_pass_begin_info, + in_contents); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); m_is_renderpass_active = true; result = true; @@ -3610,7 +3938,8 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t /* Please see header for specification */ bool Anvil::PrimaryCommandBuffer::record_end_render_pass() { - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (!m_is_renderpass_active) { @@ -3635,7 +3964,13 @@ bool Anvil::PrimaryCommandBuffer::record_end_render_pass() } #endif - vkCmdEndRenderPass(m_command_buffer); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdEndRenderPass(m_command_buffer); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); m_is_renderpass_active = false; result = true; @@ -3643,14 +3978,14 @@ bool Anvil::PrimaryCommandBuffer::record_end_render_pass() return result; } - /* Please see header for specification */ bool Anvil::PrimaryCommandBuffer::record_execute_commands(uint32_t in_cmd_buffers_count, std::shared_ptr* in_cmd_buffer_ptrs) { /* NOTE: The command can be executed both inside and outside a renderpass */ VkCommandBuffer cmd_buffers[100]; - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; anvil_assert(in_cmd_buffers_count < sizeof(cmd_buffers) / sizeof(cmd_buffers[0]) ); @@ -3680,9 +4015,15 @@ bool Anvil::PrimaryCommandBuffer::record_execute_commands(uint32_t cache_referenced_command_buffer(in_cmd_buffer_ptrs[n_cmd_buffer]); } - vkCmdExecuteCommands(m_command_buffer, - in_cmd_buffers_count, - cmd_buffers); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdExecuteCommands(m_command_buffer, + in_cmd_buffers_count, + cmd_buffers); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -3692,7 +4033,8 @@ bool Anvil::PrimaryCommandBuffer::record_execute_commands(uint32_t /* Please see header for specification */ bool Anvil::PrimaryCommandBuffer::record_next_subpass(VkSubpassContents in_contents) { - bool result = false; + auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); + bool result = false; if (!m_is_renderpass_active) { @@ -3717,8 +4059,14 @@ bool Anvil::PrimaryCommandBuffer::record_next_subpass(VkSubpassContents in_conte } #endif - vkCmdNextSubpass(m_command_buffer, - in_contents); + parent_command_pool_locked_ptr->lock(); + lock(); + { + vkCmdNextSubpass(m_command_buffer, + in_contents); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); result = true; end: @@ -3730,8 +4078,9 @@ bool Anvil::PrimaryCommandBuffer::start_recording(bool in_one_time_submit, bool in_simultaneous_use_allowed) { VkCommandBufferBeginInfo command_buffer_begin_info; - std::shared_ptr device_locked_ptr (m_device_ptr); - bool result (false); + std::shared_ptr device_locked_ptr (m_device_ptr); + auto parent_command_pool_locked_ptr(m_parent_command_pool_ptr.lock() ); + bool result (false); VkResult result_vk; if (m_recording_in_progress) @@ -3747,8 +4096,14 @@ bool Anvil::PrimaryCommandBuffer::start_recording(bool in_one_time_submit, command_buffer_begin_info.pInheritanceInfo = nullptr; /* Only relevant for secondary-level command buffers */ command_buffer_begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO; - result_vk = vkBeginCommandBuffer(m_command_buffer, - &command_buffer_begin_info); + parent_command_pool_locked_ptr->lock(); + lock(); + { + result_vk = vkBeginCommandBuffer(m_command_buffer, + &command_buffer_begin_info); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); if (!is_vk_call_successful(result_vk) ) { @@ -3776,10 +4131,12 @@ bool Anvil::PrimaryCommandBuffer::start_recording(bool in_one_time_submit, /* Please see header for specification */ Anvil::SecondaryCommandBuffer::SecondaryCommandBuffer(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_command_pool_ptr) + std::shared_ptr in_parent_command_pool_ptr, + bool in_mt_safe) :CommandBufferBase(in_device_ptr, in_parent_command_pool_ptr, - COMMAND_BUFFER_TYPE_SECONDARY) + COMMAND_BUFFER_TYPE_SECONDARY, + in_mt_safe) { VkCommandBufferAllocateInfo command_buffer_alloc_info; std::shared_ptr device_locked_ptr(in_device_ptr); @@ -3793,9 +4150,13 @@ Anvil::SecondaryCommandBuffer::SecondaryCommandBuffer(std::weak_ptrget_device_vk(), - &command_buffer_alloc_info, - &m_command_buffer); + in_parent_command_pool_ptr->lock(); + { + result_vk = vkAllocateCommandBuffers(device_locked_ptr->get_device_vk(), + &command_buffer_alloc_info, + &m_command_buffer); + } + in_parent_command_pool_ptr->unlock(); anvil_assert_vk_call_succeeded(result_vk); } @@ -3814,7 +4175,8 @@ bool Anvil::SecondaryCommandBuffer::start_recording(bool VkCommandBufferBeginInfo command_buffer_begin_info; VkCommandBufferInheritanceInfo command_buffer_inheritance_info; std::shared_ptr device_locked_ptr (m_device_ptr); - bool result = false; + auto parent_command_pool_locked_ptr (m_parent_command_pool_ptr.lock() ); + bool result (false); VkResult result_vk; if (m_recording_in_progress) @@ -3851,8 +4213,14 @@ bool Anvil::SecondaryCommandBuffer::start_recording(bool cache_referenced_renderpass(in_render_pass_ptr); } - result_vk = vkBeginCommandBuffer(m_command_buffer, - &command_buffer_begin_info); + parent_command_pool_locked_ptr->lock(); + lock(); + { + result_vk = vkBeginCommandBuffer(m_command_buffer, + &command_buffer_begin_info); + } + unlock(); + parent_command_pool_locked_ptr->unlock(); if (!is_vk_call_successful(result_vk) ) { @@ -3871,6 +4239,7 @@ bool Anvil::SecondaryCommandBuffer::start_recording(bool clear_referenced_objects(); m_is_renderpass_active = in_renderpass_usage_only; + m_recording_in_progress = true; result = true; diff --git a/src/wrappers/command_pool.cpp b/src/wrappers/command_pool.cpp index f70dae69..c9a17bcb 100644 --- a/src/wrappers/command_pool.cpp +++ b/src/wrappers/command_pool.cpp @@ -33,10 +33,12 @@ Anvil::CommandPool::CommandPool(std::weak_ptr in_device_ptr, bool in_transient_allocations_friendly, bool in_support_per_cmdbuf_reset_ops, - Anvil::QueueFamilyType in_queue_family) + Anvil::QueueFamilyType in_queue_family, + bool in_mt_safe) :DebugMarkerSupportProvider (in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT), + MTSafetySupportProvider (in_mt_safe), m_command_pool (VK_NULL_HANDLE), m_device_ptr (in_device_ptr), m_is_transient_allocations_friendly(in_transient_allocations_friendly), @@ -88,9 +90,13 @@ Anvil::CommandPool::~CommandPool() { std::shared_ptr device_locked_ptr(m_device_ptr); - vkDestroyCommandPool(device_locked_ptr->get_device_vk(), - m_command_pool, - nullptr /* pAllocator */); + lock(); + { + vkDestroyCommandPool(device_locked_ptr->get_device_vk(), + m_command_pool, + nullptr /* pAllocator */); + } + unlock(); m_command_pool = VK_NULL_HANDLE; } @@ -99,8 +105,13 @@ Anvil::CommandPool::~CommandPool() /* Please see header for specification */ std::shared_ptr Anvil::CommandPool::alloc_primary_level_command_buffer() { - std::shared_ptr new_buffer_ptr(new PrimaryCommandBuffer(m_device_ptr, - shared_from_this() )); + std::shared_ptr new_buffer_ptr; + + new_buffer_ptr.reset( + new PrimaryCommandBuffer(m_device_ptr, + shared_from_this(), + is_mt_safe() ) + ); return new_buffer_ptr; } @@ -108,8 +119,13 @@ std::shared_ptr Anvil::CommandPool::alloc_primary_l /* Please see header for specification */ std::shared_ptr Anvil::CommandPool::alloc_secondary_level_command_buffer() { - std::shared_ptr new_buffer_ptr(new SecondaryCommandBuffer(m_device_ptr, - shared_from_this() )); + std::shared_ptr new_buffer_ptr; + + new_buffer_ptr.reset( + new SecondaryCommandBuffer(m_device_ptr, + shared_from_this(), + is_mt_safe() ) + ); return new_buffer_ptr; } @@ -118,15 +134,19 @@ std::shared_ptr Anvil::CommandPool::alloc_seconda std::shared_ptr Anvil::CommandPool::create(std::weak_ptr in_device_ptr, bool in_transient_allocations_friendly, bool in_support_per_cmdbuf_reset_ops, - Anvil::QueueFamilyType in_queue_family) + Anvil::QueueFamilyType in_queue_family, + MTSafety in_mt_safety) { + const bool is_mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); std::shared_ptr result_ptr; result_ptr.reset( new Anvil::CommandPool(in_device_ptr, in_transient_allocations_friendly, in_support_per_cmdbuf_reset_ops, - in_queue_family) + in_queue_family, + is_mt_safe) ); return result_ptr; @@ -136,11 +156,16 @@ std::shared_ptr Anvil::CommandPool::create(std::weak_ptr device_locked_ptr(m_device_ptr); + std::unique_lock mutex_lock; VkResult result_vk; - result_vk = vkResetCommandPool(device_locked_ptr->get_device_vk(), - m_command_pool, - ((in_release_resources) ? VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT : 0u) ); + lock(); + { + result_vk = vkResetCommandPool(device_locked_ptr->get_device_vk(), + m_command_pool, + ((in_release_resources) ? VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT : 0u) ); + } + unlock(); anvil_assert_vk_call_succeeded(result_vk); @@ -154,9 +179,13 @@ void Anvil::CommandPool::trim() if (device_locked_ptr->is_khr_maintenance1_extension_enabled() ) { - device_locked_ptr->get_extension_khr_maintenance1_entrypoints().vkTrimCommandPoolKHR(device_locked_ptr->get_device_vk(), - m_command_pool, - 0); /* flags */ + lock(); + { + device_locked_ptr->get_extension_khr_maintenance1_entrypoints().vkTrimCommandPoolKHR(device_locked_ptr->get_device_vk(), + m_command_pool, + 0); /* flags */ + } + unlock(); } else { diff --git a/src/wrappers/compute_pipeline_manager.cpp b/src/wrappers/compute_pipeline_manager.cpp index f9546261..264cf26d 100644 --- a/src/wrappers/compute_pipeline_manager.cpp +++ b/src/wrappers/compute_pipeline_manager.cpp @@ -20,6 +20,7 @@ // THE SOFTWARE. // +#include "misc/compute_pipeline_info.h" #include "misc/debug.h" #include "misc/object_tracker.h" #include "wrappers/compute_pipeline_manager.h" @@ -30,21 +31,12 @@ #include -/** Constructor. Initializes the compute pipeline manager. - * - * @param in_device_ptr Device to use. - * @param in_use_pipeline_cache true if a VkPipelineCache instance should be used to spawn new pipeline objects. - * What pipeline cache ends up being used depends on @param pipeline_cache_to_reuse - - * if a nullptr object is passed via this argument, a new pipeline cache instance will - * be created, and later released by the destructor. If a non-nullptr object is passed, - * it will be used instead. In the latter scenario, it is the caller's responsibility - * to release the cache when no longer needed! - * @param in_pipeline_cache_to_reuse Please see above. - **/ Anvil::ComputePipelineManager::ComputePipelineManager(std::weak_ptr in_device_ptr, + bool in_mt_safe, bool in_use_pipeline_cache, std::shared_ptr in_pipeline_cache_to_reuse_ptr) :BasePipelineManager(in_device_ptr, + in_mt_safe, in_use_pipeline_cache, in_pipeline_cache_to_reuse_ptr) { @@ -61,7 +53,8 @@ Anvil::ComputePipelineManager::~ComputePipelineManager() Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_COMPUTE_PIPELINE_MANAGER, this); - m_pipelines.clear(); + m_baked_pipelines.clear (); + m_outstanding_pipelines.clear(); } /** Re-creates Vulkan compute pipeline objects for all added non-proxy pipelines marked @@ -72,79 +65,83 @@ Anvil::ComputePipelineManager::~ComputePipelineManager() **/ bool Anvil::ComputePipelineManager::bake() { - std::shared_ptr locked_device_ptr(m_device_ptr); - std::vector pipeline_create_info_items_vk; - bool result = false; - std::vector result_pipeline_items_vk; - VkResult result_vk; - std::vector > specialization_map_entries_vk(m_pipelines.size() ); - std::vector specialization_info_vk(m_pipelines.size()); - - typedef struct _bake_item + typedef struct BakeItem { VkComputePipelineCreateInfo create_info; - std::shared_ptr pipeline_ptr; + PipelineID pipeline_id; + Pipeline* pipeline_ptr; - _bake_item(const VkComputePipelineCreateInfo& in_create_info, - std::shared_ptr in_pipeline_ptr) + BakeItem(const VkComputePipelineCreateInfo& in_create_info, + PipelineID in_pipeline_id, + Pipeline* in_pipeline_ptr) { create_info = in_create_info; + pipeline_id = in_pipeline_id; pipeline_ptr = in_pipeline_ptr; } - bool operator==(std::shared_ptr in_pipeline_ptr) + bool operator==(const PipelineID& in_pipeline_id) const { - return pipeline_ptr == in_pipeline_ptr; + return pipeline_id == in_pipeline_id; } - } _bake_item; + } BakeItem; + + std::map > layout_to_bake_item_map; + std::shared_ptr locked_device_ptr (m_device_ptr); + std::unique_lock mutex_lock; + auto mutex_ptr (get_mutex() ); + uint32_t n_current_pipeline (0); + std::vector pipeline_create_info_items_vk; + bool result (false); + std::vector result_pipeline_items_vk; + VkResult result_vk; + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } - std::map > layout_to_bake_item_map; - uint32_t n_current_pipeline = 0; + std::vector > specialization_map_entries_vk(m_outstanding_pipelines.size() ); + std::vector specialization_info_vk (m_outstanding_pipelines.size()); - /* Iterate over all compute pipelines and identify the ones marked as dirty. Only these - * need to be re-created */ - for (auto pipeline_iterator = m_pipelines.begin(); - pipeline_iterator != m_pipelines.end(); + for (auto pipeline_iterator = m_outstanding_pipelines.begin(); + pipeline_iterator != m_outstanding_pipelines.end(); ++pipeline_iterator, ++n_current_pipeline) { - std::shared_ptr current_pipeline_ptr = pipeline_iterator->second; - VkComputePipelineCreateInfo pipeline_create_info; + auto current_pipeline_id = pipeline_iterator->first; + Pipeline* current_pipeline_ptr = pipeline_iterator->second.get(); + const auto current_pipeline_info_ptr = current_pipeline_ptr->pipeline_info_ptr.get(); + VkComputePipelineCreateInfo pipeline_create_info; + const Anvil::ShaderModuleStageEntryPoint* shader_stage_entry_point_ptr = nullptr; + const unsigned char* specialization_constants_data_buffer_ptr = nullptr; + const SpecializationConstants* specialization_constants_ptr = nullptr; - if (!current_pipeline_ptr->dirty || - current_pipeline_ptr->is_proxy) - { - continue; - } + anvil_assert(current_pipeline_ptr->baked_pipeline == VK_NULL_HANDLE); - if (current_pipeline_ptr->baked_pipeline != VK_NULL_HANDLE) - { - vkDestroyPipeline(locked_device_ptr->get_device_vk(), - current_pipeline_ptr->baked_pipeline, - nullptr /* pAllocator */); - - current_pipeline_ptr->baked_pipeline = VK_NULL_HANDLE; - } - - if (current_pipeline_ptr->layout_dirty) + if (current_pipeline_ptr->layout_ptr == nullptr) { current_pipeline_ptr->layout_ptr = get_pipeline_layout(pipeline_iterator->first); } - if (current_pipeline_ptr->specialization_constants_map[0].size() > 0) - { - anvil_assert(current_pipeline_ptr->specialization_constant_data_buffer.size() > 0); + current_pipeline_info_ptr->get_specialization_constants(Anvil::SHADER_STAGE_COMPUTE, + &specialization_constants_ptr, + &specialization_constants_data_buffer_ptr); - bake_specialization_info_vk(current_pipeline_ptr->specialization_constants_map.at (0), - ¤t_pipeline_ptr->specialization_constant_data_buffer.at(0), - &specialization_map_entries_vk[n_current_pipeline], - &specialization_info_vk[n_current_pipeline]); + if (specialization_constants_ptr->size() > 0) + { + bake_specialization_info_vk(*specialization_constants_ptr, + specialization_constants_data_buffer_ptr, + &specialization_map_entries_vk[n_current_pipeline], + &specialization_info_vk [n_current_pipeline]); } /* Prepare the Vulkan create info descriptor & store it in the map for later baking */ - if (current_pipeline_ptr->base_pipeline_ptr != nullptr) - { - anvil_assert(current_pipeline_ptr->base_pipeline == VK_NULL_HANDLE); + const auto current_pipeline_base_pipeline_id = current_pipeline_info_ptr->get_base_pipeline_id(); + if (current_pipeline_base_pipeline_id != UINT32_MAX) + { /* There are three cases we need to handle separately here: * * 1. The base pipeline is to be baked in the call we're preparing for. Determine @@ -158,21 +155,21 @@ bool Anvil::ComputePipelineManager::bake() auto& pipeline_vector = layout_to_bake_item_map[pipeline_create_info.layout]; auto base_pipeline_iterator = std::find(pipeline_vector.begin(), pipeline_vector.end(), - current_pipeline_ptr->base_pipeline_ptr); + current_pipeline_ptr->pipeline_info_ptr->get_base_pipeline_id() ); if (base_pipeline_iterator != pipeline_vector.end() ) { /* Case 1 */ - pipeline_create_info.basePipelineHandle = current_pipeline_ptr->base_pipeline; + pipeline_create_info.basePipelineHandle = VK_NULL_HANDLE; pipeline_create_info.basePipelineIndex = static_cast(base_pipeline_iterator - pipeline_vector.begin() ); } else - if (current_pipeline_ptr->base_pipeline_ptr != nullptr && - current_pipeline_ptr->base_pipeline_ptr->baked_pipeline != VK_NULL_HANDLE) + if (base_pipeline_iterator->pipeline_ptr != nullptr && + base_pipeline_iterator->pipeline_ptr->baked_pipeline != VK_NULL_HANDLE) { /* Case 2 */ - pipeline_create_info.basePipelineHandle = current_pipeline_ptr->base_pipeline_ptr->baked_pipeline; - pipeline_create_info.basePipelineIndex = UINT32_MAX; /* unused. */ + pipeline_create_info.basePipelineHandle = base_pipeline_iterator->pipeline_ptr->baked_pipeline; + pipeline_create_info.basePipelineIndex = UINT32_MAX; } else { @@ -181,46 +178,45 @@ bool Anvil::ComputePipelineManager::bake() } } else - if (current_pipeline_ptr->base_pipeline != VK_NULL_HANDLE) - { - pipeline_create_info.basePipelineHandle = current_pipeline_ptr->base_pipeline; - pipeline_create_info.basePipelineIndex = UINT32_MAX; /* unused. */ - } - else { /* No base pipeline requested */ pipeline_create_info.basePipelineHandle = VK_NULL_HANDLE; - pipeline_create_info.basePipelineIndex = UINT32_MAX; /* unused */ + pipeline_create_info.basePipelineIndex = UINT32_MAX; } - anvil_assert(!current_pipeline_ptr->layout_dirty); + anvil_assert(current_pipeline_ptr->layout_ptr != nullptr); + + current_pipeline_info_ptr->get_shader_stage_properties(Anvil::SHADER_STAGE_COMPUTE, + &shader_stage_entry_point_ptr); pipeline_create_info.flags = 0; pipeline_create_info.layout = current_pipeline_ptr->layout_ptr->get_pipeline_layout(); pipeline_create_info.pNext = VK_NULL_HANDLE; pipeline_create_info.stage.flags = 0; - pipeline_create_info.stage.pName = current_pipeline_ptr->shader_stages[0].name.c_str(); + pipeline_create_info.stage.pName = shader_stage_entry_point_ptr->name.c_str(); pipeline_create_info.stage.pNext = nullptr; - pipeline_create_info.stage.pSpecializationInfo = (current_pipeline_ptr->specialization_constants_map[0].size() > 0) ? &specialization_info_vk[n_current_pipeline] - : VK_NULL_HANDLE; + pipeline_create_info.stage.pSpecializationInfo = (specialization_constants_ptr->size() > 0) ? &specialization_info_vk[n_current_pipeline] + : VK_NULL_HANDLE; pipeline_create_info.stage.stage = VK_SHADER_STAGE_COMPUTE_BIT; pipeline_create_info.stage.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; pipeline_create_info.sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO; - pipeline_create_info.stage.module = current_pipeline_ptr->shader_stages[0].shader_module_ptr->get_module(); + pipeline_create_info.stage.module = shader_stage_entry_point_ptr->shader_module_ptr->get_module(); + + anvil_assert(pipeline_create_info.stage.module != VK_NULL_HANDLE); - if (pipeline_create_info.basePipelineHandle != VK_NULL_HANDLE || - pipeline_create_info.basePipelineIndex != INT32_MAX) + if (pipeline_create_info.basePipelineHandle != VK_NULL_HANDLE || + pipeline_create_info.basePipelineIndex != static_cast(UINT32_MAX) ) { pipeline_create_info.flags |= VK_PIPELINE_CREATE_DERIVATIVE_BIT; } - pipeline_create_info.flags |= ((current_pipeline_ptr->allow_derivatives) ? VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT : 0) | - ((current_pipeline_ptr->disable_optimizations) ? VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT : 0) | - ((pipeline_create_info.basePipelineHandle != VK_NULL_HANDLE) ? VK_PIPELINE_CREATE_DERIVATIVE_BIT : 0); + pipeline_create_info.flags |= ((current_pipeline_info_ptr->allows_derivatives () ) ? VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT : 0) | + ((current_pipeline_info_ptr->has_optimizations_disabled() ) ? VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT : 0); - layout_to_bake_item_map[pipeline_create_info.layout].push_back(_bake_item(pipeline_create_info, - current_pipeline_ptr) ); + layout_to_bake_item_map[pipeline_create_info.layout].push_back(BakeItem(pipeline_create_info, + current_pipeline_id, + current_pipeline_ptr) ); } /* We can finally bake the pipeline objects. */ @@ -236,19 +232,23 @@ bool Anvil::ComputePipelineManager::bake() item_iterator != map_iterator->second.end(); ++item_iterator) { - const _bake_item& current_bake_item = *item_iterator; + const BakeItem& current_bake_item = *item_iterator; pipeline_create_info_items_vk.push_back(current_bake_item.create_info); } result_pipeline_items_vk.resize(pipeline_create_info_items_vk.size() ); - result_vk = vkCreateComputePipelines(locked_device_ptr->get_device_vk(), - m_pipeline_cache_ptr->get_pipeline_cache(), - (uint32_t) pipeline_create_info_items_vk.size(), - &pipeline_create_info_items_vk[0], - nullptr, /* pAllocator */ - &result_pipeline_items_vk[0]); + m_pipeline_cache_ptr->lock(); + { + result_vk = vkCreateComputePipelines(locked_device_ptr->get_device_vk(), + m_pipeline_cache_ptr->get_pipeline_cache(), + static_cast(pipeline_create_info_items_vk.size() ), + &pipeline_create_info_items_vk[0], + nullptr, /* pAllocator */ + &result_pipeline_items_vk[0]); + } + m_pipeline_cache_ptr->unlock(); if (!is_vk_call_successful(result_vk)) { @@ -261,15 +261,22 @@ bool Anvil::ComputePipelineManager::bake() item_iterator != map_iterator->second.end(); ++item_iterator, ++n_current_item) { - const _bake_item& current_bake_item = *item_iterator; + const BakeItem& current_bake_item = *item_iterator; - anvil_assert(result_pipeline_items_vk[n_current_item] != VK_NULL_HANDLE); + anvil_assert(m_baked_pipelines.find(current_bake_item.pipeline_id) == m_baked_pipelines.end() ); + anvil_assert(result_pipeline_items_vk[n_current_item] != VK_NULL_HANDLE); current_bake_item.pipeline_ptr->baked_pipeline = result_pipeline_items_vk[n_current_item]; - current_bake_item.pipeline_ptr->dirty = false; } } + for (auto& current_baked_pipeline : m_outstanding_pipelines) + { + m_baked_pipelines[current_baked_pipeline.first] = std::move(current_baked_pipeline.second); + } + + m_outstanding_pipelines.clear(); + /* All done */ result = true; end: @@ -278,6 +285,7 @@ bool Anvil::ComputePipelineManager::bake() /* Please see header for specification */ std::shared_ptr Anvil::ComputePipelineManager::create(std::weak_ptr in_device_ptr, + bool in_mt_safe, bool in_use_pipeline_cache, std::shared_ptr in_pipeline_cache_to_reuse_ptr) { @@ -285,9 +293,10 @@ std::shared_ptr Anvil::ComputePipelineManager::cr result_ptr.reset( new Anvil::ComputePipelineManager(in_device_ptr, + in_mt_safe, in_use_pipeline_cache, in_pipeline_cache_to_reuse_ptr) ); return result_ptr; -} \ No newline at end of file +} diff --git a/src/wrappers/descriptor_pool.cpp b/src/wrappers/descriptor_pool.cpp index fe1526ef..b85208c1 100644 --- a/src/wrappers/descriptor_pool.cpp +++ b/src/wrappers/descriptor_pool.cpp @@ -31,10 +31,12 @@ /* Please see header for specification */ Anvil::DescriptorPool::DescriptorPool(std::weak_ptr in_device_ptr, uint32_t in_n_max_sets, - bool in_releaseable_sets) + bool in_releaseable_sets, + bool in_mt_safe) :CallbacksSupportProvider (DESCRIPTOR_POOL_CALLBACK_ID_COUNT), DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT), + MTSafetySupportProvider (in_mt_safe), m_baked (false), m_device_ptr (in_device_ptr), m_n_max_sets (in_n_max_sets), @@ -61,9 +63,13 @@ Anvil::DescriptorPool::~DescriptorPool() { std::shared_ptr device_locked_ptr(m_device_ptr); - vkDestroyDescriptorPool(device_locked_ptr->get_device_vk(), - m_pool, - nullptr /* pAllocator */); + lock(); + { + vkDestroyDescriptorPool(device_locked_ptr->get_device_vk(), + m_pool, + nullptr /* pAllocator */); + } + unlock(); m_pool = VK_NULL_HANDLE; } @@ -93,7 +99,8 @@ bool Anvil::DescriptorPool::alloc_descriptor_sets(uint32_t out_descriptor_sets_ptr[n_set] = Anvil::DescriptorSet::create(m_device_ptr, shared_from_this(), in_descriptor_set_layouts_ptr[n_set], - m_ds_cache[n_set]); + m_ds_cache[n_set], + Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); } } @@ -132,9 +139,13 @@ bool Anvil::DescriptorPool::alloc_descriptor_sets(uint32_t ds_alloc_info.pSetLayouts = &m_ds_layout_cache[0]; ds_alloc_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO; - result_vk = vkAllocateDescriptorSets(device_locked_ptr->get_device_vk(), - &ds_alloc_info, - out_descriptor_sets_vk_ptr); + lock(); + { + result_vk = vkAllocateDescriptorSets(device_locked_ptr->get_device_vk(), + &ds_alloc_info, + out_descriptor_sets_vk_ptr); + } + unlock(); if (out_opt_result_ptr != nullptr) { @@ -157,9 +168,13 @@ void Anvil::DescriptorPool::bake() if (m_pool != VK_NULL_HANDLE) { - vkDestroyDescriptorPool(device_locked_ptr->get_device_vk(), - m_pool, - nullptr /* pAllocator */); + lock(); + { + vkDestroyDescriptorPool(device_locked_ptr->get_device_vk(), + m_pool, + nullptr /* pAllocator */); + } + unlock(); set_vk_handle(VK_NULL_HANDLE); m_pool = VK_NULL_HANDLE; @@ -181,15 +196,6 @@ void Anvil::DescriptorPool::bake() } } - if (n_descriptor_types_used == 0) - { - /* If an empty pool is needed, request space for a single dummy descriptor. */ - descriptor_pool_sizes[0].descriptorCount = 1; - descriptor_pool_sizes[0].type = VK_DESCRIPTOR_TYPE_SAMPLER; - - n_descriptor_types_used = 1; - } - /* Set up the descriptor pool instance */ descriptor_pool_create_info.flags = (m_releaseable_sets) ? VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT : 0u; @@ -216,14 +222,18 @@ void Anvil::DescriptorPool::bake() /* Please see header for specification */ std::shared_ptr Anvil::DescriptorPool::create(std::weak_ptr in_device_ptr, uint32_t in_n_max_sets, - bool in_releaseable_sets) + bool in_releaseable_sets, + MTSafety in_mt_safety) { + const bool is_mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); std::shared_ptr result_ptr; result_ptr.reset( new Anvil::DescriptorPool(in_device_ptr, in_n_max_sets, - in_releaseable_sets) + in_releaseable_sets, + is_mt_safe) ); return result_ptr; @@ -238,9 +248,15 @@ bool Anvil::DescriptorPool::reset() { std::shared_ptr device_locked_ptr(m_device_ptr); - result_vk = vkResetDescriptorPool(device_locked_ptr->get_device_vk(), - m_pool, - 0 /* flags */); + /* TODO: Host synchronization to VkDescriptorSetObjects alloc'ed from the pool. */ + lock(); + { + result_vk = vkResetDescriptorPool(device_locked_ptr->get_device_vk(), + m_pool, + 0 /* flags */); + } + unlock(); + anvil_assert_vk_call_succeeded(result_vk); if (is_vk_call_successful(result_vk) ) diff --git a/src/wrappers/descriptor_set.cpp b/src/wrappers/descriptor_set.cpp index ec2caa94..09b2e09d 100644 --- a/src/wrappers/descriptor_set.cpp +++ b/src/wrappers/descriptor_set.cpp @@ -21,6 +21,7 @@ // #include "misc/debug.h" +#include "misc/descriptor_set_info.h" #include "misc/object_tracker.h" #include "wrappers/buffer.h" #include "wrappers/buffer_view.h" @@ -249,9 +250,11 @@ Anvil::DescriptorSet::TexelBufferBindingElement::TexelBufferBindingElement(const Anvil::DescriptorSet::DescriptorSet(std::weak_ptr in_device_ptr, std::shared_ptr in_parent_pool_ptr, std::shared_ptr in_layout_ptr, - VkDescriptorSet in_descriptor_set) + VkDescriptorSet in_descriptor_set, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT), + MTSafetySupportProvider (in_mt_safe), m_descriptor_set (in_descriptor_set), m_device_ptr (in_device_ptr), m_dirty (true), @@ -261,13 +264,6 @@ Anvil::DescriptorSet::DescriptorSet(std::weak_ptr { alloc_bindings(); - in_layout_ptr->register_for_callbacks( - Anvil::DESCRIPTOR_SET_LAYOUT_CALLBACK_ID_BINDING_ADDED, - std::bind(&DescriptorSet::on_binding_added_to_layout, - this), - this - ); - m_parent_pool_ptr->register_for_callbacks( Anvil::DESCRIPTOR_POOL_CALLBACK_ID_POOL_RESET, std::bind(&DescriptorSet::on_parent_pool_reset, @@ -294,7 +290,8 @@ Anvil::DescriptorSet::~DescriptorSet() **/ void Anvil::DescriptorSet::alloc_bindings() { - const uint32_t n_bindings = m_layout_ptr->get_n_bindings(); + const auto layout_info_ptr = m_layout_ptr->get_info (); + const uint32_t n_bindings = layout_info_ptr->get_n_bindings(); m_cached_ds_write_items_vk.resize(n_bindings); @@ -305,12 +302,12 @@ void Anvil::DescriptorSet::alloc_bindings() uint32_t array_size = 0; uint32_t binding_index; - m_layout_ptr->get_binding_properties(n_binding, - &binding_index, - nullptr, /* out_opt_descriptor_type_ptr */ - &array_size, - nullptr, /* out_opt_stage_flags_ptr */ - nullptr); /* out_opt_immutable_samplers_enabled_ptr */ + layout_info_ptr->get_binding_properties(n_binding, + &binding_index, + nullptr, /* out_opt_descriptor_type_ptr */ + &array_size, + nullptr, /* out_opt_stage_flags_ptr */ + nullptr); /* out_opt_immutable_samplers_enabled_ptr */ if (m_bindings[binding_index].size() != array_size) { @@ -324,7 +321,8 @@ void Anvil::DescriptorSet::alloc_bindings() /* Please see header for specification */ bool Anvil::DescriptorSet::bake() { - bool result = false; + const auto layout_info_ptr = m_layout_ptr->get_info(); + bool result = false; anvil_assert(!m_unusable); @@ -364,12 +362,12 @@ bool Anvil::DescriptorSet::bake() const uint32_t start_ds_texel_buffer_info_items_array_offset = cached_ds_texel_buffer_info_items_array_offset; VkWriteDescriptorSet write_ds_vk; - if (!m_layout_ptr->get_binding_properties(n_binding, - ¤t_binding_index, - &descriptor_type, - nullptr, /* out_opt_descriptor_array_size_ptr */ - nullptr, /* out_opt_stage_flags_ptr */ - &immutable_samplers_enabled) ) + if (!layout_info_ptr->get_binding_properties(n_binding, + ¤t_binding_index, + &descriptor_type, + nullptr, /* out_opt_descriptor_array_size_ptr */ + nullptr, /* out_opt_stage_flags_ptr */ + &immutable_samplers_enabled) ) { anvil_assert_fail(); } @@ -450,7 +448,7 @@ bool Anvil::DescriptorSet::bake() /* We can finally fill the write descriptor */ if (current_binding_items.size() > 0) { - write_ds_vk.descriptorCount = (uint32_t) current_binding_items.size(); + write_ds_vk.descriptorCount = static_cast(current_binding_items.size() ); write_ds_vk.descriptorType = descriptor_type; write_ds_vk.dstArrayElement = 0; write_ds_vk.dstBinding = current_binding_index; @@ -473,11 +471,15 @@ bool Anvil::DescriptorSet::bake() { std::shared_ptr device_locked_ptr(m_device_ptr); - vkUpdateDescriptorSets(device_locked_ptr->get_device_vk(), - (uint32_t) m_cached_ds_write_items_vk.size(), - &m_cached_ds_write_items_vk[0], - 0, /* copyCount */ - nullptr); /* pDescriptorCopies */ + lock(); + { + vkUpdateDescriptorSets(device_locked_ptr->get_device_vk(), + static_cast(m_cached_ds_write_items_vk.size() ), + &m_cached_ds_write_items_vk[0], + 0, /* copyCount */ + nullptr); /* pDescriptorCopies */ + } + unlock(); } m_dirty = false; @@ -493,15 +495,19 @@ bool Anvil::DescriptorSet::bake() std::shared_ptr Anvil::DescriptorSet::create(std::weak_ptr in_device_ptr, std::shared_ptr in_parent_pool_ptr, std::shared_ptr in_layout_ptr, - VkDescriptorSet in_descriptor_set) + VkDescriptorSet in_descriptor_set, + MTSafety in_mt_safety) { + const bool is_mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); std::shared_ptr result_ptr; result_ptr.reset( new Anvil::DescriptorSet(in_device_ptr, in_parent_pool_ptr, in_layout_ptr, - in_descriptor_set) + in_descriptor_set, + is_mt_safe) ); return result_ptr; @@ -760,18 +766,6 @@ bool Anvil::DescriptorSet::get_storage_texel_buffer_binding_properties(uint32_t return result; } -/** Entry-point called back whenever a new binding is added to the parent layout. - * - * This will resize a number of internally managed vectors. - * - * @param layout_raw_ptr Ignored. - * - **/ -void Anvil::DescriptorSet::on_binding_added_to_layout() -{ - alloc_bindings(); -} - /** Called back whenever parent descriptor pool is reset. * * Resets m_descriptor_set back to VK_NULL_HANDLE and marks the descriptor set as unusable. diff --git a/src/wrappers/descriptor_set_group.cpp b/src/wrappers/descriptor_set_group.cpp index af9d6f9c..e9b19956 100644 --- a/src/wrappers/descriptor_set_group.cpp +++ b/src/wrappers/descriptor_set_group.cpp @@ -30,27 +30,50 @@ #include /* Please see header for specification */ -Anvil::DescriptorSetGroup::DescriptorSetGroup(std::weak_ptr in_device_ptr, - bool in_releaseable_sets, - uint32_t in_n_sets) - :m_descriptor_pool_dirty (false), - m_device_ptr (in_device_ptr), - m_layout_modifications_blocked(false), - m_n_instantiated_sets (0), - m_n_sets (in_n_sets), - m_parent_dsg_ptr (nullptr), - m_releaseable_sets (in_releaseable_sets) +Anvil::DescriptorSetGroup::DescriptorSetGroup(std::weak_ptr in_device_ptr, + std::vector > in_ds_info_ptrs, + bool in_releaseable_sets, + MTSafety in_mt_safety, + const std::vector& in_opt_overhead_allocations) + :MTSafetySupportProvider(Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ), + m_device_ptr (in_device_ptr), + m_ds_info_ptrs (std::move(in_ds_info_ptrs) ), + m_releaseable_sets (in_releaseable_sets) { - anvil_assert(in_n_sets >= 1); - memset(m_overhead_allocations, 0, sizeof(m_overhead_allocations) ); + for (const auto& overhead_alloc : in_opt_overhead_allocations) + { + m_overhead_allocations[overhead_alloc.descriptor_type] = overhead_alloc.n_overhead_allocations; + } + /* Initialize descriptor pool */ + uint32_t n_unique_dses = 0; + + for (uint32_t n_layout_info_ptr = 0; + n_layout_info_ptr < static_cast(m_ds_info_ptrs.size() ); + ++n_layout_info_ptr) + { + auto& current_layout_info_ptr = m_ds_info_ptrs.at(n_layout_info_ptr); + + if (current_layout_info_ptr == nullptr) + { + continue; + } + + n_unique_dses += (current_layout_info_ptr != nullptr) ? 1 : 0; + m_descriptor_sets[n_layout_info_ptr].layout_ptr = Anvil::DescriptorSetLayout::create(std::move(current_layout_info_ptr), + in_device_ptr, + in_mt_safety); + } + m_descriptor_pool_ptr = Anvil::DescriptorPool::create(in_device_ptr, - in_n_sets, - in_releaseable_sets); + n_unique_dses, + in_releaseable_sets, + in_mt_safety); /* Register the object */ Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_DESCRIPTOR_SET_GROUP, @@ -60,13 +83,10 @@ Anvil::DescriptorSetGroup::DescriptorSetGroup(std::weak_ptr i /* Please see header for specification */ Anvil::DescriptorSetGroup::DescriptorSetGroup(std::shared_ptr in_parent_dsg_ptr, bool in_releaseable_sets) - :m_descriptor_pool_dirty (true), - m_descriptor_pool_ptr (nullptr), - m_device_ptr (in_parent_dsg_ptr->m_device_ptr), - m_layout_modifications_blocked(true), - m_n_sets (UINT32_MAX), - m_parent_dsg_ptr (in_parent_dsg_ptr), - m_releaseable_sets (in_releaseable_sets) + :MTSafetySupportProvider(in_parent_dsg_ptr->is_mt_safe() ), + m_device_ptr (in_parent_dsg_ptr->m_device_ptr), + m_parent_dsg_ptr (in_parent_dsg_ptr), + m_releaseable_sets (in_releaseable_sets) { anvil_assert(in_parent_dsg_ptr != nullptr); anvil_assert(in_parent_dsg_ptr->m_parent_dsg_ptr == nullptr); @@ -78,8 +98,9 @@ Anvil::DescriptorSetGroup::DescriptorSetGroup(std::shared_ptrm_device_ptr, - in_parent_dsg_ptr->m_n_sets, - in_releaseable_sets); + in_parent_dsg_ptr->m_descriptor_pool_ptr->get_n_maximum_sets(), + in_releaseable_sets, + Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() )); /* Configure the new DSG instance to use the specified parent DSG */ m_descriptor_sets = in_parent_dsg_ptr->m_descriptor_sets; @@ -89,11 +110,6 @@ Anvil::DescriptorSetGroup::DescriptorSetGroup(std::shared_ptrm_layout_modifications_blocked = true; - /* Register the object */ Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_DESCRIPTOR_SET_GROUP, this); @@ -107,54 +123,23 @@ Anvil::DescriptorSetGroup::~DescriptorSetGroup() this); } -/* Please see header for specification */ -bool Anvil::DescriptorSetGroup::add_binding(uint32_t in_n_set, - uint32_t in_binding, - VkDescriptorType in_type, - uint32_t in_n_elements, - VkShaderStageFlags in_shader_stages, - const std::shared_ptr* in_opt_immutable_sampler_ptrs) +/** Re-creates internally-maintained descriptor pool. **/ +void Anvil::DescriptorSetGroup::bake_descriptor_pool() { - bool result = false; - - /* Sanity check: The DSG must not be locked. If you run into this assertion failure, you are trying - * to add a new binding to a descriptor set group which shares its layout with other - * DSGs. This modification would have invalidated layouts used by children DSGs, and - * currently there's no mechanism implemented to inform them about such event. */ - anvil_assert(!m_layout_modifications_blocked); - - /* Sanity check: make sure no more than the number of descriptor sets specified at creation time is - * used - */ - if (m_descriptor_sets.find(in_n_set) == m_descriptor_sets.end() ) - { - if (m_descriptor_sets.size() > (m_n_instantiated_sets + 1) ) - { - anvil_assert(!(m_descriptor_sets.size() > (m_n_instantiated_sets + 1)) ); - - goto end; - } + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); - m_descriptor_sets[in_n_set].layout_ptr = Anvil::DescriptorSetLayout::create(m_device_ptr); + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); } - /* Pass the call down to DescriptorSet instance */ - result = m_descriptor_sets[in_n_set].layout_ptr->add_binding(in_binding, - in_type, - in_n_elements, - in_shader_stages, - in_opt_immutable_sampler_ptrs); - - m_descriptor_pool_dirty = true; -end: - return result; -} - -/** Re-creates internally-maintained descriptor pool. **/ -void Anvil::DescriptorSetGroup::bake_descriptor_pool() -{ - anvil_assert(m_descriptor_pool_dirty); - anvil_assert(m_descriptor_sets.size() != 0); + if (m_descriptor_sets.size() == 0) + { + goto end; + } /* Count how many descriptor of what types need to have pool space allocated */ uint32_t n_descriptors_needed_array[VK_DESCRIPTOR_TYPE_RANGE_SIZE]; @@ -165,6 +150,7 @@ void Anvil::DescriptorSetGroup::bake_descriptor_pool() for (auto current_ds : m_descriptor_sets) { + auto current_ds_layout_info_ptr = current_ds.second.layout_ptr->get_info(); uint32_t n_ds_bindings; if (current_ds.second.layout_ptr == nullptr) @@ -172,7 +158,7 @@ void Anvil::DescriptorSetGroup::bake_descriptor_pool() continue; } - n_ds_bindings = static_cast(current_ds.second.layout_ptr->get_n_bindings() ); + n_ds_bindings = static_cast(current_ds_layout_info_ptr->get_n_bindings() ); for (uint32_t n_ds_binding = 0; n_ds_binding < n_ds_bindings; @@ -181,12 +167,12 @@ void Anvil::DescriptorSetGroup::bake_descriptor_pool() uint32_t ds_binding_array_size; VkDescriptorType ds_binding_type; - current_ds.second.layout_ptr->get_binding_properties(n_ds_binding, - nullptr, /* out_opt_binding_index_ptr */ - &ds_binding_type, - &ds_binding_array_size, - nullptr, /* out_opt_stage_flags_ptr */ - nullptr); /* out_opt_immutable_samplers_enabled_ptr */ + current_ds_layout_info_ptr->get_binding_properties(n_ds_binding, + nullptr, /* out_opt_binding_index_ptr */ + &ds_binding_type, + &ds_binding_array_size, + nullptr, /* out_opt_stage_flags_ptr */ + nullptr); /* out_opt_immutable_samplers_enabled_ptr */ n_descriptors_needed_array[ds_binding_type] += ds_binding_array_size; } @@ -203,120 +189,61 @@ void Anvil::DescriptorSetGroup::bake_descriptor_pool() m_descriptor_pool_ptr->bake(); - /* The descriptor pool now matches the layout's configuration */ - m_descriptor_pool_dirty = false; +end: + ; } /* Please see header for specification */ bool Anvil::DescriptorSetGroup::bake_descriptor_sets() { - Anvil::DescriptorSetGroup* layout_vk_owner_ptr = (m_parent_dsg_ptr != nullptr) ? m_parent_dsg_ptr.get() - : this; - const uint32_t n_sets = (uint32_t) m_descriptor_sets.size(); - bool result = false; + std::vector > dses; + std::vector > ds_layouts; + const Anvil::DescriptorSetGroup* layout_vk_owner_ptr = (m_parent_dsg_ptr != nullptr) ? m_parent_dsg_ptr.get() + : this; + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + bool result = false; + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } + + anvil_assert(m_descriptor_pool_ptr != nullptr); + /* Copy layout descriptors to the helper vector.. */ - m_cached_ds_layouts.clear(); + const uint32_t n_sets = static_cast(m_descriptor_sets.size() ); for (auto ds : layout_vk_owner_ptr->m_descriptor_sets) { - m_cached_ds_layouts.push_back(ds.second.layout_ptr); - } - - /* Allocate the descriptor pool, if necessary */ - if (m_descriptor_pool_dirty) - { - bake_descriptor_pool(); - - anvil_assert(!m_descriptor_pool_dirty); + ds_layouts.push_back(ds.second.layout_ptr); } /* Reset all previous allocations */ m_descriptor_pool_ptr->reset(); - /* Grab descriptor sets from the pool. - * - * Note that baking can only occur if 1 or more bindings or sets were added. If we already have a number of - * DescriptorSet instances cached, we need to re-use existing instances in order to retain the bindings, - * which are cached internally by DescriptorSet instances. - */ - if (m_descriptor_sets.begin()->second.descriptor_set_ptr != nullptr) - { - const uint32_t n_dses_to_assign_handles = m_n_instantiated_sets; - - anvil_assert(n_dses_to_assign_handles != 0); - - m_cached_ds.resize (n_sets); - m_cached_ds_vk.resize(n_dses_to_assign_handles); - - if (n_sets - m_n_instantiated_sets > 0) - { - auto ds = layout_vk_owner_ptr->m_descriptor_sets.begin(); - - result = m_descriptor_pool_ptr->alloc_descriptor_sets(n_sets - m_n_instantiated_sets, - &m_cached_ds_layouts[m_n_instantiated_sets], - &m_cached_ds [m_n_instantiated_sets]); - - for (uint32_t n_skipped_ds = 0; - n_skipped_ds < m_n_instantiated_sets; - ++n_skipped_ds) - { - ds ++; - } - - for (uint32_t n_set = m_n_instantiated_sets; - n_set < n_sets; - ++n_set, ++ds) - { - ds->second.descriptor_set_ptr = m_cached_ds[n_set]; - } - } - else - { - result = true; - } - - result &= m_descriptor_pool_ptr->alloc_descriptor_sets(n_dses_to_assign_handles, - &m_cached_ds_layouts[0], - &m_cached_ds_vk[0]); - anvil_assert(result); + /* Grab descriptor sets from the pool. */ + auto ds_iterator = m_descriptor_sets.begin(); - /* Assign the allocated DSes to relevant descriptor set descriptors */ - auto ds_iterator = m_descriptor_sets.begin(); + dses.resize(n_sets); - for (uint32_t n_set = 0; - n_set < m_n_instantiated_sets; - ++n_set, ++ds_iterator) - { - anvil_assert(m_cached_ds[n_set] != nullptr); - anvil_assert(ds_iterator->second.descriptor_set_ptr != nullptr); + /* Allocate everything from scratch */ + result = m_descriptor_pool_ptr->alloc_descriptor_sets(n_sets, + &ds_layouts[0], + &dses [0]); + anvil_assert(result); - ds_iterator->second.descriptor_set_ptr->set_new_vk_handle(m_cached_ds_vk[n_set]); - } - } - else + for (uint32_t n_set = 0; + n_set < n_sets; + ++n_set, ++ds_iterator) { - auto ds_iterator = m_descriptor_sets.begin(); - - m_cached_ds.resize(n_sets); - - /* Allocate everything from scratch */ - result = m_descriptor_pool_ptr->alloc_descriptor_sets(n_sets, - &m_cached_ds_layouts[0], - &m_cached_ds[0]); - anvil_assert(result); - - for (uint32_t n_set = 0; - n_set < n_sets; - ++n_set, ++ds_iterator) - { - anvil_assert(m_cached_ds[n_set] != nullptr); - anvil_assert(ds_iterator->second.descriptor_set_ptr == nullptr); - - ds_iterator->second.descriptor_set_ptr = m_cached_ds[n_set]; - } + anvil_assert(dses[n_set] != nullptr); + anvil_assert(ds_iterator->second.descriptor_set_ptr == nullptr); - m_n_instantiated_sets = n_sets; + ds_iterator->second.descriptor_set_ptr = dses[n_set]; } /* All done */ @@ -326,18 +253,32 @@ bool Anvil::DescriptorSetGroup::bake_descriptor_sets() } /* Please see header for specification */ -std::shared_ptr Anvil::DescriptorSetGroup::create(std::weak_ptr in_device_ptr, - bool in_releaseable_sets, - uint32_t in_n_sets) +std::shared_ptr Anvil::DescriptorSetGroup::create(std::weak_ptr in_device_ptr, + std::vector >& in_ds_info_ptrs, + bool in_releaseable_sets, + MTSafety in_mt_safety, + const std::vector& in_opt_overhead_allocations) { std::shared_ptr result_ptr; result_ptr.reset( new Anvil::DescriptorSetGroup(in_device_ptr, + std::move(in_ds_info_ptrs), in_releaseable_sets, - in_n_sets) + in_mt_safety, + in_opt_overhead_allocations) ); + if (result_ptr != nullptr) + { + result_ptr->bake_descriptor_pool(); + + if (!result_ptr->bake_descriptor_sets() ) + { + result_ptr.reset(); + } + } + return result_ptr; } @@ -352,81 +293,73 @@ std::shared_ptr Anvil::DescriptorSetGroup::create(std in_releaseable_sets) ); + if (result_ptr != nullptr) + { + result_ptr->bake_descriptor_pool(); + + if (!result_ptr->bake_descriptor_sets() ) + { + result_ptr.reset(); + } + } + return result_ptr; } /* Please see header for specification */ -std::shared_ptr Anvil::DescriptorSetGroup::get_descriptor_set(uint32_t in_n_set) +std::shared_ptr Anvil::DescriptorSetGroup::get_descriptor_set(uint32_t in_n_set) const { - bool pool_rebaked = false; - - anvil_assert(m_descriptor_sets.find(in_n_set) != m_descriptor_sets.end() ); + decltype(m_descriptor_sets)::const_iterator ds_iterator; + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); - if (m_descriptor_pool_dirty) + if (mutex_ptr != nullptr) { - bake_descriptor_pool(); - - anvil_assert(!m_descriptor_pool_dirty); - - pool_rebaked = true; + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); } - if (pool_rebaked || - m_descriptor_sets[in_n_set].descriptor_set_ptr == nullptr) - { - bake_descriptor_sets(); - - anvil_assert(m_descriptor_sets[in_n_set].descriptor_set_ptr != nullptr); - } + ds_iterator = m_descriptor_sets.find(in_n_set); + anvil_assert(ds_iterator != m_descriptor_sets.end() ); - return m_descriptor_sets[in_n_set].descriptor_set_ptr; + return ds_iterator->second.descriptor_set_ptr; } /* Please see header for specification */ -uint32_t Anvil::DescriptorSetGroup::get_descriptor_set_binding_index(uint32_t in_n_set) const +std::shared_ptr Anvil::DescriptorSetGroup::get_descriptor_set_layout(uint32_t in_n_set) const { - std::map::const_iterator dsg_iterator = m_descriptor_sets.begin(); - - anvil_assert(m_descriptor_sets.size() > in_n_set); + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); - for (uint32_t n_current_set = 0; - n_current_set < in_n_set; - ++n_current_set, ++dsg_iterator) + if (mutex_ptr != nullptr) { - /* Stub */ + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); } - return dsg_iterator->first; -} -/* Please see header for specification */ -std::shared_ptr Anvil::DescriptorSetGroup::get_descriptor_set_layout(uint32_t in_n_set) -{ if (m_parent_dsg_ptr != nullptr) { return m_parent_dsg_ptr->get_descriptor_set_layout(in_n_set); } else { - anvil_assert(m_descriptor_sets.find(in_n_set) != m_descriptor_sets.end() ); - anvil_assert(m_descriptor_sets[in_n_set].layout_ptr != nullptr) - - return m_descriptor_sets[in_n_set].layout_ptr; - } - -} + auto ds_iterator = m_descriptor_sets.find(in_n_set); -/* Please see header for specification */ -void Anvil::DescriptorSetGroup::set_descriptor_pool_overhead_allocations(VkDescriptorType in_descriptor_type, - uint32_t in_n_overhead_allocations) -{ - anvil_assert(in_descriptor_type < VK_DESCRIPTOR_TYPE_RANGE_SIZE); + if (ds_iterator != m_descriptor_sets.end() ) + { + anvil_assert(ds_iterator->second.layout_ptr != nullptr) - if (m_overhead_allocations[in_descriptor_type] != in_n_overhead_allocations) - { - m_overhead_allocations[in_descriptor_type] = in_n_overhead_allocations; - m_descriptor_pool_dirty = true; + return ds_iterator->second.layout_ptr; + } + else + { + return nullptr; + } } + } /** Please see header for specification */ diff --git a/src/wrappers/descriptor_set_layout.cpp b/src/wrappers/descriptor_set_layout.cpp index 6f8a5e9e..30a6d3f7 100644 --- a/src/wrappers/descriptor_set_layout.cpp +++ b/src/wrappers/descriptor_set_layout.cpp @@ -21,18 +21,21 @@ // #include "misc/debug.h" +#include "misc/descriptor_set_info.h" #include "misc/object_tracker.h" #include "wrappers/descriptor_set_layout.h" #include "wrappers/device.h" #include "wrappers/sampler.h" /** Please see header for specification */ -Anvil::DescriptorSetLayout::DescriptorSetLayout(std::weak_ptr in_device_ptr) - :CallbacksSupportProvider (DESCRIPTOR_SET_LAYOUT_CALLBACK_ID_COUNT), - DebugMarkerSupportProvider(in_device_ptr, +Anvil::DescriptorSetLayout::DescriptorSetLayout(std::unique_ptr in_ds_info_ptr, + std::weak_ptr in_device_ptr, + bool in_mt_safe) + :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT), + MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), - m_dirty (true), + m_info_ptr (std::move(in_ds_info_ptr) ), m_layout (VK_NULL_HANDLE) { Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT, @@ -49,66 +52,46 @@ Anvil::DescriptorSetLayout::~DescriptorSetLayout() { std::shared_ptr device_locked_ptr(m_device_ptr); - vkDestroyDescriptorSetLayout(device_locked_ptr->get_device_vk(), - m_layout, - nullptr /* pAllocator */); + lock(); + { + vkDestroyDescriptorSetLayout(device_locked_ptr->get_device_vk(), + m_layout, + nullptr /* pAllocator */); + } + unlock(); m_layout = VK_NULL_HANDLE; } } /** Please see header for specification */ -bool Anvil::DescriptorSetLayout::add_binding(uint32_t in_binding_index, - VkDescriptorType in_descriptor_type, - uint32_t in_descriptor_array_size, - VkShaderStageFlags in_stage_flags, - const std::shared_ptr* in_immutable_sampler_ptrs) +std::shared_ptr Anvil::DescriptorSetLayout::create(std::unique_ptr in_ds_info_ptr, + std::weak_ptr in_device_ptr, + MTSafety in_mt_safety) { - bool result = false; - - /* Make sure the binding is not already defined */ - if (m_bindings.find(in_binding_index) != m_bindings.end() ) - { - anvil_assert_fail(); + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); + std::shared_ptr result_ptr; - goto end; - } + result_ptr.reset( + new Anvil::DescriptorSetLayout(std::move(in_ds_info_ptr), + in_device_ptr, + mt_safe) + ); - /* Make sure the sampler array can actually be specified for this descriptor type. */ - if (in_immutable_sampler_ptrs != nullptr) + if (result_ptr != nullptr) { - if (in_descriptor_type != VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER && - in_descriptor_type != VK_DESCRIPTOR_TYPE_SAMPLER) + if (!result_ptr->init() ) { - anvil_assert_fail(); - - goto end; + result_ptr.reset(); } } - /* Add a new binding entry and mark the layout as dirty, so that it is re-baked next time - * the user calls the getter func */ - m_bindings[in_binding_index] = Binding(in_descriptor_array_size, - in_descriptor_type, - in_stage_flags, - in_immutable_sampler_ptrs); - - { - OnNewBindingAddedToDescriptorSetLayoutCallbackArgument callback_argument(this); - - callback(DESCRIPTOR_SET_LAYOUT_CALLBACK_ID_BINDING_ADDED, - &callback_argument); - - } - - m_dirty = true; - result = true; -end: - return result; + return result_ptr; } /** Please see header for specification */ -bool Anvil::DescriptorSetLayout::bake() +bool Anvil::DescriptorSetLayout::init() { std::vector binding_info_items; VkDescriptorSetLayoutCreateInfo create_info; @@ -120,32 +103,16 @@ bool Anvil::DescriptorSetLayout::bake() VkResult result_vk; std::vector sampler_items; - if (!m_dirty) - { - result = true; - - goto end; - } - - /* Release an existing Vulkan layout, if one's already been baked in the past */ - if (m_layout != VK_NULL_HANDLE) - { - vkDestroyDescriptorSetLayout(device_locked_ptr->get_device_vk(), - m_layout, - nullptr /* pAllocator */); - - m_layout = VK_NULL_HANDLE; - set_vk_handle(VK_NULL_HANDLE); - } + anvil_assert(m_layout == VK_NULL_HANDLE); /* Count the number of immutable samplers defined. This is needed because if sampler_items is reallocated * after we start building the VkSampler array contents, all previously initialized VkDescriptorSetLayoutBinding * instances will start referring to invalid sampler arrays. */ - for (auto binding_iterator = m_bindings.begin(); - binding_iterator != m_bindings.end(); + for (auto binding_iterator = m_info_ptr->m_bindings.begin(); + binding_iterator != m_info_ptr->m_bindings.end(); ++binding_iterator) { - const Binding& binding_data = binding_iterator->second; + const auto& binding_data = binding_iterator->second; n_samplers_defined += static_cast(binding_data.immutable_samplers.size() ); } @@ -153,12 +120,12 @@ bool Anvil::DescriptorSetLayout::bake() sampler_items.reserve(n_samplers_defined); /* Determine the number of non-dummy bindings. */ - if (m_bindings.size() > 1) + if (m_info_ptr->m_bindings.size() > 1) { - n_bindings_defined = static_cast(m_bindings.size() ); + n_bindings_defined = static_cast(m_info_ptr->m_bindings.size() ); } else - for (auto binding : m_bindings) + for (auto binding : m_info_ptr->m_bindings) { if (binding.second.descriptor_array_size > 0) { @@ -176,11 +143,11 @@ bool Anvil::DescriptorSetLayout::bake() if (n_bindings_defined > 0) { - for (auto binding_iterator = m_bindings.begin(); - binding_iterator != m_bindings.end(); + for (auto binding_iterator = m_info_ptr->m_bindings.begin(); + binding_iterator != m_info_ptr->m_bindings.end(); ++binding_iterator, ++n_binding) { - const Binding& binding_data = binding_iterator->second; + const auto& binding_data = binding_iterator->second; const BindingIndex& binding_index = binding_iterator->first; VkDescriptorSetLayoutBinding& binding_vk = binding_info_items[n_binding]; @@ -219,7 +186,7 @@ bool Anvil::DescriptorSetLayout::bake() if (binding_info_items.size() > 0) { - create_info.pBindings = &binding_info_items[0]; + create_info.pBindings = &binding_info_items.at(0); } else { @@ -235,81 +202,9 @@ bool Anvil::DescriptorSetLayout::bake() anvil_assert_vk_call_succeeded(result_vk); if (is_vk_call_successful(result_vk) ) { - m_dirty = false; - set_vk_handle(m_layout); } result = is_vk_call_successful(result_vk); -end: return result; } - -/** Please see header for specification */ -std::shared_ptr Anvil::DescriptorSetLayout::create(std::weak_ptr in_device_ptr) -{ - std::shared_ptr result_ptr; - - result_ptr.reset( - new Anvil::DescriptorSetLayout(in_device_ptr) - ); - - return result_ptr; -} - -/** Please see header for specification */ -bool Anvil::DescriptorSetLayout::get_binding_properties(uint32_t in_n_binding, - uint32_t* out_opt_binding_index_ptr, - VkDescriptorType* out_opt_descriptor_type_ptr, - uint32_t* out_opt_descriptor_array_size_ptr, - VkShaderStageFlags* out_opt_stage_flags_ptr, - bool* out_opt_immutable_samplers_enabled_ptr) -{ - auto binding_iterator = m_bindings.begin(); - bool result = false; - - if (m_bindings.size() <= in_n_binding) - { - goto end; - } - - for (uint32_t n_current_binding = 0; - n_current_binding < in_n_binding; - ++n_current_binding) - { - binding_iterator ++; - } - - if (binding_iterator != m_bindings.end() ) - { - if (out_opt_binding_index_ptr != nullptr) - { - *out_opt_binding_index_ptr = binding_iterator->first; - } - - if (out_opt_descriptor_array_size_ptr != nullptr) - { - *out_opt_descriptor_array_size_ptr = binding_iterator->second.descriptor_array_size; - } - - if (out_opt_descriptor_type_ptr != nullptr) - { - *out_opt_descriptor_type_ptr = binding_iterator->second.descriptor_type; - } - - if (out_opt_immutable_samplers_enabled_ptr != nullptr) - { - *out_opt_immutable_samplers_enabled_ptr = (binding_iterator->second.immutable_samplers.size() != 0); - } - - if (out_opt_stage_flags_ptr != nullptr) - { - *out_opt_stage_flags_ptr = binding_iterator->second.stage_flags; - } - - result = true; - } - -end: - return result; -} \ No newline at end of file diff --git a/src/wrappers/device.cpp b/src/wrappers/device.cpp index ea0599da..c7bc4552 100644 --- a/src/wrappers/device.cpp +++ b/src/wrappers/device.cpp @@ -20,6 +20,7 @@ // THE SOFTWARE. // +#include "misc/base_pipeline_info.h" #include "misc/debug.h" #include "misc/object_tracker.h" #include "wrappers/command_pool.h" @@ -39,8 +40,10 @@ /* Please see header for specification */ -Anvil::BaseDevice::BaseDevice(std::weak_ptr in_parent_instance_ptr) - :m_destroyed (false), +Anvil::BaseDevice::BaseDevice(std::weak_ptr in_parent_instance_ptr, + bool in_mt_safe) + :MTSafetySupportProvider (in_mt_safe), + m_destroyed (false), m_device (VK_NULL_HANDLE), m_ext_debug_marker_enabled(false), m_parent_instance_ptr (in_parent_instance_ptr) @@ -66,9 +69,14 @@ Anvil::BaseDevice::~BaseDevice() if (m_device != nullptr) { - vkDeviceWaitIdle(m_device); - vkDestroyDevice (m_device, - nullptr /* pAllocator */); + wait_idle(); + + lock(); + { + vkDestroyDevice(m_device, + nullptr); /* pAllocator */ + } + unlock(); m_device = nullptr; } @@ -99,12 +107,12 @@ void Anvil::BaseDevice::destroy() m_sparse_binding_queues.clear(); for (Anvil::QueueFamilyType queue_family_type = Anvil::QUEUE_FAMILY_TYPE_FIRST; - queue_family_type < Anvil::QUEUE_FAMILY_TYPE_COUNT + 1; + queue_family_type < Anvil::QUEUE_FAMILY_TYPE_COUNT; queue_family_type = static_cast(queue_family_type + 1)) { - std::vector >& queues = (queue_family_type == Anvil::QUEUE_FAMILY_TYPE_COMPUTE) ? m_compute_queues - : (queue_family_type == Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL) ? m_universal_queues - : m_transfer_queues; + std::vector >& queues = (queue_family_type == Anvil::QUEUE_FAMILY_TYPE_COMPUTE) ? m_compute_queues + : (queue_family_type == Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL) ? m_universal_queues + : m_transfer_queues; queues.clear(); } @@ -221,9 +229,9 @@ void Anvil::BaseDevice::get_queue_family_indices_for_physical_device(std::weak_p /* NOTE: Vulkan API only guarantees universal queue family's availability */ anvil_assert(result_universal_queue_family_index != UINT32_MAX); - out_device_queue_family_info_ptr->family_index[Anvil::QUEUE_FAMILY_TYPE_COMPUTE] = result_compute_queue_family_index; - out_device_queue_family_info_ptr->family_index[Anvil::QUEUE_FAMILY_TYPE_TRANSFER] = result_dma_queue_family_index; - out_device_queue_family_info_ptr->family_index[Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL] = result_universal_queue_family_index; + out_device_queue_family_info_ptr->family_index[Anvil::QUEUE_FAMILY_TYPE_COMPUTE] = result_compute_queue_family_index; + out_device_queue_family_info_ptr->family_index[Anvil::QUEUE_FAMILY_TYPE_TRANSFER] = result_dma_queue_family_index; + out_device_queue_family_info_ptr->family_index[Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL] = result_universal_queue_family_index; for (uint32_t n_queue_family_type = 0; n_queue_family_type < static_cast(Anvil::QUEUE_FAMILY_TYPE_COUNT); @@ -399,6 +407,40 @@ std::shared_ptr Anvil::BaseDevice::get_sparse_binding_queue(uint32 return result_ptr; } +/* Please see header for specification */ +bool Anvil::BaseDevice::wait_idle() +{ + const bool mt_safe = is_mt_safe(); + + VkResult result_vk; + + if (mt_safe) + { + for (const auto& queue_fam : m_queue_fams) + { + for (const auto& queue_ptr : queue_fam.second) + { + queue_ptr->lock(); + } + } + } + + result_vk = vkDeviceWaitIdle(m_device); + + if (mt_safe) + { + for (const auto& queue_fam : m_queue_fams) + { + for (const auto& queue_ptr : queue_fam.second) + { + queue_ptr->unlock(); + } + } + } + + return is_vk_call_successful(result_vk); +} + /* Initializes a new Device instance */ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, const std::vector& in_layers, @@ -411,6 +453,7 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, std::shared_ptr instance_locked_ptr (m_parent_instance_ptr); const bool is_validation_enabled(instance_locked_ptr->is_validation_enabled() ); std::vector layers_final; + const auto mt_safety (Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); /* If validation is enabled, retrieve names of all suported validation layers and * append them to the list of layers the user has alreaedy specified. **/ @@ -461,9 +504,11 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, ExtensionItem(VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME, in_extensions.amd_rasterization_order, &m_amd_rasterization_order_enabled), ExtensionItem(VK_AMD_SHADER_BALLOT_EXTENSION_NAME, in_extensions.amd_shader_ballot, &m_amd_shader_ballot_enabled), ExtensionItem(VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME, in_extensions.amd_shader_explicit_vertex_parameter, &m_amd_shader_explicit_vertex_parameter_enabled), + ExtensionItem(VK_AMD_SHADER_INFO_EXTENSION_NAME, in_extensions.amd_shader_info, &m_amd_shader_info_enabled), ExtensionItem(VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME, in_extensions.amd_shader_trinary_minmax, &m_amd_shader_trinary_minmax_enabled), ExtensionItem(VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME, in_extensions.amd_texture_gather_bias_lod, &m_amd_texture_gather_bias_lod_enabled), ExtensionItem(VK_EXT_DEBUG_MARKER_EXTENSION_NAME, in_extensions.ext_debug_marker, &m_ext_debug_marker_enabled), + ExtensionItem("VK_EXT_shader_stencil_export", in_extensions.ext_shader_stencil_export, &m_ext_shader_stencil_export_enabled), ExtensionItem(VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME, in_extensions.ext_shader_subgroup_ballot, &m_ext_shader_subgroup_ballot_enabled), ExtensionItem(VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME, in_extensions.ext_shader_subgroup_vote, &m_ext_shader_subgroup_vote_enabled), ExtensionItem(VK_KHR_16BIT_STORAGE_EXTENSION_NAME, in_extensions.khr_16bit_storage, &m_khr_16bit_storage_enabled), @@ -582,6 +627,13 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, anvil_assert(m_amd_draw_indirect_count_extension_entrypoints.vkCmdDrawIndirectCountAMD != nullptr); } + if (m_amd_shader_info_enabled) + { + m_amd_shader_info_extension_entrypoints.vkGetShaderInfoAMD = reinterpret_cast(get_proc_address("vkGetShaderInfoAMD") ); + + anvil_assert(m_amd_shader_info_extension_entrypoints.vkGetShaderInfoAMD != nullptr); + } + if (m_ext_debug_marker_enabled) { m_ext_debug_marker_extension_entrypoints.vkCmdDebugMarkerBeginEXT = reinterpret_cast (get_proc_address("vkCmdDebugMarkerBeginEXT") ); @@ -647,7 +699,8 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, { std::shared_ptr new_queue_ptr = Anvil::Queue::create(shared_from_this(), m_device_queue_families.family_index[queue_family_type], - n_queue); + n_queue, + is_mt_safe() ); queues.push_back(new_queue_ptr); @@ -675,37 +728,45 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, m_command_pool_ptrs[queue_family_type] = Anvil::CommandPool::create(shared_from_this(), in_transient_command_buffer_allocs_only, in_support_resettable_command_buffer_allocs, - queue_family_type); + queue_family_type, + mt_safety); } } /* Initialize a dummy descriptor set group */ - m_dummy_dsg_ptr = Anvil::DescriptorSetGroup::create(shared_from_this(), - false, /* releaseable_sets */ - 1); /* n_sets */ - - m_dummy_dsg_ptr->add_binding(0, /* n_set */ - 0, /* n_binding */ - VK_DESCRIPTOR_TYPE_SAMPLER, - 0, /* n_elements */ - VK_SHADER_STAGE_ALL); - m_dummy_dsg_ptr->get_descriptor_set_layout(0)->bake(); - m_dummy_dsg_ptr->get_descriptor_set(0)->bake(); + { + std::vector > dummy_ds_info_ptrs(1); + + dummy_ds_info_ptrs[0] = Anvil::DescriptorSetInfo::create(); + dummy_ds_info_ptrs[0]->add_binding(0, /* n_binding */ + VK_DESCRIPTOR_TYPE_SAMPLER, + 0, /* n_elements */ + VK_SHADER_STAGE_ALL); + + m_dummy_dsg_ptr = Anvil::DescriptorSetGroup::create(shared_from_this(), + dummy_ds_info_ptrs, + false, /* releaseable_sets */ + MT_SAFETY_DISABLED); + + m_dummy_dsg_ptr->get_descriptor_set(0)->bake(); + } /* Set up the pipeline cache */ - m_pipeline_cache_ptr = Anvil::PipelineCache::create(shared_from_this() ); + m_pipeline_cache_ptr = Anvil::PipelineCache::create(shared_from_this(), + is_mt_safe () ); /* Cache a pipeline layout manager. This is needed to ensure the manager nevers goes out of scope while * the device is alive */ - m_pipeline_layout_manager_ptr = Anvil::PipelineLayoutManager::create(shared_from_this() ); + m_pipeline_layout_manager_ptr = Anvil::PipelineLayoutManager::create(shared_from_this(), + is_mt_safe() ); - /* Initialize compute & graphics pipeline managers - * - * NOTE: We force pipeline cache usage here because of LunarG#223 and LunarG#227 */ + /* Initialize compute & graphics pipeline managers */ m_compute_pipeline_manager_ptr = Anvil::ComputePipelineManager::create (shared_from_this(), + is_mt_safe() , true /* use_pipeline_cache */, m_pipeline_cache_ptr); m_graphics_pipeline_manager_ptr = Anvil::GraphicsPipelineManager::create(shared_from_this(), + is_mt_safe() , true /* use_pipeline_cache */, m_pipeline_cache_ptr); @@ -715,8 +776,10 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, /* Please see header for specification */ -Anvil::SGPUDevice::SGPUDevice(std::weak_ptr in_physical_device_ptr) - :BaseDevice (in_physical_device_ptr.lock()->get_instance() ), +Anvil::SGPUDevice::SGPUDevice(std::weak_ptr in_physical_device_ptr, + bool in_mt_safe) + :BaseDevice (in_physical_device_ptr.lock()->get_instance(), + in_mt_safe), m_parent_physical_device_ptr(in_physical_device_ptr) { /* Stub */ @@ -734,12 +797,14 @@ std::weak_ptr Anvil::SGPUDevice::create(std::weak_ptr& in_layers, bool in_transient_command_buffer_allocs_only, - bool in_support_resettable_command_buffer_allocs) + bool in_support_resettable_command_buffer_allocs, + bool in_mt_safe) { std::shared_ptr result_ptr; - result_ptr = std::shared_ptr(new Anvil::SGPUDevice(in_physical_device_ptr), - Anvil::SGPUDevice::SGPUDeviceDeleter() ); + result_ptr = std::shared_ptr(new Anvil::SGPUDevice(in_physical_device_ptr, + in_mt_safe), + Anvil::SGPUDevice::SGPUDeviceDeleter()); result_ptr->init(in_extensions, in_layers, @@ -841,7 +906,8 @@ std::shared_ptr Anvil::SGPUDevice::create_swapchain(std::share in_present_mode, in_usage, in_n_swapchain_images, - m_khr_swapchain_extension_entrypoints); + m_khr_swapchain_extension_entrypoints, + Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); return result_ptr; } diff --git a/src/wrappers/event.cpp b/src/wrappers/event.cpp index 1929ff6c..51ebf44c 100644 --- a/src/wrappers/event.cpp +++ b/src/wrappers/event.cpp @@ -26,9 +26,11 @@ #include "wrappers/event.h" /* Please see header for specification */ -Anvil::Event::Event(std::weak_ptr in_device_ptr) +Anvil::Event::Event(std::weak_ptr in_device_ptr, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT), + MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), m_event (VK_NULL_HANDLE) { @@ -73,12 +75,16 @@ Anvil::Event::~Event() } /* Please see header for specification */ -std::shared_ptr Anvil::Event::create(std::weak_ptr in_device_ptr) +std::shared_ptr Anvil::Event::create(std::weak_ptr in_device_ptr, + MTSafety in_mt_safety) { + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); std::shared_ptr result_ptr; result_ptr.reset( - new Anvil::Event(in_device_ptr) + new Anvil::Event(in_device_ptr, + mt_safe) ); return result_ptr; @@ -106,9 +112,13 @@ void Anvil::Event::release_event() { std::shared_ptr device_locked_ptr(m_device_ptr); - vkDestroyEvent(device_locked_ptr->get_device_vk(), - m_event, - nullptr /* pAllocator */); + lock(); + { + vkDestroyEvent(device_locked_ptr->get_device_vk(), + m_event, + nullptr /* pAllocator */); + } + unlock(); m_event = VK_NULL_HANDLE; } @@ -120,8 +130,13 @@ bool Anvil::Event::reset() std::shared_ptr device_locked_ptr(m_device_ptr); VkResult result; - result = vkResetEvent(device_locked_ptr->get_device_vk(), - m_event); + lock(); + { + result = vkResetEvent(device_locked_ptr->get_device_vk(), + m_event); + } + unlock(); + anvil_assert_vk_call_succeeded(result); return (result == VK_SUCCESS); @@ -133,8 +148,13 @@ bool Anvil::Event::set() std::shared_ptr device_locked_ptr(m_device_ptr); VkResult result; - result = vkSetEvent(device_locked_ptr->get_device_vk(), - m_event); + lock(); + { + result = vkSetEvent(device_locked_ptr->get_device_vk(), + m_event); + } + unlock(); + anvil_assert_vk_call_succeeded(result); return (result == VK_SUCCESS); diff --git a/src/wrappers/fence.cpp b/src/wrappers/fence.cpp index 3f2a682c..4f82b0a3 100644 --- a/src/wrappers/fence.cpp +++ b/src/wrappers/fence.cpp @@ -28,9 +28,11 @@ /* Please see header for specification */ Anvil::Fence::Fence(std::weak_ptr in_device_ptr, - bool in_create_signalled) + bool in_create_signalled, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT), + MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), m_fence (VK_NULL_HANDLE), m_possibly_set (false) @@ -74,13 +76,17 @@ Anvil::Fence::~Fence() /* Please see header for specification */ std::shared_ptr Anvil::Fence::create(std::weak_ptr in_device_ptr, - bool in_create_signalled) + bool in_create_signalled, + MTSafety in_mt_safety) { + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); std::shared_ptr result_ptr; result_ptr.reset( new Anvil::Fence(in_device_ptr, - in_create_signalled) + in_create_signalled, + mt_safe) ); return result_ptr; @@ -108,9 +114,13 @@ void Anvil::Fence::release_fence() { std::shared_ptr device_locked_ptr(m_device_ptr); - vkDestroyFence(device_locked_ptr->get_device_vk(), - m_fence, - nullptr /* pAllocator */); + lock(); + { + vkDestroyFence(device_locked_ptr->get_device_vk(), + m_fence, + nullptr /* pAllocator */); + } + unlock(); m_fence = VK_NULL_HANDLE; } @@ -122,9 +132,14 @@ bool Anvil::Fence::reset() std::shared_ptr device_locked_ptr(m_device_ptr); VkResult result; - result = vkResetFences(device_locked_ptr->get_device_vk(), - 1, /* fenceCount */ - &m_fence); + lock(); + { + result = vkResetFences(device_locked_ptr->get_device_vk(), + 1, /* fenceCount */ + &m_fence); + } + unlock(); + anvil_assert_vk_call_succeeded(result); m_possibly_set = false; @@ -166,11 +181,23 @@ bool Anvil::Fence::reset_fences(const uint32_t in_n_fences, fence_cache[n_fence] = current_fence.m_fence; current_fence.m_possibly_set = false; + + current_fence.lock(); + } + { + result_vk = vkResetFences(device_locked_ptr->get_device_vk(), + n_fences_remaining, + fence_cache); + } + for (uint32_t n_fence = 0; + n_fence < n_fences_remaining; + ++n_fence) + { + Anvil::Fence& current_fence = in_fences[n_fence_batch * fence_cache_capacity + n_fence]; + + current_fence.unlock(); } - result_vk = vkResetFences(device_locked_ptr->get_device_vk(), - n_fences_remaining, - fence_cache); anvil_assert_vk_call_succeeded(result_vk); if (!is_vk_call_successful(result_vk) ) diff --git a/src/wrappers/framebuffer.cpp b/src/wrappers/framebuffer.cpp index 12ee1a6b..58834dcc 100644 --- a/src/wrappers/framebuffer.cpp +++ b/src/wrappers/framebuffer.cpp @@ -22,6 +22,7 @@ #include "misc/debug.h" #include "misc/object_tracker.h" +#include "misc/render_pass_info.h" #include "wrappers/device.h" #include "wrappers/framebuffer.h" #include "wrappers/image.h" @@ -32,8 +33,7 @@ bool Anvil::Framebuffer::RenderPassComparator::operator()(std::shared_ptr in_a_ptr, std::shared_ptr in_b_ptr) const { - return in_a_ptr->get_render_pass(false /* allow_rebaking */) < - in_b_ptr->get_render_pass(false /* allow_rebaking */); + return in_a_ptr->get_render_pass() < in_b_ptr->get_render_pass(); } @@ -69,10 +69,12 @@ Anvil::Framebuffer::FramebufferAttachment::~FramebufferAttachment() Anvil::Framebuffer::Framebuffer(std::weak_ptr in_device_ptr, uint32_t in_width, uint32_t in_height, - uint32_t in_n_layers) + uint32_t in_n_layers, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT, true), /* in_use_delegate_workers */ + MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr) { anvil_assert(in_width >= 1); @@ -108,18 +110,13 @@ Anvil::Framebuffer::~Framebuffer() anvil_assert(fb_iterator->second.framebuffer != VK_NULL_HANDLE); /* Destroy the Vulkan framebuffer object */ - vkDestroyFramebuffer(device_locked_ptr->get_device_vk(), - fb_iterator->second.framebuffer, - nullptr /* pAllocator */); - - /* Carry on and release the renderpass the framebuffer had been baked for */ - fb_iterator->first->unregister_from_callbacks( - RENDER_PASS_CALLBACK_ID_BAKING_NEEDED, - std::bind(&Framebuffer::on_renderpass_changed, - this, - std::placeholders::_1), - this - ); + lock(); + { + vkDestroyFramebuffer(device_locked_ptr->get_device_vk(), + fb_iterator->second.framebuffer, + nullptr /* pAllocator */); + } + unlock(); } m_baked_framebuffers.clear(); @@ -217,14 +214,21 @@ bool Anvil::Framebuffer::bake(std::shared_ptr in_render_pass_ goto end; } - /* Release the existing Vulkan object handle, if one is already present */ + /* Release the existing Vulkan object handle, if one is already present + * + * TODO: Leverage the concept of render pass compatibility here! + */ baked_fb_iterator = m_baked_framebuffers.find(in_render_pass_ptr); if (baked_fb_iterator != m_baked_framebuffers.end() ) { - vkDestroyFramebuffer(device_locked_ptr->get_device_vk(), - baked_fb_iterator->second.framebuffer, - nullptr /* pAllocator */); + lock(); + { + vkDestroyFramebuffer(device_locked_ptr->get_device_vk(), + baked_fb_iterator->second.framebuffer, + nullptr /* pAllocator */); + } + unlock(); DebugMarkerSupportProvider::remove_delegate(baked_fb_iterator->second.framebuffer); @@ -242,7 +246,9 @@ bool Anvil::Framebuffer::bake(std::shared_ptr in_render_pass_ } /* Prepare the create info descriptor */ - fb_create_info.attachmentCount = (uint32_t) image_view_attachments.size(); + anvil_assert(in_render_pass_ptr->get_render_pass_info()->get_n_attachments() == image_view_attachments.size() ); + + fb_create_info.attachmentCount = static_cast(image_view_attachments.size() ); fb_create_info.flags = 0; fb_create_info.height = m_framebuffer_size[1]; fb_create_info.layers = m_framebuffer_size[2]; @@ -270,15 +276,6 @@ bool Anvil::Framebuffer::bake(std::shared_ptr in_render_pass_ DebugMarkerSupportProvider::add_delegate(result_fb); } - /* If the render pass is ever changed, make sure we re-bake the framebuffer when needed */ - in_render_pass_ptr->register_for_callbacks( - RENDER_PASS_CALLBACK_ID_BAKING_NEEDED, - std::bind(&Framebuffer::on_renderpass_changed, - this, - std::placeholders::_1), - this - ); - /* All done */ result = true; @@ -290,15 +287,19 @@ bool Anvil::Framebuffer::bake(std::shared_ptr in_render_pass_ std::shared_ptr Anvil::Framebuffer::create(std::weak_ptr in_device_ptr, uint32_t in_width, uint32_t in_height, - uint32_t in_n_layers) + uint32_t in_n_layers, + MTSafety in_mt_safety) { + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); std::shared_ptr result_ptr; result_ptr.reset( new Anvil::Framebuffer(in_device_ptr, in_width, in_height, - in_n_layers) + in_n_layers, + mt_safe) ); return result_ptr; @@ -389,29 +390,3 @@ void Anvil::Framebuffer::get_size(uint32_t* out_framebuffer_width_ptr, *out_framebuffer_height_ptr = m_framebuffer_size[1]; *out_framebuffer_depth_ptr = m_framebuffer_size[2]; } - -/** Called back whenever any renderpass using this framebuffer instance is changed. - * - * Marks the framebuffer as dirty, forcing the framebuffer to be rebaked next time it is used. - * - **/ -void Anvil::Framebuffer::on_renderpass_changed(CallbackArgument* in_callback_argument_ptr) -{ - auto callback_argument_ptr = dynamic_cast(in_callback_argument_ptr); - auto renderpass_ptr = std::shared_ptr (callback_argument_ptr->renderpass_ptr, - Anvil::NullDeleter() ); - - auto baked_fb_iterator = m_baked_framebuffers.find(renderpass_ptr); - - if (baked_fb_iterator == m_baked_framebuffers.end() ) - { - anvil_assert_fail(); - - goto end; - } - - /* Mark as dirty so that the framebuffer is rebaked the next time it is requested. */ - baked_fb_iterator->second.dirty = true; -end: - ; -} diff --git a/src/wrappers/graphics_pipeline_manager.cpp b/src/wrappers/graphics_pipeline_manager.cpp index e658396a..6a97c5ab 100644 --- a/src/wrappers/graphics_pipeline_manager.cpp +++ b/src/wrappers/graphics_pipeline_manager.cpp @@ -21,9 +21,12 @@ // #include +#include "misc/base_pipeline_info.h" #include "misc/base_pipeline_manager.h" #include "misc/debug.h" +#include "misc/graphics_pipeline_info.h" #include "misc/object_tracker.h" +#include "misc/render_pass_info.h" #include "wrappers/device.h" #include "wrappers/graphics_pipeline_manager.h" #include "wrappers/pipeline_cache.h" @@ -50,14 +53,16 @@ * This #define could be removed by handling memory allocations manually, but for simplicity * reasons we'll go with STL vectors for now. * */ -#define N_CACHE_ITEMS 128 +#define N_CACHE_ITEMS 256 /* Please see header for specification */ Anvil::GraphicsPipelineManager::GraphicsPipelineManager(std::weak_ptr in_device_ptr, + bool in_mt_safe, bool in_use_pipeline_cache, std::shared_ptr in_pipeline_cache_to_reuse_ptr) :BasePipelineManager(in_device_ptr, + in_mt_safe, in_use_pipeline_cache, in_pipeline_cache_to_reuse_ptr) { @@ -69,7 +74,8 @@ Anvil::GraphicsPipelineManager::GraphicsPipelineManager(std::weak_ptrunregister_object(Anvil::OBJECT_TYPE_GRAPHICS_PIPELINE_MANAGER, @@ -77,245 +83,52 @@ Anvil::GraphicsPipelineManager::~GraphicsPipelineManager() } /* Please see header for specification */ -bool Anvil::GraphicsPipelineManager::add_derivative_pipeline_from_sibling_pipeline(bool in_disable_optimizations, - bool in_allow_derivatives, - std::shared_ptr in_renderpass_ptr, - SubPassID in_subpass_id, - const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, - GraphicsPipelineID in_base_pipeline_id, - GraphicsPipelineID* out_graphics_pipeline_id_ptr) -{ - bool result; - ShaderModuleStageEntryPoint stages[GRAPHICS_SHADER_STAGE_COUNT]; - - stages[GRAPHICS_SHADER_STAGE_FRAGMENT] = in_fragment_shader_stage_entrypoint_info; - stages[GRAPHICS_SHADER_STAGE_GEOMETRY] = in_geometry_shader_stage_entrypoint_info; - stages[GRAPHICS_SHADER_STAGE_TESSELLATION_CONTROL] = in_tess_control_shader_stage_entrypoint_info; - stages[GRAPHICS_SHADER_STAGE_TESSELLATION_EVALUATION] = in_tess_evaluation_shader_stage_entrypoint_info; - stages[GRAPHICS_SHADER_STAGE_VERTEX] = in_vertex_shader_shader_stage_entrypoint_info; - - result = BasePipelineManager::add_derivative_pipeline_from_sibling_pipeline(in_disable_optimizations, - in_allow_derivatives, - GRAPHICS_SHADER_STAGE_COUNT, - stages, - in_base_pipeline_id, - out_graphics_pipeline_id_ptr); - anvil_assert(result); - - if (result) - { - anvil_assert(m_pipeline_configurations.find(in_base_pipeline_id) != m_pipeline_configurations.end() ); - anvil_assert(m_pipeline_configurations.find(*out_graphics_pipeline_id_ptr) == m_pipeline_configurations.end() ); - - m_pipeline_configurations[*out_graphics_pipeline_id_ptr] = std::shared_ptr(new GraphicsPipelineConfiguration(m_pipeline_configurations[in_base_pipeline_id], - in_renderpass_ptr, - in_subpass_id) ); - } - - return result; -} - -/* Please see header for specification */ -bool Anvil::GraphicsPipelineManager::add_derivative_pipeline_from_pipeline(bool in_disable_optimizations, - bool in_allow_derivatives, - std::shared_ptr in_renderpass_ptr, - SubPassID in_subpass_id, - const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, - VkPipeline in_base_pipeline, - GraphicsPipelineID* out_graphics_pipeline_id_ptr) -{ - bool result; - ShaderModuleStageEntryPoint stages[GRAPHICS_SHADER_STAGE_COUNT]; - - stages[GRAPHICS_SHADER_STAGE_FRAGMENT] = in_fragment_shader_stage_entrypoint_info; - stages[GRAPHICS_SHADER_STAGE_GEOMETRY] = in_geometry_shader_stage_entrypoint_info; - stages[GRAPHICS_SHADER_STAGE_TESSELLATION_CONTROL] = in_tess_control_shader_stage_entrypoint_info; - stages[GRAPHICS_SHADER_STAGE_TESSELLATION_EVALUATION] = in_tess_evaluation_shader_stage_entrypoint_info; - stages[GRAPHICS_SHADER_STAGE_VERTEX] = in_vertex_shader_shader_stage_entrypoint_info; - - result = BasePipelineManager::add_derivative_pipeline_from_pipeline(in_disable_optimizations, - in_allow_derivatives, - GRAPHICS_SHADER_STAGE_COUNT, - stages, - in_base_pipeline, - out_graphics_pipeline_id_ptr); - anvil_assert(result); - - if (result) - { - anvil_assert(m_pipeline_configurations.find(*out_graphics_pipeline_id_ptr) == m_pipeline_configurations.end() ); - - m_pipeline_configurations[*out_graphics_pipeline_id_ptr] = std::shared_ptr(new GraphicsPipelineConfiguration(in_renderpass_ptr, - in_subpass_id) ); - } - - return result; -} - -/* Please see header for specification */ -bool Anvil::GraphicsPipelineManager::add_proxy_pipeline(GraphicsPipelineID* out_proxy_graphics_pipeline_id_ptr) -{ - bool result = false; - - /* For proxy pipelines, we *only* need the configuration container. */ - result = BasePipelineManager::add_proxy_pipeline(out_proxy_graphics_pipeline_id_ptr); - - anvil_assert(result); - if (result) - { - anvil_assert(m_pipeline_configurations.find(*out_proxy_graphics_pipeline_id_ptr) == m_pipeline_configurations.end() ); - - m_pipeline_configurations[*out_proxy_graphics_pipeline_id_ptr] = std::shared_ptr(new GraphicsPipelineConfiguration(nullptr, /* in_renderpass_ptr */ - UINT32_MAX) ); /* in_subpass_id */ - } - - return result; -} - -/* Please see header for specification */ -bool Anvil::GraphicsPipelineManager::add_regular_pipeline(bool in_disable_optimizations, - bool in_allow_derivatives, - std::shared_ptr in_renderpass_ptr, - SubPassID in_subpass_id, - const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, - GraphicsPipelineID* out_graphics_pipeline_id_ptr) -{ - bool result; - ShaderModuleStageEntryPoint stages[GRAPHICS_SHADER_STAGE_COUNT]; - - stages[GRAPHICS_SHADER_STAGE_FRAGMENT] = in_fragment_shader_stage_entrypoint_info; - stages[GRAPHICS_SHADER_STAGE_GEOMETRY] = in_geometry_shader_stage_entrypoint_info; - stages[GRAPHICS_SHADER_STAGE_TESSELLATION_CONTROL] = in_tess_control_shader_stage_entrypoint_info; - stages[GRAPHICS_SHADER_STAGE_TESSELLATION_EVALUATION] = in_tess_evaluation_shader_stage_entrypoint_info; - stages[GRAPHICS_SHADER_STAGE_VERTEX] = in_vertex_shader_shader_stage_entrypoint_info; - - result = BasePipelineManager::add_regular_pipeline(in_disable_optimizations, - in_allow_derivatives, - GRAPHICS_SHADER_STAGE_COUNT, - stages, - out_graphics_pipeline_id_ptr); - anvil_assert(result); - - if (result) - { - anvil_assert(m_pipeline_configurations.find(*out_graphics_pipeline_id_ptr) == m_pipeline_configurations.end() ); - - m_pipeline_configurations[*out_graphics_pipeline_id_ptr] = std::shared_ptr(new GraphicsPipelineConfiguration(in_renderpass_ptr, - in_subpass_id) ); - } - - return result; -} - -/* Please see header for specification */ -bool Anvil::GraphicsPipelineManager::add_vertex_attribute(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_location, - VkFormat in_format, - uint32_t in_offset_in_bytes, - uint32_t in_stride_in_bytes, - VkVertexInputRate in_rate, - uint32_t in_explicit_binding_index) +bool Anvil::GraphicsPipelineManager::bake() { - std::shared_ptr pipeline_config_ptr; - auto pipeline_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - /* Retrieve the pipeline config descriptor ..*/ - if (pipeline_iterator == m_pipeline_configurations.end() ) + typedef struct BakeItem { - anvil_assert_fail(); + PipelineID pipeline_id; + Pipeline* pipeline_ptr; - goto end; - } - else - { - pipeline_config_ptr = pipeline_iterator->second; - } - - #ifdef _DEBUG - { - /* Make sure the location is not already referred to by already added attributes */ - for (auto attribute_iterator = pipeline_config_ptr->attributes.cbegin(); - attribute_iterator != pipeline_config_ptr->attributes.cend(); - ++attribute_iterator) + BakeItem(PipelineID in_pipeline_id, + Pipeline* in_pipeline_ptr) { - anvil_assert(attribute_iterator->location != in_location); + pipeline_id = in_pipeline_id; + pipeline_ptr = in_pipeline_ptr; } - /* If an explicit binding has been requested for the new attribute, we need to make sure that any user-specified attributes - * that refer to this binding specify the same stride and input rate. */ - if (in_explicit_binding_index != UINT32_MAX) + bool operator==(PipelineID in_pipeline_id) { - for (auto attribute_iterator = pipeline_config_ptr->attributes.cbegin(); - attribute_iterator != pipeline_config_ptr->attributes.cend(); - ++attribute_iterator) - { - const auto& current_attribute = *attribute_iterator; - - if (current_attribute.explicit_binding_index == in_explicit_binding_index) - { - anvil_assert(current_attribute.rate == in_rate); - anvil_assert(current_attribute.stride_in_bytes == in_stride_in_bytes); - } - } + return pipeline_id == in_pipeline_id; } - } - #endif + } BakeItem; + + std::vector bake_items; + auto color_blend_attachment_states_vk_cache = std::vector (); + auto color_blend_state_create_info_items_vk_cache = std::vector (); + auto depth_stencil_state_create_info_items_vk_cache = std::vector (); + auto device_locked_ptr = std::shared_ptr (m_device_ptr); + auto dynamic_state_create_info_items_vk_cache = std::vector (); + auto enabled_dynamic_states_vk_cache = std::vector (); + auto graphics_pipeline_create_info_items_vk_cache = std::vector (); + auto input_assembly_state_create_info_items_vk_cache= std::vector(); + auto multisample_state_create_info_items_vk_cache = std::vector (); + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + uint32_t n_consumed_graphics_pipelines = 0; + auto raster_state_create_info_items_vk_cache = std::vector(); + bool result = false; + std::vector result_graphics_pipelines; + VkResult result_vk; + auto scissor_boxes_vk_cache = std::vector (); + auto shader_stage_create_info_items_vk_cache = std::vector (); + auto specialization_info_vk_cache = std::vector (); + auto specialization_map_entry_vk_cache = std::vector (); + auto tessellation_state_create_info_items_vk_cache = std::vector (); + auto vertex_input_state_create_info_items_vk_cache = std::vector (); + auto viewport_state_create_info_items_vk_cache = std::vector (); + std::vector viewports_vk_cache; - /* Add a new vertex attribute descriptor. At this point, we do not differentiate between - * attributes and bindings. Actual Vulkan attributes and bindings will be created at baking - * time. */ - pipeline_config_ptr->attributes.push_back(InternalVertexAttribute(in_explicit_binding_index, - in_format, - in_location, - in_offset_in_bytes, - in_rate, - in_stride_in_bytes)); - - /* All done */ - result = true; -end: - return result; -} - -/* Please see header for specification */ -bool Anvil::GraphicsPipelineManager::bake() -{ - std::vector color_blend_attachment_states_vk_cache; - std::vector color_blend_state_create_info_items_vk_cache; - std::vector depth_stencil_state_create_info_items_vk_cache; - std::vector dynamic_state_create_info_items_vk_cache; - std::vector enabled_dynamic_states_vk_cache; - std::vector graphics_pipeline_create_info_items_vk_cache; - std::vector input_assembly_state_create_info_items_vk_cache; - std::vector multisample_state_create_info_items_vk_cache; - uint32_t n_consumed_graphics_pipelines = 0; - std::vector raster_state_create_info_items_vk_cache; - bool result = false; - std::vector result_graphics_pipelines; - VkResult result_vk; - std::vector scissor_boxes_vk_cache; - std::vector shader_stage_create_info_items_vk_cache; - std::vector specialization_info_vk_cache; - std::vector specialization_map_entry_vk_cache; - std::vector tessellation_state_create_info_items_vk_cache; - std::vector vertex_input_state_create_info_items_vk_cache; - std::vector viewport_state_create_info_items_vk_cache; - std::vector viewports_vk_cache; - - std::shared_ptr device_locked_ptr(m_device_ptr); static const VkPipelineRasterizationStateRasterizationOrderAMD relaxed_rasterization_order_item = { @@ -330,45 +143,6 @@ bool Anvil::GraphicsPipelineManager::bake() VK_RASTERIZATION_ORDER_STRICT_AMD }; - /* Iterate over all stored pipelines, focus on the ones marked as dirty. */ - typedef struct _bake_item - { - PipelineID pipeline_id; - std::shared_ptr pipeline_ptr; - - _bake_item(PipelineID in_pipeline_id, - std::shared_ptr in_pipeline_ptr) - { - pipeline_id = in_pipeline_id; - pipeline_ptr = in_pipeline_ptr; - } - - bool operator==(std::shared_ptr in_pipeline_ptr) - { - return pipeline_ptr == in_pipeline_ptr; - } - } _bake_item; - - std::vector<_bake_item> bake_items; - - - for (auto pipeline_iterator = m_pipelines.begin(); - pipeline_iterator != m_pipelines.end(); - ++pipeline_iterator) - { - if ( pipeline_iterator->second->dirty && - !pipeline_iterator->second->is_proxy && - pipeline_iterator->second->is_bakeable) - { - if (pipeline_iterator->second->layout_dirty) - { - pipeline_iterator->second->layout_ptr = get_pipeline_layout(pipeline_iterator->first); - } - - bake_items.push_back(_bake_item(pipeline_iterator->first, - pipeline_iterator->second) ); - } - } color_blend_attachment_states_vk_cache.reserve (N_CACHE_ITEMS); color_blend_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); @@ -388,433 +162,579 @@ bool Anvil::GraphicsPipelineManager::bake() viewport_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); viewports_vk_cache.reserve (N_CACHE_ITEMS); + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } + + for (auto pipeline_iterator = m_outstanding_pipelines.begin(); + pipeline_iterator != m_outstanding_pipelines.end(); + ++pipeline_iterator) + { + if (pipeline_iterator->second->layout_ptr == nullptr) + { + pipeline_iterator->second->layout_ptr = get_pipeline_layout(pipeline_iterator->first); + } + + bake_items.push_back( + BakeItem(pipeline_iterator->first, + pipeline_iterator->second.get() ) + ); + } + + if (bake_items.size() == 0) + { + result = true; + + goto end; + } + for (auto bake_item_iterator = bake_items.begin(); bake_item_iterator != bake_items.end(); ++bake_item_iterator) { - bool color_blend_state_used = false; - std::shared_ptr current_pipeline_config_ptr = nullptr; - const GraphicsPipelineID current_pipeline_id = bake_item_iterator->pipeline_id; - std::shared_ptr current_pipeline_ptr = bake_item_iterator->pipeline_ptr; - bool depth_stencil_state_used = false; - bool dynamic_state_used = false; - VkGraphicsPipelineCreateInfo graphics_pipeline_create_info = {}; - VkPipelineInputAssemblyStateCreateInfo input_assembly_state_create_info; - bool multisample_state_used = false; - VkPipelineRasterizationStateCreateInfo raster_state_create_info; - uint32_t shader_stage_start_offset = UINT32_MAX; - uint32_t subpass_n_color_attachments = 0; - bool tessellation_state_used = false; - VkPipelineVertexInputStateCreateInfo vertex_input_state_create_info; - bool viewport_state_used = false; - - if (!current_pipeline_ptr->dirty) + bool color_blend_state_used = false; + const PipelineID current_pipeline_id = bake_item_iterator->pipeline_id; + const auto current_pipeline_info_ptr = dynamic_cast(bake_item_iterator->pipeline_ptr->pipeline_info_ptr.get() ); + Pipeline* current_pipeline_ptr = bake_item_iterator->pipeline_ptr; + Anvil::RenderPass* current_pipeline_renderpass_ptr = nullptr; + Anvil::SubPassID current_pipeline_subpass_id; + bool depth_stencil_state_used = false; + bool dynamic_state_used = false; + VkGraphicsPipelineCreateInfo graphics_pipeline_create_info = {}; + VkPipelineInputAssemblyStateCreateInfo input_assembly_state_create_info; + bool multisample_state_used = false; + VkPipelineRasterizationStateCreateInfo raster_state_create_info; + uint32_t subpass_n_color_attachments = 0; + bool tessellation_state_used = false; + VkPipelineVertexInputStateCreateInfo vertex_input_state_create_info; + bool viewport_state_used = false; + + if (current_pipeline_info_ptr == nullptr) { + anvil_assert(current_pipeline_info_ptr != nullptr); + continue; } - if (m_pipeline_configurations.find(current_pipeline_id) == m_pipeline_configurations.end() ) - { - anvil_assert_fail(); + current_pipeline_renderpass_ptr = current_pipeline_info_ptr->get_renderpass().get(); + current_pipeline_subpass_id = current_pipeline_info_ptr->get_subpass_id(); - goto end; - } - else + if (current_pipeline_info_ptr->is_proxy() ) { - current_pipeline_config_ptr = m_pipeline_configurations[current_pipeline_id]; + continue; } /* Extract subpass information */ - current_pipeline_config_ptr->renderpass_ptr->get_subpass_n_attachments(current_pipeline_config_ptr->subpass_id, - ATTACHMENT_TYPE_COLOR, - &subpass_n_color_attachments); + current_pipeline_renderpass_ptr->get_render_pass_info()->get_subpass_n_attachments(current_pipeline_subpass_id, + ATTACHMENT_TYPE_COLOR, + &subpass_n_color_attachments); /* Form the color blend state create info descriptor, if needed */ - if (!current_pipeline_config_ptr->rasterizer_discard_enabled && - subpass_n_color_attachments > 0) { - VkPipelineColorBlendStateCreateInfo color_blend_state_create_info; - const uint32_t start_offset = static_cast(color_blend_attachment_states_vk_cache.size() ); - - color_blend_state_create_info.attachmentCount = subpass_n_color_attachments; - color_blend_state_create_info.flags = 0; - color_blend_state_create_info.logicOp = current_pipeline_config_ptr->logic_op; - color_blend_state_create_info.logicOpEnable = static_cast((current_pipeline_config_ptr->logic_op_enabled) ? VK_TRUE : VK_FALSE); - color_blend_state_create_info.pAttachments = nullptr; - color_blend_state_create_info.pNext = nullptr; - color_blend_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO; - - memcpy(color_blend_state_create_info.blendConstants, - current_pipeline_config_ptr->blend_constant, - sizeof(color_blend_state_create_info.blendConstants) ); - - for (uint32_t n_subpass_color_attachment = 0; - n_subpass_color_attachment < subpass_n_color_attachments; - ++n_subpass_color_attachment) + if (!current_pipeline_info_ptr->is_rasterizer_discard_enabled() && + subpass_n_color_attachments > 0) { - VkPipelineColorBlendAttachmentState blend_attachment_state; - BlendingProperties* current_attachment_blending_props_ptr = nullptr; - - if (current_pipeline_config_ptr->subpass_attachment_blending_properties.find(n_subpass_color_attachment) == current_pipeline_config_ptr->subpass_attachment_blending_properties.end() ) - { - /* The user has not defined blending properties for current color attachment. Use default state values .. */ - current_attachment_blending_props_ptr = ¤t_pipeline_config_ptr->subpass_attachment_blending_properties[n_subpass_color_attachment]; - - current_attachment_blending_props_ptr->blend_enabled = false; - current_attachment_blending_props_ptr->blend_op_alpha = VK_BLEND_OP_ADD; - current_attachment_blending_props_ptr->blend_op_color = VK_BLEND_OP_ADD; - current_attachment_blending_props_ptr->channel_write_mask = VK_COLOR_COMPONENT_A_BIT | - VK_COLOR_COMPONENT_B_BIT | - VK_COLOR_COMPONENT_G_BIT | - VK_COLOR_COMPONENT_R_BIT; - current_attachment_blending_props_ptr->dst_alpha_blend_factor = VK_BLEND_FACTOR_ONE; - current_attachment_blending_props_ptr->dst_color_blend_factor = VK_BLEND_FACTOR_ONE; - current_attachment_blending_props_ptr->src_alpha_blend_factor = VK_BLEND_FACTOR_ONE; - current_attachment_blending_props_ptr->src_color_blend_factor = VK_BLEND_FACTOR_ONE; - } - else - { - current_attachment_blending_props_ptr = ¤t_pipeline_config_ptr->subpass_attachment_blending_properties[n_subpass_color_attachment]; - } - - #ifdef _DEBUG + const float* blend_constant_ptr = nullptr; + VkPipelineColorBlendStateCreateInfo color_blend_state_create_info; + VkLogicOp logic_op; + bool logic_op_enabled = false; + const uint32_t start_offset = static_cast(color_blend_attachment_states_vk_cache.size() ); + + current_pipeline_info_ptr->get_blending_properties(&blend_constant_ptr, + nullptr); /* out_opt_n_blend_attachments_ptr */ + + current_pipeline_info_ptr->get_logic_op_state(&logic_op_enabled, + &logic_op); + + color_blend_state_create_info.attachmentCount = subpass_n_color_attachments; + color_blend_state_create_info.flags = 0; + color_blend_state_create_info.logicOp = logic_op; + color_blend_state_create_info.logicOpEnable = (logic_op_enabled) ? VK_TRUE : VK_FALSE; + color_blend_state_create_info.pAttachments = nullptr; + color_blend_state_create_info.pNext = nullptr; + color_blend_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO; + + memcpy(color_blend_state_create_info.blendConstants, + blend_constant_ptr, + sizeof(color_blend_state_create_info.blendConstants) ); + + for (uint32_t n_subpass_color_attachment = 0; + n_subpass_color_attachment < subpass_n_color_attachments; + ++n_subpass_color_attachment) { - if (n_subpass_color_attachment > 0) + color_blend_attachment_states_vk_cache.push_back(VkPipelineColorBlendAttachmentState() ); + + VkPipelineColorBlendAttachmentState* blend_attachment_state_ptr = &color_blend_attachment_states_vk_cache.back(); + bool is_blending_enabled_for_attachment = false; + + if (!current_pipeline_info_ptr->get_color_blend_attachment_properties(n_subpass_color_attachment, + &is_blending_enabled_for_attachment, + &blend_attachment_state_ptr->colorBlendOp, + &blend_attachment_state_ptr->alphaBlendOp, + &blend_attachment_state_ptr->srcColorBlendFactor, + &blend_attachment_state_ptr->dstColorBlendFactor, + &blend_attachment_state_ptr->srcAlphaBlendFactor, + &blend_attachment_state_ptr->dstAlphaBlendFactor, + &blend_attachment_state_ptr->colorWriteMask) ) + { + /* The user has not defined blending properties for current color attachment. Use default state values .. */ + blend_attachment_state_ptr->blendEnable = VK_FALSE; + blend_attachment_state_ptr->alphaBlendOp = VK_BLEND_OP_ADD; + blend_attachment_state_ptr->colorBlendOp = VK_BLEND_OP_ADD; + blend_attachment_state_ptr->colorWriteMask = VK_COLOR_COMPONENT_A_BIT | + VK_COLOR_COMPONENT_B_BIT | + VK_COLOR_COMPONENT_G_BIT | + VK_COLOR_COMPONENT_R_BIT; + blend_attachment_state_ptr->dstAlphaBlendFactor = VK_BLEND_FACTOR_ONE; + blend_attachment_state_ptr->dstColorBlendFactor = VK_BLEND_FACTOR_ONE; + blend_attachment_state_ptr->srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE; + blend_attachment_state_ptr->srcColorBlendFactor = VK_BLEND_FACTOR_ONE; + } + else { - const BlendingProperties& zero_attachment_blending_props = current_pipeline_config_ptr->subpass_attachment_blending_properties[0]; + anvil_assert(is_blending_enabled_for_attachment); - anvil_assert(zero_attachment_blending_props == *current_attachment_blending_props_ptr); + blend_attachment_state_ptr->blendEnable = VK_TRUE; } } - #endif /* _DEBUG */ - /* Convert internal descriptor to Vulkan descriptor & stash it in the cache vector. */ - blend_attachment_state = current_attachment_blending_props_ptr->get_vk_descriptor(); + color_blend_state_create_info.pAttachments = (subpass_n_color_attachments > 0) ? &color_blend_attachment_states_vk_cache[start_offset] + : nullptr; + color_blend_state_used = true; - color_blend_attachment_states_vk_cache.push_back(blend_attachment_state); + color_blend_state_create_info_items_vk_cache.push_back(color_blend_state_create_info); } + else + { + /* No color attachments available. Make sure none of the dependent modes are enabled. */ + bool logic_op_enabled = false; - color_blend_state_create_info.pAttachments = (subpass_n_color_attachments > 0) ? &color_blend_attachment_states_vk_cache[start_offset] - : nullptr; - color_blend_state_used = true; + current_pipeline_info_ptr->get_logic_op_state(&logic_op_enabled, + nullptr); /* out_opt_logic_op_ptr */ - color_blend_state_create_info_items_vk_cache.push_back(color_blend_state_create_info); - } - else - { - /* No color attachments available. Make sure none of the dependent modes are enabled. */ - anvil_assert(!current_pipeline_config_ptr->logic_op_enabled); + anvil_assert(!logic_op_enabled); - color_blend_state_used = false; + color_blend_state_used = false; + } } /* Form the depth stencil state create info descriptor, if needed */ - uint32_t n_depth_stencil_attachments = 0; - - current_pipeline_config_ptr->renderpass_ptr->get_subpass_n_attachments(current_pipeline_config_ptr->subpass_id, - ATTACHMENT_TYPE_DEPTH_STENCIL, - &n_depth_stencil_attachments); - - if (n_depth_stencil_attachments) { VkPipelineDepthStencilStateCreateInfo depth_stencil_state_create_info; + VkCompareOp depth_test_compare_op = VK_COMPARE_OP_MAX_ENUM; + bool is_depth_bounds_test_enabled = false; + bool is_depth_test_enabled = false; + bool is_stencil_test_enabled = false; + float max_depth_bounds = std::numeric_limits::max(); + float min_depth_bounds = std::numeric_limits::max(); + uint32_t n_depth_stencil_attachments = 0; + + current_pipeline_info_ptr->get_depth_bounds_state(&is_depth_bounds_test_enabled, + &min_depth_bounds, + &max_depth_bounds); + + current_pipeline_info_ptr->get_depth_test_state(&is_depth_test_enabled, + &depth_test_compare_op); + + current_pipeline_info_ptr->get_stencil_test_properties(&is_stencil_test_enabled, + &depth_stencil_state_create_info.front.failOp, + &depth_stencil_state_create_info.front.passOp, + &depth_stencil_state_create_info.front.depthFailOp, + &depth_stencil_state_create_info.front.compareOp, + &depth_stencil_state_create_info.front.compareMask, + &depth_stencil_state_create_info.front.writeMask, + &depth_stencil_state_create_info.front.reference, + &depth_stencil_state_create_info.back.failOp, + &depth_stencil_state_create_info.back.passOp, + &depth_stencil_state_create_info.back.depthFailOp, + &depth_stencil_state_create_info.back.compareOp, + &depth_stencil_state_create_info.back.compareMask, + &depth_stencil_state_create_info.back.writeMask, + &depth_stencil_state_create_info.back.reference); + + current_pipeline_renderpass_ptr->get_render_pass_info()->get_subpass_n_attachments(current_pipeline_info_ptr->get_subpass_id(), + ATTACHMENT_TYPE_DEPTH_STENCIL, + &n_depth_stencil_attachments); + + if (n_depth_stencil_attachments) + { + depth_stencil_state_create_info.depthBoundsTestEnable = is_depth_bounds_test_enabled ? VK_TRUE : VK_FALSE; + depth_stencil_state_create_info.depthCompareOp = depth_test_compare_op; + depth_stencil_state_create_info.depthTestEnable = is_depth_test_enabled ? VK_TRUE : VK_FALSE; + depth_stencil_state_create_info.depthWriteEnable = current_pipeline_info_ptr->are_depth_writes_enabled() ? VK_TRUE : VK_FALSE; + depth_stencil_state_create_info.flags = 0; + depth_stencil_state_create_info.maxDepthBounds = max_depth_bounds; + depth_stencil_state_create_info.minDepthBounds = min_depth_bounds; + depth_stencil_state_create_info.pNext = nullptr; + depth_stencil_state_create_info.stencilTestEnable = is_stencil_test_enabled ? VK_TRUE : VK_FALSE; + depth_stencil_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO; + + depth_stencil_state_used = true; + + depth_stencil_state_create_info_items_vk_cache.push_back(depth_stencil_state_create_info); + } + else + { + /* No depth/stencil attachment available. Make sure none of the dependent modes are enabled. */ + anvil_assert(!is_depth_bounds_test_enabled); + anvil_assert(!is_depth_test_enabled); + anvil_assert(!current_pipeline_info_ptr->are_depth_writes_enabled()); + anvil_assert(!is_stencil_test_enabled); - depth_stencil_state_create_info.back = current_pipeline_config_ptr->stencil_state_back_face; - depth_stencil_state_create_info.depthBoundsTestEnable = static_cast(current_pipeline_config_ptr->depth_bounds_test_enabled ? VK_TRUE : VK_FALSE); - depth_stencil_state_create_info.depthCompareOp = current_pipeline_config_ptr->depth_test_compare_op; - depth_stencil_state_create_info.depthTestEnable = static_cast(current_pipeline_config_ptr->depth_test_enabled ? VK_TRUE : VK_FALSE); - depth_stencil_state_create_info.depthWriteEnable = static_cast(current_pipeline_config_ptr->depth_writes_enabled ? VK_TRUE : VK_FALSE); - depth_stencil_state_create_info.flags = 0; - depth_stencil_state_create_info.front = current_pipeline_config_ptr->stencil_state_front_face; - depth_stencil_state_create_info.maxDepthBounds = current_pipeline_config_ptr->max_depth_bounds; - depth_stencil_state_create_info.minDepthBounds = current_pipeline_config_ptr->min_depth_bounds; - depth_stencil_state_create_info.pNext = nullptr; - depth_stencil_state_create_info.stencilTestEnable = static_cast(current_pipeline_config_ptr->stencil_test_enabled ? VK_TRUE : VK_FALSE); - depth_stencil_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO; - - depth_stencil_state_used = true; - - depth_stencil_state_create_info_items_vk_cache.push_back(depth_stencil_state_create_info); - } - else - { - /* No depth/stencil attachment available. Make sure none of the dependent modes are enabled. */ - anvil_assert(!current_pipeline_config_ptr->depth_bounds_test_enabled); - anvil_assert(!current_pipeline_config_ptr->depth_test_enabled); - anvil_assert(!current_pipeline_config_ptr->depth_writes_enabled); - anvil_assert(!current_pipeline_config_ptr->stencil_test_enabled); - - depth_stencil_state_used = false; + depth_stencil_state_used = false; + } } /* Form the dynamic state create info descriptor, if needed */ - if (current_pipeline_config_ptr->enabled_dynamic_states != 0) { - VkPipelineDynamicStateCreateInfo dynamic_state_create_info; - const uint32_t start_offset = static_cast(enabled_dynamic_states_vk_cache.size() ); + const auto& enabled_dynamic_states = current_pipeline_info_ptr->get_enabled_dynamic_states(); - if ((current_pipeline_config_ptr->enabled_dynamic_states & DYNAMIC_STATE_BLEND_CONSTANTS_BIT) != 0) + if (enabled_dynamic_states != 0) { - enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_BLEND_CONSTANTS); - } + VkPipelineDynamicStateCreateInfo dynamic_state_create_info; + const uint32_t start_offset = static_cast(enabled_dynamic_states_vk_cache.size() ); - if ((current_pipeline_config_ptr->enabled_dynamic_states & DYNAMIC_STATE_DEPTH_BIAS_BIT) != 0) - { - enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_DEPTH_BIAS); - } + if ((enabled_dynamic_states & DYNAMIC_STATE_BLEND_CONSTANTS_BIT) != 0) + { + enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_BLEND_CONSTANTS); + } - if ((current_pipeline_config_ptr->enabled_dynamic_states & DYNAMIC_STATE_DEPTH_BOUNDS_BIT) != 0) - { - enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_DEPTH_BOUNDS); - } + if ((enabled_dynamic_states & DYNAMIC_STATE_DEPTH_BIAS_BIT) != 0) + { + enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_DEPTH_BIAS); + } - if ((current_pipeline_config_ptr->enabled_dynamic_states & DYNAMIC_STATE_LINE_WIDTH_BIT) != 0) - { - enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_LINE_WIDTH); - } + if ((enabled_dynamic_states & DYNAMIC_STATE_DEPTH_BOUNDS_BIT) != 0) + { + enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_DEPTH_BOUNDS); + } - if ((current_pipeline_config_ptr->enabled_dynamic_states & DYNAMIC_STATE_SCISSOR_BIT) != 0) - { - enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_SCISSOR); - } + if ((enabled_dynamic_states & DYNAMIC_STATE_LINE_WIDTH_BIT) != 0) + { + enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_LINE_WIDTH); + } - if ((current_pipeline_config_ptr->enabled_dynamic_states & DYNAMIC_STATE_STENCIL_COMPARE_MASK_BIT) != 0) - { - enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK); - } + if ((enabled_dynamic_states & DYNAMIC_STATE_SCISSOR_BIT) != 0) + { + enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_SCISSOR); + } - if ((current_pipeline_config_ptr->enabled_dynamic_states & DYNAMIC_STATE_STENCIL_REFERENCE_BIT) != 0) - { - enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_STENCIL_REFERENCE); - } + if ((enabled_dynamic_states & DYNAMIC_STATE_STENCIL_COMPARE_MASK_BIT) != 0) + { + enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK); + } - if ((current_pipeline_config_ptr->enabled_dynamic_states & DYNAMIC_STATE_STENCIL_WRITE_MASK_BIT) != 0) - { - enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_STENCIL_WRITE_MASK); - } + if ((enabled_dynamic_states & DYNAMIC_STATE_STENCIL_REFERENCE_BIT) != 0) + { + enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_STENCIL_REFERENCE); + } - if ((current_pipeline_config_ptr->enabled_dynamic_states & DYNAMIC_STATE_VIEWPORT_BIT) != 0) - { - enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_VIEWPORT); - } + if ((enabled_dynamic_states & DYNAMIC_STATE_STENCIL_WRITE_MASK_BIT) != 0) + { + enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_STENCIL_WRITE_MASK); + } + + if ((enabled_dynamic_states & DYNAMIC_STATE_VIEWPORT_BIT) != 0) + { + enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_VIEWPORT); + } - dynamic_state_create_info.dynamicStateCount = static_cast(enabled_dynamic_states_vk_cache.size() - start_offset); - dynamic_state_create_info.flags = 0; - dynamic_state_create_info.pDynamicStates = (dynamic_state_create_info.dynamicStateCount > 0) ? &enabled_dynamic_states_vk_cache[start_offset] - : VK_NULL_HANDLE; - dynamic_state_create_info.pNext = nullptr; - dynamic_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO; + dynamic_state_create_info.dynamicStateCount = static_cast(enabled_dynamic_states_vk_cache.size() - start_offset); + dynamic_state_create_info.flags = 0; + dynamic_state_create_info.pDynamicStates = (dynamic_state_create_info.dynamicStateCount > 0) ? &enabled_dynamic_states_vk_cache[start_offset] + : VK_NULL_HANDLE; + dynamic_state_create_info.pNext = nullptr; + dynamic_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO; - dynamic_state_used = true; + dynamic_state_used = true; - dynamic_state_create_info_items_vk_cache.push_back(dynamic_state_create_info); - } - else - { - dynamic_state_used = false; + dynamic_state_create_info_items_vk_cache.push_back(dynamic_state_create_info); + } + else + { + dynamic_state_used = false; + } } /* Form the input assembly create info descriptor */ - input_assembly_state_create_info.flags = 0; - input_assembly_state_create_info.pNext = nullptr; - input_assembly_state_create_info.primitiveRestartEnable = static_cast(current_pipeline_config_ptr->primitive_restart_enabled ? VK_TRUE : VK_FALSE); - input_assembly_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO; - input_assembly_state_create_info.topology = current_pipeline_config_ptr->primitive_topology; + { + input_assembly_state_create_info.flags = 0; + input_assembly_state_create_info.pNext = nullptr; + input_assembly_state_create_info.primitiveRestartEnable = current_pipeline_info_ptr->is_primitive_restart_enabled() ? VK_TRUE : VK_FALSE; + input_assembly_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO; + input_assembly_state_create_info.topology = current_pipeline_info_ptr->get_primitive_topology(); - input_assembly_state_create_info_items_vk_cache.push_back(input_assembly_state_create_info); + input_assembly_state_create_info_items_vk_cache.push_back(input_assembly_state_create_info); + } /* Form the multisample state create info descriptor, if needed */ - if (!current_pipeline_config_ptr->rasterizer_discard_enabled) { - VkPipelineMultisampleStateCreateInfo multisample_state_create_info; + bool is_sample_shading_enabled = false; + float min_sample_shading = std::numeric_limits::max(); - /* If sample mask is not enabled, Vulkan spec will assume all samples need to pass. This is what the default sample mask value mimics. - * - * Hence, if the application specified a non-~0u sample mask and has NOT enabled the sample mask using toggle_sample_mask(), it's (in - * all likelihood) a trivial app-side issue. - */ - anvil_assert((!current_pipeline_config_ptr->sample_mask_enabled && current_pipeline_config_ptr->sample_mask == ~0u) || - current_pipeline_config_ptr->sample_mask_enabled); - - multisample_state_create_info.alphaToCoverageEnable = static_cast(current_pipeline_config_ptr->alpha_to_coverage_enabled ? VK_TRUE : VK_FALSE); - multisample_state_create_info.alphaToOneEnable = static_cast(current_pipeline_config_ptr->alpha_to_one_enabled ? VK_TRUE : VK_FALSE); - multisample_state_create_info.flags = 0; - multisample_state_create_info.minSampleShading = current_pipeline_config_ptr->min_sample_shading; - multisample_state_create_info.pNext = nullptr; - multisample_state_create_info.pSampleMask = (current_pipeline_config_ptr->sample_mask_enabled) ? ¤t_pipeline_config_ptr->sample_mask : nullptr; - multisample_state_create_info.rasterizationSamples = static_cast(current_pipeline_config_ptr->sample_count); - multisample_state_create_info.sampleShadingEnable = static_cast(current_pipeline_config_ptr->sample_shading_enabled ? VK_TRUE : VK_FALSE); - multisample_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO; - - multisample_state_used = true; - - multisample_state_create_info_items_vk_cache.push_back(multisample_state_create_info); - } - else - { - /* Make sure any dependent modes are disabled */ - anvil_assert(!current_pipeline_config_ptr->alpha_to_coverage_enabled); - anvil_assert(!current_pipeline_config_ptr->alpha_to_one_enabled); - anvil_assert(!current_pipeline_config_ptr->sample_shading_enabled); + current_pipeline_info_ptr->get_sample_shading_state(&is_sample_shading_enabled, + &min_sample_shading); + + if (!current_pipeline_info_ptr->is_rasterizer_discard_enabled() ) + { + const bool is_sample_mask_enabled = current_pipeline_info_ptr->is_sample_mask_enabled(); + VkPipelineMultisampleStateCreateInfo multisample_state_create_info; + VkSampleCountFlags sample_count = VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM; + VkSampleMask sample_mask; + + current_pipeline_info_ptr->get_multisampling_properties(&sample_count, + &sample_mask); + + /* If sample mask is not enabled, Vulkan spec will assume all samples need to pass. This is what the default sample mask value mimics. + * + * Hence, if the application specified a non-~0u sample mask and has NOT enabled the sample mask using toggle_sample_mask(), it's (in + * all likelihood) a trivial app-side issue. + */ + anvil_assert((!is_sample_mask_enabled && sample_mask == ~0u) || + is_sample_mask_enabled); + + multisample_state_create_info.alphaToCoverageEnable = current_pipeline_info_ptr->is_alpha_to_coverage_enabled() ? VK_TRUE : VK_FALSE; + multisample_state_create_info.alphaToOneEnable = current_pipeline_info_ptr->is_alpha_to_one_enabled() ? VK_TRUE : VK_FALSE; + multisample_state_create_info.flags = 0; + multisample_state_create_info.minSampleShading = min_sample_shading; + multisample_state_create_info.pNext = nullptr; + multisample_state_create_info.pSampleMask = (is_sample_mask_enabled) ? &sample_mask : nullptr; + multisample_state_create_info.rasterizationSamples = static_cast(sample_count); + multisample_state_create_info.sampleShadingEnable = is_sample_shading_enabled ? VK_TRUE : VK_FALSE; + multisample_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO; + + multisample_state_used = true; + + multisample_state_create_info_items_vk_cache.push_back(multisample_state_create_info); + } + else + { + /* Make sure any dependent modes are disabled */ + anvil_assert(!current_pipeline_info_ptr->is_alpha_to_coverage_enabled() ); + anvil_assert(!current_pipeline_info_ptr->is_alpha_to_one_enabled () ); + anvil_assert(!is_sample_shading_enabled); - multisample_state_used = false; + multisample_state_used = false; + } } /* Form the raster state create info descriptor */ - raster_state_create_info.cullMode = current_pipeline_config_ptr->cull_mode; - raster_state_create_info.depthBiasClamp = current_pipeline_config_ptr->depth_bias_clamp; - raster_state_create_info.depthBiasConstantFactor = current_pipeline_config_ptr->depth_bias_constant_factor; - raster_state_create_info.depthBiasEnable = static_cast(current_pipeline_config_ptr->depth_bias_enabled ? VK_TRUE : VK_FALSE); - raster_state_create_info.depthBiasSlopeFactor = current_pipeline_config_ptr->depth_bias_slope_factor; - raster_state_create_info.depthClampEnable = static_cast(current_pipeline_config_ptr->depth_clamp_enabled ? VK_TRUE : VK_FALSE); - raster_state_create_info.flags = 0; - raster_state_create_info.frontFace = current_pipeline_config_ptr->front_face; - raster_state_create_info.lineWidth = current_pipeline_config_ptr->line_width; - raster_state_create_info.pNext = nullptr; - raster_state_create_info.polygonMode = current_pipeline_config_ptr->polygon_mode; - raster_state_create_info.rasterizerDiscardEnable = static_cast(current_pipeline_config_ptr->rasterizer_discard_enabled ? VK_TRUE : VK_FALSE); - raster_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO; - - if (device_locked_ptr->is_extension_enabled(VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME) ) { - /* Chain a predefined struct which will toggle the relaxed rasterization, as long as the device supports the - * VK_AMD_rasterization_order extension. - */ - const VkPipelineRasterizationStateRasterizationOrderAMD* chained_item_ptr = nullptr; - - if (current_pipeline_config_ptr->rasterization_order != VK_RASTERIZATION_ORDER_STRICT_AMD) + VkCullModeFlags cull_mode = VK_CULL_MODE_FLAG_BITS_MAX_ENUM; + float depth_bias_clamp = std::numeric_limits::max(); + float depth_bias_constant_factor = std::numeric_limits::max(); + float depth_bias_slope_factor = std::numeric_limits::max(); + VkFrontFace front_face = VK_FRONT_FACE_MAX_ENUM; + bool is_depth_bias_enabled = false; + float line_width = std::numeric_limits::max(); + VkPolygonMode polygon_mode = VK_POLYGON_MODE_MAX_ENUM; + + current_pipeline_info_ptr->get_depth_bias_state (&is_depth_bias_enabled, + &depth_bias_constant_factor, + &depth_bias_clamp, + &depth_bias_slope_factor); + current_pipeline_info_ptr->get_rasterization_properties(&polygon_mode, + &cull_mode, + &front_face, + &line_width); + + raster_state_create_info.cullMode = cull_mode; + raster_state_create_info.depthBiasClamp = depth_bias_clamp; + raster_state_create_info.depthBiasConstantFactor = depth_bias_constant_factor; + raster_state_create_info.depthBiasEnable = is_depth_bias_enabled ? VK_TRUE : VK_FALSE; + raster_state_create_info.depthBiasSlopeFactor = depth_bias_slope_factor; + raster_state_create_info.depthClampEnable = current_pipeline_info_ptr->is_depth_clamp_enabled() ? VK_TRUE : VK_FALSE; + raster_state_create_info.flags = 0; + raster_state_create_info.frontFace = front_face; + raster_state_create_info.lineWidth = line_width; + raster_state_create_info.pNext = nullptr; + raster_state_create_info.polygonMode = polygon_mode; + raster_state_create_info.rasterizerDiscardEnable = current_pipeline_info_ptr->is_rasterizer_discard_enabled() ? VK_TRUE : VK_FALSE; + raster_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO; + + if (device_locked_ptr->is_extension_enabled(VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME) ) { - anvil_assert(current_pipeline_config_ptr->rasterization_order == relaxed_rasterization_order_item.rasterizationOrder); + /* Chain a predefined struct which will toggle the relaxed rasterization, as long as the device supports the + * VK_AMD_rasterization_order extension. + */ + const VkPipelineRasterizationStateRasterizationOrderAMD* chained_item_ptr = nullptr; - chained_item_ptr = &relaxed_rasterization_order_item; + if (current_pipeline_info_ptr->get_rasterization_order() != VK_RASTERIZATION_ORDER_STRICT_AMD) + { + anvil_assert(current_pipeline_info_ptr->get_rasterization_order() == relaxed_rasterization_order_item.rasterizationOrder); + + chained_item_ptr = &relaxed_rasterization_order_item; + } + else + { + chained_item_ptr = &strict_rasterization_order_item; + } + + raster_state_create_info.pNext = chained_item_ptr; } else + if (current_pipeline_info_ptr->get_rasterization_order() != VK_RASTERIZATION_ORDER_STRICT_AMD) { - chained_item_ptr = &strict_rasterization_order_item; + fprintf(stderr, + "[!] Cannot enable out-of-order rasterization - VK_AMD_rasterization_order extension not enabled at device creation time\n"); } - raster_state_create_info.pNext = chained_item_ptr; - } - else - if (current_pipeline_config_ptr->rasterization_order != VK_RASTERIZATION_ORDER_STRICT_AMD) - { - fprintf(stderr, - "[!] Cannot enable out-of-order rasterization - VK_AMD_rasterization_order extension not enabled at device creation time"); + raster_state_create_info_items_vk_cache.push_back(raster_state_create_info); } - raster_state_create_info_items_vk_cache.push_back(raster_state_create_info); - /* Form stage descriptors */ - shader_stage_start_offset = static_cast(shader_stage_create_info_items_vk_cache.size() ); - - for (uint32_t n_shader = 0; - n_shader < GRAPHICS_SHADER_STAGE_COUNT; - ++n_shader) + uint32_t shader_stage_start_offset = static_cast(shader_stage_create_info_items_vk_cache.size() ); { - if (current_pipeline_ptr->shader_stages[n_shader].name.size() != 0) + static const Anvil::ShaderStage graphics_shader_stages[] = { - VkPipelineShaderStageCreateInfo current_shader_stage_create_info; - std::shared_ptr shader_module_ptr; + Anvil::SHADER_STAGE_FRAGMENT, + Anvil::SHADER_STAGE_GEOMETRY, + Anvil::SHADER_STAGE_TESSELLATION_CONTROL, + Anvil::SHADER_STAGE_TESSELLATION_EVALUATION, + Anvil::SHADER_STAGE_VERTEX + }; + + for (const auto& current_graphics_shader_stage : graphics_shader_stages) + { + const Anvil::ShaderModuleStageEntryPoint* shader_stage_entry_point_ptr = nullptr; + + current_pipeline_info_ptr->get_shader_stage_properties(current_graphics_shader_stage, + &shader_stage_entry_point_ptr); - if (current_pipeline_ptr->specialization_constants_map[n_shader].size() > 0) + if (shader_stage_entry_point_ptr != nullptr) { - bake_specialization_info_vk(current_pipeline_ptr->specialization_constants_map [n_shader], - ¤t_pipeline_ptr->specialization_constant_data_buffer[0], - &specialization_map_entry_vk_cache, - &specialization_info_vk_cache[n_shader]); - } + VkPipelineShaderStageCreateInfo current_shader_stage_create_info; + const unsigned char* current_shader_stage_specialization_constants_data_buffer_ptr = nullptr; + const SpecializationConstants* current_shader_stage_specialization_constants_ptr = nullptr; + std::shared_ptr shader_module_ptr; + + specialization_info_vk_cache.push_back(VkSpecializationInfo() ); - shader_module_ptr = current_pipeline_ptr->shader_stages[n_shader].shader_module_ptr; - - current_shader_stage_create_info.module = shader_module_ptr->get_module(); - current_shader_stage_create_info.pName = (n_shader == GRAPHICS_SHADER_STAGE_FRAGMENT) ? shader_module_ptr->get_fs_entrypoint_name().c_str() - : (n_shader == GRAPHICS_SHADER_STAGE_GEOMETRY) ? shader_module_ptr->get_gs_entrypoint_name().c_str() - : (n_shader == GRAPHICS_SHADER_STAGE_TESSELLATION_CONTROL) ? shader_module_ptr->get_tc_entrypoint_name().c_str() - : (n_shader == GRAPHICS_SHADER_STAGE_TESSELLATION_EVALUATION) ? shader_module_ptr->get_te_entrypoint_name().c_str() - : (n_shader == GRAPHICS_SHADER_STAGE_VERTEX) ? shader_module_ptr->get_vs_entrypoint_name().c_str() - : nullptr; - - current_shader_stage_create_info.flags = 0; - current_shader_stage_create_info.pNext = nullptr; - current_shader_stage_create_info.pSpecializationInfo = (current_pipeline_ptr->specialization_constants_map[n_shader].size() > 0) ? &specialization_info_vk_cache[n_shader] - : VK_NULL_HANDLE; - current_shader_stage_create_info.stage = (n_shader == GRAPHICS_SHADER_STAGE_FRAGMENT) ? VK_SHADER_STAGE_FRAGMENT_BIT - : (n_shader == GRAPHICS_SHADER_STAGE_GEOMETRY) ? VK_SHADER_STAGE_GEOMETRY_BIT - : (n_shader == GRAPHICS_SHADER_STAGE_TESSELLATION_CONTROL) ? VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT - : (n_shader == GRAPHICS_SHADER_STAGE_TESSELLATION_EVALUATION) ? VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT - : VK_SHADER_STAGE_VERTEX_BIT; - current_shader_stage_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; - - shader_stage_create_info_items_vk_cache.push_back(current_shader_stage_create_info); + current_pipeline_info_ptr->get_specialization_constants(current_graphics_shader_stage, + ¤t_shader_stage_specialization_constants_ptr, + ¤t_shader_stage_specialization_constants_data_buffer_ptr); + + if (current_shader_stage_specialization_constants_ptr->size() > 0) + { + bake_specialization_info_vk(*current_shader_stage_specialization_constants_ptr, + current_shader_stage_specialization_constants_data_buffer_ptr, + &specialization_map_entry_vk_cache, + &specialization_info_vk_cache.back() ); + } + + shader_module_ptr = shader_stage_entry_point_ptr->shader_module_ptr; + + current_shader_stage_create_info.module = shader_module_ptr->get_module(); + current_shader_stage_create_info.pName = (shader_stage_entry_point_ptr->stage == Anvil::SHADER_STAGE_FRAGMENT) ? shader_module_ptr->get_fs_entrypoint_name().c_str() + : (shader_stage_entry_point_ptr->stage == Anvil::SHADER_STAGE_GEOMETRY) ? shader_module_ptr->get_gs_entrypoint_name().c_str() + : (shader_stage_entry_point_ptr->stage == Anvil::SHADER_STAGE_TESSELLATION_CONTROL) ? shader_module_ptr->get_tc_entrypoint_name().c_str() + : (shader_stage_entry_point_ptr->stage == Anvil::SHADER_STAGE_TESSELLATION_EVALUATION) ? shader_module_ptr->get_te_entrypoint_name().c_str() + : (shader_stage_entry_point_ptr->stage == Anvil::SHADER_STAGE_VERTEX) ? shader_module_ptr->get_vs_entrypoint_name().c_str() + : nullptr; + + current_shader_stage_create_info.flags = 0; + current_shader_stage_create_info.pNext = nullptr; + current_shader_stage_create_info.pSpecializationInfo = (current_shader_stage_specialization_constants_ptr->size() > 0) ? &specialization_info_vk_cache.back() + : VK_NULL_HANDLE; + current_shader_stage_create_info.stage = Anvil::Utils::get_shader_stage_flag_bits_from_shader_stage(shader_stage_entry_point_ptr->stage); + current_shader_stage_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; + + shader_stage_create_info_items_vk_cache.push_back(current_shader_stage_create_info); + } } } /* Form the tessellation state create info descriptor if needed */ - if (current_pipeline_ptr->shader_stages[GRAPHICS_SHADER_STAGE_TESSELLATION_CONTROL].name.size() != 0 || - current_pipeline_ptr->shader_stages[GRAPHICS_SHADER_STAGE_TESSELLATION_EVALUATION].name.size() != 0) { - VkPipelineTessellationStateCreateInfo tessellation_state_create_info; + const Anvil::ShaderModuleStageEntryPoint* tc_shader_stage_entry_point_ptr = nullptr; + const Anvil::ShaderModuleStageEntryPoint* te_shader_stage_entry_point_ptr = nullptr; - tessellation_state_create_info.flags = 0; - tessellation_state_create_info.patchControlPoints = current_pipeline_config_ptr->n_patch_control_points; - tessellation_state_create_info.pNext = nullptr; - tessellation_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO; + current_pipeline_info_ptr->get_shader_stage_properties(Anvil::SHADER_STAGE_TESSELLATION_CONTROL, + &tc_shader_stage_entry_point_ptr); + current_pipeline_info_ptr->get_shader_stage_properties(Anvil::SHADER_STAGE_TESSELLATION_EVALUATION, + &te_shader_stage_entry_point_ptr); - tessellation_state_used = true; + if (tc_shader_stage_entry_point_ptr != nullptr && + te_shader_stage_entry_point_ptr != nullptr) + { + VkPipelineTessellationStateCreateInfo tessellation_state_create_info; - tessellation_state_create_info_items_vk_cache.push_back(tessellation_state_create_info); - } - else - { - tessellation_state_used = false; + tessellation_state_create_info.flags = 0; + tessellation_state_create_info.patchControlPoints = current_pipeline_info_ptr->get_n_patch_control_points(); + tessellation_state_create_info.pNext = nullptr; + tessellation_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO; + + tessellation_state_used = true; + + tessellation_state_create_info_items_vk_cache.push_back(tessellation_state_create_info); + } + else + { + tessellation_state_used = false; + } } /* Form the vertex input state create info descriptor */ - bake_vk_attributes_and_bindings(current_pipeline_config_ptr); + { + std::unique_ptr current_pipeline_gfx_data_ptr; + + anvil_assert(m_pipeline_id_to_gfx_pipeline_data.find(current_pipeline_id) == m_pipeline_id_to_gfx_pipeline_data.end() ); + + current_pipeline_gfx_data_ptr.reset( + new GraphicsPipelineData(current_pipeline_info_ptr) + ); + + if (current_pipeline_gfx_data_ptr == nullptr) + { + anvil_assert(current_pipeline_gfx_data_ptr != nullptr); + + continue; + } + + vertex_input_state_create_info.vertexAttributeDescriptionCount = static_cast(current_pipeline_gfx_data_ptr->vk_input_attributes.size()); + vertex_input_state_create_info.vertexBindingDescriptionCount = static_cast(current_pipeline_gfx_data_ptr->vk_input_bindings.size ()); - vertex_input_state_create_info.vertexAttributeDescriptionCount = static_cast(current_pipeline_config_ptr->vk_input_attributes.size()); - vertex_input_state_create_info.vertexBindingDescriptionCount = static_cast(current_pipeline_config_ptr->vk_input_bindings.size() ); + vertex_input_state_create_info.flags = 0; + vertex_input_state_create_info.pNext = nullptr; + vertex_input_state_create_info.pVertexAttributeDescriptions = (vertex_input_state_create_info.vertexAttributeDescriptionCount > 0) ? ¤t_pipeline_gfx_data_ptr->vk_input_attributes.at(0) + : nullptr; + vertex_input_state_create_info.pVertexBindingDescriptions = (vertex_input_state_create_info.vertexBindingDescriptionCount > 0) ? ¤t_pipeline_gfx_data_ptr->vk_input_bindings.at(0) + : nullptr; + vertex_input_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO; - vertex_input_state_create_info.flags = 0; - vertex_input_state_create_info.pNext = nullptr; - vertex_input_state_create_info.pVertexAttributeDescriptions = (vertex_input_state_create_info.vertexAttributeDescriptionCount > 0) ? ¤t_pipeline_config_ptr->vk_input_attributes.at(0) - : nullptr; - vertex_input_state_create_info.pVertexBindingDescriptions = (vertex_input_state_create_info.vertexBindingDescriptionCount > 0) ? ¤t_pipeline_config_ptr->vk_input_bindings.at(0) - : nullptr; - vertex_input_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO; + vertex_input_state_create_info_items_vk_cache.push_back(vertex_input_state_create_info); - vertex_input_state_create_info_items_vk_cache.push_back(vertex_input_state_create_info); + m_pipeline_id_to_gfx_pipeline_data[current_pipeline_id] = std::move(current_pipeline_gfx_data_ptr); + } /* Form the viewport state create info descriptor, if needed */ - if (!current_pipeline_config_ptr->rasterizer_discard_enabled) + if (!current_pipeline_info_ptr->is_rasterizer_discard_enabled() ) { + const auto enabled_dynamic_states = current_pipeline_info_ptr->get_enabled_dynamic_states(); + uint32_t n_scissor_boxes = (enabled_dynamic_states & DYNAMIC_STATE_SCISSOR_BIT) ? current_pipeline_info_ptr->get_n_dynamic_scissor_boxes() + : current_pipeline_info_ptr->get_n_scissor_boxes (); + uint32_t n_viewports = (enabled_dynamic_states & DYNAMIC_STATE_VIEWPORT_BIT) ? current_pipeline_info_ptr->get_n_dynamic_viewports () + : current_pipeline_info_ptr->get_n_viewports (); const uint32_t scissor_boxes_start_offset = static_cast(scissor_boxes_vk_cache.size() ); const uint32_t viewports_start_offset = static_cast(viewports_vk_cache.size() ); VkPipelineViewportStateCreateInfo viewport_state_create_info; - #ifdef _DEBUG - { - const uint32_t n_scissor_boxes = (current_pipeline_config_ptr->enabled_dynamic_states & DYNAMIC_STATE_SCISSOR_BIT) ? current_pipeline_config_ptr->n_dynamic_scissor_boxes - : static_cast(current_pipeline_config_ptr->scissor_boxes.size() ); - const uint32_t n_viewports = (current_pipeline_config_ptr->enabled_dynamic_states & DYNAMIC_STATE_VIEWPORT_BIT) ? current_pipeline_config_ptr->n_dynamic_viewports - : static_cast(current_pipeline_config_ptr->viewports.size() ); - - anvil_assert(n_scissor_boxes == n_viewports); - } - #endif /* _DEBUG */ + anvil_assert(n_scissor_boxes == n_viewports); - if (current_pipeline_config_ptr->scissor_boxes.size() == 0) + if (n_scissor_boxes == 0) { /* No scissor boxes / viewport defined. Use default settings.. */ - InternalScissorBox default_scissor_box; - InternalViewport default_viewport; - std::shared_ptr swapchain_ptr = current_pipeline_config_ptr->renderpass_ptr->get_swapchain(); - uint32_t window_size[2] = {0}; + auto swapchain_ptr = current_pipeline_info_ptr->get_renderpass()->get_swapchain(); + uint32_t window_size[2] = {0}; /* NOTE: If you hit this assertion, you either need to pass a Swapchain instance when this renderpass is being created, * *or* specify scissor & viewport information for the GFX pipeline. */ anvil_assert(swapchain_ptr != nullptr); + anvil_assert(n_viewports == 0); swapchain_ptr->get_image(0)->get_image_mipmap_size(0, /* n_mipmap */ window_size + 0, @@ -824,49 +744,93 @@ bool Anvil::GraphicsPipelineManager::bake() anvil_assert(window_size[0] != 0 && window_size[1] != 0); - default_scissor_box.height = window_size[1]; - default_scissor_box.width = window_size[0]; - default_scissor_box.x = 0; - default_scissor_box.y = 0; - - default_viewport.height = float(window_size[1]); - default_viewport.max_depth = 1.0f; - default_viewport.min_depth = 0.0f; - default_viewport.origin_x = 0.0f; - default_viewport.origin_y = 0.0f; - default_viewport.width = float(window_size[0]); - - current_pipeline_config_ptr->scissor_boxes[0] = default_scissor_box; - current_pipeline_config_ptr->viewports [0] = default_viewport; + current_pipeline_info_ptr->set_scissor_box_properties(0, /* in_n_scissor_box */ + 0, /* in_x */ + 0, /* in_y */ + window_size[0], + window_size[1]); + current_pipeline_info_ptr->set_viewport_properties (0, /* in_n_viewport */ + 0.0f, /* in_origin_x */ + 0.0f, /* in_origin_y */ + static_cast(window_size[0]), + static_cast(window_size[1]), + 0.0f, /* in_min_depth */ + 1.0f); /* in_max_depth */ + + n_scissor_boxes = 1; + n_viewports = 1; } /* Convert internal scissor box & viewport representations to Vulkan descriptors */ - for (auto scissor_box_iterator = current_pipeline_config_ptr->scissor_boxes.cbegin(); - scissor_box_iterator != current_pipeline_config_ptr->scissor_boxes.cend(); - ++scissor_box_iterator) + if ((enabled_dynamic_states & DYNAMIC_STATE_SCISSOR_BIT) == 0) { - scissor_boxes_vk_cache.push_back(scissor_box_iterator->second.get_vk_descriptor() ); + for (uint32_t n_scissor_box = 0; + n_scissor_box < n_scissor_boxes; + ++n_scissor_box) + { + uint32_t current_scissor_box_height = UINT32_MAX; + uint32_t current_scissor_box_width = UINT32_MAX; + int32_t current_scissor_box_x = INT32_MAX; + int32_t current_scissor_box_y = INT32_MAX; + VkRect2D current_scissor_box_vk; + + current_pipeline_info_ptr->get_scissor_box_properties(n_scissor_box, + ¤t_scissor_box_x, + ¤t_scissor_box_y, + ¤t_scissor_box_width, + ¤t_scissor_box_height); + current_scissor_box_vk.extent.height = current_scissor_box_height; + current_scissor_box_vk.extent.width = current_scissor_box_width; + current_scissor_box_vk.offset.x = current_scissor_box_x; + current_scissor_box_vk.offset.y = current_scissor_box_y; + + scissor_boxes_vk_cache.push_back(current_scissor_box_vk); + } } - for (auto viewport_iterator = current_pipeline_config_ptr->viewports.cbegin(); - viewport_iterator != current_pipeline_config_ptr->viewports.cend(); - ++viewport_iterator) + if ((enabled_dynamic_states & DYNAMIC_STATE_VIEWPORT_BIT) == 0) { - viewports_vk_cache.push_back(viewport_iterator->second.get_vk_descriptor() ); + for (uint32_t n_viewport = 0; + n_viewport < n_viewports; + ++n_viewport) + { + float current_viewport_height = std::numeric_limits::max(); + float current_viewport_max_depth = std::numeric_limits::max(); + float current_viewport_min_depth = std::numeric_limits::max(); + float current_viewport_origin_x = std::numeric_limits::max(); + float current_viewport_origin_y = std::numeric_limits::max(); + float current_viewport_width = std::numeric_limits::max(); + VkViewport current_viewport_vk; + + current_pipeline_info_ptr->get_viewport_properties(n_viewport, + ¤t_viewport_origin_x, + ¤t_viewport_origin_y, + ¤t_viewport_width, + ¤t_viewport_height, + ¤t_viewport_min_depth, + ¤t_viewport_max_depth); + + current_viewport_vk.height = current_viewport_height; + current_viewport_vk.maxDepth = current_viewport_max_depth; + current_viewport_vk.minDepth = current_viewport_min_depth; + current_viewport_vk.x = current_viewport_origin_x; + current_viewport_vk.y = current_viewport_origin_y; + current_viewport_vk.width = current_viewport_width; + + viewports_vk_cache.push_back(current_viewport_vk); + } } /* Bake the descriptor */ viewport_state_create_info.flags = 0; viewport_state_create_info.pNext = nullptr; - viewport_state_create_info.pScissors = ((current_pipeline_config_ptr->enabled_dynamic_states & DYNAMIC_STATE_SCISSOR_BIT) != 0) ? VK_NULL_HANDLE - : &scissor_boxes_vk_cache[scissor_boxes_start_offset]; - viewport_state_create_info.pViewports = ((current_pipeline_config_ptr->enabled_dynamic_states & DYNAMIC_STATE_VIEWPORT_BIT) != 0) ? VK_NULL_HANDLE - : &viewports_vk_cache [viewports_start_offset]; - viewport_state_create_info.scissorCount = ((current_pipeline_config_ptr->enabled_dynamic_states & DYNAMIC_STATE_SCISSOR_BIT) != 0) ? current_pipeline_config_ptr->n_dynamic_scissor_boxes - : static_cast(current_pipeline_config_ptr->scissor_boxes.size() ); + viewport_state_create_info.pScissors = ((enabled_dynamic_states & DYNAMIC_STATE_SCISSOR_BIT) != 0) ? VK_NULL_HANDLE + : &scissor_boxes_vk_cache.at(scissor_boxes_start_offset); + viewport_state_create_info.pViewports = ((enabled_dynamic_states & DYNAMIC_STATE_VIEWPORT_BIT) != 0) ? VK_NULL_HANDLE + : &viewports_vk_cache.at(viewports_start_offset); + viewport_state_create_info.scissorCount = n_scissor_boxes; viewport_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO; - viewport_state_create_info.viewportCount = ((current_pipeline_config_ptr->enabled_dynamic_states & DYNAMIC_STATE_VIEWPORT_BIT) != 0) ? current_pipeline_config_ptr->n_dynamic_viewports - : static_cast(current_pipeline_config_ptr->viewports.size() ); + viewport_state_create_info.viewportCount = n_viewports; anvil_assert(viewport_state_create_info.scissorCount == viewport_state_create_info.viewportCount); anvil_assert(viewport_state_create_info.scissorCount != 0); @@ -881,16 +845,15 @@ bool Anvil::GraphicsPipelineManager::bake() } /* Configure base pipeline handle/indices fields of the create info descriptor */ - if (current_pipeline_ptr->base_pipeline_ptr != nullptr) - { - anvil_assert(current_pipeline_ptr->base_pipeline == VK_NULL_HANDLE); + const auto current_pipeline_base_pipeline_id = current_pipeline_info_ptr->get_base_pipeline_id(); + if (current_pipeline_base_pipeline_id != UINT32_MAX) + { /* There are three cases we need to handle separately here: * * 1. The base pipeline is to be baked in the call we're preparing for. Determine * its index in the create info descriptor array and use it. - * 2. The pipeline has been baked earlier. We should be able to work around this - * by providing a handle to the pipeline, instead of the index. + * 2. The pipeline has been baked earlier. Pass the baked pipeline's handle. * 3. The pipeline under specified index uses a different layout. This indicates * a bug in the app or the manager. * @@ -898,21 +861,21 @@ bool Anvil::GraphicsPipelineManager::bake() */ auto base_bake_item_iterator = std::find(bake_items.begin(), bake_items.end(), - current_pipeline_ptr->base_pipeline_ptr); + current_pipeline_base_pipeline_id); if (base_bake_item_iterator != bake_items.end() ) { /* Case 1 */ - graphics_pipeline_create_info.basePipelineHandle = current_pipeline_ptr->base_pipeline; + graphics_pipeline_create_info.basePipelineHandle = VK_NULL_HANDLE; graphics_pipeline_create_info.basePipelineIndex = static_cast(base_bake_item_iterator - bake_items.begin() ); } else - if (current_pipeline_ptr->base_pipeline_ptr != nullptr && - current_pipeline_ptr->base_pipeline_ptr->baked_pipeline != VK_NULL_HANDLE) + if (base_bake_item_iterator->pipeline_ptr != nullptr && + base_bake_item_iterator->pipeline_ptr->baked_pipeline != VK_NULL_HANDLE) { /* Case 2 */ - graphics_pipeline_create_info.basePipelineHandle = current_pipeline_ptr->base_pipeline_ptr->baked_pipeline; - graphics_pipeline_create_info.basePipelineIndex = -1; /* unused. */ + graphics_pipeline_create_info.basePipelineHandle = base_bake_item_iterator->pipeline_ptr->baked_pipeline; + graphics_pipeline_create_info.basePipelineIndex = UINT32_MAX; } else { @@ -921,20 +884,14 @@ bool Anvil::GraphicsPipelineManager::bake() } } else - if (current_pipeline_ptr->base_pipeline != VK_NULL_HANDLE) - { - graphics_pipeline_create_info.basePipelineHandle = current_pipeline_ptr->base_pipeline; - graphics_pipeline_create_info.basePipelineIndex = -1; /* unused. */ - } - else { /* No base pipeline requested */ graphics_pipeline_create_info.basePipelineHandle = VK_NULL_HANDLE; - graphics_pipeline_create_info.basePipelineIndex = -1; /* unused */ + graphics_pipeline_create_info.basePipelineIndex = UINT32_MAX; } /* Form the rest of the create info descriptor */ - anvil_assert(!current_pipeline_ptr->layout_dirty); + anvil_assert(current_pipeline_ptr->layout_ptr != nullptr); graphics_pipeline_create_info.flags = 0; graphics_pipeline_create_info.layout = current_pipeline_ptr->layout_ptr->get_pipeline_layout(); @@ -949,32 +906,25 @@ bool Anvil::GraphicsPipelineManager::bake() : VK_NULL_HANDLE; graphics_pipeline_create_info.pNext = nullptr; graphics_pipeline_create_info.pRasterizationState = &raster_state_create_info_items_vk_cache[raster_state_create_info_items_vk_cache.size() - 1]; - graphics_pipeline_create_info.pStages = &shader_stage_create_info_items_vk_cache[shader_stage_start_offset]; + graphics_pipeline_create_info.pStages = (shader_stage_start_offset < shader_stage_create_info_items_vk_cache.size() ) ? &shader_stage_create_info_items_vk_cache[shader_stage_start_offset] + : nullptr; graphics_pipeline_create_info.pTessellationState = (tessellation_state_used) ? &tessellation_state_create_info_items_vk_cache[tessellation_state_create_info_items_vk_cache.size() - 1] : VK_NULL_HANDLE; graphics_pipeline_create_info.pVertexInputState = &vertex_input_state_create_info_items_vk_cache[vertex_input_state_create_info_items_vk_cache.size() - 1]; graphics_pipeline_create_info.pViewportState = (viewport_state_used) ? &viewport_state_create_info_items_vk_cache[viewport_state_create_info_items_vk_cache.size() - 1] : VK_NULL_HANDLE; - graphics_pipeline_create_info.renderPass = current_pipeline_config_ptr->renderpass_ptr->get_render_pass(); + graphics_pipeline_create_info.renderPass = current_pipeline_info_ptr->get_renderpass()->get_render_pass(); graphics_pipeline_create_info.stageCount = static_cast(shader_stage_create_info_items_vk_cache.size() - shader_stage_start_offset); graphics_pipeline_create_info.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO; - graphics_pipeline_create_info.subpass = current_pipeline_config_ptr->subpass_id; + graphics_pipeline_create_info.subpass = current_pipeline_info_ptr->get_subpass_id(); - if (graphics_pipeline_create_info.basePipelineHandle != VK_NULL_HANDLE || - graphics_pipeline_create_info.basePipelineIndex != -1) + if (graphics_pipeline_create_info.basePipelineIndex != static_cast(UINT32_MAX) ) { graphics_pipeline_create_info.flags |= VK_PIPELINE_CREATE_DERIVATIVE_BIT; } - graphics_pipeline_create_info.flags |= ((current_pipeline_ptr->allow_derivatives) ? VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT : 0) | - ((current_pipeline_ptr->disable_optimizations) ? VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT : 0); - - if (current_pipeline_config_ptr->pre_bake_function != nullptr) - { - current_pipeline_config_ptr->pre_bake_function(m_device_ptr, - current_pipeline_id, - &graphics_pipeline_create_info); - } + graphics_pipeline_create_info.flags |= ((current_pipeline_info_ptr->allows_derivatives () ) ? VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT : 0) | + ((current_pipeline_info_ptr->has_optimizations_disabled() ) ? VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT : 0); /* Stash the descriptor for now. We will issue one expensive vkCreateGraphicsPipelines() call after all pipeline objects * are iterated over. */ @@ -989,35 +939,39 @@ bool Anvil::GraphicsPipelineManager::bake() * the underlying storage will likely be reallocated. Many of the descriptors use pointers to refer to children descriptors, * and when the data is moved around, the pointers are no longer valid. */ - anvil_assert(color_blend_attachment_states_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(color_blend_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(depth_stencil_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(dynamic_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(enabled_dynamic_states_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(graphics_pipeline_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(input_assembly_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(multisample_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(raster_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(scissor_boxes_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(shader_stage_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(specialization_info_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(specialization_map_entry_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(tessellation_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(vertex_input_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(viewport_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(viewports_vk_cache.size() <= N_CACHE_ITEMS); + anvil_assert(color_blend_attachment_states_vk_cache.size() <= N_CACHE_ITEMS); + anvil_assert(color_blend_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); + anvil_assert(depth_stencil_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); + anvil_assert(dynamic_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); + anvil_assert(enabled_dynamic_states_vk_cache.size() <= N_CACHE_ITEMS); + anvil_assert(graphics_pipeline_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); + anvil_assert(input_assembly_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); + anvil_assert(multisample_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); + anvil_assert(raster_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); + anvil_assert(scissor_boxes_vk_cache.size() <= N_CACHE_ITEMS); + anvil_assert(shader_stage_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); + anvil_assert(specialization_info_vk_cache.size() <= N_CACHE_ITEMS); + anvil_assert(specialization_map_entry_vk_cache.size() <= N_CACHE_ITEMS); + anvil_assert(tessellation_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); + anvil_assert(vertex_input_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); + anvil_assert(viewport_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); + anvil_assert(viewports_vk_cache.size() <= N_CACHE_ITEMS); } #endif /* All right. Try to bake all pipeline objects at once */ result_graphics_pipelines.resize(bake_items.size() ); - result_vk = vkCreateGraphicsPipelines(device_locked_ptr->get_device_vk(), - m_pipeline_cache_ptr->get_pipeline_cache(), - static_cast(graphics_pipeline_create_info_items_vk_cache.size() ), - &graphics_pipeline_create_info_items_vk_cache[0], - nullptr, /* pAllocator */ - &result_graphics_pipelines[0]); + m_pipeline_cache_ptr->lock(); + { + result_vk = vkCreateGraphicsPipelines(device_locked_ptr->get_device_vk(), + m_pipeline_cache_ptr->get_pipeline_cache(), + static_cast(graphics_pipeline_create_info_items_vk_cache.size() ), + &graphics_pipeline_create_info_items_vk_cache[0], + nullptr, /* pAllocator */ + &result_graphics_pipelines[0]); + } + m_pipeline_cache_ptr->unlock(); if (!is_vk_call_successful(result_vk) ) { @@ -1026,43 +980,23 @@ bool Anvil::GraphicsPipelineManager::bake() goto end; } - for (auto bake_item_iterator = bake_items.begin(); - bake_item_iterator != bake_items.end(); - ++bake_item_iterator) - { - if (!bake_item_iterator->pipeline_ptr->dirty) - { - continue; - } - - if (m_pipeline_configurations[bake_item_iterator->pipeline_id]->post_bake_function != nullptr) - { - m_pipeline_configurations[bake_item_iterator->pipeline_id]->post_bake_function(m_device_ptr, - bake_item_iterator->pipeline_id); - } - } - /* Distribute the result pipeline objects to pipeline configuration descriptors */ - for (auto pipeline_iterator = m_pipelines.begin(); - pipeline_iterator != m_pipelines.end(); + for (auto pipeline_iterator = m_outstanding_pipelines.begin(); + pipeline_iterator != m_outstanding_pipelines.end(); ++pipeline_iterator) { - const GraphicsPipelineID current_pipeline_id = pipeline_iterator->first; - std::shared_ptr current_pipeline_ptr = pipeline_iterator->second; + const PipelineID& current_pipeline_id = pipeline_iterator->first; - if (!current_pipeline_ptr->dirty || - current_pipeline_ptr->is_proxy || - !current_pipeline_ptr->is_bakeable) - { - continue; - } + anvil_assert(m_baked_pipelines.find(current_pipeline_id) == m_baked_pipelines.end() ); - m_pipelines[current_pipeline_id]->baked_pipeline = result_graphics_pipelines[n_consumed_graphics_pipelines++]; - current_pipeline_ptr->dirty = false; + pipeline_iterator->second->baked_pipeline = result_graphics_pipelines[n_consumed_graphics_pipelines++]; + m_baked_pipelines[current_pipeline_id] = std::move(pipeline_iterator->second); } anvil_assert(n_consumed_graphics_pipelines == static_cast(result_graphics_pipelines.size() )); + m_outstanding_pipelines.clear(); + /* All done */ result = true; end: @@ -1073,38 +1007,62 @@ bool Anvil::GraphicsPipelineManager::bake() * structures. * * The function goes an extra mile to re-use the same vertex binding for attributes whose binding properties match. - * - * @param pipeline_config_ptr Pipeline configuration descriptor to use. Must not be nullptr. */ -void Anvil::GraphicsPipelineManager::bake_vk_attributes_and_bindings(std::shared_ptr inout_pipeline_config_ptr) +void Anvil::GraphicsPipelineManager::GraphicsPipelineData::bake_vk_attributes_and_bindings() { - inout_pipeline_config_ptr->attribute_location_to_binding_index_map.clear(); - inout_pipeline_config_ptr->vk_input_attributes.clear(); - inout_pipeline_config_ptr->vk_input_bindings.clear(); + uint32_t n_attributes = 0; + + anvil_assert(attribute_location_to_binding_index_map.size() == 0); + anvil_assert(vk_input_attributes.size () == 0); + anvil_assert(vk_input_bindings.size () == 0); - for (auto attribute_iterator = inout_pipeline_config_ptr->attributes.cbegin(); - attribute_iterator != inout_pipeline_config_ptr->attributes.cend(); - ++attribute_iterator) + pipeline_info_ptr->get_graphics_pipeline_properties(nullptr, /* out_opt_n_scissors_ptr */ + nullptr, /* out_opt_n_viewports_ptr */ + &n_attributes, /* out_opt_n_vertex_attributes_ptr */ + nullptr, /* out_opt_renderpass_ptr */ + nullptr); /* out_opt_subpass_id_ptr */ + + for (uint32_t n_attribute = 0; + n_attribute < n_attributes; + ++n_attribute) { /* Identify the binding index we should use for the attribute. * * If an explicit binding has been specified by the application, this step can be skipped */ - const auto& current_attribute = *attribute_iterator; + uint32_t current_attribute_explicit_vertex_binding_index = UINT32_MAX; + uint32_t current_attribute_location = UINT32_MAX; + VkFormat current_attribute_format = VK_FORMAT_MAX_ENUM; + uint32_t current_attribute_offset = UINT32_MAX; + VkVertexInputRate current_attribute_rate = VK_VERTEX_INPUT_RATE_MAX_ENUM; + uint32_t current_attribute_stride = UINT32_MAX; VkVertexInputAttributeDescription current_attribute_vk; - uint32_t n_attribute_binding = UINT32_MAX; - bool has_found = false; + uint32_t n_attribute_binding = UINT32_MAX; + bool has_found = false; + + if (!pipeline_info_ptr->get_vertex_attribute_properties(n_attribute, + ¤t_attribute_location, + ¤t_attribute_format, + ¤t_attribute_offset, + ¤t_attribute_explicit_vertex_binding_index, + ¤t_attribute_stride, + ¤t_attribute_rate) ) + { + anvil_assert_fail(); + + continue; + } - if (current_attribute.explicit_binding_index == UINT32_MAX) + if (current_attribute_explicit_vertex_binding_index == UINT32_MAX) { - for (auto vk_input_binding_iterator = inout_pipeline_config_ptr->vk_input_bindings.begin(); - vk_input_binding_iterator != inout_pipeline_config_ptr->vk_input_bindings.end(); + for (auto vk_input_binding_iterator = vk_input_bindings.begin(); + vk_input_binding_iterator != vk_input_bindings.end(); ++vk_input_binding_iterator) { - if (vk_input_binding_iterator->inputRate == attribute_iterator->rate && - vk_input_binding_iterator->stride == attribute_iterator->stride_in_bytes) + if (vk_input_binding_iterator->inputRate == current_attribute_rate && + vk_input_binding_iterator->stride == current_attribute_stride) { has_found = true; - n_attribute_binding = static_cast(vk_input_binding_iterator - inout_pipeline_config_ptr->vk_input_bindings.begin()); + n_attribute_binding = static_cast(vk_input_binding_iterator - vk_input_bindings.begin()); break; } @@ -1113,7 +1071,7 @@ void Anvil::GraphicsPipelineManager::bake_vk_attributes_and_bindings(std::shared else { has_found = false; - n_attribute_binding = current_attribute.explicit_binding_index; + n_attribute_binding = current_attribute_explicit_vertex_binding_index; } if (!has_found) @@ -1121,33 +1079,34 @@ void Anvil::GraphicsPipelineManager::bake_vk_attributes_and_bindings(std::shared /* Got to create a new binding descriptor .. */ VkVertexInputBindingDescription new_binding_vk; - new_binding_vk.binding = (current_attribute.explicit_binding_index == UINT32_MAX) ? static_cast(inout_pipeline_config_ptr->vk_input_bindings.size() ) - : current_attribute.explicit_binding_index; - new_binding_vk.inputRate = attribute_iterator->rate; - new_binding_vk.stride = attribute_iterator->stride_in_bytes; + new_binding_vk.binding = (current_attribute_explicit_vertex_binding_index == UINT32_MAX) ? static_cast(vk_input_bindings.size() ) + : current_attribute_explicit_vertex_binding_index; + new_binding_vk.inputRate = current_attribute_rate; + new_binding_vk.stride = current_attribute_stride; - inout_pipeline_config_ptr->vk_input_bindings.push_back(new_binding_vk); + vk_input_bindings.push_back(new_binding_vk); n_attribute_binding = new_binding_vk.binding; } /* Good to convert the internal attribute descriptor to the Vulkan's input attribute descriptor */ current_attribute_vk.binding = n_attribute_binding; - current_attribute_vk.format = attribute_iterator->format; - current_attribute_vk.location = attribute_iterator->location; - current_attribute_vk.offset = attribute_iterator->offset_in_bytes; + current_attribute_vk.format = current_attribute_format; + current_attribute_vk.location = current_attribute_location; + current_attribute_vk.offset = current_attribute_offset; /* Associate attribute locations with assigned bindings */ - anvil_assert(inout_pipeline_config_ptr->attribute_location_to_binding_index_map.find(attribute_iterator->location) == inout_pipeline_config_ptr->attribute_location_to_binding_index_map.end() ); - inout_pipeline_config_ptr->attribute_location_to_binding_index_map[attribute_iterator->location] = current_attribute_vk.binding; + anvil_assert(attribute_location_to_binding_index_map.find(current_attribute_location) == attribute_location_to_binding_index_map.end() ); + attribute_location_to_binding_index_map[current_attribute_location] = current_attribute_vk.binding; /* Cache the descriptor */ - inout_pipeline_config_ptr->vk_input_attributes.push_back(current_attribute_vk); + vk_input_attributes.push_back(current_attribute_vk); } } /* Please see header for specification */ std::shared_ptr Anvil::GraphicsPipelineManager::create(std::weak_ptr in_device_ptr, + bool in_mt_safe, bool in_use_pipeline_cache, std::shared_ptr in_pipeline_cache_to_reuse_ptr) { @@ -1155,2212 +1114,10 @@ std::shared_ptr Anvil::GraphicsPipelineManager:: result_ptr.reset( new Anvil::GraphicsPipelineManager(in_device_ptr, + in_mt_safe, in_use_pipeline_cache, in_pipeline_cache_to_reuse_ptr) ); return result_ptr; } - -/* Please see header for specification */ -bool Anvil::GraphicsPipelineManager::delete_pipeline(GraphicsPipelineID in_graphics_pipeline_id) -{ - GraphicsPipelineConfigurations::iterator configuration_iterator; - bool result = false; - - result = BasePipelineManager::delete_pipeline(in_graphics_pipeline_id); - - if (!result) - { - goto end; - } - - configuration_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - - if (configuration_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(configuration_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - m_pipeline_configurations.erase(configuration_iterator); - } - - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_alpha_to_coverage_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_opt_is_enabled_ptr != nullptr) - { - *out_opt_is_enabled_ptr = pipeline_config_ptr->alpha_to_coverage_enabled; - } - - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_alpha_to_one_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_opt_is_enabled_ptr != nullptr) - { - *out_opt_is_enabled_ptr = pipeline_config_ptr->alpha_to_one_enabled; - } - - result = true; -end: - return result; -} - -/* Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_blending_properties(GraphicsPipelineID in_graphics_pipeline_id, - float* out_opt_blend_constant_vec4_ptr, - uint32_t* out_opt_n_blend_attachments_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_opt_blend_constant_vec4_ptr != nullptr) - { - memcpy(out_opt_blend_constant_vec4_ptr, - pipeline_config_ptr->blend_constant, - sizeof(pipeline_config_ptr->blend_constant) ); - } - - if (out_opt_n_blend_attachments_ptr != nullptr) - { - *out_opt_n_blend_attachments_ptr = static_cast(pipeline_config_ptr->subpass_attachment_blending_properties.size() ); - } - - result = true; -end: - return result; -} - -/* Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_color_blend_attachment_properties(GraphicsPipelineID in_graphics_pipeline_id, - SubPassAttachmentID in_attachment_id, - bool* out_opt_blending_enabled_ptr, - VkBlendOp* out_opt_blend_op_color_ptr, - VkBlendOp* out_opt_blend_op_alpha_ptr, - VkBlendFactor* out_opt_src_color_blend_factor_ptr, - VkBlendFactor* out_opt_dst_color_blend_factor_ptr, - VkBlendFactor* out_opt_src_alpha_blend_factor_ptr, - VkBlendFactor* out_opt_dst_alpha_blend_factor_ptr, - VkColorComponentFlags* out_opt_channel_write_mask_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - SubPassAttachmentToBlendingPropertiesMap::const_iterator props_iterator; - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - props_iterator = pipeline_config_ptr->subpass_attachment_blending_properties.find(in_attachment_id); - - if (props_iterator == pipeline_config_ptr->subpass_attachment_blending_properties.end() ) - { - anvil_assert(!(props_iterator == pipeline_config_ptr->subpass_attachment_blending_properties.end() ) ); - - goto end; - } - - if (out_opt_blending_enabled_ptr != nullptr) - { - *out_opt_blending_enabled_ptr = props_iterator->second.blend_enabled; - } - - if (out_opt_blend_op_color_ptr != nullptr) - { - *out_opt_blend_op_color_ptr = props_iterator->second.blend_op_color; - } - - if (out_opt_blend_op_alpha_ptr != nullptr) - { - *out_opt_blend_op_alpha_ptr = props_iterator->second.blend_op_alpha; - } - - if (out_opt_src_color_blend_factor_ptr != nullptr) - { - *out_opt_src_color_blend_factor_ptr = props_iterator->second.src_color_blend_factor; - } - - if (out_opt_dst_color_blend_factor_ptr != nullptr) - { - *out_opt_dst_color_blend_factor_ptr = props_iterator->second.dst_color_blend_factor; - } - - if (out_opt_src_alpha_blend_factor_ptr != nullptr) - { - *out_opt_src_alpha_blend_factor_ptr = props_iterator->second.src_alpha_blend_factor; - } - - if (out_opt_dst_alpha_blend_factor_ptr != nullptr) - { - *out_opt_dst_alpha_blend_factor_ptr = props_iterator->second.dst_alpha_blend_factor; - } - - if (out_opt_channel_write_mask_ptr != nullptr) - { - *out_opt_channel_write_mask_ptr = props_iterator->second.channel_write_mask; - } - - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_depth_bias_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr, - float* out_opt_depth_bias_constant_factor_ptr, - float* out_opt_depth_bias_clamp_ptr, - float* out_opt_depth_bias_slope_factor_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_opt_is_enabled_ptr != nullptr) - { - *out_opt_is_enabled_ptr = pipeline_config_ptr->depth_bias_enabled; - } - - if (out_opt_depth_bias_constant_factor_ptr != nullptr) - { - *out_opt_depth_bias_constant_factor_ptr = pipeline_config_ptr->depth_bias_constant_factor; - } - - if (out_opt_depth_bias_clamp_ptr != nullptr) - { - *out_opt_depth_bias_clamp_ptr = pipeline_config_ptr->depth_bias_clamp; - } - - if (out_opt_depth_bias_slope_factor_ptr != nullptr) - { - *out_opt_depth_bias_slope_factor_ptr = pipeline_config_ptr->depth_bias_slope_factor; - } - - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_depth_bounds_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr, - float* out_opt_min_depth_bounds_ptr, - float* out_opt_max_depth_bounds_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_opt_is_enabled_ptr != nullptr) - { - *out_opt_is_enabled_ptr = pipeline_config_ptr->depth_bounds_test_enabled; - } - - if (out_opt_min_depth_bounds_ptr != nullptr) - { - *out_opt_min_depth_bounds_ptr = pipeline_config_ptr->min_depth_bounds; - } - - if (out_opt_max_depth_bounds_ptr != nullptr) - { - *out_opt_max_depth_bounds_ptr = pipeline_config_ptr->max_depth_bounds; - } - - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_depth_clamp_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_opt_is_enabled_ptr != nullptr) - { - *out_opt_is_enabled_ptr = pipeline_config_ptr->depth_clamp_enabled; - } - - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_depth_test_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr, - VkCompareOp* out_opt_compare_op_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_opt_is_enabled_ptr != nullptr) - { - *out_opt_is_enabled_ptr = pipeline_config_ptr->depth_test_enabled; - } - - if (out_opt_compare_op_ptr != nullptr) - { - *out_opt_compare_op_ptr = pipeline_config_ptr->depth_test_compare_op; - } - - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_depth_write_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_opt_is_enabled_ptr != nullptr) - { - *out_opt_is_enabled_ptr = pipeline_config_ptr->depth_writes_enabled; - } - - result = true; -end: - return result; -} - -/* Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_dynamic_scissor_state_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t* out_opt_n_dynamic_scissor_boxes_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_opt_n_dynamic_scissor_boxes_ptr != nullptr) - { - *out_opt_n_dynamic_scissor_boxes_ptr = pipeline_config_ptr->n_dynamic_scissor_boxes; - } - - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_dynamic_states(GraphicsPipelineID in_graphics_pipeline_id, - DynamicStateBitfield* out_opt_enabled_dynamic_states_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_opt_enabled_dynamic_states_ptr != nullptr) - { - *out_opt_enabled_dynamic_states_ptr = pipeline_config_ptr->enabled_dynamic_states; - } - - result = true; -end: - return result; -} - -/* Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_dynamic_viewport_state_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t* out_n_dynamic_viewports_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_n_dynamic_viewports_ptr!= nullptr) - { - *out_n_dynamic_viewports_ptr = pipeline_config_ptr->n_dynamic_viewports; - } - - result = true; -end: - return result; -} - -/* Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_graphics_pipeline_properties(Anvil::GraphicsPipelineID in_graphics_pipeline_id, - uint32_t* out_opt_n_scissors_ptr, - uint32_t* out_opt_n_viewports_ptr, - uint32_t* out_opt_n_vertex_input_attributes_ptr, - uint32_t* out_opt_n_vertex_input_bindings_ptr, - std::shared_ptr* out_opt_renderpass_ptr, - SubPassID* out_opt_subpass_id_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_opt_n_scissors_ptr != nullptr) - { - *out_opt_n_scissors_ptr = static_cast(pipeline_config_ptr->scissor_boxes.size() ); - } - - if (out_opt_n_viewports_ptr != nullptr) - { - *out_opt_n_viewports_ptr = static_cast(pipeline_config_ptr->viewports.size() ); - } - - if (out_opt_n_vertex_input_attributes_ptr != nullptr) - { - *out_opt_n_vertex_input_attributes_ptr = static_cast(pipeline_config_ptr->vk_input_attributes.size() ); - } - - if (out_opt_n_vertex_input_bindings_ptr != nullptr) - { - *out_opt_n_vertex_input_bindings_ptr = static_cast(pipeline_config_ptr->vk_input_bindings.size() ); - } - - if (out_opt_renderpass_ptr != nullptr) - { - *out_opt_renderpass_ptr = pipeline_config_ptr->renderpass_ptr; - } - - if (out_opt_subpass_id_ptr != nullptr) - { - *out_opt_subpass_id_ptr = pipeline_config_ptr->subpass_id; - } - - /* All done */ - result = true; -end: - return result; -} - -/* Please see header for specification */ -VkPipeline Anvil::GraphicsPipelineManager::get_graphics_pipeline(GraphicsPipelineID in_pipeline_id) -{ - auto pipeline_iterator = m_pipelines.find(in_pipeline_id); - bool result = false; - VkPipeline result_pipeline = VK_NULL_HANDLE; - - ANVIL_REDUNDANT_VARIABLE(result); - - if (pipeline_iterator == m_pipelines.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end()) ); - - goto end; - } - - if (pipeline_iterator->second->baked_pipeline == VK_NULL_HANDLE || - pipeline_iterator->second->dirty) - { - anvil_assert(!pipeline_iterator->second->is_proxy); - - result = bake(); - - anvil_assert(result); - anvil_assert(pipeline_iterator->second->dirty == false); - anvil_assert(pipeline_iterator->second->baked_pipeline != VK_NULL_HANDLE); - } - - result_pipeline = pipeline_iterator->second->baked_pipeline; - -end: - return result_pipeline; -} - -/* Please see header for specification */ -std::shared_ptr Anvil::GraphicsPipelineManager::get_graphics_pipeline_layout(GraphicsPipelineID in_pipeline_id) -{ - return get_pipeline_layout(in_pipeline_id); -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_input_assembly_properties(GraphicsPipelineID in_graphics_pipeline_id, - VkPrimitiveTopology* out_opt_primitive_topology_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_opt_primitive_topology_ptr != nullptr) - { - *out_opt_primitive_topology_ptr = pipeline_config_ptr->primitive_topology; - } - - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_logic_op_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr, - VkLogicOp* out_opt_logic_op_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_opt_is_enabled_ptr != nullptr) - { - *out_opt_is_enabled_ptr = pipeline_config_ptr->logic_op_enabled; - } - - if (out_opt_logic_op_ptr != nullptr) - { - *out_opt_logic_op_ptr = pipeline_config_ptr->logic_op; - } - - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_multisampling_properties(GraphicsPipelineID in_graphics_pipeline_id, - VkSampleCountFlags* out_opt_sample_count_ptr, - VkSampleMask* out_opt_sample_mask_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_opt_sample_count_ptr != nullptr) - { - *out_opt_sample_count_ptr = pipeline_config_ptr->sample_count; - } - - if (out_opt_sample_mask_ptr != nullptr) - { - *out_opt_sample_mask_ptr = pipeline_config_ptr->sample_mask; - } - - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_primitive_restart_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_opt_is_enabled_ptr != nullptr) - { - *out_opt_is_enabled_ptr = pipeline_config_ptr->primitive_restart_enabled; - } - - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_rasterization_order(GraphicsPipelineID in_graphics_pipeline_id, - VkRasterizationOrderAMD* out_opt_rasterization_order_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_opt_rasterization_order_ptr != nullptr) - { - *out_opt_rasterization_order_ptr = pipeline_config_ptr->rasterization_order; - } - - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_rasterizer_discard_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_opt_is_enabled_ptr != nullptr) - { - *out_opt_is_enabled_ptr = pipeline_config_ptr->rasterizer_discard_enabled; - } - - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_rasterization_properties(GraphicsPipelineID in_graphics_pipeline_id, - VkPolygonMode* out_opt_polygon_mode_ptr, - VkCullModeFlags* out_opt_cull_mode_ptr, - VkFrontFace* out_opt_front_face_ptr, - float* out_opt_line_width_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_opt_polygon_mode_ptr != nullptr) - { - *out_opt_polygon_mode_ptr = pipeline_config_ptr->polygon_mode; - } - - if (out_opt_cull_mode_ptr != nullptr) - { - *out_opt_cull_mode_ptr = pipeline_config_ptr->cull_mode; - } - - if (out_opt_front_face_ptr != nullptr) - { - *out_opt_front_face_ptr = pipeline_config_ptr->front_face; - } - - if (out_opt_line_width_ptr != nullptr) - { - *out_opt_line_width_ptr = pipeline_config_ptr->line_width; - } - - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_sample_shading_state(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr, - float* out_opt_min_sample_shading_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_opt_is_enabled_ptr != nullptr) - { - *out_opt_is_enabled_ptr = pipeline_config_ptr->sample_shading_enabled; - } - - if (out_opt_min_sample_shading_ptr != nullptr) - { - *out_opt_min_sample_shading_ptr = pipeline_config_ptr->min_sample_shading; - } - - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_scissor_box_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_n_scissor_box, - int32_t* out_opt_x_ptr, - int32_t* out_opt_y_ptr, - uint32_t* out_opt_width_ptr, - uint32_t* out_opt_height_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - const InternalScissorBox* scissor_box_props_ptr = nullptr; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (pipeline_config_ptr->scissor_boxes.find(in_n_scissor_box) == pipeline_config_ptr->scissor_boxes.end() ) - { - anvil_assert(!(pipeline_config_ptr->scissor_boxes.find(in_n_scissor_box) == pipeline_config_ptr->scissor_boxes.end()) ); - - goto end; - } - else - { - scissor_box_props_ptr = &pipeline_config_ptr->scissor_boxes.at(in_n_scissor_box); - } - - if (out_opt_x_ptr != nullptr) - { - *out_opt_x_ptr = scissor_box_props_ptr->x; - } - - if (out_opt_y_ptr != nullptr) - { - *out_opt_y_ptr = scissor_box_props_ptr->y; - } - - if (out_opt_width_ptr != nullptr) - { - *out_opt_width_ptr = scissor_box_props_ptr->width; - } - - if (out_opt_height_ptr != nullptr) - { - *out_opt_height_ptr = scissor_box_props_ptr->height; - } - - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_stencil_test_properties(GraphicsPipelineID in_graphics_pipeline_id, - bool* out_opt_is_enabled_ptr, - VkStencilOp* out_opt_front_stencil_fail_op_ptr, - VkStencilOp* out_opt_front_stencil_pass_op_ptr, - VkStencilOp* out_opt_front_stencil_depth_fail_op_ptr, - VkCompareOp* out_opt_front_stencil_compare_op_ptr, - uint32_t* out_opt_front_stencil_compare_mask_ptr, - uint32_t* out_opt_front_stencil_write_mask_ptr, - uint32_t* out_opt_front_stencil_reference_ptr, - VkStencilOp* out_opt_back_stencil_fail_op_ptr, - VkStencilOp* out_opt_back_stencil_pass_op_ptr, - VkStencilOp* out_opt_back_stencil_depth_fail_op_ptr, - VkCompareOp* out_opt_back_stencil_compare_op_ptr, - uint32_t* out_opt_back_stencil_compare_mask_ptr, - uint32_t* out_opt_back_stencil_write_mask_ptr, - uint32_t* out_opt_back_stencil_reference_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_opt_is_enabled_ptr != nullptr) - { - *out_opt_is_enabled_ptr = pipeline_config_ptr->stencil_test_enabled; - } - - if (out_opt_front_stencil_fail_op_ptr != nullptr) - { - *out_opt_front_stencil_fail_op_ptr = pipeline_config_ptr->stencil_state_front_face.failOp; - } - - if (out_opt_front_stencil_pass_op_ptr != nullptr) - { - *out_opt_front_stencil_pass_op_ptr = pipeline_config_ptr->stencil_state_front_face.passOp; - } - - if (out_opt_front_stencil_depth_fail_op_ptr != nullptr) - { - *out_opt_front_stencil_depth_fail_op_ptr = pipeline_config_ptr->stencil_state_front_face.depthFailOp; - } - - if (out_opt_front_stencil_compare_op_ptr != nullptr) - { - *out_opt_front_stencil_compare_op_ptr = pipeline_config_ptr->stencil_state_front_face.compareOp; - } - - if (out_opt_front_stencil_compare_mask_ptr != nullptr) - { - *out_opt_front_stencil_compare_mask_ptr = pipeline_config_ptr->stencil_state_front_face.compareMask; - } - - if (out_opt_front_stencil_write_mask_ptr != nullptr) - { - *out_opt_front_stencil_write_mask_ptr = pipeline_config_ptr->stencil_state_front_face.writeMask; - } - - if (out_opt_front_stencil_reference_ptr != nullptr) - { - *out_opt_front_stencil_reference_ptr = pipeline_config_ptr->stencil_state_front_face.reference; - } - - if (out_opt_back_stencil_fail_op_ptr != nullptr) - { - *out_opt_back_stencil_fail_op_ptr = pipeline_config_ptr->stencil_state_back_face.failOp; - } - - if (out_opt_back_stencil_pass_op_ptr != nullptr) - { - *out_opt_back_stencil_pass_op_ptr = pipeline_config_ptr->stencil_state_back_face.passOp; - } - - if (out_opt_back_stencil_depth_fail_op_ptr != nullptr) - { - *out_opt_back_stencil_depth_fail_op_ptr = pipeline_config_ptr->stencil_state_back_face.depthFailOp; - } - - if (out_opt_back_stencil_compare_op_ptr != nullptr) - { - *out_opt_back_stencil_compare_op_ptr = pipeline_config_ptr->stencil_state_back_face.compareOp; - } - - if (out_opt_back_stencil_compare_mask_ptr != nullptr) - { - *out_opt_back_stencil_compare_mask_ptr = pipeline_config_ptr->stencil_state_back_face.compareMask; - } - - if (out_opt_back_stencil_write_mask_ptr != nullptr) - { - *out_opt_back_stencil_write_mask_ptr = pipeline_config_ptr->stencil_state_back_face.writeMask; - } - - if (out_opt_back_stencil_reference_ptr != nullptr) - { - *out_opt_back_stencil_reference_ptr = pipeline_config_ptr->stencil_state_back_face.reference; - } - - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_tessellation_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t* out_opt_n_patch_control_points_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (out_opt_n_patch_control_points_ptr != nullptr) - { - *out_opt_n_patch_control_points_ptr = pipeline_config_ptr->n_patch_control_points; - } - - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_vertex_input_attribute_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_n_vertex_input_attribute, - uint32_t* out_opt_location_ptr, - uint32_t* out_opt_binding_ptr, - VkFormat* out_opt_format_ptr, - uint32_t* out_opt_offset_ptr) const -{ - VkVertexInputAttributeDescription* attribute_ptr; - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (pipeline_config_ptr->vk_input_attributes.size() <= in_n_vertex_input_attribute) - { - anvil_assert(!(pipeline_config_ptr->vk_input_attributes.size() <= in_n_vertex_input_attribute) ); - - goto end; - } - else - { - attribute_ptr = &pipeline_config_ptr->vk_input_attributes.at(in_n_vertex_input_attribute); - } - - if (out_opt_location_ptr != nullptr) - { - *out_opt_location_ptr = attribute_ptr->location; - } - - if (out_opt_binding_ptr != nullptr) - { - *out_opt_binding_ptr = attribute_ptr->binding; - } - - if (out_opt_format_ptr != nullptr) - { - *out_opt_format_ptr = attribute_ptr->format; - } - - if (out_opt_offset_ptr != nullptr) - { - *out_opt_offset_ptr = attribute_ptr->offset; - } - - /* All done */ - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_vertex_input_binding_for_attribute_location(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_input_vertex_attribute_location, - uint32_t* out_input_vertex_binding_ptr) -{ - AttributeLocationToBindingIndexMap::const_iterator attribute_location_iterator; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - std::shared_ptr pipeline_config_ptr; - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - std::shared_ptr pipeline_ptr; - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() || - pipeline_iterator == m_pipelines.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end() )); - anvil_assert(!(pipeline_iterator == m_pipelines.end() )); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - pipeline_ptr = pipeline_iterator->second; - } - - if (pipeline_ptr->dirty) - { - const bool has_been_successfully_baked = bake(); - - if (!has_been_successfully_baked) - { - anvil_assert(has_been_successfully_baked); - - goto end; - } - - anvil_assert(!pipeline_ptr->dirty); - } - - if ( (attribute_location_iterator = pipeline_config_ptr->attribute_location_to_binding_index_map.find(in_input_vertex_attribute_location)) == pipeline_config_ptr->attribute_location_to_binding_index_map.end() ) - { - anvil_assert(!(attribute_location_iterator == pipeline_config_ptr->attribute_location_to_binding_index_map.end() )); - - goto end; - } - else - { - *out_input_vertex_binding_ptr = attribute_location_iterator->second; - result = true; - } - -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_vertex_input_binding_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_n_vertex_input_binding, - uint32_t* out_opt_binding_ptr, - uint32_t* out_opt_stride_ptr, - VkVertexInputRate* out_opt_input_rate_ptr) const -{ - VkVertexInputBindingDescription* binding_ptr; - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (pipeline_config_ptr->vk_input_bindings.size() <= in_n_vertex_input_binding) - { - anvil_assert(!(pipeline_config_ptr->vk_input_bindings.size() <= in_n_vertex_input_binding) ); - - goto end; - } - else - { - binding_ptr = &pipeline_config_ptr->vk_input_bindings.at(in_n_vertex_input_binding); - } - - if (out_opt_binding_ptr != nullptr) - { - *out_opt_binding_ptr = binding_ptr->binding; - } - - if (out_opt_stride_ptr != nullptr) - { - *out_opt_stride_ptr = binding_ptr->stride; - } - - if (out_opt_input_rate_ptr != nullptr) - { - *out_opt_input_rate_ptr = binding_ptr->inputRate; - } - - /* All done */ - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::GraphicsPipelineManager::get_viewport_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_n_viewport, - float* out_opt_origin_x_ptr, - float* out_opt_origin_y_ptr, - float* out_opt_width_ptr, - float* out_opt_height_ptr, - float* out_opt_min_depth_ptr, - float* out_opt_max_depth_ptr) const -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - bool result = false; - InternalViewport* viewport_props_ptr; - - if (pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (pipeline_config_ptr->viewports.find(in_n_viewport) == pipeline_config_ptr->viewports.end() ) - { - anvil_assert(!(pipeline_config_ptr->viewports.find(in_n_viewport) == pipeline_config_ptr->viewports.end()) ); - - goto end; - } - else - { - viewport_props_ptr = &pipeline_config_ptr->viewports.at(in_n_viewport); - } - - if (out_opt_origin_x_ptr != nullptr) - { - *out_opt_origin_x_ptr = viewport_props_ptr->origin_x; - } - - if (out_opt_origin_y_ptr != nullptr) - { - *out_opt_origin_y_ptr = viewport_props_ptr->origin_y; - } - - if (out_opt_width_ptr != nullptr) - { - *out_opt_width_ptr = viewport_props_ptr->width; - } - - if (out_opt_height_ptr != nullptr) - { - *out_opt_height_ptr = viewport_props_ptr->height; - } - - if (out_opt_min_depth_ptr != nullptr) - { - *out_opt_min_depth_ptr = viewport_props_ptr->min_depth; - } - - if (out_opt_max_depth_ptr != nullptr) - { - *out_opt_max_depth_ptr = viewport_props_ptr->max_depth; - } - - result = true; -end: - return result; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::set_blending_properties(GraphicsPipelineID in_graphics_pipeline_id, - const float* in_blend_constant_vec4) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - memcpy(pipeline_config_ptr->blend_constant, - in_blend_constant_vec4, - sizeof(pipeline_config_ptr->blend_constant) ); - - pipeline_iterator->second->dirty = true; -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::set_color_blend_attachment_properties(GraphicsPipelineID in_graphics_pipeline_id, - SubPassAttachmentID in_attachment_id, - bool in_blending_enabled, - VkBlendOp in_blend_op_color, - VkBlendOp in_blend_op_alpha, - VkBlendFactor in_src_color_blend_factor, - VkBlendFactor in_dst_color_blend_factor, - VkBlendFactor in_src_alpha_blend_factor, - VkBlendFactor in_dst_alpha_blend_factor, - VkColorComponentFlags in_channel_write_mask) -{ - BlendingProperties* attachment_blending_props_ptr = nullptr; - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - /* Retrieve and update the attachment descriptor. */ - attachment_blending_props_ptr = &pipeline_config_ptr->subpass_attachment_blending_properties[in_attachment_id]; - - attachment_blending_props_ptr->blend_enabled = in_blending_enabled; - attachment_blending_props_ptr->blend_op_alpha = in_blend_op_alpha; - attachment_blending_props_ptr->blend_op_color = in_blend_op_color; - attachment_blending_props_ptr->channel_write_mask = in_channel_write_mask; - attachment_blending_props_ptr->dst_alpha_blend_factor = in_dst_alpha_blend_factor; - attachment_blending_props_ptr->dst_color_blend_factor = in_dst_color_blend_factor; - attachment_blending_props_ptr->src_alpha_blend_factor = in_src_alpha_blend_factor; - attachment_blending_props_ptr->src_color_blend_factor = in_src_color_blend_factor; - pipeline_iterator->second->dirty = true; -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::set_dynamic_scissor_state_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_n_dynamic_scissor_boxes) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->n_dynamic_scissor_boxes = in_n_dynamic_scissor_boxes; - pipeline_iterator->second->dirty = true; -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::set_dynamic_viewport_state_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_n_dynamic_viewports) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->n_dynamic_viewports = in_n_dynamic_viewports; - pipeline_iterator->second->dirty = true; -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::set_input_assembly_properties(GraphicsPipelineID in_graphics_pipeline_id, - VkPrimitiveTopology in_primitive_topology) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->primitive_topology = in_primitive_topology; - pipeline_iterator->second->dirty = true; -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::set_multisampling_properties(GraphicsPipelineID in_graphics_pipeline_id, - VkSampleCountFlagBits in_sample_count, - float in_min_sample_shading, - const VkSampleMask in_sample_mask) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - anvil_assert(in_sample_count <= VK_SAMPLE_COUNT_32_BIT); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->min_sample_shading = in_min_sample_shading; - pipeline_config_ptr->sample_count = in_sample_count; - pipeline_config_ptr->sample_mask = in_sample_mask; - pipeline_iterator->second->dirty = true; - -end: - ; -} - -/* Please see header for specification */ -bool Anvil::GraphicsPipelineManager::set_pipeline_post_bake_callback(GraphicsPipelineID in_graphics_pipeline_id, - PipelinePostBakeFunction in_pipeline_post_bake_function) -{ - bool result = false; - - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->post_bake_function = in_pipeline_post_bake_function; - result = true; - -end: - return result; -} - -/* Please see header for specification */ -bool Anvil::GraphicsPipelineManager::set_pipeline_pre_bake_callback(GraphicsPipelineID in_graphics_pipeline_id, - PipelinePreBakeFunction in_pfn_pipeline_pre_bake_function) -{ - bool result = false; - - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->pre_bake_function = in_pfn_pipeline_pre_bake_function; - result = true; -end: - return result; -} - -/* Please see header for specification */ -bool Anvil::GraphicsPipelineManager::set_pipeline_state_from_pipeline(GraphicsPipelineID in_target_pipeline_id, - GraphicsPipelineID in_source_pipeline_id) -{ - std::shared_ptr cached_renderpass_ptr; - SubPassID cached_subpass_id = UINT32_MAX; - bool result = false; - std::shared_ptr source_pipeline_config_ptr; - - if (m_pipelines.find(in_target_pipeline_id) == m_pipelines.end() ) - { - anvil_assert(!(m_pipelines.find(in_target_pipeline_id) == m_pipelines.end()) ); - - goto end; - } - - if (m_pipeline_configurations.find(in_target_pipeline_id) == m_pipeline_configurations.end() ) - { - anvil_assert(!(m_pipeline_configurations.find(in_target_pipeline_id) == m_pipeline_configurations.end() )); - - goto end; - } - - if (m_pipeline_configurations.find(in_source_pipeline_id) == m_pipeline_configurations.end() ) - { - anvil_assert(!(m_pipeline_configurations.find(in_source_pipeline_id) == m_pipeline_configurations.end() )); - - goto end; - } - - cached_renderpass_ptr = m_pipeline_configurations[in_target_pipeline_id]->renderpass_ptr; - cached_subpass_id = m_pipeline_configurations[in_target_pipeline_id]->subpass_id; - - m_pipeline_configurations[in_target_pipeline_id] = m_pipeline_configurations[in_source_pipeline_id]; - m_pipelines [in_target_pipeline_id]->dsg_ptr = m_pipelines [in_source_pipeline_id]->dsg_ptr; - m_pipelines [in_target_pipeline_id]->dirty = true; - m_pipelines [in_target_pipeline_id]->push_constant_ranges = m_pipelines[in_source_pipeline_id]->push_constant_ranges; - - m_pipeline_configurations[in_target_pipeline_id]->renderpass_ptr = cached_renderpass_ptr; - m_pipeline_configurations[in_target_pipeline_id]->subpass_id = cached_subpass_id; - - result = true; -end: - return result; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::set_rasterization_order(GraphicsPipelineID in_graphics_pipeline_id, - VkRasterizationOrderAMD in_rasterization_order) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (pipeline_config_ptr->rasterization_order != in_rasterization_order) - { - pipeline_config_ptr->rasterization_order = in_rasterization_order; - pipeline_iterator->second->dirty = true; - } - -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::set_rasterization_properties(GraphicsPipelineID in_graphics_pipeline_id, - VkPolygonMode in_polygon_mode, - VkCullModeFlags in_cull_mode, - VkFrontFace in_front_face, - float in_line_width) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->cull_mode = in_cull_mode; - pipeline_config_ptr->front_face = in_front_face; - pipeline_config_ptr->line_width = in_line_width; - pipeline_config_ptr->polygon_mode = in_polygon_mode; - - pipeline_iterator->second->dirty = true; -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::set_scissor_box_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_n_scissor_box, - int32_t in_x, - int32_t in_y, - uint32_t in_width, - uint32_t in_height) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->scissor_boxes[in_n_scissor_box] = InternalScissorBox(in_x, - in_y, - in_width, - in_height); - - pipeline_iterator->second->dirty = true; -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::set_stencil_test_properties(GraphicsPipelineID in_graphics_pipeline_id, - bool in_update_front_face_state, - VkStencilOp in_stencil_fail_op, - VkStencilOp in_stencil_pass_op, - VkStencilOp in_stencil_depth_fail_op, - VkCompareOp in_stencil_compare_op, - uint32_t in_stencil_compare_mask, - uint32_t in_stencil_write_mask, - uint32_t in_stencil_reference) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - VkStencilOpState* stencil_op_state_ptr = nullptr; - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - stencil_op_state_ptr = (in_update_front_face_state) ? &pipeline_config_ptr->stencil_state_front_face - : &pipeline_config_ptr->stencil_state_back_face; - - stencil_op_state_ptr->compareMask = in_stencil_compare_mask; - stencil_op_state_ptr->compareOp = in_stencil_compare_op; - stencil_op_state_ptr->depthFailOp = in_stencil_depth_fail_op; - stencil_op_state_ptr->failOp = in_stencil_fail_op; - stencil_op_state_ptr->passOp = in_stencil_pass_op; - stencil_op_state_ptr->reference = in_stencil_reference; - stencil_op_state_ptr->writeMask = in_stencil_write_mask; - - pipeline_iterator->second->dirty = true; -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::set_tessellation_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_n_patch_control_points) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->n_patch_control_points = in_n_patch_control_points; - pipeline_iterator->second->dirty = true; -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::set_viewport_properties(GraphicsPipelineID in_graphics_pipeline_id, - uint32_t in_n_viewport, - float in_origin_x, - float in_origin_y, - float in_width, - float in_height, - float in_min_depth, - float in_max_depth) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->viewports[in_n_viewport] = InternalViewport(in_origin_x, - in_origin_y, - in_width, - in_height, - in_min_depth, - in_max_depth); - - pipeline_iterator->second->dirty = true; -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::toggle_alpha_to_coverage(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->alpha_to_coverage_enabled = in_should_enable; - pipeline_iterator->second->dirty = true; -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::toggle_alpha_to_one(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->alpha_to_one_enabled = in_should_enable; - pipeline_iterator->second->dirty = true; -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::toggle_depth_bounds_test(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable, - float in_min_depth_bounds, - float in_max_depth_bounds) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->depth_bounds_test_enabled = in_should_enable; - pipeline_config_ptr->max_depth_bounds = in_max_depth_bounds; - pipeline_config_ptr->min_depth_bounds = in_min_depth_bounds; - pipeline_iterator->second->dirty = true; -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::toggle_depth_bias(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable, - float in_depth_bias_constant_factor, - float in_depth_bias_clamp, - float in_depth_bias_slope_factor) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->depth_bias_constant_factor = in_depth_bias_constant_factor; - pipeline_config_ptr->depth_bias_clamp = in_depth_bias_clamp; - pipeline_config_ptr->depth_bias_enabled = in_should_enable; - pipeline_config_ptr->depth_bias_slope_factor = in_depth_bias_slope_factor; - pipeline_iterator->second->dirty = true; -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::toggle_depth_clamp(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->depth_clamp_enabled = in_should_enable; - pipeline_iterator->second->dirty = true; - -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::toggle_depth_test(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable, - VkCompareOp in_compare_op) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->depth_test_enabled = in_should_enable; - pipeline_config_ptr->depth_test_compare_op = in_compare_op; - pipeline_iterator->second->dirty = true; - -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::toggle_depth_writes(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->depth_writes_enabled = in_should_enable; - pipeline_iterator->second->dirty = true; -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::toggle_dynamic_states(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable, - DynamicStateBitfield in_dynamic_state_bits) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - if (in_should_enable) - { - pipeline_config_ptr->enabled_dynamic_states |= in_dynamic_state_bits; - } - else - { - pipeline_config_ptr->enabled_dynamic_states &= ~in_dynamic_state_bits; - } - - pipeline_iterator->second->dirty = true; -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::toggle_logic_op(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable, - VkLogicOp in_logic_op) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->logic_op = in_logic_op; - pipeline_config_ptr->logic_op_enabled = in_should_enable; - pipeline_iterator->second->dirty = true; -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::toggle_primitive_restart(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->primitive_restart_enabled = in_should_enable; - pipeline_iterator->second->dirty = true; - -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::toggle_rasterizer_discard(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->rasterizer_discard_enabled = in_should_enable; - pipeline_iterator->second->dirty = true; - -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::toggle_sample_mask(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->sample_mask_enabled = in_should_enable; - pipeline_iterator->second->dirty = true; -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::toggle_sample_shading(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->sample_shading_enabled = in_should_enable; - pipeline_iterator->second->dirty = true; -end: - ; -} - -/* Please see header for specification */ -void Anvil::GraphicsPipelineManager::toggle_stencil_test(GraphicsPipelineID in_graphics_pipeline_id, - bool in_should_enable) -{ - std::shared_ptr pipeline_config_ptr; - auto pipeline_config_iterator = m_pipeline_configurations.find(in_graphics_pipeline_id); - auto pipeline_iterator = m_pipelines.find (in_graphics_pipeline_id); - - if (pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end() ) - { - anvil_assert(!(pipeline_iterator == m_pipelines.end() || - pipeline_config_iterator == m_pipeline_configurations.end()) ); - - goto end; - } - else - { - pipeline_config_ptr = pipeline_config_iterator->second; - } - - pipeline_config_ptr->stencil_test_enabled = in_should_enable; - pipeline_iterator->second->dirty = true; - -end: - ; -} \ No newline at end of file diff --git a/src/wrappers/image.cpp b/src/wrappers/image.cpp index 52a813bd..578507ed 100644 --- a/src/wrappers/image.cpp +++ b/src/wrappers/image.cpp @@ -55,10 +55,12 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, Anvil::ImageCreateFlags in_create_flags, Anvil::QueueFamilyBits in_queue_families, VkImageLayout in_post_create_image_layout, - const std::vector* in_opt_mipmaps_ptr) + const std::vector* in_opt_mipmaps_ptr, + bool in_mt_safe) :CallbacksSupportProvider (IMAGE_CALLBACK_ID_COUNT), DebugMarkerSupportProvider (in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT), + MTSafetySupportProvider (in_mt_safe), m_alignment (0), m_create_flags (in_create_flags), m_depth (in_base_mipmap_depth), @@ -80,6 +82,7 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, m_sample_count (in_sample_count), m_sharing_mode (in_sharing_mode), m_storage_size (0), + m_swapchain_memory_assigned (false), m_tiling (in_tiling), m_type (in_type), m_usage (static_cast(in_usage)), @@ -114,10 +117,12 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, bool in_use_full_mipmap_chain, Anvil::ImageCreateFlags in_create_flags, VkImageLayout in_post_create_image_layout, - const std::vector* in_mipmaps_ptr) + const std::vector* in_mipmaps_ptr, + bool in_mt_safe) :CallbacksSupportProvider (IMAGE_CALLBACK_ID_COUNT), DebugMarkerSupportProvider (in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT), + MTSafetySupportProvider (in_mt_safe), m_alignment (0), m_create_flags (in_create_flags), m_depth (in_base_mipmap_depth), @@ -140,6 +145,7 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, m_sample_count (in_sample_count), m_sharing_mode (in_sharing_mode), m_storage_size (0), + m_swapchain_memory_assigned (false), m_tiling (in_tiling), m_type (in_type), m_usage (static_cast(in_usage)), @@ -171,10 +177,12 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, VkSampleCountFlagBits in_sample_count, uint32_t in_n_slices, Anvil::ImageCreateFlags in_create_flags, - Anvil::QueueFamilyBits in_queue_families) + Anvil::QueueFamilyBits in_queue_families, + bool in_mt_safe) :CallbacksSupportProvider (IMAGE_CALLBACK_ID_COUNT), DebugMarkerSupportProvider (in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT), + MTSafetySupportProvider (in_mt_safe), m_alignment (0), m_create_flags (in_create_flags), m_depth (in_base_mipmap_depth), @@ -197,6 +205,7 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, m_sample_count (in_sample_count), m_sharing_mode (in_sharing_mode), m_storage_size (UINT64_MAX), + m_swapchain_memory_assigned (false), m_tiling (in_tiling), m_type (VK_IMAGE_TYPE_MAX_ENUM), m_usage (static_cast(in_usage)), @@ -223,10 +232,12 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, VkSharingMode in_sharing_mode, bool in_use_full_mipmap_chain, Anvil::ImageCreateFlags in_create_flags, - Anvil::SparseResidencyScope in_residency_scope) + Anvil::SparseResidencyScope in_residency_scope, + bool in_mt_safe) :CallbacksSupportProvider (IMAGE_CALLBACK_ID_COUNT), DebugMarkerSupportProvider (in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT), + MTSafetySupportProvider (in_mt_safe), m_alignment (0), m_create_flags (in_create_flags), m_depth (in_base_mipmap_depth), @@ -249,6 +260,7 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, m_sample_count (in_sample_count), m_sharing_mode (in_sharing_mode), m_storage_size (UINT64_MAX), + m_swapchain_memory_assigned (false), m_tiling (in_tiling), m_type (in_type), m_usage (static_cast(in_usage)), @@ -274,6 +286,7 @@ void Anvil::Image::change_image_layout(std::shared_ptr const std::shared_ptr* in_opt_set_semaphore_ptrs) { std::shared_ptr device_locked_ptr (m_device_ptr); + const Anvil::DeviceType device_type (device_locked_ptr->get_type() ); Anvil::QueueFamilyType in_queue_family_type (Anvil::QUEUE_FAMILY_TYPE_UNDEFINED); const uint32_t in_queue_family_index (in_queue_ptr->get_queue_family_index() ); auto mem_block_ptr (get_memory_block() ); @@ -312,13 +325,20 @@ void Anvil::Image::change_image_layout(std::shared_ptr } transition_command_buffer_ptr->stop_recording(); - in_queue_ptr->submit_command_buffer_with_signal_wait_semaphores(transition_command_buffer_ptr, - in_opt_n_set_semaphores, - in_opt_set_semaphore_ptrs, - in_opt_n_wait_semaphores, - in_opt_wait_semaphore_ptrs, - in_opt_wait_dst_stage_mask_ptrs, - true /* should_block */); + if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) + { + in_queue_ptr->submit_command_buffer_with_signal_wait_semaphores(transition_command_buffer_ptr, + in_opt_n_set_semaphores, + in_opt_set_semaphore_ptrs, + in_opt_n_wait_semaphores, + in_opt_wait_semaphore_ptrs, + in_opt_wait_dst_stage_mask_ptrs, + true /* should_block */); + } + else + { + anvil_assert_fail(); + } } /** Please see header for specification */ @@ -337,8 +357,12 @@ std::shared_ptr Anvil::Image::create_nonsparse(std::weak_ptr* in_opt_mipmaps_ptr) + const std::vector* in_opt_mipmaps_ptr, + MTSafety in_mt_safety) { + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); + std::shared_ptr result_ptr( new Image(in_device_ptr, in_type, @@ -355,7 +379,8 @@ std::shared_ptr Anvil::Image::create_nonsparse(std::weak_ptrinit(in_use_full_mipmap_chain, @@ -382,8 +407,11 @@ std::shared_ptr Anvil::Image::create_nonsparse(std::weak_ptr* in_mipmaps_ptr) + const std::vector* in_mipmaps_ptr, + MTSafety in_mt_safety) { + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); const VkImageLayout start_image_layout = (in_mipmaps_ptr != nullptr && in_mipmaps_ptr->size() > 0) ? VK_IMAGE_LAYOUT_PREINITIALIZED : VK_IMAGE_LAYOUT_UNDEFINED; @@ -403,7 +431,8 @@ std::shared_ptr Anvil::Image::create_nonsparse(std::weak_ptrinit(in_use_full_mipmap_chain, @@ -416,9 +445,12 @@ std::shared_ptr Anvil::Image::create_nonsparse(std::weak_ptr Anvil::Image::create_nonsparse(std::weak_ptr in_device_ptr, const VkSwapchainCreateInfoKHR& in_swapchain_create_info, - VkImage in_image) + VkImage in_image, + MTSafety in_mt_safety) { std::shared_ptr device_locked_ptr(in_device_ptr); + const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); std::shared_ptr new_image_ptr( new Anvil::Image(in_device_ptr, @@ -435,7 +467,8 @@ std::shared_ptr Anvil::Image::create_nonsparse(std::weak_ptrm_memory_types = 0; @@ -464,10 +497,13 @@ std::shared_ptr Anvil::Image::create_sparse(std::weak_ptr device_locked_ptr(in_device_ptr); const VkPhysicalDeviceFeatures& features (device_locked_ptr->get_physical_device_features() ); + const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); std::shared_ptr result_ptr; anvil_assert(in_initial_layout == VK_IMAGE_LAYOUT_PREINITIALIZED || @@ -621,7 +657,8 @@ std::shared_ptr Anvil::Image::create_sparse(std::weak_ptrinit(in_use_full_mipmap_chain, @@ -685,7 +722,24 @@ std::shared_ptr Anvil::Image::get_memory_block() &callback_argument); } - return m_memory_block_ptr; + if (m_is_sparse) + { + if (m_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_NONE) + { + anvil_assert(m_page_tracker_ptr != nullptr); + + return m_page_tracker_ptr->get_memory_block(0); + } + else + { + /* More than just one memory block may exist. You need to use page tracker manually. */ + return nullptr; + } + } + else + { + return m_memory_block_ptr; + } } /** Private function which initializes the Image instance. @@ -848,14 +902,25 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, m_n_mipmaps = image_create_info.mipLevels; m_n_slices = (m_type == VK_IMAGE_TYPE_3D) ? m_depth : 1; - /* Extract various image properties we're going to need later */ - vkGetImageMemoryRequirements(device_locked_ptr->get_device_vk(), - m_image, - &m_memory_reqs); + if (m_swapchain_ptr == nullptr) + { + /* Extract various image properties we're going to need later */ + vkGetImageMemoryRequirements(device_locked_ptr->get_device_vk(), + m_image, + &m_memory_reqs); + + m_alignment = m_memory_reqs.alignment; + m_memory_types = m_memory_reqs.memoryTypeBits; + m_storage_size = m_memory_reqs.size; + } + else + { + anvil_assert(!m_memory_owner); - m_alignment = m_memory_reqs.alignment; - m_memory_types = m_memory_reqs.memoryTypeBits; - m_storage_size = m_memory_reqs.size; + m_alignment = UINT64_MAX; + m_memory_types = 0; + m_storage_size = 0; + } /* Cache aspect subresource properties if we're dealing with a linear image */ if (m_tiling == VK_IMAGE_TILING_LINEAR) @@ -903,6 +968,8 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, uint32_t n_reqs = 0; std::vector sparse_image_memory_reqs; + anvil_assert(m_swapchain_ptr == nullptr); /* TODO: can images, to which swapchains can be bound, be sparse? */ + /* Retrieve image aspect properties. Since Vulkan lets a single props structure to refer to more than * just a single aspect, we first cache the exposed info in a vec and then distribute the information to * a map, whose key is allowed to consist of a single bit ( = individual aspect) only */ @@ -963,7 +1030,8 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, m_metadata_memory_block_ptr = Anvil::MemoryBlock::create(m_device_ptr, m_memory_reqs.memoryTypeBits, metadata_aspect_iterator->second.mip_tail_size, - 0); /* in_memory_features */ + 0, /* in_memory_features */ + Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); /* Set up bind info update structure. */ metadata_binding_bind_info_id = metadata_binding_update.add_bind_info(0, /* n_signal_semaphores */ @@ -1000,7 +1068,8 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, auto memory_block_ptr = Anvil::MemoryBlock::create(m_device_ptr, m_memory_reqs.memoryTypeBits, m_memory_reqs.size, - in_memory_features); + in_memory_features, + Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); set_memory(memory_block_ptr); } @@ -1159,9 +1228,13 @@ Anvil::Image::~Image() { std::shared_ptr device_locked_ptr(m_device_ptr); - vkDestroyImage(device_locked_ptr->get_device_vk(), - m_image, - nullptr /* pAllocator */); + lock(); + { + vkDestroyImage(device_locked_ptr->get_device_vk(), + m_image, + nullptr /* pAllocator */); + } + unlock(); m_image = VK_NULL_HANDLE; } @@ -1827,14 +1900,23 @@ bool Anvil::Image::set_memory(std::shared_ptr in_memory_bloc anvil_assert(!m_is_sparse); anvil_assert(m_mipmaps.size() > 0); anvil_assert(m_memory_block_ptr == nullptr); + anvil_assert(m_swapchain_ptr == nullptr); /* Bind the memory object to the image object */ if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) { - result = vkBindImageMemory(device_locked_ptr->get_device_vk(), - m_image, - in_memory_block_ptr->get_memory(), - in_memory_block_ptr->get_start_offset() ); + lock(); + { + result = vkBindImageMemory(device_locked_ptr->get_device_vk(), + m_image, + in_memory_block_ptr->get_memory(), + in_memory_block_ptr->get_start_offset() ); + } + unlock(); + } + else + { + anvil_assert_fail(); } anvil_assert_vk_call_succeeded(result); @@ -2040,6 +2122,7 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p anvil_assert(( dst_slice_offset_page_aligned % sparse_page_size) == 0); mem_block_ptr = m_page_tracker_ptr->get_memory_block(dst_slice_offset_page_aligned, + sparse_page_size, &memory_region_start_offset); anvil_assert(mem_block_ptr != nullptr); @@ -2047,6 +2130,7 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p { VkDeviceSize dummy; auto mem_block2_ptr = m_page_tracker_ptr->get_memory_block(dst_slice_offset_page_aligned + sparse_page_size, + sparse_page_size, &dummy); // todo: the slice spans across >1 memory blocks. need more than just one write op to handle this case correctly. @@ -2069,7 +2153,7 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p } } - *out_new_image_layout_ptr = VK_IMAGE_LAYOUT_PREINITIALIZED; + *out_new_image_layout_ptr = in_current_image_layout; } else { @@ -2143,7 +2227,8 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p VK_SHARING_MODE_EXCLUSIVE, VK_BUFFER_USAGE_TRANSFER_SRC_BIT, 0, /* in_memory_features */ - merged_mip_storage.get() ); + merged_mip_storage.get(), + Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() )); merged_mip_storage.reset(); diff --git a/src/wrappers/image_view.cpp b/src/wrappers/image_view.cpp index 8e87c9e3..5ee04271 100644 --- a/src/wrappers/image_view.cpp +++ b/src/wrappers/image_view.cpp @@ -37,10 +37,14 @@ std::shared_ptr Anvil::ImageView::create_1D(std::weak_ptr new_image_view_ptr (new ImageView(in_device_ptr, - in_image_ptr) ); + in_image_ptr, + mt_safe) ); const VkComponentSwizzle swizzle_rgba[] = { in_swizzle_red, @@ -77,10 +81,15 @@ std::shared_ptr Anvil::ImageView::create_1D_array(std::weak_pt VkComponentSwizzle in_swizzle_red, VkComponentSwizzle in_swizzle_green, VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha) + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety) + { + const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); std::shared_ptr new_image_view_ptr(new ImageView(in_device_ptr, - in_image_ptr) ); + in_image_ptr, + mt_safe) ); const VkComponentSwizzle swizzle_rgba[] = { in_swizzle_red, @@ -116,10 +125,14 @@ std::shared_ptr Anvil::ImageView::create_2D(std::weak_ptr new_image_view_ptr(new ImageView(in_device_ptr, - in_image_ptr) ); + in_image_ptr, + mt_safe) ); const VkComponentSwizzle swizzle_rgba[] = { in_swizzle_red, @@ -156,10 +169,14 @@ std::shared_ptr Anvil::ImageView::create_2D_array(std::weak_pt VkComponentSwizzle in_swizzle_red, VkComponentSwizzle in_swizzle_green, VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha) + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety) { + const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); std::shared_ptr new_image_view_ptr(new ImageView(in_device_ptr, - in_image_ptr) ); + in_image_ptr, + mt_safe) ); const VkComponentSwizzle swizzle_rgba[] = { in_swizzle_red, @@ -196,10 +213,14 @@ std::shared_ptr Anvil::ImageView::create_3D(std::weak_ptr new_image_view_ptr(new ImageView(in_device_ptr, - in_image_ptr) ); + in_image_ptr, + mt_safe) ); const VkComponentSwizzle swizzle_rgba[] = { in_swizzle_red, @@ -235,10 +256,14 @@ std::shared_ptr Anvil::ImageView::create_cube_map(std::weak_pt VkComponentSwizzle in_swizzle_red, VkComponentSwizzle in_swizzle_green, VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha) + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety) { + const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); std::shared_ptr new_image_view_ptr(new ImageView(in_device_ptr, - in_image_ptr) ); + in_image_ptr, + mt_safe) ); const VkComponentSwizzle swizzle_rgba[] = { in_swizzle_red, @@ -275,10 +300,14 @@ std::shared_ptr Anvil::ImageView::create_cube_map_array(std::w VkComponentSwizzle in_swizzle_red, VkComponentSwizzle in_swizzle_green, VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha) + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety) { + const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); std::shared_ptr new_image_view_ptr(new ImageView(in_device_ptr, - in_image_ptr) ); + in_image_ptr, + mt_safe) ); const VkComponentSwizzle swizzle_rgba[] = { in_swizzle_red, @@ -310,9 +339,11 @@ std::shared_ptr Anvil::ImageView::create_cube_map_array(std::w * @param in_parent_image_ptr Image to create the view for. Must not be nullptr. **/ Anvil::ImageView::ImageView(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_image_ptr) + std::shared_ptr in_parent_image_ptr, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT) + VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT), + MTSafetySupportProvider (in_mt_safe) { anvil_assert(in_parent_image_ptr != nullptr); @@ -340,9 +371,13 @@ Anvil::ImageView::~ImageView() { std::shared_ptr device_locked_ptr(m_device_ptr); - vkDestroyImageView(device_locked_ptr->get_device_vk(), - m_image_view, - nullptr /* pAllocator */); + lock(); + { + vkDestroyImageView(device_locked_ptr->get_device_vk(), + m_image_view, + nullptr /* pAllocator */); + } + unlock(); m_image_view = VK_NULL_HANDLE; } @@ -421,9 +456,10 @@ bool Anvil::ImageView::init(VkImageViewType in_image_view_type, goto end; } - if (!m_parent_image_ptr->is_swapchain_image() && - !m_parent_image_ptr->is_sparse () && - m_parent_image_ptr->get_memory_block () == nullptr) + if (!m_parent_image_ptr->is_swapchain_image () && + !m_parent_image_ptr->is_sparse () && + m_parent_image_ptr->get_memory_block () == nullptr && + m_parent_image_ptr->get_parent_swapchain() == nullptr) { anvil_assert(!(m_parent_image_ptr->get_memory_block() == nullptr)); diff --git a/src/wrappers/instance.cpp b/src/wrappers/instance.cpp index 5fa9178c..f60d934b 100644 --- a/src/wrappers/instance.cpp +++ b/src/wrappers/instance.cpp @@ -29,8 +29,10 @@ /** Please see header for specification */ Anvil::Instance::Instance(const std::string& in_app_name, const std::string& in_engine_name, - DebugCallbackFunction in_opt_validation_callback_function) - :m_app_name (in_app_name), + DebugCallbackFunction in_opt_validation_callback_function, + bool in_mt_safe) + :MTSafetySupportProvider (in_mt_safe), + m_app_name (in_app_name), m_debug_callback_data (0), m_engine_name (in_engine_name), m_global_layer (""), @@ -50,17 +52,24 @@ Anvil::Instance::~Instance() if (m_instance != VK_NULL_HANDLE) { - vkDestroyInstance(m_instance, - nullptr /* pAllocator */); + lock(); + { + vkDestroyInstance(m_instance, + nullptr /* pAllocator */); + } + unlock(); m_instance = VK_NULL_HANDLE; } } /** Please see header for specification */ -std::shared_ptr Anvil::Instance::create(const std::string& in_app_name, - const std::string& in_engine_name, - DebugCallbackFunction in_opt_validation_callback_proc) +std::shared_ptr Anvil::Instance::create(const std::string& in_app_name, + const std::string& in_engine_name, + DebugCallbackFunction in_opt_validation_callback_proc, + bool in_mt_safe, + const std::vector& in_opt_disallowed_instance_level_extensions, + bool in_opt_enable_shader_module_cache) { std::shared_ptr new_instance_ptr; @@ -68,10 +77,12 @@ std::shared_ptr Anvil::Instance::create(const std::string& i new Instance( in_app_name, in_engine_name, - in_opt_validation_callback_proc) + in_opt_validation_callback_proc, + in_mt_safe) ); - new_instance_ptr->init(); + new_instance_ptr->init(in_opt_disallowed_instance_level_extensions, + in_opt_enable_shader_module_cache); return new_instance_ptr; } @@ -107,9 +118,13 @@ void Anvil::Instance::destroy() { if (m_debug_callback_data != VK_NULL_HANDLE) { - m_ext_debug_report_entrypoints.vkDestroyDebugReportCallbackEXT(m_instance, - m_debug_callback_data, - nullptr /* pAllocator */); + lock(); + { + m_ext_debug_report_entrypoints.vkDestroyDebugReportCallbackEXT(m_instance, + m_debug_callback_data, + nullptr /* pAllocator */); + } + unlock(); m_debug_callback_data = VK_NULL_HANDLE; } @@ -301,7 +316,8 @@ const Anvil::ExtensionKHRSurfaceEntrypoints& Anvil::Instance::get_extension_khr_ #endif /** Initializes the wrapper. */ -void Anvil::Instance::init() +void Anvil::Instance::init(const std::vector& in_disallowed_instance_level_extensions, + bool in_enable_shader_module_cache) { VkApplicationInfo app_info; VkInstanceCreateInfo create_info; @@ -411,6 +427,24 @@ void Anvil::Instance::init() m_enabled_extensions.push_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); } + if (is_instance_extension_supported(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME) ) + { + m_enabled_extensions.push_back(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME); + } + + /* Filter out undesired extensions */ + for (const auto& current_extension_name : in_disallowed_instance_level_extensions) + { + auto iterator = std::find(m_enabled_extensions.begin(), + m_enabled_extensions.end (), + current_extension_name); + + if (iterator != m_enabled_extensions.end() ) + { + m_enabled_extensions.erase(iterator); + } + } + /* We're ready to create a new Vulkan instance */ std::vector enabled_extensions_raw; @@ -444,7 +478,10 @@ void Anvil::Instance::init() enumerate_physical_devices(); - m_shader_module_cache_ptr = Anvil::ShaderModuleCache::create(); + if (in_enable_shader_module_cache) + { + m_shader_module_cache_ptr = Anvil::ShaderModuleCache::create(); + } } /** Initializes debug callback support. */ @@ -551,6 +588,14 @@ void Anvil::Instance::init_func_pointers() } } +/** Please see header for specification */ +bool Anvil::Instance::is_instance_extension_enabled(const char* in_extension_name) const +{ + return std::find(m_enabled_extensions.begin(), + m_enabled_extensions.end(), + in_extension_name) != m_enabled_extensions.end(); +} + /** Please see header for specification */ bool Anvil::Instance::is_instance_extension_supported(const char* in_extension_name) const { diff --git a/src/wrappers/memory_block.cpp b/src/wrappers/memory_block.cpp index 0c7260ee..26256143 100644 --- a/src/wrappers/memory_block.cpp +++ b/src/wrappers/memory_block.cpp @@ -32,8 +32,10 @@ Anvil::MemoryBlock::MemoryBlock(std::weak_ptr in_device_ptr, uint32_t in_allowed_memory_bits, VkDeviceSize in_size, - Anvil::MemoryFeatureFlags in_memory_features) - :m_allowed_memory_bits (in_allowed_memory_bits), + Anvil::MemoryFeatureFlags in_memory_features, + bool in_mt_safe) + :MTSafetySupportProvider (in_mt_safe), + m_allowed_memory_bits (in_allowed_memory_bits), m_device_ptr (in_device_ptr), m_gpu_data_map_count (0), m_gpu_data_ptr (nullptr), @@ -52,6 +54,7 @@ Anvil::MemoryBlock::MemoryBlock(std::weak_ptr in_device_ptr, Anvil::MemoryBlock::MemoryBlock(std::shared_ptr in_parent_memory_block_ptr, VkDeviceSize in_start_offset, VkDeviceSize in_size) + :MTSafetySupportProvider(false) { anvil_assert(in_parent_memory_block_ptr != nullptr); anvil_assert(in_parent_memory_block_ptr->m_gpu_data_ptr == nullptr); @@ -85,6 +88,7 @@ Anvil::MemoryBlock::MemoryBlock(std::weak_ptr in_device_p VkDeviceSize in_size, VkDeviceSize in_start_offset, OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function) + :MTSafetySupportProvider(false) { anvil_assert(in_on_release_callback_function != nullptr); @@ -128,9 +132,13 @@ Anvil::MemoryBlock::~MemoryBlock() { std::shared_ptr device_locked_ptr(m_device_ptr); - vkFreeMemory(device_locked_ptr->get_device_vk(), - m_memory, - nullptr /* pAllocator */); + lock(); + { + vkFreeMemory(device_locked_ptr->get_device_vk(), + m_memory, + nullptr /* pAllocator */); + } + unlock(); } m_memory = VK_NULL_HANDLE; @@ -152,8 +160,12 @@ void Anvil::MemoryBlock::close_gpu_memory_access() if (m_gpu_data_map_count.fetch_sub(1) == 1) { - vkUnmapMemory(device_locked_ptr->get_device_vk(), - m_memory); + lock(); + { + vkUnmapMemory(device_locked_ptr->get_device_vk(), + m_memory); + } + unlock(); m_gpu_data_ptr = nullptr; } @@ -164,15 +176,19 @@ void Anvil::MemoryBlock::close_gpu_memory_access() std::shared_ptr Anvil::MemoryBlock::create(std::weak_ptr in_device_ptr, uint32_t in_allowed_memory_bits, VkDeviceSize in_size, - Anvil::MemoryFeatureFlags in_memory_features) + Anvil::MemoryFeatureFlags in_memory_features, + MTSafety in_mt_safety) { + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); std::shared_ptr result_ptr; result_ptr.reset( new Anvil::MemoryBlock(in_device_ptr, in_allowed_memory_bits, in_size, - in_memory_features) + in_memory_features, + mt_safe) ); if (!result_ptr->init() ) @@ -299,7 +315,7 @@ uint32_t Anvil::MemoryBlock::get_device_memory_type_index(uint32_t bool Anvil::MemoryBlock::init() { VkMemoryAllocateInfo buffer_data_alloc_info; - std::shared_ptr device_locked_ptr (m_device_ptr); + std::shared_ptr device_locked_ptr (m_device_ptr); VkResult result; bool result_bool = false; @@ -433,12 +449,16 @@ bool Anvil::MemoryBlock::open_gpu_memory_access() if (m_gpu_data_map_count.fetch_add(1) == 0) { /* Map the memory region into process space */ - result_vk = vkMapMemory(device_locked_ptr->get_device_vk(), - m_memory, - 0, /* offset */ - m_size, - 0, /* flags */ - (void**) &m_gpu_data_ptr); + lock(); + { + result_vk = vkMapMemory(device_locked_ptr->get_device_vk(), + m_memory, + 0, /* offset */ + m_size, + 0, /* flags */ + (void**) &m_gpu_data_ptr); + } + unlock(); anvil_assert_vk_call_succeeded(result_vk); result = is_vk_call_successful(result_vk); diff --git a/src/wrappers/physical_device.cpp b/src/wrappers/physical_device.cpp index cd810bb9..2bffa314 100644 --- a/src/wrappers/physical_device.cpp +++ b/src/wrappers/physical_device.cpp @@ -179,11 +179,54 @@ void Anvil::PhysicalDevice::init() } } - if (is_device_extension_supported ("VK_KHR_16bit_storage") && - m_instance_ptr->is_instance_extension_supported("VK_KHR_get_physical_device_properties2") ) + /* Retrieve additional device info */ + if (m_instance_ptr->is_instance_extension_supported(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME) ) { const auto& gpdp2_entrypoints = m_instance_ptr->get_extension_khr_get_physical_device_properties2_entrypoints(); + if (m_instance_ptr->is_instance_extension_supported(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME) ) + { + VkPhysicalDeviceIDPropertiesKHR device_id_props; + VkPhysicalDeviceProperties2KHR general_props; + + device_id_props.pNext = nullptr; + device_id_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR; + + general_props.pNext = &device_id_props; + general_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; + + gpdp2_entrypoints.vkGetPhysicalDeviceProperties2KHR(m_physical_device, + &general_props); + + if (device_id_props.deviceLUIDValid) + { + static_assert(sizeof(m_device_LUID) == sizeof(device_id_props.deviceLUID), "Anvil asserts a LUID size different than the Vulkan header"); + + memcpy(m_device_LUID, + &device_id_props.deviceLUID, + sizeof(m_device_LUID) ); + + m_device_LUID_available = true; + } + else + { + m_device_LUID_available = false; + } + + static_assert(sizeof(m_device_UUID) == sizeof(device_id_props.deviceUUID), "Anvil asserts a UUID size different than the Vulkan header"); + static_assert(sizeof(m_driver_UUID) == sizeof(device_id_props.driverUUID), "Anvil asserts a UUID size different than the Vulkan header"); + + memcpy(m_device_UUID, + device_id_props.deviceUUID, + sizeof(m_device_UUID) ); + memcpy(m_driver_UUID, + device_id_props.driverUUID, + sizeof(m_driver_UUID) ); + + m_device_UUID_available = true; + m_driver_UUID_available = true; + } + if (is_device_extension_supported(VK_KHR_16BIT_STORAGE_EXTENSION_NAME) ) { VkPhysicalDeviceFeatures2KHR features; diff --git a/src/wrappers/pipeline_cache.cpp b/src/wrappers/pipeline_cache.cpp index dd541f63..dba8b900 100644 --- a/src/wrappers/pipeline_cache.cpp +++ b/src/wrappers/pipeline_cache.cpp @@ -28,10 +28,12 @@ /** Please see header for specification */ Anvil::PipelineCache::PipelineCache(std::weak_ptr in_device_ptr, + bool in_mt_safe, size_t in_initial_data_size, const void* in_initial_data) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT), + MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), m_pipeline_cache (VK_NULL_HANDLE) { @@ -76,9 +78,13 @@ Anvil::PipelineCache::~PipelineCache() { std::shared_ptr device_locked_ptr(m_device_ptr); - vkDestroyPipelineCache(device_locked_ptr->get_device_vk(), - m_pipeline_cache, - nullptr /* pAllocator */); + lock(); + { + vkDestroyPipelineCache(device_locked_ptr->get_device_vk(), + m_pipeline_cache, + nullptr /* pAllocator */); + } + unlock(); m_pipeline_cache = VK_NULL_HANDLE; } @@ -86,6 +92,7 @@ Anvil::PipelineCache::~PipelineCache() /** Please see header for specification */ std::shared_ptr Anvil::PipelineCache::create(std::weak_ptr in_device_ptr, + bool in_mt_safe, size_t in_initial_data_size, const void* in_initial_data) { @@ -93,6 +100,7 @@ std::shared_ptr Anvil::PipelineCache::create(std::weak_ptr result_ptr.reset( new Anvil::PipelineCache(in_device_ptr, + in_mt_safe, in_initial_data_size, in_initial_data) ); @@ -127,6 +135,7 @@ bool Anvil::PipelineCache::merge(uint32_t anvil_assert(in_n_pipeline_caches < sizeof(src_pipeline_caches) / sizeof(src_pipeline_caches[0]) ); + for (uint32_t n_pipeline_cache = 0; n_pipeline_cache < in_n_pipeline_caches; ++n_pipeline_cache) @@ -134,10 +143,14 @@ bool Anvil::PipelineCache::merge(uint32_t src_pipeline_caches[n_pipeline_cache] = in_src_cache_ptrs[n_pipeline_cache]->get_pipeline_cache(); } - result_vk = vkMergePipelineCaches(device_locked_ptr->get_device_vk(), - m_pipeline_cache, - in_n_pipeline_caches, - src_pipeline_caches); + lock(); + { + result_vk = vkMergePipelineCaches(device_locked_ptr->get_device_vk(), + m_pipeline_cache, + in_n_pipeline_caches, + src_pipeline_caches); + } + unlock(); anvil_assert(result_vk); diff --git a/src/wrappers/pipeline_layout.cpp b/src/wrappers/pipeline_layout.cpp index 12673304..17b666cd 100644 --- a/src/wrappers/pipeline_layout.cpp +++ b/src/wrappers/pipeline_layout.cpp @@ -29,42 +29,19 @@ #include "wrappers/pipeline_layout_manager.h" /** Please see header for specification */ -Anvil::PipelineLayout::PipelineLayout(std::weak_ptr in_device_ptr) +Anvil::PipelineLayout::PipelineLayout(std::weak_ptr in_device_ptr, + std::shared_ptr in_dsg_ptr, + const Anvil::PushConstantRanges& in_push_constant_ranges, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT) + VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT), + MTSafetySupportProvider (in_mt_safe) { - - m_device_ptr = in_device_ptr; - m_dirty = true; - m_is_immutable = false; - m_layout_vk = VK_NULL_HANDLE; - - m_id = in_device_ptr.lock()->get_pipeline_layout_manager()->reserve_pipeline_layout_id(); - - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_PIPELINE_LAYOUT, - this); -} - -/** Please see header for specification */ -Anvil::PipelineLayout::PipelineLayout(std::weak_ptr in_device_ptr, - std::shared_ptr in_dsg_ptr, - const Anvil::PushConstantRanges& in_push_constant_ranges, - bool in_is_immutable) - :DebugMarkerSupportProvider(in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT) -{ - m_device_ptr = in_device_ptr; - m_dirty = true; - m_is_immutable = in_is_immutable; - m_layout_vk = VK_NULL_HANDLE; - - m_id = in_device_ptr.lock()->get_pipeline_layout_manager()->reserve_pipeline_layout_id(); - + m_device_ptr = in_device_ptr; + m_dirty = true; m_dsg_ptr = in_dsg_ptr; + m_layout_vk = VK_NULL_HANDLE; m_push_constant_ranges = in_push_constant_ranges; - - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_PIPELINE_LAYOUT, - this); } /** Please see header for specification */ @@ -79,39 +56,18 @@ Anvil::PipelineLayout::~PipelineLayout() { std::shared_ptr device_locked_ptr(m_device_ptr); - vkDestroyPipelineLayout(device_locked_ptr->get_device_vk(), - m_layout_vk, - nullptr /* pAllocator */); + lock(); + { + vkDestroyPipelineLayout(device_locked_ptr->get_device_vk(), + m_layout_vk, + nullptr /* pAllocator */); + } + unlock(); m_layout_vk = VK_NULL_HANDLE; } } -/** Please see header for specification */ -bool Anvil::PipelineLayout::attach_push_constant_range(uint32_t in_offset, - uint32_t in_size, - VkShaderStageFlags in_stages) -{ - bool result = false; - - if (m_is_immutable) - { - anvil_assert(!m_is_immutable); - - goto end; - } - - /* Attach the specified push constant range */ - m_dirty = true; - m_push_constant_ranges.push_back(PushConstantRange(in_offset, - in_size, - in_stages) ); - - result = true; -end: - return result; -} - /** Please see header for specification */ bool Anvil::PipelineLayout::bake() { @@ -134,9 +90,13 @@ bool Anvil::PipelineLayout::bake() if (m_layout_vk != VK_NULL_HANDLE) { - vkDestroyPipelineLayout(device_locked_ptr->get_device_vk(), - m_layout_vk, - nullptr /* pAllocator */); + lock(); + { + vkDestroyPipelineLayout(device_locked_ptr->get_device_vk(), + m_layout_vk, + nullptr /* pAllocator */); + } + unlock(); m_layout_vk = VK_NULL_HANDLE; set_vk_handle(VK_NULL_HANDLE); @@ -144,18 +104,20 @@ bool Anvil::PipelineLayout::bake() if (m_dsg_ptr != nullptr) { - const uint32_t n_dses = m_dsg_ptr->get_n_of_descriptor_sets(); + const uint32_t n_dses = m_dsg_ptr->get_n_descriptor_sets(); for (uint32_t n_ds = 0; n_ds < n_dses; ++n_ds) { - const uint32_t current_binding_index = m_dsg_ptr->get_descriptor_set_binding_index(n_ds); + auto ds_layout_ptr = m_dsg_ptr->get_descriptor_set_layout(n_ds); - if (current_binding_index > max_ds_binding_index) + if (ds_layout_ptr == nullptr) { - max_ds_binding_index = current_binding_index; + continue; } + + max_ds_binding_index = n_ds; } } @@ -164,15 +126,20 @@ bool Anvil::PipelineLayout::bake() if (m_dsg_ptr != nullptr) { - const uint32_t n_current_dsg_sets = m_dsg_ptr->get_n_of_descriptor_sets(); + const uint32_t n_current_descriptor_sets = m_dsg_ptr->get_n_descriptor_sets(); - for (uint32_t n_current_dsg_set = 0; - n_current_dsg_set < n_current_dsg_sets; - ++n_current_dsg_set) + for (uint32_t n_current_descriptor_set = 0; + n_current_descriptor_set < n_current_descriptor_sets; + ++n_current_descriptor_set) { - uint32_t ds_binding_index = m_dsg_ptr->get_descriptor_set_binding_index(n_current_dsg_set); + auto ds_layout_ptr = m_dsg_ptr->get_descriptor_set_layout(n_current_descriptor_set); - ds_layouts_vk[ds_binding_index] = m_dsg_ptr->get_descriptor_set_layout(ds_binding_index)->get_layout(); + if (ds_layout_ptr == nullptr) + { + continue; + } + + ds_layouts_vk[n_current_descriptor_set] = ds_layout_ptr->get_layout(); } } @@ -196,11 +163,11 @@ bool Anvil::PipelineLayout::bake() pipeline_layout_create_info.flags = 0; pipeline_layout_create_info.setLayoutCount = static_cast(ds_layouts_vk.size() ); pipeline_layout_create_info.pNext = nullptr; - pipeline_layout_create_info.pPushConstantRanges = (push_constant_ranges_vk.size() > 0) ? &push_constant_ranges_vk[0] + pipeline_layout_create_info.pPushConstantRanges = (push_constant_ranges_vk.size() > 0) ? &push_constant_ranges_vk.at(0) : nullptr; - pipeline_layout_create_info.pSetLayouts = (ds_layouts_vk.size() > 0) ? &ds_layouts_vk[0] + pipeline_layout_create_info.pSetLayouts = (ds_layouts_vk.size() > 0) ? &ds_layouts_vk.at(0) : nullptr; - pipeline_layout_create_info.pushConstantRangeCount = (uint32_t) m_push_constant_ranges.size(); + pipeline_layout_create_info.pushConstantRangeCount = static_cast(m_push_constant_ranges.size() ); pipeline_layout_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO; result_vk = vkCreatePipelineLayout(device_locked_ptr->get_device_vk(), @@ -221,22 +188,10 @@ bool Anvil::PipelineLayout::bake() } /* Please see header for specification */ -std::shared_ptr Anvil::PipelineLayout::create(std::weak_ptr in_device_ptr) -{ - std::shared_ptr result_ptr; - - result_ptr.reset( - new Anvil::PipelineLayout(in_device_ptr) - ); - - return result_ptr; -} - -/* Please see header for specification */ -std::shared_ptr Anvil::PipelineLayout::create(std::weak_ptr in_device_ptr, - std::shared_ptr in_dsg_ptr, - const PushConstantRanges& in_push_constant_ranges, - bool in_is_immutable) +std::shared_ptr Anvil::PipelineLayout::create(std::weak_ptr in_device_ptr, + std::shared_ptr in_dsg_ptr, + const PushConstantRanges& in_push_constant_ranges, + bool in_mt_safe) { std::shared_ptr result_ptr; @@ -244,29 +199,22 @@ std::shared_ptr Anvil::PipelineLayout::create(std::weak_p new Anvil::PipelineLayout(in_device_ptr, in_dsg_ptr, in_push_constant_ranges, - in_is_immutable) + in_mt_safe) ); - return result_ptr; -} - -/** Please see header for specification */ -bool Anvil::PipelineLayout::set_dsg(std::shared_ptr in_dsg_ptr) -{ - bool result = false; - - if (m_is_immutable) + if (result_ptr != nullptr) { - anvil_assert(!m_is_immutable); - - goto end; + if (!result_ptr->bake() ) + { + result_ptr.reset(); + } + else + { + Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_PIPELINE_LAYOUT, + result_ptr.get() ); + } } - /* Attach the specified DSG */ - m_dirty = true; - m_dsg_ptr = in_dsg_ptr; - - result = true; -end: - return result; + return result_ptr; } + diff --git a/src/wrappers/pipeline_layout_manager.cpp b/src/wrappers/pipeline_layout_manager.cpp index 2c7d2359..e524f2c9 100644 --- a/src/wrappers/pipeline_layout_manager.cpp +++ b/src/wrappers/pipeline_layout_manager.cpp @@ -29,9 +29,10 @@ /** Constructor. */ -Anvil::PipelineLayoutManager::PipelineLayoutManager(std::weak_ptr in_device_ptr) - :m_device_ptr (in_device_ptr), - m_pipeline_layouts_created(0) +Anvil::PipelineLayoutManager::PipelineLayoutManager(std::weak_ptr in_device_ptr, + bool in_mt_safe) + :MTSafetySupportProvider(in_mt_safe), + m_device_ptr (in_device_ptr) { update_subscriptions(true); @@ -43,6 +44,8 @@ Anvil::PipelineLayoutManager::PipelineLayoutManager(std::weak_ptr Anvil::PipelineLayoutManager::create(std::weak_ptr in_device_ptr) +std::shared_ptr Anvil::PipelineLayoutManager::create(std::weak_ptr in_device_ptr, + bool in_mt_safe) { std::shared_ptr device_locked_ptr(in_device_ptr); std::shared_ptr result_ptr; - result_ptr.reset(new Anvil::PipelineLayoutManager(in_device_ptr) ); + result_ptr.reset( + new Anvil::PipelineLayoutManager(in_device_ptr, + in_mt_safe) + ); + anvil_assert(result_ptr != nullptr); return result_ptr; } /* Please see header for specification */ -bool Anvil::PipelineLayoutManager::get_layout(std::shared_ptr in_dsg_ptr, - const PushConstantRanges& in_push_constant_ranges, - std::shared_ptr* out_pipeline_layout_ptr_ptr) +bool Anvil::PipelineLayoutManager::get_layout(std::shared_ptr in_dsg_ptr, + const PushConstantRanges& in_push_constant_ranges, + std::shared_ptr* out_pipeline_layout_ptr_ptr) { - bool result = false; + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + bool result = false; + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } for (auto layout_iterator = m_pipeline_layouts.begin(); layout_iterator != m_pipeline_layouts.end(); ++layout_iterator) { - if (layout_iterator->second.expired() ) - { - continue; - } - - std::shared_ptr current_pipeline_layout_ptr = layout_iterator->second.lock(); + auto current_pipeline_layout_ptr = *layout_iterator; if (current_pipeline_layout_ptr->get_attached_dsg() == in_dsg_ptr && current_pipeline_layout_ptr->get_attached_push_constant_ranges() == in_push_constant_ranges) { - *out_pipeline_layout_ptr_ptr = current_pipeline_layout_ptr; + *out_pipeline_layout_ptr_ptr = current_pipeline_layout_ptr->shared_from_this(); result = true; break; @@ -94,93 +106,50 @@ bool Anvil::PipelineLayoutManager::get_layout(std::shared_ptr new_layout_ptr = Anvil::PipelineLayout::create(m_device_ptr); + std::shared_ptr new_layout_ptr = Anvil::PipelineLayout::create(m_device_ptr, + in_dsg_ptr, + in_push_constant_ranges, + is_mt_safe() ); - result = new_layout_ptr->set_dsg(in_dsg_ptr); + m_pipeline_layouts.push_back(new_layout_ptr.get() ); - if (!result) - { - goto end; - } - - for (auto push_constant_range_iterator = in_push_constant_ranges.begin(); - push_constant_range_iterator != in_push_constant_ranges.end(); - ++push_constant_range_iterator) - { - result = new_layout_ptr->attach_push_constant_range((*push_constant_range_iterator).offset, - (*push_constant_range_iterator).size, - (*push_constant_range_iterator).stages); - - if (!result) - { - goto end; - } - } - - if (result) - { - const PipelineLayoutID pipeline_layout_id = new_layout_ptr->get_id(); - - anvil_assert(m_pipeline_layouts.find(pipeline_layout_id) == m_pipeline_layouts.end() ); - - new_layout_ptr->bake(); - - m_pipeline_layouts[pipeline_layout_id] = new_layout_ptr; - *out_pipeline_layout_ptr_ptr = new_layout_ptr; - } + *out_pipeline_layout_ptr_ptr = new_layout_ptr; } -end: + return result; } -/* Please see header for specification */ -std::shared_ptr Anvil::PipelineLayoutManager::get_layout_by_id(Anvil::PipelineLayoutID in_id) const +/** Called back whenever a pipeline layout is released **/ +void Anvil::PipelineLayoutManager::on_pipeline_layout_dropped(CallbackArgument* in_callback_arg_raw_ptr) { - if (m_pipeline_layouts.find(in_id) == m_pipeline_layouts.end() || - m_pipeline_layouts.at (in_id).expired() ) - { - return std::shared_ptr(); - } - else + auto callback_arg_ptr = dynamic_cast(in_callback_arg_raw_ptr); + PipelineLayouts::iterator layout_iterator; + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + + if (mutex_ptr != nullptr) { - return m_pipeline_layouts.at(in_id).lock(); + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); } -} -/** Called back whenever a pipeline layout is released **/ -void Anvil::PipelineLayoutManager::on_pipeline_layout_dropped() -{ - PipelineLayouts::iterator layout_iterator; + layout_iterator = std::find(m_pipeline_layouts.begin(), + m_pipeline_layouts.end (), + callback_arg_ptr->object_raw_ptr); - /* Are we the last standing layout user? */ - for (layout_iterator = m_pipeline_layouts.begin(); - layout_iterator != m_pipeline_layouts.end(); - ) + anvil_assert(layout_iterator != m_pipeline_layouts.end() ); + if (layout_iterator != m_pipeline_layouts.end() ) { - if (layout_iterator->second.expired() ) - { - m_pipeline_layouts.erase(layout_iterator); - - layout_iterator = m_pipeline_layouts.begin(); - } - else - { - ++layout_iterator; - } + m_pipeline_layouts.erase(layout_iterator); } } -/* Please see header for specification */ -Anvil::PipelineLayoutID Anvil::PipelineLayoutManager::reserve_pipeline_layout_id() -{ - return m_pipeline_layouts_created++; -} - void Anvil::PipelineLayoutManager::update_subscriptions(bool in_should_init) { const auto callback_func = std::bind(&PipelineLayoutManager::on_pipeline_layout_dropped, - this); + this, + std::placeholders::_1); void* callback_owner = this; auto object_tracker_ptr = Anvil::ObjectTracker::get(); diff --git a/src/wrappers/query_pool.cpp b/src/wrappers/query_pool.cpp index c533da08..1fc76776 100644 --- a/src/wrappers/query_pool.cpp +++ b/src/wrappers/query_pool.cpp @@ -30,9 +30,11 @@ /* Please see header for specification */ Anvil::QueryPool::QueryPool(std::weak_ptr in_device_ptr, VkQueryType in_query_type, - uint32_t in_n_max_concurrent_queries) + uint32_t in_n_max_concurrent_queries, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT), + MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), m_n_max_indices (in_n_max_concurrent_queries) { @@ -53,11 +55,13 @@ Anvil::QueryPool::QueryPool(std::weak_ptr in_device_ptr, Anvil::QueryPool::QueryPool(std::weak_ptr in_device_ptr, VkQueryType in_query_type, VkFlags in_query_flags, - uint32_t in_n_max_concurrent_queries) + uint32_t in_n_max_concurrent_queries, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT), - m_device_ptr (in_device_ptr), - m_n_max_indices(in_n_max_concurrent_queries) + MTSafetySupportProvider (in_mt_safe), + m_device_ptr (in_device_ptr), + m_n_max_indices (in_n_max_concurrent_queries) { init(in_device_ptr, in_query_type, @@ -81,9 +85,13 @@ Anvil::QueryPool::~QueryPool() { std::shared_ptr device_locked_ptr(m_device_ptr); - vkDestroyQueryPool(device_locked_ptr->get_device_vk(), - m_query_pool_vk, - nullptr /* pAllocator */); + lock(); + { + vkDestroyQueryPool(device_locked_ptr->get_device_vk(), + m_query_pool_vk, + nullptr /* pAllocator */); + } + unlock(); m_query_pool_vk = VK_NULL_HANDLE; } @@ -92,14 +100,18 @@ Anvil::QueryPool::~QueryPool() /* Please see header for specification */ std::shared_ptr Anvil::QueryPool::create_non_ps_query_pool(std::weak_ptr in_device_ptr, VkQueryType in_query_type, - uint32_t in_n_max_concurrent_queries) + uint32_t in_n_max_concurrent_queries, + MTSafety in_mt_safety) { + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); std::shared_ptr result_ptr; result_ptr.reset( new Anvil::QueryPool(in_device_ptr, in_query_type, - in_n_max_concurrent_queries) + in_n_max_concurrent_queries, + mt_safe) ); return result_ptr; @@ -108,15 +120,19 @@ std::shared_ptr Anvil::QueryPool::create_non_ps_query_pool(std /* Please see header for specification */ std::shared_ptr Anvil::QueryPool::create_ps_query_pool(std::weak_ptr in_device_ptr, VkQueryPipelineStatisticFlags in_pipeline_statistics, - uint32_t in_n_max_concurrent_queries) + uint32_t in_n_max_concurrent_queries, + MTSafety in_mt_safety) { + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); std::shared_ptr result_ptr; result_ptr.reset( new Anvil::QueryPool(in_device_ptr, VK_QUERY_TYPE_PIPELINE_STATISTICS, in_pipeline_statistics, - in_n_max_concurrent_queries) + in_n_max_concurrent_queries, + mt_safe) ); return result_ptr; diff --git a/src/wrappers/queue.cpp b/src/wrappers/queue.cpp index c8a8688b..9664d2a8 100644 --- a/src/wrappers/queue.cpp +++ b/src/wrappers/queue.cpp @@ -39,11 +39,13 @@ /** Please see header for specification */ Anvil::Queue::Queue(std::weak_ptr in_device_ptr, uint32_t in_queue_family_index, - uint32_t in_queue_index) + uint32_t in_queue_index, + bool in_mt_safe) :CallbacksSupportProvider (QUEUE_CALLBACK_ID_COUNT), DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT), + MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), m_queue (VK_NULL_HANDLE), m_queue_family_index (in_queue_family_index), @@ -64,7 +66,8 @@ Anvil::Queue::Queue(std::weak_ptr in_device_ptr, /* Cache a fence that may be optionally used for submissions */ m_submit_fence_ptr = Anvil::Fence::create(m_device_ptr, - false /* create_signalled */); + false /* create_signalled */, + Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); /* OK, register the wrapper instance and leave */ Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_QUEUE, @@ -85,6 +88,7 @@ bool Anvil::Queue::bind_sparse_memory(Anvil::Utils::SparseMemoryBindingUpdateInf { const VkBindSparseInfo* bind_info_items = nullptr; std::shared_ptr fence_ptr; + const bool mt_safe = is_mt_safe(); uint32_t n_bind_info_items = 0; VkResult result = VK_ERROR_INITIALIZATION_FAILED; @@ -92,10 +96,23 @@ bool Anvil::Queue::bind_sparse_memory(Anvil::Utils::SparseMemoryBindingUpdateInf &bind_info_items, &fence_ptr); - result = vkQueueBindSparse(m_queue, - n_bind_info_items, - bind_info_items, - (fence_ptr != nullptr) ? fence_ptr->get_fence() : VK_NULL_HANDLE); + if (mt_safe) + { + bind_sparse_memory_lock_unlock(in_update, + true); /* in_should_lock */ + } + { + result = vkQueueBindSparse(m_queue, + n_bind_info_items, + bind_info_items, + (fence_ptr != nullptr) ? fence_ptr->get_fence() : VK_NULL_HANDLE); + } + if (mt_safe) + { + bind_sparse_memory_lock_unlock(in_update, + false); /* in_should_lock */ + } + anvil_assert(result == VK_SUCCESS); for (uint32_t n_bind_info = 0; @@ -199,17 +216,177 @@ bool Anvil::Queue::bind_sparse_memory(Anvil::Utils::SparseMemoryBindingUpdateInf return (result == VK_SUCCESS); } +void Anvil::Queue::bind_sparse_memory_lock_unlock(Anvil::Utils::SparseMemoryBindingUpdateInfo& in_update, + bool in_should_lock) +{ + const VkBindSparseInfo* bind_info_items = nullptr; + std::shared_ptr fence_ptr; + uint32_t n_bind_info_items = 0; + + in_update.get_bind_sparse_call_args(&n_bind_info_items, + &bind_info_items, + &fence_ptr); + + if (in_should_lock) + { + lock(); + } + else + { + unlock(); + } + + if (fence_ptr != nullptr) + { + if (in_should_lock) + { + fence_ptr->lock(); + } + else + { + fence_ptr->unlock(); + } + } + + for (uint32_t n_bind_info_item = 0; + n_bind_info_item < n_bind_info_items; + ++n_bind_info_item) + { + uint32_t n_buffer_memory_updates = 0; + uint32_t n_image_memory_updates = 0; + uint32_t n_image_opaque_memory_updates = 0; + uint32_t n_signal_sems = 0; + uint32_t n_wait_sems = 0; + const std::shared_ptr* signal_sem_ptrs = nullptr; + const std::shared_ptr* wait_sem_ptrs = nullptr; + + in_update.get_bind_info_properties(n_bind_info_item, + &n_buffer_memory_updates, + &n_image_memory_updates, + &n_image_opaque_memory_updates, + &n_signal_sems, + &signal_sem_ptrs, + &n_wait_sems, + &wait_sem_ptrs); + + for (uint32_t n_signal_sem = 0; + n_signal_sem < n_signal_sems; + ++n_signal_sem) + { + if (in_should_lock) + { + signal_sem_ptrs[n_signal_sem]->lock(); + } + else + { + signal_sem_ptrs[n_signal_sem]->unlock(); + } + } + + for (uint32_t n_wait_sem = 0; + n_wait_sem < n_wait_sems; + ++n_wait_sem) + { + if (in_should_lock) + { + wait_sem_ptrs[n_wait_sem]->lock(); + } + else + { + wait_sem_ptrs[n_wait_sem]->unlock(); + } + } + + for (uint32_t n_buffer_memory_update = 0; + n_buffer_memory_update < n_buffer_memory_updates; + ++n_buffer_memory_update) + { + std::shared_ptr buffer_ptr; + + in_update.get_buffer_memory_update_properties(n_bind_info_item, + n_buffer_memory_update, + &buffer_ptr, + nullptr, /* out_opt_buffer_memory_start_offset_ptr */ + nullptr, /* out_opt_memory_block_ptr */ + nullptr, /* out_opt_memory_block_start_offset_ptr */ + nullptr); /* out_opt_size_ptr */ + + if (in_should_lock) + { + buffer_ptr->lock(); + } + else + { + buffer_ptr->unlock(); + } + } + + for (uint32_t n_image_memory_update = 0; + n_image_memory_update < n_image_memory_updates; + ++n_image_memory_update) + { + std::shared_ptr image_ptr; + + in_update.get_image_memory_update_properties(n_bind_info_item, + n_image_memory_update, + &image_ptr, + nullptr, /* out_opt_subresource_ptr */ + nullptr, /* out_opt_offset_ptr */ + nullptr, /* out_opt_extent_ptr */ + nullptr, /* out_opt_flags_ptr */ + nullptr, /* out_opt_memory_block_ptr_ptr */ + nullptr); /* out_opt_memory_block_start_offset_ptr */ + + if (in_should_lock) + { + image_ptr->lock(); + } + else + { + image_ptr->unlock(); + } + } + + for (uint32_t n_opaque_image_memory_update = 0; + n_opaque_image_memory_update < n_image_opaque_memory_updates; + ++n_opaque_image_memory_update) + { + std::shared_ptr image_ptr; + + in_update.get_image_opaque_memory_update_properties(n_bind_info_item, + n_opaque_image_memory_update, + &image_ptr, + nullptr, /* out_opt_resource_offset_ptr */ + nullptr, /* out_opt_size_ptr */ + nullptr, /* out_opt_flags_ptr */ + nullptr, /* out_opt_memory_block_ptr_ptr */ + nullptr); /* out_opt_memory_block_start_offset_ptr */ + + if (in_should_lock) + { + image_ptr->lock(); + } + else + { + image_ptr->unlock(); + } + } + } +} + /** Please see header for specification */ std::shared_ptr Anvil::Queue::create(std::weak_ptr in_device_ptr, uint32_t in_queue_family_index, - uint32_t in_queue_index) + uint32_t in_queue_index, + bool in_mt_safe) { std::shared_ptr result_ptr; result_ptr.reset( new Anvil::Queue(in_device_ptr, in_queue_family_index, - in_queue_index) + in_queue_index, + in_mt_safe) ); return result_ptr; @@ -221,17 +398,16 @@ VkResult Anvil::Queue::present(std::shared_ptr in_swapchain_p uint32_t in_n_wait_semaphores, std::shared_ptr* in_wait_semaphore_ptrs) { - std::shared_ptr device_locked_ptr (m_device_ptr); - VkPresentInfoKHR image_presentation_info; - VkResult presentation_results [MAX_SWAPCHAINS]; - VkResult result; - const auto& swapchain_entrypoints (m_device_ptr.lock()->get_extension_khr_swapchain_entrypoints() ); - VkSwapchainKHR swapchains_vk [MAX_SWAPCHAINS]; - VkSemaphore wait_semaphores_vk [8]; + std::shared_ptr device_locked_ptr (m_device_ptr); + VkPresentInfoKHR image_presentation_info; + VkResult presentation_results [MAX_SWAPCHAINS]; + VkResult result; + const ExtensionKHRSwapchainEntrypoints* swapchain_entrypoints_ptr(nullptr); + VkSwapchainKHR swapchains_vk [MAX_SWAPCHAINS]; + VkSemaphore wait_semaphores_vk [8]; /* Sanity checks */ anvil_assert(in_n_wait_semaphores < sizeof(wait_semaphores_vk) / sizeof(wait_semaphores_vk[0]) ); - anvil_assert(in_swapchain_ptr != nullptr); /* If the application is only interested in off-screen rendering, do *not* post the present request, * since the fake swapchain image is not presentable. We still have to wait on the user-specified @@ -263,9 +439,6 @@ VkResult Anvil::Queue::present(std::shared_ptr in_swapchain_p &dst_stage_mask, true); /* should_block */ - for (uint32_t n_presentation = 0; - n_presentation < 1; - ++n_presentation) { OnPresentRequestIssuedCallbackArgument callback_argument(in_swapchain_ptr.get() ); @@ -279,7 +452,12 @@ VkResult Anvil::Queue::present(std::shared_ptr in_swapchain_p } } - swapchains_vk[0] = in_swapchain_ptr->get_swapchain_vk(); + /* Convert arrays of Anvil objects to raw Vulkan handle arrays */ + { + anvil_assert(in_swapchain_ptr != nullptr); + + swapchains_vk[0] = in_swapchain_ptr->get_swapchain_vk(); + } for (uint32_t n_wait_semaphore = 0; n_wait_semaphore < in_n_wait_semaphores; @@ -297,63 +475,82 @@ VkResult Anvil::Queue::present(std::shared_ptr in_swapchain_p image_presentation_info.swapchainCount = 1; image_presentation_info.waitSemaphoreCount = in_n_wait_semaphores; - result = swapchain_entrypoints.vkQueuePresentKHR(m_queue, - &image_presentation_info); + swapchain_entrypoints_ptr = &m_device_ptr.lock()->get_extension_khr_swapchain_entrypoints(); + + present_lock_unlock(1, + &in_swapchain_ptr, + in_n_wait_semaphores, + in_wait_semaphore_ptrs, + true); + { + result = swapchain_entrypoints_ptr->vkQueuePresentKHR(m_queue, + &image_presentation_info); + } + present_lock_unlock(1, + &in_swapchain_ptr, + in_n_wait_semaphores, + in_wait_semaphore_ptrs, + false); anvil_assert_vk_call_succeeded(result); if (is_vk_call_successful(result) ) { - anvil_assert(is_vk_call_successful(presentation_results[0])); - - /* Return the most important error code reported */ - if (result != VK_ERROR_DEVICE_LOST) + for (uint32_t n_presentation = 0; + n_presentation < 1; + ++n_presentation) { - switch (presentation_results[0]) + anvil_assert(is_vk_call_successful(presentation_results[n_presentation])); + + /* Return the most important error code reported */ + if (result != VK_ERROR_DEVICE_LOST) { - case VK_ERROR_DEVICE_LOST: + switch (presentation_results[n_presentation]) { - result = VK_ERROR_DEVICE_LOST; + case VK_ERROR_DEVICE_LOST: + { + result = VK_ERROR_DEVICE_LOST; - break; - } + break; + } - case VK_ERROR_SURFACE_LOST_KHR: - { - if (result != VK_ERROR_DEVICE_LOST) + case VK_ERROR_SURFACE_LOST_KHR: { - result = VK_ERROR_SURFACE_LOST_KHR; - } + if (result != VK_ERROR_DEVICE_LOST) + { + result = VK_ERROR_SURFACE_LOST_KHR; + } - break; - } + break; + } - case VK_ERROR_OUT_OF_DATE_KHR: - { - if (result != VK_ERROR_DEVICE_LOST && - result != VK_ERROR_SURFACE_LOST_KHR) + case VK_ERROR_OUT_OF_DATE_KHR: { - result = VK_ERROR_OUT_OF_DATE_KHR; - } + if (result != VK_ERROR_DEVICE_LOST && + result != VK_ERROR_SURFACE_LOST_KHR) + { + result = VK_ERROR_OUT_OF_DATE_KHR; + } - break; - } + break; + } - case VK_SUBOPTIMAL_KHR: - { - if (result != VK_ERROR_DEVICE_LOST && - result != VK_ERROR_SURFACE_LOST_KHR && - result != VK_ERROR_OUT_OF_DATE_KHR) + case VK_SUBOPTIMAL_KHR: { - result = VK_SUBOPTIMAL_KHR; + if (result != VK_ERROR_DEVICE_LOST && + result != VK_ERROR_SURFACE_LOST_KHR && + result != VK_ERROR_OUT_OF_DATE_KHR) + { + result = VK_SUBOPTIMAL_KHR; + } + + break; } - break; - } - - default: - { - anvil_assert(presentation_results[0] == VK_SUCCESS); + default: + { + anvil_assert(presentation_results[n_presentation] == VK_SUCCESS); + } } } @@ -370,6 +567,51 @@ VkResult Anvil::Queue::present(std::shared_ptr in_swapchain_p return result; } +/** Please see header for specification */ +void Anvil::Queue::present_lock_unlock(uint32_t in_n_swapchains, + const std::shared_ptr* in_swapchains, + uint32_t in_n_wait_semaphores, + std::shared_ptr* in_wait_semaphore_ptrs, + bool in_should_lock) +{ + if (in_should_lock) + { + lock(); + } + else + { + unlock(); + } + + for (uint32_t n_semaphore = 0; + n_semaphore < in_n_wait_semaphores; + ++n_semaphore) + { + if (in_should_lock) + { + in_wait_semaphore_ptrs[n_semaphore]->lock(); + } + else + { + in_wait_semaphore_ptrs[n_semaphore]->unlock(); + } + } + + for (uint32_t n_swapchain = 0; + n_swapchain < in_n_swapchains; + ++n_swapchain) + { + if (in_should_lock) + { + in_swapchains[n_swapchain]->lock(); + } + else + { + in_swapchains[n_swapchain]->unlock(); + } + } +} + /** Please see header for specification */ void Anvil::Queue::submit_command_buffers(uint32_t in_n_command_buffers, std::shared_ptr const* in_opt_cmd_buffer_ptrs, @@ -381,7 +623,8 @@ void Anvil::Queue::submit_command_buffers(uint32_t bool in_should_block, std::shared_ptr in_opt_fence_ptr) { - VkResult result (VK_ERROR_INITIALIZATION_FAILED); + bool needs_fence_reset(false); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); VkSubmitInfo submit_info; VkCommandBuffer cmd_buffers_vk [64]; @@ -396,14 +639,6 @@ void Anvil::Queue::submit_command_buffers(uint32_t anvil_assert(in_n_semaphores_to_wait_on < sizeof(wait_semaphores_vk) / sizeof(wait_semaphores_vk [0]) ); /* Prepare for the submission */ - if (in_opt_fence_ptr == nullptr && - in_should_block) - { - m_submit_fence_ptr->reset(); - - in_opt_fence_ptr = m_submit_fence_ptr; - } - for (uint32_t n_command_buffer = 0; n_command_buffer < in_n_command_buffers; ++n_command_buffer) @@ -415,7 +650,9 @@ void Anvil::Queue::submit_command_buffers(uint32_t n_signal_semaphore < in_n_semaphores_to_signal; ++n_signal_semaphore) { - signal_semaphores_vk[n_signal_semaphore] = in_opt_semaphore_to_signal_ptr_ptrs[n_signal_semaphore]->get_semaphore(); + auto sem_ptr = in_opt_semaphore_to_signal_ptr_ptrs[n_signal_semaphore]; + + signal_semaphores_vk[n_signal_semaphore] = sem_ptr->get_semaphore(); } for (uint32_t n_wait_semaphore = 0; @@ -435,23 +672,129 @@ void Anvil::Queue::submit_command_buffers(uint32_t submit_info.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO; submit_info.waitSemaphoreCount = in_n_semaphores_to_wait_on; - /* Go for it */ - result = vkQueueSubmit(m_queue, - 1, /* submitCount */ - &submit_info, - (in_opt_fence_ptr != nullptr) ? in_opt_fence_ptr->get_fence() - : VK_NULL_HANDLE); - anvil_assert_vk_call_succeeded(result); + /* Go for it */ + if (in_opt_fence_ptr == nullptr && + in_should_block) + { + in_opt_fence_ptr = m_submit_fence_ptr; + needs_fence_reset = true; + } + + submit_command_buffers_lock_unlock(in_n_command_buffers, + in_opt_cmd_buffer_ptrs, + in_n_semaphores_to_signal, + in_opt_semaphore_to_signal_ptr_ptrs, + in_n_semaphores_to_wait_on, + in_opt_semaphore_to_wait_on_ptr_ptrs, + in_opt_fence_ptr, + true); /* in_should_lock */ + { + if (needs_fence_reset) + { + m_submit_fence_ptr->reset(); + } - if (in_should_block) + result = vkQueueSubmit(m_queue, + 1, /* submitCount */ + &submit_info, + (in_opt_fence_ptr != nullptr) ? in_opt_fence_ptr->get_fence() + : VK_NULL_HANDLE); + + if (in_should_block) + { + /* Wait till initialization finishes GPU-side */ + result = vkWaitForFences(m_device_ptr.lock()->get_device_vk(), + 1, /* fenceCount */ + in_opt_fence_ptr->get_fence_ptr(), + VK_TRUE, /* waitAll */ + UINT64_MAX); /* timeout */ + + anvil_assert_vk_call_succeeded(result); + } + } + submit_command_buffers_lock_unlock(in_n_command_buffers, + in_opt_cmd_buffer_ptrs, + in_n_semaphores_to_signal, + in_opt_semaphore_to_signal_ptr_ptrs, + in_n_semaphores_to_wait_on, + in_opt_semaphore_to_wait_on_ptr_ptrs, + in_opt_fence_ptr, + false); /* in_should_lock */ + + + anvil_assert_vk_call_succeeded(result); +} + +void Anvil::Queue::submit_command_buffers_lock_unlock(uint32_t in_n_command_buffers, + std::shared_ptr const* in_opt_cmd_buffer_ptrs, + uint32_t in_n_semaphores_to_signal, + std::shared_ptr const* in_opt_semaphore_to_signal_ptr_ptrs, + uint32_t in_n_semaphores_to_wait_on, + std::shared_ptr const* in_opt_semaphore_to_wait_on_ptr_ptrs, + std::shared_ptr in_opt_fence_ptr, + bool in_should_lock) +{ + if (in_should_lock) + { + lock(); + } + else + { + unlock(); + } + + for (uint32_t n_command_buffer = 0; + n_command_buffer < in_n_command_buffers; + ++n_command_buffer) + { + if (in_should_lock) + { + in_opt_cmd_buffer_ptrs[n_command_buffer]->lock(); + } + else + { + in_opt_cmd_buffer_ptrs[n_command_buffer]->unlock(); + } + } + + for (uint32_t n_signal_semaphore = 0; + n_signal_semaphore < in_n_semaphores_to_signal; + ++n_signal_semaphore) { - /* Wait till initialization finishes GPU-side */ - result = vkWaitForFences(m_device_ptr.lock()->get_device_vk(), - 1, /* fenceCount */ - in_opt_fence_ptr->get_fence_ptr(), - VK_TRUE, /* waitAll */ - UINT64_MAX); /* timeout */ - - anvil_assert_vk_call_succeeded(result); + if (in_should_lock) + { + in_opt_semaphore_to_signal_ptr_ptrs[n_signal_semaphore]->lock(); + } + else + { + in_opt_semaphore_to_signal_ptr_ptrs[n_signal_semaphore]->unlock(); + } + } + + for (uint32_t n_wait_semaphore = 0; + n_wait_semaphore < in_n_semaphores_to_wait_on; + ++n_wait_semaphore) + { + if (in_should_lock) + { + in_opt_semaphore_to_wait_on_ptr_ptrs[n_wait_semaphore]->lock(); + } + else + { + in_opt_semaphore_to_wait_on_ptr_ptrs[n_wait_semaphore]->unlock(); + } + } + + if (in_opt_fence_ptr != nullptr) + { + if (in_should_lock) + { + in_opt_fence_ptr->lock(); + } + else + { + in_opt_fence_ptr->unlock(); + } } } + diff --git a/src/wrappers/render_pass.cpp b/src/wrappers/render_pass.cpp index 688b5b7b..604a0c5e 100644 --- a/src/wrappers/render_pass.cpp +++ b/src/wrappers/render_pass.cpp @@ -21,25 +21,23 @@ // #include "misc/debug.h" +#include "misc/graphics_pipeline_info.h" #include "misc/object_tracker.h" +#include "misc/render_pass_info.h" #include "wrappers/device.h" #include "wrappers/graphics_pipeline_manager.h" #include "wrappers/pipeline_layout.h" #include "wrappers/render_pass.h" #include "wrappers/swapchain.h" -#include -#include /** Contsructor. Initializes the Renderpass instance with default values. */ -Anvil::RenderPass::RenderPass(std::weak_ptr in_device_ptr, - std::shared_ptr in_opt_swapchain_ptr) - :CallbacksSupportProvider (RENDER_PASS_CALLBACK_ID_COUNT), - DebugMarkerSupportProvider(in_device_ptr, +Anvil::RenderPass::RenderPass(std::unique_ptr in_renderpass_info_ptr, + std::shared_ptr in_opt_swapchain_ptr) + :DebugMarkerSupportProvider(in_renderpass_info_ptr->get_device(), VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT), - m_device_ptr (in_device_ptr), - m_dirty (false), m_render_pass (VK_NULL_HANDLE), + m_render_pass_info_ptr (std::move(in_renderpass_info_ptr) ), m_swapchain_ptr (in_opt_swapchain_ptr) { /* Register the object */ @@ -56,7 +54,7 @@ Anvil::RenderPass::~RenderPass() if (m_render_pass != VK_NULL_HANDLE) { - std::shared_ptr device_locked_ptr(m_device_ptr); + std::shared_ptr device_locked_ptr(m_render_pass_info_ptr->get_device() ); vkDestroyRenderPass(device_locked_ptr->get_device_vk(), m_render_pass, @@ -65,565 +63,13 @@ Anvil::RenderPass::~RenderPass() m_render_pass = VK_NULL_HANDLE; } - while (m_subpasses.size() > 0) - { - auto iterator = m_subpasses.begin(); - - delete *iterator; - - m_subpasses.erase(iterator); - } - m_swapchain_ptr = nullptr; } -/* Please see haeder for specification */ -bool Anvil::RenderPass::add_color_attachment(VkFormat in_format, - VkSampleCountFlags in_sample_count, - VkAttachmentLoadOp in_load_op, - VkAttachmentStoreOp in_store_op, - VkImageLayout in_initial_layout, - VkImageLayout in_final_layout, - bool in_may_alias, - RenderPassAttachmentID* out_attachment_id_ptr) -{ - uint32_t new_attachment_index = UINT32_MAX; - bool result = false; - - if (out_attachment_id_ptr == nullptr) - { - anvil_assert(out_attachment_id_ptr != nullptr); - - goto end; - } - - m_dirty = true; - new_attachment_index = static_cast(m_attachments.size() ); - - *out_attachment_id_ptr = new_attachment_index; - - m_attachments.push_back(RenderPassAttachment(in_format, - in_sample_count, - in_load_op, - in_store_op, - in_initial_layout, - in_final_layout, - in_may_alias, - new_attachment_index) ); - - result = true; - - /* Notify the subscribers about the event */ - { - OnRenderPassBakeNeededCallbackArgument callback_argument(this); - - callback(RENDER_PASS_CALLBACK_ID_BAKING_NEEDED, - &callback_argument); - } - -end: - return result; -} - -/** Adds a new dependency to the internal data model. - * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. - * - * @param in_destination_subpass_ptr Pointer to the descriptor of the destination subpass. - * If nullptr, it is assumed an external destination is requested. - * @param in_source_subpass_ptr Pointer to the descriptor of the source subpass. - * If nullptr, it is assumed an external source is requested. - * @param in_source_stage_mask Source pipeline stage mask. - * @param in_destination_stage_mask Destination pipeline stage mask. - * @param in_source_access_mask Source access mask. - * @param in_destination_access_mask Destination access mask. - * @param in_by_region true if a "by-region" dependency is requested; false otherwise. - * - * @return true if the dependency was added successfully; false otherwise. - * - **/ -bool Anvil::RenderPass::add_dependency(SubPass* in_destination_subpass_ptr, - SubPass* in_source_subpass_ptr, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) -{ - SubPassDependency new_dep(in_destination_stage_mask, - in_destination_subpass_ptr, - in_source_stage_mask, - in_source_subpass_ptr, - in_source_access_mask, - in_destination_access_mask, - in_by_region); - - if (std::find(m_subpass_dependencies.begin(), - m_subpass_dependencies.end(), - new_dep) == m_subpass_dependencies.end() ) - { - m_subpass_dependencies.push_back(new_dep); - - m_dirty = true; - - /* Notify the subscribers about the event */ - { - OnRenderPassBakeNeededCallbackArgument callback_argument(this); - - callback(RENDER_PASS_CALLBACK_ID_BAKING_NEEDED, - &callback_argument); - } - } - - return true; -} - -/* Please see header for specification */ -bool Anvil::RenderPass::add_depth_stencil_attachment(VkFormat in_format, - VkSampleCountFlags in_sample_count, - VkAttachmentLoadOp in_depth_load_op, - VkAttachmentStoreOp in_depth_store_op, - VkAttachmentLoadOp in_stencil_load_op, - VkAttachmentStoreOp in_stencil_store_op, - VkImageLayout in_initial_layout, - VkImageLayout in_final_layout, - bool in_may_alias, - RenderPassAttachmentID* out_attachment_id_ptr) -{ - uint32_t new_attachment_index = UINT32_MAX; - bool result = false; - - if (out_attachment_id_ptr == nullptr) - { - anvil_assert(out_attachment_id_ptr != nullptr); - - goto end; - } - - m_dirty = true; - new_attachment_index = static_cast(m_attachments.size() ); - - *out_attachment_id_ptr = new_attachment_index; - - m_attachments.push_back(RenderPassAttachment(in_format, - in_sample_count, - in_depth_load_op, - in_depth_store_op, - in_stencil_load_op, - in_stencil_store_op, - in_initial_layout, - in_final_layout, - in_may_alias, - new_attachment_index) ); - - result = true; -end: - return result; -} - -/* Please see header for specification */ -bool Anvil::RenderPass::add_external_to_subpass_dependency(SubPassID in_destination_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) -{ - SubPass* destination_subpass_ptr = nullptr; - bool result = false; - - if (m_subpasses.size() <= in_destination_subpass_id) - { - anvil_assert(!(m_subpasses.size() <= in_destination_subpass_id) ); - - goto end; - } - - destination_subpass_ptr = m_subpasses[in_destination_subpass_id]; - - result = add_dependency(destination_subpass_ptr, - nullptr, /* source_subpass_ptr */ - in_source_stage_mask, - in_destination_stage_mask, - in_source_access_mask, - in_destination_access_mask, - in_by_region); -end: - return result; -} - -/* Please see header for specification */ -bool Anvil::RenderPass::add_self_subpass_dependency(SubPassID in_destination_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) -{ - SubPass* destination_subpass_ptr = nullptr; - bool result = false; - - if (m_subpasses.size() <= in_destination_subpass_id) - { - anvil_assert(!(m_subpasses.size() <= in_destination_subpass_id) ); - - goto end; - } - - destination_subpass_ptr = m_subpasses[in_destination_subpass_id]; - - result = add_dependency(destination_subpass_ptr, - destination_subpass_ptr, - in_source_stage_mask, - in_destination_stage_mask, - in_source_access_mask, - in_destination_access_mask, - in_by_region); -end: - return result; -} - -/* Please see header for specification */ -bool Anvil::RenderPass::add_subpass(const ShaderModuleStageEntryPoint& in_fragment_shader_entrypoint, - const ShaderModuleStageEntryPoint& in_geometry_shader_entrypoint, - const ShaderModuleStageEntryPoint& in_tess_control_shader_entrypoint, - const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_entrypoint, - const ShaderModuleStageEntryPoint& in_vertex_shader_entrypoint, - SubPassID* out_subpass_id_ptr, - const Anvil::PipelineID in_opt_pipeline_id) -{ - uint32_t new_subpass_index = UINT32_MAX; - GraphicsPipelineID new_subpass_pipeline_id = UINT32_MAX; - bool result = false; - - if (out_subpass_id_ptr == nullptr) - { - anvil_assert(out_subpass_id_ptr != nullptr); - - goto end; - } - - m_dirty = true; - new_subpass_index = static_cast(m_subpasses.size() ); - - /* Create a new graphics pipeline for the subpass */ - anvil_assert(in_vertex_shader_entrypoint.name.size() != 0); - - if (in_opt_pipeline_id == UINT32_MAX) - { - std::shared_ptr device_locked_ptr(m_device_ptr); - - device_locked_ptr->get_graphics_pipeline_manager()->add_regular_pipeline(false, /* disable_optimizations */ - false, /* allow_derivatives */ - shared_from_this(), - new_subpass_index, - in_fragment_shader_entrypoint, - in_geometry_shader_entrypoint, - in_tess_control_shader_entrypoint, - in_tess_evaluation_shader_entrypoint, - in_vertex_shader_entrypoint, - &new_subpass_pipeline_id); - } - else - { - new_subpass_pipeline_id = in_opt_pipeline_id; - } - - /* Spawn a new descriptor */ - { - SubPass* new_subpass_ptr = new SubPass(m_device_ptr, - new_subpass_index, - new_subpass_pipeline_id); - - m_subpasses.push_back(new_subpass_ptr); - - *out_subpass_id_ptr = new_subpass_index; - } - - result = true; -end: - return result; -} - -/** Adds a new attachment to the specified subpass. - * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. - * - * @param in_subpass_id ID of the subpass to update. The subpass must have been earlier - * created with an add_subpass() call. - * @param in_is_color_attachment true if the added attachment is a color attachment;false if it's - * an input attachment. - * @param in_layout Layout to use for the attachment when executing the subpass. - * Driver takes care of transforming the attachment to the requested layout - * before subpass commands starts executing. - * @param in_attachment_id ID of a render-pass attachment ID this sub-pass attachment should - * refer to. - * @param in_attachment_location Location, under which the specified attachment should be accessible. - * @param in_should_resolve true if the specified attachment is multisample and should be - * resolved at the end of the sub-pass. - * @parma in_resolve_attachment_id If @param should_resolve is true, this argument should specify the - * ID of a render-pass attachment, to which the resolved data should - * written to. - * - * @return true if the function executed successfully, false otherwise. - * - **/ -bool Anvil::RenderPass::add_subpass_attachment(SubPassID in_subpass_id, - bool in_is_color_attachment, - VkImageLayout in_layout, - RenderPassAttachmentID in_attachment_id, - uint32_t in_attachment_location, - bool in_should_resolve, - RenderPassAttachmentID in_resolve_attachment_id) -{ - RenderPassAttachment* renderpass_attachment_ptr = nullptr; - RenderPassAttachment* resolve_attachment_ptr = nullptr; - bool result = false; - LocationToSubPassAttachmentMap* subpass_attachments_ptr = nullptr; - SubPass* subpass_ptr = nullptr; - - /* Retrieve the subpass descriptor */ - if (in_subpass_id >= m_subpasses.size() ) - { - anvil_assert(!(in_subpass_id >= m_subpasses.size() )); - - goto end; - } - else - { - subpass_ptr = m_subpasses.at(in_subpass_id); - } - - /* Retrieve the renderpass attachment descriptor */ - if (in_attachment_id >= m_attachments.size() ) - { - anvil_assert(!(in_attachment_id >= m_attachments.size()) ); - - goto end; - } - else - { - renderpass_attachment_ptr = &m_attachments.at(in_attachment_id); - } - - /* Retrieve the resolve attachment descriptor, if one was requested */ - if (in_should_resolve) - { - if (in_resolve_attachment_id >= m_attachments.size() ) - { - anvil_assert(!(in_resolve_attachment_id >= m_attachments.size()) ); - - goto end; - } - else - { - resolve_attachment_ptr = &m_attachments.at(in_resolve_attachment_id); - } - } - - /* Make sure the attachment location is not already assigned an attachment */ - subpass_attachments_ptr = (in_is_color_attachment) ? &subpass_ptr->color_attachments_map - : &subpass_ptr->input_attachments_map; - - if (subpass_attachments_ptr->find(in_attachment_location) != subpass_attachments_ptr->end() ) - { - anvil_assert(!(subpass_attachments_ptr->find(in_attachment_location) != subpass_attachments_ptr->end()) ); - - goto end; - } - - /* Add the attachment */ - (*subpass_attachments_ptr)[in_attachment_location] = SubPassAttachment(renderpass_attachment_ptr, - in_layout, - resolve_attachment_ptr); - - if (in_should_resolve) - { - anvil_assert(resolve_attachment_ptr != nullptr); - - subpass_ptr->resolved_attachments_map[in_attachment_location] = SubPassAttachment(resolve_attachment_ptr, - in_layout, - nullptr); - } - - m_dirty = true; - result = true; - - /* Notify the subscribers about the event */ - { - OnRenderPassBakeNeededCallbackArgument callback_argument(this); - - callback(RENDER_PASS_CALLBACK_ID_BAKING_NEEDED, - &callback_argument); - } - -end: - return result; -} - -/* Please see header for specification */ -bool Anvil::RenderPass::add_subpass_color_attachment(SubPassID in_subpass_id, - VkImageLayout in_input_layout, - RenderPassAttachmentID in_attachment_id, - uint32_t in_location, - const RenderPassAttachmentID* in_attachment_resolve_id_ptr) -{ - return add_subpass_attachment(in_subpass_id, - true, /* is_color_attachment */ - in_input_layout, - in_attachment_id, - in_location, - (in_attachment_resolve_id_ptr != nullptr), - (in_attachment_resolve_id_ptr != nullptr) ? *in_attachment_resolve_id_ptr - : UINT32_MAX); -} - -/* Please see header for specification */ -bool Anvil::RenderPass::add_subpass_depth_stencil_attachment(SubPassID in_subpass_id, - RenderPassAttachmentID in_attachment_id, - VkImageLayout in_layout) -{ - RenderPassAttachment* ds_attachment_ptr = nullptr; - RenderPassAttachment* resolve_attachment_ptr = nullptr; - bool result = false; - SubPass* subpass_ptr = nullptr; - - /* Retrieve the subpass descriptor */ - if (m_subpasses.size() <= in_subpass_id) - { - anvil_assert(!(m_subpasses.size() <= in_subpass_id) ); - - goto end; - } - else - { - subpass_ptr = m_subpasses.at(in_subpass_id); - } - - /* Retrieve the attachment descriptors */ - if (m_attachments.size() <= in_attachment_id) - { - anvil_assert(!(m_attachments.size() <= in_attachment_id) ); - - goto end; - } - else - { - ds_attachment_ptr = &m_attachments.at(in_attachment_id); - } - - /* Update the depth/stencil attachment for the subpass */ - if (subpass_ptr->depth_stencil_attachment.attachment_ptr != nullptr) - { - anvil_assert(!(subpass_ptr->depth_stencil_attachment.attachment_ptr != nullptr) ); - - goto end; - } - - subpass_ptr->depth_stencil_attachment = SubPassAttachment(ds_attachment_ptr, - in_layout, - resolve_attachment_ptr); - - result = true; -end: - return result; -} - -/* Please see header for specification */ -bool Anvil::RenderPass::add_subpass_input_attachment(SubPassID in_subpass_id, - VkImageLayout in_layout, - RenderPassAttachmentID in_attachment_id, - uint32_t in_attachment_index) -{ - return add_subpass_attachment(in_subpass_id, - false, /* is_color_attachment */ - in_layout, - in_attachment_id, - in_attachment_index, - false, /* should_resolve */ - UINT32_MAX); /* resolve_attachment_id */ -} - -/* Please see header for specification */ -bool Anvil::RenderPass::add_subpass_to_external_dependency(SubPassID in_source_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) -{ - SubPass* source_subpass_ptr = nullptr; - bool result = false; - - if (m_subpasses.size() <= in_source_subpass_id) - { - anvil_assert(!(m_subpasses.size() <= in_source_subpass_id) ); - - goto end; - } - - source_subpass_ptr = m_subpasses[in_source_subpass_id]; - - result = add_dependency(nullptr, /* destination_subpass_ptr */ - source_subpass_ptr, - in_source_stage_mask, - in_destination_stage_mask, - in_source_access_mask, - in_destination_access_mask, - in_by_region); -end: - return result; -} - -/* Please see header for specification */ -bool Anvil::RenderPass::add_subpass_to_subpass_dependency(SubPassID in_source_subpass_id, - SubPassID in_destination_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) -{ - SubPass* destination_subpass_ptr = nullptr; - bool result = false; - SubPass* source_subpass_ptr = nullptr; - - if (m_subpasses.size() <= in_destination_subpass_id) - { - anvil_assert(!(m_subpasses.size() <= in_destination_subpass_id) ); - - goto end; - } - - if (m_subpasses.size() <= in_source_subpass_id) - { - anvil_assert(!(m_subpasses.size() <= in_source_subpass_id) ); - - goto end; - } - - destination_subpass_ptr = m_subpasses[in_destination_subpass_id]; - source_subpass_ptr = m_subpasses[in_source_subpass_id]; - - result = add_dependency(destination_subpass_ptr, - source_subpass_ptr, - in_source_stage_mask, - in_destination_stage_mask, - in_source_access_mask, - in_destination_access_mask, - in_by_region); -end: - return result; -} - /* Please see header for specification */ -bool Anvil::RenderPass::bake() +bool Anvil::RenderPass::init() { - std::shared_ptr device_locked_ptr (m_device_ptr); + std::shared_ptr device_locked_ptr (m_render_pass_info_ptr->get_device() ); std::vector renderpass_attachments_vk; VkRenderPassCreateInfo render_pass_create_info; bool result (false); @@ -690,23 +136,14 @@ bool Anvil::RenderPass::bake() std::vector > subpass_attachment_sets; - /* If this is not first baking request, release the previously created render pass instance */ - if (m_render_pass != VK_NULL_HANDLE) - { - vkDestroyRenderPass(device_locked_ptr->get_device_vk(), - m_render_pass, - nullptr /* pAllocator */); - - m_render_pass = VK_NULL_HANDLE; - set_vk_handle(VK_NULL_HANDLE); - } + anvil_assert(m_render_pass == VK_NULL_HANDLE); /* Set up helper descriptor storage space */ - subpass_dependencies_vk.reserve(m_subpass_dependencies.size() ); - subpass_descriptions_vk.reserve(m_subpasses.size() ); + subpass_dependencies_vk.reserve(m_render_pass_info_ptr->m_subpass_dependencies.size() ); + subpass_descriptions_vk.reserve(m_render_pass_info_ptr->m_subpasses.size() ); - for (auto renderpass_attachment_iterator = m_attachments.cbegin(); - renderpass_attachment_iterator != m_attachments.cend(); + for (auto renderpass_attachment_iterator = m_render_pass_info_ptr->m_attachments.cbegin(); + renderpass_attachment_iterator != m_render_pass_info_ptr->m_attachments.cend(); ++renderpass_attachment_iterator) { VkAttachmentDescription attachment_vk; @@ -725,8 +162,8 @@ bool Anvil::RenderPass::bake() renderpass_attachments_vk.push_back(attachment_vk); } - for (auto subpass_dependency_iterator = m_subpass_dependencies.cbegin(); - subpass_dependency_iterator != m_subpass_dependencies.cend(); + for (auto subpass_dependency_iterator = m_render_pass_info_ptr->m_subpass_dependencies.cbegin(); + subpass_dependency_iterator != m_render_pass_info_ptr->m_subpass_dependencies.cend(); ++subpass_dependency_iterator) { VkSubpassDependency dependency_vk; @@ -744,12 +181,9 @@ bool Anvil::RenderPass::bake() subpass_dependencies_vk.push_back(dependency_vk); } - /* Update preserved attachments for all subpasses */ - update_preserved_attachments(); - /* We now have all the data needed to create Vulkan subpass instances. */ - for (auto subpass_iterator = m_subpasses.cbegin(); - subpass_iterator != m_subpasses.cend(); + for (auto subpass_iterator = m_render_pass_info_ptr->m_subpasses.cbegin(); + subpass_iterator != m_render_pass_info_ptr->m_subpasses.cend(); ++subpass_iterator) { std::shared_ptr current_subpass_attachment_set_ptr; @@ -830,21 +264,21 @@ bool Anvil::RenderPass::bake() subpass_color_attachment_iterator != (*subpass_iterator)->color_attachments_map.cend(); ++subpass_color_attachment_iterator) { - current_subpass_attachment_set_ptr->color_attachments_vk[subpass_color_attachment_iterator->first] = get_attachment_reference_from_subpass_attachment(subpass_color_attachment_iterator->second); + current_subpass_attachment_set_ptr->color_attachments_vk[subpass_color_attachment_iterator->first] = m_render_pass_info_ptr->get_attachment_reference_from_subpass_attachment(subpass_color_attachment_iterator->second); if (need_color_resolve_attachments) { if (subpass_color_attachment_iterator->second.resolve_attachment_ptr != nullptr) { - current_subpass_attachment_set_ptr->resolve_color_attachments_vk[subpass_color_attachment_iterator->first] = get_attachment_reference_for_resolve_attachment(subpass_iterator, - subpass_color_attachment_iterator); + current_subpass_attachment_set_ptr->resolve_color_attachments_vk[subpass_color_attachment_iterator->first] = m_render_pass_info_ptr->get_attachment_reference_for_resolve_attachment(subpass_iterator, + subpass_color_attachment_iterator); } } } if ((*subpass_iterator)->depth_stencil_attachment.attachment_ptr != nullptr) { - current_subpass_attachment_set_ptr->depth_attachment_vk = get_attachment_reference_from_subpass_attachment((*subpass_iterator)->depth_stencil_attachment); + current_subpass_attachment_set_ptr->depth_attachment_vk = m_render_pass_info_ptr->get_attachment_reference_from_subpass_attachment((*subpass_iterator)->depth_stencil_attachment); } else { @@ -855,7 +289,7 @@ bool Anvil::RenderPass::bake() subpass_input_attachment_iterator != (*subpass_iterator)->input_attachments_map.cend(); ++subpass_input_attachment_iterator) { - current_subpass_attachment_set_ptr->input_attachments_vk[subpass_input_attachment_iterator->first] = get_attachment_reference_from_subpass_attachment(subpass_input_attachment_iterator->second); + current_subpass_attachment_set_ptr->input_attachments_vk[subpass_input_attachment_iterator->first] = m_render_pass_info_ptr->get_attachment_reference_from_subpass_attachment(subpass_input_attachment_iterator->second); } /* Fill the preserved attachments vector. These do not use indices or locations, so the process is much simpler */ @@ -896,9 +330,9 @@ bool Anvil::RenderPass::bake() } /* Set up a create info descriptor and spawn a new Vulkan RenderPass object. */ - render_pass_create_info.attachmentCount = static_cast(m_attachments.size() ); - render_pass_create_info.dependencyCount = static_cast(m_subpass_dependencies.size() ); - render_pass_create_info.subpassCount = static_cast(m_subpasses.size() ); + render_pass_create_info.attachmentCount = static_cast(m_render_pass_info_ptr->m_attachments.size () ); + render_pass_create_info.dependencyCount = static_cast(m_render_pass_info_ptr->m_subpass_dependencies.size() ); + render_pass_create_info.subpassCount = static_cast(m_render_pass_info_ptr->m_subpasses.size () ); render_pass_create_info.flags = 0; render_pass_create_info.pAttachments = (render_pass_create_info.attachmentCount > 0) ? &renderpass_attachments_vk.at(0) : nullptr; @@ -923,7 +357,6 @@ bool Anvil::RenderPass::bake() set_vk_handle(m_render_pass); - m_dirty = false; result = true; end: @@ -931,679 +364,23 @@ bool Anvil::RenderPass::bake() } /* Please see header for specification */ -std::shared_ptr Anvil::RenderPass::create(std::weak_ptr in_device_ptr, - std::shared_ptr in_opt_swapchain_ptr) +std::shared_ptr Anvil::RenderPass::create(std::unique_ptr in_renderpass_info_ptr, + std::shared_ptr in_opt_swapchain_ptr) { std::shared_ptr result_ptr; result_ptr.reset( - new Anvil::RenderPass(in_device_ptr, + new Anvil::RenderPass(std::move(in_renderpass_info_ptr), in_opt_swapchain_ptr) ); - return result_ptr; -} - -/** Creates a VkAttachmentReference descriptor from the specified RenderPassAttachment instance. - * - * @param in_renderpass_attachment Renderpass attachment descriptor to create the Vulkan descriptor from. - * - * @return As per description. - **/ -VkAttachmentReference Anvil::RenderPass::get_attachment_reference_from_renderpass_attachment(const RenderPassAttachment& in_renderpass_attachment) const -{ - VkAttachmentReference attachment_vk; - - attachment_vk.attachment = in_renderpass_attachment.index; - attachment_vk.layout = in_renderpass_attachment.initial_layout; - - return attachment_vk; -} - -/** Creates a VkAttachmentReference descriptor from the specified SubPassAttachment instance. - * - * @param in_renderpass_attachment Subpass attachment descriptor to create the Vulkan descriptor from. - * - * @return As per description. - **/ -VkAttachmentReference Anvil::RenderPass::get_attachment_reference_from_subpass_attachment(const SubPassAttachment& in_subpass_attachment) const -{ - VkAttachmentReference attachment_vk; - - attachment_vk.attachment = in_subpass_attachment.attachment_ptr->index; - attachment_vk.layout = in_subpass_attachment.layout; - - return attachment_vk; -} - -/** Creates a VkAttachmentReference descriptor for a resolve attachment for a color attachment specified by the user. - * - * @param in_subpass_iterator Iterator pointing at the subpass which uses the color attachment of interest. - * @param in_location_to_subpass_att_map_iterator Iterator pointing at a color attachment which has a resolve attachment attached. - * - * @return As per description. - **/ -VkAttachmentReference Anvil::RenderPass::get_attachment_reference_for_resolve_attachment(const SubPassesConstIterator& in_subpass_iterator, - const LocationToSubPassAttachmentMapConstIterator& in_location_to_subpass_att_map_iterator) const -{ - VkAttachmentReference result; - - anvil_assert((*in_subpass_iterator)->resolved_attachments_map.find(in_location_to_subpass_att_map_iterator->first) != (*in_subpass_iterator)->resolved_attachments_map.end() ); - - result.attachment = in_location_to_subpass_att_map_iterator->second.resolve_attachment_ptr->index; - result.layout = (*in_subpass_iterator)->resolved_attachments_map.at(in_location_to_subpass_att_map_iterator->first).layout; - - return result; -} - -/* Please see header for specification */ -bool Anvil::RenderPass::get_attachment_type(RenderPassAttachmentID in_attachment_id, - AttachmentType* out_attachment_type_ptr) const -{ - bool result = false; - - if (m_attachments.size() <= in_attachment_id) + if (result_ptr != nullptr) { - anvil_assert(m_attachments.size() > in_attachment_id); - - goto end; + if (!result_ptr->init() ) + { + result_ptr.reset(); + } } - *out_attachment_type_ptr = m_attachments[in_attachment_id].type; - - /* All done */ - result = true; -end: - return result; -} - -/* Please see header for specification */ -bool Anvil::RenderPass::get_color_attachment_properties(RenderPassAttachmentID in_attachment_id, - VkSampleCountFlagBits* out_opt_sample_count_ptr, - VkAttachmentLoadOp* out_opt_load_op_ptr, - VkAttachmentStoreOp* out_opt_store_op_ptr, - VkImageLayout* out_opt_initial_layout_ptr, - VkImageLayout* out_opt_final_layout_ptr, - bool* out_opt_may_alias_ptr) const -{ - bool result = false; - - if (m_attachments.size() <= in_attachment_id) - { - goto end; - } - - if (out_opt_sample_count_ptr != nullptr) - { - *out_opt_sample_count_ptr = static_cast(m_attachments[in_attachment_id].sample_count); - } - - if (out_opt_load_op_ptr != nullptr) - { - *out_opt_load_op_ptr = m_attachments[in_attachment_id].color_depth_load_op; - } - - if (out_opt_store_op_ptr != nullptr) - { - *out_opt_store_op_ptr = m_attachments[in_attachment_id].color_depth_store_op; - } - - if (out_opt_initial_layout_ptr != nullptr) - { - *out_opt_initial_layout_ptr = m_attachments[in_attachment_id].initial_layout; - } - - if (out_opt_final_layout_ptr != nullptr) - { - *out_opt_final_layout_ptr = m_attachments[in_attachment_id].final_layout; - } - - if (out_opt_may_alias_ptr != nullptr) - { - *out_opt_may_alias_ptr = m_attachments[in_attachment_id].may_alias; - } - - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::RenderPass::get_dependency_properties(uint32_t in_n_dependency, - SubPassID* out_destination_subpass_id_ptr, - SubPassID* out_source_subpass_id_ptr, - VkPipelineStageFlags* out_destination_stage_mask_ptr, - VkPipelineStageFlags* out_source_stage_mask_ptr, - VkAccessFlags* out_destination_access_mask_ptr, - VkAccessFlags* out_source_access_mask_ptr, - bool* out_by_region_ptr) const -{ - const Anvil::RenderPass::SubPassDependency* dep_ptr = nullptr; - bool result = false; - - if (m_subpass_dependencies.size() <= in_n_dependency) - { - anvil_assert_fail(); - - goto end; - } - - dep_ptr = &m_subpass_dependencies[in_n_dependency]; - - *out_destination_subpass_id_ptr = (dep_ptr->destination_subpass_ptr != nullptr) ? dep_ptr->destination_subpass_ptr->index - : UINT32_MAX; - *out_source_subpass_id_ptr = (dep_ptr->source_subpass_ptr != nullptr) ? dep_ptr->source_subpass_ptr->index - : UINT32_MAX; - *out_destination_stage_mask_ptr = dep_ptr->destination_stage_mask; - *out_source_stage_mask_ptr = dep_ptr->source_stage_mask; - *out_destination_access_mask_ptr = dep_ptr->destination_access_mask; - *out_source_access_mask_ptr = dep_ptr->source_access_mask; - *out_by_region_ptr = dep_ptr->by_region; - - /* All done */ - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::RenderPass::get_depth_stencil_attachment_properties(RenderPassAttachmentID in_attachment_id, - VkAttachmentLoadOp* out_opt_depth_load_op_ptr, - VkAttachmentStoreOp* out_opt_depth_store_op_ptr, - VkAttachmentLoadOp* out_opt_stencil_load_op_ptr, - VkAttachmentStoreOp* out_opt_stencil_store_op_ptr, - VkImageLayout* out_opt_initial_layout_ptr, - VkImageLayout* out_opt_final_layout_ptr, - bool* out_opt_may_alias_ptr) const -{bool result = false; - - if (m_attachments.size() <= in_attachment_id) - { - goto end; - } - - if (out_opt_depth_load_op_ptr != nullptr) - { - *out_opt_depth_load_op_ptr = m_attachments[in_attachment_id].color_depth_load_op; - } - - if (out_opt_depth_store_op_ptr != nullptr) - { - *out_opt_depth_store_op_ptr = m_attachments[in_attachment_id].color_depth_store_op; - } - - if (out_opt_stencil_load_op_ptr != nullptr) - { - *out_opt_stencil_load_op_ptr = m_attachments[in_attachment_id].stencil_load_op; - } - - if (out_opt_stencil_store_op_ptr != nullptr) - { - *out_opt_stencil_store_op_ptr = m_attachments[in_attachment_id].stencil_store_op; - } - - if (out_opt_initial_layout_ptr != nullptr) - { - *out_opt_initial_layout_ptr = m_attachments[in_attachment_id].initial_layout; - } - - if (out_opt_final_layout_ptr != nullptr) - { - *out_opt_final_layout_ptr = m_attachments[in_attachment_id].final_layout; - } - - if (out_opt_may_alias_ptr != nullptr) - { - *out_opt_may_alias_ptr = m_attachments[in_attachment_id].may_alias; - } - - result = true; -end: - return result; -} - -/* Please see header for specification */ -VkRenderPass Anvil::RenderPass::get_render_pass(bool allow_rebaking) -{ - VkRenderPass result = VK_NULL_HANDLE; - - if (m_dirty && allow_rebaking) - { - bake(); - - anvil_assert(!m_dirty); - } - - result = m_render_pass; - - anvil_assert(result != VK_NULL_HANDLE); - return result; -} - -/* Please see header for specification */ -bool Anvil::RenderPass::get_subpass_graphics_pipeline_id(SubPassID in_subpass_id, - GraphicsPipelineID* out_graphics_pipeline_id_ptr) const -{ - bool result = false; - - if (m_subpasses.size() <= in_subpass_id) - { - anvil_assert(!(m_subpasses.size() <= in_subpass_id) ); - - goto end; - } - else - { - *out_graphics_pipeline_id_ptr = m_subpasses[in_subpass_id]->pipeline_id; - result = true; - } - -end: - return result; -} - -/* Please see header for specification */ -bool Anvil::RenderPass::get_subpass_n_attachments(SubPassID in_subpass_id, - AttachmentType in_attachment_type, - uint32_t* out_n_attachments_ptr) -{ - bool result = false; - - if (m_subpasses.size() <= in_subpass_id) - { - anvil_assert(!(m_subpasses.size() <= in_subpass_id) ); - - goto end; - } - else - { - result = true; - - if (in_attachment_type == ATTACHMENT_TYPE_PRESERVE && m_dirty) - { - bake(); - - anvil_assert(!m_dirty); - } - - switch (in_attachment_type) - { - case ATTACHMENT_TYPE_COLOR: *out_n_attachments_ptr = static_cast(m_subpasses[in_subpass_id]->color_attachments_map.size() ); break; - case ATTACHMENT_TYPE_INPUT: *out_n_attachments_ptr = static_cast(m_subpasses[in_subpass_id]->input_attachments_map.size() ); break; - case ATTACHMENT_TYPE_PRESERVE: *out_n_attachments_ptr = static_cast(m_subpasses[in_subpass_id]->preserved_attachments.size() ); break; - case ATTACHMENT_TYPE_RESOLVE: *out_n_attachments_ptr = static_cast(m_subpasses[in_subpass_id]->resolved_attachments_map.size() ); break; - - case ATTACHMENT_TYPE_DEPTH_STENCIL: - { - *out_n_attachments_ptr = (m_subpasses[in_subpass_id]->depth_stencil_attachment.attachment_ptr != nullptr) ? 1u : 0u; - - break; - } - - default: - { - anvil_assert_fail(); - - result = false; - } - } - } - -end: - return result; -} - -/* Please see header for specification */ -bool Anvil::RenderPass::get_subpass_attachment_properties(SubPassID in_subpass_id, - AttachmentType in_attachment_type, - uint32_t in_n_subpass_attachment, - RenderPassAttachmentID* out_renderpass_attachment_id_ptr, - VkImageLayout* out_layout_ptr) -{ - SubPassAttachment attachment; - bool result = false; - LocationToSubPassAttachmentMap* subpass_attachments_ptr = nullptr; - SubPass* subpass_ptr = nullptr; - - /* Sanity checks */ - if (in_attachment_type == ATTACHMENT_TYPE_PRESERVE && - out_layout_ptr != nullptr) - { - anvil_assert(!(in_attachment_type == ATTACHMENT_TYPE_PRESERVE && - out_layout_ptr != nullptr) ); - - goto end; - } - - if (m_subpasses.size() <= in_subpass_id) - { - anvil_assert(!(m_subpasses.size() <= in_subpass_id) ); - - goto end; - } - - /* Bake the renderpass if needed.. */ - subpass_ptr = m_subpasses[in_subpass_id]; - - if (m_dirty) - { - bake(); - - if (m_dirty) - { - anvil_assert(!m_dirty); - - goto end; - } - } - - /* Even more sanity checks.. */ - switch (in_attachment_type) - { - case ATTACHMENT_TYPE_COLOR: /* Fall-through */ - case ATTACHMENT_TYPE_INPUT: /* Fall-through */ - case ATTACHMENT_TYPE_RESOLVE: - { - subpass_attachments_ptr = (in_attachment_type == ATTACHMENT_TYPE_COLOR) ? &subpass_ptr->color_attachments_map - : (in_attachment_type == ATTACHMENT_TYPE_INPUT) ? &subpass_ptr->input_attachments_map - : &subpass_ptr->resolved_attachments_map; - - auto iterator = subpass_attachments_ptr->find(in_n_subpass_attachment); - - if (iterator == subpass_attachments_ptr->end() ) - { - anvil_assert_fail(); - - goto end; - } - - *out_layout_ptr = iterator->second.layout; - *out_renderpass_attachment_id_ptr = iterator->second.attachment_ptr->index; - - break; - } - - case ATTACHMENT_TYPE_DEPTH_STENCIL: - { - if (in_n_subpass_attachment > 0) - { - anvil_assert(in_n_subpass_attachment == 0); - - goto end; - } - - *out_layout_ptr = subpass_ptr->depth_stencil_attachment.layout; - *out_renderpass_attachment_id_ptr = subpass_ptr->depth_stencil_attachment.attachment_ptr->index; - - break; - } - - case ATTACHMENT_TYPE_PRESERVE: - { - if (subpass_ptr->preserved_attachments.size() <= in_n_subpass_attachment) - { - anvil_assert(subpass_ptr->preserved_attachments.size() > in_n_subpass_attachment); - - goto end; - } - - const auto& attachment_props = subpass_ptr->preserved_attachments[in_n_subpass_attachment]; - - *out_renderpass_attachment_id_ptr = attachment_props.attachment_ptr->index; - break; - } - - default: - { - anvil_assert_fail(); - - goto end; - } - } - - /* All done */ - result = true; - -end: - return result; -} - -/* Please see header for specification */ -bool Anvil::RenderPass::set_subpass_graphics_pipeline_id(SubPassID in_subpass_id, - GraphicsPipelineID new_graphics_pipeline_id) -{ - std::shared_ptr device_locked_ptr(m_device_ptr); - bool result = false; - - if (m_subpasses.size() <= in_subpass_id) - { - anvil_assert(!(m_subpasses.size() <= in_subpass_id) ); - - goto end; - } - - if (in_subpass_id == m_subpasses[in_subpass_id]->pipeline_id) - { - goto end; - } - - /* Remove the former graphics pipeline. */ - if (!device_locked_ptr->get_graphics_pipeline_manager()->delete_pipeline(m_subpasses[in_subpass_id]->pipeline_id) ) - { - anvil_assert_fail(); - } - - m_subpasses[in_subpass_id]->pipeline_id = new_graphics_pipeline_id; - - m_dirty = true; - result = true; - - /* Notify the subscribers about the event */ - { - OnRenderPassBakeNeededCallbackArgument callback_argument(this); - - callback(RENDER_PASS_CALLBACK_ID_BAKING_NEEDED, - &callback_argument); - } - -end: - return result; -} - -/** Initializes the vector of preserved attachments for all defined attachments. The algorithm - * used is as follows: - * - * For each subpass: - * - * 1. Check what the highest subpass index that the attachment is preserved/used in is. - * 2. For all previous subpasses, determine which subpasses do not use it. For each subpass, preserve - * the attachment. - * - * This approach may need to be changed or extended in the future. - * - * This function should be considered expensive. - **/ -void Anvil::RenderPass::update_preserved_attachments() -{ - /* Cache color, depth+stencil, resolve attachments, as used by all defined subpasses. - * Make sure not to insert duplicate items. */ - std::vector unique_attachments; - - for (auto subpass_iterator = m_subpasses.begin(); - subpass_iterator != m_subpasses.end(); - ++subpass_iterator) - { - SubPass* current_subpass_ptr = *subpass_iterator; - - for (uint32_t n_attachment_type = 0; - n_attachment_type < 3; /* color, depth+stencil, resolve */ - ++n_attachment_type) - { - const uint32_t n_attachments = (n_attachment_type == 0) ? static_cast(current_subpass_ptr->color_attachments_map.size() ) - : (n_attachment_type == 1) ? ((current_subpass_ptr->depth_stencil_attachment.attachment_ptr != nullptr) ? 1 : 0) - : static_cast(current_subpass_ptr->resolved_attachments_map.size() ); - - for (uint32_t n_attachment = 0; - n_attachment < n_attachments; - ++n_attachment) - { - SubPassAttachment* current_attachment_ptr = (n_attachment_type == 0) ? current_subpass_ptr->get_color_attachment_at_index(n_attachment) - : (n_attachment_type == 1) ? ¤t_subpass_ptr->depth_stencil_attachment - : current_subpass_ptr->get_resolved_attachment_at_index(n_attachment); - - if (std::find(unique_attachments.begin(), - unique_attachments.end(), - current_attachment_ptr) == unique_attachments.end() ) - { - unique_attachments.push_back(current_attachment_ptr); - } - } - } - - /* Clean subpass's preserved attachments vector along the way.. */ - current_subpass_ptr->preserved_attachments.clear(); - } - - /* Determine what the index of the subpass which uses each unique attachment for the first, and for the last time, is. */ - for (std::vector::iterator unique_attachment_iterator = unique_attachments.begin(); - unique_attachment_iterator != unique_attachments.end(); - ++unique_attachment_iterator) - { - uint32_t current_subpass_index = 0; - const SubPassAttachment* current_unique_attachment_ptr = *unique_attachment_iterator; - uint32_t lowest_subpass_index = static_cast(m_subpasses.size() - 1); - uint32_t highest_subpass_index = 0; - - for (auto subpass_iterator = m_subpasses.begin(); - subpass_iterator != m_subpasses.end(); - ++subpass_iterator, ++current_subpass_index) - { - SubPass* current_subpass_ptr = *subpass_iterator; - bool subpass_processed = false; - - for (uint32_t n_attachment_type = 0; - n_attachment_type < 3 /* color, depth+stencil, resolve */ && !subpass_processed; - ++n_attachment_type) - { - const uint32_t n_attachments = (n_attachment_type == 0) ? static_cast(current_subpass_ptr->color_attachments_map.size() ) - : (n_attachment_type == 1) ? ((current_subpass_ptr->depth_stencil_attachment.attachment_ptr != nullptr) ? 1 : 0) - : static_cast(current_subpass_ptr->resolved_attachments_map.size() ); - - for (uint32_t n_attachment = 0; - n_attachment < n_attachments && !subpass_processed; - ++n_attachment) - { - SubPassAttachment* current_attachment_ptr = (n_attachment_type == 0) ? current_subpass_ptr->get_color_attachment_at_index(n_attachment) - : (n_attachment_type == 1) ? ¤t_subpass_ptr->depth_stencil_attachment - : current_subpass_ptr->get_resolved_attachment_at_index(n_attachment); - - if (current_attachment_ptr == current_unique_attachment_ptr) - { - if (lowest_subpass_index > current_subpass_index) - { - lowest_subpass_index = current_subpass_index; - } - - highest_subpass_index = current_subpass_index; - subpass_processed = true; - } - } - } - } - - (*unique_attachment_iterator)->highest_subpass_index = highest_subpass_index; - (*unique_attachment_iterator)->lowest_subpass_index = lowest_subpass_index; - } - - /* For each unique attachment, add it to the list of preserved attachments for all subpasses that precede the - * one at the highest subpass index and follow the one at the lowest subpass index, as long as the - * attachment is not used by a subpass. */ - for (std::vector::iterator unique_attachment_iterator = unique_attachments.begin(); - unique_attachment_iterator != unique_attachments.end(); - ++unique_attachment_iterator) - { - const SubPassAttachment* current_unique_attachment_ptr = *unique_attachment_iterator; - - if ((*unique_attachment_iterator)->highest_subpass_index == (*unique_attachment_iterator)->lowest_subpass_index) - { - /* There is only one producer subpass and no consumer subpasses defined for this renderpass. - *No need to create any preserve attachments. */ - continue; - } - - for (auto subpass_iterator = (m_subpasses.begin() + static_cast(current_unique_attachment_ptr->lowest_subpass_index) ); - subpass_iterator != (m_subpasses.begin() + static_cast(current_unique_attachment_ptr->highest_subpass_index) ) + 1; - ++subpass_iterator) - { - SubPass* current_subpass_ptr = *subpass_iterator; - bool is_subpass_attachment = false; - - for (uint32_t n_attachment_type = 0; - n_attachment_type < 3 /* color, depth+stencil, resolve */ && !is_subpass_attachment; - ++n_attachment_type) - { - const uint32_t n_attachments = (n_attachment_type == 0) ? static_cast(current_subpass_ptr->color_attachments_map.size() ) - : (n_attachment_type == 1) ? ((current_subpass_ptr->depth_stencil_attachment.attachment_ptr != nullptr) ? 1 : 0) - : static_cast(current_subpass_ptr->resolved_attachments_map.size() ); - - for (uint32_t n_attachment = 0; - n_attachment < n_attachments && !is_subpass_attachment; - ++n_attachment) - { - SubPassAttachment* current_attachment_ptr = (n_attachment_type == 0) ? current_subpass_ptr->get_color_attachment_at_index(n_attachment) - : (n_attachment_type == 1) ? ¤t_subpass_ptr->depth_stencil_attachment - : current_subpass_ptr->get_resolved_attachment_at_index(n_attachment); - - if (current_attachment_ptr == current_unique_attachment_ptr) - { - is_subpass_attachment = true; - } - } - } - - if (!is_subpass_attachment) - { - #ifdef _DEBUG - { - bool is_already_preserved = false; - const uint32_t n_preserved_attachments = static_cast(current_subpass_ptr->preserved_attachments.size() ); - - for (uint32_t n_preserved_attachment = 0; - n_preserved_attachment < n_preserved_attachments; - ++n_preserved_attachment) - { - if (¤t_subpass_ptr->preserved_attachments[n_preserved_attachment] == current_unique_attachment_ptr) - { - is_already_preserved = true; - - break; - } - } - - anvil_assert(!is_already_preserved); - } - #endif - - current_subpass_ptr->preserved_attachments.push_back(*current_unique_attachment_ptr); - } - } - } -} - -/** Please see header for specification */ -Anvil::RenderPass::SubPass::~SubPass() -{ - if (pipeline_id != UINT32_MAX) - { - std::shared_ptr device_locked_ptr (device_ptr); - std::weak_ptr gfx_pipeline_manager_ptr(device_locked_ptr->get_graphics_pipeline_manager() ); - - /* If this subpass is being automatically destroyed as a part of gfx pipeline manager destruction, the weak pointer - * will have become expired. Since pipelines are automatically destroyed as well, only delete the pipeline, if the - * manager is still around. */ - if (!gfx_pipeline_manager_ptr.expired() ) - { - gfx_pipeline_manager_ptr.lock()->delete_pipeline(pipeline_id); - } - } + return result_ptr; } diff --git a/src/wrappers/rendering_surface.cpp b/src/wrappers/rendering_surface.cpp index 89148e3a..91317608 100644 --- a/src/wrappers/rendering_surface.cpp +++ b/src/wrappers/rendering_surface.cpp @@ -33,12 +33,15 @@ Anvil::RenderingSurface::RenderingSurface(std::weak_ptr in_instance_ptr, std::weak_ptr in_device_ptr, std::shared_ptr in_window_ptr, + bool in_mt_safe, bool* out_safe_to_use_ptr) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT), + MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), m_height (0), m_instance_ptr (in_instance_ptr), + m_stream_index (UINT32_MAX), m_surface (VK_NULL_HANDLE), m_type (RENDERING_SURFACE_TYPE_GENERAL), m_width (0), @@ -61,9 +64,13 @@ Anvil::RenderingSurface::~RenderingSurface() { std::shared_ptr instance_locked_ptr(m_instance_ptr); - m_instance_ptr->get_extension_khr_surface_entrypoints().vkDestroySurfaceKHR(instance_locked_ptr->get_instance_vk(), - m_surface, - nullptr /* pAllocator */); + lock(); + { + m_instance_ptr->get_extension_khr_surface_entrypoints().vkDestroySurfaceKHR(instance_locked_ptr->get_instance_vk(), + m_surface, + nullptr /* pAllocator */); + } + unlock(); m_surface = VK_NULL_HANDLE; } @@ -73,9 +80,10 @@ Anvil::RenderingSurface::~RenderingSurface() void Anvil::RenderingSurface::cache_surface_properties() { std::shared_ptr device_locked_ptr (m_device_ptr); - auto khr_surface_entrypoints (m_instance_ptr->get_extension_khr_surface_entrypoints() ); + const Anvil::DeviceType& device_type (device_locked_ptr->get_type() ); bool is_offscreen_rendering_enabled(true); - VkPhysicalDevice physical_device_vk (VK_NULL_HANDLE); + auto khr_surface_entrypoints (m_instance_ptr->get_extension_khr_surface_entrypoints() ); + uint32_t n_physical_devices (0); std::shared_ptr sgpu_device_locked_ptr (std::dynamic_pointer_cast(device_locked_ptr)); std::vector supported_formats; @@ -103,6 +111,16 @@ void Anvil::RenderingSurface::cache_surface_properties() /* In this case, width & height may change at run-time */ } + switch (device_type) + { + case Anvil::DEVICE_TYPE_SINGLE_GPU: n_physical_devices = 1; break; + + default: + { + anvil_assert_fail(); + } + } + /* Retrieve general properties */ uint32_t n_supported_formats (0); uint32_t n_supported_presentation_modes(0); @@ -110,98 +128,112 @@ void Anvil::RenderingSurface::cache_surface_properties() ANVIL_REDUNDANT_VARIABLE(result); - std::shared_ptr physical_device_locked_ptr(sgpu_device_locked_ptr->get_physical_device()); - - auto& result_caps = m_physical_device_capabilities[0]; - - if (is_offscreen_rendering_enabled) + for (uint32_t n_physical_device = 0; + n_physical_device < n_physical_devices; + ++n_physical_device) { - result_caps.supported_composite_alpha_flags = VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR; - result_caps.supported_transformations = VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR; - result_caps.supported_usages = static_cast (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | - VK_IMAGE_USAGE_TRANSFER_SRC_BIT | - VK_IMAGE_USAGE_TRANSFER_DST_BIT | - VK_IMAGE_USAGE_STORAGE_BIT); - - goto end; - } + std::shared_ptr physical_device_locked_ptr; - physical_device_vk = physical_device_locked_ptr->get_physical_device(); - - result = khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physical_device_vk, - m_surface, - &result_caps.capabilities); + switch (device_type) + { + case Anvil::DEVICE_TYPE_SINGLE_GPU: physical_device_locked_ptr = sgpu_device_locked_ptr->get_physical_device().lock(); break; - anvil_assert_vk_call_succeeded(result); + default: + { + anvil_assert_fail(); + } + } - m_height = result_caps.capabilities.currentExtent.height; - m_width = result_caps.capabilities.currentExtent.width; + auto& result_caps = m_physical_device_capabilities.at(0); - result_caps.supported_composite_alpha_flags = static_cast (result_caps.capabilities.supportedCompositeAlpha); - result_caps.supported_transformations = static_cast(result_caps.capabilities.supportedTransforms); - result_caps.supported_usages = static_cast (result_caps.capabilities.supportedUsageFlags); + if (is_offscreen_rendering_enabled) + { + result_caps.supported_composite_alpha_flags = VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR; + result_caps.supported_transformations = VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR; + result_caps.supported_usages = static_cast (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | + VK_IMAGE_USAGE_TRANSFER_SRC_BIT | + VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_STORAGE_BIT); + + continue; + } - /* Retrieve a list of formats supported by the surface */ - result = khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceFormatsKHR(physical_device_vk, - m_surface, - &n_supported_formats, - nullptr /* pSurfaceFormats */); + const VkPhysicalDevice physical_device_vk = physical_device_locked_ptr->get_physical_device(); - anvil_assert (n_supported_formats > 0); - anvil_assert_vk_call_succeeded(result); + result = khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physical_device_vk, + m_surface, + &result_caps.capabilities); - supported_formats.resize(n_supported_formats); + anvil_assert_vk_call_succeeded(result); - result = khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceFormatsKHR(physical_device_vk, - m_surface, - &n_supported_formats, - &supported_formats.at(0) ); - anvil_assert_vk_call_succeeded(result); + if (n_physical_device == 0) + { + m_height = result_caps.capabilities.currentExtent.height; + m_width = result_caps.capabilities.currentExtent.width; + } + else + { + anvil_assert(m_height == result_caps.capabilities.currentExtent.height); + anvil_assert(m_width == result_caps.capabilities.currentExtent.width); + } - for (unsigned int n_format = 0; - n_format < n_supported_formats; - ++n_format) - { - result_caps.supported_formats.push_back(RenderingSurfaceFormat(supported_formats[n_format]) ); - } + result_caps.supported_composite_alpha_flags = static_cast (result_caps.capabilities.supportedCompositeAlpha); + result_caps.supported_transformations = static_cast(result_caps.capabilities.supportedTransforms); + result_caps.supported_usages = static_cast (result_caps.capabilities.supportedUsageFlags); - /* Retrieve a list of supported presentation modes */ - result = khr_surface_entrypoints.vkGetPhysicalDeviceSurfacePresentModesKHR(physical_device_vk, - m_surface, - &n_supported_presentation_modes, - nullptr /* pPresentModes */); + /* Retrieve a list of formats supported by the surface */ + result = khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceFormatsKHR(physical_device_vk, + m_surface, + &n_supported_formats, + nullptr /* pSurfaceFormats */); - anvil_assert (n_supported_presentation_modes > 0); - anvil_assert_vk_call_succeeded(result); + anvil_assert (n_supported_formats > 0); + anvil_assert_vk_call_succeeded(result); - result_caps.supported_presentation_modes.resize(n_supported_presentation_modes); + supported_formats.resize(n_supported_formats); - result = khr_surface_entrypoints.vkGetPhysicalDeviceSurfacePresentModesKHR(physical_device_vk, - m_surface, - &n_supported_presentation_modes, - &result_caps.supported_presentation_modes[0]); - anvil_assert_vk_call_succeeded(result); + result = khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceFormatsKHR(physical_device_vk, + m_surface, + &n_supported_formats, + &supported_formats.at(0) ); + anvil_assert_vk_call_succeeded(result); - if (n_supported_presentation_modes > 0) - { - result_caps.supported_presentation_modes.resize(n_supported_presentation_modes); + for (unsigned int n_format = 0; + n_format < n_supported_formats; + ++n_format) + { + result_caps.supported_formats.push_back(RenderingSurfaceFormat(supported_formats[n_format]) ); + } + /* Retrieve a list of supported presentation modes */ result = khr_surface_entrypoints.vkGetPhysicalDeviceSurfacePresentModesKHR(physical_device_vk, m_surface, &n_supported_presentation_modes, - &result_caps.supported_presentation_modes.at(0)); + nullptr /* pPresentModes */); + anvil_assert_vk_call_succeeded(result); - } -end: - ; + if (n_supported_presentation_modes > 0) + { + result_caps.supported_presentation_modes.resize(n_supported_presentation_modes); + + result = khr_surface_entrypoints.vkGetPhysicalDeviceSurfacePresentModesKHR(physical_device_vk, + m_surface, + &n_supported_presentation_modes, + &result_caps.supported_presentation_modes.at(0)); + anvil_assert_vk_call_succeeded(result); + } + } } /* Please see header for specification */ std::shared_ptr Anvil::RenderingSurface::create(std::weak_ptr in_instance_ptr, std::weak_ptr in_device_ptr, - std::shared_ptr in_window_ptr) + std::shared_ptr in_window_ptr, + MTSafety in_mt_safety) { + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); std::shared_ptr result_ptr; bool success = false; @@ -209,6 +241,7 @@ std::shared_ptr Anvil::RenderingSurface::create(std::we new Anvil::RenderingSurface(in_instance_ptr, in_device_ptr, in_window_ptr, + mt_safe, &success) ); if (!success) @@ -308,8 +341,9 @@ bool Anvil::RenderingSurface::get_supported_usages(std::weak_ptr device_locked_ptr (m_device_ptr); + const Anvil::DeviceType& device_type (device_locked_ptr->get_type() ); bool init_successful (false); - uint32_t n_physical_devices (1); + uint32_t n_physical_devices (0); VkResult result (VK_SUCCESS); const WindowPlatform window_platform ((m_type == RENDERING_SURFACE_TYPE_GENERAL) ? m_window_ptr.lock()->get_platform() : WINDOW_PLATFORM_UNKNOWN); @@ -317,11 +351,22 @@ bool Anvil::RenderingSurface::init() const bool is_dummy_window_platform(window_platform == WINDOW_PLATFORM_DUMMY || window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS); - for (uint32_t n_physical_device = 0; - n_physical_device < n_physical_devices; - ++n_physical_device) + + switch (device_type) { - m_physical_device_capabilities[n_physical_device] = PhysicalDeviceCapabilities(); + case Anvil::DEVICE_TYPE_SINGLE_GPU: + { + n_physical_devices = 1; + + break; + } + + default: + { + anvil_assert_fail(); + + goto end; + } } @@ -329,97 +374,128 @@ bool Anvil::RenderingSurface::init() { std::shared_ptr instance_locked_ptr(m_instance_ptr); - #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) || defined(ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT) + switch (m_type) { - if (m_type == RENDERING_SURFACE_TYPE_GENERAL) - { - #ifdef _WIN32 + #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) || defined(ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT) + case RENDERING_SURFACE_TYPE_GENERAL: { - VkWin32SurfaceCreateInfoKHR surface_create_info; + #ifdef _WIN32 + { + VkWin32SurfaceCreateInfoKHR surface_create_info; + + surface_create_info.flags = 0; + surface_create_info.hinstance = GetModuleHandle(nullptr); + surface_create_info.hwnd = m_window_ptr.lock()->get_handle(); + surface_create_info.pNext = nullptr; + surface_create_info.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR; + + result = m_instance_ptr->get_extension_khr_win32_surface_entrypoints().vkCreateWin32SurfaceKHR(instance_locked_ptr->get_instance_vk(), + &surface_create_info, + nullptr, /* pAllocator */ + &m_surface); + } + #else + { + VkXcbSurfaceCreateInfoKHR surface_create_info; - surface_create_info.flags = 0; - surface_create_info.hinstance = GetModuleHandle(nullptr); - surface_create_info.hwnd = m_window_ptr.lock()->get_handle(); - surface_create_info.pNext = nullptr; - surface_create_info.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR; + surface_create_info.flags = 0; + surface_create_info.window = m_window_ptr.lock()->get_handle(); + surface_create_info.connection = static_cast(m_window_ptr.lock()->get_connection()); + surface_create_info.pNext = nullptr; + surface_create_info.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR; - result = m_instance_ptr->get_extension_khr_win32_surface_entrypoints().vkCreateWin32SurfaceKHR(instance_locked_ptr->get_instance_vk(), + result = m_instance_ptr->get_extension_khr_xcb_surface_entrypoints().vkCreateXcbSurfaceKHR(instance_locked_ptr->get_instance_vk(), &surface_create_info, nullptr, /* pAllocator */ &m_surface); + } + #endif + + break; } - #else - { - VkXcbSurfaceCreateInfoKHR surface_create_info; - - surface_create_info.flags = 0; - surface_create_info.window = m_window_ptr.lock()->get_handle(); - surface_create_info.connection = static_cast(m_window_ptr.lock()->get_connection()); - surface_create_info.pNext = nullptr; - surface_create_info.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR; - - result = m_instance_ptr->get_extension_khr_xcb_surface_entrypoints().vkCreateXcbSurfaceKHR(instance_locked_ptr->get_instance_vk(), - &surface_create_info, - nullptr, /* pAllocator */ - &m_surface); - } - #endif - } - else + #endif + + default: { anvil_assert_fail(); - } - anvil_assert_vk_call_succeeded(result); - if (is_vk_call_successful(result) ) - { - set_vk_handle(m_surface); + goto end; } } - #endif + + anvil_assert_vk_call_succeeded(result); + if (is_vk_call_successful(result) ) + { + set_vk_handle(m_surface); + } } else { anvil_assert(window_platform != WINDOW_PLATFORM_UNKNOWN); } - if (is_dummy_window_platform == false) + if ((is_dummy_window_platform == false) ) { /* Is there at least one queue fam that can be used together with at least one physical device associated with * the logical device to present using the surface we've just spawned and the physical device user has specified? */ - const auto& queue_families (device_locked_ptr->get_physical_device_queue_families() ); - std::shared_ptr sgpu_device_locked_ptr(std::dynamic_pointer_cast(device_locked_ptr) ); - auto physical_device_locked_ptr = sgpu_device_locked_ptr->get_physical_device().lock(); - auto physical_device_caps_ptr = &m_physical_device_capabilities[0]; + const auto& queue_families(device_locked_ptr->get_physical_device_queue_families() ); - switch (m_type) + for (uint32_t n_physical_device = 0; + n_physical_device < n_physical_devices; + ++n_physical_device) { - case Anvil::RENDERING_SURFACE_TYPE_GENERAL: + Anvil::RenderingSurface::PhysicalDeviceCapabilities* physical_device_caps_ptr = nullptr; + std::shared_ptr physical_device_locked_ptr; + + switch (device_type) { - for (uint32_t n_queue_family = 0; - n_queue_family < static_cast(queue_families.size() ); - ++n_queue_family) + case Anvil::DEVICE_TYPE_SINGLE_GPU: { - VkBool32 is_presentation_supported = VK_FALSE; + std::shared_ptr sgpu_device_locked_ptr(std::dynamic_pointer_cast(device_locked_ptr) ); - result = vkGetPhysicalDeviceSurfaceSupportKHR(physical_device_locked_ptr->get_physical_device(), - n_queue_family, - m_surface, - &is_presentation_supported); + physical_device_locked_ptr = sgpu_device_locked_ptr->get_physical_device().lock(); + physical_device_caps_ptr = &m_physical_device_capabilities[0]; - if (is_vk_call_successful(result) && - is_presentation_supported == VK_TRUE) - { - physical_device_caps_ptr->present_capable_queue_fams.push_back(n_queue_family); - } + break; } - break; + default: + { + anvil_assert_fail(); + + goto end; + } } - default: + switch (m_type) { - anvil_assert_fail(); + case Anvil::RENDERING_SURFACE_TYPE_GENERAL: + { + for (uint32_t n_queue_family = 0; + n_queue_family < static_cast(queue_families.size() ); + ++n_queue_family) + { + VkBool32 is_presentation_supported = VK_FALSE; + + result = vkGetPhysicalDeviceSurfaceSupportKHR(physical_device_locked_ptr->get_physical_device(), + n_queue_family, + m_surface, + &is_presentation_supported); + + if (is_vk_call_successful(result) && + is_presentation_supported == VK_TRUE) + { + physical_device_caps_ptr->present_capable_queue_fams.push_back(n_queue_family); + } + } + + break; + } + + default: + { + anvil_assert_fail(); + } } } } @@ -430,14 +506,29 @@ bool Anvil::RenderingSurface::init() n_physical_device < n_physical_devices; ++n_physical_device) { - std::shared_ptr sgpu_device_locked_ptr(std::dynamic_pointer_cast(device_locked_ptr) ); - - if (sgpu_device_locked_ptr->get_n_universal_queues() > 0) + switch (device_type) { - std::shared_ptr physical_device_locked_ptr = sgpu_device_locked_ptr->get_physical_device().lock(); - auto& result_caps = m_physical_device_capabilities[0]; + case Anvil::DEVICE_TYPE_SINGLE_GPU: + { + std::shared_ptr sgpu_device_locked_ptr(std::dynamic_pointer_cast(device_locked_ptr) ); + + if (sgpu_device_locked_ptr->get_n_universal_queues() > 0) + { + std::shared_ptr physical_device_locked_ptr = sgpu_device_locked_ptr->get_physical_device().lock(); + auto& result_caps = m_physical_device_capabilities[0]; + + result_caps.present_capable_queue_fams.push_back(sgpu_device_locked_ptr->get_universal_queue(0)->get_queue_family_index() ); + } - result_caps.present_capable_queue_fams.push_back(sgpu_device_locked_ptr->get_universal_queue(0)->get_queue_family_index() ); + break; + } + + default: + { + anvil_assert_fail(); + + goto end; + } } } @@ -458,6 +549,7 @@ bool Anvil::RenderingSurface::init() init_successful = true; } +end: return init_successful; } diff --git a/src/wrappers/sampler.cpp b/src/wrappers/sampler.cpp index 69c8b85f..fa438c25 100644 --- a/src/wrappers/sampler.cpp +++ b/src/wrappers/sampler.cpp @@ -41,9 +41,11 @@ Anvil::Sampler::Sampler(std::weak_ptr in_device_ptr, float in_min_lod, float in_max_lod, VkBorderColor in_border_color, - bool in_use_unnormalized_coordinates) + bool in_use_unnormalized_coordinates, + bool in_mt_safe) :DebugMarkerSupportProvider (in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT), + MTSafetySupportProvider (in_mt_safe), m_address_mode_u (in_address_mode_u), m_address_mode_v (in_address_mode_v), m_address_mode_w (in_address_mode_w), @@ -56,6 +58,7 @@ Anvil::Sampler::Sampler(std::weak_ptr in_device_ptr, m_max_anisotropy (in_max_anisotropy), m_max_lod (in_max_lod), m_min_filter (in_min_filter), + m_min_lod (in_min_lod), m_mipmap_mode (in_mipmap_mode), m_sampler (VK_NULL_HANDLE), m_use_unnormalized_coordinates(in_use_unnormalized_coordinates) @@ -112,9 +115,13 @@ Anvil::Sampler::~Sampler() { std::shared_ptr device_locked_ptr(m_device_ptr); - vkDestroySampler(device_locked_ptr->get_device_vk(), - m_sampler, - nullptr /* pAllocator */); + lock(); + { + vkDestroySampler(device_locked_ptr->get_device_vk(), + m_sampler, + nullptr /* pAllocator */); + } + unlock(); m_sampler = VK_NULL_HANDLE; } @@ -135,9 +142,12 @@ std::shared_ptr Anvil::Sampler::create(std::weak_ptr device_locked_ptr(in_device_ptr); + const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); std::shared_ptr result_ptr; result_ptr.reset( @@ -155,7 +165,8 @@ std::shared_ptr Anvil::Sampler::create(std::weak_ptr in_device_ptr) +Anvil::Semaphore::Semaphore(std::weak_ptr in_device_ptr, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT), + MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), m_semaphore (VK_NULL_HANDLE) { @@ -48,12 +50,16 @@ Anvil::Semaphore::~Semaphore() } /** Please see header for specification */ -std::shared_ptr Anvil::Semaphore::create(std::weak_ptr in_device_ptr) +std::shared_ptr Anvil::Semaphore::create(std::weak_ptr in_device_ptr, + MTSafety in_mt_safety) { + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); std::shared_ptr result_ptr; result_ptr.reset( - new Anvil::Semaphore(in_device_ptr) + new Anvil::Semaphore(in_device_ptr, + mt_safe) ); return result_ptr; @@ -66,9 +72,13 @@ void Anvil::Semaphore::release_semaphore() { std::shared_ptr device_locked_ptr(m_device_ptr); - vkDestroySemaphore(device_locked_ptr->get_device_vk(), - m_semaphore, - nullptr /* pAllocator */); + lock(); + { + vkDestroySemaphore(device_locked_ptr->get_device_vk(), + m_semaphore, + nullptr /* pAllocator */); + } + unlock(); m_semaphore = VK_NULL_HANDLE; set_vk_handle(m_semaphore); diff --git a/src/wrappers/shader_module.cpp b/src/wrappers/shader_module.cpp index 1743dac3..8d6f2aff 100644 --- a/src/wrappers/shader_module.cpp +++ b/src/wrappers/shader_module.cpp @@ -35,9 +35,11 @@ /** Please see header for specification */ Anvil::ShaderModule::ShaderModule(std::weak_ptr in_device_ptr, - std::shared_ptr in_spirv_generator_ptr) + std::shared_ptr in_spirv_generator_ptr, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT), + MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), m_device_raw_ptr (in_device_ptr.lock().get() ) { @@ -74,9 +76,11 @@ Anvil::ShaderModule::ShaderModule(std::weak_ptr in_device_ptr const std::string& in_gs_entrypoint_name, const std::string& in_tc_entrypoint_name, const std::string& in_te_entrypoint_name, - const std::string& in_vs_entrypoint_name) + const std::string& in_vs_entrypoint_name, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT), + MTSafetySupportProvider (in_mt_safe), m_cs_entrypoint_name (in_cs_entrypoint_name), m_device_ptr (in_device_ptr), m_device_raw_ptr (in_device_ptr.lock().get() ), @@ -116,30 +120,53 @@ Anvil::ShaderModule::~ShaderModule() /** Please see header for specification */ std::shared_ptr Anvil::ShaderModule::create_from_spirv_generator(std::weak_ptr in_device_ptr, - std::shared_ptr in_spirv_generator_ptr) + std::shared_ptr in_spirv_generator_ptr, + MTSafety in_mt_safety) { + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); std::shared_ptr result_ptr; auto shader_module_cache_ptr = in_device_ptr.lock()->get_parent_instance().lock()->get_shader_module_cache(); const auto shader_stage = in_spirv_generator_ptr->get_shader_stage(); - /* First check if a shader module with specified parameters has not already been created. If so, - * we can safely re-use it. */ - result_ptr = shader_module_cache_ptr->get_cached_shader_module(in_device_ptr, - in_spirv_generator_ptr->get_spirv_blob(), - in_spirv_generator_ptr->get_spirv_blob_size(), - (shader_stage == SHADER_STAGE_COMPUTE) ? "main" : "", - (shader_stage == SHADER_STAGE_FRAGMENT) ? "main" : "", - (shader_stage == SHADER_STAGE_GEOMETRY) ? "main" : "", - (shader_stage == SHADER_STAGE_TESSELLATION_CONTROL) ? "main" : "", - (shader_stage == SHADER_STAGE_TESSELLATION_EVALUATION) ? "main" : "", - (shader_stage == SHADER_STAGE_VERTEX) ? "main" : ""); - - if (result_ptr == nullptr) + if (shader_module_cache_ptr != nullptr) { - /* Nope? Need to create a new instance then. */ + shader_module_cache_ptr->lock(); + { + /* First check if a shader module with specified parameters has not already been created. If so, + * we can safely re-use it. */ + result_ptr = shader_module_cache_ptr->get_cached_shader_module(in_device_ptr, + in_spirv_generator_ptr->get_spirv_blob(), + in_spirv_generator_ptr->get_spirv_blob_size(), + (shader_stage == SHADER_STAGE_COMPUTE) ? "main" : "", + (shader_stage == SHADER_STAGE_FRAGMENT) ? "main" : "", + (shader_stage == SHADER_STAGE_GEOMETRY) ? "main" : "", + (shader_stage == SHADER_STAGE_TESSELLATION_CONTROL) ? "main" : "", + (shader_stage == SHADER_STAGE_TESSELLATION_EVALUATION) ? "main" : "", + (shader_stage == SHADER_STAGE_VERTEX) ? "main" : ""); + + if (result_ptr == nullptr) + { + /* Nope? Need to create a new instance then. */ + result_ptr.reset( + new Anvil::ShaderModule(in_device_ptr, + in_spirv_generator_ptr, + mt_safe) + ); + + Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_SHADER_MODULE, + result_ptr.get() ); + } + } + shader_module_cache_ptr->unlock(); + } + else + { + /* Just spawn the new instance .. */ result_ptr.reset( new Anvil::ShaderModule(in_device_ptr, - in_spirv_generator_ptr) + in_spirv_generator_ptr, + mt_safe) ); Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_SHADER_MODULE, @@ -158,26 +185,55 @@ std::shared_ptr Anvil::ShaderModule::create_from_spirv_blob const char* in_gs_entrypoint_name, const char* in_tc_entrypoint_name, const char* in_te_entrypoint_name, - const char* in_vs_entrypoint_name) + const char* in_vs_entrypoint_name, + MTSafety in_mt_safety) { + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); std::shared_ptr result_ptr; auto shader_module_cache_ptr = in_device_ptr.lock()->get_parent_instance().lock()->get_shader_module_cache(); - /* First check if a shader module with specified parameters has not already been created. If so, - * we can safely re-use it. */ - result_ptr = shader_module_cache_ptr->get_cached_shader_module(in_device_ptr, - in_spirv_blob, - in_n_spirv_blob_bytes, - in_cs_entrypoint_name, - in_fs_entrypoint_name, - in_gs_entrypoint_name, - in_tc_entrypoint_name, - in_te_entrypoint_name, - in_vs_entrypoint_name); - - if (result_ptr == nullptr) + if (shader_module_cache_ptr != nullptr) + { + shader_module_cache_ptr->lock(); + { + /* First check if a shader module with specified parameters has not already been created. If so, + * we can safely re-use it. */ + result_ptr = shader_module_cache_ptr->get_cached_shader_module(in_device_ptr, + in_spirv_blob, + in_n_spirv_blob_bytes, + in_cs_entrypoint_name, + in_fs_entrypoint_name, + in_gs_entrypoint_name, + in_tc_entrypoint_name, + in_te_entrypoint_name, + in_vs_entrypoint_name); + + if (result_ptr == nullptr) + { + /* Nope? Need to create a new instance then. */ + result_ptr.reset( + new Anvil::ShaderModule(in_device_ptr, + in_spirv_blob, + in_n_spirv_blob_bytes, + in_cs_entrypoint_name, + in_fs_entrypoint_name, + in_gs_entrypoint_name, + in_tc_entrypoint_name, + in_te_entrypoint_name, + in_vs_entrypoint_name, + mt_safe) + ); + + Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_SHADER_MODULE, + result_ptr.get() ); + } + } + shader_module_cache_ptr->unlock(); + } + else { - /* Nope? Need to create a new instance then. */ + /* Just spawn the new instance .. */ result_ptr.reset( new Anvil::ShaderModule(in_device_ptr, in_spirv_blob, @@ -187,7 +243,8 @@ std::shared_ptr Anvil::ShaderModule::create_from_spirv_blob in_gs_entrypoint_name, in_tc_entrypoint_name, in_te_entrypoint_name, - in_vs_entrypoint_name) + in_vs_entrypoint_name, + mt_safe) ); Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_SHADER_MODULE, @@ -202,9 +259,13 @@ void Anvil::ShaderModule::destroy() { if (m_module != VK_NULL_HANDLE) { - vkDestroyShaderModule(m_device_raw_ptr->get_device_vk(), - m_module, - nullptr /* pAllocator */); + lock(); + { + vkDestroyShaderModule(m_device_raw_ptr->get_device_vk(), + m_module, + nullptr /* pAllocator */); + } + unlock(); m_module = VK_NULL_HANDLE; } diff --git a/src/wrappers/swapchain.cpp b/src/wrappers/swapchain.cpp index 6f6098f9..ae2f5e9e 100644 --- a/src/wrappers/swapchain.cpp +++ b/src/wrappers/swapchain.cpp @@ -39,9 +39,11 @@ Anvil::Swapchain::Swapchain(std::weak_ptr in_device_p VkImageUsageFlags in_usage_flags, VkSwapchainCreateFlagsKHR in_flags, uint32_t in_n_images, - const ExtensionKHRSwapchainEntrypoints& in_khr_swapchain_entrypoints) + const ExtensionKHRSwapchainEntrypoints& in_khr_swapchain_entrypoints, + bool in_mt_safe) :DebugMarkerSupportProvider (in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT), + MTSafetySupportProvider (in_mt_safe), m_destroy_swapchain_before_parent_window_closes(true), m_device_ptr (in_device_ptr), m_flags (in_flags), @@ -68,7 +70,8 @@ Anvil::Swapchain::Swapchain(std::weak_ptr in_device_p m_image_view_ptrs.resize(in_n_images); m_image_available_fence_ptr = Anvil::Fence::create(m_device_ptr, - false /* create_signalled */); + false, /* create_signalled */ + Anvil::Utils::convert_boolean_to_mt_safety_enum(in_mt_safe) ); init(); @@ -98,7 +101,8 @@ Anvil::Swapchain::~Swapchain() queue_ptr->unregister_from_callbacks( QUEUE_CALLBACK_ID_PRESENT_REQUEST_ISSUED, std::bind(&Swapchain::on_present_request_issued, - this), + this, + std::placeholders::_1), this ); } @@ -115,14 +119,16 @@ Anvil::Swapchain::~Swapchain() uint32_t Anvil::Swapchain::acquire_image(std::shared_ptr in_opt_semaphore_ptr, bool in_should_block) { - std::shared_ptr device_locked_ptr = m_device_ptr.lock(); - const RenderingSurfaceType rendering_surface = m_parent_surface_ptr->get_type(); - uint32_t result = UINT32_MAX; - VkResult result_vk = VK_ERROR_INITIALIZATION_FAILED; - const WindowPlatform window_platform = m_window_ptr->get_platform(); - const bool is_offscreen_rendering_enabled = (window_platform == WINDOW_PLATFORM_DUMMY || + std::shared_ptr device_locked_ptr (m_device_ptr); + const RenderingSurfaceType rendering_surface (m_parent_surface_ptr->get_type() ); + VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); + uint32_t result (UINT32_MAX); + std::shared_ptr single_device_locked_ptr (std::dynamic_pointer_cast (device_locked_ptr) ); + std::weak_ptr physical_device_ptr (single_device_locked_ptr->get_physical_device() ); + const WindowPlatform window_platform (m_window_ptr->get_platform() ); + const bool is_offscreen_rendering_enabled((window_platform == WINDOW_PLATFORM_DUMMY || window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS) && - (rendering_surface == Anvil::RENDERING_SURFACE_TYPE_GENERAL); + (rendering_surface == Anvil::RENDERING_SURFACE_TYPE_GENERAL) ); ANVIL_REDUNDANT_VARIABLE(result_vk); @@ -130,38 +136,54 @@ uint32_t Anvil::Swapchain::acquire_image(std::shared_ptr in_op { VkFence fence_handle = VK_NULL_HANDLE; - if (in_should_block) + if (in_opt_semaphore_ptr != nullptr) { - m_image_available_fence_ptr->reset(); - - fence_handle = m_image_available_fence_ptr->get_fence(); + in_opt_semaphore_ptr->lock(); } - result_vk = m_khr_swapchain_entrypoints.vkAcquireNextImageKHR(device_locked_ptr->get_device_vk(), - m_swapchain, - UINT64_MAX, - in_opt_semaphore_ptr->get_semaphore(), - fence_handle, - &result); + m_image_available_fence_ptr->lock(); + lock(); + { + if (in_should_block) + { + m_image_available_fence_ptr->reset(); - anvil_assert_vk_call_succeeded(result_vk); + fence_handle = m_image_available_fence_ptr->get_fence(); + } - if (fence_handle != VK_NULL_HANDLE) - { - result_vk = vkWaitForFences(device_locked_ptr->get_device_vk(), - 1, /* fenceCount */ - &fence_handle, - VK_TRUE, /* waitAll */ - UINT64_MAX); + result_vk = m_khr_swapchain_entrypoints.vkAcquireNextImageKHR(device_locked_ptr->get_device_vk(), + m_swapchain, + UINT64_MAX, + in_opt_semaphore_ptr->get_semaphore(), + fence_handle, + &result); + + if (fence_handle != VK_NULL_HANDLE) + { + result_vk = vkWaitForFences(device_locked_ptr->get_device_vk(), + 1, /* fenceCount */ + &fence_handle, + VK_TRUE, /* waitAll */ + UINT64_MAX); + + anvil_assert_vk_call_succeeded(result_vk); + } + } + unlock(); + m_image_available_fence_ptr->unlock(); - anvil_assert_vk_call_succeeded(result_vk); + if (in_opt_semaphore_ptr != nullptr) + { + in_opt_semaphore_ptr->unlock(); } + + anvil_assert_vk_call_succeeded(result_vk); } else { if (in_should_block) { - vkDeviceWaitIdle(m_device_ptr.lock()->get_device_vk() ); + m_device_ptr.lock()->wait_idle(); } if (in_opt_semaphore_ptr != nullptr) @@ -193,8 +215,11 @@ std::shared_ptr Anvil::Swapchain::create(std::weak_ptr result_ptr; result_ptr.reset( @@ -206,7 +231,8 @@ std::shared_ptr Anvil::Swapchain::create(std::weak_ptr device_locked_ptr(m_device_ptr); - m_khr_swapchain_entrypoints.vkDestroySwapchainKHR(device_locked_ptr->get_device_vk(), - m_swapchain, - nullptr /* pAllocator */); + lock(); + { + m_khr_swapchain_entrypoints.vkDestroySwapchainKHR(device_locked_ptr->get_device_vk(), + m_swapchain, + nullptr /* pAllocator */); + } + unlock(); m_swapchain = VK_NULL_HANDLE; } @@ -287,7 +317,8 @@ void Anvil::Swapchain::init() #ifdef _DEBUG { - uint32_t n_physical_devices = 1; + const Anvil::DeviceType device_type = device_locked_ptr->get_type(); + uint32_t n_physical_devices = 0; bool result_bool = false; const char* required_surface_extension_name = nullptr; VkSurfaceCapabilitiesKHR surface_caps; @@ -307,11 +338,31 @@ void Anvil::Swapchain::init() anvil_assert(required_surface_extension_name == nullptr || m_device_ptr.lock()->get_parent_instance().lock()->is_instance_extension_supported(required_surface_extension_name) ); + switch (device_type) + { + case Anvil::DEVICE_TYPE_SINGLE_GPU: n_physical_devices = 1; break; + + default: + { + anvil_assert_fail(); + } + } + for (uint32_t n_physical_device = 0; n_physical_device < n_physical_devices; ++n_physical_device) { - std::shared_ptr current_physical_device_ptr(sgpu_device_locked_ptr->get_physical_device() ); + std::shared_ptr current_physical_device_ptr; + + switch (device_type) + { + case Anvil::DEVICE_TYPE_SINGLE_GPU: current_physical_device_ptr = sgpu_device_locked_ptr->get_physical_device().lock(); break; + + default: + { + anvil_assert_fail(); + } + } /* Ensure opaque composite alpha mode is supported */ anvil_assert(m_parent_surface_ptr->get_supported_composite_alpha_flags(current_physical_device_ptr, @@ -361,10 +412,15 @@ void Anvil::Swapchain::init() create_info.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR; create_info.surface = m_parent_surface_ptr->get_surface(); - result = m_khr_swapchain_entrypoints.vkCreateSwapchainKHR(device_locked_ptr->get_device_vk(), - &create_info, - nullptr, /* pAllocator */ - &m_swapchain); + m_parent_surface_ptr->lock(); + { + result = m_khr_swapchain_entrypoints.vkCreateSwapchainKHR(device_locked_ptr->get_device_vk(), + &create_info, + nullptr, /* pAllocator */ + &m_swapchain); + } + m_parent_surface_ptr->unlock(); + anvil_assert_vk_call_succeeded(result); if (is_vk_call_successful(result) ) { @@ -407,7 +463,8 @@ void Anvil::Swapchain::init() */ m_image_ptrs[n_result_image] = Anvil::Image::create_nonsparse(m_device_ptr, create_info, - swapchain_images[n_result_image]); + swapchain_images[n_result_image], + Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() ) ); } else { @@ -427,7 +484,8 @@ void Anvil::Swapchain::init() 0, /* in_memory_features */ 0, /* in_create_flags */ VK_IMAGE_LAYOUT_GENERAL, - nullptr); + nullptr, + Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() ) ); } /* For each swap-chain image, create a relevant view */ @@ -441,7 +499,8 @@ void Anvil::Swapchain::init() VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_G, VK_COMPONENT_SWIZZLE_B, - VK_COMPONENT_SWIZZLE_A); + VK_COMPONENT_SWIZZLE_A, + Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() ) ); } /* Sign up for present submission notifications. This is needed to ensure that number of presented frames == @@ -450,42 +509,50 @@ void Anvil::Swapchain::init() { std::vector > queues; - const std::vector* queue_fams_with_present_support_ptr(nullptr); - std::shared_ptr sgpu_device_locked_ptr (std::dynamic_pointer_cast(device_locked_ptr) ); - auto physical_device_ptr (sgpu_device_locked_ptr->get_physical_device() ); - - if (!m_parent_surface_ptr->get_queue_families_with_present_support(physical_device_ptr, - &queue_fams_with_present_support_ptr) ) - { - anvil_assert_fail(); - } - - if (queue_fams_with_present_support_ptr == nullptr) - { - anvil_assert(queue_fams_with_present_support_ptr != nullptr); - } - else + switch (device_locked_ptr->get_type() ) { - for (const auto queue_fam : *queue_fams_with_present_support_ptr) + case Anvil::DEVICE_TYPE_SINGLE_GPU: { - const uint32_t n_queues = sgpu_device_locked_ptr->get_n_queues(queue_fam); + const std::vector* queue_fams_with_present_support_ptr(nullptr); + std::shared_ptr sgpu_device_locked_ptr (std::dynamic_pointer_cast(device_locked_ptr) ); + auto physical_device_ptr (sgpu_device_locked_ptr->get_physical_device() ); - for (uint32_t n_queue = 0; - n_queue < n_queues; - ++n_queue) + if (!m_parent_surface_ptr->get_queue_families_with_present_support(physical_device_ptr, + &queue_fams_with_present_support_ptr) ) { - auto queue_ptr = sgpu_device_locked_ptr->get_queue(queue_fam, - n_queue); - - anvil_assert(queue_ptr != nullptr); + break; + } - if (std::find(queues.begin(), - queues.end(), - queue_ptr) == queues.end() ) + if (queue_fams_with_present_support_ptr == nullptr) + { + anvil_assert(queue_fams_with_present_support_ptr != nullptr); + } + else + { + for (const auto queue_fam : *queue_fams_with_present_support_ptr) { - queues.push_back(queue_ptr); + const uint32_t n_queues = sgpu_device_locked_ptr->get_n_queues(queue_fam); + + for (uint32_t n_queue = 0; + n_queue < n_queues; + ++n_queue) + { + auto queue_ptr = sgpu_device_locked_ptr->get_queue(queue_fam, + n_queue); + + anvil_assert(queue_ptr != nullptr); + + if (std::find(queues.begin(), + queues.end(), + queue_ptr) == queues.end() ) + { + queues.push_back(queue_ptr); + } + } } } + + break; } } @@ -494,7 +561,8 @@ void Anvil::Swapchain::init() queue_ptr->register_for_callbacks( QUEUE_CALLBACK_ID_PRESENT_REQUEST_ISSUED, std::bind(&Swapchain::on_present_request_issued, - this), + this, + std::placeholders::_1), this ); @@ -523,7 +591,16 @@ void Anvil::Swapchain::on_parent_window_about_to_close() } /** TODO */ -void Anvil::Swapchain::on_present_request_issued() +void Anvil::Swapchain::on_present_request_issued(Anvil::CallbackArgument* in_callback_raw_ptr) { - m_n_present_counter++; + auto* callback_arg_ptr = dynamic_cast(in_callback_raw_ptr); + + anvil_assert(callback_arg_ptr != nullptr); + if (callback_arg_ptr != nullptr) + { + if (callback_arg_ptr->swapchain_ptr == this) + { + m_n_present_counter++; + } + } } \ No newline at end of file From 5e543dccbddc1f0cd518d53813abfa6ad09e5c31 Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Mon, 12 Mar 2018 15:27:41 +0100 Subject: [PATCH 02/50] Major update. Address #55: Binding arrays very difficult to use Address #54: Change supported NT version to sth more reasonable Address #50: Images created with mipmap data need VK_IMAGE_USAGE_TRANSFER_DST_BIT applied Address #47: Anvil build creates config.h in source tree, not build tree. Address #30: Rethink Ownership Model for Anvil Objects? Add support for VK_AMD_shader_fragment_mask. Add support for VK_AMD_shader_image_load_store_lod. Add support for VK_KHR_bind_memory2. Add support for VK_KHR_descriptor_update_template. Add support for VK_KHR_maintenance3. Expose features and properties using dedicated structs, for cleaner integration with future Vulkan extensions. Update Vulkan headers to VK 1.1.70. --- CMakeLists.txt | 9 +- deps/glslang/CMakeLists.txt | 1 - examples/DynamicBuffers/CMakeLists.txt | 1 + examples/DynamicBuffers/include/app.h | 74 +- examples/DynamicBuffers/src/app.cpp | 292 +- examples/MultiViewport/CMakeLists.txt | 1 + examples/MultiViewport/include/app.h | 54 +- examples/MultiViewport/src/app.cpp | 223 +- examples/OcclusionQuery/CMakeLists.txt | 1 + examples/OcclusionQuery/include/app.h | 72 +- examples/OcclusionQuery/src/app.cpp | 425 +- .../OutOfOrderRasterization/CMakeLists.txt | 1 + .../OutOfOrderRasterization/include/app.h | 56 +- examples/OutOfOrderRasterization/src/app.cpp | 520 +- examples/PushConstants/CMakeLists.txt | 1 + examples/PushConstants/include/app.h | 44 +- examples/PushConstants/src/app.cpp | 232 +- include/misc/base_pipeline_info.h | 30 +- include/misc/base_pipeline_manager.h | 65 +- include/misc/callbacks.h | 46 +- include/misc/compute_pipeline_info.h | 16 +- include/misc/debug.h | 2 +- include/misc/debug_marker.h | 90 +- include/misc/descriptor_set_info.h | 107 +- include/misc/dummy_window.h | 22 +- include/misc/glsl_to_spirv.h | 42 +- include/misc/graphics_pipeline_info.h | 64 +- .../misc/memalloc_backends/backend_oneshot.h | 12 +- include/misc/memalloc_backends/backend_vma.h | 19 +- include/misc/memory_allocator.h | 227 +- include/misc/mt_safety.h | 14 +- include/misc/page_tracker.h | 36 +- include/misc/pools.h | 130 +- include/misc/render_pass_info.h | 20 +- include/misc/shader_module_cache.h | 81 +- include/misc/struct_chainer.h | 212 + include/misc/types.h | 1136 ++- include/misc/window.h | 3 +- include/misc/window_factory.h | 18 +- include/misc/window_win3264.h | 12 +- include/misc/window_xcb.h | 14 +- include/vulkan/vk_platform.h | 28 - include/vulkan/vulkan.h | 7029 +--------------- include/vulkan/vulkan_core.h | 7334 +++++++++++++++++ include/vulkan/vulkan_win32.h | 276 + include/vulkan/vulkan_xcb.h | 66 + include/wrappers/buffer.h | 115 +- include/wrappers/buffer_view.h | 38 +- include/wrappers/command_buffer.h | 796 +- include/wrappers/command_pool.h | 45 +- include/wrappers/compute_pipeline_manager.h | 16 +- include/wrappers/descriptor_pool.h | 120 +- include/wrappers/descriptor_set.h | 417 +- include/wrappers/descriptor_set_group.h | 114 +- include/wrappers/descriptor_set_layout.h | 35 +- .../wrappers/descriptor_set_layout_manager.h | 81 + include/wrappers/descriptor_update_template.h | 97 + include/wrappers/device.h | 338 +- include/wrappers/event.h | 12 +- include/wrappers/fence.h | 20 +- include/wrappers/framebuffer.h | 58 +- include/wrappers/graphics_pipeline_manager.h | 18 +- include/wrappers/image.h | 278 +- include/wrappers/image_view.h | 197 +- include/wrappers/instance.h | 45 +- include/wrappers/memory_block.h | 96 +- include/wrappers/physical_device.h | 85 +- include/wrappers/pipeline_cache.h | 24 +- include/wrappers/pipeline_layout.h | 49 +- include/wrappers/pipeline_layout_manager.h | 52 +- include/wrappers/query_pool.h | 48 +- include/wrappers/queue.h | 167 +- include/wrappers/render_pass.h | 21 +- include/wrappers/rendering_surface.h | 71 +- include/wrappers/sampler.h | 68 +- include/wrappers/semaphore.h | 12 +- include/wrappers/shader_module.h | 108 +- include/wrappers/swapchain.h | 70 +- src/misc/base_pipeline_info.cpp | 68 +- src/misc/base_pipeline_manager.cpp | 93 +- src/misc/compute_pipeline_info.cpp | 25 +- src/misc/debug_marker.cpp | 26 +- src/misc/descriptor_set_info.cpp | 200 +- src/misc/dummy_window.cpp | 108 +- src/misc/formats.cpp | 50 +- src/misc/glsl_to_spirv.cpp | 121 +- src/misc/graphics_pipeline_info.cpp | 139 +- .../memalloc_backends/backend_oneshot.cpp | 32 +- src/misc/memalloc_backends/backend_vma.cpp | 31 +- src/misc/memory_allocator.cpp | 596 +- src/misc/object_tracker.cpp | 2 + src/misc/page_tracker.cpp | 19 +- src/misc/pools.cpp | 8 +- src/misc/render_pass_info.cpp | 124 +- src/misc/shader_module_cache.cpp | 114 +- src/misc/types.cpp | 1228 ++- src/misc/window_factory.cpp | 24 +- src/misc/window_win3264.cpp | 32 +- src/misc/window_xcb.cpp | 28 +- src/wrappers/buffer.cpp | 439 +- src/wrappers/buffer_view.cpp | 43 +- src/wrappers/command_buffer.cpp | 1649 ++-- src/wrappers/command_pool.cpp | 81 +- src/wrappers/compute_pipeline_manager.cpp | 27 +- src/wrappers/descriptor_pool.cpp | 214 +- src/wrappers/descriptor_set.cpp | 711 +- src/wrappers/descriptor_set_group.cpp | 297 +- src/wrappers/descriptor_set_layout.cpp | 153 +- .../descriptor_set_layout_manager.cpp | 171 + src/wrappers/descriptor_update_template.cpp | 238 + src/wrappers/device.cpp | 683 +- src/wrappers/event.cpp | 41 +- src/wrappers/fence.cpp | 60 +- src/wrappers/framebuffer.cpp | 83 +- src/wrappers/graphics_pipeline_manager.cpp | 395 +- src/wrappers/image.cpp | 624 +- src/wrappers/image_view.cpp | 373 +- src/wrappers/instance.cpp | 79 +- src/wrappers/memory_block.cpp | 174 +- src/wrappers/physical_device.cpp | 365 +- src/wrappers/pipeline_cache.cpp | 48 +- src/wrappers/pipeline_layout.cpp | 119 +- src/wrappers/pipeline_layout_manager.cpp | 168 +- src/wrappers/query_pool.cpp | 72 +- src/wrappers/queue.cpp | 399 +- src/wrappers/render_pass.cpp | 32 +- src/wrappers/rendering_surface.cpp | 345 +- src/wrappers/sampler.cpp | 138 +- src/wrappers/semaphore.cpp | 22 +- src/wrappers/shader_module.cpp | 127 +- src/wrappers/swapchain.cpp | 296 +- 131 files changed, 18884 insertions(+), 15719 deletions(-) create mode 100644 include/misc/struct_chainer.h create mode 100644 include/vulkan/vulkan_core.h create mode 100644 include/vulkan/vulkan_win32.h create mode 100644 include/vulkan/vulkan_xcb.h create mode 100644 include/wrappers/descriptor_set_layout_manager.h create mode 100644 include/wrappers/descriptor_update_template.h create mode 100644 src/wrappers/descriptor_set_layout_manager.cpp create mode 100644 src/wrappers/descriptor_update_template.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fe5a7b2..6e7a27e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ option(ANVIL_LINK_WITH_GLSLANG "Links with glslang, instead # Do not modify anything after this line, unless you know what you're doing. -configure_file("include/config.h.in" "${Anvil_SOURCE_DIR}/include/config.h") +configure_file("include/config.h.in" "include/config.h") include_directories("$(Anvil_SOURCE_DIR)" "$(Anvil_SOURCE_DIR)/deps" @@ -54,6 +54,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/include/misc/ref_counter.h" "${Anvil_SOURCE_DIR}/include/misc/render_pass_info.h" "${Anvil_SOURCE_DIR}/include/misc/shader_module_cache.h" + "${Anvil_SOURCE_DIR}/include/misc/struct_chainer.h" "${Anvil_SOURCE_DIR}/include/misc/time.h" "${Anvil_SOURCE_DIR}/include/misc/types.h" "${Anvil_SOURCE_DIR}/include/misc/window.h" @@ -67,6 +68,8 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/include/wrappers/descriptor_set.h" "${Anvil_SOURCE_DIR}/include/wrappers/descriptor_set_group.h" "${Anvil_SOURCE_DIR}/include/wrappers/descriptor_set_layout.h" + "${Anvil_SOURCE_DIR}/include/wrappers/descriptor_set_layout_manager.h" + "${Anvil_SOURCE_DIR}/include/wrappers/descriptor_update_template.h" "${Anvil_SOURCE_DIR}/include/wrappers/device.h" "${Anvil_SOURCE_DIR}/include/wrappers/event.h" "${Anvil_SOURCE_DIR}/include/wrappers/fence.h" @@ -122,6 +125,8 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/src/wrappers/descriptor_set.cpp" "${Anvil_SOURCE_DIR}/src/wrappers/descriptor_set_group.cpp" "${Anvil_SOURCE_DIR}/src/wrappers/descriptor_set_layout.cpp" + "${Anvil_SOURCE_DIR}/src/wrappers/descriptor_set_layout_manager.cpp" + "${Anvil_SOURCE_DIR}/src/wrappers/descriptor_update_template.cpp" "${Anvil_SOURCE_DIR}/src/wrappers/device.cpp" "${Anvil_SOURCE_DIR}/src/wrappers/event.cpp" "${Anvil_SOURCE_DIR}/src/wrappers/fence.cpp" @@ -189,8 +194,10 @@ endif() # Add dependendencies if (WIN32) add_subdirectory("deps\\glslang") + add_subdirectory("deps\\glslang\\OGLCompilersDLL") else() add_subdirectory("deps/glslang") + add_subdirectory("deps/glslang/OGLCompilersDLL") endif() # Enable level-4 warnings diff --git a/deps/glslang/CMakeLists.txt b/deps/glslang/CMakeLists.txt index 21e92c00..a17e0ddb 100644 --- a/deps/glslang/CMakeLists.txt +++ b/deps/glslang/CMakeLists.txt @@ -80,7 +80,6 @@ endfunction(glslang_set_link_args) add_subdirectory(External) add_subdirectory(glslang) -add_subdirectory(OGLCompilersDLL) if(ENABLE_GLSLANG_BINARIES) add_subdirectory(StandAlone) endif() diff --git a/examples/DynamicBuffers/CMakeLists.txt b/examples/DynamicBuffers/CMakeLists.txt index 37aa1b73..1b6cfcec 100644 --- a/examples/DynamicBuffers/CMakeLists.txt +++ b/examples/DynamicBuffers/CMakeLists.txt @@ -18,6 +18,7 @@ endif() add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") +target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") include_directories(${Anvil_SOURCE_DIR}/include ${DynamicBuffers_SOURCE_DIR}/include) diff --git a/examples/DynamicBuffers/include/app.h b/examples/DynamicBuffers/include/app.h index dc358ca0..e1c4ac1c 100644 --- a/examples/DynamicBuffers/include/app.h +++ b/examples/DynamicBuffers/include/app.h @@ -66,45 +66,45 @@ class App uint32_t* out_opt_offset_data_offset_ptr = nullptr); /* Private variables */ - std::weak_ptr m_device_ptr; - std::shared_ptr m_instance_ptr; - std::weak_ptr m_physical_device_ptr; - std::shared_ptr m_present_queue_ptr; - std::shared_ptr m_rendering_surface_ptr; - std::shared_ptr m_swapchain_ptr; - Anvil::Time m_time; - std::shared_ptr m_window_ptr; - - std::shared_ptr m_consumer_dsg_ptr; - std::shared_ptr m_producer_dsg_ptr; - - std::shared_ptr m_consumer_fs_ptr; - std::shared_ptr m_consumer_vs_ptr; - std::shared_ptr m_producer_cs_ptr; - - Anvil::PipelineID m_consumer_pipeline_id; - std::shared_ptr m_consumer_render_pass_ptr; - Anvil::PipelineID m_producer_pipeline_id; - - std::shared_ptr m_command_buffers [N_SWAPCHAIN_IMAGES]; - std::shared_ptr m_depth_images [N_SWAPCHAIN_IMAGES]; - std::shared_ptr m_depth_image_views[N_SWAPCHAIN_IMAGES]; - std::shared_ptr m_fbos [N_SWAPCHAIN_IMAGES]; - - std::shared_ptr m_sine_color_buffer_ptr; /* N_SINE_PAIRS * 2 * vec2; data stored as R8G8_UNORM */ - VkDeviceSize m_sine_color_buffer_size; - std::shared_ptr m_sine_data_buffer_ptr; - std::vector m_sine_data_buffer_offsets; - VkDeviceSize m_sine_data_buffer_size; - std::shared_ptr m_sine_offset_data_buffer_ptr; - std::vector m_sine_offset_data_buffer_offsets; - VkDeviceSize m_sine_offset_data_buffer_size; - std::shared_ptr m_sine_props_data_buffer_ptr; - VkDeviceSize m_sine_props_data_buffer_size_per_swapchain_image; + Anvil::SGPUDeviceUniquePtr m_device_ptr; + Anvil::InstanceUniquePtr m_instance_ptr; + const Anvil::PhysicalDevice* m_physical_device_ptr; + Anvil::Queue* m_present_queue_ptr; + Anvil::RenderingSurfaceUniquePtr m_rendering_surface_ptr; + Anvil::SwapchainUniquePtr m_swapchain_ptr; + Anvil::Time m_time; + Anvil::WindowUniquePtr m_window_ptr; + + Anvil::DescriptorSetGroupUniquePtr m_consumer_dsg_ptr; + Anvil::DescriptorSetGroupUniquePtr m_producer_dsg_ptr; + + std::unique_ptr m_consumer_fs_ptr; + std::unique_ptr m_consumer_vs_ptr; + std::unique_ptr m_producer_cs_ptr; + + Anvil::PipelineID m_consumer_pipeline_id; + Anvil::RenderPassUniquePtr m_consumer_render_pass_ptr; + Anvil::PipelineID m_producer_pipeline_id; + + Anvil::PrimaryCommandBufferUniquePtr m_command_buffers [N_SWAPCHAIN_IMAGES]; + Anvil::ImageUniquePtr m_depth_images [N_SWAPCHAIN_IMAGES]; + Anvil::ImageViewUniquePtr m_depth_image_views[N_SWAPCHAIN_IMAGES]; + Anvil::FramebufferUniquePtr m_fbos [N_SWAPCHAIN_IMAGES]; + + Anvil::BufferUniquePtr m_sine_color_buffer_ptr; /* N_SINE_PAIRS * 2 * vec2; data stored as R8G8_UNORM */ + VkDeviceSize m_sine_color_buffer_size; + Anvil::BufferUniquePtr m_sine_data_buffer_ptr; + std::vector m_sine_data_buffer_offsets; + VkDeviceSize m_sine_data_buffer_size; + Anvil::BufferUniquePtr m_sine_offset_data_buffer_ptr; + std::vector m_sine_offset_data_buffer_offsets; + VkDeviceSize m_sine_offset_data_buffer_size; + Anvil::BufferUniquePtr m_sine_props_data_buffer_ptr; + VkDeviceSize m_sine_props_data_buffer_size_per_swapchain_image; uint32_t m_n_last_semaphore_used; const uint32_t m_n_swapchain_images; - std::vector > m_frame_signal_semaphores; - std::vector > m_frame_wait_semaphores; + std::vector m_frame_signal_semaphores; + std::vector m_frame_wait_semaphores; }; diff --git a/examples/DynamicBuffers/src/app.cpp b/examples/DynamicBuffers/src/app.cpp index 70accf98..b1ef0613 100644 --- a/examples/DynamicBuffers/src/app.cpp +++ b/examples/DynamicBuffers/src/app.cpp @@ -182,8 +182,10 @@ static const char* g_glsl_producer_comp = App::App() - :m_n_last_semaphore_used(0), - m_n_swapchain_images (N_SWAPCHAIN_IMAGES) + :m_consumer_pipeline_id (UINT32_MAX), + m_n_last_semaphore_used(0), + m_n_swapchain_images (N_SWAPCHAIN_IMAGES), + m_producer_pipeline_id (UINT32_MAX) { // .. } @@ -195,7 +197,24 @@ App::~App() void App::deinit() { - vkDeviceWaitIdle(m_device_ptr.lock()->get_device_vk() ); + auto compute_pipeline_manager_ptr = m_device_ptr->get_compute_pipeline_manager (); + auto gfx_pipeline_manager_ptr = m_device_ptr->get_graphics_pipeline_manager(); + + vkDeviceWaitIdle(m_device_ptr->get_device_vk() ); + + if (m_consumer_pipeline_id != UINT32_MAX) + { + gfx_pipeline_manager_ptr->delete_pipeline(m_consumer_pipeline_id); + + m_consumer_pipeline_id = UINT32_MAX; + } + + if (m_producer_pipeline_id != UINT32_MAX) + { + compute_pipeline_manager_ptr->delete_pipeline(m_producer_pipeline_id); + + m_producer_pipeline_id = UINT32_MAX; + } m_frame_signal_semaphores.clear(); m_frame_wait_semaphores.clear(); @@ -239,33 +258,29 @@ void App::deinit() m_sine_offset_data_buffer_ptr.reset(); m_sine_props_data_buffer_ptr.reset(); - m_present_queue_ptr.reset(); m_rendering_surface_ptr.reset(); m_swapchain_ptr.reset(); m_window_ptr.reset(); - m_device_ptr.lock()->destroy(); m_device_ptr.reset(); - m_instance_ptr->destroy(); m_instance_ptr.reset(); } void App::draw_frame() { - std::shared_ptr curr_frame_signal_semaphore_ptr; - std::shared_ptr curr_frame_wait_semaphore_ptr; - std::shared_ptr device_locked_ptr = m_device_ptr.lock(); - static uint32_t n_frames_rendered = 0; - uint32_t n_swapchain_image; - std::shared_ptr present_wait_semaphore_ptr; - const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; + Anvil::Semaphore* curr_frame_signal_semaphore_ptr = nullptr; + Anvil::Semaphore* curr_frame_wait_semaphore_ptr = nullptr; + static uint32_t n_frames_rendered = 0; + uint32_t n_swapchain_image; + Anvil::Semaphore* present_wait_semaphore_ptr = nullptr; + const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; /* Determine the signal + wait semaphores to use for drawing this frame */ m_n_last_semaphore_used = (m_n_last_semaphore_used + 1) % m_n_swapchain_images; - curr_frame_signal_semaphore_ptr = m_frame_signal_semaphores[m_n_last_semaphore_used]; - curr_frame_wait_semaphore_ptr = m_frame_wait_semaphores [m_n_last_semaphore_used]; + curr_frame_signal_semaphore_ptr = m_frame_signal_semaphores[m_n_last_semaphore_used].get(); + curr_frame_wait_semaphore_ptr = m_frame_wait_semaphores [m_n_last_semaphore_used].get(); present_wait_semaphore_ptr = curr_frame_signal_semaphore_ptr; @@ -282,16 +297,16 @@ void App::draw_frame() &t); /* Submit jobs to relevant queues and make sure they are correctly synchronized */ - device_locked_ptr->get_universal_queue(0)->submit_command_buffer_with_signal_wait_semaphores(m_command_buffers[n_swapchain_image], - 1, /* n_semaphores_to_signal */ - &curr_frame_signal_semaphore_ptr, - 1, /* n_semaphores_to_wait_on */ - &curr_frame_wait_semaphore_ptr, - &wait_stage_mask, - false, /* should_block */ - nullptr); - - m_present_queue_ptr->present(m_swapchain_ptr, + m_device_ptr->get_universal_queue(0)->submit_command_buffer_with_signal_wait_semaphores(m_command_buffers[n_swapchain_image].get(), + 1, /* n_semaphores_to_signal */ + &curr_frame_signal_semaphore_ptr, + 1, /* n_semaphores_to_wait_on */ + &curr_frame_wait_semaphore_ptr, + &wait_stage_mask, + false, /* should_block */ + nullptr); + + m_present_queue_ptr->present(m_swapchain_ptr.get(), n_swapchain_image, 1, /* n_wait_semaphores */ &present_wait_semaphore_ptr); @@ -343,7 +358,7 @@ void App::get_buffer_memory_offsets(uint32_t n_sine_pair, if (out_opt_offset_data_offset_ptr != nullptr) { - const uint32_t sb_offset_alignment = static_cast(m_physical_device_ptr.lock()->get_device_properties().limits.minStorageBufferOffsetAlignment); + const uint32_t sb_offset_alignment = static_cast(m_physical_device_ptr->get_device_properties().core_vk1_0_properties_ptr->limits.min_storage_buffer_offset_alignment); *out_opt_offset_data_offset_ptr = Anvil::Utils::round_up(static_cast(sizeof(float) * 2), sb_offset_alignment) * n_sine_pair; @@ -352,13 +367,12 @@ void App::get_buffer_memory_offsets(uint32_t n_sine_pair, void App::init_buffers() { - std::shared_ptr memory_allocator_ptr; - std::shared_ptr physical_device_locked_ptr(m_physical_device_ptr); - const VkDeviceSize sb_data_alignment_requirement = physical_device_locked_ptr->get_device_properties().limits.minStorageBufferOffsetAlignment; - std::unique_ptr sine_offset_data_raw_buffer_ptr; + Anvil::MemoryAllocatorUniquePtr memory_allocator_ptr; + const VkDeviceSize sb_data_alignment_requirement = m_physical_device_ptr->get_device_properties().core_vk1_0_properties_ptr->limits.min_storage_buffer_offset_alignment; + std::unique_ptr sine_offset_data_raw_buffer_ptr; /* Set up allocators */ - memory_allocator_ptr = Anvil::MemoryAllocator::create_oneshot(m_device_ptr); + memory_allocator_ptr = Anvil::MemoryAllocator::create_oneshot(m_device_ptr.get() ); /* Prepare sine offset data */ m_sine_offset_data_buffer_size = 0; @@ -398,7 +412,7 @@ void App::init_buffers() /* Prepare a buffer object to hold the sine offset data. Note that we fill it with data * after memory allocator actually assigns it a memory block. */ - m_sine_offset_data_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr, + m_sine_offset_data_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), m_sine_offset_data_buffer_size, Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT, VK_SHARING_MODE_CONCURRENT, @@ -406,7 +420,7 @@ void App::init_buffers() m_sine_offset_data_buffer_ptr->set_name("Sine offset data buffer"); - memory_allocator_ptr->add_buffer(m_sine_offset_data_buffer_ptr, + memory_allocator_ptr->add_buffer(m_sine_offset_data_buffer_ptr.get(), 0); /* in_required_memory_features */ /* Now prepare a memory block which is going to hold vertex data generated by @@ -436,7 +450,7 @@ void App::init_buffers() m_sine_data_buffer_size *= 2; - m_sine_data_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr, + m_sine_data_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), m_sine_data_buffer_size, Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT, VK_SHARING_MODE_CONCURRENT, @@ -444,18 +458,18 @@ void App::init_buffers() m_sine_data_buffer_ptr->set_name("Sine data buffer"); - memory_allocator_ptr->add_buffer(m_sine_data_buffer_ptr, + memory_allocator_ptr->add_buffer(m_sine_data_buffer_ptr.get(), 0); /* in_required_memory_features */ /* We also need some space for a uniform block which is going to hold time info. */ - const auto dynamic_ub_alignment_requirement = m_device_ptr.lock()->get_physical_device_properties().limits.minUniformBufferOffsetAlignment; + const auto dynamic_ub_alignment_requirement = m_device_ptr->get_physical_device_properties().core_vk1_0_properties_ptr->limits.min_uniform_buffer_offset_alignment; const auto sine_props_data_buffer_size_per_swapchain_image = Anvil::Utils::round_up(sizeof(float), dynamic_ub_alignment_requirement); const auto sine_props_data_buffer_size_total = sine_props_data_buffer_size_per_swapchain_image * N_SWAPCHAIN_IMAGES; m_sine_props_data_buffer_size_per_swapchain_image = sine_props_data_buffer_size_per_swapchain_image; - m_sine_props_data_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr, + m_sine_props_data_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), sine_props_data_buffer_size_total, Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT, VK_SHARING_MODE_CONCURRENT, @@ -463,12 +477,12 @@ void App::init_buffers() m_sine_props_data_buffer_ptr->set_name("Sine properties data buffer"); - memory_allocator_ptr->add_buffer(m_sine_props_data_buffer_ptr, + memory_allocator_ptr->add_buffer(m_sine_props_data_buffer_ptr.get(), Anvil::MEMORY_FEATURE_FLAG_MAPPABLE); /* Each sine needs to be assigned a different color. Compute the data and upload it to another buffer object. */ - std::unique_ptr color_buffer_data_ptr; - unsigned char* color_buffer_data_traveller_ptr = nullptr; + std::unique_ptr color_buffer_data_ptr; + unsigned char* color_buffer_data_traveller_ptr = nullptr; m_sine_color_buffer_size = N_SINE_PAIRS * 2 /* sines per pair */ * (2 * sizeof(char) ) /* R8G8 */; @@ -489,7 +503,7 @@ void App::init_buffers() color_buffer_data_traveller_ptr ++; } - m_sine_color_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr, + m_sine_color_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), m_sine_color_buffer_size, Anvil::QUEUE_FAMILY_GRAPHICS_BIT, VK_SHARING_MODE_EXCLUSIVE, @@ -497,7 +511,7 @@ void App::init_buffers() m_sine_color_buffer_ptr->set_name("Sine color data buffer"); - memory_allocator_ptr->add_buffer(m_sine_color_buffer_ptr, + memory_allocator_ptr->add_buffer(m_sine_color_buffer_ptr.get(), 0); /* in_required_memory_features */ /* Assign memory blocks to buffers and fill them with data */ @@ -513,14 +527,13 @@ void App::init_buffers() void App::init_command_buffers() { - std::shared_ptr device_locked_ptr (m_device_ptr); - std::shared_ptr gfx_pipeline_manager_ptr (device_locked_ptr->get_graphics_pipeline_manager() ); - const bool is_debug_marker_ext_present (device_locked_ptr->is_ext_debug_marker_extension_enabled() ); - std::shared_ptr producer_pipeline_layout_ptr; - VkImageSubresourceRange subresource_range; - std::shared_ptr universal_queue_ptr (device_locked_ptr->get_universal_queue(0) ); + auto gfx_pipeline_manager_ptr (m_device_ptr->get_graphics_pipeline_manager() ); + const bool is_debug_marker_ext_present (m_device_ptr->is_ext_debug_marker_extension_enabled() ); + Anvil::PipelineLayout* producer_pipeline_layout_ptr(nullptr); + VkImageSubresourceRange subresource_range; + Anvil::Queue* universal_queue_ptr (m_device_ptr->get_universal_queue(0) ); - producer_pipeline_layout_ptr = device_locked_ptr->get_compute_pipeline_manager()->get_pipeline_layout(m_producer_pipeline_id); + producer_pipeline_layout_ptr = m_device_ptr->get_compute_pipeline_manager()->get_pipeline_layout(m_producer_pipeline_id); subresource_range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; subresource_range.baseArrayLayer = 0; @@ -533,10 +546,10 @@ void App::init_command_buffers() n_current_swapchain_image < N_SWAPCHAIN_IMAGES; ++n_current_swapchain_image) { - std::shared_ptr draw_cmd_buffer_ptr; + Anvil::PrimaryCommandBufferUniquePtr draw_cmd_buffer_ptr; + + draw_cmd_buffer_ptr = m_device_ptr->get_command_pool_for_queue_family_index(m_device_ptr->get_universal_queue(0)->get_queue_family_index() )->alloc_primary_level_command_buffer(); - draw_cmd_buffer_ptr = device_locked_ptr->get_command_pool(Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL)->alloc_primary_level_command_buffer(); - /* Start recording commands */ draw_cmd_buffer_ptr->start_recording(false, /* one_time_submit */ true /* simultaneous_use_allowed */); @@ -573,7 +586,7 @@ void App::init_command_buffers() VK_ACCESS_UNIFORM_READ_BIT, /* in_destination_access_mask */ VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_IGNORED, - m_sine_props_data_buffer_ptr, + m_sine_props_data_buffer_ptr.get(), n_current_swapchain_image * m_sine_props_data_buffer_size_per_swapchain_image, /* in_start_offset */ sizeof(float) ); /* in_size */ @@ -608,9 +621,9 @@ void App::init_command_buffers() n_sine_pair < N_SINE_PAIRS; ++n_sine_pair) { - uint32_t dynamic_offsets[3]; - const uint32_t n_dynamic_offsets = sizeof(dynamic_offsets) / sizeof(dynamic_offsets[0]); - std::shared_ptr producer_dses[] = + uint32_t dynamic_offsets[3]; + const uint32_t n_dynamic_offsets = sizeof(dynamic_offsets) / sizeof(dynamic_offsets[0]); + Anvil::DescriptorSet* producer_dses[] = { m_producer_dsg_ptr->get_descriptor_set(0), m_producer_dsg_ptr->get_descriptor_set(1) @@ -655,7 +668,7 @@ void App::init_command_buffers() VK_ACCESS_SHADER_READ_BIT, /* in_destination_access_mask */ VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_IGNORED, - m_sine_data_buffer_ptr, + m_sine_data_buffer_ptr.get(), 0, /* in_offset */ m_sine_data_buffer_size); @@ -689,21 +702,22 @@ void App::init_command_buffers() */ draw_cmd_buffer_ptr->record_begin_render_pass(2, /* n_clear_values */ clear_values, - m_fbos[n_current_swapchain_image], + m_fbos[n_current_swapchain_image].get(), render_area, - m_consumer_render_pass_ptr, + m_consumer_render_pass_ptr.get(), VK_SUBPASS_CONTENTS_INLINE); { - const float max_line_width = m_device_ptr.lock()->get_physical_device_properties().limits.lineWidthRange[1]; - std::shared_ptr renderer_dses[] = + const float max_line_width = m_device_ptr->get_physical_device_properties().core_vk1_0_properties_ptr->limits.line_width_range[1]; + Anvil::DescriptorSet* renderer_dses[] = { m_consumer_dsg_ptr->get_descriptor_set(0), m_consumer_dsg_ptr->get_descriptor_set(1) }; - const uint32_t n_renderer_dses = sizeof(renderer_dses) / sizeof(renderer_dses[0]); + const uint32_t n_renderer_dses = sizeof(renderer_dses) / sizeof(renderer_dses[0]); + auto sine_color_buffer_raw_ptr = m_sine_color_buffer_ptr.get(); - std::shared_ptr renderer_pipeline_layout_ptr; - static const VkDeviceSize sine_color_buffer_start_offset = 0; + Anvil::PipelineLayout* renderer_pipeline_layout_ptr = nullptr; + static const VkDeviceSize sine_color_buffer_start_offset = 0; renderer_pipeline_layout_ptr = gfx_pipeline_manager_ptr->get_pipeline_layout(m_consumer_pipeline_id); @@ -711,7 +725,7 @@ void App::init_command_buffers() m_consumer_pipeline_id); draw_cmd_buffer_ptr->record_bind_vertex_buffers (0, /* startBinding */ 1, /* bindingCount */ - &m_sine_color_buffer_ptr, + &sine_color_buffer_raw_ptr, &sine_color_buffer_start_offset); for (unsigned int n_sine_pair = 0; @@ -765,15 +779,14 @@ void App::init_command_buffers() /* Close the recording process */ draw_cmd_buffer_ptr->stop_recording(); - m_command_buffers[n_current_swapchain_image] = draw_cmd_buffer_ptr; + m_command_buffers[n_current_swapchain_image] = std::move(draw_cmd_buffer_ptr); } } void App::init_compute_pipelines() { - std::shared_ptr device_locked_ptr (m_device_ptr); - std::shared_ptr compute_manager_ptr(device_locked_ptr->get_compute_pipeline_manager() ); - bool result; + auto compute_manager_ptr(m_device_ptr->get_compute_pipeline_manager() ); + bool result; /* Create & configure the compute pipeline */ auto producer_pipeline_info_ptr = Anvil::ComputePipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ @@ -783,7 +796,7 @@ void App::init_compute_pipelines() producer_pipeline_info_ptr->attach_push_constant_range(0, /* offset */ 4, /* size */ VK_SHADER_STAGE_COMPUTE_BIT); - producer_pipeline_info_ptr->set_dsg (m_producer_dsg_ptr); + producer_pipeline_info_ptr->set_descriptor_set_info (m_producer_dsg_ptr->get_descriptor_set_info() ); result = compute_manager_ptr->add_pipeline(std::move(producer_pipeline_info_ptr), &m_producer_pipeline_id); @@ -795,8 +808,8 @@ void App::init_compute_pipelines() void App::init_dsgs() { - auto consumer_dsg_info_ptrs = std::vector >(2); - auto producer_dsg_info_ptrs = std::vector >(2); + auto consumer_dsg_info_ptrs = std::vector(2); + auto producer_dsg_info_ptrs = std::vector(2); consumer_dsg_info_ptrs[0] = Anvil::DescriptorSetInfo::create(); consumer_dsg_info_ptrs[1] = Anvil::DescriptorSetInfo::create(); @@ -826,41 +839,41 @@ void App::init_dsgs() VK_SHADER_STAGE_COMPUTE_BIT); /* Create the descriptor set layouts for the generator program. */ - m_producer_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr, + m_producer_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), producer_dsg_info_ptrs, false); /* releaseable_sets */ m_producer_dsg_ptr->set_binding_item(0, /* n_set */ 0, /* binding_index */ - Anvil::DescriptorSet::DynamicStorageBufferBindingElement(m_sine_offset_data_buffer_ptr, + Anvil::DescriptorSet::DynamicStorageBufferBindingElement(m_sine_offset_data_buffer_ptr.get(), 0, /* in_start_offset */ sizeof(float) * 2) ); m_producer_dsg_ptr->set_binding_item(0, /* n_set */ 1, /* binding_index */ - Anvil::DescriptorSet::DynamicStorageBufferBindingElement(m_sine_data_buffer_ptr, + Anvil::DescriptorSet::DynamicStorageBufferBindingElement(m_sine_data_buffer_ptr.get(), 0, /* in_start_offset */ sizeof(float) * 4 * N_VERTICES_PER_SINE * 2) ); m_producer_dsg_ptr->set_binding_item(1, /* n_set */ 0, /* binding_index */ - Anvil::DescriptorSet::DynamicUniformBufferBindingElement(m_sine_props_data_buffer_ptr, + Anvil::DescriptorSet::DynamicUniformBufferBindingElement(m_sine_props_data_buffer_ptr.get(), 0, /* in_start_offset */ m_sine_props_data_buffer_size_per_swapchain_image) ); /* Set up the descriptor set layout for the renderer program. */ - m_consumer_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr, + m_consumer_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), consumer_dsg_info_ptrs, false); /* releaseable_sets */ m_consumer_dsg_ptr->set_binding_item(0, /* n_set */ 0, /* binding_index */ - Anvil::DescriptorSet::DynamicStorageBufferBindingElement(m_sine_data_buffer_ptr, + Anvil::DescriptorSet::DynamicStorageBufferBindingElement(m_sine_data_buffer_ptr.get(), 0, /* in_start_offset */ sizeof(float) * 4 * N_VERTICES_PER_SINE) ); m_consumer_dsg_ptr->set_binding_item(1, /* n_set */ 0, /* binding_index */ - Anvil::DescriptorSet::DynamicStorageBufferBindingElement(m_sine_data_buffer_ptr, + Anvil::DescriptorSet::DynamicStorageBufferBindingElement(m_sine_data_buffer_ptr.get(), 0, /* in_start_offset */ sizeof(float) * 4 * N_VERTICES_PER_SINE) ); } @@ -878,9 +891,9 @@ void App::init_framebuffers() n_swapchain_image < N_SWAPCHAIN_IMAGES; ++n_swapchain_image) { - std::shared_ptr result_fb_ptr; + Anvil::FramebufferUniquePtr result_fb_ptr; - result_fb_ptr = Anvil::Framebuffer::create(m_device_ptr, + result_fb_ptr = Anvil::Framebuffer::create(m_device_ptr.get(), WINDOW_WIDTH, WINDOW_HEIGHT, 1); /* n_layers */ @@ -892,18 +905,17 @@ void App::init_framebuffers() nullptr); /* out_opt_attachment_id_ptr */ anvil_assert(result); - result = result_fb_ptr->add_attachment(m_depth_image_views[n_swapchain_image], + result = result_fb_ptr->add_attachment(m_depth_image_views[n_swapchain_image].get(), nullptr); /* out_opt_attachment_id_ptr */ - m_fbos[n_swapchain_image] = result_fb_ptr; + m_fbos[n_swapchain_image] = std::move(result_fb_ptr); } } void App::init_gfx_pipelines() { - auto device_locked_ptr = m_device_ptr.lock (); - auto gfx_manager_ptr = device_locked_ptr->get_graphics_pipeline_manager(); - auto renderpass_info_ptr = std::unique_ptr(new Anvil::RenderPassInfo(device_locked_ptr) ); + auto gfx_manager_ptr = m_device_ptr->get_graphics_pipeline_manager(); + auto renderpass_info_ptr = Anvil::RenderPassInfoUniquePtr(new Anvil::RenderPassInfo(m_device_ptr.get() ) ); /* Create a renderpass instance */ #ifdef ENABLE_OFFSCREEN_RENDERING @@ -948,28 +960,28 @@ void App::init_gfx_pipelines() VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); m_consumer_render_pass_ptr = Anvil::RenderPass::create(std::move(renderpass_info_ptr), - m_swapchain_ptr); + m_swapchain_ptr.get() ); m_consumer_render_pass_ptr->set_name("Consumer renderpass"); /* Set up the graphics pipeline for the main subpass */ auto consumer_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - m_consumer_render_pass_ptr, - render_pass_subpass_id, - *m_consumer_fs_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader */ - *m_consumer_vs_ptr); + false, /* in_allow_derivatives */ + m_consumer_render_pass_ptr.get(), + render_pass_subpass_id, + *m_consumer_fs_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader */ + *m_consumer_vs_ptr); consumer_pipeline_info_ptr->add_vertex_attribute (0, /* location */ VK_FORMAT_R8G8_UNORM, 0, /* offset_in_bytes */ sizeof(char) * 2, /* stride_in_bytes */ VK_VERTEX_INPUT_RATE_INSTANCE); - consumer_pipeline_info_ptr->set_dsg (m_consumer_dsg_ptr); + consumer_pipeline_info_ptr->set_descriptor_set_info (m_consumer_dsg_ptr->get_descriptor_set_info() ); consumer_pipeline_info_ptr->set_primitive_topology (VK_PRIMITIVE_TOPOLOGY_LINE_STRIP); consumer_pipeline_info_ptr->set_rasterization_properties (VK_POLYGON_MODE_FILL, VK_CULL_MODE_NONE, @@ -991,7 +1003,7 @@ void App::init_images() n_depth_image < N_SWAPCHAIN_IMAGES; ++n_depth_image) { - m_depth_images[n_depth_image] = Anvil::Image::create_nonsparse(m_device_ptr, + m_depth_images[n_depth_image] = Anvil::Image::create_nonsparse(m_device_ptr.get(), VK_IMAGE_TYPE_2D, VK_FORMAT_D16_UNORM, VK_IMAGE_TILING_OPTIMAL, @@ -1009,8 +1021,8 @@ void App::init_images() VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, nullptr); /* in_mipmaps_ptr */ - m_depth_image_views[n_depth_image] = Anvil::ImageView::create_2D(m_device_ptr, - m_depth_images[n_depth_image], + m_depth_image_views[n_depth_image] = Anvil::ImageView::create_2D(m_device_ptr.get(), + m_depth_images[n_depth_image].get(), 0, /* n_base_layer */ 0, /* n_base_mipmap_level */ 1, /* n_mipmaps */ @@ -1034,37 +1046,37 @@ void App::init_semaphores() n_semaphore < m_n_swapchain_images; ++n_semaphore) { - std::shared_ptr new_signal_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr); - std::shared_ptr new_wait_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr); + auto new_signal_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); + auto new_wait_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); new_signal_semaphore_ptr->set_name_formatted("Signal semaphore [%d]", n_semaphore); new_wait_semaphore_ptr->set_name_formatted ("Wait semaphore [%d]", n_semaphore); - m_frame_signal_semaphores.push_back(new_signal_semaphore_ptr); - m_frame_wait_semaphores.push_back (new_wait_semaphore_ptr); + m_frame_signal_semaphores.push_back(std::move(new_signal_semaphore_ptr) ); + m_frame_wait_semaphores.push_back (std::move(new_wait_semaphore_ptr) ); } } void App::init_shaders() { - std::shared_ptr cs_module_ptr; - std::shared_ptr cs_ptr; - std::shared_ptr fs_module_ptr; - std::shared_ptr fs_ptr; - std::shared_ptr vs_module_ptr; - std::shared_ptr vs_ptr; - - cs_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr, + Anvil::ShaderModuleUniquePtr cs_module_ptr; + Anvil::GLSLShaderToSPIRVGeneratorUniquePtr cs_ptr; + Anvil::ShaderModuleUniquePtr fs_module_ptr; + Anvil::GLSLShaderToSPIRVGeneratorUniquePtr fs_ptr; + Anvil::ShaderModuleUniquePtr vs_module_ptr; + Anvil::GLSLShaderToSPIRVGeneratorUniquePtr vs_ptr; + + cs_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_producer_comp, Anvil::SHADER_STAGE_COMPUTE); - fs_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr, + fs_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_consumer_frag, Anvil::SHADER_STAGE_FRAGMENT); - vs_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr, + vs_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_consumer_vert, Anvil::SHADER_STAGE_VERTEX); @@ -1079,12 +1091,12 @@ void App::init_shaders() N_VERTICES_PER_SINE); /* Initialize the shader modules */ - cs_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr, - cs_ptr); - fs_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr, - fs_ptr); - vs_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr, - vs_ptr); + cs_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr.get(), + cs_ptr.get () ); + fs_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr.get(), + fs_ptr.get () ); + vs_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr.get(), + vs_ptr.get () ); cs_module_ptr->set_name("Compute shader module"); fs_module_ptr->set_name("Fragment shader module"); @@ -1093,52 +1105,49 @@ void App::init_shaders() /* Prepare entrypoint descriptors. */ m_producer_cs_ptr.reset( new Anvil::ShaderModuleStageEntryPoint("main", - cs_module_ptr, + std::move(cs_module_ptr), Anvil::SHADER_STAGE_COMPUTE) ); m_consumer_fs_ptr.reset( new Anvil::ShaderModuleStageEntryPoint("main", - fs_module_ptr, + std::move(fs_module_ptr), Anvil::SHADER_STAGE_FRAGMENT) ); m_consumer_vs_ptr.reset( new Anvil::ShaderModuleStageEntryPoint("main", - vs_module_ptr, + std::move(vs_module_ptr), Anvil::SHADER_STAGE_VERTEX) ); } void App::init_swapchain() { - std::shared_ptr device_locked_ptr(m_device_ptr); - - m_rendering_surface_ptr = Anvil::RenderingSurface::create(m_instance_ptr, - m_device_ptr, - m_window_ptr); + m_rendering_surface_ptr = Anvil::RenderingSurface::create(m_instance_ptr.get(), + m_device_ptr.get (), + m_window_ptr.get () ); m_rendering_surface_ptr->set_name("Main rendering surface"); - m_swapchain_ptr = device_locked_ptr->create_swapchain(m_rendering_surface_ptr, - m_window_ptr, - VK_FORMAT_B8G8R8A8_UNORM, - VK_PRESENT_MODE_FIFO_KHR, - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, - m_n_swapchain_images); + m_swapchain_ptr = m_device_ptr->create_swapchain(m_rendering_surface_ptr.get(), + m_window_ptr.get (), + VK_FORMAT_B8G8R8A8_UNORM, + VK_PRESENT_MODE_FIFO_KHR, + VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, + m_n_swapchain_images); m_swapchain_ptr->set_name("Main swapchain"); /* Cache the queue we are going to use for presentation */ const std::vector* present_queue_fams_ptr = nullptr; - if (!m_rendering_surface_ptr->get_queue_families_with_present_support(device_locked_ptr->get_physical_device(), - &present_queue_fams_ptr) ) + if (!m_rendering_surface_ptr->get_queue_families_with_present_support(&present_queue_fams_ptr) ) { anvil_assert_fail(); } - m_present_queue_ptr = device_locked_ptr->get_queue(present_queue_fams_ptr->at(0), - 0); /* in_n_queue */ + m_present_queue_ptr = m_device_ptr->get_queue_for_queue_family_index(present_queue_fams_ptr->at(0), + 0); /* in_n_queue */ } void App::init_window() @@ -1185,10 +1194,11 @@ void App::init_vulkan() /* Create a Vulkan device */ m_device_ptr = Anvil::SGPUDevice::create(m_physical_device_ptr, + true, /* in_enable_shader_module_cache */ Anvil::DeviceExtensionConfiguration(), - std::vector(), /* layers */ - false, /* transient_command_buffer_allocs_only */ - false); /* support_resettable_command_buffers */ + std::vector(), /* in_layers */ + false, /* in_transient_command_buffer_allocs_only */ + false); /* in_support_resettable_command_buffers */ } VkBool32 App::on_validation_callback(VkDebugReportFlagsEXT message_flags, @@ -1214,7 +1224,7 @@ void App::run() int main() { - std::shared_ptr app_ptr(new App() ); + std::unique_ptr app_ptr(new App() ); app_ptr->init(); app_ptr->run(); diff --git a/examples/MultiViewport/CMakeLists.txt b/examples/MultiViewport/CMakeLists.txt index a9f0f620..00bca137 100644 --- a/examples/MultiViewport/CMakeLists.txt +++ b/examples/MultiViewport/CMakeLists.txt @@ -18,6 +18,7 @@ endif() add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") +target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") include_directories(${Anvil_SOURCE_DIR}/include ${MultiViewport_SOURCE_DIR}/include) diff --git a/examples/MultiViewport/include/app.h b/examples/MultiViewport/include/app.h index f99c1548..a65e3151 100644 --- a/examples/MultiViewport/include/app.h +++ b/examples/MultiViewport/include/app.h @@ -50,16 +50,16 @@ class App void init_window (); void init_vulkan (); - VkFormat get_mesh_color_data_format () const; - uint32_t get_mesh_color_data_n_components() const; - uint32_t get_mesh_color_data_start_offset (uint32_t n_stream, - uint32_t n_vertex = 0) const; - std::shared_ptr get_mesh_data () const; - uint32_t get_mesh_data_size () const; - uint32_t get_mesh_n_vertices () const; - VkFormat get_mesh_vertex_data_format () const; - uint32_t get_mesh_vertex_data_n_components() const; - uint32_t get_mesh_vertex_data_start_offset(uint32_t n_vertex = 0) const; + VkFormat get_mesh_color_data_format () const; + uint32_t get_mesh_color_data_n_components() const; + uint32_t get_mesh_color_data_start_offset (uint32_t n_stream, + uint32_t n_vertex = 0) const; + std::unique_ptr get_mesh_data () const; + uint32_t get_mesh_data_size () const; + uint32_t get_mesh_n_vertices () const; + VkFormat get_mesh_vertex_data_format () const; + uint32_t get_mesh_vertex_data_n_components() const; + uint32_t get_mesh_vertex_data_start_offset(uint32_t n_vertex = 0) const; void get_scissor_viewport_info(VkRect2D* out_scissors, VkViewport* out_viewports); @@ -71,27 +71,27 @@ class App const char* message); /* Private variables */ - std::weak_ptr m_device_ptr; - std::shared_ptr m_instance_ptr; - std::weak_ptr m_physical_device_ptr; - std::shared_ptr m_present_queue_ptr; - std::shared_ptr m_rendering_surface_ptr; - std::shared_ptr m_swapchain_ptr; - std::shared_ptr m_window_ptr; + Anvil::SGPUDeviceUniquePtr m_device_ptr; + Anvil::InstanceUniquePtr m_instance_ptr; + const Anvil::PhysicalDevice* m_physical_device_ptr; + Anvil::Queue* m_present_queue_ptr; + Anvil::RenderingSurfaceUniquePtr m_rendering_surface_ptr; + Anvil::SwapchainUniquePtr m_swapchain_ptr; + Anvil::WindowUniquePtr m_window_ptr; - std::shared_ptr m_command_buffers[N_SWAPCHAIN_IMAGES]; - std::shared_ptr m_fbos [N_SWAPCHAIN_IMAGES]; - std::shared_ptr m_fs_ptr; - std::shared_ptr m_gs_ptr; + Anvil::PrimaryCommandBufferUniquePtr m_command_buffers[N_SWAPCHAIN_IMAGES]; + Anvil::FramebufferUniquePtr m_fbos [N_SWAPCHAIN_IMAGES]; + std::unique_ptr m_fs_ptr; + std::unique_ptr m_gs_ptr; Anvil::PipelineID m_pipeline_id; - std::shared_ptr m_renderpass_ptr; - std::shared_ptr m_vs_ptr; - - std::shared_ptr m_mesh_data_buffer_ptr; + Anvil::RenderPassUniquePtr m_renderpass_ptr; + std::unique_ptr m_vs_ptr; + + Anvil::BufferUniquePtr m_mesh_data_buffer_ptr; uint32_t m_n_last_semaphore_used; const uint32_t m_n_swapchain_images; - std::vector > m_frame_signal_semaphores; - std::vector > m_frame_wait_semaphores; + std::vector m_frame_signal_semaphores; + std::vector m_frame_wait_semaphores; }; diff --git a/examples/MultiViewport/src/app.cpp b/examples/MultiViewport/src/app.cpp index c2b4ae62..20b8abfe 100644 --- a/examples/MultiViewport/src/app.cpp +++ b/examples/MultiViewport/src/app.cpp @@ -173,7 +173,9 @@ static const char* g_glsl_render_vert = App::App() :m_n_last_semaphore_used(0), - m_n_swapchain_images (N_SWAPCHAIN_IMAGES) + m_n_swapchain_images (N_SWAPCHAIN_IMAGES), + m_physical_device_ptr (nullptr), + m_present_queue_ptr (nullptr) { } @@ -184,12 +186,11 @@ App::~App() void App::deinit() { - vkDeviceWaitIdle(m_device_ptr.lock()->get_device_vk() ); + vkDeviceWaitIdle(m_device_ptr->get_device_vk() ); m_frame_signal_semaphores.clear(); m_frame_wait_semaphores.clear(); - m_present_queue_ptr.reset(); m_rendering_surface_ptr.reset(); m_swapchain_ptr.reset(); @@ -213,10 +214,7 @@ void App::deinit() m_renderpass_ptr.reset(); m_vs_ptr.reset(); - m_device_ptr.lock()->destroy(); m_device_ptr.reset(); - - m_instance_ptr->destroy(); m_instance_ptr.reset(); m_window_ptr.reset(); @@ -224,34 +222,33 @@ void App::deinit() void App::draw_frame() { - std::shared_ptr curr_frame_signal_semaphore_ptr; - std::shared_ptr curr_frame_wait_semaphore_ptr; - std::shared_ptr device_locked_ptr = m_device_ptr.lock(); - static uint32_t n_frames_rendered = 0; - uint32_t n_swapchain_image; - std::shared_ptr present_queue_ptr = device_locked_ptr->get_universal_queue(0); - const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; + Anvil::Semaphore* curr_frame_signal_semaphore_ptr = nullptr; + Anvil::Semaphore* curr_frame_wait_semaphore_ptr = nullptr; + static uint32_t n_frames_rendered = 0; + uint32_t n_swapchain_image; + auto present_queue_ptr = m_device_ptr->get_universal_queue(0); + const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; /* Determine the signal + wait semaphores to use for drawing this frame */ m_n_last_semaphore_used = (m_n_last_semaphore_used + 1) % m_n_swapchain_images; - curr_frame_signal_semaphore_ptr = m_frame_signal_semaphores[m_n_last_semaphore_used]; - curr_frame_wait_semaphore_ptr = m_frame_wait_semaphores [m_n_last_semaphore_used]; + curr_frame_signal_semaphore_ptr = m_frame_signal_semaphores[m_n_last_semaphore_used].get(); + curr_frame_wait_semaphore_ptr = m_frame_wait_semaphores [m_n_last_semaphore_used].get(); /* Determine the semaphore which the swapchain image */ n_swapchain_image = m_swapchain_ptr->acquire_image(curr_frame_wait_semaphore_ptr); /* Submit work chunk and present */ - device_locked_ptr->get_universal_queue(0)->submit_command_buffer_with_signal_wait_semaphores(m_command_buffers[n_swapchain_image], - 1, /* n_semaphores_to_signal */ - &curr_frame_signal_semaphore_ptr, - 1, /* n_semaphores_to_wait_on */ - &curr_frame_wait_semaphore_ptr, - &wait_stage_mask, - false, /* should_block */ - nullptr); /* opt_fence_ptr */ - - present_queue_ptr->present(m_swapchain_ptr, + m_device_ptr->get_universal_queue(0)->submit_command_buffer_with_signal_wait_semaphores(m_command_buffers[n_swapchain_image].get(), + 1, /* n_semaphores_to_signal */ + &curr_frame_signal_semaphore_ptr, + 1, /* n_semaphores_to_wait_on */ + &curr_frame_wait_semaphore_ptr, + &wait_stage_mask, + false, /* should_block */ + nullptr); /* opt_fence_ptr */ + + present_queue_ptr->present(m_swapchain_ptr.get(), n_swapchain_image, 1, /* n_wait_semaphores */ &curr_frame_signal_semaphore_ptr); @@ -294,12 +291,12 @@ uint32_t App::get_mesh_color_data_start_offset(uint32_t n_stream, return result; } -std::shared_ptr App::get_mesh_data() const +std::unique_ptr App::get_mesh_data() const { - const float pi = 3.14159265f; - std::shared_ptr result_data_ptr; - uint32_t result_mesh_data_size = 0; - uint32_t result_n_vertices = 0; + const float pi = 3.14159265f; + std::unique_ptr result_data_ptr; + uint32_t result_mesh_data_size = 0; + uint32_t result_n_vertices = 0; /* Generate the mesh data. We need a total of five data streams: * @@ -314,7 +311,9 @@ std::shared_ptr App::get_mesh_data() const result_mesh_data_size = get_mesh_data_size (); - result_data_ptr.reset(new unsigned char[result_mesh_data_size]); + result_data_ptr.reset( + new uint8_t[result_mesh_data_size] + ); for (unsigned int n_vertex = 0; n_vertex < result_n_vertices; @@ -467,11 +466,11 @@ void App::init() void App::init_buffers() { - std::shared_ptr mesh_data_ptr = get_mesh_data(); + auto mesh_data_ptr = get_mesh_data(); /* Initialize the buffer object */ m_mesh_data_buffer_ptr = Anvil::Buffer::create_nonsparse( - m_device_ptr, + m_device_ptr.get(), get_mesh_data_size(), Anvil::QUEUE_FAMILY_GRAPHICS_BIT, VK_SHARING_MODE_EXCLUSIVE, @@ -482,10 +481,9 @@ void App::init_buffers() void App::init_command_buffers() { - std::shared_ptr device_locked_ptr (m_device_ptr); - std::shared_ptr gfx_pipeline_manager_ptr(device_locked_ptr->get_graphics_pipeline_manager() ); - VkImageSubresourceRange subresource_range; - std::shared_ptr universal_queue_ptr (device_locked_ptr->get_universal_queue(0) ); + auto gfx_pipeline_manager_ptr(m_device_ptr->get_graphics_pipeline_manager() ); + VkImageSubresourceRange subresource_range; + auto universal_queue_ptr (m_device_ptr->get_universal_queue(0) ); subresource_range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; subresource_range.baseArrayLayer = 0; @@ -494,11 +492,20 @@ void App::init_command_buffers() subresource_range.levelCount = 1; /* Set up rendering command buffers. We need one per swap-chain image. */ + uint32_t n_universal_queue_family_indices = 0; + const uint32_t* universal_queue_family_indices = nullptr; + + m_device_ptr->get_queue_family_indices_for_queue_family_type(Anvil::QueueFamilyType::UNIVERSAL, + &n_universal_queue_family_indices, + &universal_queue_family_indices); + + anvil_assert(n_universal_queue_family_indices > 0); + for (unsigned int n_current_swapchain_image = 0; n_current_swapchain_image < N_SWAPCHAIN_IMAGES; ++n_current_swapchain_image) { - std::shared_ptr cmd_buffer_ptr = device_locked_ptr->get_command_pool(Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL)->alloc_primary_level_command_buffer(); + auto cmd_buffer_ptr = m_device_ptr->get_command_pool_for_queue_family_index(universal_queue_family_indices[0])->alloc_primary_level_command_buffer(); /* Start recording commands */ cmd_buffer_ptr->start_recording(false, /* one_time_submit */ @@ -547,18 +554,18 @@ void App::init_command_buffers() cmd_buffer_ptr->record_begin_render_pass(1, /* in_n_clear_values */ &attachment_clear_value, - m_fbos[n_current_swapchain_image], + m_fbos[n_current_swapchain_image].get(), render_area, - m_renderpass_ptr, + m_renderpass_ptr.get(), VK_SUBPASS_CONTENTS_INLINE); { - std::shared_ptr mesh_data_buffer_per_binding[g_n_attribute_bindings] = + Anvil::Buffer* mesh_data_buffer_per_binding[g_n_attribute_bindings] = { - m_mesh_data_buffer_ptr, - m_mesh_data_buffer_ptr, - m_mesh_data_buffer_ptr, - m_mesh_data_buffer_ptr, - m_mesh_data_buffer_ptr, + m_mesh_data_buffer_ptr.get(), + m_mesh_data_buffer_ptr.get(), + m_mesh_data_buffer_ptr.get(), + m_mesh_data_buffer_ptr.get(), + m_mesh_data_buffer_ptr.get(), }; VkDeviceSize mesh_data_buffer_data_offset_per_binding[g_n_attribute_bindings] = {0}; @@ -616,7 +623,7 @@ void App::init_command_buffers() /* Close the recording process */ cmd_buffer_ptr->stop_recording(); - m_command_buffers[n_current_swapchain_image] = cmd_buffer_ptr; + m_command_buffers[n_current_swapchain_image] = std::move(cmd_buffer_ptr); } } @@ -628,11 +635,10 @@ void App::init_framebuffers() n_swapchain_image < N_SWAPCHAIN_IMAGES; ++n_swapchain_image) { - m_fbos[n_swapchain_image] = Anvil::Framebuffer::create( - m_device_ptr, - WINDOW_WIDTH, - WINDOW_HEIGHT, - 1 /* n_layers */); + m_fbos[n_swapchain_image] = Anvil::Framebuffer::create(m_device_ptr.get(), + WINDOW_WIDTH, + WINDOW_HEIGHT, + 1 /* n_layers */); m_fbos[n_swapchain_image]->set_name_formatted("Framebuffer used to render to swapchain image [%d]", n_swapchain_image); @@ -645,24 +651,23 @@ void App::init_framebuffers() void App::init_gfx_pipelines() { - std::shared_ptr device_locked_ptr (m_device_ptr); - std::shared_ptr gfx_pipeline_manager_ptr(device_locked_ptr->get_graphics_pipeline_manager() ); - const VkFormat mesh_color_data_format (get_mesh_color_data_format ()); - const VkFormat mesh_vertex_data_format (get_mesh_vertex_data_format ()); - const uint32_t n_mesh_color_components (get_mesh_color_data_n_components ()); - const uint32_t n_mesh_vertex_components(get_mesh_vertex_data_n_components()); + auto gfx_pipeline_manager_ptr(m_device_ptr->get_graphics_pipeline_manager() ); + const VkFormat mesh_color_data_format (get_mesh_color_data_format ()); + const VkFormat mesh_vertex_data_format (get_mesh_vertex_data_format ()); + const uint32_t n_mesh_color_components (get_mesh_color_data_n_components ()); + const uint32_t n_mesh_vertex_components(get_mesh_vertex_data_n_components ()); /* Create a render pass for the pipeline */ - std::unique_ptr gfx_pipeline_info_ptr; - Anvil::RenderPassAttachmentID render_pass_color_attachment_id; - Anvil::SubPassID render_pass_subpass_id; - VkRect2D scissors[4]; + Anvil::GraphicsPipelineInfoUniquePtr gfx_pipeline_info_ptr; + Anvil::RenderPassAttachmentID render_pass_color_attachment_id; + Anvil::SubPassID render_pass_subpass_id; + VkRect2D scissors[4]; get_scissor_viewport_info(scissors, nullptr); /* viewports */ { - std::unique_ptr render_pass_info_ptr(new Anvil::RenderPassInfo(m_device_ptr) ); + Anvil::RenderPassInfoUniquePtr render_pass_info_ptr(new Anvil::RenderPassInfo(m_device_ptr.get() ) ); render_pass_info_ptr->add_color_attachment (m_swapchain_ptr->get_image_format(), VK_SAMPLE_COUNT_1_BIT, @@ -680,7 +685,7 @@ void App::init_gfx_pipelines() nullptr); /* in_opt_attachment_resolve_id_ptr */ m_renderpass_ptr = Anvil::RenderPass::create(std::move(render_pass_info_ptr), - m_swapchain_ptr); + m_swapchain_ptr.get() ); } m_renderpass_ptr->set_name("Main renderpass"); @@ -688,7 +693,7 @@ void App::init_gfx_pipelines() /* Configure the graphics pipeline */ gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ false, /* in_allow_derivatives */ - m_renderpass_ptr, + m_renderpass_ptr.get(), render_pass_subpass_id, *m_fs_ptr, *m_gs_ptr, @@ -759,103 +764,100 @@ void App::init_semaphores() n_semaphore < m_n_swapchain_images; ++n_semaphore) { - std::shared_ptr new_signal_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr); - std::shared_ptr new_wait_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr); + auto new_signal_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); + auto new_wait_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); new_signal_semaphore_ptr->set_name_formatted("Signal semaphore [%d]", n_semaphore); new_wait_semaphore_ptr->set_name_formatted ("Wait semaphore [%d]", n_semaphore); - m_frame_signal_semaphores.push_back(new_signal_semaphore_ptr); - m_frame_wait_semaphores.push_back (new_wait_semaphore_ptr); + m_frame_signal_semaphores.push_back(std::move(new_signal_semaphore_ptr) ); + m_frame_wait_semaphores.push_back (std::move(new_wait_semaphore_ptr) ); } } void App::init_shaders() { - std::shared_ptr fragment_shader_ptr; - std::shared_ptr fragment_shader_module_ptr; - std::shared_ptr geometry_shader_ptr; - std::shared_ptr geometry_shader_module_ptr; - std::shared_ptr vertex_shader_ptr; - std::shared_ptr vertex_shader_module_ptr; - - fragment_shader_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr, + Anvil::GLSLShaderToSPIRVGeneratorUniquePtr fragment_shader_ptr; + Anvil::ShaderModuleUniquePtr fs_module_ptr; + Anvil::ShaderModuleUniquePtr gs_module_ptr; + Anvil::ShaderModuleUniquePtr vs_module_ptr; + Anvil::GLSLShaderToSPIRVGeneratorUniquePtr geometry_shader_ptr; + Anvil::GLSLShaderToSPIRVGeneratorUniquePtr vertex_shader_ptr; + + fragment_shader_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_render_frag, Anvil::SHADER_STAGE_FRAGMENT); - vertex_shader_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr, + vertex_shader_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_render_vert, Anvil::SHADER_STAGE_VERTEX); - geometry_shader_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr, + geometry_shader_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_render_geom, Anvil::SHADER_STAGE_GEOMETRY); - fragment_shader_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr, - fragment_shader_ptr); - geometry_shader_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr, - geometry_shader_ptr); - vertex_shader_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr, - vertex_shader_ptr); + fs_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr.get (), + fragment_shader_ptr.get() ); + gs_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr.get (), + geometry_shader_ptr.get() ); + vs_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr.get (), + vertex_shader_ptr.get () ); - fragment_shader_module_ptr->set_name("Fragment shader"); - geometry_shader_module_ptr->set_name("Geometry shader"); - vertex_shader_module_ptr->set_name ("Vertex shader"); + fs_module_ptr->set_name("Fragment shader"); + gs_module_ptr->set_name("Geometry shader"); + vs_module_ptr->set_name("Vertex shader"); m_fs_ptr.reset( new Anvil::ShaderModuleStageEntryPoint( "main", - fragment_shader_module_ptr, + std::move(fs_module_ptr), Anvil::SHADER_STAGE_FRAGMENT) ); m_gs_ptr.reset( new Anvil::ShaderModuleStageEntryPoint( "main", - geometry_shader_module_ptr, + std::move(gs_module_ptr), Anvil::SHADER_STAGE_GEOMETRY) ); m_vs_ptr.reset( new Anvil::ShaderModuleStageEntryPoint( "main", - vertex_shader_module_ptr, + std::move(vs_module_ptr), Anvil::SHADER_STAGE_VERTEX) ); } void App::init_swapchain() { - std::shared_ptr device_locked_ptr(m_device_ptr); - - m_rendering_surface_ptr = Anvil::RenderingSurface::create(m_instance_ptr, - m_device_ptr, - m_window_ptr); + m_rendering_surface_ptr = Anvil::RenderingSurface::create(m_instance_ptr.get(), + m_device_ptr.get (), + m_window_ptr.get () ); m_rendering_surface_ptr->set_name("Main rendering surface"); - m_swapchain_ptr = device_locked_ptr->create_swapchain(m_rendering_surface_ptr, - m_window_ptr, - VK_FORMAT_B8G8R8A8_UNORM, - VK_PRESENT_MODE_FIFO_KHR, - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, - m_n_swapchain_images); + m_swapchain_ptr = m_device_ptr->create_swapchain(m_rendering_surface_ptr.get(), + m_window_ptr.get (), + VK_FORMAT_B8G8R8A8_UNORM, + VK_PRESENT_MODE_FIFO_KHR, + VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, + m_n_swapchain_images); m_swapchain_ptr->set_name("Main swapchain"); /* Cache the queue we are going to use for presentation */ const std::vector* present_queue_fams_ptr = nullptr; - if (!m_rendering_surface_ptr->get_queue_families_with_present_support(device_locked_ptr->get_physical_device(), - &present_queue_fams_ptr) ) + if (!m_rendering_surface_ptr->get_queue_families_with_present_support(&present_queue_fams_ptr) ) { anvil_assert_fail(); } - m_present_queue_ptr = device_locked_ptr->get_queue(present_queue_fams_ptr->at(0), - 0); /* in_n_queue */ + m_present_queue_ptr = m_device_ptr->get_queue_for_queue_family_index(present_queue_fams_ptr->at(0), + 0); /* in_n_queue */ } void App::init_window() @@ -902,10 +904,11 @@ void App::init_vulkan() /* Create a Vulkan device */ m_device_ptr = Anvil::SGPUDevice::create(m_physical_device_ptr, + true, /* in_enable_shader_module_cache */ Anvil::DeviceExtensionConfiguration(), - std::vector(), /* layers */ - false, /* transient_command_buffer_allocs_only */ - false); /* support_resettable_command_buffers */ + std::vector(), /* in_layers */ + false, /* in_transient_command_buffer_allocs_only */ + false); /* in_support_resettable_command_buffers */ } VkBool32 App::on_validation_callback(VkDebugReportFlagsEXT message_flags, @@ -931,7 +934,7 @@ void App::run() int main() { - std::shared_ptr app_ptr(new App() ); + std::unique_ptr app_ptr(new App() ); app_ptr->init(); app_ptr->run(); diff --git a/examples/OcclusionQuery/CMakeLists.txt b/examples/OcclusionQuery/CMakeLists.txt index de2203b4..ce75cf22 100644 --- a/examples/OcclusionQuery/CMakeLists.txt +++ b/examples/OcclusionQuery/CMakeLists.txt @@ -18,6 +18,7 @@ endif() add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") +target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") include_directories(${Anvil_SOURCE_DIR}/include ${OcclusionQuery_SOURCE_DIR}/include) diff --git a/examples/OcclusionQuery/include/app.h b/examples/OcclusionQuery/include/app.h index 688dc090..aa0941e3 100644 --- a/examples/OcclusionQuery/include/app.h +++ b/examples/OcclusionQuery/include/app.h @@ -61,47 +61,47 @@ class App const char* message); /* Private variables */ - std::weak_ptr m_device_ptr; - std::shared_ptr m_instance_ptr; - std::weak_ptr m_physical_device_ptr; - std::shared_ptr m_present_queue_ptr; - std::shared_ptr m_rendering_surface_ptr; - std::shared_ptr m_swapchain_ptr; - Anvil::Time m_time; - std::shared_ptr m_window_ptr; - - std::shared_ptr m_depth_image_ptr; - std::shared_ptr m_depth_image_view_ptr; - - std::shared_ptr m_quad_fs_ptr; - std::shared_ptr m_quad_vs_ptr; - std::shared_ptr m_tri_fs_ptr; - std::shared_ptr m_tri_vs_ptr; - - std::shared_ptr m_1stpass_dsg_ptr; - std::shared_ptr m_2ndpass_quad_dsg_ptr; - std::shared_ptr m_2ndpass_tri_dsg_ptr; - - std::shared_ptr m_query_pool_ptr; - - uint32_t m_n_bytes_per_query; - std::shared_ptr m_query_bo_ptr; - std::shared_ptr m_query_data_copied_event; - std::shared_ptr m_time_bo_ptr; - uint32_t m_time_n_bytes_per_swapchain_image; - - std::shared_ptr m_render_tri1_and_generate_ot_data_cmd_buffers[N_SWAPCHAIN_IMAGES]; - std::shared_ptr m_render_tri2_and_quad_cmd_buffers [N_SWAPCHAIN_IMAGES]; + Anvil::SGPUDeviceUniquePtr m_device_ptr; + Anvil::InstanceUniquePtr m_instance_ptr; + const Anvil::PhysicalDevice* m_physical_device_ptr; + Anvil::Queue* m_present_queue_ptr; + Anvil::RenderingSurfaceUniquePtr m_rendering_surface_ptr; + Anvil::SwapchainUniquePtr m_swapchain_ptr; + Anvil::Time m_time; + Anvil::WindowUniquePtr m_window_ptr; + + Anvil::ImageUniquePtr m_depth_image_ptr; + Anvil::ImageViewUniquePtr m_depth_image_view_ptr; + + std::unique_ptr m_quad_fs_ptr; + std::unique_ptr m_quad_vs_ptr; + std::unique_ptr m_tri_fs_ptr; + std::unique_ptr m_tri_vs_ptr; + + Anvil::DescriptorSetGroupUniquePtr m_1stpass_dsg_ptr; + Anvil::DescriptorSetGroupUniquePtr m_2ndpass_quad_dsg_ptr; + Anvil::DescriptorSetGroupUniquePtr m_2ndpass_tri_dsg_ptr; + + Anvil::QueryPoolUniquePtr m_query_pool_ptr; + + uint32_t m_n_bytes_per_query; + Anvil::BufferUniquePtr m_query_bo_ptr; + Anvil::EventUniquePtr m_query_data_copied_event; + Anvil::BufferUniquePtr m_time_bo_ptr; + uint32_t m_time_n_bytes_per_swapchain_image; + + Anvil::PrimaryCommandBufferUniquePtr m_render_tri1_and_generate_ot_data_cmd_buffers[N_SWAPCHAIN_IMAGES]; + Anvil::PrimaryCommandBufferUniquePtr m_render_tri2_and_quad_cmd_buffers [N_SWAPCHAIN_IMAGES]; Anvil::PipelineID m_1stpass_depth_test_always_pipeline_id; Anvil::PipelineID m_1stpass_depth_test_equal_pipeline_id; Anvil::PipelineID m_2ndpass_depth_test_off_quad_pipeline_id; Anvil::PipelineID m_2ndpass_depth_test_off_tri_pipeline_id; - std::shared_ptr m_fbos[N_SWAPCHAIN_IMAGES]; + Anvil::FramebufferUniquePtr m_fbos[N_SWAPCHAIN_IMAGES]; - std::shared_ptr m_renderpass_quad_ptr; - std::shared_ptr m_renderpass_tris_ptr; + Anvil::RenderPassUniquePtr m_renderpass_quad_ptr; + Anvil::RenderPassUniquePtr m_renderpass_tris_ptr; Anvil::SubPassID m_renderpass_1stpass_depth_test_always_subpass_id; Anvil::SubPassID m_renderpass_1stpass_depth_test_equal_ot_subpass_id; @@ -111,6 +111,6 @@ class App uint32_t m_n_last_semaphore_used; const uint32_t m_n_swapchain_images; - std::vector > m_frame_signal_semaphores; - std::vector > m_frame_wait_semaphores; + std::vector m_frame_signal_semaphores; + std::vector m_frame_wait_semaphores; }; diff --git a/examples/OcclusionQuery/src/app.cpp b/examples/OcclusionQuery/src/app.cpp index 06ee3ae2..9cff37a3 100644 --- a/examples/OcclusionQuery/src/app.cpp +++ b/examples/OcclusionQuery/src/app.cpp @@ -164,8 +164,12 @@ static const char* g_glsl_render_tri_vert = App::App() - :m_n_last_semaphore_used(0), - m_n_swapchain_images (N_SWAPCHAIN_IMAGES) + :m_1stpass_depth_test_always_pipeline_id (UINT32_MAX), + m_1stpass_depth_test_equal_pipeline_id (UINT32_MAX), + m_2ndpass_depth_test_off_quad_pipeline_id(UINT32_MAX), + m_2ndpass_depth_test_off_tri_pipeline_id (UINT32_MAX), + m_n_last_semaphore_used (0), + m_n_swapchain_images (N_SWAPCHAIN_IMAGES) { // .. } @@ -177,12 +181,41 @@ App::~App() void App::deinit() { - vkDeviceWaitIdle(m_device_ptr.lock()->get_device_vk() ); + auto gfx_pipeline_manager_ptr = m_device_ptr->get_graphics_pipeline_manager(); + + vkDeviceWaitIdle(m_device_ptr->get_device_vk() ); + + if (m_1stpass_depth_test_always_pipeline_id != UINT32_MAX) + { + gfx_pipeline_manager_ptr->delete_pipeline(m_1stpass_depth_test_always_pipeline_id); + + m_1stpass_depth_test_always_pipeline_id = UINT32_MAX; + } + + if (m_1stpass_depth_test_equal_pipeline_id != UINT32_MAX) + { + gfx_pipeline_manager_ptr->delete_pipeline(m_1stpass_depth_test_equal_pipeline_id); + + m_1stpass_depth_test_equal_pipeline_id = UINT32_MAX; + } + + if (m_2ndpass_depth_test_off_quad_pipeline_id != UINT32_MAX) + { + gfx_pipeline_manager_ptr->delete_pipeline(m_2ndpass_depth_test_off_quad_pipeline_id); + + m_2ndpass_depth_test_off_quad_pipeline_id = UINT32_MAX; + } + + if (m_2ndpass_depth_test_off_tri_pipeline_id != UINT32_MAX) + { + gfx_pipeline_manager_ptr->delete_pipeline(m_2ndpass_depth_test_off_tri_pipeline_id); + + m_2ndpass_depth_test_off_tri_pipeline_id = UINT32_MAX; + } m_frame_signal_semaphores.clear(); m_frame_wait_semaphores.clear(); - m_present_queue_ptr.reset(); m_rendering_surface_ptr.reset(); m_swapchain_ptr.reset(); @@ -212,10 +245,7 @@ void App::deinit() m_fbos[n_swapchain_image].reset(); } - m_device_ptr.lock()->destroy(); m_device_ptr.reset(); - - m_instance_ptr->destroy(); m_instance_ptr.reset(); m_window_ptr.reset(); @@ -223,20 +253,19 @@ void App::deinit() void App::draw_frame() { - std::shared_ptr curr_frame_signal_semaphore_ptr; - std::shared_ptr curr_frame_wait_semaphore_ptr; - std::shared_ptr device_locked_ptr = m_device_ptr.lock(); - static uint32_t n_frames_rendered = 0; - uint32_t n_swapchain_image; - std::shared_ptr present_queue_ptr = device_locked_ptr->get_universal_queue(0); - std::shared_ptr present_wait_semaphore_ptr; - const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; + Anvil::Semaphore* curr_frame_signal_semaphore_ptr = nullptr; + Anvil::Semaphore* curr_frame_wait_semaphore_ptr = nullptr; + static uint32_t n_frames_rendered = 0; + uint32_t n_swapchain_image; + Anvil::Queue* present_queue_ptr = m_device_ptr->get_universal_queue(0); + Anvil::Semaphore* present_wait_semaphore_ptr = nullptr; + const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; /* Determine the signal + wait semaphores to use for drawing this frame */ m_n_last_semaphore_used = (m_n_last_semaphore_used + 1) % m_n_swapchain_images; - curr_frame_signal_semaphore_ptr = m_frame_signal_semaphores[m_n_last_semaphore_used]; - curr_frame_wait_semaphore_ptr = m_frame_wait_semaphores [m_n_last_semaphore_used]; + curr_frame_signal_semaphore_ptr = m_frame_signal_semaphores[m_n_last_semaphore_used].get(); + curr_frame_wait_semaphore_ptr = m_frame_wait_semaphores [m_n_last_semaphore_used].get(); present_wait_semaphore_ptr = curr_frame_signal_semaphore_ptr; @@ -252,10 +281,10 @@ void App::draw_frame() &time); /* Submit work chunks and present */ - std::shared_ptr cmd_buffers[] = + Anvil::CommandBufferBase* cmd_buffers[] = { - m_render_tri1_and_generate_ot_data_cmd_buffers[n_swapchain_image], - m_render_tri2_and_quad_cmd_buffers [n_swapchain_image] + m_render_tri1_and_generate_ot_data_cmd_buffers[n_swapchain_image].get(), + m_render_tri2_and_quad_cmd_buffers [n_swapchain_image].get() }; const uint32_t n_cmd_buffers = sizeof(cmd_buffers) / sizeof(cmd_buffers[0]); @@ -268,7 +297,7 @@ void App::draw_frame() &wait_stage_mask, false); /* should_block */ - present_queue_ptr->present(m_swapchain_ptr, + present_queue_ptr->present(m_swapchain_ptr.get(), n_swapchain_image, 1, /* n_wait_semaphores */ &present_wait_semaphore_ptr); @@ -306,43 +335,48 @@ void App::init() void App::init_buffers() { - std::shared_ptr physical_device_locked_ptr(m_physical_device_ptr); - const VkDeviceSize uniform_alignment_req (physical_device_locked_ptr->get_device_properties().limits.minUniformBufferOffsetAlignment); + const VkDeviceSize uniform_alignment_req(m_physical_device_ptr->get_device_properties().core_vk1_0_properties_ptr->limits.min_uniform_buffer_offset_alignment); m_n_bytes_per_query = static_cast(Anvil::Utils::round_up(sizeof(uint32_t), uniform_alignment_req) ); m_time_n_bytes_per_swapchain_image = static_cast(Anvil::Utils::round_up(sizeof(float), uniform_alignment_req) ); - m_query_bo_ptr = Anvil::Buffer::create_nonsparse( - m_device_ptr, - m_n_bytes_per_query * N_SWAPCHAIN_IMAGES, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT, - 0, /* in_memory_features */ - nullptr); /* opt_client_data */ - - m_time_bo_ptr = Anvil::Buffer::create_nonsparse( - m_device_ptr, - m_time_n_bytes_per_swapchain_image * N_SWAPCHAIN_IMAGES, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, - Anvil::MEMORY_FEATURE_FLAG_MAPPABLE, - nullptr); /* opt_client_data */ + m_query_bo_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), + m_n_bytes_per_query * N_SWAPCHAIN_IMAGES, + Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_EXCLUSIVE, + VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT, + 0, /* in_memory_features */ + nullptr); /* opt_client_data */ + + m_time_bo_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), + m_time_n_bytes_per_swapchain_image * N_SWAPCHAIN_IMAGES, + Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_EXCLUSIVE, + VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, + Anvil::MEMORY_FEATURE_FLAG_MAPPABLE, + nullptr); /* opt_client_data */ } void App::init_command_buffers() { - VkClearValue clear_values[2]; - std::shared_ptr device_locked_ptr (m_device_ptr); - std::shared_ptr gfx_pipeline_manager_ptr (device_locked_ptr->get_graphics_pipeline_manager() ); - const bool is_ext_debug_marker_supported(device_locked_ptr->is_ext_debug_marker_extension_enabled() ); - VkRect2D render_area; - std::shared_ptr tri_1stpass_ds0_ptr (m_1stpass_dsg_ptr->get_descriptor_set (0) ); - std::shared_ptr quad_2ndpass_ds0_ptr (m_2ndpass_quad_dsg_ptr->get_descriptor_set(0) ); - std::shared_ptr tri_2ndpass_ds0_ptr (m_2ndpass_tri_dsg_ptr->get_descriptor_set (0) ); + VkClearValue clear_values[2]; + auto gfx_pipeline_manager_ptr (m_device_ptr->get_graphics_pipeline_manager() ); + const bool is_ext_debug_marker_supported(m_device_ptr->is_ext_debug_marker_extension_enabled() ); + VkRect2D render_area; + auto tri_1stpass_ds0_ptr (m_1stpass_dsg_ptr->get_descriptor_set (0) ); + auto quad_2ndpass_ds0_ptr (m_2ndpass_quad_dsg_ptr->get_descriptor_set(0) ); + auto tri_2ndpass_ds0_ptr (m_2ndpass_tri_dsg_ptr->get_descriptor_set (0) ); + + uint32_t n_universal_queues_available = 0; + const uint32_t* universal_queue_family_indices = nullptr; + + m_device_ptr->get_queue_family_indices_for_queue_family_type(Anvil::QueueFamilyType::UNIVERSAL, + &n_universal_queues_available, + &universal_queue_family_indices); + + anvil_assert(n_universal_queues_available > 0); clear_values[0].color.float32[0] = 1.0f; clear_values[0].color.float32[1] = 1.0f; @@ -362,24 +396,23 @@ void App::init_command_buffers() const uint32_t query_result_offset = m_n_bytes_per_query * n_command_buffer; const uint32_t time_dynamic_offset = m_time_n_bytes_per_swapchain_image * n_command_buffer; - m_render_tri1_and_generate_ot_data_cmd_buffers[n_command_buffer] = device_locked_ptr->get_command_pool(Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL)->alloc_primary_level_command_buffer(); - m_render_tri2_and_quad_cmd_buffers [n_command_buffer] = device_locked_ptr->get_command_pool(Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL)->alloc_primary_level_command_buffer(); + m_render_tri1_and_generate_ot_data_cmd_buffers[n_command_buffer] = m_device_ptr->get_command_pool_for_queue_family_index(universal_queue_family_indices[0])->alloc_primary_level_command_buffer(); + m_render_tri2_and_quad_cmd_buffers [n_command_buffer] = m_device_ptr->get_command_pool_for_queue_family_index(universal_queue_family_indices[0])->alloc_primary_level_command_buffer(); - - std::shared_ptr render_tri1_and_generate_ot_data_cmd_buffer_ptr = m_render_tri1_and_generate_ot_data_cmd_buffers[n_command_buffer]; - std::shared_ptr render_tri2_and_quad_cmd_buffer_ptr = m_render_tri2_and_quad_cmd_buffers [n_command_buffer]; + Anvil::PrimaryCommandBuffer* render_tri1_and_generate_ot_data_cmd_buffer_ptr = m_render_tri1_and_generate_ot_data_cmd_buffers[n_command_buffer].get(); + Anvil::PrimaryCommandBuffer* render_tri2_and_quad_cmd_buffer_ptr = m_render_tri2_and_quad_cmd_buffers [n_command_buffer].get(); render_tri1_and_generate_ot_data_cmd_buffer_ptr->start_recording(false, /* one_time_submit */ true); /* simultaneous_use_allowed */ { - render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_reset_event(m_query_data_copied_event, + render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_reset_event(m_query_data_copied_event.get(), VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT); render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_begin_render_pass(sizeof(clear_values) / sizeof(clear_values[0]), clear_values, - m_fbos[n_command_buffer], + m_fbos[n_command_buffer].get(), render_area, - m_renderpass_tris_ptr, + m_renderpass_tris_ptr.get(), VK_SUBPASS_CONTENTS_INLINE); { if (is_ext_debug_marker_supported) @@ -423,7 +456,7 @@ void App::init_command_buffers() render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_bind_pipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, m_1stpass_depth_test_equal_pipeline_id); - render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_begin_query(m_query_pool_ptr, + render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_begin_query(m_query_pool_ptr.get(), n_command_buffer, 0); /* in_flags */ { @@ -432,7 +465,7 @@ void App::init_command_buffers() 0, /* in_first_vertex */ 1); /* in_first_instance */ } - render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_end_query(m_query_pool_ptr, + render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_end_query(m_query_pool_ptr.get(), n_command_buffer); if (is_ext_debug_marker_supported) @@ -442,14 +475,14 @@ void App::init_command_buffers() } render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_end_render_pass(); - render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_copy_query_pool_results(m_query_pool_ptr, + render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_copy_query_pool_results(m_query_pool_ptr.get(), n_command_buffer, 1, /* in_query_count */ - m_query_bo_ptr, + m_query_bo_ptr.get(), m_n_bytes_per_query * n_command_buffer, /* in_dst_offset */ 0, /* in_dst_stride */ VK_QUERY_RESULT_WAIT_BIT); - render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_set_event (m_query_data_copied_event, + render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_set_event (m_query_data_copied_event.get(), VK_PIPELINE_STAGE_TRANSFER_BIT); } render_tri1_and_generate_ot_data_cmd_buffer_ptr->stop_recording(); @@ -458,16 +491,17 @@ void App::init_command_buffers() true); /* simultaneous_use_allowed */ { /* Wait until query data arrives */ - Anvil::BufferBarrier query_data_barrier(VK_ACCESS_TRANSFER_WRITE_BIT, - VK_ACCESS_UNIFORM_READ_BIT, - device_locked_ptr->get_queue_family_index(Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL), - device_locked_ptr->get_queue_family_index(Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL), - m_query_bo_ptr, - query_result_offset, /* in_offset */ - m_n_bytes_per_query); /* in_size */ + Anvil::BufferBarrier query_data_barrier (VK_ACCESS_TRANSFER_WRITE_BIT, + VK_ACCESS_UNIFORM_READ_BIT, + universal_queue_family_indices[0], + universal_queue_family_indices[0], + m_query_bo_ptr.get(), + query_result_offset, /* in_offset */ + m_n_bytes_per_query); /* in_size */ + auto query_data_copied_event_raw_ptr(m_query_data_copied_event.get() ); render_tri2_and_quad_cmd_buffer_ptr->record_wait_events(1, /* in_event_count */ - &m_query_data_copied_event, + &query_data_copied_event_raw_ptr, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_VERTEX_SHADER_BIT, 0, /* in_memory_barrier_count */ @@ -486,9 +520,9 @@ void App::init_command_buffers() /* Rasterize the right triangle */ render_tri2_and_quad_cmd_buffer_ptr->record_begin_render_pass(0, /* in_n_clear_values */ nullptr, /* in_clear_value_ptrs */ - m_fbos[n_command_buffer], + m_fbos[n_command_buffer].get(), render_area, - m_renderpass_quad_ptr, + m_renderpass_quad_ptr.get(), VK_SUBPASS_CONTENTS_INLINE); { render_tri2_and_quad_cmd_buffer_ptr->record_bind_pipeline (VK_PIPELINE_BIND_POINT_GRAPHICS, @@ -537,9 +571,9 @@ void App::init_command_buffers() void App::init_dsgs() { - std::vector > dsg_1stpass_info_ptrs (1); - std::vector > quad_dsg_2ndpass_info_ptrs(1); - std::vector > tri_dsg_2ndpass_info_ptrs (1); + std::vector dsg_1stpass_info_ptrs (1); + std::vector quad_dsg_2ndpass_info_ptrs(1); + std::vector tri_dsg_2ndpass_info_ptrs (1); dsg_1stpass_info_ptrs [0] = Anvil::DescriptorSetInfo::create(); quad_dsg_2ndpass_info_ptrs[0] = Anvil::DescriptorSetInfo::create(); @@ -559,36 +593,36 @@ void App::init_dsgs() 1, /* n_elements */ VK_SHADER_STAGE_VERTEX_BIT); - m_1stpass_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr, + m_1stpass_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), dsg_1stpass_info_ptrs, false); /* in_releaseable_sets */ - m_2ndpass_tri_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr, + m_2ndpass_tri_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), tri_dsg_2ndpass_info_ptrs, false); /* in_releaseable_sets */ - m_2ndpass_quad_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr, + m_2ndpass_quad_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), quad_dsg_2ndpass_info_ptrs, false); /* in_releaseable_sets */ m_1stpass_dsg_ptr->set_binding_item (0, /* n_set */ 0, /* binding_index */ - Anvil::DescriptorSet::DynamicUniformBufferBindingElement(m_time_bo_ptr, + Anvil::DescriptorSet::DynamicUniformBufferBindingElement(m_time_bo_ptr.get(), 0, /* in_start_offset */ m_time_n_bytes_per_swapchain_image) ); m_2ndpass_tri_dsg_ptr->set_binding_item (0, /* n_set */ 0, /* binding_index */ - Anvil::DescriptorSet::DynamicUniformBufferBindingElement(m_time_bo_ptr, + Anvil::DescriptorSet::DynamicUniformBufferBindingElement(m_time_bo_ptr.get(), 0, /* in_start_offset */ m_time_n_bytes_per_swapchain_image) ); m_2ndpass_quad_dsg_ptr->set_binding_item(0, /* n_set */ 0, /* binding_index */ - Anvil::DescriptorSet::DynamicUniformBufferBindingElement(m_query_bo_ptr, + Anvil::DescriptorSet::DynamicUniformBufferBindingElement(m_query_bo_ptr.get(), 0, /* in_start_offset */ m_n_bytes_per_query)); } void App::init_events() { - m_query_data_copied_event = Anvil::Event::create(m_device_ptr); + m_query_data_copied_event = Anvil::Event::create(m_device_ptr.get() ); m_query_data_copied_event->set_name("Query data copied event"); } @@ -599,7 +633,7 @@ void App::init_framebuffers() n_swapchain_image < N_SWAPCHAIN_IMAGES; ++n_swapchain_image) { - m_fbos[n_swapchain_image] = Anvil::Framebuffer::create(m_device_ptr, + m_fbos[n_swapchain_image] = Anvil::Framebuffer::create(m_device_ptr.get(), WINDOW_WIDTH, WINDOW_HEIGHT, 1); /* n_layers */ @@ -609,70 +643,69 @@ void App::init_framebuffers() m_fbos[n_swapchain_image]->add_attachment(m_swapchain_ptr->get_image_view(n_swapchain_image), nullptr); /* out_opt_attachment_id_ptr */ - m_fbos[n_swapchain_image]->add_attachment(m_depth_image_view_ptr, + m_fbos[n_swapchain_image]->add_attachment(m_depth_image_view_ptr.get(), nullptr); /* out_opt_attachment_id_ptr */ } } void App::init_images() { - m_depth_image_ptr = Anvil::Image::create_nonsparse( - m_device_ptr, - VK_IMAGE_TYPE_2D, - VK_FORMAT_D16_UNORM, - VK_IMAGE_TILING_OPTIMAL, - VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, - WINDOW_WIDTH, - WINDOW_HEIGHT, - 1, /* base_mipmap_depth */ - 1, /* n_layers */ - VK_SAMPLE_COUNT_1_BIT, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - false, /* use_full_mipmap_chain */ - 0, /* in_memory_features */ - false, /* is_mutable */ - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, - nullptr); - - m_depth_image_view_ptr = Anvil::ImageView::create_2D( - m_device_ptr, - m_depth_image_ptr, - 0, /* n_base_layer */ - 0, /* n_base_mipmap_level */ - 1, /* n_mipmaps */ - VK_IMAGE_ASPECT_DEPTH_BIT, - m_depth_image_ptr->get_image_format(), - VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY); + m_depth_image_ptr = Anvil::Image::create_nonsparse(m_device_ptr.get(), + VK_IMAGE_TYPE_2D, + VK_FORMAT_D16_UNORM, + VK_IMAGE_TILING_OPTIMAL, + VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, + WINDOW_WIDTH, + WINDOW_HEIGHT, + 1, /* base_mipmap_depth */ + 1, /* n_layers */ + VK_SAMPLE_COUNT_1_BIT, + Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_EXCLUSIVE, + false, /* use_full_mipmap_chain */ + 0, /* in_memory_features */ + false, /* is_mutable */ + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + nullptr); + + m_depth_image_view_ptr = Anvil::ImageView::create_2D(m_device_ptr.get(), + m_depth_image_ptr.get(), + 0, /* n_base_layer */ + 0, /* n_base_mipmap_level */ + 1, /* n_mipmaps */ + VK_IMAGE_ASPECT_DEPTH_BIT, + m_depth_image_ptr->get_image_format(), + VK_COMPONENT_SWIZZLE_IDENTITY, + VK_COMPONENT_SWIZZLE_IDENTITY, + VK_COMPONENT_SWIZZLE_IDENTITY, + VK_COMPONENT_SWIZZLE_IDENTITY); } void App::init_query_pool() { - m_query_pool_ptr = Anvil::QueryPool::create_non_ps_query_pool(m_device_ptr, + m_query_pool_ptr = Anvil::QueryPool::create_non_ps_query_pool(m_device_ptr.get(), VK_QUERY_TYPE_OCCLUSION, N_SWAPCHAIN_IMAGES); } void App::init_renderpasses() { - std::shared_ptr device_locked_ptr (m_device_ptr); - std::shared_ptr gfx_pipeline_manager_ptr(device_locked_ptr->get_graphics_pipeline_manager() ); + auto gfx_pipeline_manager_ptr(m_device_ptr->get_graphics_pipeline_manager() ); for (uint32_t n_renderpass = 0; n_renderpass < 2; /* quad, tri */ ++n_renderpass) { - Anvil::RenderPassAttachmentID color_attachment_id; - Anvil::RenderPassAttachmentID ds_attachment_id; - const bool is_2nd_renderpass = (n_renderpass == 1); - std::shared_ptr renderpass_ptr; + Anvil::RenderPassAttachmentID color_attachment_id; + Anvil::RenderPassAttachmentID ds_attachment_id; + const bool is_2nd_renderpass = (n_renderpass == 1); + Anvil::RenderPassUniquePtr renderpass_ptr; { - std::unique_ptr renderpass_info_ptr(new Anvil::RenderPassInfo(m_device_ptr) ); + Anvil::RenderPassInfoUniquePtr renderpass_info_ptr( + new Anvil::RenderPassInfo(m_device_ptr.get() ) + ); renderpass_info_ptr->add_color_attachment(m_swapchain_ptr->get_image_format(), VK_SAMPLE_COUNT_1_BIT, @@ -762,7 +795,7 @@ void App::init_renderpasses() } renderpass_ptr = Anvil::RenderPass::create(std::move(renderpass_info_ptr), - m_swapchain_ptr); + m_swapchain_ptr.get() ); } renderpass_ptr->set_name( (n_renderpass == 0) ? "Quad renderpass" @@ -772,7 +805,7 @@ void App::init_renderpasses() { auto depth_test_off_tri_subpass_gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ false, /* in_allow_derivatives */ - renderpass_ptr, + renderpass_ptr.get(), m_renderpass_2ndpass_depth_test_off_tri_subpass_id, *m_tri_fs_ptr, Anvil::ShaderModuleStageEntryPoint(), /* in_geometry_shader_entrypoint */ @@ -781,7 +814,7 @@ void App::init_renderpasses() *m_tri_vs_ptr); auto depth_test_off_quad_subpass_gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ false, /* in_allow_derivatives */ - renderpass_ptr, + renderpass_ptr.get(), m_renderpass_2ndpass_depth_test_off_quad_subpass_id, *m_quad_fs_ptr, Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ @@ -791,9 +824,9 @@ void App::init_renderpasses() - depth_test_off_tri_subpass_gfx_pipeline_info_ptr->set_dsg(m_2ndpass_tri_dsg_ptr); + depth_test_off_tri_subpass_gfx_pipeline_info_ptr->set_descriptor_set_info (m_2ndpass_tri_dsg_ptr->get_descriptor_set_info() ); + depth_test_off_quad_subpass_gfx_pipeline_info_ptr->set_descriptor_set_info(m_2ndpass_quad_dsg_ptr->get_descriptor_set_info() ); - depth_test_off_quad_subpass_gfx_pipeline_info_ptr->set_dsg (m_2ndpass_quad_dsg_ptr); depth_test_off_quad_subpass_gfx_pipeline_info_ptr->set_primitive_topology(VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP); @@ -802,13 +835,13 @@ void App::init_renderpasses() gfx_pipeline_manager_ptr->add_pipeline(std::move(depth_test_off_tri_subpass_gfx_pipeline_info_ptr), &m_2ndpass_depth_test_off_tri_pipeline_id); - m_renderpass_quad_ptr = renderpass_ptr; + m_renderpass_quad_ptr = std::move(renderpass_ptr); } else { auto depth_test_always_subpass_gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ false, /* in_allow_derivatives */ - renderpass_ptr, + renderpass_ptr.get(), m_renderpass_1stpass_depth_test_always_subpass_id, *m_tri_fs_ptr, Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ @@ -817,7 +850,7 @@ void App::init_renderpasses() *m_tri_vs_ptr); auto depth_test_equal_ot_subpass_gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ false, /* in_allow_derivatives */ - renderpass_ptr, + renderpass_ptr.get(), m_renderpass_1stpass_depth_test_equal_ot_subpass_id, *m_tri_fs_ptr, Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ @@ -825,15 +858,15 @@ void App::init_renderpasses() Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader_entrypoint */ *m_tri_vs_ptr); - depth_test_always_subpass_gfx_pipeline_info_ptr->set_dsg (m_1stpass_dsg_ptr); - depth_test_always_subpass_gfx_pipeline_info_ptr->toggle_depth_test (true, /* in_should_enable */ - VK_COMPARE_OP_ALWAYS); - depth_test_always_subpass_gfx_pipeline_info_ptr->toggle_depth_writes(true); /* in_should_enable */ + depth_test_always_subpass_gfx_pipeline_info_ptr->set_descriptor_set_info(m_1stpass_dsg_ptr->get_descriptor_set_info() ); + depth_test_always_subpass_gfx_pipeline_info_ptr->toggle_depth_test (true, /* in_should_enable */ + VK_COMPARE_OP_ALWAYS); + depth_test_always_subpass_gfx_pipeline_info_ptr->toggle_depth_writes (true); /* in_should_enable */ - depth_test_equal_ot_subpass_gfx_pipeline_info_ptr->set_dsg (m_1stpass_dsg_ptr); - depth_test_equal_ot_subpass_gfx_pipeline_info_ptr->toggle_depth_test (true, /* in_should_enable */ - VK_COMPARE_OP_EQUAL); - depth_test_equal_ot_subpass_gfx_pipeline_info_ptr->toggle_depth_writes(true); /* in_should_enable */ + depth_test_equal_ot_subpass_gfx_pipeline_info_ptr->set_descriptor_set_info(m_1stpass_dsg_ptr->get_descriptor_set_info() ); + depth_test_equal_ot_subpass_gfx_pipeline_info_ptr->toggle_depth_test (true, /* in_should_enable */ + VK_COMPARE_OP_EQUAL); + depth_test_equal_ot_subpass_gfx_pipeline_info_ptr->toggle_depth_writes (true); /* in_should_enable */ gfx_pipeline_manager_ptr->add_pipeline(std::move(depth_test_always_subpass_gfx_pipeline_info_ptr), @@ -841,7 +874,7 @@ void App::init_renderpasses() gfx_pipeline_manager_ptr->add_pipeline(std::move(depth_test_equal_ot_subpass_gfx_pipeline_info_ptr), &m_1stpass_depth_test_equal_pipeline_id); - m_renderpass_tris_ptr = renderpass_ptr; + m_renderpass_tris_ptr = std::move(renderpass_ptr); } } } @@ -852,43 +885,43 @@ void App::init_semaphores() n_semaphore < m_n_swapchain_images; ++n_semaphore) { - std::shared_ptr new_signal_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr); - std::shared_ptr new_wait_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr); + auto new_signal_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); + auto new_wait_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); new_signal_semaphore_ptr->set_name_formatted("Frame signal semaphore [%d]", n_semaphore); new_wait_semaphore_ptr->set_name_formatted ("Frame wait semaphore [%d]", n_semaphore); - m_frame_signal_semaphores.push_back(new_signal_semaphore_ptr); - m_frame_wait_semaphores.push_back (new_wait_semaphore_ptr); + m_frame_signal_semaphores.push_back(std::move(new_signal_semaphore_ptr) ); + m_frame_wait_semaphores.push_back (std::move(new_wait_semaphore_ptr) ); } } void App::init_shaders() { - std::shared_ptr fs_quad_glsl_ptr; - std::shared_ptr fs_quad_module_ptr; - std::shared_ptr fs_tri_glsl_ptr; - std::shared_ptr fs_tri_module_ptr; - std::shared_ptr vs_quad_glsl_ptr; - std::shared_ptr vs_quad_module_ptr; - std::shared_ptr vs_tri_glsl_ptr; - std::shared_ptr vs_tri_module_ptr; - - fs_quad_glsl_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr, + Anvil::GLSLShaderToSPIRVGeneratorUniquePtr fs_quad_glsl_ptr; + Anvil::ShaderModuleUniquePtr fs_quad_module_ptr; + Anvil::GLSLShaderToSPIRVGeneratorUniquePtr fs_tri_glsl_ptr; + Anvil::ShaderModuleUniquePtr fs_tri_module_ptr; + Anvil::GLSLShaderToSPIRVGeneratorUniquePtr vs_quad_glsl_ptr; + Anvil::ShaderModuleUniquePtr vs_quad_module_ptr; + Anvil::GLSLShaderToSPIRVGeneratorUniquePtr vs_tri_glsl_ptr; + Anvil::ShaderModuleUniquePtr vs_tri_module_ptr; + + fs_quad_glsl_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_render_quad_frag, Anvil::SHADER_STAGE_FRAGMENT); - fs_tri_glsl_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr, + fs_tri_glsl_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_render_tri_frag, Anvil::SHADER_STAGE_FRAGMENT); - vs_quad_glsl_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr, + vs_quad_glsl_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_render_quad_vert, Anvil::SHADER_STAGE_VERTEX); - vs_tri_glsl_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr, + vs_tri_glsl_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_render_tri_vert, Anvil::SHADER_STAGE_VERTEX); @@ -897,14 +930,14 @@ void App::init_shaders() N_SWAPCHAIN_IMAGES); - fs_quad_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr, - fs_quad_glsl_ptr); - fs_tri_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr, - fs_tri_glsl_ptr); - vs_quad_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr, - vs_quad_glsl_ptr); - vs_tri_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr, - vs_tri_glsl_ptr); + fs_quad_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr.get (), + fs_quad_glsl_ptr.get() ); + fs_tri_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr.get (), + fs_tri_glsl_ptr.get () ); + vs_quad_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr.get (), + vs_quad_glsl_ptr.get() ); + vs_tri_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr.get (), + vs_tri_glsl_ptr.get () ); fs_quad_module_ptr->set_name("Quad fragment shader module"); fs_tri_module_ptr->set_name ("Triangle fragment shader module"); @@ -913,62 +946,55 @@ void App::init_shaders() m_quad_fs_ptr.reset( - new Anvil::ShaderModuleStageEntryPoint( - "main", - fs_quad_module_ptr, - Anvil::SHADER_STAGE_FRAGMENT) + new Anvil::ShaderModuleStageEntryPoint("main", + std::move(fs_quad_module_ptr), + Anvil::SHADER_STAGE_FRAGMENT) ); m_quad_vs_ptr.reset( - new Anvil::ShaderModuleStageEntryPoint( - "main", - vs_quad_module_ptr, - Anvil::SHADER_STAGE_VERTEX) + new Anvil::ShaderModuleStageEntryPoint("main", + std::move(vs_quad_module_ptr), + Anvil::SHADER_STAGE_VERTEX) ); m_tri_fs_ptr.reset( - new Anvil::ShaderModuleStageEntryPoint( - "main", - fs_tri_module_ptr, - Anvil::SHADER_STAGE_FRAGMENT) + new Anvil::ShaderModuleStageEntryPoint("main", + std::move(fs_tri_module_ptr), + Anvil::SHADER_STAGE_FRAGMENT) ); m_tri_vs_ptr.reset( - new Anvil::ShaderModuleStageEntryPoint( - "main", - vs_tri_module_ptr, - Anvil::SHADER_STAGE_VERTEX) + new Anvil::ShaderModuleStageEntryPoint("main", + std::move(vs_tri_module_ptr), + Anvil::SHADER_STAGE_VERTEX) ); } void App::init_swapchain() { - std::shared_ptr device_locked_ptr(m_device_ptr); - - m_rendering_surface_ptr = Anvil::RenderingSurface::create(m_instance_ptr, - m_device_ptr, - m_window_ptr); + m_rendering_surface_ptr = Anvil::RenderingSurface::create(m_instance_ptr.get(), + m_device_ptr.get (), + m_window_ptr.get () ); m_rendering_surface_ptr->set_name("Main rendering surface"); - m_swapchain_ptr = device_locked_ptr->create_swapchain(m_rendering_surface_ptr, - m_window_ptr, - VK_FORMAT_B8G8R8A8_UNORM, - VK_PRESENT_MODE_FIFO_KHR, - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, - m_n_swapchain_images); + m_swapchain_ptr = m_device_ptr->create_swapchain(m_rendering_surface_ptr.get(), + m_window_ptr.get (), + VK_FORMAT_B8G8R8A8_UNORM, + VK_PRESENT_MODE_FIFO_KHR, + VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, + m_n_swapchain_images); m_swapchain_ptr->set_name("Main swapchain"); /* Cache the queue we are going to use for presentation */ const std::vector* present_queue_fams_ptr = nullptr; - if (!m_rendering_surface_ptr->get_queue_families_with_present_support(device_locked_ptr->get_physical_device(), - &present_queue_fams_ptr) ) + if (!m_rendering_surface_ptr->get_queue_families_with_present_support(&present_queue_fams_ptr) ) { anvil_assert_fail(); } - m_present_queue_ptr = device_locked_ptr->get_queue(present_queue_fams_ptr->at(0), - 0); /* in_n_queue */ + m_present_queue_ptr = m_device_ptr->get_queue_for_queue_family_index(present_queue_fams_ptr->at(0), + 0); /* in_n_queue */ } void App::init_window() @@ -1015,10 +1041,11 @@ void App::init_vulkan() /* Create a Vulkan device */ m_device_ptr = Anvil::SGPUDevice::create(m_physical_device_ptr, + true, /* in_enable_shader_module_cache */ Anvil::DeviceExtensionConfiguration(), - std::vector(), /* layers */ - false, /* transient_command_buffer_allocs_only */ - false); /* support_resettable_command_buffers */ + std::vector(), /* in_layers */ + false, /* in_transient_command_buffer_allocs_only */ + false); /* in_support_resettable_command_buffers */ } VkBool32 App::on_validation_callback(VkDebugReportFlagsEXT message_flags, @@ -1044,7 +1071,7 @@ void App::run() int main() { - std::shared_ptr app_ptr(new App() ); + std::unique_ptr app_ptr(new App() ); app_ptr->init(); app_ptr->run(); diff --git a/examples/OutOfOrderRasterization/CMakeLists.txt b/examples/OutOfOrderRasterization/CMakeLists.txt index ba91e7c7..a180516d 100644 --- a/examples/OutOfOrderRasterization/CMakeLists.txt +++ b/examples/OutOfOrderRasterization/CMakeLists.txt @@ -18,6 +18,7 @@ endif() add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") +target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") include_directories(${Anvil_SOURCE_DIR}/include ${OutOfOrderRasterization_SOURCE_DIR}/include) diff --git a/examples/OutOfOrderRasterization/include/app.h b/examples/OutOfOrderRasterization/include/app.h index bcdc770d..9c86a88d 100644 --- a/examples/OutOfOrderRasterization/include/app.h +++ b/examples/OutOfOrderRasterization/include/app.h @@ -67,54 +67,50 @@ class App const char* message); /* Private variables */ - std::weak_ptr m_device_ptr; - std::shared_ptr m_instance_ptr; - std::shared_ptr m_present_queue_ptr; - std::shared_ptr m_query_pool_ptr; - std::shared_ptr m_rendering_surface_ptr; - std::shared_ptr m_swapchain_ptr; - std::shared_ptr m_window_ptr; + Anvil::SGPUDeviceUniquePtr m_device_ptr; - std::shared_ptr m_depth_image_ptr; - std::shared_ptr m_depth_image_view_ptr; - std::vector > m_framebuffers; - std::shared_ptr m_fs_entrypoint_ptr; + Anvil::InstanceUniquePtr m_instance_ptr; + Anvil::Queue* m_present_queue_ptr; + Anvil::QueryPoolUniquePtr m_query_pool_ptr; + Anvil::RenderingSurfaceUniquePtr m_rendering_surface_ptr; + Anvil::SwapchainUniquePtr m_swapchain_ptr; + Anvil::WindowUniquePtr m_window_ptr; - std::vector > m_render_cmdbuffers_ooo_off; - std::vector > m_render_cmdbuffers_ooo_on; + Anvil::ImageUniquePtr m_depth_image_ptr; + Anvil::ImageViewUniquePtr m_depth_image_view_ptr; + std::vector m_framebuffers; + std::unique_ptr m_fs_entrypoint_ptr; - std::vector > m_renderpasses; - std::shared_ptr m_vs_entrypoint_ptr; + std::vector m_render_cmdbuffers_ooo_off; + std::vector m_render_cmdbuffers_ooo_on; + + std::vector m_renderpasses; + std::unique_ptr m_vs_entrypoint_ptr; uint32_t m_n_indices; uint32_t m_n_last_semaphore_used; const uint32_t m_n_swapchain_images; bool m_ooo_enabled; bool m_should_rotate; - std::shared_ptr m_teapot_props_data_ptr; + std::unique_ptr m_teapot_props_data_ptr; Anvil::Time m_time; - typedef struct - { - /* Holds as many semaphores as there are physical devices bound to a logical device */ - std::vector > semaphores; - } SemaphoreBundle; - - std::vector m_frame_signal_semaphore_bundles; - std::vector m_frame_wait_semaphore_bundles; + std::vector m_frame_acquisition_wait_semaphores; + std::vector m_frame_signal_semaphores; + std::vector m_frame_wait_semaphores; bool m_frame_drawn_status[N_SWAPCHAIN_IMAGES]; Anvil::PipelineID m_general_pipeline_id; Anvil::PipelineID m_ooo_disabled_pipeline_id; Anvil::PipelineID m_ooo_enabled_pipeline_id; - std::shared_ptr m_index_buffer_ptr; - std::shared_ptr m_query_results_buffer_ptr; - std::shared_ptr m_vertex_buffer_ptr; + Anvil::BufferUniquePtr m_index_buffer_ptr; + Anvil::BufferUniquePtr m_query_results_buffer_ptr; + Anvil::BufferUniquePtr m_vertex_buffer_ptr; - std::vector > m_dsg_ptrs; - std::vector > m_properties_buffer_ptrs; - bool m_properties_data_set; + std::vector m_dsg_ptrs; + std::vector m_properties_buffer_ptrs; + bool m_properties_data_set; uint32_t m_n_frames_drawn; std::vector m_timestamp_deltas; diff --git a/examples/OutOfOrderRasterization/src/app.cpp b/examples/OutOfOrderRasterization/src/app.cpp index 283fa1f7..9fd974b4 100644 --- a/examples/OutOfOrderRasterization/src/app.cpp +++ b/examples/OutOfOrderRasterization/src/app.cpp @@ -59,18 +59,6 @@ #include "teapot_data.h" #include "app.h" -/* Sanity checks */ -#if defined(_WIN32) - #if !defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) && !defined(ENABLE_OFFSCREEN_RENDERING) - #error Anvil has not been built with Win32/64 window system support. The application can only be built in offscreen rendering mode. - #endif -#else - #if !defined(ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT) && !defined(ENABLE_OFFSCREEN_RENDERING) - #error Anvil has not been built with XCB window system support. The application can only be built in offscreen rendering mode. - #endif -#endif - - /* Low-level #defines follow.. */ /* When offscreen rendering is enabled, N_FRAMES_TO_RENDER tells how many frames should be @@ -165,15 +153,15 @@ static const char* vs_body = App::App() - :m_general_pipeline_id (-1), - m_n_frames_drawn ( 0), - m_n_indices ( 0), - m_n_last_semaphore_used (-1), - m_n_swapchain_images (N_SWAPCHAIN_IMAGES), - m_ooo_disabled_pipeline_id (-1), - m_ooo_enabled (false), - m_ooo_enabled_pipeline_id (-1), - m_should_rotate (true) + :m_general_pipeline_id (-1), + m_n_frames_drawn ( 0), + m_n_indices ( 0), + m_n_last_semaphore_used (-1), + m_n_swapchain_images (N_SWAPCHAIN_IMAGES), + m_ooo_disabled_pipeline_id(-1), + m_ooo_enabled (false), + m_ooo_enabled_pipeline_id (-1), + m_should_rotate (true) { memset(m_frame_drawn_status, 0, @@ -207,7 +195,7 @@ void App::clear_console_line() void App::deinit() { - vkDeviceWaitIdle(m_device_ptr.lock()->get_device_vk() ); + vkDeviceWaitIdle(m_device_ptr->get_device_vk() ); const Anvil::PipelineID gfx_pipeline_ids[] = { @@ -218,8 +206,7 @@ void App::deinit() const uint32_t n_gfx_pipeline_ids = sizeof(gfx_pipeline_ids) / sizeof(gfx_pipeline_ids[0]); { - std::shared_ptr device_locked_ptr (m_device_ptr); - std::shared_ptr gfx_pipeline_manager_ptr(device_locked_ptr->get_graphics_pipeline_manager() ); + auto gfx_pipeline_manager_ptr(m_device_ptr->get_graphics_pipeline_manager() ); for (uint32_t n_gfx_pipeline_id = 0; n_gfx_pipeline_id < n_gfx_pipeline_ids; @@ -232,8 +219,8 @@ void App::deinit() } m_dsg_ptrs.clear(); - m_frame_signal_semaphore_bundles.clear(); - m_frame_wait_semaphore_bundles.clear(); + m_frame_signal_semaphores.clear(); + m_frame_wait_semaphores.clear(); m_framebuffers.clear(); m_properties_buffer_ptrs.clear(); m_render_cmdbuffers_ooo_on.clear(); @@ -249,14 +236,10 @@ void App::deinit() m_vertex_buffer_ptr.reset(); m_vs_entrypoint_ptr.reset(); - m_present_queue_ptr.reset(); m_rendering_surface_ptr.reset(); m_swapchain_ptr.reset(); - m_device_ptr.lock()->destroy(); m_device_ptr.reset(); - - m_instance_ptr->destroy(); m_instance_ptr.reset(); m_window_ptr.reset(); @@ -264,57 +247,23 @@ void App::deinit() void App::draw_frame() { - std::shared_ptr device_locked_ptr = m_device_ptr.lock(); - const Anvil::DeviceType device_type = device_locked_ptr->get_type(); - static const VkPipelineStageFlags dst_stage_mask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; - std::shared_ptr frame_ready_for_present_semaphore_ptr; - std::shared_ptr frame_ready_for_render_semaphore_ptr; - uint32_t n_physical_devices; - uint32_t n_swapchain_image; - std::weak_ptr physical_device_ptr; - std::shared_ptr render_cmdbuffer_ptr; - const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; - - switch (device_type) - { - case Anvil::DEVICE_TYPE_SINGLE_GPU: - { - std::shared_ptr sgpu_device_locked_ptr(std::dynamic_pointer_cast(device_locked_ptr) ); - - n_physical_devices = 1; - physical_device_ptr = sgpu_device_locked_ptr->get_physical_device(); - - break; - } - - default: - { - anvil_assert(false); - } - } + const Anvil::DeviceType device_type = m_device_ptr->get_type(); + static const VkPipelineStageFlags dst_stage_mask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; + Anvil::Semaphore* frame_ready_for_present_semaphore_ptr = nullptr; + uint32_t n_swapchain_image; + Anvil::PrimaryCommandBuffer* render_cmdbuffer_ptr = nullptr; + const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; /* Determine the signal + wait semaphores to use for drawing this frame */ m_n_last_semaphore_used = (m_n_last_semaphore_used + 1) % m_n_swapchain_images; - auto& curr_frame_signal_semaphores = m_frame_signal_semaphore_bundles.at (m_n_last_semaphore_used); - auto& curr_frame_wait_semaphores = m_frame_wait_semaphore_bundles.at (m_n_last_semaphore_used); - auto& curr_frame_acqusition_wait_semaphore_ptr = curr_frame_wait_semaphores.semaphores.at(0); - - const auto& present_wait_semaphores = curr_frame_signal_semaphores; + auto curr_frame_signal_semaphore_ptr = m_frame_signal_semaphores.at(m_n_last_semaphore_used).get(); + auto curr_frame_wait_semaphore_ptr = m_frame_wait_semaphores.at (m_n_last_semaphore_used).get(); /* Determine the semaphore which the swapchain image */ - n_swapchain_image = m_swapchain_ptr->acquire_image(curr_frame_acqusition_wait_semaphore_ptr, + n_swapchain_image = m_swapchain_ptr->acquire_image(curr_frame_wait_semaphore_ptr, true); /* in_should_block */ - /* Set up semaphores we're going to use to render this frame. */ - for (uint32_t n_signal_sem = 0; - n_signal_sem < n_physical_devices; - ++n_signal_sem) - { - frame_ready_for_present_semaphore_ptr = curr_frame_signal_semaphores.semaphores[n_signal_sem]; - frame_ready_for_render_semaphore_ptr = curr_frame_wait_semaphores.semaphores [n_signal_sem]; - } - /* if the frame has already been rendered to in the past, then given the fact we use FIFO presentation mode, * we should be safe to extract the timestamps which must have been written by now. */ @@ -323,7 +272,7 @@ void App::draw_frame() uint64_t timestamps[2]; /* top of pipe, bottom of pipe */ /* TODO: Do better than this. */ - vkDeviceWaitIdle(device_locked_ptr->get_device_vk() ); + vkDeviceWaitIdle(m_device_ptr->get_device_vk() ); const uint32_t n_iterations = 1; @@ -352,30 +301,26 @@ void App::draw_frame() /* Submit work chunks and present */ if (m_ooo_enabled) { - render_cmdbuffer_ptr = m_render_cmdbuffers_ooo_on.at(n_swapchain_image); + render_cmdbuffer_ptr = m_render_cmdbuffers_ooo_on.at(n_swapchain_image).get(); } else { - render_cmdbuffer_ptr = m_render_cmdbuffers_ooo_off.at(n_swapchain_image); - } - - { - m_present_queue_ptr->submit_command_buffer_with_signal_wait_semaphores(render_cmdbuffer_ptr, - 1, /* n_semaphores_to_signal */ - &frame_ready_for_present_semaphore_ptr, - 1, /* n_semaphores_to_wait_on */ - &frame_ready_for_render_semaphore_ptr, - &wait_stage_mask, - false /* should_block */); - } - - { - m_present_queue_ptr->present(m_swapchain_ptr, - n_swapchain_image, - 1, /* n_wait_semaphores */ - &frame_ready_for_present_semaphore_ptr); + render_cmdbuffer_ptr = m_render_cmdbuffers_ooo_off.at(n_swapchain_image).get(); } + m_present_queue_ptr->submit_command_buffer_with_signal_wait_semaphores(render_cmdbuffer_ptr, + 1, /* n_semaphores_to_signal */ + &curr_frame_signal_semaphore_ptr, + 1, /* n_semaphores_to_wait_on */ + &curr_frame_wait_semaphore_ptr, + &wait_stage_mask, + false /* should_block */); + + m_present_queue_ptr->present(m_swapchain_ptr.get(), + n_swapchain_image, + 1, /* n_wait_semaphores */ + &curr_frame_signal_semaphore_ptr); + ++m_n_frames_drawn; m_frame_drawn_status[n_swapchain_image] = true; @@ -410,30 +355,29 @@ void App::init() void App::init_buffers() { - std::shared_ptr allocator_ptr; - TeapotData data (U_GRANULARITY, V_GRANULARITY); - const Anvil::DeviceType device_type (m_device_ptr.lock()->get_type() ); + Anvil::MemoryAllocatorUniquePtr allocator_ptr; + TeapotData data (U_GRANULARITY, V_GRANULARITY); + const Anvil::DeviceType device_type (m_device_ptr->get_type() ); const VkDeviceSize index_data_size = data.get_index_data_size(); const VkDeviceSize properties_data_size = N_TEAPOTS * sizeof(float) * 8; /* rot_xyzX + pos_xyzX */ - const Anvil::MemoryFeatureFlags required_feature_flags = 0; const VkDeviceSize vertex_data_size = data.get_vertex_data_size(); - allocator_ptr = Anvil::MemoryAllocator::create_oneshot(m_device_ptr); + allocator_ptr = Anvil::MemoryAllocator::create_oneshot(m_device_ptr.get() ); - m_index_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr, + m_index_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), index_data_size, Anvil::QUEUE_FAMILY_GRAPHICS_BIT, VK_SHARING_MODE_EXCLUSIVE, VK_BUFFER_USAGE_INDEX_BUFFER_BIT); - m_query_results_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr, + m_query_results_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), sizeof(uint64_t) * m_n_swapchain_images * 2, /* top of pipe, bottom of pipe */ Anvil::QUEUE_FAMILY_GRAPHICS_BIT, VK_SHARING_MODE_EXCLUSIVE, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT); - m_vertex_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr, + m_vertex_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), vertex_data_size, Anvil::QUEUE_FAMILY_GRAPHICS_BIT, VK_SHARING_MODE_EXCLUSIVE, @@ -443,21 +387,21 @@ void App::init_buffers() m_query_results_buffer_ptr->set_name("Query results buffer"); m_vertex_buffer_ptr->set_name ("Teapot vertex buffer"); - allocator_ptr->add_buffer(m_query_results_buffer_ptr, - /* Anvil::MEMORY_FEATURE_FLAG_MAPPABLE | */ required_feature_flags); + allocator_ptr->add_buffer(m_query_results_buffer_ptr.get(), + 0); /* in_required_memory_features */ - allocator_ptr->add_buffer(m_index_buffer_ptr, - required_feature_flags); - allocator_ptr->add_buffer(m_vertex_buffer_ptr, - required_feature_flags); + allocator_ptr->add_buffer(m_index_buffer_ptr.get(), + 0); /* in_required_memory_features */ + allocator_ptr->add_buffer(m_vertex_buffer_ptr.get(), + 0); /* in_required_memory_features */ for (uint32_t n_swapchain_image = 0; n_swapchain_image < m_n_swapchain_images; ++n_swapchain_image) { - std::shared_ptr new_buffer_ptr; + Anvil::BufferUniquePtr new_buffer_ptr; - new_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr, + new_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), properties_data_size, Anvil::QUEUE_FAMILY_GRAPHICS_BIT, VK_SHARING_MODE_EXCLUSIVE, @@ -465,10 +409,12 @@ void App::init_buffers() new_buffer_ptr->set_name("Properties buffer"); - allocator_ptr->add_buffer(new_buffer_ptr, - required_feature_flags); /* in_required_memory_features */ + allocator_ptr->add_buffer(new_buffer_ptr.get(), + 0); /* in_required_memory_features */ - m_properties_buffer_ptrs.push_back(new_buffer_ptr); + m_properties_buffer_ptrs.push_back( + std::move(new_buffer_ptr) + ); } m_index_buffer_ptr->write (0, /* start_offset */ @@ -483,14 +429,14 @@ void App::init_buffers() void App::init_command_buffers() { - VkClearValue clear_values[2]; - std::shared_ptr device_locked_ptr = m_device_ptr.lock(); - const Anvil::DeviceType device_type = device_locked_ptr->get_type(); - std::shared_ptr gfx_manager_ptr = device_locked_ptr->get_graphics_pipeline_manager(); - const uint32_t n_swapchain_images = m_swapchain_ptr->get_n_images(); - std::shared_ptr vertex_buffers[] = + VkClearValue clear_values[2]; + const Anvil::DeviceType device_type = m_device_ptr->get_type(); + auto gfx_manager_ptr = m_device_ptr->get_graphics_pipeline_manager(); + const uint32_t n_swapchain_images = m_swapchain_ptr->get_n_images(); + const uint32_t universal_queue_family_index = m_device_ptr->get_universal_queue(0)->get_queue_family_index(); + Anvil::Buffer* vertex_buffers[] = { - m_vertex_buffer_ptr + m_vertex_buffer_ptr.get() }; VkDeviceSize vertex_buffer_offsets[] = { @@ -500,14 +446,12 @@ void App::init_command_buffers() const uint32_t n_vertex_buffers = sizeof(vertex_buffers) / sizeof(vertex_buffers [0]); const uint32_t n_vertex_buffer_offsets = sizeof(vertex_buffer_offsets) / sizeof(vertex_buffer_offsets[0]); - static_assert(n_vertex_buffers == n_vertex_buffer_offsets, ""); anvil_assert (m_framebuffers.size() == n_swapchain_images); anvil_assert (m_render_cmdbuffers_ooo_off.size() == 0); anvil_assert (m_render_cmdbuffers_ooo_on.size() == 0); anvil_assert (m_renderpasses.size() == n_swapchain_images); - const uint32_t n_physical_device_iterations(1); VkRect2D render_area; render_area.extent.height = m_window_ptr->get_height_at_creation_time(); @@ -521,48 +465,45 @@ void App::init_command_buffers() clear_values[0].color.float32[3] = 1.0f; clear_values[1].depthStencil.depth = 1.0f; - for (uint32_t n_physical_device_iteration = 0; - n_physical_device_iteration < n_physical_device_iterations; - ++n_physical_device_iteration) { for (uint32_t n_ooo_iteration = 0; n_ooo_iteration < 2; /* off, on */ ++n_ooo_iteration) { - const bool is_ooo_enabled = (n_ooo_iteration == 1); - const Anvil::PipelineID pipeline_id = (is_ooo_enabled) ? m_ooo_enabled_pipeline_id - : m_ooo_disabled_pipeline_id; - std::shared_ptr pipeline_layout_ptr = gfx_manager_ptr->get_pipeline_layout(pipeline_id); + const bool is_ooo_enabled = (n_ooo_iteration == 1); + const Anvil::PipelineID pipeline_id = (is_ooo_enabled) ? m_ooo_enabled_pipeline_id + : m_ooo_disabled_pipeline_id; + Anvil::PipelineLayout* pipeline_layout_ptr = gfx_manager_ptr->get_pipeline_layout(pipeline_id); - std::vector >& render_cmdbuffers = (is_ooo_enabled) ? m_render_cmdbuffers_ooo_on - : m_render_cmdbuffers_ooo_off; + std::vector& render_cmdbuffers = (is_ooo_enabled) ? m_render_cmdbuffers_ooo_on + : m_render_cmdbuffers_ooo_off; for (uint32_t n_render_cmdbuffer = 0; n_render_cmdbuffer < n_swapchain_images; ++n_render_cmdbuffer) { - std::shared_ptr cmdbuffer_ptr; - std::shared_ptr ds_ptr (m_dsg_ptrs [n_render_cmdbuffer]->get_descriptor_set(0)); - std::shared_ptr framebuffer_ptr(m_framebuffers[n_render_cmdbuffer]); - std::shared_ptr renderpass_ptr (m_renderpasses[n_render_cmdbuffer]); + Anvil::PrimaryCommandBufferUniquePtr cmdbuffer_ptr; + Anvil::DescriptorSet* ds_ptr (m_dsg_ptrs [n_render_cmdbuffer]->get_descriptor_set(0)); + Anvil::Framebuffer* framebuffer_ptr(m_framebuffers[n_render_cmdbuffer].get() ); + Anvil::RenderPass* renderpass_ptr (m_renderpasses[n_render_cmdbuffer].get() ); const Anvil::BufferBarrier query_result_barrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT | VK_ACCESS_TRANSFER_READ_BIT, - device_locked_ptr->get_queue_family_index(Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL), - device_locked_ptr->get_queue_family_index(Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL), - m_query_results_buffer_ptr, + universal_queue_family_index, + universal_queue_family_index, + m_query_results_buffer_ptr.get(), sizeof(uint64_t) * n_render_cmdbuffer * 2, sizeof(uint64_t) * 2); const Anvil::BufferBarrier props_buffer_barrier(VK_ACCESS_HOST_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT, - device_locked_ptr->get_queue_family_index(Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL), - device_locked_ptr->get_queue_family_index(Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL), - m_properties_buffer_ptrs[n_render_cmdbuffer], + universal_queue_family_index, + universal_queue_family_index, + m_properties_buffer_ptrs[n_render_cmdbuffer].get(), 0, N_TEAPOTS * sizeof(float) * 2 * 4 /* pos + rot */); - cmdbuffer_ptr = device_locked_ptr->get_command_pool(Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL)->alloc_primary_level_command_buffer(); + cmdbuffer_ptr = m_device_ptr->get_command_pool_for_queue_family_index(universal_queue_family_index)->alloc_primary_level_command_buffer(); cmdbuffer_ptr->set_name_formatted("Rendering command buffer (OoO:%s)", ((n_ooo_iteration == 0) ? "off" : "on") ); @@ -583,20 +524,17 @@ void App::init_command_buffers() nullptr); /* in_image_memory_barrier_ptrs */ cmdbuffer_ptr->record_write_timestamp(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, - m_query_pool_ptr, + m_query_pool_ptr.get(), n_render_cmdbuffer * 2 /* top of pipe, bottom of pipe*/ + 0); - { - cmdbuffer_ptr->record_begin_render_pass(sizeof(clear_values) / sizeof(clear_values[0]), - clear_values, - framebuffer_ptr, - render_area, - renderpass_ptr, - VK_SUBPASS_CONTENTS_INLINE); - } - { - const uint32_t n_physical_devices(1); + cmdbuffer_ptr->record_begin_render_pass(sizeof(clear_values) / sizeof(clear_values[0]), + clear_values, + framebuffer_ptr, + render_area, + renderpass_ptr, + VK_SUBPASS_CONTENTS_INLINE); + { cmdbuffer_ptr->record_bind_pipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline_id); @@ -608,7 +546,7 @@ void App::init_command_buffers() 0, /* in_dynamic_offset_count */ nullptr); /* in_dynamic_offset_ptrs */ - cmdbuffer_ptr->record_bind_index_buffer (m_index_buffer_ptr, + cmdbuffer_ptr->record_bind_index_buffer (m_index_buffer_ptr.get(), 0, /* in_offset */ VK_INDEX_TYPE_UINT32); cmdbuffer_ptr->record_bind_vertex_buffers(0, /* in_start_binding */ @@ -616,27 +554,22 @@ void App::init_command_buffers() vertex_buffers, vertex_buffer_offsets); - for (uint32_t n_physical_device = 0; - n_physical_device < n_physical_devices; - ++n_physical_device) - { - /* Draw the teapots! */ - cmdbuffer_ptr->record_draw_indexed(m_n_indices, - N_TEAPOTS, /* in_instance_count */ - 0, /* in_first_index */ - 0, /* in_vertex_offset */ - 0); /* in_first_instance */ - } + /* Draw the teapots! */ + cmdbuffer_ptr->record_draw_indexed(m_n_indices, + N_TEAPOTS, /* in_instance_count */ + 0, /* in_first_index */ + 0, /* in_vertex_offset */ + 0); /* in_first_instance */ } cmdbuffer_ptr->record_end_render_pass(); cmdbuffer_ptr->record_write_timestamp (VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, - m_query_pool_ptr, + m_query_pool_ptr.get(), n_render_cmdbuffer * 2 /* top of pipe, bottom of pipe */ + 1); - cmdbuffer_ptr->record_copy_query_pool_results(m_query_pool_ptr, + cmdbuffer_ptr->record_copy_query_pool_results(m_query_pool_ptr.get(), n_render_cmdbuffer * 2, /* top of pipe, bottom of pipe */ 2, /* in_query_count */ - m_query_results_buffer_ptr, + m_query_results_buffer_ptr.get(), sizeof(uint64_t) * n_render_cmdbuffer * 2, sizeof(uint64_t), VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WAIT_BIT); @@ -653,7 +586,7 @@ void App::init_command_buffers() } cmdbuffer_ptr->stop_recording(); - render_cmdbuffers.push_back(cmdbuffer_ptr); + render_cmdbuffers.push_back(std::move(cmdbuffer_ptr) ); } } } @@ -667,10 +600,10 @@ void App::init_dsgs() n_swapchain_image < m_n_swapchain_images; ++n_swapchain_image) { - std::shared_ptr new_dsg_ptr; + Anvil::DescriptorSetGroupUniquePtr new_dsg_ptr; { - std::vector > new_dsg_info_ptr(1); + std::vector new_dsg_info_ptr(1); new_dsg_info_ptr[0] = Anvil::DescriptorSetInfo::create(); @@ -679,16 +612,18 @@ void App::init_dsgs() 1, /* in_n_elements */ VK_SHADER_STAGE_VERTEX_BIT); - new_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr, + new_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), new_dsg_info_ptr, false); /* in_releaseable_sets */ } new_dsg_ptr->set_binding_item(0, /* n_set */ 0, /* binding_index */ - Anvil::DescriptorSet::StorageBufferBindingElement(m_properties_buffer_ptrs[n_swapchain_image])); + Anvil::DescriptorSet::StorageBufferBindingElement(m_properties_buffer_ptrs[n_swapchain_image].get() )); - m_dsg_ptrs.push_back(new_dsg_ptr); + m_dsg_ptrs.push_back( + std::move(new_dsg_ptr) + ); } } @@ -699,8 +634,7 @@ void App::init_events() void App::init_gfx_pipelines() { - std::shared_ptr device_locked_ptr = m_device_ptr.lock(); - std::shared_ptr gfx_manager_ptr = device_locked_ptr->get_graphics_pipeline_manager(); + auto gfx_manager_ptr = m_device_ptr->get_graphics_pipeline_manager(); for (uint32_t n_pipeline = 0; n_pipeline < 2 /* ooo on, ooo off */; @@ -713,7 +647,7 @@ void App::init_gfx_pipelines() { auto pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ false, /* in_allow_derivatives */ - m_renderpasses[0], + m_renderpasses[0].get(), 0, /* in_subpass_id */ *m_fs_entrypoint_ptr, Anvil::ShaderModuleStageEntryPoint(), /* in_gs_entrypoint */ @@ -727,7 +661,7 @@ void App::init_gfx_pipelines() sizeof(float) * 3, /* stride_in_bytes */ VK_VERTEX_INPUT_RATE_VERTEX); - pipeline_info_ptr->set_dsg(m_dsg_ptrs[0]); + pipeline_info_ptr->set_descriptor_set_info(m_dsg_ptrs[0]->get_descriptor_set_info() ); pipeline_info_ptr->set_primitive_topology (VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST); pipeline_info_ptr->set_rasterization_properties(VK_POLYGON_MODE_FILL, @@ -740,7 +674,7 @@ void App::init_gfx_pipelines() if (!is_ooo_disabled) { - if (device_locked_ptr->is_extension_enabled("VK_AMD_rasterization_order") ) + if (m_device_ptr->is_extension_enabled("VK_AMD_rasterization_order") ) { pipeline_info_ptr->set_rasterization_order(VK_RASTERIZATION_ORDER_RELAXED_AMD); } @@ -758,9 +692,7 @@ void App::init_gfx_pipelines() void App::init_images() { - std::shared_ptr device_locked_ptr(m_device_ptr); - - m_depth_image_ptr = Anvil::Image::create_nonsparse(m_device_ptr, + m_depth_image_ptr = Anvil::Image::create_nonsparse(m_device_ptr.get(), VK_IMAGE_TYPE_2D, VK_FORMAT_D32_SFLOAT, VK_IMAGE_TILING_OPTIMAL, @@ -778,8 +710,8 @@ void App::init_images() VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* in_final_image_layout */ nullptr); /* in_mipmaps_ptr */ - m_depth_image_view_ptr = Anvil::ImageView::create_2D(m_device_ptr, - m_depth_image_ptr, + m_depth_image_view_ptr = Anvil::ImageView::create_2D(m_device_ptr.get(), + m_depth_image_ptr.get(), 0, /* n_base_layer */ 0, /* n_base_mipmap_level */ 1, /* n_mipmaps */ @@ -793,27 +725,25 @@ void App::init_images() void App::init_query_pool() { - m_query_pool_ptr = Anvil::QueryPool::create_non_ps_query_pool(m_device_ptr, + m_query_pool_ptr = Anvil::QueryPool::create_non_ps_query_pool(m_device_ptr.get(), VK_QUERY_TYPE_TIMESTAMP, m_n_swapchain_images * 2 /* top of pipe, bottom of pipe */); } void App::init_renderpasses() { - std::shared_ptr device_locked_ptr(m_device_ptr); - /* We are rendering directly to the swapchain image, so need one renderpass per image */ for (uint32_t n_swapchain_image = 0; n_swapchain_image < m_n_swapchain_images; ++n_swapchain_image) { - Anvil::RenderPassAttachmentID color_attachment_id; - Anvil::RenderPassAttachmentID depth_attachment_id; - std::shared_ptr renderpass_ptr; - Anvil::SubPassID subpass_id; + Anvil::RenderPassAttachmentID color_attachment_id; + Anvil::RenderPassAttachmentID depth_attachment_id; + Anvil::RenderPassUniquePtr renderpass_ptr; + Anvil::SubPassID subpass_id; { - std::unique_ptr renderpass_info_ptr(new Anvil::RenderPassInfo(m_device_ptr) ); + Anvil::RenderPassInfoUniquePtr renderpass_info_ptr(new Anvil::RenderPassInfo(m_device_ptr.get() ) ); renderpass_info_ptr->add_color_attachment(m_swapchain_ptr->get_image_format(), VK_SAMPLE_COUNT_1_BIT, @@ -853,14 +783,12 @@ void App::init_renderpasses() VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); renderpass_ptr = Anvil::RenderPass::create(std::move(renderpass_info_ptr), - m_swapchain_ptr); + m_swapchain_ptr.get() ); } renderpass_ptr->set_name_formatted("Renderpass for swapchain image [%d]", n_swapchain_image); - m_renderpasses.push_back(renderpass_ptr); - /* If no general pipeline has been set up yet, do it now. This pipeline is only used to form a pipeline layout * so we only need to configure DSGs & attributes here. * @@ -868,32 +796,36 @@ void App::init_renderpasses() **/ if (m_general_pipeline_id == -1) { - std::shared_ptr gfx_manager_ptr = device_locked_ptr->get_graphics_pipeline_manager (); - auto gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - renderpass_ptr, - subpass_id, - *m_fs_entrypoint_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* in_gs_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* in_tc_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* in_te_entrypoint */ - *m_vs_entrypoint_ptr); - - gfx_pipeline_info_ptr->add_vertex_attribute(0, /* location */ - VK_FORMAT_R32G32B32_SFLOAT, - 0, /* offset_in_bytes */ - sizeof(float) * 3, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX); - gfx_pipeline_info_ptr->set_dsg (m_dsg_ptrs[0]); + auto gfx_manager_ptr = m_device_ptr->get_graphics_pipeline_manager (); + auto gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ + false, /* in_allow_derivatives */ + renderpass_ptr.get(), + subpass_id, + *m_fs_entrypoint_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* in_gs_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* in_tc_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* in_te_entrypoint */ + *m_vs_entrypoint_ptr); + + gfx_pipeline_info_ptr->add_vertex_attribute (0, /* location */ + VK_FORMAT_R32G32B32_SFLOAT, + 0, /* offset_in_bytes */ + sizeof(float) * 3, /* stride_in_bytes */ + VK_VERTEX_INPUT_RATE_VERTEX); + gfx_pipeline_info_ptr->set_descriptor_set_info(m_dsg_ptrs[0]->get_descriptor_set_info() ); gfx_manager_ptr->add_pipeline(std::move(gfx_pipeline_info_ptr), &m_general_pipeline_id); } + m_renderpasses.push_back( + std::move(renderpass_ptr) + ); + /* Set up a framebuffer we will use for the renderpass */ - std::shared_ptr framebuffer_ptr; + Anvil::FramebufferUniquePtr framebuffer_ptr; - framebuffer_ptr = Anvil::Framebuffer::create(m_device_ptr, + framebuffer_ptr = Anvil::Framebuffer::create(m_device_ptr.get(), m_window_ptr->get_width_at_creation_time (), m_window_ptr->get_height_at_creation_time(), 1); /* n_layers */ @@ -902,77 +834,51 @@ void App::init_renderpasses() framebuffer_ptr->add_attachment(m_swapchain_ptr->get_image_view(n_swapchain_image), nullptr); - framebuffer_ptr->add_attachment(m_depth_image_view_ptr, + framebuffer_ptr->add_attachment(m_depth_image_view_ptr.get(), nullptr); - m_framebuffers.push_back(framebuffer_ptr); + m_framebuffers.push_back( + std::move(framebuffer_ptr) + ); } } void App::init_semaphores() { - std::shared_ptr base_device_locked_ptr(m_device_ptr); - uint32_t n_physical_devices (0); - - switch (base_device_locked_ptr->get_type() ) - { - case Anvil::DEVICE_TYPE_SINGLE_GPU: - { - n_physical_devices = 1; - - break; - } - - default: - { - anvil_assert(false); - } - } - for (uint32_t n_swapchain_image = 0; n_swapchain_image < m_n_swapchain_images; ++n_swapchain_image) { - std::shared_ptr new_frame_acquisition_wait_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr); - SemaphoreBundle signal_semaphore_bundle; - SemaphoreBundle wait_semaphore_bundle; + auto new_frame_acquisition_wait_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); new_frame_acquisition_wait_semaphore_ptr->set_name_formatted("New frame acquisition wait semaphore [%d]", n_swapchain_image); - for (uint32_t n_physical_device = 0; - n_physical_device < n_physical_devices; - ++n_physical_device) - { - std::shared_ptr new_signal_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr); - std::shared_ptr new_wait_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr); - - new_signal_semaphore_ptr->set_name_formatted("Signal semaphore [%d]", - n_swapchain_image); - new_wait_semaphore_ptr->set_name_formatted ("Wait semaphore [%d]", - n_swapchain_image); + auto new_signal_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); + auto new_wait_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); - signal_semaphore_bundle.semaphores.push_back(new_signal_semaphore_ptr); - wait_semaphore_bundle.semaphores.push_back (new_wait_semaphore_ptr); - } + new_signal_semaphore_ptr->set_name_formatted("Signal semaphore [%d]", + n_swapchain_image); + new_wait_semaphore_ptr->set_name_formatted ("Wait semaphore [%d]", + n_swapchain_image); - m_frame_signal_semaphore_bundles.push_back(signal_semaphore_bundle); - m_frame_wait_semaphore_bundles.push_back (wait_semaphore_bundle); + m_frame_signal_semaphores.push_back(std::move(new_signal_semaphore_ptr )); + m_frame_wait_semaphores.push_back (std::move(new_wait_semaphore_ptr) ); } } void App::init_shaders() { - std::shared_ptr fs_ptr; - std::shared_ptr fs_sm_ptr; - std::shared_ptr vs_ptr; - std::shared_ptr vs_sm_ptr; + Anvil::GLSLShaderToSPIRVGeneratorUniquePtr fs_ptr; + Anvil::ShaderModuleUniquePtr fs_sm_ptr; + Anvil::GLSLShaderToSPIRVGeneratorUniquePtr vs_ptr; + Anvil::ShaderModuleUniquePtr vs_sm_ptr; - fs_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr, + fs_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, fs_body, Anvil::SHADER_STAGE_FRAGMENT); - vs_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr, + vs_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, vs_body, Anvil::SHADER_STAGE_VERTEX); @@ -986,69 +892,53 @@ void App::init_shaders() vs_ptr->add_definition_value_pair("N_TEAPOTS", N_TEAPOTS); - fs_sm_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr, - fs_ptr); - vs_sm_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr, - vs_ptr); + fs_sm_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr.get(), + fs_ptr.get () ); + vs_sm_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr.get(), + vs_ptr.get () ); fs_sm_ptr->set_name("Fragment shader"); vs_sm_ptr->set_name("Vertex shader"); m_fs_entrypoint_ptr.reset(new Anvil::ShaderModuleStageEntryPoint("main", - fs_sm_ptr, + std::move(fs_sm_ptr), Anvil::SHADER_STAGE_FRAGMENT) ); m_vs_entrypoint_ptr.reset(new Anvil::ShaderModuleStageEntryPoint("main", - vs_sm_ptr, + std::move(vs_sm_ptr), Anvil::SHADER_STAGE_VERTEX) ); } void App::init_swapchain() { - std::shared_ptr device_locked_ptr (m_device_ptr); - static const VkFormat swapchain_format (VK_FORMAT_B8G8R8A8_UNORM); - static const VkPresentModeKHR swapchain_present_mode(VK_PRESENT_MODE_FIFO_KHR); - static const VkImageUsageFlags swapchain_usage (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT); + Anvil::SGPUDevice* sgpu_device_ptr (dynamic_cast(m_device_ptr.get() ) ); + static const VkFormat swapchain_format (VK_FORMAT_B8G8R8A8_UNORM); + static const VkPresentModeKHR swapchain_present_mode(VK_PRESENT_MODE_FIFO_KHR); + static const VkImageUsageFlags swapchain_usage (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT); - m_rendering_surface_ptr = Anvil::RenderingSurface::create(m_instance_ptr, - m_device_ptr, - m_window_ptr); + m_rendering_surface_ptr = Anvil::RenderingSurface::create(m_instance_ptr.get(), + m_device_ptr.get (), + m_window_ptr.get () ); m_rendering_surface_ptr->set_name("Main rendering surface"); + m_swapchain_ptr = sgpu_device_ptr->create_swapchain(m_rendering_surface_ptr.get(), + m_window_ptr.get (), + swapchain_format, + swapchain_present_mode, + swapchain_usage, + m_n_swapchain_images); - switch (device_locked_ptr->get_type() ) - { - case Anvil::DEVICE_TYPE_SINGLE_GPU: - { - std::shared_ptr sgpu_device_locked_ptr(std::dynamic_pointer_cast(device_locked_ptr) ); - - m_swapchain_ptr = sgpu_device_locked_ptr->create_swapchain(m_rendering_surface_ptr, - m_window_ptr, - swapchain_format, - swapchain_present_mode, - swapchain_usage, - m_n_swapchain_images); - - /* Cache the queue we are going to use for presentation */ - const std::vector* present_queue_fams_ptr = nullptr; + /* Cache the queue we are going to use for presentation */ + const std::vector* present_queue_fams_ptr = nullptr; - if (!m_rendering_surface_ptr->get_queue_families_with_present_support(sgpu_device_locked_ptr->get_physical_device(), - &present_queue_fams_ptr) ) - { - anvil_assert_fail(); - } - - m_present_queue_ptr = device_locked_ptr->get_queue(present_queue_fams_ptr->at(0), - 0); /* in_n_queue */ + if (!m_rendering_surface_ptr->get_queue_families_with_present_support(&present_queue_fams_ptr) ) + { + anvil_assert_fail(); + } - break; - } + m_present_queue_ptr = sgpu_device_ptr->get_queue_for_queue_family_index(present_queue_fams_ptr->at(0), + 0); /* in_n_queue */ - default: - { - anvil_assert(false); - } - } } void App::init_window() @@ -1097,23 +987,18 @@ void App::init_vulkan() #endif false); /* in_mt_safe */ - /* Determine which extensions we need to request for */ - std::shared_ptr physical_device_locked_ptr(m_instance_ptr->get_physical_device(0) ); - - { - /* Create a Vulkan device */ - m_device_ptr = Anvil::SGPUDevice::create(physical_device_locked_ptr, - Anvil::DeviceExtensionConfiguration(), - std::vector(), /* layers */ - false, /* transient_command_buffer_allocs_only */ - false); /* support_resettable_command_buffers */ - } + /* Create a Vulkan device */ + m_device_ptr = Anvil::SGPUDevice::create(m_instance_ptr->get_physical_device(0), + true, /* in_enable_shader_module_cache */ + Anvil::DeviceExtensionConfiguration(), + std::vector(), /* in_layers */ + false, /* in_transient_command_buffer_allocs_only */ + false); /* in_support_resettable_command_buffers */ } void App::on_keypress_event(Anvil::CallbackArgument* callback_data_raw_ptr) { auto callback_data_ptr = static_cast(callback_data_raw_ptr); - auto device_locked_ptr = m_device_ptr.lock(); #ifndef ENABLE_OFFSCREEN_RENDERING { @@ -1121,7 +1006,7 @@ void App::on_keypress_event(Anvil::CallbackArgument* callback_data_raw_ptr) { printf("\n\n"); - if (device_locked_ptr->is_extension_enabled("VK_AMD_rasterization_order") ) + if (m_device_ptr->is_extension_enabled("VK_AMD_rasterization_order") ) { m_ooo_enabled = !m_ooo_enabled; @@ -1179,8 +1064,7 @@ void App::run() void App::update_fps() { - uint64_t average_delta = 0; - std::shared_ptr device_locked_ptr(m_device_ptr); + uint64_t average_delta = 0; /* Compute average delta from all the samples we have cached so far */ for (uint64_t delta : m_timestamp_deltas) @@ -1191,7 +1075,7 @@ void App::update_fps() average_delta /= m_timestamp_deltas.size(); /* Convert the delta to human-readable information */ - const double time_ns = double(average_delta) * double(device_locked_ptr->get_physical_device_properties().limits.timestampPeriod); + const double time_ns = double(average_delta) * double(m_device_ptr->get_physical_device_properties().core_vk1_0_properties_ptr->limits.timestamp_period); const double time_s = time_ns / NSEC_PER_SEC; const float average_fps = float(1.0 / time_s); @@ -1270,7 +1154,7 @@ void App::update_teapot_props(uint32_t n_current_swapchain_image) int main() { - std::shared_ptr app_ptr(new App() ); + std::unique_ptr app_ptr(new App() ); app_ptr->init(); app_ptr->run(); diff --git a/examples/PushConstants/CMakeLists.txt b/examples/PushConstants/CMakeLists.txt index 61c9e6dd..f178ad04 100644 --- a/examples/PushConstants/CMakeLists.txt +++ b/examples/PushConstants/CMakeLists.txt @@ -18,6 +18,7 @@ endif() add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") +target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") include_directories(${Anvil_SOURCE_DIR}/include ${PushConstants_SOURCE_DIR}/include) diff --git a/examples/PushConstants/include/app.h b/examples/PushConstants/include/app.h index ad92e06c..446b3a2f 100644 --- a/examples/PushConstants/include/app.h +++ b/examples/PushConstants/include/app.h @@ -59,8 +59,8 @@ class App const char* in_layer_prefix, const char* in_message); - void get_luminance_data(std::shared_ptr* out_result_ptr, - uint32_t* out_result_size_ptr) const; + void get_luminance_data(std::unique_ptr* out_result_ptr, + uint32_t* out_result_size_ptr) const; const unsigned char* get_mesh_data () const; uint32_t get_mesh_data_color_start_offset () const; @@ -76,30 +76,30 @@ class App /* Private variables */ - std::weak_ptr m_device_ptr; - std::shared_ptr m_instance_ptr; - std::weak_ptr m_physical_device_ptr; - std::shared_ptr m_present_queue_ptr; - std::shared_ptr m_rendering_surface_ptr; - std::shared_ptr m_swapchain_ptr; - Anvil::Time m_time; - VkDeviceSize m_ub_data_size_per_swapchain_image; - std::shared_ptr m_window_ptr; - - std::shared_ptr m_command_buffers[N_SWAPCHAIN_IMAGES]; - std::shared_ptr m_data_buffer_ptr; - std::shared_ptr m_dsg_ptr; - std::shared_ptr m_fbos[N_SWAPCHAIN_IMAGES]; - std::shared_ptr m_fs_ptr; - std::shared_ptr m_mesh_data_buffer_ptr; + Anvil::SGPUDeviceUniquePtr m_device_ptr; + Anvil::InstanceUniquePtr m_instance_ptr; + const Anvil::PhysicalDevice* m_physical_device_ptr; + Anvil::Queue* m_present_queue_ptr; + Anvil::RenderingSurfaceUniquePtr m_rendering_surface_ptr; + Anvil::SwapchainUniquePtr m_swapchain_ptr; + Anvil::Time m_time; + VkDeviceSize m_ub_data_size_per_swapchain_image; + Anvil::WindowUniquePtr m_window_ptr; + + Anvil::PrimaryCommandBufferUniquePtr m_command_buffers[N_SWAPCHAIN_IMAGES]; + Anvil::BufferUniquePtr m_data_buffer_ptr; + Anvil::DescriptorSetGroupUniquePtr m_dsg_ptr; + Anvil::FramebufferUniquePtr m_fbos[N_SWAPCHAIN_IMAGES]; + std::unique_ptr m_fs_ptr; + Anvil::BufferUniquePtr m_mesh_data_buffer_ptr; Anvil::PipelineID m_pipeline_id; - std::shared_ptr m_renderpass_ptr; - std::shared_ptr m_vs_ptr; + Anvil::RenderPassUniquePtr m_renderpass_ptr; + std::unique_ptr m_vs_ptr; uint32_t m_n_last_semaphore_used; const uint32_t m_n_swapchain_images; - std::vector > m_frame_signal_semaphores; - std::vector > m_frame_wait_semaphores; + std::vector m_frame_signal_semaphores; + std::vector m_frame_wait_semaphores; }; diff --git a/examples/PushConstants/src/app.cpp b/examples/PushConstants/src/app.cpp index bc199451..25bc6e1a 100644 --- a/examples/PushConstants/src/app.cpp +++ b/examples/PushConstants/src/app.cpp @@ -213,12 +213,20 @@ App::~App() void App::deinit() { - vkDeviceWaitIdle(m_device_ptr.lock()->get_device_vk() ); + auto gfx_pipeline_manager_ptr = m_device_ptr->get_graphics_pipeline_manager(); + + vkDeviceWaitIdle(m_device_ptr->get_device_vk() ); + + if (m_pipeline_id != UINT32_MAX) + { + gfx_pipeline_manager_ptr->delete_pipeline(m_pipeline_id); + + m_pipeline_id = UINT32_MAX; + } m_frame_signal_semaphores.clear(); m_frame_wait_semaphores.clear(); - m_present_queue_ptr.reset(); m_rendering_surface_ptr.reset(); m_swapchain_ptr.reset(); @@ -237,10 +245,7 @@ void App::deinit() m_renderpass_ptr.reset(); m_vs_ptr.reset(); - m_device_ptr.lock()->destroy(); m_device_ptr.reset(); - - m_instance_ptr->destroy(); m_instance_ptr.reset(); m_window_ptr.reset(); @@ -248,20 +253,19 @@ void App::deinit() void App::draw_frame() { - std::shared_ptr curr_frame_signal_semaphore_ptr; - std::shared_ptr curr_frame_wait_semaphore_ptr; - std::shared_ptr device_locked_ptr = m_device_ptr.lock(); - static uint32_t n_frames_rendered = 0; - uint32_t n_swapchain_image; - std::shared_ptr present_queue_ptr = device_locked_ptr->get_universal_queue(0); - std::shared_ptr present_wait_semaphore_ptr; - const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; + Anvil::Semaphore* curr_frame_signal_semaphore_ptr = nullptr; + Anvil::Semaphore* curr_frame_wait_semaphore_ptr = nullptr; + static uint32_t n_frames_rendered = 0; + uint32_t n_swapchain_image; + Anvil::Queue* present_queue_ptr = m_device_ptr->get_universal_queue(0); + Anvil::Semaphore* present_wait_semaphore_ptr = nullptr; + const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; /* Determine the signal + wait semaphores to use for drawing this frame */ m_n_last_semaphore_used = (m_n_last_semaphore_used + 1) % m_n_swapchain_images; - curr_frame_signal_semaphore_ptr = m_frame_signal_semaphores[m_n_last_semaphore_used]; - curr_frame_wait_semaphore_ptr = m_frame_wait_semaphores [m_n_last_semaphore_used]; + curr_frame_signal_semaphore_ptr = m_frame_signal_semaphores[m_n_last_semaphore_used].get(); + curr_frame_wait_semaphore_ptr = m_frame_wait_semaphores [m_n_last_semaphore_used].get(); present_wait_semaphore_ptr = curr_frame_signal_semaphore_ptr; @@ -272,7 +276,7 @@ void App::draw_frame() /* Submit work chunk and present */ update_data_ub_contents(n_swapchain_image); - present_queue_ptr->submit_command_buffer_with_signal_wait_semaphores(m_command_buffers[n_swapchain_image], + present_queue_ptr->submit_command_buffer_with_signal_wait_semaphores(m_command_buffers[n_swapchain_image].get(), 1, /* n_semaphores_to_signal */ &curr_frame_signal_semaphore_ptr, 1, /* n_semaphores_to_wait_on */ @@ -280,7 +284,7 @@ void App::draw_frame() &wait_stage_mask, false /* should_block */); - present_queue_ptr->present(m_swapchain_ptr, + present_queue_ptr->present(m_swapchain_ptr.get(), n_swapchain_image, 1, /* n_wait_semaphores */ &present_wait_semaphore_ptr); @@ -297,19 +301,19 @@ void App::draw_frame() #endif } -void App::get_luminance_data(std::shared_ptr* out_result_ptr, - uint32_t* out_result_size_ptr) const +void App::get_luminance_data(std::unique_ptr* out_result_ptr, + uint32_t* out_result_size_ptr) const { - std::shared_ptr luminance_data_ptr; - float* luminance_data_raw_ptr; - uint32_t luminance_data_size; + std::unique_ptr luminance_data_ptr; + float* luminance_data_raw_ptr; + uint32_t luminance_data_size; static_assert(N_TRIANGLES == 16, "Shader and the app logic assumes N_TRIANGLES will always be 16"); luminance_data_size = sizeof(float) * N_TRIANGLES; - luminance_data_ptr.reset(new float[luminance_data_size / sizeof(float)], std::default_delete()); + luminance_data_ptr.reset(new float[luminance_data_size / sizeof(float)] ); luminance_data_raw_ptr = luminance_data_ptr.get(); @@ -320,7 +324,7 @@ void App::get_luminance_data(std::shared_ptr* out_result_ptr, luminance_data_raw_ptr[n_tri] = float(n_tri) / float(N_TRIANGLES - 1); } - *out_result_ptr = luminance_data_ptr; + *out_result_ptr = std::move(luminance_data_ptr); *out_result_size_ptr = luminance_data_size; } @@ -393,17 +397,17 @@ void App::init_buffers() sizeof(float) * N_TRIANGLES * 4 + /* position (vec2) + rotation (vec2) */ sizeof(float) * N_TRIANGLES + /* luminance */ sizeof(float) * N_TRIANGLES; /* size */ - const auto ub_data_alignment_requirement = m_device_ptr.lock()->get_physical_device_properties().limits.minUniformBufferOffsetAlignment; + const auto ub_data_alignment_requirement = m_device_ptr->get_physical_device_properties().core_vk1_0_properties_ptr->limits.min_uniform_buffer_offset_alignment; const auto ub_data_size_total = N_SWAPCHAIN_IMAGES * (Anvil::Utils::round_up(ub_data_size_per_swapchain_image, ub_data_alignment_requirement) ); m_ub_data_size_per_swapchain_image = ub_data_size_total / N_SWAPCHAIN_IMAGES; /* Use a memory allocator to re-use memory blocks wherever possible */ - std::shared_ptr allocator_ptr = Anvil::MemoryAllocator::create_oneshot(m_device_ptr); + auto allocator_ptr = Anvil::MemoryAllocator::create_oneshot(m_device_ptr.get() ); /* Set up a buffer to hold uniform data */ - m_data_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr, + m_data_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), ub_data_size_total, Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT, VK_SHARING_MODE_EXCLUSIVE, @@ -411,20 +415,19 @@ void App::init_buffers() m_data_buffer_ptr->set_name("Data buffer"); - allocator_ptr->add_buffer(m_data_buffer_ptr, + allocator_ptr->add_buffer(m_data_buffer_ptr.get(), 0); /* in_required_memory_features */ /* Set up a buffer to hold mesh data */ - m_mesh_data_buffer_ptr = Anvil::Buffer::create_nonsparse( - m_device_ptr, - get_mesh_data_size(), - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_VERTEX_BUFFER_BIT); + m_mesh_data_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), + get_mesh_data_size(), + Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_EXCLUSIVE, + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT); m_mesh_data_buffer_ptr->set_name("Mesh vertexdata buffer"); - allocator_ptr->add_buffer(m_mesh_data_buffer_ptr, + allocator_ptr->add_buffer(m_mesh_data_buffer_ptr.get(), 0); /* in_required_memory_features */ /* Allocate memory blocks and copy data where applicable */ @@ -435,12 +438,11 @@ void App::init_buffers() void App::init_command_buffers() { - std::shared_ptr device_locked_ptr (m_device_ptr); - std::shared_ptr gfx_pipeline_manager_ptr(device_locked_ptr->get_graphics_pipeline_manager() ); - VkImageSubresourceRange image_subresource_range; - std::shared_ptr luminance_data_ptr; - uint32_t luminance_data_size; - std::shared_ptr universal_queue_ptr (device_locked_ptr->get_universal_queue(0) ); + auto gfx_pipeline_manager_ptr(m_device_ptr->get_graphics_pipeline_manager() ); + VkImageSubresourceRange image_subresource_range; + std::unique_ptr luminance_data_ptr; + uint32_t luminance_data_size; + Anvil::Queue* universal_queue_ptr (m_device_ptr->get_universal_queue(0) ); image_subresource_range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; image_subresource_range.baseArrayLayer = 0; @@ -455,9 +457,9 @@ void App::init_command_buffers() n_command_buffer < N_SWAPCHAIN_IMAGES; ++n_command_buffer) { - std::shared_ptr cmd_buffer_ptr; + Anvil::PrimaryCommandBufferUniquePtr cmd_buffer_ptr; - cmd_buffer_ptr = device_locked_ptr->get_command_pool(Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL)->alloc_primary_level_command_buffer(); + cmd_buffer_ptr = m_device_ptr->get_command_pool_for_queue_family_index(m_device_ptr->get_universal_queue(0)->get_queue_family_index() )->alloc_primary_level_command_buffer(); /* Start recording commands */ cmd_buffer_ptr->start_recording(false, /* one_time_submit */ @@ -487,13 +489,13 @@ void App::init_command_buffers() } /* Make sure CPU-written data is flushed before we start rendering */ - Anvil::BufferBarrier buffer_barrier(VK_ACCESS_HOST_WRITE_BIT, /* in_source_access_mask */ - VK_ACCESS_UNIFORM_READ_BIT, /* in_destination_access_mask */ - universal_queue_ptr->get_queue_family_index(), /* in_src_queue_family_index */ - universal_queue_ptr->get_queue_family_index(), /* in_dst_queue_family_index */ - m_data_buffer_ptr, - m_ub_data_size_per_swapchain_image * n_command_buffer, /* in_offset */ - m_ub_data_size_per_swapchain_image); + Anvil::BufferBarrier buffer_barrier(VK_ACCESS_HOST_WRITE_BIT, /* in_source_access_mask */ + VK_ACCESS_UNIFORM_READ_BIT, /* in_destination_access_mask */ + universal_queue_ptr->get_queue_family_index(), /* in_src_queue_family_index */ + universal_queue_ptr->get_queue_family_index(), /* in_dst_queue_family_index */ + m_data_buffer_ptr.get(), + m_ub_data_size_per_swapchain_image * n_command_buffer, /* in_offset */ + m_ub_data_size_per_swapchain_image); cmd_buffer_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_HOST_BIT, VK_PIPELINE_STAGE_VERTEX_SHADER_BIT, @@ -522,15 +524,16 @@ void App::init_command_buffers() cmd_buffer_ptr->record_begin_render_pass(1, /* in_n_clear_values */ &attachment_clear_value, - m_fbos[n_command_buffer], + m_fbos[n_command_buffer].get(), render_area, - m_renderpass_ptr, + m_renderpass_ptr.get(), VK_SUBPASS_CONTENTS_INLINE); { - const uint32_t data_ub_offset = static_cast(m_ub_data_size_per_swapchain_image * n_command_buffer); - std::shared_ptr ds_ptr = m_dsg_ptr->get_descriptor_set (0 /* n_set */); - const VkDeviceSize mesh_data_buffer_offset = 0; - std::shared_ptr pipeline_layout_ptr = gfx_pipeline_manager_ptr->get_pipeline_layout(m_pipeline_id); + const uint32_t data_ub_offset = static_cast(m_ub_data_size_per_swapchain_image * n_command_buffer); + auto ds_ptr = m_dsg_ptr->get_descriptor_set (0 /* n_set */); + const VkDeviceSize mesh_data_buffer_offset = 0; + auto mesh_data_buffer_raw_ptr = m_mesh_data_buffer_ptr.get(); + auto pipeline_layout_ptr = gfx_pipeline_manager_ptr->get_pipeline_layout(m_pipeline_id); cmd_buffer_ptr->record_bind_pipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, m_pipeline_id); @@ -551,7 +554,7 @@ void App::init_command_buffers() cmd_buffer_ptr->record_bind_vertex_buffers(0, /* startBinding */ 1, /* bindingCount */ - &m_mesh_data_buffer_ptr, + &mesh_data_buffer_raw_ptr, &mesh_data_buffer_offset); cmd_buffer_ptr->record_draw(3, /* in_vertex_count */ @@ -564,14 +567,14 @@ void App::init_command_buffers() /* Close the recording process */ cmd_buffer_ptr->stop_recording(); - m_command_buffers[n_command_buffer] = cmd_buffer_ptr; + m_command_buffers[n_command_buffer] = std::move(cmd_buffer_ptr); } } void App::init_dsgs() { { - auto dsg_info_ptrs = std::vector >(1); + auto dsg_info_ptrs = std::vector(1); dsg_info_ptrs[0] = Anvil::DescriptorSetInfo::create(); @@ -580,14 +583,14 @@ void App::init_dsgs() 1, /* n_elements */ VK_SHADER_STAGE_VERTEX_BIT); - m_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr, + m_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), dsg_info_ptrs, false); /* releaseable_sets */ } m_dsg_ptr->set_binding_item(0, /* n_set */ 0, /* n_binding */ - Anvil::DescriptorSet::DynamicUniformBufferBindingElement(m_data_buffer_ptr, + Anvil::DescriptorSet::DynamicUniformBufferBindingElement(m_data_buffer_ptr.get(), 0, /* in_start_offset */ m_ub_data_size_per_swapchain_image) ); } @@ -606,16 +609,15 @@ void App::init_framebuffers() n_fbo < N_SWAPCHAIN_IMAGES; ++n_fbo) { - std::shared_ptr attachment_image_view_ptr; + Anvil::ImageView* attachment_image_view_ptr = nullptr; attachment_image_view_ptr = m_swapchain_ptr->get_image_view(n_fbo); /* Create the internal framebuffer object */ - m_fbos[n_fbo] = Anvil::Framebuffer::create( - m_device_ptr, - WINDOW_WIDTH, - WINDOW_HEIGHT, - 1 /* n_layers */); + m_fbos[n_fbo] = Anvil::Framebuffer::create(m_device_ptr.get(), + WINDOW_WIDTH, + WINDOW_HEIGHT, + 1 /* n_layers */); m_fbos[n_fbo]->set_name_formatted("Framebuffer for swapchain image [%d]", n_fbo); @@ -629,16 +631,15 @@ void App::init_framebuffers() void App::init_gfx_pipelines() { - std::shared_ptr device_locked_ptr (m_device_ptr); - std::unique_ptr gfx_pipeline_info_ptr; - std::shared_ptr gfx_pipeline_manager_ptr(device_locked_ptr->get_graphics_pipeline_manager() ); + Anvil::GraphicsPipelineInfoUniquePtr gfx_pipeline_info_ptr; + auto gfx_pipeline_manager_ptr(m_device_ptr->get_graphics_pipeline_manager() ); /* Create a renderpass for the pipeline */ Anvil::RenderPassAttachmentID render_pass_color_attachment_id; Anvil::SubPassID render_pass_subpass_id; { - std::unique_ptr render_pass_info_ptr(new Anvil::RenderPassInfo(m_device_ptr) ); + Anvil::RenderPassInfoUniquePtr render_pass_info_ptr(new Anvil::RenderPassInfo(m_device_ptr.get() ) ); render_pass_info_ptr->add_color_attachment(m_swapchain_ptr->get_image_format(), VK_SAMPLE_COUNT_1_BIT, @@ -663,14 +664,14 @@ void App::init_gfx_pipelines() m_renderpass_ptr = Anvil::RenderPass::create(std::move(render_pass_info_ptr), - m_swapchain_ptr); + m_swapchain_ptr.get() ); } m_renderpass_ptr->set_name("Main renderpass"); gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ false, /* in_allow_derivatives */ - m_renderpass_ptr, + m_renderpass_ptr.get(), render_pass_subpass_id, *m_fs_ptr, Anvil::ShaderModuleStageEntryPoint(), /* in_geometry_shader */ @@ -680,7 +681,7 @@ void App::init_gfx_pipelines() - gfx_pipeline_info_ptr->set_dsg (m_dsg_ptr); + gfx_pipeline_info_ptr->set_descriptor_set_info (m_dsg_ptr->get_descriptor_set_info() ); gfx_pipeline_info_ptr->attach_push_constant_range (0, /* in_offset */ sizeof(float) * 4 /* vec4 */ * 4 /* vec4 values */, VK_SHADER_STAGE_FRAGMENT_BIT | VK_SHADER_STAGE_VERTEX_BIT); @@ -725,31 +726,31 @@ void App::init_semaphores() n_semaphore < m_n_swapchain_images; ++n_semaphore) { - std::shared_ptr new_signal_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr); - std::shared_ptr new_wait_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr); + auto new_signal_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); + auto new_wait_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); new_signal_semaphore_ptr->set_name_formatted("Signal semaphore [%d]", n_semaphore); new_wait_semaphore_ptr->set_name_formatted ("Wait semaphore [%d]", n_semaphore); - m_frame_signal_semaphores.push_back(new_signal_semaphore_ptr); - m_frame_wait_semaphores.push_back (new_wait_semaphore_ptr); + m_frame_signal_semaphores.push_back(std::move(new_signal_semaphore_ptr) ); + m_frame_wait_semaphores.push_back (std::move(new_wait_semaphore_ptr) ); } } void App::init_shaders() { - std::shared_ptr fragment_shader_ptr; - std::shared_ptr fragment_shader_module_ptr; - std::shared_ptr vertex_shader_ptr; - std::shared_ptr vertex_shader_module_ptr; + Anvil::GLSLShaderToSPIRVGeneratorUniquePtr fragment_shader_ptr; + Anvil::ShaderModuleUniquePtr fragment_shader_module_ptr; + Anvil::GLSLShaderToSPIRVGeneratorUniquePtr vertex_shader_ptr; + Anvil::ShaderModuleUniquePtr vertex_shader_module_ptr; - fragment_shader_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr, + fragment_shader_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_frag, Anvil::SHADER_STAGE_FRAGMENT); - vertex_shader_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr, + vertex_shader_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_vert, Anvil::SHADER_STAGE_VERTEX); @@ -760,59 +761,56 @@ void App::init_shaders() N_TRIANGLES); - fragment_shader_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr, - fragment_shader_ptr); - vertex_shader_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr, - vertex_shader_ptr); + fragment_shader_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr.get (), + fragment_shader_ptr.get() ); + vertex_shader_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr.get (), + vertex_shader_ptr.get () ); fragment_shader_module_ptr->set_name("Fragment shader module"); vertex_shader_module_ptr->set_name ("Vertex shader module"); m_fs_ptr.reset( - new Anvil::ShaderModuleStageEntryPoint( - "main", - fragment_shader_module_ptr, - Anvil::SHADER_STAGE_FRAGMENT) + new Anvil::ShaderModuleStageEntryPoint("main", + std::move(fragment_shader_module_ptr), + Anvil::SHADER_STAGE_FRAGMENT) ); m_vs_ptr.reset( - new Anvil::ShaderModuleStageEntryPoint( - "main", - vertex_shader_module_ptr, - Anvil::SHADER_STAGE_VERTEX) + new Anvil::ShaderModuleStageEntryPoint("main", + std::move(vertex_shader_module_ptr), + Anvil::SHADER_STAGE_VERTEX) ); } void App::init_swapchain() { - std::shared_ptr device_locked_ptr(m_device_ptr); + Anvil::SGPUDevice* device_ptr(m_device_ptr.get() ); - m_rendering_surface_ptr = Anvil::RenderingSurface::create(m_instance_ptr, - m_device_ptr, - m_window_ptr); + m_rendering_surface_ptr = Anvil::RenderingSurface::create(m_instance_ptr.get(), + m_device_ptr.get (), + m_window_ptr.get ()); m_rendering_surface_ptr->set_name("Main rendering surface"); - m_swapchain_ptr = device_locked_ptr->create_swapchain(m_rendering_surface_ptr, - m_window_ptr, - VK_FORMAT_B8G8R8A8_UNORM, - VK_PRESENT_MODE_FIFO_KHR, - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, - m_n_swapchain_images); + m_swapchain_ptr = device_ptr->create_swapchain(m_rendering_surface_ptr.get(), + m_window_ptr.get (), + VK_FORMAT_B8G8R8A8_UNORM, + VK_PRESENT_MODE_FIFO_KHR, + VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, + m_n_swapchain_images); m_swapchain_ptr->set_name("Main swapchain"); /* Cache the queue we are going to use for presentation */ const std::vector* present_queue_fams_ptr = nullptr; - if (!m_rendering_surface_ptr->get_queue_families_with_present_support(device_locked_ptr->get_physical_device(), - &present_queue_fams_ptr) ) + if (!m_rendering_surface_ptr->get_queue_families_with_present_support(&present_queue_fams_ptr) ) { anvil_assert_fail(); } - m_present_queue_ptr = device_locked_ptr->get_queue(present_queue_fams_ptr->at(0), - 0); /* in_n_queue */ + m_present_queue_ptr = device_ptr->get_queue_for_queue_family_index(present_queue_fams_ptr->at(0), + 0); /* in_n_queue */ } void App::init_window() @@ -857,15 +855,13 @@ void App::init_vulkan() m_physical_device_ptr = m_instance_ptr->get_physical_device(0); - /* Determine which extensions we need to request for */ - std::shared_ptr physical_device_locked_ptr(m_instance_ptr->get_physical_device(0) ); - /* Create a Vulkan device */ m_device_ptr = Anvil::SGPUDevice::create(m_physical_device_ptr, + true, /* in_enable_shader_module_cache */ Anvil::DeviceExtensionConfiguration(), - std::vector(), /* layers */ - false, /* transient_command_buffer_allocs_only */ - false); /* support_resettable_command_buffers */ + std::vector(), /* in_layers */ + false, /* in_transient_command_buffer_allocs_only */ + false); /* in_support_resettable_command_buffers */ } VkBool32 App::on_validation_callback(VkDebugReportFlagsEXT in_message_flags, @@ -921,7 +917,7 @@ void App::update_data_ub_contents(uint32_t in_n_swapchain_image) m_data_buffer_ptr->write(in_n_swapchain_image * m_ub_data_size_per_swapchain_image, /* start_offset */ sizeof(data), &data, - m_device_ptr.lock()->get_universal_queue(0) ); + m_device_ptr->get_universal_queue(0) ); ++n_frames_rendered; } @@ -929,7 +925,7 @@ void App::update_data_ub_contents(uint32_t in_n_swapchain_image) int main() { - std::shared_ptr app_ptr(new App() ); + std::unique_ptr app_ptr(new App() ); app_ptr->init(); app_ptr->run(); diff --git a/include/misc/base_pipeline_info.h b/include/misc/base_pipeline_info.h index 028210f6..494d86de 100644 --- a/include/misc/base_pipeline_info.h +++ b/include/misc/base_pipeline_info.h @@ -49,9 +49,9 @@ namespace Anvil return m_base_pipeline_id; } - std::shared_ptr get_dsg() const + const std::vector* get_ds_info_items() const { - return m_dsg_ptr; + return &m_ds_info_items; } const PushConstantRanges& get_push_constant_ranges() const @@ -77,7 +77,7 @@ namespace Anvil return m_is_proxy; } - void set_dsg(std::shared_ptr in_dsg_ptr); + void set_descriptor_set_info(const std::vector* in_ds_info_vec_ptr); protected: /* Protected functions */ @@ -100,18 +100,18 @@ namespace Anvil uint32_t in_n_data_bytes, const void* in_data_ptr); - void init_derivative_pipeline_info(bool in_disable_optimizations, - bool in_allow_derivatives, - uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, - Anvil::PipelineID in_base_pipeline_id, - std::shared_ptr in_opt_dsg_ptr = std::shared_ptr() ); + void init_derivative_pipeline_info(bool in_disable_optimizations, + bool in_allow_derivatives, + uint32_t in_n_shader_module_stage_entrypoints, + const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, + Anvil::PipelineID in_base_pipeline_id, + const std::vector* in_opt_ds_info_vec_ptr = nullptr); void init_proxy_pipeline_info (); - void init_regular_pipeline_info (bool in_disable_optimizations, - bool in_allow_derivatives, - uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, - std::shared_ptr in_opt_dsg_ptr = std::shared_ptr() ); + void init_regular_pipeline_info (bool in_disable_optimizations, + bool in_allow_derivatives, + uint32_t in_n_shader_module_stage_entrypoints, + const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, + const std::vector* in_opt_ds_info_vec_ptr = nullptr); void copy_state_from(const BasePipelineInfo* in_src_pipeline_info_ptr); @@ -122,7 +122,7 @@ namespace Anvil /* Protected variables */ Anvil::PipelineID m_base_pipeline_id; - std::shared_ptr m_dsg_ptr; + std::vector m_ds_info_items; PushConstantRanges m_push_constant_ranges; std::vector m_specialization_constants_data_buffer; ShaderStageToSpecializationConstantsMap m_specialization_constants_map; diff --git a/include/misc/base_pipeline_manager.h b/include/misc/base_pipeline_manager.h index e1a9373d..a68d651e 100644 --- a/include/misc/base_pipeline_manager.h +++ b/include/misc/base_pipeline_manager.h @@ -67,28 +67,12 @@ namespace Anvil public: /* Public functions */ - /** Constructor. Initializes base layer of a pipeline manager. - * - * @param in_device_ptr Device to use. - * @param in_mt_safe True if more than one thread at a time is going to be issuing calls against the pipeline manager. - * @param in_use_pipeline_cache true if a pipeline cache should be used to spawn new pipeline objects. - * What pipeline cache ends up being used depends on @param in_pipeline_cache_to_reuse_ptr - - * if a nullptr object is passed via this argument, a new pipeline cache instance will - * be created, and later released by the destructor. If a non-nullptr object is passed, - * it will be used instead. - * @param in_pipeline_cache_to_reuse_ptr Please see above. - **/ - explicit BasePipelineManager(std::weak_ptr in_device_ptr, - bool in_mt_safe, - bool in_use_pipeline_cache, - std::shared_ptr in_pipeline_cache_to_reuse_ptr); - /** Destructor. Releases internally managed objects. */ virtual ~BasePipelineManager(); /** TODO */ - bool add_pipeline(std::unique_ptr in_pipeline_info_ptr, - PipelineID* out_pipeline_id_ptr); + bool add_pipeline(Anvil::BasePipelineInfoUniquePtr in_pipeline_info_ptr, + PipelineID* out_pipeline_id_ptr); /** TODO */ virtual bool bake() = 0; @@ -125,7 +109,7 @@ namespace Anvil * * @return Ptr to a PipelineLayout instance or nullptr if the function failed. **/ - std::shared_ptr get_pipeline_layout(PipelineID in_pipeline_id); + Anvil::PipelineLayout* get_pipeline_layout(PipelineID in_pipeline_id); /** Returns various post-compile information about compute and graphics pipeline shaders like * compiled binary or optionally shader disassembly. @@ -168,14 +152,14 @@ namespace Anvil /** Internal pipeline object descriptor */ typedef struct Pipeline : public MTSafetySupportProvider { - VkPipeline baked_pipeline; - std::weak_ptr device_ptr; - std::shared_ptr layout_ptr; - std::unique_ptr pipeline_info_ptr; - - Pipeline(std::weak_ptr in_device_ptr, - std::unique_ptr in_pipeline_info_ptr, - bool in_mt_safe) + VkPipeline baked_pipeline; + const BaseDevice* device_ptr; + Anvil::PipelineLayoutUniquePtr layout_ptr; + Anvil::BasePipelineInfoUniquePtr pipeline_info_ptr; + + Pipeline(const Anvil::BaseDevice* in_device_ptr, + Anvil::BasePipelineInfoUniquePtr in_pipeline_info_ptr, + bool in_mt_safe) :MTSafetySupportProvider(in_mt_safe) { baked_pipeline = VK_NULL_HANDLE; @@ -200,6 +184,22 @@ namespace Anvil /* Protected functions */ + /** Constructor. Initializes base layer of a pipeline manager. + * + * @param in_device_ptr Device to use. + * @param in_mt_safe True if more than one thread at a time is going to be issuing calls against the pipeline manager. + * @param in_use_pipeline_cache true if a pipeline cache should be used to spawn new pipeline objects. + * What pipeline cache ends up being used depends on @param in_pipeline_cache_to_reuse_ptr - + * if a nullptr object is passed via this argument, a new pipeline cache instance will + * be created, and later released by the destructor. If a non-nullptr object is passed, + * it will be used instead. + * @param in_pipeline_cache_to_reuse_ptr Please see above. + **/ + explicit BasePipelineManager(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe, + bool in_use_pipeline_cache, + Anvil::PipelineCache* in_pipeline_cache_to_reuse_ptr); + /** Fills & returns a VkSpecializationInfo descriptor. Any sub-descriptors, to which the baked descriptor * is going to point at, are stored in a vector provided by the caller. It is caller's responsibility to * ensure the vector is not released before pipeline baking occurs. @@ -216,15 +216,16 @@ namespace Anvil VkSpecializationInfo* out_specialization_info_ptr); /* Protected members */ - std::weak_ptr m_device_ptr; - std::atomic m_pipeline_counter; + const Anvil::BaseDevice* m_device_ptr; + std::atomic m_pipeline_counter; Pipelines m_baked_pipelines; Pipelines m_outstanding_pipelines; - std::shared_ptr m_pipeline_cache_ptr; - std::shared_ptr m_pipeline_layout_manager_ptr; - bool m_use_pipeline_cache; + Anvil::PipelineCache* m_pipeline_cache_ptr; + PipelineCacheUniquePtr m_pipeline_cache_owned_ptr; + PipelineLayoutManager* m_pipeline_layout_manager_ptr; + bool m_use_pipeline_cache; private: /* Private functions */ diff --git a/include/misc/callbacks.h b/include/misc/callbacks.h index b66c4806..a80cc185 100644 --- a/include/misc/callbacks.h +++ b/include/misc/callbacks.h @@ -72,10 +72,10 @@ namespace Anvil typedef struct IsBufferMemoryAllocPendingQueryCallbackArgument : public Anvil::CallbackArgument { - std::shared_ptr buffer_ptr; - bool result; + const Anvil::Buffer* buffer_ptr; + bool result; - explicit IsBufferMemoryAllocPendingQueryCallbackArgument(std::shared_ptr in_buffer_ptr) + explicit IsBufferMemoryAllocPendingQueryCallbackArgument(const Anvil::Buffer* in_buffer_ptr) :buffer_ptr(in_buffer_ptr), result (false) { @@ -87,7 +87,7 @@ namespace Anvil typedef struct IsImageMemoryAllocPendingQueryCallbackArgument : Anvil::CallbackArgument { - explicit IsImageMemoryAllocPendingQueryCallbackArgument(std::shared_ptr in_image_ptr) + explicit IsImageMemoryAllocPendingQueryCallbackArgument(const Anvil::Image* in_image_ptr) :image_ptr(in_image_ptr), result (false) { @@ -96,13 +96,13 @@ namespace Anvil IsImageMemoryAllocPendingQueryCallbackArgument& operator=(const IsImageMemoryAllocPendingQueryCallbackArgument&) = delete; - const std::shared_ptr image_ptr; - bool result; + const Anvil::Image* image_ptr; + bool result; } IsImageMemoryAllocPendingQueryCallbackArgument; typedef struct OnDescriptorPoolResetCallbackArgument : public Anvil::CallbackArgument { - DescriptorPool* descriptor_pool_ptr; + const DescriptorPool* descriptor_pool_ptr; explicit OnDescriptorPoolResetCallbackArgument(DescriptorPool* in_descriptor_pool_ptr) { @@ -112,9 +112,9 @@ namespace Anvil typedef struct OnGLSLToSPIRVConversionAboutToBeStartedCallbackArgument : public Anvil::CallbackArgument { - GLSLShaderToSPIRVGenerator* generator_ptr; + const GLSLShaderToSPIRVGenerator* generator_ptr; - explicit OnGLSLToSPIRVConversionAboutToBeStartedCallbackArgument(GLSLShaderToSPIRVGenerator* in_generator_ptr) + explicit OnGLSLToSPIRVConversionAboutToBeStartedCallbackArgument(const GLSLShaderToSPIRVGenerator* in_generator_ptr) { generator_ptr = in_generator_ptr; } @@ -143,7 +143,7 @@ namespace Anvil typedef struct OnMemoryBlockNeededForBufferCallbackArgument : public Anvil::CallbackArgument { - explicit OnMemoryBlockNeededForBufferCallbackArgument(std::shared_ptr in_buffer_ptr) + explicit OnMemoryBlockNeededForBufferCallbackArgument(const Anvil::Buffer* in_buffer_ptr) :buffer_ptr(in_buffer_ptr) { /* Stub */ @@ -151,12 +151,12 @@ namespace Anvil OnMemoryBlockNeededForBufferCallbackArgument& operator=(const OnMemoryBlockNeededForBufferCallbackArgument&) = delete; - const std::shared_ptr buffer_ptr; + const Anvil::Buffer* buffer_ptr; } OnMemoryBlockNeededForBufferCallbackArgument; typedef struct OnMemoryBlockNeededForImageCallbackArgument : public Anvil::CallbackArgument { - explicit OnMemoryBlockNeededForImageCallbackArgument(std::shared_ptr in_image_ptr) + explicit OnMemoryBlockNeededForImageCallbackArgument(const Anvil::Image* in_image_ptr) :image_ptr(in_image_ptr) { /* Stub */ @@ -164,14 +164,14 @@ namespace Anvil OnMemoryBlockNeededForImageCallbackArgument& operator=(const OnMemoryBlockNeededForImageCallbackArgument&) = delete; - const std::shared_ptr image_ptr; + const Anvil::Image* image_ptr; } OnMemoryBlockNeededForImageCallbackArgument; typedef struct OnNewBindingAddedToDescriptorSetLayoutCallbackArgument : public Anvil::CallbackArgument { - DescriptorSetLayout* descriptor_set_layout_ptr; + const DescriptorSetLayout* descriptor_set_layout_ptr; - explicit OnNewBindingAddedToDescriptorSetLayoutCallbackArgument(DescriptorSetLayout* in_descriptor_set_layout_ptr) + explicit OnNewBindingAddedToDescriptorSetLayoutCallbackArgument(const DescriptorSetLayout* in_descriptor_set_layout_ptr) { descriptor_set_layout_ptr = in_descriptor_set_layout_ptr; } @@ -225,9 +225,9 @@ namespace Anvil typedef struct OnPresentRequestIssuedCallbackArgument : public Anvil::CallbackArgument { - Swapchain* swapchain_ptr; + const Swapchain* swapchain_ptr; - explicit OnPresentRequestIssuedCallbackArgument(Swapchain* in_swapchain_ptr) + explicit OnPresentRequestIssuedCallbackArgument(const Swapchain* in_swapchain_ptr) { swapchain_ptr = in_swapchain_ptr; } @@ -235,9 +235,9 @@ namespace Anvil typedef struct OnRenderPassBakeNeededCallbackArgument : public Anvil::CallbackArgument { - RenderPass* renderpass_ptr; + const RenderPass* renderpass_ptr; - explicit OnRenderPassBakeNeededCallbackArgument(RenderPass* in_renderpass_ptr) + explicit OnRenderPassBakeNeededCallbackArgument(const RenderPass* in_renderpass_ptr) { renderpass_ptr = in_renderpass_ptr; } @@ -245,9 +245,9 @@ namespace Anvil typedef struct OnWindowAboutToCloseCallbackArgument : public Anvil::CallbackArgument { - Window* window_ptr; + const Window* window_ptr; - explicit OnWindowAboutToCloseCallbackArgument(Window* in_window_ptr) + explicit OnWindowAboutToCloseCallbackArgument(const Window* in_window_ptr) { window_ptr = in_window_ptr; } @@ -424,7 +424,7 @@ namespace Anvil * @param in_callback_arg_ptr Call-back argument to use. **/ void callback(CallbackID in_callback_id, - CallbackArgument* in_callback_arg_ptr) + CallbackArgument* in_callback_arg_ptr) const { std::unique_lock mutex_lock(m_mutex); @@ -557,7 +557,7 @@ namespace Anvil /* Private variables */ CallbackID m_callback_id_count; Callbacks* m_callbacks; - volatile bool m_callbacks_locked; + mutable volatile bool m_callbacks_locked; mutable std::recursive_mutex m_mutex; }; } /* namespace Anvil */ diff --git a/include/misc/compute_pipeline_info.h b/include/misc/compute_pipeline_info.h index 9c89acea..9d9706ef 100644 --- a/include/misc/compute_pipeline_info.h +++ b/include/misc/compute_pipeline_info.h @@ -32,14 +32,14 @@ namespace Anvil { public: /* Public functions */ - static std::unique_ptr create_derivative_pipeline_info(bool in_disable_optimizations, - bool in_allow_derivatives, - const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info, - Anvil::PipelineID in_base_pipeline_id); - static std::unique_ptr create_proxy_pipeline_info (); - static std::unique_ptr create_regular_pipeline_info (bool in_disable_optimizations, - bool in_allow_derivatives, - const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info); + static ComputePipelineInfoUniquePtr create_derivative_pipeline_info(bool in_disable_optimizations, + bool in_allow_derivatives, + const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info, + Anvil::PipelineID in_base_pipeline_id); + static ComputePipelineInfoUniquePtr create_proxy_pipeline_info (); + static ComputePipelineInfoUniquePtr create_regular_pipeline_info (bool in_disable_optimizations, + bool in_allow_derivatives, + const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info); /** Adds a new specialization constant. * diff --git a/include/misc/debug.h b/include/misc/debug.h index b8d20002..a4ed34a8 100644 --- a/include/misc/debug.h +++ b/include/misc/debug.h @@ -24,7 +24,7 @@ #ifndef MISC_DEBUG_H #define MISC_DEBUG_H -#include "misc/types.h" +#include #ifdef _DEBUG diff --git a/include/misc/debug_marker.h b/include/misc/debug_marker.h index 18124643..47995faf 100644 --- a/include/misc/debug_marker.h +++ b/include/misc/debug_marker.h @@ -38,8 +38,8 @@ namespace Anvil /* Public functions */ /** Constructor. */ - DebugMarkerSupportProviderWorker(std::weak_ptr in_device_ptr, - VkDebugReportObjectTypeEXT in_vk_object_type); + DebugMarkerSupportProviderWorker(const Anvil::BaseDevice* in_device_ptr, + VkDebugReportObjectTypeEXT in_vk_object_type); /** Destructor. */ ~DebugMarkerSupportProviderWorker() @@ -109,13 +109,13 @@ namespace Anvil private: /* Private variables */ - std::weak_ptr m_device_ptr; - bool m_is_ext_debug_marker_available; - std::string m_object_name; - std::vector m_object_tag_data; - uint64_t m_object_tag_name; - uint64_t m_vk_object_handle; - VkDebugReportObjectTypeEXT m_vk_object_type; + const Anvil::BaseDevice* m_device_ptr; + bool m_is_ext_debug_marker_available; + std::string m_object_name; + std::vector m_object_tag_data; + uint64_t m_object_tag_name; + uint64_t m_vk_object_handle; + VkDebugReportObjectTypeEXT m_vk_object_type; }; /** This class needs to be inherited from by all wrapper classes that wrap Vulkan objects. @@ -150,11 +150,13 @@ namespace Anvil * True to permit more than one handle to be used. * **/ - DebugMarkerSupportProvider(std::weak_ptr in_device_ptr, - VkDebugReportObjectTypeEXT in_vk_object_type, - bool in_use_delegate_workers = false) + DebugMarkerSupportProvider(const Anvil::BaseDevice* in_device_ptr, + VkDebugReportObjectTypeEXT in_vk_object_type, + bool in_use_delegate_workers = false) { - anvil_assert(!in_device_ptr.expired() ); + anvil_assert(in_device_ptr != nullptr); + + m_device_ptr = in_device_ptr; if (!in_use_delegate_workers) { @@ -165,7 +167,6 @@ namespace Anvil } else { - m_device_ptr = in_device_ptr; m_vk_object_type = in_vk_object_type; } } @@ -187,27 +188,35 @@ namespace Anvil */ void add_delegate(uint64_t in_vk_object_handle) { - std::shared_ptr new_delegate_ptr; - - anvil_assert(m_worker_ptr == nullptr); + Anvil::DebugMarkerSupportProviderWorker* new_delegate_raw_ptr = nullptr; - #ifdef _DEBUG { - for (auto delegate_ptr : m_delegate_workers) + std::unique_ptr new_delegate_ptr; + + anvil_assert(m_worker_ptr == nullptr); + + #ifdef _DEBUG { - anvil_assert(delegate_ptr->get_vk_handle_internal() != in_vk_object_handle); + for (auto& delegate_ptr : m_delegate_workers) + { + anvil_assert(delegate_ptr->get_vk_handle_internal() != in_vk_object_handle); + } } - } - #endif + #endif - new_delegate_ptr.reset( - new Anvil::DebugMarkerSupportProviderWorker(m_device_ptr, - m_vk_object_type) - ); + new_delegate_ptr.reset( + new Anvil::DebugMarkerSupportProviderWorker(m_device_ptr, + m_vk_object_type) + ); - new_delegate_ptr->set_vk_handle_internal(in_vk_object_handle); + new_delegate_ptr->set_vk_handle_internal(in_vk_object_handle); - m_delegate_workers.push_back(new_delegate_ptr); + new_delegate_raw_ptr = new_delegate_ptr.get(); + + m_delegate_workers.push_back( + std::move(new_delegate_ptr) + ); + } if (m_delegate_workers.size() > 1) { @@ -220,13 +229,13 @@ namespace Anvil existing_delegate_worker_ptr->get_tag(&existing_delegate_worker_tag_data_ptr, &existing_delegate_worker_tag_name); - new_delegate_ptr->set_name_internal(existing_delegate_worker_name.c_str() ); + new_delegate_raw_ptr->set_name_internal(existing_delegate_worker_name.c_str() ); if (existing_delegate_worker_tag_data_ptr->size() > 0) { - new_delegate_ptr->set_tag_internal (existing_delegate_worker_tag_name, - existing_delegate_worker_tag_data_ptr->size(), - &existing_delegate_worker_tag_data_ptr->at(0) ); + new_delegate_raw_ptr->set_tag_internal (existing_delegate_worker_tag_name, + existing_delegate_worker_tag_data_ptr->size(), + &existing_delegate_worker_tag_data_ptr->at(0) ); } } } @@ -248,7 +257,7 @@ namespace Anvil */ void remove_delegate(uint64_t in_vk_object_handle) { - std::vector >::iterator worker_iterator; + std::vector >::iterator worker_iterator; anvil_assert(m_worker_ptr == nullptr); @@ -256,7 +265,7 @@ namespace Anvil worker_iterator != m_delegate_workers.end(); ++worker_iterator) { - auto current_worker_ptr = *worker_iterator; + auto& current_worker_ptr = *worker_iterator; if (current_worker_ptr->get_vk_handle_internal() == in_vk_object_handle) { @@ -293,7 +302,7 @@ namespace Anvil } else { - for (auto worker_ptr : m_delegate_workers) + for (auto& worker_ptr : m_delegate_workers) { worker_ptr->set_name_internal(in_object_name); } @@ -329,7 +338,7 @@ namespace Anvil } else { - for (auto worker_ptr : m_delegate_workers) + for (auto& worker_ptr : m_delegate_workers) { worker_ptr->set_name_internal(buffer); } @@ -357,7 +366,7 @@ namespace Anvil } else { - for (auto worker_ptr : m_delegate_workers) + for (auto& worker_ptr : m_delegate_workers) { worker_ptr->set_tag_internal(in_tag_name, in_tag_size, @@ -393,13 +402,14 @@ namespace Anvil /* Private variables */ /* Only used if delegate workers have been requested at creation time: ==> */ - std::vector > m_delegate_workers; - std::weak_ptr m_device_ptr; + std::vector > m_delegate_workers; + const Anvil::BaseDevice* m_device_ptr; VkDebugReportObjectTypeEXT m_vk_object_type; + /* <== */ /* Otherwise: ==> */ - std::shared_ptr m_worker_ptr; + std::unique_ptr m_worker_ptr; /* <== */ friend Wrapper; diff --git a/include/misc/descriptor_set_info.h b/include/misc/descriptor_set_info.h index 8e8ba2fe..1cd3d293 100644 --- a/include/misc/descriptor_set_info.h +++ b/include/misc/descriptor_set_info.h @@ -24,9 +24,17 @@ #define MISC_DESCRIPTOR_SET_INFO_H #include "misc/types.h" +#include "misc/struct_chainer.h" namespace Anvil { + struct DescriptorSetLayoutCreateInfoContainer + { + std::vector binding_info_items; + std::vector sampler_items; + Anvil::StructChainUniquePtr struct_chain_ptr; + }; + class DescriptorSetInfo { public: @@ -43,26 +51,56 @@ namespace Anvil * It is an error to attempt to define immutable samplers for descriptors of type other than * sampler or combined image+sampler. * - * @param in_binding_index Index of the binding to configure. - * @param in_descriptor_type Type of the descriptor to use for the binding. - * @param in_descriptor_array_size Size of the descriptor array to use for the binding. - * @param in_stage_flags Rendering stages which are going to use the binding. - * @param in_opt_immutable_sampler_ptrs If not nullptr, an array of @param in_descriptor_array_size samplers should - * be passed. The binding will then be considered immutable, as per spec language. - * May be nullptr. + * @param in_binding_index Index of the binding to configure. + * @param in_descriptor_type Type of the descriptor to use for the binding. + * @param in_descriptor_array_size Size of the descriptor array to use for the binding. + * @param in_stage_flags Rendering stages which are going to use the binding. + * @param in_flags Please see documentation of Anvil::DescriptorBindingFlags for more details. + * @param in_opt_immutable_sampler_ptr_ptr If not nullptr, an array of @param in_descriptor_array_size samplers should + * be passed. The binding will then be considered immutable, as per spec language. + * May be nullptr. * * @return true if successful, false otherwise. **/ - bool add_binding(uint32_t in_binding_index, - VkDescriptorType in_descriptor_type, - uint32_t in_descriptor_array_size, - VkShaderStageFlags in_stage_flags, - const std::shared_ptr* in_opt_immutable_sampler_ptrs = nullptr); + bool add_binding(uint32_t in_binding_index, + VkDescriptorType in_descriptor_type, + uint32_t in_descriptor_array_size, + VkShaderStageFlags in_stage_flags, + const Anvil::Sampler* const* in_opt_immutable_sampler_ptr_ptr = nullptr); /** Creates a new DescriptorSetInfo instance. **/ - static std::unique_ptr create(); + static DescriptorSetInfoUniquePtr create(); + + /* Fills & returns a VkDescriptorSetLayoutCreateInfo structure holding all information necessary to spawn + * a new descriptor set layout instance. + * + **/ + std::unique_ptr create_descriptor_set_layout_create_info(const Anvil::BaseDevice* in_device_ptr) const; + + /** Retrieves properties of a binding at a given index number. + * + * @param in_n_binding Index number of the binding to retrieve properties of. + * @param out_opt_binding_index_ptr May be nullptr. If not, deref will be set to the index of the + * binding. This does NOT need to be equal to @param in_n_binding. + * @param out_opt_descriptor_type_ptr May be nullptr. If not, deref will be set to the descriptor type + * for the specified binding. + * @param out_opt_descriptor_array_size_ptr May be nullptr. If not, deref will be set to size of the descriptor + * array, associated with the specified binding. + * @param out_opt_stage_flags_ptr May be nullptr. If not, deref will be set to stage flags, + * as configured for the specified binding. + * @param out_opt_immutable_samplers_enabled_ptr May be nullptr. If not, deref will be set to true if immutable samplers + * have been defined for the specified binding; otherwise, it will be + * set to false. + * + * @return true if successful, false otherwise. + **/ + bool get_binding_properties_by_binding_index(uint32_t in_binding_index, + VkDescriptorType* out_opt_descriptor_type_ptr = nullptr, + uint32_t* out_opt_descriptor_array_size_ptr = nullptr, + VkShaderStageFlags* out_opt_stage_flags_ptr = nullptr, + bool* out_opt_immutable_samplers_enabled_ptr = nullptr) const; - /** Retrieves properties of a single defined binding. + /** Retrieves properties of a binding at a given index number. * * @param in_n_binding Index number of the binding to retrieve properties of. * @param out_opt_binding_index_ptr May be nullptr. If not, deref will be set to the index of the @@ -76,15 +114,17 @@ namespace Anvil * @param out_opt_immutable_samplers_enabled_ptr May be nullptr. If not, deref will be set to true if immutable samplers * have been defined for the specified binding; otherwise, it will be * set to false. + * @param out_opt_flags_ptr May be nullptr. If not, deref will be set to the flags specified at binding + * addition time. * * @return true if successful, false otherwise. **/ - bool get_binding_properties(uint32_t in_n_binding, - uint32_t* out_opt_binding_index_ptr, - VkDescriptorType* out_opt_descriptor_type_ptr, - uint32_t* out_opt_descriptor_array_size_ptr, - VkShaderStageFlags* out_opt_stage_flags_ptr, - bool* out_opt_immutable_samplers_enabled_ptr) const; + bool get_binding_properties_by_index_number(uint32_t in_n_binding, + uint32_t* out_opt_binding_index_ptr = nullptr, + VkDescriptorType* out_opt_descriptor_type_ptr = nullptr, + uint32_t* out_opt_descriptor_array_size_ptr = nullptr, + VkShaderStageFlags* out_opt_stage_flags_ptr = nullptr, + bool* out_opt_immutable_samplers_enabled_ptr = nullptr) const; /** Returns the number of bindings defined for the layout. */ uint32_t get_n_bindings() const @@ -92,15 +132,17 @@ namespace Anvil return static_cast(m_bindings.size() ); } + bool operator==(const Anvil::DescriptorSetInfo& in_ds) const; + private: /* Private type definitions */ /** Describes a single descriptor set layout binding */ typedef struct Binding { - uint32_t descriptor_array_size; - VkDescriptorType descriptor_type; - std::vector > immutable_samplers; + uint32_t descriptor_array_size; + VkDescriptorType descriptor_type; + std::vector immutable_samplers; VkShaderStageFlagsVariable(stage_flags); @@ -116,10 +158,10 @@ namespace Anvil * * For argument discussion, please see Anvil::DescriptorSetLayout::add_binding() documentation. **/ - Binding(uint32_t in_descriptor_array_size, - VkDescriptorType in_descriptor_type, - VkShaderStageFlags in_stage_flags, - const std::shared_ptr* in_immutable_sampler_ptrs) + Binding(uint32_t in_descriptor_array_size, + VkDescriptorType in_descriptor_type, + VkShaderStageFlags in_stage_flags, + const Anvil::Sampler* const* in_immutable_sampler_ptrs) { descriptor_array_size = in_descriptor_array_size; descriptor_type = in_descriptor_type; @@ -135,6 +177,14 @@ namespace Anvil } } } + + bool operator==(const Binding& in_binding) const + { + return (descriptor_array_size == in_binding.descriptor_array_size) && + (descriptor_type == in_binding.descriptor_type) && + (immutable_samplers == in_binding.immutable_samplers) && + (stage_flags == in_binding.stage_flags); + } } Binding; typedef std::map BindingIndexToBindingMap; @@ -148,9 +198,6 @@ namespace Anvil BindingIndexToBindingMap m_bindings; ANVIL_DISABLE_ASSIGNMENT_OPERATOR(DescriptorSetInfo); - ANVIL_DISABLE_COPY_CONSTRUCTOR(DescriptorSetInfo); - - friend class Anvil::DescriptorSetLayout; }; }; /* namespace Anvil */ diff --git a/include/misc/dummy_window.h b/include/misc/dummy_window.h index 763ef396..f8f33e26 100644 --- a/include/misc/dummy_window.h +++ b/include/misc/dummy_window.h @@ -35,10 +35,10 @@ namespace Anvil { public: /* Public functions */ - static std::shared_ptr create(const std::string& in_title, - unsigned int in_width, - unsigned int in_height, - Anvil::PresentCallbackFunction in_present_callback_func); + static Anvil::WindowUniquePtr create(const std::string& in_title, + unsigned int in_width, + unsigned int in_height, + Anvil::PresentCallbackFunction in_present_callback_func); virtual ~DummyWindow() { @@ -80,10 +80,10 @@ namespace Anvil { public: /* Public methods */ - static std::shared_ptr create(const std::string& in_title, - unsigned int in_width, - unsigned int in_height, - PresentCallbackFunction in_present_callback_func); + static Anvil::WindowUniquePtr create(const std::string& in_title, + unsigned int in_width, + unsigned int in_height, + PresentCallbackFunction in_present_callback_func); /** Destructor */ virtual ~DummyWindowWithPNGSnapshots() @@ -105,7 +105,7 @@ namespace Anvil * * @param in_swapchain_ptr Swapchain to assign. Must not be NULL. */ - void set_swapchain(std::weak_ptr in_swapchain_ptr); + void set_swapchain(Anvil::Swapchain* in_swapchain_ptr); private: /* Private functions */ @@ -124,7 +124,7 @@ namespace Anvil * * @return As per summary. */ - std::shared_ptr get_swapchain_image_raw_r8g8b8a8_unorm_data(std::shared_ptr in_swapchain_image_ptr); + std::unique_ptr get_swapchain_image_raw_r8g8b8a8_unorm_data(Anvil::Image* in_swapchain_image_ptr); /** Grabs fake swapchain image contents and stores it in a PNG file. */ void store_swapchain_frame(); @@ -135,7 +135,7 @@ namespace Anvil std::string m_title; uint32_t m_width; - std::weak_ptr m_swapchain_ptr; + Anvil::Swapchain* m_swapchain_ptr; }; }; /* namespace Anvil */ diff --git a/include/misc/glsl_to_spirv.h b/include/misc/glsl_to_spirv.h index 4193a286..1c6c759a 100644 --- a/include/misc/glsl_to_spirv.h +++ b/include/misc/glsl_to_spirv.h @@ -59,7 +59,7 @@ namespace Anvil { public: /* Constructor. */ - explicit GLSLangLimits(std::weak_ptr in_device_ptr); + explicit GLSLangLimits(const Anvil::BaseDevice* in_device_ptr); /* Destructor */ ~GLSLangLimits() @@ -135,10 +135,10 @@ namespace Anvil * macro is undefined. * @param in_shader_stage Shader stage described by the file. **/ - static std::shared_ptr create(std::weak_ptr in_opt_device_ptr, - const Mode& in_mode, - std::string in_data, - ShaderStage in_shader_stage); + static Anvil::GLSLShaderToSPIRVGeneratorUniquePtr create(const Anvil::BaseDevice* in_opt_device_ptr, + const Mode& in_mode, + std::string in_data, + ShaderStage in_shader_stage); /** Destructor. Releases all created Vulkan objects, as well as the SPIR-V blob data. */ ~GLSLShaderToSPIRVGenerator(); @@ -221,7 +221,7 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool bake_spirv_blob(); + bool bake_spirv_blob() const; /* Converts a ExtensionBehavior enum value to a corresponding GLSL definition */ std::string get_extension_behavior_glsl_code(const ExtensionBehavior& in_value) const; @@ -258,7 +258,7 @@ namespace Anvil * Otherwise, an assertion failure will occur, as the returned string will have a size of 0. * */ - const std::string& get_glsl_source_code() + const std::string& get_glsl_source_code() const { if (m_glsl_source_code_dirty) { @@ -284,7 +284,7 @@ namespace Anvil * * @return SPIR-V blob or nullptr if the function failed. **/ - const char* get_spirv_blob() + const char* get_spirv_blob() const { if (m_spirv_blob.size() == 0) { @@ -300,7 +300,7 @@ namespace Anvil } /** Returns the number of bytes the SPIR-V blob, accessible via get_spirv_blob(), takes. */ - const uint32_t get_spirv_blob_size() + const uint32_t get_spirv_blob_size() const { if (m_spirv_blob.size() == 0) { @@ -327,15 +327,15 @@ namespace Anvil ANVIL_DISABLE_COPY_CONSTRUCTOR (GLSLShaderToSPIRVGenerator); /* Constructor. Please see create() documentation for specification */ - explicit GLSLShaderToSPIRVGenerator(std::weak_ptr in_device_ptr, - const Mode& in_mode, - std::string in_data, - ShaderStage in_shader_stage); + explicit GLSLShaderToSPIRVGenerator(const Anvil::BaseDevice* in_device_ptr, + const Mode& in_mode, + std::string in_data, + ShaderStage in_shader_stage); - bool bake_glsl_source_code(); + bool bake_glsl_source_code() const; #ifdef ANVIL_LINK_WITH_GLSLANG - bool bake_spirv_blob_by_calling_glslang(const char* in_body); + bool bake_spirv_blob_by_calling_glslang(const char* in_body) const; EShLanguage get_glslang_shader_stage () const; #else bool bake_spirv_blob_by_spawning_glslang_process(const std::string& in_glsl_filename_with_path, @@ -345,18 +345,18 @@ namespace Anvil /* Private members */ #ifdef ANVIL_LINK_WITH_GLSLANG std::unique_ptr m_limits_ptr; - std::string m_program_info_log; - std::string m_shader_info_log; + mutable std::string m_program_info_log; + mutable std::string m_shader_info_log; #endif std::string m_data; Mode m_mode; - std::string m_glsl_source_code; - bool m_glsl_source_code_dirty; + mutable std::string m_glsl_source_code; + mutable bool m_glsl_source_code_dirty; - ShaderStage m_shader_stage; - std::vector m_spirv_blob; + ShaderStage m_shader_stage; + mutable std::vector m_spirv_blob; DefinitionNameToValueMap m_definition_values; ExtensionNameToExtensionBehaviorMap m_extension_behaviors; diff --git a/include/misc/graphics_pipeline_info.h b/include/misc/graphics_pipeline_info.h index f8edb146..432b3131 100644 --- a/include/misc/graphics_pipeline_info.h +++ b/include/misc/graphics_pipeline_info.h @@ -31,27 +31,27 @@ namespace Anvil { public: /* Public functions */ - static std::unique_ptr create_derivative_pipeline_info(bool in_disable_optimizations, - bool in_allow_derivatives, - std::shared_ptr in_renderpass_ptr, - SubPassID in_subpass_id, - const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, - Anvil::PipelineID in_base_pipeline_id); - static std::unique_ptr create_proxy_pipeline_info (); - static std::unique_ptr create_regular_pipeline_info (bool in_disable_optimizations, - bool in_allow_derivatives, - std::shared_ptr in_renderpass_ptr, - SubPassID in_subpass_id, - const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, - const Anvil::GraphicsPipelineInfo* in_opt_reference_pipeline_info_ptr = nullptr); + static Anvil::GraphicsPipelineInfoUniquePtr create_derivative_pipeline_info(bool in_disable_optimizations, + bool in_allow_derivatives, + const RenderPass* in_renderpass_ptr, + SubPassID in_subpass_id, + const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, + Anvil::PipelineID in_base_pipeline_id); + static Anvil::GraphicsPipelineInfoUniquePtr create_proxy_pipeline_info (); + static Anvil::GraphicsPipelineInfoUniquePtr create_regular_pipeline_info (bool in_disable_optimizations, + bool in_allow_derivatives, + const RenderPass* in_renderpass_ptr, + SubPassID in_subpass_id, + const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, + const Anvil::GraphicsPipelineInfo* in_opt_reference_pipeline_info_ptr = nullptr); ~GraphicsPipelineInfo(); @@ -215,18 +215,18 @@ namespace Anvil * by the pipeline. * @param out_opt_n_vertex_attributes_ptr If not null, deref will be set to the number of vertex * attributes specified by the owner. - * @param out_opt_renderpass_ptr If not null, deref will be set to the renderpass assigned to + * @param out_opt_renderpass_ptr_ptr If not null, deref will be set to the renderpass assigned to * the pipeline. * @param out_opt_subpass_id_ptr If not null, deref will be set to the ID of the subpass the pipeline * has been created for. * * @return true if successful, false otherwise. **/ - void get_graphics_pipeline_properties(uint32_t* out_opt_n_scissors_ptr, - uint32_t* out_opt_n_viewports_ptr, - uint32_t* out_opt_n_vertex_attributes_ptr, - std::shared_ptr* out_opt_renderpass_ptr, - SubPassID* out_opt_subpass_id_ptr) const; + void get_graphics_pipeline_properties(uint32_t* out_opt_n_scissors_ptr, + uint32_t* out_opt_n_viewports_ptr, + uint32_t* out_opt_n_vertex_attributes_ptr, + const RenderPass** out_opt_renderpass_ptr_ptr, + SubPassID* out_opt_subpass_id_ptr) const; /** Retrieves logic op-related state configuration. * @@ -285,7 +285,7 @@ namespace Anvil VkFrontFace* out_opt_front_face_ptr, float* out_opt_line_width_ptr) const; - std::shared_ptr get_renderpass() const + const RenderPass* get_renderpass() const { return m_renderpass_ptr; } @@ -883,8 +883,8 @@ namespace Anvil typedef std::map InternalViewports; /* Private functions */ - explicit GraphicsPipelineInfo(std::shared_ptr in_renderpass_ptr, - SubPassID in_subpass_id); + explicit GraphicsPipelineInfo(const RenderPass* in_renderpass_ptr, + SubPassID in_subpass_id); bool copy_gfx_state_from(const Anvil::GraphicsPipelineInfo* in_src_pipeline_info_ptr); @@ -938,8 +938,8 @@ namespace Anvil VkCullModeFlagsVariable (m_cull_mode); VkSampleCountFlagsVariable(m_sample_count); - std::shared_ptr m_renderpass_ptr; - SubPassID m_subpass_id; + const RenderPass* m_renderpass_ptr; + SubPassID m_subpass_id; }; }; diff --git a/include/misc/memalloc_backends/backend_oneshot.h b/include/misc/memalloc_backends/backend_oneshot.h index 1a27e66e..81aed926 100644 --- a/include/misc/memalloc_backends/backend_oneshot.h +++ b/include/misc/memalloc_backends/backend_oneshot.h @@ -41,7 +41,8 @@ namespace Anvil * * Should only be used by Anvil::MemoryAllocator */ - class OneShot : public Anvil::MemoryAllocator::IMemoryAllocatorBackend + class OneShot : public Anvil::MemoryAllocator::IMemoryAllocatorBackend, + public std::enable_shared_from_this { public: /* Public functions */ @@ -52,7 +53,7 @@ namespace Anvil * * @param in_device_ptr Vulkan device the memory allocations are going to be made for. **/ - OneShot(std::weak_ptr in_device_ptr); + OneShot(const Anvil::BaseDevice* in_device_ptr); /** Destructor. */ virtual ~OneShot(); @@ -66,10 +67,9 @@ namespace Anvil /* Private functions */ /* Private variables */ - std::weak_ptr m_device_ptr; - bool m_is_baked; - std::vector > m_memory_blocks; - + const Anvil::BaseDevice* m_device_ptr; + bool m_is_baked; + std::vector m_memory_blocks; }; }; }; diff --git a/include/misc/memalloc_backends/backend_vma.h b/include/misc/memalloc_backends/backend_vma.h index 3a7f0435..254d0ca3 100644 --- a/include/misc/memalloc_backends/backend_vma.h +++ b/include/misc/memalloc_backends/backend_vma.h @@ -41,7 +41,8 @@ namespace Anvil * * Should only be used by Anvil::MemoryAllocator */ - class VMA : public Anvil::MemoryAllocator::IMemoryAllocatorBackend + class VMA : public Anvil::MemoryAllocator::IMemoryAllocatorBackend, + public std::enable_shared_from_this { public: /* Public functions */ @@ -52,7 +53,7 @@ namespace Anvil * * @param in_device_ptr Vulkan device the memory allocations are going to be made for. **/ - static std::shared_ptr create(std::weak_ptr in_device_ptr); + static std::unique_ptr create(const Anvil::BaseDevice* in_device_ptr); /** Destructor. */ virtual ~VMA(); @@ -73,7 +74,7 @@ namespace Anvil * * @param in_device_ptr Device the allocator should be initialized for. **/ - static std::shared_ptr create(std::weak_ptr in_device_ptr); + static std::shared_ptr create(const Anvil::BaseDevice* in_device_ptr); /** Destructor */ virtual ~VMAAllocator(); @@ -101,20 +102,20 @@ namespace Anvil private: /* Private functions */ - VMAAllocator(std::weak_ptr in_device_ptr); + VMAAllocator(const Anvil::BaseDevice* in_device_ptr); bool init(); /* Private variables */ - VmaAllocator m_allocator; - std::weak_ptr m_device_ptr; + VmaAllocator m_allocator; + const Anvil::BaseDevice* m_device_ptr; std::vector > m_refcount_helper; }; /* Private functions */ - VMA(std::weak_ptr in_device_ptr); + VMA(const Anvil::BaseDevice* in_device_ptr); bool init(); @@ -124,8 +125,8 @@ namespace Anvil bool supports_baking() const; /* Private variables */ - std::weak_ptr m_device_ptr; - std::shared_ptr m_vma_allocator_ptr; + const Anvil::BaseDevice* m_device_ptr; + std::shared_ptr m_vma_allocator_ptr; }; }; }; diff --git a/include/misc/memory_allocator.h b/include/misc/memory_allocator.h index 10ab3a3a..f5855149 100644 --- a/include/misc/memory_allocator.h +++ b/include/misc/memory_allocator.h @@ -32,6 +32,7 @@ #include "misc/debug.h" #include "misc/mt_safety.h" #include "misc/types.h" +#include #include @@ -39,8 +40,7 @@ namespace Anvil { typedef std::function MemoryAllocatorBakeCallbackFunction; - class MemoryAllocator : public MTSafetySupportProvider, - public std::enable_shared_from_this + class MemoryAllocator : public MTSafetySupportProvider { public: /* Public type definitions */ @@ -56,27 +56,27 @@ namespace Anvil typedef struct Item { - std::shared_ptr buffer_ptr; - std::shared_ptr buffer_ref_float_data_ptr; - std::shared_ptr > buffer_ref_float_vector_data_ptr; - std::shared_ptr buffer_ref_uchar8_data_ptr; - std::shared_ptr > buffer_ref_uchar8_vector_data_ptr; - std::shared_ptr buffer_ref_uint32_data_ptr; - std::shared_ptr > buffer_ref_uint32_vector_data_ptr; - std::shared_ptr image_ptr; + Anvil::Buffer* buffer_ptr; + std::unique_ptr buffer_ref_float_data_ptr; + std::unique_ptr, std::function*)> > buffer_ref_float_vector_data_ptr; + std::unique_ptr buffer_ref_uchar8_data_ptr; + std::unique_ptr > buffer_ref_uchar8_vector_data_ptr; + std::unique_ptr buffer_ref_uint32_data_ptr; + std::unique_ptr, std::function*)> > buffer_ref_uint32_vector_data_ptr; + Anvil::Image* image_ptr; - std::shared_ptr memory_allocator_ptr; + Anvil::MemoryAllocator* memory_allocator_ptr; ItemType type; - std::shared_ptr alloc_memory_block_ptr; - uint32_t alloc_memory_final_type; - VkDeviceSize alloc_memory_required_alignment; - MemoryFeatureFlags alloc_memory_required_features; - uint32_t alloc_memory_supported_memory_types; - uint32_t alloc_memory_types; - VkDeviceSize alloc_offset; - VkDeviceSize alloc_size; + MemoryBlockUniquePtr alloc_memory_block_ptr; + uint32_t alloc_memory_final_type; + VkDeviceSize alloc_memory_required_alignment; + MemoryFeatureFlags alloc_memory_required_features; + uint32_t alloc_memory_supported_memory_types; + uint32_t alloc_memory_types; + VkDeviceSize alloc_offset; + VkDeviceSize alloc_size; VkExtent3D extent; bool is_baked; @@ -85,54 +85,56 @@ namespace Anvil VkOffset3D offset; VkImageSubresource subresource; - Item(std::shared_ptr in_memory_allocator_ptr, - std::shared_ptr in_buffer_ptr, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types); - - Item(std::shared_ptr in_memory_allocator_ptr, - std::shared_ptr in_buffer_ptr, - VkDeviceSize in_alloc_offset, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types); - - Item(std::shared_ptr in_memory_allocator_ptr, - std::shared_ptr in_image_ptr, - uint32_t in_n_layer, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_miptail_offset, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types); - - Item(std::shared_ptr in_memory_allocator_ptr, - std::shared_ptr in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - const VkExtent3D& in_extent, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types); - - Item(std::shared_ptr in_memory_allocator_ptr, - std::shared_ptr in_image_ptr, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types); - - Item& operator=(const Item&); - Item (const Item&); + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types); + + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_alloc_offset, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types); + + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_layer, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_miptail_offset, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types); + + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + const VkExtent3D& in_extent, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types); + + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types); + + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment); /** TODO */ ~Item(); @@ -147,9 +149,9 @@ namespace Anvil bool image_has_memory_block_needed_callback_registered; } Item; - typedef std::vector > Items; + typedef std::vector > Items; - class IMemoryAllocatorBackend + class IMemoryAllocatorBackend : public IMemoryAllocatorBackendBase { public: virtual ~IMemoryAllocatorBackend() @@ -157,8 +159,7 @@ namespace Anvil /* Stub */ } - virtual bool bake (Items& in_items) = 0; - virtual bool supports_baking() const = 0; + virtual bool bake(Items& in_items) = 0; }; /* Public functions */ @@ -179,25 +180,31 @@ namespace Anvil * * @return true if the buffer has been successfully scheduled for baking, false otherwise. **/ - bool add_buffer (std::shared_ptr in_buffer_ptr, + bool add_buffer (Anvil::Buffer* in_buffer_ptr, MemoryFeatureFlags in_required_memory_features); - bool add_buffer_with_float_data_ptr_based_post_fill (std::shared_ptr in_buffer_ptr, - std::shared_ptr in_data_ptr, + bool add_buffer_with_float_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, + std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features); - bool add_buffer_with_float_data_vector_ptr_based_post_fill (std::shared_ptr in_buffer_ptr, - std::shared_ptr > in_data_vector_ptr, + bool add_buffer_with_float_data_vector_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, + std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features); - bool add_buffer_with_uchar8_data_ptr_based_post_fill (std::shared_ptr in_buffer_ptr, - std::shared_ptr in_data_ptr, + bool add_buffer_with_float_data_vector_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, + const std::vector* in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features); - bool add_buffer_with_uchar8_data_vector_ptr_based_post_fill(std::shared_ptr in_buffer_ptr, - std::shared_ptr > in_data_vector_ptr, + bool add_buffer_with_uchar8_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, + std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features); - bool add_buffer_with_uint32_data_ptr_based_post_fill (std::shared_ptr in_buffer_ptr, - std::shared_ptr in_data_ptr, + bool add_buffer_with_uchar8_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features); - bool add_buffer_with_uint32_data_vector_ptr_based_post_fill(std::shared_ptr in_buffer_ptr, - std::shared_ptr > in_data_vector_ptr, + bool add_buffer_with_uint32_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, + std::unique_ptr in_data_ptr, + MemoryFeatureFlags in_required_memory_features); + bool add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr > in_data_vector_ptr, + MemoryFeatureFlags in_required_memory_features); + bool add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + const std::vector* in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features); /** TODO @@ -209,10 +216,10 @@ namespace Anvil * * @return TODO */ - bool add_sparse_buffer_region(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - VkDeviceSize in_size, - MemoryFeatureFlags in_required_memory_features); + bool add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkDeviceSize in_size, + MemoryFeatureFlags in_required_memory_features); /** Adds an Image object which should be assigned storage coming from memory objects * maintained by the Memory Allocator. At baking time, all subresources of the image, @@ -227,8 +234,8 @@ namespace Anvil * * @return true if the image has been successfully scheduled for baking, false otherwise. **/ - bool add_image_whole(std::shared_ptr in_image_ptr, - MemoryFeatureFlags in_required_memory_features); + bool add_image_whole(Anvil::Image* in_image_ptr, + MemoryFeatureFlags in_required_memory_features); /** Adds a new Image object whose layer @param in_n_layer 's miptail for @param in_aspect * aspect should be assigned a physical memory backing. The miptail will be bound a memory @@ -247,10 +254,10 @@ namespace Anvil * * @return true if the miptail has been successfully scheduled for baking, false otherwise. */ - bool add_sparse_image_miptail(std::shared_ptr in_image_ptr, - VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - MemoryFeatureFlags in_required_memory_features); + bool add_sparse_image_miptail(Anvil::Image* in_image_ptr, + VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + MemoryFeatureFlags in_required_memory_features); /** Adds a single subresource which should be assigned memory backing. * @@ -270,11 +277,11 @@ namespace Anvil * * @return true if the subresource has been successfully scheduled for baking, false otherwise. **/ - bool add_sparse_image_subresource(std::shared_ptr in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - VkExtent3D in_extent, - MemoryFeatureFlags in_required_memory_features); + bool add_sparse_image_subresource(Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + VkExtent3D in_extent, + MemoryFeatureFlags in_required_memory_features); /** TODO */ bool bake(); @@ -285,8 +292,8 @@ namespace Anvil * * @param in_device_ptr Device to use. **/ - static std::shared_ptr create_oneshot(std::weak_ptr in_device_ptr, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::MemoryAllocatorUniquePtr create_oneshot(const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Creates a new VMA memory allocator instance. * @@ -294,8 +301,8 @@ namespace Anvil * * @param in_device_ptr Device to use. **/ - static std::shared_ptr create_vma(std::weak_ptr in_device_ptr, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::MemoryAllocatorUniquePtr create_vma(const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Assigns a func pointer which will be called by the allocator after all added objects * have been assigned memory blocks. @@ -316,11 +323,11 @@ namespace Anvil private: /* Private functions */ - bool add_buffer_internal(std::shared_ptr in_buffer_ptr, - MemoryFeatureFlags in_required_memory_features); - bool is_alloc_supported (uint32_t in_memory_types, - Anvil::MemoryFeatureFlags in_memory_features, - uint32_t* out_opt_filtered_memory_types_ptr) const; + bool add_buffer_internal(Anvil::Buffer* in_buffer_ptr, + MemoryFeatureFlags in_required_memory_features); + bool is_alloc_supported (uint32_t in_memory_types, + Anvil::MemoryFeatureFlags in_memory_features, + uint32_t* out_opt_filtered_memory_types_ptr) const; void on_is_alloc_pending_for_buffer_query(CallbackArgument* in_callback_arg_ptr); void on_is_alloc_pending_for_image_query (CallbackArgument* in_callback_arg_ptr); @@ -329,7 +336,7 @@ namespace Anvil /** Constructor. * * Please see create() documentation for specification. */ - MemoryAllocator(std::weak_ptr in_device_ptr, + MemoryAllocator(const Anvil::BaseDevice* in_device_ptr, std::shared_ptr in_backend_ptr, bool in_mt_safe); @@ -338,7 +345,7 @@ namespace Anvil /* Private members */ std::shared_ptr m_backend_ptr; - std::weak_ptr m_device_ptr; + const Anvil::BaseDevice* m_device_ptr; Items m_items; std::map m_per_object_pending_alloc_status; diff --git a/include/misc/mt_safety.h b/include/misc/mt_safety.h index fe7c1772..10a6d75e 100644 --- a/include/misc/mt_safety.h +++ b/include/misc/mt_safety.h @@ -22,8 +22,8 @@ #ifndef MISC_MT_SAFETY_H #define MISC_MT_SAFETY_H -#include "misc/types.h" - +#include +#include namespace Anvil { @@ -37,8 +37,6 @@ namespace Anvil m_mutex_ptr.reset( new std::recursive_mutex() ); - - anvil_assert(m_mutex_ptr != nullptr); } } @@ -52,7 +50,7 @@ namespace Anvil return (m_mutex_ptr != nullptr); } - inline void lock() + inline void lock() const { if (m_mutex_ptr != nullptr) { @@ -60,7 +58,7 @@ namespace Anvil } } - inline void unlock() + inline void unlock() const { if (m_mutex_ptr != nullptr) { @@ -77,8 +75,8 @@ namespace Anvil private: std::unique_ptr m_mutex_ptr; - ANVIL_DISABLE_ASSIGNMENT_OPERATOR(MTSafetySupportProvider); - ANVIL_DISABLE_COPY_CONSTRUCTOR (MTSafetySupportProvider); + MTSafetySupportProvider (const MTSafetySupportProvider&); + MTSafetySupportProvider& operator=(const MTSafetySupportProvider&) const; }; }; /* namespace Anvil */ diff --git a/include/misc/page_tracker.h b/include/misc/page_tracker.h index 16b02ad9..47599a29 100644 --- a/include/misc/page_tracker.h +++ b/include/misc/page_tracker.h @@ -54,9 +54,9 @@ namespace Anvil * * @return Memory block instance bound to the specified page OR null, if no memory block has been assigned to the memory region. */ - std::shared_ptr get_memory_block(VkDeviceSize in_start_offset_page_aligned, - VkDeviceSize in_size, - VkDeviceSize* out_memory_region_start_offset_ptr) const; + Anvil::MemoryBlock* get_memory_block(VkDeviceSize in_start_offset_page_aligned, + VkDeviceSize in_size, + VkDeviceSize* out_memory_region_start_offset_ptr) const; /** The same memory block is often bound to more than just one page. PageTracker * coalesces such occurences into a single descriptor. @@ -69,7 +69,7 @@ namespace Anvil * * @return The requested memory block. */ - std::shared_ptr get_memory_block(uint32_t in_n_memory_block) const + Anvil::MemoryBlock* get_memory_block(uint32_t in_n_memory_block) const { anvil_assert(in_n_memory_block < m_memory_blocks.size() ); @@ -114,25 +114,27 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool set_binding(std::shared_ptr in_memory_block_ptr, - VkDeviceSize in_memory_block_start_offset, - VkDeviceSize in_start_offset, - VkDeviceSize in_size); + bool set_binding(MemoryBlock* in_memory_block_ptr, + VkDeviceSize in_memory_block_start_offset, + VkDeviceSize in_start_offset, + VkDeviceSize in_size); private: /* Private type definitions */ typedef struct MemoryBlockBinding { - std::shared_ptr memory_block_ptr; - VkDeviceSize memory_block_start_offset; - VkDeviceSize size; - VkDeviceSize start_offset; - - MemoryBlockBinding(std::shared_ptr in_memory_block_ptr, - VkDeviceSize in_memory_block_start_offset, - VkDeviceSize in_size, - VkDeviceSize in_start_offset) + MemoryBlock* memory_block_ptr; + VkDeviceSize memory_block_start_offset; + VkDeviceSize size; + VkDeviceSize start_offset; + + MemoryBlockBinding(MemoryBlock* in_memory_block_ptr, + VkDeviceSize in_memory_block_start_offset, + VkDeviceSize in_size, + VkDeviceSize in_start_offset) { + anvil_assert(in_memory_block_ptr != nullptr); + memory_block_ptr = in_memory_block_ptr; memory_block_start_offset = in_memory_block_start_offset; size = in_size; diff --git a/include/misc/pools.h b/include/misc/pools.h index 939c256e..b41eef4b 100644 --- a/include/misc/pools.h +++ b/include/misc/pools.h @@ -62,9 +62,9 @@ namespace Anvil /* Stub */ } - virtual PoolItem create_item () = 0; - virtual void release_item(PoolItem in_item_ptr) = 0; - virtual void reset_item (PoolItem in_item_ptr) = 0; + virtual PoolItem create_item () = 0; + virtual void release_item(PoolItem in_item_ptr) = 0; + virtual void reset_item (PoolItem& in_item_ptr) = 0; }; /** Generic pool implementation */ @@ -80,13 +80,16 @@ namespace Anvil PoolItemContainer(PoolItemPtrType in_item) { - item = in_item; + item = std::move(in_item); } bool operator==(const PoolItemType* in_item_ptr) const { return item.get() == in_item_ptr; } + + PoolItemContainer(const PoolItemContainer&) = delete; + PoolItemContainer& operator=(const PoolItemContainer&) = delete; }; /** A functor which returns an object back to the pool. @@ -145,9 +148,13 @@ namespace Anvil n_item < in_n_items_to_preallocate; ++n_item) { - PoolItemContainer new_item_container(m_worker_ptr->create_item() ); + std::unique_ptr > new_item_container_ptr( + new PoolItemContainer(m_worker_ptr->create_item() ) + ); - m_available_pool_item_containers.push_back(new_item_container); + m_available_pool_item_containers.push_back( + std::move(new_item_container_ptr) + ); } } @@ -160,18 +167,22 @@ namespace Anvil { while (!m_active_pool_item_containers.empty()) { - Anvil::PoolItemContainer current_item_container = m_active_pool_item_containers.front(); + std::unique_ptr >& current_item_container = m_active_pool_item_containers.back(); - m_worker_ptr->release_item(current_item_container.item); + m_worker_ptr->release_item( + std::move(current_item_container->item) + ); m_active_pool_item_containers.pop_back(); } while (!m_available_pool_item_containers.empty()) { - Anvil::PoolItemContainer current_item_container = m_available_pool_item_containers.front(); + std::unique_ptr >& current_item_container = m_available_pool_item_containers.back(); - m_worker_ptr->release_item(current_item_container.item); + m_worker_ptr->release_item( + std::move(current_item_container->item) + ); m_available_pool_item_containers.pop_back(); } @@ -205,19 +216,26 @@ namespace Anvil if (!m_available_pool_item_containers.empty()) { - result = PoolItemPtrType(m_available_pool_item_containers.back().item.get(), + result = PoolItemPtrType(m_available_pool_item_containers.back()->item.get(), release_functor); - m_active_pool_item_containers.push_back (m_available_pool_item_containers.back() ); + m_active_pool_item_containers.push_back( + std::move(m_available_pool_item_containers.back() ) + ); + m_available_pool_item_containers.pop_back(); } else { - PoolItemContainer new_item_container(m_worker_ptr->create_item() ); + std::unique_ptr > new_item_container( + new PoolItemContainer(m_worker_ptr->create_item() ) + ); - m_active_pool_item_containers.push_back(new_item_container); + m_active_pool_item_containers.push_back( + std::move(new_item_container) + ); - result = PoolItemPtrType(m_active_pool_item_containers.back().item.get(), + result = PoolItemPtrType(m_active_pool_item_containers.back()->item.get(), release_functor); } @@ -229,8 +247,8 @@ namespace Anvil /** Stores the provided instance back in the pool. */ void return_item(PoolItemType* in_item_ptr) { - PoolItemContainer container; - bool has_found = false; + std::unique_ptr > container; + bool has_found = false; ANVIL_REDUNDANT_VARIABLE(has_found); @@ -238,9 +256,9 @@ namespace Anvil iterator != m_active_pool_item_containers.end(); ++iterator) { - if (iterator->item.get() == in_item_ptr) + if ((*iterator)->item.get() == in_item_ptr) { - container = *iterator; + container = std::move(*iterator); has_found = true; m_active_pool_item_containers.erase(iterator); @@ -251,12 +269,14 @@ namespace Anvil anvil_assert(has_found); - m_available_pool_item_containers.push_back(container); + m_available_pool_item_containers.push_back( + std::move(container) + ); } protected: /* Protected type declarations */ - typedef std::vector > PoolItemContainers; + typedef std::vector > > PoolItemContainers; /* Protected functions */ @@ -278,8 +298,8 @@ namespace Anvil /** Implements IPoolWorker interface for primary command buffers. */ - template - class CommandBufferPoolWorker : public IPoolWorker > + template + class CommandBufferPoolWorker : public IPoolWorker { public: /* Public functions */ @@ -291,7 +311,7 @@ namespace Anvil * @param in_parent_command_pool_ptr Command pool instance, from which command buffers * should be spawned. Must not be nullptr. **/ - CommandBufferPoolWorker(std::shared_ptr in_parent_command_pool_ptr) + CommandBufferPoolWorker(Anvil::CommandPool* in_parent_command_pool_ptr) :m_parent_command_pool_ptr(in_parent_command_pool_ptr) { anvil_assert(m_parent_command_pool_ptr != nullptr) @@ -306,25 +326,9 @@ namespace Anvil /* Stub */ } - /** Creates a new primary / secondary command buffer instance. The command buffer - * is taken from the pool specified at worker instantiation time. **/ - virtual std::shared_ptr create_item() = 0; - - /** Resets contents of the specified command buffer. - * - * @param in_item_ptr Command buffer to reset. Must not be nullptr. - **/ - virtual void reset_item(std::shared_ptr in_item_ptr) = 0; - - /** Releases the specified command buffer. **/ - void release_item(std::shared_ptr in_item_ptr) - { - /* Nop */ - } - protected: /* Protected variables */ - std::shared_ptr m_parent_command_pool_ptr; + Anvil::CommandPool* m_parent_command_pool_ptr; private: /* Private functions */ @@ -332,10 +336,10 @@ namespace Anvil bool operator= (const CommandBufferPoolWorker&); }; - class PrimaryCommandBufferPoolWorker : public CommandBufferPoolWorker + class PrimaryCommandBufferPoolWorker : public CommandBufferPoolWorker { public: - PrimaryCommandBufferPoolWorker(std::shared_ptr in_parent_command_pool_ptr) + PrimaryCommandBufferPoolWorker(Anvil::CommandPool* in_parent_command_pool_ptr) :CommandBufferPoolWorker(in_parent_command_pool_ptr) { /* Stub */ @@ -346,17 +350,22 @@ namespace Anvil /* Stub */ } - std::shared_ptr create_item(); - void reset_item (std::shared_ptr in_item_ptr); + Anvil::PrimaryCommandBufferUniquePtr create_item (); + void reset_item (Anvil::PrimaryCommandBufferUniquePtr& in_item_ptr); + + void release_item(Anvil::PrimaryCommandBufferUniquePtr in_item_ptr) + { + /* Stub */ + } ANVIL_DISABLE_ASSIGNMENT_OPERATOR(PrimaryCommandBufferPoolWorker); ANVIL_DISABLE_COPY_CONSTRUCTOR (PrimaryCommandBufferPoolWorker); }; - class SecondaryCommandBufferPoolWorker : public CommandBufferPoolWorker + class SecondaryCommandBufferPoolWorker : public CommandBufferPoolWorker { public: - SecondaryCommandBufferPoolWorker(std::shared_ptr in_parent_command_pool_ptr) + SecondaryCommandBufferPoolWorker(Anvil::CommandPool* in_parent_command_pool_ptr) :CommandBufferPoolWorker(in_parent_command_pool_ptr) { /* Stub */ @@ -367,8 +376,13 @@ namespace Anvil /* Stub */ } - std::shared_ptr create_item(); - void reset_item (std::shared_ptr in_item_ptr); + Anvil::SecondaryCommandBufferUniquePtr create_item (); + void reset_item (Anvil::SecondaryCommandBufferUniquePtr& in_item_ptr); + + void release_item(Anvil::SecondaryCommandBufferUniquePtr in_item_ptr) + { + /* Stub */ + } ANVIL_DISABLE_ASSIGNMENT_OPERATOR(SecondaryCommandBufferPoolWorker); ANVIL_DISABLE_COPY_CONSTRUCTOR (SecondaryCommandBufferPoolWorker); @@ -386,14 +400,13 @@ namespace Anvil * @param in_n_preallocated_items Number of command buffers to preallocate at creation time. * **/ - static std::shared_ptr > create(std::shared_ptr in_parent_command_pool_ptr, - uint32_t in_n_preallocated_items) + static std::unique_ptr > create(Anvil::CommandPool* in_parent_command_pool_ptr, + uint32_t in_n_preallocated_items) { - std::shared_ptr > result_ptr; + std::unique_ptr > result_ptr; result_ptr.reset( - new CommandBufferPool(in_parent_command_pool_ptr, - in_n_preallocated_items, + new CommandBufferPool(in_n_preallocated_items, new PoolWorker(in_parent_command_pool_ptr)) ); @@ -409,9 +422,8 @@ namespace Anvil private: /* Constructor. Please see create() for documentation */ - CommandBufferPool(std::shared_ptr in_parent_command_pool_ptr, - uint32_t in_n_preallocated_items, - PoolWorker* in_pool_worker_ptr) + CommandBufferPool(uint32_t in_n_preallocated_items, + PoolWorker* in_pool_worker_ptr) :GenericPool(in_n_preallocated_items, in_pool_worker_ptr) { @@ -421,8 +433,8 @@ namespace Anvil }; /* Command pool specializations */ - typedef CommandBufferPool > PrimaryCommandBufferPool; - typedef CommandBufferPool > SecondaryCommandBufferPool; + typedef CommandBufferPool PrimaryCommandBufferPool; + typedef CommandBufferPool SecondaryCommandBufferPool; }; /* namespace Anvil */ diff --git a/include/misc/render_pass_info.h b/include/misc/render_pass_info.h index 7270eb87..98406b44 100644 --- a/include/misc/render_pass_info.h +++ b/include/misc/render_pass_info.h @@ -29,7 +29,7 @@ namespace Anvil class RenderPassInfo { public: - RenderPassInfo(std::weak_ptr in_device_ptr); + RenderPassInfo(const Anvil::BaseDevice* in_device_ptr); ~RenderPassInfo(); /** Adds a new render-pass color attachment to the internal data model. @@ -371,7 +371,7 @@ namespace Anvil VkImageLayout* out_opt_final_layout_ptr = nullptr, bool* out_opt_may_alias_ptr = nullptr) const; - std::weak_ptr get_device() const + const Anvil::BaseDevice* get_device() const { return m_device_ptr; } @@ -411,7 +411,7 @@ namespace Anvil AttachmentType in_attachment_type, uint32_t in_n_subpass_attachment, RenderPassAttachmentID* out_renderpass_attachment_id_ptr, - VkImageLayout* out_layout_ptr); + VkImageLayout* out_layout_ptr) const; /** Returns the number of attachments of user-specified type, defined for the specified subpass. * @@ -427,7 +427,7 @@ namespace Anvil **/ bool get_subpass_n_attachments(SubPassID in_subpass_id, AttachmentType in_attachment_type, - uint32_t* out_n_attachments_ptr); + uint32_t* out_n_attachments_ptr) const; private: /* Private type definitions */ @@ -755,15 +755,15 @@ namespace Anvil VkAttachmentReference get_attachment_reference_from_subpass_attachment (const SubPassAttachment& in_subpass_attachment) const; VkAttachmentReference get_attachment_reference_for_resolve_attachment (const SubPassesConstIterator& in_subpass_iterator, const LocationToSubPassAttachmentMapConstIterator& in_location_to_subpass_att_map_iterator) const; - void update_preserved_attachments (); + void update_preserved_attachments () const; /* Private variables */ - RenderPassAttachments m_attachments; - std::weak_ptr m_device_ptr; - SubPasses m_subpasses; - SubPassDependencies m_subpass_dependencies; - bool m_update_preserved_attachments; + RenderPassAttachments m_attachments; + const Anvil::BaseDevice* m_device_ptr; + SubPasses m_subpasses; + SubPassDependencies m_subpass_dependencies; + mutable bool m_update_preserved_attachments; friend class Anvil::RenderPass; }; diff --git a/include/misc/shader_module_cache.h b/include/misc/shader_module_cache.h index 86dbe19b..4b07b7a3 100644 --- a/include/misc/shader_module_cache.h +++ b/include/misc/shader_module_cache.h @@ -25,6 +25,8 @@ #include "misc/mt_safety.h" #include "misc/types.h" +#include "wrappers/shader_module.h" + namespace Anvil { @@ -43,26 +45,26 @@ namespace Anvil ~ShaderModuleCache(); /** TODO */ - static std::shared_ptr create(); + static Anvil::ShaderModuleCacheUniquePtr create(); /** TODO */ - std::shared_ptr get_cached_shader_module(std::weak_ptr in_device_ptr, - const char* in_spirv_blob, - uint32_t in_n_spirv_blob_bytes, - const std::string& in_cs_entrypoint_name, - const std::string& in_fs_entrypoint_name, - const std::string& in_gs_entrypoint_name, - const std::string& in_tc_entrypoint_name, - const std::string& in_te_entrypoint_name, - const std::string& in_vs_entrypoint_name); + Anvil::ShaderModuleUniquePtr get_cached_shader_module(const Anvil::BaseDevice* in_device_ptr, + const char* in_spirv_blob, + uint32_t in_n_spirv_blob_bytes, + const std::string& in_cs_entrypoint_name, + const std::string& in_fs_entrypoint_name, + const std::string& in_gs_entrypoint_name, + const std::string& in_tc_entrypoint_name, + const std::string& in_te_entrypoint_name, + const std::string& in_vs_entrypoint_name); private: /* Private type definitions */ typedef struct HashMapItem { - std::weak_ptr device_ptr; - std::vector spirv_blob; - std::shared_ptr shader_module_ptr; + const Anvil::BaseDevice* device_ptr; + std::vector spirv_blob; + Anvil::ShaderModuleUniquePtr shader_module_owned_ptr; std::string cs_entrypoint_name; std::string fs_entrypoint_name; @@ -71,19 +73,20 @@ namespace Anvil std::string te_entrypoint_name; std::string vs_entrypoint_name; - explicit HashMapItem(std::weak_ptr in_device_ptr, - const std::vector& in_spirv_blob, - const std::string& in_cs_entrypoint_name, - const std::string& in_fs_entrypoint_name, - const std::string& in_gs_entrypoint_name, - const std::string& in_tc_entrypoint_name, - const std::string& in_te_entrypoint_name, - const std::string& in_vs_entrypoint_name, - std::shared_ptr in_shader_module_ptr) + explicit HashMapItem(const Anvil::BaseDevice* in_device_ptr, + const std::vector& in_spirv_blob, + const std::string& in_cs_entrypoint_name, + const std::string& in_fs_entrypoint_name, + const std::string& in_gs_entrypoint_name, + const std::string& in_tc_entrypoint_name, + const std::string& in_te_entrypoint_name, + const std::string& in_vs_entrypoint_name, + Anvil::ShaderModule* in_shader_module_ptr) { - device_ptr = in_device_ptr; - spirv_blob = in_spirv_blob; - shader_module_ptr = in_shader_module_ptr; + device_ptr = in_device_ptr; + spirv_blob = in_spirv_blob; + shader_module_owned_ptr = Anvil::ShaderModuleUniquePtr(in_shader_module_ptr, + std::default_delete() ); cs_entrypoint_name = in_cs_entrypoint_name; fs_entrypoint_name = in_fs_entrypoint_name; @@ -93,15 +96,15 @@ namespace Anvil vs_entrypoint_name = in_vs_entrypoint_name; } - bool matches(std::weak_ptr in_device_ptr, - const char* in_spirv_blob, - uint32_t in_n_spirv_blob_bytes, - const std::string& in_cs_entrypoint_name, - const std::string& in_fs_entrypoint_name, - const std::string& in_gs_entrypoint_name, - const std::string& in_tc_entrypoint_name, - const std::string& in_te_entrypoint_name, - const std::string& in_vs_entrypoint_name) const + bool matches(const Anvil::BaseDevice* in_device_ptr, + const char* in_spirv_blob, + uint32_t in_n_spirv_blob_bytes, + const std::string& in_cs_entrypoint_name, + const std::string& in_fs_entrypoint_name, + const std::string& in_gs_entrypoint_name, + const std::string& in_tc_entrypoint_name, + const std::string& in_te_entrypoint_name, + const std::string& in_vs_entrypoint_name) const { bool result = (spirv_blob.size() * sizeof(spirv_blob.at(0)) == in_n_spirv_blob_bytes); @@ -117,7 +120,7 @@ namespace Anvil if (result) { - result = (device_ptr.lock() == in_device_ptr.lock() ); + result = (device_ptr == in_device_ptr); } if (result) @@ -131,14 +134,14 @@ namespace Anvil } } HashMapItem; - typedef std::forward_list HashMapItems; + typedef std::forward_list > HashMapItems; /* Private functions */ ShaderModuleCache(); - void cache (std::shared_ptr in_shader_module_ptr); - void update_subscriptions(bool in_should_init); + void cache (Anvil::ShaderModule* in_shader_module_ptr); + void update_subscriptions(bool in_should_init); size_t get_hash(const char* in_spirv_blob, uint32_t in_n_spirv_blob_bytes, @@ -153,7 +156,7 @@ namespace Anvil void on_shader_module_object_registered (CallbackArgument* in_callback_arg_ptr); /* Private variables */ - std::map m_items; + std::map m_item_ptrs; ANVIL_DISABLE_ASSIGNMENT_OPERATOR(ShaderModuleCache); ANVIL_DISABLE_COPY_CONSTRUCTOR(ShaderModuleCache); diff --git a/include/misc/struct_chainer.h b/include/misc/struct_chainer.h new file mode 100644 index 00000000..cea29af4 --- /dev/null +++ b/include/misc/struct_chainer.h @@ -0,0 +1,212 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#ifndef MISC_STRUCT_CHAINER_H +#define MISC_STRUCT_CHAINER_H + +#include "types.h" + +namespace Anvil +{ + typedef uint32_t StructID; + + template + struct StructChain + { + std::vector raw_data; + StructType* root_struct_ptr; + + StructChain(const uint32_t& in_raw_data_size) + :raw_data(in_raw_data_size) + { + root_struct_ptr = nullptr; + } + + const StructType* get_struct_with_id(const StructID& in_id) const + { + anvil_assert(in_id < raw_data.size() ); + + return reinterpret_cast(&raw_data.at(0) + in_id); + } + + template + StructType2* get_struct_with_id(const StructID& in_id) + { + anvil_assert(in_id < raw_data.size() ); + + return reinterpret_cast(&raw_data.at(0) + in_id); + } + + StructType* get_root_struct() + { + return reinterpret_cast(&raw_data.at(0) ); + } + + const StructType* get_root_struct() const + { + return reinterpret_cast(&raw_data.at(0) ); + } + }; + + template + using StructChainUniquePtr = std::unique_ptr >; + + template + struct StructChainVector + { + void append_struct_chain(StructChainUniquePtr inout_struct_chain_ptr) + { + root_structs.push_back (*inout_struct_chain_ptr->get_root_struct() ); + struct_chain_ptrs.push_back(std::move(inout_struct_chain_ptr) ); + } + + const uint32_t get_n_structs() const + { + return static_cast(root_structs.size() ); + } + const StructType* get_root_structs() const + { + return &root_structs.at(0); + } + + + private: + std::vector root_structs; + std::vector > struct_chain_ptrs; + }; + + template + class StructChainer + { + public: + /* Public functions */ + StructChainer() + :m_structs_size(0) + { + /* Stub */ + } + + ~StructChainer() + { + /* Stub */ + } + + template + StructID append_struct(const ChainedStructType& in_struct) + { + const uint32_t pre_call_structs_size(m_structs_size); + std::vector struct_raw_data (sizeof(in_struct) ); + + anvil_assert(in_struct.pNext == nullptr); + + /* Zeroth item appended to the chain must be of StructType type! */ + if (m_structs_size == 0 && + sizeof(in_struct) != sizeof(StructType) ) + { + anvil_assert_fail(); + } + + memcpy(&struct_raw_data.at(0), + &in_struct, + sizeof(in_struct) ); + + m_structs.push_back( + std::move(struct_raw_data) + ); + + m_structs_size += sizeof(in_struct); + + return pre_call_structs_size; + } + + std::unique_ptr > create_chain() const + { + size_t n_bytes_used = 0; + const uint32_t n_structs = static_cast(m_structs.size() ); + std::unique_ptr > result_ptr; + + /* Sanity checks */ + if (m_structs.size() == 0) + { + anvil_assert(m_structs.size() > 0); + + goto end; + } + + /* Allocate the result instance */ + result_ptr.reset( + new StructChain(m_structs_size) + ); + + if (result_ptr == nullptr) + { + anvil_assert(result_ptr != nullptr); + + goto end; + } + + /* Form the struct chain.. */ + for (uint32_t n_struct = 0; + n_struct < n_structs; + ++n_struct) + { + /* Copy struct contents to the final vector */ + const auto& current_struct_data = m_structs.at(n_struct); + const auto current_struct_data_size = current_struct_data.size(); + + memcpy(&result_ptr->raw_data.at(n_bytes_used), + ¤t_struct_data.at(0), + current_struct_data_size); + + /* Adjust pNext pointer to point at the next struct, if defined. */ + if (n_struct != (n_structs - 1) ) + { + VkStructHeader* header_ptr = reinterpret_cast(&result_ptr->raw_data.at(n_bytes_used) ); + + header_ptr->next_ptr = &result_ptr->raw_data.at(0) + n_bytes_used + current_struct_data_size; + } + + n_bytes_used += current_struct_data_size; + } + + result_ptr->root_struct_ptr = reinterpret_cast(&result_ptr->raw_data.at(0) ); + + /* Done. */ + end: + return result_ptr; + } + + const StructType* get_root_struct() const + { + anvil_assert(m_structs.size() > 0); + + return reinterpret_cast(&m_structs.at(0).at(0) ); + } + + private: + /* Private functions */ + std::vector > m_structs; + uint32_t m_structs_size; + }; +}; + +#endif /* MISC_STRUCT_CHAINER_H */ \ No newline at end of file diff --git a/include/misc/types.h b/include/misc/types.h index d7ac967c..a8841346 100644 --- a/include/misc/types.h +++ b/include/misc/types.h @@ -59,10 +59,9 @@ #endif #endif - #ifdef _WIN32 /* NOTE: Version clamp required for IsDebuggerPresent() */ - #define ANVIL_MIN_WIN32_WINNT_REQUIRED 0x0400 + #define ANVIL_MIN_WIN32_WINNT_REQUIRED 0x0501 #if !defined(_WIN32_WINNT) #define _WIN32_WINNT ANVIL_MIN_WIN32_WINNT_REQUIRED @@ -228,8 +227,6 @@ struct \ { \ uint8_t VK_DEPENDENCY_BY_REGION_BIT : 1; \ - uint8_t VK_DEPENDENCY_VIEW_LOCAL_BIT_KHX : 1; \ - uint8_t VK_DEPENDENCY_DEVICE_GROUP_BIT_KHX : 1; \ uint32_t OTHER: 29; \ } name##_flags; \ }; @@ -538,6 +535,8 @@ namespace Anvil class DescriptorSetGroup; class DescriptorSetInfo; class DescriptorSetLayout; + class DescriptorSetLayoutManager; + class DescriptorUpdateTemplate; class Event; class Fence; class Framebuffer; @@ -571,6 +570,48 @@ namespace Anvil class Swapchain; class Window; + typedef std::unique_ptr > BaseDeviceUniquePtr; + typedef std::unique_ptr BasePipelineInfoUniquePtr; + typedef std::unique_ptr > BufferUniquePtr; + typedef std::unique_ptr > BufferViewUniquePtr; + typedef std::unique_ptr > CommandBufferBaseUniquePtr; + typedef std::unique_ptr > CommandPoolUniquePtr; + typedef std::unique_ptr ComputePipelineInfoUniquePtr; + typedef std::unique_ptr > DescriptorPoolUniquePtr; + typedef std::unique_ptr > DescriptorSetGroupUniquePtr; + typedef std::unique_ptr DescriptorSetInfoUniquePtr; + typedef std::unique_ptr > DescriptorSetLayoutUniquePtr; + typedef std::unique_ptr > DescriptorSetLayoutManagerUniquePtr; + typedef std::unique_ptr > DescriptorSetUniquePtr; + typedef std::unique_ptr > DescriptorUpdateTemplateUniquePtr; + typedef std::unique_ptr > EventUniquePtr; + typedef std::unique_ptr > FenceUniquePtr; + typedef std::unique_ptr > FramebufferUniquePtr; + typedef std::unique_ptr > GLSLShaderToSPIRVGeneratorUniquePtr; + typedef std::unique_ptr GraphicsPipelineInfoUniquePtr; + typedef std::unique_ptr GraphicsPipelineManagerUniquePtr; + typedef std::unique_ptr > ImageUniquePtr; + typedef std::unique_ptr > ImageViewUniquePtr; + typedef std::unique_ptr > InstanceUniquePtr; + typedef std::unique_ptr > MemoryAllocatorUniquePtr; + typedef std::unique_ptr > MemoryBlockUniquePtr; + typedef std::unique_ptr > PipelineCacheUniquePtr; + typedef std::unique_ptr > PipelineLayoutManagerUniquePtr; + typedef std::unique_ptr > PipelineLayoutUniquePtr; + typedef std::unique_ptr > PrimaryCommandBufferUniquePtr; + typedef std::unique_ptr > QueryPoolUniquePtr; + typedef std::unique_ptr > RenderingSurfaceUniquePtr; + typedef std::unique_ptr > RenderPassUniquePtr; + typedef std::unique_ptr RenderPassInfoUniquePtr; + typedef std::unique_ptr > SamplerUniquePtr; + typedef std::unique_ptr > SecondaryCommandBufferUniquePtr; + typedef std::unique_ptr > SemaphoreUniquePtr; + typedef std::unique_ptr > SGPUDeviceUniquePtr; + typedef std::unique_ptr > ShaderModuleCacheUniquePtr; + typedef std::unique_ptr > ShaderModuleUniquePtr; + typedef std::unique_ptr > SwapchainUniquePtr; + typedef std::unique_ptr > WindowUniquePtr; + /* Describes recognized subpass attachment types */ enum AttachmentType { @@ -607,13 +648,13 @@ namespace Anvil VkAccessFlagsVariable(dst_access_mask); VkAccessFlagsVariable(src_access_mask); - VkBuffer buffer; - VkBufferMemoryBarrier buffer_barrier_vk; - std::shared_ptr buffer_ptr; - uint32_t dst_queue_family_index; - VkDeviceSize offset; - VkDeviceSize size; - uint32_t src_queue_family_index; + VkBuffer buffer; + VkBufferMemoryBarrier buffer_barrier_vk; + Anvil::Buffer* buffer_ptr; + uint32_t dst_queue_family_index; + VkDeviceSize offset; + VkDeviceSize size; + uint32_t src_queue_family_index; /** Constructor. * @@ -628,13 +669,13 @@ namespace Anvil * @param in_offset Start offset of the region described by the barrier. * @param in_size Size of the region described by the barrier. **/ - explicit BufferBarrier(VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - uint32_t in_src_queue_family_index, - uint32_t in_dst_queue_family_index, - std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - VkDeviceSize in_size); + explicit BufferBarrier(VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + uint32_t in_src_queue_family_index, + uint32_t in_dst_queue_family_index, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkDeviceSize in_size); /** Destructor. * @@ -694,6 +735,153 @@ namespace Anvil COMPONENT_LAYOUT_UNKNOWN } ComponentLayout; + typedef enum + { + /* When set, descriptor set allocations will return back to the pool at release time.*/ + DESCRIPTOR_POOL_FLAG_CREATE_FREE_DESCRIPTOR_SET_BIT = 1 << 0, + } DescriptorPoolFlagBits; + + typedef uint32_t DescriptorPoolFlags; + + typedef struct DescriptorSetAllocation + { + /* Descriptor set layout to use for the allocation request */ + const Anvil::DescriptorSetLayout* ds_layout_ptr; + + /* Dummy constructor. Do not use as input for DS allocation functions. */ + DescriptorSetAllocation() + { + ds_layout_ptr = nullptr; + } + + /* Constructor. */ + DescriptorSetAllocation(const Anvil::DescriptorSetLayout* in_ds_layout_ptr); + } DescriptorSetAllocation; + + typedef enum + { + /* Updates dirty DS bindings using vkUpdateDescriptorSet() which is available on all Vulkan implementations. */ + DESCRIPTOR_SET_UPDATE_METHOD_CORE, + + /* Updates dirty DS bindings using vkUpdateDescriptorSetWithTemplateKHR(). Templates are cached across update operations, + * and are release at DescriptorSet release time. + * + * This setting is recommended if you are going to be updating the same set of descriptor set bindings more than once. + * + * Only available on devices supporting VK_KHR_descriptor_update_template extension. + */ + DESCRIPTOR_SET_UPDATE_METHOD_TEMPLATE, + } DescriptorSetUpdateMethod; + + typedef struct DescriptorUpdateTemplateEntry + { + VkDescriptorType descriptor_type; + uint32_t n_descriptors; + uint32_t n_destination_array_element; + uint32_t n_destination_binding; + size_t offset; + size_t stride; + + DescriptorUpdateTemplateEntry() + :descriptor_type (VK_DESCRIPTOR_TYPE_MAX_ENUM), + n_descriptors (UINT32_MAX), + n_destination_array_element(UINT32_MAX), + n_destination_binding (UINT32_MAX), + offset (SIZE_MAX), + stride (SIZE_MAX) + { + /* Stub */ + } + + DescriptorUpdateTemplateEntry(const VkDescriptorType& in_descriptor_type, + const uint32_t& in_n_destination_array_element, + const uint32_t& in_n_destination_binding, + const uint32_t& in_n_descriptors, + const size_t& in_offset, + const size_t& in_stride) + :descriptor_type (in_descriptor_type), + n_descriptors (in_n_descriptors), + n_destination_array_element(in_n_destination_array_element), + n_destination_binding (in_n_destination_binding), + offset (in_offset), + stride (in_stride) + { + /* Stub */ + } + + VkDescriptorUpdateTemplateEntryKHR get_vk_descriptor_update_template_entry_khr() const; + + bool operator==(const DescriptorUpdateTemplateEntry& in_entry) const + { + return (in_entry.descriptor_type == descriptor_type) && + (in_entry.n_descriptors == n_descriptors) && + (in_entry.n_destination_array_element == n_destination_array_element) && + (in_entry.n_destination_binding == n_destination_binding) && + (in_entry.offset == offset) && + (in_entry.stride == stride); + } + + bool operator<(const DescriptorUpdateTemplateEntry& in_entry) const + { + if (in_entry.descriptor_type < descriptor_type) + { + return true; + } + else + if (in_entry.descriptor_type > descriptor_type) + { + return false; + } + + if (in_entry.n_descriptors < n_descriptors) + { + return true; + } + else + if (in_entry.n_descriptors > n_descriptors) + { + return false; + } + + if (in_entry.n_destination_array_element < n_destination_array_element) + { + return true; + } + else + if (in_entry.n_destination_array_element > n_destination_array_element) + { + return false; + } + + if (in_entry.n_destination_binding < n_destination_binding) + { + return true; + } + else + if (in_entry.n_destination_binding > n_destination_binding) + { + return false; + } + + if (in_entry.offset < offset) + { + return true; + } + else + if (in_entry.offset > offset) + { + return false; + } + + if (in_entry.stride < stride) + { + return true; + } + + return false; + } + } DescriptorUpdateTemplateEntry; + typedef enum { EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE, @@ -716,6 +904,8 @@ namespace Anvil ExtensionAvailability amd_rasterization_order; ExtensionAvailability amd_shader_ballot; ExtensionAvailability amd_shader_explicit_vertex_parameter; + ExtensionAvailability amd_shader_fragment_mask; + ExtensionAvailability amd_shader_image_load_store_lod; ExtensionAvailability amd_shader_info; ExtensionAvailability amd_shader_trinary_minmax; ExtensionAvailability amd_texture_gather_bias_lod; @@ -725,7 +915,10 @@ namespace Anvil ExtensionAvailability ext_shader_subgroup_ballot; ExtensionAvailability ext_shader_subgroup_vote; ExtensionAvailability khr_16bit_storage; + ExtensionAvailability khr_bind_memory2; + ExtensionAvailability khr_descriptor_update_template; ExtensionAvailability khr_maintenance1; + ExtensionAvailability khr_maintenance3; ExtensionAvailability khr_storage_buffer_storage_class; ExtensionAvailability khr_surface; ExtensionAvailability khr_swapchain; @@ -735,9 +928,9 @@ namespace Anvil DeviceExtensionConfiguration(); - bool is_supported_by_physical_device(std::weak_ptr in_physical_device_ptr, - std::vector* out_opt_unsupported_extensions_ptr = nullptr) const; - bool operator== (const DeviceExtensionConfiguration& in) const; + bool is_supported_by_physical_device(const Anvil::PhysicalDevice* in_physical_device_ptr, + std::vector* out_opt_unsupported_extensions_ptr = nullptr) const; + bool operator== (const DeviceExtensionConfiguration& in) const; } DeviceExtensionConfiguration; /** Tells the type of an Anvil::BaseDevice instance */ @@ -745,6 +938,7 @@ namespace Anvil { /* BaseDevice is implemented by SGPUDevice class */ DEVICE_TYPE_SINGLE_GPU, + } DeviceType; /** Holds properties of a single Vulkan Extension */ @@ -824,6 +1018,32 @@ namespace Anvil } } ExtensionEXTDebugReportEntrypoints; + typedef struct ExtensionKHRBindMemory2Entrypoints + { + PFN_vkBindBufferMemory2KHR vkBindBufferMemory2KHR; + PFN_vkBindImageMemory2KHR vkBindImageMemory2KHR; + + ExtensionKHRBindMemory2Entrypoints() + { + vkBindBufferMemory2KHR = nullptr; + vkBindImageMemory2KHR = nullptr; + } + } ExtensionKHRBindMemory2Entrypoints; + + typedef struct ExtensionKHRDescriptorUpdateTemplateEntrypoints + { + PFN_vkCreateDescriptorUpdateTemplateKHR vkCreateDescriptorUpdateTemplateKHR; + PFN_vkDestroyDescriptorUpdateTemplateKHR vkDestroyDescriptorUpdateTemplateKHR; + PFN_vkUpdateDescriptorSetWithTemplateKHR vkUpdateDescriptorSetWithTemplateKHR; + + ExtensionKHRDescriptorUpdateTemplateEntrypoints() + { + vkCreateDescriptorUpdateTemplateKHR = nullptr; + vkDestroyDescriptorUpdateTemplateKHR = nullptr; + vkUpdateDescriptorSetWithTemplateKHR = nullptr; + } + } ExtensionKHRDescriptorUpdateTemplateEntrypoints; + typedef struct ExtensionKHRGetPhysicalDeviceProperties2 { PFN_vkGetPhysicalDeviceFeatures2KHR vkGetPhysicalDeviceFeatures2KHR; @@ -856,6 +1076,16 @@ namespace Anvil } } ExtensionKHRMaintenance1Entrypoints; + typedef struct ExtensionKHRMaintenance3Entrypoints + { + PFN_vkGetDescriptorSetLayoutSupportKHR vkGetDescriptorSetLayoutSupportKHR; + + ExtensionKHRMaintenance3Entrypoints() + { + vkGetDescriptorSetLayoutSupportKHR = nullptr; + } + } ExtensionKHRMaintenance3Entrypoints; + typedef struct ExtensionKHRSurfaceEntrypoints { PFN_vkDestroySurfaceKHR vkDestroySurfaceKHR; @@ -980,15 +1210,15 @@ namespace Anvil VkAccessFlagsVariable(dst_access_mask); VkAccessFlagsVariable(src_access_mask); - bool by_region; - uint32_t dst_queue_family_index; - VkImage image; - VkImageMemoryBarrier image_barrier_vk; - std::shared_ptr image_ptr; - VkImageLayout new_layout; - VkImageLayout old_layout; - uint32_t src_queue_family_index; - VkImageSubresourceRange subresource_range; + bool by_region; + uint32_t dst_queue_family_index; + VkImage image; + VkImageMemoryBarrier image_barrier_vk; + Anvil::Image* image_ptr; + VkImageLayout new_layout; + VkImageLayout old_layout; + uint32_t src_queue_family_index; + VkImageSubresourceRange subresource_range; /** Constructor. * @@ -1007,15 +1237,15 @@ namespace Anvil * @param in_image_subresource_range Subresource range to use for the barrier. * **/ - ImageBarrier(VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region_barrier, - VkImageLayout in_old_layout, - VkImageLayout in_new_layout, - uint32_t in_src_queue_family_index, - uint32_t in_dst_queue_family_index, - std::shared_ptr in_image_ptr, - VkImageSubresourceRange in_image_subresource_range); + ImageBarrier(VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region_barrier, + VkImageLayout in_old_layout, + VkImageLayout in_new_layout, + uint32_t in_src_queue_family_index, + uint32_t in_dst_queue_family_index, + Anvil::Image* in_image_ptr, + VkImageSubresourceRange in_image_subresource_range); /** Destructor. * @@ -1064,6 +1294,50 @@ namespace Anvil }; typedef uint32_t ImageCreateFlags; + class IMemoryAllocatorBackendBase + { + public: + virtual ~IMemoryAllocatorBackendBase() + { + /* Stub */ + } + + virtual bool supports_baking() const = 0; + }; + + /* Holds 16-bit storage features */ + typedef struct KHR16BitStorageFeatures + { + bool is_input_output_storage_supported; + bool is_push_constant_16_bit_storage_supported; + bool is_storage_buffer_16_bit_access_supported; + bool is_uniform_and_storage_buffer_16_bit_access_supported; + + KHR16BitStorageFeatures() + { + is_input_output_storage_supported = false; + is_push_constant_16_bit_storage_supported = false; + is_storage_buffer_16_bit_access_supported = false; + is_uniform_and_storage_buffer_16_bit_access_supported = false; + } + + KHR16BitStorageFeatures(const VkPhysicalDevice16BitStorageFeaturesKHR& in_features); + + bool operator==(const KHR16BitStorageFeatures& in_features) const; + } KHR16BitStorageFeatures; + + typedef struct KHRMaintenance3Properties + { + VkDeviceSize max_memory_allocation_size; + uint32_t max_per_set_descriptors; + + KHRMaintenance3Properties(); + KHRMaintenance3Properties(const VkPhysicalDeviceMaintenance3PropertiesKHR& in_props); + + bool operator==(const KHRMaintenance3Properties&) const; + + } KHRMaintenance3Properties; + /** Holds properties of a single Vulkan Layer. */ typedef struct Layer { @@ -1260,22 +1534,22 @@ namespace Anvil { /* Image aspect the mip-map data is specified for. */ VkImageAspectFlagBits aspect; - + /* Start layer index */ uint32_t n_layer; - + /* Number of layers to update */ uint32_t n_layers; - + /* Number of 3D texture slices to update. For non-3D texture types, this field * should be set to 1. */ uint32_t n_slices; - - + + /* Index of the mip-map to update. */ uint32_t n_mipmap; - - + + /* Pointer to a buffer holding raw data representation. The data structure is characterized by * data_size, row_size and slice_size fields. * @@ -1285,15 +1559,15 @@ namespace Anvil std::shared_ptr linear_tightly_packed_data_uchar_ptr; const unsigned char* linear_tightly_packed_data_uchar_raw_ptr; std::shared_ptr > linear_tightly_packed_data_uchar_vec_ptr; - - + + /* Total number of bytes available for reading under linear_tightly_packed_data_ptr */ uint32_t data_size; - + /* Number of bytes each row takes */ uint32_t row_size; - - + + /** Creates a MipmapRawData instance which can be used to upload data to 1D Image instances: * * @param in_aspect Image aspect to modify. @@ -1319,7 +1593,7 @@ namespace Anvil uint32_t in_n_mipmap, std::shared_ptr > in_linear_tightly_packed_data_ptr, uint32_t in_row_size); - + /** Creates a MipmapRawData instance which can be used to upload data to 1D Array Image instances: * * @param in_aspect Image aspect to modify. @@ -1354,7 +1628,7 @@ namespace Anvil std::shared_ptr > in_linear_tightly_packed_data_ptr, uint32_t in_row_size, uint32_t in_data_size); - + /** Creates a MipmapRawData instance which can be used to upload data to 2D Image instances: * * @param in_aspect Image aspect to modify. @@ -1381,7 +1655,7 @@ namespace Anvil std::shared_ptr > in_linear_tightly_packed_data_ptr, uint32_t in_data_size, uint32_t in_row_size); - + /** Creates a MipmapRawData instance which can be used to upload data to 2D Array Image instances: * * @param in_aspect Image aspect to modify. @@ -1416,7 +1690,7 @@ namespace Anvil std::shared_ptr > in_linear_tightly_packed_data_ptr, uint32_t in_data_size, uint32_t in_row_size); - + /** Creates a MipmapRawData instnce which can be used to upload data to 3D Image instances: * * @param in_aspect Image aspect to modify. @@ -1451,7 +1725,7 @@ namespace Anvil std::shared_ptr > in_linear_tightly_packed_data_ptr, uint32_t in_slice_data_size, uint32_t in_row_size); - + /** Creates a MipmapRawData instance which can be used to upload data to Cube Map Image instances: * * @param in_aspect Image aspect to modify. @@ -1483,7 +1757,7 @@ namespace Anvil std::shared_ptr > in_linear_tightly_packed_data_ptr, uint32_t in_data_size, uint32_t in_row_size); - + /** Creates a MipmapRawData instance which can be used to upload data to Cube Map Array Image instances: * * @param in_aspect Image aspect to modify. @@ -1520,7 +1794,7 @@ namespace Anvil std::shared_ptr > in_linear_tightly_packed_data_ptr, uint32_t in_data_size, uint32_t in_row_size); - + private: static MipmapRawData create_1D (VkImageAspectFlagBits in_aspect, uint32_t in_n_mipmap, @@ -1582,6 +1856,8 @@ namespace Anvil OBJECT_TYPE_DESCRIPTOR_SET, OBJECT_TYPE_DESCRIPTOR_SET_GROUP, OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT, + OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_MANAGER, + OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE, OBJECT_TYPE_DEVICE, OBJECT_TYPE_EVENT, OBJECT_TYPE_FENCE, @@ -1628,6 +1904,277 @@ namespace Anvil OCCLUSION_QUERY_SUPPORT_SCOPE_REQUIRED_PRECISE, } OcclusionQuerySupportScope; + typedef struct PhysicalDeviceFeaturesCoreVK10 + { + bool alpha_to_one; + bool depth_bias_clamp; + bool depth_bounds; + bool depth_clamp; + bool draw_indirect_first_instance; + bool dual_src_blend; + bool fill_mode_non_solid; + bool fragment_stores_and_atomics; + bool full_draw_index_uint32; + bool geometry_shader; + bool image_cube_array; + bool independent_blend; + bool inherited_queries; + bool large_points; + bool logic_ip; + bool multi_draw_indirect; + bool multi_viewport; + bool occlusion_query_precise; + bool pipeline_statistics_query; + bool robust_buffer_access; + bool sampler_anisotropy; + bool sample_rate_shading; + bool shader_clip_distance; + bool shader_cull_distance; + bool shader_float64; + bool shader_image_gather_extended; + bool shader_int16; + bool shader_int64; + bool shader_resource_residency; + bool shader_resource_min_lod; + bool shader_sampled_image_array_dynamic_indexing; + bool shader_storage_buffer_array_dynamic_indexing; + bool shader_storage_image_array_dynamic_indexing; + bool shader_storage_image_extended_formats; + bool shader_storage_image_multisample; + bool shader_storage_image_read_without_format; + bool shader_storage_image_write_without_format; + bool shader_tessellation_and_geometry_point_size; + bool shader_uniform_buffer_array_dynamic_indexing; + bool sparse_binding; + bool sparse_residency_2_samples; + bool sparse_residency_4_samples; + bool sparse_residency_8_samples; + bool sparse_residency_16_samples; + bool sparse_residency_aliased; + bool sparse_residency_buffer; + bool sparse_residency_image_2D; + bool sparse_residency_image_3D; + bool tessellation_shader; + bool texture_compression_ASTC_LDR; + bool texture_compression_BC; + bool texture_compression_ETC2; + bool variable_multisample_rate; + bool vertex_pipeline_stores_and_atomics; + bool wide_lines; + + VkPhysicalDeviceFeatures get_vk_physical_device_features() const; + bool operator== (const PhysicalDeviceFeaturesCoreVK10& in_data) const; + + PhysicalDeviceFeaturesCoreVK10(); + PhysicalDeviceFeaturesCoreVK10(const VkPhysicalDeviceFeatures& in_physical_device_features); + + } PhysicalDeviceFeaturesCoreVK10; + + typedef struct PhysicalDeviceFeatures + { + const PhysicalDeviceFeaturesCoreVK10* core_vk1_0_features_ptr; + const KHR16BitStorageFeatures* khr_16bit_storage_features_ptr; + + PhysicalDeviceFeatures() + { + core_vk1_0_features_ptr = nullptr; + khr_16bit_storage_features_ptr = nullptr; + } + + PhysicalDeviceFeatures(const PhysicalDeviceFeaturesCoreVK10* in_core_vk1_0_features_ptr, + const KHR16BitStorageFeatures* in_khr_16_bit_storage_features_ptr) + { + core_vk1_0_features_ptr = in_core_vk1_0_features_ptr; + khr_16bit_storage_features_ptr = in_khr_16_bit_storage_features_ptr; + } + + bool operator==(const PhysicalDeviceFeatures& in_physical_device_features) const; + } PhysicalDeviceFeatures; + + typedef struct PhysicalDeviceLimits + { + VkDeviceSize buffer_image_granularity; + uint32_t discrete_queue_priorities; + VkSampleCountFlags framebuffer_color_sample_counts; + VkSampleCountFlags framebuffer_depth_sample_counts; + VkSampleCountFlags framebuffer_no_attachments_sample_counts; + VkSampleCountFlags framebuffer_stencil_sample_counts; + float line_width_granularity; + float line_width_range[2]; + uint32_t max_bound_descriptor_sets; + uint32_t max_clip_distances; + uint32_t max_color_attachments; + uint32_t max_combined_clip_and_cull_distances; + uint32_t max_compute_shared_memory_size; + uint32_t max_compute_work_group_count[3]; + uint32_t max_compute_work_group_invocations; + uint32_t max_compute_work_group_size[3]; + uint32_t max_cull_distances; + uint32_t max_descriptor_set_input_attachments; + uint32_t max_descriptor_set_sampled_images; + uint32_t max_descriptor_set_samplers; + uint32_t max_descriptor_set_storage_buffers; + uint32_t max_descriptor_set_storage_buffers_dynamic; + uint32_t max_descriptor_set_storage_images; + uint32_t max_descriptor_set_uniform_buffers; + uint32_t max_descriptor_set_uniform_buffers_dynamic; + uint32_t max_draw_indexed_index_value; + uint32_t max_draw_indirect_count; + uint32_t max_fragment_combined_output_resources; + uint32_t max_fragment_dual_src_attachments; + uint32_t max_fragment_input_components; + uint32_t max_fragment_output_attachments; + uint32_t max_framebuffer_height; + uint32_t max_framebuffer_layers; + uint32_t max_framebuffer_width; + uint32_t max_geometry_input_components; + uint32_t max_geometry_output_components; + uint32_t max_geometry_output_vertices; + uint32_t max_geometry_shader_invocations; + uint32_t max_geometry_total_output_components; + uint32_t max_image_array_layers; + uint32_t max_image_dimension_1D; + uint32_t max_image_dimension_2D; + uint32_t max_image_dimension_3D; + uint32_t max_image_dimension_cube; + float max_interpolation_offset; + uint32_t max_memory_allocation_count; + uint32_t max_per_stage_descriptor_input_attachments; + uint32_t max_per_stage_descriptor_sampled_images; + uint32_t max_per_stage_descriptor_samplers; + uint32_t max_per_stage_descriptor_storage_buffers; + uint32_t max_per_stage_descriptor_storage_images; + uint32_t max_per_stage_descriptor_uniform_buffers; + uint32_t max_per_stage_resources; + uint32_t max_push_constants_size; + uint32_t max_sample_mask_words; + uint32_t max_sampler_allocation_count; + float max_sampler_anisotropy; + float max_sampler_lod_bias; + uint32_t max_storage_buffer_range; + uint32_t max_viewport_dimensions[2]; + uint32_t max_viewports; + uint32_t max_tessellation_control_per_patch_output_components; + uint32_t max_tessellation_control_per_vertex_input_components; + uint32_t max_tessellation_control_per_vertex_output_components; + uint32_t max_tessellation_control_total_output_components; + uint32_t max_tessellation_evaluation_input_components; + uint32_t max_tessellation_evaluation_output_components; + uint32_t max_tessellation_generation_level; + uint32_t max_tessellation_patch_size; + uint32_t max_texel_buffer_elements; + uint32_t max_texel_gather_offset; + uint32_t max_texel_offset; + uint32_t max_uniform_buffer_range; + uint32_t max_vertex_input_attributes; + uint32_t max_vertex_input_attribute_offset; + uint32_t max_vertex_input_bindings; + uint32_t max_vertex_input_binding_stride; + uint32_t max_vertex_output_components; + float min_interpolation_offset; + size_t min_memory_map_alignment; + VkDeviceSize min_storage_buffer_offset_alignment; + VkDeviceSize min_texel_buffer_offset_alignment; + int32_t min_texel_gather_offset; + int32_t min_texel_offset; + VkDeviceSize min_uniform_buffer_offset_alignment; + uint32_t mipmap_precision_bits; + VkDeviceSize non_coherent_atom_size; + VkDeviceSize optimal_buffer_copy_offset_alignment; + VkDeviceSize optimal_buffer_copy_row_pitch_alignment; + float point_size_granularity; + float point_size_range[2]; + VkSampleCountFlags sampled_image_color_sample_counts; + VkSampleCountFlags sampled_image_depth_sample_counts; + VkSampleCountFlags sampled_image_integer_sample_counts; + VkSampleCountFlags sampled_image_stencil_sample_counts; + VkDeviceSize sparse_address_space_size; + bool standard_sample_locations; + VkSampleCountFlags storage_image_sample_counts; + bool strict_lines; + uint32_t sub_pixel_interpolation_offset_bits; + uint32_t sub_pixel_precision_bits; + uint32_t sub_texel_precision_bits; + bool timestamp_compute_and_graphics; + float timestamp_period; + float viewport_bounds_range[2]; + uint32_t viewport_sub_pixel_bits; + + PhysicalDeviceLimits(); + PhysicalDeviceLimits(const VkPhysicalDeviceLimits& in_device_limits); + + bool operator==(const PhysicalDeviceLimits& in_device_limits) const; + } PhysicalDeviceLimits; + + typedef struct PhysicalDeviceSparseProperties + { + bool residency_standard_2D_block_shape; + bool residency_standard_2D_multisample_block_shape; + bool residency_standard_3D_block_shape; + bool residency_aligned_mip_size; + bool residency_non_resident_strict; + + PhysicalDeviceSparseProperties(); + PhysicalDeviceSparseProperties(const VkPhysicalDeviceSparseProperties& in_sparse_props); + + bool operator==(const PhysicalDeviceSparseProperties& in_props) const; + } PhysicalDeviceSparseProperties; + + typedef struct PhysicalDevicePropertiesCoreVK10 + { + uint32_t api_version; + uint32_t device_id; + char device_name [VK_MAX_PHYSICAL_DEVICE_NAME_SIZE]; + VkPhysicalDeviceType device_type; + uint32_t driver_version; + uint8_t pipeline_cache_uuid[VK_UUID_SIZE]; + uint32_t vendor_id; + + PhysicalDeviceLimits limits; + PhysicalDeviceSparseProperties sparse_properties; + + bool operator==(const PhysicalDevicePropertiesCoreVK10& in_props) const; + + PhysicalDevicePropertiesCoreVK10() + :api_version (UINT32_MAX), + device_id (UINT32_MAX), + device_type (VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM), + driver_version(UINT32_MAX), + vendor_id (UINT32_MAX) + { + memset(device_name, + 0xFF, + sizeof(device_name) ); + memset(pipeline_cache_uuid, + 0xFF, + sizeof(pipeline_cache_uuid) ); + } + + PhysicalDevicePropertiesCoreVK10(const VkPhysicalDeviceProperties& in_physical_device_properties); + } PhysicalDevicePropertiesCoreVK10; + + typedef struct PhysicalDeviceProperties + { + const PhysicalDevicePropertiesCoreVK10* core_vk1_0_properties_ptr; + const KHRMaintenance3Properties* khr_maintenance3_properties_ptr; + + PhysicalDeviceProperties() + { + core_vk1_0_properties_ptr = nullptr; + khr_maintenance3_properties_ptr = nullptr; + } + + PhysicalDeviceProperties(const PhysicalDevicePropertiesCoreVK10* in_core_vk1_0_properties_ptr, + const KHRMaintenance3Properties* in_khr_maintenance3_properties_ptr) + :core_vk1_0_properties_ptr (in_core_vk1_0_properties_ptr), + khr_maintenance3_properties_ptr(in_khr_maintenance3_properties_ptr) + { + /* Stub */ + } + + bool operator==(const PhysicalDeviceProperties& in_props) const; + } PhysicalDeviceProperties; + /* A single push constant range descriptor */ typedef struct PushConstantRange { @@ -1672,9 +2219,9 @@ namespace Anvil { VkQueueFlagsVariable(flags); - VkExtent3D min_image_transfer_granularity; - uint32_t n_queues; - uint32_t n_timestamp_bits; + VkExtent3D min_image_transfer_granularity; + uint32_t n_queues; + uint32_t n_timestamp_bits; /** Constructor. Initializes the instance using data provided by the driver. * @@ -1695,17 +2242,24 @@ namespace Anvil typedef std::vector QueueFamilyInfoItems; /** Enumerates all available queue family types */ - typedef enum + enum class QueueFamilyType { - QUEUE_FAMILY_TYPE_COMPUTE, - QUEUE_FAMILY_TYPE_TRANSFER, - QUEUE_FAMILY_TYPE_UNIVERSAL, /* compute + graphics */ + /* Holds queues that support COMPUTE operations but do NOT support GRAPHICS operations. */ + COMPUTE, + + /* Holds queues that support TRANSFER operations and which have not been classified + * as COMPUTE or UNIVERSAL queue family members. */ + TRANSFER, + + /* Holds queues that support GRAPHICS operations and which have not been classified + * as COMPUTE queue family members. */ + UNIVERSAL, /* Always last */ - QUEUE_FAMILY_TYPE_COUNT, - QUEUE_FAMILY_TYPE_FIRST = QUEUE_FAMILY_TYPE_COMPUTE, - QUEUE_FAMILY_TYPE_UNDEFINED = QUEUE_FAMILY_TYPE_COUNT - } QueueFamilyType; + COUNT, + FIRST = COMPUTE, + UNDEFINED = COUNT + }; /** Base pipeline ID. Internal type, used to represent compute / graphics pipeline IDs */ typedef uint32_t PipelineID; @@ -1716,6 +2270,9 @@ namespace Anvil QUEUE_FAMILY_COMPUTE_BIT = 1 << 0, QUEUE_FAMILY_DMA_BIT = 1 << 1, QUEUE_FAMILY_GRAPHICS_BIT = 1 << 2, + + QUEUE_FAMILY_FIRST_BIT = QUEUE_FAMILY_COMPUTE_BIT, + QUEUE_FAMILY_LAST_BIT = QUEUE_FAMILY_GRAPHICS_BIT } QueueFamily; typedef int QueueFamilyBits; @@ -1767,11 +2324,6 @@ namespace Anvil /* Unique ID of a render-pass attachment within scope of a RenderPass instance. */ typedef uint32_t RenderPassAttachmentID; - typedef enum - { - RENDERING_SURFACE_TYPE_GENERAL, - } RenderingSurfaceType; - /* A pair of 32-bit FP values which describes a sample location */ typedef std::pair SampleLocation; @@ -1805,9 +2357,10 @@ namespace Anvil /** Holds all information related to a specific shader module stage entry-point. */ typedef struct ShaderModuleStageEntryPoint { - std::string name; - std::shared_ptr shader_module_ptr; - Anvil::ShaderStage stage; + std::string name; + ShaderModuleUniquePtr shader_module_owned_ptr; + Anvil::ShaderModule* shader_module_ptr; + Anvil::ShaderStage stage; /** Dummy constructor */ ShaderModuleStageEntryPoint(); @@ -1821,9 +2374,12 @@ namespace Anvil * @param in_shader_module_ptr ShaderModule instance to use. * @param in_stage Shader stage the entry-point implements. */ - ShaderModuleStageEntryPoint(const std::string& in_name, - std::shared_ptr in_shader_module_ptr, - ShaderStage in_stage); + ShaderModuleStageEntryPoint(const std::string& in_name, + ShaderModule* in_shader_module_ptr, + ShaderStage in_stage); + ShaderModuleStageEntryPoint(const std::string& in_name, + ShaderModuleUniquePtr in_shader_module_ptr, + ShaderStage in_stage); /** Destructor. */ ~ShaderModuleStageEntryPoint(); @@ -1911,34 +2467,6 @@ namespace Anvil typedef std::vector SpecializationConstants; - /* Holds 16-bit storage features */ - typedef struct StorageFeatures16Bit - { - bool is_input_output_storage_supported; - bool is_push_constant_16_bit_storage_supported; - bool is_storage_buffer_16_bit_access_supported; - bool is_uniform_and_storage_buffer_16_bit_access_supported; - - StorageFeatures16Bit() - { - is_input_output_storage_supported = false; - is_push_constant_16_bit_storage_supported = false; - is_storage_buffer_16_bit_access_supported = false; - is_uniform_and_storage_buffer_16_bit_access_supported = false; - } - - StorageFeatures16Bit(bool in_is_input_output_storage_supported, - bool in_is_push_constant_16_bit_storage_supported, - bool in_is_storage_buffer_16_bit_access_supported, - bool in_is_uniform_and_storage_buffer_16_bit_access_supported) - { - is_input_output_storage_supported = in_is_input_output_storage_supported; - is_push_constant_16_bit_storage_supported = in_is_push_constant_16_bit_storage_supported; - is_storage_buffer_16_bit_access_supported = in_is_storage_buffer_16_bit_access_supported; - is_uniform_and_storage_buffer_16_bit_access_supported = in_is_uniform_and_storage_buffer_16_bit_access_supported; - } - } StorageFeatures16Bit; - /* Unique ID of a render-pass' sub-pass attachment within scope of a RenderPass instance. */ typedef uint32_t SubPassAttachmentID; @@ -1970,8 +2498,8 @@ namespace Anvil { MTSafety convert_boolean_to_mt_safety_enum(bool in_mt_safe); - bool convert_mt_safety_enum_to_boolean(MTSafety in_mt_safety, - std::weak_ptr in_device_ptr); + bool convert_mt_safety_enum_to_boolean(MTSafety in_mt_safety, + const Anvil::BaseDevice* in_device_ptr); Anvil::QueueFamilyBits get_queue_family_bits_from_queue_family_type(Anvil::QueueFamilyType in_queue_family_type); @@ -1984,10 +2512,10 @@ namespace Anvil * under @param out_opt_queue_family_indices_ptr. * **/ - void convert_queue_family_bits_to_family_indices(std::weak_ptr in_device_ptr, - Anvil::QueueFamilyBits in_queue_families, - uint32_t* out_opt_queue_family_indices_ptr, - uint32_t* out_opt_n_queue_family_indices_ptr); + void convert_queue_family_bits_to_family_indices(const Anvil::BaseDevice* in_device_ptr, + Anvil::QueueFamilyBits in_queue_families, + uint32_t* out_opt_queue_family_indices_ptr, + uint32_t* out_opt_n_queue_family_indices_ptr); /** Returns an access mask which has all the access bits, relevant to the user-specified image layout, * enabled. @@ -1995,7 +2523,7 @@ namespace Anvil * The access mask can be further restricted to the specified queue family type. */ VkAccessFlags get_access_mask_from_image_layout(VkImageLayout in_layout, - Anvil::QueueFamilyType in_queue_family_type = Anvil::QUEUE_FAMILY_TYPE_UNDEFINED); + Anvil::QueueFamilyType in_queue_family_type = Anvil::QueueFamilyType::UNDEFINED); /** Converts a pair of VkMemoryPropertyFlags and VkMemoryHeapFlags bitfields to a corresponding Anvil::MemoryFeatureFlags * enum. @@ -2249,78 +2777,84 @@ namespace Anvil /** Adds a new bind info to the container. The application can then append buffer memory updates * to the bind info by calling append_buffer_memory_update(). * - * @param in_n_signal_semaphores Number of semaphores to signal after the bind info is processed. Can be 0. - * @param in_opt_signal_semaphores_ptr An array of semaphores (sized @param in_n_signal_semaphores) to signal. - * Should be null if @param in_n_signal_semaphores is 0. - * @param in_n_wait_semaphores Number of semaphores to wait on before the bind info should start being - * processed. Can be 0. - * @param in_opt_wait_semaphores_ptr An array of semaphores (sized @param in_n_wait_semaphores) to wait on, - * before processing the bind info. Should be null if @param in_n_wait_semaphores - * is 0. + * @param in_n_signal_semaphores Number of semaphores to signal after the bind info is processed. Can be 0. + * @param in_opt_signal_semaphores_ptrs_ptr Ptr to an array of semaphores (sized @param in_n_signal_semaphores) to signal. + * Should be null if @param in_n_signal_semaphores is 0. + * @param in_n_wait_semaphores Number of semaphores to wait on before the bind info should start being + * processed. Can be 0. + * @param in_opt_wait_semaphores_ptrs_ptr Ptr to an array of semaphores (sized @param in_n_wait_semaphores) to wait on, + * before processing the bind info. Should be null if @param in_n_wait_semaphores + * is 0. * * @return ID of the new bind info. **/ - SparseMemoryBindInfoID add_bind_info(uint32_t in_n_signal_semaphores, - std::shared_ptr* in_opt_signal_semaphores_ptr, - uint32_t in_n_wait_semaphores, - std::shared_ptr* in_opt_wait_semaphores_ptr); + SparseMemoryBindInfoID add_bind_info(uint32_t in_n_signal_semaphores, + Anvil::Semaphore* const* in_opt_signal_semaphores_ptrs_ptr, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_opt_wait_semaphores_ptrs_ptr); /** Appends a new buffer memory block update to the bind info. * - * @param in_bind_info_id ID of the bind info to append the update to. - * @param in_buffer_ptr Buffer instance to update. Must not be NULL. - * @param in_buffer_memory_start_offset Start offset of the target memory region. - * @param in_opt_memory_block_ptr Memory block to use for the binding. May be NULL. - * @param in_opt_memory_block_start_offset Start offset of the source memory region. Ignored - * if @param in_memory_block_ptr is NULL. - * @param in_size Size of the memory block to update. + * @param in_bind_info_id ID of the bind info to append the update to. + * @param in_buffer_ptr Buffer instance to update. Must not be NULL. + * @param in_buffer_memory_start_offset Start offset of the target memory region. + * @param in_opt_memory_block_ptr Memory block to use for the binding. May be NULL. + * @param in_opt_memory_block_start_offset Start offset of the source memory region. Ignored + * if @param in_memory_block_ptr is NULL. + * @param in_opt_memory_block_owned_by_buffer TODO. + * @param in_size Size of the memory block to update. **/ - void append_buffer_memory_update(SparseMemoryBindInfoID in_bind_info_id, - std::shared_ptr in_buffer_ptr, - VkDeviceSize in_buffer_memory_start_offset, - std::shared_ptr in_opt_memory_block_ptr, - VkDeviceSize in_opt_memory_block_start_offset, - VkDeviceSize in_size); + void append_buffer_memory_update(SparseMemoryBindInfoID in_bind_info_id, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_buffer_memory_start_offset, + Anvil::MemoryBlock* in_opt_memory_block_ptr, + VkDeviceSize in_opt_memory_block_start_offset, + bool in_opt_memory_block_owned_by_buffer, + VkDeviceSize in_size); /** Appends a new non-opaque image memory update to the bind info. * - * @param in_bind_info_id ID of the bind info to append the update to. - * @param in_image_ptr Image instance to update. Must not be NULL. - * @param in_subresource Subresource which should be used for the update operation. - * @param in_offset Image region offset for the update operation. - * @param in_extent Extent of the update operation. - * @param in_flags VkSparseMemoryBindFlags value to use for the update. - * @param in_opt_memory_block_ptr Memory block to use for the update operation. May be NULL. - * @param in_opt_memory_block_start_offset Start offset of the source memory region. ignored if - * @param in_opt_memory_block_ptr is NULL. + * @param in_bind_info_id ID of the bind info to append the update to. + * @param in_image_ptr Image instance to update. Must not be NULL. + * @param in_subresource Subresource which should be used for the update operation. + * @param in_offset Image region offset for the update operation. + * @param in_extent Extent of the update operation. + * @param in_flags VkSparseMemoryBindFlags value to use for the update. + * @param in_opt_memory_block_ptr Memory block to use for the update operation. May be NULL. + * @param in_opt_memory_block_start_offset Start offset of the source memory region. ignored if + * @param in_opt_memory_block_ptr is NULL. + * @param in_opt_memory_block_owned_by_image TODO **/ - void append_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, - std::shared_ptr in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - const VkExtent3D& in_extent, - VkSparseMemoryBindFlags in_flags, - std::shared_ptr in_opt_memory_block_ptr, - VkDeviceSize in_opt_memory_block_start_offset); + void append_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, + Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + const VkExtent3D& in_extent, + VkSparseMemoryBindFlags in_flags, + Anvil::MemoryBlock* in_opt_memory_block_ptr, + VkDeviceSize in_opt_memory_block_start_offset, + bool in_opt_memory_block_owned_by_image); /** Appends a new opaque image memory update to the bind info. * - * @param in_bind_info_id ID of the bind info to append the update to. - * @param in_image_ptr Image instance to update. Must not be NULL. - * @param in_resource_offset Raw memory image start offset to use for the update. - * @param in_size Number of bytes to update. - * @param in_flags VkSparseMemoryBindFlags value to use for the update. - * @param in_opt_memory_block_ptr Memory block to use for the update operation. May be NULL. - * @param in_opt_memory_block_start_offset Start offset of the source memory region. Ignored if - * @param in_opt_memory_block_ptr is NULL. + * @param in_bind_info_id ID of the bind info to append the update to. + * @param in_image_ptr Image instance to update. Must not be NULL. + * @param in_resource_offset Raw memory image start offset to use for the update. + * @param in_size Number of bytes to update. + * @param in_flags VkSparseMemoryBindFlags value to use for the update. + * @param in_opt_memory_block_ptr Memory block to use for the update operation. May be NULL. + * @param in_opt_memory_block_start_offset Start offset of the source memory region. Ignored if + * @param in_opt_memory_block_ptr is NULL. + * @param in_opt_memory_block_owned_by_image TODO **/ - void append_opaque_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, - std::shared_ptr in_image_ptr, - VkDeviceSize in_resource_offset, - VkDeviceSize in_size, - VkSparseMemoryBindFlags in_flags, - std::shared_ptr in_opt_memory_block_ptr, - VkDeviceSize in_opt_memory_block_start_offset); + void append_opaque_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, + Anvil::Image* in_image_ptr, + VkDeviceSize in_resource_offset, + VkDeviceSize in_size, + VkSparseMemoryBindFlags in_flags, + Anvil::MemoryBlock* in_opt_memory_block_ptr, + VkDeviceSize in_opt_memory_block_start_offset, + bool in_opt_memory_block_owned_by_image); /** Retrieves bind info properties. * @@ -2335,131 +2869,137 @@ namespace Anvil * updates assigned to the bind info item are executed. May be NULL. * @param out_opt_n_signal_semaphores_ptr Deref will be set to the number of semaphores, which should be * signalled after bindings are applied. May be NULL. - * @param out_opt_signal_semaphores_ptr_ptr Deref will be set to an array of signal semaphores. May be NULL. + * @param out_opt_signal_semaphores_ptr_ptr_ptr Deref will be set to a ptr to an array of signal semaphores. May be NULL. * @param out_opt_n_wait_semaphores_ptr Deref will be set to the number of semaphores, which should be * waited on before bindings are applied. May be NULL. - * @param out_opt_wait_semaphores_ptr_ptr Deref will be set to an array of wait semaphores. May be NULL. + * @param out_opt_wait_semaphores_ptr_ptr_ptr Deref will be set to a ptr to an array of wait semaphores. May be NULL. * * @return true if successful, false otherwise. **/ - bool get_bind_info_properties(SparseMemoryBindInfoID in_bind_info_id, - uint32_t* const out_opt_n_buffer_memory_updates_ptr, - uint32_t* const out_opt_n_image_memory_updates_ptr, - uint32_t* const out_opt_n_image_opaque_memory_updates_ptr, - uint32_t* const out_opt_n_signal_semaphores_ptr, - const std::shared_ptr** out_opt_signal_semaphores_ptr_ptr, - uint32_t* const out_opt_n_wait_semaphores_ptr, - const std::shared_ptr** out_opt_wait_semaphores_ptr_ptr) const; + bool get_bind_info_properties(SparseMemoryBindInfoID in_bind_info_id, + uint32_t* const out_opt_n_buffer_memory_updates_ptr, + uint32_t* const out_opt_n_image_memory_updates_ptr, + uint32_t* const out_opt_n_image_opaque_memory_updates_ptr, + uint32_t* const out_opt_n_signal_semaphores_ptr, + Anvil::Semaphore*** out_opt_signal_semaphores_ptr_ptr_ptr, + uint32_t* const out_opt_n_wait_semaphores_ptr, + Anvil::Semaphore*** out_opt_wait_semaphores_ptr_ptr_ptr); /** Retrieves Vulkan descriptors which should be used for the vkQueueBindSparse() call. * * This call will trigger baking, if the container is marked as dirty. * - * @param out_bind_info_count_ptr Deref will be set to the value which should be passed in the - * argument of the call. Must not be NULL. - * @param out_bind_info_ptr Deref will be set to a pointer to an array, which should be - * passed in the argument of the call. Must not be NULL. - * @param out_fence_to_set_ptr Deref will be set to the fence, which should be set by the implementation - * after all bindings are in place. Note that the fence itself is optional - * and may be null. + * @param out_bind_info_count_ptr Deref will be set to the value which should be passed in the + * argument of the call. Must not be NULL. + * @param out_bind_info_ptrs_ptr Deref will be set to a pointer to an array, which should be + * passed in the argument of the call. Must not be NULL. + * @param out_fence_to_set_ptrs_ptr Deref will be set to the fence, which should be set by the implementation + * after all bindings are in place. Note that the fence itself is optional + * and may be null. **/ - void get_bind_sparse_call_args(uint32_t* out_bind_info_count_ptr, - const VkBindSparseInfo** out_bind_info_ptr, - std::shared_ptr* out_fence_to_set_ptr); + void get_bind_sparse_call_args(uint32_t* out_bind_info_count_ptr, + const VkBindSparseInfo** out_bind_info_ptrs_ptr, + Anvil::Fence** out_fence_to_set_ptr_ptr); /** Retrieves details of buffer memory binding updates, cached for user-specified bind info. * - * @param in_bind_info_id ID of the bind info, which owns the update, whose properties are - * being queried. - * @param in_n_update Index of the buffer memory update to retrieve properties of. - * @param out_opt_buffer_ptr If not NULL, deref will be set to the buffer, whose sparse memory - * binding should be updated. Otherwise ignored. - * @param out_opt_buffer_memory_start_offset_ptr If not NULL, deref will be set to the start offset of the buffer, - * at which the memory block should be bound. Otherwise ignored. - * @param out_opt_memory_block_ptr If not NULL, deref will be set to the memory block, which should - * be used for the binding. Otherwise ignored. - * @param out_opt_memory_block_start_offset_ptr If not NULL, deref will be set to the start offset of the memory block, - * from which the memory region, which should be used for the binding, - * starts. Otherwise ignored. - * @param out_opt_size_ptr If not NULL, deref will be set to the size of the memory region, - * which should be used for the binding. Otherwise ignored. + * @param in_bind_info_id ID of the bind info, which owns the update, whose properties are + * being queried. + * @param in_n_update Index of the buffer memory update to retrieve properties of. + * @param out_opt_buffer_ptr If not NULL, deref will be set to the buffer, whose sparse memory + * binding should be updated. Otherwise ignored. + * @param out_opt_buffer_memory_start_offset_ptr If not NULL, deref will be set to the start offset of the buffer, + * at which the memory block should be bound. Otherwise ignored. + * @param out_opt_memory_block_ptr If not NULL, deref will be set to the memory block, which should + * be used for the binding. Otherwise ignored. + * @param out_opt_memory_block_start_offset_ptr If not NULL, deref will be set to the start offset of the memory block, + * from which the memory region, which should be used for the binding, + * starts. Otherwise ignored. + * @param out_opt_memory_block_owned_by_buffer_ptr TODO. + * @param out_opt_size_ptr If not NULL, deref will be set to the size of the memory region, + * which should be used for the binding. Otherwise ignored. * * @return true if successful, false otherwise. **/ - bool get_buffer_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, - uint32_t in_n_update, - std::shared_ptr* out_opt_buffer_ptr, - VkDeviceSize* out_opt_buffer_memory_start_offset_ptr, - std::shared_ptr* out_opt_memory_block_ptr, - VkDeviceSize* out_opt_memory_block_start_offset_ptr, - VkDeviceSize* out_opt_size_ptr) const; + bool get_buffer_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, + uint32_t in_n_update, + Anvil::Buffer** out_opt_buffer_ptr_ptr, + VkDeviceSize* out_opt_buffer_memory_start_offset_ptr, + Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, + VkDeviceSize* out_opt_memory_block_start_offset_ptr, + bool* out_opt_memory_block_owned_by_buffer_ptr, + VkDeviceSize* out_opt_size_ptr) const; /** Retrieves the fence, if one was earlier assigned to the instance */ - std::shared_ptr get_fence() const + const Anvil::Fence* get_fence() const { return m_fence_ptr; } /** Retrieves properties of a non-opaque image memory update with a given ID. * - * @param in_bind_info_id ID of the bind info, which owns the update, and whose properties are - * being queried. - * @param in_n_update Index of the image memory update to retrieve properties of. - * @param out_opt_image_ptr_ptr If not NULL, deref will be set to the image which should be updated. - * Otherwise ignored. - * @param out_opt_subresouce_ptr If not NULL, deref will be set to the subresource to be used for the - * update. Otherwise ignored. - * @param out_opt_offset_ptr If not NULL, deref will be set to image start offset, at which - * the memory block should be bound. Otherwise ignored. - * @param out_opt_extent_ptr If not NULL, deref will be set to the extent of the update. Otherwise - * ignored. - * @param out_opt_flags_ptr If not NULL, deref will be set to VkSparseMemoryBindFlags value which - * is going to be used for the update. Otherwise ignored. - * @param out_opt_memory_block_ptr_ptr If not NULL, deref will be set to pointer to the memory block, which - * is going to be used for the bind operation. Otherwise ignored. - * @param out_opt_memory_block_start_offset_ptr If not NULL, deref will be set to the start offset of the memory block, - * which should be used for the binding operation. Otherwise ignored. + * @param in_bind_info_id ID of the bind info, which owns the update, and whose properties are + * being queried. + * @param in_n_update Index of the image memory update to retrieve properties of. + * @param out_opt_image_ptr_ptr If not NULL, deref will be set to the image which should be updated. + * Otherwise ignored. + * @param out_opt_subresouce_ptr If not NULL, deref will be set to the subresource to be used for the + * update. Otherwise ignored. + * @param out_opt_offset_ptr If not NULL, deref will be set to image start offset, at which + * the memory block should be bound. Otherwise ignored. + * @param out_opt_extent_ptr If not NULL, deref will be set to the extent of the update. Otherwise + * ignored. + * @param out_opt_flags_ptr If not NULL, deref will be set to VkSparseMemoryBindFlags value which + * is going to be used for the update. Otherwise ignored. + * @param out_opt_memory_block_ptr_ptr If not NULL, deref will be set to pointer to the memory block, which + * is going to be used for the bind operation. Otherwise ignored. + * @param out_opt_memory_block_start_offset_ptr If not NULL, deref will be set to the start offset of the memory block, + * which should be used for the binding operation. Otherwise ignored. + * @param out_opt_memory_block_owned_by_image_ptr TODO * * @return true if successful, false otherwise. **/ - bool get_image_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, - uint32_t in_n_update, - std::shared_ptr* out_opt_image_ptr_ptr, - VkImageSubresource* out_opt_subresource_ptr, - VkOffset3D* out_opt_offset_ptr, - VkExtent3D* out_opt_extent_ptr, - VkSparseMemoryBindFlags* out_opt_flags_ptr, - std::shared_ptr* out_opt_memory_block_ptr_ptr, - VkDeviceSize* out_opt_memory_block_start_offset_ptr) const; + bool get_image_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, + uint32_t in_n_update, + Anvil::Image** out_opt_image_ptr_ptr, + VkImageSubresource* out_opt_subresource_ptr, + VkOffset3D* out_opt_offset_ptr, + VkExtent3D* out_opt_extent_ptr, + VkSparseMemoryBindFlags* out_opt_flags_ptr, + Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, + VkDeviceSize* out_opt_memory_block_start_offset_ptr, + bool* out_opt_memory_block_owned_by_image_ptr) const; /** Retrieves properties of an opaque image memory updated with a given ID. * - * @param in_bind_info_id ID of the bind info, which owns the update, and whose properties are being - * queried. - * @param in_n_update Index of the opaque image memory update to retrieve properties of. - * @param out_opt_image_ptr_ptr If not NULL, deref will be set to the image which should be updated. Otherwise - * ignored. - * @param out_opt_resource_offset_ptr If not NULL, deref will be set to the raw image memory offset, which should - * be used for the update. Otherwise ignored. - * @param out_opt_size_ptr If not NULL, deref will be set to the size of the image memory which should - * be used for the update. Otherwise ignored. - * @param out_opt_flags_ptr If not NULL, deref will be set to the VkSParseMemoryBindFlags value which is - * going to be used for the update. Otherwise igfnored. - * @param out_opt_memory_block_ptr_ptr If not NULL, deref will be set to pointer to the memory block, which is going - * to be used for the bind operation. Otherwise ignored. - * @param out_opt_memory_block_start_offset_ptr If not NULL, deref will be set to the start offset of the memory block, which - * should be used for the binding operation. Otherwise ignored. + * @param in_bind_info_id ID of the bind info, which owns the update, and whose properties are being + * queried. + * @param in_n_update Index of the opaque image memory update to retrieve properties of. + * @param out_opt_image_ptr_ptr If not NULL, deref will be set to the image which should be updated. Otherwise + * ignored. + * @param out_opt_resource_offset_ptr If not NULL, deref will be set to the raw image memory offset, which should + * be used for the update. Otherwise ignored. + * @param out_opt_size_ptr If not NULL, deref will be set to the size of the image memory which should + * be used for the update. Otherwise ignored. + * @param out_opt_flags_ptr If not NULL, deref will be set to the VkSParseMemoryBindFlags value which is + * going to be used for the update. Otherwise igfnored. + * @param out_opt_memory_block_ptr_ptr If not NULL, deref will be set to pointer to the memory block, which is going + * to be used for the bind operation. Otherwise ignored. + * @param out_opt_memory_block_start_offset_ptr If not NULL, deref will be set to the start offset of the memory block, which + * should be used for the binding operation. Otherwise ignored. + * @param out_opt_memory_block_owned_by_image_ptr TODO * * @return true if successful, false otherwise. */ - bool get_image_opaque_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, - uint32_t in_n_update, - std::shared_ptr* out_opt_image_ptr_ptr, - VkDeviceSize* out_opt_resource_offset_ptr, - VkDeviceSize* out_opt_size_ptr, - VkSparseMemoryBindFlags* out_opt_flags_ptr, - std::shared_ptr* out_opt_memory_block_ptr_ptr, - VkDeviceSize* out_opt_memory_block_start_offset_ptr) const; + bool get_image_opaque_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, + uint32_t in_n_update, + Anvil::Image** out_opt_image_ptr_ptr, + VkDeviceSize* out_opt_resource_offset_ptr, + VkDeviceSize* out_opt_size_ptr, + VkSparseMemoryBindFlags* out_opt_flags_ptr, + Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, + VkDeviceSize* out_opt_memory_block_start_offset_ptr, + bool* out_opt_memory_block_owned_by_image_ptr) const; /** Tells how many bind info items have been assigned to the descriptor */ uint32_t get_n_bind_info_items() const @@ -2470,37 +3010,51 @@ namespace Anvil /* Changes the fence (null by default), which should be set by the Vulkan implementation after it finishes * updating the bindings. **/ - void set_fence(std::shared_ptr in_fence_ptr) + void set_fence(Anvil::Fence* in_fence_ptr) { m_fence_ptr = in_fence_ptr; } private: /* Private type definitions */ - typedef struct + typedef struct GeneralBindInfo { - VkDeviceSize start_offset; - std::shared_ptr memory_block_ptr; - VkDeviceSize memory_block_start_offset; - VkDeviceSize size; + VkDeviceSize start_offset; + bool memory_block_owned_by_target; + Anvil::MemoryBlock* memory_block_ptr; + VkDeviceSize memory_block_start_offset; + VkDeviceSize size; VkSparseMemoryBindFlagsVariable(flags); + + GeneralBindInfo() + { + memory_block_owned_by_target = false; + memory_block_ptr = nullptr; + } } GeneralBindInfo; - typedef struct + typedef struct ImageBindInfo { - VkExtent3D extent; - VkOffset3D offset; - std::shared_ptr memory_block_ptr; - VkDeviceSize memory_block_start_offset; - VkImageSubresource subresource; + VkExtent3D extent; + VkOffset3D offset; + bool memory_block_owned_by_image; + Anvil::MemoryBlock* memory_block_ptr; + VkDeviceSize memory_block_start_offset; + VkImageSubresource subresource; VkSparseMemoryBindFlagsVariable(flags); + + ImageBindInfo() + { + memory_block_owned_by_image = false; + memory_block_ptr = nullptr; + } } ImageBindInfo; - typedef std::map, std::pair, std::vector >> BufferBindUpdateMap; - typedef std::map, std::pair, std::vector >> ImageBindUpdateMap; - typedef std::map, std::pair, std::vector >> ImageOpaqueBindUpdateMap; + typedef std::map, std::vector >> BufferBindUpdateMap; + typedef std::map, std::vector >> ImageBindUpdateMap; + typedef std::map, std::vector >> ImageOpaqueBindUpdateMap; typedef struct BindingInfo { @@ -2508,20 +3062,15 @@ namespace Anvil ImageOpaqueBindUpdateMap image_opaque_updates; ImageBindUpdateMap image_updates; - std::vector > signal_semaphores; - std::vector signal_semaphores_vk; - std::vector > wait_semaphores; - std::vector wait_semaphores_vk; - - BindingInfo() - { - /* Stub */ - } + std::vector signal_semaphores; + std::vector signal_semaphores_vk; + std::vector wait_semaphores; + std::vector wait_semaphores_vk; } BindingInfo; - std::vector m_bindings; - bool m_dirty; - std::shared_ptr m_fence_ptr; + std::vector m_bindings; + bool m_dirty; + Anvil::Fence* m_fence_ptr; std::vector m_bindings_vk; std::vector m_buffer_bindings_vk; @@ -2542,6 +3091,13 @@ namespace Anvil VkStructureType type; const void* next_ptr; } VkStructHeader; + }; /* Anvil namespace */ +/* Work around compilers complaining about MemoryBlock class being unrecognized. + * + * This should be removed when types is split into smaller headers. + */ +#include "wrappers/memory_block.h" + #endif /* MISC_TYPES_H */ diff --git a/include/misc/window.h b/include/misc/window.h index f2d877f0..4c99802e 100644 --- a/include/misc/window.h +++ b/include/misc/window.h @@ -124,6 +124,8 @@ namespace Anvil bool in_closable, PresentCallbackFunction in_present_callback_func); + virtual ~Window(); + /** Closes the window and unblocks the thread executing the message pump. */ virtual void close() { /* Stub */ } @@ -194,7 +196,6 @@ namespace Anvil bool m_window_owned; /* protected functions */ - virtual ~Window(); private: /* Private functions */ diff --git a/include/misc/window_factory.h b/include/misc/window_factory.h index 0c858b95..c23a04af 100644 --- a/include/misc/window_factory.h +++ b/include/misc/window_factory.h @@ -59,12 +59,12 @@ namespace Anvil * * @return A new Window wrapper instance if successful, null otherwise. **/ - static std::shared_ptr create_window(WindowPlatform in_platform, - const std::string& in_title, - unsigned int in_width, - unsigned int in_height, - bool in_closable, - Anvil::PresentCallbackFunction in_present_callback_func); + static Anvil::WindowUniquePtr create_window(WindowPlatform in_platform, + const std::string& in_title, + unsigned int in_width, + unsigned int in_height, + bool in_closable, + Anvil::PresentCallbackFunction in_present_callback_func); /* Creates a Window wrapper instance using app-managed window handle. * @@ -79,9 +79,9 @@ namespace Anvil * @param in_handle Valid, existing window handle. * @param in_xcb_connection Only relevant for XCB window platform; Pointer to xcb_connection_t which owns the window. */ - static std::shared_ptr create_window(WindowPlatform in_platform, - WindowHandle in_handle, - void* in_xcb_connection_ptr = nullptr); + static Anvil::WindowUniquePtr create_window(WindowPlatform in_platform, + WindowHandle in_handle, + void* in_xcb_connection_ptr = nullptr); }; }; /* namespace Anvil */ diff --git a/include/misc/window_win3264.h b/include/misc/window_win3264.h index d161e360..4b0c083d 100644 --- a/include/misc/window_win3264.h +++ b/include/misc/window_win3264.h @@ -50,11 +50,11 @@ namespace Anvil * * @return New Anvil::Window instance if successful, or null otherwise. */ - static std::shared_ptr create(const std::string& in_title, - unsigned int in_width, - unsigned int in_height, - bool in_closable, - Anvil::PresentCallbackFunction in_present_callback_func); + static Anvil::WindowUniquePtr create(const std::string& in_title, + unsigned int in_width, + unsigned int in_height, + bool in_closable, + Anvil::PresentCallbackFunction in_present_callback_func); /* Creates a window wrapper instance from an existing window handle. * @@ -68,7 +68,7 @@ namespace Anvil * * @return New Anvil::Window instance if successful, or null otherwise. */ - static std::shared_ptr create(HWND in_window_handle); + static Anvil::WindowUniquePtr create(HWND in_window_handle); virtual ~WindowWin3264(){ /* Stub */ } diff --git a/include/misc/window_xcb.h b/include/misc/window_xcb.h index 019af2f6..f5154fc8 100644 --- a/include/misc/window_xcb.h +++ b/include/misc/window_xcb.h @@ -35,14 +35,14 @@ namespace Anvil { public: /* Public functions */ - static std::shared_ptr create(const std::string& in_title, - unsigned int in_width, - unsigned int in_height, - bool in_closable, - Anvil::PresentCallbackFunction in_present_callback_func); + static Anvil::WindowUniquePtr create(const std::string& in_title, + unsigned int in_width, + unsigned int in_height, + bool in_closable, + Anvil::PresentCallbackFunction in_present_callback_func); - static std::shared_ptr create(xcb_connection_t* in_connection_ptr, - WindowHandle in_window_handle); + static Anvil::WindowUniquePtr create(xcb_connection_t* in_connection_ptr, + WindowHandle in_window_handle); virtual ~WindowXcb(); diff --git a/include/vulkan/vk_platform.h b/include/vulkan/vk_platform.h index 72f80493..72892992 100644 --- a/include/vulkan/vk_platform.h +++ b/include/vulkan/vk_platform.h @@ -89,32 +89,4 @@ extern "C" } // extern "C" #endif // __cplusplus -// Platform-specific headers required by platform window system extensions. -// These are enabled prior to #including "vulkan.h". The same enable then -// controls inclusion of the extension interfaces in vulkan.h. - -#ifdef VK_USE_PLATFORM_ANDROID_KHR -#include -#endif - -#ifdef VK_USE_PLATFORM_MIR_KHR -#include -#endif - -#ifdef VK_USE_PLATFORM_WAYLAND_KHR -#include -#endif - -#ifdef VK_USE_PLATFORM_WIN32_KHR -#include -#endif - -#ifdef VK_USE_PLATFORM_XLIB_KHR -#include -#endif - -#ifdef VK_USE_PLATFORM_XCB_KHR -#include -#endif - #endif diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h index d3e2e246..d05c8490 100644 --- a/include/vulkan/vulkan.h +++ b/include/vulkan/vulkan.h @@ -1,10 +1,6 @@ #ifndef VULKAN_H_ #define VULKAN_H_ 1 -#ifdef __cplusplus -extern "C" { -#endif - /* ** Copyright (c) 2015-2018 The Khronos Group Inc. ** @@ -21,7012 +17,63 @@ extern "C" { ** limitations under the License. */ -/* -** This header is generated from the Khronos Vulkan XML API Registry. -** -*/ - - -#define VK_VERSION_1_0 1 #include "vk_platform.h" +#include "vulkan_core.h" -#define VK_MAKE_VERSION(major, minor, patch) \ - (((major) << 22) | ((minor) << 12) | (patch)) - -// DEPRECATED: This define has been removed. Specific version defines (e.g. VK_API_VERSION_1_0), or the VK_MAKE_VERSION macro, should be used instead. -//#define VK_API_VERSION VK_MAKE_VERSION(1, 0, 0) // Patch version should always be set to 0 - -// Vulkan 1.0 version number -#define VK_API_VERSION_1_0 VK_MAKE_VERSION(1, 0, 0)// Patch version should always be set to 0 - -#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22) -#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) -#define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff) -// Version of this file -#define VK_HEADER_VERSION 68 - - -#define VK_NULL_HANDLE 0 - - - -#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object; - - -#if !defined(VK_DEFINE_NON_DISPATCHABLE_HANDLE) -#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) - #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object; -#else - #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object; -#endif +#ifdef VK_USE_PLATFORM_ANDROID_KHR +#include "vulkan_android.h" #endif - - - -typedef uint32_t VkFlags; -typedef uint32_t VkBool32; -typedef uint64_t VkDeviceSize; -typedef uint32_t VkSampleMask; - -VK_DEFINE_HANDLE(VkInstance) -VK_DEFINE_HANDLE(VkPhysicalDevice) -VK_DEFINE_HANDLE(VkDevice) -VK_DEFINE_HANDLE(VkQueue) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSemaphore) -VK_DEFINE_HANDLE(VkCommandBuffer) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFence) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeviceMemory) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBuffer) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImage) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkEvent) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkQueryPool) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferView) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImageView) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderModule) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineCache) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineLayout) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkRenderPass) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipeline) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSetLayout) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSampler) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorPool) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSet) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFramebuffer) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool) - -#define VK_LOD_CLAMP_NONE 1000.0f -#define VK_REMAINING_MIP_LEVELS (~0U) -#define VK_REMAINING_ARRAY_LAYERS (~0U) -#define VK_WHOLE_SIZE (~0ULL) -#define VK_ATTACHMENT_UNUSED (~0U) -#define VK_TRUE 1 -#define VK_FALSE 0 -#define VK_QUEUE_FAMILY_IGNORED (~0U) -#define VK_SUBPASS_EXTERNAL (~0U) -#define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256 -#define VK_UUID_SIZE 16 -#define VK_MAX_MEMORY_TYPES 32 -#define VK_MAX_MEMORY_HEAPS 16 -#define VK_MAX_EXTENSION_NAME_SIZE 256 -#define VK_MAX_DESCRIPTION_SIZE 256 - - -typedef enum VkPipelineCacheHeaderVersion { - VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1, - VK_PIPELINE_CACHE_HEADER_VERSION_BEGIN_RANGE = VK_PIPELINE_CACHE_HEADER_VERSION_ONE, - VK_PIPELINE_CACHE_HEADER_VERSION_END_RANGE = VK_PIPELINE_CACHE_HEADER_VERSION_ONE, - VK_PIPELINE_CACHE_HEADER_VERSION_RANGE_SIZE = (VK_PIPELINE_CACHE_HEADER_VERSION_ONE - VK_PIPELINE_CACHE_HEADER_VERSION_ONE + 1), - VK_PIPELINE_CACHE_HEADER_VERSION_MAX_ENUM = 0x7FFFFFFF -} VkPipelineCacheHeaderVersion; - -typedef enum VkResult { - VK_SUCCESS = 0, - VK_NOT_READY = 1, - VK_TIMEOUT = 2, - VK_EVENT_SET = 3, - VK_EVENT_RESET = 4, - VK_INCOMPLETE = 5, - VK_ERROR_OUT_OF_HOST_MEMORY = -1, - VK_ERROR_OUT_OF_DEVICE_MEMORY = -2, - VK_ERROR_INITIALIZATION_FAILED = -3, - VK_ERROR_DEVICE_LOST = -4, - VK_ERROR_MEMORY_MAP_FAILED = -5, - VK_ERROR_LAYER_NOT_PRESENT = -6, - VK_ERROR_EXTENSION_NOT_PRESENT = -7, - VK_ERROR_FEATURE_NOT_PRESENT = -8, - VK_ERROR_INCOMPATIBLE_DRIVER = -9, - VK_ERROR_TOO_MANY_OBJECTS = -10, - VK_ERROR_FORMAT_NOT_SUPPORTED = -11, - VK_ERROR_FRAGMENTED_POOL = -12, - VK_ERROR_SURFACE_LOST_KHR = -1000000000, - VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001, - VK_SUBOPTIMAL_KHR = 1000001003, - VK_ERROR_OUT_OF_DATE_KHR = -1000001004, - VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001, - VK_ERROR_VALIDATION_FAILED_EXT = -1000011001, - VK_ERROR_INVALID_SHADER_NV = -1000012000, - VK_ERROR_OUT_OF_POOL_MEMORY_KHR = -1000069000, - VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR = -1000072003, - VK_ERROR_NOT_PERMITTED_EXT = -1000174001, - VK_RESULT_BEGIN_RANGE = VK_ERROR_FRAGMENTED_POOL, - VK_RESULT_END_RANGE = VK_INCOMPLETE, - VK_RESULT_RANGE_SIZE = (VK_INCOMPLETE - VK_ERROR_FRAGMENTED_POOL + 1), - VK_RESULT_MAX_ENUM = 0x7FFFFFFF -} VkResult; - -typedef enum VkStructureType { - VK_STRUCTURE_TYPE_APPLICATION_INFO = 0, - VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1, - VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2, - VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3, - VK_STRUCTURE_TYPE_SUBMIT_INFO = 4, - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5, - VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6, - VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7, - VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8, - VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9, - VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10, - VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11, - VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12, - VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13, - VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14, - VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15, - VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16, - VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17, - VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18, - VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19, - VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20, - VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23, - VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24, - VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25, - VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26, - VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27, - VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28, - VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29, - VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30, - VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32, - VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34, - VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35, - VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36, - VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37, - VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38, - VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42, - VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43, - VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44, - VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45, - VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46, - VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47, - VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48, - VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000, - VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001, - VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000, - VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001, - VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR = 1000003000, - VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000, - VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000, - VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000, - VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000, - VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000, - VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000, - VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000, - VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000, - VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001, - VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002, - VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000, - VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001, - VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002, - VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD = 1000041000, - VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHX = 1000053000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHX = 1000053001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHX = 1000053002, - VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000, - VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001, - VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000, - VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001, - VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = 1000059000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = 1000059001, - VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = 1000059002, - VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = 1000059004, - VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = 1000059005, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006, - VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008, - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHX = 1000060000, - VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO_KHX = 1000060003, - VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHX = 1000060004, - VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHX = 1000060005, - VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHX = 1000060006, - VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHX = 1000060010, - VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO_KHX = 1000060013, - VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHX = 1000060014, - VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHX = 1000060007, - VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHX = 1000060008, - VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHX = 1000060009, - VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHX = 1000060011, - VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHX = 1000060012, - VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000, - VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN = 1000062000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHX = 1000070000, - VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHX = 1000070001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHR = 1000071000, - VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHR = 1000071001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHR = 1000071002, - VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHR = 1000071003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR = 1000071004, - VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR = 1000072000, - VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR = 1000072001, - VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR = 1000072002, - VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR = 1000073000, - VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR = 1000073001, - VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR = 1000073002, - VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR = 1000073003, - VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR = 1000074000, - VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR = 1000074001, - VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR = 1000074002, - VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR = 1000075000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHR = 1000076000, - VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHR = 1000076001, - VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHR = 1000077000, - VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR = 1000078000, - VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR = 1000078001, - VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR = 1000078002, - VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR = 1000078003, - VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR = 1000079000, - VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR = 1000079001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR = 1000080000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR = 1000083000, - VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000, - VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR = 1000085000, - VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000, - VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001, - VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002, - VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003, - VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004, - VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV = 1000087000, - VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT = 1000090000, - VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT = 1000091000, - VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT = 1000091001, - VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT = 1000091002, - VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT = 1000091003, - VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE = 1000092000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX = 1000097000, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV = 1000098000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT = 1000099000, - VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT = 1000099001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT = 1000101000, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT = 1000101001, - VK_STRUCTURE_TYPE_HDR_METADATA_EXT = 1000105000, - VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR = 1000111000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO_KHR = 1000112000, - VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES_KHR = 1000112001, - VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO_KHR = 1000113000, - VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR = 1000114000, - VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR = 1000114001, - VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR = 1000114002, - VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR = 1000115000, - VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR = 1000115001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES_KHR = 1000117000, - VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO_KHR = 1000117001, - VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO_KHR = 1000117002, - VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO_KHR = 1000117003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR = 1000119000, - VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR = 1000119001, - VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR = 1000119002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR = 1000120000, - VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK = 1000122000, - VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000123000, - VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR = 1000127000, - VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR = 1000127001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT = 1000130000, - VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT = 1000130001, - VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT = 1000143000, - VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT = 1000143001, - VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT = 1000143002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT = 1000143003, - VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT = 1000143004, - VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR = 1000146000, - VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR = 1000146001, - VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2_KHR = 1000146002, - VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR = 1000146003, - VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2_KHR = 1000146004, - VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR = 1000147000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT = 1000148000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT = 1000148001, - VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT = 1000148002, - VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV = 1000149000, - VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV = 1000152000, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO_KHR = 1000156000, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO_KHR = 1000156001, - VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO_KHR = 1000156002, - VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO_KHR = 1000156003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR = 1000156004, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES_KHR = 1000156005, - VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR = 1000157000, - VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR = 1000157001, - VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160000, - VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160001, - VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT = 1000174000, - VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT = 1000178000, - VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT = 1000178001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT = 1000178002, - VK_STRUCTURE_TYPE_BEGIN_RANGE = VK_STRUCTURE_TYPE_APPLICATION_INFO, - VK_STRUCTURE_TYPE_END_RANGE = VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO, - VK_STRUCTURE_TYPE_RANGE_SIZE = (VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO - VK_STRUCTURE_TYPE_APPLICATION_INFO + 1), - VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF -} VkStructureType; - -typedef enum VkSystemAllocationScope { - VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0, - VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 1, - VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 2, - VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 3, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 4, - VK_SYSTEM_ALLOCATION_SCOPE_BEGIN_RANGE = VK_SYSTEM_ALLOCATION_SCOPE_COMMAND, - VK_SYSTEM_ALLOCATION_SCOPE_END_RANGE = VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE, - VK_SYSTEM_ALLOCATION_SCOPE_RANGE_SIZE = (VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE - VK_SYSTEM_ALLOCATION_SCOPE_COMMAND + 1), - VK_SYSTEM_ALLOCATION_SCOPE_MAX_ENUM = 0x7FFFFFFF -} VkSystemAllocationScope; - -typedef enum VkInternalAllocationType { - VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0, - VK_INTERNAL_ALLOCATION_TYPE_BEGIN_RANGE = VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE, - VK_INTERNAL_ALLOCATION_TYPE_END_RANGE = VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE, - VK_INTERNAL_ALLOCATION_TYPE_RANGE_SIZE = (VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE - VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE + 1), - VK_INTERNAL_ALLOCATION_TYPE_MAX_ENUM = 0x7FFFFFFF -} VkInternalAllocationType; - -typedef enum VkFormat { - VK_FORMAT_UNDEFINED = 0, - VK_FORMAT_R4G4_UNORM_PACK8 = 1, - VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2, - VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3, - VK_FORMAT_R5G6B5_UNORM_PACK16 = 4, - VK_FORMAT_B5G6R5_UNORM_PACK16 = 5, - VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6, - VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7, - VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8, - VK_FORMAT_R8_UNORM = 9, - VK_FORMAT_R8_SNORM = 10, - VK_FORMAT_R8_USCALED = 11, - VK_FORMAT_R8_SSCALED = 12, - VK_FORMAT_R8_UINT = 13, - VK_FORMAT_R8_SINT = 14, - VK_FORMAT_R8_SRGB = 15, - VK_FORMAT_R8G8_UNORM = 16, - VK_FORMAT_R8G8_SNORM = 17, - VK_FORMAT_R8G8_USCALED = 18, - VK_FORMAT_R8G8_SSCALED = 19, - VK_FORMAT_R8G8_UINT = 20, - VK_FORMAT_R8G8_SINT = 21, - VK_FORMAT_R8G8_SRGB = 22, - VK_FORMAT_R8G8B8_UNORM = 23, - VK_FORMAT_R8G8B8_SNORM = 24, - VK_FORMAT_R8G8B8_USCALED = 25, - VK_FORMAT_R8G8B8_SSCALED = 26, - VK_FORMAT_R8G8B8_UINT = 27, - VK_FORMAT_R8G8B8_SINT = 28, - VK_FORMAT_R8G8B8_SRGB = 29, - VK_FORMAT_B8G8R8_UNORM = 30, - VK_FORMAT_B8G8R8_SNORM = 31, - VK_FORMAT_B8G8R8_USCALED = 32, - VK_FORMAT_B8G8R8_SSCALED = 33, - VK_FORMAT_B8G8R8_UINT = 34, - VK_FORMAT_B8G8R8_SINT = 35, - VK_FORMAT_B8G8R8_SRGB = 36, - VK_FORMAT_R8G8B8A8_UNORM = 37, - VK_FORMAT_R8G8B8A8_SNORM = 38, - VK_FORMAT_R8G8B8A8_USCALED = 39, - VK_FORMAT_R8G8B8A8_SSCALED = 40, - VK_FORMAT_R8G8B8A8_UINT = 41, - VK_FORMAT_R8G8B8A8_SINT = 42, - VK_FORMAT_R8G8B8A8_SRGB = 43, - VK_FORMAT_B8G8R8A8_UNORM = 44, - VK_FORMAT_B8G8R8A8_SNORM = 45, - VK_FORMAT_B8G8R8A8_USCALED = 46, - VK_FORMAT_B8G8R8A8_SSCALED = 47, - VK_FORMAT_B8G8R8A8_UINT = 48, - VK_FORMAT_B8G8R8A8_SINT = 49, - VK_FORMAT_B8G8R8A8_SRGB = 50, - VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51, - VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52, - VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53, - VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54, - VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55, - VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56, - VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57, - VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58, - VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59, - VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60, - VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61, - VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62, - VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63, - VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64, - VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65, - VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66, - VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67, - VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68, - VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69, - VK_FORMAT_R16_UNORM = 70, - VK_FORMAT_R16_SNORM = 71, - VK_FORMAT_R16_USCALED = 72, - VK_FORMAT_R16_SSCALED = 73, - VK_FORMAT_R16_UINT = 74, - VK_FORMAT_R16_SINT = 75, - VK_FORMAT_R16_SFLOAT = 76, - VK_FORMAT_R16G16_UNORM = 77, - VK_FORMAT_R16G16_SNORM = 78, - VK_FORMAT_R16G16_USCALED = 79, - VK_FORMAT_R16G16_SSCALED = 80, - VK_FORMAT_R16G16_UINT = 81, - VK_FORMAT_R16G16_SINT = 82, - VK_FORMAT_R16G16_SFLOAT = 83, - VK_FORMAT_R16G16B16_UNORM = 84, - VK_FORMAT_R16G16B16_SNORM = 85, - VK_FORMAT_R16G16B16_USCALED = 86, - VK_FORMAT_R16G16B16_SSCALED = 87, - VK_FORMAT_R16G16B16_UINT = 88, - VK_FORMAT_R16G16B16_SINT = 89, - VK_FORMAT_R16G16B16_SFLOAT = 90, - VK_FORMAT_R16G16B16A16_UNORM = 91, - VK_FORMAT_R16G16B16A16_SNORM = 92, - VK_FORMAT_R16G16B16A16_USCALED = 93, - VK_FORMAT_R16G16B16A16_SSCALED = 94, - VK_FORMAT_R16G16B16A16_UINT = 95, - VK_FORMAT_R16G16B16A16_SINT = 96, - VK_FORMAT_R16G16B16A16_SFLOAT = 97, - VK_FORMAT_R32_UINT = 98, - VK_FORMAT_R32_SINT = 99, - VK_FORMAT_R32_SFLOAT = 100, - VK_FORMAT_R32G32_UINT = 101, - VK_FORMAT_R32G32_SINT = 102, - VK_FORMAT_R32G32_SFLOAT = 103, - VK_FORMAT_R32G32B32_UINT = 104, - VK_FORMAT_R32G32B32_SINT = 105, - VK_FORMAT_R32G32B32_SFLOAT = 106, - VK_FORMAT_R32G32B32A32_UINT = 107, - VK_FORMAT_R32G32B32A32_SINT = 108, - VK_FORMAT_R32G32B32A32_SFLOAT = 109, - VK_FORMAT_R64_UINT = 110, - VK_FORMAT_R64_SINT = 111, - VK_FORMAT_R64_SFLOAT = 112, - VK_FORMAT_R64G64_UINT = 113, - VK_FORMAT_R64G64_SINT = 114, - VK_FORMAT_R64G64_SFLOAT = 115, - VK_FORMAT_R64G64B64_UINT = 116, - VK_FORMAT_R64G64B64_SINT = 117, - VK_FORMAT_R64G64B64_SFLOAT = 118, - VK_FORMAT_R64G64B64A64_UINT = 119, - VK_FORMAT_R64G64B64A64_SINT = 120, - VK_FORMAT_R64G64B64A64_SFLOAT = 121, - VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122, - VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123, - VK_FORMAT_D16_UNORM = 124, - VK_FORMAT_X8_D24_UNORM_PACK32 = 125, - VK_FORMAT_D32_SFLOAT = 126, - VK_FORMAT_S8_UINT = 127, - VK_FORMAT_D16_UNORM_S8_UINT = 128, - VK_FORMAT_D24_UNORM_S8_UINT = 129, - VK_FORMAT_D32_SFLOAT_S8_UINT = 130, - VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131, - VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132, - VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133, - VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134, - VK_FORMAT_BC2_UNORM_BLOCK = 135, - VK_FORMAT_BC2_SRGB_BLOCK = 136, - VK_FORMAT_BC3_UNORM_BLOCK = 137, - VK_FORMAT_BC3_SRGB_BLOCK = 138, - VK_FORMAT_BC4_UNORM_BLOCK = 139, - VK_FORMAT_BC4_SNORM_BLOCK = 140, - VK_FORMAT_BC5_UNORM_BLOCK = 141, - VK_FORMAT_BC5_SNORM_BLOCK = 142, - VK_FORMAT_BC6H_UFLOAT_BLOCK = 143, - VK_FORMAT_BC6H_SFLOAT_BLOCK = 144, - VK_FORMAT_BC7_UNORM_BLOCK = 145, - VK_FORMAT_BC7_SRGB_BLOCK = 146, - VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147, - VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148, - VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149, - VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150, - VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151, - VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152, - VK_FORMAT_EAC_R11_UNORM_BLOCK = 153, - VK_FORMAT_EAC_R11_SNORM_BLOCK = 154, - VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155, - VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156, - VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157, - VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158, - VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159, - VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160, - VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161, - VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162, - VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163, - VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164, - VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165, - VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166, - VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167, - VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168, - VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169, - VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170, - VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171, - VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172, - VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173, - VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174, - VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175, - VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176, - VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177, - VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178, - VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179, - VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180, - VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181, - VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182, - VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183, - VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184, - VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000, - VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001, - VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002, - VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003, - VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004, - VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005, - VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006, - VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007, - VK_FORMAT_G8B8G8R8_422_UNORM_KHR = 1000156000, - VK_FORMAT_B8G8R8G8_422_UNORM_KHR = 1000156001, - VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR = 1000156002, - VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR = 1000156003, - VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR = 1000156004, - VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR = 1000156005, - VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR = 1000156006, - VK_FORMAT_R10X6_UNORM_PACK16_KHR = 1000156007, - VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR = 1000156008, - VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR = 1000156009, - VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR = 1000156010, - VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR = 1000156011, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR = 1000156012, - VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR = 1000156013, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR = 1000156014, - VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR = 1000156015, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR = 1000156016, - VK_FORMAT_R12X4_UNORM_PACK16_KHR = 1000156017, - VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR = 1000156018, - VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR = 1000156019, - VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR = 1000156020, - VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR = 1000156021, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR = 1000156022, - VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR = 1000156023, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR = 1000156024, - VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR = 1000156025, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR = 1000156026, - VK_FORMAT_G16B16G16R16_422_UNORM_KHR = 1000156027, - VK_FORMAT_B16G16R16G16_422_UNORM_KHR = 1000156028, - VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR = 1000156029, - VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR = 1000156030, - VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR = 1000156031, - VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR = 1000156032, - VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR = 1000156033, - VK_FORMAT_BEGIN_RANGE = VK_FORMAT_UNDEFINED, - VK_FORMAT_END_RANGE = VK_FORMAT_ASTC_12x12_SRGB_BLOCK, - VK_FORMAT_RANGE_SIZE = (VK_FORMAT_ASTC_12x12_SRGB_BLOCK - VK_FORMAT_UNDEFINED + 1), - VK_FORMAT_MAX_ENUM = 0x7FFFFFFF -} VkFormat; - -typedef enum VkImageType { - VK_IMAGE_TYPE_1D = 0, - VK_IMAGE_TYPE_2D = 1, - VK_IMAGE_TYPE_3D = 2, - VK_IMAGE_TYPE_BEGIN_RANGE = VK_IMAGE_TYPE_1D, - VK_IMAGE_TYPE_END_RANGE = VK_IMAGE_TYPE_3D, - VK_IMAGE_TYPE_RANGE_SIZE = (VK_IMAGE_TYPE_3D - VK_IMAGE_TYPE_1D + 1), - VK_IMAGE_TYPE_MAX_ENUM = 0x7FFFFFFF -} VkImageType; - -typedef enum VkImageTiling { - VK_IMAGE_TILING_OPTIMAL = 0, - VK_IMAGE_TILING_LINEAR = 1, - VK_IMAGE_TILING_BEGIN_RANGE = VK_IMAGE_TILING_OPTIMAL, - VK_IMAGE_TILING_END_RANGE = VK_IMAGE_TILING_LINEAR, - VK_IMAGE_TILING_RANGE_SIZE = (VK_IMAGE_TILING_LINEAR - VK_IMAGE_TILING_OPTIMAL + 1), - VK_IMAGE_TILING_MAX_ENUM = 0x7FFFFFFF -} VkImageTiling; - -typedef enum VkPhysicalDeviceType { - VK_PHYSICAL_DEVICE_TYPE_OTHER = 0, - VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 1, - VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 2, - VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 3, - VK_PHYSICAL_DEVICE_TYPE_CPU = 4, - VK_PHYSICAL_DEVICE_TYPE_BEGIN_RANGE = VK_PHYSICAL_DEVICE_TYPE_OTHER, - VK_PHYSICAL_DEVICE_TYPE_END_RANGE = VK_PHYSICAL_DEVICE_TYPE_CPU, - VK_PHYSICAL_DEVICE_TYPE_RANGE_SIZE = (VK_PHYSICAL_DEVICE_TYPE_CPU - VK_PHYSICAL_DEVICE_TYPE_OTHER + 1), - VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM = 0x7FFFFFFF -} VkPhysicalDeviceType; - -typedef enum VkQueryType { - VK_QUERY_TYPE_OCCLUSION = 0, - VK_QUERY_TYPE_PIPELINE_STATISTICS = 1, - VK_QUERY_TYPE_TIMESTAMP = 2, - VK_QUERY_TYPE_BEGIN_RANGE = VK_QUERY_TYPE_OCCLUSION, - VK_QUERY_TYPE_END_RANGE = VK_QUERY_TYPE_TIMESTAMP, - VK_QUERY_TYPE_RANGE_SIZE = (VK_QUERY_TYPE_TIMESTAMP - VK_QUERY_TYPE_OCCLUSION + 1), - VK_QUERY_TYPE_MAX_ENUM = 0x7FFFFFFF -} VkQueryType; - -typedef enum VkSharingMode { - VK_SHARING_MODE_EXCLUSIVE = 0, - VK_SHARING_MODE_CONCURRENT = 1, - VK_SHARING_MODE_BEGIN_RANGE = VK_SHARING_MODE_EXCLUSIVE, - VK_SHARING_MODE_END_RANGE = VK_SHARING_MODE_CONCURRENT, - VK_SHARING_MODE_RANGE_SIZE = (VK_SHARING_MODE_CONCURRENT - VK_SHARING_MODE_EXCLUSIVE + 1), - VK_SHARING_MODE_MAX_ENUM = 0x7FFFFFFF -} VkSharingMode; - -typedef enum VkImageLayout { - VK_IMAGE_LAYOUT_UNDEFINED = 0, - VK_IMAGE_LAYOUT_GENERAL = 1, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 2, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 3, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 4, - VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 5, - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 6, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 7, - VK_IMAGE_LAYOUT_PREINITIALIZED = 8, - VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002, - VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR = 1000111000, - VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR = 1000117000, - VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR = 1000117001, - VK_IMAGE_LAYOUT_BEGIN_RANGE = VK_IMAGE_LAYOUT_UNDEFINED, - VK_IMAGE_LAYOUT_END_RANGE = VK_IMAGE_LAYOUT_PREINITIALIZED, - VK_IMAGE_LAYOUT_RANGE_SIZE = (VK_IMAGE_LAYOUT_PREINITIALIZED - VK_IMAGE_LAYOUT_UNDEFINED + 1), - VK_IMAGE_LAYOUT_MAX_ENUM = 0x7FFFFFFF -} VkImageLayout; - -typedef enum VkImageViewType { - VK_IMAGE_VIEW_TYPE_1D = 0, - VK_IMAGE_VIEW_TYPE_2D = 1, - VK_IMAGE_VIEW_TYPE_3D = 2, - VK_IMAGE_VIEW_TYPE_CUBE = 3, - VK_IMAGE_VIEW_TYPE_1D_ARRAY = 4, - VK_IMAGE_VIEW_TYPE_2D_ARRAY = 5, - VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 6, - VK_IMAGE_VIEW_TYPE_BEGIN_RANGE = VK_IMAGE_VIEW_TYPE_1D, - VK_IMAGE_VIEW_TYPE_END_RANGE = VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, - VK_IMAGE_VIEW_TYPE_RANGE_SIZE = (VK_IMAGE_VIEW_TYPE_CUBE_ARRAY - VK_IMAGE_VIEW_TYPE_1D + 1), - VK_IMAGE_VIEW_TYPE_MAX_ENUM = 0x7FFFFFFF -} VkImageViewType; - -typedef enum VkComponentSwizzle { - VK_COMPONENT_SWIZZLE_IDENTITY = 0, - VK_COMPONENT_SWIZZLE_ZERO = 1, - VK_COMPONENT_SWIZZLE_ONE = 2, - VK_COMPONENT_SWIZZLE_R = 3, - VK_COMPONENT_SWIZZLE_G = 4, - VK_COMPONENT_SWIZZLE_B = 5, - VK_COMPONENT_SWIZZLE_A = 6, - VK_COMPONENT_SWIZZLE_BEGIN_RANGE = VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_END_RANGE = VK_COMPONENT_SWIZZLE_A, - VK_COMPONENT_SWIZZLE_RANGE_SIZE = (VK_COMPONENT_SWIZZLE_A - VK_COMPONENT_SWIZZLE_IDENTITY + 1), - VK_COMPONENT_SWIZZLE_MAX_ENUM = 0x7FFFFFFF -} VkComponentSwizzle; - -typedef enum VkVertexInputRate { - VK_VERTEX_INPUT_RATE_VERTEX = 0, - VK_VERTEX_INPUT_RATE_INSTANCE = 1, - VK_VERTEX_INPUT_RATE_BEGIN_RANGE = VK_VERTEX_INPUT_RATE_VERTEX, - VK_VERTEX_INPUT_RATE_END_RANGE = VK_VERTEX_INPUT_RATE_INSTANCE, - VK_VERTEX_INPUT_RATE_RANGE_SIZE = (VK_VERTEX_INPUT_RATE_INSTANCE - VK_VERTEX_INPUT_RATE_VERTEX + 1), - VK_VERTEX_INPUT_RATE_MAX_ENUM = 0x7FFFFFFF -} VkVertexInputRate; - -typedef enum VkPrimitiveTopology { - VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0, - VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 1, - VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 2, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 3, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 4, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 5, - VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 6, - VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 7, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 8, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 9, - VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 10, - VK_PRIMITIVE_TOPOLOGY_BEGIN_RANGE = VK_PRIMITIVE_TOPOLOGY_POINT_LIST, - VK_PRIMITIVE_TOPOLOGY_END_RANGE = VK_PRIMITIVE_TOPOLOGY_PATCH_LIST, - VK_PRIMITIVE_TOPOLOGY_RANGE_SIZE = (VK_PRIMITIVE_TOPOLOGY_PATCH_LIST - VK_PRIMITIVE_TOPOLOGY_POINT_LIST + 1), - VK_PRIMITIVE_TOPOLOGY_MAX_ENUM = 0x7FFFFFFF -} VkPrimitiveTopology; - -typedef enum VkPolygonMode { - VK_POLYGON_MODE_FILL = 0, - VK_POLYGON_MODE_LINE = 1, - VK_POLYGON_MODE_POINT = 2, - VK_POLYGON_MODE_FILL_RECTANGLE_NV = 1000153000, - VK_POLYGON_MODE_BEGIN_RANGE = VK_POLYGON_MODE_FILL, - VK_POLYGON_MODE_END_RANGE = VK_POLYGON_MODE_POINT, - VK_POLYGON_MODE_RANGE_SIZE = (VK_POLYGON_MODE_POINT - VK_POLYGON_MODE_FILL + 1), - VK_POLYGON_MODE_MAX_ENUM = 0x7FFFFFFF -} VkPolygonMode; - -typedef enum VkFrontFace { - VK_FRONT_FACE_COUNTER_CLOCKWISE = 0, - VK_FRONT_FACE_CLOCKWISE = 1, - VK_FRONT_FACE_BEGIN_RANGE = VK_FRONT_FACE_COUNTER_CLOCKWISE, - VK_FRONT_FACE_END_RANGE = VK_FRONT_FACE_CLOCKWISE, - VK_FRONT_FACE_RANGE_SIZE = (VK_FRONT_FACE_CLOCKWISE - VK_FRONT_FACE_COUNTER_CLOCKWISE + 1), - VK_FRONT_FACE_MAX_ENUM = 0x7FFFFFFF -} VkFrontFace; - -typedef enum VkCompareOp { - VK_COMPARE_OP_NEVER = 0, - VK_COMPARE_OP_LESS = 1, - VK_COMPARE_OP_EQUAL = 2, - VK_COMPARE_OP_LESS_OR_EQUAL = 3, - VK_COMPARE_OP_GREATER = 4, - VK_COMPARE_OP_NOT_EQUAL = 5, - VK_COMPARE_OP_GREATER_OR_EQUAL = 6, - VK_COMPARE_OP_ALWAYS = 7, - VK_COMPARE_OP_BEGIN_RANGE = VK_COMPARE_OP_NEVER, - VK_COMPARE_OP_END_RANGE = VK_COMPARE_OP_ALWAYS, - VK_COMPARE_OP_RANGE_SIZE = (VK_COMPARE_OP_ALWAYS - VK_COMPARE_OP_NEVER + 1), - VK_COMPARE_OP_MAX_ENUM = 0x7FFFFFFF -} VkCompareOp; - -typedef enum VkStencilOp { - VK_STENCIL_OP_KEEP = 0, - VK_STENCIL_OP_ZERO = 1, - VK_STENCIL_OP_REPLACE = 2, - VK_STENCIL_OP_INCREMENT_AND_CLAMP = 3, - VK_STENCIL_OP_DECREMENT_AND_CLAMP = 4, - VK_STENCIL_OP_INVERT = 5, - VK_STENCIL_OP_INCREMENT_AND_WRAP = 6, - VK_STENCIL_OP_DECREMENT_AND_WRAP = 7, - VK_STENCIL_OP_BEGIN_RANGE = VK_STENCIL_OP_KEEP, - VK_STENCIL_OP_END_RANGE = VK_STENCIL_OP_DECREMENT_AND_WRAP, - VK_STENCIL_OP_RANGE_SIZE = (VK_STENCIL_OP_DECREMENT_AND_WRAP - VK_STENCIL_OP_KEEP + 1), - VK_STENCIL_OP_MAX_ENUM = 0x7FFFFFFF -} VkStencilOp; - -typedef enum VkLogicOp { - VK_LOGIC_OP_CLEAR = 0, - VK_LOGIC_OP_AND = 1, - VK_LOGIC_OP_AND_REVERSE = 2, - VK_LOGIC_OP_COPY = 3, - VK_LOGIC_OP_AND_INVERTED = 4, - VK_LOGIC_OP_NO_OP = 5, - VK_LOGIC_OP_XOR = 6, - VK_LOGIC_OP_OR = 7, - VK_LOGIC_OP_NOR = 8, - VK_LOGIC_OP_EQUIVALENT = 9, - VK_LOGIC_OP_INVERT = 10, - VK_LOGIC_OP_OR_REVERSE = 11, - VK_LOGIC_OP_COPY_INVERTED = 12, - VK_LOGIC_OP_OR_INVERTED = 13, - VK_LOGIC_OP_NAND = 14, - VK_LOGIC_OP_SET = 15, - VK_LOGIC_OP_BEGIN_RANGE = VK_LOGIC_OP_CLEAR, - VK_LOGIC_OP_END_RANGE = VK_LOGIC_OP_SET, - VK_LOGIC_OP_RANGE_SIZE = (VK_LOGIC_OP_SET - VK_LOGIC_OP_CLEAR + 1), - VK_LOGIC_OP_MAX_ENUM = 0x7FFFFFFF -} VkLogicOp; - -typedef enum VkBlendFactor { - VK_BLEND_FACTOR_ZERO = 0, - VK_BLEND_FACTOR_ONE = 1, - VK_BLEND_FACTOR_SRC_COLOR = 2, - VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 3, - VK_BLEND_FACTOR_DST_COLOR = 4, - VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 5, - VK_BLEND_FACTOR_SRC_ALPHA = 6, - VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 7, - VK_BLEND_FACTOR_DST_ALPHA = 8, - VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 9, - VK_BLEND_FACTOR_CONSTANT_COLOR = 10, - VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 11, - VK_BLEND_FACTOR_CONSTANT_ALPHA = 12, - VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 13, - VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 14, - VK_BLEND_FACTOR_SRC1_COLOR = 15, - VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 16, - VK_BLEND_FACTOR_SRC1_ALPHA = 17, - VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 18, - VK_BLEND_FACTOR_BEGIN_RANGE = VK_BLEND_FACTOR_ZERO, - VK_BLEND_FACTOR_END_RANGE = VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA, - VK_BLEND_FACTOR_RANGE_SIZE = (VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA - VK_BLEND_FACTOR_ZERO + 1), - VK_BLEND_FACTOR_MAX_ENUM = 0x7FFFFFFF -} VkBlendFactor; - -typedef enum VkBlendOp { - VK_BLEND_OP_ADD = 0, - VK_BLEND_OP_SUBTRACT = 1, - VK_BLEND_OP_REVERSE_SUBTRACT = 2, - VK_BLEND_OP_MIN = 3, - VK_BLEND_OP_MAX = 4, - VK_BLEND_OP_ZERO_EXT = 1000148000, - VK_BLEND_OP_SRC_EXT = 1000148001, - VK_BLEND_OP_DST_EXT = 1000148002, - VK_BLEND_OP_SRC_OVER_EXT = 1000148003, - VK_BLEND_OP_DST_OVER_EXT = 1000148004, - VK_BLEND_OP_SRC_IN_EXT = 1000148005, - VK_BLEND_OP_DST_IN_EXT = 1000148006, - VK_BLEND_OP_SRC_OUT_EXT = 1000148007, - VK_BLEND_OP_DST_OUT_EXT = 1000148008, - VK_BLEND_OP_SRC_ATOP_EXT = 1000148009, - VK_BLEND_OP_DST_ATOP_EXT = 1000148010, - VK_BLEND_OP_XOR_EXT = 1000148011, - VK_BLEND_OP_MULTIPLY_EXT = 1000148012, - VK_BLEND_OP_SCREEN_EXT = 1000148013, - VK_BLEND_OP_OVERLAY_EXT = 1000148014, - VK_BLEND_OP_DARKEN_EXT = 1000148015, - VK_BLEND_OP_LIGHTEN_EXT = 1000148016, - VK_BLEND_OP_COLORDODGE_EXT = 1000148017, - VK_BLEND_OP_COLORBURN_EXT = 1000148018, - VK_BLEND_OP_HARDLIGHT_EXT = 1000148019, - VK_BLEND_OP_SOFTLIGHT_EXT = 1000148020, - VK_BLEND_OP_DIFFERENCE_EXT = 1000148021, - VK_BLEND_OP_EXCLUSION_EXT = 1000148022, - VK_BLEND_OP_INVERT_EXT = 1000148023, - VK_BLEND_OP_INVERT_RGB_EXT = 1000148024, - VK_BLEND_OP_LINEARDODGE_EXT = 1000148025, - VK_BLEND_OP_LINEARBURN_EXT = 1000148026, - VK_BLEND_OP_VIVIDLIGHT_EXT = 1000148027, - VK_BLEND_OP_LINEARLIGHT_EXT = 1000148028, - VK_BLEND_OP_PINLIGHT_EXT = 1000148029, - VK_BLEND_OP_HARDMIX_EXT = 1000148030, - VK_BLEND_OP_HSL_HUE_EXT = 1000148031, - VK_BLEND_OP_HSL_SATURATION_EXT = 1000148032, - VK_BLEND_OP_HSL_COLOR_EXT = 1000148033, - VK_BLEND_OP_HSL_LUMINOSITY_EXT = 1000148034, - VK_BLEND_OP_PLUS_EXT = 1000148035, - VK_BLEND_OP_PLUS_CLAMPED_EXT = 1000148036, - VK_BLEND_OP_PLUS_CLAMPED_ALPHA_EXT = 1000148037, - VK_BLEND_OP_PLUS_DARKER_EXT = 1000148038, - VK_BLEND_OP_MINUS_EXT = 1000148039, - VK_BLEND_OP_MINUS_CLAMPED_EXT = 1000148040, - VK_BLEND_OP_CONTRAST_EXT = 1000148041, - VK_BLEND_OP_INVERT_OVG_EXT = 1000148042, - VK_BLEND_OP_RED_EXT = 1000148043, - VK_BLEND_OP_GREEN_EXT = 1000148044, - VK_BLEND_OP_BLUE_EXT = 1000148045, - VK_BLEND_OP_BEGIN_RANGE = VK_BLEND_OP_ADD, - VK_BLEND_OP_END_RANGE = VK_BLEND_OP_MAX, - VK_BLEND_OP_RANGE_SIZE = (VK_BLEND_OP_MAX - VK_BLEND_OP_ADD + 1), - VK_BLEND_OP_MAX_ENUM = 0x7FFFFFFF -} VkBlendOp; - -typedef enum VkDynamicState { - VK_DYNAMIC_STATE_VIEWPORT = 0, - VK_DYNAMIC_STATE_SCISSOR = 1, - VK_DYNAMIC_STATE_LINE_WIDTH = 2, - VK_DYNAMIC_STATE_DEPTH_BIAS = 3, - VK_DYNAMIC_STATE_BLEND_CONSTANTS = 4, - VK_DYNAMIC_STATE_DEPTH_BOUNDS = 5, - VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 6, - VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 7, - VK_DYNAMIC_STATE_STENCIL_REFERENCE = 8, - VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV = 1000087000, - VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT = 1000099000, - VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT = 1000143000, - VK_DYNAMIC_STATE_BEGIN_RANGE = VK_DYNAMIC_STATE_VIEWPORT, - VK_DYNAMIC_STATE_END_RANGE = VK_DYNAMIC_STATE_STENCIL_REFERENCE, - VK_DYNAMIC_STATE_RANGE_SIZE = (VK_DYNAMIC_STATE_STENCIL_REFERENCE - VK_DYNAMIC_STATE_VIEWPORT + 1), - VK_DYNAMIC_STATE_MAX_ENUM = 0x7FFFFFFF -} VkDynamicState; - -typedef enum VkFilter { - VK_FILTER_NEAREST = 0, - VK_FILTER_LINEAR = 1, - VK_FILTER_CUBIC_IMG = 1000015000, - VK_FILTER_BEGIN_RANGE = VK_FILTER_NEAREST, - VK_FILTER_END_RANGE = VK_FILTER_LINEAR, - VK_FILTER_RANGE_SIZE = (VK_FILTER_LINEAR - VK_FILTER_NEAREST + 1), - VK_FILTER_MAX_ENUM = 0x7FFFFFFF -} VkFilter; - -typedef enum VkSamplerMipmapMode { - VK_SAMPLER_MIPMAP_MODE_NEAREST = 0, - VK_SAMPLER_MIPMAP_MODE_LINEAR = 1, - VK_SAMPLER_MIPMAP_MODE_BEGIN_RANGE = VK_SAMPLER_MIPMAP_MODE_NEAREST, - VK_SAMPLER_MIPMAP_MODE_END_RANGE = VK_SAMPLER_MIPMAP_MODE_LINEAR, - VK_SAMPLER_MIPMAP_MODE_RANGE_SIZE = (VK_SAMPLER_MIPMAP_MODE_LINEAR - VK_SAMPLER_MIPMAP_MODE_NEAREST + 1), - VK_SAMPLER_MIPMAP_MODE_MAX_ENUM = 0x7FFFFFFF -} VkSamplerMipmapMode; - -typedef enum VkSamplerAddressMode { - VK_SAMPLER_ADDRESS_MODE_REPEAT = 0, - VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 1, - VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 2, - VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 3, - VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 4, - VK_SAMPLER_ADDRESS_MODE_BEGIN_RANGE = VK_SAMPLER_ADDRESS_MODE_REPEAT, - VK_SAMPLER_ADDRESS_MODE_END_RANGE = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, - VK_SAMPLER_ADDRESS_MODE_RANGE_SIZE = (VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER - VK_SAMPLER_ADDRESS_MODE_REPEAT + 1), - VK_SAMPLER_ADDRESS_MODE_MAX_ENUM = 0x7FFFFFFF -} VkSamplerAddressMode; - -typedef enum VkBorderColor { - VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0, - VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 1, - VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 2, - VK_BORDER_COLOR_INT_OPAQUE_BLACK = 3, - VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 4, - VK_BORDER_COLOR_INT_OPAQUE_WHITE = 5, - VK_BORDER_COLOR_BEGIN_RANGE = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK, - VK_BORDER_COLOR_END_RANGE = VK_BORDER_COLOR_INT_OPAQUE_WHITE, - VK_BORDER_COLOR_RANGE_SIZE = (VK_BORDER_COLOR_INT_OPAQUE_WHITE - VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK + 1), - VK_BORDER_COLOR_MAX_ENUM = 0x7FFFFFFF -} VkBorderColor; - -typedef enum VkDescriptorType { - VK_DESCRIPTOR_TYPE_SAMPLER = 0, - VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 1, - VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 2, - VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 3, - VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 4, - VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 5, - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 6, - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 7, - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 8, - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 9, - VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 10, - VK_DESCRIPTOR_TYPE_BEGIN_RANGE = VK_DESCRIPTOR_TYPE_SAMPLER, - VK_DESCRIPTOR_TYPE_END_RANGE = VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, - VK_DESCRIPTOR_TYPE_RANGE_SIZE = (VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT - VK_DESCRIPTOR_TYPE_SAMPLER + 1), - VK_DESCRIPTOR_TYPE_MAX_ENUM = 0x7FFFFFFF -} VkDescriptorType; - -typedef enum VkAttachmentLoadOp { - VK_ATTACHMENT_LOAD_OP_LOAD = 0, - VK_ATTACHMENT_LOAD_OP_CLEAR = 1, - VK_ATTACHMENT_LOAD_OP_DONT_CARE = 2, - VK_ATTACHMENT_LOAD_OP_BEGIN_RANGE = VK_ATTACHMENT_LOAD_OP_LOAD, - VK_ATTACHMENT_LOAD_OP_END_RANGE = VK_ATTACHMENT_LOAD_OP_DONT_CARE, - VK_ATTACHMENT_LOAD_OP_RANGE_SIZE = (VK_ATTACHMENT_LOAD_OP_DONT_CARE - VK_ATTACHMENT_LOAD_OP_LOAD + 1), - VK_ATTACHMENT_LOAD_OP_MAX_ENUM = 0x7FFFFFFF -} VkAttachmentLoadOp; - -typedef enum VkAttachmentStoreOp { - VK_ATTACHMENT_STORE_OP_STORE = 0, - VK_ATTACHMENT_STORE_OP_DONT_CARE = 1, - VK_ATTACHMENT_STORE_OP_BEGIN_RANGE = VK_ATTACHMENT_STORE_OP_STORE, - VK_ATTACHMENT_STORE_OP_END_RANGE = VK_ATTACHMENT_STORE_OP_DONT_CARE, - VK_ATTACHMENT_STORE_OP_RANGE_SIZE = (VK_ATTACHMENT_STORE_OP_DONT_CARE - VK_ATTACHMENT_STORE_OP_STORE + 1), - VK_ATTACHMENT_STORE_OP_MAX_ENUM = 0x7FFFFFFF -} VkAttachmentStoreOp; - -typedef enum VkPipelineBindPoint { - VK_PIPELINE_BIND_POINT_GRAPHICS = 0, - VK_PIPELINE_BIND_POINT_COMPUTE = 1, - VK_PIPELINE_BIND_POINT_BEGIN_RANGE = VK_PIPELINE_BIND_POINT_GRAPHICS, - VK_PIPELINE_BIND_POINT_END_RANGE = VK_PIPELINE_BIND_POINT_COMPUTE, - VK_PIPELINE_BIND_POINT_RANGE_SIZE = (VK_PIPELINE_BIND_POINT_COMPUTE - VK_PIPELINE_BIND_POINT_GRAPHICS + 1), - VK_PIPELINE_BIND_POINT_MAX_ENUM = 0x7FFFFFFF -} VkPipelineBindPoint; - -typedef enum VkCommandBufferLevel { - VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0, - VK_COMMAND_BUFFER_LEVEL_SECONDARY = 1, - VK_COMMAND_BUFFER_LEVEL_BEGIN_RANGE = VK_COMMAND_BUFFER_LEVEL_PRIMARY, - VK_COMMAND_BUFFER_LEVEL_END_RANGE = VK_COMMAND_BUFFER_LEVEL_SECONDARY, - VK_COMMAND_BUFFER_LEVEL_RANGE_SIZE = (VK_COMMAND_BUFFER_LEVEL_SECONDARY - VK_COMMAND_BUFFER_LEVEL_PRIMARY + 1), - VK_COMMAND_BUFFER_LEVEL_MAX_ENUM = 0x7FFFFFFF -} VkCommandBufferLevel; - -typedef enum VkIndexType { - VK_INDEX_TYPE_UINT16 = 0, - VK_INDEX_TYPE_UINT32 = 1, - VK_INDEX_TYPE_BEGIN_RANGE = VK_INDEX_TYPE_UINT16, - VK_INDEX_TYPE_END_RANGE = VK_INDEX_TYPE_UINT32, - VK_INDEX_TYPE_RANGE_SIZE = (VK_INDEX_TYPE_UINT32 - VK_INDEX_TYPE_UINT16 + 1), - VK_INDEX_TYPE_MAX_ENUM = 0x7FFFFFFF -} VkIndexType; - -typedef enum VkSubpassContents { - VK_SUBPASS_CONTENTS_INLINE = 0, - VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 1, - VK_SUBPASS_CONTENTS_BEGIN_RANGE = VK_SUBPASS_CONTENTS_INLINE, - VK_SUBPASS_CONTENTS_END_RANGE = VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS, - VK_SUBPASS_CONTENTS_RANGE_SIZE = (VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS - VK_SUBPASS_CONTENTS_INLINE + 1), - VK_SUBPASS_CONTENTS_MAX_ENUM = 0x7FFFFFFF -} VkSubpassContents; - -typedef enum VkObjectType { - VK_OBJECT_TYPE_UNKNOWN = 0, - VK_OBJECT_TYPE_INSTANCE = 1, - VK_OBJECT_TYPE_PHYSICAL_DEVICE = 2, - VK_OBJECT_TYPE_DEVICE = 3, - VK_OBJECT_TYPE_QUEUE = 4, - VK_OBJECT_TYPE_SEMAPHORE = 5, - VK_OBJECT_TYPE_COMMAND_BUFFER = 6, - VK_OBJECT_TYPE_FENCE = 7, - VK_OBJECT_TYPE_DEVICE_MEMORY = 8, - VK_OBJECT_TYPE_BUFFER = 9, - VK_OBJECT_TYPE_IMAGE = 10, - VK_OBJECT_TYPE_EVENT = 11, - VK_OBJECT_TYPE_QUERY_POOL = 12, - VK_OBJECT_TYPE_BUFFER_VIEW = 13, - VK_OBJECT_TYPE_IMAGE_VIEW = 14, - VK_OBJECT_TYPE_SHADER_MODULE = 15, - VK_OBJECT_TYPE_PIPELINE_CACHE = 16, - VK_OBJECT_TYPE_PIPELINE_LAYOUT = 17, - VK_OBJECT_TYPE_RENDER_PASS = 18, - VK_OBJECT_TYPE_PIPELINE = 19, - VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT = 20, - VK_OBJECT_TYPE_SAMPLER = 21, - VK_OBJECT_TYPE_DESCRIPTOR_POOL = 22, - VK_OBJECT_TYPE_DESCRIPTOR_SET = 23, - VK_OBJECT_TYPE_FRAMEBUFFER = 24, - VK_OBJECT_TYPE_COMMAND_POOL = 25, - VK_OBJECT_TYPE_SURFACE_KHR = 1000000000, - VK_OBJECT_TYPE_SWAPCHAIN_KHR = 1000001000, - VK_OBJECT_TYPE_DISPLAY_KHR = 1000002000, - VK_OBJECT_TYPE_DISPLAY_MODE_KHR = 1000002001, - VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT = 1000011000, - VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR = 1000085000, - VK_OBJECT_TYPE_OBJECT_TABLE_NVX = 1000086000, - VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX = 1000086001, - VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR = 1000156000, - VK_OBJECT_TYPE_VALIDATION_CACHE_EXT = 1000160000, - VK_OBJECT_TYPE_BEGIN_RANGE = VK_OBJECT_TYPE_UNKNOWN, - VK_OBJECT_TYPE_END_RANGE = VK_OBJECT_TYPE_COMMAND_POOL, - VK_OBJECT_TYPE_RANGE_SIZE = (VK_OBJECT_TYPE_COMMAND_POOL - VK_OBJECT_TYPE_UNKNOWN + 1), - VK_OBJECT_TYPE_MAX_ENUM = 0x7FFFFFFF -} VkObjectType; - -typedef VkFlags VkInstanceCreateFlags; - -typedef enum VkFormatFeatureFlagBits { - VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, - VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, - VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, - VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, - VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, - VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, - VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, - VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, - VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, - VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, - VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, - VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000, - VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR = 0x00004000, - VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR = 0x00008000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT = 0x00010000, - VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT_KHR = 0x00020000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR = 0x00040000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR = 0x00080000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR = 0x00100000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR = 0x00200000, - VK_FORMAT_FEATURE_DISJOINT_BIT_KHR = 0x00400000, - VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR = 0x00800000, - VK_FORMAT_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkFormatFeatureFlagBits; -typedef VkFlags VkFormatFeatureFlags; - -typedef enum VkImageUsageFlagBits { - VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, - VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, - VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, - VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, - VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, - VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, - VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, - VK_IMAGE_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkImageUsageFlagBits; -typedef VkFlags VkImageUsageFlags; - -typedef enum VkImageCreateFlagBits { - VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, - VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, - VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 0x00000004, - VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, - VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010, - VK_IMAGE_CREATE_BIND_SFR_BIT_KHX = 0x00000040, - VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = 0x00000020, - VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR = 0x00000080, - VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR = 0x00000100, - VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT = 0x00001000, - VK_IMAGE_CREATE_DISJOINT_BIT_KHR = 0x00000200, - VK_IMAGE_CREATE_ALIAS_BIT_KHR = 0x00000400, - VK_IMAGE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkImageCreateFlagBits; -typedef VkFlags VkImageCreateFlags; - -typedef enum VkSampleCountFlagBits { - VK_SAMPLE_COUNT_1_BIT = 0x00000001, - VK_SAMPLE_COUNT_2_BIT = 0x00000002, - VK_SAMPLE_COUNT_4_BIT = 0x00000004, - VK_SAMPLE_COUNT_8_BIT = 0x00000008, - VK_SAMPLE_COUNT_16_BIT = 0x00000010, - VK_SAMPLE_COUNT_32_BIT = 0x00000020, - VK_SAMPLE_COUNT_64_BIT = 0x00000040, - VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkSampleCountFlagBits; -typedef VkFlags VkSampleCountFlags; - -typedef enum VkQueueFlagBits { - VK_QUEUE_GRAPHICS_BIT = 0x00000001, - VK_QUEUE_COMPUTE_BIT = 0x00000002, - VK_QUEUE_TRANSFER_BIT = 0x00000004, - VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, - VK_QUEUE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkQueueFlagBits; -typedef VkFlags VkQueueFlags; - -typedef enum VkMemoryPropertyFlagBits { - VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001, - VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002, - VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004, - VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008, - VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010, - VK_MEMORY_PROPERTY_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkMemoryPropertyFlagBits; -typedef VkFlags VkMemoryPropertyFlags; - -typedef enum VkMemoryHeapFlagBits { - VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001, - VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHX = 0x00000002, - VK_MEMORY_HEAP_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkMemoryHeapFlagBits; -typedef VkFlags VkMemoryHeapFlags; -typedef VkFlags VkDeviceCreateFlags; -typedef VkFlags VkDeviceQueueCreateFlags; - -typedef enum VkPipelineStageFlagBits { - VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, - VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, - VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, - VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, - VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, - VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, - VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, - VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, - VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, - VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, - VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, - VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000, - VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, - VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, - VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, - VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000, - VK_PIPELINE_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkPipelineStageFlagBits; -typedef VkFlags VkPipelineStageFlags; -typedef VkFlags VkMemoryMapFlags; - -typedef enum VkImageAspectFlagBits { - VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001, - VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002, - VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004, - VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008, - VK_IMAGE_ASPECT_PLANE_0_BIT_KHR = 0x00000010, - VK_IMAGE_ASPECT_PLANE_1_BIT_KHR = 0x00000020, - VK_IMAGE_ASPECT_PLANE_2_BIT_KHR = 0x00000040, - VK_IMAGE_ASPECT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkImageAspectFlagBits; -typedef VkFlags VkImageAspectFlags; - -typedef enum VkSparseImageFormatFlagBits { - VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, - VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT = 0x00000002, - VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, - VK_SPARSE_IMAGE_FORMAT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkSparseImageFormatFlagBits; -typedef VkFlags VkSparseImageFormatFlags; - -typedef enum VkSparseMemoryBindFlagBits { - VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001, - VK_SPARSE_MEMORY_BIND_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkSparseMemoryBindFlagBits; -typedef VkFlags VkSparseMemoryBindFlags; - -typedef enum VkFenceCreateFlagBits { - VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001, - VK_FENCE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkFenceCreateFlagBits; -typedef VkFlags VkFenceCreateFlags; -typedef VkFlags VkSemaphoreCreateFlags; -typedef VkFlags VkEventCreateFlags; -typedef VkFlags VkQueryPoolCreateFlags; - -typedef enum VkQueryPipelineStatisticFlagBits { - VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, - VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, - VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, - VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, - VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, - VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, - VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, - VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, - VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, - VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, - VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, - VK_QUERY_PIPELINE_STATISTIC_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkQueryPipelineStatisticFlagBits; -typedef VkFlags VkQueryPipelineStatisticFlags; - -typedef enum VkQueryResultFlagBits { - VK_QUERY_RESULT_64_BIT = 0x00000001, - VK_QUERY_RESULT_WAIT_BIT = 0x00000002, - VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, - VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, - VK_QUERY_RESULT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkQueryResultFlagBits; -typedef VkFlags VkQueryResultFlags; - -typedef enum VkBufferCreateFlagBits { - VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, - VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, - VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, - VK_BUFFER_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkBufferCreateFlagBits; -typedef VkFlags VkBufferCreateFlags; - -typedef enum VkBufferUsageFlagBits { - VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, - VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, - VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, - VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, - VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, - VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, - VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, - VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, - VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, - VK_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkBufferUsageFlagBits; -typedef VkFlags VkBufferUsageFlags; -typedef VkFlags VkBufferViewCreateFlags; -typedef VkFlags VkImageViewCreateFlags; -typedef VkFlags VkShaderModuleCreateFlags; -typedef VkFlags VkPipelineCacheCreateFlags; - -typedef enum VkPipelineCreateFlagBits { - VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001, - VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002, - VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004, - VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHX = 0x00000008, - VK_PIPELINE_CREATE_DISPATCH_BASE_KHX = 0x00000010, - VK_PIPELINE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkPipelineCreateFlagBits; -typedef VkFlags VkPipelineCreateFlags; -typedef VkFlags VkPipelineShaderStageCreateFlags; - -typedef enum VkShaderStageFlagBits { - VK_SHADER_STAGE_VERTEX_BIT = 0x00000001, - VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002, - VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004, - VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008, - VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010, - VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020, - VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F, - VK_SHADER_STAGE_ALL = 0x7FFFFFFF, - VK_SHADER_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkShaderStageFlagBits; -typedef VkFlags VkPipelineVertexInputStateCreateFlags; -typedef VkFlags VkPipelineInputAssemblyStateCreateFlags; -typedef VkFlags VkPipelineTessellationStateCreateFlags; -typedef VkFlags VkPipelineViewportStateCreateFlags; -typedef VkFlags VkPipelineRasterizationStateCreateFlags; - -typedef enum VkCullModeFlagBits { - VK_CULL_MODE_NONE = 0, - VK_CULL_MODE_FRONT_BIT = 0x00000001, - VK_CULL_MODE_BACK_BIT = 0x00000002, - VK_CULL_MODE_FRONT_AND_BACK = 0x00000003, - VK_CULL_MODE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkCullModeFlagBits; -typedef VkFlags VkCullModeFlags; -typedef VkFlags VkPipelineMultisampleStateCreateFlags; -typedef VkFlags VkPipelineDepthStencilStateCreateFlags; -typedef VkFlags VkPipelineColorBlendStateCreateFlags; - -typedef enum VkColorComponentFlagBits { - VK_COLOR_COMPONENT_R_BIT = 0x00000001, - VK_COLOR_COMPONENT_G_BIT = 0x00000002, - VK_COLOR_COMPONENT_B_BIT = 0x00000004, - VK_COLOR_COMPONENT_A_BIT = 0x00000008, - VK_COLOR_COMPONENT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkColorComponentFlagBits; -typedef VkFlags VkColorComponentFlags; -typedef VkFlags VkPipelineDynamicStateCreateFlags; -typedef VkFlags VkPipelineLayoutCreateFlags; -typedef VkFlags VkShaderStageFlags; -typedef VkFlags VkSamplerCreateFlags; - -typedef enum VkDescriptorSetLayoutCreateFlagBits { - VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR = 0x00000001, - VK_DESCRIPTOR_SET_LAYOUT_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkDescriptorSetLayoutCreateFlagBits; -typedef VkFlags VkDescriptorSetLayoutCreateFlags; - -typedef enum VkDescriptorPoolCreateFlagBits { - VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001, - VK_DESCRIPTOR_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkDescriptorPoolCreateFlagBits; -typedef VkFlags VkDescriptorPoolCreateFlags; -typedef VkFlags VkDescriptorPoolResetFlags; -typedef VkFlags VkFramebufferCreateFlags; -typedef VkFlags VkRenderPassCreateFlags; - -typedef enum VkAttachmentDescriptionFlagBits { - VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT = 0x00000001, - VK_ATTACHMENT_DESCRIPTION_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkAttachmentDescriptionFlagBits; -typedef VkFlags VkAttachmentDescriptionFlags; - -typedef enum VkSubpassDescriptionFlagBits { - VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX = 0x00000001, - VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX = 0x00000002, - VK_SUBPASS_DESCRIPTION_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkSubpassDescriptionFlagBits; -typedef VkFlags VkSubpassDescriptionFlags; - -typedef enum VkAccessFlagBits { - VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001, - VK_ACCESS_INDEX_READ_BIT = 0x00000002, - VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004, - VK_ACCESS_UNIFORM_READ_BIT = 0x00000008, - VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010, - VK_ACCESS_SHADER_READ_BIT = 0x00000020, - VK_ACCESS_SHADER_WRITE_BIT = 0x00000040, - VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080, - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100, - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200, - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400, - VK_ACCESS_TRANSFER_READ_BIT = 0x00000800, - VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000, - VK_ACCESS_HOST_READ_BIT = 0x00002000, - VK_ACCESS_HOST_WRITE_BIT = 0x00004000, - VK_ACCESS_MEMORY_READ_BIT = 0x00008000, - VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000, - VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000, - VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000, - VK_ACCESS_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT = 0x00080000, - VK_ACCESS_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkAccessFlagBits; -typedef VkFlags VkAccessFlags; - -typedef enum VkDependencyFlagBits { - VK_DEPENDENCY_BY_REGION_BIT = 0x00000001, - VK_DEPENDENCY_VIEW_LOCAL_BIT_KHX = 0x00000002, - VK_DEPENDENCY_DEVICE_GROUP_BIT_KHX = 0x00000004, - VK_DEPENDENCY_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkDependencyFlagBits; -typedef VkFlags VkDependencyFlags; - -typedef enum VkCommandPoolCreateFlagBits { - VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, - VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, - VK_COMMAND_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkCommandPoolCreateFlagBits; -typedef VkFlags VkCommandPoolCreateFlags; - -typedef enum VkCommandPoolResetFlagBits { - VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, - VK_COMMAND_POOL_RESET_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkCommandPoolResetFlagBits; -typedef VkFlags VkCommandPoolResetFlags; - -typedef enum VkCommandBufferUsageFlagBits { - VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001, - VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002, - VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004, - VK_COMMAND_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkCommandBufferUsageFlagBits; -typedef VkFlags VkCommandBufferUsageFlags; - -typedef enum VkQueryControlFlagBits { - VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001, - VK_QUERY_CONTROL_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkQueryControlFlagBits; -typedef VkFlags VkQueryControlFlags; - -typedef enum VkCommandBufferResetFlagBits { - VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, - VK_COMMAND_BUFFER_RESET_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkCommandBufferResetFlagBits; -typedef VkFlags VkCommandBufferResetFlags; - -typedef enum VkStencilFaceFlagBits { - VK_STENCIL_FACE_FRONT_BIT = 0x00000001, - VK_STENCIL_FACE_BACK_BIT = 0x00000002, - VK_STENCIL_FRONT_AND_BACK = 0x00000003, - VK_STENCIL_FACE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VkStencilFaceFlagBits; -typedef VkFlags VkStencilFaceFlags; - -typedef struct VkApplicationInfo { - VkStructureType sType; - const void* pNext; - const char* pApplicationName; - uint32_t applicationVersion; - const char* pEngineName; - uint32_t engineVersion; - uint32_t apiVersion; -} VkApplicationInfo; - -typedef struct VkInstanceCreateInfo { - VkStructureType sType; - const void* pNext; - VkInstanceCreateFlags flags; - const VkApplicationInfo* pApplicationInfo; - uint32_t enabledLayerCount; - const char* const* ppEnabledLayerNames; - uint32_t enabledExtensionCount; - const char* const* ppEnabledExtensionNames; -} VkInstanceCreateInfo; - -typedef void* (VKAPI_PTR *PFN_vkAllocationFunction)( - void* pUserData, - size_t size, - size_t alignment, - VkSystemAllocationScope allocationScope); - -typedef void* (VKAPI_PTR *PFN_vkReallocationFunction)( - void* pUserData, - void* pOriginal, - size_t size, - size_t alignment, - VkSystemAllocationScope allocationScope); - -typedef void (VKAPI_PTR *PFN_vkFreeFunction)( - void* pUserData, - void* pMemory); - -typedef void (VKAPI_PTR *PFN_vkInternalAllocationNotification)( - void* pUserData, - size_t size, - VkInternalAllocationType allocationType, - VkSystemAllocationScope allocationScope); - -typedef void (VKAPI_PTR *PFN_vkInternalFreeNotification)( - void* pUserData, - size_t size, - VkInternalAllocationType allocationType, - VkSystemAllocationScope allocationScope); - -typedef struct VkAllocationCallbacks { - void* pUserData; - PFN_vkAllocationFunction pfnAllocation; - PFN_vkReallocationFunction pfnReallocation; - PFN_vkFreeFunction pfnFree; - PFN_vkInternalAllocationNotification pfnInternalAllocation; - PFN_vkInternalFreeNotification pfnInternalFree; -} VkAllocationCallbacks; - -typedef struct VkPhysicalDeviceFeatures { - VkBool32 robustBufferAccess; - VkBool32 fullDrawIndexUint32; - VkBool32 imageCubeArray; - VkBool32 independentBlend; - VkBool32 geometryShader; - VkBool32 tessellationShader; - VkBool32 sampleRateShading; - VkBool32 dualSrcBlend; - VkBool32 logicOp; - VkBool32 multiDrawIndirect; - VkBool32 drawIndirectFirstInstance; - VkBool32 depthClamp; - VkBool32 depthBiasClamp; - VkBool32 fillModeNonSolid; - VkBool32 depthBounds; - VkBool32 wideLines; - VkBool32 largePoints; - VkBool32 alphaToOne; - VkBool32 multiViewport; - VkBool32 samplerAnisotropy; - VkBool32 textureCompressionETC2; - VkBool32 textureCompressionASTC_LDR; - VkBool32 textureCompressionBC; - VkBool32 occlusionQueryPrecise; - VkBool32 pipelineStatisticsQuery; - VkBool32 vertexPipelineStoresAndAtomics; - VkBool32 fragmentStoresAndAtomics; - VkBool32 shaderTessellationAndGeometryPointSize; - VkBool32 shaderImageGatherExtended; - VkBool32 shaderStorageImageExtendedFormats; - VkBool32 shaderStorageImageMultisample; - VkBool32 shaderStorageImageReadWithoutFormat; - VkBool32 shaderStorageImageWriteWithoutFormat; - VkBool32 shaderUniformBufferArrayDynamicIndexing; - VkBool32 shaderSampledImageArrayDynamicIndexing; - VkBool32 shaderStorageBufferArrayDynamicIndexing; - VkBool32 shaderStorageImageArrayDynamicIndexing; - VkBool32 shaderClipDistance; - VkBool32 shaderCullDistance; - VkBool32 shaderFloat64; - VkBool32 shaderInt64; - VkBool32 shaderInt16; - VkBool32 shaderResourceResidency; - VkBool32 shaderResourceMinLod; - VkBool32 sparseBinding; - VkBool32 sparseResidencyBuffer; - VkBool32 sparseResidencyImage2D; - VkBool32 sparseResidencyImage3D; - VkBool32 sparseResidency2Samples; - VkBool32 sparseResidency4Samples; - VkBool32 sparseResidency8Samples; - VkBool32 sparseResidency16Samples; - VkBool32 sparseResidencyAliased; - VkBool32 variableMultisampleRate; - VkBool32 inheritedQueries; -} VkPhysicalDeviceFeatures; - -typedef struct VkFormatProperties { - VkFormatFeatureFlags linearTilingFeatures; - VkFormatFeatureFlags optimalTilingFeatures; - VkFormatFeatureFlags bufferFeatures; -} VkFormatProperties; - -typedef struct VkExtent3D { - uint32_t width; - uint32_t height; - uint32_t depth; -} VkExtent3D; - -typedef struct VkImageFormatProperties { - VkExtent3D maxExtent; - uint32_t maxMipLevels; - uint32_t maxArrayLayers; - VkSampleCountFlags sampleCounts; - VkDeviceSize maxResourceSize; -} VkImageFormatProperties; - -typedef struct VkPhysicalDeviceLimits { - uint32_t maxImageDimension1D; - uint32_t maxImageDimension2D; - uint32_t maxImageDimension3D; - uint32_t maxImageDimensionCube; - uint32_t maxImageArrayLayers; - uint32_t maxTexelBufferElements; - uint32_t maxUniformBufferRange; - uint32_t maxStorageBufferRange; - uint32_t maxPushConstantsSize; - uint32_t maxMemoryAllocationCount; - uint32_t maxSamplerAllocationCount; - VkDeviceSize bufferImageGranularity; - VkDeviceSize sparseAddressSpaceSize; - uint32_t maxBoundDescriptorSets; - uint32_t maxPerStageDescriptorSamplers; - uint32_t maxPerStageDescriptorUniformBuffers; - uint32_t maxPerStageDescriptorStorageBuffers; - uint32_t maxPerStageDescriptorSampledImages; - uint32_t maxPerStageDescriptorStorageImages; - uint32_t maxPerStageDescriptorInputAttachments; - uint32_t maxPerStageResources; - uint32_t maxDescriptorSetSamplers; - uint32_t maxDescriptorSetUniformBuffers; - uint32_t maxDescriptorSetUniformBuffersDynamic; - uint32_t maxDescriptorSetStorageBuffers; - uint32_t maxDescriptorSetStorageBuffersDynamic; - uint32_t maxDescriptorSetSampledImages; - uint32_t maxDescriptorSetStorageImages; - uint32_t maxDescriptorSetInputAttachments; - uint32_t maxVertexInputAttributes; - uint32_t maxVertexInputBindings; - uint32_t maxVertexInputAttributeOffset; - uint32_t maxVertexInputBindingStride; - uint32_t maxVertexOutputComponents; - uint32_t maxTessellationGenerationLevel; - uint32_t maxTessellationPatchSize; - uint32_t maxTessellationControlPerVertexInputComponents; - uint32_t maxTessellationControlPerVertexOutputComponents; - uint32_t maxTessellationControlPerPatchOutputComponents; - uint32_t maxTessellationControlTotalOutputComponents; - uint32_t maxTessellationEvaluationInputComponents; - uint32_t maxTessellationEvaluationOutputComponents; - uint32_t maxGeometryShaderInvocations; - uint32_t maxGeometryInputComponents; - uint32_t maxGeometryOutputComponents; - uint32_t maxGeometryOutputVertices; - uint32_t maxGeometryTotalOutputComponents; - uint32_t maxFragmentInputComponents; - uint32_t maxFragmentOutputAttachments; - uint32_t maxFragmentDualSrcAttachments; - uint32_t maxFragmentCombinedOutputResources; - uint32_t maxComputeSharedMemorySize; - uint32_t maxComputeWorkGroupCount[3]; - uint32_t maxComputeWorkGroupInvocations; - uint32_t maxComputeWorkGroupSize[3]; - uint32_t subPixelPrecisionBits; - uint32_t subTexelPrecisionBits; - uint32_t mipmapPrecisionBits; - uint32_t maxDrawIndexedIndexValue; - uint32_t maxDrawIndirectCount; - float maxSamplerLodBias; - float maxSamplerAnisotropy; - uint32_t maxViewports; - uint32_t maxViewportDimensions[2]; - float viewportBoundsRange[2]; - uint32_t viewportSubPixelBits; - size_t minMemoryMapAlignment; - VkDeviceSize minTexelBufferOffsetAlignment; - VkDeviceSize minUniformBufferOffsetAlignment; - VkDeviceSize minStorageBufferOffsetAlignment; - int32_t minTexelOffset; - uint32_t maxTexelOffset; - int32_t minTexelGatherOffset; - uint32_t maxTexelGatherOffset; - float minInterpolationOffset; - float maxInterpolationOffset; - uint32_t subPixelInterpolationOffsetBits; - uint32_t maxFramebufferWidth; - uint32_t maxFramebufferHeight; - uint32_t maxFramebufferLayers; - VkSampleCountFlags framebufferColorSampleCounts; - VkSampleCountFlags framebufferDepthSampleCounts; - VkSampleCountFlags framebufferStencilSampleCounts; - VkSampleCountFlags framebufferNoAttachmentsSampleCounts; - uint32_t maxColorAttachments; - VkSampleCountFlags sampledImageColorSampleCounts; - VkSampleCountFlags sampledImageIntegerSampleCounts; - VkSampleCountFlags sampledImageDepthSampleCounts; - VkSampleCountFlags sampledImageStencilSampleCounts; - VkSampleCountFlags storageImageSampleCounts; - uint32_t maxSampleMaskWords; - VkBool32 timestampComputeAndGraphics; - float timestampPeriod; - uint32_t maxClipDistances; - uint32_t maxCullDistances; - uint32_t maxCombinedClipAndCullDistances; - uint32_t discreteQueuePriorities; - float pointSizeRange[2]; - float lineWidthRange[2]; - float pointSizeGranularity; - float lineWidthGranularity; - VkBool32 strictLines; - VkBool32 standardSampleLocations; - VkDeviceSize optimalBufferCopyOffsetAlignment; - VkDeviceSize optimalBufferCopyRowPitchAlignment; - VkDeviceSize nonCoherentAtomSize; -} VkPhysicalDeviceLimits; - -typedef struct VkPhysicalDeviceSparseProperties { - VkBool32 residencyStandard2DBlockShape; - VkBool32 residencyStandard2DMultisampleBlockShape; - VkBool32 residencyStandard3DBlockShape; - VkBool32 residencyAlignedMipSize; - VkBool32 residencyNonResidentStrict; -} VkPhysicalDeviceSparseProperties; - -typedef struct VkPhysicalDeviceProperties { - uint32_t apiVersion; - uint32_t driverVersion; - uint32_t vendorID; - uint32_t deviceID; - VkPhysicalDeviceType deviceType; - char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE]; - uint8_t pipelineCacheUUID[VK_UUID_SIZE]; - VkPhysicalDeviceLimits limits; - VkPhysicalDeviceSparseProperties sparseProperties; -} VkPhysicalDeviceProperties; - -typedef struct VkQueueFamilyProperties { - VkQueueFlags queueFlags; - uint32_t queueCount; - uint32_t timestampValidBits; - VkExtent3D minImageTransferGranularity; -} VkQueueFamilyProperties; - -typedef struct VkMemoryType { - VkMemoryPropertyFlags propertyFlags; - uint32_t heapIndex; -} VkMemoryType; - -typedef struct VkMemoryHeap { - VkDeviceSize size; - VkMemoryHeapFlags flags; -} VkMemoryHeap; - -typedef struct VkPhysicalDeviceMemoryProperties { - uint32_t memoryTypeCount; - VkMemoryType memoryTypes[VK_MAX_MEMORY_TYPES]; - uint32_t memoryHeapCount; - VkMemoryHeap memoryHeaps[VK_MAX_MEMORY_HEAPS]; -} VkPhysicalDeviceMemoryProperties; - -typedef void (VKAPI_PTR *PFN_vkVoidFunction)(void); -typedef struct VkDeviceQueueCreateInfo { - VkStructureType sType; - const void* pNext; - VkDeviceQueueCreateFlags flags; - uint32_t queueFamilyIndex; - uint32_t queueCount; - const float* pQueuePriorities; -} VkDeviceQueueCreateInfo; - -typedef struct VkDeviceCreateInfo { - VkStructureType sType; - const void* pNext; - VkDeviceCreateFlags flags; - uint32_t queueCreateInfoCount; - const VkDeviceQueueCreateInfo* pQueueCreateInfos; - uint32_t enabledLayerCount; - const char* const* ppEnabledLayerNames; - uint32_t enabledExtensionCount; - const char* const* ppEnabledExtensionNames; - const VkPhysicalDeviceFeatures* pEnabledFeatures; -} VkDeviceCreateInfo; - -typedef struct VkExtensionProperties { - char extensionName[VK_MAX_EXTENSION_NAME_SIZE]; - uint32_t specVersion; -} VkExtensionProperties; - -typedef struct VkLayerProperties { - char layerName[VK_MAX_EXTENSION_NAME_SIZE]; - uint32_t specVersion; - uint32_t implementationVersion; - char description[VK_MAX_DESCRIPTION_SIZE]; -} VkLayerProperties; - -typedef struct VkSubmitInfo { - VkStructureType sType; - const void* pNext; - uint32_t waitSemaphoreCount; - const VkSemaphore* pWaitSemaphores; - const VkPipelineStageFlags* pWaitDstStageMask; - uint32_t commandBufferCount; - const VkCommandBuffer* pCommandBuffers; - uint32_t signalSemaphoreCount; - const VkSemaphore* pSignalSemaphores; -} VkSubmitInfo; - -typedef struct VkMemoryAllocateInfo { - VkStructureType sType; - const void* pNext; - VkDeviceSize allocationSize; - uint32_t memoryTypeIndex; -} VkMemoryAllocateInfo; - -typedef struct VkMappedMemoryRange { - VkStructureType sType; - const void* pNext; - VkDeviceMemory memory; - VkDeviceSize offset; - VkDeviceSize size; -} VkMappedMemoryRange; - -typedef struct VkMemoryRequirements { - VkDeviceSize size; - VkDeviceSize alignment; - uint32_t memoryTypeBits; -} VkMemoryRequirements; - -typedef struct VkSparseImageFormatProperties { - VkImageAspectFlags aspectMask; - VkExtent3D imageGranularity; - VkSparseImageFormatFlags flags; -} VkSparseImageFormatProperties; - -typedef struct VkSparseImageMemoryRequirements { - VkSparseImageFormatProperties formatProperties; - uint32_t imageMipTailFirstLod; - VkDeviceSize imageMipTailSize; - VkDeviceSize imageMipTailOffset; - VkDeviceSize imageMipTailStride; -} VkSparseImageMemoryRequirements; - -typedef struct VkSparseMemoryBind { - VkDeviceSize resourceOffset; - VkDeviceSize size; - VkDeviceMemory memory; - VkDeviceSize memoryOffset; - VkSparseMemoryBindFlags flags; -} VkSparseMemoryBind; - -typedef struct VkSparseBufferMemoryBindInfo { - VkBuffer buffer; - uint32_t bindCount; - const VkSparseMemoryBind* pBinds; -} VkSparseBufferMemoryBindInfo; - -typedef struct VkSparseImageOpaqueMemoryBindInfo { - VkImage image; - uint32_t bindCount; - const VkSparseMemoryBind* pBinds; -} VkSparseImageOpaqueMemoryBindInfo; - -typedef struct VkImageSubresource { - VkImageAspectFlags aspectMask; - uint32_t mipLevel; - uint32_t arrayLayer; -} VkImageSubresource; - -typedef struct VkOffset3D { - int32_t x; - int32_t y; - int32_t z; -} VkOffset3D; - -typedef struct VkSparseImageMemoryBind { - VkImageSubresource subresource; - VkOffset3D offset; - VkExtent3D extent; - VkDeviceMemory memory; - VkDeviceSize memoryOffset; - VkSparseMemoryBindFlags flags; -} VkSparseImageMemoryBind; - -typedef struct VkSparseImageMemoryBindInfo { - VkImage image; - uint32_t bindCount; - const VkSparseImageMemoryBind* pBinds; -} VkSparseImageMemoryBindInfo; -typedef struct VkBindSparseInfo { - VkStructureType sType; - const void* pNext; - uint32_t waitSemaphoreCount; - const VkSemaphore* pWaitSemaphores; - uint32_t bufferBindCount; - const VkSparseBufferMemoryBindInfo* pBufferBinds; - uint32_t imageOpaqueBindCount; - const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds; - uint32_t imageBindCount; - const VkSparseImageMemoryBindInfo* pImageBinds; - uint32_t signalSemaphoreCount; - const VkSemaphore* pSignalSemaphores; -} VkBindSparseInfo; -typedef struct VkFenceCreateInfo { - VkStructureType sType; - const void* pNext; - VkFenceCreateFlags flags; -} VkFenceCreateInfo; - -typedef struct VkSemaphoreCreateInfo { - VkStructureType sType; - const void* pNext; - VkSemaphoreCreateFlags flags; -} VkSemaphoreCreateInfo; - -typedef struct VkEventCreateInfo { - VkStructureType sType; - const void* pNext; - VkEventCreateFlags flags; -} VkEventCreateInfo; - -typedef struct VkQueryPoolCreateInfo { - VkStructureType sType; - const void* pNext; - VkQueryPoolCreateFlags flags; - VkQueryType queryType; - uint32_t queryCount; - VkQueryPipelineStatisticFlags pipelineStatistics; -} VkQueryPoolCreateInfo; - -typedef struct VkBufferCreateInfo { - VkStructureType sType; - const void* pNext; - VkBufferCreateFlags flags; - VkDeviceSize size; - VkBufferUsageFlags usage; - VkSharingMode sharingMode; - uint32_t queueFamilyIndexCount; - const uint32_t* pQueueFamilyIndices; -} VkBufferCreateInfo; - -typedef struct VkBufferViewCreateInfo { - VkStructureType sType; - const void* pNext; - VkBufferViewCreateFlags flags; - VkBuffer buffer; - VkFormat format; - VkDeviceSize offset; - VkDeviceSize range; -} VkBufferViewCreateInfo; - -typedef struct VkImageCreateInfo { - VkStructureType sType; - const void* pNext; - VkImageCreateFlags flags; - VkImageType imageType; - VkFormat format; - VkExtent3D extent; - uint32_t mipLevels; - uint32_t arrayLayers; - VkSampleCountFlagBits samples; - VkImageTiling tiling; - VkImageUsageFlags usage; - VkSharingMode sharingMode; - uint32_t queueFamilyIndexCount; - const uint32_t* pQueueFamilyIndices; - VkImageLayout initialLayout; -} VkImageCreateInfo; - -typedef struct VkSubresourceLayout { - VkDeviceSize offset; - VkDeviceSize size; - VkDeviceSize rowPitch; - VkDeviceSize arrayPitch; - VkDeviceSize depthPitch; -} VkSubresourceLayout; - -typedef struct VkComponentMapping { - VkComponentSwizzle r; - VkComponentSwizzle g; - VkComponentSwizzle b; - VkComponentSwizzle a; -} VkComponentMapping; - -typedef struct VkImageSubresourceRange { - VkImageAspectFlags aspectMask; - uint32_t baseMipLevel; - uint32_t levelCount; - uint32_t baseArrayLayer; - uint32_t layerCount; -} VkImageSubresourceRange; - -typedef struct VkImageViewCreateInfo { - VkStructureType sType; - const void* pNext; - VkImageViewCreateFlags flags; - VkImage image; - VkImageViewType viewType; - VkFormat format; - VkComponentMapping components; - VkImageSubresourceRange subresourceRange; -} VkImageViewCreateInfo; - -typedef struct VkShaderModuleCreateInfo { - VkStructureType sType; - const void* pNext; - VkShaderModuleCreateFlags flags; - size_t codeSize; - const uint32_t* pCode; -} VkShaderModuleCreateInfo; - -typedef struct VkPipelineCacheCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineCacheCreateFlags flags; - size_t initialDataSize; - const void* pInitialData; -} VkPipelineCacheCreateInfo; - -typedef struct VkSpecializationMapEntry { - uint32_t constantID; - uint32_t offset; - size_t size; -} VkSpecializationMapEntry; - -typedef struct VkSpecializationInfo { - uint32_t mapEntryCount; - const VkSpecializationMapEntry* pMapEntries; - size_t dataSize; - const void* pData; -} VkSpecializationInfo; - -typedef struct VkPipelineShaderStageCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineShaderStageCreateFlags flags; - VkShaderStageFlagBits stage; - VkShaderModule module; - const char* pName; - const VkSpecializationInfo* pSpecializationInfo; -} VkPipelineShaderStageCreateInfo; - -typedef struct VkVertexInputBindingDescription { - uint32_t binding; - uint32_t stride; - VkVertexInputRate inputRate; -} VkVertexInputBindingDescription; - -typedef struct VkVertexInputAttributeDescription { - uint32_t location; - uint32_t binding; - VkFormat format; - uint32_t offset; -} VkVertexInputAttributeDescription; - -typedef struct VkPipelineVertexInputStateCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineVertexInputStateCreateFlags flags; - uint32_t vertexBindingDescriptionCount; - const VkVertexInputBindingDescription* pVertexBindingDescriptions; - uint32_t vertexAttributeDescriptionCount; - const VkVertexInputAttributeDescription* pVertexAttributeDescriptions; -} VkPipelineVertexInputStateCreateInfo; - -typedef struct VkPipelineInputAssemblyStateCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineInputAssemblyStateCreateFlags flags; - VkPrimitiveTopology topology; - VkBool32 primitiveRestartEnable; -} VkPipelineInputAssemblyStateCreateInfo; - -typedef struct VkPipelineTessellationStateCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineTessellationStateCreateFlags flags; - uint32_t patchControlPoints; -} VkPipelineTessellationStateCreateInfo; - -typedef struct VkViewport { - float x; - float y; - float width; - float height; - float minDepth; - float maxDepth; -} VkViewport; - -typedef struct VkOffset2D { - int32_t x; - int32_t y; -} VkOffset2D; - -typedef struct VkExtent2D { - uint32_t width; - uint32_t height; -} VkExtent2D; - -typedef struct VkRect2D { - VkOffset2D offset; - VkExtent2D extent; -} VkRect2D; - -typedef struct VkPipelineViewportStateCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineViewportStateCreateFlags flags; - uint32_t viewportCount; - const VkViewport* pViewports; - uint32_t scissorCount; - const VkRect2D* pScissors; -} VkPipelineViewportStateCreateInfo; - -typedef struct VkPipelineRasterizationStateCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineRasterizationStateCreateFlags flags; - VkBool32 depthClampEnable; - VkBool32 rasterizerDiscardEnable; - VkPolygonMode polygonMode; - VkCullModeFlags cullMode; - VkFrontFace frontFace; - VkBool32 depthBiasEnable; - float depthBiasConstantFactor; - float depthBiasClamp; - float depthBiasSlopeFactor; - float lineWidth; -} VkPipelineRasterizationStateCreateInfo; - -typedef struct VkPipelineMultisampleStateCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineMultisampleStateCreateFlags flags; - VkSampleCountFlagBits rasterizationSamples; - VkBool32 sampleShadingEnable; - float minSampleShading; - const VkSampleMask* pSampleMask; - VkBool32 alphaToCoverageEnable; - VkBool32 alphaToOneEnable; -} VkPipelineMultisampleStateCreateInfo; - -typedef struct VkStencilOpState { - VkStencilOp failOp; - VkStencilOp passOp; - VkStencilOp depthFailOp; - VkCompareOp compareOp; - uint32_t compareMask; - uint32_t writeMask; - uint32_t reference; -} VkStencilOpState; - -typedef struct VkPipelineDepthStencilStateCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineDepthStencilStateCreateFlags flags; - VkBool32 depthTestEnable; - VkBool32 depthWriteEnable; - VkCompareOp depthCompareOp; - VkBool32 depthBoundsTestEnable; - VkBool32 stencilTestEnable; - VkStencilOpState front; - VkStencilOpState back; - float minDepthBounds; - float maxDepthBounds; -} VkPipelineDepthStencilStateCreateInfo; - -typedef struct VkPipelineColorBlendAttachmentState { - VkBool32 blendEnable; - VkBlendFactor srcColorBlendFactor; - VkBlendFactor dstColorBlendFactor; - VkBlendOp colorBlendOp; - VkBlendFactor srcAlphaBlendFactor; - VkBlendFactor dstAlphaBlendFactor; - VkBlendOp alphaBlendOp; - VkColorComponentFlags colorWriteMask; -} VkPipelineColorBlendAttachmentState; - -typedef struct VkPipelineColorBlendStateCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineColorBlendStateCreateFlags flags; - VkBool32 logicOpEnable; - VkLogicOp logicOp; - uint32_t attachmentCount; - const VkPipelineColorBlendAttachmentState* pAttachments; - float blendConstants[4]; -} VkPipelineColorBlendStateCreateInfo; - -typedef struct VkPipelineDynamicStateCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineDynamicStateCreateFlags flags; - uint32_t dynamicStateCount; - const VkDynamicState* pDynamicStates; -} VkPipelineDynamicStateCreateInfo; - -typedef struct VkGraphicsPipelineCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineCreateFlags flags; - uint32_t stageCount; - const VkPipelineShaderStageCreateInfo* pStages; - const VkPipelineVertexInputStateCreateInfo* pVertexInputState; - const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState; - const VkPipelineTessellationStateCreateInfo* pTessellationState; - const VkPipelineViewportStateCreateInfo* pViewportState; - const VkPipelineRasterizationStateCreateInfo* pRasterizationState; - const VkPipelineMultisampleStateCreateInfo* pMultisampleState; - const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState; - const VkPipelineColorBlendStateCreateInfo* pColorBlendState; - const VkPipelineDynamicStateCreateInfo* pDynamicState; - VkPipelineLayout layout; - VkRenderPass renderPass; - uint32_t subpass; - VkPipeline basePipelineHandle; - int32_t basePipelineIndex; -} VkGraphicsPipelineCreateInfo; - -typedef struct VkComputePipelineCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineCreateFlags flags; - VkPipelineShaderStageCreateInfo stage; - VkPipelineLayout layout; - VkPipeline basePipelineHandle; - int32_t basePipelineIndex; -} VkComputePipelineCreateInfo; - -typedef struct VkPushConstantRange { - VkShaderStageFlags stageFlags; - uint32_t offset; - uint32_t size; -} VkPushConstantRange; - -typedef struct VkPipelineLayoutCreateInfo { - VkStructureType sType; - const void* pNext; - VkPipelineLayoutCreateFlags flags; - uint32_t setLayoutCount; - const VkDescriptorSetLayout* pSetLayouts; - uint32_t pushConstantRangeCount; - const VkPushConstantRange* pPushConstantRanges; -} VkPipelineLayoutCreateInfo; - -typedef struct VkSamplerCreateInfo { - VkStructureType sType; - const void* pNext; - VkSamplerCreateFlags flags; - VkFilter magFilter; - VkFilter minFilter; - VkSamplerMipmapMode mipmapMode; - VkSamplerAddressMode addressModeU; - VkSamplerAddressMode addressModeV; - VkSamplerAddressMode addressModeW; - float mipLodBias; - VkBool32 anisotropyEnable; - float maxAnisotropy; - VkBool32 compareEnable; - VkCompareOp compareOp; - float minLod; - float maxLod; - VkBorderColor borderColor; - VkBool32 unnormalizedCoordinates; -} VkSamplerCreateInfo; - -typedef struct VkDescriptorSetLayoutBinding { - uint32_t binding; - VkDescriptorType descriptorType; - uint32_t descriptorCount; - VkShaderStageFlags stageFlags; - const VkSampler* pImmutableSamplers; -} VkDescriptorSetLayoutBinding; - -typedef struct VkDescriptorSetLayoutCreateInfo { - VkStructureType sType; - const void* pNext; - VkDescriptorSetLayoutCreateFlags flags; - uint32_t bindingCount; - const VkDescriptorSetLayoutBinding* pBindings; -} VkDescriptorSetLayoutCreateInfo; - -typedef struct VkDescriptorPoolSize { - VkDescriptorType type; - uint32_t descriptorCount; -} VkDescriptorPoolSize; - -typedef struct VkDescriptorPoolCreateInfo { - VkStructureType sType; - const void* pNext; - VkDescriptorPoolCreateFlags flags; - uint32_t maxSets; - uint32_t poolSizeCount; - const VkDescriptorPoolSize* pPoolSizes; -} VkDescriptorPoolCreateInfo; - -typedef struct VkDescriptorSetAllocateInfo { - VkStructureType sType; - const void* pNext; - VkDescriptorPool descriptorPool; - uint32_t descriptorSetCount; - const VkDescriptorSetLayout* pSetLayouts; -} VkDescriptorSetAllocateInfo; - -typedef struct VkDescriptorImageInfo { - VkSampler sampler; - VkImageView imageView; - VkImageLayout imageLayout; -} VkDescriptorImageInfo; - -typedef struct VkDescriptorBufferInfo { - VkBuffer buffer; - VkDeviceSize offset; - VkDeviceSize range; -} VkDescriptorBufferInfo; - -typedef struct VkWriteDescriptorSet { - VkStructureType sType; - const void* pNext; - VkDescriptorSet dstSet; - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; - VkDescriptorType descriptorType; - const VkDescriptorImageInfo* pImageInfo; - const VkDescriptorBufferInfo* pBufferInfo; - const VkBufferView* pTexelBufferView; -} VkWriteDescriptorSet; - -typedef struct VkCopyDescriptorSet { - VkStructureType sType; - const void* pNext; - VkDescriptorSet srcSet; - uint32_t srcBinding; - uint32_t srcArrayElement; - VkDescriptorSet dstSet; - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; -} VkCopyDescriptorSet; - -typedef struct VkFramebufferCreateInfo { - VkStructureType sType; - const void* pNext; - VkFramebufferCreateFlags flags; - VkRenderPass renderPass; - uint32_t attachmentCount; - const VkImageView* pAttachments; - uint32_t width; - uint32_t height; - uint32_t layers; -} VkFramebufferCreateInfo; - -typedef struct VkAttachmentDescription { - VkAttachmentDescriptionFlags flags; - VkFormat format; - VkSampleCountFlagBits samples; - VkAttachmentLoadOp loadOp; - VkAttachmentStoreOp storeOp; - VkAttachmentLoadOp stencilLoadOp; - VkAttachmentStoreOp stencilStoreOp; - VkImageLayout initialLayout; - VkImageLayout finalLayout; -} VkAttachmentDescription; - -typedef struct VkAttachmentReference { - uint32_t attachment; - VkImageLayout layout; -} VkAttachmentReference; - -typedef struct VkSubpassDescription { - VkSubpassDescriptionFlags flags; - VkPipelineBindPoint pipelineBindPoint; - uint32_t inputAttachmentCount; - const VkAttachmentReference* pInputAttachments; - uint32_t colorAttachmentCount; - const VkAttachmentReference* pColorAttachments; - const VkAttachmentReference* pResolveAttachments; - const VkAttachmentReference* pDepthStencilAttachment; - uint32_t preserveAttachmentCount; - const uint32_t* pPreserveAttachments; -} VkSubpassDescription; - -typedef struct VkSubpassDependency { - uint32_t srcSubpass; - uint32_t dstSubpass; - VkPipelineStageFlags srcStageMask; - VkPipelineStageFlags dstStageMask; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - VkDependencyFlags dependencyFlags; -} VkSubpassDependency; - -typedef struct VkRenderPassCreateInfo { - VkStructureType sType; - const void* pNext; - VkRenderPassCreateFlags flags; - uint32_t attachmentCount; - const VkAttachmentDescription* pAttachments; - uint32_t subpassCount; - const VkSubpassDescription* pSubpasses; - uint32_t dependencyCount; - const VkSubpassDependency* pDependencies; -} VkRenderPassCreateInfo; - -typedef struct VkCommandPoolCreateInfo { - VkStructureType sType; - const void* pNext; - VkCommandPoolCreateFlags flags; - uint32_t queueFamilyIndex; -} VkCommandPoolCreateInfo; - -typedef struct VkCommandBufferAllocateInfo { - VkStructureType sType; - const void* pNext; - VkCommandPool commandPool; - VkCommandBufferLevel level; - uint32_t commandBufferCount; -} VkCommandBufferAllocateInfo; - -typedef struct VkCommandBufferInheritanceInfo { - VkStructureType sType; - const void* pNext; - VkRenderPass renderPass; - uint32_t subpass; - VkFramebuffer framebuffer; - VkBool32 occlusionQueryEnable; - VkQueryControlFlags queryFlags; - VkQueryPipelineStatisticFlags pipelineStatistics; -} VkCommandBufferInheritanceInfo; - -typedef struct VkCommandBufferBeginInfo { - VkStructureType sType; - const void* pNext; - VkCommandBufferUsageFlags flags; - const VkCommandBufferInheritanceInfo* pInheritanceInfo; -} VkCommandBufferBeginInfo; - -typedef struct VkBufferCopy { - VkDeviceSize srcOffset; - VkDeviceSize dstOffset; - VkDeviceSize size; -} VkBufferCopy; - -typedef struct VkImageSubresourceLayers { - VkImageAspectFlags aspectMask; - uint32_t mipLevel; - uint32_t baseArrayLayer; - uint32_t layerCount; -} VkImageSubresourceLayers; - -typedef struct VkImageCopy { - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffset; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffset; - VkExtent3D extent; -} VkImageCopy; - -typedef struct VkImageBlit { - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffsets[2]; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffsets[2]; -} VkImageBlit; - -typedef struct VkBufferImageCopy { - VkDeviceSize bufferOffset; - uint32_t bufferRowLength; - uint32_t bufferImageHeight; - VkImageSubresourceLayers imageSubresource; - VkOffset3D imageOffset; - VkExtent3D imageExtent; -} VkBufferImageCopy; - -typedef union VkClearColorValue { - float float32[4]; - int32_t int32[4]; - uint32_t uint32[4]; -} VkClearColorValue; - -typedef struct VkClearDepthStencilValue { - float depth; - uint32_t stencil; -} VkClearDepthStencilValue; - -typedef union VkClearValue { - VkClearColorValue color; - VkClearDepthStencilValue depthStencil; -} VkClearValue; - -typedef struct VkClearAttachment { - VkImageAspectFlags aspectMask; - uint32_t colorAttachment; - VkClearValue clearValue; -} VkClearAttachment; - -typedef struct VkClearRect { - VkRect2D rect; - uint32_t baseArrayLayer; - uint32_t layerCount; -} VkClearRect; - -typedef struct VkImageResolve { - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffset; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffset; - VkExtent3D extent; -} VkImageResolve; - -typedef struct VkMemoryBarrier { - VkStructureType sType; - const void* pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; -} VkMemoryBarrier; - -typedef struct VkBufferMemoryBarrier { - VkStructureType sType; - const void* pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkBuffer buffer; - VkDeviceSize offset; - VkDeviceSize size; -} VkBufferMemoryBarrier; - -typedef struct VkImageMemoryBarrier { - VkStructureType sType; - const void* pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - VkImageLayout oldLayout; - VkImageLayout newLayout; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkImage image; - VkImageSubresourceRange subresourceRange; -} VkImageMemoryBarrier; - -typedef struct VkRenderPassBeginInfo { - VkStructureType sType; - const void* pNext; - VkRenderPass renderPass; - VkFramebuffer framebuffer; - VkRect2D renderArea; - uint32_t clearValueCount; - const VkClearValue* pClearValues; -} VkRenderPassBeginInfo; - -typedef struct VkDispatchIndirectCommand { - uint32_t x; - uint32_t y; - uint32_t z; -} VkDispatchIndirectCommand; - -typedef struct VkDrawIndexedIndirectCommand { - uint32_t indexCount; - uint32_t instanceCount; - uint32_t firstIndex; - int32_t vertexOffset; - uint32_t firstInstance; -} VkDrawIndexedIndirectCommand; - -typedef struct VkDrawIndirectCommand { - uint32_t vertexCount; - uint32_t instanceCount; - uint32_t firstVertex; - uint32_t firstInstance; -} VkDrawIndirectCommand; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateInstance)(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance); -typedef void (VKAPI_PTR *PFN_vkDestroyInstance)(VkInstance instance, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDevices)(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFeatures)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties)(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMemoryProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties); -typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vkGetInstanceProcAddr)(VkInstance instance, const char* pName); -typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vkGetDeviceProcAddr)(VkDevice device, const char* pName); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDevice)(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice); -typedef void (VKAPI_PTR *PFN_vkDestroyDevice)(VkDevice device, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkEnumerateInstanceExtensionProperties)(const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties); -typedef VkResult (VKAPI_PTR *PFN_vkEnumerateDeviceExtensionProperties)(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties); -typedef VkResult (VKAPI_PTR *PFN_vkEnumerateInstanceLayerProperties)(uint32_t* pPropertyCount, VkLayerProperties* pProperties); -typedef VkResult (VKAPI_PTR *PFN_vkEnumerateDeviceLayerProperties)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkLayerProperties* pProperties); -typedef void (VKAPI_PTR *PFN_vkGetDeviceQueue)(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue); -typedef VkResult (VKAPI_PTR *PFN_vkQueueSubmit)(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence); -typedef VkResult (VKAPI_PTR *PFN_vkQueueWaitIdle)(VkQueue queue); -typedef VkResult (VKAPI_PTR *PFN_vkDeviceWaitIdle)(VkDevice device); -typedef VkResult (VKAPI_PTR *PFN_vkAllocateMemory)(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory); -typedef void (VKAPI_PTR *PFN_vkFreeMemory)(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkMapMemory)(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData); -typedef void (VKAPI_PTR *PFN_vkUnmapMemory)(VkDevice device, VkDeviceMemory memory); -typedef VkResult (VKAPI_PTR *PFN_vkFlushMappedMemoryRanges)(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges); -typedef VkResult (VKAPI_PTR *PFN_vkInvalidateMappedMemoryRanges)(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges); -typedef void (VKAPI_PTR *PFN_vkGetDeviceMemoryCommitment)(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes); -typedef VkResult (VKAPI_PTR *PFN_vkBindBufferMemory)(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset); -typedef VkResult (VKAPI_PTR *PFN_vkBindImageMemory)(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset); -typedef void (VKAPI_PTR *PFN_vkGetBufferMemoryRequirements)(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements); -typedef void (VKAPI_PTR *PFN_vkGetImageMemoryRequirements)(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements); -typedef void (VKAPI_PTR *PFN_vkGetImageSparseMemoryRequirements)(VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties); -typedef VkResult (VKAPI_PTR *PFN_vkQueueBindSparse)(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence); -typedef VkResult (VKAPI_PTR *PFN_vkCreateFence)(VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence); -typedef void (VKAPI_PTR *PFN_vkDestroyFence)(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkResetFences)(VkDevice device, uint32_t fenceCount, const VkFence* pFences); -typedef VkResult (VKAPI_PTR *PFN_vkGetFenceStatus)(VkDevice device, VkFence fence); -typedef VkResult (VKAPI_PTR *PFN_vkWaitForFences)(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout); -typedef VkResult (VKAPI_PTR *PFN_vkCreateSemaphore)(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore); -typedef void (VKAPI_PTR *PFN_vkDestroySemaphore)(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreateEvent)(VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkEvent* pEvent); -typedef void (VKAPI_PTR *PFN_vkDestroyEvent)(VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkGetEventStatus)(VkDevice device, VkEvent event); -typedef VkResult (VKAPI_PTR *PFN_vkSetEvent)(VkDevice device, VkEvent event); -typedef VkResult (VKAPI_PTR *PFN_vkResetEvent)(VkDevice device, VkEvent event); -typedef VkResult (VKAPI_PTR *PFN_vkCreateQueryPool)(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool); -typedef void (VKAPI_PTR *PFN_vkDestroyQueryPool)(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkGetQueryPoolResults)(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags); -typedef VkResult (VKAPI_PTR *PFN_vkCreateBuffer)(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer); -typedef void (VKAPI_PTR *PFN_vkDestroyBuffer)(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreateBufferView)(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferView* pView); -typedef void (VKAPI_PTR *PFN_vkDestroyBufferView)(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreateImage)(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage); -typedef void (VKAPI_PTR *PFN_vkDestroyImage)(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator); -typedef void (VKAPI_PTR *PFN_vkGetImageSubresourceLayout)(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout); -typedef VkResult (VKAPI_PTR *PFN_vkCreateImageView)(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView); -typedef void (VKAPI_PTR *PFN_vkDestroyImageView)(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreateShaderModule)(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule); -typedef void (VKAPI_PTR *PFN_vkDestroyShaderModule)(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreatePipelineCache)(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache); -typedef void (VKAPI_PTR *PFN_vkDestroyPipelineCache)(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkGetPipelineCacheData)(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData); -typedef VkResult (VKAPI_PTR *PFN_vkMergePipelineCaches)(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches); -typedef VkResult (VKAPI_PTR *PFN_vkCreateGraphicsPipelines)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines); -typedef VkResult (VKAPI_PTR *PFN_vkCreateComputePipelines)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines); -typedef void (VKAPI_PTR *PFN_vkDestroyPipeline)(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreatePipelineLayout)(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout); -typedef void (VKAPI_PTR *PFN_vkDestroyPipelineLayout)(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreateSampler)(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSampler* pSampler); -typedef void (VKAPI_PTR *PFN_vkDestroySampler)(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorSetLayout)(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout); -typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorSetLayout)(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorPool)(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool); -typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkResetDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags); -typedef VkResult (VKAPI_PTR *PFN_vkAllocateDescriptorSets)(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets); -typedef VkResult (VKAPI_PTR *PFN_vkFreeDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets); -typedef void (VKAPI_PTR *PFN_vkUpdateDescriptorSets)(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies); -typedef VkResult (VKAPI_PTR *PFN_vkCreateFramebuffer)(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer); -typedef void (VKAPI_PTR *PFN_vkDestroyFramebuffer)(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreateRenderPass)(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass); -typedef void (VKAPI_PTR *PFN_vkDestroyRenderPass)(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator); -typedef void (VKAPI_PTR *PFN_vkGetRenderAreaGranularity)(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity); -typedef VkResult (VKAPI_PTR *PFN_vkCreateCommandPool)(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool); -typedef void (VKAPI_PTR *PFN_vkDestroyCommandPool)(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkResetCommandPool)(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags); -typedef VkResult (VKAPI_PTR *PFN_vkAllocateCommandBuffers)(VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers); -typedef void (VKAPI_PTR *PFN_vkFreeCommandBuffers)(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers); -typedef VkResult (VKAPI_PTR *PFN_vkBeginCommandBuffer)(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo); -typedef VkResult (VKAPI_PTR *PFN_vkEndCommandBuffer)(VkCommandBuffer commandBuffer); -typedef VkResult (VKAPI_PTR *PFN_vkResetCommandBuffer)(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags); -typedef void (VKAPI_PTR *PFN_vkCmdBindPipeline)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline); -typedef void (VKAPI_PTR *PFN_vkCmdSetViewport)(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports); -typedef void (VKAPI_PTR *PFN_vkCmdSetScissor)(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors); -typedef void (VKAPI_PTR *PFN_vkCmdSetLineWidth)(VkCommandBuffer commandBuffer, float lineWidth); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBias)(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor); -typedef void (VKAPI_PTR *PFN_vkCmdSetBlendConstants)(VkCommandBuffer commandBuffer, const float blendConstants[4]); -typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBounds)(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds); -typedef void (VKAPI_PTR *PFN_vkCmdSetStencilCompareMask)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask); -typedef void (VKAPI_PTR *PFN_vkCmdSetStencilWriteMask)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask); -typedef void (VKAPI_PTR *PFN_vkCmdSetStencilReference)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference); -typedef void (VKAPI_PTR *PFN_vkCmdBindDescriptorSets)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets); -typedef void (VKAPI_PTR *PFN_vkCmdBindIndexBuffer)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType); -typedef void (VKAPI_PTR *PFN_vkCmdBindVertexBuffers)(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets); -typedef void (VKAPI_PTR *PFN_vkCmdDraw)(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexed)(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexedIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); -typedef void (VKAPI_PTR *PFN_vkCmdDispatch)(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); -typedef void (VKAPI_PTR *PFN_vkCmdDispatchIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); -typedef void (VKAPI_PTR *PFN_vkCmdCopyBuffer)(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy* pRegions); -typedef void (VKAPI_PTR *PFN_vkCmdCopyImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions); -typedef void (VKAPI_PTR *PFN_vkCmdBlitImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkFilter filter); -typedef void (VKAPI_PTR *PFN_vkCmdCopyBufferToImage)(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions); -typedef void (VKAPI_PTR *PFN_vkCmdCopyImageToBuffer)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions); -typedef void (VKAPI_PTR *PFN_vkCmdUpdateBuffer)(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void* pData); -typedef void (VKAPI_PTR *PFN_vkCmdFillBuffer)(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data); -typedef void (VKAPI_PTR *PFN_vkCmdClearColorImage)(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges); -typedef void (VKAPI_PTR *PFN_vkCmdClearDepthStencilImage)(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges); -typedef void (VKAPI_PTR *PFN_vkCmdClearAttachments)(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects); -typedef void (VKAPI_PTR *PFN_vkCmdResolveImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve* pRegions); -typedef void (VKAPI_PTR *PFN_vkCmdSetEvent)(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); -typedef void (VKAPI_PTR *PFN_vkCmdResetEvent)(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); -typedef void (VKAPI_PTR *PFN_vkCmdWaitEvents)(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers); -typedef void (VKAPI_PTR *PFN_vkCmdPipelineBarrier)(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers); -typedef void (VKAPI_PTR *PFN_vkCmdBeginQuery)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags); -typedef void (VKAPI_PTR *PFN_vkCmdEndQuery)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query); -typedef void (VKAPI_PTR *PFN_vkCmdResetQueryPool)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount); -typedef void (VKAPI_PTR *PFN_vkCmdWriteTimestamp)(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query); -typedef void (VKAPI_PTR *PFN_vkCmdCopyQueryPoolResults)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags); -typedef void (VKAPI_PTR *PFN_vkCmdPushConstants)(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues); -typedef void (VKAPI_PTR *PFN_vkCmdBeginRenderPass)(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents); -typedef void (VKAPI_PTR *PFN_vkCmdNextSubpass)(VkCommandBuffer commandBuffer, VkSubpassContents contents); -typedef void (VKAPI_PTR *PFN_vkCmdEndRenderPass)(VkCommandBuffer commandBuffer); -typedef void (VKAPI_PTR *PFN_vkCmdExecuteCommands)(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance( - const VkInstanceCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkInstance* pInstance); - -VKAPI_ATTR void VKAPI_CALL vkDestroyInstance( - VkInstance instance, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDevices( - VkInstance instance, - uint32_t* pPhysicalDeviceCount, - VkPhysicalDevice* pPhysicalDevices); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceFeatures* pFeatures); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties( - VkPhysicalDevice physicalDevice, - VkFormat format, - VkFormatProperties* pFormatProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties( - VkPhysicalDevice physicalDevice, - VkFormat format, - VkImageType type, - VkImageTiling tiling, - VkImageUsageFlags usage, - VkImageCreateFlags flags, - VkImageFormatProperties* pImageFormatProperties); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceProperties* pProperties); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties( - VkPhysicalDevice physicalDevice, - uint32_t* pQueueFamilyPropertyCount, - VkQueueFamilyProperties* pQueueFamilyProperties); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceMemoryProperties* pMemoryProperties); - -VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr( - VkInstance instance, - const char* pName); - -VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr( - VkDevice device, - const char* pName); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice( - VkPhysicalDevice physicalDevice, - const VkDeviceCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkDevice* pDevice); - -VKAPI_ATTR void VKAPI_CALL vkDestroyDevice( - VkDevice device, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionProperties( - const char* pLayerName, - uint32_t* pPropertyCount, - VkExtensionProperties* pProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties( - VkPhysicalDevice physicalDevice, - const char* pLayerName, - uint32_t* pPropertyCount, - VkExtensionProperties* pProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties( - uint32_t* pPropertyCount, - VkLayerProperties* pProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceLayerProperties( - VkPhysicalDevice physicalDevice, - uint32_t* pPropertyCount, - VkLayerProperties* pProperties); - -VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue( - VkDevice device, - uint32_t queueFamilyIndex, - uint32_t queueIndex, - VkQueue* pQueue); - -VKAPI_ATTR VkResult VKAPI_CALL vkQueueSubmit( - VkQueue queue, - uint32_t submitCount, - const VkSubmitInfo* pSubmits, - VkFence fence); - -VKAPI_ATTR VkResult VKAPI_CALL vkQueueWaitIdle( - VkQueue queue); - -VKAPI_ATTR VkResult VKAPI_CALL vkDeviceWaitIdle( - VkDevice device); - -VKAPI_ATTR VkResult VKAPI_CALL vkAllocateMemory( - VkDevice device, - const VkMemoryAllocateInfo* pAllocateInfo, - const VkAllocationCallbacks* pAllocator, - VkDeviceMemory* pMemory); - -VKAPI_ATTR void VKAPI_CALL vkFreeMemory( - VkDevice device, - VkDeviceMemory memory, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkMapMemory( - VkDevice device, - VkDeviceMemory memory, - VkDeviceSize offset, - VkDeviceSize size, - VkMemoryMapFlags flags, - void** ppData); - -VKAPI_ATTR void VKAPI_CALL vkUnmapMemory( - VkDevice device, - VkDeviceMemory memory); - -VKAPI_ATTR VkResult VKAPI_CALL vkFlushMappedMemoryRanges( - VkDevice device, - uint32_t memoryRangeCount, - const VkMappedMemoryRange* pMemoryRanges); - -VKAPI_ATTR VkResult VKAPI_CALL vkInvalidateMappedMemoryRanges( - VkDevice device, - uint32_t memoryRangeCount, - const VkMappedMemoryRange* pMemoryRanges); +#ifdef VK_USE_PLATFORM_IOS_MVK +#include "vulkan_ios.h" +#endif -VKAPI_ATTR void VKAPI_CALL vkGetDeviceMemoryCommitment( - VkDevice device, - VkDeviceMemory memory, - VkDeviceSize* pCommittedMemoryInBytes); -VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory( - VkDevice device, - VkBuffer buffer, - VkDeviceMemory memory, - VkDeviceSize memoryOffset); +#ifdef VK_USE_PLATFORM_MACOS_MVK +#include "vulkan_macos.h" +#endif -VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory( - VkDevice device, - VkImage image, - VkDeviceMemory memory, - VkDeviceSize memoryOffset); -VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements( - VkDevice device, - VkBuffer buffer, - VkMemoryRequirements* pMemoryRequirements); +#ifdef VK_USE_PLATFORM_MIR_KHR +#include +#include "vulkan_mir.h" +#endif -VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements( - VkDevice device, - VkImage image, - VkMemoryRequirements* pMemoryRequirements); -VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements( - VkDevice device, - VkImage image, - uint32_t* pSparseMemoryRequirementCount, - VkSparseImageMemoryRequirements* pSparseMemoryRequirements); +#ifdef VK_USE_PLATFORM_VI_NN +#include "vulkan_vi.h" +#endif -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties( - VkPhysicalDevice physicalDevice, - VkFormat format, - VkImageType type, - VkSampleCountFlagBits samples, - VkImageUsageFlags usage, - VkImageTiling tiling, - uint32_t* pPropertyCount, - VkSparseImageFormatProperties* pProperties); -VKAPI_ATTR VkResult VKAPI_CALL vkQueueBindSparse( - VkQueue queue, - uint32_t bindInfoCount, - const VkBindSparseInfo* pBindInfo, - VkFence fence); +#ifdef VK_USE_PLATFORM_WAYLAND_KHR +#include +#include "vulkan_wayland.h" +#endif -VKAPI_ATTR VkResult VKAPI_CALL vkCreateFence( - VkDevice device, - const VkFenceCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkFence* pFence); -VKAPI_ATTR void VKAPI_CALL vkDestroyFence( - VkDevice device, - VkFence fence, - const VkAllocationCallbacks* pAllocator); +#ifdef VK_USE_PLATFORM_WIN32_KHR +#include +#include "vulkan_win32.h" +#endif -VKAPI_ATTR VkResult VKAPI_CALL vkResetFences( - VkDevice device, - uint32_t fenceCount, - const VkFence* pFences); -VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceStatus( - VkDevice device, - VkFence fence); +#ifdef VK_USE_PLATFORM_XCB_KHR +#include +#include "vulkan_xcb.h" +#endif -VKAPI_ATTR VkResult VKAPI_CALL vkWaitForFences( - VkDevice device, - uint32_t fenceCount, - const VkFence* pFences, - VkBool32 waitAll, - uint64_t timeout); -VKAPI_ATTR VkResult VKAPI_CALL vkCreateSemaphore( - VkDevice device, - const VkSemaphoreCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSemaphore* pSemaphore); +#ifdef VK_USE_PLATFORM_XLIB_KHR +#include +#include "vulkan_xlib.h" +#endif -VKAPI_ATTR void VKAPI_CALL vkDestroySemaphore( - VkDevice device, - VkSemaphore semaphore, - const VkAllocationCallbacks* pAllocator); -VKAPI_ATTR VkResult VKAPI_CALL vkCreateEvent( - VkDevice device, - const VkEventCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkEvent* pEvent); +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT +#include +#include +#include "vulkan_xlib_xrandr.h" +#endif -VKAPI_ATTR void VKAPI_CALL vkDestroyEvent( - VkDevice device, - VkEvent event, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetEventStatus( - VkDevice device, - VkEvent event); - -VKAPI_ATTR VkResult VKAPI_CALL vkSetEvent( - VkDevice device, - VkEvent event); - -VKAPI_ATTR VkResult VKAPI_CALL vkResetEvent( - VkDevice device, - VkEvent event); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateQueryPool( - VkDevice device, - const VkQueryPoolCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkQueryPool* pQueryPool); - -VKAPI_ATTR void VKAPI_CALL vkDestroyQueryPool( - VkDevice device, - VkQueryPool queryPool, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetQueryPoolResults( - VkDevice device, - VkQueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount, - size_t dataSize, - void* pData, - VkDeviceSize stride, - VkQueryResultFlags flags); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateBuffer( - VkDevice device, - const VkBufferCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkBuffer* pBuffer); - -VKAPI_ATTR void VKAPI_CALL vkDestroyBuffer( - VkDevice device, - VkBuffer buffer, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferView( - VkDevice device, - const VkBufferViewCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkBufferView* pView); - -VKAPI_ATTR void VKAPI_CALL vkDestroyBufferView( - VkDevice device, - VkBufferView bufferView, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateImage( - VkDevice device, - const VkImageCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkImage* pImage); - -VKAPI_ATTR void VKAPI_CALL vkDestroyImage( - VkDevice device, - VkImage image, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR void VKAPI_CALL vkGetImageSubresourceLayout( - VkDevice device, - VkImage image, - const VkImageSubresource* pSubresource, - VkSubresourceLayout* pLayout); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateImageView( - VkDevice device, - const VkImageViewCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkImageView* pView); - -VKAPI_ATTR void VKAPI_CALL vkDestroyImageView( - VkDevice device, - VkImageView imageView, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateShaderModule( - VkDevice device, - const VkShaderModuleCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkShaderModule* pShaderModule); - -VKAPI_ATTR void VKAPI_CALL vkDestroyShaderModule( - VkDevice device, - VkShaderModule shaderModule, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineCache( - VkDevice device, - const VkPipelineCacheCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkPipelineCache* pPipelineCache); - -VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineCache( - VkDevice device, - VkPipelineCache pipelineCache, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelineCacheData( - VkDevice device, - VkPipelineCache pipelineCache, - size_t* pDataSize, - void* pData); - -VKAPI_ATTR VkResult VKAPI_CALL vkMergePipelineCaches( - VkDevice device, - VkPipelineCache dstCache, - uint32_t srcCacheCount, - const VkPipelineCache* pSrcCaches); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateGraphicsPipelines( - VkDevice device, - VkPipelineCache pipelineCache, - uint32_t createInfoCount, - const VkGraphicsPipelineCreateInfo* pCreateInfos, - const VkAllocationCallbacks* pAllocator, - VkPipeline* pPipelines); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateComputePipelines( - VkDevice device, - VkPipelineCache pipelineCache, - uint32_t createInfoCount, - const VkComputePipelineCreateInfo* pCreateInfos, - const VkAllocationCallbacks* pAllocator, - VkPipeline* pPipelines); - -VKAPI_ATTR void VKAPI_CALL vkDestroyPipeline( - VkDevice device, - VkPipeline pipeline, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineLayout( - VkDevice device, - const VkPipelineLayoutCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkPipelineLayout* pPipelineLayout); - -VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineLayout( - VkDevice device, - VkPipelineLayout pipelineLayout, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateSampler( - VkDevice device, - const VkSamplerCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSampler* pSampler); - -VKAPI_ATTR void VKAPI_CALL vkDestroySampler( - VkDevice device, - VkSampler sampler, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorSetLayout( - VkDevice device, - const VkDescriptorSetLayoutCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkDescriptorSetLayout* pSetLayout); - -VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorSetLayout( - VkDevice device, - VkDescriptorSetLayout descriptorSetLayout, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorPool( - VkDevice device, - const VkDescriptorPoolCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkDescriptorPool* pDescriptorPool); - -VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorPool( - VkDevice device, - VkDescriptorPool descriptorPool, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkResetDescriptorPool( - VkDevice device, - VkDescriptorPool descriptorPool, - VkDescriptorPoolResetFlags flags); - -VKAPI_ATTR VkResult VKAPI_CALL vkAllocateDescriptorSets( - VkDevice device, - const VkDescriptorSetAllocateInfo* pAllocateInfo, - VkDescriptorSet* pDescriptorSets); - -VKAPI_ATTR VkResult VKAPI_CALL vkFreeDescriptorSets( - VkDevice device, - VkDescriptorPool descriptorPool, - uint32_t descriptorSetCount, - const VkDescriptorSet* pDescriptorSets); - -VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSets( - VkDevice device, - uint32_t descriptorWriteCount, - const VkWriteDescriptorSet* pDescriptorWrites, - uint32_t descriptorCopyCount, - const VkCopyDescriptorSet* pDescriptorCopies); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateFramebuffer( - VkDevice device, - const VkFramebufferCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkFramebuffer* pFramebuffer); - -VKAPI_ATTR void VKAPI_CALL vkDestroyFramebuffer( - VkDevice device, - VkFramebuffer framebuffer, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass( - VkDevice device, - const VkRenderPassCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkRenderPass* pRenderPass); - -VKAPI_ATTR void VKAPI_CALL vkDestroyRenderPass( - VkDevice device, - VkRenderPass renderPass, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR void VKAPI_CALL vkGetRenderAreaGranularity( - VkDevice device, - VkRenderPass renderPass, - VkExtent2D* pGranularity); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateCommandPool( - VkDevice device, - const VkCommandPoolCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkCommandPool* pCommandPool); - -VKAPI_ATTR void VKAPI_CALL vkDestroyCommandPool( - VkDevice device, - VkCommandPool commandPool, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandPool( - VkDevice device, - VkCommandPool commandPool, - VkCommandPoolResetFlags flags); - -VKAPI_ATTR VkResult VKAPI_CALL vkAllocateCommandBuffers( - VkDevice device, - const VkCommandBufferAllocateInfo* pAllocateInfo, - VkCommandBuffer* pCommandBuffers); - -VKAPI_ATTR void VKAPI_CALL vkFreeCommandBuffers( - VkDevice device, - VkCommandPool commandPool, - uint32_t commandBufferCount, - const VkCommandBuffer* pCommandBuffers); - -VKAPI_ATTR VkResult VKAPI_CALL vkBeginCommandBuffer( - VkCommandBuffer commandBuffer, - const VkCommandBufferBeginInfo* pBeginInfo); - -VKAPI_ATTR VkResult VKAPI_CALL vkEndCommandBuffer( - VkCommandBuffer commandBuffer); - -VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandBuffer( - VkCommandBuffer commandBuffer, - VkCommandBufferResetFlags flags); - -VKAPI_ATTR void VKAPI_CALL vkCmdBindPipeline( - VkCommandBuffer commandBuffer, - VkPipelineBindPoint pipelineBindPoint, - VkPipeline pipeline); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetViewport( - VkCommandBuffer commandBuffer, - uint32_t firstViewport, - uint32_t viewportCount, - const VkViewport* pViewports); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetScissor( - VkCommandBuffer commandBuffer, - uint32_t firstScissor, - uint32_t scissorCount, - const VkRect2D* pScissors); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetLineWidth( - VkCommandBuffer commandBuffer, - float lineWidth); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBias( - VkCommandBuffer commandBuffer, - float depthBiasConstantFactor, - float depthBiasClamp, - float depthBiasSlopeFactor); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetBlendConstants( - VkCommandBuffer commandBuffer, - const float blendConstants[4]); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBounds( - VkCommandBuffer commandBuffer, - float minDepthBounds, - float maxDepthBounds); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilCompareMask( - VkCommandBuffer commandBuffer, - VkStencilFaceFlags faceMask, - uint32_t compareMask); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilWriteMask( - VkCommandBuffer commandBuffer, - VkStencilFaceFlags faceMask, - uint32_t writeMask); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilReference( - VkCommandBuffer commandBuffer, - VkStencilFaceFlags faceMask, - uint32_t reference); - -VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorSets( - VkCommandBuffer commandBuffer, - VkPipelineBindPoint pipelineBindPoint, - VkPipelineLayout layout, - uint32_t firstSet, - uint32_t descriptorSetCount, - const VkDescriptorSet* pDescriptorSets, - uint32_t dynamicOffsetCount, - const uint32_t* pDynamicOffsets); - -VKAPI_ATTR void VKAPI_CALL vkCmdBindIndexBuffer( - VkCommandBuffer commandBuffer, - VkBuffer buffer, - VkDeviceSize offset, - VkIndexType indexType); - -VKAPI_ATTR void VKAPI_CALL vkCmdBindVertexBuffers( - VkCommandBuffer commandBuffer, - uint32_t firstBinding, - uint32_t bindingCount, - const VkBuffer* pBuffers, - const VkDeviceSize* pOffsets); - -VKAPI_ATTR void VKAPI_CALL vkCmdDraw( - VkCommandBuffer commandBuffer, - uint32_t vertexCount, - uint32_t instanceCount, - uint32_t firstVertex, - uint32_t firstInstance); - -VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexed( - VkCommandBuffer commandBuffer, - uint32_t indexCount, - uint32_t instanceCount, - uint32_t firstIndex, - int32_t vertexOffset, - uint32_t firstInstance); - -VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirect( - VkCommandBuffer commandBuffer, - VkBuffer buffer, - VkDeviceSize offset, - uint32_t drawCount, - uint32_t stride); - -VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirect( - VkCommandBuffer commandBuffer, - VkBuffer buffer, - VkDeviceSize offset, - uint32_t drawCount, - uint32_t stride); - -VKAPI_ATTR void VKAPI_CALL vkCmdDispatch( - VkCommandBuffer commandBuffer, - uint32_t groupCountX, - uint32_t groupCountY, - uint32_t groupCountZ); - -VKAPI_ATTR void VKAPI_CALL vkCmdDispatchIndirect( - VkCommandBuffer commandBuffer, - VkBuffer buffer, - VkDeviceSize offset); - -VKAPI_ATTR void VKAPI_CALL vkCmdCopyBuffer( - VkCommandBuffer commandBuffer, - VkBuffer srcBuffer, - VkBuffer dstBuffer, - uint32_t regionCount, - const VkBufferCopy* pRegions); - -VKAPI_ATTR void VKAPI_CALL vkCmdCopyImage( - VkCommandBuffer commandBuffer, - VkImage srcImage, - VkImageLayout srcImageLayout, - VkImage dstImage, - VkImageLayout dstImageLayout, - uint32_t regionCount, - const VkImageCopy* pRegions); - -VKAPI_ATTR void VKAPI_CALL vkCmdBlitImage( - VkCommandBuffer commandBuffer, - VkImage srcImage, - VkImageLayout srcImageLayout, - VkImage dstImage, - VkImageLayout dstImageLayout, - uint32_t regionCount, - const VkImageBlit* pRegions, - VkFilter filter); - -VKAPI_ATTR void VKAPI_CALL vkCmdCopyBufferToImage( - VkCommandBuffer commandBuffer, - VkBuffer srcBuffer, - VkImage dstImage, - VkImageLayout dstImageLayout, - uint32_t regionCount, - const VkBufferImageCopy* pRegions); - -VKAPI_ATTR void VKAPI_CALL vkCmdCopyImageToBuffer( - VkCommandBuffer commandBuffer, - VkImage srcImage, - VkImageLayout srcImageLayout, - VkBuffer dstBuffer, - uint32_t regionCount, - const VkBufferImageCopy* pRegions); - -VKAPI_ATTR void VKAPI_CALL vkCmdUpdateBuffer( - VkCommandBuffer commandBuffer, - VkBuffer dstBuffer, - VkDeviceSize dstOffset, - VkDeviceSize dataSize, - const void* pData); - -VKAPI_ATTR void VKAPI_CALL vkCmdFillBuffer( - VkCommandBuffer commandBuffer, - VkBuffer dstBuffer, - VkDeviceSize dstOffset, - VkDeviceSize size, - uint32_t data); - -VKAPI_ATTR void VKAPI_CALL vkCmdClearColorImage( - VkCommandBuffer commandBuffer, - VkImage image, - VkImageLayout imageLayout, - const VkClearColorValue* pColor, - uint32_t rangeCount, - const VkImageSubresourceRange* pRanges); - -VKAPI_ATTR void VKAPI_CALL vkCmdClearDepthStencilImage( - VkCommandBuffer commandBuffer, - VkImage image, - VkImageLayout imageLayout, - const VkClearDepthStencilValue* pDepthStencil, - uint32_t rangeCount, - const VkImageSubresourceRange* pRanges); - -VKAPI_ATTR void VKAPI_CALL vkCmdClearAttachments( - VkCommandBuffer commandBuffer, - uint32_t attachmentCount, - const VkClearAttachment* pAttachments, - uint32_t rectCount, - const VkClearRect* pRects); - -VKAPI_ATTR void VKAPI_CALL vkCmdResolveImage( - VkCommandBuffer commandBuffer, - VkImage srcImage, - VkImageLayout srcImageLayout, - VkImage dstImage, - VkImageLayout dstImageLayout, - uint32_t regionCount, - const VkImageResolve* pRegions); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetEvent( - VkCommandBuffer commandBuffer, - VkEvent event, - VkPipelineStageFlags stageMask); - -VKAPI_ATTR void VKAPI_CALL vkCmdResetEvent( - VkCommandBuffer commandBuffer, - VkEvent event, - VkPipelineStageFlags stageMask); - -VKAPI_ATTR void VKAPI_CALL vkCmdWaitEvents( - VkCommandBuffer commandBuffer, - uint32_t eventCount, - const VkEvent* pEvents, - VkPipelineStageFlags srcStageMask, - VkPipelineStageFlags dstStageMask, - uint32_t memoryBarrierCount, - const VkMemoryBarrier* pMemoryBarriers, - uint32_t bufferMemoryBarrierCount, - const VkBufferMemoryBarrier* pBufferMemoryBarriers, - uint32_t imageMemoryBarrierCount, - const VkImageMemoryBarrier* pImageMemoryBarriers); - -VKAPI_ATTR void VKAPI_CALL vkCmdPipelineBarrier( - VkCommandBuffer commandBuffer, - VkPipelineStageFlags srcStageMask, - VkPipelineStageFlags dstStageMask, - VkDependencyFlags dependencyFlags, - uint32_t memoryBarrierCount, - const VkMemoryBarrier* pMemoryBarriers, - uint32_t bufferMemoryBarrierCount, - const VkBufferMemoryBarrier* pBufferMemoryBarriers, - uint32_t imageMemoryBarrierCount, - const VkImageMemoryBarrier* pImageMemoryBarriers); - -VKAPI_ATTR void VKAPI_CALL vkCmdBeginQuery( - VkCommandBuffer commandBuffer, - VkQueryPool queryPool, - uint32_t query, - VkQueryControlFlags flags); - -VKAPI_ATTR void VKAPI_CALL vkCmdEndQuery( - VkCommandBuffer commandBuffer, - VkQueryPool queryPool, - uint32_t query); - -VKAPI_ATTR void VKAPI_CALL vkCmdResetQueryPool( - VkCommandBuffer commandBuffer, - VkQueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount); - -VKAPI_ATTR void VKAPI_CALL vkCmdWriteTimestamp( - VkCommandBuffer commandBuffer, - VkPipelineStageFlagBits pipelineStage, - VkQueryPool queryPool, - uint32_t query); - -VKAPI_ATTR void VKAPI_CALL vkCmdCopyQueryPoolResults( - VkCommandBuffer commandBuffer, - VkQueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount, - VkBuffer dstBuffer, - VkDeviceSize dstOffset, - VkDeviceSize stride, - VkQueryResultFlags flags); - -VKAPI_ATTR void VKAPI_CALL vkCmdPushConstants( - VkCommandBuffer commandBuffer, - VkPipelineLayout layout, - VkShaderStageFlags stageFlags, - uint32_t offset, - uint32_t size, - const void* pValues); - -VKAPI_ATTR void VKAPI_CALL vkCmdBeginRenderPass( - VkCommandBuffer commandBuffer, - const VkRenderPassBeginInfo* pRenderPassBegin, - VkSubpassContents contents); - -VKAPI_ATTR void VKAPI_CALL vkCmdNextSubpass( - VkCommandBuffer commandBuffer, - VkSubpassContents contents); - -VKAPI_ATTR void VKAPI_CALL vkCmdEndRenderPass( - VkCommandBuffer commandBuffer); - -VKAPI_ATTR void VKAPI_CALL vkCmdExecuteCommands( - VkCommandBuffer commandBuffer, - uint32_t commandBufferCount, - const VkCommandBuffer* pCommandBuffers); -#endif - -#define VK_KHR_surface 1 -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) - -#define VK_KHR_SURFACE_SPEC_VERSION 25 -#define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface" -#define VK_COLORSPACE_SRGB_NONLINEAR_KHR VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - - -typedef enum VkColorSpaceKHR { - VK_COLOR_SPACE_SRGB_NONLINEAR_KHR = 0, - VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT = 1000104001, - VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT = 1000104002, - VK_COLOR_SPACE_DCI_P3_LINEAR_EXT = 1000104003, - VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT = 1000104004, - VK_COLOR_SPACE_BT709_LINEAR_EXT = 1000104005, - VK_COLOR_SPACE_BT709_NONLINEAR_EXT = 1000104006, - VK_COLOR_SPACE_BT2020_LINEAR_EXT = 1000104007, - VK_COLOR_SPACE_HDR10_ST2084_EXT = 1000104008, - VK_COLOR_SPACE_DOLBYVISION_EXT = 1000104009, - VK_COLOR_SPACE_HDR10_HLG_EXT = 1000104010, - VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT = 1000104011, - VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT = 1000104012, - VK_COLOR_SPACE_PASS_THROUGH_EXT = 1000104013, - VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT = 1000104014, - VK_COLOR_SPACE_BEGIN_RANGE_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, - VK_COLOR_SPACE_END_RANGE_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, - VK_COLOR_SPACE_RANGE_SIZE_KHR = (VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - VK_COLOR_SPACE_SRGB_NONLINEAR_KHR + 1), - VK_COLOR_SPACE_MAX_ENUM_KHR = 0x7FFFFFFF -} VkColorSpaceKHR; - -typedef enum VkPresentModeKHR { - VK_PRESENT_MODE_IMMEDIATE_KHR = 0, - VK_PRESENT_MODE_MAILBOX_KHR = 1, - VK_PRESENT_MODE_FIFO_KHR = 2, - VK_PRESENT_MODE_FIFO_RELAXED_KHR = 3, - VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR = 1000111000, - VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR = 1000111001, - VK_PRESENT_MODE_BEGIN_RANGE_KHR = VK_PRESENT_MODE_IMMEDIATE_KHR, - VK_PRESENT_MODE_END_RANGE_KHR = VK_PRESENT_MODE_FIFO_RELAXED_KHR, - VK_PRESENT_MODE_RANGE_SIZE_KHR = (VK_PRESENT_MODE_FIFO_RELAXED_KHR - VK_PRESENT_MODE_IMMEDIATE_KHR + 1), - VK_PRESENT_MODE_MAX_ENUM_KHR = 0x7FFFFFFF -} VkPresentModeKHR; - - -typedef enum VkSurfaceTransformFlagBitsKHR { - VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001, - VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002, - VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004, - VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008, - VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010, - VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020, - VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040, - VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080, - VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100, - VK_SURFACE_TRANSFORM_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkSurfaceTransformFlagBitsKHR; -typedef VkFlags VkSurfaceTransformFlagsKHR; - -typedef enum VkCompositeAlphaFlagBitsKHR { - VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001, - VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002, - VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004, - VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008, - VK_COMPOSITE_ALPHA_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkCompositeAlphaFlagBitsKHR; -typedef VkFlags VkCompositeAlphaFlagsKHR; - -typedef struct VkSurfaceCapabilitiesKHR { - uint32_t minImageCount; - uint32_t maxImageCount; - VkExtent2D currentExtent; - VkExtent2D minImageExtent; - VkExtent2D maxImageExtent; - uint32_t maxImageArrayLayers; - VkSurfaceTransformFlagsKHR supportedTransforms; - VkSurfaceTransformFlagBitsKHR currentTransform; - VkCompositeAlphaFlagsKHR supportedCompositeAlpha; - VkImageUsageFlags supportedUsageFlags; -} VkSurfaceCapabilitiesKHR; - -typedef struct VkSurfaceFormatKHR { - VkFormat format; - VkColorSpaceKHR colorSpace; -} VkSurfaceFormatKHR; - - -typedef void (VKAPI_PTR *PFN_vkDestroySurfaceKHR)(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkDestroySurfaceKHR( - VkInstance instance, - VkSurfaceKHR surface, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceSupportKHR( - VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - VkSurfaceKHR surface, - VkBool32* pSupported); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilitiesKHR( - VkPhysicalDevice physicalDevice, - VkSurfaceKHR surface, - VkSurfaceCapabilitiesKHR* pSurfaceCapabilities); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormatsKHR( - VkPhysicalDevice physicalDevice, - VkSurfaceKHR surface, - uint32_t* pSurfaceFormatCount, - VkSurfaceFormatKHR* pSurfaceFormats); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModesKHR( - VkPhysicalDevice physicalDevice, - VkSurfaceKHR surface, - uint32_t* pPresentModeCount, - VkPresentModeKHR* pPresentModes); -#endif - -#define VK_KHR_swapchain 1 -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) - -#define VK_KHR_SWAPCHAIN_SPEC_VERSION 68 -#define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain" - - -typedef enum VkSwapchainCreateFlagBitsKHR { - VK_SWAPCHAIN_CREATE_BIND_SFR_BIT_KHX = 0x00000001, - VK_SWAPCHAIN_CREATE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkSwapchainCreateFlagBitsKHR; -typedef VkFlags VkSwapchainCreateFlagsKHR; - -typedef struct VkSwapchainCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkSwapchainCreateFlagsKHR flags; - VkSurfaceKHR surface; - uint32_t minImageCount; - VkFormat imageFormat; - VkColorSpaceKHR imageColorSpace; - VkExtent2D imageExtent; - uint32_t imageArrayLayers; - VkImageUsageFlags imageUsage; - VkSharingMode imageSharingMode; - uint32_t queueFamilyIndexCount; - const uint32_t* pQueueFamilyIndices; - VkSurfaceTransformFlagBitsKHR preTransform; - VkCompositeAlphaFlagBitsKHR compositeAlpha; - VkPresentModeKHR presentMode; - VkBool32 clipped; - VkSwapchainKHR oldSwapchain; -} VkSwapchainCreateInfoKHR; - -typedef struct VkPresentInfoKHR { - VkStructureType sType; - const void* pNext; - uint32_t waitSemaphoreCount; - const VkSemaphore* pWaitSemaphores; - uint32_t swapchainCount; - const VkSwapchainKHR* pSwapchains; - const uint32_t* pImageIndices; - VkResult* pResults; -} VkPresentInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateSwapchainKHR)(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain); -typedef void (VKAPI_PTR *PFN_vkDestroySwapchainKHR)(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainImagesKHR)(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages); -typedef VkResult (VKAPI_PTR *PFN_vkAcquireNextImageKHR)(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex); -typedef VkResult (VKAPI_PTR *PFN_vkQueuePresentKHR)(VkQueue queue, const VkPresentInfoKHR* pPresentInfo); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateSwapchainKHR( - VkDevice device, - const VkSwapchainCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSwapchainKHR* pSwapchain); - -VKAPI_ATTR void VKAPI_CALL vkDestroySwapchainKHR( - VkDevice device, - VkSwapchainKHR swapchain, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainImagesKHR( - VkDevice device, - VkSwapchainKHR swapchain, - uint32_t* pSwapchainImageCount, - VkImage* pSwapchainImages); - -VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImageKHR( - VkDevice device, - VkSwapchainKHR swapchain, - uint64_t timeout, - VkSemaphore semaphore, - VkFence fence, - uint32_t* pImageIndex); - -VKAPI_ATTR VkResult VKAPI_CALL vkQueuePresentKHR( - VkQueue queue, - const VkPresentInfoKHR* pPresentInfo); -#endif - -#define VK_KHR_display 1 -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayKHR) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayModeKHR) - -#define VK_KHR_DISPLAY_SPEC_VERSION 21 -#define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display" - - -typedef enum VkDisplayPlaneAlphaFlagBitsKHR { - VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001, - VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002, - VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004, - VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008, - VK_DISPLAY_PLANE_ALPHA_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkDisplayPlaneAlphaFlagBitsKHR; -typedef VkFlags VkDisplayPlaneAlphaFlagsKHR; -typedef VkFlags VkDisplayModeCreateFlagsKHR; -typedef VkFlags VkDisplaySurfaceCreateFlagsKHR; - -typedef struct VkDisplayPropertiesKHR { - VkDisplayKHR display; - const char* displayName; - VkExtent2D physicalDimensions; - VkExtent2D physicalResolution; - VkSurfaceTransformFlagsKHR supportedTransforms; - VkBool32 planeReorderPossible; - VkBool32 persistentContent; -} VkDisplayPropertiesKHR; - -typedef struct VkDisplayModeParametersKHR { - VkExtent2D visibleRegion; - uint32_t refreshRate; -} VkDisplayModeParametersKHR; - -typedef struct VkDisplayModePropertiesKHR { - VkDisplayModeKHR displayMode; - VkDisplayModeParametersKHR parameters; -} VkDisplayModePropertiesKHR; - -typedef struct VkDisplayModeCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkDisplayModeCreateFlagsKHR flags; - VkDisplayModeParametersKHR parameters; -} VkDisplayModeCreateInfoKHR; - -typedef struct VkDisplayPlaneCapabilitiesKHR { - VkDisplayPlaneAlphaFlagsKHR supportedAlpha; - VkOffset2D minSrcPosition; - VkOffset2D maxSrcPosition; - VkExtent2D minSrcExtent; - VkExtent2D maxSrcExtent; - VkOffset2D minDstPosition; - VkOffset2D maxDstPosition; - VkExtent2D minDstExtent; - VkExtent2D maxDstExtent; -} VkDisplayPlaneCapabilitiesKHR; - -typedef struct VkDisplayPlanePropertiesKHR { - VkDisplayKHR currentDisplay; - uint32_t currentStackIndex; -} VkDisplayPlanePropertiesKHR; - -typedef struct VkDisplaySurfaceCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkDisplaySurfaceCreateFlagsKHR flags; - VkDisplayModeKHR displayMode; - uint32_t planeIndex; - uint32_t planeStackIndex; - VkSurfaceTransformFlagBitsKHR transform; - float globalAlpha; - VkDisplayPlaneAlphaFlagBitsKHR alphaMode; - VkExtent2D imageExtent; -} VkDisplaySurfaceCreateInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceDisplayPropertiesKHR)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPropertiesKHR* pProperties); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPlanePropertiesKHR* pProperties); -typedef VkResult (VKAPI_PTR *PFN_vkGetDisplayPlaneSupportedDisplaysKHR)(VkPhysicalDevice physicalDevice, uint32_t planeIndex, uint32_t* pDisplayCount, VkDisplayKHR* pDisplays); -typedef VkResult (VKAPI_PTR *PFN_vkGetDisplayModePropertiesKHR)(VkPhysicalDevice physicalDevice, VkDisplayKHR display, uint32_t* pPropertyCount, VkDisplayModePropertiesKHR* pProperties); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDisplayModeKHR)(VkPhysicalDevice physicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDisplayModeKHR* pMode); -typedef VkResult (VKAPI_PTR *PFN_vkGetDisplayPlaneCapabilitiesKHR)(VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, uint32_t planeIndex, VkDisplayPlaneCapabilitiesKHR* pCapabilities); -typedef VkResult (VKAPI_PTR *PFN_vkCreateDisplayPlaneSurfaceKHR)(VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceDisplayPropertiesKHR( - VkPhysicalDevice physicalDevice, - uint32_t* pPropertyCount, - VkDisplayPropertiesKHR* pProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceDisplayPlanePropertiesKHR( - VkPhysicalDevice physicalDevice, - uint32_t* pPropertyCount, - VkDisplayPlanePropertiesKHR* pProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayPlaneSupportedDisplaysKHR( - VkPhysicalDevice physicalDevice, - uint32_t planeIndex, - uint32_t* pDisplayCount, - VkDisplayKHR* pDisplays); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayModePropertiesKHR( - VkPhysicalDevice physicalDevice, - VkDisplayKHR display, - uint32_t* pPropertyCount, - VkDisplayModePropertiesKHR* pProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateDisplayModeKHR( - VkPhysicalDevice physicalDevice, - VkDisplayKHR display, - const VkDisplayModeCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkDisplayModeKHR* pMode); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayPlaneCapabilitiesKHR( - VkPhysicalDevice physicalDevice, - VkDisplayModeKHR mode, - uint32_t planeIndex, - VkDisplayPlaneCapabilitiesKHR* pCapabilities); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateDisplayPlaneSurfaceKHR( - VkInstance instance, - const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSurfaceKHR* pSurface); -#endif - -#define VK_KHR_display_swapchain 1 -#define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9 -#define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain" - -typedef struct VkDisplayPresentInfoKHR { - VkStructureType sType; - const void* pNext; - VkRect2D srcRect; - VkRect2D dstRect; - VkBool32 persistent; -} VkDisplayPresentInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateSharedSwapchainsKHR)(VkDevice device, uint32_t swapchainCount, const VkSwapchainCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateSharedSwapchainsKHR( - VkDevice device, - uint32_t swapchainCount, - const VkSwapchainCreateInfoKHR* pCreateInfos, - const VkAllocationCallbacks* pAllocator, - VkSwapchainKHR* pSwapchains); -#endif - -#ifdef VK_USE_PLATFORM_XLIB_KHR -#define VK_KHR_xlib_surface 1 -#include - -#define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6 -#define VK_KHR_XLIB_SURFACE_EXTENSION_NAME "VK_KHR_xlib_surface" - -typedef VkFlags VkXlibSurfaceCreateFlagsKHR; - -typedef struct VkXlibSurfaceCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkXlibSurfaceCreateFlagsKHR flags; - Display* dpy; - Window window; -} VkXlibSurfaceCreateInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateXlibSurfaceKHR)(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); -typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR( - VkInstance instance, - const VkXlibSurfaceCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSurfaceKHR* pSurface); - -VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXlibPresentationSupportKHR( - VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - Display* dpy, - VisualID visualID); -#endif -#endif /* VK_USE_PLATFORM_XLIB_KHR */ - -#ifdef VK_USE_PLATFORM_XCB_KHR -#define VK_KHR_xcb_surface 1 -#include - -#define VK_KHR_XCB_SURFACE_SPEC_VERSION 6 -#define VK_KHR_XCB_SURFACE_EXTENSION_NAME "VK_KHR_xcb_surface" - -typedef VkFlags VkXcbSurfaceCreateFlagsKHR; - -typedef struct VkXcbSurfaceCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkXcbSurfaceCreateFlagsKHR flags; - xcb_connection_t* connection; - xcb_window_t window; -} VkXcbSurfaceCreateInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateXcbSurfaceKHR)(VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); -typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR( - VkInstance instance, - const VkXcbSurfaceCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSurfaceKHR* pSurface); - -VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXcbPresentationSupportKHR( - VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - xcb_connection_t* connection, - xcb_visualid_t visual_id); -#endif -#endif /* VK_USE_PLATFORM_XCB_KHR */ - -#ifdef VK_USE_PLATFORM_WAYLAND_KHR -#define VK_KHR_wayland_surface 1 -#include - -#define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 6 -#define VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME "VK_KHR_wayland_surface" - -typedef VkFlags VkWaylandSurfaceCreateFlagsKHR; - -typedef struct VkWaylandSurfaceCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkWaylandSurfaceCreateFlagsKHR flags; - struct wl_display* display; - struct wl_surface* surface; -} VkWaylandSurfaceCreateInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateWaylandSurfaceKHR)(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); -typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR( - VkInstance instance, - const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSurfaceKHR* pSurface); - -VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWaylandPresentationSupportKHR( - VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - struct wl_display* display); -#endif -#endif /* VK_USE_PLATFORM_WAYLAND_KHR */ - -#ifdef VK_USE_PLATFORM_MIR_KHR -#define VK_KHR_mir_surface 1 -#include - -#define VK_KHR_MIR_SURFACE_SPEC_VERSION 4 -#define VK_KHR_MIR_SURFACE_EXTENSION_NAME "VK_KHR_mir_surface" - -typedef VkFlags VkMirSurfaceCreateFlagsKHR; - -typedef struct VkMirSurfaceCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkMirSurfaceCreateFlagsKHR flags; - MirConnection* connection; - MirSurface* mirSurface; -} VkMirSurfaceCreateInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateMirSurfaceKHR)(VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); -typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, MirConnection* connection); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateMirSurfaceKHR( - VkInstance instance, - const VkMirSurfaceCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSurfaceKHR* pSurface); - -VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceMirPresentationSupportKHR( - VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - MirConnection* connection); -#endif -#endif /* VK_USE_PLATFORM_MIR_KHR */ - -#ifdef VK_USE_PLATFORM_ANDROID_KHR -#define VK_KHR_android_surface 1 -#include - -#define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6 -#define VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface" - -typedef VkFlags VkAndroidSurfaceCreateFlagsKHR; - -typedef struct VkAndroidSurfaceCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkAndroidSurfaceCreateFlagsKHR flags; - ANativeWindow* window; -} VkAndroidSurfaceCreateInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR( - VkInstance instance, - const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSurfaceKHR* pSurface); -#endif -#endif /* VK_USE_PLATFORM_ANDROID_KHR */ - -#ifdef VK_USE_PLATFORM_WIN32_KHR -#define VK_KHR_win32_surface 1 -#include - -#define VK_KHR_WIN32_SURFACE_SPEC_VERSION 6 -#define VK_KHR_WIN32_SURFACE_EXTENSION_NAME "VK_KHR_win32_surface" - -typedef VkFlags VkWin32SurfaceCreateFlagsKHR; - -typedef struct VkWin32SurfaceCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkWin32SurfaceCreateFlagsKHR flags; - HINSTANCE hinstance; - HWND hwnd; -} VkWin32SurfaceCreateInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateWin32SurfaceKHR)(VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); -typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateWin32SurfaceKHR( - VkInstance instance, - const VkWin32SurfaceCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSurfaceKHR* pSurface); - -VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWin32PresentationSupportKHR( - VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex); -#endif -#endif /* VK_USE_PLATFORM_WIN32_KHR */ - -#define VK_KHR_sampler_mirror_clamp_to_edge 1 -#define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION 1 -#define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME "VK_KHR_sampler_mirror_clamp_to_edge" - - -#define VK_KHR_get_physical_device_properties2 1 -#define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION 1 -#define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_physical_device_properties2" - -typedef struct VkPhysicalDeviceFeatures2KHR { - VkStructureType sType; - void* pNext; - VkPhysicalDeviceFeatures features; -} VkPhysicalDeviceFeatures2KHR; - -typedef struct VkPhysicalDeviceProperties2KHR { - VkStructureType sType; - void* pNext; - VkPhysicalDeviceProperties properties; -} VkPhysicalDeviceProperties2KHR; - -typedef struct VkFormatProperties2KHR { - VkStructureType sType; - void* pNext; - VkFormatProperties formatProperties; -} VkFormatProperties2KHR; - -typedef struct VkImageFormatProperties2KHR { - VkStructureType sType; - void* pNext; - VkImageFormatProperties imageFormatProperties; -} VkImageFormatProperties2KHR; - -typedef struct VkPhysicalDeviceImageFormatInfo2KHR { - VkStructureType sType; - const void* pNext; - VkFormat format; - VkImageType type; - VkImageTiling tiling; - VkImageUsageFlags usage; - VkImageCreateFlags flags; -} VkPhysicalDeviceImageFormatInfo2KHR; - -typedef struct VkQueueFamilyProperties2KHR { - VkStructureType sType; - void* pNext; - VkQueueFamilyProperties queueFamilyProperties; -} VkQueueFamilyProperties2KHR; - -typedef struct VkPhysicalDeviceMemoryProperties2KHR { - VkStructureType sType; - void* pNext; - VkPhysicalDeviceMemoryProperties memoryProperties; -} VkPhysicalDeviceMemoryProperties2KHR; - -typedef struct VkSparseImageFormatProperties2KHR { - VkStructureType sType; - void* pNext; - VkSparseImageFormatProperties properties; -} VkSparseImageFormatProperties2KHR; - -typedef struct VkPhysicalDeviceSparseImageFormatInfo2KHR { - VkStructureType sType; - const void* pNext; - VkFormat format; - VkImageType type; - VkSampleCountFlagBits samples; - VkImageUsageFlags usage; - VkImageTiling tiling; -} VkPhysicalDeviceSparseImageFormatInfo2KHR; - - -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFeatures2KHR)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2KHR* pFeatures); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceProperties2KHR)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2KHR* pProperties); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFormatProperties2KHR)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2KHR* pFormatProperties); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo, VkImageFormatProperties2KHR* pImageFormatProperties); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR)(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2KHR* pQueueFamilyProperties); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMemoryProperties2KHR)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2KHR* pProperties); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures2KHR( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceFeatures2KHR* pFeatures); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties2KHR( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceProperties2KHR* pProperties); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties2KHR( - VkPhysicalDevice physicalDevice, - VkFormat format, - VkFormatProperties2KHR* pFormatProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo, - VkImageFormatProperties2KHR* pImageFormatProperties); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties2KHR( - VkPhysicalDevice physicalDevice, - uint32_t* pQueueFamilyPropertyCount, - VkQueueFamilyProperties2KHR* pQueueFamilyProperties); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties2KHR( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo, - uint32_t* pPropertyCount, - VkSparseImageFormatProperties2KHR* pProperties); -#endif - -#define VK_KHR_shader_draw_parameters 1 -#define VK_KHR_SHADER_DRAW_PARAMETERS_SPEC_VERSION 1 -#define VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME "VK_KHR_shader_draw_parameters" - - -#define VK_KHR_maintenance1 1 -#define VK_KHR_MAINTENANCE1_SPEC_VERSION 1 -#define VK_KHR_MAINTENANCE1_EXTENSION_NAME "VK_KHR_maintenance1" - -typedef VkFlags VkCommandPoolTrimFlagsKHR; - -typedef void (VKAPI_PTR *PFN_vkTrimCommandPoolKHR)(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlagsKHR flags); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkTrimCommandPoolKHR( - VkDevice device, - VkCommandPool commandPool, - VkCommandPoolTrimFlagsKHR flags); -#endif - -#define VK_KHR_external_memory_capabilities 1 -#define VK_LUID_SIZE_KHR 8 -#define VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_KHR_external_memory_capabilities" - - -typedef enum VkExternalMemoryHandleTypeFlagBitsKHR { - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = 0x00000001, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = 0x00000002, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = 0x00000004, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR = 0x00000008, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR = 0x00000010, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR = 0x00000020, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR = 0x00000040, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT = 0x00000200, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT = 0x00000080, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT = 0x00000100, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkExternalMemoryHandleTypeFlagBitsKHR; -typedef VkFlags VkExternalMemoryHandleTypeFlagsKHR; - -typedef enum VkExternalMemoryFeatureFlagBitsKHR { - VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_KHR = 0x00000001, - VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHR = 0x00000002, - VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHR = 0x00000004, - VK_EXTERNAL_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkExternalMemoryFeatureFlagBitsKHR; -typedef VkFlags VkExternalMemoryFeatureFlagsKHR; - -typedef struct VkExternalMemoryPropertiesKHR { - VkExternalMemoryFeatureFlagsKHR externalMemoryFeatures; - VkExternalMemoryHandleTypeFlagsKHR exportFromImportedHandleTypes; - VkExternalMemoryHandleTypeFlagsKHR compatibleHandleTypes; -} VkExternalMemoryPropertiesKHR; - -typedef struct VkPhysicalDeviceExternalImageFormatInfoKHR { - VkStructureType sType; - const void* pNext; - VkExternalMemoryHandleTypeFlagBitsKHR handleType; -} VkPhysicalDeviceExternalImageFormatInfoKHR; - -typedef struct VkExternalImageFormatPropertiesKHR { - VkStructureType sType; - void* pNext; - VkExternalMemoryPropertiesKHR externalMemoryProperties; -} VkExternalImageFormatPropertiesKHR; - -typedef struct VkPhysicalDeviceExternalBufferInfoKHR { - VkStructureType sType; - const void* pNext; - VkBufferCreateFlags flags; - VkBufferUsageFlags usage; - VkExternalMemoryHandleTypeFlagBitsKHR handleType; -} VkPhysicalDeviceExternalBufferInfoKHR; - -typedef struct VkExternalBufferPropertiesKHR { - VkStructureType sType; - void* pNext; - VkExternalMemoryPropertiesKHR externalMemoryProperties; -} VkExternalBufferPropertiesKHR; - -typedef struct VkPhysicalDeviceIDPropertiesKHR { - VkStructureType sType; - void* pNext; - uint8_t deviceUUID[VK_UUID_SIZE]; - uint8_t driverUUID[VK_UUID_SIZE]; - uint8_t deviceLUID[VK_LUID_SIZE_KHR]; - uint32_t deviceNodeMask; - VkBool32 deviceLUIDValid; -} VkPhysicalDeviceIDPropertiesKHR; - - -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfoKHR* pExternalBufferInfo, VkExternalBufferPropertiesKHR* pExternalBufferProperties); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalBufferPropertiesKHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceExternalBufferInfoKHR* pExternalBufferInfo, - VkExternalBufferPropertiesKHR* pExternalBufferProperties); -#endif - -#define VK_KHR_external_memory 1 -#define VK_KHR_EXTERNAL_MEMORY_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME "VK_KHR_external_memory" -#define VK_QUEUE_FAMILY_EXTERNAL_KHR (~0U-1) - -typedef struct VkExternalMemoryImageCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkExternalMemoryHandleTypeFlagsKHR handleTypes; -} VkExternalMemoryImageCreateInfoKHR; - -typedef struct VkExternalMemoryBufferCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkExternalMemoryHandleTypeFlagsKHR handleTypes; -} VkExternalMemoryBufferCreateInfoKHR; - -typedef struct VkExportMemoryAllocateInfoKHR { - VkStructureType sType; - const void* pNext; - VkExternalMemoryHandleTypeFlagsKHR handleTypes; -} VkExportMemoryAllocateInfoKHR; - - - -#ifdef VK_USE_PLATFORM_WIN32_KHR -#define VK_KHR_external_memory_win32 1 -#define VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_KHR_external_memory_win32" - -typedef struct VkImportMemoryWin32HandleInfoKHR { - VkStructureType sType; - const void* pNext; - VkExternalMemoryHandleTypeFlagBitsKHR handleType; - HANDLE handle; - LPCWSTR name; -} VkImportMemoryWin32HandleInfoKHR; - -typedef struct VkExportMemoryWin32HandleInfoKHR { - VkStructureType sType; - const void* pNext; - const SECURITY_ATTRIBUTES* pAttributes; - DWORD dwAccess; - LPCWSTR name; -} VkExportMemoryWin32HandleInfoKHR; - -typedef struct VkMemoryWin32HandlePropertiesKHR { - VkStructureType sType; - void* pNext; - uint32_t memoryTypeBits; -} VkMemoryWin32HandlePropertiesKHR; - -typedef struct VkMemoryGetWin32HandleInfoKHR { - VkStructureType sType; - const void* pNext; - VkDeviceMemory memory; - VkExternalMemoryHandleTypeFlagBitsKHR handleType; -} VkMemoryGetWin32HandleInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleKHR)(VkDevice device, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle); -typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandlePropertiesKHR)(VkDevice device, VkExternalMemoryHandleTypeFlagBitsKHR handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleKHR( - VkDevice device, - const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, - HANDLE* pHandle); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandlePropertiesKHR( - VkDevice device, - VkExternalMemoryHandleTypeFlagBitsKHR handleType, - HANDLE handle, - VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties); -#endif -#endif /* VK_USE_PLATFORM_WIN32_KHR */ - -#define VK_KHR_external_memory_fd 1 -#define VK_KHR_EXTERNAL_MEMORY_FD_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME "VK_KHR_external_memory_fd" - -typedef struct VkImportMemoryFdInfoKHR { - VkStructureType sType; - const void* pNext; - VkExternalMemoryHandleTypeFlagBitsKHR handleType; - int fd; -} VkImportMemoryFdInfoKHR; - -typedef struct VkMemoryFdPropertiesKHR { - VkStructureType sType; - void* pNext; - uint32_t memoryTypeBits; -} VkMemoryFdPropertiesKHR; - -typedef struct VkMemoryGetFdInfoKHR { - VkStructureType sType; - const void* pNext; - VkDeviceMemory memory; - VkExternalMemoryHandleTypeFlagBitsKHR handleType; -} VkMemoryGetFdInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryFdKHR)(VkDevice device, const VkMemoryGetFdInfoKHR* pGetFdInfo, int* pFd); -typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryFdPropertiesKHR)(VkDevice device, VkExternalMemoryHandleTypeFlagBitsKHR handleType, int fd, VkMemoryFdPropertiesKHR* pMemoryFdProperties); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryFdKHR( - VkDevice device, - const VkMemoryGetFdInfoKHR* pGetFdInfo, - int* pFd); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryFdPropertiesKHR( - VkDevice device, - VkExternalMemoryHandleTypeFlagBitsKHR handleType, - int fd, - VkMemoryFdPropertiesKHR* pMemoryFdProperties); -#endif - -#ifdef VK_USE_PLATFORM_WIN32_KHR -#define VK_KHR_win32_keyed_mutex 1 -#define VK_KHR_WIN32_KEYED_MUTEX_SPEC_VERSION 1 -#define VK_KHR_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_KHR_win32_keyed_mutex" - -typedef struct VkWin32KeyedMutexAcquireReleaseInfoKHR { - VkStructureType sType; - const void* pNext; - uint32_t acquireCount; - const VkDeviceMemory* pAcquireSyncs; - const uint64_t* pAcquireKeys; - const uint32_t* pAcquireTimeouts; - uint32_t releaseCount; - const VkDeviceMemory* pReleaseSyncs; - const uint64_t* pReleaseKeys; -} VkWin32KeyedMutexAcquireReleaseInfoKHR; - - -#endif /* VK_USE_PLATFORM_WIN32_KHR */ - -#define VK_KHR_external_semaphore_capabilities 1 -#define VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME "VK_KHR_external_semaphore_capabilities" - - -typedef enum VkExternalSemaphoreHandleTypeFlagBitsKHR { - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = 0x00000001, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = 0x00000002, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = 0x00000004, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT_KHR = 0x00000008, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR = 0x00000010, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkExternalSemaphoreHandleTypeFlagBitsKHR; -typedef VkFlags VkExternalSemaphoreHandleTypeFlagsKHR; - -typedef enum VkExternalSemaphoreFeatureFlagBitsKHR { - VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT_KHR = 0x00000001, - VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT_KHR = 0x00000002, - VK_EXTERNAL_SEMAPHORE_FEATURE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkExternalSemaphoreFeatureFlagBitsKHR; -typedef VkFlags VkExternalSemaphoreFeatureFlagsKHR; - -typedef struct VkPhysicalDeviceExternalSemaphoreInfoKHR { - VkStructureType sType; - const void* pNext; - VkExternalSemaphoreHandleTypeFlagBitsKHR handleType; -} VkPhysicalDeviceExternalSemaphoreInfoKHR; - -typedef struct VkExternalSemaphorePropertiesKHR { - VkStructureType sType; - void* pNext; - VkExternalSemaphoreHandleTypeFlagsKHR exportFromImportedHandleTypes; - VkExternalSemaphoreHandleTypeFlagsKHR compatibleHandleTypes; - VkExternalSemaphoreFeatureFlagsKHR externalSemaphoreFeatures; -} VkExternalSemaphorePropertiesKHR; - - -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfoKHR* pExternalSemaphoreInfo, VkExternalSemaphorePropertiesKHR* pExternalSemaphoreProperties); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceExternalSemaphoreInfoKHR* pExternalSemaphoreInfo, - VkExternalSemaphorePropertiesKHR* pExternalSemaphoreProperties); -#endif - -#define VK_KHR_external_semaphore 1 -#define VK_KHR_EXTERNAL_SEMAPHORE_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME "VK_KHR_external_semaphore" - - -typedef enum VkSemaphoreImportFlagBitsKHR { - VK_SEMAPHORE_IMPORT_TEMPORARY_BIT_KHR = 0x00000001, - VK_SEMAPHORE_IMPORT_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkSemaphoreImportFlagBitsKHR; -typedef VkFlags VkSemaphoreImportFlagsKHR; - -typedef struct VkExportSemaphoreCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkExternalSemaphoreHandleTypeFlagsKHR handleTypes; -} VkExportSemaphoreCreateInfoKHR; - - - -#ifdef VK_USE_PLATFORM_WIN32_KHR -#define VK_KHR_external_semaphore_win32 1 -#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME "VK_KHR_external_semaphore_win32" - -typedef struct VkImportSemaphoreWin32HandleInfoKHR { - VkStructureType sType; - const void* pNext; - VkSemaphore semaphore; - VkSemaphoreImportFlagsKHR flags; - VkExternalSemaphoreHandleTypeFlagBitsKHR handleType; - HANDLE handle; - LPCWSTR name; -} VkImportSemaphoreWin32HandleInfoKHR; - -typedef struct VkExportSemaphoreWin32HandleInfoKHR { - VkStructureType sType; - const void* pNext; - const SECURITY_ATTRIBUTES* pAttributes; - DWORD dwAccess; - LPCWSTR name; -} VkExportSemaphoreWin32HandleInfoKHR; - -typedef struct VkD3D12FenceSubmitInfoKHR { - VkStructureType sType; - const void* pNext; - uint32_t waitSemaphoreValuesCount; - const uint64_t* pWaitSemaphoreValues; - uint32_t signalSemaphoreValuesCount; - const uint64_t* pSignalSemaphoreValues; -} VkD3D12FenceSubmitInfoKHR; - -typedef struct VkSemaphoreGetWin32HandleInfoKHR { - VkStructureType sType; - const void* pNext; - VkSemaphore semaphore; - VkExternalSemaphoreHandleTypeFlagBitsKHR handleType; -} VkSemaphoreGetWin32HandleInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreWin32HandleKHR)(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo); -typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreWin32HandleKHR)(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreWin32HandleKHR( - VkDevice device, - const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreWin32HandleKHR( - VkDevice device, - const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, - HANDLE* pHandle); -#endif -#endif /* VK_USE_PLATFORM_WIN32_KHR */ - -#define VK_KHR_external_semaphore_fd 1 -#define VK_KHR_EXTERNAL_SEMAPHORE_FD_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME "VK_KHR_external_semaphore_fd" - -typedef struct VkImportSemaphoreFdInfoKHR { - VkStructureType sType; - const void* pNext; - VkSemaphore semaphore; - VkSemaphoreImportFlagsKHR flags; - VkExternalSemaphoreHandleTypeFlagBitsKHR handleType; - int fd; -} VkImportSemaphoreFdInfoKHR; - -typedef struct VkSemaphoreGetFdInfoKHR { - VkStructureType sType; - const void* pNext; - VkSemaphore semaphore; - VkExternalSemaphoreHandleTypeFlagBitsKHR handleType; -} VkSemaphoreGetFdInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreFdKHR)(VkDevice device, const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo); -typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreFdKHR)(VkDevice device, const VkSemaphoreGetFdInfoKHR* pGetFdInfo, int* pFd); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreFdKHR( - VkDevice device, - const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreFdKHR( - VkDevice device, - const VkSemaphoreGetFdInfoKHR* pGetFdInfo, - int* pFd); -#endif - -#define VK_KHR_push_descriptor 1 -#define VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION 1 -#define VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME "VK_KHR_push_descriptor" - -typedef struct VkPhysicalDevicePushDescriptorPropertiesKHR { - VkStructureType sType; - void* pNext; - uint32_t maxPushDescriptors; -} VkPhysicalDevicePushDescriptorPropertiesKHR; - - -typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSetKHR)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSetKHR( - VkCommandBuffer commandBuffer, - VkPipelineBindPoint pipelineBindPoint, - VkPipelineLayout layout, - uint32_t set, - uint32_t descriptorWriteCount, - const VkWriteDescriptorSet* pDescriptorWrites); -#endif - -#define VK_KHR_16bit_storage 1 -#define VK_KHR_16BIT_STORAGE_SPEC_VERSION 1 -#define VK_KHR_16BIT_STORAGE_EXTENSION_NAME "VK_KHR_16bit_storage" - -typedef struct VkPhysicalDevice16BitStorageFeaturesKHR { - VkStructureType sType; - void* pNext; - VkBool32 storageBuffer16BitAccess; - VkBool32 uniformAndStorageBuffer16BitAccess; - VkBool32 storagePushConstant16; - VkBool32 storageInputOutput16; -} VkPhysicalDevice16BitStorageFeaturesKHR; - - - -#define VK_KHR_incremental_present 1 -#define VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION 1 -#define VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME "VK_KHR_incremental_present" - -typedef struct VkRectLayerKHR { - VkOffset2D offset; - VkExtent2D extent; - uint32_t layer; -} VkRectLayerKHR; - -typedef struct VkPresentRegionKHR { - uint32_t rectangleCount; - const VkRectLayerKHR* pRectangles; -} VkPresentRegionKHR; - -typedef struct VkPresentRegionsKHR { - VkStructureType sType; - const void* pNext; - uint32_t swapchainCount; - const VkPresentRegionKHR* pRegions; -} VkPresentRegionsKHR; - - - -#define VK_KHR_descriptor_update_template 1 -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorUpdateTemplateKHR) - -#define VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_SPEC_VERSION 1 -#define VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME "VK_KHR_descriptor_update_template" - - -typedef enum VkDescriptorUpdateTemplateTypeKHR { - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR = 0, - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR = 1, - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_BEGIN_RANGE_KHR = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR, - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_END_RANGE_KHR = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_RANGE_SIZE_KHR = (VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR + 1), - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_MAX_ENUM_KHR = 0x7FFFFFFF -} VkDescriptorUpdateTemplateTypeKHR; - -typedef VkFlags VkDescriptorUpdateTemplateCreateFlagsKHR; - -typedef struct VkDescriptorUpdateTemplateEntryKHR { - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; - VkDescriptorType descriptorType; - size_t offset; - size_t stride; -} VkDescriptorUpdateTemplateEntryKHR; - -typedef struct VkDescriptorUpdateTemplateCreateInfoKHR { - VkStructureType sType; - void* pNext; - VkDescriptorUpdateTemplateCreateFlagsKHR flags; - uint32_t descriptorUpdateEntryCount; - const VkDescriptorUpdateTemplateEntryKHR* pDescriptorUpdateEntries; - VkDescriptorUpdateTemplateTypeKHR templateType; - VkDescriptorSetLayout descriptorSetLayout; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout pipelineLayout; - uint32_t set; -} VkDescriptorUpdateTemplateCreateInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorUpdateTemplateKHR)(VkDevice device, const VkDescriptorUpdateTemplateCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate); -typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorUpdateTemplateKHR)(VkDevice device, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator); -typedef void (VKAPI_PTR *PFN_vkUpdateDescriptorSetWithTemplateKHR)(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const void* pData); -typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSetWithTemplateKHR)(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void* pData); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplateKHR( - VkDevice device, - const VkDescriptorUpdateTemplateCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkDescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate); - -VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorUpdateTemplateKHR( - VkDevice device, - VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSetWithTemplateKHR( - VkDevice device, - VkDescriptorSet descriptorSet, - VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, - const void* pData); - -VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSetWithTemplateKHR( - VkCommandBuffer commandBuffer, - VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, - VkPipelineLayout layout, - uint32_t set, - const void* pData); -#endif - -#define VK_KHR_shared_presentable_image 1 -#define VK_KHR_SHARED_PRESENTABLE_IMAGE_SPEC_VERSION 1 -#define VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME "VK_KHR_shared_presentable_image" - -typedef struct VkSharedPresentSurfaceCapabilitiesKHR { - VkStructureType sType; - void* pNext; - VkImageUsageFlags sharedPresentSupportedUsageFlags; -} VkSharedPresentSurfaceCapabilitiesKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainStatusKHR)(VkDevice device, VkSwapchainKHR swapchain); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainStatusKHR( - VkDevice device, - VkSwapchainKHR swapchain); -#endif - -#define VK_KHR_external_fence_capabilities 1 -#define VK_KHR_EXTERNAL_FENCE_CAPABILITIES_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_FENCE_CAPABILITIES_EXTENSION_NAME "VK_KHR_external_fence_capabilities" - - -typedef enum VkExternalFenceHandleTypeFlagBitsKHR { - VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = 0x00000001, - VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = 0x00000002, - VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = 0x00000004, - VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT_KHR = 0x00000008, - VK_EXTERNAL_FENCE_HANDLE_TYPE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkExternalFenceHandleTypeFlagBitsKHR; -typedef VkFlags VkExternalFenceHandleTypeFlagsKHR; - -typedef enum VkExternalFenceFeatureFlagBitsKHR { - VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT_KHR = 0x00000001, - VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT_KHR = 0x00000002, - VK_EXTERNAL_FENCE_FEATURE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkExternalFenceFeatureFlagBitsKHR; -typedef VkFlags VkExternalFenceFeatureFlagsKHR; - -typedef struct VkPhysicalDeviceExternalFenceInfoKHR { - VkStructureType sType; - const void* pNext; - VkExternalFenceHandleTypeFlagBitsKHR handleType; -} VkPhysicalDeviceExternalFenceInfoKHR; - -typedef struct VkExternalFencePropertiesKHR { - VkStructureType sType; - void* pNext; - VkExternalFenceHandleTypeFlagsKHR exportFromImportedHandleTypes; - VkExternalFenceHandleTypeFlagsKHR compatibleHandleTypes; - VkExternalFenceFeatureFlagsKHR externalFenceFeatures; -} VkExternalFencePropertiesKHR; - - -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfoKHR* pExternalFenceInfo, VkExternalFencePropertiesKHR* pExternalFenceProperties); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalFencePropertiesKHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceExternalFenceInfoKHR* pExternalFenceInfo, - VkExternalFencePropertiesKHR* pExternalFenceProperties); -#endif - -#define VK_KHR_external_fence 1 -#define VK_KHR_EXTERNAL_FENCE_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_FENCE_EXTENSION_NAME "VK_KHR_external_fence" - - -typedef enum VkFenceImportFlagBitsKHR { - VK_FENCE_IMPORT_TEMPORARY_BIT_KHR = 0x00000001, - VK_FENCE_IMPORT_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkFenceImportFlagBitsKHR; -typedef VkFlags VkFenceImportFlagsKHR; - -typedef struct VkExportFenceCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkExternalFenceHandleTypeFlagsKHR handleTypes; -} VkExportFenceCreateInfoKHR; - - - -#ifdef VK_USE_PLATFORM_WIN32_KHR -#define VK_KHR_external_fence_win32 1 -#define VK_KHR_EXTERNAL_FENCE_WIN32_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_FENCE_WIN32_EXTENSION_NAME "VK_KHR_external_fence_win32" - -typedef struct VkImportFenceWin32HandleInfoKHR { - VkStructureType sType; - const void* pNext; - VkFence fence; - VkFenceImportFlagsKHR flags; - VkExternalFenceHandleTypeFlagBitsKHR handleType; - HANDLE handle; - LPCWSTR name; -} VkImportFenceWin32HandleInfoKHR; - -typedef struct VkExportFenceWin32HandleInfoKHR { - VkStructureType sType; - const void* pNext; - const SECURITY_ATTRIBUTES* pAttributes; - DWORD dwAccess; - LPCWSTR name; -} VkExportFenceWin32HandleInfoKHR; - -typedef struct VkFenceGetWin32HandleInfoKHR { - VkStructureType sType; - const void* pNext; - VkFence fence; - VkExternalFenceHandleTypeFlagBitsKHR handleType; -} VkFenceGetWin32HandleInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkImportFenceWin32HandleKHR)(VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo); -typedef VkResult (VKAPI_PTR *PFN_vkGetFenceWin32HandleKHR)(VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkImportFenceWin32HandleKHR( - VkDevice device, - const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceWin32HandleKHR( - VkDevice device, - const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, - HANDLE* pHandle); -#endif -#endif /* VK_USE_PLATFORM_WIN32_KHR */ - -#define VK_KHR_external_fence_fd 1 -#define VK_KHR_EXTERNAL_FENCE_FD_SPEC_VERSION 1 -#define VK_KHR_EXTERNAL_FENCE_FD_EXTENSION_NAME "VK_KHR_external_fence_fd" - -typedef struct VkImportFenceFdInfoKHR { - VkStructureType sType; - const void* pNext; - VkFence fence; - VkFenceImportFlagsKHR flags; - VkExternalFenceHandleTypeFlagBitsKHR handleType; - int fd; -} VkImportFenceFdInfoKHR; - -typedef struct VkFenceGetFdInfoKHR { - VkStructureType sType; - const void* pNext; - VkFence fence; - VkExternalFenceHandleTypeFlagBitsKHR handleType; -} VkFenceGetFdInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkImportFenceFdKHR)(VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo); -typedef VkResult (VKAPI_PTR *PFN_vkGetFenceFdKHR)(VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkImportFenceFdKHR( - VkDevice device, - const VkImportFenceFdInfoKHR* pImportFenceFdInfo); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceFdKHR( - VkDevice device, - const VkFenceGetFdInfoKHR* pGetFdInfo, - int* pFd); -#endif - -#define VK_KHR_maintenance2 1 -#define VK_KHR_MAINTENANCE2_SPEC_VERSION 1 -#define VK_KHR_MAINTENANCE2_EXTENSION_NAME "VK_KHR_maintenance2" - - -typedef enum VkPointClippingBehaviorKHR { - VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES_KHR = 0, - VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY_KHR = 1, - VK_POINT_CLIPPING_BEHAVIOR_BEGIN_RANGE_KHR = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES_KHR, - VK_POINT_CLIPPING_BEHAVIOR_END_RANGE_KHR = VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY_KHR, - VK_POINT_CLIPPING_BEHAVIOR_RANGE_SIZE_KHR = (VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY_KHR - VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES_KHR + 1), - VK_POINT_CLIPPING_BEHAVIOR_MAX_ENUM_KHR = 0x7FFFFFFF -} VkPointClippingBehaviorKHR; - -typedef enum VkTessellationDomainOriginKHR { - VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT_KHR = 0, - VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT_KHR = 1, - VK_TESSELLATION_DOMAIN_ORIGIN_BEGIN_RANGE_KHR = VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT_KHR, - VK_TESSELLATION_DOMAIN_ORIGIN_END_RANGE_KHR = VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT_KHR, - VK_TESSELLATION_DOMAIN_ORIGIN_RANGE_SIZE_KHR = (VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT_KHR - VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT_KHR + 1), - VK_TESSELLATION_DOMAIN_ORIGIN_MAX_ENUM_KHR = 0x7FFFFFFF -} VkTessellationDomainOriginKHR; - -typedef struct VkPhysicalDevicePointClippingPropertiesKHR { - VkStructureType sType; - void* pNext; - VkPointClippingBehaviorKHR pointClippingBehavior; -} VkPhysicalDevicePointClippingPropertiesKHR; - -typedef struct VkInputAttachmentAspectReferenceKHR { - uint32_t subpass; - uint32_t inputAttachmentIndex; - VkImageAspectFlags aspectMask; -} VkInputAttachmentAspectReferenceKHR; - -typedef struct VkRenderPassInputAttachmentAspectCreateInfoKHR { - VkStructureType sType; - const void* pNext; - uint32_t aspectReferenceCount; - const VkInputAttachmentAspectReferenceKHR* pAspectReferences; -} VkRenderPassInputAttachmentAspectCreateInfoKHR; - -typedef struct VkImageViewUsageCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkImageUsageFlags usage; -} VkImageViewUsageCreateInfoKHR; - -typedef struct VkPipelineTessellationDomainOriginStateCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkTessellationDomainOriginKHR domainOrigin; -} VkPipelineTessellationDomainOriginStateCreateInfoKHR; - - - -#define VK_KHR_get_surface_capabilities2 1 -#define VK_KHR_GET_SURFACE_CAPABILITIES_2_SPEC_VERSION 1 -#define VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME "VK_KHR_get_surface_capabilities2" - -typedef struct VkPhysicalDeviceSurfaceInfo2KHR { - VkStructureType sType; - const void* pNext; - VkSurfaceKHR surface; -} VkPhysicalDeviceSurfaceInfo2KHR; - -typedef struct VkSurfaceCapabilities2KHR { - VkStructureType sType; - void* pNext; - VkSurfaceCapabilitiesKHR surfaceCapabilities; -} VkSurfaceCapabilities2KHR; - -typedef struct VkSurfaceFormat2KHR { - VkStructureType sType; - void* pNext; - VkSurfaceFormatKHR surfaceFormat; -} VkSurfaceFormat2KHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceFormats2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilities2KHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, - VkSurfaceCapabilities2KHR* pSurfaceCapabilities); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormats2KHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, - uint32_t* pSurfaceFormatCount, - VkSurfaceFormat2KHR* pSurfaceFormats); -#endif - -#define VK_KHR_variable_pointers 1 -#define VK_KHR_VARIABLE_POINTERS_SPEC_VERSION 1 -#define VK_KHR_VARIABLE_POINTERS_EXTENSION_NAME "VK_KHR_variable_pointers" - -typedef struct VkPhysicalDeviceVariablePointerFeaturesKHR { - VkStructureType sType; - void* pNext; - VkBool32 variablePointersStorageBuffer; - VkBool32 variablePointers; -} VkPhysicalDeviceVariablePointerFeaturesKHR; - - - -#define VK_KHR_dedicated_allocation 1 -#define VK_KHR_DEDICATED_ALLOCATION_SPEC_VERSION 3 -#define VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_KHR_dedicated_allocation" - -typedef struct VkMemoryDedicatedRequirementsKHR { - VkStructureType sType; - void* pNext; - VkBool32 prefersDedicatedAllocation; - VkBool32 requiresDedicatedAllocation; -} VkMemoryDedicatedRequirementsKHR; - -typedef struct VkMemoryDedicatedAllocateInfoKHR { - VkStructureType sType; - const void* pNext; - VkImage image; - VkBuffer buffer; -} VkMemoryDedicatedAllocateInfoKHR; - - - -#define VK_KHR_storage_buffer_storage_class 1 -#define VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_SPEC_VERSION 1 -#define VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_EXTENSION_NAME "VK_KHR_storage_buffer_storage_class" - - -#define VK_KHR_relaxed_block_layout 1 -#define VK_KHR_RELAXED_BLOCK_LAYOUT_SPEC_VERSION 1 -#define VK_KHR_RELAXED_BLOCK_LAYOUT_EXTENSION_NAME "VK_KHR_relaxed_block_layout" - - -#define VK_KHR_get_memory_requirements2 1 -#define VK_KHR_GET_MEMORY_REQUIREMENTS_2_SPEC_VERSION 1 -#define VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME "VK_KHR_get_memory_requirements2" - -typedef struct VkBufferMemoryRequirementsInfo2KHR { - VkStructureType sType; - const void* pNext; - VkBuffer buffer; -} VkBufferMemoryRequirementsInfo2KHR; - -typedef struct VkImageMemoryRequirementsInfo2KHR { - VkStructureType sType; - const void* pNext; - VkImage image; -} VkImageMemoryRequirementsInfo2KHR; - -typedef struct VkImageSparseMemoryRequirementsInfo2KHR { - VkStructureType sType; - const void* pNext; - VkImage image; -} VkImageSparseMemoryRequirementsInfo2KHR; - -typedef struct VkMemoryRequirements2KHR { - VkStructureType sType; - void* pNext; - VkMemoryRequirements memoryRequirements; -} VkMemoryRequirements2KHR; - -typedef struct VkSparseImageMemoryRequirements2KHR { - VkStructureType sType; - void* pNext; - VkSparseImageMemoryRequirements memoryRequirements; -} VkSparseImageMemoryRequirements2KHR; - - -typedef void (VKAPI_PTR *PFN_vkGetImageMemoryRequirements2KHR)(VkDevice device, const VkImageMemoryRequirementsInfo2KHR* pInfo, VkMemoryRequirements2KHR* pMemoryRequirements); -typedef void (VKAPI_PTR *PFN_vkGetBufferMemoryRequirements2KHR)(VkDevice device, const VkBufferMemoryRequirementsInfo2KHR* pInfo, VkMemoryRequirements2KHR* pMemoryRequirements); -typedef void (VKAPI_PTR *PFN_vkGetImageSparseMemoryRequirements2KHR)(VkDevice device, const VkImageSparseMemoryRequirementsInfo2KHR* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2KHR* pSparseMemoryRequirements); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements2KHR( - VkDevice device, - const VkImageMemoryRequirementsInfo2KHR* pInfo, - VkMemoryRequirements2KHR* pMemoryRequirements); - -VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements2KHR( - VkDevice device, - const VkBufferMemoryRequirementsInfo2KHR* pInfo, - VkMemoryRequirements2KHR* pMemoryRequirements); - -VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements2KHR( - VkDevice device, - const VkImageSparseMemoryRequirementsInfo2KHR* pInfo, - uint32_t* pSparseMemoryRequirementCount, - VkSparseImageMemoryRequirements2KHR* pSparseMemoryRequirements); -#endif - -#define VK_KHR_image_format_list 1 -#define VK_KHR_IMAGE_FORMAT_LIST_SPEC_VERSION 1 -#define VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME "VK_KHR_image_format_list" - -typedef struct VkImageFormatListCreateInfoKHR { - VkStructureType sType; - const void* pNext; - uint32_t viewFormatCount; - const VkFormat* pViewFormats; -} VkImageFormatListCreateInfoKHR; - - - -#define VK_KHR_sampler_ycbcr_conversion 1 -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSamplerYcbcrConversionKHR) - -#define VK_KHR_SAMPLER_YCBCR_CONVERSION_SPEC_VERSION 1 -#define VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME "VK_KHR_sampler_ycbcr_conversion" - - -typedef enum VkSamplerYcbcrModelConversionKHR { - VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY_KHR = 0, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY_KHR = 1, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709_KHR = 2, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601_KHR = 3, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR = 4, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_BEGIN_RANGE_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY_KHR, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_END_RANGE_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_RANGE_SIZE_KHR = (VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR - VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY_KHR + 1), - VK_SAMPLER_YCBCR_MODEL_CONVERSION_MAX_ENUM_KHR = 0x7FFFFFFF -} VkSamplerYcbcrModelConversionKHR; - -typedef enum VkSamplerYcbcrRangeKHR { - VK_SAMPLER_YCBCR_RANGE_ITU_FULL_KHR = 0, - VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR = 1, - VK_SAMPLER_YCBCR_RANGE_BEGIN_RANGE_KHR = VK_SAMPLER_YCBCR_RANGE_ITU_FULL_KHR, - VK_SAMPLER_YCBCR_RANGE_END_RANGE_KHR = VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR, - VK_SAMPLER_YCBCR_RANGE_RANGE_SIZE_KHR = (VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR - VK_SAMPLER_YCBCR_RANGE_ITU_FULL_KHR + 1), - VK_SAMPLER_YCBCR_RANGE_MAX_ENUM_KHR = 0x7FFFFFFF -} VkSamplerYcbcrRangeKHR; - -typedef enum VkChromaLocationKHR { - VK_CHROMA_LOCATION_COSITED_EVEN_KHR = 0, - VK_CHROMA_LOCATION_MIDPOINT_KHR = 1, - VK_CHROMA_LOCATION_BEGIN_RANGE_KHR = VK_CHROMA_LOCATION_COSITED_EVEN_KHR, - VK_CHROMA_LOCATION_END_RANGE_KHR = VK_CHROMA_LOCATION_MIDPOINT_KHR, - VK_CHROMA_LOCATION_RANGE_SIZE_KHR = (VK_CHROMA_LOCATION_MIDPOINT_KHR - VK_CHROMA_LOCATION_COSITED_EVEN_KHR + 1), - VK_CHROMA_LOCATION_MAX_ENUM_KHR = 0x7FFFFFFF -} VkChromaLocationKHR; - -typedef struct VkSamplerYcbcrConversionCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkFormat format; - VkSamplerYcbcrModelConversionKHR ycbcrModel; - VkSamplerYcbcrRangeKHR ycbcrRange; - VkComponentMapping components; - VkChromaLocationKHR xChromaOffset; - VkChromaLocationKHR yChromaOffset; - VkFilter chromaFilter; - VkBool32 forceExplicitReconstruction; -} VkSamplerYcbcrConversionCreateInfoKHR; - -typedef struct VkSamplerYcbcrConversionInfoKHR { - VkStructureType sType; - const void* pNext; - VkSamplerYcbcrConversionKHR conversion; -} VkSamplerYcbcrConversionInfoKHR; - -typedef struct VkBindImagePlaneMemoryInfoKHR { - VkStructureType sType; - const void* pNext; - VkImageAspectFlagBits planeAspect; -} VkBindImagePlaneMemoryInfoKHR; - -typedef struct VkImagePlaneMemoryRequirementsInfoKHR { - VkStructureType sType; - const void* pNext; - VkImageAspectFlagBits planeAspect; -} VkImagePlaneMemoryRequirementsInfoKHR; - -typedef struct VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR { - VkStructureType sType; - void* pNext; - VkBool32 samplerYcbcrConversion; -} VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR; - -typedef struct VkSamplerYcbcrConversionImageFormatPropertiesKHR { - VkStructureType sType; - void* pNext; - uint32_t combinedImageSamplerDescriptorCount; -} VkSamplerYcbcrConversionImageFormatPropertiesKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateSamplerYcbcrConversionKHR)(VkDevice device, const VkSamplerYcbcrConversionCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversionKHR* pYcbcrConversion); -typedef void (VKAPI_PTR *PFN_vkDestroySamplerYcbcrConversionKHR)(VkDevice device, VkSamplerYcbcrConversionKHR ycbcrConversion, const VkAllocationCallbacks* pAllocator); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateSamplerYcbcrConversionKHR( - VkDevice device, - const VkSamplerYcbcrConversionCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSamplerYcbcrConversionKHR* pYcbcrConversion); - -VKAPI_ATTR void VKAPI_CALL vkDestroySamplerYcbcrConversionKHR( - VkDevice device, - VkSamplerYcbcrConversionKHR ycbcrConversion, - const VkAllocationCallbacks* pAllocator); -#endif - -#define VK_KHR_bind_memory2 1 -#define VK_KHR_BIND_MEMORY_2_SPEC_VERSION 1 -#define VK_KHR_BIND_MEMORY_2_EXTENSION_NAME "VK_KHR_bind_memory2" - -typedef struct VkBindBufferMemoryInfoKHR { - VkStructureType sType; - const void* pNext; - VkBuffer buffer; - VkDeviceMemory memory; - VkDeviceSize memoryOffset; -} VkBindBufferMemoryInfoKHR; - -typedef struct VkBindImageMemoryInfoKHR { - VkStructureType sType; - const void* pNext; - VkImage image; - VkDeviceMemory memory; - VkDeviceSize memoryOffset; -} VkBindImageMemoryInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkBindBufferMemory2KHR)(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfoKHR* pBindInfos); -typedef VkResult (VKAPI_PTR *PFN_vkBindImageMemory2KHR)(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfoKHR* pBindInfos); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory2KHR( - VkDevice device, - uint32_t bindInfoCount, - const VkBindBufferMemoryInfoKHR* pBindInfos); - -VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory2KHR( - VkDevice device, - uint32_t bindInfoCount, - const VkBindImageMemoryInfoKHR* pBindInfos); -#endif - -#define VK_EXT_debug_report 1 -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) - -#define VK_EXT_DEBUG_REPORT_SPEC_VERSION 9 -#define VK_EXT_DEBUG_REPORT_EXTENSION_NAME "VK_EXT_debug_report" -#define VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT -#define VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT - - -typedef enum VkDebugReportObjectTypeEXT { - VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0, - VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1, - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2, - VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3, - VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4, - VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6, - VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7, - VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8, - VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9, - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10, - VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11, - VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12, - VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13, - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14, - VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17, - VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20, - VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23, - VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25, - VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26, - VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27, - VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT = 28, - VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29, - VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30, - VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31, - VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32, - VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT = 33, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT = 1000085000, - VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR_EXT = 1000156000, - VK_DEBUG_REPORT_OBJECT_TYPE_BEGIN_RANGE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_END_RANGE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_RANGE_SIZE_EXT = (VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT - VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT + 1), - VK_DEBUG_REPORT_OBJECT_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF -} VkDebugReportObjectTypeEXT; - - -typedef enum VkDebugReportFlagBitsEXT { - VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001, - VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002, - VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004, - VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008, - VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010, - VK_DEBUG_REPORT_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkDebugReportFlagBitsEXT; -typedef VkFlags VkDebugReportFlagsEXT; - -typedef VkBool32 (VKAPI_PTR *PFN_vkDebugReportCallbackEXT)( - VkDebugReportFlagsEXT flags, - VkDebugReportObjectTypeEXT objectType, - uint64_t object, - size_t location, - int32_t messageCode, - const char* pLayerPrefix, - const char* pMessage, - void* pUserData); - -typedef struct VkDebugReportCallbackCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkDebugReportFlagsEXT flags; - PFN_vkDebugReportCallbackEXT pfnCallback; - void* pUserData; -} VkDebugReportCallbackCreateInfoEXT; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateDebugReportCallbackEXT)(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback); -typedef void (VKAPI_PTR *PFN_vkDestroyDebugReportCallbackEXT)(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator); -typedef void (VKAPI_PTR *PFN_vkDebugReportMessageEXT)(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateDebugReportCallbackEXT( - VkInstance instance, - const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkDebugReportCallbackEXT* pCallback); - -VKAPI_ATTR void VKAPI_CALL vkDestroyDebugReportCallbackEXT( - VkInstance instance, - VkDebugReportCallbackEXT callback, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR void VKAPI_CALL vkDebugReportMessageEXT( - VkInstance instance, - VkDebugReportFlagsEXT flags, - VkDebugReportObjectTypeEXT objectType, - uint64_t object, - size_t location, - int32_t messageCode, - const char* pLayerPrefix, - const char* pMessage); -#endif - -#define VK_NV_glsl_shader 1 -#define VK_NV_GLSL_SHADER_SPEC_VERSION 1 -#define VK_NV_GLSL_SHADER_EXTENSION_NAME "VK_NV_glsl_shader" - - -#define VK_EXT_depth_range_unrestricted 1 -#define VK_EXT_DEPTH_RANGE_UNRESTRICTED_SPEC_VERSION 1 -#define VK_EXT_DEPTH_RANGE_UNRESTRICTED_EXTENSION_NAME "VK_EXT_depth_range_unrestricted" - - -#define VK_IMG_filter_cubic 1 -#define VK_IMG_FILTER_CUBIC_SPEC_VERSION 1 -#define VK_IMG_FILTER_CUBIC_EXTENSION_NAME "VK_IMG_filter_cubic" - - -#define VK_AMD_rasterization_order 1 -#define VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION 1 -#define VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME "VK_AMD_rasterization_order" - - -typedef enum VkRasterizationOrderAMD { - VK_RASTERIZATION_ORDER_STRICT_AMD = 0, - VK_RASTERIZATION_ORDER_RELAXED_AMD = 1, - VK_RASTERIZATION_ORDER_BEGIN_RANGE_AMD = VK_RASTERIZATION_ORDER_STRICT_AMD, - VK_RASTERIZATION_ORDER_END_RANGE_AMD = VK_RASTERIZATION_ORDER_RELAXED_AMD, - VK_RASTERIZATION_ORDER_RANGE_SIZE_AMD = (VK_RASTERIZATION_ORDER_RELAXED_AMD - VK_RASTERIZATION_ORDER_STRICT_AMD + 1), - VK_RASTERIZATION_ORDER_MAX_ENUM_AMD = 0x7FFFFFFF -} VkRasterizationOrderAMD; - -typedef struct VkPipelineRasterizationStateRasterizationOrderAMD { - VkStructureType sType; - const void* pNext; - VkRasterizationOrderAMD rasterizationOrder; -} VkPipelineRasterizationStateRasterizationOrderAMD; - - - -#define VK_AMD_shader_trinary_minmax 1 -#define VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION 1 -#define VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME "VK_AMD_shader_trinary_minmax" - - -#define VK_AMD_shader_explicit_vertex_parameter 1 -#define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION 1 -#define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME "VK_AMD_shader_explicit_vertex_parameter" - - -#define VK_EXT_debug_marker 1 -#define VK_EXT_DEBUG_MARKER_SPEC_VERSION 4 -#define VK_EXT_DEBUG_MARKER_EXTENSION_NAME "VK_EXT_debug_marker" - -typedef struct VkDebugMarkerObjectNameInfoEXT { - VkStructureType sType; - const void* pNext; - VkDebugReportObjectTypeEXT objectType; - uint64_t object; - const char* pObjectName; -} VkDebugMarkerObjectNameInfoEXT; - -typedef struct VkDebugMarkerObjectTagInfoEXT { - VkStructureType sType; - const void* pNext; - VkDebugReportObjectTypeEXT objectType; - uint64_t object; - uint64_t tagName; - size_t tagSize; - const void* pTag; -} VkDebugMarkerObjectTagInfoEXT; - -typedef struct VkDebugMarkerMarkerInfoEXT { - VkStructureType sType; - const void* pNext; - const char* pMarkerName; - float color[4]; -} VkDebugMarkerMarkerInfoEXT; - - -typedef VkResult (VKAPI_PTR *PFN_vkDebugMarkerSetObjectTagEXT)(VkDevice device, const VkDebugMarkerObjectTagInfoEXT* pTagInfo); -typedef VkResult (VKAPI_PTR *PFN_vkDebugMarkerSetObjectNameEXT)(VkDevice device, const VkDebugMarkerObjectNameInfoEXT* pNameInfo); -typedef void (VKAPI_PTR *PFN_vkCmdDebugMarkerBeginEXT)(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo); -typedef void (VKAPI_PTR *PFN_vkCmdDebugMarkerEndEXT)(VkCommandBuffer commandBuffer); -typedef void (VKAPI_PTR *PFN_vkCmdDebugMarkerInsertEXT)(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkDebugMarkerSetObjectTagEXT( - VkDevice device, - const VkDebugMarkerObjectTagInfoEXT* pTagInfo); - -VKAPI_ATTR VkResult VKAPI_CALL vkDebugMarkerSetObjectNameEXT( - VkDevice device, - const VkDebugMarkerObjectNameInfoEXT* pNameInfo); - -VKAPI_ATTR void VKAPI_CALL vkCmdDebugMarkerBeginEXT( - VkCommandBuffer commandBuffer, - const VkDebugMarkerMarkerInfoEXT* pMarkerInfo); - -VKAPI_ATTR void VKAPI_CALL vkCmdDebugMarkerEndEXT( - VkCommandBuffer commandBuffer); - -VKAPI_ATTR void VKAPI_CALL vkCmdDebugMarkerInsertEXT( - VkCommandBuffer commandBuffer, - const VkDebugMarkerMarkerInfoEXT* pMarkerInfo); -#endif - -#define VK_AMD_gcn_shader 1 -#define VK_AMD_GCN_SHADER_SPEC_VERSION 1 -#define VK_AMD_GCN_SHADER_EXTENSION_NAME "VK_AMD_gcn_shader" - - -#define VK_NV_dedicated_allocation 1 -#define VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION 1 -#define VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_NV_dedicated_allocation" - -typedef struct VkDedicatedAllocationImageCreateInfoNV { - VkStructureType sType; - const void* pNext; - VkBool32 dedicatedAllocation; -} VkDedicatedAllocationImageCreateInfoNV; - -typedef struct VkDedicatedAllocationBufferCreateInfoNV { - VkStructureType sType; - const void* pNext; - VkBool32 dedicatedAllocation; -} VkDedicatedAllocationBufferCreateInfoNV; - -typedef struct VkDedicatedAllocationMemoryAllocateInfoNV { - VkStructureType sType; - const void* pNext; - VkImage image; - VkBuffer buffer; -} VkDedicatedAllocationMemoryAllocateInfoNV; - - - -#define VK_AMD_draw_indirect_count 1 -#define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 1 -#define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count" - -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirectCountAMD)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); -typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexedIndirectCountAMD)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirectCountAMD( - VkCommandBuffer commandBuffer, - VkBuffer buffer, - VkDeviceSize offset, - VkBuffer countBuffer, - VkDeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride); - -VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirectCountAMD( - VkCommandBuffer commandBuffer, - VkBuffer buffer, - VkDeviceSize offset, - VkBuffer countBuffer, - VkDeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride); -#endif - -#define VK_AMD_negative_viewport_height 1 -#define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION 1 -#define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME "VK_AMD_negative_viewport_height" - - -#define VK_AMD_gpu_shader_half_float 1 -#define VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION 1 -#define VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME "VK_AMD_gpu_shader_half_float" - - -#define VK_AMD_shader_ballot 1 -#define VK_AMD_SHADER_BALLOT_SPEC_VERSION 1 -#define VK_AMD_SHADER_BALLOT_EXTENSION_NAME "VK_AMD_shader_ballot" - - -#define VK_AMD_texture_gather_bias_lod 1 -#define VK_AMD_TEXTURE_GATHER_BIAS_LOD_SPEC_VERSION 1 -#define VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME "VK_AMD_texture_gather_bias_lod" - -typedef struct VkTextureLODGatherFormatPropertiesAMD { - VkStructureType sType; - void* pNext; - VkBool32 supportsTextureGatherLODBiasAMD; -} VkTextureLODGatherFormatPropertiesAMD; - - - -#define VK_AMD_shader_info 1 -#define VK_AMD_SHADER_INFO_SPEC_VERSION 1 -#define VK_AMD_SHADER_INFO_EXTENSION_NAME "VK_AMD_shader_info" - - -typedef enum VkShaderInfoTypeAMD { - VK_SHADER_INFO_TYPE_STATISTICS_AMD = 0, - VK_SHADER_INFO_TYPE_BINARY_AMD = 1, - VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD = 2, - VK_SHADER_INFO_TYPE_BEGIN_RANGE_AMD = VK_SHADER_INFO_TYPE_STATISTICS_AMD, - VK_SHADER_INFO_TYPE_END_RANGE_AMD = VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD, - VK_SHADER_INFO_TYPE_RANGE_SIZE_AMD = (VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD - VK_SHADER_INFO_TYPE_STATISTICS_AMD + 1), - VK_SHADER_INFO_TYPE_MAX_ENUM_AMD = 0x7FFFFFFF -} VkShaderInfoTypeAMD; - -typedef struct VkShaderResourceUsageAMD { - uint32_t numUsedVgprs; - uint32_t numUsedSgprs; - uint32_t ldsSizePerLocalWorkGroup; - size_t ldsUsageSizeInBytes; - size_t scratchMemUsageInBytes; -} VkShaderResourceUsageAMD; - -typedef struct VkShaderStatisticsInfoAMD { - VkShaderStageFlags shaderStageMask; - VkShaderResourceUsageAMD resourceUsage; - uint32_t numPhysicalVgprs; - uint32_t numPhysicalSgprs; - uint32_t numAvailableVgprs; - uint32_t numAvailableSgprs; - uint32_t computeWorkGroupSize[3]; -} VkShaderStatisticsInfoAMD; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetShaderInfoAMD)(VkDevice device, VkPipeline pipeline, VkShaderStageFlagBits shaderStage, VkShaderInfoTypeAMD infoType, size_t* pInfoSize, void* pInfo); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetShaderInfoAMD( - VkDevice device, - VkPipeline pipeline, - VkShaderStageFlagBits shaderStage, - VkShaderInfoTypeAMD infoType, - size_t* pInfoSize, - void* pInfo); -#endif - -#define VK_AMD_shader_image_load_store_lod 1 -#define VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_SPEC_VERSION 1 -#define VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_EXTENSION_NAME "VK_AMD_shader_image_load_store_lod" - - -#define VK_KHX_multiview 1 -#define VK_KHX_MULTIVIEW_SPEC_VERSION 1 -#define VK_KHX_MULTIVIEW_EXTENSION_NAME "VK_KHX_multiview" - -typedef struct VkRenderPassMultiviewCreateInfoKHX { - VkStructureType sType; - const void* pNext; - uint32_t subpassCount; - const uint32_t* pViewMasks; - uint32_t dependencyCount; - const int32_t* pViewOffsets; - uint32_t correlationMaskCount; - const uint32_t* pCorrelationMasks; -} VkRenderPassMultiviewCreateInfoKHX; - -typedef struct VkPhysicalDeviceMultiviewFeaturesKHX { - VkStructureType sType; - void* pNext; - VkBool32 multiview; - VkBool32 multiviewGeometryShader; - VkBool32 multiviewTessellationShader; -} VkPhysicalDeviceMultiviewFeaturesKHX; - -typedef struct VkPhysicalDeviceMultiviewPropertiesKHX { - VkStructureType sType; - void* pNext; - uint32_t maxMultiviewViewCount; - uint32_t maxMultiviewInstanceIndex; -} VkPhysicalDeviceMultiviewPropertiesKHX; - - - -#define VK_IMG_format_pvrtc 1 -#define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1 -#define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc" - - -#define VK_NV_external_memory_capabilities 1 -#define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1 -#define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_NV_external_memory_capabilities" - - -typedef enum VkExternalMemoryHandleTypeFlagBitsNV { - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV = 0x00000001, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV = 0x00000002, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0x00000004, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0x00000008, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_FLAG_BITS_MAX_ENUM_NV = 0x7FFFFFFF -} VkExternalMemoryHandleTypeFlagBitsNV; -typedef VkFlags VkExternalMemoryHandleTypeFlagsNV; - -typedef enum VkExternalMemoryFeatureFlagBitsNV { - VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV = 0x00000001, - VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0x00000002, - VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0x00000004, - VK_EXTERNAL_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM_NV = 0x7FFFFFFF -} VkExternalMemoryFeatureFlagBitsNV; -typedef VkFlags VkExternalMemoryFeatureFlagsNV; - -typedef struct VkExternalImageFormatPropertiesNV { - VkImageFormatProperties imageFormatProperties; - VkExternalMemoryFeatureFlagsNV externalMemoryFeatures; - VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes; - VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes; -} VkExternalImageFormatPropertiesNV; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkExternalMemoryHandleTypeFlagsNV externalHandleType, VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceExternalImageFormatPropertiesNV( - VkPhysicalDevice physicalDevice, - VkFormat format, - VkImageType type, - VkImageTiling tiling, - VkImageUsageFlags usage, - VkImageCreateFlags flags, - VkExternalMemoryHandleTypeFlagsNV externalHandleType, - VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties); -#endif - -#define VK_NV_external_memory 1 -#define VK_NV_EXTERNAL_MEMORY_SPEC_VERSION 1 -#define VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME "VK_NV_external_memory" - -typedef struct VkExternalMemoryImageCreateInfoNV { - VkStructureType sType; - const void* pNext; - VkExternalMemoryHandleTypeFlagsNV handleTypes; -} VkExternalMemoryImageCreateInfoNV; - -typedef struct VkExportMemoryAllocateInfoNV { - VkStructureType sType; - const void* pNext; - VkExternalMemoryHandleTypeFlagsNV handleTypes; -} VkExportMemoryAllocateInfoNV; - - - -#ifdef VK_USE_PLATFORM_WIN32_KHR -#define VK_NV_external_memory_win32 1 -#define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1 -#define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32" - -typedef struct VkImportMemoryWin32HandleInfoNV { - VkStructureType sType; - const void* pNext; - VkExternalMemoryHandleTypeFlagsNV handleType; - HANDLE handle; -} VkImportMemoryWin32HandleInfoNV; - -typedef struct VkExportMemoryWin32HandleInfoNV { - VkStructureType sType; - const void* pNext; - const SECURITY_ATTRIBUTES* pAttributes; - DWORD dwAccess; -} VkExportMemoryWin32HandleInfoNV; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleNV)(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleNV( - VkDevice device, - VkDeviceMemory memory, - VkExternalMemoryHandleTypeFlagsNV handleType, - HANDLE* pHandle); -#endif -#endif /* VK_USE_PLATFORM_WIN32_KHR */ - -#ifdef VK_USE_PLATFORM_WIN32_KHR -#define VK_NV_win32_keyed_mutex 1 -#define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1 -#define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex" - -typedef struct VkWin32KeyedMutexAcquireReleaseInfoNV { - VkStructureType sType; - const void* pNext; - uint32_t acquireCount; - const VkDeviceMemory* pAcquireSyncs; - const uint64_t* pAcquireKeys; - const uint32_t* pAcquireTimeoutMilliseconds; - uint32_t releaseCount; - const VkDeviceMemory* pReleaseSyncs; - const uint64_t* pReleaseKeys; -} VkWin32KeyedMutexAcquireReleaseInfoNV; - - -#endif /* VK_USE_PLATFORM_WIN32_KHR */ - -#define VK_KHX_device_group 1 -#define VK_KHX_DEVICE_GROUP_SPEC_VERSION 2 -#define VK_KHX_DEVICE_GROUP_EXTENSION_NAME "VK_KHX_device_group" -#define VK_MAX_DEVICE_GROUP_SIZE_KHX 32 - - -typedef enum VkPeerMemoryFeatureFlagBitsKHX { - VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT_KHX = 0x00000001, - VK_PEER_MEMORY_FEATURE_COPY_DST_BIT_KHX = 0x00000002, - VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT_KHX = 0x00000004, - VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT_KHX = 0x00000008, - VK_PEER_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM_KHX = 0x7FFFFFFF -} VkPeerMemoryFeatureFlagBitsKHX; -typedef VkFlags VkPeerMemoryFeatureFlagsKHX; - -typedef enum VkMemoryAllocateFlagBitsKHX { - VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT_KHX = 0x00000001, - VK_MEMORY_ALLOCATE_FLAG_BITS_MAX_ENUM_KHX = 0x7FFFFFFF -} VkMemoryAllocateFlagBitsKHX; -typedef VkFlags VkMemoryAllocateFlagsKHX; - -typedef enum VkDeviceGroupPresentModeFlagBitsKHX { - VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHX = 0x00000001, - VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHX = 0x00000002, - VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHX = 0x00000004, - VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHX = 0x00000008, - VK_DEVICE_GROUP_PRESENT_MODE_FLAG_BITS_MAX_ENUM_KHX = 0x7FFFFFFF -} VkDeviceGroupPresentModeFlagBitsKHX; -typedef VkFlags VkDeviceGroupPresentModeFlagsKHX; - -typedef struct VkMemoryAllocateFlagsInfoKHX { - VkStructureType sType; - const void* pNext; - VkMemoryAllocateFlagsKHX flags; - uint32_t deviceMask; -} VkMemoryAllocateFlagsInfoKHX; - -typedef struct VkDeviceGroupRenderPassBeginInfoKHX { - VkStructureType sType; - const void* pNext; - uint32_t deviceMask; - uint32_t deviceRenderAreaCount; - const VkRect2D* pDeviceRenderAreas; -} VkDeviceGroupRenderPassBeginInfoKHX; - -typedef struct VkDeviceGroupCommandBufferBeginInfoKHX { - VkStructureType sType; - const void* pNext; - uint32_t deviceMask; -} VkDeviceGroupCommandBufferBeginInfoKHX; - -typedef struct VkDeviceGroupSubmitInfoKHX { - VkStructureType sType; - const void* pNext; - uint32_t waitSemaphoreCount; - const uint32_t* pWaitSemaphoreDeviceIndices; - uint32_t commandBufferCount; - const uint32_t* pCommandBufferDeviceMasks; - uint32_t signalSemaphoreCount; - const uint32_t* pSignalSemaphoreDeviceIndices; -} VkDeviceGroupSubmitInfoKHX; - -typedef struct VkDeviceGroupBindSparseInfoKHX { - VkStructureType sType; - const void* pNext; - uint32_t resourceDeviceIndex; - uint32_t memoryDeviceIndex; -} VkDeviceGroupBindSparseInfoKHX; - -typedef struct VkBindBufferMemoryDeviceGroupInfoKHX { - VkStructureType sType; - const void* pNext; - uint32_t deviceIndexCount; - const uint32_t* pDeviceIndices; -} VkBindBufferMemoryDeviceGroupInfoKHX; - -typedef struct VkBindImageMemoryDeviceGroupInfoKHX { - VkStructureType sType; - const void* pNext; - uint32_t deviceIndexCount; - const uint32_t* pDeviceIndices; - uint32_t SFRRectCount; - const VkRect2D* pSFRRects; -} VkBindImageMemoryDeviceGroupInfoKHX; - -typedef struct VkDeviceGroupPresentCapabilitiesKHX { - VkStructureType sType; - const void* pNext; - uint32_t presentMask[VK_MAX_DEVICE_GROUP_SIZE_KHX]; - VkDeviceGroupPresentModeFlagsKHX modes; -} VkDeviceGroupPresentCapabilitiesKHX; - -typedef struct VkImageSwapchainCreateInfoKHX { - VkStructureType sType; - const void* pNext; - VkSwapchainKHR swapchain; -} VkImageSwapchainCreateInfoKHX; - -typedef struct VkBindImageMemorySwapchainInfoKHX { - VkStructureType sType; - const void* pNext; - VkSwapchainKHR swapchain; - uint32_t imageIndex; -} VkBindImageMemorySwapchainInfoKHX; - -typedef struct VkAcquireNextImageInfoKHX { - VkStructureType sType; - const void* pNext; - VkSwapchainKHR swapchain; - uint64_t timeout; - VkSemaphore semaphore; - VkFence fence; - uint32_t deviceMask; -} VkAcquireNextImageInfoKHX; - -typedef struct VkDeviceGroupPresentInfoKHX { - VkStructureType sType; - const void* pNext; - uint32_t swapchainCount; - const uint32_t* pDeviceMasks; - VkDeviceGroupPresentModeFlagBitsKHX mode; -} VkDeviceGroupPresentInfoKHX; - -typedef struct VkDeviceGroupSwapchainCreateInfoKHX { - VkStructureType sType; - const void* pNext; - VkDeviceGroupPresentModeFlagsKHX modes; -} VkDeviceGroupSwapchainCreateInfoKHX; - - -typedef void (VKAPI_PTR *PFN_vkGetDeviceGroupPeerMemoryFeaturesKHX)(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlagsKHX* pPeerMemoryFeatures); -typedef void (VKAPI_PTR *PFN_vkCmdSetDeviceMaskKHX)(VkCommandBuffer commandBuffer, uint32_t deviceMask); -typedef void (VKAPI_PTR *PFN_vkCmdDispatchBaseKHX)(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); -typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupPresentCapabilitiesKHX)(VkDevice device, VkDeviceGroupPresentCapabilitiesKHX* pDeviceGroupPresentCapabilities); -typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupSurfacePresentModesKHX)(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHX* pModes); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDevicePresentRectanglesKHX)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pRectCount, VkRect2D* pRects); -typedef VkResult (VKAPI_PTR *PFN_vkAcquireNextImage2KHX)(VkDevice device, const VkAcquireNextImageInfoKHX* pAcquireInfo, uint32_t* pImageIndex); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkGetDeviceGroupPeerMemoryFeaturesKHX( - VkDevice device, - uint32_t heapIndex, - uint32_t localDeviceIndex, - uint32_t remoteDeviceIndex, - VkPeerMemoryFeatureFlagsKHX* pPeerMemoryFeatures); - -VKAPI_ATTR void VKAPI_CALL vkCmdSetDeviceMaskKHX( - VkCommandBuffer commandBuffer, - uint32_t deviceMask); - -VKAPI_ATTR void VKAPI_CALL vkCmdDispatchBaseKHX( - VkCommandBuffer commandBuffer, - uint32_t baseGroupX, - uint32_t baseGroupY, - uint32_t baseGroupZ, - uint32_t groupCountX, - uint32_t groupCountY, - uint32_t groupCountZ); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupPresentCapabilitiesKHX( - VkDevice device, - VkDeviceGroupPresentCapabilitiesKHX* pDeviceGroupPresentCapabilities); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModesKHX( - VkDevice device, - VkSurfaceKHR surface, - VkDeviceGroupPresentModeFlagsKHX* pModes); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDevicePresentRectanglesKHX( - VkPhysicalDevice physicalDevice, - VkSurfaceKHR surface, - uint32_t* pRectCount, - VkRect2D* pRects); - -VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImage2KHX( - VkDevice device, - const VkAcquireNextImageInfoKHX* pAcquireInfo, - uint32_t* pImageIndex); -#endif - -#define VK_EXT_validation_flags 1 -#define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 1 -#define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags" - - -typedef enum VkValidationCheckEXT { - VK_VALIDATION_CHECK_ALL_EXT = 0, - VK_VALIDATION_CHECK_SHADERS_EXT = 1, - VK_VALIDATION_CHECK_BEGIN_RANGE_EXT = VK_VALIDATION_CHECK_ALL_EXT, - VK_VALIDATION_CHECK_END_RANGE_EXT = VK_VALIDATION_CHECK_SHADERS_EXT, - VK_VALIDATION_CHECK_RANGE_SIZE_EXT = (VK_VALIDATION_CHECK_SHADERS_EXT - VK_VALIDATION_CHECK_ALL_EXT + 1), - VK_VALIDATION_CHECK_MAX_ENUM_EXT = 0x7FFFFFFF -} VkValidationCheckEXT; - -typedef struct VkValidationFlagsEXT { - VkStructureType sType; - const void* pNext; - uint32_t disabledValidationCheckCount; - VkValidationCheckEXT* pDisabledValidationChecks; -} VkValidationFlagsEXT; - - - -#ifdef VK_USE_PLATFORM_VI_NN -#define VK_NN_vi_surface 1 -#define VK_NN_VI_SURFACE_SPEC_VERSION 1 -#define VK_NN_VI_SURFACE_EXTENSION_NAME "VK_NN_vi_surface" - -typedef VkFlags VkViSurfaceCreateFlagsNN; - -typedef struct VkViSurfaceCreateInfoNN { - VkStructureType sType; - const void* pNext; - VkViSurfaceCreateFlagsNN flags; - void* window; -} VkViSurfaceCreateInfoNN; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateViSurfaceNN)(VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateViSurfaceNN( - VkInstance instance, - const VkViSurfaceCreateInfoNN* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSurfaceKHR* pSurface); -#endif -#endif /* VK_USE_PLATFORM_VI_NN */ - -#define VK_EXT_shader_subgroup_ballot 1 -#define VK_EXT_SHADER_SUBGROUP_BALLOT_SPEC_VERSION 1 -#define VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME "VK_EXT_shader_subgroup_ballot" - - -#define VK_EXT_shader_subgroup_vote 1 -#define VK_EXT_SHADER_SUBGROUP_VOTE_SPEC_VERSION 1 -#define VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME "VK_EXT_shader_subgroup_vote" - - -#define VK_KHX_device_group_creation 1 -#define VK_KHX_DEVICE_GROUP_CREATION_SPEC_VERSION 1 -#define VK_KHX_DEVICE_GROUP_CREATION_EXTENSION_NAME "VK_KHX_device_group_creation" - -typedef struct VkPhysicalDeviceGroupPropertiesKHX { - VkStructureType sType; - void* pNext; - uint32_t physicalDeviceCount; - VkPhysicalDevice physicalDevices[VK_MAX_DEVICE_GROUP_SIZE_KHX]; - VkBool32 subsetAllocation; -} VkPhysicalDeviceGroupPropertiesKHX; - -typedef struct VkDeviceGroupDeviceCreateInfoKHX { - VkStructureType sType; - const void* pNext; - uint32_t physicalDeviceCount; - const VkPhysicalDevice* pPhysicalDevices; -} VkDeviceGroupDeviceCreateInfoKHX; - - -typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDeviceGroupsKHX)(VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupPropertiesKHX* pPhysicalDeviceGroupProperties); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDeviceGroupsKHX( - VkInstance instance, - uint32_t* pPhysicalDeviceGroupCount, - VkPhysicalDeviceGroupPropertiesKHX* pPhysicalDeviceGroupProperties); -#endif - -#define VK_NVX_device_generated_commands 1 -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkObjectTableNVX) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkIndirectCommandsLayoutNVX) - -#define VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 3 -#define VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NVX_device_generated_commands" - - -typedef enum VkIndirectCommandsTokenTypeNVX { - VK_INDIRECT_COMMANDS_TOKEN_TYPE_PIPELINE_NVX = 0, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DESCRIPTOR_SET_NVX = 1, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_INDEX_BUFFER_NVX = 2, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_VERTEX_BUFFER_NVX = 3, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_NVX = 4, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_NVX = 5, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_NVX = 6, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_NVX = 7, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_BEGIN_RANGE_NVX = VK_INDIRECT_COMMANDS_TOKEN_TYPE_PIPELINE_NVX, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_END_RANGE_NVX = VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_NVX, - VK_INDIRECT_COMMANDS_TOKEN_TYPE_RANGE_SIZE_NVX = (VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_NVX - VK_INDIRECT_COMMANDS_TOKEN_TYPE_PIPELINE_NVX + 1), - VK_INDIRECT_COMMANDS_TOKEN_TYPE_MAX_ENUM_NVX = 0x7FFFFFFF -} VkIndirectCommandsTokenTypeNVX; - -typedef enum VkObjectEntryTypeNVX { - VK_OBJECT_ENTRY_TYPE_DESCRIPTOR_SET_NVX = 0, - VK_OBJECT_ENTRY_TYPE_PIPELINE_NVX = 1, - VK_OBJECT_ENTRY_TYPE_INDEX_BUFFER_NVX = 2, - VK_OBJECT_ENTRY_TYPE_VERTEX_BUFFER_NVX = 3, - VK_OBJECT_ENTRY_TYPE_PUSH_CONSTANT_NVX = 4, - VK_OBJECT_ENTRY_TYPE_BEGIN_RANGE_NVX = VK_OBJECT_ENTRY_TYPE_DESCRIPTOR_SET_NVX, - VK_OBJECT_ENTRY_TYPE_END_RANGE_NVX = VK_OBJECT_ENTRY_TYPE_PUSH_CONSTANT_NVX, - VK_OBJECT_ENTRY_TYPE_RANGE_SIZE_NVX = (VK_OBJECT_ENTRY_TYPE_PUSH_CONSTANT_NVX - VK_OBJECT_ENTRY_TYPE_DESCRIPTOR_SET_NVX + 1), - VK_OBJECT_ENTRY_TYPE_MAX_ENUM_NVX = 0x7FFFFFFF -} VkObjectEntryTypeNVX; - - -typedef enum VkIndirectCommandsLayoutUsageFlagBitsNVX { - VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX = 0x00000001, - VK_INDIRECT_COMMANDS_LAYOUT_USAGE_SPARSE_SEQUENCES_BIT_NVX = 0x00000002, - VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EMPTY_EXECUTIONS_BIT_NVX = 0x00000004, - VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NVX = 0x00000008, - VK_INDIRECT_COMMANDS_LAYOUT_USAGE_FLAG_BITS_MAX_ENUM_NVX = 0x7FFFFFFF -} VkIndirectCommandsLayoutUsageFlagBitsNVX; -typedef VkFlags VkIndirectCommandsLayoutUsageFlagsNVX; - -typedef enum VkObjectEntryUsageFlagBitsNVX { - VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX = 0x00000001, - VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX = 0x00000002, - VK_OBJECT_ENTRY_USAGE_FLAG_BITS_MAX_ENUM_NVX = 0x7FFFFFFF -} VkObjectEntryUsageFlagBitsNVX; -typedef VkFlags VkObjectEntryUsageFlagsNVX; - -typedef struct VkDeviceGeneratedCommandsFeaturesNVX { - VkStructureType sType; - const void* pNext; - VkBool32 computeBindingPointSupport; -} VkDeviceGeneratedCommandsFeaturesNVX; - -typedef struct VkDeviceGeneratedCommandsLimitsNVX { - VkStructureType sType; - const void* pNext; - uint32_t maxIndirectCommandsLayoutTokenCount; - uint32_t maxObjectEntryCounts; - uint32_t minSequenceCountBufferOffsetAlignment; - uint32_t minSequenceIndexBufferOffsetAlignment; - uint32_t minCommandsTokenBufferOffsetAlignment; -} VkDeviceGeneratedCommandsLimitsNVX; - -typedef struct VkIndirectCommandsTokenNVX { - VkIndirectCommandsTokenTypeNVX tokenType; - VkBuffer buffer; - VkDeviceSize offset; -} VkIndirectCommandsTokenNVX; - -typedef struct VkIndirectCommandsLayoutTokenNVX { - VkIndirectCommandsTokenTypeNVX tokenType; - uint32_t bindingUnit; - uint32_t dynamicCount; - uint32_t divisor; -} VkIndirectCommandsLayoutTokenNVX; - -typedef struct VkIndirectCommandsLayoutCreateInfoNVX { - VkStructureType sType; - const void* pNext; - VkPipelineBindPoint pipelineBindPoint; - VkIndirectCommandsLayoutUsageFlagsNVX flags; - uint32_t tokenCount; - const VkIndirectCommandsLayoutTokenNVX* pTokens; -} VkIndirectCommandsLayoutCreateInfoNVX; - -typedef struct VkCmdProcessCommandsInfoNVX { - VkStructureType sType; - const void* pNext; - VkObjectTableNVX objectTable; - VkIndirectCommandsLayoutNVX indirectCommandsLayout; - uint32_t indirectCommandsTokenCount; - const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens; - uint32_t maxSequencesCount; - VkCommandBuffer targetCommandBuffer; - VkBuffer sequencesCountBuffer; - VkDeviceSize sequencesCountOffset; - VkBuffer sequencesIndexBuffer; - VkDeviceSize sequencesIndexOffset; -} VkCmdProcessCommandsInfoNVX; - -typedef struct VkCmdReserveSpaceForCommandsInfoNVX { - VkStructureType sType; - const void* pNext; - VkObjectTableNVX objectTable; - VkIndirectCommandsLayoutNVX indirectCommandsLayout; - uint32_t maxSequencesCount; -} VkCmdReserveSpaceForCommandsInfoNVX; - -typedef struct VkObjectTableCreateInfoNVX { - VkStructureType sType; - const void* pNext; - uint32_t objectCount; - const VkObjectEntryTypeNVX* pObjectEntryTypes; - const uint32_t* pObjectEntryCounts; - const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags; - uint32_t maxUniformBuffersPerDescriptor; - uint32_t maxStorageBuffersPerDescriptor; - uint32_t maxStorageImagesPerDescriptor; - uint32_t maxSampledImagesPerDescriptor; - uint32_t maxPipelineLayouts; -} VkObjectTableCreateInfoNVX; - -typedef struct VkObjectTableEntryNVX { - VkObjectEntryTypeNVX type; - VkObjectEntryUsageFlagsNVX flags; -} VkObjectTableEntryNVX; - -typedef struct VkObjectTablePipelineEntryNVX { - VkObjectEntryTypeNVX type; - VkObjectEntryUsageFlagsNVX flags; - VkPipeline pipeline; -} VkObjectTablePipelineEntryNVX; - -typedef struct VkObjectTableDescriptorSetEntryNVX { - VkObjectEntryTypeNVX type; - VkObjectEntryUsageFlagsNVX flags; - VkPipelineLayout pipelineLayout; - VkDescriptorSet descriptorSet; -} VkObjectTableDescriptorSetEntryNVX; - -typedef struct VkObjectTableVertexBufferEntryNVX { - VkObjectEntryTypeNVX type; - VkObjectEntryUsageFlagsNVX flags; - VkBuffer buffer; -} VkObjectTableVertexBufferEntryNVX; - -typedef struct VkObjectTableIndexBufferEntryNVX { - VkObjectEntryTypeNVX type; - VkObjectEntryUsageFlagsNVX flags; - VkBuffer buffer; - VkIndexType indexType; -} VkObjectTableIndexBufferEntryNVX; - -typedef struct VkObjectTablePushConstantEntryNVX { - VkObjectEntryTypeNVX type; - VkObjectEntryUsageFlagsNVX flags; - VkPipelineLayout pipelineLayout; - VkShaderStageFlags stageFlags; -} VkObjectTablePushConstantEntryNVX; - - -typedef void (VKAPI_PTR *PFN_vkCmdProcessCommandsNVX)(VkCommandBuffer commandBuffer, const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo); -typedef void (VKAPI_PTR *PFN_vkCmdReserveSpaceForCommandsNVX)(VkCommandBuffer commandBuffer, const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo); -typedef VkResult (VKAPI_PTR *PFN_vkCreateIndirectCommandsLayoutNVX)(VkDevice device, const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout); -typedef void (VKAPI_PTR *PFN_vkDestroyIndirectCommandsLayoutNVX)(VkDevice device, VkIndirectCommandsLayoutNVX indirectCommandsLayout, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkCreateObjectTableNVX)(VkDevice device, const VkObjectTableCreateInfoNVX* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkObjectTableNVX* pObjectTable); -typedef void (VKAPI_PTR *PFN_vkDestroyObjectTableNVX)(VkDevice device, VkObjectTableNVX objectTable, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkRegisterObjectsNVX)(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, const VkObjectTableEntryNVX* const* ppObjectTableEntries, const uint32_t* pObjectIndices); -typedef VkResult (VKAPI_PTR *PFN_vkUnregisterObjectsNVX)(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, const VkObjectEntryTypeNVX* pObjectEntryTypes, const uint32_t* pObjectIndices); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX)(VkPhysicalDevice physicalDevice, VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, VkDeviceGeneratedCommandsLimitsNVX* pLimits); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkCmdProcessCommandsNVX( - VkCommandBuffer commandBuffer, - const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo); - -VKAPI_ATTR void VKAPI_CALL vkCmdReserveSpaceForCommandsNVX( - VkCommandBuffer commandBuffer, - const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateIndirectCommandsLayoutNVX( - VkDevice device, - const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout); - -VKAPI_ATTR void VKAPI_CALL vkDestroyIndirectCommandsLayoutNVX( - VkDevice device, - VkIndirectCommandsLayoutNVX indirectCommandsLayout, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateObjectTableNVX( - VkDevice device, - const VkObjectTableCreateInfoNVX* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkObjectTableNVX* pObjectTable); - -VKAPI_ATTR void VKAPI_CALL vkDestroyObjectTableNVX( - VkDevice device, - VkObjectTableNVX objectTable, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkRegisterObjectsNVX( - VkDevice device, - VkObjectTableNVX objectTable, - uint32_t objectCount, - const VkObjectTableEntryNVX* const* ppObjectTableEntries, - const uint32_t* pObjectIndices); - -VKAPI_ATTR VkResult VKAPI_CALL vkUnregisterObjectsNVX( - VkDevice device, - VkObjectTableNVX objectTable, - uint32_t objectCount, - const VkObjectEntryTypeNVX* pObjectEntryTypes, - const uint32_t* pObjectIndices); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( - VkPhysicalDevice physicalDevice, - VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, - VkDeviceGeneratedCommandsLimitsNVX* pLimits); -#endif - -#define VK_NV_clip_space_w_scaling 1 -#define VK_NV_CLIP_SPACE_W_SCALING_SPEC_VERSION 1 -#define VK_NV_CLIP_SPACE_W_SCALING_EXTENSION_NAME "VK_NV_clip_space_w_scaling" - -typedef struct VkViewportWScalingNV { - float xcoeff; - float ycoeff; -} VkViewportWScalingNV; - -typedef struct VkPipelineViewportWScalingStateCreateInfoNV { - VkStructureType sType; - const void* pNext; - VkBool32 viewportWScalingEnable; - uint32_t viewportCount; - const VkViewportWScalingNV* pViewportWScalings; -} VkPipelineViewportWScalingStateCreateInfoNV; - - -typedef void (VKAPI_PTR *PFN_vkCmdSetViewportWScalingNV)(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV* pViewportWScalings); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkCmdSetViewportWScalingNV( - VkCommandBuffer commandBuffer, - uint32_t firstViewport, - uint32_t viewportCount, - const VkViewportWScalingNV* pViewportWScalings); -#endif - -#define VK_EXT_direct_mode_display 1 -#define VK_EXT_DIRECT_MODE_DISPLAY_SPEC_VERSION 1 -#define VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME "VK_EXT_direct_mode_display" - -typedef VkResult (VKAPI_PTR *PFN_vkReleaseDisplayEXT)(VkPhysicalDevice physicalDevice, VkDisplayKHR display); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkReleaseDisplayEXT( - VkPhysicalDevice physicalDevice, - VkDisplayKHR display); -#endif - -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT -#define VK_EXT_acquire_xlib_display 1 -#include - -#define VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION 1 -#define VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME "VK_EXT_acquire_xlib_display" - -typedef VkResult (VKAPI_PTR *PFN_vkAcquireXlibDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, VkDisplayKHR display); -typedef VkResult (VKAPI_PTR *PFN_vkGetRandROutputDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkAcquireXlibDisplayEXT( - VkPhysicalDevice physicalDevice, - Display* dpy, - VkDisplayKHR display); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetRandROutputDisplayEXT( - VkPhysicalDevice physicalDevice, - Display* dpy, - RROutput rrOutput, - VkDisplayKHR* pDisplay); -#endif -#endif /* VK_USE_PLATFORM_XLIB_XRANDR_EXT */ - -#define VK_EXT_display_surface_counter 1 -#define VK_EXT_DISPLAY_SURFACE_COUNTER_SPEC_VERSION 1 -#define VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME "VK_EXT_display_surface_counter" -#define VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT - - -typedef enum VkSurfaceCounterFlagBitsEXT { - VK_SURFACE_COUNTER_VBLANK_EXT = 0x00000001, - VK_SURFACE_COUNTER_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkSurfaceCounterFlagBitsEXT; -typedef VkFlags VkSurfaceCounterFlagsEXT; - -typedef struct VkSurfaceCapabilities2EXT { - VkStructureType sType; - void* pNext; - uint32_t minImageCount; - uint32_t maxImageCount; - VkExtent2D currentExtent; - VkExtent2D minImageExtent; - VkExtent2D maxImageExtent; - uint32_t maxImageArrayLayers; - VkSurfaceTransformFlagsKHR supportedTransforms; - VkSurfaceTransformFlagBitsKHR currentTransform; - VkCompositeAlphaFlagsKHR supportedCompositeAlpha; - VkImageUsageFlags supportedUsageFlags; - VkSurfaceCounterFlagsEXT supportedSurfaceCounters; -} VkSurfaceCapabilities2EXT; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilities2EXT* pSurfaceCapabilities); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilities2EXT( - VkPhysicalDevice physicalDevice, - VkSurfaceKHR surface, - VkSurfaceCapabilities2EXT* pSurfaceCapabilities); -#endif - -#define VK_EXT_display_control 1 -#define VK_EXT_DISPLAY_CONTROL_SPEC_VERSION 1 -#define VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME "VK_EXT_display_control" - - -typedef enum VkDisplayPowerStateEXT { - VK_DISPLAY_POWER_STATE_OFF_EXT = 0, - VK_DISPLAY_POWER_STATE_SUSPEND_EXT = 1, - VK_DISPLAY_POWER_STATE_ON_EXT = 2, - VK_DISPLAY_POWER_STATE_BEGIN_RANGE_EXT = VK_DISPLAY_POWER_STATE_OFF_EXT, - VK_DISPLAY_POWER_STATE_END_RANGE_EXT = VK_DISPLAY_POWER_STATE_ON_EXT, - VK_DISPLAY_POWER_STATE_RANGE_SIZE_EXT = (VK_DISPLAY_POWER_STATE_ON_EXT - VK_DISPLAY_POWER_STATE_OFF_EXT + 1), - VK_DISPLAY_POWER_STATE_MAX_ENUM_EXT = 0x7FFFFFFF -} VkDisplayPowerStateEXT; - -typedef enum VkDeviceEventTypeEXT { - VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT = 0, - VK_DEVICE_EVENT_TYPE_BEGIN_RANGE_EXT = VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT, - VK_DEVICE_EVENT_TYPE_END_RANGE_EXT = VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT, - VK_DEVICE_EVENT_TYPE_RANGE_SIZE_EXT = (VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT - VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT + 1), - VK_DEVICE_EVENT_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF -} VkDeviceEventTypeEXT; - -typedef enum VkDisplayEventTypeEXT { - VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT = 0, - VK_DISPLAY_EVENT_TYPE_BEGIN_RANGE_EXT = VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT, - VK_DISPLAY_EVENT_TYPE_END_RANGE_EXT = VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT, - VK_DISPLAY_EVENT_TYPE_RANGE_SIZE_EXT = (VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT - VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT + 1), - VK_DISPLAY_EVENT_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF -} VkDisplayEventTypeEXT; - -typedef struct VkDisplayPowerInfoEXT { - VkStructureType sType; - const void* pNext; - VkDisplayPowerStateEXT powerState; -} VkDisplayPowerInfoEXT; - -typedef struct VkDeviceEventInfoEXT { - VkStructureType sType; - const void* pNext; - VkDeviceEventTypeEXT deviceEvent; -} VkDeviceEventInfoEXT; - -typedef struct VkDisplayEventInfoEXT { - VkStructureType sType; - const void* pNext; - VkDisplayEventTypeEXT displayEvent; -} VkDisplayEventInfoEXT; - -typedef struct VkSwapchainCounterCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkSurfaceCounterFlagsEXT surfaceCounters; -} VkSwapchainCounterCreateInfoEXT; - - -typedef VkResult (VKAPI_PTR *PFN_vkDisplayPowerControlEXT)(VkDevice device, VkDisplayKHR display, const VkDisplayPowerInfoEXT* pDisplayPowerInfo); -typedef VkResult (VKAPI_PTR *PFN_vkRegisterDeviceEventEXT)(VkDevice device, const VkDeviceEventInfoEXT* pDeviceEventInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence); -typedef VkResult (VKAPI_PTR *PFN_vkRegisterDisplayEventEXT)(VkDevice device, VkDisplayKHR display, const VkDisplayEventInfoEXT* pDisplayEventInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence); -typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainCounterEXT)(VkDevice device, VkSwapchainKHR swapchain, VkSurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkDisplayPowerControlEXT( - VkDevice device, - VkDisplayKHR display, - const VkDisplayPowerInfoEXT* pDisplayPowerInfo); - -VKAPI_ATTR VkResult VKAPI_CALL vkRegisterDeviceEventEXT( - VkDevice device, - const VkDeviceEventInfoEXT* pDeviceEventInfo, - const VkAllocationCallbacks* pAllocator, - VkFence* pFence); - -VKAPI_ATTR VkResult VKAPI_CALL vkRegisterDisplayEventEXT( - VkDevice device, - VkDisplayKHR display, - const VkDisplayEventInfoEXT* pDisplayEventInfo, - const VkAllocationCallbacks* pAllocator, - VkFence* pFence); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainCounterEXT( - VkDevice device, - VkSwapchainKHR swapchain, - VkSurfaceCounterFlagBitsEXT counter, - uint64_t* pCounterValue); -#endif - -#define VK_GOOGLE_display_timing 1 -#define VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION 1 -#define VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME "VK_GOOGLE_display_timing" - -typedef struct VkRefreshCycleDurationGOOGLE { - uint64_t refreshDuration; -} VkRefreshCycleDurationGOOGLE; - -typedef struct VkPastPresentationTimingGOOGLE { - uint32_t presentID; - uint64_t desiredPresentTime; - uint64_t actualPresentTime; - uint64_t earliestPresentTime; - uint64_t presentMargin; -} VkPastPresentationTimingGOOGLE; - -typedef struct VkPresentTimeGOOGLE { - uint32_t presentID; - uint64_t desiredPresentTime; -} VkPresentTimeGOOGLE; - -typedef struct VkPresentTimesInfoGOOGLE { - VkStructureType sType; - const void* pNext; - uint32_t swapchainCount; - const VkPresentTimeGOOGLE* pTimes; -} VkPresentTimesInfoGOOGLE; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetRefreshCycleDurationGOOGLE)(VkDevice device, VkSwapchainKHR swapchain, VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties); -typedef VkResult (VKAPI_PTR *PFN_vkGetPastPresentationTimingGOOGLE)(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pPresentationTimingCount, VkPastPresentationTimingGOOGLE* pPresentationTimings); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetRefreshCycleDurationGOOGLE( - VkDevice device, - VkSwapchainKHR swapchain, - VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPastPresentationTimingGOOGLE( - VkDevice device, - VkSwapchainKHR swapchain, - uint32_t* pPresentationTimingCount, - VkPastPresentationTimingGOOGLE* pPresentationTimings); -#endif - -#define VK_NV_sample_mask_override_coverage 1 -#define VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_SPEC_VERSION 1 -#define VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_EXTENSION_NAME "VK_NV_sample_mask_override_coverage" - - -#define VK_NV_geometry_shader_passthrough 1 -#define VK_NV_GEOMETRY_SHADER_PASSTHROUGH_SPEC_VERSION 1 -#define VK_NV_GEOMETRY_SHADER_PASSTHROUGH_EXTENSION_NAME "VK_NV_geometry_shader_passthrough" - - -#define VK_NV_viewport_array2 1 -#define VK_NV_VIEWPORT_ARRAY2_SPEC_VERSION 1 -#define VK_NV_VIEWPORT_ARRAY2_EXTENSION_NAME "VK_NV_viewport_array2" - - -#define VK_NVX_multiview_per_view_attributes 1 -#define VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION 1 -#define VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME "VK_NVX_multiview_per_view_attributes" - -typedef struct VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX { - VkStructureType sType; - void* pNext; - VkBool32 perViewPositionAllComponents; -} VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX; - - - -#define VK_NV_viewport_swizzle 1 -#define VK_NV_VIEWPORT_SWIZZLE_SPEC_VERSION 1 -#define VK_NV_VIEWPORT_SWIZZLE_EXTENSION_NAME "VK_NV_viewport_swizzle" - - -typedef enum VkViewportCoordinateSwizzleNV { - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV = 0, - VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_X_NV = 1, - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Y_NV = 2, - VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Y_NV = 3, - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Z_NV = 4, - VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Z_NV = 5, - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_W_NV = 6, - VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV = 7, - VK_VIEWPORT_COORDINATE_SWIZZLE_BEGIN_RANGE_NV = VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV, - VK_VIEWPORT_COORDINATE_SWIZZLE_END_RANGE_NV = VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV, - VK_VIEWPORT_COORDINATE_SWIZZLE_RANGE_SIZE_NV = (VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV + 1), - VK_VIEWPORT_COORDINATE_SWIZZLE_MAX_ENUM_NV = 0x7FFFFFFF -} VkViewportCoordinateSwizzleNV; - -typedef VkFlags VkPipelineViewportSwizzleStateCreateFlagsNV; - -typedef struct VkViewportSwizzleNV { - VkViewportCoordinateSwizzleNV x; - VkViewportCoordinateSwizzleNV y; - VkViewportCoordinateSwizzleNV z; - VkViewportCoordinateSwizzleNV w; -} VkViewportSwizzleNV; - -typedef struct VkPipelineViewportSwizzleStateCreateInfoNV { - VkStructureType sType; - const void* pNext; - VkPipelineViewportSwizzleStateCreateFlagsNV flags; - uint32_t viewportCount; - const VkViewportSwizzleNV* pViewportSwizzles; -} VkPipelineViewportSwizzleStateCreateInfoNV; - - - -#define VK_EXT_discard_rectangles 1 -#define VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION 1 -#define VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME "VK_EXT_discard_rectangles" - - -typedef enum VkDiscardRectangleModeEXT { - VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT = 0, - VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT = 1, - VK_DISCARD_RECTANGLE_MODE_BEGIN_RANGE_EXT = VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT, - VK_DISCARD_RECTANGLE_MODE_END_RANGE_EXT = VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT, - VK_DISCARD_RECTANGLE_MODE_RANGE_SIZE_EXT = (VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT - VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT + 1), - VK_DISCARD_RECTANGLE_MODE_MAX_ENUM_EXT = 0x7FFFFFFF -} VkDiscardRectangleModeEXT; - -typedef VkFlags VkPipelineDiscardRectangleStateCreateFlagsEXT; - -typedef struct VkPhysicalDeviceDiscardRectanglePropertiesEXT { - VkStructureType sType; - void* pNext; - uint32_t maxDiscardRectangles; -} VkPhysicalDeviceDiscardRectanglePropertiesEXT; - -typedef struct VkPipelineDiscardRectangleStateCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkPipelineDiscardRectangleStateCreateFlagsEXT flags; - VkDiscardRectangleModeEXT discardRectangleMode; - uint32_t discardRectangleCount; - const VkRect2D* pDiscardRectangles; -} VkPipelineDiscardRectangleStateCreateInfoEXT; - - -typedef void (VKAPI_PTR *PFN_vkCmdSetDiscardRectangleEXT)(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkCmdSetDiscardRectangleEXT( - VkCommandBuffer commandBuffer, - uint32_t firstDiscardRectangle, - uint32_t discardRectangleCount, - const VkRect2D* pDiscardRectangles); -#endif - -#define VK_EXT_conservative_rasterization 1 -#define VK_EXT_CONSERVATIVE_RASTERIZATION_SPEC_VERSION 1 -#define VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME "VK_EXT_conservative_rasterization" - - -typedef enum VkConservativeRasterizationModeEXT { - VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT = 0, - VK_CONSERVATIVE_RASTERIZATION_MODE_OVERESTIMATE_EXT = 1, - VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT = 2, - VK_CONSERVATIVE_RASTERIZATION_MODE_BEGIN_RANGE_EXT = VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT, - VK_CONSERVATIVE_RASTERIZATION_MODE_END_RANGE_EXT = VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT, - VK_CONSERVATIVE_RASTERIZATION_MODE_RANGE_SIZE_EXT = (VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT - VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT + 1), - VK_CONSERVATIVE_RASTERIZATION_MODE_MAX_ENUM_EXT = 0x7FFFFFFF -} VkConservativeRasterizationModeEXT; - -typedef VkFlags VkPipelineRasterizationConservativeStateCreateFlagsEXT; - -typedef struct VkPhysicalDeviceConservativeRasterizationPropertiesEXT { - VkStructureType sType; - void* pNext; - float primitiveOverestimationSize; - float maxExtraPrimitiveOverestimationSize; - float extraPrimitiveOverestimationSizeGranularity; - VkBool32 primitiveUnderestimation; - VkBool32 conservativePointAndLineRasterization; - VkBool32 degenerateTrianglesRasterized; - VkBool32 degenerateLinesRasterized; - VkBool32 fullyCoveredFragmentShaderInputVariable; - VkBool32 conservativeRasterizationPostDepthCoverage; -} VkPhysicalDeviceConservativeRasterizationPropertiesEXT; - -typedef struct VkPipelineRasterizationConservativeStateCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkPipelineRasterizationConservativeStateCreateFlagsEXT flags; - VkConservativeRasterizationModeEXT conservativeRasterizationMode; - float extraPrimitiveOverestimationSize; -} VkPipelineRasterizationConservativeStateCreateInfoEXT; - - - -#define VK_EXT_swapchain_colorspace 1 -#define VK_EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION 3 -#define VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME "VK_EXT_swapchain_colorspace" - - -#define VK_EXT_hdr_metadata 1 -#define VK_EXT_HDR_METADATA_SPEC_VERSION 1 -#define VK_EXT_HDR_METADATA_EXTENSION_NAME "VK_EXT_hdr_metadata" - -typedef struct VkXYColorEXT { - float x; - float y; -} VkXYColorEXT; - -typedef struct VkHdrMetadataEXT { - VkStructureType sType; - const void* pNext; - VkXYColorEXT displayPrimaryRed; - VkXYColorEXT displayPrimaryGreen; - VkXYColorEXT displayPrimaryBlue; - VkXYColorEXT whitePoint; - float maxLuminance; - float minLuminance; - float maxContentLightLevel; - float maxFrameAverageLightLevel; -} VkHdrMetadataEXT; - - -typedef void (VKAPI_PTR *PFN_vkSetHdrMetadataEXT)(VkDevice device, uint32_t swapchainCount, const VkSwapchainKHR* pSwapchains, const VkHdrMetadataEXT* pMetadata); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkSetHdrMetadataEXT( - VkDevice device, - uint32_t swapchainCount, - const VkSwapchainKHR* pSwapchains, - const VkHdrMetadataEXT* pMetadata); -#endif - -#ifdef VK_USE_PLATFORM_IOS_MVK -#define VK_MVK_ios_surface 1 -#define VK_MVK_IOS_SURFACE_SPEC_VERSION 2 -#define VK_MVK_IOS_SURFACE_EXTENSION_NAME "VK_MVK_ios_surface" - -typedef VkFlags VkIOSSurfaceCreateFlagsMVK; - -typedef struct VkIOSSurfaceCreateInfoMVK { - VkStructureType sType; - const void* pNext; - VkIOSSurfaceCreateFlagsMVK flags; - const void* pView; -} VkIOSSurfaceCreateInfoMVK; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateIOSSurfaceMVK)(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateIOSSurfaceMVK( - VkInstance instance, - const VkIOSSurfaceCreateInfoMVK* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSurfaceKHR* pSurface); -#endif -#endif /* VK_USE_PLATFORM_IOS_MVK */ - -#ifdef VK_USE_PLATFORM_MACOS_MVK -#define VK_MVK_macos_surface 1 -#define VK_MVK_MACOS_SURFACE_SPEC_VERSION 2 -#define VK_MVK_MACOS_SURFACE_EXTENSION_NAME "VK_MVK_macos_surface" - -typedef VkFlags VkMacOSSurfaceCreateFlagsMVK; - -typedef struct VkMacOSSurfaceCreateInfoMVK { - VkStructureType sType; - const void* pNext; - VkMacOSSurfaceCreateFlagsMVK flags; - const void* pView; -} VkMacOSSurfaceCreateInfoMVK; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateMacOSSurfaceMVK)(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateMacOSSurfaceMVK( - VkInstance instance, - const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSurfaceKHR* pSurface); -#endif -#endif /* VK_USE_PLATFORM_MACOS_MVK */ - -#define VK_EXT_external_memory_dma_buf 1 -#define VK_EXT_EXTERNAL_MEMORY_DMA_BUF_SPEC_VERSION 1 -#define VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME "VK_EXT_external_memory_dma_buf" - - -#define VK_EXT_queue_family_foreign 1 -#define VK_EXT_QUEUE_FAMILY_FOREIGN_SPEC_VERSION 1 -#define VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME "VK_EXT_queue_family_foreign" -#define VK_QUEUE_FAMILY_FOREIGN_EXT (~0U-2) - - -#define VK_EXT_sampler_filter_minmax 1 -#define VK_EXT_SAMPLER_FILTER_MINMAX_SPEC_VERSION 1 -#define VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME "VK_EXT_sampler_filter_minmax" - - -typedef enum VkSamplerReductionModeEXT { - VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT = 0, - VK_SAMPLER_REDUCTION_MODE_MIN_EXT = 1, - VK_SAMPLER_REDUCTION_MODE_MAX_EXT = 2, - VK_SAMPLER_REDUCTION_MODE_BEGIN_RANGE_EXT = VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT, - VK_SAMPLER_REDUCTION_MODE_END_RANGE_EXT = VK_SAMPLER_REDUCTION_MODE_MAX_EXT, - VK_SAMPLER_REDUCTION_MODE_RANGE_SIZE_EXT = (VK_SAMPLER_REDUCTION_MODE_MAX_EXT - VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT + 1), - VK_SAMPLER_REDUCTION_MODE_MAX_ENUM_EXT = 0x7FFFFFFF -} VkSamplerReductionModeEXT; - -typedef struct VkSamplerReductionModeCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkSamplerReductionModeEXT reductionMode; -} VkSamplerReductionModeCreateInfoEXT; - -typedef struct VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT { - VkStructureType sType; - void* pNext; - VkBool32 filterMinmaxSingleComponentFormats; - VkBool32 filterMinmaxImageComponentMapping; -} VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT; - - - -#define VK_AMD_gpu_shader_int16 1 -#define VK_AMD_GPU_SHADER_INT16_SPEC_VERSION 1 -#define VK_AMD_GPU_SHADER_INT16_EXTENSION_NAME "VK_AMD_gpu_shader_int16" - - -#define VK_AMD_mixed_attachment_samples 1 -#define VK_AMD_MIXED_ATTACHMENT_SAMPLES_SPEC_VERSION 1 -#define VK_AMD_MIXED_ATTACHMENT_SAMPLES_EXTENSION_NAME "VK_AMD_mixed_attachment_samples" - - -#define VK_AMD_shader_fragment_mask 1 -#define VK_AMD_SHADER_FRAGMENT_MASK_SPEC_VERSION 1 -#define VK_AMD_SHADER_FRAGMENT_MASK_EXTENSION_NAME "VK_AMD_shader_fragment_mask" - - -#define VK_EXT_shader_stencil_export 1 -#define VK_EXT_SHADER_STENCIL_EXPORT_SPEC_VERSION 1 -#define VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME "VK_EXT_shader_stencil_export" - - -#define VK_EXT_sample_locations 1 -#define VK_EXT_SAMPLE_LOCATIONS_SPEC_VERSION 1 -#define VK_EXT_SAMPLE_LOCATIONS_EXTENSION_NAME "VK_EXT_sample_locations" - -typedef struct VkSampleLocationEXT { - float x; - float y; -} VkSampleLocationEXT; - -typedef struct VkSampleLocationsInfoEXT { - VkStructureType sType; - const void* pNext; - VkSampleCountFlagBits sampleLocationsPerPixel; - VkExtent2D sampleLocationGridSize; - uint32_t sampleLocationsCount; - const VkSampleLocationEXT* pSampleLocations; -} VkSampleLocationsInfoEXT; - -typedef struct VkAttachmentSampleLocationsEXT { - uint32_t attachmentIndex; - VkSampleLocationsInfoEXT sampleLocationsInfo; -} VkAttachmentSampleLocationsEXT; - -typedef struct VkSubpassSampleLocationsEXT { - uint32_t subpassIndex; - VkSampleLocationsInfoEXT sampleLocationsInfo; -} VkSubpassSampleLocationsEXT; - -typedef struct VkRenderPassSampleLocationsBeginInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t attachmentInitialSampleLocationsCount; - const VkAttachmentSampleLocationsEXT* pAttachmentInitialSampleLocations; - uint32_t postSubpassSampleLocationsCount; - const VkSubpassSampleLocationsEXT* pPostSubpassSampleLocations; -} VkRenderPassSampleLocationsBeginInfoEXT; - -typedef struct VkPipelineSampleLocationsStateCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkBool32 sampleLocationsEnable; - VkSampleLocationsInfoEXT sampleLocationsInfo; -} VkPipelineSampleLocationsStateCreateInfoEXT; - -typedef struct VkPhysicalDeviceSampleLocationsPropertiesEXT { - VkStructureType sType; - void* pNext; - VkSampleCountFlags sampleLocationSampleCounts; - VkExtent2D maxSampleLocationGridSize; - float sampleLocationCoordinateRange[2]; - uint32_t sampleLocationSubPixelBits; - VkBool32 variableSampleLocations; -} VkPhysicalDeviceSampleLocationsPropertiesEXT; - -typedef struct VkMultisamplePropertiesEXT { - VkStructureType sType; - void* pNext; - VkExtent2D maxSampleLocationGridSize; -} VkMultisamplePropertiesEXT; - - -typedef void (VKAPI_PTR *PFN_vkCmdSetSampleLocationsEXT)(VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT* pSampleLocationsInfo); -typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT)(VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT* pMultisampleProperties); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkCmdSetSampleLocationsEXT( - VkCommandBuffer commandBuffer, - const VkSampleLocationsInfoEXT* pSampleLocationsInfo); - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMultisamplePropertiesEXT( - VkPhysicalDevice physicalDevice, - VkSampleCountFlagBits samples, - VkMultisamplePropertiesEXT* pMultisampleProperties); -#endif - -#define VK_EXT_blend_operation_advanced 1 -#define VK_EXT_BLEND_OPERATION_ADVANCED_SPEC_VERSION 2 -#define VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME "VK_EXT_blend_operation_advanced" - - -typedef enum VkBlendOverlapEXT { - VK_BLEND_OVERLAP_UNCORRELATED_EXT = 0, - VK_BLEND_OVERLAP_DISJOINT_EXT = 1, - VK_BLEND_OVERLAP_CONJOINT_EXT = 2, - VK_BLEND_OVERLAP_BEGIN_RANGE_EXT = VK_BLEND_OVERLAP_UNCORRELATED_EXT, - VK_BLEND_OVERLAP_END_RANGE_EXT = VK_BLEND_OVERLAP_CONJOINT_EXT, - VK_BLEND_OVERLAP_RANGE_SIZE_EXT = (VK_BLEND_OVERLAP_CONJOINT_EXT - VK_BLEND_OVERLAP_UNCORRELATED_EXT + 1), - VK_BLEND_OVERLAP_MAX_ENUM_EXT = 0x7FFFFFFF -} VkBlendOverlapEXT; - -typedef struct VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT { - VkStructureType sType; - void* pNext; - VkBool32 advancedBlendCoherentOperations; -} VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT; - -typedef struct VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT { - VkStructureType sType; - void* pNext; - uint32_t advancedBlendMaxColorAttachments; - VkBool32 advancedBlendIndependentBlend; - VkBool32 advancedBlendNonPremultipliedSrcColor; - VkBool32 advancedBlendNonPremultipliedDstColor; - VkBool32 advancedBlendCorrelatedOverlap; - VkBool32 advancedBlendAllOperations; -} VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT; - -typedef struct VkPipelineColorBlendAdvancedStateCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkBool32 srcPremultiplied; - VkBool32 dstPremultiplied; - VkBlendOverlapEXT blendOverlap; -} VkPipelineColorBlendAdvancedStateCreateInfoEXT; - - - -#define VK_NV_fragment_coverage_to_color 1 -#define VK_NV_FRAGMENT_COVERAGE_TO_COLOR_SPEC_VERSION 1 -#define VK_NV_FRAGMENT_COVERAGE_TO_COLOR_EXTENSION_NAME "VK_NV_fragment_coverage_to_color" - -typedef VkFlags VkPipelineCoverageToColorStateCreateFlagsNV; - -typedef struct VkPipelineCoverageToColorStateCreateInfoNV { - VkStructureType sType; - const void* pNext; - VkPipelineCoverageToColorStateCreateFlagsNV flags; - VkBool32 coverageToColorEnable; - uint32_t coverageToColorLocation; -} VkPipelineCoverageToColorStateCreateInfoNV; - - - -#define VK_NV_framebuffer_mixed_samples 1 -#define VK_NV_FRAMEBUFFER_MIXED_SAMPLES_SPEC_VERSION 1 -#define VK_NV_FRAMEBUFFER_MIXED_SAMPLES_EXTENSION_NAME "VK_NV_framebuffer_mixed_samples" - - -typedef enum VkCoverageModulationModeNV { - VK_COVERAGE_MODULATION_MODE_NONE_NV = 0, - VK_COVERAGE_MODULATION_MODE_RGB_NV = 1, - VK_COVERAGE_MODULATION_MODE_ALPHA_NV = 2, - VK_COVERAGE_MODULATION_MODE_RGBA_NV = 3, - VK_COVERAGE_MODULATION_MODE_BEGIN_RANGE_NV = VK_COVERAGE_MODULATION_MODE_NONE_NV, - VK_COVERAGE_MODULATION_MODE_END_RANGE_NV = VK_COVERAGE_MODULATION_MODE_RGBA_NV, - VK_COVERAGE_MODULATION_MODE_RANGE_SIZE_NV = (VK_COVERAGE_MODULATION_MODE_RGBA_NV - VK_COVERAGE_MODULATION_MODE_NONE_NV + 1), - VK_COVERAGE_MODULATION_MODE_MAX_ENUM_NV = 0x7FFFFFFF -} VkCoverageModulationModeNV; - -typedef VkFlags VkPipelineCoverageModulationStateCreateFlagsNV; - -typedef struct VkPipelineCoverageModulationStateCreateInfoNV { - VkStructureType sType; - const void* pNext; - VkPipelineCoverageModulationStateCreateFlagsNV flags; - VkCoverageModulationModeNV coverageModulationMode; - VkBool32 coverageModulationTableEnable; - uint32_t coverageModulationTableCount; - const float* pCoverageModulationTable; -} VkPipelineCoverageModulationStateCreateInfoNV; - - - -#define VK_NV_fill_rectangle 1 -#define VK_NV_FILL_RECTANGLE_SPEC_VERSION 1 -#define VK_NV_FILL_RECTANGLE_EXTENSION_NAME "VK_NV_fill_rectangle" - - -#define VK_EXT_post_depth_coverage 1 -#define VK_EXT_POST_DEPTH_COVERAGE_SPEC_VERSION 1 -#define VK_EXT_POST_DEPTH_COVERAGE_EXTENSION_NAME "VK_EXT_post_depth_coverage" - - -#define VK_EXT_validation_cache 1 -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkValidationCacheEXT) - -#define VK_EXT_VALIDATION_CACHE_SPEC_VERSION 1 -#define VK_EXT_VALIDATION_CACHE_EXTENSION_NAME "VK_EXT_validation_cache" -#define VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT - - -typedef enum VkValidationCacheHeaderVersionEXT { - VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT = 1, - VK_VALIDATION_CACHE_HEADER_VERSION_BEGIN_RANGE_EXT = VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT, - VK_VALIDATION_CACHE_HEADER_VERSION_END_RANGE_EXT = VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT, - VK_VALIDATION_CACHE_HEADER_VERSION_RANGE_SIZE_EXT = (VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT - VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT + 1), - VK_VALIDATION_CACHE_HEADER_VERSION_MAX_ENUM_EXT = 0x7FFFFFFF -} VkValidationCacheHeaderVersionEXT; - -typedef VkFlags VkValidationCacheCreateFlagsEXT; - -typedef struct VkValidationCacheCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkValidationCacheCreateFlagsEXT flags; - size_t initialDataSize; - const void* pInitialData; -} VkValidationCacheCreateInfoEXT; - -typedef struct VkShaderModuleValidationCacheCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkValidationCacheEXT validationCache; -} VkShaderModuleValidationCacheCreateInfoEXT; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateValidationCacheEXT)(VkDevice device, const VkValidationCacheCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkValidationCacheEXT* pValidationCache); -typedef void (VKAPI_PTR *PFN_vkDestroyValidationCacheEXT)(VkDevice device, VkValidationCacheEXT validationCache, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkMergeValidationCachesEXT)(VkDevice device, VkValidationCacheEXT dstCache, uint32_t srcCacheCount, const VkValidationCacheEXT* pSrcCaches); -typedef VkResult (VKAPI_PTR *PFN_vkGetValidationCacheDataEXT)(VkDevice device, VkValidationCacheEXT validationCache, size_t* pDataSize, void* pData); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateValidationCacheEXT( - VkDevice device, - const VkValidationCacheCreateInfoEXT* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkValidationCacheEXT* pValidationCache); - -VKAPI_ATTR void VKAPI_CALL vkDestroyValidationCacheEXT( - VkDevice device, - VkValidationCacheEXT validationCache, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkMergeValidationCachesEXT( - VkDevice device, - VkValidationCacheEXT dstCache, - uint32_t srcCacheCount, - const VkValidationCacheEXT* pSrcCaches); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetValidationCacheDataEXT( - VkDevice device, - VkValidationCacheEXT validationCache, - size_t* pDataSize, - void* pData); -#endif - -#define VK_EXT_shader_viewport_index_layer 1 -#define VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_SPEC_VERSION 1 -#define VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME "VK_EXT_shader_viewport_index_layer" - - -#define VK_EXT_global_priority 1 -#define VK_EXT_GLOBAL_PRIORITY_SPEC_VERSION 2 -#define VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME "VK_EXT_global_priority" - - -typedef enum VkQueueGlobalPriorityEXT { - VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT = 128, - VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT = 256, - VK_QUEUE_GLOBAL_PRIORITY_HIGH_EXT = 512, - VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT = 1024, - VK_QUEUE_GLOBAL_PRIORITY_BEGIN_RANGE_EXT = VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT, - VK_QUEUE_GLOBAL_PRIORITY_END_RANGE_EXT = VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT, - VK_QUEUE_GLOBAL_PRIORITY_RANGE_SIZE_EXT = (VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT - VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT + 1), - VK_QUEUE_GLOBAL_PRIORITY_MAX_ENUM_EXT = 0x7FFFFFFF -} VkQueueGlobalPriorityEXT; - -typedef struct VkDeviceQueueGlobalPriorityCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkQueueGlobalPriorityEXT globalPriority; -} VkDeviceQueueGlobalPriorityCreateInfoEXT; - - - -#define VK_EXT_external_memory_host 1 -#define VK_EXT_EXTERNAL_MEMORY_HOST_SPEC_VERSION 1 -#define VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME "VK_EXT_external_memory_host" - -typedef struct VkImportMemoryHostPointerInfoEXT { - VkStructureType sType; - const void* pNext; - VkExternalMemoryHandleTypeFlagBitsKHR handleType; - void* pHostPointer; -} VkImportMemoryHostPointerInfoEXT; - -typedef struct VkMemoryHostPointerPropertiesEXT { - VkStructureType sType; - void* pNext; - uint32_t memoryTypeBits; -} VkMemoryHostPointerPropertiesEXT; - -typedef struct VkPhysicalDeviceExternalMemoryHostPropertiesEXT { - VkStructureType sType; - void* pNext; - VkDeviceSize minImportedHostPointerAlignment; -} VkPhysicalDeviceExternalMemoryHostPropertiesEXT; - - -typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryHostPointerPropertiesEXT)(VkDevice device, VkExternalMemoryHandleTypeFlagBitsKHR handleType, const void* pHostPointer, VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryHostPointerPropertiesEXT( - VkDevice device, - VkExternalMemoryHandleTypeFlagBitsKHR handleType, - const void* pHostPointer, - VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties); -#endif - -#ifdef __cplusplus -} -#endif - -#endif +#endif // VULKAN_H_ diff --git a/include/vulkan/vulkan_core.h b/include/vulkan/vulkan_core.h new file mode 100644 index 00000000..c115fa66 --- /dev/null +++ b/include/vulkan/vulkan_core.h @@ -0,0 +1,7334 @@ +#ifndef VULKAN_CORE_H_ +#define VULKAN_CORE_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_VERSION_1_0 1 +#include "vk_platform.h" + +#define VK_MAKE_VERSION(major, minor, patch) \ + (((major) << 22) | ((minor) << 12) | (patch)) + +// DEPRECATED: This define has been removed. Specific version defines (e.g. VK_API_VERSION_1_0), or the VK_MAKE_VERSION macro, should be used instead. +//#define VK_API_VERSION VK_MAKE_VERSION(1, 0, 0) // Patch version should always be set to 0 + +// Vulkan 1.0 version number +#define VK_API_VERSION_1_0 VK_MAKE_VERSION(1, 0, 0)// Patch version should always be set to 0 + +#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22) +#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) +#define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff) +// Version of this file +#define VK_HEADER_VERSION 70 + + +#define VK_NULL_HANDLE 0 + + + +#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object; + + +#if !defined(VK_DEFINE_NON_DISPATCHABLE_HANDLE) +#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) + #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object; +#else + #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object; +#endif +#endif + + + +typedef uint32_t VkFlags; +typedef uint32_t VkBool32; +typedef uint64_t VkDeviceSize; +typedef uint32_t VkSampleMask; + +VK_DEFINE_HANDLE(VkInstance) +VK_DEFINE_HANDLE(VkPhysicalDevice) +VK_DEFINE_HANDLE(VkDevice) +VK_DEFINE_HANDLE(VkQueue) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSemaphore) +VK_DEFINE_HANDLE(VkCommandBuffer) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFence) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeviceMemory) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBuffer) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImage) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkEvent) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkQueryPool) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferView) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImageView) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderModule) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineCache) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineLayout) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkRenderPass) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipeline) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSetLayout) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSampler) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorPool) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSet) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFramebuffer) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool) + +#define VK_LOD_CLAMP_NONE 1000.0f +#define VK_REMAINING_MIP_LEVELS (~0U) +#define VK_REMAINING_ARRAY_LAYERS (~0U) +#define VK_WHOLE_SIZE (~0ULL) +#define VK_ATTACHMENT_UNUSED (~0U) +#define VK_TRUE 1 +#define VK_FALSE 0 +#define VK_QUEUE_FAMILY_IGNORED (~0U) +#define VK_SUBPASS_EXTERNAL (~0U) +#define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256 +#define VK_UUID_SIZE 16 +#define VK_MAX_MEMORY_TYPES 32 +#define VK_MAX_MEMORY_HEAPS 16 +#define VK_MAX_EXTENSION_NAME_SIZE 256 +#define VK_MAX_DESCRIPTION_SIZE 256 + + +typedef enum VkPipelineCacheHeaderVersion { + VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1, + VK_PIPELINE_CACHE_HEADER_VERSION_BEGIN_RANGE = VK_PIPELINE_CACHE_HEADER_VERSION_ONE, + VK_PIPELINE_CACHE_HEADER_VERSION_END_RANGE = VK_PIPELINE_CACHE_HEADER_VERSION_ONE, + VK_PIPELINE_CACHE_HEADER_VERSION_RANGE_SIZE = (VK_PIPELINE_CACHE_HEADER_VERSION_ONE - VK_PIPELINE_CACHE_HEADER_VERSION_ONE + 1), + VK_PIPELINE_CACHE_HEADER_VERSION_MAX_ENUM = 0x7FFFFFFF +} VkPipelineCacheHeaderVersion; + +typedef enum VkResult { + VK_SUCCESS = 0, + VK_NOT_READY = 1, + VK_TIMEOUT = 2, + VK_EVENT_SET = 3, + VK_EVENT_RESET = 4, + VK_INCOMPLETE = 5, + VK_ERROR_OUT_OF_HOST_MEMORY = -1, + VK_ERROR_OUT_OF_DEVICE_MEMORY = -2, + VK_ERROR_INITIALIZATION_FAILED = -3, + VK_ERROR_DEVICE_LOST = -4, + VK_ERROR_MEMORY_MAP_FAILED = -5, + VK_ERROR_LAYER_NOT_PRESENT = -6, + VK_ERROR_EXTENSION_NOT_PRESENT = -7, + VK_ERROR_FEATURE_NOT_PRESENT = -8, + VK_ERROR_INCOMPATIBLE_DRIVER = -9, + VK_ERROR_TOO_MANY_OBJECTS = -10, + VK_ERROR_FORMAT_NOT_SUPPORTED = -11, + VK_ERROR_FRAGMENTED_POOL = -12, + VK_ERROR_OUT_OF_POOL_MEMORY = -1000069000, + VK_ERROR_INVALID_EXTERNAL_HANDLE = -1000072003, + VK_ERROR_SURFACE_LOST_KHR = -1000000000, + VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001, + VK_SUBOPTIMAL_KHR = 1000001003, + VK_ERROR_OUT_OF_DATE_KHR = -1000001004, + VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001, + VK_ERROR_VALIDATION_FAILED_EXT = -1000011001, + VK_ERROR_INVALID_SHADER_NV = -1000012000, + VK_ERROR_NOT_PERMITTED_EXT = -1000174001, + VK_ERROR_OUT_OF_POOL_MEMORY_KHR = VK_ERROR_OUT_OF_POOL_MEMORY, + VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR = VK_ERROR_INVALID_EXTERNAL_HANDLE, + VK_RESULT_BEGIN_RANGE = VK_ERROR_FRAGMENTED_POOL, + VK_RESULT_END_RANGE = VK_INCOMPLETE, + VK_RESULT_RANGE_SIZE = (VK_INCOMPLETE - VK_ERROR_FRAGMENTED_POOL + 1), + VK_RESULT_MAX_ENUM = 0x7FFFFFFF +} VkResult; + +typedef enum VkStructureType { + VK_STRUCTURE_TYPE_APPLICATION_INFO = 0, + VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1, + VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2, + VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3, + VK_STRUCTURE_TYPE_SUBMIT_INFO = 4, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5, + VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6, + VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7, + VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8, + VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9, + VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10, + VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11, + VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12, + VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13, + VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14, + VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15, + VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16, + VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17, + VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18, + VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19, + VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20, + VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23, + VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24, + VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25, + VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26, + VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27, + VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28, + VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29, + VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30, + VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32, + VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34, + VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35, + VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36, + VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37, + VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38, + VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39, + VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40, + VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41, + VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42, + VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43, + VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44, + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45, + VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46, + VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47, + VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES = 1000094000, + VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO = 1000157000, + VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO = 1000157001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES = 1000083000, + VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS = 1000127000, + VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO = 1000127001, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO = 1000060000, + VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO = 1000060003, + VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO = 1000060004, + VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO = 1000060005, + VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO = 1000060006, + VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO = 1000060013, + VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO = 1000060014, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES = 1000070000, + VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO = 1000070001, + VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2 = 1000146000, + VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2 = 1000146001, + VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2 = 1000146002, + VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2 = 1000146003, + VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2 = 1000146004, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2 = 1000059000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2 = 1000059001, + VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2 = 1000059002, + VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2 = 1000059003, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2 = 1000059004, + VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2 = 1000059005, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2 = 1000059006, + VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2 = 1000059007, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2 = 1000059008, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES = 1000117000, + VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO = 1000117001, + VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO = 1000117002, + VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO = 1000117003, + VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO = 1000053000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES = 1000053001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES = 1000053002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES = 1000120000, + VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO = 1000145000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES = 1000145001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES = 1000145002, + VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2 = 1000145003, + VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO = 1000156000, + VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO = 1000156001, + VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO = 1000156002, + VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO = 1000156003, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES = 1000156004, + VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES = 1000156005, + VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO = 1000085000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO = 1000071000, + VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES = 1000071001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO = 1000071002, + VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES = 1000071003, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES = 1000071004, + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO = 1000072000, + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO = 1000072001, + VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO = 1000072002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO = 1000112000, + VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES = 1000112001, + VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO = 1000113000, + VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO = 1000077000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO = 1000076000, + VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES = 1000076001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES = 1000168000, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT = 1000168001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES = 1000063000, + VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000, + VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001, + VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR = 1000060007, + VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR = 1000060008, + VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR = 1000060009, + VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR = 1000060010, + VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR = 1000060011, + VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR = 1000060012, + VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000, + VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001, + VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR = 1000003000, + VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000, + VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000, + VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000, + VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000, + VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000, + VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000, + VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000, + VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000, + VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001, + VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002, + VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000, + VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001, + VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002, + VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD = 1000041000, + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000, + VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001, + VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000, + VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001, + VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000, + VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000, + VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN = 1000062000, + VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR = 1000073000, + VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR = 1000073001, + VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR = 1000073002, + VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR = 1000073003, + VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR = 1000074000, + VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR = 1000074001, + VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR = 1000074002, + VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR = 1000075000, + VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR = 1000078000, + VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR = 1000078001, + VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR = 1000078002, + VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR = 1000078003, + VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR = 1000079000, + VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR = 1000079001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR = 1000080000, + VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000, + VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000, + VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001, + VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002, + VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003, + VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004, + VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV = 1000087000, + VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT = 1000090000, + VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT = 1000091000, + VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT = 1000091001, + VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT = 1000091002, + VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT = 1000091003, + VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE = 1000092000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX = 1000097000, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV = 1000098000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT = 1000099000, + VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT = 1000099001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT = 1000101000, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT = 1000101001, + VK_STRUCTURE_TYPE_HDR_METADATA_EXT = 1000105000, + VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR = 1000111000, + VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR = 1000114000, + VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR = 1000114001, + VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR = 1000114002, + VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR = 1000115000, + VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR = 1000115001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR = 1000119000, + VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR = 1000119001, + VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR = 1000119002, + VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK = 1000122000, + VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000123000, + VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT = 1000128000, + VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT = 1000128001, + VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT = 1000128002, + VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT = 1000128003, + VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT = 1000128004, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT = 1000130000, + VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT = 1000130001, + VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT = 1000143000, + VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT = 1000143001, + VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT = 1000143002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT = 1000143003, + VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT = 1000143004, + VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR = 1000147000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT = 1000148000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT = 1000148001, + VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT = 1000148002, + VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV = 1000149000, + VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV = 1000152000, + VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160000, + VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160001, + VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT = 1000174000, + VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT = 1000178000, + VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT = 1000178001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT = 1000178002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT = 1000190000, + VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT = 1000190001, + VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, + VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2, + VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2, + VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2, + VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHR = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO, + VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO, + VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO, + VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO, + VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO, + VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO_KHR = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO, + VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES, + VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO, + VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHR = VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO, + VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHR = VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES, + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO, + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO, + VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO, + VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHR = VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES, + VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES, + VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO, + VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES_KHR = VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES, + VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES, + VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO, + VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO, + VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES, + VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS, + VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO, + VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2, + VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2, + VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2_KHR = VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2, + VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, + VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2_KHR = VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2, + VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO, + VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO_KHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO, + VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO_KHR = VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO, + VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO_KHR = VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES, + VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES_KHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES, + VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO, + VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT_KHR = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT, + VK_STRUCTURE_TYPE_BEGIN_RANGE = VK_STRUCTURE_TYPE_APPLICATION_INFO, + VK_STRUCTURE_TYPE_END_RANGE = VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO, + VK_STRUCTURE_TYPE_RANGE_SIZE = (VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO - VK_STRUCTURE_TYPE_APPLICATION_INFO + 1), + VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkStructureType; + +typedef enum VkSystemAllocationScope { + VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0, + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 1, + VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 2, + VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 3, + VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 4, + VK_SYSTEM_ALLOCATION_SCOPE_BEGIN_RANGE = VK_SYSTEM_ALLOCATION_SCOPE_COMMAND, + VK_SYSTEM_ALLOCATION_SCOPE_END_RANGE = VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE, + VK_SYSTEM_ALLOCATION_SCOPE_RANGE_SIZE = (VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE - VK_SYSTEM_ALLOCATION_SCOPE_COMMAND + 1), + VK_SYSTEM_ALLOCATION_SCOPE_MAX_ENUM = 0x7FFFFFFF +} VkSystemAllocationScope; + +typedef enum VkInternalAllocationType { + VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0, + VK_INTERNAL_ALLOCATION_TYPE_BEGIN_RANGE = VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE, + VK_INTERNAL_ALLOCATION_TYPE_END_RANGE = VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE, + VK_INTERNAL_ALLOCATION_TYPE_RANGE_SIZE = (VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE - VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE + 1), + VK_INTERNAL_ALLOCATION_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkInternalAllocationType; + +typedef enum VkFormat { + VK_FORMAT_UNDEFINED = 0, + VK_FORMAT_R4G4_UNORM_PACK8 = 1, + VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2, + VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3, + VK_FORMAT_R5G6B5_UNORM_PACK16 = 4, + VK_FORMAT_B5G6R5_UNORM_PACK16 = 5, + VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6, + VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7, + VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8, + VK_FORMAT_R8_UNORM = 9, + VK_FORMAT_R8_SNORM = 10, + VK_FORMAT_R8_USCALED = 11, + VK_FORMAT_R8_SSCALED = 12, + VK_FORMAT_R8_UINT = 13, + VK_FORMAT_R8_SINT = 14, + VK_FORMAT_R8_SRGB = 15, + VK_FORMAT_R8G8_UNORM = 16, + VK_FORMAT_R8G8_SNORM = 17, + VK_FORMAT_R8G8_USCALED = 18, + VK_FORMAT_R8G8_SSCALED = 19, + VK_FORMAT_R8G8_UINT = 20, + VK_FORMAT_R8G8_SINT = 21, + VK_FORMAT_R8G8_SRGB = 22, + VK_FORMAT_R8G8B8_UNORM = 23, + VK_FORMAT_R8G8B8_SNORM = 24, + VK_FORMAT_R8G8B8_USCALED = 25, + VK_FORMAT_R8G8B8_SSCALED = 26, + VK_FORMAT_R8G8B8_UINT = 27, + VK_FORMAT_R8G8B8_SINT = 28, + VK_FORMAT_R8G8B8_SRGB = 29, + VK_FORMAT_B8G8R8_UNORM = 30, + VK_FORMAT_B8G8R8_SNORM = 31, + VK_FORMAT_B8G8R8_USCALED = 32, + VK_FORMAT_B8G8R8_SSCALED = 33, + VK_FORMAT_B8G8R8_UINT = 34, + VK_FORMAT_B8G8R8_SINT = 35, + VK_FORMAT_B8G8R8_SRGB = 36, + VK_FORMAT_R8G8B8A8_UNORM = 37, + VK_FORMAT_R8G8B8A8_SNORM = 38, + VK_FORMAT_R8G8B8A8_USCALED = 39, + VK_FORMAT_R8G8B8A8_SSCALED = 40, + VK_FORMAT_R8G8B8A8_UINT = 41, + VK_FORMAT_R8G8B8A8_SINT = 42, + VK_FORMAT_R8G8B8A8_SRGB = 43, + VK_FORMAT_B8G8R8A8_UNORM = 44, + VK_FORMAT_B8G8R8A8_SNORM = 45, + VK_FORMAT_B8G8R8A8_USCALED = 46, + VK_FORMAT_B8G8R8A8_SSCALED = 47, + VK_FORMAT_B8G8R8A8_UINT = 48, + VK_FORMAT_B8G8R8A8_SINT = 49, + VK_FORMAT_B8G8R8A8_SRGB = 50, + VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51, + VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52, + VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53, + VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54, + VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55, + VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56, + VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57, + VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58, + VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59, + VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60, + VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61, + VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62, + VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63, + VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64, + VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65, + VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66, + VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67, + VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68, + VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69, + VK_FORMAT_R16_UNORM = 70, + VK_FORMAT_R16_SNORM = 71, + VK_FORMAT_R16_USCALED = 72, + VK_FORMAT_R16_SSCALED = 73, + VK_FORMAT_R16_UINT = 74, + VK_FORMAT_R16_SINT = 75, + VK_FORMAT_R16_SFLOAT = 76, + VK_FORMAT_R16G16_UNORM = 77, + VK_FORMAT_R16G16_SNORM = 78, + VK_FORMAT_R16G16_USCALED = 79, + VK_FORMAT_R16G16_SSCALED = 80, + VK_FORMAT_R16G16_UINT = 81, + VK_FORMAT_R16G16_SINT = 82, + VK_FORMAT_R16G16_SFLOAT = 83, + VK_FORMAT_R16G16B16_UNORM = 84, + VK_FORMAT_R16G16B16_SNORM = 85, + VK_FORMAT_R16G16B16_USCALED = 86, + VK_FORMAT_R16G16B16_SSCALED = 87, + VK_FORMAT_R16G16B16_UINT = 88, + VK_FORMAT_R16G16B16_SINT = 89, + VK_FORMAT_R16G16B16_SFLOAT = 90, + VK_FORMAT_R16G16B16A16_UNORM = 91, + VK_FORMAT_R16G16B16A16_SNORM = 92, + VK_FORMAT_R16G16B16A16_USCALED = 93, + VK_FORMAT_R16G16B16A16_SSCALED = 94, + VK_FORMAT_R16G16B16A16_UINT = 95, + VK_FORMAT_R16G16B16A16_SINT = 96, + VK_FORMAT_R16G16B16A16_SFLOAT = 97, + VK_FORMAT_R32_UINT = 98, + VK_FORMAT_R32_SINT = 99, + VK_FORMAT_R32_SFLOAT = 100, + VK_FORMAT_R32G32_UINT = 101, + VK_FORMAT_R32G32_SINT = 102, + VK_FORMAT_R32G32_SFLOAT = 103, + VK_FORMAT_R32G32B32_UINT = 104, + VK_FORMAT_R32G32B32_SINT = 105, + VK_FORMAT_R32G32B32_SFLOAT = 106, + VK_FORMAT_R32G32B32A32_UINT = 107, + VK_FORMAT_R32G32B32A32_SINT = 108, + VK_FORMAT_R32G32B32A32_SFLOAT = 109, + VK_FORMAT_R64_UINT = 110, + VK_FORMAT_R64_SINT = 111, + VK_FORMAT_R64_SFLOAT = 112, + VK_FORMAT_R64G64_UINT = 113, + VK_FORMAT_R64G64_SINT = 114, + VK_FORMAT_R64G64_SFLOAT = 115, + VK_FORMAT_R64G64B64_UINT = 116, + VK_FORMAT_R64G64B64_SINT = 117, + VK_FORMAT_R64G64B64_SFLOAT = 118, + VK_FORMAT_R64G64B64A64_UINT = 119, + VK_FORMAT_R64G64B64A64_SINT = 120, + VK_FORMAT_R64G64B64A64_SFLOAT = 121, + VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122, + VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123, + VK_FORMAT_D16_UNORM = 124, + VK_FORMAT_X8_D24_UNORM_PACK32 = 125, + VK_FORMAT_D32_SFLOAT = 126, + VK_FORMAT_S8_UINT = 127, + VK_FORMAT_D16_UNORM_S8_UINT = 128, + VK_FORMAT_D24_UNORM_S8_UINT = 129, + VK_FORMAT_D32_SFLOAT_S8_UINT = 130, + VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131, + VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132, + VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133, + VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134, + VK_FORMAT_BC2_UNORM_BLOCK = 135, + VK_FORMAT_BC2_SRGB_BLOCK = 136, + VK_FORMAT_BC3_UNORM_BLOCK = 137, + VK_FORMAT_BC3_SRGB_BLOCK = 138, + VK_FORMAT_BC4_UNORM_BLOCK = 139, + VK_FORMAT_BC4_SNORM_BLOCK = 140, + VK_FORMAT_BC5_UNORM_BLOCK = 141, + VK_FORMAT_BC5_SNORM_BLOCK = 142, + VK_FORMAT_BC6H_UFLOAT_BLOCK = 143, + VK_FORMAT_BC6H_SFLOAT_BLOCK = 144, + VK_FORMAT_BC7_UNORM_BLOCK = 145, + VK_FORMAT_BC7_SRGB_BLOCK = 146, + VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147, + VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148, + VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149, + VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150, + VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151, + VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152, + VK_FORMAT_EAC_R11_UNORM_BLOCK = 153, + VK_FORMAT_EAC_R11_SNORM_BLOCK = 154, + VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155, + VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156, + VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157, + VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158, + VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159, + VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160, + VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161, + VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162, + VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163, + VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164, + VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165, + VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166, + VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167, + VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168, + VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169, + VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170, + VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171, + VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172, + VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173, + VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174, + VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175, + VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176, + VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177, + VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178, + VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179, + VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180, + VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181, + VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182, + VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183, + VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184, + VK_FORMAT_G8B8G8R8_422_UNORM = 1000156000, + VK_FORMAT_B8G8R8G8_422_UNORM = 1000156001, + VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM = 1000156002, + VK_FORMAT_G8_B8R8_2PLANE_420_UNORM = 1000156003, + VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM = 1000156004, + VK_FORMAT_G8_B8R8_2PLANE_422_UNORM = 1000156005, + VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM = 1000156006, + VK_FORMAT_R10X6_UNORM_PACK16 = 1000156007, + VK_FORMAT_R10X6G10X6_UNORM_2PACK16 = 1000156008, + VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16 = 1000156009, + VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16 = 1000156010, + VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16 = 1000156011, + VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16 = 1000156012, + VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 = 1000156013, + VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16 = 1000156014, + VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16 = 1000156015, + VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16 = 1000156016, + VK_FORMAT_R12X4_UNORM_PACK16 = 1000156017, + VK_FORMAT_R12X4G12X4_UNORM_2PACK16 = 1000156018, + VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16 = 1000156019, + VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16 = 1000156020, + VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16 = 1000156021, + VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16 = 1000156022, + VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16 = 1000156023, + VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16 = 1000156024, + VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16 = 1000156025, + VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16 = 1000156026, + VK_FORMAT_G16B16G16R16_422_UNORM = 1000156027, + VK_FORMAT_B16G16R16G16_422_UNORM = 1000156028, + VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM = 1000156029, + VK_FORMAT_G16_B16R16_2PLANE_420_UNORM = 1000156030, + VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM = 1000156031, + VK_FORMAT_G16_B16R16_2PLANE_422_UNORM = 1000156032, + VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM = 1000156033, + VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000, + VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001, + VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002, + VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003, + VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004, + VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005, + VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006, + VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007, + VK_FORMAT_G8B8G8R8_422_UNORM_KHR = VK_FORMAT_G8B8G8R8_422_UNORM, + VK_FORMAT_B8G8R8G8_422_UNORM_KHR = VK_FORMAT_B8G8R8G8_422_UNORM, + VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM, + VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM, + VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR = VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM, + VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR = VK_FORMAT_G8_B8R8_2PLANE_422_UNORM, + VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR = VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM, + VK_FORMAT_R10X6_UNORM_PACK16_KHR = VK_FORMAT_R10X6_UNORM_PACK16, + VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR = VK_FORMAT_R10X6G10X6_UNORM_2PACK16, + VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR = VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16, + VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR = VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16, + VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR = VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16, + VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16, + VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16, + VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16, + VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16, + VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16, + VK_FORMAT_R12X4_UNORM_PACK16_KHR = VK_FORMAT_R12X4_UNORM_PACK16, + VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR = VK_FORMAT_R12X4G12X4_UNORM_2PACK16, + VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR = VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16, + VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR = VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16, + VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR = VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16, + VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16, + VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16, + VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16, + VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16, + VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16, + VK_FORMAT_G16B16G16R16_422_UNORM_KHR = VK_FORMAT_G16B16G16R16_422_UNORM, + VK_FORMAT_B16G16R16G16_422_UNORM_KHR = VK_FORMAT_B16G16R16G16_422_UNORM, + VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR = VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, + VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR = VK_FORMAT_G16_B16R16_2PLANE_420_UNORM, + VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR = VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM, + VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR = VK_FORMAT_G16_B16R16_2PLANE_422_UNORM, + VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR = VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM, + VK_FORMAT_BEGIN_RANGE = VK_FORMAT_UNDEFINED, + VK_FORMAT_END_RANGE = VK_FORMAT_ASTC_12x12_SRGB_BLOCK, + VK_FORMAT_RANGE_SIZE = (VK_FORMAT_ASTC_12x12_SRGB_BLOCK - VK_FORMAT_UNDEFINED + 1), + VK_FORMAT_MAX_ENUM = 0x7FFFFFFF +} VkFormat; + +typedef enum VkImageType { + VK_IMAGE_TYPE_1D = 0, + VK_IMAGE_TYPE_2D = 1, + VK_IMAGE_TYPE_3D = 2, + VK_IMAGE_TYPE_BEGIN_RANGE = VK_IMAGE_TYPE_1D, + VK_IMAGE_TYPE_END_RANGE = VK_IMAGE_TYPE_3D, + VK_IMAGE_TYPE_RANGE_SIZE = (VK_IMAGE_TYPE_3D - VK_IMAGE_TYPE_1D + 1), + VK_IMAGE_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkImageType; + +typedef enum VkImageTiling { + VK_IMAGE_TILING_OPTIMAL = 0, + VK_IMAGE_TILING_LINEAR = 1, + VK_IMAGE_TILING_BEGIN_RANGE = VK_IMAGE_TILING_OPTIMAL, + VK_IMAGE_TILING_END_RANGE = VK_IMAGE_TILING_LINEAR, + VK_IMAGE_TILING_RANGE_SIZE = (VK_IMAGE_TILING_LINEAR - VK_IMAGE_TILING_OPTIMAL + 1), + VK_IMAGE_TILING_MAX_ENUM = 0x7FFFFFFF +} VkImageTiling; + +typedef enum VkPhysicalDeviceType { + VK_PHYSICAL_DEVICE_TYPE_OTHER = 0, + VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 1, + VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 2, + VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 3, + VK_PHYSICAL_DEVICE_TYPE_CPU = 4, + VK_PHYSICAL_DEVICE_TYPE_BEGIN_RANGE = VK_PHYSICAL_DEVICE_TYPE_OTHER, + VK_PHYSICAL_DEVICE_TYPE_END_RANGE = VK_PHYSICAL_DEVICE_TYPE_CPU, + VK_PHYSICAL_DEVICE_TYPE_RANGE_SIZE = (VK_PHYSICAL_DEVICE_TYPE_CPU - VK_PHYSICAL_DEVICE_TYPE_OTHER + 1), + VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkPhysicalDeviceType; + +typedef enum VkQueryType { + VK_QUERY_TYPE_OCCLUSION = 0, + VK_QUERY_TYPE_PIPELINE_STATISTICS = 1, + VK_QUERY_TYPE_TIMESTAMP = 2, + VK_QUERY_TYPE_BEGIN_RANGE = VK_QUERY_TYPE_OCCLUSION, + VK_QUERY_TYPE_END_RANGE = VK_QUERY_TYPE_TIMESTAMP, + VK_QUERY_TYPE_RANGE_SIZE = (VK_QUERY_TYPE_TIMESTAMP - VK_QUERY_TYPE_OCCLUSION + 1), + VK_QUERY_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkQueryType; + +typedef enum VkSharingMode { + VK_SHARING_MODE_EXCLUSIVE = 0, + VK_SHARING_MODE_CONCURRENT = 1, + VK_SHARING_MODE_BEGIN_RANGE = VK_SHARING_MODE_EXCLUSIVE, + VK_SHARING_MODE_END_RANGE = VK_SHARING_MODE_CONCURRENT, + VK_SHARING_MODE_RANGE_SIZE = (VK_SHARING_MODE_CONCURRENT - VK_SHARING_MODE_EXCLUSIVE + 1), + VK_SHARING_MODE_MAX_ENUM = 0x7FFFFFFF +} VkSharingMode; + +typedef enum VkImageLayout { + VK_IMAGE_LAYOUT_UNDEFINED = 0, + VK_IMAGE_LAYOUT_GENERAL = 1, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 2, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 3, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 4, + VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 5, + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 6, + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 7, + VK_IMAGE_LAYOUT_PREINITIALIZED = 8, + VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL = 1000117000, + VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL = 1000117001, + VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002, + VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR = 1000111000, + VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL, + VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, + VK_IMAGE_LAYOUT_BEGIN_RANGE = VK_IMAGE_LAYOUT_UNDEFINED, + VK_IMAGE_LAYOUT_END_RANGE = VK_IMAGE_LAYOUT_PREINITIALIZED, + VK_IMAGE_LAYOUT_RANGE_SIZE = (VK_IMAGE_LAYOUT_PREINITIALIZED - VK_IMAGE_LAYOUT_UNDEFINED + 1), + VK_IMAGE_LAYOUT_MAX_ENUM = 0x7FFFFFFF +} VkImageLayout; + +typedef enum VkImageViewType { + VK_IMAGE_VIEW_TYPE_1D = 0, + VK_IMAGE_VIEW_TYPE_2D = 1, + VK_IMAGE_VIEW_TYPE_3D = 2, + VK_IMAGE_VIEW_TYPE_CUBE = 3, + VK_IMAGE_VIEW_TYPE_1D_ARRAY = 4, + VK_IMAGE_VIEW_TYPE_2D_ARRAY = 5, + VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 6, + VK_IMAGE_VIEW_TYPE_BEGIN_RANGE = VK_IMAGE_VIEW_TYPE_1D, + VK_IMAGE_VIEW_TYPE_END_RANGE = VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, + VK_IMAGE_VIEW_TYPE_RANGE_SIZE = (VK_IMAGE_VIEW_TYPE_CUBE_ARRAY - VK_IMAGE_VIEW_TYPE_1D + 1), + VK_IMAGE_VIEW_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkImageViewType; + +typedef enum VkComponentSwizzle { + VK_COMPONENT_SWIZZLE_IDENTITY = 0, + VK_COMPONENT_SWIZZLE_ZERO = 1, + VK_COMPONENT_SWIZZLE_ONE = 2, + VK_COMPONENT_SWIZZLE_R = 3, + VK_COMPONENT_SWIZZLE_G = 4, + VK_COMPONENT_SWIZZLE_B = 5, + VK_COMPONENT_SWIZZLE_A = 6, + VK_COMPONENT_SWIZZLE_BEGIN_RANGE = VK_COMPONENT_SWIZZLE_IDENTITY, + VK_COMPONENT_SWIZZLE_END_RANGE = VK_COMPONENT_SWIZZLE_A, + VK_COMPONENT_SWIZZLE_RANGE_SIZE = (VK_COMPONENT_SWIZZLE_A - VK_COMPONENT_SWIZZLE_IDENTITY + 1), + VK_COMPONENT_SWIZZLE_MAX_ENUM = 0x7FFFFFFF +} VkComponentSwizzle; + +typedef enum VkVertexInputRate { + VK_VERTEX_INPUT_RATE_VERTEX = 0, + VK_VERTEX_INPUT_RATE_INSTANCE = 1, + VK_VERTEX_INPUT_RATE_BEGIN_RANGE = VK_VERTEX_INPUT_RATE_VERTEX, + VK_VERTEX_INPUT_RATE_END_RANGE = VK_VERTEX_INPUT_RATE_INSTANCE, + VK_VERTEX_INPUT_RATE_RANGE_SIZE = (VK_VERTEX_INPUT_RATE_INSTANCE - VK_VERTEX_INPUT_RATE_VERTEX + 1), + VK_VERTEX_INPUT_RATE_MAX_ENUM = 0x7FFFFFFF +} VkVertexInputRate; + +typedef enum VkPrimitiveTopology { + VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0, + VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 1, + VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 2, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 3, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 4, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 5, + VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 6, + VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 7, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 8, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 9, + VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 10, + VK_PRIMITIVE_TOPOLOGY_BEGIN_RANGE = VK_PRIMITIVE_TOPOLOGY_POINT_LIST, + VK_PRIMITIVE_TOPOLOGY_END_RANGE = VK_PRIMITIVE_TOPOLOGY_PATCH_LIST, + VK_PRIMITIVE_TOPOLOGY_RANGE_SIZE = (VK_PRIMITIVE_TOPOLOGY_PATCH_LIST - VK_PRIMITIVE_TOPOLOGY_POINT_LIST + 1), + VK_PRIMITIVE_TOPOLOGY_MAX_ENUM = 0x7FFFFFFF +} VkPrimitiveTopology; + +typedef enum VkPolygonMode { + VK_POLYGON_MODE_FILL = 0, + VK_POLYGON_MODE_LINE = 1, + VK_POLYGON_MODE_POINT = 2, + VK_POLYGON_MODE_FILL_RECTANGLE_NV = 1000153000, + VK_POLYGON_MODE_BEGIN_RANGE = VK_POLYGON_MODE_FILL, + VK_POLYGON_MODE_END_RANGE = VK_POLYGON_MODE_POINT, + VK_POLYGON_MODE_RANGE_SIZE = (VK_POLYGON_MODE_POINT - VK_POLYGON_MODE_FILL + 1), + VK_POLYGON_MODE_MAX_ENUM = 0x7FFFFFFF +} VkPolygonMode; + +typedef enum VkFrontFace { + VK_FRONT_FACE_COUNTER_CLOCKWISE = 0, + VK_FRONT_FACE_CLOCKWISE = 1, + VK_FRONT_FACE_BEGIN_RANGE = VK_FRONT_FACE_COUNTER_CLOCKWISE, + VK_FRONT_FACE_END_RANGE = VK_FRONT_FACE_CLOCKWISE, + VK_FRONT_FACE_RANGE_SIZE = (VK_FRONT_FACE_CLOCKWISE - VK_FRONT_FACE_COUNTER_CLOCKWISE + 1), + VK_FRONT_FACE_MAX_ENUM = 0x7FFFFFFF +} VkFrontFace; + +typedef enum VkCompareOp { + VK_COMPARE_OP_NEVER = 0, + VK_COMPARE_OP_LESS = 1, + VK_COMPARE_OP_EQUAL = 2, + VK_COMPARE_OP_LESS_OR_EQUAL = 3, + VK_COMPARE_OP_GREATER = 4, + VK_COMPARE_OP_NOT_EQUAL = 5, + VK_COMPARE_OP_GREATER_OR_EQUAL = 6, + VK_COMPARE_OP_ALWAYS = 7, + VK_COMPARE_OP_BEGIN_RANGE = VK_COMPARE_OP_NEVER, + VK_COMPARE_OP_END_RANGE = VK_COMPARE_OP_ALWAYS, + VK_COMPARE_OP_RANGE_SIZE = (VK_COMPARE_OP_ALWAYS - VK_COMPARE_OP_NEVER + 1), + VK_COMPARE_OP_MAX_ENUM = 0x7FFFFFFF +} VkCompareOp; + +typedef enum VkStencilOp { + VK_STENCIL_OP_KEEP = 0, + VK_STENCIL_OP_ZERO = 1, + VK_STENCIL_OP_REPLACE = 2, + VK_STENCIL_OP_INCREMENT_AND_CLAMP = 3, + VK_STENCIL_OP_DECREMENT_AND_CLAMP = 4, + VK_STENCIL_OP_INVERT = 5, + VK_STENCIL_OP_INCREMENT_AND_WRAP = 6, + VK_STENCIL_OP_DECREMENT_AND_WRAP = 7, + VK_STENCIL_OP_BEGIN_RANGE = VK_STENCIL_OP_KEEP, + VK_STENCIL_OP_END_RANGE = VK_STENCIL_OP_DECREMENT_AND_WRAP, + VK_STENCIL_OP_RANGE_SIZE = (VK_STENCIL_OP_DECREMENT_AND_WRAP - VK_STENCIL_OP_KEEP + 1), + VK_STENCIL_OP_MAX_ENUM = 0x7FFFFFFF +} VkStencilOp; + +typedef enum VkLogicOp { + VK_LOGIC_OP_CLEAR = 0, + VK_LOGIC_OP_AND = 1, + VK_LOGIC_OP_AND_REVERSE = 2, + VK_LOGIC_OP_COPY = 3, + VK_LOGIC_OP_AND_INVERTED = 4, + VK_LOGIC_OP_NO_OP = 5, + VK_LOGIC_OP_XOR = 6, + VK_LOGIC_OP_OR = 7, + VK_LOGIC_OP_NOR = 8, + VK_LOGIC_OP_EQUIVALENT = 9, + VK_LOGIC_OP_INVERT = 10, + VK_LOGIC_OP_OR_REVERSE = 11, + VK_LOGIC_OP_COPY_INVERTED = 12, + VK_LOGIC_OP_OR_INVERTED = 13, + VK_LOGIC_OP_NAND = 14, + VK_LOGIC_OP_SET = 15, + VK_LOGIC_OP_BEGIN_RANGE = VK_LOGIC_OP_CLEAR, + VK_LOGIC_OP_END_RANGE = VK_LOGIC_OP_SET, + VK_LOGIC_OP_RANGE_SIZE = (VK_LOGIC_OP_SET - VK_LOGIC_OP_CLEAR + 1), + VK_LOGIC_OP_MAX_ENUM = 0x7FFFFFFF +} VkLogicOp; + +typedef enum VkBlendFactor { + VK_BLEND_FACTOR_ZERO = 0, + VK_BLEND_FACTOR_ONE = 1, + VK_BLEND_FACTOR_SRC_COLOR = 2, + VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 3, + VK_BLEND_FACTOR_DST_COLOR = 4, + VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 5, + VK_BLEND_FACTOR_SRC_ALPHA = 6, + VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 7, + VK_BLEND_FACTOR_DST_ALPHA = 8, + VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 9, + VK_BLEND_FACTOR_CONSTANT_COLOR = 10, + VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 11, + VK_BLEND_FACTOR_CONSTANT_ALPHA = 12, + VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 13, + VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 14, + VK_BLEND_FACTOR_SRC1_COLOR = 15, + VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 16, + VK_BLEND_FACTOR_SRC1_ALPHA = 17, + VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 18, + VK_BLEND_FACTOR_BEGIN_RANGE = VK_BLEND_FACTOR_ZERO, + VK_BLEND_FACTOR_END_RANGE = VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA, + VK_BLEND_FACTOR_RANGE_SIZE = (VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA - VK_BLEND_FACTOR_ZERO + 1), + VK_BLEND_FACTOR_MAX_ENUM = 0x7FFFFFFF +} VkBlendFactor; + +typedef enum VkBlendOp { + VK_BLEND_OP_ADD = 0, + VK_BLEND_OP_SUBTRACT = 1, + VK_BLEND_OP_REVERSE_SUBTRACT = 2, + VK_BLEND_OP_MIN = 3, + VK_BLEND_OP_MAX = 4, + VK_BLEND_OP_ZERO_EXT = 1000148000, + VK_BLEND_OP_SRC_EXT = 1000148001, + VK_BLEND_OP_DST_EXT = 1000148002, + VK_BLEND_OP_SRC_OVER_EXT = 1000148003, + VK_BLEND_OP_DST_OVER_EXT = 1000148004, + VK_BLEND_OP_SRC_IN_EXT = 1000148005, + VK_BLEND_OP_DST_IN_EXT = 1000148006, + VK_BLEND_OP_SRC_OUT_EXT = 1000148007, + VK_BLEND_OP_DST_OUT_EXT = 1000148008, + VK_BLEND_OP_SRC_ATOP_EXT = 1000148009, + VK_BLEND_OP_DST_ATOP_EXT = 1000148010, + VK_BLEND_OP_XOR_EXT = 1000148011, + VK_BLEND_OP_MULTIPLY_EXT = 1000148012, + VK_BLEND_OP_SCREEN_EXT = 1000148013, + VK_BLEND_OP_OVERLAY_EXT = 1000148014, + VK_BLEND_OP_DARKEN_EXT = 1000148015, + VK_BLEND_OP_LIGHTEN_EXT = 1000148016, + VK_BLEND_OP_COLORDODGE_EXT = 1000148017, + VK_BLEND_OP_COLORBURN_EXT = 1000148018, + VK_BLEND_OP_HARDLIGHT_EXT = 1000148019, + VK_BLEND_OP_SOFTLIGHT_EXT = 1000148020, + VK_BLEND_OP_DIFFERENCE_EXT = 1000148021, + VK_BLEND_OP_EXCLUSION_EXT = 1000148022, + VK_BLEND_OP_INVERT_EXT = 1000148023, + VK_BLEND_OP_INVERT_RGB_EXT = 1000148024, + VK_BLEND_OP_LINEARDODGE_EXT = 1000148025, + VK_BLEND_OP_LINEARBURN_EXT = 1000148026, + VK_BLEND_OP_VIVIDLIGHT_EXT = 1000148027, + VK_BLEND_OP_LINEARLIGHT_EXT = 1000148028, + VK_BLEND_OP_PINLIGHT_EXT = 1000148029, + VK_BLEND_OP_HARDMIX_EXT = 1000148030, + VK_BLEND_OP_HSL_HUE_EXT = 1000148031, + VK_BLEND_OP_HSL_SATURATION_EXT = 1000148032, + VK_BLEND_OP_HSL_COLOR_EXT = 1000148033, + VK_BLEND_OP_HSL_LUMINOSITY_EXT = 1000148034, + VK_BLEND_OP_PLUS_EXT = 1000148035, + VK_BLEND_OP_PLUS_CLAMPED_EXT = 1000148036, + VK_BLEND_OP_PLUS_CLAMPED_ALPHA_EXT = 1000148037, + VK_BLEND_OP_PLUS_DARKER_EXT = 1000148038, + VK_BLEND_OP_MINUS_EXT = 1000148039, + VK_BLEND_OP_MINUS_CLAMPED_EXT = 1000148040, + VK_BLEND_OP_CONTRAST_EXT = 1000148041, + VK_BLEND_OP_INVERT_OVG_EXT = 1000148042, + VK_BLEND_OP_RED_EXT = 1000148043, + VK_BLEND_OP_GREEN_EXT = 1000148044, + VK_BLEND_OP_BLUE_EXT = 1000148045, + VK_BLEND_OP_BEGIN_RANGE = VK_BLEND_OP_ADD, + VK_BLEND_OP_END_RANGE = VK_BLEND_OP_MAX, + VK_BLEND_OP_RANGE_SIZE = (VK_BLEND_OP_MAX - VK_BLEND_OP_ADD + 1), + VK_BLEND_OP_MAX_ENUM = 0x7FFFFFFF +} VkBlendOp; + +typedef enum VkDynamicState { + VK_DYNAMIC_STATE_VIEWPORT = 0, + VK_DYNAMIC_STATE_SCISSOR = 1, + VK_DYNAMIC_STATE_LINE_WIDTH = 2, + VK_DYNAMIC_STATE_DEPTH_BIAS = 3, + VK_DYNAMIC_STATE_BLEND_CONSTANTS = 4, + VK_DYNAMIC_STATE_DEPTH_BOUNDS = 5, + VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 6, + VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 7, + VK_DYNAMIC_STATE_STENCIL_REFERENCE = 8, + VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV = 1000087000, + VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT = 1000099000, + VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT = 1000143000, + VK_DYNAMIC_STATE_BEGIN_RANGE = VK_DYNAMIC_STATE_VIEWPORT, + VK_DYNAMIC_STATE_END_RANGE = VK_DYNAMIC_STATE_STENCIL_REFERENCE, + VK_DYNAMIC_STATE_RANGE_SIZE = (VK_DYNAMIC_STATE_STENCIL_REFERENCE - VK_DYNAMIC_STATE_VIEWPORT + 1), + VK_DYNAMIC_STATE_MAX_ENUM = 0x7FFFFFFF +} VkDynamicState; + +typedef enum VkFilter { + VK_FILTER_NEAREST = 0, + VK_FILTER_LINEAR = 1, + VK_FILTER_CUBIC_IMG = 1000015000, + VK_FILTER_BEGIN_RANGE = VK_FILTER_NEAREST, + VK_FILTER_END_RANGE = VK_FILTER_LINEAR, + VK_FILTER_RANGE_SIZE = (VK_FILTER_LINEAR - VK_FILTER_NEAREST + 1), + VK_FILTER_MAX_ENUM = 0x7FFFFFFF +} VkFilter; + +typedef enum VkSamplerMipmapMode { + VK_SAMPLER_MIPMAP_MODE_NEAREST = 0, + VK_SAMPLER_MIPMAP_MODE_LINEAR = 1, + VK_SAMPLER_MIPMAP_MODE_BEGIN_RANGE = VK_SAMPLER_MIPMAP_MODE_NEAREST, + VK_SAMPLER_MIPMAP_MODE_END_RANGE = VK_SAMPLER_MIPMAP_MODE_LINEAR, + VK_SAMPLER_MIPMAP_MODE_RANGE_SIZE = (VK_SAMPLER_MIPMAP_MODE_LINEAR - VK_SAMPLER_MIPMAP_MODE_NEAREST + 1), + VK_SAMPLER_MIPMAP_MODE_MAX_ENUM = 0x7FFFFFFF +} VkSamplerMipmapMode; + +typedef enum VkSamplerAddressMode { + VK_SAMPLER_ADDRESS_MODE_REPEAT = 0, + VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 1, + VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 2, + VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 3, + VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 4, + VK_SAMPLER_ADDRESS_MODE_BEGIN_RANGE = VK_SAMPLER_ADDRESS_MODE_REPEAT, + VK_SAMPLER_ADDRESS_MODE_END_RANGE = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, + VK_SAMPLER_ADDRESS_MODE_RANGE_SIZE = (VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER - VK_SAMPLER_ADDRESS_MODE_REPEAT + 1), + VK_SAMPLER_ADDRESS_MODE_MAX_ENUM = 0x7FFFFFFF +} VkSamplerAddressMode; + +typedef enum VkBorderColor { + VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0, + VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 1, + VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 2, + VK_BORDER_COLOR_INT_OPAQUE_BLACK = 3, + VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 4, + VK_BORDER_COLOR_INT_OPAQUE_WHITE = 5, + VK_BORDER_COLOR_BEGIN_RANGE = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK, + VK_BORDER_COLOR_END_RANGE = VK_BORDER_COLOR_INT_OPAQUE_WHITE, + VK_BORDER_COLOR_RANGE_SIZE = (VK_BORDER_COLOR_INT_OPAQUE_WHITE - VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK + 1), + VK_BORDER_COLOR_MAX_ENUM = 0x7FFFFFFF +} VkBorderColor; + +typedef enum VkDescriptorType { + VK_DESCRIPTOR_TYPE_SAMPLER = 0, + VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 1, + VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 2, + VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 3, + VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 4, + VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 5, + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 6, + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 7, + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 8, + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 9, + VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 10, + VK_DESCRIPTOR_TYPE_BEGIN_RANGE = VK_DESCRIPTOR_TYPE_SAMPLER, + VK_DESCRIPTOR_TYPE_END_RANGE = VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, + VK_DESCRIPTOR_TYPE_RANGE_SIZE = (VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT - VK_DESCRIPTOR_TYPE_SAMPLER + 1), + VK_DESCRIPTOR_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkDescriptorType; + +typedef enum VkAttachmentLoadOp { + VK_ATTACHMENT_LOAD_OP_LOAD = 0, + VK_ATTACHMENT_LOAD_OP_CLEAR = 1, + VK_ATTACHMENT_LOAD_OP_DONT_CARE = 2, + VK_ATTACHMENT_LOAD_OP_BEGIN_RANGE = VK_ATTACHMENT_LOAD_OP_LOAD, + VK_ATTACHMENT_LOAD_OP_END_RANGE = VK_ATTACHMENT_LOAD_OP_DONT_CARE, + VK_ATTACHMENT_LOAD_OP_RANGE_SIZE = (VK_ATTACHMENT_LOAD_OP_DONT_CARE - VK_ATTACHMENT_LOAD_OP_LOAD + 1), + VK_ATTACHMENT_LOAD_OP_MAX_ENUM = 0x7FFFFFFF +} VkAttachmentLoadOp; + +typedef enum VkAttachmentStoreOp { + VK_ATTACHMENT_STORE_OP_STORE = 0, + VK_ATTACHMENT_STORE_OP_DONT_CARE = 1, + VK_ATTACHMENT_STORE_OP_BEGIN_RANGE = VK_ATTACHMENT_STORE_OP_STORE, + VK_ATTACHMENT_STORE_OP_END_RANGE = VK_ATTACHMENT_STORE_OP_DONT_CARE, + VK_ATTACHMENT_STORE_OP_RANGE_SIZE = (VK_ATTACHMENT_STORE_OP_DONT_CARE - VK_ATTACHMENT_STORE_OP_STORE + 1), + VK_ATTACHMENT_STORE_OP_MAX_ENUM = 0x7FFFFFFF +} VkAttachmentStoreOp; + +typedef enum VkPipelineBindPoint { + VK_PIPELINE_BIND_POINT_GRAPHICS = 0, + VK_PIPELINE_BIND_POINT_COMPUTE = 1, + VK_PIPELINE_BIND_POINT_BEGIN_RANGE = VK_PIPELINE_BIND_POINT_GRAPHICS, + VK_PIPELINE_BIND_POINT_END_RANGE = VK_PIPELINE_BIND_POINT_COMPUTE, + VK_PIPELINE_BIND_POINT_RANGE_SIZE = (VK_PIPELINE_BIND_POINT_COMPUTE - VK_PIPELINE_BIND_POINT_GRAPHICS + 1), + VK_PIPELINE_BIND_POINT_MAX_ENUM = 0x7FFFFFFF +} VkPipelineBindPoint; + +typedef enum VkCommandBufferLevel { + VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0, + VK_COMMAND_BUFFER_LEVEL_SECONDARY = 1, + VK_COMMAND_BUFFER_LEVEL_BEGIN_RANGE = VK_COMMAND_BUFFER_LEVEL_PRIMARY, + VK_COMMAND_BUFFER_LEVEL_END_RANGE = VK_COMMAND_BUFFER_LEVEL_SECONDARY, + VK_COMMAND_BUFFER_LEVEL_RANGE_SIZE = (VK_COMMAND_BUFFER_LEVEL_SECONDARY - VK_COMMAND_BUFFER_LEVEL_PRIMARY + 1), + VK_COMMAND_BUFFER_LEVEL_MAX_ENUM = 0x7FFFFFFF +} VkCommandBufferLevel; + +typedef enum VkIndexType { + VK_INDEX_TYPE_UINT16 = 0, + VK_INDEX_TYPE_UINT32 = 1, + VK_INDEX_TYPE_BEGIN_RANGE = VK_INDEX_TYPE_UINT16, + VK_INDEX_TYPE_END_RANGE = VK_INDEX_TYPE_UINT32, + VK_INDEX_TYPE_RANGE_SIZE = (VK_INDEX_TYPE_UINT32 - VK_INDEX_TYPE_UINT16 + 1), + VK_INDEX_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkIndexType; + +typedef enum VkSubpassContents { + VK_SUBPASS_CONTENTS_INLINE = 0, + VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 1, + VK_SUBPASS_CONTENTS_BEGIN_RANGE = VK_SUBPASS_CONTENTS_INLINE, + VK_SUBPASS_CONTENTS_END_RANGE = VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS, + VK_SUBPASS_CONTENTS_RANGE_SIZE = (VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS - VK_SUBPASS_CONTENTS_INLINE + 1), + VK_SUBPASS_CONTENTS_MAX_ENUM = 0x7FFFFFFF +} VkSubpassContents; + +typedef enum VkObjectType { + VK_OBJECT_TYPE_UNKNOWN = 0, + VK_OBJECT_TYPE_INSTANCE = 1, + VK_OBJECT_TYPE_PHYSICAL_DEVICE = 2, + VK_OBJECT_TYPE_DEVICE = 3, + VK_OBJECT_TYPE_QUEUE = 4, + VK_OBJECT_TYPE_SEMAPHORE = 5, + VK_OBJECT_TYPE_COMMAND_BUFFER = 6, + VK_OBJECT_TYPE_FENCE = 7, + VK_OBJECT_TYPE_DEVICE_MEMORY = 8, + VK_OBJECT_TYPE_BUFFER = 9, + VK_OBJECT_TYPE_IMAGE = 10, + VK_OBJECT_TYPE_EVENT = 11, + VK_OBJECT_TYPE_QUERY_POOL = 12, + VK_OBJECT_TYPE_BUFFER_VIEW = 13, + VK_OBJECT_TYPE_IMAGE_VIEW = 14, + VK_OBJECT_TYPE_SHADER_MODULE = 15, + VK_OBJECT_TYPE_PIPELINE_CACHE = 16, + VK_OBJECT_TYPE_PIPELINE_LAYOUT = 17, + VK_OBJECT_TYPE_RENDER_PASS = 18, + VK_OBJECT_TYPE_PIPELINE = 19, + VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT = 20, + VK_OBJECT_TYPE_SAMPLER = 21, + VK_OBJECT_TYPE_DESCRIPTOR_POOL = 22, + VK_OBJECT_TYPE_DESCRIPTOR_SET = 23, + VK_OBJECT_TYPE_FRAMEBUFFER = 24, + VK_OBJECT_TYPE_COMMAND_POOL = 25, + VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION = 1000156000, + VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE = 1000085000, + VK_OBJECT_TYPE_SURFACE_KHR = 1000000000, + VK_OBJECT_TYPE_SWAPCHAIN_KHR = 1000001000, + VK_OBJECT_TYPE_DISPLAY_KHR = 1000002000, + VK_OBJECT_TYPE_DISPLAY_MODE_KHR = 1000002001, + VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT = 1000011000, + VK_OBJECT_TYPE_OBJECT_TABLE_NVX = 1000086000, + VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX = 1000086001, + VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT = 1000128000, + VK_OBJECT_TYPE_VALIDATION_CACHE_EXT = 1000160000, + VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR = VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE, + VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR = VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION, + VK_OBJECT_TYPE_BEGIN_RANGE = VK_OBJECT_TYPE_UNKNOWN, + VK_OBJECT_TYPE_END_RANGE = VK_OBJECT_TYPE_COMMAND_POOL, + VK_OBJECT_TYPE_RANGE_SIZE = (VK_OBJECT_TYPE_COMMAND_POOL - VK_OBJECT_TYPE_UNKNOWN + 1), + VK_OBJECT_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkObjectType; + +typedef VkFlags VkInstanceCreateFlags; + +typedef enum VkFormatFeatureFlagBits { + VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, + VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, + VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, + VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, + VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, + VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, + VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, + VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, + VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, + VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, + VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, + VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000, + VK_FORMAT_FEATURE_TRANSFER_SRC_BIT = 0x00004000, + VK_FORMAT_FEATURE_TRANSFER_DST_BIT = 0x00008000, + VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT = 0x00020000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT = 0x00040000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT = 0x00080000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT = 0x00100000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT = 0x00200000, + VK_FORMAT_FEATURE_DISJOINT_BIT = 0x00400000, + VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT = 0x00800000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT = 0x00010000, + VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT, + VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_DST_BIT, + VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT_KHR = VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT, + VK_FORMAT_FEATURE_DISJOINT_BIT_KHR = VK_FORMAT_FEATURE_DISJOINT_BIT, + VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR = VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT, + VK_FORMAT_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkFormatFeatureFlagBits; +typedef VkFlags VkFormatFeatureFlags; + +typedef enum VkImageUsageFlagBits { + VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, + VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, + VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, + VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, + VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, + VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, + VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, + VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, + VK_IMAGE_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkImageUsageFlagBits; +typedef VkFlags VkImageUsageFlags; + +typedef enum VkImageCreateFlagBits { + VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, + VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, + VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 0x00000004, + VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, + VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010, + VK_IMAGE_CREATE_ALIAS_BIT = 0x00000400, + VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT = 0x00000040, + VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT = 0x00000020, + VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT = 0x00000080, + VK_IMAGE_CREATE_EXTENDED_USAGE_BIT = 0x00000100, + VK_IMAGE_CREATE_PROTECTED_BIT = 0x00000800, + VK_IMAGE_CREATE_DISJOINT_BIT = 0x00000200, + VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT = 0x00001000, + VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT, + VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT, + VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR = VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT, + VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR = VK_IMAGE_CREATE_EXTENDED_USAGE_BIT, + VK_IMAGE_CREATE_DISJOINT_BIT_KHR = VK_IMAGE_CREATE_DISJOINT_BIT, + VK_IMAGE_CREATE_ALIAS_BIT_KHR = VK_IMAGE_CREATE_ALIAS_BIT, + VK_IMAGE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkImageCreateFlagBits; +typedef VkFlags VkImageCreateFlags; + +typedef enum VkSampleCountFlagBits { + VK_SAMPLE_COUNT_1_BIT = 0x00000001, + VK_SAMPLE_COUNT_2_BIT = 0x00000002, + VK_SAMPLE_COUNT_4_BIT = 0x00000004, + VK_SAMPLE_COUNT_8_BIT = 0x00000008, + VK_SAMPLE_COUNT_16_BIT = 0x00000010, + VK_SAMPLE_COUNT_32_BIT = 0x00000020, + VK_SAMPLE_COUNT_64_BIT = 0x00000040, + VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkSampleCountFlagBits; +typedef VkFlags VkSampleCountFlags; + +typedef enum VkQueueFlagBits { + VK_QUEUE_GRAPHICS_BIT = 0x00000001, + VK_QUEUE_COMPUTE_BIT = 0x00000002, + VK_QUEUE_TRANSFER_BIT = 0x00000004, + VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, + VK_QUEUE_PROTECTED_BIT = 0x00000010, + VK_QUEUE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkQueueFlagBits; +typedef VkFlags VkQueueFlags; + +typedef enum VkMemoryPropertyFlagBits { + VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002, + VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004, + VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008, + VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010, + VK_MEMORY_PROPERTY_PROTECTED_BIT = 0x00000020, + VK_MEMORY_PROPERTY_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkMemoryPropertyFlagBits; +typedef VkFlags VkMemoryPropertyFlags; + +typedef enum VkMemoryHeapFlagBits { + VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001, + VK_MEMORY_HEAP_MULTI_INSTANCE_BIT = 0x00000002, + VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR = VK_MEMORY_HEAP_MULTI_INSTANCE_BIT, + VK_MEMORY_HEAP_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkMemoryHeapFlagBits; +typedef VkFlags VkMemoryHeapFlags; +typedef VkFlags VkDeviceCreateFlags; + +typedef enum VkDeviceQueueCreateFlagBits { + VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT = 0x00000001, + VK_DEVICE_QUEUE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkDeviceQueueCreateFlagBits; +typedef VkFlags VkDeviceQueueCreateFlags; + +typedef enum VkPipelineStageFlagBits { + VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, + VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, + VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, + VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, + VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, + VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, + VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, + VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, + VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, + VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, + VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, + VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, + VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000, + VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, + VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, + VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, + VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000, + VK_PIPELINE_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkPipelineStageFlagBits; +typedef VkFlags VkPipelineStageFlags; +typedef VkFlags VkMemoryMapFlags; + +typedef enum VkImageAspectFlagBits { + VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001, + VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002, + VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004, + VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008, + VK_IMAGE_ASPECT_PLANE_0_BIT = 0x00000010, + VK_IMAGE_ASPECT_PLANE_1_BIT = 0x00000020, + VK_IMAGE_ASPECT_PLANE_2_BIT = 0x00000040, + VK_IMAGE_ASPECT_PLANE_0_BIT_KHR = VK_IMAGE_ASPECT_PLANE_0_BIT, + VK_IMAGE_ASPECT_PLANE_1_BIT_KHR = VK_IMAGE_ASPECT_PLANE_1_BIT, + VK_IMAGE_ASPECT_PLANE_2_BIT_KHR = VK_IMAGE_ASPECT_PLANE_2_BIT, + VK_IMAGE_ASPECT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkImageAspectFlagBits; +typedef VkFlags VkImageAspectFlags; + +typedef enum VkSparseImageFormatFlagBits { + VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, + VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT = 0x00000002, + VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, + VK_SPARSE_IMAGE_FORMAT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkSparseImageFormatFlagBits; +typedef VkFlags VkSparseImageFormatFlags; + +typedef enum VkSparseMemoryBindFlagBits { + VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001, + VK_SPARSE_MEMORY_BIND_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkSparseMemoryBindFlagBits; +typedef VkFlags VkSparseMemoryBindFlags; + +typedef enum VkFenceCreateFlagBits { + VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001, + VK_FENCE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkFenceCreateFlagBits; +typedef VkFlags VkFenceCreateFlags; +typedef VkFlags VkSemaphoreCreateFlags; +typedef VkFlags VkEventCreateFlags; +typedef VkFlags VkQueryPoolCreateFlags; + +typedef enum VkQueryPipelineStatisticFlagBits { + VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, + VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, + VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, + VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, + VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, + VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, + VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, + VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, + VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, + VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, + VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, + VK_QUERY_PIPELINE_STATISTIC_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkQueryPipelineStatisticFlagBits; +typedef VkFlags VkQueryPipelineStatisticFlags; + +typedef enum VkQueryResultFlagBits { + VK_QUERY_RESULT_64_BIT = 0x00000001, + VK_QUERY_RESULT_WAIT_BIT = 0x00000002, + VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, + VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, + VK_QUERY_RESULT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkQueryResultFlagBits; +typedef VkFlags VkQueryResultFlags; + +typedef enum VkBufferCreateFlagBits { + VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, + VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, + VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, + VK_BUFFER_CREATE_PROTECTED_BIT = 0x00000008, + VK_BUFFER_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkBufferCreateFlagBits; +typedef VkFlags VkBufferCreateFlags; + +typedef enum VkBufferUsageFlagBits { + VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, + VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, + VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, + VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, + VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, + VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, + VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, + VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, + VK_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkBufferUsageFlagBits; +typedef VkFlags VkBufferUsageFlags; +typedef VkFlags VkBufferViewCreateFlags; +typedef VkFlags VkImageViewCreateFlags; +typedef VkFlags VkShaderModuleCreateFlags; +typedef VkFlags VkPipelineCacheCreateFlags; + +typedef enum VkPipelineCreateFlagBits { + VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001, + VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002, + VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004, + VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT = 0x00000008, + VK_PIPELINE_CREATE_DISPATCH_BASE = 0x00000010, + VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHR = VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT, + VK_PIPELINE_CREATE_DISPATCH_BASE_KHR = VK_PIPELINE_CREATE_DISPATCH_BASE, + VK_PIPELINE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkPipelineCreateFlagBits; +typedef VkFlags VkPipelineCreateFlags; +typedef VkFlags VkPipelineShaderStageCreateFlags; + +typedef enum VkShaderStageFlagBits { + VK_SHADER_STAGE_VERTEX_BIT = 0x00000001, + VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002, + VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004, + VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008, + VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010, + VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020, + VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F, + VK_SHADER_STAGE_ALL = 0x7FFFFFFF, + VK_SHADER_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkShaderStageFlagBits; +typedef VkFlags VkPipelineVertexInputStateCreateFlags; +typedef VkFlags VkPipelineInputAssemblyStateCreateFlags; +typedef VkFlags VkPipelineTessellationStateCreateFlags; +typedef VkFlags VkPipelineViewportStateCreateFlags; +typedef VkFlags VkPipelineRasterizationStateCreateFlags; + +typedef enum VkCullModeFlagBits { + VK_CULL_MODE_NONE = 0, + VK_CULL_MODE_FRONT_BIT = 0x00000001, + VK_CULL_MODE_BACK_BIT = 0x00000002, + VK_CULL_MODE_FRONT_AND_BACK = 0x00000003, + VK_CULL_MODE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkCullModeFlagBits; +typedef VkFlags VkCullModeFlags; +typedef VkFlags VkPipelineMultisampleStateCreateFlags; +typedef VkFlags VkPipelineDepthStencilStateCreateFlags; +typedef VkFlags VkPipelineColorBlendStateCreateFlags; + +typedef enum VkColorComponentFlagBits { + VK_COLOR_COMPONENT_R_BIT = 0x00000001, + VK_COLOR_COMPONENT_G_BIT = 0x00000002, + VK_COLOR_COMPONENT_B_BIT = 0x00000004, + VK_COLOR_COMPONENT_A_BIT = 0x00000008, + VK_COLOR_COMPONENT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkColorComponentFlagBits; +typedef VkFlags VkColorComponentFlags; +typedef VkFlags VkPipelineDynamicStateCreateFlags; +typedef VkFlags VkPipelineLayoutCreateFlags; +typedef VkFlags VkShaderStageFlags; +typedef VkFlags VkSamplerCreateFlags; + +typedef enum VkDescriptorSetLayoutCreateFlagBits { + VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR = 0x00000001, + VK_DESCRIPTOR_SET_LAYOUT_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkDescriptorSetLayoutCreateFlagBits; +typedef VkFlags VkDescriptorSetLayoutCreateFlags; + +typedef enum VkDescriptorPoolCreateFlagBits { + VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001, + VK_DESCRIPTOR_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkDescriptorPoolCreateFlagBits; +typedef VkFlags VkDescriptorPoolCreateFlags; +typedef VkFlags VkDescriptorPoolResetFlags; +typedef VkFlags VkFramebufferCreateFlags; +typedef VkFlags VkRenderPassCreateFlags; + +typedef enum VkAttachmentDescriptionFlagBits { + VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT = 0x00000001, + VK_ATTACHMENT_DESCRIPTION_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkAttachmentDescriptionFlagBits; +typedef VkFlags VkAttachmentDescriptionFlags; + +typedef enum VkSubpassDescriptionFlagBits { + VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX = 0x00000001, + VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX = 0x00000002, + VK_SUBPASS_DESCRIPTION_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkSubpassDescriptionFlagBits; +typedef VkFlags VkSubpassDescriptionFlags; + +typedef enum VkAccessFlagBits { + VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001, + VK_ACCESS_INDEX_READ_BIT = 0x00000002, + VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004, + VK_ACCESS_UNIFORM_READ_BIT = 0x00000008, + VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010, + VK_ACCESS_SHADER_READ_BIT = 0x00000020, + VK_ACCESS_SHADER_WRITE_BIT = 0x00000040, + VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080, + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100, + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200, + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400, + VK_ACCESS_TRANSFER_READ_BIT = 0x00000800, + VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000, + VK_ACCESS_HOST_READ_BIT = 0x00002000, + VK_ACCESS_HOST_WRITE_BIT = 0x00004000, + VK_ACCESS_MEMORY_READ_BIT = 0x00008000, + VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000, + VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000, + VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000, + VK_ACCESS_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT = 0x00080000, + VK_ACCESS_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkAccessFlagBits; +typedef VkFlags VkAccessFlags; + +typedef enum VkDependencyFlagBits { + VK_DEPENDENCY_BY_REGION_BIT = 0x00000001, + VK_DEPENDENCY_DEVICE_GROUP_BIT = 0x00000004, + VK_DEPENDENCY_VIEW_LOCAL_BIT = 0x00000002, + VK_DEPENDENCY_VIEW_LOCAL_BIT_KHR = VK_DEPENDENCY_VIEW_LOCAL_BIT, + VK_DEPENDENCY_DEVICE_GROUP_BIT_KHR = VK_DEPENDENCY_DEVICE_GROUP_BIT, + VK_DEPENDENCY_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkDependencyFlagBits; +typedef VkFlags VkDependencyFlags; + +typedef enum VkCommandPoolCreateFlagBits { + VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, + VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, + VK_COMMAND_POOL_CREATE_PROTECTED_BIT = 0x00000004, + VK_COMMAND_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkCommandPoolCreateFlagBits; +typedef VkFlags VkCommandPoolCreateFlags; + +typedef enum VkCommandPoolResetFlagBits { + VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, + VK_COMMAND_POOL_RESET_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkCommandPoolResetFlagBits; +typedef VkFlags VkCommandPoolResetFlags; + +typedef enum VkCommandBufferUsageFlagBits { + VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001, + VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002, + VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004, + VK_COMMAND_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkCommandBufferUsageFlagBits; +typedef VkFlags VkCommandBufferUsageFlags; + +typedef enum VkQueryControlFlagBits { + VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001, + VK_QUERY_CONTROL_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkQueryControlFlagBits; +typedef VkFlags VkQueryControlFlags; + +typedef enum VkCommandBufferResetFlagBits { + VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, + VK_COMMAND_BUFFER_RESET_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkCommandBufferResetFlagBits; +typedef VkFlags VkCommandBufferResetFlags; + +typedef enum VkStencilFaceFlagBits { + VK_STENCIL_FACE_FRONT_BIT = 0x00000001, + VK_STENCIL_FACE_BACK_BIT = 0x00000002, + VK_STENCIL_FRONT_AND_BACK = 0x00000003, + VK_STENCIL_FACE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkStencilFaceFlagBits; +typedef VkFlags VkStencilFaceFlags; + +typedef struct VkApplicationInfo { + VkStructureType sType; + const void* pNext; + const char* pApplicationName; + uint32_t applicationVersion; + const char* pEngineName; + uint32_t engineVersion; + uint32_t apiVersion; +} VkApplicationInfo; + +typedef struct VkInstanceCreateInfo { + VkStructureType sType; + const void* pNext; + VkInstanceCreateFlags flags; + const VkApplicationInfo* pApplicationInfo; + uint32_t enabledLayerCount; + const char* const* ppEnabledLayerNames; + uint32_t enabledExtensionCount; + const char* const* ppEnabledExtensionNames; +} VkInstanceCreateInfo; + +typedef void* (VKAPI_PTR *PFN_vkAllocationFunction)( + void* pUserData, + size_t size, + size_t alignment, + VkSystemAllocationScope allocationScope); + +typedef void* (VKAPI_PTR *PFN_vkReallocationFunction)( + void* pUserData, + void* pOriginal, + size_t size, + size_t alignment, + VkSystemAllocationScope allocationScope); + +typedef void (VKAPI_PTR *PFN_vkFreeFunction)( + void* pUserData, + void* pMemory); + +typedef void (VKAPI_PTR *PFN_vkInternalAllocationNotification)( + void* pUserData, + size_t size, + VkInternalAllocationType allocationType, + VkSystemAllocationScope allocationScope); + +typedef void (VKAPI_PTR *PFN_vkInternalFreeNotification)( + void* pUserData, + size_t size, + VkInternalAllocationType allocationType, + VkSystemAllocationScope allocationScope); + +typedef struct VkAllocationCallbacks { + void* pUserData; + PFN_vkAllocationFunction pfnAllocation; + PFN_vkReallocationFunction pfnReallocation; + PFN_vkFreeFunction pfnFree; + PFN_vkInternalAllocationNotification pfnInternalAllocation; + PFN_vkInternalFreeNotification pfnInternalFree; +} VkAllocationCallbacks; + +typedef struct VkPhysicalDeviceFeatures { + VkBool32 robustBufferAccess; + VkBool32 fullDrawIndexUint32; + VkBool32 imageCubeArray; + VkBool32 independentBlend; + VkBool32 geometryShader; + VkBool32 tessellationShader; + VkBool32 sampleRateShading; + VkBool32 dualSrcBlend; + VkBool32 logicOp; + VkBool32 multiDrawIndirect; + VkBool32 drawIndirectFirstInstance; + VkBool32 depthClamp; + VkBool32 depthBiasClamp; + VkBool32 fillModeNonSolid; + VkBool32 depthBounds; + VkBool32 wideLines; + VkBool32 largePoints; + VkBool32 alphaToOne; + VkBool32 multiViewport; + VkBool32 samplerAnisotropy; + VkBool32 textureCompressionETC2; + VkBool32 textureCompressionASTC_LDR; + VkBool32 textureCompressionBC; + VkBool32 occlusionQueryPrecise; + VkBool32 pipelineStatisticsQuery; + VkBool32 vertexPipelineStoresAndAtomics; + VkBool32 fragmentStoresAndAtomics; + VkBool32 shaderTessellationAndGeometryPointSize; + VkBool32 shaderImageGatherExtended; + VkBool32 shaderStorageImageExtendedFormats; + VkBool32 shaderStorageImageMultisample; + VkBool32 shaderStorageImageReadWithoutFormat; + VkBool32 shaderStorageImageWriteWithoutFormat; + VkBool32 shaderUniformBufferArrayDynamicIndexing; + VkBool32 shaderSampledImageArrayDynamicIndexing; + VkBool32 shaderStorageBufferArrayDynamicIndexing; + VkBool32 shaderStorageImageArrayDynamicIndexing; + VkBool32 shaderClipDistance; + VkBool32 shaderCullDistance; + VkBool32 shaderFloat64; + VkBool32 shaderInt64; + VkBool32 shaderInt16; + VkBool32 shaderResourceResidency; + VkBool32 shaderResourceMinLod; + VkBool32 sparseBinding; + VkBool32 sparseResidencyBuffer; + VkBool32 sparseResidencyImage2D; + VkBool32 sparseResidencyImage3D; + VkBool32 sparseResidency2Samples; + VkBool32 sparseResidency4Samples; + VkBool32 sparseResidency8Samples; + VkBool32 sparseResidency16Samples; + VkBool32 sparseResidencyAliased; + VkBool32 variableMultisampleRate; + VkBool32 inheritedQueries; +} VkPhysicalDeviceFeatures; + +typedef struct VkFormatProperties { + VkFormatFeatureFlags linearTilingFeatures; + VkFormatFeatureFlags optimalTilingFeatures; + VkFormatFeatureFlags bufferFeatures; +} VkFormatProperties; + +typedef struct VkExtent3D { + uint32_t width; + uint32_t height; + uint32_t depth; +} VkExtent3D; + +typedef struct VkImageFormatProperties { + VkExtent3D maxExtent; + uint32_t maxMipLevels; + uint32_t maxArrayLayers; + VkSampleCountFlags sampleCounts; + VkDeviceSize maxResourceSize; +} VkImageFormatProperties; + +typedef struct VkPhysicalDeviceLimits { + uint32_t maxImageDimension1D; + uint32_t maxImageDimension2D; + uint32_t maxImageDimension3D; + uint32_t maxImageDimensionCube; + uint32_t maxImageArrayLayers; + uint32_t maxTexelBufferElements; + uint32_t maxUniformBufferRange; + uint32_t maxStorageBufferRange; + uint32_t maxPushConstantsSize; + uint32_t maxMemoryAllocationCount; + uint32_t maxSamplerAllocationCount; + VkDeviceSize bufferImageGranularity; + VkDeviceSize sparseAddressSpaceSize; + uint32_t maxBoundDescriptorSets; + uint32_t maxPerStageDescriptorSamplers; + uint32_t maxPerStageDescriptorUniformBuffers; + uint32_t maxPerStageDescriptorStorageBuffers; + uint32_t maxPerStageDescriptorSampledImages; + uint32_t maxPerStageDescriptorStorageImages; + uint32_t maxPerStageDescriptorInputAttachments; + uint32_t maxPerStageResources; + uint32_t maxDescriptorSetSamplers; + uint32_t maxDescriptorSetUniformBuffers; + uint32_t maxDescriptorSetUniformBuffersDynamic; + uint32_t maxDescriptorSetStorageBuffers; + uint32_t maxDescriptorSetStorageBuffersDynamic; + uint32_t maxDescriptorSetSampledImages; + uint32_t maxDescriptorSetStorageImages; + uint32_t maxDescriptorSetInputAttachments; + uint32_t maxVertexInputAttributes; + uint32_t maxVertexInputBindings; + uint32_t maxVertexInputAttributeOffset; + uint32_t maxVertexInputBindingStride; + uint32_t maxVertexOutputComponents; + uint32_t maxTessellationGenerationLevel; + uint32_t maxTessellationPatchSize; + uint32_t maxTessellationControlPerVertexInputComponents; + uint32_t maxTessellationControlPerVertexOutputComponents; + uint32_t maxTessellationControlPerPatchOutputComponents; + uint32_t maxTessellationControlTotalOutputComponents; + uint32_t maxTessellationEvaluationInputComponents; + uint32_t maxTessellationEvaluationOutputComponents; + uint32_t maxGeometryShaderInvocations; + uint32_t maxGeometryInputComponents; + uint32_t maxGeometryOutputComponents; + uint32_t maxGeometryOutputVertices; + uint32_t maxGeometryTotalOutputComponents; + uint32_t maxFragmentInputComponents; + uint32_t maxFragmentOutputAttachments; + uint32_t maxFragmentDualSrcAttachments; + uint32_t maxFragmentCombinedOutputResources; + uint32_t maxComputeSharedMemorySize; + uint32_t maxComputeWorkGroupCount[3]; + uint32_t maxComputeWorkGroupInvocations; + uint32_t maxComputeWorkGroupSize[3]; + uint32_t subPixelPrecisionBits; + uint32_t subTexelPrecisionBits; + uint32_t mipmapPrecisionBits; + uint32_t maxDrawIndexedIndexValue; + uint32_t maxDrawIndirectCount; + float maxSamplerLodBias; + float maxSamplerAnisotropy; + uint32_t maxViewports; + uint32_t maxViewportDimensions[2]; + float viewportBoundsRange[2]; + uint32_t viewportSubPixelBits; + size_t minMemoryMapAlignment; + VkDeviceSize minTexelBufferOffsetAlignment; + VkDeviceSize minUniformBufferOffsetAlignment; + VkDeviceSize minStorageBufferOffsetAlignment; + int32_t minTexelOffset; + uint32_t maxTexelOffset; + int32_t minTexelGatherOffset; + uint32_t maxTexelGatherOffset; + float minInterpolationOffset; + float maxInterpolationOffset; + uint32_t subPixelInterpolationOffsetBits; + uint32_t maxFramebufferWidth; + uint32_t maxFramebufferHeight; + uint32_t maxFramebufferLayers; + VkSampleCountFlags framebufferColorSampleCounts; + VkSampleCountFlags framebufferDepthSampleCounts; + VkSampleCountFlags framebufferStencilSampleCounts; + VkSampleCountFlags framebufferNoAttachmentsSampleCounts; + uint32_t maxColorAttachments; + VkSampleCountFlags sampledImageColorSampleCounts; + VkSampleCountFlags sampledImageIntegerSampleCounts; + VkSampleCountFlags sampledImageDepthSampleCounts; + VkSampleCountFlags sampledImageStencilSampleCounts; + VkSampleCountFlags storageImageSampleCounts; + uint32_t maxSampleMaskWords; + VkBool32 timestampComputeAndGraphics; + float timestampPeriod; + uint32_t maxClipDistances; + uint32_t maxCullDistances; + uint32_t maxCombinedClipAndCullDistances; + uint32_t discreteQueuePriorities; + float pointSizeRange[2]; + float lineWidthRange[2]; + float pointSizeGranularity; + float lineWidthGranularity; + VkBool32 strictLines; + VkBool32 standardSampleLocations; + VkDeviceSize optimalBufferCopyOffsetAlignment; + VkDeviceSize optimalBufferCopyRowPitchAlignment; + VkDeviceSize nonCoherentAtomSize; +} VkPhysicalDeviceLimits; + +typedef struct VkPhysicalDeviceSparseProperties { + VkBool32 residencyStandard2DBlockShape; + VkBool32 residencyStandard2DMultisampleBlockShape; + VkBool32 residencyStandard3DBlockShape; + VkBool32 residencyAlignedMipSize; + VkBool32 residencyNonResidentStrict; +} VkPhysicalDeviceSparseProperties; + +typedef struct VkPhysicalDeviceProperties { + uint32_t apiVersion; + uint32_t driverVersion; + uint32_t vendorID; + uint32_t deviceID; + VkPhysicalDeviceType deviceType; + char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE]; + uint8_t pipelineCacheUUID[VK_UUID_SIZE]; + VkPhysicalDeviceLimits limits; + VkPhysicalDeviceSparseProperties sparseProperties; +} VkPhysicalDeviceProperties; + +typedef struct VkQueueFamilyProperties { + VkQueueFlags queueFlags; + uint32_t queueCount; + uint32_t timestampValidBits; + VkExtent3D minImageTransferGranularity; +} VkQueueFamilyProperties; + +typedef struct VkMemoryType { + VkMemoryPropertyFlags propertyFlags; + uint32_t heapIndex; +} VkMemoryType; + +typedef struct VkMemoryHeap { + VkDeviceSize size; + VkMemoryHeapFlags flags; +} VkMemoryHeap; + +typedef struct VkPhysicalDeviceMemoryProperties { + uint32_t memoryTypeCount; + VkMemoryType memoryTypes[VK_MAX_MEMORY_TYPES]; + uint32_t memoryHeapCount; + VkMemoryHeap memoryHeaps[VK_MAX_MEMORY_HEAPS]; +} VkPhysicalDeviceMemoryProperties; + +typedef void (VKAPI_PTR *PFN_vkVoidFunction)(void); +typedef struct VkDeviceQueueCreateInfo { + VkStructureType sType; + const void* pNext; + VkDeviceQueueCreateFlags flags; + uint32_t queueFamilyIndex; + uint32_t queueCount; + const float* pQueuePriorities; +} VkDeviceQueueCreateInfo; + +typedef struct VkDeviceCreateInfo { + VkStructureType sType; + const void* pNext; + VkDeviceCreateFlags flags; + uint32_t queueCreateInfoCount; + const VkDeviceQueueCreateInfo* pQueueCreateInfos; + uint32_t enabledLayerCount; + const char* const* ppEnabledLayerNames; + uint32_t enabledExtensionCount; + const char* const* ppEnabledExtensionNames; + const VkPhysicalDeviceFeatures* pEnabledFeatures; +} VkDeviceCreateInfo; + +typedef struct VkExtensionProperties { + char extensionName[VK_MAX_EXTENSION_NAME_SIZE]; + uint32_t specVersion; +} VkExtensionProperties; + +typedef struct VkLayerProperties { + char layerName[VK_MAX_EXTENSION_NAME_SIZE]; + uint32_t specVersion; + uint32_t implementationVersion; + char description[VK_MAX_DESCRIPTION_SIZE]; +} VkLayerProperties; + +typedef struct VkSubmitInfo { + VkStructureType sType; + const void* pNext; + uint32_t waitSemaphoreCount; + const VkSemaphore* pWaitSemaphores; + const VkPipelineStageFlags* pWaitDstStageMask; + uint32_t commandBufferCount; + const VkCommandBuffer* pCommandBuffers; + uint32_t signalSemaphoreCount; + const VkSemaphore* pSignalSemaphores; +} VkSubmitInfo; + +typedef struct VkMemoryAllocateInfo { + VkStructureType sType; + const void* pNext; + VkDeviceSize allocationSize; + uint32_t memoryTypeIndex; +} VkMemoryAllocateInfo; + +typedef struct VkMappedMemoryRange { + VkStructureType sType; + const void* pNext; + VkDeviceMemory memory; + VkDeviceSize offset; + VkDeviceSize size; +} VkMappedMemoryRange; + +typedef struct VkMemoryRequirements { + VkDeviceSize size; + VkDeviceSize alignment; + uint32_t memoryTypeBits; +} VkMemoryRequirements; + +typedef struct VkSparseImageFormatProperties { + VkImageAspectFlags aspectMask; + VkExtent3D imageGranularity; + VkSparseImageFormatFlags flags; +} VkSparseImageFormatProperties; + +typedef struct VkSparseImageMemoryRequirements { + VkSparseImageFormatProperties formatProperties; + uint32_t imageMipTailFirstLod; + VkDeviceSize imageMipTailSize; + VkDeviceSize imageMipTailOffset; + VkDeviceSize imageMipTailStride; +} VkSparseImageMemoryRequirements; + +typedef struct VkSparseMemoryBind { + VkDeviceSize resourceOffset; + VkDeviceSize size; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; + VkSparseMemoryBindFlags flags; +} VkSparseMemoryBind; + +typedef struct VkSparseBufferMemoryBindInfo { + VkBuffer buffer; + uint32_t bindCount; + const VkSparseMemoryBind* pBinds; +} VkSparseBufferMemoryBindInfo; + +typedef struct VkSparseImageOpaqueMemoryBindInfo { + VkImage image; + uint32_t bindCount; + const VkSparseMemoryBind* pBinds; +} VkSparseImageOpaqueMemoryBindInfo; + +typedef struct VkImageSubresource { + VkImageAspectFlags aspectMask; + uint32_t mipLevel; + uint32_t arrayLayer; +} VkImageSubresource; + +typedef struct VkOffset3D { + int32_t x; + int32_t y; + int32_t z; +} VkOffset3D; + +typedef struct VkSparseImageMemoryBind { + VkImageSubresource subresource; + VkOffset3D offset; + VkExtent3D extent; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; + VkSparseMemoryBindFlags flags; +} VkSparseImageMemoryBind; + +typedef struct VkSparseImageMemoryBindInfo { + VkImage image; + uint32_t bindCount; + const VkSparseImageMemoryBind* pBinds; +} VkSparseImageMemoryBindInfo; + +typedef struct VkBindSparseInfo { + VkStructureType sType; + const void* pNext; + uint32_t waitSemaphoreCount; + const VkSemaphore* pWaitSemaphores; + uint32_t bufferBindCount; + const VkSparseBufferMemoryBindInfo* pBufferBinds; + uint32_t imageOpaqueBindCount; + const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds; + uint32_t imageBindCount; + const VkSparseImageMemoryBindInfo* pImageBinds; + uint32_t signalSemaphoreCount; + const VkSemaphore* pSignalSemaphores; +} VkBindSparseInfo; + +typedef struct VkFenceCreateInfo { + VkStructureType sType; + const void* pNext; + VkFenceCreateFlags flags; +} VkFenceCreateInfo; + +typedef struct VkSemaphoreCreateInfo { + VkStructureType sType; + const void* pNext; + VkSemaphoreCreateFlags flags; +} VkSemaphoreCreateInfo; + +typedef struct VkEventCreateInfo { + VkStructureType sType; + const void* pNext; + VkEventCreateFlags flags; +} VkEventCreateInfo; + +typedef struct VkQueryPoolCreateInfo { + VkStructureType sType; + const void* pNext; + VkQueryPoolCreateFlags flags; + VkQueryType queryType; + uint32_t queryCount; + VkQueryPipelineStatisticFlags pipelineStatistics; +} VkQueryPoolCreateInfo; + +typedef struct VkBufferCreateInfo { + VkStructureType sType; + const void* pNext; + VkBufferCreateFlags flags; + VkDeviceSize size; + VkBufferUsageFlags usage; + VkSharingMode sharingMode; + uint32_t queueFamilyIndexCount; + const uint32_t* pQueueFamilyIndices; +} VkBufferCreateInfo; + +typedef struct VkBufferViewCreateInfo { + VkStructureType sType; + const void* pNext; + VkBufferViewCreateFlags flags; + VkBuffer buffer; + VkFormat format; + VkDeviceSize offset; + VkDeviceSize range; +} VkBufferViewCreateInfo; + +typedef struct VkImageCreateInfo { + VkStructureType sType; + const void* pNext; + VkImageCreateFlags flags; + VkImageType imageType; + VkFormat format; + VkExtent3D extent; + uint32_t mipLevels; + uint32_t arrayLayers; + VkSampleCountFlagBits samples; + VkImageTiling tiling; + VkImageUsageFlags usage; + VkSharingMode sharingMode; + uint32_t queueFamilyIndexCount; + const uint32_t* pQueueFamilyIndices; + VkImageLayout initialLayout; +} VkImageCreateInfo; + +typedef struct VkSubresourceLayout { + VkDeviceSize offset; + VkDeviceSize size; + VkDeviceSize rowPitch; + VkDeviceSize arrayPitch; + VkDeviceSize depthPitch; +} VkSubresourceLayout; + +typedef struct VkComponentMapping { + VkComponentSwizzle r; + VkComponentSwizzle g; + VkComponentSwizzle b; + VkComponentSwizzle a; +} VkComponentMapping; + +typedef struct VkImageSubresourceRange { + VkImageAspectFlags aspectMask; + uint32_t baseMipLevel; + uint32_t levelCount; + uint32_t baseArrayLayer; + uint32_t layerCount; +} VkImageSubresourceRange; + +typedef struct VkImageViewCreateInfo { + VkStructureType sType; + const void* pNext; + VkImageViewCreateFlags flags; + VkImage image; + VkImageViewType viewType; + VkFormat format; + VkComponentMapping components; + VkImageSubresourceRange subresourceRange; +} VkImageViewCreateInfo; + +typedef struct VkShaderModuleCreateInfo { + VkStructureType sType; + const void* pNext; + VkShaderModuleCreateFlags flags; + size_t codeSize; + const uint32_t* pCode; +} VkShaderModuleCreateInfo; + +typedef struct VkPipelineCacheCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineCacheCreateFlags flags; + size_t initialDataSize; + const void* pInitialData; +} VkPipelineCacheCreateInfo; + +typedef struct VkSpecializationMapEntry { + uint32_t constantID; + uint32_t offset; + size_t size; +} VkSpecializationMapEntry; + +typedef struct VkSpecializationInfo { + uint32_t mapEntryCount; + const VkSpecializationMapEntry* pMapEntries; + size_t dataSize; + const void* pData; +} VkSpecializationInfo; + +typedef struct VkPipelineShaderStageCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineShaderStageCreateFlags flags; + VkShaderStageFlagBits stage; + VkShaderModule module; + const char* pName; + const VkSpecializationInfo* pSpecializationInfo; +} VkPipelineShaderStageCreateInfo; + +typedef struct VkVertexInputBindingDescription { + uint32_t binding; + uint32_t stride; + VkVertexInputRate inputRate; +} VkVertexInputBindingDescription; + +typedef struct VkVertexInputAttributeDescription { + uint32_t location; + uint32_t binding; + VkFormat format; + uint32_t offset; +} VkVertexInputAttributeDescription; + +typedef struct VkPipelineVertexInputStateCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineVertexInputStateCreateFlags flags; + uint32_t vertexBindingDescriptionCount; + const VkVertexInputBindingDescription* pVertexBindingDescriptions; + uint32_t vertexAttributeDescriptionCount; + const VkVertexInputAttributeDescription* pVertexAttributeDescriptions; +} VkPipelineVertexInputStateCreateInfo; + +typedef struct VkPipelineInputAssemblyStateCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineInputAssemblyStateCreateFlags flags; + VkPrimitiveTopology topology; + VkBool32 primitiveRestartEnable; +} VkPipelineInputAssemblyStateCreateInfo; + +typedef struct VkPipelineTessellationStateCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineTessellationStateCreateFlags flags; + uint32_t patchControlPoints; +} VkPipelineTessellationStateCreateInfo; + +typedef struct VkViewport { + float x; + float y; + float width; + float height; + float minDepth; + float maxDepth; +} VkViewport; + +typedef struct VkOffset2D { + int32_t x; + int32_t y; +} VkOffset2D; + +typedef struct VkExtent2D { + uint32_t width; + uint32_t height; +} VkExtent2D; + +typedef struct VkRect2D { + VkOffset2D offset; + VkExtent2D extent; +} VkRect2D; + +typedef struct VkPipelineViewportStateCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineViewportStateCreateFlags flags; + uint32_t viewportCount; + const VkViewport* pViewports; + uint32_t scissorCount; + const VkRect2D* pScissors; +} VkPipelineViewportStateCreateInfo; + +typedef struct VkPipelineRasterizationStateCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineRasterizationStateCreateFlags flags; + VkBool32 depthClampEnable; + VkBool32 rasterizerDiscardEnable; + VkPolygonMode polygonMode; + VkCullModeFlags cullMode; + VkFrontFace frontFace; + VkBool32 depthBiasEnable; + float depthBiasConstantFactor; + float depthBiasClamp; + float depthBiasSlopeFactor; + float lineWidth; +} VkPipelineRasterizationStateCreateInfo; + +typedef struct VkPipelineMultisampleStateCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineMultisampleStateCreateFlags flags; + VkSampleCountFlagBits rasterizationSamples; + VkBool32 sampleShadingEnable; + float minSampleShading; + const VkSampleMask* pSampleMask; + VkBool32 alphaToCoverageEnable; + VkBool32 alphaToOneEnable; +} VkPipelineMultisampleStateCreateInfo; + +typedef struct VkStencilOpState { + VkStencilOp failOp; + VkStencilOp passOp; + VkStencilOp depthFailOp; + VkCompareOp compareOp; + uint32_t compareMask; + uint32_t writeMask; + uint32_t reference; +} VkStencilOpState; + +typedef struct VkPipelineDepthStencilStateCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineDepthStencilStateCreateFlags flags; + VkBool32 depthTestEnable; + VkBool32 depthWriteEnable; + VkCompareOp depthCompareOp; + VkBool32 depthBoundsTestEnable; + VkBool32 stencilTestEnable; + VkStencilOpState front; + VkStencilOpState back; + float minDepthBounds; + float maxDepthBounds; +} VkPipelineDepthStencilStateCreateInfo; + +typedef struct VkPipelineColorBlendAttachmentState { + VkBool32 blendEnable; + VkBlendFactor srcColorBlendFactor; + VkBlendFactor dstColorBlendFactor; + VkBlendOp colorBlendOp; + VkBlendFactor srcAlphaBlendFactor; + VkBlendFactor dstAlphaBlendFactor; + VkBlendOp alphaBlendOp; + VkColorComponentFlags colorWriteMask; +} VkPipelineColorBlendAttachmentState; + +typedef struct VkPipelineColorBlendStateCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineColorBlendStateCreateFlags flags; + VkBool32 logicOpEnable; + VkLogicOp logicOp; + uint32_t attachmentCount; + const VkPipelineColorBlendAttachmentState* pAttachments; + float blendConstants[4]; +} VkPipelineColorBlendStateCreateInfo; + +typedef struct VkPipelineDynamicStateCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineDynamicStateCreateFlags flags; + uint32_t dynamicStateCount; + const VkDynamicState* pDynamicStates; +} VkPipelineDynamicStateCreateInfo; + +typedef struct VkGraphicsPipelineCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineCreateFlags flags; + uint32_t stageCount; + const VkPipelineShaderStageCreateInfo* pStages; + const VkPipelineVertexInputStateCreateInfo* pVertexInputState; + const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState; + const VkPipelineTessellationStateCreateInfo* pTessellationState; + const VkPipelineViewportStateCreateInfo* pViewportState; + const VkPipelineRasterizationStateCreateInfo* pRasterizationState; + const VkPipelineMultisampleStateCreateInfo* pMultisampleState; + const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState; + const VkPipelineColorBlendStateCreateInfo* pColorBlendState; + const VkPipelineDynamicStateCreateInfo* pDynamicState; + VkPipelineLayout layout; + VkRenderPass renderPass; + uint32_t subpass; + VkPipeline basePipelineHandle; + int32_t basePipelineIndex; +} VkGraphicsPipelineCreateInfo; + +typedef struct VkComputePipelineCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineCreateFlags flags; + VkPipelineShaderStageCreateInfo stage; + VkPipelineLayout layout; + VkPipeline basePipelineHandle; + int32_t basePipelineIndex; +} VkComputePipelineCreateInfo; + +typedef struct VkPushConstantRange { + VkShaderStageFlags stageFlags; + uint32_t offset; + uint32_t size; +} VkPushConstantRange; + +typedef struct VkPipelineLayoutCreateInfo { + VkStructureType sType; + const void* pNext; + VkPipelineLayoutCreateFlags flags; + uint32_t setLayoutCount; + const VkDescriptorSetLayout* pSetLayouts; + uint32_t pushConstantRangeCount; + const VkPushConstantRange* pPushConstantRanges; +} VkPipelineLayoutCreateInfo; + +typedef struct VkSamplerCreateInfo { + VkStructureType sType; + const void* pNext; + VkSamplerCreateFlags flags; + VkFilter magFilter; + VkFilter minFilter; + VkSamplerMipmapMode mipmapMode; + VkSamplerAddressMode addressModeU; + VkSamplerAddressMode addressModeV; + VkSamplerAddressMode addressModeW; + float mipLodBias; + VkBool32 anisotropyEnable; + float maxAnisotropy; + VkBool32 compareEnable; + VkCompareOp compareOp; + float minLod; + float maxLod; + VkBorderColor borderColor; + VkBool32 unnormalizedCoordinates; +} VkSamplerCreateInfo; + +typedef struct VkDescriptorSetLayoutBinding { + uint32_t binding; + VkDescriptorType descriptorType; + uint32_t descriptorCount; + VkShaderStageFlags stageFlags; + const VkSampler* pImmutableSamplers; +} VkDescriptorSetLayoutBinding; + +typedef struct VkDescriptorSetLayoutCreateInfo { + VkStructureType sType; + const void* pNext; + VkDescriptorSetLayoutCreateFlags flags; + uint32_t bindingCount; + const VkDescriptorSetLayoutBinding* pBindings; +} VkDescriptorSetLayoutCreateInfo; + +typedef struct VkDescriptorPoolSize { + VkDescriptorType type; + uint32_t descriptorCount; +} VkDescriptorPoolSize; + +typedef struct VkDescriptorPoolCreateInfo { + VkStructureType sType; + const void* pNext; + VkDescriptorPoolCreateFlags flags; + uint32_t maxSets; + uint32_t poolSizeCount; + const VkDescriptorPoolSize* pPoolSizes; +} VkDescriptorPoolCreateInfo; + +typedef struct VkDescriptorSetAllocateInfo { + VkStructureType sType; + const void* pNext; + VkDescriptorPool descriptorPool; + uint32_t descriptorSetCount; + const VkDescriptorSetLayout* pSetLayouts; +} VkDescriptorSetAllocateInfo; + +typedef struct VkDescriptorImageInfo { + VkSampler sampler; + VkImageView imageView; + VkImageLayout imageLayout; +} VkDescriptorImageInfo; + +typedef struct VkDescriptorBufferInfo { + VkBuffer buffer; + VkDeviceSize offset; + VkDeviceSize range; +} VkDescriptorBufferInfo; + +typedef struct VkWriteDescriptorSet { + VkStructureType sType; + const void* pNext; + VkDescriptorSet dstSet; + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; + VkDescriptorType descriptorType; + const VkDescriptorImageInfo* pImageInfo; + const VkDescriptorBufferInfo* pBufferInfo; + const VkBufferView* pTexelBufferView; +} VkWriteDescriptorSet; + +typedef struct VkCopyDescriptorSet { + VkStructureType sType; + const void* pNext; + VkDescriptorSet srcSet; + uint32_t srcBinding; + uint32_t srcArrayElement; + VkDescriptorSet dstSet; + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; +} VkCopyDescriptorSet; + +typedef struct VkFramebufferCreateInfo { + VkStructureType sType; + const void* pNext; + VkFramebufferCreateFlags flags; + VkRenderPass renderPass; + uint32_t attachmentCount; + const VkImageView* pAttachments; + uint32_t width; + uint32_t height; + uint32_t layers; +} VkFramebufferCreateInfo; + +typedef struct VkAttachmentDescription { + VkAttachmentDescriptionFlags flags; + VkFormat format; + VkSampleCountFlagBits samples; + VkAttachmentLoadOp loadOp; + VkAttachmentStoreOp storeOp; + VkAttachmentLoadOp stencilLoadOp; + VkAttachmentStoreOp stencilStoreOp; + VkImageLayout initialLayout; + VkImageLayout finalLayout; +} VkAttachmentDescription; + +typedef struct VkAttachmentReference { + uint32_t attachment; + VkImageLayout layout; +} VkAttachmentReference; + +typedef struct VkSubpassDescription { + VkSubpassDescriptionFlags flags; + VkPipelineBindPoint pipelineBindPoint; + uint32_t inputAttachmentCount; + const VkAttachmentReference* pInputAttachments; + uint32_t colorAttachmentCount; + const VkAttachmentReference* pColorAttachments; + const VkAttachmentReference* pResolveAttachments; + const VkAttachmentReference* pDepthStencilAttachment; + uint32_t preserveAttachmentCount; + const uint32_t* pPreserveAttachments; +} VkSubpassDescription; + +typedef struct VkSubpassDependency { + uint32_t srcSubpass; + uint32_t dstSubpass; + VkPipelineStageFlags srcStageMask; + VkPipelineStageFlags dstStageMask; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; + VkDependencyFlags dependencyFlags; +} VkSubpassDependency; + +typedef struct VkRenderPassCreateInfo { + VkStructureType sType; + const void* pNext; + VkRenderPassCreateFlags flags; + uint32_t attachmentCount; + const VkAttachmentDescription* pAttachments; + uint32_t subpassCount; + const VkSubpassDescription* pSubpasses; + uint32_t dependencyCount; + const VkSubpassDependency* pDependencies; +} VkRenderPassCreateInfo; + +typedef struct VkCommandPoolCreateInfo { + VkStructureType sType; + const void* pNext; + VkCommandPoolCreateFlags flags; + uint32_t queueFamilyIndex; +} VkCommandPoolCreateInfo; + +typedef struct VkCommandBufferAllocateInfo { + VkStructureType sType; + const void* pNext; + VkCommandPool commandPool; + VkCommandBufferLevel level; + uint32_t commandBufferCount; +} VkCommandBufferAllocateInfo; + +typedef struct VkCommandBufferInheritanceInfo { + VkStructureType sType; + const void* pNext; + VkRenderPass renderPass; + uint32_t subpass; + VkFramebuffer framebuffer; + VkBool32 occlusionQueryEnable; + VkQueryControlFlags queryFlags; + VkQueryPipelineStatisticFlags pipelineStatistics; +} VkCommandBufferInheritanceInfo; + +typedef struct VkCommandBufferBeginInfo { + VkStructureType sType; + const void* pNext; + VkCommandBufferUsageFlags flags; + const VkCommandBufferInheritanceInfo* pInheritanceInfo; +} VkCommandBufferBeginInfo; + +typedef struct VkBufferCopy { + VkDeviceSize srcOffset; + VkDeviceSize dstOffset; + VkDeviceSize size; +} VkBufferCopy; + +typedef struct VkImageSubresourceLayers { + VkImageAspectFlags aspectMask; + uint32_t mipLevel; + uint32_t baseArrayLayer; + uint32_t layerCount; +} VkImageSubresourceLayers; + +typedef struct VkImageCopy { + VkImageSubresourceLayers srcSubresource; + VkOffset3D srcOffset; + VkImageSubresourceLayers dstSubresource; + VkOffset3D dstOffset; + VkExtent3D extent; +} VkImageCopy; + +typedef struct VkImageBlit { + VkImageSubresourceLayers srcSubresource; + VkOffset3D srcOffsets[2]; + VkImageSubresourceLayers dstSubresource; + VkOffset3D dstOffsets[2]; +} VkImageBlit; + +typedef struct VkBufferImageCopy { + VkDeviceSize bufferOffset; + uint32_t bufferRowLength; + uint32_t bufferImageHeight; + VkImageSubresourceLayers imageSubresource; + VkOffset3D imageOffset; + VkExtent3D imageExtent; +} VkBufferImageCopy; + +typedef union VkClearColorValue { + float float32[4]; + int32_t int32[4]; + uint32_t uint32[4]; +} VkClearColorValue; + +typedef struct VkClearDepthStencilValue { + float depth; + uint32_t stencil; +} VkClearDepthStencilValue; + +typedef union VkClearValue { + VkClearColorValue color; + VkClearDepthStencilValue depthStencil; +} VkClearValue; + +typedef struct VkClearAttachment { + VkImageAspectFlags aspectMask; + uint32_t colorAttachment; + VkClearValue clearValue; +} VkClearAttachment; + +typedef struct VkClearRect { + VkRect2D rect; + uint32_t baseArrayLayer; + uint32_t layerCount; +} VkClearRect; + +typedef struct VkImageResolve { + VkImageSubresourceLayers srcSubresource; + VkOffset3D srcOffset; + VkImageSubresourceLayers dstSubresource; + VkOffset3D dstOffset; + VkExtent3D extent; +} VkImageResolve; + +typedef struct VkMemoryBarrier { + VkStructureType sType; + const void* pNext; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; +} VkMemoryBarrier; + +typedef struct VkBufferMemoryBarrier { + VkStructureType sType; + const void* pNext; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; + uint32_t srcQueueFamilyIndex; + uint32_t dstQueueFamilyIndex; + VkBuffer buffer; + VkDeviceSize offset; + VkDeviceSize size; +} VkBufferMemoryBarrier; + +typedef struct VkImageMemoryBarrier { + VkStructureType sType; + const void* pNext; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; + VkImageLayout oldLayout; + VkImageLayout newLayout; + uint32_t srcQueueFamilyIndex; + uint32_t dstQueueFamilyIndex; + VkImage image; + VkImageSubresourceRange subresourceRange; +} VkImageMemoryBarrier; + +typedef struct VkRenderPassBeginInfo { + VkStructureType sType; + const void* pNext; + VkRenderPass renderPass; + VkFramebuffer framebuffer; + VkRect2D renderArea; + uint32_t clearValueCount; + const VkClearValue* pClearValues; +} VkRenderPassBeginInfo; + +typedef struct VkDispatchIndirectCommand { + uint32_t x; + uint32_t y; + uint32_t z; +} VkDispatchIndirectCommand; + +typedef struct VkDrawIndexedIndirectCommand { + uint32_t indexCount; + uint32_t instanceCount; + uint32_t firstIndex; + int32_t vertexOffset; + uint32_t firstInstance; +} VkDrawIndexedIndirectCommand; + +typedef struct VkDrawIndirectCommand { + uint32_t vertexCount; + uint32_t instanceCount; + uint32_t firstVertex; + uint32_t firstInstance; +} VkDrawIndirectCommand; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateInstance)(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance); +typedef void (VKAPI_PTR *PFN_vkDestroyInstance)(VkInstance instance, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDevices)(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFeatures)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties)(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMemoryProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties); +typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vkGetInstanceProcAddr)(VkInstance instance, const char* pName); +typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vkGetDeviceProcAddr)(VkDevice device, const char* pName); +typedef VkResult (VKAPI_PTR *PFN_vkCreateDevice)(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice); +typedef void (VKAPI_PTR *PFN_vkDestroyDevice)(VkDevice device, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkEnumerateInstanceExtensionProperties)(const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties); +typedef VkResult (VKAPI_PTR *PFN_vkEnumerateDeviceExtensionProperties)(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties); +typedef VkResult (VKAPI_PTR *PFN_vkEnumerateInstanceLayerProperties)(uint32_t* pPropertyCount, VkLayerProperties* pProperties); +typedef VkResult (VKAPI_PTR *PFN_vkEnumerateDeviceLayerProperties)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkLayerProperties* pProperties); +typedef void (VKAPI_PTR *PFN_vkGetDeviceQueue)(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue); +typedef VkResult (VKAPI_PTR *PFN_vkQueueSubmit)(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence); +typedef VkResult (VKAPI_PTR *PFN_vkQueueWaitIdle)(VkQueue queue); +typedef VkResult (VKAPI_PTR *PFN_vkDeviceWaitIdle)(VkDevice device); +typedef VkResult (VKAPI_PTR *PFN_vkAllocateMemory)(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory); +typedef void (VKAPI_PTR *PFN_vkFreeMemory)(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkMapMemory)(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData); +typedef void (VKAPI_PTR *PFN_vkUnmapMemory)(VkDevice device, VkDeviceMemory memory); +typedef VkResult (VKAPI_PTR *PFN_vkFlushMappedMemoryRanges)(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges); +typedef VkResult (VKAPI_PTR *PFN_vkInvalidateMappedMemoryRanges)(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges); +typedef void (VKAPI_PTR *PFN_vkGetDeviceMemoryCommitment)(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes); +typedef VkResult (VKAPI_PTR *PFN_vkBindBufferMemory)(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset); +typedef VkResult (VKAPI_PTR *PFN_vkBindImageMemory)(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset); +typedef void (VKAPI_PTR *PFN_vkGetBufferMemoryRequirements)(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements); +typedef void (VKAPI_PTR *PFN_vkGetImageMemoryRequirements)(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements); +typedef void (VKAPI_PTR *PFN_vkGetImageSparseMemoryRequirements)(VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties); +typedef VkResult (VKAPI_PTR *PFN_vkQueueBindSparse)(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence); +typedef VkResult (VKAPI_PTR *PFN_vkCreateFence)(VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence); +typedef void (VKAPI_PTR *PFN_vkDestroyFence)(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkResetFences)(VkDevice device, uint32_t fenceCount, const VkFence* pFences); +typedef VkResult (VKAPI_PTR *PFN_vkGetFenceStatus)(VkDevice device, VkFence fence); +typedef VkResult (VKAPI_PTR *PFN_vkWaitForFences)(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout); +typedef VkResult (VKAPI_PTR *PFN_vkCreateSemaphore)(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore); +typedef void (VKAPI_PTR *PFN_vkDestroySemaphore)(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreateEvent)(VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkEvent* pEvent); +typedef void (VKAPI_PTR *PFN_vkDestroyEvent)(VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkGetEventStatus)(VkDevice device, VkEvent event); +typedef VkResult (VKAPI_PTR *PFN_vkSetEvent)(VkDevice device, VkEvent event); +typedef VkResult (VKAPI_PTR *PFN_vkResetEvent)(VkDevice device, VkEvent event); +typedef VkResult (VKAPI_PTR *PFN_vkCreateQueryPool)(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool); +typedef void (VKAPI_PTR *PFN_vkDestroyQueryPool)(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkGetQueryPoolResults)(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags); +typedef VkResult (VKAPI_PTR *PFN_vkCreateBuffer)(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer); +typedef void (VKAPI_PTR *PFN_vkDestroyBuffer)(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreateBufferView)(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferView* pView); +typedef void (VKAPI_PTR *PFN_vkDestroyBufferView)(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreateImage)(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage); +typedef void (VKAPI_PTR *PFN_vkDestroyImage)(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkGetImageSubresourceLayout)(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout); +typedef VkResult (VKAPI_PTR *PFN_vkCreateImageView)(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView); +typedef void (VKAPI_PTR *PFN_vkDestroyImageView)(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreateShaderModule)(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule); +typedef void (VKAPI_PTR *PFN_vkDestroyShaderModule)(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreatePipelineCache)(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache); +typedef void (VKAPI_PTR *PFN_vkDestroyPipelineCache)(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkGetPipelineCacheData)(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData); +typedef VkResult (VKAPI_PTR *PFN_vkMergePipelineCaches)(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches); +typedef VkResult (VKAPI_PTR *PFN_vkCreateGraphicsPipelines)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines); +typedef VkResult (VKAPI_PTR *PFN_vkCreateComputePipelines)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines); +typedef void (VKAPI_PTR *PFN_vkDestroyPipeline)(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreatePipelineLayout)(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout); +typedef void (VKAPI_PTR *PFN_vkDestroyPipelineLayout)(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreateSampler)(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSampler* pSampler); +typedef void (VKAPI_PTR *PFN_vkDestroySampler)(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorSetLayout)(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout); +typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorSetLayout)(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorPool)(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool); +typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkResetDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags); +typedef VkResult (VKAPI_PTR *PFN_vkAllocateDescriptorSets)(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets); +typedef VkResult (VKAPI_PTR *PFN_vkFreeDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets); +typedef void (VKAPI_PTR *PFN_vkUpdateDescriptorSets)(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies); +typedef VkResult (VKAPI_PTR *PFN_vkCreateFramebuffer)(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer); +typedef void (VKAPI_PTR *PFN_vkDestroyFramebuffer)(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreateRenderPass)(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass); +typedef void (VKAPI_PTR *PFN_vkDestroyRenderPass)(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkGetRenderAreaGranularity)(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity); +typedef VkResult (VKAPI_PTR *PFN_vkCreateCommandPool)(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool); +typedef void (VKAPI_PTR *PFN_vkDestroyCommandPool)(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkResetCommandPool)(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags); +typedef VkResult (VKAPI_PTR *PFN_vkAllocateCommandBuffers)(VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers); +typedef void (VKAPI_PTR *PFN_vkFreeCommandBuffers)(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers); +typedef VkResult (VKAPI_PTR *PFN_vkBeginCommandBuffer)(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo); +typedef VkResult (VKAPI_PTR *PFN_vkEndCommandBuffer)(VkCommandBuffer commandBuffer); +typedef VkResult (VKAPI_PTR *PFN_vkResetCommandBuffer)(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags); +typedef void (VKAPI_PTR *PFN_vkCmdBindPipeline)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline); +typedef void (VKAPI_PTR *PFN_vkCmdSetViewport)(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports); +typedef void (VKAPI_PTR *PFN_vkCmdSetScissor)(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors); +typedef void (VKAPI_PTR *PFN_vkCmdSetLineWidth)(VkCommandBuffer commandBuffer, float lineWidth); +typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBias)(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor); +typedef void (VKAPI_PTR *PFN_vkCmdSetBlendConstants)(VkCommandBuffer commandBuffer, const float blendConstants[4]); +typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBounds)(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds); +typedef void (VKAPI_PTR *PFN_vkCmdSetStencilCompareMask)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask); +typedef void (VKAPI_PTR *PFN_vkCmdSetStencilWriteMask)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask); +typedef void (VKAPI_PTR *PFN_vkCmdSetStencilReference)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference); +typedef void (VKAPI_PTR *PFN_vkCmdBindDescriptorSets)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets); +typedef void (VKAPI_PTR *PFN_vkCmdBindIndexBuffer)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType); +typedef void (VKAPI_PTR *PFN_vkCmdBindVertexBuffers)(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets); +typedef void (VKAPI_PTR *PFN_vkCmdDraw)(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); +typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexed)(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance); +typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); +typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexedIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); +typedef void (VKAPI_PTR *PFN_vkCmdDispatch)(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); +typedef void (VKAPI_PTR *PFN_vkCmdDispatchIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); +typedef void (VKAPI_PTR *PFN_vkCmdCopyBuffer)(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy* pRegions); +typedef void (VKAPI_PTR *PFN_vkCmdCopyImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions); +typedef void (VKAPI_PTR *PFN_vkCmdBlitImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkFilter filter); +typedef void (VKAPI_PTR *PFN_vkCmdCopyBufferToImage)(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions); +typedef void (VKAPI_PTR *PFN_vkCmdCopyImageToBuffer)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions); +typedef void (VKAPI_PTR *PFN_vkCmdUpdateBuffer)(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void* pData); +typedef void (VKAPI_PTR *PFN_vkCmdFillBuffer)(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data); +typedef void (VKAPI_PTR *PFN_vkCmdClearColorImage)(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges); +typedef void (VKAPI_PTR *PFN_vkCmdClearDepthStencilImage)(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges); +typedef void (VKAPI_PTR *PFN_vkCmdClearAttachments)(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects); +typedef void (VKAPI_PTR *PFN_vkCmdResolveImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve* pRegions); +typedef void (VKAPI_PTR *PFN_vkCmdSetEvent)(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); +typedef void (VKAPI_PTR *PFN_vkCmdResetEvent)(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); +typedef void (VKAPI_PTR *PFN_vkCmdWaitEvents)(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers); +typedef void (VKAPI_PTR *PFN_vkCmdPipelineBarrier)(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers); +typedef void (VKAPI_PTR *PFN_vkCmdBeginQuery)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags); +typedef void (VKAPI_PTR *PFN_vkCmdEndQuery)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query); +typedef void (VKAPI_PTR *PFN_vkCmdResetQueryPool)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount); +typedef void (VKAPI_PTR *PFN_vkCmdWriteTimestamp)(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query); +typedef void (VKAPI_PTR *PFN_vkCmdCopyQueryPoolResults)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags); +typedef void (VKAPI_PTR *PFN_vkCmdPushConstants)(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues); +typedef void (VKAPI_PTR *PFN_vkCmdBeginRenderPass)(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents); +typedef void (VKAPI_PTR *PFN_vkCmdNextSubpass)(VkCommandBuffer commandBuffer, VkSubpassContents contents); +typedef void (VKAPI_PTR *PFN_vkCmdEndRenderPass)(VkCommandBuffer commandBuffer); +typedef void (VKAPI_PTR *PFN_vkCmdExecuteCommands)(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance( + const VkInstanceCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkInstance* pInstance); + +VKAPI_ATTR void VKAPI_CALL vkDestroyInstance( + VkInstance instance, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDevices( + VkInstance instance, + uint32_t* pPhysicalDeviceCount, + VkPhysicalDevice* pPhysicalDevices); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceFeatures* pFeatures); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties( + VkPhysicalDevice physicalDevice, + VkFormat format, + VkFormatProperties* pFormatProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties( + VkPhysicalDevice physicalDevice, + VkFormat format, + VkImageType type, + VkImageTiling tiling, + VkImageUsageFlags usage, + VkImageCreateFlags flags, + VkImageFormatProperties* pImageFormatProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceProperties* pProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties( + VkPhysicalDevice physicalDevice, + uint32_t* pQueueFamilyPropertyCount, + VkQueueFamilyProperties* pQueueFamilyProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceMemoryProperties* pMemoryProperties); + +VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr( + VkInstance instance, + const char* pName); + +VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr( + VkDevice device, + const char* pName); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice( + VkPhysicalDevice physicalDevice, + const VkDeviceCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDevice* pDevice); + +VKAPI_ATTR void VKAPI_CALL vkDestroyDevice( + VkDevice device, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionProperties( + const char* pLayerName, + uint32_t* pPropertyCount, + VkExtensionProperties* pProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties( + VkPhysicalDevice physicalDevice, + const char* pLayerName, + uint32_t* pPropertyCount, + VkExtensionProperties* pProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties( + uint32_t* pPropertyCount, + VkLayerProperties* pProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceLayerProperties( + VkPhysicalDevice physicalDevice, + uint32_t* pPropertyCount, + VkLayerProperties* pProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue( + VkDevice device, + uint32_t queueFamilyIndex, + uint32_t queueIndex, + VkQueue* pQueue); + +VKAPI_ATTR VkResult VKAPI_CALL vkQueueSubmit( + VkQueue queue, + uint32_t submitCount, + const VkSubmitInfo* pSubmits, + VkFence fence); + +VKAPI_ATTR VkResult VKAPI_CALL vkQueueWaitIdle( + VkQueue queue); + +VKAPI_ATTR VkResult VKAPI_CALL vkDeviceWaitIdle( + VkDevice device); + +VKAPI_ATTR VkResult VKAPI_CALL vkAllocateMemory( + VkDevice device, + const VkMemoryAllocateInfo* pAllocateInfo, + const VkAllocationCallbacks* pAllocator, + VkDeviceMemory* pMemory); + +VKAPI_ATTR void VKAPI_CALL vkFreeMemory( + VkDevice device, + VkDeviceMemory memory, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkMapMemory( + VkDevice device, + VkDeviceMemory memory, + VkDeviceSize offset, + VkDeviceSize size, + VkMemoryMapFlags flags, + void** ppData); + +VKAPI_ATTR void VKAPI_CALL vkUnmapMemory( + VkDevice device, + VkDeviceMemory memory); + +VKAPI_ATTR VkResult VKAPI_CALL vkFlushMappedMemoryRanges( + VkDevice device, + uint32_t memoryRangeCount, + const VkMappedMemoryRange* pMemoryRanges); + +VKAPI_ATTR VkResult VKAPI_CALL vkInvalidateMappedMemoryRanges( + VkDevice device, + uint32_t memoryRangeCount, + const VkMappedMemoryRange* pMemoryRanges); + +VKAPI_ATTR void VKAPI_CALL vkGetDeviceMemoryCommitment( + VkDevice device, + VkDeviceMemory memory, + VkDeviceSize* pCommittedMemoryInBytes); + +VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory( + VkDevice device, + VkBuffer buffer, + VkDeviceMemory memory, + VkDeviceSize memoryOffset); + +VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory( + VkDevice device, + VkImage image, + VkDeviceMemory memory, + VkDeviceSize memoryOffset); + +VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements( + VkDevice device, + VkBuffer buffer, + VkMemoryRequirements* pMemoryRequirements); + +VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements( + VkDevice device, + VkImage image, + VkMemoryRequirements* pMemoryRequirements); + +VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements( + VkDevice device, + VkImage image, + uint32_t* pSparseMemoryRequirementCount, + VkSparseImageMemoryRequirements* pSparseMemoryRequirements); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties( + VkPhysicalDevice physicalDevice, + VkFormat format, + VkImageType type, + VkSampleCountFlagBits samples, + VkImageUsageFlags usage, + VkImageTiling tiling, + uint32_t* pPropertyCount, + VkSparseImageFormatProperties* pProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkQueueBindSparse( + VkQueue queue, + uint32_t bindInfoCount, + const VkBindSparseInfo* pBindInfo, + VkFence fence); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateFence( + VkDevice device, + const VkFenceCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkFence* pFence); + +VKAPI_ATTR void VKAPI_CALL vkDestroyFence( + VkDevice device, + VkFence fence, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkResetFences( + VkDevice device, + uint32_t fenceCount, + const VkFence* pFences); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceStatus( + VkDevice device, + VkFence fence); + +VKAPI_ATTR VkResult VKAPI_CALL vkWaitForFences( + VkDevice device, + uint32_t fenceCount, + const VkFence* pFences, + VkBool32 waitAll, + uint64_t timeout); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateSemaphore( + VkDevice device, + const VkSemaphoreCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSemaphore* pSemaphore); + +VKAPI_ATTR void VKAPI_CALL vkDestroySemaphore( + VkDevice device, + VkSemaphore semaphore, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateEvent( + VkDevice device, + const VkEventCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkEvent* pEvent); + +VKAPI_ATTR void VKAPI_CALL vkDestroyEvent( + VkDevice device, + VkEvent event, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetEventStatus( + VkDevice device, + VkEvent event); + +VKAPI_ATTR VkResult VKAPI_CALL vkSetEvent( + VkDevice device, + VkEvent event); + +VKAPI_ATTR VkResult VKAPI_CALL vkResetEvent( + VkDevice device, + VkEvent event); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateQueryPool( + VkDevice device, + const VkQueryPoolCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkQueryPool* pQueryPool); + +VKAPI_ATTR void VKAPI_CALL vkDestroyQueryPool( + VkDevice device, + VkQueryPool queryPool, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetQueryPoolResults( + VkDevice device, + VkQueryPool queryPool, + uint32_t firstQuery, + uint32_t queryCount, + size_t dataSize, + void* pData, + VkDeviceSize stride, + VkQueryResultFlags flags); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateBuffer( + VkDevice device, + const VkBufferCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkBuffer* pBuffer); + +VKAPI_ATTR void VKAPI_CALL vkDestroyBuffer( + VkDevice device, + VkBuffer buffer, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferView( + VkDevice device, + const VkBufferViewCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkBufferView* pView); + +VKAPI_ATTR void VKAPI_CALL vkDestroyBufferView( + VkDevice device, + VkBufferView bufferView, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateImage( + VkDevice device, + const VkImageCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkImage* pImage); + +VKAPI_ATTR void VKAPI_CALL vkDestroyImage( + VkDevice device, + VkImage image, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR void VKAPI_CALL vkGetImageSubresourceLayout( + VkDevice device, + VkImage image, + const VkImageSubresource* pSubresource, + VkSubresourceLayout* pLayout); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateImageView( + VkDevice device, + const VkImageViewCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkImageView* pView); + +VKAPI_ATTR void VKAPI_CALL vkDestroyImageView( + VkDevice device, + VkImageView imageView, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateShaderModule( + VkDevice device, + const VkShaderModuleCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkShaderModule* pShaderModule); + +VKAPI_ATTR void VKAPI_CALL vkDestroyShaderModule( + VkDevice device, + VkShaderModule shaderModule, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineCache( + VkDevice device, + const VkPipelineCacheCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkPipelineCache* pPipelineCache); + +VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineCache( + VkDevice device, + VkPipelineCache pipelineCache, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelineCacheData( + VkDevice device, + VkPipelineCache pipelineCache, + size_t* pDataSize, + void* pData); + +VKAPI_ATTR VkResult VKAPI_CALL vkMergePipelineCaches( + VkDevice device, + VkPipelineCache dstCache, + uint32_t srcCacheCount, + const VkPipelineCache* pSrcCaches); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateGraphicsPipelines( + VkDevice device, + VkPipelineCache pipelineCache, + uint32_t createInfoCount, + const VkGraphicsPipelineCreateInfo* pCreateInfos, + const VkAllocationCallbacks* pAllocator, + VkPipeline* pPipelines); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateComputePipelines( + VkDevice device, + VkPipelineCache pipelineCache, + uint32_t createInfoCount, + const VkComputePipelineCreateInfo* pCreateInfos, + const VkAllocationCallbacks* pAllocator, + VkPipeline* pPipelines); + +VKAPI_ATTR void VKAPI_CALL vkDestroyPipeline( + VkDevice device, + VkPipeline pipeline, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineLayout( + VkDevice device, + const VkPipelineLayoutCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkPipelineLayout* pPipelineLayout); + +VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineLayout( + VkDevice device, + VkPipelineLayout pipelineLayout, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateSampler( + VkDevice device, + const VkSamplerCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSampler* pSampler); + +VKAPI_ATTR void VKAPI_CALL vkDestroySampler( + VkDevice device, + VkSampler sampler, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorSetLayout( + VkDevice device, + const VkDescriptorSetLayoutCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDescriptorSetLayout* pSetLayout); + +VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorSetLayout( + VkDevice device, + VkDescriptorSetLayout descriptorSetLayout, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorPool( + VkDevice device, + const VkDescriptorPoolCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDescriptorPool* pDescriptorPool); + +VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorPool( + VkDevice device, + VkDescriptorPool descriptorPool, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkResetDescriptorPool( + VkDevice device, + VkDescriptorPool descriptorPool, + VkDescriptorPoolResetFlags flags); + +VKAPI_ATTR VkResult VKAPI_CALL vkAllocateDescriptorSets( + VkDevice device, + const VkDescriptorSetAllocateInfo* pAllocateInfo, + VkDescriptorSet* pDescriptorSets); + +VKAPI_ATTR VkResult VKAPI_CALL vkFreeDescriptorSets( + VkDevice device, + VkDescriptorPool descriptorPool, + uint32_t descriptorSetCount, + const VkDescriptorSet* pDescriptorSets); + +VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSets( + VkDevice device, + uint32_t descriptorWriteCount, + const VkWriteDescriptorSet* pDescriptorWrites, + uint32_t descriptorCopyCount, + const VkCopyDescriptorSet* pDescriptorCopies); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateFramebuffer( + VkDevice device, + const VkFramebufferCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkFramebuffer* pFramebuffer); + +VKAPI_ATTR void VKAPI_CALL vkDestroyFramebuffer( + VkDevice device, + VkFramebuffer framebuffer, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass( + VkDevice device, + const VkRenderPassCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkRenderPass* pRenderPass); + +VKAPI_ATTR void VKAPI_CALL vkDestroyRenderPass( + VkDevice device, + VkRenderPass renderPass, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR void VKAPI_CALL vkGetRenderAreaGranularity( + VkDevice device, + VkRenderPass renderPass, + VkExtent2D* pGranularity); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateCommandPool( + VkDevice device, + const VkCommandPoolCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkCommandPool* pCommandPool); + +VKAPI_ATTR void VKAPI_CALL vkDestroyCommandPool( + VkDevice device, + VkCommandPool commandPool, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandPool( + VkDevice device, + VkCommandPool commandPool, + VkCommandPoolResetFlags flags); + +VKAPI_ATTR VkResult VKAPI_CALL vkAllocateCommandBuffers( + VkDevice device, + const VkCommandBufferAllocateInfo* pAllocateInfo, + VkCommandBuffer* pCommandBuffers); + +VKAPI_ATTR void VKAPI_CALL vkFreeCommandBuffers( + VkDevice device, + VkCommandPool commandPool, + uint32_t commandBufferCount, + const VkCommandBuffer* pCommandBuffers); + +VKAPI_ATTR VkResult VKAPI_CALL vkBeginCommandBuffer( + VkCommandBuffer commandBuffer, + const VkCommandBufferBeginInfo* pBeginInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkEndCommandBuffer( + VkCommandBuffer commandBuffer); + +VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandBuffer( + VkCommandBuffer commandBuffer, + VkCommandBufferResetFlags flags); + +VKAPI_ATTR void VKAPI_CALL vkCmdBindPipeline( + VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipeline pipeline); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetViewport( + VkCommandBuffer commandBuffer, + uint32_t firstViewport, + uint32_t viewportCount, + const VkViewport* pViewports); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetScissor( + VkCommandBuffer commandBuffer, + uint32_t firstScissor, + uint32_t scissorCount, + const VkRect2D* pScissors); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetLineWidth( + VkCommandBuffer commandBuffer, + float lineWidth); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBias( + VkCommandBuffer commandBuffer, + float depthBiasConstantFactor, + float depthBiasClamp, + float depthBiasSlopeFactor); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetBlendConstants( + VkCommandBuffer commandBuffer, + const float blendConstants[4]); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBounds( + VkCommandBuffer commandBuffer, + float minDepthBounds, + float maxDepthBounds); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilCompareMask( + VkCommandBuffer commandBuffer, + VkStencilFaceFlags faceMask, + uint32_t compareMask); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilWriteMask( + VkCommandBuffer commandBuffer, + VkStencilFaceFlags faceMask, + uint32_t writeMask); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilReference( + VkCommandBuffer commandBuffer, + VkStencilFaceFlags faceMask, + uint32_t reference); + +VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorSets( + VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipelineLayout layout, + uint32_t firstSet, + uint32_t descriptorSetCount, + const VkDescriptorSet* pDescriptorSets, + uint32_t dynamicOffsetCount, + const uint32_t* pDynamicOffsets); + +VKAPI_ATTR void VKAPI_CALL vkCmdBindIndexBuffer( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkIndexType indexType); + +VKAPI_ATTR void VKAPI_CALL vkCmdBindVertexBuffers( + VkCommandBuffer commandBuffer, + uint32_t firstBinding, + uint32_t bindingCount, + const VkBuffer* pBuffers, + const VkDeviceSize* pOffsets); + +VKAPI_ATTR void VKAPI_CALL vkCmdDraw( + VkCommandBuffer commandBuffer, + uint32_t vertexCount, + uint32_t instanceCount, + uint32_t firstVertex, + uint32_t firstInstance); + +VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexed( + VkCommandBuffer commandBuffer, + uint32_t indexCount, + uint32_t instanceCount, + uint32_t firstIndex, + int32_t vertexOffset, + uint32_t firstInstance); + +VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirect( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + uint32_t drawCount, + uint32_t stride); + +VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirect( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + uint32_t drawCount, + uint32_t stride); + +VKAPI_ATTR void VKAPI_CALL vkCmdDispatch( + VkCommandBuffer commandBuffer, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ); + +VKAPI_ATTR void VKAPI_CALL vkCmdDispatchIndirect( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset); + +VKAPI_ATTR void VKAPI_CALL vkCmdCopyBuffer( + VkCommandBuffer commandBuffer, + VkBuffer srcBuffer, + VkBuffer dstBuffer, + uint32_t regionCount, + const VkBufferCopy* pRegions); + +VKAPI_ATTR void VKAPI_CALL vkCmdCopyImage( + VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkImageCopy* pRegions); + +VKAPI_ATTR void VKAPI_CALL vkCmdBlitImage( + VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkImageBlit* pRegions, + VkFilter filter); + +VKAPI_ATTR void VKAPI_CALL vkCmdCopyBufferToImage( + VkCommandBuffer commandBuffer, + VkBuffer srcBuffer, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkBufferImageCopy* pRegions); + +VKAPI_ATTR void VKAPI_CALL vkCmdCopyImageToBuffer( + VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkBuffer dstBuffer, + uint32_t regionCount, + const VkBufferImageCopy* pRegions); + +VKAPI_ATTR void VKAPI_CALL vkCmdUpdateBuffer( + VkCommandBuffer commandBuffer, + VkBuffer dstBuffer, + VkDeviceSize dstOffset, + VkDeviceSize dataSize, + const void* pData); + +VKAPI_ATTR void VKAPI_CALL vkCmdFillBuffer( + VkCommandBuffer commandBuffer, + VkBuffer dstBuffer, + VkDeviceSize dstOffset, + VkDeviceSize size, + uint32_t data); + +VKAPI_ATTR void VKAPI_CALL vkCmdClearColorImage( + VkCommandBuffer commandBuffer, + VkImage image, + VkImageLayout imageLayout, + const VkClearColorValue* pColor, + uint32_t rangeCount, + const VkImageSubresourceRange* pRanges); + +VKAPI_ATTR void VKAPI_CALL vkCmdClearDepthStencilImage( + VkCommandBuffer commandBuffer, + VkImage image, + VkImageLayout imageLayout, + const VkClearDepthStencilValue* pDepthStencil, + uint32_t rangeCount, + const VkImageSubresourceRange* pRanges); + +VKAPI_ATTR void VKAPI_CALL vkCmdClearAttachments( + VkCommandBuffer commandBuffer, + uint32_t attachmentCount, + const VkClearAttachment* pAttachments, + uint32_t rectCount, + const VkClearRect* pRects); + +VKAPI_ATTR void VKAPI_CALL vkCmdResolveImage( + VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkImageResolve* pRegions); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetEvent( + VkCommandBuffer commandBuffer, + VkEvent event, + VkPipelineStageFlags stageMask); + +VKAPI_ATTR void VKAPI_CALL vkCmdResetEvent( + VkCommandBuffer commandBuffer, + VkEvent event, + VkPipelineStageFlags stageMask); + +VKAPI_ATTR void VKAPI_CALL vkCmdWaitEvents( + VkCommandBuffer commandBuffer, + uint32_t eventCount, + const VkEvent* pEvents, + VkPipelineStageFlags srcStageMask, + VkPipelineStageFlags dstStageMask, + uint32_t memoryBarrierCount, + const VkMemoryBarrier* pMemoryBarriers, + uint32_t bufferMemoryBarrierCount, + const VkBufferMemoryBarrier* pBufferMemoryBarriers, + uint32_t imageMemoryBarrierCount, + const VkImageMemoryBarrier* pImageMemoryBarriers); + +VKAPI_ATTR void VKAPI_CALL vkCmdPipelineBarrier( + VkCommandBuffer commandBuffer, + VkPipelineStageFlags srcStageMask, + VkPipelineStageFlags dstStageMask, + VkDependencyFlags dependencyFlags, + uint32_t memoryBarrierCount, + const VkMemoryBarrier* pMemoryBarriers, + uint32_t bufferMemoryBarrierCount, + const VkBufferMemoryBarrier* pBufferMemoryBarriers, + uint32_t imageMemoryBarrierCount, + const VkImageMemoryBarrier* pImageMemoryBarriers); + +VKAPI_ATTR void VKAPI_CALL vkCmdBeginQuery( + VkCommandBuffer commandBuffer, + VkQueryPool queryPool, + uint32_t query, + VkQueryControlFlags flags); + +VKAPI_ATTR void VKAPI_CALL vkCmdEndQuery( + VkCommandBuffer commandBuffer, + VkQueryPool queryPool, + uint32_t query); + +VKAPI_ATTR void VKAPI_CALL vkCmdResetQueryPool( + VkCommandBuffer commandBuffer, + VkQueryPool queryPool, + uint32_t firstQuery, + uint32_t queryCount); + +VKAPI_ATTR void VKAPI_CALL vkCmdWriteTimestamp( + VkCommandBuffer commandBuffer, + VkPipelineStageFlagBits pipelineStage, + VkQueryPool queryPool, + uint32_t query); + +VKAPI_ATTR void VKAPI_CALL vkCmdCopyQueryPoolResults( + VkCommandBuffer commandBuffer, + VkQueryPool queryPool, + uint32_t firstQuery, + uint32_t queryCount, + VkBuffer dstBuffer, + VkDeviceSize dstOffset, + VkDeviceSize stride, + VkQueryResultFlags flags); + +VKAPI_ATTR void VKAPI_CALL vkCmdPushConstants( + VkCommandBuffer commandBuffer, + VkPipelineLayout layout, + VkShaderStageFlags stageFlags, + uint32_t offset, + uint32_t size, + const void* pValues); + +VKAPI_ATTR void VKAPI_CALL vkCmdBeginRenderPass( + VkCommandBuffer commandBuffer, + const VkRenderPassBeginInfo* pRenderPassBegin, + VkSubpassContents contents); + +VKAPI_ATTR void VKAPI_CALL vkCmdNextSubpass( + VkCommandBuffer commandBuffer, + VkSubpassContents contents); + +VKAPI_ATTR void VKAPI_CALL vkCmdEndRenderPass( + VkCommandBuffer commandBuffer); + +VKAPI_ATTR void VKAPI_CALL vkCmdExecuteCommands( + VkCommandBuffer commandBuffer, + uint32_t commandBufferCount, + const VkCommandBuffer* pCommandBuffers); +#endif + +#define VK_VERSION_1_1 1 +// Vulkan 1.1 version number +#define VK_API_VERSION_1_1 VK_MAKE_VERSION(1, 1, 0)// Patch version should always be set to 0 + + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSamplerYcbcrConversion) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorUpdateTemplate) + +#define VK_MAX_DEVICE_GROUP_SIZE 32 +#define VK_LUID_SIZE 8 +#define VK_QUEUE_FAMILY_EXTERNAL (~0U-1) + + +typedef enum VkPointClippingBehavior { + VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES = 0, + VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY = 1, + VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES_KHR = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES, + VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY_KHR = VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY, + VK_POINT_CLIPPING_BEHAVIOR_BEGIN_RANGE = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES, + VK_POINT_CLIPPING_BEHAVIOR_END_RANGE = VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY, + VK_POINT_CLIPPING_BEHAVIOR_RANGE_SIZE = (VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY - VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES + 1), + VK_POINT_CLIPPING_BEHAVIOR_MAX_ENUM = 0x7FFFFFFF +} VkPointClippingBehavior; + +typedef enum VkTessellationDomainOrigin { + VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT = 0, + VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT = 1, + VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT_KHR = VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT, + VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT_KHR = VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT, + VK_TESSELLATION_DOMAIN_ORIGIN_BEGIN_RANGE = VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT, + VK_TESSELLATION_DOMAIN_ORIGIN_END_RANGE = VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT, + VK_TESSELLATION_DOMAIN_ORIGIN_RANGE_SIZE = (VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT - VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT + 1), + VK_TESSELLATION_DOMAIN_ORIGIN_MAX_ENUM = 0x7FFFFFFF +} VkTessellationDomainOrigin; + +typedef enum VkSamplerYcbcrModelConversion { + VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY = 0, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY = 1, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709 = 2, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601 = 3, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020 = 4, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_BEGIN_RANGE = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_END_RANGE = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_RANGE_SIZE = (VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020 - VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY + 1), + VK_SAMPLER_YCBCR_MODEL_CONVERSION_MAX_ENUM = 0x7FFFFFFF +} VkSamplerYcbcrModelConversion; + +typedef enum VkSamplerYcbcrRange { + VK_SAMPLER_YCBCR_RANGE_ITU_FULL = 0, + VK_SAMPLER_YCBCR_RANGE_ITU_NARROW = 1, + VK_SAMPLER_YCBCR_RANGE_ITU_FULL_KHR = VK_SAMPLER_YCBCR_RANGE_ITU_FULL, + VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR = VK_SAMPLER_YCBCR_RANGE_ITU_NARROW, + VK_SAMPLER_YCBCR_RANGE_BEGIN_RANGE = VK_SAMPLER_YCBCR_RANGE_ITU_FULL, + VK_SAMPLER_YCBCR_RANGE_END_RANGE = VK_SAMPLER_YCBCR_RANGE_ITU_NARROW, + VK_SAMPLER_YCBCR_RANGE_RANGE_SIZE = (VK_SAMPLER_YCBCR_RANGE_ITU_NARROW - VK_SAMPLER_YCBCR_RANGE_ITU_FULL + 1), + VK_SAMPLER_YCBCR_RANGE_MAX_ENUM = 0x7FFFFFFF +} VkSamplerYcbcrRange; + +typedef enum VkChromaLocation { + VK_CHROMA_LOCATION_COSITED_EVEN = 0, + VK_CHROMA_LOCATION_MIDPOINT = 1, + VK_CHROMA_LOCATION_COSITED_EVEN_KHR = VK_CHROMA_LOCATION_COSITED_EVEN, + VK_CHROMA_LOCATION_MIDPOINT_KHR = VK_CHROMA_LOCATION_MIDPOINT, + VK_CHROMA_LOCATION_BEGIN_RANGE = VK_CHROMA_LOCATION_COSITED_EVEN, + VK_CHROMA_LOCATION_END_RANGE = VK_CHROMA_LOCATION_MIDPOINT, + VK_CHROMA_LOCATION_RANGE_SIZE = (VK_CHROMA_LOCATION_MIDPOINT - VK_CHROMA_LOCATION_COSITED_EVEN + 1), + VK_CHROMA_LOCATION_MAX_ENUM = 0x7FFFFFFF +} VkChromaLocation; + +typedef enum VkDescriptorUpdateTemplateType { + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET = 0, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR = 1, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_BEGIN_RANGE = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_END_RANGE = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_RANGE_SIZE = (VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET + 1), + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkDescriptorUpdateTemplateType; + + +typedef enum VkSubgroupFeatureFlagBits { + VK_SUBGROUP_FEATURE_BASIC_BIT = 0x00000001, + VK_SUBGROUP_FEATURE_VOTE_BIT = 0x00000002, + VK_SUBGROUP_FEATURE_ARITHMETIC_BIT = 0x00000004, + VK_SUBGROUP_FEATURE_BALLOT_BIT = 0x00000008, + VK_SUBGROUP_FEATURE_SHUFFLE_BIT = 0x00000010, + VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT = 0x00000020, + VK_SUBGROUP_FEATURE_CLUSTERED_BIT = 0x00000040, + VK_SUBGROUP_FEATURE_QUAD_BIT = 0x00000080, + VK_SUBGROUP_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkSubgroupFeatureFlagBits; +typedef VkFlags VkSubgroupFeatureFlags; + +typedef enum VkPeerMemoryFeatureFlagBits { + VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT = 0x00000001, + VK_PEER_MEMORY_FEATURE_COPY_DST_BIT = 0x00000002, + VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT = 0x00000004, + VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT = 0x00000008, + VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT_KHR = VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT, + VK_PEER_MEMORY_FEATURE_COPY_DST_BIT_KHR = VK_PEER_MEMORY_FEATURE_COPY_DST_BIT, + VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT_KHR = VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT, + VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT_KHR = VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT, + VK_PEER_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkPeerMemoryFeatureFlagBits; +typedef VkFlags VkPeerMemoryFeatureFlags; + +typedef enum VkMemoryAllocateFlagBits { + VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT = 0x00000001, + VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT_KHR = VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT, + VK_MEMORY_ALLOCATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkMemoryAllocateFlagBits; +typedef VkFlags VkMemoryAllocateFlags; +typedef VkFlags VkCommandPoolTrimFlags; +typedef VkFlags VkDescriptorUpdateTemplateCreateFlags; + +typedef enum VkExternalMemoryHandleTypeFlagBits { + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT = 0x00000001, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT = 0x00000002, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 0x00000004, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT = 0x00000008, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT = 0x00000010, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT = 0x00000020, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT = 0x00000040, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT = 0x00000200, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT = 0x00000080, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT = 0x00000100, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkExternalMemoryHandleTypeFlagBits; +typedef VkFlags VkExternalMemoryHandleTypeFlags; + +typedef enum VkExternalMemoryFeatureFlagBits { + VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT = 0x00000001, + VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT = 0x00000002, + VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT = 0x00000004, + VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT, + VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT, + VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT, + VK_EXTERNAL_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkExternalMemoryFeatureFlagBits; +typedef VkFlags VkExternalMemoryFeatureFlags; + +typedef enum VkExternalFenceHandleTypeFlagBits { + VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT = 0x00000001, + VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT = 0x00000002, + VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 0x00000004, + VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT = 0x00000008, + VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT, + VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT, + VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, + VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT_KHR = VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT, + VK_EXTERNAL_FENCE_HANDLE_TYPE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkExternalFenceHandleTypeFlagBits; +typedef VkFlags VkExternalFenceHandleTypeFlags; + +typedef enum VkExternalFenceFeatureFlagBits { + VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT = 0x00000001, + VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT = 0x00000002, + VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT_KHR = VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT, + VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT_KHR = VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT, + VK_EXTERNAL_FENCE_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkExternalFenceFeatureFlagBits; +typedef VkFlags VkExternalFenceFeatureFlags; + +typedef enum VkFenceImportFlagBits { + VK_FENCE_IMPORT_TEMPORARY_BIT = 0x00000001, + VK_FENCE_IMPORT_TEMPORARY_BIT_KHR = VK_FENCE_IMPORT_TEMPORARY_BIT, + VK_FENCE_IMPORT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkFenceImportFlagBits; +typedef VkFlags VkFenceImportFlags; + +typedef enum VkSemaphoreImportFlagBits { + VK_SEMAPHORE_IMPORT_TEMPORARY_BIT = 0x00000001, + VK_SEMAPHORE_IMPORT_TEMPORARY_BIT_KHR = VK_SEMAPHORE_IMPORT_TEMPORARY_BIT, + VK_SEMAPHORE_IMPORT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkSemaphoreImportFlagBits; +typedef VkFlags VkSemaphoreImportFlags; + +typedef enum VkExternalSemaphoreHandleTypeFlagBits { + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT = 0x00000001, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT = 0x00000002, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 0x00000004, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT = 0x00000008, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT = 0x00000010, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkExternalSemaphoreHandleTypeFlagBits; +typedef VkFlags VkExternalSemaphoreHandleTypeFlags; + +typedef enum VkExternalSemaphoreFeatureFlagBits { + VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT = 0x00000001, + VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT = 0x00000002, + VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT_KHR = VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT, + VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT_KHR = VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT, + VK_EXTERNAL_SEMAPHORE_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkExternalSemaphoreFeatureFlagBits; +typedef VkFlags VkExternalSemaphoreFeatureFlags; + +typedef struct VkPhysicalDeviceSubgroupProperties { + VkStructureType sType; + void* pNext; + uint32_t subgroupSize; + VkShaderStageFlags supportedStages; + VkSubgroupFeatureFlags supportedOperations; + VkBool32 quadOperationsInAllStages; +} VkPhysicalDeviceSubgroupProperties; + +typedef struct VkBindBufferMemoryInfo { + VkStructureType sType; + const void* pNext; + VkBuffer buffer; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; +} VkBindBufferMemoryInfo; + +typedef struct VkBindImageMemoryInfo { + VkStructureType sType; + const void* pNext; + VkImage image; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; +} VkBindImageMemoryInfo; + +typedef struct VkPhysicalDevice16BitStorageFeatures { + VkStructureType sType; + void* pNext; + VkBool32 storageBuffer16BitAccess; + VkBool32 uniformAndStorageBuffer16BitAccess; + VkBool32 storagePushConstant16; + VkBool32 storageInputOutput16; +} VkPhysicalDevice16BitStorageFeatures; + +typedef struct VkMemoryDedicatedRequirements { + VkStructureType sType; + void* pNext; + VkBool32 prefersDedicatedAllocation; + VkBool32 requiresDedicatedAllocation; +} VkMemoryDedicatedRequirements; + +typedef struct VkMemoryDedicatedAllocateInfo { + VkStructureType sType; + const void* pNext; + VkImage image; + VkBuffer buffer; +} VkMemoryDedicatedAllocateInfo; + +typedef struct VkMemoryAllocateFlagsInfo { + VkStructureType sType; + const void* pNext; + VkMemoryAllocateFlags flags; + uint32_t deviceMask; +} VkMemoryAllocateFlagsInfo; + +typedef struct VkDeviceGroupRenderPassBeginInfo { + VkStructureType sType; + const void* pNext; + uint32_t deviceMask; + uint32_t deviceRenderAreaCount; + const VkRect2D* pDeviceRenderAreas; +} VkDeviceGroupRenderPassBeginInfo; + +typedef struct VkDeviceGroupCommandBufferBeginInfo { + VkStructureType sType; + const void* pNext; + uint32_t deviceMask; +} VkDeviceGroupCommandBufferBeginInfo; + +typedef struct VkDeviceGroupSubmitInfo { + VkStructureType sType; + const void* pNext; + uint32_t waitSemaphoreCount; + const uint32_t* pWaitSemaphoreDeviceIndices; + uint32_t commandBufferCount; + const uint32_t* pCommandBufferDeviceMasks; + uint32_t signalSemaphoreCount; + const uint32_t* pSignalSemaphoreDeviceIndices; +} VkDeviceGroupSubmitInfo; + +typedef struct VkDeviceGroupBindSparseInfo { + VkStructureType sType; + const void* pNext; + uint32_t resourceDeviceIndex; + uint32_t memoryDeviceIndex; +} VkDeviceGroupBindSparseInfo; + +typedef struct VkBindBufferMemoryDeviceGroupInfo { + VkStructureType sType; + const void* pNext; + uint32_t deviceIndexCount; + const uint32_t* pDeviceIndices; +} VkBindBufferMemoryDeviceGroupInfo; + +typedef struct VkBindImageMemoryDeviceGroupInfo { + VkStructureType sType; + const void* pNext; + uint32_t deviceIndexCount; + const uint32_t* pDeviceIndices; + uint32_t splitInstanceBindRegionCount; + const VkRect2D* pSplitInstanceBindRegions; +} VkBindImageMemoryDeviceGroupInfo; + +typedef struct VkPhysicalDeviceGroupProperties { + VkStructureType sType; + void* pNext; + uint32_t physicalDeviceCount; + VkPhysicalDevice physicalDevices[VK_MAX_DEVICE_GROUP_SIZE]; + VkBool32 subsetAllocation; +} VkPhysicalDeviceGroupProperties; + +typedef struct VkDeviceGroupDeviceCreateInfo { + VkStructureType sType; + const void* pNext; + uint32_t physicalDeviceCount; + const VkPhysicalDevice* pPhysicalDevices; +} VkDeviceGroupDeviceCreateInfo; + +typedef struct VkBufferMemoryRequirementsInfo2 { + VkStructureType sType; + const void* pNext; + VkBuffer buffer; +} VkBufferMemoryRequirementsInfo2; + +typedef struct VkImageMemoryRequirementsInfo2 { + VkStructureType sType; + const void* pNext; + VkImage image; +} VkImageMemoryRequirementsInfo2; + +typedef struct VkImageSparseMemoryRequirementsInfo2 { + VkStructureType sType; + const void* pNext; + VkImage image; +} VkImageSparseMemoryRequirementsInfo2; + +typedef struct VkMemoryRequirements2 { + VkStructureType sType; + void* pNext; + VkMemoryRequirements memoryRequirements; +} VkMemoryRequirements2; + +typedef struct VkSparseImageMemoryRequirements2 { + VkStructureType sType; + void* pNext; + VkSparseImageMemoryRequirements memoryRequirements; +} VkSparseImageMemoryRequirements2; + +typedef struct VkPhysicalDeviceFeatures2 { + VkStructureType sType; + void* pNext; + VkPhysicalDeviceFeatures features; +} VkPhysicalDeviceFeatures2; + +typedef struct VkPhysicalDeviceProperties2 { + VkStructureType sType; + void* pNext; + VkPhysicalDeviceProperties properties; +} VkPhysicalDeviceProperties2; + +typedef struct VkFormatProperties2 { + VkStructureType sType; + void* pNext; + VkFormatProperties formatProperties; +} VkFormatProperties2; + +typedef struct VkImageFormatProperties2 { + VkStructureType sType; + void* pNext; + VkImageFormatProperties imageFormatProperties; +} VkImageFormatProperties2; + +typedef struct VkPhysicalDeviceImageFormatInfo2 { + VkStructureType sType; + const void* pNext; + VkFormat format; + VkImageType type; + VkImageTiling tiling; + VkImageUsageFlags usage; + VkImageCreateFlags flags; +} VkPhysicalDeviceImageFormatInfo2; + +typedef struct VkQueueFamilyProperties2 { + VkStructureType sType; + void* pNext; + VkQueueFamilyProperties queueFamilyProperties; +} VkQueueFamilyProperties2; + +typedef struct VkPhysicalDeviceMemoryProperties2 { + VkStructureType sType; + void* pNext; + VkPhysicalDeviceMemoryProperties memoryProperties; +} VkPhysicalDeviceMemoryProperties2; + +typedef struct VkSparseImageFormatProperties2 { + VkStructureType sType; + void* pNext; + VkSparseImageFormatProperties properties; +} VkSparseImageFormatProperties2; + +typedef struct VkPhysicalDeviceSparseImageFormatInfo2 { + VkStructureType sType; + const void* pNext; + VkFormat format; + VkImageType type; + VkSampleCountFlagBits samples; + VkImageUsageFlags usage; + VkImageTiling tiling; +} VkPhysicalDeviceSparseImageFormatInfo2; + +typedef struct VkPhysicalDevicePointClippingProperties { + VkStructureType sType; + void* pNext; + VkPointClippingBehavior pointClippingBehavior; +} VkPhysicalDevicePointClippingProperties; + +typedef struct VkInputAttachmentAspectReference { + uint32_t subpass; + uint32_t inputAttachmentIndex; + VkImageAspectFlags aspectMask; +} VkInputAttachmentAspectReference; + +typedef struct VkRenderPassInputAttachmentAspectCreateInfo { + VkStructureType sType; + const void* pNext; + uint32_t aspectReferenceCount; + const VkInputAttachmentAspectReference* pAspectReferences; +} VkRenderPassInputAttachmentAspectCreateInfo; + +typedef struct VkImageViewUsageCreateInfo { + VkStructureType sType; + const void* pNext; + VkImageUsageFlags usage; +} VkImageViewUsageCreateInfo; + +typedef struct VkPipelineTessellationDomainOriginStateCreateInfo { + VkStructureType sType; + const void* pNext; + VkTessellationDomainOrigin domainOrigin; +} VkPipelineTessellationDomainOriginStateCreateInfo; + +typedef struct VkRenderPassMultiviewCreateInfo { + VkStructureType sType; + const void* pNext; + uint32_t subpassCount; + const uint32_t* pViewMasks; + uint32_t dependencyCount; + const int32_t* pViewOffsets; + uint32_t correlationMaskCount; + const uint32_t* pCorrelationMasks; +} VkRenderPassMultiviewCreateInfo; + +typedef struct VkPhysicalDeviceMultiviewFeatures { + VkStructureType sType; + void* pNext; + VkBool32 multiview; + VkBool32 multiviewGeometryShader; + VkBool32 multiviewTessellationShader; +} VkPhysicalDeviceMultiviewFeatures; + +typedef struct VkPhysicalDeviceMultiviewProperties { + VkStructureType sType; + void* pNext; + uint32_t maxMultiviewViewCount; + uint32_t maxMultiviewInstanceIndex; +} VkPhysicalDeviceMultiviewProperties; + +typedef struct VkPhysicalDeviceVariablePointerFeatures { + VkStructureType sType; + void* pNext; + VkBool32 variablePointersStorageBuffer; + VkBool32 variablePointers; +} VkPhysicalDeviceVariablePointerFeatures; + +typedef struct VkPhysicalDeviceProtectedMemoryFeatures { + VkStructureType sType; + void* pNext; + VkBool32 protectedMemory; +} VkPhysicalDeviceProtectedMemoryFeatures; + +typedef struct VkPhysicalDeviceProtectedMemoryProperties { + VkStructureType sType; + void* pNext; + VkBool32 protectedNoFault; +} VkPhysicalDeviceProtectedMemoryProperties; + +typedef struct VkDeviceQueueInfo2 { + VkStructureType sType; + const void* pNext; + VkDeviceQueueCreateFlags flags; + uint32_t queueFamilyIndex; + uint32_t queueIndex; +} VkDeviceQueueInfo2; + +typedef struct VkProtectedSubmitInfo { + VkStructureType sType; + const void* pNext; + VkBool32 protectedSubmit; +} VkProtectedSubmitInfo; + +typedef struct VkSamplerYcbcrConversionCreateInfo { + VkStructureType sType; + const void* pNext; + VkFormat format; + VkSamplerYcbcrModelConversion ycbcrModel; + VkSamplerYcbcrRange ycbcrRange; + VkComponentMapping components; + VkChromaLocation xChromaOffset; + VkChromaLocation yChromaOffset; + VkFilter chromaFilter; + VkBool32 forceExplicitReconstruction; +} VkSamplerYcbcrConversionCreateInfo; + +typedef struct VkSamplerYcbcrConversionInfo { + VkStructureType sType; + const void* pNext; + VkSamplerYcbcrConversion conversion; +} VkSamplerYcbcrConversionInfo; + +typedef struct VkBindImagePlaneMemoryInfo { + VkStructureType sType; + const void* pNext; + VkImageAspectFlagBits planeAspect; +} VkBindImagePlaneMemoryInfo; + +typedef struct VkImagePlaneMemoryRequirementsInfo { + VkStructureType sType; + const void* pNext; + VkImageAspectFlagBits planeAspect; +} VkImagePlaneMemoryRequirementsInfo; + +typedef struct VkPhysicalDeviceSamplerYcbcrConversionFeatures { + VkStructureType sType; + void* pNext; + VkBool32 samplerYcbcrConversion; +} VkPhysicalDeviceSamplerYcbcrConversionFeatures; + +typedef struct VkSamplerYcbcrConversionImageFormatProperties { + VkStructureType sType; + void* pNext; + uint32_t combinedImageSamplerDescriptorCount; +} VkSamplerYcbcrConversionImageFormatProperties; + +typedef struct VkDescriptorUpdateTemplateEntry { + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; + VkDescriptorType descriptorType; + size_t offset; + size_t stride; +} VkDescriptorUpdateTemplateEntry; + +typedef struct VkDescriptorUpdateTemplateCreateInfo { + VkStructureType sType; + void* pNext; + VkDescriptorUpdateTemplateCreateFlags flags; + uint32_t descriptorUpdateEntryCount; + const VkDescriptorUpdateTemplateEntry* pDescriptorUpdateEntries; + VkDescriptorUpdateTemplateType templateType; + VkDescriptorSetLayout descriptorSetLayout; + VkPipelineBindPoint pipelineBindPoint; + VkPipelineLayout pipelineLayout; + uint32_t set; +} VkDescriptorUpdateTemplateCreateInfo; + +typedef struct VkExternalMemoryProperties { + VkExternalMemoryFeatureFlags externalMemoryFeatures; + VkExternalMemoryHandleTypeFlags exportFromImportedHandleTypes; + VkExternalMemoryHandleTypeFlags compatibleHandleTypes; +} VkExternalMemoryProperties; + +typedef struct VkPhysicalDeviceExternalImageFormatInfo { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagBits handleType; +} VkPhysicalDeviceExternalImageFormatInfo; + +typedef struct VkExternalImageFormatProperties { + VkStructureType sType; + void* pNext; + VkExternalMemoryProperties externalMemoryProperties; +} VkExternalImageFormatProperties; + +typedef struct VkPhysicalDeviceExternalBufferInfo { + VkStructureType sType; + const void* pNext; + VkBufferCreateFlags flags; + VkBufferUsageFlags usage; + VkExternalMemoryHandleTypeFlagBits handleType; +} VkPhysicalDeviceExternalBufferInfo; + +typedef struct VkExternalBufferProperties { + VkStructureType sType; + void* pNext; + VkExternalMemoryProperties externalMemoryProperties; +} VkExternalBufferProperties; + +typedef struct VkPhysicalDeviceIDProperties { + VkStructureType sType; + void* pNext; + uint8_t deviceUUID[VK_UUID_SIZE]; + uint8_t driverUUID[VK_UUID_SIZE]; + uint8_t deviceLUID[VK_LUID_SIZE]; + uint32_t deviceNodeMask; + VkBool32 deviceLUIDValid; +} VkPhysicalDeviceIDProperties; + +typedef struct VkExternalMemoryImageCreateInfo { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlags handleTypes; +} VkExternalMemoryImageCreateInfo; + +typedef struct VkExternalMemoryBufferCreateInfo { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlags handleTypes; +} VkExternalMemoryBufferCreateInfo; + +typedef struct VkExportMemoryAllocateInfo { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlags handleTypes; +} VkExportMemoryAllocateInfo; + +typedef struct VkPhysicalDeviceExternalFenceInfo { + VkStructureType sType; + const void* pNext; + VkExternalFenceHandleTypeFlagBits handleType; +} VkPhysicalDeviceExternalFenceInfo; + +typedef struct VkExternalFenceProperties { + VkStructureType sType; + void* pNext; + VkExternalFenceHandleTypeFlags exportFromImportedHandleTypes; + VkExternalFenceHandleTypeFlags compatibleHandleTypes; + VkExternalFenceFeatureFlags externalFenceFeatures; +} VkExternalFenceProperties; + +typedef struct VkExportFenceCreateInfo { + VkStructureType sType; + const void* pNext; + VkExternalFenceHandleTypeFlags handleTypes; +} VkExportFenceCreateInfo; + +typedef struct VkExportSemaphoreCreateInfo { + VkStructureType sType; + const void* pNext; + VkExternalSemaphoreHandleTypeFlags handleTypes; +} VkExportSemaphoreCreateInfo; + +typedef struct VkPhysicalDeviceExternalSemaphoreInfo { + VkStructureType sType; + const void* pNext; + VkExternalSemaphoreHandleTypeFlagBits handleType; +} VkPhysicalDeviceExternalSemaphoreInfo; + +typedef struct VkExternalSemaphoreProperties { + VkStructureType sType; + void* pNext; + VkExternalSemaphoreHandleTypeFlags exportFromImportedHandleTypes; + VkExternalSemaphoreHandleTypeFlags compatibleHandleTypes; + VkExternalSemaphoreFeatureFlags externalSemaphoreFeatures; +} VkExternalSemaphoreProperties; + +typedef struct VkPhysicalDeviceMaintenance3Properties { + VkStructureType sType; + void* pNext; + uint32_t maxPerSetDescriptors; + VkDeviceSize maxMemoryAllocationSize; +} VkPhysicalDeviceMaintenance3Properties; + +typedef struct VkDescriptorSetLayoutSupport { + VkStructureType sType; + void* pNext; + VkBool32 supported; +} VkDescriptorSetLayoutSupport; + +typedef struct VkPhysicalDeviceShaderDrawParameterFeatures { + VkStructureType sType; + void* pNext; + VkBool32 shaderDrawParameters; +} VkPhysicalDeviceShaderDrawParameterFeatures; + + +typedef VkResult (VKAPI_PTR *PFN_vkEnumerateInstanceVersion)(uint32_t* pApiVersion); +typedef VkResult (VKAPI_PTR *PFN_vkBindBufferMemory2)(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos); +typedef VkResult (VKAPI_PTR *PFN_vkBindImageMemory2)(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos); +typedef void (VKAPI_PTR *PFN_vkGetDeviceGroupPeerMemoryFeatures)(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures); +typedef void (VKAPI_PTR *PFN_vkCmdSetDeviceMask)(VkCommandBuffer commandBuffer, uint32_t deviceMask); +typedef void (VKAPI_PTR *PFN_vkCmdDispatchBase)(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); +typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDeviceGroups)(VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties); +typedef void (VKAPI_PTR *PFN_vkGetImageMemoryRequirements2)(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements); +typedef void (VKAPI_PTR *PFN_vkGetBufferMemoryRequirements2)(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements); +typedef void (VKAPI_PTR *PFN_vkGetImageSparseMemoryRequirements2)(VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFeatures2)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceProperties2)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFormatProperties2)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2* pFormatProperties); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties2)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties2)(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMemoryProperties2)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties2)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties); +typedef void (VKAPI_PTR *PFN_vkTrimCommandPool)(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags); +typedef void (VKAPI_PTR *PFN_vkGetDeviceQueue2)(VkDevice device, const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue); +typedef VkResult (VKAPI_PTR *PFN_vkCreateSamplerYcbcrConversion)(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion); +typedef void (VKAPI_PTR *PFN_vkDestroySamplerYcbcrConversion)(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorUpdateTemplate)(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate); +typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorUpdateTemplate)(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkUpdateDescriptorSetWithTemplate)(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalBufferProperties)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalFenceProperties)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalSemaphoreProperties)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties); +typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetLayoutSupport)(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceVersion( + uint32_t* pApiVersion); + +VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory2( + VkDevice device, + uint32_t bindInfoCount, + const VkBindBufferMemoryInfo* pBindInfos); + +VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory2( + VkDevice device, + uint32_t bindInfoCount, + const VkBindImageMemoryInfo* pBindInfos); + +VKAPI_ATTR void VKAPI_CALL vkGetDeviceGroupPeerMemoryFeatures( + VkDevice device, + uint32_t heapIndex, + uint32_t localDeviceIndex, + uint32_t remoteDeviceIndex, + VkPeerMemoryFeatureFlags* pPeerMemoryFeatures); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetDeviceMask( + VkCommandBuffer commandBuffer, + uint32_t deviceMask); + +VKAPI_ATTR void VKAPI_CALL vkCmdDispatchBase( + VkCommandBuffer commandBuffer, + uint32_t baseGroupX, + uint32_t baseGroupY, + uint32_t baseGroupZ, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ); + +VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDeviceGroups( + VkInstance instance, + uint32_t* pPhysicalDeviceGroupCount, + VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements2( + VkDevice device, + const VkImageMemoryRequirementsInfo2* pInfo, + VkMemoryRequirements2* pMemoryRequirements); + +VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements2( + VkDevice device, + const VkBufferMemoryRequirementsInfo2* pInfo, + VkMemoryRequirements2* pMemoryRequirements); + +VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements2( + VkDevice device, + const VkImageSparseMemoryRequirementsInfo2* pInfo, + uint32_t* pSparseMemoryRequirementCount, + VkSparseImageMemoryRequirements2* pSparseMemoryRequirements); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures2( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceFeatures2* pFeatures); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties2( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceProperties2* pProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties2( + VkPhysicalDevice physicalDevice, + VkFormat format, + VkFormatProperties2* pFormatProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties2( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, + VkImageFormatProperties2* pImageFormatProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties2( + VkPhysicalDevice physicalDevice, + uint32_t* pQueueFamilyPropertyCount, + VkQueueFamilyProperties2* pQueueFamilyProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties2( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceMemoryProperties2* pMemoryProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, + uint32_t* pPropertyCount, + VkSparseImageFormatProperties2* pProperties); + +VKAPI_ATTR void VKAPI_CALL vkTrimCommandPool( + VkDevice device, + VkCommandPool commandPool, + VkCommandPoolTrimFlags flags); + +VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue2( + VkDevice device, + const VkDeviceQueueInfo2* pQueueInfo, + VkQueue* pQueue); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateSamplerYcbcrConversion( + VkDevice device, + const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSamplerYcbcrConversion* pYcbcrConversion); + +VKAPI_ATTR void VKAPI_CALL vkDestroySamplerYcbcrConversion( + VkDevice device, + VkSamplerYcbcrConversion ycbcrConversion, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplate( + VkDevice device, + const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate); + +VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorUpdateTemplate( + VkDevice device, + VkDescriptorUpdateTemplate descriptorUpdateTemplate, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSetWithTemplate( + VkDevice device, + VkDescriptorSet descriptorSet, + VkDescriptorUpdateTemplate descriptorUpdateTemplate, + const void* pData); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalBufferProperties( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, + VkExternalBufferProperties* pExternalBufferProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalFenceProperties( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, + VkExternalFenceProperties* pExternalFenceProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphoreProperties( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, + VkExternalSemaphoreProperties* pExternalSemaphoreProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetDescriptorSetLayoutSupport( + VkDevice device, + const VkDescriptorSetLayoutCreateInfo* pCreateInfo, + VkDescriptorSetLayoutSupport* pSupport); +#endif + +#define VK_KHR_surface 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) + +#define VK_KHR_SURFACE_SPEC_VERSION 25 +#define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface" +#define VK_COLORSPACE_SRGB_NONLINEAR_KHR VK_COLOR_SPACE_SRGB_NONLINEAR_KHR + + +typedef enum VkColorSpaceKHR { + VK_COLOR_SPACE_SRGB_NONLINEAR_KHR = 0, + VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT = 1000104001, + VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT = 1000104002, + VK_COLOR_SPACE_DCI_P3_LINEAR_EXT = 1000104003, + VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT = 1000104004, + VK_COLOR_SPACE_BT709_LINEAR_EXT = 1000104005, + VK_COLOR_SPACE_BT709_NONLINEAR_EXT = 1000104006, + VK_COLOR_SPACE_BT2020_LINEAR_EXT = 1000104007, + VK_COLOR_SPACE_HDR10_ST2084_EXT = 1000104008, + VK_COLOR_SPACE_DOLBYVISION_EXT = 1000104009, + VK_COLOR_SPACE_HDR10_HLG_EXT = 1000104010, + VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT = 1000104011, + VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT = 1000104012, + VK_COLOR_SPACE_PASS_THROUGH_EXT = 1000104013, + VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT = 1000104014, + VK_COLOR_SPACE_BEGIN_RANGE_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, + VK_COLOR_SPACE_END_RANGE_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, + VK_COLOR_SPACE_RANGE_SIZE_KHR = (VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - VK_COLOR_SPACE_SRGB_NONLINEAR_KHR + 1), + VK_COLOR_SPACE_MAX_ENUM_KHR = 0x7FFFFFFF +} VkColorSpaceKHR; + +typedef enum VkPresentModeKHR { + VK_PRESENT_MODE_IMMEDIATE_KHR = 0, + VK_PRESENT_MODE_MAILBOX_KHR = 1, + VK_PRESENT_MODE_FIFO_KHR = 2, + VK_PRESENT_MODE_FIFO_RELAXED_KHR = 3, + VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR = 1000111000, + VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR = 1000111001, + VK_PRESENT_MODE_BEGIN_RANGE_KHR = VK_PRESENT_MODE_IMMEDIATE_KHR, + VK_PRESENT_MODE_END_RANGE_KHR = VK_PRESENT_MODE_FIFO_RELAXED_KHR, + VK_PRESENT_MODE_RANGE_SIZE_KHR = (VK_PRESENT_MODE_FIFO_RELAXED_KHR - VK_PRESENT_MODE_IMMEDIATE_KHR + 1), + VK_PRESENT_MODE_MAX_ENUM_KHR = 0x7FFFFFFF +} VkPresentModeKHR; + + +typedef enum VkSurfaceTransformFlagBitsKHR { + VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001, + VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002, + VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004, + VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080, + VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100, + VK_SURFACE_TRANSFORM_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkSurfaceTransformFlagBitsKHR; +typedef VkFlags VkSurfaceTransformFlagsKHR; + +typedef enum VkCompositeAlphaFlagBitsKHR { + VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001, + VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002, + VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004, + VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008, + VK_COMPOSITE_ALPHA_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkCompositeAlphaFlagBitsKHR; +typedef VkFlags VkCompositeAlphaFlagsKHR; + +typedef struct VkSurfaceCapabilitiesKHR { + uint32_t minImageCount; + uint32_t maxImageCount; + VkExtent2D currentExtent; + VkExtent2D minImageExtent; + VkExtent2D maxImageExtent; + uint32_t maxImageArrayLayers; + VkSurfaceTransformFlagsKHR supportedTransforms; + VkSurfaceTransformFlagBitsKHR currentTransform; + VkCompositeAlphaFlagsKHR supportedCompositeAlpha; + VkImageUsageFlags supportedUsageFlags; +} VkSurfaceCapabilitiesKHR; + +typedef struct VkSurfaceFormatKHR { + VkFormat format; + VkColorSpaceKHR colorSpace; +} VkSurfaceFormatKHR; + + +typedef void (VKAPI_PTR *PFN_vkDestroySurfaceKHR)(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkDestroySurfaceKHR( + VkInstance instance, + VkSurfaceKHR surface, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceSupportKHR( + VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + VkSurfaceKHR surface, + VkBool32* pSupported); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilitiesKHR( + VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + VkSurfaceCapabilitiesKHR* pSurfaceCapabilities); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormatsKHR( + VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + uint32_t* pSurfaceFormatCount, + VkSurfaceFormatKHR* pSurfaceFormats); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModesKHR( + VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + uint32_t* pPresentModeCount, + VkPresentModeKHR* pPresentModes); +#endif + +#define VK_KHR_swapchain 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) + +#define VK_KHR_SWAPCHAIN_SPEC_VERSION 70 +#define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain" + + +typedef enum VkSwapchainCreateFlagBitsKHR { + VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = 0x00000001, + VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR = 0x00000002, + VK_SWAPCHAIN_CREATE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkSwapchainCreateFlagBitsKHR; +typedef VkFlags VkSwapchainCreateFlagsKHR; + +typedef enum VkDeviceGroupPresentModeFlagBitsKHR { + VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR = 0x00000001, + VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR = 0x00000002, + VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR = 0x00000004, + VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR = 0x00000008, + VK_DEVICE_GROUP_PRESENT_MODE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkDeviceGroupPresentModeFlagBitsKHR; +typedef VkFlags VkDeviceGroupPresentModeFlagsKHR; + +typedef struct VkSwapchainCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkSwapchainCreateFlagsKHR flags; + VkSurfaceKHR surface; + uint32_t minImageCount; + VkFormat imageFormat; + VkColorSpaceKHR imageColorSpace; + VkExtent2D imageExtent; + uint32_t imageArrayLayers; + VkImageUsageFlags imageUsage; + VkSharingMode imageSharingMode; + uint32_t queueFamilyIndexCount; + const uint32_t* pQueueFamilyIndices; + VkSurfaceTransformFlagBitsKHR preTransform; + VkCompositeAlphaFlagBitsKHR compositeAlpha; + VkPresentModeKHR presentMode; + VkBool32 clipped; + VkSwapchainKHR oldSwapchain; +} VkSwapchainCreateInfoKHR; + +typedef struct VkPresentInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t waitSemaphoreCount; + const VkSemaphore* pWaitSemaphores; + uint32_t swapchainCount; + const VkSwapchainKHR* pSwapchains; + const uint32_t* pImageIndices; + VkResult* pResults; +} VkPresentInfoKHR; + +typedef struct VkImageSwapchainCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkSwapchainKHR swapchain; +} VkImageSwapchainCreateInfoKHR; + +typedef struct VkBindImageMemorySwapchainInfoKHR { + VkStructureType sType; + const void* pNext; + VkSwapchainKHR swapchain; + uint32_t imageIndex; +} VkBindImageMemorySwapchainInfoKHR; + +typedef struct VkAcquireNextImageInfoKHR { + VkStructureType sType; + const void* pNext; + VkSwapchainKHR swapchain; + uint64_t timeout; + VkSemaphore semaphore; + VkFence fence; + uint32_t deviceMask; +} VkAcquireNextImageInfoKHR; + +typedef struct VkDeviceGroupPresentCapabilitiesKHR { + VkStructureType sType; + const void* pNext; + uint32_t presentMask[VK_MAX_DEVICE_GROUP_SIZE]; + VkDeviceGroupPresentModeFlagsKHR modes; +} VkDeviceGroupPresentCapabilitiesKHR; + +typedef struct VkDeviceGroupPresentInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t swapchainCount; + const uint32_t* pDeviceMasks; + VkDeviceGroupPresentModeFlagBitsKHR mode; +} VkDeviceGroupPresentInfoKHR; + +typedef struct VkDeviceGroupSwapchainCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkDeviceGroupPresentModeFlagsKHR modes; +} VkDeviceGroupSwapchainCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateSwapchainKHR)(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain); +typedef void (VKAPI_PTR *PFN_vkDestroySwapchainKHR)(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainImagesKHR)(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages); +typedef VkResult (VKAPI_PTR *PFN_vkAcquireNextImageKHR)(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex); +typedef VkResult (VKAPI_PTR *PFN_vkQueuePresentKHR)(VkQueue queue, const VkPresentInfoKHR* pPresentInfo); +typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupPresentCapabilitiesKHR)(VkDevice device, VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities); +typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupSurfacePresentModesKHR)(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR* pModes); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDevicePresentRectanglesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pRectCount, VkRect2D* pRects); +typedef VkResult (VKAPI_PTR *PFN_vkAcquireNextImage2KHR)(VkDevice device, const VkAcquireNextImageInfoKHR* pAcquireInfo, uint32_t* pImageIndex); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateSwapchainKHR( + VkDevice device, + const VkSwapchainCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSwapchainKHR* pSwapchain); + +VKAPI_ATTR void VKAPI_CALL vkDestroySwapchainKHR( + VkDevice device, + VkSwapchainKHR swapchain, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainImagesKHR( + VkDevice device, + VkSwapchainKHR swapchain, + uint32_t* pSwapchainImageCount, + VkImage* pSwapchainImages); + +VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImageKHR( + VkDevice device, + VkSwapchainKHR swapchain, + uint64_t timeout, + VkSemaphore semaphore, + VkFence fence, + uint32_t* pImageIndex); + +VKAPI_ATTR VkResult VKAPI_CALL vkQueuePresentKHR( + VkQueue queue, + const VkPresentInfoKHR* pPresentInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupPresentCapabilitiesKHR( + VkDevice device, + VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModesKHR( + VkDevice device, + VkSurfaceKHR surface, + VkDeviceGroupPresentModeFlagsKHR* pModes); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDevicePresentRectanglesKHR( + VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + uint32_t* pRectCount, + VkRect2D* pRects); + +VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImage2KHR( + VkDevice device, + const VkAcquireNextImageInfoKHR* pAcquireInfo, + uint32_t* pImageIndex); +#endif + +#define VK_KHR_display 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayKHR) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayModeKHR) + +#define VK_KHR_DISPLAY_SPEC_VERSION 21 +#define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display" + + +typedef enum VkDisplayPlaneAlphaFlagBitsKHR { + VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001, + VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002, + VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004, + VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008, + VK_DISPLAY_PLANE_ALPHA_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkDisplayPlaneAlphaFlagBitsKHR; +typedef VkFlags VkDisplayPlaneAlphaFlagsKHR; +typedef VkFlags VkDisplayModeCreateFlagsKHR; +typedef VkFlags VkDisplaySurfaceCreateFlagsKHR; + +typedef struct VkDisplayPropertiesKHR { + VkDisplayKHR display; + const char* displayName; + VkExtent2D physicalDimensions; + VkExtent2D physicalResolution; + VkSurfaceTransformFlagsKHR supportedTransforms; + VkBool32 planeReorderPossible; + VkBool32 persistentContent; +} VkDisplayPropertiesKHR; + +typedef struct VkDisplayModeParametersKHR { + VkExtent2D visibleRegion; + uint32_t refreshRate; +} VkDisplayModeParametersKHR; + +typedef struct VkDisplayModePropertiesKHR { + VkDisplayModeKHR displayMode; + VkDisplayModeParametersKHR parameters; +} VkDisplayModePropertiesKHR; + +typedef struct VkDisplayModeCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkDisplayModeCreateFlagsKHR flags; + VkDisplayModeParametersKHR parameters; +} VkDisplayModeCreateInfoKHR; + +typedef struct VkDisplayPlaneCapabilitiesKHR { + VkDisplayPlaneAlphaFlagsKHR supportedAlpha; + VkOffset2D minSrcPosition; + VkOffset2D maxSrcPosition; + VkExtent2D minSrcExtent; + VkExtent2D maxSrcExtent; + VkOffset2D minDstPosition; + VkOffset2D maxDstPosition; + VkExtent2D minDstExtent; + VkExtent2D maxDstExtent; +} VkDisplayPlaneCapabilitiesKHR; + +typedef struct VkDisplayPlanePropertiesKHR { + VkDisplayKHR currentDisplay; + uint32_t currentStackIndex; +} VkDisplayPlanePropertiesKHR; + +typedef struct VkDisplaySurfaceCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkDisplaySurfaceCreateFlagsKHR flags; + VkDisplayModeKHR displayMode; + uint32_t planeIndex; + uint32_t planeStackIndex; + VkSurfaceTransformFlagBitsKHR transform; + float globalAlpha; + VkDisplayPlaneAlphaFlagBitsKHR alphaMode; + VkExtent2D imageExtent; +} VkDisplaySurfaceCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceDisplayPropertiesKHR)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPropertiesKHR* pProperties); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPlanePropertiesKHR* pProperties); +typedef VkResult (VKAPI_PTR *PFN_vkGetDisplayPlaneSupportedDisplaysKHR)(VkPhysicalDevice physicalDevice, uint32_t planeIndex, uint32_t* pDisplayCount, VkDisplayKHR* pDisplays); +typedef VkResult (VKAPI_PTR *PFN_vkGetDisplayModePropertiesKHR)(VkPhysicalDevice physicalDevice, VkDisplayKHR display, uint32_t* pPropertyCount, VkDisplayModePropertiesKHR* pProperties); +typedef VkResult (VKAPI_PTR *PFN_vkCreateDisplayModeKHR)(VkPhysicalDevice physicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDisplayModeKHR* pMode); +typedef VkResult (VKAPI_PTR *PFN_vkGetDisplayPlaneCapabilitiesKHR)(VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, uint32_t planeIndex, VkDisplayPlaneCapabilitiesKHR* pCapabilities); +typedef VkResult (VKAPI_PTR *PFN_vkCreateDisplayPlaneSurfaceKHR)(VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceDisplayPropertiesKHR( + VkPhysicalDevice physicalDevice, + uint32_t* pPropertyCount, + VkDisplayPropertiesKHR* pProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceDisplayPlanePropertiesKHR( + VkPhysicalDevice physicalDevice, + uint32_t* pPropertyCount, + VkDisplayPlanePropertiesKHR* pProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayPlaneSupportedDisplaysKHR( + VkPhysicalDevice physicalDevice, + uint32_t planeIndex, + uint32_t* pDisplayCount, + VkDisplayKHR* pDisplays); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayModePropertiesKHR( + VkPhysicalDevice physicalDevice, + VkDisplayKHR display, + uint32_t* pPropertyCount, + VkDisplayModePropertiesKHR* pProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDisplayModeKHR( + VkPhysicalDevice physicalDevice, + VkDisplayKHR display, + const VkDisplayModeCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDisplayModeKHR* pMode); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayPlaneCapabilitiesKHR( + VkPhysicalDevice physicalDevice, + VkDisplayModeKHR mode, + uint32_t planeIndex, + VkDisplayPlaneCapabilitiesKHR* pCapabilities); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDisplayPlaneSurfaceKHR( + VkInstance instance, + const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); +#endif + +#define VK_KHR_display_swapchain 1 +#define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9 +#define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain" + +typedef struct VkDisplayPresentInfoKHR { + VkStructureType sType; + const void* pNext; + VkRect2D srcRect; + VkRect2D dstRect; + VkBool32 persistent; +} VkDisplayPresentInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateSharedSwapchainsKHR)(VkDevice device, uint32_t swapchainCount, const VkSwapchainCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateSharedSwapchainsKHR( + VkDevice device, + uint32_t swapchainCount, + const VkSwapchainCreateInfoKHR* pCreateInfos, + const VkAllocationCallbacks* pAllocator, + VkSwapchainKHR* pSwapchains); +#endif + +#define VK_KHR_sampler_mirror_clamp_to_edge 1 +#define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION 1 +#define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME "VK_KHR_sampler_mirror_clamp_to_edge" + + +#define VK_KHR_multiview 1 +#define VK_KHR_MULTIVIEW_SPEC_VERSION 1 +#define VK_KHR_MULTIVIEW_EXTENSION_NAME "VK_KHR_multiview" + +typedef VkRenderPassMultiviewCreateInfo VkRenderPassMultiviewCreateInfoKHR; + +typedef VkPhysicalDeviceMultiviewFeatures VkPhysicalDeviceMultiviewFeaturesKHR; + +typedef VkPhysicalDeviceMultiviewProperties VkPhysicalDeviceMultiviewPropertiesKHR; + + + +#define VK_KHR_get_physical_device_properties2 1 +#define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION 1 +#define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_physical_device_properties2" + +typedef VkPhysicalDeviceFeatures2 VkPhysicalDeviceFeatures2KHR; + +typedef VkPhysicalDeviceProperties2 VkPhysicalDeviceProperties2KHR; + +typedef VkFormatProperties2 VkFormatProperties2KHR; + +typedef VkImageFormatProperties2 VkImageFormatProperties2KHR; + +typedef VkPhysicalDeviceImageFormatInfo2 VkPhysicalDeviceImageFormatInfo2KHR; + +typedef VkQueueFamilyProperties2 VkQueueFamilyProperties2KHR; + +typedef VkPhysicalDeviceMemoryProperties2 VkPhysicalDeviceMemoryProperties2KHR; + +typedef VkSparseImageFormatProperties2 VkSparseImageFormatProperties2KHR; + +typedef VkPhysicalDeviceSparseImageFormatInfo2 VkPhysicalDeviceSparseImageFormatInfo2KHR; + + +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFeatures2KHR)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceProperties2KHR)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFormatProperties2KHR)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2* pFormatProperties); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR)(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMemoryProperties2KHR)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures2KHR( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceFeatures2* pFeatures); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties2KHR( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceProperties2* pProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties2KHR( + VkPhysicalDevice physicalDevice, + VkFormat format, + VkFormatProperties2* pFormatProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties2KHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, + VkImageFormatProperties2* pImageFormatProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties2KHR( + VkPhysicalDevice physicalDevice, + uint32_t* pQueueFamilyPropertyCount, + VkQueueFamilyProperties2* pQueueFamilyProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties2KHR( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceMemoryProperties2* pMemoryProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2KHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, + uint32_t* pPropertyCount, + VkSparseImageFormatProperties2* pProperties); +#endif + +#define VK_KHR_device_group 1 +#define VK_KHR_DEVICE_GROUP_SPEC_VERSION 3 +#define VK_KHR_DEVICE_GROUP_EXTENSION_NAME "VK_KHR_device_group" + +typedef VkPeerMemoryFeatureFlags VkPeerMemoryFeatureFlagsKHR; + +typedef VkPeerMemoryFeatureFlagBits VkPeerMemoryFeatureFlagBitsKHR; + +typedef VkMemoryAllocateFlags VkMemoryAllocateFlagsKHR; + +typedef VkMemoryAllocateFlagBits VkMemoryAllocateFlagBitsKHR; + + +typedef VkMemoryAllocateFlagsInfo VkMemoryAllocateFlagsInfoKHR; + +typedef VkDeviceGroupRenderPassBeginInfo VkDeviceGroupRenderPassBeginInfoKHR; + +typedef VkDeviceGroupCommandBufferBeginInfo VkDeviceGroupCommandBufferBeginInfoKHR; + +typedef VkDeviceGroupSubmitInfo VkDeviceGroupSubmitInfoKHR; + +typedef VkDeviceGroupBindSparseInfo VkDeviceGroupBindSparseInfoKHR; + +typedef VkBindBufferMemoryDeviceGroupInfo VkBindBufferMemoryDeviceGroupInfoKHR; + +typedef VkBindImageMemoryDeviceGroupInfo VkBindImageMemoryDeviceGroupInfoKHR; + + +typedef void (VKAPI_PTR *PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR)(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures); +typedef void (VKAPI_PTR *PFN_vkCmdSetDeviceMaskKHR)(VkCommandBuffer commandBuffer, uint32_t deviceMask); +typedef void (VKAPI_PTR *PFN_vkCmdDispatchBaseKHR)(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetDeviceGroupPeerMemoryFeaturesKHR( + VkDevice device, + uint32_t heapIndex, + uint32_t localDeviceIndex, + uint32_t remoteDeviceIndex, + VkPeerMemoryFeatureFlags* pPeerMemoryFeatures); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetDeviceMaskKHR( + VkCommandBuffer commandBuffer, + uint32_t deviceMask); + +VKAPI_ATTR void VKAPI_CALL vkCmdDispatchBaseKHR( + VkCommandBuffer commandBuffer, + uint32_t baseGroupX, + uint32_t baseGroupY, + uint32_t baseGroupZ, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ); +#endif + +#define VK_KHR_shader_draw_parameters 1 +#define VK_KHR_SHADER_DRAW_PARAMETERS_SPEC_VERSION 1 +#define VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME "VK_KHR_shader_draw_parameters" + + +#define VK_KHR_maintenance1 1 +#define VK_KHR_MAINTENANCE1_SPEC_VERSION 1 +#define VK_KHR_MAINTENANCE1_EXTENSION_NAME "VK_KHR_maintenance1" + +typedef VkCommandPoolTrimFlags VkCommandPoolTrimFlagsKHR; + + +typedef void (VKAPI_PTR *PFN_vkTrimCommandPoolKHR)(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkTrimCommandPoolKHR( + VkDevice device, + VkCommandPool commandPool, + VkCommandPoolTrimFlags flags); +#endif + +#define VK_KHR_device_group_creation 1 +#define VK_KHR_DEVICE_GROUP_CREATION_SPEC_VERSION 1 +#define VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME "VK_KHR_device_group_creation" +#define VK_MAX_DEVICE_GROUP_SIZE_KHR VK_MAX_DEVICE_GROUP_SIZE + +typedef VkPhysicalDeviceGroupProperties VkPhysicalDeviceGroupPropertiesKHR; + +typedef VkDeviceGroupDeviceCreateInfo VkDeviceGroupDeviceCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDeviceGroupsKHR)(VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDeviceGroupsKHR( + VkInstance instance, + uint32_t* pPhysicalDeviceGroupCount, + VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties); +#endif + +#define VK_KHR_external_memory_capabilities 1 +#define VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1 +#define VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_KHR_external_memory_capabilities" +#define VK_LUID_SIZE_KHR VK_LUID_SIZE + +typedef VkExternalMemoryHandleTypeFlags VkExternalMemoryHandleTypeFlagsKHR; + +typedef VkExternalMemoryHandleTypeFlagBits VkExternalMemoryHandleTypeFlagBitsKHR; + +typedef VkExternalMemoryFeatureFlags VkExternalMemoryFeatureFlagsKHR; + +typedef VkExternalMemoryFeatureFlagBits VkExternalMemoryFeatureFlagBitsKHR; + + +typedef VkExternalMemoryProperties VkExternalMemoryPropertiesKHR; + +typedef VkPhysicalDeviceExternalImageFormatInfo VkPhysicalDeviceExternalImageFormatInfoKHR; + +typedef VkExternalImageFormatProperties VkExternalImageFormatPropertiesKHR; + +typedef VkPhysicalDeviceExternalBufferInfo VkPhysicalDeviceExternalBufferInfoKHR; + +typedef VkExternalBufferProperties VkExternalBufferPropertiesKHR; + +typedef VkPhysicalDeviceIDProperties VkPhysicalDeviceIDPropertiesKHR; + + +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalBufferPropertiesKHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, + VkExternalBufferProperties* pExternalBufferProperties); +#endif + +#define VK_KHR_external_memory 1 +#define VK_KHR_EXTERNAL_MEMORY_SPEC_VERSION 1 +#define VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME "VK_KHR_external_memory" +#define VK_QUEUE_FAMILY_EXTERNAL_KHR VK_QUEUE_FAMILY_EXTERNAL + +typedef VkExternalMemoryImageCreateInfo VkExternalMemoryImageCreateInfoKHR; + +typedef VkExternalMemoryBufferCreateInfo VkExternalMemoryBufferCreateInfoKHR; + +typedef VkExportMemoryAllocateInfo VkExportMemoryAllocateInfoKHR; + + + +#define VK_KHR_external_memory_fd 1 +#define VK_KHR_EXTERNAL_MEMORY_FD_SPEC_VERSION 1 +#define VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME "VK_KHR_external_memory_fd" + +typedef struct VkImportMemoryFdInfoKHR { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagBits handleType; + int fd; +} VkImportMemoryFdInfoKHR; + +typedef struct VkMemoryFdPropertiesKHR { + VkStructureType sType; + void* pNext; + uint32_t memoryTypeBits; +} VkMemoryFdPropertiesKHR; + +typedef struct VkMemoryGetFdInfoKHR { + VkStructureType sType; + const void* pNext; + VkDeviceMemory memory; + VkExternalMemoryHandleTypeFlagBits handleType; +} VkMemoryGetFdInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryFdKHR)(VkDevice device, const VkMemoryGetFdInfoKHR* pGetFdInfo, int* pFd); +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryFdPropertiesKHR)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, int fd, VkMemoryFdPropertiesKHR* pMemoryFdProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryFdKHR( + VkDevice device, + const VkMemoryGetFdInfoKHR* pGetFdInfo, + int* pFd); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryFdPropertiesKHR( + VkDevice device, + VkExternalMemoryHandleTypeFlagBits handleType, + int fd, + VkMemoryFdPropertiesKHR* pMemoryFdProperties); +#endif + +#define VK_KHR_external_semaphore_capabilities 1 +#define VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_SPEC_VERSION 1 +#define VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME "VK_KHR_external_semaphore_capabilities" + +typedef VkExternalSemaphoreHandleTypeFlags VkExternalSemaphoreHandleTypeFlagsKHR; + +typedef VkExternalSemaphoreHandleTypeFlagBits VkExternalSemaphoreHandleTypeFlagBitsKHR; + +typedef VkExternalSemaphoreFeatureFlags VkExternalSemaphoreFeatureFlagsKHR; + +typedef VkExternalSemaphoreFeatureFlagBits VkExternalSemaphoreFeatureFlagBitsKHR; + + +typedef VkPhysicalDeviceExternalSemaphoreInfo VkPhysicalDeviceExternalSemaphoreInfoKHR; + +typedef VkExternalSemaphoreProperties VkExternalSemaphorePropertiesKHR; + + +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, + VkExternalSemaphoreProperties* pExternalSemaphoreProperties); +#endif + +#define VK_KHR_external_semaphore 1 +#define VK_KHR_EXTERNAL_SEMAPHORE_SPEC_VERSION 1 +#define VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME "VK_KHR_external_semaphore" + +typedef VkSemaphoreImportFlags VkSemaphoreImportFlagsKHR; + +typedef VkSemaphoreImportFlagBits VkSemaphoreImportFlagBitsKHR; + + +typedef VkExportSemaphoreCreateInfo VkExportSemaphoreCreateInfoKHR; + + + +#define VK_KHR_external_semaphore_fd 1 +#define VK_KHR_EXTERNAL_SEMAPHORE_FD_SPEC_VERSION 1 +#define VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME "VK_KHR_external_semaphore_fd" + +typedef struct VkImportSemaphoreFdInfoKHR { + VkStructureType sType; + const void* pNext; + VkSemaphore semaphore; + VkSemaphoreImportFlags flags; + VkExternalSemaphoreHandleTypeFlagBits handleType; + int fd; +} VkImportSemaphoreFdInfoKHR; + +typedef struct VkSemaphoreGetFdInfoKHR { + VkStructureType sType; + const void* pNext; + VkSemaphore semaphore; + VkExternalSemaphoreHandleTypeFlagBits handleType; +} VkSemaphoreGetFdInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreFdKHR)(VkDevice device, const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo); +typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreFdKHR)(VkDevice device, const VkSemaphoreGetFdInfoKHR* pGetFdInfo, int* pFd); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreFdKHR( + VkDevice device, + const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreFdKHR( + VkDevice device, + const VkSemaphoreGetFdInfoKHR* pGetFdInfo, + int* pFd); +#endif + +#define VK_KHR_push_descriptor 1 +#define VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION 2 +#define VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME "VK_KHR_push_descriptor" + +typedef struct VkPhysicalDevicePushDescriptorPropertiesKHR { + VkStructureType sType; + void* pNext; + uint32_t maxPushDescriptors; +} VkPhysicalDevicePushDescriptorPropertiesKHR; + + +typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSetKHR)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites); +typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSetWithTemplateKHR)(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void* pData); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSetKHR( + VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipelineLayout layout, + uint32_t set, + uint32_t descriptorWriteCount, + const VkWriteDescriptorSet* pDescriptorWrites); + +VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSetWithTemplateKHR( + VkCommandBuffer commandBuffer, + VkDescriptorUpdateTemplate descriptorUpdateTemplate, + VkPipelineLayout layout, + uint32_t set, + const void* pData); +#endif + +#define VK_KHR_16bit_storage 1 +#define VK_KHR_16BIT_STORAGE_SPEC_VERSION 1 +#define VK_KHR_16BIT_STORAGE_EXTENSION_NAME "VK_KHR_16bit_storage" + +typedef VkPhysicalDevice16BitStorageFeatures VkPhysicalDevice16BitStorageFeaturesKHR; + + + +#define VK_KHR_incremental_present 1 +#define VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION 1 +#define VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME "VK_KHR_incremental_present" + +typedef struct VkRectLayerKHR { + VkOffset2D offset; + VkExtent2D extent; + uint32_t layer; +} VkRectLayerKHR; + +typedef struct VkPresentRegionKHR { + uint32_t rectangleCount; + const VkRectLayerKHR* pRectangles; +} VkPresentRegionKHR; + +typedef struct VkPresentRegionsKHR { + VkStructureType sType; + const void* pNext; + uint32_t swapchainCount; + const VkPresentRegionKHR* pRegions; +} VkPresentRegionsKHR; + + + +#define VK_KHR_descriptor_update_template 1 +typedef VkDescriptorUpdateTemplate VkDescriptorUpdateTemplateKHR; + + +#define VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_SPEC_VERSION 1 +#define VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME "VK_KHR_descriptor_update_template" + +typedef VkDescriptorUpdateTemplateType VkDescriptorUpdateTemplateTypeKHR; + + +typedef VkDescriptorUpdateTemplateCreateFlags VkDescriptorUpdateTemplateCreateFlagsKHR; + + +typedef VkDescriptorUpdateTemplateEntry VkDescriptorUpdateTemplateEntryKHR; + +typedef VkDescriptorUpdateTemplateCreateInfo VkDescriptorUpdateTemplateCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorUpdateTemplateKHR)(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate); +typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorUpdateTemplateKHR)(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkUpdateDescriptorSetWithTemplateKHR)(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplateKHR( + VkDevice device, + const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate); + +VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorUpdateTemplateKHR( + VkDevice device, + VkDescriptorUpdateTemplate descriptorUpdateTemplate, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSetWithTemplateKHR( + VkDevice device, + VkDescriptorSet descriptorSet, + VkDescriptorUpdateTemplate descriptorUpdateTemplate, + const void* pData); +#endif + +#define VK_KHR_shared_presentable_image 1 +#define VK_KHR_SHARED_PRESENTABLE_IMAGE_SPEC_VERSION 1 +#define VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME "VK_KHR_shared_presentable_image" + +typedef struct VkSharedPresentSurfaceCapabilitiesKHR { + VkStructureType sType; + void* pNext; + VkImageUsageFlags sharedPresentSupportedUsageFlags; +} VkSharedPresentSurfaceCapabilitiesKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainStatusKHR)(VkDevice device, VkSwapchainKHR swapchain); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainStatusKHR( + VkDevice device, + VkSwapchainKHR swapchain); +#endif + +#define VK_KHR_external_fence_capabilities 1 +#define VK_KHR_EXTERNAL_FENCE_CAPABILITIES_SPEC_VERSION 1 +#define VK_KHR_EXTERNAL_FENCE_CAPABILITIES_EXTENSION_NAME "VK_KHR_external_fence_capabilities" + +typedef VkExternalFenceHandleTypeFlags VkExternalFenceHandleTypeFlagsKHR; + +typedef VkExternalFenceHandleTypeFlagBits VkExternalFenceHandleTypeFlagBitsKHR; + +typedef VkExternalFenceFeatureFlags VkExternalFenceFeatureFlagsKHR; + +typedef VkExternalFenceFeatureFlagBits VkExternalFenceFeatureFlagBitsKHR; + + +typedef VkPhysicalDeviceExternalFenceInfo VkPhysicalDeviceExternalFenceInfoKHR; + +typedef VkExternalFenceProperties VkExternalFencePropertiesKHR; + + +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalFencePropertiesKHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, + VkExternalFenceProperties* pExternalFenceProperties); +#endif + +#define VK_KHR_external_fence 1 +#define VK_KHR_EXTERNAL_FENCE_SPEC_VERSION 1 +#define VK_KHR_EXTERNAL_FENCE_EXTENSION_NAME "VK_KHR_external_fence" + +typedef VkFenceImportFlags VkFenceImportFlagsKHR; + +typedef VkFenceImportFlagBits VkFenceImportFlagBitsKHR; + + +typedef VkExportFenceCreateInfo VkExportFenceCreateInfoKHR; + + + +#define VK_KHR_external_fence_fd 1 +#define VK_KHR_EXTERNAL_FENCE_FD_SPEC_VERSION 1 +#define VK_KHR_EXTERNAL_FENCE_FD_EXTENSION_NAME "VK_KHR_external_fence_fd" + +typedef struct VkImportFenceFdInfoKHR { + VkStructureType sType; + const void* pNext; + VkFence fence; + VkFenceImportFlags flags; + VkExternalFenceHandleTypeFlagBits handleType; + int fd; +} VkImportFenceFdInfoKHR; + +typedef struct VkFenceGetFdInfoKHR { + VkStructureType sType; + const void* pNext; + VkFence fence; + VkExternalFenceHandleTypeFlagBits handleType; +} VkFenceGetFdInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkImportFenceFdKHR)(VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo); +typedef VkResult (VKAPI_PTR *PFN_vkGetFenceFdKHR)(VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkImportFenceFdKHR( + VkDevice device, + const VkImportFenceFdInfoKHR* pImportFenceFdInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceFdKHR( + VkDevice device, + const VkFenceGetFdInfoKHR* pGetFdInfo, + int* pFd); +#endif + +#define VK_KHR_maintenance2 1 +#define VK_KHR_MAINTENANCE2_SPEC_VERSION 1 +#define VK_KHR_MAINTENANCE2_EXTENSION_NAME "VK_KHR_maintenance2" + +typedef VkPointClippingBehavior VkPointClippingBehaviorKHR; + +typedef VkTessellationDomainOrigin VkTessellationDomainOriginKHR; + + +typedef VkPhysicalDevicePointClippingProperties VkPhysicalDevicePointClippingPropertiesKHR; + +typedef VkRenderPassInputAttachmentAspectCreateInfo VkRenderPassInputAttachmentAspectCreateInfoKHR; + +typedef VkInputAttachmentAspectReference VkInputAttachmentAspectReferenceKHR; + +typedef VkImageViewUsageCreateInfo VkImageViewUsageCreateInfoKHR; + +typedef VkPipelineTessellationDomainOriginStateCreateInfo VkPipelineTessellationDomainOriginStateCreateInfoKHR; + + + +#define VK_KHR_get_surface_capabilities2 1 +#define VK_KHR_GET_SURFACE_CAPABILITIES_2_SPEC_VERSION 1 +#define VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME "VK_KHR_get_surface_capabilities2" + +typedef struct VkPhysicalDeviceSurfaceInfo2KHR { + VkStructureType sType; + const void* pNext; + VkSurfaceKHR surface; +} VkPhysicalDeviceSurfaceInfo2KHR; + +typedef struct VkSurfaceCapabilities2KHR { + VkStructureType sType; + void* pNext; + VkSurfaceCapabilitiesKHR surfaceCapabilities; +} VkSurfaceCapabilities2KHR; + +typedef struct VkSurfaceFormat2KHR { + VkStructureType sType; + void* pNext; + VkSurfaceFormatKHR surfaceFormat; +} VkSurfaceFormat2KHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceFormats2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilities2KHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, + VkSurfaceCapabilities2KHR* pSurfaceCapabilities); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormats2KHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, + uint32_t* pSurfaceFormatCount, + VkSurfaceFormat2KHR* pSurfaceFormats); +#endif + +#define VK_KHR_variable_pointers 1 +#define VK_KHR_VARIABLE_POINTERS_SPEC_VERSION 1 +#define VK_KHR_VARIABLE_POINTERS_EXTENSION_NAME "VK_KHR_variable_pointers" + +typedef VkPhysicalDeviceVariablePointerFeatures VkPhysicalDeviceVariablePointerFeaturesKHR; + + + +#define VK_KHR_dedicated_allocation 1 +#define VK_KHR_DEDICATED_ALLOCATION_SPEC_VERSION 3 +#define VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_KHR_dedicated_allocation" + +typedef VkMemoryDedicatedRequirements VkMemoryDedicatedRequirementsKHR; + +typedef VkMemoryDedicatedAllocateInfo VkMemoryDedicatedAllocateInfoKHR; + + + +#define VK_KHR_storage_buffer_storage_class 1 +#define VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_SPEC_VERSION 1 +#define VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_EXTENSION_NAME "VK_KHR_storage_buffer_storage_class" + + +#define VK_KHR_relaxed_block_layout 1 +#define VK_KHR_RELAXED_BLOCK_LAYOUT_SPEC_VERSION 1 +#define VK_KHR_RELAXED_BLOCK_LAYOUT_EXTENSION_NAME "VK_KHR_relaxed_block_layout" + + +#define VK_KHR_get_memory_requirements2 1 +#define VK_KHR_GET_MEMORY_REQUIREMENTS_2_SPEC_VERSION 1 +#define VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME "VK_KHR_get_memory_requirements2" + +typedef VkBufferMemoryRequirementsInfo2 VkBufferMemoryRequirementsInfo2KHR; + +typedef VkImageMemoryRequirementsInfo2 VkImageMemoryRequirementsInfo2KHR; + +typedef VkImageSparseMemoryRequirementsInfo2 VkImageSparseMemoryRequirementsInfo2KHR; + +typedef VkMemoryRequirements2 VkMemoryRequirements2KHR; + +typedef VkSparseImageMemoryRequirements2 VkSparseImageMemoryRequirements2KHR; + + +typedef void (VKAPI_PTR *PFN_vkGetImageMemoryRequirements2KHR)(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements); +typedef void (VKAPI_PTR *PFN_vkGetBufferMemoryRequirements2KHR)(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements); +typedef void (VKAPI_PTR *PFN_vkGetImageSparseMemoryRequirements2KHR)(VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements2KHR( + VkDevice device, + const VkImageMemoryRequirementsInfo2* pInfo, + VkMemoryRequirements2* pMemoryRequirements); + +VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements2KHR( + VkDevice device, + const VkBufferMemoryRequirementsInfo2* pInfo, + VkMemoryRequirements2* pMemoryRequirements); + +VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements2KHR( + VkDevice device, + const VkImageSparseMemoryRequirementsInfo2* pInfo, + uint32_t* pSparseMemoryRequirementCount, + VkSparseImageMemoryRequirements2* pSparseMemoryRequirements); +#endif + +#define VK_KHR_image_format_list 1 +#define VK_KHR_IMAGE_FORMAT_LIST_SPEC_VERSION 1 +#define VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME "VK_KHR_image_format_list" + +typedef struct VkImageFormatListCreateInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t viewFormatCount; + const VkFormat* pViewFormats; +} VkImageFormatListCreateInfoKHR; + + + +#define VK_KHR_sampler_ycbcr_conversion 1 +typedef VkSamplerYcbcrConversion VkSamplerYcbcrConversionKHR; + + +#define VK_KHR_SAMPLER_YCBCR_CONVERSION_SPEC_VERSION 1 +#define VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME "VK_KHR_sampler_ycbcr_conversion" + +typedef VkSamplerYcbcrModelConversion VkSamplerYcbcrModelConversionKHR; + +typedef VkSamplerYcbcrRange VkSamplerYcbcrRangeKHR; + +typedef VkChromaLocation VkChromaLocationKHR; + + +typedef VkSamplerYcbcrConversionCreateInfo VkSamplerYcbcrConversionCreateInfoKHR; + +typedef VkSamplerYcbcrConversionInfo VkSamplerYcbcrConversionInfoKHR; + +typedef VkBindImagePlaneMemoryInfo VkBindImagePlaneMemoryInfoKHR; + +typedef VkImagePlaneMemoryRequirementsInfo VkImagePlaneMemoryRequirementsInfoKHR; + +typedef VkPhysicalDeviceSamplerYcbcrConversionFeatures VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR; + +typedef VkSamplerYcbcrConversionImageFormatProperties VkSamplerYcbcrConversionImageFormatPropertiesKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateSamplerYcbcrConversionKHR)(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion); +typedef void (VKAPI_PTR *PFN_vkDestroySamplerYcbcrConversionKHR)(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateSamplerYcbcrConversionKHR( + VkDevice device, + const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSamplerYcbcrConversion* pYcbcrConversion); + +VKAPI_ATTR void VKAPI_CALL vkDestroySamplerYcbcrConversionKHR( + VkDevice device, + VkSamplerYcbcrConversion ycbcrConversion, + const VkAllocationCallbacks* pAllocator); +#endif + +#define VK_KHR_bind_memory2 1 +#define VK_KHR_BIND_MEMORY_2_SPEC_VERSION 1 +#define VK_KHR_BIND_MEMORY_2_EXTENSION_NAME "VK_KHR_bind_memory2" + +typedef VkBindBufferMemoryInfo VkBindBufferMemoryInfoKHR; + +typedef VkBindImageMemoryInfo VkBindImageMemoryInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkBindBufferMemory2KHR)(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos); +typedef VkResult (VKAPI_PTR *PFN_vkBindImageMemory2KHR)(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory2KHR( + VkDevice device, + uint32_t bindInfoCount, + const VkBindBufferMemoryInfo* pBindInfos); + +VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory2KHR( + VkDevice device, + uint32_t bindInfoCount, + const VkBindImageMemoryInfo* pBindInfos); +#endif + +#define VK_KHR_maintenance3 1 +#define VK_KHR_MAINTENANCE3_SPEC_VERSION 1 +#define VK_KHR_MAINTENANCE3_EXTENSION_NAME "VK_KHR_maintenance3" + +typedef VkPhysicalDeviceMaintenance3Properties VkPhysicalDeviceMaintenance3PropertiesKHR; + +typedef VkDescriptorSetLayoutSupport VkDescriptorSetLayoutSupportKHR; + + +typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetLayoutSupportKHR)(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetDescriptorSetLayoutSupportKHR( + VkDevice device, + const VkDescriptorSetLayoutCreateInfo* pCreateInfo, + VkDescriptorSetLayoutSupport* pSupport); +#endif + +#define VK_EXT_debug_report 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) + +#define VK_EXT_DEBUG_REPORT_SPEC_VERSION 9 +#define VK_EXT_DEBUG_REPORT_EXTENSION_NAME "VK_EXT_debug_report" +#define VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT +#define VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT + + +typedef enum VkDebugReportObjectTypeEXT { + VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0, + VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1, + VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2, + VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3, + VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4, + VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5, + VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6, + VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7, + VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8, + VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9, + VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10, + VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11, + VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12, + VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13, + VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14, + VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15, + VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16, + VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17, + VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18, + VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19, + VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20, + VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21, + VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22, + VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23, + VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24, + VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25, + VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26, + VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27, + VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT = 28, + VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29, + VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30, + VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31, + VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32, + VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT = 33, + VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT = 1000156000, + VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT = 1000085000, + VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_BEGIN_RANGE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_END_RANGE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_RANGE_SIZE_EXT = (VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT - VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT + 1), + VK_DEBUG_REPORT_OBJECT_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDebugReportObjectTypeEXT; + + +typedef enum VkDebugReportFlagBitsEXT { + VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001, + VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002, + VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004, + VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008, + VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010, + VK_DEBUG_REPORT_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDebugReportFlagBitsEXT; +typedef VkFlags VkDebugReportFlagsEXT; + +typedef VkBool32 (VKAPI_PTR *PFN_vkDebugReportCallbackEXT)( + VkDebugReportFlagsEXT flags, + VkDebugReportObjectTypeEXT objectType, + uint64_t object, + size_t location, + int32_t messageCode, + const char* pLayerPrefix, + const char* pMessage, + void* pUserData); + +typedef struct VkDebugReportCallbackCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkDebugReportFlagsEXT flags; + PFN_vkDebugReportCallbackEXT pfnCallback; + void* pUserData; +} VkDebugReportCallbackCreateInfoEXT; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateDebugReportCallbackEXT)(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback); +typedef void (VKAPI_PTR *PFN_vkDestroyDebugReportCallbackEXT)(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkDebugReportMessageEXT)(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDebugReportCallbackEXT( + VkInstance instance, + const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDebugReportCallbackEXT* pCallback); + +VKAPI_ATTR void VKAPI_CALL vkDestroyDebugReportCallbackEXT( + VkInstance instance, + VkDebugReportCallbackEXT callback, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR void VKAPI_CALL vkDebugReportMessageEXT( + VkInstance instance, + VkDebugReportFlagsEXT flags, + VkDebugReportObjectTypeEXT objectType, + uint64_t object, + size_t location, + int32_t messageCode, + const char* pLayerPrefix, + const char* pMessage); +#endif + +#define VK_NV_glsl_shader 1 +#define VK_NV_GLSL_SHADER_SPEC_VERSION 1 +#define VK_NV_GLSL_SHADER_EXTENSION_NAME "VK_NV_glsl_shader" + + +#define VK_EXT_depth_range_unrestricted 1 +#define VK_EXT_DEPTH_RANGE_UNRESTRICTED_SPEC_VERSION 1 +#define VK_EXT_DEPTH_RANGE_UNRESTRICTED_EXTENSION_NAME "VK_EXT_depth_range_unrestricted" + + +#define VK_IMG_filter_cubic 1 +#define VK_IMG_FILTER_CUBIC_SPEC_VERSION 1 +#define VK_IMG_FILTER_CUBIC_EXTENSION_NAME "VK_IMG_filter_cubic" + + +#define VK_AMD_rasterization_order 1 +#define VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION 1 +#define VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME "VK_AMD_rasterization_order" + + +typedef enum VkRasterizationOrderAMD { + VK_RASTERIZATION_ORDER_STRICT_AMD = 0, + VK_RASTERIZATION_ORDER_RELAXED_AMD = 1, + VK_RASTERIZATION_ORDER_BEGIN_RANGE_AMD = VK_RASTERIZATION_ORDER_STRICT_AMD, + VK_RASTERIZATION_ORDER_END_RANGE_AMD = VK_RASTERIZATION_ORDER_RELAXED_AMD, + VK_RASTERIZATION_ORDER_RANGE_SIZE_AMD = (VK_RASTERIZATION_ORDER_RELAXED_AMD - VK_RASTERIZATION_ORDER_STRICT_AMD + 1), + VK_RASTERIZATION_ORDER_MAX_ENUM_AMD = 0x7FFFFFFF +} VkRasterizationOrderAMD; + +typedef struct VkPipelineRasterizationStateRasterizationOrderAMD { + VkStructureType sType; + const void* pNext; + VkRasterizationOrderAMD rasterizationOrder; +} VkPipelineRasterizationStateRasterizationOrderAMD; + + + +#define VK_AMD_shader_trinary_minmax 1 +#define VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION 1 +#define VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME "VK_AMD_shader_trinary_minmax" + + +#define VK_AMD_shader_explicit_vertex_parameter 1 +#define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION 1 +#define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME "VK_AMD_shader_explicit_vertex_parameter" + + +#define VK_EXT_debug_marker 1 +#define VK_EXT_DEBUG_MARKER_SPEC_VERSION 4 +#define VK_EXT_DEBUG_MARKER_EXTENSION_NAME "VK_EXT_debug_marker" + +typedef struct VkDebugMarkerObjectNameInfoEXT { + VkStructureType sType; + const void* pNext; + VkDebugReportObjectTypeEXT objectType; + uint64_t object; + const char* pObjectName; +} VkDebugMarkerObjectNameInfoEXT; + +typedef struct VkDebugMarkerObjectTagInfoEXT { + VkStructureType sType; + const void* pNext; + VkDebugReportObjectTypeEXT objectType; + uint64_t object; + uint64_t tagName; + size_t tagSize; + const void* pTag; +} VkDebugMarkerObjectTagInfoEXT; + +typedef struct VkDebugMarkerMarkerInfoEXT { + VkStructureType sType; + const void* pNext; + const char* pMarkerName; + float color[4]; +} VkDebugMarkerMarkerInfoEXT; + + +typedef VkResult (VKAPI_PTR *PFN_vkDebugMarkerSetObjectTagEXT)(VkDevice device, const VkDebugMarkerObjectTagInfoEXT* pTagInfo); +typedef VkResult (VKAPI_PTR *PFN_vkDebugMarkerSetObjectNameEXT)(VkDevice device, const VkDebugMarkerObjectNameInfoEXT* pNameInfo); +typedef void (VKAPI_PTR *PFN_vkCmdDebugMarkerBeginEXT)(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo); +typedef void (VKAPI_PTR *PFN_vkCmdDebugMarkerEndEXT)(VkCommandBuffer commandBuffer); +typedef void (VKAPI_PTR *PFN_vkCmdDebugMarkerInsertEXT)(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkDebugMarkerSetObjectTagEXT( + VkDevice device, + const VkDebugMarkerObjectTagInfoEXT* pTagInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkDebugMarkerSetObjectNameEXT( + VkDevice device, + const VkDebugMarkerObjectNameInfoEXT* pNameInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdDebugMarkerBeginEXT( + VkCommandBuffer commandBuffer, + const VkDebugMarkerMarkerInfoEXT* pMarkerInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdDebugMarkerEndEXT( + VkCommandBuffer commandBuffer); + +VKAPI_ATTR void VKAPI_CALL vkCmdDebugMarkerInsertEXT( + VkCommandBuffer commandBuffer, + const VkDebugMarkerMarkerInfoEXT* pMarkerInfo); +#endif + +#define VK_AMD_gcn_shader 1 +#define VK_AMD_GCN_SHADER_SPEC_VERSION 1 +#define VK_AMD_GCN_SHADER_EXTENSION_NAME "VK_AMD_gcn_shader" + + +#define VK_NV_dedicated_allocation 1 +#define VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION 1 +#define VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_NV_dedicated_allocation" + +typedef struct VkDedicatedAllocationImageCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkBool32 dedicatedAllocation; +} VkDedicatedAllocationImageCreateInfoNV; + +typedef struct VkDedicatedAllocationBufferCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkBool32 dedicatedAllocation; +} VkDedicatedAllocationBufferCreateInfoNV; + +typedef struct VkDedicatedAllocationMemoryAllocateInfoNV { + VkStructureType sType; + const void* pNext; + VkImage image; + VkBuffer buffer; +} VkDedicatedAllocationMemoryAllocateInfoNV; + + + +#define VK_AMD_draw_indirect_count 1 +#define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 1 +#define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count" + +typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirectCountAMD)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); +typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexedIndirectCountAMD)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirectCountAMD( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride); + +VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirectCountAMD( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride); +#endif + +#define VK_AMD_negative_viewport_height 1 +#define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION 1 +#define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME "VK_AMD_negative_viewport_height" + + +#define VK_AMD_gpu_shader_half_float 1 +#define VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION 1 +#define VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME "VK_AMD_gpu_shader_half_float" + + +#define VK_AMD_shader_ballot 1 +#define VK_AMD_SHADER_BALLOT_SPEC_VERSION 1 +#define VK_AMD_SHADER_BALLOT_EXTENSION_NAME "VK_AMD_shader_ballot" + + +#define VK_AMD_texture_gather_bias_lod 1 +#define VK_AMD_TEXTURE_GATHER_BIAS_LOD_SPEC_VERSION 1 +#define VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME "VK_AMD_texture_gather_bias_lod" + +typedef struct VkTextureLODGatherFormatPropertiesAMD { + VkStructureType sType; + void* pNext; + VkBool32 supportsTextureGatherLODBiasAMD; +} VkTextureLODGatherFormatPropertiesAMD; + + + +#define VK_AMD_shader_info 1 +#define VK_AMD_SHADER_INFO_SPEC_VERSION 1 +#define VK_AMD_SHADER_INFO_EXTENSION_NAME "VK_AMD_shader_info" + + +typedef enum VkShaderInfoTypeAMD { + VK_SHADER_INFO_TYPE_STATISTICS_AMD = 0, + VK_SHADER_INFO_TYPE_BINARY_AMD = 1, + VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD = 2, + VK_SHADER_INFO_TYPE_BEGIN_RANGE_AMD = VK_SHADER_INFO_TYPE_STATISTICS_AMD, + VK_SHADER_INFO_TYPE_END_RANGE_AMD = VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD, + VK_SHADER_INFO_TYPE_RANGE_SIZE_AMD = (VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD - VK_SHADER_INFO_TYPE_STATISTICS_AMD + 1), + VK_SHADER_INFO_TYPE_MAX_ENUM_AMD = 0x7FFFFFFF +} VkShaderInfoTypeAMD; + +typedef struct VkShaderResourceUsageAMD { + uint32_t numUsedVgprs; + uint32_t numUsedSgprs; + uint32_t ldsSizePerLocalWorkGroup; + size_t ldsUsageSizeInBytes; + size_t scratchMemUsageInBytes; +} VkShaderResourceUsageAMD; + +typedef struct VkShaderStatisticsInfoAMD { + VkShaderStageFlags shaderStageMask; + VkShaderResourceUsageAMD resourceUsage; + uint32_t numPhysicalVgprs; + uint32_t numPhysicalSgprs; + uint32_t numAvailableVgprs; + uint32_t numAvailableSgprs; + uint32_t computeWorkGroupSize[3]; +} VkShaderStatisticsInfoAMD; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetShaderInfoAMD)(VkDevice device, VkPipeline pipeline, VkShaderStageFlagBits shaderStage, VkShaderInfoTypeAMD infoType, size_t* pInfoSize, void* pInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetShaderInfoAMD( + VkDevice device, + VkPipeline pipeline, + VkShaderStageFlagBits shaderStage, + VkShaderInfoTypeAMD infoType, + size_t* pInfoSize, + void* pInfo); +#endif + +#define VK_AMD_shader_image_load_store_lod 1 +#define VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_SPEC_VERSION 1 +#define VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_EXTENSION_NAME "VK_AMD_shader_image_load_store_lod" + + +#define VK_IMG_format_pvrtc 1 +#define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1 +#define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc" + + +#define VK_NV_external_memory_capabilities 1 +#define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1 +#define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_NV_external_memory_capabilities" + + +typedef enum VkExternalMemoryHandleTypeFlagBitsNV { + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV = 0x00000001, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV = 0x00000002, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0x00000004, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0x00000008, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_FLAG_BITS_MAX_ENUM_NV = 0x7FFFFFFF +} VkExternalMemoryHandleTypeFlagBitsNV; +typedef VkFlags VkExternalMemoryHandleTypeFlagsNV; + +typedef enum VkExternalMemoryFeatureFlagBitsNV { + VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV = 0x00000001, + VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0x00000002, + VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0x00000004, + VK_EXTERNAL_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM_NV = 0x7FFFFFFF +} VkExternalMemoryFeatureFlagBitsNV; +typedef VkFlags VkExternalMemoryFeatureFlagsNV; + +typedef struct VkExternalImageFormatPropertiesNV { + VkImageFormatProperties imageFormatProperties; + VkExternalMemoryFeatureFlagsNV externalMemoryFeatures; + VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes; + VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes; +} VkExternalImageFormatPropertiesNV; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkExternalMemoryHandleTypeFlagsNV externalHandleType, VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceExternalImageFormatPropertiesNV( + VkPhysicalDevice physicalDevice, + VkFormat format, + VkImageType type, + VkImageTiling tiling, + VkImageUsageFlags usage, + VkImageCreateFlags flags, + VkExternalMemoryHandleTypeFlagsNV externalHandleType, + VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties); +#endif + +#define VK_NV_external_memory 1 +#define VK_NV_EXTERNAL_MEMORY_SPEC_VERSION 1 +#define VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME "VK_NV_external_memory" + +typedef struct VkExternalMemoryImageCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagsNV handleTypes; +} VkExternalMemoryImageCreateInfoNV; + +typedef struct VkExportMemoryAllocateInfoNV { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagsNV handleTypes; +} VkExportMemoryAllocateInfoNV; + + + +#define VK_EXT_validation_flags 1 +#define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 1 +#define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags" + + +typedef enum VkValidationCheckEXT { + VK_VALIDATION_CHECK_ALL_EXT = 0, + VK_VALIDATION_CHECK_SHADERS_EXT = 1, + VK_VALIDATION_CHECK_BEGIN_RANGE_EXT = VK_VALIDATION_CHECK_ALL_EXT, + VK_VALIDATION_CHECK_END_RANGE_EXT = VK_VALIDATION_CHECK_SHADERS_EXT, + VK_VALIDATION_CHECK_RANGE_SIZE_EXT = (VK_VALIDATION_CHECK_SHADERS_EXT - VK_VALIDATION_CHECK_ALL_EXT + 1), + VK_VALIDATION_CHECK_MAX_ENUM_EXT = 0x7FFFFFFF +} VkValidationCheckEXT; + +typedef struct VkValidationFlagsEXT { + VkStructureType sType; + const void* pNext; + uint32_t disabledValidationCheckCount; + VkValidationCheckEXT* pDisabledValidationChecks; +} VkValidationFlagsEXT; + + + +#define VK_EXT_shader_subgroup_ballot 1 +#define VK_EXT_SHADER_SUBGROUP_BALLOT_SPEC_VERSION 1 +#define VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME "VK_EXT_shader_subgroup_ballot" + + +#define VK_EXT_shader_subgroup_vote 1 +#define VK_EXT_SHADER_SUBGROUP_VOTE_SPEC_VERSION 1 +#define VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME "VK_EXT_shader_subgroup_vote" + + +#define VK_NVX_device_generated_commands 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkObjectTableNVX) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkIndirectCommandsLayoutNVX) + +#define VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 3 +#define VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NVX_device_generated_commands" + + +typedef enum VkIndirectCommandsTokenTypeNVX { + VK_INDIRECT_COMMANDS_TOKEN_TYPE_PIPELINE_NVX = 0, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_DESCRIPTOR_SET_NVX = 1, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_INDEX_BUFFER_NVX = 2, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_VERTEX_BUFFER_NVX = 3, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_NVX = 4, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_NVX = 5, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_NVX = 6, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_NVX = 7, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_BEGIN_RANGE_NVX = VK_INDIRECT_COMMANDS_TOKEN_TYPE_PIPELINE_NVX, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_END_RANGE_NVX = VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_NVX, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_RANGE_SIZE_NVX = (VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_NVX - VK_INDIRECT_COMMANDS_TOKEN_TYPE_PIPELINE_NVX + 1), + VK_INDIRECT_COMMANDS_TOKEN_TYPE_MAX_ENUM_NVX = 0x7FFFFFFF +} VkIndirectCommandsTokenTypeNVX; + +typedef enum VkObjectEntryTypeNVX { + VK_OBJECT_ENTRY_TYPE_DESCRIPTOR_SET_NVX = 0, + VK_OBJECT_ENTRY_TYPE_PIPELINE_NVX = 1, + VK_OBJECT_ENTRY_TYPE_INDEX_BUFFER_NVX = 2, + VK_OBJECT_ENTRY_TYPE_VERTEX_BUFFER_NVX = 3, + VK_OBJECT_ENTRY_TYPE_PUSH_CONSTANT_NVX = 4, + VK_OBJECT_ENTRY_TYPE_BEGIN_RANGE_NVX = VK_OBJECT_ENTRY_TYPE_DESCRIPTOR_SET_NVX, + VK_OBJECT_ENTRY_TYPE_END_RANGE_NVX = VK_OBJECT_ENTRY_TYPE_PUSH_CONSTANT_NVX, + VK_OBJECT_ENTRY_TYPE_RANGE_SIZE_NVX = (VK_OBJECT_ENTRY_TYPE_PUSH_CONSTANT_NVX - VK_OBJECT_ENTRY_TYPE_DESCRIPTOR_SET_NVX + 1), + VK_OBJECT_ENTRY_TYPE_MAX_ENUM_NVX = 0x7FFFFFFF +} VkObjectEntryTypeNVX; + + +typedef enum VkIndirectCommandsLayoutUsageFlagBitsNVX { + VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX = 0x00000001, + VK_INDIRECT_COMMANDS_LAYOUT_USAGE_SPARSE_SEQUENCES_BIT_NVX = 0x00000002, + VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EMPTY_EXECUTIONS_BIT_NVX = 0x00000004, + VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NVX = 0x00000008, + VK_INDIRECT_COMMANDS_LAYOUT_USAGE_FLAG_BITS_MAX_ENUM_NVX = 0x7FFFFFFF +} VkIndirectCommandsLayoutUsageFlagBitsNVX; +typedef VkFlags VkIndirectCommandsLayoutUsageFlagsNVX; + +typedef enum VkObjectEntryUsageFlagBitsNVX { + VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX = 0x00000001, + VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX = 0x00000002, + VK_OBJECT_ENTRY_USAGE_FLAG_BITS_MAX_ENUM_NVX = 0x7FFFFFFF +} VkObjectEntryUsageFlagBitsNVX; +typedef VkFlags VkObjectEntryUsageFlagsNVX; + +typedef struct VkDeviceGeneratedCommandsFeaturesNVX { + VkStructureType sType; + const void* pNext; + VkBool32 computeBindingPointSupport; +} VkDeviceGeneratedCommandsFeaturesNVX; + +typedef struct VkDeviceGeneratedCommandsLimitsNVX { + VkStructureType sType; + const void* pNext; + uint32_t maxIndirectCommandsLayoutTokenCount; + uint32_t maxObjectEntryCounts; + uint32_t minSequenceCountBufferOffsetAlignment; + uint32_t minSequenceIndexBufferOffsetAlignment; + uint32_t minCommandsTokenBufferOffsetAlignment; +} VkDeviceGeneratedCommandsLimitsNVX; + +typedef struct VkIndirectCommandsTokenNVX { + VkIndirectCommandsTokenTypeNVX tokenType; + VkBuffer buffer; + VkDeviceSize offset; +} VkIndirectCommandsTokenNVX; + +typedef struct VkIndirectCommandsLayoutTokenNVX { + VkIndirectCommandsTokenTypeNVX tokenType; + uint32_t bindingUnit; + uint32_t dynamicCount; + uint32_t divisor; +} VkIndirectCommandsLayoutTokenNVX; + +typedef struct VkIndirectCommandsLayoutCreateInfoNVX { + VkStructureType sType; + const void* pNext; + VkPipelineBindPoint pipelineBindPoint; + VkIndirectCommandsLayoutUsageFlagsNVX flags; + uint32_t tokenCount; + const VkIndirectCommandsLayoutTokenNVX* pTokens; +} VkIndirectCommandsLayoutCreateInfoNVX; + +typedef struct VkCmdProcessCommandsInfoNVX { + VkStructureType sType; + const void* pNext; + VkObjectTableNVX objectTable; + VkIndirectCommandsLayoutNVX indirectCommandsLayout; + uint32_t indirectCommandsTokenCount; + const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens; + uint32_t maxSequencesCount; + VkCommandBuffer targetCommandBuffer; + VkBuffer sequencesCountBuffer; + VkDeviceSize sequencesCountOffset; + VkBuffer sequencesIndexBuffer; + VkDeviceSize sequencesIndexOffset; +} VkCmdProcessCommandsInfoNVX; + +typedef struct VkCmdReserveSpaceForCommandsInfoNVX { + VkStructureType sType; + const void* pNext; + VkObjectTableNVX objectTable; + VkIndirectCommandsLayoutNVX indirectCommandsLayout; + uint32_t maxSequencesCount; +} VkCmdReserveSpaceForCommandsInfoNVX; + +typedef struct VkObjectTableCreateInfoNVX { + VkStructureType sType; + const void* pNext; + uint32_t objectCount; + const VkObjectEntryTypeNVX* pObjectEntryTypes; + const uint32_t* pObjectEntryCounts; + const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags; + uint32_t maxUniformBuffersPerDescriptor; + uint32_t maxStorageBuffersPerDescriptor; + uint32_t maxStorageImagesPerDescriptor; + uint32_t maxSampledImagesPerDescriptor; + uint32_t maxPipelineLayouts; +} VkObjectTableCreateInfoNVX; + +typedef struct VkObjectTableEntryNVX { + VkObjectEntryTypeNVX type; + VkObjectEntryUsageFlagsNVX flags; +} VkObjectTableEntryNVX; + +typedef struct VkObjectTablePipelineEntryNVX { + VkObjectEntryTypeNVX type; + VkObjectEntryUsageFlagsNVX flags; + VkPipeline pipeline; +} VkObjectTablePipelineEntryNVX; + +typedef struct VkObjectTableDescriptorSetEntryNVX { + VkObjectEntryTypeNVX type; + VkObjectEntryUsageFlagsNVX flags; + VkPipelineLayout pipelineLayout; + VkDescriptorSet descriptorSet; +} VkObjectTableDescriptorSetEntryNVX; + +typedef struct VkObjectTableVertexBufferEntryNVX { + VkObjectEntryTypeNVX type; + VkObjectEntryUsageFlagsNVX flags; + VkBuffer buffer; +} VkObjectTableVertexBufferEntryNVX; + +typedef struct VkObjectTableIndexBufferEntryNVX { + VkObjectEntryTypeNVX type; + VkObjectEntryUsageFlagsNVX flags; + VkBuffer buffer; + VkIndexType indexType; +} VkObjectTableIndexBufferEntryNVX; + +typedef struct VkObjectTablePushConstantEntryNVX { + VkObjectEntryTypeNVX type; + VkObjectEntryUsageFlagsNVX flags; + VkPipelineLayout pipelineLayout; + VkShaderStageFlags stageFlags; +} VkObjectTablePushConstantEntryNVX; + + +typedef void (VKAPI_PTR *PFN_vkCmdProcessCommandsNVX)(VkCommandBuffer commandBuffer, const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo); +typedef void (VKAPI_PTR *PFN_vkCmdReserveSpaceForCommandsNVX)(VkCommandBuffer commandBuffer, const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo); +typedef VkResult (VKAPI_PTR *PFN_vkCreateIndirectCommandsLayoutNVX)(VkDevice device, const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout); +typedef void (VKAPI_PTR *PFN_vkDestroyIndirectCommandsLayoutNVX)(VkDevice device, VkIndirectCommandsLayoutNVX indirectCommandsLayout, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkCreateObjectTableNVX)(VkDevice device, const VkObjectTableCreateInfoNVX* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkObjectTableNVX* pObjectTable); +typedef void (VKAPI_PTR *PFN_vkDestroyObjectTableNVX)(VkDevice device, VkObjectTableNVX objectTable, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkRegisterObjectsNVX)(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, const VkObjectTableEntryNVX* const* ppObjectTableEntries, const uint32_t* pObjectIndices); +typedef VkResult (VKAPI_PTR *PFN_vkUnregisterObjectsNVX)(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, const VkObjectEntryTypeNVX* pObjectEntryTypes, const uint32_t* pObjectIndices); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX)(VkPhysicalDevice physicalDevice, VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, VkDeviceGeneratedCommandsLimitsNVX* pLimits); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdProcessCommandsNVX( + VkCommandBuffer commandBuffer, + const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdReserveSpaceForCommandsNVX( + VkCommandBuffer commandBuffer, + const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateIndirectCommandsLayoutNVX( + VkDevice device, + const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout); + +VKAPI_ATTR void VKAPI_CALL vkDestroyIndirectCommandsLayoutNVX( + VkDevice device, + VkIndirectCommandsLayoutNVX indirectCommandsLayout, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateObjectTableNVX( + VkDevice device, + const VkObjectTableCreateInfoNVX* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkObjectTableNVX* pObjectTable); + +VKAPI_ATTR void VKAPI_CALL vkDestroyObjectTableNVX( + VkDevice device, + VkObjectTableNVX objectTable, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkRegisterObjectsNVX( + VkDevice device, + VkObjectTableNVX objectTable, + uint32_t objectCount, + const VkObjectTableEntryNVX* const* ppObjectTableEntries, + const uint32_t* pObjectIndices); + +VKAPI_ATTR VkResult VKAPI_CALL vkUnregisterObjectsNVX( + VkDevice device, + VkObjectTableNVX objectTable, + uint32_t objectCount, + const VkObjectEntryTypeNVX* pObjectEntryTypes, + const uint32_t* pObjectIndices); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( + VkPhysicalDevice physicalDevice, + VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, + VkDeviceGeneratedCommandsLimitsNVX* pLimits); +#endif + +#define VK_NV_clip_space_w_scaling 1 +#define VK_NV_CLIP_SPACE_W_SCALING_SPEC_VERSION 1 +#define VK_NV_CLIP_SPACE_W_SCALING_EXTENSION_NAME "VK_NV_clip_space_w_scaling" + +typedef struct VkViewportWScalingNV { + float xcoeff; + float ycoeff; +} VkViewportWScalingNV; + +typedef struct VkPipelineViewportWScalingStateCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkBool32 viewportWScalingEnable; + uint32_t viewportCount; + const VkViewportWScalingNV* pViewportWScalings; +} VkPipelineViewportWScalingStateCreateInfoNV; + + +typedef void (VKAPI_PTR *PFN_vkCmdSetViewportWScalingNV)(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV* pViewportWScalings); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetViewportWScalingNV( + VkCommandBuffer commandBuffer, + uint32_t firstViewport, + uint32_t viewportCount, + const VkViewportWScalingNV* pViewportWScalings); +#endif + +#define VK_EXT_direct_mode_display 1 +#define VK_EXT_DIRECT_MODE_DISPLAY_SPEC_VERSION 1 +#define VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME "VK_EXT_direct_mode_display" + +typedef VkResult (VKAPI_PTR *PFN_vkReleaseDisplayEXT)(VkPhysicalDevice physicalDevice, VkDisplayKHR display); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkReleaseDisplayEXT( + VkPhysicalDevice physicalDevice, + VkDisplayKHR display); +#endif + +#define VK_EXT_display_surface_counter 1 +#define VK_EXT_DISPLAY_SURFACE_COUNTER_SPEC_VERSION 1 +#define VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME "VK_EXT_display_surface_counter" +#define VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT + + +typedef enum VkSurfaceCounterFlagBitsEXT { + VK_SURFACE_COUNTER_VBLANK_EXT = 0x00000001, + VK_SURFACE_COUNTER_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkSurfaceCounterFlagBitsEXT; +typedef VkFlags VkSurfaceCounterFlagsEXT; + +typedef struct VkSurfaceCapabilities2EXT { + VkStructureType sType; + void* pNext; + uint32_t minImageCount; + uint32_t maxImageCount; + VkExtent2D currentExtent; + VkExtent2D minImageExtent; + VkExtent2D maxImageExtent; + uint32_t maxImageArrayLayers; + VkSurfaceTransformFlagsKHR supportedTransforms; + VkSurfaceTransformFlagBitsKHR currentTransform; + VkCompositeAlphaFlagsKHR supportedCompositeAlpha; + VkImageUsageFlags supportedUsageFlags; + VkSurfaceCounterFlagsEXT supportedSurfaceCounters; +} VkSurfaceCapabilities2EXT; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilities2EXT* pSurfaceCapabilities); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilities2EXT( + VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + VkSurfaceCapabilities2EXT* pSurfaceCapabilities); +#endif + +#define VK_EXT_display_control 1 +#define VK_EXT_DISPLAY_CONTROL_SPEC_VERSION 1 +#define VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME "VK_EXT_display_control" + + +typedef enum VkDisplayPowerStateEXT { + VK_DISPLAY_POWER_STATE_OFF_EXT = 0, + VK_DISPLAY_POWER_STATE_SUSPEND_EXT = 1, + VK_DISPLAY_POWER_STATE_ON_EXT = 2, + VK_DISPLAY_POWER_STATE_BEGIN_RANGE_EXT = VK_DISPLAY_POWER_STATE_OFF_EXT, + VK_DISPLAY_POWER_STATE_END_RANGE_EXT = VK_DISPLAY_POWER_STATE_ON_EXT, + VK_DISPLAY_POWER_STATE_RANGE_SIZE_EXT = (VK_DISPLAY_POWER_STATE_ON_EXT - VK_DISPLAY_POWER_STATE_OFF_EXT + 1), + VK_DISPLAY_POWER_STATE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDisplayPowerStateEXT; + +typedef enum VkDeviceEventTypeEXT { + VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT = 0, + VK_DEVICE_EVENT_TYPE_BEGIN_RANGE_EXT = VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT, + VK_DEVICE_EVENT_TYPE_END_RANGE_EXT = VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT, + VK_DEVICE_EVENT_TYPE_RANGE_SIZE_EXT = (VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT - VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT + 1), + VK_DEVICE_EVENT_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDeviceEventTypeEXT; + +typedef enum VkDisplayEventTypeEXT { + VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT = 0, + VK_DISPLAY_EVENT_TYPE_BEGIN_RANGE_EXT = VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT, + VK_DISPLAY_EVENT_TYPE_END_RANGE_EXT = VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT, + VK_DISPLAY_EVENT_TYPE_RANGE_SIZE_EXT = (VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT - VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT + 1), + VK_DISPLAY_EVENT_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDisplayEventTypeEXT; + +typedef struct VkDisplayPowerInfoEXT { + VkStructureType sType; + const void* pNext; + VkDisplayPowerStateEXT powerState; +} VkDisplayPowerInfoEXT; + +typedef struct VkDeviceEventInfoEXT { + VkStructureType sType; + const void* pNext; + VkDeviceEventTypeEXT deviceEvent; +} VkDeviceEventInfoEXT; + +typedef struct VkDisplayEventInfoEXT { + VkStructureType sType; + const void* pNext; + VkDisplayEventTypeEXT displayEvent; +} VkDisplayEventInfoEXT; + +typedef struct VkSwapchainCounterCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkSurfaceCounterFlagsEXT surfaceCounters; +} VkSwapchainCounterCreateInfoEXT; + + +typedef VkResult (VKAPI_PTR *PFN_vkDisplayPowerControlEXT)(VkDevice device, VkDisplayKHR display, const VkDisplayPowerInfoEXT* pDisplayPowerInfo); +typedef VkResult (VKAPI_PTR *PFN_vkRegisterDeviceEventEXT)(VkDevice device, const VkDeviceEventInfoEXT* pDeviceEventInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence); +typedef VkResult (VKAPI_PTR *PFN_vkRegisterDisplayEventEXT)(VkDevice device, VkDisplayKHR display, const VkDisplayEventInfoEXT* pDisplayEventInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence); +typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainCounterEXT)(VkDevice device, VkSwapchainKHR swapchain, VkSurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkDisplayPowerControlEXT( + VkDevice device, + VkDisplayKHR display, + const VkDisplayPowerInfoEXT* pDisplayPowerInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkRegisterDeviceEventEXT( + VkDevice device, + const VkDeviceEventInfoEXT* pDeviceEventInfo, + const VkAllocationCallbacks* pAllocator, + VkFence* pFence); + +VKAPI_ATTR VkResult VKAPI_CALL vkRegisterDisplayEventEXT( + VkDevice device, + VkDisplayKHR display, + const VkDisplayEventInfoEXT* pDisplayEventInfo, + const VkAllocationCallbacks* pAllocator, + VkFence* pFence); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainCounterEXT( + VkDevice device, + VkSwapchainKHR swapchain, + VkSurfaceCounterFlagBitsEXT counter, + uint64_t* pCounterValue); +#endif + +#define VK_GOOGLE_display_timing 1 +#define VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION 1 +#define VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME "VK_GOOGLE_display_timing" + +typedef struct VkRefreshCycleDurationGOOGLE { + uint64_t refreshDuration; +} VkRefreshCycleDurationGOOGLE; + +typedef struct VkPastPresentationTimingGOOGLE { + uint32_t presentID; + uint64_t desiredPresentTime; + uint64_t actualPresentTime; + uint64_t earliestPresentTime; + uint64_t presentMargin; +} VkPastPresentationTimingGOOGLE; + +typedef struct VkPresentTimeGOOGLE { + uint32_t presentID; + uint64_t desiredPresentTime; +} VkPresentTimeGOOGLE; + +typedef struct VkPresentTimesInfoGOOGLE { + VkStructureType sType; + const void* pNext; + uint32_t swapchainCount; + const VkPresentTimeGOOGLE* pTimes; +} VkPresentTimesInfoGOOGLE; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetRefreshCycleDurationGOOGLE)(VkDevice device, VkSwapchainKHR swapchain, VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties); +typedef VkResult (VKAPI_PTR *PFN_vkGetPastPresentationTimingGOOGLE)(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pPresentationTimingCount, VkPastPresentationTimingGOOGLE* pPresentationTimings); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetRefreshCycleDurationGOOGLE( + VkDevice device, + VkSwapchainKHR swapchain, + VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPastPresentationTimingGOOGLE( + VkDevice device, + VkSwapchainKHR swapchain, + uint32_t* pPresentationTimingCount, + VkPastPresentationTimingGOOGLE* pPresentationTimings); +#endif + +#define VK_NV_sample_mask_override_coverage 1 +#define VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_SPEC_VERSION 1 +#define VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_EXTENSION_NAME "VK_NV_sample_mask_override_coverage" + + +#define VK_NV_geometry_shader_passthrough 1 +#define VK_NV_GEOMETRY_SHADER_PASSTHROUGH_SPEC_VERSION 1 +#define VK_NV_GEOMETRY_SHADER_PASSTHROUGH_EXTENSION_NAME "VK_NV_geometry_shader_passthrough" + + +#define VK_NV_viewport_array2 1 +#define VK_NV_VIEWPORT_ARRAY2_SPEC_VERSION 1 +#define VK_NV_VIEWPORT_ARRAY2_EXTENSION_NAME "VK_NV_viewport_array2" + + +#define VK_NVX_multiview_per_view_attributes 1 +#define VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION 1 +#define VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME "VK_NVX_multiview_per_view_attributes" + +typedef struct VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX { + VkStructureType sType; + void* pNext; + VkBool32 perViewPositionAllComponents; +} VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX; + + + +#define VK_NV_viewport_swizzle 1 +#define VK_NV_VIEWPORT_SWIZZLE_SPEC_VERSION 1 +#define VK_NV_VIEWPORT_SWIZZLE_EXTENSION_NAME "VK_NV_viewport_swizzle" + + +typedef enum VkViewportCoordinateSwizzleNV { + VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV = 0, + VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_X_NV = 1, + VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Y_NV = 2, + VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Y_NV = 3, + VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Z_NV = 4, + VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Z_NV = 5, + VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_W_NV = 6, + VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV = 7, + VK_VIEWPORT_COORDINATE_SWIZZLE_BEGIN_RANGE_NV = VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV, + VK_VIEWPORT_COORDINATE_SWIZZLE_END_RANGE_NV = VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV, + VK_VIEWPORT_COORDINATE_SWIZZLE_RANGE_SIZE_NV = (VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV + 1), + VK_VIEWPORT_COORDINATE_SWIZZLE_MAX_ENUM_NV = 0x7FFFFFFF +} VkViewportCoordinateSwizzleNV; + +typedef VkFlags VkPipelineViewportSwizzleStateCreateFlagsNV; + +typedef struct VkViewportSwizzleNV { + VkViewportCoordinateSwizzleNV x; + VkViewportCoordinateSwizzleNV y; + VkViewportCoordinateSwizzleNV z; + VkViewportCoordinateSwizzleNV w; +} VkViewportSwizzleNV; + +typedef struct VkPipelineViewportSwizzleStateCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkPipelineViewportSwizzleStateCreateFlagsNV flags; + uint32_t viewportCount; + const VkViewportSwizzleNV* pViewportSwizzles; +} VkPipelineViewportSwizzleStateCreateInfoNV; + + + +#define VK_EXT_discard_rectangles 1 +#define VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION 1 +#define VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME "VK_EXT_discard_rectangles" + + +typedef enum VkDiscardRectangleModeEXT { + VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT = 0, + VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT = 1, + VK_DISCARD_RECTANGLE_MODE_BEGIN_RANGE_EXT = VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT, + VK_DISCARD_RECTANGLE_MODE_END_RANGE_EXT = VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT, + VK_DISCARD_RECTANGLE_MODE_RANGE_SIZE_EXT = (VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT - VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT + 1), + VK_DISCARD_RECTANGLE_MODE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDiscardRectangleModeEXT; + +typedef VkFlags VkPipelineDiscardRectangleStateCreateFlagsEXT; + +typedef struct VkPhysicalDeviceDiscardRectanglePropertiesEXT { + VkStructureType sType; + void* pNext; + uint32_t maxDiscardRectangles; +} VkPhysicalDeviceDiscardRectanglePropertiesEXT; + +typedef struct VkPipelineDiscardRectangleStateCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkPipelineDiscardRectangleStateCreateFlagsEXT flags; + VkDiscardRectangleModeEXT discardRectangleMode; + uint32_t discardRectangleCount; + const VkRect2D* pDiscardRectangles; +} VkPipelineDiscardRectangleStateCreateInfoEXT; + + +typedef void (VKAPI_PTR *PFN_vkCmdSetDiscardRectangleEXT)(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetDiscardRectangleEXT( + VkCommandBuffer commandBuffer, + uint32_t firstDiscardRectangle, + uint32_t discardRectangleCount, + const VkRect2D* pDiscardRectangles); +#endif + +#define VK_EXT_conservative_rasterization 1 +#define VK_EXT_CONSERVATIVE_RASTERIZATION_SPEC_VERSION 1 +#define VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME "VK_EXT_conservative_rasterization" + + +typedef enum VkConservativeRasterizationModeEXT { + VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT = 0, + VK_CONSERVATIVE_RASTERIZATION_MODE_OVERESTIMATE_EXT = 1, + VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT = 2, + VK_CONSERVATIVE_RASTERIZATION_MODE_BEGIN_RANGE_EXT = VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT, + VK_CONSERVATIVE_RASTERIZATION_MODE_END_RANGE_EXT = VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT, + VK_CONSERVATIVE_RASTERIZATION_MODE_RANGE_SIZE_EXT = (VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT - VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT + 1), + VK_CONSERVATIVE_RASTERIZATION_MODE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkConservativeRasterizationModeEXT; + +typedef VkFlags VkPipelineRasterizationConservativeStateCreateFlagsEXT; + +typedef struct VkPhysicalDeviceConservativeRasterizationPropertiesEXT { + VkStructureType sType; + void* pNext; + float primitiveOverestimationSize; + float maxExtraPrimitiveOverestimationSize; + float extraPrimitiveOverestimationSizeGranularity; + VkBool32 primitiveUnderestimation; + VkBool32 conservativePointAndLineRasterization; + VkBool32 degenerateTrianglesRasterized; + VkBool32 degenerateLinesRasterized; + VkBool32 fullyCoveredFragmentShaderInputVariable; + VkBool32 conservativeRasterizationPostDepthCoverage; +} VkPhysicalDeviceConservativeRasterizationPropertiesEXT; + +typedef struct VkPipelineRasterizationConservativeStateCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkPipelineRasterizationConservativeStateCreateFlagsEXT flags; + VkConservativeRasterizationModeEXT conservativeRasterizationMode; + float extraPrimitiveOverestimationSize; +} VkPipelineRasterizationConservativeStateCreateInfoEXT; + + + +#define VK_EXT_swapchain_colorspace 1 +#define VK_EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION 3 +#define VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME "VK_EXT_swapchain_colorspace" + + +#define VK_EXT_hdr_metadata 1 +#define VK_EXT_HDR_METADATA_SPEC_VERSION 1 +#define VK_EXT_HDR_METADATA_EXTENSION_NAME "VK_EXT_hdr_metadata" + +typedef struct VkXYColorEXT { + float x; + float y; +} VkXYColorEXT; + +typedef struct VkHdrMetadataEXT { + VkStructureType sType; + const void* pNext; + VkXYColorEXT displayPrimaryRed; + VkXYColorEXT displayPrimaryGreen; + VkXYColorEXT displayPrimaryBlue; + VkXYColorEXT whitePoint; + float maxLuminance; + float minLuminance; + float maxContentLightLevel; + float maxFrameAverageLightLevel; +} VkHdrMetadataEXT; + + +typedef void (VKAPI_PTR *PFN_vkSetHdrMetadataEXT)(VkDevice device, uint32_t swapchainCount, const VkSwapchainKHR* pSwapchains, const VkHdrMetadataEXT* pMetadata); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkSetHdrMetadataEXT( + VkDevice device, + uint32_t swapchainCount, + const VkSwapchainKHR* pSwapchains, + const VkHdrMetadataEXT* pMetadata); +#endif + +#define VK_EXT_external_memory_dma_buf 1 +#define VK_EXT_EXTERNAL_MEMORY_DMA_BUF_SPEC_VERSION 1 +#define VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME "VK_EXT_external_memory_dma_buf" + + +#define VK_EXT_queue_family_foreign 1 +#define VK_EXT_QUEUE_FAMILY_FOREIGN_SPEC_VERSION 1 +#define VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME "VK_EXT_queue_family_foreign" +#define VK_QUEUE_FAMILY_FOREIGN_EXT (~0U-2) + + +#define VK_EXT_debug_utils 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugUtilsMessengerEXT) + +#define VK_EXT_DEBUG_UTILS_SPEC_VERSION 1 +#define VK_EXT_DEBUG_UTILS_EXTENSION_NAME "VK_EXT_debug_utils" + +typedef VkFlags VkDebugUtilsMessengerCallbackDataFlagsEXT; +typedef VkFlags VkDebugUtilsMessengerCreateFlagsEXT; + +typedef enum VkDebugUtilsMessageSeverityFlagBitsEXT { + VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT = 0x00000001, + VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT = 0x00000010, + VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT = 0x00000100, + VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT = 0x00001000, + VK_DEBUG_UTILS_MESSAGE_SEVERITY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDebugUtilsMessageSeverityFlagBitsEXT; +typedef VkFlags VkDebugUtilsMessageSeverityFlagsEXT; + +typedef enum VkDebugUtilsMessageTypeFlagBitsEXT { + VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT = 0x00000001, + VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT = 0x00000002, + VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT = 0x00000004, + VK_DEBUG_UTILS_MESSAGE_TYPE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDebugUtilsMessageTypeFlagBitsEXT; +typedef VkFlags VkDebugUtilsMessageTypeFlagsEXT; + +typedef struct VkDebugUtilsObjectNameInfoEXT { + VkStructureType sType; + const void* pNext; + VkObjectType objectType; + uint64_t objectHandle; + const char* pObjectName; +} VkDebugUtilsObjectNameInfoEXT; + +typedef struct VkDebugUtilsObjectTagInfoEXT { + VkStructureType sType; + const void* pNext; + VkObjectType objectType; + uint64_t objectHandle; + uint64_t tagName; + size_t tagSize; + const void* pTag; +} VkDebugUtilsObjectTagInfoEXT; + +typedef struct VkDebugUtilsLabelEXT { + VkStructureType sType; + const void* pNext; + const char* pLabelName; + float color[4]; +} VkDebugUtilsLabelEXT; + +typedef struct VkDebugUtilsMessengerCallbackDataEXT { + VkStructureType sType; + const void* pNext; + VkDebugUtilsMessengerCallbackDataFlagsEXT flags; + const char* pMessageIdName; + int32_t messageIdNumber; + const char* pMessage; + uint32_t queueLabelCount; + VkDebugUtilsLabelEXT* pQueueLabels; + uint32_t cmdBufLabelCount; + VkDebugUtilsLabelEXT* pCmdBufLabels; + uint32_t objectCount; + VkDebugUtilsObjectNameInfoEXT* pObjects; +} VkDebugUtilsMessengerCallbackDataEXT; + +typedef VkBool32 (VKAPI_PTR *PFN_vkDebugUtilsMessengerCallbackEXT)( + VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, + VkDebugUtilsMessageTypeFlagsEXT messageType, + const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, + void* pUserData); + +typedef struct VkDebugUtilsMessengerCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkDebugUtilsMessengerCreateFlagsEXT flags; + VkDebugUtilsMessageSeverityFlagsEXT messageSeverity; + VkDebugUtilsMessageTypeFlagsEXT messageType; + PFN_vkDebugUtilsMessengerCallbackEXT pfnUserCallback; + void* pUserData; +} VkDebugUtilsMessengerCreateInfoEXT; + + +typedef VkResult (VKAPI_PTR *PFN_vkSetDebugUtilsObjectNameEXT)(VkDevice device, const VkDebugUtilsObjectNameInfoEXT* pNameInfo); +typedef VkResult (VKAPI_PTR *PFN_vkSetDebugUtilsObjectTagEXT)(VkDevice device, const VkDebugUtilsObjectTagInfoEXT* pTagInfo); +typedef void (VKAPI_PTR *PFN_vkQueueBeginDebugUtilsLabelEXT)(VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo); +typedef void (VKAPI_PTR *PFN_vkQueueEndDebugUtilsLabelEXT)(VkQueue queue); +typedef void (VKAPI_PTR *PFN_vkQueueInsertDebugUtilsLabelEXT)(VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo); +typedef void (VKAPI_PTR *PFN_vkCmdBeginDebugUtilsLabelEXT)(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT* pLabelInfo); +typedef void (VKAPI_PTR *PFN_vkCmdEndDebugUtilsLabelEXT)(VkCommandBuffer commandBuffer); +typedef void (VKAPI_PTR *PFN_vkCmdInsertDebugUtilsLabelEXT)(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT* pLabelInfo); +typedef VkResult (VKAPI_PTR *PFN_vkCreateDebugUtilsMessengerEXT)(VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugUtilsMessengerEXT* pMessenger); +typedef void (VKAPI_PTR *PFN_vkDestroyDebugUtilsMessengerEXT)(VkInstance instance, VkDebugUtilsMessengerEXT messenger, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkSubmitDebugUtilsMessageEXT)(VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkSetDebugUtilsObjectNameEXT( + VkDevice device, + const VkDebugUtilsObjectNameInfoEXT* pNameInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkSetDebugUtilsObjectTagEXT( + VkDevice device, + const VkDebugUtilsObjectTagInfoEXT* pTagInfo); + +VKAPI_ATTR void VKAPI_CALL vkQueueBeginDebugUtilsLabelEXT( + VkQueue queue, + const VkDebugUtilsLabelEXT* pLabelInfo); + +VKAPI_ATTR void VKAPI_CALL vkQueueEndDebugUtilsLabelEXT( + VkQueue queue); + +VKAPI_ATTR void VKAPI_CALL vkQueueInsertDebugUtilsLabelEXT( + VkQueue queue, + const VkDebugUtilsLabelEXT* pLabelInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdBeginDebugUtilsLabelEXT( + VkCommandBuffer commandBuffer, + const VkDebugUtilsLabelEXT* pLabelInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdEndDebugUtilsLabelEXT( + VkCommandBuffer commandBuffer); + +VKAPI_ATTR void VKAPI_CALL vkCmdInsertDebugUtilsLabelEXT( + VkCommandBuffer commandBuffer, + const VkDebugUtilsLabelEXT* pLabelInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDebugUtilsMessengerEXT( + VkInstance instance, + const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDebugUtilsMessengerEXT* pMessenger); + +VKAPI_ATTR void VKAPI_CALL vkDestroyDebugUtilsMessengerEXT( + VkInstance instance, + VkDebugUtilsMessengerEXT messenger, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR void VKAPI_CALL vkSubmitDebugUtilsMessageEXT( + VkInstance instance, + VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, + VkDebugUtilsMessageTypeFlagsEXT messageTypes, + const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData); +#endif + +#define VK_EXT_sampler_filter_minmax 1 +#define VK_EXT_SAMPLER_FILTER_MINMAX_SPEC_VERSION 1 +#define VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME "VK_EXT_sampler_filter_minmax" + + +typedef enum VkSamplerReductionModeEXT { + VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT = 0, + VK_SAMPLER_REDUCTION_MODE_MIN_EXT = 1, + VK_SAMPLER_REDUCTION_MODE_MAX_EXT = 2, + VK_SAMPLER_REDUCTION_MODE_BEGIN_RANGE_EXT = VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT, + VK_SAMPLER_REDUCTION_MODE_END_RANGE_EXT = VK_SAMPLER_REDUCTION_MODE_MAX_EXT, + VK_SAMPLER_REDUCTION_MODE_RANGE_SIZE_EXT = (VK_SAMPLER_REDUCTION_MODE_MAX_EXT - VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT + 1), + VK_SAMPLER_REDUCTION_MODE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkSamplerReductionModeEXT; + +typedef struct VkSamplerReductionModeCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkSamplerReductionModeEXT reductionMode; +} VkSamplerReductionModeCreateInfoEXT; + +typedef struct VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT { + VkStructureType sType; + void* pNext; + VkBool32 filterMinmaxSingleComponentFormats; + VkBool32 filterMinmaxImageComponentMapping; +} VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT; + + + +#define VK_AMD_gpu_shader_int16 1 +#define VK_AMD_GPU_SHADER_INT16_SPEC_VERSION 1 +#define VK_AMD_GPU_SHADER_INT16_EXTENSION_NAME "VK_AMD_gpu_shader_int16" + + +#define VK_AMD_mixed_attachment_samples 1 +#define VK_AMD_MIXED_ATTACHMENT_SAMPLES_SPEC_VERSION 1 +#define VK_AMD_MIXED_ATTACHMENT_SAMPLES_EXTENSION_NAME "VK_AMD_mixed_attachment_samples" + + +#define VK_AMD_shader_fragment_mask 1 +#define VK_AMD_SHADER_FRAGMENT_MASK_SPEC_VERSION 1 +#define VK_AMD_SHADER_FRAGMENT_MASK_EXTENSION_NAME "VK_AMD_shader_fragment_mask" + + +#define VK_EXT_shader_stencil_export 1 +#define VK_EXT_SHADER_STENCIL_EXPORT_SPEC_VERSION 1 +#define VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME "VK_EXT_shader_stencil_export" + + +#define VK_EXT_sample_locations 1 +#define VK_EXT_SAMPLE_LOCATIONS_SPEC_VERSION 1 +#define VK_EXT_SAMPLE_LOCATIONS_EXTENSION_NAME "VK_EXT_sample_locations" + +typedef struct VkSampleLocationEXT { + float x; + float y; +} VkSampleLocationEXT; + +typedef struct VkSampleLocationsInfoEXT { + VkStructureType sType; + const void* pNext; + VkSampleCountFlagBits sampleLocationsPerPixel; + VkExtent2D sampleLocationGridSize; + uint32_t sampleLocationsCount; + const VkSampleLocationEXT* pSampleLocations; +} VkSampleLocationsInfoEXT; + +typedef struct VkAttachmentSampleLocationsEXT { + uint32_t attachmentIndex; + VkSampleLocationsInfoEXT sampleLocationsInfo; +} VkAttachmentSampleLocationsEXT; + +typedef struct VkSubpassSampleLocationsEXT { + uint32_t subpassIndex; + VkSampleLocationsInfoEXT sampleLocationsInfo; +} VkSubpassSampleLocationsEXT; + +typedef struct VkRenderPassSampleLocationsBeginInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t attachmentInitialSampleLocationsCount; + const VkAttachmentSampleLocationsEXT* pAttachmentInitialSampleLocations; + uint32_t postSubpassSampleLocationsCount; + const VkSubpassSampleLocationsEXT* pPostSubpassSampleLocations; +} VkRenderPassSampleLocationsBeginInfoEXT; + +typedef struct VkPipelineSampleLocationsStateCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkBool32 sampleLocationsEnable; + VkSampleLocationsInfoEXT sampleLocationsInfo; +} VkPipelineSampleLocationsStateCreateInfoEXT; + +typedef struct VkPhysicalDeviceSampleLocationsPropertiesEXT { + VkStructureType sType; + void* pNext; + VkSampleCountFlags sampleLocationSampleCounts; + VkExtent2D maxSampleLocationGridSize; + float sampleLocationCoordinateRange[2]; + uint32_t sampleLocationSubPixelBits; + VkBool32 variableSampleLocations; +} VkPhysicalDeviceSampleLocationsPropertiesEXT; + +typedef struct VkMultisamplePropertiesEXT { + VkStructureType sType; + void* pNext; + VkExtent2D maxSampleLocationGridSize; +} VkMultisamplePropertiesEXT; + + +typedef void (VKAPI_PTR *PFN_vkCmdSetSampleLocationsEXT)(VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT* pSampleLocationsInfo); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT)(VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT* pMultisampleProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetSampleLocationsEXT( + VkCommandBuffer commandBuffer, + const VkSampleLocationsInfoEXT* pSampleLocationsInfo); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMultisamplePropertiesEXT( + VkPhysicalDevice physicalDevice, + VkSampleCountFlagBits samples, + VkMultisamplePropertiesEXT* pMultisampleProperties); +#endif + +#define VK_EXT_blend_operation_advanced 1 +#define VK_EXT_BLEND_OPERATION_ADVANCED_SPEC_VERSION 2 +#define VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME "VK_EXT_blend_operation_advanced" + + +typedef enum VkBlendOverlapEXT { + VK_BLEND_OVERLAP_UNCORRELATED_EXT = 0, + VK_BLEND_OVERLAP_DISJOINT_EXT = 1, + VK_BLEND_OVERLAP_CONJOINT_EXT = 2, + VK_BLEND_OVERLAP_BEGIN_RANGE_EXT = VK_BLEND_OVERLAP_UNCORRELATED_EXT, + VK_BLEND_OVERLAP_END_RANGE_EXT = VK_BLEND_OVERLAP_CONJOINT_EXT, + VK_BLEND_OVERLAP_RANGE_SIZE_EXT = (VK_BLEND_OVERLAP_CONJOINT_EXT - VK_BLEND_OVERLAP_UNCORRELATED_EXT + 1), + VK_BLEND_OVERLAP_MAX_ENUM_EXT = 0x7FFFFFFF +} VkBlendOverlapEXT; + +typedef struct VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 advancedBlendCoherentOperations; +} VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT; + +typedef struct VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT { + VkStructureType sType; + void* pNext; + uint32_t advancedBlendMaxColorAttachments; + VkBool32 advancedBlendIndependentBlend; + VkBool32 advancedBlendNonPremultipliedSrcColor; + VkBool32 advancedBlendNonPremultipliedDstColor; + VkBool32 advancedBlendCorrelatedOverlap; + VkBool32 advancedBlendAllOperations; +} VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT; + +typedef struct VkPipelineColorBlendAdvancedStateCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkBool32 srcPremultiplied; + VkBool32 dstPremultiplied; + VkBlendOverlapEXT blendOverlap; +} VkPipelineColorBlendAdvancedStateCreateInfoEXT; + + + +#define VK_NV_fragment_coverage_to_color 1 +#define VK_NV_FRAGMENT_COVERAGE_TO_COLOR_SPEC_VERSION 1 +#define VK_NV_FRAGMENT_COVERAGE_TO_COLOR_EXTENSION_NAME "VK_NV_fragment_coverage_to_color" + +typedef VkFlags VkPipelineCoverageToColorStateCreateFlagsNV; + +typedef struct VkPipelineCoverageToColorStateCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkPipelineCoverageToColorStateCreateFlagsNV flags; + VkBool32 coverageToColorEnable; + uint32_t coverageToColorLocation; +} VkPipelineCoverageToColorStateCreateInfoNV; + + + +#define VK_NV_framebuffer_mixed_samples 1 +#define VK_NV_FRAMEBUFFER_MIXED_SAMPLES_SPEC_VERSION 1 +#define VK_NV_FRAMEBUFFER_MIXED_SAMPLES_EXTENSION_NAME "VK_NV_framebuffer_mixed_samples" + + +typedef enum VkCoverageModulationModeNV { + VK_COVERAGE_MODULATION_MODE_NONE_NV = 0, + VK_COVERAGE_MODULATION_MODE_RGB_NV = 1, + VK_COVERAGE_MODULATION_MODE_ALPHA_NV = 2, + VK_COVERAGE_MODULATION_MODE_RGBA_NV = 3, + VK_COVERAGE_MODULATION_MODE_BEGIN_RANGE_NV = VK_COVERAGE_MODULATION_MODE_NONE_NV, + VK_COVERAGE_MODULATION_MODE_END_RANGE_NV = VK_COVERAGE_MODULATION_MODE_RGBA_NV, + VK_COVERAGE_MODULATION_MODE_RANGE_SIZE_NV = (VK_COVERAGE_MODULATION_MODE_RGBA_NV - VK_COVERAGE_MODULATION_MODE_NONE_NV + 1), + VK_COVERAGE_MODULATION_MODE_MAX_ENUM_NV = 0x7FFFFFFF +} VkCoverageModulationModeNV; + +typedef VkFlags VkPipelineCoverageModulationStateCreateFlagsNV; + +typedef struct VkPipelineCoverageModulationStateCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkPipelineCoverageModulationStateCreateFlagsNV flags; + VkCoverageModulationModeNV coverageModulationMode; + VkBool32 coverageModulationTableEnable; + uint32_t coverageModulationTableCount; + const float* pCoverageModulationTable; +} VkPipelineCoverageModulationStateCreateInfoNV; + + + +#define VK_NV_fill_rectangle 1 +#define VK_NV_FILL_RECTANGLE_SPEC_VERSION 1 +#define VK_NV_FILL_RECTANGLE_EXTENSION_NAME "VK_NV_fill_rectangle" + + +#define VK_EXT_post_depth_coverage 1 +#define VK_EXT_POST_DEPTH_COVERAGE_SPEC_VERSION 1 +#define VK_EXT_POST_DEPTH_COVERAGE_EXTENSION_NAME "VK_EXT_post_depth_coverage" + + +#define VK_EXT_validation_cache 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkValidationCacheEXT) + +#define VK_EXT_VALIDATION_CACHE_SPEC_VERSION 1 +#define VK_EXT_VALIDATION_CACHE_EXTENSION_NAME "VK_EXT_validation_cache" +#define VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT + + +typedef enum VkValidationCacheHeaderVersionEXT { + VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT = 1, + VK_VALIDATION_CACHE_HEADER_VERSION_BEGIN_RANGE_EXT = VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT, + VK_VALIDATION_CACHE_HEADER_VERSION_END_RANGE_EXT = VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT, + VK_VALIDATION_CACHE_HEADER_VERSION_RANGE_SIZE_EXT = (VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT - VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT + 1), + VK_VALIDATION_CACHE_HEADER_VERSION_MAX_ENUM_EXT = 0x7FFFFFFF +} VkValidationCacheHeaderVersionEXT; + +typedef VkFlags VkValidationCacheCreateFlagsEXT; + +typedef struct VkValidationCacheCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkValidationCacheCreateFlagsEXT flags; + size_t initialDataSize; + const void* pInitialData; +} VkValidationCacheCreateInfoEXT; + +typedef struct VkShaderModuleValidationCacheCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkValidationCacheEXT validationCache; +} VkShaderModuleValidationCacheCreateInfoEXT; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateValidationCacheEXT)(VkDevice device, const VkValidationCacheCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkValidationCacheEXT* pValidationCache); +typedef void (VKAPI_PTR *PFN_vkDestroyValidationCacheEXT)(VkDevice device, VkValidationCacheEXT validationCache, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkMergeValidationCachesEXT)(VkDevice device, VkValidationCacheEXT dstCache, uint32_t srcCacheCount, const VkValidationCacheEXT* pSrcCaches); +typedef VkResult (VKAPI_PTR *PFN_vkGetValidationCacheDataEXT)(VkDevice device, VkValidationCacheEXT validationCache, size_t* pDataSize, void* pData); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateValidationCacheEXT( + VkDevice device, + const VkValidationCacheCreateInfoEXT* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkValidationCacheEXT* pValidationCache); + +VKAPI_ATTR void VKAPI_CALL vkDestroyValidationCacheEXT( + VkDevice device, + VkValidationCacheEXT validationCache, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkMergeValidationCachesEXT( + VkDevice device, + VkValidationCacheEXT dstCache, + uint32_t srcCacheCount, + const VkValidationCacheEXT* pSrcCaches); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetValidationCacheDataEXT( + VkDevice device, + VkValidationCacheEXT validationCache, + size_t* pDataSize, + void* pData); +#endif + +#define VK_EXT_shader_viewport_index_layer 1 +#define VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_SPEC_VERSION 1 +#define VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME "VK_EXT_shader_viewport_index_layer" + + +#define VK_EXT_global_priority 1 +#define VK_EXT_GLOBAL_PRIORITY_SPEC_VERSION 2 +#define VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME "VK_EXT_global_priority" + + +typedef enum VkQueueGlobalPriorityEXT { + VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT = 128, + VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT = 256, + VK_QUEUE_GLOBAL_PRIORITY_HIGH_EXT = 512, + VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT = 1024, + VK_QUEUE_GLOBAL_PRIORITY_BEGIN_RANGE_EXT = VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT, + VK_QUEUE_GLOBAL_PRIORITY_END_RANGE_EXT = VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT, + VK_QUEUE_GLOBAL_PRIORITY_RANGE_SIZE_EXT = (VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT - VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT + 1), + VK_QUEUE_GLOBAL_PRIORITY_MAX_ENUM_EXT = 0x7FFFFFFF +} VkQueueGlobalPriorityEXT; + +typedef struct VkDeviceQueueGlobalPriorityCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkQueueGlobalPriorityEXT globalPriority; +} VkDeviceQueueGlobalPriorityCreateInfoEXT; + + + +#define VK_EXT_external_memory_host 1 +#define VK_EXT_EXTERNAL_MEMORY_HOST_SPEC_VERSION 1 +#define VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME "VK_EXT_external_memory_host" + +typedef struct VkImportMemoryHostPointerInfoEXT { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagBits handleType; + void* pHostPointer; +} VkImportMemoryHostPointerInfoEXT; + +typedef struct VkMemoryHostPointerPropertiesEXT { + VkStructureType sType; + void* pNext; + uint32_t memoryTypeBits; +} VkMemoryHostPointerPropertiesEXT; + +typedef struct VkPhysicalDeviceExternalMemoryHostPropertiesEXT { + VkStructureType sType; + void* pNext; + VkDeviceSize minImportedHostPointerAlignment; +} VkPhysicalDeviceExternalMemoryHostPropertiesEXT; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryHostPointerPropertiesEXT)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHostPointer, VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryHostPointerPropertiesEXT( + VkDevice device, + VkExternalMemoryHandleTypeFlagBits handleType, + const void* pHostPointer, + VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties); +#endif + +#define VK_AMD_buffer_marker 1 +#define VK_AMD_BUFFER_MARKER_SPEC_VERSION 1 +#define VK_AMD_BUFFER_MARKER_EXTENSION_NAME "VK_AMD_buffer_marker" + +typedef void (VKAPI_PTR *PFN_vkCmdWriteBufferMarkerAMD)(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdWriteBufferMarkerAMD( + VkCommandBuffer commandBuffer, + VkPipelineStageFlagBits pipelineStage, + VkBuffer dstBuffer, + VkDeviceSize dstOffset, + uint32_t marker); +#endif + +#define VK_EXT_vertex_attribute_divisor 1 +#define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION 1 +#define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME "VK_EXT_vertex_attribute_divisor" + +typedef struct VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT { + VkStructureType sType; + void* pNext; + uint32_t maxVertexAttribDivisor; +} VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT; + +typedef struct VkVertexInputBindingDivisorDescriptionEXT { + uint32_t binding; + uint32_t divisor; +} VkVertexInputBindingDivisorDescriptionEXT; + +typedef struct VkPipelineVertexInputDivisorStateCreateInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t vertexBindingDivisorCount; + const VkVertexInputBindingDivisorDescriptionEXT* pVertexBindingDivisors; +} VkPipelineVertexInputDivisorStateCreateInfoEXT; + + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/vulkan/vulkan_win32.h b/include/vulkan/vulkan_win32.h new file mode 100644 index 00000000..6a85409e --- /dev/null +++ b/include/vulkan/vulkan_win32.h @@ -0,0 +1,276 @@ +#ifndef VULKAN_WIN32_H_ +#define VULKAN_WIN32_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_KHR_win32_surface 1 +#define VK_KHR_WIN32_SURFACE_SPEC_VERSION 6 +#define VK_KHR_WIN32_SURFACE_EXTENSION_NAME "VK_KHR_win32_surface" + +typedef VkFlags VkWin32SurfaceCreateFlagsKHR; + +typedef struct VkWin32SurfaceCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkWin32SurfaceCreateFlagsKHR flags; + HINSTANCE hinstance; + HWND hwnd; +} VkWin32SurfaceCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateWin32SurfaceKHR)(VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); +typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateWin32SurfaceKHR( + VkInstance instance, + const VkWin32SurfaceCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); + +VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWin32PresentationSupportKHR( + VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex); +#endif + +#define VK_KHR_external_memory_win32 1 +#define VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1 +#define VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_KHR_external_memory_win32" + +typedef struct VkImportMemoryWin32HandleInfoKHR { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagBits handleType; + HANDLE handle; + LPCWSTR name; +} VkImportMemoryWin32HandleInfoKHR; + +typedef struct VkExportMemoryWin32HandleInfoKHR { + VkStructureType sType; + const void* pNext; + const SECURITY_ATTRIBUTES* pAttributes; + DWORD dwAccess; + LPCWSTR name; +} VkExportMemoryWin32HandleInfoKHR; + +typedef struct VkMemoryWin32HandlePropertiesKHR { + VkStructureType sType; + void* pNext; + uint32_t memoryTypeBits; +} VkMemoryWin32HandlePropertiesKHR; + +typedef struct VkMemoryGetWin32HandleInfoKHR { + VkStructureType sType; + const void* pNext; + VkDeviceMemory memory; + VkExternalMemoryHandleTypeFlagBits handleType; +} VkMemoryGetWin32HandleInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleKHR)(VkDevice device, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle); +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandlePropertiesKHR)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleKHR( + VkDevice device, + const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, + HANDLE* pHandle); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandlePropertiesKHR( + VkDevice device, + VkExternalMemoryHandleTypeFlagBits handleType, + HANDLE handle, + VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties); +#endif + +#define VK_KHR_win32_keyed_mutex 1 +#define VK_KHR_WIN32_KEYED_MUTEX_SPEC_VERSION 1 +#define VK_KHR_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_KHR_win32_keyed_mutex" + +typedef struct VkWin32KeyedMutexAcquireReleaseInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t acquireCount; + const VkDeviceMemory* pAcquireSyncs; + const uint64_t* pAcquireKeys; + const uint32_t* pAcquireTimeouts; + uint32_t releaseCount; + const VkDeviceMemory* pReleaseSyncs; + const uint64_t* pReleaseKeys; +} VkWin32KeyedMutexAcquireReleaseInfoKHR; + + + +#define VK_KHR_external_semaphore_win32 1 +#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION 1 +#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME "VK_KHR_external_semaphore_win32" + +typedef struct VkImportSemaphoreWin32HandleInfoKHR { + VkStructureType sType; + const void* pNext; + VkSemaphore semaphore; + VkSemaphoreImportFlags flags; + VkExternalSemaphoreHandleTypeFlagBits handleType; + HANDLE handle; + LPCWSTR name; +} VkImportSemaphoreWin32HandleInfoKHR; + +typedef struct VkExportSemaphoreWin32HandleInfoKHR { + VkStructureType sType; + const void* pNext; + const SECURITY_ATTRIBUTES* pAttributes; + DWORD dwAccess; + LPCWSTR name; +} VkExportSemaphoreWin32HandleInfoKHR; + +typedef struct VkD3D12FenceSubmitInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t waitSemaphoreValuesCount; + const uint64_t* pWaitSemaphoreValues; + uint32_t signalSemaphoreValuesCount; + const uint64_t* pSignalSemaphoreValues; +} VkD3D12FenceSubmitInfoKHR; + +typedef struct VkSemaphoreGetWin32HandleInfoKHR { + VkStructureType sType; + const void* pNext; + VkSemaphore semaphore; + VkExternalSemaphoreHandleTypeFlagBits handleType; +} VkSemaphoreGetWin32HandleInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreWin32HandleKHR)(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo); +typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreWin32HandleKHR)(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreWin32HandleKHR( + VkDevice device, + const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreWin32HandleKHR( + VkDevice device, + const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, + HANDLE* pHandle); +#endif + +#define VK_KHR_external_fence_win32 1 +#define VK_KHR_EXTERNAL_FENCE_WIN32_SPEC_VERSION 1 +#define VK_KHR_EXTERNAL_FENCE_WIN32_EXTENSION_NAME "VK_KHR_external_fence_win32" + +typedef struct VkImportFenceWin32HandleInfoKHR { + VkStructureType sType; + const void* pNext; + VkFence fence; + VkFenceImportFlags flags; + VkExternalFenceHandleTypeFlagBits handleType; + HANDLE handle; + LPCWSTR name; +} VkImportFenceWin32HandleInfoKHR; + +typedef struct VkExportFenceWin32HandleInfoKHR { + VkStructureType sType; + const void* pNext; + const SECURITY_ATTRIBUTES* pAttributes; + DWORD dwAccess; + LPCWSTR name; +} VkExportFenceWin32HandleInfoKHR; + +typedef struct VkFenceGetWin32HandleInfoKHR { + VkStructureType sType; + const void* pNext; + VkFence fence; + VkExternalFenceHandleTypeFlagBits handleType; +} VkFenceGetWin32HandleInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkImportFenceWin32HandleKHR)(VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo); +typedef VkResult (VKAPI_PTR *PFN_vkGetFenceWin32HandleKHR)(VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkImportFenceWin32HandleKHR( + VkDevice device, + const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceWin32HandleKHR( + VkDevice device, + const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, + HANDLE* pHandle); +#endif + +#define VK_NV_external_memory_win32 1 +#define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1 +#define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32" + +typedef struct VkImportMemoryWin32HandleInfoNV { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagsNV handleType; + HANDLE handle; +} VkImportMemoryWin32HandleInfoNV; + +typedef struct VkExportMemoryWin32HandleInfoNV { + VkStructureType sType; + const void* pNext; + const SECURITY_ATTRIBUTES* pAttributes; + DWORD dwAccess; +} VkExportMemoryWin32HandleInfoNV; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleNV)(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleNV( + VkDevice device, + VkDeviceMemory memory, + VkExternalMemoryHandleTypeFlagsNV handleType, + HANDLE* pHandle); +#endif + +#define VK_NV_win32_keyed_mutex 1 +#define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1 +#define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex" + +typedef struct VkWin32KeyedMutexAcquireReleaseInfoNV { + VkStructureType sType; + const void* pNext; + uint32_t acquireCount; + const VkDeviceMemory* pAcquireSyncs; + const uint64_t* pAcquireKeys; + const uint32_t* pAcquireTimeoutMilliseconds; + uint32_t releaseCount; + const VkDeviceMemory* pReleaseSyncs; + const uint64_t* pReleaseKeys; +} VkWin32KeyedMutexAcquireReleaseInfoNV; + + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/vulkan/vulkan_xcb.h b/include/vulkan/vulkan_xcb.h new file mode 100644 index 00000000..ba036006 --- /dev/null +++ b/include/vulkan/vulkan_xcb.h @@ -0,0 +1,66 @@ +#ifndef VULKAN_XCB_H_ +#define VULKAN_XCB_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_KHR_xcb_surface 1 +#define VK_KHR_XCB_SURFACE_SPEC_VERSION 6 +#define VK_KHR_XCB_SURFACE_EXTENSION_NAME "VK_KHR_xcb_surface" + +typedef VkFlags VkXcbSurfaceCreateFlagsKHR; + +typedef struct VkXcbSurfaceCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkXcbSurfaceCreateFlagsKHR flags; + xcb_connection_t* connection; + xcb_window_t window; +} VkXcbSurfaceCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateXcbSurfaceKHR)(VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); +typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR( + VkInstance instance, + const VkXcbSurfaceCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); + +VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXcbPresentationSupportKHR( + VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + xcb_connection_t* connection, + xcb_visualid_t visual_id); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/wrappers/buffer.h b/include/wrappers/buffer.h index 49eb88bf..f4a897b1 100644 --- a/include/wrappers/buffer.h +++ b/include/wrappers/buffer.h @@ -70,8 +70,7 @@ namespace Anvil BUFFER_CALLBACK_ID_COUNT }; - class Buffer : public std::enable_shared_from_this, - public CallbacksSupportProvider, + class Buffer : public CallbacksSupportProvider, public DebugMarkerSupportProvider, public MTSafetySupportProvider { @@ -92,12 +91,12 @@ namespace Anvil * @param in_usage_flags Usage flags to set in the VkBufferCreateInfo descriptor, passed to * to the vkCreateBuffer() call. **/ - static std::shared_ptr create_nonsparse(std::weak_ptr in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - VkSharingMode in_queue_sharing_mode, - VkBufferUsageFlags in_usage_flags, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::BufferUniquePtr create_nonsparse(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_queue_sharing_mode, + VkBufferUsageFlags in_usage_flags, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Initializes a new NON-SPARSE buffer object using user-specified parameters. * @@ -118,14 +117,14 @@ namespace Anvil * @param in_opt_client_data if not nullptr, exactly @param in_size bytes will be copied to the allocated * buffer memory. **/ - static std::shared_ptr create_nonsparse(std::weak_ptr in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - VkSharingMode in_queue_sharing_mode, - VkBufferUsageFlags in_usage_flags, - Anvil::MemoryFeatureFlags in_memory_features, - const void* in_opt_client_data, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::BufferUniquePtr create_nonsparse(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_queue_sharing_mode, + VkBufferUsageFlags in_usage_flags, + Anvil::MemoryFeatureFlags in_memory_features, + const void* in_opt_client_data, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Creates a new Buffer wrapper instance. The new NON-SPARSE buffer will reuse a region of the specified * buffer's storage, instead of creating one's own. @@ -138,9 +137,9 @@ namespace Anvil * @param in_start_offset Memory region's start offset. * @param in_size Size of the memory region to "claim". **/ - static std::shared_ptr create_nonsparse(std::shared_ptr in_parent_nonsparse_buffer_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size); + static Anvil::BufferUniquePtr create_nonsparse(Anvil::Buffer* in_parent_nonsparse_buffer_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size); /** Initializes a new SPARSE buffer object using user-specified parameters. * @@ -157,19 +156,19 @@ namespace Anvil * to the vkCreateBuffer() call. * @param in_residency_scope Scope of residency to support for the buffer. **/ - static std::shared_ptr create_sparse(std::weak_ptr in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - VkSharingMode in_queue_sharing_mode, - VkBufferUsageFlags in_usage_flags, - Anvil::SparseResidencyScope in_residency_scope, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::BufferUniquePtr create_sparse(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_queue_sharing_mode, + VkBufferUsageFlags in_usage_flags, + Anvil::SparseResidencyScope in_residency_scope, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destroys the Vulkan objects and unregister the Buffer instance from Object Tracker. */ virtual ~Buffer(); /** Returns the lowest-level Buffer instance which stores the data exposed by this Buffer instance. */ - std::shared_ptr get_base_buffer(); + const Anvil::Buffer* get_base_buffer(); /** Returns the encapsulated raw Vulkan buffer handle * @@ -198,7 +197,7 @@ namespace Anvil * * Note that resident sparse buffers may have multiple memory blocks assigned. **/ - std::shared_ptr get_memory_block(uint32_t in_n_memory_block); + Anvil::MemoryBlock* get_memory_block(uint32_t in_n_memory_block); /** Returns memory requirements for the buffer */ VkMemoryRequirements get_memory_requirements() const @@ -232,7 +231,7 @@ namespace Anvil } /** Returns a pointer to the parent buffer, if one was specified at creation time */ - std::shared_ptr get_parent_buffer_ptr() const + Anvil::Buffer* get_parent_buffer_ptr() const { return m_parent_buffer_ptr; } @@ -293,6 +292,8 @@ namespace Anvil * executed either on the transfer queue (if available), or on the universal queue. Afterward, the staging buffer * will be released. * + * This function must not be used to read data from buffers, whose memory backing comes from a multi-instance heap. + * * This function blocks until the transfer completes. * * @param in_start_offset As per description. Must be smaller than the underlying memory object's size. @@ -302,9 +303,13 @@ namespace Anvil * * @return true if the operation was successful, false otherwise. **/ - bool read(VkDeviceSize in_start_offset, - VkDeviceSize in_size, - void* in_out_result_ptr); + bool read(VkDeviceSize in_start_offset, + VkDeviceSize in_size, + void* in_out_result_ptr); + bool read(VkDeviceSize in_start_offset, + VkDeviceSize in_size, + const Anvil::PhysicalDevice* in_physical_device_ptr, + void* out_result_ptr); /** Attaches a memory block to the buffer object. * @@ -314,12 +319,14 @@ namespace Anvil * This function can only be used for NON-SPARSE buffers. Calling this function for sparse buffers will * result in an assertion failure. * - * @param in_memory_block_ptr Memory block to attach to the buffer object. Must not be NULL. + * @param in_memory_block_ptr Memory block to attach to the buffer object. Must not be NULL. + * @param in_memory_block_owned_by_buffer TODO * * @return true if successful, false otherwise. **/ - bool set_nonsparse_memory(std::shared_ptr in_memory_block_ptr); - + bool set_nonsparse_memory(MemoryBlockUniquePtr in_memory_block_ptr); + bool set_nonsparse_memory(MemoryBlock* in_memory_block_ptr, + bool in_memory_block_owned_by_buffer); /** Writes @param in_size bytes, starting from @param in_start_offset, into the wrapped memory object. * @@ -332,6 +339,10 @@ namespace Anvil * transfer the new contents to the target buffer. The operation will be submitted via a transfer queue, if one * is available, or a universal queue otherwise. * + * This function must not be used to read data from buffers, whose memory backing comes from a multi-instance heap. + * + * The function prototype without @param in_physical_device_ptr argument should be used for single-GPU devices only. + * * If the buffer instance uses an exclusive sharing mode and supports more than just one queue family type AND memory * backing the buffer is not mappable, you MUST specify a queue instance that should be used to perform a buffer->buffer * copy op. The queue MUST support transfer ops. @@ -345,28 +356,33 @@ namespace Anvil * * @return true if the operation was successful, false otherwise. **/ - bool write(VkDeviceSize in_start_offset, - VkDeviceSize in_size, - const void* in_data, - std::shared_ptr in_opt_queue_ptr = nullptr); + bool write(VkDeviceSize in_start_offset, + VkDeviceSize in_size, + const void* in_data, + Anvil::Queue* in_opt_queue_ptr = nullptr); + bool write(VkDeviceSize in_start_offset, + VkDeviceSize in_size, + const Anvil::PhysicalDevice* in_physical_device_ptr, + const void* in_data, + Anvil::Queue* in_opt_queue_ptr = nullptr); private: /* Private functions */ - explicit Buffer(std::weak_ptr in_device_ptr, + explicit Buffer(const Anvil::BaseDevice* in_device_ptr, VkDeviceSize in_size, QueueFamilyBits in_queue_families, VkSharingMode in_queue_sharing_mode, VkBufferUsageFlags in_usage_flags, Anvil::SparseResidencyScope in_residency_scope, bool in_mt_safe); - explicit Buffer(std::weak_ptr in_device_ptr, + explicit Buffer(const Anvil::BaseDevice* in_device_ptr, VkDeviceSize in_size, QueueFamilyBits in_queue_families, VkSharingMode in_queue_sharing_mode, VkBufferUsageFlags in_usage_flags, MemoryFeatureFlags in_memory_features, bool in_mt_safe); - explicit Buffer(std::shared_ptr in_parent_buffer_ptr, + explicit Buffer(Anvil::Buffer* in_parent_buffer_ptr, VkDeviceSize in_start_offset, VkDeviceSize in_size); @@ -376,29 +392,34 @@ namespace Anvil void create_buffer (Anvil::QueueFamilyBits in_queue_families, VkSharingMode in_sharing_mode, VkDeviceSize in_size); - bool set_memory_sparse(std::shared_ptr in_memory_block_ptr, + bool set_memory_sparse(MemoryBlock* in_memory_block_ptr, + bool in_memory_block_owned_by_buffer, VkDeviceSize in_memory_start_offset, VkDeviceSize in_start_offset, VkDeviceSize in_size); + bool set_memory_nonsparse_internal(MemoryBlockUniquePtr in_memory_block_ptr); + /* Private members */ VkBuffer m_buffer; VkMemoryRequirements m_buffer_memory_reqs; VkDeviceSize m_buffer_size; - std::weak_ptr m_device_ptr; + const Anvil::BaseDevice* m_device_ptr; bool m_is_sparse; - std::shared_ptr m_memory_block_ptr; // only used by non-sparse buffers + Anvil::MemoryBlock* m_memory_block_ptr; // only used by non-sparse buffers std::unique_ptr m_page_tracker_ptr; // only used by sparse buffers - std::shared_ptr m_parent_buffer_ptr; + Anvil::Buffer* m_parent_buffer_ptr; Anvil::QueueFamilyBits m_queue_families; Anvil::SparseResidencyScope m_residency_scope; VkSharingMode m_sharing_mode; VkDeviceSize m_start_offset; + std::vector m_owned_memory_blocks; + VkBufferCreateFlagsVariable(m_create_flags); VkBufferUsageFlagsVariable (m_usage_flags); - friend class Anvil::Queue; /* set_sparse_memory() */ + friend class Anvil::Queue; /* set_memory_sparse() */ }; }; /* namespace Anvil */ diff --git a/include/wrappers/buffer_view.h b/include/wrappers/buffer_view.h index 91f25eb4..52b5c4ce 100644 --- a/include/wrappers/buffer_view.h +++ b/include/wrappers/buffer_view.h @@ -44,12 +44,12 @@ namespace Anvil /** Creates a single Vulkan buffer view instance and registers the object in Object Tracker. * For argument documentation, please see Vulkan API specification. */ - static std::shared_ptr create(std::weak_ptr in_device_ptr, - std::shared_ptr in_buffer_ptr, - VkFormat in_format, - VkDeviceSize in_start_offset, - VkDeviceSize in_size, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static BufferViewUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + Anvil::Buffer* in_buffer_ptr, + VkFormat in_format, + VkDeviceSize in_start_offset, + VkDeviceSize in_size, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destructor */ virtual ~BufferView(); @@ -73,7 +73,7 @@ namespace Anvil } /** Returns pointer to the parent buffer instance */ - std::shared_ptr get_parent_buffer() const + Anvil::Buffer* get_parent_buffer() const { return m_buffer_ptr; } @@ -92,23 +92,23 @@ namespace Anvil private: /* Private functions */ - BufferView(std::weak_ptr in_device_ptr, - std::shared_ptr in_buffer_ptr, - VkFormat in_format, - VkDeviceSize in_start_offset, - VkDeviceSize in_size, - bool in_mt_safe); + BufferView(const Anvil::BaseDevice* in_device_ptr, + Anvil::Buffer* in_buffer_ptr, + VkFormat in_format, + VkDeviceSize in_start_offset, + VkDeviceSize in_size, + bool in_mt_safe); BufferView (const BufferView&); BufferView& operator=(const BufferView&); /* Private variables */ - std::shared_ptr m_buffer_ptr; - VkBufferView m_buffer_view; - std::weak_ptr m_device_ptr; - VkFormat m_format; - VkDeviceSize m_size; - VkDeviceSize m_start_offset; + Anvil::Buffer* m_buffer_ptr; + VkBufferView m_buffer_view; + const Anvil::BaseDevice* m_device_ptr; + VkFormat m_format; + VkDeviceSize m_size; + VkDeviceSize m_start_offset; }; }; /* namespace Anvil */ diff --git a/include/wrappers/command_buffer.h b/include/wrappers/command_buffer.h index 90885fb5..f911b83e 100644 --- a/include/wrappers/command_buffer.h +++ b/include/wrappers/command_buffer.h @@ -162,11 +162,12 @@ namespace Anvil */ typedef struct BeginRenderPassCommand : public Command { - std::vector clear_values; - VkSubpassContents contents; - std::shared_ptr fbo_ptr; - VkRect2D render_area; - std::shared_ptr render_pass_ptr; + std::vector clear_values; + VkSubpassContents contents; + Anvil::Framebuffer* fbo_ptr; + const Anvil::PhysicalDevice* physical_device_ptr; + VkRect2D render_area; + Anvil::RenderPass* render_pass_ptr; /** Constructor. * @@ -174,12 +175,13 @@ namespace Anvil * * Arguments as per Vulkan API. **/ - explicit BeginRenderPassCommand(uint32_t in_n_clear_values, - const VkClearValue* in_clear_value_ptrs, - std::shared_ptr in_fbo_ptr, - const VkRect2D& in_render_area, - std::shared_ptr in_render_pass_ptr, - VkSubpassContents in_contents); + explicit BeginRenderPassCommand(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + const Anvil::PhysicalDevice* in_physical_device_ptr, + const VkRect2D& in_render_area, + Anvil::RenderPass* in_render_pass_ptr, + VkSubpassContents in_contents); /** Destructor. * @@ -302,6 +304,8 @@ namespace Anvil public: /* Public functions */ + virtual ~CommandBufferBase(); + /* Disables internal command stashing which is enbled for builds created with * STORE_COMMAND_BUFFER_COMMANDS enabled. * @@ -333,7 +337,7 @@ namespace Anvil } /** Returns the parent command pool */ - std::weak_ptr get_parent_command_pool() const + Anvil::CommandPool* get_parent_command_pool() const { return m_parent_command_pool_ptr; } @@ -349,9 +353,9 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_begin_query(std::shared_ptr in_query_pool_ptr, - Anvil::QueryIndex in_entry, - VkQueryControlFlags in_flags); + bool record_begin_query(Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_entry, + VkQueryControlFlags in_flags); /** Issues a vkCmdBindDescriptorSets() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -364,13 +368,13 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_bind_descriptor_sets(VkPipelineBindPoint in_pipeline_bind_point, - std::shared_ptr in_layout_ptr, - uint32_t in_first_set, - uint32_t in_set_count, - std::shared_ptr* in_descriptor_set_ptrs, - uint32_t in_dynamic_offset_count, - const uint32_t* in_dynamic_offset_ptrs); + bool record_bind_descriptor_sets(VkPipelineBindPoint in_pipeline_bind_point, + Anvil::PipelineLayout* in_layout_ptr, + uint32_t in_first_set, + uint32_t in_set_count, + const Anvil::DescriptorSet* const* in_descriptor_set_ptrs, + uint32_t in_dynamic_offset_count, + const uint32_t* in_dynamic_offset_ptrs); /** Issues a vkCmdBindIndexBuffer() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -386,9 +390,9 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_bind_index_buffer(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - VkIndexType in_index_type); + bool record_bind_index_buffer(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkIndexType in_index_type); /** Issues a vkCmdBindPipeline() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -418,10 +422,10 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_bind_vertex_buffers(uint32_t in_start_binding, - uint32_t in_binding_count, - std::shared_ptr* in_buffer_ptrs, - const VkDeviceSize* in_offset_ptrs); + bool record_bind_vertex_buffers(uint32_t in_start_binding, + uint32_t in_binding_count, + Anvil::Buffer** in_buffer_ptrs, + const VkDeviceSize* in_offset_ptrs); /** Issues a vkCmdBlitImage() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -440,13 +444,13 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_blit_image(std::shared_ptr in_src_image_ptr, - VkImageLayout in_src_image_layout, - std::shared_ptr in_dst_image_ptr, - VkImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageBlit* in_region_ptrs, - VkFilter in_filter); + bool record_blit_image(Anvil::Image* in_src_image_ptr, + VkImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + VkImageLayout in_dst_image_layout, + uint32_t in_region_count, + const VkImageBlit* in_region_ptrs, + VkFilter in_filter); /** Issues a vkCmdClearAttachments() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -487,7 +491,7 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_clear_color_image(std::shared_ptr in_image_ptr, + bool record_clear_color_image(Anvil::Image* in_image_ptr, VkImageLayout in_image_layout, const VkClearColorValue* in_color_ptr, uint32_t in_range_count, @@ -510,7 +514,7 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_clear_depth_stencil_image(std::shared_ptr in_image_ptr, + bool record_clear_depth_stencil_image(Anvil::Image* in_image_ptr, VkImageLayout in_image_layout, const VkClearDepthStencilValue* in_depth_stencil_ptr, uint32_t in_range_count, @@ -533,10 +537,10 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_copy_buffer(std::shared_ptr in_src_buffer_ptr, - std::shared_ptr in_dst_buffer_ptr, - uint32_t in_region_count, - const VkBufferCopy* in_region_ptrs); + bool record_copy_buffer(Anvil::Buffer* in_src_buffer_ptr, + Anvil::Buffer* in_dst_buffer_ptr, + uint32_t in_region_count, + const VkBufferCopy* in_region_ptrs); /** Issues a vkCmdCopyBufferToImage() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -555,11 +559,11 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_copy_buffer_to_image(std::shared_ptr in_src_buffer_ptr, - std::shared_ptr in_dst_image_ptr, - VkImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkBufferImageCopy* in_region_ptrs); + bool record_copy_buffer_to_image(Anvil::Buffer* in_src_buffer_ptr, + Anvil::Image* in_dst_image_ptr, + VkImageLayout in_dst_image_layout, + uint32_t in_region_count, + const VkBufferImageCopy* in_region_ptrs); /** Issues a vkCmdCopyImage() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -578,12 +582,12 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_copy_image(std::shared_ptr in_src_image_ptr, - VkImageLayout in_src_image_layout, - std::shared_ptr in_dst_image_ptr, - VkImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageCopy* in_region_ptrs); + bool record_copy_image(Anvil::Image* in_src_image_ptr, + VkImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + VkImageLayout in_dst_image_layout, + uint32_t in_region_count, + const VkImageCopy* in_region_ptrs); /** Issues a vkCmdCopyImageToBuffer() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -602,11 +606,11 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_copy_image_to_buffer(std::shared_ptr in_src_image_ptr, - VkImageLayout in_src_image_layout, - std::shared_ptr in_dst_buffer_ptr, - uint32_t in_region_count, - const VkBufferImageCopy* in_region_ptrs); + bool record_copy_image_to_buffer(Anvil::Image* in_src_image_ptr, + VkImageLayout in_src_image_layout, + Anvil::Buffer* in_dst_buffer_ptr, + uint32_t in_region_count, + const VkBufferImageCopy* in_region_ptrs); /** Issues a vkCmdCopyQueryPoolResults() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -625,13 +629,13 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_copy_query_pool_results(std::shared_ptr in_query_pool_ptr, - Anvil::QueryIndex in_start_query, - uint32_t in_query_count, - std::shared_ptr in_dst_buffer_ptr, - VkDeviceSize in_dst_offset, - VkDeviceSize in_dst_stride, - VkQueryResultFlags in_flags); + bool record_copy_query_pool_results(Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_start_query, + uint32_t in_query_count, + Anvil::Buffer* in_dst_buffer_ptr, + VkDeviceSize in_dst_offset, + VkDeviceSize in_dst_stride, + VkQueryResultFlags in_flags); /** Issues a vkCmdDebugMarkerBeginEXT() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -709,8 +713,8 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_dispatch_indirect(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset); + bool record_dispatch_indirect(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset); /** Issues a vkCmdDraw() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -768,10 +772,10 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_draw_indexed_indirect(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - uint32_t in_draw_count, - uint32_t in_stride); + bool record_draw_indexed_indirect(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + uint32_t in_draw_count, + uint32_t in_stride); /** Issues a vkCmdDrawIndexedIndirectCount() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -793,12 +797,12 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_draw_indexed_indirect_count_AMD(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - std::shared_ptr in_count_buffer_ptr, - VkDeviceSize in_count_offset, - uint32_t in_max_draw_count, - uint32_t in_stride); + bool record_draw_indexed_indirect_count_AMD(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + Anvil::Buffer* in_count_buffer_ptr, + VkDeviceSize in_count_offset, + uint32_t in_max_draw_count, + uint32_t in_stride); /** Issues a vkCmdDrawIndirect() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -817,10 +821,10 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_draw_indirect(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - uint32_t in_count, - uint32_t in_stride); + bool record_draw_indirect(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + uint32_t in_count, + uint32_t in_stride); /** Issues a vkCmdDrawIndirectCount() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -842,12 +846,12 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_draw_indirect_count_AMD(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - std::shared_ptr in_count_buffer_ptr, - VkDeviceSize in_count_offset, - uint32_t in_max_draw_count, - uint32_t in_stride); + bool record_draw_indirect_count_AMD(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + Anvil::Buffer* in_count_buffer_ptr, + VkDeviceSize in_count_offset, + uint32_t in_max_draw_count, + uint32_t in_stride); /** Issues a vkCmdEndQuery() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -860,8 +864,8 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_end_query(std::shared_ptr in_query_pool_ptr, - Anvil::QueryIndex in_entry); + bool record_end_query(Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_entry); /** Issues a vkCmdFillBuffer() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -880,10 +884,10 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_fill_buffer(std::shared_ptr in_dst_buffer_ptr, - VkDeviceSize in_dst_offset, - VkDeviceSize in_size, - uint32_t in_data); + bool record_fill_buffer(Anvil::Buffer* in_dst_buffer_ptr, + VkDeviceSize in_dst_offset, + VkDeviceSize in_size, + uint32_t in_data); /** Issues a vkCmdPipelineBarrier() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -920,11 +924,11 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_push_constants(std::shared_ptr in_layout_ptr, - VkShaderStageFlags in_stage_flags, - uint32_t in_offset, - uint32_t in_size, - const void* in_values); + bool record_push_constants(Anvil::PipelineLayout* in_layout_ptr, + VkShaderStageFlags in_stage_flags, + uint32_t in_offset, + uint32_t in_size, + const void* in_values); /** Issues a vkCmdResetEvent() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -943,8 +947,8 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_reset_event(std::shared_ptr in_event_ptr, - VkPipelineStageFlags in_stage_mask); + bool record_reset_event(Anvil::Event* in_event_ptr, + VkPipelineStageFlags in_stage_mask); /** Issues a vkCmdResetQueryPool() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -960,9 +964,9 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_reset_query_pool(std::shared_ptr in_query_pool_ptr, - Anvil::QueryIndex in_start_query, - uint32_t in_query_count); + bool record_reset_query_pool(Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_start_query, + uint32_t in_query_count); /** Issues a vkCmdResolveImage() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -981,12 +985,12 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_resolve_image(std::shared_ptr in_src_image_ptr, - VkImageLayout in_src_image_layout, - std::shared_ptr in_dst_image_ptr, - VkImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageResolve* in_region_ptrs); + bool record_resolve_image(Anvil::Image* in_src_image_ptr, + VkImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + VkImageLayout in_dst_image_layout, + uint32_t in_region_count, + const VkImageResolve* in_region_ptrs); /** Issues a vkCmdSetBlendConstants() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -1047,8 +1051,8 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_set_event(std::shared_ptr in_event_ptr, - VkPipelineStageFlags in_stage_mask); + bool record_set_event(Anvil::Event* in_event_ptr, + VkPipelineStageFlags in_stage_mask); /** Issues a vkCmdSetLineWidth() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -1152,10 +1156,10 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_update_buffer(std::shared_ptr in_dst_buffer_ptr, - VkDeviceSize in_dst_offset, - VkDeviceSize in_data_size, - const uint32_t* in_data_ptr); + bool record_update_buffer(Anvil::Buffer* in_dst_buffer_ptr, + VkDeviceSize in_dst_offset, + VkDeviceSize in_data_size, + const uint32_t* in_data_ptr); /** Issues a vkCmdWaitEvents() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -1171,16 +1175,16 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_wait_events(uint32_t in_event_count, - std::shared_ptr* in_event_ptrs, - VkPipelineStageFlags in_src_stage_mask, - VkPipelineStageFlags in_dst_stage_mask, - uint32_t in_memory_barrier_count, - const MemoryBarrier* const in_memory_barriers_ptr, - uint32_t in_buffer_memory_barrier_count, - const BufferBarrier* const in_buffer_memory_barriers_ptr, - uint32_t in_image_memory_barrier_count, - const ImageBarrier* const in_image_memory_barriers_ptr); + bool record_wait_events(uint32_t in_event_count, + Anvil::Event* const* in_event_ptrs, + VkPipelineStageFlags in_src_stage_mask, + VkPipelineStageFlags in_dst_stage_mask, + uint32_t in_memory_barrier_count, + const MemoryBarrier* const in_memory_barriers_ptr, + uint32_t in_buffer_memory_barrier_count, + const BufferBarrier* const in_buffer_memory_barriers_ptr, + uint32_t in_image_memory_barrier_count, + const ImageBarrier* const in_image_memory_barriers_ptr); /** Issues a vkCmdWriteTimestamp() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -1196,9 +1200,9 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_write_timestamp(VkPipelineStageFlagBits in_pipeline_stage, - std::shared_ptr in_query_pool_ptr, - Anvil::QueryIndex in_entry); + bool record_write_timestamp(VkPipelineStageFlagBits in_pipeline_stage, + Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_entry); /** Resets the underlying Vulkan command buffer and clears the internally managed vector of * recorded commands, if STORE_COMMAND_BUFFER_COMMANDS has been defined for the build. @@ -1272,13 +1276,13 @@ namespace Anvil { VkQueryControlFlagsVariable(flags); - Anvil::QueryIndex entry; - std::shared_ptr query_pool_ptr; + Anvil::QueryIndex entry; + Anvil::QueryPool* query_pool_ptr; /** Constructor. */ - explicit BeginQueryCommand(std::shared_ptr in_query_pool_ptr, - Anvil::QueryIndex in_entry, - VkQueryControlFlags in_flags); + explicit BeginQueryCommand(Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_entry, + VkQueryControlFlags in_flags); /** Destructor. */ virtual ~BeginQueryCommand() @@ -1290,20 +1294,20 @@ namespace Anvil /** Holds all arguments passed to a vkCmdBindDescriptorSets() command. */ typedef struct BindDescriptorSetsCommand : public Command { - std::vector > descriptor_sets; - std::vector dynamic_offsets; - uint32_t first_set; - std::shared_ptr layout_ptr; - VkPipelineBindPoint pipeline_bind_point; + std::vector descriptor_sets; + std::vector dynamic_offsets; + uint32_t first_set; + Anvil::PipelineLayout* layout_ptr; + VkPipelineBindPoint pipeline_bind_point; /** Constructor. **/ - explicit BindDescriptorSetsCommand(VkPipelineBindPoint in_pipeline_bind_point, - std::shared_ptr in_layout_ptr, - uint32_t in_first_set, - uint32_t in_set_count, - std::shared_ptr* in_descriptor_set_ptrs, - uint32_t in_dynamic_offset_count, - const uint32_t* in_dynamic_offset_ptrs); + explicit BindDescriptorSetsCommand(VkPipelineBindPoint in_pipeline_bind_point, + Anvil::PipelineLayout* in_layout_ptr, + uint32_t in_first_set, + uint32_t in_set_count, + const Anvil::DescriptorSet* const* in_descriptor_set_ptrs, + uint32_t in_dynamic_offset_count, + const uint32_t* in_dynamic_offset_ptrs); /** Destructor. */ virtual ~BindDescriptorSetsCommand() @@ -1322,15 +1326,15 @@ namespace Anvil */ typedef struct BindIndexBufferCommand : public Command { - VkBuffer buffer; - std::shared_ptr buffer_ptr; - VkIndexType index_type; - VkDeviceSize offset; + VkBuffer buffer; + Anvil::Buffer* buffer_ptr; + VkIndexType index_type; + VkDeviceSize offset; /** Constructor. **/ - explicit BindIndexBufferCommand(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - VkIndexType in_index_type); + explicit BindIndexBufferCommand(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkIndexType in_index_type); /** Destructor. */ virtual ~BindIndexBufferCommand() @@ -1373,13 +1377,13 @@ namespace Anvil **/ typedef struct BindVertexBuffersCommandBinding { - VkBuffer buffer; - std::shared_ptr buffer_ptr; - VkDeviceSize offset; + VkBuffer buffer; + Anvil::Buffer* buffer_ptr; + VkDeviceSize offset; /** Constructor. **/ - explicit BindVertexBuffersCommandBinding(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset); + explicit BindVertexBuffersCommandBinding(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset); /** Destructor. */ virtual ~BindVertexBuffersCommandBinding() @@ -1400,10 +1404,10 @@ namespace Anvil uint32_t start_binding; /** Constructor. **/ - explicit BindVertexBuffersCommand(uint32_t in_start_binding, - uint32_t in_binding_count, - std::shared_ptr* in_buffer_ptrs, - const VkDeviceSize* in_offset_ptrs); + explicit BindVertexBuffersCommand(uint32_t in_start_binding, + uint32_t in_binding_count, + Anvil::Buffer** in_buffer_ptrs, + const VkDeviceSize* in_offset_ptrs); /** Destructor. */ virtual ~BindVertexBuffersCommand() @@ -1415,24 +1419,24 @@ namespace Anvil /** Holds all arguments passed to a vkCmdBlitImage() command. */ typedef struct BlitImageCommand : public Command { - VkImage dst_image; - VkImageLayout dst_image_layout; - std::shared_ptr dst_image_ptr; - VkImage src_image; - VkImageLayout src_image_layout; - std::shared_ptr src_image_ptr; + VkImage dst_image; + VkImageLayout dst_image_layout; + Anvil::Image* dst_image_ptr; + VkImage src_image; + VkImageLayout src_image_layout; + Anvil::Image* src_image_ptr; VkFilter filter; std::vector regions; /** Constructor. */ - explicit BlitImageCommand(std::shared_ptr in_src_image_ptr, - VkImageLayout in_src_image_layout, - std::shared_ptr in_dst_image_ptr, - VkImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageBlit* in_region_ptrs, - VkFilter in_filter); + explicit BlitImageCommand(Anvil::Image* in_src_image_ptr, + VkImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + VkImageLayout in_dst_image_layout, + uint32_t in_region_count, + const VkImageBlit* in_region_ptrs, + VkFilter in_filter); /** Destructor. */ virtual ~BlitImageCommand() @@ -1496,11 +1500,11 @@ namespace Anvil VkClearColorValue color; VkImage image; VkImageLayout image_layout; - std::shared_ptr image_ptr; + Anvil::Image* image_ptr; std::vector ranges; /** Constructor. **/ - explicit ClearColorImageCommand(std::shared_ptr in_image_ptr, + explicit ClearColorImageCommand(Anvil::Image* in_image_ptr, VkImageLayout in_image_layout, const VkClearColorValue* in_color_ptr, uint32_t in_range_count, @@ -1523,11 +1527,11 @@ namespace Anvil VkClearDepthStencilValue depth_stencil; VkImage image; VkImageLayout image_layout; - std::shared_ptr image_ptr; + Anvil::Image* image_ptr; std::vector ranges; /** Constructor. **/ - explicit ClearDepthStencilImageCommand(std::shared_ptr in_image_ptr, + explicit ClearDepthStencilImageCommand(Anvil::Image* in_image_ptr, VkImageLayout in_image_layout, const VkClearDepthStencilValue* in_depth_stencil_ptr, uint32_t in_range_count, @@ -1547,17 +1551,17 @@ namespace Anvil /** Holds all arguments passed to a vkCmdCopyBuffer() command. */ typedef struct CopyBufferCommand : public Command { - VkBuffer dst_buffer; - std::shared_ptr dst_buffer_ptr; - std::vector regions; - VkBuffer src_buffer; - std::shared_ptr src_buffer_ptr; + VkBuffer dst_buffer; + Anvil::Buffer* dst_buffer_ptr; + std::vector regions; + VkBuffer src_buffer; + Anvil::Buffer* src_buffer_ptr; /** Constructor. **/ - explicit CopyBufferCommand(std::shared_ptr in_src_buffer_ptr, - std::shared_ptr in_dst_buffer_ptr, - uint32_t in_region_count, - const VkBufferCopy* in_region_ptrs); + explicit CopyBufferCommand(Anvil::Buffer* in_src_buffer_ptr, + Anvil::Buffer* in_dst_buffer_ptr, + uint32_t in_region_count, + const VkBufferCopy* in_region_ptrs); /** Destructor. */ virtual ~CopyBufferCommand() @@ -1575,17 +1579,17 @@ namespace Anvil { VkImage dst_image; VkImageLayout dst_image_layout; - std::shared_ptr dst_image_ptr; + Anvil::Image* dst_image_ptr; std::vector regions; VkBuffer src_buffer; - std::shared_ptr src_buffer_ptr; + Anvil::Buffer* src_buffer_ptr; /** Constructor. **/ - explicit CopyBufferToImageCommand(std::shared_ptr in_src_buffer_ptr, - std::shared_ptr in_dst_image_ptr, - VkImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkBufferImageCopy* in_region_ptrs); + explicit CopyBufferToImageCommand(Anvil::Buffer* in_src_buffer_ptr, + Anvil::Image* in_dst_image_ptr, + VkImageLayout in_dst_image_layout, + uint32_t in_region_count, + const VkBufferImageCopy* in_region_ptrs); /** Destructor. */ virtual ~CopyBufferToImageCommand() @@ -1602,21 +1606,21 @@ namespace Anvil /** Holds all arguments passed to a vkCmdCopyImage() command. */ typedef struct CopyImageCommand : public Command { - VkImage dst_image; - std::shared_ptr dst_image_ptr; - VkImageLayout dst_image_layout; - std::vector regions; - VkImage src_image; - std::shared_ptr src_image_ptr; - VkImageLayout src_image_layout; + VkImage dst_image; + Anvil::Image* dst_image_ptr; + VkImageLayout dst_image_layout; + std::vector regions; + VkImage src_image; + Anvil::Image* src_image_ptr; + VkImageLayout src_image_layout; /** Constructor. **/ - explicit CopyImageCommand(std::shared_ptr in_src_image_ptr, - VkImageLayout in_src_image_layout, - std::shared_ptr in_dst_image_ptr, - VkImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageCopy* in_region_ptrs); + explicit CopyImageCommand(Anvil::Image* in_src_image_ptr, + VkImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + VkImageLayout in_dst_image_layout, + uint32_t in_region_count, + const VkImageCopy* in_region_ptrs); /** Destructor. */ virtual ~CopyImageCommand() @@ -1633,18 +1637,18 @@ namespace Anvil typedef struct CopyImageToBufferCommand : public Command { VkBuffer dst_buffer; - std::shared_ptr dst_buffer_ptr; + Anvil::Buffer* dst_buffer_ptr; std::vector regions; VkImage src_image; VkImageLayout src_image_layout; - std::shared_ptr src_image_ptr; + Anvil::Image* src_image_ptr; /** Constructor. **/ - explicit CopyImageToBufferCommand(std::shared_ptr in_src_image_ptr, - VkImageLayout in_src_image_layout, - std::shared_ptr in_dst_buffer_ptr, - uint32_t in_region_count, - const VkBufferImageCopy* in_region_ptrs); + explicit CopyImageToBufferCommand(Anvil::Image* in_src_image_ptr, + VkImageLayout in_src_image_layout, + Anvil::Buffer* in_dst_buffer_ptr, + uint32_t in_region_count, + const VkBufferImageCopy* in_region_ptrs); /** Destructor. */ virtual ~CopyImageToBufferCommand() @@ -1662,22 +1666,22 @@ namespace Anvil { VkQueryResultFlagsVariable(flags); - VkBuffer dst_buffer; - std::shared_ptr dst_buffer_ptr; - VkDeviceSize dst_offset; - VkDeviceSize dst_stride; - uint32_t query_count; - std::shared_ptr query_pool_ptr; - Anvil::QueryIndex start_query; + VkBuffer dst_buffer; + Anvil::Buffer* dst_buffer_ptr; + VkDeviceSize dst_offset; + VkDeviceSize dst_stride; + uint32_t query_count; + Anvil::QueryPool* query_pool_ptr; + Anvil::QueryIndex start_query; /** Constructor. **/ - explicit CopyQueryPoolResultsCommand(std::shared_ptr in_query_pool_ptr, - Anvil::QueryIndex in_start_query, - uint32_t in_query_count, - std::shared_ptr in_dst_buffer_ptr, - VkDeviceSize in_dst_offset, - VkDeviceSize in_dst_stride, - VkQueryResultFlags in_flags); + explicit CopyQueryPoolResultsCommand(Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_start_query, + uint32_t in_query_count, + Anvil::Buffer* in_dst_buffer_ptr, + VkDeviceSize in_dst_offset, + VkDeviceSize in_dst_stride, + VkQueryResultFlags in_flags); /** Destructor. */ virtual ~CopyQueryPoolResultsCommand() @@ -1759,13 +1763,13 @@ namespace Anvil /** Holds all arguments passed to a vkCmdDispatchIndirect() command. */ typedef struct DispatchIndirectCommand : public Command { - VkBuffer buffer; - std::shared_ptr buffer_ptr; - VkDeviceSize offset; + VkBuffer buffer; + Anvil::Buffer* buffer_ptr; + VkDeviceSize offset; /** Constructor. **/ - explicit DispatchIndirectCommand(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset); + explicit DispatchIndirectCommand(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset); /** Destructor. */ virtual ~DispatchIndirectCommand() @@ -1830,17 +1834,17 @@ namespace Anvil /** Holds all arguments passed to a vkCmdDrawIndirect() command. */ typedef struct DrawIndirectCommand : public Command { - VkBuffer buffer; - std::shared_ptr buffer_ptr; - uint32_t count; - VkDeviceSize offset; - uint32_t stride; + VkBuffer buffer; + Anvil::Buffer* buffer_ptr; + uint32_t count; + VkDeviceSize offset; + uint32_t stride; /** Constructor. **/ - explicit DrawIndirectCommand(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - uint32_t in_count, - uint32_t in_stride); + explicit DrawIndirectCommand(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + uint32_t in_count, + uint32_t in_stride); /** Destructor. */ virtual ~DrawIndirectCommand() @@ -1855,22 +1859,22 @@ namespace Anvil /** Holds all arguments passed to a vkCmdDrawIndirectCountAMD() command. */ typedef struct DrawIndirectCountAMDCommand : public Command { - VkBuffer buffer; - std::shared_ptr buffer_ptr; - VkBuffer count_buffer; - std::shared_ptr count_buffer_ptr; - VkDeviceSize count_offset; - uint32_t max_draw_count; - VkDeviceSize offset; - uint32_t stride; + VkBuffer buffer; + Anvil::Buffer* buffer_ptr; + VkBuffer count_buffer; + Anvil::Buffer* count_buffer_ptr; + VkDeviceSize count_offset; + uint32_t max_draw_count; + VkDeviceSize offset; + uint32_t stride; /** Constructor. **/ - explicit DrawIndirectCountAMDCommand(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - std::shared_ptr in_count_buffer_ptr, - VkDeviceSize in_count_offset, - uint32_t in_max_draw_count, - uint32_t in_stride); + explicit DrawIndirectCountAMDCommand(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + Anvil::Buffer* in_count_buffer_ptr, + VkDeviceSize in_count_offset, + uint32_t in_max_draw_count, + uint32_t in_stride); /** Destructor */ virtual ~DrawIndirectCountAMDCommand() @@ -1885,17 +1889,17 @@ namespace Anvil /** Holds all arguments passed to a vkCmdDrawIndexedIndirect() command. */ typedef struct DrawIndexedIndirectCommand : public Command { - VkBuffer buffer; - std::shared_ptr buffer_ptr; - uint32_t draw_count; - VkDeviceSize offset; - uint32_t stride; + VkBuffer buffer; + Anvil::Buffer* buffer_ptr; + uint32_t draw_count; + VkDeviceSize offset; + uint32_t stride; /** Constructor. **/ - explicit DrawIndexedIndirectCommand(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - uint32_t in_draw_count, - uint32_t in_stride); + explicit DrawIndexedIndirectCommand(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + uint32_t in_draw_count, + uint32_t in_stride); /** Destructor. */ virtual ~DrawIndexedIndirectCommand() @@ -1910,22 +1914,22 @@ namespace Anvil /** Holds all arguments passed to a vkCmdDrawIndexedIndirectCountAMD() command. */ typedef struct DrawIndexedIndirectCountAMDCommand : public Command { - VkBuffer buffer; - std::shared_ptr buffer_ptr; - VkBuffer count_buffer; - std::shared_ptr count_buffer_ptr; - VkDeviceSize count_offset; - uint32_t max_draw_count; - VkDeviceSize offset; - uint32_t stride; + VkBuffer buffer; + Anvil::Buffer* buffer_ptr; + VkBuffer count_buffer; + Anvil::Buffer* count_buffer_ptr; + VkDeviceSize count_offset; + uint32_t max_draw_count; + VkDeviceSize offset; + uint32_t stride; /** Constructor. **/ - explicit DrawIndexedIndirectCountAMDCommand(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - std::shared_ptr in_count_buffer_ptr, - VkDeviceSize in_count_offset, - uint32_t in_max_draw_count, - uint32_t in_stride); + explicit DrawIndexedIndirectCountAMDCommand(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + Anvil::Buffer* in_count_buffer_ptr, + VkDeviceSize in_count_offset, + uint32_t in_max_draw_count, + uint32_t in_stride); /** Destructor */ virtual ~DrawIndexedIndirectCountAMDCommand() @@ -1940,12 +1944,12 @@ namespace Anvil /** Holds all arguments passed to a vkCmdEndQuery() command. */ typedef struct EndQueryCommand : public Command { - Anvil::QueryIndex entry; - std::shared_ptr query_pool_ptr; + Anvil::QueryIndex entry; + Anvil::QueryPool* query_pool_ptr; /** Constructor. **/ - explicit EndQueryCommand(std::shared_ptr in_query_pool_ptr, - Anvil::QueryIndex in_entry); + explicit EndQueryCommand(Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_entry); /** Destructor. */ virtual ~EndQueryCommand() @@ -1958,12 +1962,12 @@ namespace Anvil /** Holds all arguments passed to a vkCmdExecuteCommands() command. */ typedef struct ExecuteCommandsCommand : public Command { - std::vector > command_buffer_ptrs; - std::vector command_buffers; + std::vector command_buffer_ptrs; + std::vector command_buffers; /** Constructor. **/ - explicit ExecuteCommandsCommand(uint32_t in_cmd_buffers_count, - std::shared_ptr* in_cmd_buffer_ptrs); + explicit ExecuteCommandsCommand(uint32_t in_cmd_buffers_count, + Anvil::SecondaryCommandBuffer** in_cmd_buffer_ptrs); /** Destructor. */ virtual ~ExecuteCommandsCommand() @@ -1979,17 +1983,17 @@ namespace Anvil /** Holds all arguments passed to a vkCmdFillBuffer() command. */ typedef struct FillBufferCommand : public Command { - uint32_t data; - VkBuffer dst_buffer; - std::shared_ptr dst_buffer_ptr; - VkDeviceSize dst_offset; - VkDeviceSize size; + uint32_t data; + VkBuffer dst_buffer; + Anvil::Buffer* dst_buffer_ptr; + VkDeviceSize dst_offset; + VkDeviceSize size; /** Constructor. **/ - explicit FillBufferCommand(std::shared_ptr in_dst_buffer_ptr, - VkDeviceSize in_dst_offset, - VkDeviceSize in_size, - uint32_t in_data); + explicit FillBufferCommand(Anvil::Buffer* in_dst_buffer_ptr, + VkDeviceSize in_dst_offset, + VkDeviceSize in_size, + uint32_t in_data); /** Destructor. */ virtual ~FillBufferCommand() @@ -2023,17 +2027,17 @@ namespace Anvil { VkShaderStageFlagsVariable(stage_flags); - std::shared_ptr layout_ptr; - uint32_t offset; - uint32_t size; - const void* values; + Anvil::PipelineLayout* layout_ptr; + uint32_t offset; + uint32_t size; + const void* values; /** Constructor. **/ - explicit PushConstantsCommand(std::shared_ptr in_layout_ptr, - VkShaderStageFlags in_stage_flags, - uint32_t in_offset, - uint32_t in_size, - const void* in_values); + explicit PushConstantsCommand(Anvil::PipelineLayout* in_layout_ptr, + VkShaderStageFlags in_stage_flags, + uint32_t in_offset, + uint32_t in_size, + const void* in_values); /** Destructor. */ virtual ~PushConstantsCommand() @@ -2048,12 +2052,12 @@ namespace Anvil { VkPipelineStageFlagsVariable(stage_mask); - VkEvent event; - std::shared_ptr event_ptr; + VkEvent event; + Anvil::Event* event_ptr; /** Constructor. **/ - explicit ResetEventCommand(std::shared_ptr in_event_ptr, - VkPipelineStageFlags in_stage_mask); + explicit ResetEventCommand(Anvil::Event* in_event_ptr, + VkPipelineStageFlags in_stage_mask); /** Destructor. */ virtual ~ResetEventCommand() @@ -2069,14 +2073,14 @@ namespace Anvil /** Holds all arguments passed to a vkCmdResetQueryPoolCommand() command. **/ typedef struct ResetQueryPoolCommand : public Command { - uint32_t query_count; - std::shared_ptr query_pool_ptr; - Anvil::QueryIndex start_query; + uint32_t query_count; + Anvil::QueryPool* query_pool_ptr; + Anvil::QueryIndex start_query; /** Constructor. **/ - explicit ResetQueryPoolCommand(std::shared_ptr in_query_pool_ptr, - Anvil::QueryIndex in_start_query, - uint32_t in_query_count); + explicit ResetQueryPoolCommand(Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_start_query, + uint32_t in_query_count); /** Destructor. */ virtual ~ResetQueryPoolCommand() @@ -2089,21 +2093,21 @@ namespace Anvil /** Holds all arguments passed to a vkCmdResolveImage() command. **/ typedef struct ResolveImageCommand : public Command { - VkImage dst_image; - std::shared_ptr dst_image_ptr; - VkImageLayout dst_image_layout; - std::vector regions; - VkImage src_image; - std::shared_ptr src_image_ptr; - VkImageLayout src_image_layout; + VkImage dst_image; + Anvil::Image* dst_image_ptr; + VkImageLayout dst_image_layout; + std::vector regions; + VkImage src_image; + Anvil::Image* src_image_ptr; + VkImageLayout src_image_layout; /** Constructor. **/ - explicit ResolveImageCommand(std::shared_ptr in_src_image_ptr, - VkImageLayout in_src_image_layout, - std::shared_ptr in_dst_image_ptr, - VkImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageResolve* in_region_ptrs); + explicit ResolveImageCommand(Anvil::Image* in_src_image_ptr, + VkImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + VkImageLayout in_dst_image_layout, + uint32_t in_region_count, + const VkImageResolve* in_region_ptrs); /** Destructor. */ virtual ~ResolveImageCommand() @@ -2171,14 +2175,14 @@ namespace Anvil /** Holds all arguments passed to a vkCmdSetEvent() command. **/ typedef struct SetEventCommand : public Command { - VkEvent event; - std::shared_ptr event_ptr; + VkEvent event; + Anvil::Event* event_ptr; VkPipelineStageFlagsVariable(stage_mask); /** Constructor. **/ - explicit SetEventCommand(std::shared_ptr in_event_ptr, - VkPipelineStageFlags in_stage_mask); + explicit SetEventCommand(Anvil::Event* in_event_ptr, + VkPipelineStageFlags in_stage_mask); /** Destructor. */ virtual ~SetEventCommand() @@ -2304,17 +2308,17 @@ namespace Anvil /** Holds all arguments passed to a vkCmdUpdateBuffer() command. **/ typedef struct UpdateBufferCommand : public Command { - const uint32_t* data_ptr; - VkDeviceSize data_size; - VkBuffer dst_buffer; - std::shared_ptr dst_buffer_ptr; - VkDeviceSize dst_offset; + const uint32_t* data_ptr; + VkDeviceSize data_size; + VkBuffer dst_buffer; + Anvil::Buffer* dst_buffer_ptr; + VkDeviceSize dst_offset; /** Constructor **/ - explicit UpdateBufferCommand(std::shared_ptr in_dst_buffer_ptr, - VkDeviceSize in_dst_offset, - VkDeviceSize in_data_size, - const uint32_t* in_data_ptr); + explicit UpdateBufferCommand(Anvil::Buffer* in_dst_buffer_ptr, + VkDeviceSize in_dst_offset, + VkDeviceSize in_data_size, + const uint32_t* in_data_ptr); /** Destructor. */ virtual ~UpdateBufferCommand() @@ -2337,20 +2341,20 @@ namespace Anvil std::vector image_barriers; std::vector memory_barriers; - std::vector events; - std::vector > event_ptrs; + std::vector events; + std::vector event_ptrs; /** Constructor **/ - explicit WaitEventsCommand(uint32_t in_event_count, - std::shared_ptr* in_event_ptrs, - VkPipelineStageFlags in_src_stage_mask, - VkPipelineStageFlags in_dst_stage_mask, - uint32_t in_memory_barrier_count, - const MemoryBarrier* const in_memory_barrier_ptr_ptr, - uint32_t in_buffer_memory_barrier_count, - const BufferBarrier* const in_buffer_memory_barrier_ptr_ptr, - uint32_t in_image_memory_barrier_count, - const ImageBarrier* const in_image_memory_barrier_ptr_ptr); + explicit WaitEventsCommand(uint32_t in_event_count, + Anvil::Event* const* in_event_ptrs, + VkPipelineStageFlags in_src_stage_mask, + VkPipelineStageFlags in_dst_stage_mask, + uint32_t in_memory_barrier_count, + const MemoryBarrier* const in_memory_barrier_ptr_ptr, + uint32_t in_buffer_memory_barrier_count, + const BufferBarrier* const in_buffer_memory_barrier_ptr_ptr, + uint32_t in_image_memory_barrier_count, + const ImageBarrier* const in_image_memory_barrier_ptr_ptr); /** Destructor. */ virtual ~WaitEventsCommand() @@ -2368,13 +2372,13 @@ namespace Anvil { VkPipelineStageFlagsVariable(pipeline_stage); - Anvil::QueryIndex entry; - std::shared_ptr query_pool_ptr; + Anvil::QueryIndex entry; + Anvil::QueryPool* query_pool_ptr; /** Constructor. **/ - explicit WriteTimestampCommand(VkPipelineStageFlagBits in_pipeline_stage, - std::shared_ptr in_query_pool_ptr, - Anvil::QueryIndex in_entry); + explicit WriteTimestampCommand(VkPipelineStageFlagBits in_pipeline_stage, + Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_entry); /** Destructor. */ virtual ~WriteTimestampCommand() @@ -2390,40 +2394,26 @@ namespace Anvil typedef std::vector Commands; /* Protected functions */ - explicit CommandBufferBase(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_command_pool_ptr, - CommandBufferType in_type, - bool in_mt_safe); - - virtual ~CommandBufferBase(); - - void cache_referenced_buffer (std::shared_ptr in_buffer_ptr); - void cache_referenced_command_buffer(std::shared_ptr in_cmd_buffer_ptr); - void cache_referenced_descriptor_set(std::shared_ptr in_ds_ptr); - void cache_referenced_event (std::shared_ptr in_event_ptr); - void cache_referenced_framebuffer (std::shared_ptr in_fb_ptr); - void cache_referenced_image (std::shared_ptr in_image_ptr); - void cache_referenced_query_pool (std::shared_ptr in_query_pool_ptr); - void cache_referenced_renderpass (std::shared_ptr in_renderpass_ptr); + explicit CommandBufferBase(const Anvil::BaseDevice* in_device_ptr, + Anvil::CommandPool* in_parent_command_pool_ptr, + CommandBufferType in_type, + bool in_mt_safe); #ifdef STORE_COMMAND_BUFFER_COMMANDS void clear_commands(); #endif - void clear_referenced_objects(); - /* Protected variables */ #ifdef STORE_COMMAND_BUFFER_COMMANDS Commands m_commands; #endif - VkCommandBuffer m_command_buffer; - std::weak_ptr m_device_ptr; - bool m_is_renderpass_active; - std::weak_ptr m_parent_command_pool_ptr; - bool m_recording_in_progress; - uint32_t m_renderpass_device_mask; - CommandBufferType m_type; + VkCommandBuffer m_command_buffer; + const Anvil::BaseDevice* m_device_ptr; + bool m_is_renderpass_active; + Anvil::CommandPool* m_parent_command_pool_ptr; + bool m_recording_in_progress; + CommandBufferType m_type; static bool m_command_stashing_disabled; @@ -2435,14 +2425,6 @@ namespace Anvil CommandBufferBase& operator=(const CommandBufferBase&); /* Private variables */ - std::vector > m_referenced_buffers; - std::vector > m_referenced_command_buffers; - std::vector > m_referenced_descriptor_sets; - std::vector > m_referenced_events; - std::vector > m_referenced_framebuffers; - std::vector > m_referenced_images; - std::vector > m_referenced_query_pools; - std::vector > m_referenced_renderpasses; friend class Anvil::CommandPool; }; @@ -2473,12 +2455,12 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_begin_render_pass(uint32_t in_n_clear_values, - const VkClearValue* in_clear_value_ptrs, - std::shared_ptr in_fbo_ptr, - VkRect2D in_render_area, - std::shared_ptr in_render_pass_ptr, - VkSubpassContents in_contents); + bool record_begin_render_pass(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + VkRect2D in_render_area, + Anvil::RenderPass* in_render_pass_ptr, + VkSubpassContents in_contents); /** Issues a vkCmdEndRenderPass() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -2507,8 +2489,8 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_execute_commands(uint32_t in_cmd_buffers_count, - std::shared_ptr* in_cmd_buffers); + bool record_execute_commands(uint32_t in_cmd_buffers_count, + Anvil::SecondaryCommandBuffer** in_cmd_buffers); /** Issues a vkCmdNextSubpass() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -2532,6 +2514,8 @@ namespace Anvil * be used for the Vulkan API call. * @param in_simultaneous_use_allowed true if the VK_CMD_BUFFER_OPTIMIZE_NO_SIMULTANEOUS_USE_BIT flag should * be used for the Vulkan API call. + * @param in_n_physical_devices Number of physical devices specified under @param in_physical_devices_ptr + * @param in_physical_devices_ptr Physical devices to allow for usage for the command buffer. Must not be nullptr. * * @return true if successful, false otherwise. **/ @@ -2548,9 +2532,9 @@ namespace Anvil * @param in_parent_command_pool_ptr Command pool to use as a parent. Must not be nullptr. * **/ - PrimaryCommandBuffer(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_command_pool_ptr, - bool in_mt_safe); + PrimaryCommandBuffer(const Anvil::BaseDevice* in_device_ptr, + CommandPool* in_parent_command_pool_ptr, + bool in_mt_safe); private: friend class Anvil::CommandPool; @@ -2592,8 +2576,8 @@ namespace Anvil bool start_recording(bool in_one_time_submit, bool in_simultaneous_use_allowed, bool in_renderpass_usage_only, - std::shared_ptr in_framebuffer_ptr, - std::shared_ptr in_render_pass_ptr, + Framebuffer* in_framebuffer_ptr, + RenderPass* in_render_pass_ptr, SubPassID in_subpass_id, OcclusionQuerySupportScope in_required_occlusion_query_support_scope, bool in_occlusion_query_used_by_primary_command_buffer, @@ -2611,9 +2595,9 @@ namespace Anvil * @param in_parent_command_pool_ptr Command pool to use as a parent. Must not be nullptr. * **/ - SecondaryCommandBuffer(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_command_pool_ptr, - bool in_mt_safe); + SecondaryCommandBuffer(const Anvil::BaseDevice* in_device_ptr, + CommandPool* in_parent_command_pool_ptr, + bool in_mt_safe); private: friend class Anvil::CommandPool; diff --git a/include/wrappers/command_pool.h b/include/wrappers/command_pool.h index 6138ff15..c2566aa1 100644 --- a/include/wrappers/command_pool.h +++ b/include/wrappers/command_pool.h @@ -38,8 +38,7 @@ namespace Anvil { /** Implements a command pool wrapper */ class CommandPool : public MTSafetySupportProvider, - public DebugMarkerSupportProvider, - public std::enable_shared_from_this + public DebugMarkerSupportProvider { public: /* Public functions */ @@ -53,7 +52,7 @@ namespace Anvil * * @return As per description. **/ - std::shared_ptr alloc_primary_level_command_buffer(); + Anvil::PrimaryCommandBufferUniquePtr alloc_primary_level_command_buffer(); /** Allocates a new secondary-level command buffer instance from this command pool. * @@ -61,7 +60,7 @@ namespace Anvil * * @return As per description. **/ - std::shared_ptr alloc_secondary_level_command_buffer(); + Anvil::SecondaryCommandBufferUniquePtr alloc_secondary_level_command_buffer(); /** Creates a new CommandPool object. * @@ -70,15 +69,15 @@ namespace Anvil * VK_COMMAND_POOL_CREATE_TRANSIENT_BIT flag set on. * @param in_support_per_cmdbuf_reset_ops Set to true if the command pool should be created with the * VK_COMMAND_POOL_RESET_COMMAND_BUFFER_BIT flag set on. - * @param in_queue_family Index of the queue family the command pool should be created for. + * @param in_queue_family_index Index of the Vulkan queue family the command pool should be created for. * @param in_mt_safe Enable if your application is going to be calling any of the * alloc_*() functions from more than one thread at a time. **/ - static std::shared_ptr create(std::weak_ptr in_device_ptr, - bool in_transient_allocations_friendly, - bool in_support_per_cmdbuf_reset_ops, - Anvil::QueueFamilyType in_queue_family, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static CommandPoolUniquePtr create(Anvil::BaseDevice* in_device_ptr, + bool in_transient_allocations_friendly, + bool in_support_per_cmdbuf_reset_ops, + uint32_t in_queue_family_index, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Retrieves the raw Vulkan handle for the encapsulated command pool */ VkCommandPool get_command_pool() const @@ -86,10 +85,10 @@ namespace Anvil return m_command_pool; } - /** Tells what queue family this command pool instance has been created for */ - Anvil::QueueFamilyType get_queue_family_type() const + /** Tells which Vulkan queue family this command pool instance has been created for */ + uint32_t get_queue_family_index() const { - return m_queue_family; + return m_queue_family_index; } /** Tells whether the command pool has been created with VK_COMMAND_POOL_CREATE_TRANSIENT_BIT @@ -126,21 +125,21 @@ namespace Anvil /* Private functions */ /* Please seee create() documentation for more details */ - explicit CommandPool(std::weak_ptr in_device_ptr, - bool in_transient_allocations_friendly, - bool in_support_per_cmdbuf_reset_ops, - Anvil::QueueFamilyType in_queue_family, - bool in_mt_safe); + explicit CommandPool(Anvil::BaseDevice* in_device_ptr, + bool in_transient_allocations_friendly, + bool in_support_per_cmdbuf_reset_ops, + uint32_t in_queue_family_index, + bool in_mt_safe); CommandPool (const CommandPool&); CommandPool& operator=(const CommandPool&); /* Private variables */ - VkCommandPool m_command_pool; - std::weak_ptr m_device_ptr; - bool m_is_transient_allocations_friendly; - Anvil::QueueFamilyType m_queue_family; - bool m_supports_per_cmdbuf_reset_ops; + VkCommandPool m_command_pool; + Anvil::BaseDevice* m_device_ptr; + bool m_is_transient_allocations_friendly; + uint32_t m_queue_family_index; + bool m_supports_per_cmdbuf_reset_ops; friend class Anvil::CommandBufferBase; }; diff --git a/include/wrappers/compute_pipeline_manager.h b/include/wrappers/compute_pipeline_manager.h index 858d1bd4..fefc6077 100644 --- a/include/wrappers/compute_pipeline_manager.h +++ b/include/wrappers/compute_pipeline_manager.h @@ -42,10 +42,10 @@ namespace Anvil using BasePipelineManager::bake; /* Public functions */ - static std::shared_ptr create(std::weak_ptr in_device_ptr, - bool in_mt_safe, - bool in_use_pipeline_cache, - std::shared_ptr in_pipeline_cache_to_reuse_ptr); + static std::unique_ptr create(Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe, + bool in_use_pipeline_cache, + Anvil::PipelineCache* in_pipeline_cache_to_reuse_ptr); virtual ~ComputePipelineManager(); @@ -53,10 +53,10 @@ namespace Anvil private: /* Constructor */ - explicit ComputePipelineManager(std::weak_ptr in_device_ptr, - bool in_mt_safe, - bool in_use_pipeline_cache = false, - std::shared_ptr in_pipeline_cache_to_reuse_ptr = nullptr); + explicit ComputePipelineManager(Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe, + bool in_use_pipeline_cache = false, + Anvil::PipelineCache* in_pipeline_cache_to_reuse_ptr = nullptr); ANVIL_DISABLE_ASSIGNMENT_OPERATOR(ComputePipelineManager); ANVIL_DISABLE_COPY_CONSTRUCTOR (ComputePipelineManager); diff --git a/include/wrappers/descriptor_pool.h b/include/wrappers/descriptor_pool.h index e43d6352..b6e1cea4 100644 --- a/include/wrappers/descriptor_pool.h +++ b/include/wrappers/descriptor_pool.h @@ -50,8 +50,7 @@ namespace Anvil class DescriptorPool : public CallbacksSupportProvider, public DebugMarkerSupportProvider, - public MTSafetySupportProvider, - public std::enable_shared_from_this + public MTSafetySupportProvider { public: /* Public functions */ @@ -59,16 +58,19 @@ namespace Anvil /** Creates a new DescriptorPool instance. Sets up the wrapper, but does not immediately * bake a new Vulkan pool. * - * @param in_device_ptr Device to use. - * @param in_n_max_sets Maximum number of sets to be allocable from the pool. Must be at - * least 1. - * @param in_releaseable_sets true if the sets should be releaseable with vkFreeDescriptorSet() - * calls. false otherwise. + * @param in_device_ptr Device to use. + * @param in_n_max_sets Maximum number of sets to be allocable from the pool. Must be at + * least 1. + * @param in_flags See DescriptorPoolFlagBits documentation for more details. + * @param in_descriptor_count_per_type_ptr Pointer to an array holding info regarding the number of descriptors to preallocate + * slots for in the pool. Exactly VK_DESCRIPTOR_TYPE_RANGE_SIZE uint32s will be read + * from the array. Must not be null. **/ - static std::shared_ptr create(std::weak_ptr in_device_ptr, - uint32_t in_n_max_sets, - bool in_releaseable_sets, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static DescriptorPoolUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_n_max_sets, + const DescriptorPoolFlags& in_flags, + const uint32_t* in_descriptor_count_per_type_ptr, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destructor. Releases the Vulkan pool object if instantiated. */ virtual ~DescriptorPool(); @@ -90,27 +92,21 @@ namespace Anvil * This may be useful for KHR_maintenance1-aware applications. * @return true if successful, false otherwise. **/ - bool alloc_descriptor_sets(uint32_t in_n_sets, - std::shared_ptr* in_descriptor_set_layouts_ptr, - std::shared_ptr* out_descriptor_sets_ptr, - VkResult* out_opt_result_ptr = nullptr); - - bool alloc_descriptor_sets(uint32_t in_n_sets, - std::shared_ptr* in_descriptor_set_layouts_ptr, - VkDescriptorSet* out_descriptor_sets_vk_ptr, - VkResult* out_opt_result_ptr = nullptr); - - /** Tells if the pool allocated from the pool can be freed with vkFreeDescriptorSet() call. */ - bool are_sets_releaseable() const + bool alloc_descriptor_sets(uint32_t in_n_sets, + const DescriptorSetAllocation* in_ds_allocations_ptr, + DescriptorSetUniquePtr* out_descriptor_sets_ptr, + VkResult* out_opt_result_ptr = nullptr); + + bool alloc_descriptor_sets(uint32_t in_n_sets, + const DescriptorSetAllocation* in_ds_allocations_ptr, + VkDescriptorSet* out_descriptor_sets_vk_ptr, + VkResult* out_opt_result_ptr = nullptr); + + const Anvil::DescriptorPoolFlags& get_flags() const { - return m_releaseable_sets; + return m_flags; } - /** Releases previously baked Vulkan pool handle and instantiates a new Vulkan object, according - * to how the wrapper has been configured. - **/ - void bake(); - /** Returns a raw Vulkan handle for the pool. * * This function may re-bake the pool object, if necessary. @@ -119,11 +115,6 @@ namespace Anvil **/ const VkDescriptorPool& get_descriptor_pool() { - if (!m_baked) - { - bake(); - } - return m_pool; } @@ -138,72 +129,31 @@ namespace Anvil **/ bool reset(); - /** Configures how many descriptors of user-specified type should be allocable for a single - * set, that's going to be allocated from the pool. - * - * This function may mark the pool as dirty, meaning it will be re-baked at the next - * get_descriptor_pool() call time. - * - * @param in_descriptor_type Type of the descriptor to adjust the number of slots. - * @param in_n_slots_in_pool Number of descriptors of the specified type to be allocable for - * a single set. - * - **/ - void set_descriptor_array_size(VkDescriptorType in_descriptor_type, - uint32_t in_n_slots_in_pool) - { - anvil_assert(in_descriptor_type < VK_DESCRIPTOR_TYPE_RANGE_SIZE); - if (in_descriptor_type < VK_DESCRIPTOR_TYPE_RANGE_SIZE) - { - if (m_descriptor_count[in_descriptor_type] != in_n_slots_in_pool) - { - m_baked = false; - m_descriptor_count[in_descriptor_type] = in_n_slots_in_pool; - } - } - } - - /** Updates the maximum number of sets which can be allocated from the pool. - * - * This function may mark the pool as dirty, meaning it will be re-baked at the next - * get_descriptor_pool() call time. - * - * @param in_n_maximum_sets New maximum number of allocable sets. - **/ - void set_n_maximum_sets(uint32_t in_n_maximum_sets) - { - anvil_assert(in_n_maximum_sets != 0); - - if (m_n_max_sets != in_n_maximum_sets) - { - m_baked = false; - m_n_max_sets = in_n_maximum_sets; - } - } private: /* Private functions */ + bool init(); + /** Constructor */ - DescriptorPool(std::weak_ptr in_device_ptr, - uint32_t in_n_max_sets, - bool in_releaseable_sets, - bool in_mt_safe); + DescriptorPool(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_n_max_sets, + const DescriptorPoolFlags& in_flags, + const uint32_t* in_descriptor_count_per_type_ptr, + bool in_mt_safe); DescriptorPool (const DescriptorPool&); DescriptorPool& operator=(const DescriptorPool&); /* Private variables */ - bool m_baked; - std::weak_ptr m_device_ptr; - VkDescriptorPool m_pool; + const Anvil::BaseDevice* m_device_ptr; + VkDescriptorPool m_pool; uint32_t m_descriptor_count[VK_DESCRIPTOR_TYPE_RANGE_SIZE]; uint32_t m_n_max_sets; std::vector m_ds_cache; std::vector m_ds_layout_cache; - - const bool m_releaseable_sets; + const DescriptorPoolFlags& m_flags; }; }; /* namespace Anvil */ diff --git a/include/wrappers/descriptor_set.h b/include/wrappers/descriptor_set.h index cf1e5743..88e7f348 100644 --- a/include/wrappers/descriptor_set.h +++ b/include/wrappers/descriptor_set.h @@ -28,8 +28,6 @@ * - cache set binding information. * - monitor layout adjustments and act accordingly. * - monitor pool reset events and act accordingly. - * - * Not thread-safe at the moment. */ #ifndef WRAPPERS_DESCRIPTOR_SET_H #define WRAPPERS_DESCRIPTOR_SET_H @@ -47,23 +45,23 @@ namespace Anvil /** Represents a single buffer object, which can be bound to a specific descriptor set slot */ typedef struct BufferBindingElement { - std::shared_ptr buffer_ptr; - VkDeviceSize size; - VkDeviceSize start_offset; + Anvil::Buffer* buffer_ptr; + VkDeviceSize size; + VkDeviceSize start_offset; /** Constructor. Associates all available buffer memory with the binding. * * @param in_buffer_ptr Buffer object to use for the binding. Must not be nullptr. **/ - BufferBindingElement(std::shared_ptr in_buffer_ptr); + BufferBindingElement(Anvil::Buffer* in_buffer_ptr); /** Constructor. Associates specified sub-region of the buffer memory with the binding. * * @param in_buffer_ptr Buffer object to use for the binding. Must not be nullptr. **/ - BufferBindingElement(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size); + BufferBindingElement(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size); /** Destructor. Releases the encapsulated buffer instance */ virtual ~BufferBindingElement(); @@ -88,15 +86,15 @@ namespace Anvil { DynamicStorageBufferBindingElement() = delete; - DynamicStorageBufferBindingElement(std::shared_ptr in_buffer_ptr) + DynamicStorageBufferBindingElement(Anvil::Buffer* in_buffer_ptr) : BufferBindingElement(in_buffer_ptr) { /* Stub */ } - DynamicStorageBufferBindingElement(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size) + DynamicStorageBufferBindingElement(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size) : BufferBindingElement(in_buffer_ptr, in_start_offset, in_size) @@ -117,15 +115,15 @@ namespace Anvil { DynamicUniformBufferBindingElement() = delete; - DynamicUniformBufferBindingElement(std::shared_ptr in_buffer_ptr) + DynamicUniformBufferBindingElement(Anvil::Buffer* in_buffer_ptr) : BufferBindingElement(in_buffer_ptr) { /* Stub */ } - DynamicUniformBufferBindingElement(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size) + DynamicUniformBufferBindingElement(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size) : BufferBindingElement(in_buffer_ptr, in_start_offset, in_size) @@ -146,15 +144,15 @@ namespace Anvil { StorageBufferBindingElement() = delete; - StorageBufferBindingElement(std::shared_ptr in_buffer_ptr) + StorageBufferBindingElement(Anvil::Buffer* in_buffer_ptr) :BufferBindingElement(in_buffer_ptr) { /* Stub */ } - StorageBufferBindingElement(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size) + StorageBufferBindingElement(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size) :BufferBindingElement(in_buffer_ptr, in_start_offset, in_size) @@ -175,15 +173,15 @@ namespace Anvil { UniformBufferBindingElement() = delete; - UniformBufferBindingElement(std::shared_ptr in_buffer_ptr) + UniformBufferBindingElement(Anvil::Buffer* in_buffer_ptr) :BufferBindingElement(in_buffer_ptr) { /* Stub */ } - UniformBufferBindingElement(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size) + UniformBufferBindingElement(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size) :BufferBindingElement(in_buffer_ptr, in_start_offset, in_size) @@ -202,9 +200,9 @@ namespace Anvil **/ typedef struct CombinedImageSamplerBindingElement { - VkImageLayout image_layout; - std::shared_ptr image_view_ptr; - std::shared_ptr sampler_ptr; + VkImageLayout image_layout; + Anvil::ImageView* image_view_ptr; + Anvil::Sampler* sampler_ptr; /** Constructor. * @@ -214,9 +212,9 @@ namespace Anvil * it will be assumed the element corresponds to an immutable * sampler. **/ - CombinedImageSamplerBindingElement(VkImageLayout in_image_layout, - std::shared_ptr in_image_view_ptr, - std::shared_ptr in_sampler_ptr); + CombinedImageSamplerBindingElement(VkImageLayout in_image_layout, + Anvil::ImageView* in_image_view_ptr, + Anvil::Sampler* in_sampler_ptr); /** Destructor. * @@ -243,16 +241,16 @@ namespace Anvil /** Holds a single image view, along with other metadata required bound it to a specific descriptor set slot */ typedef struct ImageBindingElement { - VkImageLayout image_layout; - std::shared_ptr image_view_ptr; + VkImageLayout image_layout; + Anvil::ImageView* image_view_ptr; /** Constructor. * * @param in_image_layout Image layout to use for the binding. * @param in_image_view_ptr Image view to use for the binding. Must not be nullptr. **/ - ImageBindingElement(VkImageLayout in_image_layout, - std::shared_ptr in_image_view_ptr); + ImageBindingElement(VkImageLayout in_image_layout, + Anvil::ImageView* in_image_view_ptr); /** Copy assignment operator. * @@ -280,8 +278,8 @@ namespace Anvil { InputAttachmentBindingElement() = delete; - InputAttachmentBindingElement(VkImageLayout in_image_layout, - std::shared_ptr in_image_view_ptr) + InputAttachmentBindingElement(VkImageLayout in_image_layout, + Anvil::ImageView* in_image_view_ptr) :ImageBindingElement(in_image_layout, in_image_view_ptr) { @@ -301,8 +299,8 @@ namespace Anvil { SampledImageBindingElement() = delete; - SampledImageBindingElement(VkImageLayout in_image_layout, - std::shared_ptr in_image_view_ptr) + SampledImageBindingElement(VkImageLayout in_image_layout, + Anvil::ImageView* in_image_view_ptr) :ImageBindingElement(in_image_layout, in_image_view_ptr) { @@ -322,8 +320,8 @@ namespace Anvil { StorageImageBindingElement() = delete; - StorageImageBindingElement(VkImageLayout in_image_layout, - std::shared_ptr in_image_view_ptr) + StorageImageBindingElement(VkImageLayout in_image_layout, + Anvil::ImageView* in_image_view_ptr) :ImageBindingElement(in_image_layout, in_image_view_ptr) { @@ -339,7 +337,7 @@ namespace Anvil /** Holds a single sampler. Can be used to bind a sampler to a descriptor set slot **/ typedef struct SamplerBindingElement { - std::shared_ptr sampler_ptr; + Anvil::Sampler* sampler_ptr; /** Constructor. * @@ -347,7 +345,7 @@ namespace Anvil * it will be assumed the element corresponds to an immutable * sampler. **/ - SamplerBindingElement(std::shared_ptr in_sampler_ptr); + SamplerBindingElement(Anvil::Sampler* in_sampler_ptr); /** Destructor. * @@ -374,14 +372,14 @@ namespace Anvil /** Holds a single buffer view instance. Can be used to bind a sampler to a descriptor set slot */ typedef struct TexelBufferBindingElement { - std::shared_ptr buffer_view_ptr; + Anvil::BufferView* buffer_view_ptr; /** Constructor. * * @param in_buffer_view_ptr Buffer view to use for the binding. Must not be nullptr. * Retained. The object will be released at destruction time. **/ - TexelBufferBindingElement(std::shared_ptr in_buffer_view_ptr); + TexelBufferBindingElement(Anvil::BufferView* in_buffer_view_ptr); /** Destructor. * @@ -409,7 +407,7 @@ namespace Anvil { StorageTexelBufferBindingElement() = delete; - StorageTexelBufferBindingElement(std::shared_ptr in_buffer_view_ptr) + StorageTexelBufferBindingElement(Anvil::BufferView* in_buffer_view_ptr) : TexelBufferBindingElement(in_buffer_view_ptr) { /* Stub */ @@ -428,7 +426,7 @@ namespace Anvil { UniformTexelBufferBindingElement() = delete; - UniformTexelBufferBindingElement(std::shared_ptr in_buffer_view_ptr) + UniformTexelBufferBindingElement(Anvil::BufferView* in_buffer_view_ptr) : TexelBufferBindingElement(in_buffer_view_ptr) { /* Stub */ @@ -449,48 +447,6 @@ namespace Anvil **/ virtual ~DescriptorSet(); - /** Updates internally-maintained Vulkan descriptor set instances. - * - * @return true if the function executed successfully, false otherwise. - **/ - bool bake(); - - /** Creates a new DescriptorSet instance. - * - * @param in_device_ptr Device the descriptor set has been initialized for. - * @param in_parent_pool_ptr Pool, from which the descriptor set has been allocated from. - * Must not be nullptr. - * @param in_layout_ptr Layout which has been used at descriptor set construction time. - * @param in_descriptor_set Raw Vulkan handle the wrapper instance is being created for. - **/ - static std::shared_ptr create(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_pool_ptr, - std::shared_ptr in_layout_ptr, - VkDescriptorSet in_descriptor_set, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); - - /** Tells how many array items have been declared for a binding at a given index - * - * @param in_n_binding Binding index to use for the query. - * @param out_result_ptr If the function reports success, deref will be set to the query result. - * Must not be null. - * - * @return true if successful, false otherwise. - **/ - bool get_binding_array_size(uint32_t in_n_binding, - uint32_t* out_result_ptr) const; - - /** Tells the descriptor type associated to a binding at index @param in_n_binding . - * - * @param in_n_binding Binding index to use for the query. - * @param out_descriptor_type_ptr If the function reports success, deref will be set to the query result. - * Must not be null. - * - * @return true if successful, false otherwise. - */ - bool get_binding_descriptor_type(uint32_t in_n_binding, - VkDescriptorType* out_descriptor_type_ptr) const; - /** Returns properties of a combined image/sampler descriptor binding. * * @param in_n_binding Binding index to use for the query. @@ -504,11 +460,11 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool get_combined_image_sampler_binding_properties(uint32_t in_n_binding, - uint32_t in_n_binding_array_item, - VkImageLayout* out_opt_image_layout_ptr, - std::shared_ptr* out_opt_image_view_ptr, - std::shared_ptr* out_opt_sampler_ptr); + bool get_combined_image_sampler_binding_properties(uint32_t in_n_binding, + uint32_t in_n_binding_array_item, + VkImageLayout* out_opt_image_layout_ptr, + Anvil::ImageView** out_opt_image_view_ptr_ptr, + Anvil::Sampler** out_opt_sampler_ptr_ptr); /** Retrieves raw Vulkan handle of the encapsulated descriptor set. * @@ -517,11 +473,11 @@ namespace Anvil * * @return As per description. **/ - VkDescriptorSet get_descriptor_set_vk() + VkDescriptorSet get_descriptor_set_vk() const { if (m_dirty) { - bake(); + update(); anvil_assert(!m_dirty); } @@ -530,75 +486,69 @@ namespace Anvil } /** Returns a descriptor set layout wrapper instance, assigned to the descriptor set wrapper */ - std::shared_ptr get_descriptor_set_layout() const + const Anvil::DescriptorSetLayout* get_descriptor_set_layout() const { return m_layout_ptr; } /** Returns properties of an input attachment descriptor binding. * - * @param in_n_binding Binding index to use for the query. - * @param in_n_binding_array_item Index of the array item to use for the query. - * @param out_opt_image_layout_ptr If not null, deref will be set to the image layout specified for - * the binding. May be null. - * @param out_opt_image_view_ptr If not null, deref will be set to the image view specified for - * the binding. May be null. + * @param in_n_binding Binding index to use for the query. + * @param in_n_binding_array_item Index of the array item to use for the query. + * @param out_opt_image_layout_ptr_ptr If not null, deref will be set to the image layout specified for + * the binding. May be null. + * @param out_opt_image_view_ptr_ptr If not null, deref will be set to the image view specified for + * the binding. May be null. * * @return true if successful, false otherwise. * */ - bool get_input_attachment_binding_properties(uint32_t in_n_binding, - uint32_t in_n_binding_array_item, - VkImageLayout* out_opt_image_layout_ptr, - std::shared_ptr* out_opt_image_view_ptr) const; - - /** Returns information about the number of bindings described by the descriptor set. */ - uint32_t get_n_bindings() const - { - return static_cast(m_bindings.size() ); - } + bool get_input_attachment_binding_properties(uint32_t in_n_binding, + uint32_t in_n_binding_array_item, + VkImageLayout* out_opt_image_layout_ptr_ptr, + Anvil::ImageView** out_opt_image_view_ptr_ptr) const; /** Returns properties of a sampled image descriptor binding. * - * @param in_n_binding Binding index to use for the query. - * @param in_n_binding_array_item Index of the array item to use for the query. - * @param out_opt_image_layout_ptr If not null, deref will be set to the image layout specified - * for the binding. May be null. - * @param out_opt_image_view_ptr If not null, deref will be set to the image view specified for - * the binding. May be null. + * @param in_n_binding Binding index to use for the query. + * @param in_n_binding_array_item Index of the array item to use for the query. + * @param out_opt_image_layout_ptr If not null, deref will be set to the image layout specified + * for the binding. May be null. + * @param out_opt_image_view_ptr_prt If not null, deref will be set to the image view specified for + * the binding. May be null. * * @return true if successful, false otherwise. */ - bool get_sampled_image_binding_properties(uint32_t in_n_binding, - uint32_t in_n_binding_array_item, - VkImageLayout* out_opt_image_layout_ptr, - std::shared_ptr* out_opt_image_view_ptr) const + bool get_sampled_image_binding_properties(uint32_t in_n_binding, + uint32_t in_n_binding_array_item, + VkImageLayout* out_opt_image_layout_ptr, + Anvil::ImageView** out_opt_image_view_ptr_prt) const { /* Re-use existing code */ return get_input_attachment_binding_properties(in_n_binding, in_n_binding_array_item, out_opt_image_layout_ptr, - out_opt_image_view_ptr); + out_opt_image_view_ptr_prt); } /** Returns properties of a sampler descriptor binding. * * @param in_n_binding Binding index to use for the query. * @param in_n_binding_array_item Index of the array item to use for the query. - * @param out_opt_sampler_ptr If not null, deref will be set to the sampler specified for + * @param out_sampler_ptr_ptr If not null, deref will be set to the sampler specified for * the binding. May be null. * * @return true if successful, false otherwise. */ - bool get_sampler_binding_properties(uint32_t in_n_binding, - uint32_t in_n_binding_array_item, - std::shared_ptr* out_sampler_ptr) const; + bool get_sampler_binding_properties(uint32_t in_n_binding, + uint32_t in_n_binding_array_item, + Anvil::Sampler** out_sampler_ptr_ptr) const; /** Returns properties of a storage buffer descriptor binding. * * @param in_n_binding Binding index to use for the query. * @param in_n_binding_array_item Index of the array item to use for the query. - * @param out_opt_buffer_ptr If not null, deref will be set to the buffer specified for + * @param out_opt_buffer_ptr_ptr If not null, deref will be set to the buffer specified for * the binding. May be null. * @param out_opt_size_ptr If not null, deref will be set to the size of the buffer * memory region associated with the binding. May be null. @@ -608,53 +558,53 @@ namespace Anvil * * @return true if successful, false otherwise. */ - bool get_storage_buffer_binding_properties(uint32_t in_n_binding, - uint32_t in_n_binding_array_item, - std::shared_ptr* out_opt_buffer_ptr, - VkDeviceSize* out_opt_size_ptr, - VkDeviceSize* out_opt_start_offset_ptr) const; + bool get_storage_buffer_binding_properties(uint32_t in_n_binding, + uint32_t in_n_binding_array_item, + Anvil::Buffer** out_opt_buffer_ptr_ptr, + VkDeviceSize* out_opt_size_ptr, + VkDeviceSize* out_opt_start_offset_ptr) const; /** Returns properties of a storage image descriptor binding. * - * @param in_n_binding Binding index to use for the query. - * @param in_n_binding_array_item Index of the array item to use for the query. - * @param out_opt_image_layout_ptr If not null, deref will be set to the image layout declared for - * the binding. May be null. - * @param out_opt_image_view_ptr If not null, deref will be set to the image view specified for - * the binding. May be null. + * @param in_n_binding Binding index to use for the query. + * @param in_n_binding_array_item Index of the array item to use for the query. + * @param out_opt_image_layout_ptr If not null, deref will be set to the image layout declared for + * the binding. May be null. + * @param out_opt_image_view_ptr_ptr If not null, deref will be set to the image view specified for + * the binding. May be null. * * @return true if successful, false otherwise. */ - bool get_storage_image_binding_properties(uint32_t in_n_binding, - uint32_t in_n_binding_array_item, - VkImageLayout* out_opt_image_layout_ptr, - std::shared_ptr* out_opt_image_view_ptr) const + bool get_storage_image_binding_properties(uint32_t in_n_binding, + uint32_t in_n_binding_array_item, + VkImageLayout* out_opt_image_layout_ptr, + Anvil::ImageView** out_opt_image_view_ptr_ptr) const { /* Re-use existing code */ return get_input_attachment_binding_properties(in_n_binding, in_n_binding_array_item, out_opt_image_layout_ptr, - out_opt_image_view_ptr); + out_opt_image_view_ptr_ptr); } /** Returns properties of a storage texel buffer descriptor binding. * - * @param in_n_binding Binding index to use for the query. - * @param in_n_binding_array_item Index of the array item to use for the query. - * @param out_opt_buffer_view_ptr If not null, deref will be set to the buffer view specified for - * the binding. May be null. + * @param in_n_binding Binding index to use for the query. + * @param in_n_binding_array_item Index of the array item to use for the query. + * @param out_opt_buffer_view_ptr_ptr If not null, deref will be set to the buffer view specified for + * the binding. May be null. * * @return true if successful, false otherwise. */ - bool get_storage_texel_buffer_binding_properties(uint32_t in_n_binding, - uint32_t in_n_binding_array_item, - std::shared_ptr* out_opt_buffer_view_ptr) const; + bool get_storage_texel_buffer_binding_properties(uint32_t in_n_binding, + uint32_t in_n_binding_array_item, + Anvil::BufferView** out_opt_buffer_view_ptr_ptr) const; /** Returns properties of a uniform buffer descriptor binding. * * @param in_n_binding Binding index to use for the query. * @param in_n_binding_array_item Index of the array item to use for the query. - * @param out_opt_buffer_ptr If not null, deref will be set to the buffer specified for + * @param out_opt_buffer_ptr_ptr If not null, deref will be set to the buffer specified for * the binding. May be null. * @param out_opt_size_ptr If not null, deref will be set to size of the buffer memory region * declared for the binding. May be null. @@ -663,37 +613,37 @@ namespace Anvil * * @return true if successful, false otherwise. */ - bool get_uniform_buffer_binding_properties(uint32_t in_n_binding, - uint32_t in_n_binding_array_item, - std::shared_ptr* out_opt_buffer_ptr, - VkDeviceSize* out_opt_size_ptr, - VkDeviceSize* out_opt_start_offset_ptr) const + bool get_uniform_buffer_binding_properties(uint32_t in_n_binding, + uint32_t in_n_binding_array_item, + Anvil::Buffer** out_opt_buffer_ptr_ptr, + VkDeviceSize* out_opt_size_ptr, + VkDeviceSize* out_opt_start_offset_ptr) const { /* Re-use existing code */ return get_storage_buffer_binding_properties(in_n_binding, in_n_binding_array_item, - out_opt_buffer_ptr, + out_opt_buffer_ptr_ptr, out_opt_size_ptr, out_opt_start_offset_ptr); } /** Returns properties of a uniform texel buffer descriptor binding. * - * @param in_n_binding Binding index to use for the query. - * @param in_n_binding_array_item Index of the array item to use for the query. - * @param out_opt_buffer_view_ptr If not null, deref will be set to the buffer view specified for - * the binding. May be null. + * @param in_n_binding Binding index to use for the query. + * @param in_n_binding_array_item Index of the array item to use for the query. + * @param out_opt_buffer_view_ptr_ptr If not null, deref will be set to the buffer view specified for + * the binding. May be null. * * @return true if successful, false otherwise. */ - bool get_uniform_texel_buffer_binding_properties(uint32_t in_n_binding, - uint32_t in_n_binding_array_item, - std::shared_ptr* out_opt_buffer_view_ptr) const + bool get_uniform_texel_buffer_binding_properties(uint32_t in_n_binding, + uint32_t in_n_binding_array_item, + Anvil::BufferView** out_opt_buffer_view_ptr_ptr) const { /* Re-use existing code */ return get_storage_texel_buffer_binding_properties(in_n_binding, in_n_binding_array_item, - out_opt_buffer_view_ptr); + out_opt_buffer_view_ptr_ptr); } /** This function should be set to assign physical Vulkan objects to a descriptor binding @@ -727,10 +677,33 @@ namespace Anvil template bool set_binding_array_items(BindingIndex in_binding_index, BindingElementArrayRange in_element_range, - const BindingElementType* in_elements) + const BindingElementType* in_elements_ptr) + { + anvil_assert(in_elements_ptr != nullptr); + anvil_assert(m_unusable == false); + + BindingItems& binding_items = m_bindings[in_binding_index]; + const uint32_t last_element_index = in_element_range.second + in_element_range.first; + + for (BindingElementIndex current_element_index = in_element_range.first; + current_element_index < last_element_index; + ++current_element_index) + { + m_dirty |= !(binding_items[current_element_index] == in_elements_ptr[current_element_index - in_element_range.first]); + + binding_items[current_element_index] = in_elements_ptr[current_element_index - in_element_range.first]; + } + + return true; + } + + template + bool set_binding_array_items(BindingIndex in_binding_index, + BindingElementArrayRange in_element_range, + const BindingElementType* const* in_elements_ptr_ptr) { - anvil_assert(in_elements != nullptr); - anvil_assert(m_unusable == false); + anvil_assert(in_elements_ptr_ptr != nullptr); + anvil_assert(m_unusable == false); BindingItems& binding_items = m_bindings[in_binding_index]; const uint32_t last_element_index = in_element_range.second + in_element_range.first; @@ -739,9 +712,9 @@ namespace Anvil current_element_index < last_element_index; ++current_element_index) { - m_dirty |= !(binding_items[current_element_index] == in_elements[current_element_index - in_element_range.first]); + m_dirty |= !(binding_items[current_element_index] == *in_elements_ptr_ptr[current_element_index - in_element_range.first]); - binding_items[current_element_index] = in_elements[current_element_index - in_element_range.first]; + binding_items[current_element_index] = *in_elements_ptr_ptr[current_element_index - in_element_range.first]; } return true; @@ -760,18 +733,13 @@ namespace Anvil &in_element); } - /** Assigns a new Vulkan descriptor set handle to the wrapper instance. + /** Updates internally-maintained Vulkan descriptor set instances. * - * This function should only be used internally. Its purpose is to introduce support for "recycling" of - * deprecated descriptor sets. When a descriptor set pool is reset or the descriptor set layout is adjusted, - * Descriptor Set's Vulkan handle may become obsolete. When that happens, this function can be called to - * "revive" the object by assigning it a new handle, at which point the object becomes usable again. - * Furthermore, all cached binding information will be automatically writtne to the descriptor set at - * next baking time. + * @param in_update_method Please see DescriptorSetUpdateMethod documentation for more details. * - * @param in_ds New Vulkan handle to use. Must not be VK_NULL_HANDLE. + * @return true if the function executed successfully, false otherwise. **/ - void set_new_vk_handle(VkDescriptorSet in_ds); + bool update(const DescriptorSetUpdateMethod& in_update_method = DESCRIPTOR_SET_UPDATE_METHOD_CORE) const; private: /* Private type declarations */ @@ -783,14 +751,14 @@ namespace Anvil **/ typedef struct BindingItem { - std::shared_ptr buffer_ptr; - std::shared_ptr buffer_view_ptr; - VkImageLayout image_layout; - std::shared_ptr image_view_ptr; - std::shared_ptr sampler_ptr; - VkDeviceSize size; - VkDeviceSize start_offset; - VkDescriptorType type_vk; + Anvil::Buffer* buffer_ptr; + Anvil::BufferView* buffer_view_ptr; + VkImageLayout image_layout; + Anvil::ImageView* image_view_ptr; + Anvil::Sampler* sampler_ptr; + VkDeviceSize size; + VkDeviceSize start_offset; + VkDescriptorType type_vk; bool dirty; @@ -861,6 +829,11 @@ namespace Anvil image_layout = VK_IMAGE_LAYOUT_MAX_ENUM; size = 0; start_offset = 0; + + buffer_ptr = nullptr; + buffer_view_ptr = nullptr; + image_view_ptr = nullptr; + sampler_ptr = nullptr; } /* Destructor. @@ -875,32 +848,58 @@ namespace Anvil /* Private functions */ /** Please see create() documentation for argument discussion */ - DescriptorSet(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_pool_ptr, - std::shared_ptr in_layout_ptr, - VkDescriptorSet in_descriptor_set, - bool in_mt_safe); + DescriptorSet(const Anvil::BaseDevice* in_device_ptr, + Anvil::DescriptorPool* in_parent_pool_ptr, + const Anvil::DescriptorSetLayout* in_layout_ptr, + VkDescriptorSet in_descriptor_set, + bool in_mt_safe); + + /** Creates a new DescriptorSet instance. + * + * @param in_device_ptr Device the descriptor set has been initialized for. + * @param in_parent_pool_ptr Pool, from which the descriptor set has been allocated from. + * Must not be nullptr. + * @param in_layout_ptr Layout which has been used at descriptor set construction time. + * @param in_descriptor_set Raw Vulkan handle the wrapper instance is being created for. + **/ + static DescriptorSetUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + Anvil::DescriptorPool* in_parent_pool_ptr, + const Anvil::DescriptorSetLayout* in_layout_ptr, + VkDescriptorSet in_descriptor_set, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); DescriptorSet (const DescriptorSet&); DescriptorSet& operator=(const DescriptorSet&); - void on_parent_pool_reset(); - - void alloc_bindings(); + void alloc_bindings (); + void fill_buffer_info_vk_descriptor(const Anvil::DescriptorSet::BindingItem& in_binding_item, + VkDescriptorBufferInfo* out_descriptor_ptr) const; + void fill_image_info_vk_descriptor (const Anvil::DescriptorSet::BindingItem& in_binding_item, + const bool& in_immutable_samplers_enabled, + VkDescriptorImageInfo* out_descriptor_ptr) const; + void on_parent_pool_reset (); + bool update_using_core_method () const; + bool update_using_template_method () const; /* Private variables */ - BindingIndexToBindingItemsMap m_bindings; - VkDescriptorSet m_descriptor_set; - std::weak_ptr m_device_ptr; - bool m_dirty; - std::shared_ptr m_layout_ptr; - bool m_unusable; - std::shared_ptr m_parent_pool_ptr; - - std::vector m_cached_ds_info_buffer_info_items_vk; - std::vector m_cached_ds_info_image_info_items_vk; - std::vector m_cached_ds_info_texel_buffer_info_items_vk; - std::vector m_cached_ds_write_items_vk; + BindingIndexToBindingItemsMap m_bindings; + VkDescriptorSet m_descriptor_set; + const Anvil::BaseDevice* m_device_ptr; + mutable bool m_dirty; + const Anvil::DescriptorSetLayout* m_layout_ptr; + Anvil::DescriptorPool* m_parent_pool_ptr; + bool m_unusable; + + mutable std::vector m_cached_ds_info_buffer_info_items_vk; + mutable std::vector m_cached_ds_info_image_info_items_vk; + mutable std::vector m_cached_ds_info_texel_buffer_info_items_vk; + mutable std::vector m_cached_ds_write_items_vk; + + mutable std::vector m_template_entries; + mutable std::map, Anvil::DescriptorUpdateTemplateUniquePtr> m_template_object_map; + mutable std::vector m_template_raw_data; + + friend class Anvil::DescriptorPool; }; }; diff --git a/include/wrappers/descriptor_set_group.h b/include/wrappers/descriptor_set_group.h index 2f09488d..73adac78 100644 --- a/include/wrappers/descriptor_set_group.h +++ b/include/wrappers/descriptor_set_group.h @@ -55,6 +55,7 @@ #include "misc/mt_safety.h" #include "misc/types.h" #include "wrappers/descriptor_set.h" +#include "wrappers/descriptor_set_layout.h" namespace Anvil { @@ -99,11 +100,11 @@ namespace Anvil * @param in_device_ptr Device to use. * @param in_ds_info_ptrs TODO. */ - static std::shared_ptr create(std::weak_ptr in_device_ptr, - std::vector >& in_ds_info_ptrs, - bool in_releaseable_sets, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, - const std::vector& in_opt_overhead_allocations = std::vector() ); + static Anvil::DescriptorSetGroupUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + std::vector& in_ds_info_ptrs, + bool in_releaseable_sets, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + const std::vector& in_opt_overhead_allocations = std::vector() ); /** Creates a new DescriptorSetGroup instance. * @@ -114,8 +115,8 @@ namespace Anvil * @param in_parent_dsg_ptr Pointer to a DSG without a parent. Must not be nullptr. * @param in_releaseable_sets See the documentation above for more details. **/ - static std::shared_ptr create(std::shared_ptr in_parent_dsg_ptr, - bool in_releaseable_sets); + static DescriptorSetGroupUniquePtr create(const DescriptorSetGroup* in_parent_dsg_ptr, + bool in_releaseable_sets); /** Retrieves a Vulkan instance of the descriptor set, as configured for the DSG instance's set * at index @param in_n_set. @@ -127,7 +128,10 @@ namespace Anvil * * @return Pointer to the requested Anvil::DescriptorSet instance. **/ - std::shared_ptr get_descriptor_set(uint32_t in_n_set) const; + Anvil::DescriptorSet* get_descriptor_set(uint32_t in_n_set); + + const std::vector* get_descriptor_set_info() const; + const Anvil::DescriptorSetInfo* get_descriptor_set_info(uint32_t in_n_set) const; /** Retrieves a Vulkan instace of the descriptor set layout, as configured for the DSG instance's * set at index @param in_n_set. @@ -136,7 +140,7 @@ namespace Anvil * * @return Requested Anvil::DescriptorSetLayout instance. */ - std::shared_ptr get_descriptor_set_layout(uint32_t in_n_set) const; + Anvil::DescriptorSetLayout* get_descriptor_set_layout(uint32_t in_n_set) const; /** Returns the total number of added descriptor sets. * @@ -183,20 +187,42 @@ namespace Anvil bool set_binding_array_items(uint32_t in_n_set, BindingIndex in_binding_index, BindingElementArrayRange in_element_range, - const BindingElementType* in_elements) + const BindingElementType* in_elements_ptr) + { + anvil_assert(m_descriptor_sets.find(in_n_set) != m_descriptor_sets.end() ); + + if (m_descriptor_sets[in_n_set]->descriptor_set_ptr == nullptr) + { + bake_descriptor_sets(); + + anvil_assert(m_descriptor_sets[in_n_set]->descriptor_set_ptr != nullptr); + } + + m_descriptor_sets[in_n_set]->descriptor_set_ptr->set_binding_array_items(in_binding_index, + in_element_range, + in_elements_ptr); + + return true; + } + + template + bool set_binding_array_items(uint32_t in_n_set, + BindingIndex in_binding_index, + BindingElementArrayRange in_element_range, + const BindingElementType* const* in_elements_ptr_ptr) { anvil_assert(m_descriptor_sets.find(in_n_set) != m_descriptor_sets.end() ); - if (m_descriptor_sets[in_n_set].descriptor_set_ptr == nullptr) + if (m_descriptor_sets[in_n_set]->descriptor_set_ptr == nullptr) { bake_descriptor_sets(); - anvil_assert(m_descriptor_sets[in_n_set].descriptor_set_ptr != nullptr); + anvil_assert(m_descriptor_sets[in_n_set]->descriptor_set_ptr != nullptr); } - m_descriptor_sets[in_n_set].descriptor_set_ptr->set_binding_array_items(in_binding_index, - in_element_range, - in_elements); + m_descriptor_sets[in_n_set]->descriptor_set_ptr->set_binding_array_items(in_binding_index, + in_element_range, + in_elements_ptr_ptr); return true; } @@ -220,63 +246,53 @@ namespace Anvil /* Private type declarations */ /* Encapsulates all info related to a single descriptor set */ - typedef struct DescriptorSetInfo + typedef struct DescriptorSetInfoContainer { - std::shared_ptr descriptor_set_ptr; - std::shared_ptr layout_ptr; + Anvil::DescriptorSetUniquePtr descriptor_set_ptr; + Anvil::DescriptorSetLayoutUniquePtr layout_ptr; /* Dummy constructor */ - DescriptorSetInfo() + DescriptorSetInfoContainer() { /* Stub */ } - /** Copy constructor. - * - * Retains non-null descriptor set and layout wrapper instances. - **/ - DescriptorSetInfo(const DescriptorSetInfo& in); - - /** Assignment operator. - * - * Retains non-null descriptor set and layout wrapper instances. - **/ - DescriptorSetInfo& operator=(const DescriptorSetInfo& in); - /** Deinitializes a DescriptorSet instance by releasing the Vulkan descriptor set layout object, * if it's not nullptr. * * The function does not release the VkDescriptorSet instance it also holds. This object * should be released by the DescriptorSetGroup destructor instead. */ - ~DescriptorSetInfo(); - } DescriptorSetInfo; + ~DescriptorSetInfoContainer(); + } DescriptorSetInfoContainer; /* Private functions */ /** Please see create() documentation for more details. */ - DescriptorSetGroup(std::weak_ptr in_device_ptr, - std::vector > in_ds_info_ptrs, - bool in_releaseable_sets, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, - const std::vector& in_opt_overhead_allocations = std::vector() ); + DescriptorSetGroup(const Anvil::BaseDevice* in_device_ptr, + std::vector in_ds_info_ptrs, + bool in_releaseable_sets, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + const std::vector& in_opt_overhead_allocations = std::vector() ); /** Please see create() documentation for more details. */ - DescriptorSetGroup(std::shared_ptr in_parent_dsg_ptr, - bool in_releaseable_sets); + DescriptorSetGroup(const DescriptorSetGroup* in_parent_dsg_ptr, + bool in_releaseable_sets); - void bake_descriptor_pool(); + bool bake_descriptor_pool(); bool bake_descriptor_sets(); /* Private members */ - mutable std::shared_ptr m_descriptor_pool_ptr; - mutable std::map m_descriptor_sets; - std::weak_ptr m_device_ptr; - std::vector > m_ds_info_ptrs; - uint32_t m_overhead_allocations[VK_DESCRIPTOR_TYPE_RANGE_SIZE]; - - std::shared_ptr m_parent_dsg_ptr; - bool m_releaseable_sets; + mutable DescriptorPoolUniquePtr m_descriptor_pool_ptr; + mutable std::map > m_descriptor_sets; + const Anvil::BaseDevice* m_device_ptr; + std::vector m_ds_info_ptrs; + uint32_t m_overhead_allocations [VK_DESCRIPTOR_TYPE_RANGE_SIZE]; + uint32_t m_pool_size_per_descriptor_type[VK_DESCRIPTOR_TYPE_RANGE_SIZE]; + + uint32_t m_n_unique_dses; + const Anvil::DescriptorSetGroup* m_parent_dsg_ptr; + bool m_releaseable_sets; ANVIL_DISABLE_ASSIGNMENT_OPERATOR(DescriptorSetGroup); ANVIL_DISABLE_COPY_CONSTRUCTOR(DescriptorSetGroup); diff --git a/include/wrappers/descriptor_set_layout.h b/include/wrappers/descriptor_set_layout.h index 63be9291..d676ff76 100644 --- a/include/wrappers/descriptor_set_layout.h +++ b/include/wrappers/descriptor_set_layout.h @@ -61,9 +61,9 @@ namespace Anvil * @param in_device_ptr Device the layout will be created for. * **/ - static std::shared_ptr create(std::unique_ptr in_ds_info_ptr, - std::weak_ptr in_device_ptr, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static DescriptorSetLayoutUniquePtr create(DescriptorSetInfoUniquePtr in_ds_info_ptr, + const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); const Anvil::DescriptorSetInfo* get_info() const { @@ -77,13 +77,26 @@ namespace Anvil * * @return As per description. **/ - VkDescriptorSetLayout get_layout() + VkDescriptorSetLayout get_layout() const { anvil_assert(m_layout != VK_NULL_HANDLE); return m_layout; } + /* Checks if the specified descriptor set layout create info structure can be used to create a descriptor set layout instance. + * + * The app should call this function if the DS create info structure defines a number of descriptors that exceeds the + * VkPhysicalDeviceMaintenance3PropertiesKHR::maxPerSetDescriptors limit. + * + * Requires VK_KHR_maintenance3. + * + * @param in_ds_create_info_ptr Instance obtained by calling DescriptorSetInfo::create_descriptor_set_layout_create_info(). + * Must not be null. + */ + static bool meets_max_per_set_descriptors_limit(const DescriptorSetLayoutCreateInfoContainer* in_ds_create_info_ptr, + const Anvil::BaseDevice* in_device_ptr); + private: /* Private functions */ @@ -97,19 +110,17 @@ namespace Anvil bool init(); /* Please see create() documentation for more details */ - DescriptorSetLayout(std::unique_ptr in_ds_info_ptr, - std::weak_ptr in_device_ptr, - bool in_mt_safe); + DescriptorSetLayout(DescriptorSetInfoUniquePtr in_ds_info_ptr, + const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe); DescriptorSetLayout (const DescriptorSetLayout&); DescriptorSetLayout& operator=(const DescriptorSetLayout&); /* Private variables */ - std::weak_ptr m_device_ptr; - std::unique_ptr m_info_ptr; - VkDescriptorSetLayout m_layout; - - friend class std::shared_ptr; + const Anvil::BaseDevice* m_device_ptr; + DescriptorSetInfoUniquePtr m_info_ptr; + VkDescriptorSetLayout m_layout; }; }; /* namespace Anvil */ diff --git a/include/wrappers/descriptor_set_layout_manager.h b/include/wrappers/descriptor_set_layout_manager.h new file mode 100644 index 00000000..711594f3 --- /dev/null +++ b/include/wrappers/descriptor_set_layout_manager.h @@ -0,0 +1,81 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#ifndef DESCRIPTOR_SET_LAYOUT_MANAGER_H +#define DESCRIPTOR_SET_LAYOUT_MANAGER_H + +#include "misc/mt_safety.h" +#include "misc/types.h" + +namespace Anvil +{ + class DescriptorSetLayoutManager : public MTSafetySupportProvider + { + public: + /* Public functions */ + + /** Destructor */ + ~DescriptorSetLayoutManager(); + + bool get_layout(const DescriptorSetInfo* in_ds_info_ptr, + Anvil::DescriptorSetLayoutUniquePtr* out_ds_layout_ptr_ptr); + + protected: + /* Protected functions */ + + private: + /* Private type declarations */ + typedef struct DescriptorSetLayoutContainer + { + DescriptorSetLayoutUniquePtr ds_layout_ptr; + std::atomic n_references; + + DescriptorSetLayoutContainer() + :n_references(1) + { + /* Stub */ + } + } DescriptorSetLayoutContainer; + + typedef std::vector > DescriptorSetLayouts; + + /* Private functions */ + DescriptorSetLayoutManager(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe); + + DescriptorSetLayoutManager (const DescriptorSetLayoutManager&); + DescriptorSetLayoutManager& operator=(const DescriptorSetLayoutManager&); + + void on_descriptor_set_layout_dereferenced(Anvil::DescriptorSetLayout* in_layout_ptr); + + static Anvil::DescriptorSetLayoutManagerUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe); + + /* Private members */ + const Anvil::BaseDevice* m_device_ptr; + DescriptorSetLayouts m_descriptor_set_layouts; + + friend class BaseDevice; + }; +}; /* Vulkan namespace */ + +#endif /* DESCRIPTOR_SET_LAYOUT_MANAGER_H */ \ No newline at end of file diff --git a/include/wrappers/descriptor_update_template.h b/include/wrappers/descriptor_update_template.h new file mode 100644 index 00000000..6b9ec2a4 --- /dev/null +++ b/include/wrappers/descriptor_update_template.h @@ -0,0 +1,97 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#ifndef WRAPPERS_DESCRIPTOR_UPDATE_TEMPLATE_H +#define WRAPPERS_DESCRIPTOR_UPDATE_TEMPLATE_H + +#include "misc/debug_marker.h" +#include "misc/mt_safety.h" +#include "misc/types.h" + +namespace Anvil +{ + /* Descriptor Update Template wrapper */ + class DescriptorUpdateTemplate : public DebugMarkerSupportProvider, + public MTSafetySupportProvider + { + public: + /* Public functions */ + + /** Destructor. + * + * Destroys the Vulkan counterpart and unregisters the instance from the + * object tracker. + **/ + virtual ~DescriptorUpdateTemplate(); + + /** Creates a new DescriptorUpdateTemplate instance. + * + * @param in_device_ptr Device the layout will be created for. Must not be null. + * @param in_descriptor_set_layout_ptr DS layout to use as reference when creating the template. + * The function caches layout info internaly, so the object may be safely released + * after this function leaves. Must not be null. + * + **/ + static Anvil::DescriptorUpdateTemplateUniquePtr create_for_descriptor_set_updates(const Anvil::BaseDevice* in_device_ptr, + const Anvil::DescriptorSetLayout* in_descriptor_set_layout_ptr, + const std::vector& in_update_entries, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + { + return create_for_descriptor_set_updates(in_device_ptr, + in_descriptor_set_layout_ptr, + &in_update_entries.at(0), + static_cast(in_update_entries.size() ), + in_mt_safety); + } + + static Anvil::DescriptorUpdateTemplateUniquePtr create_for_descriptor_set_updates(const Anvil::BaseDevice* in_device_ptr, + const Anvil::DescriptorSetLayout* in_descriptor_set_layout_ptr, + const Anvil::DescriptorUpdateTemplateEntry* in_update_entries_ptr, + const uint32_t& in_n_update_entries, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + + /* Issues a MT-safe (if needed) vkUpdateDescriptorSetWithTeeplateKHR() call against the specified descriptor set. */ + void update_descriptor_set(const Anvil::DescriptorSet* inout_ds_ptr, + const void* in_data_ptr) const; + + private: + /* Private functions */ + + bool init(const Anvil::DescriptorSetLayout* in_descriptor_set_layout_ptr, + const Anvil::DescriptorUpdateTemplateEntry* in_update_entries_ptr, + const uint32_t& in_n_update_entries); + + /* Please see create() documentation for more details */ + DescriptorUpdateTemplate(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe); + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(DescriptorUpdateTemplate); + ANVIL_DISABLE_COPY_CONSTRUCTOR (DescriptorUpdateTemplate); + + /* Private variables */ + const Anvil::BaseDevice* m_device_ptr; + Anvil::DescriptorSetInfoUniquePtr m_ds_info_ptr; + VkDescriptorUpdateTemplateKHR m_vk_object; + }; +}; /* namespace Anvil */ + +#endif /* WRAPPERS_DESCRIPTOR_UPDATE_TEMPLATE_H */ diff --git a/include/wrappers/device.h b/include/wrappers/device.h index 820b1f1d..08e3ff2e 100644 --- a/include/wrappers/device.h +++ b/include/wrappers/device.h @@ -38,37 +38,35 @@ namespace Anvil { - class BaseDevice : public Anvil::MTSafetySupportProvider, - public std::enable_shared_from_this + class BaseDevice : public Anvil::MTSafetySupportProvider { public: /* Public functions */ /* Constructor */ - BaseDevice(std::weak_ptr in_parent_instance_ptr, - bool in_mt_safe); + BaseDevice(const Anvil::Instance* in_parent_instance_ptr, + bool in_mt_safe); - /** Releases all children queues and unregisters itself from the owning physical device. */ - virtual void destroy(); + virtual ~BaseDevice(); - /** Retrieves a command pool, created for the specified queue family type. + /** Retrieves a command pool, created for the specified queue family index. * - * @param in_queue_family_type Queue family to retrieve the command pool for. + * @param in_vk_queue_family_index Vulkan index of the queue family to return the command pool for. * * @return As per description **/ - std::shared_ptr get_command_pool(Anvil::QueueFamilyType in_queue_family_type) const + Anvil::CommandPool* get_command_pool_for_queue_family_index(uint32_t in_vk_queue_family_index) const { - return m_command_pool_ptrs[in_queue_family_type]; + return m_command_pool_ptr_per_vk_queue_fam.at(in_vk_queue_family_index).get(); } /** Retrieves a compute pipeline manager, created for this device instance. * * @return As per description **/ - std::shared_ptr get_compute_pipeline_manager() const + Anvil::ComputePipelineManager* get_compute_pipeline_manager() const { - return m_compute_pipeline_manager_ptr; + return m_compute_pipeline_manager_ptr.get(); } /** Returns a Queue instance, corresponding to a compute queue at index @param in_n_queue @@ -77,18 +75,23 @@ namespace Anvil * * @return As per description **/ - std::shared_ptr get_compute_queue(uint32_t in_n_queue) const + Anvil::Queue* get_compute_queue(uint32_t in_n_queue) const { - std::shared_ptr result_ptr; + Anvil::Queue* result_ptr = nullptr; if (m_compute_queues.size() > in_n_queue) { - result_ptr = m_compute_queues[in_n_queue]; + result_ptr = m_compute_queues.at(in_n_queue); } return result_ptr; } + Anvil::DescriptorSetLayoutManager* get_descriptor_set_layout_manager() const + { + return m_descriptor_set_layout_manager_ptr.get(); + } + /** Retrieves a raw Vulkan handle for this device. * * @return As per description @@ -102,14 +105,14 @@ namespace Anvil * * Do NOT release. This object is owned by Device and will be released at object tear-down time. **/ - std::shared_ptr get_dummy_descriptor_set() const; + const Anvil::DescriptorSet* get_dummy_descriptor_set() const; /** Retrieves a DescriptorSetLayout instance, which encapsulates a single descriptor set layout, * which holds 1 descriptor set holding 0 descriptors. * * Do NOT release. This object is owned by Device and will be released at object tear-down time. **/ - std::shared_ptr get_dummy_descriptor_set_layout() const; + Anvil::DescriptorSetLayout* get_dummy_descriptor_set_layout() const; /** Returns a container with entry-points to functions introduced by VK_AMD_draw_indirect_count extension. * @@ -144,6 +147,22 @@ namespace Anvil return m_ext_debug_marker_extension_entrypoints; } + /** Returns a container with entry-points to functions introduced by VK_KHR_bind_memory2 extension. **/ + const ExtensionKHRBindMemory2Entrypoints& get_extension_khr_bind_memory2_entrypoints() const + { + anvil_assert(m_khr_bind_memory2_enabled); + + return m_khr_bind_memory2_extension_entrypoints; + } + + /** Returns a container with entry-points to functions introduced by VK_KHR_descriptor_update_template extension. **/ + const ExtensionKHRDescriptorUpdateTemplateEntrypoints& get_extension_khr_descriptor_update_template_entrypoints() const + { + anvil_assert(m_khr_descriptor_update_template_enabled); + + return m_khr_descriptor_update_template_extension_entrypoints; + } + /** Returns a container with entry-points to functions introduced by VK_KHR_maintenance1 extension. **/ const ExtensionKHRMaintenance1Entrypoints& get_extension_khr_maintenance1_entrypoints() const { @@ -152,6 +171,14 @@ namespace Anvil return m_khr_maintenance1_extension_entrypoints; } + /** Returns a container with entry-points to functions introduced by VK_KHR_maintenance3 extension. **/ + const ExtensionKHRMaintenance3Entrypoints& get_extension_khr_maintenance3_entrypoints() const + { + anvil_assert(m_khr_maintenance3_enabled); + + return m_khr_maintenance3_extension_entrypoints; + } + /** Returns a container with entry-points to functions introduced by VK_KHR_swapchain extension. * * Will fire an assertion failure if the extension was not requested at device creation time. @@ -167,9 +194,9 @@ namespace Anvil * * @return As per description **/ - std::shared_ptr get_graphics_pipeline_manager() const + Anvil::GraphicsPipelineManager* get_graphics_pipeline_manager() const { - return m_graphics_pipeline_manager_ptr; + return m_graphics_pipeline_manager_ptr.get(); } /** Returns the number of compute queues supported by this device. @@ -196,9 +223,9 @@ namespace Anvil switch (in_family_type) { - case QUEUE_FAMILY_TYPE_COMPUTE: result = static_cast(m_compute_queues.size() ); break; - case QUEUE_FAMILY_TYPE_TRANSFER: result = static_cast(m_transfer_queues.size() ); break; - case QUEUE_FAMILY_TYPE_UNIVERSAL: result = static_cast(m_universal_queues.size() ); break; + case Anvil::QueueFamilyType::COMPUTE: result = static_cast(m_compute_queues.size() ); break; + case Anvil::QueueFamilyType::TRANSFER: result = static_cast(m_transfer_queues.size() ); break; + case Anvil::QueueFamilyType::UNIVERSAL: result = static_cast(m_universal_queues.size() ); break; default: { @@ -238,7 +265,7 @@ namespace Anvil } /** Returns Vulkan instance wrapper used to create this device. */ - std::weak_ptr get_parent_instance() const + const Anvil::Instance* get_parent_instance() const { return m_parent_instance_ptr; } @@ -246,7 +273,7 @@ namespace Anvil /** Returns features supported by physical device(s) which have been used to instantiate * this logical device instance. **/ - virtual const VkPhysicalDeviceFeatures& get_physical_device_features() const = 0; + virtual const Anvil::PhysicalDeviceFeatures& get_physical_device_features() const = 0; /** Returns format properties, as reported by physical device(s) which have been used to * instantiate this logical device instance. @@ -283,7 +310,7 @@ namespace Anvil /** Returns general physical device properties, as reported by physical device(s) which have been used * to instantiate this logical device instance. **/ - virtual const VkPhysicalDeviceProperties& get_physical_device_properties() const = 0; + virtual const Anvil::PhysicalDeviceProperties& get_physical_device_properties() const = 0; /** Returns queue families available for the physical device(s) used to instantiate this * logical device instance. @@ -314,25 +341,25 @@ namespace Anvil /** Returns surface capabilities, as reported for physical device(s) which have been used to instantiate * this logical device instance. **/ - virtual bool get_physical_device_surface_capabilities(std::shared_ptr in_surface_ptr, - VkSurfaceCapabilitiesKHR* out_result_ptr) const = 0; + virtual bool get_physical_device_surface_capabilities(Anvil::RenderingSurface* in_surface_ptr, + VkSurfaceCapabilitiesKHR* out_result_ptr) const = 0; /** Returns a pipeline cache, created specifically for this device. * * @return As per description **/ - std::shared_ptr get_pipeline_cache() const + Anvil::PipelineCache* get_pipeline_cache() const { - return m_pipeline_cache_ptr; + return m_pipeline_cache_ptr.get(); } /** Returns a pipeline layout manager, created specifically for this device. * * @return As per description **/ - std::shared_ptr get_pipeline_layout_manager() const + Anvil::PipelineLayoutManager* get_pipeline_layout_manager() const { - return m_pipeline_layout_manager_ptr; + return m_pipeline_layout_manager_ptr.get(); } /** Calls the device-specific implementaton of vkGetDeviceProcAddr(), using this device @@ -347,11 +374,16 @@ namespace Anvil return vkGetDeviceProcAddr(m_device, in_name); } + PFN_vkVoidFunction get_proc_address(const std::string& in_name) const { return get_proc_address(in_name.c_str() ); } + /** TODO */ + Anvil::Queue* get_queue(const Anvil::QueueFamilyType& in_queue_family_type, + uint32_t in_n_queue) const; + /* Returns a Queue instance representing a Vulkan queue from queue family @param in_n_queue_family * at index @param in_n_queue. * @@ -360,32 +392,22 @@ namespace Anvil * * @return Requested Queue instance OR nullptr if either of the parameters is invalid. */ - std::shared_ptr get_queue(uint32_t in_n_queue_family, - uint32_t in_n_queue) const; + Anvil::Queue* get_queue_for_queue_family_index(uint32_t in_n_queue_family, + uint32_t in_n_queue) const; - /** Returns a index of the specified queue family type. + /** TODO * - * @param in_family_type TODO - * - * @return The requested queue family index, or -1 if the specified queue family type is - * not supported on this device. - **/ - uint32_t get_queue_family_index(Anvil::QueueFamilyType in_family_type) const - { - return m_device_queue_families.family_index[in_family_type]; - } + * NOTE: A single Anvil queue family MAY map onto more than one Vulkan queue family type. The same is not true the other way around. + */ + bool get_queue_family_indices_for_queue_family_type(const Anvil::QueueFamilyType& in_queue_family_type, + uint32_t* out_opt_n_queue_family_indices_ptr, + const uint32_t** out_opt_queue_family_indices_ptr_ptr) const; - /** Returns queue family type for the specified queue family index. + /** TODO. * - * @param in_queue_family_index TODO - * - * @return The requested information OR Anvil::QUEUE_FAMILY_TYPE_UNDEFINED if the index has - * not been recognized. + * NOTE: Anvil's queue family may map onto more than one Vulkan queue family. The same is not true the other way around. */ - Anvil::QueueFamilyType get_queue_family_type(uint32_t in_queue_family_index) const - { - return m_device_queue_families.family_type[in_queue_family_index]; - } + Anvil::QueueFamilyType get_queue_family_type(uint32_t in_queue_family_index) const; /** Returns detailed queue family information for a queue family at index @param in_queue_family_index . */ virtual const Anvil::QueueFamilyInfo* get_queue_family_info(uint32_t in_queue_family_index) const = 0; @@ -403,6 +425,12 @@ namespace Anvil bool get_sample_locations(VkSampleCountFlagBits in_sample_count, std::vector* out_result_ptr) const; + /** Returns shader module cache instance */ + Anvil::ShaderModuleCache* get_shader_module_cache() const + { + return m_shader_module_cache_ptr.get(); + } + /** Returns a Queue instance, corresponding to a sparse binding-capable queue at index @param in_n_queue, * which supports queue family capabilities specified with @param opt_required_queue_flags. * @@ -412,8 +440,8 @@ namespace Anvil * * @return As per description **/ - std::shared_ptr get_sparse_binding_queue(uint32_t in_n_queue, - VkQueueFlags in_opt_required_queue_flags = 0) const; + Anvil::Queue* get_sparse_binding_queue(uint32_t in_n_queue, + VkQueueFlags in_opt_required_queue_flags = 0) const; /** Returns a Queue instance, corresponding to a transfer queue at index @param in_n_queue * @@ -421,13 +449,13 @@ namespace Anvil * * @return As per description **/ - std::shared_ptr get_transfer_queue(uint32_t in_n_queue) const + Anvil::Queue* get_transfer_queue(uint32_t in_n_queue) const { - std::shared_ptr result_ptr; + Anvil::Queue* result_ptr = nullptr; if (m_transfer_queues.size() > in_n_queue) { - result_ptr = m_transfer_queues[in_n_queue]; + result_ptr = m_transfer_queues.at(in_n_queue); } return result_ptr; @@ -439,13 +467,13 @@ namespace Anvil * * @return As per description **/ - std::shared_ptr get_universal_queue(uint32_t in_n_queue) const + Anvil::Queue* get_universal_queue(uint32_t in_n_queue) const { - std::shared_ptr result_ptr; + Anvil::Queue* result_ptr = nullptr; if (m_universal_queues.size() > in_n_queue) { - result_ptr = m_universal_queues[in_n_queue]; + result_ptr = m_universal_queues.at(in_n_queue); } return result_ptr; @@ -494,6 +522,16 @@ namespace Anvil return m_amd_shader_explicit_vertex_parameter_enabled; } + bool is_amd_shader_fragment_mask_extension_enabled() const + { + return m_amd_shader_fragment_mask_enabled; + } + + bool is_amd_shader_image_load_store_lod_enabled() const + { + return m_amd_shader_image_load_store_lod_enabled; + } + bool is_amd_shader_info_extension_enabled() const { return m_amd_shader_info_enabled; @@ -509,6 +547,8 @@ namespace Anvil return m_amd_texture_gather_bias_lod_enabled; } + bool is_compute_queue_family_index(const uint32_t& in_queue_family_index) const; + bool is_ext_shader_stencil_export_extension_enabled() const { return m_ext_shader_stencil_export_enabled; @@ -547,11 +587,26 @@ namespace Anvil return m_khr_16bit_storage_enabled; } + bool is_khr_descriptor_update_template_extension_enabled() const + { + return m_khr_descriptor_update_template_enabled; + } + + bool is_khr_bind_memory2_extension_enabled() const + { + return m_khr_bind_memory2_enabled; + } + bool is_khr_maintenance1_extension_enabled() const { return m_khr_maintenance1_enabled; } + bool is_khr_maintenance3_extension_enabled() const + { + return m_khr_maintenance3_enabled; + } + bool is_khr_storage_buffer_storage_class_enabled() const { return m_khr_storage_buffer_storage_class_enabled; @@ -567,37 +622,66 @@ namespace Anvil return m_khr_swapchain_enabled; } - bool wait_idle(); + bool is_transfer_queue_family_index(const uint32_t& in_queue_family_index) const; + + bool is_universal_queue_family_index(const uint32_t& in_queue_family_index) const; + + bool wait_idle() const; protected: /* Protected type definitions */ + + typedef struct DeviceQueueFamilyMemberInfo + { + uint32_t family_index; + uint32_t n_queues; + + DeviceQueueFamilyMemberInfo() + :family_index(UINT32_MAX), + n_queues (UINT32_MAX) + { + /* Stub */ + } + + explicit DeviceQueueFamilyMemberInfo(uint32_t in_family_index, + uint32_t in_n_queues) + :family_index(in_family_index), + n_queues (in_n_queues) + { + /* Stub */ + } + + bool operator==(const uint32_t& in_family_index) const + { + return family_index == in_family_index; + } + } DeviceQueueFamilyMemberInfo; + typedef struct { - uint32_t family_index[Anvil::QUEUE_FAMILY_TYPE_COUNT]; - Anvil::QueueFamilyType family_type [Anvil::QUEUE_FAMILY_TYPE_COUNT]; - uint32_t n_queues [Anvil::QUEUE_FAMILY_TYPE_COUNT]; + uint32_t n_total_queues_per_family[static_cast(Anvil::QueueFamilyType::COUNT)]; + std::map > queue_families; } DeviceQueueFamilyInfo; /* Protected functions */ - virtual ~BaseDevice(); - std::vector get_queue_priorities(const QueueFamilyInfo* in_queue_family_info_ptr) const; void init (const DeviceExtensionConfiguration& in_extensions, const std::vector& in_layers, bool in_transient_command_buffer_allocs_only, - bool in_support_resettable_command_buffer_allocs); + bool in_support_resettable_command_buffer_allocs, + bool in_enable_shader_module_cache); BaseDevice& operator=(const BaseDevice&); BaseDevice (const BaseDevice&); - /** Retrieves family indices of compute, DMA, graphics and transfer queue families for the specified physical device. + /** Retrieves family indices of compute, DMA, graphics, transfer queue families for the specified physical device. * * @param in_physical_device_ptr Physical device to use for the query. * @param out_device_queue_family_info_ptr Deref will be used to store the result info. Must not be null. * **/ - virtual void get_queue_family_indices_for_physical_device(std::weak_ptr in_physical_device_ptr, - DeviceQueueFamilyInfo* out_device_queue_family_info_ptr) const; + virtual void get_queue_family_indices_for_physical_device(const Anvil::PhysicalDevice* in_physical_device_ptr, + DeviceQueueFamilyInfo* out_device_queue_family_info_ptr) const; virtual void create_device (const std::vector& in_extensions, const std::vector& in_layers, @@ -608,24 +692,30 @@ namespace Anvil virtual bool is_physical_device_extension_supported(const std::string& in_extension_name) const = 0; /* Protected variables */ - std::vector > m_compute_queues; - DeviceQueueFamilyInfo m_device_queue_families; - std::vector > m_sparse_binding_queues; - std::vector > m_transfer_queues; - std::vector > m_universal_queues; + std::vector m_compute_queues; + DeviceQueueFamilyInfo m_device_queue_families; + std::vector m_sparse_binding_queues; + std::vector m_transfer_queues; + std::vector m_universal_queues; + + std::vector > m_owned_queues; - std::map > > m_queue_fams; + std::map m_queue_family_index_to_type; + std::map > m_queue_family_type_to_queue_family_indices; + std::map > m_queue_ptrs_per_vk_queue_fam; /* Protected variables */ - bool m_destroyed; VkDevice m_device; - ExtensionAMDDrawIndirectCountEntrypoints m_amd_draw_indirect_count_extension_entrypoints; - ExtensionAMDShaderInfoEntrypoints m_amd_shader_info_extension_entrypoints; - ExtensionEXTDebugMarkerEntrypoints m_ext_debug_marker_extension_entrypoints; - ExtensionKHRMaintenance1Entrypoints m_khr_maintenance1_extension_entrypoints; - ExtensionKHRSurfaceEntrypoints m_khr_surface_extension_entrypoints; - ExtensionKHRSwapchainEntrypoints m_khr_swapchain_extension_entrypoints; + ExtensionAMDDrawIndirectCountEntrypoints m_amd_draw_indirect_count_extension_entrypoints; + ExtensionAMDShaderInfoEntrypoints m_amd_shader_info_extension_entrypoints; + ExtensionEXTDebugMarkerEntrypoints m_ext_debug_marker_extension_entrypoints; + ExtensionKHRBindMemory2Entrypoints m_khr_bind_memory2_extension_entrypoints; + ExtensionKHRDescriptorUpdateTemplateEntrypoints m_khr_descriptor_update_template_extension_entrypoints; + ExtensionKHRMaintenance1Entrypoints m_khr_maintenance1_extension_entrypoints; + ExtensionKHRMaintenance3Entrypoints m_khr_maintenance3_extension_entrypoints; + ExtensionKHRSurfaceEntrypoints m_khr_surface_extension_entrypoints; + ExtensionKHRSwapchainEntrypoints m_khr_swapchain_extension_entrypoints; private: /* Private variables */ @@ -637,6 +727,8 @@ namespace Anvil bool m_amd_rasterization_order_enabled; bool m_amd_shader_ballot_enabled; bool m_amd_shader_explicit_vertex_parameter_enabled; + bool m_amd_shader_fragment_mask_enabled; + bool m_amd_shader_image_load_store_lod_enabled; bool m_amd_shader_info_enabled; bool m_amd_shader_trinary_minmax_enabled; bool m_amd_texture_gather_bias_lod_enabled; @@ -645,22 +737,26 @@ namespace Anvil bool m_ext_shader_subgroup_ballot_enabled; bool m_ext_shader_subgroup_vote_enabled; bool m_khr_16bit_storage_enabled; + bool m_khr_bind_memory2_enabled; + bool m_khr_descriptor_update_template_enabled; bool m_khr_maintenance1_enabled; + bool m_khr_maintenance3_enabled; bool m_khr_storage_buffer_storage_class_enabled; bool m_khr_surface_enabled; bool m_khr_swapchain_enabled; - std::shared_ptr m_compute_pipeline_manager_ptr; - std::shared_ptr m_dummy_dsg_ptr; - std::vector m_enabled_extensions; - std::shared_ptr m_graphics_pipeline_manager_ptr; - std::shared_ptr m_parent_instance_ptr; - std::shared_ptr m_pipeline_cache_ptr; - std::shared_ptr m_pipeline_layout_manager_ptr; - uint32_t m_queue_family_index[Anvil::QUEUE_FAMILY_TYPE_COUNT]; + std::unique_ptr m_compute_pipeline_manager_ptr; + DescriptorSetLayoutManagerUniquePtr m_descriptor_set_layout_manager_ptr; + Anvil::DescriptorSetGroupUniquePtr m_dummy_dsg_ptr; + std::vector m_enabled_extensions; + GraphicsPipelineManagerUniquePtr m_graphics_pipeline_manager_ptr; + const Anvil::Instance* m_parent_instance_ptr; + PipelineCacheUniquePtr m_pipeline_cache_ptr; + PipelineLayoutManagerUniquePtr m_pipeline_layout_manager_ptr; + Anvil::ShaderModuleCacheUniquePtr m_shader_module_cache_ptr; - std::shared_ptr m_command_pool_ptrs[Anvil::QUEUE_FAMILY_TYPE_COUNT]; + std::vector m_command_pool_ptr_per_vk_queue_fam; friend struct DeviceDeleter; }; @@ -671,9 +767,9 @@ namespace Anvil public: /* Public functions */ + virtual ~SGPUDevice(); + /** Creates a new Vulkan Device instance using a user-specified physical device instance. - * - * To release a device instance, please call destroy(). * * @param in_physical_device_ptr Physical device to create this device from. Must not be nullptr. * @param in_extensions Tells which extensions must/should be specified at creation time. @@ -684,18 +780,21 @@ namespace Anvil * support. * @param in_support_resettable_command_buffer_allocs True if the command pools should be configured for resettable command * buffer support. + * @param in_enable_shader_module_cache True if all spawned shader modules should be cached throughout instance lifetime. + * False if they should be released as soon as all shared pointers go out of scope. * @param in_mt_safe True if command buffer creation and queue submissions should be automatically serialized. * Set to false if your app is never going to use more than one thread at a time for * command buffer creation or submission. * * @return A new Device instance. **/ - static std::weak_ptr create(std::weak_ptr in_physical_device_ptr, - const DeviceExtensionConfiguration& in_extensions, - const std::vector& in_layers, - bool in_transient_command_buffer_allocs_only, - bool in_support_resettable_command_buffer_allocs, - bool in_mt_safe = false); + static SGPUDeviceUniquePtr create(const Anvil::PhysicalDevice* in_physical_device_ptr, + bool in_enable_shader_module_cache, + const DeviceExtensionConfiguration& in_extensions, + const std::vector& in_layers, + bool in_transient_command_buffer_allocs_only, + bool in_support_resettable_command_buffer_allocs, + bool in_mt_safe = false); /** Creates a new swapchain instance for the device. * @@ -708,27 +807,24 @@ namespace Anvil * * @return A new Swapchain instance. **/ - std::shared_ptr create_swapchain(std::shared_ptr in_parent_surface_ptr, - std::shared_ptr in_window_ptr, - VkFormat in_image_format, - VkPresentModeKHR in_present_mode, - VkImageUsageFlags in_usage, - uint32_t in_n_swapchain_images); - - /** Releases all children queues and unregisters itself from the owning physical device. */ - virtual void destroy() override; + Anvil::SwapchainUniquePtr create_swapchain(Anvil::RenderingSurface* in_parent_surface_ptr, + Anvil::Window* in_window_ptr, + VkFormat in_image_format, + VkPresentModeKHR in_present_mode, + VkImageUsageFlags in_usage, + uint32_t in_n_swapchain_images); /** Retrieves a PhysicalDevice instance, from which this device instance was created. * * @return As per description **/ - std::weak_ptr get_physical_device() const + const Anvil::PhysicalDevice* get_physical_device() const { return m_parent_physical_device_ptr; } /** See documentation in BaseDevice for more details */ - const VkPhysicalDeviceFeatures& get_physical_device_features() const override; + const Anvil::PhysicalDeviceFeatures& get_physical_device_features() const override; /** See documentation in BaseDevice for more details */ const Anvil::FormatProperties& get_physical_device_format_properties(VkFormat in_format) const override; @@ -745,7 +841,7 @@ namespace Anvil const Anvil::MemoryProperties& get_physical_device_memory_properties() const override; /** See documentation in BaseDevice for more details */ - const VkPhysicalDeviceProperties& get_physical_device_properties() const override; + const Anvil::PhysicalDeviceProperties& get_physical_device_properties() const override; /** See documentation in BaseDevice for more details */ const QueueFamilyInfoItems& get_physical_device_queue_families() const override; @@ -759,8 +855,8 @@ namespace Anvil std::vector& out_result) const override; /** See documentation in BaseDevice for more details */ - bool get_physical_device_surface_capabilities(std::shared_ptr in_surface_ptr, - VkSurfaceCapabilitiesKHR* out_result_ptr) const override; + bool get_physical_device_surface_capabilities(Anvil::RenderingSurface* in_surface_ptr, + VkSurfaceCapabilitiesKHR* out_result_ptr) const override; /** See documentation in BaseDevice for more details */ const Anvil::QueueFamilyInfo* get_queue_family_info(uint32_t in_queue_family_index) const override; @@ -784,23 +880,15 @@ namespace Anvil private: /* Private type definitions */ - struct SGPUDeviceDeleter - { - void operator()(SGPUDevice* in_device_ptr) - { - delete in_device_ptr; - } - }; /* Private functions */ - virtual ~SGPUDevice(); /** Private constructor. Please use create() instead. */ - SGPUDevice(std::weak_ptr in_physical_device_ptr, - bool in_mt_safe); + SGPUDevice(const Anvil::PhysicalDevice* in_physical_device_ptr, + bool in_mt_safe); /* Private variables */ - std::weak_ptr m_parent_physical_device_ptr; + const Anvil::PhysicalDevice* m_parent_physical_device_ptr; }; }; /* namespace Anvil */ diff --git a/include/wrappers/event.h b/include/wrappers/event.h index 027e590c..3a1c47fc 100644 --- a/include/wrappers/event.h +++ b/include/wrappers/event.h @@ -50,8 +50,8 @@ namespace Anvil * * @param in_device_ptr Device to use. */ - static std::shared_ptr create(std::weak_ptr in_device_ptr, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::EventUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destructor. * @@ -92,8 +92,8 @@ namespace Anvil /* Private functions */ /* Constructor. */ - Event(std::weak_ptr in_device_ptr, - bool in_mt_safe); + Event(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe); Event (const Event&); Event& operator=(const Event&); @@ -101,8 +101,8 @@ namespace Anvil void release_event(); /* Private variables */ - std::weak_ptr m_device_ptr; - VkEvent m_event; + const Anvil::BaseDevice* m_device_ptr; + VkEvent m_event; }; }; /* namespace Anvil */ diff --git a/include/wrappers/fence.h b/include/wrappers/fence.h index e1120cbf..064818ce 100644 --- a/include/wrappers/fence.h +++ b/include/wrappers/fence.h @@ -58,9 +58,9 @@ namespace Anvil * @param in_create_signalled true if the fence should be created as a signalled entity. * False to make it unsignalled at creation time. */ - static std::shared_ptr create(std::weak_ptr in_device_ptr, - bool in_create_signalled, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::FenceUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + bool in_create_signalled, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Retrieves a raw handle to the underlying Vulkan fence instance */ VkFence get_fence() const @@ -69,7 +69,7 @@ namespace Anvil } /** Retrieves a pointer to the raw handle to the underlying Vulkan fence instance */ - const VkFence* get_fence_ptr() + const VkFence* get_fence_ptr() const { m_possibly_set = true; @@ -109,9 +109,9 @@ namespace Anvil * * Please see documentation of create() for specification */ - Fence(std::weak_ptr in_device_ptr, - bool in_create_signalled, - bool in_mt_safe); + Fence(const Anvil::BaseDevice* in_device_ptr, + bool in_create_signalled, + bool in_mt_safe); Fence (const Fence&); Fence& operator=(const Fence&); @@ -119,9 +119,9 @@ namespace Anvil void release_fence(); /* Private variables */ - std::weak_ptr m_device_ptr; - VkFence m_fence; - bool m_possibly_set; + const Anvil::BaseDevice* m_device_ptr; + VkFence m_fence; + mutable bool m_possibly_set; }; }; /* namespace Anvil */ diff --git a/include/wrappers/framebuffer.h b/include/wrappers/framebuffer.h index 90033be0..2d8e317f 100644 --- a/include/wrappers/framebuffer.h +++ b/include/wrappers/framebuffer.h @@ -50,11 +50,11 @@ namespace Anvil * @param in_height Framebuffer height. Must be at least 1. * @param in_n_layers Number of layers the framebuffer should use. Must be at least 1. **/ - static std::shared_ptr create(std::weak_ptr in_device_ptr, - uint32_t in_width, - uint32_t in_height, - uint32_t in_n_layers, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::FramebufferUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_width, + uint32_t in_height, + uint32_t in_n_layers, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destructor. * @@ -75,8 +75,8 @@ namespace Anvil * * @return true if the function was successful, false otherwise. **/ - bool add_attachment(std::shared_ptr in_image_view_ptr, - FramebufferAttachmentID* out_opt_attachment_id_ptr); + bool add_attachment(ImageView* in_image_view_ptr, + FramebufferAttachmentID* out_opt_attachment_id_ptr); /** Re-creates a Vulkan framebuffer object for the specified render pass instance. If a FB * has already been created in the past, the instance will be released. @@ -88,11 +88,11 @@ namespace Anvil * * @return true if the function was successful, false otherwise. * */ - bool bake(std::shared_ptr in_render_pass_ptr); + bool bake(Anvil::RenderPass* in_render_pass_ptr); /* Returns an attachment at user-specified index */ - bool get_attachment_at_index(uint32_t in_attachment_index, - std::shared_ptr* out_image_view_ptr) const; + bool get_attachment_at_index(uint32_t in_attachment_index, + ImageView** out_image_view_ptr_ptr) const; /** Checks if an attachment has already been created for the specified image view and, if so, * returns the attachment's ID. @@ -105,8 +105,8 @@ namespace Anvil * @return true if successful (eg. the attachment corresponding to the specified image view was * found), false otherwise. **/ - bool get_attachment_id_for_image_view(std::shared_ptr in_image_view_ptr, - FramebufferAttachmentID* out_attachment_id_ptr); + bool get_attachment_id_for_image_view(ImageView* in_image_view_ptr, + FramebufferAttachmentID* out_attachment_id_ptr); /** Returns the number of attachments defined for the framebuffer. */ uint32_t get_n_attachments() const @@ -124,7 +124,7 @@ namespace Anvil * * @return Raw Vulkan framebuffer handle or VK_NULL_HANDLE, if the function failed. **/ - const VkFramebuffer get_framebuffer(std::shared_ptr in_render_pass_ptr); + const VkFramebuffer get_framebuffer(Anvil::RenderPass* in_render_pass_ptr); /** Returns framebuffer size, specified at creation time */ void get_size(uint32_t* out_framebuffer_width_ptr, @@ -147,14 +147,14 @@ namespace Anvil typedef struct FramebufferAttachment { - std::shared_ptr image_view_ptr; + ImageView* image_view_ptr; /** Constructor. Retains the input image view instance. * * @param in_image_view_ptr Image view instance to use for the FB attachment. Must not * be nullptr. **/ - FramebufferAttachment(std::shared_ptr in_image_view_ptr); + FramebufferAttachment(ImageView* in_image_view_ptr); /** Destructor. Releases the encapsulated image view instance. */ ~FramebufferAttachment(); @@ -168,7 +168,7 @@ namespace Anvil /** Returns true if the encapsulated image view instance is the same as the one * specified uner @param in_image_view_ptr argument. **/ - bool operator==(std::shared_ptr in_image_view_ptr) const + bool operator==(const ImageView* in_image_view_ptr) const { return (image_view_ptr == in_image_view_ptr); } @@ -176,30 +176,30 @@ namespace Anvil struct RenderPassComparator { - bool operator()(std::shared_ptr in_a_ptr, - std::shared_ptr in_b_ptr) const; + bool operator()(Anvil::RenderPass* in_a_ptr, + Anvil::RenderPass* in_b_ptr) const; }; - typedef std::map, BakedFramebufferData, RenderPassComparator> BakedFramebufferMap; - typedef std::vector FramebufferAttachments; + typedef std::map BakedFramebufferMap; + typedef std::vector FramebufferAttachments; /* Private functions */ /* Constructor. Please see specification of create() for more details */ - Framebuffer(std::weak_ptr in_device_ptr, - uint32_t in_width, - uint32_t in_height, - uint32_t in_n_layers, - bool in_mt_safe); + Framebuffer(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_width, + uint32_t in_height, + uint32_t in_n_layers, + bool in_mt_safe); Framebuffer& operator=(const Framebuffer&); Framebuffer (const Framebuffer&); /* Private members */ - FramebufferAttachments m_attachments; - BakedFramebufferMap m_baked_framebuffers; - std::weak_ptr m_device_ptr; - uint32_t m_framebuffer_size[3]; + FramebufferAttachments m_attachments; + BakedFramebufferMap m_baked_framebuffers; + const Anvil::BaseDevice* m_device_ptr; + uint32_t m_framebuffer_size[3]; }; }; diff --git a/include/wrappers/graphics_pipeline_manager.h b/include/wrappers/graphics_pipeline_manager.h index ee6ec647..2250a508 100644 --- a/include/wrappers/graphics_pipeline_manager.h +++ b/include/wrappers/graphics_pipeline_manager.h @@ -90,6 +90,8 @@ namespace Anvil **/ bool bake(); + bool delete_pipeline(PipelineID in_pipeline_id); + /** Creates a new GraphicsPipelineManager instance. * * @param in_device_ptr Device to use. @@ -102,10 +104,10 @@ namespace Anvil * If one is not provided and the other argument is set as described, * a new pipeline cache with size 0 will be allocated. **/ - static std::shared_ptr create(std::weak_ptr in_device_ptr, - bool in_mt_safe, - bool in_use_pipeline_cache = false, - std::shared_ptr in_pipeline_cache_to_reuse_ptr = std::shared_ptr() ); + static GraphicsPipelineManagerUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe, + bool in_use_pipeline_cache = false, + Anvil::PipelineCache* in_pipeline_cache_to_reuse_ptr = nullptr); /** Destructor. */ virtual ~GraphicsPipelineManager(); @@ -135,10 +137,10 @@ namespace Anvil typedef std::map > GraphicsPipelineDataMap; /* Private functions */ - explicit GraphicsPipelineManager(std::weak_ptr in_device_ptr, - bool in_mt_safe, - bool in_use_pipeline_cache, - std::shared_ptr in_pipeline_cache_to_reuse_ptr); + explicit GraphicsPipelineManager(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe, + bool in_use_pipeline_cache, + Anvil::PipelineCache* in_pipeline_cache_to_reuse_ptr); ANVIL_DISABLE_ASSIGNMENT_OPERATOR(GraphicsPipelineManager); ANVIL_DISABLE_COPY_CONSTRUCTOR (GraphicsPipelineManager); diff --git a/include/wrappers/image.h b/include/wrappers/image.h index 15c6ac18..d080c96c 100644 --- a/include/wrappers/image.h +++ b/include/wrappers/image.h @@ -69,8 +69,7 @@ namespace Anvil /** A wrapper class for a VkImage and the bound VkMemory object. */ class Image : public CallbacksSupportProvider, public DebugMarkerSupportProvider, - public MTSafetySupportProvider, - public std::enable_shared_from_this + public MTSafetySupportProvider { public: /* Public functions */ @@ -96,17 +95,17 @@ namespace Anvil * @param in_opt_set_semaphore_ptrs A raw array of semaphores to set upon finished execution of the image layout transfer command buffer. * May be null if @param in_opt_n_set_semaphores is 0. */ - void change_image_layout(std::shared_ptr in_queue_ptr, - VkAccessFlags in_src_access_mask, - VkImageLayout in_src_layout, - VkAccessFlags in_dst_access_mask, - VkImageLayout in_dst_layout, - const VkImageSubresourceRange& in_subresource_range, - const uint32_t in_opt_n_wait_semaphores = 0, - const VkPipelineStageFlags* in_opt_wait_dst_stage_mask_ptrs = nullptr, - const std::shared_ptr* in_opt_wait_semaphore_ptrs = nullptr, - const uint32_t in_opt_n_set_semaphores = 0, - const std::shared_ptr* in_opt_set_semaphore_ptrs = nullptr); + void change_image_layout(Anvil::Queue* in_queue_ptr, + VkAccessFlags in_src_access_mask, + VkImageLayout in_src_layout, + VkAccessFlags in_dst_access_mask, + VkImageLayout in_dst_layout, + const VkImageSubresourceRange& in_subresource_range, + const uint32_t in_opt_n_wait_semaphores = 0, + const VkPipelineStageFlags* in_opt_wait_dst_stage_mask_ptrs = nullptr, + Anvil::Semaphore* const* in_opt_wait_semaphore_ptrs = nullptr, + const uint32_t in_opt_n_set_semaphores = 0, + Anvil::Semaphore* const* in_opt_set_semaphore_ptrs = nullptr); /** Initializes a new non-sparse Image instance *without* a memory backing. A memory region should be bound * to the object by calling Image::set_memory() before using the object for any operations. @@ -139,29 +138,31 @@ namespace Anvil * backing. In order to leave the image intact, set this argument to * VK_IMAGE_LAYOUT_UNDEFINED if @param in_opt_mipmaps_ptr is NULL, or to * VK_IMAGE_LAYOUT_PREINITIALIZED if @param in_opt_mipmaps_ptr is not NULL. - * (which depends on what value is passed to @param in_opt_mipmaps_ptr), + * (which depends on what value is passed to @param in_opt_mipmaps_ptr), * @param in_opt_mipmaps_ptr If not NULL, specified data will be used to initialize created image's mipmaps * with content, as soon as the image is assigned a memory backing. + * Specifying a non-NULL @param in_opt_mipmaps_ptr argument will make the function OR + * @param in_usage with VK_IMAGE_USAGE_TRANSFER_DST_BIT. * * @return New image instance, if successful, or nullptr otherwise. **/ - static std::shared_ptr create_nonsparse(std::weak_ptr in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - ImageCreateFlags in_flags, - VkImageLayout in_post_create_image_layout, - const std::vector* in_opt_mipmaps_ptr, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static ImageUniquePtr create_nonsparse(const Anvil::BaseDevice* in_device_ptr, + VkImageType in_type, + VkFormat in_format, + VkImageTiling in_tiling, + VkImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + VkSampleCountFlagBits in_sample_count, + Anvil::QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + bool in_use_full_mipmap_chain, + ImageCreateFlags in_flags, + VkImageLayout in_post_create_image_layout, + const std::vector* in_opt_mipmaps_ptr, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Initializes a new non-sparse Image instance, along with a memory backing. * @@ -191,27 +192,29 @@ namespace Anvil * VK_IMAGE_LAYOUT_PREINITIALIZED. * @param in_opt_mipmaps_ptr If not nullptr, specified MipmapRawData items will be used to drive the mipmap contents * initialization process. Ignored if nullptr. + * Specifying a non-NULL in_opt_mipmaps_ptr argument will make the function OR + * @param in_usage with VK_IMAGE_USAGE_TRANSFER_DST_BIT. * * @return New image instance, if successful, or nullptr otherwise. **/ - static std::shared_ptr create_nonsparse(std::weak_ptr in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - MemoryFeatureFlags in_memory_features, - ImageCreateFlags in_create_flags, - VkImageLayout in_post_create_image_layout, - const std::vector* in_opt_mipmaps_ptr, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static ImageUniquePtr create_nonsparse(const Anvil::BaseDevice* in_device_ptr, + VkImageType in_type, + VkFormat in_format, + VkImageTiling in_tiling, + VkImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + VkSampleCountFlagBits in_sample_count, + Anvil::QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + bool in_use_full_mipmap_chain, + MemoryFeatureFlags in_memory_features, + ImageCreateFlags in_create_flags, + VkImageLayout in_post_create_image_layout, + const std::vector* in_opt_mipmaps_ptr, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Wrapper constructor for existing VkImage instances, as reported for * swapchain images. Object instantiated with this constructor will NOT @@ -221,10 +224,10 @@ namespace Anvil * * For argument discussion, see specification of the other create() functions. **/ - static std::shared_ptr create_nonsparse(std::weak_ptr in_device_ptr, - const VkSwapchainCreateInfoKHR& in_swapchain_create_info, - VkImage in_image, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static ImageUniquePtr create_nonsparse(const Anvil::BaseDevice* in_device_ptr, + const VkSwapchainCreateInfoKHR& in_swapchain_create_info, + VkImage in_image, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Initializes a new sparse Image instance *without* physical memory backing. Memory region(s) * should be bound to the object by calling Image::set_memory_block() before using the object @@ -260,23 +263,23 @@ namespace Anvil * * @return New image instance, if successful, or nullptr otherwise. **/ - static std::shared_ptr create_sparse(std::weak_ptr in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - ImageCreateFlags in_create_flags, - Anvil::SparseResidencyScope in_residency_scope, - VkImageLayout in_initial_layout = VK_IMAGE_LAYOUT_UNDEFINED, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static ImageUniquePtr create_sparse(const Anvil::BaseDevice* in_device_ptr, + VkImageType in_type, + VkFormat in_format, + VkImageTiling in_tiling, + VkImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + VkSampleCountFlagBits in_sample_count, + Anvil::QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + bool in_use_full_mipmap_chain, + ImageCreateFlags in_create_flags, + Anvil::SparseResidencyScope in_residency_scope, + VkImageLayout in_initial_layout = VK_IMAGE_LAYOUT_UNDEFINED, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destructor */ virtual ~Image(); @@ -436,7 +439,7 @@ namespace Anvil * In case of sparse images, the callback will only occur if at least one memory allocation * has been scheduled for this image instance. **/ - std::shared_ptr get_memory_block(); + Anvil::MemoryBlock* get_memory_block(); /** Returns VkMemoryRequirements structure, as reported by the driver for this Image instance. */ const VkMemoryRequirements& get_memory_requirements() const @@ -445,7 +448,7 @@ namespace Anvil } /** Returns swapchain, from which the image has been created. */ - std::shared_ptr get_parent_swapchain() const + const Anvil::Swapchain* get_parent_swapchain() const { return m_swapchain_ptr; } @@ -514,7 +517,8 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool set_memory(std::shared_ptr in_memory_block_ptr); + bool set_memory(MemoryBlockUniquePtr in_memory_block_ptr); + bool set_memory(Anvil::MemoryBlock* in_memory_block_ptr); /** Updates image with specified mip-map data. Blocks until the operation finishes executing. * @@ -532,8 +536,6 @@ namespace Anvil VkImageLayout* out_new_image_layout_ptr); private: - /* Private type declarations */ - /** Defines dimensions of a single image mip-map */ typedef struct Mipmap { @@ -558,7 +560,7 @@ namespace Anvil { /* Each item in this vector holds a reference to a MemoryBlock instance, which provides memory * backing for the corresponding linearized image tile location */ - std::vector > tile_to_block_mappings; + std::vector tile_to_block_mappings; uint32_t n_tiles_x; uint32_t n_tiles_y; @@ -649,9 +651,9 @@ namespace Anvil { std::vector mips; - uint32_t n_total_tail_pages; - std::map, uint32_t> tail_pages_per_binding; - std::vector tail_occupancy; + uint32_t n_total_tail_pages; + std::map tail_pages_per_binding; + std::vector tail_occupancy; AspectPageOccupancyLayerData() { @@ -672,12 +674,12 @@ namespace Anvil /* Private functions */ /** See corresponding create_nonsparse() function for specification */ - Image(std::weak_ptr in_device_ptr, - std::weak_ptr in_swapchain_ptr, - bool in_mt_safe); + Image(const Anvil::BaseDevice* in_device_ptr, + Anvil::Swapchain* in_swapchain_ptr, + bool in_mt_safe); /** See corresponding create_nonsparse() function for specification */ - Image(std::weak_ptr in_device_ptr, + Image(const Anvil::BaseDevice* in_device_ptr, VkImageType in_type, VkFormat in_format, VkImageTiling in_tiling, @@ -696,7 +698,7 @@ namespace Anvil bool in_mt_safe); /** See corresponding create_nonsparse() function for specification **/ - Image(std::weak_ptr in_device_ptr, + Image(const Anvil::BaseDevice* in_device_ptr, VkImageType in_type, VkFormat in_format, VkImageTiling in_tiling, @@ -715,40 +717,40 @@ namespace Anvil bool in_mt_safe); /** See corresponding create_nonsparse() function for specification **/ - Image(std::weak_ptr in_device_ptr, - VkImage in_image, - VkFormat in_format, - VkImageTiling in_tiling, - VkSharingMode in_sharing_mode, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - uint32_t in_n_mipmaps, - VkSampleCountFlagBits in_sample_count, - uint32_t in_n_slices, - Anvil::ImageCreateFlags in_create_flags, - Anvil::QueueFamilyBits in_queue_families, - bool in_mt_safe); + Image(const Anvil::BaseDevice* in_device_ptr, + VkImage in_image, + VkFormat in_format, + VkImageTiling in_tiling, + VkSharingMode in_sharing_mode, + VkImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + uint32_t in_n_mipmaps, + VkSampleCountFlagBits in_sample_count, + uint32_t in_n_slices, + Anvil::ImageCreateFlags in_create_flags, + Anvil::QueueFamilyBits in_queue_families, + bool in_mt_safe); /** See corresponding create_sparse() function for specification **/ - Image(std::weak_ptr in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - ImageCreateFlags in_create_flags, - Anvil::SparseResidencyScope in_residency_scope, - bool in_mt_safe); + Image(const Anvil::BaseDevice* in_device_ptr, + VkImageType in_type, + VkFormat in_format, + VkImageTiling in_tiling, + VkImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + VkSampleCountFlagBits in_sample_count, + Anvil::QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + bool in_use_full_mipmap_chain, + ImageCreateFlags in_create_flags, + Anvil::SparseResidencyScope in_residency_scope, + bool in_mt_safe); Image (const Image&); Image& operator=(const Image&); @@ -759,15 +761,20 @@ namespace Anvil void init_mipmap_props (); void init_page_occupancy(const std::vector& in_memory_reqs); - void on_memory_backing_update (const VkImageSubresource& in_subresource, - VkOffset3D in_offset, - VkExtent3D in_extent, - std::shared_ptr in_memory_block_ptr, - VkDeviceSize in_memory_block_start_offset); - void on_memory_backing_opaque_update(VkDeviceSize in_resource_offset, - VkDeviceSize in_size, - std::shared_ptr in_memory_block_ptr, - VkDeviceSize in_memory_block_start_offset); + bool set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, + bool in_owned_by_image); + + void on_memory_backing_update (const VkImageSubresource& in_subresource, + VkOffset3D in_offset, + VkExtent3D in_extent, + Anvil::MemoryBlock* in_memory_block_ptr, + VkDeviceSize in_memory_block_start_offset, + bool in_memory_block_owned_by_image); + void on_memory_backing_opaque_update(VkDeviceSize in_resource_offset, + VkDeviceSize in_size, + Anvil::MemoryBlock* in_memory_block_ptr, + VkDeviceSize in_memory_block_start_offset, + bool in_memory_block_owned_by_image); void transition_to_post_create_image_layout(VkAccessFlags in_src_access_mask, VkImageLayout in_src_layout); @@ -776,7 +783,7 @@ namespace Anvil * * Does NOT set ::pQueueFamilyIndices and ::queueFamilyIndexCount! */ - static VkImageCreateInfo get_create_info_for_swapchain(std::shared_ptr in_swapchain_ptr); + static VkImageCreateInfo get_create_info_for_swapchain(const Anvil::Swapchain* in_swapchain_ptr); /* Private members */ VkSampleCountFlagsVariable(m_sample_count); @@ -790,7 +797,7 @@ namespace Anvil AspectToLayerMipToSubresourceLayoutMap m_aspects; /* only used for linear images */ Anvil::ImageCreateFlags m_create_flags; uint32_t m_depth; - std::weak_ptr m_device_ptr; + const Anvil::BaseDevice* m_device_ptr; VkFormat m_format; bool m_has_transitioned_to_post_create_layout; uint32_t m_height; @@ -810,20 +817,21 @@ namespace Anvil VkSharingMode m_sharing_mode; VkDeviceSize m_storage_size; bool m_swapchain_memory_assigned; /* only used for images which can be bound swapchain memory */ - std::shared_ptr m_swapchain_ptr; /* only used for images which can be bound a swapchain */ + Anvil::Swapchain* m_swapchain_ptr; /* only used for images which can be bound a swapchain */ VkImageTiling m_tiling; VkImageType m_type; bool m_uses_full_mipmap_chain; uint32_t m_width; - std::shared_ptr m_metadata_memory_block_ptr; - std::shared_ptr m_memory_block_ptr; - bool m_memory_owner; + MemoryBlockUniquePtr m_metadata_memory_block_ptr; + std::vector m_memory_blocks_owned; + bool m_memory_set_by_world; - std::vector m_mipmaps_to_upload; - std::unique_ptr m_page_tracker_ptr; /* only used for sparse non-resident images */ - std::map > m_sparse_aspect_page_occupancy; - std::map m_sparse_aspect_props; + std::vector m_mipmaps_to_upload; + std::unique_ptr m_page_tracker_ptr; /* only used for sparse non-resident images */ + std::map m_sparse_aspect_page_occupancy; + std::vector > m_sparse_aspect_page_occupancy_data_items_owned; + std::map m_sparse_aspect_props; friend class Anvil::Queue; }; diff --git a/include/wrappers/image_view.h b/include/wrappers/image_view.h index 46011fb0..c34b41db 100644 --- a/include/wrappers/image_view.h +++ b/include/wrappers/image_view.h @@ -57,18 +57,18 @@ namespace Anvil * * @return New ImageView instance, if function executes successfully; nullptr otherwise. **/ - static std::shared_ptr create_1D(std::weak_ptr in_device_ptr, - std::shared_ptr in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::ImageViewUniquePtr create_1D(const Anvil::BaseDevice* in_device_ptr, + Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Creates a single-sample 1D array image view wrapper instance. * @@ -88,19 +88,19 @@ namespace Anvil * * @return New ImageView instance, if function executes successfully; nullptr otherwise. **/ - static std::shared_ptr create_1D_array(std::weak_ptr in_device_ptr, - std::shared_ptr in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_layers, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::ImageViewUniquePtr create_1D_array(const Anvil::BaseDevice* in_device_ptr, + Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_layers, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Creates a single-sample or a multi-sample 2D image view wrapper instance. The view will be @@ -121,18 +121,18 @@ namespace Anvil * * @return New ImageView instance, if function executes successfully; nullptr otherwise. **/ - static std::shared_ptr create_2D(std::weak_ptr in_device_ptr, - std::shared_ptr in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::ImageViewUniquePtr create_2D(const Anvil::BaseDevice* in_device_ptr, + Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Creates a single-sample or a multi-sample 2D array image view wrapper instance. The view will be * single-sample if @param in_image_ptr uses 1 sample per texel, and multi-sample otherwise. @@ -153,19 +153,19 @@ namespace Anvil * * @return New ImageView instance, if function executes successfully; nullptr otherwise. **/ - static std::shared_ptr create_2D_array(std::weak_ptr in_device_ptr, - std::shared_ptr in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_layers, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::ImageViewUniquePtr create_2D_array(const Anvil::BaseDevice* in_device_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_layers, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Creates a single-sample 3D image view wrapper instance. * @@ -185,19 +185,19 @@ namespace Anvil * * @return New ImageView instance, if function executes successfully; nullptr otherwise. **/ - static std::shared_ptr create_3D(std::weak_ptr in_device_ptr, - std::shared_ptr in_image_ptr, - uint32_t in_n_base_slice, - uint32_t in_n_slices, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::ImageViewUniquePtr create_3D(const Anvil::BaseDevice* in_device_ptr, + Image* in_image_ptr, + uint32_t in_n_base_slice, + uint32_t in_n_slices, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Creates a cube-map image view wrapper instance. * @@ -216,18 +216,18 @@ namespace Anvil * * @return New ImageView instance, if function executes successfully; nullptr otherwise. **/ - static std::shared_ptr create_cube_map(std::weak_ptr in_device_ptr, - std::shared_ptr in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::ImageViewUniquePtr create_cube_map(const Anvil::BaseDevice* in_device_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Creates a cube-map array image view wrapper instance. * @@ -248,19 +248,19 @@ namespace Anvil * * @return New ImageView instance, if function executes successfully; nullptr otherwise. **/ - static std::shared_ptr create_cube_map_array(std::weak_ptr in_device_ptr, - std::shared_ptr in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_cube_maps, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::ImageViewUniquePtr create_cube_map_array(const Anvil::BaseDevice* in_device_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_cube_maps, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destructor. Should only be called when the reference counter drops to zero. * @@ -328,7 +328,12 @@ namespace Anvil } /** Returns a pointer to the parent image, from which the image view has been created. */ - std::shared_ptr get_parent_image() const + const Anvil::Image* get_parent_image() const + { + return m_parent_image_ptr; + } + + Anvil::Image* get_parent_image() { return m_parent_image_ptr; } @@ -372,16 +377,16 @@ namespace Anvil * * @return True if an intersection was found, false otherwise. */ - bool intersects(std::shared_ptr in_image_view_ptr) const; + bool intersects(const Anvil::ImageView* in_image_view_ptr) const; private: /* Private functions */ ImageView (const ImageView&); ImageView& operator=(const ImageView&); - ImageView(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_image_ptr, - bool in_mt_safe); + ImageView(const Anvil::BaseDevice* in_device_ptr, + Anvil::Image* in_parent_image_ptr, + bool in_mt_safe); bool init(VkImageViewType in_image_view_type, uint32_t in_n_base_layer, @@ -394,9 +399,9 @@ namespace Anvil const VkComponentSwizzle* in_swizzle_rgba_ptr); /* Private members */ - std::weak_ptr m_device_ptr; - VkImageView m_image_view; - std::shared_ptr m_parent_image_ptr; + const Anvil::BaseDevice* m_device_ptr; + VkImageView m_image_view; + Anvil::Image* m_parent_image_ptr; VkImageAspectFlagsVariable(m_aspect_mask); diff --git a/include/wrappers/instance.h b/include/wrappers/instance.h index 61e82a96..21dd7660 100644 --- a/include/wrappers/instance.h +++ b/include/wrappers/instance.h @@ -42,8 +42,7 @@ namespace Anvil const char* in_layer_prefix, const char* in_message)> DebugCallbackFunction; - class Instance : public Anvil::MTSafetySupportProvider, - public std::enable_shared_from_this + class Instance : public Anvil::MTSafetySupportProvider { public: /** Destructor */ @@ -75,17 +74,12 @@ namespace Anvil * is required should be automatically synchronized by Anvil. * @param in_opt_disallowed_instance_level_extensions Optional vector holding instance-level extension names that must NOT be * requested at creation time. - * @param in_opt_enable_shader_module_cache True if all spawned shader modules should be cached throughout instance lifetime. - * False if they should be released as soon as all shared pointers go out of scope. **/ - static std::shared_ptr create(const std::string& in_app_name, - const std::string& in_engine_name, - DebugCallbackFunction in_opt_validation_callback_proc, - bool in_mt_safe, - const std::vector& in_opt_disallowed_instance_level_extensions = std::vector(), - bool in_opt_enable_shader_module_cache = true); - - void destroy(); + static Anvil::InstanceUniquePtr create(const std::string& in_app_name, + const std::string& in_engine_name, + DebugCallbackFunction in_opt_validation_callback_proc, + bool in_mt_safe, + const std::vector& in_opt_disallowed_instance_level_extensions = std::vector() ); /** Returns a container with entry-points to functions introduced by VK_KHR_get_physical_device_properties2. * @@ -131,9 +125,9 @@ namespace Anvil * ** @return As per description. **/ - std::weak_ptr get_physical_device(uint32_t in_n_device) const + const Anvil::PhysicalDevice* get_physical_device(uint32_t in_n_device) const { - return m_physical_devices.at(in_n_device); + return m_physical_devices.at(in_n_device).get(); } /** Returns the total number of physical devices supported on the running platform. */ @@ -142,12 +136,6 @@ namespace Anvil return static_cast(m_physical_devices.size() ); } - /** Returns shader module cache instance */ - std::shared_ptr get_shader_module_cache() const - { - return m_shader_module_cache_ptr; - } - bool is_instance_extension_enabled(const char* in_extension_name) const; bool is_instance_extension_enabled(const std::string& in_extension_name) const { @@ -184,14 +172,11 @@ namespace Anvil Instance& operator=(const Instance&); Instance (const Instance&); - void register_physical_device (std::shared_ptr in_physical_device_ptr); - void unregister_physical_device(std::shared_ptr in_physical_device_ptr); - + void destroy (); void enumerate_instance_layers (); void enumerate_layer_extensions(Anvil::Layer* layer_ptr); void enumerate_physical_devices(); - void init (const std::vector& in_disallowed_instance_level_extensions, - bool in_enable_shader_module_cache); + void init (const std::vector& in_disallowed_instance_level_extensions); void init_debug_callbacks (); void init_func_pointers (); @@ -210,9 +195,9 @@ namespace Anvil /* DebugReport extension function pointers and data */ VkDebugReportCallbackEXT m_debug_callback_data; - ExtensionEXTDebugReportEntrypoints m_ext_debug_report_entrypoints; - ExtensionKHRGetPhysicalDeviceProperties2 m_khr_get_physical_device_properties2_entrypoints; - ExtensionKHRSurfaceEntrypoints m_khr_surface_entrypoints; + ExtensionEXTDebugReportEntrypoints m_ext_debug_report_entrypoints; + ExtensionKHRGetPhysicalDeviceProperties2 m_khr_get_physical_device_properties2_entrypoints; + ExtensionKHRSurfaceEntrypoints m_khr_surface_entrypoints; #ifdef _WIN32 #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) @@ -230,11 +215,9 @@ namespace Anvil std::vector m_enabled_extensions; Anvil::Layer m_global_layer; - std::vector > m_physical_devices; - std::shared_ptr m_shader_module_cache_ptr; + std::vector > m_physical_devices; std::vector m_supported_layers; - friend class Anvil::PhysicalDevice; friend struct InstanceDeleter; }; }; /* namespace Anvil */ diff --git a/include/wrappers/memory_block.h b/include/wrappers/memory_block.h index f2c3d4e5..c75c7aa5 100644 --- a/include/wrappers/memory_block.h +++ b/include/wrappers/memory_block.h @@ -39,15 +39,25 @@ #include "misc/mt_safety.h" #include "misc/types.h" - namespace Anvil { /** "About to be deleted" call-back function prototype. */ typedef std::function OnMemoryBlockReleaseCallbackFunction; + typedef class IMemoryBlockBackendSupport + { + public: + virtual ~IMemoryBlockBackendSupport() + { + /* Stub */ + } + + virtual void set_parent_memory_allocator_backend_ptr(std::shared_ptr in_backend_ptr) = 0; + } IMemoryBlockBackendSupport; + /** Wrapper class for memory objects. Please see header for more details */ - class MemoryBlock : public MTSafetySupportProvider, - public std::enable_shared_from_this + class MemoryBlock : public IMemoryBlockBackendSupport, + public MTSafetySupportProvider { public: /* Public functions */ @@ -59,11 +69,11 @@ namespace Anvil * @param in_size Required allocation size. * @param in_memory_features Required memory features. **/ - static std::shared_ptr create(std::weak_ptr in_device_ptr, - uint32_t in_allowed_memory_bits, - VkDeviceSize in_size, - Anvil::MemoryFeatureFlags in_memory_features, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static MemoryBlockUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_allowed_memory_bits, + VkDeviceSize in_size, + Anvil::MemoryFeatureFlags in_memory_features, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Create a memory block whose storage space is maintained by another MemoryBlock instance. * @@ -76,9 +86,9 @@ namespace Anvil * storage size. * @param in_size Region size to use for the derived memory block. **/ - static std::shared_ptr create_derived(std::shared_ptr in_parent_memory_block_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size); + static MemoryBlockUniquePtr create_derived(MemoryBlock* in_parent_memory_block_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size); /** Create a memory block whose lifetime is maintained by a separate entity. While the memory block remains reference-counted * as usual, the destruction process is carried out by an external party via the specified call-back. @@ -88,14 +98,14 @@ namespace Anvil * * TODO */ - static std::shared_ptr create_derived_with_custom_delete_proc(std::weak_ptr in_device_ptr, - VkDeviceMemory in_memory, - uint32_t in_allowed_memory_bits, - Anvil::MemoryFeatureFlags in_memory_features, - uint32_t in_memory_type_index, - VkDeviceSize in_size, - VkDeviceSize in_start_offset, - OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function); + static MemoryBlockUniquePtr create_derived_with_custom_delete_proc(const Anvil::BaseDevice* in_device_ptr, + VkDeviceMemory in_memory, + uint32_t in_allowed_memory_bits, + Anvil::MemoryFeatureFlags in_memory_features, + uint32_t in_memory_type_index, + VkDeviceSize in_size, + VkDeviceSize in_start_offset, + OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function); /** Releases the Vulkan counterpart and unregisters the wrapper instance from the object tracker */ virtual ~MemoryBlock(); @@ -140,7 +150,7 @@ namespace Anvil } /* Returns parent memory block, if one has been defined for this instance */ - std::shared_ptr get_parent_memory_block() const + const Anvil::MemoryBlock* get_parent_memory_block() const { return m_parent_memory_block_ptr; } @@ -168,7 +178,7 @@ namespace Anvil * @param in_memory_block_ptr * * @return true if intersection has been detected, false otherwise. */ - bool intersects(std::shared_ptr in_memory_block_ptr) const; + bool intersects(const Anvil::MemoryBlock* in_memory_block_ptr) const; /** Maps the specified region of the underlying memory object to the process space. * @@ -239,19 +249,19 @@ namespace Anvil bool init(); /** Please see create() for documentation */ - MemoryBlock(std::weak_ptr in_device_ptr, - uint32_t in_allowed_memory_bits, - VkDeviceSize in_size, - Anvil::MemoryFeatureFlags in_memory_features, - bool in_mt_safe); + MemoryBlock(MemoryBlock* in_parent_memory_block_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size); /** Please see create() for documentation */ - MemoryBlock(std::shared_ptr in_parent_memory_block_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size); + MemoryBlock(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_allowed_memory_bits, + VkDeviceSize in_size, + Anvil::MemoryFeatureFlags in_memory_features, + bool in_mt_safe); /** Please see create_derived_with_custom_delete_proc() for documentation */ - MemoryBlock(std::weak_ptr in_device_ptr, + MemoryBlock(const Anvil::BaseDevice* in_device_ptr, VkDeviceMemory in_memory, uint32_t in_allowed_memory_bits, Anvil::MemoryFeatureFlags in_memory_features, @@ -268,20 +278,30 @@ namespace Anvil Anvil::MemoryFeatureFlags in_memory_features); bool open_gpu_memory_access (); + /* IMemoryBlockBackendSupport */ + void set_parent_memory_allocator_backend_ptr(std::shared_ptr in_backend_ptr) + { + anvil_assert(m_parent_memory_allocator_backend_ptr == nullptr); + + m_parent_memory_allocator_backend_ptr = in_backend_ptr; + } + /* Private members */ OnMemoryBlockReleaseCallbackFunction m_on_release_callback_function; std::atomic m_gpu_data_map_count; /* Only set for root memory blocks */ void* m_gpu_data_ptr; /* Only set for root memory blocks */ - uint32_t m_allowed_memory_bits; - std::weak_ptr m_device_ptr; - VkDeviceMemory m_memory; - Anvil::MemoryFeatureFlags m_memory_features; - uint32_t m_memory_type_index; - std::shared_ptr m_parent_memory_block_ptr; - VkDeviceSize m_size; - VkDeviceSize m_start_offset; + uint32_t m_allowed_memory_bits; + const Anvil::BaseDevice* m_device_ptr; + VkDeviceMemory m_memory; + Anvil::MemoryFeatureFlags m_memory_features; + uint32_t m_memory_type_index; + Anvil::MemoryBlock* m_parent_memory_block_ptr; + VkDeviceSize m_size; + VkDeviceSize m_start_offset; + + std::shared_ptr m_parent_memory_allocator_backend_ptr; }; }; /* Vulkan namespace */ diff --git a/include/wrappers/physical_device.h b/include/wrappers/physical_device.h index 403ffd1e..a19ff6cc 100644 --- a/include/wrappers/physical_device.h +++ b/include/wrappers/physical_device.h @@ -37,7 +37,7 @@ namespace Anvil { /* Wrapper class for Vulkan physical devices */ - class PhysicalDevice : public std::enable_shared_from_this + class PhysicalDevice { public: /* Public functions */ @@ -51,30 +51,13 @@ namespace Anvil * @param in_index Index of the physical device to initialize the wrapper for. * @param in_physical_device Raw Vulkan physical device handle to encapsulate. */ - static std::weak_ptr create(std::shared_ptr in_instance_ptr, - uint32_t in_index, - VkPhysicalDevice in_physical_device); + static std::unique_ptr create(Anvil::Instance* in_instance_ptr, + uint32_t in_index, + VkPhysicalDevice in_physical_device); /** Destructor */ virtual ~PhysicalDevice(); - /** Retrieves 16-bit storage features supported by this physical device. - * - * This function will only succeed if both VK_KHR_16bit_storage_features and VK_KHR_get_physical_device_properties2 - * are supported. - * - * @return true if successful, false otherwise. - */ - bool get_16bit_storage_features(StorageFeatures16Bit* out_result_ptr) const - { - if (m_16bit_storage_features_available) - { - *out_result_ptr = m_16bit_storage_features; - } - - return m_16bit_storage_features_available; - } - /* Returns physical device's LUID. * * Requires VK_KHR_external_memory support, as well as VkPhysicalDeviceIDPropertiesKHR::deviceLUIDValid @@ -158,15 +141,12 @@ namespace Anvil } /** Retrieves features supported by the physical device */ - const VkPhysicalDeviceFeatures& get_device_features() const + const Anvil::PhysicalDeviceFeatures& get_device_features() const { return m_features; } - /** Retrieves a filled VkPhysicalDeviceProperties structure, holding properties of - * the wrapped physical device. - **/ - const VkPhysicalDeviceProperties& get_device_properties() const + const Anvil::PhysicalDeviceProperties& get_device_properties() const { return m_properties; } @@ -200,7 +180,12 @@ namespace Anvil } /** Returns parent Vulkan instance wrapper. */ - std::weak_ptr get_instance() const + const Anvil::Instance* get_instance() const + { + return m_instance_ptr; + } + + Anvil::Instance* get_instance() { return m_instance_ptr; } @@ -285,16 +270,14 @@ namespace Anvil * @param in_index Index of the physical device to initialize the wrapper for. * @param in_physical_device Raw Vulkan physical device handle to encapsulate. */ - explicit PhysicalDevice(std::weak_ptr in_instance_ptr, - uint32_t in_index, - VkPhysicalDevice in_physical_device) - :m_16bit_storage_features_available(false), - m_destroyed (false), - m_device_LUID_available (false), - m_device_UUID_available (false), - m_index (in_index), - m_instance_ptr (in_instance_ptr), - m_physical_device (in_physical_device) + explicit PhysicalDevice(Anvil::Instance* in_instance_ptr, + uint32_t in_index, + VkPhysicalDevice in_physical_device) + :m_device_LUID_available (false), + m_device_UUID_available (false), + m_index (in_index), + m_instance_ptr (in_instance_ptr), + m_physical_device (in_physical_device) { anvil_assert(in_physical_device != VK_NULL_HANDLE); } @@ -302,27 +285,25 @@ namespace Anvil PhysicalDevice (const PhysicalDevice&); PhysicalDevice& operator=(const PhysicalDevice&); - void destroy (); - void init (); - void register_device (std::shared_ptr in_device_ptr); - void unregister_device(std::shared_ptr in_device_ptr); + bool init(); /* Private variables */ - bool m_destroyed; - - StorageFeatures16Bit m_16bit_storage_features; - bool m_16bit_storage_features_available; FormatProperties m_dummy; Anvil::Extensions m_extensions; uint32_t m_index; - std::shared_ptr m_instance_ptr; - VkPhysicalDeviceFeatures m_features; + Anvil::Instance* m_instance_ptr; + Anvil::PhysicalDeviceFeatures m_features; FormatPropertiesMap m_format_properties; Anvil::Layers m_layers; MemoryProperties m_memory_properties; VkPhysicalDevice m_physical_device; QueueFamilyInfoItems m_queue_families; - VkPhysicalDeviceProperties m_properties; + Anvil::PhysicalDeviceProperties m_properties; + + std::unique_ptr m_core_features_vk10_ptr; + std::unique_ptr m_core_properties_vk10_ptr; + std::unique_ptr m_khr_16_bit_storage_features_ptr; + std::unique_ptr m_khr_maintenance3_properties_ptr; bool m_device_LUID_available; uint8_t m_device_LUID[VK_LUID_SIZE_KHR]; @@ -331,10 +312,7 @@ namespace Anvil uint8_t m_driver_UUID[VK_UUID_SIZE]; bool m_driver_UUID_available; - std::vector > m_cached_devices; - friend class Anvil::Instance; - friend class Anvil::SGPUDevice; }; /** Tells whether the specified Anvil PhysicalDevice wrapper encapsulates given Vulkan physical device. @@ -344,9 +322,8 @@ namespace Anvil * * @return true if objects match, false otherwise. **/ - bool operator==(const std::shared_ptr& in_physical_device_ptr, + bool operator==(const std::unique_ptr& in_physical_device_ptr, const VkPhysicalDevice& in_physical_device_vk); - }; /* namespace Anvil */ -#endif /* WRAPPERS_FENCE_H */ \ No newline at end of file +#endif /* WRAPPERS_FENCE_H */ diff --git a/include/wrappers/pipeline_cache.h b/include/wrappers/pipeline_cache.h index a66ebd6e..e79fad3e 100644 --- a/include/wrappers/pipeline_cache.h +++ b/include/wrappers/pipeline_cache.h @@ -53,10 +53,10 @@ namespace Anvil * @param in_initial_data Initial data to initialize the new pipeline cache instance with. * May be nullptr if @param in_initial_data_size is 0. **/ - static std::shared_ptr create(std::weak_ptr in_device_ptr, - bool in_mt_safe, - size_t in_initial_data_size = 0, - const void* in_initial_data = nullptr); + static Anvil::PipelineCacheUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe, + size_t in_initial_data_size = 0, + const void* in_initial_data = nullptr); /** Destroys the Vulkan counterpart and unregisters the wrapper instance from the object tracker. */ virtual ~PipelineCache(); @@ -88,24 +88,24 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool merge(uint32_t in_n_pipeline_caches, - std::shared_ptr const* in_src_cache_ptrs); + bool merge(uint32_t in_n_pipeline_caches, + const Anvil::PipelineCache* const* in_src_cache_ptrs); private: /* Private functions */ /* Constructor. See create() for specification */ - PipelineCache(std::weak_ptr in_device_ptr, - bool in_mt_safe, - size_t in_initial_data_size, - const void* in_initial_data); + PipelineCache(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe, + size_t in_initial_data_size, + const void* in_initial_data); PipelineCache (const PipelineCache&); PipelineCache& operator=(const PipelineCache&); /* Private variables */ - std::weak_ptr m_device_ptr; - VkPipelineCache m_pipeline_cache; + const Anvil::BaseDevice* m_device_ptr; + VkPipelineCache m_pipeline_cache; }; }; /* namespace Anvil */ diff --git a/include/wrappers/pipeline_layout.h b/include/wrappers/pipeline_layout.h index c627165f..fb8555c9 100644 --- a/include/wrappers/pipeline_layout.h +++ b/include/wrappers/pipeline_layout.h @@ -41,8 +41,7 @@ namespace Anvil /** Vulkan Pipeline Layout wrapper */ class PipelineLayout : public DebugMarkerSupportProvider, - public MTSafetySupportProvider, - public std::enable_shared_from_this + public MTSafetySupportProvider { public: /* Public functions */ @@ -52,18 +51,17 @@ namespace Anvil **/ virtual ~PipelineLayout(); - /** Retrieves a descriptor set group, as assigned to the pipeline layout. */ - std::shared_ptr get_attached_dsg() const - { - return m_dsg_ptr; - } - /** Retrieves a vector of push constant ranges, attached to the pipeline layout. */ const PushConstantRanges& get_attached_push_constant_ranges() const { return m_push_constant_ranges; } + const std::vector* get_ds_info_ptrs() const + { + return &m_ds_info_ptrs; + } + /** Retrieves a raw Vulkan pipeline layout handle. * * This getter will automatically invoke bake(), if the wrapper instance is marked as dirty. @@ -72,11 +70,6 @@ namespace Anvil **/ VkPipelineLayout get_pipeline_layout() { - if (m_dirty) - { - bake(); - } - return m_layout_vk; } @@ -84,10 +77,9 @@ namespace Anvil /* Private functions */ /* Constructor. Please see create() for specification */ - PipelineLayout(std::weak_ptr in_device_ptr, - std::shared_ptr in_dsg_ptr, - const PushConstantRanges& in_push_constant_ranges, - bool in_mt_safe); + PipelineLayout(const Anvil::BaseDevice* in_device_ptr, + const PushConstantRanges& in_push_constant_ranges, + bool in_mt_safe); PipelineLayout (const PipelineLayout&); PipelineLayout& operator=(const PipelineLayout&); @@ -96,30 +88,29 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool bake(); + bool bake(const std::vector* in_ds_info_items_ptr); - /** Initializes a new wrapper instance with user-specified descriptor set groups (appended - * one after another, in the user-defined order) defined at creation time. + /** Initializes a new wrapper instance using information extracted from user-specified descriptor set groups (appended + * one after another, in the user-defined order). * * This constructor can be used to initialize immutable pipeline layouts. If @param in_is_immutable * is set to true, attach_dsg() and attach_push_constant_range() calls invoked for such object * will result in a failure. * * @param in_device_ptr Device to use. Must not be nullptr. - * @param in_dsg_ptr Descriptor set group to use for the pipeline layout. + * @param in_ds_info_items_ptr TODO * @param in_push_constant_ranges Push constant ranges to define for the pipeline layout. * **/ - static std::shared_ptr create(std::weak_ptr in_device_ptr, - std::shared_ptr in_dsg_ptr, - const PushConstantRanges& in_push_constant_ranges, - bool in_mt_safe); + static PipelineLayoutUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + const std::vector* in_ds_info_items_ptr, + const PushConstantRanges& in_push_constant_ranges, + bool in_mt_safe); /* Private variables */ - std::weak_ptr m_device_ptr; - - bool m_dirty; - std::shared_ptr m_dsg_ptr; + const Anvil::BaseDevice* m_device_ptr; + std::vector m_ds_info_ptrs; + std::vector m_ds_layout_ptrs; VkPipelineLayout m_layout_vk; PushConstantRanges m_push_constant_ranges; diff --git a/include/wrappers/pipeline_layout_manager.h b/include/wrappers/pipeline_layout_manager.h index 248486b9..12893135 100644 --- a/include/wrappers/pipeline_layout_manager.h +++ b/include/wrappers/pipeline_layout_manager.h @@ -47,39 +47,46 @@ namespace Anvil /** Returns a pipeline layout wrapper matching the specified DSG + push constant range configuration. * If such pipeline layout has never been defined before, it will be created at the call time. * - * If the function returns a Anvil::PipelineLayout instance, it is caller's responsibility to release it - * in order for the object to be correctly deleted when its reference counter drops to zero. - * - * @param in_dsg_ptr A DescriptorSetGroup instance, holding the set of descriptor sets which the - * layout should describe. - * @param in_push_constant_ranges A vector of PushConstantRange descriptor, describing the push constant ranges - * the layout should define. - * @param out_pipeline_layout_ptr Deref will be set to a ptr to the pipeline layout wrapper instance, matching the described - * requirements. Must not be nullptr. + * @param in_ds_info_items_ptr TODO. + * @param in_push_constant_ranges A vector of PushConstantRange descriptor, describing the push constant ranges + * the layout should define. + * @param out_pipeline_layout_ptr_ptr Deref will be set to a ptr to the pipeline layout wrapper instance, matching the described + * requirements. Must not be nullptr. * * @return true if successful, false otherwise. **/ - bool get_layout(std::shared_ptr in_dsg_ptr, - const PushConstantRanges& in_push_constant_ranges, - std::shared_ptr* out_pipeline_layout_ptr); + bool get_layout(const std::vector* in_ds_info_items_ptr, + const PushConstantRanges& in_push_constant_ranges, + Anvil::PipelineLayoutUniquePtr* out_pipeline_layout_ptr_ptr); protected: /* Protected functions */ private: /* Private type declarations */ + typedef struct PipelineLayoutContainer + { + std::atomic n_references; + PipelineLayoutUniquePtr pipeline_layout_ptr; + + PipelineLayoutContainer() + :n_references(1) + { + /* Stub */ + } + } PipelineLayoutContainer; - /* NOTE: We do NOT own pipeline layouts. As soon as all wrapper instances are out of scope, - * we drop the entry. */ - typedef std::vector PipelineLayouts; + typedef std::vector > PipelineLayouts; /* Private functions */ - PipelineLayoutManager(std::weak_ptr in_device_ptr, - bool in_mt_safe); + PipelineLayoutManager(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe); PipelineLayoutManager (const PipelineLayoutManager&); PipelineLayoutManager& operator=(const PipelineLayoutManager&); + void on_pipeline_layout_dereferenced(Anvil::PipelineLayout* in_layout_ptr); + /** Instantiates a new PipelineLayoutManager instance. * * NOTE: This function should only be used by Device. @@ -89,15 +96,12 @@ namespace Anvil * * @return PipelineLayoutManager instance, or nullptr if the function failed. **/ - static std::shared_ptr create(std::weak_ptr in_device_ptr, - bool in_mt_safe); - - void on_pipeline_layout_dropped(CallbackArgument* in_callback_arg_raw_ptr); - void update_subscriptions (bool in_should_init); + static Anvil::PipelineLayoutManagerUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe); /* Private members */ - std::weak_ptr m_device_ptr; - PipelineLayouts m_pipeline_layouts; + const Anvil::BaseDevice* m_device_ptr; + PipelineLayouts m_pipeline_layouts; friend class BaseDevice; }; diff --git a/include/wrappers/query_pool.h b/include/wrappers/query_pool.h index 44ae55b4..a0f74502 100644 --- a/include/wrappers/query_pool.h +++ b/include/wrappers/query_pool.h @@ -52,10 +52,10 @@ namespace Anvil * for this query pool. * **/ - static std::shared_ptr create_non_ps_query_pool(std::weak_ptr in_device_ptr, - VkQueryType in_query_type, - uint32_t in_n_max_concurrent_queries, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::QueryPoolUniquePtr create_non_ps_query_pool(const Anvil::BaseDevice* in_device_ptr, + VkQueryType in_query_type, + uint32_t in_n_max_concurrent_queries, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Creates a new pipeline statistics query pool. * @@ -67,10 +67,10 @@ namespace Anvil * @param in_n_max_concurrent_queries Number of queries to preallocate in the pool. * **/ - static std::shared_ptr create_ps_query_pool(std::weak_ptr in_device_ptr, - VkQueryPipelineStatisticFlags in_pipeline_statistics, - uint32_t in_n_max_concurrent_queries, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::QueryPoolUniquePtr create_ps_query_pool(const Anvil::BaseDevice* in_device_ptr, + VkQueryPipelineStatisticFlags in_pipeline_statistics, + uint32_t in_n_max_concurrent_queries, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destructor */ virtual ~QueryPool(); @@ -90,35 +90,33 @@ namespace Anvil private: /* Constructor. Please see corresponding create() for specification */ - explicit QueryPool(std::weak_ptr in_device_ptr, - VkQueryType in_query_type, - uint32_t in_n_max_concurrent_queries, - bool in_mt_safe); + explicit QueryPool(const Anvil::BaseDevice* in_device_ptr, + VkQueryType in_query_type, + uint32_t in_n_max_concurrent_queries, + bool in_mt_safe); /* Constructor. Please see corresponding create() for specification */ - explicit QueryPool(std::weak_ptr in_device_ptr, - VkQueryType in_query_type, - VkFlags in_query_flags, - uint32_t in_n_max_concurrent_queries, - bool in_mt_safe); + explicit QueryPool(const Anvil::BaseDevice* in_device_ptr, + VkQueryType in_query_type, + VkFlags in_query_flags, + uint32_t in_n_max_concurrent_queries, + bool in_mt_safe); /** Initializes the Vulkan counterpart. * - * @param in_device_ptr Device to create the query pool for. Must not be nullptr. * @param in_query_type Type of the query to instantiate the pool for. * @param in_flags Query flags to instantiate the pool with. * @param in_n_max_concurrent_queries Maximum number of queries which can be used concurrently with * the query pool. **/ - void init(std::weak_ptr in_device_ptr, - VkQueryType in_query_type, - VkFlags in_flags, - uint32_t in_n_max_concurrent_queries); + void init(VkQueryType in_query_type, + VkFlags in_flags, + uint32_t in_n_max_concurrent_queries); /* Private variables */ - std::weak_ptr m_device_ptr; - uint32_t m_n_max_indices; - VkQueryPool m_query_pool_vk; + const Anvil::BaseDevice* m_device_ptr; + uint32_t m_n_max_indices; + VkQueryPool m_query_pool_vk; }; }; /* namespace Anvil */ diff --git a/include/wrappers/queue.h b/include/wrappers/queue.h index 0a481178..666929fc 100644 --- a/include/wrappers/queue.h +++ b/include/wrappers/queue.h @@ -69,10 +69,10 @@ namespace Anvil * no more than one thread at a time will ever submit a cmd buffer to the * same cmd queue. **/ - static std::shared_ptr create(std::weak_ptr in_device_ptr, - uint32_t in_queue_family_index, - uint32_t in_queue_index, - bool in_mt_safe); + static std::unique_ptr create(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_queue_family_index, + uint32_t in_queue_index, + bool in_mt_safe); /** Destructor */ virtual ~Queue(); @@ -84,7 +84,7 @@ namespace Anvil bool bind_sparse_memory(Anvil::Utils::SparseMemoryBindingUpdateInfo& in_update); /** Retrieves parent device instance */ - std::weak_ptr get_parent_device() const + const Anvil::BaseDevice* get_parent_device() const { return m_device_ptr; } @@ -118,19 +118,19 @@ namespace Anvil * In off-screen rendering mode, swapchain images are actually regular images, so * presentable layout is not supported. * - * @param in_swapchain_ptr Swapchain to use for the operation. Must not be NULL. - * @param in_swapchain_image_index Index of the swapchain image to present. - * @param in_n_wait_semaphores Number of semaphores defined under @param in_wait_semaphore_ptrs. These sems will - * be waited on before presentation occurs. - * @param in_wait_semaphore_pts An array of @param in_n_wait_semaphores semaphore wrapper instances. May be nullptr - * if @param in_n_wait_semaphores is 0. + * @param in_swapchain_ptr Swapchain to use for the operation. Must not be NULL. + * @param in_swapchain_image_index Index of the swapchain image to present. + * @param in_n_wait_semaphores Number of semaphores defined under @param in_wait_semaphore_ptrs. These sems will + * be waited on before presentation occurs. + * @param in_wait_semaphore_ptrs_ptr Ptr to an array of @param in_n_wait_semaphores semaphore wrapper instances. May be nullptr + * if @param in_n_wait_semaphores is 0. * * @return Vulkan result for the operation. **/ - VkResult present(std::shared_ptr in_swapchain_ptr, - uint32_t in_swapchain_image_index, - uint32_t in_n_wait_semaphores, - std::shared_ptr* in_wait_semaphore_ptrs); + VkResult present(Anvil::Swapchain* in_swapchain_ptr, + uint32_t in_swapchain_image_index, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs_ptr); /** Waits on the semaphores specified by the user, executes user-defined command buffers, * and then signals the semaphores passed by arguments. If a non-nullptr fence is specified, @@ -144,15 +144,15 @@ namespace Anvil * * @param in_n_command_buffers Number of command buffers under @param in_opt_cmd_buffer_ptrs * which should be executed. May be 0. - * @param in_opt_cmd_buffer_ptrs Array of command buffers to execute. Can be nullptr if + * @param in_opt_cmd_buffer_ptrs_ptr Ptr to an array of command buffers to execute. Can be nullptr if * @param n_command_buffers is 0. * @param in_n_semaphores_to_signal Number of semaphores to signal after command buffers finish * executing. May be 0. - * @param in_opt_semaphore_to_signal_ptr_ptrs Array of semaphores to signal after execution. May be nullptr if + * @param in_opt_semaphore_to_signal_ptrs_ptr Ptr to an array of semaphores to signal after execution. May be nullptr if * @param n_semaphores_to_signal is 0. * @param in_n_semaphores_to_wait_on Number of semaphores to wait on before executing command buffers. * May be 0. - * @param in_opt_semaphore_to_wait_on_ptr_ptrs Array of semaphores to wait on prior to execution. May be nullptr + * @param in_opt_semaphore_to_wait_on_ptrs_ptr Ptr to an array of semaphores to wait on prior to execution. May be nullptr * if @param in_n_semaphores_to_wait_on is 0. * @param in_opt_dst_stage_masks_to_wait_on_ptrs Array of size @param in_n_semaphores_to_wait_on, specifying stages * at which the wait ops should be performed. May be nullptr if @@ -164,23 +164,23 @@ namespace Anvil * If @param in_should_block is false, the fence will be passed at * submit call time, but will not be waited on. **/ - void submit_command_buffers(uint32_t in_n_command_buffers, - std::shared_ptr const* in_opt_cmd_buffer_ptrs, - uint32_t in_n_semaphores_to_signal, - std::shared_ptr const* in_opt_semaphore_to_signal_ptr_ptrs, - uint32_t in_n_semaphores_to_wait_on, - std::shared_ptr const* in_opt_semaphore_to_wait_on_ptr_ptrs, - const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, - bool in_should_block, - std::shared_ptr in_opt_fence_ptr = std::shared_ptr() ); + void submit_command_buffers(uint32_t in_n_command_buffers, + Anvil::CommandBufferBase* const* in_opt_cmd_buffer_ptrs_ptr, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptr_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr); /** Submits specified command buffer to the queue. Can optionally wait until the execution finishes. * * For argument discussion, please see submit_command_buffers() documentation **/ - void submit_command_buffer(std::shared_ptr in_cmd_buffer_ptr, - bool in_should_block, - std::shared_ptr in_opt_fence_ptr = std::shared_ptr() ) + void submit_command_buffer(Anvil::CommandBufferBase* in_cmd_buffer_ptr, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr) { submit_command_buffers(1, /* n_command_buffers */ &in_cmd_buffer_ptr, @@ -200,16 +200,16 @@ namespace Anvil * * For argument discussion, please see submit_command_buffers() documentation **/ - void submit_command_buffer_with_signal_semaphores(std::shared_ptr in_opt_cmd_buffer_ptr, - uint32_t in_n_semaphores_to_signal, - std::shared_ptr const* in_semaphore_to_signal_ptr_ptrs, - bool in_should_block, - std::shared_ptr in_opt_fence_ptr = std::shared_ptr() ) + void submit_command_buffer_with_signal_semaphores(Anvil::CommandBufferBase* in_opt_cmd_buffer_ptr, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr) { submit_command_buffers((in_opt_cmd_buffer_ptr != nullptr) ? 1u : 0u, &in_opt_cmd_buffer_ptr, in_n_semaphores_to_signal, - in_semaphore_to_signal_ptr_ptrs, + in_semaphore_to_signal_ptrs_ptr, 0, /* n_semaphores_to_wait_on */ nullptr, /* semaphore_to_wait_on_ptr_ptrs */ nullptr, /* opt_dst_stage_masks_to_wait_on_ptrs */ @@ -225,21 +225,21 @@ namespace Anvil * * For argument discussion, please see submit_command_buffers() documentation **/ - void submit_command_buffer_with_signal_wait_semaphores(std::shared_ptr in_opt_cmd_buffer_ptr, - uint32_t in_n_semaphores_to_signal, - std::shared_ptr const* in_semaphore_to_signal_ptr_ptrs, - uint32_t in_n_semaphores_to_wait_on, - std::shared_ptr const* in_semaphore_to_wait_on_ptr_ptrs, - const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, - bool in_should_block, - std::shared_ptr in_opt_fence_ptr = std::shared_ptr() ) + void submit_command_buffer_with_signal_wait_semaphores(Anvil::CommandBufferBase* in_opt_cmd_buffer_ptr, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr) { submit_command_buffers((in_opt_cmd_buffer_ptr != nullptr) ? 1u : 0u, &in_opt_cmd_buffer_ptr, in_n_semaphores_to_signal, - in_semaphore_to_signal_ptr_ptrs, + in_semaphore_to_signal_ptrs_ptr, in_n_semaphores_to_wait_on, - in_semaphore_to_wait_on_ptr_ptrs, + in_semaphore_to_wait_on_ptrs_ptr, in_dst_stage_masks_to_wait_on_ptrs, in_should_block, in_opt_fence_ptr); @@ -251,19 +251,19 @@ namespace Anvil * * For argument discussion, please see submit_command_buffers() documentation **/ - void submit_command_buffer_with_wait_semaphores(std::shared_ptr in_cmd_buffer_ptr, - uint32_t in_n_semaphores_to_wait_on, - std::shared_ptr const* in_semaphore_to_wait_on_ptr_ptrs, - const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, - bool in_should_block, - std::shared_ptr in_opt_fence_ptr = std::shared_ptr() ) + void submit_command_buffer_with_wait_semaphores(Anvil::CommandBufferBase* in_cmd_buffer_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr) { submit_command_buffers((in_cmd_buffer_ptr != nullptr) ? 1u : 0u, &in_cmd_buffer_ptr, 0u, /* n_semaphores_to_signal */ nullptr, /* semaphore_to_signal_ptr_ptrs */ in_n_semaphores_to_wait_on, - in_semaphore_to_wait_on_ptr_ptrs, + in_semaphore_to_wait_on_ptrs_ptr, in_dst_stage_masks_to_wait_on_ptrs, in_should_block, in_opt_fence_ptr); @@ -277,45 +277,44 @@ namespace Anvil private: /* Private functions */ - VkResult present_internal (uint32_t in_n_swapchains, - const std::shared_ptr* in_swapchains, - const uint32_t* in_swapchain_image_indices, - const uint32_t* in_device_masks, - uint32_t in_n_wait_semaphores, - std::shared_ptr* in_wait_semaphore_ptrs); - void present_lock_unlock(uint32_t in_n_swapchains, - const std::shared_ptr* in_swapchains, - uint32_t in_n_wait_semaphores, - std::shared_ptr* in_wait_semaphore_ptrs, - bool in_should_lock); + VkResult present_internal (uint32_t in_n_swapchains, + Anvil::Swapchain* const* in_swapchains, + const uint32_t* in_swapchain_image_indices, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs); + void present_lock_unlock(uint32_t in_n_swapchains, + const Anvil::Swapchain* const* in_swapchains, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs, + bool in_should_lock); - void bind_sparse_memory_lock_unlock (Anvil::Utils::SparseMemoryBindingUpdateInfo& in_update, - bool in_should_lock); - void submit_command_buffers_lock_unlock(uint32_t in_n_command_buffers, - std::shared_ptr const* in_opt_cmd_buffer_ptrs, - uint32_t in_n_semaphores_to_signal, - std::shared_ptr const* in_opt_semaphore_to_signal_ptr_ptrs, - uint32_t in_n_semaphores_to_wait_on, - std::shared_ptr const* in_opt_semaphore_to_wait_on_ptr_ptrs, - std::shared_ptr in_opt_fence_ptr, - bool in_should_lock); + void bind_sparse_memory_lock_unlock (Anvil::Utils::SparseMemoryBindingUpdateInfo& in_update, + bool in_should_lock); + void submit_command_buffers_lock_unlock(uint32_t in_n_command_buffers, + Anvil::CommandBufferBase* const* in_opt_cmd_buffer_ptrs_ptr, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, + Anvil::Fence* in_opt_fence_ptr, + bool in_should_lock); /* Constructor. Please see create() for specification */ - Queue(std::weak_ptr in_device_ptr, - uint32_t in_queue_family_index, - uint32_t in_queue_index, - bool in_mt_safe); + Queue(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_queue_family_index, + uint32_t in_queue_index, + bool in_mt_safe); Queue (const Queue&); Queue operator=(const Queue&); /* Private variables */ - std::weak_ptr m_device_ptr; - VkQueue m_queue; - uint32_t m_queue_family_index; - uint32_t m_queue_index; - std::shared_ptr m_submit_fence_ptr; - bool m_supports_sparse_bindings; + const Anvil::BaseDevice* m_device_ptr; + VkQueue m_queue; + uint32_t m_queue_family_index; + uint32_t m_queue_index; + Anvil::FenceUniquePtr m_submit_fence_ptr; + bool m_supports_sparse_bindings; }; }; /* namespace Anvil */ diff --git a/include/wrappers/render_pass.h b/include/wrappers/render_pass.h index c225b525..fc883f71 100644 --- a/include/wrappers/render_pass.h +++ b/include/wrappers/render_pass.h @@ -30,8 +30,7 @@ namespace Anvil { - class RenderPass : public DebugMarkerSupportProvider, - public std::enable_shared_from_this + class RenderPass : public DebugMarkerSupportProvider { public: /* Public functions */ @@ -51,8 +50,8 @@ namespace Anvil * May be nullptr. * **/ - static std::shared_ptr create(std::unique_ptr in_renderpass_info_ptr, - std::shared_ptr in_opt_swapchain_ptr); + static Anvil::RenderPassUniquePtr create(Anvil::RenderPassInfoUniquePtr in_renderpass_info_ptr, + Anvil::Swapchain* in_opt_swapchain_ptr); /** Destructor. * @@ -68,13 +67,13 @@ namespace Anvil return m_render_pass; } - Anvil::RenderPassInfo* get_render_pass_info() const + const Anvil::RenderPassInfo* get_render_pass_info() const { return m_render_pass_info_ptr.get(); } /** Returns the Swapchain instance, associated with the RenderPass wrapper instance at creation time. */ - std::shared_ptr get_swapchain() const + Anvil::Swapchain* get_swapchain() const { return m_swapchain_ptr; } @@ -87,16 +86,16 @@ namespace Anvil bool init(); /* Constructor. Please see create() for specification */ - RenderPass(std::unique_ptr in_renderpass_info_ptr, - std::shared_ptr in_opt_swapchain_ptr); + RenderPass(Anvil::RenderPassInfoUniquePtr in_renderpass_info_ptr, + Anvil::Swapchain* in_opt_swapchain_ptr); RenderPass& operator=(const RenderPass&); RenderPass (const RenderPass&); /* Private members */ - VkRenderPass m_render_pass; - std::unique_ptr m_render_pass_info_ptr; - std::shared_ptr m_swapchain_ptr; + VkRenderPass m_render_pass; + Anvil::RenderPassInfoUniquePtr m_render_pass_info_ptr; + Swapchain* m_swapchain_ptr; }; }; diff --git a/include/wrappers/rendering_surface.h b/include/wrappers/rendering_surface.h index 07c00bf8..8a318a59 100644 --- a/include/wrappers/rendering_surface.h +++ b/include/wrappers/rendering_surface.h @@ -75,10 +75,10 @@ namespace Anvil /** Creates a single Vulkan rendering surface instance and registers the object in * Object Tracker. */ - static std::shared_ptr create(std::weak_ptr in_instance_ptr, - std::weak_ptr in_device_ptr, - std::shared_ptr in_window_ptr, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::RenderingSurfaceUniquePtr create(Anvil::Instance* in_instance_ptr, + const Anvil::BaseDevice* in_device_ptr, + const Anvil::Window* in_window_ptr, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destructor * @@ -88,8 +88,7 @@ namespace Anvil virtual ~RenderingSurface(); /** Returns rendering surface capabilities */ - bool get_capabilities(std::weak_ptr in_physical_device_ptr, - VkSurfaceCapabilitiesKHR* out_surface_caps_ptr) const; + bool get_capabilities(VkSurfaceCapabilitiesKHR* out_surface_caps_ptr) const; /** Returns rendering surface's height */ uint32_t get_height() const @@ -100,26 +99,22 @@ namespace Anvil } /** Returns logical device which was used to create this surface */ - std::weak_ptr get_device() const + const Anvil::BaseDevice* get_device() const { return m_device_ptr; } /** Returns queue family indices which support presentation on a given physical device */ - bool get_queue_families_with_present_support(std::weak_ptr in_physical_device_ptr, - const std::vector** out_result_ptr) const; + bool get_queue_families_with_present_support(const std::vector** out_result_ptr) const; /** Returns composite alpha modes supported by the rendering surface */ - bool get_supported_composite_alpha_flags(std::weak_ptr in_physical_device_ptr, - VkCompositeAlphaFlagsKHR* out_result_ptr) const; + bool get_supported_composite_alpha_flags(VkCompositeAlphaFlagsKHR* out_result_ptr) const; /** Returns transformations supported by the rendering surface */ - bool get_supported_transformations(std::weak_ptr in_physical_device_ptr, - VkSurfaceTransformFlagsKHR* out_result_ptr) const; + bool get_supported_transformations(VkSurfaceTransformFlagsKHR* out_result_ptr) const; /** Returns flags corresponding to image usage supported by the rendering surface */ - bool get_supported_usages(std::weak_ptr in_physical_device_ptr, - VkImageUsageFlags* out_result_ptr) const; + bool get_supported_usages(VkImageUsageFlags* out_result_ptr) const; /** Retrieves a raw handle to the underlying Vulkan Rendering Surface */ VkSurfaceKHR get_surface() const @@ -133,12 +128,6 @@ namespace Anvil return &m_surface; } - /** Returns type of the rendering surface */ - RenderingSurfaceType get_type() const - { - return m_type; - } - /** Returns rendering surface's width */ uint32_t get_width() const { @@ -149,19 +138,15 @@ namespace Anvil /* Tells whether the specified image format can be used for swapchain image initialization, using * this rendering surface. */ - bool is_compatible_with_image_format(std::weak_ptr in_physical_device_ptr, - VkFormat in_image_format, - bool* out_result_ptr) const; + bool is_compatible_with_image_format(VkFormat in_image_format, + bool* out_result_ptr) const; /* Tells whether the specified presentation mode is supported by the rendering surface */ - bool supports_presentation_mode(std::weak_ptr in_physical_device_ptr, - VkPresentModeKHR in_presentation_mode, - bool* out_result_ptr) const; + bool supports_presentation_mode(VkPresentModeKHR in_presentation_mode, + bool* out_result_ptr) const; private: /* Private type definitions */ - typedef uint32_t DeviceGroupIndex; - typedef struct PhysicalDeviceCapabilities { VkSurfaceCapabilitiesKHR capabilities; @@ -185,11 +170,11 @@ namespace Anvil /* Private functions */ /* Constructor. Please see create() for specification */ - RenderingSurface(std::weak_ptr in_instance_ptr, - std::weak_ptr in_device_ptr, - std::shared_ptr in_window_ptr, - bool in_mt_safe, - bool* out_safe_to_use_ptr); + RenderingSurface(Anvil::Instance* in_instance_ptr, + const Anvil::BaseDevice* in_device_ptr, + const Anvil::Window* in_window_ptr, + bool in_mt_safe, + bool* out_safe_to_use_ptr); RenderingSurface (const RenderingSurface&); RenderingSurface& operator=(const RenderingSurface&); @@ -198,16 +183,14 @@ namespace Anvil bool init (); /* Private variables */ - std::weak_ptr m_device_ptr; - std::shared_ptr m_instance_ptr; - - uint32_t m_height; - std::map m_physical_device_capabilities; - uint32_t m_stream_index; - VkSurfaceKHR m_surface; - RenderingSurfaceType m_type; - uint32_t m_width; - std::weak_ptr m_window_ptr; + const Anvil::BaseDevice* m_device_ptr; + Anvil::Instance* m_instance_ptr; + + uint32_t m_height; + PhysicalDeviceCapabilities m_physical_device_capabilities; + VkSurfaceKHR m_surface; + uint32_t m_width; + const Anvil::Window* m_window_ptr; }; }; /* namespace Anvil */ diff --git a/include/wrappers/sampler.h b/include/wrappers/sampler.h index 672b2bc0..c00a09e6 100644 --- a/include/wrappers/sampler.h +++ b/include/wrappers/sampler.h @@ -50,22 +50,22 @@ namespace Anvil * * For argument discussion, please consult Vulkan API specification. */ - static std::shared_ptr create(std::weak_ptr in_device_ptr, - VkFilter in_mag_filter, - VkFilter in_min_filter, - VkSamplerMipmapMode in_mipmap_mode, - VkSamplerAddressMode in_address_mode_u, - VkSamplerAddressMode in_address_mode_v, - VkSamplerAddressMode in_address_mode_w, - float in_lod_bias, - float in_max_anisotropy, - bool in_compare_enable, - VkCompareOp in_compare_op, - float in_min_lod, - float in_max_lod, - VkBorderColor in_border_color, - bool in_use_unnormalized_coordinates, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::SamplerUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + VkFilter in_mag_filter, + VkFilter in_min_filter, + VkSamplerMipmapMode in_mipmap_mode, + VkSamplerAddressMode in_address_mode_u, + VkSamplerAddressMode in_address_mode_v, + VkSamplerAddressMode in_address_mode_w, + float in_lod_bias, + float in_max_anisotropy, + bool in_compare_enable, + VkCompareOp in_compare_op, + float in_min_lod, + float in_max_lod, + VkBorderColor in_border_color, + bool in_use_unnormalized_coordinates, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destructor. * @@ -160,22 +160,22 @@ namespace Anvil /* Private functions */ /* Please see create() for specification */ - Sampler(std::weak_ptr in_device_ptr, - VkFilter in_mag_filter, - VkFilter in_min_filter, - VkSamplerMipmapMode in_mipmap_mode, - VkSamplerAddressMode in_address_mode_u, - VkSamplerAddressMode in_address_mode_v, - VkSamplerAddressMode in_address_mode_w, - float in_lod_bias, - float in_max_anisotropy, - bool in_compare_enable, - VkCompareOp in_compare_op, - float in_min_lod, - float in_max_lod, - VkBorderColor in_border_color, - bool in_use_unnormalized_coordinates, - bool in_mt_safe); + Sampler(const Anvil::BaseDevice* in_device_ptr, + VkFilter in_mag_filter, + VkFilter in_min_filter, + VkSamplerMipmapMode in_mipmap_mode, + VkSamplerAddressMode in_address_mode_u, + VkSamplerAddressMode in_address_mode_v, + VkSamplerAddressMode in_address_mode_w, + float in_lod_bias, + float in_max_anisotropy, + bool in_compare_enable, + VkCompareOp in_compare_op, + float in_min_lod, + float in_max_lod, + VkBorderColor in_border_color, + bool in_use_unnormalized_coordinates, + bool in_mt_safe); Sampler (const Sampler&); Sampler& operator=(const Sampler&); @@ -196,8 +196,8 @@ namespace Anvil VkSamplerMipmapMode m_mipmap_mode; bool m_use_unnormalized_coordinates; - std::weak_ptr m_device_ptr; - VkSampler m_sampler; + const Anvil::BaseDevice* m_device_ptr; + VkSampler m_sampler; }; }; /* namespace Anvil */ diff --git a/include/wrappers/semaphore.h b/include/wrappers/semaphore.h index 599d23d4..90fade94 100644 --- a/include/wrappers/semaphore.h +++ b/include/wrappers/semaphore.h @@ -45,8 +45,8 @@ namespace Anvil /* Public functions */ /** Creates a single Vulkan semaphore instance and registers the object in Object Tracker. */ - static std::shared_ptr create(std::weak_ptr in_device_ptr, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::SemaphoreUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destructor. * @@ -74,8 +74,8 @@ namespace Anvil /* Private functions */ /* Constructor. Please see create() for specification */ - Semaphore(std::weak_ptr in_device_ptr, - bool in_mt_safe); + Semaphore(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe); Semaphore (const Semaphore&); Semaphore& operator=(const Semaphore&); @@ -83,8 +83,8 @@ namespace Anvil void release_semaphore(); /* Private variables */ - std::weak_ptr m_device_ptr; - VkSemaphore m_semaphore; + const Anvil::BaseDevice* m_device_ptr; + VkSemaphore m_semaphore; }; }; /* namespace Anvil */ diff --git a/include/wrappers/shader_module.h b/include/wrappers/shader_module.h index 1dc72128..80a79d32 100644 --- a/include/wrappers/shader_module.h +++ b/include/wrappers/shader_module.h @@ -40,8 +40,7 @@ namespace Anvil class GLSLShaderToSPIRVGenerator; class ShaderModule : public DebugMarkerSupportProvider, - public MTSafetySupportProvider, - public std::enable_shared_from_this + public MTSafetySupportProvider { public: /* Public functions */ @@ -55,9 +54,9 @@ namespace Anvil * @param in_device_ptr Device to use to instantiate the shader module. Must not be nullptr. * @param in_spirv_generator_ptr SPIR-V generator, initialized with a GLSL shader body. **/ - static std::shared_ptr create_from_spirv_generator(std::weak_ptr in_device_ptr, - std::shared_ptr in_spirv_generator_ptr, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static ShaderModuleUniquePtr create_from_spirv_generator(const Anvil::BaseDevice* in_device_ptr, + GLSLShaderToSPIRVGenerator* in_spirv_generator_ptr, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Creates a new shader module instance from a raw SPIR-V blob. * @@ -80,26 +79,26 @@ namespace Anvil * @param in_opt_vs_entrypoint_name Vertex shader stage entry-point, if one is defined in the blob. * Otherwise, should be set to nullptr. **/ - static std::shared_ptr create_from_spirv_blob(std::weak_ptr in_device_ptr, - const char* in_spirv_blob, - uint32_t in_n_spirv_blob_bytes, - const char* in_opt_cs_entrypoint_name, - const char* in_opt_fs_entrypoint_name, - const char* in_opt_gs_entrypoint_name, - const char* in_opt_tc_entrypoint_name, - const char* in_opt_te_entrypoint_name, - const char* in_opt_vs_entrypoint_name, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); - static std::shared_ptr create_from_spirv_blob(std::weak_ptr in_device_ptr, - const char* in_spirv_blob, - uint32_t in_n_spirv_blob_bytes, - const std::string& in_opt_cs_entrypoint_name, - const std::string& in_opt_fs_entrypoint_name, - const std::string& in_opt_gs_entrypoint_name, - const std::string& in_opt_tc_entrypoint_name, - const std::string& in_opt_te_entrypoint_name, - const std::string& in_opt_vs_entrypoint_name, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + static ShaderModuleUniquePtr create_from_spirv_blob(const Anvil::BaseDevice* in_device_ptr, + const char* in_spirv_blob, + uint32_t in_n_spirv_blob_bytes, + const char* in_opt_cs_entrypoint_name, + const char* in_opt_fs_entrypoint_name, + const char* in_opt_gs_entrypoint_name, + const char* in_opt_tc_entrypoint_name, + const char* in_opt_te_entrypoint_name, + const char* in_opt_vs_entrypoint_name, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static ShaderModuleUniquePtr create_from_spirv_blob(const Anvil::BaseDevice* in_device_ptr, + const char* in_spirv_blob, + uint32_t in_n_spirv_blob_bytes, + const std::string& in_opt_cs_entrypoint_name, + const std::string& in_opt_fs_entrypoint_name, + const std::string& in_opt_gs_entrypoint_name, + const std::string& in_opt_tc_entrypoint_name, + const std::string& in_opt_te_entrypoint_name, + const std::string& in_opt_vs_entrypoint_name, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) { return create_from_spirv_blob(in_device_ptr, in_spirv_blob, @@ -112,16 +111,16 @@ namespace Anvil in_opt_vs_entrypoint_name.c_str(), in_mt_safety); } - static std::shared_ptr create_from_spirv_blob(std::weak_ptr in_device_ptr, - const uint32_t* in_spirv_blob, - uint32_t in_n_spirv_blob_uint32s, - const std::string& in_opt_cs_entrypoint_name, - const std::string& in_opt_fs_entrypoint_name, - const std::string& in_opt_gs_entrypoint_name, - const std::string& in_opt_tc_entrypoint_name, - const std::string& in_opt_te_entrypoint_name, - const std::string& in_opt_vs_entrypoint_name, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + static ShaderModuleUniquePtr create_from_spirv_blob(const Anvil::BaseDevice* in_device_ptr, + const uint32_t* in_spirv_blob, + uint32_t in_n_spirv_blob_uint32s, + const std::string& in_opt_cs_entrypoint_name, + const std::string& in_opt_fs_entrypoint_name, + const std::string& in_opt_gs_entrypoint_name, + const std::string& in_opt_tc_entrypoint_name, + const std::string& in_opt_te_entrypoint_name, + const std::string& in_opt_vs_entrypoint_name, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) { return create_from_spirv_blob(in_device_ptr, reinterpret_cast(in_spirv_blob), @@ -192,7 +191,7 @@ namespace Anvil } /** Returns the device, for which this shader module has been created. */ - std::weak_ptr get_parent_device() const + const Anvil::BaseDevice* get_parent_device() const { return m_device_ptr; } @@ -238,19 +237,19 @@ namespace Anvil /* Private functions */ /* Constructor. Please see create() for specification */ - explicit ShaderModule(std::weak_ptr in_device_ptr, - std::shared_ptr in_spirv_generator_ptr, - bool in_mt_safe); - explicit ShaderModule(std::weak_ptr in_device_ptr, - const char* in_spirv_blob, - uint32_t in_n_spirv_blob_bytes, - const std::string& in_opt_cs_entrypoint_name, - const std::string& in_opt_fs_entrypoint_name, - const std::string& in_opt_gs_entrypoint_name, - const std::string& in_opt_tc_entrypoint_name, - const std::string& in_opt_te_entrypoint_name, - const std::string& in_opt_vs_entrypoint_name, - bool in_mt_safe); + explicit ShaderModule(const Anvil::BaseDevice* in_device_ptr, + GLSLShaderToSPIRVGenerator* in_spirv_generator_ptr, + bool in_mt_safe); + explicit ShaderModule(const Anvil::BaseDevice* in_device_ptr, + const char* in_spirv_blob, + uint32_t in_n_spirv_blob_bytes, + const std::string& in_opt_cs_entrypoint_name, + const std::string& in_opt_fs_entrypoint_name, + const std::string& in_opt_gs_entrypoint_name, + const std::string& in_opt_tc_entrypoint_name, + const std::string& in_opt_te_entrypoint_name, + const std::string& in_opt_vs_entrypoint_name, + bool in_mt_safe); ShaderModule (const ShaderModule&); ShaderModule& operator=(const ShaderModule&); @@ -269,7 +268,7 @@ namespace Anvil bool init_from_spirv_blob(const char* in_spirv_blob, uint32_t in_n_spirv_blob_bytes); - void on_object_about_to_be_released(void* in_callback_arg); + void on_device_about_to_be_released(void* in_callback_arg); /* Private variables */ std::string m_cs_entrypoint_name; @@ -279,11 +278,10 @@ namespace Anvil std::string m_te_entrypoint_name; std::string m_vs_entrypoint_name; - std::weak_ptr m_device_ptr; - const Anvil::BaseDevice* m_device_raw_ptr; - std::string m_glsl_source_code; - VkShaderModule m_module; - std::vector m_spirv_blob; + const Anvil::BaseDevice* m_device_ptr; + std::string m_glsl_source_code; + VkShaderModule m_module; + std::vector m_spirv_blob; #ifdef ANVIL_LINK_WITH_GLSLANG std::string m_disassembly; diff --git a/include/wrappers/swapchain.h b/include/wrappers/swapchain.h index b3afff28..73a604f7 100644 --- a/include/wrappers/swapchain.h +++ b/include/wrappers/swapchain.h @@ -64,16 +64,16 @@ namespace Anvil * @param in_flags Swapchain create flags to pass, when creating the swapchain. * */ - static std::shared_ptr create(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_surface_ptr, - std::shared_ptr in_window_ptr, - VkFormat in_format, - VkPresentModeKHR in_present_mode, - VkImageUsageFlags in_usage_flags, - uint32_t in_n_images, - const ExtensionKHRSwapchainEntrypoints& in_khr_swapchain_entrypoints, - MTSafety in_mt_safety, - VkSwapchainCreateFlagsKHR in_flags = 0); + static Anvil::SwapchainUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + Anvil::RenderingSurface* in_parent_surface_ptr, + Anvil::Window* in_window_ptr, + VkFormat in_format, + VkPresentModeKHR in_present_mode, + VkImageUsageFlags in_usage_flags, + uint32_t in_n_images, + const ExtensionKHRSwapchainEntrypoints& in_khr_swapchain_entrypoints, + MTSafety in_mt_safety, + VkSwapchainCreateFlagsKHR in_flags = 0); /** Destructor. * @@ -92,8 +92,8 @@ namespace Anvil * * @return Index of the swapchain image that the commands should be submitted against. **/ - uint32_t acquire_image(std::shared_ptr in_opt_semaphore_ptr, - bool in_should_block = false); + uint32_t acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, + bool in_should_block = false); /* By default, swapchain instance will transparently destroy the underlying Vulkan swapchain handle, right before * the window is closed. @@ -105,7 +105,7 @@ namespace Anvil void disable_destroy_swapchain_before_parent_window_closes_behavior(); /** Returns device instance which has been used to create the swapchain */ - std::weak_ptr get_device() const + const Anvil::BaseDevice* get_device() const { return m_device_ptr; } @@ -145,7 +145,7 @@ namespace Anvil * * @return As per summary. **/ - std::shared_ptr get_image(uint32_t in_n_swapchain_image) const; + Anvil::Image* get_image(uint32_t in_n_swapchain_image) const; /** Retrieves an Image View instance associated with a swapchain image at index * @param n_swapchain_image. @@ -158,7 +158,7 @@ namespace Anvil * * @return As per summary. **/ - std::shared_ptr get_image_view(uint32_t in_n_swapchain_image) const; + Anvil::ImageView* get_image_view(uint32_t in_n_swapchain_image) const; /* Returns index of the most recently acquired swapchain image. * @@ -176,7 +176,7 @@ namespace Anvil } /** Retrieves parent rendering surface. */ - std::shared_ptr get_rendering_surface() const + const Anvil::RenderingSurface* get_rendering_surface() const { return m_parent_surface_ptr; } @@ -200,7 +200,7 @@ namespace Anvil /** Retrieves a window, to which the swapchain is bound. Note that under certain * circumstances no window may be assigned. */ - std::shared_ptr get_window() const + Anvil::Window* get_window() const { return m_window_ptr; } @@ -209,9 +209,9 @@ namespace Anvil /* Private functions */ /* Constructor. Please see create() for specification */ - Swapchain(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_surface_ptr, - std::shared_ptr in_window_ptr, + Swapchain(const Anvil::BaseDevice* in_device_ptr, + Anvil::RenderingSurface* in_parent_surface_ptr, + Anvil::Window* in_window_ptr, VkFormat in_format, VkPresentModeKHR in_present_mode, VkImageUsageFlags in_usage_flags, @@ -230,20 +230,20 @@ namespace Anvil void on_present_request_issued (Anvil::CallbackArgument* in_callback_raw_ptr); /* Private variables */ - bool m_destroy_swapchain_before_parent_window_closes; - std::weak_ptr m_device_ptr; - VkSwapchainCreateFlagsKHR m_flags; - std::shared_ptr m_image_available_fence_ptr; - VkFormat m_image_format; - std::vector > m_image_ptrs; - VkFormat m_image_view_format; - std::vector > m_image_view_ptrs; - uint32_t m_last_acquired_image_index; - uint32_t m_n_swapchain_images; - std::shared_ptr m_parent_surface_ptr; - VkPresentModeKHR m_present_mode; - VkSwapchainKHR m_swapchain; - std::shared_ptr m_window_ptr; + bool m_destroy_swapchain_before_parent_window_closes; + const Anvil::BaseDevice* m_device_ptr; + VkSwapchainCreateFlagsKHR m_flags; + Anvil::FenceUniquePtr m_image_available_fence_ptr; + VkFormat m_image_format; + std::vector m_image_ptrs; + VkFormat m_image_view_format; + std::vector m_image_view_ptrs; + uint32_t m_last_acquired_image_index; + uint32_t m_n_swapchain_images; + Anvil::RenderingSurface* m_parent_surface_ptr; + VkPresentModeKHR m_present_mode; + VkSwapchainKHR m_swapchain; + Anvil::Window* m_window_ptr; VkExtent2D m_size; @@ -255,7 +255,7 @@ namespace Anvil volatile uint32_t m_n_acquire_counter_rounded; volatile uint64_t m_n_present_counter; - std::vector > m_observed_queues; + std::vector m_observed_queues; }; }; /* namespace Anvil */ diff --git a/src/misc/base_pipeline_info.cpp b/src/misc/base_pipeline_info.cpp index 23e30320..9527dcc7 100644 --- a/src/misc/base_pipeline_info.cpp +++ b/src/misc/base_pipeline_info.cpp @@ -20,6 +20,8 @@ // THE SOFTWARE. // #include "misc/base_pipeline_info.h" +#include "misc/descriptor_set_info.h" +#include "wrappers/descriptor_set_group.h" #include @@ -115,7 +117,15 @@ void Anvil::BasePipelineInfo::copy_state_from(const BasePipelineInfo* in_src_pip { m_base_pipeline_id = in_src_pipeline_info_ptr->m_base_pipeline_id; - m_dsg_ptr = in_src_pipeline_info_ptr->m_dsg_ptr; + for (auto& current_ds_info_item_ptr : in_src_pipeline_info_ptr->m_ds_info_items) + { + m_ds_info_items.push_back( + Anvil::DescriptorSetInfoUniquePtr( + new DescriptorSetInfo(*current_ds_info_item_ptr.get() ) + ) + ); + } + m_push_constant_ranges = in_src_pipeline_info_ptr->m_push_constant_ranges; m_allow_derivatives = in_src_pipeline_info_ptr->m_allow_derivatives; @@ -171,21 +181,21 @@ bool Anvil::BasePipelineInfo::get_specialization_constants(Anvil::ShaderStage return result; } -void Anvil::BasePipelineInfo::init_derivative_pipeline_info(bool in_disable_optimizations, - bool in_allow_derivatives, - uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, - Anvil::PipelineID in_base_pipeline_id, - std::shared_ptr in_opt_dsg_ptr) +void Anvil::BasePipelineInfo::init_derivative_pipeline_info(bool in_disable_optimizations, + bool in_allow_derivatives, + uint32_t in_n_shader_module_stage_entrypoints, + const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, + Anvil::PipelineID in_base_pipeline_id, + const std::vector* in_opt_ds_info_vec_ptr) { m_allow_derivatives = in_allow_derivatives; m_base_pipeline_id = in_base_pipeline_id; m_disable_optimizations = in_disable_optimizations; m_is_proxy = false; - if (in_opt_dsg_ptr != nullptr) + if (in_opt_ds_info_vec_ptr != nullptr) { - m_dsg_ptr = in_opt_dsg_ptr; + set_descriptor_set_info(in_opt_ds_info_vec_ptr); } init_shader_modules(in_n_shader_module_stage_entrypoints, @@ -200,20 +210,20 @@ void Anvil::BasePipelineInfo::init_proxy_pipeline_info() m_is_proxy = true; } -void Anvil::BasePipelineInfo::init_regular_pipeline_info(bool in_disable_optimizations, - bool in_allow_derivatives, - uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, - std::shared_ptr in_opt_dsg_ptr) +void Anvil::BasePipelineInfo::init_regular_pipeline_info(bool in_disable_optimizations, + bool in_allow_derivatives, + uint32_t in_n_shader_module_stage_entrypoints, + const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, + const std::vector* in_opt_ds_info_vec_ptr) { m_allow_derivatives = in_allow_derivatives; m_base_pipeline_id = UINT32_MAX; m_disable_optimizations = in_disable_optimizations; m_is_proxy = false; - if (in_opt_dsg_ptr != nullptr) + if (in_opt_ds_info_vec_ptr != nullptr) { - m_dsg_ptr = in_opt_dsg_ptr; + set_descriptor_set_info(in_opt_ds_info_vec_ptr); } init_shader_modules(in_n_shader_module_stage_entrypoints, @@ -239,7 +249,29 @@ void Anvil::BasePipelineInfo::init_shader_modules(uint32_t } } -void Anvil::BasePipelineInfo::set_dsg(std::shared_ptr in_dsg_ptr) +void Anvil::BasePipelineInfo::set_descriptor_set_info(const std::vector* in_ds_info_vec_ptr) { - m_dsg_ptr = in_dsg_ptr; + const uint32_t n_descriptor_sets = static_cast(in_ds_info_vec_ptr->size() ); + + for (uint32_t n_descriptor_set = 0; + n_descriptor_set < n_descriptor_sets; + ++n_descriptor_set) + { + const auto reference_ds_info_ptr = in_ds_info_vec_ptr->at(n_descriptor_set); + + if (reference_ds_info_ptr == nullptr) + { + m_ds_info_items.push_back( + Anvil::DescriptorSetInfoUniquePtr() + ); + + continue; + } + + m_ds_info_items.push_back( + Anvil::DescriptorSetInfoUniquePtr( + new Anvil::DescriptorSetInfo(*reference_ds_info_ptr) + ) + ); + } } \ No newline at end of file diff --git a/src/misc/base_pipeline_manager.cpp b/src/misc/base_pipeline_manager.cpp index ddb5730d..ecc5883b 100644 --- a/src/misc/base_pipeline_manager.cpp +++ b/src/misc/base_pipeline_manager.cpp @@ -31,19 +31,20 @@ #include /** Please see header for specification */ -Anvil::BasePipelineManager::BasePipelineManager(std::weak_ptr in_device_ptr, - bool in_mt_safe, - bool in_use_pipeline_cache, - std::shared_ptr in_pipeline_cache_to_reuse_ptr) +Anvil::BasePipelineManager::BasePipelineManager(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe, + bool in_use_pipeline_cache, + Anvil::PipelineCache* in_pipeline_cache_to_reuse_ptr) :CallbacksSupportProvider(BASE_PIPELINE_MANAGER_CALLBACK_ID_COUNT), MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), + m_pipeline_cache_ptr (nullptr), m_pipeline_counter (0) { anvil_assert(!in_use_pipeline_cache && in_pipeline_cache_to_reuse_ptr == nullptr || in_use_pipeline_cache); - m_pipeline_layout_manager_ptr = in_device_ptr.lock()->get_pipeline_layout_manager(); + m_pipeline_layout_manager_ptr = in_device_ptr->get_pipeline_layout_manager(); anvil_assert(m_pipeline_layout_manager_ptr != nullptr); if (in_pipeline_cache_to_reuse_ptr != nullptr) @@ -55,12 +56,12 @@ Anvil::BasePipelineManager::BasePipelineManager(std::weak_ptr { if (in_use_pipeline_cache) { - m_pipeline_cache_ptr = Anvil::PipelineCache::create( - m_device_ptr, - in_mt_safe, - 0, /* in_initial_data_size */ - nullptr /* in_initial_data */ - ); + m_pipeline_cache_owned_ptr = Anvil::PipelineCache::create(m_device_ptr, + in_mt_safe, + 0, /* in_initial_data_size */ + nullptr); /* in_initial_data */ + + m_pipeline_cache_ptr = m_pipeline_cache_owned_ptr.get(); } m_use_pipeline_cache = in_use_pipeline_cache; @@ -71,8 +72,6 @@ Anvil::BasePipelineManager::BasePipelineManager(std::weak_ptr Anvil::BasePipelineManager::~BasePipelineManager() { anvil_assert(m_baked_pipelines.size() == 0); - - m_pipeline_layout_manager_ptr.reset(); } @@ -84,17 +83,15 @@ void Anvil::BasePipelineManager::Pipeline::release_pipeline() { if (baked_pipeline != VK_NULL_HANDLE) { - std::shared_ptr device_locked_ptr(device_ptr); - - device_locked_ptr->get_pipeline_cache()->lock(); + device_ptr->get_pipeline_cache()->lock(); lock(); { - vkDestroyPipeline(device_locked_ptr->get_device_vk(), + vkDestroyPipeline(device_ptr->get_device_vk(), baked_pipeline, nullptr /* pAllocator */); } unlock(); - device_locked_ptr->get_pipeline_cache()->unlock(); + device_ptr->get_pipeline_cache()->unlock(); baked_pipeline = VK_NULL_HANDLE; } @@ -102,11 +99,10 @@ void Anvil::BasePipelineManager::Pipeline::release_pipeline() /* Please see header for specification */ -bool Anvil::BasePipelineManager::add_pipeline(std::unique_ptr in_pipeline_info_ptr, - PipelineID* out_pipeline_id_ptr) +bool Anvil::BasePipelineManager::add_pipeline(Anvil::BasePipelineInfoUniquePtr in_pipeline_info_ptr, + PipelineID* out_pipeline_id_ptr) { const Anvil::PipelineID base_pipeline_id = in_pipeline_info_ptr->get_base_pipeline_id(); - std::shared_ptr base_pipeline_ptr; auto callback_arg = Anvil::OnNewPipelineCreatedCallbackData(UINT32_MAX); std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -142,7 +138,7 @@ bool Anvil::BasePipelineManager::add_pipeline(std::unique_ptrpipeline_info_ptr->allows_derivatives() ); + anvil_assert(base_pipeline_info_ptr->allows_derivatives() ); } else { @@ -350,13 +346,13 @@ const Anvil::BasePipelineInfo* Anvil::BasePipelineManager::get_pipeline_info(Pip } /* Please see header for specification */ -std::shared_ptr Anvil::BasePipelineManager::get_pipeline_layout(PipelineID in_pipeline_id) +Anvil::PipelineLayout* Anvil::BasePipelineManager::get_pipeline_layout(PipelineID in_pipeline_id) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); Pipelines::iterator pipeline_iterator; Pipeline* pipeline_ptr = nullptr; - std::shared_ptr result_ptr; + Anvil::PipelineLayout* result_ptr = nullptr; if (mutex_ptr != nullptr) { @@ -390,7 +386,7 @@ std::shared_ptr Anvil::BasePipelineManager::get_pipeline_ if (pipeline_ptr->layout_ptr == nullptr) { - if (!m_pipeline_layout_manager_ptr->get_layout(pipeline_ptr->pipeline_info_ptr->get_dsg (), + if (!m_pipeline_layout_manager_ptr->get_layout(pipeline_ptr->pipeline_info_ptr->get_ds_info_items (), pipeline_ptr->pipeline_info_ptr->get_push_constant_ranges(), &pipeline_ptr->layout_ptr) ) { @@ -407,7 +403,7 @@ std::shared_ptr Anvil::BasePipelineManager::get_pipeline_ } } - result_ptr = pipeline_ptr->layout_ptr; + result_ptr = pipeline_ptr->layout_ptr.get(); end: return result_ptr; @@ -419,8 +415,7 @@ bool Anvil::BasePipelineManager::get_shader_info(PipelineID in_ Anvil::ShaderInfoType in_info_type, std::vector* out_data_ptr) { - std::shared_ptr device_ptr = m_device_ptr.lock();; - Anvil::ExtensionAMDShaderInfoEntrypoints entrypoints = device_ptr->get_extension_amd_shader_info_entrypoints(); + Anvil::ExtensionAMDShaderInfoEntrypoints entrypoints = m_device_ptr->get_extension_amd_shader_info_entrypoints(); std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); Pipelines::const_iterator pipeline_iterator; @@ -493,13 +488,12 @@ bool Anvil::BasePipelineManager::get_shader_info(PipelineID in_ if (out_data_size == 0) { - vk_result = entrypoints.vkGetShaderInfoAMD( - device_ptr->get_device_vk(), - pipeline_ptr->baked_pipeline, - shader_stage_vk, - vk_info_type, - &out_data_size, - nullptr); + vk_result = entrypoints.vkGetShaderInfoAMD(m_device_ptr->get_device_vk(), + pipeline_ptr->baked_pipeline, + shader_stage_vk, + vk_info_type, + &out_data_size, + nullptr); if (vk_result == VK_ERROR_FEATURE_NOT_PRESENT) { @@ -515,13 +509,12 @@ bool Anvil::BasePipelineManager::get_shader_info(PipelineID in_ out_data_ptr->resize(out_data_size); } - vk_result = entrypoints.vkGetShaderInfoAMD( - device_ptr->get_device_vk(), - pipeline_ptr->baked_pipeline, - shader_stage_vk, - vk_info_type, - &out_data_size, - &(*out_data_ptr).at(0)); + vk_result = entrypoints.vkGetShaderInfoAMD(m_device_ptr->get_device_vk(), + pipeline_ptr->baked_pipeline, + shader_stage_vk, + vk_info_type, + &out_data_size, + &(*out_data_ptr).at(0)); if (vk_result == VK_ERROR_FEATURE_NOT_PRESENT) { @@ -544,8 +537,7 @@ bool Anvil::BasePipelineManager::get_shader_statistics(PipelineID Anvil::ShaderStage in_shader_stage, VkShaderStatisticsInfoAMD* out_shader_statistics_ptr) { - std::shared_ptr device_ptr = m_device_ptr.lock(); - Anvil::ExtensionAMDShaderInfoEntrypoints entrypoints = device_ptr->get_extension_amd_shader_info_entrypoints(); + Anvil::ExtensionAMDShaderInfoEntrypoints entrypoints = m_device_ptr->get_extension_amd_shader_info_entrypoints(); std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); Pipelines::const_iterator pipeline_iterator; @@ -591,13 +583,12 @@ bool Anvil::BasePipelineManager::get_shader_statistics(PipelineID anvil_assert(!pipeline_ptr->baked_pipeline != VK_NULL_HANDLE); } - vk_result = entrypoints.vkGetShaderInfoAMD( - device_ptr->get_device_vk(), - pipeline_ptr->baked_pipeline, - shader_stage_vk, - VK_SHADER_INFO_TYPE_STATISTICS_AMD, - &shader_statistics_size, - out_shader_statistics_ptr); + vk_result = entrypoints.vkGetShaderInfoAMD(m_device_ptr->get_device_vk(), + pipeline_ptr->baked_pipeline, + shader_stage_vk, + VK_SHADER_INFO_TYPE_STATISTICS_AMD, + &shader_statistics_size, + out_shader_statistics_ptr); if (vk_result == VK_ERROR_FEATURE_NOT_PRESENT) { diff --git a/src/misc/compute_pipeline_info.cpp b/src/misc/compute_pipeline_info.cpp index 1ae93de5..8f3a6750 100644 --- a/src/misc/compute_pipeline_info.cpp +++ b/src/misc/compute_pipeline_info.cpp @@ -31,12 +31,13 @@ Anvil::ComputePipelineInfo::~ComputePipelineInfo() /* Stub */ } -std::unique_ptr Anvil::ComputePipelineInfo::create_derivative_pipeline_info(bool in_disable_optimizations, - bool in_allow_derivatives, - const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info, - Anvil::PipelineID in_base_pipeline_id) +Anvil::ComputePipelineInfoUniquePtr Anvil::ComputePipelineInfo::create_derivative_pipeline_info(bool in_disable_optimizations, + bool in_allow_derivatives, + const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info, + Anvil::PipelineID in_base_pipeline_id) { - std::unique_ptr result_ptr; + Anvil::ComputePipelineInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new ComputePipelineInfo() @@ -54,9 +55,10 @@ std::unique_ptr Anvil::ComputePipelineInfo::create_d return result_ptr; } -std::unique_ptr Anvil::ComputePipelineInfo::create_proxy_pipeline_info() +Anvil::ComputePipelineInfoUniquePtr Anvil::ComputePipelineInfo::create_proxy_pipeline_info() { - std::unique_ptr result_ptr; + Anvil::ComputePipelineInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new ComputePipelineInfo() @@ -70,11 +72,12 @@ std::unique_ptr Anvil::ComputePipelineInfo::create_p return result_ptr; } -std::unique_ptr Anvil::ComputePipelineInfo::create_regular_pipeline_info(bool in_disable_optimizations, - bool in_allow_derivatives, - const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info) +Anvil::ComputePipelineInfoUniquePtr Anvil::ComputePipelineInfo::create_regular_pipeline_info(bool in_disable_optimizations, + bool in_allow_derivatives, + const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info) { - std::unique_ptr result_ptr; + Anvil::ComputePipelineInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new ComputePipelineInfo() diff --git a/src/misc/debug_marker.cpp b/src/misc/debug_marker.cpp index 54f01d02..e9c06c05 100644 --- a/src/misc/debug_marker.cpp +++ b/src/misc/debug_marker.cpp @@ -25,16 +25,14 @@ #include "wrappers/device.h" /** Please see header for specification */ -Anvil::DebugMarkerSupportProviderWorker::DebugMarkerSupportProviderWorker(std::weak_ptr in_device_ptr, - VkDebugReportObjectTypeEXT in_vk_object_type) +Anvil::DebugMarkerSupportProviderWorker::DebugMarkerSupportProviderWorker(const Anvil::BaseDevice* in_device_ptr, + VkDebugReportObjectTypeEXT in_vk_object_type) :m_device_ptr (in_device_ptr), m_object_tag_name (0), m_vk_object_handle(VK_NULL_HANDLE), m_vk_object_type (in_vk_object_type) { - std::shared_ptr device_locked_ptr(m_device_ptr); - - m_is_ext_debug_marker_available = device_locked_ptr->is_ext_debug_marker_extension_enabled(); + m_is_ext_debug_marker_available = m_device_ptr->is_ext_debug_marker_extension_enabled(); m_object_tag_name = 0; } @@ -51,10 +49,9 @@ void Anvil::DebugMarkerSupportProviderWorker::set_name_internal(const std::strin if (m_is_ext_debug_marker_available && (m_vk_object_handle != VK_NULL_HANDLE) ) { - std::shared_ptr device_locked_ptr(m_device_ptr); - const auto& entrypoints (device_locked_ptr->get_extension_ext_debug_marker_entrypoints() ); - VkDebugMarkerObjectNameInfoEXT name_info; - VkResult result_vk; + const auto& entrypoints(m_device_ptr->get_extension_ext_debug_marker_entrypoints() ); + VkDebugMarkerObjectNameInfoEXT name_info; + VkResult result_vk; name_info.object = m_vk_object_handle; name_info.objectType = m_vk_object_type; @@ -64,7 +61,7 @@ void Anvil::DebugMarkerSupportProviderWorker::set_name_internal(const std::strin /* TODO: Host synchronization */ { - result_vk = entrypoints.vkDebugMarkerSetObjectNameEXT(device_locked_ptr->get_device_vk(), + result_vk = entrypoints.vkDebugMarkerSetObjectNameEXT(m_device_ptr->get_device_vk(), &name_info); } @@ -112,10 +109,9 @@ void Anvil::DebugMarkerSupportProviderWorker::set_tag_internal(const uint64_t in if (m_is_ext_debug_marker_available && (m_vk_object_handle != VK_NULL_HANDLE) ) { - std::shared_ptr device_locked_ptr(m_device_ptr); - const auto& entrypoints (device_locked_ptr->get_extension_ext_debug_marker_entrypoints() ); - VkResult result_vk; - VkDebugMarkerObjectTagInfoEXT tag_info; + const auto& entrypoints(m_device_ptr->get_extension_ext_debug_marker_entrypoints() ); + VkResult result_vk; + VkDebugMarkerObjectTagInfoEXT tag_info; tag_info.object = m_vk_object_handle; tag_info.objectType = m_vk_object_type; @@ -126,7 +122,7 @@ void Anvil::DebugMarkerSupportProviderWorker::set_tag_internal(const uint64_t in /* TODO: Host synchronization */ { - result_vk = entrypoints.vkDebugMarkerSetObjectTagEXT(device_locked_ptr->get_device_vk(), + result_vk = entrypoints.vkDebugMarkerSetObjectTagEXT(m_device_ptr->get_device_vk(), &tag_info); } diff --git a/src/misc/descriptor_set_info.cpp b/src/misc/descriptor_set_info.cpp index a8ac8b0a..4c34a054 100644 --- a/src/misc/descriptor_set_info.cpp +++ b/src/misc/descriptor_set_info.cpp @@ -21,6 +21,9 @@ // #include "misc/descriptor_set_info.h" +#include "misc/struct_chainer.h" +#include "wrappers/device.h" +#include "wrappers/sampler.h" /** Please see header for specification */ Anvil::DescriptorSetInfo::DescriptorSetInfo() @@ -35,11 +38,11 @@ Anvil::DescriptorSetInfo::~DescriptorSetInfo() } /** Please see header for specification */ -bool Anvil::DescriptorSetInfo::add_binding(uint32_t in_binding_index, - VkDescriptorType in_descriptor_type, - uint32_t in_descriptor_array_size, - VkShaderStageFlags in_stage_flags, - const std::shared_ptr* in_immutable_sampler_ptrs) +bool Anvil::DescriptorSetInfo::add_binding(uint32_t in_binding_index, + VkDescriptorType in_descriptor_type, + uint32_t in_descriptor_array_size, + VkShaderStageFlags in_stage_flags, + const Anvil::Sampler* const* in_immutable_sampler_ptrs) { bool result = false; @@ -76,9 +79,10 @@ bool Anvil::DescriptorSetInfo::add_binding(uint32_t } /** Please see header for specification */ -std::unique_ptr Anvil::DescriptorSetInfo::create() +Anvil::DescriptorSetInfoUniquePtr Anvil::DescriptorSetInfo::create() { - std::unique_ptr result_ptr; + Anvil::DescriptorSetInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::DescriptorSetInfo() @@ -88,12 +92,176 @@ std::unique_ptr Anvil::DescriptorSetInfo::create() } /** Please see header for specification */ -bool Anvil::DescriptorSetInfo::get_binding_properties(uint32_t in_n_binding, - uint32_t* out_opt_binding_index_ptr, - VkDescriptorType* out_opt_descriptor_type_ptr, - uint32_t* out_opt_descriptor_array_size_ptr, - VkShaderStageFlags* out_opt_stage_flags_ptr, - bool* out_opt_immutable_samplers_enabled_ptr) const +std::unique_ptr Anvil::DescriptorSetInfo::create_descriptor_set_layout_create_info(const Anvil::BaseDevice* in_device_ptr) const +{ + uint32_t n_binding = 0; + uint32_t n_bindings_defined = 0; + uint32_t n_samplers_defined = 0; + std::unique_ptr result_ptr; + Anvil::StructChainer struct_chainer; + + ANVIL_REDUNDANT_ARGUMENT_CONST(in_device_ptr); + + result_ptr.reset( + new Anvil::DescriptorSetLayoutCreateInfoContainer() + ); + + if (result_ptr == nullptr) + { + anvil_assert(result_ptr != nullptr); + + goto end; + } + + /* Count the number of immutable samplers defined. This is needed because if sampler_items is reallocated + * after we start building the VkSampler array contents, all previously initialized VkDescriptorSetLayoutBinding + * instances will start referring to invalid sampler arrays. + */ + for (auto binding_iterator = m_bindings.begin(); + binding_iterator != m_bindings.end(); + ++binding_iterator) + { + const auto& binding_data = binding_iterator->second; + + n_samplers_defined += static_cast(binding_data.immutable_samplers.size() ); + } + + result_ptr->sampler_items.reserve(n_samplers_defined); + + /* Determine the number of non-dummy bindings. */ + if (m_bindings.size() > 1) + { + n_bindings_defined = static_cast(m_bindings.size() ); + } + else + for (auto binding : m_bindings) + { + if (binding.second.descriptor_array_size > 0) + { + ++n_bindings_defined; + } + } + + /* Convert internal representation to Vulkan structure(s) */ + result_ptr->binding_info_items.resize(n_bindings_defined); + + { + VkDescriptorSetLayoutCreateInfo create_info; + + create_info.bindingCount = n_bindings_defined; + create_info.flags = 0; + create_info.pNext = nullptr; + create_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO; + + if (n_bindings_defined > 0) + { + for (auto binding_iterator = m_bindings.begin(); + binding_iterator != m_bindings.end(); + ++binding_iterator, ++n_binding) + { + const auto& binding_data = binding_iterator->second; + const BindingIndex& binding_index = binding_iterator->first; + VkDescriptorSetLayoutBinding& binding_vk = result_ptr->binding_info_items.at(n_binding); + + if (binding_data.descriptor_array_size == 0) + { + /* Dummy binding, ignore. */ + continue; + } + + binding_vk.binding = binding_index; + binding_vk.descriptorCount = binding_data.descriptor_array_size; + binding_vk.descriptorType = binding_data.descriptor_type; + binding_vk.stageFlags = binding_data.stage_flags; + + if (binding_data.immutable_samplers.size() > 0) + { + const uint32_t sampler_array_start_index = static_cast(result_ptr->sampler_items.size() ); + + anvil_assert(binding_data.immutable_samplers.size() == binding_data.descriptor_array_size); + + for (uint32_t n_sampler = 0; + n_sampler < binding_data.descriptor_array_size; + ++n_sampler) + { + result_ptr->sampler_items.push_back(binding_data.immutable_samplers[n_sampler]->get_sampler() ); + } + + binding_vk.pImmutableSamplers = &result_ptr->sampler_items[sampler_array_start_index]; + } + else + { + binding_vk.pImmutableSamplers = nullptr; + } + } + } + + if (result_ptr->binding_info_items.size() > 0) + { + create_info.pBindings = &result_ptr->binding_info_items.at(0); + } + else + { + create_info.pBindings = nullptr; + } + + struct_chainer.append_struct(create_info); + } + + result_ptr->struct_chain_ptr = struct_chainer.create_chain(); + +end: + return result_ptr; +} + +/** Please see header for specification */ +bool Anvil::DescriptorSetInfo::get_binding_properties_by_binding_index(uint32_t in_binding_index, + VkDescriptorType* out_opt_descriptor_type_ptr, + uint32_t* out_opt_descriptor_array_size_ptr, + VkShaderStageFlags* out_opt_stage_flags_ptr, + bool* out_opt_immutable_samplers_enabled_ptr) const +{ + auto binding_iterator = m_bindings.find(in_binding_index); + bool result = false; + + if (binding_iterator == m_bindings.end() ) + { + goto end; + } + + if (out_opt_descriptor_array_size_ptr != nullptr) + { + *out_opt_descriptor_array_size_ptr = binding_iterator->second.descriptor_array_size; + } + + if (out_opt_descriptor_type_ptr != nullptr) + { + *out_opt_descriptor_type_ptr = binding_iterator->second.descriptor_type; + } + + if (out_opt_immutable_samplers_enabled_ptr != nullptr) + { + *out_opt_immutable_samplers_enabled_ptr = (binding_iterator->second.immutable_samplers.size() != 0); + } + + if (out_opt_stage_flags_ptr != nullptr) + { + *out_opt_stage_flags_ptr = binding_iterator->second.stage_flags; + } + + result = true; + +end: + return result; +} + +/** Please see header for specification */ +bool Anvil::DescriptorSetInfo::get_binding_properties_by_index_number(uint32_t in_n_binding, + uint32_t* out_opt_binding_index_ptr, + VkDescriptorType* out_opt_descriptor_type_ptr, + uint32_t* out_opt_descriptor_array_size_ptr, + VkShaderStageFlags* out_opt_stage_flags_ptr, + bool* out_opt_immutable_samplers_enabled_ptr) const { auto binding_iterator = m_bindings.begin(); bool result = false; @@ -143,3 +311,9 @@ bool Anvil::DescriptorSetInfo::get_binding_properties(uint32_t in_n_b end: return result; } + +/** Please see header for specification */ +bool Anvil::DescriptorSetInfo::operator==(const Anvil::DescriptorSetInfo& in_ds) const +{ + return (m_bindings == in_ds.m_bindings); +} \ No newline at end of file diff --git a/src/misc/dummy_window.cpp b/src/misc/dummy_window.cpp index f15ac42a..c2a96b3e 100644 --- a/src/misc/dummy_window.cpp +++ b/src/misc/dummy_window.cpp @@ -32,12 +32,13 @@ #include "miniz/miniz.c" /** Please see header for specification */ -std::shared_ptr Anvil::DummyWindow::create(const std::string& in_title, - unsigned int in_width, - unsigned int in_height, - PresentCallbackFunction in_present_callback_func) +Anvil::WindowUniquePtr Anvil::DummyWindow::create(const std::string& in_title, + unsigned int in_width, + unsigned int in_height, + PresentCallbackFunction in_present_callback_func) { - std::shared_ptr result_ptr; + WindowUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::DummyWindow(in_title, @@ -48,7 +49,7 @@ std::shared_ptr Anvil::DummyWindow::create(const std::string& if (result_ptr) { - if (!result_ptr->init() ) + if (!dynamic_cast(result_ptr.get() )->init() ) { result_ptr.reset(); } @@ -62,11 +63,11 @@ Anvil::DummyWindow::DummyWindow(const std::string& in_title, unsigned int in_width, unsigned int in_height, PresentCallbackFunction in_present_callback_func) - : Window(in_title, - in_width, - in_height, - false, /* in_closable */ - in_present_callback_func) + :Window(in_title, + in_width, + in_height, + false, /* in_closable */ + in_present_callback_func) { m_window_owned = true; } @@ -114,12 +115,13 @@ void Anvil::DummyWindow::run() /** Please see header for specification */ -std::shared_ptr Anvil::DummyWindowWithPNGSnapshots::create(const std::string& in_title, - unsigned int in_width, - unsigned int in_height, - PresentCallbackFunction in_present_callback_func) +Anvil::WindowUniquePtr Anvil::DummyWindowWithPNGSnapshots::create(const std::string& in_title, + unsigned int in_width, + unsigned int in_height, + PresentCallbackFunction in_present_callback_func) { - std::shared_ptr result_ptr; + WindowUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::DummyWindowWithPNGSnapshots(in_title, @@ -130,7 +132,7 @@ std::shared_ptr Anvil::DummyWindowWithPNGSnapshots::create(const if (result_ptr) { - if (!result_ptr->init() ) + if (!dynamic_cast(result_ptr.get() )->init() ) { result_ptr.reset(); } @@ -151,31 +153,32 @@ Anvil::DummyWindowWithPNGSnapshots::DummyWindowWithPNGSnapshots(const std::strin { m_height = in_height; m_n_frames_presented = 0; + m_swapchain_ptr = nullptr; m_title = in_title; m_width = in_width; m_window_owned = true; } /** Please see header for specification */ -std::shared_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_image_raw_r8g8b8a8_unorm_data(std::shared_ptr in_swapchain_image_ptr) +std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_image_raw_r8g8b8a8_unorm_data(Anvil::Image* in_swapchain_image_ptr) { - std::shared_ptr device_locked_ptr (m_swapchain_ptr.lock()->get_device() ); - std::shared_ptr result_ptr; - VkFormat swapchain_image_format (in_swapchain_image_ptr->get_image_format () ); - const VkImageSubresourceRange swapchain_image_subresource_range(in_swapchain_image_ptr->get_subresource_range() ); + const Anvil::BaseDevice* device_ptr (m_swapchain_ptr->get_device() ); + std::unique_ptr result_ptr; + VkFormat swapchain_image_format (in_swapchain_image_ptr->get_image_format () ); + const VkImageSubresourceRange swapchain_image_subresource_range(in_swapchain_image_ptr->get_subresource_range() ); /* Sanity checks .. */ ANVIL_REDUNDANT_VARIABLE(swapchain_image_format); anvil_assert(swapchain_image_subresource_range.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT); - anvil_assert(device_locked_ptr->get_physical_device_format_properties(swapchain_image_format).optimal_tiling_capabilities & VK_FORMAT_FEATURE_BLIT_SRC_BIT); - anvil_assert(device_locked_ptr->get_physical_device_format_properties(VK_FORMAT_R8G8B8A8_UNORM).optimal_tiling_capabilities & VK_FORMAT_FEATURE_BLIT_DST_BIT); + anvil_assert(device_ptr->get_physical_device_format_properties(swapchain_image_format).optimal_tiling_capabilities & VK_FORMAT_FEATURE_BLIT_SRC_BIT); + anvil_assert(device_ptr->get_physical_device_format_properties(VK_FORMAT_R8G8B8A8_UNORM).optimal_tiling_capabilities & VK_FORMAT_FEATURE_BLIT_DST_BIT); /* Initialize storage for the raw R8G8B8A8 image data */ - std::shared_ptr raw_image_buffer_ptr; - uint32_t raw_image_size = 0; - uint32_t swapchain_image_height = 0; - uint32_t swapchain_image_width = 0; + Anvil::BufferUniquePtr raw_image_buffer_ptr; + uint32_t raw_image_size = 0; + uint32_t swapchain_image_height = 0; + uint32_t swapchain_image_width = 0; in_swapchain_image_ptr->get_image_mipmap_size(0, /* n_mipmap */ &swapchain_image_width, @@ -184,12 +187,9 @@ std::shared_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain raw_image_size = 4 /* RGBA8 */ * swapchain_image_width * swapchain_image_height; - result_ptr.reset( - new unsigned char[raw_image_size], - std::default_delete() - ); + result_ptr.reset(new unsigned char[raw_image_size]); - raw_image_buffer_ptr = Anvil::Buffer::create_nonsparse(device_locked_ptr, + raw_image_buffer_ptr = Anvil::Buffer::create_nonsparse(device_ptr, raw_image_size, Anvil::QUEUE_FAMILY_GRAPHICS_BIT, VK_SHARING_MODE_EXCLUSIVE, @@ -199,10 +199,10 @@ std::shared_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain MT_SAFETY_DISABLED); /* 2. Create the intermediate image */ - VkImageBlit intermediate_image_blit; - std::shared_ptr intermediate_image_ptr; + VkImageBlit intermediate_image_blit; + ImageUniquePtr intermediate_image_ptr; - intermediate_image_ptr = Anvil::Image::create_nonsparse(device_locked_ptr, + intermediate_image_ptr = Anvil::Image::create_nonsparse(device_ptr, VK_IMAGE_TYPE_2D, VK_FORMAT_R8G8B8A8_UNORM, VK_IMAGE_TILING_OPTIMAL, @@ -223,12 +223,12 @@ std::shared_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain MT_SAFETY_DISABLED); /* 3. Set up the command buffer */ - std::shared_ptr command_buffer_ptr; - std::shared_ptr universal_command_pool_ptr; - std::shared_ptr universal_queue_ptr = device_locked_ptr->get_universal_queue (0); - const uint32_t universal_queue_family_index = universal_queue_ptr->get_queue_family_index(); + auto command_buffer_ptr = Anvil::PrimaryCommandBufferUniquePtr(); + Anvil::CommandPool* universal_command_pool_ptr = nullptr; + Anvil::Queue* universal_queue_ptr = device_ptr->get_universal_queue (0); + const uint32_t universal_queue_family_index = universal_queue_ptr->get_queue_family_index(); - universal_command_pool_ptr = device_locked_ptr->get_command_pool(Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL); + universal_command_pool_ptr = device_ptr->get_command_pool_for_queue_family_index(universal_queue_ptr->get_queue_family_index() ); command_buffer_ptr = universal_command_pool_ptr->alloc_primary_level_command_buffer(); command_buffer_ptr->start_recording(true, /* one_time_submit */ @@ -256,7 +256,7 @@ std::shared_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, universal_queue_family_index, universal_queue_family_index, - intermediate_image_ptr, + intermediate_image_ptr.get(), swapchain_image_subresource_range); Anvil::ImageBarrier transfer_src_to_general_image_barrier( @@ -296,7 +296,7 @@ std::shared_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain command_buffer_ptr->record_blit_image(in_swapchain_image_ptr, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, - intermediate_image_ptr, + intermediate_image_ptr.get(), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, /* regionCount */ &intermediate_image_blit, @@ -326,9 +326,9 @@ std::shared_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain buffer_image_copy_region.imageSubresource.layerCount = 1; buffer_image_copy_region.imageSubresource.mipLevel = 0; - command_buffer_ptr->record_copy_image_to_buffer(intermediate_image_ptr, + command_buffer_ptr->record_copy_image_to_buffer(intermediate_image_ptr.get(), VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, - raw_image_buffer_ptr, + raw_image_buffer_ptr.get(), 1, /* regionCount */ &buffer_image_copy_region); @@ -345,7 +345,7 @@ std::shared_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain command_buffer_ptr->stop_recording(); /* Execute the command buffer */ - universal_queue_ptr->submit_command_buffer(command_buffer_ptr, + universal_queue_ptr->submit_command_buffer(command_buffer_ptr.get(), true); /* should_block */ /* Read back the result data */ @@ -374,9 +374,9 @@ void Anvil::DummyWindowWithPNGSnapshots::run() } /** Please see header for specification */ -void Anvil::DummyWindowWithPNGSnapshots::set_swapchain(std::weak_ptr in_swapchain_ptr) +void Anvil::DummyWindowWithPNGSnapshots::set_swapchain(Anvil::Swapchain* in_swapchain_ptr) { - anvil_assert(m_swapchain_ptr.lock() == nullptr); + anvil_assert(m_swapchain_ptr == nullptr); m_swapchain_ptr = in_swapchain_ptr; } @@ -384,15 +384,13 @@ void Anvil::DummyWindowWithPNGSnapshots::set_swapchain(std::weak_ptr swapchain_locked_ptr(m_swapchain_ptr); - - anvil_assert(swapchain_locked_ptr != nullptr); + anvil_assert(m_swapchain_ptr != nullptr); /* Retrieve image contents */ - const uint32_t swapchain_image_index = swapchain_locked_ptr->get_last_acquired_image_index(); - std::shared_ptr swapchain_image_ptr = swapchain_locked_ptr->get_image (swapchain_image_index); - std::shared_ptr swapchain_image_raw_data_ptr = get_swapchain_image_raw_r8g8b8a8_unorm_data (swapchain_image_ptr); - uint32_t swapchain_image_size[2]; + const uint32_t swapchain_image_index = m_swapchain_ptr->get_last_acquired_image_index(); + Anvil::Image* swapchain_image_ptr = m_swapchain_ptr->get_image (swapchain_image_index); + auto swapchain_image_raw_data_ptr = get_swapchain_image_raw_r8g8b8a8_unorm_data (swapchain_image_ptr); + uint32_t swapchain_image_size[2]; swapchain_image_ptr->get_image_mipmap_size(0, /* n_mipmap */ swapchain_image_size + 0, diff --git a/src/misc/formats.cpp b/src/misc/formats.cpp index 96efdb3d..1dd59ea1 100644 --- a/src/misc/formats.cpp +++ b/src/misc/formats.cpp @@ -495,33 +495,35 @@ bool Anvil::Formats::get_format_aspects(VkFormat in_form out_aspects_ptr->clear(); - /* This image can hold color and/or depth and/or stencil aspects only */ - const Anvil::ComponentLayout format_layout = Anvil::Formats::get_format_component_layout(in_format); - - if (format_layout == Anvil::COMPONENT_LAYOUT_ABGR || - format_layout == Anvil::COMPONENT_LAYOUT_ARGB || - format_layout == Anvil::COMPONENT_LAYOUT_BGR || - format_layout == Anvil::COMPONENT_LAYOUT_BGRA || - format_layout == Anvil::COMPONENT_LAYOUT_EBGR || - format_layout == Anvil::COMPONENT_LAYOUT_R || - format_layout == Anvil::COMPONENT_LAYOUT_RG || - format_layout == Anvil::COMPONENT_LAYOUT_RGB || - format_layout == Anvil::COMPONENT_LAYOUT_RGBA) { - out_aspects_ptr->push_back(VK_IMAGE_ASPECT_COLOR_BIT); - } + /* This image can hold color and/or depth and/or stencil aspects only */ + const Anvil::ComponentLayout format_layout = Anvil::Formats::get_format_component_layout(in_format); + + if (format_layout == Anvil::COMPONENT_LAYOUT_ABGR || + format_layout == Anvil::COMPONENT_LAYOUT_ARGB || + format_layout == Anvil::COMPONENT_LAYOUT_BGR || + format_layout == Anvil::COMPONENT_LAYOUT_BGRA || + format_layout == Anvil::COMPONENT_LAYOUT_EBGR || + format_layout == Anvil::COMPONENT_LAYOUT_R || + format_layout == Anvil::COMPONENT_LAYOUT_RG || + format_layout == Anvil::COMPONENT_LAYOUT_RGB || + format_layout == Anvil::COMPONENT_LAYOUT_RGBA) + { + out_aspects_ptr->push_back(VK_IMAGE_ASPECT_COLOR_BIT); + } - if (format_layout == Anvil::COMPONENT_LAYOUT_D || - format_layout == Anvil::COMPONENT_LAYOUT_DS || - format_layout == Anvil::COMPONENT_LAYOUT_XD) - { - out_aspects_ptr->push_back(VK_IMAGE_ASPECT_DEPTH_BIT); - } + if (format_layout == Anvil::COMPONENT_LAYOUT_D || + format_layout == Anvil::COMPONENT_LAYOUT_DS || + format_layout == Anvil::COMPONENT_LAYOUT_XD) + { + out_aspects_ptr->push_back(VK_IMAGE_ASPECT_DEPTH_BIT); + } - if (format_layout == Anvil::COMPONENT_LAYOUT_DS || - format_layout == Anvil::COMPONENT_LAYOUT_S) - { - out_aspects_ptr->push_back(VK_IMAGE_ASPECT_STENCIL_BIT); + if (format_layout == Anvil::COMPONENT_LAYOUT_DS || + format_layout == Anvil::COMPONENT_LAYOUT_S) + { + out_aspects_ptr->push_back(VK_IMAGE_ASPECT_STENCIL_BIT); + } } result = true; diff --git a/src/misc/glsl_to_spirv.cpp b/src/misc/glsl_to_spirv.cpp index 7980df36..ec6939d3 100644 --- a/src/misc/glsl_to_spirv.cpp +++ b/src/misc/glsl_to_spirv.cpp @@ -72,17 +72,17 @@ }; /* Constructor. */ - Anvil::GLSLangLimits::GLSLangLimits(std::weak_ptr in_device_ptr) + Anvil::GLSLangLimits::GLSLangLimits(const Anvil::BaseDevice* in_device_ptr) { - const VkPhysicalDeviceLimits& limits = in_device_ptr.lock()->get_physical_device_properties().limits; - VkSampleCountFlags max_sampled_image_sample_count; - int32_t max_sampled_image_samples = 0; - VkSampleCountFlags max_storage_image_sample_count = limits.storageImageSampleCounts; - int32_t max_storage_image_samples = 0; + const auto& limits = in_device_ptr->get_physical_device_properties().core_vk1_0_properties_ptr->limits; + VkSampleCountFlags max_sampled_image_sample_count; + int32_t max_sampled_image_samples = 0; + VkSampleCountFlags max_storage_image_sample_count = limits.storage_image_sample_counts; + int32_t max_storage_image_samples = 0; - max_sampled_image_sample_count = std::max(limits.sampledImageColorSampleCounts, limits.sampledImageDepthSampleCounts); - max_sampled_image_sample_count = std::max(max_sampled_image_sample_count, limits.sampledImageIntegerSampleCounts); - max_sampled_image_sample_count = std::max(max_sampled_image_sample_count, limits.sampledImageStencilSampleCounts); + max_sampled_image_sample_count = std::max(limits.sampled_image_color_sample_counts, limits.sampled_image_depth_sample_counts); + max_sampled_image_sample_count = std::max(max_sampled_image_sample_count, limits.sampled_image_integer_sample_counts); + max_sampled_image_sample_count = std::max(max_sampled_image_sample_count, limits.sampled_image_stencil_sample_counts); const struct SampleCountToSamplesData { @@ -135,7 +135,7 @@ m_resources_ptr->maxClipPlanes = 6; /* irrelevant to Vulkan */ m_resources_ptr->maxTextureUnits = 32; /* irrelevant to Vulkan */ m_resources_ptr->maxTextureCoords = 32; /* irrelevant to Vulkan */ - m_resources_ptr->maxVertexAttribs = static_cast(CLAMP_TO_INT_MAX(limits.maxVertexInputAttributes) ); + m_resources_ptr->maxVertexAttribs = static_cast(CLAMP_TO_INT_MAX(limits.max_vertex_input_attributes) ); m_resources_ptr->maxVertexUniformComponents = 4096; /* irrelevant to Vulkan */ m_resources_ptr->maxVaryingFloats = 64; /* irrelevant to Vulkan? */ m_resources_ptr->maxVertexTextureImageUnits = 32; /* irrelevant to Vulkan? */ @@ -146,55 +146,55 @@ m_resources_ptr->maxVertexUniformVectors = 128; /* irrelevant to Vulkan? */ m_resources_ptr->maxVaryingVectors = 8; /* irrelevant to Vulkan? */ m_resources_ptr->maxFragmentUniformVectors = 16; /* irrelevant to Vulkan? */ - m_resources_ptr->maxVertexOutputVectors = static_cast(CLAMP_TO_INT_MAX(limits.maxVertexOutputComponents / 4) ); - m_resources_ptr->maxFragmentInputVectors = static_cast(CLAMP_TO_INT_MAX(limits.maxFragmentInputComponents / 4) ); - m_resources_ptr->minProgramTexelOffset = static_cast(CLAMP_TO_INT_MAX(limits.minTexelOffset) ); - m_resources_ptr->maxProgramTexelOffset = static_cast(CLAMP_TO_INT_MAX(limits.maxTexelOffset) ); - m_resources_ptr->maxClipDistances = static_cast(CLAMP_TO_INT_MAX(limits.maxClipDistances) ); - m_resources_ptr->maxComputeWorkGroupCountX = static_cast(CLAMP_TO_INT_MAX(limits.maxComputeWorkGroupCount[0]) ); - m_resources_ptr->maxComputeWorkGroupCountY = static_cast(CLAMP_TO_INT_MAX(limits.maxComputeWorkGroupCount[1]) ); - m_resources_ptr->maxComputeWorkGroupCountZ = static_cast(CLAMP_TO_INT_MAX(limits.maxComputeWorkGroupCount[2]) ); - m_resources_ptr->maxComputeWorkGroupSizeX = static_cast(CLAMP_TO_INT_MAX(limits.maxComputeWorkGroupSize[0]) ); - m_resources_ptr->maxComputeWorkGroupSizeY = static_cast(CLAMP_TO_INT_MAX(limits.maxComputeWorkGroupSize[1]) ); - m_resources_ptr->maxComputeWorkGroupSizeZ = static_cast(CLAMP_TO_INT_MAX(limits.maxComputeWorkGroupSize[2]) ); + m_resources_ptr->maxVertexOutputVectors = static_cast(CLAMP_TO_INT_MAX(limits.max_vertex_output_components / 4) ); + m_resources_ptr->maxFragmentInputVectors = static_cast(CLAMP_TO_INT_MAX(limits.max_fragment_input_components / 4) ); + m_resources_ptr->minProgramTexelOffset = static_cast(CLAMP_TO_INT_MAX(limits.min_texel_offset) ); + m_resources_ptr->maxProgramTexelOffset = static_cast(CLAMP_TO_INT_MAX(limits.max_texel_offset) ); + m_resources_ptr->maxClipDistances = static_cast(CLAMP_TO_INT_MAX(limits.max_clip_distances) ); + m_resources_ptr->maxComputeWorkGroupCountX = static_cast(CLAMP_TO_INT_MAX(limits.max_compute_work_group_count[0]) ); + m_resources_ptr->maxComputeWorkGroupCountY = static_cast(CLAMP_TO_INT_MAX(limits.max_compute_work_group_count[1]) ); + m_resources_ptr->maxComputeWorkGroupCountZ = static_cast(CLAMP_TO_INT_MAX(limits.max_compute_work_group_count[2]) ); + m_resources_ptr->maxComputeWorkGroupSizeX = static_cast(CLAMP_TO_INT_MAX(limits.max_compute_work_group_size[0]) ); + m_resources_ptr->maxComputeWorkGroupSizeY = static_cast(CLAMP_TO_INT_MAX(limits.max_compute_work_group_size[1]) ); + m_resources_ptr->maxComputeWorkGroupSizeZ = static_cast(CLAMP_TO_INT_MAX(limits.max_compute_work_group_size[2]) ); m_resources_ptr->maxComputeUniformComponents = 1024; /* irrelevant to Vulkan? */ m_resources_ptr->maxComputeTextureImageUnits = 16; /* irrelevant to Vulkan? */ - m_resources_ptr->maxComputeImageUniforms = static_cast(CLAMP_TO_INT_MAX(limits.maxPerStageDescriptorStorageImages) ); + m_resources_ptr->maxComputeImageUniforms = static_cast(CLAMP_TO_INT_MAX(limits.max_per_stage_descriptor_storage_images) ); m_resources_ptr->maxComputeAtomicCounters = 8; /* irrelevant to Vulkan */ m_resources_ptr->maxComputeAtomicCounterBuffers = 1; /* irrelevant to Vulkan */ m_resources_ptr->maxVaryingComponents = 60; /* irrelevant to Vulkan */ - m_resources_ptr->maxVertexOutputComponents = static_cast(CLAMP_TO_INT_MAX(limits.maxVertexOutputComponents) ); - m_resources_ptr->maxGeometryInputComponents = static_cast(CLAMP_TO_INT_MAX(limits.maxGeometryInputComponents) ); - m_resources_ptr->maxGeometryOutputComponents = static_cast(CLAMP_TO_INT_MAX(limits.maxGeometryOutputComponents) ); - m_resources_ptr->maxFragmentInputComponents = static_cast(CLAMP_TO_INT_MAX(limits.maxFragmentInputComponents) ); + m_resources_ptr->maxVertexOutputComponents = static_cast(CLAMP_TO_INT_MAX(limits.max_vertex_output_components) ); + m_resources_ptr->maxGeometryInputComponents = static_cast(CLAMP_TO_INT_MAX(limits.max_geometry_input_components) ); + m_resources_ptr->maxGeometryOutputComponents = static_cast(CLAMP_TO_INT_MAX(limits.max_geometry_output_components) ); + m_resources_ptr->maxFragmentInputComponents = static_cast(CLAMP_TO_INT_MAX(limits.max_fragment_input_components) ); m_resources_ptr->maxImageUnits = 8; /* irrelevant to Vulkan */ m_resources_ptr->maxCombinedImageUnitsAndFragmentOutputs = 8; /* irrelevant to Vulkan? */ - m_resources_ptr->maxCombinedShaderOutputResources = static_cast(CLAMP_TO_INT_MAX(limits.maxFragmentCombinedOutputResources) ); + m_resources_ptr->maxCombinedShaderOutputResources = static_cast(CLAMP_TO_INT_MAX(limits.max_fragment_combined_output_resources) ); m_resources_ptr->maxImageSamples = max_storage_image_samples; - m_resources_ptr->maxVertexImageUniforms = static_cast(CLAMP_TO_INT_MAX(limits.maxPerStageDescriptorStorageImages) ); - m_resources_ptr->maxTessControlImageUniforms = static_cast(CLAMP_TO_INT_MAX(limits.maxPerStageDescriptorStorageImages) ); - m_resources_ptr->maxTessEvaluationImageUniforms = static_cast(CLAMP_TO_INT_MAX(limits.maxPerStageDescriptorStorageImages) ); - m_resources_ptr->maxGeometryImageUniforms = static_cast(CLAMP_TO_INT_MAX(limits.maxPerStageDescriptorStorageImages) ); - m_resources_ptr->maxFragmentImageUniforms = static_cast(CLAMP_TO_INT_MAX(limits.maxPerStageDescriptorStorageImages) ); - m_resources_ptr->maxCombinedImageUniforms = static_cast(CLAMP_TO_INT_MAX(5 /* vs, tc, te, gs, fs */ * limits.maxPerStageDescriptorStorageImages) ); + m_resources_ptr->maxVertexImageUniforms = static_cast(CLAMP_TO_INT_MAX(limits.max_per_stage_descriptor_storage_images) ); + m_resources_ptr->maxTessControlImageUniforms = static_cast(CLAMP_TO_INT_MAX(limits.max_per_stage_descriptor_storage_images) ); + m_resources_ptr->maxTessEvaluationImageUniforms = static_cast(CLAMP_TO_INT_MAX(limits.max_per_stage_descriptor_storage_images) ); + m_resources_ptr->maxGeometryImageUniforms = static_cast(CLAMP_TO_INT_MAX(limits.max_per_stage_descriptor_storage_images) ); + m_resources_ptr->maxFragmentImageUniforms = static_cast(CLAMP_TO_INT_MAX(limits.max_per_stage_descriptor_storage_images) ); + m_resources_ptr->maxCombinedImageUniforms = static_cast(CLAMP_TO_INT_MAX(5 /* vs, tc, te, gs, fs */ * limits.max_per_stage_descriptor_storage_images) ); m_resources_ptr->maxGeometryTextureImageUnits = 16; /* irrelevant to Vulkan? */ - m_resources_ptr->maxGeometryOutputVertices = static_cast(CLAMP_TO_INT_MAX(limits.maxGeometryOutputVertices) ); - m_resources_ptr->maxGeometryTotalOutputComponents = static_cast(CLAMP_TO_INT_MAX(limits.maxGeometryTotalOutputComponents) ); + m_resources_ptr->maxGeometryOutputVertices = static_cast(CLAMP_TO_INT_MAX(limits.max_geometry_output_vertices) ); + m_resources_ptr->maxGeometryTotalOutputComponents = static_cast(CLAMP_TO_INT_MAX(limits.max_geometry_total_output_components) ); m_resources_ptr->maxGeometryUniformComponents = 1024; /* irrelevant to Vulkan? */ - m_resources_ptr->maxGeometryVaryingComponents = static_cast(CLAMP_TO_INT_MAX(limits.maxGeometryInputComponents) ); - m_resources_ptr->maxTessControlInputComponents = static_cast(CLAMP_TO_INT_MAX(limits.maxTessellationControlPerVertexInputComponents) ); - m_resources_ptr->maxTessControlOutputComponents = static_cast(CLAMP_TO_INT_MAX(limits.maxTessellationControlPerVertexOutputComponents) ); + m_resources_ptr->maxGeometryVaryingComponents = static_cast(CLAMP_TO_INT_MAX(limits.max_geometry_input_components) ); + m_resources_ptr->maxTessControlInputComponents = static_cast(CLAMP_TO_INT_MAX(limits.max_tessellation_control_per_vertex_input_components) ); + m_resources_ptr->maxTessControlOutputComponents = static_cast(CLAMP_TO_INT_MAX(limits.max_tessellation_control_per_vertex_output_components) ); m_resources_ptr->maxTessControlTextureImageUnits = 16; /* irrelevant to Vulkan? */ m_resources_ptr->maxTessControlUniformComponents = 1024; /* irrelevant to Vulkan? */ - m_resources_ptr->maxTessControlTotalOutputComponents = static_cast(CLAMP_TO_INT_MAX(limits.maxTessellationControlTotalOutputComponents) ); - m_resources_ptr->maxTessEvaluationInputComponents = static_cast(CLAMP_TO_INT_MAX(limits.maxTessellationEvaluationInputComponents) ); - m_resources_ptr->maxTessEvaluationOutputComponents = static_cast(CLAMP_TO_INT_MAX(limits.maxTessellationEvaluationOutputComponents) ); + m_resources_ptr->maxTessControlTotalOutputComponents = static_cast(CLAMP_TO_INT_MAX(limits.max_tessellation_control_total_output_components) ); + m_resources_ptr->maxTessEvaluationInputComponents = static_cast(CLAMP_TO_INT_MAX(limits.max_tessellation_evaluation_input_components) ); + m_resources_ptr->maxTessEvaluationOutputComponents = static_cast(CLAMP_TO_INT_MAX(limits.max_tessellation_evaluation_output_components) ); m_resources_ptr->maxTessEvaluationTextureImageUnits = 16; /* irrelevant to Vulkan? */ m_resources_ptr->maxTessEvaluationUniformComponents = 1024; /* irrelevant to Vulkan? */ - m_resources_ptr->maxTessPatchComponents = static_cast(CLAMP_TO_INT_MAX(limits.maxTessellationControlPerPatchOutputComponents) ); - m_resources_ptr->maxPatchVertices = static_cast(CLAMP_TO_INT_MAX(limits.maxTessellationPatchSize) ); - m_resources_ptr->maxTessGenLevel = static_cast(CLAMP_TO_INT_MAX(limits.maxTessellationGenerationLevel) ); - m_resources_ptr->maxViewports = static_cast(CLAMP_TO_INT_MAX(limits.maxViewports) ); + m_resources_ptr->maxTessPatchComponents = static_cast(CLAMP_TO_INT_MAX(limits.max_tessellation_control_per_patch_output_components) ); + m_resources_ptr->maxPatchVertices = static_cast(CLAMP_TO_INT_MAX(limits.max_tessellation_patch_size) ); + m_resources_ptr->maxTessGenLevel = static_cast(CLAMP_TO_INT_MAX(limits.max_tessellation_generation_level) ); + m_resources_ptr->maxViewports = static_cast(CLAMP_TO_INT_MAX(limits.max_viewports) ); m_resources_ptr->maxVertexAtomicCounters = 0; /* not supported in Vulkan */ m_resources_ptr->maxTessControlAtomicCounters = 0; /* not supported in Vulkan */ m_resources_ptr->maxTessEvaluationAtomicCounters = 0; /* not supported in Vulkan */ @@ -211,8 +211,8 @@ m_resources_ptr->maxAtomicCounterBufferSize = 0; /* not supported in Vulkan */ m_resources_ptr->maxTransformFeedbackBuffers = 0; /* not supported in Vulkan */ m_resources_ptr->maxTransformFeedbackInterleavedComponents = 0; /* not supported in Vulkan */ - m_resources_ptr->maxCullDistances = static_cast(CLAMP_TO_INT_MAX(limits.maxCullDistances) ); - m_resources_ptr->maxCombinedClipAndCullDistances = static_cast(CLAMP_TO_INT_MAX(limits.maxCombinedClipAndCullDistances) ); + m_resources_ptr->maxCullDistances = static_cast(CLAMP_TO_INT_MAX(limits.max_cull_distances) ); + m_resources_ptr->maxCombinedClipAndCullDistances = static_cast(CLAMP_TO_INT_MAX(limits.max_combined_clip_and_cull_distances) ); m_resources_ptr->maxSamples = (max_sampled_image_samples > max_storage_image_samples) ? CLAMP_TO_INT_MAX(max_sampled_image_samples) : CLAMP_TO_INT_MAX(max_storage_image_samples); m_resources_ptr->limits.nonInductiveForLoops = 1; @@ -231,10 +231,10 @@ /* Please see header for specification */ -Anvil::GLSLShaderToSPIRVGenerator::GLSLShaderToSPIRVGenerator(std::weak_ptr in_device_ptr, - const Mode& in_mode, - std::string in_data, - ShaderStage in_shader_stage) +Anvil::GLSLShaderToSPIRVGenerator::GLSLShaderToSPIRVGenerator(const Anvil::BaseDevice* in_device_ptr, + const Mode& in_mode, + std::string in_data, + ShaderStage in_shader_stage) :CallbacksSupportProvider(GLSL_SHADER_TO_SPIRV_GENERATOR_CALLBACK_ID_COUNT), m_data (in_data), m_glsl_source_code_dirty(true), @@ -243,7 +243,7 @@ Anvil::GLSLShaderToSPIRVGenerator::GLSLShaderToSPIRVGenerator(std::weak_ptr(m_definition_values.size() ); @@ -452,7 +452,7 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_glsl_source_code() } /* Please see header for specification */ -bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() +bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() const { bool glsl_filename_is_temporary = false; std::string glsl_filename_with_path; @@ -572,7 +572,7 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() * * @return true if successful, false otherwise. **/ - bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob_by_calling_glslang(const char* in_body) + bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob_by_calling_glslang(const char* in_body) const { const EShLanguage glslang_shader_stage = get_glslang_shader_stage(); glslang::TIntermediate* intermediate_ptr = nullptr; @@ -857,12 +857,13 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() #endif /* Please see header for specification */ -std::shared_ptr Anvil::GLSLShaderToSPIRVGenerator::create(std::weak_ptr in_opt_device_ptr, - const Mode& in_mode, - std::string in_data, - ShaderStage in_shader_stage) +Anvil::GLSLShaderToSPIRVGeneratorUniquePtr Anvil::GLSLShaderToSPIRVGenerator::create(const Anvil::BaseDevice* in_opt_device_ptr, + const Mode& in_mode, + std::string in_data, + ShaderStage in_shader_stage) { - std::shared_ptr result_ptr; + Anvil::GLSLShaderToSPIRVGeneratorUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::GLSLShaderToSPIRVGenerator(in_opt_device_ptr, diff --git a/src/misc/graphics_pipeline_info.cpp b/src/misc/graphics_pipeline_info.cpp index a1f29bd9..4d123ee3 100644 --- a/src/misc/graphics_pipeline_info.cpp +++ b/src/misc/graphics_pipeline_info.cpp @@ -21,34 +21,34 @@ // #include "misc/graphics_pipeline_info.h" -Anvil::GraphicsPipelineInfo::GraphicsPipelineInfo(std::shared_ptr in_renderpass_ptr, - SubPassID in_subpass_id) +Anvil::GraphicsPipelineInfo::GraphicsPipelineInfo(const RenderPass* in_renderpass_ptr, + SubPassID in_subpass_id) { - m_alpha_to_coverage_enabled = false; - m_alpha_to_one_enabled = false; - m_depth_bias_clamp = 0.0f; - m_depth_bias_constant_factor = 0.0f; - m_depth_bias_enabled = false; - m_depth_bias_slope_factor = 1.0f; - m_depth_bounds_test_enabled = false; - m_depth_clamp_enabled = false; - m_depth_test_compare_op = VK_COMPARE_OP_ALWAYS; - m_depth_test_enabled = false; - m_depth_writes_enabled = false; - m_enabled_dynamic_states = 0; - m_front_face = VK_FRONT_FACE_COUNTER_CLOCKWISE; - m_logic_op = VK_LOGIC_OP_NO_OP; - m_logic_op_enabled = false; - m_max_depth_bounds = 1.0f; - m_min_depth_bounds = 0.0f; - m_n_dynamic_scissor_boxes = 0; - m_n_dynamic_viewports = 0; - m_n_patch_control_points = 1; - m_primitive_restart_enabled = false; - m_rasterizer_discard_enabled = false; - m_sample_mask_enabled = false; - m_sample_shading_enabled = false; - m_stencil_test_enabled = false; + m_alpha_to_coverage_enabled = false; + m_alpha_to_one_enabled = false; + m_depth_bias_clamp = 0.0f; + m_depth_bias_constant_factor = 0.0f; + m_depth_bias_enabled = false; + m_depth_bias_slope_factor = 1.0f; + m_depth_bounds_test_enabled = false; + m_depth_clamp_enabled = false; + m_depth_test_compare_op = VK_COMPARE_OP_ALWAYS; + m_depth_test_enabled = false; + m_depth_writes_enabled = false; + m_enabled_dynamic_states = 0; + m_front_face = VK_FRONT_FACE_COUNTER_CLOCKWISE; + m_logic_op = VK_LOGIC_OP_NO_OP; + m_logic_op_enabled = false; + m_max_depth_bounds = 1.0f; + m_min_depth_bounds = 0.0f; + m_n_dynamic_scissor_boxes = 0; + m_n_dynamic_viewports = 0; + m_n_patch_control_points = 1; + m_primitive_restart_enabled = false; + m_rasterizer_discard_enabled = false; + m_sample_mask_enabled = false; + m_sample_shading_enabled = false; + m_stencil_test_enabled = false; m_renderpass_ptr = in_renderpass_ptr; m_subpass_id = in_subpass_id; @@ -169,15 +169,15 @@ bool Anvil::GraphicsPipelineInfo::copy_gfx_state_from(const Anvil::GraphicsPipel m_enabled_dynamic_states = in_src_pipeline_info_ptr->m_enabled_dynamic_states; - m_alpha_to_coverage_enabled = in_src_pipeline_info_ptr->m_alpha_to_coverage_enabled; - m_alpha_to_one_enabled = in_src_pipeline_info_ptr->m_alpha_to_one_enabled; - m_depth_clamp_enabled = in_src_pipeline_info_ptr->m_depth_clamp_enabled; - m_depth_writes_enabled = in_src_pipeline_info_ptr->m_depth_writes_enabled; - m_logic_op_enabled = in_src_pipeline_info_ptr->m_logic_op_enabled; - m_primitive_restart_enabled = in_src_pipeline_info_ptr->m_primitive_restart_enabled; - m_rasterizer_discard_enabled = in_src_pipeline_info_ptr->m_rasterizer_discard_enabled; - m_sample_mask_enabled = in_src_pipeline_info_ptr->m_sample_mask_enabled; - m_sample_shading_enabled = in_src_pipeline_info_ptr->m_sample_shading_enabled; + m_alpha_to_coverage_enabled = in_src_pipeline_info_ptr->m_alpha_to_coverage_enabled; + m_alpha_to_one_enabled = in_src_pipeline_info_ptr->m_alpha_to_one_enabled; + m_depth_clamp_enabled = in_src_pipeline_info_ptr->m_depth_clamp_enabled; + m_depth_writes_enabled = in_src_pipeline_info_ptr->m_depth_writes_enabled; + m_logic_op_enabled = in_src_pipeline_info_ptr->m_logic_op_enabled; + m_primitive_restart_enabled = in_src_pipeline_info_ptr->m_primitive_restart_enabled; + m_rasterizer_discard_enabled = in_src_pipeline_info_ptr->m_rasterizer_discard_enabled; + m_sample_mask_enabled = in_src_pipeline_info_ptr->m_sample_mask_enabled; + m_sample_shading_enabled = in_src_pipeline_info_ptr->m_sample_shading_enabled; m_stencil_test_enabled = in_src_pipeline_info_ptr->m_stencil_test_enabled; m_stencil_state_back_face = in_src_pipeline_info_ptr->m_stencil_state_back_face; @@ -214,18 +214,19 @@ bool Anvil::GraphicsPipelineInfo::copy_gfx_state_from(const Anvil::GraphicsPipel return result; } -std::unique_ptr Anvil::GraphicsPipelineInfo::create_derivative_pipeline_info(bool in_disable_optimizations, - bool in_allow_derivatives, - std::shared_ptr in_renderpass_ptr, - SubPassID in_subpass_id, - const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, - Anvil::PipelineID in_base_pipeline_id) +Anvil::GraphicsPipelineInfoUniquePtr Anvil::GraphicsPipelineInfo::create_derivative_pipeline_info(bool in_disable_optimizations, + bool in_allow_derivatives, + const RenderPass* in_renderpass_ptr, + SubPassID in_subpass_id, + const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, + Anvil::PipelineID in_base_pipeline_id) { - std::unique_ptr result_ptr; + Anvil::GraphicsPipelineInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new GraphicsPipelineInfo(in_renderpass_ptr, @@ -253,12 +254,13 @@ std::unique_ptr Anvil::GraphicsPipelineInfo::create return result_ptr; } -std::unique_ptr Anvil::GraphicsPipelineInfo::create_proxy_pipeline_info() +Anvil::GraphicsPipelineInfoUniquePtr Anvil::GraphicsPipelineInfo::create_proxy_pipeline_info() { - std::unique_ptr result_ptr; + Anvil::GraphicsPipelineInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( - new GraphicsPipelineInfo(std::shared_ptr(), + new GraphicsPipelineInfo(nullptr, /* in_renderpass_ptr */ UINT32_MAX) ); @@ -270,18 +272,19 @@ std::unique_ptr Anvil::GraphicsPipelineInfo::create return result_ptr; } -std::unique_ptr Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(bool in_disable_optimizations, - bool in_allow_derivatives, - std::shared_ptr in_renderpass_ptr, - SubPassID in_subpass_id, - const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, - const Anvil::GraphicsPipelineInfo* in_opt_reference_pipeline_info_ptr) +Anvil::GraphicsPipelineInfoUniquePtr Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(bool in_disable_optimizations, + bool in_allow_derivatives, + const RenderPass* in_renderpass_ptr, + SubPassID in_subpass_id, + const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, + const Anvil::GraphicsPipelineInfo* in_opt_reference_pipeline_info_ptr) { - std::unique_ptr result_ptr; + Anvil::GraphicsPipelineInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new GraphicsPipelineInfo(in_renderpass_ptr, @@ -463,11 +466,11 @@ Anvil::DynamicStateBitfield Anvil::GraphicsPipelineInfo::get_enabled_dynamic_sta return m_enabled_dynamic_states; } -void Anvil::GraphicsPipelineInfo::get_graphics_pipeline_properties(uint32_t* out_opt_n_scissors_ptr, - uint32_t* out_opt_n_viewports_ptr, - uint32_t* out_opt_n_vertex_attributes_ptr, - std::shared_ptr* out_opt_renderpass_ptr, - SubPassID* out_opt_subpass_id_ptr) const +void Anvil::GraphicsPipelineInfo::get_graphics_pipeline_properties(uint32_t* out_opt_n_scissors_ptr, + uint32_t* out_opt_n_viewports_ptr, + uint32_t* out_opt_n_vertex_attributes_ptr, + const RenderPass** out_opt_renderpass_ptr_ptr, + SubPassID* out_opt_subpass_id_ptr) const { if (out_opt_n_scissors_ptr != nullptr) { @@ -484,9 +487,9 @@ void Anvil::GraphicsPipelineInfo::get_graphics_pipeline_properties(uint32_t* *out_opt_n_vertex_attributes_ptr = static_cast(m_attributes.size() ); } - if (out_opt_renderpass_ptr != nullptr) + if (out_opt_renderpass_ptr_ptr != nullptr) { - *out_opt_renderpass_ptr = m_renderpass_ptr; + *out_opt_renderpass_ptr_ptr = m_renderpass_ptr; } if (out_opt_subpass_id_ptr != nullptr) diff --git a/src/misc/memalloc_backends/backend_oneshot.cpp b/src/misc/memalloc_backends/backend_oneshot.cpp index 1979074e..a52e81e9 100644 --- a/src/misc/memalloc_backends/backend_oneshot.cpp +++ b/src/misc/memalloc_backends/backend_oneshot.cpp @@ -31,7 +31,7 @@ #include /** Please see header for specification */ -Anvil::MemoryAllocatorBackends::OneShot::OneShot(std::weak_ptr in_device_ptr) +Anvil::MemoryAllocatorBackends::OneShot::OneShot(const Anvil::BaseDevice* in_device_ptr) :m_device_ptr(in_device_ptr), m_is_baked (false) { @@ -59,11 +59,10 @@ Anvil::MemoryAllocatorBackends::OneShot::~OneShot() **/ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items& in_items) { - std::shared_ptr device_locked_ptr (m_device_ptr); - const auto& memory_props (device_locked_ptr->get_physical_device_memory_properties() ); - const uint32_t n_memory_types (static_cast(memory_props.types.size() )); - std::vector > > per_mem_type_items_vector (n_memory_types); - bool result (true); + const auto& memory_props (m_device_ptr->get_physical_device_memory_properties() ); + const uint32_t n_memory_types (static_cast(memory_props.types.size() )); + std::vector > per_mem_type_items_vector (n_memory_types); + bool result (true); /* Iterate over all block items and determine what memory types we can use. * @@ -93,15 +92,15 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items continue; } - per_mem_type_items_vector.at(n_memory_type).push_back((*item_iterator) ); + per_mem_type_items_vector.at(n_memory_type).push_back((item_iterator->get() ) ); break; } } /* For each memory type, for each there's at least one item, bake a memory block */ { - std::map, VkDeviceSize> alloc_offset_map; - uint32_t current_memory_type_index(0); + std::map alloc_offset_map; + uint32_t current_memory_type_index(0); for (auto mem_type_to_item_vector_iterator = per_mem_type_items_vector.begin(); mem_type_to_item_vector_iterator != per_mem_type_items_vector.end(); @@ -111,8 +110,9 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items if (current_item_vector.size() > 0) { - std::shared_ptr new_memory_block_ptr; - VkDeviceSize n_bytes_required = 0; + Anvil::MemoryBlockUniquePtr new_memory_block_ptr(nullptr, + std::default_delete() ); + VkDeviceSize n_bytes_required (0); /* Go through the items, calculate offsets and the total amount of memory we're going * to need to alloc off the heap */ @@ -130,7 +130,7 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items 1u << current_memory_type_index, n_bytes_required, (memory_props.types[current_memory_type_index].features), - Anvil::Utils::convert_boolean_to_mt_safety_enum(device_locked_ptr->is_mt_safe()) ); + Anvil::Utils::convert_boolean_to_mt_safety_enum(m_device_ptr->is_mt_safe()) ); if (new_memory_block_ptr == nullptr) { @@ -143,7 +143,7 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items /* Go through the items again and assign the result memory block */ for (auto& current_item_ptr : current_item_vector) { - current_item_ptr->alloc_memory_block_ptr = Anvil::MemoryBlock::create_derived(new_memory_block_ptr, + current_item_ptr->alloc_memory_block_ptr = Anvil::MemoryBlock::create_derived(new_memory_block_ptr.get(), alloc_offset_map.at(current_item_ptr), current_item_ptr->alloc_size); @@ -151,7 +151,13 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items { current_item_ptr->is_baked = true; } + + dynamic_cast(current_item_ptr->alloc_memory_block_ptr.get() )->set_parent_memory_allocator_backend_ptr(shared_from_this() ); } + + m_memory_blocks.push_back( + std::move(new_memory_block_ptr) + ); } } } diff --git a/src/misc/memalloc_backends/backend_vma.cpp b/src/misc/memalloc_backends/backend_vma.cpp index 00405d6a..8c665d65 100644 --- a/src/misc/memalloc_backends/backend_vma.cpp +++ b/src/misc/memalloc_backends/backend_vma.cpp @@ -51,7 +51,7 @@ /* Please see header for specification */ -Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::VMAAllocator(std::weak_ptr in_device_ptr) +Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::VMAAllocator(const Anvil::BaseDevice* in_device_ptr) :m_allocator (nullptr), m_device_ptr(in_device_ptr) { @@ -70,7 +70,7 @@ Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::~VMAAllocator() } /* Please see header for specifications */ -std::shared_ptr Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::create(std::weak_ptr in_device_ptr) +std::shared_ptr Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::create(const Anvil::BaseDevice* in_device_ptr) { std::shared_ptr result_ptr; @@ -95,17 +95,16 @@ std::shared_ptr Anvil::Memory **/ bool Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::init() { - VmaAllocatorCreateInfo create_info; - std::shared_ptr device_locked_ptr(m_device_ptr); - VkResult result (VK_ERROR_DEVICE_LOST); + VmaAllocatorCreateInfo create_info; + VkResult result (VK_ERROR_DEVICE_LOST); - switch (device_locked_ptr->get_type() ) + switch (m_device_ptr->get_type() ) { case Anvil::DEVICE_TYPE_SINGLE_GPU: { - std::shared_ptr sgpu_device_locked_ptr(std::dynamic_pointer_cast(device_locked_ptr) ); + const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr) ); - create_info.physicalDevice = sgpu_device_locked_ptr->get_physical_device().lock()->get_physical_device(); + create_info.physicalDevice = sgpu_device_ptr->get_physical_device()->get_physical_device(); break; } @@ -115,7 +114,7 @@ bool Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::init() } } - create_info.device = device_locked_ptr->get_device_vk(); + create_info.device = m_device_ptr->get_device_vk(); create_info.pAllocationCallbacks = nullptr; create_info.preferredLargeHeapBlockSize = 0; create_info.preferredSmallHeapBlockSize = 0; @@ -128,7 +127,7 @@ bool Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::init() } /** Please see header for specification */ -Anvil::MemoryAllocatorBackends::VMA::VMA(std::weak_ptr in_device_ptr) +Anvil::MemoryAllocatorBackends::VMA::VMA(const Anvil::BaseDevice* in_device_ptr) :m_device_ptr(in_device_ptr) { /* Stub */ @@ -162,9 +161,11 @@ bool Anvil::MemoryAllocatorBackends::VMA::bake(Anvil::MemoryAllocator::Items& in */ for (auto& current_item_ptr : in_items) { + MemoryBlockUniquePtr new_memory_block_ptr(nullptr, + std::default_delete() ); + VkMemoryRequirements memory_requirements_vk; VmaMemoryRequirements memory_requirements_vma; - std::shared_ptr new_memory_block_ptr; Anvil::OnMemoryBlockReleaseCallbackFunction release_callback_function; VkMemoryHeapFlags required_mem_heap_flags = 0; VkMemoryPropertyFlags required_mem_property_flags = 0; @@ -228,7 +229,9 @@ bool Anvil::MemoryAllocatorBackends::VMA::bake(Anvil::MemoryAllocator::Items& in continue; } - current_item_ptr->alloc_memory_block_ptr = new_memory_block_ptr; + dynamic_cast(new_memory_block_ptr.get() )->set_parent_memory_allocator_backend_ptr(shared_from_this() ); + + current_item_ptr->alloc_memory_block_ptr = std::move(new_memory_block_ptr); current_item_ptr->alloc_size = memory_requirements_vk.size; current_item_ptr->is_baked = true; @@ -239,9 +242,9 @@ bool Anvil::MemoryAllocatorBackends::VMA::bake(Anvil::MemoryAllocator::Items& in } /** Please see header for specification */ -std::shared_ptr Anvil::MemoryAllocatorBackends::VMA::create(std::weak_ptr in_device_ptr) +std::unique_ptr Anvil::MemoryAllocatorBackends::VMA::create(const Anvil::BaseDevice* in_device_ptr) { - std::shared_ptr result_ptr; + std::unique_ptr result_ptr; result_ptr.reset( new VMA(in_device_ptr) diff --git a/src/misc/memory_allocator.cpp b/src/misc/memory_allocator.cpp index 86c1429e..d46360dc 100644 --- a/src/misc/memory_allocator.cpp +++ b/src/misc/memory_allocator.cpp @@ -32,13 +32,13 @@ #include "wrappers/queue.h" /* Please see header for specification */ -Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_memory_allocator_ptr, - std::shared_ptr in_buffer_ptr, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types) +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -50,6 +50,7 @@ Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_me alloc_memory_types = in_alloc_memory_types; alloc_size = in_alloc_size; buffer_ptr = in_buffer_ptr; + image_ptr = nullptr; is_baked = false; memory_allocator_ptr = in_memory_allocator_ptr; type = ITEM_TYPE_BUFFER; @@ -57,14 +58,14 @@ Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_me register_for_callbacks(); } -Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_memory_allocator_ptr, - std::shared_ptr in_buffer_ptr, - VkDeviceSize in_alloc_offset, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types) +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_alloc_offset, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -77,6 +78,7 @@ Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_me alloc_offset = in_alloc_offset; alloc_size = in_alloc_size; buffer_ptr = in_buffer_ptr; + image_ptr = nullptr; is_baked = false; memory_allocator_ptr = in_memory_allocator_ptr; type = ITEM_TYPE_SPARSE_BUFFER_REGION; @@ -85,15 +87,15 @@ Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_me } /* Please see header for specification */ -Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_memory_allocator_ptr, - std::shared_ptr in_image_ptr, - uint32_t in_n_layer, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_miptail_offset, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types) +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_layer, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_miptail_offset, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -105,6 +107,7 @@ Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_me alloc_memory_types = in_alloc_memory_types; alloc_offset = UINT64_MAX; alloc_size = in_alloc_size; + buffer_ptr = nullptr; image_ptr = in_image_ptr; is_baked = false; memory_allocator_ptr = in_memory_allocator_ptr; @@ -116,16 +119,16 @@ Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_me } /* Please see header for specification */ -Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_memory_allocator_ptr, - std::shared_ptr in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - const VkExtent3D& in_extent, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types) +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + const VkExtent3D& in_extent, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -137,6 +140,7 @@ Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_me alloc_memory_supported_memory_types = in_alloc_supported_memory_types; alloc_offset = UINT64_MAX; alloc_size = in_alloc_size; + buffer_ptr = nullptr; extent = in_extent; image_ptr = in_image_ptr; is_baked = false; @@ -149,13 +153,13 @@ Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_me } /* Please see header for specification */ -Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_memory_allocator_ptr, - std::shared_ptr in_image_ptr, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types) +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -167,6 +171,7 @@ Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_me alloc_memory_types = in_alloc_memory_types; alloc_offset = UINT64_MAX; alloc_size = in_alloc_size; + buffer_ptr = nullptr; image_ptr = in_image_ptr; is_baked = false; memory_allocator_ptr = in_memory_allocator_ptr; @@ -175,76 +180,6 @@ Anvil::MemoryAllocator::Item::Item(std::shared_ptr in_me register_for_callbacks(); } -/* Please see header for specification */ -Anvil::MemoryAllocator::Item& Anvil::MemoryAllocator::Item::operator=(const Anvil::MemoryAllocator::Item& in) -{ - buffer_ptr = in.buffer_ptr; - buffer_ref_float_data_ptr = in.buffer_ref_float_data_ptr; - buffer_ref_float_vector_data_ptr = in.buffer_ref_float_vector_data_ptr; - buffer_ref_uchar8_data_ptr = in.buffer_ref_uchar8_data_ptr; - buffer_ref_uchar8_vector_data_ptr = in.buffer_ref_uchar8_vector_data_ptr; - buffer_ref_uint32_data_ptr = in.buffer_ref_uint32_data_ptr; - buffer_ref_uint32_vector_data_ptr = in.buffer_ref_uint32_vector_data_ptr; - image_ptr = in.image_ptr; - - memory_allocator_ptr = in.memory_allocator_ptr; - type = in.type; - - alloc_memory_block_ptr = in.alloc_memory_block_ptr; - alloc_memory_final_type = in.alloc_memory_final_type; - alloc_memory_required_alignment = in.alloc_memory_required_alignment; - alloc_memory_required_features = in.alloc_memory_required_features; - alloc_memory_supported_memory_types = in.alloc_memory_supported_memory_types; - alloc_memory_types = in.alloc_memory_types; - alloc_offset = in.alloc_offset; - alloc_size = in.alloc_size; - - extent = in.extent; - is_baked = in.is_baked; - miptail_offset = in.miptail_offset; - n_layer = in.n_layer; - offset = in.offset; - subresource = in.subresource; - - register_for_callbacks(); - - return *this; -} - -/* Please see header for specification */ -Anvil::MemoryAllocator::Item::Item(const Anvil::MemoryAllocator::Item& in) -{ - buffer_ptr = in.buffer_ptr; - buffer_ref_float_data_ptr = in.buffer_ref_float_data_ptr; - buffer_ref_float_vector_data_ptr = in.buffer_ref_float_vector_data_ptr; - buffer_ref_uchar8_data_ptr = in.buffer_ref_uchar8_data_ptr; - buffer_ref_uchar8_vector_data_ptr = in.buffer_ref_uchar8_vector_data_ptr; - buffer_ref_uint32_data_ptr = in.buffer_ref_uint32_data_ptr; - buffer_ref_uint32_vector_data_ptr = in.buffer_ref_uint32_vector_data_ptr; - image_ptr = in.image_ptr; - - memory_allocator_ptr = in.memory_allocator_ptr; - type = in.type; - - alloc_memory_block_ptr = in.alloc_memory_block_ptr; - alloc_memory_final_type = in.alloc_memory_final_type; - alloc_memory_required_alignment = in.alloc_memory_required_alignment; - alloc_memory_required_features = in.alloc_memory_required_features; - alloc_memory_supported_memory_types = in.alloc_memory_supported_memory_types; - alloc_memory_types = in.alloc_memory_types; - alloc_offset = in.alloc_offset; - alloc_size = in.alloc_size; - - extent = in.extent; - is_baked = in.is_baked; - miptail_offset = in.miptail_offset; - n_layer = in.n_layer; - offset = in.offset; - subresource = in.subresource; - - register_for_callbacks(); -} - /* Please see header for specification */ Anvil::MemoryAllocator::Item::~Item() { @@ -255,12 +190,12 @@ Anvil::MemoryAllocator::Item::~Item() void Anvil::MemoryAllocator::Item::register_for_callbacks() { auto on_implicit_bake_needed_callback_func = std::bind(&Anvil::MemoryAllocator::on_implicit_bake_needed, - memory_allocator_ptr.get() ); + memory_allocator_ptr); auto on_is_alloc_pending_for_buffer_query_callback_func = std::bind(&Anvil::MemoryAllocator::on_is_alloc_pending_for_buffer_query, - memory_allocator_ptr.get(), + memory_allocator_ptr, std::placeholders::_1); auto on_is_alloc_pending_for_image_query_callback_func = std::bind(&Anvil::MemoryAllocator::on_is_alloc_pending_for_image_query, - memory_allocator_ptr.get(), + memory_allocator_ptr, std::placeholders::_1); if (buffer_ptr != nullptr) @@ -268,11 +203,11 @@ void Anvil::MemoryAllocator::Item::register_for_callbacks() /* Sign up for "is alloc pending" callback in order to support sparsely bound/sparse buffers */ if (!buffer_ptr->is_callback_registered(BUFFER_CALLBACK_ID_IS_ALLOC_PENDING, on_is_alloc_pending_for_buffer_query_callback_func, - buffer_ptr.get() )) + buffer_ptr)) { buffer_ptr->register_for_callbacks(BUFFER_CALLBACK_ID_IS_ALLOC_PENDING, on_is_alloc_pending_for_buffer_query_callback_func, - buffer_ptr.get() ); + buffer_ptr); buffer_has_is_alloc_pending_callback_registered = true; } @@ -284,11 +219,11 @@ void Anvil::MemoryAllocator::Item::register_for_callbacks() /* Sign up for "memory needed" callback so that we can trigger an implicit bake operation */ if (!buffer_ptr->is_callback_registered(BUFFER_CALLBACK_ID_MEMORY_BLOCK_NEEDED, on_implicit_bake_needed_callback_func, - buffer_ptr.get() )) + buffer_ptr)) { buffer_ptr->register_for_callbacks(BUFFER_CALLBACK_ID_MEMORY_BLOCK_NEEDED, on_implicit_bake_needed_callback_func, - buffer_ptr.get() ); + buffer_ptr); buffer_has_memory_block_needed_callback_registered = true; } @@ -303,11 +238,11 @@ void Anvil::MemoryAllocator::Item::register_for_callbacks() /* Sign up for "is alloc pending" callback in order to support sparse images */ if (!image_ptr->is_callback_registered(IMAGE_CALLBACK_ID_IS_ALLOC_PENDING, on_is_alloc_pending_for_image_query_callback_func, - image_ptr.get() )) + image_ptr)) { image_ptr->register_for_callbacks(IMAGE_CALLBACK_ID_IS_ALLOC_PENDING, on_is_alloc_pending_for_image_query_callback_func, - image_ptr.get() ); + image_ptr); image_has_is_alloc_pending_callback_registered = true; } @@ -319,11 +254,11 @@ void Anvil::MemoryAllocator::Item::register_for_callbacks() /* Sign up for "memory needed" callback so that we can trigger an implicit bake operation */ if (!image_ptr->is_callback_registered(IMAGE_CALLBACK_ID_MEMORY_BLOCK_NEEDED, on_implicit_bake_needed_callback_func, - image_ptr.get() )) + image_ptr)) { image_ptr->register_for_callbacks(IMAGE_CALLBACK_ID_MEMORY_BLOCK_NEEDED, on_implicit_bake_needed_callback_func, - image_ptr.get() ); + image_ptr); image_has_memory_block_needed_callback_registered = true; } @@ -339,12 +274,12 @@ void Anvil::MemoryAllocator::Item::register_for_callbacks() void Anvil::MemoryAllocator::Item::unregister_from_callbacks() { auto on_implicit_bake_needed_callback_func = std::bind(&Anvil::MemoryAllocator::on_implicit_bake_needed, - memory_allocator_ptr.get() ); + memory_allocator_ptr); auto on_is_alloc_pending_for_buffer_query_callback_func = std::bind(&Anvil::MemoryAllocator::on_is_alloc_pending_for_buffer_query, - memory_allocator_ptr.get(), + memory_allocator_ptr, std::placeholders::_1); auto on_is_alloc_pending_for_image_query_callback_func = std::bind(&Anvil::MemoryAllocator::on_is_alloc_pending_for_image_query, - memory_allocator_ptr.get(), + memory_allocator_ptr, std::placeholders::_1); if (buffer_ptr != nullptr) @@ -353,14 +288,14 @@ void Anvil::MemoryAllocator::Item::unregister_from_callbacks() { buffer_ptr->unregister_from_callbacks(BUFFER_CALLBACK_ID_IS_ALLOC_PENDING, on_is_alloc_pending_for_buffer_query_callback_func, - buffer_ptr.get() ); + buffer_ptr); } if (buffer_has_memory_block_needed_callback_registered) { buffer_ptr->unregister_from_callbacks(BUFFER_CALLBACK_ID_MEMORY_BLOCK_NEEDED, on_implicit_bake_needed_callback_func, - buffer_ptr.get() ); + buffer_ptr); } } @@ -370,25 +305,25 @@ void Anvil::MemoryAllocator::Item::unregister_from_callbacks() { image_ptr->unregister_from_callbacks(IMAGE_CALLBACK_ID_IS_ALLOC_PENDING, on_is_alloc_pending_for_image_query_callback_func, - image_ptr.get() ); + image_ptr); } if (image_has_memory_block_needed_callback_registered) { image_ptr->unregister_from_callbacks(IMAGE_CALLBACK_ID_MEMORY_BLOCK_NEEDED, on_implicit_bake_needed_callback_func, - image_ptr.get() ); + image_ptr); } } } /* Please see header for specification */ -Anvil::MemoryAllocator::MemoryAllocator(std::weak_ptr in_device_ptr, +Anvil::MemoryAllocator::MemoryAllocator(const Anvil::BaseDevice* in_device_ptr, std::shared_ptr in_backend_ptr, bool in_mt_safe) :MTSafetySupportProvider(in_mt_safe), - m_backend_ptr (in_backend_ptr), + m_backend_ptr (std::move(in_backend_ptr) ), m_device_ptr (in_device_ptr) { /* Stub */ @@ -406,8 +341,8 @@ Anvil::MemoryAllocator::~MemoryAllocator() /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer(std::shared_ptr in_buffer_ptr, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* in_buffer_ptr, + MemoryFeatureFlags in_required_memory_features) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -428,15 +363,17 @@ bool Anvil::MemoryAllocator::add_buffer(std::shared_ptr in_buffer * * @param buffer_ptr Buffer instance to assign a memory block at baking time. **/ -bool Anvil::MemoryAllocator::add_buffer_internal(std::shared_ptr in_buffer_ptr, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* in_buffer_ptr, + MemoryFeatureFlags in_required_memory_features) { - std::shared_ptr backend_interface_ptr = std::dynamic_pointer_cast(m_backend_ptr); - VkDeviceSize buffer_alignment = 0; - uint32_t buffer_memory_types = 0; - VkDeviceSize buffer_storage_size = 0; - std::shared_ptr new_item_ptr; - bool result = true; + IMemoryAllocatorBackend* backend_interface_ptr = dynamic_cast(m_backend_ptr.get() ); + VkDeviceSize buffer_alignment = 0; + uint32_t buffer_memory_types = 0; + VkDeviceSize buffer_storage_size = 0; + std::unique_ptr new_item_ptr; + bool result = true; + + ANVIL_REDUNDANT_VARIABLE(backend_interface_ptr); /* Sanity checks */ anvil_assert(backend_interface_ptr->supports_baking() ); @@ -462,7 +399,7 @@ bool Anvil::MemoryAllocator::add_buffer_internal(std::shared_ptr /* Store a new block item descriptor. */ new_item_ptr.reset( - new Item(shared_from_this(), + new Item(this, in_buffer_ptr, buffer_storage_size, buffer_memory_types, @@ -471,9 +408,11 @@ bool Anvil::MemoryAllocator::add_buffer_internal(std::shared_ptr filtered_memory_types) ); - m_items.push_back(new_item_ptr); + m_items.push_back( + std::move(new_item_ptr) + ); - m_per_object_pending_alloc_status[in_buffer_ptr.get()] = true; + m_per_object_pending_alloc_status[in_buffer_ptr] = true; end: anvil_assert(result); @@ -482,9 +421,9 @@ bool Anvil::MemoryAllocator::add_buffer_internal(std::shared_ptr } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(std::shared_ptr in_buffer_ptr, - std::shared_ptr in_data_ptr, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr in_data_ptr, + MemoryFeatureFlags in_required_memory_features) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -502,15 +441,15 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(std: if (result) { - m_items.back()->buffer_ref_float_data_ptr = in_data_ptr; + m_items.back()->buffer_ref_float_data_ptr = std::move(in_data_ptr); } return result; } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fill(std::shared_ptr in_buffer_ptr, - std::shared_ptr > in_data_vector_ptr, +bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features) { std::unique_lock mutex_lock; @@ -531,19 +470,24 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi if (result) { - m_items.back()->buffer_ref_float_vector_data_ptr = in_data_vector_ptr; + m_items.back()->buffer_ref_float_vector_data_ptr = std::move(in_data_vector_ptr); } return result; } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(std::shared_ptr in_buffer_ptr, - std::shared_ptr in_data_ptr, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + const std::vector* in_data_vector_ptr, + MemoryFeatureFlags in_required_memory_features) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); + auto ptr = std::unique_ptr, std::function*) > >(const_cast* >(in_data_vector_ptr), + [](const std::vector*) + { + /* Stub */ + }); bool result; if (mutex_ptr != nullptr) @@ -553,20 +497,49 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(std ); } + anvil_assert(in_data_vector_ptr->size() * sizeof(uint32_t) == in_buffer_ptr->get_size() ); + result = add_buffer_internal(in_buffer_ptr, in_required_memory_features); if (result) { - m_items.back()->buffer_ref_uchar8_data_ptr = in_data_ptr; + m_items.back()->buffer_ref_float_vector_data_ptr = std::move(ptr); } return result; } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_vector_ptr_based_post_fill(std::shared_ptr in_buffer_ptr, - std::shared_ptr > in_data_vector_ptr, +bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr in_data_ptr, + MemoryFeatureFlags in_required_memory_features) +{ + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + bool result; + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } + + result = add_buffer_internal(in_buffer_ptr, + in_required_memory_features); + + if (result) + { + m_items.back()->buffer_ref_uchar8_data_ptr = std::move(in_data_ptr); + } + + return result; +} + +/* Please see header for specification */ +bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features) { std::unique_lock mutex_lock; @@ -587,16 +560,16 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_vector_ptr_based_post_f if (result) { - m_items.back()->buffer_ref_uchar8_vector_data_ptr = in_data_vector_ptr; + m_items.back()->buffer_ref_uchar8_vector_data_ptr = std::move(in_data_vector_ptr); } return result; } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(std::shared_ptr in_buffer_ptr, - std::shared_ptr in_data_ptr, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr in_data_ptr, + MemoryFeatureFlags in_required_memory_features) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -614,15 +587,15 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(std if (result) { - m_items.back()->buffer_ref_uint32_data_ptr = in_data_ptr; + m_items.back()->buffer_ref_uint32_data_ptr = std::move(in_data_ptr); } return result; } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_fill(std::shared_ptr in_buffer_ptr, - std::shared_ptr > in_data_vector_ptr, +bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features) { std::unique_lock mutex_lock; @@ -643,15 +616,49 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f if (result) { - m_items.back()->buffer_ref_uint32_vector_data_ptr = in_data_vector_ptr; + m_items.back()->buffer_ref_uint32_vector_data_ptr = std::move(in_data_vector_ptr); } return result; } /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_image_whole(std::shared_ptr in_image_ptr, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + const std::vector* in_data_vector_ptr, + MemoryFeatureFlags in_required_memory_features) +{ + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + auto ptr = std::unique_ptr, std::function*) > >(const_cast* >(in_data_vector_ptr), + [](const std::vector*) + { + /* Stub */ + }); + bool result; + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } + + anvil_assert(in_data_vector_ptr->size() * sizeof(uint32_t) == in_buffer_ptr->get_size() ); + + result = add_buffer_internal(in_buffer_ptr, + in_required_memory_features); + + if (result) + { + m_items.back()->buffer_ref_uint32_vector_data_ptr = std::move(ptr); + } + + return result; +} + +/** Please see header for specification */ +bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* in_image_ptr, + MemoryFeatureFlags in_required_memory_features) { uint32_t filtered_memory_types = 0; VkDeviceSize image_alignment = 0; @@ -659,7 +666,7 @@ bool Anvil::MemoryAllocator::add_image_whole(std::shared_ptr in_im VkDeviceSize image_storage_size = 0; std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); - std::shared_ptr new_item_ptr; + std::unique_ptr new_item_ptr; bool result = true; if (mutex_ptr != nullptr) @@ -690,7 +697,7 @@ bool Anvil::MemoryAllocator::add_image_whole(std::shared_ptr in_im /* Store a new block item descriptor */ new_item_ptr.reset( - new Item(shared_from_this(), + new Item(this, in_image_ptr, image_storage_size, image_memory_types, @@ -699,22 +706,24 @@ bool Anvil::MemoryAllocator::add_image_whole(std::shared_ptr in_im filtered_memory_types) ); - m_items.push_back(new_item_ptr); + m_items.push_back( + std::move(new_item_ptr) + ); - m_per_object_pending_alloc_status[in_image_ptr.get()] = true; + m_per_object_pending_alloc_status[in_image_ptr] = true; end: return result; } /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_sparse_buffer_region(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - VkDeviceSize in_size, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkDeviceSize in_size, + MemoryFeatureFlags in_required_memory_features) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); - std::shared_ptr new_item_ptr; + std::unique_ptr new_item_ptr; bool result = true; /* Sanity checks */ @@ -748,7 +757,7 @@ bool Anvil::MemoryAllocator::add_sparse_buffer_region(std::shared_ptr in_image_ptr, - VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* in_image_ptr, + VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + MemoryFeatureFlags in_required_memory_features) { const Anvil::SparseImageAspectProperties* aspect_props_ptr = nullptr; uint32_t filtered_memory_types = 0; std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); - std::shared_ptr new_item_ptr; + std::unique_ptr new_item_ptr; uint32_t miptail_memory_types = 0; VkDeviceSize miptail_offset = static_cast(UINT64_MAX); VkDeviceSize miptail_size = 0; @@ -828,7 +839,7 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(std::shared_ptr in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - VkExtent3D in_extent, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + VkExtent3D in_extent, + MemoryFeatureFlags in_required_memory_features) { const Anvil::SparseImageAspectProperties* aspect_props_ptr = nullptr; uint32_t component_size_bits[4] = {0}; uint32_t filtered_memory_types = 0; + const auto image_format = in_image_ptr->get_image_format(); uint32_t mip_size[3]; std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); - std::shared_ptr new_item_ptr; + std::unique_ptr new_item_ptr; bool result = true; VkDeviceSize total_region_size_in_bytes = 0; @@ -878,8 +892,7 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(std::shared_ptr= 1); anvil_assert(in_extent.width >= 1); - anvil_assert(!Anvil::Formats::is_format_compressed(in_image_ptr->get_image_format() )); // TODO - anvil_assert((Anvil::Utils::is_pow2 (static_cast(in_subresource.aspectMask)) != 0)); // only permit a single aspect + anvil_assert((Anvil::Utils::is_pow2(static_cast(in_subresource.aspectMask)) != 0)); // only permit a single aspect if (mutex_ptr != nullptr) { @@ -889,6 +902,8 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(std::shared_ptrget_memory_requirements().alignment; + result = in_image_ptr->get_sparse_image_aspect_properties(static_cast(in_subresource.aspectMask), &aspect_props_ptr); anvil_assert(result); @@ -938,27 +953,63 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(std::shared_ptrget_image_format(), - component_size_bits + 0, - component_size_bits + 1, - component_size_bits + 2, - component_size_bits + 3); - - anvil_assert(component_size_bits[0] != 0 || - component_size_bits[1] != 0 || - component_size_bits[2] != 0 || - component_size_bits[3] != 0); - anvil_assert(((component_size_bits[0] + component_size_bits[1] + - component_size_bits[2] + component_size_bits[3]) % 8) == 0); - - total_region_size_in_bytes = (component_size_bits[0] + component_size_bits[1] + component_size_bits[2] + component_size_bits[3]) / 8 /* bits in byte */ - * in_extent.width - * in_extent.height - * in_extent.depth; + if (!Anvil::Formats::is_format_compressed(image_format)) + { + Anvil::Formats::get_format_n_component_bits(image_format, + component_size_bits + 0, + component_size_bits + 1, + component_size_bits + 2, + component_size_bits + 3); + + anvil_assert(component_size_bits[0] != 0 || + component_size_bits[1] != 0 || + component_size_bits[2] != 0 || + component_size_bits[3] != 0); + anvil_assert(((component_size_bits[0] + component_size_bits[1] + + component_size_bits[2] + component_size_bits[3]) % 8) == 0); + + total_region_size_in_bytes = (component_size_bits[0] + component_size_bits[1] + component_size_bits[2] + component_size_bits[3]) / 8 /* bits in byte */ + * in_extent.width + * in_extent.height + * in_extent.depth; + } + else + { + uint32_t compressed_block_size[3] = + { + 1, + 1, + 1 + }; + uint32_t n_bytes_per_block = 0; + + if (!Anvil::Formats::get_compressed_format_block_size(image_format, + compressed_block_size, + &n_bytes_per_block) ) + { + result = false; - /* The region size may be smaller than the required page size. Round it up if that's the case */ - const VkDeviceSize tile_size = in_image_ptr->get_memory_requirements().alignment; + goto end; + } + else + { + anvil_assert(compressed_block_size[0] != 0 && + compressed_block_size[1] != 0 && + compressed_block_size[2] != 0); + anvil_assert(n_bytes_per_block != 0); + + anvil_assert( (in_extent.width % compressed_block_size[0]) == 0); + anvil_assert( (in_extent.height % compressed_block_size[1]) == 0); + anvil_assert( (in_extent.depth % compressed_block_size[2]) == 0); + + total_region_size_in_bytes = (in_extent.width / compressed_block_size[0]) * + (in_extent.height / compressed_block_size[1]) * + (in_extent.depth / compressed_block_size[2]) * + n_bytes_per_block; + } + } + /* The region size may be smaller than the required page size. Round it up if that's the case */ total_region_size_in_bytes = Anvil::Utils::round_up(total_region_size_in_bytes, tile_size); @@ -973,7 +1024,7 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(std::shared_ptr device_locked_ptr = std::shared_ptr(m_device_ptr); + std::vector fences; std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); bool needs_sparse_memory_binding = false; @@ -1059,11 +1112,12 @@ bool Anvil::MemoryAllocator::bake() if (needs_sparse_memory_binding) { - std::shared_ptr wait_fence_ptr = Anvil::Fence::create(m_device_ptr, - false, /* create_signalled */ - MT_SAFETY_DISABLED); + auto wait_fence_ptr = Anvil::Fence::create(m_device_ptr, + false, /* create_signalled */ + MT_SAFETY_DISABLED); - sparse_memory_binding.set_fence(wait_fence_ptr); + sparse_memory_binding.set_fence(wait_fence_ptr.get() ); + fences.push_back (std::move(wait_fence_ptr) ); sparse_memory_bind_info_id = sparse_memory_binding.add_bind_info(0, /* n_signal_semaphores */ nullptr, /* opt_signal_semaphores_ptr */ @@ -1080,7 +1134,7 @@ bool Anvil::MemoryAllocator::bake() item_iterator != m_items.end(); ++item_iterator) { - auto item_ptr = *item_iterator; + auto item_ptr = item_iterator->get(); if (item_ptr->alloc_memory_block_ptr) { @@ -1092,15 +1146,18 @@ bool Anvil::MemoryAllocator::bake() { if (!item_ptr->buffer_ptr->is_sparse() ) { - item_ptr->buffer_ptr->set_nonsparse_memory(item_ptr->alloc_memory_block_ptr); + item_ptr->buffer_ptr->set_nonsparse_memory( + std::move(item_ptr->alloc_memory_block_ptr) + ); } else { sparse_memory_binding.append_buffer_memory_update(sparse_memory_bind_info_id, item_ptr->buffer_ptr, 0, /* buffer_memory_start_offset */ - item_ptr->alloc_memory_block_ptr, - 0, /* opt_memory_block_start_offset */ + item_ptr->alloc_memory_block_ptr.release(), + 0, /* opt_memory_block_start_offset */ + true, /* in_opt_memory_block_owned_by_buffer */ item_ptr->alloc_size); } @@ -1114,8 +1171,9 @@ bool Anvil::MemoryAllocator::bake() sparse_memory_binding.append_buffer_memory_update(sparse_memory_bind_info_id, item_ptr->buffer_ptr, item_ptr->alloc_offset, - item_ptr->alloc_memory_block_ptr, - 0, /* opt_memory_block_start_offset */ + item_ptr->alloc_memory_block_ptr.release(), + 0, /* opt_memory_block_start_offset */ + true, /* in_opt_memory_block_owned_by_buffer */ item_ptr->alloc_size); break; @@ -1125,7 +1183,9 @@ bool Anvil::MemoryAllocator::bake() { if (!item_ptr->image_ptr->is_sparse() ) { - item_ptr->image_ptr->set_memory(item_ptr->alloc_memory_block_ptr); + item_ptr->image_ptr->set_memory( + std::move(item_ptr->alloc_memory_block_ptr) + ); } else { @@ -1134,8 +1194,9 @@ bool Anvil::MemoryAllocator::bake() 0, /* resource_offset */ item_ptr->alloc_size, 0, /* flags */ - item_ptr->alloc_memory_block_ptr, - 0); /* opt_memory_block_start_offset */ + item_ptr->alloc_memory_block_ptr.release(), + 0, /* opt_memory_block_start_offset */ + true); /* in_opt_memory_block_owned_by_image */ } break; @@ -1148,8 +1209,9 @@ bool Anvil::MemoryAllocator::bake() item_ptr->miptail_offset, item_ptr->alloc_size, 0, /* flags */ - item_ptr->alloc_memory_block_ptr, - 0); /* opt_memory_block_start_offset */ + item_ptr->alloc_memory_block_ptr.release(), + 0, /* opt_memory_block_start_offset */ + true); /* in_opt_memory_block_owned_by_image */ break; } @@ -1162,8 +1224,9 @@ bool Anvil::MemoryAllocator::bake() item_ptr->offset, item_ptr->extent, 0, /* flags */ - item_ptr->alloc_memory_block_ptr, - 0); /* opt_memory_block_start_offset */ + item_ptr->alloc_memory_block_ptr.release(), + 0, /* opt_memory_block_start_offset */ + true); /* in_opt_memory_block_owned_by_image */ break; } @@ -1179,13 +1242,13 @@ bool Anvil::MemoryAllocator::bake() /* If memory backing is needed for one or more sparse resources, bind these now */ if (sparse_memory_bind_info_id != UINT32_MAX) { - std::shared_ptr sparse_queue_ptr(device_locked_ptr->get_sparse_binding_queue(0) ); + Anvil::Queue* sparse_queue_ptr(m_device_ptr->get_sparse_binding_queue(0) ); result = sparse_queue_ptr->bind_sparse_memory(sparse_memory_binding); anvil_assert(result); /* Block until the sparse memory bindings are in place */ - vkWaitForFences(device_locked_ptr->get_device_vk(), + vkWaitForFences(m_device_ptr->get_device_vk(), 1, /* fenceCount */ sparse_memory_binding.get_fence()->get_fence_ptr(), VK_FALSE, /* waitAll */ @@ -1198,15 +1261,13 @@ bool Anvil::MemoryAllocator::bake() * to prevent the premature destruction of the allocator, cache a shared ptr to this instance, so that * the allocator only goes out of scope when this function leaves. */ - this_ptr = shared_from_this(); - for (uint32_t n_item = 0; n_item < m_items.size(); ++n_item ) { - auto item_iterator = m_items.begin() + n_item; - auto item_ptr = *item_iterator; + auto item_iterator = m_items.begin() + n_item; + auto& item_ptr = *item_iterator; if (item_ptr->is_baked) { @@ -1215,11 +1276,11 @@ bool Anvil::MemoryAllocator::bake() switch (item_ptr->type) { case ITEM_TYPE_BUFFER: /* fall-through */ - case ITEM_TYPE_SPARSE_BUFFER_REGION: alloc_status_map_iterator = m_per_object_pending_alloc_status.find(item_ptr->buffer_ptr.get() ); break; + case ITEM_TYPE_SPARSE_BUFFER_REGION: alloc_status_map_iterator = m_per_object_pending_alloc_status.find(item_ptr->buffer_ptr); break; case ITEM_TYPE_IMAGE_WHOLE: /* fall-through */ case ITEM_TYPE_SPARSE_IMAGE_MIPTAIL: /* fall-through */ - case ITEM_TYPE_SPARSE_IMAGE_SUBRESOURCE: alloc_status_map_iterator = m_per_object_pending_alloc_status.find(item_ptr->image_ptr.get() ); break; + case ITEM_TYPE_SPARSE_IMAGE_SUBRESOURCE: alloc_status_map_iterator = m_per_object_pending_alloc_status.find(item_ptr->image_ptr); break; default: { @@ -1311,13 +1372,14 @@ bool Anvil::MemoryAllocator::bake() } /* Please see header for specification */ -std::shared_ptr Anvil::MemoryAllocator::create_oneshot(std::weak_ptr in_device_ptr, - MTSafety in_mt_safety) +Anvil::MemoryAllocatorUniquePtr Anvil::MemoryAllocator::create_oneshot(const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety) { std::shared_ptr backend_ptr; const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, in_device_ptr) ); - std::shared_ptr result_ptr; + std::unique_ptr result_ptr (nullptr, + std::default_delete() ); backend_ptr.reset( new Anvil::MemoryAllocatorBackends::OneShot(in_device_ptr) @@ -1332,17 +1394,18 @@ std::shared_ptr Anvil::MemoryAllocator::create_oneshot(s ); } - return result_ptr; + return std::move(result_ptr); } /* Please see header for specification */ -std::shared_ptr Anvil::MemoryAllocator::create_vma(std::weak_ptr in_device_ptr, - MTSafety in_mt_safety) +Anvil::MemoryAllocatorUniquePtr Anvil::MemoryAllocator::create_vma(const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety) { std::shared_ptr backend_ptr; const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, in_device_ptr) ); - std::shared_ptr result_ptr; + std::unique_ptr result_ptr(nullptr, + std::default_delete() ); backend_ptr = Anvil::MemoryAllocatorBackends::VMA::create(in_device_ptr); @@ -1350,12 +1413,12 @@ std::shared_ptr Anvil::MemoryAllocator::create_vma(std:: { result_ptr.reset( new Anvil::MemoryAllocator(in_device_ptr, - backend_ptr, + std::move(backend_ptr), mt_safe) ); } - return result_ptr; + return std::move(result_ptr); } /** Tells whether or not a given set of memory types supports the requested memory features. */ @@ -1363,25 +1426,24 @@ bool Anvil::MemoryAllocator::is_alloc_supported(uint32_t in_mem Anvil::MemoryFeatureFlags in_memory_features, uint32_t* out_opt_filtered_memory_types_ptr) const { - std::shared_ptr device_locked_ptr (m_device_ptr); - const bool is_coherent_memory_required (((in_memory_features & MEMORY_FEATURE_FLAG_HOST_COHERENT) != 0) ); - const bool is_device_local_memory_required (((in_memory_features & MEMORY_FEATURE_FLAG_DEVICE_LOCAL) != 0) ); - const bool is_host_cached_memory_required (((in_memory_features & MEMORY_FEATURE_FLAG_HOST_CACHED) != 0) ); - const bool is_lazily_allocated_memory_required(((in_memory_features & MEMORY_FEATURE_FLAG_LAZILY_ALLOCATED) != 0) ); - const bool is_mappable_memory_required (((in_memory_features & MEMORY_FEATURE_FLAG_MAPPABLE) != 0) ); - const auto& memory_props (device_locked_ptr->get_physical_device_memory_properties() ); - bool result (true); + const bool is_coherent_memory_required (((in_memory_features & MEMORY_FEATURE_FLAG_HOST_COHERENT) != 0) ); + const bool is_device_local_memory_required (((in_memory_features & MEMORY_FEATURE_FLAG_DEVICE_LOCAL) != 0) ); + const bool is_host_cached_memory_required (((in_memory_features & MEMORY_FEATURE_FLAG_HOST_CACHED) != 0) ); + const bool is_lazily_allocated_memory_required(((in_memory_features & MEMORY_FEATURE_FLAG_LAZILY_ALLOCATED) != 0) ); + const bool is_mappable_memory_required (((in_memory_features & MEMORY_FEATURE_FLAG_MAPPABLE) != 0) ); + const auto& memory_props (m_device_ptr->get_physical_device_memory_properties() ); + bool result (true); /* Filter out memory types that do not support features requested at creation time */ for (uint32_t n_memory_type = 0; (1u << n_memory_type) <= in_memory_types; ++n_memory_type) { - if ((is_coherent_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)) || - (is_device_local_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) || - (is_host_cached_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT)) || - (is_lazily_allocated_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT)) || - (is_mappable_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)) ) + if ((is_coherent_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)) || + (is_device_local_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) || + (is_host_cached_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT)) || + (is_lazily_allocated_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT)) || + (is_mappable_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)) ) { in_memory_types &= ~(1 << n_memory_type); } @@ -1408,7 +1470,7 @@ bool Anvil::MemoryAllocator::is_alloc_supported(uint32_t in_mem void Anvil::MemoryAllocator::on_is_alloc_pending_for_buffer_query(CallbackArgument* in_callback_arg_ptr) { IsBufferMemoryAllocPendingQueryCallbackArgument* query_ptr = dynamic_cast(in_callback_arg_ptr); - auto alloc_status_map_iterator = m_per_object_pending_alloc_status.find (query_ptr->buffer_ptr.get() ); + auto alloc_status_map_iterator = m_per_object_pending_alloc_status.find (query_ptr->buffer_ptr); std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -1429,7 +1491,7 @@ void Anvil::MemoryAllocator::on_is_alloc_pending_for_buffer_query(CallbackArgume void Anvil::MemoryAllocator::on_is_alloc_pending_for_image_query(CallbackArgument* in_callback_arg_ptr) { IsImageMemoryAllocPendingQueryCallbackArgument* query_ptr = dynamic_cast(in_callback_arg_ptr); - auto alloc_status_map_iterator = m_per_object_pending_alloc_status.find (query_ptr->image_ptr.get() ); + auto alloc_status_map_iterator = m_per_object_pending_alloc_status.find (query_ptr->image_ptr); std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); diff --git a/src/misc/object_tracker.cpp b/src/misc/object_tracker.cpp index d28b958b..f68cefc4 100644 --- a/src/misc/object_tracker.cpp +++ b/src/misc/object_tracker.cpp @@ -111,6 +111,8 @@ const char* Anvil::ObjectTracker::get_object_type_name(ObjectType in_object_type "Descriptor Set", "Descriptor Set Group", "Descriptor Set Layout", + "Descriptor Set Layout Manager", + "Descriptor Update Template", "Device", "Event", "Fence", diff --git a/src/misc/page_tracker.cpp b/src/misc/page_tracker.cpp index 86098b33..3a3be343 100644 --- a/src/misc/page_tracker.cpp +++ b/src/misc/page_tracker.cpp @@ -19,7 +19,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // - +#include "misc/types.h" +#include "wrappers/memory_block.h" #include "misc/debug.h" #include "misc/page_tracker.h" @@ -38,11 +39,11 @@ Anvil::PageTracker::PageTracker(VkDeviceSize in_region_size, } /** Please see header for specification */ -std::shared_ptr Anvil::PageTracker::get_memory_block(VkDeviceSize in_start_offset, - VkDeviceSize in_size, - VkDeviceSize* out_memory_region_start_offset_ptr) const +Anvil::MemoryBlock* Anvil::PageTracker::get_memory_block(VkDeviceSize in_start_offset, + VkDeviceSize in_size, + VkDeviceSize* out_memory_region_start_offset_ptr) const { - std::shared_ptr result_ptr; + Anvil::MemoryBlock* result_ptr = nullptr; if (in_size > m_page_size) { @@ -69,10 +70,10 @@ std::shared_ptr Anvil::PageTracker::get_memory_block(VkDevic } /** Please see header for specification */ -bool Anvil::PageTracker::set_binding(std::shared_ptr in_memory_block_ptr, - VkDeviceSize in_memory_block_start_offset, - VkDeviceSize in_start_offset, - VkDeviceSize in_size) +bool Anvil::PageTracker::set_binding(MemoryBlock* in_memory_block_ptr, + VkDeviceSize in_memory_block_start_offset, + VkDeviceSize in_start_offset, + VkDeviceSize in_size) { const auto end_offset_page_aligned = Anvil::Utils::round_up(in_start_offset + in_size, m_page_size); diff --git a/src/misc/pools.cpp b/src/misc/pools.cpp index 16711a82..a90ae4fc 100644 --- a/src/misc/pools.cpp +++ b/src/misc/pools.cpp @@ -25,23 +25,23 @@ #include "wrappers/command_buffer.h" #include "wrappers/command_pool.h" -std::shared_ptr Anvil::PrimaryCommandBufferPoolWorker::create_item() +Anvil::PrimaryCommandBufferUniquePtr Anvil::PrimaryCommandBufferPoolWorker::create_item() { return m_parent_command_pool_ptr->alloc_primary_level_command_buffer(); } -void Anvil::PrimaryCommandBufferPoolWorker::reset_item(std::shared_ptr in_item_ptr) +void Anvil::PrimaryCommandBufferPoolWorker::reset_item(Anvil::PrimaryCommandBufferUniquePtr& in_item_ptr) { in_item_ptr->reset(false /* should_release_resources */); } -std::shared_ptr Anvil::SecondaryCommandBufferPoolWorker::create_item() +Anvil::SecondaryCommandBufferUniquePtr Anvil::SecondaryCommandBufferPoolWorker::create_item() { return m_parent_command_pool_ptr->alloc_secondary_level_command_buffer(); } -void Anvil::SecondaryCommandBufferPoolWorker::reset_item(std::shared_ptr in_item_ptr) +void Anvil::SecondaryCommandBufferPoolWorker::reset_item(Anvil::SecondaryCommandBufferUniquePtr& in_item_ptr) { in_item_ptr->reset(false /* should_release_resources */); } \ No newline at end of file diff --git a/src/misc/render_pass_info.cpp b/src/misc/render_pass_info.cpp index 54d8b75a..ea18fb48 100644 --- a/src/misc/render_pass_info.cpp +++ b/src/misc/render_pass_info.cpp @@ -26,11 +26,11 @@ #include -Anvil::RenderPassInfo::RenderPassInfo(std::weak_ptr in_device_ptr) +Anvil::RenderPassInfo::RenderPassInfo(const Anvil::BaseDevice* in_device_ptr) :m_device_ptr (in_device_ptr), m_update_preserved_attachments(false) { - anvil_assert(in_device_ptr.lock() != nullptr); + anvil_assert(in_device_ptr != nullptr); } Anvil::RenderPassInfo::~RenderPassInfo() @@ -40,13 +40,13 @@ Anvil::RenderPassInfo::~RenderPassInfo() /* Please see haeder for specification */ bool Anvil::RenderPassInfo::add_color_attachment(VkFormat in_format, - VkSampleCountFlags in_sample_count, - VkAttachmentLoadOp in_load_op, - VkAttachmentStoreOp in_store_op, - VkImageLayout in_initial_layout, - VkImageLayout in_final_layout, - bool in_may_alias, - RenderPassAttachmentID* out_attachment_id_ptr) + VkSampleCountFlags in_sample_count, + VkAttachmentLoadOp in_load_op, + VkAttachmentStoreOp in_store_op, + VkImageLayout in_initial_layout, + VkImageLayout in_final_layout, + bool in_may_alias, + RenderPassAttachmentID* out_attachment_id_ptr) { uint32_t new_attachment_index = UINT32_MAX; bool result = false; @@ -92,12 +92,12 @@ bool Anvil::RenderPassInfo::add_color_attachment(VkFormat in_form * **/ bool Anvil::RenderPassInfo::add_dependency(SubPass* in_destination_subpass_ptr, - SubPass* in_source_subpass_ptr, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) + SubPass* in_source_subpass_ptr, + VkPipelineStageFlags in_source_stage_mask, + VkPipelineStageFlags in_destination_stage_mask, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region) { auto new_dep = SubPassDependency(in_destination_stage_mask, in_destination_subpass_ptr, @@ -119,15 +119,15 @@ bool Anvil::RenderPassInfo::add_dependency(SubPass* in_destination_s /* Please see header for specification */ bool Anvil::RenderPassInfo::add_depth_stencil_attachment(VkFormat in_format, - VkSampleCountFlags in_sample_count, - VkAttachmentLoadOp in_depth_load_op, - VkAttachmentStoreOp in_depth_store_op, - VkAttachmentLoadOp in_stencil_load_op, - VkAttachmentStoreOp in_stencil_store_op, - VkImageLayout in_initial_layout, - VkImageLayout in_final_layout, - bool in_may_alias, - RenderPassAttachmentID* out_attachment_id_ptr) + VkSampleCountFlags in_sample_count, + VkAttachmentLoadOp in_depth_load_op, + VkAttachmentStoreOp in_depth_store_op, + VkAttachmentLoadOp in_stencil_load_op, + VkAttachmentStoreOp in_stencil_store_op, + VkImageLayout in_initial_layout, + VkImageLayout in_final_layout, + bool in_may_alias, + RenderPassAttachmentID* out_attachment_id_ptr) { uint32_t new_attachment_index = UINT32_MAX; bool result = false; @@ -160,11 +160,11 @@ bool Anvil::RenderPassInfo::add_depth_stencil_attachment(VkFormat /* Please see header for specification */ bool Anvil::RenderPassInfo::add_external_to_subpass_dependency(SubPassID in_destination_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) + VkPipelineStageFlags in_source_stage_mask, + VkPipelineStageFlags in_destination_stage_mask, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region) { SubPass* destination_subpass_ptr = nullptr; bool result = false; @@ -191,11 +191,11 @@ bool Anvil::RenderPassInfo::add_external_to_subpass_dependency(SubPassID /* Please see header for specification */ bool Anvil::RenderPassInfo::add_self_subpass_dependency(SubPassID in_destination_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) + VkPipelineStageFlags in_source_stage_mask, + VkPipelineStageFlags in_destination_stage_mask, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region) { SubPass* destination_subpass_ptr = nullptr; bool result = false; @@ -275,12 +275,12 @@ bool Anvil::RenderPassInfo::add_subpass(SubPassID* out_subpass_id_ptr) * **/ bool Anvil::RenderPassInfo::add_subpass_attachment(SubPassID in_subpass_id, - bool in_is_color_attachment, - VkImageLayout in_layout, - RenderPassAttachmentID in_attachment_id, - uint32_t in_attachment_location, - bool in_should_resolve, - RenderPassAttachmentID in_resolve_attachment_id) + bool in_is_color_attachment, + VkImageLayout in_layout, + RenderPassAttachmentID in_attachment_id, + uint32_t in_attachment_location, + bool in_should_resolve, + RenderPassAttachmentID in_resolve_attachment_id) { RenderPassAttachment* renderpass_attachment_ptr = nullptr; RenderPassAttachment* resolve_attachment_ptr = nullptr; @@ -361,10 +361,10 @@ bool Anvil::RenderPassInfo::add_subpass_attachment(SubPassID in_sub /* Please see header for specification */ bool Anvil::RenderPassInfo::add_subpass_color_attachment(SubPassID in_subpass_id, - VkImageLayout in_input_layout, - RenderPassAttachmentID in_attachment_id, - uint32_t in_location, - const RenderPassAttachmentID* in_attachment_resolve_id_ptr) + VkImageLayout in_input_layout, + RenderPassAttachmentID in_attachment_id, + uint32_t in_location, + const RenderPassAttachmentID* in_attachment_resolve_id_ptr) { return add_subpass_attachment(in_subpass_id, true, /* is_color_attachment */ @@ -430,9 +430,9 @@ bool Anvil::RenderPassInfo::add_subpass_depth_stencil_attachment(SubPassID /* Please see header for specification */ bool Anvil::RenderPassInfo::add_subpass_input_attachment(SubPassID in_subpass_id, - VkImageLayout in_layout, - RenderPassAttachmentID in_attachment_id, - uint32_t in_attachment_index) + VkImageLayout in_layout, + RenderPassAttachmentID in_attachment_id, + uint32_t in_attachment_index) { return add_subpass_attachment(in_subpass_id, false, /* is_color_attachment */ @@ -445,11 +445,11 @@ bool Anvil::RenderPassInfo::add_subpass_input_attachment(SubPassID /* Please see header for specification */ bool Anvil::RenderPassInfo::add_subpass_to_external_dependency(SubPassID in_source_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) + VkPipelineStageFlags in_source_stage_mask, + VkPipelineStageFlags in_destination_stage_mask, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region) { bool result = false; SubPass* source_subpass_ptr = nullptr; @@ -476,12 +476,12 @@ bool Anvil::RenderPassInfo::add_subpass_to_external_dependency(SubPassID /* Please see header for specification */ bool Anvil::RenderPassInfo::add_subpass_to_subpass_dependency(SubPassID in_source_subpass_id, - SubPassID in_destination_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) + SubPassID in_destination_subpass_id, + VkPipelineStageFlags in_source_stage_mask, + VkPipelineStageFlags in_destination_stage_mask, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region) { SubPass* destination_subpass_ptr = nullptr; bool result = false; @@ -555,7 +555,7 @@ VkAttachmentReference Anvil::RenderPassInfo::get_attachment_reference_from_subpa * @return As per description. **/ VkAttachmentReference Anvil::RenderPassInfo::get_attachment_reference_for_resolve_attachment(const SubPassesConstIterator& in_subpass_iterator, - const LocationToSubPassAttachmentMapConstIterator& in_location_to_subpass_att_map_iterator) const + const LocationToSubPassAttachmentMapConstIterator& in_location_to_subpass_att_map_iterator) const { VkAttachmentReference result; @@ -737,7 +737,7 @@ bool Anvil::RenderPassInfo::get_depth_stencil_attachment_properties(RenderPassAt /* Please see header for specification */ bool Anvil::RenderPassInfo::get_subpass_n_attachments(SubPassID in_subpass_id, AttachmentType in_attachment_type, - uint32_t* out_n_attachments_ptr) + uint32_t* out_n_attachments_ptr) const { bool result = false; @@ -791,7 +791,7 @@ bool Anvil::RenderPassInfo::get_subpass_attachment_properties(SubPassID AttachmentType in_attachment_type, uint32_t in_n_subpass_attachment, RenderPassAttachmentID* out_renderpass_attachment_id_ptr, - VkImageLayout* out_layout_ptr) + VkImageLayout* out_layout_ptr) const { SubPassAttachment attachment; bool result = false; @@ -901,7 +901,7 @@ bool Anvil::RenderPassInfo::get_subpass_attachment_properties(SubPassID * * This function should be considered expensive. **/ -void Anvil::RenderPassInfo::update_preserved_attachments() +void Anvil::RenderPassInfo::update_preserved_attachments() const { anvil_assert(m_update_preserved_attachments); diff --git a/src/misc/shader_module_cache.cpp b/src/misc/shader_module_cache.cpp index a53f868c..4eb6d87f 100644 --- a/src/misc/shader_module_cache.cpp +++ b/src/misc/shader_module_cache.cpp @@ -38,7 +38,7 @@ Anvil::ShaderModuleCache::~ShaderModuleCache() } /** TODO */ -void Anvil::ShaderModuleCache::cache(std::shared_ptr in_shader_module_ptr) +void Anvil::ShaderModuleCache::cache(Anvil::ShaderModule* in_shader_module_ptr) { const auto shader_module_cs_entrypoint_name = in_shader_module_ptr->get_cs_entrypoint_name(); const auto shader_module_device_ptr = in_shader_module_ptr->get_parent_device (); @@ -63,10 +63,10 @@ void Anvil::ShaderModuleCache::cache(std::shared_ptr in_sha { std::unique_lock mutex_lock(*get_mutex() ); - auto items_map_iterator = m_items.find(hash); + auto items_map_iterator = m_item_ptrs.find(hash); bool should_store_new_item = false; - if (items_map_iterator == m_items.end() ) + if (items_map_iterator == m_item_ptrs.end() ) { /* No collision case */ should_store_new_item = true; @@ -79,20 +79,20 @@ void Anvil::ShaderModuleCache::cache(std::shared_ptr in_sha bool item_found = false; auto& item_list = items_map_iterator->second; - for (const auto& current_item : item_list) + for (const auto& current_item_ptr : item_list) { - if (current_item.matches(shader_module_device_ptr, - reinterpret_cast(&shader_module_spirv_blob.at(0) ), - static_cast(shader_module_spirv_blob.size() * sizeof(shader_module_spirv_blob.at(0) )), - shader_module_cs_entrypoint_name, - shader_module_fs_entrypoint_name, - shader_module_gs_entrypoint_name, - shader_module_tc_entrypoint_name, - shader_module_te_entrypoint_name, - shader_module_vs_entrypoint_name) ) + if (current_item_ptr->matches(shader_module_device_ptr, + reinterpret_cast(&shader_module_spirv_blob.at(0) ), + static_cast(shader_module_spirv_blob.size() * sizeof(shader_module_spirv_blob.at(0) )), + shader_module_cs_entrypoint_name, + shader_module_fs_entrypoint_name, + shader_module_gs_entrypoint_name, + shader_module_tc_entrypoint_name, + shader_module_te_entrypoint_name, + shader_module_vs_entrypoint_name) ) { /* This assertion check should never explode */ - anvil_assert(current_item.shader_module_ptr == in_shader_module_ptr); + anvil_assert(current_item_ptr->shader_module_owned_ptr.get() == in_shader_module_ptr); item_found = true; break; @@ -104,24 +104,29 @@ void Anvil::ShaderModuleCache::cache(std::shared_ptr in_sha if (should_store_new_item) { - auto new_item = HashMapItem(shader_module_device_ptr, - shader_module_spirv_blob, - shader_module_cs_entrypoint_name, - shader_module_fs_entrypoint_name, - shader_module_gs_entrypoint_name, - shader_module_tc_entrypoint_name, - shader_module_te_entrypoint_name, - shader_module_vs_entrypoint_name, - in_shader_module_ptr); - - m_items[hash].push_front(new_item); + std::unique_ptr new_item_ptr( + new HashMapItem(shader_module_device_ptr, + shader_module_spirv_blob, + shader_module_cs_entrypoint_name, + shader_module_fs_entrypoint_name, + shader_module_gs_entrypoint_name, + shader_module_tc_entrypoint_name, + shader_module_te_entrypoint_name, + shader_module_vs_entrypoint_name, + in_shader_module_ptr) + ); + + m_item_ptrs[hash].push_front( + std::move(new_item_ptr) + ); } } } -std::shared_ptr Anvil::ShaderModuleCache::create() +Anvil::ShaderModuleCacheUniquePtr Anvil::ShaderModuleCache::create() { - std::shared_ptr result_ptr; + ShaderModuleCacheUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::ShaderModuleCache() @@ -131,17 +136,17 @@ std::shared_ptr Anvil::ShaderModuleCache::create() } /** Please see header for documentation */ -std::shared_ptr Anvil::ShaderModuleCache::get_cached_shader_module(std::weak_ptr in_device_ptr, - const char* in_spirv_blob, - uint32_t in_n_spirv_blob_bytes, - const std::string& in_cs_entrypoint_name, - const std::string& in_fs_entrypoint_name, - const std::string& in_gs_entrypoint_name, - const std::string& in_tc_entrypoint_name, - const std::string& in_te_entrypoint_name, - const std::string& in_vs_entrypoint_name) +Anvil::ShaderModuleUniquePtr Anvil::ShaderModuleCache::get_cached_shader_module(const Anvil::BaseDevice* in_device_ptr, + const char* in_spirv_blob, + uint32_t in_n_spirv_blob_bytes, + const std::string& in_cs_entrypoint_name, + const std::string& in_fs_entrypoint_name, + const std::string& in_gs_entrypoint_name, + const std::string& in_tc_entrypoint_name, + const std::string& in_te_entrypoint_name, + const std::string& in_vs_entrypoint_name) { - std::shared_ptr result_ptr; + Anvil::ShaderModuleUniquePtr result_ptr; { std::unique_lock mutex_lock(*get_mutex() ); @@ -154,25 +159,32 @@ std::shared_ptr Anvil::ShaderModuleCache::get_cached_shader in_tc_entrypoint_name, in_te_entrypoint_name, in_vs_entrypoint_name) ); - auto items_map_iterator(m_items.find(hash) ); + auto items_map_iterator(m_item_ptrs.find(hash) ); - if (items_map_iterator != m_items.end() ) + if (items_map_iterator != m_item_ptrs.end() ) { const auto& items = items_map_iterator->second; - for (const auto& current_item : items) + for (const auto& current_item_ptr : items) { - if (current_item.matches(in_device_ptr, - in_spirv_blob, - in_n_spirv_blob_bytes, - in_cs_entrypoint_name, - in_fs_entrypoint_name, - in_gs_entrypoint_name, - in_tc_entrypoint_name, - in_te_entrypoint_name, - in_vs_entrypoint_name) ) + if (current_item_ptr->matches(in_device_ptr, + in_spirv_blob, + in_n_spirv_blob_bytes, + in_cs_entrypoint_name, + in_fs_entrypoint_name, + in_gs_entrypoint_name, + in_tc_entrypoint_name, + in_te_entrypoint_name, + in_vs_entrypoint_name) ) { - result_ptr = current_item.shader_module_ptr; + anvil_assert(current_item_ptr->shader_module_owned_ptr != nullptr); + anvil_assert(current_item_ptr->shader_module_owned_ptr->get_module() != VK_NULL_HANDLE); + + result_ptr = Anvil::ShaderModuleUniquePtr(current_item_ptr->shader_module_owned_ptr.get(), + [](ShaderModule*) + { + /* Stub */ + }); break; } } @@ -239,7 +251,7 @@ void Anvil::ShaderModuleCache::on_shader_module_object_registered(CallbackArgume auto shader_module_ptr = static_cast(callback_arg_ptr->object_raw_ptr); - cache(shader_module_ptr->shared_from_this() ); + cache(shader_module_ptr); } void Anvil::ShaderModuleCache::update_subscriptions(bool in_should_init) diff --git a/src/misc/types.cpp b/src/misc/types.cpp index 55a2dc55..31b2778e 100644 --- a/src/misc/types.cpp +++ b/src/misc/types.cpp @@ -20,8 +20,12 @@ // THE SOFTWARE. // +#include +#include #include "misc/debug.h" +#include "misc/descriptor_set_info.h" #include "wrappers/buffer.h" +#include "wrappers/descriptor_set_layout.h" #include "wrappers/device.h" #include "wrappers/image.h" #include "wrappers/memory_block.h" @@ -29,6 +33,13 @@ #include "wrappers/semaphore.h" #include "wrappers/shader_module.h" +#define BOOL_TO_VK_BOOL32(x) ((x) ? VK_TRUE : VK_FALSE); +#define VK_BOOL32_TO_BOOL(x) ((x == VK_FALSE) ? false : true) + +#ifdef max + #undef max +#endif + /** Please see header for specification */ Anvil::BufferBarrier::BufferBarrier(const BufferBarrier& in) { @@ -44,13 +55,13 @@ Anvil::BufferBarrier::BufferBarrier(const BufferBarrier& in) } /** Please see header for specification */ -Anvil::BufferBarrier::BufferBarrier(VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - uint32_t in_src_queue_family_index, - uint32_t in_dst_queue_family_index, - std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - VkDeviceSize in_size) +Anvil::BufferBarrier::BufferBarrier(VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + uint32_t in_src_queue_family_index, + uint32_t in_dst_queue_family_index, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkDeviceSize in_size) { buffer = in_buffer_ptr->get_buffer(); buffer_ptr = in_buffer_ptr; @@ -84,6 +95,28 @@ Anvil::BufferBarrier::~BufferBarrier() /* Stub */ } +Anvil::DescriptorSetAllocation::DescriptorSetAllocation(const Anvil::DescriptorSetLayout* in_ds_layout_ptr) +{ + anvil_assert( in_ds_layout_ptr != nullptr); + + ds_layout_ptr = in_ds_layout_ptr; +} + +/** Please see header for specification */ +VkDescriptorUpdateTemplateEntryKHR Anvil::DescriptorUpdateTemplateEntry::get_vk_descriptor_update_template_entry_khr() const +{ + VkDescriptorUpdateTemplateEntryKHR result; + + result.descriptorCount = n_descriptors; + result.descriptorType = descriptor_type; + result.dstArrayElement = n_destination_array_element; + result.dstBinding = n_destination_binding; + result.offset = offset; + result.stride = stride; + + return result; +} + /** Please see header for specification */ Anvil::DeviceExtensionConfiguration::DeviceExtensionConfiguration() { @@ -94,14 +127,19 @@ Anvil::DeviceExtensionConfiguration::DeviceExtensionConfiguration() amd_rasterization_order = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; amd_shader_ballot = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; amd_shader_explicit_vertex_parameter = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - amd_shader_info = EXTENSION_AVAILABILITY_IGNORE; + amd_shader_fragment_mask = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; + amd_shader_image_load_store_lod = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; + amd_shader_info = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; amd_shader_trinary_minmax = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; amd_texture_gather_bias_lod = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; ext_shader_stencil_export = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; ext_shader_subgroup_ballot = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; ext_shader_subgroup_vote = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; khr_16bit_storage = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; + khr_bind_memory2 = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; + khr_descriptor_update_template = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; khr_maintenance1 = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; + khr_maintenance3 = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; khr_storage_buffer_storage_class = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; khr_surface = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; khr_swapchain = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; @@ -125,8 +163,8 @@ Anvil::DeviceExtensionConfiguration::DeviceExtensionConfiguration() } /** Please see header for specification */ -bool Anvil::DeviceExtensionConfiguration::is_supported_by_physical_device(std::weak_ptr in_physical_device_ptr, - std::vector* out_opt_unsupported_extensions_ptr) const +bool Anvil::DeviceExtensionConfiguration::is_supported_by_physical_device(const Anvil::PhysicalDevice* in_physical_device_ptr, + std::vector* out_opt_unsupported_extensions_ptr) const { typedef struct ExtensionItem { @@ -141,9 +179,8 @@ bool Anvil::DeviceExtensionConfiguration::is_supported_by_physical_device(std::w } } ExtensionItem; - std::shared_ptr physical_device_locked_ptr(in_physical_device_ptr); - bool result (true); - std::vector extensions = + bool result = true; + std::vector extensions = { ExtensionItem(VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME, amd_draw_indirect_count == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem(VK_AMD_GCN_SHADER_EXTENSION_NAME, amd_gcn_shader == Anvil::EXTENSION_AVAILABILITY_REQUIRE), @@ -153,15 +190,20 @@ bool Anvil::DeviceExtensionConfiguration::is_supported_by_physical_device(std::w ExtensionItem(VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME, amd_rasterization_order == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem(VK_AMD_SHADER_BALLOT_EXTENSION_NAME, amd_shader_ballot == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem(VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME, amd_shader_explicit_vertex_parameter == Anvil::EXTENSION_AVAILABILITY_REQUIRE), + ExtensionItem(VK_AMD_SHADER_FRAGMENT_MASK_EXTENSION_NAME, amd_shader_fragment_mask == Anvil::EXTENSION_AVAILABILITY_REQUIRE), + ExtensionItem(VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_EXTENSION_NAME, amd_shader_image_load_store_lod == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem(VK_AMD_SHADER_INFO_EXTENSION_NAME, amd_shader_info == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem(VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME, amd_shader_trinary_minmax == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem(VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME, amd_texture_gather_bias_lod == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem(VK_EXT_DEBUG_MARKER_EXTENSION_NAME, ext_debug_marker == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem("VK_EXT_shader_stencil_export", ext_shader_stencil_export == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME, ext_shader_subgroup_vote == Anvil::EXTENSION_AVAILABILITY_REQUIRE), + ExtensionItem(VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME, ext_shader_subgroup_ballot == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem(VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME, ext_shader_subgroup_vote == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem(VK_KHR_16BIT_STORAGE_EXTENSION_NAME, khr_16bit_storage == Anvil::EXTENSION_AVAILABILITY_REQUIRE), + ExtensionItem(VK_KHR_BIND_MEMORY_2_EXTENSION_NAME, khr_bind_memory2 == Anvil::EXTENSION_AVAILABILITY_REQUIRE), + ExtensionItem(VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME, khr_descriptor_update_template == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem(VK_KHR_MAINTENANCE1_EXTENSION_NAME, khr_maintenance1 == Anvil::EXTENSION_AVAILABILITY_REQUIRE), + ExtensionItem(VK_KHR_MAINTENANCE3_EXTENSION_NAME, khr_maintenance3 == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem("VK_KHR_storage_buffer_storage_class", khr_storage_buffer_storage_class == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem(VK_KHR_SURFACE_EXTENSION_NAME, khr_surface == Anvil::EXTENSION_AVAILABILITY_REQUIRE), ExtensionItem(VK_KHR_SWAPCHAIN_EXTENSION_NAME, khr_swapchain == Anvil::EXTENSION_AVAILABILITY_REQUIRE) @@ -185,7 +227,7 @@ bool Anvil::DeviceExtensionConfiguration::is_supported_by_physical_device(std::w for (const auto& current_extension : extensions) { - if (!physical_device_locked_ptr->is_device_extension_supported(current_extension.extension_name) && + if (!in_physical_device_ptr->is_device_extension_supported(current_extension.extension_name) && current_extension.is_required) { result = false; @@ -216,13 +258,20 @@ bool Anvil::DeviceExtensionConfiguration::operator==(const Anvil::DeviceExtensio (amd_rasterization_order == in_config.amd_rasterization_order) && (amd_shader_ballot == in_config.amd_shader_ballot) && (amd_shader_explicit_vertex_parameter == in_config.amd_shader_explicit_vertex_parameter) && + (amd_shader_fragment_mask == in_config.amd_shader_fragment_mask) && + (amd_shader_image_load_store_lod == in_config.amd_shader_image_load_store_lod) && (amd_shader_info == in_config.amd_shader_info) && (amd_shader_trinary_minmax == in_config.amd_shader_trinary_minmax) && (amd_texture_gather_bias_lod == in_config.amd_texture_gather_bias_lod) && (ext_debug_marker == in_config.ext_debug_marker) && + (ext_shader_stencil_export == in_config.ext_shader_stencil_export) && (ext_shader_subgroup_ballot == in_config.ext_shader_subgroup_ballot) && (ext_shader_subgroup_vote == in_config.ext_shader_subgroup_vote) && (khr_16bit_storage == in_config.khr_16bit_storage) && + (khr_bind_memory2 == in_config.khr_bind_memory2) && + (khr_descriptor_update_template == in_config.khr_descriptor_update_template) && + (khr_maintenance1 == in_config.khr_maintenance1) && + (khr_maintenance3 == in_config.khr_maintenance3) && (khr_storage_buffer_storage_class == in_config.khr_storage_buffer_storage_class) && (khr_surface == in_config.khr_surface) && (khr_swapchain == in_config.khr_swapchain); @@ -272,15 +321,15 @@ Anvil::ImageBarrier::ImageBarrier(const ImageBarrier& in) } /** Please see header for specification */ -Anvil::ImageBarrier::ImageBarrier(VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region_barrier, - VkImageLayout in_old_layout, - VkImageLayout in_new_layout, - uint32_t in_src_queue_family_index, - uint32_t in_dst_queue_family_index, - std::shared_ptr in_image_ptr, - VkImageSubresourceRange in_image_subresource_range) +Anvil::ImageBarrier::ImageBarrier(VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region_barrier, + VkImageLayout in_old_layout, + VkImageLayout in_new_layout, + uint32_t in_src_queue_family_index, + uint32_t in_dst_queue_family_index, + Anvil::Image* in_image_ptr, + VkImageSubresourceRange in_image_subresource_range) { by_region = in_by_region_barrier; dst_access_mask = static_cast(in_destination_access_mask); @@ -319,6 +368,42 @@ Anvil::ImageBarrier::~ImageBarrier() /* Stub */ } +Anvil::KHR16BitStorageFeatures::KHR16BitStorageFeatures(const VkPhysicalDevice16BitStorageFeaturesKHR& in_features) +{ + is_input_output_storage_supported = VK_BOOL32_TO_BOOL(in_features.storageInputOutput16); + is_push_constant_16_bit_storage_supported = VK_BOOL32_TO_BOOL(in_features.storagePushConstant16); + is_storage_buffer_16_bit_access_supported = VK_BOOL32_TO_BOOL(in_features.storageBuffer16BitAccess); + is_uniform_and_storage_buffer_16_bit_access_supported = VK_BOOL32_TO_BOOL(in_features.uniformAndStorageBuffer16BitAccess); +} + +bool Anvil::KHR16BitStorageFeatures::operator==(const KHR16BitStorageFeatures& in_features) const +{ + return (in_features.is_input_output_storage_supported == is_input_output_storage_supported && + in_features.is_push_constant_16_bit_storage_supported == is_push_constant_16_bit_storage_supported && + in_features.is_storage_buffer_16_bit_access_supported == is_storage_buffer_16_bit_access_supported && + in_features.is_uniform_and_storage_buffer_16_bit_access_supported == is_uniform_and_storage_buffer_16_bit_access_supported); +} + +Anvil::KHRMaintenance3Properties::KHRMaintenance3Properties() + :max_memory_allocation_size(std::numeric_limits::max() ), + max_per_set_descriptors (UINT32_MAX) +{ + /* Stub */ +} + +Anvil::KHRMaintenance3Properties::KHRMaintenance3Properties(const VkPhysicalDeviceMaintenance3PropertiesKHR& in_props) + :max_memory_allocation_size(in_props.maxMemoryAllocationSize), + max_per_set_descriptors (in_props.maxPerSetDescriptors) +{ + /* Stub */ +} + +bool Anvil::KHRMaintenance3Properties::operator==(const Anvil::KHRMaintenance3Properties& in_props) const +{ + return (max_memory_allocation_size == in_props.max_memory_allocation_size && + max_per_set_descriptors == in_props.max_per_set_descriptors); +} + /* Please see header for specification */ bool Anvil::operator==(const MemoryProperties& in1, const MemoryProperties& in2) @@ -947,6 +1032,456 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_array_from_uchar_vect return result; } +Anvil::PhysicalDeviceLimits::PhysicalDeviceLimits() + :buffer_image_granularity (std::numeric_limits::max() ), + discrete_queue_priorities (UINT32_MAX), + framebuffer_color_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), + framebuffer_depth_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), + framebuffer_no_attachments_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), + framebuffer_stencil_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), + line_width_granularity (FLT_MAX), + max_bound_descriptor_sets (UINT32_MAX), + max_clip_distances (UINT32_MAX), + max_color_attachments (UINT32_MAX), + max_combined_clip_and_cull_distances (UINT32_MAX), + max_compute_shared_memory_size (UINT32_MAX), + max_compute_work_group_invocations (UINT32_MAX), + max_cull_distances (UINT32_MAX), + max_descriptor_set_input_attachments (UINT32_MAX), + max_descriptor_set_sampled_images (UINT32_MAX), + max_descriptor_set_samplers (UINT32_MAX), + max_descriptor_set_storage_buffers (UINT32_MAX), + max_descriptor_set_storage_buffers_dynamic (UINT32_MAX), + max_descriptor_set_storage_images (UINT32_MAX), + max_descriptor_set_uniform_buffers (UINT32_MAX), + max_descriptor_set_uniform_buffers_dynamic (UINT32_MAX), + max_draw_indexed_index_value (UINT32_MAX), + max_draw_indirect_count (UINT32_MAX), + max_fragment_combined_output_resources (UINT32_MAX), + max_fragment_dual_src_attachments (UINT32_MAX), + max_fragment_input_components (UINT32_MAX), + max_fragment_output_attachments (UINT32_MAX), + max_framebuffer_height (UINT32_MAX), + max_framebuffer_layers (UINT32_MAX), + max_framebuffer_width (UINT32_MAX), + max_geometry_input_components (UINT32_MAX), + max_geometry_output_components (UINT32_MAX), + max_geometry_output_vertices (UINT32_MAX), + max_geometry_shader_invocations (UINT32_MAX), + max_geometry_total_output_components (UINT32_MAX), + max_image_array_layers (UINT32_MAX), + max_image_dimension_1D (UINT32_MAX), + max_image_dimension_2D (UINT32_MAX), + max_image_dimension_3D (UINT32_MAX), + max_image_dimension_cube (UINT32_MAX), + max_interpolation_offset (FLT_MAX), + max_memory_allocation_count (UINT32_MAX), + max_per_stage_descriptor_input_attachments (UINT32_MAX), + max_per_stage_descriptor_sampled_images (UINT32_MAX), + max_per_stage_descriptor_samplers (UINT32_MAX), + max_per_stage_descriptor_storage_buffers (UINT32_MAX), + max_per_stage_descriptor_storage_images (UINT32_MAX), + max_per_stage_descriptor_uniform_buffers (UINT32_MAX), + max_per_stage_resources (UINT32_MAX), + max_push_constants_size (UINT32_MAX), + max_sample_mask_words (UINT32_MAX), + max_sampler_allocation_count (UINT32_MAX), + max_sampler_anisotropy (FLT_MAX), + max_sampler_lod_bias (FLT_MAX), + max_storage_buffer_range (UINT32_MAX), + max_viewports (UINT32_MAX), + max_tessellation_control_per_patch_output_components (UINT32_MAX), + max_tessellation_control_per_vertex_input_components (UINT32_MAX), + max_tessellation_control_per_vertex_output_components(UINT32_MAX), + max_tessellation_control_total_output_components (UINT32_MAX), + max_tessellation_evaluation_input_components (UINT32_MAX), + max_tessellation_evaluation_output_components (UINT32_MAX), + max_tessellation_generation_level (UINT32_MAX), + max_tessellation_patch_size (UINT32_MAX), + max_texel_buffer_elements (UINT32_MAX), + max_texel_gather_offset (UINT32_MAX), + max_texel_offset (UINT32_MAX), + max_uniform_buffer_range (UINT32_MAX), + max_vertex_input_attributes (UINT32_MAX), + max_vertex_input_attribute_offset (UINT32_MAX), + max_vertex_input_bindings (UINT32_MAX), + max_vertex_input_binding_stride (UINT32_MAX), + max_vertex_output_components (UINT32_MAX), + min_interpolation_offset (FLT_MAX), + min_memory_map_alignment (std::numeric_limits::max () ), + min_storage_buffer_offset_alignment (std::numeric_limits::max() ), + min_texel_buffer_offset_alignment (std::numeric_limits::max() ), + min_texel_gather_offset (INT32_MAX), + min_texel_offset (INT32_MAX), + min_uniform_buffer_offset_alignment (std::numeric_limits::max() ), + mipmap_precision_bits (UINT32_MAX), + non_coherent_atom_size (std::numeric_limits::max() ), + optimal_buffer_copy_offset_alignment (std::numeric_limits::max() ), + optimal_buffer_copy_row_pitch_alignment (std::numeric_limits::max() ), + point_size_granularity (FLT_MAX), + sampled_image_color_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), + sampled_image_depth_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), + sampled_image_integer_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), + sampled_image_stencil_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), + sparse_address_space_size (std::numeric_limits::max() ), + standard_sample_locations (false), + storage_image_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), + strict_lines (false), + sub_pixel_interpolation_offset_bits (UINT32_MAX), + sub_pixel_precision_bits (UINT32_MAX), + sub_texel_precision_bits (UINT32_MAX), + timestamp_compute_and_graphics (false), + timestamp_period (FLT_MAX), + viewport_sub_pixel_bits (UINT32_MAX) +{ + line_width_range[0] = FLT_MAX; + line_width_range[1] = FLT_MAX; + + max_compute_work_group_count[0] = UINT32_MAX; + max_compute_work_group_count[1] = UINT32_MAX; + max_compute_work_group_count[2] = UINT32_MAX; + + max_compute_work_group_size[0] = UINT32_MAX; + max_compute_work_group_size[1] = UINT32_MAX; + max_compute_work_group_size[2] = UINT32_MAX; + + max_viewport_dimensions[0] = UINT32_MAX; + max_viewport_dimensions[1] = UINT32_MAX; + + point_size_range[0] = FLT_MAX; + point_size_range[1] = FLT_MAX; + + viewport_bounds_range[0] = FLT_MAX; + viewport_bounds_range[1] = FLT_MAX; +} + +Anvil::PhysicalDeviceLimits::PhysicalDeviceLimits(const VkPhysicalDeviceLimits& in_device_limits) + :buffer_image_granularity (in_device_limits.bufferImageGranularity), + discrete_queue_priorities (in_device_limits.discreteQueuePriorities), + framebuffer_color_sample_counts (in_device_limits.framebufferColorSampleCounts), + framebuffer_depth_sample_counts (in_device_limits.framebufferDepthSampleCounts), + framebuffer_no_attachments_sample_counts (in_device_limits.framebufferNoAttachmentsSampleCounts), + framebuffer_stencil_sample_counts (in_device_limits.framebufferStencilSampleCounts), + line_width_granularity (in_device_limits.lineWidthGranularity), + max_bound_descriptor_sets (in_device_limits.maxBoundDescriptorSets), + max_clip_distances (in_device_limits.maxClipDistances), + max_color_attachments (in_device_limits.maxColorAttachments), + max_combined_clip_and_cull_distances (in_device_limits.maxCombinedClipAndCullDistances), + max_compute_shared_memory_size (in_device_limits.maxComputeSharedMemorySize), + max_compute_work_group_invocations (in_device_limits.maxComputeWorkGroupInvocations), + max_cull_distances (in_device_limits.maxCullDistances), + max_descriptor_set_input_attachments (in_device_limits.maxDescriptorSetInputAttachments), + max_descriptor_set_sampled_images (in_device_limits.maxDescriptorSetSampledImages), + max_descriptor_set_samplers (in_device_limits.maxDescriptorSetSamplers), + max_descriptor_set_storage_buffers (in_device_limits.maxDescriptorSetStorageBuffers), + max_descriptor_set_storage_buffers_dynamic (in_device_limits.maxDescriptorSetStorageBuffersDynamic), + max_descriptor_set_storage_images (in_device_limits.maxDescriptorSetStorageImages), + max_descriptor_set_uniform_buffers (in_device_limits.maxDescriptorSetUniformBuffers), + max_descriptor_set_uniform_buffers_dynamic (in_device_limits.maxDescriptorSetUniformBuffersDynamic), + max_draw_indexed_index_value (in_device_limits.maxDrawIndexedIndexValue), + max_draw_indirect_count (in_device_limits.maxDrawIndirectCount), + max_fragment_combined_output_resources (in_device_limits.maxFragmentCombinedOutputResources), + max_fragment_dual_src_attachments (in_device_limits.maxFragmentDualSrcAttachments), + max_fragment_input_components (in_device_limits.maxFragmentInputComponents), + max_fragment_output_attachments (in_device_limits.maxFragmentOutputAttachments), + max_framebuffer_height (in_device_limits.maxFramebufferHeight), + max_framebuffer_layers (in_device_limits.maxFramebufferLayers), + max_framebuffer_width (in_device_limits.maxFramebufferWidth), + max_geometry_input_components (in_device_limits.maxGeometryInputComponents), + max_geometry_output_components (in_device_limits.maxGeometryOutputComponents), + max_geometry_output_vertices (in_device_limits.maxGeometryOutputVertices), + max_geometry_shader_invocations (in_device_limits.maxGeometryShaderInvocations), + max_geometry_total_output_components (in_device_limits.maxGeometryTotalOutputComponents), + max_image_array_layers (in_device_limits.maxImageArrayLayers), + max_image_dimension_1D (in_device_limits.maxImageDimension1D), + max_image_dimension_2D (in_device_limits.maxImageDimension2D), + max_image_dimension_3D (in_device_limits.maxImageDimension3D), + max_image_dimension_cube (in_device_limits.maxImageDimensionCube), + max_interpolation_offset (in_device_limits.maxInterpolationOffset), + max_memory_allocation_count (in_device_limits.maxMemoryAllocationCount), + max_per_stage_descriptor_input_attachments (in_device_limits.maxPerStageDescriptorInputAttachments), + max_per_stage_descriptor_sampled_images (in_device_limits.maxPerStageDescriptorSampledImages), + max_per_stage_descriptor_samplers (in_device_limits.maxPerStageDescriptorSamplers), + max_per_stage_descriptor_storage_buffers (in_device_limits.maxPerStageDescriptorStorageBuffers), + max_per_stage_descriptor_storage_images (in_device_limits.maxPerStageDescriptorStorageImages), + max_per_stage_descriptor_uniform_buffers (in_device_limits.maxPerStageDescriptorUniformBuffers), + max_per_stage_resources (in_device_limits.maxPerStageResources), + max_push_constants_size (in_device_limits.maxPushConstantsSize), + max_sample_mask_words (in_device_limits.maxSampleMaskWords), + max_sampler_allocation_count (in_device_limits.maxSamplerAllocationCount), + max_sampler_anisotropy (in_device_limits.maxSamplerAnisotropy), + max_sampler_lod_bias (in_device_limits.maxSamplerLodBias), + max_storage_buffer_range (in_device_limits.maxStorageBufferRange), + max_viewports (in_device_limits.maxViewports), + max_tessellation_control_per_patch_output_components (in_device_limits.maxTessellationControlPerPatchOutputComponents), + max_tessellation_control_per_vertex_input_components (in_device_limits.maxTessellationControlPerVertexInputComponents), + max_tessellation_control_per_vertex_output_components(in_device_limits.maxTessellationControlPerVertexOutputComponents), + max_tessellation_control_total_output_components (in_device_limits.maxTessellationControlTotalOutputComponents), + max_tessellation_evaluation_input_components (in_device_limits.maxTessellationEvaluationInputComponents), + max_tessellation_evaluation_output_components (in_device_limits.maxTessellationEvaluationOutputComponents), + max_tessellation_generation_level (in_device_limits.maxTessellationGenerationLevel), + max_tessellation_patch_size (in_device_limits.maxTessellationPatchSize), + max_texel_buffer_elements (in_device_limits.maxTexelBufferElements), + max_texel_gather_offset (in_device_limits.maxTexelGatherOffset), + max_texel_offset (in_device_limits.maxTexelOffset), + max_uniform_buffer_range (in_device_limits.maxUniformBufferRange), + max_vertex_input_attributes (in_device_limits.maxVertexInputAttributes), + max_vertex_input_attribute_offset (in_device_limits.maxVertexInputAttributeOffset), + max_vertex_input_bindings (in_device_limits.maxVertexInputBindings), + max_vertex_input_binding_stride (in_device_limits.maxVertexInputBindingStride), + max_vertex_output_components (in_device_limits.maxVertexOutputComponents), + min_interpolation_offset (in_device_limits.minInterpolationOffset), + min_memory_map_alignment (in_device_limits.minMemoryMapAlignment), + min_storage_buffer_offset_alignment (in_device_limits.minStorageBufferOffsetAlignment), + min_texel_buffer_offset_alignment (in_device_limits.minTexelBufferOffsetAlignment), + min_texel_gather_offset (in_device_limits.minTexelGatherOffset), + min_texel_offset (in_device_limits.minTexelOffset), + min_uniform_buffer_offset_alignment (in_device_limits.minUniformBufferOffsetAlignment), + mipmap_precision_bits (in_device_limits.mipmapPrecisionBits), + non_coherent_atom_size (in_device_limits.nonCoherentAtomSize), + optimal_buffer_copy_offset_alignment (in_device_limits.optimalBufferCopyOffsetAlignment), + optimal_buffer_copy_row_pitch_alignment (in_device_limits.optimalBufferCopyRowPitchAlignment), + point_size_granularity (in_device_limits.pointSizeGranularity), + sampled_image_color_sample_counts (in_device_limits.sampledImageColorSampleCounts), + sampled_image_depth_sample_counts (in_device_limits.sampledImageDepthSampleCounts), + sampled_image_integer_sample_counts (in_device_limits.sampledImageIntegerSampleCounts), + sampled_image_stencil_sample_counts (in_device_limits.sampledImageStencilSampleCounts), + sparse_address_space_size (in_device_limits.sparseAddressSpaceSize), + standard_sample_locations (VK_BOOL32_TO_BOOL(in_device_limits.standardSampleLocations) ), + storage_image_sample_counts (in_device_limits.storageImageSampleCounts), + strict_lines (VK_BOOL32_TO_BOOL(in_device_limits.strictLines) ), + sub_pixel_interpolation_offset_bits (in_device_limits.subPixelInterpolationOffsetBits), + sub_pixel_precision_bits (in_device_limits.subPixelPrecisionBits), + sub_texel_precision_bits (in_device_limits.subTexelPrecisionBits), + timestamp_compute_and_graphics (VK_BOOL32_TO_BOOL(in_device_limits.timestampComputeAndGraphics) ), + timestamp_period (in_device_limits.timestampPeriod), + viewport_sub_pixel_bits (in_device_limits.viewportSubPixelBits) +{ + memcpy(line_width_range, + in_device_limits.lineWidthRange, + sizeof(line_width_range) ); + + memcpy(max_compute_work_group_count, + in_device_limits.maxComputeWorkGroupCount, + sizeof(max_compute_work_group_count) ); + + memcpy(max_compute_work_group_size, + in_device_limits.maxComputeWorkGroupSize, + sizeof(max_compute_work_group_size) ); + + memcpy(max_viewport_dimensions, + in_device_limits.maxViewportDimensions, + sizeof(max_viewport_dimensions) ); + + memcpy(point_size_range, + in_device_limits.pointSizeRange, + sizeof(point_size_range) ); + + memcpy(viewport_bounds_range, + in_device_limits.viewportBoundsRange, + sizeof(viewport_bounds_range) ); +} + +bool Anvil::PhysicalDeviceLimits::operator==(const Anvil::PhysicalDeviceLimits& in_device_limits) const +{ + bool result = false; + + if (buffer_image_granularity == in_device_limits.buffer_image_granularity && + discrete_queue_priorities == in_device_limits.discrete_queue_priorities && + framebuffer_color_sample_counts == in_device_limits.framebuffer_color_sample_counts && + framebuffer_depth_sample_counts == in_device_limits.framebuffer_depth_sample_counts && + framebuffer_no_attachments_sample_counts == in_device_limits.framebuffer_no_attachments_sample_counts && + framebuffer_stencil_sample_counts == in_device_limits.framebuffer_stencil_sample_counts && + max_bound_descriptor_sets == in_device_limits.max_bound_descriptor_sets && + max_clip_distances == in_device_limits.max_clip_distances && + max_color_attachments == in_device_limits.max_color_attachments && + max_combined_clip_and_cull_distances == in_device_limits.max_combined_clip_and_cull_distances && + max_compute_shared_memory_size == in_device_limits.max_compute_shared_memory_size && + max_compute_work_group_count[0] == in_device_limits.max_compute_work_group_count[0] && + max_compute_work_group_count[1] == in_device_limits.max_compute_work_group_count[1] && + max_compute_work_group_count[2] == in_device_limits.max_compute_work_group_count[2] && + max_compute_work_group_invocations == in_device_limits.max_compute_work_group_invocations && + max_compute_work_group_size[0] == in_device_limits.max_compute_work_group_size[0] && + max_compute_work_group_size[1] == in_device_limits.max_compute_work_group_size[1] && + max_compute_work_group_size[2] == in_device_limits.max_compute_work_group_size[2] && + max_cull_distances == in_device_limits.max_cull_distances && + max_descriptor_set_input_attachments == in_device_limits.max_descriptor_set_input_attachments && + max_descriptor_set_sampled_images == in_device_limits.max_descriptor_set_sampled_images && + max_descriptor_set_samplers == in_device_limits.max_descriptor_set_samplers && + max_descriptor_set_storage_buffers == in_device_limits.max_descriptor_set_storage_buffers && + max_descriptor_set_storage_buffers_dynamic == in_device_limits.max_descriptor_set_storage_buffers_dynamic && + max_descriptor_set_storage_images == in_device_limits.max_descriptor_set_storage_images && + max_descriptor_set_uniform_buffers == in_device_limits.max_descriptor_set_uniform_buffers && + max_descriptor_set_uniform_buffers_dynamic == in_device_limits.max_descriptor_set_uniform_buffers_dynamic && + max_draw_indexed_index_value == in_device_limits.max_draw_indexed_index_value && + max_draw_indirect_count == in_device_limits.max_draw_indirect_count && + max_fragment_combined_output_resources == in_device_limits.max_fragment_combined_output_resources && + max_fragment_dual_src_attachments == in_device_limits.max_fragment_dual_src_attachments && + max_fragment_input_components == in_device_limits.max_fragment_input_components && + max_fragment_output_attachments == in_device_limits.max_fragment_output_attachments && + max_framebuffer_height == in_device_limits.max_framebuffer_height && + max_framebuffer_layers == in_device_limits.max_framebuffer_layers && + max_framebuffer_width == in_device_limits.max_framebuffer_width && + max_geometry_input_components == in_device_limits.max_geometry_input_components && + max_geometry_output_components == in_device_limits.max_geometry_output_components && + max_geometry_output_vertices == in_device_limits.max_geometry_output_vertices && + max_geometry_shader_invocations == in_device_limits.max_geometry_shader_invocations && + max_geometry_total_output_components == in_device_limits.max_geometry_total_output_components && + max_image_array_layers == in_device_limits.max_image_array_layers && + max_image_dimension_1D == in_device_limits.max_image_dimension_1D && + max_image_dimension_2D == in_device_limits.max_image_dimension_2D && + max_image_dimension_3D == in_device_limits.max_image_dimension_3D && + max_image_dimension_cube == in_device_limits.max_image_dimension_cube && + max_memory_allocation_count == in_device_limits.max_memory_allocation_count && + max_per_stage_descriptor_input_attachments == in_device_limits.max_per_stage_descriptor_input_attachments && + max_per_stage_descriptor_sampled_images == in_device_limits.max_per_stage_descriptor_sampled_images && + max_per_stage_descriptor_samplers == in_device_limits.max_per_stage_descriptor_samplers && + max_per_stage_descriptor_storage_buffers == in_device_limits.max_per_stage_descriptor_storage_buffers && + max_per_stage_descriptor_storage_images == in_device_limits.max_per_stage_descriptor_storage_images && + max_per_stage_descriptor_uniform_buffers == in_device_limits.max_per_stage_descriptor_uniform_buffers && + max_per_stage_resources == in_device_limits.max_per_stage_resources && + max_push_constants_size == in_device_limits.max_push_constants_size && + max_sample_mask_words == in_device_limits.max_sample_mask_words && + max_sampler_allocation_count == in_device_limits.max_sampler_allocation_count && + max_storage_buffer_range == in_device_limits.max_storage_buffer_range && + max_viewport_dimensions[0] == in_device_limits.max_viewport_dimensions[0] && + max_viewport_dimensions[1] == in_device_limits.max_viewport_dimensions[1] && + max_viewports == in_device_limits.max_viewports && + max_tessellation_control_per_patch_output_components == in_device_limits.max_tessellation_control_per_patch_output_components && + max_tessellation_control_per_vertex_input_components == in_device_limits.max_tessellation_control_per_vertex_input_components && + max_tessellation_control_per_vertex_output_components == in_device_limits.max_tessellation_control_per_vertex_output_components && + max_tessellation_control_total_output_components == in_device_limits.max_tessellation_control_total_output_components && + max_tessellation_evaluation_input_components == in_device_limits.max_tessellation_evaluation_input_components && + max_tessellation_evaluation_output_components == in_device_limits.max_tessellation_evaluation_output_components && + max_tessellation_generation_level == in_device_limits.max_tessellation_generation_level && + max_tessellation_patch_size == in_device_limits.max_tessellation_patch_size && + max_texel_buffer_elements == in_device_limits.max_texel_buffer_elements && + max_texel_gather_offset == in_device_limits.max_texel_gather_offset && + max_texel_offset == in_device_limits.max_texel_offset && + max_uniform_buffer_range == in_device_limits.max_uniform_buffer_range && + max_vertex_input_attributes == in_device_limits.max_vertex_input_attributes && + max_vertex_input_attribute_offset == in_device_limits.max_vertex_input_attribute_offset && + max_vertex_input_bindings == in_device_limits.max_vertex_input_bindings && + max_vertex_input_binding_stride == in_device_limits.max_vertex_input_binding_stride && + max_vertex_output_components == in_device_limits.max_vertex_output_components && + min_memory_map_alignment == in_device_limits.min_memory_map_alignment && + min_storage_buffer_offset_alignment == in_device_limits.min_storage_buffer_offset_alignment && + min_texel_buffer_offset_alignment == in_device_limits.min_texel_buffer_offset_alignment && + min_texel_gather_offset == in_device_limits.min_texel_gather_offset && + min_texel_offset == in_device_limits.min_texel_offset && + min_uniform_buffer_offset_alignment == in_device_limits.min_uniform_buffer_offset_alignment && + mipmap_precision_bits == in_device_limits.mipmap_precision_bits && + non_coherent_atom_size == in_device_limits.non_coherent_atom_size && + optimal_buffer_copy_offset_alignment == in_device_limits.optimal_buffer_copy_offset_alignment && + optimal_buffer_copy_row_pitch_alignment == in_device_limits.optimal_buffer_copy_row_pitch_alignment && + sampled_image_color_sample_counts == in_device_limits.sampled_image_color_sample_counts && + sampled_image_depth_sample_counts == in_device_limits.sampled_image_depth_sample_counts && + sampled_image_integer_sample_counts == in_device_limits.sampled_image_integer_sample_counts && + sampled_image_stencil_sample_counts == in_device_limits.sampled_image_stencil_sample_counts && + sparse_address_space_size == in_device_limits.sparse_address_space_size && + standard_sample_locations == in_device_limits.standard_sample_locations && + storage_image_sample_counts == in_device_limits.storage_image_sample_counts && + strict_lines == in_device_limits.strict_lines && + sub_pixel_interpolation_offset_bits == in_device_limits.sub_pixel_interpolation_offset_bits && + sub_pixel_precision_bits == in_device_limits.sub_pixel_precision_bits && + sub_texel_precision_bits == in_device_limits.sub_texel_precision_bits && + timestamp_compute_and_graphics == in_device_limits.timestamp_compute_and_graphics && + viewport_sub_pixel_bits == in_device_limits.viewport_sub_pixel_bits) + { + /* Floats */ + if (fabs(line_width_range[0] - in_device_limits.line_width_range[0]) < 1e-5f && + fabs(line_width_range[1] - in_device_limits.line_width_range[1]) < 1e-5f && + fabs(line_width_granularity - in_device_limits.line_width_granularity) < 1e-5f && + fabs(max_interpolation_offset - in_device_limits.max_interpolation_offset) < 1e-5f && + fabs(max_sampler_anisotropy - in_device_limits.max_sampler_anisotropy) < 1e-5f && + fabs(max_sampler_lod_bias - in_device_limits.max_sampler_lod_bias) < 1e-5f && + fabs(min_interpolation_offset - in_device_limits.min_interpolation_offset) < 1e-5f && + fabs(point_size_granularity - in_device_limits.point_size_granularity) < 1e-5f && + fabs(point_size_range[0] - in_device_limits.point_size_range[0]) < 1e-5f && + fabs(point_size_range[1] - in_device_limits.point_size_range[1]) < 1e-5f && + fabs(timestamp_period - in_device_limits.timestamp_period) < 1e-5f && + fabs(viewport_bounds_range[0] - in_device_limits.viewport_bounds_range[0]) < 1e-5f && + fabs(viewport_bounds_range[1] - in_device_limits.viewport_bounds_range[1]) < 1e-5f) + { + result = true; + } + } + + return result; +} + +Anvil::PhysicalDevicePropertiesCoreVK10::PhysicalDevicePropertiesCoreVK10(const VkPhysicalDeviceProperties& in_physical_device_properties) + :api_version (in_physical_device_properties.apiVersion), + device_id (in_physical_device_properties.deviceID), + device_type (in_physical_device_properties.deviceType), + driver_version (in_physical_device_properties.driverVersion), + limits (PhysicalDeviceLimits (in_physical_device_properties.limits) ), + sparse_properties(PhysicalDeviceSparseProperties(in_physical_device_properties.sparseProperties) ), + vendor_id (in_physical_device_properties.vendorID) +{ + memcpy(device_name, + in_physical_device_properties.deviceName, + sizeof(device_name) ); + memcpy(pipeline_cache_uuid, + in_physical_device_properties.pipelineCacheUUID, + sizeof(pipeline_cache_uuid) ); +} + +bool Anvil::PhysicalDevicePropertiesCoreVK10::operator==(const PhysicalDevicePropertiesCoreVK10& in_props) const +{ + bool result = false; + + if (in_props.api_version == api_version && + in_props.device_id == device_id && + in_props.device_type == device_type && + in_props.driver_version == driver_version && + in_props.limits == limits && + in_props.sparse_properties == sparse_properties && + in_props.vendor_id == vendor_id) + { + if (memcmp(device_name, + in_props.device_name, + sizeof(device_name) ) == 0 && + memcmp(pipeline_cache_uuid, + in_props.pipeline_cache_uuid, + sizeof(pipeline_cache_uuid) ) == 0) + { + result = true; + } + } + + return result; +} + +Anvil::PhysicalDeviceSparseProperties::PhysicalDeviceSparseProperties() + :residency_standard_2D_block_shape (false), + residency_standard_2D_multisample_block_shape(false), + residency_standard_3D_block_shape (false), + residency_aligned_mip_size (false), + residency_non_resident_strict (false) +{ + /* Stub */ +} + +Anvil::PhysicalDeviceSparseProperties::PhysicalDeviceSparseProperties(const VkPhysicalDeviceSparseProperties& in_sparse_props) + :residency_standard_2D_block_shape (VK_BOOL32_TO_BOOL(in_sparse_props.residencyStandard2DBlockShape) ), + residency_standard_2D_multisample_block_shape(VK_BOOL32_TO_BOOL(in_sparse_props.residencyStandard2DMultisampleBlockShape) ), + residency_standard_3D_block_shape (VK_BOOL32_TO_BOOL(in_sparse_props.residencyStandard3DBlockShape) ), + residency_aligned_mip_size (VK_BOOL32_TO_BOOL(in_sparse_props.residencyAlignedMipSize) ), + residency_non_resident_strict (VK_BOOL32_TO_BOOL(in_sparse_props.residencyNonResidentStrict) ) +{ + /* Stub */ +} + +bool Anvil::PhysicalDeviceSparseProperties::operator==(const Anvil::PhysicalDeviceSparseProperties& in_props) const +{ + return (residency_standard_2D_block_shape == in_props.residency_standard_2D_block_shape && + residency_standard_2D_multisample_block_shape == in_props.residency_standard_2D_multisample_block_shape && + residency_standard_3D_block_shape == in_props.residency_standard_3D_block_shape && + residency_aligned_mip_size == in_props.residency_aligned_mip_size && + residency_non_resident_strict == in_props.residency_non_resident_strict); +} + /** Please see header for specification */ bool Anvil::operator==(const Anvil::QueueFamilyInfo& in1, const Anvil::QueueFamilyInfo& in2) @@ -962,13 +1497,14 @@ bool Anvil::operator==(const Anvil::QueueFamilyInfo& in1, /** Please see header for specification */ Anvil::ShaderModuleStageEntryPoint::ShaderModuleStageEntryPoint() { - stage = SHADER_STAGE_UNKNOWN; + shader_module_ptr = nullptr; + stage = SHADER_STAGE_UNKNOWN; } /** Please see header for specification */ -Anvil::ShaderModuleStageEntryPoint::ShaderModuleStageEntryPoint(const std::string& in_name, - std::shared_ptr in_shader_module_ptr, - ShaderStage in_stage) +Anvil::ShaderModuleStageEntryPoint::ShaderModuleStageEntryPoint(const std::string& in_name, + ShaderModule* in_shader_module_ptr, + ShaderStage in_stage) { anvil_assert(in_shader_module_ptr != nullptr); @@ -977,6 +1513,19 @@ Anvil::ShaderModuleStageEntryPoint::ShaderModuleStageEntryPoint(const std::strin stage = in_stage; } +Anvil::ShaderModuleStageEntryPoint::ShaderModuleStageEntryPoint(const std::string& in_name, + ShaderModuleUniquePtr in_shader_module_ptr, + ShaderStage in_stage) +{ + anvil_assert(in_shader_module_ptr != nullptr); + + name = in_name; + shader_module_ptr = in_shader_module_ptr.get(); + stage = in_stage; + + shader_module_owned_ptr = std::move(in_shader_module_ptr); +} + /** Please see header for specification */ Anvil::ShaderModuleStageEntryPoint::ShaderModuleStageEntryPoint(const ShaderModuleStageEntryPoint& in) { @@ -1007,11 +1556,294 @@ Anvil::Utils::SparseMemoryBindingUpdateInfo::SparseMemoryBindingUpdateInfo() m_dirty = true; } +bool Anvil::PhysicalDeviceFeatures::operator==(const PhysicalDeviceFeatures& in_physical_device_features) const +{ + const bool core_vk1_0_features_match = (*core_vk1_0_features_ptr == *in_physical_device_features.core_vk1_0_features_ptr); + bool khr_16bit_storage_features_match = false; + + if (khr_16bit_storage_features_ptr != nullptr && + in_physical_device_features.khr_16bit_storage_features_ptr != nullptr) + { + khr_16bit_storage_features_match = (*khr_16bit_storage_features_ptr == *in_physical_device_features.khr_16bit_storage_features_ptr); + } + else + { + khr_16bit_storage_features_match = (khr_16bit_storage_features_ptr == nullptr && + in_physical_device_features.khr_16bit_storage_features_ptr == nullptr); + } + + return core_vk1_0_features_match && + khr_16bit_storage_features_match; +} + +Anvil::PhysicalDeviceFeaturesCoreVK10::PhysicalDeviceFeaturesCoreVK10() + :alpha_to_one (false), + depth_bias_clamp (false), + depth_bounds (false), + depth_clamp (false), + draw_indirect_first_instance (false), + dual_src_blend (false), + fill_mode_non_solid (false), + fragment_stores_and_atomics (false), + full_draw_index_uint32 (false), + geometry_shader (false), + image_cube_array (false), + independent_blend (false), + inherited_queries (false), + large_points (false), + logic_ip (false), + multi_draw_indirect (false), + multi_viewport (false), + occlusion_query_precise (false), + pipeline_statistics_query (false), + robust_buffer_access (false), + sampler_anisotropy (false), + sample_rate_shading (false), + shader_clip_distance (false), + shader_cull_distance (false), + shader_float64 (false), + shader_image_gather_extended (false), + shader_int16 (false), + shader_int64 (false), + shader_resource_residency (false), + shader_resource_min_lod (false), + shader_sampled_image_array_dynamic_indexing (false), + shader_storage_buffer_array_dynamic_indexing(false), + shader_storage_image_array_dynamic_indexing (false), + shader_storage_image_extended_formats (false), + shader_storage_image_multisample (false), + shader_storage_image_read_without_format (false), + shader_storage_image_write_without_format (false), + shader_tessellation_and_geometry_point_size (false), + shader_uniform_buffer_array_dynamic_indexing(false), + sparse_binding (false), + sparse_residency_2_samples (false), + sparse_residency_4_samples (false), + sparse_residency_8_samples (false), + sparse_residency_16_samples (false), + sparse_residency_aliased (false), + sparse_residency_buffer (false), + sparse_residency_image_2D (false), + sparse_residency_image_3D (false), + tessellation_shader (false), + texture_compression_ASTC_LDR (false), + texture_compression_BC (false), + texture_compression_ETC2 (false), + variable_multisample_rate (false), + vertex_pipeline_stores_and_atomics (false), + wide_lines (false) +{ + /* Stub */ +} + +Anvil::PhysicalDeviceFeaturesCoreVK10::PhysicalDeviceFeaturesCoreVK10(const VkPhysicalDeviceFeatures& in_physical_device_features) + :alpha_to_one (VK_BOOL32_TO_BOOL(in_physical_device_features.alphaToOne) ), + depth_bias_clamp (VK_BOOL32_TO_BOOL(in_physical_device_features.depthBiasClamp) ), + depth_bounds (VK_BOOL32_TO_BOOL(in_physical_device_features.depthBounds) ), + depth_clamp (VK_BOOL32_TO_BOOL(in_physical_device_features.depthClamp) ), + draw_indirect_first_instance (VK_BOOL32_TO_BOOL(in_physical_device_features.drawIndirectFirstInstance) ), + dual_src_blend (VK_BOOL32_TO_BOOL(in_physical_device_features.dualSrcBlend) ), + fill_mode_non_solid (VK_BOOL32_TO_BOOL(in_physical_device_features.fillModeNonSolid) ), + fragment_stores_and_atomics (VK_BOOL32_TO_BOOL(in_physical_device_features.fragmentStoresAndAtomics) ), + full_draw_index_uint32 (VK_BOOL32_TO_BOOL(in_physical_device_features.fullDrawIndexUint32) ), + geometry_shader (VK_BOOL32_TO_BOOL(in_physical_device_features.geometryShader) ), + image_cube_array (VK_BOOL32_TO_BOOL(in_physical_device_features.imageCubeArray) ), + independent_blend (VK_BOOL32_TO_BOOL(in_physical_device_features.independentBlend) ), + inherited_queries (VK_BOOL32_TO_BOOL(in_physical_device_features.inheritedQueries) ), + large_points (VK_BOOL32_TO_BOOL(in_physical_device_features.largePoints) ), + logic_ip (VK_BOOL32_TO_BOOL(in_physical_device_features.logicOp) ), + multi_draw_indirect (VK_BOOL32_TO_BOOL(in_physical_device_features.multiDrawIndirect) ), + multi_viewport (VK_BOOL32_TO_BOOL(in_physical_device_features.multiViewport) ), + occlusion_query_precise (VK_BOOL32_TO_BOOL(in_physical_device_features.occlusionQueryPrecise) ), + pipeline_statistics_query (VK_BOOL32_TO_BOOL(in_physical_device_features.pipelineStatisticsQuery) ), + robust_buffer_access (VK_BOOL32_TO_BOOL(in_physical_device_features.robustBufferAccess) ), + sampler_anisotropy (VK_BOOL32_TO_BOOL(in_physical_device_features.samplerAnisotropy) ), + sample_rate_shading (VK_BOOL32_TO_BOOL(in_physical_device_features.sampleRateShading) ), + shader_clip_distance (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderClipDistance) ), + shader_cull_distance (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderCullDistance) ), + shader_float64 (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderFloat64) ), + shader_image_gather_extended (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderImageGatherExtended) ), + shader_int16 (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderInt16) ), + shader_int64 (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderInt64) ), + shader_resource_residency (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderResourceResidency) ), + shader_resource_min_lod (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderResourceMinLod) ), + shader_sampled_image_array_dynamic_indexing (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderSampledImageArrayDynamicIndexing) ), + shader_storage_buffer_array_dynamic_indexing(VK_BOOL32_TO_BOOL(in_physical_device_features.shaderStorageBufferArrayDynamicIndexing) ), + shader_storage_image_array_dynamic_indexing (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderStorageImageArrayDynamicIndexing) ), + shader_storage_image_extended_formats (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderStorageImageExtendedFormats) ), + shader_storage_image_multisample (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderStorageImageMultisample) ), + shader_storage_image_read_without_format (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderStorageImageReadWithoutFormat) ), + shader_storage_image_write_without_format (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderStorageImageWriteWithoutFormat) ), + shader_tessellation_and_geometry_point_size (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderTessellationAndGeometryPointSize) ), + shader_uniform_buffer_array_dynamic_indexing(VK_BOOL32_TO_BOOL(in_physical_device_features.shaderUniformBufferArrayDynamicIndexing) ), + sparse_binding (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseBinding) ), + sparse_residency_2_samples (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidency2Samples) ), + sparse_residency_4_samples (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidency4Samples) ), + sparse_residency_8_samples (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidency8Samples) ), + sparse_residency_16_samples (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidency16Samples) ), + sparse_residency_aliased (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidencyAliased) ), + sparse_residency_buffer (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidencyBuffer) ), + sparse_residency_image_2D (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidencyImage2D) ), + sparse_residency_image_3D (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidencyImage3D) ), + tessellation_shader (VK_BOOL32_TO_BOOL(in_physical_device_features.tessellationShader) ), + texture_compression_ASTC_LDR (VK_BOOL32_TO_BOOL(in_physical_device_features.textureCompressionASTC_LDR) ), + texture_compression_BC (VK_BOOL32_TO_BOOL(in_physical_device_features.textureCompressionBC) ), + texture_compression_ETC2 (VK_BOOL32_TO_BOOL(in_physical_device_features.textureCompressionETC2) ), + variable_multisample_rate (VK_BOOL32_TO_BOOL(in_physical_device_features.variableMultisampleRate) ), + vertex_pipeline_stores_and_atomics (VK_BOOL32_TO_BOOL(in_physical_device_features.vertexPipelineStoresAndAtomics) ), + wide_lines (VK_BOOL32_TO_BOOL(in_physical_device_features.wideLines) ) +{ + /* Stub */ +} + +VkPhysicalDeviceFeatures Anvil::PhysicalDeviceFeaturesCoreVK10::get_vk_physical_device_features() const +{ + VkPhysicalDeviceFeatures result; + + result.alphaToOne = BOOL_TO_VK_BOOL32(alpha_to_one); + result.depthBiasClamp = BOOL_TO_VK_BOOL32(depth_bias_clamp); + result.depthBounds = BOOL_TO_VK_BOOL32(depth_bounds); + result.depthClamp = BOOL_TO_VK_BOOL32(depth_clamp); + result.drawIndirectFirstInstance = BOOL_TO_VK_BOOL32(draw_indirect_first_instance); + result.dualSrcBlend = BOOL_TO_VK_BOOL32(dual_src_blend); + result.fillModeNonSolid = BOOL_TO_VK_BOOL32(fill_mode_non_solid); + result.fragmentStoresAndAtomics = BOOL_TO_VK_BOOL32(fragment_stores_and_atomics); + result.fullDrawIndexUint32 = BOOL_TO_VK_BOOL32(full_draw_index_uint32); + result.geometryShader = BOOL_TO_VK_BOOL32(geometry_shader); + result.imageCubeArray = BOOL_TO_VK_BOOL32(image_cube_array); + result.independentBlend = BOOL_TO_VK_BOOL32(independent_blend); + result.inheritedQueries = BOOL_TO_VK_BOOL32(inherited_queries); + result.largePoints = BOOL_TO_VK_BOOL32(large_points); + result.logicOp = BOOL_TO_VK_BOOL32(logic_ip); + result.multiDrawIndirect = BOOL_TO_VK_BOOL32(multi_draw_indirect); + result.multiViewport = BOOL_TO_VK_BOOL32(multi_viewport); + result.occlusionQueryPrecise = BOOL_TO_VK_BOOL32(occlusion_query_precise); + result.pipelineStatisticsQuery = BOOL_TO_VK_BOOL32(pipeline_statistics_query); + result.robustBufferAccess = BOOL_TO_VK_BOOL32(robust_buffer_access); + result.samplerAnisotropy = BOOL_TO_VK_BOOL32(sampler_anisotropy); + result.sampleRateShading = BOOL_TO_VK_BOOL32(sample_rate_shading); + result.shaderClipDistance = BOOL_TO_VK_BOOL32(shader_clip_distance); + result.shaderCullDistance = BOOL_TO_VK_BOOL32(shader_cull_distance); + result.shaderFloat64 = BOOL_TO_VK_BOOL32(shader_float64); + result.shaderImageGatherExtended = BOOL_TO_VK_BOOL32(shader_image_gather_extended); + result.shaderInt16 = BOOL_TO_VK_BOOL32(shader_int16); + result.shaderInt64 = BOOL_TO_VK_BOOL32(shader_int64); + result.shaderResourceResidency = BOOL_TO_VK_BOOL32(shader_resource_residency); + result.shaderResourceMinLod = BOOL_TO_VK_BOOL32(shader_resource_min_lod); + result.shaderSampledImageArrayDynamicIndexing = BOOL_TO_VK_BOOL32(shader_sampled_image_array_dynamic_indexing); + result.shaderStorageBufferArrayDynamicIndexing = BOOL_TO_VK_BOOL32(shader_storage_buffer_array_dynamic_indexing); + result.shaderStorageImageArrayDynamicIndexing = BOOL_TO_VK_BOOL32(shader_storage_image_array_dynamic_indexing); + result.shaderStorageImageExtendedFormats = BOOL_TO_VK_BOOL32(shader_storage_image_extended_formats); + result.shaderStorageImageMultisample = BOOL_TO_VK_BOOL32(shader_storage_image_multisample); + result.shaderStorageImageReadWithoutFormat = BOOL_TO_VK_BOOL32(shader_storage_image_read_without_format); + result.shaderStorageImageWriteWithoutFormat = BOOL_TO_VK_BOOL32(shader_storage_image_write_without_format); + result.shaderTessellationAndGeometryPointSize = BOOL_TO_VK_BOOL32(shader_tessellation_and_geometry_point_size); + result.shaderUniformBufferArrayDynamicIndexing = BOOL_TO_VK_BOOL32(shader_uniform_buffer_array_dynamic_indexing); + result.sparseBinding = BOOL_TO_VK_BOOL32(sparse_binding); + result.sparseResidency2Samples = BOOL_TO_VK_BOOL32(sparse_residency_2_samples); + result.sparseResidency4Samples = BOOL_TO_VK_BOOL32(sparse_residency_4_samples); + result.sparseResidency8Samples = BOOL_TO_VK_BOOL32(sparse_residency_8_samples); + result.sparseResidency16Samples = BOOL_TO_VK_BOOL32(sparse_residency_16_samples); + result.sparseResidencyAliased = BOOL_TO_VK_BOOL32(sparse_residency_aliased); + result.sparseResidencyBuffer = BOOL_TO_VK_BOOL32(sparse_residency_buffer); + result.sparseResidencyImage2D = BOOL_TO_VK_BOOL32(sparse_residency_image_2D); + result.sparseResidencyImage3D = BOOL_TO_VK_BOOL32(sparse_residency_image_3D); + result.tessellationShader = BOOL_TO_VK_BOOL32(tessellation_shader); + result.textureCompressionASTC_LDR = BOOL_TO_VK_BOOL32(texture_compression_ASTC_LDR); + result.textureCompressionBC = BOOL_TO_VK_BOOL32(texture_compression_BC); + result.textureCompressionETC2 = BOOL_TO_VK_BOOL32(texture_compression_ETC2); + result.variableMultisampleRate = BOOL_TO_VK_BOOL32(variable_multisample_rate); + result.vertexPipelineStoresAndAtomics = BOOL_TO_VK_BOOL32(vertex_pipeline_stores_and_atomics); + result.wideLines = BOOL_TO_VK_BOOL32(wide_lines); + + return result; +} + +bool Anvil::PhysicalDeviceFeaturesCoreVK10::operator==(const Anvil::PhysicalDeviceFeaturesCoreVK10& in_data) const +{ + return (alpha_to_one == in_data.alpha_to_one) && + (depth_bias_clamp == in_data.depth_bias_clamp) && + (depth_bounds == in_data.depth_bounds) && + (depth_clamp == in_data.depth_clamp) && + (draw_indirect_first_instance == in_data.draw_indirect_first_instance) && + (dual_src_blend == in_data.dual_src_blend) && + (fill_mode_non_solid == in_data.fill_mode_non_solid) && + (fragment_stores_and_atomics == in_data.fragment_stores_and_atomics) && + (full_draw_index_uint32 == in_data.full_draw_index_uint32) && + (geometry_shader == in_data.geometry_shader) && + (image_cube_array == in_data.image_cube_array) && + (independent_blend == in_data.independent_blend) && + (inherited_queries == in_data.inherited_queries) && + (large_points == in_data.large_points) && + (logic_ip == in_data.logic_ip) && + (multi_draw_indirect == in_data.multi_draw_indirect) && + (multi_viewport == in_data.multi_viewport) && + (occlusion_query_precise == in_data.occlusion_query_precise) && + (pipeline_statistics_query == in_data.pipeline_statistics_query) && + (robust_buffer_access == in_data.robust_buffer_access) && + (sampler_anisotropy == in_data.sampler_anisotropy) && + (sample_rate_shading == in_data.sample_rate_shading) && + (shader_clip_distance == in_data.shader_clip_distance) && + (shader_cull_distance == in_data.shader_cull_distance) && + (shader_float64 == in_data.shader_float64) && + (shader_image_gather_extended == in_data.shader_image_gather_extended) && + (shader_int16 == in_data.shader_int16) && + (shader_int64 == in_data.shader_int64) && + (shader_resource_residency == in_data.shader_resource_residency) && + (shader_resource_min_lod == in_data.shader_resource_min_lod) && + (shader_sampled_image_array_dynamic_indexing == in_data.shader_sampled_image_array_dynamic_indexing) && + (shader_storage_buffer_array_dynamic_indexing == in_data.shader_storage_buffer_array_dynamic_indexing) && + (shader_storage_image_array_dynamic_indexing == in_data.shader_storage_image_array_dynamic_indexing) && + (shader_storage_image_extended_formats == in_data.shader_storage_image_extended_formats) && + (shader_storage_image_multisample == in_data.shader_storage_image_multisample) && + (shader_storage_image_read_without_format == in_data.shader_storage_image_read_without_format) && + (shader_storage_image_write_without_format == in_data.shader_storage_image_write_without_format) && + (shader_tessellation_and_geometry_point_size == in_data.shader_tessellation_and_geometry_point_size) && + (shader_uniform_buffer_array_dynamic_indexing == in_data.shader_uniform_buffer_array_dynamic_indexing) && + (sparse_binding == in_data.sparse_binding) && + (sparse_residency_2_samples == in_data.sparse_residency_2_samples) && + (sparse_residency_4_samples == in_data.sparse_residency_4_samples) && + (sparse_residency_8_samples == in_data.sparse_residency_8_samples) && + (sparse_residency_16_samples == in_data.sparse_residency_16_samples) && + (sparse_residency_aliased == in_data.sparse_residency_aliased) && + (sparse_residency_buffer == in_data.sparse_residency_buffer) && + (sparse_residency_image_2D == in_data.sparse_residency_image_2D) && + (sparse_residency_image_3D == in_data.sparse_residency_image_3D) && + (tessellation_shader == in_data.tessellation_shader) && + (texture_compression_ASTC_LDR == in_data.texture_compression_ASTC_LDR) && + (texture_compression_BC == in_data.texture_compression_BC) && + (texture_compression_ETC2 == in_data.texture_compression_ETC2) && + (variable_multisample_rate == in_data.variable_multisample_rate) && + (vertex_pipeline_stores_and_atomics == in_data.vertex_pipeline_stores_and_atomics) && + (wide_lines == in_data.wide_lines); +} + +bool Anvil::PhysicalDeviceProperties::operator==(const PhysicalDeviceProperties& in_props) const +{ + const bool core_vk1_0_features_match = (*core_vk1_0_properties_ptr == *in_props.core_vk1_0_properties_ptr); + bool khr_maintenance3_properties_match = false; + + if (khr_maintenance3_properties_ptr != nullptr && + in_props.khr_maintenance3_properties_ptr != nullptr) + { + khr_maintenance3_properties_match = (*khr_maintenance3_properties_ptr == *in_props.khr_maintenance3_properties_ptr); + } + else + { + khr_maintenance3_properties_match = (khr_maintenance3_properties_ptr == nullptr && + in_props.khr_maintenance3_properties_ptr == nullptr); + } + + return core_vk1_0_features_match && + khr_maintenance3_properties_match; +} + + /** Please see header for specification */ -Anvil::SparseMemoryBindInfoID Anvil::Utils::SparseMemoryBindingUpdateInfo::add_bind_info(uint32_t in_n_signal_semaphores, - std::shared_ptr* in_opt_signal_semaphores_ptr, - uint32_t in_n_wait_semaphores, - std::shared_ptr* in_opt_wait_semaphores_ptr) +Anvil::SparseMemoryBindInfoID Anvil::Utils::SparseMemoryBindingUpdateInfo::add_bind_info(uint32_t in_n_signal_semaphores, + Anvil::Semaphore* const* in_opt_signal_semaphores_ptr, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_opt_wait_semaphores_ptr) { Anvil::SparseMemoryBindInfoID result_id = static_cast(m_bindings.size() ); BindingInfo new_binding; @@ -1036,12 +1868,13 @@ Anvil::SparseMemoryBindInfoID Anvil::Utils::SparseMemoryBindingUpdateInfo::add_b } /** Please see header for specification */ -void Anvil::Utils::SparseMemoryBindingUpdateInfo::append_buffer_memory_update(SparseMemoryBindInfoID in_bind_info_id, - std::shared_ptr in_buffer_ptr, - VkDeviceSize in_buffer_memory_start_offset, - std::shared_ptr in_memory_block_ptr, - VkDeviceSize in_memory_block_start_offset, - VkDeviceSize in_size) +void Anvil::Utils::SparseMemoryBindingUpdateInfo::append_buffer_memory_update(SparseMemoryBindInfoID in_bind_info_id, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_buffer_memory_start_offset, + Anvil::MemoryBlock* in_memory_block_ptr, + VkDeviceSize in_memory_block_start_offset, + bool in_memory_block_owned_by_buffer, + VkDeviceSize in_size) { /* Sanity checks */ anvil_assert(in_buffer_ptr != nullptr); @@ -1058,32 +1891,34 @@ void Anvil::Utils::SparseMemoryBindingUpdateInfo::append_buffer_memory_update(Sp GeneralBindInfo update; VkSparseMemoryBind update_vk; - update.memory_block_ptr = in_memory_block_ptr; - update.memory_block_start_offset = in_memory_block_start_offset; - update.size = in_size; - update.start_offset = in_buffer_memory_start_offset; + update.memory_block_owned_by_target = in_memory_block_owned_by_buffer; + update.memory_block_ptr = in_memory_block_ptr; + update.memory_block_start_offset = in_memory_block_start_offset; + update.size = in_size; + update.start_offset = in_buffer_memory_start_offset; - update_vk.flags = 0; - update_vk.memory = (in_memory_block_ptr != nullptr) ? in_memory_block_ptr->get_memory() - : VK_NULL_HANDLE; - update_vk.memoryOffset = (in_memory_block_ptr != nullptr) ? (in_memory_block_ptr->get_start_offset() + in_memory_block_start_offset) - : UINT32_MAX; - update_vk.resourceOffset = (in_buffer_ptr->get_start_offset() + in_buffer_memory_start_offset); - update_vk.size = in_size; + update_vk.flags = 0; + update_vk.memory = (in_memory_block_ptr != nullptr) ? in_memory_block_ptr->get_memory() + : VK_NULL_HANDLE; + update_vk.memoryOffset = (in_memory_block_ptr != nullptr) ? (in_memory_block_ptr->get_start_offset() + in_memory_block_start_offset) + : UINT32_MAX; + update_vk.resourceOffset = (in_buffer_ptr->get_start_offset() + in_buffer_memory_start_offset); + update_vk.size = in_size; binding.buffer_updates[in_buffer_ptr].first.push_back (update); binding.buffer_updates[in_buffer_ptr].second.push_back(update_vk); } /** Please see header for specification */ -void Anvil::Utils::SparseMemoryBindingUpdateInfo::append_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, - std::shared_ptr in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - const VkExtent3D& in_extent, - VkSparseMemoryBindFlags in_flags, - std::shared_ptr in_opt_memory_block_ptr, - VkDeviceSize in_opt_memory_block_start_offset) +void Anvil::Utils::SparseMemoryBindingUpdateInfo::append_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, + Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + const VkExtent3D& in_extent, + VkSparseMemoryBindFlags in_flags, + Anvil::MemoryBlock* in_opt_memory_block_ptr, + VkDeviceSize in_opt_memory_block_start_offset, + bool in_opt_memory_block_owned_by_image) { /* Sanity checks .. */ anvil_assert(in_image_ptr != nullptr); @@ -1104,12 +1939,13 @@ void Anvil::Utils::SparseMemoryBindingUpdateInfo::append_image_memory_update(Spa ImageBindInfo update; VkSparseImageMemoryBind update_vk; - update.extent = in_extent; - update.flags = in_flags; - update.memory_block_ptr = in_opt_memory_block_ptr; - update.memory_block_start_offset = in_opt_memory_block_start_offset; - update.offset = in_offset; - update.subresource = in_subresource; + update.extent = in_extent; + update.flags = in_flags; + update.memory_block_owned_by_image = in_opt_memory_block_owned_by_image; + update.memory_block_ptr = in_opt_memory_block_ptr; + update.memory_block_start_offset = in_opt_memory_block_start_offset; + update.offset = in_offset; + update.subresource = in_subresource; update_vk.extent = in_extent; update_vk.flags = in_flags; @@ -1125,13 +1961,14 @@ void Anvil::Utils::SparseMemoryBindingUpdateInfo::append_image_memory_update(Spa } /** Please see header for specification */ -void Anvil::Utils::SparseMemoryBindingUpdateInfo::append_opaque_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, - std::shared_ptr in_image_ptr, - VkDeviceSize in_resource_offset, - VkDeviceSize in_size, - VkSparseMemoryBindFlags in_flags, - std::shared_ptr in_opt_memory_block_ptr, - VkDeviceSize in_opt_memory_block_start_offset) +void Anvil::Utils::SparseMemoryBindingUpdateInfo::append_opaque_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, + Anvil::Image* in_image_ptr, + VkDeviceSize in_resource_offset, + VkDeviceSize in_size, + VkSparseMemoryBindFlags in_flags, + Anvil::MemoryBlock* in_opt_memory_block_ptr, + VkDeviceSize in_opt_memory_block_start_offset, + bool in_opt_memory_block_owned_by_image) { /* Sanity checks */ anvil_assert(in_image_ptr != nullptr); @@ -1148,19 +1985,20 @@ void Anvil::Utils::SparseMemoryBindingUpdateInfo::append_opaque_image_memory_upd GeneralBindInfo update; VkSparseMemoryBind update_vk; - update.flags = in_flags; - update.memory_block_ptr = in_opt_memory_block_ptr; - update.memory_block_start_offset = in_opt_memory_block_start_offset; - update.size = in_size; - update.start_offset = in_resource_offset; - - update_vk.flags = in_flags; - update_vk.memory = (in_opt_memory_block_ptr != nullptr) ? in_opt_memory_block_ptr->get_memory() - : VK_NULL_HANDLE; - update_vk.memoryOffset = (in_opt_memory_block_ptr != nullptr) ? (in_opt_memory_block_ptr->get_start_offset() + in_opt_memory_block_start_offset) - : UINT32_MAX; - update_vk.resourceOffset = in_resource_offset; - update_vk.size = in_size; + update.flags = in_flags; + update.memory_block_owned_by_target = in_opt_memory_block_owned_by_image; + update.memory_block_ptr = in_opt_memory_block_ptr; + update.memory_block_start_offset = in_opt_memory_block_start_offset; + update.size = in_size; + update.start_offset = in_resource_offset; + + update_vk.flags = in_flags; + update_vk.memory = (in_opt_memory_block_ptr != nullptr) ? in_opt_memory_block_ptr->get_memory() + : VK_NULL_HANDLE; + update_vk.memoryOffset = (in_opt_memory_block_ptr != nullptr) ? (in_opt_memory_block_ptr->get_start_offset() + in_opt_memory_block_start_offset) + : UINT32_MAX; + update_vk.resourceOffset = in_resource_offset; + update_vk.size = in_size; binding.image_opaque_updates[in_image_ptr].first.push_back (update); binding.image_opaque_updates[in_image_ptr].second.push_back(update_vk); @@ -1275,17 +2113,17 @@ void Anvil::Utils::SparseMemoryBindingUpdateInfo::bake() } /** Please see header for specification */ -bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_bind_info_properties(SparseMemoryBindInfoID in_bind_info_id, - uint32_t* const out_opt_n_buffer_memory_updates_ptr, - uint32_t* const out_opt_n_image_memory_updates_ptr, - uint32_t* const out_opt_n_image_opaque_memory_updates_ptr, - uint32_t* const out_opt_n_signal_semaphores_ptr, - const std::shared_ptr** out_opt_signal_semaphores_ptr_ptr, - uint32_t* const out_opt_n_wait_semaphores_ptr, - const std::shared_ptr** out_opt_wait_semaphores_ptr_ptr) const -{ - decltype(m_bindings)::const_iterator binding_iterator; - bool result = false; +bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_bind_info_properties(SparseMemoryBindInfoID in_bind_info_id, + uint32_t* const out_opt_n_buffer_memory_updates_ptr, + uint32_t* const out_opt_n_image_memory_updates_ptr, + uint32_t* const out_opt_n_image_opaque_memory_updates_ptr, + uint32_t* const out_opt_n_signal_semaphores_ptr, + Anvil::Semaphore*** out_opt_signal_semaphores_ptr_ptr_ptr, + uint32_t* const out_opt_n_wait_semaphores_ptr, + Anvil::Semaphore*** out_opt_wait_semaphores_ptr_ptr_ptr) +{ + decltype(m_bindings)::iterator binding_iterator; + bool result = false; if (m_bindings.size() <= in_bind_info_id) { @@ -1337,10 +2175,10 @@ bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_bind_info_properties(Spars *out_opt_n_signal_semaphores_ptr = static_cast(binding_iterator->signal_semaphores.size() ); } - if (out_opt_signal_semaphores_ptr_ptr != nullptr && + if (out_opt_signal_semaphores_ptr_ptr_ptr != nullptr && binding_iterator->signal_semaphores.size() > 0) { - *out_opt_signal_semaphores_ptr_ptr = &binding_iterator->signal_semaphores[0]; + *out_opt_signal_semaphores_ptr_ptr_ptr = &binding_iterator->signal_semaphores.at(0); } if (out_opt_n_wait_semaphores_ptr != nullptr) @@ -1348,10 +2186,10 @@ bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_bind_info_properties(Spars *out_opt_n_wait_semaphores_ptr = static_cast(binding_iterator->wait_semaphores.size() ); } - if (out_opt_wait_semaphores_ptr_ptr != nullptr && + if (out_opt_wait_semaphores_ptr_ptr_ptr != nullptr && binding_iterator->wait_semaphores.size() > 0) { - *out_opt_wait_semaphores_ptr_ptr = &binding_iterator->wait_semaphores[0]; + *out_opt_wait_semaphores_ptr_ptr_ptr = &binding_iterator->wait_semaphores.at(0); } /* All done */ @@ -1361,9 +2199,9 @@ bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_bind_info_properties(Spars } /** Please see header for specification */ -void Anvil::Utils::SparseMemoryBindingUpdateInfo::get_bind_sparse_call_args(uint32_t* out_bind_info_count_ptr, - const VkBindSparseInfo** out_bind_info_ptr, - std::shared_ptr* out_fence_to_set_ptr) +void Anvil::Utils::SparseMemoryBindingUpdateInfo::get_bind_sparse_call_args(uint32_t* out_bind_info_count_ptr, + const VkBindSparseInfo** out_bind_info_ptr, + Anvil::Fence** out_fence_to_set_ptr) { if (m_dirty) { @@ -1373,18 +2211,19 @@ void Anvil::Utils::SparseMemoryBindingUpdateInfo::get_bind_sparse_call_args(uint } *out_bind_info_count_ptr = static_cast(m_bindings.size() ); - *out_bind_info_ptr = (m_bindings_vk.size() > 0) ? &m_bindings_vk[0] : nullptr; + *out_bind_info_ptr = (m_bindings_vk.size() > 0) ? &m_bindings_vk.at(0) : nullptr; *out_fence_to_set_ptr = m_fence_ptr; } /** Please see header for specification */ -bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_buffer_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, - uint32_t in_n_update, - std::shared_ptr* out_opt_buffer_ptr, - VkDeviceSize* out_opt_buffer_memory_start_offset_ptr, - std::shared_ptr* out_opt_memory_block_ptr, - VkDeviceSize* out_opt_memory_block_start_offset_ptr, - VkDeviceSize* out_opt_size_ptr) const +bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_buffer_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, + uint32_t in_n_update, + Anvil::Buffer** out_opt_buffer_ptr_ptr, + VkDeviceSize* out_opt_buffer_memory_start_offset_ptr, + Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, + VkDeviceSize* out_opt_memory_block_start_offset_ptr, + bool* out_opt_memory_block_owned_by_buffer_ptr, + VkDeviceSize* out_opt_size_ptr) const { GeneralBindInfo buffer_bind; BufferBindUpdateMap::const_iterator buffer_binding_map_iterator; @@ -1426,9 +2265,9 @@ bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_buffer_memory_update_prope goto end; } - if (out_opt_buffer_ptr != nullptr) + if (out_opt_buffer_ptr_ptr != nullptr) { - *out_opt_buffer_ptr = buffer_binding_map_iterator->first; + *out_opt_buffer_ptr_ptr = buffer_binding_map_iterator->first; } if (out_opt_buffer_memory_start_offset_ptr != nullptr) @@ -1436,9 +2275,14 @@ bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_buffer_memory_update_prope *out_opt_buffer_memory_start_offset_ptr = buffer_bind.start_offset; } - if (out_opt_memory_block_ptr != nullptr) + if (out_opt_memory_block_owned_by_buffer_ptr != nullptr) + { + *out_opt_memory_block_owned_by_buffer_ptr = buffer_bind.memory_block_owned_by_target; + } + + if (out_opt_memory_block_ptr_ptr != nullptr) { - *out_opt_memory_block_ptr = buffer_bind.memory_block_ptr; + *out_opt_memory_block_ptr_ptr = buffer_bind.memory_block_ptr; } if (out_opt_memory_block_start_offset_ptr != nullptr) @@ -1458,15 +2302,16 @@ bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_buffer_memory_update_prope } /** Please see header for specification */ -bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_image_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, - uint32_t in_n_update, - std::shared_ptr* out_opt_image_ptr_ptr, - VkImageSubresource* out_opt_subresource_ptr, - VkOffset3D* out_opt_offset_ptr, - VkExtent3D* out_opt_extent_ptr, - VkSparseMemoryBindFlags* out_opt_flags_ptr, - std::shared_ptr* out_opt_memory_block_ptr_ptr, - VkDeviceSize* out_opt_memory_block_start_offset_ptr) const +bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_image_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, + uint32_t in_n_update, + Anvil::Image** out_opt_image_ptr_ptr, + VkImageSubresource* out_opt_subresource_ptr, + VkOffset3D* out_opt_offset_ptr, + VkExtent3D* out_opt_extent_ptr, + VkSparseMemoryBindFlags* out_opt_flags_ptr, + Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, + VkDeviceSize* out_opt_memory_block_start_offset_ptr, + bool* out_opt_memory_block_owned_by_image_ptr) const { decltype(m_bindings)::const_iterator binding_iterator; ImageBindInfo image_bind; @@ -1543,6 +2388,11 @@ bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_image_memory_update_proper *out_opt_memory_block_start_offset_ptr = image_bind.memory_block_start_offset; } + if (out_opt_memory_block_owned_by_image_ptr != nullptr) + { + *out_opt_memory_block_owned_by_image_ptr = image_bind.memory_block_owned_by_image; + } + /* All done */ result = true; end: @@ -1550,14 +2400,15 @@ bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_image_memory_update_proper } /** Please see header for specification */ -bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_image_opaque_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, - uint32_t in_n_update, - std::shared_ptr* out_opt_image_ptr_ptr, - VkDeviceSize* out_opt_resource_offset_ptr, - VkDeviceSize* out_opt_size_ptr, - VkSparseMemoryBindFlags* out_opt_flags_ptr, - std::shared_ptr* out_opt_memory_block_ptr_ptr, - VkDeviceSize* out_opt_memory_block_start_offset_ptr) const +bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_image_opaque_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, + uint32_t in_n_update, + Anvil::Image** out_opt_image_ptr_ptr, + VkDeviceSize* out_opt_resource_offset_ptr, + VkDeviceSize* out_opt_size_ptr, + VkSparseMemoryBindFlags* out_opt_flags_ptr, + Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, + VkDeviceSize* out_opt_memory_block_start_offset_ptr, + bool* out_opt_memory_block_owned_by_image_ptr) const { decltype(m_bindings)::const_iterator binding_iterator; GeneralBindInfo image_opaque_bind; @@ -1629,6 +2480,11 @@ bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_image_opaque_memory_update *out_opt_memory_block_start_offset_ptr = image_opaque_bind.memory_block_start_offset; } + if (out_opt_memory_block_owned_by_image_ptr != nullptr) + { + *out_opt_memory_block_owned_by_image_ptr = image_opaque_bind.memory_block_owned_by_target; + } + /* All done */ result = true; end: @@ -1641,7 +2497,7 @@ Anvil::MemoryFeatureFlags Anvil::Utils::get_memory_feature_flags_from_vk_propert { Anvil::MemoryFeatureFlags result = 0; - ANVIL_REDUNDANT_ARGUMENT_CONST(in_mem_heap_flags); + ANVIL_REDUNDANT_ARGUMENT(in_mem_heap_flags); if ((in_mem_type_flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0) { @@ -1677,8 +2533,8 @@ Anvil::MTSafety Anvil::Utils::convert_boolean_to_mt_safety_enum(bool in_mt_safe) : MT_SAFETY_DISABLED; } -bool Anvil::Utils::convert_mt_safety_enum_to_boolean(Anvil::MTSafety in_mt_safety, - std::weak_ptr in_device_ptr) +bool Anvil::Utils::convert_mt_safety_enum_to_boolean(Anvil::MTSafety in_mt_safety, + const Anvil::BaseDevice* in_device_ptr) { bool result = false; @@ -1689,10 +2545,9 @@ bool Anvil::Utils::convert_mt_safety_enum_to_boolean(Anvil::MTSafety case MT_SAFETY_INHERIT_FROM_PARENT_DEVICE: { - anvil_assert(!in_device_ptr.expired() ); - anvil_assert( in_device_ptr.lock () != nullptr); + anvil_assert(in_device_ptr != nullptr); - result = in_device_ptr.lock()->is_mt_safe(); + result = in_device_ptr->is_mt_safe(); break; } @@ -1706,75 +2561,54 @@ bool Anvil::Utils::convert_mt_safety_enum_to_boolean(Anvil::MTSafety } /** Please see header for specification */ -void Anvil::Utils::convert_queue_family_bits_to_family_indices(std::weak_ptr in_device_ptr, - Anvil::QueueFamilyBits in_queue_families, - uint32_t* out_opt_queue_family_indices_ptr, - uint32_t* out_opt_n_queue_family_indices_ptr) +void Anvil::Utils::convert_queue_family_bits_to_family_indices(const Anvil::BaseDevice* in_device_ptr, + Anvil::QueueFamilyBits in_queue_families, + uint32_t* out_opt_queue_family_indices_ptr, + uint32_t* out_opt_n_queue_family_indices_ptr) { - std::shared_ptr device_locked_ptr (in_device_ptr); - uint32_t n_queue_family_indices (0); - bool universal_queue_included(false); + uint32_t n_result_queue_family_indices(0); - if ((in_queue_families & QUEUE_FAMILY_COMPUTE_BIT) != 0) + static const struct { - if (out_opt_queue_family_indices_ptr != nullptr) - { - out_opt_queue_family_indices_ptr[n_queue_family_indices] = device_locked_ptr->get_queue_family_index(Anvil::QUEUE_FAMILY_TYPE_COMPUTE); - - /* If the compute queue family is not available, use universal instead */ - if (out_opt_queue_family_indices_ptr[n_queue_family_indices] == UINT32_MAX) - { - out_opt_queue_family_indices_ptr[n_queue_family_indices] = device_locked_ptr->get_queue_family_index(Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL); - - ++n_queue_family_indices; - universal_queue_included = true; - } - else - { - ++n_queue_family_indices; - } - } - } + Anvil::QueueFamily queue_family; + Anvil::QueueFamilyType queue_family_type; + } queue_family_data[] = + { + {Anvil::QUEUE_FAMILY_COMPUTE_BIT, Anvil::QueueFamilyType::COMPUTE}, + {Anvil::QUEUE_FAMILY_DMA_BIT, Anvil::QueueFamilyType::TRANSFER}, + {Anvil::QUEUE_FAMILY_GRAPHICS_BIT, Anvil::QueueFamilyType::UNIVERSAL}, + }; - if ((in_queue_families & QUEUE_FAMILY_DMA_BIT) != 0) + for (const auto& current_queue_fam_data : queue_family_data) { - if (out_opt_queue_family_indices_ptr != nullptr) + if ((in_queue_families & current_queue_fam_data.queue_family) != 0) { - out_opt_queue_family_indices_ptr[n_queue_family_indices] = device_locked_ptr->get_queue_family_index(Anvil::QUEUE_FAMILY_TYPE_TRANSFER); + uint32_t n_queue_family_indices = 0; + const uint32_t* queue_family_indices_ptr = nullptr; - /* If the DMA queue family is unavailable, use universal instead */ - if (out_opt_queue_family_indices_ptr[n_queue_family_indices] == UINT32_MAX && - !universal_queue_included) - { - out_opt_queue_family_indices_ptr[n_queue_family_indices] = device_locked_ptr->get_queue_family_index(Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL); + in_device_ptr->get_queue_family_indices_for_queue_family_type(current_queue_fam_data.queue_family_type, + &n_queue_family_indices, + &queue_family_indices_ptr); - ++n_queue_family_indices; - universal_queue_included = true; + if (out_opt_queue_family_indices_ptr != nullptr) + { + for (uint32_t n_queue_family_index = 0; + n_queue_family_index < n_queue_family_indices; + ++n_queue_family_index, ++n_result_queue_family_indices) + { + out_opt_queue_family_indices_ptr[n_result_queue_family_indices] = queue_family_indices_ptr[n_queue_family_index]; + } } else { - ++n_queue_family_indices; + n_result_queue_family_indices += n_queue_family_indices; } } } - if (((in_queue_families & QUEUE_FAMILY_GRAPHICS_BIT) != 0) && - !universal_queue_included) - { - if (out_opt_queue_family_indices_ptr != nullptr) - { - out_opt_queue_family_indices_ptr[n_queue_family_indices] = device_locked_ptr->get_queue_family_index(Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL); - } - - ++n_queue_family_indices; - universal_queue_included = true; - } - - anvil_assert(n_queue_family_indices > 0); - if (out_opt_n_queue_family_indices_ptr != nullptr) { - *out_opt_n_queue_family_indices_ptr = n_queue_family_indices; + *out_opt_n_queue_family_indices_ptr = n_result_queue_family_indices; } } @@ -1883,7 +2717,7 @@ VkAccessFlags Anvil::Utils::get_access_mask_from_image_layout(VkImageLayout switch (in_queue_family_type) { - case Anvil::QUEUE_FAMILY_TYPE_COMPUTE: + case Anvil::QueueFamilyType::COMPUTE: { result &= (VK_ACCESS_INDIRECT_COMMAND_READ_BIT | VK_ACCESS_MEMORY_READ_BIT | @@ -1897,7 +2731,7 @@ VkAccessFlags Anvil::Utils::get_access_mask_from_image_layout(VkImageLayout break; } - case Anvil::QUEUE_FAMILY_TYPE_TRANSFER: + case Anvil::QueueFamilyType::TRANSFER: { result &= (VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT | @@ -1907,7 +2741,7 @@ VkAccessFlags Anvil::Utils::get_access_mask_from_image_layout(VkImageLayout break; } - case Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL: + case Anvil::QueueFamilyType::UNIVERSAL: { result &= (VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | @@ -1927,7 +2761,7 @@ VkAccessFlags Anvil::Utils::get_access_mask_from_image_layout(VkImageLayout break; } - case Anvil::QUEUE_FAMILY_TYPE_UNDEFINED: + case Anvil::QueueFamilyType::UNDEFINED: { break; } @@ -1948,9 +2782,9 @@ Anvil::QueueFamilyBits Anvil::Utils::get_queue_family_bits_from_queue_family_typ switch (in_queue_family_type) { - case Anvil::QUEUE_FAMILY_TYPE_COMPUTE: result = Anvil::QUEUE_FAMILY_COMPUTE_BIT; break; - case Anvil::QUEUE_FAMILY_TYPE_TRANSFER: result = Anvil::QUEUE_FAMILY_DMA_BIT; break; - case Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL: result = Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT; break; + case Anvil::QueueFamilyType::COMPUTE: result = Anvil::QUEUE_FAMILY_COMPUTE_BIT; break; + case Anvil::QueueFamilyType::TRANSFER: result = Anvil::QUEUE_FAMILY_DMA_BIT; break; + case Anvil::QueueFamilyType::UNIVERSAL: result = Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT; break; default: { @@ -1972,9 +2806,9 @@ const char* Anvil::Utils::get_raw_string(Anvil::QueueFamilyType in_queue_family_ }; static const uint32_t n_result_strings = sizeof(result_strings) / sizeof(result_strings[0]); - static_assert(n_result_strings == QUEUE_FAMILY_TYPE_COUNT, ""); + static_assert(n_result_strings == static_cast(Anvil::QueueFamilyType::COUNT), ""); - return result_strings[in_queue_family_type]; + return result_strings[static_cast(in_queue_family_type)]; } /* Please see header for specification */ diff --git a/src/misc/window_factory.cpp b/src/misc/window_factory.cpp index c07d19df..73f6c340 100644 --- a/src/misc/window_factory.cpp +++ b/src/misc/window_factory.cpp @@ -22,14 +22,15 @@ #include "misc/window_factory.h" -std::shared_ptr Anvil::WindowFactory::create_window(WindowPlatform in_platform, - const std::string& in_title, - unsigned int in_width, - unsigned int in_height, - bool in_closable, - PresentCallbackFunction in_present_callback_func) +Anvil::WindowUniquePtr Anvil::WindowFactory::create_window(WindowPlatform in_platform, + const std::string& in_title, + unsigned int in_width, + unsigned int in_height, + bool in_closable, + PresentCallbackFunction in_present_callback_func) { - std::shared_ptr result_ptr; + WindowUniquePtr result_ptr(nullptr, + std::default_delete() ); switch (in_platform) { @@ -97,11 +98,12 @@ std::shared_ptr Anvil::WindowFactory::create_window(WindowPlatfor return result_ptr; } -std::shared_ptr Anvil::WindowFactory::create_window(WindowPlatform in_platform, - WindowHandle in_handle, - void* in_xcb_connection_ptr) +Anvil::WindowUniquePtr Anvil::WindowFactory::create_window(WindowPlatform in_platform, + WindowHandle in_handle, + void* in_xcb_connection_ptr) { - std::shared_ptr result_ptr; + WindowUniquePtr result_ptr(nullptr, + std::default_delete() ); /* NOTE: These arguments may not be used at all, depending on ANVIL_INCLUDE_*_WINDOW_SYSTEM_SUPPORT configuration */ ANVIL_REDUNDANT_ARGUMENT(in_handle); diff --git a/src/misc/window_win3264.cpp b/src/misc/window_win3264.cpp index f27ddac6..879c47cd 100644 --- a/src/misc/window_win3264.cpp +++ b/src/misc/window_win3264.cpp @@ -58,23 +58,24 @@ Anvil::WindowWin3264::WindowWin3264(HWND in_handle, } /** Please see header for specification */ -std::shared_ptr Anvil::WindowWin3264::create(const std::string& in_title, - unsigned int in_width, - unsigned int in_height, - bool in_closable, - Anvil::PresentCallbackFunction in_present_callback_func) +Anvil::WindowUniquePtr Anvil::WindowWin3264::create(const std::string& in_title, + unsigned int in_width, + unsigned int in_height, + bool in_closable, + Anvil::PresentCallbackFunction in_present_callback_func) { - std::shared_ptr result_ptr( + WindowUniquePtr result_ptr( new Anvil::WindowWin3264(in_title, in_width, in_height, in_closable, - in_present_callback_func) + in_present_callback_func), + std::default_delete() ); if (result_ptr) { - if (!result_ptr->init() ) + if (!dynamic_cast(result_ptr.get() )->init() ) { result_ptr.reset(); } @@ -84,13 +85,14 @@ std::shared_ptr Anvil::WindowWin3264::create(const std::string& } /** Please see header for specification */ -std::shared_ptr Anvil::WindowWin3264::create(HWND in_window_handle) +Anvil::WindowUniquePtr Anvil::WindowWin3264::create(HWND in_window_handle) { - std::shared_ptr result_ptr; - RECT window_rect; - uint32_t window_size[2] = {0}; - std::vector window_title; - uint32_t window_title_length = 0; + WindowUniquePtr result_ptr(nullptr, + std::default_delete() ); + RECT window_rect; + uint32_t window_size[2] = {0}; + std::vector window_title; + uint32_t window_title_length = 0; /* The window has already been spawned by the user. Gather all the info we need in order to instantiate * the wrapper instance. @@ -135,7 +137,7 @@ std::shared_ptr Anvil::WindowWin3264::create(HWND in_window_handl if (result_ptr) { - if (!result_ptr->init() ) + if (!dynamic_cast(result_ptr.get() )->init() ) { result_ptr.reset(); } diff --git a/src/misc/window_xcb.cpp b/src/misc/window_xcb.cpp index 8784e764..5dc5361c 100644 --- a/src/misc/window_xcb.cpp +++ b/src/misc/window_xcb.cpp @@ -40,13 +40,14 @@ typedef struct /** Please see header for specification */ -std::shared_ptr Anvil::WindowXcb::create(const std::string& in_title, - unsigned int in_width, - unsigned int in_height, - bool in_closable, - Anvil::PresentCallbackFunction in_present_callback_func) +Anvil::WindowUniquePtr Anvil::WindowXcb::create(const std::string& in_title, + unsigned int in_width, + unsigned int in_height, + bool in_closable, + Anvil::PresentCallbackFunction in_present_callback_func) { - std::shared_ptr result_ptr; + WindowUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::WindowXcb(in_title, @@ -58,7 +59,7 @@ std::shared_ptr Anvil::WindowXcb::create(const std::string& if (result_ptr) { - if (!result_ptr->init() ) + if (!dynamic_cast(result_ptr.get() )->init() ) { result_ptr.reset(); } @@ -67,10 +68,11 @@ std::shared_ptr Anvil::WindowXcb::create(const std::string& return result_ptr; } -std::shared_ptr Anvil::WindowXcb::create(xcb_connection_t* in_connection_ptr, - WindowHandle in_window_handle) +Anvil::WindowUniquePtr Anvil::WindowXcb::create(xcb_connection_t* in_connection_ptr, + WindowHandle in_window_handle) { - std::shared_ptr result_ptr; + WindowUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::WindowXcb(in_connection_ptr, @@ -79,7 +81,7 @@ std::shared_ptr Anvil::WindowXcb::create(xcb_connection_t* in_con if (result_ptr) { - if (!result_ptr->init() ) + if (!dynamic_cast(result_ptr.get() )->init() ) { result_ptr.reset(); } @@ -367,7 +369,7 @@ void Anvil::WindowXcb::run() { case XCB_CLIENT_MESSAGE: { - if (reinterpret_cast(event_ptr)->data.data32[0] == m_atom_wm_delete_window_ptr->atom && + if ((reinterpret_cast(event_ptr)->data.data32[0] == m_atom_wm_delete_window_ptr->atom) && m_closable) { running = false; @@ -431,5 +433,7 @@ void Anvil::WindowXcb::run() } } + close(); + m_window_close_finished = true; } diff --git a/src/wrappers/buffer.cpp b/src/wrappers/buffer.cpp index 737e9cfb..06aed601 100644 --- a/src/wrappers/buffer.cpp +++ b/src/wrappers/buffer.cpp @@ -22,6 +22,7 @@ #include "misc/debug.h" #include "misc/object_tracker.h" +#include "misc/struct_chainer.h" #include "wrappers/buffer.h" #include "wrappers/command_buffer.h" #include "wrappers/command_pool.h" @@ -32,7 +33,7 @@ #include "wrappers/queue.h" /* Please see header for specification */ -Anvil::Buffer::Buffer(std::weak_ptr in_device_ptr, +Anvil::Buffer::Buffer(const Anvil::BaseDevice* in_device_ptr, VkDeviceSize in_size, QueueFamilyBits in_queue_families, VkSharingMode in_queue_sharing_mode, @@ -48,7 +49,8 @@ Anvil::Buffer::Buffer(std::weak_ptr in_device_ptr, m_create_flags (0), m_device_ptr (in_device_ptr), m_is_sparse (true), - m_parent_buffer_ptr (0), + m_memory_block_ptr (nullptr), + m_parent_buffer_ptr (nullptr), m_queue_families (in_queue_families), m_residency_scope (in_residency_scope), m_sharing_mode (in_queue_sharing_mode), @@ -75,13 +77,13 @@ Anvil::Buffer::Buffer(std::weak_ptr in_device_ptr, } /* Please see header for specification */ -Anvil::Buffer::Buffer(std::weak_ptr in_device_ptr, - VkDeviceSize in_size, - Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_queue_sharing_mode, - VkBufferUsageFlags in_usage_flags, - Anvil::MemoryFeatureFlags in_memory_features, - bool in_mt_safe) +Anvil::Buffer::Buffer(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + Anvil::QueueFamilyBits in_queue_families, + VkSharingMode in_queue_sharing_mode, + VkBufferUsageFlags in_usage_flags, + Anvil::MemoryFeatureFlags in_memory_features, + bool in_mt_safe) :CallbacksSupportProvider (BUFFER_CALLBACK_ID_COUNT), DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT), @@ -91,7 +93,8 @@ Anvil::Buffer::Buffer(std::weak_ptr in_device_ptr, m_create_flags (0), m_device_ptr (in_device_ptr), m_is_sparse (false), - m_parent_buffer_ptr (0), + m_memory_block_ptr (nullptr), + m_parent_buffer_ptr (nullptr), m_queue_families (in_queue_families), m_residency_scope (Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED), m_sharing_mode (in_queue_sharing_mode), @@ -112,9 +115,9 @@ Anvil::Buffer::Buffer(std::weak_ptr in_device_ptr, } /* Please see header for specification */ -Anvil::Buffer::Buffer(std::shared_ptr in_parent_buffer_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size) +Anvil::Buffer::Buffer(Anvil::Buffer* in_parent_buffer_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size) :CallbacksSupportProvider (BUFFER_CALLBACK_ID_COUNT), DebugMarkerSupportProvider(in_parent_buffer_ptr->m_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT), @@ -122,7 +125,9 @@ Anvil::Buffer::Buffer(std::shared_ptr in_parent_buffer_ptr, m_buffer (VK_NULL_HANDLE), m_buffer_size (in_size), m_create_flags (0), + m_device_ptr (nullptr), m_is_sparse (false), + m_memory_block_ptr (nullptr), m_parent_buffer_ptr (in_parent_buffer_ptr), m_residency_scope (Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED), m_sharing_mode (VK_SHARING_MODE_MAX_ENUM), @@ -149,11 +154,9 @@ Anvil::Buffer::~Buffer() if (m_buffer != VK_NULL_HANDLE && m_parent_buffer_ptr == nullptr) { - std::shared_ptr device_locked_ptr(m_device_ptr); - lock(); { - vkDestroyBuffer(device_locked_ptr->get_device_vk(), + vkDestroyBuffer(m_device_ptr->get_device_vk(), m_buffer, nullptr /* pAllocator */); } @@ -166,16 +169,17 @@ Anvil::Buffer::~Buffer() } /** Please see header for specification */ -std::shared_ptr Anvil::Buffer::create_nonsparse(std::weak_ptr in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - VkSharingMode in_queue_sharing_mode, - VkBufferUsageFlags in_usage_flags, - MTSafety in_mt_safety) +Anvil::BufferUniquePtr Anvil::Buffer::create_nonsparse(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_queue_sharing_mode, + VkBufferUsageFlags in_usage_flags, + MTSafety in_mt_safety) { - const auto is_mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - std::shared_ptr new_buffer_ptr; + const auto is_mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); + Anvil::BufferUniquePtr new_buffer_ptr(nullptr, + std::default_delete() ); new_buffer_ptr.reset( new Anvil::Buffer(in_device_ptr, @@ -200,18 +204,19 @@ std::shared_ptr Anvil::Buffer::create_nonsparse(std::weak_ptr Anvil::Buffer::create_nonsparse(std::weak_ptr in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - VkSharingMode in_queue_sharing_mode, - VkBufferUsageFlags in_usage_flags, - Anvil::MemoryFeatureFlags in_memory_features, - const void* in_opt_client_data, - MTSafety in_mt_safety) +Anvil::BufferUniquePtr Anvil::Buffer::create_nonsparse(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_queue_sharing_mode, + VkBufferUsageFlags in_usage_flags, + Anvil::MemoryFeatureFlags in_memory_features, + const void* in_opt_client_data, + MTSafety in_mt_safety) { - const auto is_mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - std::shared_ptr new_buffer_ptr; + const auto is_mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); + Anvil::BufferUniquePtr new_buffer_ptr = Anvil::BufferUniquePtr(nullptr, + std::default_delete() ); new_buffer_ptr.reset( new Anvil::Buffer(in_device_ptr, @@ -230,15 +235,15 @@ std::shared_ptr Anvil::Buffer::create_nonsparse(std::weak_ptr memory_block_ptr; + auto memory_block_ptr = Anvil::MemoryBlock::create(in_device_ptr, + new_buffer_ptr->m_buffer_memory_reqs.memoryTypeBits, + new_buffer_ptr->m_buffer_memory_reqs.size, + in_memory_features, + in_mt_safety); - memory_block_ptr = Anvil::MemoryBlock::create(in_device_ptr, - new_buffer_ptr->m_buffer_memory_reqs.memoryTypeBits, - new_buffer_ptr->m_buffer_memory_reqs.size, - in_memory_features, - in_mt_safety); - - new_buffer_ptr->set_nonsparse_memory(memory_block_ptr); + new_buffer_ptr->set_nonsparse_memory( + std::move(memory_block_ptr) + ); if (in_opt_client_data != nullptr) { @@ -256,13 +261,13 @@ std::shared_ptr Anvil::Buffer::create_nonsparse(std::weak_ptr Anvil::Buffer::create_nonsparse(std::shared_ptr in_parent_nonsparse_buffer_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size) +Anvil::BufferUniquePtr Anvil::Buffer::create_nonsparse(Anvil::Buffer* in_parent_nonsparse_buffer_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size) { - std::shared_ptr new_buffer_ptr; - std::shared_ptr new_mem_block_ptr; - + Anvil::BufferUniquePtr new_buffer_ptr(nullptr, + std::default_delete() ); + if (in_parent_nonsparse_buffer_ptr->is_sparse() ) { anvil_assert(!in_parent_nonsparse_buffer_ptr->is_sparse() ); @@ -280,13 +285,19 @@ std::shared_ptr Anvil::Buffer::create_nonsparse(std::shared_ptrget_memory_block(0 /* in_n_memory_block */) != nullptr); - new_buffer_ptr->m_buffer = in_parent_nonsparse_buffer_ptr->m_buffer; - new_buffer_ptr->m_memory_block_ptr = Anvil::MemoryBlock::create_derived (in_parent_nonsparse_buffer_ptr->get_memory_block(0 /* in_n_memory_block */), - in_start_offset, - in_size); - new_buffer_ptr->m_queue_families = in_parent_nonsparse_buffer_ptr->get_queue_families(); - new_buffer_ptr->m_sharing_mode = in_parent_nonsparse_buffer_ptr->get_sharing_mode (); - new_buffer_ptr->m_usage_flags = in_parent_nonsparse_buffer_ptr->get_usage (); + new_buffer_ptr->m_owned_memory_blocks.push_back( + Anvil::MemoryBlock::create_derived(in_parent_nonsparse_buffer_ptr->get_memory_block(0 /* in_n_memory_block */), + in_start_offset, + in_size) + ); + + new_buffer_ptr->m_buffer = in_parent_nonsparse_buffer_ptr->m_buffer; + new_buffer_ptr->m_memory_block_ptr = new_buffer_ptr->m_owned_memory_blocks.back().get(); + new_buffer_ptr->m_queue_families = in_parent_nonsparse_buffer_ptr->get_queue_families(); + new_buffer_ptr->m_sharing_mode = in_parent_nonsparse_buffer_ptr->get_sharing_mode (); + new_buffer_ptr->m_usage_flags = in_parent_nonsparse_buffer_ptr->get_usage (); + + anvil_assert(new_buffer_ptr->m_memory_block_ptr != nullptr); /* Register the object */ Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_BUFFER, @@ -297,44 +308,44 @@ std::shared_ptr Anvil::Buffer::create_nonsparse(std::shared_ptr Anvil::Buffer::create_sparse(std::weak_ptr in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - VkSharingMode in_queue_sharing_mode, - VkBufferUsageFlags in_usage_flags, - Anvil::SparseResidencyScope in_residency_scope, - MTSafety in_mt_safety) +Anvil::BufferUniquePtr Anvil::Buffer::create_sparse(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_queue_sharing_mode, + VkBufferUsageFlags in_usage_flags, + Anvil::SparseResidencyScope in_residency_scope, + MTSafety in_mt_safety) { - std::shared_ptr device_locked_ptr (in_device_ptr); - const auto is_mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); - const VkPhysicalDeviceFeatures& physical_device_features (device_locked_ptr->get_physical_device_features() ); - std::shared_ptr result_ptr; + const auto is_mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); + const auto& physical_device_features(in_device_ptr->get_physical_device_features () ); + Anvil::BufferUniquePtr result_ptr (nullptr, + std::default_delete() ); /* Sanity checks */ - if (!physical_device_features.sparseBinding) + if (!physical_device_features.core_vk1_0_features_ptr->sparse_binding) { - anvil_assert(physical_device_features.sparseBinding); + anvil_assert(physical_device_features.core_vk1_0_features_ptr->sparse_binding); goto end; } - if ((in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED || - in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_NONALIASED) && - !physical_device_features.sparseResidencyBuffer) + if ((in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED || + in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_NONALIASED) && + !physical_device_features.core_vk1_0_features_ptr->sparse_residency_buffer) { - anvil_assert((in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED || - in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_NONALIASED) && - physical_device_features.sparseResidencyBuffer); + anvil_assert((in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED || + in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_NONALIASED) && + physical_device_features.core_vk1_0_features_ptr->sparse_residency_buffer); goto end; } - if ( in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED && - !physical_device_features.sparseResidencyAliased) + if ( in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED && + !physical_device_features.core_vk1_0_features_ptr->sparse_residency_aliased) { - anvil_assert(in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED && - physical_device_features.sparseResidencyAliased); + anvil_assert(in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED && + physical_device_features.core_vk1_0_features_ptr->sparse_residency_aliased); goto end; } @@ -380,11 +391,10 @@ void Anvil::Buffer::create_buffer(Anvil::QueueFamilyBits in_queue_families, VkSharingMode in_sharing_mode, VkDeviceSize in_size) { - VkBufferCreateInfo buffer_create_info; - std::shared_ptr device_locked_ptr(m_device_ptr); - uint32_t n_queue_family_indices; - uint32_t queue_family_indices[8]; - VkResult result(VK_ERROR_INITIALIZATION_FAILED); + VkBufferCreateInfo buffer_create_info; + uint32_t n_queue_family_indices; + uint32_t queue_family_indices[8]; + VkResult result(VK_ERROR_INITIALIZATION_FAILED); ANVIL_REDUNDANT_VARIABLE(result); @@ -408,7 +418,7 @@ void Anvil::Buffer::create_buffer(Anvil::QueueFamilyBits in_queue_families, buffer_create_info.usage = m_usage_flags; /* Create the buffer object */ - result = vkCreateBuffer(device_locked_ptr->get_device_vk(), + result = vkCreateBuffer(m_device_ptr->get_device_vk(), &buffer_create_info, nullptr, /* pAllocator */ &m_buffer); @@ -419,17 +429,17 @@ void Anvil::Buffer::create_buffer(Anvil::QueueFamilyBits in_queue_families, set_vk_handle(m_buffer); /* Cache buffer data memory requirements */ - vkGetBufferMemoryRequirements(device_locked_ptr->get_device_vk(), + vkGetBufferMemoryRequirements(m_device_ptr->get_device_vk(), m_buffer, &m_buffer_memory_reqs); } } /* Please see header for specification */ -std::shared_ptr Anvil::Buffer::get_base_buffer() +const Anvil::Buffer* Anvil::Buffer::get_base_buffer() { - std::shared_ptr parent_ptr; - std::shared_ptr result_ptr = shared_from_this(); + const Anvil::Buffer* result_ptr = this; + Anvil::Buffer* parent_ptr = nullptr; if ( (parent_ptr = result_ptr->get_parent_buffer_ptr()) != nullptr) { @@ -454,13 +464,13 @@ VkBuffer Anvil::Buffer::get_buffer() } /* Please see header for specification */ -std::shared_ptr Anvil::Buffer::get_memory_block(uint32_t in_n_memory_block) +Anvil::MemoryBlock* Anvil::Buffer::get_memory_block(uint32_t in_n_memory_block) { bool is_callback_needed = false; if (m_is_sparse) { - IsBufferMemoryAllocPendingQueryCallbackArgument callback_arg(shared_from_this() ); + IsBufferMemoryAllocPendingQueryCallbackArgument callback_arg(this); callback(BUFFER_CALLBACK_ID_IS_ALLOC_PENDING, &callback_arg); @@ -474,7 +484,7 @@ std::shared_ptr Anvil::Buffer::get_memory_block(uint32_t in_ if (is_callback_needed) { - OnMemoryBlockNeededForBufferCallbackArgument callback_argument(shared_from_this() ); + OnMemoryBlockNeededForBufferCallbackArgument callback_argument(this); anvil_assert(m_parent_buffer_ptr == nullptr); @@ -508,14 +518,27 @@ VkDeviceSize Anvil::Buffer::get_start_offset() const } /* Please see header for specification */ -bool Anvil::Buffer::read(VkDeviceSize in_start_offset, - VkDeviceSize in_size, +bool Anvil::Buffer::read(VkDeviceSize start_offset, + VkDeviceSize size, void* out_result_ptr) { - std::shared_ptr device_locked_ptr(m_device_ptr); - const Anvil::DeviceType device_type (device_locked_ptr->get_type() ); - auto memory_block_ptr (get_memory_block(0 /* in_n_memory_block */) ); - bool result (false); + return read(start_offset, + size, + nullptr, /* in_physical_device_ptr */ + out_result_ptr); +} + +/* Please see header for specification */ +bool Anvil::Buffer::read(VkDeviceSize in_start_offset, + VkDeviceSize in_size, + const Anvil::PhysicalDevice* in_physical_device_ptr, + void* out_result_ptr) +{ + const Anvil::DeviceType device_type (m_device_ptr->get_type() ); + auto memory_block_ptr (get_memory_block(0 /* in_n_memory_block */) ); + bool result (false); + + ANVIL_REDUNDANT_ARGUMENT_CONST(in_physical_device_ptr); /* TODO: Support for sparse buffers */ anvil_assert(!is_sparse()); @@ -530,14 +553,13 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, { /* The buffer memory is not mappable. We need to create a staging buffer, * do a non-mappable->mappable memory copy, and then read back data from the mappable buffer. */ - const uint32_t n_transfer_queues = device_locked_ptr->get_n_transfer_queues(); - std::shared_ptr queue_ptr = (n_transfer_queues > 0) ? device_locked_ptr->get_transfer_queue (0) - : device_locked_ptr->get_universal_queue(0); - std::shared_ptr staging_buffer_ptr; - const Anvil::QueueFamilyBits staging_buffer_queue_fam_bits = (n_transfer_queues > 0) ? Anvil::QUEUE_FAMILY_DMA_BIT : Anvil::QUEUE_FAMILY_GRAPHICS_BIT; - const Anvil::QueueFamilyType staging_buffer_queue_fam_type = (n_transfer_queues > 0) ? Anvil::QUEUE_FAMILY_TYPE_TRANSFER : Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL; - - std::shared_ptr copy_cmdbuf_ptr = device_locked_ptr->get_command_pool(staging_buffer_queue_fam_type)->alloc_primary_level_command_buffer(); + const uint32_t n_transfer_queues = m_device_ptr->get_n_transfer_queues(); + Anvil::Queue* queue_ptr = (n_transfer_queues > 0) ? m_device_ptr->get_transfer_queue (0) + : m_device_ptr->get_universal_queue(0); + Anvil::BufferUniquePtr staging_buffer_ptr; + const Anvil::QueueFamilyBits staging_buffer_queue_fam_bits = (n_transfer_queues > 0) ? Anvil::QUEUE_FAMILY_DMA_BIT + : Anvil::QUEUE_FAMILY_GRAPHICS_BIT; + Anvil::PrimaryCommandBufferUniquePtr copy_cmdbuf_ptr = m_device_ptr->get_command_pool_for_queue_family_index(queue_ptr->get_queue_family_index() )->alloc_primary_level_command_buffer(); if (copy_cmdbuf_ptr == nullptr) { @@ -568,16 +590,13 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, copy_cmdbuf_ptr->start_recording(true, /* one_time_submit */ false); /* simultaneous_use_allowed */ } - else - { - anvil_assert_fail(); - } + { Anvil::BufferBarrier buffer_barrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_IGNORED, - staging_buffer_ptr, + staging_buffer_ptr.get(), 0, /* in_offset */ staging_buffer_ptr->get_size() ); VkBufferCopy copy_region; @@ -586,8 +605,8 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, copy_region.size = in_size; copy_region.srcOffset = in_start_offset; - copy_cmdbuf_ptr->record_copy_buffer (shared_from_this(), - staging_buffer_ptr, + copy_cmdbuf_ptr->record_copy_buffer (this, + staging_buffer_ptr.get(), 1, /* in_region_count */ ©_region); copy_cmdbuf_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_TRANSFER_BIT, @@ -604,13 +623,9 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) { - queue_ptr->submit_command_buffer(copy_cmdbuf_ptr, + queue_ptr->submit_command_buffer(copy_cmdbuf_ptr.get(), true /* should_block */); } - else - { - anvil_assert_fail(); - } result = staging_buffer_ptr->read(0, in_size, @@ -621,13 +636,10 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, return result; } -/* Please see header for specification */ -bool Anvil::Buffer::set_nonsparse_memory(std::shared_ptr in_memory_block_ptr) +bool Anvil::Buffer::set_memory_nonsparse_internal(MemoryBlockUniquePtr in_memory_block_ptr) { - std::shared_ptr device_locked_ptr(m_device_ptr); - bool result (false); - VkResult result_vk; - std::weak_ptr sgpu_physical_device_ptr; + bool result (false); + VkResult result_vk; if (in_memory_block_ptr == nullptr) { @@ -650,23 +662,15 @@ bool Anvil::Buffer::set_nonsparse_memory(std::shared_ptr in_ goto end; } - { - std::shared_ptr sgpu_device_locked_ptr(std::dynamic_pointer_cast(device_locked_ptr) ); - - sgpu_physical_device_ptr = sgpu_device_locked_ptr->get_physical_device(); - } - /* Bind the memory object to the buffer object */ + lock(); { - lock(); - { - result_vk = vkBindBufferMemory(device_locked_ptr->get_device_vk(), - m_buffer, - in_memory_block_ptr->get_memory (), - in_memory_block_ptr->get_start_offset() ); - } - unlock(); + result_vk = vkBindBufferMemory(m_device_ptr->get_device_vk(), + m_buffer, + in_memory_block_ptr->get_memory (), + in_memory_block_ptr->get_start_offset() ); } + unlock(); if (!is_vk_call_successful(result_vk) ) { @@ -676,38 +680,107 @@ bool Anvil::Buffer::set_nonsparse_memory(std::shared_ptr in_ } /* All done */ - m_memory_block_ptr = in_memory_block_ptr; + m_memory_block_ptr = in_memory_block_ptr.get(); result = true; + + m_owned_memory_blocks.push_back( + std::move(in_memory_block_ptr) + ); + end: return result; } /* Please see header for specification */ -bool Anvil::Buffer::set_memory_sparse(std::shared_ptr in_memory_block_ptr, - VkDeviceSize in_memory_block_start_offset, - VkDeviceSize in_start_offset, - VkDeviceSize in_size) +bool Anvil::Buffer::set_memory_sparse(MemoryBlock* in_memory_block_ptr, + bool in_memory_block_owned_by_buffer, + VkDeviceSize in_memory_block_start_offset, + VkDeviceSize in_start_offset, + VkDeviceSize in_size) { anvil_assert(m_is_sparse); - return m_page_tracker_ptr->set_binding(in_memory_block_ptr, - in_memory_block_start_offset, - in_start_offset, - in_size); + if (m_page_tracker_ptr->set_binding(in_memory_block_ptr, + in_memory_block_start_offset, + in_start_offset, + in_size) ) + { + if (in_memory_block_owned_by_buffer) + { + MemoryBlockUniquePtr mem_block_ptr(in_memory_block_ptr, + std::default_delete() ); + + m_owned_memory_blocks.push_back( + std::move(mem_block_ptr) + ); + } + + return true; + } + else + { + return false; + } +} + +/* Please see header for specification */ +bool Anvil::Buffer::set_nonsparse_memory(MemoryBlockUniquePtr in_memory_block_ptr) +{ + MemoryBlock* memory_block_raw_ptr = in_memory_block_ptr.release(); + + return set_nonsparse_memory(memory_block_raw_ptr, + true); +} + +bool Anvil::Buffer::set_nonsparse_memory(MemoryBlock* in_memory_block_ptr, + bool in_memory_block_owned_by_buffer) +{ + MemoryBlockUniquePtr memory_block_ptr; + + if (in_memory_block_owned_by_buffer) + { + memory_block_ptr = MemoryBlockUniquePtr(in_memory_block_ptr, + std::default_delete() ); + } + else + { + memory_block_ptr = MemoryBlockUniquePtr(in_memory_block_ptr, + [](MemoryBlock*) + { + /* Stub */ + }); + } + + return set_memory_nonsparse_internal(std::move(memory_block_ptr) ); } /* Please see header for specification */ -bool Anvil::Buffer::write(VkDeviceSize in_start_offset, - VkDeviceSize in_size, - const void* in_data, - std::shared_ptr in_opt_queue_ptr) +bool Anvil::Buffer::write(VkDeviceSize in_start_offset, + VkDeviceSize in_size, + const void* in_data, + Anvil::Queue* in_opt_queue_ptr) { - std::shared_ptr base_device_locked_ptr(m_device_ptr); - const Anvil::DeviceType device_type (base_device_locked_ptr->get_type() ); - bool result (false); + return write(in_start_offset, + in_size, + nullptr, + in_data, + in_opt_queue_ptr); +} + +/* Please see header for specification */ +bool Anvil::Buffer::write(VkDeviceSize in_start_offset, + VkDeviceSize in_size, + const Anvil::PhysicalDevice* in_physical_device_ptr, + const void* in_data, + Anvil::Queue* in_opt_queue_ptr) +{ + const Anvil::DeviceType device_type(m_device_ptr->get_type() ); + bool result (false); + + ANVIL_REDUNDANT_ARGUMENT(in_physical_device_ptr); /** TODO: Support for sparse-resident buffers whose n_memory_blocks > 1 */ - std::shared_ptr memory_block_ptr(get_memory_block(0) ); + Anvil::MemoryBlock* memory_block_ptr(get_memory_block(0) ); if (m_is_sparse) { @@ -727,11 +800,10 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, { /* The buffer memory is not mappable. We need to create a staging memory, * upload user's data there, and then issue a copy op. */ - std::shared_ptr copy_cmdbuf_ptr; - std::shared_ptr queue_ptr; - std::shared_ptr staging_buffer_ptr; - Anvil::QueueFamilyBits staging_buffer_queue_fam_bits = 0; - Anvil::QueueFamilyType staging_buffer_queue_fam_type = Anvil::QUEUE_FAMILY_TYPE_UNDEFINED; + Anvil::PrimaryCommandBufferUniquePtr copy_cmdbuf_ptr; + Anvil::Queue* queue_ptr = nullptr; + Anvil::BufferUniquePtr staging_buffer_ptr; + Anvil::QueueFamilyBits staging_buffer_queue_fam_bits = 0; if (m_sharing_mode == VK_SHARING_MODE_EXCLUSIVE) { @@ -743,9 +815,9 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, { switch (m_queue_families) { - case Anvil::QUEUE_FAMILY_COMPUTE_BIT: queue_ptr = base_device_locked_ptr->get_compute_queue (0); break; - case Anvil::QUEUE_FAMILY_DMA_BIT: queue_ptr = base_device_locked_ptr->get_transfer_queue (0); break; - case Anvil::QUEUE_FAMILY_GRAPHICS_BIT: queue_ptr = base_device_locked_ptr->get_universal_queue(0); break; + case Anvil::QUEUE_FAMILY_COMPUTE_BIT: queue_ptr = m_device_ptr->get_compute_queue (0); break; + case Anvil::QUEUE_FAMILY_DMA_BIT: queue_ptr = m_device_ptr->get_transfer_queue (0); break; + case Anvil::QUEUE_FAMILY_GRAPHICS_BIT: queue_ptr = m_device_ptr->get_universal_queue(0); break; default: { @@ -761,13 +833,12 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, } anvil_assert(queue_ptr != nullptr); - staging_buffer_queue_fam_type = base_device_locked_ptr->get_queue_family_type(queue_ptr->get_queue_family_index() ); - switch (staging_buffer_queue_fam_type) + switch (m_device_ptr->get_queue_family_type(queue_ptr->get_queue_family_index() ) ) { - case Anvil::QUEUE_FAMILY_TYPE_COMPUTE: staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_COMPUTE_BIT; break; - case Anvil::QUEUE_FAMILY_TYPE_TRANSFER: staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_DMA_BIT; break; - case Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL: staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_GRAPHICS_BIT; break; + case Anvil::QueueFamilyType::COMPUTE: staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_COMPUTE_BIT; break; + case Anvil::QueueFamilyType::TRANSFER: staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_DMA_BIT; break; + case Anvil::QueueFamilyType::UNIVERSAL: staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_GRAPHICS_BIT; break; default: { @@ -780,28 +851,25 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, /* We can use any queue from the list of queue fams this buffer is compatible, in order to perform the copy op. */ if ((m_queue_families & Anvil::QUEUE_FAMILY_GRAPHICS_BIT) != 0) { - queue_ptr = base_device_locked_ptr->get_universal_queue(0); + queue_ptr = m_device_ptr->get_universal_queue(0); staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_GRAPHICS_BIT; - staging_buffer_queue_fam_type = Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL; } else if ((m_queue_families & Anvil::QUEUE_FAMILY_DMA_BIT) != 0) { - queue_ptr = base_device_locked_ptr->get_transfer_queue(0); + queue_ptr = m_device_ptr->get_transfer_queue(0); staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_DMA_BIT; - staging_buffer_queue_fam_type = Anvil::QUEUE_FAMILY_TYPE_TRANSFER; } else { anvil_assert((m_queue_families & Anvil::QUEUE_FAMILY_COMPUTE_BIT) != 0) - queue_ptr = base_device_locked_ptr->get_compute_queue(0); + queue_ptr = m_device_ptr->get_compute_queue(0); staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_COMPUTE_BIT; - staging_buffer_queue_fam_type = Anvil::QUEUE_FAMILY_TYPE_COMPUTE; } } - copy_cmdbuf_ptr = base_device_locked_ptr->get_command_pool(staging_buffer_queue_fam_type)->alloc_primary_level_command_buffer(); + copy_cmdbuf_ptr = m_device_ptr->get_command_pool_for_queue_family_index(queue_ptr->get_queue_family_index() )->alloc_primary_level_command_buffer(); if (copy_cmdbuf_ptr == nullptr) { @@ -832,16 +900,13 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, copy_cmdbuf_ptr->start_recording(true, /* one_time_submit */ false); /* simultaneous_use_allowed */ } - else - { - anvil_assert_fail(); - } + { BufferBarrier buffer_barrier(VK_ACCESS_HOST_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT, VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_IGNORED, - staging_buffer_ptr, + staging_buffer_ptr.get(), 0, /* in_offset */ staging_buffer_ptr->get_size() ); VkBufferCopy copy_region; @@ -859,8 +924,8 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, &buffer_barrier, 0, /* in_image_memory_barrier_count */ nullptr); /* in_image_memory_barriers_ptr */ - copy_cmdbuf_ptr->record_copy_buffer (staging_buffer_ptr, - shared_from_this(), + copy_cmdbuf_ptr->record_copy_buffer (staging_buffer_ptr.get(), + this, 1, /* in_region_count */ ©_region); } @@ -868,13 +933,9 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) { - queue_ptr->submit_command_buffer(copy_cmdbuf_ptr, + queue_ptr->submit_command_buffer(copy_cmdbuf_ptr.get(), true /* should_block */); } - else - { - anvil_assert_fail(); - } result = true; } diff --git a/src/wrappers/buffer_view.cpp b/src/wrappers/buffer_view.cpp index d27e2484..328ec3c0 100644 --- a/src/wrappers/buffer_view.cpp +++ b/src/wrappers/buffer_view.cpp @@ -27,12 +27,12 @@ #include "wrappers/device.h" /** Please see header for specification */ -Anvil::BufferView::BufferView(std::weak_ptr in_device_ptr, - std::shared_ptr in_buffer_ptr, - VkFormat in_format, - VkDeviceSize in_start_offset, - VkDeviceSize in_size, - bool in_mt_safe) +Anvil::BufferView::BufferView(const Anvil::BaseDevice* in_device_ptr, + Anvil::Buffer* in_buffer_ptr, + VkFormat in_format, + VkDeviceSize in_start_offset, + VkDeviceSize in_size, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT), MTSafetySupportProvider (in_mt_safe), @@ -42,9 +42,8 @@ Anvil::BufferView::BufferView(std::weak_ptr in_device_ptr, m_size (in_size), m_start_offset(in_start_offset) { - VkBufferViewCreateInfo buffer_view_create_info; - std::shared_ptr device_locked_ptr(in_device_ptr); - VkResult result (VK_ERROR_INITIALIZATION_FAILED); + VkBufferViewCreateInfo buffer_view_create_info; + VkResult result (VK_ERROR_INITIALIZATION_FAILED); ANVIL_REDUNDANT_VARIABLE(result); @@ -57,7 +56,7 @@ Anvil::BufferView::BufferView(std::weak_ptr in_device_ptr, buffer_view_create_info.range = in_size; buffer_view_create_info.sType = VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO; - result = vkCreateBufferView(device_locked_ptr->get_device_vk(), + result = vkCreateBufferView(in_device_ptr->get_device_vk(), &buffer_view_create_info, nullptr, /* pAllocator */ &m_buffer_view); @@ -76,15 +75,12 @@ Anvil::BufferView::BufferView(std::weak_ptr in_device_ptr, **/ Anvil::BufferView::~BufferView() { - std::shared_ptr device_locked_ptr(m_device_ptr); - - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_BUFFER_VIEW, this); lock(); { - vkDestroyBufferView(device_locked_ptr->get_device_vk(), + vkDestroyBufferView(m_device_ptr->get_device_vk(), m_buffer_view, nullptr /* pAllocator */); } @@ -94,16 +90,17 @@ Anvil::BufferView::~BufferView() } /** Please see header for specification */ -std::shared_ptr Anvil::BufferView::create(std::weak_ptr in_device_ptr, - std::shared_ptr in_buffer_ptr, - VkFormat in_format, - VkDeviceSize in_start_offset, - VkDeviceSize in_size, - MTSafety in_mt_safety) +Anvil::BufferViewUniquePtr Anvil::BufferView::create(const Anvil::BaseDevice* in_device_ptr, + Anvil::Buffer* in_buffer_ptr, + VkFormat in_format, + VkDeviceSize in_start_offset, + VkDeviceSize in_size, + MTSafety in_mt_safety) { - const bool is_mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - std::shared_ptr result_ptr; + const bool is_mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); + BufferViewUniquePtr result_ptr = BufferViewUniquePtr(nullptr, + std::default_delete() ); /* Instantiate the object */ result_ptr.reset( diff --git a/src/wrappers/command_buffer.cpp b/src/wrappers/command_buffer.cpp index ae8b8eb3..bfb54f2b 100644 --- a/src/wrappers/command_buffer.cpp +++ b/src/wrappers/command_buffer.cpp @@ -23,12 +23,15 @@ #include "misc/base_pipeline_info.h" #include "misc/callbacks.h" #include "misc/debug.h" +#include "misc/descriptor_set_info.h" +#include "misc/struct_chainer.h" #include "wrappers/buffer.h" #include "wrappers/buffer_view.h" #include "wrappers/command_buffer.h" #include "wrappers/command_pool.h" #include "wrappers/compute_pipeline_manager.h" #include "wrappers/descriptor_set.h" +#include "wrappers/descriptor_set_layout.h" #include "wrappers/device.h" #include "wrappers/event.h" #include "wrappers/framebuffer.h" @@ -47,9 +50,9 @@ bool Anvil::CommandBufferBase::m_command_stashing_disabled = false; /** Please see header for specification */ -Anvil::CommandBufferBase::BeginQueryCommand::BeginQueryCommand(std::shared_ptr in_query_pool_ptr, - Anvil::QueryIndex in_entry, - VkQueryControlFlags in_flags) +Anvil::CommandBufferBase::BeginQueryCommand::BeginQueryCommand(Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_entry, + VkQueryControlFlags in_flags) :Command(COMMAND_TYPE_BEGIN_QUERY) { entry = in_entry; @@ -58,12 +61,13 @@ Anvil::CommandBufferBase::BeginQueryCommand::BeginQueryCommand(std::shared_ptr in_fbo_ptr, - const VkRect2D& in_render_area, - std::shared_ptr in_render_pass_ptr, - VkSubpassContents in_contents) +Anvil::BeginRenderPassCommand::BeginRenderPassCommand(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + const Anvil::PhysicalDevice* in_physical_device_ptr, + const VkRect2D& in_render_area, + Anvil::RenderPass* in_render_pass_ptr, + VkSubpassContents in_contents) :Command(COMMAND_TYPE_BEGIN_RENDER_PASS) { contents = in_contents; @@ -77,16 +81,18 @@ Anvil::BeginRenderPassCommand::BeginRenderPassCommand(uint32_t { clear_values.push_back(in_clear_value_ptrs[n_clear_value]); } + + physical_device_ptr = in_physical_device_ptr; } /** Please see header for specification */ -Anvil::CommandBufferBase::BindDescriptorSetsCommand::BindDescriptorSetsCommand(VkPipelineBindPoint in_pipeline_bind_point, - std::shared_ptr in_layout_ptr, - uint32_t in_first_set, - uint32_t in_set_count, - std::shared_ptr* in_descriptor_set_ptrs, - uint32_t in_dynamic_offset_count, - const uint32_t* in_dynamic_offset_ptrs) +Anvil::CommandBufferBase::BindDescriptorSetsCommand::BindDescriptorSetsCommand(VkPipelineBindPoint in_pipeline_bind_point, + Anvil::PipelineLayout* in_layout_ptr, + uint32_t in_first_set, + uint32_t in_set_count, + const Anvil::DescriptorSet* const* in_descriptor_set_ptrs, + uint32_t in_dynamic_offset_count, + const uint32_t* in_dynamic_offset_ptrs) :Command(COMMAND_TYPE_BIND_DESCRIPTOR_SETS) { first_set = in_first_set; @@ -109,9 +115,9 @@ Anvil::CommandBufferBase::BindDescriptorSetsCommand::BindDescriptorSetsCommand(V } /** Please see header for specification */ -Anvil::CommandBufferBase::BindIndexBufferCommand::BindIndexBufferCommand(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - VkIndexType in_index_type) +Anvil::CommandBufferBase::BindIndexBufferCommand::BindIndexBufferCommand(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkIndexType in_index_type) :Command(COMMAND_TYPE_BIND_INDEX_BUFFER) { buffer = in_buffer_ptr->get_buffer(); @@ -130,10 +136,10 @@ Anvil::CommandBufferBase::BindPipelineCommand::BindPipelineCommand(VkPipelineBin } /** Please see header for specification */ -Anvil::CommandBufferBase::BindVertexBuffersCommand::BindVertexBuffersCommand(uint32_t in_start_binding, - uint32_t in_binding_count, - std::shared_ptr* in_buffer_ptrs, - const VkDeviceSize* in_offset_ptrs) +Anvil::CommandBufferBase::BindVertexBuffersCommand::BindVertexBuffersCommand(uint32_t in_start_binding, + uint32_t in_binding_count, + Anvil::Buffer** in_buffer_ptrs, + const VkDeviceSize* in_offset_ptrs) :Command(COMMAND_TYPE_BIND_VERTEX_BUFFER) { start_binding = in_start_binding; @@ -156,8 +162,8 @@ Anvil::CommandBufferBase::BindVertexBuffersCommandBinding::BindVertexBuffersComm } /** Please see header for specification */ -Anvil::CommandBufferBase::BindVertexBuffersCommandBinding::BindVertexBuffersCommandBinding(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset) +Anvil::CommandBufferBase::BindVertexBuffersCommandBinding::BindVertexBuffersCommandBinding(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset) { buffer = in_buffer_ptr->get_buffer(); buffer_ptr = in_buffer_ptr; @@ -165,13 +171,13 @@ Anvil::CommandBufferBase::BindVertexBuffersCommandBinding::BindVertexBuffersComm } /** Please see header for specification */ -Anvil::CommandBufferBase::BlitImageCommand::BlitImageCommand(std::shared_ptr in_src_image_ptr, - VkImageLayout in_src_image_layout, - std::shared_ptr in_dst_image_ptr, - VkImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageBlit* in_region_ptrs, - VkFilter in_filter) +Anvil::CommandBufferBase::BlitImageCommand::BlitImageCommand(Anvil::Image* in_src_image_ptr, + VkImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + VkImageLayout in_dst_image_layout, + uint32_t in_region_count, + const VkImageBlit* in_region_ptrs, + VkFilter in_filter) :Command(COMMAND_TYPE_BLIT_IMAGE) { dst_image = in_dst_image_ptr->get_image(); @@ -215,7 +221,7 @@ Anvil::CommandBufferBase::ClearAttachmentsCommand::ClearAttachmentsCommand(uint3 } /** Please see header for specification */ -Anvil::CommandBufferBase::ClearColorImageCommand::ClearColorImageCommand(std::shared_ptr in_image_ptr, +Anvil::CommandBufferBase::ClearColorImageCommand::ClearColorImageCommand(Anvil::Image* in_image_ptr, VkImageLayout in_image_layout, const VkClearColorValue* in_color_ptr, uint32_t in_range_count, @@ -236,7 +242,7 @@ Anvil::CommandBufferBase::ClearColorImageCommand::ClearColorImageCommand(std::sh } /** Please see header for specification */ -Anvil::CommandBufferBase::ClearDepthStencilImageCommand::ClearDepthStencilImageCommand(std::shared_ptr in_image_ptr, +Anvil::CommandBufferBase::ClearDepthStencilImageCommand::ClearDepthStencilImageCommand(Anvil::Image* in_image_ptr, VkImageLayout in_image_layout, const VkClearDepthStencilValue* in_depth_stencil_ptr, uint32_t in_range_count, @@ -257,10 +263,10 @@ Anvil::CommandBufferBase::ClearDepthStencilImageCommand::ClearDepthStencilImageC } /** Please see header for specification */ -Anvil::CommandBufferBase::CopyBufferCommand::CopyBufferCommand(std::shared_ptr in_src_buffer_ptr, - std::shared_ptr in_dst_buffer_ptr, - uint32_t in_region_count, - const VkBufferCopy* in_region_ptrs) +Anvil::CommandBufferBase::CopyBufferCommand::CopyBufferCommand(Anvil::Buffer* in_src_buffer_ptr, + Anvil::Buffer* in_dst_buffer_ptr, + uint32_t in_region_count, + const VkBufferCopy* in_region_ptrs) :Command(COMMAND_TYPE_COPY_BUFFER) { dst_buffer = in_dst_buffer_ptr->get_buffer(); @@ -277,11 +283,11 @@ Anvil::CommandBufferBase::CopyBufferCommand::CopyBufferCommand(std::shared_ptr in_src_buffer_ptr, - std::shared_ptr in_dst_image_ptr, - VkImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkBufferImageCopy* in_region_ptrs) +Anvil::CommandBufferBase::CopyBufferToImageCommand::CopyBufferToImageCommand(Anvil::Buffer* in_src_buffer_ptr, + Anvil::Image* in_dst_image_ptr, + VkImageLayout in_dst_image_layout, + uint32_t in_region_count, + const VkBufferImageCopy* in_region_ptrs) :Command(COMMAND_TYPE_COPY_BUFFER_TO_IMAGE) { dst_image = in_dst_image_ptr->get_image(); @@ -299,12 +305,12 @@ Anvil::CommandBufferBase::CopyBufferToImageCommand::CopyBufferToImageCommand(std } /** Please see header for specification */ -Anvil::CommandBufferBase::CopyImageCommand::CopyImageCommand(std::shared_ptr in_src_image_ptr, - VkImageLayout in_src_image_layout, - std::shared_ptr in_dst_image_ptr, - VkImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageCopy* in_region_ptrs) +Anvil::CommandBufferBase::CopyImageCommand::CopyImageCommand(Anvil::Image* in_src_image_ptr, + VkImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + VkImageLayout in_dst_image_layout, + uint32_t in_region_count, + const VkImageCopy* in_region_ptrs) :Command(COMMAND_TYPE_COPY_IMAGE) { dst_image = in_dst_image_ptr->get_image(); @@ -323,11 +329,11 @@ Anvil::CommandBufferBase::CopyImageCommand::CopyImageCommand(std::shared_ptr in_src_image_ptr, - VkImageLayout in_src_image_layout, - std::shared_ptr in_dst_buffer_ptr, - uint32_t in_region_count, - const VkBufferImageCopy* in_region_ptrs) +Anvil::CommandBufferBase::CopyImageToBufferCommand::CopyImageToBufferCommand(Anvil::Image* in_src_image_ptr, + VkImageLayout in_src_image_layout, + Anvil::Buffer* in_dst_buffer_ptr, + uint32_t in_region_count, + const VkBufferImageCopy* in_region_ptrs) :Command(COMMAND_TYPE_COPY_IMAGE_TO_BUFFER) { dst_buffer = in_dst_buffer_ptr->get_buffer(); @@ -345,13 +351,13 @@ Anvil::CommandBufferBase::CopyImageToBufferCommand::CopyImageToBufferCommand(std } /** Please see header for specification */ -Anvil::CommandBufferBase::CopyQueryPoolResultsCommand::CopyQueryPoolResultsCommand(std::shared_ptr in_query_pool_ptr, - Anvil::QueryIndex in_start_query, - uint32_t in_query_count, - std::shared_ptr in_dst_buffer_ptr, - VkDeviceSize in_dst_offset, - VkDeviceSize in_dst_stride, - VkQueryResultFlags in_flags) +Anvil::CommandBufferBase::CopyQueryPoolResultsCommand::CopyQueryPoolResultsCommand(Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_start_query, + uint32_t in_query_count, + Anvil::Buffer* in_dst_buffer_ptr, + VkDeviceSize in_dst_offset, + VkDeviceSize in_dst_stride, + VkQueryResultFlags in_flags) :Command(COMMAND_TYPE_COPY_QUERY_POOL_RESULTS) { dst_buffer = in_dst_buffer_ptr->get_buffer(); @@ -425,8 +431,8 @@ Anvil::CommandBufferBase::DispatchCommand::DispatchCommand(uint32_t in_x, } /** Please see header for specification */ -Anvil::CommandBufferBase::DispatchIndirectCommand::DispatchIndirectCommand(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset) +Anvil::CommandBufferBase::DispatchIndirectCommand::DispatchIndirectCommand(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset) :Command(COMMAND_TYPE_DISPATCH_INDIRECT) { buffer = in_buffer_ptr->get_buffer(); @@ -463,10 +469,10 @@ Anvil::CommandBufferBase::DrawIndexedCommand::DrawIndexedCommand(uint32_t in_ind } /** Please see header for specification */ -Anvil::CommandBufferBase::DrawIndexedIndirectCommand::DrawIndexedIndirectCommand(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - uint32_t in_draw_count, - uint32_t in_stride) +Anvil::CommandBufferBase::DrawIndexedIndirectCommand::DrawIndexedIndirectCommand(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + uint32_t in_draw_count, + uint32_t in_stride) :Command(COMMAND_TYPE_DRAW_INDEXED_INDIRECT) { buffer = in_buffer_ptr->get_buffer(); @@ -477,12 +483,12 @@ Anvil::CommandBufferBase::DrawIndexedIndirectCommand::DrawIndexedIndirectCommand } /** Please see header for specification */ -Anvil::CommandBufferBase::DrawIndexedIndirectCountAMDCommand::DrawIndexedIndirectCountAMDCommand(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - std::shared_ptr in_count_buffer_ptr, - VkDeviceSize in_count_offset, - uint32_t in_max_draw_count, - uint32_t in_stride) +Anvil::CommandBufferBase::DrawIndexedIndirectCountAMDCommand::DrawIndexedIndirectCountAMDCommand(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + Anvil::Buffer* in_count_buffer_ptr, + VkDeviceSize in_count_offset, + uint32_t in_max_draw_count, + uint32_t in_stride) :Command(COMMAND_TYPE_DRAW_INDEXED_INDIRECT_COUNT_AMD) { buffer = in_buffer_ptr->get_buffer(); @@ -496,10 +502,10 @@ Anvil::CommandBufferBase::DrawIndexedIndirectCountAMDCommand::DrawIndexedIndirec } /** Please see header for specification */ -Anvil::CommandBufferBase::DrawIndirectCommand::DrawIndirectCommand(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - uint32_t in_count, - uint32_t in_stride) +Anvil::CommandBufferBase::DrawIndirectCommand::DrawIndirectCommand(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + uint32_t in_count, + uint32_t in_stride) :Command(COMMAND_TYPE_DRAW_INDIRECT) { buffer = in_buffer_ptr->get_buffer(); @@ -510,12 +516,12 @@ Anvil::CommandBufferBase::DrawIndirectCommand::DrawIndirectCommand(std::shared_p } /** Please see header for specification */ -Anvil::CommandBufferBase::DrawIndirectCountAMDCommand::DrawIndirectCountAMDCommand(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - std::shared_ptr in_count_buffer_ptr, - VkDeviceSize in_count_offset, - uint32_t in_max_draw_count, - uint32_t in_stride) +Anvil::CommandBufferBase::DrawIndirectCountAMDCommand::DrawIndirectCountAMDCommand(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + Anvil::Buffer* in_count_buffer_ptr, + VkDeviceSize in_count_offset, + uint32_t in_max_draw_count, + uint32_t in_stride) :Command(COMMAND_TYPE_DRAW_INDIRECT_COUNT_AMD) { buffer = in_buffer_ptr->get_buffer(); @@ -529,8 +535,8 @@ Anvil::CommandBufferBase::DrawIndirectCountAMDCommand::DrawIndirectCountAMDComma } /** Please see header for specification */ -Anvil::CommandBufferBase::EndQueryCommand::EndQueryCommand(std::shared_ptr in_query_pool_ptr, - Anvil::QueryIndex in_entry) +Anvil::CommandBufferBase::EndQueryCommand::EndQueryCommand(Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_entry) :Command(COMMAND_TYPE_END_QUERY) { entry = in_entry; @@ -544,8 +550,8 @@ Anvil::EndRenderPassCommand::EndRenderPassCommand() } /** Please see header for specification */ -Anvil::CommandBufferBase::ExecuteCommandsCommand::ExecuteCommandsCommand(uint32_t in_cmd_buffers_count, - std::shared_ptr* in_cmd_buffer_ptrs) +Anvil::CommandBufferBase::ExecuteCommandsCommand::ExecuteCommandsCommand(uint32_t in_cmd_buffers_count, + Anvil::SecondaryCommandBuffer** in_cmd_buffer_ptrs) :Command(COMMAND_TYPE_EXECUTE_COMMANDS) { for (uint32_t n_cmd_buffer = 0; @@ -558,10 +564,10 @@ Anvil::CommandBufferBase::ExecuteCommandsCommand::ExecuteCommandsCommand(uint32_ } /** Please see header for specification */ -Anvil::CommandBufferBase::FillBufferCommand::FillBufferCommand(std::shared_ptr in_dst_buffer_ptr, - VkDeviceSize in_dst_offset, - VkDeviceSize in_size, - uint32_t in_data) +Anvil::CommandBufferBase::FillBufferCommand::FillBufferCommand(Anvil::Buffer* in_dst_buffer_ptr, + VkDeviceSize in_dst_offset, + VkDeviceSize in_size, + uint32_t in_data) :Command(COMMAND_TYPE_FILL_BUFFER) { data = in_data; @@ -617,11 +623,11 @@ Anvil::PipelineBarrierCommand::PipelineBarrierCommand(VkPipelineStageFlags } /** Please see header for specification */ -Anvil::CommandBufferBase::PushConstantsCommand::PushConstantsCommand(std::shared_ptr in_layout_ptr, - VkShaderStageFlags in_stage_flags, - uint32_t in_offset, - uint32_t in_size, - const void* in_values) +Anvil::CommandBufferBase::PushConstantsCommand::PushConstantsCommand(Anvil::PipelineLayout* in_layout_ptr, + VkShaderStageFlags in_stage_flags, + uint32_t in_offset, + uint32_t in_size, + const void* in_values) :Command(COMMAND_TYPE_PUSH_CONSTANTS) { layout_ptr = in_layout_ptr; @@ -632,8 +638,8 @@ Anvil::CommandBufferBase::PushConstantsCommand::PushConstantsCommand(std::shared } /** Please see header for specification */ -Anvil::CommandBufferBase::ResetEventCommand::ResetEventCommand(std::shared_ptr in_event_ptr, - VkPipelineStageFlags in_stage_mask) +Anvil::CommandBufferBase::ResetEventCommand::ResetEventCommand(Anvil::Event* in_event_ptr, + VkPipelineStageFlags in_stage_mask) :Command(COMMAND_TYPE_RESET_EVENT) { event = in_event_ptr->get_event(); @@ -642,9 +648,9 @@ Anvil::CommandBufferBase::ResetEventCommand::ResetEventCommand(std::shared_ptr in_query_pool_ptr, - Anvil::QueryIndex in_start_query, - uint32_t in_query_count) +Anvil::CommandBufferBase::ResetQueryPoolCommand::ResetQueryPoolCommand(Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_start_query, + uint32_t in_query_count) :Command(COMMAND_TYPE_RESET_QUERY_POOL) { query_count = in_query_count; @@ -653,12 +659,12 @@ Anvil::CommandBufferBase::ResetQueryPoolCommand::ResetQueryPoolCommand(std::shar } /** Please see header for specification */ -Anvil::CommandBufferBase::ResolveImageCommand::ResolveImageCommand(std::shared_ptr in_src_image_ptr, - VkImageLayout in_src_image_layout, - std::shared_ptr in_dst_image_ptr, - VkImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageResolve* in_region_ptrs) +Anvil::CommandBufferBase::ResolveImageCommand::ResolveImageCommand(Anvil::Image* in_src_image_ptr, + VkImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + VkImageLayout in_dst_image_layout, + uint32_t in_region_count, + const VkImageResolve* in_region_ptrs) :Command(COMMAND_TYPE_RESOLVE_IMAGE) { dst_image = in_dst_image_ptr->get_image(); @@ -706,8 +712,8 @@ Anvil::CommandBufferBase::SetDepthBoundsCommand::SetDepthBoundsCommand(float in_ } /** Please see header for specification */ -Anvil::CommandBufferBase::SetEventCommand::SetEventCommand(std::shared_ptr in_event_ptr, - VkPipelineStageFlags in_stage_mask) +Anvil::CommandBufferBase::SetEventCommand::SetEventCommand(Anvil::Event* in_event_ptr, + VkPipelineStageFlags in_stage_mask) :Command(COMMAND_TYPE_SET_EVENT) { event = in_event_ptr->get_event(); @@ -782,10 +788,10 @@ Anvil::CommandBufferBase::SetViewportCommand::SetViewportCommand(uint32_t } /** Please see header for specification */ -Anvil::CommandBufferBase::UpdateBufferCommand::UpdateBufferCommand(std::shared_ptr in_dst_buffer_ptr, - VkDeviceSize in_dst_offset, - VkDeviceSize in_data_size, - const uint32_t* in_data_ptr) +Anvil::CommandBufferBase::UpdateBufferCommand::UpdateBufferCommand(Anvil::Buffer* in_dst_buffer_ptr, + VkDeviceSize in_dst_offset, + VkDeviceSize in_data_size, + const uint32_t* in_data_ptr) :Command(COMMAND_TYPE_UPDATE_BUFFER) { data_ptr = in_data_ptr; @@ -796,16 +802,16 @@ Anvil::CommandBufferBase::UpdateBufferCommand::UpdateBufferCommand(std::shared_p } /** Please see header for specification */ -Anvil::CommandBufferBase::WaitEventsCommand::WaitEventsCommand(uint32_t in_event_count, - std::shared_ptr* in_event_ptrs, - VkPipelineStageFlags in_src_stage_mask, - VkPipelineStageFlags in_dst_stage_mask, - uint32_t in_memory_barrier_count, - const MemoryBarrier* const in_memory_barriers_ptr, - uint32_t in_buffer_memory_barrier_count, - const BufferBarrier* const in_buffer_memory_barriers_ptr, - uint32_t in_image_memory_barrier_count, - const ImageBarrier* const in_image_memory_barriers_ptr) +Anvil::CommandBufferBase::WaitEventsCommand::WaitEventsCommand(uint32_t in_event_count, + Anvil::Event* const* in_event_ptrs, + VkPipelineStageFlags in_src_stage_mask, + VkPipelineStageFlags in_dst_stage_mask, + uint32_t in_memory_barrier_count, + const MemoryBarrier* const in_memory_barriers_ptr, + uint32_t in_buffer_memory_barrier_count, + const BufferBarrier* const in_buffer_memory_barriers_ptr, + uint32_t in_image_memory_barrier_count, + const ImageBarrier* const in_image_memory_barriers_ptr) :Command(COMMAND_TYPE_WAIT_EVENTS) { dst_stage_mask = static_cast(in_dst_stage_mask); @@ -842,9 +848,9 @@ Anvil::CommandBufferBase::WaitEventsCommand::WaitEventsCommand(uint32_t } /** Please see header for specification */ -Anvil::CommandBufferBase::WriteTimestampCommand::WriteTimestampCommand(VkPipelineStageFlagBits in_pipeline_stage, - std::shared_ptr in_query_pool_ptr, - Anvil::QueryIndex in_entry) +Anvil::CommandBufferBase::WriteTimestampCommand::WriteTimestampCommand(VkPipelineStageFlagBits in_pipeline_stage, + Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_entry) :Command(COMMAND_TYPE_WRITE_TIMESTAMP) { entry = in_entry; @@ -859,10 +865,10 @@ Anvil::CommandBufferBase::WriteTimestampCommand::WriteTimestampCommand(VkPipelin * @param parent_command_pool_ptr Command pool to allocate the commands from. Must not be nullptr. * @param type Command buffer type **/ -Anvil::CommandBufferBase::CommandBufferBase(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_command_pool_ptr, - Anvil::CommandBufferType in_type, - bool in_mt_safe) +Anvil::CommandBufferBase::CommandBufferBase(const Anvil::BaseDevice* in_device_ptr, + Anvil::CommandPool* in_parent_command_pool_ptr, + Anvil::CommandBufferType in_type, + bool in_mt_safe) :MTSafetySupportProvider (in_mt_safe), DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT), @@ -872,7 +878,6 @@ Anvil::CommandBufferBase::CommandBufferBase(std::weak_ptr m_is_renderpass_active (false), m_parent_command_pool_ptr (in_parent_command_pool_ptr), m_recording_in_progress (false), - m_renderpass_device_mask (0), m_type (in_type) { anvil_assert(in_parent_command_pool_ptr != nullptr); @@ -888,23 +893,20 @@ Anvil::CommandBufferBase::~CommandBufferBase() { anvil_assert(!m_recording_in_progress); - if (m_command_buffer != VK_NULL_HANDLE && - m_parent_command_pool_ptr.expired() == false) + if (m_command_buffer != VK_NULL_HANDLE && + m_parent_command_pool_ptr != nullptr) { - std::shared_ptr command_pool_locked_ptr(m_parent_command_pool_ptr); - std::shared_ptr device_locked_ptr (m_device_ptr); - /* Physically free the command buffer we own */ - command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { - vkFreeCommandBuffers(device_locked_ptr->get_device_vk(), - command_pool_locked_ptr->get_command_pool(), + vkFreeCommandBuffers(m_device_ptr->get_device_vk(), + m_parent_command_pool_ptr->get_command_pool(), 1, /* commandBufferCount */ &m_command_buffer); } unlock(); - command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); m_command_buffer = VK_NULL_HANDLE; } @@ -916,395 +918,6 @@ Anvil::CommandBufferBase::~CommandBufferBase() #endif } -/** Stores a specified buffer instance in m_referenced_buffers if the buffer has not already been cached. - * - * @param in_buffer_ptr Buffer instance to cache. Must not be null. - **/ -void Anvil::CommandBufferBase::cache_referenced_buffer(std::shared_ptr in_buffer_ptr) -{ - auto buffer_iterator = std::find(m_referenced_buffers.begin(), - m_referenced_buffers.end(), - in_buffer_ptr); - - if (buffer_iterator == m_referenced_buffers.end() ) - { - /* Anvil's Memory Allocator defers memory allocation in time unless the user explicitly requested a bake operation. - * - * vkCmd*() commands may use memory backing which is bound to the object at command recording time. For implicit - * baking op to work correctly, we therefore need to ensure all scheduled allocs are handled BEFORE the vkCmd*() - * invocation is passed down to the driver. - */ - - /* NOTE: Buffer::get_memory_block() triggers implicit bake op if needed */ - auto buffer_mem_block_ptr = in_buffer_ptr->get_memory_block(0); - - ANVIL_REDUNDANT_VARIABLE(buffer_mem_block_ptr); - - m_referenced_buffers.push_back(in_buffer_ptr); - } -} - -/** Stores a specified command buffer instance in m_referenced_command_buffers if the cmd buffer has not already been cached. - * - * @param in_cmd_buffer_ptr Command buffer instance to cache. Must not be null. - **/ -void Anvil::CommandBufferBase::cache_referenced_command_buffer(std::shared_ptr in_cmd_buffer_ptr) -{ - auto cmd_buffer_iterator = std::find(m_referenced_command_buffers.begin(), - m_referenced_command_buffers.end(), - in_cmd_buffer_ptr); - - if (cmd_buffer_iterator == m_referenced_command_buffers.end() ) - { - m_referenced_command_buffers.push_back(in_cmd_buffer_ptr); - } -} - -/** Stores a specified descriptor set instance in m_referenced_descriptor_sets if the DS instance has not - * already been cached, along with underlying objects specified DS' bindings refer to. The latter are cached - * in corresponding m_referenced_* vectors. - * - * @param in_ds_ptr Descriptor set instance to cache. Must not be null. - **/ -void Anvil::CommandBufferBase::cache_referenced_descriptor_set(std::shared_ptr in_ds_ptr) -{ - decltype(m_referenced_descriptor_sets)::iterator ds_iterator; - const uint32_t n_bindings = in_ds_ptr->get_n_bindings(); - - /* Extract any buffer / image instances from container objects and cache them separately. - * This is needed for implicit memory allocation bake support. - * - * Other object types need not be cached exclusively, as caching the descriptor set will automatically imply - * the objects owned by DS do not go out of scope. - */ - for (uint32_t n_binding = 0; - n_binding < n_bindings; - ++n_binding) - { - VkDescriptorType current_binding_type; - uint32_t n_binding_array_items = 0; - - if (!in_ds_ptr->get_binding_array_size(n_binding, - &n_binding_array_items) ) - { - continue; - } - - if (n_binding_array_items > 0) - { - if (!in_ds_ptr->get_binding_descriptor_type(n_binding, - ¤t_binding_type) ) - { - /* This should never happen */ - anvil_assert_fail(); - - continue; - } - - for (uint32_t n_binding_array_item = 0; - n_binding_array_item < n_binding_array_items; - ++n_binding_array_item) - { - switch (current_binding_type) - { - case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER: - { - std::shared_ptr image_view_ptr; - - if (!in_ds_ptr->get_combined_image_sampler_binding_properties(n_binding, - n_binding_array_item, - nullptr, /* out_opt_image_layout_ptr */ - &image_view_ptr, - nullptr) ) /* out_opt_sampler_ptr */ - { - /* This should never happen */ - anvil_assert_fail(); - - continue; - } - - cache_referenced_image(image_view_ptr->get_parent_image() ); - break; - } - - case VK_DESCRIPTOR_TYPE_SAMPLER: - { - /* Don't care */ - break; - } - - case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT: - { - std::shared_ptr image_view_ptr; - - if (!in_ds_ptr->get_input_attachment_binding_properties(n_binding, - n_binding_array_item, - nullptr, /* out_opt_image_layout_ptr */ - &image_view_ptr) ) - { - /* This should never happen */ - anvil_assert_fail(); - - continue; - } - - cache_referenced_image(image_view_ptr->get_parent_image() ); - break; - } - - case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE: - { - std::shared_ptr image_view_ptr; - - if (!in_ds_ptr->get_sampled_image_binding_properties(n_binding, - n_binding_array_item, - nullptr, /* out_opt_image_layout_ptr */ - &image_view_ptr) ) - { - /* This should never happen */ - anvil_assert_fail(); - - continue; - } - - cache_referenced_image(image_view_ptr->get_parent_image() ); - break; - } - - case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: - { - std::shared_ptr image_view_ptr; - - if (!in_ds_ptr->get_storage_image_binding_properties(n_binding, - n_binding_array_item, - nullptr, /* out_opt_image_layout_ptr */ - &image_view_ptr) ) - { - /* This should never happen */ - anvil_assert_fail(); - - continue; - } - - cache_referenced_image(image_view_ptr->get_parent_image() ); - break; - } - - case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: - case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: - { - std::shared_ptr buffer_ptr; - - if (!in_ds_ptr->get_storage_buffer_binding_properties(n_binding, - n_binding_array_item, - &buffer_ptr, - nullptr, /* out_opt_size_ptr */ - nullptr) ) /* out_opt_start_offset_ptr */ - { - /* This should never happen */ - anvil_assert_fail(); - - continue; - } - - cache_referenced_buffer(buffer_ptr); - break; - } - - case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: - { - std::shared_ptr buffer_view_ptr; - - if (!in_ds_ptr->get_storage_texel_buffer_binding_properties(n_binding, - n_binding_array_item, - &buffer_view_ptr) ) - { - /* This should never happen */ - anvil_assert_fail(); - - continue; - } - - cache_referenced_buffer(buffer_view_ptr->get_parent_buffer() ); - break; - } - - - case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER: - case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: - { - std::shared_ptr buffer_ptr; - - if (!in_ds_ptr->get_uniform_buffer_binding_properties(n_binding, - n_binding_array_item, - &buffer_ptr, - nullptr, /* out_opt_size_ptr */ - nullptr) ) /* out_opt_start_offset_ptr */ - { - /* This should never happen */ - anvil_assert_fail(); - - continue; - } - - cache_referenced_buffer(buffer_ptr); - break; - } - - case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: - { - std::shared_ptr buffer_view_ptr; - - if (!in_ds_ptr->get_uniform_texel_buffer_binding_properties(n_binding, - n_binding_array_item, - &buffer_view_ptr) ) - { - /* This should never happen */ - anvil_assert_fail(); - - continue; - } - - cache_referenced_buffer(buffer_view_ptr->get_parent_buffer() ); - break; - } - - default: - { - anvil_assert_fail(); - } - } - } - } - } - - ds_iterator = std::find(m_referenced_descriptor_sets.begin(), - m_referenced_descriptor_sets.end(), - in_ds_ptr); - - if (ds_iterator == m_referenced_descriptor_sets.end() ) - { - m_referenced_descriptor_sets.push_back(in_ds_ptr); - } -} - -/** Stores a specified event instance in m_referenced_events, if the event has not already been cached. - * - * @param in_event_ptr Event instance to cache. Must not be null. - **/ -void Anvil::CommandBufferBase::cache_referenced_event(std::shared_ptr in_event_ptr) -{ - auto event_iterator = std::find(m_referenced_events.begin(), - m_referenced_events.end(), - in_event_ptr); - - if (event_iterator == m_referenced_events.end() ) - { - m_referenced_events.push_back(in_event_ptr); - } -} - -/** Stores a specified framebuffer instance in m_referenced_framebuffers, if the framebuffer has not already been cached. - * Any attachments defined for the FB are also cached. - * - * @param in_fb_ptr Framebuffer instance to cache. Must not be null. - **/ -void Anvil::CommandBufferBase::cache_referenced_framebuffer(std::shared_ptr in_fb_ptr) -{ - decltype(m_referenced_framebuffers)::iterator fb_iterator; - const auto n_attachments = in_fb_ptr->get_n_attachments(); - - /* Extract image instances that the specified framebuffer points to. This is needed for - * implicit memory allocation bake support. - */ - for (uint32_t n_attachment = 0; - n_attachment < n_attachments; - ++n_attachment) - { - std::shared_ptr image_view_ptr; - - if (!in_fb_ptr->get_attachment_at_index(n_attachment, - &image_view_ptr) ) - { - /* This should never happen */ - anvil_assert_fail(); - - continue; - } - - cache_referenced_image(image_view_ptr->get_parent_image() ); - } - - fb_iterator = std::find(m_referenced_framebuffers.begin(), - m_referenced_framebuffers.end(), - in_fb_ptr); - - if (fb_iterator == m_referenced_framebuffers.end() ) - { - m_referenced_framebuffers.push_back(in_fb_ptr); - } -} - -/** Stores a specified image instance in m_referenced_images, if the image has not already been cached. - * - * @param in_image_ptr Image instance to cache. Must not be null. - **/ -void Anvil::CommandBufferBase::cache_referenced_image(std::shared_ptr in_image_ptr) -{ - auto image_iterator = std::find(m_referenced_images.begin(), - m_referenced_images.end(), - in_image_ptr); - - if (image_iterator == m_referenced_images.end() ) - { - /* Anvil's Memory Allocator defers memory allocation in time unless the user explicitly requested a bake operation. - * - * vkCmd*() commands may use memory backing which is bound to the object at command recording time. For implicit - * baking op to work correctly, we therefore need to ensure all scheduled allocs are handled BEFORE the vkCmd*() - * invocation is passed down to the driver. - */ - - /* NOTE: Image::get_memory_block() triggers implicit bake op if needed */ - auto image_mem_block_ptr = in_image_ptr->get_memory_block(); - - ANVIL_REDUNDANT_VARIABLE(image_mem_block_ptr); - - m_referenced_images.push_back(in_image_ptr); - } -} - -/** Stores a specified query pool instance in m_referenced_query_pools, if the query pool has not already been cached. - * - * @param in_query_pool_ptr Query pool instance to cache. Must not be null. - **/ -void Anvil::CommandBufferBase::cache_referenced_query_pool(std::shared_ptr in_query_pool_ptr) -{ - auto qp_iterator = std::find(m_referenced_query_pools.begin(), - m_referenced_query_pools.end(), - in_query_pool_ptr); - - if (qp_iterator == m_referenced_query_pools.end() ) - { - m_referenced_query_pools.push_back(in_query_pool_ptr); - } -} - -/** Stores a specified renderpass instance in m_referenced_renderpasses, if the renderpass has not already been cached. - * - * @param in_renderpass_ptr Renderpass instance to cache. Must not be null. - **/ -void Anvil::CommandBufferBase::cache_referenced_renderpass(std::shared_ptr in_renderpass_ptr) -{ - auto rp_iterator = std::find(m_referenced_renderpasses.begin(), - m_referenced_renderpasses.end(), - in_renderpass_ptr); - - if (rp_iterator == m_referenced_renderpasses.end() ) - { - m_referenced_renderpasses.push_back(in_renderpass_ptr); - } -} - #ifdef STORE_COMMAND_BUFFER_COMMANDS /** Clears the command vector by releasing all command descriptors back to the heap memory. */ void Anvil::CommandBufferBase::clear_commands() @@ -1313,27 +926,13 @@ void Anvil::CommandBufferBase::cache_referenced_renderpass(std::shared_ptr in_query_pool_ptr, - Anvil::QueryIndex in_entry, - VkQueryControlFlags in_flags) +bool Anvil::CommandBufferBase::record_begin_query(Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_entry, + VkQueryControlFlags in_flags) { /* NOTE: The command can be executed both inside and outside a renderpass */ - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (!m_recording_in_progress) { @@ -1353,9 +952,7 @@ bool Anvil::CommandBufferBase::record_begin_query(std::shared_ptrlock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdBeginQuery(m_command_buffer, @@ -1364,7 +961,7 @@ bool Anvil::CommandBufferBase::record_begin_query(std::shared_ptrunlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -1372,18 +969,17 @@ bool Anvil::CommandBufferBase::record_begin_query(std::shared_ptr in_layout_ptr, - uint32_t in_first_set, - uint32_t in_set_count, - std::shared_ptr* in_descriptor_set_ptrs, - uint32_t in_dynamic_offset_count, - const uint32_t* in_dynamic_offset_ptrs) +bool Anvil::CommandBufferBase::record_bind_descriptor_sets(VkPipelineBindPoint in_pipeline_bind_point, + Anvil::PipelineLayout* in_layout_ptr, + uint32_t in_first_set, + uint32_t in_set_count, + const Anvil::DescriptorSet* const* in_descriptor_set_ptrs, + uint32_t in_dynamic_offset_count, + const uint32_t* in_dynamic_offset_ptrs) { /* Note: Command supported inside and outside the renderpass. */ - VkDescriptorSet dss_vk[100]; - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + auto dss_vk = std::vector(in_set_count); + bool result = false; anvil_assert(in_set_count < sizeof(dss_vk) / sizeof(dss_vk[0]) ); @@ -1391,7 +987,7 @@ bool Anvil::CommandBufferBase::record_bind_descriptor_sets(VkPipelineBindPoint n_set < in_set_count; ++n_set) { - dss_vk[n_set] = in_descriptor_set_ptrs[n_set]->get_descriptor_set_vk(); + dss_vk.at(n_set) = in_descriptor_set_ptrs[n_set]->get_descriptor_set_vk(); } if (!m_recording_in_progress) @@ -1416,14 +1012,7 @@ bool Anvil::CommandBufferBase::record_bind_descriptor_sets(VkPipelineBindPoint } #endif - for (uint32_t n_ds = 0; - n_ds < in_set_count; - ++n_ds) - { - cache_referenced_descriptor_set(in_descriptor_set_ptrs[n_ds]); - } - - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdBindDescriptorSets(m_command_buffer, @@ -1431,12 +1020,12 @@ bool Anvil::CommandBufferBase::record_bind_descriptor_sets(VkPipelineBindPoint in_layout_ptr->get_pipeline_layout(), in_first_set, in_set_count, - dss_vk, + (in_set_count > 0) ? &dss_vk.at(0) : nullptr, in_dynamic_offset_count, in_dynamic_offset_ptrs); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -1444,13 +1033,12 @@ bool Anvil::CommandBufferBase::record_bind_descriptor_sets(VkPipelineBindPoint } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_bind_index_buffer(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - VkIndexType in_index_type) +bool Anvil::CommandBufferBase::record_bind_index_buffer(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkIndexType in_index_type) { /* Note: Command supported inside and outside the renderpass. */ - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (!m_recording_in_progress) { @@ -1470,9 +1058,7 @@ bool Anvil::CommandBufferBase::record_bind_index_buffer(std::shared_ptrlock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdBindIndexBuffer(m_command_buffer, @@ -1481,7 +1067,7 @@ bool Anvil::CommandBufferBase::record_bind_index_buffer(std::shared_ptrunlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -1493,10 +1079,8 @@ bool Anvil::CommandBufferBase::record_bind_pipeline(VkPipelineBindPoint in_pipel Anvil::PipelineID in_pipeline_id) { /* Command supported inside and outside the renderpass. */ - std::shared_ptr device_locked_ptr (m_device_ptr); - auto parent_command_pool_locked_ptr(m_parent_command_pool_ptr.lock() ); - VkPipeline pipeline_vk (VK_NULL_HANDLE); - bool result (false); + VkPipeline pipeline_vk (VK_NULL_HANDLE); + bool result (false); if (!m_recording_in_progress) { @@ -1508,8 +1092,8 @@ bool Anvil::CommandBufferBase::record_bind_pipeline(VkPipelineBindPoint in_pipel anvil_assert(in_pipeline_bind_point == VK_PIPELINE_BIND_POINT_COMPUTE || in_pipeline_bind_point == VK_PIPELINE_BIND_POINT_GRAPHICS); - pipeline_vk = (in_pipeline_bind_point == VK_PIPELINE_BIND_POINT_COMPUTE) ? device_locked_ptr->get_compute_pipeline_manager()->get_pipeline (in_pipeline_id) - : device_locked_ptr->get_graphics_pipeline_manager()->get_pipeline(in_pipeline_id); + pipeline_vk = (in_pipeline_bind_point == VK_PIPELINE_BIND_POINT_COMPUTE) ? m_device_ptr->get_compute_pipeline_manager()->get_pipeline (in_pipeline_id) + : m_device_ptr->get_graphics_pipeline_manager()->get_pipeline(in_pipeline_id); #ifdef STORE_COMMAND_BUFFER_COMMANDS { @@ -1521,7 +1105,7 @@ bool Anvil::CommandBufferBase::record_bind_pipeline(VkPipelineBindPoint in_pipel } #endif - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdBindPipeline(m_command_buffer, @@ -1529,7 +1113,7 @@ bool Anvil::CommandBufferBase::record_bind_pipeline(VkPipelineBindPoint in_pipel pipeline_vk); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -1537,17 +1121,14 @@ bool Anvil::CommandBufferBase::record_bind_pipeline(VkPipelineBindPoint in_pipel } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_bind_vertex_buffers(uint32_t in_start_binding, - uint32_t in_binding_count, - std::shared_ptr* in_buffer_ptrs, - const VkDeviceSize* in_offset_ptrs) +bool Anvil::CommandBufferBase::record_bind_vertex_buffers(uint32_t in_start_binding, + uint32_t in_binding_count, + Anvil::Buffer** in_buffer_ptrs, + const VkDeviceSize* in_offset_ptrs) { /* Note: Command supported inside and outside the renderpass. */ - VkBuffer buffers[100]; - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; - - anvil_assert(in_binding_count < sizeof(buffers) / sizeof(buffers[0]) ); + auto buffers = std::vector(in_binding_count); + bool result = false; if (!m_recording_in_progress) { @@ -1572,22 +1153,20 @@ bool Anvil::CommandBufferBase::record_bind_vertex_buffers(uint32_t n_binding < in_binding_count; ++n_binding) { - buffers[n_binding] = in_buffer_ptrs[n_binding]->get_buffer(); - - cache_referenced_buffer(in_buffer_ptrs[n_binding]); + buffers.at(n_binding) = in_buffer_ptrs[n_binding]->get_buffer(); } - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdBindVertexBuffers(m_command_buffer, in_start_binding, in_binding_count, - buffers, + (in_binding_count > 0) ? &buffers.at(0) : nullptr, in_offset_ptrs); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -1595,16 +1174,15 @@ bool Anvil::CommandBufferBase::record_bind_vertex_buffers(uint32_t } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_blit_image(std::shared_ptr in_src_image_ptr, - VkImageLayout in_src_image_layout, - std::shared_ptr in_dst_image_ptr, - VkImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageBlit* in_region_ptrs, - VkFilter in_filter) +bool Anvil::CommandBufferBase::record_blit_image(Anvil::Image* in_src_image_ptr, + VkImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + VkImageLayout in_dst_image_layout, + uint32_t in_region_count, + const VkImageBlit* in_region_ptrs, + VkFilter in_filter) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (m_is_renderpass_active) { @@ -1635,10 +1213,7 @@ bool Anvil::CommandBufferBase::record_blit_image(std::shared_ptr i } #endif - cache_referenced_image(in_src_image_ptr); - cache_referenced_image(in_dst_image_ptr); - - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdBlitImage(m_command_buffer, @@ -1651,7 +1226,7 @@ bool Anvil::CommandBufferBase::record_blit_image(std::shared_ptr i in_filter); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -1664,8 +1239,7 @@ bool Anvil::CommandBufferBase::record_clear_attachments(uint32_t uint32_t in_n_rects, const VkClearRect* in_rect_ptrs) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (!m_is_renderpass_active) { @@ -1693,7 +1267,7 @@ bool Anvil::CommandBufferBase::record_clear_attachments(uint32_t } #endif - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdClearAttachments(m_command_buffer, @@ -1703,7 +1277,7 @@ bool Anvil::CommandBufferBase::record_clear_attachments(uint32_t in_rect_ptrs); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -1711,14 +1285,13 @@ bool Anvil::CommandBufferBase::record_clear_attachments(uint32_t } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_clear_color_image(std::shared_ptr in_image_ptr, +bool Anvil::CommandBufferBase::record_clear_color_image(Anvil::Image* in_image_ptr, VkImageLayout in_image_layout, const VkClearColorValue* in_color_ptr, uint32_t in_range_count, const VkImageSubresourceRange* in_range_ptrs) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (m_is_renderpass_active) { @@ -1747,9 +1320,7 @@ bool Anvil::CommandBufferBase::record_clear_color_image(std::shared_ptrlock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdClearColorImage(m_command_buffer, @@ -1760,7 +1331,7 @@ bool Anvil::CommandBufferBase::record_clear_color_image(std::shared_ptrunlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -1768,14 +1339,13 @@ bool Anvil::CommandBufferBase::record_clear_color_image(std::shared_ptr in_image_ptr, +bool Anvil::CommandBufferBase::record_clear_depth_stencil_image(Anvil::Image* in_image_ptr, VkImageLayout in_image_layout, const VkClearDepthStencilValue* in_depth_stencil_ptr, uint32_t in_range_count, const VkImageSubresourceRange* in_range_ptrs) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (m_is_renderpass_active) { @@ -1804,9 +1374,7 @@ bool Anvil::CommandBufferBase::record_clear_depth_stencil_image(std::shared_ptr< } #endif - cache_referenced_image(in_image_ptr); - - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdClearDepthStencilImage(m_command_buffer, @@ -1817,7 +1385,7 @@ bool Anvil::CommandBufferBase::record_clear_depth_stencil_image(std::shared_ptr< in_range_ptrs); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -1825,13 +1393,12 @@ bool Anvil::CommandBufferBase::record_clear_depth_stencil_image(std::shared_ptr< } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_copy_buffer(std::shared_ptr in_src_buffer_ptr, - std::shared_ptr in_dst_buffer_ptr, - uint32_t in_region_count, - const VkBufferCopy* in_region_ptrs) +bool Anvil::CommandBufferBase::record_copy_buffer(Anvil::Buffer* in_src_buffer_ptr, + Anvil::Buffer* in_dst_buffer_ptr, + uint32_t in_region_count, + const VkBufferCopy* in_region_ptrs) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (m_is_renderpass_active) { @@ -1859,10 +1426,7 @@ bool Anvil::CommandBufferBase::record_copy_buffer(std::shared_ptr } #endif - cache_referenced_buffer(in_src_buffer_ptr); - cache_referenced_buffer(in_dst_buffer_ptr); - - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdCopyBuffer(m_command_buffer, @@ -1872,7 +1436,7 @@ bool Anvil::CommandBufferBase::record_copy_buffer(std::shared_ptr in_region_ptrs); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -1880,14 +1444,13 @@ bool Anvil::CommandBufferBase::record_copy_buffer(std::shared_ptr } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_copy_buffer_to_image(std::shared_ptr in_src_buffer_ptr, - std::shared_ptr in_dst_image_ptr, - VkImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkBufferImageCopy* in_region_ptrs) +bool Anvil::CommandBufferBase::record_copy_buffer_to_image(Anvil::Buffer* in_src_buffer_ptr, + Anvil::Image* in_dst_image_ptr, + VkImageLayout in_dst_image_layout, + uint32_t in_region_count, + const VkBufferImageCopy* in_region_ptrs) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (m_is_renderpass_active) { @@ -1916,10 +1479,7 @@ bool Anvil::CommandBufferBase::record_copy_buffer_to_image(std::shared_ptrlock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdCopyBufferToImage(m_command_buffer, @@ -1930,7 +1490,7 @@ bool Anvil::CommandBufferBase::record_copy_buffer_to_image(std::shared_ptrunlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -1938,15 +1498,14 @@ bool Anvil::CommandBufferBase::record_copy_buffer_to_image(std::shared_ptr in_src_image_ptr, - VkImageLayout in_src_image_layout, - std::shared_ptr in_dst_image_ptr, - VkImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageCopy* in_region_ptrs) +bool Anvil::CommandBufferBase::record_copy_image(Anvil::Image* in_src_image_ptr, + VkImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + VkImageLayout in_dst_image_layout, + uint32_t in_region_count, + const VkImageCopy* in_region_ptrs) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (m_is_renderpass_active) { @@ -1976,10 +1535,7 @@ bool Anvil::CommandBufferBase::record_copy_image(std::shared_ptr i } #endif - cache_referenced_image(in_src_image_ptr); - cache_referenced_image(in_dst_image_ptr); - - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdCopyImage(m_command_buffer, @@ -1991,7 +1547,7 @@ bool Anvil::CommandBufferBase::record_copy_image(std::shared_ptr i in_region_ptrs); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -1999,14 +1555,13 @@ bool Anvil::CommandBufferBase::record_copy_image(std::shared_ptr i } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_copy_image_to_buffer(std::shared_ptr in_src_image_ptr, - VkImageLayout in_src_image_layout, - std::shared_ptr in_dst_buffer_ptr, - uint32_t in_region_count, - const VkBufferImageCopy* in_region_ptrs) +bool Anvil::CommandBufferBase::record_copy_image_to_buffer(Anvil::Image* in_src_image_ptr, + VkImageLayout in_src_image_layout, + Anvil::Buffer* in_dst_buffer_ptr, + uint32_t in_region_count, + const VkBufferImageCopy* in_region_ptrs) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (m_is_renderpass_active) { @@ -2035,10 +1590,7 @@ bool Anvil::CommandBufferBase::record_copy_image_to_buffer(std::shared_ptrlock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdCopyImageToBuffer(m_command_buffer, @@ -2049,7 +1601,7 @@ bool Anvil::CommandBufferBase::record_copy_image_to_buffer(std::shared_ptrunlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -2057,16 +1609,15 @@ bool Anvil::CommandBufferBase::record_copy_image_to_buffer(std::shared_ptr in_query_pool_ptr, - Anvil::QueryIndex in_start_query, - uint32_t in_query_count, - std::shared_ptr in_dst_buffer_ptr, - VkDeviceSize in_dst_offset, - VkDeviceSize in_dst_stride, - VkQueryResultFlags in_flags) +bool Anvil::CommandBufferBase::record_copy_query_pool_results(Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_start_query, + uint32_t in_query_count, + Anvil::Buffer* in_dst_buffer_ptr, + VkDeviceSize in_dst_offset, + VkDeviceSize in_dst_stride, + VkQueryResultFlags in_flags) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (m_is_renderpass_active) { @@ -2097,10 +1648,7 @@ bool Anvil::CommandBufferBase::record_copy_query_pool_results(std::shared_ptrlock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdCopyQueryPoolResults(m_command_buffer, @@ -2113,7 +1661,7 @@ bool Anvil::CommandBufferBase::record_copy_query_pool_results(std::shared_ptrunlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -2125,8 +1673,7 @@ bool Anvil::CommandBufferBase::record_dispatch(uint32_t in_x, uint32_t in_y, uint32_t in_z) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (m_is_renderpass_active) { @@ -2153,7 +1700,7 @@ bool Anvil::CommandBufferBase::record_dispatch(uint32_t in_x, } #endif - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdDispatch(m_command_buffer, @@ -2162,7 +1709,7 @@ bool Anvil::CommandBufferBase::record_dispatch(uint32_t in_x, in_z); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -2173,11 +1720,9 @@ bool Anvil::CommandBufferBase::record_dispatch(uint32_t in_x, bool Anvil::CommandBufferBase::record_debug_marker_begin_EXT(const std::string& in_marker_name, const float* in_opt_color) { - std::shared_ptr device_locked_ptr (m_device_ptr); - const auto& entrypoints (device_locked_ptr->get_extension_ext_debug_marker_entrypoints() ); - VkDebugMarkerMarkerInfoEXT marker_info; - auto parent_command_pool_locked_ptr(m_parent_command_pool_ptr.lock() ); - bool result (false); + const auto& entrypoints (m_device_ptr->get_extension_ext_debug_marker_entrypoints() ); + VkDebugMarkerMarkerInfoEXT marker_info; + bool result (false); if (!m_recording_in_progress) { @@ -2196,7 +1741,7 @@ bool Anvil::CommandBufferBase::record_debug_marker_begin_EXT(const std::string& } #endif - anvil_assert(device_locked_ptr->is_ext_debug_marker_extension_enabled() ); + anvil_assert(m_device_ptr->is_ext_debug_marker_extension_enabled() ); if (in_opt_color != nullptr) { @@ -2216,12 +1761,12 @@ bool Anvil::CommandBufferBase::record_debug_marker_begin_EXT(const std::string& marker_info.pNext = nullptr; marker_info.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT; - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); { entrypoints.vkCmdDebugMarkerBeginEXT(m_command_buffer, &marker_info); } - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -2231,10 +1776,8 @@ bool Anvil::CommandBufferBase::record_debug_marker_begin_EXT(const std::string& /* Please see header for specification */ bool Anvil::CommandBufferBase::record_debug_marker_end_EXT() { - std::shared_ptr device_locked_ptr (m_device_ptr); - const auto& entrypoints (device_locked_ptr->get_extension_ext_debug_marker_entrypoints() ); - auto parent_command_pool_locked_ptr(m_parent_command_pool_ptr.lock() ); - bool result (false); + const auto& entrypoints(m_device_ptr->get_extension_ext_debug_marker_entrypoints() ); + bool result (false); if (!m_recording_in_progress) { @@ -2243,7 +1786,7 @@ bool Anvil::CommandBufferBase::record_debug_marker_end_EXT() goto end; } - anvil_assert(device_locked_ptr->is_ext_debug_marker_extension_enabled() ); + anvil_assert(m_device_ptr->is_ext_debug_marker_extension_enabled() ); #ifdef STORE_COMMAND_BUFFER_COMMANDS @@ -2255,11 +1798,11 @@ bool Anvil::CommandBufferBase::record_debug_marker_end_EXT() } #endif - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); { entrypoints.vkCmdDebugMarkerEndEXT(m_command_buffer); } - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -2270,11 +1813,9 @@ bool Anvil::CommandBufferBase::record_debug_marker_end_EXT() bool Anvil::CommandBufferBase::record_debug_marker_insert_EXT(const std::string& in_marker_name, const float* in_opt_color) { - std::shared_ptr device_locked_ptr (m_device_ptr); - const auto& entrypoints (device_locked_ptr->get_extension_ext_debug_marker_entrypoints() ); - VkDebugMarkerMarkerInfoEXT marker_info; - auto parent_command_pool_locked_ptr(m_parent_command_pool_ptr.lock() ); - bool result (false); + const auto& entrypoints (m_device_ptr->get_extension_ext_debug_marker_entrypoints() ); + VkDebugMarkerMarkerInfoEXT marker_info; + bool result (false); if (!m_recording_in_progress) { @@ -2283,7 +1824,7 @@ bool Anvil::CommandBufferBase::record_debug_marker_insert_EXT(const std::string& goto end; } - anvil_assert(device_locked_ptr->is_ext_debug_marker_extension_enabled() ); + anvil_assert(m_device_ptr->is_ext_debug_marker_extension_enabled() ); #ifdef STORE_COMMAND_BUFFER_COMMANDS @@ -2314,12 +1855,12 @@ bool Anvil::CommandBufferBase::record_debug_marker_insert_EXT(const std::string& marker_info.pNext = nullptr; marker_info.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT; - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); { entrypoints.vkCmdDebugMarkerInsertEXT(m_command_buffer, &marker_info); } - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -2327,11 +1868,10 @@ bool Anvil::CommandBufferBase::record_debug_marker_insert_EXT(const std::string& } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_dispatch_indirect(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset) +bool Anvil::CommandBufferBase::record_dispatch_indirect(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (m_is_renderpass_active) { @@ -2357,9 +1897,7 @@ bool Anvil::CommandBufferBase::record_dispatch_indirect(std::shared_ptrlock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdDispatchIndirect(m_command_buffer, @@ -2367,7 +1905,7 @@ bool Anvil::CommandBufferBase::record_dispatch_indirect(std::shared_ptrunlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -2380,8 +1918,7 @@ bool Anvil::CommandBufferBase::record_draw(uint32_t in_vertex_count, uint32_t in_first_vertex, uint32_t in_first_instance) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (!m_is_renderpass_active) { @@ -2409,7 +1946,7 @@ bool Anvil::CommandBufferBase::record_draw(uint32_t in_vertex_count, } #endif - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdDraw(m_command_buffer, @@ -2419,7 +1956,7 @@ bool Anvil::CommandBufferBase::record_draw(uint32_t in_vertex_count, in_first_instance); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -2433,8 +1970,7 @@ bool Anvil::CommandBufferBase::record_draw_indexed(uint32_t in_index_count, int32_t in_vertex_offset, uint32_t in_first_instance) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (!m_is_renderpass_active) { @@ -2463,7 +1999,7 @@ bool Anvil::CommandBufferBase::record_draw_indexed(uint32_t in_index_count, } #endif - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdDrawIndexed(m_command_buffer, @@ -2474,7 +2010,7 @@ bool Anvil::CommandBufferBase::record_draw_indexed(uint32_t in_index_count, in_first_instance); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -2482,13 +2018,12 @@ bool Anvil::CommandBufferBase::record_draw_indexed(uint32_t in_index_count, } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_draw_indexed_indirect(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - uint32_t in_count, - uint32_t in_stride) +bool Anvil::CommandBufferBase::record_draw_indexed_indirect(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + uint32_t in_count, + uint32_t in_stride) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (!m_is_renderpass_active) { @@ -2516,9 +2051,7 @@ bool Anvil::CommandBufferBase::record_draw_indexed_indirect(std::shared_ptrlock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdDrawIndexedIndirect(m_command_buffer, @@ -2528,7 +2061,7 @@ bool Anvil::CommandBufferBase::record_draw_indexed_indirect(std::shared_ptrunlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -2536,17 +2069,15 @@ bool Anvil::CommandBufferBase::record_draw_indexed_indirect(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - std::shared_ptr in_count_buffer_ptr, - VkDeviceSize in_count_offset, - uint32_t in_max_draw_count, - uint32_t in_stride) +bool Anvil::CommandBufferBase::record_draw_indexed_indirect_count_AMD(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + Anvil::Buffer* in_count_buffer_ptr, + VkDeviceSize in_count_offset, + uint32_t in_max_draw_count, + uint32_t in_stride) { - std::shared_ptr device_locked_ptr (m_device_ptr); Anvil::ExtensionAMDDrawIndirectCountEntrypoints entrypoints; - auto parent_command_pool_locked_ptr(m_parent_command_pool_ptr.lock() ); - bool result (false); + bool result (false); if (!m_is_renderpass_active) { @@ -2562,7 +2093,7 @@ bool Anvil::CommandBufferBase::record_draw_indexed_indirect_count_AMD(std::share goto end; } - anvil_assert(device_locked_ptr->is_amd_draw_indirect_count_extension_enabled() ); + anvil_assert(m_device_ptr->is_amd_draw_indirect_count_extension_enabled() ); #ifdef STORE_COMMAND_BUFFER_COMMANDS @@ -2579,12 +2110,9 @@ bool Anvil::CommandBufferBase::record_draw_indexed_indirect_count_AMD(std::share } #endif - entrypoints = device_locked_ptr->get_extension_amd_draw_indirect_count_entrypoints(); + entrypoints = m_device_ptr->get_extension_amd_draw_indirect_count_entrypoints(); - cache_referenced_buffer(in_buffer_ptr); - cache_referenced_buffer(in_count_buffer_ptr); - - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { entrypoints.vkCmdDrawIndexedIndirectCountAMD(m_command_buffer, @@ -2596,7 +2124,7 @@ bool Anvil::CommandBufferBase::record_draw_indexed_indirect_count_AMD(std::share in_stride); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -2604,13 +2132,12 @@ bool Anvil::CommandBufferBase::record_draw_indexed_indirect_count_AMD(std::share } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_draw_indirect(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - uint32_t in_count, - uint32_t in_stride) +bool Anvil::CommandBufferBase::record_draw_indirect(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + uint32_t in_count, + uint32_t in_stride) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (!m_is_renderpass_active) { @@ -2638,9 +2165,7 @@ bool Anvil::CommandBufferBase::record_draw_indirect(std::shared_ptrlock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdDrawIndirect(m_command_buffer, @@ -2650,7 +2175,7 @@ bool Anvil::CommandBufferBase::record_draw_indirect(std::shared_ptrunlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -2658,17 +2183,15 @@ bool Anvil::CommandBufferBase::record_draw_indirect(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_offset, - std::shared_ptr in_count_buffer_ptr, - VkDeviceSize in_count_offset, - uint32_t in_max_draw_count, - uint32_t in_stride) +bool Anvil::CommandBufferBase::record_draw_indirect_count_AMD(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + Anvil::Buffer* in_count_buffer_ptr, + VkDeviceSize in_count_offset, + uint32_t in_max_draw_count, + uint32_t in_stride) { - std::shared_ptr device_locked_ptr (m_device_ptr); Anvil::ExtensionAMDDrawIndirectCountEntrypoints entrypoints; - auto parent_command_pool_locked_ptr(m_parent_command_pool_ptr.lock() ); - bool result (false); + bool result (false); if (!m_is_renderpass_active) { @@ -2684,7 +2207,7 @@ bool Anvil::CommandBufferBase::record_draw_indirect_count_AMD(std::shared_ptris_amd_draw_indirect_count_extension_enabled() ); + anvil_assert(m_device_ptr->is_amd_draw_indirect_count_extension_enabled() ); #ifdef STORE_COMMAND_BUFFER_COMMANDS @@ -2701,12 +2224,9 @@ bool Anvil::CommandBufferBase::record_draw_indirect_count_AMD(std::shared_ptrget_extension_amd_draw_indirect_count_entrypoints(); - - cache_referenced_buffer(in_buffer_ptr); - cache_referenced_buffer(in_count_buffer_ptr); + entrypoints = m_device_ptr->get_extension_amd_draw_indirect_count_entrypoints(); - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { entrypoints.vkCmdDrawIndirectCountAMD(m_command_buffer, @@ -2718,7 +2238,7 @@ bool Anvil::CommandBufferBase::record_draw_indirect_count_AMD(std::shared_ptrunlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -2726,12 +2246,11 @@ bool Anvil::CommandBufferBase::record_draw_indirect_count_AMD(std::shared_ptr in_query_pool_ptr, - Anvil::QueryIndex in_entry) +bool Anvil::CommandBufferBase::record_end_query(Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_entry) { /* NOTE: The command can be executed both inside and outside a renderpass */ - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (!m_recording_in_progress) { @@ -2750,9 +2269,7 @@ bool Anvil::CommandBufferBase::record_end_query(std::shared_ptrlock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdEndQuery(m_command_buffer, @@ -2760,7 +2277,7 @@ bool Anvil::CommandBufferBase::record_end_query(std::shared_ptrunlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -2768,13 +2285,12 @@ bool Anvil::CommandBufferBase::record_end_query(std::shared_ptr in_dst_buffer_ptr, - VkDeviceSize in_dst_offset, - VkDeviceSize in_size, - uint32_t in_data) +bool Anvil::CommandBufferBase::record_fill_buffer(Anvil::Buffer* in_dst_buffer_ptr, + VkDeviceSize in_dst_offset, + VkDeviceSize in_size, + uint32_t in_data) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (m_is_renderpass_active) { @@ -2802,9 +2318,7 @@ bool Anvil::CommandBufferBase::record_fill_buffer(std::shared_ptr } #endif - cache_referenced_buffer(in_dst_buffer_ptr); - - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdFillBuffer(m_command_buffer, @@ -2814,7 +2328,7 @@ bool Anvil::CommandBufferBase::record_fill_buffer(std::shared_ptr in_data); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -2833,11 +2347,10 @@ bool Anvil::CommandBufferBase::record_pipeline_barrier(VkPipelineStageFlags const ImageBarrier* const in_image_memory_barriers_ptr) { /* NOTE: The command can be executed both inside and outside a renderpass */ - VkBufferMemoryBarrier buffer_barriers_vk[100]; - VkImageMemoryBarrier image_barriers_vk [100]; - VkMemoryBarrier memory_barriers_vk[100]; - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + auto buffer_barriers_vk = std::vector(in_buffer_memory_barrier_count); + auto image_barriers_vk = std::vector (in_image_memory_barrier_count); + auto memory_barriers_vk = std::vector (in_memory_barrier_count); + bool result = false; if (!m_recording_in_progress) { @@ -2881,36 +2394,28 @@ bool Anvil::CommandBufferBase::record_pipeline_barrier(VkPipelineStageFlags &callback_data); } - anvil_assert(sizeof(buffer_barriers_vk) / sizeof(buffer_barriers_vk[0]) >= in_buffer_memory_barrier_count && - sizeof(image_barriers_vk) / sizeof(image_barriers_vk [0]) >= in_image_memory_barrier_count && - sizeof(memory_barriers_vk) / sizeof(memory_barriers_vk[0]) >= in_memory_barrier_count); - for (uint32_t n_buffer_barrier = 0; n_buffer_barrier < in_buffer_memory_barrier_count; ++n_buffer_barrier) { - buffer_barriers_vk[n_buffer_barrier] = in_buffer_memory_barriers_ptr[n_buffer_barrier].get_barrier_vk(); - - cache_referenced_buffer(in_buffer_memory_barriers_ptr[n_buffer_barrier].buffer_ptr); + buffer_barriers_vk.at(n_buffer_barrier) = in_buffer_memory_barriers_ptr[n_buffer_barrier].get_barrier_vk(); } for (uint32_t n_image_barrier = 0; n_image_barrier < in_image_memory_barrier_count; ++n_image_barrier) { - image_barriers_vk[n_image_barrier] = in_image_memory_barriers_ptr[n_image_barrier].get_barrier_vk(); - - cache_referenced_image(in_image_memory_barriers_ptr[n_image_barrier].image_ptr); + image_barriers_vk.at(n_image_barrier) = in_image_memory_barriers_ptr[n_image_barrier].get_barrier_vk(); } for (uint32_t n_memory_barrier = 0; n_memory_barrier < in_memory_barrier_count; ++n_memory_barrier) { - memory_barriers_vk[n_memory_barrier] = in_memory_barriers_ptr[n_memory_barrier].get_barrier_vk(); + memory_barriers_vk.at(n_memory_barrier) = in_memory_barriers_ptr[n_memory_barrier].get_barrier_vk(); } - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdPipelineBarrier(m_command_buffer, @@ -2918,14 +2423,14 @@ bool Anvil::CommandBufferBase::record_pipeline_barrier(VkPipelineStageFlags in_dst_stage_mask, in_by_region, in_memory_barrier_count, - memory_barriers_vk, + (in_memory_barrier_count > 0) ? &memory_barriers_vk.at(0) : nullptr, in_buffer_memory_barrier_count, - buffer_barriers_vk, + (in_buffer_memory_barrier_count > 0) ? &buffer_barriers_vk.at(0) : nullptr, in_image_memory_barrier_count, - image_barriers_vk); + (in_image_memory_barrier_count > 0) ? &image_barriers_vk.at(0) : nullptr); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -2933,15 +2438,14 @@ bool Anvil::CommandBufferBase::record_pipeline_barrier(VkPipelineStageFlags } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_push_constants(std::shared_ptr in_layout_ptr, - VkShaderStageFlags in_stage_flags, - uint32_t in_offset, - uint32_t in_size, - const void* in_values) +bool Anvil::CommandBufferBase::record_push_constants(Anvil::PipelineLayout* in_layout_ptr, + VkShaderStageFlags in_stage_flags, + uint32_t in_offset, + uint32_t in_size, + const void* in_values) { /* NOTE: The command can be executed both inside and outside a renderpass */ - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (!m_recording_in_progress) { @@ -2963,7 +2467,7 @@ bool Anvil::CommandBufferBase::record_push_constants(std::shared_ptrlock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdPushConstants(m_command_buffer, @@ -2974,7 +2478,7 @@ bool Anvil::CommandBufferBase::record_push_constants(std::shared_ptrunlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -2982,11 +2486,10 @@ bool Anvil::CommandBufferBase::record_push_constants(std::shared_ptr in_event_ptr, - VkPipelineStageFlags in_stage_mask) +bool Anvil::CommandBufferBase::record_reset_event(Anvil::Event* in_event_ptr, + VkPipelineStageFlags in_stage_mask) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (m_is_renderpass_active) { @@ -3012,9 +2515,7 @@ bool Anvil::CommandBufferBase::record_reset_event(std::shared_ptr } #endif - cache_referenced_event(in_event_ptr); - - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdResetEvent(m_command_buffer, @@ -3022,7 +2523,7 @@ bool Anvil::CommandBufferBase::record_reset_event(std::shared_ptr in_stage_mask); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -3030,12 +2531,11 @@ bool Anvil::CommandBufferBase::record_reset_event(std::shared_ptr } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_reset_query_pool(std::shared_ptr in_query_pool_ptr, - Anvil::QueryIndex in_start_query, - uint32_t in_query_count) +bool Anvil::CommandBufferBase::record_reset_query_pool(Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_start_query, + uint32_t in_query_count) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (m_is_renderpass_active) { @@ -3062,9 +2562,7 @@ bool Anvil::CommandBufferBase::record_reset_query_pool(std::shared_ptrlock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdResetQueryPool(m_command_buffer, @@ -3073,7 +2571,7 @@ bool Anvil::CommandBufferBase::record_reset_query_pool(std::shared_ptrunlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -3081,15 +2579,14 @@ bool Anvil::CommandBufferBase::record_reset_query_pool(std::shared_ptr in_src_image_ptr, - VkImageLayout in_src_image_layout, - std::shared_ptr in_dst_image_ptr, - VkImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageResolve* in_region_ptrs) +bool Anvil::CommandBufferBase::record_resolve_image(Anvil::Image* in_src_image_ptr, + VkImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + VkImageLayout in_dst_image_layout, + uint32_t in_region_count, + const VkImageResolve* in_region_ptrs) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (m_is_renderpass_active) { @@ -3119,10 +2616,7 @@ bool Anvil::CommandBufferBase::record_resolve_image(std::shared_ptrlock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdResolveImage(m_command_buffer, @@ -3134,20 +2628,18 @@ bool Anvil::CommandBufferBase::record_resolve_image(std::shared_ptrunlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: return result; } - /* Please see header for specification */ bool Anvil::CommandBufferBase::record_set_blend_constants(const float in_blend_constants[4]) { /* Note: Command supported inside and outside the renderpass. */ - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (!m_recording_in_progress) { @@ -3165,14 +2657,14 @@ bool Anvil::CommandBufferBase::record_set_blend_constants(const float in_blend_c } #endif - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdSetBlendConstants(m_command_buffer, in_blend_constants); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -3185,8 +2677,7 @@ bool Anvil::CommandBufferBase::record_set_depth_bias(float in_depth_bias_constan float in_slope_scaled_depth_bias) { /* Note: Command supported inside and outside the renderpass. */ - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (!m_recording_in_progress) { @@ -3206,7 +2697,7 @@ bool Anvil::CommandBufferBase::record_set_depth_bias(float in_depth_bias_constan } #endif - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdSetDepthBias(m_command_buffer, @@ -3215,7 +2706,7 @@ bool Anvil::CommandBufferBase::record_set_depth_bias(float in_depth_bias_constan in_slope_scaled_depth_bias); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -3227,8 +2718,7 @@ bool Anvil::CommandBufferBase::record_set_depth_bounds(float in_min_depth_bounds float in_max_depth_bounds) { /* Note: Command supported inside and outside the renderpass. */ - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (!m_recording_in_progress) { @@ -3247,7 +2737,7 @@ bool Anvil::CommandBufferBase::record_set_depth_bounds(float in_min_depth_bounds } #endif - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdSetDepthBounds(m_command_buffer, @@ -3255,7 +2745,7 @@ bool Anvil::CommandBufferBase::record_set_depth_bounds(float in_min_depth_bounds in_max_depth_bounds); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -3263,11 +2753,11 @@ bool Anvil::CommandBufferBase::record_set_depth_bounds(float in_min_depth_bounds } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_set_event(std::shared_ptr in_event_ptr, - VkPipelineStageFlags in_stage_mask) +bool Anvil::CommandBufferBase::record_set_event(Anvil::Event* in_event_ptr, + VkPipelineStageFlags in_stage_mask) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + const Anvil::DeviceType device_type = m_device_ptr->get_type(); + bool result = false; if (m_is_renderpass_active) { @@ -3293,9 +2783,7 @@ bool Anvil::CommandBufferBase::record_set_event(std::shared_ptr in } #endif - cache_referenced_event(in_event_ptr); - - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdSetEvent(m_command_buffer, @@ -3303,7 +2791,7 @@ bool Anvil::CommandBufferBase::record_set_event(std::shared_ptr in in_stage_mask); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -3314,8 +2802,7 @@ bool Anvil::CommandBufferBase::record_set_event(std::shared_ptr in bool Anvil::CommandBufferBase::record_set_line_width(float in_line_width) { /* Note: Command supported inside and outside the renderpass. */ - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (!m_recording_in_progress) { @@ -3333,14 +2820,14 @@ bool Anvil::CommandBufferBase::record_set_line_width(float in_line_width) } #endif - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdSetLineWidth(m_command_buffer, in_line_width); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -3353,8 +2840,7 @@ bool Anvil::CommandBufferBase::record_set_scissor(uint32_t in_first_sciss const VkRect2D* in_scissor_ptrs) { /* Note: Command supported inside and outside the renderpass. */ - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (!m_recording_in_progress) { @@ -3374,7 +2860,7 @@ bool Anvil::CommandBufferBase::record_set_scissor(uint32_t in_first_sciss } #endif - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdSetScissor(m_command_buffer, @@ -3383,7 +2869,7 @@ bool Anvil::CommandBufferBase::record_set_scissor(uint32_t in_first_sciss in_scissor_ptrs); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -3395,8 +2881,7 @@ bool Anvil::CommandBufferBase::record_set_stencil_compare_mask(VkStencilFaceFlag uint32_t in_stencil_compare_mask) { /* Note: Command supported inside and outside the renderpass. */ - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (!m_recording_in_progress) { @@ -3415,7 +2900,7 @@ bool Anvil::CommandBufferBase::record_set_stencil_compare_mask(VkStencilFaceFlag } #endif - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdSetStencilCompareMask(m_command_buffer, @@ -3423,7 +2908,7 @@ bool Anvil::CommandBufferBase::record_set_stencil_compare_mask(VkStencilFaceFlag in_stencil_compare_mask); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -3435,8 +2920,7 @@ bool Anvil::CommandBufferBase::record_set_stencil_reference(VkStencilFaceFlags i uint32_t in_stencil_reference) { /* Note: Command supported inside and outside the renderpass. */ - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (!m_recording_in_progress) { @@ -3455,7 +2939,7 @@ bool Anvil::CommandBufferBase::record_set_stencil_reference(VkStencilFaceFlags i } #endif - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdSetStencilReference(m_command_buffer, @@ -3463,7 +2947,7 @@ bool Anvil::CommandBufferBase::record_set_stencil_reference(VkStencilFaceFlags i in_stencil_reference); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -3475,8 +2959,7 @@ bool Anvil::CommandBufferBase::record_set_stencil_write_mask(VkStencilFaceFlags uint32_t in_stencil_write_mask) { /* Note: Command supported inside and outside the renderpass. */ - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (!m_recording_in_progress) { @@ -3495,7 +2978,7 @@ bool Anvil::CommandBufferBase::record_set_stencil_write_mask(VkStencilFaceFlags } #endif - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdSetStencilWriteMask(m_command_buffer, @@ -3503,7 +2986,7 @@ bool Anvil::CommandBufferBase::record_set_stencil_write_mask(VkStencilFaceFlags in_stencil_write_mask); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -3516,8 +2999,7 @@ bool Anvil::CommandBufferBase::record_set_viewport(uint32_t in_first_vi const VkViewport* in_viewport_ptrs) { /* Note: Command supported inside and outside the renderpass. */ - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (!m_recording_in_progress) { @@ -3537,7 +3019,7 @@ bool Anvil::CommandBufferBase::record_set_viewport(uint32_t in_first_vi } #endif - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdSetViewport(m_command_buffer, @@ -3546,7 +3028,7 @@ bool Anvil::CommandBufferBase::record_set_viewport(uint32_t in_first_vi in_viewport_ptrs); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -3554,13 +3036,12 @@ bool Anvil::CommandBufferBase::record_set_viewport(uint32_t in_first_vi } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_update_buffer(std::shared_ptr in_dst_buffer_ptr, - VkDeviceSize in_dst_offset, - VkDeviceSize in_data_size, - const uint32_t* in_data_ptr) +bool Anvil::CommandBufferBase::record_update_buffer(Anvil::Buffer* in_dst_buffer_ptr, + VkDeviceSize in_dst_offset, + VkDeviceSize in_data_size, + const uint32_t* in_data_ptr) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (m_is_renderpass_active) { @@ -3588,9 +3069,8 @@ bool Anvil::CommandBufferBase::record_update_buffer(std::shared_ptrlock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdUpdateBuffer(m_command_buffer, @@ -3600,7 +3080,7 @@ bool Anvil::CommandBufferBase::record_update_buffer(std::shared_ptrunlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -3608,31 +3088,26 @@ bool Anvil::CommandBufferBase::record_update_buffer(std::shared_ptr* in_events, - VkPipelineStageFlags in_src_stage_mask, - VkPipelineStageFlags in_dst_stage_mask, - uint32_t in_memory_barrier_count, - const MemoryBarrier* const in_memory_barriers_ptr, - uint32_t in_buffer_memory_barrier_count, - const BufferBarrier* const in_buffer_memory_barriers_ptr, - uint32_t in_image_memory_barrier_count, - const ImageBarrier* const in_image_memory_barriers_ptr) +bool Anvil::CommandBufferBase::record_wait_events(uint32_t in_event_count, + Anvil::Event* const* in_events, + VkPipelineStageFlags in_src_stage_mask, + VkPipelineStageFlags in_dst_stage_mask, + uint32_t in_memory_barrier_count, + const MemoryBarrier* const in_memory_barriers_ptr, + uint32_t in_buffer_memory_barrier_count, + const BufferBarrier* const in_buffer_memory_barriers_ptr, + uint32_t in_image_memory_barrier_count, + const ImageBarrier* const in_image_memory_barriers_ptr) { /* NOTE: The command can be executed both inside and outside a renderpass */ - VkEvent events [100]; - VkBufferMemoryBarrier buffer_barriers_vk[100]; - VkImageMemoryBarrier image_barriers_vk [100]; - VkMemoryBarrier memory_barriers_vk[100]; - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; - - anvil_assert(in_event_count > 0); /* as per spec - easy to miss */ - anvil_assert(in_event_count < sizeof(events) / sizeof(events [0]) ); - anvil_assert(in_buffer_memory_barrier_count < sizeof(buffer_barriers_vk) / sizeof(buffer_barriers_vk[0]) ); - anvil_assert(in_image_memory_barrier_count < sizeof(image_barriers_vk) / sizeof(image_barriers_vk [0]) ); - anvil_assert(in_memory_barrier_count < sizeof(memory_barriers_vk) / sizeof(memory_barriers_vk[0]) ); + std::vector events (in_event_count); + std::vector buffer_barriers_vk(in_buffer_memory_barrier_count); + std::vector image_barriers_vk (in_image_memory_barrier_count); + std::vector memory_barriers_vk(in_memory_barrier_count); + bool result (false); + + anvil_assert(in_event_count > 0); /* as per spec - easy to miss */ if (!m_recording_in_progress) { @@ -3659,57 +3134,52 @@ bool Anvil::CommandBufferBase::record_wait_events(uint32_t } #endif + for (uint32_t n_event = 0; n_event < in_event_count; ++n_event) { - events[n_event] = in_events[n_event]->get_event(); - - cache_referenced_event(in_events[n_event]); + events.at(n_event) = in_events[n_event]->get_event(); } for (uint32_t n_buffer_barrier = 0; n_buffer_barrier < in_buffer_memory_barrier_count; ++n_buffer_barrier) { - buffer_barriers_vk[n_buffer_barrier] = in_buffer_memory_barriers_ptr[n_buffer_barrier].get_barrier_vk(); - - cache_referenced_buffer(in_buffer_memory_barriers_ptr[n_buffer_barrier].buffer_ptr); + buffer_barriers_vk.at(n_buffer_barrier) = in_buffer_memory_barriers_ptr[n_buffer_barrier].get_barrier_vk(); } for (uint32_t n_image_barrier = 0; n_image_barrier < in_image_memory_barrier_count; ++n_image_barrier) { - image_barriers_vk[n_image_barrier] = in_image_memory_barriers_ptr[n_image_barrier].get_barrier_vk(); - - cache_referenced_image(in_image_memory_barriers_ptr[n_image_barrier].image_ptr); + image_barriers_vk.at(n_image_barrier) = in_image_memory_barriers_ptr[n_image_barrier].get_barrier_vk(); } for (uint32_t n_memory_barrier = 0; n_memory_barrier < in_memory_barrier_count; ++n_memory_barrier) { - memory_barriers_vk[n_memory_barrier] = in_memory_barriers_ptr[n_memory_barrier].get_barrier_vk(); + memory_barriers_vk.at(n_memory_barrier) = in_memory_barriers_ptr[n_memory_barrier].get_barrier_vk(); } - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdWaitEvents(m_command_buffer, in_event_count, - events, + (in_event_count > 0) ? &events.at(0) : nullptr, in_src_stage_mask, in_dst_stage_mask, in_memory_barrier_count, - memory_barriers_vk, + (in_memory_barrier_count > 0) ? &memory_barriers_vk.at(0) : nullptr, in_buffer_memory_barrier_count, - buffer_barriers_vk, + (in_buffer_memory_barrier_count > 0) ? &buffer_barriers_vk.at(0) : nullptr, in_image_memory_barrier_count, - image_barriers_vk); + (in_image_memory_barrier_count > 0) ? &image_barriers_vk.at(0) : nullptr); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -3717,13 +3187,12 @@ bool Anvil::CommandBufferBase::record_wait_events(uint32_t } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_write_timestamp(VkPipelineStageFlagBits in_pipeline_stage, - std::shared_ptr in_query_pool_ptr, - Anvil::QueryIndex in_query_index) +bool Anvil::CommandBufferBase::record_write_timestamp(VkPipelineStageFlagBits in_pipeline_stage, + Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_query_index) { /* NOTE: The command can be executed both inside and outside a renderpass */ - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (!m_recording_in_progress) { @@ -3743,9 +3212,7 @@ bool Anvil::CommandBufferBase::record_write_timestamp(VkPipelineStageFlagBits } #endif - cache_referenced_query_pool(in_query_pool_ptr); - - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdWriteTimestamp(m_command_buffer, @@ -3754,7 +3221,7 @@ bool Anvil::CommandBufferBase::record_write_timestamp(VkPipelineStageFlagBits in_query_index); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -3802,8 +3269,7 @@ bool Anvil::CommandBufferBase::reset(bool in_should_release_resources) /* Please see header for specification */ bool Anvil::CommandBufferBase::stop_recording() { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; VkResult result_vk; if (!m_recording_in_progress) @@ -3813,13 +3279,13 @@ bool Anvil::CommandBufferBase::stop_recording() goto end; } - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { result_vk = vkEndCommandBuffer(m_command_buffer); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); if (!is_vk_call_successful(result_vk)) { @@ -3835,17 +3301,16 @@ bool Anvil::CommandBufferBase::stop_recording() } /* Please see header for specification */ -Anvil::PrimaryCommandBuffer::PrimaryCommandBuffer(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_command_pool_ptr, - bool in_mt_safe) +Anvil::PrimaryCommandBuffer::PrimaryCommandBuffer(const Anvil::BaseDevice* in_device_ptr, + Anvil::CommandPool* in_parent_command_pool_ptr, + bool in_mt_safe) :CommandBufferBase(in_device_ptr, in_parent_command_pool_ptr, COMMAND_BUFFER_TYPE_PRIMARY, in_mt_safe) { - VkCommandBufferAllocateInfo alloc_info; - std::shared_ptr device_locked_ptr(in_device_ptr); - VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); + VkCommandBufferAllocateInfo alloc_info; + VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); ANVIL_REDUNDANT_VARIABLE(result_vk); @@ -3857,7 +3322,7 @@ Anvil::PrimaryCommandBuffer::PrimaryCommandBuffer(std::weak_ptrlock(); { - result_vk = vkAllocateCommandBuffers(device_locked_ptr->get_device_vk(), + result_vk = vkAllocateCommandBuffers(m_device_ptr->get_device_vk(), &alloc_info, &m_command_buffer); } @@ -3867,18 +3332,16 @@ Anvil::PrimaryCommandBuffer::PrimaryCommandBuffer(std::weak_ptr in_fbo_ptr, - VkRect2D in_render_area, - std::shared_ptr in_render_pass_ptr, - VkSubpassContents in_contents) +bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + VkRect2D in_render_area, + Anvil::RenderPass* in_render_pass_ptr, + VkSubpassContents in_contents) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - VkRenderPassBeginInfo render_pass_begin_info; - bool result = false; - auto sgpu_device_locked_ptr = std::shared_ptr(std::dynamic_pointer_cast(m_device_ptr.lock() ) ); - std::weak_ptr physical_device_ptr = sgpu_device_locked_ptr->get_physical_device(); + const Anvil::PhysicalDevice* physical_device_ptr = nullptr; + Anvil::StructChainer render_pass_begin_info_chain; + bool result = false; if (m_is_renderpass_active) { @@ -3894,6 +3357,14 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t goto end; } + { + const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr) ); + + anvil_assert(sgpu_device_ptr != nullptr); /* User attempted to call this function prototype with in_n_physical_devices set to 0 */ + + physical_device_ptr = sgpu_device_ptr->get_physical_device(); + } + #ifdef STORE_COMMAND_BUFFER_COMMANDS { if (!m_command_stashing_disabled) @@ -3901,6 +3372,7 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t m_commands.push_back(BeginRenderPassCommand(in_n_clear_values, in_clear_value_ptrs, in_fbo_ptr, + physical_device_ptr, in_render_area, in_render_pass_ptr, in_contents) ); @@ -3908,26 +3380,31 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t } #endif - render_pass_begin_info.clearValueCount = in_n_clear_values; - render_pass_begin_info.framebuffer = in_fbo_ptr->get_framebuffer(in_render_pass_ptr); - render_pass_begin_info.pClearValues = in_clear_value_ptrs; - render_pass_begin_info.pNext = nullptr; - render_pass_begin_info.renderArea = in_render_area; - render_pass_begin_info.renderPass = in_render_pass_ptr->get_render_pass(); - render_pass_begin_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO; + { + VkRenderPassBeginInfo render_pass_begin_info; - cache_referenced_framebuffer(in_fbo_ptr); - cache_referenced_renderpass (in_render_pass_ptr); + render_pass_begin_info.clearValueCount = in_n_clear_values; + render_pass_begin_info.framebuffer = in_fbo_ptr->get_framebuffer(in_render_pass_ptr); + render_pass_begin_info.pClearValues = in_clear_value_ptrs; + render_pass_begin_info.pNext = nullptr; + render_pass_begin_info.renderArea = in_render_area; + render_pass_begin_info.renderPass = in_render_pass_ptr->get_render_pass(); + render_pass_begin_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO; + + render_pass_begin_info_chain.append_struct(render_pass_begin_info); + } - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { + auto chain_ptr = render_pass_begin_info_chain.create_chain(); + vkCmdBeginRenderPass(m_command_buffer, - &render_pass_begin_info, + chain_ptr->get_root_struct(), in_contents); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); m_is_renderpass_active = true; result = true; @@ -3938,8 +3415,7 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t /* Please see header for specification */ bool Anvil::PrimaryCommandBuffer::record_end_render_pass() { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (!m_is_renderpass_active) { @@ -3964,13 +3440,13 @@ bool Anvil::PrimaryCommandBuffer::record_end_render_pass() } #endif - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdEndRenderPass(m_command_buffer); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); m_is_renderpass_active = false; result = true; @@ -3979,15 +3455,12 @@ bool Anvil::PrimaryCommandBuffer::record_end_render_pass() } /* Please see header for specification */ -bool Anvil::PrimaryCommandBuffer::record_execute_commands(uint32_t in_cmd_buffers_count, - std::shared_ptr* in_cmd_buffer_ptrs) +bool Anvil::PrimaryCommandBuffer::record_execute_commands(uint32_t in_cmd_buffers_count, + Anvil::SecondaryCommandBuffer** in_cmd_buffer_ptrs) { /* NOTE: The command can be executed both inside and outside a renderpass */ - VkCommandBuffer cmd_buffers[100]; - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; - - anvil_assert(in_cmd_buffers_count < sizeof(cmd_buffers) / sizeof(cmd_buffers[0]) ); + auto cmd_buffers = std::vector(in_cmd_buffers_count); + bool result = false; if (!m_recording_in_progress) { @@ -4010,20 +3483,18 @@ bool Anvil::PrimaryCommandBuffer::record_execute_commands(uint32_t n_cmd_buffer < in_cmd_buffers_count; ++n_cmd_buffer) { - cmd_buffers[n_cmd_buffer] = in_cmd_buffer_ptrs[n_cmd_buffer]->get_command_buffer(); - - cache_referenced_command_buffer(in_cmd_buffer_ptrs[n_cmd_buffer]); + cmd_buffers.at(n_cmd_buffer) = in_cmd_buffer_ptrs[n_cmd_buffer]->get_command_buffer(); } - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdExecuteCommands(m_command_buffer, in_cmd_buffers_count, - cmd_buffers); + (in_cmd_buffers_count > 0) ? &cmd_buffers.at(0) : nullptr); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -4033,8 +3504,7 @@ bool Anvil::PrimaryCommandBuffer::record_execute_commands(uint32_t /* Please see header for specification */ bool Anvil::PrimaryCommandBuffer::record_next_subpass(VkSubpassContents in_contents) { - auto parent_command_pool_locked_ptr = m_parent_command_pool_ptr.lock(); - bool result = false; + bool result = false; if (!m_is_renderpass_active) { @@ -4059,14 +3529,14 @@ bool Anvil::PrimaryCommandBuffer::record_next_subpass(VkSubpassContents in_conte } #endif - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { vkCmdNextSubpass(m_command_buffer, in_contents); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); result = true; end: @@ -4077,11 +3547,9 @@ bool Anvil::PrimaryCommandBuffer::record_next_subpass(VkSubpassContents in_conte bool Anvil::PrimaryCommandBuffer::start_recording(bool in_one_time_submit, bool in_simultaneous_use_allowed) { - VkCommandBufferBeginInfo command_buffer_begin_info; - std::shared_ptr device_locked_ptr (m_device_ptr); - auto parent_command_pool_locked_ptr(m_parent_command_pool_ptr.lock() ); - bool result (false); - VkResult result_vk; + bool result (false); + VkResult result_vk; + Anvil::StructChainer struct_chainer; if (m_recording_in_progress) { @@ -4090,20 +3558,28 @@ bool Anvil::PrimaryCommandBuffer::start_recording(bool in_one_time_submit, goto end; } - command_buffer_begin_info.flags = ((in_one_time_submit) ? VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT : 0u) | - ((in_simultaneous_use_allowed) ? VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT : 0u); - command_buffer_begin_info.pNext = nullptr; - command_buffer_begin_info.pInheritanceInfo = nullptr; /* Only relevant for secondary-level command buffers */ - command_buffer_begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO; + { + VkCommandBufferBeginInfo command_buffer_begin_info; + + command_buffer_begin_info.flags = ((in_one_time_submit) ? VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT : 0u) | + ((in_simultaneous_use_allowed) ? VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT : 0u); + command_buffer_begin_info.pNext = nullptr; + command_buffer_begin_info.pInheritanceInfo = nullptr; /* Only relevant for secondary-level command buffers */ + command_buffer_begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO; - parent_command_pool_locked_ptr->lock(); + struct_chainer.append_struct(command_buffer_begin_info); + } + + m_parent_command_pool_ptr->lock(); lock(); { + auto chain_ptr = struct_chainer.create_chain(); + result_vk = vkBeginCommandBuffer(m_command_buffer, - &command_buffer_begin_info); + chain_ptr->get_root_struct() ); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); if (!is_vk_call_successful(result_vk) ) { @@ -4119,8 +3595,6 @@ bool Anvil::PrimaryCommandBuffer::start_recording(bool in_one_time_submit, } #endif - clear_referenced_objects(); - m_recording_in_progress = true; result = true; @@ -4130,17 +3604,16 @@ bool Anvil::PrimaryCommandBuffer::start_recording(bool in_one_time_submit, /* Please see header for specification */ -Anvil::SecondaryCommandBuffer::SecondaryCommandBuffer(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_command_pool_ptr, - bool in_mt_safe) +Anvil::SecondaryCommandBuffer::SecondaryCommandBuffer(const Anvil::BaseDevice* in_device_ptr, + Anvil::CommandPool* in_parent_command_pool_ptr, + bool in_mt_safe) :CommandBufferBase(in_device_ptr, in_parent_command_pool_ptr, COMMAND_BUFFER_TYPE_SECONDARY, in_mt_safe) { - VkCommandBufferAllocateInfo command_buffer_alloc_info; - std::shared_ptr device_locked_ptr(in_device_ptr); - VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); + VkCommandBufferAllocateInfo command_buffer_alloc_info; + VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); ANVIL_REDUNDANT_VARIABLE(result_vk); @@ -4152,7 +3625,7 @@ Anvil::SecondaryCommandBuffer::SecondaryCommandBuffer(std::weak_ptrlock(); { - result_vk = vkAllocateCommandBuffers(device_locked_ptr->get_device_vk(), + result_vk = vkAllocateCommandBuffers(m_device_ptr->get_device_vk(), &command_buffer_alloc_info, &m_command_buffer); } @@ -4162,22 +3635,20 @@ Anvil::SecondaryCommandBuffer::SecondaryCommandBuffer(std::weak_ptr in_framebuffer_ptr, - std::shared_ptr in_render_pass_ptr, - SubPassID in_subpass_id, - OcclusionQuerySupportScope in_required_occlusion_query_support_scope, - bool in_occlusion_query_used_by_primary_command_buffer, - VkQueryPipelineStatisticFlags in_required_pipeline_statistics_scope) -{ - VkCommandBufferBeginInfo command_buffer_begin_info; - VkCommandBufferInheritanceInfo command_buffer_inheritance_info; - std::shared_ptr device_locked_ptr (m_device_ptr); - auto parent_command_pool_locked_ptr (m_parent_command_pool_ptr.lock() ); - bool result (false); - VkResult result_vk; +bool Anvil::SecondaryCommandBuffer::start_recording(bool in_one_time_submit, + bool in_simultaneous_use_allowed, + bool in_renderpass_usage_only, + Framebuffer* in_framebuffer_ptr, + RenderPass* in_render_pass_ptr, + SubPassID in_subpass_id, + OcclusionQuerySupportScope in_required_occlusion_query_support_scope, + bool in_occlusion_query_used_by_primary_command_buffer, + VkQueryPipelineStatisticFlags in_required_pipeline_statistics_scope) +{ + VkCommandBufferInheritanceInfo command_buffer_inheritance_info; + bool result (false); + VkResult result_vk; + Anvil::StructChainer struct_chainer; if (m_recording_in_progress) { @@ -4186,41 +3657,41 @@ bool Anvil::SecondaryCommandBuffer::start_recording(bool goto end; } - command_buffer_inheritance_info.framebuffer = (in_framebuffer_ptr != nullptr) ? in_framebuffer_ptr->get_framebuffer(in_render_pass_ptr) : VK_NULL_HANDLE; - command_buffer_inheritance_info.occlusionQueryEnable = (in_occlusion_query_used_by_primary_command_buffer) ? VK_TRUE : VK_FALSE; - command_buffer_inheritance_info.pipelineStatistics = in_required_pipeline_statistics_scope; - command_buffer_inheritance_info.pNext = nullptr; - command_buffer_inheritance_info.queryFlags = (in_occlusion_query_used_by_primary_command_buffer && - in_required_occlusion_query_support_scope == OCCLUSION_QUERY_SUPPORT_SCOPE_REQUIRED_PRECISE) ? VK_QUERY_CONTROL_PRECISE_BIT : 0u; - command_buffer_inheritance_info.renderPass = (in_render_pass_ptr != nullptr) ? in_render_pass_ptr->get_render_pass() : VK_NULL_HANDLE; - command_buffer_inheritance_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO; - command_buffer_inheritance_info.subpass = in_subpass_id; + { + VkCommandBufferBeginInfo command_buffer_begin_info; - command_buffer_begin_info.flags = ((in_one_time_submit) ? VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT : 0u) | - ((in_simultaneous_use_allowed) ? VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT : 0u) | - ((in_renderpass_usage_only) ? VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT : 0u); - command_buffer_begin_info.pInheritanceInfo = &command_buffer_inheritance_info; - command_buffer_begin_info.pNext = nullptr; - command_buffer_begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO; + command_buffer_begin_info.flags = ((in_one_time_submit) ? VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT : 0u) | + ((in_simultaneous_use_allowed) ? VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT : 0u) | + ((in_renderpass_usage_only) ? VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT : 0u); + command_buffer_begin_info.pInheritanceInfo = &command_buffer_inheritance_info; + command_buffer_begin_info.pNext = nullptr; + command_buffer_begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO; - if (in_framebuffer_ptr != nullptr) - { - cache_referenced_framebuffer(in_framebuffer_ptr); + struct_chainer.append_struct(command_buffer_begin_info); } - if (in_render_pass_ptr != nullptr) { - cache_referenced_renderpass(in_render_pass_ptr); + command_buffer_inheritance_info.framebuffer = (in_framebuffer_ptr != nullptr) ? in_framebuffer_ptr->get_framebuffer(in_render_pass_ptr) : VK_NULL_HANDLE; + command_buffer_inheritance_info.occlusionQueryEnable = (in_occlusion_query_used_by_primary_command_buffer) ? VK_TRUE : VK_FALSE; + command_buffer_inheritance_info.pipelineStatistics = in_required_pipeline_statistics_scope; + command_buffer_inheritance_info.pNext = nullptr; + command_buffer_inheritance_info.queryFlags = (in_occlusion_query_used_by_primary_command_buffer && + in_required_occlusion_query_support_scope == OCCLUSION_QUERY_SUPPORT_SCOPE_REQUIRED_PRECISE) ? VK_QUERY_CONTROL_PRECISE_BIT : 0u; + command_buffer_inheritance_info.renderPass = (in_render_pass_ptr != nullptr) ? in_render_pass_ptr->get_render_pass() : VK_NULL_HANDLE; + command_buffer_inheritance_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO; + command_buffer_inheritance_info.subpass = in_subpass_id; } - parent_command_pool_locked_ptr->lock(); + m_parent_command_pool_ptr->lock(); lock(); { + auto chain_ptr = struct_chainer.create_chain(); + result_vk = vkBeginCommandBuffer(m_command_buffer, - &command_buffer_begin_info); + chain_ptr->get_root_struct() ); } unlock(); - parent_command_pool_locked_ptr->unlock(); + m_parent_command_pool_ptr->unlock(); if (!is_vk_call_successful(result_vk) ) { @@ -4236,8 +3707,6 @@ bool Anvil::SecondaryCommandBuffer::start_recording(bool } #endif - clear_referenced_objects(); - m_is_renderpass_active = in_renderpass_usage_only; m_recording_in_progress = true; diff --git a/src/wrappers/command_pool.cpp b/src/wrappers/command_pool.cpp index c9a17bcb..06f81a26 100644 --- a/src/wrappers/command_pool.cpp +++ b/src/wrappers/command_pool.cpp @@ -30,11 +30,11 @@ #include /* Please see header for specification */ -Anvil::CommandPool::CommandPool(std::weak_ptr in_device_ptr, - bool in_transient_allocations_friendly, - bool in_support_per_cmdbuf_reset_ops, - Anvil::QueueFamilyType in_queue_family, - bool in_mt_safe) +Anvil::CommandPool::CommandPool(Anvil::BaseDevice* in_device_ptr, + bool in_transient_allocations_friendly, + bool in_support_per_cmdbuf_reset_ops, + uint32_t in_queue_family_index, + bool in_mt_safe) :DebugMarkerSupportProvider (in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT), @@ -42,27 +42,22 @@ Anvil::CommandPool::CommandPool(std::weak_ptr in_device_ptr, m_command_pool (VK_NULL_HANDLE), m_device_ptr (in_device_ptr), m_is_transient_allocations_friendly(in_transient_allocations_friendly), - m_queue_family (in_queue_family), + m_queue_family_index (in_queue_family_index), m_supports_per_cmdbuf_reset_ops (in_support_per_cmdbuf_reset_ops) { - VkCommandPoolCreateInfo command_pool_create_info; - std::shared_ptr device_locked_ptr (in_device_ptr); - uint32_t queue_family_index (UINT32_MAX); - VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); + VkCommandPoolCreateInfo command_pool_create_info; + VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); ANVIL_REDUNDANT_VARIABLE(result_vk); - queue_family_index = (device_locked_ptr->get_queue_family_index(in_queue_family) ); - anvil_assert(queue_family_index != UINT32_MAX); - /* Go on and create the command pool */ command_pool_create_info.flags = ((in_transient_allocations_friendly) ? VK_COMMAND_POOL_CREATE_TRANSIENT_BIT : 0u) | ((in_support_per_cmdbuf_reset_ops) ? VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT : 0u); command_pool_create_info.pNext = nullptr; - command_pool_create_info.queueFamilyIndex = queue_family_index; + command_pool_create_info.queueFamilyIndex = in_queue_family_index; command_pool_create_info.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO; - result_vk = vkCreateCommandPool(device_locked_ptr->get_device_vk(), + result_vk = vkCreateCommandPool(in_device_ptr->get_device_vk(), &command_pool_create_info, nullptr, /* pAllocator */ &m_command_pool); @@ -88,11 +83,9 @@ Anvil::CommandPool::~CommandPool() /* Release the Vulkan command pool */ if (m_command_pool != VK_NULL_HANDLE) { - std::shared_ptr device_locked_ptr(m_device_ptr); - lock(); { - vkDestroyCommandPool(device_locked_ptr->get_device_vk(), + vkDestroyCommandPool(m_device_ptr->get_device_vk(), m_command_pool, nullptr /* pAllocator */); } @@ -103,13 +96,14 @@ Anvil::CommandPool::~CommandPool() } /* Please see header for specification */ -std::shared_ptr Anvil::CommandPool::alloc_primary_level_command_buffer() +Anvil::PrimaryCommandBufferUniquePtr Anvil::CommandPool::alloc_primary_level_command_buffer() { - std::shared_ptr new_buffer_ptr; + Anvil::PrimaryCommandBufferUniquePtr new_buffer_ptr(nullptr, + std::default_delete() ); new_buffer_ptr.reset( new PrimaryCommandBuffer(m_device_ptr, - shared_from_this(), + this, is_mt_safe() ) ); @@ -117,13 +111,14 @@ std::shared_ptr Anvil::CommandPool::alloc_primary_l } /* Please see header for specification */ -std::shared_ptr Anvil::CommandPool::alloc_secondary_level_command_buffer() +Anvil::SecondaryCommandBufferUniquePtr Anvil::CommandPool::alloc_secondary_level_command_buffer() { - std::shared_ptr new_buffer_ptr; + Anvil::SecondaryCommandBufferUniquePtr new_buffer_ptr(nullptr, + std::default_delete() ); new_buffer_ptr.reset( new SecondaryCommandBuffer(m_device_ptr, - shared_from_this(), + this, is_mt_safe() ) ); @@ -131,21 +126,22 @@ std::shared_ptr Anvil::CommandPool::alloc_seconda } /* Please see header for specification */ -std::shared_ptr Anvil::CommandPool::create(std::weak_ptr in_device_ptr, - bool in_transient_allocations_friendly, - bool in_support_per_cmdbuf_reset_ops, - Anvil::QueueFamilyType in_queue_family, - MTSafety in_mt_safety) +Anvil::CommandPoolUniquePtr Anvil::CommandPool::create(Anvil::BaseDevice* in_device_ptr, + bool in_transient_allocations_friendly, + bool in_support_per_cmdbuf_reset_ops, + uint32_t in_queue_family_index, + MTSafety in_mt_safety) { - const bool is_mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - std::shared_ptr result_ptr; + const bool is_mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); + Anvil::CommandPoolUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::CommandPool(in_device_ptr, in_transient_allocations_friendly, in_support_per_cmdbuf_reset_ops, - in_queue_family, + in_queue_family_index, is_mt_safe) ); @@ -155,13 +151,12 @@ std::shared_ptr Anvil::CommandPool::create(std::weak_ptr device_locked_ptr(m_device_ptr); - std::unique_lock mutex_lock; - VkResult result_vk; + std::unique_lock mutex_lock; + VkResult result_vk; lock(); { - result_vk = vkResetCommandPool(device_locked_ptr->get_device_vk(), + result_vk = vkResetCommandPool(m_device_ptr->get_device_vk(), m_command_pool, ((in_release_resources) ? VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT : 0u) ); } @@ -175,20 +170,18 @@ bool Anvil::CommandPool::reset(bool in_release_resources) /* Please see header for specification */ void Anvil::CommandPool::trim() { - std::shared_ptr device_locked_ptr(m_device_ptr); - - if (device_locked_ptr->is_khr_maintenance1_extension_enabled() ) + if (m_device_ptr->is_khr_maintenance1_extension_enabled() ) { lock(); { - device_locked_ptr->get_extension_khr_maintenance1_entrypoints().vkTrimCommandPoolKHR(device_locked_ptr->get_device_vk(), - m_command_pool, - 0); /* flags */ + m_device_ptr->get_extension_khr_maintenance1_entrypoints().vkTrimCommandPoolKHR(m_device_ptr->get_device_vk(), + m_command_pool, + 0); /* flags */ } unlock(); } else { - anvil_assert(device_locked_ptr->is_khr_maintenance1_extension_enabled() ); + anvil_assert(m_device_ptr->is_khr_maintenance1_extension_enabled() ); } } \ No newline at end of file diff --git a/src/wrappers/compute_pipeline_manager.cpp b/src/wrappers/compute_pipeline_manager.cpp index 264cf26d..ce297199 100644 --- a/src/wrappers/compute_pipeline_manager.cpp +++ b/src/wrappers/compute_pipeline_manager.cpp @@ -31,10 +31,10 @@ #include -Anvil::ComputePipelineManager::ComputePipelineManager(std::weak_ptr in_device_ptr, - bool in_mt_safe, - bool in_use_pipeline_cache, - std::shared_ptr in_pipeline_cache_to_reuse_ptr) +Anvil::ComputePipelineManager::ComputePipelineManager(Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe, + bool in_use_pipeline_cache, + Anvil::PipelineCache* in_pipeline_cache_to_reuse_ptr) :BasePipelineManager(in_device_ptr, in_mt_safe, in_use_pipeline_cache, @@ -87,7 +87,6 @@ bool Anvil::ComputePipelineManager::bake() } BakeItem; std::map > layout_to_bake_item_map; - std::shared_ptr locked_device_ptr (m_device_ptr); std::unique_lock mutex_lock; auto mutex_ptr (get_mutex() ); uint32_t n_current_pipeline (0); @@ -122,7 +121,9 @@ bool Anvil::ComputePipelineManager::bake() if (current_pipeline_ptr->layout_ptr == nullptr) { - current_pipeline_ptr->layout_ptr = get_pipeline_layout(pipeline_iterator->first); + get_pipeline_layout(pipeline_iterator->first); + + anvil_assert(current_pipeline_ptr->layout_ptr != nullptr); } current_pipeline_info_ptr->get_specialization_constants(Anvil::SHADER_STAGE_COMPUTE, @@ -191,7 +192,7 @@ bool Anvil::ComputePipelineManager::bake() pipeline_create_info.flags = 0; pipeline_create_info.layout = current_pipeline_ptr->layout_ptr->get_pipeline_layout(); - pipeline_create_info.pNext = VK_NULL_HANDLE; + pipeline_create_info.pNext = nullptr; pipeline_create_info.stage.flags = 0; pipeline_create_info.stage.pName = shader_stage_entry_point_ptr->name.c_str(); pipeline_create_info.stage.pNext = nullptr; @@ -241,7 +242,7 @@ bool Anvil::ComputePipelineManager::bake() m_pipeline_cache_ptr->lock(); { - result_vk = vkCreateComputePipelines(locked_device_ptr->get_device_vk(), + result_vk = vkCreateComputePipelines(m_device_ptr->get_device_vk(), m_pipeline_cache_ptr->get_pipeline_cache(), static_cast(pipeline_create_info_items_vk.size() ), &pipeline_create_info_items_vk[0], @@ -284,12 +285,12 @@ bool Anvil::ComputePipelineManager::bake() } /* Please see header for specification */ -std::shared_ptr Anvil::ComputePipelineManager::create(std::weak_ptr in_device_ptr, - bool in_mt_safe, - bool in_use_pipeline_cache, - std::shared_ptr in_pipeline_cache_to_reuse_ptr) +std::unique_ptr Anvil::ComputePipelineManager::create(Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe, + bool in_use_pipeline_cache, + Anvil::PipelineCache* in_pipeline_cache_to_reuse_ptr) { - std::shared_ptr result_ptr; + std::unique_ptr result_ptr; result_ptr.reset( new Anvil::ComputePipelineManager(in_device_ptr, diff --git a/src/wrappers/descriptor_pool.cpp b/src/wrappers/descriptor_pool.cpp index b85208c1..e7666698 100644 --- a/src/wrappers/descriptor_pool.cpp +++ b/src/wrappers/descriptor_pool.cpp @@ -21,7 +21,9 @@ // #include "misc/debug.h" +#include "misc/descriptor_set_info.h" #include "misc/object_tracker.h" +#include "misc/struct_chainer.h" #include "wrappers/descriptor_pool.h" #include "wrappers/descriptor_set.h" #include "wrappers/descriptor_set_layout.h" @@ -29,23 +31,23 @@ /* Please see header for specification */ -Anvil::DescriptorPool::DescriptorPool(std::weak_ptr in_device_ptr, - uint32_t in_n_max_sets, - bool in_releaseable_sets, - bool in_mt_safe) +Anvil::DescriptorPool::DescriptorPool(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_n_max_sets, + const Anvil::DescriptorPoolFlags& in_flags, + const uint32_t* in_descriptor_count_per_type_ptr, + bool in_mt_safe) :CallbacksSupportProvider (DESCRIPTOR_POOL_CALLBACK_ID_COUNT), DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT), MTSafetySupportProvider (in_mt_safe), - m_baked (false), m_device_ptr (in_device_ptr), + m_flags (in_flags), m_n_max_sets (in_n_max_sets), - m_pool (VK_NULL_HANDLE), - m_releaseable_sets (in_releaseable_sets) + m_pool (VK_NULL_HANDLE) { - memset(m_descriptor_count, - 0, - sizeof(m_descriptor_count) ); + memcpy(m_descriptor_count, + in_descriptor_count_per_type_ptr, + sizeof(uint32_t) * VK_DESCRIPTOR_TYPE_RANGE_SIZE); /* Register the object in the Object Tracker */ Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_DESCRIPTOR_POOL, @@ -61,11 +63,9 @@ Anvil::DescriptorPool::~DescriptorPool() if (m_pool != VK_NULL_HANDLE) { - std::shared_ptr device_locked_ptr(m_device_ptr); - lock(); { - vkDestroyDescriptorPool(device_locked_ptr->get_device_vk(), + vkDestroyDescriptorPool(m_device_ptr->get_device_vk(), m_pool, nullptr /* pAllocator */); } @@ -76,17 +76,17 @@ Anvil::DescriptorPool::~DescriptorPool() } /* Please see header for specification */ -bool Anvil::DescriptorPool::alloc_descriptor_sets(uint32_t in_n_sets, - std::shared_ptr* in_descriptor_set_layouts_ptr, - std::shared_ptr* out_descriptor_sets_ptr, - VkResult* out_opt_result_ptr) +bool Anvil::DescriptorPool::alloc_descriptor_sets(uint32_t in_n_sets, + const DescriptorSetAllocation* in_ds_allocations_ptr, + DescriptorSetUniquePtr* out_descriptor_sets_ptr, + VkResult* out_opt_result_ptr) { bool result = false; m_ds_cache.resize(in_n_sets); result = alloc_descriptor_sets(in_n_sets, - in_descriptor_set_layouts_ptr, + in_ds_allocations_ptr, &m_ds_cache.at(0), out_opt_result_ptr); @@ -97,10 +97,29 @@ bool Anvil::DescriptorPool::alloc_descriptor_sets(uint32_t ++n_set) { out_descriptor_sets_ptr[n_set] = Anvil::DescriptorSet::create(m_device_ptr, - shared_from_this(), - in_descriptor_set_layouts_ptr[n_set], + this, + in_ds_allocations_ptr[n_set].ds_layout_ptr, m_ds_cache[n_set], Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); + + if (out_descriptor_sets_ptr[n_set] == nullptr) + { + anvil_assert_fail(); + + result = false; + goto end; + } + } + } + +end: + if (!result) + { + for (uint32_t n_set = 0; + n_set < in_n_sets; + ++n_set) + { + out_descriptor_sets_ptr[n_set].reset(); } } @@ -108,42 +127,53 @@ bool Anvil::DescriptorPool::alloc_descriptor_sets(uint32_t } /* Please see header for specification */ -bool Anvil::DescriptorPool::alloc_descriptor_sets(uint32_t in_n_sets, - std::shared_ptr* in_descriptor_set_layouts_ptr, - VkDescriptorSet* out_descriptor_sets_vk_ptr, - VkResult* out_opt_result_ptr) +bool Anvil::DescriptorPool::alloc_descriptor_sets(uint32_t in_n_sets, + const DescriptorSetAllocation* in_ds_allocations_ptr, + VkDescriptorSet* out_descriptor_sets_vk_ptr, + VkResult* out_opt_result_ptr) { - std::shared_ptr device_locked_ptr(m_device_ptr); - VkDescriptorSetAllocateInfo ds_alloc_info; - VkResult result_vk; + bool result (false); + VkResult result_vk; + Anvil::StructChainer struct_chainer; - if (!m_baked) + lock(); { - bake(); + m_ds_layout_cache.resize(in_n_sets); - anvil_assert(m_baked); - } + for (uint32_t n_set = 0; + n_set < in_n_sets; + ++n_set) + { + if (in_ds_allocations_ptr[n_set].ds_layout_ptr != nullptr) + { + m_ds_layout_cache[n_set] = in_ds_allocations_ptr[n_set].ds_layout_ptr->get_layout(); + } + else + { + /* This is a "gap" set. */ + m_ds_layout_cache[n_set] = m_device_ptr->get_dummy_descriptor_set_layout()->get_layout(); + } + } - m_ds_layout_cache.resize(in_n_sets); + { + VkDescriptorSetAllocateInfo ds_alloc_info; - for (uint32_t n_set = 0; - n_set < in_n_sets; - ++n_set) - { - m_ds_layout_cache[n_set] = in_descriptor_set_layouts_ptr[n_set]->get_layout(); - } + ds_alloc_info.descriptorPool = m_pool; + ds_alloc_info.descriptorSetCount = in_n_sets; + ds_alloc_info.pNext = nullptr; + ds_alloc_info.pSetLayouts = &m_ds_layout_cache.at(0); + ds_alloc_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO; - ds_alloc_info.descriptorPool = m_pool; - ds_alloc_info.descriptorSetCount = in_n_sets; - ds_alloc_info.pNext = nullptr; - ds_alloc_info.pSetLayouts = &m_ds_layout_cache[0]; - ds_alloc_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO; + struct_chainer.append_struct(ds_alloc_info); + } - lock(); - { - result_vk = vkAllocateDescriptorSets(device_locked_ptr->get_device_vk(), - &ds_alloc_info, - out_descriptor_sets_vk_ptr); + { + auto chain_ptr = struct_chainer.create_chain(); + + result_vk = vkAllocateDescriptorSets(m_device_ptr->get_device_vk(), + chain_ptr->get_root_struct(), + out_descriptor_sets_vk_ptr); + } } unlock(); @@ -152,34 +182,51 @@ bool Anvil::DescriptorPool::alloc_descriptor_sets(uint32_t *out_opt_result_ptr = result_vk; } - return is_vk_call_successful(result_vk); + result = is_vk_call_successful(result_vk); + + return result; } /* Please see header for specification */ -void Anvil::DescriptorPool::bake() +Anvil::DescriptorPoolUniquePtr Anvil::DescriptorPool::create(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_n_max_sets, + const Anvil::DescriptorPoolFlags& in_flags, + const uint32_t* in_descriptor_count_per_type_ptr, + MTSafety in_mt_safety) { - VkDescriptorPoolCreateInfo descriptor_pool_create_info; - VkDescriptorPoolSize descriptor_pool_sizes[VK_DESCRIPTOR_TYPE_RANGE_SIZE]; - std::shared_ptr device_locked_ptr (m_device_ptr); - uint32_t n_descriptor_types_used(0); - VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); + const bool is_mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); + DescriptorPoolUniquePtr result_ptr(nullptr, + std::default_delete() ); - ANVIL_REDUNDANT_VARIABLE(result_vk); + result_ptr.reset( + new Anvil::DescriptorPool(in_device_ptr, + in_n_max_sets, + in_flags, + in_descriptor_count_per_type_ptr, + is_mt_safe) + ); - if (m_pool != VK_NULL_HANDLE) + if (result_ptr != nullptr) { - lock(); + if (!result_ptr->init() ) { - vkDestroyDescriptorPool(device_locked_ptr->get_device_vk(), - m_pool, - nullptr /* pAllocator */); + result_ptr.reset(); } - unlock(); - - set_vk_handle(VK_NULL_HANDLE); - m_pool = VK_NULL_HANDLE; } + return result_ptr; +} + +/* Please see header for specification */ +bool Anvil::DescriptorPool::init() +{ + VkDescriptorPoolCreateInfo descriptor_pool_create_info; + VkDescriptorPoolSize descriptor_pool_sizes[VK_DESCRIPTOR_TYPE_RANGE_SIZE]; + uint32_t n_descriptor_types_used (0); + bool result (false); + VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); + /* Convert the counters to an arrayed, linear representation */ for (uint32_t n_descriptor_type = 0; n_descriptor_type < VK_DESCRIPTOR_TYPE_RANGE_SIZE; @@ -197,15 +244,14 @@ void Anvil::DescriptorPool::bake() } /* Set up the descriptor pool instance */ - descriptor_pool_create_info.flags = (m_releaseable_sets) ? VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT - : 0u; + descriptor_pool_create_info.flags = ((m_flags & Anvil::DESCRIPTOR_POOL_FLAG_CREATE_FREE_DESCRIPTOR_SET_BIT) ? VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT : 0u); descriptor_pool_create_info.maxSets = m_n_max_sets; descriptor_pool_create_info.pNext = nullptr; descriptor_pool_create_info.poolSizeCount = n_descriptor_types_used; descriptor_pool_create_info.pPoolSizes = descriptor_pool_sizes; descriptor_pool_create_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO; - result_vk = vkCreateDescriptorPool(device_locked_ptr->get_device_vk(), + result_vk = vkCreateDescriptorPool(m_device_ptr->get_device_vk(), &descriptor_pool_create_info, nullptr, /* pAllocator */ &m_pool); @@ -215,28 +261,16 @@ void Anvil::DescriptorPool::bake() { set_vk_handle(m_pool); } + else + { + anvil_assert(result); - m_baked = true; -} - -/* Please see header for specification */ -std::shared_ptr Anvil::DescriptorPool::create(std::weak_ptr in_device_ptr, - uint32_t in_n_max_sets, - bool in_releaseable_sets, - MTSafety in_mt_safety) -{ - const bool is_mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - std::shared_ptr result_ptr; - - result_ptr.reset( - new Anvil::DescriptorPool(in_device_ptr, - in_n_max_sets, - in_releaseable_sets, - is_mt_safe) - ); + goto end; + } - return result_ptr; + result = true; +end: + return result; } /* Please see header for specification */ @@ -246,12 +280,10 @@ bool Anvil::DescriptorPool::reset() if (m_pool != VK_NULL_HANDLE) { - std::shared_ptr device_locked_ptr(m_device_ptr); - /* TODO: Host synchronization to VkDescriptorSetObjects alloc'ed from the pool. */ lock(); { - result_vk = vkResetDescriptorPool(device_locked_ptr->get_device_vk(), + result_vk = vkResetDescriptorPool(m_device_ptr->get_device_vk(), m_pool, 0 /* flags */); } diff --git a/src/wrappers/descriptor_set.cpp b/src/wrappers/descriptor_set.cpp index 09b2e09d..25a4548a 100644 --- a/src/wrappers/descriptor_set.cpp +++ b/src/wrappers/descriptor_set.cpp @@ -28,6 +28,7 @@ #include "wrappers/descriptor_pool.h" #include "wrappers/descriptor_set.h" #include "wrappers/descriptor_set_layout.h" +#include "wrappers/descriptor_update_template.h" #include "wrappers/device.h" #include "wrappers/image_view.h" #include "wrappers/sampler.h" @@ -115,11 +116,11 @@ Anvil::DescriptorSet::BindingItem& Anvil::DescriptorSet::BindingItem::operator=( /** Please see header for specification */ Anvil::DescriptorSet::BindingItem::~BindingItem() { - /* Stub */ + buffer_ptr = nullptr; } /** Please see header for specification */ -Anvil::DescriptorSet::BufferBindingElement::BufferBindingElement(std::shared_ptr in_buffer_ptr) +Anvil::DescriptorSet::BufferBindingElement::BufferBindingElement(Anvil::Buffer* in_buffer_ptr) { anvil_assert(in_buffer_ptr != nullptr); @@ -129,9 +130,9 @@ Anvil::DescriptorSet::BufferBindingElement::BufferBindingElement(std::shared_ptr } /** Please see header for specification */ -Anvil::DescriptorSet::BufferBindingElement::BufferBindingElement(std::shared_ptr in_buffer_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size) +Anvil::DescriptorSet::BufferBindingElement::BufferBindingElement(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size) { anvil_assert(in_buffer_ptr != nullptr); @@ -158,9 +159,9 @@ Anvil::DescriptorSet::BufferBindingElement::BufferBindingElement(const BufferBin } /** Please see header for specification */ -Anvil::DescriptorSet::CombinedImageSamplerBindingElement::CombinedImageSamplerBindingElement(VkImageLayout in_image_layout, - std::shared_ptr in_image_view_ptr, - std::shared_ptr in_sampler_ptr) +Anvil::DescriptorSet::CombinedImageSamplerBindingElement::CombinedImageSamplerBindingElement(VkImageLayout in_image_layout, + Anvil::ImageView* in_image_view_ptr, + Anvil::Sampler* in_sampler_ptr) { anvil_assert(in_image_view_ptr != nullptr); @@ -172,7 +173,8 @@ Anvil::DescriptorSet::CombinedImageSamplerBindingElement::CombinedImageSamplerBi /** Please see header for specification */ Anvil::DescriptorSet::CombinedImageSamplerBindingElement::~CombinedImageSamplerBindingElement() { - /* Stub */ + image_view_ptr = nullptr; + sampler_ptr = nullptr; } /** Please see header for specification */ @@ -184,8 +186,8 @@ Anvil::DescriptorSet::CombinedImageSamplerBindingElement::CombinedImageSamplerBi } /** Please see header for specification */ -Anvil::DescriptorSet::ImageBindingElement::ImageBindingElement(VkImageLayout in_image_layout, - std::shared_ptr in_image_view_ptr) +Anvil::DescriptorSet::ImageBindingElement::ImageBindingElement(VkImageLayout in_image_layout, + Anvil::ImageView* in_image_view_ptr) { anvil_assert(in_image_view_ptr != nullptr); @@ -207,7 +209,7 @@ Anvil::DescriptorSet::ImageBindingElement::~ImageBindingElement() } /** Please see header for specification */ -Anvil::DescriptorSet::SamplerBindingElement::SamplerBindingElement(std::shared_ptr in_sampler_ptr) +Anvil::DescriptorSet::SamplerBindingElement::SamplerBindingElement(Anvil::Sampler* in_sampler_ptr) { anvil_assert(in_sampler_ptr != nullptr); @@ -223,11 +225,11 @@ Anvil::DescriptorSet::SamplerBindingElement::SamplerBindingElement(const Sampler /** Please see header for specification */ Anvil::DescriptorSet::SamplerBindingElement::~SamplerBindingElement() { - /* Stub */ + sampler_ptr = nullptr; } /** Please see header for specification */ -Anvil::DescriptorSet::TexelBufferBindingElement::TexelBufferBindingElement(std::shared_ptr in_buffer_view_ptr) +Anvil::DescriptorSet::TexelBufferBindingElement::TexelBufferBindingElement(Anvil::BufferView* in_buffer_view_ptr) { anvil_assert(in_buffer_view_ptr != nullptr); @@ -247,11 +249,11 @@ Anvil::DescriptorSet::TexelBufferBindingElement::TexelBufferBindingElement(const } /** Please see header for specification */ -Anvil::DescriptorSet::DescriptorSet(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_pool_ptr, - std::shared_ptr in_layout_ptr, - VkDescriptorSet in_descriptor_set, - bool in_mt_safe) +Anvil::DescriptorSet::DescriptorSet(const Anvil::BaseDevice* in_device_ptr, + Anvil::DescriptorPool* in_parent_pool_ptr, + const Anvil::DescriptorSetLayout* in_layout_ptr, + VkDescriptorSet in_descriptor_set, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT), MTSafetySupportProvider (in_mt_safe), @@ -302,12 +304,12 @@ void Anvil::DescriptorSet::alloc_bindings() uint32_t array_size = 0; uint32_t binding_index; - layout_info_ptr->get_binding_properties(n_binding, - &binding_index, - nullptr, /* out_opt_descriptor_type_ptr */ - &array_size, - nullptr, /* out_opt_stage_flags_ptr */ - nullptr); /* out_opt_immutable_samplers_enabled_ptr */ + layout_info_ptr->get_binding_properties_by_index_number(n_binding, + &binding_index, + nullptr, /* out_opt_descriptor_type_ptr */ + &array_size, + nullptr, /* out_opt_stage_flags_ptr */ + nullptr); /* out_opt_immutable_samplers_enabled_ptr */ if (m_bindings[binding_index].size() != array_size) { @@ -319,188 +321,16 @@ void Anvil::DescriptorSet::alloc_bindings() } /* Please see header for specification */ -bool Anvil::DescriptorSet::bake() -{ - const auto layout_info_ptr = m_layout_ptr->get_info(); - bool result = false; - - anvil_assert(!m_unusable); - - if (m_dirty) - { - uint32_t cached_ds_buffer_info_items_array_offset = 0; - uint32_t cached_ds_image_info_items_array_offset = 0; - uint32_t cached_ds_texel_buffer_info_items_array_offset = 0; - const uint32_t n_bindings = static_cast(m_bindings.size() ); - uint32_t n_max_ds_info_items_to_cache = 0; - - m_cached_ds_info_buffer_info_items_vk.clear(); - m_cached_ds_info_image_info_items_vk.clear(); - m_cached_ds_info_texel_buffer_info_items_vk.clear(); - m_cached_ds_write_items_vk.clear(); - - for (auto& binding : m_bindings) - { - const uint32_t n_current_binding_items = static_cast(binding.second.size() ); - - n_max_ds_info_items_to_cache += n_current_binding_items; - } - - m_cached_ds_info_buffer_info_items_vk.reserve (n_max_ds_info_items_to_cache); - m_cached_ds_info_image_info_items_vk.reserve (n_max_ds_info_items_to_cache); - m_cached_ds_info_texel_buffer_info_items_vk.reserve(n_max_ds_info_items_to_cache); - - for (uint32_t n_binding = 0; - n_binding < n_bindings; - ++n_binding) - { - uint32_t current_binding_index; - VkDescriptorType descriptor_type; - bool immutable_samplers_enabled = false; - const uint32_t start_ds_buffer_info_items_array_offset = cached_ds_buffer_info_items_array_offset; - const uint32_t start_ds_image_info_items_array_offset = cached_ds_image_info_items_array_offset; - const uint32_t start_ds_texel_buffer_info_items_array_offset = cached_ds_texel_buffer_info_items_array_offset; - VkWriteDescriptorSet write_ds_vk; - - if (!layout_info_ptr->get_binding_properties(n_binding, - ¤t_binding_index, - &descriptor_type, - nullptr, /* out_opt_descriptor_array_size_ptr */ - nullptr, /* out_opt_stage_flags_ptr */ - &immutable_samplers_enabled) ) - { - anvil_assert_fail(); - } - - /* For each array item, initialize a descriptor info item.. */ - BindingItems& current_binding_items = m_bindings[current_binding_index]; - const uint32_t n_current_binding_items = static_cast(current_binding_items.size() ); - - for (uint32_t n_current_binding_item = 0; - n_current_binding_item < n_current_binding_items; - ++n_current_binding_item) - { - BindingItem& current_binding_item = current_binding_items[n_current_binding_item]; - - if (!current_binding_item.dirty) - { - continue; - } - - if (current_binding_item.buffer_ptr != nullptr) - { - VkDescriptorBufferInfo buffer_info; - - buffer_info.buffer = current_binding_item.buffer_ptr->get_buffer(); - - if (current_binding_item.start_offset != UINT64_MAX) - { - buffer_info.offset = current_binding_item.start_offset; - buffer_info.range = current_binding_item.size; - } - else - { - buffer_info.offset = current_binding_item.buffer_ptr->get_start_offset(); - buffer_info.range = current_binding_item.buffer_ptr->get_size (); - } - - m_cached_ds_info_buffer_info_items_vk.push_back(buffer_info); - - ++cached_ds_buffer_info_items_array_offset; - } - else - if (current_binding_item.buffer_view_ptr != nullptr) - { - m_cached_ds_info_texel_buffer_info_items_vk.push_back( current_binding_item.buffer_view_ptr->get_buffer_view() ); - - ++cached_ds_texel_buffer_info_items_array_offset; - } - else - if (current_binding_item.image_view_ptr != nullptr) - { - VkDescriptorImageInfo image_info; - - image_info.imageLayout = current_binding_item.image_layout; - image_info.imageView = current_binding_item.image_view_ptr->get_image_view(); - - if (false == immutable_samplers_enabled && - nullptr != current_binding_item.sampler_ptr) - { - image_info.sampler = current_binding_item.sampler_ptr->get_sampler(); - } - else - { - image_info.sampler = VK_NULL_HANDLE; - } - - m_cached_ds_info_image_info_items_vk.push_back(image_info); - - ++cached_ds_image_info_items_array_offset; - } - else - { - anvil_assert_fail(); - - goto end; - } - } - - /* We can finally fill the write descriptor */ - if (current_binding_items.size() > 0) - { - write_ds_vk.descriptorCount = static_cast(current_binding_items.size() ); - write_ds_vk.descriptorType = descriptor_type; - write_ds_vk.dstArrayElement = 0; - write_ds_vk.dstBinding = current_binding_index; - write_ds_vk.dstSet = m_descriptor_set; - write_ds_vk.pBufferInfo = (start_ds_buffer_info_items_array_offset != cached_ds_buffer_info_items_array_offset) ? &m_cached_ds_info_buffer_info_items_vk[start_ds_buffer_info_items_array_offset] - : nullptr; - write_ds_vk.pImageInfo = (start_ds_image_info_items_array_offset != cached_ds_image_info_items_array_offset) ? &m_cached_ds_info_image_info_items_vk[start_ds_image_info_items_array_offset] - : nullptr; - write_ds_vk.pNext = nullptr; - write_ds_vk.pTexelBufferView = (start_ds_texel_buffer_info_items_array_offset != cached_ds_texel_buffer_info_items_array_offset) ? &m_cached_ds_info_texel_buffer_info_items_vk[start_ds_texel_buffer_info_items_array_offset] - : nullptr; - write_ds_vk.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; - - m_cached_ds_write_items_vk.push_back(write_ds_vk); - } - } - - /* Issue the Vulkan call */ - if (m_cached_ds_write_items_vk.size() > 0) - { - std::shared_ptr device_locked_ptr(m_device_ptr); - - lock(); - { - vkUpdateDescriptorSets(device_locked_ptr->get_device_vk(), - static_cast(m_cached_ds_write_items_vk.size() ), - &m_cached_ds_write_items_vk[0], - 0, /* copyCount */ - nullptr); /* pDescriptorCopies */ - } - unlock(); - } - - m_dirty = false; - } - - result = true; - -end: - return result; -} - -/* Please see header for specification */ -std::shared_ptr Anvil::DescriptorSet::create(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_pool_ptr, - std::shared_ptr in_layout_ptr, - VkDescriptorSet in_descriptor_set, - MTSafety in_mt_safety) +Anvil::DescriptorSetUniquePtr Anvil::DescriptorSet::create(const Anvil::BaseDevice* in_device_ptr, + Anvil::DescriptorPool* in_parent_pool_ptr, + const Anvil::DescriptorSetLayout* in_layout_ptr, + VkDescriptorSet in_descriptor_set, + MTSafety in_mt_safety) { - const bool is_mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - std::shared_ptr result_ptr; + const bool is_mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); + Anvil::DescriptorSetUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::DescriptorSet(in_device_ptr, @@ -513,50 +343,47 @@ std::shared_ptr Anvil::DescriptorSet::create(std::weak_ptr return result_ptr; } -/* Please see header for specification */ -bool Anvil::DescriptorSet::get_binding_array_size(uint32_t in_n_binding, - uint32_t* out_result_ptr) const +void Anvil::DescriptorSet::fill_buffer_info_vk_descriptor(const Anvil::DescriptorSet::BindingItem& in_binding_item, + VkDescriptorBufferInfo* out_descriptor_ptr) const { - bool result = true; + out_descriptor_ptr->buffer = in_binding_item.buffer_ptr->get_buffer(); - if (m_bindings.find(in_n_binding) == m_bindings.end() ) + if (in_binding_item.start_offset != UINT64_MAX) { - result = false; - goto end; + out_descriptor_ptr->offset = in_binding_item.start_offset; + out_descriptor_ptr->range = in_binding_item.size; + } + else + { + out_descriptor_ptr->offset = in_binding_item.buffer_ptr->get_start_offset(); + out_descriptor_ptr->range = in_binding_item.buffer_ptr->get_size (); } - - *out_result_ptr = static_cast(m_bindings.at(in_n_binding).size() ); - -end: - return result; } -/* Please see header for specification */ -bool Anvil::DescriptorSet::get_binding_descriptor_type(uint32_t in_n_binding, - VkDescriptorType* out_descriptor_type_ptr) const +void Anvil::DescriptorSet::fill_image_info_vk_descriptor(const Anvil::DescriptorSet::BindingItem& in_binding_item, + const bool& in_immutable_samplers_enabled, + VkDescriptorImageInfo* out_descriptor_ptr) const { - bool result = true; - - if (m_bindings.find(in_n_binding) == m_bindings.end() ) + out_descriptor_ptr->imageLayout = in_binding_item.image_layout; + out_descriptor_ptr->imageView = in_binding_item.image_view_ptr->get_image_view(); + + if (false == in_immutable_samplers_enabled && + nullptr != in_binding_item.sampler_ptr) { - anvil_assert(m_bindings.find(in_n_binding) != m_bindings.end() ); - - result = false; - goto end; + out_descriptor_ptr->sampler = in_binding_item.sampler_ptr->get_sampler(); + } + else + { + out_descriptor_ptr->sampler = VK_NULL_HANDLE; } - - *out_descriptor_type_ptr = m_bindings.at(in_n_binding).at(0).type_vk; - -end: - return result; } /* Please see header for specification */ -bool Anvil::DescriptorSet::get_combined_image_sampler_binding_properties(uint32_t in_n_binding, - uint32_t in_n_binding_array_item, - VkImageLayout* out_opt_image_layout_ptr, - std::shared_ptr* out_opt_image_view_ptr, - std::shared_ptr* out_opt_sampler_ptr) +bool Anvil::DescriptorSet::get_combined_image_sampler_binding_properties(uint32_t in_n_binding, + uint32_t in_n_binding_array_item, + VkImageLayout* out_opt_image_layout_ptr, + Anvil::ImageView** out_opt_image_view_ptr_ptr, + Anvil::Sampler** out_opt_sampler_ptr_ptr) { decltype(m_bindings)::const_iterator binding_iterator = m_bindings.find(in_n_binding); bool result = true; @@ -585,14 +412,14 @@ bool Anvil::DescriptorSet::get_combined_image_sampler_binding_properties(uint32_ *out_opt_image_layout_ptr = binding_item_iterator->image_layout; } - if (out_opt_image_view_ptr != nullptr) + if (out_opt_image_view_ptr_ptr != nullptr) { - *out_opt_image_view_ptr = binding_item_iterator->image_view_ptr; + *out_opt_image_view_ptr_ptr= binding_item_iterator->image_view_ptr; } - if (out_opt_sampler_ptr != nullptr) + if (out_opt_sampler_ptr_ptr != nullptr) { - *out_opt_sampler_ptr = binding_item_iterator->sampler_ptr; + *out_opt_sampler_ptr_ptr = binding_item_iterator->sampler_ptr; } } @@ -601,10 +428,10 @@ bool Anvil::DescriptorSet::get_combined_image_sampler_binding_properties(uint32_ } /* Please see header for specification */ -bool Anvil::DescriptorSet::get_input_attachment_binding_properties(uint32_t in_n_binding, - uint32_t in_n_binding_array_item, - VkImageLayout* out_opt_image_layout_ptr, - std::shared_ptr* out_opt_image_view_ptr) const +bool Anvil::DescriptorSet::get_input_attachment_binding_properties(uint32_t in_n_binding, + uint32_t in_n_binding_array_item, + VkImageLayout* out_opt_image_layout_ptr, + Anvil::ImageView** out_opt_image_view_ptr_ptr) const { decltype(m_bindings)::const_iterator binding_iterator = m_bindings.find(in_n_binding); bool result = true; @@ -633,9 +460,9 @@ bool Anvil::DescriptorSet::get_input_attachment_binding_properties(uint32_t *out_opt_image_layout_ptr = binding_item_iterator->image_layout; } - if (out_opt_image_view_ptr != nullptr) + if (out_opt_image_view_ptr_ptr != nullptr) { - *out_opt_image_view_ptr = binding_item_iterator->image_view_ptr; + *out_opt_image_view_ptr_ptr = binding_item_iterator->image_view_ptr; } } @@ -644,9 +471,9 @@ bool Anvil::DescriptorSet::get_input_attachment_binding_properties(uint32_t } /* Please see header for specification */ -bool Anvil::DescriptorSet::get_sampler_binding_properties(uint32_t in_n_binding, - uint32_t in_n_binding_array_item, - std::shared_ptr* out_sampler_ptr) const +bool Anvil::DescriptorSet::get_sampler_binding_properties(uint32_t in_n_binding, + uint32_t in_n_binding_array_item, + Anvil::Sampler** out_sampler_ptr_ptr) const { decltype(m_bindings)::const_iterator binding_iterator = m_bindings.find(in_n_binding); bool result = true; @@ -670,9 +497,9 @@ bool Anvil::DescriptorSet::get_sampler_binding_properties(uint32_t { auto binding_item_iterator = binding_iterator->second.begin() + in_n_binding_array_item; - if (out_sampler_ptr != nullptr) + if (out_sampler_ptr_ptr != nullptr) { - *out_sampler_ptr = binding_item_iterator->sampler_ptr; + *out_sampler_ptr_ptr = binding_item_iterator->sampler_ptr; } } @@ -681,11 +508,11 @@ bool Anvil::DescriptorSet::get_sampler_binding_properties(uint32_t } /* Please see header for specification */ -bool Anvil::DescriptorSet::get_storage_buffer_binding_properties(uint32_t in_n_binding, - uint32_t in_n_binding_array_item, - std::shared_ptr* out_opt_buffer_ptr, - VkDeviceSize* out_opt_size_ptr, - VkDeviceSize* out_opt_start_offset_ptr) const +bool Anvil::DescriptorSet::get_storage_buffer_binding_properties(uint32_t in_n_binding, + uint32_t in_n_binding_array_item, + Anvil::Buffer** out_opt_buffer_ptr_ptr, + VkDeviceSize* out_opt_size_ptr, + VkDeviceSize* out_opt_start_offset_ptr) const { decltype(m_bindings)::const_iterator binding_iterator = m_bindings.find(in_n_binding); bool result = true; @@ -709,9 +536,9 @@ bool Anvil::DescriptorSet::get_storage_buffer_binding_properties(uint32_t { auto binding_item_iterator = binding_iterator->second.begin() + in_n_binding_array_item; - if (out_opt_buffer_ptr != nullptr) + if (out_opt_buffer_ptr_ptr != nullptr) { - *out_opt_buffer_ptr = binding_item_iterator->buffer_ptr; + *out_opt_buffer_ptr_ptr = binding_item_iterator->buffer_ptr; } if (out_opt_size_ptr != nullptr) @@ -730,9 +557,9 @@ bool Anvil::DescriptorSet::get_storage_buffer_binding_properties(uint32_t } /* Please see header for specification */ -bool Anvil::DescriptorSet::get_storage_texel_buffer_binding_properties(uint32_t in_n_binding, - uint32_t in_n_binding_array_item, - std::shared_ptr* out_opt_buffer_view_ptr) const +bool Anvil::DescriptorSet::get_storage_texel_buffer_binding_properties(uint32_t in_n_binding, + uint32_t in_n_binding_array_item, + Anvil::BufferView** out_opt_buffer_view_ptr_ptr) const { decltype(m_bindings)::const_iterator binding_iterator = m_bindings.find(in_n_binding); bool result = true; @@ -756,9 +583,9 @@ bool Anvil::DescriptorSet::get_storage_texel_buffer_binding_properties(uint32_t { auto binding_item_iterator = binding_iterator->second.begin() + in_n_binding_array_item; - if (out_opt_buffer_view_ptr != nullptr) + if (out_opt_buffer_view_ptr_ptr != nullptr) { - *out_opt_buffer_view_ptr = binding_item_iterator->buffer_view_ptr; + *out_opt_buffer_view_ptr_ptr = binding_item_iterator->buffer_view_ptr; } } @@ -773,21 +600,353 @@ bool Anvil::DescriptorSet::get_storage_texel_buffer_binding_properties(uint32_t **/ void Anvil::DescriptorSet::on_parent_pool_reset() { - /* This descriptor set instance is no longer usable. - * - * To restore functionality, a new Vulkan DS handle should be assigned to this instance - * by calling set_new_vk_handle() */ + /* This descriptor set instance is no longer usable. */ m_descriptor_set = VK_NULL_HANDLE; m_unusable = true; } -/** Please see header for specification */ -void Anvil::DescriptorSet::set_new_vk_handle(VkDescriptorSet in_ds) +bool Anvil::DescriptorSet::update(const DescriptorSetUpdateMethod& in_update_method) const { - anvil_assert(m_unusable); - anvil_assert(in_ds != VK_NULL_HANDLE); + bool result; + + lock(); + { + switch (in_update_method) + { + case Anvil::DESCRIPTOR_SET_UPDATE_METHOD_CORE: + { + result = update_using_core_method(); + + break; + } + + case Anvil::DESCRIPTOR_SET_UPDATE_METHOD_TEMPLATE: + { + result = update_using_template_method(); - m_descriptor_set = in_ds; - m_dirty = true; - m_unusable = false; + break; + } + + default: + { + anvil_assert_fail(); + + result = false; + } + } + } + unlock(); + + return result; +} + +/* Please see header for specification */ +bool Anvil::DescriptorSet::update_using_core_method() const +{ + const auto layout_info_ptr = m_layout_ptr->get_info(); + bool result = false; + + anvil_assert(!m_unusable); + + if (m_dirty) + { + uint32_t cached_ds_buffer_info_items_array_offset = 0; + uint32_t cached_ds_image_info_items_array_offset = 0; + uint32_t cached_ds_texel_buffer_info_items_array_offset = 0; + const uint32_t n_bindings = static_cast(m_bindings.size() ); + uint32_t n_max_ds_info_items_to_cache = 0; + + m_cached_ds_info_buffer_info_items_vk.clear(); + m_cached_ds_info_image_info_items_vk.clear(); + m_cached_ds_info_texel_buffer_info_items_vk.clear(); + m_cached_ds_write_items_vk.clear(); + + for (auto& binding : m_bindings) + { + const uint32_t n_current_binding_items = static_cast(binding.second.size() ); + + n_max_ds_info_items_to_cache += n_current_binding_items; + } + + m_cached_ds_info_buffer_info_items_vk.reserve (n_max_ds_info_items_to_cache); + m_cached_ds_info_image_info_items_vk.reserve (n_max_ds_info_items_to_cache); + m_cached_ds_info_texel_buffer_info_items_vk.reserve(n_max_ds_info_items_to_cache); + + for (uint32_t n_binding = 0; + n_binding < n_bindings; + ++n_binding) + { + uint32_t current_binding_index; + VkDescriptorType descriptor_type; + bool immutable_samplers_enabled = false; + const uint32_t start_ds_buffer_info_items_array_offset = cached_ds_buffer_info_items_array_offset; + const uint32_t start_ds_image_info_items_array_offset = cached_ds_image_info_items_array_offset; + const uint32_t start_ds_texel_buffer_info_items_array_offset = cached_ds_texel_buffer_info_items_array_offset; + VkWriteDescriptorSet write_ds_vk; + + if (!layout_info_ptr->get_binding_properties_by_index_number(n_binding, + ¤t_binding_index, + &descriptor_type, + nullptr, /* out_opt_descriptor_array_size_ptr */ + nullptr, /* out_opt_stage_flags_ptr */ + &immutable_samplers_enabled) ) + { + anvil_assert_fail(); + } + + /* For each array item, initialize a descriptor info item.. */ + const BindingItems& current_binding_items = m_bindings.at(current_binding_index); + const uint32_t n_current_binding_items = static_cast(current_binding_items.size() ); + + for (uint32_t n_current_binding_item = 0; + n_current_binding_item < n_current_binding_items; + ++n_current_binding_item) + { + const BindingItem& current_binding_item = current_binding_items.at(n_current_binding_item); + + if (!current_binding_item.dirty) + { + continue; + } + + if (current_binding_item.buffer_ptr != nullptr) + { + VkDescriptorBufferInfo buffer_info; + + fill_buffer_info_vk_descriptor(current_binding_item, + &buffer_info); + + m_cached_ds_info_buffer_info_items_vk.push_back(buffer_info); + + ++cached_ds_buffer_info_items_array_offset; + } + else + if (current_binding_item.buffer_view_ptr != nullptr) + { + m_cached_ds_info_texel_buffer_info_items_vk.push_back( current_binding_item.buffer_view_ptr->get_buffer_view() ); + + ++cached_ds_texel_buffer_info_items_array_offset; + } + else + if (current_binding_item.image_view_ptr != nullptr) + { + VkDescriptorImageInfo image_info; + + fill_image_info_vk_descriptor(current_binding_item, + immutable_samplers_enabled, + &image_info); + + m_cached_ds_info_image_info_items_vk.push_back(image_info); + + ++cached_ds_image_info_items_array_offset; + } + else + { + anvil_assert_fail(); + + goto end; + } + } + + /* We can finally fill the write descriptor */ + if (current_binding_items.size() > 0) + { + write_ds_vk.descriptorCount = static_cast(current_binding_items.size() ); + write_ds_vk.descriptorType = descriptor_type; + write_ds_vk.dstArrayElement = 0; + write_ds_vk.dstBinding = current_binding_index; + write_ds_vk.dstSet = m_descriptor_set; + write_ds_vk.pBufferInfo = (start_ds_buffer_info_items_array_offset != cached_ds_buffer_info_items_array_offset) ? &m_cached_ds_info_buffer_info_items_vk[start_ds_buffer_info_items_array_offset] + : nullptr; + write_ds_vk.pImageInfo = (start_ds_image_info_items_array_offset != cached_ds_image_info_items_array_offset) ? &m_cached_ds_info_image_info_items_vk[start_ds_image_info_items_array_offset] + : nullptr; + write_ds_vk.pNext = nullptr; + write_ds_vk.pTexelBufferView = (start_ds_texel_buffer_info_items_array_offset != cached_ds_texel_buffer_info_items_array_offset) ? &m_cached_ds_info_texel_buffer_info_items_vk[start_ds_texel_buffer_info_items_array_offset] + : nullptr; + write_ds_vk.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; + + m_cached_ds_write_items_vk.push_back(write_ds_vk); + } + } + + /* Issue the Vulkan call */ + if (m_cached_ds_write_items_vk.size() > 0) + { + vkUpdateDescriptorSets(m_device_ptr->get_device_vk(), + static_cast(m_cached_ds_write_items_vk.size() ), + &m_cached_ds_write_items_vk[0], + 0, /* copyCount */ + nullptr); /* pDescriptorCopies */ + } + + m_dirty = false; + } + + result = true; + +end: + + return result; +} + +bool Anvil::DescriptorSet::update_using_template_method() const +{ + std::vector data_vector; + const auto layout_info_ptr = m_layout_ptr->get_info(); + bool result = false; + + if (!m_device_ptr->is_khr_descriptor_update_template_extension_enabled() ) + { + anvil_assert(m_device_ptr->is_khr_descriptor_update_template_extension_enabled() ); + + goto end; + } + + anvil_assert(!m_unusable); + + if (m_dirty) + { + /* First build up a vector of template entries we need the template to encapsulate. While on it, + * also construct an array of descriptors we're going to pass along the template. + */ + const uint32_t n_bindings = static_cast(m_bindings.size() ); + decltype(m_template_object_map)::const_iterator template_object_iterator; + + m_template_entries.clear (); + m_template_raw_data.clear(); + + for (uint32_t n_binding = 0; + n_binding < n_bindings; + ++n_binding) + { + const std::vector* binding_element_vec_ptr = nullptr; + uint32_t current_binding_index = UINT32_MAX; + VkDescriptorType descriptor_type; + bool immutable_samplers_enabled = false; + uint32_t n_binding_elements = 0; + + if (!layout_info_ptr->get_binding_properties_by_index_number(n_binding, + ¤t_binding_index, + &descriptor_type, + nullptr, /* out_opt_descriptor_array_size_ptr */ + nullptr, /* out_opt_stage_flags_ptr */ + &immutable_samplers_enabled) ) + { + anvil_assert_fail(); + + result = false; + goto end; + } + + binding_element_vec_ptr = &m_bindings.at(current_binding_index); + n_binding_elements = static_cast(binding_element_vec_ptr->size() ); + + for (uint32_t n_binding_element = 0; + n_binding_element < n_binding_elements; + ++n_binding_element) + { + const auto& current_binding_element = binding_element_vec_ptr->at(n_binding_element); + const uint32_t current_template_raw_data_size = static_cast(m_template_raw_data.size() ); + + if (!current_binding_element.dirty) + { + continue; + } + + /* Append the new descriptor to the raw data vector. + * + * TODO: Consecutive dirty binding elements could be merged into a single item here. + */ + if (current_binding_element.buffer_ptr != nullptr) + { + m_template_raw_data.resize(current_template_raw_data_size + sizeof(VkDescriptorBufferInfo) ); + + fill_buffer_info_vk_descriptor(current_binding_element, + reinterpret_cast(&m_template_raw_data.at(current_template_raw_data_size) )); + } + else + if (current_binding_element.buffer_view_ptr != nullptr) + { + m_template_raw_data.resize(current_template_raw_data_size + sizeof(VkBufferView) ); + + *reinterpret_cast(&m_template_raw_data.at(current_template_raw_data_size) ) = current_binding_element.buffer_view_ptr->get_buffer_view(); + } + else + if (current_binding_element.image_view_ptr != nullptr) + { + m_template_raw_data.resize(current_template_raw_data_size + sizeof(VkDescriptorImageInfo) ); + + fill_image_info_vk_descriptor(current_binding_element, + immutable_samplers_enabled, + reinterpret_cast(&m_template_raw_data.at(current_template_raw_data_size) )); + } + else + { + anvil_assert_fail(); + + result = false; + goto end; + } + + m_template_entries.push_back( + DescriptorUpdateTemplateEntry(descriptor_type, + n_binding_element, + current_binding_index, + 1, /* in_n_descriptors */ + current_template_raw_data_size, + 0) /* in_stride */ + ); + } + } + + if (m_template_entries.size() == 0) + { + goto end; + } + else + { + anvil_assert(m_template_raw_data.size() > 0); + } + + /* Has a template object matching our needs already been created in the past? */ + template_object_iterator = m_template_object_map.find(m_template_entries); + + if (template_object_iterator == m_template_object_map.end() ) + { + /* Need to create a new template object.. */ + m_template_object_map[m_template_entries] = std::move( + Anvil::DescriptorUpdateTemplate::create_for_descriptor_set_updates(m_device_ptr, + m_layout_ptr, + m_template_entries, + Anvil::MT_SAFETY_DISABLED) ); + + /* Update the iterator */ + template_object_iterator = m_template_object_map.find(m_template_entries); + anvil_assert(template_object_iterator != m_template_object_map.end() ); + + if (template_object_iterator->second == nullptr) + { + anvil_assert(template_object_iterator->second != nullptr); + + result = false; + goto end; + } + } + + /* Issue the Vulkan call. + * + * NOTE: The order MUST be reversed, since update_descriptor_set() calls DescriptorSet::get_descriptor_set_vk() which would invoke update() + * had m_dirty been set to true. + */ + m_dirty = false; + + template_object_iterator->second->update_descriptor_set(this, + &m_template_raw_data.at(0) ); + } + + result = true; + +end: + + return result; } \ No newline at end of file diff --git a/src/wrappers/descriptor_set_group.cpp b/src/wrappers/descriptor_set_group.cpp index e9b19956..ee45d64f 100644 --- a/src/wrappers/descriptor_set_group.cpp +++ b/src/wrappers/descriptor_set_group.cpp @@ -26,24 +26,32 @@ #include "wrappers/descriptor_set.h" #include "wrappers/descriptor_set_group.h" #include "wrappers/descriptor_set_layout.h" +#include "wrappers/descriptor_set_layout_manager.h" +#include "wrappers/device.h" #include "wrappers/pipeline_layout.h" #include /* Please see header for specification */ -Anvil::DescriptorSetGroup::DescriptorSetGroup(std::weak_ptr in_device_ptr, - std::vector > in_ds_info_ptrs, - bool in_releaseable_sets, - MTSafety in_mt_safety, - const std::vector& in_opt_overhead_allocations) +Anvil::DescriptorSetGroup::DescriptorSetGroup(const Anvil::BaseDevice* in_device_ptr, + std::vector in_ds_info_ptrs, + bool in_releaseable_sets, + MTSafety in_mt_safety, + const std::vector& in_opt_overhead_allocations) :MTSafetySupportProvider(Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, in_device_ptr) ), m_device_ptr (in_device_ptr), - m_ds_info_ptrs (std::move(in_ds_info_ptrs) ), + m_n_unique_dses (0), + m_parent_dsg_ptr (nullptr), m_releaseable_sets (in_releaseable_sets) { + auto ds_layout_manager_ptr = m_device_ptr->get_descriptor_set_layout_manager(); + memset(m_overhead_allocations, 0, sizeof(m_overhead_allocations) ); + memset(m_pool_size_per_descriptor_type, + 0, + sizeof(m_pool_size_per_descriptor_type) ); for (const auto& overhead_alloc : in_opt_overhead_allocations) { @@ -51,47 +59,65 @@ Anvil::DescriptorSetGroup::DescriptorSetGroup(std::weak_ptr } /* Initialize descriptor pool */ - uint32_t n_unique_dses = 0; + m_n_unique_dses = static_cast(in_ds_info_ptrs.size() ); for (uint32_t n_layout_info_ptr = 0; - n_layout_info_ptr < static_cast(m_ds_info_ptrs.size() ); + n_layout_info_ptr < static_cast(in_ds_info_ptrs.size() ); ++n_layout_info_ptr) { - auto& current_layout_info_ptr = m_ds_info_ptrs.at(n_layout_info_ptr); + auto& current_layout_info_ptr = in_ds_info_ptrs.at(n_layout_info_ptr); - if (current_layout_info_ptr == nullptr) + m_descriptor_sets[n_layout_info_ptr].reset( + new DescriptorSetInfoContainer() + ); + + if (current_layout_info_ptr != nullptr) { - continue; + if (ds_layout_manager_ptr != nullptr) + { + ds_layout_manager_ptr->get_layout(current_layout_info_ptr.get(), + &m_descriptor_sets.at(n_layout_info_ptr)->layout_ptr); + + anvil_assert(m_descriptor_sets.at(n_layout_info_ptr)->layout_ptr != nullptr); + } + else + { + /* Required at device bring-up time. */ + m_descriptor_sets.at(n_layout_info_ptr)->layout_ptr = Anvil::DescriptorSetLayout::create(std::move(current_layout_info_ptr), + in_device_ptr, + in_mt_safety); + } + + m_ds_info_ptrs.push_back(m_descriptor_sets.at(n_layout_info_ptr)->layout_ptr->get_info() ); + } + else + { + m_ds_info_ptrs.push_back(nullptr); } - - n_unique_dses += (current_layout_info_ptr != nullptr) ? 1 : 0; - m_descriptor_sets[n_layout_info_ptr].layout_ptr = Anvil::DescriptorSetLayout::create(std::move(current_layout_info_ptr), - in_device_ptr, - in_mt_safety); } - m_descriptor_pool_ptr = Anvil::DescriptorPool::create(in_device_ptr, - n_unique_dses, - in_releaseable_sets, - in_mt_safety); - /* Register the object */ Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_DESCRIPTOR_SET_GROUP, this); } /* Please see header for specification */ -Anvil::DescriptorSetGroup::DescriptorSetGroup(std::shared_ptr in_parent_dsg_ptr, - bool in_releaseable_sets) +Anvil::DescriptorSetGroup::DescriptorSetGroup(const DescriptorSetGroup* in_parent_dsg_ptr, + bool in_releaseable_sets) :MTSafetySupportProvider(in_parent_dsg_ptr->is_mt_safe() ), m_device_ptr (in_parent_dsg_ptr->m_device_ptr), m_parent_dsg_ptr (in_parent_dsg_ptr), m_releaseable_sets (in_releaseable_sets) { - anvil_assert(in_parent_dsg_ptr != nullptr); - anvil_assert(in_parent_dsg_ptr->m_parent_dsg_ptr == nullptr); - anvil_assert(in_parent_dsg_ptr->m_descriptor_pool_ptr->are_sets_releaseable() == in_releaseable_sets); + auto descriptor_set_layout_manager_ptr = m_device_ptr->get_descriptor_set_layout_manager(); + anvil_assert( in_parent_dsg_ptr != nullptr); + anvil_assert( in_parent_dsg_ptr->m_parent_dsg_ptr == nullptr); + anvil_assert(((in_parent_dsg_ptr->m_descriptor_pool_ptr->get_flags() & Anvil::DESCRIPTOR_POOL_FLAG_CREATE_FREE_DESCRIPTOR_SET_BIT) > 0) == in_releaseable_sets); + + memcpy(m_pool_size_per_descriptor_type, + in_parent_dsg_ptr->m_pool_size_per_descriptor_type, + sizeof(m_pool_size_per_descriptor_type) ); memset(m_overhead_allocations, 0, sizeof(m_overhead_allocations) ); @@ -100,16 +126,32 @@ Anvil::DescriptorSetGroup::DescriptorSetGroup(std::shared_ptrm_device_ptr, in_parent_dsg_ptr->m_descriptor_pool_ptr->get_n_maximum_sets(), in_releaseable_sets, + m_pool_size_per_descriptor_type, Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() )); /* Configure the new DSG instance to use the specified parent DSG */ - m_descriptor_sets = in_parent_dsg_ptr->m_descriptor_sets; - - for (auto ds : m_descriptor_sets) + for (const auto& ds : in_parent_dsg_ptr->m_descriptor_sets) { - m_descriptor_sets[ds.first].descriptor_set_ptr = nullptr; + m_descriptor_sets[ds.first].reset( + new DescriptorSetInfoContainer() + ); + + if (ds.second->layout_ptr != nullptr) + { + /* NOTE: We must use pipeline layout manager to acquire a clone of the input layout, instead of wrapping + * the raw pointer inside a customized std::unique_ptr. Reason for this is the descriptor set layout manager + * manually reference-counts users of each instantiated layout, and the counter is only bumped at get_layout() + * call time. + */ + descriptor_set_layout_manager_ptr->get_layout(ds.second->layout_ptr->get_info(), + &m_descriptor_sets.at(ds.first)->layout_ptr); + + anvil_assert(m_descriptor_sets.at(ds.first)->layout_ptr.get() == ds.second->layout_ptr.get() ); + } } + m_n_unique_dses = in_parent_dsg_ptr->m_n_unique_dses; + /* Register the object */ Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_DESCRIPTOR_SET_GROUP, this); @@ -124,10 +166,12 @@ Anvil::DescriptorSetGroup::~DescriptorSetGroup() } /** Re-creates internally-maintained descriptor pool. **/ -void Anvil::DescriptorSetGroup::bake_descriptor_pool() +bool Anvil::DescriptorSetGroup::bake_descriptor_pool() { + Anvil::DescriptorPoolFlags flags = ((m_releaseable_sets) ? Anvil::DESCRIPTOR_POOL_FLAG_CREATE_FREE_DESCRIPTOR_SET_BIT : 0); std::unique_lock mutex_lock; - auto mutex_ptr = get_mutex(); + auto mutex_ptr = get_mutex(); + bool result = false; if (mutex_ptr != nullptr) { @@ -148,14 +192,18 @@ void Anvil::DescriptorSetGroup::bake_descriptor_pool() 0, sizeof(n_descriptors_needed_array) ); - for (auto current_ds : m_descriptor_sets) + for (auto& current_ds : m_descriptor_sets) { - auto current_ds_layout_info_ptr = current_ds.second.layout_ptr->get_info(); - uint32_t n_ds_bindings; + const Anvil::DescriptorSetInfo* current_ds_layout_info_ptr = nullptr; + uint32_t n_ds_bindings; - if (current_ds.second.layout_ptr == nullptr) + if (current_ds.second->layout_ptr == nullptr) + { + current_ds_layout_info_ptr = m_device_ptr->get_dummy_descriptor_set_layout()->get_info(); + } + else { - continue; + current_ds_layout_info_ptr = current_ds.second->layout_ptr->get_info(); } n_ds_bindings = static_cast(current_ds_layout_info_ptr->get_n_bindings() ); @@ -167,12 +215,17 @@ void Anvil::DescriptorSetGroup::bake_descriptor_pool() uint32_t ds_binding_array_size; VkDescriptorType ds_binding_type; - current_ds_layout_info_ptr->get_binding_properties(n_ds_binding, - nullptr, /* out_opt_binding_index_ptr */ - &ds_binding_type, - &ds_binding_array_size, - nullptr, /* out_opt_stage_flags_ptr */ - nullptr); /* out_opt_immutable_samplers_enabled_ptr */ + current_ds_layout_info_ptr->get_binding_properties_by_index_number(n_ds_binding, + nullptr, /* out_opt_binding_index_ptr */ + &ds_binding_type, + &ds_binding_array_size, + nullptr, /* out_opt_stage_flags_ptr */ + nullptr);/* out_opt_immutable_samplers_enabled_ptr */ + + if (ds_binding_type > VK_DESCRIPTOR_TYPE_END_RANGE) + { + continue; + } n_descriptors_needed_array[ds_binding_type] += ds_binding_array_size; } @@ -183,26 +236,38 @@ void Anvil::DescriptorSetGroup::bake_descriptor_pool() n_descriptor_type < VK_DESCRIPTOR_TYPE_RANGE_SIZE; ++n_descriptor_type) { - m_descriptor_pool_ptr->set_descriptor_array_size(static_cast(n_descriptor_type), - n_descriptors_needed_array[n_descriptor_type] + m_overhead_allocations[n_descriptor_type]); + m_pool_size_per_descriptor_type[n_descriptor_type] = n_descriptors_needed_array[n_descriptor_type] + m_overhead_allocations[n_descriptor_type]; } - m_descriptor_pool_ptr->bake(); + /* Create the pool */ + m_descriptor_pool_ptr = Anvil::DescriptorPool::create(m_device_ptr, + m_n_unique_dses, + flags, + m_pool_size_per_descriptor_type, + Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() )); + + if (m_descriptor_pool_ptr == nullptr) + { + anvil_assert(m_descriptor_pool_ptr != nullptr); + + goto end; + } + result = true; end: - ; + return result; } /* Please see header for specification */ bool Anvil::DescriptorSetGroup::bake_descriptor_sets() { - std::vector > dses; - std::vector > ds_layouts; - const Anvil::DescriptorSetGroup* layout_vk_owner_ptr = (m_parent_dsg_ptr != nullptr) ? m_parent_dsg_ptr.get() - : this; - std::unique_lock mutex_lock; - auto mutex_ptr = get_mutex(); - bool result = false; + std::vector allocations; + std::vector dses; + const Anvil::DescriptorSetGroup* layout_vk_owner_ptr = (m_parent_dsg_ptr != nullptr) ? m_parent_dsg_ptr + : this; + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + bool result = false; if (mutex_ptr != nullptr) { @@ -215,11 +280,25 @@ bool Anvil::DescriptorSetGroup::bake_descriptor_sets() /* Copy layout descriptors to the helper vector.. */ - const uint32_t n_sets = static_cast(m_descriptor_sets.size() ); + const auto n_sets = static_cast(m_descriptor_sets.size() ); - for (auto ds : layout_vk_owner_ptr->m_descriptor_sets) + for (const auto& ds_data : layout_vk_owner_ptr->m_descriptor_sets) { - ds_layouts.push_back(ds.second.layout_ptr); + const auto set_index = ds_data.first; + const auto& ds_ptr = ds_data.second; + + if (ds_data.second->layout_ptr == nullptr) + { + allocations.push_back( + Anvil::DescriptorSetAllocation(m_device_ptr->get_dummy_descriptor_set_layout() ) + ); + } + else + { + allocations.push_back( + Anvil::DescriptorSetAllocation(ds_ptr->layout_ptr.get() ) + ); + } } /* Reset all previous allocations */ @@ -232,18 +311,18 @@ bool Anvil::DescriptorSetGroup::bake_descriptor_sets() /* Allocate everything from scratch */ result = m_descriptor_pool_ptr->alloc_descriptor_sets(n_sets, - &ds_layouts[0], - &dses [0]); + &allocations.at(0), + &dses.at (0) ); anvil_assert(result); for (uint32_t n_set = 0; n_set < n_sets; ++n_set, ++ds_iterator) { - anvil_assert(dses[n_set] != nullptr); - anvil_assert(ds_iterator->second.descriptor_set_ptr == nullptr); + anvil_assert(dses[n_set] != nullptr); + anvil_assert(ds_iterator->second->descriptor_set_ptr == nullptr); - ds_iterator->second.descriptor_set_ptr = dses[n_set]; + ds_iterator->second->descriptor_set_ptr = std::move(dses.at(n_set) ); } /* All done */ @@ -253,13 +332,14 @@ bool Anvil::DescriptorSetGroup::bake_descriptor_sets() } /* Please see header for specification */ -std::shared_ptr Anvil::DescriptorSetGroup::create(std::weak_ptr in_device_ptr, - std::vector >& in_ds_info_ptrs, - bool in_releaseable_sets, - MTSafety in_mt_safety, - const std::vector& in_opt_overhead_allocations) +Anvil::DescriptorSetGroupUniquePtr Anvil::DescriptorSetGroup::create(const Anvil::BaseDevice* in_device_ptr, + std::vector& in_ds_info_ptrs, + bool in_releaseable_sets, + MTSafety in_mt_safety, + const std::vector& in_opt_overhead_allocations) { - std::shared_ptr result_ptr; + Anvil::DescriptorSetGroupUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::DescriptorSetGroup(in_device_ptr, @@ -283,10 +363,11 @@ std::shared_ptr Anvil::DescriptorSetGroup::create(std } /* Please see header for specification */ -std::shared_ptr Anvil::DescriptorSetGroup::create(std::shared_ptr in_parent_dsg_ptr, - bool in_releaseable_sets) +Anvil::DescriptorSetGroupUniquePtr Anvil::DescriptorSetGroup::create(const Anvil::DescriptorSetGroup* in_parent_dsg_ptr, + bool in_releaseable_sets) { - std::shared_ptr result_ptr; + Anvil::DescriptorSetGroupUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::DescriptorSetGroup(in_parent_dsg_ptr, @@ -307,7 +388,7 @@ std::shared_ptr Anvil::DescriptorSetGroup::create(std } /* Please see header for specification */ -std::shared_ptr Anvil::DescriptorSetGroup::get_descriptor_set(uint32_t in_n_set) const +Anvil::DescriptorSet* Anvil::DescriptorSetGroup::get_descriptor_set(uint32_t in_n_set) { decltype(m_descriptor_sets)::const_iterator ds_iterator; std::unique_lock mutex_lock; @@ -323,11 +404,56 @@ std::shared_ptr Anvil::DescriptorSetGroup::get_descriptor_ ds_iterator = m_descriptor_sets.find(in_n_set); anvil_assert(ds_iterator != m_descriptor_sets.end() ); - return ds_iterator->second.descriptor_set_ptr; + return ds_iterator->second->descriptor_set_ptr.get(); +} + +const std::vector* Anvil::DescriptorSetGroup::get_descriptor_set_info() const +{ + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + const std::vector* result_ptr = nullptr; + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } + + result_ptr = &m_ds_info_ptrs; + + return result_ptr; +} + +/* Please see header for specification */ +const Anvil::DescriptorSetInfo* Anvil::DescriptorSetGroup::get_descriptor_set_info(uint32_t in_n_set) const +{ + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + const Anvil::DescriptorSetInfo* result_ptr = nullptr; + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } + + if (m_ds_info_ptrs.size() < in_n_set) + { + anvil_assert_fail(); + + goto end; + } + + result_ptr = m_ds_info_ptrs.at(in_n_set); + +end: + return result_ptr; } /* Please see header for specification */ -std::shared_ptr Anvil::DescriptorSetGroup::get_descriptor_set_layout(uint32_t in_n_set) const +Anvil::DescriptorSetLayout* Anvil::DescriptorSetGroup::get_descriptor_set_layout(uint32_t in_n_set) const { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -350,36 +476,19 @@ std::shared_ptr Anvil::DescriptorSetGroup::get_descr if (ds_iterator != m_descriptor_sets.end() ) { - anvil_assert(ds_iterator->second.layout_ptr != nullptr) + anvil_assert(ds_iterator->second->layout_ptr != nullptr) - return ds_iterator->second.layout_ptr; + return ds_iterator->second->layout_ptr.get(); } else { return nullptr; } } - -} - -/** Please see header for specification */ -Anvil::DescriptorSetGroup::DescriptorSetInfo::DescriptorSetInfo(const DescriptorSetInfo& in) -{ - descriptor_set_ptr = in.descriptor_set_ptr; - layout_ptr = in.layout_ptr; -} - -/** Please see header for specification */ -Anvil::DescriptorSetGroup::DescriptorSetInfo& Anvil::DescriptorSetGroup::DescriptorSetInfo::operator=(const DescriptorSetInfo& in) -{ - descriptor_set_ptr = in.descriptor_set_ptr; - layout_ptr = in.layout_ptr; - - return *this; } /** Please see header for specification */ -Anvil::DescriptorSetGroup::DescriptorSetInfo::~DescriptorSetInfo() +Anvil::DescriptorSetGroup::DescriptorSetInfoContainer::~DescriptorSetInfoContainer() { /* Stub */ } \ No newline at end of file diff --git a/src/wrappers/descriptor_set_layout.cpp b/src/wrappers/descriptor_set_layout.cpp index 30a6d3f7..a8018786 100644 --- a/src/wrappers/descriptor_set_layout.cpp +++ b/src/wrappers/descriptor_set_layout.cpp @@ -23,14 +23,15 @@ #include "misc/debug.h" #include "misc/descriptor_set_info.h" #include "misc/object_tracker.h" +#include "misc/struct_chainer.h" #include "wrappers/descriptor_set_layout.h" #include "wrappers/device.h" #include "wrappers/sampler.h" /** Please see header for specification */ -Anvil::DescriptorSetLayout::DescriptorSetLayout(std::unique_ptr in_ds_info_ptr, - std::weak_ptr in_device_ptr, - bool in_mt_safe) +Anvil::DescriptorSetLayout::DescriptorSetLayout(Anvil::DescriptorSetInfoUniquePtr in_ds_info_ptr, + const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT), MTSafetySupportProvider (in_mt_safe), @@ -50,11 +51,9 @@ Anvil::DescriptorSetLayout::~DescriptorSetLayout() if (m_layout != VK_NULL_HANDLE) { - std::shared_ptr device_locked_ptr(m_device_ptr); - lock(); { - vkDestroyDescriptorSetLayout(device_locked_ptr->get_device_vk(), + vkDestroyDescriptorSetLayout(m_device_ptr->get_device_vk(), m_layout, nullptr /* pAllocator */); } @@ -65,13 +64,14 @@ Anvil::DescriptorSetLayout::~DescriptorSetLayout() } /** Please see header for specification */ -std::shared_ptr Anvil::DescriptorSetLayout::create(std::unique_ptr in_ds_info_ptr, - std::weak_ptr in_device_ptr, - MTSafety in_mt_safety) +Anvil::DescriptorSetLayoutUniquePtr Anvil::DescriptorSetLayout::create(Anvil::DescriptorSetInfoUniquePtr in_ds_info_ptr, + const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety) { - const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - std::shared_ptr result_ptr; + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); + DescriptorSetLayoutUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::DescriptorSetLayout(std::move(in_ds_info_ptr), @@ -90,112 +90,57 @@ std::shared_ptr Anvil::DescriptorSetLayout::create(s return result_ptr; } -/** Please see header for specification */ -bool Anvil::DescriptorSetLayout::init() +bool Anvil::DescriptorSetLayout::meets_max_per_set_descriptors_limit(const DescriptorSetLayoutCreateInfoContainer* in_ds_create_info_ptr, + const Anvil::BaseDevice* in_device_ptr) { - std::vector binding_info_items; - VkDescriptorSetLayoutCreateInfo create_info; - std::shared_ptr device_locked_ptr(m_device_ptr); - uint32_t n_binding = 0; - uint32_t n_bindings_defined = 0; - uint32_t n_samplers_defined = 0; - bool result = false; - VkResult result_vk; - std::vector sampler_items; - - anvil_assert(m_layout == VK_NULL_HANDLE); + const Anvil::ExtensionKHRMaintenance3Entrypoints* entrypoints_ptr = nullptr; + VkDescriptorSetLayoutSupportKHR query; + bool result = false; - /* Count the number of immutable samplers defined. This is needed because if sampler_items is reallocated - * after we start building the VkSampler array contents, all previously initialized VkDescriptorSetLayoutBinding - * instances will start referring to invalid sampler arrays. */ - for (auto binding_iterator = m_info_ptr->m_bindings.begin(); - binding_iterator != m_info_ptr->m_bindings.end(); - ++binding_iterator) + if (!in_device_ptr->is_khr_maintenance3_extension_enabled() ) { - const auto& binding_data = binding_iterator->second; - - n_samplers_defined += static_cast(binding_data.immutable_samplers.size() ); - } - - sampler_items.reserve(n_samplers_defined); + anvil_assert(in_device_ptr->is_khr_maintenance3_extension_enabled()); - /* Determine the number of non-dummy bindings. */ - if (m_info_ptr->m_bindings.size() > 1) - { - n_bindings_defined = static_cast(m_info_ptr->m_bindings.size() ); + goto end; } else - for (auto binding : m_info_ptr->m_bindings) { - if (binding.second.descriptor_array_size > 0) - { - ++n_bindings_defined; - } + entrypoints_ptr = &in_device_ptr->get_extension_khr_maintenance3_entrypoints(); } - /* Convert internal representation to Vulkan structure(s) */ - binding_info_items.resize(n_bindings_defined); + query.pNext = nullptr; + query.sType = static_cast(VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT_KHR); + query.supported = VK_FALSE; - create_info.bindingCount = n_bindings_defined; - create_info.flags = 0; - create_info.pNext = nullptr; - create_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO; + entrypoints_ptr->vkGetDescriptorSetLayoutSupportKHR(in_device_ptr->get_device_vk(), + in_ds_create_info_ptr->struct_chain_ptr->get_root_struct(), + &query); - if (n_bindings_defined > 0) - { - for (auto binding_iterator = m_info_ptr->m_bindings.begin(); - binding_iterator != m_info_ptr->m_bindings.end(); - ++binding_iterator, ++n_binding) - { - const auto& binding_data = binding_iterator->second; - const BindingIndex& binding_index = binding_iterator->first; - VkDescriptorSetLayoutBinding& binding_vk = binding_info_items[n_binding]; - - if (binding_data.descriptor_array_size == 0) - { - /* Dummy binding, ignore. */ - continue; - } - - binding_vk.binding = binding_index; - binding_vk.descriptorCount = binding_data.descriptor_array_size; - binding_vk.descriptorType = binding_data.descriptor_type; - binding_vk.stageFlags = binding_data.stage_flags; - - if (binding_data.immutable_samplers.size() > 0) - { - const uint32_t sampler_array_start_index = static_cast(sampler_items.size() ); - - anvil_assert(binding_data.immutable_samplers.size() == binding_data.descriptor_array_size); - - for (uint32_t n_sampler = 0; - n_sampler < binding_data.descriptor_array_size; - ++n_sampler) - { - sampler_items.push_back(binding_data.immutable_samplers[n_sampler]->get_sampler() ); - } - - binding_vk.pImmutableSamplers = &sampler_items[sampler_array_start_index]; - } - else - { - binding_vk.pImmutableSamplers = nullptr; - } - } - } + result = (query.supported == VK_TRUE); +end: + return result; +} - if (binding_info_items.size() > 0) - { - create_info.pBindings = &binding_info_items.at(0); - } - else +/** Please see header for specification */ +bool Anvil::DescriptorSetLayout::init() +{ + bool result = false; + VkResult result_vk; + + anvil_assert(m_layout == VK_NULL_HANDLE); + + /* Bake the Vulkan object */ + auto create_info_ptr = m_info_ptr->create_descriptor_set_layout_create_info(m_device_ptr); + + if (create_info_ptr == nullptr) { - create_info.pBindings = nullptr; + anvil_assert(create_info_ptr != nullptr); + + goto end; } - /* Bake the Vulkan object */ - result_vk = vkCreateDescriptorSetLayout(device_locked_ptr->get_device_vk(), - &create_info, + result_vk = vkCreateDescriptorSetLayout(m_device_ptr->get_device_vk(), + create_info_ptr->struct_chain_ptr->get_root_struct(), nullptr, /* pAllocator */ &m_layout); @@ -206,5 +151,7 @@ bool Anvil::DescriptorSetLayout::init() } result = is_vk_call_successful(result_vk); + +end: return result; } diff --git a/src/wrappers/descriptor_set_layout_manager.cpp b/src/wrappers/descriptor_set_layout_manager.cpp new file mode 100644 index 00000000..3ca8e27d --- /dev/null +++ b/src/wrappers/descriptor_set_layout_manager.cpp @@ -0,0 +1,171 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#include "misc/debug.h" +#include "misc/descriptor_set_info.h" +#include "misc/object_tracker.h" +#include "wrappers/descriptor_set_layout.h" +#include "wrappers/descriptor_set_layout_manager.h" +#include + + +/** Constructor. */ +Anvil::DescriptorSetLayoutManager::DescriptorSetLayoutManager(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe) + :MTSafetySupportProvider(in_mt_safe), + m_device_ptr (in_device_ptr) +{ + /* Register the object */ + Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_MANAGER, + this); +} + +/** Destructor */ +Anvil::DescriptorSetLayoutManager::~DescriptorSetLayoutManager() +{ + anvil_assert(m_descriptor_set_layouts.size() == 0); + + /* Unregister the object */ + Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_MANAGER, + this); +} + +/* Please see header for specification */ +Anvil::DescriptorSetLayoutManagerUniquePtr Anvil::DescriptorSetLayoutManager::create(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe) +{ + DescriptorSetLayoutManagerUniquePtr result_ptr(nullptr, + std::default_delete() ); + + result_ptr.reset( + new Anvil::DescriptorSetLayoutManager(in_device_ptr, + in_mt_safe) + ); + + anvil_assert(result_ptr != nullptr); + return result_ptr; +} + +/* Please see header for specification */ +bool Anvil::DescriptorSetLayoutManager::get_layout(const DescriptorSetInfo* in_ds_info_ptr, + Anvil::DescriptorSetLayoutUniquePtr* out_ds_layout_ptr_ptr) +{ + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + bool result = false; + Anvil::DescriptorSetLayout* result_ds_layout_ptr = nullptr; + + anvil_assert(in_ds_info_ptr != nullptr); + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } + + for (auto layout_iterator = m_descriptor_set_layouts.begin(); + layout_iterator != m_descriptor_set_layouts.end(); + ++layout_iterator) + { + auto& current_ds_layout_container_ptr = *layout_iterator; + auto& current_ds_layout_ptr = current_ds_layout_container_ptr->ds_layout_ptr; + auto current_ds_info_ptr = current_ds_layout_ptr->get_info(); + + if (*in_ds_info_ptr == *current_ds_info_ptr) + { + result = true; + result_ds_layout_ptr = current_ds_layout_ptr.get(); + + current_ds_layout_container_ptr->n_references.fetch_add(1); + + break; + } + } + + if (!result) + { + auto ds_info_clone_ptr = DescriptorSetInfoUniquePtr (new DescriptorSetInfo(*in_ds_info_ptr), + std::default_delete() ); + auto new_ds_layout_ptr = Anvil::DescriptorSetLayout::create (std::move(ds_info_clone_ptr), + m_device_ptr, + Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() )); + auto new_ds_layout_container_ptr = std::unique_ptr(new DescriptorSetLayoutContainer() ); + + result = true; + result_ds_layout_ptr = new_ds_layout_ptr.get(); + new_ds_layout_container_ptr->ds_layout_ptr = std::move(new_ds_layout_ptr); + + m_descriptor_set_layouts.push_back( + std::move(new_ds_layout_container_ptr) + ); + } + + if (result) + { + anvil_assert(result_ds_layout_ptr != nullptr); + + *out_ds_layout_ptr_ptr = Anvil::DescriptorSetLayoutUniquePtr(result_ds_layout_ptr, + std::bind(&DescriptorSetLayoutManager::on_descriptor_set_layout_dereferenced, + this, + result_ds_layout_ptr) + ); + } + + return result; +} + +void Anvil::DescriptorSetLayoutManager::on_descriptor_set_layout_dereferenced(Anvil::DescriptorSetLayout* in_layout_ptr) +{ + bool has_found = false; + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + + if (mutex_ptr != nullptr) + { + mutex_lock = std::move( + std::unique_lock(*mutex_ptr) + ); + } + + for (auto layout_iterator = m_descriptor_set_layouts.begin(); + layout_iterator != m_descriptor_set_layouts.end() && !has_found; + ++layout_iterator) + { + auto& current_ds_layout_container_ptr = *layout_iterator; + auto& current_ds_layout_ptr = current_ds_layout_container_ptr->ds_layout_ptr; + + if (current_ds_layout_ptr.get() == in_layout_ptr) + { + has_found = true; + + if (current_ds_layout_container_ptr->n_references.fetch_sub(1) == 1) + { + m_descriptor_set_layouts.erase(layout_iterator); + } + + break; + } + } + + anvil_assert(has_found); +} \ No newline at end of file diff --git a/src/wrappers/descriptor_update_template.cpp b/src/wrappers/descriptor_update_template.cpp new file mode 100644 index 00000000..19926640 --- /dev/null +++ b/src/wrappers/descriptor_update_template.cpp @@ -0,0 +1,238 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#include "misc/debug.h" +#include "misc/descriptor_set_info.h" +#include "misc/object_tracker.h" +#include "wrappers/descriptor_set.h" +#include "wrappers/descriptor_set_layout.h" +#include "wrappers/descriptor_update_template.h" +#include "wrappers/device.h" +#include "wrappers/physical_device.h" + +Anvil::DescriptorUpdateTemplate::DescriptorUpdateTemplate(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe) + :DebugMarkerSupportProvider(in_device_ptr, + VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT), + MTSafetySupportProvider (in_mt_safe), + m_device_ptr (in_device_ptr), + m_vk_object (VK_NULL_HANDLE) +{ + /* Register this instance */ + Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE, + this); + +} + +Anvil::DescriptorUpdateTemplate::~DescriptorUpdateTemplate() +{ + if (m_vk_object != VK_NULL_HANDLE) + { + const auto& entrypoints = m_device_ptr->get_extension_khr_descriptor_update_template_entrypoints(); + + entrypoints.vkDestroyDescriptorUpdateTemplateKHR(m_device_ptr->get_device_vk(), + m_vk_object, + nullptr); /* pAllocator */ + + m_vk_object = VK_NULL_HANDLE; + } + + /* Unregister the object */ + Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE, + this); + +} + +Anvil::DescriptorUpdateTemplateUniquePtr Anvil::DescriptorUpdateTemplate::create_for_descriptor_set_updates(const Anvil::BaseDevice* in_device_ptr, + const Anvil::DescriptorSetLayout* in_descriptor_set_layout_ptr, + const Anvil::DescriptorUpdateTemplateEntry* in_update_entries_ptr, + const uint32_t& in_n_update_entries, + MTSafety in_mt_safety) +{ + DescriptorUpdateTemplateUniquePtr result_ptr(nullptr, + std::default_delete() ); + + result_ptr.reset( + new DescriptorUpdateTemplate(in_device_ptr, + Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ) + ); + + if (result_ptr != nullptr) + { + if (!result_ptr->init(in_descriptor_set_layout_ptr, + in_update_entries_ptr, + in_n_update_entries) ) + { + result_ptr.reset(); + } + } + + return result_ptr; +} + +bool Anvil::DescriptorUpdateTemplate::init(const Anvil::DescriptorSetLayout* in_descriptor_set_layout_ptr, + const Anvil::DescriptorUpdateTemplateEntry* in_update_entries_ptr, + const uint32_t& in_n_update_entries) +{ + const Anvil::ExtensionKHRDescriptorUpdateTemplateEntrypoints* entrypoints_ptr = nullptr; + bool result = true; + + if (!m_device_ptr->is_khr_descriptor_update_template_extension_enabled() ) + { + anvil_assert(m_device_ptr->is_khr_descriptor_update_template_extension_enabled() ); + + result = false; + goto end; + } + + if (in_descriptor_set_layout_ptr == nullptr) + { + anvil_assert(in_descriptor_set_layout_ptr != nullptr); + + result = false; + goto end; + } + + if (in_n_update_entries == 0) + { + anvil_assert(in_n_update_entries != 0); + + result = false; + goto end; + } + + if (in_update_entries_ptr == nullptr) + { + anvil_assert(in_update_entries_ptr != nullptr); + + result = false; + goto end; + } + + entrypoints_ptr = &m_device_ptr->get_extension_khr_descriptor_update_template_entrypoints(); + + if (entrypoints_ptr == nullptr) + { + anvil_assert(entrypoints_ptr != nullptr); + + result = false; + goto end; + } + + { + VkDescriptorUpdateTemplateCreateInfoKHR create_info; + std::vector update_entries(in_n_update_entries); + + for (uint32_t n_update_entry = 0; + n_update_entry < in_n_update_entries; + ++n_update_entry) + { + update_entries.at(n_update_entry) = in_update_entries_ptr[n_update_entry].get_vk_descriptor_update_template_entry_khr(); + } + + create_info.descriptorSetLayout = in_descriptor_set_layout_ptr->get_layout(); + create_info.descriptorUpdateEntryCount = in_n_update_entries; + create_info.flags = 0; + create_info.pDescriptorUpdateEntries = &update_entries.at(0); + create_info.pipelineBindPoint = VK_PIPELINE_BIND_POINT_MAX_ENUM; + create_info.pipelineLayout = VK_NULL_HANDLE; + create_info.pNext = nullptr; + create_info.set = VK_NULL_HANDLE; + create_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR; + create_info.templateType = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR; + + in_descriptor_set_layout_ptr->lock(); + { + result = is_vk_call_successful(entrypoints_ptr->vkCreateDescriptorUpdateTemplateKHR(m_device_ptr->get_device_vk(), + &create_info, + nullptr, /* pAllocator */ + &m_vk_object) ); + } + in_descriptor_set_layout_ptr->unlock(); + } + + if (!result || + m_vk_object == VK_NULL_HANDLE) + { + anvil_assert(result); + anvil_assert(m_vk_object != VK_NULL_HANDLE); + + result = false; + goto end; + } + + /* Finally, also cache descriptor set info using the user-specified DS layout */ + m_ds_info_ptr.reset( + new Anvil::DescriptorSetInfo(*in_descriptor_set_layout_ptr->get_info() ) + ); + + if (m_ds_info_ptr == nullptr) + { + anvil_assert(m_ds_info_ptr != nullptr); + + result = false; + goto end; + } + +end: + return result; +} + +void Anvil::DescriptorUpdateTemplate::update_descriptor_set(const Anvil::DescriptorSet* inout_ds_ptr, + const void* in_data_ptr) const +{ + const auto& entrypoints = m_device_ptr->get_extension_khr_descriptor_update_template_entrypoints(); + + if (in_data_ptr == nullptr) + { + anvil_assert(in_data_ptr != nullptr); + + goto end; + } + + #ifdef _DEBUG + { + if (!(*inout_ds_ptr->get_descriptor_set_layout()->get_info() == *m_ds_info_ptr) ) + { + anvil_assert_fail(); + + goto end; + } + } + #endif + + inout_ds_ptr->lock(); + lock(); + { + entrypoints.vkUpdateDescriptorSetWithTemplateKHR(m_device_ptr->get_device_vk(), + inout_ds_ptr->get_descriptor_set_vk(), + m_vk_object, + in_data_ptr); + } + unlock(); + inout_ds_ptr->unlock(); + +end: + ; +} + diff --git a/src/wrappers/device.cpp b/src/wrappers/device.cpp index c7bc4552..4ae2e55f 100644 --- a/src/wrappers/device.cpp +++ b/src/wrappers/device.cpp @@ -23,11 +23,14 @@ #include "misc/base_pipeline_info.h" #include "misc/debug.h" #include "misc/object_tracker.h" +#include "misc/shader_module_cache.h" +#include "misc/struct_chainer.h" #include "wrappers/command_pool.h" #include "wrappers/compute_pipeline_manager.h" #include "wrappers/descriptor_set.h" #include "wrappers/descriptor_set_group.h" #include "wrappers/descriptor_set_layout.h" +#include "wrappers/descriptor_set_layout_manager.h" #include "wrappers/device.h" #include "wrappers/graphics_pipeline_manager.h" #include "wrappers/instance.h" @@ -40,17 +43,13 @@ /* Please see header for specification */ -Anvil::BaseDevice::BaseDevice(std::weak_ptr in_parent_instance_ptr, - bool in_mt_safe) - :MTSafetySupportProvider (in_mt_safe), - m_destroyed (false), - m_device (VK_NULL_HANDLE), - m_ext_debug_marker_enabled(false), - m_parent_instance_ptr (in_parent_instance_ptr) +Anvil::BaseDevice::BaseDevice(const Anvil::Instance* in_parent_instance_ptr, + bool in_mt_safe) + :MTSafetySupportProvider(in_mt_safe), + m_device (VK_NULL_HANDLE), + m_parent_instance_ptr (in_parent_instance_ptr) { - std::shared_ptr instance_locked_ptr(in_parent_instance_ptr); - - m_khr_surface_extension_entrypoints = instance_locked_ptr->get_extension_khr_surface_entrypoints(); + m_khr_surface_extension_entrypoints = m_parent_instance_ptr->get_extension_khr_surface_entrypoints(); /* Register the instance */ Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_DEVICE, @@ -59,18 +58,28 @@ Anvil::BaseDevice::BaseDevice(std::weak_ptr in_parent_instance_ Anvil::BaseDevice::~BaseDevice() { - anvil_assert(m_destroyed); - /* Unregister the instance. Tihs needs to happen before actual Vulkan object destruction, as there might * be observers who postpone their destruction until the device is about to go down. */ Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_DEVICE, this); - if (m_device != nullptr) + if (m_device != VK_NULL_HANDLE) { wait_idle(); + } + + m_command_pool_ptr_per_vk_queue_fam.clear(); + m_compute_pipeline_manager_ptr.reset (); + m_descriptor_set_layout_manager_ptr.reset(); + m_dummy_dsg_ptr.reset (); + m_graphics_pipeline_manager_ptr.reset (); + m_pipeline_cache_ptr.reset (); + m_pipeline_layout_manager_ptr.reset (); + m_owned_queues.clear (); + if (m_device != VK_NULL_HANDLE) + { lock(); { vkDestroyDevice(m_device, @@ -83,49 +92,13 @@ Anvil::BaseDevice::~BaseDevice() } /** Please see header for specification */ -void Anvil::BaseDevice::destroy() -{ - anvil_assert(!m_destroyed); - - m_destroyed = true; - - for (uint32_t n_command_pool = 0; - n_command_pool < sizeof(m_command_pool_ptrs) / sizeof(m_command_pool_ptrs[0]); - ++n_command_pool) - { - m_command_pool_ptrs[n_command_pool] = nullptr; - } - - m_compute_pipeline_manager_ptr = nullptr; - m_dummy_dsg_ptr = nullptr; - m_graphics_pipeline_manager_ptr = nullptr; - m_pipeline_cache_ptr = nullptr; - m_pipeline_layout_manager_ptr = nullptr; - - /* Proceed with device-specific instances */ - m_queue_fams.clear (); - m_sparse_binding_queues.clear(); - - for (Anvil::QueueFamilyType queue_family_type = Anvil::QUEUE_FAMILY_TYPE_FIRST; - queue_family_type < Anvil::QUEUE_FAMILY_TYPE_COUNT; - queue_family_type = static_cast(queue_family_type + 1)) - { - std::vector >& queues = (queue_family_type == Anvil::QUEUE_FAMILY_TYPE_COMPUTE) ? m_compute_queues - : (queue_family_type == Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL) ? m_universal_queues - : m_transfer_queues; - - queues.clear(); - } -} - -/** Please see header for specification */ -std::shared_ptr Anvil::BaseDevice::get_dummy_descriptor_set() const +const Anvil::DescriptorSet* Anvil::BaseDevice::get_dummy_descriptor_set() const { return m_dummy_dsg_ptr->get_descriptor_set(0); } /** Please see header for specification */ -std::shared_ptr Anvil::BaseDevice::get_dummy_descriptor_set_layout() const +Anvil::DescriptorSetLayout* Anvil::BaseDevice::get_dummy_descriptor_set_layout() const { return m_dummy_dsg_ptr->get_descriptor_set_layout(0); } @@ -133,10 +106,10 @@ std::shared_ptr Anvil::BaseDevice::get_dummy_descrip /** Please see header for specification */ uint32_t Anvil::BaseDevice::get_n_queues(uint32_t in_n_queue_family) const { - auto map_iterator = m_queue_fams.find(in_n_queue_family); + auto map_iterator = m_queue_ptrs_per_vk_queue_fam.find(in_n_queue_family); uint32_t result = 0; - if (map_iterator != m_queue_fams.end()) + if (map_iterator != m_queue_ptrs_per_vk_queue_fam.end()) { result = static_cast(map_iterator->second.size() ); } @@ -144,18 +117,21 @@ uint32_t Anvil::BaseDevice::get_n_queues(uint32_t in_n_queue_family) const return result; } -/** Please see header for specification */ -std::shared_ptr Anvil::BaseDevice::get_queue(uint32_t in_n_queue_family, - uint32_t in_n_queue) const +/* Please see header for specification */ +Anvil::Queue* Anvil::BaseDevice::get_queue(const Anvil::QueueFamilyType& in_queue_family_type, + uint32_t in_n_queue) const { - auto map_iterator = m_queue_fams.find(in_n_queue_family); - std::shared_ptr result_ptr; + Anvil::Queue* result_ptr = nullptr; - if (map_iterator != m_queue_fams.end()) + switch (in_queue_family_type) { - if (map_iterator->second.size() > in_n_queue) + case Anvil::QueueFamilyType::COMPUTE: result_ptr = get_compute_queue (in_n_queue); break; + case Anvil::QueueFamilyType::TRANSFER: result_ptr = get_transfer_queue (in_n_queue); break; + case Anvil::QueueFamilyType::UNIVERSAL: result_ptr = get_universal_queue(in_n_queue); break; + + default: { - result_ptr = map_iterator->second.at(in_n_queue); + anvil_assert_fail(); } } @@ -163,101 +139,153 @@ std::shared_ptr Anvil::BaseDevice::get_queue(uint32_t in_n_queue_f } /* Please see header for specification */ -void Anvil::BaseDevice::get_queue_family_indices_for_physical_device(std::weak_ptr in_physical_device_ptr, - DeviceQueueFamilyInfo* out_device_queue_family_info_ptr) const +void Anvil::BaseDevice::get_queue_family_indices_for_physical_device(const Anvil::PhysicalDevice* in_physical_device_ptr, + DeviceQueueFamilyInfo* out_device_queue_family_info_ptr) const { - std::shared_ptr physical_device_locked_ptr(in_physical_device_ptr); - - /* Retrieve a compute-only queue, and then look for another queue which can handle graphics tasks. */ - const size_t n_queue_families = physical_device_locked_ptr->get_queue_families().size(); - uint32_t result_compute_queue_family_index = UINT32_MAX; - uint32_t result_dma_queue_family_index = UINT32_MAX; - uint32_t result_n_compute_queues = 0; - uint32_t result_n_dma_queues = 0; - uint32_t result_n_universal_queues = 0; - uint32_t result_universal_queue_family_index = UINT32_MAX; - + const auto n_queue_families = static_cast(in_physical_device_ptr->get_queue_families().size() ); + std::vector result_compute_queue_families; + std::vector result_transfer_queue_families; + std::vector result_universal_queue_families; + for (uint32_t n_iteration = 0; n_iteration < 3; ++n_iteration) { - for (size_t n_queue_family_index = 0; - n_queue_family_index < n_queue_families; - ++n_queue_family_index) + for (uint32_t n_queue_family_index = 0; + n_queue_family_index < n_queue_families; + ++n_queue_family_index) { - const Anvil::QueueFamilyInfo& current_queue_family = physical_device_locked_ptr->get_queue_families()[n_queue_family_index]; + const Anvil::QueueFamilyInfo& current_queue_family = in_physical_device_ptr->get_queue_families()[n_queue_family_index]; if (n_iteration == 0) { if ( (current_queue_family.flags & VK_QUEUE_COMPUTE_BIT) && !(current_queue_family.flags & VK_QUEUE_GRAPHICS_BIT) ) { - result_compute_queue_family_index = (uint32_t) n_queue_family_index; - result_n_compute_queues = current_queue_family.n_queues; - - break; + result_compute_queue_families.push_back( + DeviceQueueFamilyMemberInfo(n_queue_family_index, + current_queue_family.n_queues) + ); } } else if (n_iteration == 1) { - if (current_queue_family.flags & VK_QUEUE_GRAPHICS_BIT && - n_queue_family_index != result_compute_queue_family_index) + if (current_queue_family.flags & VK_QUEUE_GRAPHICS_BIT) { - result_universal_queue_family_index = (uint32_t) n_queue_family_index; - result_n_universal_queues = current_queue_family.n_queues; - - break; + if (std::find(result_compute_queue_families.begin(), + result_compute_queue_families.end (), + n_queue_family_index) == result_compute_queue_families.end() ) + { + result_universal_queue_families.push_back( + DeviceQueueFamilyMemberInfo(n_queue_family_index, + current_queue_family.n_queues) + ); + } } } else if (n_iteration == 2) { - if (current_queue_family.flags & VK_QUEUE_TRANSFER_BIT && - n_queue_family_index != result_compute_queue_family_index && - n_queue_family_index != result_universal_queue_family_index) + if (current_queue_family.flags & VK_QUEUE_TRANSFER_BIT) { - result_dma_queue_family_index = (uint32_t) n_queue_family_index; - result_n_dma_queues = current_queue_family.n_queues; - - break; + if (std::find(result_compute_queue_families.begin(), + result_compute_queue_families.end (), + n_queue_family_index) == result_compute_queue_families.end() && + std::find(result_universal_queue_families.begin(), + result_universal_queue_families.end (), + n_queue_family_index) == result_universal_queue_families.end() ) + { + result_transfer_queue_families.push_back( + DeviceQueueFamilyMemberInfo(n_queue_family_index, + current_queue_family.n_queues) + ); + } } } } } /* NOTE: Vulkan API only guarantees universal queue family's availability */ - anvil_assert(result_universal_queue_family_index != UINT32_MAX); + anvil_assert(result_universal_queue_families.size() > 0); + + out_device_queue_family_info_ptr->queue_families[Anvil::QueueFamilyType::COMPUTE] = result_compute_queue_families; + out_device_queue_family_info_ptr->queue_families[Anvil::QueueFamilyType::TRANSFER] = result_transfer_queue_families; + out_device_queue_family_info_ptr->queue_families[Anvil::QueueFamilyType::UNIVERSAL] = result_universal_queue_families; + + for (Anvil::QueueFamilyType current_queue_family_type = Anvil::QueueFamilyType::FIRST; + current_queue_family_type != Anvil::QueueFamilyType::COUNT; + current_queue_family_type = static_cast(static_cast(current_queue_family_type) + 1) ) + { + uint32_t n_total_queues = 0; + + for (const auto& current_queue_fam : out_device_queue_family_info_ptr->queue_families[current_queue_family_type]) + { + n_total_queues += current_queue_fam.n_queues; + } + + out_device_queue_family_info_ptr->n_total_queues_per_family[static_cast(current_queue_family_type)] = n_total_queues; + } +} + +/** Please see header for specification */ +bool Anvil::BaseDevice::get_queue_family_indices_for_queue_family_type(const Anvil::QueueFamilyType& in_queue_family_type, + uint32_t* out_opt_n_queue_family_indices_ptr, + const uint32_t** out_opt_queue_family_indices_ptr_ptr) const +{ + bool result = false; + uint32_t result_n_queue_family_indices = 0; + const uint32_t* result_queue_family_indices_ptr = nullptr; - out_device_queue_family_info_ptr->family_index[Anvil::QUEUE_FAMILY_TYPE_COMPUTE] = result_compute_queue_family_index; - out_device_queue_family_info_ptr->family_index[Anvil::QUEUE_FAMILY_TYPE_TRANSFER] = result_dma_queue_family_index; - out_device_queue_family_info_ptr->family_index[Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL] = result_universal_queue_family_index; + auto map_iterator = m_queue_family_type_to_queue_family_indices.find(in_queue_family_type); - for (uint32_t n_queue_family_type = 0; - n_queue_family_type < static_cast(Anvil::QUEUE_FAMILY_TYPE_COUNT); - ++n_queue_family_type) + if (map_iterator != m_queue_family_type_to_queue_family_indices.end() ) + { + result = true; + result_n_queue_family_indices = static_cast(map_iterator->second.size() ); + result_queue_family_indices_ptr = (map_iterator->second.size() > 0) ? &map_iterator->second.at(0) + : nullptr; + } + else { - out_device_queue_family_info_ptr->family_type[n_queue_family_type] = Anvil::QUEUE_FAMILY_TYPE_UNDEFINED; + result = true; } - if (result_compute_queue_family_index != UINT32_MAX) + if (out_opt_n_queue_family_indices_ptr != nullptr) { - out_device_queue_family_info_ptr->family_type[result_compute_queue_family_index] = Anvil::QUEUE_FAMILY_TYPE_COMPUTE; + *out_opt_n_queue_family_indices_ptr = result_n_queue_family_indices; } - if (result_dma_queue_family_index != UINT32_MAX) + if (out_opt_queue_family_indices_ptr_ptr != nullptr) { - out_device_queue_family_info_ptr->family_type[result_dma_queue_family_index] = Anvil::QUEUE_FAMILY_TYPE_TRANSFER; + *out_opt_queue_family_indices_ptr_ptr = result_queue_family_indices_ptr; } - if (result_universal_queue_family_index != UINT32_MAX) + return result; +} + +/** Please see header for specification */ +Anvil::QueueFamilyType Anvil::BaseDevice::get_queue_family_type(uint32_t in_queue_family_index) const +{ + return m_queue_family_index_to_type.at(in_queue_family_index); +} + +/** Please see header for specification */ +Anvil::Queue* Anvil::BaseDevice::get_queue_for_queue_family_index(uint32_t in_n_queue_family, + uint32_t in_n_queue) const +{ + auto map_iterator = m_queue_ptrs_per_vk_queue_fam.find(in_n_queue_family); + Anvil::Queue* result_ptr = nullptr; + + if (map_iterator != m_queue_ptrs_per_vk_queue_fam.end()) { - out_device_queue_family_info_ptr->family_type[result_universal_queue_family_index] = Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL; + if (map_iterator->second.size() > in_n_queue) + { + result_ptr = map_iterator->second.at(in_n_queue); + } } - out_device_queue_family_info_ptr->n_queues[Anvil::QUEUE_FAMILY_TYPE_COMPUTE] = result_n_compute_queues; - out_device_queue_family_info_ptr->n_queues[Anvil::QUEUE_FAMILY_TYPE_TRANSFER] = result_n_dma_queues; - out_device_queue_family_info_ptr->n_queues[Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL] = result_n_universal_queues; + return result_ptr; } /* Please see header for specification */ @@ -275,7 +303,7 @@ bool Anvil::BaseDevice::get_sample_locations(VkSampleCountFlagBits in_sam const Anvil::SGPUDevice* sgpu_device_ptr = reinterpret_cast(this); anvil_assert(sgpu_device_ptr != nullptr); - standard_sample_locations_support = (sgpu_device_ptr->get_physical_device_properties().limits.standardSampleLocations == VK_TRUE); + standard_sample_locations_support = (sgpu_device_ptr->get_physical_device_properties().core_vk1_0_properties_ptr->limits.standard_sample_locations); break; } @@ -379,11 +407,11 @@ bool Anvil::BaseDevice::get_sample_locations(VkSampleCountFlagBits in_sam } /* Please see header for specification */ -std::shared_ptr Anvil::BaseDevice::get_sparse_binding_queue(uint32_t in_n_queue, - VkQueueFlags in_opt_required_queue_flags) const +Anvil::Queue* Anvil::BaseDevice::get_sparse_binding_queue(uint32_t in_n_queue, + VkQueueFlags in_opt_required_queue_flags) const { - uint32_t n_queues_found = 0; - std::shared_ptr result_ptr; + uint32_t n_queues_found = 0; + Anvil::Queue* result_ptr = nullptr; for (auto queue_ptr : m_sparse_binding_queues) { @@ -407,53 +435,19 @@ std::shared_ptr Anvil::BaseDevice::get_sparse_binding_queue(uint32 return result_ptr; } -/* Please see header for specification */ -bool Anvil::BaseDevice::wait_idle() -{ - const bool mt_safe = is_mt_safe(); - - VkResult result_vk; - - if (mt_safe) - { - for (const auto& queue_fam : m_queue_fams) - { - for (const auto& queue_ptr : queue_fam.second) - { - queue_ptr->lock(); - } - } - } - - result_vk = vkDeviceWaitIdle(m_device); - - if (mt_safe) - { - for (const auto& queue_fam : m_queue_fams) - { - for (const auto& queue_ptr : queue_fam.second) - { - queue_ptr->unlock(); - } - } - } - - return is_vk_call_successful(result_vk); -} - /* Initializes a new Device instance */ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, const std::vector& in_layers, bool in_transient_command_buffer_allocs_only, - bool in_support_resettable_command_buffer_allocs) + bool in_support_resettable_command_buffer_allocs, + bool in_enable_shader_module_cache) { - std::vector extensions_final; - VkPhysicalDeviceFeatures features_to_enable; - std::shared_ptr instance_locked_ptr (m_parent_instance_ptr); - const bool is_validation_enabled(instance_locked_ptr->is_validation_enabled() ); - std::vector layers_final; - const auto mt_safety (Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); + std::vector extensions_final; + VkPhysicalDeviceFeatures features_to_enable; + const bool is_validation_enabled(m_parent_instance_ptr->is_validation_enabled() ); + std::vector layers_final; + const auto mt_safety (Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); /* If validation is enabled, retrieve names of all suported validation layers and * append them to the list of layers the user has alreaedy specified. **/ @@ -504,6 +498,8 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, ExtensionItem(VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME, in_extensions.amd_rasterization_order, &m_amd_rasterization_order_enabled), ExtensionItem(VK_AMD_SHADER_BALLOT_EXTENSION_NAME, in_extensions.amd_shader_ballot, &m_amd_shader_ballot_enabled), ExtensionItem(VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME, in_extensions.amd_shader_explicit_vertex_parameter, &m_amd_shader_explicit_vertex_parameter_enabled), + ExtensionItem(VK_AMD_SHADER_FRAGMENT_MASK_EXTENSION_NAME, in_extensions.amd_shader_fragment_mask, &m_amd_shader_fragment_mask_enabled), + ExtensionItem(VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_EXTENSION_NAME, in_extensions.amd_shader_image_load_store_lod, &m_amd_shader_image_load_store_lod_enabled), ExtensionItem(VK_AMD_SHADER_INFO_EXTENSION_NAME, in_extensions.amd_shader_info, &m_amd_shader_info_enabled), ExtensionItem(VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME, in_extensions.amd_shader_trinary_minmax, &m_amd_shader_trinary_minmax_enabled), ExtensionItem(VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME, in_extensions.amd_texture_gather_bias_lod, &m_amd_texture_gather_bias_lod_enabled), @@ -512,7 +508,10 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, ExtensionItem(VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME, in_extensions.ext_shader_subgroup_ballot, &m_ext_shader_subgroup_ballot_enabled), ExtensionItem(VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME, in_extensions.ext_shader_subgroup_vote, &m_ext_shader_subgroup_vote_enabled), ExtensionItem(VK_KHR_16BIT_STORAGE_EXTENSION_NAME, in_extensions.khr_16bit_storage, &m_khr_16bit_storage_enabled), + ExtensionItem(VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME, in_extensions.khr_descriptor_update_template, &m_khr_descriptor_update_template_enabled), ExtensionItem(VK_KHR_MAINTENANCE1_EXTENSION_NAME, in_extensions.khr_maintenance1, &m_khr_maintenance1_enabled), + ExtensionItem(VK_KHR_MAINTENANCE3_EXTENSION_NAME, in_extensions.khr_maintenance3, &m_khr_maintenance3_enabled), + ExtensionItem(VK_KHR_BIND_MEMORY_2_EXTENSION_NAME, in_extensions.khr_bind_memory2, &m_khr_bind_memory2_enabled), ExtensionItem("VK_KHR_storage_buffer_storage_class", in_extensions.khr_storage_buffer_storage_class, &m_khr_storage_buffer_storage_class_enabled), ExtensionItem(VK_KHR_SURFACE_EXTENSION_NAME, in_extensions.khr_surface, &m_khr_surface_enabled), ExtensionItem(VK_KHR_SWAPCHAIN_EXTENSION_NAME, in_extensions.khr_swapchain, &m_khr_swapchain_enabled), @@ -606,7 +605,7 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, } /* Instantiate the device. Actual behavior behind this is implemented by the overriding class. */ - features_to_enable = get_physical_device_features(); + features_to_enable = get_physical_device_features().core_vk1_0_features_ptr->get_vk_physical_device_features(); anvil_assert(m_device == VK_NULL_HANDLE); { @@ -649,6 +648,27 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, anvil_assert(m_ext_debug_marker_extension_entrypoints.vkDebugMarkerSetObjectTagEXT != nullptr); } + if (m_khr_descriptor_update_template_enabled) + { + m_khr_descriptor_update_template_extension_entrypoints.vkCreateDescriptorUpdateTemplateKHR = reinterpret_cast (get_proc_address("vkCreateDescriptorUpdateTemplateKHR") ); + m_khr_descriptor_update_template_extension_entrypoints.vkDestroyDescriptorUpdateTemplateKHR = reinterpret_cast(get_proc_address("vkDestroyDescriptorUpdateTemplateKHR") ); + m_khr_descriptor_update_template_extension_entrypoints.vkUpdateDescriptorSetWithTemplateKHR = reinterpret_cast(get_proc_address("vkUpdateDescriptorSetWithTemplateKHR") ); + + anvil_assert(m_khr_descriptor_update_template_extension_entrypoints.vkCreateDescriptorUpdateTemplateKHR != nullptr); + anvil_assert(m_khr_descriptor_update_template_extension_entrypoints.vkDestroyDescriptorUpdateTemplateKHR != nullptr); + anvil_assert(m_khr_descriptor_update_template_extension_entrypoints.vkUpdateDescriptorSetWithTemplateKHR != nullptr); + } + + if (m_khr_bind_memory2_enabled) + { + m_khr_bind_memory2_extension_entrypoints.vkBindBufferMemory2KHR = reinterpret_cast (get_proc_address("vkBindBufferMemory2KHR")); + m_khr_bind_memory2_extension_entrypoints.vkBindImageMemory2KHR = reinterpret_cast (get_proc_address("vkBindImageMemory2KHR")); + + anvil_assert(m_khr_bind_memory2_extension_entrypoints.vkBindBufferMemory2KHR != nullptr); + anvil_assert(m_khr_bind_memory2_extension_entrypoints.vkBindImageMemory2KHR != nullptr); + } + + if (m_khr_maintenance1_enabled) { m_khr_maintenance1_extension_entrypoints.vkTrimCommandPoolKHR = reinterpret_cast(get_proc_address("vkTrimCommandPoolKHR") ); @@ -656,6 +676,13 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, anvil_assert(m_khr_maintenance1_extension_entrypoints.vkTrimCommandPoolKHR != nullptr); } + if (m_khr_maintenance3_enabled) + { + m_khr_maintenance3_extension_entrypoints.vkGetDescriptorSetLayoutSupportKHR = reinterpret_cast(get_proc_address("vkGetDescriptorSetLayoutSupportKHR") ); + + anvil_assert(m_khr_maintenance3_extension_entrypoints.vkGetDescriptorSetLayoutSupportKHR != nullptr); + } + if (m_khr_swapchain_enabled) { m_khr_swapchain_extension_entrypoints.vkAcquireNextImageKHR = reinterpret_cast (get_proc_address("vkAcquireNextImageKHR") ); @@ -672,113 +699,212 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, } /* Spawn queue wrappers */ - for (Anvil::QueueFamilyType queue_family_type = Anvil::QUEUE_FAMILY_TYPE_FIRST; - queue_family_type < Anvil::QUEUE_FAMILY_TYPE_COUNT; - queue_family_type = static_cast(queue_family_type + 1)) + for (Anvil::QueueFamilyType queue_family_type = Anvil::QueueFamilyType::FIRST; + queue_family_type < Anvil::QueueFamilyType::COUNT; + queue_family_type = static_cast(static_cast(queue_family_type) + 1)) { - decltype(m_queue_fams)::iterator current_queue_fam_queues_vec_iterator; - const uint32_t n_queues = m_device_queue_families.n_queues[queue_family_type]; - std::vector >& queues = (queue_family_type == Anvil::QUEUE_FAMILY_TYPE_COMPUTE) ? m_compute_queues - : (queue_family_type == Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL) ? m_universal_queues - : m_transfer_queues; + const uint32_t n_queues = m_device_queue_families.n_total_queues_per_family[static_cast(queue_family_type)]; + std::vector* out_queues_ptr = nullptr; if (n_queues == 0) { continue; } - /* Create a dummy queue vector and instantiate an iterator we're going to fill up with queue instances */ - anvil_assert(m_queue_fams.find(m_device_queue_families.family_index[queue_family_type]) == m_queue_fams.end() ); - m_queue_fams[m_device_queue_families.family_index[queue_family_type] ]; + switch (queue_family_type) + { + case Anvil::QueueFamilyType::COMPUTE: out_queues_ptr = &m_compute_queues; break; + case Anvil::QueueFamilyType::TRANSFER: out_queues_ptr = &m_transfer_queues; break; + case Anvil::QueueFamilyType::UNIVERSAL: out_queues_ptr = &m_universal_queues; break; - current_queue_fam_queues_vec_iterator = m_queue_fams.find(m_device_queue_families.family_index[queue_family_type]); + default: + { + anvil_assert_fail(); + } + } - for (uint32_t n_queue = 0; - n_queue < n_queues; - ++n_queue) + for (const auto& current_queue_fam : m_device_queue_families.queue_families[queue_family_type]) { - std::shared_ptr new_queue_ptr = Anvil::Queue::create(shared_from_this(), - m_device_queue_families.family_index[queue_family_type], - n_queue, - is_mt_safe() ); + auto queue_ptr_storage_ptr = &m_queue_ptrs_per_vk_queue_fam[current_queue_fam.family_index]; - queues.push_back(new_queue_ptr); + anvil_assert(m_queue_family_index_to_type.find(current_queue_fam.family_index) == m_queue_family_index_to_type.end() ); + anvil_assert(std::find(m_queue_family_type_to_queue_family_indices[queue_family_type].begin(), + m_queue_family_type_to_queue_family_indices[queue_family_type].end(), + current_queue_fam.family_index) == m_queue_family_type_to_queue_family_indices[queue_family_type].end() ); - anvil_assert(std::find(current_queue_fam_queues_vec_iterator->second.begin(), - current_queue_fam_queues_vec_iterator->second.end(), - new_queue_ptr) == current_queue_fam_queues_vec_iterator->second.end() ); + m_queue_family_index_to_type [current_queue_fam.family_index] = queue_family_type; + m_queue_family_type_to_queue_family_indices[queue_family_type].push_back(current_queue_fam.family_index); - current_queue_fam_queues_vec_iterator->second.push_back(new_queue_ptr); - - /* If this queue supports sparse binding ops, cache it in a separate vector as well */ - if (new_queue_ptr->supports_sparse_bindings() ) + for (uint32_t n_queue = 0; + n_queue < current_queue_fam.n_queues; + ++n_queue) { - m_sparse_binding_queues.push_back(new_queue_ptr); + std::unique_ptr new_queue_ptr = Anvil::Queue::create(this, + current_queue_fam.family_index, + n_queue, + is_mt_safe() ); + + { + anvil_assert(out_queues_ptr != nullptr); + + out_queues_ptr->push_back(new_queue_ptr.get() ); + } + + /* If this queue supports sparse binding ops, cache it in a separate vector as well */ + if (new_queue_ptr->supports_sparse_bindings() ) + { + m_sparse_binding_queues.push_back(new_queue_ptr.get() ); + } + + /* Cache the queue in general-purpose storage as well */ + if (std::find(queue_ptr_storage_ptr->cbegin(), + queue_ptr_storage_ptr->cend (), + new_queue_ptr.get() ) == queue_ptr_storage_ptr->cend() ) + { + queue_ptr_storage_ptr->push_back(new_queue_ptr.get() ); + } + + m_owned_queues.push_back( + std::move(new_queue_ptr) + ); } } } /* Instantiate per-queue family command pools */ - for (Anvil::QueueFamilyType queue_family_type = Anvil::QUEUE_FAMILY_TYPE_FIRST; - queue_family_type < Anvil::QUEUE_FAMILY_TYPE_COUNT; - queue_family_type = static_cast(queue_family_type + 1)) + m_command_pool_ptr_per_vk_queue_fam.resize(m_device_queue_families.queue_families.size() ); + + for (const auto& current_queue_fam : m_device_queue_families.queue_families) { - if (get_queue_family_index(queue_family_type) != UINT32_MAX) + for (const auto& current_queue_fam_queue : current_queue_fam.second) { - m_command_pool_ptrs[queue_family_type] = Anvil::CommandPool::create(shared_from_this(), - in_transient_command_buffer_allocs_only, - in_support_resettable_command_buffer_allocs, - queue_family_type, - mt_safety); + if (m_command_pool_ptr_per_vk_queue_fam.size() <= current_queue_fam_queue.family_index) + { + m_command_pool_ptr_per_vk_queue_fam.resize(current_queue_fam_queue.family_index + 1); + } + + if (m_command_pool_ptr_per_vk_queue_fam[current_queue_fam_queue.family_index] == nullptr) + { + m_command_pool_ptr_per_vk_queue_fam[current_queue_fam_queue.family_index] = + Anvil::CommandPool::create(this, + in_transient_command_buffer_allocs_only, + in_support_resettable_command_buffer_allocs, + current_queue_fam_queue.family_index, + mt_safety); + } } } /* Initialize a dummy descriptor set group */ { - std::vector > dummy_ds_info_ptrs(1); + std::vector dummy_ds_info_ptrs(1); dummy_ds_info_ptrs[0] = Anvil::DescriptorSetInfo::create(); dummy_ds_info_ptrs[0]->add_binding(0, /* n_binding */ - VK_DESCRIPTOR_TYPE_SAMPLER, - 0, /* n_elements */ - VK_SHADER_STAGE_ALL); + VK_DESCRIPTOR_TYPE_MAX_ENUM, + 0, /* n_elements */ + 0); /* stage_flags */ - m_dummy_dsg_ptr = Anvil::DescriptorSetGroup::create(shared_from_this(), + m_dummy_dsg_ptr = Anvil::DescriptorSetGroup::create(this, dummy_ds_info_ptrs, false, /* releaseable_sets */ MT_SAFETY_DISABLED); - m_dummy_dsg_ptr->get_descriptor_set(0)->bake(); + m_dummy_dsg_ptr->get_descriptor_set(0)->update(); + } + + /* Set up shader module cache, if one was requested. */ + if (in_enable_shader_module_cache) + { + m_shader_module_cache_ptr = Anvil::ShaderModuleCache::create(); } /* Set up the pipeline cache */ - m_pipeline_cache_ptr = Anvil::PipelineCache::create(shared_from_this(), - is_mt_safe () ); + m_pipeline_cache_ptr = Anvil::PipelineCache::create(this, + is_mt_safe() ); - /* Cache a pipeline layout manager. This is needed to ensure the manager nevers goes out of scope while - * the device is alive */ - m_pipeline_layout_manager_ptr = Anvil::PipelineLayoutManager::create(shared_from_this(), + /* Cache a pipeline layout manager instance. */ + m_pipeline_layout_manager_ptr = Anvil::PipelineLayoutManager::create(this, is_mt_safe() ); + /* Cache a descriptor set layout manager. */ + m_descriptor_set_layout_manager_ptr = Anvil::DescriptorSetLayoutManager::create(this, + is_mt_safe() ); + /* Initialize compute & graphics pipeline managers */ - m_compute_pipeline_manager_ptr = Anvil::ComputePipelineManager::create (shared_from_this(), + m_compute_pipeline_manager_ptr = Anvil::ComputePipelineManager::create (this, is_mt_safe() , true /* use_pipeline_cache */, - m_pipeline_cache_ptr); - m_graphics_pipeline_manager_ptr = Anvil::GraphicsPipelineManager::create(shared_from_this(), + m_pipeline_cache_ptr.get() ); + m_graphics_pipeline_manager_ptr = Anvil::GraphicsPipelineManager::create(this, is_mt_safe() , true /* use_pipeline_cache */, - m_pipeline_cache_ptr); + m_pipeline_cache_ptr.get() ); /* Continue with specialized initialization */ init_device(); } +/** Please see header for specification */ +bool Anvil::BaseDevice::is_compute_queue_family_index(const uint32_t& in_queue_family_index) const +{ + return (m_queue_family_index_to_type.find(in_queue_family_index) != m_queue_family_index_to_type.end()) && + (m_queue_family_index_to_type.at (in_queue_family_index) == Anvil::QueueFamilyType::COMPUTE); +} + +/** Please see header for specification */ +bool Anvil::BaseDevice::is_transfer_queue_family_index(const uint32_t& in_queue_family_index) const +{ + return (m_queue_family_index_to_type.find(in_queue_family_index) != m_queue_family_index_to_type.end()) && + (m_queue_family_index_to_type.at (in_queue_family_index) == Anvil::QueueFamilyType::TRANSFER); +} + +/** Please see header for specification */ +bool Anvil::BaseDevice::is_universal_queue_family_index(const uint32_t& in_queue_family_index) const +{ + return (m_queue_family_index_to_type.find(in_queue_family_index) != m_queue_family_index_to_type.end() ) && + (m_queue_family_index_to_type.at (in_queue_family_index) == Anvil::QueueFamilyType::UNIVERSAL); +} + +/* Please see header for specification */ +bool Anvil::BaseDevice::wait_idle() const +{ + const bool mt_safe = is_mt_safe(); + + VkResult result_vk; + + if (mt_safe) + { + for (const auto& queue_fam : m_queue_ptrs_per_vk_queue_fam) + { + for (const auto& queue_ptr : queue_fam.second) + { + queue_ptr->lock(); + } + } + } + + result_vk = vkDeviceWaitIdle(m_device); + + if (mt_safe) + { + for (const auto& queue_fam : m_queue_ptrs_per_vk_queue_fam) + { + for (const auto& queue_ptr : queue_fam.second) + { + queue_ptr->unlock(); + } + } + } + + return is_vk_call_successful(result_vk); +} + /* Please see header for specification */ -Anvil::SGPUDevice::SGPUDevice(std::weak_ptr in_physical_device_ptr, - bool in_mt_safe) - :BaseDevice (in_physical_device_ptr.lock()->get_instance(), +Anvil::SGPUDevice::SGPUDevice(const Anvil::PhysicalDevice* in_physical_device_ptr, + bool in_mt_safe) + :BaseDevice (in_physical_device_ptr->get_instance(), in_mt_safe), m_parent_physical_device_ptr(in_physical_device_ptr) { @@ -793,23 +919,27 @@ Anvil::SGPUDevice::~SGPUDevice() /* Please see header for specification */ -std::weak_ptr Anvil::SGPUDevice::create(std::weak_ptr in_physical_device_ptr, - const DeviceExtensionConfiguration& in_extensions, - const std::vector& in_layers, - bool in_transient_command_buffer_allocs_only, - bool in_support_resettable_command_buffer_allocs, - bool in_mt_safe) +Anvil::SGPUDeviceUniquePtr Anvil::SGPUDevice::create(const Anvil::PhysicalDevice* in_physical_device_ptr, + bool in_enable_shader_module_cache, + const DeviceExtensionConfiguration& in_extensions, + const std::vector& in_layers, + bool in_transient_command_buffer_allocs_only, + bool in_support_resettable_command_buffer_allocs, + bool in_mt_safe) { - std::shared_ptr result_ptr; + SGPUDeviceUniquePtr result_ptr(nullptr, + std::default_delete() ); - result_ptr = std::shared_ptr(new Anvil::SGPUDevice(in_physical_device_ptr, - in_mt_safe), - Anvil::SGPUDevice::SGPUDeviceDeleter()); + result_ptr = std::unique_ptr( + new Anvil::SGPUDevice(in_physical_device_ptr, + in_mt_safe) + ); result_ptr->init(in_extensions, in_layers, in_transient_command_buffer_allocs_only, - in_support_resettable_command_buffer_allocs); + in_support_resettable_command_buffer_allocs, + in_enable_shader_module_cache); return result_ptr; } @@ -820,12 +950,11 @@ void Anvil::SGPUDevice::create_device(const std::vector& in_extensi const VkPhysicalDeviceFeatures& in_features, DeviceQueueFamilyInfo* out_queue_families_ptr) { - VkDeviceCreateInfo create_info; - std::vector device_queue_create_info_items; - std::vector device_queue_priorities; - std::shared_ptr physical_device_locked_ptr(m_parent_physical_device_ptr); - const auto& physical_device_queue_fams(physical_device_locked_ptr->get_queue_families() ); - VkResult result (VK_ERROR_INITIALIZATION_FAILED); + VkDeviceCreateInfo create_info; + std::vector device_queue_create_info_items; + std::vector device_queue_priorities; + const auto& physical_device_queue_fams(m_parent_physical_device_ptr->get_queue_families() ); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); ANVIL_REDUNDANT_VARIABLE(result); @@ -879,7 +1008,7 @@ void Anvil::SGPUDevice::create_device(const std::vector& in_extensi create_info.queueCreateInfoCount = static_cast(device_queue_create_info_items.size() ); create_info.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO; - result = vkCreateDevice(m_parent_physical_device_ptr.lock()->get_physical_device(), + result = vkCreateDevice(m_parent_physical_device_ptr->get_physical_device(), &create_info, nullptr, /* pAllocator */ &m_device); @@ -890,16 +1019,17 @@ void Anvil::SGPUDevice::create_device(const std::vector& in_extensi } /** Please see header for specification */ -std::shared_ptr Anvil::SGPUDevice::create_swapchain(std::shared_ptr in_parent_surface_ptr, - std::shared_ptr in_window_ptr, - VkFormat in_image_format, - VkPresentModeKHR in_present_mode, - VkImageUsageFlags in_usage, - uint32_t in_n_swapchain_images) +Anvil::SwapchainUniquePtr Anvil::SGPUDevice::create_swapchain(Anvil::RenderingSurface* in_parent_surface_ptr, + Anvil::Window* in_window_ptr, + VkFormat in_image_format, + VkPresentModeKHR in_present_mode, + VkImageUsageFlags in_usage, + uint32_t in_n_swapchain_images) { - std::shared_ptr result_ptr; + SwapchainUniquePtr result_ptr(nullptr, + std::default_delete() ); - result_ptr = Anvil::Swapchain::create(shared_from_this(), + result_ptr = Anvil::Swapchain::create(this, in_parent_surface_ptr, in_window_ptr, in_image_format, @@ -913,33 +1043,15 @@ std::shared_ptr Anvil::SGPUDevice::create_swapchain(std::share } /** Please see header for specification */ -void Anvil::SGPUDevice::destroy() -{ - std::shared_ptr physical_device_locked_ptr(m_parent_physical_device_ptr); - - /* Release common stuff first */ - Anvil::BaseDevice::destroy(); - - /* Unregister the instance from physical device, so that Device instance gets released as soon - * as all external shared pointers go out of scope. - */ - physical_device_locked_ptr->unregister_device(shared_from_this() ); -} - -/** Please see header for specification */ -const VkPhysicalDeviceFeatures& Anvil::SGPUDevice::get_physical_device_features() const +const Anvil::PhysicalDeviceFeatures& Anvil::SGPUDevice::get_physical_device_features() const { - std::shared_ptr physical_device_locked_ptr(m_parent_physical_device_ptr); - - return physical_device_locked_ptr->get_device_features(); + return m_parent_physical_device_ptr->get_device_features(); } /** Please see header for specification */ const Anvil::FormatProperties& Anvil::SGPUDevice::get_physical_device_format_properties(VkFormat in_format) const { - std::shared_ptr physical_device_locked_ptr(m_parent_physical_device_ptr); - - return physical_device_locked_ptr->get_format_properties(in_format); + return m_parent_physical_device_ptr->get_format_properties(in_format); } /** Please see header for specification */ @@ -952,7 +1064,7 @@ bool Anvil::SGPUDevice::get_physical_device_image_format_properties(VkFormat { bool result; - result = is_vk_call_successful(vkGetPhysicalDeviceImageFormatProperties(m_parent_physical_device_ptr.lock()->get_physical_device(), + result = is_vk_call_successful(vkGetPhysicalDeviceImageFormatProperties(m_parent_physical_device_ptr->get_physical_device(), in_format, in_type, in_tiling, @@ -966,25 +1078,19 @@ bool Anvil::SGPUDevice::get_physical_device_image_format_properties(VkFormat /** Please see header for specification */ const Anvil::MemoryProperties& Anvil::SGPUDevice::get_physical_device_memory_properties() const { - std::shared_ptr physical_device_locked_ptr(m_parent_physical_device_ptr); - - return physical_device_locked_ptr->get_memory_properties(); + return m_parent_physical_device_ptr->get_memory_properties(); } /** Please see header for specification */ -const VkPhysicalDeviceProperties& Anvil::SGPUDevice::get_physical_device_properties() const +const Anvil::PhysicalDeviceProperties& Anvil::SGPUDevice::get_physical_device_properties() const { - std::shared_ptr physical_device_locked_ptr(m_parent_physical_device_ptr); - - return physical_device_locked_ptr->get_device_properties(); + return m_parent_physical_device_ptr->get_device_properties(); } /** Please see header for specification */ const Anvil::QueueFamilyInfoItems& Anvil::SGPUDevice::get_physical_device_queue_families() const { - std::shared_ptr physical_device_locked_ptr(m_parent_physical_device_ptr); - - return physical_device_locked_ptr->get_queue_families(); + return m_parent_physical_device_ptr->get_queue_families(); } /** Please see header for specification */ @@ -997,7 +1103,7 @@ bool Anvil::SGPUDevice::get_physical_device_sparse_image_format_properties(VkFor { uint32_t n_props = 0; - vkGetPhysicalDeviceSparseImageFormatProperties(m_parent_physical_device_ptr.lock()->get_physical_device(), + vkGetPhysicalDeviceSparseImageFormatProperties(m_parent_physical_device_ptr->get_physical_device(), in_format, in_type, in_sample_count, @@ -1010,7 +1116,7 @@ bool Anvil::SGPUDevice::get_physical_device_sparse_image_format_properties(VkFor { out_result.resize(n_props); - vkGetPhysicalDeviceSparseImageFormatProperties(m_parent_physical_device_ptr.lock()->get_physical_device(), + vkGetPhysicalDeviceSparseImageFormatProperties(m_parent_physical_device_ptr->get_physical_device(), in_format, in_type, in_sample_count, @@ -1024,10 +1130,10 @@ bool Anvil::SGPUDevice::get_physical_device_sparse_image_format_properties(VkFor } /* Please see header for specification */ -bool Anvil::SGPUDevice::get_physical_device_surface_capabilities(std::shared_ptr in_surface_ptr, - VkSurfaceCapabilitiesKHR* out_result_ptr) const +bool Anvil::SGPUDevice::get_physical_device_surface_capabilities(Anvil::RenderingSurface* in_surface_ptr, + VkSurfaceCapabilitiesKHR* out_result_ptr) const { - return (vkGetPhysicalDeviceSurfaceCapabilitiesKHR(m_parent_physical_device_ptr.lock()->get_physical_device(), + return (vkGetPhysicalDeviceSurfaceCapabilitiesKHR(m_parent_physical_device_ptr->get_physical_device(), in_surface_ptr->get_surface(), out_result_ptr) == VK_SUCCESS); } @@ -1042,9 +1148,8 @@ void Anvil::SGPUDevice::get_queue_family_indices(DeviceQueueFamilyInfo* out_devi /** Please see header for specification */ const Anvil::QueueFamilyInfo* Anvil::SGPUDevice::get_queue_family_info(uint32_t in_queue_family_index) const { - std::shared_ptr physical_device_locked_ptr(m_parent_physical_device_ptr); - const auto& queue_fams (physical_device_locked_ptr->get_queue_families() ); - const Anvil::QueueFamilyInfo* result_ptr (nullptr); + const auto& queue_fams(m_parent_physical_device_ptr->get_queue_families() ); + const Anvil::QueueFamilyInfo* result_ptr(nullptr); if (queue_fams.size() > in_queue_family_index) { @@ -1054,31 +1159,19 @@ const Anvil::QueueFamilyInfo* Anvil::SGPUDevice::get_queue_family_info(uint32_t return result_ptr; } -/** Register this SGPUDevice with the owning physical device. This is necessary to ensure this device instance - * is not released prematurely. - **/ void Anvil::SGPUDevice::init_device() { - std::shared_ptr physical_device_locked_ptr(m_parent_physical_device_ptr); - - /* Cache a shared pointer owning this instance in PhysicalDevice. We will release it at destroy() time, - * having destroyed all children objects we also own and which take a weak pointer to this Device. - */ - physical_device_locked_ptr->register_device(shared_from_this() ); + /* Stub */ } /** Please see header for specification */ bool Anvil::SGPUDevice::is_layer_supported(const std::string& in_layer_name) const { - std::shared_ptr physical_device_locked_ptr(m_parent_physical_device_ptr); - - return physical_device_locked_ptr->is_layer_supported(in_layer_name); + return m_parent_physical_device_ptr->is_layer_supported(in_layer_name); } /** Please see header for specification */ bool Anvil::SGPUDevice::is_physical_device_extension_supported(const std::string& in_extension_name) const { - std::shared_ptr physical_device_locked_ptr(m_parent_physical_device_ptr); - - return physical_device_locked_ptr->is_device_extension_supported(in_extension_name); + return m_parent_physical_device_ptr->is_device_extension_supported(in_extension_name); } diff --git a/src/wrappers/event.cpp b/src/wrappers/event.cpp index 51ebf44c..5c22b247 100644 --- a/src/wrappers/event.cpp +++ b/src/wrappers/event.cpp @@ -26,17 +26,16 @@ #include "wrappers/event.h" /* Please see header for specification */ -Anvil::Event::Event(std::weak_ptr in_device_ptr, - bool in_mt_safe) +Anvil::Event::Event(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT), MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), m_event (VK_NULL_HANDLE) { - std::shared_ptr device_locked_ptr(m_device_ptr); - VkEventCreateInfo event_create_info; - VkResult result (VK_ERROR_INITIALIZATION_FAILED); + VkEventCreateInfo event_create_info; + VkResult result (VK_ERROR_INITIALIZATION_FAILED); ANVIL_REDUNDANT_VARIABLE(result); @@ -45,7 +44,7 @@ Anvil::Event::Event(std::weak_ptr in_device_ptr, event_create_info.pNext = nullptr; event_create_info.sType = VK_STRUCTURE_TYPE_EVENT_CREATE_INFO; - result = vkCreateEvent(device_locked_ptr->get_device_vk(), + result = vkCreateEvent(m_device_ptr->get_device_vk(), &event_create_info, nullptr, /* pAllocator */ &m_event); @@ -75,12 +74,13 @@ Anvil::Event::~Event() } /* Please see header for specification */ -std::shared_ptr Anvil::Event::create(std::weak_ptr in_device_ptr, - MTSafety in_mt_safety) +Anvil::EventUniquePtr Anvil::Event::create(const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety) { - const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - std::shared_ptr result_ptr; + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); + Anvil::EventUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::Event(in_device_ptr, @@ -93,10 +93,9 @@ std::shared_ptr Anvil::Event::create(std::weak_ptr device_locked_ptr(m_device_ptr); - VkResult result; + VkResult result; - result = vkGetEventStatus(device_locked_ptr->get_device_vk(), + result = vkGetEventStatus(m_device_ptr->get_device_vk(), m_event); anvil_assert(result == VK_EVENT_RESET || @@ -110,11 +109,9 @@ void Anvil::Event::release_event() { if (m_event != VK_NULL_HANDLE) { - std::shared_ptr device_locked_ptr(m_device_ptr); - lock(); { - vkDestroyEvent(device_locked_ptr->get_device_vk(), + vkDestroyEvent(m_device_ptr->get_device_vk(), m_event, nullptr /* pAllocator */); } @@ -127,12 +124,11 @@ void Anvil::Event::release_event() /* Please see header for specification */ bool Anvil::Event::reset() { - std::shared_ptr device_locked_ptr(m_device_ptr); - VkResult result; + VkResult result; lock(); { - result = vkResetEvent(device_locked_ptr->get_device_vk(), + result = vkResetEvent(m_device_ptr->get_device_vk(), m_event); } unlock(); @@ -145,12 +141,11 @@ bool Anvil::Event::reset() /* Please see header for specification */ bool Anvil::Event::set() { - std::shared_ptr device_locked_ptr(m_device_ptr); - VkResult result; + VkResult result; lock(); { - result = vkSetEvent(device_locked_ptr->get_device_vk(), + result = vkSetEvent(m_device_ptr->get_device_vk(), m_event); } unlock(); diff --git a/src/wrappers/fence.cpp b/src/wrappers/fence.cpp index 4f82b0a3..9a1907b3 100644 --- a/src/wrappers/fence.cpp +++ b/src/wrappers/fence.cpp @@ -27,9 +27,9 @@ #include /* Please see header for specification */ -Anvil::Fence::Fence(std::weak_ptr in_device_ptr, - bool in_create_signalled, - bool in_mt_safe) +Anvil::Fence::Fence(const Anvil::BaseDevice* in_device_ptr, + bool in_create_signalled, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT), MTSafetySupportProvider (in_mt_safe), @@ -37,9 +37,8 @@ Anvil::Fence::Fence(std::weak_ptr in_device_ptr, m_fence (VK_NULL_HANDLE), m_possibly_set (false) { - std::shared_ptr device_locked_ptr(m_device_ptr); - VkFenceCreateInfo fence_create_info; - VkResult result (VK_ERROR_INITIALIZATION_FAILED); + VkFenceCreateInfo fence_create_info; + VkResult result (VK_ERROR_INITIALIZATION_FAILED); ANVIL_REDUNDANT_VARIABLE(result); @@ -49,7 +48,7 @@ Anvil::Fence::Fence(std::weak_ptr in_device_ptr, fence_create_info.pNext = nullptr; fence_create_info.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO; - result = vkCreateFence(device_locked_ptr->get_device_vk(), + result = vkCreateFence(m_device_ptr->get_device_vk(), &fence_create_info, nullptr, /* pAllocator */ &m_fence); @@ -75,13 +74,14 @@ Anvil::Fence::~Fence() } /* Please see header for specification */ -std::shared_ptr Anvil::Fence::create(std::weak_ptr in_device_ptr, - bool in_create_signalled, - MTSafety in_mt_safety) +Anvil::FenceUniquePtr Anvil::Fence::create(const Anvil::BaseDevice* in_device_ptr, + bool in_create_signalled, + MTSafety in_mt_safety) { - const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - std::shared_ptr result_ptr; + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); + Anvil::FenceUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::Fence(in_device_ptr, @@ -95,10 +95,9 @@ std::shared_ptr Anvil::Fence::create(std::weak_ptr device_locked_ptr(m_device_ptr); - VkResult result; + VkResult result; - result = vkGetFenceStatus(device_locked_ptr->get_device_vk(), + result = vkGetFenceStatus(m_device_ptr->get_device_vk(), m_fence); anvil_assert(result == VK_SUCCESS || @@ -112,11 +111,9 @@ void Anvil::Fence::release_fence() { if (m_fence != VK_NULL_HANDLE) { - std::shared_ptr device_locked_ptr(m_device_ptr); - lock(); { - vkDestroyFence(device_locked_ptr->get_device_vk(), + vkDestroyFence(m_device_ptr->get_device_vk(), m_fence, nullptr /* pAllocator */); } @@ -129,12 +126,11 @@ void Anvil::Fence::release_fence() /* Please see header for specification */ bool Anvil::Fence::reset() { - std::shared_ptr device_locked_ptr(m_device_ptr); - VkResult result; + VkResult result; lock(); { - result = vkResetFences(device_locked_ptr->get_device_vk(), + result = vkResetFences(m_device_ptr->get_device_vk(), 1, /* fenceCount */ &m_fence); } @@ -151,11 +147,11 @@ bool Anvil::Fence::reset() bool Anvil::Fence::reset_fences(const uint32_t in_n_fences, Fence* in_fences) { - std::shared_ptr device_locked_ptr; - VkFence fence_cache[32]; - static const uint32_t fence_cache_capacity = sizeof(fence_cache) / sizeof(fence_cache[0]); - bool result = true; - VkResult result_vk; + const Anvil::BaseDevice* device_ptr = nullptr; + auto fence_cache = std::vector(in_n_fences); + static const uint32_t fence_cache_capacity = sizeof(fence_cache) / sizeof(fence_cache[0]); + bool result = true; + VkResult result_vk; if (in_n_fences == 0) { @@ -174,10 +170,10 @@ bool Anvil::Fence::reset_fences(const uint32_t in_n_fences, { Anvil::Fence& current_fence = in_fences[n_fence_batch * fence_cache_capacity + n_fence]; - anvil_assert(device_locked_ptr == nullptr || - device_locked_ptr != nullptr && !current_fence.m_device_ptr.expired()); + anvil_assert(device_ptr == nullptr || + device_ptr != nullptr && current_fence.m_device_ptr != nullptr); - device_locked_ptr = current_fence.m_device_ptr.lock(); + device_ptr = current_fence.m_device_ptr; fence_cache[n_fence] = current_fence.m_fence; current_fence.m_possibly_set = false; @@ -185,9 +181,9 @@ bool Anvil::Fence::reset_fences(const uint32_t in_n_fences, current_fence.lock(); } { - result_vk = vkResetFences(device_locked_ptr->get_device_vk(), + result_vk = vkResetFences(device_ptr->get_device_vk(), n_fences_remaining, - fence_cache); + (n_fences_remaining > 0) ? &fence_cache.at(0) : nullptr); } for (uint32_t n_fence = 0; n_fence < n_fences_remaining; diff --git a/src/wrappers/framebuffer.cpp b/src/wrappers/framebuffer.cpp index 58834dcc..5af9dda4 100644 --- a/src/wrappers/framebuffer.cpp +++ b/src/wrappers/framebuffer.cpp @@ -30,15 +30,15 @@ #include "wrappers/render_pass.h" #include -bool Anvil::Framebuffer::RenderPassComparator::operator()(std::shared_ptr in_a_ptr, - std::shared_ptr in_b_ptr) const +bool Anvil::Framebuffer::RenderPassComparator::operator()(Anvil::RenderPass* in_a_ptr, + Anvil::RenderPass* in_b_ptr) const { return in_a_ptr->get_render_pass() < in_b_ptr->get_render_pass(); } /** Please see header for specification */ -Anvil::Framebuffer::FramebufferAttachment::FramebufferAttachment(std::shared_ptr in_image_view_ptr) +Anvil::Framebuffer::FramebufferAttachment::FramebufferAttachment(ImageView* in_image_view_ptr) { anvil_assert(in_image_view_ptr != nullptr); @@ -66,11 +66,11 @@ Anvil::Framebuffer::FramebufferAttachment::~FramebufferAttachment() } /* Please see header for specification */ -Anvil::Framebuffer::Framebuffer(std::weak_ptr in_device_ptr, - uint32_t in_width, - uint32_t in_height, - uint32_t in_n_layers, - bool in_mt_safe) +Anvil::Framebuffer::Framebuffer(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_width, + uint32_t in_height, + uint32_t in_n_layers, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT, true), /* in_use_delegate_workers */ @@ -97,8 +97,6 @@ Anvil::Framebuffer::Framebuffer(std::weak_ptr in_device_ptr, **/ Anvil::Framebuffer::~Framebuffer() { - std::shared_ptr device_locked_ptr(m_device_ptr); - /* Unregister the object */ Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_FRAMEBUFFER, this); @@ -112,7 +110,7 @@ Anvil::Framebuffer::~Framebuffer() /* Destroy the Vulkan framebuffer object */ lock(); { - vkDestroyFramebuffer(device_locked_ptr->get_device_vk(), + vkDestroyFramebuffer(m_device_ptr->get_device_vk(), fb_iterator->second.framebuffer, nullptr /* pAllocator */); } @@ -124,12 +122,12 @@ Anvil::Framebuffer::~Framebuffer() } /* Please see header for specification */ -bool Anvil::Framebuffer::add_attachment(std::shared_ptr in_image_view_ptr, - FramebufferAttachmentID* out_opt_attachment_id_ptr) +bool Anvil::Framebuffer::add_attachment(ImageView* in_image_view_ptr, + FramebufferAttachmentID* out_opt_attachment_id_ptr) { - std::shared_ptr parent_image_ptr; - bool result = false; - uint32_t view_size[3]; + const Anvil::Image* parent_image_ptr; + bool result = false; + uint32_t view_size[3]; /* Sanity checks: Input image view must not be nullptr */ anvil_assert(in_image_view_ptr != nullptr); @@ -151,8 +149,7 @@ bool Anvil::Framebuffer::add_attachment(std::shared_ptr in_image_view } if (view_size[0] < m_framebuffer_size[0] || - view_size[1] < m_framebuffer_size[1] || - view_size[2] < m_framebuffer_size[2]) + view_size[1] < m_framebuffer_size[1]) { /* Attachment size is wrong */ anvil_assert_fail(); @@ -184,15 +181,14 @@ bool Anvil::Framebuffer::add_attachment(std::shared_ptr in_image_view } /* Please see header for specification */ -bool Anvil::Framebuffer::bake(std::shared_ptr in_render_pass_ptr) +bool Anvil::Framebuffer::bake(Anvil::RenderPass* in_render_pass_ptr) { - BakedFramebufferMap::iterator baked_fb_iterator; - std::shared_ptr device_locked_ptr(m_device_ptr); - VkFramebufferCreateInfo fb_create_info; - std::vector image_view_attachments; - bool result = false; - VkFramebuffer result_fb = VK_NULL_HANDLE; - VkResult result_vk = VK_ERROR_INITIALIZATION_FAILED; + BakedFramebufferMap::iterator baked_fb_iterator; + VkFramebufferCreateInfo fb_create_info; + std::vector image_view_attachments; + bool result = false; + VkFramebuffer result_fb = VK_NULL_HANDLE; + VkResult result_vk = VK_ERROR_INITIALIZATION_FAILED; ANVIL_REDUNDANT_VARIABLE(result_vk); @@ -224,7 +220,7 @@ bool Anvil::Framebuffer::bake(std::shared_ptr in_render_pass_ { lock(); { - vkDestroyFramebuffer(device_locked_ptr->get_device_vk(), + vkDestroyFramebuffer(m_device_ptr->get_device_vk(), baked_fb_iterator->second.framebuffer, nullptr /* pAllocator */); } @@ -260,7 +256,7 @@ bool Anvil::Framebuffer::bake(std::shared_ptr in_render_pass_ fb_create_info.width = m_framebuffer_size[0]; /* Create the framebuffer instance and store it */ - result_vk = vkCreateFramebuffer(device_locked_ptr->get_device_vk(), + result_vk = vkCreateFramebuffer(m_device_ptr->get_device_vk(), &fb_create_info, nullptr, /* pAllocator */ &result_fb); @@ -284,15 +280,16 @@ bool Anvil::Framebuffer::bake(std::shared_ptr in_render_pass_ } /* Please see header for specification */ -std::shared_ptr Anvil::Framebuffer::create(std::weak_ptr in_device_ptr, - uint32_t in_width, - uint32_t in_height, - uint32_t in_n_layers, - MTSafety in_mt_safety) +Anvil::FramebufferUniquePtr Anvil::Framebuffer::create(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_width, + uint32_t in_height, + uint32_t in_n_layers, + MTSafety in_mt_safety) { - const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - std::shared_ptr result_ptr; + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); + Anvil::FramebufferUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::Framebuffer(in_device_ptr, @@ -306,8 +303,8 @@ std::shared_ptr Anvil::Framebuffer::create(std::weak_ptr* out_image_view_ptr) const +bool Anvil::Framebuffer::get_attachment_at_index(uint32_t in_attachment_index, + ImageView** out_image_view_ptr_ptr) const { bool result = false; @@ -317,8 +314,8 @@ bool Anvil::Framebuffer::get_attachment_at_index(uint32_t in_ } else { - *out_image_view_ptr = m_attachments[in_attachment_index].image_view_ptr; - result = true; + *out_image_view_ptr_ptr = m_attachments[in_attachment_index].image_view_ptr; + result = true; } end: @@ -326,8 +323,8 @@ bool Anvil::Framebuffer::get_attachment_at_index(uint32_t in_ } /* Please see header for specification */ -bool Anvil::Framebuffer::get_attachment_id_for_image_view(std::shared_ptr in_image_view_ptr, - FramebufferAttachmentID* out_attachment_id_ptr) +bool Anvil::Framebuffer::get_attachment_id_for_image_view(ImageView* in_image_view_ptr, + FramebufferAttachmentID* out_attachment_id_ptr) { bool result = false; auto attachment_iterator = std::find(m_attachments.cbegin(), @@ -344,7 +341,7 @@ bool Anvil::Framebuffer::get_attachment_id_for_image_view(std::shared_ptr in_render_pass_ptr) +const VkFramebuffer Anvil::Framebuffer::get_framebuffer(Anvil::RenderPass* in_render_pass_ptr) { auto fb_iterator = m_baked_framebuffers.find(in_render_pass_ptr); VkFramebuffer result_fb = VK_NULL_HANDLE; diff --git a/src/wrappers/graphics_pipeline_manager.cpp b/src/wrappers/graphics_pipeline_manager.cpp index 6a97c5ab..b47e0f13 100644 --- a/src/wrappers/graphics_pipeline_manager.cpp +++ b/src/wrappers/graphics_pipeline_manager.cpp @@ -27,6 +27,7 @@ #include "misc/graphics_pipeline_info.h" #include "misc/object_tracker.h" #include "misc/render_pass_info.h" +#include "misc/struct_chainer.h" #include "wrappers/device.h" #include "wrappers/graphics_pipeline_manager.h" #include "wrappers/pipeline_cache.h" @@ -39,7 +40,6 @@ #undef max #endif - /** When baking a graphics pipeline descriptor, we currently use STL vectors to maintain storage * for various Vulkan descriptors. These need to be stored on heap because: * @@ -57,10 +57,10 @@ /* Please see header for specification */ -Anvil::GraphicsPipelineManager::GraphicsPipelineManager(std::weak_ptr in_device_ptr, - bool in_mt_safe, - bool in_use_pipeline_cache, - std::shared_ptr in_pipeline_cache_to_reuse_ptr) +Anvil::GraphicsPipelineManager::GraphicsPipelineManager(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe, + bool in_use_pipeline_cache, + Anvil::PipelineCache* in_pipeline_cache_to_reuse_ptr) :BasePipelineManager(in_device_ptr, in_mt_safe, in_use_pipeline_cache, @@ -104,29 +104,28 @@ bool Anvil::GraphicsPipelineManager::bake() } BakeItem; std::vector bake_items; - auto color_blend_attachment_states_vk_cache = std::vector (); - auto color_blend_state_create_info_items_vk_cache = std::vector (); - auto depth_stencil_state_create_info_items_vk_cache = std::vector (); - auto device_locked_ptr = std::shared_ptr (m_device_ptr); - auto dynamic_state_create_info_items_vk_cache = std::vector (); - auto enabled_dynamic_states_vk_cache = std::vector (); - auto graphics_pipeline_create_info_items_vk_cache = std::vector (); - auto input_assembly_state_create_info_items_vk_cache= std::vector(); - auto multisample_state_create_info_items_vk_cache = std::vector (); + auto color_blend_attachment_states_vk_cache = std::vector (); + auto color_blend_state_create_info_items_vk_cache = std::vector (); + auto depth_stencil_state_create_info_items_vk_cache = std::vector (); + auto dynamic_state_create_info_items_vk_cache = std::vector (); + auto enabled_dynamic_states_vk_cache = std::vector (); + auto graphics_pipeline_create_info_chains = Anvil::StructChainVector(); + auto input_assembly_state_create_info_items_vk_cache = std::vector (); + auto multisample_state_create_info_items_vk_cache = std::vector (); std::unique_lock mutex_lock; - auto mutex_ptr = get_mutex(); - uint32_t n_consumed_graphics_pipelines = 0; - auto raster_state_create_info_items_vk_cache = std::vector(); - bool result = false; + auto mutex_ptr = get_mutex(); + uint32_t n_consumed_graphics_pipelines = 0; + auto raster_state_create_info_chains_vk_cache = std::vector > >(); + bool result = false; std::vector result_graphics_pipelines; VkResult result_vk; - auto scissor_boxes_vk_cache = std::vector (); - auto shader_stage_create_info_items_vk_cache = std::vector (); - auto specialization_info_vk_cache = std::vector (); - auto specialization_map_entry_vk_cache = std::vector (); - auto tessellation_state_create_info_items_vk_cache = std::vector (); - auto vertex_input_state_create_info_items_vk_cache = std::vector (); - auto viewport_state_create_info_items_vk_cache = std::vector (); + auto scissor_boxes_vk_cache = std::vector (); + auto shader_stage_create_info_items_vk_cache = std::vector (); + auto specialization_info_vk_cache = std::vector (); + auto specialization_map_entry_vk_cache = std::vector (); + auto tessellation_state_create_info_items_vk_cache = std::vector (); + auto vertex_input_state_create_info_items_vk_cache = std::vector (); + auto viewport_state_create_info_items_vk_cache = std::vector (); std::vector viewports_vk_cache; @@ -144,23 +143,22 @@ bool Anvil::GraphicsPipelineManager::bake() }; - color_blend_attachment_states_vk_cache.reserve (N_CACHE_ITEMS); - color_blend_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - depth_stencil_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - dynamic_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - enabled_dynamic_states_vk_cache.reserve (N_CACHE_ITEMS); - graphics_pipeline_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - input_assembly_state_create_info_items_vk_cache.reserve(N_CACHE_ITEMS); - multisample_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - raster_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - scissor_boxes_vk_cache.reserve (N_CACHE_ITEMS); - shader_stage_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - specialization_info_vk_cache.reserve (N_CACHE_ITEMS); - specialization_map_entry_vk_cache.reserve (N_CACHE_ITEMS); - tessellation_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - vertex_input_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - viewport_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - viewports_vk_cache.reserve (N_CACHE_ITEMS); + color_blend_attachment_states_vk_cache.reserve (N_CACHE_ITEMS); + color_blend_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); + depth_stencil_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); + dynamic_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); + enabled_dynamic_states_vk_cache.reserve (N_CACHE_ITEMS); + input_assembly_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); + multisample_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); + raster_state_create_info_chains_vk_cache.reserve (N_CACHE_ITEMS); + scissor_boxes_vk_cache.reserve (N_CACHE_ITEMS); + shader_stage_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); + specialization_info_vk_cache.reserve (N_CACHE_ITEMS); + specialization_map_entry_vk_cache.reserve (N_CACHE_ITEMS); + tessellation_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); + vertex_input_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); + viewport_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); + viewports_vk_cache.reserve (N_CACHE_ITEMS); if (mutex_ptr != nullptr) { @@ -175,7 +173,9 @@ bool Anvil::GraphicsPipelineManager::bake() { if (pipeline_iterator->second->layout_ptr == nullptr) { - pipeline_iterator->second->layout_ptr = get_pipeline_layout(pipeline_iterator->first); + get_pipeline_layout(pipeline_iterator->first); + + anvil_assert(pipeline_iterator->second->layout_ptr != nullptr); } bake_items.push_back( @@ -195,22 +195,21 @@ bool Anvil::GraphicsPipelineManager::bake() bake_item_iterator != bake_items.end(); ++bake_item_iterator) { - bool color_blend_state_used = false; - const PipelineID current_pipeline_id = bake_item_iterator->pipeline_id; - const auto current_pipeline_info_ptr = dynamic_cast(bake_item_iterator->pipeline_ptr->pipeline_info_ptr.get() ); - Pipeline* current_pipeline_ptr = bake_item_iterator->pipeline_ptr; - Anvil::RenderPass* current_pipeline_renderpass_ptr = nullptr; - Anvil::SubPassID current_pipeline_subpass_id; - bool depth_stencil_state_used = false; - bool dynamic_state_used = false; - VkGraphicsPipelineCreateInfo graphics_pipeline_create_info = {}; - VkPipelineInputAssemblyStateCreateInfo input_assembly_state_create_info; - bool multisample_state_used = false; - VkPipelineRasterizationStateCreateInfo raster_state_create_info; - uint32_t subpass_n_color_attachments = 0; - bool tessellation_state_used = false; - VkPipelineVertexInputStateCreateInfo vertex_input_state_create_info; - bool viewport_state_used = false; + bool color_blend_state_used = false; + const PipelineID current_pipeline_id = bake_item_iterator->pipeline_id; + auto current_pipeline_info_ptr = dynamic_cast(bake_item_iterator->pipeline_ptr->pipeline_info_ptr.get() ); + Pipeline* current_pipeline_ptr = bake_item_iterator->pipeline_ptr; + const Anvil::RenderPass* current_pipeline_renderpass_ptr = nullptr; + Anvil::SubPassID current_pipeline_subpass_id; + bool depth_stencil_state_used = false; + bool dynamic_state_used = false; + Anvil::StructChainer graphics_pipeline_create_info_chainer; + VkPipelineInputAssemblyStateCreateInfo input_assembly_state_create_info; + bool multisample_state_used = false; + uint32_t subpass_n_color_attachments = 0; + bool tessellation_state_used = false; + VkPipelineVertexInputStateCreateInfo vertex_input_state_create_info; + bool viewport_state_used = false; if (current_pipeline_info_ptr == nullptr) { @@ -219,7 +218,7 @@ bool Anvil::GraphicsPipelineManager::bake() continue; } - current_pipeline_renderpass_ptr = current_pipeline_info_ptr->get_renderpass().get(); + current_pipeline_renderpass_ptr = current_pipeline_info_ptr->get_renderpass(); current_pipeline_subpass_id = current_pipeline_info_ptr->get_subpass_id(); if (current_pipeline_info_ptr->is_proxy() ) @@ -521,16 +520,17 @@ bool Anvil::GraphicsPipelineManager::bake() } } - /* Form the raster state create info descriptor */ + /* Form the raster state create info chain */ { - VkCullModeFlags cull_mode = VK_CULL_MODE_FLAG_BITS_MAX_ENUM; - float depth_bias_clamp = std::numeric_limits::max(); - float depth_bias_constant_factor = std::numeric_limits::max(); - float depth_bias_slope_factor = std::numeric_limits::max(); - VkFrontFace front_face = VK_FRONT_FACE_MAX_ENUM; - bool is_depth_bias_enabled = false; - float line_width = std::numeric_limits::max(); - VkPolygonMode polygon_mode = VK_POLYGON_MODE_MAX_ENUM; + VkCullModeFlags cull_mode = VK_CULL_MODE_FLAG_BITS_MAX_ENUM; + float depth_bias_clamp = std::numeric_limits::max(); + float depth_bias_constant_factor = std::numeric_limits::max(); + float depth_bias_slope_factor = std::numeric_limits::max(); + VkFrontFace front_face = VK_FRONT_FACE_MAX_ENUM; + bool is_depth_bias_enabled = false; + float line_width = std::numeric_limits::max(); + VkPolygonMode polygon_mode = VK_POLYGON_MODE_MAX_ENUM; + Anvil::StructChainer raster_state_create_info_chainer; current_pipeline_info_ptr->get_depth_bias_state (&is_depth_bias_enabled, &depth_bias_constant_factor, @@ -541,39 +541,41 @@ bool Anvil::GraphicsPipelineManager::bake() &front_face, &line_width); - raster_state_create_info.cullMode = cull_mode; - raster_state_create_info.depthBiasClamp = depth_bias_clamp; - raster_state_create_info.depthBiasConstantFactor = depth_bias_constant_factor; - raster_state_create_info.depthBiasEnable = is_depth_bias_enabled ? VK_TRUE : VK_FALSE; - raster_state_create_info.depthBiasSlopeFactor = depth_bias_slope_factor; - raster_state_create_info.depthClampEnable = current_pipeline_info_ptr->is_depth_clamp_enabled() ? VK_TRUE : VK_FALSE; - raster_state_create_info.flags = 0; - raster_state_create_info.frontFace = front_face; - raster_state_create_info.lineWidth = line_width; - raster_state_create_info.pNext = nullptr; - raster_state_create_info.polygonMode = polygon_mode; - raster_state_create_info.rasterizerDiscardEnable = current_pipeline_info_ptr->is_rasterizer_discard_enabled() ? VK_TRUE : VK_FALSE; - raster_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO; - - if (device_locked_ptr->is_extension_enabled(VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME) ) + { + VkPipelineRasterizationStateCreateInfo raster_state_create_info; + + raster_state_create_info.cullMode = cull_mode; + raster_state_create_info.depthBiasClamp = depth_bias_clamp; + raster_state_create_info.depthBiasConstantFactor = depth_bias_constant_factor; + raster_state_create_info.depthBiasEnable = is_depth_bias_enabled ? VK_TRUE : VK_FALSE; + raster_state_create_info.depthBiasSlopeFactor = depth_bias_slope_factor; + raster_state_create_info.depthClampEnable = current_pipeline_info_ptr->is_depth_clamp_enabled() ? VK_TRUE : VK_FALSE; + raster_state_create_info.flags = 0; + raster_state_create_info.frontFace = front_face; + raster_state_create_info.lineWidth = line_width; + raster_state_create_info.pNext = nullptr; + raster_state_create_info.polygonMode = polygon_mode; + raster_state_create_info.rasterizerDiscardEnable = current_pipeline_info_ptr->is_rasterizer_discard_enabled() ? VK_TRUE : VK_FALSE; + raster_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO; + + raster_state_create_info_chainer.append_struct(raster_state_create_info); + } + + if (m_device_ptr->is_extension_enabled(VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME) ) { /* Chain a predefined struct which will toggle the relaxed rasterization, as long as the device supports the * VK_AMD_rasterization_order extension. */ - const VkPipelineRasterizationStateRasterizationOrderAMD* chained_item_ptr = nullptr; - if (current_pipeline_info_ptr->get_rasterization_order() != VK_RASTERIZATION_ORDER_STRICT_AMD) { anvil_assert(current_pipeline_info_ptr->get_rasterization_order() == relaxed_rasterization_order_item.rasterizationOrder); - chained_item_ptr = &relaxed_rasterization_order_item; + raster_state_create_info_chainer.append_struct(relaxed_rasterization_order_item); } else { - chained_item_ptr = &strict_rasterization_order_item; + raster_state_create_info_chainer.append_struct(strict_rasterization_order_item); } - - raster_state_create_info.pNext = chained_item_ptr; } else if (current_pipeline_info_ptr->get_rasterization_order() != VK_RASTERIZATION_ORDER_STRICT_AMD) @@ -582,7 +584,9 @@ bool Anvil::GraphicsPipelineManager::bake() "[!] Cannot enable out-of-order rasterization - VK_AMD_rasterization_order extension not enabled at device creation time\n"); } - raster_state_create_info_items_vk_cache.push_back(raster_state_create_info); + raster_state_create_info_chains_vk_cache.push_back( + raster_state_create_info_chainer.create_chain() + ); } /* Form stage descriptors */ @@ -606,10 +610,10 @@ bool Anvil::GraphicsPipelineManager::bake() if (shader_stage_entry_point_ptr != nullptr) { - VkPipelineShaderStageCreateInfo current_shader_stage_create_info; - const unsigned char* current_shader_stage_specialization_constants_data_buffer_ptr = nullptr; - const SpecializationConstants* current_shader_stage_specialization_constants_ptr = nullptr; - std::shared_ptr shader_module_ptr; + VkPipelineShaderStageCreateInfo current_shader_stage_create_info; + const unsigned char* current_shader_stage_specialization_constants_data_buffer_ptr = nullptr; + const SpecializationConstants* current_shader_stage_specialization_constants_ptr = nullptr; + Anvil::ShaderModule* shader_module_ptr = nullptr; specialization_info_vk_cache.push_back(VkSpecializationInfo() ); @@ -844,91 +848,100 @@ bool Anvil::GraphicsPipelineManager::bake() viewport_state_used = false; } - /* Configure base pipeline handle/indices fields of the create info descriptor */ - const auto current_pipeline_base_pipeline_id = current_pipeline_info_ptr->get_base_pipeline_id(); - - if (current_pipeline_base_pipeline_id != UINT32_MAX) + /* Bake the GFX pipeline info struct chain */ { - /* There are three cases we need to handle separately here: - * - * 1. The base pipeline is to be baked in the call we're preparing for. Determine - * its index in the create info descriptor array and use it. - * 2. The pipeline has been baked earlier. Pass the baked pipeline's handle. - * 3. The pipeline under specified index uses a different layout. This indicates - * a bug in the app or the manager. - * - * NOTE: A slightly adjusted version of this code is re-used in ComputePipelineManager::bake() - */ - auto base_bake_item_iterator = std::find(bake_items.begin(), - bake_items.end(), - current_pipeline_base_pipeline_id); - - if (base_bake_item_iterator != bake_items.end() ) + VkGraphicsPipelineCreateInfo graphics_pipeline_create_info = {}; + + /* Configure base pipeline handle/indices fields of the create info descriptor */ + const auto current_pipeline_base_pipeline_id = current_pipeline_info_ptr->get_base_pipeline_id(); + + if (current_pipeline_base_pipeline_id != UINT32_MAX) { - /* Case 1 */ - graphics_pipeline_create_info.basePipelineHandle = VK_NULL_HANDLE; - graphics_pipeline_create_info.basePipelineIndex = static_cast(base_bake_item_iterator - bake_items.begin() ); + /* There are three cases we need to handle separately here: + * + * 1. The base pipeline is to be baked in the call we're preparing for. Determine + * its index in the create info descriptor array and use it. + * 2. The pipeline has been baked earlier. Pass the baked pipeline's handle. + * 3. The pipeline under specified index uses a different layout. This indicates + * a bug in the app or the manager. + * + * NOTE: A slightly adjusted version of this code is re-used in ComputePipelineManager::bake() + */ + auto base_bake_item_iterator = std::find(bake_items.begin(), + bake_items.end(), + current_pipeline_base_pipeline_id); + + if (base_bake_item_iterator != bake_items.end() ) + { + /* Case 1 */ + graphics_pipeline_create_info.basePipelineHandle = VK_NULL_HANDLE; + graphics_pipeline_create_info.basePipelineIndex = static_cast(base_bake_item_iterator - bake_items.begin() ); + } + else + if (base_bake_item_iterator->pipeline_ptr != nullptr && + base_bake_item_iterator->pipeline_ptr->baked_pipeline != VK_NULL_HANDLE) + { + /* Case 2 */ + graphics_pipeline_create_info.basePipelineHandle = base_bake_item_iterator->pipeline_ptr->baked_pipeline; + graphics_pipeline_create_info.basePipelineIndex = UINT32_MAX; + } + else + { + /* Case 3 */ + anvil_assert_fail(); + } } else - if (base_bake_item_iterator->pipeline_ptr != nullptr && - base_bake_item_iterator->pipeline_ptr->baked_pipeline != VK_NULL_HANDLE) { - /* Case 2 */ - graphics_pipeline_create_info.basePipelineHandle = base_bake_item_iterator->pipeline_ptr->baked_pipeline; + /* No base pipeline requested */ + graphics_pipeline_create_info.basePipelineHandle = VK_NULL_HANDLE; graphics_pipeline_create_info.basePipelineIndex = UINT32_MAX; } - else + + /* Form the rest of the create info descriptor */ + anvil_assert(current_pipeline_ptr->layout_ptr != nullptr); + + graphics_pipeline_create_info.flags = 0; + graphics_pipeline_create_info.layout = current_pipeline_ptr->layout_ptr->get_pipeline_layout(); + graphics_pipeline_create_info.pColorBlendState = (color_blend_state_used) ? &color_blend_state_create_info_items_vk_cache[color_blend_state_create_info_items_vk_cache.size() - 1] + : VK_NULL_HANDLE; + graphics_pipeline_create_info.pDepthStencilState = (depth_stencil_state_used) ? &depth_stencil_state_create_info_items_vk_cache[depth_stencil_state_create_info_items_vk_cache.size() - 1] + : VK_NULL_HANDLE; + graphics_pipeline_create_info.pDynamicState = (dynamic_state_used) ? &dynamic_state_create_info_items_vk_cache[dynamic_state_create_info_items_vk_cache.size() - 1] + : VK_NULL_HANDLE; + graphics_pipeline_create_info.pInputAssemblyState = &input_assembly_state_create_info_items_vk_cache[input_assembly_state_create_info_items_vk_cache.size() - 1]; + graphics_pipeline_create_info.pMultisampleState = (multisample_state_used) ? &multisample_state_create_info_items_vk_cache[multisample_state_create_info_items_vk_cache.size() - 1] + : VK_NULL_HANDLE; + graphics_pipeline_create_info.pNext = nullptr; + graphics_pipeline_create_info.pRasterizationState = raster_state_create_info_chains_vk_cache.at(raster_state_create_info_chains_vk_cache.size() - 1)->root_struct_ptr; + graphics_pipeline_create_info.pStages = (shader_stage_start_offset < shader_stage_create_info_items_vk_cache.size() ) ? &shader_stage_create_info_items_vk_cache[shader_stage_start_offset] + : nullptr; + graphics_pipeline_create_info.pTessellationState = (tessellation_state_used) ? &tessellation_state_create_info_items_vk_cache[tessellation_state_create_info_items_vk_cache.size() - 1] + : VK_NULL_HANDLE; + graphics_pipeline_create_info.pVertexInputState = &vertex_input_state_create_info_items_vk_cache[vertex_input_state_create_info_items_vk_cache.size() - 1]; + graphics_pipeline_create_info.pViewportState = (viewport_state_used) ? &viewport_state_create_info_items_vk_cache[viewport_state_create_info_items_vk_cache.size() - 1] + : VK_NULL_HANDLE; + graphics_pipeline_create_info.renderPass = current_pipeline_info_ptr->get_renderpass()->get_render_pass(); + graphics_pipeline_create_info.stageCount = static_cast(shader_stage_create_info_items_vk_cache.size() - shader_stage_start_offset); + graphics_pipeline_create_info.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO; + graphics_pipeline_create_info.subpass = current_pipeline_info_ptr->get_subpass_id(); + + if (graphics_pipeline_create_info.basePipelineIndex != static_cast(UINT32_MAX) ) { - /* Case 3 */ - anvil_assert_fail(); + graphics_pipeline_create_info.flags |= VK_PIPELINE_CREATE_DERIVATIVE_BIT; } - } - else - { - /* No base pipeline requested */ - graphics_pipeline_create_info.basePipelineHandle = VK_NULL_HANDLE; - graphics_pipeline_create_info.basePipelineIndex = UINT32_MAX; - } - /* Form the rest of the create info descriptor */ - anvil_assert(current_pipeline_ptr->layout_ptr != nullptr); - - graphics_pipeline_create_info.flags = 0; - graphics_pipeline_create_info.layout = current_pipeline_ptr->layout_ptr->get_pipeline_layout(); - graphics_pipeline_create_info.pColorBlendState = (color_blend_state_used) ? &color_blend_state_create_info_items_vk_cache[color_blend_state_create_info_items_vk_cache.size() - 1] - : VK_NULL_HANDLE; - graphics_pipeline_create_info.pDepthStencilState = (depth_stencil_state_used) ? &depth_stencil_state_create_info_items_vk_cache[depth_stencil_state_create_info_items_vk_cache.size() - 1] - : VK_NULL_HANDLE; - graphics_pipeline_create_info.pDynamicState = (dynamic_state_used) ? &dynamic_state_create_info_items_vk_cache[dynamic_state_create_info_items_vk_cache.size() - 1] - : VK_NULL_HANDLE; - graphics_pipeline_create_info.pInputAssemblyState = &input_assembly_state_create_info_items_vk_cache[input_assembly_state_create_info_items_vk_cache.size() - 1]; - graphics_pipeline_create_info.pMultisampleState = (multisample_state_used) ? &multisample_state_create_info_items_vk_cache[multisample_state_create_info_items_vk_cache.size() - 1] - : VK_NULL_HANDLE; - graphics_pipeline_create_info.pNext = nullptr; - graphics_pipeline_create_info.pRasterizationState = &raster_state_create_info_items_vk_cache[raster_state_create_info_items_vk_cache.size() - 1]; - graphics_pipeline_create_info.pStages = (shader_stage_start_offset < shader_stage_create_info_items_vk_cache.size() ) ? &shader_stage_create_info_items_vk_cache[shader_stage_start_offset] - : nullptr; - graphics_pipeline_create_info.pTessellationState = (tessellation_state_used) ? &tessellation_state_create_info_items_vk_cache[tessellation_state_create_info_items_vk_cache.size() - 1] - : VK_NULL_HANDLE; - graphics_pipeline_create_info.pVertexInputState = &vertex_input_state_create_info_items_vk_cache[vertex_input_state_create_info_items_vk_cache.size() - 1]; - graphics_pipeline_create_info.pViewportState = (viewport_state_used) ? &viewport_state_create_info_items_vk_cache[viewport_state_create_info_items_vk_cache.size() - 1] - : VK_NULL_HANDLE; - graphics_pipeline_create_info.renderPass = current_pipeline_info_ptr->get_renderpass()->get_render_pass(); - graphics_pipeline_create_info.stageCount = static_cast(shader_stage_create_info_items_vk_cache.size() - shader_stage_start_offset); - graphics_pipeline_create_info.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO; - graphics_pipeline_create_info.subpass = current_pipeline_info_ptr->get_subpass_id(); - - if (graphics_pipeline_create_info.basePipelineIndex != static_cast(UINT32_MAX) ) - { - graphics_pipeline_create_info.flags |= VK_PIPELINE_CREATE_DERIVATIVE_BIT; - } + graphics_pipeline_create_info.flags |= ((current_pipeline_info_ptr->allows_derivatives () ) ? VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT : 0) | + ((current_pipeline_info_ptr->has_optimizations_disabled() ) ? VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT : 0); - graphics_pipeline_create_info.flags |= ((current_pipeline_info_ptr->allows_derivatives () ) ? VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT : 0) | - ((current_pipeline_info_ptr->has_optimizations_disabled() ) ? VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT : 0); + graphics_pipeline_create_info_chainer.append_struct(graphics_pipeline_create_info); + } /* Stash the descriptor for now. We will issue one expensive vkCreateGraphicsPipelines() call after all pipeline objects * are iterated over. */ - graphics_pipeline_create_info_items_vk_cache.push_back(graphics_pipeline_create_info); + graphics_pipeline_create_info_chains.append_struct_chain( + std::move(graphics_pipeline_create_info_chainer.create_chain() ) + ); } #ifdef _DEBUG @@ -944,10 +957,9 @@ bool Anvil::GraphicsPipelineManager::bake() anvil_assert(depth_stencil_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(dynamic_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(enabled_dynamic_states_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(graphics_pipeline_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(input_assembly_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(multisample_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(raster_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); + anvil_assert(raster_state_create_info_chains_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(scissor_boxes_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(shader_stage_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(specialization_info_vk_cache.size() <= N_CACHE_ITEMS); @@ -964,10 +976,10 @@ bool Anvil::GraphicsPipelineManager::bake() m_pipeline_cache_ptr->lock(); { - result_vk = vkCreateGraphicsPipelines(device_locked_ptr->get_device_vk(), + result_vk = vkCreateGraphicsPipelines(m_device_ptr->get_device_vk(), m_pipeline_cache_ptr->get_pipeline_cache(), - static_cast(graphics_pipeline_create_info_items_vk_cache.size() ), - &graphics_pipeline_create_info_items_vk_cache[0], + graphics_pipeline_create_info_chains.get_n_structs (), + graphics_pipeline_create_info_chains.get_root_structs(), nullptr, /* pAllocator */ &result_graphics_pipelines[0]); } @@ -1003,6 +1015,36 @@ bool Anvil::GraphicsPipelineManager::bake() return result; } +/* Please see header for specification */ +bool Anvil::GraphicsPipelineManager::delete_pipeline(PipelineID in_pipeline_id) +{ + bool result; + + lock(); + { + result = BasePipelineManager::delete_pipeline(in_pipeline_id); + + if (result) + { + auto baked_pipelines_iterator = m_baked_pipelines.find (in_pipeline_id); + auto pipeline_id_to_gfx_pipeline_data_iterator = m_pipeline_id_to_gfx_pipeline_data.find(in_pipeline_id); + + if (baked_pipelines_iterator != m_baked_pipelines.end() ) + { + m_baked_pipelines.erase(baked_pipelines_iterator); + } + + if (pipeline_id_to_gfx_pipeline_data_iterator != m_pipeline_id_to_gfx_pipeline_data.end() ) + { + m_pipeline_id_to_gfx_pipeline_data.erase(pipeline_id_to_gfx_pipeline_data_iterator); + } + } + } + unlock(); + + return result; +} + /** Converts the internal vertex attribute descriptors to one or more VkVertexInputAttributeDescription & VkVertexInputBindingDescription * structures. * @@ -1105,12 +1147,13 @@ void Anvil::GraphicsPipelineManager::GraphicsPipelineData::bake_vk_attributes_an } /* Please see header for specification */ -std::shared_ptr Anvil::GraphicsPipelineManager::create(std::weak_ptr in_device_ptr, - bool in_mt_safe, - bool in_use_pipeline_cache, - std::shared_ptr in_pipeline_cache_to_reuse_ptr) +Anvil::GraphicsPipelineManagerUniquePtr Anvil::GraphicsPipelineManager::create(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe, + bool in_use_pipeline_cache, + Anvil::PipelineCache* in_pipeline_cache_to_reuse_ptr) { - std::shared_ptr result_ptr; + GraphicsPipelineManagerUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::GraphicsPipelineManager(in_device_ptr, diff --git a/src/wrappers/image.cpp b/src/wrappers/image.cpp index 578507ed..efb90e98 100644 --- a/src/wrappers/image.cpp +++ b/src/wrappers/image.cpp @@ -23,6 +23,7 @@ #include "misc/debug.h" #include "misc/formats.h" #include "misc/object_tracker.h" +#include "misc/struct_chainer.h" #include "wrappers/buffer.h" #include "wrappers/command_buffer.h" #include "wrappers/command_pool.h" @@ -39,8 +40,12 @@ #undef max #endif +#ifdef min + #undef min +#endif + /* Please see header for specification */ -Anvil::Image::Image(std::weak_ptr in_device_ptr, +Anvil::Image::Image(const Anvil::BaseDevice* in_device_ptr, VkImageType in_type, VkFormat in_format, VkImageTiling in_tiling, @@ -61,7 +66,7 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, DebugMarkerSupportProvider (in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT), MTSafetySupportProvider (in_mt_safe), - m_alignment (0), + m_alignment (UINT64_MAX), m_create_flags (in_create_flags), m_depth (in_base_mipmap_depth), m_device_ptr (in_device_ptr), @@ -72,6 +77,7 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, m_image_owner (true), m_is_sparse (false), m_is_swapchain_image (false), + m_memory_set_by_world (true), m_memory_types (0), m_n_mipmaps (0), m_n_layers (in_n_layers), @@ -83,12 +89,12 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, m_sharing_mode (in_sharing_mode), m_storage_size (0), m_swapchain_memory_assigned (false), + m_swapchain_ptr (nullptr), m_tiling (in_tiling), m_type (in_type), m_usage (static_cast(in_usage)), m_uses_full_mipmap_chain (in_use_full_mipmap_chain), - m_width (in_base_mipmap_width), - m_memory_owner (false) + m_width (in_base_mipmap_width) { if (in_opt_mipmaps_ptr != nullptr) { @@ -102,7 +108,7 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, } /* Please see header for specification */ -Anvil::Image::Image(std::weak_ptr in_device_ptr, +Anvil::Image::Image(const Anvil::BaseDevice* in_device_ptr, VkImageType in_type, VkFormat in_format, VkImageTiling in_tiling, @@ -123,7 +129,7 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, DebugMarkerSupportProvider (in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT), MTSafetySupportProvider (in_mt_safe), - m_alignment (0), + m_alignment (UINT64_MAX), m_create_flags (in_create_flags), m_depth (in_base_mipmap_depth), m_device_ptr (in_device_ptr), @@ -134,7 +140,7 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, m_image_owner (true), m_is_sparse (false), m_is_swapchain_image (false), - m_memory_owner (true), + m_memory_set_by_world (false), m_memory_types (0), m_n_layers (in_n_layers), m_n_mipmaps (0), @@ -146,6 +152,7 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, m_sharing_mode (in_sharing_mode), m_storage_size (0), m_swapchain_memory_assigned (false), + m_swapchain_ptr (nullptr), m_tiling (in_tiling), m_type (in_type), m_usage (static_cast(in_usage)), @@ -163,27 +170,27 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, } /* Please see header for specification */ -Anvil::Image::Image(std::weak_ptr in_device_ptr, - VkImage in_image, - VkFormat in_format, - VkImageTiling in_tiling, - VkSharingMode in_sharing_mode, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - uint32_t in_n_mipmaps, - VkSampleCountFlagBits in_sample_count, - uint32_t in_n_slices, - Anvil::ImageCreateFlags in_create_flags, - Anvil::QueueFamilyBits in_queue_families, - bool in_mt_safe) +Anvil::Image::Image(const Anvil::BaseDevice* in_device_ptr, + VkImage in_image, + VkFormat in_format, + VkImageTiling in_tiling, + VkSharingMode in_sharing_mode, + VkImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + uint32_t in_n_mipmaps, + VkSampleCountFlagBits in_sample_count, + uint32_t in_n_slices, + Anvil::ImageCreateFlags in_create_flags, + Anvil::QueueFamilyBits in_queue_families, + bool in_mt_safe) :CallbacksSupportProvider (IMAGE_CALLBACK_ID_COUNT), DebugMarkerSupportProvider (in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT), MTSafetySupportProvider (in_mt_safe), - m_alignment (0), + m_alignment (UINT64_MAX), m_create_flags (in_create_flags), m_depth (in_base_mipmap_depth), m_device_ptr (in_device_ptr), @@ -194,8 +201,8 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, m_image_owner (false), m_is_sparse (false), m_is_swapchain_image (false), - m_memory_owner (false), - m_memory_types (UINT32_MAX), + m_memory_set_by_world (false), + m_memory_types (0), m_n_layers (in_n_layers), m_n_mipmaps (in_n_mipmaps), m_n_slices (in_n_slices), @@ -204,8 +211,9 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, m_residency_scope (Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED), m_sample_count (in_sample_count), m_sharing_mode (in_sharing_mode), - m_storage_size (UINT64_MAX), + m_storage_size (0), m_swapchain_memory_assigned (false), + m_swapchain_ptr (nullptr), m_tiling (in_tiling), m_type (VK_IMAGE_TYPE_MAX_ENUM), m_usage (static_cast(in_usage)), @@ -218,27 +226,27 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, } /** Please see header for specification */ -Anvil::Image::Image(std::weak_ptr in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - Anvil::ImageCreateFlags in_create_flags, - Anvil::SparseResidencyScope in_residency_scope, - bool in_mt_safe) +Anvil::Image::Image(const Anvil::BaseDevice* in_device_ptr, + VkImageType in_type, + VkFormat in_format, + VkImageTiling in_tiling, + VkImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + VkSampleCountFlagBits in_sample_count, + Anvil::QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + bool in_use_full_mipmap_chain, + Anvil::ImageCreateFlags in_create_flags, + Anvil::SparseResidencyScope in_residency_scope, + bool in_mt_safe) :CallbacksSupportProvider (IMAGE_CALLBACK_ID_COUNT), DebugMarkerSupportProvider (in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT), MTSafetySupportProvider (in_mt_safe), - m_alignment (0), + m_alignment (UINT64_MAX), m_create_flags (in_create_flags), m_depth (in_base_mipmap_depth), m_device_ptr (in_device_ptr), @@ -249,8 +257,8 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, m_image_owner (true), m_is_sparse (true), m_is_swapchain_image (false), - m_memory_owner (false), - m_memory_types (UINT32_MAX), + m_memory_set_by_world (true), + m_memory_types (0), m_n_layers (in_n_layers), m_n_mipmaps (0), m_n_slices (0), @@ -259,8 +267,9 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, m_residency_scope (in_residency_scope), m_sample_count (in_sample_count), m_sharing_mode (in_sharing_mode), - m_storage_size (UINT64_MAX), + m_storage_size (0), m_swapchain_memory_assigned (false), + m_swapchain_ptr (nullptr), m_tiling (in_tiling), m_type (in_type), m_usage (static_cast(in_usage)), @@ -273,32 +282,29 @@ Anvil::Image::Image(std::weak_ptr in_device_ptr, } /** Please see header for specification */ -void Anvil::Image::change_image_layout(std::shared_ptr in_queue_ptr, - VkAccessFlags in_src_access_mask, - VkImageLayout in_src_layout, - VkAccessFlags in_dst_access_mask, - VkImageLayout in_dst_layout, - const VkImageSubresourceRange& in_subresource_range, - const uint32_t in_opt_n_wait_semaphores, - const VkPipelineStageFlags* in_opt_wait_dst_stage_mask_ptrs, - const std::shared_ptr* in_opt_wait_semaphore_ptrs, - const uint32_t in_opt_n_set_semaphores, - const std::shared_ptr* in_opt_set_semaphore_ptrs) +void Anvil::Image::change_image_layout(Anvil::Queue* in_queue_ptr, + VkAccessFlags in_src_access_mask, + VkImageLayout in_src_layout, + VkAccessFlags in_dst_access_mask, + VkImageLayout in_dst_layout, + const VkImageSubresourceRange& in_subresource_range, + const uint32_t in_opt_n_wait_semaphores, + const VkPipelineStageFlags* in_opt_wait_dst_stage_mask_ptrs, + Anvil::Semaphore* const* in_opt_wait_semaphore_ptrs, + const uint32_t in_opt_n_set_semaphores, + Anvil::Semaphore* const* in_opt_set_semaphore_ptrs) { - std::shared_ptr device_locked_ptr (m_device_ptr); - const Anvil::DeviceType device_type (device_locked_ptr->get_type() ); - Anvil::QueueFamilyType in_queue_family_type (Anvil::QUEUE_FAMILY_TYPE_UNDEFINED); - const uint32_t in_queue_family_index (in_queue_ptr->get_queue_family_index() ); - auto mem_block_ptr (get_memory_block() ); - std::shared_ptr transition_command_buffer_ptr; + const Anvil::DeviceType device_type (m_device_ptr->get_type() ); + const uint32_t in_queue_family_index (in_queue_ptr->get_queue_family_index() ); + auto mem_block_ptr (get_memory_block() ); + Anvil::PrimaryCommandBufferUniquePtr transition_command_buffer_ptr; /* mem_block_ptr is only used here in order to trigger memory allocator bakes if there are any pending. Other than that, * we are not going to be accessing it in this func. */ ANVIL_REDUNDANT_VARIABLE(mem_block_ptr); - in_queue_family_type = device_locked_ptr->get_queue_family_type(in_queue_ptr->get_queue_family_index() ); - transition_command_buffer_ptr = device_locked_ptr->get_command_pool (in_queue_family_type)->alloc_primary_level_command_buffer(); + transition_command_buffer_ptr = m_device_ptr->get_command_pool_for_queue_family_index(in_queue_ptr->get_queue_family_index())->alloc_primary_level_command_buffer(); transition_command_buffer_ptr->start_recording(true, /* one_time_submit */ false); /* simultaneous_use_allowed */ @@ -310,7 +316,7 @@ void Anvil::Image::change_image_layout(std::shared_ptr in_dst_layout, (m_sharing_mode == VK_SHARING_MODE_CONCURRENT) ? VK_QUEUE_FAMILY_IGNORED : in_queue_family_index, (m_sharing_mode == VK_SHARING_MODE_CONCURRENT) ? VK_QUEUE_FAMILY_IGNORED : in_queue_family_index, - shared_from_this(), + this, in_subresource_range); transition_command_buffer_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, @@ -327,7 +333,7 @@ void Anvil::Image::change_image_layout(std::shared_ptr if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) { - in_queue_ptr->submit_command_buffer_with_signal_wait_semaphores(transition_command_buffer_ptr, + in_queue_ptr->submit_command_buffer_with_signal_wait_semaphores(transition_command_buffer_ptr.get(), in_opt_n_set_semaphores, in_opt_set_semaphore_ptrs, in_opt_n_wait_semaphores, @@ -335,35 +341,36 @@ void Anvil::Image::change_image_layout(std::shared_ptr in_opt_wait_dst_stage_mask_ptrs, true /* should_block */); } - else - { - anvil_assert_fail(); - } } /** Please see header for specification */ -std::shared_ptr Anvil::Image::create_nonsparse(std::weak_ptr in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - ImageCreateFlags in_create_flags, - VkImageLayout in_post_create_image_layout, - const std::vector* in_opt_mipmaps_ptr, - MTSafety in_mt_safety) +Anvil::ImageUniquePtr Anvil::Image::create_nonsparse(const Anvil::BaseDevice* in_device_ptr, + VkImageType in_type, + VkFormat in_format, + VkImageTiling in_tiling, + VkImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + VkSampleCountFlagBits in_sample_count, + Anvil::QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + bool in_use_full_mipmap_chain, + ImageCreateFlags in_create_flags, + VkImageLayout in_post_create_image_layout, + const std::vector* in_opt_mipmaps_ptr, + MTSafety in_mt_safety) { const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, in_device_ptr); - std::shared_ptr result_ptr( + if (in_opt_mipmaps_ptr != nullptr) + { + in_usage |= VK_IMAGE_USAGE_TRANSFER_DST_BIT; + } + + ImageUniquePtr result_ptr( new Image(in_device_ptr, in_type, in_format, @@ -380,7 +387,8 @@ std::shared_ptr Anvil::Image::create_nonsparse(std::weak_ptr() ); result_ptr->init(in_use_full_mipmap_chain, @@ -391,31 +399,36 @@ std::shared_ptr Anvil::Image::create_nonsparse(std::weak_ptr Anvil::Image::create_nonsparse(std::weak_ptr in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - MemoryFeatureFlags in_memory_features, - ImageCreateFlags in_create_flags, - VkImageLayout in_post_create_image_layout, - const std::vector* in_mipmaps_ptr, - MTSafety in_mt_safety) +Anvil::ImageUniquePtr Anvil::Image::create_nonsparse(const Anvil::BaseDevice* in_device_ptr, + VkImageType in_type, + VkFormat in_format, + VkImageTiling in_tiling, + VkImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + VkSampleCountFlagBits in_sample_count, + Anvil::QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + bool in_use_full_mipmap_chain, + MemoryFeatureFlags in_memory_features, + ImageCreateFlags in_create_flags, + VkImageLayout in_post_create_image_layout, + const std::vector* in_mipmaps_ptr, + MTSafety in_mt_safety) { const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, in_device_ptr); const VkImageLayout start_image_layout = (in_mipmaps_ptr != nullptr && in_mipmaps_ptr->size() > 0) ? VK_IMAGE_LAYOUT_PREINITIALIZED : VK_IMAGE_LAYOUT_UNDEFINED; - std::shared_ptr new_image_ptr( + if (in_mipmaps_ptr != nullptr) + { + in_usage |= VK_IMAGE_USAGE_TRANSFER_DST_BIT; + } + + ImageUniquePtr new_image_ptr( new Anvil::Image(in_device_ptr, in_type, in_format, @@ -432,7 +445,8 @@ std::shared_ptr Anvil::Image::create_nonsparse(std::weak_ptr() ); new_image_ptr->init(in_use_full_mipmap_chain, @@ -443,16 +457,15 @@ std::shared_ptr Anvil::Image::create_nonsparse(std::weak_ptr Anvil::Image::create_nonsparse(std::weak_ptr in_device_ptr, - const VkSwapchainCreateInfoKHR& in_swapchain_create_info, - VkImage in_image, - MTSafety in_mt_safety) +Anvil::ImageUniquePtr Anvil::Image::create_nonsparse(const Anvil::BaseDevice* in_device_ptr, + const VkSwapchainCreateInfoKHR& in_swapchain_create_info, + VkImage in_image, + MTSafety in_mt_safety) { - std::shared_ptr device_locked_ptr(in_device_ptr); - const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); + const bool mt_safe(Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); - std::shared_ptr new_image_ptr( + ImageUniquePtr new_image_ptr( new Anvil::Image(in_device_ptr, in_image, in_swapchain_create_info.imageFormat, @@ -465,10 +478,11 @@ std::shared_ptr Anvil::Image::create_nonsparse(std::weak_ptr() ); new_image_ptr->m_memory_types = 0; @@ -482,37 +496,37 @@ std::shared_ptr Anvil::Image::create_nonsparse(std::weak_ptr Anvil::Image::create_sparse(std::weak_ptr in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - ImageCreateFlags in_create_flags, - Anvil::SparseResidencyScope in_residency_scope, - VkImageLayout in_initial_layout, - MTSafety in_mt_safety) +Anvil::ImageUniquePtr Anvil::Image::create_sparse(const Anvil::BaseDevice* in_device_ptr, + VkImageType in_type, + VkFormat in_format, + VkImageTiling in_tiling, + VkImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + VkSampleCountFlagBits in_sample_count, + Anvil::QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + bool in_use_full_mipmap_chain, + ImageCreateFlags in_create_flags, + Anvil::SparseResidencyScope in_residency_scope, + VkImageLayout in_initial_layout, + MTSafety in_mt_safety) { - std::shared_ptr device_locked_ptr(in_device_ptr); - const VkPhysicalDeviceFeatures& features (device_locked_ptr->get_physical_device_features() ); - const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); - std::shared_ptr result_ptr; + const auto& features (in_device_ptr->get_physical_device_features() ); + const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); + ImageUniquePtr result_ptr(nullptr, + std::default_delete() ); anvil_assert(in_initial_layout == VK_IMAGE_LAYOUT_PREINITIALIZED || in_initial_layout == VK_IMAGE_LAYOUT_UNDEFINED); /* Make sure requested functionality is supported by the device */ - if (!features.sparseBinding) + if (!features.core_vk1_0_features_ptr->sparse_binding) { - anvil_assert(features.sparseBinding); + anvil_assert(features.core_vk1_0_features_ptr->sparse_binding); goto end; } @@ -522,12 +536,12 @@ std::shared_ptr Anvil::Image::create_sparse(std::weak_ptr result_properties; - device_locked_ptr->get_physical_device_sparse_image_format_properties(in_format, - in_type, - in_sample_count, - in_usage, - in_tiling, - result_properties); + in_device_ptr->get_physical_device_sparse_image_format_properties(in_format, + in_type, + in_sample_count, + in_usage, + in_tiling, + result_properties); if (result_properties.size() == 0) { @@ -546,9 +560,9 @@ std::shared_ptr Anvil::Image::create_sparse(std::weak_ptrsparse_residency_image_2D) { - anvil_assert_fail(); + anvil_assert(features.core_vk1_0_features_ptr->sparse_residency_image_2D); goto end; } @@ -558,9 +572,9 @@ std::shared_ptr Anvil::Image::create_sparse(std::weak_ptrsparse_residency_image_3D) { - anvil_assert_fail(); + anvil_assert(features.core_vk1_0_features_ptr->sparse_residency_image_3D); goto end; } @@ -586,9 +600,9 @@ std::shared_ptr Anvil::Image::create_sparse(std::weak_ptrsparse_residency_2_samples) { - anvil_assert(features.sparseResidency2Samples); + anvil_assert(features.core_vk1_0_features_ptr->sparse_residency_2_samples); goto end; } @@ -598,9 +612,9 @@ std::shared_ptr Anvil::Image::create_sparse(std::weak_ptrsparse_residency_4_samples) { - anvil_assert(features.sparseResidency4Samples); + anvil_assert(features.core_vk1_0_features_ptr->sparse_residency_4_samples); goto end; } @@ -610,9 +624,9 @@ std::shared_ptr Anvil::Image::create_sparse(std::weak_ptrsparse_residency_8_samples) { - anvil_assert(features.sparseResidency8Samples); + anvil_assert(features.core_vk1_0_features_ptr->sparse_residency_8_samples); goto end; } @@ -622,9 +636,9 @@ std::shared_ptr Anvil::Image::create_sparse(std::weak_ptrsparse_residency_16_samples) { - anvil_assert(features.sparseResidency16Samples); + anvil_assert(features.core_vk1_0_features_ptr->sparse_residency_16_samples); goto end; } @@ -695,13 +709,13 @@ bool Anvil::Image::get_aspect_subresource_layout(VkImageAspectFlags in_aspect, } /** Please see header for specification */ -std::shared_ptr Anvil::Image::get_memory_block() +Anvil::MemoryBlock* Anvil::Image::get_memory_block() { bool is_callback_needed = false; if (m_is_sparse) { - IsImageMemoryAllocPendingQueryCallbackArgument callback_arg(shared_from_this() ); + IsImageMemoryAllocPendingQueryCallbackArgument callback_arg(this); callback(IMAGE_CALLBACK_ID_IS_ALLOC_PENDING, &callback_arg); @@ -709,14 +723,14 @@ std::shared_ptr Anvil::Image::get_memory_block() is_callback_needed = callback_arg.result; } else - if (m_memory_block_ptr == nullptr) + if (m_memory_blocks_owned.size() == 0) { is_callback_needed = true; } if (is_callback_needed) { - OnMemoryBlockNeededForImageCallbackArgument callback_argument(shared_from_this() ); + OnMemoryBlockNeededForImageCallbackArgument callback_argument(this); callback_safe(IMAGE_CALLBACK_ID_MEMORY_BLOCK_NEEDED, &callback_argument); @@ -738,7 +752,8 @@ std::shared_ptr Anvil::Image::get_memory_block() } else { - return m_memory_block_ptr; + return (m_memory_blocks_owned.size() > 0) ? m_memory_blocks_owned.at(0).get() + : nullptr; } } @@ -750,20 +765,18 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, Anvil::MemoryFeatureFlags in_memory_features, const VkImageLayout* in_start_image_layout_ptr) { - std::vector aspects_used; - std::shared_ptr device_locked_ptr(m_device_ptr); - VkImageFormatProperties image_format_props; - uint32_t max_dimension; - uint32_t n_queue_family_indices = 0; - uint32_t queue_family_indices[3]; - VkResult result (VK_ERROR_INITIALIZATION_FAILED); - bool result_bool(false); + std::vector aspects_used; + VkImageFormatProperties image_format_props; + uint32_t max_dimension; + uint32_t n_queue_family_indices = 0; + uint32_t queue_family_indices[3]; + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + bool result_bool(false); ANVIL_REDUNDANT_VARIABLE(result); ANVIL_REDUNDANT_VARIABLE(result_bool); - if (m_memory_owner && - (in_memory_features & MEMORY_FEATURE_FLAG_MAPPABLE) == 0) + if ((in_memory_features & MEMORY_FEATURE_FLAG_MAPPABLE) == 0) { anvil_assert((in_memory_features & MEMORY_FEATURE_FLAG_HOST_COHERENT) == 0); } @@ -788,35 +801,35 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, &n_queue_family_indices); /* Is the requested texture size valid? */ - result_bool = device_locked_ptr->get_physical_device_image_format_properties(m_format, - m_type, - m_tiling, - m_usage, - 0, /* flags */ - image_format_props); + result_bool = m_device_ptr->get_physical_device_image_format_properties(m_format, + m_type, + m_tiling, + m_usage, + 0, /* flags */ + image_format_props); anvil_assert(result_bool); anvil_assert(m_width >= 1 && m_height >= 1 && m_depth >= 1); - anvil_assert(m_width <= (uint32_t) image_format_props.maxExtent.width); + anvil_assert(m_width <= image_format_props.maxExtent.width); if (m_height > 1) { - anvil_assert(m_height <= (uint32_t) image_format_props.maxExtent.height); + anvil_assert(m_height <= image_format_props.maxExtent.height); } if (m_depth > 1) { - anvil_assert(m_depth <= (uint32_t) image_format_props.maxExtent.depth); + anvil_assert(m_depth <= image_format_props.maxExtent.depth); } anvil_assert(m_n_layers >= 1); if (m_n_layers > 1) { - anvil_assert(m_n_layers <= (uint32_t) image_format_props.maxArrayLayers); + anvil_assert(m_n_layers <= image_format_props.maxArrayLayers); } /* If multisample image is requested, make sure the number of samples is supported. */ @@ -846,7 +859,7 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, if ( (m_create_flags & Anvil::IMAGE_CREATE_FLAG_2D_ARRAY_COMPATIBLE_BIT) != 0) { - anvil_assert(device_locked_ptr->is_khr_maintenance1_extension_enabled() ); + anvil_assert(m_device_ptr->is_khr_maintenance1_extension_enabled() ); anvil_assert(m_type == VK_IMAGE_TYPE_3D); image_flags |= VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR; @@ -888,7 +901,7 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, image_create_info.tiling = m_tiling; image_create_info.usage = m_usage; - result = vkCreateImage(device_locked_ptr->get_device_vk(), + result = vkCreateImage(m_device_ptr->get_device_vk(), &image_create_info, nullptr, /* pAllocator */ &m_image); @@ -905,7 +918,7 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, if (m_swapchain_ptr == nullptr) { /* Extract various image properties we're going to need later */ - vkGetImageMemoryRequirements(device_locked_ptr->get_device_vk(), + vkGetImageMemoryRequirements(m_device_ptr->get_device_vk(), m_image, &m_memory_reqs); @@ -913,14 +926,6 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, m_memory_types = m_memory_reqs.memoryTypeBits; m_storage_size = m_memory_reqs.size; } - else - { - anvil_assert(!m_memory_owner); - - m_alignment = UINT64_MAX; - m_memory_types = 0; - m_storage_size = 0; - } /* Cache aspect subresource properties if we're dealing with a linear image */ if (m_tiling == VK_IMAGE_TILING_LINEAR) @@ -948,7 +953,7 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, subresource.mipLevel = n_mip; - vkGetImageSubresourceLayout(device_locked_ptr->get_device_vk(), + vkGetImageSubresourceLayout(m_device_ptr->get_device_vk(), m_image, &subresource, &subresource_layout); @@ -973,7 +978,7 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, /* Retrieve image aspect properties. Since Vulkan lets a single props structure to refer to more than * just a single aspect, we first cache the exposed info in a vec and then distribute the information to * a map, whose key is allowed to consist of a single bit ( = individual aspect) only */ - vkGetImageSparseMemoryRequirements(device_locked_ptr->get_device_vk(), + vkGetImageSparseMemoryRequirements(m_device_ptr->get_device_vk(), m_image, &n_reqs, nullptr); @@ -982,7 +987,7 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, sparse_image_memory_reqs.resize(n_reqs); - vkGetImageSparseMemoryRequirements(device_locked_ptr->get_device_vk(), + vkGetImageSparseMemoryRequirements(m_device_ptr->get_device_vk(), m_image, &n_reqs, &sparse_image_memory_reqs[0]); @@ -1017,7 +1022,7 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, { Anvil::SparseMemoryBindInfoID metadata_binding_bind_info_id; Anvil::Utils::SparseMemoryBindingUpdateInfo metadata_binding_update; - std::shared_ptr sparse_queue_ptr(device_locked_ptr->get_sparse_binding_queue(0) ); + Anvil::Queue* sparse_queue_ptr(m_device_ptr->get_sparse_binding_queue(0) ); /* TODO: Right now, we only support cases where image uses only one metadata block, no matter how many * layers there are. */ @@ -1027,11 +1032,11 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, * * NOTE: We should use an instance-wide allocator, preferably resizable, for this. */ - m_metadata_memory_block_ptr = Anvil::MemoryBlock::create(m_device_ptr, - m_memory_reqs.memoryTypeBits, - metadata_aspect_iterator->second.mip_tail_size, - 0, /* in_memory_features */ - Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); + auto memory_block_ptr = Anvil::MemoryBlock::create(m_device_ptr, + m_memory_reqs.memoryTypeBits, + metadata_aspect_iterator->second.mip_tail_size, + 0, /* in_memory_features */ + Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); /* Set up bind info update structure. */ metadata_binding_bind_info_id = metadata_binding_update.add_bind_info(0, /* n_signal_semaphores */ @@ -1040,12 +1045,13 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, nullptr); /* opt_wait_semaphores_ptr */ metadata_binding_update.append_opaque_image_memory_update(metadata_binding_bind_info_id, - shared_from_this(), + this, metadata_aspect_iterator->second.mip_tail_offset, metadata_aspect_iterator->second.mip_tail_size, VK_SPARSE_MEMORY_BIND_METADATA_BIT, - m_metadata_memory_block_ptr, - 0); /* opt_memory_block_start_offset */ + memory_block_ptr.release(), + 0, /* opt_memory_block_start_offset */ + true); /* in_opt_memory_block_owned_by_image */ result_bool = sparse_queue_ptr->bind_sparse_memory(metadata_binding_update); anvil_assert(result_bool); @@ -1060,7 +1066,7 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, ); } - if (m_memory_owner) + if (!m_memory_set_by_world) { anvil_assert(!m_is_sparse); @@ -1071,7 +1077,9 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, in_memory_features, Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); - set_memory(memory_block_ptr); + set_memory( + std::move(memory_block_ptr) + ); } } @@ -1081,8 +1089,6 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, **/ void Anvil::Image::init_page_occupancy(const std::vector& in_memory_reqs) { - std::shared_ptr device_locked_ptr(m_device_ptr); - anvil_assert(m_residency_scope != Anvil::SPARSE_RESIDENCY_SCOPE_NONE && m_residency_scope != Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED); @@ -1093,7 +1099,7 @@ void Anvil::Image::init_page_occupancy(const std::vector occupancy_data_ptr; + AspectPageOccupancyData* occupancy_data_ptr = nullptr; for (uint32_t n_aspect_bit = 0; (1u << n_aspect_bit) <= memory_req.formatProperties.aspectMask; @@ -1116,8 +1122,8 @@ void Anvil::Image::init_page_occupancy(const std::vector(new AspectPageOccupancyData() ) ); } @@ -1132,7 +1138,7 @@ void Anvil::Image::init_page_occupancy(const std::vectorfirst; decltype(m_sparse_aspect_props)::const_iterator current_aspect_props_iterator; - std::shared_ptr page_occupancy_ptr = occupancy_iterator->second; + AspectPageOccupancyData* page_occupancy_ptr = occupancy_iterator->second; if (page_occupancy_ptr->layers.size() > 0) { @@ -1226,11 +1232,9 @@ Anvil::Image::~Image() if (m_image != VK_NULL_HANDLE && m_image_owner) { - std::shared_ptr device_locked_ptr(m_device_ptr); - lock(); { - vkDestroyImage(device_locked_ptr->get_device_vk(), + vkDestroyImage(m_device_ptr->get_device_vk(), m_image, nullptr /* pAllocator */); } @@ -1239,8 +1243,6 @@ Anvil::Image::~Image() m_image = VK_NULL_HANDLE; } - m_memory_block_ptr.reset(); - /* Unregister the object */ Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_IMAGE, this); @@ -1251,7 +1253,7 @@ const VkImage& Anvil::Image::get_image() { if (!m_is_sparse) { - if (m_memory_block_ptr == nullptr) + if (m_memory_blocks_owned.size() == 0) { get_memory_block(); } @@ -1382,7 +1384,7 @@ bool Anvil::Image::get_sparse_image_aspect_properties(const VkImageAspectFlagBit } /** TODO */ -VkImageCreateInfo Anvil::Image::get_create_info_for_swapchain(std::shared_ptr in_swapchain_ptr) +VkImageCreateInfo Anvil::Image::get_create_info_for_swapchain(const Anvil::Swapchain* in_swapchain_ptr) { VkImageCreateInfo result; @@ -1653,15 +1655,17 @@ bool Anvil::Image::is_memory_bound_for_texel(VkImageAspectFlagBits in_aspect, /** Updates page tracker (for non-resident images) OR tile-to-block mappings & tail page counteres, * as per the specified opaque image memory update properties. * - * @param in_resource_offset Raw image data offset, from which the update has been performed - * @param in_size Size of the updated region. - * @param in_memory_block_ptr Memory block, bound to the specified region. - * @param in_memory_block_start_offset Start offset relative to @param memory_block_ptr used for the update. + * @param in_resource_offset Raw image data offset, from which the update has been performed + * @param in_size Size of the updated region. + * @param in_memory_block_ptr Memory block, bound to the specified region. + * @param in_memory_block_start_offset Start offset relative to @param memory_block_ptr used for the update. + * @param in_memory_block_owned_by_image TODO **/ -void Anvil::Image::on_memory_backing_opaque_update(VkDeviceSize in_resource_offset, - VkDeviceSize in_size, - std::shared_ptr in_memory_block_ptr, - VkDeviceSize in_memory_block_start_offset) +void Anvil::Image::on_memory_backing_opaque_update(VkDeviceSize in_resource_offset, + VkDeviceSize in_size, + Anvil::MemoryBlock* in_memory_block_ptr, + VkDeviceSize in_memory_block_start_offset, + bool in_memory_block_owned_by_image) { const bool is_unbinding = (in_memory_block_ptr == nullptr); @@ -1703,6 +1707,12 @@ void Anvil::Image::on_memory_backing_opaque_update(VkDeviceSize if (in_resource_offset == metadata_aspect_iterator->second.mip_tail_offset && in_size == metadata_aspect_iterator->second.mip_tail_size) { + anvil_assert(m_metadata_memory_block_ptr == nullptr); + anvil_assert(in_memory_block_owned_by_image); + + m_metadata_memory_block_ptr = MemoryBlockUniquePtr(in_memory_block_ptr, + std::default_delete() ); + return; } else @@ -1794,6 +1804,15 @@ void Anvil::Image::on_memory_backing_opaque_update(VkDeviceSize } } } + + /* PTR_MANAGEMENT: Remove mem blocks no longer referenced by any page / til.e ! */ + if (in_memory_block_owned_by_image) + { + m_memory_blocks_owned.push_back( + Anvil::MemoryBlockUniquePtr(in_memory_block_ptr, + std::default_delete() ) + ); + } } /** Updates page tracker (for non-resident images) OR tile-to-block mappings & tail page counteres, @@ -1805,11 +1824,12 @@ void Anvil::Image::on_memory_backing_opaque_update(VkDeviceSize * @param in_memory_block_ptr Memory block, bound to the specified region. * @param in_memory_block_start_offset Start offset relative to @param memory_block_ptr used for the update. **/ -void Anvil::Image::on_memory_backing_update(const VkImageSubresource& in_subresource, - VkOffset3D in_offset, - VkExtent3D in_extent, - std::shared_ptr in_memory_block_ptr, - VkDeviceSize in_memory_block_start_offset) +void Anvil::Image::on_memory_backing_update(const VkImageSubresource& in_subresource, + VkOffset3D in_offset, + VkExtent3D in_extent, + Anvil::MemoryBlock* in_memory_block_ptr, + VkDeviceSize in_memory_block_start_offset, + bool in_memory_block_owned_by_image) { AspectPageOccupancyLayerData* aspect_layer_ptr; AspectPageOccupancyLayerMipData* aspect_layer_mip_ptr; @@ -1886,38 +1906,54 @@ void Anvil::Image::on_memory_backing_update(const VkImageSubresource& } } } + + if (in_memory_block_owned_by_image) + { + m_memory_blocks_owned.push_back( + MemoryBlockUniquePtr(in_memory_block_ptr, + std::default_delete() ) + ); + } } /* Please see header for specification */ -bool Anvil::Image::set_memory(std::shared_ptr in_memory_block_ptr) +bool Anvil::Image::set_memory(MemoryBlockUniquePtr in_memory_block_ptr) +{ + return set_memory_internal(in_memory_block_ptr.release(), + true); /* in_owned_by_image */ +} + +bool Anvil::Image::set_memory(Anvil::MemoryBlock* in_memory_block_ptr) +{ + return set_memory_internal(in_memory_block_ptr, + false); /* in_owned_by_image */ +} + +bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, + bool in_owned_by_image) { - std::shared_ptr device_locked_ptr(m_device_ptr); - const Anvil::DeviceType device_type (device_locked_ptr->get_type() ); - VkResult result (VK_ERROR_INITIALIZATION_FAILED); + const Anvil::DeviceType device_type(m_device_ptr->get_type() ); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); /* Sanity checks */ - anvil_assert(in_memory_block_ptr != nullptr); + anvil_assert(in_memory_block_ptr != nullptr); anvil_assert(!m_is_sparse); - anvil_assert(m_mipmaps.size() > 0); - anvil_assert(m_memory_block_ptr == nullptr); - anvil_assert(m_swapchain_ptr == nullptr); + anvil_assert(m_mipmaps.size() > 0); + anvil_assert(m_memory_blocks_owned.size() == 0); + anvil_assert(m_swapchain_ptr == nullptr); /* Bind the memory object to the image object */ if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) { lock(); { - result = vkBindImageMemory(device_locked_ptr->get_device_vk(), + result = vkBindImageMemory(m_device_ptr->get_device_vk(), m_image, in_memory_block_ptr->get_memory(), in_memory_block_ptr->get_start_offset() ); } unlock(); } - else - { - anvil_assert_fail(); - } anvil_assert_vk_call_succeeded(result); if (is_vk_call_successful(result) ) @@ -1925,7 +1961,13 @@ bool Anvil::Image::set_memory(std::shared_ptr in_memory_bloc VkImageLayout src_image_layout = (m_tiling == VK_IMAGE_TILING_LINEAR && m_mipmaps_to_upload.size() > 0) ? VK_IMAGE_LAYOUT_PREINITIALIZED : VK_IMAGE_LAYOUT_UNDEFINED; - m_memory_block_ptr = in_memory_block_ptr; + if (in_owned_by_image) + { + m_memory_blocks_owned.push_back( + MemoryBlockUniquePtr(in_memory_block_ptr, + std::default_delete() ) + ); + } /* Fill the storage with mipmap contents, if mipmap data was specified at input */ if (m_mipmaps_to_upload.size() > 0) @@ -1971,11 +2013,9 @@ bool Anvil::Image::set_memory(std::shared_ptr in_memory_bloc void Anvil::Image::transition_to_post_create_image_layout(VkAccessFlags in_source_access_mask, VkImageLayout in_src_layout) { - std::shared_ptr device_locked_ptr(m_device_ptr); - anvil_assert(!m_has_transitioned_to_post_create_layout); - change_image_layout(device_locked_ptr->get_universal_queue(0), + change_image_layout(m_device_ptr->get_universal_queue(0), in_source_access_mask, in_src_layout, Anvil::Utils::get_access_mask_from_image_layout(m_post_create_layout), @@ -1990,16 +2030,14 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p VkImageLayout in_current_image_layout, VkImageLayout* out_new_image_layout_ptr) { - std::shared_ptr device_locked_ptr (m_device_ptr); std::map > image_aspect_to_mipmap_raw_data_map; VkImageAspectFlags image_aspects_touched (0); - std::shared_ptr image_mem_block_ptr; VkImageSubresourceRange image_subresource_range; const VkDeviceSize sparse_page_size ( (m_page_tracker_ptr != nullptr) ? m_page_tracker_ptr->get_page_size() : 0); - const std::shared_ptr universal_queue_ptr (device_locked_ptr->get_universal_queue(0) ); + Anvil::Queue* universal_queue_ptr (m_device_ptr->get_universal_queue(0) ); /* Make sure image has been assigned at least one memory block before we go ahead with the upload process */ - image_mem_block_ptr = get_memory_block(); + get_memory_block(); /* Each image aspect needs to be modified separately. Iterate over the input vector and move MipmapRawData * to separate vectors corresponding to which aspect they need to update. */ @@ -2064,7 +2102,7 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p image_subresource.aspectMask = current_aspect; image_subresource.mipLevel = current_mipmap_raw_data_item_ptr->n_mipmap; - vkGetImageSubresourceLayout(device_locked_ptr->get_device_vk(), + vkGetImageSubresourceLayout(m_device_ptr->get_device_vk(), m_image, &image_subresource, &image_subresource_layout); @@ -2104,12 +2142,14 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p n_row < current_mipmap_height; ++n_row, dst_slice_offset += image_subresource_layout.rowPitch) { - std::shared_ptr mem_block_ptr; - VkDeviceSize write_dst_slice_offset = dst_slice_offset; + Anvil::MemoryBlock* mem_block_ptr = nullptr; + VkDeviceSize write_dst_slice_offset = dst_slice_offset; if (!m_is_sparse) { - mem_block_ptr = m_memory_block_ptr; + anvil_assert(m_memory_blocks_owned.size() == 1); + + mem_block_ptr = m_memory_blocks_owned.at(0).get(); } else if (m_residency_scope == SPARSE_RESIDENCY_SCOPE_NONE) @@ -2133,6 +2173,8 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p sparse_page_size, &dummy); + ANVIL_REDUNDANT_VARIABLE(mem_block2_ptr); + // todo: the slice spans across >1 memory blocks. need more than just one write op to handle this case correctly. anvil_assert(mem_block2_ptr == mem_block_ptr); } @@ -2159,9 +2201,9 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p { anvil_assert(m_tiling == VK_IMAGE_TILING_OPTIMAL); - std::shared_ptr temp_buffer_ptr; - std::shared_ptr temp_cmdbuf_ptr; - VkDeviceSize total_raw_mips_size = 0; + Anvil::BufferUniquePtr temp_buffer_ptr; + Anvil::PrimaryCommandBufferUniquePtr temp_cmdbuf_ptr; + VkDeviceSize total_raw_mips_size = 0; /* Count how much space all specified mipmaps take in raw format. */ for (auto mipmap_iterator = in_mipmaps_ptr->cbegin(); @@ -2233,7 +2275,7 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p merged_mip_storage.reset(); /* Set up a command buffer we will use to copy the data to the image */ - temp_cmdbuf_ptr = device_locked_ptr->get_command_pool(Anvil::QUEUE_FAMILY_TYPE_UNIVERSAL)->alloc_primary_level_command_buffer(); + temp_cmdbuf_ptr = m_device_ptr->get_command_pool_for_queue_family_index(universal_queue_ptr->get_queue_family_index() )->alloc_primary_level_command_buffer(); anvil_assert(temp_cmdbuf_ptr != nullptr); temp_cmdbuf_ptr->start_recording(true, /* one_time_submit */ @@ -2246,14 +2288,14 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p in_current_image_layout != VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL) { Anvil::ImageBarrier image_barrier(0, /* source_access_mask */ - VK_ACCESS_TRANSFER_WRITE_BIT, - false, - in_current_image_layout, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, - (m_sharing_mode == VK_SHARING_MODE_EXCLUSIVE) ? universal_queue_ptr->get_queue_family_index() : VK_QUEUE_FAMILY_IGNORED, - (m_sharing_mode == VK_SHARING_MODE_EXCLUSIVE) ? universal_queue_ptr->get_queue_family_index() : VK_QUEUE_FAMILY_IGNORED, - shared_from_this(), - image_subresource_range); + VK_ACCESS_TRANSFER_WRITE_BIT, + false, + in_current_image_layout, + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, + (m_sharing_mode == VK_SHARING_MODE_EXCLUSIVE) ? universal_queue_ptr->get_queue_family_index() : VK_QUEUE_FAMILY_IGNORED, + (m_sharing_mode == VK_SHARING_MODE_EXCLUSIVE) ? universal_queue_ptr->get_queue_family_index() : VK_QUEUE_FAMILY_IGNORED, + this, + image_subresource_range); temp_cmdbuf_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, @@ -2314,16 +2356,28 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p copy_regions.push_back(current_copy_region); } - temp_cmdbuf_ptr->record_copy_buffer_to_image(temp_buffer_ptr, - shared_from_this(), - *out_new_image_layout_ptr, - static_cast(copy_regions.size() ), - ©_regions[0]); + /* Issue the copy ops. */ + const uint32_t n_copy_regions = static_cast(copy_regions.size() ); + static const uint32_t n_max_copy_regions_per_copy_call = 1024; + + for (uint32_t n_copy_region = 0; + n_copy_region < n_copy_regions; + n_copy_region += n_max_copy_regions_per_copy_call) + { + const uint32_t n_copy_regions_to_use = std::min(n_max_copy_regions_per_copy_call, + n_copy_regions - n_copy_region); + + temp_cmdbuf_ptr->record_copy_buffer_to_image(temp_buffer_ptr.get(), + this, + *out_new_image_layout_ptr, + n_copy_regions_to_use, + ©_regions.at(n_copy_region) ); + } } temp_cmdbuf_ptr->stop_recording(); /* Execute the command buffer */ - universal_queue_ptr->submit_command_buffer(temp_cmdbuf_ptr, + universal_queue_ptr->submit_command_buffer(temp_cmdbuf_ptr.get(), true /* should_block */); } } \ No newline at end of file diff --git a/src/wrappers/image_view.cpp b/src/wrappers/image_view.cpp index 5ee04271..cd0422d0 100644 --- a/src/wrappers/image_view.cpp +++ b/src/wrappers/image_view.cpp @@ -22,30 +22,32 @@ #include "misc/debug.h" #include "misc/object_tracker.h" +#include "misc/struct_chainer.h" #include "wrappers/device.h" #include "wrappers/image.h" #include "wrappers/image_view.h" /* Please see header for specification */ -std::shared_ptr Anvil::ImageView::create_1D(std::weak_ptr in_device_ptr, - std::shared_ptr in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety) +Anvil::ImageViewUniquePtr Anvil::ImageView::create_1D(const Anvil::BaseDevice* in_device_ptr, + Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety) { - const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); - std::shared_ptr new_image_view_ptr (new ImageView(in_device_ptr, - in_image_ptr, - mt_safe) ); - const VkComponentSwizzle swizzle_rgba[] = + const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); + ImageViewUniquePtr new_image_view_ptr (new ImageView(in_device_ptr, + in_image_ptr, + mt_safe), + std::default_delete() ); + const VkComponentSwizzle swizzle_rgba[] = { in_swizzle_red, in_swizzle_green, @@ -70,27 +72,28 @@ std::shared_ptr Anvil::ImageView::create_1D(std::weak_ptr Anvil::ImageView::create_1D_array(std::weak_ptr in_device_ptr, - std::shared_ptr in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_layers, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety) +Anvil::ImageViewUniquePtr Anvil::ImageView::create_1D_array(const Anvil::BaseDevice* in_device_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_layers, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety) { - const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); - std::shared_ptr new_image_view_ptr(new ImageView(in_device_ptr, - in_image_ptr, - mt_safe) ); - const VkComponentSwizzle swizzle_rgba[] = + const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); + ImageViewUniquePtr new_image_view_ptr(new ImageView(in_device_ptr, + in_image_ptr, + mt_safe), + std::default_delete() ); + const VkComponentSwizzle swizzle_rgba[] = { in_swizzle_red, in_swizzle_green, @@ -115,25 +118,26 @@ std::shared_ptr Anvil::ImageView::create_1D_array(std::weak_pt } /* Please see header for specification */ -std::shared_ptr Anvil::ImageView::create_2D(std::weak_ptr in_device_ptr, - std::shared_ptr in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety) +Anvil::ImageViewUniquePtr Anvil::ImageView::create_2D(const Anvil::BaseDevice* in_device_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety) { - const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); - std::shared_ptr new_image_view_ptr(new ImageView(in_device_ptr, - in_image_ptr, - mt_safe) ); - const VkComponentSwizzle swizzle_rgba[] = + const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); + ImageViewUniquePtr new_image_view_ptr(new ImageView(in_device_ptr, + in_image_ptr, + mt_safe) , + std::default_delete() ); + const VkComponentSwizzle swizzle_rgba[] = { in_swizzle_red, in_swizzle_green, @@ -158,26 +162,27 @@ std::shared_ptr Anvil::ImageView::create_2D(std::weak_ptr Anvil::ImageView::create_2D_array(std::weak_ptr in_device_ptr, - std::shared_ptr in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_layers, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety) +Anvil::ImageViewUniquePtr Anvil::ImageView::create_2D_array(const Anvil::BaseDevice* in_device_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_layers, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety) { - const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); - std::shared_ptr new_image_view_ptr(new ImageView(in_device_ptr, - in_image_ptr, - mt_safe) ); - const VkComponentSwizzle swizzle_rgba[] = + const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); + ImageViewUniquePtr new_image_view_ptr(new ImageView(in_device_ptr, + in_image_ptr, + mt_safe), + std::default_delete() ); + const VkComponentSwizzle swizzle_rgba[] = { in_swizzle_red, in_swizzle_green, @@ -202,26 +207,27 @@ std::shared_ptr Anvil::ImageView::create_2D_array(std::weak_pt } /* Please see header for specification */ -std::shared_ptr Anvil::ImageView::create_3D(std::weak_ptr in_device_ptr, - std::shared_ptr in_image_ptr, - uint32_t in_n_base_slice, - uint32_t in_n_slices, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety) +Anvil::ImageViewUniquePtr Anvil::ImageView::create_3D(const Anvil::BaseDevice* in_device_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_base_slice, + uint32_t in_n_slices, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety) { - const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); - std::shared_ptr new_image_view_ptr(new ImageView(in_device_ptr, - in_image_ptr, - mt_safe) ); - const VkComponentSwizzle swizzle_rgba[] = + const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); + ImageViewUniquePtr new_image_view_ptr(new ImageView(in_device_ptr, + in_image_ptr, + mt_safe), + std::default_delete() ); + const VkComponentSwizzle swizzle_rgba[] = { in_swizzle_red, in_swizzle_green, @@ -246,25 +252,26 @@ std::shared_ptr Anvil::ImageView::create_3D(std::weak_ptr Anvil::ImageView::create_cube_map(std::weak_ptr in_device_ptr, - std::shared_ptr in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety) +Anvil::ImageViewUniquePtr Anvil::ImageView::create_cube_map(const Anvil::BaseDevice* in_device_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety) { - const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); - std::shared_ptr new_image_view_ptr(new ImageView(in_device_ptr, - in_image_ptr, - mt_safe) ); - const VkComponentSwizzle swizzle_rgba[] = + const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); + ImageViewUniquePtr new_image_view_ptr(new ImageView(in_device_ptr, + in_image_ptr, + mt_safe), + std::default_delete() ); + const VkComponentSwizzle swizzle_rgba[] = { in_swizzle_red, in_swizzle_green, @@ -289,26 +296,27 @@ std::shared_ptr Anvil::ImageView::create_cube_map(std::weak_pt } /* Please see header for specification */ -std::shared_ptr Anvil::ImageView::create_cube_map_array(std::weak_ptr in_device_ptr, - std::shared_ptr in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_cube_maps, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety) +Anvil::ImageViewUniquePtr Anvil::ImageView::create_cube_map_array(const Anvil::BaseDevice* in_device_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_cube_maps, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha, + MTSafety in_mt_safety) { - const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); - std::shared_ptr new_image_view_ptr(new ImageView(in_device_ptr, - in_image_ptr, - mt_safe) ); - const VkComponentSwizzle swizzle_rgba[] = + const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); + ImageViewUniquePtr new_image_view_ptr(new ImageView(in_device_ptr, + in_image_ptr, + mt_safe), + std::default_delete() ); + const VkComponentSwizzle swizzle_rgba[] = { in_swizzle_red, in_swizzle_green, @@ -338,9 +346,9 @@ std::shared_ptr Anvil::ImageView::create_cube_map_array(std::w * @param in_device_ptr Device to use. Must not be nullptr. * @param in_parent_image_ptr Image to create the view for. Must not be nullptr. **/ -Anvil::ImageView::ImageView(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_image_ptr, - bool in_mt_safe) +Anvil::ImageView::ImageView(const Anvil::BaseDevice* in_device_ptr, + Anvil::Image* in_parent_image_ptr, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT), MTSafetySupportProvider (in_mt_safe) @@ -369,11 +377,9 @@ Anvil::ImageView::~ImageView() if (m_image_view != VK_NULL_HANDLE) { - std::shared_ptr device_locked_ptr(m_device_ptr); - lock(); { - vkDestroyImageView(device_locked_ptr->get_device_vk(), + vkDestroyImageView(m_device_ptr->get_device_vk(), m_image_view, nullptr /* pAllocator */); } @@ -438,13 +444,12 @@ bool Anvil::ImageView::init(VkImageViewType in_image_view_type, VkFormat in_format, const VkComponentSwizzle* in_swizzle_rgba_ptr) { - std::shared_ptr device_locked_ptr(m_device_ptr); - VkImageViewCreateInfo image_view_create_info; - VkFormat parent_image_format = VK_FORMAT_UNDEFINED; - uint32_t parent_image_n_layers = 0; - uint32_t parent_image_n_mipmaps = 0; - bool result = false; - VkResult result_vk; + VkFormat parent_image_format = VK_FORMAT_UNDEFINED; + uint32_t parent_image_n_layers = 0; + uint32_t parent_image_n_mipmaps = 0; + bool result = false; + VkResult result_vk; + Anvil::StructChainer struct_chainer; /* Sanity checks. Only focus on the basic stuff - hopefully more complicated issues * will be caught by the validation layers. @@ -508,9 +513,9 @@ bool Anvil::ImageView::init(VkImageViewType in_image_view_type, if (in_image_view_type == VK_IMAGE_VIEW_TYPE_2D || in_image_view_type == VK_IMAGE_VIEW_TYPE_2D_ARRAY) { - if (!device_locked_ptr->is_khr_maintenance1_extension_enabled() ) + if (!m_device_ptr->is_khr_maintenance1_extension_enabled() ) { - anvil_assert(device_locked_ptr->is_khr_maintenance1_extension_enabled()); + anvil_assert(m_device_ptr->is_khr_maintenance1_extension_enabled()); goto end; } @@ -525,26 +530,36 @@ bool Anvil::ImageView::init(VkImageViewType in_image_view_type, } /* Create the image view instance */ - image_view_create_info.components.a = in_swizzle_rgba_ptr[3]; - image_view_create_info.components.b = in_swizzle_rgba_ptr[2]; - image_view_create_info.components.g = in_swizzle_rgba_ptr[1]; - image_view_create_info.components.r = in_swizzle_rgba_ptr[0]; - image_view_create_info.flags = 0; - image_view_create_info.format = in_format; - image_view_create_info.image = m_parent_image_ptr->get_image(); - image_view_create_info.pNext = nullptr; - image_view_create_info.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; - image_view_create_info.subresourceRange.aspectMask = in_aspect_mask; - image_view_create_info.subresourceRange.baseArrayLayer = in_n_base_layer; - image_view_create_info.subresourceRange.baseMipLevel = in_n_base_mipmap_level; - image_view_create_info.subresourceRange.layerCount = in_n_layers; - image_view_create_info.subresourceRange.levelCount = in_n_mipmaps; - image_view_create_info.viewType = in_image_view_type; - - result_vk = vkCreateImageView(device_locked_ptr->get_device_vk(), - &image_view_create_info, - nullptr, /* pAllocator */ - &m_image_view); + { + VkImageViewCreateInfo image_view_create_info; + + image_view_create_info.components.a = in_swizzle_rgba_ptr[3]; + image_view_create_info.components.b = in_swizzle_rgba_ptr[2]; + image_view_create_info.components.g = in_swizzle_rgba_ptr[1]; + image_view_create_info.components.r = in_swizzle_rgba_ptr[0]; + image_view_create_info.flags = 0; + image_view_create_info.format = in_format; + image_view_create_info.image = m_parent_image_ptr->get_image(); + image_view_create_info.pNext = nullptr; + image_view_create_info.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; + image_view_create_info.subresourceRange.aspectMask = in_aspect_mask; + image_view_create_info.subresourceRange.baseArrayLayer = in_n_base_layer; + image_view_create_info.subresourceRange.baseMipLevel = in_n_base_mipmap_level; + image_view_create_info.subresourceRange.layerCount = in_n_layers; + image_view_create_info.subresourceRange.levelCount = in_n_mipmaps; + image_view_create_info.viewType = in_image_view_type; + + struct_chainer.append_struct(image_view_create_info); + } + + { + auto chain_ptr = struct_chainer.create_chain(); + + result_vk = vkCreateImageView(m_device_ptr->get_device_vk(), + chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_image_view); + } if (!is_vk_call_successful(result_vk) ) { @@ -577,7 +592,7 @@ bool Anvil::ImageView::init(VkImageViewType in_image_view_type, } /* Please see header for specification */ -bool Anvil::ImageView::intersects(std::shared_ptr in_image_view_ptr) const +bool Anvil::ImageView::intersects(const Anvil::ImageView* in_image_view_ptr) const { bool result = false; @@ -589,21 +604,19 @@ bool Anvil::ImageView::intersects(std::shared_ptr in_image_vie /* Aspect mask */ if ((this_subresource_range.aspectMask & in_subresource_range.aspectMask) != 0) { - result = true; - } - else - /* Layers + mips */ - if (!(this_subresource_range.baseArrayLayer < in_subresource_range.baseArrayLayer && - this_subresource_range.baseArrayLayer + this_subresource_range.layerCount < in_subresource_range.baseArrayLayer && - in_subresource_range.baseArrayLayer < this_subresource_range.baseArrayLayer && - in_subresource_range.baseArrayLayer + in_subresource_range.layerCount < this_subresource_range.baseArrayLayer) ) - { - if (!(this_subresource_range.baseMipLevel < in_subresource_range.baseMipLevel && - this_subresource_range.baseMipLevel + this_subresource_range.levelCount < in_subresource_range.baseMipLevel && - in_subresource_range.baseMipLevel < this_subresource_range.baseMipLevel && - in_subresource_range.baseMipLevel + in_subresource_range.levelCount < this_subresource_range.baseMipLevel) ) + /* Layers + mips */ + if (!((this_subresource_range.baseArrayLayer < in_subresource_range.baseArrayLayer && + this_subresource_range.baseArrayLayer + this_subresource_range.layerCount < in_subresource_range.baseArrayLayer) || + (in_subresource_range.baseArrayLayer < this_subresource_range.baseArrayLayer && + in_subresource_range.baseArrayLayer + in_subresource_range.layerCount < this_subresource_range.baseArrayLayer) )) { - result = true; + if (!((this_subresource_range.baseMipLevel < in_subresource_range.baseMipLevel && + this_subresource_range.baseMipLevel + this_subresource_range.levelCount < in_subresource_range.baseMipLevel) || + (in_subresource_range.baseMipLevel < this_subresource_range.baseMipLevel && + in_subresource_range.baseMipLevel + in_subresource_range.levelCount < this_subresource_range.baseMipLevel) )) + { + result = true; + } } } } diff --git a/src/wrappers/instance.cpp b/src/wrappers/instance.cpp index f60d934b..1c9df729 100644 --- a/src/wrappers/instance.cpp +++ b/src/wrappers/instance.cpp @@ -22,7 +22,6 @@ #include "misc/debug.h" #include "misc/object_tracker.h" -#include "misc/shader_module_cache.h" #include "wrappers/instance.h" #include "wrappers/physical_device.h" @@ -64,16 +63,16 @@ Anvil::Instance::~Instance() } /** Please see header for specification */ -std::shared_ptr Anvil::Instance::create(const std::string& in_app_name, - const std::string& in_engine_name, - DebugCallbackFunction in_opt_validation_callback_proc, - bool in_mt_safe, - const std::vector& in_opt_disallowed_instance_level_extensions, - bool in_opt_enable_shader_module_cache) +Anvil::InstanceUniquePtr Anvil::Instance::create(const std::string& in_app_name, + const std::string& in_engine_name, + DebugCallbackFunction in_opt_validation_callback_proc, + bool in_mt_safe, + const std::vector& in_opt_disallowed_instance_level_extensions) { - std::shared_ptr new_instance_ptr; + InstanceUniquePtr new_instance_ptr(nullptr, + std::default_delete() ); - new_instance_ptr = std::shared_ptr( + new_instance_ptr.reset( new Instance( in_app_name, in_engine_name, @@ -81,8 +80,7 @@ std::shared_ptr Anvil::Instance::create(const std::string& in_mt_safe) ); - new_instance_ptr->init(in_opt_disallowed_instance_level_extensions, - in_opt_enable_shader_module_cache); + new_instance_ptr->init(in_opt_disallowed_instance_level_extensions); return new_instance_ptr; } @@ -129,12 +127,17 @@ void Anvil::Instance::destroy() m_debug_callback_data = VK_NULL_HANDLE; } - while (m_physical_devices.size() > 0) + m_physical_devices.clear(); + + #ifdef _DEBUG { - m_physical_devices.back()->destroy(); - } + /* Make sure no physical devices are still registered with Object Tracker at this point */ + auto object_manager_ptr = Anvil::ObjectTracker::get(); - m_shader_module_cache_ptr.reset(); + anvil_assert(object_manager_ptr->get_object_at_index(Anvil::OBJECT_TYPE_PHYSICAL_DEVICE, + 0) == nullptr); + } + #endif } /** Enumerates and caches all layers supported by the Vulkan Instance. */ @@ -261,11 +264,15 @@ void Anvil::Instance::enumerate_physical_devices() n_physical_device < n_physical_devices; ++n_physical_device) { - std::shared_ptr new_physical_device_ptr; + std::unique_ptr new_physical_device_ptr; - Anvil::PhysicalDevice::create(shared_from_this(), + new_physical_device_ptr = Anvil::PhysicalDevice::create(this, n_physical_device, devices[n_physical_device]); + + m_physical_devices.push_back( + std::move(new_physical_device_ptr) + ); } } @@ -316,8 +323,7 @@ const Anvil::ExtensionKHRSurfaceEntrypoints& Anvil::Instance::get_extension_khr_ #endif /** Initializes the wrapper. */ -void Anvil::Instance::init(const std::vector& in_disallowed_instance_level_extensions, - bool in_enable_shader_module_cache) +void Anvil::Instance::init(const std::vector& in_disallowed_instance_level_extensions) { VkApplicationInfo app_info; VkInstanceCreateInfo create_info; @@ -477,11 +483,6 @@ void Anvil::Instance::init(const std::vector& in_disallowed_instanc } enumerate_physical_devices(); - - if (in_enable_shader_module_cache) - { - m_shader_module_cache_ptr = Anvil::ShaderModuleCache::create(); - } } /** Initializes debug callback support. */ @@ -603,33 +604,3 @@ bool Anvil::Instance::is_instance_extension_supported(const char* in_extension_n m_global_layer.extensions.end(), in_extension_name) != m_global_layer.extensions.end(); } - -/** Please see header for specification */ -void Anvil::Instance::register_physical_device(std::shared_ptr in_physical_device_ptr) -{ - auto iterator = std::find(m_physical_devices.begin(), - m_physical_devices.end(), - in_physical_device_ptr); - - anvil_assert(iterator == m_physical_devices.end() ); - - if (iterator == m_physical_devices.end() ) - { - m_physical_devices.push_back(in_physical_device_ptr); - } -} - -/** Please see header for specification */ -void Anvil::Instance::unregister_physical_device(std::shared_ptr in_physical_device_ptr) -{ - auto iterator = std::find(m_physical_devices.begin(), - m_physical_devices.end(), - in_physical_device_ptr); - - anvil_assert(iterator != m_physical_devices.end() ); - - if (iterator != m_physical_devices.end() ) - { - m_physical_devices.erase(iterator); - } -} \ No newline at end of file diff --git a/src/wrappers/memory_block.cpp b/src/wrappers/memory_block.cpp index 26256143..b2db365b 100644 --- a/src/wrappers/memory_block.cpp +++ b/src/wrappers/memory_block.cpp @@ -22,6 +22,7 @@ #include "misc/debug.h" #include "misc/object_tracker.h" +#include "misc/struct_chainer.h" #include "wrappers/buffer.h" #include "wrappers/device.h" #include "wrappers/image.h" @@ -29,11 +30,11 @@ #include "wrappers/physical_device.h" /* Please see header for specification */ -Anvil::MemoryBlock::MemoryBlock(std::weak_ptr in_device_ptr, - uint32_t in_allowed_memory_bits, - VkDeviceSize in_size, - Anvil::MemoryFeatureFlags in_memory_features, - bool in_mt_safe) +Anvil::MemoryBlock::MemoryBlock(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_allowed_memory_bits, + VkDeviceSize in_size, + Anvil::MemoryFeatureFlags in_memory_features, + bool in_mt_safe) :MTSafetySupportProvider (in_mt_safe), m_allowed_memory_bits (in_allowed_memory_bits), m_device_ptr (in_device_ptr), @@ -51,9 +52,9 @@ Anvil::MemoryBlock::MemoryBlock(std::weak_ptr in_device_ptr, } /* Please see header for specification */ -Anvil::MemoryBlock::MemoryBlock(std::shared_ptr in_parent_memory_block_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size) +Anvil::MemoryBlock::MemoryBlock(MemoryBlock* in_parent_memory_block_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size) :MTSafetySupportProvider(false) { anvil_assert(in_parent_memory_block_ptr != nullptr); @@ -80,7 +81,7 @@ Anvil::MemoryBlock::MemoryBlock(std::shared_ptr in_parent_memory_bl } /* Please see header for specification */ -Anvil::MemoryBlock::MemoryBlock(std::weak_ptr in_device_ptr, +Anvil::MemoryBlock::MemoryBlock(const Anvil::BaseDevice* in_device_ptr, VkDeviceMemory in_memory, uint32_t in_allowed_memory_bits, Anvil::MemoryFeatureFlags in_memory_features, @@ -130,11 +131,9 @@ Anvil::MemoryBlock::~MemoryBlock() { if (m_on_release_callback_function == nullptr) { - std::shared_ptr device_locked_ptr(m_device_ptr); - lock(); { - vkFreeMemory(device_locked_ptr->get_device_vk(), + vkFreeMemory(m_device_ptr->get_device_vk(), m_memory, nullptr /* pAllocator */); } @@ -148,8 +147,6 @@ Anvil::MemoryBlock::~MemoryBlock() /** Finishes the memory mapping process, opened earlier with a open_gpu_memory_access() call. */ void Anvil::MemoryBlock::close_gpu_memory_access() { - std::shared_ptr device_locked_ptr(m_device_ptr); - if (m_parent_memory_block_ptr != nullptr) { m_parent_memory_block_ptr->close_gpu_memory_access(); @@ -162,7 +159,7 @@ void Anvil::MemoryBlock::close_gpu_memory_access() { lock(); { - vkUnmapMemory(device_locked_ptr->get_device_vk(), + vkUnmapMemory(m_device_ptr->get_device_vk(), m_memory); } unlock(); @@ -173,15 +170,16 @@ void Anvil::MemoryBlock::close_gpu_memory_access() } /* Please see header for specification */ -std::shared_ptr Anvil::MemoryBlock::create(std::weak_ptr in_device_ptr, - uint32_t in_allowed_memory_bits, - VkDeviceSize in_size, - Anvil::MemoryFeatureFlags in_memory_features, - MTSafety in_mt_safety) +Anvil::MemoryBlockUniquePtr Anvil::MemoryBlock::create(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_allowed_memory_bits, + VkDeviceSize in_size, + Anvil::MemoryFeatureFlags in_memory_features, + MTSafety in_mt_safety) { - const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - std::shared_ptr result_ptr; + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); + MemoryBlockUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::MemoryBlock(in_device_ptr, @@ -200,11 +198,12 @@ std::shared_ptr Anvil::MemoryBlock::create(std::weak_ptr Anvil::MemoryBlock::create_derived(std::shared_ptr in_parent_memory_block_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size) +Anvil::MemoryBlockUniquePtr Anvil::MemoryBlock::create_derived(MemoryBlock* in_parent_memory_block_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size) { - std::shared_ptr result_ptr; + MemoryBlockUniquePtr result_ptr(nullptr, + std::default_delete() ); if (in_parent_memory_block_ptr == nullptr) { @@ -224,16 +223,17 @@ std::shared_ptr Anvil::MemoryBlock::create_derived(std::shar } /* Please see header for specification */ -std::shared_ptr Anvil::MemoryBlock::create_derived_with_custom_delete_proc(std::weak_ptr in_device_ptr, - VkDeviceMemory in_memory, - uint32_t in_allowed_memory_bits, - Anvil::MemoryFeatureFlags in_memory_features, - uint32_t in_memory_type_index, - VkDeviceSize in_size, - VkDeviceSize in_start_offset, - OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function) +Anvil::MemoryBlockUniquePtr Anvil::MemoryBlock::create_derived_with_custom_delete_proc(const Anvil::BaseDevice* in_device_ptr, + VkDeviceMemory in_memory, + uint32_t in_allowed_memory_bits, + Anvil::MemoryFeatureFlags in_memory_features, + uint32_t in_memory_type_index, + VkDeviceSize in_size, + VkDeviceSize in_start_offset, + OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function) { - std::shared_ptr result_ptr; + MemoryBlockUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::MemoryBlock(in_device_ptr, @@ -265,13 +265,12 @@ std::shared_ptr Anvil::MemoryBlock::create_derived_with_cust uint32_t Anvil::MemoryBlock::get_device_memory_type_index(uint32_t in_memory_type_bits, Anvil::MemoryFeatureFlags in_memory_features) { - std::shared_ptr device_locked_ptr (m_device_ptr); - const bool is_coherent_memory_required ((in_memory_features & MEMORY_FEATURE_FLAG_HOST_COHERENT) != 0); - const bool is_device_local_memory_required ((in_memory_features & MEMORY_FEATURE_FLAG_DEVICE_LOCAL) != 0); - const bool is_host_cached_memory_required ((in_memory_features & MEMORY_FEATURE_FLAG_HOST_CACHED) != 0); - const bool is_lazily_allocated_memory_required((in_memory_features & MEMORY_FEATURE_FLAG_LAZILY_ALLOCATED) != 0); - const bool is_mappable_memory_required ((in_memory_features & MEMORY_FEATURE_FLAG_MAPPABLE) != 0); - const Anvil::MemoryTypes& memory_types (device_locked_ptr->get_physical_device_memory_properties().types); + const bool is_coherent_memory_required ((in_memory_features & MEMORY_FEATURE_FLAG_HOST_COHERENT) != 0); + const bool is_device_local_memory_required ((in_memory_features & MEMORY_FEATURE_FLAG_DEVICE_LOCAL) != 0); + const bool is_host_cached_memory_required ((in_memory_features & MEMORY_FEATURE_FLAG_HOST_CACHED) != 0); + const bool is_lazily_allocated_memory_required((in_memory_features & MEMORY_FEATURE_FLAG_LAZILY_ALLOCATED) != 0); + const bool is_mappable_memory_required ((in_memory_features & MEMORY_FEATURE_FLAG_MAPPABLE) != 0); + const Anvil::MemoryTypes& memory_types (m_device_ptr->get_physical_device_memory_properties().types); if (!is_mappable_memory_required) { @@ -287,15 +286,15 @@ uint32_t Anvil::MemoryBlock::get_device_memory_type_index(uint32_t { const Anvil::MemoryType& current_memory_type = memory_types[n_memory_type]; - if (((is_coherent_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)) || - !is_coherent_memory_required) && - ((is_device_local_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) || - !is_device_local_memory_required) && - ((is_host_cached_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT)) || - !is_host_cached_memory_required) && - ((is_lazily_allocated_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT)) || - !is_lazily_allocated_memory_required) && - ((is_mappable_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)) || + if (((is_coherent_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)) || + !is_coherent_memory_required) && + ((is_device_local_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) || + !is_device_local_memory_required) && + ((is_host_cached_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT)) || + !is_host_cached_memory_required) && + ((is_lazily_allocated_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT)) || + !is_lazily_allocated_memory_required) && + ((is_mappable_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)) || !is_mappable_memory_required) ) { if ( (in_memory_type_bits & (1 << n_memory_type)) != 0) @@ -314,21 +313,32 @@ uint32_t Anvil::MemoryBlock::get_device_memory_type_index(uint32_t /* Allocates actual memory and caches a number of properties used to spawn the memory block */ bool Anvil::MemoryBlock::init() { - VkMemoryAllocateInfo buffer_data_alloc_info; - std::shared_ptr device_locked_ptr (m_device_ptr); - VkResult result; - bool result_bool = false; - - buffer_data_alloc_info.allocationSize = m_size; - buffer_data_alloc_info.memoryTypeIndex = get_device_memory_type_index(m_allowed_memory_bits, - m_memory_features); - buffer_data_alloc_info.pNext = nullptr; - buffer_data_alloc_info.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO; - - result = vkAllocateMemory(device_locked_ptr->get_device_vk(), - &buffer_data_alloc_info, - nullptr, /* pAllocator */ - &m_memory); + VkResult result; + bool result_bool = false; + Anvil::StructChainer struct_chainer; + + { + VkMemoryAllocateInfo buffer_data_alloc_info; + + buffer_data_alloc_info.allocationSize = m_size; + buffer_data_alloc_info.memoryTypeIndex = get_device_memory_type_index(m_allowed_memory_bits, + m_memory_features); + buffer_data_alloc_info.pNext = nullptr; + buffer_data_alloc_info.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO; + + m_memory_type_index = buffer_data_alloc_info.memoryTypeIndex; + + struct_chainer.append_struct(buffer_data_alloc_info); + } + + { + auto chain_ptr = struct_chainer.create_chain(); + + result = vkAllocateMemory(m_device_ptr->get_device_vk(), + chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_memory); + } anvil_assert_vk_call_succeeded(result); if (!is_vk_call_successful(result) ) @@ -336,8 +346,6 @@ bool Anvil::MemoryBlock::init() goto end; } - m_memory_type_index = buffer_data_alloc_info.memoryTypeIndex; - /* All done */ result_bool = true; end: @@ -345,9 +353,9 @@ bool Anvil::MemoryBlock::init() } /* Please see header for specification */ -bool Anvil::MemoryBlock::intersects(std::shared_ptr in_memory_block_ptr) const +bool Anvil::MemoryBlock::intersects(const Anvil::MemoryBlock* in_memory_block_ptr) const { - bool result = (in_memory_block_ptr == shared_from_this() ); + bool result = (m_memory == in_memory_block_ptr->m_memory); if (result) { @@ -393,9 +401,8 @@ bool Anvil::MemoryBlock::map(VkDeviceSize in_start_offset, if ((m_memory_features & Anvil::MEMORY_FEATURE_FLAG_HOST_COHERENT) == 0) { /* Make sure the mapped region is invalidated before letting the user read from it */ - std::shared_ptr device_locked_ptr (m_device_ptr); - VkMappedMemoryRange mapped_memory_range; - VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); + VkMappedMemoryRange mapped_memory_range; + VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); ANVIL_REDUNDANT_VARIABLE(result_vk); @@ -405,7 +412,7 @@ bool Anvil::MemoryBlock::map(VkDeviceSize in_start_offset, mapped_memory_range.size = in_size; mapped_memory_range.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE; - result_vk = vkInvalidateMappedMemoryRanges(device_locked_ptr->get_device_vk(), + result_vk = vkInvalidateMappedMemoryRanges(m_device_ptr->get_device_vk(), 1, /* memRangeCount */ &mapped_memory_range); anvil_assert_vk_call_succeeded(result_vk); @@ -432,9 +439,8 @@ bool Anvil::MemoryBlock::map(VkDeviceSize in_start_offset, **/ bool Anvil::MemoryBlock::open_gpu_memory_access() { - std::shared_ptr device_locked_ptr(m_device_ptr); - bool result (false); - VkResult result_vk; + bool result (false); + VkResult result_vk; /* Sanity checks */ anvil_assert(m_parent_memory_block_ptr == nullptr); @@ -451,7 +457,7 @@ bool Anvil::MemoryBlock::open_gpu_memory_access() /* Map the memory region into process space */ lock(); { - result_vk = vkMapMemory(device_locked_ptr->get_device_vk(), + result_vk = vkMapMemory(m_device_ptr->get_device_vk(), m_memory, 0, /* offset */ m_size, @@ -477,8 +483,7 @@ bool Anvil::MemoryBlock::read(VkDeviceSize in_start_offset, VkDeviceSize in_size, void* out_result_ptr) { - std::shared_ptr device_locked_ptr(m_device_ptr); - bool result (false); + bool result(false); anvil_assert(in_size > 0); anvil_assert(in_start_offset + in_size <= m_size); @@ -513,7 +518,7 @@ bool Anvil::MemoryBlock::read(VkDeviceSize in_start_offset, mapped_memory_range.size = in_size; mapped_memory_range.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE; - result_vk = vkInvalidateMappedMemoryRanges(device_locked_ptr->get_device_vk(), + result_vk = vkInvalidateMappedMemoryRanges(m_device_ptr->get_device_vk(), 1, /* memRangeCount */ &mapped_memory_range); anvil_assert_vk_call_succeeded(result_vk); @@ -566,8 +571,7 @@ bool Anvil::MemoryBlock::write(VkDeviceSize in_start_offset, VkDeviceSize in_size, const void* in_data) { - std::shared_ptr device_locked_ptr(m_device_ptr); - bool result (false); + bool result(false); anvil_assert(in_size > 0); anvil_assert(in_start_offset + in_size <= in_start_offset + m_size); @@ -603,7 +607,7 @@ bool Anvil::MemoryBlock::write(VkDeviceSize in_start_offset, mapped_memory_range.size = in_size; mapped_memory_range.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE; - result_vk = vkFlushMappedMemoryRanges(device_locked_ptr->get_device_vk(), + result_vk = vkFlushMappedMemoryRanges(m_device_ptr->get_device_vk(), 1, /* memRangeCount */ &mapped_memory_range); anvil_assert_vk_call_succeeded(result_vk); diff --git a/src/wrappers/physical_device.cpp b/src/wrappers/physical_device.cpp index 2bffa314..019057f0 100644 --- a/src/wrappers/physical_device.cpp +++ b/src/wrappers/physical_device.cpp @@ -22,29 +22,31 @@ #include "misc/debug.h" #include "misc/object_tracker.h" +#include "misc/struct_chainer.h" #include "wrappers/device.h" #include "wrappers/instance.h" #include "wrappers/physical_device.h" #include /* Please see header for specification */ -bool Anvil::operator==(const std::shared_ptr& in_physical_device_ptr, +bool Anvil::operator==(const std::unique_ptr& in_physical_device_ptr, const VkPhysicalDevice& in_physical_device_vk) { return (in_physical_device_ptr->get_physical_device() == in_physical_device_vk); } /* Please see header for specification */ -std::weak_ptr Anvil::PhysicalDevice::create(std::shared_ptr in_instance_ptr, - uint32_t in_index, - VkPhysicalDevice in_physical_device) +std::unique_ptr Anvil::PhysicalDevice::create(Anvil::Instance* in_instance_ptr, + uint32_t in_index, + VkPhysicalDevice in_physical_device) { - std::shared_ptr physical_device_ptr(new Anvil::PhysicalDevice(in_instance_ptr, - in_index, - in_physical_device) ); + std::unique_ptr physical_device_ptr( + new Anvil::PhysicalDevice( + in_instance_ptr, + in_index, + in_physical_device) ); - physical_device_ptr->init (); - in_instance_ptr->register_physical_device(physical_device_ptr); + physical_device_ptr->init(); /* Register the physical device instance */ Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_PHYSICAL_DEVICE, @@ -56,44 +58,26 @@ std::weak_ptr Anvil::PhysicalDevice::create(std::shared_p /* Please see header for specification */ Anvil::PhysicalDevice::~PhysicalDevice() { - anvil_assert(m_destroyed); - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_PHYSICAL_DEVICE, this); } -/* Please see header for specification */ -void Anvil::PhysicalDevice::destroy() -{ - anvil_assert(!m_destroyed); - - m_destroyed = true; - - while (m_cached_devices.size() > 0) - { - m_cached_devices.back()->destroy(); - } - - m_instance_ptr->unregister_physical_device(shared_from_this() ); - -} - /** Initializes _vulkan_physical_device descriptor with actual data by issuing a number * of Vulkan API calls. * * @param physical_device_ptr Pointer to a _vulkan_physical_device instance to be initialized. * Must not be nullptr. **/ -void Anvil::PhysicalDevice::init() +bool Anvil::PhysicalDevice::init() { const Anvil::ExtensionKHRGetPhysicalDeviceProperties2* gpdp2_entrypoints_ptr = nullptr; VkPhysicalDeviceMemoryProperties memory_properties; uint32_t n_extensions = 0; uint32_t n_physical_device_layers = 0; uint32_t n_physical_device_queues = 0; - VkResult result = VK_ERROR_INITIALIZATION_FAILED; - - ANVIL_REDUNDANT_VARIABLE(result); + bool result = true; + VkResult result_vk = VK_ERROR_INITIALIZATION_FAILED; + const bool texture_gather_bias_lod_support = is_device_extension_supported(VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME); anvil_assert(m_physical_device != VK_NULL_HANDLE); @@ -103,11 +87,18 @@ void Anvil::PhysicalDevice::init() } /* Retrieve device extensions */ - result = vkEnumerateDeviceExtensionProperties(m_physical_device, - nullptr, /* pLayerName */ - &n_extensions, - nullptr); /* pProperties */ - anvil_assert_vk_call_succeeded(result); + result_vk = vkEnumerateDeviceExtensionProperties(m_physical_device, + nullptr, /* pLayerName */ + &n_extensions, + nullptr); /* pProperties */ + + if (!is_vk_call_successful(result_vk) ) + { + anvil_assert_vk_call_succeeded(result_vk); + + result = false; + goto end; + } if (n_extensions > 0) { @@ -115,11 +106,11 @@ void Anvil::PhysicalDevice::init() extension_props.resize(n_extensions); - result = vkEnumerateDeviceExtensionProperties(m_physical_device, - nullptr, /* pLayerName */ - &n_extensions, - &extension_props[0]); - anvil_assert_vk_call_succeeded(result); + result_vk = vkEnumerateDeviceExtensionProperties(m_physical_device, + nullptr, /* pLayerName */ + &n_extensions, + &extension_props[0]); + anvil_assert_vk_call_succeeded(result_vk); for (uint32_t n_extension = 0; n_extension < n_extensions; @@ -129,16 +120,76 @@ void Anvil::PhysicalDevice::init() } } - /* Retrieve device features */ - vkGetPhysicalDeviceFeatures(m_physical_device, - &m_features); + /* Retrieve and cache device features */ + { + VkPhysicalDeviceFeatures features_vk; + + vkGetPhysicalDeviceFeatures(m_physical_device, + &features_vk); - /* Retrieve device format properties */ - const bool texture_gather_bias_lod_support = is_device_extension_supported(VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME); + if (is_device_extension_supported(VK_KHR_16BIT_STORAGE_EXTENSION_NAME) ) + { + const auto& gpdp2_entrypoints = m_instance_ptr->get_extension_khr_get_physical_device_properties2_entrypoints(); + Anvil::StructID storage_features_struct_id = UINT32_MAX; + Anvil::StructChainUniquePtr struct_chain_ptr; + Anvil::StructChainer struct_chainer; + + { + VkPhysicalDeviceFeatures2KHR features; - for (VkFormat current_format = (VkFormat)1; /* skip the _UNDEFINED format */ - current_format < VK_FORMAT_RANGE_SIZE; - current_format = static_cast(current_format + 1)) + features.pNext = nullptr; + features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR; + + struct_chainer.append_struct(features); + } + + { + VkPhysicalDevice16BitStorageFeaturesKHR storage_features; + + storage_features.pNext = nullptr; + storage_features.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR); + + storage_features_struct_id = struct_chainer.append_struct(storage_features); + } + + struct_chain_ptr = struct_chainer.create_chain(); + + gpdp2_entrypoints.vkGetPhysicalDeviceFeatures2KHR(m_physical_device, + struct_chain_ptr->get_root_struct() ); + + m_khr_16_bit_storage_features_ptr.reset( + new KHR16BitStorageFeatures(*struct_chain_ptr->get_struct_with_id(storage_features_struct_id) ) + ); + + if (m_khr_16_bit_storage_features_ptr == nullptr) + { + anvil_assert(m_khr_16_bit_storage_features_ptr != nullptr); + + result = false; + goto end; + } + } + + m_core_features_vk10_ptr.reset( + new Anvil::PhysicalDeviceFeaturesCoreVK10(features_vk) + ); + + if (m_core_features_vk10_ptr == nullptr) + { + anvil_assert(m_core_features_vk10_ptr != nullptr); + + result = false; + goto end; + } + + m_features = Anvil::PhysicalDeviceFeatures(m_core_features_vk10_ptr.get (), + m_khr_16_bit_storage_features_ptr.get() ); + } + + /* Retrieve device format properties */ + for (VkFormat current_format = static_cast(1); /* skip the _UNDEFINED format */ + current_format < VK_FORMAT_RANGE_SIZE; + current_format = static_cast(current_format + 1)) { VkFormatProperties format_props; @@ -152,12 +203,10 @@ void Anvil::PhysicalDevice::init() if (gpdp2_entrypoints_ptr != nullptr && texture_gather_bias_lod_support) { - VkPhysicalDeviceImageFormatInfo2KHR format_info; - VkImageFormatProperties2KHR image_format_props = {}; - VkTextureLODGatherFormatPropertiesAMD texture_lod_gather_support = {}; - - texture_lod_gather_support.sType = VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD; - texture_lod_gather_support.pNext = nullptr; + VkPhysicalDeviceImageFormatInfo2KHR format_info; + Anvil::StructChainUniquePtr struct_chain_ptr; + Anvil::StructChainer struct_chainer; + Anvil::StructID texture_lod_gather_support_struct_id = UINT32_MAX; format_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR; format_info.pNext = nullptr; @@ -167,14 +216,33 @@ void Anvil::PhysicalDevice::init() format_info.usage = VK_IMAGE_USAGE_SAMPLED_BIT; // irrelevant format_info.flags = 0; // irrelevant - image_format_props.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR; - image_format_props.pNext = &texture_lod_gather_support; + { + VkImageFormatProperties2KHR image_format_props = {}; + + image_format_props.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR; + image_format_props.pNext = nullptr; + + struct_chainer.append_struct(image_format_props); + } + + { + VkTextureLODGatherFormatPropertiesAMD texture_lod_gather_support = {}; + + texture_lod_gather_support.sType = VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD; + texture_lod_gather_support.pNext = nullptr; + + texture_lod_gather_support_struct_id = struct_chainer.append_struct(texture_lod_gather_support); + } + + struct_chain_ptr = struct_chainer.create_chain(); if (gpdp2_entrypoints_ptr->vkGetPhysicalDeviceImageFormatProperties2KHR(m_physical_device, &format_info, - &image_format_props) == VK_SUCCESS) + struct_chain_ptr->get_root_struct() ) == VK_SUCCESS) { - m_format_properties.at(current_format).supports_amd_texture_gather_bias_lod = (texture_lod_gather_support.supportsTextureGatherLODBiasAMD == VK_TRUE); + auto texture_lod_gather_support_ptr = struct_chain_ptr->get_struct_with_id(texture_lod_gather_support_struct_id); + + m_format_properties.at(current_format).supports_amd_texture_gather_bias_lod = (texture_lod_gather_support_ptr->supportsTextureGatherLODBiasAMD == VK_TRUE); } } } @@ -186,24 +254,40 @@ void Anvil::PhysicalDevice::init() if (m_instance_ptr->is_instance_extension_supported(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME) ) { - VkPhysicalDeviceIDPropertiesKHR device_id_props; - VkPhysicalDeviceProperties2KHR general_props; + Anvil::StructID device_id_props_struct_id = UINT32_MAX; + const VkPhysicalDeviceIDPropertiesKHR* result_device_id_props_ptr = nullptr; + Anvil::StructChainUniquePtr struct_chain_ptr; + Anvil::StructChainer struct_chainer; + { + VkPhysicalDeviceProperties2KHR general_props; + + general_props.pNext = nullptr; + general_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; + + struct_chainer.append_struct(general_props); + } + + { + VkPhysicalDeviceIDPropertiesKHR device_id_props; - device_id_props.pNext = nullptr; - device_id_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR; + device_id_props.pNext = nullptr; + device_id_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR; - general_props.pNext = &device_id_props; - general_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; + device_id_props_struct_id = struct_chainer.append_struct(device_id_props); + } + + struct_chain_ptr = struct_chainer.create_chain(); + result_device_id_props_ptr = struct_chain_ptr->get_struct_with_id(device_id_props_struct_id); gpdp2_entrypoints.vkGetPhysicalDeviceProperties2KHR(m_physical_device, - &general_props); + struct_chain_ptr->get_root_struct() ); - if (device_id_props.deviceLUIDValid) + if (result_device_id_props_ptr->deviceLUIDValid) { - static_assert(sizeof(m_device_LUID) == sizeof(device_id_props.deviceLUID), "Anvil asserts a LUID size different than the Vulkan header"); + static_assert(sizeof(m_device_LUID) == sizeof(result_device_id_props_ptr->deviceLUID), "Anvil asserts a LUID size different than the Vulkan header"); memcpy(m_device_LUID, - &device_id_props.deviceLUID, + &result_device_id_props_ptr->deviceLUID, sizeof(m_device_LUID) ); m_device_LUID_available = true; @@ -213,45 +297,86 @@ void Anvil::PhysicalDevice::init() m_device_LUID_available = false; } - static_assert(sizeof(m_device_UUID) == sizeof(device_id_props.deviceUUID), "Anvil asserts a UUID size different than the Vulkan header"); - static_assert(sizeof(m_driver_UUID) == sizeof(device_id_props.driverUUID), "Anvil asserts a UUID size different than the Vulkan header"); + static_assert(sizeof(m_device_UUID) == sizeof(result_device_id_props_ptr->deviceUUID), "Anvil asserts a UUID size different than the Vulkan header"); + static_assert(sizeof(m_driver_UUID) == sizeof(result_device_id_props_ptr->driverUUID), "Anvil asserts a UUID size different than the Vulkan header"); memcpy(m_device_UUID, - device_id_props.deviceUUID, + result_device_id_props_ptr->deviceUUID, sizeof(m_device_UUID) ); memcpy(m_driver_UUID, - device_id_props.driverUUID, + result_device_id_props_ptr->driverUUID, sizeof(m_driver_UUID) ); m_device_UUID_available = true; m_driver_UUID_available = true; } - if (is_device_extension_supported(VK_KHR_16BIT_STORAGE_EXTENSION_NAME) ) + if (is_device_extension_supported(VK_KHR_MAINTENANCE3_EXTENSION_NAME) ) { - VkPhysicalDeviceFeatures2KHR features; - VkPhysicalDevice16BitStorageFeaturesKHR storage_features; + Anvil::StructID maintenance3_struct_id = UINT32_MAX; + const VkPhysicalDeviceMaintenance3PropertiesKHR* result_maintenanc3_struct_ptr = nullptr; + Anvil::StructChainUniquePtr struct_chain_ptr; + Anvil::StructChainer struct_chainer; - features.pNext = &storage_features; - features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR; + { + VkPhysicalDeviceProperties2KHR general_props; - storage_features.pNext = nullptr; - storage_features.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR); + general_props.pNext = nullptr; + general_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; - gpdp2_entrypoints.vkGetPhysicalDeviceFeatures2KHR(m_physical_device, - &features); + struct_chainer.append_struct(general_props); + } + { + VkPhysicalDeviceMaintenance3PropertiesKHR maintenance3_props; + + maintenance3_props.pNext = nullptr; + maintenance3_props.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES_KHR); - m_16bit_storage_features = StorageFeatures16Bit( (storage_features.storageInputOutput16 == VK_TRUE), - (storage_features.storagePushConstant16 == VK_TRUE), - (storage_features.storageBuffer16BitAccess == VK_TRUE), - (storage_features.uniformAndStorageBuffer16BitAccess == VK_TRUE)); - m_16bit_storage_features_available = true; + maintenance3_struct_id = struct_chainer.append_struct(maintenance3_props); + } + + struct_chain_ptr = struct_chainer.create_chain(); + result_maintenanc3_struct_ptr = struct_chain_ptr->get_struct_with_id(maintenance3_struct_id); + + gpdp2_entrypoints.vkGetPhysicalDeviceProperties2KHR(m_physical_device, + struct_chain_ptr->get_root_struct() ); + + m_khr_maintenance3_properties_ptr.reset( + new KHRMaintenance3Properties(*result_maintenanc3_struct_ptr) + ); + + if (m_khr_maintenance3_properties_ptr == nullptr) + { + anvil_assert(m_khr_maintenance3_properties_ptr != nullptr); + + result = false; + goto end; + } } } /* Retrieve device properties */ - vkGetPhysicalDeviceProperties(m_physical_device, - &m_properties); + { + VkPhysicalDeviceProperties props; + + vkGetPhysicalDeviceProperties(m_physical_device, + &props); + + m_core_properties_vk10_ptr.reset( + new Anvil::PhysicalDevicePropertiesCoreVK10(props) + ); + + if (m_core_properties_vk10_ptr == nullptr) + { + anvil_assert(m_core_properties_vk10_ptr != nullptr); + + result = false; + goto end; + } + } + + m_properties = Anvil::PhysicalDeviceProperties(m_core_properties_vk10_ptr.get (), + m_khr_maintenance3_properties_ptr.get() ); /* Retrieve device queue data */ vkGetPhysicalDeviceQueueFamilyProperties(m_physical_device, @@ -283,10 +408,17 @@ void Anvil::PhysicalDevice::init() m_memory_properties.init(memory_properties); /* Retrieve device layers */ - result = vkEnumerateDeviceLayerProperties(m_physical_device, - &n_physical_device_layers, - nullptr); /* pProperties */ - anvil_assert_vk_call_succeeded(result); + result_vk = vkEnumerateDeviceLayerProperties(m_physical_device, + &n_physical_device_layers, + nullptr); /* pProperties */ + + if (!is_vk_call_successful(result_vk) ) + { + anvil_assert_vk_call_succeeded(result_vk); + + result = false; + goto end; + } if (n_physical_device_layers > 0) { @@ -294,9 +426,17 @@ void Anvil::PhysicalDevice::init() layer_props.resize(n_physical_device_layers); - result = vkEnumerateDeviceLayerProperties(m_physical_device, - &n_physical_device_layers, - &layer_props[0]); + result_vk = vkEnumerateDeviceLayerProperties(m_physical_device, + &n_physical_device_layers, + &layer_props[0]); + + if (!is_vk_call_successful(result_vk) ) + { + anvil_assert(is_vk_call_successful(result_vk) ); + + result = false; + goto end; + } for (uint32_t n_layer = 0; n_layer < n_physical_device_layers; @@ -305,6 +445,9 @@ void Anvil::PhysicalDevice::init() m_layers.push_back(Anvil::Layer(layer_props[n_layer]) ); } } + +end: + return result; } /* Please see header for specification */ @@ -361,33 +504,3 @@ bool Anvil::PhysicalDevice::is_layer_supported(const std::string& in_layer_name) m_layers.end(), in_layer_name) != m_layers.end(); } - -/* Please see header for specification */ -void Anvil::PhysicalDevice::register_device(std::shared_ptr in_device_ptr) -{ - auto device_iterator = std::find(m_cached_devices.begin(), - m_cached_devices.end(), - in_device_ptr); - - anvil_assert(device_iterator == m_cached_devices.end() ); - - if (device_iterator == m_cached_devices.end() ) - { - m_cached_devices.push_back(in_device_ptr); - } -} - -/* Please see header for specification */ -void Anvil::PhysicalDevice::unregister_device(std::shared_ptr in_device_ptr) -{ - auto device_iterator = std::find(m_cached_devices.begin(), - m_cached_devices.end(), - in_device_ptr); - - anvil_assert(device_iterator != m_cached_devices.end() ); - - if (device_iterator != m_cached_devices.end() ) - { - m_cached_devices.erase(device_iterator); - } -} diff --git a/src/wrappers/pipeline_cache.cpp b/src/wrappers/pipeline_cache.cpp index dba8b900..a51ea569 100644 --- a/src/wrappers/pipeline_cache.cpp +++ b/src/wrappers/pipeline_cache.cpp @@ -27,19 +27,18 @@ /** Please see header for specification */ -Anvil::PipelineCache::PipelineCache(std::weak_ptr in_device_ptr, - bool in_mt_safe, - size_t in_initial_data_size, - const void* in_initial_data) +Anvil::PipelineCache::PipelineCache(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe, + size_t in_initial_data_size, + const void* in_initial_data) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT), MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), m_pipeline_cache (VK_NULL_HANDLE) { - VkPipelineCacheCreateInfo cache_create_info; - std::shared_ptr device_locked_ptr(in_device_ptr); - VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); + VkPipelineCacheCreateInfo cache_create_info; + VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); ANVIL_REDUNDANT_VARIABLE(result_vk); @@ -49,7 +48,7 @@ Anvil::PipelineCache::PipelineCache(std::weak_ptr in_device_p cache_create_info.pNext = nullptr; cache_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO; - result_vk = vkCreatePipelineCache(device_locked_ptr->get_device_vk(), + result_vk = vkCreatePipelineCache(m_device_ptr->get_device_vk(), &cache_create_info, nullptr, /* pAllocator */ &m_pipeline_cache); @@ -76,11 +75,9 @@ Anvil::PipelineCache::~PipelineCache() if (m_pipeline_cache != VK_NULL_HANDLE) { - std::shared_ptr device_locked_ptr(m_device_ptr); - lock(); { - vkDestroyPipelineCache(device_locked_ptr->get_device_vk(), + vkDestroyPipelineCache(m_device_ptr->get_device_vk(), m_pipeline_cache, nullptr /* pAllocator */); } @@ -91,12 +88,13 @@ Anvil::PipelineCache::~PipelineCache() } /** Please see header for specification */ -std::shared_ptr Anvil::PipelineCache::create(std::weak_ptr in_device_ptr, - bool in_mt_safe, - size_t in_initial_data_size, - const void* in_initial_data) +Anvil::PipelineCacheUniquePtr Anvil::PipelineCache::create(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe, + size_t in_initial_data_size, + const void* in_initial_data) { - std::shared_ptr result_ptr; + PipelineCacheUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::PipelineCache(in_device_ptr, @@ -112,10 +110,9 @@ std::shared_ptr Anvil::PipelineCache::create(std::weak_ptr bool Anvil::PipelineCache::get_data(size_t* out_n_data_bytes_ptr, const void** out_data_ptr) { - std::shared_ptr device_locked_ptr(m_device_ptr); - VkResult result_vk; + VkResult result_vk; - result_vk = vkGetPipelineCacheData(device_locked_ptr->get_device_vk(), + result_vk = vkGetPipelineCacheData(m_device_ptr->get_device_vk(), m_pipeline_cache, out_n_data_bytes_ptr, out_data_ptr); @@ -126,12 +123,11 @@ bool Anvil::PipelineCache::get_data(size_t* out_n_data_bytes_ptr, } /** Please see header for specification */ -bool Anvil::PipelineCache::merge(uint32_t in_n_pipeline_caches, - std::shared_ptr const* in_src_cache_ptrs) +bool Anvil::PipelineCache::merge(uint32_t in_n_pipeline_caches, + const Anvil::PipelineCache* const* in_src_cache_ptrs) { - std::shared_ptr device_locked_ptr(m_device_ptr); - VkResult result_vk; - VkPipelineCache src_pipeline_caches[64]; + VkResult result_vk; + std::vector src_pipeline_caches(in_n_pipeline_caches); anvil_assert(in_n_pipeline_caches < sizeof(src_pipeline_caches) / sizeof(src_pipeline_caches[0]) ); @@ -145,10 +141,10 @@ bool Anvil::PipelineCache::merge(uint32_t lock(); { - result_vk = vkMergePipelineCaches(device_locked_ptr->get_device_vk(), + result_vk = vkMergePipelineCaches(m_device_ptr->get_device_vk(), m_pipeline_cache, in_n_pipeline_caches, - src_pipeline_caches); + &src_pipeline_caches.at(0) ); } unlock(); diff --git a/src/wrappers/pipeline_layout.cpp b/src/wrappers/pipeline_layout.cpp index 17b666cd..1176ed48 100644 --- a/src/wrappers/pipeline_layout.cpp +++ b/src/wrappers/pipeline_layout.cpp @@ -24,22 +24,20 @@ #include "misc/object_tracker.h" #include "wrappers/descriptor_set_group.h" #include "wrappers/descriptor_set_layout.h" +#include "wrappers/descriptor_set_layout_manager.h" #include "wrappers/device.h" #include "wrappers/pipeline_layout.h" #include "wrappers/pipeline_layout_manager.h" /** Please see header for specification */ -Anvil::PipelineLayout::PipelineLayout(std::weak_ptr in_device_ptr, - std::shared_ptr in_dsg_ptr, - const Anvil::PushConstantRanges& in_push_constant_ranges, - bool in_mt_safe) +Anvil::PipelineLayout::PipelineLayout(const Anvil::BaseDevice* in_device_ptr, + const Anvil::PushConstantRanges& in_push_constant_ranges, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT), MTSafetySupportProvider (in_mt_safe) { m_device_ptr = in_device_ptr; - m_dirty = true; - m_dsg_ptr = in_dsg_ptr; m_layout_vk = VK_NULL_HANDLE; m_push_constant_ranges = in_push_constant_ranges; } @@ -47,18 +45,14 @@ Anvil::PipelineLayout::PipelineLayout(std::weak_ptr /** Please see header for specification */ Anvil::PipelineLayout::~PipelineLayout() { - m_dsg_ptr = nullptr; - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_PIPELINE_LAYOUT, this); if (m_layout_vk != VK_NULL_HANDLE) { - std::shared_ptr device_locked_ptr(m_device_ptr); - lock(); { - vkDestroyPipelineLayout(device_locked_ptr->get_device_vk(), + vkDestroyPipelineLayout(m_device_ptr->get_device_vk(), m_layout_vk, nullptr /* pAllocator */); } @@ -69,77 +63,64 @@ Anvil::PipelineLayout::~PipelineLayout() } /** Please see header for specification */ -bool Anvil::PipelineLayout::bake() +bool Anvil::PipelineLayout::bake(const std::vector* in_ds_info_items_ptr) { - std::shared_ptr device_locked_ptr(m_device_ptr); + auto ds_layout_manager_ptr = m_device_ptr->get_descriptor_set_layout_manager(); std::vector ds_layouts_vk; VkPipelineLayoutCreateInfo pipeline_layout_create_info; std::vector push_constant_ranges_vk; VkResult result_vk; /* Convert descriptor set layouts to Vulkan equivalents */ - const VkDescriptorSetLayout dummy_ds_layout = device_locked_ptr->get_dummy_descriptor_set_layout()->get_layout(); - uint32_t max_ds_binding_index = 0; - - if (!m_dirty) - { - result_vk = VK_SUCCESS; - - goto end; - } - - if (m_layout_vk != VK_NULL_HANDLE) - { - lock(); - { - vkDestroyPipelineLayout(device_locked_ptr->get_device_vk(), - m_layout_vk, - nullptr /* pAllocator */); - } - unlock(); + const VkDescriptorSetLayout dummy_ds_layout = m_device_ptr->get_dummy_descriptor_set_layout()->get_layout(); - m_layout_vk = VK_NULL_HANDLE; - set_vk_handle(VK_NULL_HANDLE); - } + ds_layouts_vk.resize(in_ds_info_items_ptr->size() + 1, + dummy_ds_layout); - if (m_dsg_ptr != nullptr) + if (in_ds_info_items_ptr != nullptr && + in_ds_info_items_ptr->size() > 0) { - const uint32_t n_dses = m_dsg_ptr->get_n_descriptor_sets(); + const uint32_t n_current_descriptor_sets = static_cast(in_ds_info_items_ptr->size() ); - for (uint32_t n_ds = 0; - n_ds < n_dses; - ++n_ds) + for (uint32_t n_current_descriptor_set = 0; + n_current_descriptor_set < n_current_descriptor_sets; + ++n_current_descriptor_set) { - auto ds_layout_ptr = m_dsg_ptr->get_descriptor_set_layout(n_ds); + auto& current_ds_info_ptr = in_ds_info_items_ptr->at(n_current_descriptor_set); - if (ds_layout_ptr == nullptr) + if (current_ds_info_ptr == nullptr) { + m_ds_info_ptrs.push_back( + Anvil::DescriptorSetInfoUniquePtr() + ); + continue; } + else + { + Anvil::DescriptorSetLayoutUniquePtr new_ds_layout_ptr; - max_ds_binding_index = n_ds; - } - } + m_ds_info_ptrs.push_back( + Anvil::DescriptorSetInfoUniquePtr( + new Anvil::DescriptorSetInfo(*current_ds_info_ptr) + ) + ); - ds_layouts_vk.resize(max_ds_binding_index + 1, - dummy_ds_layout); + if (!ds_layout_manager_ptr->get_layout(current_ds_info_ptr.get(), + &new_ds_layout_ptr) ) + { + anvil_assert_fail(); - if (m_dsg_ptr != nullptr) - { - const uint32_t n_current_descriptor_sets = m_dsg_ptr->get_n_descriptor_sets(); + result_vk = VK_ERROR_INITIALIZATION_FAILED; + goto end; + } - for (uint32_t n_current_descriptor_set = 0; - n_current_descriptor_set < n_current_descriptor_sets; - ++n_current_descriptor_set) - { - auto ds_layout_ptr = m_dsg_ptr->get_descriptor_set_layout(n_current_descriptor_set); + ds_layouts_vk.at(n_current_descriptor_set) = new_ds_layout_ptr->get_layout(); - if (ds_layout_ptr == nullptr) - { - continue; + m_ds_layout_ptrs.push_back( + std::move(new_ds_layout_ptr) + ); } - - ds_layouts_vk[n_current_descriptor_set] = ds_layout_ptr->get_layout(); } } @@ -170,7 +151,7 @@ bool Anvil::PipelineLayout::bake() pipeline_layout_create_info.pushConstantRangeCount = static_cast(m_push_constant_ranges.size() ); pipeline_layout_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO; - result_vk = vkCreatePipelineLayout(device_locked_ptr->get_device_vk(), + result_vk = vkCreatePipelineLayout(m_device_ptr->get_device_vk(), &pipeline_layout_create_info, nullptr, /* pAllocator */ &m_layout_vk); @@ -179,8 +160,6 @@ bool Anvil::PipelineLayout::bake() if (is_vk_call_successful(result_vk)) { set_vk_handle(m_layout_vk); - - m_dirty = false; } end: @@ -188,23 +167,23 @@ bool Anvil::PipelineLayout::bake() } /* Please see header for specification */ -std::shared_ptr Anvil::PipelineLayout::create(std::weak_ptr in_device_ptr, - std::shared_ptr in_dsg_ptr, - const PushConstantRanges& in_push_constant_ranges, - bool in_mt_safe) +Anvil::PipelineLayoutUniquePtr Anvil::PipelineLayout::create(const Anvil::BaseDevice* in_device_ptr, + const std::vector* in_ds_info_items_ptr, + const PushConstantRanges& in_push_constant_ranges, + bool in_mt_safe) { - std::shared_ptr result_ptr; + PipelineLayoutUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::PipelineLayout(in_device_ptr, - in_dsg_ptr, in_push_constant_ranges, in_mt_safe) ); if (result_ptr != nullptr) { - if (!result_ptr->bake() ) + if (!result_ptr->bake(in_ds_info_items_ptr) ) { result_ptr.reset(); } diff --git a/src/wrappers/pipeline_layout_manager.cpp b/src/wrappers/pipeline_layout_manager.cpp index e524f2c9..e898f7d1 100644 --- a/src/wrappers/pipeline_layout_manager.cpp +++ b/src/wrappers/pipeline_layout_manager.cpp @@ -29,13 +29,11 @@ /** Constructor. */ -Anvil::PipelineLayoutManager::PipelineLayoutManager(std::weak_ptr in_device_ptr, - bool in_mt_safe) +Anvil::PipelineLayoutManager::PipelineLayoutManager(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe) :MTSafetySupportProvider(in_mt_safe), m_device_ptr (in_device_ptr) { - update_subscriptions(true); - /* Register the object */ Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_PIPELINE_LAYOUT_MANAGER, this); @@ -44,21 +42,20 @@ Anvil::PipelineLayoutManager::PipelineLayoutManager(std::weak_ptrunregister_object(Anvil::OBJECT_TYPE_PIPELINE_LAYOUT_MANAGER, this); } /* Please see header for specification */ -std::shared_ptr Anvil::PipelineLayoutManager::create(std::weak_ptr in_device_ptr, - bool in_mt_safe) +Anvil::PipelineLayoutManagerUniquePtr Anvil::PipelineLayoutManager::create(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe) { - std::shared_ptr device_locked_ptr(in_device_ptr); - std::shared_ptr result_ptr; + PipelineLayoutManagerUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::PipelineLayoutManager(in_device_ptr, @@ -66,18 +63,19 @@ std::shared_ptr Anvil::PipelineLayoutManager::crea ); anvil_assert(result_ptr != nullptr); - return result_ptr; } /* Please see header for specification */ -bool Anvil::PipelineLayoutManager::get_layout(std::shared_ptr in_dsg_ptr, - const PushConstantRanges& in_push_constant_ranges, - std::shared_ptr* out_pipeline_layout_ptr_ptr) +bool Anvil::PipelineLayoutManager::get_layout(const std::vector* in_ds_info_items_ptr, + const PushConstantRanges& in_push_constant_ranges, + Anvil::PipelineLayoutUniquePtr* out_pipeline_layout_ptr_ptr) { std::unique_lock mutex_lock; - auto mutex_ptr = get_mutex(); - bool result = false; + auto mutex_ptr = get_mutex(); + const uint32_t n_descriptor_sets_in_in_dsg = static_cast(in_ds_info_items_ptr->size() ); + bool result = false; + Anvil::PipelineLayout* result_pipeline_layout_ptr = nullptr; if (mutex_ptr != nullptr) { @@ -90,40 +88,98 @@ bool Anvil::PipelineLayoutManager::get_layout(std::shared_ptrpipeline_layout_ptr; + auto current_pipeline_ds_info_ptrs = current_pipeline_layout_ptr->get_ds_info_ptrs(); + bool dss_match = true; + const auto n_descriptor_sets_in_current_pipeline_dsg = static_cast(current_pipeline_ds_info_ptrs->size() ); + + if (n_descriptor_sets_in_current_pipeline_dsg != n_descriptor_sets_in_in_dsg) + { + continue; + } - if (current_pipeline_layout_ptr->get_attached_dsg() == in_dsg_ptr && - current_pipeline_layout_ptr->get_attached_push_constant_ranges() == in_push_constant_ranges) + if (current_pipeline_layout_ptr->get_attached_push_constant_ranges() != in_push_constant_ranges) { - *out_pipeline_layout_ptr_ptr = current_pipeline_layout_ptr->shared_from_this(); - result = true; + continue; + } - break; + for (uint32_t n_ds = 0; + n_ds < n_descriptor_sets_in_in_dsg && dss_match; + ++n_ds) + { + auto& in_dsg_ds_info_ptr = in_ds_info_items_ptr->at (n_ds); + const auto& current_pipeline_dsg_ds_info_ptr = current_pipeline_ds_info_ptrs->at(n_ds); + + if ((in_dsg_ds_info_ptr != nullptr && current_pipeline_dsg_ds_info_ptr == nullptr) || + (in_dsg_ds_info_ptr == nullptr && current_pipeline_dsg_ds_info_ptr != nullptr) ) + { + dss_match = false; + + break; + } + + if (in_dsg_ds_info_ptr != nullptr && + current_pipeline_dsg_ds_info_ptr != nullptr) + { + if (!(*in_dsg_ds_info_ptr == *current_pipeline_dsg_ds_info_ptr) ) + { + dss_match = false; + + break; + } + } } + + if (!dss_match) + { + continue; + } + + result = true; + result_pipeline_layout_ptr = current_pipeline_layout_container_ptr->pipeline_layout_ptr.get(); + + current_pipeline_layout_container_ptr->n_references.fetch_add(1); + + break; } if (!result) { - result = true; + auto new_layout_ptr = Anvil::PipelineLayout::create(m_device_ptr, + in_ds_info_items_ptr, + in_push_constant_ranges, + is_mt_safe() ); + auto new_layout_container_ptr = std::unique_ptr( + new PipelineLayoutContainer() + ); - std::shared_ptr new_layout_ptr = Anvil::PipelineLayout::create(m_device_ptr, - in_dsg_ptr, - in_push_constant_ranges, - is_mt_safe() ); + result = true; + result_pipeline_layout_ptr = new_layout_ptr.get(); + new_layout_container_ptr->pipeline_layout_ptr = std::move(new_layout_ptr); - m_pipeline_layouts.push_back(new_layout_ptr.get() ); + m_pipeline_layouts.push_back( + std::move(new_layout_container_ptr) + ); + } - *out_pipeline_layout_ptr_ptr = new_layout_ptr; + if (result) + { + anvil_assert(result_pipeline_layout_ptr != nullptr); + + *out_pipeline_layout_ptr_ptr = Anvil::PipelineLayoutUniquePtr(result_pipeline_layout_ptr, + std::bind(&PipelineLayoutManager::on_pipeline_layout_dereferenced, + this, + result_pipeline_layout_ptr) + ); } return result; } -/** Called back whenever a pipeline layout is released **/ -void Anvil::PipelineLayoutManager::on_pipeline_layout_dropped(CallbackArgument* in_callback_arg_raw_ptr) +void Anvil::PipelineLayoutManager::on_pipeline_layout_dereferenced(Anvil::PipelineLayout* in_layout_ptr) { - auto callback_arg_ptr = dynamic_cast(in_callback_arg_raw_ptr); - PipelineLayouts::iterator layout_iterator; + bool has_found = false; std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -134,35 +190,25 @@ void Anvil::PipelineLayoutManager::on_pipeline_layout_dropped(CallbackArgument* ); } - layout_iterator = std::find(m_pipeline_layouts.begin(), - m_pipeline_layouts.end (), - callback_arg_ptr->object_raw_ptr); - - anvil_assert(layout_iterator != m_pipeline_layouts.end() ); - if (layout_iterator != m_pipeline_layouts.end() ) + for (auto layout_iterator = m_pipeline_layouts.begin(); + layout_iterator != m_pipeline_layouts.end() && !has_found; + ++layout_iterator) { - m_pipeline_layouts.erase(layout_iterator); - } -} + auto& current_pipeline_layout_container_ptr = *layout_iterator; + auto& current_pipeline_layout_ptr = current_pipeline_layout_container_ptr->pipeline_layout_ptr; -void Anvil::PipelineLayoutManager::update_subscriptions(bool in_should_init) -{ - const auto callback_func = std::bind(&PipelineLayoutManager::on_pipeline_layout_dropped, - this, - std::placeholders::_1); - void* callback_owner = this; - auto object_tracker_ptr = Anvil::ObjectTracker::get(); + if (current_pipeline_layout_ptr.get() == in_layout_ptr) + { + has_found = true; - if (in_should_init) - { - object_tracker_ptr->register_for_callbacks(OBJECT_TRACKER_CALLBACK_ID_ON_PIPELINE_LAYOUT_OBJECT_ABOUT_TO_BE_UNREGISTERED, - callback_func, - callback_owner); - } - else - { - object_tracker_ptr->unregister_from_callbacks(OBJECT_TRACKER_CALLBACK_ID_ON_PIPELINE_LAYOUT_OBJECT_ABOUT_TO_BE_UNREGISTERED, - callback_func, - callback_owner); + if (current_pipeline_layout_container_ptr->n_references.fetch_sub(1) == 1) + { + m_pipeline_layouts.erase(layout_iterator); + } + + break; + } } -} + + anvil_assert(has_found); +} \ No newline at end of file diff --git a/src/wrappers/query_pool.cpp b/src/wrappers/query_pool.cpp index 1fc76776..eeeaa606 100644 --- a/src/wrappers/query_pool.cpp +++ b/src/wrappers/query_pool.cpp @@ -28,10 +28,10 @@ /* Please see header for specification */ -Anvil::QueryPool::QueryPool(std::weak_ptr in_device_ptr, - VkQueryType in_query_type, - uint32_t in_n_max_concurrent_queries, - bool in_mt_safe) +Anvil::QueryPool::QueryPool(const Anvil::BaseDevice* in_device_ptr, + VkQueryType in_query_type, + uint32_t in_n_max_concurrent_queries, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT), MTSafetySupportProvider (in_mt_safe), @@ -41,8 +41,7 @@ Anvil::QueryPool::QueryPool(std::weak_ptr in_device_ptr, anvil_assert(in_query_type == VK_QUERY_TYPE_OCCLUSION || in_query_type == VK_QUERY_TYPE_TIMESTAMP); - init(in_device_ptr, - in_query_type, + init(in_query_type, 0, /* in_flags - irrelevant */ in_n_max_concurrent_queries); @@ -52,19 +51,18 @@ Anvil::QueryPool::QueryPool(std::weak_ptr in_device_ptr, } /* Please see header for specification */ -Anvil::QueryPool::QueryPool(std::weak_ptr in_device_ptr, - VkQueryType in_query_type, - VkFlags in_query_flags, - uint32_t in_n_max_concurrent_queries, - bool in_mt_safe) +Anvil::QueryPool::QueryPool(const Anvil::BaseDevice* in_device_ptr, + VkQueryType in_query_type, + VkFlags in_query_flags, + uint32_t in_n_max_concurrent_queries, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT), MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), m_n_max_indices (in_n_max_concurrent_queries) { - init(in_device_ptr, - in_query_type, + init(in_query_type, in_query_flags, in_n_max_concurrent_queries); @@ -83,11 +81,9 @@ Anvil::QueryPool::~QueryPool() if (m_query_pool_vk != VK_NULL_HANDLE) { - std::shared_ptr device_locked_ptr(m_device_ptr); - lock(); { - vkDestroyQueryPool(device_locked_ptr->get_device_vk(), + vkDestroyQueryPool(m_device_ptr->get_device_vk(), m_query_pool_vk, nullptr /* pAllocator */); } @@ -98,14 +94,15 @@ Anvil::QueryPool::~QueryPool() } /* Please see header for specification */ -std::shared_ptr Anvil::QueryPool::create_non_ps_query_pool(std::weak_ptr in_device_ptr, - VkQueryType in_query_type, - uint32_t in_n_max_concurrent_queries, - MTSafety in_mt_safety) +Anvil::QueryPoolUniquePtr Anvil::QueryPool::create_non_ps_query_pool(const Anvil::BaseDevice* in_device_ptr, + VkQueryType in_query_type, + uint32_t in_n_max_concurrent_queries, + MTSafety in_mt_safety) { - const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - std::shared_ptr result_ptr; + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); + QueryPoolUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::QueryPool(in_device_ptr, @@ -118,14 +115,15 @@ std::shared_ptr Anvil::QueryPool::create_non_ps_query_pool(std } /* Please see header for specification */ -std::shared_ptr Anvil::QueryPool::create_ps_query_pool(std::weak_ptr in_device_ptr, - VkQueryPipelineStatisticFlags in_pipeline_statistics, - uint32_t in_n_max_concurrent_queries, - MTSafety in_mt_safety) +Anvil::QueryPoolUniquePtr Anvil::QueryPool::create_ps_query_pool(const Anvil::BaseDevice* in_device_ptr, + VkQueryPipelineStatisticFlags in_pipeline_statistics, + uint32_t in_n_max_concurrent_queries, + MTSafety in_mt_safety) { - const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - std::shared_ptr result_ptr; + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); + QueryPoolUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::QueryPool(in_device_ptr, @@ -139,14 +137,12 @@ std::shared_ptr Anvil::QueryPool::create_ps_query_pool(std::we } /* Please see header for specification */ -void Anvil::QueryPool::init(std::weak_ptr in_device_ptr, - VkQueryType in_query_type, - VkFlags in_query_flags, - uint32_t in_n_max_concurrent_queries) +void Anvil::QueryPool::init(VkQueryType in_query_type, + VkFlags in_query_flags, + uint32_t in_n_max_concurrent_queries) { - VkQueryPoolCreateInfo create_info; - std::shared_ptr device_locked_ptr(m_device_ptr); - VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); + VkQueryPoolCreateInfo create_info; + VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); ANVIL_REDUNDANT_VARIABLE(result_vk); @@ -157,7 +153,7 @@ void Anvil::QueryPool::init(std::weak_ptr in_device_ptr, create_info.queryType = in_query_type; create_info.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO; - result_vk = vkCreateQueryPool(device_locked_ptr->get_device_vk(), + result_vk = vkCreateQueryPool(m_device_ptr->get_device_vk(), &create_info, nullptr, /* pAllocator */ &m_query_pool_vk); diff --git a/src/wrappers/queue.cpp b/src/wrappers/queue.cpp index 9664d2a8..1a48ebc3 100644 --- a/src/wrappers/queue.cpp +++ b/src/wrappers/queue.cpp @@ -22,6 +22,7 @@ #include "misc/debug.h" #include "misc/object_tracker.h" +#include "misc/struct_chainer.h" #include "misc/window.h" #include "wrappers/buffer.h" #include "wrappers/command_buffer.h" @@ -37,10 +38,10 @@ /** Please see header for specification */ -Anvil::Queue::Queue(std::weak_ptr in_device_ptr, - uint32_t in_queue_family_index, - uint32_t in_queue_index, - bool in_mt_safe) +Anvil::Queue::Queue(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_queue_family_index, + uint32_t in_queue_index, + bool in_mt_safe) :CallbacksSupportProvider (QUEUE_CALLBACK_ID_COUNT), DebugMarkerSupportProvider(in_device_ptr, @@ -51,10 +52,8 @@ Anvil::Queue::Queue(std::weak_ptr in_device_ptr, m_queue_family_index (in_queue_family_index), m_queue_index (in_queue_index) { - std::shared_ptr device_locked_ptr(in_device_ptr); - /* Retrieve the Vulkan handle */ - vkGetDeviceQueue(device_locked_ptr->get_device_vk(), + vkGetDeviceQueue(m_device_ptr->get_device_vk(), in_queue_family_index, in_queue_index, &m_queue); @@ -62,7 +61,7 @@ Anvil::Queue::Queue(std::weak_ptr in_device_ptr, anvil_assert(m_queue != VK_NULL_HANDLE); /* Determine whether the queue supports sparse bindings */ - m_supports_sparse_bindings = !!(device_locked_ptr->get_queue_family_info(in_queue_family_index)->flags & VK_QUEUE_SPARSE_BINDING_BIT); + m_supports_sparse_bindings = !!(m_device_ptr->get_queue_family_info(in_queue_family_index)->flags & VK_QUEUE_SPARSE_BINDING_BIT); /* Cache a fence that may be optionally used for submissions */ m_submit_fence_ptr = Anvil::Fence::create(m_device_ptr, @@ -77,8 +76,6 @@ Anvil::Queue::Queue(std::weak_ptr in_device_ptr, /** Please see header for specification */ Anvil::Queue::~Queue() { - m_submit_fence_ptr.reset(); - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_QUEUE, this); } @@ -86,11 +83,11 @@ Anvil::Queue::~Queue() /** Please see header for specification */ bool Anvil::Queue::bind_sparse_memory(Anvil::Utils::SparseMemoryBindingUpdateInfo& in_update) { - const VkBindSparseInfo* bind_info_items = nullptr; - std::shared_ptr fence_ptr; - const bool mt_safe = is_mt_safe(); - uint32_t n_bind_info_items = 0; - VkResult result = VK_ERROR_INITIALIZATION_FAILED; + const VkBindSparseInfo* bind_info_items = nullptr; + Anvil::Fence* fence_ptr = nullptr; + const bool mt_safe = is_mt_safe(); + uint32_t n_bind_info_items = 0; + VkResult result = VK_ERROR_INITIALIZATION_FAILED; in_update.get_bind_sparse_call_args(&n_bind_info_items, &bind_info_items, @@ -136,11 +133,12 @@ bool Anvil::Queue::bind_sparse_memory(Anvil::Utils::SparseMemoryBindingUpdateInf n_buffer_memory_update < n_buffer_memory_updates; ++n_buffer_memory_update) { - VkDeviceSize alloc_size = UINT64_MAX; - VkDeviceSize buffer_memory_start_offset = UINT64_MAX; - std::shared_ptr buffer_ptr; - std::shared_ptr memory_block_ptr; - VkDeviceSize memory_block_start_offset; + VkDeviceSize alloc_size = UINT64_MAX; + VkDeviceSize buffer_memory_start_offset = UINT64_MAX; + Anvil::Buffer* buffer_ptr = nullptr; + bool memory_block_owned_by_buffer = false; + Anvil::MemoryBlock* memory_block_ptr = nullptr; + VkDeviceSize memory_block_start_offset; in_update.get_buffer_memory_update_properties(n_bind_info, n_buffer_memory_update, @@ -148,9 +146,11 @@ bool Anvil::Queue::bind_sparse_memory(Anvil::Utils::SparseMemoryBindingUpdateInf &buffer_memory_start_offset, &memory_block_ptr, &memory_block_start_offset, + &memory_block_owned_by_buffer, &alloc_size); buffer_ptr->set_memory_sparse(memory_block_ptr, + memory_block_owned_by_buffer, memory_block_start_offset, buffer_memory_start_offset, alloc_size); @@ -160,13 +160,14 @@ bool Anvil::Queue::bind_sparse_memory(Anvil::Utils::SparseMemoryBindingUpdateInf n_image_memory_update < n_image_memory_updates; ++n_image_memory_update) { - std::shared_ptr image_ptr; - VkExtent3D extent; - VkSparseMemoryBindFlags flags; - std::shared_ptr memory_block_ptr; - VkDeviceSize memory_block_start_offset; - VkOffset3D offset; - VkImageSubresource subresource; + Anvil::Image* image_ptr = nullptr; + VkExtent3D extent; + VkSparseMemoryBindFlags flags; + bool memory_block_owned_by_image = false; + Anvil::MemoryBlock* memory_block_ptr = nullptr; + VkDeviceSize memory_block_start_offset; + VkOffset3D offset; + VkImageSubresource subresource; in_update.get_image_memory_update_properties(n_bind_info, n_image_memory_update, @@ -176,26 +177,28 @@ bool Anvil::Queue::bind_sparse_memory(Anvil::Utils::SparseMemoryBindingUpdateInf &extent, &flags, &memory_block_ptr, - &memory_block_start_offset); - + &memory_block_start_offset, + &memory_block_owned_by_image); image_ptr->on_memory_backing_update(subresource, offset, extent, memory_block_ptr, - memory_block_start_offset); + memory_block_start_offset, + memory_block_owned_by_image); } for (uint32_t n_image_opaque_memory_update = 0; n_image_opaque_memory_update < n_image_opaque_memory_updates; ++n_image_opaque_memory_update) { - VkSparseMemoryBindFlags flags; - std::shared_ptr image_ptr; - std::shared_ptr memory_block_ptr; - VkDeviceSize memory_block_start_offset; - VkDeviceSize resource_offset; - VkDeviceSize size; + VkSparseMemoryBindFlags flags; + Anvil::Image* image_ptr = nullptr; + bool memory_block_owned_by_image = false; + Anvil::MemoryBlock* memory_block_ptr = nullptr; + VkDeviceSize memory_block_start_offset; + VkDeviceSize resource_offset; + VkDeviceSize size; in_update.get_image_opaque_memory_update_properties(n_bind_info, n_image_opaque_memory_update, @@ -204,12 +207,14 @@ bool Anvil::Queue::bind_sparse_memory(Anvil::Utils::SparseMemoryBindingUpdateInf &size, &flags, &memory_block_ptr, - &memory_block_start_offset); + &memory_block_start_offset, + &memory_block_owned_by_image); image_ptr->on_memory_backing_opaque_update(resource_offset, size, memory_block_ptr, - memory_block_start_offset); + memory_block_start_offset, + memory_block_owned_by_image); } } @@ -219,9 +224,9 @@ bool Anvil::Queue::bind_sparse_memory(Anvil::Utils::SparseMemoryBindingUpdateInf void Anvil::Queue::bind_sparse_memory_lock_unlock(Anvil::Utils::SparseMemoryBindingUpdateInfo& in_update, bool in_should_lock) { - const VkBindSparseInfo* bind_info_items = nullptr; - std::shared_ptr fence_ptr; - uint32_t n_bind_info_items = 0; + const VkBindSparseInfo* bind_info_items = nullptr; + Anvil::Fence* fence_ptr = nullptr; + uint32_t n_bind_info_items = 0; in_update.get_bind_sparse_call_args(&n_bind_info_items, &bind_info_items, @@ -252,13 +257,13 @@ void Anvil::Queue::bind_sparse_memory_lock_unlock(Anvil::Utils::SparseMemoryBind n_bind_info_item < n_bind_info_items; ++n_bind_info_item) { - uint32_t n_buffer_memory_updates = 0; - uint32_t n_image_memory_updates = 0; - uint32_t n_image_opaque_memory_updates = 0; - uint32_t n_signal_sems = 0; - uint32_t n_wait_sems = 0; - const std::shared_ptr* signal_sem_ptrs = nullptr; - const std::shared_ptr* wait_sem_ptrs = nullptr; + uint32_t n_buffer_memory_updates = 0; + uint32_t n_image_memory_updates = 0; + uint32_t n_image_opaque_memory_updates = 0; + uint32_t n_signal_sems = 0; + uint32_t n_wait_sems = 0; + Anvil::Semaphore** signal_sem_ptrs = nullptr; + Anvil::Semaphore** wait_sem_ptrs = nullptr; in_update.get_bind_info_properties(n_bind_info_item, &n_buffer_memory_updates, @@ -301,15 +306,16 @@ void Anvil::Queue::bind_sparse_memory_lock_unlock(Anvil::Utils::SparseMemoryBind n_buffer_memory_update < n_buffer_memory_updates; ++n_buffer_memory_update) { - std::shared_ptr buffer_ptr; + Anvil::Buffer* buffer_ptr = nullptr; in_update.get_buffer_memory_update_properties(n_bind_info_item, n_buffer_memory_update, &buffer_ptr, - nullptr, /* out_opt_buffer_memory_start_offset_ptr */ - nullptr, /* out_opt_memory_block_ptr */ - nullptr, /* out_opt_memory_block_start_offset_ptr */ - nullptr); /* out_opt_size_ptr */ + nullptr, /* out_opt_buffer_memory_start_offset_ptr */ + nullptr, /* out_opt_memory_block_ptr */ + nullptr, /* out_opt_memory_block_start_offset_ptr */ + nullptr, /* out_opt_memory_block_owned_by_buffer_ptr */ + nullptr); /* out_opt_size_ptr */ if (in_should_lock) { @@ -325,17 +331,18 @@ void Anvil::Queue::bind_sparse_memory_lock_unlock(Anvil::Utils::SparseMemoryBind n_image_memory_update < n_image_memory_updates; ++n_image_memory_update) { - std::shared_ptr image_ptr; + Anvil::Image* image_ptr = nullptr; in_update.get_image_memory_update_properties(n_bind_info_item, n_image_memory_update, &image_ptr, - nullptr, /* out_opt_subresource_ptr */ - nullptr, /* out_opt_offset_ptr */ - nullptr, /* out_opt_extent_ptr */ - nullptr, /* out_opt_flags_ptr */ - nullptr, /* out_opt_memory_block_ptr_ptr */ - nullptr); /* out_opt_memory_block_start_offset_ptr */ + nullptr, /* out_opt_subresource_ptr */ + nullptr, /* out_opt_offset_ptr */ + nullptr, /* out_opt_extent_ptr */ + nullptr, /* out_opt_flags_ptr */ + nullptr, /* out_opt_memory_block_ptr_ptr */ + nullptr, /* out_opt_memory_block_start_offset_ptr */ + nullptr); /* out_opt_memory_block_owned_by_image_ptr */ if (in_should_lock) { @@ -351,16 +358,17 @@ void Anvil::Queue::bind_sparse_memory_lock_unlock(Anvil::Utils::SparseMemoryBind n_opaque_image_memory_update < n_image_opaque_memory_updates; ++n_opaque_image_memory_update) { - std::shared_ptr image_ptr; + Anvil::Image* image_ptr = nullptr; in_update.get_image_opaque_memory_update_properties(n_bind_info_item, n_opaque_image_memory_update, &image_ptr, - nullptr, /* out_opt_resource_offset_ptr */ - nullptr, /* out_opt_size_ptr */ - nullptr, /* out_opt_flags_ptr */ - nullptr, /* out_opt_memory_block_ptr_ptr */ - nullptr); /* out_opt_memory_block_start_offset_ptr */ + nullptr, /* out_opt_resource_offset_ptr */ + nullptr, /* out_opt_size_ptr */ + nullptr, /* out_opt_flags_ptr */ + nullptr, /* out_opt_memory_block_ptr_ptr */ + nullptr, /* out_opt_memory_block_start_offset_ptr */ + nullptr); /* out_opt_memory_block_owned_by_image_ptr */ if (in_should_lock) { @@ -375,12 +383,12 @@ void Anvil::Queue::bind_sparse_memory_lock_unlock(Anvil::Utils::SparseMemoryBind } /** Please see header for specification */ -std::shared_ptr Anvil::Queue::create(std::weak_ptr in_device_ptr, - uint32_t in_queue_family_index, - uint32_t in_queue_index, - bool in_mt_safe) +std::unique_ptr Anvil::Queue::create(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_queue_family_index, + uint32_t in_queue_index, + bool in_mt_safe) { - std::shared_ptr result_ptr; + std::unique_ptr result_ptr; result_ptr.reset( new Anvil::Queue(in_device_ptr, @@ -393,58 +401,48 @@ std::shared_ptr Anvil::Queue::create(std::weak_ptr in_swapchain_ptr, - uint32_t in_swapchain_image_index, - uint32_t in_n_wait_semaphores, - std::shared_ptr* in_wait_semaphore_ptrs) +VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, + uint32_t in_swapchain_image_index, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs) { - std::shared_ptr device_locked_ptr (m_device_ptr); - VkPresentInfoKHR image_presentation_info; - VkResult presentation_results [MAX_SWAPCHAINS]; + const Anvil::DeviceType device_type (m_device_ptr->get_type() ); + VkResult presentation_result; VkResult result; + Anvil::StructChainer struct_chainer; const ExtensionKHRSwapchainEntrypoints* swapchain_entrypoints_ptr(nullptr); - VkSwapchainKHR swapchains_vk [MAX_SWAPCHAINS]; - VkSemaphore wait_semaphores_vk [8]; - - /* Sanity checks */ - anvil_assert(in_n_wait_semaphores < sizeof(wait_semaphores_vk) / sizeof(wait_semaphores_vk[0]) ); + VkSwapchainKHR swapchain_vk; + std::vector wait_semaphores_vk (in_n_wait_semaphores); /* If the application is only interested in off-screen rendering, do *not* post the present request, * since the fake swapchain image is not presentable. We still have to wait on the user-specified * semaphores though. */ - if (in_swapchain_ptr != nullptr) + if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU && + in_swapchain_ptr != nullptr) { - std::shared_ptr window_locked_ptr; - std::weak_ptr window_ptr; + Anvil::Window* window_ptr = nullptr; window_ptr = in_swapchain_ptr->get_window(); - if (!window_ptr.expired() ) - { - window_locked_ptr = window_ptr.lock(); - } - - if (window_locked_ptr != nullptr) + if (window_ptr != nullptr) { - const WindowPlatform window_platform = window_locked_ptr->get_platform(); + const WindowPlatform window_platform = window_ptr->get_platform(); if (window_platform == WINDOW_PLATFORM_DUMMY || window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS) { static const VkPipelineStageFlags dst_stage_mask(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT); - device_locked_ptr->get_universal_queue(0)->submit_command_buffer_with_wait_semaphores(nullptr, /* cmd_buffer_ptr */ - in_n_wait_semaphores, - in_wait_semaphore_ptrs, - &dst_stage_mask, - true); /* should_block */ + m_device_ptr->get_universal_queue(0)->submit_command_buffer_with_wait_semaphores(nullptr, /* cmd_buffer_ptr */ + in_n_wait_semaphores, + in_wait_semaphore_ptrs, + &dst_stage_mask, + true); /* should_block */ - { - OnPresentRequestIssuedCallbackArgument callback_argument(in_swapchain_ptr.get() ); + OnPresentRequestIssuedCallbackArgument callback_argument(in_swapchain_ptr); - CallbacksSupportProvider::callback(QUEUE_CALLBACK_ID_PRESENT_REQUEST_ISSUED, - &callback_argument); - } + CallbacksSupportProvider::callback(QUEUE_CALLBACK_ID_PRESENT_REQUEST_ISSUED, + &callback_argument); result = VK_SUCCESS; goto end; @@ -453,11 +451,7 @@ VkResult Anvil::Queue::present(std::shared_ptr in_swapchain_p } /* Convert arrays of Anvil objects to raw Vulkan handle arrays */ - { - anvil_assert(in_swapchain_ptr != nullptr); - - swapchains_vk[0] = in_swapchain_ptr->get_swapchain_vk(); - } + swapchain_vk = in_swapchain_ptr->get_swapchain_vk(); for (uint32_t n_wait_semaphore = 0; n_wait_semaphore < in_n_wait_semaphores; @@ -466,27 +460,35 @@ VkResult Anvil::Queue::present(std::shared_ptr in_swapchain_p wait_semaphores_vk[n_wait_semaphore] = in_wait_semaphore_ptrs[n_wait_semaphore]->get_semaphore(); } - image_presentation_info.pImageIndices = &in_swapchain_image_index; - image_presentation_info.pNext = nullptr; - image_presentation_info.pResults = presentation_results; - image_presentation_info.pSwapchains = swapchains_vk; - image_presentation_info.pWaitSemaphores = wait_semaphores_vk; - image_presentation_info.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR; - image_presentation_info.swapchainCount = 1; - image_presentation_info.waitSemaphoreCount = in_n_wait_semaphores; + { + VkPresentInfoKHR image_presentation_info; + + image_presentation_info.pImageIndices = &in_swapchain_image_index; + image_presentation_info.pNext = nullptr; + image_presentation_info.pResults = &presentation_result; + image_presentation_info.pSwapchains = &swapchain_vk; + image_presentation_info.pWaitSemaphores = (in_n_wait_semaphores != 0) ? &wait_semaphores_vk.at(0) : nullptr; + image_presentation_info.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR; + image_presentation_info.swapchainCount = 1; + image_presentation_info.waitSemaphoreCount = in_n_wait_semaphores; + + struct_chainer.append_struct(image_presentation_info); + } - swapchain_entrypoints_ptr = &m_device_ptr.lock()->get_extension_khr_swapchain_entrypoints(); + swapchain_entrypoints_ptr = &m_device_ptr->get_extension_khr_swapchain_entrypoints(); - present_lock_unlock(1, + present_lock_unlock(1, /* in_n_swapchains */ &in_swapchain_ptr, in_n_wait_semaphores, in_wait_semaphore_ptrs, true); { + auto chain_ptr = struct_chainer.create_chain(); + result = swapchain_entrypoints_ptr->vkQueuePresentKHR(m_queue, - &image_presentation_info); + chain_ptr->get_root_struct() ); } - present_lock_unlock(1, + present_lock_unlock(1, /* in_n_swapchains */ &in_swapchain_ptr, in_n_wait_semaphores, in_wait_semaphore_ptrs, @@ -496,66 +498,61 @@ VkResult Anvil::Queue::present(std::shared_ptr in_swapchain_p if (is_vk_call_successful(result) ) { - for (uint32_t n_presentation = 0; - n_presentation < 1; - ++n_presentation) - { - anvil_assert(is_vk_call_successful(presentation_results[n_presentation])); + anvil_assert(is_vk_call_successful(presentation_result)); - /* Return the most important error code reported */ - if (result != VK_ERROR_DEVICE_LOST) + /* Return the most important error code reported */ + if (result != VK_ERROR_DEVICE_LOST) + { + switch (presentation_result) { - switch (presentation_results[n_presentation]) + case VK_ERROR_DEVICE_LOST: { - case VK_ERROR_DEVICE_LOST: - { - result = VK_ERROR_DEVICE_LOST; + result = VK_ERROR_DEVICE_LOST; - break; - } + break; + } - case VK_ERROR_SURFACE_LOST_KHR: + case VK_ERROR_SURFACE_LOST_KHR: + { + if (result != VK_ERROR_DEVICE_LOST) { - if (result != VK_ERROR_DEVICE_LOST) - { - result = VK_ERROR_SURFACE_LOST_KHR; - } - - break; + result = VK_ERROR_SURFACE_LOST_KHR; } - case VK_ERROR_OUT_OF_DATE_KHR: - { - if (result != VK_ERROR_DEVICE_LOST && - result != VK_ERROR_SURFACE_LOST_KHR) - { - result = VK_ERROR_OUT_OF_DATE_KHR; - } - - break; - } + break; + } - case VK_SUBOPTIMAL_KHR: + case VK_ERROR_OUT_OF_DATE_KHR: + { + if (result != VK_ERROR_DEVICE_LOST && + result != VK_ERROR_SURFACE_LOST_KHR) { - if (result != VK_ERROR_DEVICE_LOST && - result != VK_ERROR_SURFACE_LOST_KHR && - result != VK_ERROR_OUT_OF_DATE_KHR) - { - result = VK_SUBOPTIMAL_KHR; - } - - break; + result = VK_ERROR_OUT_OF_DATE_KHR; } - default: + break; + } + + case VK_SUBOPTIMAL_KHR: + { + if (result != VK_ERROR_DEVICE_LOST && + result != VK_ERROR_SURFACE_LOST_KHR && + result != VK_ERROR_OUT_OF_DATE_KHR) { - anvil_assert(presentation_results[n_presentation] == VK_SUCCESS); + result = VK_SUBOPTIMAL_KHR; } + + break; + } + + default: + { + anvil_assert(presentation_result == VK_SUCCESS); } } { - OnPresentRequestIssuedCallbackArgument callback_argument(in_swapchain_ptr.get() ); + OnPresentRequestIssuedCallbackArgument callback_argument(in_swapchain_ptr); CallbacksSupportProvider::callback(QUEUE_CALLBACK_ID_PRESENT_REQUEST_ISSUED, &callback_argument); @@ -568,11 +565,11 @@ VkResult Anvil::Queue::present(std::shared_ptr in_swapchain_p } /** Please see header for specification */ -void Anvil::Queue::present_lock_unlock(uint32_t in_n_swapchains, - const std::shared_ptr* in_swapchains, - uint32_t in_n_wait_semaphores, - std::shared_ptr* in_wait_semaphore_ptrs, - bool in_should_lock) +void Anvil::Queue::present_lock_unlock(uint32_t in_n_swapchains, + const Anvil::Swapchain* const* in_swapchains, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs, + bool in_should_lock) { if (in_should_lock) { @@ -613,37 +610,32 @@ void Anvil::Queue::present_lock_unlock(uint32_t } /** Please see header for specification */ -void Anvil::Queue::submit_command_buffers(uint32_t in_n_command_buffers, - std::shared_ptr const* in_opt_cmd_buffer_ptrs, - uint32_t in_n_semaphores_to_signal, - std::shared_ptr const* in_opt_semaphore_to_signal_ptr_ptrs, - uint32_t in_n_semaphores_to_wait_on, - std::shared_ptr const* in_opt_semaphore_to_wait_on_ptr_ptrs, - const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, - bool in_should_block, - std::shared_ptr in_opt_fence_ptr) +void Anvil::Queue::submit_command_buffers(uint32_t in_n_command_buffers, + Anvil::CommandBufferBase* const* in_opt_cmd_buffer_ptrs, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptr_ptrs, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptr_ptrs, + const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) { - bool needs_fence_reset(false); - VkResult result (VK_ERROR_INITIALIZATION_FAILED); - VkSubmitInfo submit_info; + bool needs_fence_reset(false); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + VkSubmitInfo submit_info; - VkCommandBuffer cmd_buffers_vk [64]; - VkSemaphore signal_semaphores_vk[64]; - VkSemaphore wait_semaphores_vk [64]; + std::vector cmd_buffers_vk (in_n_command_buffers); + std::vector signal_semaphores_vk(in_n_semaphores_to_signal); + std::vector wait_semaphores_vk (in_n_semaphores_to_wait_on); ANVIL_REDUNDANT_VARIABLE(result); - /* Sanity checks */ - anvil_assert(in_n_command_buffers < sizeof(cmd_buffers_vk) / sizeof(cmd_buffers_vk [0]) ); - anvil_assert(in_n_semaphores_to_signal < sizeof(signal_semaphores_vk) / sizeof(signal_semaphores_vk[0]) ); - anvil_assert(in_n_semaphores_to_wait_on < sizeof(wait_semaphores_vk) / sizeof(wait_semaphores_vk [0]) ); - /* Prepare for the submission */ for (uint32_t n_command_buffer = 0; n_command_buffer < in_n_command_buffers; ++n_command_buffer) { - cmd_buffers_vk[n_command_buffer] = in_opt_cmd_buffer_ptrs[n_command_buffer]->get_command_buffer(); + cmd_buffers_vk.at(n_command_buffer) = in_opt_cmd_buffer_ptrs[n_command_buffer]->get_command_buffer(); } for (uint32_t n_signal_semaphore = 0; @@ -652,22 +644,22 @@ void Anvil::Queue::submit_command_buffers(uint32_t { auto sem_ptr = in_opt_semaphore_to_signal_ptr_ptrs[n_signal_semaphore]; - signal_semaphores_vk[n_signal_semaphore] = sem_ptr->get_semaphore(); + signal_semaphores_vk.at(n_signal_semaphore) = sem_ptr->get_semaphore(); } for (uint32_t n_wait_semaphore = 0; n_wait_semaphore < in_n_semaphores_to_wait_on; ++n_wait_semaphore) { - wait_semaphores_vk[n_wait_semaphore] = in_opt_semaphore_to_wait_on_ptr_ptrs[n_wait_semaphore]->get_semaphore(); + wait_semaphores_vk.at(n_wait_semaphore) = in_opt_semaphore_to_wait_on_ptr_ptrs[n_wait_semaphore]->get_semaphore(); } submit_info.commandBufferCount = in_n_command_buffers; - submit_info.pCommandBuffers = cmd_buffers_vk; + submit_info.pCommandBuffers = (in_n_command_buffers != 0) ? &cmd_buffers_vk.at(0) : nullptr; submit_info.pNext = nullptr; - submit_info.pSignalSemaphores = signal_semaphores_vk; + submit_info.pSignalSemaphores = (in_n_semaphores_to_signal != 0) ? &signal_semaphores_vk.at(0) : nullptr; submit_info.pWaitDstStageMask = in_opt_dst_stage_masks_to_wait_on_ptrs; - submit_info.pWaitSemaphores = wait_semaphores_vk; + submit_info.pWaitSemaphores = (in_n_semaphores_to_wait_on != 0) ? &wait_semaphores_vk.at(0) : nullptr; submit_info.signalSemaphoreCount = in_n_semaphores_to_signal; submit_info.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO; submit_info.waitSemaphoreCount = in_n_semaphores_to_wait_on; @@ -676,7 +668,7 @@ void Anvil::Queue::submit_command_buffers(uint32_t if (in_opt_fence_ptr == nullptr && in_should_block) { - in_opt_fence_ptr = m_submit_fence_ptr; + in_opt_fence_ptr = m_submit_fence_ptr.get(); needs_fence_reset = true; } @@ -703,7 +695,7 @@ void Anvil::Queue::submit_command_buffers(uint32_t if (in_should_block) { /* Wait till initialization finishes GPU-side */ - result = vkWaitForFences(m_device_ptr.lock()->get_device_vk(), + result = vkWaitForFences(m_device_ptr->get_device_vk(), 1, /* fenceCount */ in_opt_fence_ptr->get_fence_ptr(), VK_TRUE, /* waitAll */ @@ -725,14 +717,14 @@ void Anvil::Queue::submit_command_buffers(uint32_t anvil_assert_vk_call_succeeded(result); } -void Anvil::Queue::submit_command_buffers_lock_unlock(uint32_t in_n_command_buffers, - std::shared_ptr const* in_opt_cmd_buffer_ptrs, - uint32_t in_n_semaphores_to_signal, - std::shared_ptr const* in_opt_semaphore_to_signal_ptr_ptrs, - uint32_t in_n_semaphores_to_wait_on, - std::shared_ptr const* in_opt_semaphore_to_wait_on_ptr_ptrs, - std::shared_ptr in_opt_fence_ptr, - bool in_should_lock) +void Anvil::Queue::submit_command_buffers_lock_unlock(uint32_t in_n_command_buffers, + Anvil::CommandBufferBase* const* in_opt_cmd_buffer_ptrs, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptr_ptrs, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptr_ptrs, + Anvil::Fence* in_opt_fence_ptr, + bool in_should_lock) { if (in_should_lock) { @@ -797,4 +789,3 @@ void Anvil::Queue::submit_command_buffers_lock_unlock(uint32_t } } } - diff --git a/src/wrappers/render_pass.cpp b/src/wrappers/render_pass.cpp index 604a0c5e..e3e83ba8 100644 --- a/src/wrappers/render_pass.cpp +++ b/src/wrappers/render_pass.cpp @@ -32,8 +32,8 @@ /** Contsructor. Initializes the Renderpass instance with default values. */ -Anvil::RenderPass::RenderPass(std::unique_ptr in_renderpass_info_ptr, - std::shared_ptr in_opt_swapchain_ptr) +Anvil::RenderPass::RenderPass(Anvil::RenderPassInfoUniquePtr in_renderpass_info_ptr, + Anvil::Swapchain* in_opt_swapchain_ptr) :DebugMarkerSupportProvider(in_renderpass_info_ptr->get_device(), VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT), m_render_pass (VK_NULL_HANDLE), @@ -54,9 +54,7 @@ Anvil::RenderPass::~RenderPass() if (m_render_pass != VK_NULL_HANDLE) { - std::shared_ptr device_locked_ptr(m_render_pass_info_ptr->get_device() ); - - vkDestroyRenderPass(device_locked_ptr->get_device_vk(), + vkDestroyRenderPass(m_render_pass_info_ptr->get_device()->get_device_vk(), m_render_pass, nullptr /* pAllocator */); @@ -69,10 +67,9 @@ Anvil::RenderPass::~RenderPass() /* Please see header for specification */ bool Anvil::RenderPass::init() { - std::shared_ptr device_locked_ptr (m_render_pass_info_ptr->get_device() ); std::vector renderpass_attachments_vk; VkRenderPassCreateInfo render_pass_create_info; - bool result (false); + bool result (false); VkResult result_vk; std::vector subpass_dependencies_vk; std::vector subpass_descriptions_vk; @@ -134,7 +131,7 @@ bool Anvil::RenderPass::init() uint32_t n_max_preserve_attachments; } SubPassAttachmentSet; - std::vector > subpass_attachment_sets; + std::vector > subpass_attachment_sets; anvil_assert(m_render_pass == VK_NULL_HANDLE); @@ -186,10 +183,11 @@ bool Anvil::RenderPass::init() subpass_iterator != m_render_pass_info_ptr->m_subpasses.cend(); ++subpass_iterator) { - std::shared_ptr current_subpass_attachment_set_ptr; + std::unique_ptr current_subpass_attachment_set_ptr; uint32_t highest_subpass_color_attachment_location = UINT32_MAX; uint32_t highest_subpass_input_attachment_index = UINT32_MAX; bool need_color_resolve_attachments = false; + const uint32_t subpass_index = static_cast(subpass_iterator - m_render_pass_info_ptr->m_subpasses.begin() ); VkSubpassDescription subpass_vk; VkAttachmentReference unused_reference; @@ -325,7 +323,10 @@ bool Anvil::RenderPass::init() current_subpass_attachment_set_ptr->do_sanity_checks(); - subpass_attachment_sets.push_back(current_subpass_attachment_set_ptr); + subpass_attachment_sets.push_back( + std::move(current_subpass_attachment_set_ptr) + ); + subpass_descriptions_vk.push_back(subpass_vk); } @@ -343,7 +344,7 @@ bool Anvil::RenderPass::init() : nullptr; render_pass_create_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO; - result_vk = vkCreateRenderPass(device_locked_ptr->get_device_vk(), + result_vk = vkCreateRenderPass(m_device_ptr->get_device_vk(), &render_pass_create_info, nullptr, /* pAllocator */ &m_render_pass); @@ -364,10 +365,11 @@ bool Anvil::RenderPass::init() } /* Please see header for specification */ -std::shared_ptr Anvil::RenderPass::create(std::unique_ptr in_renderpass_info_ptr, - std::shared_ptr in_opt_swapchain_ptr) +Anvil::RenderPassUniquePtr Anvil::RenderPass::create(Anvil::RenderPassInfoUniquePtr in_renderpass_info_ptr, + Anvil::Swapchain* in_opt_swapchain_ptr) { - std::shared_ptr result_ptr; + std::unique_ptr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::RenderPass(std::move(in_renderpass_info_ptr), @@ -382,5 +384,5 @@ std::shared_ptr Anvil::RenderPass::create(std::unique_ptr in_instance_ptr, - std::weak_ptr in_device_ptr, - std::shared_ptr in_window_ptr, - bool in_mt_safe, - bool* out_safe_to_use_ptr) +Anvil::RenderingSurface::RenderingSurface(Anvil::Instance* in_instance_ptr, + const Anvil::BaseDevice* in_device_ptr, + const Anvil::Window* in_window_ptr, + bool in_mt_safe, + bool* out_safe_to_use_ptr) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT), MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), m_height (0), m_instance_ptr (in_instance_ptr), - m_stream_index (UINT32_MAX), m_surface (VK_NULL_HANDLE), - m_type (RENDERING_SURFACE_TYPE_GENERAL), m_width (0), m_window_ptr (in_window_ptr) { @@ -62,11 +61,9 @@ Anvil::RenderingSurface::~RenderingSurface() if (m_surface != VK_NULL_HANDLE) { - std::shared_ptr instance_locked_ptr(m_instance_ptr); - lock(); { - m_instance_ptr->get_extension_khr_surface_entrypoints().vkDestroySurfaceKHR(instance_locked_ptr->get_instance_vk(), + m_instance_ptr->get_extension_khr_surface_entrypoints().vkDestroySurfaceKHR(m_instance_ptr->get_instance_vk(), m_surface, nullptr /* pAllocator */); } @@ -79,27 +76,24 @@ Anvil::RenderingSurface::~RenderingSurface() /* Please see header for specification */ void Anvil::RenderingSurface::cache_surface_properties() { - std::shared_ptr device_locked_ptr (m_device_ptr); - const Anvil::DeviceType& device_type (device_locked_ptr->get_type() ); - bool is_offscreen_rendering_enabled(true); - auto khr_surface_entrypoints (m_instance_ptr->get_extension_khr_surface_entrypoints() ); - uint32_t n_physical_devices (0); - std::shared_ptr sgpu_device_locked_ptr (std::dynamic_pointer_cast(device_locked_ptr)); - std::vector supported_formats; - - if (m_window_ptr.lock() ) + const Anvil::DeviceType& device_type (m_device_ptr->get_type() ); + bool is_offscreen_rendering_enabled(true); + auto khr_surface_entrypoints (m_instance_ptr->get_extension_khr_surface_entrypoints() ); + uint32_t n_physical_devices (0); + const Anvil::SGPUDevice* sgpu_device_ptr (dynamic_cast(m_device_ptr)); + std::vector supported_formats; + + if (m_window_ptr != nullptr) { - std::shared_ptr window_locked_ptr(m_window_ptr); - const WindowPlatform window_platform (window_locked_ptr->get_platform() ); + const WindowPlatform window_platform(m_window_ptr->get_platform() ); is_offscreen_rendering_enabled = (window_platform == WINDOW_PLATFORM_DUMMY || - window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS) && - (m_type == RENDERING_SURFACE_TYPE_GENERAL); + window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS); if (is_offscreen_rendering_enabled) { - m_height = window_locked_ptr->get_height_at_creation_time(); - m_width = window_locked_ptr->get_width_at_creation_time (); + m_height = m_window_ptr->get_height_at_creation_time(); + m_width = m_window_ptr->get_width_at_creation_time (); } else { @@ -113,7 +107,7 @@ void Anvil::RenderingSurface::cache_surface_properties() switch (device_type) { - case Anvil::DEVICE_TYPE_SINGLE_GPU: n_physical_devices = 1; break; + case Anvil::DEVICE_TYPE_SINGLE_GPU: n_physical_devices = 1;break; default: { @@ -122,9 +116,9 @@ void Anvil::RenderingSurface::cache_surface_properties() } /* Retrieve general properties */ - uint32_t n_supported_formats (0); - uint32_t n_supported_presentation_modes(0); - VkResult result (VK_ERROR_INITIALIZATION_FAILED); + uint32_t n_supported_formats (0); + uint32_t n_supported_presentation_modes(0); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); ANVIL_REDUNDANT_VARIABLE(result); @@ -132,11 +126,11 @@ void Anvil::RenderingSurface::cache_surface_properties() n_physical_device < n_physical_devices; ++n_physical_device) { - std::shared_ptr physical_device_locked_ptr; + const Anvil::PhysicalDevice* physical_device_ptr = nullptr; switch (device_type) { - case Anvil::DEVICE_TYPE_SINGLE_GPU: physical_device_locked_ptr = sgpu_device_locked_ptr->get_physical_device().lock(); break; + case Anvil::DEVICE_TYPE_SINGLE_GPU: physical_device_ptr = sgpu_device_ptr->get_physical_device(); break; default: { @@ -144,9 +138,9 @@ void Anvil::RenderingSurface::cache_surface_properties() } } - auto& result_caps = m_physical_device_capabilities.at(0); + auto& result_caps = m_physical_device_capabilities; - if (is_offscreen_rendering_enabled) + if (m_surface == VK_NULL_HANDLE) { result_caps.supported_composite_alpha_flags = VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR; result_caps.supported_transformations = VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR; @@ -155,10 +149,12 @@ void Anvil::RenderingSurface::cache_surface_properties() VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_STORAGE_BIT); + result_caps.supported_presentation_modes.push_back(VK_PRESENT_MODE_IMMEDIATE_KHR); + continue; } - const VkPhysicalDevice physical_device_vk = physical_device_locked_ptr->get_physical_device(); + const VkPhysicalDevice physical_device_vk = physical_device_ptr->get_physical_device(); result = khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physical_device_vk, m_surface, @@ -227,15 +223,16 @@ void Anvil::RenderingSurface::cache_surface_properties() } /* Please see header for specification */ -std::shared_ptr Anvil::RenderingSurface::create(std::weak_ptr in_instance_ptr, - std::weak_ptr in_device_ptr, - std::shared_ptr in_window_ptr, - MTSafety in_mt_safety) +Anvil::RenderingSurfaceUniquePtr Anvil::RenderingSurface::create(Anvil::Instance* in_instance_ptr, + const Anvil::BaseDevice* in_device_ptr, + const Anvil::Window* in_window_ptr, + MTSafety in_mt_safety) { - const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - std::shared_ptr result_ptr; - bool success = false; + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); + RenderingSurfaceUniquePtr result_ptr(nullptr, + std::default_delete() ); + bool success = false; result_ptr.reset( new Anvil::RenderingSurface(in_instance_ptr, @@ -253,103 +250,60 @@ std::shared_ptr Anvil::RenderingSurface::create(std::we } /* Please see header for specification */ -bool Anvil::RenderingSurface::get_capabilities(std::weak_ptr in_physical_device_ptr, - VkSurfaceCapabilitiesKHR* out_surface_caps_ptr) const +bool Anvil::RenderingSurface::get_capabilities(VkSurfaceCapabilitiesKHR* out_surface_caps_ptr) const { - auto caps_iterator = m_physical_device_capabilities.find(0); - bool result = false; + *out_surface_caps_ptr = m_physical_device_capabilities.capabilities; - if (caps_iterator != m_physical_device_capabilities.end() ) - { - *out_surface_caps_ptr = caps_iterator->second.capabilities; - result = true; - } - - /* All done */ - return result; + return true; } /* Please see header for specification */ -bool Anvil::RenderingSurface::get_queue_families_with_present_support(std::weak_ptr in_physical_device_ptr, - const std::vector** out_result_ptr) const +bool Anvil::RenderingSurface::get_queue_families_with_present_support(const std::vector** out_result_ptr) const { - auto caps_iterator = m_physical_device_capabilities.find(0); - bool result = false; - - if (caps_iterator != m_physical_device_capabilities.end() ) - { - *out_result_ptr = &caps_iterator->second.present_capable_queue_fams; - result = true; - } + *out_result_ptr = &m_physical_device_capabilities.present_capable_queue_fams; /* All done */ - return result; + return true; } /* Please see header for specification */ -bool Anvil::RenderingSurface::get_supported_composite_alpha_flags(std::weak_ptr in_physical_device_ptr, - VkCompositeAlphaFlagsKHR* out_result_ptr) const +bool Anvil::RenderingSurface::get_supported_composite_alpha_flags(VkCompositeAlphaFlagsKHR* out_result_ptr) const { - auto caps_iterator = m_physical_device_capabilities.find(0); - bool result = false; - - if (caps_iterator != m_physical_device_capabilities.end() ) - { - *out_result_ptr = caps_iterator->second.supported_composite_alpha_flags; - result = true; - } + *out_result_ptr = m_physical_device_capabilities.supported_composite_alpha_flags; /* All done */ - return result; + return true; } /* Please see header for specification */ -bool Anvil::RenderingSurface::get_supported_transformations(std::weak_ptr in_physical_device_ptr, - VkSurfaceTransformFlagsKHR* out_result_ptr) const +bool Anvil::RenderingSurface::get_supported_transformations(VkSurfaceTransformFlagsKHR* out_result_ptr) const { - auto caps_iterator = m_physical_device_capabilities.find(0); - bool result = false; - - if (caps_iterator != m_physical_device_capabilities.end() ) - { - *out_result_ptr = caps_iterator->second.supported_transformations; - result = true; - } + *out_result_ptr = m_physical_device_capabilities.supported_transformations; /* All done */ - return result; + return true; } /* Please see header for specification */ -bool Anvil::RenderingSurface::get_supported_usages(std::weak_ptr in_physical_device_ptr, - VkImageUsageFlags* out_result_ptr) const +bool Anvil::RenderingSurface::get_supported_usages(VkImageUsageFlags* out_result_ptr) const { - auto caps_iterator = m_physical_device_capabilities.find(0); - bool result = false; - - if (caps_iterator != m_physical_device_capabilities.end() ) - { - *out_result_ptr = caps_iterator->second.supported_usages; - result = true; - } + *out_result_ptr = m_physical_device_capabilities.supported_usages; /* All done */ - return result; + return true; } /* Please see header for specification */ bool Anvil::RenderingSurface::init() { - std::shared_ptr device_locked_ptr (m_device_ptr); - const Anvil::DeviceType& device_type (device_locked_ptr->get_type() ); - bool init_successful (false); - uint32_t n_physical_devices (0); - VkResult result (VK_SUCCESS); - const WindowPlatform window_platform ((m_type == RENDERING_SURFACE_TYPE_GENERAL) ? m_window_ptr.lock()->get_platform() - : WINDOW_PLATFORM_UNKNOWN); + const Anvil::DeviceType& device_type (m_device_ptr->get_type() ); + bool init_successful (false); + uint32_t n_physical_devices(0); + VkResult result (VK_SUCCESS); + const WindowPlatform window_platform (m_window_ptr->get_platform()); - const bool is_dummy_window_platform(window_platform == WINDOW_PLATFORM_DUMMY || - window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS); + const bool is_dummy_window_platform(window_platform == WINDOW_PLATFORM_DUMMY || + window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS); switch (device_type) @@ -372,57 +326,38 @@ bool Anvil::RenderingSurface::init() if (!is_dummy_window_platform) { - std::shared_ptr instance_locked_ptr(m_instance_ptr); - - switch (m_type) + #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) && defined(_WIN32) { - #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) || defined(ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT) - case RENDERING_SURFACE_TYPE_GENERAL: - { - #ifdef _WIN32 - { - VkWin32SurfaceCreateInfoKHR surface_create_info; - - surface_create_info.flags = 0; - surface_create_info.hinstance = GetModuleHandle(nullptr); - surface_create_info.hwnd = m_window_ptr.lock()->get_handle(); - surface_create_info.pNext = nullptr; - surface_create_info.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR; - - result = m_instance_ptr->get_extension_khr_win32_surface_entrypoints().vkCreateWin32SurfaceKHR(instance_locked_ptr->get_instance_vk(), - &surface_create_info, - nullptr, /* pAllocator */ - &m_surface); - } - #else - { - VkXcbSurfaceCreateInfoKHR surface_create_info; - - surface_create_info.flags = 0; - surface_create_info.window = m_window_ptr.lock()->get_handle(); - surface_create_info.connection = static_cast(m_window_ptr.lock()->get_connection()); - surface_create_info.pNext = nullptr; - surface_create_info.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR; - - result = m_instance_ptr->get_extension_khr_xcb_surface_entrypoints().vkCreateXcbSurfaceKHR(instance_locked_ptr->get_instance_vk(), - &surface_create_info, - nullptr, /* pAllocator */ - &m_surface); - } - #endif - - break; - } - #endif - - default: - { - anvil_assert_fail(); - - goto end; - } + VkWin32SurfaceCreateInfoKHR surface_create_info; + + surface_create_info.flags = 0; + surface_create_info.hinstance = GetModuleHandle(nullptr); + surface_create_info.hwnd = m_window_ptr->get_handle(); + surface_create_info.pNext = nullptr; + surface_create_info.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR; + + result = m_instance_ptr->get_extension_khr_win32_surface_entrypoints().vkCreateWin32SurfaceKHR(m_instance_ptr->get_instance_vk(), + &surface_create_info, + nullptr, /* pAllocator */ + &m_surface); } - + #endif + #if defined(ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT) && !defined(_WIN32) + { + VkXcbSurfaceCreateInfoKHR surface_create_info; + + surface_create_info.flags = 0; + surface_create_info.window = m_window_ptr->get_handle(); + surface_create_info.connection = static_cast(m_window_ptr->get_connection()); + surface_create_info.pNext = nullptr; + surface_create_info.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR; + + result = m_instance_ptr->get_extension_khr_xcb_surface_entrypoints().vkCreateXcbSurfaceKHR(m_instance_ptr->get_instance_vk(), + &surface_create_info, + nullptr, /* pAllocator */ + &m_surface); + } + #endif anvil_assert_vk_call_succeeded(result); if (is_vk_call_successful(result) ) { @@ -434,27 +369,27 @@ bool Anvil::RenderingSurface::init() anvil_assert(window_platform != WINDOW_PLATFORM_UNKNOWN); } - if ((is_dummy_window_platform == false) ) + if (is_dummy_window_platform == false) { /* Is there at least one queue fam that can be used together with at least one physical device associated with * the logical device to present using the surface we've just spawned and the physical device user has specified? */ - const auto& queue_families(device_locked_ptr->get_physical_device_queue_families() ); + const auto& queue_families(m_device_ptr->get_physical_device_queue_families() ); for (uint32_t n_physical_device = 0; n_physical_device < n_physical_devices; ++n_physical_device) { - Anvil::RenderingSurface::PhysicalDeviceCapabilities* physical_device_caps_ptr = nullptr; - std::shared_ptr physical_device_locked_ptr; + Anvil::RenderingSurface::PhysicalDeviceCapabilities* physical_device_caps_ptr = nullptr; + const Anvil::PhysicalDevice* physical_device_ptr = nullptr; switch (device_type) { case Anvil::DEVICE_TYPE_SINGLE_GPU: { - std::shared_ptr sgpu_device_locked_ptr(std::dynamic_pointer_cast(device_locked_ptr) ); + const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr) ); - physical_device_locked_ptr = sgpu_device_locked_ptr->get_physical_device().lock(); - physical_device_caps_ptr = &m_physical_device_capabilities[0]; + physical_device_ptr = sgpu_device_ptr->get_physical_device(); + physical_device_caps_ptr = &m_physical_device_capabilities; break; } @@ -467,34 +402,23 @@ bool Anvil::RenderingSurface::init() } } - switch (m_type) + for (uint32_t n_queue_family = 0; + n_queue_family < static_cast(queue_families.size() ); + ++n_queue_family) { - case Anvil::RENDERING_SURFACE_TYPE_GENERAL: - { - for (uint32_t n_queue_family = 0; - n_queue_family < static_cast(queue_families.size() ); - ++n_queue_family) - { - VkBool32 is_presentation_supported = VK_FALSE; - - result = vkGetPhysicalDeviceSurfaceSupportKHR(physical_device_locked_ptr->get_physical_device(), - n_queue_family, - m_surface, - &is_presentation_supported); - - if (is_vk_call_successful(result) && - is_presentation_supported == VK_TRUE) - { - physical_device_caps_ptr->present_capable_queue_fams.push_back(n_queue_family); - } - } + VkBool32 is_presentation_supported = VK_FALSE; - break; + { + result = vkGetPhysicalDeviceSurfaceSupportKHR(physical_device_ptr->get_physical_device(), + n_queue_family, + m_surface, + &is_presentation_supported); } - default: + if (is_vk_call_successful(result) && + is_presentation_supported == VK_TRUE) { - anvil_assert_fail(); + physical_device_caps_ptr->present_capable_queue_fams.push_back(n_queue_family); } } } @@ -510,14 +434,13 @@ bool Anvil::RenderingSurface::init() { case Anvil::DEVICE_TYPE_SINGLE_GPU: { - std::shared_ptr sgpu_device_locked_ptr(std::dynamic_pointer_cast(device_locked_ptr) ); + const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr) ); - if (sgpu_device_locked_ptr->get_n_universal_queues() > 0) + if (sgpu_device_ptr->get_n_universal_queues() > 0) { - std::shared_ptr physical_device_locked_ptr = sgpu_device_locked_ptr->get_physical_device().lock(); - auto& result_caps = m_physical_device_capabilities[0]; + auto& result_caps = m_physical_device_capabilities; - result_caps.present_capable_queue_fams.push_back(sgpu_device_locked_ptr->get_universal_queue(0)->get_queue_family_index() ); + result_caps.present_capable_queue_fams.push_back(sgpu_device_ptr->get_universal_queue(0)->get_queue_family_index() ); } break; @@ -554,39 +477,23 @@ bool Anvil::RenderingSurface::init() } /* Please see header for specification */ -bool Anvil::RenderingSurface::is_compatible_with_image_format(std::weak_ptr in_physical_device_ptr, - VkFormat in_image_format, - bool* out_result_ptr) const +bool Anvil::RenderingSurface::is_compatible_with_image_format(VkFormat in_image_format, + bool* out_result_ptr) const { - auto caps_iterator = m_physical_device_capabilities.find(0); - bool result = false; + *out_result_ptr = std::find(m_physical_device_capabilities.supported_formats.begin(), + m_physical_device_capabilities.supported_formats.end(), + in_image_format) != m_physical_device_capabilities.supported_formats.end(); - if (caps_iterator != m_physical_device_capabilities.end() ) - { - *out_result_ptr = std::find(caps_iterator->second.supported_formats.begin(), - caps_iterator->second.supported_formats.end(), - in_image_format) != caps_iterator->second.supported_formats.end(); - result = true; - } - - return result; + return true; } /* Please see header for specification */ -bool Anvil::RenderingSurface::supports_presentation_mode(std::weak_ptr in_physical_device_ptr, - VkPresentModeKHR in_presentation_mode, - bool* out_result_ptr) const +bool Anvil::RenderingSurface::supports_presentation_mode(VkPresentModeKHR in_presentation_mode, + bool* out_result_ptr) const { - auto caps_iterator = m_physical_device_capabilities.find(0); - bool result = false; - - if (caps_iterator != m_physical_device_capabilities.end() ) - { - *out_result_ptr = std::find(caps_iterator->second.supported_presentation_modes.begin(), - caps_iterator->second.supported_presentation_modes.end(), - in_presentation_mode) != caps_iterator->second.supported_presentation_modes.end(); - result = true; - } + *out_result_ptr = std::find(m_physical_device_capabilities.supported_presentation_modes.begin(), + m_physical_device_capabilities.supported_presentation_modes.end(), + in_presentation_mode) != m_physical_device_capabilities.supported_presentation_modes.end(); - return result; + return true; } \ No newline at end of file diff --git a/src/wrappers/sampler.cpp b/src/wrappers/sampler.cpp index fa438c25..9bbaaeb3 100644 --- a/src/wrappers/sampler.cpp +++ b/src/wrappers/sampler.cpp @@ -22,27 +22,28 @@ #include "misc/debug.h" #include "misc/object_tracker.h" +#include "misc/struct_chainer.h" #include "wrappers/device.h" #include "wrappers/physical_device.h" #include "wrappers/sampler.h" /** Please see header for specification */ -Anvil::Sampler::Sampler(std::weak_ptr in_device_ptr, - VkFilter in_mag_filter, - VkFilter in_min_filter, - VkSamplerMipmapMode in_mipmap_mode, - VkSamplerAddressMode in_address_mode_u, - VkSamplerAddressMode in_address_mode_v, - VkSamplerAddressMode in_address_mode_w, - float in_lod_bias, - float in_max_anisotropy, - bool in_compare_enable, - VkCompareOp in_compare_op, - float in_min_lod, - float in_max_lod, - VkBorderColor in_border_color, - bool in_use_unnormalized_coordinates, - bool in_mt_safe) +Anvil::Sampler::Sampler(const Anvil::BaseDevice* in_device_ptr, + VkFilter in_mag_filter, + VkFilter in_min_filter, + VkSamplerMipmapMode in_mipmap_mode, + VkSamplerAddressMode in_address_mode_u, + VkSamplerAddressMode in_address_mode_v, + VkSamplerAddressMode in_address_mode_w, + float in_lod_bias, + float in_max_anisotropy, + bool in_compare_enable, + VkCompareOp in_compare_op, + float in_min_lod, + float in_max_lod, + VkBorderColor in_border_color, + bool in_use_unnormalized_coordinates, + bool in_mt_safe) :DebugMarkerSupportProvider (in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT), MTSafetySupportProvider (in_mt_safe), @@ -63,36 +64,45 @@ Anvil::Sampler::Sampler(std::weak_ptr in_device_ptr, m_sampler (VK_NULL_HANDLE), m_use_unnormalized_coordinates(in_use_unnormalized_coordinates) { - std::shared_ptr device_locked_ptr (m_device_ptr); - VkSamplerCreateInfo sampler_create_info; - VkResult result (VK_ERROR_INITIALIZATION_FAILED); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + Anvil::StructChainer struct_chainer; ANVIL_REDUNDANT_VARIABLE(result); /* Spawn a new sampler */ - sampler_create_info.addressModeU = in_address_mode_u; - sampler_create_info.addressModeV = in_address_mode_v; - sampler_create_info.addressModeW = in_address_mode_w; - sampler_create_info.anisotropyEnable = static_cast((in_max_anisotropy > 1.0f) ? VK_TRUE : VK_FALSE); - sampler_create_info.borderColor = in_border_color; - sampler_create_info.compareEnable = static_cast(in_compare_enable ? VK_TRUE : VK_FALSE); - sampler_create_info.compareOp = in_compare_op; - sampler_create_info.flags = 0; - sampler_create_info.magFilter = in_mag_filter; - sampler_create_info.maxAnisotropy = in_max_anisotropy; - sampler_create_info.maxLod = in_max_lod; - sampler_create_info.minFilter = in_min_filter; - sampler_create_info.minLod = in_min_lod; - sampler_create_info.mipLodBias = in_lod_bias; - sampler_create_info.mipmapMode = in_mipmap_mode; - sampler_create_info.pNext = nullptr; - sampler_create_info.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO; - sampler_create_info.unnormalizedCoordinates = static_cast(in_use_unnormalized_coordinates ? VK_TRUE : VK_FALSE); - - result = vkCreateSampler(device_locked_ptr->get_device_vk(), - &sampler_create_info, - nullptr, /* pAllocator */ - &m_sampler); + { + VkSamplerCreateInfo sampler_create_info; + + sampler_create_info.addressModeU = in_address_mode_u; + sampler_create_info.addressModeV = in_address_mode_v; + sampler_create_info.addressModeW = in_address_mode_w; + sampler_create_info.anisotropyEnable = static_cast((in_max_anisotropy > 1.0f) ? VK_TRUE : VK_FALSE); + sampler_create_info.borderColor = in_border_color; + sampler_create_info.compareEnable = static_cast(in_compare_enable ? VK_TRUE : VK_FALSE); + sampler_create_info.compareOp = in_compare_op; + sampler_create_info.flags = 0; + sampler_create_info.magFilter = in_mag_filter; + sampler_create_info.maxAnisotropy = in_max_anisotropy; + sampler_create_info.maxLod = in_max_lod; + sampler_create_info.minFilter = in_min_filter; + sampler_create_info.minLod = in_min_lod; + sampler_create_info.mipLodBias = in_lod_bias; + sampler_create_info.mipmapMode = in_mipmap_mode; + sampler_create_info.pNext = nullptr; + sampler_create_info.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO; + sampler_create_info.unnormalizedCoordinates = static_cast(in_use_unnormalized_coordinates ? VK_TRUE : VK_FALSE); + + struct_chainer.append_struct(sampler_create_info); + } + + { + auto chain_ptr = struct_chainer.create_chain(); + + result = vkCreateSampler(m_device_ptr->get_device_vk(), + chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_sampler); + } anvil_assert_vk_call_succeeded(result); if (is_vk_call_successful(result) ) @@ -113,11 +123,9 @@ Anvil::Sampler::~Sampler() if (m_sampler != VK_NULL_HANDLE) { - std::shared_ptr device_locked_ptr(m_device_ptr); - lock(); { - vkDestroySampler(device_locked_ptr->get_device_vk(), + vkDestroySampler(m_device_ptr->get_device_vk(), m_sampler, nullptr /* pAllocator */); } @@ -128,27 +136,27 @@ Anvil::Sampler::~Sampler() } /* Please see header for specification */ -std::shared_ptr Anvil::Sampler::create(std::weak_ptr in_device_ptr, - VkFilter in_mag_filter, - VkFilter in_min_filter, - VkSamplerMipmapMode in_mipmap_mode, - VkSamplerAddressMode in_address_mode_u, - VkSamplerAddressMode in_address_mode_v, - VkSamplerAddressMode in_address_mode_w, - float in_lod_bias, - float in_max_anisotropy, - bool in_compare_enable, - VkCompareOp in_compare_op, - float in_min_lod, - float in_max_lod, - VkBorderColor in_border_color, - bool in_use_unnormalized_coordinates, - MTSafety in_mt_safety) +Anvil::SamplerUniquePtr Anvil::Sampler::create(const Anvil::BaseDevice* in_device_ptr, + VkFilter in_mag_filter, + VkFilter in_min_filter, + VkSamplerMipmapMode in_mipmap_mode, + VkSamplerAddressMode in_address_mode_u, + VkSamplerAddressMode in_address_mode_v, + VkSamplerAddressMode in_address_mode_w, + float in_lod_bias, + float in_max_anisotropy, + bool in_compare_enable, + VkCompareOp in_compare_op, + float in_min_lod, + float in_max_lod, + VkBorderColor in_border_color, + bool in_use_unnormalized_coordinates, + MTSafety in_mt_safety) { - std::shared_ptr device_locked_ptr(in_device_ptr); - const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); - std::shared_ptr result_ptr; + const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ); + SamplerUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::Sampler(in_device_ptr, diff --git a/src/wrappers/semaphore.cpp b/src/wrappers/semaphore.cpp index d0265581..ceaf4c53 100644 --- a/src/wrappers/semaphore.cpp +++ b/src/wrappers/semaphore.cpp @@ -26,8 +26,8 @@ #include "wrappers/semaphore.h" /* Please see header for specification */ -Anvil::Semaphore::Semaphore(std::weak_ptr in_device_ptr, - bool in_mt_safe) +Anvil::Semaphore::Semaphore(const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT), MTSafetySupportProvider (in_mt_safe), @@ -50,12 +50,13 @@ Anvil::Semaphore::~Semaphore() } /** Please see header for specification */ -std::shared_ptr Anvil::Semaphore::create(std::weak_ptr in_device_ptr, - MTSafety in_mt_safety) +Anvil::SemaphoreUniquePtr Anvil::Semaphore::create(const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety) { - const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - std::shared_ptr result_ptr; + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); + SemaphoreUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::Semaphore(in_device_ptr, @@ -70,11 +71,9 @@ void Anvil::Semaphore::release_semaphore() { if (m_semaphore != VK_NULL_HANDLE) { - std::shared_ptr device_locked_ptr(m_device_ptr); - lock(); { - vkDestroySemaphore(device_locked_ptr->get_device_vk(), + vkDestroySemaphore(m_device_ptr->get_device_vk(), m_semaphore, nullptr /* pAllocator */); } @@ -88,7 +87,6 @@ void Anvil::Semaphore::release_semaphore() /* Please see header for specification */ void Anvil::Semaphore::reset() { - std::shared_ptr device_locked_ptr (m_device_ptr); VkResult result (VK_ERROR_INITIALIZATION_FAILED); VkSemaphoreCreateInfo semaphore_create_info; @@ -101,7 +99,7 @@ void Anvil::Semaphore::reset() semaphore_create_info.pNext = nullptr; semaphore_create_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; - result = vkCreateSemaphore(device_locked_ptr->get_device_vk(), + result = vkCreateSemaphore(m_device_ptr->get_device_vk(), &semaphore_create_info, nullptr, /* pAllocator */ &m_semaphore); diff --git a/src/wrappers/shader_module.cpp b/src/wrappers/shader_module.cpp index 8d6f2aff..0009e748 100644 --- a/src/wrappers/shader_module.cpp +++ b/src/wrappers/shader_module.cpp @@ -34,14 +34,13 @@ /** Please see header for specification */ -Anvil::ShaderModule::ShaderModule(std::weak_ptr in_device_ptr, - std::shared_ptr in_spirv_generator_ptr, - bool in_mt_safe) +Anvil::ShaderModule::ShaderModule(const Anvil::BaseDevice* in_device_ptr, + GLSLShaderToSPIRVGenerator* in_spirv_generator_ptr, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT), MTSafetySupportProvider (in_mt_safe), - m_device_ptr (in_device_ptr), - m_device_raw_ptr (in_device_ptr.lock().get() ) + m_device_ptr (in_device_ptr) { bool result = false; const char* shader_spirv_blob = in_spirv_generator_ptr->get_spirv_blob(); @@ -68,22 +67,21 @@ Anvil::ShaderModule::ShaderModule(std::weak_ptr in } /** Please see header for specification */ -Anvil::ShaderModule::ShaderModule(std::weak_ptr in_device_ptr, - const char* in_spirv_blob, - uint32_t in_n_spirv_blob_bytes, - const std::string& in_cs_entrypoint_name, - const std::string& in_fs_entrypoint_name, - const std::string& in_gs_entrypoint_name, - const std::string& in_tc_entrypoint_name, - const std::string& in_te_entrypoint_name, - const std::string& in_vs_entrypoint_name, - bool in_mt_safe) +Anvil::ShaderModule::ShaderModule(const Anvil::BaseDevice* in_device_ptr, + const char* in_spirv_blob, + uint32_t in_n_spirv_blob_bytes, + const std::string& in_cs_entrypoint_name, + const std::string& in_fs_entrypoint_name, + const std::string& in_gs_entrypoint_name, + const std::string& in_tc_entrypoint_name, + const std::string& in_te_entrypoint_name, + const std::string& in_vs_entrypoint_name, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT), MTSafetySupportProvider (in_mt_safe), m_cs_entrypoint_name (in_cs_entrypoint_name), m_device_ptr (in_device_ptr), - m_device_raw_ptr (in_device_ptr.lock().get() ), m_fs_entrypoint_name (in_fs_entrypoint_name), m_gs_entrypoint_name (in_gs_entrypoint_name), m_tc_entrypoint_name (in_tc_entrypoint_name), @@ -111,7 +109,7 @@ Anvil::ShaderModule::~ShaderModule() /* Unregister from any callbacks we have subscribed for */ object_tracker_ptr->unregister_from_callbacks( Anvil::OBJECT_TRACKER_CALLBACK_ID_ON_DEVICE_OBJECT_ABOUT_TO_BE_UNREGISTERED, - std::bind(&ShaderModule::on_object_about_to_be_released, + std::bind(&ShaderModule::on_device_about_to_be_released, this, std::placeholders::_1), this @@ -119,15 +117,16 @@ Anvil::ShaderModule::~ShaderModule() } /** Please see header for specification */ -std::shared_ptr Anvil::ShaderModule::create_from_spirv_generator(std::weak_ptr in_device_ptr, - std::shared_ptr in_spirv_generator_ptr, - MTSafety in_mt_safety) +Anvil::ShaderModuleUniquePtr Anvil::ShaderModule::create_from_spirv_generator(const Anvil::BaseDevice* in_device_ptr, + GLSLShaderToSPIRVGenerator* in_spirv_generator_ptr, + MTSafety in_mt_safety) { - const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - std::shared_ptr result_ptr; - auto shader_module_cache_ptr = in_device_ptr.lock()->get_parent_instance().lock()->get_shader_module_cache(); - const auto shader_stage = in_spirv_generator_ptr->get_shader_stage(); + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); + Anvil::ShaderModuleUniquePtr result_ptr = Anvil::ShaderModuleUniquePtr(nullptr, + std::default_delete() ); + auto shader_module_cache_ptr = in_device_ptr->get_shader_module_cache(); + const auto shader_stage = in_spirv_generator_ptr->get_shader_stage(); if (shader_module_cache_ptr != nullptr) { @@ -147,12 +146,18 @@ std::shared_ptr Anvil::ShaderModule::create_from_spirv_gene if (result_ptr == nullptr) { - /* Nope? Need to create a new instance then. */ - result_ptr.reset( + /* Nope? Need to create a new instance then. + * + * Make sure not to specify any deleter. The created shader module is going to be observed and acquired + * by the cache which will take care of destroying at tear-down time. */ + result_ptr = Anvil::ShaderModuleUniquePtr( new Anvil::ShaderModule(in_device_ptr, in_spirv_generator_ptr, - mt_safe) - ); + mt_safe), + [](Anvil::ShaderModule*) + { + /* Stub */ + }); Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_SHADER_MODULE, result_ptr.get() ); @@ -162,13 +167,15 @@ std::shared_ptr Anvil::ShaderModule::create_from_spirv_gene } else { - /* Just spawn the new instance .. */ + /* Just spawn a new instance .. */ result_ptr.reset( new Anvil::ShaderModule(in_device_ptr, in_spirv_generator_ptr, mt_safe) ); + anvil_assert(result_ptr->get_module() != VK_NULL_HANDLE); + Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_SHADER_MODULE, result_ptr.get() ); } @@ -177,21 +184,22 @@ std::shared_ptr Anvil::ShaderModule::create_from_spirv_gene } /** Please see header for specification */ -std::shared_ptr Anvil::ShaderModule::create_from_spirv_blob(std::weak_ptr in_device_ptr, - const char* in_spirv_blob, - uint32_t in_n_spirv_blob_bytes, - const char* in_cs_entrypoint_name, - const char* in_fs_entrypoint_name, - const char* in_gs_entrypoint_name, - const char* in_tc_entrypoint_name, - const char* in_te_entrypoint_name, - const char* in_vs_entrypoint_name, - MTSafety in_mt_safety) +Anvil::ShaderModuleUniquePtr Anvil::ShaderModule::create_from_spirv_blob(const Anvil::BaseDevice* in_device_ptr, + const char* in_spirv_blob, + uint32_t in_n_spirv_blob_bytes, + const char* in_cs_entrypoint_name, + const char* in_fs_entrypoint_name, + const char* in_gs_entrypoint_name, + const char* in_tc_entrypoint_name, + const char* in_te_entrypoint_name, + const char* in_vs_entrypoint_name, + MTSafety in_mt_safety) { - const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - std::shared_ptr result_ptr; - auto shader_module_cache_ptr = in_device_ptr.lock()->get_parent_instance().lock()->get_shader_module_cache(); + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); + Anvil::ShaderModuleUniquePtr result_ptr (nullptr, + std::default_delete() ); + auto shader_module_cache_ptr = in_device_ptr->get_shader_module_cache(); if (shader_module_cache_ptr != nullptr) { @@ -211,8 +219,11 @@ std::shared_ptr Anvil::ShaderModule::create_from_spirv_blob if (result_ptr == nullptr) { - /* Nope? Need to create a new instance then. */ - result_ptr.reset( + /* Nope? Need to create a new instance then. + * + * Make sure not to specify any deleter. The created shader module is going to be observed and acquired + * by the cache which will take care of destroying at tear-down time. */ + result_ptr = Anvil::ShaderModuleUniquePtr( new Anvil::ShaderModule(in_device_ptr, in_spirv_blob, in_n_spirv_blob_bytes, @@ -222,8 +233,11 @@ std::shared_ptr Anvil::ShaderModule::create_from_spirv_blob in_tc_entrypoint_name, in_te_entrypoint_name, in_vs_entrypoint_name, - mt_safe) - ); + mt_safe), + [](Anvil::ShaderModule*) + { + /* Stub */ + }); Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_SHADER_MODULE, result_ptr.get() ); @@ -247,6 +261,8 @@ std::shared_ptr Anvil::ShaderModule::create_from_spirv_blob mt_safe) ); + anvil_assert(result_ptr->get_module() != VK_NULL_HANDLE); + Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_SHADER_MODULE, result_ptr.get() ); } @@ -261,7 +277,7 @@ void Anvil::ShaderModule::destroy() { lock(); { - vkDestroyShaderModule(m_device_raw_ptr->get_device_vk(), + vkDestroyShaderModule(m_device_ptr->get_device_vk(), m_module, nullptr /* pAllocator */); } @@ -296,9 +312,8 @@ const std::string& Anvil::ShaderModule::get_disassembly() bool Anvil::ShaderModule::init_from_spirv_blob(const char* in_spirv_blob, uint32_t in_n_spirv_blob_bytes) { - std::shared_ptr device_locked_ptr(m_device_ptr); - VkResult result_vk; - VkShaderModuleCreateInfo shader_module_create_info; + VkResult result_vk; + VkShaderModuleCreateInfo shader_module_create_info; /* Set up the "shader module" create info descriptor */ anvil_assert((in_n_spirv_blob_bytes % sizeof(uint32_t) ) == 0); @@ -309,7 +324,7 @@ bool Anvil::ShaderModule::init_from_spirv_blob(const char* in_spirv_blob, shader_module_create_info.pNext = nullptr; shader_module_create_info.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; - result_vk = vkCreateShaderModule(device_locked_ptr->get_device_vk(), + result_vk = vkCreateShaderModule(m_device_ptr->get_device_vk(), &shader_module_create_info, nullptr, /* pAllocator */ &m_module); @@ -329,7 +344,7 @@ bool Anvil::ShaderModule::init_from_spirv_blob(const char* in_spirv_blob, /* Sign for device destruction notification, in which case we need to destroy the shader module. */ Anvil::ObjectTracker::get()->register_for_callbacks( Anvil::OBJECT_TRACKER_CALLBACK_ID_ON_DEVICE_OBJECT_ABOUT_TO_BE_UNREGISTERED, - std::bind(&ShaderModule::on_object_about_to_be_released, + std::bind(&ShaderModule::on_device_about_to_be_released, this, std::placeholders::_1), this @@ -339,11 +354,11 @@ bool Anvil::ShaderModule::init_from_spirv_blob(const char* in_spirv_blob, } /** TODO */ -void Anvil::ShaderModule::on_object_about_to_be_released(void* in_callback_arg_ptr) +void Anvil::ShaderModule::on_device_about_to_be_released(void* in_callback_arg_ptr) { const auto callback_arg_ptr = reinterpret_cast(in_callback_arg_ptr); - if (m_device_raw_ptr == callback_arg_ptr->object_raw_ptr) + if (m_device_ptr == callback_arg_ptr->object_raw_ptr) { /* Make sure to release the shader module handle before we let the object actually proceed with destruction! */ destroy(); diff --git a/src/wrappers/swapchain.cpp b/src/wrappers/swapchain.cpp index ae2f5e9e..6431eb31 100644 --- a/src/wrappers/swapchain.cpp +++ b/src/wrappers/swapchain.cpp @@ -23,6 +23,7 @@ #include "misc/debug.h" #include "misc/dummy_window.h" #include "misc/object_tracker.h" +#include "misc/struct_chainer.h" #include "misc/window.h" #include "wrappers/command_buffer.h" #include "wrappers/command_pool.h" @@ -31,9 +32,9 @@ #include "wrappers/swapchain.h" /** Please see header for specification */ -Anvil::Swapchain::Swapchain(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_surface_ptr, - std::shared_ptr in_window_ptr, +Anvil::Swapchain::Swapchain(const Anvil::BaseDevice* in_device_ptr, + Anvil::RenderingSurface* in_parent_surface_ptr, + Anvil::Window* in_window_ptr, VkFormat in_format, VkPresentModeKHR in_present_mode, VkImageUsageFlags in_usage_flags, @@ -60,8 +61,6 @@ Anvil::Swapchain::Swapchain(std::weak_ptr in_device_p m_usage_flags (static_cast(in_usage_flags) ), m_khr_swapchain_entrypoints (in_khr_swapchain_entrypoints) { - std::shared_ptr device_locked_ptr(in_device_ptr); - anvil_assert(in_n_images > 0); anvil_assert(in_parent_surface_ptr != nullptr); anvil_assert(in_usage_flags != 0); @@ -116,19 +115,19 @@ Anvil::Swapchain::~Swapchain() } /** Please see header for specification */ -uint32_t Anvil::Swapchain::acquire_image(std::shared_ptr in_opt_semaphore_ptr, - bool in_should_block) +uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, + bool in_should_block) { - std::shared_ptr device_locked_ptr (m_device_ptr); - const RenderingSurfaceType rendering_surface (m_parent_surface_ptr->get_type() ); - VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); - uint32_t result (UINT32_MAX); - std::shared_ptr single_device_locked_ptr (std::dynamic_pointer_cast (device_locked_ptr) ); - std::weak_ptr physical_device_ptr (single_device_locked_ptr->get_physical_device() ); - const WindowPlatform window_platform (m_window_ptr->get_platform() ); - const bool is_offscreen_rendering_enabled((window_platform == WINDOW_PLATFORM_DUMMY || - window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS) && - (rendering_surface == Anvil::RENDERING_SURFACE_TYPE_GENERAL) ); + uint32_t result (UINT32_MAX); + const Anvil::PhysicalDevice* physical_device_ptr (nullptr); + VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); + const WindowPlatform window_platform (m_window_ptr->get_platform()); + const bool is_offscreen_rendering_enabled ((window_platform == WINDOW_PLATFORM_DUMMY || + window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS) ); + const Anvil::SGPUDevice* sgpu_device_ptr (dynamic_cast(m_device_ptr) ); + + physical_device_ptr = sgpu_device_ptr->get_physical_device(); + ANVIL_REDUNDANT_VARIABLE(result_vk); @@ -151,16 +150,16 @@ uint32_t Anvil::Swapchain::acquire_image(std::shared_ptr in_op fence_handle = m_image_available_fence_ptr->get_fence(); } - result_vk = m_khr_swapchain_entrypoints.vkAcquireNextImageKHR(device_locked_ptr->get_device_vk(), + result_vk = m_khr_swapchain_entrypoints.vkAcquireNextImageKHR(m_device_ptr->get_device_vk(), m_swapchain, UINT64_MAX, - in_opt_semaphore_ptr->get_semaphore(), + (in_opt_semaphore_ptr != nullptr) ? in_opt_semaphore_ptr->get_semaphore() : VK_NULL_HANDLE, fence_handle, &result); if (fence_handle != VK_NULL_HANDLE) { - result_vk = vkWaitForFences(device_locked_ptr->get_device_vk(), + result_vk = vkWaitForFences(m_device_ptr->get_device_vk(), 1, /* fenceCount */ &fence_handle, VK_TRUE, /* waitAll */ @@ -183,16 +182,16 @@ uint32_t Anvil::Swapchain::acquire_image(std::shared_ptr in_op { if (in_should_block) { - m_device_ptr.lock()->wait_idle(); + m_device_ptr->wait_idle(); } if (in_opt_semaphore_ptr != nullptr) { /* We need to set the semaphore manually in this scenario */ - device_locked_ptr->get_universal_queue(0)->submit_command_buffer_with_signal_semaphores(nullptr, /* cmd_buffer_ptr */ - 1, /* n_semaphores_to_signal */ - &in_opt_semaphore_ptr, - true); /* should_block */ + m_device_ptr->get_universal_queue(0)->submit_command_buffer_with_signal_semaphores(nullptr, /* cmd_buffer_ptr */ + 1, /* n_semaphores_to_signal */ + &in_opt_semaphore_ptr, + true); /* should_block */ } result = m_n_acquire_counter_rounded; @@ -207,20 +206,21 @@ uint32_t Anvil::Swapchain::acquire_image(std::shared_ptr in_op } /** Please see header for specification */ -std::shared_ptr Anvil::Swapchain::create(std::weak_ptr in_device_ptr, - std::shared_ptr in_parent_surface_ptr, - std::shared_ptr in_window_ptr, - VkFormat in_format, - VkPresentModeKHR in_present_mode, - VkImageUsageFlags in_usage_flags, - uint32_t in_n_images, - const ExtensionKHRSwapchainEntrypoints& in_khr_swapchain_entrypoints, - MTSafety in_mt_safety, - VkSwapchainCreateFlagsKHR in_flags) +Anvil::SwapchainUniquePtr Anvil::Swapchain::create(const Anvil::BaseDevice* in_device_ptr, + Anvil::RenderingSurface* in_parent_surface_ptr, + Anvil::Window* in_window_ptr, + VkFormat in_format, + VkPresentModeKHR in_present_mode, + VkImageUsageFlags in_usage_flags, + uint32_t in_n_images, + const ExtensionKHRSwapchainEntrypoints& in_khr_swapchain_entrypoints, + MTSafety in_mt_safety, + VkSwapchainCreateFlagsKHR in_flags) { - const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - std::shared_ptr result_ptr; + const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr); + SwapchainUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( new Anvil::Swapchain(in_device_ptr, @@ -238,7 +238,7 @@ std::shared_ptr Anvil::Swapchain::create(std::weak_ptrget_platform() == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS) { - std::dynamic_pointer_cast(in_window_ptr)->set_swapchain(result_ptr); + dynamic_cast(in_window_ptr)->set_swapchain(result_ptr.get() ); } return result_ptr; @@ -250,14 +250,13 @@ void Anvil::Swapchain::destroy_swapchain() /* If this assertion failure explodes, your application attempted to release a swapchain without presenting all acquired swapchain images. * That's illegal per Vulkan spec. */ - anvil_assert(m_n_acquire_counter == m_n_present_counter); if (m_swapchain != VK_NULL_HANDLE) { - std::shared_ptr device_locked_ptr(m_device_ptr); + anvil_assert(m_n_acquire_counter == m_n_present_counter); lock(); { - m_khr_swapchain_entrypoints.vkDestroySwapchainKHR(device_locked_ptr->get_device_vk(), + m_khr_swapchain_entrypoints.vkDestroySwapchainKHR(m_device_ptr->get_device_vk(), m_swapchain, nullptr /* pAllocator */); } @@ -274,35 +273,32 @@ void Anvil::Swapchain::disable_destroy_swapchain_before_parent_window_closes_beh } /** Please see header for specification */ -std::shared_ptr Anvil::Swapchain::get_image(uint32_t in_n_swapchain_image) const +Anvil::Image* Anvil::Swapchain::get_image(uint32_t in_n_swapchain_image) const { anvil_assert(in_n_swapchain_image < m_n_swapchain_images); - return m_image_ptrs[in_n_swapchain_image]; + return m_image_ptrs[in_n_swapchain_image].get(); } /** Please see header for specification */ -std::shared_ptr Anvil::Swapchain::get_image_view(uint32_t in_n_swapchain_image) const +Anvil::ImageView* Anvil::Swapchain::get_image_view(uint32_t in_n_swapchain_image) const { anvil_assert(in_n_swapchain_image < m_n_swapchain_images); - return m_image_view_ptrs[in_n_swapchain_image]; + return m_image_view_ptrs[in_n_swapchain_image].get(); } /** Initializes the swapchain object. */ void Anvil::Swapchain::init() { - VkSwapchainCreateInfoKHR create_info; - std::shared_ptr device_locked_ptr = m_device_ptr.lock(); - uint32_t n_swapchain_images = 0; - VkResult result = VK_ERROR_INITIALIZATION_FAILED; - const RenderingSurfaceType rendering_surface = m_parent_surface_ptr->get_type(); - std::vector swapchain_images; - const VkSurfaceTransformFlagBitsKHR swapchain_transformation = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR; - const WindowPlatform window_platform = m_window_ptr->get_platform(); - const bool is_offscreen_rendering_enabled = (window_platform == WINDOW_PLATFORM_DUMMY || - window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS) && - (rendering_surface == Anvil::RENDERING_SURFACE_TYPE_GENERAL); + uint32_t n_swapchain_images = 0; + VkResult result = VK_ERROR_INITIALIZATION_FAILED; + Anvil::StructChainUniquePtr struct_chain_ptr; + std::vector swapchain_images; + const VkSurfaceTransformFlagBitsKHR swapchain_transformation = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR; + const WindowPlatform window_platform = m_window_ptr->get_platform(); + const bool is_offscreen_rendering_enabled = (window_platform == WINDOW_PLATFORM_DUMMY || + window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS); ANVIL_REDUNDANT_VARIABLE(result); @@ -313,12 +309,10 @@ void Anvil::Swapchain::init() /* not doing offscreen rendering */ if (!is_offscreen_rendering_enabled) { - std::shared_ptr sgpu_device_locked_ptr(std::dynamic_pointer_cast(device_locked_ptr) ); + Anvil::StructChainer struct_chainer; #ifdef _DEBUG { - const Anvil::DeviceType device_type = device_locked_ptr->get_type(); - uint32_t n_physical_devices = 0; bool result_bool = false; const char* required_surface_extension_name = nullptr; VkSurfaceCapabilitiesKHR surface_caps; @@ -335,87 +329,64 @@ void Anvil::Swapchain::init() #endif #endif - anvil_assert(required_surface_extension_name == nullptr || - m_device_ptr.lock()->get_parent_instance().lock()->is_instance_extension_supported(required_surface_extension_name) ); - - switch (device_type) - { - case Anvil::DEVICE_TYPE_SINGLE_GPU: n_physical_devices = 1; break; - - default: - { - anvil_assert_fail(); - } - } - - for (uint32_t n_physical_device = 0; - n_physical_device < n_physical_devices; - ++n_physical_device) - { - std::shared_ptr current_physical_device_ptr; - - switch (device_type) - { - case Anvil::DEVICE_TYPE_SINGLE_GPU: current_physical_device_ptr = sgpu_device_locked_ptr->get_physical_device().lock(); break; - - default: - { - anvil_assert_fail(); - } - } + anvil_assert(required_surface_extension_name == nullptr || + m_device_ptr->get_parent_instance()->is_instance_extension_supported(required_surface_extension_name) ); - /* Ensure opaque composite alpha mode is supported */ - anvil_assert(m_parent_surface_ptr->get_supported_composite_alpha_flags(current_physical_device_ptr, - &supported_composite_alpha_flags) ); + /* Ensure opaque composite alpha mode is supported */ + anvil_assert(m_parent_surface_ptr->get_supported_composite_alpha_flags(&supported_composite_alpha_flags) ); - anvil_assert(supported_composite_alpha_flags & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR); + anvil_assert(supported_composite_alpha_flags & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR); - /* Ensure we can use the swapchain image format */ - anvil_assert(m_parent_surface_ptr->is_compatible_with_image_format(current_physical_device_ptr, - m_image_format, - &result_bool) ); - anvil_assert(result_bool); + /* Ensure we can use the swapchain image format */ + anvil_assert(m_parent_surface_ptr->is_compatible_with_image_format(m_image_format, + &result_bool) ); + anvil_assert(result_bool); - /* Ensure the transformation we're about to request is supported by the rendering surface */ - anvil_assert(m_parent_surface_ptr->get_supported_transformations(current_physical_device_ptr, - &supported_surface_transform_flags) ); + /* Ensure the transformation we're about to request is supported by the rendering surface */ + anvil_assert(m_parent_surface_ptr->get_supported_transformations(&supported_surface_transform_flags) ); - anvil_assert(supported_surface_transform_flags & swapchain_transformation); + anvil_assert(supported_surface_transform_flags & swapchain_transformation); - /* Ensure the requested number of swapchain images is reasonable*/ - anvil_assert(m_parent_surface_ptr->get_capabilities(current_physical_device_ptr, - &surface_caps) ); + /* Ensure the requested number of swapchain images is reasonable*/ + anvil_assert(m_parent_surface_ptr->get_capabilities(&surface_caps) ); - anvil_assert(surface_caps.maxImageCount == 0 || - surface_caps.maxImageCount >= m_n_swapchain_images); - } + anvil_assert(surface_caps.maxImageCount == 0 || + surface_caps.maxImageCount >= m_n_swapchain_images); } #endif - create_info.clipped = true; /* we won't be reading from the presentable images */ - create_info.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; - create_info.flags = m_flags; - create_info.imageArrayLayers = 1; - create_info.imageColorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR; - create_info.imageExtent.height = m_parent_surface_ptr->get_height(); - create_info.imageExtent.width = m_parent_surface_ptr->get_width(); - create_info.imageFormat = m_image_format; - create_info.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE; - create_info.imageUsage = m_usage_flags; - create_info.minImageCount = m_n_swapchain_images; - create_info.oldSwapchain = VK_NULL_HANDLE; - create_info.pNext = nullptr; - create_info.pQueueFamilyIndices = nullptr; - create_info.presentMode = m_present_mode; - create_info.preTransform = swapchain_transformation; - create_info.queueFamilyIndexCount = 0; - create_info.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR; - create_info.surface = m_parent_surface_ptr->get_surface(); + { + VkSwapchainCreateInfoKHR create_info; + + create_info.clipped = true; /* we won't be reading from the presentable images */ + create_info.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; + create_info.flags = m_flags; + create_info.imageArrayLayers = 1; + create_info.imageColorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR; + create_info.imageExtent.height = m_parent_surface_ptr->get_height(); + create_info.imageExtent.width = m_parent_surface_ptr->get_width(); + create_info.imageFormat = m_image_format; + create_info.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE; + create_info.imageUsage = m_usage_flags; + create_info.minImageCount = m_n_swapchain_images; + create_info.oldSwapchain = VK_NULL_HANDLE; + create_info.pNext = nullptr; + create_info.pQueueFamilyIndices = nullptr; + create_info.presentMode = m_present_mode; + create_info.preTransform = swapchain_transformation; + create_info.queueFamilyIndexCount = 0; + create_info.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR; + create_info.surface = m_parent_surface_ptr->get_surface(); + + struct_chainer.append_struct(create_info); + } + + struct_chain_ptr = struct_chainer.create_chain(); m_parent_surface_ptr->lock(); { - result = m_khr_swapchain_entrypoints.vkCreateSwapchainKHR(device_locked_ptr->get_device_vk(), - &create_info, + result = m_khr_swapchain_entrypoints.vkCreateSwapchainKHR(m_device_ptr->get_device_vk(), + struct_chain_ptr->get_root_struct(), nullptr, /* pAllocator */ &m_swapchain); } @@ -428,7 +399,7 @@ void Anvil::Swapchain::init() } /* Retrieve swap-chain images */ - result = m_khr_swapchain_entrypoints.vkGetSwapchainImagesKHR(device_locked_ptr->get_device_vk(), + result = m_khr_swapchain_entrypoints.vkGetSwapchainImagesKHR(m_device_ptr->get_device_vk(), m_swapchain, &n_swapchain_images, nullptr); /* pSwapchainImages */ @@ -438,7 +409,7 @@ void Anvil::Swapchain::init() swapchain_images.resize(n_swapchain_images); - result = m_khr_swapchain_entrypoints.vkGetSwapchainImagesKHR(device_locked_ptr->get_device_vk(), + result = m_khr_swapchain_entrypoints.vkGetSwapchainImagesKHR(m_device_ptr->get_device_vk(), m_swapchain, &n_swapchain_images, &swapchain_images[0]); @@ -462,7 +433,7 @@ void Anvil::Swapchain::init() * when the Image instance goes out of scope. */ m_image_ptrs[n_result_image] = Anvil::Image::create_nonsparse(m_device_ptr, - create_info, + *struct_chain_ptr->get_root_struct(), swapchain_images[n_result_image], Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() ) ); } @@ -490,7 +461,7 @@ void Anvil::Swapchain::init() /* For each swap-chain image, create a relevant view */ m_image_view_ptrs[n_result_image] = Anvil::ImageView::create_2D(m_device_ptr, - m_image_ptrs[n_result_image], + m_image_ptrs[n_result_image].get(), 0, /* n_base_layer */ 0, /* n_base_mipmap_level */ 1, /* n_mipmaps */ @@ -507,52 +478,39 @@ void Anvil::Swapchain::init() * number of acquired frames at destruction time. */ { - std::vector > queues; + std::vector queues; + + const std::vector* queue_fams_with_present_support_ptr(nullptr); + const Anvil::SGPUDevice* sgpu_device_ptr (dynamic_cast(m_device_ptr) ); - switch (device_locked_ptr->get_type() ) + m_parent_surface_ptr->get_queue_families_with_present_support(&queue_fams_with_present_support_ptr); + + if (queue_fams_with_present_support_ptr == nullptr) + { + anvil_assert(queue_fams_with_present_support_ptr != nullptr); + } + else { - case Anvil::DEVICE_TYPE_SINGLE_GPU: + for (const auto queue_fam : *queue_fams_with_present_support_ptr) { - const std::vector* queue_fams_with_present_support_ptr(nullptr); - std::shared_ptr sgpu_device_locked_ptr (std::dynamic_pointer_cast(device_locked_ptr) ); - auto physical_device_ptr (sgpu_device_locked_ptr->get_physical_device() ); + const uint32_t n_queues = sgpu_device_ptr->get_n_queues(queue_fam); - if (!m_parent_surface_ptr->get_queue_families_with_present_support(physical_device_ptr, - &queue_fams_with_present_support_ptr) ) + for (uint32_t n_queue = 0; + n_queue < n_queues; + ++n_queue) { - break; - } + auto queue_ptr = sgpu_device_ptr->get_queue_for_queue_family_index(queue_fam, + n_queue); - if (queue_fams_with_present_support_ptr == nullptr) - { - anvil_assert(queue_fams_with_present_support_ptr != nullptr); - } - else - { - for (const auto queue_fam : *queue_fams_with_present_support_ptr) + anvil_assert(queue_ptr != nullptr); + + if (std::find(queues.begin(), + queues.end(), + queue_ptr) == queues.end() ) { - const uint32_t n_queues = sgpu_device_locked_ptr->get_n_queues(queue_fam); - - for (uint32_t n_queue = 0; - n_queue < n_queues; - ++n_queue) - { - auto queue_ptr = sgpu_device_locked_ptr->get_queue(queue_fam, - n_queue); - - anvil_assert(queue_ptr != nullptr); - - if (std::find(queues.begin(), - queues.end(), - queue_ptr) == queues.end() ) - { - queues.push_back(queue_ptr); - } - } + queues.push_back(queue_ptr); } } - - break; } } From 1e7d471881cea548173e49d5c813f9ca7b4c6271 Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Mon, 12 Mar 2018 15:48:57 +0100 Subject: [PATCH 03/50] Fix config.h issues --- CMakeLists.txt | 3 ++- examples/DynamicBuffers/CMakeLists.txt | 2 -- examples/MultiViewport/CMakeLists.txt | 2 -- examples/OcclusionQuery/CMakeLists.txt | 2 -- examples/OutOfOrderRasterization/CMakeLists.txt | 2 -- examples/PushConstants/CMakeLists.txt | 2 -- 6 files changed, 2 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e7a27e4..3012f39e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,8 @@ configure_file("include/config.h.in" "include/config.h") include_directories("$(Anvil_SOURCE_DIR)" "$(Anvil_SOURCE_DIR)/deps" - "$(Anvil_SOURCE_DIR)/include") + "$(Anvil_SOURCE_DIR)/include" + "${Anvil_BINARY_DIR}/include") if (WIN32) if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") diff --git a/examples/DynamicBuffers/CMakeLists.txt b/examples/DynamicBuffers/CMakeLists.txt index 1b6cfcec..f08c4d4d 100644 --- a/examples/DynamicBuffers/CMakeLists.txt +++ b/examples/DynamicBuffers/CMakeLists.txt @@ -18,8 +18,6 @@ endif() add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") -target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") - include_directories(${Anvil_SOURCE_DIR}/include ${DynamicBuffers_SOURCE_DIR}/include) diff --git a/examples/MultiViewport/CMakeLists.txt b/examples/MultiViewport/CMakeLists.txt index 00bca137..2710e142 100644 --- a/examples/MultiViewport/CMakeLists.txt +++ b/examples/MultiViewport/CMakeLists.txt @@ -18,8 +18,6 @@ endif() add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") -target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") - include_directories(${Anvil_SOURCE_DIR}/include ${MultiViewport_SOURCE_DIR}/include) diff --git a/examples/OcclusionQuery/CMakeLists.txt b/examples/OcclusionQuery/CMakeLists.txt index ce75cf22..a3a802e9 100644 --- a/examples/OcclusionQuery/CMakeLists.txt +++ b/examples/OcclusionQuery/CMakeLists.txt @@ -18,8 +18,6 @@ endif() add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") -target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") - include_directories(${Anvil_SOURCE_DIR}/include ${OcclusionQuery_SOURCE_DIR}/include) diff --git a/examples/OutOfOrderRasterization/CMakeLists.txt b/examples/OutOfOrderRasterization/CMakeLists.txt index a180516d..1642c092 100644 --- a/examples/OutOfOrderRasterization/CMakeLists.txt +++ b/examples/OutOfOrderRasterization/CMakeLists.txt @@ -18,8 +18,6 @@ endif() add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") -target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") - include_directories(${Anvil_SOURCE_DIR}/include ${OutOfOrderRasterization_SOURCE_DIR}/include) diff --git a/examples/PushConstants/CMakeLists.txt b/examples/PushConstants/CMakeLists.txt index f178ad04..8f5320eb 100644 --- a/examples/PushConstants/CMakeLists.txt +++ b/examples/PushConstants/CMakeLists.txt @@ -18,8 +18,6 @@ endif() add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") -target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") - include_directories(${Anvil_SOURCE_DIR}/include ${PushConstants_SOURCE_DIR}/include) From 28e50a070d2645f5b4873fd3fc76254726b7c95f Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Mon, 12 Mar 2018 15:58:18 +0100 Subject: [PATCH 04/50] gcc issues --- src/wrappers/command_buffer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/wrappers/command_buffer.cpp b/src/wrappers/command_buffer.cpp index bfb54f2b..4fc06a31 100644 --- a/src/wrappers/command_buffer.cpp +++ b/src/wrappers/command_buffer.cpp @@ -2756,8 +2756,7 @@ bool Anvil::CommandBufferBase::record_set_depth_bounds(float in_min_depth_bounds bool Anvil::CommandBufferBase::record_set_event(Anvil::Event* in_event_ptr, VkPipelineStageFlags in_stage_mask) { - const Anvil::DeviceType device_type = m_device_ptr->get_type(); - bool result = false; + bool result = false; if (m_is_renderpass_active) { From abfd6330a837aa2544546b70a682d177b6514300 Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Tue, 13 Mar 2018 09:20:02 +0100 Subject: [PATCH 05/50] gcc fixes --- src/wrappers/command_buffer.cpp | 2 ++ src/wrappers/descriptor_set_group.cpp | 3 +-- src/wrappers/render_pass.cpp | 1 - src/wrappers/swapchain.cpp | 15 +++++---------- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/wrappers/command_buffer.cpp b/src/wrappers/command_buffer.cpp index 4fc06a31..6760d41c 100644 --- a/src/wrappers/command_buffer.cpp +++ b/src/wrappers/command_buffer.cpp @@ -3342,6 +3342,8 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t i Anvil::StructChainer render_pass_begin_info_chain; bool result = false; + ANVIL_REDUNDANT_VARIABLE(physical_device_ptr); + if (m_is_renderpass_active) { anvil_assert(!m_is_renderpass_active); diff --git a/src/wrappers/descriptor_set_group.cpp b/src/wrappers/descriptor_set_group.cpp index ee45d64f..2a0995c5 100644 --- a/src/wrappers/descriptor_set_group.cpp +++ b/src/wrappers/descriptor_set_group.cpp @@ -284,8 +284,7 @@ bool Anvil::DescriptorSetGroup::bake_descriptor_sets() for (const auto& ds_data : layout_vk_owner_ptr->m_descriptor_sets) { - const auto set_index = ds_data.first; - const auto& ds_ptr = ds_data.second; + const auto& ds_ptr = ds_data.second; if (ds_data.second->layout_ptr == nullptr) { diff --git a/src/wrappers/render_pass.cpp b/src/wrappers/render_pass.cpp index e3e83ba8..b6db84f1 100644 --- a/src/wrappers/render_pass.cpp +++ b/src/wrappers/render_pass.cpp @@ -187,7 +187,6 @@ bool Anvil::RenderPass::init() uint32_t highest_subpass_color_attachment_location = UINT32_MAX; uint32_t highest_subpass_input_attachment_index = UINT32_MAX; bool need_color_resolve_attachments = false; - const uint32_t subpass_index = static_cast(subpass_iterator - m_render_pass_info_ptr->m_subpasses.begin() ); VkSubpassDescription subpass_vk; VkAttachmentReference unused_reference; diff --git a/src/wrappers/swapchain.cpp b/src/wrappers/swapchain.cpp index 6431eb31..80a9d8d1 100644 --- a/src/wrappers/swapchain.cpp +++ b/src/wrappers/swapchain.cpp @@ -118,16 +118,11 @@ Anvil::Swapchain::~Swapchain() uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, bool in_should_block) { - uint32_t result (UINT32_MAX); - const Anvil::PhysicalDevice* physical_device_ptr (nullptr); - VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); - const WindowPlatform window_platform (m_window_ptr->get_platform()); - const bool is_offscreen_rendering_enabled ((window_platform == WINDOW_PLATFORM_DUMMY || - window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS) ); - const Anvil::SGPUDevice* sgpu_device_ptr (dynamic_cast(m_device_ptr) ); - - physical_device_ptr = sgpu_device_ptr->get_physical_device(); - + uint32_t result (UINT32_MAX); + VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); + const WindowPlatform window_platform (m_window_ptr->get_platform()); + const bool is_offscreen_rendering_enabled((window_platform == WINDOW_PLATFORM_DUMMY || + window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS) ); ANVIL_REDUNDANT_VARIABLE(result_vk); From 0528fad7492c3daccae4f276db12f98e4a89748b Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Tue, 27 Mar 2018 12:49:35 +0200 Subject: [PATCH 06/50] Bug-fixes & improvements: * #62: Exception when trying to bake a descriptor set with null bindings * Descriptor set write support can now handle arrayed bindings with gaps. * Fix an issue where RenderPassInfo would use obsolete pointers under certain circumstances. * Fix an issue where bindings would not be marked as clean at update time * Fix broken sampler descriptor support. * Fix VK_AMD_texture_gather_bias_lod support regression --- examples/DynamicBuffers/CMakeLists.txt | 2 + examples/MultiViewport/CMakeLists.txt | 2 + examples/OcclusionQuery/CMakeLists.txt | 2 + .../OutOfOrderRasterization/CMakeLists.txt | 2 + examples/PushConstants/CMakeLists.txt | 2 + include/misc/render_pass_info.h | 52 ++++---- include/misc/types.h | 2 + include/wrappers/descriptor_set.h | 21 +-- include/wrappers/device.h | 4 + src/misc/render_pass_info.cpp | 56 +++----- src/misc/types.cpp | 15 +++ src/wrappers/descriptor_set.cpp | 126 +++++++++++------- src/wrappers/descriptor_set_group.cpp | 7 +- src/wrappers/device.cpp | 39 +++++- src/wrappers/physical_device.cpp | 4 +- src/wrappers/render_pass.cpp | 22 +-- src/wrappers/swapchain.cpp | 10 +- 17 files changed, 221 insertions(+), 147 deletions(-) diff --git a/examples/DynamicBuffers/CMakeLists.txt b/examples/DynamicBuffers/CMakeLists.txt index f08c4d4d..1b6cfcec 100644 --- a/examples/DynamicBuffers/CMakeLists.txt +++ b/examples/DynamicBuffers/CMakeLists.txt @@ -18,6 +18,8 @@ endif() add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") +target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") + include_directories(${Anvil_SOURCE_DIR}/include ${DynamicBuffers_SOURCE_DIR}/include) diff --git a/examples/MultiViewport/CMakeLists.txt b/examples/MultiViewport/CMakeLists.txt index 2710e142..00bca137 100644 --- a/examples/MultiViewport/CMakeLists.txt +++ b/examples/MultiViewport/CMakeLists.txt @@ -18,6 +18,8 @@ endif() add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") +target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") + include_directories(${Anvil_SOURCE_DIR}/include ${MultiViewport_SOURCE_DIR}/include) diff --git a/examples/OcclusionQuery/CMakeLists.txt b/examples/OcclusionQuery/CMakeLists.txt index a3a802e9..ce75cf22 100644 --- a/examples/OcclusionQuery/CMakeLists.txt +++ b/examples/OcclusionQuery/CMakeLists.txt @@ -18,6 +18,8 @@ endif() add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") +target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") + include_directories(${Anvil_SOURCE_DIR}/include ${OcclusionQuery_SOURCE_DIR}/include) diff --git a/examples/OutOfOrderRasterization/CMakeLists.txt b/examples/OutOfOrderRasterization/CMakeLists.txt index 1642c092..a180516d 100644 --- a/examples/OutOfOrderRasterization/CMakeLists.txt +++ b/examples/OutOfOrderRasterization/CMakeLists.txt @@ -18,6 +18,8 @@ endif() add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") +target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") + include_directories(${Anvil_SOURCE_DIR}/include ${OutOfOrderRasterization_SOURCE_DIR}/include) diff --git a/examples/PushConstants/CMakeLists.txt b/examples/PushConstants/CMakeLists.txt index 8f5320eb..f178ad04 100644 --- a/examples/PushConstants/CMakeLists.txt +++ b/examples/PushConstants/CMakeLists.txt @@ -18,6 +18,8 @@ endif() add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") +target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") + include_directories(${Anvil_SOURCE_DIR}/include ${PushConstants_SOURCE_DIR}/include) diff --git a/include/misc/render_pass_info.h b/include/misc/render_pass_info.h index 98406b44..c063053b 100644 --- a/include/misc/render_pass_info.h +++ b/include/misc/render_pass_info.h @@ -544,42 +544,42 @@ namespace Anvil /* Holds properties of a sub-pass attachment */ typedef struct SubPassAttachment { - RenderPassAttachment* attachment_ptr; - uint32_t highest_subpass_index; - VkImageLayout layout; - uint32_t lowest_subpass_index; - RenderPassAttachment* resolve_attachment_ptr; + uint32_t attachment_index; + uint32_t highest_subpass_index; + VkImageLayout layout; + uint32_t lowest_subpass_index; + uint32_t resolve_attachment_index; /* Dummy constructor. Should only be used by STL containers */ SubPassAttachment() { - attachment_ptr = nullptr; - highest_subpass_index = UINT32_MAX; - layout = VK_IMAGE_LAYOUT_MAX_ENUM; - lowest_subpass_index = UINT32_MAX; - resolve_attachment_ptr = nullptr; + attachment_index = UINT32_MAX; + highest_subpass_index = UINT32_MAX; + layout = VK_IMAGE_LAYOUT_MAX_ENUM; + lowest_subpass_index = UINT32_MAX; + resolve_attachment_index = UINT32_MAX; } /** Constructor. * - * @param in_attachment_ptr Render-pass attachment that this sub-pass attachment should reference. - * Must not be nullptr. - * @param in_layout Layout to use for the attachment when executing the subpass. - * Driver takes care of transforming the attachment to the requested layout - * before subpass commands starts executing. - * @param in_resolve_attachment_ptr If not nullptr, this should point to the render-pass attachment, to which - * MS data of @param in_attachment_ptr should be resolved. If nullptr, it is - * assumed the sub-pass should not resolve the MS data. + * @param in_attachment_index Index of render-pass attachment that this sub-pass attachment should reference. + * Must not be UINT32_MAX. + * @param in_layout Layout to use for the attachment when executing the subpass. + * Driver takes care of transforming the attachment to the requested layout + * before subpass commands starts executing. + * @param in_opt_resolve_attachment_index If not UINT32_MAX, this should point to the render-pass attachment, to which + * MS data of @param in_attachment_ptr should be resolved. If UINT32_MAX, it is + * assumed the sub-pass should not resolve the MS data. **/ - SubPassAttachment(RenderPassAttachment* in_attachment_ptr, - VkImageLayout in_layout, - RenderPassAttachment* in_opt_resolve_attachment_ptr) + SubPassAttachment(const uint32_t& in_attachment_index, + VkImageLayout in_layout, + const uint32_t& in_opt_resolve_attachment_index) { - attachment_ptr = in_attachment_ptr; - highest_subpass_index = UINT32_MAX; - layout = in_layout; - lowest_subpass_index = UINT32_MAX; - resolve_attachment_ptr = in_opt_resolve_attachment_ptr; + attachment_index = in_attachment_index; + highest_subpass_index = UINT32_MAX; + layout = in_layout; + lowest_subpass_index = UINT32_MAX; + resolve_attachment_index = in_opt_resolve_attachment_index; } } SubPassAttachment; diff --git a/include/misc/types.h b/include/misc/types.h index a8841346..859a5c6e 100644 --- a/include/misc/types.h +++ b/include/misc/types.h @@ -1323,6 +1323,8 @@ namespace Anvil KHR16BitStorageFeatures(const VkPhysicalDevice16BitStorageFeaturesKHR& in_features); + VkPhysicalDevice16BitStorageFeaturesKHR get_vk_physical_device_16_bit_storage_features() const; + bool operator==(const KHR16BitStorageFeatures& in_features) const; } KHR16BitStorageFeatures; diff --git a/include/wrappers/descriptor_set.h b/include/wrappers/descriptor_set.h index 88e7f348..0e658049 100644 --- a/include/wrappers/descriptor_set.h +++ b/include/wrappers/descriptor_set.h @@ -689,9 +689,12 @@ namespace Anvil current_element_index < last_element_index; ++current_element_index) { - m_dirty |= !(binding_items[current_element_index] == in_elements_ptr[current_element_index - in_element_range.first]); + if (!(binding_items[current_element_index] == in_elements_ptr[current_element_index - in_element_range.first]) ) + { + m_dirty = true; - binding_items[current_element_index] = in_elements_ptr[current_element_index - in_element_range.first]; + binding_items[current_element_index] = in_elements_ptr[current_element_index - in_element_range.first]; + } } return true; @@ -882,13 +885,13 @@ namespace Anvil bool update_using_template_method () const; /* Private variables */ - BindingIndexToBindingItemsMap m_bindings; - VkDescriptorSet m_descriptor_set; - const Anvil::BaseDevice* m_device_ptr; - mutable bool m_dirty; - const Anvil::DescriptorSetLayout* m_layout_ptr; - Anvil::DescriptorPool* m_parent_pool_ptr; - bool m_unusable; + mutable BindingIndexToBindingItemsMap m_bindings; + VkDescriptorSet m_descriptor_set; + const Anvil::BaseDevice* m_device_ptr; + mutable bool m_dirty; + const Anvil::DescriptorSetLayout* m_layout_ptr; + Anvil::DescriptorPool* m_parent_pool_ptr; + bool m_unusable; mutable std::vector m_cached_ds_info_buffer_info_items_vk; mutable std::vector m_cached_ds_info_image_info_items_vk; diff --git a/include/wrappers/device.h b/include/wrappers/device.h index 08e3ff2e..210a2ebd 100644 --- a/include/wrappers/device.h +++ b/include/wrappers/device.h @@ -33,6 +33,7 @@ #include "misc/debug.h" #include "misc/mt_safety.h" +#include "misc/struct_chainer.h" #include "misc/types.h" #include @@ -664,6 +665,9 @@ namespace Anvil } DeviceQueueFamilyInfo; /* Protected functions */ + + std::unique_ptr > get_physical_device_features_chain() const; + std::vector get_queue_priorities(const QueueFamilyInfo* in_queue_family_info_ptr) const; void init (const DeviceExtensionConfiguration& in_extensions, const std::vector& in_layers, diff --git a/src/misc/render_pass_info.cpp b/src/misc/render_pass_info.cpp index ea18fb48..7219230d 100644 --- a/src/misc/render_pass_info.cpp +++ b/src/misc/render_pass_info.cpp @@ -282,8 +282,6 @@ bool Anvil::RenderPassInfo::add_subpass_attachment(SubPassID in_sub bool in_should_resolve, RenderPassAttachmentID in_resolve_attachment_id) { - RenderPassAttachment* renderpass_attachment_ptr = nullptr; - RenderPassAttachment* resolve_attachment_ptr = nullptr; bool result = false; LocationToSubPassAttachmentMap* subpass_attachments_ptr = nullptr; SubPass* subpass_ptr = nullptr; @@ -307,10 +305,6 @@ bool Anvil::RenderPassInfo::add_subpass_attachment(SubPassID in_sub goto end; } - else - { - renderpass_attachment_ptr = &m_attachments.at(in_attachment_id); - } /* Retrieve the resolve attachment descriptor, if one was requested */ if (in_should_resolve) @@ -321,10 +315,6 @@ bool Anvil::RenderPassInfo::add_subpass_attachment(SubPassID in_sub goto end; } - else - { - resolve_attachment_ptr = &m_attachments.at(in_resolve_attachment_id); - } } /* Make sure the attachment location is not already assigned an attachment */ @@ -339,17 +329,15 @@ bool Anvil::RenderPassInfo::add_subpass_attachment(SubPassID in_sub } /* Add the attachment */ - (*subpass_attachments_ptr)[in_attachment_location] = SubPassAttachment(renderpass_attachment_ptr, + (*subpass_attachments_ptr)[in_attachment_location] = SubPassAttachment(in_attachment_id, in_layout, - resolve_attachment_ptr); + in_resolve_attachment_id); if (in_should_resolve) { - anvil_assert(resolve_attachment_ptr != nullptr); - - subpass_ptr->resolved_attachments_map[in_attachment_location] = SubPassAttachment(resolve_attachment_ptr, + subpass_ptr->resolved_attachments_map[in_attachment_location] = SubPassAttachment(in_resolve_attachment_id, in_layout, - nullptr); + UINT32_MAX); } m_update_preserved_attachments = true; @@ -381,10 +369,8 @@ bool Anvil::RenderPassInfo::add_subpass_depth_stencil_attachment(SubPassID RenderPassAttachmentID in_attachment_id, VkImageLayout in_layout) { - RenderPassAttachment* ds_attachment_ptr = nullptr; - RenderPassAttachment* resolve_attachment_ptr = nullptr; - bool result = false; - SubPass* subpass_ptr = nullptr; + bool result = false; + SubPass* subpass_ptr = nullptr; /* Retrieve the subpass descriptor */ if (m_subpasses.size() <= in_subpass_id) @@ -405,22 +391,18 @@ bool Anvil::RenderPassInfo::add_subpass_depth_stencil_attachment(SubPassID goto end; } - else - { - ds_attachment_ptr = &m_attachments.at(in_attachment_id); - } /* Update the depth/stencil attachment for the subpass */ - if (subpass_ptr->depth_stencil_attachment.attachment_ptr != nullptr) + if (subpass_ptr->depth_stencil_attachment.attachment_index != UINT32_MAX) { - anvil_assert(!(subpass_ptr->depth_stencil_attachment.attachment_ptr != nullptr) ); + anvil_assert(!(subpass_ptr->depth_stencil_attachment.attachment_index != UINT32_MAX) ); goto end; } - subpass_ptr->depth_stencil_attachment = SubPassAttachment(ds_attachment_ptr, + subpass_ptr->depth_stencil_attachment = SubPassAttachment(in_attachment_id, in_layout, - resolve_attachment_ptr); + UINT32_MAX); m_update_preserved_attachments = true; result = true; @@ -541,7 +523,7 @@ VkAttachmentReference Anvil::RenderPassInfo::get_attachment_reference_from_subpa { VkAttachmentReference attachment_vk; - attachment_vk.attachment = in_subpass_attachment.attachment_ptr->index; + attachment_vk.attachment = m_attachments.at(in_subpass_attachment.attachment_index).index; attachment_vk.layout = in_subpass_attachment.layout; return attachment_vk; @@ -561,7 +543,7 @@ VkAttachmentReference Anvil::RenderPassInfo::get_attachment_reference_for_resolv anvil_assert((*in_subpass_iterator)->resolved_attachments_map.find(in_location_to_subpass_att_map_iterator->first) != (*in_subpass_iterator)->resolved_attachments_map.end() ); - result.attachment = in_location_to_subpass_att_map_iterator->second.resolve_attachment_ptr->index; + result.attachment = m_attachments.at(in_location_to_subpass_att_map_iterator->second.resolve_attachment_index).index; result.layout = (*in_subpass_iterator)->resolved_attachments_map.at(in_location_to_subpass_att_map_iterator->first).layout; return result; @@ -768,7 +750,7 @@ bool Anvil::RenderPassInfo::get_subpass_n_attachments(SubPassID in_subpass_ case ATTACHMENT_TYPE_DEPTH_STENCIL: { - *out_n_attachments_ptr = (m_subpasses[in_subpass_id]->depth_stencil_attachment.attachment_ptr != nullptr) ? 1u : 0u; + *out_n_attachments_ptr = (m_subpasses[in_subpass_id]->depth_stencil_attachment.attachment_index != UINT32_MAX) ? 1u : 0u; break; } @@ -838,7 +820,7 @@ bool Anvil::RenderPassInfo::get_subpass_attachment_properties(SubPassID } *out_layout_ptr = iterator->second.layout; - *out_renderpass_attachment_id_ptr = iterator->second.attachment_ptr->index; + *out_renderpass_attachment_id_ptr = m_attachments.at(iterator->second.attachment_index).index; break; } @@ -853,7 +835,7 @@ bool Anvil::RenderPassInfo::get_subpass_attachment_properties(SubPassID } *out_layout_ptr = subpass_ptr->depth_stencil_attachment.layout; - *out_renderpass_attachment_id_ptr = subpass_ptr->depth_stencil_attachment.attachment_ptr->index; + *out_renderpass_attachment_id_ptr = m_attachments.at(subpass_ptr->depth_stencil_attachment.attachment_index).index; break; } @@ -869,7 +851,7 @@ bool Anvil::RenderPassInfo::get_subpass_attachment_properties(SubPassID const auto& attachment_props = subpass_ptr->preserved_attachments[in_n_subpass_attachment]; - *out_renderpass_attachment_id_ptr = attachment_props.attachment_ptr->index; + *out_renderpass_attachment_id_ptr = m_attachments.at(attachment_props.attachment_index).index; break; } @@ -920,7 +902,7 @@ void Anvil::RenderPassInfo::update_preserved_attachments() const ++n_attachment_type) { const uint32_t n_attachments = (n_attachment_type == 0) ? static_cast(current_subpass_ptr->color_attachments_map.size() ) - : (n_attachment_type == 1) ? ((current_subpass_ptr->depth_stencil_attachment.attachment_ptr != nullptr) ? 1 : 0) + : (n_attachment_type == 1) ? ((current_subpass_ptr->depth_stencil_attachment.attachment_index != UINT32_MAX) ? 1 : 0) : static_cast(current_subpass_ptr->resolved_attachments_map.size() ); for (uint32_t n_attachment = 0; @@ -966,7 +948,7 @@ void Anvil::RenderPassInfo::update_preserved_attachments() const ++n_attachment_type) { const uint32_t n_attachments = (n_attachment_type == 0) ? static_cast(current_subpass_ptr->color_attachments_map.size() ) - : (n_attachment_type == 1) ? ((current_subpass_ptr->depth_stencil_attachment.attachment_ptr != nullptr) ? 1 : 0) + : (n_attachment_type == 1) ? ((current_subpass_ptr->depth_stencil_attachment.attachment_index != UINT32_MAX) ? 1 : 0) : static_cast(current_subpass_ptr->resolved_attachments_map.size() ); for (uint32_t n_attachment = 0; @@ -1023,7 +1005,7 @@ void Anvil::RenderPassInfo::update_preserved_attachments() const ++n_attachment_type) { const uint32_t n_attachments = (n_attachment_type == 0) ? static_cast(current_subpass_ptr->color_attachments_map.size() ) - : (n_attachment_type == 1) ? ((current_subpass_ptr->depth_stencil_attachment.attachment_ptr != nullptr) ? 1 : 0) + : (n_attachment_type == 1) ? ((current_subpass_ptr->depth_stencil_attachment.attachment_index != UINT32_MAX) ? 1 : 0) : static_cast(current_subpass_ptr->resolved_attachments_map.size() ); for (uint32_t n_attachment = 0; diff --git a/src/misc/types.cpp b/src/misc/types.cpp index 31b2778e..6d77aec0 100644 --- a/src/misc/types.cpp +++ b/src/misc/types.cpp @@ -384,6 +384,21 @@ bool Anvil::KHR16BitStorageFeatures::operator==(const KHR16BitStorageFeatures& i in_features.is_uniform_and_storage_buffer_16_bit_access_supported == is_uniform_and_storage_buffer_16_bit_access_supported); } +VkPhysicalDevice16BitStorageFeaturesKHR Anvil::KHR16BitStorageFeatures::get_vk_physical_device_16_bit_storage_features() const +{ + VkPhysicalDevice16BitStorageFeaturesKHR result; + + result.pNext = nullptr; + result.storageBuffer16BitAccess = BOOL_TO_VK_BOOL32(is_storage_buffer_16_bit_access_supported); + result.storageInputOutput16 = BOOL_TO_VK_BOOL32(is_input_output_storage_supported); + result.storagePushConstant16 = BOOL_TO_VK_BOOL32(is_push_constant_16_bit_storage_supported); + result.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR; + result.uniformAndStorageBuffer16BitAccess = BOOL_TO_VK_BOOL32(is_uniform_and_storage_buffer_16_bit_access_supported); + + return result; + +} + Anvil::KHRMaintenance3Properties::KHRMaintenance3Properties() :max_memory_allocation_size(std::numeric_limits::max() ), max_per_set_descriptors (UINT32_MAX) diff --git a/src/wrappers/descriptor_set.cpp b/src/wrappers/descriptor_set.cpp index 25a4548a..2e10f88f 100644 --- a/src/wrappers/descriptor_set.cpp +++ b/src/wrappers/descriptor_set.cpp @@ -33,6 +33,10 @@ #include "wrappers/image_view.h" #include "wrappers/sampler.h" +#ifdef max + #undef max +#endif + /** Please see header for specification */ Anvil::DescriptorSet::BindingItem& Anvil::DescriptorSet::BindingItem::operator=(const BufferBindingElement& in_element) { @@ -301,8 +305,8 @@ void Anvil::DescriptorSet::alloc_bindings() n_binding < n_bindings; ++n_binding) { - uint32_t array_size = 0; - uint32_t binding_index; + uint32_t array_size = 0; + uint32_t binding_index = UINT32_MAX; layout_info_ptr->get_binding_properties_by_index_number(n_binding, &binding_index, @@ -365,8 +369,8 @@ void Anvil::DescriptorSet::fill_image_info_vk_descriptor(const Anvil::Descriptor VkDescriptorImageInfo* out_descriptor_ptr) const { out_descriptor_ptr->imageLayout = in_binding_item.image_layout; - out_descriptor_ptr->imageView = in_binding_item.image_view_ptr->get_image_view(); - + out_descriptor_ptr->imageView = (in_binding_item.image_view_ptr != nullptr) ? in_binding_item.image_view_ptr->get_image_view() : VK_NULL_HANDLE; + if (false == in_immutable_samplers_enabled && nullptr != in_binding_item.sampler_ptr) { @@ -654,35 +658,38 @@ bool Anvil::DescriptorSet::update_using_core_method() const uint32_t cached_ds_image_info_items_array_offset = 0; uint32_t cached_ds_texel_buffer_info_items_array_offset = 0; const uint32_t n_bindings = static_cast(m_bindings.size() ); - uint32_t n_max_ds_info_items_to_cache = 0; - m_cached_ds_info_buffer_info_items_vk.clear(); - m_cached_ds_info_image_info_items_vk.clear(); + m_cached_ds_info_buffer_info_items_vk.clear (); + m_cached_ds_info_image_info_items_vk.clear (); m_cached_ds_info_texel_buffer_info_items_vk.clear(); - m_cached_ds_write_items_vk.clear(); + m_cached_ds_write_items_vk.clear (); - for (auto& binding : m_bindings) { - const uint32_t n_current_binding_items = static_cast(binding.second.size() ); + uint32_t n_max_ds_info_items_to_cache = 0; - n_max_ds_info_items_to_cache += n_current_binding_items; - } + for (auto& binding : m_bindings) + { + const uint32_t n_current_binding_items = static_cast(binding.second.size() ); - m_cached_ds_info_buffer_info_items_vk.reserve (n_max_ds_info_items_to_cache); - m_cached_ds_info_image_info_items_vk.reserve (n_max_ds_info_items_to_cache); - m_cached_ds_info_texel_buffer_info_items_vk.reserve(n_max_ds_info_items_to_cache); + n_max_ds_info_items_to_cache += n_current_binding_items; + } + + m_cached_ds_info_buffer_info_items_vk.reserve (n_max_ds_info_items_to_cache); + m_cached_ds_info_image_info_items_vk.reserve (n_max_ds_info_items_to_cache); + m_cached_ds_info_texel_buffer_info_items_vk.reserve(n_max_ds_info_items_to_cache); + } for (uint32_t n_binding = 0; n_binding < n_bindings; ++n_binding) { - uint32_t current_binding_index; - VkDescriptorType descriptor_type; - bool immutable_samplers_enabled = false; - const uint32_t start_ds_buffer_info_items_array_offset = cached_ds_buffer_info_items_array_offset; - const uint32_t start_ds_image_info_items_array_offset = cached_ds_image_info_items_array_offset; - const uint32_t start_ds_texel_buffer_info_items_array_offset = cached_ds_texel_buffer_info_items_array_offset; - VkWriteDescriptorSet write_ds_vk; + uint32_t current_binding_index; + VkDescriptorType descriptor_type; + bool immutable_samplers_enabled = false; + uint32_t start_ds_buffer_info_items_array_offset = cached_ds_buffer_info_items_array_offset; + uint32_t start_ds_image_info_items_array_offset = cached_ds_image_info_items_array_offset; + uint32_t start_ds_texel_buffer_info_items_array_offset = cached_ds_texel_buffer_info_items_array_offset; + VkWriteDescriptorSet write_ds_vk; if (!layout_info_ptr->get_binding_properties_by_index_number(n_binding, ¤t_binding_index, @@ -695,16 +702,21 @@ bool Anvil::DescriptorSet::update_using_core_method() const } /* For each array item, initialize a descriptor info item.. */ - const BindingItems& current_binding_items = m_bindings.at(current_binding_index); - const uint32_t n_current_binding_items = static_cast(current_binding_items.size() ); + BindingItems& current_binding_items = m_bindings.at(current_binding_index); + const uint32_t n_current_binding_items = static_cast(current_binding_items.size() ); + int32_t n_last_binding_item = -1; for (uint32_t n_current_binding_item = 0; n_current_binding_item < n_current_binding_items; ++n_current_binding_item) { - const BindingItem& current_binding_item = current_binding_items.at(n_current_binding_item); + BindingItem& current_binding_item = current_binding_items.at(n_current_binding_item); + bool needs_write_item = ((n_current_binding_item + 1) == n_current_binding_items); - if (!current_binding_item.dirty) + /* TODO: For arrayed binding items, avoid updating all binding items every time baking is triggered. */ + if (!current_binding_item.dirty && + n_current_binding_item == 0 && + n_current_binding_items == 1) { continue; } @@ -728,7 +740,8 @@ bool Anvil::DescriptorSet::update_using_core_method() const ++cached_ds_texel_buffer_info_items_array_offset; } else - if (current_binding_item.image_view_ptr != nullptr) + if (current_binding_item.image_view_ptr != nullptr || + current_binding_item.sampler_ptr != nullptr) { VkDescriptorImageInfo image_info; @@ -742,30 +755,44 @@ bool Anvil::DescriptorSet::update_using_core_method() const } else { - anvil_assert_fail(); + /* Need to cache a write item at this point since current binding has not been assigned a descriptor */ + needs_write_item = true; + } - goto end; + if (needs_write_item) + { + const uint32_t n_descriptors = (cached_ds_buffer_info_items_array_offset - start_ds_buffer_info_items_array_offset) + + (cached_ds_image_info_items_array_offset - start_ds_image_info_items_array_offset) + + (cached_ds_texel_buffer_info_items_array_offset - start_ds_texel_buffer_info_items_array_offset); + + if (n_descriptors > 0) + { + write_ds_vk.descriptorCount = n_descriptors; + write_ds_vk.descriptorType = descriptor_type; + write_ds_vk.dstArrayElement = n_last_binding_item + 1; + write_ds_vk.dstBinding = current_binding_index; + write_ds_vk.dstSet = m_descriptor_set; + write_ds_vk.pBufferInfo = (start_ds_buffer_info_items_array_offset != cached_ds_buffer_info_items_array_offset) ? &m_cached_ds_info_buffer_info_items_vk[start_ds_buffer_info_items_array_offset] + : nullptr; + write_ds_vk.pImageInfo = (start_ds_image_info_items_array_offset != cached_ds_image_info_items_array_offset) ? &m_cached_ds_info_image_info_items_vk[start_ds_image_info_items_array_offset] + : nullptr; + write_ds_vk.pNext = nullptr; + write_ds_vk.pTexelBufferView = (start_ds_texel_buffer_info_items_array_offset != cached_ds_texel_buffer_info_items_array_offset) ? &m_cached_ds_info_texel_buffer_info_items_vk[start_ds_texel_buffer_info_items_array_offset] + : nullptr; + write_ds_vk.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; + + anvil_assert(write_ds_vk.descriptorCount != 0); + + m_cached_ds_write_items_vk.push_back(write_ds_vk); + } + + n_last_binding_item = n_current_binding_item; + start_ds_buffer_info_items_array_offset = cached_ds_buffer_info_items_array_offset; + start_ds_image_info_items_array_offset = cached_ds_image_info_items_array_offset; + start_ds_texel_buffer_info_items_array_offset = cached_ds_texel_buffer_info_items_array_offset; } - } - /* We can finally fill the write descriptor */ - if (current_binding_items.size() > 0) - { - write_ds_vk.descriptorCount = static_cast(current_binding_items.size() ); - write_ds_vk.descriptorType = descriptor_type; - write_ds_vk.dstArrayElement = 0; - write_ds_vk.dstBinding = current_binding_index; - write_ds_vk.dstSet = m_descriptor_set; - write_ds_vk.pBufferInfo = (start_ds_buffer_info_items_array_offset != cached_ds_buffer_info_items_array_offset) ? &m_cached_ds_info_buffer_info_items_vk[start_ds_buffer_info_items_array_offset] - : nullptr; - write_ds_vk.pImageInfo = (start_ds_image_info_items_array_offset != cached_ds_image_info_items_array_offset) ? &m_cached_ds_info_image_info_items_vk[start_ds_image_info_items_array_offset] - : nullptr; - write_ds_vk.pNext = nullptr; - write_ds_vk.pTexelBufferView = (start_ds_texel_buffer_info_items_array_offset != cached_ds_texel_buffer_info_items_array_offset) ? &m_cached_ds_info_texel_buffer_info_items_vk[start_ds_texel_buffer_info_items_array_offset] - : nullptr; - write_ds_vk.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; - - m_cached_ds_write_items_vk.push_back(write_ds_vk); + current_binding_item.dirty = false; } } @@ -783,9 +810,6 @@ bool Anvil::DescriptorSet::update_using_core_method() const } result = true; - -end: - return result; } diff --git a/src/wrappers/descriptor_set_group.cpp b/src/wrappers/descriptor_set_group.cpp index 2a0995c5..61c6f5f2 100644 --- a/src/wrappers/descriptor_set_group.cpp +++ b/src/wrappers/descriptor_set_group.cpp @@ -111,7 +111,6 @@ Anvil::DescriptorSetGroup::DescriptorSetGroup(const DescriptorSetGroup* in_paren { auto descriptor_set_layout_manager_ptr = m_device_ptr->get_descriptor_set_layout_manager(); - anvil_assert( in_parent_dsg_ptr != nullptr); anvil_assert( in_parent_dsg_ptr->m_parent_dsg_ptr == nullptr); anvil_assert(((in_parent_dsg_ptr->m_descriptor_pool_ptr->get_flags() & Anvil::DESCRIPTOR_POOL_FLAG_CREATE_FREE_DESCRIPTOR_SET_BIT) > 0) == in_releaseable_sets); @@ -125,7 +124,7 @@ Anvil::DescriptorSetGroup::DescriptorSetGroup(const DescriptorSetGroup* in_paren /* Initialize descriptor pool */ m_descriptor_pool_ptr = Anvil::DescriptorPool::create(in_parent_dsg_ptr->m_device_ptr, in_parent_dsg_ptr->m_descriptor_pool_ptr->get_n_maximum_sets(), - in_releaseable_sets, + in_parent_dsg_ptr->m_descriptor_pool_ptr->get_flags (), m_pool_size_per_descriptor_type, Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() )); @@ -216,11 +215,11 @@ bool Anvil::DescriptorSetGroup::bake_descriptor_pool() VkDescriptorType ds_binding_type; current_ds_layout_info_ptr->get_binding_properties_by_index_number(n_ds_binding, - nullptr, /* out_opt_binding_index_ptr */ + nullptr, /* out_opt_binding_index_Ptr */ &ds_binding_type, &ds_binding_array_size, nullptr, /* out_opt_stage_flags_ptr */ - nullptr);/* out_opt_immutable_samplers_enabled_ptr */ + nullptr); /* out_opt_immutable_samplers_enabled_ptr */ if (ds_binding_type > VK_DESCRIPTOR_TYPE_END_RANGE) { diff --git a/src/wrappers/device.cpp b/src/wrappers/device.cpp index 4ae2e55f..a2c07639 100644 --- a/src/wrappers/device.cpp +++ b/src/wrappers/device.cpp @@ -117,6 +117,34 @@ uint32_t Anvil::BaseDevice::get_n_queues(uint32_t in_n_queue_family) const return result; } +/* Please see header for specification */ +std::unique_ptr > Anvil::BaseDevice::get_physical_device_features_chain() const +{ + const auto& features = get_physical_device_features(); + std::unique_ptr > struct_chainer_ptr; + + struct_chainer_ptr.reset( + new Anvil::StructChainer() + ); + + { + VkPhysicalDeviceFeatures2KHR features_khr; + + features_khr.features = features.core_vk1_0_features_ptr->get_vk_physical_device_features(); + features_khr.pNext = nullptr; + features_khr.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR; + + struct_chainer_ptr->append_struct(features_khr); + } + + if (is_khr_16bit_storage_extension_enabled() ) + { + struct_chainer_ptr->append_struct(features.khr_16bit_storage_features_ptr->get_vk_physical_device_16_bit_storage_features() ); + } + + return struct_chainer_ptr->create_chain(); +} + /* Please see header for specification */ Anvil::Queue* Anvil::BaseDevice::get_queue(const Anvil::QueueFamilyType& in_queue_family_type, uint32_t in_n_queue) const @@ -953,8 +981,10 @@ void Anvil::SGPUDevice::create_device(const std::vector& in_extensi VkDeviceCreateInfo create_info; std::vector device_queue_create_info_items; std::vector device_queue_priorities; - const auto& physical_device_queue_fams(m_parent_physical_device_ptr->get_queue_families() ); - VkResult result (VK_ERROR_INITIALIZATION_FAILED); + auto features_chain_ptr (get_physical_device_features_chain() ); + auto features_chain_root_struct_ptr(features_chain_ptr->get_root_struct() ); + const auto& physical_device_queue_fams (m_parent_physical_device_ptr->get_queue_families() ); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); ANVIL_REDUNDANT_VARIABLE(result); @@ -1001,7 +1031,8 @@ void Anvil::SGPUDevice::create_device(const std::vector& in_extensi create_info.enabledLayerCount = static_cast(in_layers.size() ); create_info.flags = 0; create_info.pEnabledFeatures = &in_features; - create_info.pNext = nullptr; + create_info.pNext = (m_parent_physical_device_ptr->get_instance()->is_instance_extension_enabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME)) ? features_chain_root_struct_ptr + : features_chain_root_struct_ptr->pNext; create_info.ppEnabledExtensionNames = (in_extensions.size() > 0) ? &in_extensions[0] : nullptr; create_info.ppEnabledLayerNames = (in_layers.size() > 0) ? &in_layers [0] : nullptr; create_info.pQueueCreateInfos = &device_queue_create_info_items[0]; @@ -1037,7 +1068,7 @@ Anvil::SwapchainUniquePtr Anvil::SGPUDevice::create_swapchain(Anvil::RenderingSu in_usage, in_n_swapchain_images, m_khr_swapchain_extension_entrypoints, - Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); + Anvil::MT_SAFETY_ENABLED); return result_ptr; } diff --git a/src/wrappers/physical_device.cpp b/src/wrappers/physical_device.cpp index 019057f0..311efcd1 100644 --- a/src/wrappers/physical_device.cpp +++ b/src/wrappers/physical_device.cpp @@ -77,7 +77,7 @@ bool Anvil::PhysicalDevice::init() uint32_t n_physical_device_queues = 0; bool result = true; VkResult result_vk = VK_ERROR_INITIALIZATION_FAILED; - const bool texture_gather_bias_lod_support = is_device_extension_supported(VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME); + bool texture_gather_bias_lod_support = false; anvil_assert(m_physical_device != VK_NULL_HANDLE); @@ -187,6 +187,8 @@ bool Anvil::PhysicalDevice::init() } /* Retrieve device format properties */ + texture_gather_bias_lod_support = is_device_extension_supported(VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME);; + for (VkFormat current_format = static_cast(1); /* skip the _UNDEFINED format */ current_format < VK_FORMAT_RANGE_SIZE; current_format = static_cast(current_format + 1)) diff --git a/src/wrappers/render_pass.cpp b/src/wrappers/render_pass.cpp index b6db84f1..9bccb763 100644 --- a/src/wrappers/render_pass.cpp +++ b/src/wrappers/render_pass.cpp @@ -198,7 +198,7 @@ bool Anvil::RenderPass::init() subpass_color_attachment_iterator != (*subpass_iterator)->color_attachments_map.cend(); ++subpass_color_attachment_iterator) { - if (subpass_color_attachment_iterator->second.resolve_attachment_ptr != nullptr) + if (subpass_color_attachment_iterator->second.resolve_attachment_index != UINT32_MAX) { need_color_resolve_attachments = true; @@ -265,7 +265,7 @@ bool Anvil::RenderPass::init() if (need_color_resolve_attachments) { - if (subpass_color_attachment_iterator->second.resolve_attachment_ptr != nullptr) + if (subpass_color_attachment_iterator->second.resolve_attachment_index != UINT32_MAX) { current_subpass_attachment_set_ptr->resolve_color_attachments_vk[subpass_color_attachment_iterator->first] = m_render_pass_info_ptr->get_attachment_reference_for_resolve_attachment(subpass_iterator, subpass_color_attachment_iterator); @@ -273,7 +273,7 @@ bool Anvil::RenderPass::init() } } - if ((*subpass_iterator)->depth_stencil_attachment.attachment_ptr != nullptr) + if ((*subpass_iterator)->depth_stencil_attachment.attachment_index != UINT32_MAX) { current_subpass_attachment_set_ptr->depth_attachment_vk = m_render_pass_info_ptr->get_attachment_reference_from_subpass_attachment((*subpass_iterator)->depth_stencil_attachment); } @@ -294,7 +294,9 @@ bool Anvil::RenderPass::init() subpass_preserve_attachment_iterator != (*subpass_iterator)->preserved_attachments.cend(); ++subpass_preserve_attachment_iterator) { - current_subpass_attachment_set_ptr->preserve_attachments_vk.push_back(subpass_preserve_attachment_iterator->attachment_ptr->index); + current_subpass_attachment_set_ptr->preserve_attachments_vk.push_back( + m_render_pass_info_ptr->m_attachments.at(subpass_preserve_attachment_iterator->attachment_index).index + ); } /* Prepare the VK subpass descriptor */ @@ -307,12 +309,12 @@ bool Anvil::RenderPass::init() subpass_vk.colorAttachmentCount = n_color_attachments; subpass_vk.flags = 0; subpass_vk.inputAttachmentCount = n_input_attachments; - subpass_vk.pColorAttachments = (n_color_attachments > 0) ? ¤t_subpass_attachment_set_ptr->color_attachments_vk.at(0) - : nullptr; - subpass_vk.pDepthStencilAttachment = ((*subpass_iterator)->depth_stencil_attachment.attachment_ptr != nullptr) ? ¤t_subpass_attachment_set_ptr->depth_attachment_vk - : nullptr; - subpass_vk.pInputAttachments = (n_input_attachments > 0) ? ¤t_subpass_attachment_set_ptr->input_attachments_vk.at(0) - : nullptr; + subpass_vk.pColorAttachments = (n_color_attachments > 0) ? ¤t_subpass_attachment_set_ptr->color_attachments_vk.at(0) + : nullptr; + subpass_vk.pDepthStencilAttachment = ((*subpass_iterator)->depth_stencil_attachment.attachment_index != UINT32_MAX) ? ¤t_subpass_attachment_set_ptr->depth_attachment_vk + : nullptr; + subpass_vk.pInputAttachments = (n_input_attachments > 0) ? ¤t_subpass_attachment_set_ptr->input_attachments_vk.at(0) + : nullptr; subpass_vk.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS; subpass_vk.pPreserveAttachments = (n_preserved_attachments > 0) ? ¤t_subpass_attachment_set_ptr->preserve_attachments_vk.at(0) : nullptr; diff --git a/src/wrappers/swapchain.cpp b/src/wrappers/swapchain.cpp index 80a9d8d1..6753cef5 100644 --- a/src/wrappers/swapchain.cpp +++ b/src/wrappers/swapchain.cpp @@ -245,20 +245,20 @@ void Anvil::Swapchain::destroy_swapchain() /* If this assertion failure explodes, your application attempted to release a swapchain without presenting all acquired swapchain images. * That's illegal per Vulkan spec. */ - if (m_swapchain != VK_NULL_HANDLE) + lock(); { - anvil_assert(m_n_acquire_counter == m_n_present_counter); - - lock(); + if (m_swapchain != VK_NULL_HANDLE) { + anvil_assert(m_n_acquire_counter == m_n_present_counter); + m_khr_swapchain_entrypoints.vkDestroySwapchainKHR(m_device_ptr->get_device_vk(), m_swapchain, nullptr /* pAllocator */); } - unlock(); m_swapchain = VK_NULL_HANDLE; } + unlock(); } /** Please see header for specification */ From be89283d9c3947a4c3c8e18e3468e716afd3175a Mon Sep 17 00:00:00 2001 From: Joshua Reibert Date: Fri, 6 Apr 2018 09:33:05 +0200 Subject: [PATCH 07/50] Fix VmaVector resize call --- deps/VulkanMemoryAllocator/vk_mem_alloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/VulkanMemoryAllocator/vk_mem_alloc.h b/deps/VulkanMemoryAllocator/vk_mem_alloc.h index 669e383c..d65e7508 100644 --- a/deps/VulkanMemoryAllocator/vk_mem_alloc.h +++ b/deps/VulkanMemoryAllocator/vk_mem_alloc.h @@ -926,7 +926,7 @@ class VmaVector { if(&rhs != this) { - Resize(rhs.m_Count); + resize(rhs.m_Count); if(m_Count != 0) memcpy(m_pArray, rhs.m_pArray, m_Count * sizeof(T)); } From 6856a265e07c9dddd584227d994d9ef7478295e3 Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Thu, 12 Apr 2018 16:25:01 +0200 Subject: [PATCH 08/50] Week 15 update: Bug-fixes: Resetting command buffers must be preceded with a pool lock. Dependency updates: Updated glslang to 5d3babdbdfb2b2fb632450fdd1c4ec093bb3b071 Dependency updates: Updated VMA to 5391e6c7fae01b4271d61b1e5bbeff494cc24296 Dependency updates: Updated Vulkan headers to v72 New features: Added support for AMD_shader_core New features: Added support for EXT_descriptor_indexing Refactoring: General extension support is now encapsulated in a single header file. Refactoring: Most of the objects now take a "create info" structure at instantiation time. Refactoring: Renamed existing ..Info structs to CreateInfo for coherence. --- CMakeLists.txt | 54 +- deps/VulkanMemoryAllocator/vk_mem_alloc.h | 8721 ++++++++++--- deps/glslang/CMakeLists.txt | 30 +- deps/glslang/External/CMakeLists.txt | 35 - deps/glslang/LinuxDoAll.bash | 34 - deps/glslang/OGLCompilersDLL/CMakeLists.txt | 12 +- .../glslang/OGLCompilersDLL/InitializeDll.cpp | 34 +- deps/glslang/OGLCompilersDLL/InitializeDll.h | 4 +- deps/glslang/README-spirv-remap.txt | 2 +- deps/glslang/SPIRV/CMakeLists.txt | 31 +- deps/glslang/SPIRV/GLSL.ext.AMD.h | 13 +- deps/glslang/SPIRV/GLSL.ext.EXT.h | 37 + deps/glslang/SPIRV/GLSL.ext.KHR.h | 6 - deps/glslang/SPIRV/GLSL.ext.NV.h | 3 + deps/glslang/SPIRV/GlslangToSpv.cpp | 2355 +++- deps/glslang/SPIRV/GlslangToSpv.h | 8 +- deps/glslang/SPIRV/SPVRemapper.cpp | 182 +- deps/glslang/SPIRV/SPVRemapper.h | 12 +- deps/glslang/SPIRV/SpvBuilder.cpp | 297 +- deps/glslang/SPIRV/SpvBuilder.h | 54 +- deps/glslang/SPIRV/disassemble.cpp | 5 +- deps/glslang/SPIRV/doc.cpp | 933 +- deps/glslang/SPIRV/doc.h | 4 - deps/glslang/SPIRV/spirv.hpp | 128 +- deps/glslang/SPIRV/spvIR.h | 13 +- deps/glslang/SetupLinux.sh | 10 - deps/glslang/glslang/CMakeLists.txt | 25 +- deps/glslang/glslang/Include/BaseTypes.h | 95 +- deps/glslang/glslang/Include/Common.h | 62 +- deps/glslang/glslang/Include/ConstantUnion.h | 361 +- .../glslang/Include/InitializeGlobals.h | 3 - deps/glslang/glslang/Include/PoolAlloc.h | 9 +- deps/glslang/glslang/Include/ShHandle.h | 7 +- deps/glslang/glslang/Include/Types.h | 179 +- deps/glslang/glslang/Include/arrays.h | 43 +- deps/glslang/glslang/Include/intermediate.h | 500 +- deps/glslang/glslang/Include/revision.h | 5 +- .../glslang/MachineIndependent/Constant.cpp | 251 +- .../glslang/MachineIndependent/Initialize.cpp | 3025 ++++- .../glslang/MachineIndependent/Initialize.h | 2 - .../MachineIndependent/Intermediate.cpp | 1792 ++- .../MachineIndependent/ParseContextBase.cpp | 32 +- .../MachineIndependent/ParseHelper.cpp | 822 +- .../glslang/MachineIndependent/ParseHelper.h | 69 +- .../glslang/MachineIndependent/PoolAlloc.cpp | 62 +- .../glslang/MachineIndependent/Scan.cpp | 315 +- .../glslang/glslang/MachineIndependent/Scan.h | 17 +- .../glslang/MachineIndependent/ShaderLang.cpp | 241 +- .../MachineIndependent/SymbolTable.cpp | 14 +- .../glslang/MachineIndependent/Versions.cpp | 191 +- .../glslang/MachineIndependent/Versions.h | 31 +- .../glslang/MachineIndependent/attribute.cpp | 257 + .../glslang/MachineIndependent/attribute.h | 102 + .../glslang/MachineIndependent/gl_types.h | 34 + .../glslang/MachineIndependent/glslang.y | 1002 +- .../MachineIndependent/glslang_tab.cpp | 10794 +++++++++------- .../MachineIndependent/glslang_tab.cpp.h | 690 +- .../glslang/MachineIndependent/intermOut.cpp | 518 +- .../glslang/MachineIndependent/iomapper.cpp | 176 +- .../MachineIndependent/linkValidate.cpp | 92 +- .../MachineIndependent/localintermediate.h | 159 +- .../MachineIndependent/parseVersions.h | 11 +- .../MachineIndependent/preprocessor/Pp.cpp | 58 +- .../preprocessor/PpContext.h | 2 +- .../preprocessor/PpScanner.cpp | 283 +- .../preprocessor/PpTokens.cpp | 6 - .../preprocessor/PpTokens.h | 2 - .../glslang/MachineIndependent/reflection.cpp | 56 +- .../glslang/MachineIndependent/reflection.h | 2 +- deps/glslang/glslang/Public/ShaderLang.h | 93 +- deps/glslang/hlsl/CMakeLists.txt | 14 +- deps/glslang/hlsl/hlslAttributes.cpp | 94 +- deps/glslang/hlsl/hlslAttributes.h | 61 +- deps/glslang/hlsl/hlslGrammar.cpp | 416 +- deps/glslang/hlsl/hlslGrammar.h | 17 +- deps/glslang/hlsl/hlslParseHelper.cpp | 1736 ++- deps/glslang/hlsl/hlslParseHelper.h | 93 +- deps/glslang/hlsl/hlslParseables.cpp | 132 +- deps/glslang/hlsl/hlslScanContext.cpp | 22 +- deps/glslang/hlsl/hlslTokens.h | 5 + deps/glslang/index.php | 81 - examples/DynamicBuffers/src/app.cpp | 371 +- examples/MultiViewport/src/app.cpp | 217 +- examples/OcclusionQuery/src/app.cpp | 345 +- .../OutOfOrderRasterization/include/app.h | 1 - examples/OutOfOrderRasterization/src/app.cpp | 583 +- examples/PushConstants/src/app.cpp | 213 +- ...ine_info.h => base_pipeline_create_info.h} | 54 +- include/misc/base_pipeline_manager.h | 32 +- include/misc/buffer_create_info.h | 312 + include/misc/buffer_view_create_info.h | 135 + include/misc/callbacks.h | 2 +- ..._info.h => compute_pipeline_create_info.h} | 40 +- include/misc/debug.h | 2 +- include/misc/debug_marker.h | 2 +- ...et_info.h => descriptor_set_create_info.h} | 94 +- include/misc/dummy_window.h | 2 +- include/misc/event_create_info.h | 78 + include/misc/extensions.h | 628 + include/misc/fence_create_info.h | 91 + include/misc/formats.h | 3 +- include/misc/fp16.h | 2 +- include/misc/framebuffer_create_info.h | 184 + include/misc/glsl_to_spirv.h | 26 +- ...info.h => graphics_pipeline_create_info.h} | 72 +- include/misc/image_create_info.h | 530 + include/misc/image_view_create_info.h | 441 + include/misc/io.h | 2 +- .../misc/memalloc_backends/backend_oneshot.h | 12 +- include/misc/memalloc_backends/backend_vma.h | 16 +- include/misc/memory_allocator.h | 288 +- include/misc/mt_safety.h | 2 +- include/misc/object_tracker.h | 2 +- include/misc/page_tracker.h | 2 +- include/misc/pools.h | 2 +- include/misc/ref_counter.h | 2 +- ..._pass_info.h => render_pass_create_info.h} | 36 +- include/misc/sampler_create_info.h | 260 + include/misc/semaphore_create_info.h | 71 + include/misc/shader_module_cache.h | 2 +- include/misc/swapchain_create_info.h | 180 + include/misc/time.h | 2 +- include/misc/types.h | 2922 +---- include/misc/types_classes.h | 371 + include/misc/types_enums.h | 388 + include/misc/types_macro.h | 430 + include/misc/types_struct.h | 1378 ++ include/misc/types_utils.h | 299 + include/misc/window.h | 2 +- include/misc/window_factory.h | 2 +- include/misc/window_win3264.h | 2 +- include/vulkan/vulkan_android.h | 126 + include/vulkan/vulkan_core.h | 140 +- include/vulkan/vulkan_ios.h | 58 + include/vulkan/vulkan_macos.h | 58 + include/vulkan/vulkan_mir.h | 65 + include/vulkan/vulkan_vi.h | 58 + include/vulkan/vulkan_wayland.h | 65 + include/vulkan/vulkan_xlib.h | 66 + include/vulkan/vulkan_xlib_xrandr.h | 54 + include/wrappers/buffer.h | 257 +- include/wrappers/buffer_view.h | 53 +- include/wrappers/command_buffer.h | 46 +- include/wrappers/command_pool.h | 2 +- include/wrappers/compute_pipeline_manager.h | 2 +- include/wrappers/descriptor_pool.h | 2 +- include/wrappers/descriptor_set.h | 2 +- include/wrappers/descriptor_set_group.h | 41 +- include/wrappers/descriptor_set_layout.h | 34 +- .../wrappers/descriptor_set_layout_manager.h | 2 +- include/wrappers/descriptor_update_template.h | 6 +- include/wrappers/device.h | 186 +- include/wrappers/event.h | 20 +- include/wrappers/fence.h | 26 +- include/wrappers/framebuffer.h | 134 +- include/wrappers/graphics_pipeline_manager.h | 8 +- include/wrappers/image.h | 391 +- include/wrappers/image_view.h | 333 +- include/wrappers/instance.h | 12 +- include/wrappers/memory_block.h | 95 +- include/wrappers/physical_device.h | 40 +- include/wrappers/pipeline_cache.h | 2 +- include/wrappers/pipeline_layout.h | 32 +- include/wrappers/pipeline_layout_manager.h | 10 +- include/wrappers/query_pool.h | 2 +- include/wrappers/queue.h | 39 +- include/wrappers/render_pass.h | 26 +- include/wrappers/rendering_surface.h | 18 +- include/wrappers/sampler.h | 126 +- include/wrappers/semaphore.h | 25 +- include/wrappers/shader_module.h | 2 +- include/wrappers/swapchain.h | 132 +- ...info.cpp => base_pipeline_create_info.cpp} | 112 +- src/misc/base_pipeline_manager.cpp | 48 +- src/misc/buffer_create_info.cpp | 220 + src/misc/buffer_view_create_info.cpp | 59 + src/misc/compute_pipeline_create_info.cpp | 95 + src/misc/compute_pipeline_info.cpp | 95 - src/misc/debug.cpp | 2 +- src/misc/debug_marker.cpp | 4 +- ...nfo.cpp => descriptor_set_create_info.cpp} | 171 +- src/misc/dummy_window.cpp | 73 +- src/misc/event_create_info.cpp | 43 + src/misc/fence_create_info.cpp | 47 + src/misc/formats.cpp | 2 +- src/misc/fp16.cpp | 2 +- src/misc/framebuffer_create_info.cpp | 179 + src/misc/glsl_to_spirv.cpp | 4 +- ....cpp => graphics_pipeline_create_info.cpp} | 562 +- src/misc/image_create_info.cpp | 262 + src/misc/image_view_create_info.cpp | 334 + src/misc/io.cpp | 2 +- .../memalloc_backends/backend_oneshot.cpp | 31 +- src/misc/memalloc_backends/backend_vma.cpp | 87 +- src/misc/memory_allocator.cpp | 444 +- src/misc/object_tracker.cpp | 2 +- src/misc/page_tracker.cpp | 2 +- src/misc/pools.cpp | 2 +- ...s_info.cpp => render_pass_create_info.cpp} | 231 +- src/misc/sampler_create_info.cpp | 100 + src/misc/semaphore_create_info.cpp | 44 + src/misc/shader_module_cache.cpp | 2 +- src/misc/swapchain_create_info.cpp | 74 + src/misc/time.cpp | 2 +- src/misc/types.cpp | 3349 +---- src/misc/types_classes.cpp | 680 + src/misc/types_struct.cpp | 2356 ++++ src/misc/types_utils.cpp | 894 ++ src/misc/window.cpp | 2 +- src/misc/window_factory.cpp | 2 +- src/misc/window_win3264.cpp | 2 +- src/wrappers/buffer.cpp | 793 +- src/wrappers/buffer_view.cpp | 115 +- src/wrappers/command_buffer.cpp | 67 +- src/wrappers/command_pool.cpp | 6 +- src/wrappers/compute_pipeline_manager.cpp | 24 +- src/wrappers/descriptor_pool.cpp | 57 +- src/wrappers/descriptor_set.cpp | 60 +- src/wrappers/descriptor_set_group.cpp | 157 +- src/wrappers/descriptor_set_layout.cpp | 94 +- .../descriptor_set_layout_manager.cpp | 16 +- src/wrappers/descriptor_update_template.cpp | 18 +- src/wrappers/device.cpp | 291 +- src/wrappers/event.cpp | 73 +- src/wrappers/fence.cpp | 80 +- src/wrappers/framebuffer.cpp | 225 +- src/wrappers/graphics_pipeline_manager.cpp | 290 +- src/wrappers/image.cpp | 1114 +- src/wrappers/image_view.cpp | 522 +- src/wrappers/instance.cpp | 134 +- src/wrappers/memory_block.cpp | 181 +- src/wrappers/physical_device.cpp | 168 +- src/wrappers/pipeline_cache.cpp | 2 +- src/wrappers/pipeline_layout.cpp | 38 +- src/wrappers/pipeline_layout_manager.cpp | 30 +- src/wrappers/query_pool.cpp | 2 +- src/wrappers/queue.cpp | 133 +- src/wrappers/render_pass.cpp | 64 +- src/wrappers/rendering_surface.cpp | 97 +- src/wrappers/sampler.cpp | 188 +- src/wrappers/semaphore.cpp | 38 +- src/wrappers/shader_module.cpp | 2 +- src/wrappers/swapchain.cpp | 415 +- 243 files changed, 44074 insertions(+), 24149 deletions(-) delete mode 100644 deps/glslang/External/CMakeLists.txt delete mode 100644 deps/glslang/LinuxDoAll.bash create mode 100644 deps/glslang/SPIRV/GLSL.ext.EXT.h delete mode 100644 deps/glslang/SetupLinux.sh create mode 100644 deps/glslang/glslang/MachineIndependent/attribute.cpp create mode 100644 deps/glslang/glslang/MachineIndependent/attribute.h delete mode 100644 deps/glslang/index.php rename include/misc/{base_pipeline_info.h => base_pipeline_create_info.h} (66%) create mode 100644 include/misc/buffer_create_info.h create mode 100644 include/misc/buffer_view_create_info.h rename include/misc/{compute_pipeline_info.h => compute_pipeline_create_info.h} (66%) rename include/misc/{descriptor_set_info.h => descriptor_set_create_info.h} (70%) create mode 100644 include/misc/event_create_info.h create mode 100644 include/misc/extensions.h create mode 100644 include/misc/fence_create_info.h create mode 100644 include/misc/framebuffer_create_info.h rename include/misc/{graphics_pipeline_info.h => graphics_pipeline_create_info.h} (95%) create mode 100644 include/misc/image_create_info.h create mode 100644 include/misc/image_view_create_info.h rename include/misc/{render_pass_info.h => render_pass_create_info.h} (97%) create mode 100644 include/misc/sampler_create_info.h create mode 100644 include/misc/semaphore_create_info.h create mode 100644 include/misc/swapchain_create_info.h create mode 100644 include/misc/types_classes.h create mode 100644 include/misc/types_enums.h create mode 100644 include/misc/types_macro.h create mode 100644 include/misc/types_struct.h create mode 100644 include/misc/types_utils.h create mode 100644 include/vulkan/vulkan_android.h create mode 100644 include/vulkan/vulkan_ios.h create mode 100644 include/vulkan/vulkan_macos.h create mode 100644 include/vulkan/vulkan_mir.h create mode 100644 include/vulkan/vulkan_vi.h create mode 100644 include/vulkan/vulkan_wayland.h create mode 100644 include/vulkan/vulkan_xlib.h create mode 100644 include/vulkan/vulkan_xlib_xrandr.h rename src/misc/{base_pipeline_info.cpp => base_pipeline_create_info.cpp} (52%) create mode 100644 src/misc/buffer_create_info.cpp create mode 100644 src/misc/buffer_view_create_info.cpp create mode 100644 src/misc/compute_pipeline_create_info.cpp delete mode 100644 src/misc/compute_pipeline_info.cpp rename src/misc/{descriptor_set_info.cpp => descriptor_set_create_info.cpp} (57%) create mode 100644 src/misc/event_create_info.cpp create mode 100644 src/misc/fence_create_info.cpp create mode 100644 src/misc/framebuffer_create_info.cpp rename src/misc/{graphics_pipeline_info.cpp => graphics_pipeline_create_info.cpp} (50%) create mode 100644 src/misc/image_create_info.cpp create mode 100644 src/misc/image_view_create_info.cpp rename src/misc/{render_pass_info.cpp => render_pass_create_info.cpp} (79%) create mode 100644 src/misc/sampler_create_info.cpp create mode 100644 src/misc/semaphore_create_info.cpp create mode 100644 src/misc/swapchain_create_info.cpp create mode 100644 src/misc/types_classes.cpp create mode 100644 src/misc/types_struct.cpp create mode 100644 src/misc/types_utils.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 3012f39e..395963fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,8 +11,7 @@ configure_file("include/config.h.in" "include/config.h") include_directories("$(Anvil_SOURCE_DIR)" "$(Anvil_SOURCE_DIR)/deps" - "$(Anvil_SOURCE_DIR)/include" - "${Anvil_BINARY_DIR}/include") + "$(Anvil_SOURCE_DIR)/include") if (WIN32) if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") @@ -34,18 +33,26 @@ endif() SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_oneshot.h" "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_vma.h" - "${Anvil_SOURCE_DIR}/include/misc/base_pipeline_info.h" + "${Anvil_SOURCE_DIR}/include/misc/base_pipeline_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/base_pipeline_manager.h" + "${Anvil_SOURCE_DIR}/include/misc/buffer_create_info.h" + "${Anvil_SOURCE_DIR}/include/misc/buffer_view_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/callbacks.h" - "${Anvil_SOURCE_DIR}/include/misc/compute_pipeline_info.h" + "${Anvil_SOURCE_DIR}/include/misc/compute_pipeline_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/debug.h" "${Anvil_SOURCE_DIR}/include/misc/debug_marker.h" - "${Anvil_SOURCE_DIR}/include/misc/descriptor_set_info.h" + "${Anvil_SOURCE_DIR}/include/misc/descriptor_set_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/dummy_window.h" + "${Anvil_SOURCE_DIR}/include/misc/event_create_info.h" + "${Anvil_SOURCE_DIR}/include/misc/extensions.h" + "${Anvil_SOURCE_DIR}/include/misc/fence_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/formats.h" "${Anvil_SOURCE_DIR}/include/misc/fp16.h" + "${Anvil_SOURCE_DIR}/include/misc/framebuffer_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/glsl_to_spirv.h" - "${Anvil_SOURCE_DIR}/include/misc/graphics_pipeline_info.h" + "${Anvil_SOURCE_DIR}/include/misc/graphics_pipeline_create_info.h" + "${Anvil_SOURCE_DIR}/include/misc/image_create_info.h" + "${Anvil_SOURCE_DIR}/include/misc/image_view_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/io.h" "${Anvil_SOURCE_DIR}/include/misc/memory_allocator.h" "${Anvil_SOURCE_DIR}/include/misc/mt_safety.h" @@ -53,11 +60,19 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/include/misc/page_tracker.h" "${Anvil_SOURCE_DIR}/include/misc/pools.h" "${Anvil_SOURCE_DIR}/include/misc/ref_counter.h" - "${Anvil_SOURCE_DIR}/include/misc/render_pass_info.h" + "${Anvil_SOURCE_DIR}/include/misc/render_pass_create_info.h" + "${Anvil_SOURCE_DIR}/include/misc/sampler_create_info.h" + "${Anvil_SOURCE_DIR}/include/misc/semaphore_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/shader_module_cache.h" "${Anvil_SOURCE_DIR}/include/misc/struct_chainer.h" + "${Anvil_SOURCE_DIR}/include/misc/swapchain_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/time.h" "${Anvil_SOURCE_DIR}/include/misc/types.h" + "${Anvil_SOURCE_DIR}/include/misc/types_classes.h" + "${Anvil_SOURCE_DIR}/include/misc/types_enums.h" + "${Anvil_SOURCE_DIR}/include/misc/types_macro.h" + "${Anvil_SOURCE_DIR}/include/misc/types_struct.h" + "${Anvil_SOURCE_DIR}/include/misc/types_utils.h" "${Anvil_SOURCE_DIR}/include/misc/window.h" "${Anvil_SOURCE_DIR}/include/misc/window_factory.h" "${Anvil_SOURCE_DIR}/include/wrappers/buffer.h" @@ -95,26 +110,39 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/src/misc/memalloc_backends/backend_oneshot.cpp" "${Anvil_SOURCE_DIR}/src/misc/memalloc_backends/backend_vma.cpp" - "${Anvil_SOURCE_DIR}/src/misc/base_pipeline_info.cpp" + "${Anvil_SOURCE_DIR}/src/misc/base_pipeline_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/base_pipeline_manager.cpp" - "${Anvil_SOURCE_DIR}/src/misc/compute_pipeline_info.cpp" + "${Anvil_SOURCE_DIR}/src/misc/buffer_create_info.cpp" + "${Anvil_SOURCE_DIR}/src/misc/buffer_view_create_info.cpp" + "${Anvil_SOURCE_DIR}/src/misc/compute_pipeline_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/debug.cpp" "${Anvil_SOURCE_DIR}/src/misc/debug_marker.cpp" - "${Anvil_SOURCE_DIR}/src/misc/descriptor_set_info.cpp" + "${Anvil_SOURCE_DIR}/src/misc/descriptor_set_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/dummy_window.cpp" + "${Anvil_SOURCE_DIR}/src/misc/event_create_info.cpp" + "${Anvil_SOURCE_DIR}/src/misc/fence_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/formats.cpp" "${Anvil_SOURCE_DIR}/src/misc/fp16.cpp" + "${Anvil_SOURCE_DIR}/src/misc/framebuffer_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/glsl_to_spirv.cpp" - "${Anvil_SOURCE_DIR}/src/misc/graphics_pipeline_info.cpp" + "${Anvil_SOURCE_DIR}/src/misc/graphics_pipeline_create_info.cpp" + "${Anvil_SOURCE_DIR}/src/misc/image_create_info.cpp" + "${Anvil_SOURCE_DIR}/src/misc/image_view_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/io.cpp" "${Anvil_SOURCE_DIR}/src/misc/memory_allocator.cpp" "${Anvil_SOURCE_DIR}/src/misc/object_tracker.cpp" "${Anvil_SOURCE_DIR}/src/misc/page_tracker.cpp" "${Anvil_SOURCE_DIR}/src/misc/pools.cpp" - "${Anvil_SOURCE_DIR}/src/misc/render_pass_info.cpp" + "${Anvil_SOURCE_DIR}/src/misc/render_pass_create_info.cpp" + "${Anvil_SOURCE_DIR}/src/misc/sampler_create_info.cpp" + "${Anvil_SOURCE_DIR}/src/misc/semaphore_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/shader_module_cache.cpp" + "${Anvil_SOURCE_DIR}/src/misc/swapchain_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/time.cpp" "${Anvil_SOURCE_DIR}/src/misc/types.cpp" + "${Anvil_SOURCE_DIR}/src/misc/types_classes.cpp" + "${Anvil_SOURCE_DIR}/src/misc/types_struct.cpp" + "${Anvil_SOURCE_DIR}/src/misc/types_utils.cpp" "${Anvil_SOURCE_DIR}/src/misc/window.cpp" "${Anvil_SOURCE_DIR}/src/misc/window_factory.cpp" "${Anvil_SOURCE_DIR}/src/wrappers/buffer.cpp" @@ -195,10 +223,8 @@ endif() # Add dependendencies if (WIN32) add_subdirectory("deps\\glslang") - add_subdirectory("deps\\glslang\\OGLCompilersDLL") else() add_subdirectory("deps/glslang") - add_subdirectory("deps/glslang/OGLCompilersDLL") endif() # Enable level-4 warnings diff --git a/deps/VulkanMemoryAllocator/vk_mem_alloc.h b/deps/VulkanMemoryAllocator/vk_mem_alloc.h index d65e7508..1ff25299 100644 --- a/deps/VulkanMemoryAllocator/vk_mem_alloc.h +++ b/deps/VulkanMemoryAllocator/vk_mem_alloc.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -23,162 +23,1240 @@ #ifndef AMD_VULKAN_MEMORY_ALLOCATOR_H #define AMD_VULKAN_MEMORY_ALLOCATOR_H +#ifdef __cplusplus +extern "C" { +#endif + /** \mainpage Vulkan Memory Allocator -Version 1.0, 2017-05-10 +Version 2.0.0 (2018-03-19) + +Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. \n +License: MIT + +Documentation of all members: vk_mem_alloc.h + +\section main_table_of_contents Table of contents + +- User guide + - \subpage quick_start + - [Project setup](@ref quick_start_project_setup) + - [Initialization](@ref quick_start_initialization) + - [Resource allocation](@ref quick_start_resource_allocation) + - \subpage choosing_memory_type + - [Usage](@ref choosing_memory_type_usage) + - [Required and preferred flags](@ref choosing_memory_type_required_preferred_flags) + - [Explicit memory types](@ref choosing_memory_type_explicit_memory_types) + - [Custom memory pools](@ref choosing_memory_type_custom_memory_pools) + - \subpage memory_mapping + - [Mapping functions](@ref memory_mapping_mapping_functions) + - [Persistently mapped memory](@ref memory_mapping_persistently_mapped_memory) + - [Cache control](@ref memory_mapping_cache_control) + - [Finding out if memory is mappable](@ref memory_mapping_finding_if_memory_mappable) + - \subpage custom_memory_pools + - [Choosing memory type index](@ref custom_memory_pools_MemTypeIndex) + - \subpage defragmentation + - \subpage lost_allocations + - \subpage statistics + - [Numeric statistics](@ref statistics_numeric_statistics) + - [JSON dump](@ref statistics_json_dump) + - \subpage allocation_annotation + - [Allocation user data](@ref allocation_user_data) + - [Allocation names](@ref allocation_names) +- \subpage usage_patterns + - [Simple patterns](@ref usage_patterns_simple) + - [Advanced patterns](@ref usage_patterns_advanced) +- \subpage configuration + - [Pointers to Vulkan functions](@ref config_Vulkan_functions) + - [Custom host memory allocator](@ref custom_memory_allocator) + - [Device memory allocation callbacks](@ref allocation_callbacks) + - [Device heap memory limit](@ref heap_memory_limit) + - \subpage vk_khr_dedicated_allocation +- \subpage general_considerations + - [Thread safety](@ref general_considerations_thread_safety) + - [Allocation algorithm](@ref general_considerations_allocation_algorithm) + - [Features not supported](@ref general_considerations_features_not_supported) + +\section main_see_also See also + +- [Product page on GPUOpen](https://gpuopen.com/gaming-product/vulkan-memory-allocator/) +- [Source repository on GitHub](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator) + + + + +\page quick_start Quick start + +\section quick_start_project_setup Project setup + +Vulkan Memory Allocator comes in form of a single header file. +You don't need to build it as a separate library project. +You can add this file directly to your project and submit it to code repository next to your other source files. + +"Single header" doesn't mean that everything is contained in C/C++ declarations, +like it tends to be in case of inline functions or C++ templates. +It means that implementation is bundled with interface in a single file and needs to be extracted using preprocessor macro. +If you don't do it properly, you will get linker errors. + +To do it properly: + +-# Include "vk_mem_alloc.h" file in each CPP file where you want to use the library. + This includes declarations of all members of the library. +-# In exacly one CPP file define following macro before this include. + It enables also internal definitions. + +\code +#define VMA_IMPLEMENTATION +#include "vk_mem_alloc.h" +\endcode + +It may be a good idea to create dedicated CPP file just for this purpose. + +\section quick_start_initialization Initialization -Members grouped: see Modules. +At program startup: -All members: see vk_mem_alloc.h. +-# Initialize Vulkan to have `VkPhysicalDevice` and `VkDevice` object. +-# Fill VmaAllocatorCreateInfo structure and create #VmaAllocator object by + calling vmaCreateAllocator(). -\section problem Problem Statement +\code +VmaAllocatorCreateInfo allocatorInfo = {}; +allocatorInfo.physicalDevice = physicalDevice; +allocatorInfo.device = device; -Memory allocation and resource (buffer and image) creation in Vulkan is -difficult (comparing to older graphics API-s, like D3D11 or OpenGL) for several -reasons: +VmaAllocator allocator; +vmaCreateAllocator(&allocatorInfo, &allocator); +\endcode -- It requires a lot of boilerplate code, just like everything else in Vulkan, - because it is a low-level and high-performance API. -- There is additional level of indirection: VkDeviceMemory is allocated - separately from creating VkBuffer/VkImage and they must be bound together. The - binding cannot be changed later - resource must be recreated. -- Driver must be queried for supported memory heaps and memory types. Different - IHV-s provide different types of it. -- Resources that don't fit in VRAM are not automatically evicted to RAM. - Developer must handle out-of-memory errors on his own. -- It is recommended practice to allocate bigger chunks of memory and assign - parts of them to particular resources. +\section quick_start_resource_allocation Resource allocation -\section features Features +When you want to create a buffer or image: -This library is helps game developers to manage memory allocations and resource -creation by offering some higher-level functions. Features of the library could -be divided into several layers, low level to high level: +-# Fill `VkBufferCreateInfo` / `VkImageCreateInfo` structure. +-# Fill VmaAllocationCreateInfo structure. +-# Call vmaCreateBuffer() / vmaCreateImage() to get `VkBuffer`/`VkImage` with memory + already allocated and bound to it. --# Functions that help to choose correct and optimal memory type based on - intended usage of the memory. - - Required or preferred traits of the memory are expressed using higher-level - description comparing to Vulkan flags. --# Functions that allocate memory blocks, reserve and return parts of them - (VkDeviceMemory + offset + size) to the user. - - Library keeps track of allocated memory blocks, used and unused ranges - inside them, finds best matching unused ranges for new allocations, takes - all the rules of alignment into consideration. --# Functions that can create an image/buffer, allocate memory for it and bind - them together - all in one call. +\code +VkBufferCreateInfo bufferInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; +bufferInfo.size = 65536; +bufferInfo.usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; -\section prequisites Prequisites +VmaAllocationCreateInfo allocInfo = {}; +allocInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY; + +VkBuffer buffer; +VmaAllocation allocation; +vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr); +\endcode + +Don't forget to destroy your objects when no longer needed: + +\code +vmaDestroyBuffer(allocator, buffer, allocation); +vmaDestroyAllocator(allocator); +\endcode + + +\page choosing_memory_type Choosing memory type + +Physical devices in Vulkan support various combinations of memory heaps and +types. Help with choosing correct and optimal memory type for your specific +resource is one of the key features of this library. You can use it by filling +appropriate members of VmaAllocationCreateInfo structure, as described below. +You can also combine multiple methods. + +-# If you just want to find memory type index that meets your requirements, you + can use function vmaFindMemoryTypeIndex(). +-# If you want to allocate a region of device memory without association with any + specific image or buffer, you can use function vmaAllocateMemory(). Usage of + this function is not recommended and usually not needed. +-# If you already have a buffer or an image created, you want to allocate memory + for it and then you will bind it yourself, you can use function + vmaAllocateMemoryForBuffer(), vmaAllocateMemoryForImage(). + For binding you should use functions: vmaBindBufferMemory(), vmaBindImageMemory(). +-# If you want to create a buffer or an image, allocate memory for it and bind + them together, all in one call, you can use function vmaCreateBuffer(), + vmaCreateImage(). This is the recommended way to use this library. -- Self-contained C++ library in single header file. No external dependencies - other than standard C and C++ library and of course Vulkan. -- Public interface in C, in same convention as Vulkan API. Implementation in - C++. -- Interface documented using Doxygen-style comments. -- Platform-independent, but developed and tested on Windows using Visual Studio. -- Error handling implemented by returning VkResult error codes - same way as in - Vulkan. +When using 3. or 4., the library internally queries Vulkan for memory types +supported for that buffer or image (function `vkGetBufferMemoryRequirements()`) +and uses only one of these types. + +If no memory type can be found that meets all the requirements, these functions +return `VK_ERROR_FEATURE_NOT_PRESENT`. + +You can leave VmaAllocationCreateInfo structure completely filled with zeros. +It means no requirements are specified for memory type. +It is valid, although not very useful. + +\section choosing_memory_type_usage Usage + +The easiest way to specify memory requirements is to fill member +VmaAllocationCreateInfo::usage using one of the values of enum #VmaMemoryUsage. +It defines high level, common usage types. +For more details, see description of this enum. + +For example, if you want to create a uniform buffer that will be filled using +transfer only once or infrequently and used for rendering every frame, you can +do it using following code: + +\code +VkBufferCreateInfo bufferInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; +bufferInfo.size = 65536; +bufferInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; + +VmaAllocationCreateInfo allocInfo = {}; +allocInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY; + +VkBuffer buffer; +VmaAllocation allocation; +vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr); +\endcode + +\section choosing_memory_type_required_preferred_flags Required and preferred flags + +You can specify more detailed requirements by filling members +VmaAllocationCreateInfo::requiredFlags and VmaAllocationCreateInfo::preferredFlags +with a combination of bits from enum `VkMemoryPropertyFlags`. For example, +if you want to create a buffer that will be persistently mapped on host (so it +must be `HOST_VISIBLE`) and preferably will also be `HOST_COHERENT` and `HOST_CACHED`, +use following code: + +\code +VmaAllocationCreateInfo allocInfo = {}; +allocInfo.requiredFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT; +allocInfo.preferredFlags = VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT; +allocInfo.flags = VMA_ALLOCATION_CREATE_MAPPED_BIT; + +VkBuffer buffer; +VmaAllocation allocation; +vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr); +\endcode + +A memory type is chosen that has all the required flags and as many preferred +flags set as possible. + +If you use VmaAllocationCreateInfo::usage, it is just internally converted to +a set of required and preferred flags. + +\section choosing_memory_type_explicit_memory_types Explicit memory types + +If you inspected memory types available on the physical device and you have +a preference for memory types that you want to use, you can fill member +VmaAllocationCreateInfo::memoryTypeBits. It is a bit mask, where each bit set +means that a memory type with that index is allowed to be used for the +allocation. Special value 0, just like `UINT32_MAX`, means there are no +restrictions to memory type index. + +Please note that this member is NOT just a memory type index. +Still you can use it to choose just one, specific memory type. +For example, if you already determined that your buffer should be created in +memory type 2, use following code: + +\code +uint32_t memoryTypeIndex = 2; + +VmaAllocationCreateInfo allocInfo = {}; +allocInfo.memoryTypeBits = 1u << memoryTypeIndex; + +VkBuffer buffer; +VmaAllocation allocation; +vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr); +\endcode + +\section choosing_memory_type_custom_memory_pools Custom memory pools + +If you allocate from custom memory pool, all the ways of specifying memory +requirements described above are not applicable and the aforementioned members +of VmaAllocationCreateInfo structure are ignored. Memory type is selected +explicitly when creating the pool and then used to make all the allocations from +that pool. For further details, see \ref custom_memory_pools. + + +\page memory_mapping Memory mapping + +To "map memory" in Vulkan means to obtain a CPU pointer to `VkDeviceMemory`, +to be able to read from it or write to it in CPU code. +Mapping is possible only of memory allocated from a memory type that has +`VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT` flag. +Functions `vkMapMemory()`, `vkUnmapMemory()` are designed for this purpose. +You can use them directly with memory allocated by this library, +but it is not recommended because of following issue: +Mapping the same `VkDeviceMemory` block multiple times is illegal - only one mapping at a time is allowed. +This includes mapping disjoint regions. Mapping is not reference-counted internally by Vulkan. +Because of this, Vulkan Memory Allocator provides following facilities: + +\section memory_mapping_mapping_functions Mapping functions -\section quick_start Quick Start +The library provides following functions for mapping of a specific #VmaAllocation: vmaMapMemory(), vmaUnmapMemory(). +They are safer and more convenient to use than standard Vulkan functions. +You can map an allocation multiple times simultaneously - mapping is reference-counted internally. +You can also map different allocations simultaneously regardless of whether they use the same `VkDeviceMemory` block. +They way it's implemented is that the library always maps entire memory block, not just region of the allocation. +For further details, see description of vmaMapMemory() function. +Example: -In your project code: +\code +// Having these objects initialized: + +struct ConstantBuffer +{ + ... +}; +ConstantBuffer constantBufferData; + +VmaAllocator allocator; +VmaBuffer constantBuffer; +VmaAllocation constantBufferAllocation; + +// You can map and fill your buffer using following code: + +void* mappedData; +vmaMapMemory(allocator, constantBufferAllocation, &mappedData); +memcpy(mappedData, &constantBufferData, sizeof(constantBufferData)); +vmaUnmapMemory(allocator, constantBufferAllocation); +\endcode + +\section memory_mapping_persistently_mapped_memory Persistently mapped memory + +Kepping your memory persistently mapped is generally OK in Vulkan. +You don't need to unmap it before using its data on the GPU. +The library provides a special feature designed for that: +Allocations made with #VMA_ALLOCATION_CREATE_MAPPED_BIT flag set in +VmaAllocationCreateInfo::flags stay mapped all the time, +so you can just access CPU pointer to it any time +without a need to call any "map" or "unmap" function. +Example: + +\code +VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; +bufCreateInfo.size = sizeof(ConstantBuffer); +bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + +VmaAllocationCreateInfo allocCreateInfo = {}; +allocCreateInfo.usage = VMA_MEMORY_USAGE_CPU_ONLY; +allocCreateInfo.flags = VMA_ALLOCATION_CREATE_MAPPED_BIT; + +VkBuffer buf; +VmaAllocation alloc; +VmaAllocationInfo allocInfo; +vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo); + +// Buffer is already mapped. You can access its memory. +memcpy(allocInfo.pMappedData, &constantBufferData, sizeof(constantBufferData)); +\endcode + +There are some exceptions though, when you should consider mapping memory only for a short period of time: + +- When operating system is Windows 7 or 8.x (Windows 10 is not affected because it uses WDDM2), + device is discrete AMD GPU, + and memory type is the special 256 MiB pool of `DEVICE_LOCAL + HOST_VISIBLE` memory + (selected when you use #VMA_MEMORY_USAGE_CPU_TO_GPU), + then whenever a memory block allocated from this memory type stays mapped + for the time of any call to `vkQueueSubmit()` or `vkQueuePresentKHR()`, this + block is migrated by WDDM to system RAM, which degrades performance. It doesn't + matter if that particular memory block is actually used by the command buffer + being submitted. +- Keeping many large memory blocks mapped may impact performance or stability of some debugging tools. + +\section memory_mapping_cache_control Cache control + +Memory in Vulkan doesn't need to be unmapped before using it on GPU, +but unless a memory types has `VK_MEMORY_PROPERTY_HOST_COHERENT_BIT` flag set, +you need to manually invalidate cache before reading of mapped pointer +using function `vkvkInvalidateMappedMemoryRanges()` +and flush cache after writing to mapped pointer +using function `vkFlushMappedMemoryRanges()`. +Example: + +\code +memcpy(allocInfo.pMappedData, &constantBufferData, sizeof(constantBufferData)); + +VkMemoryPropertyFlags memFlags; +vmaGetMemoryTypeProperties(allocator, allocInfo.memoryType, &memFlags); +if((memFlags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) == 0) +{ + VkMappedMemoryRange memRange = { VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE }; + memRange.memory = allocInfo.deviceMemory; + memRange.offset = allocInfo.offset; + memRange.size = allocInfo.size; + vkFlushMappedMemoryRanges(device, 1, &memRange); +} +\endcode --# Include "vk_mem_alloc.h" file wherever you want to use the library. --# In exacly one C++ file define following macro before include to build library - implementation. +Please note that memory allocated with #VMA_MEMORY_USAGE_CPU_ONLY is guaranteed to be host coherent. +Also, Windows drivers from all 3 PC GPU vendors (AMD, Intel, NVIDIA) +currently provide `VK_MEMORY_PROPERTY_HOST_COHERENT_BIT` flag on all memory types that are +`VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT`, so on this platform you may not need to bother. - #define VMA_IMPLEMENTATION - #include "vk_mem_alloc.h" +\section memory_mapping_finding_if_memory_mappable Finding out if memory is mappable -At program startup: +It may happen that your allocation ends up in memory that is `HOST_VISIBLE` (available for mapping) +despite it wasn't explicitly requested. +For example, application may work on integrated graphics with unified memory (like Intel) or +allocation from video memory might have failed, so the library chose system memory as fallback. --# Initialize Vulkan to have VkPhysicalDevice and VkDevice object. --# Fill VmaAllocatorCreateInfo structure and create VmaAllocator object by - calling vmaCreateAllocator(). +You can detect this case and map such allocation to access its memory on CPU directly, +instead of launching a transfer operation. +In order to do that: inspect `allocInfo.memoryType`, call vmaGetMemoryTypeProperties(), +and look for `VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT` flag in properties of that memory type. +\code +VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; +bufCreateInfo.size = sizeof(ConstantBuffer); +bufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; - VmaAllocatorCreateInfo allocatorInfo = {}; - allocatorInfo.physicalDevice = physicalDevice; - allocatorInfo.device = device; +VmaAllocationCreateInfo allocCreateInfo = {}; +allocCreateInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY; +allocCreateInfo.preferredFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT; - VmaAllocator allocator; - vmaCreateAllocator(&allocatorInfo, &allocator); +VkBuffer buf; +VmaAllocation alloc; +VmaAllocationInfo allocInfo; +vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo); -When you want to create a buffer or image: +VkMemoryPropertyFlags memFlags; +vmaGetMemoryTypeProperties(allocator, allocInfo.memoryType, &memFlags); +if((memFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0) +{ + // Allocation ended up in mappable memory. You can map it and access it directly. + void* mappedData; + vmaMapMemory(allocator, alloc, &mappedData); + memcpy(mappedData, &constantBufferData, sizeof(constantBufferData)); + vmaUnmapMemory(allocator, alloc); +} +else +{ + // Allocation ended up in non-mappable memory. + // You need to create CPU-side buffer in VMA_MEMORY_USAGE_CPU_ONLY and make a transfer. +} +\endcode --# Fill VkBufferCreateInfo / VkImageCreateInfo structure. --# Fill VmaMemoryRequirements structure. --# Call vmaCreateBuffer() / vmaCreateImage() to get VkBuffer/VkImage with memory - already allocated and bound to it. +You can even use #VMA_ALLOCATION_CREATE_MAPPED_BIT flag while creating allocations +that are not necessarily `HOST_VISIBLE` (e.g. using #VMA_MEMORY_USAGE_GPU_ONLY). +If the allocation ends up in memory type that is `HOST_VISIBLE`, it will be persistently mapped and you can use it directly. +If not, the flag is just ignored. +Example: + +\code +VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; +bufCreateInfo.size = sizeof(ConstantBuffer); +bufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; + +VmaAllocationCreateInfo allocCreateInfo = {}; +allocCreateInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY; +allocCreateInfo.flags = VMA_ALLOCATION_CREATE_MAPPED_BIT; + +VkBuffer buf; +VmaAllocation alloc; +VmaAllocationInfo allocInfo; +vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo); + +if(allocInfo.pUserData != nullptr) +{ + // Allocation ended up in mappable memory. + // It's persistently mapped. You can access it directly. + memcpy(allocInfo.pMappedData, &constantBufferData, sizeof(constantBufferData)); +} +else +{ + // Allocation ended up in non-mappable memory. + // You need to create CPU-side buffer in VMA_MEMORY_USAGE_CPU_ONLY and make a transfer. +} +\endcode + + +\page custom_memory_pools Custom memory pools + +A memory pool contains a number of `VkDeviceMemory` blocks. +The library automatically creates and manages default pool for each memory type available on the device. +Default memory pool automatically grows in size. +Size of allocated blocks is also variable and managed automatically. + +You can create custom pool and allocate memory out of it. +It can be useful if you want to: + +- Keep certain kind of allocations separate from others. +- Enforce particular, fixed size of Vulkan memory blocks. +- Limit maximum amount of Vulkan memory allocated for that pool. +- Reserve minimum or fixed amount of Vulkan memory always preallocated for that pool. + +To use custom memory pools: + +-# Fill VmaPoolCreateInfo structure. +-# Call vmaCreatePool() to obtain #VmaPool handle. +-# When making an allocation, set VmaAllocationCreateInfo::pool to this handle. + You don't need to specify any other parameters of this structure, like usage. + +Example: + +\code +// Create a pool that can have at most 2 blocks, 128 MiB each. +VmaPoolCreateInfo poolCreateInfo = {}; +poolCreateInfo.memoryTypeIndex = ... +poolCreateInfo.blockSize = 128ull * 1024 * 1024; +poolCreateInfo.maxBlockCount = 2; + +VmaPool pool; +vmaCreatePool(allocator, &poolCreateInfo, &pool); + +// Allocate a buffer out of it. +VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; +bufCreateInfo.size = 1024; +bufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; + +VmaAllocationCreateInfo allocCreateInfo = {}; +allocCreateInfo.pool = pool; + +VkBuffer buf; +VmaAllocation alloc; +VmaAllocationInfo allocInfo; +vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo); +\endcode + +You have to free all allocations made from this pool before destroying it. + +\code +vmaDestroyBuffer(allocator, buf, alloc); +vmaDestroyPool(allocator, pool); +\endcode + +\section custom_memory_pools_MemTypeIndex Choosing memory type index + +When creating a pool, you must explicitly specify memory type index. +To find the one suitable for your buffers or images, you can use helper functions +vmaFindMemoryTypeIndexForBufferInfo(), vmaFindMemoryTypeIndexForImageInfo(). +You need to provide structures with example parameters of buffers or images +that you are going to create in that pool. + +\code +VkBufferCreateInfo exampleBufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; +exampleBufCreateInfo.size = 1024; // Whatever. +exampleBufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; // Change if needed. + +VmaAllocationCreateInfo allocCreateInfo = {}; +allocCreateInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY; // Change if needed. + +uint32_t memTypeIndex; +vmaFindMemoryTypeIndexForBufferInfo(allocator, &exampleBufCreateInfo, &allocCreateInfo, &memTypeIndex); + +VmaPoolCreateInfo poolCreateInfo = {}; +poolCreateInfo.memoryTypeIndex = memTypeIndex; +// ... +\endcode + +When creating buffers/images allocated in that pool, provide following parameters: + +- `VkBufferCreateInfo`: Prefer to pass same parameters as above. + Otherwise you risk creating resources in a memory type that is not suitable for them, which may result in undefined behavior. + Using different `VK_BUFFER_USAGE_` flags may work, but you shouldn't create images in a pool intended for buffers + or the other way around. +- VmaAllocationCreateInfo: You don't need to pass same parameters. Fill only `pool` member. + Other members are ignored anyway. + + +\page defragmentation Defragmentation + +Interleaved allocations and deallocations of many objects of varying size can +cause fragmentation, which can lead to a situation where the library is unable +to find a continuous range of free memory for a new allocation despite there is +enough free space, just scattered across many small free ranges between existing +allocations. + +To mitigate this problem, you can use vmaDefragment(). Given set of allocations, +this function can move them to compact used memory, ensure more continuous free +space and possibly also free some `VkDeviceMemory`. It can work only on +allocations made from memory type that is `HOST_VISIBLE`. Allocations are +modified to point to the new `VkDeviceMemory` and offset. Data in this memory is +also `memmove`-ed to the new place. However, if you have images or buffers bound +to these allocations (and you certainly do), you need to destroy, recreate, and +bind them to the new place in memory. + +For further details and example code, see documentation of function +vmaDefragment(). + +\page lost_allocations Lost allocations + +If your game oversubscribes video memory, if may work OK in previous-generation +graphics APIs (DirectX 9, 10, 11, OpenGL) because resources are automatically +paged to system RAM. In Vulkan you can't do it because when you run out of +memory, an allocation just fails. If you have more data (e.g. textures) that can +fit into VRAM and you don't need it all at once, you may want to upload them to +GPU on demand and "push out" ones that are not used for a long time to make room +for the new ones, effectively using VRAM (or a cartain memory pool) as a form of +cache. Vulkan Memory Allocator can help you with that by supporting a concept of +"lost allocations". + +To create an allocation that can become lost, include #VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT +flag in VmaAllocationCreateInfo::flags. Before using a buffer or image bound to +such allocation in every new frame, you need to query it if it's not lost. +To check it, call vmaTouchAllocation(). +If the allocation is lost, you should not use it or buffer/image bound to it. +You mustn't forget to destroy this allocation and this buffer/image. +vmaGetAllocationInfo() can also be used for checking status of the allocation. +Allocation is lost when returned VmaAllocationInfo::deviceMemory == `VK_NULL_HANDLE`. + +To create an allocation that can make some other allocations lost to make room +for it, use #VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT flag. You will +usually use both flags #VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT and +#VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT at the same time. + +Warning! Current implementation uses quite naive, brute force algorithm, +which can make allocation calls that use #VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT +flag quite slow. A new, more optimal algorithm and data structure to speed this +up is planned for the future. + +Q: When interleaving creation of new allocations with usage of existing ones, +how do you make sure that an allocation won't become lost while it's used in the +current frame? + +It is ensured because vmaTouchAllocation() / vmaGetAllocationInfo() not only returns allocation +status/parameters and checks whether it's not lost, but when it's not, it also +atomically marks it as used in the current frame, which makes it impossible to +become lost in that frame. It uses lockless algorithm, so it works fast and +doesn't involve locking any internal mutex. + +Q: What if my allocation may still be in use by the GPU when it's rendering a +previous frame while I already submit new frame on the CPU? + +You can make sure that allocations "touched" by vmaTouchAllocation() / vmaGetAllocationInfo() will not +become lost for a number of additional frames back from the current one by +specifying this number as VmaAllocatorCreateInfo::frameInUseCount (for default +memory pool) and VmaPoolCreateInfo::frameInUseCount (for custom pool). + +Q: How do you inform the library when new frame starts? + +You need to call function vmaSetCurrentFrameIndex(). + +Example code: + +\code +struct MyBuffer +{ + VkBuffer m_Buf = nullptr; + VmaAllocation m_Alloc = nullptr; + + // Called when the buffer is really needed in the current frame. + void EnsureBuffer(); +}; + +void MyBuffer::EnsureBuffer() +{ + // Buffer has been created. + if(m_Buf != VK_NULL_HANDLE) + { + // Check if its allocation is not lost + mark it as used in current frame. + if(vmaTouchAllocation(allocator, m_Alloc)) + { + // It's all OK - safe to use m_Buf. + return; + } + } + + // Buffer not yet exists or lost - destroy and recreate it. + + vmaDestroyBuffer(allocator, m_Buf, m_Alloc); + + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.size = 1024; + bufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY; + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT | + VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT; + + vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &m_Buf, &m_Alloc, nullptr); +} +\endcode + +When using lost allocations, you may see some Vulkan validation layer warnings +about overlapping regions of memory bound to different kinds of buffers and +images. This is still valid as long as you implement proper handling of lost +allocations (like in the example above) and don't use them. + +You can create an allocation that is already in lost state from the beginning using function +vmaCreateLostAllocation(). It may be useful if you need a "dummy" allocation that is not null. + +You can call function vmaMakePoolAllocationsLost() to set all eligible allocations +in a specified custom pool to lost state. +Allocations that have been "touched" in current frame or VmaPoolCreateInfo::frameInUseCount frames back +cannot become lost. + + +\page statistics Statistics + +This library contains functions that return information about its internal state, +especially the amount of memory allocated from Vulkan. +Please keep in mind that these functions need to traverse all internal data structures +to gather these information, so they may be quite time-consuming. +Don't call them too often. + +\section statistics_numeric_statistics Numeric statistics + +You can query for overall statistics of the allocator using function vmaCalculateStats(). +Information are returned using structure #VmaStats. +It contains #VmaStatInfo - number of allocated blocks, number of allocations +(occupied ranges in these blocks), number of unused (free) ranges in these blocks, +number of bytes used and unused (but still allocated from Vulkan) and other information. +They are summed across memory heaps, memory types and total for whole allocator. + +You can query for statistics of a custom pool using function vmaGetPoolStats(). +Information are returned using structure #VmaPoolStats. + +You can query for information about specific allocation using function vmaGetAllocationInfo(). +It fill structure #VmaAllocationInfo. + +\section statistics_json_dump JSON dump + +You can dump internal state of the allocator to a string in JSON format using function vmaBuildStatsString(). +The result is guaranteed to be correct JSON. +It uses ANSI encoding. +Any strings provided by user (see [Allocation names](@ref allocation_names)) +are copied as-is and properly escaped for JSON, so if they use UTF-8, ISO-8859-2 or any other encoding, +this JSON string can be treated as using this encoding. +It must be freed using function vmaFreeStatsString(). + +The format of this JSON string is not part of official documentation of the library, +but it will not change in backward-incompatible way without increasing library major version number +and appropriate mention in changelog. + +The JSON string contains all the data that can be obtained using vmaCalculateStats(). +It can also contain detailed map of allocated memory blocks and their regions - +free and occupied by allocations. +This allows e.g. to visualize the memory or assess fragmentation. + + +\page allocation_annotation Allocation names and user data + +\section allocation_user_data Allocation user data + +You can annotate allocations with your own information, e.g. for debugging purposes. +To do that, fill VmaAllocationCreateInfo::pUserData field when creating +an allocation. It's an opaque `void*` pointer. You can use it e.g. as a pointer, +some handle, index, key, ordinal number or any other value that would associate +the allocation with your custom metadata. + +\code +VkBufferCreateInfo bufferInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; +// Fill bufferInfo... + +MyBufferMetadata* pMetadata = CreateBufferMetadata(); + +VmaAllocationCreateInfo allocCreateInfo = {}; +allocCreateInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY; +allocCreateInfo.pUserData = pMetadata; + +VkBuffer buffer; +VmaAllocation allocation; +vmaCreateBuffer(allocator, &bufferInfo, &allocCreateInfo, &buffer, &allocation, nullptr); +\endcode + +The pointer may be later retrieved as VmaAllocationInfo::pUserData: + +\code +VmaAllocationInfo allocInfo; +vmaGetAllocationInfo(allocator, allocation, &allocInfo); +MyBufferMetadata* pMetadata = (MyBufferMetadata*)allocInfo.pUserData; +\endcode + +It can also be changed using function vmaSetAllocationUserData(). + +Values of (non-zero) allocations' `pUserData` are printed in JSON report created by +vmaBuildStatsString(), in hexadecimal form. + +\section allocation_names Allocation names + +There is alternative mode available where `pUserData` pointer is used to point to +a null-terminated string, giving a name to the allocation. To use this mode, +set #VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT flag in VmaAllocationCreateInfo::flags. +Then `pUserData` passed as VmaAllocationCreateInfo::pUserData or argument to +vmaSetAllocationUserData() must be either null or pointer to a null-terminated string. +The library creates internal copy of the string, so the pointer you pass doesn't need +to be valid for whole lifetime of the allocation. You can free it after the call. + +\code +VkImageCreateInfo imageInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; +// Fill imageInfo... + +std::string imageName = "Texture: "; +imageName += fileName; + +VmaAllocationCreateInfo allocCreateInfo = {}; +allocCreateInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY; +allocCreateInfo.flags = VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT; +allocCreateInfo.pUserData = imageName.c_str(); + +VkImage image; +VmaAllocation allocation; +vmaCreateImage(allocator, &imageInfo, &allocCreateInfo, &image, &allocation, nullptr); +\endcode + +The value of `pUserData` pointer of the allocation will be different than the one +you passed when setting allocation's name - pointing to a buffer managed +internally that holds copy of the string. + +\code +VmaAllocationInfo allocInfo; +vmaGetAllocationInfo(allocator, allocation, &allocInfo); +const char* imageName = (const char*)allocInfo.pUserData; +printf("Image name: %s\n", imageName); +\endcode + +That string is also printed in JSON report created by vmaBuildStatsString(). + + +\page usage_patterns Recommended usage patterns + +See also slides from talk: +[Sawicki, Adam. Advanced Graphics Techniques Tutorial: Memory management in Vulkan and DX12. Game Developers Conference, 2018](https://www.gdcvault.com/play/1025458/Advanced-Graphics-Techniques-Tutorial-New) + + +\section usage_patterns_simple Simple patterns + +\subsection usage_patterns_simple_render_targets Render targets + +When: +Any resources that you frequently write and read on GPU, +e.g. images used as color attachments (aka "render targets"), depth-stencil attachments, +images/buffers used as storage image/buffer (aka "Unordered Access View (UAV)"). + +What to do: +Create them in video memory that is fastest to access from GPU using +#VMA_MEMORY_USAGE_GPU_ONLY. + +Consider using [VK_KHR_dedicated_allocation](@ref vk_khr_dedicated_allocation) extension +and/or manually creating them as dedicated allocations using #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT, +especially if they are large or if you plan to destroy and recreate them e.g. when +display resolution changes. +Prefer to create such resources first and all other GPU resources (like textures and vertex buffers) later. + +\subsection usage_patterns_simple_immutable_resources Immutable resources + +When: +Any resources that you fill on CPU only once (aka "immutable") or infrequently +and then read frequently on GPU, +e.g. textures, vertex and index buffers, constant buffers that don't change often. + +What to do: +Create them in video memory that is fastest to access from GPU using +#VMA_MEMORY_USAGE_GPU_ONLY. + +To initialize content of such resource, create a CPU-side (aka "staging") copy of it +in system memory - #VMA_MEMORY_USAGE_CPU_ONLY, map it, fill it, +and submit a transfer from it to the GPU resource. +You can keep the staging copy if you need it for another upload transfer in the future. +If you don't, you can destroy it or reuse this buffer for uploading different resource +after the transfer finishes. + +Prefer to create just buffers in system memory rather than images, even for uploading textures. +Use `vkCmdCopyBufferToImage()`. +Dont use images with `VK_IMAGE_TILING_LINEAR`. + +\subsection usage_patterns_dynamic_resources Dynamic resources + +When: +Any resources that change frequently (aka "dynamic"), e.g. every frame or every draw call, +written on CPU, read on GPU. + +What to do: +Create them using #VMA_MEMORY_USAGE_CPU_TO_GPU. +You can map it and write to it directly on CPU, as well as read from it on GPU. + +This is a more complex situation. Different solutions are possible, +and the best one depends on specific GPU type, but you can use this simple approach for the start. +Prefer to write to such resource sequentially (e.g. using `memcpy`). +Don't perform random access or any reads from it, as it may be very slow. + +\subsection usage_patterns_readback Readback + +When: +Resources that contain data written by GPU that you want to read back on CPU, +e.g. results of some computations. + +What to do: +Create them using #VMA_MEMORY_USAGE_GPU_TO_CPU. +You can write to them directly on GPU, as well as map and read them on CPU. + +\section usage_patterns_advanced Advanced patterns + +\subsection usage_patterns_integrated_graphics Detecting integrated graphics + +You can support integrated graphics (like Intel HD Graphics, AMD APU) better +by detecting it in Vulkan. +To do it, call `vkGetPhysicalDeviceProperties()`, inspect +`VkPhysicalDeviceProperties::deviceType` and look for `VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU`. +When you find it, you can assume that memory is unified and all memory types are equally fast +to access from GPU, regardless of `VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT`. + +You can then sum up sizes of all available memory heaps and treat them as useful for +your GPU resources, instead of only `DEVICE_LOCAL` ones. +You can also prefer to create your resources in memory types that are `HOST_VISIBLE` to map them +directly instead of submitting explicit transfer (see below). + +\subsection usage_patterns_direct_vs_transfer Direct access versus transfer + +For resources that you frequently write on CPU and read on GPU, many solutions are possible: + +-# Create one copy in video memory using #VMA_MEMORY_USAGE_GPU_ONLY, + second copy in system memory using #VMA_MEMORY_USAGE_CPU_ONLY and submit explicit tranfer each time. +-# Create just single copy using #VMA_MEMORY_USAGE_CPU_TO_GPU, map it and fill it on CPU, + read it directly on GPU. +-# Create just single copy using #VMA_MEMORY_USAGE_CPU_ONLY, map it and fill it on CPU, + read it directly on GPU. + +Which solution is the most efficient depends on your resource and especially on the GPU. +It is best to measure it and then make the decision. +Some general recommendations: + +- On integrated graphics use (2) or (3) to avoid unnecesary time and memory overhead + related to using a second copy. +- For small resources (e.g. constant buffers) use (2). + Discrete AMD cards have special 256 MiB pool of video memory that is directly mappable. + Even if the resource ends up in system memory, its data may be cached on GPU after first + fetch over PCIe bus. +- For larger resources (e.g. textures), decide between (1) and (2). + You may want to differentiate NVIDIA and AMD, e.g. by looking for memory type that is + both `DEVICE_LOCAL` and `HOST_VISIBLE`. When you find it, use (2), otherwise use (1). + +Similarly, for resources that you frequently write on GPU and read on CPU, multiple +solutions are possible: + +-# Create one copy in video memory using #VMA_MEMORY_USAGE_GPU_ONLY, + second copy in system memory using #VMA_MEMORY_USAGE_GPU_TO_CPU and submit explicit tranfer each time. +-# Create just single copy using #VMA_MEMORY_USAGE_GPU_TO_CPU, write to it directly on GPU, + map it and read it on CPU. + +You should take some measurements to decide which option is faster in case of your specific +resource. + +If you don't want to specialize your code for specific types of GPUs, you can still make +an simple optimization for cases when your resource ends up in mappable memory to use it +directly in this case instead of creating CPU-side staging copy. +For details see [Finding out if memory is mappable](@ref memory_mapping_finding_if_memory_mappable). + + +\page configuration Configuration + +Please check "CONFIGURATION SECTION" in the code to find macros that you can define +before each include of this file or change directly in this file to provide +your own implementation of basic facilities like assert, `min()` and `max()` functions, +mutex, atomic etc. +The library uses its own implementation of containers by default, but you can switch to using +STL containers instead. +\section config_Vulkan_functions Pointers to Vulkan functions - VkBufferCreateInfo bufferInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; - bufferInfo.size = myBufferSize; - bufferInfo.usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; +The library uses Vulkan functions straight from the `vulkan.h` header by default. +If you want to provide your own pointers to these functions, e.g. fetched using +`vkGetInstanceProcAddr()` and `vkGetDeviceProcAddr()`: - VmaMemoryRequirements memReq = {}; - memReq.usage = VMA_MEMORY_USAGE_GPU_ONLY; +-# Define `VMA_STATIC_VULKAN_FUNCTIONS 0`. +-# Provide valid pointers through VmaAllocatorCreateInfo::pVulkanFunctions. - VkBuffer buffer; - vmaCreateBuffer(allocator, &bufferInfo, &memReq, &buffer, nullptr, nullptr); +\section custom_memory_allocator Custom host memory allocator -When no longer needed, destroy your buffer or image using vmaDestroyBuffer() / vmaDestroyImage(). -This function would also free memory bound to it. +If you use custom allocator for CPU memory rather than default operator `new` +and `delete` from C++, you can make this library using your allocator as well +by filling optional member VmaAllocatorCreateInfo::pAllocationCallbacks. These +functions will be passed to Vulkan, as well as used by the library itself to +make any CPU-side allocations. +\section allocation_callbacks Device memory allocation callbacks - vmaDestroyBuffer(allocator, buffer); +The library makes calls to `vkAllocateMemory()` and `vkFreeMemory()` internally. +You can setup callbacks to be informed about these calls, e.g. for the purpose +of gathering some statistics. To do it, fill optional member +VmaAllocatorCreateInfo::pDeviceMemoryCallbacks. -\section configuration Configuration +\section heap_memory_limit Device heap memory limit -Set VMA_STATS_STRING_ENABLED macro in vk_mem_alloc.h to 0 or 1 to disable/enable -compilation of code for dumping internal allocator state to string in JSON -format. +If you want to test how your program behaves with limited amount of Vulkan device +memory available without switching your graphics card to one that really has +smaller VRAM, you can use a feature of this library intended for this purpose. +To do it, fill optional member VmaAllocatorCreateInfo::pHeapSizeLimit. -Please check "CONFIGURATION" section in vk_mem_alloc.cpp file to find macros and -other definitions that you can change to connect the library to your own -implementation of basic facilities like assert, min and max functions, mutex -etc. C++ STL is used by default, but changing these allows you to get rid of any -STL usage if you want, as many game developers tend to do. -\section custom_memory_allocator Custom memory allocator -You can use custom memory allocator by filling optional member -VmaAllocatorCreateInfo::pAllocationCallbacks. These functions will be passed to -Vulkan, as well as used by the library itself to make any CPU-side allocations. +\page vk_khr_dedicated_allocation VK_KHR_dedicated_allocation -\section thread_safety Thread safety +VK_KHR_dedicated_allocation is a Vulkan extension which can be used to improve +performance on some GPUs. It augments Vulkan API with possibility to query +driver whether it prefers particular buffer or image to have its own, dedicated +allocation (separate `VkDeviceMemory` block) for better efficiency - to be able +to do some internal optimizations. + +The extension is supported by this library. It will be used automatically when +enabled. To enable it: + +1 . When creating Vulkan device, check if following 2 device extensions are +supported (call `vkEnumerateDeviceExtensionProperties()`). +If yes, enable them (fill `VkDeviceCreateInfo::ppEnabledExtensionNames`). + +- VK_KHR_get_memory_requirements2 +- VK_KHR_dedicated_allocation + +If you enabled these extensions: + +2 . Use #VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT flag when creating +your #VmaAllocator`to inform the library that you enabled required extensions +and you want the library to use them. + +\code +allocatorInfo.flags |= VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT; + +vmaCreateAllocator(&allocatorInfo, &allocator); +\endcode + +That's all. The extension will be automatically used whenever you create a +buffer using vmaCreateBuffer() or image using vmaCreateImage(). + +When using the extension together with Vulkan Validation Layer, you will receive +warnings like this: + + vkBindBufferMemory(): Binding memory to buffer 0x33 but vkGetBufferMemoryRequirements() has not been called on that buffer. + +It is OK, you should just ignore it. It happens because you use function +`vkGetBufferMemoryRequirements2KHR()` instead of standard +`vkGetBufferMemoryRequirements()`, while the validation layer seems to be +unaware of it. + +To learn more about this extension, see: + +- [VK_KHR_dedicated_allocation in Vulkan specification](https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VK_KHR_dedicated_allocation) +- [VK_KHR_dedicated_allocation unofficial manual](http://asawicki.info/articles/VK_KHR_dedicated_allocation.php5) + + + +\page general_considerations General considerations + +\section general_considerations_thread_safety Thread safety + +- The library has no global state, so separate #VmaAllocator objects can be used + independently. + There should be no need to create multiple such objects though - one per `VkDevice` is enough. +- By default, all calls to functions that take #VmaAllocator as first parameter + are safe to call from multiple threads simultaneously because they are + synchronized internally when needed. +- When the allocator is created with #VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT + flag, calls to functions that take such #VmaAllocator object must be + synchronized externally. +- Access to a #VmaAllocation object must be externally synchronized. For example, + you must not call vmaGetAllocationInfo() and vmaMapMemory() from different + threads at the same time if you pass the same #VmaAllocation object to these + functions. + +\section general_considerations_allocation_algorithm Allocation algorithm + +The library uses following algorithm for allocation, in order: + +-# Try to find free range of memory in existing blocks. +-# If failed, try to create a new block of `VkDeviceMemory`, with preferred block size. +-# If failed, try to create such block with size/2, size/4, size/8. +-# If failed and #VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT flag was + specified, try to find space in existing blocks, possilby making some other + allocations lost. +-# If failed, try to allocate separate `VkDeviceMemory` for this allocation, + just like when you use #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT. +-# If failed, choose other memory type that meets the requirements specified in + VmaAllocationCreateInfo and go to point 1. +-# If failed, return `VK_ERROR_OUT_OF_DEVICE_MEMORY`. + +\section general_considerations_features_not_supported Features not supported + +Features deliberately excluded from the scope of this library: + +- Data transfer - issuing commands that transfer data between buffers or images, any usage of + `VkCommandList` or `VkCommandQueue` and related synchronization is responsibility of the user. +- Allocations for imported/exported external memory. They tend to require + explicit memory type index and dedicated allocation anyway, so they don't + interact with main features of this library. Such special purpose allocations + should be made manually, using `vkCreateBuffer()` and `vkAllocateMemory()`. +- Support for any programming languages other than C/C++. + Bindings to other languages are welcomed as external projects. -All calls to functions that take VmaAllocator as first parameter are safe to -call from multiple threads simultaneously, synchronized internally when needed. */ #include -//////////////////////////////////////////////////////////////////////////////// -/** \defgroup general General -@{ -*/ +#if !defined(VMA_DEDICATED_ALLOCATION) + #if VK_KHR_get_memory_requirements2 && VK_KHR_dedicated_allocation + #define VMA_DEDICATED_ALLOCATION 1 + #else + #define VMA_DEDICATED_ALLOCATION 0 + #endif +#endif + +/** \struct VmaAllocator +\brief Represents main object of this library initialized. +Fill structure VmaAllocatorCreateInfo and call function vmaCreateAllocator() to create it. +Call function vmaDestroyAllocator() to destroy it. + +It is recommended to create just one object of this type per `VkDevice` object, +right after Vulkan is initialized and keep it alive until before Vulkan device is destroyed. +*/ VK_DEFINE_HANDLE(VmaAllocator) +/// Callback function called after successful vkAllocateMemory. +typedef void (VKAPI_PTR *PFN_vmaAllocateDeviceMemoryFunction)( + VmaAllocator allocator, + uint32_t memoryType, + VkDeviceMemory memory, + VkDeviceSize size); +/// Callback function called before vkFreeMemory. +typedef void (VKAPI_PTR *PFN_vmaFreeDeviceMemoryFunction)( + VmaAllocator allocator, + uint32_t memoryType, + VkDeviceMemory memory, + VkDeviceSize size); + +/** \brief Set of callbacks that the library will call for `vkAllocateMemory` and `vkFreeMemory`. + +Provided for informative purpose, e.g. to gather statistics about number of +allocations or total amount of memory allocated in Vulkan. + +Used in VmaAllocatorCreateInfo::pDeviceMemoryCallbacks. +*/ +typedef struct VmaDeviceMemoryCallbacks { + /// Optional, can be null. + PFN_vmaAllocateDeviceMemoryFunction pfnAllocate; + /// Optional, can be null. + PFN_vmaFreeDeviceMemoryFunction pfnFree; +} VmaDeviceMemoryCallbacks; + +/// Flags for created #VmaAllocator. +typedef enum VmaAllocatorCreateFlagBits { + /** \brief Allocator and all objects created from it will not be synchronized internally, so you must guarantee they are used from only one thread at a time or synchronized externally by you. + + Using this flag may increase performance because internal mutexes are not used. + */ + VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT = 0x00000001, + /** \brief Enables usage of VK_KHR_dedicated_allocation extension. + + Using this extenion will automatically allocate dedicated blocks of memory for + some buffers and images instead of suballocating place for them out of bigger + memory blocks (as if you explicitly used #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT + flag) when it is recommended by the driver. It may improve performance on some + GPUs. + + You may set this flag only if you found out that following device extensions are + supported, you enabled them while creating Vulkan device passed as + VmaAllocatorCreateInfo::device, and you want them to be used internally by this + library: + + - VK_KHR_get_memory_requirements2 + - VK_KHR_dedicated_allocation + +When this flag is set, you can experience following warnings reported by Vulkan +validation layer. You can ignore them. + +> vkBindBufferMemory(): Binding memory to buffer 0x2d but vkGetBufferMemoryRequirements() has not been called on that buffer. + */ + VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT = 0x00000002, + + VMA_ALLOCATOR_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VmaAllocatorCreateFlagBits; +typedef VkFlags VmaAllocatorCreateFlags; + +/** \brief Pointers to some Vulkan functions - a subset used by the library. + +Used in VmaAllocatorCreateInfo::pVulkanFunctions. +*/ +typedef struct VmaVulkanFunctions { + PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties; + PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties; + PFN_vkAllocateMemory vkAllocateMemory; + PFN_vkFreeMemory vkFreeMemory; + PFN_vkMapMemory vkMapMemory; + PFN_vkUnmapMemory vkUnmapMemory; + PFN_vkBindBufferMemory vkBindBufferMemory; + PFN_vkBindImageMemory vkBindImageMemory; + PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements; + PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements; + PFN_vkCreateBuffer vkCreateBuffer; + PFN_vkDestroyBuffer vkDestroyBuffer; + PFN_vkCreateImage vkCreateImage; + PFN_vkDestroyImage vkDestroyImage; +#if VMA_DEDICATED_ALLOCATION + PFN_vkGetBufferMemoryRequirements2KHR vkGetBufferMemoryRequirements2KHR; + PFN_vkGetImageMemoryRequirements2KHR vkGetImageMemoryRequirements2KHR; +#endif +} VmaVulkanFunctions; + /// Description of a Allocator to be created. typedef struct VmaAllocatorCreateInfo { + /// Flags for created allocator. Use #VmaAllocatorCreateFlagBits enum. + VmaAllocatorCreateFlags flags; /// Vulkan physical device. - /** It must be valid throughout whole lifetime of created Allocator. */ + /** It must be valid throughout whole lifetime of created allocator. */ VkPhysicalDevice physicalDevice; /// Vulkan device. - /** It must be valid throughout whole lifetime of created Allocator. */ + /** It must be valid throughout whole lifetime of created allocator. */ VkDevice device; - /// Size of a single memory block to allocate for resources. - /** Set to 0 to use default, which is currently 256 MB. */ + /// Preferred size of a single `VkDeviceMemory` block to be allocated from large heaps > 1 GiB. Optional. + /** Set to 0 to use default, which is currently 256 MiB. */ VkDeviceSize preferredLargeHeapBlockSize; - /// Size of a single memory block to allocate for resources from a small heap <= 512 MB. - /** Set to 0 to use default, which is currently 64 MB. */ - VkDeviceSize preferredSmallHeapBlockSize; - /// Custom allocation callbacks. + /// Custom CPU memory allocation callbacks. Optional. /** Optional, can be null. When specified, will also be used for all CPU-side memory allocations. */ const VkAllocationCallbacks* pAllocationCallbacks; + /// Informative callbacks for `vkAllocateMemory`, `vkFreeMemory`. Optional. + /** Optional, can be null. */ + const VmaDeviceMemoryCallbacks* pDeviceMemoryCallbacks; + /** \brief Maximum number of additional frames that are in use at the same time as current frame. + + This value is used only when you make allocations with + VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT flag. Such allocation cannot become + lost if allocation.lastUseFrameIndex >= allocator.currentFrameIndex - frameInUseCount. + + For example, if you double-buffer your command buffers, so resources used for + rendering in previous frame may still be in use by the GPU at the moment you + allocate resources needed for the current frame, set this value to 1. + + If you want to allow any allocations other than used in the current frame to + become lost, set this value to 0. + */ + uint32_t frameInUseCount; + /** \brief Either null or a pointer to an array of limits on maximum number of bytes that can be allocated out of particular Vulkan memory heap. + + If not NULL, it must be a pointer to an array of + `VkPhysicalDeviceMemoryProperties::memoryHeapCount` elements, defining limit on + maximum number of bytes that can be allocated out of particular Vulkan memory + heap. + + Any of the elements may be equal to `VK_WHOLE_SIZE`, which means no limit on that + heap. This is also the default in case of `pHeapSizeLimit` = NULL. + + If there is a limit defined for a heap: + + - If user tries to allocate more memory from that heap using this allocator, + the allocation fails with `VK_ERROR_OUT_OF_DEVICE_MEMORY`. + - If the limit is smaller than heap size reported in `VkMemoryHeap::size`, the + value of this limit will be reported instead when using vmaGetMemoryProperties(). + + Warning! Using this feature may not be equivalent to installing a GPU with + smaller amount of memory, because graphics driver doesn't necessary fail new + allocations with `VK_ERROR_OUT_OF_DEVICE_MEMORY` result when memory capacity is + exceeded. It may return success and just silently migrate some device memory + blocks to system RAM. + */ + const VkDeviceSize* pHeapSizeLimit; + /** \brief Pointers to Vulkan functions. Can be null if you leave define `VMA_STATIC_VULKAN_FUNCTIONS 1`. + + If you leave define `VMA_STATIC_VULKAN_FUNCTIONS 1` in configuration section, + you can pass null as this member, because the library will fetch pointers to + Vulkan functions internally in a static way, like: + + vulkanFunctions.vkAllocateMemory = &vkAllocateMemory; + + Fill this member if you want to provide your own pointers to Vulkan functions, + e.g. fetched using `vkGetInstanceProcAddr()` and `vkGetDeviceProcAddr()`. + */ + const VmaVulkanFunctions* pVulkanFunctions; } VmaAllocatorCreateInfo; /// Creates Allocator object. @@ -217,31 +1295,50 @@ void vmaGetMemoryTypeProperties( uint32_t memoryTypeIndex, VkMemoryPropertyFlags* pFlags); +/** \brief Sets index of the current frame. + +This function must be used if you make allocations with +#VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT and +#VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT flags to inform the allocator +when a new frame begins. Allocations queried using vmaGetAllocationInfo() cannot +become lost in the current frame. +*/ +void vmaSetCurrentFrameIndex( + VmaAllocator allocator, + uint32_t frameIndex); + +/** \brief Calculated statistics of memory usage in entire allocator. +*/ typedef struct VmaStatInfo { - uint32_t AllocationCount; - uint32_t SuballocationCount; - uint32_t UnusedRangeCount; - VkDeviceSize UsedBytes; - VkDeviceSize UnusedBytes; - VkDeviceSize SuballocationSizeMin, SuballocationSizeAvg, SuballocationSizeMax; - VkDeviceSize UnusedRangeSizeMin, UnusedRangeSizeAvg, UnusedRangeSizeMax; + /// Number of `VkDeviceMemory` Vulkan memory blocks allocated. + uint32_t blockCount; + /// Number of #VmaAllocation allocation objects allocated. + uint32_t allocationCount; + /// Number of free ranges of memory between allocations. + uint32_t unusedRangeCount; + /// Total number of bytes occupied by all allocations. + VkDeviceSize usedBytes; + /// Total number of bytes occupied by unused ranges. + VkDeviceSize unusedBytes; + VkDeviceSize allocationSizeMin, allocationSizeAvg, allocationSizeMax; + VkDeviceSize unusedRangeSizeMin, unusedRangeSizeAvg, unusedRangeSizeMax; } VmaStatInfo; /// General statistics from current state of Allocator. -struct VmaStats +typedef struct VmaStats { VmaStatInfo memoryType[VK_MAX_MEMORY_TYPES]; VmaStatInfo memoryHeap[VK_MAX_MEMORY_HEAPS]; VmaStatInfo total; -}; +} VmaStats; /// Retrieves statistics from current state of the Allocator. void vmaCalculateStats( VmaAllocator allocator, VmaStats* pStats); -#define VMA_STATS_STRING_ENABLED 0 +#define VMA_STATS_STRING_ENABLED 1 #if VMA_STATS_STRING_ENABLED @@ -259,69 +1356,189 @@ void vmaFreeStatsString( #endif // #if VMA_STATS_STRING_ENABLED -/** @} */ +/** \struct VmaPool +\brief Represents custom memory pool -//////////////////////////////////////////////////////////////////////////////// -/** \defgroup layer1 Layer 1 Choosing Memory Type -@{ +Fill structure VmaPoolCreateInfo and call function vmaCreatePool() to create it. +Call function vmaDestroyPool() to destroy it. + +For more information see [Custom memory pools](@ref choosing_memory_type_custom_memory_pools). */ +VK_DEFINE_HANDLE(VmaPool) typedef enum VmaMemoryUsage { - /// No intended memory usage specified. + /** No intended memory usage specified. + Use other members of VmaAllocationCreateInfo to specify your requirements. + */ VMA_MEMORY_USAGE_UNKNOWN = 0, - /// Memory will be used on device only, no need to be mapped on host. + /** Memory will be used on device only, so fast access from the device is preferred. + It usually means device-local GPU (video) memory. + No need to be mappable on host. + It is roughly equivalent of `D3D12_HEAP_TYPE_DEFAULT`. + + Usage: + + - Resources written and read by device, e.g. images used as attachments. + - Resources transferred from host once (immutable) or infrequently and read by + device multiple times, e.g. textures to be sampled, vertex buffers, uniform + (constant) buffers, and majority of other types of resources used on GPU. + + Allocation may still end up in `HOST_VISIBLE` memory on some implementations. + In such case, you are free to map it. + You can use #VMA_ALLOCATION_CREATE_MAPPED_BIT with this usage type. + */ VMA_MEMORY_USAGE_GPU_ONLY = 1, - /// Memory will be mapped on host. Could be used for transfer to device. + /** Memory will be mappable on host. + It usually means CPU (system) memory. + Guarantees to be `HOST_VISIBLE` and `HOST_COHERENT`. + CPU access is typically uncached. Writes may be write-combined. + Resources created in this pool may still be accessible to the device, but access to them can be slow. + It is roughly equivalent of `D3D12_HEAP_TYPE_UPLOAD`. + + Usage: Staging copy of resources used as transfer source. + */ VMA_MEMORY_USAGE_CPU_ONLY = 2, - /// Memory will be used for frequent (dynamic) updates from host and reads on device. + /** + Memory that is both mappable on host (guarantees to be `HOST_VISIBLE`) and preferably fast to access by GPU. + CPU access is typically uncached. Writes may be write-combined. + + Usage: Resources written frequently by host (dynamic), read by device. E.g. textures, vertex buffers, uniform buffers updated every frame or every draw call. + */ VMA_MEMORY_USAGE_CPU_TO_GPU = 3, - /// Memory will be used for writing on device and readback on host. + /** Memory mappable on host (guarantees to be `HOST_VISIBLE`) and cached. + It is roughly equivalent of `D3D12_HEAP_TYPE_READBACK`. + + Usage: + + - Resources written by device, read by host - results of some computations, e.g. screen capture, average scene luminance for HDR tone mapping. + - Any resources read or accessed randomly on host, e.g. CPU-side copy of vertex buffer used as source of transfer, but also used for collision detection. + */ VMA_MEMORY_USAGE_GPU_TO_CPU = 4, VMA_MEMORY_USAGE_MAX_ENUM = 0x7FFFFFFF } VmaMemoryUsage; -typedef struct VmaMemoryRequirements -{ - /** \brief Set to true if this allocation should have its own memory block. +/// Flags to be passed as VmaAllocationCreateInfo::flags. +typedef enum VmaAllocationCreateFlagBits { + /** \brief Set this flag if the allocation should have its own memory block. Use it for special, big resources, like fullscreen images used as attachments. This flag must also be used for host visible resources that you want to map simultaneously because otherwise they might end up as regions of the same - VkDeviceMemory, while mapping same VkDeviceMemory multiple times is illegal. + `VkDeviceMemory`, while mapping same `VkDeviceMemory` multiple times + simultaneously is illegal. + + You should not use this flag if VmaAllocationCreateInfo::pool is not null. + */ + VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT = 0x00000001, + + /** \brief Set this flag to only try to allocate from existing `VkDeviceMemory` blocks and never create new such block. + + If new allocation cannot be placed in any of the existing blocks, allocation + fails with `VK_ERROR_OUT_OF_DEVICE_MEMORY` error. + + You should not use #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT and + #VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT at the same time. It makes no sense. + + If VmaAllocationCreateInfo::pool is not null, this flag is implied and ignored. */ + VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT = 0x00000002, + /** \brief Set this flag to use a memory that will be persistently mapped and retrieve pointer to it. + + Pointer to mapped memory will be returned through VmaAllocationInfo::pMappedData. + + Is it valid to use this flag for allocation made from memory type that is not + `HOST_VISIBLE`. This flag is then ignored and memory is not mapped. This is + useful if you need an allocation that is efficient to use on GPU + (`DEVICE_LOCAL`) and still want to map it directly if possible on platforms that + support it (e.g. Intel GPU). + + You should not use this flag together with #VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT. + */ + VMA_ALLOCATION_CREATE_MAPPED_BIT = 0x00000004, + /** Allocation created with this flag can become lost as a result of another + allocation with #VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT flag, so you + must check it before use. + + To check if allocation is not lost, call vmaGetAllocationInfo() and check if + VmaAllocationInfo::deviceMemory is not `VK_NULL_HANDLE`. + + For details about supporting lost allocations, see Lost Allocations + chapter of User Guide on Main Page. + + You should not use this flag together with #VMA_ALLOCATION_CREATE_MAPPED_BIT. + */ + VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT = 0x00000008, + /** While creating allocation using this flag, other allocations that were + created with flag #VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT can become lost. + + For details about supporting lost allocations, see Lost Allocations + chapter of User Guide on Main Page. + */ + VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT = 0x00000010, + /** Set this flag to treat VmaAllocationCreateInfo::pUserData as pointer to a + null-terminated string. Instead of copying pointer value, a local copy of the + string is made and stored in allocation's `pUserData`. The string is automatically + freed together with the allocation. It is also used in vmaBuildStatsString(). */ - VkBool32 ownMemory; + VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT = 0x00000020, + + VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VmaAllocationCreateFlagBits; +typedef VkFlags VmaAllocationCreateFlags; + +typedef struct VmaAllocationCreateInfo +{ + /// Use #VmaAllocationCreateFlagBits enum. + VmaAllocationCreateFlags flags; /** \brief Intended usage of memory. - Leave VMA_MEMORY_USAGE_UNKNOWN if you specify requiredFlags. You can also use both. + You can leave #VMA_MEMORY_USAGE_UNKNOWN if you specify memory requirements in other way. \n + If `pool` is not null, this member is ignored. */ VmaMemoryUsage usage; /** \brief Flags that must be set in a Memory Type chosen for an allocation. - Leave 0 if you specify requirement via usage. */ + Leave 0 if you specify memory requirements in other way. \n + If `pool` is not null, this member is ignored.*/ VkMemoryPropertyFlags requiredFlags; - /** \brief Flags that preferably should be set in a Memory Type chosen for an allocation. + /** \brief Flags that preferably should be set in a memory type chosen for an allocation. - Set to 0 if no additional flags are prefered and only requiredFlags should be used. - If not 0, it must be a superset or equal to requiredFlags. */ + Set to 0 if no additional flags are prefered. \n + If `pool` is not null, this member is ignored. */ VkMemoryPropertyFlags preferredFlags; - /** \brief Set this flag to only try to allocate from existing VkDeviceMemory blocks and never create new such block. - - If new allocation cannot be placed in any of the existing blocks, allocation - fails with VK_ERROR_OUT_OF_DEVICE_MEMORY error. + /** \brief Bitmask containing one bit set for every memory type acceptable for this allocation. + + Value 0 is equivalent to `UINT32_MAX` - it means any memory type is accepted if + it meets other requirements specified by this structure, with no further + restrictions on memory type index. \n + If `pool` is not null, this member is ignored. + */ + uint32_t memoryTypeBits; + /** \brief Pool that this allocation should be created in. + + Leave `VK_NULL_HANDLE` to allocate from default pool. If not null, members: + `usage`, `requiredFlags`, `preferredFlags`, `memoryTypeBits` are ignored. + */ + VmaPool pool; + /** \brief Custom general-purpose pointer that will be stored in #VmaAllocation, can be read as VmaAllocationInfo::pUserData and changed using vmaSetAllocationUserData(). - It makes no sense to set ownMemory and neverAllocate at the same time. */ - VkBool32 neverAllocate; -} VmaMemoryRequirements; + If #VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT is used, it must be either + null or pointer to a null-terminated string. The string will be then copied to + internal buffer, so it doesn't need to be valid after allocation call. + */ + void* pUserData; +} VmaAllocationCreateInfo; /** +\brief Helps to find memoryTypeIndex, given memoryTypeBits and VmaAllocationCreateInfo. + This algorithm tries to find a memory type that: - Is allowed by memoryTypeBits. -- Contains all the flags from pMemoryRequirements->requiredFlags. +- Contains all the flags from pAllocationCreateInfo->requiredFlags. - Matches intended usage. -- Has as many flags from pMemoryRequirements->preferredFlags as possible. +- Has as many flags from pAllocationCreateInfo->preferredFlags as possible. \return Returns VK_ERROR_FEATURE_NOT_PRESENT if not found. Receiving such result from this function or any other allocating function probably means that your @@ -332,139 +1549,671 @@ resource, like image layout (OPTIMAL versus LINEAR) or mip level count. VkResult vmaFindMemoryTypeIndex( VmaAllocator allocator, uint32_t memoryTypeBits, - const VmaMemoryRequirements* pMemoryRequirements, + const VmaAllocationCreateInfo* pAllocationCreateInfo, uint32_t* pMemoryTypeIndex); -/** @} */ - -//////////////////////////////////////////////////////////////////////////////// -/** \defgroup layer2 Layer 2 Allocating Memory -@{ -*/ - -/** \brief General purpose memory allocation. - -@param[out] pMemory Allocated memory. -@param[out] pMemoryTypeIndex Optional. Index of memory type that has been chosen for this allocation. - -You should free the memory using vmaFreeMemory(). +/** +\brief Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo. -All allocated memory is also automatically freed in vmaDestroyAllocator(). +It can be useful e.g. to determine value to be used as VmaPoolCreateInfo::memoryTypeIndex. +It internally creates a temporary, dummy buffer that never has memory bound. +It is just a convenience function, equivalent to calling: -It is recommended to use vmaAllocateMemoryForBuffer(), vmaAllocateMemoryForImage(), -vmaCreateBuffer(), vmaCreateImage() instead whenever possible. +- `vkCreateBuffer` +- `vkGetBufferMemoryRequirements` +- `vmaFindMemoryTypeIndex` +- `vkDestroyBuffer` */ -VkResult vmaAllocateMemory( +VkResult vmaFindMemoryTypeIndexForBufferInfo( VmaAllocator allocator, - const VkMemoryRequirements* pVkMemoryRequirements, - const VmaMemoryRequirements* pVmaMemoryRequirements, - VkMappedMemoryRange* pMemory, + const VkBufferCreateInfo* pBufferCreateInfo, + const VmaAllocationCreateInfo* pAllocationCreateInfo, uint32_t* pMemoryTypeIndex); /** -@param[out] pMemoryTypeIndex Optional. Pass null if you don't need this information. +\brief Helps to find memoryTypeIndex, given VkImageCreateInfo and VmaAllocationCreateInfo. -You should free the memory using vmaFreeMemory(). +It can be useful e.g. to determine value to be used as VmaPoolCreateInfo::memoryTypeIndex. +It internally creates a temporary, dummy image that never has memory bound. +It is just a convenience function, equivalent to calling: -All allocated memory is also automatically freed in vmaDestroyAllocator(). +- `vkCreateImage` +- `vkGetImageMemoryRequirements` +- `vmaFindMemoryTypeIndex` +- `vkDestroyImage` */ -VkResult vmaAllocateMemoryForBuffer( +VkResult vmaFindMemoryTypeIndexForImageInfo( VmaAllocator allocator, - VkBuffer buffer, - const VmaMemoryRequirements* pMemoryRequirements, - VkMappedMemoryRange* pMemory, + const VkImageCreateInfo* pImageCreateInfo, + const VmaAllocationCreateInfo* pAllocationCreateInfo, uint32_t* pMemoryTypeIndex); -/// Function similar to vmaAllocateMemoryForBuffer(). -VkResult vmaAllocateMemoryForImage( - VmaAllocator allocator, - VkImage image, - const VmaMemoryRequirements* pMemoryRequirements, - VkMappedMemoryRange* pMemory, - uint32_t* pMemoryTypeIndex); +/// Flags to be passed as VmaPoolCreateInfo::flags. +typedef enum VmaPoolCreateFlagBits { + /** \brief Use this flag if you always allocate only buffers and linear images or only optimal images out of this pool and so Buffer-Image Granularity can be ignored. -/// Frees memory previously allocated using vmaAllocateMemoryForBuffer() or vmaAllocateMemoryForImage(). -void vmaFreeMemory( - VmaAllocator allocator, - const VkMappedMemoryRange* pMemory); + This is na optional optimization flag. + + If you always allocate using vmaCreateBuffer(), vmaCreateImage(), + vmaAllocateMemoryForBuffer(), then you don't need to use it because allocator + knows exact type of your allocations so it can handle Buffer-Image Granularity + in the optimal way. + + If you also allocate using vmaAllocateMemoryForImage() or vmaAllocateMemory(), + exact type of such allocations is not known, so allocator must be conservative + in handling Buffer-Image Granularity, which can lead to suboptimal allocation + (wasted memory). In that case, if you can make sure you always allocate only + buffers and linear images or only optimal images out of this pool, use this flag + to make allocator disregard Buffer-Image Granularity and so make allocations + more optimal. + */ + VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT = 0x00000002, + + VMA_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VmaPoolCreateFlagBits; +typedef VkFlags VmaPoolCreateFlags; + +/** \brief Describes parameter of created #VmaPool. +*/ +typedef struct VmaPoolCreateInfo { + /** \brief Vulkan memory type index to allocate this pool from. + */ + uint32_t memoryTypeIndex; + /** \brief Use combination of #VmaPoolCreateFlagBits. + */ + VmaPoolCreateFlags flags; + /** \brief Size of a single `VkDeviceMemory` block to be allocated as part of this pool, in bytes. + + Optional. Leave 0 to use default. + */ + VkDeviceSize blockSize; + /** \brief Minimum number of blocks to be always allocated in this pool, even if they stay empty. + + Set to 0 to have no preallocated blocks and let the pool be completely empty. + */ + size_t minBlockCount; + /** \brief Maximum number of blocks that can be allocated in this pool. Optional. + + Optional. Set to 0 to use `SIZE_MAX`, which means no limit. + + Set to same value as minBlockCount to have fixed amount of memory allocated + throuout whole lifetime of this pool. + */ + size_t maxBlockCount; + /** \brief Maximum number of additional frames that are in use at the same time as current frame. + + This value is used only when you make allocations with + #VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT flag. Such allocation cannot become + lost if allocation.lastUseFrameIndex >= allocator.currentFrameIndex - frameInUseCount. + + For example, if you double-buffer your command buffers, so resources used for + rendering in previous frame may still be in use by the GPU at the moment you + allocate resources needed for the current frame, set this value to 1. + + If you want to allow any allocations other than used in the current frame to + become lost, set this value to 0. + */ + uint32_t frameInUseCount; +} VmaPoolCreateInfo; + +/** \brief Describes parameter of existing #VmaPool. +*/ +typedef struct VmaPoolStats { + /** \brief Total amount of `VkDeviceMemory` allocated from Vulkan for this pool, in bytes. + */ + VkDeviceSize size; + /** \brief Total number of bytes in the pool not used by any #VmaAllocation. + */ + VkDeviceSize unusedSize; + /** \brief Number of #VmaAllocation objects created from this pool that were not destroyed or lost. + */ + size_t allocationCount; + /** \brief Number of continuous memory ranges in the pool not used by any #VmaAllocation. + */ + size_t unusedRangeCount; + /** \brief Size of the largest continuous free memory region. + + Making a new allocation of that size is not guaranteed to succeed because of + possible additional margin required to respect alignment and buffer/image + granularity. + */ + VkDeviceSize unusedRangeSizeMax; +} VmaPoolStats; + +/** \brief Allocates Vulkan device memory and creates #VmaPool object. + +@param allocator Allocator object. +@param pCreateInfo Parameters of pool to create. +@param[out] pPool Handle to created pool. +*/ +VkResult vmaCreatePool( + VmaAllocator allocator, + const VmaPoolCreateInfo* pCreateInfo, + VmaPool* pPool); + +/** \brief Destroys #VmaPool object and frees Vulkan device memory. +*/ +void vmaDestroyPool( + VmaAllocator allocator, + VmaPool pool); + +/** \brief Retrieves statistics of existing #VmaPool object. + +@param allocator Allocator object. +@param pool Pool object. +@param[out] pPoolStats Statistics of specified pool. +*/ +void vmaGetPoolStats( + VmaAllocator allocator, + VmaPool pool, + VmaPoolStats* pPoolStats); + +/** \brief Marks all allocations in given pool as lost if they are not used in current frame or VmaPoolCreateInfo::frameInUseCount back from now. + +@param allocator Allocator object. +@param pool Pool. +@param[out] pLostAllocationCount Number of allocations marked as lost. Optional - pass null if you don't need this information. +*/ +void vmaMakePoolAllocationsLost( + VmaAllocator allocator, + VmaPool pool, + size_t* pLostAllocationCount); + +/** \struct VmaAllocation +\brief Represents single memory allocation. + +It may be either dedicated block of `VkDeviceMemory` or a specific region of a bigger block of this type +plus unique offset. + +There are multiple ways to create such object. +You need to fill structure VmaAllocationCreateInfo. +For more information see [Choosing memory type](@ref choosing_memory_type). + +Although the library provides convenience functions that create Vulkan buffer or image, +allocate memory for it and bind them together, +binding of the allocation to a buffer or an image is out of scope of the allocation itself. +Allocation object can exist without buffer/image bound, +binding can be done manually by the user, and destruction of it can be done +independently of destruction of the allocation. + +The object also remembers its size and some other information. +To retrieve this information, use function vmaGetAllocationInfo() and inspect +returned structure VmaAllocationInfo. + +Some kinds allocations can be in lost state. +For more information, see [Lost allocations](@ref lost_allocations). +*/ +VK_DEFINE_HANDLE(VmaAllocation) + +/** \brief Parameters of #VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo(). +*/ +typedef struct VmaAllocationInfo { + /** \brief Memory type index that this allocation was allocated from. + + It never changes. + */ + uint32_t memoryType; + /** \brief Handle to Vulkan memory object. + + Same memory object can be shared by multiple allocations. + + It can change after call to vmaDefragment() if this allocation is passed to the function, or if allocation is lost. + + If the allocation is lost, it is equal to `VK_NULL_HANDLE`. + */ + VkDeviceMemory deviceMemory; + /** \brief Offset into deviceMemory object to the beginning of this allocation, in bytes. (deviceMemory, offset) pair is unique to this allocation. + + It can change after call to vmaDefragment() if this allocation is passed to the function, or if allocation is lost. + */ + VkDeviceSize offset; + /** \brief Size of this allocation, in bytes. + + It never changes, unless allocation is lost. + */ + VkDeviceSize size; + /** \brief Pointer to the beginning of this allocation as mapped data. + + If the allocation hasn't been mapped using vmaMapMemory() and hasn't been + created with #VMA_ALLOCATION_CREATE_MAPPED_BIT flag, this value null. + + It can change after call to vmaMapMemory(), vmaUnmapMemory(). + It can also change after call to vmaDefragment() if this allocation is passed to the function. + */ + void* pMappedData; + /** \brief Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vmaSetAllocationUserData(). + + It can change after call to vmaSetAllocationUserData() for this allocation. + */ + void* pUserData; +} VmaAllocationInfo; + +/** \brief General purpose memory allocation. + +@param[out] pAllocation Handle to allocated memory. +@param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo(). + +You should free the memory using vmaFreeMemory(). + +It is recommended to use vmaAllocateMemoryForBuffer(), vmaAllocateMemoryForImage(), +vmaCreateBuffer(), vmaCreateImage() instead whenever possible. +*/ +VkResult vmaAllocateMemory( + VmaAllocator allocator, + const VkMemoryRequirements* pVkMemoryRequirements, + const VmaAllocationCreateInfo* pCreateInfo, + VmaAllocation* pAllocation, + VmaAllocationInfo* pAllocationInfo); /** -Feel free to use vkMapMemory on these memory blocks on you own if you want, but -just for convenience and to make sure correct offset and size is always -specified, usage of vmaMapMemory() / vmaUnmapMemory() is recommended. +@param[out] pAllocation Handle to allocated memory. +@param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo(). + +You should free the memory using vmaFreeMemory(). +*/ +VkResult vmaAllocateMemoryForBuffer( + VmaAllocator allocator, + VkBuffer buffer, + const VmaAllocationCreateInfo* pCreateInfo, + VmaAllocation* pAllocation, + VmaAllocationInfo* pAllocationInfo); + +/// Function similar to vmaAllocateMemoryForBuffer(). +VkResult vmaAllocateMemoryForImage( + VmaAllocator allocator, + VkImage image, + const VmaAllocationCreateInfo* pCreateInfo, + VmaAllocation* pAllocation, + VmaAllocationInfo* pAllocationInfo); + +/// Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(), or vmaAllocateMemoryForImage(). +void vmaFreeMemory( + VmaAllocator allocator, + VmaAllocation allocation); + +/** \brief Returns current information about specified allocation and atomically marks it as used in current frame. + +Current paramters of given allocation are returned in `pAllocationInfo`. + +This function also atomically "touches" allocation - marks it as used in current frame, +just like vmaTouchAllocation(). +If the allocation is in lost state, `pAllocationInfo->deviceMemory == VK_NULL_HANDLE`. + +Although this function uses atomics and doesn't lock any mutex, so it should be quite efficient, +you can avoid calling it too often. + +- You can retrieve same VmaAllocationInfo structure while creating your resource, from function + vmaCreateBuffer(), vmaCreateImage(). You can remember it if you are sure parameters don't change + (e.g. due to defragmentation or allocation becoming lost). +- If you just want to check if allocation is not lost, vmaTouchAllocation() will work faster. +*/ +void vmaGetAllocationInfo( + VmaAllocator allocator, + VmaAllocation allocation, + VmaAllocationInfo* pAllocationInfo); + +/** \brief Returns `VK_TRUE` if allocation is not lost and atomically marks it as used in current frame. + +If the allocation has been created with #VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT flag, +this function returns `VK_TRUE` if it's not in lost state, so it can still be used. +It then also atomically "touches" the allocation - marks it as used in current frame, +so that you can be sure it won't become lost in current frame or next `frameInUseCount` frames. + +If the allocation is in lost state, the function returns `VK_FALSE`. +Memory of such allocation, as well as buffer or image bound to it, should not be used. +Lost allocation and the buffer/image still need to be destroyed. + +If the allocation has been created without #VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT flag, +this function always returns `VK_TRUE`. +*/ +VkBool32 vmaTouchAllocation( + VmaAllocator allocator, + VmaAllocation allocation); + +/** \brief Sets pUserData in given allocation to new value. + +If the allocation was created with VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT, +pUserData must be either null, or pointer to a null-terminated string. The function +makes local copy of the string and sets it as allocation's `pUserData`. String +passed as pUserData doesn't need to be valid for whole lifetime of the allocation - +you can free it after this call. String previously pointed by allocation's +pUserData is freed from memory. + +If the flag was not used, the value of pointer `pUserData` is just copied to +allocation's `pUserData`. It is opaque, so you can use it however you want - e.g. +as a pointer, ordinal number or some handle to you own data. +*/ +void vmaSetAllocationUserData( + VmaAllocator allocator, + VmaAllocation allocation, + void* pUserData); + +/** \brief Creates new allocation that is in lost state from the beginning. + +It can be useful if you need a dummy, non-null allocation. + +You still need to destroy created object using vmaFreeMemory(). + +Returned allocation is not tied to any specific memory pool or memory type and +not bound to any image or buffer. It has size = 0. It cannot be turned into +a real, non-empty allocation. +*/ +void vmaCreateLostAllocation( + VmaAllocator allocator, + VmaAllocation* pAllocation); + +/** \brief Maps memory represented by given allocation and returns pointer to it. + +Maps memory represented by given allocation to make it accessible to CPU code. +When succeeded, `*ppData` contains pointer to first byte of this memory. +If the allocation is part of bigger `VkDeviceMemory` block, the pointer is +correctly offseted to the beginning of region assigned to this particular +allocation. + +Mapping is internally reference-counted and synchronized, so despite raw Vulkan +function `vkMapMemory()` cannot be used to map same block of `VkDeviceMemory` +multiple times simultaneously, it is safe to call this function on allocations +assigned to the same memory block. Actual Vulkan memory will be mapped on first +mapping and unmapped on last unmapping. + +If the function succeeded, you must call vmaUnmapMemory() to unmap the +allocation when mapping is no longer needed or before freeing the allocation, at +the latest. + +It also safe to call this function multiple times on the same allocation. You +must call vmaUnmapMemory() same number of times as you called vmaMapMemory(). + +It is also safe to call this function on allocation created with +#VMA_ALLOCATION_CREATE_MAPPED_BIT flag. Its memory stays mapped all the time. +You must still call vmaUnmapMemory() same number of times as you called +vmaMapMemory(). You must not call vmaUnmapMemory() additional time to free the +"0-th" mapping made automatically due to #VMA_ALLOCATION_CREATE_MAPPED_BIT flag. + +This function fails when used on allocation made in memory type that is not +`HOST_VISIBLE`. + +This function always fails when called for allocation that was created with +#VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT flag. Such allocations cannot be +mapped. */ VkResult vmaMapMemory( VmaAllocator allocator, - const VkMappedMemoryRange* pMemory, + VmaAllocation allocation, void** ppData); +/** \brief Unmaps memory represented by given allocation, mapped previously using vmaMapMemory(). + +For details, see description of vmaMapMemory(). +*/ void vmaUnmapMemory( VmaAllocator allocator, - const VkMappedMemoryRange* pMemory); + VmaAllocation allocation); -/** @} */ +/** \brief Optional configuration parameters to be passed to function vmaDefragment(). */ +typedef struct VmaDefragmentationInfo { + /** \brief Maximum total numbers of bytes that can be copied while moving allocations to different places. + + Default is `VK_WHOLE_SIZE`, which means no limit. + */ + VkDeviceSize maxBytesToMove; + /** \brief Maximum number of allocations that can be moved to different place. -//////////////////////////////////////////////////////////////////////////////// -/** \defgroup layer3 Layer 3 Creating Buffers and Images -@{ + Default is `UINT32_MAX`, which means no limit. + */ + uint32_t maxAllocationsToMove; +} VmaDefragmentationInfo; + +/** \brief Statistics returned by function vmaDefragment(). */ +typedef struct VmaDefragmentationStats { + /// Total number of bytes that have been copied while moving allocations to different places. + VkDeviceSize bytesMoved; + /// Total number of bytes that have been released to the system by freeing empty `VkDeviceMemory` objects. + VkDeviceSize bytesFreed; + /// Number of allocations that have been moved to different places. + uint32_t allocationsMoved; + /// Number of empty `VkDeviceMemory` objects that have been released to the system. + uint32_t deviceMemoryBlocksFreed; +} VmaDefragmentationStats; + +/** \brief Compacts memory by moving allocations. + +@param pAllocations Array of allocations that can be moved during this compation. +@param allocationCount Number of elements in pAllocations and pAllocationsChanged arrays. +@param[out] pAllocationsChanged Array of boolean values that will indicate whether matching allocation in pAllocations array has been moved. This parameter is optional. Pass null if you don't need this information. +@param pDefragmentationInfo Configuration parameters. Optional - pass null to use default values. +@param[out] pDefragmentationStats Statistics returned by the function. Optional - pass null if you don't need this information. +@return VK_SUCCESS if completed, VK_INCOMPLETE if succeeded but didn't make all possible optimizations because limits specified in pDefragmentationInfo have been reached, negative error code in case of error. + +This function works by moving allocations to different places (different +`VkDeviceMemory` objects and/or different offsets) in order to optimize memory +usage. Only allocations that are in pAllocations array can be moved. All other +allocations are considered nonmovable in this call. Basic rules: + +- Only allocations made in memory types that have + `VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT` flag can be compacted. You may pass other + allocations but it makes no sense - these will never be moved. +- You may pass allocations made with #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT but + it makes no sense - they will never be moved. +- Both allocations made with or without #VMA_ALLOCATION_CREATE_MAPPED_BIT + flag can be compacted. If not persistently mapped, memory will be mapped + temporarily inside this function if needed. +- You must not pass same #VmaAllocation object multiple times in pAllocations array. + +The function also frees empty `VkDeviceMemory` blocks. + +After allocation has been moved, its VmaAllocationInfo::deviceMemory and/or +VmaAllocationInfo::offset changes. You must query them again using +vmaGetAllocationInfo() if you need them. + +If an allocation has been moved, data in memory is copied to new place +automatically, but if it was bound to a buffer or an image, you must destroy +that object yourself, create new one and bind it to the new memory pointed by +the allocation. You must use `vkDestroyBuffer()`, `vkDestroyImage()`, +`vkCreateBuffer()`, `vkCreateImage()` for that purpose and NOT vmaDestroyBuffer(), +vmaDestroyImage(), vmaCreateBuffer(), vmaCreateImage()! Example: + +\code +VkDevice device = ...; +VmaAllocator allocator = ...; +std::vector buffers = ...; +std::vector allocations = ...; + +std::vector allocationsChanged(allocations.size()); +vmaDefragment(allocator, allocations.data(), allocations.size(), allocationsChanged.data(), nullptr, nullptr); + +for(size_t i = 0; i < allocations.size(); ++i) +{ + if(allocationsChanged[i]) + { + VmaAllocationInfo allocInfo; + vmaGetAllocationInfo(allocator, allocations[i], &allocInfo); + + vkDestroyBuffer(device, buffers[i], nullptr); + + VkBufferCreateInfo bufferInfo = ...; + vkCreateBuffer(device, &bufferInfo, nullptr, &buffers[i]); + + // You can make dummy call to vkGetBufferMemoryRequirements here to silence validation layer warning. + + vkBindBufferMemory(device, buffers[i], allocInfo.deviceMemory, allocInfo.offset); + } +} +\endcode + +Note: Please don't expect memory to be fully compacted after this call. +Algorithms inside are based on some heuristics that try to maximize number of Vulkan +memory blocks to make totally empty to release them, as well as to maximimze continuous +empty space inside remaining blocks, while minimizing the number and size of data that +needs to be moved. Some fragmentation still remains after this call. This is normal. + +Warning: This function is not 100% correct according to Vulkan specification. Use it +at your own risk. That's because Vulkan doesn't guarantee that memory +requirements (size and alignment) for a new buffer or image are consistent. They +may be different even for subsequent calls with the same parameters. It really +does happen on some platforms, especially with images. + +Warning: This function may be time-consuming, so you shouldn't call it too often +(like every frame or after every resource creation/destruction). +You can call it on special occasions (like when reloading a game level or +when you just destroyed a lot of objects). +*/ +VkResult vmaDefragment( + VmaAllocator allocator, + VmaAllocation* pAllocations, + size_t allocationCount, + VkBool32* pAllocationsChanged, + const VmaDefragmentationInfo *pDefragmentationInfo, + VmaDefragmentationStats* pDefragmentationStats); + +/** \brief Binds buffer to allocation. + +Binds specified buffer to region of memory represented by specified allocation. +Gets `VkDeviceMemory` handle and offset from the allocation. +If you want to create a buffer, allocate memory for it and bind them together separately, +you should use this function for binding instead of standard `vkBindBufferMemory()`, +because it ensures proper synchronization so that when a `VkDeviceMemory` object is used by multiple +allocations, calls to `vkBind*Memory()` or `vkMapMemory()` won't happen from multiple threads simultaneously +(which is illegal in Vulkan). + +It is recommended to use function vmaCreateBuffer() instead of this one. +*/ +VkResult vmaBindBufferMemory( + VmaAllocator allocator, + VmaAllocation allocation, + VkBuffer buffer); + +/** \brief Binds image to allocation. + +Binds specified image to region of memory represented by specified allocation. +Gets `VkDeviceMemory` handle and offset from the allocation. +If you want to create an image, allocate memory for it and bind them together separately, +you should use this function for binding instead of standard `vkBindImageMemory()`, +because it ensures proper synchronization so that when a `VkDeviceMemory` object is used by multiple +allocations, calls to `vkBind*Memory()` or `vkMapMemory()` won't happen from multiple threads simultaneously +(which is illegal in Vulkan). + +It is recommended to use function vmaCreateImage() instead of this one. */ +VkResult vmaBindImageMemory( + VmaAllocator allocator, + VmaAllocation allocation, + VkImage image); /** -@param[out] pMemory Optional. Pass null if you don't need this information. -@param[out] pMemoryTypeIndex Optional. Pass null if you don't need this information. +@param[out] pBuffer Buffer that was created. +@param[out] pAllocation Allocation that was created. +@param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo(). This function automatically: --# Creates buffer/image. +-# Creates buffer. -# Allocates appropriate memory for it. --# Binds the buffer/image with the memory. - -You do not (and should not) pass returned pMemory to vmaFreeMemory. Only calling -vmaDestroyBuffer() / vmaDestroyImage() is required for objects created using -vmaCreateBuffer() / vmaCreateImage(). - -All allocated buffers and images are also automatically destroyed in -vmaDestroyAllocator(), along with their memory allocations. +-# Binds the buffer with the memory. + +If any of these operations fail, buffer and allocation are not created, +returned value is negative error code, *pBuffer and *pAllocation are null. + +If the function succeeded, you must destroy both buffer and allocation when you +no longer need them using either convenience function vmaDestroyBuffer() or +separately, using `vkDestroyBuffer()` and vmaFreeMemory(). + +If VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT flag was used, +VK_KHR_dedicated_allocation extension is used internally to query driver whether +it requires or prefers the new buffer to have dedicated allocation. If yes, +and if dedicated allocation is possible (VmaAllocationCreateInfo::pool is null +and VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT is not used), it creates dedicated +allocation for this buffer, just like when using +VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT. */ VkResult vmaCreateBuffer( VmaAllocator allocator, - const VkBufferCreateInfo* pCreateInfo, - const VmaMemoryRequirements* pMemoryRequirements, + const VkBufferCreateInfo* pBufferCreateInfo, + const VmaAllocationCreateInfo* pAllocationCreateInfo, VkBuffer* pBuffer, - VkMappedMemoryRange* pMemory, - uint32_t* pMemoryTypeIndex); + VmaAllocation* pAllocation, + VmaAllocationInfo* pAllocationInfo); + +/** \brief Destroys Vulkan buffer and frees allocated memory. + +This is just a convenience function equivalent to: +\code +vkDestroyBuffer(device, buffer, allocationCallbacks); +vmaFreeMemory(allocator, allocation); +\endcode + +It it safe to pass null as buffer and/or allocation. +*/ void vmaDestroyBuffer( VmaAllocator allocator, - VkBuffer buffer); + VkBuffer buffer, + VmaAllocation allocation); /// Function similar to vmaCreateBuffer(). VkResult vmaCreateImage( VmaAllocator allocator, - const VkImageCreateInfo* pCreateInfo, - const VmaMemoryRequirements* pMemoryRequirements, + const VkImageCreateInfo* pImageCreateInfo, + const VmaAllocationCreateInfo* pAllocationCreateInfo, VkImage* pImage, - VkMappedMemoryRange* pMemory, - uint32_t* pMemoryTypeIndex); + VmaAllocation* pAllocation, + VmaAllocationInfo* pAllocationInfo); + +/** \brief Destroys Vulkan image and frees allocated memory. + +This is just a convenience function equivalent to: + +\code +vkDestroyImage(device, image, allocationCallbacks); +vmaFreeMemory(allocator, allocation); +\endcode +It it safe to pass null as image and/or allocation. +*/ void vmaDestroyImage( VmaAllocator allocator, - VkImage image); + VkImage image, + VmaAllocation allocation); + +#ifdef __cplusplus +} +#endif + +#endif // AMD_VULKAN_MEMORY_ALLOCATOR_H -/** @} */ +// For Visual Studio IntelliSense. +#ifdef __INTELLISENSE__ +#define VMA_IMPLEMENTATION +#endif #ifdef VMA_IMPLEMENTATION +#undef VMA_IMPLEMENTATION #include #include +#include /******************************************************************************* -CONFIGURATION +CONFIGURATION SECTION + +Define some of these macros before each #include of this header or change them +here if you need other then default behavior depending on your environment. +*/ + +/* +Define this macro to 1 to make the library fetch pointers to Vulkan functions +internally, like: + + vulkanFunctions.vkAllocateMemory = &vkAllocateMemory; -Change these definitions depending on your environment. +Define to 0 if you are going to provide you own pointers to Vulkan functions via +VmaAllocatorCreateInfo::pVulkanFunctions. */ +#if !defined(VMA_STATIC_VULKAN_FUNCTIONS) && !defined(VK_NO_PROTOTYPES) +#define VMA_STATIC_VULKAN_FUNCTIONS 1 +#endif -#define VMA_USE_STL_CONTAINERS 0 +// Define this macro to 1 to make the library use STL containers instead of its own implementation. +//#define VMA_USE_STL_CONTAINERS 1 /* Set this macro to 1 to make the library including and using STL containers: std::pair, std::vector, std::list, std::unordered_map. @@ -473,21 +2222,21 @@ Set it to 0 or undefined to make the library using its own implementation of the containers. */ #if VMA_USE_STL_CONTAINERS -#define VMA_USE_STL_VECTOR 1 -#define VMA_USE_STL_UNORDERED_MAP 1 -#define VMA_USE_STL_LIST 1 + #define VMA_USE_STL_VECTOR 1 + #define VMA_USE_STL_UNORDERED_MAP 1 + #define VMA_USE_STL_LIST 1 #endif #if VMA_USE_STL_VECTOR -#include + #include #endif #if VMA_USE_STL_UNORDERED_MAP -#include + #include #endif #if VMA_USE_STL_LIST -#include + #include #endif /* @@ -497,122 +2246,208 @@ remove them if not needed. #include // for assert #include // for min, max #include // for std::mutex +#include // for std::atomic -#if !defined(_WIN32) +#if !defined(_WIN32) && !defined(__APPLE__) #include // for aligned_alloc() #endif +#ifndef VMA_NULL + // Value used as null pointer. Define it to e.g.: nullptr, NULL, 0, (void*)0. + #define VMA_NULL nullptr +#endif + +#if defined(__APPLE__) || defined(__ANDROID__) +#include +void *aligned_alloc(size_t alignment, size_t size) +{ + // alignment must be >= sizeof(void*) + if(alignment < sizeof(void*)) + { + alignment = sizeof(void*); + } -#ifdef _DEBUG - // Normal assert to check for programmer's errors, especially in Debug configuration. - #define VMA_ASSERT(expr) assert(expr) - // Assert that will be called very often, like inside data structures e.g. operator[]. - // Making it non-empty can make program slow. - #define VMA_HEAVY_ASSERT(expr) //VMA_ASSERT(expr) -#else - #define VMA_ASSERT(expr) - #define VMA_HEAVY_ASSERT(expr) + void *pointer; + if(posix_memalign(&pointer, alignment, size) == 0) + return pointer; + return VMA_NULL; +} #endif -// Value used as null pointer. Define it to e.g.: nullptr, NULL, 0, (void*)0. -#define VMA_NULL nullptr +// Normal assert to check for programmer's errors, especially in Debug configuration. +#ifndef VMA_ASSERT + #ifdef _DEBUG + #define VMA_ASSERT(expr) assert(expr) + #else + #define VMA_ASSERT(expr) + #endif +#endif -#define VMA_ALIGN_OF(type) (__alignof(type)) +// Assert that will be called very often, like inside data structures e.g. operator[]. +// Making it non-empty can make program slow. +#ifndef VMA_HEAVY_ASSERT + #ifdef _DEBUG + #define VMA_HEAVY_ASSERT(expr) //VMA_ASSERT(expr) + #else + #define VMA_HEAVY_ASSERT(expr) + #endif +#endif -#if defined(_WIN32) - #define VMA_SYSTEM_ALIGNED_MALLOC(size, alignment) (_aligned_malloc((size), (alignment))) - #define VMA_SYSTEM_FREE(ptr) _aligned_free(ptr) -#else - #define VMA_SYSTEM_ALIGNED_MALLOC(size, alignment) (aligned_alloc((alignment), (size) )) - #define VMA_SYSTEM_FREE(ptr) free(ptr) +#ifndef VMA_ALIGN_OF + #define VMA_ALIGN_OF(type) (__alignof(type)) #endif -#define VMA_MIN(v1, v2) (std::min((v1), (v2))) -#define VMA_MAX(v1, v2) (std::max((v1), (v2))) -#define VMA_SWAP(v1, v2) std::swap((v1), (v2)) +#ifndef VMA_SYSTEM_ALIGNED_MALLOC + #if defined(_WIN32) + #define VMA_SYSTEM_ALIGNED_MALLOC(size, alignment) (_aligned_malloc((size), (alignment))) + #else + #define VMA_SYSTEM_ALIGNED_MALLOC(size, alignment) (aligned_alloc((alignment), (size) )) + #endif +#endif -#define VMA_DEBUG_LOG(format, ...) -/* -#define VMA_DEBUG_LOG(format, ...) do { \ - printf(format, __VA_ARGS__); \ - printf("\n"); \ -} while(false) -*/ +#ifndef VMA_SYSTEM_FREE + #if defined(_WIN32) + #define VMA_SYSTEM_FREE(ptr) _aligned_free(ptr) + #else + #define VMA_SYSTEM_FREE(ptr) free(ptr) + #endif +#endif -#if VMA_STATS_STRING_ENABLED +#ifndef VMA_MIN + #define VMA_MIN(v1, v2) (std::min((v1), (v2))) +#endif -static inline void VmaUint32ToStr(char* outStr, size_t strLen, uint32_t num) -{ - _ultoa_s(num, outStr, strLen, 10); -} -static inline void VmaUint64ToStr(char* outStr, size_t strLen, uint64_t num) -{ - _ui64toa_s(num, outStr, strLen, 10); -} +#ifndef VMA_MAX + #define VMA_MAX(v1, v2) (std::max((v1), (v2))) +#endif -#endif // #if VMA_STATS_STRING_ENABLED +#ifndef VMA_SWAP + #define VMA_SWAP(v1, v2) std::swap((v1), (v2)) +#endif -class VmaMutex -{ -public: - VmaMutex() { } - ~VmaMutex() { } - void Lock() { m_Mutex.lock(); } - void Unlock() { m_Mutex.unlock(); } -private: - std::mutex m_Mutex; -}; +#ifndef VMA_SORT + #define VMA_SORT(beg, end, cmp) std::sort(beg, end, cmp) +#endif -/* -Main parameter for function assessing how good is a free suballocation for a new -allocation request. +#ifndef VMA_DEBUG_LOG + #define VMA_DEBUG_LOG(format, ...) + /* + #define VMA_DEBUG_LOG(format, ...) do { \ + printf(format, __VA_ARGS__); \ + printf("\n"); \ + } while(false) + */ +#endif -- Set to true to use Best-Fit algorithm - prefer smaller blocks, as close to the - size of requested allocations as possible. -- Set to false to use Worst-Fit algorithm - prefer larger blocks, as large as - possible. +// Define this macro to 1 to enable functions: vmaBuildStatsString, vmaFreeStatsString. +#if VMA_STATS_STRING_ENABLED + static inline void VmaUint32ToStr(char* outStr, size_t strLen, uint32_t num) + { + snprintf(outStr, strLen, "%u", static_cast(num)); + } + static inline void VmaUint64ToStr(char* outStr, size_t strLen, uint64_t num) + { + snprintf(outStr, strLen, "%llu", static_cast(num)); + } + static inline void VmaPtrToStr(char* outStr, size_t strLen, const void* ptr) + { + snprintf(outStr, strLen, "%p", ptr); + } +#endif -Experiments in special testing environment showed that Best-Fit algorithm is -better. -*/ -static const bool VMA_BEST_FIT = true; +#ifndef VMA_MUTEX + class VmaMutex + { + public: + VmaMutex() { } + ~VmaMutex() { } + void Lock() { m_Mutex.lock(); } + void Unlock() { m_Mutex.unlock(); } + private: + std::mutex m_Mutex; + }; + #define VMA_MUTEX VmaMutex +#endif /* -Every object will have its own allocation. -Enable for debugging purposes only. -*/ -static const bool VMA_DEBUG_ALWAYS_OWN_MEMORY = false; +If providing your own implementation, you need to implement a subset of std::atomic: -/* -Minimum alignment of all suballocations, in bytes. -Set to more than 1 for debugging purposes only. Must be power of two. +- Constructor(uint32_t desired) +- uint32_t load() const +- void store(uint32_t desired) +- bool compare_exchange_weak(uint32_t& expected, uint32_t desired) */ -static const VkDeviceSize VMA_DEBUG_ALIGNMENT = 1; +#ifndef VMA_ATOMIC_UINT32 + #define VMA_ATOMIC_UINT32 std::atomic +#endif -/* -Minimum margin between suballocations, in bytes. -Set nonzero for debugging purposes only. -*/ -static const VkDeviceSize VMA_DEBUG_MARGIN = 0; +#ifndef VMA_BEST_FIT + /** + Main parameter for function assessing how good is a free suballocation for a new + allocation request. -/* -Set this to 1 for debugging purposes only, to enable single mutex protecting all -entry calls to the library. Can be useful for debugging multithreading issues. -*/ -#define VMA_DEBUG_GLOBAL_MUTEX 0 + - Set to 1 to use Best-Fit algorithm - prefer smaller blocks, as close to the + size of requested allocations as possible. + - Set to 0 to use Worst-Fit algorithm - prefer larger blocks, as large as + possible. -/* -Minimum value for VkPhysicalDeviceLimits::bufferImageGranularity. -Set to more than 1 for debugging purposes only. Must be power of two. -*/ -static const VkDeviceSize VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY = 1; + Experiments in special testing environment showed that Best-Fit algorithm is + better. + */ + #define VMA_BEST_FIT (1) +#endif + +#ifndef VMA_DEBUG_ALWAYS_DEDICATED_MEMORY + /** + Every allocation will have its own memory block. + Define to 1 for debugging purposes only. + */ + #define VMA_DEBUG_ALWAYS_DEDICATED_MEMORY (0) +#endif + +#ifndef VMA_DEBUG_ALIGNMENT + /** + Minimum alignment of all suballocations, in bytes. + Set to more than 1 for debugging purposes only. Must be power of two. + */ + #define VMA_DEBUG_ALIGNMENT (1) +#endif -// Maximum size of a memory heap in Vulkan to consider it "small". -static const VkDeviceSize VMA_SMALL_HEAP_MAX_SIZE = 512 * 1024 * 1024; -// Default size of a block allocated as single VkDeviceMemory from a "large" heap. -static const VkDeviceSize VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE = 256 * 1024 * 1024; -// Default size of a block allocated as single VkDeviceMemory from a "small" heap. -static const VkDeviceSize VMA_DEFAULT_SMALL_HEAP_BLOCK_SIZE = 64 * 1024 * 1024; +#ifndef VMA_DEBUG_MARGIN + /** + Minimum margin between suballocations, in bytes. + Set nonzero for debugging purposes only. + */ + #define VMA_DEBUG_MARGIN (0) +#endif + +#ifndef VMA_DEBUG_GLOBAL_MUTEX + /** + Set this to 1 for debugging purposes only, to enable single mutex protecting all + entry calls to the library. Can be useful for debugging multithreading issues. + */ + #define VMA_DEBUG_GLOBAL_MUTEX (0) +#endif + +#ifndef VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY + /** + Minimum value for VkPhysicalDeviceLimits::bufferImageGranularity. + Set to more than 1 for debugging purposes only. Must be power of two. + */ + #define VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY (1) +#endif + +#ifndef VMA_SMALL_HEAP_MAX_SIZE + /// Maximum size of a memory heap in Vulkan to consider it "small". + #define VMA_SMALL_HEAP_MAX_SIZE (1024ull * 1024 * 1024) +#endif + +#ifndef VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE + /// Default size of a block allocated as single VkDeviceMemory from a "large" heap. + #define VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE (256ull * 1024 * 1024) +#endif + +static const uint32_t VMA_FRAME_INDEX_LOST = UINT32_MAX; /******************************************************************************* END OF CONFIGURATION @@ -622,7 +2457,7 @@ static VkAllocationCallbacks VmaEmptyAllocationCallbacks = { VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL }; // Returns number of bits set to 1 in (v). -static inline uint32_t CountBitsSet(uint32_t v) +static inline uint32_t VmaCountBitsSet(uint32_t v) { uint32_t c = v - ((v >> 1) & 0x55555555); c = ((c >> 2) & 0x33333333) + (c & 0x33333333); @@ -646,6 +2481,47 @@ inline T VmaRoundDiv(T x, T y) { return (x + (y / (T)2)) / y; } + +#ifndef VMA_SORT + +template +Iterator VmaQuickSortPartition(Iterator beg, Iterator end, Compare cmp) +{ + Iterator centerValue = end; --centerValue; + Iterator insertIndex = beg; + for(Iterator memTypeIndex = beg; memTypeIndex < centerValue; ++memTypeIndex) + { + if(cmp(*memTypeIndex, *centerValue)) + { + if(insertIndex != memTypeIndex) + { + VMA_SWAP(*memTypeIndex, *insertIndex); + } + ++insertIndex; + } + } + if(insertIndex != centerValue) + { + VMA_SWAP(*insertIndex, *centerValue); + } + return insertIndex; +} + +template +void VmaQuickSort(Iterator beg, Iterator end, Compare cmp) +{ + if(beg < end) + { + Iterator it = VmaQuickSortPartition(beg, end, cmp); + VmaQuickSort(beg, it, cmp); + VmaQuickSort(it + 1, end, cmp); + } +} + +#define VMA_SORT(beg, end, cmp) VmaQuickSort(beg, end, cmp) + +#endif // #ifndef VMA_SORT + /* Returns true if two memory blocks occupy overlapping pages. ResourceA must be in less memory offset than ResourceB. @@ -689,7 +2565,9 @@ static inline bool VmaIsBufferImageGranularityConflict( VmaSuballocationType suballocType2) { if(suballocType1 > suballocType2) + { VMA_SWAP(suballocType1, suballocType2); + } switch(suballocType1) { @@ -721,17 +2599,30 @@ static inline bool VmaIsBufferImageGranularityConflict( struct VmaMutexLock { public: - VmaMutexLock(VmaMutex& mutex) : m_Mutex(mutex) { mutex.Lock(); } - ~VmaMutexLock() { m_Mutex.Unlock(); } + VmaMutexLock(VMA_MUTEX& mutex, bool useMutex) : + m_pMutex(useMutex ? &mutex : VMA_NULL) + { + if(m_pMutex) + { + m_pMutex->Lock(); + } + } + + ~VmaMutexLock() + { + if(m_pMutex) + { + m_pMutex->Unlock(); + } + } - VmaMutexLock& operator=(const VmaMutexLock&) = delete; private: - VmaMutex& m_Mutex; + VMA_MUTEX* m_pMutex; }; #if VMA_DEBUG_GLOBAL_MUTEX - static VmaMutex gDebugGlobalMutex; - #define VMA_DEBUG_GLOBAL_MUTEX_LOCK VmaMutexLock debugGlobalMutexLock(gDebugGlobalMutex); + static VMA_MUTEX gDebugGlobalMutex; + #define VMA_DEBUG_GLOBAL_MUTEX_LOCK VmaMutexLock debugGlobalMutexLock(gDebugGlobalMutex, true); #else #define VMA_DEBUG_GLOBAL_MUTEX_LOCK #endif @@ -751,16 +2642,20 @@ new element with value (key) should be inserted. template static IterT VmaBinaryFindFirstNotLess(IterT beg, IterT end, const KeyT &key, CmpT cmp) { - size_t down = 0, up = (end - beg); - while(down < up) - { - const size_t mid = (down + up) / 2; - if(cmp(*(beg+mid), key)) - down = mid + 1; - else - up = mid; - } - return beg + down; + size_t down = 0, up = (end - beg); + while(down < up) + { + const size_t mid = (down + up) / 2; + if(cmp(*(beg+mid), key)) + { + down = mid + 1; + } + else + { + up = mid; + } + } + return beg + down; } //////////////////////////////////////////////////////////////////////////////// @@ -825,7 +2720,9 @@ static void vma_delete_array(const VkAllocationCallbacks* pAllocationCallbacks, if(ptr != VMA_NULL) { for(size_t i = count; i--; ) + { ptr[i].~T(); + } VmaFree(pAllocationCallbacks, ptr); } } @@ -863,13 +2760,13 @@ class VmaStlAllocator #define VmaVector std::vector template -static void VectorInsert(std::vector& vec, size_t index, const T& item) +static void VmaVectorInsert(std::vector& vec, size_t index, const T& item) { vec.insert(vec.begin() + index, item); } template -static void VectorRemove(std::vector& vec, size_t index) +static void VmaVectorRemove(std::vector& vec, size_t index) { vec.erase(vec.begin() + index); } @@ -883,6 +2780,8 @@ template class VmaVector { public: + typedef T value_type; + VmaVector(const AllocatorT& allocator) : m_Allocator(allocator), m_pArray(VMA_NULL), @@ -891,17 +2790,9 @@ class VmaVector { } - VmaVector(AllocatorT& allocator) : - m_Allocator(allocator), - m_pArray(VMA_NULL), - m_Count(0), - m_Capacity(0) - { - } - - VmaVector(size_t count, AllocatorT& allocator) : + VmaVector(size_t count, const AllocatorT& allocator) : m_Allocator(allocator), - m_pArray(count ? (T*)VmaAllocateArray(allocator->m_pCallbacks, count) : VMA_NULL), + m_pArray(count ? (T*)VmaAllocateArray(allocator.m_pCallbacks, count) : VMA_NULL), m_Count(count), m_Capacity(count) { @@ -909,12 +2800,14 @@ class VmaVector VmaVector(const VmaVector& src) : m_Allocator(src.m_Allocator), - m_pArray(src.m_Count ? (T*)VmaAllocateArray(src->m_pCallbacks, src.m_Count) : VMA_NULL), + m_pArray(src.m_Count ? (T*)VmaAllocateArray(src.m_Allocator.m_pCallbacks, src.m_Count) : VMA_NULL), m_Count(src.m_Count), m_Capacity(src.m_Count) { if(m_Count != 0) + { memcpy(m_pArray, src.m_pArray, m_Count * sizeof(T)); + } } ~VmaVector() @@ -928,7 +2821,9 @@ class VmaVector { resize(rhs.m_Count); if(m_Count != 0) + { memcpy(m_pArray, rhs.m_pArray, m_Count * sizeof(T)); + } } return *this; } @@ -975,13 +2870,17 @@ class VmaVector newCapacity = VMA_MAX(newCapacity, m_Count); if((newCapacity < m_Capacity) && !freeMemory) + { newCapacity = m_Capacity; + } if(newCapacity != m_Capacity) { T* const newArray = newCapacity ? VmaAllocateArray(m_Allocator, newCapacity) : VMA_NULL; if(m_Count != 0) + { memcpy(newArray, m_pArray, m_Count * sizeof(T)); + } VmaFree(m_Allocator.m_pCallbacks, m_pArray); m_Capacity = newCapacity; m_pArray = newArray; @@ -992,16 +2891,22 @@ class VmaVector { size_t newCapacity = m_Capacity; if(newCount > m_Capacity) + { newCapacity = VMA_MAX(newCount, VMA_MAX(m_Capacity * 3 / 2, (size_t)8)); + } else if(freeMemory) + { newCapacity = newCount; + } if(newCapacity != m_Capacity) { T* const newArray = newCapacity ? VmaAllocateArray(m_Allocator.m_pCallbacks, newCapacity) : VMA_NULL; const size_t elementsToCopy = VMA_MIN(m_Count, newCount); if(elementsToCopy != 0) + { memcpy(newArray, m_pArray, elementsToCopy * sizeof(T)); + } VmaFree(m_Allocator.m_pCallbacks, m_pArray); m_Capacity = newCapacity; m_pArray = newArray; @@ -1021,7 +2926,9 @@ class VmaVector const size_t oldCount = size(); resize(oldCount + 1); if(index < oldCount) + { memmove(m_pArray + (index + 1), m_pArray + index, (oldCount - index) * sizeof(T)); + } m_pArray[index] = src; } @@ -1030,7 +2937,9 @@ class VmaVector VMA_HEAVY_ASSERT(index < m_Count); const size_t oldCount = size(); if(index < oldCount - 1) + { memmove(m_pArray + index, m_pArray + (index + 1), (oldCount - index - 1) * sizeof(T)); + } resize(oldCount - 1); } @@ -1071,19 +2980,68 @@ class VmaVector }; template -static void VectorInsert(VmaVector& vec, size_t index, const T& item) +static void VmaVectorInsert(VmaVector& vec, size_t index, const T& item) { vec.insert(index, item); } template -static void VectorRemove(VmaVector& vec, size_t index) +static void VmaVectorRemove(VmaVector& vec, size_t index) { vec.remove(index); } #endif // #if VMA_USE_STL_VECTOR +template +size_t VmaVectorInsertSorted(VectorT& vector, const typename VectorT::value_type& value) +{ + const size_t indexToInsert = VmaBinaryFindFirstNotLess( + vector.data(), + vector.data() + vector.size(), + value, + CmpLess()) - vector.data(); + VmaVectorInsert(vector, indexToInsert, value); + return indexToInsert; +} + +template +bool VmaVectorRemoveSorted(VectorT& vector, const typename VectorT::value_type& value) +{ + CmpLess comparator; + typename VectorT::iterator it = VmaBinaryFindFirstNotLess( + vector.begin(), + vector.end(), + value, + comparator); + if((it != vector.end()) && !comparator(*it, value) && !comparator(value, *it)) + { + size_t indexToRemove = it - vector.begin(); + VmaVectorRemove(vector, indexToRemove); + return true; + } + return false; +} + +template +size_t VmaVectorFindSorted(const VectorT& vector, const typename VectorT::value_type& value) +{ + CmpLess comparator; + typename VectorT::iterator it = VmaBinaryFindFirstNotLess( + vector.data(), + vector.data() + vector.size(), + value, + comparator); + if(it != vector.size() && !comparator(*it, value) && !comparator(value, *it)) + { + return it - vector.begin(); + } + else + { + return vector.size(); + } +} + //////////////////////////////////////////////////////////////////////////////// // class VmaPoolAllocator @@ -1373,7 +3331,9 @@ void VmaRawList::PopBack() ItemType* const pBackItem = m_pBack; ItemType* const pPrevItem = pBackItem->pPrev; if(pPrevItem != VMA_NULL) + { pPrevItem->pNext = VMA_NULL; + } m_pBack = pPrevItem; m_ItemAllocator.Free(pBackItem); --m_Count; @@ -1386,7 +3346,9 @@ void VmaRawList::PopFront() ItemType* const pFrontItem = m_pFront; ItemType* const pNextItem = pFrontItem->pNext; if(pNextItem != VMA_NULL) + { pNextItem->pPrev = VMA_NULL; + } m_pFront = pNextItem; m_ItemAllocator.Free(pFrontItem); --m_Count; @@ -1399,7 +3361,9 @@ void VmaRawList::Remove(ItemType* pItem) VMA_HEAVY_ASSERT(m_Count > 0); if(pItem->pPrev != VMA_NULL) + { pItem->pPrev->pNext = pItem->pNext; + } else { VMA_HEAVY_ASSERT(m_pFront == pItem); @@ -1407,7 +3371,9 @@ void VmaRawList::Remove(ItemType* pItem) } if(pItem->pNext != VMA_NULL) + { pItem->pNext->pPrev = pItem->pPrev; + } else { VMA_HEAVY_ASSERT(m_pBack == pItem); @@ -1429,10 +3395,12 @@ VmaListItem* VmaRawList::InsertBefore(ItemType* pItem) newItem->pNext = pItem; pItem->pPrev = newItem; if(prevItem != VMA_NULL) + { prevItem->pNext = newItem; + } else { - VMA_HEAVY_ASSERT(m_pFront = pItem); + VMA_HEAVY_ASSERT(m_pFront == pItem); m_pFront = newItem; } ++m_Count; @@ -1453,10 +3421,12 @@ VmaListItem* VmaRawList::InsertAfter(ItemType* pItem) newItem->pPrev = pItem; pItem->pNext = newItem; if(nextItem != VMA_NULL) + { nextItem->pPrev = newItem; + } else { - VMA_HEAVY_ASSERT(m_pBack = pItem); + VMA_HEAVY_ASSERT(m_pBack == pItem); m_pBack = newItem; } ++m_Count; @@ -1515,10 +3485,12 @@ class VmaList iterator& operator--() { if(m_pItem != VMA_NULL) + { m_pItem = m_pItem->pPrev; + } else { - VMA_HEAVY_ASSERT(!m_pList.IsEmpty()); + VMA_HEAVY_ASSERT(!m_pList->IsEmpty()); m_pItem = m_pList->Back(); } return *this; @@ -1547,7 +3519,7 @@ class VmaList VMA_HEAVY_ASSERT(m_pList == rhs.m_pList); return m_pItem != rhs.m_pItem; } - + private: VmaRawList* m_pList; VmaListItem* m_pItem; @@ -1559,7 +3531,6 @@ class VmaList } friend class VmaList; - //friend class VmaList::const_iterator; }; class const_iterator @@ -1597,7 +3568,9 @@ class VmaList const_iterator& operator--() { if(m_pItem != VMA_NULL) + { m_pItem = m_pItem->pPrev; + } else { VMA_HEAVY_ASSERT(!m_pList->IsEmpty()); @@ -1643,7 +3616,6 @@ class VmaList friend class VmaList; }; - VmaList(AllocatorT& allocator) : m_RawList(allocator.m_pCallbacks) { } VmaList(const AllocatorT& allocator) : m_RawList(allocator.m_pCallbacks) { } bool empty() const { return m_RawList.IsEmpty(); } @@ -1669,6 +3641,9 @@ class VmaList //////////////////////////////////////////////////////////////////////////////// // class VmaMap +// Unused in this version. +#if 0 + #if VMA_USE_STL_UNORDERED_MAP #define VmaPair std::pair @@ -1698,7 +3673,6 @@ class VmaMap typedef VmaPair PairType; typedef PairType* iterator; - VmaMap(VmaStlAllocator& allocator) : m_Vector(allocator) { } VmaMap(const VmaStlAllocator& allocator) : m_Vector(allocator) { } iterator begin() { return m_Vector.begin(); } @@ -1735,7 +3709,7 @@ void VmaMap::insert(const PairType& pair) m_Vector.data() + m_Vector.size(), pair, VmaPairFirstLess()) - m_Vector.data(); - VectorInsert(m_Vector, indexToInsert, pair); + VmaVectorInsert(m_Vector, indexToInsert, pair); } template @@ -1747,111 +3721,360 @@ VmaPair* VmaMap::find(const KeyT& key) key, VmaPairFirstLess()); if((it != m_Vector.end()) && (it->first == key)) + { return it; + } else + { return m_Vector.end(); + } } template void VmaMap::erase(iterator it) { - VectorRemove(m_Vector, it - m_Vector.begin()); + VmaVectorRemove(m_Vector, it - m_Vector.begin()); } #endif // #if VMA_USE_STL_UNORDERED_MAP +#endif // #if 0 + +//////////////////////////////////////////////////////////////////////////////// + +class VmaDeviceMemoryBlock; + +struct VmaAllocation_T +{ +private: + static const uint8_t MAP_COUNT_FLAG_PERSISTENT_MAP = 0x80; + + enum FLAGS + { + FLAG_USER_DATA_STRING = 0x01, + }; + +public: + enum ALLOCATION_TYPE + { + ALLOCATION_TYPE_NONE, + ALLOCATION_TYPE_BLOCK, + ALLOCATION_TYPE_DEDICATED, + }; + + VmaAllocation_T(uint32_t currentFrameIndex, bool userDataString) : + m_Alignment(1), + m_Size(0), + m_pUserData(VMA_NULL), + m_LastUseFrameIndex(currentFrameIndex), + m_Type((uint8_t)ALLOCATION_TYPE_NONE), + m_SuballocationType((uint8_t)VMA_SUBALLOCATION_TYPE_UNKNOWN), + m_MapCount(0), + m_Flags(userDataString ? (uint8_t)FLAG_USER_DATA_STRING : 0) + { + } + + ~VmaAllocation_T() + { + VMA_ASSERT((m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP) == 0 && "Allocation was not unmapped before destruction."); + + // Check if owned string was freed. + VMA_ASSERT(m_pUserData == VMA_NULL); + } + + void InitBlockAllocation( + VmaPool hPool, + VmaDeviceMemoryBlock* block, + VkDeviceSize offset, + VkDeviceSize alignment, + VkDeviceSize size, + VmaSuballocationType suballocationType, + bool mapped, + bool canBecomeLost) + { + VMA_ASSERT(m_Type == ALLOCATION_TYPE_NONE); + VMA_ASSERT(block != VMA_NULL); + m_Type = (uint8_t)ALLOCATION_TYPE_BLOCK; + m_Alignment = alignment; + m_Size = size; + m_MapCount = mapped ? MAP_COUNT_FLAG_PERSISTENT_MAP : 0; + m_SuballocationType = (uint8_t)suballocationType; + m_BlockAllocation.m_hPool = hPool; + m_BlockAllocation.m_Block = block; + m_BlockAllocation.m_Offset = offset; + m_BlockAllocation.m_CanBecomeLost = canBecomeLost; + } + + void InitLost() + { + VMA_ASSERT(m_Type == ALLOCATION_TYPE_NONE); + VMA_ASSERT(m_LastUseFrameIndex.load() == VMA_FRAME_INDEX_LOST); + m_Type = (uint8_t)ALLOCATION_TYPE_BLOCK; + m_BlockAllocation.m_hPool = VK_NULL_HANDLE; + m_BlockAllocation.m_Block = VMA_NULL; + m_BlockAllocation.m_Offset = 0; + m_BlockAllocation.m_CanBecomeLost = true; + } + + void ChangeBlockAllocation( + VmaAllocator hAllocator, + VmaDeviceMemoryBlock* block, + VkDeviceSize offset); + + // pMappedData not null means allocation is created with MAPPED flag. + void InitDedicatedAllocation( + uint32_t memoryTypeIndex, + VkDeviceMemory hMemory, + VmaSuballocationType suballocationType, + void* pMappedData, + VkDeviceSize size) + { + VMA_ASSERT(m_Type == ALLOCATION_TYPE_NONE); + VMA_ASSERT(hMemory != VK_NULL_HANDLE); + m_Type = (uint8_t)ALLOCATION_TYPE_DEDICATED; + m_Alignment = 0; + m_Size = size; + m_SuballocationType = (uint8_t)suballocationType; + m_MapCount = (pMappedData != VMA_NULL) ? MAP_COUNT_FLAG_PERSISTENT_MAP : 0; + m_DedicatedAllocation.m_MemoryTypeIndex = memoryTypeIndex; + m_DedicatedAllocation.m_hMemory = hMemory; + m_DedicatedAllocation.m_pMappedData = pMappedData; + } + + ALLOCATION_TYPE GetType() const { return (ALLOCATION_TYPE)m_Type; } + VkDeviceSize GetAlignment() const { return m_Alignment; } + VkDeviceSize GetSize() const { return m_Size; } + bool IsUserDataString() const { return (m_Flags & FLAG_USER_DATA_STRING) != 0; } + void* GetUserData() const { return m_pUserData; } + void SetUserData(VmaAllocator hAllocator, void* pUserData); + VmaSuballocationType GetSuballocationType() const { return (VmaSuballocationType)m_SuballocationType; } + + VmaDeviceMemoryBlock* GetBlock() const + { + VMA_ASSERT(m_Type == ALLOCATION_TYPE_BLOCK); + return m_BlockAllocation.m_Block; + } + VkDeviceSize GetOffset() const; + VkDeviceMemory GetMemory() const; + uint32_t GetMemoryTypeIndex() const; + bool IsPersistentMap() const { return (m_MapCount & MAP_COUNT_FLAG_PERSISTENT_MAP) != 0; } + void* GetMappedData() const; + bool CanBecomeLost() const; + VmaPool GetPool() const; + + uint32_t GetLastUseFrameIndex() const + { + return m_LastUseFrameIndex.load(); + } + bool CompareExchangeLastUseFrameIndex(uint32_t& expected, uint32_t desired) + { + return m_LastUseFrameIndex.compare_exchange_weak(expected, desired); + } + /* + - If hAllocation.LastUseFrameIndex + frameInUseCount < allocator.CurrentFrameIndex, + makes it lost by setting LastUseFrameIndex = VMA_FRAME_INDEX_LOST and returns true. + - Else, returns false. + + If hAllocation is already lost, assert - you should not call it then. + If hAllocation was not created with CAN_BECOME_LOST_BIT, assert. + */ + bool MakeLost(uint32_t currentFrameIndex, uint32_t frameInUseCount); + + void DedicatedAllocCalcStatsInfo(VmaStatInfo& outInfo) + { + VMA_ASSERT(m_Type == ALLOCATION_TYPE_DEDICATED); + outInfo.blockCount = 1; + outInfo.allocationCount = 1; + outInfo.unusedRangeCount = 0; + outInfo.usedBytes = m_Size; + outInfo.unusedBytes = 0; + outInfo.allocationSizeMin = outInfo.allocationSizeMax = m_Size; + outInfo.unusedRangeSizeMin = UINT64_MAX; + outInfo.unusedRangeSizeMax = 0; + } + + void BlockAllocMap(); + void BlockAllocUnmap(); + VkResult DedicatedAllocMap(VmaAllocator hAllocator, void** ppData); + void DedicatedAllocUnmap(VmaAllocator hAllocator); + +private: + VkDeviceSize m_Alignment; + VkDeviceSize m_Size; + void* m_pUserData; + VMA_ATOMIC_UINT32 m_LastUseFrameIndex; + uint8_t m_Type; // ALLOCATION_TYPE + uint8_t m_SuballocationType; // VmaSuballocationType + // Bit 0x80 is set when allocation was created with VMA_ALLOCATION_CREATE_MAPPED_BIT. + // Bits with mask 0x7F are reference counter for vmaMapMemory()/vmaUnmapMemory(). + uint8_t m_MapCount; + uint8_t m_Flags; // enum FLAGS + + // Allocation out of VmaDeviceMemoryBlock. + struct BlockAllocation + { + VmaPool m_hPool; // Null if belongs to general memory. + VmaDeviceMemoryBlock* m_Block; + VkDeviceSize m_Offset; + bool m_CanBecomeLost; + }; + + // Allocation for an object that has its own private VkDeviceMemory. + struct DedicatedAllocation + { + uint32_t m_MemoryTypeIndex; + VkDeviceMemory m_hMemory; + void* m_pMappedData; // Not null means memory is mapped. + }; + + union + { + // Allocation out of VmaDeviceMemoryBlock. + BlockAllocation m_BlockAllocation; + // Allocation for an object that has its own private VkDeviceMemory. + DedicatedAllocation m_DedicatedAllocation; + }; + + void FreeUserDataString(VmaAllocator hAllocator); +}; + /* -Represents a region of VmaAllocation that is either assigned and returned as +Represents a region of VmaDeviceMemoryBlock that is either assigned and returned as allocated memory block or free. */ struct VmaSuballocation { VkDeviceSize offset; VkDeviceSize size; + VmaAllocation hAllocation; VmaSuballocationType type; }; typedef VmaList< VmaSuballocation, VmaStlAllocator > VmaSuballocationList; -// Parameters of an allocation. +// Cost of one additional allocation lost, as equivalent in bytes. +static const VkDeviceSize VMA_LOST_ALLOCATION_COST = 1048576; + +/* +Parameters of planned allocation inside a VmaDeviceMemoryBlock. + +If canMakeOtherLost was false: +- item points to a FREE suballocation. +- itemsToMakeLostCount is 0. + +If canMakeOtherLost was true: +- item points to first of sequence of suballocations, which are either FREE, + or point to VmaAllocations that can become lost. +- itemsToMakeLostCount is the number of VmaAllocations that need to be made lost for + the requested allocation to succeed. +*/ struct VmaAllocationRequest { - VmaSuballocationList::iterator freeSuballocationItem; VkDeviceSize offset; + VkDeviceSize sumFreeSize; // Sum size of free items that overlap with proposed allocation. + VkDeviceSize sumItemSize; // Sum size of items to make lost that overlap with proposed allocation. + VmaSuballocationList::iterator item; + size_t itemsToMakeLostCount; + + VkDeviceSize CalcCost() const + { + return sumItemSize + itemsToMakeLostCount * VMA_LOST_ALLOCATION_COST; + } }; -/* Single block of memory - VkDeviceMemory with all the data about its regions -assigned or free. */ -class VmaAllocation +/* +Data structure used for bookkeeping of allocations and unused ranges of memory +in a single VkDeviceMemory block. +*/ +class VmaBlockMetadata { public: - VkDeviceMemory m_hMemory; - VkDeviceSize m_Size; - uint32_t m_FreeCount; - VkDeviceSize m_SumFreeSize; - VmaSuballocationList m_Suballocations; - // Suballocations that are free and have size greater than certain threshold. - // Sorted by size, ascending. - VmaVector< VmaSuballocationList::iterator, VmaStlAllocator< VmaSuballocationList::iterator > > m_FreeSuballocationsBySize; - - VmaAllocation(VmaAllocator hAllocator); + VmaBlockMetadata(VmaAllocator hAllocator); + ~VmaBlockMetadata(); + void Init(VkDeviceSize size); - ~VmaAllocation() - { - VMA_ASSERT(m_hMemory == VK_NULL_HANDLE); - } - - // Always call after construction. - void Init(VkDeviceMemory newMemory, VkDeviceSize newSize); - // Always call before destruction. - void Destroy(VmaAllocator allocator); - // Validates all data structures inside this object. If not valid, returns false. bool Validate() const; - - // Tries to find a place for suballocation with given parameters inside this allocation. + VkDeviceSize GetSize() const { return m_Size; } + size_t GetAllocationCount() const { return m_Suballocations.size() - m_FreeCount; } + VkDeviceSize GetSumFreeSize() const { return m_SumFreeSize; } + VkDeviceSize GetUnusedRangeSizeMax() const; + // Returns true if this block is empty - contains only single free suballocation. + bool IsEmpty() const; + + void CalcAllocationStatInfo(VmaStatInfo& outInfo) const; + void AddPoolStats(VmaPoolStats& inoutStats) const; + +#if VMA_STATS_STRING_ENABLED + void PrintDetailedMap(class VmaJsonWriter& json) const; +#endif + + // Creates trivial request for case when block is empty. + void CreateFirstAllocationRequest(VmaAllocationRequest* pAllocationRequest); + + // Tries to find a place for suballocation with given parameters inside this block. // If succeeded, fills pAllocationRequest and returns true. // If failed, returns false. bool CreateAllocationRequest( + uint32_t currentFrameIndex, + uint32_t frameInUseCount, VkDeviceSize bufferImageGranularity, VkDeviceSize allocSize, VkDeviceSize allocAlignment, VmaSuballocationType allocType, + bool canMakeOtherLost, VmaAllocationRequest* pAllocationRequest); - // Checks if requested suballocation with given parameters can be placed in given pFreeSuballocItem. - // If yes, fills pOffset and returns true. If no, returns false. - bool CheckAllocation( - VkDeviceSize bufferImageGranularity, - VkDeviceSize allocSize, - VkDeviceSize allocAlignment, - VmaSuballocationType allocType, - VmaSuballocationList::const_iterator freeSuballocItem, - VkDeviceSize* pOffset) const; - - // Returns true if this allocation is empty - contains only single free suballocation. - bool IsEmpty() const; + bool MakeRequestedAllocationsLost( + uint32_t currentFrameIndex, + uint32_t frameInUseCount, + VmaAllocationRequest* pAllocationRequest); - // Makes actual allocation based on request. Request must already be checked - // and valid. + uint32_t MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount); + + // Makes actual allocation based on request. Request must already be checked and valid. void Alloc( const VmaAllocationRequest& request, VmaSuballocationType type, - VkDeviceSize allocSize); + VkDeviceSize allocSize, + VmaAllocation hAllocation); // Frees suballocation assigned to given memory region. - void Free(const VkMappedMemoryRange* pMemory); - -#if VMA_STATS_STRING_ENABLED - void PrintDetailedMap(class VmaStringBuilder& sb) const; -#endif + void Free(const VmaAllocation allocation); + void FreeAtOffset(VkDeviceSize offset); private: + VkDeviceSize m_Size; + uint32_t m_FreeCount; + VkDeviceSize m_SumFreeSize; + VmaSuballocationList m_Suballocations; + // Suballocations that are free and have size greater than certain threshold. + // Sorted by size, ascending. + VmaVector< VmaSuballocationList::iterator, VmaStlAllocator< VmaSuballocationList::iterator > > m_FreeSuballocationsBySize; + + bool ValidateFreeSuballocationList() const; + + // Checks if requested suballocation with given parameters can be placed in given pFreeSuballocItem. + // If yes, fills pOffset and returns true. If no, returns false. + bool CheckAllocation( + uint32_t currentFrameIndex, + uint32_t frameInUseCount, + VkDeviceSize bufferImageGranularity, + VkDeviceSize allocSize, + VkDeviceSize allocAlignment, + VmaSuballocationType allocType, + VmaSuballocationList::const_iterator suballocItem, + bool canMakeOtherLost, + VkDeviceSize* pOffset, + size_t* itemsToMakeLostCount, + VkDeviceSize* pSumFreeSize, + VkDeviceSize* pSumItemSize) const; // Given free suballocation, it merges it with following one, which must also be free. void MergeFreeWithNext(VmaSuballocationList::iterator item); - // Releases given suballocation, making it free. Merges it with adjacent free - // suballocations if applicable. - void FreeSuballocation(VmaSuballocationList::iterator suballocItem); + // Releases given suballocation, making it free. + // Merges it with adjacent free suballocations if applicable. + // Returns iterator to new free suballocation at this place. + VmaSuballocationList::iterator FreeSuballocation(VmaSuballocationList::iterator suballocItem); // Given free suballocation, it inserts it into sorted list of // m_FreeSuballocationsBySize if it's suitable. void RegisterFreeSuballocation(VmaSuballocationList::iterator item); @@ -1860,88 +4083,342 @@ class VmaAllocation void UnregisterFreeSuballocation(VmaSuballocationList::iterator item); }; -// Allocation for an object that has its own private VkDeviceMemory. -struct VmaOwnAllocation +/* +Represents a single block of device memory (`VkDeviceMemory`) with all the +data about its regions (aka suballocations, #VmaAllocation), assigned and free. + +Thread-safety: This class must be externally synchronized. +*/ +class VmaDeviceMemoryBlock { +public: + VmaBlockMetadata m_Metadata; + + VmaDeviceMemoryBlock(VmaAllocator hAllocator); + + ~VmaDeviceMemoryBlock() + { + VMA_ASSERT(m_MapCount == 0 && "VkDeviceMemory block is being destroyed while it is still mapped."); + VMA_ASSERT(m_hMemory == VK_NULL_HANDLE); + } + + // Always call after construction. + void Init( + uint32_t newMemoryTypeIndex, + VkDeviceMemory newMemory, + VkDeviceSize newSize); + // Always call before destruction. + void Destroy(VmaAllocator allocator); + + VkDeviceMemory GetDeviceMemory() const { return m_hMemory; } + uint32_t GetMemoryTypeIndex() const { return m_MemoryTypeIndex; } + void* GetMappedData() const { return m_pMappedData; } + + // Validates all data structures inside this object. If not valid, returns false. + bool Validate() const; + + // ppData can be null. + VkResult Map(VmaAllocator hAllocator, uint32_t count, void** ppData); + void Unmap(VmaAllocator hAllocator, uint32_t count); + + VkResult BindBufferMemory( + const VmaAllocator hAllocator, + const VmaAllocation hAllocation, + VkBuffer hBuffer); + VkResult BindImageMemory( + const VmaAllocator hAllocator, + const VmaAllocation hAllocation, + VkImage hImage); + +private: + uint32_t m_MemoryTypeIndex; VkDeviceMemory m_hMemory; - VkDeviceSize m_Size; - VmaSuballocationType m_Type; + + // Protects access to m_hMemory so it's not used by multiple threads simultaneously, e.g. vkMapMemory, vkBindBufferMemory. + // Also protects m_MapCount, m_pMappedData. + VMA_MUTEX m_Mutex; + uint32_t m_MapCount; + void* m_pMappedData; }; -struct VmaOwnAllocationMemoryHandleLess +struct VmaPointerLess { - bool operator()(const VmaOwnAllocation& lhs, const VmaOwnAllocation& rhs) const - { - return lhs.m_hMemory < rhs.m_hMemory; - } - bool operator()(const VmaOwnAllocation& lhs, VkDeviceMemory rhsMem) const + bool operator()(const void* lhs, const void* rhs) const { - return lhs.m_hMemory < rhsMem; + return lhs < rhs; } }; -/* Sequence of VmaAllocation. Represents memory blocks allocated for a specific -Vulkan memory type. */ -struct VmaAllocationVector -{ - // Incrementally sorted by sumFreeSize, ascending. - VmaVector< VmaAllocation*, VmaStlAllocator > m_Allocations; +class VmaDefragmentator; + +/* +Sequence of VmaDeviceMemoryBlock. Represents memory blocks allocated for a specific +Vulkan memory type. - VmaAllocationVector(VmaAllocator hAllocator); - ~VmaAllocationVector(); +Synchronized internally with a mutex. +*/ +struct VmaBlockVector +{ + VmaBlockVector( + VmaAllocator hAllocator, + uint32_t memoryTypeIndex, + VkDeviceSize preferredBlockSize, + size_t minBlockCount, + size_t maxBlockCount, + VkDeviceSize bufferImageGranularity, + uint32_t frameInUseCount, + bool isCustomPool); + ~VmaBlockVector(); - bool IsEmpty() const { return m_Allocations.empty(); } + VkResult CreateMinBlocks(); - // Tries to free memory from any if its Allocations. - // Returns index of Allocation that the memory was freed from, or -1 if not found. - size_t Free(const VkMappedMemoryRange* pMemory); + uint32_t GetMemoryTypeIndex() const { return m_MemoryTypeIndex; } + VkDeviceSize GetPreferredBlockSize() const { return m_PreferredBlockSize; } + VkDeviceSize GetBufferImageGranularity() const { return m_BufferImageGranularity; } + uint32_t GetFrameInUseCount() const { return m_FrameInUseCount; } - // Performs single step in sorting m_Allocations. They may not be fully sorted - // after this call. - void IncrementallySortAllocations(); - - // Adds statistics of this AllocationVector to pStats. - void AddStats(VmaStats* pStats, uint32_t memTypeIndex, uint32_t memHeapIndex) const; + void GetPoolStats(VmaPoolStats* pStats); + + bool IsEmpty() const { return m_Blocks.empty(); } + + VkResult Allocate( + VmaPool hCurrentPool, + uint32_t currentFrameIndex, + const VkMemoryRequirements& vkMemReq, + const VmaAllocationCreateInfo& createInfo, + VmaSuballocationType suballocType, + VmaAllocation* pAllocation); + + void Free( + VmaAllocation hAllocation); + + // Adds statistics of this BlockVector to pStats. + void AddStats(VmaStats* pStats); #if VMA_STATS_STRING_ENABLED - void PrintDetailedMap(class VmaStringBuilder& sb) const; + void PrintDetailedMap(class VmaJsonWriter& json); #endif -private: - VmaAllocator m_hAllocator; -}; + void MakePoolAllocationsLost( + uint32_t currentFrameIndex, + size_t* pLostAllocationCount); -// Main allocator object. -struct VmaAllocator_T -{ - VkDevice m_hDevice; - bool m_AllocationCallbacksSpecified; - VkAllocationCallbacks m_AllocationCallbacks; - VkDeviceSize m_PreferredLargeHeapBlockSize; - VkDeviceSize m_PreferredSmallHeapBlockSize; + VmaDefragmentator* EnsureDefragmentator( + VmaAllocator hAllocator, + uint32_t currentFrameIndex); - VkPhysicalDeviceProperties m_PhysicalDeviceProperties; - VkPhysicalDeviceMemoryProperties m_MemProps; + VkResult Defragment( + VmaDefragmentationStats* pDefragmentationStats, + VkDeviceSize& maxBytesToMove, + uint32_t& maxAllocationsToMove); + + void DestroyDefragmentator(); - VmaAllocationVector* m_pAllocations[VK_MAX_MEMORY_TYPES]; +private: + friend class VmaDefragmentator; + + const VmaAllocator m_hAllocator; + const uint32_t m_MemoryTypeIndex; + const VkDeviceSize m_PreferredBlockSize; + const size_t m_MinBlockCount; + const size_t m_MaxBlockCount; + const VkDeviceSize m_BufferImageGranularity; + const uint32_t m_FrameInUseCount; + const bool m_IsCustomPool; + VMA_MUTEX m_Mutex; + // Incrementally sorted by sumFreeSize, ascending. + VmaVector< VmaDeviceMemoryBlock*, VmaStlAllocator > m_Blocks; /* There can be at most one allocation that is completely empty - a hysteresis to avoid pessimistic case of alternating creation and destruction of a VkDeviceMemory. */ - bool m_HasEmptyAllocation[VK_MAX_MEMORY_TYPES]; - VmaMutex m_AllocationsMutex[VK_MAX_MEMORY_TYPES]; + bool m_HasEmptyBlock; + VmaDefragmentator* m_pDefragmentator; - // Each vector is sorted by memory (handle value). - typedef VmaVector< VmaOwnAllocation, VmaStlAllocator > OwnAllocationVectorType; - OwnAllocationVectorType* m_pOwnAllocations[VK_MAX_MEMORY_TYPES]; - VmaMutex m_OwnAllocationsMutex[VK_MAX_MEMORY_TYPES]; - - // Sorted by first (VkBuffer handle value). - VMA_MAP_TYPE(VkBuffer, VkMappedMemoryRange) m_BufferToMemoryMap; - VmaMutex m_BufferToMemoryMapMutex; - // Sorted by first (VkImage handle value). - VMA_MAP_TYPE(VkImage, VkMappedMemoryRange) m_ImageToMemoryMap; - VmaMutex m_ImageToMemoryMapMutex; + size_t CalcMaxBlockSize() const; + + // Finds and removes given block from vector. + void Remove(VmaDeviceMemoryBlock* pBlock); + + // Performs single step in sorting m_Blocks. They may not be fully sorted + // after this call. + void IncrementallySortBlocks(); + + VkResult CreateBlock(VkDeviceSize blockSize, size_t* pNewBlockIndex); +}; + +struct VmaPool_T +{ +public: + VmaBlockVector m_BlockVector; + + // Takes ownership. + VmaPool_T( + VmaAllocator hAllocator, + const VmaPoolCreateInfo& createInfo); + ~VmaPool_T(); + + VmaBlockVector& GetBlockVector() { return m_BlockVector; } + +#if VMA_STATS_STRING_ENABLED + //void PrintDetailedMap(class VmaStringBuilder& sb); +#endif +}; + +class VmaDefragmentator +{ + const VmaAllocator m_hAllocator; + VmaBlockVector* const m_pBlockVector; + uint32_t m_CurrentFrameIndex; + VkDeviceSize m_BytesMoved; + uint32_t m_AllocationsMoved; + + struct AllocationInfo + { + VmaAllocation m_hAllocation; + VkBool32* m_pChanged; + + AllocationInfo() : + m_hAllocation(VK_NULL_HANDLE), + m_pChanged(VMA_NULL) + { + } + }; + + struct AllocationInfoSizeGreater + { + bool operator()(const AllocationInfo& lhs, const AllocationInfo& rhs) const + { + return lhs.m_hAllocation->GetSize() > rhs.m_hAllocation->GetSize(); + } + }; + + // Used between AddAllocation and Defragment. + VmaVector< AllocationInfo, VmaStlAllocator > m_Allocations; + + struct BlockInfo + { + VmaDeviceMemoryBlock* m_pBlock; + bool m_HasNonMovableAllocations; + VmaVector< AllocationInfo, VmaStlAllocator > m_Allocations; + + BlockInfo(const VkAllocationCallbacks* pAllocationCallbacks) : + m_pBlock(VMA_NULL), + m_HasNonMovableAllocations(true), + m_Allocations(pAllocationCallbacks), + m_pMappedDataForDefragmentation(VMA_NULL) + { + } + + void CalcHasNonMovableAllocations() + { + const size_t blockAllocCount = m_pBlock->m_Metadata.GetAllocationCount(); + const size_t defragmentAllocCount = m_Allocations.size(); + m_HasNonMovableAllocations = blockAllocCount != defragmentAllocCount; + } + + void SortAllocationsBySizeDescecnding() + { + VMA_SORT(m_Allocations.begin(), m_Allocations.end(), AllocationInfoSizeGreater()); + } + + VkResult EnsureMapping(VmaAllocator hAllocator, void** ppMappedData); + void Unmap(VmaAllocator hAllocator); + + private: + // Not null if mapped for defragmentation only, not originally mapped. + void* m_pMappedDataForDefragmentation; + }; + + struct BlockPointerLess + { + bool operator()(const BlockInfo* pLhsBlockInfo, const VmaDeviceMemoryBlock* pRhsBlock) const + { + return pLhsBlockInfo->m_pBlock < pRhsBlock; + } + bool operator()(const BlockInfo* pLhsBlockInfo, const BlockInfo* pRhsBlockInfo) const + { + return pLhsBlockInfo->m_pBlock < pRhsBlockInfo->m_pBlock; + } + }; + + // 1. Blocks with some non-movable allocations go first. + // 2. Blocks with smaller sumFreeSize go first. + struct BlockInfoCompareMoveDestination + { + bool operator()(const BlockInfo* pLhsBlockInfo, const BlockInfo* pRhsBlockInfo) const + { + if(pLhsBlockInfo->m_HasNonMovableAllocations && !pRhsBlockInfo->m_HasNonMovableAllocations) + { + return true; + } + if(!pLhsBlockInfo->m_HasNonMovableAllocations && pRhsBlockInfo->m_HasNonMovableAllocations) + { + return false; + } + if(pLhsBlockInfo->m_pBlock->m_Metadata.GetSumFreeSize() < pRhsBlockInfo->m_pBlock->m_Metadata.GetSumFreeSize()) + { + return true; + } + return false; + } + }; + + typedef VmaVector< BlockInfo*, VmaStlAllocator > BlockInfoVector; + BlockInfoVector m_Blocks; + + VkResult DefragmentRound( + VkDeviceSize maxBytesToMove, + uint32_t maxAllocationsToMove); + + static bool MoveMakesSense( + size_t dstBlockIndex, VkDeviceSize dstOffset, + size_t srcBlockIndex, VkDeviceSize srcOffset); + +public: + VmaDefragmentator( + VmaAllocator hAllocator, + VmaBlockVector* pBlockVector, + uint32_t currentFrameIndex); + + ~VmaDefragmentator(); + + VkDeviceSize GetBytesMoved() const { return m_BytesMoved; } + uint32_t GetAllocationsMoved() const { return m_AllocationsMoved; } + + void AddAllocation(VmaAllocation hAlloc, VkBool32* pChanged); + + VkResult Defragment( + VkDeviceSize maxBytesToMove, + uint32_t maxAllocationsToMove); + + VmaDefragmentator& operator=(const VmaDefragmentator&) = delete; +}; + +// Main allocator object. +struct VmaAllocator_T +{ + bool m_UseMutex; + bool m_UseKhrDedicatedAllocation; + VkDevice m_hDevice; + bool m_AllocationCallbacksSpecified; + VkAllocationCallbacks m_AllocationCallbacks; + VmaDeviceMemoryCallbacks m_DeviceMemoryCallbacks; + // Number of bytes free out of limit, or VK_WHOLE_SIZE if not limit for that heap. + VkDeviceSize m_HeapSizeLimit[VK_MAX_MEMORY_HEAPS]; + VMA_MUTEX m_HeapSizeLimitMutex; + + VkPhysicalDeviceProperties m_PhysicalDeviceProperties; + VkPhysicalDeviceMemoryProperties m_MemProps; + + // Default pools. + VmaBlockVector* m_pBlockVectors[VK_MAX_MEMORY_TYPES]; + + // Each vector is sorted by memory (handle value). + typedef VmaVector< VmaAllocation, VmaStlAllocator > AllocationVectorType; + AllocationVectorType* m_pDedicatedAllocations[VK_MAX_MEMORY_TYPES]; + VMA_MUTEX m_DedicatedAllocationsMutex[VK_MAX_MEMORY_TYPES]; + VmaAllocator_T(const VmaAllocatorCreateInfo* pCreateInfo); ~VmaAllocator_T(); @@ -1949,55 +4426,134 @@ struct VmaAllocator_T { return m_AllocationCallbacksSpecified ? &m_AllocationCallbacks : 0; } - - VkDeviceSize GetPreferredBlockSize(uint32_t memTypeIndex) const; + const VmaVulkanFunctions& GetVulkanFunctions() const + { + return m_VulkanFunctions; + } VkDeviceSize GetBufferImageGranularity() const { return VMA_MAX( - VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY, + static_cast(VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY), m_PhysicalDeviceProperties.limits.bufferImageGranularity); } uint32_t GetMemoryHeapCount() const { return m_MemProps.memoryHeapCount; } uint32_t GetMemoryTypeCount() const { return m_MemProps.memoryTypeCount; } + uint32_t MemoryTypeIndexToHeapIndex(uint32_t memTypeIndex) const + { + VMA_ASSERT(memTypeIndex < m_MemProps.memoryTypeCount); + return m_MemProps.memoryTypes[memTypeIndex].heapIndex; + } + + bool IsIntegratedGpu() const + { + return m_PhysicalDeviceProperties.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU; + } + + void GetBufferMemoryRequirements( + VkBuffer hBuffer, + VkMemoryRequirements& memReq, + bool& requiresDedicatedAllocation, + bool& prefersDedicatedAllocation) const; + void GetImageMemoryRequirements( + VkImage hImage, + VkMemoryRequirements& memReq, + bool& requiresDedicatedAllocation, + bool& prefersDedicatedAllocation) const; + // Main allocation function. VkResult AllocateMemory( const VkMemoryRequirements& vkMemReq, - const VmaMemoryRequirements& vmaMemReq, + bool requiresDedicatedAllocation, + bool prefersDedicatedAllocation, + VkBuffer dedicatedBuffer, + VkImage dedicatedImage, + const VmaAllocationCreateInfo& createInfo, VmaSuballocationType suballocType, - VkMappedMemoryRange* pMemory, - uint32_t* pMemoryTypeIndex); + VmaAllocation* pAllocation); // Main deallocation function. - void FreeMemory(const VkMappedMemoryRange* pMemory); + void FreeMemory(const VmaAllocation allocation); void CalculateStats(VmaStats* pStats); #if VMA_STATS_STRING_ENABLED - void PrintDetailedMap(class VmaStringBuilder& sb); + void PrintDetailedMap(class VmaJsonWriter& json); #endif + VkResult Defragment( + VmaAllocation* pAllocations, + size_t allocationCount, + VkBool32* pAllocationsChanged, + const VmaDefragmentationInfo* pDefragmentationInfo, + VmaDefragmentationStats* pDefragmentationStats); + + void GetAllocationInfo(VmaAllocation hAllocation, VmaAllocationInfo* pAllocationInfo); + bool TouchAllocation(VmaAllocation hAllocation); + + VkResult CreatePool(const VmaPoolCreateInfo* pCreateInfo, VmaPool* pPool); + void DestroyPool(VmaPool pool); + void GetPoolStats(VmaPool pool, VmaPoolStats* pPoolStats); + + void SetCurrentFrameIndex(uint32_t frameIndex); + + void MakePoolAllocationsLost( + VmaPool hPool, + size_t* pLostAllocationCount); + + void CreateLostAllocation(VmaAllocation* pAllocation); + + VkResult AllocateVulkanMemory(const VkMemoryAllocateInfo* pAllocateInfo, VkDeviceMemory* pMemory); + void FreeVulkanMemory(uint32_t memoryType, VkDeviceSize size, VkDeviceMemory hMemory); + + VkResult Map(VmaAllocation hAllocation, void** ppData); + void Unmap(VmaAllocation hAllocation); + + VkResult BindBufferMemory(VmaAllocation hAllocation, VkBuffer hBuffer); + VkResult BindImageMemory(VmaAllocation hAllocation, VkImage hImage); + private: + VkDeviceSize m_PreferredLargeHeapBlockSize; + VkPhysicalDevice m_PhysicalDevice; + VMA_ATOMIC_UINT32 m_CurrentFrameIndex; + + VMA_MUTEX m_PoolsMutex; + // Protected by m_PoolsMutex. Sorted by pointer value. + VmaVector > m_Pools; + + VmaVulkanFunctions m_VulkanFunctions; + + void ImportVulkanFunctions(const VmaVulkanFunctions* pVulkanFunctions); + + VkDeviceSize CalcPreferredBlockSize(uint32_t memTypeIndex); VkResult AllocateMemoryOfType( const VkMemoryRequirements& vkMemReq, - const VmaMemoryRequirements& vmaMemReq, + bool dedicatedAllocation, + VkBuffer dedicatedBuffer, + VkImage dedicatedImage, + const VmaAllocationCreateInfo& createInfo, uint32_t memTypeIndex, VmaSuballocationType suballocType, - VkMappedMemoryRange* pMemory); - + VmaAllocation* pAllocation); + // Allocates and registers new VkDeviceMemory specifically for single allocation. - VkResult AllocateOwnMemory( + VkResult AllocateDedicatedMemory( VkDeviceSize size, VmaSuballocationType suballocType, uint32_t memTypeIndex, - VkMappedMemoryRange* pMemory); - - // Tries to free pMemory as Own Memory. Returns true if found and freed. - bool FreeOwnMemory(const VkMappedMemoryRange* pMemory); + bool map, + bool isUserDataString, + void* pUserData, + VkBuffer dedicatedBuffer, + VkImage dedicatedImage, + VmaAllocation* pAllocation); + + // Tries to free pMemory as Dedicated Memory. Returns true if found and freed. + void FreeDedicatedMemory(VmaAllocation allocation); }; //////////////////////////////////////////////////////////////////////////////// @@ -2063,9 +4619,7 @@ class VmaStringBuilder void AddNewLine() { Add('\n'); } void AddNumber(uint32_t num); void AddNumber(uint64_t num); - void AddBool(bool b) { Add(b ? "true" : "false"); } - void AddNull() { Add("null"); } - void AddString(const char* pStr); + void AddPointer(const void* ptr); private: VmaVector< char, VmaStlAllocator > m_Data; @@ -2096,149 +4650,694 @@ void VmaStringBuilder::AddNumber(uint64_t num) Add(buf); } -void VmaStringBuilder::AddString(const char* pStr) +void VmaStringBuilder::AddPointer(const void* ptr) +{ + char buf[21]; + VmaPtrToStr(buf, sizeof(buf), ptr); + Add(buf); +} + +#endif // #if VMA_STATS_STRING_ENABLED + +//////////////////////////////////////////////////////////////////////////////// +// VmaJsonWriter + +#if VMA_STATS_STRING_ENABLED + +class VmaJsonWriter +{ +public: + VmaJsonWriter(const VkAllocationCallbacks* pAllocationCallbacks, VmaStringBuilder& sb); + ~VmaJsonWriter(); + + void BeginObject(bool singleLine = false); + void EndObject(); + + void BeginArray(bool singleLine = false); + void EndArray(); + + void WriteString(const char* pStr); + void BeginString(const char* pStr = VMA_NULL); + void ContinueString(const char* pStr); + void ContinueString(uint32_t n); + void ContinueString(uint64_t n); + void ContinueString_Pointer(const void* ptr); + void EndString(const char* pStr = VMA_NULL); + + void WriteNumber(uint32_t n); + void WriteNumber(uint64_t n); + void WriteBool(bool b); + void WriteNull(); + +private: + static const char* const INDENT; + + enum COLLECTION_TYPE + { + COLLECTION_TYPE_OBJECT, + COLLECTION_TYPE_ARRAY, + }; + struct StackItem + { + COLLECTION_TYPE type; + uint32_t valueCount; + bool singleLineMode; + }; + + VmaStringBuilder& m_SB; + VmaVector< StackItem, VmaStlAllocator > m_Stack; + bool m_InsideString; + + void BeginValue(bool isString); + void WriteIndent(bool oneLess = false); + + VmaJsonWriter& operator=(const VmaJsonWriter&) = delete; +}; + +const char* const VmaJsonWriter::INDENT = " "; + +VmaJsonWriter::VmaJsonWriter(const VkAllocationCallbacks* pAllocationCallbacks, VmaStringBuilder& sb) : + m_SB(sb), + m_Stack(VmaStlAllocator(pAllocationCallbacks)), + m_InsideString(false) +{ +} + +VmaJsonWriter::~VmaJsonWriter() +{ + VMA_ASSERT(!m_InsideString); + VMA_ASSERT(m_Stack.empty()); +} + +void VmaJsonWriter::BeginObject(bool singleLine) +{ + VMA_ASSERT(!m_InsideString); + + BeginValue(false); + m_SB.Add('{'); + + StackItem item; + item.type = COLLECTION_TYPE_OBJECT; + item.valueCount = 0; + item.singleLineMode = singleLine; + m_Stack.push_back(item); +} + +void VmaJsonWriter::EndObject() { - Add('"'); + VMA_ASSERT(!m_InsideString); + + WriteIndent(true); + m_SB.Add('}'); + + VMA_ASSERT(!m_Stack.empty() && m_Stack.back().type == COLLECTION_TYPE_OBJECT); + m_Stack.pop_back(); +} + +void VmaJsonWriter::BeginArray(bool singleLine) +{ + VMA_ASSERT(!m_InsideString); + + BeginValue(false); + m_SB.Add('['); + + StackItem item; + item.type = COLLECTION_TYPE_ARRAY; + item.valueCount = 0; + item.singleLineMode = singleLine; + m_Stack.push_back(item); +} + +void VmaJsonWriter::EndArray() +{ + VMA_ASSERT(!m_InsideString); + + WriteIndent(true); + m_SB.Add(']'); + + VMA_ASSERT(!m_Stack.empty() && m_Stack.back().type == COLLECTION_TYPE_ARRAY); + m_Stack.pop_back(); +} + +void VmaJsonWriter::WriteString(const char* pStr) +{ + BeginString(pStr); + EndString(); +} + +void VmaJsonWriter::BeginString(const char* pStr) +{ + VMA_ASSERT(!m_InsideString); + + BeginValue(true); + m_SB.Add('"'); + m_InsideString = true; + if(pStr != VMA_NULL && pStr[0] != '\0') + { + ContinueString(pStr); + } +} + +void VmaJsonWriter::ContinueString(const char* pStr) +{ + VMA_ASSERT(m_InsideString); + const size_t strLen = strlen(pStr); for(size_t i = 0; i < strLen; ++i) { char ch = pStr[i]; if(ch == '\'') - Add("\\\\"); + { + m_SB.Add("\\\\"); + } else if(ch == '"') - Add("\\\""); + { + m_SB.Add("\\\""); + } else if(ch >= 32) - Add(ch); + { + m_SB.Add(ch); + } else switch(ch) { + case '\b': + m_SB.Add("\\b"); + break; + case '\f': + m_SB.Add("\\f"); + break; case '\n': - Add("\\n"); + m_SB.Add("\\n"); break; case '\r': - Add("\\r"); + m_SB.Add("\\r"); break; case '\t': - Add("\\t"); + m_SB.Add("\\t"); break; default: VMA_ASSERT(0 && "Character not currently supported."); break; } } - Add('"'); } -//////////////////////////////////////////////////////////////////////////////// - -// Correspond to values of enum VmaSuballocationType. -static const char* VMA_SUBALLOCATION_TYPE_NAMES[] = { - "FREE", - "UNKNOWN", - "BUFFER", - "IMAGE_UNKNOWN", - "IMAGE_LINEAR", - "IMAGE_OPTIMAL", -}; +void VmaJsonWriter::ContinueString(uint32_t n) +{ + VMA_ASSERT(m_InsideString); + m_SB.AddNumber(n); +} -static void VmaPrintStatInfo(VmaStringBuilder& sb, const VmaStatInfo& stat) -{ - sb.Add("{ \"Allocations\": "); - sb.AddNumber(stat.AllocationCount); - sb.Add(", \"Suballocations\": "); - sb.AddNumber(stat.SuballocationCount); - sb.Add(", \"UnusedRanges\": "); - sb.AddNumber(stat.UnusedRangeCount); - sb.Add(", \"UsedBytes\": "); - sb.AddNumber(stat.UsedBytes); - sb.Add(", \"UnusedBytes\": "); - sb.AddNumber(stat.UnusedBytes); - sb.Add(", \"SuballocationSize\": { \"Min\": "); - sb.AddNumber(stat.SuballocationSizeMin); - sb.Add(", \"Avg\": "); - sb.AddNumber(stat.SuballocationSizeAvg); - sb.Add(", \"Max\": "); - sb.AddNumber(stat.SuballocationSizeMax); - sb.Add(" }, \"UnusedRangeSize\": { \"Min\": "); - sb.AddNumber(stat.UnusedRangeSizeMin); - sb.Add(", \"Avg\": "); - sb.AddNumber(stat.UnusedRangeSizeAvg); - sb.Add(", \"Max\": "); - sb.AddNumber(stat.UnusedRangeSizeMax); - sb.Add(" } }"); +void VmaJsonWriter::ContinueString(uint64_t n) +{ + VMA_ASSERT(m_InsideString); + m_SB.AddNumber(n); } -#endif // #if VMA_STATS_STRING_ENABLED +void VmaJsonWriter::ContinueString_Pointer(const void* ptr) +{ + VMA_ASSERT(m_InsideString); + m_SB.AddPointer(ptr); +} -struct VmaSuballocationItemSizeLess +void VmaJsonWriter::EndString(const char* pStr) { - bool operator()( - const VmaSuballocationList::iterator lhs, - const VmaSuballocationList::iterator rhs) const - { - return lhs->size < rhs->size; - } - bool operator()( - const VmaSuballocationList::iterator lhs, - VkDeviceSize rhsSize) const + VMA_ASSERT(m_InsideString); + if(pStr != VMA_NULL && pStr[0] != '\0') { - return lhs->size < rhsSize; + ContinueString(pStr); } -}; + m_SB.Add('"'); + m_InsideString = false; +} -VmaAllocation::VmaAllocation(VmaAllocator hAllocator) : - m_hMemory(VK_NULL_HANDLE), - m_Size(0), - m_FreeCount(0), - m_SumFreeSize(0), - m_Suballocations(VmaStlAllocator(hAllocator->GetAllocationCallbacks())), - m_FreeSuballocationsBySize(VmaStlAllocator(hAllocator->GetAllocationCallbacks())) +void VmaJsonWriter::WriteNumber(uint32_t n) { + VMA_ASSERT(!m_InsideString); + BeginValue(false); + m_SB.AddNumber(n); } -void VmaAllocation::Init(VkDeviceMemory newMemory, VkDeviceSize newSize) +void VmaJsonWriter::WriteNumber(uint64_t n) { - VMA_ASSERT(m_hMemory == VK_NULL_HANDLE); - - m_hMemory = newMemory; - m_Size = newSize; - m_FreeCount = 1; - m_SumFreeSize = newSize; - - m_Suballocations.clear(); - m_FreeSuballocationsBySize.clear(); - - VmaSuballocation suballoc = {}; - suballoc.offset = 0; - suballoc.size = newSize; - suballoc.type = VMA_SUBALLOCATION_TYPE_FREE; + VMA_ASSERT(!m_InsideString); + BeginValue(false); + m_SB.AddNumber(n); +} - m_Suballocations.push_back(suballoc); - VmaSuballocationList::iterator suballocItem = m_Suballocations.end(); - --suballocItem; - m_FreeSuballocationsBySize.push_back(suballocItem); +void VmaJsonWriter::WriteBool(bool b) +{ + VMA_ASSERT(!m_InsideString); + BeginValue(false); + m_SB.Add(b ? "true" : "false"); } -void VmaAllocation::Destroy(VmaAllocator allocator) +void VmaJsonWriter::WriteNull() { - VMA_ASSERT(m_hMemory != VK_NULL_HANDLE); - vkFreeMemory(allocator->m_hDevice, m_hMemory, allocator->GetAllocationCallbacks()); - m_hMemory = VK_NULL_HANDLE; + VMA_ASSERT(!m_InsideString); + BeginValue(false); + m_SB.Add("null"); } -bool VmaAllocation::Validate() const +void VmaJsonWriter::BeginValue(bool isString) { - if((m_hMemory == VK_NULL_HANDLE) || - (m_Size == 0) || - m_Suballocations.empty()) + isString; + + if(!m_Stack.empty()) { - return false; - } - - // Expected offset of new suballocation as calculates from previous ones. - VkDeviceSize calculatedOffset = 0; - // Expected number of free suballocations as calculated from traversing their list. - uint32_t calculatedFreeCount = 0; - // Expected sum size of free suballocations as calculated from traversing their list. + StackItem& currItem = m_Stack.back(); + if(currItem.type == COLLECTION_TYPE_OBJECT && + currItem.valueCount % 2 == 0) + { + VMA_ASSERT(isString); + } + + if(currItem.type == COLLECTION_TYPE_OBJECT && + currItem.valueCount % 2 != 0) + { + m_SB.Add(": "); + } + else if(currItem.valueCount > 0) + { + m_SB.Add(", "); + WriteIndent(); + } + else + { + WriteIndent(); + } + ++currItem.valueCount; + } +} + +void VmaJsonWriter::WriteIndent(bool oneLess) +{ + if(!m_Stack.empty() && !m_Stack.back().singleLineMode) + { + m_SB.AddNewLine(); + + size_t count = m_Stack.size(); + if(count > 0 && oneLess) + { + --count; + } + for(size_t i = 0; i < count; ++i) + { + m_SB.Add(INDENT); + } + } +} + +#endif // #if VMA_STATS_STRING_ENABLED + +//////////////////////////////////////////////////////////////////////////////// + +void VmaAllocation_T::SetUserData(VmaAllocator hAllocator, void* pUserData) +{ + if(IsUserDataString()) + { + VMA_ASSERT(pUserData == VMA_NULL || pUserData != m_pUserData); + + FreeUserDataString(hAllocator); + + if(pUserData != VMA_NULL) + { + const char* const newStrSrc = (char*)pUserData; + const size_t newStrLen = strlen(newStrSrc); + char* const newStrDst = vma_new_array(hAllocator, char, newStrLen + 1); + memcpy(newStrDst, newStrSrc, newStrLen + 1); + m_pUserData = newStrDst; + } + } + else + { + m_pUserData = pUserData; + } +} + +void VmaAllocation_T::ChangeBlockAllocation( + VmaAllocator hAllocator, + VmaDeviceMemoryBlock* block, + VkDeviceSize offset) +{ + VMA_ASSERT(block != VMA_NULL); + VMA_ASSERT(m_Type == ALLOCATION_TYPE_BLOCK); + + // Move mapping reference counter from old block to new block. + if(block != m_BlockAllocation.m_Block) + { + uint32_t mapRefCount = m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP; + if(IsPersistentMap()) + ++mapRefCount; + m_BlockAllocation.m_Block->Unmap(hAllocator, mapRefCount); + block->Map(hAllocator, mapRefCount, VMA_NULL); + } + + m_BlockAllocation.m_Block = block; + m_BlockAllocation.m_Offset = offset; +} + +VkDeviceSize VmaAllocation_T::GetOffset() const +{ + switch(m_Type) + { + case ALLOCATION_TYPE_BLOCK: + return m_BlockAllocation.m_Offset; + case ALLOCATION_TYPE_DEDICATED: + return 0; + default: + VMA_ASSERT(0); + return 0; + } +} + +VkDeviceMemory VmaAllocation_T::GetMemory() const +{ + switch(m_Type) + { + case ALLOCATION_TYPE_BLOCK: + return m_BlockAllocation.m_Block->GetDeviceMemory(); + case ALLOCATION_TYPE_DEDICATED: + return m_DedicatedAllocation.m_hMemory; + default: + VMA_ASSERT(0); + return VK_NULL_HANDLE; + } +} + +uint32_t VmaAllocation_T::GetMemoryTypeIndex() const +{ + switch(m_Type) + { + case ALLOCATION_TYPE_BLOCK: + return m_BlockAllocation.m_Block->GetMemoryTypeIndex(); + case ALLOCATION_TYPE_DEDICATED: + return m_DedicatedAllocation.m_MemoryTypeIndex; + default: + VMA_ASSERT(0); + return UINT32_MAX; + } +} + +void* VmaAllocation_T::GetMappedData() const +{ + switch(m_Type) + { + case ALLOCATION_TYPE_BLOCK: + if(m_MapCount != 0) + { + void* pBlockData = m_BlockAllocation.m_Block->GetMappedData(); + VMA_ASSERT(pBlockData != VMA_NULL); + return (char*)pBlockData + m_BlockAllocation.m_Offset; + } + else + { + return VMA_NULL; + } + break; + case ALLOCATION_TYPE_DEDICATED: + VMA_ASSERT((m_DedicatedAllocation.m_pMappedData != VMA_NULL) == (m_MapCount != 0)); + return m_DedicatedAllocation.m_pMappedData; + default: + VMA_ASSERT(0); + return VMA_NULL; + } +} + +bool VmaAllocation_T::CanBecomeLost() const +{ + switch(m_Type) + { + case ALLOCATION_TYPE_BLOCK: + return m_BlockAllocation.m_CanBecomeLost; + case ALLOCATION_TYPE_DEDICATED: + return false; + default: + VMA_ASSERT(0); + return false; + } +} + +VmaPool VmaAllocation_T::GetPool() const +{ + VMA_ASSERT(m_Type == ALLOCATION_TYPE_BLOCK); + return m_BlockAllocation.m_hPool; +} + +bool VmaAllocation_T::MakeLost(uint32_t currentFrameIndex, uint32_t frameInUseCount) +{ + VMA_ASSERT(CanBecomeLost()); + + /* + Warning: This is a carefully designed algorithm. + Do not modify unless you really know what you're doing :) + */ + uint32_t localLastUseFrameIndex = GetLastUseFrameIndex(); + for(;;) + { + if(localLastUseFrameIndex == VMA_FRAME_INDEX_LOST) + { + VMA_ASSERT(0); + return false; + } + else if(localLastUseFrameIndex + frameInUseCount >= currentFrameIndex) + { + return false; + } + else // Last use time earlier than current time. + { + if(CompareExchangeLastUseFrameIndex(localLastUseFrameIndex, VMA_FRAME_INDEX_LOST)) + { + // Setting hAllocation.LastUseFrameIndex atomic to VMA_FRAME_INDEX_LOST is enough to mark it as LOST. + // Calling code just needs to unregister this allocation in owning VmaDeviceMemoryBlock. + return true; + } + } + } +} + +void VmaAllocation_T::FreeUserDataString(VmaAllocator hAllocator) +{ + VMA_ASSERT(IsUserDataString()); + if(m_pUserData != VMA_NULL) + { + char* const oldStr = (char*)m_pUserData; + const size_t oldStrLen = strlen(oldStr); + vma_delete_array(hAllocator, oldStr, oldStrLen + 1); + m_pUserData = VMA_NULL; + } +} + +void VmaAllocation_T::BlockAllocMap() +{ + VMA_ASSERT(GetType() == ALLOCATION_TYPE_BLOCK); + + if((m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP) < 0x7F) + { + ++m_MapCount; + } + else + { + VMA_ASSERT(0 && "Allocation mapped too many times simultaneously."); + } +} + +void VmaAllocation_T::BlockAllocUnmap() +{ + VMA_ASSERT(GetType() == ALLOCATION_TYPE_BLOCK); + + if((m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP) != 0) + { + --m_MapCount; + } + else + { + VMA_ASSERT(0 && "Unmapping allocation not previously mapped."); + } +} + +VkResult VmaAllocation_T::DedicatedAllocMap(VmaAllocator hAllocator, void** ppData) +{ + VMA_ASSERT(GetType() == ALLOCATION_TYPE_DEDICATED); + + if(m_MapCount != 0) + { + if((m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP) < 0x7F) + { + VMA_ASSERT(m_DedicatedAllocation.m_pMappedData != VMA_NULL); + *ppData = m_DedicatedAllocation.m_pMappedData; + ++m_MapCount; + return VK_SUCCESS; + } + else + { + VMA_ASSERT(0 && "Dedicated allocation mapped too many times simultaneously."); + return VK_ERROR_MEMORY_MAP_FAILED; + } + } + else + { + VkResult result = (*hAllocator->GetVulkanFunctions().vkMapMemory)( + hAllocator->m_hDevice, + m_DedicatedAllocation.m_hMemory, + 0, // offset + VK_WHOLE_SIZE, + 0, // flags + ppData); + if(result == VK_SUCCESS) + { + m_DedicatedAllocation.m_pMappedData = *ppData; + m_MapCount = 1; + } + return result; + } +} + +void VmaAllocation_T::DedicatedAllocUnmap(VmaAllocator hAllocator) +{ + VMA_ASSERT(GetType() == ALLOCATION_TYPE_DEDICATED); + + if((m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP) != 0) + { + --m_MapCount; + if(m_MapCount == 0) + { + m_DedicatedAllocation.m_pMappedData = VMA_NULL; + (*hAllocator->GetVulkanFunctions().vkUnmapMemory)( + hAllocator->m_hDevice, + m_DedicatedAllocation.m_hMemory); + } + } + else + { + VMA_ASSERT(0 && "Unmapping dedicated allocation not previously mapped."); + } +} + +#if VMA_STATS_STRING_ENABLED + +// Correspond to values of enum VmaSuballocationType. +static const char* VMA_SUBALLOCATION_TYPE_NAMES[] = { + "FREE", + "UNKNOWN", + "BUFFER", + "IMAGE_UNKNOWN", + "IMAGE_LINEAR", + "IMAGE_OPTIMAL", +}; + +static void VmaPrintStatInfo(VmaJsonWriter& json, const VmaStatInfo& stat) +{ + json.BeginObject(); + + json.WriteString("Blocks"); + json.WriteNumber(stat.blockCount); + + json.WriteString("Allocations"); + json.WriteNumber(stat.allocationCount); + + json.WriteString("UnusedRanges"); + json.WriteNumber(stat.unusedRangeCount); + + json.WriteString("UsedBytes"); + json.WriteNumber(stat.usedBytes); + + json.WriteString("UnusedBytes"); + json.WriteNumber(stat.unusedBytes); + + if(stat.allocationCount > 1) + { + json.WriteString("AllocationSize"); + json.BeginObject(true); + json.WriteString("Min"); + json.WriteNumber(stat.allocationSizeMin); + json.WriteString("Avg"); + json.WriteNumber(stat.allocationSizeAvg); + json.WriteString("Max"); + json.WriteNumber(stat.allocationSizeMax); + json.EndObject(); + } + + if(stat.unusedRangeCount > 1) + { + json.WriteString("UnusedRangeSize"); + json.BeginObject(true); + json.WriteString("Min"); + json.WriteNumber(stat.unusedRangeSizeMin); + json.WriteString("Avg"); + json.WriteNumber(stat.unusedRangeSizeAvg); + json.WriteString("Max"); + json.WriteNumber(stat.unusedRangeSizeMax); + json.EndObject(); + } + + json.EndObject(); +} + +#endif // #if VMA_STATS_STRING_ENABLED + +struct VmaSuballocationItemSizeLess +{ + bool operator()( + const VmaSuballocationList::iterator lhs, + const VmaSuballocationList::iterator rhs) const + { + return lhs->size < rhs->size; + } + bool operator()( + const VmaSuballocationList::iterator lhs, + VkDeviceSize rhsSize) const + { + return lhs->size < rhsSize; + } +}; + +//////////////////////////////////////////////////////////////////////////////// +// class VmaBlockMetadata + +VmaBlockMetadata::VmaBlockMetadata(VmaAllocator hAllocator) : + m_Size(0), + m_FreeCount(0), + m_SumFreeSize(0), + m_Suballocations(VmaStlAllocator(hAllocator->GetAllocationCallbacks())), + m_FreeSuballocationsBySize(VmaStlAllocator(hAllocator->GetAllocationCallbacks())) +{ +} + +VmaBlockMetadata::~VmaBlockMetadata() +{ +} + +void VmaBlockMetadata::Init(VkDeviceSize size) +{ + m_Size = size; + m_FreeCount = 1; + m_SumFreeSize = size; + + VmaSuballocation suballoc = {}; + suballoc.offset = 0; + suballoc.size = size; + suballoc.type = VMA_SUBALLOCATION_TYPE_FREE; + suballoc.hAllocation = VK_NULL_HANDLE; + + m_Suballocations.push_back(suballoc); + VmaSuballocationList::iterator suballocItem = m_Suballocations.end(); + --suballocItem; + m_FreeSuballocationsBySize.push_back(suballocItem); +} + +bool VmaBlockMetadata::Validate() const +{ + if(m_Suballocations.empty()) + { + return false; + } + + // Expected offset of new suballocation as calculates from previous ones. + VkDeviceSize calculatedOffset = 0; + // Expected number of free suballocations as calculated from traversing their list. + uint32_t calculatedFreeCount = 0; + // Expected sum size of free suballocations as calculated from traversing their list. VkDeviceSize calculatedSumFreeSize = 0; // Expected number of free suballocations that should be registered in // m_FreeSuballocationsBySize calculated from traversing their list. @@ -2254,1136 +5353,3237 @@ bool VmaAllocation::Validate() const // Actual offset of this suballocation doesn't match expected one. if(subAlloc.offset != calculatedOffset) + { return false; + } const bool currFree = (subAlloc.type == VMA_SUBALLOCATION_TYPE_FREE); // Two adjacent free suballocations are invalid. They should be merged. if(prevFree && currFree) + { return false; - prevFree = currFree; + } + + if(currFree != (subAlloc.hAllocation == VK_NULL_HANDLE)) + { + return false; + } if(currFree) { calculatedSumFreeSize += subAlloc.size; ++calculatedFreeCount; if(subAlloc.size >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER) + { ++freeSuballocationsToRegister; + } } - - calculatedOffset += subAlloc.size; - } + else + { + if(subAlloc.hAllocation->GetOffset() != subAlloc.offset) + { + return false; + } + if(subAlloc.hAllocation->GetSize() != subAlloc.size) + { + return false; + } + } + + calculatedOffset += subAlloc.size; + prevFree = currFree; + } // Number of free suballocations registered in m_FreeSuballocationsBySize doesn't // match expected one. if(m_FreeSuballocationsBySize.size() != freeSuballocationsToRegister) + { + return false; + } + + VkDeviceSize lastSize = 0; + for(size_t i = 0; i < m_FreeSuballocationsBySize.size(); ++i) + { + VmaSuballocationList::iterator suballocItem = m_FreeSuballocationsBySize[i]; + + // Only free suballocations can be registered in m_FreeSuballocationsBySize. + if(suballocItem->type != VMA_SUBALLOCATION_TYPE_FREE) + { + return false; + } + // They must be sorted by size ascending. + if(suballocItem->size < lastSize) + { + return false; + } + + lastSize = suballocItem->size; + } + + // Check if totals match calculacted values. + if(!ValidateFreeSuballocationList() || + (calculatedOffset != m_Size) || + (calculatedSumFreeSize != m_SumFreeSize) || + (calculatedFreeCount != m_FreeCount)) + { + return false; + } + + return true; +} + +VkDeviceSize VmaBlockMetadata::GetUnusedRangeSizeMax() const +{ + if(!m_FreeSuballocationsBySize.empty()) + { + return m_FreeSuballocationsBySize.back()->size; + } + else + { + return 0; + } +} + +bool VmaBlockMetadata::IsEmpty() const +{ + return (m_Suballocations.size() == 1) && (m_FreeCount == 1); +} + +void VmaBlockMetadata::CalcAllocationStatInfo(VmaStatInfo& outInfo) const +{ + outInfo.blockCount = 1; + + const uint32_t rangeCount = (uint32_t)m_Suballocations.size(); + outInfo.allocationCount = rangeCount - m_FreeCount; + outInfo.unusedRangeCount = m_FreeCount; + + outInfo.unusedBytes = m_SumFreeSize; + outInfo.usedBytes = m_Size - outInfo.unusedBytes; + + outInfo.allocationSizeMin = UINT64_MAX; + outInfo.allocationSizeMax = 0; + outInfo.unusedRangeSizeMin = UINT64_MAX; + outInfo.unusedRangeSizeMax = 0; + + for(VmaSuballocationList::const_iterator suballocItem = m_Suballocations.cbegin(); + suballocItem != m_Suballocations.cend(); + ++suballocItem) + { + const VmaSuballocation& suballoc = *suballocItem; + if(suballoc.type != VMA_SUBALLOCATION_TYPE_FREE) + { + outInfo.allocationSizeMin = VMA_MIN(outInfo.allocationSizeMin, suballoc.size); + outInfo.allocationSizeMax = VMA_MAX(outInfo.allocationSizeMax, suballoc.size); + } + else + { + outInfo.unusedRangeSizeMin = VMA_MIN(outInfo.unusedRangeSizeMin, suballoc.size); + outInfo.unusedRangeSizeMax = VMA_MAX(outInfo.unusedRangeSizeMax, suballoc.size); + } + } +} + +void VmaBlockMetadata::AddPoolStats(VmaPoolStats& inoutStats) const +{ + const uint32_t rangeCount = (uint32_t)m_Suballocations.size(); + + inoutStats.size += m_Size; + inoutStats.unusedSize += m_SumFreeSize; + inoutStats.allocationCount += rangeCount - m_FreeCount; + inoutStats.unusedRangeCount += m_FreeCount; + inoutStats.unusedRangeSizeMax = VMA_MAX(inoutStats.unusedRangeSizeMax, GetUnusedRangeSizeMax()); +} + +#if VMA_STATS_STRING_ENABLED + +void VmaBlockMetadata::PrintDetailedMap(class VmaJsonWriter& json) const +{ + json.BeginObject(); + + json.WriteString("TotalBytes"); + json.WriteNumber(m_Size); + + json.WriteString("UnusedBytes"); + json.WriteNumber(m_SumFreeSize); + + json.WriteString("Allocations"); + json.WriteNumber((uint64_t)m_Suballocations.size() - m_FreeCount); + + json.WriteString("UnusedRanges"); + json.WriteNumber(m_FreeCount); + + json.WriteString("Suballocations"); + json.BeginArray(); + size_t i = 0; + for(VmaSuballocationList::const_iterator suballocItem = m_Suballocations.cbegin(); + suballocItem != m_Suballocations.cend(); + ++suballocItem, ++i) + { + json.BeginObject(true); + + json.WriteString("Type"); + json.WriteString(VMA_SUBALLOCATION_TYPE_NAMES[suballocItem->type]); + + json.WriteString("Size"); + json.WriteNumber(suballocItem->size); + + json.WriteString("Offset"); + json.WriteNumber(suballocItem->offset); + + if(suballocItem->type != VMA_SUBALLOCATION_TYPE_FREE) + { + const void* pUserData = suballocItem->hAllocation->GetUserData(); + if(pUserData != VMA_NULL) + { + json.WriteString("UserData"); + if(suballocItem->hAllocation->IsUserDataString()) + { + json.WriteString((const char*)pUserData); + } + else + { + json.BeginString(); + json.ContinueString_Pointer(pUserData); + json.EndString(); + } + } + } + + json.EndObject(); + } + json.EndArray(); + + json.EndObject(); +} + +#endif // #if VMA_STATS_STRING_ENABLED + +/* +How many suitable free suballocations to analyze before choosing best one. +- Set to 1 to use First-Fit algorithm - first suitable free suballocation will + be chosen. +- Set to UINT32_MAX to use Best-Fit/Worst-Fit algorithm - all suitable free + suballocations will be analized and best one will be chosen. +- Any other value is also acceptable. +*/ +//static const uint32_t MAX_SUITABLE_SUBALLOCATIONS_TO_CHECK = 8; + +void VmaBlockMetadata::CreateFirstAllocationRequest(VmaAllocationRequest* pAllocationRequest) +{ + VMA_ASSERT(IsEmpty()); + pAllocationRequest->offset = 0; + pAllocationRequest->sumFreeSize = m_SumFreeSize; + pAllocationRequest->sumItemSize = 0; + pAllocationRequest->item = m_Suballocations.begin(); + pAllocationRequest->itemsToMakeLostCount = 0; +} + +bool VmaBlockMetadata::CreateAllocationRequest( + uint32_t currentFrameIndex, + uint32_t frameInUseCount, + VkDeviceSize bufferImageGranularity, + VkDeviceSize allocSize, + VkDeviceSize allocAlignment, + VmaSuballocationType allocType, + bool canMakeOtherLost, + VmaAllocationRequest* pAllocationRequest) +{ + VMA_ASSERT(allocSize > 0); + VMA_ASSERT(allocType != VMA_SUBALLOCATION_TYPE_FREE); + VMA_ASSERT(pAllocationRequest != VMA_NULL); + VMA_HEAVY_ASSERT(Validate()); + + // There is not enough total free space in this block to fullfill the request: Early return. + if(canMakeOtherLost == false && m_SumFreeSize < allocSize) + { return false; + } + + // New algorithm, efficiently searching freeSuballocationsBySize. + const size_t freeSuballocCount = m_FreeSuballocationsBySize.size(); + if(freeSuballocCount > 0) + { + if(VMA_BEST_FIT) + { + // Find first free suballocation with size not less than allocSize. + VmaSuballocationList::iterator* const it = VmaBinaryFindFirstNotLess( + m_FreeSuballocationsBySize.data(), + m_FreeSuballocationsBySize.data() + freeSuballocCount, + allocSize, + VmaSuballocationItemSizeLess()); + size_t index = it - m_FreeSuballocationsBySize.data(); + for(; index < freeSuballocCount; ++index) + { + if(CheckAllocation( + currentFrameIndex, + frameInUseCount, + bufferImageGranularity, + allocSize, + allocAlignment, + allocType, + m_FreeSuballocationsBySize[index], + false, // canMakeOtherLost + &pAllocationRequest->offset, + &pAllocationRequest->itemsToMakeLostCount, + &pAllocationRequest->sumFreeSize, + &pAllocationRequest->sumItemSize)) + { + pAllocationRequest->item = m_FreeSuballocationsBySize[index]; + return true; + } + } + } + else + { + // Search staring from biggest suballocations. + for(size_t index = freeSuballocCount; index--; ) + { + if(CheckAllocation( + currentFrameIndex, + frameInUseCount, + bufferImageGranularity, + allocSize, + allocAlignment, + allocType, + m_FreeSuballocationsBySize[index], + false, // canMakeOtherLost + &pAllocationRequest->offset, + &pAllocationRequest->itemsToMakeLostCount, + &pAllocationRequest->sumFreeSize, + &pAllocationRequest->sumItemSize)) + { + pAllocationRequest->item = m_FreeSuballocationsBySize[index]; + return true; + } + } + } + } + + if(canMakeOtherLost) + { + // Brute-force algorithm. TODO: Come up with something better. + + pAllocationRequest->sumFreeSize = VK_WHOLE_SIZE; + pAllocationRequest->sumItemSize = VK_WHOLE_SIZE; + + VmaAllocationRequest tmpAllocRequest = {}; + for(VmaSuballocationList::iterator suballocIt = m_Suballocations.begin(); + suballocIt != m_Suballocations.end(); + ++suballocIt) + { + if(suballocIt->type == VMA_SUBALLOCATION_TYPE_FREE || + suballocIt->hAllocation->CanBecomeLost()) + { + if(CheckAllocation( + currentFrameIndex, + frameInUseCount, + bufferImageGranularity, + allocSize, + allocAlignment, + allocType, + suballocIt, + canMakeOtherLost, + &tmpAllocRequest.offset, + &tmpAllocRequest.itemsToMakeLostCount, + &tmpAllocRequest.sumFreeSize, + &tmpAllocRequest.sumItemSize)) + { + tmpAllocRequest.item = suballocIt; + + if(tmpAllocRequest.CalcCost() < pAllocationRequest->CalcCost()) + { + *pAllocationRequest = tmpAllocRequest; + } + } + } + } + + if(pAllocationRequest->sumItemSize != VK_WHOLE_SIZE) + { + return true; + } + } + + return false; +} + +bool VmaBlockMetadata::MakeRequestedAllocationsLost( + uint32_t currentFrameIndex, + uint32_t frameInUseCount, + VmaAllocationRequest* pAllocationRequest) +{ + while(pAllocationRequest->itemsToMakeLostCount > 0) + { + if(pAllocationRequest->item->type == VMA_SUBALLOCATION_TYPE_FREE) + { + ++pAllocationRequest->item; + } + VMA_ASSERT(pAllocationRequest->item != m_Suballocations.end()); + VMA_ASSERT(pAllocationRequest->item->hAllocation != VK_NULL_HANDLE); + VMA_ASSERT(pAllocationRequest->item->hAllocation->CanBecomeLost()); + if(pAllocationRequest->item->hAllocation->MakeLost(currentFrameIndex, frameInUseCount)) + { + pAllocationRequest->item = FreeSuballocation(pAllocationRequest->item); + --pAllocationRequest->itemsToMakeLostCount; + } + else + { + return false; + } + } + + VMA_HEAVY_ASSERT(Validate()); + VMA_ASSERT(pAllocationRequest->item != m_Suballocations.end()); + VMA_ASSERT(pAllocationRequest->item->type == VMA_SUBALLOCATION_TYPE_FREE); + + return true; +} + +uint32_t VmaBlockMetadata::MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount) +{ + uint32_t lostAllocationCount = 0; + for(VmaSuballocationList::iterator it = m_Suballocations.begin(); + it != m_Suballocations.end(); + ++it) + { + if(it->type != VMA_SUBALLOCATION_TYPE_FREE && + it->hAllocation->CanBecomeLost() && + it->hAllocation->MakeLost(currentFrameIndex, frameInUseCount)) + { + it = FreeSuballocation(it); + ++lostAllocationCount; + } + } + return lostAllocationCount; +} + +void VmaBlockMetadata::Alloc( + const VmaAllocationRequest& request, + VmaSuballocationType type, + VkDeviceSize allocSize, + VmaAllocation hAllocation) +{ + VMA_ASSERT(request.item != m_Suballocations.end()); + VmaSuballocation& suballoc = *request.item; + // Given suballocation is a free block. + VMA_ASSERT(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE); + // Given offset is inside this suballocation. + VMA_ASSERT(request.offset >= suballoc.offset); + const VkDeviceSize paddingBegin = request.offset - suballoc.offset; + VMA_ASSERT(suballoc.size >= paddingBegin + allocSize); + const VkDeviceSize paddingEnd = suballoc.size - paddingBegin - allocSize; + + // Unregister this free suballocation from m_FreeSuballocationsBySize and update + // it to become used. + UnregisterFreeSuballocation(request.item); + + suballoc.offset = request.offset; + suballoc.size = allocSize; + suballoc.type = type; + suballoc.hAllocation = hAllocation; + + // If there are any free bytes remaining at the end, insert new free suballocation after current one. + if(paddingEnd) + { + VmaSuballocation paddingSuballoc = {}; + paddingSuballoc.offset = request.offset + allocSize; + paddingSuballoc.size = paddingEnd; + paddingSuballoc.type = VMA_SUBALLOCATION_TYPE_FREE; + VmaSuballocationList::iterator next = request.item; + ++next; + const VmaSuballocationList::iterator paddingEndItem = + m_Suballocations.insert(next, paddingSuballoc); + RegisterFreeSuballocation(paddingEndItem); + } + + // If there are any free bytes remaining at the beginning, insert new free suballocation before current one. + if(paddingBegin) + { + VmaSuballocation paddingSuballoc = {}; + paddingSuballoc.offset = request.offset - paddingBegin; + paddingSuballoc.size = paddingBegin; + paddingSuballoc.type = VMA_SUBALLOCATION_TYPE_FREE; + const VmaSuballocationList::iterator paddingBeginItem = + m_Suballocations.insert(request.item, paddingSuballoc); + RegisterFreeSuballocation(paddingBeginItem); + } + + // Update totals. + m_FreeCount = m_FreeCount - 1; + if(paddingBegin > 0) + { + ++m_FreeCount; + } + if(paddingEnd > 0) + { + ++m_FreeCount; + } + m_SumFreeSize -= allocSize; +} + +void VmaBlockMetadata::Free(const VmaAllocation allocation) +{ + for(VmaSuballocationList::iterator suballocItem = m_Suballocations.begin(); + suballocItem != m_Suballocations.end(); + ++suballocItem) + { + VmaSuballocation& suballoc = *suballocItem; + if(suballoc.hAllocation == allocation) + { + FreeSuballocation(suballocItem); + VMA_HEAVY_ASSERT(Validate()); + return; + } + } + VMA_ASSERT(0 && "Not found!"); +} + +void VmaBlockMetadata::FreeAtOffset(VkDeviceSize offset) +{ + for(VmaSuballocationList::iterator suballocItem = m_Suballocations.begin(); + suballocItem != m_Suballocations.end(); + ++suballocItem) + { + VmaSuballocation& suballoc = *suballocItem; + if(suballoc.offset == offset) + { + FreeSuballocation(suballocItem); + return; + } + } + VMA_ASSERT(0 && "Not found!"); +} + +bool VmaBlockMetadata::ValidateFreeSuballocationList() const +{ + VkDeviceSize lastSize = 0; + for(size_t i = 0, count = m_FreeSuballocationsBySize.size(); i < count; ++i) + { + const VmaSuballocationList::iterator it = m_FreeSuballocationsBySize[i]; + + if(it->type != VMA_SUBALLOCATION_TYPE_FREE) + { + VMA_ASSERT(0); + return false; + } + if(it->size < VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER) + { + VMA_ASSERT(0); + return false; + } + if(it->size < lastSize) + { + VMA_ASSERT(0); + return false; + } + + lastSize = it->size; + } + return true; +} + +bool VmaBlockMetadata::CheckAllocation( + uint32_t currentFrameIndex, + uint32_t frameInUseCount, + VkDeviceSize bufferImageGranularity, + VkDeviceSize allocSize, + VkDeviceSize allocAlignment, + VmaSuballocationType allocType, + VmaSuballocationList::const_iterator suballocItem, + bool canMakeOtherLost, + VkDeviceSize* pOffset, + size_t* itemsToMakeLostCount, + VkDeviceSize* pSumFreeSize, + VkDeviceSize* pSumItemSize) const +{ + VMA_ASSERT(allocSize > 0); + VMA_ASSERT(allocType != VMA_SUBALLOCATION_TYPE_FREE); + VMA_ASSERT(suballocItem != m_Suballocations.cend()); + VMA_ASSERT(pOffset != VMA_NULL); + + *itemsToMakeLostCount = 0; + *pSumFreeSize = 0; + *pSumItemSize = 0; + + if(canMakeOtherLost) + { + if(suballocItem->type == VMA_SUBALLOCATION_TYPE_FREE) + { + *pSumFreeSize = suballocItem->size; + } + else + { + if(suballocItem->hAllocation->CanBecomeLost() && + suballocItem->hAllocation->GetLastUseFrameIndex() + frameInUseCount < currentFrameIndex) + { + ++*itemsToMakeLostCount; + *pSumItemSize = suballocItem->size; + } + else + { + return false; + } + } + + // Remaining size is too small for this request: Early return. + if(m_Size - suballocItem->offset < allocSize) + { + return false; + } + + // Start from offset equal to beginning of this suballocation. + *pOffset = suballocItem->offset; + + // Apply VMA_DEBUG_MARGIN at the beginning. + if((VMA_DEBUG_MARGIN > 0) && suballocItem != m_Suballocations.cbegin()) + { + *pOffset += VMA_DEBUG_MARGIN; + } + + // Apply alignment. + const VkDeviceSize alignment = VMA_MAX(allocAlignment, static_cast(VMA_DEBUG_ALIGNMENT)); + *pOffset = VmaAlignUp(*pOffset, alignment); + + // Check previous suballocations for BufferImageGranularity conflicts. + // Make bigger alignment if necessary. + if(bufferImageGranularity > 1) + { + bool bufferImageGranularityConflict = false; + VmaSuballocationList::const_iterator prevSuballocItem = suballocItem; + while(prevSuballocItem != m_Suballocations.cbegin()) + { + --prevSuballocItem; + const VmaSuballocation& prevSuballoc = *prevSuballocItem; + if(VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, *pOffset, bufferImageGranularity)) + { + if(VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType)) + { + bufferImageGranularityConflict = true; + break; + } + } + else + // Already on previous page. + break; + } + if(bufferImageGranularityConflict) + { + *pOffset = VmaAlignUp(*pOffset, bufferImageGranularity); + } + } + + // Now that we have final *pOffset, check if we are past suballocItem. + // If yes, return false - this function should be called for another suballocItem as starting point. + if(*pOffset >= suballocItem->offset + suballocItem->size) + { + return false; + } + + // Calculate padding at the beginning based on current offset. + const VkDeviceSize paddingBegin = *pOffset - suballocItem->offset; + + // Calculate required margin at the end if this is not last suballocation. + VmaSuballocationList::const_iterator next = suballocItem; + ++next; + const VkDeviceSize requiredEndMargin = + (next != m_Suballocations.cend()) ? VMA_DEBUG_MARGIN : 0; + + const VkDeviceSize totalSize = paddingBegin + allocSize + requiredEndMargin; + // Another early return check. + if(suballocItem->offset + totalSize > m_Size) + { + return false; + } + + // Advance lastSuballocItem until desired size is reached. + // Update itemsToMakeLostCount. + VmaSuballocationList::const_iterator lastSuballocItem = suballocItem; + if(totalSize > suballocItem->size) + { + VkDeviceSize remainingSize = totalSize - suballocItem->size; + while(remainingSize > 0) + { + ++lastSuballocItem; + if(lastSuballocItem == m_Suballocations.cend()) + { + return false; + } + if(lastSuballocItem->type == VMA_SUBALLOCATION_TYPE_FREE) + { + *pSumFreeSize += lastSuballocItem->size; + } + else + { + VMA_ASSERT(lastSuballocItem->hAllocation != VK_NULL_HANDLE); + if(lastSuballocItem->hAllocation->CanBecomeLost() && + lastSuballocItem->hAllocation->GetLastUseFrameIndex() + frameInUseCount < currentFrameIndex) + { + ++*itemsToMakeLostCount; + *pSumItemSize += lastSuballocItem->size; + } + else + { + return false; + } + } + remainingSize = (lastSuballocItem->size < remainingSize) ? + remainingSize - lastSuballocItem->size : 0; + } + } + + // Check next suballocations for BufferImageGranularity conflicts. + // If conflict exists, we must mark more allocations lost or fail. + if(bufferImageGranularity > 1) + { + VmaSuballocationList::const_iterator nextSuballocItem = lastSuballocItem; + ++nextSuballocItem; + while(nextSuballocItem != m_Suballocations.cend()) + { + const VmaSuballocation& nextSuballoc = *nextSuballocItem; + if(VmaBlocksOnSamePage(*pOffset, allocSize, nextSuballoc.offset, bufferImageGranularity)) + { + if(VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type)) + { + VMA_ASSERT(nextSuballoc.hAllocation != VK_NULL_HANDLE); + if(nextSuballoc.hAllocation->CanBecomeLost() && + nextSuballoc.hAllocation->GetLastUseFrameIndex() + frameInUseCount < currentFrameIndex) + { + ++*itemsToMakeLostCount; + } + else + { + return false; + } + } + } + else + { + // Already on next page. + break; + } + ++nextSuballocItem; + } + } + } + else + { + const VmaSuballocation& suballoc = *suballocItem; + VMA_ASSERT(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE); + + *pSumFreeSize = suballoc.size; + + // Size of this suballocation is too small for this request: Early return. + if(suballoc.size < allocSize) + { + return false; + } + + // Start from offset equal to beginning of this suballocation. + *pOffset = suballoc.offset; + + // Apply VMA_DEBUG_MARGIN at the beginning. + if((VMA_DEBUG_MARGIN > 0) && suballocItem != m_Suballocations.cbegin()) + { + *pOffset += VMA_DEBUG_MARGIN; + } + + // Apply alignment. + const VkDeviceSize alignment = VMA_MAX(allocAlignment, static_cast(VMA_DEBUG_ALIGNMENT)); + *pOffset = VmaAlignUp(*pOffset, alignment); + + // Check previous suballocations for BufferImageGranularity conflicts. + // Make bigger alignment if necessary. + if(bufferImageGranularity > 1) + { + bool bufferImageGranularityConflict = false; + VmaSuballocationList::const_iterator prevSuballocItem = suballocItem; + while(prevSuballocItem != m_Suballocations.cbegin()) + { + --prevSuballocItem; + const VmaSuballocation& prevSuballoc = *prevSuballocItem; + if(VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, *pOffset, bufferImageGranularity)) + { + if(VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType)) + { + bufferImageGranularityConflict = true; + break; + } + } + else + // Already on previous page. + break; + } + if(bufferImageGranularityConflict) + { + *pOffset = VmaAlignUp(*pOffset, bufferImageGranularity); + } + } + + // Calculate padding at the beginning based on current offset. + const VkDeviceSize paddingBegin = *pOffset - suballoc.offset; + + // Calculate required margin at the end if this is not last suballocation. + VmaSuballocationList::const_iterator next = suballocItem; + ++next; + const VkDeviceSize requiredEndMargin = + (next != m_Suballocations.cend()) ? VMA_DEBUG_MARGIN : 0; + + // Fail if requested size plus margin before and after is bigger than size of this suballocation. + if(paddingBegin + allocSize + requiredEndMargin > suballoc.size) + { + return false; + } + + // Check next suballocations for BufferImageGranularity conflicts. + // If conflict exists, allocation cannot be made here. + if(bufferImageGranularity > 1) + { + VmaSuballocationList::const_iterator nextSuballocItem = suballocItem; + ++nextSuballocItem; + while(nextSuballocItem != m_Suballocations.cend()) + { + const VmaSuballocation& nextSuballoc = *nextSuballocItem; + if(VmaBlocksOnSamePage(*pOffset, allocSize, nextSuballoc.offset, bufferImageGranularity)) + { + if(VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type)) + { + return false; + } + } + else + { + // Already on next page. + break; + } + ++nextSuballocItem; + } + } + } + + // All tests passed: Success. pOffset is already filled. + return true; +} + +void VmaBlockMetadata::MergeFreeWithNext(VmaSuballocationList::iterator item) +{ + VMA_ASSERT(item != m_Suballocations.end()); + VMA_ASSERT(item->type == VMA_SUBALLOCATION_TYPE_FREE); + + VmaSuballocationList::iterator nextItem = item; + ++nextItem; + VMA_ASSERT(nextItem != m_Suballocations.end()); + VMA_ASSERT(nextItem->type == VMA_SUBALLOCATION_TYPE_FREE); + + item->size += nextItem->size; + --m_FreeCount; + m_Suballocations.erase(nextItem); +} + +VmaSuballocationList::iterator VmaBlockMetadata::FreeSuballocation(VmaSuballocationList::iterator suballocItem) +{ + // Change this suballocation to be marked as free. + VmaSuballocation& suballoc = *suballocItem; + suballoc.type = VMA_SUBALLOCATION_TYPE_FREE; + suballoc.hAllocation = VK_NULL_HANDLE; + + // Update totals. + ++m_FreeCount; + m_SumFreeSize += suballoc.size; + + // Merge with previous and/or next suballocation if it's also free. + bool mergeWithNext = false; + bool mergeWithPrev = false; + + VmaSuballocationList::iterator nextItem = suballocItem; + ++nextItem; + if((nextItem != m_Suballocations.end()) && (nextItem->type == VMA_SUBALLOCATION_TYPE_FREE)) + { + mergeWithNext = true; + } + + VmaSuballocationList::iterator prevItem = suballocItem; + if(suballocItem != m_Suballocations.begin()) + { + --prevItem; + if(prevItem->type == VMA_SUBALLOCATION_TYPE_FREE) + { + mergeWithPrev = true; + } + } + + if(mergeWithNext) + { + UnregisterFreeSuballocation(nextItem); + MergeFreeWithNext(suballocItem); + } + + if(mergeWithPrev) + { + UnregisterFreeSuballocation(prevItem); + MergeFreeWithNext(prevItem); + RegisterFreeSuballocation(prevItem); + return prevItem; + } + else + { + RegisterFreeSuballocation(suballocItem); + return suballocItem; + } +} + +void VmaBlockMetadata::RegisterFreeSuballocation(VmaSuballocationList::iterator item) +{ + VMA_ASSERT(item->type == VMA_SUBALLOCATION_TYPE_FREE); + VMA_ASSERT(item->size > 0); + + // You may want to enable this validation at the beginning or at the end of + // this function, depending on what do you want to check. + VMA_HEAVY_ASSERT(ValidateFreeSuballocationList()); + + if(item->size >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER) + { + if(m_FreeSuballocationsBySize.empty()) + { + m_FreeSuballocationsBySize.push_back(item); + } + else + { + VmaVectorInsertSorted(m_FreeSuballocationsBySize, item); + } + } + + //VMA_HEAVY_ASSERT(ValidateFreeSuballocationList()); +} + + +void VmaBlockMetadata::UnregisterFreeSuballocation(VmaSuballocationList::iterator item) +{ + VMA_ASSERT(item->type == VMA_SUBALLOCATION_TYPE_FREE); + VMA_ASSERT(item->size > 0); + + // You may want to enable this validation at the beginning or at the end of + // this function, depending on what do you want to check. + VMA_HEAVY_ASSERT(ValidateFreeSuballocationList()); + + if(item->size >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER) + { + VmaSuballocationList::iterator* const it = VmaBinaryFindFirstNotLess( + m_FreeSuballocationsBySize.data(), + m_FreeSuballocationsBySize.data() + m_FreeSuballocationsBySize.size(), + item, + VmaSuballocationItemSizeLess()); + for(size_t index = it - m_FreeSuballocationsBySize.data(); + index < m_FreeSuballocationsBySize.size(); + ++index) + { + if(m_FreeSuballocationsBySize[index] == item) + { + VmaVectorRemove(m_FreeSuballocationsBySize, index); + return; + } + VMA_ASSERT((m_FreeSuballocationsBySize[index]->size == item->size) && "Not found."); + } + VMA_ASSERT(0 && "Not found."); + } + + //VMA_HEAVY_ASSERT(ValidateFreeSuballocationList()); +} + +//////////////////////////////////////////////////////////////////////////////// +// class VmaDeviceMemoryBlock + +VmaDeviceMemoryBlock::VmaDeviceMemoryBlock(VmaAllocator hAllocator) : + m_Metadata(hAllocator), + m_MemoryTypeIndex(UINT32_MAX), + m_hMemory(VK_NULL_HANDLE), + m_MapCount(0), + m_pMappedData(VMA_NULL) +{ +} + +void VmaDeviceMemoryBlock::Init( + uint32_t newMemoryTypeIndex, + VkDeviceMemory newMemory, + VkDeviceSize newSize) +{ + VMA_ASSERT(m_hMemory == VK_NULL_HANDLE); + + m_MemoryTypeIndex = newMemoryTypeIndex; + m_hMemory = newMemory; + + m_Metadata.Init(newSize); +} + +void VmaDeviceMemoryBlock::Destroy(VmaAllocator allocator) +{ + // This is the most important assert in the entire library. + // Hitting it means you have some memory leak - unreleased VmaAllocation objects. + VMA_ASSERT(m_Metadata.IsEmpty() && "Some allocations were not freed before destruction of this memory block!"); + + VMA_ASSERT(m_hMemory != VK_NULL_HANDLE); + allocator->FreeVulkanMemory(m_MemoryTypeIndex, m_Metadata.GetSize(), m_hMemory); + m_hMemory = VK_NULL_HANDLE; +} + +bool VmaDeviceMemoryBlock::Validate() const +{ + if((m_hMemory == VK_NULL_HANDLE) || + (m_Metadata.GetSize() == 0)) + { + return false; + } + + return m_Metadata.Validate(); +} + +VkResult VmaDeviceMemoryBlock::Map(VmaAllocator hAllocator, uint32_t count, void** ppData) +{ + if(count == 0) + { + return VK_SUCCESS; + } + + VmaMutexLock lock(m_Mutex, hAllocator->m_UseMutex); + if(m_MapCount != 0) + { + m_MapCount += count; + VMA_ASSERT(m_pMappedData != VMA_NULL); + if(ppData != VMA_NULL) + { + *ppData = m_pMappedData; + } + return VK_SUCCESS; + } + else + { + VkResult result = (*hAllocator->GetVulkanFunctions().vkMapMemory)( + hAllocator->m_hDevice, + m_hMemory, + 0, // offset + VK_WHOLE_SIZE, + 0, // flags + &m_pMappedData); + if(result == VK_SUCCESS) + { + if(ppData != VMA_NULL) + { + *ppData = m_pMappedData; + } + m_MapCount = count; + } + return result; + } +} + +void VmaDeviceMemoryBlock::Unmap(VmaAllocator hAllocator, uint32_t count) +{ + if(count == 0) + { + return; + } + + VmaMutexLock lock(m_Mutex, hAllocator->m_UseMutex); + if(m_MapCount >= count) + { + m_MapCount -= count; + if(m_MapCount == 0) + { + m_pMappedData = VMA_NULL; + (*hAllocator->GetVulkanFunctions().vkUnmapMemory)(hAllocator->m_hDevice, m_hMemory); + } + } + else + { + VMA_ASSERT(0 && "VkDeviceMemory block is being unmapped while it was not previously mapped."); + } +} + +VkResult VmaDeviceMemoryBlock::BindBufferMemory( + const VmaAllocator hAllocator, + const VmaAllocation hAllocation, + VkBuffer hBuffer) +{ + VMA_ASSERT(hAllocation->GetType() == VmaAllocation_T::ALLOCATION_TYPE_BLOCK && + hAllocation->GetBlock() == this); + // This lock is important so that we don't call vkBind... and/or vkMap... simultaneously on the same VkDeviceMemory from multiple threads. + VmaMutexLock lock(m_Mutex, hAllocator->m_UseMutex); + return hAllocator->GetVulkanFunctions().vkBindBufferMemory( + hAllocator->m_hDevice, + hBuffer, + m_hMemory, + hAllocation->GetOffset()); +} + +VkResult VmaDeviceMemoryBlock::BindImageMemory( + const VmaAllocator hAllocator, + const VmaAllocation hAllocation, + VkImage hImage) +{ + VMA_ASSERT(hAllocation->GetType() == VmaAllocation_T::ALLOCATION_TYPE_BLOCK && + hAllocation->GetBlock() == this); + // This lock is important so that we don't call vkBind... and/or vkMap... simultaneously on the same VkDeviceMemory from multiple threads. + VmaMutexLock lock(m_Mutex, hAllocator->m_UseMutex); + return hAllocator->GetVulkanFunctions().vkBindImageMemory( + hAllocator->m_hDevice, + hImage, + m_hMemory, + hAllocation->GetOffset()); +} + +static void InitStatInfo(VmaStatInfo& outInfo) +{ + memset(&outInfo, 0, sizeof(outInfo)); + outInfo.allocationSizeMin = UINT64_MAX; + outInfo.unusedRangeSizeMin = UINT64_MAX; +} + +// Adds statistics srcInfo into inoutInfo, like: inoutInfo += srcInfo. +static void VmaAddStatInfo(VmaStatInfo& inoutInfo, const VmaStatInfo& srcInfo) +{ + inoutInfo.blockCount += srcInfo.blockCount; + inoutInfo.allocationCount += srcInfo.allocationCount; + inoutInfo.unusedRangeCount += srcInfo.unusedRangeCount; + inoutInfo.usedBytes += srcInfo.usedBytes; + inoutInfo.unusedBytes += srcInfo.unusedBytes; + inoutInfo.allocationSizeMin = VMA_MIN(inoutInfo.allocationSizeMin, srcInfo.allocationSizeMin); + inoutInfo.allocationSizeMax = VMA_MAX(inoutInfo.allocationSizeMax, srcInfo.allocationSizeMax); + inoutInfo.unusedRangeSizeMin = VMA_MIN(inoutInfo.unusedRangeSizeMin, srcInfo.unusedRangeSizeMin); + inoutInfo.unusedRangeSizeMax = VMA_MAX(inoutInfo.unusedRangeSizeMax, srcInfo.unusedRangeSizeMax); +} + +static void VmaPostprocessCalcStatInfo(VmaStatInfo& inoutInfo) +{ + inoutInfo.allocationSizeAvg = (inoutInfo.allocationCount > 0) ? + VmaRoundDiv(inoutInfo.usedBytes, inoutInfo.allocationCount) : 0; + inoutInfo.unusedRangeSizeAvg = (inoutInfo.unusedRangeCount > 0) ? + VmaRoundDiv(inoutInfo.unusedBytes, inoutInfo.unusedRangeCount) : 0; +} + +VmaPool_T::VmaPool_T( + VmaAllocator hAllocator, + const VmaPoolCreateInfo& createInfo) : + m_BlockVector( + hAllocator, + createInfo.memoryTypeIndex, + createInfo.blockSize, + createInfo.minBlockCount, + createInfo.maxBlockCount, + (createInfo.flags & VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT) != 0 ? 1 : hAllocator->GetBufferImageGranularity(), + createInfo.frameInUseCount, + true) // isCustomPool +{ +} + +VmaPool_T::~VmaPool_T() +{ +} + +#if VMA_STATS_STRING_ENABLED + +#endif // #if VMA_STATS_STRING_ENABLED + +VmaBlockVector::VmaBlockVector( + VmaAllocator hAllocator, + uint32_t memoryTypeIndex, + VkDeviceSize preferredBlockSize, + size_t minBlockCount, + size_t maxBlockCount, + VkDeviceSize bufferImageGranularity, + uint32_t frameInUseCount, + bool isCustomPool) : + m_hAllocator(hAllocator), + m_MemoryTypeIndex(memoryTypeIndex), + m_PreferredBlockSize(preferredBlockSize), + m_MinBlockCount(minBlockCount), + m_MaxBlockCount(maxBlockCount), + m_BufferImageGranularity(bufferImageGranularity), + m_FrameInUseCount(frameInUseCount), + m_IsCustomPool(isCustomPool), + m_Blocks(VmaStlAllocator(hAllocator->GetAllocationCallbacks())), + m_HasEmptyBlock(false), + m_pDefragmentator(VMA_NULL) +{ +} + +VmaBlockVector::~VmaBlockVector() +{ + VMA_ASSERT(m_pDefragmentator == VMA_NULL); + + for(size_t i = m_Blocks.size(); i--; ) + { + m_Blocks[i]->Destroy(m_hAllocator); + vma_delete(m_hAllocator, m_Blocks[i]); + } +} + +VkResult VmaBlockVector::CreateMinBlocks() +{ + for(size_t i = 0; i < m_MinBlockCount; ++i) + { + VkResult res = CreateBlock(m_PreferredBlockSize, VMA_NULL); + if(res != VK_SUCCESS) + { + return res; + } + } + return VK_SUCCESS; +} + +void VmaBlockVector::GetPoolStats(VmaPoolStats* pStats) +{ + pStats->size = 0; + pStats->unusedSize = 0; + pStats->allocationCount = 0; + pStats->unusedRangeCount = 0; + pStats->unusedRangeSizeMax = 0; + + VmaMutexLock lock(m_Mutex, m_hAllocator->m_UseMutex); + + for(uint32_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex) + { + const VmaDeviceMemoryBlock* const pBlock = m_Blocks[blockIndex]; + VMA_ASSERT(pBlock); + VMA_HEAVY_ASSERT(pBlock->Validate()); + pBlock->m_Metadata.AddPoolStats(*pStats); + } +} + +static const uint32_t VMA_ALLOCATION_TRY_COUNT = 32; + +VkResult VmaBlockVector::Allocate( + VmaPool hCurrentPool, + uint32_t currentFrameIndex, + const VkMemoryRequirements& vkMemReq, + const VmaAllocationCreateInfo& createInfo, + VmaSuballocationType suballocType, + VmaAllocation* pAllocation) +{ + const bool mapped = (createInfo.flags & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0; + const bool isUserDataString = (createInfo.flags & VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT) != 0; + + VmaMutexLock lock(m_Mutex, m_hAllocator->m_UseMutex); + + // 1. Search existing allocations. Try to allocate without making other allocations lost. + // Forward order in m_Blocks - prefer blocks with smallest amount of free space. + for(size_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex ) + { + VmaDeviceMemoryBlock* const pCurrBlock = m_Blocks[blockIndex]; + VMA_ASSERT(pCurrBlock); + VmaAllocationRequest currRequest = {}; + if(pCurrBlock->m_Metadata.CreateAllocationRequest( + currentFrameIndex, + m_FrameInUseCount, + m_BufferImageGranularity, + vkMemReq.size, + vkMemReq.alignment, + suballocType, + false, // canMakeOtherLost + &currRequest)) + { + // Allocate from pCurrBlock. + VMA_ASSERT(currRequest.itemsToMakeLostCount == 0); + + if(mapped) + { + VkResult res = pCurrBlock->Map(m_hAllocator, 1, VMA_NULL); + if(res != VK_SUCCESS) + { + return res; + } + } + + // We no longer have an empty Allocation. + if(pCurrBlock->m_Metadata.IsEmpty()) + { + m_HasEmptyBlock = false; + } + + *pAllocation = vma_new(m_hAllocator, VmaAllocation_T)(currentFrameIndex, isUserDataString); + pCurrBlock->m_Metadata.Alloc(currRequest, suballocType, vkMemReq.size, *pAllocation); + (*pAllocation)->InitBlockAllocation( + hCurrentPool, + pCurrBlock, + currRequest.offset, + vkMemReq.alignment, + vkMemReq.size, + suballocType, + mapped, + (createInfo.flags & VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT) != 0); + VMA_HEAVY_ASSERT(pCurrBlock->Validate()); + VMA_DEBUG_LOG(" Returned from existing allocation #%u", (uint32_t)blockIndex); + (*pAllocation)->SetUserData(m_hAllocator, createInfo.pUserData); + return VK_SUCCESS; + } + } + + const bool canCreateNewBlock = + ((createInfo.flags & VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT) == 0) && + (m_Blocks.size() < m_MaxBlockCount); + + // 2. Try to create new block. + if(canCreateNewBlock) + { + // Calculate optimal size for new block. + VkDeviceSize newBlockSize = m_PreferredBlockSize; + uint32_t newBlockSizeShift = 0; + const uint32_t NEW_BLOCK_SIZE_SHIFT_MAX = 3; + + // Allocating blocks of other sizes is allowed only in default pools. + // In custom pools block size is fixed. + if(m_IsCustomPool == false) + { + // Allocate 1/8, 1/4, 1/2 as first blocks. + const VkDeviceSize maxExistingBlockSize = CalcMaxBlockSize(); + for(uint32_t i = 0; i < NEW_BLOCK_SIZE_SHIFT_MAX; ++i) + { + const VkDeviceSize smallerNewBlockSize = newBlockSize / 2; + if(smallerNewBlockSize > maxExistingBlockSize && smallerNewBlockSize >= vkMemReq.size * 2) + { + newBlockSize = smallerNewBlockSize; + ++newBlockSizeShift; + } + else + { + break; + } + } + } + + size_t newBlockIndex = 0; + VkResult res = CreateBlock(newBlockSize, &newBlockIndex); + // Allocation of this size failed? Try 1/2, 1/4, 1/8 of m_PreferredBlockSize. + if(m_IsCustomPool == false) + { + while(res < 0 && newBlockSizeShift < NEW_BLOCK_SIZE_SHIFT_MAX) + { + const VkDeviceSize smallerNewBlockSize = newBlockSize / 2; + if(smallerNewBlockSize >= vkMemReq.size) + { + newBlockSize = smallerNewBlockSize; + ++newBlockSizeShift; + res = CreateBlock(newBlockSize, &newBlockIndex); + } + else + { + break; + } + } + } + + if(res == VK_SUCCESS) + { + VmaDeviceMemoryBlock* const pBlock = m_Blocks[newBlockIndex]; + VMA_ASSERT(pBlock->m_Metadata.GetSize() >= vkMemReq.size); + + if(mapped) + { + res = pBlock->Map(m_hAllocator, 1, VMA_NULL); + if(res != VK_SUCCESS) + { + return res; + } + } + + // Allocate from pBlock. Because it is empty, dstAllocRequest can be trivially filled. + VmaAllocationRequest allocRequest; + pBlock->m_Metadata.CreateFirstAllocationRequest(&allocRequest); + *pAllocation = vma_new(m_hAllocator, VmaAllocation_T)(currentFrameIndex, isUserDataString); + pBlock->m_Metadata.Alloc(allocRequest, suballocType, vkMemReq.size, *pAllocation); + (*pAllocation)->InitBlockAllocation( + hCurrentPool, + pBlock, + allocRequest.offset, + vkMemReq.alignment, + vkMemReq.size, + suballocType, + mapped, + (createInfo.flags & VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT) != 0); + VMA_HEAVY_ASSERT(pBlock->Validate()); + VMA_DEBUG_LOG(" Created new allocation Size=%llu", allocInfo.allocationSize); + (*pAllocation)->SetUserData(m_hAllocator, createInfo.pUserData); + return VK_SUCCESS; + } + } + + const bool canMakeOtherLost = (createInfo.flags & VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT) != 0; + + // 3. Try to allocate from existing blocks with making other allocations lost. + if(canMakeOtherLost) + { + uint32_t tryIndex = 0; + for(; tryIndex < VMA_ALLOCATION_TRY_COUNT; ++tryIndex) + { + VmaDeviceMemoryBlock* pBestRequestBlock = VMA_NULL; + VmaAllocationRequest bestRequest = {}; + VkDeviceSize bestRequestCost = VK_WHOLE_SIZE; + + // 1. Search existing allocations. + // Forward order in m_Blocks - prefer blocks with smallest amount of free space. + for(size_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex ) + { + VmaDeviceMemoryBlock* const pCurrBlock = m_Blocks[blockIndex]; + VMA_ASSERT(pCurrBlock); + VmaAllocationRequest currRequest = {}; + if(pCurrBlock->m_Metadata.CreateAllocationRequest( + currentFrameIndex, + m_FrameInUseCount, + m_BufferImageGranularity, + vkMemReq.size, + vkMemReq.alignment, + suballocType, + canMakeOtherLost, + &currRequest)) + { + const VkDeviceSize currRequestCost = currRequest.CalcCost(); + if(pBestRequestBlock == VMA_NULL || + currRequestCost < bestRequestCost) + { + pBestRequestBlock = pCurrBlock; + bestRequest = currRequest; + bestRequestCost = currRequestCost; + + if(bestRequestCost == 0) + { + break; + } + } + } + } + + if(pBestRequestBlock != VMA_NULL) + { + if(mapped) + { + VkResult res = pBestRequestBlock->Map(m_hAllocator, 1, VMA_NULL); + if(res != VK_SUCCESS) + { + return res; + } + } + + if(pBestRequestBlock->m_Metadata.MakeRequestedAllocationsLost( + currentFrameIndex, + m_FrameInUseCount, + &bestRequest)) + { + // We no longer have an empty Allocation. + if(pBestRequestBlock->m_Metadata.IsEmpty()) + { + m_HasEmptyBlock = false; + } + // Allocate from this pBlock. + *pAllocation = vma_new(m_hAllocator, VmaAllocation_T)(currentFrameIndex, isUserDataString); + pBestRequestBlock->m_Metadata.Alloc(bestRequest, suballocType, vkMemReq.size, *pAllocation); + (*pAllocation)->InitBlockAllocation( + hCurrentPool, + pBestRequestBlock, + bestRequest.offset, + vkMemReq.alignment, + vkMemReq.size, + suballocType, + mapped, + (createInfo.flags & VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT) != 0); + VMA_HEAVY_ASSERT(pBestRequestBlock->Validate()); + VMA_DEBUG_LOG(" Returned from existing allocation #%u", (uint32_t)blockIndex); + (*pAllocation)->SetUserData(m_hAllocator, createInfo.pUserData); + return VK_SUCCESS; + } + // else: Some allocations must have been touched while we are here. Next try. + } + else + { + // Could not find place in any of the blocks - break outer loop. + break; + } + } + /* Maximum number of tries exceeded - a very unlike event when many other + threads are simultaneously touching allocations making it impossible to make + lost at the same time as we try to allocate. */ + if(tryIndex == VMA_ALLOCATION_TRY_COUNT) + { + return VK_ERROR_TOO_MANY_OBJECTS; + } + } + + return VK_ERROR_OUT_OF_DEVICE_MEMORY; +} + +void VmaBlockVector::Free( + VmaAllocation hAllocation) +{ + VmaDeviceMemoryBlock* pBlockToDelete = VMA_NULL; + + // Scope for lock. + { + VmaMutexLock lock(m_Mutex, m_hAllocator->m_UseMutex); + + VmaDeviceMemoryBlock* pBlock = hAllocation->GetBlock(); + + if(hAllocation->IsPersistentMap()) + { + pBlock->Unmap(m_hAllocator, 1); + } + + pBlock->m_Metadata.Free(hAllocation); + VMA_HEAVY_ASSERT(pBlock->Validate()); + + VMA_DEBUG_LOG(" Freed from MemoryTypeIndex=%u", memTypeIndex); + + // pBlock became empty after this deallocation. + if(pBlock->m_Metadata.IsEmpty()) + { + // Already has empty Allocation. We don't want to have two, so delete this one. + if(m_HasEmptyBlock && m_Blocks.size() > m_MinBlockCount) + { + pBlockToDelete = pBlock; + Remove(pBlock); + } + // We now have first empty Allocation. + else + { + m_HasEmptyBlock = true; + } + } + // pBlock didn't become empty, but we have another empty block - find and free that one. + // (This is optional, heuristics.) + else if(m_HasEmptyBlock) + { + VmaDeviceMemoryBlock* pLastBlock = m_Blocks.back(); + if(pLastBlock->m_Metadata.IsEmpty() && m_Blocks.size() > m_MinBlockCount) + { + pBlockToDelete = pLastBlock; + m_Blocks.pop_back(); + m_HasEmptyBlock = false; + } + } + + IncrementallySortBlocks(); + } + + // Destruction of a free Allocation. Deferred until this point, outside of mutex + // lock, for performance reason. + if(pBlockToDelete != VMA_NULL) + { + VMA_DEBUG_LOG(" Deleted empty allocation"); + pBlockToDelete->Destroy(m_hAllocator); + vma_delete(m_hAllocator, pBlockToDelete); + } +} + +size_t VmaBlockVector::CalcMaxBlockSize() const +{ + size_t result = 0; + for(size_t i = m_Blocks.size(); i--; ) + { + result = static_cast(VMA_MAX((uint64_t)result, (uint64_t)m_Blocks[i]->m_Metadata.GetSize()) ); + if(result >= m_PreferredBlockSize) + { + break; + } + } + return result; +} + +void VmaBlockVector::Remove(VmaDeviceMemoryBlock* pBlock) +{ + for(uint32_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex) + { + if(m_Blocks[blockIndex] == pBlock) + { + VmaVectorRemove(m_Blocks, blockIndex); + return; + } + } + VMA_ASSERT(0); +} + +void VmaBlockVector::IncrementallySortBlocks() +{ + // Bubble sort only until first swap. + for(size_t i = 1; i < m_Blocks.size(); ++i) + { + if(m_Blocks[i - 1]->m_Metadata.GetSumFreeSize() > m_Blocks[i]->m_Metadata.GetSumFreeSize()) + { + VMA_SWAP(m_Blocks[i - 1], m_Blocks[i]); + return; + } + } +} + +VkResult VmaBlockVector::CreateBlock(VkDeviceSize blockSize, size_t* pNewBlockIndex) +{ + VkMemoryAllocateInfo allocInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO }; + allocInfo.memoryTypeIndex = m_MemoryTypeIndex; + allocInfo.allocationSize = blockSize; + VkDeviceMemory mem = VK_NULL_HANDLE; + VkResult res = m_hAllocator->AllocateVulkanMemory(&allocInfo, &mem); + if(res < 0) + { + return res; + } + + // New VkDeviceMemory successfully created. + + // Create new Allocation for it. + VmaDeviceMemoryBlock* const pBlock = vma_new(m_hAllocator, VmaDeviceMemoryBlock)(m_hAllocator); + pBlock->Init( + m_MemoryTypeIndex, + mem, + allocInfo.allocationSize); + + m_Blocks.push_back(pBlock); + if(pNewBlockIndex != VMA_NULL) + { + *pNewBlockIndex = m_Blocks.size() - 1; + } + + return VK_SUCCESS; +} + +#if VMA_STATS_STRING_ENABLED + +void VmaBlockVector::PrintDetailedMap(class VmaJsonWriter& json) +{ + VmaMutexLock lock(m_Mutex, m_hAllocator->m_UseMutex); + + json.BeginObject(); + + if(m_IsCustomPool) + { + json.WriteString("MemoryTypeIndex"); + json.WriteNumber(m_MemoryTypeIndex); + + json.WriteString("BlockSize"); + json.WriteNumber(m_PreferredBlockSize); + + json.WriteString("BlockCount"); + json.BeginObject(true); + if(m_MinBlockCount > 0) + { + json.WriteString("Min"); + json.WriteNumber((uint64_t)m_MinBlockCount); + } + if(m_MaxBlockCount < SIZE_MAX) + { + json.WriteString("Max"); + json.WriteNumber((uint64_t)m_MaxBlockCount); + } + json.WriteString("Cur"); + json.WriteNumber((uint64_t)m_Blocks.size()); + json.EndObject(); + + if(m_FrameInUseCount > 0) + { + json.WriteString("FrameInUseCount"); + json.WriteNumber(m_FrameInUseCount); + } + } + else + { + json.WriteString("PreferredBlockSize"); + json.WriteNumber(m_PreferredBlockSize); + } + + json.WriteString("Blocks"); + json.BeginArray(); + for(size_t i = 0; i < m_Blocks.size(); ++i) + { + m_Blocks[i]->m_Metadata.PrintDetailedMap(json); + } + json.EndArray(); + + json.EndObject(); +} + +#endif // #if VMA_STATS_STRING_ENABLED + +VmaDefragmentator* VmaBlockVector::EnsureDefragmentator( + VmaAllocator hAllocator, + uint32_t currentFrameIndex) +{ + if(m_pDefragmentator == VMA_NULL) + { + m_pDefragmentator = vma_new(m_hAllocator, VmaDefragmentator)( + hAllocator, + this, + currentFrameIndex); + } + + return m_pDefragmentator; +} + +VkResult VmaBlockVector::Defragment( + VmaDefragmentationStats* pDefragmentationStats, + VkDeviceSize& maxBytesToMove, + uint32_t& maxAllocationsToMove) +{ + if(m_pDefragmentator == VMA_NULL) + { + return VK_SUCCESS; + } + + VmaMutexLock lock(m_Mutex, m_hAllocator->m_UseMutex); + + // Defragment. + VkResult result = m_pDefragmentator->Defragment(maxBytesToMove, maxAllocationsToMove); + + // Accumulate statistics. + if(pDefragmentationStats != VMA_NULL) + { + const VkDeviceSize bytesMoved = m_pDefragmentator->GetBytesMoved(); + const uint32_t allocationsMoved = m_pDefragmentator->GetAllocationsMoved(); + pDefragmentationStats->bytesMoved += bytesMoved; + pDefragmentationStats->allocationsMoved += allocationsMoved; + VMA_ASSERT(bytesMoved <= maxBytesToMove); + VMA_ASSERT(allocationsMoved <= maxAllocationsToMove); + maxBytesToMove -= bytesMoved; + maxAllocationsToMove -= allocationsMoved; + } + + // Free empty blocks. + m_HasEmptyBlock = false; + for(size_t blockIndex = m_Blocks.size(); blockIndex--; ) + { + VmaDeviceMemoryBlock* pBlock = m_Blocks[blockIndex]; + if(pBlock->m_Metadata.IsEmpty()) + { + if(m_Blocks.size() > m_MinBlockCount) + { + if(pDefragmentationStats != VMA_NULL) + { + ++pDefragmentationStats->deviceMemoryBlocksFreed; + pDefragmentationStats->bytesFreed += pBlock->m_Metadata.GetSize(); + } + + VmaVectorRemove(m_Blocks, blockIndex); + pBlock->Destroy(m_hAllocator); + vma_delete(m_hAllocator, pBlock); + } + else + { + m_HasEmptyBlock = true; + } + } + } + + return result; +} + +void VmaBlockVector::DestroyDefragmentator() +{ + if(m_pDefragmentator != VMA_NULL) + { + vma_delete(m_hAllocator, m_pDefragmentator); + m_pDefragmentator = VMA_NULL; + } +} + +void VmaBlockVector::MakePoolAllocationsLost( + uint32_t currentFrameIndex, + size_t* pLostAllocationCount) +{ + VmaMutexLock lock(m_Mutex, m_hAllocator->m_UseMutex); + size_t lostAllocationCount = 0; + for(uint32_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex) + { + VmaDeviceMemoryBlock* const pBlock = m_Blocks[blockIndex]; + VMA_ASSERT(pBlock); + lostAllocationCount += pBlock->m_Metadata.MakeAllocationsLost(currentFrameIndex, m_FrameInUseCount); + } + if(pLostAllocationCount != VMA_NULL) + { + *pLostAllocationCount = lostAllocationCount; + } +} + +void VmaBlockVector::AddStats(VmaStats* pStats) +{ + const uint32_t memTypeIndex = m_MemoryTypeIndex; + const uint32_t memHeapIndex = m_hAllocator->MemoryTypeIndexToHeapIndex(memTypeIndex); + + VmaMutexLock lock(m_Mutex, m_hAllocator->m_UseMutex); + + for(uint32_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex) + { + const VmaDeviceMemoryBlock* const pBlock = m_Blocks[blockIndex]; + VMA_ASSERT(pBlock); + VMA_HEAVY_ASSERT(pBlock->Validate()); + VmaStatInfo allocationStatInfo; + pBlock->m_Metadata.CalcAllocationStatInfo(allocationStatInfo); + VmaAddStatInfo(pStats->total, allocationStatInfo); + VmaAddStatInfo(pStats->memoryType[memTypeIndex], allocationStatInfo); + VmaAddStatInfo(pStats->memoryHeap[memHeapIndex], allocationStatInfo); + } +} + +//////////////////////////////////////////////////////////////////////////////// +// VmaDefragmentator members definition + +VmaDefragmentator::VmaDefragmentator( + VmaAllocator hAllocator, + VmaBlockVector* pBlockVector, + uint32_t currentFrameIndex) : + m_hAllocator(hAllocator), + m_pBlockVector(pBlockVector), + m_CurrentFrameIndex(currentFrameIndex), + m_BytesMoved(0), + m_AllocationsMoved(0), + m_Allocations(VmaStlAllocator(hAllocator->GetAllocationCallbacks())), + m_Blocks(VmaStlAllocator(hAllocator->GetAllocationCallbacks())) +{ +} - VkDeviceSize lastSize = 0; - for(size_t i = 0; i < m_FreeSuballocationsBySize.size(); ++i) +VmaDefragmentator::~VmaDefragmentator() +{ + for(size_t i = m_Blocks.size(); i--; ) { - VmaSuballocationList::iterator suballocItem = m_FreeSuballocationsBySize[i]; - - // Only free suballocations can be registered in m_FreeSuballocationsBySize. - if(suballocItem->type != VMA_SUBALLOCATION_TYPE_FREE) - return false; - // They must be sorted by size ascending. - if(suballocItem->size < lastSize) - return false; - - lastSize = suballocItem->size; + vma_delete(m_hAllocator, m_Blocks[i]); } +} - // Check if totals match calculacted values. - return - (calculatedOffset == m_Size) && - (calculatedSumFreeSize == m_SumFreeSize) && - (calculatedFreeCount == m_FreeCount); +void VmaDefragmentator::AddAllocation(VmaAllocation hAlloc, VkBool32* pChanged) +{ + AllocationInfo allocInfo; + allocInfo.m_hAllocation = hAlloc; + allocInfo.m_pChanged = pChanged; + m_Allocations.push_back(allocInfo); } -/* -How many suitable free suballocations to analyze before choosing best one. -- Set to 1 to use First-Fit algorithm - first suitable free suballocation will - be chosen. -- Set to UINT32_MAX to use Best-Fit/Worst-Fit algorithm - all suitable free - suballocations will be analized and best one will be chosen. -- Any other value is also acceptable. -*/ -//static const uint32_t MAX_SUITABLE_SUBALLOCATIONS_TO_CHECK = 8; +VkResult VmaDefragmentator::BlockInfo::EnsureMapping(VmaAllocator hAllocator, void** ppMappedData) +{ + // It has already been mapped for defragmentation. + if(m_pMappedDataForDefragmentation) + { + *ppMappedData = m_pMappedDataForDefragmentation; + return VK_SUCCESS; + } + + // It is originally mapped. + if(m_pBlock->GetMappedData()) + { + *ppMappedData = m_pBlock->GetMappedData(); + return VK_SUCCESS; + } + + // Map on first usage. + VkResult res = m_pBlock->Map(hAllocator, 1, &m_pMappedDataForDefragmentation); + *ppMappedData = m_pMappedDataForDefragmentation; + return res; +} -bool VmaAllocation::CreateAllocationRequest( - VkDeviceSize bufferImageGranularity, - VkDeviceSize allocSize, - VkDeviceSize allocAlignment, - VmaSuballocationType allocType, - VmaAllocationRequest* pAllocationRequest) +void VmaDefragmentator::BlockInfo::Unmap(VmaAllocator hAllocator) { - VMA_ASSERT(allocSize > 0); - VMA_ASSERT(allocType != VMA_SUBALLOCATION_TYPE_FREE); - VMA_ASSERT(pAllocationRequest != VMA_NULL); - VMA_HEAVY_ASSERT(Validate()); + if(m_pMappedDataForDefragmentation != VMA_NULL) + { + m_pBlock->Unmap(hAllocator, 1); + } +} - // There is not enough total free space in this allocation to fullfill the request: Early return. - if(m_SumFreeSize < allocSize) - return false; +VkResult VmaDefragmentator::DefragmentRound( + VkDeviceSize maxBytesToMove, + uint32_t maxAllocationsToMove) +{ + if(m_Blocks.empty()) + { + return VK_SUCCESS; + } - // Old brute-force algorithm, linearly searching suballocations. - /* - uint32_t suitableSuballocationsFound = 0; - for(VmaSuballocationList::iterator suballocItem = suballocations.Front(); - suballocItem != VMA_NULL && - suitableSuballocationsFound < MAX_SUITABLE_SUBALLOCATIONS_TO_CHECK; - suballocItem = suballocItem->Next) + size_t srcBlockIndex = m_Blocks.size() - 1; + size_t srcAllocIndex = SIZE_MAX; + for(;;) { - if(suballocItem->Value.type == VMA_SUBALLOCATION_TYPE_FREE) + // 1. Find next allocation to move. + // 1.1. Start from last to first m_Blocks - they are sorted from most "destination" to most "source". + // 1.2. Then start from last to first m_Allocations - they are sorted from largest to smallest. + while(srcAllocIndex >= m_Blocks[srcBlockIndex]->m_Allocations.size()) { - VkDeviceSize offset = 0, cost = 0; - if(CheckAllocation(bufferImageGranularity, allocSize, allocAlignment, allocType, suballocItem, &offset, &cost)) + if(m_Blocks[srcBlockIndex]->m_Allocations.empty()) { - ++suitableSuballocationsFound; - if(cost < costLimit) + // Finished: no more allocations to process. + if(srcBlockIndex == 0) + { + return VK_SUCCESS; + } + else { - pAllocationRequest->freeSuballocationItem = suballocItem; - pAllocationRequest->offset = offset; - pAllocationRequest->cost = cost; - if(cost == 0) - return true; - costLimit = cost; - betterSuballocationFound = true; + --srcBlockIndex; + srcAllocIndex = SIZE_MAX; } } + else + { + srcAllocIndex = m_Blocks[srcBlockIndex]->m_Allocations.size() - 1; + } } - } - */ + + BlockInfo* pSrcBlockInfo = m_Blocks[srcBlockIndex]; + AllocationInfo& allocInfo = pSrcBlockInfo->m_Allocations[srcAllocIndex]; - // New algorithm, efficiently searching freeSuballocationsBySize. - const size_t freeSuballocCount = m_FreeSuballocationsBySize.size(); - if(freeSuballocCount > 0) - { - if(VMA_BEST_FIT) + const VkDeviceSize size = allocInfo.m_hAllocation->GetSize(); + const VkDeviceSize srcOffset = allocInfo.m_hAllocation->GetOffset(); + const VkDeviceSize alignment = allocInfo.m_hAllocation->GetAlignment(); + const VmaSuballocationType suballocType = allocInfo.m_hAllocation->GetSuballocationType(); + + // 2. Try to find new place for this allocation in preceding or current block. + for(size_t dstBlockIndex = 0; dstBlockIndex <= srcBlockIndex; ++dstBlockIndex) { - // Find first free suballocation with size not less than allocSize. - VmaSuballocationList::iterator* const it = VmaBinaryFindFirstNotLess( - m_FreeSuballocationsBySize.data(), - m_FreeSuballocationsBySize.data() + freeSuballocCount, - allocSize, - VmaSuballocationItemSizeLess()); - size_t index = it - m_FreeSuballocationsBySize.data(); - for(; index < freeSuballocCount; ++index) + BlockInfo* pDstBlockInfo = m_Blocks[dstBlockIndex]; + VmaAllocationRequest dstAllocRequest; + if(pDstBlockInfo->m_pBlock->m_Metadata.CreateAllocationRequest( + m_CurrentFrameIndex, + m_pBlockVector->GetFrameInUseCount(), + m_pBlockVector->GetBufferImageGranularity(), + size, + alignment, + suballocType, + false, // canMakeOtherLost + &dstAllocRequest) && + MoveMakesSense( + dstBlockIndex, dstAllocRequest.offset, srcBlockIndex, srcOffset)) { - VkDeviceSize offset = 0; - const VmaSuballocationList::iterator suballocItem = m_FreeSuballocationsBySize[index]; - if(CheckAllocation(bufferImageGranularity, allocSize, allocAlignment, allocType, suballocItem, &offset)) + VMA_ASSERT(dstAllocRequest.itemsToMakeLostCount == 0); + + // Reached limit on number of allocations or bytes to move. + if((m_AllocationsMoved + 1 > maxAllocationsToMove) || + (m_BytesMoved + size > maxBytesToMove)) { - pAllocationRequest->freeSuballocationItem = suballocItem; - pAllocationRequest->offset = offset; - return true; + return VK_INCOMPLETE; + } + + void* pDstMappedData = VMA_NULL; + VkResult res = pDstBlockInfo->EnsureMapping(m_hAllocator, &pDstMappedData); + if(res != VK_SUCCESS) + { + return res; + } + + void* pSrcMappedData = VMA_NULL; + res = pSrcBlockInfo->EnsureMapping(m_hAllocator, &pSrcMappedData); + if(res != VK_SUCCESS) + { + return res; + } + + // THE PLACE WHERE ACTUAL DATA COPY HAPPENS. + memcpy( + reinterpret_cast(pDstMappedData) + dstAllocRequest.offset, + reinterpret_cast(pSrcMappedData) + srcOffset, + static_cast(size)); + + pDstBlockInfo->m_pBlock->m_Metadata.Alloc(dstAllocRequest, suballocType, size, allocInfo.m_hAllocation); + pSrcBlockInfo->m_pBlock->m_Metadata.FreeAtOffset(srcOffset); + + allocInfo.m_hAllocation->ChangeBlockAllocation(m_hAllocator, pDstBlockInfo->m_pBlock, dstAllocRequest.offset); + + if(allocInfo.m_pChanged != VMA_NULL) + { + *allocInfo.m_pChanged = VK_TRUE; } + + ++m_AllocationsMoved; + m_BytesMoved += size; + + VmaVectorRemove(pSrcBlockInfo->m_Allocations, srcAllocIndex); + + break; } } + + // If not processed, this allocInfo remains in pBlockInfo->m_Allocations for next round. + + if(srcAllocIndex > 0) + { + --srcAllocIndex; + } else { - // Search staring from biggest suballocations. - for(size_t index = freeSuballocCount; index--; ) + if(srcBlockIndex > 0) { - VkDeviceSize offset = 0; - const VmaSuballocationList::iterator suballocItem = m_FreeSuballocationsBySize[index]; - if(CheckAllocation(bufferImageGranularity, allocSize, allocAlignment, allocType, suballocItem, &offset)) - { - pAllocationRequest->freeSuballocationItem = suballocItem; - pAllocationRequest->offset = offset; - return true; - } + --srcBlockIndex; + srcAllocIndex = SIZE_MAX; + } + else + { + return VK_SUCCESS; + } + } + } +} + +VkResult VmaDefragmentator::Defragment( + VkDeviceSize maxBytesToMove, + uint32_t maxAllocationsToMove) +{ + if(m_Allocations.empty()) + { + return VK_SUCCESS; + } + + // Create block info for each block. + const size_t blockCount = m_pBlockVector->m_Blocks.size(); + for(size_t blockIndex = 0; blockIndex < blockCount; ++blockIndex) + { + BlockInfo* pBlockInfo = vma_new(m_hAllocator, BlockInfo)(m_hAllocator->GetAllocationCallbacks()); + pBlockInfo->m_pBlock = m_pBlockVector->m_Blocks[blockIndex]; + m_Blocks.push_back(pBlockInfo); + } + + // Sort them by m_pBlock pointer value. + VMA_SORT(m_Blocks.begin(), m_Blocks.end(), BlockPointerLess()); + + // Move allocation infos from m_Allocations to appropriate m_Blocks[memTypeIndex].m_Allocations. + for(size_t blockIndex = 0, allocCount = m_Allocations.size(); blockIndex < allocCount; ++blockIndex) + { + AllocationInfo& allocInfo = m_Allocations[blockIndex]; + // Now as we are inside VmaBlockVector::m_Mutex, we can make final check if this allocation was not lost. + if(allocInfo.m_hAllocation->GetLastUseFrameIndex() != VMA_FRAME_INDEX_LOST) + { + VmaDeviceMemoryBlock* pBlock = allocInfo.m_hAllocation->GetBlock(); + BlockInfoVector::iterator it = VmaBinaryFindFirstNotLess(m_Blocks.begin(), m_Blocks.end(), pBlock, BlockPointerLess()); + if(it != m_Blocks.end() && (*it)->m_pBlock == pBlock) + { + (*it)->m_Allocations.push_back(allocInfo); + } + else + { + VMA_ASSERT(0); } } } + m_Allocations.clear(); + + for(size_t blockIndex = 0; blockIndex < blockCount; ++blockIndex) + { + BlockInfo* pBlockInfo = m_Blocks[blockIndex]; + pBlockInfo->CalcHasNonMovableAllocations(); + pBlockInfo->SortAllocationsBySizeDescecnding(); + } + // Sort m_Blocks this time by the main criterium, from most "destination" to most "source" blocks. + VMA_SORT(m_Blocks.begin(), m_Blocks.end(), BlockInfoCompareMoveDestination()); + + // Execute defragmentation rounds (the main part). + VkResult result = VK_SUCCESS; + for(size_t round = 0; (round < 2) && (result == VK_SUCCESS); ++round) + { + result = DefragmentRound(maxBytesToMove, maxAllocationsToMove); + } + + // Unmap blocks that were mapped for defragmentation. + for(size_t blockIndex = 0; blockIndex < blockCount; ++blockIndex) + { + m_Blocks[blockIndex]->Unmap(m_hAllocator); + } + + return result; +} + +bool VmaDefragmentator::MoveMakesSense( + size_t dstBlockIndex, VkDeviceSize dstOffset, + size_t srcBlockIndex, VkDeviceSize srcOffset) +{ + if(dstBlockIndex < srcBlockIndex) + { + return true; + } + if(dstBlockIndex > srcBlockIndex) + { + return false; + } + if(dstOffset < srcOffset) + { + return true; + } return false; } -bool VmaAllocation::CheckAllocation( - VkDeviceSize bufferImageGranularity, - VkDeviceSize allocSize, - VkDeviceSize allocAlignment, - VmaSuballocationType allocType, - VmaSuballocationList::const_iterator freeSuballocItem, - VkDeviceSize* pOffset) const +//////////////////////////////////////////////////////////////////////////////// +// VmaAllocator_T + +VmaAllocator_T::VmaAllocator_T(const VmaAllocatorCreateInfo* pCreateInfo) : + m_UseMutex((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT) == 0), + m_UseKhrDedicatedAllocation((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT) != 0), + m_hDevice(pCreateInfo->device), + m_AllocationCallbacksSpecified(pCreateInfo->pAllocationCallbacks != VMA_NULL), + m_AllocationCallbacks(pCreateInfo->pAllocationCallbacks ? + *pCreateInfo->pAllocationCallbacks : VmaEmptyAllocationCallbacks), + m_PreferredLargeHeapBlockSize(0), + m_PhysicalDevice(pCreateInfo->physicalDevice), + m_CurrentFrameIndex(0), + m_Pools(VmaStlAllocator(GetAllocationCallbacks())) { - VMA_ASSERT(allocSize > 0); - VMA_ASSERT(allocType != VMA_SUBALLOCATION_TYPE_FREE); - VMA_ASSERT(freeSuballocItem != m_Suballocations.cend()); - VMA_ASSERT(pOffset != VMA_NULL); + VMA_ASSERT(pCreateInfo->physicalDevice && pCreateInfo->device); - const VmaSuballocation& suballoc = *freeSuballocItem; - VMA_ASSERT(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE); +#if !(VMA_DEDICATED_ALLOCATION) + if((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT) != 0) + { + VMA_ASSERT(0 && "VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT set but required extensions are disabled by preprocessor macros."); + } +#endif - // Size of this suballocation is too small for this request: Early return. - if(suballoc.size < allocSize) - return false; + memset(&m_DeviceMemoryCallbacks, 0 ,sizeof(m_DeviceMemoryCallbacks)); + memset(&m_MemProps, 0, sizeof(m_MemProps)); + memset(&m_PhysicalDeviceProperties, 0, sizeof(m_PhysicalDeviceProperties)); + + memset(&m_pBlockVectors, 0, sizeof(m_pBlockVectors)); + memset(&m_pDedicatedAllocations, 0, sizeof(m_pDedicatedAllocations)); - // Start from offset equal to beginning of this suballocation. - *pOffset = suballoc.offset; - - // Apply VMA_DEBUG_MARGIN at the beginning. - if((VMA_DEBUG_MARGIN > 0) && freeSuballocItem != m_Suballocations.cbegin()) - *pOffset += VMA_DEBUG_MARGIN; - - // Apply alignment. - const VkDeviceSize alignment = VMA_MAX(allocAlignment, VMA_DEBUG_ALIGNMENT); - *pOffset = VmaAlignUp(*pOffset, alignment); - - // Check previous suballocations for BufferImageGranularity conflicts. - // Make bigger alignment if necessary. - if(bufferImageGranularity > 1) + for(uint32_t i = 0; i < VK_MAX_MEMORY_HEAPS; ++i) + { + m_HeapSizeLimit[i] = VK_WHOLE_SIZE; + } + + if(pCreateInfo->pDeviceMemoryCallbacks != VMA_NULL) + { + m_DeviceMemoryCallbacks.pfnAllocate = pCreateInfo->pDeviceMemoryCallbacks->pfnAllocate; + m_DeviceMemoryCallbacks.pfnFree = pCreateInfo->pDeviceMemoryCallbacks->pfnFree; + } + + ImportVulkanFunctions(pCreateInfo->pVulkanFunctions); + + (*m_VulkanFunctions.vkGetPhysicalDeviceProperties)(m_PhysicalDevice, &m_PhysicalDeviceProperties); + (*m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties)(m_PhysicalDevice, &m_MemProps); + + m_PreferredLargeHeapBlockSize = (pCreateInfo->preferredLargeHeapBlockSize != 0) ? + pCreateInfo->preferredLargeHeapBlockSize : static_cast(VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE); + + if(pCreateInfo->pHeapSizeLimit != VMA_NULL) { - bool bufferImageGranularityConflict = false; - VmaSuballocationList::const_iterator prevSuballocItem = freeSuballocItem; - while(prevSuballocItem != m_Suballocations.cbegin()) + for(uint32_t heapIndex = 0; heapIndex < GetMemoryHeapCount(); ++heapIndex) { - --prevSuballocItem; - const VmaSuballocation& prevSuballoc = *prevSuballocItem; - if(VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, *pOffset, bufferImageGranularity)) + const VkDeviceSize limit = pCreateInfo->pHeapSizeLimit[heapIndex]; + if(limit != VK_WHOLE_SIZE) { - if(VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType)) + m_HeapSizeLimit[heapIndex] = limit; + if(limit < m_MemProps.memoryHeaps[heapIndex].size) { - bufferImageGranularityConflict = true; - break; + m_MemProps.memoryHeaps[heapIndex].size = limit; } } - else - // Already on previous page. - break; } - if(bufferImageGranularityConflict) - *pOffset = VmaAlignUp(*pOffset, bufferImageGranularity); } - - // Calculate padding at the beginning based on current offset. - const VkDeviceSize paddingBegin = *pOffset - suballoc.offset; - // Calculate required margin at the end if this is not last suballocation. - VmaSuballocationList::const_iterator next = freeSuballocItem; - ++next; - const VkDeviceSize requiredEndMargin = - (next != m_Suballocations.cend()) ? VMA_DEBUG_MARGIN : 0; + for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex) + { + const VkDeviceSize preferredBlockSize = CalcPreferredBlockSize(memTypeIndex); + + m_pBlockVectors[memTypeIndex] = vma_new(this, VmaBlockVector)( + this, + memTypeIndex, + preferredBlockSize, + 0, + SIZE_MAX, + GetBufferImageGranularity(), + pCreateInfo->frameInUseCount, + false); // isCustomPool + // No need to call m_pBlockVectors[memTypeIndex][blockVectorTypeIndex]->CreateMinBlocks here, + // becase minBlockCount is 0. + m_pDedicatedAllocations[memTypeIndex] = vma_new(this, AllocationVectorType)(VmaStlAllocator(GetAllocationCallbacks())); + } +} + +VmaAllocator_T::~VmaAllocator_T() +{ + VMA_ASSERT(m_Pools.empty()); - // Fail if requested size plus margin before and after is bigger than size of this suballocation. - if(paddingBegin + allocSize + requiredEndMargin > suballoc.size) - return false; + for(size_t i = GetMemoryTypeCount(); i--; ) + { + vma_delete(this, m_pDedicatedAllocations[i]); + vma_delete(this, m_pBlockVectors[i]); + } +} + +void VmaAllocator_T::ImportVulkanFunctions(const VmaVulkanFunctions* pVulkanFunctions) +{ +#if VMA_STATIC_VULKAN_FUNCTIONS == 1 + m_VulkanFunctions.vkGetPhysicalDeviceProperties = &vkGetPhysicalDeviceProperties; + m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties = &vkGetPhysicalDeviceMemoryProperties; + m_VulkanFunctions.vkAllocateMemory = &vkAllocateMemory; + m_VulkanFunctions.vkFreeMemory = &vkFreeMemory; + m_VulkanFunctions.vkMapMemory = &vkMapMemory; + m_VulkanFunctions.vkUnmapMemory = &vkUnmapMemory; + m_VulkanFunctions.vkBindBufferMemory = &vkBindBufferMemory; + m_VulkanFunctions.vkBindImageMemory = &vkBindImageMemory; + m_VulkanFunctions.vkGetBufferMemoryRequirements = &vkGetBufferMemoryRequirements; + m_VulkanFunctions.vkGetImageMemoryRequirements = &vkGetImageMemoryRequirements; + m_VulkanFunctions.vkCreateBuffer = &vkCreateBuffer; + m_VulkanFunctions.vkDestroyBuffer = &vkDestroyBuffer; + m_VulkanFunctions.vkCreateImage = &vkCreateImage; + m_VulkanFunctions.vkDestroyImage = &vkDestroyImage; +#if VMA_DEDICATED_ALLOCATION + if(m_UseKhrDedicatedAllocation) + { + m_VulkanFunctions.vkGetBufferMemoryRequirements2KHR = + (PFN_vkGetBufferMemoryRequirements2KHR)vkGetDeviceProcAddr(m_hDevice, "vkGetBufferMemoryRequirements2KHR"); + m_VulkanFunctions.vkGetImageMemoryRequirements2KHR = + (PFN_vkGetImageMemoryRequirements2KHR)vkGetDeviceProcAddr(m_hDevice, "vkGetImageMemoryRequirements2KHR"); + } +#endif // #if VMA_DEDICATED_ALLOCATION +#endif // #if VMA_STATIC_VULKAN_FUNCTIONS == 1 + +#define VMA_COPY_IF_NOT_NULL(funcName) \ + if(pVulkanFunctions->funcName != VMA_NULL) m_VulkanFunctions.funcName = pVulkanFunctions->funcName; + + if(pVulkanFunctions != VMA_NULL) + { + VMA_COPY_IF_NOT_NULL(vkGetPhysicalDeviceProperties); + VMA_COPY_IF_NOT_NULL(vkGetPhysicalDeviceMemoryProperties); + VMA_COPY_IF_NOT_NULL(vkAllocateMemory); + VMA_COPY_IF_NOT_NULL(vkFreeMemory); + VMA_COPY_IF_NOT_NULL(vkMapMemory); + VMA_COPY_IF_NOT_NULL(vkUnmapMemory); + VMA_COPY_IF_NOT_NULL(vkBindBufferMemory); + VMA_COPY_IF_NOT_NULL(vkBindImageMemory); + VMA_COPY_IF_NOT_NULL(vkGetBufferMemoryRequirements); + VMA_COPY_IF_NOT_NULL(vkGetImageMemoryRequirements); + VMA_COPY_IF_NOT_NULL(vkCreateBuffer); + VMA_COPY_IF_NOT_NULL(vkDestroyBuffer); + VMA_COPY_IF_NOT_NULL(vkCreateImage); + VMA_COPY_IF_NOT_NULL(vkDestroyImage); +#if VMA_DEDICATED_ALLOCATION + VMA_COPY_IF_NOT_NULL(vkGetBufferMemoryRequirements2KHR); + VMA_COPY_IF_NOT_NULL(vkGetImageMemoryRequirements2KHR); +#endif + } + +#undef VMA_COPY_IF_NOT_NULL + + // If these asserts are hit, you must either #define VMA_STATIC_VULKAN_FUNCTIONS 1 + // or pass valid pointers as VmaAllocatorCreateInfo::pVulkanFunctions. + VMA_ASSERT(m_VulkanFunctions.vkGetPhysicalDeviceProperties != VMA_NULL); + VMA_ASSERT(m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties != VMA_NULL); + VMA_ASSERT(m_VulkanFunctions.vkAllocateMemory != VMA_NULL); + VMA_ASSERT(m_VulkanFunctions.vkFreeMemory != VMA_NULL); + VMA_ASSERT(m_VulkanFunctions.vkMapMemory != VMA_NULL); + VMA_ASSERT(m_VulkanFunctions.vkUnmapMemory != VMA_NULL); + VMA_ASSERT(m_VulkanFunctions.vkBindBufferMemory != VMA_NULL); + VMA_ASSERT(m_VulkanFunctions.vkBindImageMemory != VMA_NULL); + VMA_ASSERT(m_VulkanFunctions.vkGetBufferMemoryRequirements != VMA_NULL); + VMA_ASSERT(m_VulkanFunctions.vkGetImageMemoryRequirements != VMA_NULL); + VMA_ASSERT(m_VulkanFunctions.vkCreateBuffer != VMA_NULL); + VMA_ASSERT(m_VulkanFunctions.vkDestroyBuffer != VMA_NULL); + VMA_ASSERT(m_VulkanFunctions.vkCreateImage != VMA_NULL); + VMA_ASSERT(m_VulkanFunctions.vkDestroyImage != VMA_NULL); +#if VMA_DEDICATED_ALLOCATION + if(m_UseKhrDedicatedAllocation) + { + VMA_ASSERT(m_VulkanFunctions.vkGetBufferMemoryRequirements2KHR != VMA_NULL); + VMA_ASSERT(m_VulkanFunctions.vkGetImageMemoryRequirements2KHR != VMA_NULL); + } +#endif +} + +VkDeviceSize VmaAllocator_T::CalcPreferredBlockSize(uint32_t memTypeIndex) +{ + const uint32_t heapIndex = MemoryTypeIndexToHeapIndex(memTypeIndex); + const VkDeviceSize heapSize = m_MemProps.memoryHeaps[heapIndex].size; + const bool isSmallHeap = heapSize <= VMA_SMALL_HEAP_MAX_SIZE; + return isSmallHeap ? (heapSize / 8) : m_PreferredLargeHeapBlockSize; +} + +VkResult VmaAllocator_T::AllocateMemoryOfType( + const VkMemoryRequirements& vkMemReq, + bool dedicatedAllocation, + VkBuffer dedicatedBuffer, + VkImage dedicatedImage, + const VmaAllocationCreateInfo& createInfo, + uint32_t memTypeIndex, + VmaSuballocationType suballocType, + VmaAllocation* pAllocation) +{ + VMA_ASSERT(pAllocation != VMA_NULL); + VMA_DEBUG_LOG(" AllocateMemory: MemoryTypeIndex=%u, Size=%llu", memTypeIndex, vkMemReq.size); - // Check next suballocations for BufferImageGranularity conflicts. - // If conflict exists, allocation cannot be made here. - if(bufferImageGranularity > 1) + VmaAllocationCreateInfo finalCreateInfo = createInfo; + + // If memory type is not HOST_VISIBLE, disable MAPPED. + if((finalCreateInfo.flags & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0 && + (m_MemProps.memoryTypes[memTypeIndex].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0) + { + finalCreateInfo.flags &= ~VMA_ALLOCATION_CREATE_MAPPED_BIT; + } + + VmaBlockVector* const blockVector = m_pBlockVectors[memTypeIndex]; + VMA_ASSERT(blockVector); + + const VkDeviceSize preferredBlockSize = blockVector->GetPreferredBlockSize(); + bool preferDedicatedMemory = + VMA_DEBUG_ALWAYS_DEDICATED_MEMORY || + dedicatedAllocation || + // Heuristics: Allocate dedicated memory if requested size if greater than half of preferred block size. + vkMemReq.size > preferredBlockSize / 2; + + if(preferDedicatedMemory && + (finalCreateInfo.flags & VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT) == 0 && + finalCreateInfo.pool == VK_NULL_HANDLE) + { + finalCreateInfo.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; + } + + if((finalCreateInfo.flags & VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT) != 0) + { + if((finalCreateInfo.flags & VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT) != 0) + { + return VK_ERROR_OUT_OF_DEVICE_MEMORY; + } + else + { + return AllocateDedicatedMemory( + vkMemReq.size, + suballocType, + memTypeIndex, + (finalCreateInfo.flags & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0, + (finalCreateInfo.flags & VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT) != 0, + finalCreateInfo.pUserData, + dedicatedBuffer, + dedicatedImage, + pAllocation); + } + } + else { - VmaSuballocationList::const_iterator nextSuballocItem = freeSuballocItem; - ++nextSuballocItem; - while(nextSuballocItem != m_Suballocations.cend()) + VkResult res = blockVector->Allocate( + VK_NULL_HANDLE, // hCurrentPool + m_CurrentFrameIndex.load(), + vkMemReq, + finalCreateInfo, + suballocType, + pAllocation); + if(res == VK_SUCCESS) + { + return res; + } + + // 5. Try dedicated memory. + if((finalCreateInfo.flags & VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT) != 0) + { + return VK_ERROR_OUT_OF_DEVICE_MEMORY; + } + else { - const VmaSuballocation& nextSuballoc = *nextSuballocItem; - if(VmaBlocksOnSamePage(*pOffset, allocSize, nextSuballoc.offset, bufferImageGranularity)) + res = AllocateDedicatedMemory( + vkMemReq.size, + suballocType, + memTypeIndex, + (finalCreateInfo.flags & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0, + (finalCreateInfo.flags & VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT) != 0, + finalCreateInfo.pUserData, + dedicatedBuffer, + dedicatedImage, + pAllocation); + if(res == VK_SUCCESS) { - if(VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type)) - return false; + // Succeeded: AllocateDedicatedMemory function already filld pMemory, nothing more to do here. + VMA_DEBUG_LOG(" Allocated as DedicatedMemory"); + return VK_SUCCESS; } else - // Already on next page. - break; - ++nextSuballocItem; + { + // Everything failed: Return error code. + VMA_DEBUG_LOG(" vkAllocateMemory FAILED"); + return res; + } } } - - // All tests passed: Success. pOffset is already filled. - return true; } -bool VmaAllocation::IsEmpty() const +VkResult VmaAllocator_T::AllocateDedicatedMemory( + VkDeviceSize size, + VmaSuballocationType suballocType, + uint32_t memTypeIndex, + bool map, + bool isUserDataString, + void* pUserData, + VkBuffer dedicatedBuffer, + VkImage dedicatedImage, + VmaAllocation* pAllocation) { - return (m_Suballocations.size() == 1) && (m_FreeCount == 1); -} + VMA_ASSERT(pAllocation); -void VmaAllocation::Alloc( - const VmaAllocationRequest& request, - VmaSuballocationType type, - VkDeviceSize allocSize) -{ - VMA_ASSERT(request.freeSuballocationItem != m_Suballocations.end()); - VmaSuballocation& suballoc = *request.freeSuballocationItem; - // Given suballocation is a free block. - VMA_ASSERT(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE); - // Given offset is inside this suballocation. - VMA_ASSERT(request.offset >= suballoc.offset); - const VkDeviceSize paddingBegin = request.offset - suballoc.offset; - VMA_ASSERT(suballoc.size >= paddingBegin + allocSize); - const VkDeviceSize paddingEnd = suballoc.size - paddingBegin - allocSize; + VkMemoryAllocateInfo allocInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO }; + allocInfo.memoryTypeIndex = memTypeIndex; + allocInfo.allocationSize = size; - // Unregister this free suballocation from m_FreeSuballocationsBySize and update - // it to become used. - UnregisterFreeSuballocation(request.freeSuballocationItem); +#if VMA_DEDICATED_ALLOCATION + VkMemoryDedicatedAllocateInfoKHR dedicatedAllocInfo = { VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR }; + if(m_UseKhrDedicatedAllocation) + { + if(dedicatedBuffer != VK_NULL_HANDLE) + { + VMA_ASSERT(dedicatedImage == VK_NULL_HANDLE); + dedicatedAllocInfo.buffer = dedicatedBuffer; + allocInfo.pNext = &dedicatedAllocInfo; + } + else if(dedicatedImage != VK_NULL_HANDLE) + { + dedicatedAllocInfo.image = dedicatedImage; + allocInfo.pNext = &dedicatedAllocInfo; + } + } +#endif // #if VMA_DEDICATED_ALLOCATION - suballoc.offset = request.offset; - suballoc.size = allocSize; - suballoc.type = type; + // Allocate VkDeviceMemory. + VkDeviceMemory hMemory = VK_NULL_HANDLE; + VkResult res = AllocateVulkanMemory(&allocInfo, &hMemory); + if(res < 0) + { + VMA_DEBUG_LOG(" vkAllocateMemory FAILED"); + return res; + } - // If there are any free bytes remaining at the end, insert new free suballocation after current one. - if(paddingEnd) + void* pMappedData = VMA_NULL; + if(map) { - VmaSuballocation paddingSuballoc = {}; - paddingSuballoc.offset = request.offset + allocSize; - paddingSuballoc.size = paddingEnd; - paddingSuballoc.type = VMA_SUBALLOCATION_TYPE_FREE; - VmaSuballocationList::iterator next = request.freeSuballocationItem; - ++next; - const VmaSuballocationList::iterator paddingEndItem = - m_Suballocations.insert(next, paddingSuballoc); - RegisterFreeSuballocation(paddingEndItem); + res = (*m_VulkanFunctions.vkMapMemory)( + m_hDevice, + hMemory, + 0, + VK_WHOLE_SIZE, + 0, + &pMappedData); + if(res < 0) + { + VMA_DEBUG_LOG(" vkMapMemory FAILED"); + FreeVulkanMemory(memTypeIndex, size, hMemory); + return res; + } } - // If there are any free bytes remaining at the beginning, insert new free suballocation before current one. - if(paddingBegin) + *pAllocation = vma_new(this, VmaAllocation_T)(m_CurrentFrameIndex.load(), isUserDataString); + (*pAllocation)->InitDedicatedAllocation(memTypeIndex, hMemory, suballocType, pMappedData, size); + (*pAllocation)->SetUserData(this, pUserData); + + // Register it in m_pDedicatedAllocations. { - VmaSuballocation paddingSuballoc = {}; - paddingSuballoc.offset = request.offset - paddingBegin; - paddingSuballoc.size = paddingBegin; - paddingSuballoc.type = VMA_SUBALLOCATION_TYPE_FREE; - const VmaSuballocationList::iterator paddingBeginItem = - m_Suballocations.insert(request.freeSuballocationItem, paddingSuballoc); - RegisterFreeSuballocation(paddingBeginItem); + VmaMutexLock lock(m_DedicatedAllocationsMutex[memTypeIndex], m_UseMutex); + AllocationVectorType* pDedicatedAllocations = m_pDedicatedAllocations[memTypeIndex]; + VMA_ASSERT(pDedicatedAllocations); + VmaVectorInsertSorted(*pDedicatedAllocations, *pAllocation); } - // Update totals. - m_FreeCount = m_FreeCount - 1; - if(paddingBegin > 0) - ++m_FreeCount; - if(paddingEnd > 0) - ++m_FreeCount; - m_SumFreeSize -= allocSize; + VMA_DEBUG_LOG(" Allocated DedicatedMemory MemoryTypeIndex=#%u", memTypeIndex); + + return VK_SUCCESS; } -void VmaAllocation::FreeSuballocation(VmaSuballocationList::iterator suballocItem) +void VmaAllocator_T::GetBufferMemoryRequirements( + VkBuffer hBuffer, + VkMemoryRequirements& memReq, + bool& requiresDedicatedAllocation, + bool& prefersDedicatedAllocation) const { - // Change this suballocation to be marked as free. - VmaSuballocation& suballoc = *suballocItem; - suballoc.type = VMA_SUBALLOCATION_TYPE_FREE; - - // Update totals. - ++m_FreeCount; - m_SumFreeSize += suballoc.size; +#if VMA_DEDICATED_ALLOCATION + if(m_UseKhrDedicatedAllocation) + { + VkBufferMemoryRequirementsInfo2KHR memReqInfo = { VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR }; + memReqInfo.buffer = hBuffer; - // Merge with previous and/or next suballocation if it's also free. - bool mergeWithNext = false; - bool mergeWithPrev = false; - - VmaSuballocationList::iterator nextItem = suballocItem; - ++nextItem; - if((nextItem != m_Suballocations.end()) && (nextItem->type == VMA_SUBALLOCATION_TYPE_FREE)) - mergeWithNext = true; + VkMemoryDedicatedRequirementsKHR memDedicatedReq = { VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR }; - VmaSuballocationList::iterator prevItem = suballocItem; - if(suballocItem != m_Suballocations.begin()) - { - --prevItem; - if(prevItem->type == VMA_SUBALLOCATION_TYPE_FREE) - mergeWithPrev = true; - } + VkMemoryRequirements2KHR memReq2 = { VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR }; + memReq2.pNext = &memDedicatedReq; - if(mergeWithNext) + (*m_VulkanFunctions.vkGetBufferMemoryRequirements2KHR)(m_hDevice, &memReqInfo, &memReq2); + + memReq = memReq2.memoryRequirements; + requiresDedicatedAllocation = (memDedicatedReq.requiresDedicatedAllocation != VK_FALSE); + prefersDedicatedAllocation = (memDedicatedReq.prefersDedicatedAllocation != VK_FALSE); + } + else +#endif // #if VMA_DEDICATED_ALLOCATION { - UnregisterFreeSuballocation(nextItem); - MergeFreeWithNext(suballocItem); + (*m_VulkanFunctions.vkGetBufferMemoryRequirements)(m_hDevice, hBuffer, &memReq); + requiresDedicatedAllocation = false; + prefersDedicatedAllocation = false; } +} - if(mergeWithPrev) +void VmaAllocator_T::GetImageMemoryRequirements( + VkImage hImage, + VkMemoryRequirements& memReq, + bool& requiresDedicatedAllocation, + bool& prefersDedicatedAllocation) const +{ +#if VMA_DEDICATED_ALLOCATION + if(m_UseKhrDedicatedAllocation) { - UnregisterFreeSuballocation(prevItem); - MergeFreeWithNext(prevItem); - RegisterFreeSuballocation(prevItem); + VkImageMemoryRequirementsInfo2KHR memReqInfo = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR }; + memReqInfo.image = hImage; + + VkMemoryDedicatedRequirementsKHR memDedicatedReq = { VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR }; + + VkMemoryRequirements2KHR memReq2 = { VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR }; + memReq2.pNext = &memDedicatedReq; + + (*m_VulkanFunctions.vkGetImageMemoryRequirements2KHR)(m_hDevice, &memReqInfo, &memReq2); + + memReq = memReq2.memoryRequirements; + requiresDedicatedAllocation = (memDedicatedReq.requiresDedicatedAllocation != VK_FALSE); + prefersDedicatedAllocation = (memDedicatedReq.prefersDedicatedAllocation != VK_FALSE); } else - RegisterFreeSuballocation(suballocItem); +#endif // #if VMA_DEDICATED_ALLOCATION + { + (*m_VulkanFunctions.vkGetImageMemoryRequirements)(m_hDevice, hImage, &memReq); + requiresDedicatedAllocation = false; + prefersDedicatedAllocation = false; + } } -void VmaAllocation::Free(const VkMappedMemoryRange* pMemory) +VkResult VmaAllocator_T::AllocateMemory( + const VkMemoryRequirements& vkMemReq, + bool requiresDedicatedAllocation, + bool prefersDedicatedAllocation, + VkBuffer dedicatedBuffer, + VkImage dedicatedImage, + const VmaAllocationCreateInfo& createInfo, + VmaSuballocationType suballocType, + VmaAllocation* pAllocation) { - // If suballocation to free has offset smaller than half of allocation size, search forward. - // Otherwise search backward. - const bool forwardDirection = pMemory->offset < (m_Size / 2); - if(forwardDirection) + if((createInfo.flags & VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT) != 0 && + (createInfo.flags & VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT) != 0) { - for(VmaSuballocationList::iterator suballocItem = m_Suballocations.begin(); - suballocItem != m_Suballocations.end(); - ++suballocItem) + VMA_ASSERT(0 && "Specifying VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT together with VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT makes no sense."); + return VK_ERROR_OUT_OF_DEVICE_MEMORY; + } + if((createInfo.flags & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0 && + (createInfo.flags & VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT) != 0) + { + VMA_ASSERT(0 && "Specifying VMA_ALLOCATION_CREATE_MAPPED_BIT together with VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT is invalid."); + return VK_ERROR_OUT_OF_DEVICE_MEMORY; + } + if(requiresDedicatedAllocation) + { + if((createInfo.flags & VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT) != 0) { - VmaSuballocation& suballoc = *suballocItem; - if(suballoc.offset == pMemory->offset) - { - FreeSuballocation(suballocItem); - VMA_HEAVY_ASSERT(Validate()); - return; - } + VMA_ASSERT(0 && "VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT specified while dedicated allocation is required."); + return VK_ERROR_OUT_OF_DEVICE_MEMORY; + } + if(createInfo.pool != VK_NULL_HANDLE) + { + VMA_ASSERT(0 && "Pool specified while dedicated allocation is required."); + return VK_ERROR_OUT_OF_DEVICE_MEMORY; } - VMA_ASSERT(0 && "Not found!"); + } + if((createInfo.pool != VK_NULL_HANDLE) && + ((createInfo.flags & (VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT)) != 0)) + { + VMA_ASSERT(0 && "Specifying VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT when pool != null is invalid."); + return VK_ERROR_OUT_OF_DEVICE_MEMORY; + } + + if(createInfo.pool != VK_NULL_HANDLE) + { + return createInfo.pool->m_BlockVector.Allocate( + createInfo.pool, + m_CurrentFrameIndex.load(), + vkMemReq, + createInfo, + suballocType, + pAllocation); } else { - for(VmaSuballocationList::iterator suballocItem = m_Suballocations.begin(); - suballocItem != m_Suballocations.end(); - ++suballocItem) + // Bit mask of memory Vulkan types acceptable for this allocation. + uint32_t memoryTypeBits = vkMemReq.memoryTypeBits; + uint32_t memTypeIndex = UINT32_MAX; + VkResult res = vmaFindMemoryTypeIndex(this, memoryTypeBits, &createInfo, &memTypeIndex); + if(res == VK_SUCCESS) { - VmaSuballocation& suballoc = *suballocItem; - if(suballoc.offset == pMemory->offset) + res = AllocateMemoryOfType( + vkMemReq, + requiresDedicatedAllocation || prefersDedicatedAllocation, + dedicatedBuffer, + dedicatedImage, + createInfo, + memTypeIndex, + suballocType, + pAllocation); + // Succeeded on first try. + if(res == VK_SUCCESS) { - FreeSuballocation(suballocItem); - VMA_HEAVY_ASSERT(Validate()); - return; + return res; + } + // Allocation from this memory type failed. Try other compatible memory types. + else + { + for(;;) + { + // Remove old memTypeIndex from list of possibilities. + memoryTypeBits &= ~(1u << memTypeIndex); + // Find alternative memTypeIndex. + res = vmaFindMemoryTypeIndex(this, memoryTypeBits, &createInfo, &memTypeIndex); + if(res == VK_SUCCESS) + { + res = AllocateMemoryOfType( + vkMemReq, + requiresDedicatedAllocation || prefersDedicatedAllocation, + dedicatedBuffer, + dedicatedImage, + createInfo, + memTypeIndex, + suballocType, + pAllocation); + // Allocation from this alternative memory type succeeded. + if(res == VK_SUCCESS) + { + return res; + } + // else: Allocation from this memory type failed. Try next one - next loop iteration. + } + // No other matching memory type index could be found. + else + { + // Not returning res, which is VK_ERROR_FEATURE_NOT_PRESENT, because we already failed to allocate once. + return VK_ERROR_OUT_OF_DEVICE_MEMORY; + } + } } } - VMA_ASSERT(0 && "Not found!"); + // Can't find any single memory type maching requirements. res is VK_ERROR_FEATURE_NOT_PRESENT. + else + return res; } } -#if VMA_STATS_STRING_ENABLED - -void VmaAllocation::PrintDetailedMap(class VmaStringBuilder& sb) const +void VmaAllocator_T::FreeMemory(const VmaAllocation allocation) { - sb.Add("{\n\t\t\t\"Bytes\": "); - sb.AddNumber(m_Size); - sb.Add(",\n\t\t\t\"FreeBytes\": "); - sb.AddNumber(m_SumFreeSize); - sb.Add(",\n\t\t\t\"Suballocations\": "); - sb.AddNumber(m_Suballocations.size()); - sb.Add(",\n\t\t\t\"FreeSuballocations\": "); - sb.AddNumber(m_FreeCount); - sb.Add(",\n\t\t\t\"SuballocationList\": ["); + VMA_ASSERT(allocation); - size_t i = 0; - for(VmaSuballocationList::const_iterator suballocItem = m_Suballocations.cbegin(); - suballocItem != m_Suballocations.cend(); - ++suballocItem, ++i) + if(allocation->CanBecomeLost() == false || + allocation->GetLastUseFrameIndex() != VMA_FRAME_INDEX_LOST) { - if(i > 0) - sb.Add(",\n\t\t\t\t{ \"Type\": "); - else - sb.Add("\n\t\t\t\t{ \"Type\": "); - sb.AddString(VMA_SUBALLOCATION_TYPE_NAMES[suballocItem->type]); - sb.Add(", \"Size\": "); - sb.AddNumber(suballocItem->size); - sb.Add(", \"Offset\": "); - sb.AddNumber(suballocItem->offset); - sb.Add(" }"); + switch(allocation->GetType()) + { + case VmaAllocation_T::ALLOCATION_TYPE_BLOCK: + { + VmaBlockVector* pBlockVector = VMA_NULL; + VmaPool hPool = allocation->GetPool(); + if(hPool != VK_NULL_HANDLE) + { + pBlockVector = &hPool->m_BlockVector; + } + else + { + const uint32_t memTypeIndex = allocation->GetMemoryTypeIndex(); + pBlockVector = m_pBlockVectors[memTypeIndex]; + } + pBlockVector->Free(allocation); + } + break; + case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED: + FreeDedicatedMemory(allocation); + break; + default: + VMA_ASSERT(0); + } } - sb.Add("\n\t\t\t]\n\t\t}"); + allocation->SetUserData(this, VMA_NULL); + vma_delete(this, allocation); } -#endif // #if VMA_STATS_STRING_ENABLED - -void VmaAllocation::MergeFreeWithNext(VmaSuballocationList::iterator item) +void VmaAllocator_T::CalculateStats(VmaStats* pStats) { - VMA_ASSERT(item != m_Suballocations.end()); - VMA_ASSERT(item->type == VMA_SUBALLOCATION_TYPE_FREE); + // Initialize. + InitStatInfo(pStats->total); + for(size_t i = 0; i < VK_MAX_MEMORY_TYPES; ++i) + InitStatInfo(pStats->memoryType[i]); + for(size_t i = 0; i < VK_MAX_MEMORY_HEAPS; ++i) + InitStatInfo(pStats->memoryHeap[i]); - VmaSuballocationList::iterator nextItem = item; - ++nextItem; - VMA_ASSERT(nextItem != m_Suballocations.end()); - VMA_ASSERT(nextItem->type == VMA_SUBALLOCATION_TYPE_FREE); - - item->size += nextItem->size; - --m_FreeCount; - m_Suballocations.erase(nextItem); -} + // Process default pools. + for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex) + { + VmaBlockVector* const pBlockVector = m_pBlockVectors[memTypeIndex]; + VMA_ASSERT(pBlockVector); + pBlockVector->AddStats(pStats); + } -void VmaAllocation::RegisterFreeSuballocation(VmaSuballocationList::iterator item) -{ - VMA_ASSERT(item->type == VMA_SUBALLOCATION_TYPE_FREE); - VMA_ASSERT(item->size > 0); + // Process custom pools. + { + VmaMutexLock lock(m_PoolsMutex, m_UseMutex); + for(size_t poolIndex = 0, poolCount = m_Pools.size(); poolIndex < poolCount; ++poolIndex) + { + m_Pools[poolIndex]->GetBlockVector().AddStats(pStats); + } + } - if(item->size >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER) + // Process dedicated allocations. + for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex) { - if(m_FreeSuballocationsBySize.empty()) - m_FreeSuballocationsBySize.push_back(item); - else + const uint32_t memHeapIndex = MemoryTypeIndexToHeapIndex(memTypeIndex); + VmaMutexLock dedicatedAllocationsLock(m_DedicatedAllocationsMutex[memTypeIndex], m_UseMutex); + AllocationVectorType* const pDedicatedAllocVector = m_pDedicatedAllocations[memTypeIndex]; + VMA_ASSERT(pDedicatedAllocVector); + for(size_t allocIndex = 0, allocCount = pDedicatedAllocVector->size(); allocIndex < allocCount; ++allocIndex) { - VmaSuballocationList::iterator* const it = VmaBinaryFindFirstNotLess( - m_FreeSuballocationsBySize.data(), - m_FreeSuballocationsBySize.data() + m_FreeSuballocationsBySize.size(), - item, - VmaSuballocationItemSizeLess()); - size_t index = it - m_FreeSuballocationsBySize.data(); - VectorInsert(m_FreeSuballocationsBySize, index, item); + VmaStatInfo allocationStatInfo; + (*pDedicatedAllocVector)[allocIndex]->DedicatedAllocCalcStatsInfo(allocationStatInfo); + VmaAddStatInfo(pStats->total, allocationStatInfo); + VmaAddStatInfo(pStats->memoryType[memTypeIndex], allocationStatInfo); + VmaAddStatInfo(pStats->memoryHeap[memHeapIndex], allocationStatInfo); } } + + // Postprocess. + VmaPostprocessCalcStatInfo(pStats->total); + for(size_t i = 0; i < GetMemoryTypeCount(); ++i) + VmaPostprocessCalcStatInfo(pStats->memoryType[i]); + for(size_t i = 0; i < GetMemoryHeapCount(); ++i) + VmaPostprocessCalcStatInfo(pStats->memoryHeap[i]); } -void VmaAllocation::UnregisterFreeSuballocation(VmaSuballocationList::iterator item) +static const uint32_t VMA_VENDOR_ID_AMD = 4098; + +VkResult VmaAllocator_T::Defragment( + VmaAllocation* pAllocations, + size_t allocationCount, + VkBool32* pAllocationsChanged, + const VmaDefragmentationInfo* pDefragmentationInfo, + VmaDefragmentationStats* pDefragmentationStats) { - VMA_ASSERT(item->type == VMA_SUBALLOCATION_TYPE_FREE); - VMA_ASSERT(item->size > 0); + if(pAllocationsChanged != VMA_NULL) + { + memset(pAllocationsChanged, 0, sizeof(*pAllocationsChanged)); + } + if(pDefragmentationStats != VMA_NULL) + { + memset(pDefragmentationStats, 0, sizeof(*pDefragmentationStats)); + } - if(item->size >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER) + const uint32_t currentFrameIndex = m_CurrentFrameIndex.load(); + + VmaMutexLock poolsLock(m_PoolsMutex, m_UseMutex); + + const size_t poolCount = m_Pools.size(); + + // Dispatch pAllocations among defragmentators. Create them in BlockVectors when necessary. + for(size_t allocIndex = 0; allocIndex < allocationCount; ++allocIndex) { - VmaSuballocationList::iterator* const it = VmaBinaryFindFirstNotLess( - m_FreeSuballocationsBySize.data(), - m_FreeSuballocationsBySize.data() + m_FreeSuballocationsBySize.size(), - item, - VmaSuballocationItemSizeLess()); - for(size_t index = it - m_FreeSuballocationsBySize.data(); - index < m_FreeSuballocationsBySize.size(); - ++index) + VmaAllocation hAlloc = pAllocations[allocIndex]; + VMA_ASSERT(hAlloc); + const uint32_t memTypeIndex = hAlloc->GetMemoryTypeIndex(); + // DedicatedAlloc cannot be defragmented. + if((hAlloc->GetType() == VmaAllocation_T::ALLOCATION_TYPE_BLOCK) && + // Only HOST_VISIBLE memory types can be defragmented. + ((m_MemProps.memoryTypes[memTypeIndex].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0) && + // Lost allocation cannot be defragmented. + (hAlloc->GetLastUseFrameIndex() != VMA_FRAME_INDEX_LOST)) { - if(m_FreeSuballocationsBySize[index] == item) + VmaBlockVector* pAllocBlockVector = VMA_NULL; + + const VmaPool hAllocPool = hAlloc->GetPool(); + // This allocation belongs to custom pool. + if(hAllocPool != VK_NULL_HANDLE) { - VectorRemove(m_FreeSuballocationsBySize, index); - return; + pAllocBlockVector = &hAllocPool->GetBlockVector(); + } + // This allocation belongs to general pool. + else + { + pAllocBlockVector = m_pBlockVectors[memTypeIndex]; } - VMA_ASSERT((m_FreeSuballocationsBySize[index]->size == item->size) && "Not found."); - } - VMA_ASSERT(0 && "Not found."); - } -} -static void InitStatInfo(VmaStatInfo& outInfo) -{ - memset(&outInfo, 0, sizeof(outInfo)); - outInfo.SuballocationSizeMin = UINT64_MAX; - outInfo.UnusedRangeSizeMin = UINT64_MAX; -} + VmaDefragmentator* const pDefragmentator = pAllocBlockVector->EnsureDefragmentator(this, currentFrameIndex); + + VkBool32* const pChanged = (pAllocationsChanged != VMA_NULL) ? + &pAllocationsChanged[allocIndex] : VMA_NULL; + pDefragmentator->AddAllocation(hAlloc, pChanged); + } + } -static void CalcAllocationStatInfo(VmaStatInfo& outInfo, const VmaAllocation& alloc) -{ - outInfo.AllocationCount = 1; + VkResult result = VK_SUCCESS; - const uint32_t rangeCount = (uint32_t)alloc.m_Suballocations.size(); - outInfo.SuballocationCount = rangeCount - alloc.m_FreeCount; - outInfo.UnusedRangeCount = alloc.m_FreeCount; - - outInfo.UnusedBytes = alloc.m_SumFreeSize; - outInfo.UsedBytes = alloc.m_Size - outInfo.UnusedBytes; + // ======== Main processing. - outInfo.SuballocationSizeMin = UINT64_MAX; - outInfo.SuballocationSizeMax = 0; - outInfo.UnusedRangeSizeMin = UINT64_MAX; - outInfo.UnusedRangeSizeMax = 0; + VkDeviceSize maxBytesToMove = SIZE_MAX; + uint32_t maxAllocationsToMove = UINT32_MAX; + if(pDefragmentationInfo != VMA_NULL) + { + maxBytesToMove = pDefragmentationInfo->maxBytesToMove; + maxAllocationsToMove = pDefragmentationInfo->maxAllocationsToMove; + } - for(VmaSuballocationList::const_iterator suballocItem = alloc.m_Suballocations.cbegin(); - suballocItem != alloc.m_Suballocations.cend(); - ++suballocItem) + // Process standard memory. + for(uint32_t memTypeIndex = 0; + (memTypeIndex < GetMemoryTypeCount()) && (result == VK_SUCCESS); + ++memTypeIndex) { - const VmaSuballocation& suballoc = *suballocItem; - if(suballoc.type != VMA_SUBALLOCATION_TYPE_FREE) + // Only HOST_VISIBLE memory types can be defragmented. + if((m_MemProps.memoryTypes[memTypeIndex].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0) { - outInfo.SuballocationSizeMin = VMA_MIN(outInfo.SuballocationSizeMin, suballoc.size); - outInfo.SuballocationSizeMax = VMA_MAX(outInfo.SuballocationSizeMax, suballoc.size); - } - else - { - outInfo.UnusedRangeSizeMin = VMA_MIN(outInfo.UnusedRangeSizeMin, suballoc.size); - outInfo.UnusedRangeSizeMax = VMA_MAX(outInfo.UnusedRangeSizeMax, suballoc.size); + result = m_pBlockVectors[memTypeIndex]->Defragment( + pDefragmentationStats, + maxBytesToMove, + maxAllocationsToMove); } } -} - -// Adds statistics srcInfo into inoutInfo, like: inoutInfo += srcInfo. -static void VmaAddStatInfo(VmaStatInfo& inoutInfo, const VmaStatInfo& srcInfo) -{ - inoutInfo.AllocationCount += srcInfo.AllocationCount; - inoutInfo.SuballocationCount += srcInfo.SuballocationCount; - inoutInfo.UnusedRangeCount += srcInfo.UnusedRangeCount; - inoutInfo.UsedBytes += srcInfo.UsedBytes; - inoutInfo.UnusedBytes += srcInfo.UnusedBytes; - inoutInfo.SuballocationSizeMin = VMA_MIN(inoutInfo.SuballocationSizeMin, srcInfo.SuballocationSizeMin); - inoutInfo.SuballocationSizeMax = VMA_MAX(inoutInfo.SuballocationSizeMax, srcInfo.SuballocationSizeMax); - inoutInfo.UnusedRangeSizeMin = VMA_MIN(inoutInfo.UnusedRangeSizeMin, srcInfo.UnusedRangeSizeMin); - inoutInfo.UnusedRangeSizeMax = VMA_MAX(inoutInfo.UnusedRangeSizeMax, srcInfo.UnusedRangeSizeMax); -} -static void VmaPostprocessCalcStatInfo(VmaStatInfo& inoutInfo) -{ - inoutInfo.SuballocationSizeAvg = (inoutInfo.SuballocationCount > 0) ? - VmaRoundDiv(inoutInfo.UsedBytes, inoutInfo.SuballocationCount) : 0; - inoutInfo.UnusedRangeSizeAvg = (inoutInfo.UnusedRangeCount > 0) ? - VmaRoundDiv(inoutInfo.UnusedBytes, inoutInfo.UnusedRangeCount) : 0; -} + // Process custom pools. + for(size_t poolIndex = 0; (poolIndex < poolCount) && (result == VK_SUCCESS); ++poolIndex) + { + result = m_Pools[poolIndex]->GetBlockVector().Defragment( + pDefragmentationStats, + maxBytesToMove, + maxAllocationsToMove); + } -VmaAllocationVector::VmaAllocationVector(VmaAllocator hAllocator) : - m_hAllocator(hAllocator), - m_Allocations(VmaStlAllocator(hAllocator->GetAllocationCallbacks())) -{ -} + // ======== Destroy defragmentators. -VmaAllocationVector::~VmaAllocationVector() -{ - for(size_t i = m_Allocations.size(); i--; ) + // Process custom pools. + for(size_t poolIndex = poolCount; poolIndex--; ) { - m_Allocations[i]->Destroy(m_hAllocator); - vma_delete(m_hAllocator, m_Allocations[i]); + m_Pools[poolIndex]->GetBlockVector().DestroyDefragmentator(); } -} -size_t VmaAllocationVector::Free(const VkMappedMemoryRange* pMemory) -{ - for(uint32_t allocIndex = 0; allocIndex < m_Allocations.size(); ++allocIndex) + // Process standard memory. + for(uint32_t memTypeIndex = GetMemoryTypeCount(); memTypeIndex--; ) { - VmaAllocation* const pAlloc = m_Allocations[allocIndex]; - VMA_ASSERT(pAlloc); - if(pAlloc->m_hMemory == pMemory->memory) + if((m_MemProps.memoryTypes[memTypeIndex].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0) { - pAlloc->Free(pMemory); - VMA_HEAVY_ASSERT(pAlloc->Validate()); - return allocIndex; + m_pBlockVectors[memTypeIndex]->DestroyDefragmentator(); } } - return (size_t)-1; + return result; } -void VmaAllocationVector::IncrementallySortAllocations() +void VmaAllocator_T::GetAllocationInfo(VmaAllocation hAllocation, VmaAllocationInfo* pAllocationInfo) { - // Bubble sort only until first swap. - for(size_t i = 1; i < m_Allocations.size(); ++i) + if(hAllocation->CanBecomeLost()) { - if(m_Allocations[i - 1]->m_SumFreeSize > m_Allocations[i]->m_SumFreeSize) + /* + Warning: This is a carefully designed algorithm. + Do not modify unless you really know what you're doing :) + */ + uint32_t localCurrFrameIndex = m_CurrentFrameIndex.load(); + uint32_t localLastUseFrameIndex = hAllocation->GetLastUseFrameIndex(); + for(;;) { - VMA_SWAP(m_Allocations[i - 1], m_Allocations[i]); - return; + if(localLastUseFrameIndex == VMA_FRAME_INDEX_LOST) + { + pAllocationInfo->memoryType = UINT32_MAX; + pAllocationInfo->deviceMemory = VK_NULL_HANDLE; + pAllocationInfo->offset = 0; + pAllocationInfo->size = hAllocation->GetSize(); + pAllocationInfo->pMappedData = VMA_NULL; + pAllocationInfo->pUserData = hAllocation->GetUserData(); + return; + } + else if(localLastUseFrameIndex == localCurrFrameIndex) + { + pAllocationInfo->memoryType = hAllocation->GetMemoryTypeIndex(); + pAllocationInfo->deviceMemory = hAllocation->GetMemory(); + pAllocationInfo->offset = hAllocation->GetOffset(); + pAllocationInfo->size = hAllocation->GetSize(); + pAllocationInfo->pMappedData = VMA_NULL; + pAllocationInfo->pUserData = hAllocation->GetUserData(); + return; + } + else // Last use time earlier than current time. + { + if(hAllocation->CompareExchangeLastUseFrameIndex(localLastUseFrameIndex, localCurrFrameIndex)) + { + localLastUseFrameIndex = localCurrFrameIndex; + } + } } } -} - -#if VMA_STATS_STRING_ENABLED - -void VmaAllocationVector::PrintDetailedMap(class VmaStringBuilder& sb) const -{ - for(size_t i = 0; i < m_Allocations.size(); ++i) + else { - if(i > 0) - sb.Add(",\n\t\t"); - else - sb.Add("\n\t\t"); - m_Allocations[i]->PrintDetailedMap(sb); + pAllocationInfo->memoryType = hAllocation->GetMemoryTypeIndex(); + pAllocationInfo->deviceMemory = hAllocation->GetMemory(); + pAllocationInfo->offset = hAllocation->GetOffset(); + pAllocationInfo->size = hAllocation->GetSize(); + pAllocationInfo->pMappedData = hAllocation->GetMappedData(); + pAllocationInfo->pUserData = hAllocation->GetUserData(); } } -#endif // #if VMA_STATS_STRING_ENABLED - -void VmaAllocationVector::AddStats(VmaStats* pStats, uint32_t memTypeIndex, uint32_t memHeapIndex) const +bool VmaAllocator_T::TouchAllocation(VmaAllocation hAllocation) { - for(uint32_t allocIndex = 0; allocIndex < m_Allocations.size(); ++allocIndex) + // This is a stripped-down version of VmaAllocator_T::GetAllocationInfo. + if(hAllocation->CanBecomeLost()) { - const VmaAllocation* const pAlloc = m_Allocations[allocIndex]; - VMA_ASSERT(pAlloc); - VMA_HEAVY_ASSERT(pAlloc->Validate()); - VmaStatInfo allocationStatInfo; - CalcAllocationStatInfo(allocationStatInfo, *pAlloc); - VmaAddStatInfo(pStats->total, allocationStatInfo); - VmaAddStatInfo(pStats->memoryType[memTypeIndex], allocationStatInfo); - VmaAddStatInfo(pStats->memoryHeap[memHeapIndex], allocationStatInfo); + uint32_t localCurrFrameIndex = m_CurrentFrameIndex.load(); + uint32_t localLastUseFrameIndex = hAllocation->GetLastUseFrameIndex(); + for(;;) + { + if(localLastUseFrameIndex == VMA_FRAME_INDEX_LOST) + { + return false; + } + else if(localLastUseFrameIndex == localCurrFrameIndex) + { + return true; + } + else // Last use time earlier than current time. + { + if(hAllocation->CompareExchangeLastUseFrameIndex(localLastUseFrameIndex, localCurrFrameIndex)) + { + localLastUseFrameIndex = localCurrFrameIndex; + } + } + } + } + else + { + return true; } } -//////////////////////////////////////////////////////////////////////////////// -// VmaAllocator_T - -VmaAllocator_T::VmaAllocator_T(const VmaAllocatorCreateInfo* pCreateInfo) : - m_PhysicalDevice(pCreateInfo->physicalDevice), - m_hDevice(pCreateInfo->device), - m_AllocationCallbacksSpecified(pCreateInfo->pAllocationCallbacks != VMA_NULL), - m_AllocationCallbacks(pCreateInfo->pAllocationCallbacks ? - *pCreateInfo->pAllocationCallbacks : VmaEmptyAllocationCallbacks), - m_PreferredLargeHeapBlockSize(0), - m_PreferredSmallHeapBlockSize(0), - m_BufferToMemoryMap(VmaStlAllocator< VmaPair >(pCreateInfo->pAllocationCallbacks)), - m_ImageToMemoryMap(VmaStlAllocator< VmaPair >(pCreateInfo->pAllocationCallbacks)) +VkResult VmaAllocator_T::CreatePool(const VmaPoolCreateInfo* pCreateInfo, VmaPool* pPool) { - VMA_ASSERT(pCreateInfo->physicalDevice && pCreateInfo->device); - - memset(&m_MemProps, 0, sizeof(m_MemProps)); - memset(&m_PhysicalDeviceProperties, 0, sizeof(m_PhysicalDeviceProperties)); - - memset(&m_pAllocations, 0, sizeof(m_pAllocations)); - memset(&m_HasEmptyAllocation, 0, sizeof(m_HasEmptyAllocation)); - memset(&m_pOwnAllocations, 0, sizeof(m_pOwnAllocations)); - - m_PreferredLargeHeapBlockSize = (pCreateInfo->preferredLargeHeapBlockSize != 0) ? - pCreateInfo->preferredLargeHeapBlockSize : VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE; - m_PreferredSmallHeapBlockSize = (pCreateInfo->preferredSmallHeapBlockSize != 0) ? - pCreateInfo->preferredSmallHeapBlockSize : VMA_DEFAULT_SMALL_HEAP_BLOCK_SIZE; + VMA_DEBUG_LOG(" CreatePool: MemoryTypeIndex=%u", pCreateInfo->memoryTypeIndex); - vkGetPhysicalDeviceProperties(m_PhysicalDevice, &m_PhysicalDeviceProperties); - vkGetPhysicalDeviceMemoryProperties(m_PhysicalDevice, &m_MemProps); + VmaPoolCreateInfo newCreateInfo = *pCreateInfo; - for(size_t i = 0; i < GetMemoryTypeCount(); ++i) + if(newCreateInfo.maxBlockCount == 0) { - m_pAllocations[i] = vma_new(this, VmaAllocationVector)(this); - m_pOwnAllocations[i] = vma_new(this, OwnAllocationVectorType)(VmaStlAllocator(GetAllocationCallbacks())); + newCreateInfo.maxBlockCount = SIZE_MAX; } -} - -VmaAllocator_T::~VmaAllocator_T() -{ - for(VMA_MAP_TYPE(VkImage, VkMappedMemoryRange)::iterator it = m_ImageToMemoryMap.begin(); - it != m_ImageToMemoryMap.end(); - ++it) + if(newCreateInfo.blockSize == 0) { - vkDestroyImage(m_hDevice, it->first, GetAllocationCallbacks()); + newCreateInfo.blockSize = CalcPreferredBlockSize(newCreateInfo.memoryTypeIndex); } - for(VMA_MAP_TYPE(VkBuffer, VkMappedMemoryRange)::iterator it = m_BufferToMemoryMap.begin(); - it != m_BufferToMemoryMap.end(); - ++it) + *pPool = vma_new(this, VmaPool_T)(this, newCreateInfo); + + VkResult res = (*pPool)->m_BlockVector.CreateMinBlocks(); + if(res != VK_SUCCESS) { - vkDestroyBuffer(m_hDevice, it->first, GetAllocationCallbacks()); + vma_delete(this, *pPool); + *pPool = VMA_NULL; + return res; } - for(uint32_t typeIndex = 0; typeIndex < GetMemoryTypeCount(); ++typeIndex) + // Add to m_Pools. { - OwnAllocationVectorType* pOwnAllocations = m_pOwnAllocations[typeIndex]; - VMA_ASSERT(pOwnAllocations); - for(size_t allocationIndex = 0; allocationIndex < pOwnAllocations->size(); ++allocationIndex) - { - const VmaOwnAllocation& ownAlloc = (*pOwnAllocations)[allocationIndex]; - vkFreeMemory(m_hDevice, ownAlloc.m_hMemory, GetAllocationCallbacks()); - } + VmaMutexLock lock(m_PoolsMutex, m_UseMutex); + VmaVectorInsertSorted(m_Pools, *pPool); } - for(size_t i = GetMemoryTypeCount(); i--; ) + return VK_SUCCESS; +} + +void VmaAllocator_T::DestroyPool(VmaPool pool) +{ + // Remove from m_Pools. { - vma_delete(this, m_pAllocations[i]); - vma_delete(this, m_pOwnAllocations[i]); + VmaMutexLock lock(m_PoolsMutex, m_UseMutex); + bool success = VmaVectorRemoveSorted(m_Pools, pool); + VMA_ASSERT(success && "Pool not found in Allocator."); + + success; } + + vma_delete(this, pool); } -VkDeviceSize VmaAllocator_T::GetPreferredBlockSize(uint32_t memTypeIndex) const +void VmaAllocator_T::GetPoolStats(VmaPool pool, VmaPoolStats* pPoolStats) { - VkDeviceSize heapSize = m_MemProps.memoryHeaps[m_MemProps.memoryTypes[memTypeIndex].heapIndex].size; - return (heapSize <= VMA_SMALL_HEAP_MAX_SIZE) ? - m_PreferredSmallHeapBlockSize : m_PreferredLargeHeapBlockSize; + pool->m_BlockVector.GetPoolStats(pPoolStats); } -VkResult VmaAllocator_T::AllocateMemoryOfType( - const VkMemoryRequirements& vkMemReq, - const VmaMemoryRequirements& vmaMemReq, - uint32_t memTypeIndex, - VmaSuballocationType suballocType, - VkMappedMemoryRange* pMemory) +void VmaAllocator_T::SetCurrentFrameIndex(uint32_t frameIndex) { - VMA_DEBUG_LOG(" AllocateMemory: MemoryTypeIndex=%u, Size=%llu", memTypeIndex, vkMemReq.size); + m_CurrentFrameIndex.store(frameIndex); +} - pMemory->sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE; - pMemory->pNext = VMA_NULL; - pMemory->size = vkMemReq.size; +void VmaAllocator_T::MakePoolAllocationsLost( + VmaPool hPool, + size_t* pLostAllocationCount) +{ + hPool->m_BlockVector.MakePoolAllocationsLost( + m_CurrentFrameIndex.load(), + pLostAllocationCount); +} - const VkDeviceSize preferredBlockSize = GetPreferredBlockSize(memTypeIndex); - // Heuristics: Allocate own memory if requested size if greater than half of preferred block size. - const bool ownMemory = - vmaMemReq.ownMemory || - VMA_DEBUG_ALWAYS_OWN_MEMORY || - ((vmaMemReq.neverAllocate == false) && (vkMemReq.size > preferredBlockSize / 2)); +void VmaAllocator_T::CreateLostAllocation(VmaAllocation* pAllocation) +{ + *pAllocation = vma_new(this, VmaAllocation_T)(VMA_FRAME_INDEX_LOST, false); + (*pAllocation)->InitLost(); +} - if(ownMemory) - { - if(vmaMemReq.neverAllocate) - return VK_ERROR_OUT_OF_DEVICE_MEMORY; - else - return AllocateOwnMemory(vkMemReq.size, suballocType, memTypeIndex, pMemory); - } - else - { - VmaMutexLock lock(m_AllocationsMutex[memTypeIndex]); - VmaAllocationVector* const allocationVector = m_pAllocations[memTypeIndex]; - VMA_ASSERT(allocationVector); +VkResult VmaAllocator_T::AllocateVulkanMemory(const VkMemoryAllocateInfo* pAllocateInfo, VkDeviceMemory* pMemory) +{ + const uint32_t heapIndex = MemoryTypeIndexToHeapIndex(pAllocateInfo->memoryTypeIndex); - // 1. Search existing allocations. - // Forward order - prefer blocks with smallest amount of free space. - for(size_t allocIndex = 0; allocIndex < allocationVector->m_Allocations.size(); ++allocIndex ) + VkResult res; + if(m_HeapSizeLimit[heapIndex] != VK_WHOLE_SIZE) + { + VmaMutexLock lock(m_HeapSizeLimitMutex, m_UseMutex); + if(m_HeapSizeLimit[heapIndex] >= pAllocateInfo->allocationSize) { - VmaAllocation* const pAlloc = allocationVector->m_Allocations[allocIndex]; - VMA_ASSERT(pAlloc); - VmaAllocationRequest allocRequest = {}; - // Check if can allocate from pAlloc. - if(pAlloc->CreateAllocationRequest( - GetBufferImageGranularity(), - vkMemReq.size, - vkMemReq.alignment, - suballocType, - &allocRequest)) - { - // We no longer have an empty Allocation. - if(pAlloc->IsEmpty()) - m_HasEmptyAllocation[memTypeIndex] = false; - // Allocate from this pAlloc. - pAlloc->Alloc(allocRequest, suballocType, vkMemReq.size); - // Return VkDeviceMemory and offset (size already filled above). - pMemory->memory = pAlloc->m_hMemory; - pMemory->offset = allocRequest.offset; - VMA_HEAVY_ASSERT(pAlloc->Validate()); - VMA_DEBUG_LOG(" Returned from existing allocation #%u", (uint32_t)allocIndex); - return VK_SUCCESS; + res = (*m_VulkanFunctions.vkAllocateMemory)(m_hDevice, pAllocateInfo, GetAllocationCallbacks(), pMemory); + if(res == VK_SUCCESS) + { + m_HeapSizeLimit[heapIndex] -= pAllocateInfo->allocationSize; } } - - // 2. Create new Allocation. - if(vmaMemReq.neverAllocate) - { - VMA_DEBUG_LOG(" FAILED due to VmaMemoryRequirements::neverAllocate"); - return VK_ERROR_OUT_OF_DEVICE_MEMORY; - } else { - // Start with full preferredBlockSize. - VkMemoryAllocateInfo allocInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO }; - allocInfo.memoryTypeIndex = memTypeIndex; - allocInfo.allocationSize = preferredBlockSize; - VkDeviceMemory mem = VK_NULL_HANDLE; - VkResult res = vkAllocateMemory(m_hDevice, &allocInfo, GetAllocationCallbacks(), &mem); - if(res < 0) - { - // 3. Try half the size. - allocInfo.allocationSize /= 2; - if(allocInfo.allocationSize >= vkMemReq.size) - { - res = vkAllocateMemory(m_hDevice, &allocInfo, GetAllocationCallbacks(), &mem); - if(res < 0) - { - // 4. Try quarter the size. - allocInfo.allocationSize /= 2; - if(allocInfo.allocationSize >= vkMemReq.size) - { - res = vkAllocateMemory(m_hDevice, &allocInfo, GetAllocationCallbacks(), &mem); - } - } - } - } - if(res < 0) - { - // 5. Try OwnAlloc. - res = AllocateOwnMemory(vkMemReq.size, suballocType, memTypeIndex, pMemory); - if(res == VK_SUCCESS) - { - // Succeeded: AllocateOwnMemory function already filld pMemory, nothing more to do here. - VMA_DEBUG_LOG(" Allocated as OwnMemory"); - return VK_SUCCESS; - } - else - { - // Everything failed: Return error code. - VMA_DEBUG_LOG(" vkAllocateMemory FAILED"); - return res; - } - } - - // New VkDeviceMemory successfully created. Create new Allocation for it. - VmaAllocation* const pAlloc = vma_new(this, VmaAllocation)(this); - pAlloc->Init(mem, allocInfo.allocationSize); - - allocationVector->m_Allocations.push_back(pAlloc); - - // Allocate from pAlloc. Because it is empty, allocRequest can be trivially filled. - VmaAllocationRequest allocRequest = {}; - allocRequest.freeSuballocationItem = pAlloc->m_Suballocations.begin(); - allocRequest.offset = 0; - pAlloc->Alloc(allocRequest, suballocType, vkMemReq.size); - pMemory->memory = mem; - pMemory->offset = allocRequest.offset; - VMA_HEAVY_ASSERT(pAlloc->Validate()); - VMA_DEBUG_LOG(" Created new allocation Size=%llu", allocInfo.allocationSize); - return VK_SUCCESS; + res = VK_ERROR_OUT_OF_DEVICE_MEMORY; } } -} - -VkResult VmaAllocator_T::AllocateOwnMemory( - VkDeviceSize size, - VmaSuballocationType suballocType, - uint32_t memTypeIndex, - VkMappedMemoryRange* pMemory) -{ - VkMemoryAllocateInfo allocInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO }; - allocInfo.memoryTypeIndex = memTypeIndex; - allocInfo.allocationSize = size; + else + { + res = (*m_VulkanFunctions.vkAllocateMemory)(m_hDevice, pAllocateInfo, GetAllocationCallbacks(), pMemory); + } - // Allocate VkDeviceMemory. - VmaOwnAllocation ownAlloc = {}; - ownAlloc.m_Size = size; - ownAlloc.m_Type = suballocType; - VkResult res = vkAllocateMemory(m_hDevice, &allocInfo, GetAllocationCallbacks(), &ownAlloc.m_hMemory); - if(res < 0) + if(res == VK_SUCCESS && m_DeviceMemoryCallbacks.pfnAllocate != VMA_NULL) { - VMA_DEBUG_LOG(" vkAllocateMemory FAILED"); - return res; + (*m_DeviceMemoryCallbacks.pfnAllocate)(this, pAllocateInfo->memoryTypeIndex, *pMemory, pAllocateInfo->allocationSize); } - // Register it in m_pOwnAllocations. - VmaMutexLock lock(m_OwnAllocationsMutex[memTypeIndex]); - OwnAllocationVectorType* ownAllocations = m_pOwnAllocations[memTypeIndex]; - VMA_ASSERT(ownAllocations); - VmaOwnAllocation* const pOwnAllocationsBeg = ownAllocations->data(); - VmaOwnAllocation* const pOwnAllocationsEnd = pOwnAllocationsBeg + ownAllocations->size(); - const size_t indexToInsert = VmaBinaryFindFirstNotLess( - pOwnAllocationsBeg, - pOwnAllocationsEnd, - ownAlloc, - VmaOwnAllocationMemoryHandleLess()) - pOwnAllocationsBeg; - VectorInsert(*ownAllocations, indexToInsert, ownAlloc); + return res; +} - // Return parameters of the allocation. - pMemory->sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE; - pMemory->pNext = VMA_NULL; - pMemory->memory = ownAlloc.m_hMemory; - pMemory->offset = 0; - pMemory->size = size; +void VmaAllocator_T::FreeVulkanMemory(uint32_t memoryType, VkDeviceSize size, VkDeviceMemory hMemory) +{ + if(m_DeviceMemoryCallbacks.pfnFree != VMA_NULL) + { + (*m_DeviceMemoryCallbacks.pfnFree)(this, memoryType, hMemory, size); + } - VMA_DEBUG_LOG(" Allocated OwnMemory MemoryTypeIndex=#%u", memTypeIndex); + (*m_VulkanFunctions.vkFreeMemory)(m_hDevice, hMemory, GetAllocationCallbacks()); - return VK_SUCCESS; + const uint32_t heapIndex = MemoryTypeIndexToHeapIndex(memoryType); + if(m_HeapSizeLimit[heapIndex] != VK_WHOLE_SIZE) + { + VmaMutexLock lock(m_HeapSizeLimitMutex, m_UseMutex); + m_HeapSizeLimit[heapIndex] += size; + } } -VkResult VmaAllocator_T::AllocateMemory( - const VkMemoryRequirements& vkMemReq, - const VmaMemoryRequirements& vmaMemReq, - VmaSuballocationType suballocType, - VkMappedMemoryRange* pMemory, - uint32_t* pMemoryTypeIndex) +VkResult VmaAllocator_T::Map(VmaAllocation hAllocation, void** ppData) { - if(vmaMemReq.ownMemory && vmaMemReq.neverAllocate) + if(hAllocation->CanBecomeLost()) { - VMA_ASSERT(0 && "Specifying VmaMemoryRequirements::ownMemory && VmaMemoryRequirements::neverAllocate makes no sense."); - return VK_ERROR_OUT_OF_DEVICE_MEMORY; + return VK_ERROR_MEMORY_MAP_FAILED; } - // Bit mask of memory Vulkan types acceptable for this allocation. - uint32_t memoryTypeBits = vkMemReq.memoryTypeBits; - uint32_t memTypeIndex = UINT32_MAX; - VkResult res = vmaFindMemoryTypeIndex(this, memoryTypeBits, &vmaMemReq, &memTypeIndex); - if(res == VK_SUCCESS) + switch(hAllocation->GetType()) { - res = AllocateMemoryOfType(vkMemReq, vmaMemReq, memTypeIndex, suballocType, pMemory); - // Succeeded on first try. - if(res == VK_SUCCESS) - { - if(pMemoryTypeIndex != VMA_NULL) - *pMemoryTypeIndex = memTypeIndex; - return res; - } - // Allocation from this memory type failed. Try other compatible memory types. - else + case VmaAllocation_T::ALLOCATION_TYPE_BLOCK: { - for(;;) + VmaDeviceMemoryBlock* const pBlock = hAllocation->GetBlock(); + char *pBytes = VMA_NULL; + VkResult res = pBlock->Map(this, 1, (void**)&pBytes); + if(res == VK_SUCCESS) { - // Remove old memTypeIndex from list of possibilities. - memoryTypeBits &= ~(1u << memTypeIndex); - // Find alternative memTypeIndex. - res = vmaFindMemoryTypeIndex(this, memoryTypeBits, &vmaMemReq, &memTypeIndex); - if(res == VK_SUCCESS) - { - res = AllocateMemoryOfType(vkMemReq, vmaMemReq, memTypeIndex, suballocType, pMemory); - // Allocation from this alternative memory type succeeded. - if(res == VK_SUCCESS) - { - if(pMemoryTypeIndex != VMA_NULL) - *pMemoryTypeIndex = memTypeIndex; - return res; - } - // else: Allocation from this memory type failed. Try next one - next loop iteration. - } - // No other matching memory type index could be found. - else - // Not returning res, which is VK_ERROR_FEATURE_NOT_PRESENT, because we already failed to allocate once. - return VK_ERROR_OUT_OF_DEVICE_MEMORY; + *ppData = pBytes + (ptrdiff_t)hAllocation->GetOffset(); + hAllocation->BlockAllocMap(); } + return res; } + case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED: + return hAllocation->DedicatedAllocMap(this, ppData); + default: + VMA_ASSERT(0); + return VK_ERROR_MEMORY_MAP_FAILED; } - // Can't find any single memory type maching requirements. res is VK_ERROR_FEATURE_NOT_PRESENT. - else - return res; } -void VmaAllocator_T::FreeMemory(const VkMappedMemoryRange* pMemory) +void VmaAllocator_T::Unmap(VmaAllocation hAllocation) { - uint32_t memTypeIndex = 0; - bool found = false; - VmaAllocation* allocationToDelete = VMA_NULL; - // Check all memory types because we don't know which one does pMemory come from. - for(; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex) + switch(hAllocation->GetType()) { - VmaMutexLock lock(m_AllocationsMutex[memTypeIndex]); - VmaAllocationVector* const pAllocationVector = m_pAllocations[memTypeIndex]; - VMA_ASSERT(pAllocationVector); - // Try to free pMemory from pAllocationVector. - const size_t allocIndex = pAllocationVector->Free(pMemory); - if(allocIndex != (size_t)-1) + case VmaAllocation_T::ALLOCATION_TYPE_BLOCK: { - VMA_DEBUG_LOG(" Freed from MemoryTypeIndex=%u", memTypeIndex); - found = true; - VmaAllocation* const pAlloc = pAllocationVector->m_Allocations[allocIndex]; - VMA_ASSERT(pAlloc); - // pAlloc became empty after this deallocation. - if(pAlloc->IsEmpty()) - { - // Already has empty Allocation. We don't want to have two, so delete this one. - if(m_HasEmptyAllocation[memTypeIndex]) - { - allocationToDelete = pAlloc; - VectorRemove(pAllocationVector->m_Allocations, allocIndex); - break; - } - // We now have first empty Allocation. - else - m_HasEmptyAllocation[memTypeIndex] = true; - } - // Must be called after allocIndex is used, because later it may become invalid! - pAllocationVector->IncrementallySortAllocations(); - break; + VmaDeviceMemoryBlock* const pBlock = hAllocation->GetBlock(); + hAllocation->BlockAllocUnmap(); + pBlock->Unmap(this, 1); } + break; + case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED: + hAllocation->DedicatedAllocUnmap(this); + break; + default: + VMA_ASSERT(0); } - if(found) +} + +VkResult VmaAllocator_T::BindBufferMemory(VmaAllocation hAllocation, VkBuffer hBuffer) +{ + VkResult res = VK_SUCCESS; + switch(hAllocation->GetType()) { - // Destruction of a free Allocation. Deferred until this point, outside of mutex - // lock, for performance reason. - if(allocationToDelete != VMA_NULL) - { - VMA_DEBUG_LOG(" Deleted empty allocation"); - allocationToDelete->Destroy(this); - vma_delete(this, allocationToDelete); - } - return; + case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED: + res = GetVulkanFunctions().vkBindBufferMemory( + m_hDevice, + hBuffer, + hAllocation->GetMemory(), + 0); //memoryOffset + break; + case VmaAllocation_T::ALLOCATION_TYPE_BLOCK: + { + VmaDeviceMemoryBlock* pBlock = hAllocation->GetBlock(); + VMA_ASSERT(pBlock && "Binding buffer to allocation that doesn't belong to any block. Is the allocation lost?"); + res = pBlock->BindBufferMemory(this, hAllocation, hBuffer); + break; } - - // pMemory not found in allocations. Try free it as Own Memory. - if(FreeOwnMemory(pMemory)) - return; - - // pMemory not found as Own Memory either. - VMA_ASSERT(0 && "Not found. Trying to free memory not allocated using this allocator (or some other bug)."); + default: + VMA_ASSERT(0); + } + return res; } -void VmaAllocator_T::CalculateStats(VmaStats* pStats) +VkResult VmaAllocator_T::BindImageMemory(VmaAllocation hAllocation, VkImage hImage) { - InitStatInfo(pStats->total); - for(size_t i = 0; i < VK_MAX_MEMORY_TYPES; ++i) - InitStatInfo(pStats->memoryType[i]); - for(size_t i = 0; i < VK_MAX_MEMORY_HEAPS; ++i) - InitStatInfo(pStats->memoryHeap[i]); - - for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex) + VkResult res = VK_SUCCESS; + switch(hAllocation->GetType()) { - VmaMutexLock allocationsLock(m_AllocationsMutex[memTypeIndex]); - const uint32_t heapIndex = m_MemProps.memoryTypes[memTypeIndex].heapIndex; - const VmaAllocationVector* const allocVector = m_pAllocations[memTypeIndex]; - VMA_ASSERT(allocVector); - allocVector->AddStats(pStats, memTypeIndex, heapIndex); + case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED: + res = GetVulkanFunctions().vkBindImageMemory( + m_hDevice, + hImage, + hAllocation->GetMemory(), + 0); //memoryOffset + break; + case VmaAllocation_T::ALLOCATION_TYPE_BLOCK: + { + VmaDeviceMemoryBlock* pBlock = hAllocation->GetBlock(); + VMA_ASSERT(pBlock && "Binding image to allocation that doesn't belong to any block. Is the allocation lost?"); + res = pBlock->BindImageMemory(this, hAllocation, hImage); + break; } - - VmaPostprocessCalcStatInfo(pStats->total); - for(size_t i = 0; i < GetMemoryTypeCount(); ++i) - VmaPostprocessCalcStatInfo(pStats->memoryType[i]); - for(size_t i = 0; i < GetMemoryHeapCount(); ++i) - VmaPostprocessCalcStatInfo(pStats->memoryHeap[i]); + default: + VMA_ASSERT(0); + } + return res; } -bool VmaAllocator_T::FreeOwnMemory(const VkMappedMemoryRange* pMemory) +void VmaAllocator_T::FreeDedicatedMemory(VmaAllocation allocation) { - VkDeviceMemory vkMemory = VK_NULL_HANDLE; + VMA_ASSERT(allocation && allocation->GetType() == VmaAllocation_T::ALLOCATION_TYPE_DEDICATED); - // Check all memory types because we don't know which one does pMemory come from. - for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex) + const uint32_t memTypeIndex = allocation->GetMemoryTypeIndex(); { - VmaMutexLock lock(m_OwnAllocationsMutex[memTypeIndex]); - OwnAllocationVectorType* const pOwnAllocations = m_pOwnAllocations[memTypeIndex]; - VMA_ASSERT(pOwnAllocations); - VmaOwnAllocation* const pOwnAllocationsBeg = pOwnAllocations->data(); - VmaOwnAllocation* const pOwnAllocationsEnd = pOwnAllocationsBeg + pOwnAllocations->size(); - VmaOwnAllocation* const pOwnAllocationIt = VmaBinaryFindFirstNotLess( - pOwnAllocationsBeg, - pOwnAllocationsEnd, - pMemory->memory, - VmaOwnAllocationMemoryHandleLess()); - if((pOwnAllocationIt != pOwnAllocationsEnd) && - (pOwnAllocationIt->m_hMemory == pMemory->memory)) - { - VMA_ASSERT(pMemory->size == pOwnAllocationIt->m_Size && pMemory->offset == 0); - vkMemory = pOwnAllocationIt->m_hMemory; - const size_t ownAllocationIndex = pOwnAllocationIt - pOwnAllocationsBeg; - VectorRemove(*pOwnAllocations, ownAllocationIndex); - VMA_DEBUG_LOG(" Freed OwnMemory MemoryTypeIndex=%u", memTypeIndex); - break; - } + VmaMutexLock lock(m_DedicatedAllocationsMutex[memTypeIndex], m_UseMutex); + AllocationVectorType* const pDedicatedAllocations = m_pDedicatedAllocations[memTypeIndex]; + VMA_ASSERT(pDedicatedAllocations); + bool success = VmaVectorRemoveSorted(*pDedicatedAllocations, allocation); + VMA_ASSERT(success); + + success; } - // Found. Free VkDeviceMemory deferred until this point, outside of mutex lock, - // for performance reason. - if(vkMemory != VK_NULL_HANDLE) + VkDeviceMemory hMemory = allocation->GetMemory(); + + if(allocation->GetMappedData() != VMA_NULL) { - vkFreeMemory(m_hDevice, vkMemory, GetAllocationCallbacks()); - return true; + (*m_VulkanFunctions.vkUnmapMemory)(m_hDevice, hMemory); } - else - return false; + + FreeVulkanMemory(memTypeIndex, allocation->GetSize(), hMemory); + + VMA_DEBUG_LOG(" Freed DedicatedMemory MemoryTypeIndex=%u", memTypeIndex); } #if VMA_STATS_STRING_ENABLED -void VmaAllocator_T::PrintDetailedMap(VmaStringBuilder& sb) +void VmaAllocator_T::PrintDetailedMap(VmaJsonWriter& json) { - bool ownAllocationsStarted = false; - for(size_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex) + bool dedicatedAllocationsStarted = false; + for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex) { - VmaMutexLock ownAllocationsLock(m_OwnAllocationsMutex[memTypeIndex]); - OwnAllocationVectorType* const pOwnAllocVector = m_pOwnAllocations[memTypeIndex]; - VMA_ASSERT(pOwnAllocVector); - if(pOwnAllocVector->empty() == false) + VmaMutexLock dedicatedAllocationsLock(m_DedicatedAllocationsMutex[memTypeIndex], m_UseMutex); + AllocationVectorType* const pDedicatedAllocVector = m_pDedicatedAllocations[memTypeIndex]; + VMA_ASSERT(pDedicatedAllocVector); + if(pDedicatedAllocVector->empty() == false) { - if(ownAllocationsStarted) - sb.Add(",\n\t\"Type "); - else + if(dedicatedAllocationsStarted == false) { - sb.Add(",\n\"OwnAllocations\": {\n\t\"Type "); - ownAllocationsStarted = true; + dedicatedAllocationsStarted = true; + json.WriteString("DedicatedAllocations"); + json.BeginObject(); } - sb.AddNumber(memTypeIndex); - sb.Add("\": ["); - for(size_t i = 0; i < pOwnAllocVector->size(); ++i) + json.BeginString("Type "); + json.ContinueString(memTypeIndex); + json.EndString(); + + json.BeginArray(); + + for(size_t i = 0; i < pDedicatedAllocVector->size(); ++i) { - const VmaOwnAllocation& ownAlloc = (*pOwnAllocVector)[i]; - if(i > 0) - sb.Add(",\n\t\t{ \"Size\": "); - else - sb.Add("\n\t\t{ \"Size\": "); - sb.AddNumber(ownAlloc.m_Size); - sb.Add(", \"Type\": "); - sb.AddString(VMA_SUBALLOCATION_TYPE_NAMES[ownAlloc.m_Type]); - sb.Add(" }"); + const VmaAllocation hAlloc = (*pDedicatedAllocVector)[i]; + json.BeginObject(true); + + json.WriteString("Type"); + json.WriteString(VMA_SUBALLOCATION_TYPE_NAMES[hAlloc->GetSuballocationType()]); + + json.WriteString("Size"); + json.WriteNumber(hAlloc->GetSize()); + + const void* pUserData = hAlloc->GetUserData(); + if(pUserData != VMA_NULL) + { + json.WriteString("UserData"); + if(hAlloc->IsUserDataString()) + { + json.WriteString((const char*)pUserData); + } + else + { + json.BeginString(); + json.ContinueString_Pointer(pUserData); + json.EndString(); + } + } + + json.EndObject(); } - sb.Add("\n\t]"); + json.EndArray(); } } - if(ownAllocationsStarted) - sb.Add("\n}"); + if(dedicatedAllocationsStarted) + { + json.EndObject(); + } { bool allocationsStarted = false; - for(size_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex) + for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex) { - VmaMutexLock globalAllocationsLock(m_AllocationsMutex[memTypeIndex]); - if(m_pAllocations[memTypeIndex]->IsEmpty() == false) + if(m_pBlockVectors[memTypeIndex]->IsEmpty() == false) { - if(allocationsStarted) - sb.Add(",\n\t\"Type "); - else + if(allocationsStarted == false) { - sb.Add(",\n\"Allocations\": {\n\t\"Type "); allocationsStarted = true; + json.WriteString("DefaultPools"); + json.BeginObject(); } - sb.AddNumber(memTypeIndex); - sb.Add("\": ["); - m_pAllocations[memTypeIndex]->PrintDetailedMap(sb); + json.BeginString("Type "); + json.ContinueString(memTypeIndex); + json.EndString(); - sb.Add("\n\t]"); + m_pBlockVectors[memTypeIndex]->PrintDetailedMap(json); } } if(allocationsStarted) - sb.Add("\n}"); + { + json.EndObject(); + } + } + + { + VmaMutexLock lock(m_PoolsMutex, m_UseMutex); + const size_t poolCount = m_Pools.size(); + if(poolCount > 0) + { + json.WriteString("Pools"); + json.BeginArray(); + for(size_t poolIndex = 0; poolIndex < poolCount; ++poolIndex) + { + m_Pools[poolIndex]->m_BlockVector.PrintDetailedMap(json); + } + json.EndArray(); + } } } @@ -3392,22 +8592,27 @@ void VmaAllocator_T::PrintDetailedMap(VmaStringBuilder& sb) static VkResult AllocateMemoryForImage( VmaAllocator allocator, VkImage image, - const VmaMemoryRequirements* pMemoryRequirements, + const VmaAllocationCreateInfo* pAllocationCreateInfo, VmaSuballocationType suballocType, - VkMappedMemoryRange* pMemory, - uint32_t* pMemoryTypeIndex) + VmaAllocation* pAllocation) { - VMA_ASSERT(allocator && image != VK_NULL_HANDLE && pMemoryRequirements && pMemory); + VMA_ASSERT(allocator && (image != VK_NULL_HANDLE) && pAllocationCreateInfo && pAllocation); VkMemoryRequirements vkMemReq = {}; - vkGetImageMemoryRequirements(allocator->m_hDevice, image, &vkMemReq); + bool requiresDedicatedAllocation = false; + bool prefersDedicatedAllocation = false; + allocator->GetImageMemoryRequirements(image, vkMemReq, + requiresDedicatedAllocation, prefersDedicatedAllocation); return allocator->AllocateMemory( vkMemReq, - *pMemoryRequirements, + requiresDedicatedAllocation, + prefersDedicatedAllocation, + VK_NULL_HANDLE, // dedicatedBuffer + image, // dedicatedImage + *pAllocationCreateInfo, suballocType, - pMemory, - pMemoryTypeIndex); + pAllocation); } //////////////////////////////////////////////////////////////////////////////// @@ -3460,6 +8665,18 @@ void vmaGetMemoryTypeProperties( *pFlags = allocator->m_MemProps.memoryTypes[memoryTypeIndex].propertyFlags; } +void vmaSetCurrentFrameIndex( + VmaAllocator allocator, + uint32_t frameIndex) +{ + VMA_ASSERT(allocator); + VMA_ASSERT(frameIndex != VMA_FRAME_INDEX_LOST); + + VMA_DEBUG_GLOBAL_MUTEX_LOCK + + allocator->SetCurrentFrameIndex(frameIndex); +} + void vmaCalculateStats( VmaAllocator allocator, VmaStats* pStats) @@ -3481,67 +8698,100 @@ void vmaBuildStatsString( VmaStringBuilder sb(allocator); { + VmaJsonWriter json(allocator->GetAllocationCallbacks(), sb); + json.BeginObject(); + VmaStats stats; allocator->CalculateStats(&stats); - sb.Add("{\n\"Total\": "); - VmaPrintStatInfo(sb, stats.total); + json.WriteString("Total"); + VmaPrintStatInfo(json, stats.total); for(uint32_t heapIndex = 0; heapIndex < allocator->GetMemoryHeapCount(); ++heapIndex) { - sb.Add(",\n\"Heap "); - sb.AddNumber(heapIndex); - sb.Add("\": {\n\t\"Size\": "); - sb.AddNumber(allocator->m_MemProps.memoryHeaps[heapIndex].size); - sb.Add(",\n\t\"Flags\": "); + json.BeginString("Heap "); + json.ContinueString(heapIndex); + json.EndString(); + json.BeginObject(); + + json.WriteString("Size"); + json.WriteNumber(allocator->m_MemProps.memoryHeaps[heapIndex].size); + + json.WriteString("Flags"); + json.BeginArray(true); if((allocator->m_MemProps.memoryHeaps[heapIndex].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) != 0) - sb.AddString("DEVICE_LOCAL"); - else - sb.AddString(""); - if(stats.memoryHeap[heapIndex].AllocationCount > 0) { - sb.Add(",\n\t\"Stats:\": "); - VmaPrintStatInfo(sb, stats.memoryHeap[heapIndex]); + json.WriteString("DEVICE_LOCAL"); + } + json.EndArray(); + + if(stats.memoryHeap[heapIndex].blockCount > 0) + { + json.WriteString("Stats"); + VmaPrintStatInfo(json, stats.memoryHeap[heapIndex]); } for(uint32_t typeIndex = 0; typeIndex < allocator->GetMemoryTypeCount(); ++typeIndex) { - if(allocator->m_MemProps.memoryTypes[typeIndex].heapIndex == heapIndex) + if(allocator->MemoryTypeIndexToHeapIndex(typeIndex) == heapIndex) { - sb.Add(",\n\t\"Type "); - sb.AddNumber(typeIndex); - sb.Add("\": {\n\t\t\"Flags\": \""); + json.BeginString("Type "); + json.ContinueString(typeIndex); + json.EndString(); + + json.BeginObject(); + + json.WriteString("Flags"); + json.BeginArray(true); VkMemoryPropertyFlags flags = allocator->m_MemProps.memoryTypes[typeIndex].propertyFlags; if((flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0) - sb.Add(" DEVICE_LOCAL"); + { + json.WriteString("DEVICE_LOCAL"); + } if((flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0) - sb.Add(" HOST_VISIBLE"); + { + json.WriteString("HOST_VISIBLE"); + } if((flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) != 0) - sb.Add(" HOST_COHERENT"); + { + json.WriteString("HOST_COHERENT"); + } if((flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) != 0) - sb.Add(" HOST_CACHED"); + { + json.WriteString("HOST_CACHED"); + } if((flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) != 0) - sb.Add(" LAZILY_ALLOCATED"); - sb.Add("\""); - if(stats.memoryType[typeIndex].AllocationCount > 0) { - sb.Add(",\n\t\t\"Stats\": "); - VmaPrintStatInfo(sb, stats.memoryType[typeIndex]); + json.WriteString("LAZILY_ALLOCATED"); + } + json.EndArray(); + + if(stats.memoryType[typeIndex].blockCount > 0) + { + json.WriteString("Stats"); + VmaPrintStatInfo(json, stats.memoryType[typeIndex]); } - sb.Add("\n\t}"); + + json.EndObject(); } } - sb.Add("\n}"); + + json.EndObject(); } if(detailedMap == VK_TRUE) - allocator->PrintDetailedMap(sb); - sb.Add("\n}\n"); + { + allocator->PrintDetailedMap(json); + } + + json.EndObject(); } const size_t len = sb.GetLength(); char* const pChars = vma_new_array(allocator, char, len + 1); if(len > 0) + { memcpy(pChars, sb.GetData(), len); + } pChars[len] = '\0'; *ppStatsString = pChars; } @@ -3560,39 +8810,53 @@ void vmaFreeStatsString( #endif // #if VMA_STATS_STRING_ENABLED -/** This function is not protected by any mutex because it just reads immutable data. +/* +This function is not protected by any mutex because it just reads immutable data. */ VkResult vmaFindMemoryTypeIndex( VmaAllocator allocator, uint32_t memoryTypeBits, - const VmaMemoryRequirements* pMemoryRequirements, + const VmaAllocationCreateInfo* pAllocationCreateInfo, uint32_t* pMemoryTypeIndex) { VMA_ASSERT(allocator != VK_NULL_HANDLE); - VMA_ASSERT(pMemoryRequirements != VMA_NULL); + VMA_ASSERT(pAllocationCreateInfo != VMA_NULL); VMA_ASSERT(pMemoryTypeIndex != VMA_NULL); + + if(pAllocationCreateInfo->memoryTypeBits != 0) + { + memoryTypeBits &= pAllocationCreateInfo->memoryTypeBits; + } - uint32_t requiredFlags = pMemoryRequirements->requiredFlags; - uint32_t preferredFlags = pMemoryRequirements->preferredFlags; - if(preferredFlags == 0) - preferredFlags = requiredFlags; - // preferredFlags, if not 0, must be subset of requiredFlags. - VMA_ASSERT((requiredFlags & ~preferredFlags) == 0); + uint32_t requiredFlags = pAllocationCreateInfo->requiredFlags; + uint32_t preferredFlags = pAllocationCreateInfo->preferredFlags; + + const bool mapped = (pAllocationCreateInfo->flags & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0; + if(mapped) + { + preferredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT; + } // Convert usage to requiredFlags and preferredFlags. - switch(pMemoryRequirements->usage) + switch(pAllocationCreateInfo->usage) { case VMA_MEMORY_USAGE_UNKNOWN: break; case VMA_MEMORY_USAGE_GPU_ONLY: - preferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; + if(!allocator->IsIntegratedGpu() || (preferredFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0) + { + preferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; + } break; case VMA_MEMORY_USAGE_CPU_ONLY: requiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; break; case VMA_MEMORY_USAGE_CPU_TO_GPU: requiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT; - preferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; + if(!allocator->IsIntegratedGpu() || (preferredFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0) + { + preferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; + } break; case VMA_MEMORY_USAGE_GPU_TO_CPU: requiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT; @@ -3617,13 +8881,15 @@ VkResult vmaFindMemoryTypeIndex( if((requiredFlags & ~currFlags) == 0) { // Calculate cost as number of bits from preferredFlags not present in this memory type. - uint32_t currCost = CountBitsSet(preferredFlags & ~currFlags); + uint32_t currCost = VmaCountBitsSet(preferredFlags & ~currFlags); // Remember memory type with lowest cost. if(currCost < minCost) { *pMemoryTypeIndex = memTypeIndex; if(currCost == 0) + { return VK_SUCCESS; + } minCost = currCost; } } @@ -3632,160 +8898,433 @@ VkResult vmaFindMemoryTypeIndex( return (*pMemoryTypeIndex != UINT32_MAX) ? VK_SUCCESS : VK_ERROR_FEATURE_NOT_PRESENT; } +VkResult vmaFindMemoryTypeIndexForBufferInfo( + VmaAllocator allocator, + const VkBufferCreateInfo* pBufferCreateInfo, + const VmaAllocationCreateInfo* pAllocationCreateInfo, + uint32_t* pMemoryTypeIndex) +{ + VMA_ASSERT(allocator != VK_NULL_HANDLE); + VMA_ASSERT(pBufferCreateInfo != VMA_NULL); + VMA_ASSERT(pAllocationCreateInfo != VMA_NULL); + VMA_ASSERT(pMemoryTypeIndex != VMA_NULL); + + const VkDevice hDev = allocator->m_hDevice; + VkBuffer hBuffer = VK_NULL_HANDLE; + VkResult res = allocator->GetVulkanFunctions().vkCreateBuffer( + hDev, pBufferCreateInfo, allocator->GetAllocationCallbacks(), &hBuffer); + if(res == VK_SUCCESS) + { + VkMemoryRequirements memReq = {}; + allocator->GetVulkanFunctions().vkGetBufferMemoryRequirements( + hDev, hBuffer, &memReq); + + res = vmaFindMemoryTypeIndex( + allocator, + memReq.memoryTypeBits, + pAllocationCreateInfo, + pMemoryTypeIndex); + + allocator->GetVulkanFunctions().vkDestroyBuffer( + hDev, hBuffer, allocator->GetAllocationCallbacks()); + } + return res; +} + +VkResult vmaFindMemoryTypeIndexForImageInfo( + VmaAllocator allocator, + const VkImageCreateInfo* pImageCreateInfo, + const VmaAllocationCreateInfo* pAllocationCreateInfo, + uint32_t* pMemoryTypeIndex) +{ + VMA_ASSERT(allocator != VK_NULL_HANDLE); + VMA_ASSERT(pImageCreateInfo != VMA_NULL); + VMA_ASSERT(pAllocationCreateInfo != VMA_NULL); + VMA_ASSERT(pMemoryTypeIndex != VMA_NULL); + + const VkDevice hDev = allocator->m_hDevice; + VkImage hImage = VK_NULL_HANDLE; + VkResult res = allocator->GetVulkanFunctions().vkCreateImage( + hDev, pImageCreateInfo, allocator->GetAllocationCallbacks(), &hImage); + if(res == VK_SUCCESS) + { + VkMemoryRequirements memReq = {}; + allocator->GetVulkanFunctions().vkGetImageMemoryRequirements( + hDev, hImage, &memReq); + + res = vmaFindMemoryTypeIndex( + allocator, + memReq.memoryTypeBits, + pAllocationCreateInfo, + pMemoryTypeIndex); + + allocator->GetVulkanFunctions().vkDestroyImage( + hDev, hImage, allocator->GetAllocationCallbacks()); + } + return res; +} + +VkResult vmaCreatePool( + VmaAllocator allocator, + const VmaPoolCreateInfo* pCreateInfo, + VmaPool* pPool) +{ + VMA_ASSERT(allocator && pCreateInfo && pPool); + + VMA_DEBUG_LOG("vmaCreatePool"); + + VMA_DEBUG_GLOBAL_MUTEX_LOCK + + return allocator->CreatePool(pCreateInfo, pPool); +} + +void vmaDestroyPool( + VmaAllocator allocator, + VmaPool pool) +{ + VMA_ASSERT(allocator); + + if(pool == VK_NULL_HANDLE) + { + return; + } + + VMA_DEBUG_LOG("vmaDestroyPool"); + + VMA_DEBUG_GLOBAL_MUTEX_LOCK + + allocator->DestroyPool(pool); +} + +void vmaGetPoolStats( + VmaAllocator allocator, + VmaPool pool, + VmaPoolStats* pPoolStats) +{ + VMA_ASSERT(allocator && pool && pPoolStats); + + VMA_DEBUG_GLOBAL_MUTEX_LOCK + + allocator->GetPoolStats(pool, pPoolStats); +} + +void vmaMakePoolAllocationsLost( + VmaAllocator allocator, + VmaPool pool, + size_t* pLostAllocationCount) +{ + VMA_ASSERT(allocator && pool); + + VMA_DEBUG_GLOBAL_MUTEX_LOCK + + allocator->MakePoolAllocationsLost(pool, pLostAllocationCount); +} + VkResult vmaAllocateMemory( VmaAllocator allocator, const VkMemoryRequirements* pVkMemoryRequirements, - const VmaMemoryRequirements* pVmaMemoryRequirements, - VkMappedMemoryRange* pMemory, - uint32_t* pMemoryTypeIndex) + const VmaAllocationCreateInfo* pCreateInfo, + VmaAllocation* pAllocation, + VmaAllocationInfo* pAllocationInfo) { - VMA_ASSERT(allocator && pVkMemoryRequirements && pVmaMemoryRequirements && pMemory); + VMA_ASSERT(allocator && pVkMemoryRequirements && pCreateInfo && pAllocation); VMA_DEBUG_LOG("vmaAllocateMemory"); VMA_DEBUG_GLOBAL_MUTEX_LOCK - return allocator->AllocateMemory( + VkResult result = allocator->AllocateMemory( *pVkMemoryRequirements, - *pVmaMemoryRequirements, + false, // requiresDedicatedAllocation + false, // prefersDedicatedAllocation + VK_NULL_HANDLE, // dedicatedBuffer + VK_NULL_HANDLE, // dedicatedImage + *pCreateInfo, VMA_SUBALLOCATION_TYPE_UNKNOWN, - pMemory, - pMemoryTypeIndex); + pAllocation); + + if(pAllocationInfo && result == VK_SUCCESS) + { + allocator->GetAllocationInfo(*pAllocation, pAllocationInfo); + } + + return result; } VkResult vmaAllocateMemoryForBuffer( VmaAllocator allocator, VkBuffer buffer, - const VmaMemoryRequirements* pMemoryRequirements, - VkMappedMemoryRange* pMemory, - uint32_t* pMemoryTypeIndex) + const VmaAllocationCreateInfo* pCreateInfo, + VmaAllocation* pAllocation, + VmaAllocationInfo* pAllocationInfo) { - VMA_ASSERT(allocator && buffer != VK_NULL_HANDLE && pMemoryRequirements && pMemory); + VMA_ASSERT(allocator && buffer != VK_NULL_HANDLE && pCreateInfo && pAllocation); VMA_DEBUG_LOG("vmaAllocateMemoryForBuffer"); VMA_DEBUG_GLOBAL_MUTEX_LOCK VkMemoryRequirements vkMemReq = {}; - vkGetBufferMemoryRequirements(allocator->m_hDevice, buffer, &vkMemReq); + bool requiresDedicatedAllocation = false; + bool prefersDedicatedAllocation = false; + allocator->GetBufferMemoryRequirements(buffer, vkMemReq, + requiresDedicatedAllocation, + prefersDedicatedAllocation); - return allocator->AllocateMemory( + VkResult result = allocator->AllocateMemory( vkMemReq, - *pMemoryRequirements, + requiresDedicatedAllocation, + prefersDedicatedAllocation, + buffer, // dedicatedBuffer + VK_NULL_HANDLE, // dedicatedImage + *pCreateInfo, VMA_SUBALLOCATION_TYPE_BUFFER, - pMemory, - pMemoryTypeIndex); + pAllocation); + + if(pAllocationInfo && result == VK_SUCCESS) + { + allocator->GetAllocationInfo(*pAllocation, pAllocationInfo); + } + + return result; } VkResult vmaAllocateMemoryForImage( VmaAllocator allocator, VkImage image, - const VmaMemoryRequirements* pMemoryRequirements, - VkMappedMemoryRange* pMemory, - uint32_t* pMemoryTypeIndex) + const VmaAllocationCreateInfo* pCreateInfo, + VmaAllocation* pAllocation, + VmaAllocationInfo* pAllocationInfo) { - VMA_ASSERT(allocator && image != VK_NULL_HANDLE && pMemoryRequirements); + VMA_ASSERT(allocator && image != VK_NULL_HANDLE && pCreateInfo && pAllocation); VMA_DEBUG_LOG("vmaAllocateMemoryForImage"); VMA_DEBUG_GLOBAL_MUTEX_LOCK - return AllocateMemoryForImage( + VkResult result = AllocateMemoryForImage( allocator, image, - pMemoryRequirements, + pCreateInfo, VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN, - pMemory, - pMemoryTypeIndex); + pAllocation); + + if(pAllocationInfo && result == VK_SUCCESS) + { + allocator->GetAllocationInfo(*pAllocation, pAllocationInfo); + } + + return result; } void vmaFreeMemory( VmaAllocator allocator, - const VkMappedMemoryRange* pMemory) + VmaAllocation allocation) { - VMA_ASSERT(allocator && pMemory); - + VMA_ASSERT(allocator); VMA_DEBUG_LOG("vmaFreeMemory"); + VMA_DEBUG_GLOBAL_MUTEX_LOCK + if(allocation != VK_NULL_HANDLE) + { + allocator->FreeMemory(allocation); + } +} + +void vmaGetAllocationInfo( + VmaAllocator allocator, + VmaAllocation allocation, + VmaAllocationInfo* pAllocationInfo) +{ + VMA_ASSERT(allocator && allocation && pAllocationInfo); + + VMA_DEBUG_GLOBAL_MUTEX_LOCK + + allocator->GetAllocationInfo(allocation, pAllocationInfo); +} + +VkBool32 vmaTouchAllocation( + VmaAllocator allocator, + VmaAllocation allocation) +{ + VMA_ASSERT(allocator && allocation); + + VMA_DEBUG_GLOBAL_MUTEX_LOCK + + return allocator->TouchAllocation(allocation); +} + +void vmaSetAllocationUserData( + VmaAllocator allocator, + VmaAllocation allocation, + void* pUserData) +{ + VMA_ASSERT(allocator && allocation); VMA_DEBUG_GLOBAL_MUTEX_LOCK - allocator->FreeMemory(pMemory); + allocation->SetUserData(allocator, pUserData); +} + +void vmaCreateLostAllocation( + VmaAllocator allocator, + VmaAllocation* pAllocation) +{ + VMA_ASSERT(allocator && pAllocation); + + VMA_DEBUG_GLOBAL_MUTEX_LOCK; + + allocator->CreateLostAllocation(pAllocation); } VkResult vmaMapMemory( VmaAllocator allocator, - const VkMappedMemoryRange* pMemory, + VmaAllocation allocation, void** ppData) { - VMA_ASSERT(allocator && pMemory && ppData); + VMA_ASSERT(allocator && allocation && ppData); VMA_DEBUG_GLOBAL_MUTEX_LOCK - return vkMapMemory(allocator->m_hDevice, pMemory->memory, - pMemory->offset, pMemory->size, 0, ppData); + return allocator->Map(allocation, ppData); } void vmaUnmapMemory( VmaAllocator allocator, - const VkMappedMemoryRange* pMemory) + VmaAllocation allocation) +{ + VMA_ASSERT(allocator && allocation); + + VMA_DEBUG_GLOBAL_MUTEX_LOCK + + allocator->Unmap(allocation); +} + +VkResult vmaDefragment( + VmaAllocator allocator, + VmaAllocation* pAllocations, + size_t allocationCount, + VkBool32* pAllocationsChanged, + const VmaDefragmentationInfo *pDefragmentationInfo, + VmaDefragmentationStats* pDefragmentationStats) +{ + VMA_ASSERT(allocator && pAllocations); + + VMA_DEBUG_LOG("vmaDefragment"); + + VMA_DEBUG_GLOBAL_MUTEX_LOCK + + return allocator->Defragment(pAllocations, allocationCount, pAllocationsChanged, pDefragmentationInfo, pDefragmentationStats); +} + +VkResult vmaBindBufferMemory( + VmaAllocator allocator, + VmaAllocation allocation, + VkBuffer buffer) +{ + VMA_ASSERT(allocator && allocation && buffer); + + VMA_DEBUG_LOG("vmaBindBufferMemory"); + + VMA_DEBUG_GLOBAL_MUTEX_LOCK + + return allocator->BindBufferMemory(allocation, buffer); +} + +VkResult vmaBindImageMemory( + VmaAllocator allocator, + VmaAllocation allocation, + VkImage image) { - VMA_ASSERT(allocator && pMemory); + VMA_ASSERT(allocator && allocation && image); + + VMA_DEBUG_LOG("vmaBindImageMemory"); VMA_DEBUG_GLOBAL_MUTEX_LOCK - vkUnmapMemory(allocator->m_hDevice, pMemory->memory); + return allocator->BindImageMemory(allocation, image); } VkResult vmaCreateBuffer( VmaAllocator allocator, - const VkBufferCreateInfo* pCreateInfo, - const VmaMemoryRequirements* pMemoryRequirements, + const VkBufferCreateInfo* pBufferCreateInfo, + const VmaAllocationCreateInfo* pAllocationCreateInfo, VkBuffer* pBuffer, - VkMappedMemoryRange* pMemory, - uint32_t* pMemoryTypeIndex) + VmaAllocation* pAllocation, + VmaAllocationInfo* pAllocationInfo) { - VMA_ASSERT(allocator && pCreateInfo && pMemoryRequirements); + VMA_ASSERT(allocator && pBufferCreateInfo && pAllocationCreateInfo && pBuffer && pAllocation); VMA_DEBUG_LOG("vmaCreateBuffer"); VMA_DEBUG_GLOBAL_MUTEX_LOCK + *pBuffer = VK_NULL_HANDLE; + *pAllocation = VK_NULL_HANDLE; + // 1. Create VkBuffer. - VkResult res = vkCreateBuffer(allocator->m_hDevice, pCreateInfo, allocator->GetAllocationCallbacks(), pBuffer); + VkResult res = (*allocator->GetVulkanFunctions().vkCreateBuffer)( + allocator->m_hDevice, + pBufferCreateInfo, + allocator->GetAllocationCallbacks(), + pBuffer); if(res >= 0) { - VkMappedMemoryRange mem = {}; - // 2. vkGetBufferMemoryRequirements. VkMemoryRequirements vkMemReq = {}; - vkGetBufferMemoryRequirements(allocator->m_hDevice, *pBuffer, &vkMemReq); + bool requiresDedicatedAllocation = false; + bool prefersDedicatedAllocation = false; + allocator->GetBufferMemoryRequirements(*pBuffer, vkMemReq, + requiresDedicatedAllocation, prefersDedicatedAllocation); + + // Make sure alignment requirements for specific buffer usages reported + // in Physical Device Properties are included in alignment reported by memory requirements. + if((pBufferCreateInfo->usage & VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT) != 0) + { + VMA_ASSERT(vkMemReq.alignment % + allocator->m_PhysicalDeviceProperties.limits.minTexelBufferOffsetAlignment == 0); + } + if((pBufferCreateInfo->usage & VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT) != 0) + { + VMA_ASSERT(vkMemReq.alignment % + allocator->m_PhysicalDeviceProperties.limits.minUniformBufferOffsetAlignment == 0); + } + if((pBufferCreateInfo->usage & VK_BUFFER_USAGE_STORAGE_BUFFER_BIT) != 0) + { + VMA_ASSERT(vkMemReq.alignment % + allocator->m_PhysicalDeviceProperties.limits.minStorageBufferOffsetAlignment == 0); + } // 3. Allocate memory using allocator. res = allocator->AllocateMemory( vkMemReq, - *pMemoryRequirements, + requiresDedicatedAllocation, + prefersDedicatedAllocation, + *pBuffer, // dedicatedBuffer + VK_NULL_HANDLE, // dedicatedImage + *pAllocationCreateInfo, VMA_SUBALLOCATION_TYPE_BUFFER, - &mem, - pMemoryTypeIndex); + pAllocation); if(res >= 0) { - if(pMemory != VMA_NULL) - { - *pMemory = mem; - } // 3. Bind buffer with memory. - res = vkBindBufferMemory(allocator->m_hDevice, *pBuffer, mem.memory, mem.offset); + res = allocator->BindBufferMemory(*pAllocation, *pBuffer); if(res >= 0) { // All steps succeeded. - VmaMutexLock lock(allocator->m_BufferToMemoryMapMutex); - allocator->m_BufferToMemoryMap.insert(VmaPair(*pBuffer, mem)); + if(pAllocationInfo != VMA_NULL) + { + allocator->GetAllocationInfo(*pAllocation, pAllocationInfo); + } return VK_SUCCESS; } - allocator->FreeMemory(&mem); + allocator->FreeMemory(*pAllocation); + *pAllocation = VK_NULL_HANDLE; + (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, *pBuffer, allocator->GetAllocationCallbacks()); + *pBuffer = VK_NULL_HANDLE; return res; } - vkDestroyBuffer(allocator->m_hDevice, *pBuffer, allocator->GetAllocationCallbacks()); + (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, *pBuffer, allocator->GetAllocationCallbacks()); + *pBuffer = VK_NULL_HANDLE; return res; } return res; @@ -3793,77 +9332,74 @@ VkResult vmaCreateBuffer( void vmaDestroyBuffer( VmaAllocator allocator, - VkBuffer buffer) + VkBuffer buffer, + VmaAllocation allocation) { + VMA_ASSERT(allocator); + VMA_DEBUG_LOG("vmaDestroyBuffer"); + VMA_DEBUG_GLOBAL_MUTEX_LOCK if(buffer != VK_NULL_HANDLE) { - VMA_ASSERT(allocator); - - VMA_DEBUG_LOG("vmaDestroyBuffer"); - - VMA_DEBUG_GLOBAL_MUTEX_LOCK - - VkMappedMemoryRange mem = {}; - { - VmaMutexLock lock(allocator->m_BufferToMemoryMapMutex); - VMA_MAP_TYPE(VkBuffer, VkMappedMemoryRange)::iterator it = allocator->m_BufferToMemoryMap.find(buffer); - if(it == allocator->m_BufferToMemoryMap.end()) - { - VMA_ASSERT(0 && "Trying to destroy buffer that was not created using vmaCreateBuffer or already freed."); - return; - } - mem = it->second; - allocator->m_BufferToMemoryMap.erase(it); - } - - vkDestroyBuffer(allocator->m_hDevice, buffer, allocator->GetAllocationCallbacks()); - - allocator->FreeMemory(&mem); + (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, buffer, allocator->GetAllocationCallbacks()); + } + if(allocation != VK_NULL_HANDLE) + { + allocator->FreeMemory(allocation); } } VkResult vmaCreateImage( VmaAllocator allocator, - const VkImageCreateInfo* pCreateInfo, - const VmaMemoryRequirements* pMemoryRequirements, + const VkImageCreateInfo* pImageCreateInfo, + const VmaAllocationCreateInfo* pAllocationCreateInfo, VkImage* pImage, - VkMappedMemoryRange* pMemory, - uint32_t* pMemoryTypeIndex) + VmaAllocation* pAllocation, + VmaAllocationInfo* pAllocationInfo) { - VMA_ASSERT(allocator && pCreateInfo && pMemoryRequirements); + VMA_ASSERT(allocator && pImageCreateInfo && pAllocationCreateInfo && pImage && pAllocation); VMA_DEBUG_LOG("vmaCreateImage"); VMA_DEBUG_GLOBAL_MUTEX_LOCK + *pImage = VK_NULL_HANDLE; + *pAllocation = VK_NULL_HANDLE; + // 1. Create VkImage. - VkResult res = vkCreateImage(allocator->m_hDevice, pCreateInfo, allocator->GetAllocationCallbacks(), pImage); + VkResult res = (*allocator->GetVulkanFunctions().vkCreateImage)( + allocator->m_hDevice, + pImageCreateInfo, + allocator->GetAllocationCallbacks(), + pImage); if(res >= 0) { - VkMappedMemoryRange mem = {}; - VmaSuballocationType suballocType = pCreateInfo->tiling == VK_IMAGE_TILING_OPTIMAL ? + VmaSuballocationType suballocType = pImageCreateInfo->tiling == VK_IMAGE_TILING_OPTIMAL ? VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL : VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR; // 2. Allocate memory using allocator. - res = AllocateMemoryForImage(allocator, *pImage, pMemoryRequirements, suballocType, &mem, pMemoryTypeIndex); + res = AllocateMemoryForImage(allocator, *pImage, pAllocationCreateInfo, suballocType, pAllocation); if(res >= 0) { - if(pMemory != VMA_NULL) - *pMemory = mem; // 3. Bind image with memory. - res = vkBindImageMemory(allocator->m_hDevice, *pImage, mem.memory, mem.offset); + res = allocator->BindImageMemory(*pAllocation, *pImage); if(res >= 0) { // All steps succeeded. - VmaMutexLock lock(allocator->m_ImageToMemoryMapMutex); - allocator->m_ImageToMemoryMap.insert(VmaPair(*pImage, mem)); + if(pAllocationInfo != VMA_NULL) + { + allocator->GetAllocationInfo(*pAllocation, pAllocationInfo); + } return VK_SUCCESS; } - allocator->FreeMemory(&mem); + allocator->FreeMemory(*pAllocation); + *pAllocation = VK_NULL_HANDLE; + (*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, *pImage, allocator->GetAllocationCallbacks()); + *pImage = VK_NULL_HANDLE; return res; } - vkDestroyImage(allocator->m_hDevice, *pImage, allocator->GetAllocationCallbacks()); + (*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, *pImage, allocator->GetAllocationCallbacks()); + *pImage = VK_NULL_HANDLE; return res; } return res; @@ -3871,35 +9407,20 @@ VkResult vmaCreateImage( void vmaDestroyImage( VmaAllocator allocator, - VkImage image) + VkImage image, + VmaAllocation allocation) { + VMA_ASSERT(allocator); + VMA_DEBUG_LOG("vmaDestroyImage"); + VMA_DEBUG_GLOBAL_MUTEX_LOCK if(image != VK_NULL_HANDLE) { - VMA_ASSERT(allocator); - - VMA_DEBUG_LOG("vmaDestroyImage"); - - VMA_DEBUG_GLOBAL_MUTEX_LOCK - - VkMappedMemoryRange mem = {}; - { - VmaMutexLock lock(allocator->m_ImageToMemoryMapMutex); - VMA_MAP_TYPE(VkImage, VkMappedMemoryRange)::iterator it = allocator->m_ImageToMemoryMap.find(image); - if(it == allocator->m_ImageToMemoryMap.end()) - { - VMA_ASSERT(0 && "Trying to destroy buffer that was not created using vmaCreateBuffer or already freed."); - return; - } - mem = it->second; - allocator->m_ImageToMemoryMap.erase(it); - } - - vkDestroyImage(allocator->m_hDevice, image, allocator->GetAllocationCallbacks()); - - allocator->FreeMemory(&mem); + (*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, image, allocator->GetAllocationCallbacks()); + } + if(allocation != VK_NULL_HANDLE) + { + allocator->FreeMemory(allocation); } } #endif // #ifdef VMA_IMPLEMENTATION - -#endif // AMD_VULKAN_MEMORY_ALLOCATOR_H diff --git a/deps/glslang/CMakeLists.txt b/deps/glslang/CMakeLists.txt index a17e0ddb..1ffb1859 100644 --- a/deps/glslang/CMakeLists.txt +++ b/deps/glslang/CMakeLists.txt @@ -1,19 +1,28 @@ # increase to 3.1 once all major distributions # include a version of CMake >= 3.1 cmake_minimum_required(VERSION 2.8.12) +if (POLICY CMP0048) + cmake_policy(SET CMP0048 NEW) +endif() set_property(GLOBAL PROPERTY USE_FOLDERS ON) # Adhere to GNU filesystem layout conventions include(GNUInstallDirs) -option(ENABLE_AMD_EXTENSIONS "Enables support of AMD-specific extensions" ON) +option(SKIP_GLSLANG_INSTALL "Skip installation" ${SKIP_GLSLANG_INSTALL}) +if(NOT ${SKIP_GLSLANG_INSTALL}) + set(ENABLE_GLSLANG_INSTALL ON) +endif() -#Adjusted for Anvil: +option(ENABLE_AMD_EXTENSIONS "Enables support of AMD-specific extensions" ON) option(ENABLE_GLSLANG_BINARIES "Builds glslangValidator and spirv-remap" OFF) option(ENABLE_NV_EXTENSIONS "Enables support of Nvidia-specific extensions" ON) + option(ENABLE_HLSL "Enables HLSL input support" ON) +option(ENABLE_OPT "Enables spirv-opt capability if present" OFF) + if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND WIN32) set(CMAKE_INSTALL_PREFIX "install" CACHE STRING "..." FORCE) endif() @@ -48,7 +57,7 @@ endif(WIN32) if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU") add_compile_options(-Wall -Wmaybe-uninitialized -Wuninitialized -Wunused -Wunused-local-typedefs - -Wunused-parameter -Wunused-value -Wunused-variable -Wunused-but-set-parameter -Wunused-but-set-variable) + -Wunused-parameter -Wunused-value -Wunused-variable -Wunused-but-set-parameter -Wunused-but-set-variable -fno-exceptions) add_compile_options(-Wno-reorder) # disable this from -Wall, since it happens all over. elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") add_compile_options(-Wall -Wuninitialized -Wunused -Wunused-local-typedefs @@ -77,9 +86,21 @@ function(glslang_set_link_args TARGET) endfunction(glslang_set_link_args) # We depend on these for later projects, so they should come first. -add_subdirectory(External) +#add_subdirectory(External) + +if(NOT TARGET SPIRV-Tools-opt) + set(ENABLE_OPT OFF) +endif() + +if(ENABLE_OPT) + message(STATUS "optimizer enabled") + add_definitions(-DENABLE_OPT) +elseif(ENABLE_HLSL) + message(STATUS "spirv-tools not linked - illegal SPIRV may be generated for HLSL") +endif() add_subdirectory(glslang) +add_subdirectory(OGLCompilersDLL) if(ENABLE_GLSLANG_BINARIES) add_subdirectory(StandAlone) endif() @@ -87,5 +108,4 @@ add_subdirectory(SPIRV) if(ENABLE_HLSL) add_subdirectory(hlsl) endif(ENABLE_HLSL) -#Disabled for Anvil: #add_subdirectory(gtests) diff --git a/deps/glslang/External/CMakeLists.txt b/deps/glslang/External/CMakeLists.txt deleted file mode 100644 index 4f694ee7..00000000 --- a/deps/glslang/External/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -# Suppress all warnings from external projects. -set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS -w) - -if(BUILD_TESTING) - if(TARGET gmock) - message(STATUS "Google Mock already configured - use it") - elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest) - # We need to make sure Google Test does not mess up with the - # global CRT settings on Windows. - if(WIN32) - set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) - endif(WIN32) - add_subdirectory(googletest) - set(GTEST_TARGETS - gtest - gtest_main - gmock - gmock_main) - foreach(target ${GTEST_TARGETS}) - set_property(TARGET ${target} PROPERTY FOLDER gtest) - endforeach() - mark_as_advanced(gmock_build_tests - BUILD_GMOCK - BUILD_GTEST - BUILD_SHARED_LIBS - gtest_build_samples - gtest_build_tests - gtest_disable_pthreads - gtest_force_shared_crt - gtest_hide_internal_symbols) - else() - message(STATUS - "Google Mock was not found - tests based on that will not build") - endif() -endif() diff --git a/deps/glslang/LinuxDoAll.bash b/deps/glslang/LinuxDoAll.bash deleted file mode 100644 index 4bd39a33..00000000 --- a/deps/glslang/LinuxDoAll.bash +++ /dev/null @@ -1,34 +0,0 @@ -#! /bin/bash - -svn update - -rm -f StandAlone/glslangValidator -rm -f Test/glslangValidator -rm -f glslang/MachineIndependent/lib/libglslang.so -rm -f Install/Linux/libglslang.so -rm -f Install/Linux/glslangValidator - -cd StandAlone -make clean -cd ../glslang/MachineIndependent -make clean -cd ../.. - -# build the StandAlone app and all it's dependencies -make -C StandAlone - -# so we can find the shared library -#LD_LIBRARY_PATH=`pwd`/glslang/MachineIndependent/lib -#export LD_LIBRARY_PATH - -# install -cd Install/Linux -./install -cp glslangValidator ../../Test -LD_LIBRARY_PATH=/usr/local/lib -export LD_LIBRARY_PATH - -# run using test data -cd ../../Test -chmod +x runtests -./runtests diff --git a/deps/glslang/OGLCompilersDLL/CMakeLists.txt b/deps/glslang/OGLCompilersDLL/CMakeLists.txt index 9b9b0386..5bb3f0ee 100644 --- a/deps/glslang/OGLCompilersDLL/CMakeLists.txt +++ b/deps/glslang/OGLCompilersDLL/CMakeLists.txt @@ -1,14 +1,14 @@ set(SOURCES InitializeDll.cpp InitializeDll.h) add_library(OGLCompiler STATIC ${SOURCES}) -set_property(TARGET OGLCompiler PROPERTY FOLDER glslang POSITION_INDEPENDENT_CODE ON) +set_property(TARGET OGLCompiler PROPERTY FOLDER glslang) +set_property(TARGET OGLCompiler PROPERTY POSITION_INDEPENDENT_CODE ON) if(WIN32) source_group("Source" FILES ${SOURCES}) endif(WIN32) -# Disabled for Anvil: -#>> -#install(TARGETS OGLCompiler -# ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -#<< +if(ENABLE_GLSLANG_INSTALL) + install(TARGETS OGLCompiler + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +endif(ENABLE_GLSLANG_INSTALL) diff --git a/deps/glslang/OGLCompilersDLL/InitializeDll.cpp b/deps/glslang/OGLCompilersDLL/InitializeDll.cpp index 2eb912c4..abea9108 100644 --- a/deps/glslang/OGLCompilersDLL/InitializeDll.cpp +++ b/deps/glslang/OGLCompilersDLL/InitializeDll.cpp @@ -38,13 +38,17 @@ #include "InitializeDll.h" #include "../glslang/Include/InitializeGlobals.h" - #include "../glslang/Public/ShaderLang.h" +#include "../glslang/Include/PoolAlloc.h" namespace glslang { OS_TLSIndex ThreadInitializeIndex = OS_INVALID_TLS_INDEX; +// Per-process initialization. +// Needs to be called at least once before parsing, etc. is done. +// Will also do thread initialization for the calling thread; other +// threads will need to do that explicitly. bool InitProcess() { glslang::GetGlobalLock(); @@ -85,7 +89,9 @@ bool InitProcess() return true; } - +// Per-thread scoped initialization. +// Must be called at least once by each new thread sharing the +// symbol tables, etc., needed to parse. bool InitThread() { // @@ -99,17 +105,21 @@ bool InitThread() if (OS_GetTLSValue(ThreadInitializeIndex) != 0) return true; - InitializeMemoryPools(); - if (! OS_SetTLSValue(ThreadInitializeIndex, (void *)1)) { assert(0 && "InitThread(): Unable to set init flag."); return false; } + glslang::SetThreadPoolAllocator(nullptr); + return true; } - +// Not necessary to call this: InitThread() is reentrant, and the need +// to do per thread tear down has been removed. +// +// This is kept, with memory management removed, to satisfy any exiting +// calls to it that rely on it. bool DetachThread() { bool success = true; @@ -125,14 +135,18 @@ bool DetachThread() assert(0 && "DetachThread(): Unable to clear init flag."); success = false; } - - FreeGlobalPools(); - } return success; } +// Not necessary to call this: InitProcess() is reentrant. +// +// This is kept, with memory management removed, to satisfy any exiting +// calls to it that rely on it. +// +// Users of glslang should call shFinalize() or glslang::FinalizeProcess() for +// process-scoped memory tear down. bool DetachProcess() { bool success = true; @@ -140,12 +154,8 @@ bool DetachProcess() if (ThreadInitializeIndex == OS_INVALID_TLS_INDEX) return true; - ShFinalize(); - success = DetachThread(); - FreePoolIndex(); - OS_FreeTLSIndex(ThreadInitializeIndex); ThreadInitializeIndex = OS_INVALID_TLS_INDEX; diff --git a/deps/glslang/OGLCompilersDLL/InitializeDll.h b/deps/glslang/OGLCompilersDLL/InitializeDll.h index 60b2b159..661cee4d 100644 --- a/deps/glslang/OGLCompilersDLL/InitializeDll.h +++ b/deps/glslang/OGLCompilersDLL/InitializeDll.h @@ -40,8 +40,8 @@ namespace glslang { bool InitProcess(); bool InitThread(); -bool DetachThread(); -bool DetachProcess(); +bool DetachThread(); // not called from standalone, perhaps other tools rely on parts of it +bool DetachProcess(); // not called from standalone, perhaps other tools rely on parts of it } // end namespace glslang diff --git a/deps/glslang/README-spirv-remap.txt b/deps/glslang/README-spirv-remap.txt index 8e3259f8..3e5288aa 100644 --- a/deps/glslang/README-spirv-remap.txt +++ b/deps/glslang/README-spirv-remap.txt @@ -98,7 +98,7 @@ options. See REMAPPING AND OPTIMIZATION OPTIONS. On error, the function supplied to registerErrorHandler() will be invoked. This can be a standard C/C++ function, a lambda function, or a functor. The default handler simply calls exit(5); The error handler is a static -members, so need only be set up once, not once per spirvbin_t instance. +member, so need only be set up once, not once per spirvbin_t instance. Log messages are supplied to registerLogHandler(). By default, log messages are eaten silently. The log handler is also a static member. diff --git a/deps/glslang/SPIRV/CMakeLists.txt b/deps/glslang/SPIRV/CMakeLists.txt index 246a2d7f..b6824192 100644 --- a/deps/glslang/SPIRV/CMakeLists.txt +++ b/deps/glslang/SPIRV/CMakeLists.txt @@ -14,6 +14,7 @@ set(HEADERS bitutils.h spirv.hpp GLSL.std.450.h + GLSL.ext.EXT.h GLSL.ext.KHR.h GlslangToSpv.h hex_float.h @@ -40,21 +41,31 @@ if(ENABLE_NV_EXTENSIONS) endif(ENABLE_NV_EXTENSIONS) add_library(SPIRV STATIC ${SOURCES} ${HEADERS}) -set_property(TARGET SPIRV PROPERTY FOLDER glslang POSITION_INDEPENDENT_CODE ON) -target_link_libraries(SPIRV glslang) +set_property(TARGET SPIRV PROPERTY FOLDER glslang) +set_property(TARGET SPIRV PROPERTY POSITION_INDEPENDENT_CODE ON) add_library(SPVRemapper STATIC ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS}) -set_property(TARGET SPVRemapper PROPERTY FOLDER glslang POSITION_INDEPENDENT_CODE ON) +set_property(TARGET SPVRemapper PROPERTY FOLDER glslang) +set_property(TARGET SPVRemapper PROPERTY POSITION_INDEPENDENT_CODE ON) + +if(ENABLE_OPT) + target_include_directories(SPIRV + PRIVATE ${spirv-tools_SOURCE_DIR}/include + PRIVATE ${spirv-tools_SOURCE_DIR}/source + ) + target_link_libraries(SPIRV glslang SPIRV-Tools-opt SPVRemapper) +else() + target_link_libraries(SPIRV glslang) +endif(ENABLE_OPT) if(WIN32) source_group("Source" FILES ${SOURCES} ${HEADERS}) source_group("Source" FILES ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS}) endif(WIN32) -# Disabled for Anvil: -#>> -#install(TARGETS SPIRV SPVRemapper -# ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -# -#install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SPIRV/) -#<< +if(ENABLE_GLSLANG_INSTALL) + install(TARGETS SPIRV SPVRemapper + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SPIRV/) +endif(ENABLE_GLSLANG_INSTALL) diff --git a/deps/glslang/SPIRV/GLSL.ext.AMD.h b/deps/glslang/SPIRV/GLSL.ext.AMD.h index 5121ed99..009d2f1c 100644 --- a/deps/glslang/SPIRV/GLSL.ext.AMD.h +++ b/deps/glslang/SPIRV/GLSL.ext.AMD.h @@ -27,13 +27,8 @@ #ifndef GLSLextAMD_H #define GLSLextAMD_H -enum BuiltIn; -enum Capability; -enum Decoration; -enum Op; - static const int GLSLextAMDVersion = 100; -static const int GLSLextAMDRevision = 5; +static const int GLSLextAMDRevision = 7; // SPV_AMD_shader_ballot static const char* const E_SPV_AMD_shader_ballot = "SPV_AMD_shader_ballot"; @@ -104,6 +99,10 @@ static const char* const E_SPV_AMD_gpu_shader_int16 = "SPV_AMD_gpu_shader_int16" // SPV_AMD_shader_image_load_store_lod static const char* const E_SPV_AMD_shader_image_load_store_lod = "SPV_AMD_shader_image_load_store_lod"; -static const Capability CapabilityImageReadWriteLodAMD = static_cast(5015); +// SPV_AMD_shader_fragment_mask +static const char* const E_SPV_AMD_shader_fragment_mask = "SPV_AMD_shader_fragment_mask"; + +// SPV_AMD_gpu_shader_half_float_fetch +static const char* const E_SPV_AMD_gpu_shader_half_float_fetch = "SPV_AMD_gpu_shader_half_float_fetch"; #endif // #ifndef GLSLextAMD_H diff --git a/deps/glslang/SPIRV/GLSL.ext.EXT.h b/deps/glslang/SPIRV/GLSL.ext.EXT.h new file mode 100644 index 00000000..c4a24308 --- /dev/null +++ b/deps/glslang/SPIRV/GLSL.ext.EXT.h @@ -0,0 +1,37 @@ +/* +** Copyright (c) 2014-2016 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +#ifndef GLSLextEXT_H +#define GLSLextEXT_H + +static const int GLSLextEXTVersion = 100; +static const int GLSLextEXTRevision = 1; + +static const char* const E_SPV_EXT_shader_stencil_export = "SPV_EXT_shader_stencil_export"; +static const char* const E_SPV_EXT_shader_viewport_index_layer = "SPV_EXT_shader_viewport_index_layer"; +static const char* const E_SPV_EXT_fragment_fully_covered = "SPV_EXT_fragment_fully_covered"; + +#endif // #ifndef GLSLextEXT_H diff --git a/deps/glslang/SPIRV/GLSL.ext.KHR.h b/deps/glslang/SPIRV/GLSL.ext.KHR.h index 2eb10ae6..d8ea9b67 100644 --- a/deps/glslang/SPIRV/GLSL.ext.KHR.h +++ b/deps/glslang/SPIRV/GLSL.ext.KHR.h @@ -27,10 +27,6 @@ #ifndef GLSLextKHR_H #define GLSLextKHR_H -enum BuiltIn; -enum Op; -enum Capability; - static const int GLSLextKHRVersion = 100; static const int GLSLextKHRRevision = 2; @@ -42,7 +38,5 @@ static const char* const E_SPV_KHR_shader_draw_parameters = "SPV_KHR_shade static const char* const E_SPV_KHR_16bit_storage = "SPV_KHR_16bit_storage"; static const char* const E_SPV_KHR_storage_buffer_storage_class = "SPV_KHR_storage_buffer_storage_class"; static const char* const E_SPV_KHR_post_depth_coverage = "SPV_KHR_post_depth_coverage"; -static const char* const E_SPV_EXT_shader_stencil_export = "SPV_EXT_shader_stencil_export"; -static const char* const E_SPV_EXT_shader_viewport_index_layer = "SPV_EXT_shader_viewport_index_layer"; #endif // #ifndef GLSLextKHR_H diff --git a/deps/glslang/SPIRV/GLSL.ext.NV.h b/deps/glslang/SPIRV/GLSL.ext.NV.h index c01858be..148d4b45 100644 --- a/deps/glslang/SPIRV/GLSL.ext.NV.h +++ b/deps/glslang/SPIRV/GLSL.ext.NV.h @@ -51,4 +51,7 @@ const char* const E_SPV_NV_stereo_view_rendering = "SPV_NV_stereo_view_rendering //SPV_NVX_multiview_per_view_attributes const char* const E_SPV_NVX_multiview_per_view_attributes = "SPV_NVX_multiview_per_view_attributes"; +//SPV_NV_shader_subgroup_partitioned +const char* const E_SPV_NV_shader_subgroup_partitioned = "SPV_NV_shader_subgroup_partitioned"; + #endif // #ifndef GLSLextNV_H \ No newline at end of file diff --git a/deps/glslang/SPIRV/GlslangToSpv.cpp b/deps/glslang/SPIRV/GlslangToSpv.cpp index b6c9705d..95b507b1 100644 --- a/deps/glslang/SPIRV/GlslangToSpv.cpp +++ b/deps/glslang/SPIRV/GlslangToSpv.cpp @@ -1,6 +1,7 @@ // // Copyright (C) 2014-2016 LunarG, Inc. // Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -44,6 +45,7 @@ namespace spv { #include "GLSL.std.450.h" #include "GLSL.ext.KHR.h" + #include "GLSL.ext.EXT.h" #ifdef AMD_EXTENSIONS #include "GLSL.ext.AMD.h" #endif @@ -52,6 +54,15 @@ namespace spv { #endif } +#if ENABLE_OPT + #include "spirv-tools/optimizer.hpp" + #include "message.h" +#endif + +#if ENABLE_OPT +using namespace spvtools; +#endif + // Glslang includes #include "../glslang/MachineIndependent/localintermediate.h" #include "../glslang/MachineIndependent/SymbolTable.h" @@ -68,11 +79,6 @@ namespace spv { namespace { -// For low-order part of the generator's magic number. Bump up -// when there is a change in the style (e.g., if SSA form changes, -// or a different instruction sequence to do something gets used). -const int GeneratorVersion = 1; - namespace { class SpecConstantOpModeGuard { public: @@ -92,7 +98,14 @@ class SpecConstantOpModeGuard { spv::Builder* builder_; bool previous_flag_; }; -} + +struct OpDecorations { + spv::Decoration precision; + spv::Decoration noContraction; + spv::Decoration nonUniform; +}; + +} // namespace // // The main holder of information for translating glslang to SPIR-V. @@ -101,7 +114,8 @@ class SpecConstantOpModeGuard { // class TGlslangToSpvTraverser : public glslang::TIntermTraverser { public: - TGlslangToSpvTraverser(const glslang::TIntermediate*, spv::SpvBuildLogger* logger, glslang::SpvOptions& options); + TGlslangToSpvTraverser(unsigned int spvVersion, const glslang::TIntermediate*, spv::SpvBuildLogger* logger, + glslang::SpvOptions& options); virtual ~TGlslangToSpvTraverser() { } bool visitAggregate(glslang::TVisit, glslang::TIntermAggregate*); @@ -118,20 +132,27 @@ class TGlslangToSpvTraverser : public glslang::TIntermTraverser { void dumpSpv(std::vector& out); protected: + TGlslangToSpvTraverser(TGlslangToSpvTraverser&); + TGlslangToSpvTraverser& operator=(TGlslangToSpvTraverser&); + spv::Decoration TranslateInterpolationDecoration(const glslang::TQualifier& qualifier); spv::Decoration TranslateAuxiliaryStorageDecoration(const glslang::TQualifier& qualifier); + spv::Decoration TranslateNonUniformDecoration(const glslang::TQualifier& qualifier); spv::BuiltIn TranslateBuiltInDecoration(glslang::TBuiltInVariable, bool memberDeclaration); spv::ImageFormat TranslateImageFormat(const glslang::TType& type); - spv::SelectionControlMask TranslateSelectionControl(glslang::TSelectionControl) const; - spv::LoopControlMask TranslateLoopControl(glslang::TLoopControl) const; + spv::SelectionControlMask TranslateSelectionControl(const glslang::TIntermSelection&) const; + spv::SelectionControlMask TranslateSwitchControl(const glslang::TIntermSwitch&) const; + spv::LoopControlMask TranslateLoopControl(const glslang::TIntermLoop&, unsigned int& dependencyLength) const; spv::StorageClass TranslateStorageClass(const glslang::TType&); + void addIndirectionIndexCapabilities(const glslang::TType& baseType, const glslang::TType& indexType); spv::Id createSpvVariable(const glslang::TIntermSymbol*); spv::Id getSampledType(const glslang::TSampler&); spv::Id getInvertedSwizzleType(const glslang::TIntermTyped&); spv::Id createInvertedSwizzle(spv::Decoration precision, const glslang::TIntermTyped&, spv::Id parentResult); void convertSwizzle(const glslang::TIntermAggregate&, std::vector& swizzle); spv::Id convertGlslangToSpvType(const glslang::TType& type); - spv::Id convertGlslangToSpvType(const glslang::TType& type, glslang::TLayoutPacking, const glslang::TQualifier&); + spv::Id convertGlslangToSpvType(const glslang::TType& type, glslang::TLayoutPacking, const glslang::TQualifier&, + bool lastBufferBlockMember); bool filterMember(const glslang::TType& member); spv::Id convertGlslangStructToSpvType(const glslang::TType&, const glslang::TTypeList* glslangStruct, glslang::TLayoutPacking, const glslang::TQualifier&); @@ -144,10 +165,13 @@ class TGlslangToSpvTraverser : public glslang::TIntermTraverser { glslang::TLayoutPacking getExplicitLayout(const glslang::TType& type) const; int getArrayStride(const glslang::TType& arrayType, glslang::TLayoutPacking, glslang::TLayoutMatrix); int getMatrixStride(const glslang::TType& matrixType, glslang::TLayoutPacking, glslang::TLayoutMatrix); - void updateMemberOffset(const glslang::TType& structType, const glslang::TType& memberType, int& currentOffset, int& nextOffset, glslang::TLayoutPacking, glslang::TLayoutMatrix); + void updateMemberOffset(const glslang::TType& structType, const glslang::TType& memberType, int& currentOffset, + int& nextOffset, glslang::TLayoutPacking, glslang::TLayoutMatrix); void declareUseOfStructMember(const glslang::TTypeList& members, int glslangMember); bool isShaderEntryPoint(const glslang::TIntermAggregate* node); + bool writableParam(glslang::TStorageQualifier); + bool originalParam(glslang::TStorageQualifier, const glslang::TType&, bool implicitThisParam); void makeFunctions(const glslang::TIntermSequence&); void makeGlobalInitializers(const glslang::TIntermSequence&); void visitFunctions(const glslang::TIntermSequence&); @@ -157,28 +181,37 @@ class TGlslangToSpvTraverser : public glslang::TIntermTraverser { spv::Id createImageTextureFunctionCall(glslang::TIntermOperator* node); spv::Id handleUserFunctionCall(const glslang::TIntermAggregate*); - spv::Id createBinaryOperation(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id left, spv::Id right, glslang::TBasicType typeProxy, bool reduceComparison = true); - spv::Id createBinaryMatrixOperation(spv::Op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id left, spv::Id right); - spv::Id createUnaryOperation(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id operand,glslang::TBasicType typeProxy); - spv::Id createUnaryMatrixOperation(spv::Op op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id operand,glslang::TBasicType typeProxy); - spv::Id createConversion(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id destTypeId, spv::Id operand, glslang::TBasicType typeProxy); + spv::Id createBinaryOperation(glslang::TOperator op, OpDecorations&, spv::Id typeId, spv::Id left, spv::Id right, + glslang::TBasicType typeProxy, bool reduceComparison = true); + spv::Id createBinaryMatrixOperation(spv::Op, OpDecorations&, spv::Id typeId, spv::Id left, spv::Id right); + spv::Id createUnaryOperation(glslang::TOperator op, OpDecorations&, spv::Id typeId, spv::Id operand, + glslang::TBasicType typeProxy); + spv::Id createUnaryMatrixOperation(spv::Op op, OpDecorations&, spv::Id typeId, spv::Id operand, + glslang::TBasicType typeProxy); + spv::Id createConversion(glslang::TOperator op, OpDecorations&, spv::Id destTypeId, spv::Id operand, + glslang::TBasicType typeProxy); + spv::Id createConversionOperation(glslang::TOperator op, spv::Id operand, int vectorSize); spv::Id makeSmearedConstant(spv::Id constant, int vectorSize); spv::Id createAtomicOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy); spv::Id createInvocationsOperation(glslang::TOperator op, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy); spv::Id CreateInvocationsVectorOperation(spv::Op op, spv::GroupOperation groupOperation, spv::Id typeId, std::vector& operands); + spv::Id createSubgroupOperation(glslang::TOperator op, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy); spv::Id createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy); spv::Id createNoArgOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId); spv::Id getSymbolId(const glslang::TIntermSymbol* node); - void addDecoration(spv::Id id, spv::Decoration dec); - void addDecoration(spv::Id id, spv::Decoration dec, unsigned value); - void addMemberDecoration(spv::Id id, int member, spv::Decoration dec); - void addMemberDecoration(spv::Id id, int member, spv::Decoration dec, unsigned value); spv::Id createSpvConstant(const glslang::TIntermTyped&); spv::Id createSpvConstantFromConstUnionArray(const glslang::TType& type, const glslang::TConstUnionArray&, int& nextConst, bool specConstant); bool isTrivialLeaf(const glslang::TIntermTyped* node); bool isTrivial(const glslang::TIntermTyped* node); spv::Id createShortCircuit(glslang::TOperator, glslang::TIntermTyped& left, glslang::TIntermTyped& right); +#ifdef AMD_EXTENSIONS spv::Id getExtBuiltins(const char* name); +#endif + void addPre13Extension(const char* ext) + { + if (builder.getSpvVersion() < glslang::EShTargetSpv_1_3) + builder.addExtension(ext); + } glslang::SpvOptions& options; spv::Function* shaderEntry; @@ -202,8 +235,10 @@ class TGlslangToSpvTraverser : public glslang::TIntermTraverser { std::unordered_set rValueParameters; // set of formal function parameters passed as rValues, rather than a pointer std::unordered_map functionMap; std::unordered_map structMap[glslang::ElpCount][glslang::ElmCount]; - std::unordered_map > memberRemapper; // for mapping glslang block indices to spv indices (e.g., due to hidden members) + // for mapping glslang block indices to spv indices (e.g., due to hidden members): + std::unordered_map > memberRemapper; std::stack breakForLoop; // false means break for switch + std::unordered_map counterOriginator; }; // @@ -411,6 +446,17 @@ spv::Decoration TranslateNoContractionDecoration(const glslang::TQualifier& qual return spv::DecorationMax; } +// If glslang type is nonUniform, return SPIR-V NonUniform decoration. +spv::Decoration TGlslangToSpvTraverser::TranslateNonUniformDecoration(const glslang::TQualifier& qualifier) +{ + if (qualifier.isNonUniform()) { + builder.addExtension("SPV_EXT_descriptor_indexing"); + builder.addCapability(spv::CapabilityShaderNonUniformEXT); + return spv::DecorationNonUniformEXT; + } else + return spv::DecorationMax; +} + // Translate a glslang built-in variable to a SPIR-V built in decoration. Also generate // associated capabilities when required. For some built-in variables, a capability // is generated only when using the variable in an executable instruction, but not when @@ -453,15 +499,13 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI return spv::BuiltInCullDistance; case glslang::EbvViewportIndex: - if (!memberDeclaration) { - builder.addCapability(spv::CapabilityMultiViewport); - if (glslangIntermediate->getStage() == EShLangVertex || - glslangIntermediate->getStage() == EShLangTessControl || - glslangIntermediate->getStage() == EShLangTessEvaluation) { + builder.addCapability(spv::CapabilityMultiViewport); + if (glslangIntermediate->getStage() == EShLangVertex || + glslangIntermediate->getStage() == EShLangTessControl || + glslangIntermediate->getStage() == EShLangTessEvaluation) { - builder.addExtension(spv::E_SPV_EXT_shader_viewport_index_layer); - builder.addCapability(spv::CapabilityShaderViewportIndexLayerEXT); - } + builder.addExtension(spv::E_SPV_EXT_shader_viewport_index_layer); + builder.addCapability(spv::CapabilityShaderViewportIndexLayerEXT); } return spv::BuiltInViewportIndex; @@ -474,21 +518,17 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI return spv::BuiltInSamplePosition; case glslang::EbvSampleMask: - builder.addCapability(spv::CapabilitySampleRateShading); return spv::BuiltInSampleMask; case glslang::EbvLayer: - if (!memberDeclaration) { - builder.addCapability(spv::CapabilityGeometry); - if (glslangIntermediate->getStage() == EShLangVertex || - glslangIntermediate->getStage() == EShLangTessControl || - glslangIntermediate->getStage() == EShLangTessEvaluation) { + builder.addCapability(spv::CapabilityGeometry); + if (glslangIntermediate->getStage() == EShLangVertex || + glslangIntermediate->getStage() == EShLangTessControl || + glslangIntermediate->getStage() == EShLangTessEvaluation) { - builder.addExtension(spv::E_SPV_EXT_shader_viewport_index_layer); - builder.addCapability(spv::CapabilityShaderViewportIndexLayerEXT); - } + builder.addExtension(spv::E_SPV_EXT_shader_viewport_index_layer); + builder.addCapability(spv::CapabilityShaderViewportIndexLayerEXT); } - return spv::BuiltInLayer; case glslang::EbvPosition: return spv::BuiltInPosition; @@ -498,17 +538,17 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI case glslang::EbvInstanceIndex: return spv::BuiltInInstanceIndex; case glslang::EbvBaseVertex: - builder.addExtension(spv::E_SPV_KHR_shader_draw_parameters); + addPre13Extension(spv::E_SPV_KHR_shader_draw_parameters); builder.addCapability(spv::CapabilityDrawParameters); return spv::BuiltInBaseVertex; case glslang::EbvBaseInstance: - builder.addExtension(spv::E_SPV_KHR_shader_draw_parameters); + addPre13Extension(spv::E_SPV_KHR_shader_draw_parameters); builder.addCapability(spv::CapabilityDrawParameters); return spv::BuiltInBaseInstance; case glslang::EbvDrawId: - builder.addExtension(spv::E_SPV_KHR_shader_draw_parameters); + addPre13Extension(spv::E_SPV_KHR_shader_draw_parameters); builder.addCapability(spv::CapabilityDrawParameters); return spv::BuiltInDrawIndex; @@ -574,6 +614,46 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI builder.addCapability(spv::CapabilitySubgroupBallotKHR); return spv::BuiltInSubgroupLtMaskKHR; + case glslang::EbvNumSubgroups: + builder.addCapability(spv::CapabilityGroupNonUniform); + return spv::BuiltInNumSubgroups; + + case glslang::EbvSubgroupID: + builder.addCapability(spv::CapabilityGroupNonUniform); + return spv::BuiltInSubgroupId; + + case glslang::EbvSubgroupSize2: + builder.addCapability(spv::CapabilityGroupNonUniform); + return spv::BuiltInSubgroupSize; + + case glslang::EbvSubgroupInvocation2: + builder.addCapability(spv::CapabilityGroupNonUniform); + return spv::BuiltInSubgroupLocalInvocationId; + + case glslang::EbvSubgroupEqMask2: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformBallot); + return spv::BuiltInSubgroupEqMask; + + case glslang::EbvSubgroupGeMask2: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformBallot); + return spv::BuiltInSubgroupGeMask; + + case glslang::EbvSubgroupGtMask2: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformBallot); + return spv::BuiltInSubgroupGtMask; + + case glslang::EbvSubgroupLeMask2: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformBallot); + return spv::BuiltInSubgroupLeMask; + + case glslang::EbvSubgroupLtMask2: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformBallot); + return spv::BuiltInSubgroupLtMask; #ifdef AMD_EXTENSIONS case glslang::EbvBaryCoordNoPersp: builder.addExtension(spv::E_SPV_AMD_shader_explicit_vertex_parameter); @@ -605,12 +685,12 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI #endif case glslang::EbvDeviceIndex: - builder.addExtension(spv::E_SPV_KHR_device_group); + addPre13Extension(spv::E_SPV_KHR_device_group); builder.addCapability(spv::CapabilityDeviceGroup); return spv::BuiltInDeviceIndex; case glslang::EbvViewIndex: - builder.addExtension(spv::E_SPV_KHR_multiview); + addPre13Extension(spv::E_SPV_KHR_multiview); builder.addCapability(spv::CapabilityMultiView); return spv::BuiltInViewIndex; @@ -645,6 +725,10 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI builder.addCapability(spv::CapabilityPerViewAttributesNV); } return spv::BuiltInViewportMaskPerViewNV; + case glslang::EbvFragFullyCoveredNV: + builder.addExtension(spv::E_SPV_EXT_fragment_fully_covered); + builder.addCapability(spv::CapabilityFragmentFullyCoveredEXT); + return spv::BuiltInFullyCoveredEXT; #endif default: return spv::BuiltInMax; @@ -739,26 +823,42 @@ spv::ImageFormat TGlslangToSpvTraverser::TranslateImageFormat(const glslang::TTy } } -spv::SelectionControlMask TGlslangToSpvTraverser::TranslateSelectionControl(glslang::TSelectionControl selectionControl) const +spv::SelectionControlMask TGlslangToSpvTraverser::TranslateSelectionControl(const glslang::TIntermSelection& selectionNode) const { - switch (selectionControl) { - case glslang::ESelectionControlNone: return spv::SelectionControlMaskNone; - case glslang::ESelectionControlFlatten: return spv::SelectionControlFlattenMask; - case glslang::ESelectionControlDontFlatten: return spv::SelectionControlDontFlattenMask; - default: return spv::SelectionControlMaskNone; - } + if (selectionNode.getFlatten()) + return spv::SelectionControlFlattenMask; + if (selectionNode.getDontFlatten()) + return spv::SelectionControlDontFlattenMask; + return spv::SelectionControlMaskNone; +} + +spv::SelectionControlMask TGlslangToSpvTraverser::TranslateSwitchControl(const glslang::TIntermSwitch& switchNode) const +{ + if (switchNode.getFlatten()) + return spv::SelectionControlFlattenMask; + if (switchNode.getDontFlatten()) + return spv::SelectionControlDontFlattenMask; + return spv::SelectionControlMaskNone; } -spv::LoopControlMask TGlslangToSpvTraverser::TranslateLoopControl(glslang::TLoopControl loopControl) const +// return a non-0 dependency if the dependency argument must be set +spv::LoopControlMask TGlslangToSpvTraverser::TranslateLoopControl(const glslang::TIntermLoop& loopNode, + unsigned int& dependencyLength) const { - switch (loopControl) { - case glslang::ELoopControlNone: return spv::LoopControlMaskNone; - case glslang::ELoopControlUnroll: return spv::LoopControlUnrollMask; - case glslang::ELoopControlDontUnroll: return spv::LoopControlDontUnrollMask; - // TODO: DependencyInfinite - // TODO: DependencyLength - default: return spv::LoopControlMaskNone; + spv::LoopControlMask control = spv::LoopControlMaskNone; + + if (loopNode.getDontUnroll()) + control = control | spv::LoopControlDontUnrollMask; + if (loopNode.getUnroll()) + control = control | spv::LoopControlUnrollMask; + if (unsigned(loopNode.getLoopDependency()) == glslang::TIntermLoop::dependencyInfinite) + control = control | spv::LoopControlDependencyInfiniteMask; + else if (loopNode.getLoopDependency() > 0) { + control = control | spv::LoopControlDependencyLengthMask; + dependencyLength = loopNode.getLoopDependency(); } + + return control; } // Translate glslang type to SPIR-V storage class. @@ -766,31 +866,75 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T { if (type.getQualifier().isPipeInput()) return spv::StorageClassInput; - else if (type.getQualifier().isPipeOutput()) + if (type.getQualifier().isPipeOutput()) return spv::StorageClassOutput; - else if (type.getBasicType() == glslang::EbtAtomicUint) - return spv::StorageClassAtomicCounter; - else if (type.containsOpaque()) - return spv::StorageClassUniformConstant; - else if (glslangIntermediate->usingStorageBuffer() && type.getQualifier().storage == glslang::EvqBuffer) { - builder.addExtension(spv::E_SPV_KHR_storage_buffer_storage_class); + + if (glslangIntermediate->getSource() != glslang::EShSourceHlsl || + type.getQualifier().storage == glslang::EvqUniform) { + if (type.getBasicType() == glslang::EbtAtomicUint) + return spv::StorageClassAtomicCounter; + if (type.containsOpaque()) + return spv::StorageClassUniformConstant; + } + + if (glslangIntermediate->usingStorageBuffer() && type.getQualifier().storage == glslang::EvqBuffer) { + addPre13Extension(spv::E_SPV_KHR_storage_buffer_storage_class); return spv::StorageClassStorageBuffer; - } else if (type.getQualifier().isUniformOrBuffer()) { + } + + if (type.getQualifier().isUniformOrBuffer()) { if (type.getQualifier().layoutPushConstant) return spv::StorageClassPushConstant; if (type.getBasicType() == glslang::EbtBlock) return spv::StorageClassUniform; - else - return spv::StorageClassUniformConstant; + return spv::StorageClassUniformConstant; + } + + switch (type.getQualifier().storage) { + case glslang::EvqShared: return spv::StorageClassWorkgroup; + case glslang::EvqGlobal: return spv::StorageClassPrivate; + case glslang::EvqConstReadOnly: return spv::StorageClassFunction; + case glslang::EvqTemporary: return spv::StorageClassFunction; + default: + assert(0); + break; + } + + return spv::StorageClassFunction; +} + +// Add capabilities pertaining to how an array is indexed. +void TGlslangToSpvTraverser::addIndirectionIndexCapabilities(const glslang::TType& baseType, + const glslang::TType& indexType) +{ + if (indexType.getQualifier().isNonUniform()) { + // deal with an asserted non-uniform index + if (baseType.getBasicType() == glslang::EbtSampler) { + if (baseType.getQualifier().hasAttachment()) + builder.addCapability(spv::CapabilityInputAttachmentArrayNonUniformIndexingEXT); + else if (baseType.isImage() && baseType.getSampler().dim == glslang::EsdBuffer) + builder.addCapability(spv::CapabilityStorageTexelBufferArrayNonUniformIndexingEXT); + else if (baseType.isTexture() && baseType.getSampler().dim == glslang::EsdBuffer) + builder.addCapability(spv::CapabilityUniformTexelBufferArrayNonUniformIndexingEXT); + else if (baseType.isImage()) + builder.addCapability(spv::CapabilityStorageImageArrayNonUniformIndexingEXT); + else if (baseType.isTexture()) + builder.addCapability(spv::CapabilitySampledImageArrayNonUniformIndexingEXT); + } else if (baseType.getBasicType() == glslang::EbtBlock) { + if (baseType.getQualifier().storage == glslang::EvqBuffer) + builder.addCapability(spv::CapabilityStorageBufferArrayNonUniformIndexingEXT); + else if (baseType.getQualifier().storage == glslang::EvqUniform) + builder.addCapability(spv::CapabilityUniformBufferArrayNonUniformIndexingEXT); + } } else { - switch (type.getQualifier().storage) { - case glslang::EvqShared: return spv::StorageClassWorkgroup; break; - case glslang::EvqGlobal: return spv::StorageClassPrivate; - case glslang::EvqConstReadOnly: return spv::StorageClassFunction; - case glslang::EvqTemporary: return spv::StorageClassFunction; - default: - assert(0); - return spv::StorageClassFunction; + // assume a dynamically uniform index + if (baseType.getBasicType() == glslang::EbtSampler) { + if (baseType.getQualifier().hasAttachment()) + builder.addCapability(spv::CapabilityInputAttachmentArrayDynamicIndexingEXT); + else if (baseType.isImage() && baseType.getSampler().dim == glslang::EsdBuffer) + builder.addCapability(spv::CapabilityStorageTexelBufferArrayDynamicIndexingEXT); + else if (baseType.isTexture() && baseType.getSampler().dim == glslang::EsdBuffer) + builder.addCapability(spv::CapabilityUniformTexelBufferArrayDynamicIndexingEXT); } } } @@ -864,13 +1008,13 @@ bool HasNonLayoutQualifiers(const glslang::TType& type, const glslang::TQualifie // Implement the TGlslangToSpvTraverser class. // -TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* glslangIntermediate, +TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const glslang::TIntermediate* glslangIntermediate, spv::SpvBuildLogger* buildLogger, glslang::SpvOptions& options) : TIntermTraverser(true, false, true), options(options), shaderEntry(nullptr), currentFunction(nullptr), sequenceDepth(0), logger(buildLogger), - builder((glslang::GetKhronosToolId() << 16) | GeneratorVersion, logger), + builder(spvVersion, (glslang::GetKhronosToolId() << 16) | glslang::GetSpirvGeneratorVersion(), logger), inEntryPoint(false), entryPointTerminated(false), linkageOnly(false), glslangIntermediate(glslangIntermediate) { @@ -1086,8 +1230,10 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol) // Include all "static use" and "linkage only" interface variables on the OpEntryPoint instruction if (builder.isPointer(id)) { spv::StorageClass sc = builder.getStorageClass(id); - if (sc == spv::StorageClassInput || sc == spv::StorageClassOutput) - iOSet.insert(id); + if (sc == spv::StorageClassInput || sc == spv::StorageClassOutput) { + if (!symbol->getType().isStruct() || symbol->getType().getStruct()->size() > 0) + iOSet.insert(id); + } } // Only process non-linkage-only nodes for generating actual static uses @@ -1111,6 +1257,38 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol) else builder.setAccessChainLValue(id); } + + // Process linkage-only nodes for any special additional interface work. + if (linkageOnly) { + if (glslangIntermediate->getHlslFunctionality1()) { + // Map implicit counter buffers to their originating buffers, which should have been + // seen by now, given earlier pruning of unused counters, and preservation of order + // of declaration. + if (symbol->getType().getQualifier().isUniformOrBuffer()) { + if (!glslangIntermediate->hasCounterBufferName(symbol->getName())) { + // Save possible originating buffers for counter buffers, keyed by + // making the potential counter-buffer name. + std::string keyName = symbol->getName().c_str(); + keyName = glslangIntermediate->addCounterBufferName(keyName); + counterOriginator[keyName] = symbol; + } else { + // Handle a counter buffer, by finding the saved originating buffer. + std::string keyName = symbol->getName().c_str(); + auto it = counterOriginator.find(keyName); + if (it != counterOriginator.end()) { + id = getSymbolId(it->second); + if (id != spv::NoResult) { + spv::Id counterId = getSymbolId(symbol); + if (counterId != spv::NoResult) { + builder.addExtension("SPV_GOOGLE_hlsl_functionality1"); + builder.addDecorationId(id, spv::DecorationHlslCounterBufferGOOGLE, counterId); + } + } + } + } + } + } + } } bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::TIntermBinary* node) @@ -1159,8 +1337,10 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T spv::Id leftRValue = accessChainLoad(node->getLeft()->getType()); // do the operation - rValue = createBinaryOperation(node->getOp(), TranslatePrecisionDecoration(node->getOperationPrecision()), - TranslateNoContractionDecoration(node->getType().getQualifier()), + OpDecorations decorations = { TranslatePrecisionDecoration(node->getOperationPrecision()), + TranslateNoContractionDecoration(node->getType().getQualifier()), + TranslateNonUniformDecoration(node->getType().getQualifier()) }; + rValue = createBinaryOperation(node->getOp(), decorations, convertGlslangToSpvType(node->getType()), leftRValue, rValue, node->getType().getBasicType()); @@ -1235,6 +1415,8 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T node->getRight()->traverse(this); spv::Id index = accessChainLoad(node->getRight()->getType()); + addIndirectionIndexCapabilities(node->getLeft()->getType(), node->getRight()->getType()); + // restore the saved access chain builder.setAccessChain(partial); @@ -1287,8 +1469,10 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T spv::Id right = accessChainLoad(node->getRight()->getType()); // get result - spv::Id result = createBinaryOperation(node->getOp(), TranslatePrecisionDecoration(node->getOperationPrecision()), - TranslateNoContractionDecoration(node->getType().getQualifier()), + OpDecorations decorations = { TranslatePrecisionDecoration(node->getOperationPrecision()), + TranslateNoContractionDecoration(node->getType().getQualifier()), + TranslateNonUniformDecoration(node->getType().getQualifier()) }; + spv::Id result = createBinaryOperation(node->getOp(), decorations, convertGlslangToSpvType(node->getType()), left, right, node->getLeft()->getType().getBasicType()); @@ -1326,10 +1510,15 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI if (node->getOp() == glslang::EOpArrayLength) { // Quite special; won't want to evaluate the operand. + // Currently, the front-end does not allow .length() on an array until it is sized, + // except for the last block membeor of an SSBO. + // TODO: If this changes, link-time sized arrays might show up here, and need their + // size extracted. + // Normal .length() would have been constant folded by the front-end. // So, this has to be block.lastMember.length(). // SPV wants "block" and member number as the operands, go get them. - assert(node->getOperand()->getType().isRuntimeSizedArray()); + glslang::TIntermTyped* block = node->getOperand()->getAsBinaryNode()->getLeft(); block->traverse(this); unsigned int member = node->getOperand()->getAsBinaryNode()->getRight()->getAsConstantUnion()->getConstArray()[0].getUConst(); @@ -1366,20 +1555,23 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI else operand = accessChainLoad(node->getOperand()->getType()); - spv::Decoration precision = TranslatePrecisionDecoration(node->getOperationPrecision()); - spv::Decoration noContraction = TranslateNoContractionDecoration(node->getType().getQualifier()); + OpDecorations decorations = { TranslatePrecisionDecoration(node->getOperationPrecision()), + TranslateNoContractionDecoration(node->getType().getQualifier()), + TranslateNonUniformDecoration(node->getType().getQualifier()) }; // it could be a conversion if (! result) - result = createConversion(node->getOp(), precision, noContraction, resultType(), operand, node->getOperand()->getBasicType()); + result = createConversion(node->getOp(), decorations, resultType(), operand, node->getOperand()->getBasicType()); // if not, then possibly an operation if (! result) - result = createUnaryOperation(node->getOp(), precision, noContraction, resultType(), operand, node->getOperand()->getBasicType()); + result = createUnaryOperation(node->getOp(), decorations, resultType(), operand, node->getOperand()->getBasicType()); if (result) { - if (invertedType) - result = createInvertedSwizzle(precision, *node->getOperand(), result); + if (invertedType) { + result = createInvertedSwizzle(decorations.precision, *node->getOperand(), result); + builder.addDecoration(result, decorations.nonUniform); + } builder.clearAccessChain(); builder.setAccessChainRValue(result); @@ -1400,16 +1592,14 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI one = builder.makeFloatConstant(1.0F); else if (node->getBasicType() == glslang::EbtDouble) one = builder.makeDoubleConstant(1.0); -#ifdef AMD_EXTENSIONS else if (node->getBasicType() == glslang::EbtFloat16) one = builder.makeFloat16Constant(1.0F); -#endif - else if (node->getBasicType() == glslang::EbtInt64 || node->getBasicType() == glslang::EbtUint64) - one = builder.makeInt64Constant(1); -#ifdef AMD_EXTENSIONS + else if (node->getBasicType() == glslang::EbtInt8 || node->getBasicType() == glslang::EbtUint8) + one = builder.makeInt8Constant(1); else if (node->getBasicType() == glslang::EbtInt16 || node->getBasicType() == glslang::EbtUint16) one = builder.makeInt16Constant(1); -#endif + else if (node->getBasicType() == glslang::EbtInt64 || node->getBasicType() == glslang::EbtUint64) + one = builder.makeInt64Constant(1); else one = builder.makeIntConstant(1); glslang::TOperator op; @@ -1419,8 +1609,7 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI else op = glslang::EOpSub; - spv::Id result = createBinaryOperation(op, precision, - TranslateNoContractionDecoration(node->getType().getQualifier()), + spv::Id result = createBinaryOperation(op, decorations, convertGlslangToSpvType(node->getType()), operand, one, node->getType().getBasicType()); assert(result != spv::NoResult); @@ -1614,7 +1803,6 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpConstructBMat4x2: case glslang::EOpConstructBMat4x3: case glslang::EOpConstructBMat4x4: -#ifdef AMD_EXTENSIONS case glslang::EOpConstructF16Mat2x2: case glslang::EOpConstructF16Mat2x3: case glslang::EOpConstructF16Mat2x4: @@ -1624,7 +1812,6 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpConstructF16Mat4x2: case glslang::EOpConstructF16Mat4x3: case glslang::EOpConstructF16Mat4x4: -#endif isMatrix = true; // fall through case glslang::EOpConstructFloat: @@ -1635,16 +1822,30 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpConstructDVec2: case glslang::EOpConstructDVec3: case glslang::EOpConstructDVec4: -#ifdef AMD_EXTENSIONS case glslang::EOpConstructFloat16: case glslang::EOpConstructF16Vec2: case glslang::EOpConstructF16Vec3: case glslang::EOpConstructF16Vec4: -#endif case glslang::EOpConstructBool: case glslang::EOpConstructBVec2: case glslang::EOpConstructBVec3: case glslang::EOpConstructBVec4: + case glslang::EOpConstructInt8: + case glslang::EOpConstructI8Vec2: + case glslang::EOpConstructI8Vec3: + case glslang::EOpConstructI8Vec4: + case glslang::EOpConstructUint8: + case glslang::EOpConstructU8Vec2: + case glslang::EOpConstructU8Vec3: + case glslang::EOpConstructU8Vec4: + case glslang::EOpConstructInt16: + case glslang::EOpConstructI16Vec2: + case glslang::EOpConstructI16Vec3: + case glslang::EOpConstructI16Vec4: + case glslang::EOpConstructUint16: + case glslang::EOpConstructU16Vec2: + case glslang::EOpConstructU16Vec3: + case glslang::EOpConstructU16Vec4: case glslang::EOpConstructInt: case glslang::EOpConstructIVec2: case glslang::EOpConstructIVec3: @@ -1661,16 +1862,6 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpConstructU64Vec2: case glslang::EOpConstructU64Vec3: case glslang::EOpConstructU64Vec4: -#ifdef AMD_EXTENSIONS - case glslang::EOpConstructInt16: - case glslang::EOpConstructI16Vec2: - case glslang::EOpConstructI16Vec3: - case glslang::EOpConstructI16Vec4: - case glslang::EOpConstructUint16: - case glslang::EOpConstructU16Vec2: - case glslang::EOpConstructU16Vec3: - case glslang::EOpConstructU16Vec4: -#endif case glslang::EOpConstructStruct: case glslang::EOpConstructTextureSampler: { @@ -1746,10 +1937,16 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpMemoryBarrierImage: case glslang::EOpMemoryBarrierShared: case glslang::EOpGroupMemoryBarrier: + case glslang::EOpDeviceMemoryBarrier: case glslang::EOpAllMemoryBarrierWithGroupSync: - case glslang::EOpGroupMemoryBarrierWithGroupSync: + case glslang::EOpDeviceMemoryBarrierWithGroupSync: case glslang::EOpWorkgroupMemoryBarrier: case glslang::EOpWorkgroupMemoryBarrierWithGroupSync: + case glslang::EOpSubgroupBarrier: + case glslang::EOpSubgroupMemoryBarrier: + case glslang::EOpSubgroupMemoryBarrierBuffer: + case glslang::EOpSubgroupMemoryBarrierImage: + case glslang::EOpSubgroupMemoryBarrierShared: noReturnValue = true; // These all have 0 operands and will naturally finish up in the code below for 0 operands break; @@ -1800,7 +1997,10 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt spv::Id rightId = accessChainLoad(right->getType()); builder.setLine(node->getLoc().line); - result = createBinaryOperation(binOp, precision, TranslateNoContractionDecoration(node->getType().getQualifier()), + OpDecorations decorations = { precision, + TranslateNoContractionDecoration(node->getType().getQualifier()), + TranslateNonUniformDecoration(node->getType().getQualifier()) }; + result = createBinaryOperation(binOp, decorations, resultType(), leftId, rightId, left->getType().getBasicType(), reduceComparison); @@ -1898,11 +2098,15 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt result = createNoArgOperation(node->getOp(), precision, resultType()); break; case 1: - result = createUnaryOperation( - node->getOp(), precision, - TranslateNoContractionDecoration(node->getType().getQualifier()), - resultType(), operands.front(), - glslangOperands[0]->getAsTyped()->getBasicType()); + { + OpDecorations decorations = { precision, + TranslateNoContractionDecoration(node->getType().getQualifier()), + TranslateNonUniformDecoration(node->getType().getQualifier()) }; + result = createUnaryOperation( + node->getOp(), decorations, + resultType(), operands.front(), + glslangOperands[0]->getAsTyped()->getBasicType()); + } break; default: result = createMiscOperation(node->getOp(), precision, resultType(), operands, node->getBasicType()); @@ -1936,18 +2140,29 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt // next layer copies r-values into memory to use the access-chain mechanism bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang::TIntermSelection* node) { - // See if it simple and safe to generate OpSelect instead of using control flow. - // Crucially, side effects must be avoided, and there are performance trade-offs. - // Return true if good idea (and safe) for OpSelect, false otherwise. - const auto selectPolicy = [&]() -> bool { - if ((!node->getType().isScalar() && !node->getType().isVector()) || - node->getBasicType() == glslang::EbtVoid) - return false; - + // See if it simple and safe, or required, to execute both sides. + // Crucially, side effects must be either semantically required or avoided, + // and there are performance trade-offs. + // Return true if required or a good idea (and safe) to execute both sides, + // false otherwise. + const auto bothSidesPolicy = [&]() -> bool { + // do we have both sides? if (node->getTrueBlock() == nullptr || node->getFalseBlock() == nullptr) return false; + // required? (unless we write additional code to look for side effects + // and make performance trade-offs if none are present) + if (!node->getShortCircuit()) + return true; + + // if not required to execute both, decide based on performance/practicality... + + // see if OpSelect can handle it + if ((!node->getType().isScalar() && !node->getType().isVector()) || + node->getBasicType() == glslang::EbtVoid) + return false; + assert(node->getType() == node->getTrueBlock() ->getAsTyped()->getType() && node->getType() == node->getFalseBlock()->getAsTyped()->getType()); @@ -1960,10 +2175,14 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang operandOkay(node->getFalseBlock()->getAsTyped()); }; - // Emit OpSelect for this selection. - const auto handleAsOpSelect = [&]() { - node->getCondition()->traverse(this); - spv::Id condition = accessChainLoad(node->getCondition()->getType()); + spv::Id result = spv::NoResult; // upcoming result selecting between trueValue and falseValue + // emit the condition before doing anything with selection + node->getCondition()->traverse(this); + spv::Id condition = accessChainLoad(node->getCondition()->getType()); + + // Find a way of executing both sides and selecting the right result. + const auto executeBothSides = [&]() -> void { + // execute both sides node->getTrueBlock()->traverse(this); spv::Id trueValue = accessChainLoad(node->getTrueBlock()->getAsTyped()->getType()); node->getFalseBlock()->traverse(this); @@ -1971,72 +2190,98 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang builder.setLine(node->getLoc().line); - // smear condition to vector, if necessary (AST is always scalar) - if (builder.isVector(trueValue)) - condition = builder.smearScalar(spv::NoPrecision, condition, - builder.makeVectorType(builder.makeBoolType(), - builder.getNumComponents(trueValue))); + // done if void + if (node->getBasicType() == glslang::EbtVoid) + return; - spv::Id select = builder.createTriOp(spv::OpSelect, - convertGlslangToSpvType(node->getType()), condition, - trueValue, falseValue); - builder.clearAccessChain(); - builder.setAccessChainRValue(select); - }; + // emit code to select between trueValue and falseValue - // Try for OpSelect + // see if OpSelect can handle it + if (node->getType().isScalar() || node->getType().isVector()) { + // Emit OpSelect for this selection. - if (selectPolicy()) { - SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); - if (node->getType().getQualifier().isSpecConstant()) - spec_constant_op_mode_setter.turnOnSpecConstantOpMode(); + // smear condition to vector, if necessary (AST is always scalar) + if (builder.isVector(trueValue)) + condition = builder.smearScalar(spv::NoPrecision, condition, + builder.makeVectorType(builder.makeBoolType(), + builder.getNumComponents(trueValue))); - handleAsOpSelect(); - return false; - } + // OpSelect + result = builder.createTriOp(spv::OpSelect, + convertGlslangToSpvType(node->getType()), condition, + trueValue, falseValue); - // Instead, emit control flow... - // Don't handle results as temporaries, because there will be two names - // and better to leave SSA to later passes. - spv::Id result = (node->getBasicType() == glslang::EbtVoid) - ? spv::NoResult - : builder.createVariable(spv::StorageClassFunction, convertGlslangToSpvType(node->getType())); + builder.clearAccessChain(); + builder.setAccessChainRValue(result); + } else { + // We need control flow to select the result. + // TODO: Once SPIR-V OpSelect allows arbitrary types, eliminate this path. + result = builder.createVariable(spv::StorageClassFunction, convertGlslangToSpvType(node->getType())); - // emit the condition before doing anything with selection - node->getCondition()->traverse(this); + // Selection control: + const spv::SelectionControlMask control = TranslateSelectionControl(*node); - // Selection control: - const spv::SelectionControlMask control = TranslateSelectionControl(node->getSelectionControl()); + // make an "if" based on the value created by the condition + spv::Builder::If ifBuilder(condition, control, builder); - // make an "if" based on the value created by the condition - spv::Builder::If ifBuilder(accessChainLoad(node->getCondition()->getType()), control, builder); + // emit the "then" statement + builder.createStore(trueValue, result); + ifBuilder.makeBeginElse(); + // emit the "else" statement + builder.createStore(falseValue, result); - // emit the "then" statement - if (node->getTrueBlock() != nullptr) { - node->getTrueBlock()->traverse(this); - if (result != spv::NoResult) - builder.createStore(accessChainLoad(node->getTrueBlock()->getAsTyped()->getType()), result); - } + // finish off the control flow + ifBuilder.makeEndIf(); - if (node->getFalseBlock() != nullptr) { - ifBuilder.makeBeginElse(); - // emit the "else" statement - node->getFalseBlock()->traverse(this); - if (result != spv::NoResult) - builder.createStore(accessChainLoad(node->getFalseBlock()->getAsTyped()->getType()), result); - } + builder.clearAccessChain(); + builder.setAccessChainLValue(result); + } + }; - // finish off the control flow - ifBuilder.makeEndIf(); + // Execute the one side needed, as per the condition + const auto executeOneSide = [&]() { + // Always emit control flow. + if (node->getBasicType() != glslang::EbtVoid) + result = builder.createVariable(spv::StorageClassFunction, convertGlslangToSpvType(node->getType())); - if (result != spv::NoResult) { - // GLSL only has r-values as the result of a :?, but - // if we have an l-value, that can be more efficient if it will - // become the base of a complex r-value expression, because the - // next layer copies r-values into memory to use the access-chain mechanism - builder.clearAccessChain(); - builder.setAccessChainLValue(result); - } + // Selection control: + const spv::SelectionControlMask control = TranslateSelectionControl(*node); + + // make an "if" based on the value created by the condition + spv::Builder::If ifBuilder(condition, control, builder); + + // emit the "then" statement + if (node->getTrueBlock() != nullptr) { + node->getTrueBlock()->traverse(this); + if (result != spv::NoResult) + builder.createStore(accessChainLoad(node->getTrueBlock()->getAsTyped()->getType()), result); + } + + if (node->getFalseBlock() != nullptr) { + ifBuilder.makeBeginElse(); + // emit the "else" statement + node->getFalseBlock()->traverse(this); + if (result != spv::NoResult) + builder.createStore(accessChainLoad(node->getFalseBlock()->getAsTyped()->getType()), result); + } + + // finish off the control flow + ifBuilder.makeEndIf(); + + if (result != spv::NoResult) { + builder.clearAccessChain(); + builder.setAccessChainLValue(result); + } + }; + + // Try for OpSelect (or a requirement to execute both sides) + if (bothSidesPolicy()) { + SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); + if (node->getType().getQualifier().isSpecConstant()) + spec_constant_op_mode_setter.turnOnSpecConstantOpMode(); + executeBothSides(); + } else + executeOneSide(); return false; } @@ -2048,7 +2293,7 @@ bool TGlslangToSpvTraverser::visitSwitch(glslang::TVisit /* visit */, glslang::T spv::Id selector = accessChainLoad(node->getCondition()->getAsTyped()->getType()); // Selection control: - const spv::SelectionControlMask control = TranslateSelectionControl(node->getSelectionControl()); + const spv::SelectionControlMask control = TranslateSwitchControl(*node); // browse the children to sort out code segments int defaultSegment = -1; @@ -2108,9 +2353,8 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn builder.createBranch(&blocks.head); // Loop control: - const spv::LoopControlMask control = TranslateLoopControl(node->getLoopControl()); - - // TODO: dependency length + unsigned int dependencyLength = glslang::TIntermLoop::dependencyInfinite; + const spv::LoopControlMask control = TranslateLoopControl(*node, dependencyLength); // Spec requires back edges to target header blocks, and every header block // must dominate its merge block. Make a header block first to ensure these @@ -2120,7 +2364,7 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn // including merges of its own. builder.setLine(node->getLoc().line); builder.setBuildPoint(&blocks.head); - builder.createLoopMerge(&blocks.merge, &blocks.continue_target, control); + builder.createLoopMerge(&blocks.merge, &blocks.continue_target, control, dependencyLength); if (node->testFirst() && node->getTest()) { spv::Block& test = builder.makeNewBlock(); builder.createBranch(&test); @@ -2231,25 +2475,23 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol* spv::StorageClass storageClass = TranslateStorageClass(node->getType()); spv::Id spvType = convertGlslangToSpvType(node->getType()); -#ifdef AMD_EXTENSIONS const bool contains16BitType = node->getType().containsBasicType(glslang::EbtFloat16) || node->getType().containsBasicType(glslang::EbtInt16) || node->getType().containsBasicType(glslang::EbtUint16); if (contains16BitType) { if (storageClass == spv::StorageClassInput || storageClass == spv::StorageClassOutput) { - builder.addExtension(spv::E_SPV_KHR_16bit_storage); + addPre13Extension(spv::E_SPV_KHR_16bit_storage); builder.addCapability(spv::CapabilityStorageInputOutput16); } else if (storageClass == spv::StorageClassPushConstant) { - builder.addExtension(spv::E_SPV_KHR_16bit_storage); + addPre13Extension(spv::E_SPV_KHR_16bit_storage); builder.addCapability(spv::CapabilityStoragePushConstant16); } else if (storageClass == spv::StorageClassUniform) { - builder.addExtension(spv::E_SPV_KHR_16bit_storage); + addPre13Extension(spv::E_SPV_KHR_16bit_storage); builder.addCapability(spv::CapabilityStorageUniform16); if (node->getType().getQualifier().storage == glslang::EvqBuffer) builder.addCapability(spv::CapabilityStorageUniformBufferBlock16); } } -#endif const char* name = node->getName().c_str(); if (glslang::IsAnonymous(name)) @@ -2263,6 +2505,12 @@ spv::Id TGlslangToSpvTraverser::getSampledType(const glslang::TSampler& sampler) { switch (sampler.type) { case glslang::EbtFloat: return builder.makeFloatType(32); +#ifdef AMD_EXTENSIONS + case glslang::EbtFloat16: + builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float_fetch); + builder.addCapability(spv::CapabilityFloat16ImageAMD); + return builder.makeFloatType(16); +#endif case glslang::EbtInt: return builder.makeIntType(32); case glslang::EbtUint: return builder.makeUintType(32); default: @@ -2305,13 +2553,14 @@ void TGlslangToSpvTraverser::convertSwizzle(const glslang::TIntermAggregate& nod // layout state rooted from the top-level type. spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& type) { - return convertGlslangToSpvType(type, getExplicitLayout(type), type.getQualifier()); + return convertGlslangToSpvType(type, getExplicitLayout(type), type.getQualifier(), false); } // Do full recursive conversion of an arbitrary glslang type to a SPIR-V Id. // explicitLayout can be kept the same throughout the hierarchical recursive walk. // Mutually recursive with convertGlslangStructToSpvType(). -spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& type, glslang::TLayoutPacking explicitLayout, const glslang::TQualifier& qualifier) +spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& type, + glslang::TLayoutPacking explicitLayout, const glslang::TQualifier& qualifier, bool lastBufferBlockMember) { spv::Id spvType = spv::NoResult; @@ -2326,12 +2575,14 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty case glslang::EbtDouble: spvType = builder.makeFloatType(64); break; -#ifdef AMD_EXTENSIONS case glslang::EbtFloat16: - builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float); + builder.addCapability(spv::CapabilityFloat16); +#if AMD_EXTENSIONS + if (builder.getSpvVersion() < glslang::EShTargetSpv_1_3) + builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float); +#endif spvType = builder.makeFloatType(16); break; -#endif case glslang::EbtBool: // "transparent" bool doesn't exist in SPIR-V. The GLSL convention is // a 32-bit int where non-0 means true. @@ -2340,6 +2591,30 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty else spvType = builder.makeBoolType(); break; + case glslang::EbtInt8: + builder.addCapability(spv::CapabilityInt8); + spvType = builder.makeIntType(8); + break; + case glslang::EbtUint8: + builder.addCapability(spv::CapabilityInt8); + spvType = builder.makeUintType(8); + break; + case glslang::EbtInt16: + builder.addCapability(spv::CapabilityInt16); +#ifdef AMD_EXTENSIONS + if (builder.getSpvVersion() < glslang::EShTargetSpv_1_3) + builder.addExtension(spv::E_SPV_AMD_gpu_shader_int16); +#endif + spvType = builder.makeIntType(16); + break; + case glslang::EbtUint16: + builder.addCapability(spv::CapabilityInt16); +#ifdef AMD_EXTENSIONS + if (builder.getSpvVersion() < glslang::EShTargetSpv_1_3) + builder.addExtension(spv::E_SPV_AMD_gpu_shader_int16); +#endif + spvType = builder.makeUintType(16); + break; case glslang::EbtInt: spvType = builder.makeIntType(32); break; @@ -2352,16 +2627,6 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty case glslang::EbtUint64: spvType = builder.makeUintType(64); break; -#ifdef AMD_EXTENSIONS - case glslang::EbtInt16: - builder.addExtension(spv::E_SPV_AMD_gpu_shader_int16); - spvType = builder.makeIntType(16); - break; - case glslang::EbtUint16: - builder.addExtension(spv::E_SPV_AMD_gpu_shader_int16); - spvType = builder.makeUintType(16); - break; -#endif case glslang::EbtAtomicUint: builder.addCapability(spv::CapabilityAtomicStorage); spvType = builder.makeUintType(32); @@ -2425,8 +2690,8 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty // Use a dummy glslang type for querying internal strides of // arrays of arrays, but using just a one-dimensional array. glslang::TType simpleArrayType(type, 0); // deference type of the array - while (simpleArrayType.getArraySizes().getNumDims() > 1) - simpleArrayType.getArraySizes().dereference(); + while (simpleArrayType.getArraySizes()->getNumDims() > 1) + simpleArrayType.getArraySizes()->dereference(); // Will compute the higher-order strides here, rather than making a whole // pile of types and doing repetitive recursion on their contents. @@ -2448,12 +2713,16 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty stride = getArrayStride(type, explicitLayout, qualifier.layoutMatrix); } - // Do the outer dimension, which might not be known for a runtime-sized array - if (type.isRuntimeSizedArray()) { - spvType = builder.makeRuntimeArray(spvType); - } else { - assert(type.getOuterArraySize() > 0); + // Do the outer dimension, which might not be known for a runtime-sized array. + // (Unsized arrays that survive through linking will be runtime-sized arrays) + if (type.isSizedArray()) spvType = builder.makeArrayType(spvType, makeArraySizeId(*type.getArraySizes(), 0), stride); + else { + if (!lastBufferBlockMember) { + builder.addExtension("SPV_EXT_descriptor_indexing"); + builder.addCapability(spv::CapabilityRuntimeDescriptorArrayEXT); + } + spvType = builder.makeRuntimeArray(spvType); } if (stride > 0) builder.addDecoration(spvType, spv::DecorationArrayStride, stride); @@ -2485,10 +2754,6 @@ bool TGlslangToSpvTraverser::filterMember(const glslang::TType& member) if (member.getFieldName() == "gl_ViewportMaskPerViewNV" && extensions.find("GL_NVX_multiview_per_view_attributes") == extensions.end()) return true; - if ((member.getFieldName() == "gl_ViewportIndex" || member.getFieldName() == "gl_Layer") && - extensions.find(glslang::E_GL_ARB_shader_viewport_layer_array) == extensions.end() && - extensions.find("GL_NV_viewport_array2") == extensions.end()) - return true; return false; }; @@ -2525,7 +2790,10 @@ spv::Id TGlslangToSpvTraverser::convertGlslangStructToSpvType(const glslang::TTy memberQualifier.layoutLocation = qualifier.layoutLocation; // recurse - spvMembers.push_back(convertGlslangToSpvType(glslangMember, explicitLayout, memberQualifier)); + bool lastBufferBlockMember = qualifier.storage == glslang::EvqBuffer && + i == (int)glslangMembers->size() - 1; + spvMembers.push_back( + convertGlslangToSpvType(glslangMember, explicitLayout, memberQualifier, lastBufferBlockMember)); } } @@ -2563,99 +2831,110 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type, InheritQualifiers(memberQualifier, qualifier); // using -1 above to indicate a hidden member - if (member >= 0) { - builder.addMemberName(spvType, member, glslangMember.getFieldName().c_str()); - addMemberDecoration(spvType, member, TranslateLayoutDecoration(glslangMember, memberQualifier.layoutMatrix)); - addMemberDecoration(spvType, member, TranslatePrecisionDecoration(glslangMember)); - // Add interpolation and auxiliary storage decorations only to top-level members of Input and Output storage classes - if (type.getQualifier().storage == glslang::EvqVaryingIn || - type.getQualifier().storage == glslang::EvqVaryingOut) { - if (type.getBasicType() == glslang::EbtBlock || - glslangIntermediate->getSource() == glslang::EShSourceHlsl) { - addMemberDecoration(spvType, member, TranslateInterpolationDecoration(memberQualifier)); - addMemberDecoration(spvType, member, TranslateAuxiliaryStorageDecoration(memberQualifier)); - } - } - addMemberDecoration(spvType, member, TranslateInvariantDecoration(memberQualifier)); - - if (type.getBasicType() == glslang::EbtBlock && - qualifier.storage == glslang::EvqBuffer) { - // Add memory decorations only to top-level members of shader storage block - std::vector memory; - TranslateMemoryDecoration(memberQualifier, memory); - for (unsigned int i = 0; i < memory.size(); ++i) - addMemberDecoration(spvType, member, memory[i]); - } + if (member < 0) + continue; - // Location assignment was already completed correctly by the front end, - // just track whether a member needs to be decorated. - // Ignore member locations if the container is an array, as that's - // ill-specified and decisions have been made to not allow this. - if (! type.isArray() && memberQualifier.hasLocation()) - builder.addMemberDecoration(spvType, member, spv::DecorationLocation, memberQualifier.layoutLocation); - - if (qualifier.hasLocation()) // track for upcoming inheritance - locationOffset += glslangIntermediate->computeTypeLocationSize(glslangMember); - - // component, XFB, others - if (glslangMember.getQualifier().hasComponent()) - builder.addMemberDecoration(spvType, member, spv::DecorationComponent, glslangMember.getQualifier().layoutComponent); - if (glslangMember.getQualifier().hasXfbOffset()) - builder.addMemberDecoration(spvType, member, spv::DecorationOffset, glslangMember.getQualifier().layoutXfbOffset); - else if (explicitLayout != glslang::ElpNone) { - // figure out what to do with offset, which is accumulating - int nextOffset; - updateMemberOffset(type, glslangMember, offset, nextOffset, explicitLayout, memberQualifier.layoutMatrix); - if (offset >= 0) - builder.addMemberDecoration(spvType, member, spv::DecorationOffset, offset); - offset = nextOffset; + builder.addMemberName(spvType, member, glslangMember.getFieldName().c_str()); + builder.addMemberDecoration(spvType, member, + TranslateLayoutDecoration(glslangMember, memberQualifier.layoutMatrix)); + builder.addMemberDecoration(spvType, member, TranslatePrecisionDecoration(glslangMember)); + // Add interpolation and auxiliary storage decorations only to + // top-level members of Input and Output storage classes + if (type.getQualifier().storage == glslang::EvqVaryingIn || + type.getQualifier().storage == glslang::EvqVaryingOut) { + if (type.getBasicType() == glslang::EbtBlock || + glslangIntermediate->getSource() == glslang::EShSourceHlsl) { + builder.addMemberDecoration(spvType, member, TranslateInterpolationDecoration(memberQualifier)); + builder.addMemberDecoration(spvType, member, TranslateAuxiliaryStorageDecoration(memberQualifier)); } + } + builder.addMemberDecoration(spvType, member, TranslateInvariantDecoration(memberQualifier)); + + if (type.getBasicType() == glslang::EbtBlock && + qualifier.storage == glslang::EvqBuffer) { + // Add memory decorations only to top-level members of shader storage block + std::vector memory; + TranslateMemoryDecoration(memberQualifier, memory); + for (unsigned int i = 0; i < memory.size(); ++i) + builder.addMemberDecoration(spvType, member, memory[i]); + } + + // Location assignment was already completed correctly by the front end, + // just track whether a member needs to be decorated. + // Ignore member locations if the container is an array, as that's + // ill-specified and decisions have been made to not allow this. + if (! type.isArray() && memberQualifier.hasLocation()) + builder.addMemberDecoration(spvType, member, spv::DecorationLocation, memberQualifier.layoutLocation); + + if (qualifier.hasLocation()) // track for upcoming inheritance + locationOffset += glslangIntermediate->computeTypeLocationSize( + glslangMember, glslangIntermediate->getStage()); + + // component, XFB, others + if (glslangMember.getQualifier().hasComponent()) + builder.addMemberDecoration(spvType, member, spv::DecorationComponent, + glslangMember.getQualifier().layoutComponent); + if (glslangMember.getQualifier().hasXfbOffset()) + builder.addMemberDecoration(spvType, member, spv::DecorationOffset, + glslangMember.getQualifier().layoutXfbOffset); + else if (explicitLayout != glslang::ElpNone) { + // figure out what to do with offset, which is accumulating + int nextOffset; + updateMemberOffset(type, glslangMember, offset, nextOffset, explicitLayout, memberQualifier.layoutMatrix); + if (offset >= 0) + builder.addMemberDecoration(spvType, member, spv::DecorationOffset, offset); + offset = nextOffset; + } + + if (glslangMember.isMatrix() && explicitLayout != glslang::ElpNone) + builder.addMemberDecoration(spvType, member, spv::DecorationMatrixStride, + getMatrixStride(glslangMember, explicitLayout, memberQualifier.layoutMatrix)); - if (glslangMember.isMatrix() && explicitLayout != glslang::ElpNone) - builder.addMemberDecoration(spvType, member, spv::DecorationMatrixStride, getMatrixStride(glslangMember, explicitLayout, memberQualifier.layoutMatrix)); + // built-in variable decorations + spv::BuiltIn builtIn = TranslateBuiltInDecoration(glslangMember.getQualifier().builtIn, true); + if (builtIn != spv::BuiltInMax) + builder.addMemberDecoration(spvType, member, spv::DecorationBuiltIn, (int)builtIn); - // built-in variable decorations - spv::BuiltIn builtIn = TranslateBuiltInDecoration(glslangMember.getQualifier().builtIn, true); - if (builtIn != spv::BuiltInMax) - addMemberDecoration(spvType, member, spv::DecorationBuiltIn, (int)builtIn); + // nonuniform + builder.addMemberDecoration(spvType, member, TranslateNonUniformDecoration(glslangMember.getQualifier())); + + if (glslangIntermediate->getHlslFunctionality1() && memberQualifier.semanticName != nullptr) { + builder.addExtension("SPV_GOOGLE_hlsl_functionality1"); + builder.addMemberDecoration(spvType, member, (spv::Decoration)spv::DecorationHlslSemanticGOOGLE, + memberQualifier.semanticName); + } #ifdef NV_EXTENSIONS - if (builtIn == spv::BuiltInLayer) { - // SPV_NV_viewport_array2 extension - if (glslangMember.getQualifier().layoutViewportRelative){ - addMemberDecoration(spvType, member, (spv::Decoration)spv::DecorationViewportRelativeNV); - builder.addCapability(spv::CapabilityShaderViewportMaskNV); - builder.addExtension(spv::E_SPV_NV_viewport_array2); - } - if (glslangMember.getQualifier().layoutSecondaryViewportRelativeOffset != -2048){ - addMemberDecoration(spvType, member, (spv::Decoration)spv::DecorationSecondaryViewportRelativeNV, glslangMember.getQualifier().layoutSecondaryViewportRelativeOffset); - builder.addCapability(spv::CapabilityShaderStereoViewNV); - builder.addExtension(spv::E_SPV_NV_stereo_view_rendering); - } + if (builtIn == spv::BuiltInLayer) { + // SPV_NV_viewport_array2 extension + if (glslangMember.getQualifier().layoutViewportRelative){ + builder.addMemberDecoration(spvType, member, (spv::Decoration)spv::DecorationViewportRelativeNV); + builder.addCapability(spv::CapabilityShaderViewportMaskNV); + builder.addExtension(spv::E_SPV_NV_viewport_array2); } - if (glslangMember.getQualifier().layoutPassthrough) { - addMemberDecoration(spvType, member, (spv::Decoration)spv::DecorationPassthroughNV); - builder.addCapability(spv::CapabilityGeometryShaderPassthroughNV); - builder.addExtension(spv::E_SPV_NV_geometry_shader_passthrough); + if (glslangMember.getQualifier().layoutSecondaryViewportRelativeOffset != -2048){ + builder.addMemberDecoration(spvType, member, + (spv::Decoration)spv::DecorationSecondaryViewportRelativeNV, + glslangMember.getQualifier().layoutSecondaryViewportRelativeOffset); + builder.addCapability(spv::CapabilityShaderStereoViewNV); + builder.addExtension(spv::E_SPV_NV_stereo_view_rendering); } -#endif } + if (glslangMember.getQualifier().layoutPassthrough) { + builder.addMemberDecoration(spvType, member, (spv::Decoration)spv::DecorationPassthroughNV); + builder.addCapability(spv::CapabilityGeometryShaderPassthroughNV); + builder.addExtension(spv::E_SPV_NV_geometry_shader_passthrough); + } +#endif } // Decorate the structure - addDecoration(spvType, TranslateLayoutDecoration(type, qualifier.layoutMatrix)); - addDecoration(spvType, TranslateBlockDecoration(type, glslangIntermediate->usingStorageBuffer())); + builder.addDecoration(spvType, TranslateLayoutDecoration(type, qualifier.layoutMatrix)); + builder.addDecoration(spvType, TranslateBlockDecoration(type, glslangIntermediate->usingStorageBuffer())); if (type.getQualifier().hasStream() && glslangIntermediate->isMultiStream()) { builder.addCapability(spv::CapabilityGeometryStreams); builder.addDecoration(spvType, spv::DecorationStream, type.getQualifier().layoutStream); } - if (glslangIntermediate->getXfbMode()) { - builder.addCapability(spv::CapabilityTransformFeedback); - if (type.getQualifier().hasXfbStride()) - builder.addDecoration(spvType, spv::DecorationXfbStride, type.getQualifier().layoutXfbStride); - if (type.getQualifier().hasXfbBuffer()) - builder.addDecoration(spvType, spv::DecorationXfbBuffer, type.getQualifier().layoutXfbBuffer); - } } // Turn the expression forming the array size into an id. @@ -2686,7 +2965,8 @@ spv::Id TGlslangToSpvTraverser::makeArraySizeId(const glslang::TArraySizes& arra spv::Id TGlslangToSpvTraverser::accessChainLoad(const glslang::TType& type) { spv::Id nominalTypeId = builder.accessChainGetInferredType(); - spv::Id loadedId = builder.accessChainLoad(TranslatePrecisionDecoration(type), nominalTypeId); + spv::Id loadedId = builder.accessChainLoad(TranslatePrecisionDecoration(type), + TranslateNonUniformDecoration(type.getQualifier()), nominalTypeId); // Need to convert to abstract types when necessary if (type.getBasicType() == glslang::EbtBool) { @@ -2936,8 +3216,6 @@ void TGlslangToSpvTraverser::declareUseOfStructMember(const glslang::TTypeList& case glslang::EbvCullDistance: case glslang::EbvPointSize: #ifdef NV_EXTENSIONS - case glslang::EbvLayer: - case glslang::EbvViewportIndex: case glslang::EbvViewportMaskNV: case glslang::EbvSecondaryPositionNV: case glslang::EbvSecondaryViewportMaskNV: @@ -2960,6 +3238,30 @@ bool TGlslangToSpvTraverser::isShaderEntryPoint(const glslang::TIntermAggregate* return node->getName().compare(glslangIntermediate->getEntryPointMangledName().c_str()) == 0; } +// Does parameter need a place to keep writes, separate from the original? +// Assumes called after originalParam(), which filters out block/buffer/opaque-based +// qualifiers such that we should have only in/out/inout/constreadonly here. +bool TGlslangToSpvTraverser::writableParam(glslang::TStorageQualifier qualifier) +{ + assert(qualifier == glslang::EvqIn || + qualifier == glslang::EvqOut || + qualifier == glslang::EvqInOut || + qualifier == glslang::EvqConstReadOnly); + return qualifier != glslang::EvqConstReadOnly; +} + +// Is parameter pass-by-original? +bool TGlslangToSpvTraverser::originalParam(glslang::TStorageQualifier qualifier, const glslang::TType& paramType, + bool implicitThisParam) +{ + if (implicitThisParam) // implicit this + return true; + if (glslangIntermediate->getSource() == glslang::EShSourceHlsl) + return paramType.getBasicType() == glslang::EbtBlock; + return paramType.containsOpaque() || // sampler, etc. + (paramType.getBasicType() == glslang::EbtBlock && qualifier == glslang::EvqBuffer); // SSBO +} + // Make all the functions, skeletally, without actually visiting their bodies. void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslFunctions) { @@ -3000,13 +3302,9 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF for (int p = 0; p < (int)parameters.size(); ++p) { const glslang::TType& paramType = parameters[p]->getAsTyped()->getType(); spv::Id typeId = convertGlslangToSpvType(paramType); - // can we pass by reference? - if (paramType.containsOpaque() || // sampler, etc. - (paramType.getBasicType() == glslang::EbtBlock && - paramType.getQualifier().storage == glslang::EvqBuffer) || // SSBO - (p == 0 && implicitThis)) // implicit 'this' + if (originalParam(paramType.getQualifier().storage, paramType, implicitThis && p == 0)) typeId = builder.makePointer(TranslateStorageClass(paramType), typeId); - else if (paramType.getQualifier().storage != glslang::EvqConstReadOnly) + else if (writableParam(paramType.getQualifier().storage)) typeId = builder.makePointer(spv::StorageClassFunction, typeId); else rValueParameters.insert(parameters[p]->getAsSymbolNode()->getId()); @@ -3074,9 +3372,15 @@ void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& glslang::TSampler sampler = {}; bool cubeCompare = false; +#ifdef AMD_EXTENSIONS + bool f16ShadowCompare = false; +#endif if (node.isTexture() || node.isImage()) { sampler = glslangArguments[0]->getAsTyped()->getType().getSampler(); cubeCompare = sampler.dim == glslang::EsdCube && sampler.arrayed && sampler.shadow; +#ifdef AMD_EXTENSIONS + f16ShadowCompare = sampler.shadow && glslangArguments[1]->getAsTyped()->getType().getBasicType() == glslang::EbtFloat16; +#endif } for (int i = 0; i < (int)glslangArguments.size(); ++i) { @@ -3101,6 +3405,21 @@ void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& if ((sampler.ms && i == 3) || (! sampler.ms && i == 2)) lvalue = true; break; +#ifdef AMD_EXTENSIONS + case glslang::EOpSparseTexture: + if (((cubeCompare || f16ShadowCompare) && i == 3) || (! (cubeCompare || f16ShadowCompare) && i == 2)) + lvalue = true; + break; + case glslang::EOpSparseTextureClamp: + if (((cubeCompare || f16ShadowCompare) && i == 4) || (! (cubeCompare || f16ShadowCompare) && i == 3)) + lvalue = true; + break; + case glslang::EOpSparseTextureLod: + case glslang::EOpSparseTextureOffset: + if ((f16ShadowCompare && i == 4) || (! f16ShadowCompare && i == 3)) + lvalue = true; + break; +#else case glslang::EOpSparseTexture: if ((cubeCompare && i == 3) || (! cubeCompare && i == 2)) lvalue = true; @@ -3114,6 +3433,7 @@ void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& if (i == 3) lvalue = true; break; +#endif case glslang::EOpSparseTextureFetch: if ((sampler.dim != glslang::EsdRect && i == 3) || (sampler.dim == glslang::EsdRect && i == 2)) lvalue = true; @@ -3122,6 +3442,23 @@ void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& if ((sampler.dim != glslang::EsdRect && i == 4) || (sampler.dim == glslang::EsdRect && i == 3)) lvalue = true; break; +#ifdef AMD_EXTENSIONS + case glslang::EOpSparseTextureLodOffset: + case glslang::EOpSparseTextureGrad: + case glslang::EOpSparseTextureOffsetClamp: + if ((f16ShadowCompare && i == 5) || (! f16ShadowCompare && i == 4)) + lvalue = true; + break; + case glslang::EOpSparseTextureGradOffset: + case glslang::EOpSparseTextureGradClamp: + if ((f16ShadowCompare && i == 6) || (! f16ShadowCompare && i == 5)) + lvalue = true; + break; + case glslang::EOpSparseTextureGradOffsetClamp: + if ((f16ShadowCompare && i == 7) || (! f16ShadowCompare && i == 6)) + lvalue = true; + break; +#else case glslang::EOpSparseTextureLodOffset: case glslang::EOpSparseTextureGrad: case glslang::EOpSparseTextureOffsetClamp: @@ -3137,6 +3474,7 @@ void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& if (i == 6) lvalue = true; break; +#endif case glslang::EOpSparseTextureGather: if ((sampler.shadow && i == 3) || (! sampler.shadow && i == 2)) lvalue = true; @@ -3186,11 +3524,15 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO builder.setLine(node->getLoc().line); - auto resultType = [&node,this]{ return convertGlslangToSpvType(node->getType()); }; - // Process a GLSL texturing op (will be SPV image) const glslang::TSampler sampler = node->getAsAggregate() ? node->getAsAggregate()->getSequence()[0]->getAsTyped()->getType().getSampler() : node->getAsUnaryNode()->getOperand()->getAsTyped()->getType().getSampler(); +#ifdef AMD_EXTENSIONS + bool f16ShadowCompare = (sampler.shadow && node->getAsAggregate()) + ? node->getAsAggregate()->getSequence()[1]->getAsTyped()->getType().getBasicType() == glslang::EbtFloat16 + : false; +#endif + std::vector arguments; if (node->getAsAggregate()) translateArguments(*node->getAsAggregate(), arguments); @@ -3204,9 +3546,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO glslang::TCrackedTextureOp cracked; node->crackTexture(sampler, cracked); - const bool isUnsignedResult = - node->getType().getBasicType() == glslang::EbtUint64 || - node->getType().getBasicType() == glslang::EbtUint; + const bool isUnsignedResult = node->getType().getBasicType() == glslang::EbtUint; // Check for queries if (cracked.query) { @@ -3238,6 +3578,20 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO } } + int components = node->getType().getVectorSize(); + + if (node->getOp() == glslang::EOpTextureFetch) { + // These must produce 4 components, per SPIR-V spec. We'll add a conversion constructor if needed. + // This will only happen through the HLSL path for operator[], so we do not have to handle e.g. + // the EOpTexture/Proj/Lod/etc family. It would be harmless to do so, but would need more logic + // here around e.g. which ones return scalars or other types. + components = 4; + } + + glslang::TType returnType(node->getType().getBasicType(), glslang::EvqTemporary, components); + + auto resultType = [&returnType,this]{ return convertGlslangToSpvType(returnType); }; + // Check for image functions other than queries if (node->isImage()) { std::vector operands; @@ -3258,7 +3612,9 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO operands.push_back(spv::ImageOperandsSampleMask); operands.push_back(*(opIt++)); } - return builder.createOp(spv::OpImageRead, resultType(), operands); + spv::Id result = builder.createOp(spv::OpImageRead, resultType(), operands); + builder.setPrecision(result, precision); + return result; } operands.push_back(*(opIt++)); @@ -3281,7 +3637,15 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO } if (builder.getImageTypeFormat(builder.getImageType(operands.front())) == spv::ImageFormatUnknown) builder.addCapability(spv::CapabilityStorageImageReadWithoutFormat); - return builder.createOp(spv::OpImageRead, resultType(), operands); + + std::vector result( 1, builder.createOp(spv::OpImageRead, resultType(), operands) ); + builder.setPrecision(result[0], precision); + + // If needed, add a conversion constructor to the proper size. + if (components != node->getType().getVectorSize()) + result[0] = builder.createConstructor(precision, result, convertGlslangToSpvType(node->getType())); + + return result[0]; #ifdef AMD_EXTENSIONS } else if (node->getOp() == glslang::EOpImageStore || node->getOp() == glslang::EOpImageStoreLod) { #else @@ -3358,6 +3722,45 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO } } +#ifdef AMD_EXTENSIONS + // Check for fragment mask functions other than queries + if (cracked.fragMask) { + assert(sampler.ms); + + auto opIt = arguments.begin(); + std::vector operands; + + // Extract the image if necessary + if (builder.isSampledImage(params.sampler)) + params.sampler = builder.createUnaryOp(spv::OpImage, builder.getImageType(params.sampler), params.sampler); + + operands.push_back(params.sampler); + ++opIt; + + if (sampler.isSubpass()) { + // add on the (0,0) coordinate + spv::Id zero = builder.makeIntConstant(0); + std::vector comps; + comps.push_back(zero); + comps.push_back(zero); + operands.push_back(builder.makeCompositeConstant(builder.makeVectorType(builder.makeIntType(32), 2), comps)); + } + + for (; opIt != arguments.end(); ++opIt) + operands.push_back(*opIt); + + spv::Op fragMaskOp = spv::OpNop; + if (node->getOp() == glslang::EOpFragmentMaskFetch) + fragMaskOp = spv::OpFragmentMaskFetchAMD; + else if (node->getOp() == glslang::EOpFragmentFetch) + fragMaskOp = spv::OpFragmentFetchAMD; + + builder.addExtension(spv::E_SPV_AMD_shader_fragment_mask); + builder.addCapability(spv::CapabilityFragmentMaskAMD); + return builder.createOp(fragMaskOp, resultType(), operands); + } +#endif + // Check for texture functions other than queries bool sparse = node->isSparseTexture(); bool cubeCompare = sampler.dim == glslang::EsdCube && sampler.arrayed && sampler.shadow; @@ -3373,6 +3776,9 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO #ifdef AMD_EXTENSIONS if (cracked.gather) ++nonBiasArgCount; // comp argument should be present when bias argument is present + + if (f16ShadowCompare) + ++nonBiasArgCount; #endif if (cracked.offset) ++nonBiasArgCount; @@ -3416,7 +3822,11 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO bool noImplicitLod = false; // sort out where Dref is coming from +#ifdef AMD_EXTENSIONS + if (cubeCompare || f16ShadowCompare) { +#else if (cubeCompare) { +#endif params.Dref = arguments[2]; ++extraArgs; } else if (sampler.shadow && cracked.gather) { @@ -3516,7 +3926,14 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO } } - return builder.createTextureCall(precision, resultType(), sparse, cracked.fetch, cracked.proj, cracked.gather, noImplicitLod, params); + std::vector result( 1, + builder.createTextureCall(precision, resultType(), sparse, cracked.fetch, cracked.proj, cracked.gather, noImplicitLod, params) + ); + + if (components != node->getType().getVectorSize()) + result[0] = builder.createConstructor(precision, result, convertGlslangToSpvType(node->getType())); + + return result[0]; } spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAggregate* node) @@ -3547,8 +3964,9 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg builder.clearAccessChain(); glslangArgs[a]->traverse(this); argTypes.push_back(¶mType); - // keep outputs and opaque objects as l-values, evaluate input-only as r-values - if (qualifiers[a] != glslang::EvqConstReadOnly || paramType.containsOpaque()) { + // keep outputs and pass-by-originals as l-values, evaluate others as r-values + if (originalParam(qualifiers[a], paramType, function->hasImplicitThis() && a == 0) || + writableParam(qualifiers[a])) { // save l-value lValues.push_back(builder.getAccessChain()); } else { @@ -3567,13 +3985,11 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg for (int a = 0; a < (int)glslangArgs.size(); ++a) { const glslang::TType& paramType = glslangArgs[a]->getAsTyped()->getType(); spv::Id arg; - if (paramType.containsOpaque() || - (paramType.getBasicType() == glslang::EbtBlock && qualifiers[a] == glslang::EvqBuffer) || - (a == 0 && function->hasImplicitThis())) { + if (originalParam(qualifiers[a], paramType, function->hasImplicitThis() && a == 0)) { builder.setAccessChain(lValues[lValueCount]); arg = builder.accessChainGetLValue(); ++lValueCount; - } else if (qualifiers[a] != glslang::EvqConstReadOnly) { + } else if (writableParam(qualifiers[a])) { // need space to hold the copy arg = builder.createVariable(spv::StorageClassFunction, convertGlslangToSpvType(paramType), "param"); if (qualifiers[a] == glslang::EvqIn || qualifiers[a] == glslang::EvqInOut) { @@ -3600,7 +4016,9 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg lValueCount = 0; for (int a = 0; a < (int)glslangArgs.size(); ++a) { const glslang::TType& paramType = glslangArgs[a]->getAsTyped()->getType(); - if (qualifiers[a] != glslang::EvqConstReadOnly) { + if (originalParam(qualifiers[a], paramType, function->hasImplicitThis() && a == 0)) + ++lValueCount; + else if (writableParam(qualifiers[a])) { if (qualifiers[a] == glslang::EvqOut || qualifiers[a] == glslang::EvqInOut) { spv::Id copy = builder.createLoad(spvArgs[a]); builder.setAccessChain(lValues[lValueCount]); @@ -3614,18 +4032,12 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg } // Translate AST operation to SPV operation, already having SPV-based operands/types. -spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv::Decoration precision, - spv::Decoration noContraction, +spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, OpDecorations& decorations, spv::Id typeId, spv::Id left, spv::Id right, glslang::TBasicType typeProxy, bool reduceComparison) { -#ifdef AMD_EXTENSIONS - bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64 || typeProxy == glslang::EbtUint16; - bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble || typeProxy == glslang::EbtFloat16; -#else - bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64; - bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble; -#endif + bool isUnsigned = isTypeUnsignedInt(typeProxy); + bool isFloat = isTypeFloat(typeProxy); bool isBool = typeProxy == glslang::EbtBool; spv::Op binOp = spv::OpNop; @@ -3757,15 +4169,16 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv if (binOp != spv::OpNop) { assert(comparison == false); if (builder.isMatrix(left) || builder.isMatrix(right)) - return createBinaryMatrixOperation(binOp, precision, noContraction, typeId, left, right); + return createBinaryMatrixOperation(binOp, decorations, typeId, left, right); // No matrix involved; make both operands be the same number of components, if needed if (needMatchingVectors) - builder.promoteScalar(precision, left, right); + builder.promoteScalar(decorations.precision, left, right); spv::Id result = builder.createBinOp(binOp, typeId, left, right); - addDecoration(result, noContraction); - return builder.setPrecision(result, precision); + builder.addDecoration(result, decorations.noContraction); + builder.addDecoration(result, decorations.nonUniform); + return builder.setPrecision(result, decorations.precision); } if (! comparison) @@ -3774,8 +4187,11 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv // Handle comparison instructions if (reduceComparison && (op == glslang::EOpEqual || op == glslang::EOpNotEqual) - && (builder.isVector(left) || builder.isMatrix(left) || builder.isAggregate(left))) - return builder.createCompositeCompare(precision, left, right, op == glslang::EOpEqual); + && (builder.isVector(left) || builder.isMatrix(left) || builder.isAggregate(left))) { + spv::Id result = builder.createCompositeCompare(decorations.precision, left, right, op == glslang::EOpEqual); + builder.addDecoration(result, decorations.nonUniform); + return result; + } switch (op) { case glslang::EOpLessThan: @@ -3834,8 +4250,9 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv if (binOp != spv::OpNop) { spv::Id result = builder.createBinOp(binOp, typeId, left, right); - addDecoration(result, noContraction); - return builder.setPrecision(result, precision); + builder.addDecoration(result, decorations.noContraction); + builder.addDecoration(result, decorations.nonUniform); + return builder.setPrecision(result, decorations.precision); } return 0; @@ -3855,7 +4272,8 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv // matrix op scalar op in {+, -, /} // scalar op matrix op in {+, -, /} // -spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id left, spv::Id right) +spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, OpDecorations& decorations, spv::Id typeId, + spv::Id left, spv::Id right) { bool firstClass = true; @@ -3864,7 +4282,8 @@ spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, spv::Dec case spv::OpFDiv: if (builder.isMatrix(left) && builder.isScalar(right)) { // turn matrix / scalar into a multiply... - right = builder.createBinOp(spv::OpFDiv, builder.getTypeId(right), builder.makeFloatConstant(1.0F), right); + spv::Id resultType = builder.getTypeId(right); + right = builder.createBinOp(spv::OpFDiv, resultType, builder.makeFpConstant(resultType, 1.0), right); op = spv::OpMatrixTimesScalar; } else firstClass = false; @@ -3893,8 +4312,9 @@ spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, spv::Dec if (firstClass) { spv::Id result = builder.createBinOp(op, typeId, left, right); - addDecoration(result, noContraction); - return builder.setPrecision(result, precision); + builder.addDecoration(result, decorations.noContraction); + builder.addDecoration(result, decorations.nonUniform); + return builder.setPrecision(result, decorations.precision); } // Handle component-wise +, -, *, %, and / for all combinations of type. @@ -3921,9 +4341,9 @@ spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, spv::Dec std::vector results; spv::Id smearVec = spv::NoResult; if (builder.isScalar(left)) - smearVec = builder.smearScalar(precision, left, vecType); + smearVec = builder.smearScalar(decorations.precision, left, vecType); else if (builder.isScalar(right)) - smearVec = builder.smearScalar(precision, right, vecType); + smearVec = builder.smearScalar(decorations.precision, right, vecType); // do each vector op for (unsigned int c = 0; c < numCols; ++c) { @@ -3932,12 +4352,15 @@ spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, spv::Dec spv::Id leftVec = leftMat ? builder.createCompositeExtract( left, vecType, indexes) : smearVec; spv::Id rightVec = rightMat ? builder.createCompositeExtract(right, vecType, indexes) : smearVec; spv::Id result = builder.createBinOp(op, vecType, leftVec, rightVec); - addDecoration(result, noContraction); - results.push_back(builder.setPrecision(result, precision)); + builder.addDecoration(result, decorations.noContraction); + builder.addDecoration(result, decorations.nonUniform); + results.push_back(builder.setPrecision(result, decorations.precision)); } // put the pieces together - return builder.setPrecision(builder.createCompositeConstruct(typeId, results), precision); + spv::Id result = builder.setPrecision(builder.createCompositeConstruct(typeId, results), decorations.precision); + builder.addDecoration(result, decorations.nonUniform); + return result; } default: assert(0); @@ -3945,25 +4368,21 @@ spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, spv::Dec } } -spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id operand, glslang::TBasicType typeProxy) +spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDecorations& decorations, spv::Id typeId, + spv::Id operand, glslang::TBasicType typeProxy) { spv::Op unaryOp = spv::OpNop; int extBuiltins = -1; int libCall = -1; -#ifdef AMD_EXTENSIONS - bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64 || typeProxy == glslang::EbtUint16; - bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble || typeProxy == glslang::EbtFloat16; -#else - bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64; - bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble; -#endif + bool isUnsigned = isTypeUnsignedInt(typeProxy); + bool isFloat = isTypeFloat(typeProxy); switch (op) { case glslang::EOpNegative: if (isFloat) { unaryOp = spv::OpFNegate; if (builder.isMatrixType(typeId)) - return createUnaryMatrixOperation(unaryOp, precision, noContraction, typeId, operand, typeProxy); + return createUnaryMatrixOperation(unaryOp, decorations, typeId, operand, typeProxy); } else unaryOp = spv::OpSNegate; break; @@ -4093,12 +4512,10 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv: case glslang::EOpDoubleBitsToUint64: case glslang::EOpInt64BitsToDouble: case glslang::EOpUint64BitsToDouble: -#ifdef AMD_EXTENSIONS case glslang::EOpFloat16BitsToInt16: case glslang::EOpFloat16BitsToUint16: case glslang::EOpInt16BitsToFloat16: case glslang::EOpUint16BitsToFloat16: -#endif unaryOp = spv::OpBitcast; break; @@ -4143,10 +4560,12 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv: case glslang::EOpUnpackInt2x32: case glslang::EOpPackUint2x32: case glslang::EOpUnpackUint2x32: - unaryOp = spv::OpBitcast; - break; - -#ifdef AMD_EXTENSIONS + case glslang::EOpPack16: + case glslang::EOpPack32: + case glslang::EOpPack64: + case glslang::EOpUnpack32: + case glslang::EOpUnpack16: + case glslang::EOpUnpack8: case glslang::EOpPackInt2x16: case glslang::EOpUnpackInt2x16: case glslang::EOpPackUint2x16: @@ -4159,7 +4578,6 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv: case glslang::EOpUnpackFloat2x16: unaryOp = spv::OpBitcast; break; -#endif case glslang::EOpDPdx: unaryOp = spv::OpDPdx; @@ -4225,7 +4643,7 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv: // Handle all of the atomics in one place, in createAtomicOperation() std::vector operands; operands.push_back(operand); - return createAtomicOperation(op, precision, typeId, operands, typeProxy); + return createAtomicOperation(op, decorations.precision, typeId, operands, typeProxy); } case glslang::EOpBitFieldReverse: @@ -4274,7 +4692,45 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv: operands.push_back(operand); return createInvocationsOperation(op, typeId, operands, typeProxy); } - + case glslang::EOpSubgroupAll: + case glslang::EOpSubgroupAny: + case glslang::EOpSubgroupAllEqual: + case glslang::EOpSubgroupBroadcastFirst: + case glslang::EOpSubgroupBallot: + case glslang::EOpSubgroupInverseBallot: + case glslang::EOpSubgroupBallotBitCount: + case glslang::EOpSubgroupBallotInclusiveBitCount: + case glslang::EOpSubgroupBallotExclusiveBitCount: + case glslang::EOpSubgroupBallotFindLSB: + case glslang::EOpSubgroupBallotFindMSB: + case glslang::EOpSubgroupAdd: + case glslang::EOpSubgroupMul: + case glslang::EOpSubgroupMin: + case glslang::EOpSubgroupMax: + case glslang::EOpSubgroupAnd: + case glslang::EOpSubgroupOr: + case glslang::EOpSubgroupXor: + case glslang::EOpSubgroupInclusiveAdd: + case glslang::EOpSubgroupInclusiveMul: + case glslang::EOpSubgroupInclusiveMin: + case glslang::EOpSubgroupInclusiveMax: + case glslang::EOpSubgroupInclusiveAnd: + case glslang::EOpSubgroupInclusiveOr: + case glslang::EOpSubgroupInclusiveXor: + case glslang::EOpSubgroupExclusiveAdd: + case glslang::EOpSubgroupExclusiveMul: + case glslang::EOpSubgroupExclusiveMin: + case glslang::EOpSubgroupExclusiveMax: + case glslang::EOpSubgroupExclusiveAnd: + case glslang::EOpSubgroupExclusiveOr: + case glslang::EOpSubgroupExclusiveXor: + case glslang::EOpSubgroupQuadSwapHorizontal: + case glslang::EOpSubgroupQuadSwapVertical: + case glslang::EOpSubgroupQuadSwapDiagonal: { + std::vector operands; + operands.push_back(operand); + return createSubgroupOperation(op, typeId, operands, typeProxy); + } #ifdef AMD_EXTENSIONS case glslang::EOpMbcnt: extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_ballot); @@ -4291,7 +4747,13 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv: libCall = spv::CubeFaceCoordAMD; break; #endif - +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartition: + builder.addExtension(spv::E_SPV_NV_shader_subgroup_partitioned); + builder.addCapability(spv::CapabilityGroupNonUniformPartitionedNV); + unaryOp = spv::OpGroupNonUniformPartitionNV; + break; +#endif default: return 0; } @@ -4305,12 +4767,14 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv: id = builder.createUnaryOp(unaryOp, typeId, operand); } - addDecoration(id, noContraction); - return builder.setPrecision(id, precision); + builder.addDecoration(id, decorations.noContraction); + builder.addDecoration(id, decorations.nonUniform); + return builder.setPrecision(id, decorations.precision); } // Create a unary operation on a matrix -spv::Id TGlslangToSpvTraverser::createUnaryMatrixOperation(spv::Op op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id operand, glslang::TBasicType /* typeProxy */) +spv::Id TGlslangToSpvTraverser::createUnaryMatrixOperation(spv::Op op, OpDecorations& decorations, spv::Id typeId, + spv::Id operand, glslang::TBasicType /* typeProxy */) { // Handle unary operations vector by vector. // The result type is the same type as the original type. @@ -4332,40 +4796,162 @@ spv::Id TGlslangToSpvTraverser::createUnaryMatrixOperation(spv::Op op, spv::Deco indexes.push_back(c); spv::Id srcVec = builder.createCompositeExtract(operand, srcVecType, indexes); spv::Id destVec = builder.createUnaryOp(op, destVecType, srcVec); - addDecoration(destVec, noContraction); - results.push_back(builder.setPrecision(destVec, precision)); + builder.addDecoration(destVec, decorations.noContraction); + builder.addDecoration(destVec, decorations.nonUniform); + results.push_back(builder.setPrecision(destVec, decorations.precision)); } // put the pieces together - return builder.setPrecision(builder.createCompositeConstruct(typeId, results), precision); + spv::Id result = builder.setPrecision(builder.createCompositeConstruct(typeId, results), decorations.precision); + builder.addDecoration(result, decorations.nonUniform); + return result; } -spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id destType, spv::Id operand, glslang::TBasicType typeProxy) +spv::Id TGlslangToSpvTraverser::createConversionOperation(glslang::TOperator op, spv::Id operand, int vectorSize) +{ + spv::Op convOp = spv::OpNop; + spv::Id type = 0; + + spv::Id result = 0; + + switch(op) { + case glslang::EOpConvInt8ToUint16: + convOp = spv::OpSConvert; + type = builder.makeIntType(16); + break; + case glslang::EOpConvInt8ToUint: + convOp = spv::OpSConvert; + type = builder.makeIntType(32); + break; + case glslang::EOpConvInt8ToUint64: + convOp = spv::OpSConvert; + type = builder.makeIntType(64); + break; + case glslang::EOpConvInt16ToUint8: + convOp = spv::OpSConvert; + type = builder.makeIntType(8); + break; + case glslang::EOpConvInt16ToUint: + convOp = spv::OpSConvert; + type = builder.makeIntType(32); + break; + case glslang::EOpConvInt16ToUint64: + convOp = spv::OpSConvert; + type = builder.makeIntType(64); + break; + case glslang::EOpConvIntToUint8: + convOp = spv::OpSConvert; + type = builder.makeIntType(8); + break; + case glslang::EOpConvIntToUint16: + convOp = spv::OpSConvert; + type = builder.makeIntType(16); + break; + case glslang::EOpConvIntToUint64: + convOp = spv::OpSConvert; + type = builder.makeIntType(64); + break; + case glslang::EOpConvInt64ToUint8: + convOp = spv::OpSConvert; + type = builder.makeIntType(8); + break; + case glslang::EOpConvInt64ToUint16: + convOp = spv::OpSConvert; + type = builder.makeIntType(16); + break; + case glslang::EOpConvInt64ToUint: + convOp = spv::OpSConvert; + type = builder.makeIntType(32); + break; + case glslang::EOpConvUint8ToInt16: + convOp = spv::OpUConvert; + type = builder.makeIntType(16); + break; + case glslang::EOpConvUint8ToInt: + convOp = spv::OpUConvert; + type = builder.makeIntType(32); + break; + case glslang::EOpConvUint8ToInt64: + convOp = spv::OpUConvert; + type = builder.makeIntType(64); + break; + case glslang::EOpConvUint16ToInt8: + convOp = spv::OpUConvert; + type = builder.makeIntType(8); + break; + case glslang::EOpConvUint16ToInt: + convOp = spv::OpUConvert; + type = builder.makeIntType(32); + break; + case glslang::EOpConvUint16ToInt64: + convOp = spv::OpUConvert; + type = builder.makeIntType(64); + break; + case glslang::EOpConvUintToInt8: + convOp = spv::OpUConvert; + type = builder.makeIntType(8); + break; + case glslang::EOpConvUintToInt16: + convOp = spv::OpUConvert; + type = builder.makeIntType(16); + break; + case glslang::EOpConvUintToInt64: + convOp = spv::OpUConvert; + type = builder.makeIntType(64); + break; + case glslang::EOpConvUint64ToInt8: + convOp = spv::OpUConvert; + type = builder.makeIntType(8); + break; + case glslang::EOpConvUint64ToInt16: + convOp = spv::OpUConvert; + type = builder.makeIntType(16); + break; + case glslang::EOpConvUint64ToInt: + convOp = spv::OpUConvert; + type = builder.makeIntType(32); + break; + + default: + assert(false && "Default missing"); + break; + } + + if (vectorSize > 0) + type = builder.makeVectorType(type, vectorSize); + + result = builder.createUnaryOp(convOp, type, operand); + return result; +} + +spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, OpDecorations& decorations, spv::Id destType, + spv::Id operand, glslang::TBasicType typeProxy) { spv::Op convOp = spv::OpNop; spv::Id zero = 0; spv::Id one = 0; - spv::Id type = 0; int vectorSize = builder.isVectorType(destType) ? builder.getNumTypeComponents(destType) : 0; switch (op) { + case glslang::EOpConvInt8ToBool: + case glslang::EOpConvUint8ToBool: + zero = builder.makeUint8Constant(0); + zero = makeSmearedConstant(zero, vectorSize); + return builder.createBinOp(spv::OpINotEqual, destType, operand, zero); + case glslang::EOpConvInt16ToBool: + case glslang::EOpConvUint16ToBool: + zero = builder.makeUint16Constant(0); + zero = makeSmearedConstant(zero, vectorSize); + return builder.createBinOp(spv::OpINotEqual, destType, operand, zero); case glslang::EOpConvIntToBool: case glslang::EOpConvUintToBool: + zero = builder.makeUintConstant(0); + zero = makeSmearedConstant(zero, vectorSize); + return builder.createBinOp(spv::OpINotEqual, destType, operand, zero); case glslang::EOpConvInt64ToBool: case glslang::EOpConvUint64ToBool: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvInt16ToBool: - case glslang::EOpConvUint16ToBool: -#endif - if (op == glslang::EOpConvInt64ToBool || op == glslang::EOpConvUint64ToBool) - zero = builder.makeUint64Constant(0); -#ifdef AMD_EXTENSIONS - else if (op == glslang::EOpConvInt16ToBool || op == glslang::EOpConvUint16ToBool) - zero = builder.makeUint16Constant(0); -#endif - else - zero = builder.makeUintConstant(0); + zero = builder.makeUint64Constant(0); zero = makeSmearedConstant(zero, vectorSize); return builder.createBinOp(spv::OpINotEqual, destType, operand, zero); @@ -4379,12 +4965,10 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec zero = makeSmearedConstant(zero, vectorSize); return builder.createBinOp(spv::OpFOrdNotEqual, destType, operand, zero); -#ifdef AMD_EXTENSIONS case glslang::EOpConvFloat16ToBool: zero = builder.makeFloat16Constant(0.0F); zero = makeSmearedConstant(zero, vectorSize); return builder.createBinOp(spv::OpFOrdNotEqual, destType, operand, zero); -#endif case glslang::EOpConvBoolToFloat: convOp = spv::OpSelect; @@ -4398,34 +4982,45 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec one = builder.makeDoubleConstant(1.0); break; -#ifdef AMD_EXTENSIONS case glslang::EOpConvBoolToFloat16: convOp = spv::OpSelect; zero = builder.makeFloat16Constant(0.0F); one = builder.makeFloat16Constant(1.0F); break; -#endif + + case glslang::EOpConvBoolToInt8: + zero = builder.makeInt8Constant(0); + one = builder.makeInt8Constant(1); + convOp = spv::OpSelect; + break; + + case glslang::EOpConvBoolToUint8: + zero = builder.makeUint8Constant(0); + one = builder.makeUint8Constant(1); + convOp = spv::OpSelect; + break; + + case glslang::EOpConvBoolToInt16: + zero = builder.makeInt16Constant(0); + one = builder.makeInt16Constant(1); + convOp = spv::OpSelect; + break; + + case glslang::EOpConvBoolToUint16: + zero = builder.makeUint16Constant(0); + one = builder.makeUint16Constant(1); + convOp = spv::OpSelect; + break; case glslang::EOpConvBoolToInt: case glslang::EOpConvBoolToInt64: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvBoolToInt16: -#endif if (op == glslang::EOpConvBoolToInt64) zero = builder.makeInt64Constant(0); -#ifdef AMD_EXTENSIONS - else if (op == glslang::EOpConvBoolToInt16) - zero = builder.makeInt16Constant(0); -#endif else zero = builder.makeIntConstant(0); if (op == glslang::EOpConvBoolToInt64) one = builder.makeInt64Constant(1); -#ifdef AMD_EXTENSIONS - else if (op == glslang::EOpConvBoolToInt16) - one = builder.makeInt16Constant(1); -#endif else one = builder.makeIntConstant(1); @@ -4434,104 +5029,94 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec case glslang::EOpConvBoolToUint: case glslang::EOpConvBoolToUint64: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvBoolToUint16: -#endif if (op == glslang::EOpConvBoolToUint64) zero = builder.makeUint64Constant(0); -#ifdef AMD_EXTENSIONS - else if (op == glslang::EOpConvBoolToUint16) - zero = builder.makeUint16Constant(0); -#endif else zero = builder.makeUintConstant(0); if (op == glslang::EOpConvBoolToUint64) one = builder.makeUint64Constant(1); -#ifdef AMD_EXTENSIONS - else if (op == glslang::EOpConvBoolToUint16) - one = builder.makeUint16Constant(1); -#endif else one = builder.makeUintConstant(1); convOp = spv::OpSelect; break; + case glslang::EOpConvInt8ToFloat16: + case glslang::EOpConvInt8ToFloat: + case glslang::EOpConvInt8ToDouble: + case glslang::EOpConvInt16ToFloat16: + case glslang::EOpConvInt16ToFloat: + case glslang::EOpConvInt16ToDouble: + case glslang::EOpConvIntToFloat16: case glslang::EOpConvIntToFloat: case glslang::EOpConvIntToDouble: case glslang::EOpConvInt64ToFloat: case glslang::EOpConvInt64ToDouble: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvInt16ToFloat: - case glslang::EOpConvInt16ToDouble: - case glslang::EOpConvInt16ToFloat16: - case glslang::EOpConvIntToFloat16: case glslang::EOpConvInt64ToFloat16: -#endif convOp = spv::OpConvertSToF; break; + case glslang::EOpConvUint8ToFloat16: + case glslang::EOpConvUint8ToFloat: + case glslang::EOpConvUint8ToDouble: + case glslang::EOpConvUint16ToFloat16: + case glslang::EOpConvUint16ToFloat: + case glslang::EOpConvUint16ToDouble: + case glslang::EOpConvUintToFloat16: case glslang::EOpConvUintToFloat: case glslang::EOpConvUintToDouble: case glslang::EOpConvUint64ToFloat: case glslang::EOpConvUint64ToDouble: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvUint16ToFloat: - case glslang::EOpConvUint16ToDouble: - case glslang::EOpConvUint16ToFloat16: - case glslang::EOpConvUintToFloat16: case glslang::EOpConvUint64ToFloat16: -#endif convOp = spv::OpConvertUToF; break; case glslang::EOpConvDoubleToFloat: case glslang::EOpConvFloatToDouble: -#ifdef AMD_EXTENSIONS case glslang::EOpConvDoubleToFloat16: case glslang::EOpConvFloat16ToDouble: case glslang::EOpConvFloatToFloat16: case glslang::EOpConvFloat16ToFloat: -#endif convOp = spv::OpFConvert; if (builder.isMatrixType(destType)) - return createUnaryMatrixOperation(convOp, precision, noContraction, destType, operand, typeProxy); + return createUnaryMatrixOperation(convOp, decorations, destType, operand, typeProxy); break; - case glslang::EOpConvFloatToInt: - case glslang::EOpConvDoubleToInt: - case glslang::EOpConvFloatToInt64: - case glslang::EOpConvDoubleToInt64: -#ifdef AMD_EXTENSIONS + case glslang::EOpConvFloat16ToInt8: + case glslang::EOpConvFloatToInt8: + case glslang::EOpConvDoubleToInt8: + case glslang::EOpConvFloat16ToInt16: case glslang::EOpConvFloatToInt16: case glslang::EOpConvDoubleToInt16: - case glslang::EOpConvFloat16ToInt16: case glslang::EOpConvFloat16ToInt: + case glslang::EOpConvFloatToInt: + case glslang::EOpConvDoubleToInt: case glslang::EOpConvFloat16ToInt64: -#endif + case glslang::EOpConvFloatToInt64: + case glslang::EOpConvDoubleToInt64: convOp = spv::OpConvertFToS; break; + case glslang::EOpConvUint8ToInt8: + case glslang::EOpConvInt8ToUint8: + case glslang::EOpConvUint16ToInt16: + case glslang::EOpConvInt16ToUint16: case glslang::EOpConvUintToInt: case glslang::EOpConvIntToUint: case glslang::EOpConvUint64ToInt64: case glslang::EOpConvInt64ToUint64: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvUint16ToInt16: - case glslang::EOpConvInt16ToUint16: -#endif if (builder.isInSpecConstCodeGenMode()) { // Build zero scalar or vector for OpIAdd. - if (op == glslang::EOpConvUint64ToInt64 || op == glslang::EOpConvInt64ToUint64) - zero = builder.makeUint64Constant(0); -#ifdef AMD_EXTENSIONS - else if (op == glslang::EOpConvUint16ToInt16 || op == glslang::EOpConvInt16ToUint16) + if(op == glslang::EOpConvUint8ToInt8 || op == glslang::EOpConvInt8ToUint8) { + zero = builder.makeUint8Constant(0); + } else if (op == glslang::EOpConvUint16ToInt16 || op == glslang::EOpConvInt16ToUint16) { zero = builder.makeUint16Constant(0); -#endif - else + } else if (op == glslang::EOpConvUint64ToInt64 || op == glslang::EOpConvInt64ToUint64) { + zero = builder.makeUint64Constant(0); + } else { zero = builder.makeUintConstant(0); - + } zero = makeSmearedConstant(zero, vectorSize); // Use OpIAdd, instead of OpBitcast to do the conversion when // generating for OpSpecConstantOp instruction. @@ -4541,126 +5126,117 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec convOp = spv::OpBitcast; break; + case glslang::EOpConvFloat16ToUint8: + case glslang::EOpConvFloatToUint8: + case glslang::EOpConvDoubleToUint8: + case glslang::EOpConvFloat16ToUint16: + case glslang::EOpConvFloatToUint16: + case glslang::EOpConvDoubleToUint16: + case glslang::EOpConvFloat16ToUint: case glslang::EOpConvFloatToUint: case glslang::EOpConvDoubleToUint: case glslang::EOpConvFloatToUint64: case glslang::EOpConvDoubleToUint64: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvFloatToUint16: - case glslang::EOpConvDoubleToUint16: - case glslang::EOpConvFloat16ToUint16: - case glslang::EOpConvFloat16ToUint: case glslang::EOpConvFloat16ToUint64: -#endif convOp = spv::OpConvertFToU; break; - case glslang::EOpConvIntToInt64: - case glslang::EOpConvInt64ToInt: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvIntToInt16: + case glslang::EOpConvInt8ToInt16: + case glslang::EOpConvInt8ToInt: + case glslang::EOpConvInt8ToInt64: + case glslang::EOpConvInt16ToInt8: case glslang::EOpConvInt16ToInt: - case glslang::EOpConvInt64ToInt16: case glslang::EOpConvInt16ToInt64: -#endif + case glslang::EOpConvIntToInt8: + case glslang::EOpConvIntToInt16: + case glslang::EOpConvIntToInt64: + case glslang::EOpConvInt64ToInt8: + case glslang::EOpConvInt64ToInt16: + case glslang::EOpConvInt64ToInt: convOp = spv::OpSConvert; break; - case glslang::EOpConvUintToUint64: - case glslang::EOpConvUint64ToUint: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvUintToUint16: + case glslang::EOpConvUint8ToUint16: + case glslang::EOpConvUint8ToUint: + case glslang::EOpConvUint8ToUint64: + case glslang::EOpConvUint16ToUint8: case glslang::EOpConvUint16ToUint: - case glslang::EOpConvUint64ToUint16: case glslang::EOpConvUint16ToUint64: -#endif + case glslang::EOpConvUintToUint8: + case glslang::EOpConvUintToUint16: + case glslang::EOpConvUintToUint64: + case glslang::EOpConvUint64ToUint8: + case glslang::EOpConvUint64ToUint16: + case glslang::EOpConvUint64ToUint: convOp = spv::OpUConvert; break; - case glslang::EOpConvIntToUint64: - case glslang::EOpConvInt64ToUint: - case glslang::EOpConvUint64ToInt: - case glslang::EOpConvUintToInt64: -#ifdef AMD_EXTENSIONS + case glslang::EOpConvInt8ToUint16: + case glslang::EOpConvInt8ToUint: + case glslang::EOpConvInt8ToUint64: + case glslang::EOpConvInt16ToUint8: case glslang::EOpConvInt16ToUint: - case glslang::EOpConvUintToInt16: case glslang::EOpConvInt16ToUint64: - case glslang::EOpConvUint64ToInt16: - case glslang::EOpConvUint16ToInt: + case glslang::EOpConvIntToUint8: case glslang::EOpConvIntToUint16: - case glslang::EOpConvUint16ToInt64: + case glslang::EOpConvIntToUint64: + case glslang::EOpConvInt64ToUint8: case glslang::EOpConvInt64ToUint16: -#endif + case glslang::EOpConvInt64ToUint: + case glslang::EOpConvUint8ToInt16: + case glslang::EOpConvUint8ToInt: + case glslang::EOpConvUint8ToInt64: + case glslang::EOpConvUint16ToInt8: + case glslang::EOpConvUint16ToInt: + case glslang::EOpConvUint16ToInt64: + case glslang::EOpConvUintToInt8: + case glslang::EOpConvUintToInt16: + case glslang::EOpConvUintToInt64: + case glslang::EOpConvUint64ToInt8: + case glslang::EOpConvUint64ToInt16: + case glslang::EOpConvUint64ToInt: // OpSConvert/OpUConvert + OpBitCast - switch (op) { - case glslang::EOpConvIntToUint64: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvInt16ToUint64: -#endif - convOp = spv::OpSConvert; - type = builder.makeIntType(64); - break; - case glslang::EOpConvInt64ToUint: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvInt16ToUint: -#endif - convOp = spv::OpSConvert; - type = builder.makeIntType(32); - break; - case glslang::EOpConvUint64ToInt: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvUint16ToInt: -#endif - convOp = spv::OpUConvert; - type = builder.makeUintType(32); - break; - case glslang::EOpConvUintToInt64: -#ifdef AMD_EXTENSIONS - case glslang::EOpConvUint16ToInt64: -#endif - convOp = spv::OpUConvert; - type = builder.makeUintType(64); - break; -#ifdef AMD_EXTENSIONS - case glslang::EOpConvUintToInt16: - case glslang::EOpConvUint64ToInt16: - convOp = spv::OpUConvert; - type = builder.makeUintType(16); - break; - case glslang::EOpConvIntToUint16: - case glslang::EOpConvInt64ToUint16: - convOp = spv::OpSConvert; - type = builder.makeIntType(16); - break; -#endif - default: - assert(0); - break; - } - - if (vectorSize > 0) - type = builder.makeVectorType(type, vectorSize); - - operand = builder.createUnaryOp(convOp, type, operand); + operand = createConversionOperation(op, operand, vectorSize); if (builder.isInSpecConstCodeGenMode()) { // Build zero scalar or vector for OpIAdd. -#ifdef AMD_EXTENSIONS - if (op == glslang::EOpConvIntToUint64 || op == glslang::EOpConvUintToInt64 || - op == glslang::EOpConvInt16ToUint64 || op == glslang::EOpConvUint16ToInt64) - zero = builder.makeUint64Constant(0); - else if (op == glslang::EOpConvIntToUint16 || op == glslang::EOpConvUintToInt16 || - op == glslang::EOpConvInt64ToUint16 || op == glslang::EOpConvUint64ToInt16) + switch(op) { + case glslang::EOpConvInt16ToUint8: + case glslang::EOpConvIntToUint8: + case glslang::EOpConvInt64ToUint8: + case glslang::EOpConvUint16ToInt8: + case glslang::EOpConvUintToInt8: + case glslang::EOpConvUint64ToInt8: + zero = builder.makeUint8Constant(0); + break; + case glslang::EOpConvInt8ToUint16: + case glslang::EOpConvIntToUint16: + case glslang::EOpConvInt64ToUint16: + case glslang::EOpConvUint8ToInt16: + case glslang::EOpConvUintToInt16: + case glslang::EOpConvUint64ToInt16: zero = builder.makeUint16Constant(0); - else + break; + case glslang::EOpConvInt8ToUint: + case glslang::EOpConvInt16ToUint: + case glslang::EOpConvInt64ToUint: + case glslang::EOpConvUint8ToInt: + case glslang::EOpConvUint16ToInt: + case glslang::EOpConvUint64ToInt: zero = builder.makeUintConstant(0); -#else - if (op == glslang::EOpConvIntToUint64 || op == glslang::EOpConvUintToInt64) + break; + case glslang::EOpConvInt8ToUint64: + case glslang::EOpConvInt16ToUint64: + case glslang::EOpConvIntToUint64: + case glslang::EOpConvUint8ToInt64: + case glslang::EOpConvUint16ToInt64: + case glslang::EOpConvUintToInt64: zero = builder.makeUint64Constant(0); - else - zero = builder.makeUintConstant(0); -#endif - + break; + default: + assert(false && "Default missing"); + break; + } zero = makeSmearedConstant(zero, vectorSize); // Use OpIAdd, instead of OpBitcast to do the conversion when // generating for OpSpecConstantOp instruction. @@ -4684,7 +5260,9 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec } else result = builder.createUnaryOp(convOp, destType, operand); - return builder.setPrecision(result, precision); + result = builder.setPrecision(result, decorations.precision); + builder.addDecoration(result, decorations.nonUniform); + return result; } spv::Id TGlslangToSpvTraverser::makeSmearedConstant(spv::Id constant, int vectorSize) @@ -4716,12 +5294,12 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv case glslang::EOpAtomicMin: case glslang::EOpImageAtomicMin: case glslang::EOpAtomicCounterMin: - opCode = typeProxy == glslang::EbtUint ? spv::OpAtomicUMin : spv::OpAtomicSMin; + opCode = (typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64) ? spv::OpAtomicUMin : spv::OpAtomicSMin; break; case glslang::EOpAtomicMax: case glslang::EOpImageAtomicMax: case glslang::EOpAtomicCounterMax: - opCode = typeProxy == glslang::EbtUint ? spv::OpAtomicUMax : spv::OpAtomicSMax; + opCode = (typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64) ? spv::OpAtomicUMax : spv::OpAtomicSMax; break; case glslang::EOpAtomicAnd: case glslang::EOpImageAtomicAnd: @@ -4762,11 +5340,15 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv break; } + if (typeProxy == glslang::EbtInt64 || typeProxy == glslang::EbtUint64) + builder.addCapability(spv::CapabilityInt64Atomics); + // Sort out the operands // - mapping from glslang -> SPV // - there are extra SPV operands with no glslang source // - compare-exchange swaps the value and comparator // - compare-exchange has an extra memory semantics + // - EOpAtomicCounterDecrement needs a post decrement std::vector spvAtomicOperands; // hold the spv operands auto opIt = operands.begin(); // walk the glslang operands spvAtomicOperands.push_back(*(opIt++)); @@ -4785,16 +5367,21 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv for (; opIt != operands.end(); ++opIt) spvAtomicOperands.push_back(*opIt); - return builder.createOp(opCode, typeId, spvAtomicOperands); + spv::Id resultId = builder.createOp(opCode, typeId, spvAtomicOperands); + + // GLSL and HLSL atomic-counter decrement return post-decrement value, + // while SPIR-V returns pre-decrement value. Translate between these semantics. + if (op == glslang::EOpAtomicCounterDecrement) + resultId = builder.createBinOp(spv::OpISub, typeId, resultId, builder.makeIntConstant(1)); + + return resultId; } // Create group invocation operations. spv::Id TGlslangToSpvTraverser::createInvocationsOperation(glslang::TOperator op, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy) { -#ifdef AMD_EXTENSIONS - bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64; - bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble || typeProxy == glslang::EbtFloat16; -#endif + bool isUnsigned = isTypeUnsignedInt(typeProxy); + bool isFloat = isTypeFloat(typeProxy); spv::Op opCode = spv::OpNop; std::vector spvGroupOperands; @@ -5055,15 +5642,353 @@ spv::Id TGlslangToSpvTraverser::CreateInvocationsVectorOperation(spv::Op op, spv return builder.createCompositeConstruct(typeId, results); } -spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy) +// Create subgroup invocation operations. +spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy) { -#ifdef AMD_EXTENSIONS - bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64 || typeProxy == glslang::EbtUint16; - bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble || typeProxy == glslang::EbtFloat16; -#else - bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64; - bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble; + // Add the required capabilities. + switch (op) { + case glslang::EOpSubgroupElect: + builder.addCapability(spv::CapabilityGroupNonUniform); + break; + case glslang::EOpSubgroupAll: + case glslang::EOpSubgroupAny: + case glslang::EOpSubgroupAllEqual: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformVote); + break; + case glslang::EOpSubgroupBroadcast: + case glslang::EOpSubgroupBroadcastFirst: + case glslang::EOpSubgroupBallot: + case glslang::EOpSubgroupInverseBallot: + case glslang::EOpSubgroupBallotBitExtract: + case glslang::EOpSubgroupBallotBitCount: + case glslang::EOpSubgroupBallotInclusiveBitCount: + case glslang::EOpSubgroupBallotExclusiveBitCount: + case glslang::EOpSubgroupBallotFindLSB: + case glslang::EOpSubgroupBallotFindMSB: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformBallot); + break; + case glslang::EOpSubgroupShuffle: + case glslang::EOpSubgroupShuffleXor: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformShuffle); + break; + case glslang::EOpSubgroupShuffleUp: + case glslang::EOpSubgroupShuffleDown: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformShuffleRelative); + break; + case glslang::EOpSubgroupAdd: + case glslang::EOpSubgroupMul: + case glslang::EOpSubgroupMin: + case glslang::EOpSubgroupMax: + case glslang::EOpSubgroupAnd: + case glslang::EOpSubgroupOr: + case glslang::EOpSubgroupXor: + case glslang::EOpSubgroupInclusiveAdd: + case glslang::EOpSubgroupInclusiveMul: + case glslang::EOpSubgroupInclusiveMin: + case glslang::EOpSubgroupInclusiveMax: + case glslang::EOpSubgroupInclusiveAnd: + case glslang::EOpSubgroupInclusiveOr: + case glslang::EOpSubgroupInclusiveXor: + case glslang::EOpSubgroupExclusiveAdd: + case glslang::EOpSubgroupExclusiveMul: + case glslang::EOpSubgroupExclusiveMin: + case glslang::EOpSubgroupExclusiveMax: + case glslang::EOpSubgroupExclusiveAnd: + case glslang::EOpSubgroupExclusiveOr: + case glslang::EOpSubgroupExclusiveXor: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformArithmetic); + break; + case glslang::EOpSubgroupClusteredAdd: + case glslang::EOpSubgroupClusteredMul: + case glslang::EOpSubgroupClusteredMin: + case glslang::EOpSubgroupClusteredMax: + case glslang::EOpSubgroupClusteredAnd: + case glslang::EOpSubgroupClusteredOr: + case glslang::EOpSubgroupClusteredXor: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformClustered); + break; + case glslang::EOpSubgroupQuadBroadcast: + case glslang::EOpSubgroupQuadSwapHorizontal: + case glslang::EOpSubgroupQuadSwapVertical: + case glslang::EOpSubgroupQuadSwapDiagonal: + builder.addCapability(spv::CapabilityGroupNonUniform); + builder.addCapability(spv::CapabilityGroupNonUniformQuad); + break; +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartitionedAdd: + case glslang::EOpSubgroupPartitionedMul: + case glslang::EOpSubgroupPartitionedMin: + case glslang::EOpSubgroupPartitionedMax: + case glslang::EOpSubgroupPartitionedAnd: + case glslang::EOpSubgroupPartitionedOr: + case glslang::EOpSubgroupPartitionedXor: + case glslang::EOpSubgroupPartitionedInclusiveAdd: + case glslang::EOpSubgroupPartitionedInclusiveMul: + case glslang::EOpSubgroupPartitionedInclusiveMin: + case glslang::EOpSubgroupPartitionedInclusiveMax: + case glslang::EOpSubgroupPartitionedInclusiveAnd: + case glslang::EOpSubgroupPartitionedInclusiveOr: + case glslang::EOpSubgroupPartitionedInclusiveXor: + case glslang::EOpSubgroupPartitionedExclusiveAdd: + case glslang::EOpSubgroupPartitionedExclusiveMul: + case glslang::EOpSubgroupPartitionedExclusiveMin: + case glslang::EOpSubgroupPartitionedExclusiveMax: + case glslang::EOpSubgroupPartitionedExclusiveAnd: + case glslang::EOpSubgroupPartitionedExclusiveOr: + case glslang::EOpSubgroupPartitionedExclusiveXor: + builder.addExtension(spv::E_SPV_NV_shader_subgroup_partitioned); + builder.addCapability(spv::CapabilityGroupNonUniformPartitionedNV); + break; #endif + default: assert(0 && "Unhandled subgroup operation!"); + } + + const bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64; + const bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble; + const bool isBool = typeProxy == glslang::EbtBool; + + spv::Op opCode = spv::OpNop; + + // Figure out which opcode to use. + switch (op) { + case glslang::EOpSubgroupElect: opCode = spv::OpGroupNonUniformElect; break; + case glslang::EOpSubgroupAll: opCode = spv::OpGroupNonUniformAll; break; + case glslang::EOpSubgroupAny: opCode = spv::OpGroupNonUniformAny; break; + case glslang::EOpSubgroupAllEqual: opCode = spv::OpGroupNonUniformAllEqual; break; + case glslang::EOpSubgroupBroadcast: opCode = spv::OpGroupNonUniformBroadcast; break; + case glslang::EOpSubgroupBroadcastFirst: opCode = spv::OpGroupNonUniformBroadcastFirst; break; + case glslang::EOpSubgroupBallot: opCode = spv::OpGroupNonUniformBallot; break; + case glslang::EOpSubgroupInverseBallot: opCode = spv::OpGroupNonUniformInverseBallot; break; + case glslang::EOpSubgroupBallotBitExtract: opCode = spv::OpGroupNonUniformBallotBitExtract; break; + case glslang::EOpSubgroupBallotBitCount: + case glslang::EOpSubgroupBallotInclusiveBitCount: + case glslang::EOpSubgroupBallotExclusiveBitCount: opCode = spv::OpGroupNonUniformBallotBitCount; break; + case glslang::EOpSubgroupBallotFindLSB: opCode = spv::OpGroupNonUniformBallotFindLSB; break; + case glslang::EOpSubgroupBallotFindMSB: opCode = spv::OpGroupNonUniformBallotFindMSB; break; + case glslang::EOpSubgroupShuffle: opCode = spv::OpGroupNonUniformShuffle; break; + case glslang::EOpSubgroupShuffleXor: opCode = spv::OpGroupNonUniformShuffleXor; break; + case glslang::EOpSubgroupShuffleUp: opCode = spv::OpGroupNonUniformShuffleUp; break; + case glslang::EOpSubgroupShuffleDown: opCode = spv::OpGroupNonUniformShuffleDown; break; + case glslang::EOpSubgroupAdd: + case glslang::EOpSubgroupInclusiveAdd: + case glslang::EOpSubgroupExclusiveAdd: + case glslang::EOpSubgroupClusteredAdd: +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartitionedAdd: + case glslang::EOpSubgroupPartitionedInclusiveAdd: + case glslang::EOpSubgroupPartitionedExclusiveAdd: +#endif + if (isFloat) { + opCode = spv::OpGroupNonUniformFAdd; + } else { + opCode = spv::OpGroupNonUniformIAdd; + } + break; + case glslang::EOpSubgroupMul: + case glslang::EOpSubgroupInclusiveMul: + case glslang::EOpSubgroupExclusiveMul: + case glslang::EOpSubgroupClusteredMul: +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartitionedMul: + case glslang::EOpSubgroupPartitionedInclusiveMul: + case glslang::EOpSubgroupPartitionedExclusiveMul: +#endif + if (isFloat) { + opCode = spv::OpGroupNonUniformFMul; + } else { + opCode = spv::OpGroupNonUniformIMul; + } + break; + case glslang::EOpSubgroupMin: + case glslang::EOpSubgroupInclusiveMin: + case glslang::EOpSubgroupExclusiveMin: + case glslang::EOpSubgroupClusteredMin: +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartitionedMin: + case glslang::EOpSubgroupPartitionedInclusiveMin: + case glslang::EOpSubgroupPartitionedExclusiveMin: +#endif + if (isFloat) { + opCode = spv::OpGroupNonUniformFMin; + } else if (isUnsigned) { + opCode = spv::OpGroupNonUniformUMin; + } else { + opCode = spv::OpGroupNonUniformSMin; + } + break; + case glslang::EOpSubgroupMax: + case glslang::EOpSubgroupInclusiveMax: + case glslang::EOpSubgroupExclusiveMax: + case glslang::EOpSubgroupClusteredMax: +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartitionedMax: + case glslang::EOpSubgroupPartitionedInclusiveMax: + case glslang::EOpSubgroupPartitionedExclusiveMax: +#endif + if (isFloat) { + opCode = spv::OpGroupNonUniformFMax; + } else if (isUnsigned) { + opCode = spv::OpGroupNonUniformUMax; + } else { + opCode = spv::OpGroupNonUniformSMax; + } + break; + case glslang::EOpSubgroupAnd: + case glslang::EOpSubgroupInclusiveAnd: + case glslang::EOpSubgroupExclusiveAnd: + case glslang::EOpSubgroupClusteredAnd: +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartitionedAnd: + case glslang::EOpSubgroupPartitionedInclusiveAnd: + case glslang::EOpSubgroupPartitionedExclusiveAnd: +#endif + if (isBool) { + opCode = spv::OpGroupNonUniformLogicalAnd; + } else { + opCode = spv::OpGroupNonUniformBitwiseAnd; + } + break; + case glslang::EOpSubgroupOr: + case glslang::EOpSubgroupInclusiveOr: + case glslang::EOpSubgroupExclusiveOr: + case glslang::EOpSubgroupClusteredOr: +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartitionedOr: + case glslang::EOpSubgroupPartitionedInclusiveOr: + case glslang::EOpSubgroupPartitionedExclusiveOr: +#endif + if (isBool) { + opCode = spv::OpGroupNonUniformLogicalOr; + } else { + opCode = spv::OpGroupNonUniformBitwiseOr; + } + break; + case glslang::EOpSubgroupXor: + case glslang::EOpSubgroupInclusiveXor: + case glslang::EOpSubgroupExclusiveXor: + case glslang::EOpSubgroupClusteredXor: +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartitionedXor: + case glslang::EOpSubgroupPartitionedInclusiveXor: + case glslang::EOpSubgroupPartitionedExclusiveXor: +#endif + if (isBool) { + opCode = spv::OpGroupNonUniformLogicalXor; + } else { + opCode = spv::OpGroupNonUniformBitwiseXor; + } + break; + case glslang::EOpSubgroupQuadBroadcast: opCode = spv::OpGroupNonUniformQuadBroadcast; break; + case glslang::EOpSubgroupQuadSwapHorizontal: + case glslang::EOpSubgroupQuadSwapVertical: + case glslang::EOpSubgroupQuadSwapDiagonal: opCode = spv::OpGroupNonUniformQuadSwap; break; + default: assert(0 && "Unhandled subgroup operation!"); + } + + std::vector spvGroupOperands; + + // Every operation begins with the Execution Scope operand. + spvGroupOperands.push_back(builder.makeUintConstant(spv::ScopeSubgroup)); + + // Next, for all operations that use a Group Operation, push that as an operand. + switch (op) { + default: break; + case glslang::EOpSubgroupBallotBitCount: + case glslang::EOpSubgroupAdd: + case glslang::EOpSubgroupMul: + case glslang::EOpSubgroupMin: + case glslang::EOpSubgroupMax: + case glslang::EOpSubgroupAnd: + case glslang::EOpSubgroupOr: + case glslang::EOpSubgroupXor: + spvGroupOperands.push_back(spv::GroupOperationReduce); + break; + case glslang::EOpSubgroupBallotInclusiveBitCount: + case glslang::EOpSubgroupInclusiveAdd: + case glslang::EOpSubgroupInclusiveMul: + case glslang::EOpSubgroupInclusiveMin: + case glslang::EOpSubgroupInclusiveMax: + case glslang::EOpSubgroupInclusiveAnd: + case glslang::EOpSubgroupInclusiveOr: + case glslang::EOpSubgroupInclusiveXor: + spvGroupOperands.push_back(spv::GroupOperationInclusiveScan); + break; + case glslang::EOpSubgroupBallotExclusiveBitCount: + case glslang::EOpSubgroupExclusiveAdd: + case glslang::EOpSubgroupExclusiveMul: + case glslang::EOpSubgroupExclusiveMin: + case glslang::EOpSubgroupExclusiveMax: + case glslang::EOpSubgroupExclusiveAnd: + case glslang::EOpSubgroupExclusiveOr: + case glslang::EOpSubgroupExclusiveXor: + spvGroupOperands.push_back(spv::GroupOperationExclusiveScan); + break; + case glslang::EOpSubgroupClusteredAdd: + case glslang::EOpSubgroupClusteredMul: + case glslang::EOpSubgroupClusteredMin: + case glslang::EOpSubgroupClusteredMax: + case glslang::EOpSubgroupClusteredAnd: + case glslang::EOpSubgroupClusteredOr: + case glslang::EOpSubgroupClusteredXor: + spvGroupOperands.push_back(spv::GroupOperationClusteredReduce); + break; +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartitionedAdd: + case glslang::EOpSubgroupPartitionedMul: + case glslang::EOpSubgroupPartitionedMin: + case glslang::EOpSubgroupPartitionedMax: + case glslang::EOpSubgroupPartitionedAnd: + case glslang::EOpSubgroupPartitionedOr: + case glslang::EOpSubgroupPartitionedXor: + spvGroupOperands.push_back(spv::GroupOperationPartitionedReduceNV); + break; + case glslang::EOpSubgroupPartitionedInclusiveAdd: + case glslang::EOpSubgroupPartitionedInclusiveMul: + case glslang::EOpSubgroupPartitionedInclusiveMin: + case glslang::EOpSubgroupPartitionedInclusiveMax: + case glslang::EOpSubgroupPartitionedInclusiveAnd: + case glslang::EOpSubgroupPartitionedInclusiveOr: + case glslang::EOpSubgroupPartitionedInclusiveXor: + spvGroupOperands.push_back(spv::GroupOperationPartitionedInclusiveScanNV); + break; + case glslang::EOpSubgroupPartitionedExclusiveAdd: + case glslang::EOpSubgroupPartitionedExclusiveMul: + case glslang::EOpSubgroupPartitionedExclusiveMin: + case glslang::EOpSubgroupPartitionedExclusiveMax: + case glslang::EOpSubgroupPartitionedExclusiveAnd: + case glslang::EOpSubgroupPartitionedExclusiveOr: + case glslang::EOpSubgroupPartitionedExclusiveXor: + spvGroupOperands.push_back(spv::GroupOperationPartitionedExclusiveScanNV); + break; +#endif + } + + // Push back the operands next. + for (auto opIt : operands) { + spvGroupOperands.push_back(opIt); + } + + // Some opcodes have additional operands. + switch (op) { + default: break; + case glslang::EOpSubgroupQuadSwapHorizontal: spvGroupOperands.push_back(builder.makeUintConstant(0)); break; + case glslang::EOpSubgroupQuadSwapVertical: spvGroupOperands.push_back(builder.makeUintConstant(1)); break; + case glslang::EOpSubgroupQuadSwapDiagonal: spvGroupOperands.push_back(builder.makeUintConstant(2)); break; + } + + return builder.createOp(opCode, typeId, spvGroupOperands); +} + +spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy) +{ + bool isUnsigned = isTypeUnsignedInt(typeProxy); + bool isFloat = isTypeFloat(typeProxy); spv::Op opCode = spv::OpNop; int extBuiltins = -1; @@ -5200,11 +6125,7 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: libCall = spv::GLSLstd450FrexpStruct; assert(builder.isPointerType(typeId1)); typeId1 = builder.getContainedTypeId(typeId1); -#ifdef AMD_EXTENSIONS int width = builder.getScalarTypeWidth(typeId1); -#else - int width = 32; -#endif if (builder.getNumComponents(operands[0]) == 1) frexpIntType = builder.makeIntegerType(width, true); else @@ -5220,6 +6141,45 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: case glslang::EOpReadInvocation: return createInvocationsOperation(op, typeId, operands, typeProxy); + case glslang::EOpSubgroupBroadcast: + case glslang::EOpSubgroupBallotBitExtract: + case glslang::EOpSubgroupShuffle: + case glslang::EOpSubgroupShuffleXor: + case glslang::EOpSubgroupShuffleUp: + case glslang::EOpSubgroupShuffleDown: + case glslang::EOpSubgroupClusteredAdd: + case glslang::EOpSubgroupClusteredMul: + case glslang::EOpSubgroupClusteredMin: + case glslang::EOpSubgroupClusteredMax: + case glslang::EOpSubgroupClusteredAnd: + case glslang::EOpSubgroupClusteredOr: + case glslang::EOpSubgroupClusteredXor: + case glslang::EOpSubgroupQuadBroadcast: +#ifdef NV_EXTENSIONS + case glslang::EOpSubgroupPartitionedAdd: + case glslang::EOpSubgroupPartitionedMul: + case glslang::EOpSubgroupPartitionedMin: + case glslang::EOpSubgroupPartitionedMax: + case glslang::EOpSubgroupPartitionedAnd: + case glslang::EOpSubgroupPartitionedOr: + case glslang::EOpSubgroupPartitionedXor: + case glslang::EOpSubgroupPartitionedInclusiveAdd: + case glslang::EOpSubgroupPartitionedInclusiveMul: + case glslang::EOpSubgroupPartitionedInclusiveMin: + case glslang::EOpSubgroupPartitionedInclusiveMax: + case glslang::EOpSubgroupPartitionedInclusiveAnd: + case glslang::EOpSubgroupPartitionedInclusiveOr: + case glslang::EOpSubgroupPartitionedInclusiveXor: + case glslang::EOpSubgroupPartitionedExclusiveAdd: + case glslang::EOpSubgroupPartitionedExclusiveMul: + case glslang::EOpSubgroupPartitionedExclusiveMin: + case glslang::EOpSubgroupPartitionedExclusiveMax: + case glslang::EOpSubgroupPartitionedExclusiveAnd: + case glslang::EOpSubgroupPartitionedExclusiveOr: + case glslang::EOpSubgroupPartitionedExclusiveXor: +#endif + return createSubgroupOperation(op, typeId, operands, typeProxy); + #ifdef AMD_EXTENSIONS case glslang::EOpSwizzleInvocations: extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_ballot); @@ -5352,41 +6312,90 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv: builder.createNoResultOp(spv::OpEndPrimitive); return 0; case glslang::EOpBarrier: - builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeDevice, spv::MemorySemanticsMaskNone); + if (glslangIntermediate->getStage() == EShLangTessControl) { + builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeInvocation, spv::MemorySemanticsMaskNone); + // TODO: prefer the following, when available: + // builder.createControlBarrier(spv::ScopePatch, spv::ScopePatch, + // spv::MemorySemanticsPatchMask | + // spv::MemorySemanticsAcquireReleaseMask); + } else { + builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeWorkgroup, + spv::MemorySemanticsWorkgroupMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); + } return 0; case glslang::EOpMemoryBarrier: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsAllMemory); + builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsAllMemory | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpMemoryBarrierAtomicCounter: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsAtomicCounterMemoryMask); + builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsAtomicCounterMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpMemoryBarrierBuffer: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsUniformMemoryMask); + builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsUniformMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpMemoryBarrierImage: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsImageMemoryMask); + builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsImageMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpMemoryBarrierShared: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsWorkgroupMemoryMask); + builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsWorkgroupMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpGroupMemoryBarrier: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsCrossWorkgroupMemoryMask); + builder.createMemoryBarrier(spv::ScopeWorkgroup, spv::MemorySemanticsAllMemory | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpAllMemoryBarrierWithGroupSync: - // Control barrier with non-"None" semantic is also a memory barrier. - builder.createControlBarrier(spv::ScopeDevice, spv::ScopeDevice, spv::MemorySemanticsAllMemory); + builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeDevice, + spv::MemorySemanticsAllMemory | + spv::MemorySemanticsAcquireReleaseMask); return 0; - case glslang::EOpGroupMemoryBarrierWithGroupSync: - // Control barrier with non-"None" semantic is also a memory barrier. - builder.createControlBarrier(spv::ScopeDevice, spv::ScopeDevice, spv::MemorySemanticsCrossWorkgroupMemoryMask); + case glslang::EOpDeviceMemoryBarrier: + builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsUniformMemoryMask | + spv::MemorySemanticsImageMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); + return 0; + case glslang::EOpDeviceMemoryBarrierWithGroupSync: + builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeDevice, spv::MemorySemanticsUniformMemoryMask | + spv::MemorySemanticsImageMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpWorkgroupMemoryBarrier: - builder.createMemoryBarrier(spv::ScopeWorkgroup, spv::MemorySemanticsWorkgroupMemoryMask); + builder.createMemoryBarrier(spv::ScopeWorkgroup, spv::MemorySemanticsWorkgroupMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpWorkgroupMemoryBarrierWithGroupSync: - // Control barrier with non-"None" semantic is also a memory barrier. - builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeWorkgroup, spv::MemorySemanticsWorkgroupMemoryMask); + builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeWorkgroup, + spv::MemorySemanticsWorkgroupMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; + case glslang::EOpSubgroupBarrier: + builder.createControlBarrier(spv::ScopeSubgroup, spv::ScopeSubgroup, spv::MemorySemanticsAllMemory | + spv::MemorySemanticsAcquireReleaseMask); + return spv::NoResult; + case glslang::EOpSubgroupMemoryBarrier: + builder.createMemoryBarrier(spv::ScopeSubgroup, spv::MemorySemanticsAllMemory | + spv::MemorySemanticsAcquireReleaseMask); + return spv::NoResult; + case glslang::EOpSubgroupMemoryBarrierBuffer: + builder.createMemoryBarrier(spv::ScopeSubgroup, spv::MemorySemanticsUniformMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); + return spv::NoResult; + case glslang::EOpSubgroupMemoryBarrierImage: + builder.createMemoryBarrier(spv::ScopeSubgroup, spv::MemorySemanticsImageMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); + return spv::NoResult; + case glslang::EOpSubgroupMemoryBarrierShared: + builder.createMemoryBarrier(spv::ScopeSubgroup, spv::MemorySemanticsWorkgroupMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); + return spv::NoResult; + case glslang::EOpSubgroupElect: { + std::vector operands; + return createSubgroupOperation(op, typeId, operands, glslang::EbtVoid); + } #ifdef AMD_EXTENSIONS case glslang::EOpTime: { @@ -5415,24 +6424,15 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol symbolValues[symbol->getId()] = id; if (symbol->getBasicType() != glslang::EbtBlock) { - addDecoration(id, TranslatePrecisionDecoration(symbol->getType())); - addDecoration(id, TranslateInterpolationDecoration(symbol->getType().getQualifier())); - addDecoration(id, TranslateAuxiliaryStorageDecoration(symbol->getType().getQualifier())); + builder.addDecoration(id, TranslatePrecisionDecoration(symbol->getType())); + builder.addDecoration(id, TranslateInterpolationDecoration(symbol->getType().getQualifier())); + builder.addDecoration(id, TranslateAuxiliaryStorageDecoration(symbol->getType().getQualifier())); if (symbol->getType().getQualifier().hasSpecConstantId()) - addDecoration(id, spv::DecorationSpecId, symbol->getType().getQualifier().layoutSpecConstantId); + builder.addDecoration(id, spv::DecorationSpecId, symbol->getType().getQualifier().layoutSpecConstantId); if (symbol->getQualifier().hasIndex()) builder.addDecoration(id, spv::DecorationIndex, symbol->getQualifier().layoutIndex); if (symbol->getQualifier().hasComponent()) builder.addDecoration(id, spv::DecorationComponent, symbol->getQualifier().layoutComponent); - if (glslangIntermediate->getXfbMode()) { - builder.addCapability(spv::CapabilityTransformFeedback); - if (symbol->getQualifier().hasXfbStride()) - builder.addDecoration(id, spv::DecorationXfbStride, symbol->getQualifier().layoutXfbStride); - if (symbol->getQualifier().hasXfbBuffer()) - builder.addDecoration(id, spv::DecorationXfbBuffer, symbol->getQualifier().layoutXfbBuffer); - if (symbol->getQualifier().hasXfbOffset()) - builder.addDecoration(id, spv::DecorationOffset, symbol->getQualifier().layoutXfbOffset); - } // atomic counters use this: if (symbol->getQualifier().hasOffset()) builder.addDecoration(id, spv::DecorationOffset, symbol->getQualifier().layoutOffset); @@ -5440,7 +6440,7 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol if (symbol->getQualifier().hasLocation()) builder.addDecoration(id, spv::DecorationLocation, symbol->getQualifier().layoutLocation); - addDecoration(id, TranslateInvariantDecoration(symbol->getType().getQualifier())); + builder.addDecoration(id, TranslateInvariantDecoration(symbol->getType().getQualifier())); if (symbol->getQualifier().hasStream() && glslangIntermediate->isMultiStream()) { builder.addCapability(spv::CapabilityGeometryStreams); builder.addDecoration(id, spv::DecorationStream, symbol->getQualifier().layoutStream); @@ -5459,21 +6459,30 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol builder.addCapability(spv::CapabilityTransformFeedback); if (symbol->getQualifier().hasXfbStride()) builder.addDecoration(id, spv::DecorationXfbStride, symbol->getQualifier().layoutXfbStride); - if (symbol->getQualifier().hasXfbBuffer()) + if (symbol->getQualifier().hasXfbBuffer()) { builder.addDecoration(id, spv::DecorationXfbBuffer, symbol->getQualifier().layoutXfbBuffer); + unsigned stride = glslangIntermediate->getXfbStride(symbol->getQualifier().layoutXfbBuffer); + if (stride != glslang::TQualifier::layoutXfbStrideEnd) + builder.addDecoration(id, spv::DecorationXfbStride, stride); + } + if (symbol->getQualifier().hasXfbOffset()) + builder.addDecoration(id, spv::DecorationOffset, symbol->getQualifier().layoutXfbOffset); } if (symbol->getType().isImage()) { std::vector memory; TranslateMemoryDecoration(symbol->getType().getQualifier(), memory); for (unsigned int i = 0; i < memory.size(); ++i) - addDecoration(id, memory[i]); + builder.addDecoration(id, memory[i]); } // built-in variable decorations spv::BuiltIn builtIn = TranslateBuiltInDecoration(symbol->getQualifier().builtIn, false); if (builtIn != spv::BuiltInMax) - addDecoration(id, spv::DecorationBuiltIn, (int)builtIn); + builder.addDecoration(id, spv::DecorationBuiltIn, (int)builtIn); + + // nonuniform + builder.addDecoration(id, TranslateNonUniformDecoration(symbol->getType().getQualifier())); #ifdef NV_EXTENSIONS if (builtIn == spv::BuiltInSampleMask) { @@ -5483,7 +6492,7 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol decoration = (spv::Decoration)spv::DecorationOverrideCoverageNV; else decoration = (spv::Decoration)spv::DecorationMax; - addDecoration(id, decoration); + builder.addDecoration(id, decoration); if (decoration != spv::DecorationMax) { builder.addExtension(spv::E_SPV_NV_sample_mask_override_coverage); } @@ -5491,53 +6500,32 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol else if (builtIn == spv::BuiltInLayer) { // SPV_NV_viewport_array2 extension if (symbol->getQualifier().layoutViewportRelative) { - addDecoration(id, (spv::Decoration)spv::DecorationViewportRelativeNV); + builder.addDecoration(id, (spv::Decoration)spv::DecorationViewportRelativeNV); builder.addCapability(spv::CapabilityShaderViewportMaskNV); builder.addExtension(spv::E_SPV_NV_viewport_array2); } if (symbol->getQualifier().layoutSecondaryViewportRelativeOffset != -2048) { - addDecoration(id, (spv::Decoration)spv::DecorationSecondaryViewportRelativeNV, symbol->getQualifier().layoutSecondaryViewportRelativeOffset); + builder.addDecoration(id, (spv::Decoration)spv::DecorationSecondaryViewportRelativeNV, + symbol->getQualifier().layoutSecondaryViewportRelativeOffset); builder.addCapability(spv::CapabilityShaderStereoViewNV); builder.addExtension(spv::E_SPV_NV_stereo_view_rendering); } } if (symbol->getQualifier().layoutPassthrough) { - addDecoration(id, spv::DecorationPassthroughNV); + builder.addDecoration(id, spv::DecorationPassthroughNV); builder.addCapability(spv::CapabilityGeometryShaderPassthroughNV); builder.addExtension(spv::E_SPV_NV_geometry_shader_passthrough); } #endif - return id; -} - -// If 'dec' is valid, add no-operand decoration to an object -void TGlslangToSpvTraverser::addDecoration(spv::Id id, spv::Decoration dec) -{ - if (dec != spv::DecorationMax) - builder.addDecoration(id, dec); -} - -// If 'dec' is valid, add a one-operand decoration to an object -void TGlslangToSpvTraverser::addDecoration(spv::Id id, spv::Decoration dec, unsigned value) -{ - if (dec != spv::DecorationMax) - builder.addDecoration(id, dec, value); -} - -// If 'dec' is valid, add a no-operand decoration to a struct member -void TGlslangToSpvTraverser::addMemberDecoration(spv::Id id, int member, spv::Decoration dec) -{ - if (dec != spv::DecorationMax) - builder.addMemberDecoration(id, (unsigned)member, dec); -} + if (glslangIntermediate->getHlslFunctionality1() && symbol->getType().getQualifier().semanticName != nullptr) { + builder.addExtension("SPV_GOOGLE_hlsl_functionality1"); + builder.addDecoration(id, (spv::Decoration)spv::DecorationHlslSemanticGOOGLE, + symbol->getType().getQualifier().semanticName); + } -// If 'dec' is valid, add a one-operand decoration to a struct member -void TGlslangToSpvTraverser::addMemberDecoration(spv::Id id, int member, spv::Decoration dec, unsigned value) -{ - if (dec != spv::DecorationMax) - builder.addMemberDecoration(id, (unsigned)member, dec, value); + return id; } // Make a full tree of instructions to build a SPIR-V specialization constant, @@ -5572,8 +6560,10 @@ spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TIntermTyped& n for (int dim = 0; dim < 3; ++dim) { bool specConst = (glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet); dimConstId.push_back(builder.makeUintConstant(glslangIntermediate->getLocalSize(dim), specConst)); - if (specConst) - addDecoration(dimConstId.back(), spv::DecorationSpecId, glslangIntermediate->getLocalSizeSpecId(dim)); + if (specConst) { + builder.addDecoration(dimConstId.back(), spv::DecorationSpecId, + glslangIntermediate->getLocalSizeSpecId(dim)); + } } return builder.makeCompositeConstant(builder.makeVectorType(builder.makeUintType(32), 3), dimConstId, true); } @@ -5632,6 +6622,18 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla for (unsigned int i = 0; i < (unsigned int)glslangType.getVectorSize(); ++i) { bool zero = nextConst >= consts.size(); switch (glslangType.getBasicType()) { + case glslang::EbtInt8: + spvConsts.push_back(builder.makeInt8Constant(zero ? 0 : consts[nextConst].getI8Const())); + break; + case glslang::EbtUint8: + spvConsts.push_back(builder.makeUint8Constant(zero ? 0 : consts[nextConst].getU8Const())); + break; + case glslang::EbtInt16: + spvConsts.push_back(builder.makeInt16Constant(zero ? 0 : consts[nextConst].getI16Const())); + break; + case glslang::EbtUint16: + spvConsts.push_back(builder.makeUint16Constant(zero ? 0 : consts[nextConst].getU16Const())); + break; case glslang::EbtInt: spvConsts.push_back(builder.makeIntConstant(zero ? 0 : consts[nextConst].getIConst())); break; @@ -5644,25 +6646,15 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla case glslang::EbtUint64: spvConsts.push_back(builder.makeUint64Constant(zero ? 0 : consts[nextConst].getU64Const())); break; -#ifdef AMD_EXTENSIONS - case glslang::EbtInt16: - spvConsts.push_back(builder.makeInt16Constant(zero ? 0 : (short)consts[nextConst].getIConst())); - break; - case glslang::EbtUint16: - spvConsts.push_back(builder.makeUint16Constant(zero ? 0 : (unsigned short)consts[nextConst].getUConst())); - break; -#endif case glslang::EbtFloat: spvConsts.push_back(builder.makeFloatConstant(zero ? 0.0F : (float)consts[nextConst].getDConst())); break; case glslang::EbtDouble: spvConsts.push_back(builder.makeDoubleConstant(zero ? 0.0 : consts[nextConst].getDConst())); break; -#ifdef AMD_EXTENSIONS case glslang::EbtFloat16: spvConsts.push_back(builder.makeFloat16Constant(zero ? 0.0F : (float)consts[nextConst].getDConst())); break; -#endif case glslang::EbtBool: spvConsts.push_back(builder.makeBoolConstant(zero ? false : consts[nextConst].getBConst())); break; @@ -5677,6 +6669,18 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla bool zero = nextConst >= consts.size(); spv::Id scalar = 0; switch (glslangType.getBasicType()) { + case glslang::EbtInt8: + scalar = builder.makeInt8Constant(zero ? 0 : consts[nextConst].getI8Const(), specConstant); + break; + case glslang::EbtUint8: + scalar = builder.makeUint8Constant(zero ? 0 : consts[nextConst].getU8Const(), specConstant); + break; + case glslang::EbtInt16: + scalar = builder.makeInt16Constant(zero ? 0 : consts[nextConst].getI16Const(), specConstant); + break; + case glslang::EbtUint16: + scalar = builder.makeUint16Constant(zero ? 0 : consts[nextConst].getU16Const(), specConstant); + break; case glslang::EbtInt: scalar = builder.makeIntConstant(zero ? 0 : consts[nextConst].getIConst(), specConstant); break; @@ -5689,25 +6693,15 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla case glslang::EbtUint64: scalar = builder.makeUint64Constant(zero ? 0 : consts[nextConst].getU64Const(), specConstant); break; -#ifdef AMD_EXTENSIONS - case glslang::EbtInt16: - scalar = builder.makeInt16Constant(zero ? 0 : (short)consts[nextConst].getIConst(), specConstant); - break; - case glslang::EbtUint16: - scalar = builder.makeUint16Constant(zero ? 0 : (unsigned short)consts[nextConst].getUConst(), specConstant); - break; -#endif case glslang::EbtFloat: scalar = builder.makeFloatConstant(zero ? 0.0F : (float)consts[nextConst].getDConst(), specConstant); break; case glslang::EbtDouble: scalar = builder.makeDoubleConstant(zero ? 0.0 : consts[nextConst].getDConst(), specConstant); break; -#ifdef AMD_EXTENSIONS case glslang::EbtFloat16: scalar = builder.makeFloat16Constant(zero ? 0.0F : (float)consts[nextConst].getDConst(), specConstant); break; -#endif case glslang::EbtBool: scalar = builder.makeBoolConstant(zero ? false : consts[nextConst].getBConst(), specConstant); break; @@ -5854,6 +6848,7 @@ spv::Id TGlslangToSpvTraverser::createShortCircuit(glslang::TOperator op, glslan return builder.createOp(spv::OpPhi, boolTypeId, phiOperands); } +#ifdef AMD_EXTENSIONS // Return type Id of the imported set of extended instructions corresponds to the name. // Import this set if it has not been imported yet. spv::Id TGlslangToSpvTraverser::getExtBuiltins(const char* name) @@ -5867,6 +6862,7 @@ spv::Id TGlslangToSpvTraverser::getExtBuiltins(const char* name) return extBuiltins; } } +#endif }; // end anonymous namespace @@ -5880,6 +6876,20 @@ void GetSpirvVersion(std::string& version) version = buf; } +// For low-order part of the generator's magic number. Bump up +// when there is a change in the style (e.g., if SSA form changes, +// or a different instruction sequence to do something gets used). +int GetSpirvGeneratorVersion() +{ + // return 1; // start + // return 2; // EOpAtomicCounterDecrement gets a post decrement, to map between GLSL -> SPIR-V + // return 3; // change/correct barrier-instruction operands, to match memory model group decisions + // return 4; // some deeper access chains: for dynamic vector component, and local Boolean component + // return 5; // make OpArrayLength result type be an int with signedness of 0 + return 6; // revert version 5 change, which makes a different (new) kind of incorrect code, + // versions 4 and 6 each generate OpArrayLength as it has long been done +} + // Write SPIR-V out to a binary file void OutputSpvBin(const std::vector& spirv, const char* baseName) { @@ -5901,7 +6911,9 @@ void OutputSpvHex(const std::vector& spirv, const char* baseName, out.open(baseName, std::ios::binary | std::ios::out); if (out.fail()) printf("ERROR: Failed to open file: %s\n", baseName); - out << "\t// " GLSLANG_REVISION " " GLSLANG_DATE << std::endl; + out << "\t// " << + glslang::GetSpirvGeneratorVersion() << "." << GLSLANG_MINOR_VERSION << "." << GLSLANG_PATCH_LEVEL << + std::endl; if (varName != nullptr) { out << "\t #pragma once" << std::endl; out << "const uint32_t " << varName << "[] = {" << std::endl; @@ -5947,11 +6959,60 @@ void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vectortraverse(&it); it.finishSpv(); it.dumpSpv(spirv); +#if ENABLE_OPT + // If from HLSL, run spirv-opt to "legalize" the SPIR-V for Vulkan + // eg. forward and remove memory writes of opaque types. + if ((intermediate.getSource() == EShSourceHlsl || + options->optimizeSize) && + !options->disableOptimizer) { + spv_target_env target_env = SPV_ENV_UNIVERSAL_1_2; + + spvtools::Optimizer optimizer(target_env); + optimizer.SetMessageConsumer([](spv_message_level_t level, + const char* source, + const spv_position_t& position, + const char* message) { + std::cerr << StringifyMessage(level, source, position, message) + << std::endl; + }); + + optimizer.RegisterPass(CreateMergeReturnPass()); + optimizer.RegisterPass(CreateInlineExhaustivePass()); + optimizer.RegisterPass(CreateEliminateDeadFunctionsPass()); + optimizer.RegisterPass(CreateScalarReplacementPass()); + optimizer.RegisterPass(CreateLocalAccessChainConvertPass()); + optimizer.RegisterPass(CreateLocalSingleBlockLoadStoreElimPass()); + optimizer.RegisterPass(CreateLocalSingleStoreElimPass()); + optimizer.RegisterPass(CreateAggressiveDCEPass()); + optimizer.RegisterPass(CreateInsertExtractElimPass()); + optimizer.RegisterPass(CreateDeadInsertElimPass()); + optimizer.RegisterPass(CreateAggressiveDCEPass()); + optimizer.RegisterPass(CreateCCPPass()); + optimizer.RegisterPass(CreateSimplificationPass()); + optimizer.RegisterPass(CreateDeadBranchElimPass()); + optimizer.RegisterPass(CreateCFGCleanupPass()); + optimizer.RegisterPass(CreateBlockMergePass()); + optimizer.RegisterPass(CreateLocalMultiStoreElimPass()); + optimizer.RegisterPass(CreateAggressiveDCEPass()); + optimizer.RegisterPass(CreateInsertExtractElimPass()); + optimizer.RegisterPass(CreateDeadInsertElimPass()); + if (options->optimizeSize) { + optimizer.RegisterPass(CreateRedundancyEliminationPass()); + // TODO(greg-lunarg): Add this when AMD driver issues are resolved + // optimizer.RegisterPass(CreateCommonUniformElimPass()); + } + optimizer.RegisterPass(CreateAggressiveDCEPass()); + + if (!optimizer.Run(spirv.data(), spirv.size(), &spirv)) + return; + } +#endif + glslang::GetThreadPoolAllocator().pop(); } diff --git a/deps/glslang/SPIRV/GlslangToSpv.h b/deps/glslang/SPIRV/GlslangToSpv.h index 0dad4d21..f7f7cff6 100644 --- a/deps/glslang/SPIRV/GlslangToSpv.h +++ b/deps/glslang/SPIRV/GlslangToSpv.h @@ -34,7 +34,7 @@ #pragma once -#if _MSC_VER >= 1900 +#if defined(_MSC_VER) && _MSC_VER >= 1900 #pragma warning(disable : 4464) // relative include path contains '..' #endif @@ -48,11 +48,15 @@ namespace glslang { struct SpvOptions { - SpvOptions() : generateDebugInfo(false) { } + SpvOptions() : generateDebugInfo(false), disableOptimizer(true), + optimizeSize(false) { } bool generateDebugInfo; + bool disableOptimizer; + bool optimizeSize; }; void GetSpirvVersion(std::string&); +int GetSpirvGeneratorVersion(); void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, SpvOptions* options = nullptr); void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, diff --git a/deps/glslang/SPIRV/SPVRemapper.cpp b/deps/glslang/SPIRV/SPVRemapper.cpp index e8031d02..4bac1453 100644 --- a/deps/glslang/SPIRV/SPVRemapper.cpp +++ b/deps/glslang/SPIRV/SPVRemapper.cpp @@ -135,6 +135,9 @@ namespace spv { const unsigned typeStart = idPos(id); const spv::Op opCode = asOpCode(typeStart); + if (errorLatch) + return 0; + switch (opCode) { case spv::OpTypeInt: // fall through... case spv::OpTypeFloat: return (spv[typeStart+2]+31)/32; @@ -148,8 +151,10 @@ namespace spv { unsigned spirvbin_t::idTypeSizeInWords(spv::Id id) const { const auto tid_it = idTypeSizeMap.find(id); - if (tid_it == idTypeSizeMap.end()) + if (tid_it == idTypeSizeMap.end()) { error("type size for ID not found"); + return 0; + } return tid_it->second; } @@ -215,14 +220,19 @@ namespace spv { bool spirvbin_t::isConstOp(spv::Op opCode) const { switch (opCode) { - case spv::OpConstantNull: error("unimplemented constant type"); - case spv::OpConstantSampler: error("unimplemented constant type"); + case spv::OpConstantNull: + case spv::OpConstantSampler: + error("unimplemented constant type"); + return true; case spv::OpConstantTrue: case spv::OpConstantFalse: case spv::OpConstantComposite: - case spv::OpConstant: return true; - default: return false; + case spv::OpConstant: + return true; + + default: + return false; } } @@ -246,21 +256,33 @@ namespace spv { spv::Id spirvbin_t::localId(spv::Id id, spv::Id newId) { - assert(id != spv::NoResult && newId != spv::NoResult); + //assert(id != spv::NoResult && newId != spv::NoResult); + + if (id > bound()) { + error(std::string("ID out of range: ") + std::to_string(id)); + return spirvbin_t::unused; + } if (id >= idMapL.size()) idMapL.resize(id+1, unused); if (newId != unmapped && newId != unused) { - if (isOldIdUnused(id)) + if (isOldIdUnused(id)) { error(std::string("ID unused in module: ") + std::to_string(id)); + return spirvbin_t::unused; + } - if (!isOldIdUnmapped(id)) + if (!isOldIdUnmapped(id)) { error(std::string("ID already mapped: ") + std::to_string(id) + " -> " - + std::to_string(localId(id))); + + std::to_string(localId(id))); - if (isNewIdMapped(newId)) + return spirvbin_t::unused; + } + + if (isNewIdMapped(newId)) { error(std::string("ID already used in module: ") + std::to_string(newId)); + return spirvbin_t::unused; + } msg(4, 4, std::string("map: ") + std::to_string(id) + " -> " + std::to_string(newId)); setMapped(newId); @@ -294,6 +316,10 @@ namespace spv { process(inst_fn_nop, // ignore instructions [this](spv::Id& id) { id = localId(id); + + if (errorLatch) + return; + assert(id != unused && id != unmapped); } ); @@ -312,14 +338,22 @@ namespace spv { continue; // Find a new mapping for any used but unmapped IDs - if (isOldIdUnmapped(id)) + if (isOldIdUnmapped(id)) { localId(id, unusedId = nextUnusedId(unusedId)); + if (errorLatch) + return; + } - if (isOldIdUnmapped(id)) + if (isOldIdUnmapped(id)) { error(std::string("old ID not mapped: ") + std::to_string(id)); + return; + } // Track max bound maxBound = std::max(maxBound, localId(id) + 1); + + if (errorLatch) + return; } bound(maxBound); // reset header ID bound to as big as it now needs to be @@ -401,6 +435,9 @@ namespace spv { if (typeId != spv::NoResult) { const unsigned idTypeSize = typeSizeInWords(typeId); + if (errorLatch) + return false; + if (idTypeSize != 0) idTypeSizeMap[resultId] = idTypeSize; } @@ -416,17 +453,26 @@ namespace spv { } else if (opCode == spv::Op::OpEntryPoint) { entryPoint = asId(start + 2); } else if (opCode == spv::Op::OpFunction) { - if (fnStart != 0) + if (fnStart != 0) { error("nested function found"); + return false; + } + fnStart = start; fnRes = asId(start + 2); } else if (opCode == spv::Op::OpFunctionEnd) { assert(fnRes != spv::NoResult); - if (fnStart == 0) + if (fnStart == 0) { error("function end without function start"); + return false; + } + fnPos[fnRes] = range_t(fnStart, start + asWordCount(start)); fnStart = 0; } else if (isConstOp(opCode)) { + if (errorLatch) + return false; + assert(asId(start + 2) != spv::NoResult); typeConstPos.insert(start); } else if (isTypeOp(opCode)) { @@ -446,18 +492,24 @@ namespace spv { { msg(2, 2, std::string("validating: ")); - if (spv.size() < header_size) + if (spv.size() < header_size) { error("file too short: "); + return; + } - if (magic() != spv::MagicNumber) + if (magic() != spv::MagicNumber) { error("bad magic number"); + return; + } // field 1 = version // field 2 = generator magic // field 3 = result bound - if (schemaNum() != 0) + if (schemaNum() != 0) { error("bad schema, must be 0"); + return; + } } int spirvbin_t::processInstruction(unsigned word, instfn_t instFn, idfn_t idFn) @@ -467,8 +519,10 @@ namespace spv { const int nextInst = word++ + wordCount; spv::Op opCode = asOpCode(instructionStart); - if (nextInst > int(spv.size())) + if (nextInst > int(spv.size())) { error("spir instruction terminated too early"); + return -1; + } // Base for computing number of operands; will be updated as more is learned unsigned numOperands = wordCount - 1; @@ -550,6 +604,9 @@ namespace spv { const unsigned literalSize = idTypeSizeInWords(idBuffer[literalSizePos]); const unsigned numLiteralIdPairs = (nextInst-word) / (1+literalSize); + if (errorLatch) + return -1; + for (unsigned arg=0; arg 0) @@ -927,6 +1010,9 @@ namespace spv { }, op_fn_nop); + if (errorLatch) + return; + // Chase replacements to their origins, in case there is a chain such as: // 2 = store 1 // 3 = load 2 @@ -960,6 +1046,9 @@ namespace spv { } ); + if (errorLatch) + return; + strip(); // strip out data we decided to eliminate } @@ -1003,6 +1092,9 @@ namespace spv { fn->second.first, fn->second.second); + if (errorLatch) + return; + fn = fnPos.erase(fn); } else ++fn; } @@ -1035,6 +1127,9 @@ namespace spv { [&](spv::Id& id) { if (varUseCount[id]) ++varUseCount[id]; } ); + if (errorLatch) + return; + // Remove single-use function variables + associated decorations and names process( [&](spv::Op opCode, unsigned start) { @@ -1076,6 +1171,9 @@ namespace spv { [&](spv::Id& id) { if (isType[id]) ++typeUseCount[id]; } ); + if (errorLatch) + return; + // Remove single reference types for (const auto typeStart : typeConstPos) { const spv::Id typeId = asTypeConstId(typeStart); @@ -1085,6 +1183,9 @@ namespace spv { stripInst(typeStart); } } + + if (errorLatch) + return; } } @@ -1163,8 +1264,10 @@ namespace spv { unsigned spirvbin_t::idPos(spv::Id id) const { const auto tid_it = idPosR.find(id); - if (tid_it == idPosR.end()) + if (tid_it == idPosR.end()) { error("ID not found"); + return 0; + } return tid_it->second; } @@ -1263,8 +1366,14 @@ namespace spv { const spv::Id resId = asTypeConstId(typeStart); const std::uint32_t hashval = hashType(typeStart); - if (isOldIdUnmapped(resId)) + if (errorLatch) + return; + + if (isOldIdUnmapped(resId)) { localId(resId, nextUnusedId(hashval % softTypeIdLimit + firstMappedID)); + if (errorLatch) + return; + } } } @@ -1283,7 +1392,7 @@ namespace spv { int strippedPos = 0; for (unsigned word = 0; word < unsigned(spv.size()); ++word) { - if (strip_it != stripRange.end() && word >= strip_it->second) + while (strip_it != stripRange.end() && word >= strip_it->second) ++strip_it; if (strip_it == stripRange.end() || word < strip_it->first || word >= strip_it->second) @@ -1310,24 +1419,49 @@ namespace spv { msg(3, 4, std::string("ID bound: ") + std::to_string(bound())); if (options & STRIP) stripDebug(); + if (errorLatch) return; + strip(); // strip out data we decided to eliminate + if (errorLatch) return; + if (options & OPT_LOADSTORE) optLoadStore(); + if (errorLatch) return; + if (options & OPT_FWD_LS) forwardLoadStores(); + if (errorLatch) return; + if (options & DCE_FUNCS) dceFuncs(); + if (errorLatch) return; + if (options & DCE_VARS) dceVars(); + if (errorLatch) return; + if (options & DCE_TYPES) dceTypes(); + if (errorLatch) return; strip(); // strip out data we decided to eliminate + if (errorLatch) return; + stripDeadRefs(); // remove references to things we DCEed + if (errorLatch) return; + // after the last strip, we must clean any debug info referring to now-deleted data if (options & MAP_TYPES) mapTypeConst(); + if (errorLatch) return; + if (options & MAP_NAMES) mapNames(); + if (errorLatch) return; + if (options & MAP_FUNCS) mapFnBodies(); + if (errorLatch) return; if (options & MAP_ALL) { mapRemainder(); // map any unmapped IDs + if (errorLatch) return; + applyMap(); // Now remap each shader to the new IDs we've come up with + if (errorLatch) return; } } diff --git a/deps/glslang/SPIRV/SPVRemapper.h b/deps/glslang/SPIRV/SPVRemapper.h index f9f369a3..97e3f31f 100644 --- a/deps/glslang/SPIRV/SPVRemapper.h +++ b/deps/glslang/SPIRV/SPVRemapper.h @@ -39,6 +39,7 @@ #include #include #include +#include namespace spv { @@ -111,7 +112,9 @@ namespace spv { class spirvbin_t : public spirvbin_base_t { public: - spirvbin_t(int verbose = 0) : entryPoint(spv::NoResult), largestNewId(0), verbose(verbose) { } + spirvbin_t(int verbose = 0) : entryPoint(spv::NoResult), largestNewId(0), verbose(verbose), errorLatch(false) + { } + virtual ~spirvbin_t() { } // remap on an existing binary in memory @@ -165,7 +168,7 @@ class spirvbin_t : public spirvbin_base_t typedef std::unordered_map typesize_map_t; // handle error - void error(const std::string& txt) const { errorHandler(txt); } + void error(const std::string& txt) const { errorLatch = true; errorHandler(txt); } bool isConstOp(spv::Op opCode) const; bool isTypeOp(spv::Op opCode) const; @@ -286,6 +289,11 @@ class spirvbin_t : public spirvbin_base_t std::uint32_t options; int verbose; // verbosity level + // Error latch: this is set if the error handler is ever executed. It would be better to + // use a try/catch block and throw, but that's not desired for certain environments, so + // this is the alternative. + mutable bool errorLatch; + static errorfn_t errorHandler; static logfn_t logHandler; }; diff --git a/deps/glslang/SPIRV/SpvBuilder.cpp b/deps/glslang/SPIRV/SpvBuilder.cpp index 289d59af..27ce71ca 100644 --- a/deps/glslang/SPIRV/SpvBuilder.cpp +++ b/deps/glslang/SPIRV/SpvBuilder.cpp @@ -46,9 +46,7 @@ #include "SpvBuilder.h" -#ifdef AMD_EXTENSIONS - #include "hex_float.h" -#endif +#include "hex_float.h" #ifndef _WIN32 #include @@ -56,7 +54,8 @@ namespace spv { -Builder::Builder(unsigned int magicNumber, SpvBuildLogger* buildLogger) : +Builder::Builder(unsigned int spvVersion, unsigned int magicNumber, SpvBuildLogger* buildLogger) : + spvVersion(spvVersion), source(SourceLanguageUnknown), sourceVersion(0), sourceFileStringId(NoResult), @@ -193,6 +192,9 @@ Id Builder::makeIntegerType(int width, bool hasSign) // deal with capabilities switch (width) { + case 8: + addCapability(CapabilityInt8); + break; case 16: addCapability(CapabilityInt16); break; @@ -469,7 +471,10 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo if (ms) { if (sampled == 2) { - addCapability(CapabilityStorageImageMultisample); + // Images used with subpass data are not storage + // images, so don't require the capability for them. + if (dim != Dim::DimSubpassData) + addCapability(CapabilityStorageImageMultisample); if (arrayed) addCapability(CapabilityImageMSArray); } @@ -618,7 +623,7 @@ Id Builder::getContainedTypeId(Id typeId) const // See if a scalar constant of this type has already been created, so it // can be reused rather than duplicated. (Required by the specification). -Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value) const +Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value) { Instruction* constant; for (int i = 0; i < (int)groupedConstants[typeClass].size(); ++i) { @@ -633,7 +638,7 @@ Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned valu } // Version of findScalarConstant (see above) for scalars that take two operands (e.g. a 'double' or 'int64'). -Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2) const +Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2) { Instruction* constant; for (int i = 0; i < (int)groupedConstants[typeClass].size(); ++i) { @@ -815,7 +820,6 @@ Id Builder::makeDoubleConstant(double d, bool specConstant) return c->getResultId(); } -#ifdef AMD_EXTENSIONS Id Builder::makeFloat16Constant(float f16, bool specConstant) { Op opcode = specConstant ? OpSpecConstant : OpConstant; @@ -843,9 +847,27 @@ Id Builder::makeFloat16Constant(float f16, bool specConstant) return c->getResultId(); } -#endif -Id Builder::findCompositeConstant(Op typeClass, const std::vector& comps) const +Id Builder::makeFpConstant(Id type, double d, bool specConstant) +{ + assert(isFloatType(type)); + + switch (getScalarTypeWidth(type)) { + case 16: + return makeFloat16Constant((float)d, specConstant); + case 32: + return makeFloatConstant((float)d, specConstant); + case 64: + return makeDoubleConstant(d, specConstant); + default: + break; + } + + assert(false); + return NoResult; +} + +Id Builder::findCompositeConstant(Op typeClass, const std::vector& comps) { Instruction* constant = 0; bool found = false; @@ -873,6 +895,30 @@ Id Builder::findCompositeConstant(Op typeClass, const std::vector& comps) co return found ? constant->getResultId() : NoResult; } +Id Builder::findStructConstant(Id typeId, const std::vector& comps) +{ + Instruction* constant = 0; + bool found = false; + for (int i = 0; i < (int)groupedStructConstants[typeId].size(); ++i) { + constant = groupedStructConstants[typeId][i]; + + // same contents? + bool mismatch = false; + for (int op = 0; op < constant->getNumOperands(); ++op) { + if (constant->getIdOperand(op) != comps[op]) { + mismatch = true; + break; + } + } + if (! mismatch) { + found = true; + break; + } + } + + return found ? constant->getResultId() : NoResult; +} + // Comments in header Id Builder::makeCompositeConstant(Id typeId, const std::vector& members, bool specConstant) { @@ -883,25 +929,33 @@ Id Builder::makeCompositeConstant(Id typeId, const std::vector& members, boo switch (typeClass) { case OpTypeVector: case OpTypeArray: - case OpTypeStruct: case OpTypeMatrix: + if (! specConstant) { + Id existing = findCompositeConstant(typeClass, members); + if (existing) + return existing; + } + break; + case OpTypeStruct: + if (! specConstant) { + Id existing = findStructConstant(typeId, members); + if (existing) + return existing; + } break; default: assert(0); return makeFloatConstant(0.0); } - if (! specConstant) { - Id existing = findCompositeConstant(typeClass, members); - if (existing) - return existing; - } - Instruction* c = new Instruction(getUniqueId(), typeId, opcode); for (int op = 0; op < (int)members.size(); ++op) c->addIdOperand(members[op]); constantsTypesGlobals.push_back(std::unique_ptr(c)); - groupedConstants[typeClass].push_back(c); + if (typeClass == OpTypeStruct) + groupedStructConstants[typeId].push_back(c); + else + groupedConstants[typeClass].push_back(c); module.mapInstruction(c); return c->getResultId(); @@ -958,6 +1012,7 @@ void Builder::addDecoration(Id id, Decoration decoration, int num) { if (decoration == spv::DecorationMax) return; + Instruction* dec = new Instruction(OpDecorate); dec->addIdOperand(id); dec->addImmediateOperand(decoration); @@ -967,8 +1022,37 @@ void Builder::addDecoration(Id id, Decoration decoration, int num) decorations.push_back(std::unique_ptr(dec)); } +void Builder::addDecoration(Id id, Decoration decoration, const char* s) +{ + if (decoration == spv::DecorationMax) + return; + + Instruction* dec = new Instruction(OpDecorateStringGOOGLE); + dec->addIdOperand(id); + dec->addImmediateOperand(decoration); + dec->addStringOperand(s); + + decorations.push_back(std::unique_ptr(dec)); +} + +void Builder::addDecorationId(Id id, Decoration decoration, Id idDecoration) +{ + if (decoration == spv::DecorationMax) + return; + + Instruction* dec = new Instruction(OpDecorateId); + dec->addIdOperand(id); + dec->addImmediateOperand(decoration); + dec->addIdOperand(idDecoration); + + decorations.push_back(std::unique_ptr(dec)); +} + void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decoration, int num) { + if (decoration == spv::DecorationMax) + return; + Instruction* dec = new Instruction(OpMemberDecorate); dec->addIdOperand(id); dec->addImmediateOperand(member); @@ -979,6 +1063,20 @@ void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decorat decorations.push_back(std::unique_ptr(dec)); } +void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decoration, const char *s) +{ + if (decoration == spv::DecorationMax) + return; + + Instruction* dec = new Instruction(OpMemberDecorateStringGOOGLE); + dec->addIdOperand(id); + dec->addImmediateOperand(member); + dec->addImmediateOperand(decoration); + dec->addStringOperand(s); + + decorations.push_back(std::unique_ptr(dec)); +} + // Comments in header Function* Builder::makeEntryPoint(const char* entryPoint) { @@ -1384,16 +1482,13 @@ Id Builder::createLvalueSwizzle(Id typeId, Id target, Id source, const std::vect return createCompositeInsert(source, target, typeId, channels.front()); Instruction* swizzle = new Instruction(getUniqueId(), typeId, OpVectorShuffle); + assert(isVector(target)); swizzle->addIdOperand(target); - if (accessChain.component != NoResult) - // For dynamic component selection, source does not involve in l-value swizzle - swizzle->addIdOperand(target); - else { - assert(getNumComponents(source) == (int)channels.size()); - assert(isVector(source)); - swizzle->addIdOperand(source); - } + + assert(getNumComponents(source) == (int)channels.size()); + assert(isVector(source)); + swizzle->addIdOperand(source); // Set up an identity shuffle from the base value to the result value unsigned int components[4]; @@ -1402,12 +1497,8 @@ Id Builder::createLvalueSwizzle(Id typeId, Id target, Id source, const std::vect components[i] = i; // Punch in the l-value swizzle - for (int i = 0; i < (int)channels.size(); ++i) { - if (accessChain.component != NoResult) - components[i] = channels[i]; // Only shuffle the base value - else - components[channels[i]] = numTargetComponents + i; - } + for (int i = 0; i < (int)channels.size(); ++i) + components[channels[i]] = numTargetComponents + i; // finish the instruction with these components selectors for (int i = 0; i < numTargetComponents; ++i) @@ -1722,7 +1813,11 @@ Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameter break; } case OpImageQueryLod: +#ifdef AMD_EXTENSIONS + resultType = makeVectorType(getScalarTypeId(getTypeId(parameters.coords)), 2); +#else resultType = makeVectorType(makeFloatType(32), 2); +#endif break; case OpImageQueryLevels: case OpImageQuerySamples: @@ -2199,7 +2294,7 @@ void Builder::accessChainPushSwizzle(std::vector& swizzle, Id preSwizz accessChain.preSwizzleBaseType = preSwizzleBaseType; // if needed, propagate the swizzle for the current access chain - if (accessChain.swizzle.size()) { + if (accessChain.swizzle.size() > 0) { std::vector oldSwizzle = accessChain.swizzle; accessChain.swizzle.resize(0); for (unsigned int i = 0; i < swizzle.size(); ++i) { @@ -2220,34 +2315,28 @@ void Builder::accessChainStore(Id rvalue) transferAccessChainSwizzle(true); Id base = collapseAccessChain(); + Id source = rvalue; + + // dynamic component should be gone + assert(accessChain.component == NoResult); // If swizzle still exists, it is out-of-order or not full, we must load the target vector, // extract and insert elements to perform writeMask and/or swizzle. - Id source = NoResult; - if (accessChain.swizzle.size()) { + if (accessChain.swizzle.size() > 0) { Id tempBaseId = createLoad(base); - source = createLvalueSwizzle(getTypeId(tempBaseId), tempBaseId, rvalue, accessChain.swizzle); - } - - // dynamic component selection - if (accessChain.component != NoResult) { - Id tempBaseId = (source == NoResult) ? createLoad(base) : source; - source = createVectorInsertDynamic(tempBaseId, getTypeId(tempBaseId), rvalue, accessChain.component); + source = createLvalueSwizzle(getTypeId(tempBaseId), tempBaseId, source, accessChain.swizzle); } - if (source == NoResult) - source = rvalue; - createStore(source, base); } // Comments in header -Id Builder::accessChainLoad(Decoration precision, Id resultType) +Id Builder::accessChainLoad(Decoration precision, Decoration nonUniform, Id resultType) { Id id; if (accessChain.isRValue) { - // transfer access chain, but keep it static, so we can stay in registers + // transfer access chain, but try to stay in registers transferAccessChainSwizzle(false); if (accessChain.indexChain.size() > 0) { Id swizzleBase = accessChain.preSwizzleBaseType != NoType ? accessChain.preSwizzleBaseType : resultType; @@ -2288,6 +2377,7 @@ Id Builder::accessChainLoad(Decoration precision, Id resultType) // load through the access chain id = createLoad(collapseAccessChain()); setPrecision(id, precision); + addDecoration(id, nonUniform); } // Done, unless there are swizzles to do @@ -2295,19 +2385,20 @@ Id Builder::accessChainLoad(Decoration precision, Id resultType) return id; // Do remaining swizzling - // First, static swizzling - if (accessChain.swizzle.size()) { - // static swizzle + + // Do the basic swizzle + if (accessChain.swizzle.size() > 0) { Id swizzledType = getScalarTypeId(getTypeId(id)); if (accessChain.swizzle.size() > 1) swizzledType = makeVectorType(swizzledType, (int)accessChain.swizzle.size()); id = createRvalueSwizzle(precision, swizzledType, id, accessChain.swizzle); } - // dynamic single-component selection + // Do the dynamic component if (accessChain.component != NoResult) id = setPrecision(createVectorExtractDynamic(id, resultType, accessChain.component), precision); + addDecoration(id, nonUniform); return id; } @@ -2400,7 +2491,7 @@ void Builder::dump(std::vector& out) const { // Header, before first instructions: out.push_back(MagicNumber); - out.push_back(Version); + out.push_back(spvVersion); out.push_back(builderNumber); out.push_back(uniqueId + 1); out.push_back(0); @@ -2430,7 +2521,6 @@ void Builder::dump(std::vector& out) const // Debug instructions dumpInstructions(out, strings); - dumpModuleProcesses(out); dumpSourceInstructions(out); for (int e = 0; e < (int)sourceExtensions.size(); ++e) { Instruction sourceExtInst(0, 0, OpSourceExtension); @@ -2438,7 +2528,7 @@ void Builder::dump(std::vector& out) const sourceExtInst.dump(out); } dumpInstructions(out, names); - dumpInstructions(out, lines); + dumpModuleProcesses(out); // Annotation instructions dumpInstructions(out, decorations); @@ -2454,26 +2544,66 @@ void Builder::dump(std::vector& out) const // Protected methods. // -// Turn the described access chain in 'accessChain' into an instruction +// Turn the described access chain in 'accessChain' into an instruction(s) // computing its address. This *cannot* include complex swizzles, which must -// be handled after this is called, but it does include swizzles that select -// an individual element, as a single address of a scalar type can be -// computed by an OpAccessChain instruction. +// be handled after this is called. +// +// Can generate code. Id Builder::collapseAccessChain() { assert(accessChain.isRValue == false); - if (accessChain.indexChain.size() > 0) { - if (accessChain.instr == 0) { - StorageClass storageClass = (StorageClass)module.getStorageClass(getTypeId(accessChain.base)); - accessChain.instr = createAccessChain(storageClass, accessChain.base, accessChain.indexChain); - } - + // did we already emit an access chain for this? + if (accessChain.instr != NoResult) return accessChain.instr; - } else + + // If we have a dynamic component, we can still transfer + // that into a final operand to the access chain. We need to remap the + // dynamic component through the swizzle to get a new dynamic component to + // update. + // + // This was not done in transferAccessChainSwizzle() because it might + // generate code. + remapDynamicSwizzle(); + if (accessChain.component != NoResult) { + // transfer the dynamic component to the access chain + accessChain.indexChain.push_back(accessChain.component); + accessChain.component = NoResult; + } + + // note that non-trivial swizzling is left pending + + // do we have an access chain? + if (accessChain.indexChain.size() == 0) return accessChain.base; - // note that non-trivial swizzling is left pending... + // emit the access chain + StorageClass storageClass = (StorageClass)module.getStorageClass(getTypeId(accessChain.base)); + accessChain.instr = createAccessChain(storageClass, accessChain.base, accessChain.indexChain); + + return accessChain.instr; +} + +// For a dynamic component selection of a swizzle. +// +// Turn the swizzle and dynamic component into just a dynamic component. +// +// Generates code. +void Builder::remapDynamicSwizzle() +{ + // do we have a swizzle to remap a dynamic component through? + if (accessChain.component != NoResult && accessChain.swizzle.size() > 1) { + // build a vector of the swizzle for the component to map into + std::vector components; + for (int c = 0; c < (int)accessChain.swizzle.size(); ++c) + components.push_back(makeUintConstant(accessChain.swizzle[c])); + Id mapType = makeVectorType(makeUintType(32), (int)accessChain.swizzle.size()); + Id map = makeCompositeConstant(mapType, components); + + // use it + accessChain.component = createVectorExtractDynamic(map, makeUintType(32), accessChain.component); + accessChain.swizzle.clear(); + } } // clear out swizzle if it is redundant, that is reselecting the same components @@ -2499,38 +2629,30 @@ void Builder::simplifyAccessChainSwizzle() // To the extent any swizzling can become part of the chain // of accesses instead of a post operation, make it so. -// If 'dynamic' is true, include transferring a non-static component index, -// otherwise, only transfer static indexes. +// If 'dynamic' is true, include transferring the dynamic component, +// otherwise, leave it pending. // -// Also, Boolean vectors are likely to be special. While -// for external storage, they should only be integer types, -// function-local bool vectors could use sub-word indexing, -// so keep that as a separate Insert/Extract on a loaded vector. +// Does not generate code. just updates the access chain. void Builder::transferAccessChainSwizzle(bool dynamic) { - // too complex? - if (accessChain.swizzle.size() > 1) - return; - // non existent? if (accessChain.swizzle.size() == 0 && accessChain.component == NoResult) return; - // single component... - - // skip doing it for Boolean vectors - if (isBoolType(getContainedTypeId(accessChain.preSwizzleBaseType))) + // too complex? + // (this requires either a swizzle, or generating code for a dynamic component) + if (accessChain.swizzle.size() > 1) return; + // single component, either in the swizzle and/or dynamic component if (accessChain.swizzle.size() == 1) { - // handle static component + assert(accessChain.component == NoResult); + // handle static component selection accessChain.indexChain.push_back(makeUintConstant(accessChain.swizzle.front())); accessChain.swizzle.clear(); - // note, the only valid remaining dynamic access would be to this one - // component, so don't bother even looking at accessChain.component accessChain.preSwizzleBaseType = NoType; - accessChain.component = NoResult; } else if (dynamic && accessChain.component != NoResult) { + assert(accessChain.swizzle.size() == 0); // handle dynamic component accessChain.indexChain.push_back(accessChain.component); accessChain.preSwizzleBaseType = NoType; @@ -2569,12 +2691,15 @@ void Builder::createSelectionMerge(Block* mergeBlock, unsigned int control) buildPoint->addInstruction(std::unique_ptr(merge)); } -void Builder::createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control) +void Builder::createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control, + unsigned int dependencyLength) { Instruction* merge = new Instruction(OpLoopMerge); merge->addIdOperand(mergeBlock->getId()); merge->addIdOperand(continueBlock->getId()); merge->addImmediateOperand(control); + if ((control & LoopControlDependencyLengthMask) != 0) + merge->addImmediateOperand(dependencyLength); buildPoint->addInstruction(std::unique_ptr(merge)); } @@ -2641,8 +2766,6 @@ void Builder::dumpInstructions(std::vector& out, const std::vector void Builder::dumpModuleProcesses(std::vector& out) const { for (int i = 0; i < (int)moduleProcesses.size(); ++i) { - // TODO: switch this out for the 1.1 headers - const spv::Op OpModuleProcessed = (spv::Op)330; Instruction moduleProcessed(OpModuleProcessed); moduleProcessed.addStringOperand(moduleProcesses[i]); moduleProcessed.dump(out); diff --git a/deps/glslang/SPIRV/SpvBuilder.h b/deps/glslang/SPIRV/SpvBuilder.h index 59b1da2e..099b1d95 100644 --- a/deps/glslang/SPIRV/SpvBuilder.h +++ b/deps/glslang/SPIRV/SpvBuilder.h @@ -1,6 +1,7 @@ // // Copyright (C) 2014-2015 LunarG, Inc. // Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -55,16 +56,19 @@ #include #include #include +#include namespace spv { class Builder { public: - Builder(unsigned int userNumber, SpvBuildLogger* logger); + Builder(unsigned int spvVersion, unsigned int userNumber, SpvBuildLogger* logger); virtual ~Builder(); static const int maxMatrixSize = 4; + unsigned int getSpvVersion() const { return spvVersion; } + void setSource(spv::SourceLanguage lang, int version) { source = lang; @@ -149,7 +153,7 @@ class Builder { bool isAggregate(Id resultId) const { return isAggregateType(getTypeId(resultId)); } bool isSampledImage(Id resultId) const { return isSampledImageType(getTypeId(resultId)); } - bool isBoolType(Id typeId) const { return groupedTypes[OpTypeBool].size() > 0 && typeId == groupedTypes[OpTypeBool].back()->getResultId(); } + bool isBoolType(Id typeId) { return groupedTypes[OpTypeBool].size() > 0 && typeId == groupedTypes[OpTypeBool].back()->getResultId(); } bool isIntType(Id typeId) const { return getTypeClass(typeId) == OpTypeInt && module.getInstruction(typeId)->getImmediateOperand(1) != 0; } bool isUintType(Id typeId) const { return getTypeClass(typeId) == OpTypeInt && module.getInstruction(typeId)->getImmediateOperand(1) == 0; } bool isFloatType(Id typeId) const { return getTypeClass(typeId) == OpTypeFloat; } @@ -211,19 +215,18 @@ class Builder { // For making new constants (will return old constant if the requested one was already made). Id makeBoolConstant(bool b, bool specConstant = false); + Id makeInt8Constant(int i, bool specConstant = false) { return makeIntConstant(makeIntType(8), (unsigned)i, specConstant); } + Id makeUint8Constant(unsigned u, bool specConstant = false) { return makeIntConstant(makeUintType(8), u, specConstant); } + Id makeInt16Constant(int i, bool specConstant = false) { return makeIntConstant(makeIntType(16), (unsigned)i, specConstant); } + Id makeUint16Constant(unsigned u, bool specConstant = false) { return makeIntConstant(makeUintType(16), u, specConstant); } Id makeIntConstant(int i, bool specConstant = false) { return makeIntConstant(makeIntType(32), (unsigned)i, specConstant); } Id makeUintConstant(unsigned u, bool specConstant = false) { return makeIntConstant(makeUintType(32), u, specConstant); } Id makeInt64Constant(long long i, bool specConstant = false) { return makeInt64Constant(makeIntType(64), (unsigned long long)i, specConstant); } Id makeUint64Constant(unsigned long long u, bool specConstant = false) { return makeInt64Constant(makeUintType(64), u, specConstant); } -#ifdef AMD_EXTENSIONS - Id makeInt16Constant(short i, bool specConstant = false) { return makeIntConstant(makeIntType(16), (unsigned)((unsigned short)i), specConstant); } - Id makeUint16Constant(unsigned short u, bool specConstant = false) { return makeIntConstant(makeUintType(16), (unsigned)u, specConstant); } -#endif Id makeFloatConstant(float f, bool specConstant = false); Id makeDoubleConstant(double d, bool specConstant = false); -#ifdef AMD_EXTENSIONS Id makeFloat16Constant(float f16, bool specConstant = false); -#endif + Id makeFpConstant(Id type, double d, bool specConstant = false); // Turn the array of constants into a proper spv constant of the requested type. Id makeCompositeConstant(Id type, const std::vector& comps, bool specConst = false); @@ -234,7 +237,10 @@ class Builder { void addName(Id, const char* name); void addMemberName(Id, int member, const char* name); void addDecoration(Id, Decoration, int num = -1); + void addDecoration(Id, Decoration, const char*); + void addDecorationId(Id id, Decoration, Id idDecoration); void addMemberDecoration(Id, unsigned int member, Decoration, int num = -1); + void addMemberDecoration(Id, unsigned int member, Decoration, const char*); // At the end of what block do the next create*() instructions go? void setBuildPoint(Block* bp) { buildPoint = bp; } @@ -330,7 +336,7 @@ class Builder { // Generally, the type of 'scalar' does not need to be the same type as the components in 'vector'. // The type of the created vector is a vector of components of the same type as the scalar. // - // Note: One of the arguments will change, with the result coming back that way rather than + // Note: One of the arguments will change, with the result coming back that way rather than // through the return value. void promoteScalar(Decoration precision, Id& left, Id& right); @@ -533,19 +539,22 @@ class Builder { // push new swizzle onto the end of any existing swizzle, merging into a single swizzle void accessChainPushSwizzle(std::vector& swizzle, Id preSwizzleBaseType); - // push a variable component selection onto the access chain; supporting only one, so unsided + // push a dynamic component selection onto the access chain, only applicable with a + // non-trivial swizzle or no swizzle void accessChainPushComponent(Id component, Id preSwizzleBaseType) { - accessChain.component = component; - if (accessChain.preSwizzleBaseType == NoType) - accessChain.preSwizzleBaseType = preSwizzleBaseType; + if (accessChain.swizzle.size() != 1) { + accessChain.component = component; + if (accessChain.preSwizzleBaseType == NoType) + accessChain.preSwizzleBaseType = preSwizzleBaseType; + } } // use accessChain and swizzle to store value void accessChainStore(Id rvalue); // use accessChain and swizzle to load an r-value - Id accessChainLoad(Decoration precision, Id ResultType); + Id accessChainLoad(Decoration precision, Decoration nonUniform, Id ResultType); // get the direct pointer for an l-value Id accessChainGetLValue(); @@ -561,7 +570,7 @@ class Builder { void createBranch(Block* block); void createConditionalBranch(Id condition, Block* thenBlock, Block* elseBlock); - void createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control); + void createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control, unsigned int dependencyLength); // Sets to generate opcode for specialization constants. void setToSpecConstCodeGenMode() { generatingOpCodeForSpecConst = true; } @@ -573,10 +582,12 @@ class Builder { protected: Id makeIntConstant(Id typeId, unsigned value, bool specConstant); Id makeInt64Constant(Id typeId, unsigned long long value, bool specConstant); - Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value) const; - Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2) const; - Id findCompositeConstant(Op typeClass, const std::vector& comps) const; + Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value); + Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2); + Id findCompositeConstant(Op typeClass, const std::vector& comps); + Id findStructConstant(Id typeId, const std::vector& comps); Id collapseAccessChain(); + void remapDynamicSwizzle(); void transferAccessChainSwizzle(bool dynamic); void simplifyAccessChainSwizzle(); void createAndSetNoPredecessorBlock(const char*); @@ -585,6 +596,7 @@ class Builder { void dumpInstructions(std::vector&, const std::vector >&) const; void dumpModuleProcesses(std::vector&) const; + unsigned int spvVersion; // the version of SPIR-V to emit in the header SourceLanguage source; int sourceVersion; spv::Id sourceFileStringId; @@ -611,15 +623,15 @@ class Builder { std::vector > entryPoints; std::vector > executionModes; std::vector > names; - std::vector > lines; std::vector > decorations; std::vector > constantsTypesGlobals; std::vector > externals; std::vector > functions; // not output, internally used for quick & dirty canonical (unique) creation - std::vector groupedConstants[OpConstant]; // all types appear before OpConstant - std::vector groupedTypes[OpConstant]; + std::unordered_map> groupedConstants; // map type opcodes to constant inst. + std::unordered_map> groupedStructConstants; // map struct-id to constant instructions + std::unordered_map> groupedTypes; // map type opcodes to type instructions // stack of switches std::stack switchMerges; diff --git a/deps/glslang/SPIRV/disassemble.cpp b/deps/glslang/SPIRV/disassemble.cpp index c950a66a..c07dfc78 100644 --- a/deps/glslang/SPIRV/disassemble.cpp +++ b/deps/glslang/SPIRV/disassemble.cpp @@ -54,6 +54,7 @@ namespace spv { #ifdef AMD_EXTENSIONS #include "GLSL.ext.AMD.h" #endif + #ifdef NV_EXTENSIONS #include "GLSL.ext.NV.h" #endif @@ -80,12 +81,15 @@ static void Kill(std::ostream& out, const char* message) // used to identify the extended instruction library imported when printing enum ExtInstSet { GLSL450Inst, + #ifdef AMD_EXTENSIONS GLSLextAMDInst, #endif + #ifdef NV_EXTENSIONS GLSLextNVInst, #endif + OpenCLExtInst, }; @@ -653,7 +657,6 @@ static const char* GLSLextAMDGetDebugNames(const char* name, unsigned entrypoint } #endif - #ifdef NV_EXTENSIONS static const char* GLSLextNVGetDebugNames(const char* name, unsigned entrypoint) { diff --git a/deps/glslang/SPIRV/doc.cpp b/deps/glslang/SPIRV/doc.cpp index 2fe5d9ce..a9059687 100644 --- a/deps/glslang/SPIRV/doc.cpp +++ b/deps/glslang/SPIRV/doc.cpp @@ -49,6 +49,7 @@ namespace spv { extern "C" { // Include C-based headers that don't have a namespace #include "GLSL.ext.KHR.h" + #include "GLSL.ext.EXT.h" #ifdef AMD_EXTENSIONS #include "GLSL.ext.AMD.h" #endif @@ -65,7 +66,7 @@ namespace spv { // the specification (or their sanitized versions for auto-generating the // spirv headers. // -// Also, the ceilings are declared next to these, to help keep them in sync. +// Also, for masks the ceilings are declared next to these, to help keep them in sync. // Ceilings should be // - one more than the maximum value an enumerant takes on, for non-mask enumerants // (for non-sparse enums, this is the number of enumerants) @@ -73,8 +74,6 @@ namespace spv { // (for non-sparse mask enums, this is the number of enumerants) // -const int SourceLanguageCeiling = 6; // HLSL todo: need official enumerant - const char* SourceString(int source) { switch (source) { @@ -85,13 +84,10 @@ const char* SourceString(int source) case 4: return "OpenCL_CPP"; case 5: return "HLSL"; - case SourceLanguageCeiling: default: return "Bad"; } } -const int ExecutionModelCeiling = 7; - const char* ExecutionModelString(int model) { switch (model) { @@ -103,13 +99,10 @@ const char* ExecutionModelString(int model) case 5: return "GLCompute"; case 6: return "Kernel"; - case ExecutionModelCeiling: default: return "Bad"; } } -const int AddressingModelCeiling = 3; - const char* AddressingString(int addr) { switch (addr) { @@ -117,13 +110,10 @@ const char* AddressingString(int addr) case 1: return "Physical32"; case 2: return "Physical64"; - case AddressingModelCeiling: default: return "Bad"; } } -const int MemoryModelCeiling = 3; - const char* MemoryString(int mem) { switch (mem) { @@ -131,7 +121,6 @@ const char* MemoryString(int mem) case 1: return "GLSL450"; case 2: return "OpenCL"; - case MemoryModelCeiling: default: return "Bad"; } } @@ -181,8 +170,6 @@ const char* ExecutionModeString(int mode) } } -const int StorageClassCeiling = 13; - const char* StorageClassString(int StorageClass) { switch (StorageClass) { @@ -200,7 +187,6 @@ const char* StorageClassString(int StorageClass) case 11: return "Image"; case 12: return "StorageBuffer"; - case StorageClassCeiling: default: return "Bad"; } } @@ -260,19 +246,21 @@ const char* DecorationString(int decoration) default: return "Bad"; #ifdef AMD_EXTENSIONS - case 4999: return "ExplicitInterpAMD"; + case DecorationExplicitInterpAMD: return "ExplicitInterpAMD"; #endif #ifdef NV_EXTENSIONS - case 5248: return "OverrideCoverageNV"; - case 5250: return "PassthroughNV"; - case 5252: return "ViewportRelativeNV"; - case 5256: return "SecondaryViewportRelativeNV"; + case DecorationOverrideCoverageNV: return "OverrideCoverageNV"; + case DecorationPassthroughNV: return "PassthroughNV"; + case DecorationViewportRelativeNV: return "ViewportRelativeNV"; + case DecorationSecondaryViewportRelativeNV: return "SecondaryViewportRelativeNV"; #endif + + case DecorationNonUniformEXT: return "DecorationNonUniformEXT"; + case DecorationHlslCounterBufferGOOGLE: return "DecorationHlslCounterBufferGOOGLE"; + case DecorationHlslSemanticGOOGLE: return "DecorationHlslSemanticGOOGLE"; } } -const int BuiltInCeiling = 44; - const char* BuiltInString(int builtIn) { switch (builtIn) { @@ -351,13 +339,12 @@ const char* BuiltInString(int builtIn) case 5262: return "ViewportMaskPerViewNV"; #endif - case BuiltInCeiling: + case 5264: return "FullyCoveredEXT"; + default: return "Bad"; } } -const int DimensionCeiling = 7; - const char* DimensionString(int dim) { switch (dim) { @@ -369,13 +356,10 @@ const char* DimensionString(int dim) case 5: return "Buffer"; case 6: return "SubpassData"; - case DimensionCeiling: default: return "Bad"; } } -const int SamplerAddressingModeCeiling = 5; - const char* SamplerAddressingModeString(int mode) { switch (mode) { @@ -385,26 +369,20 @@ const char* SamplerAddressingModeString(int mode) case 3: return "Repeat"; case 4: return "RepeatMirrored"; - case SamplerAddressingModeCeiling: default: return "Bad"; } } -const int SamplerFilterModeCeiling = 2; - const char* SamplerFilterModeString(int mode) { switch (mode) { case 0: return "Nearest"; case 1: return "Linear"; - case SamplerFilterModeCeiling: default: return "Bad"; } } -const int ImageFormatCeiling = 40; - const char* ImageFormatString(int format) { switch (format) { @@ -461,14 +439,11 @@ const char* ImageFormatString(int format) case 38: return "R16ui"; case 39: return "R8ui"; - case ImageFormatCeiling: default: return "Bad"; } } -const int ImageChannelOrderCeiling = 19; - const char* ImageChannelOrderString(int format) { switch (format) { @@ -492,14 +467,11 @@ const char* ImageChannelOrderString(int format) case 17: return "sRGBA"; case 18: return "sBGRA"; - case ImageChannelOrderCeiling: default: return "Bad"; } } -const int ImageChannelDataTypeCeiling = 17; - const char* ImageChannelDataTypeString(int type) { switch (type) @@ -522,7 +494,6 @@ const char* ImageChannelDataTypeString(int type) case 15: return "UnormInt24"; case 16: return "UnormInt101010_2"; - case ImageChannelDataTypeCeiling: default: return "Bad"; } @@ -548,8 +519,6 @@ const char* ImageOperandsString(int format) } } -const int FPFastMathCeiling = 5; - const char* FPFastMathString(int mode) { switch (mode) { @@ -559,13 +528,10 @@ const char* FPFastMathString(int mode) case 3: return "AllowRecip"; case 4: return "Fast"; - case FPFastMathCeiling: default: return "Bad"; } } -const int FPRoundingModeCeiling = 4; - const char* FPRoundingModeString(int mode) { switch (mode) { @@ -574,26 +540,20 @@ const char* FPRoundingModeString(int mode) case 2: return "RTP"; case 3: return "RTN"; - case FPRoundingModeCeiling: default: return "Bad"; } } -const int LinkageTypeCeiling = 2; - const char* LinkageTypeString(int type) { switch (type) { case 0: return "Export"; case 1: return "Import"; - case LinkageTypeCeiling: default: return "Bad"; } } -const int FuncParamAttrCeiling = 8; - const char* FuncParamAttrString(int attr) { switch (attr) { @@ -606,13 +566,10 @@ const char* FuncParamAttrString(int attr) case 6: return "NoWrite"; case 7: return "NoReadWrite"; - case FuncParamAttrCeiling: default: return "Bad"; } } -const int AccessQualifierCeiling = 3; - const char* AccessQualifierString(int attr) { switch (attr) { @@ -620,7 +577,6 @@ const char* AccessQualifierString(int attr) case 1: return "WriteOnly"; case 2: return "ReadWrite"; - case AccessQualifierCeiling: default: return "Bad"; } } @@ -668,8 +624,6 @@ const char* FunctionControlString(int cont) } } -const int MemorySemanticsCeiling = 12; - const char* MemorySemanticsString(int mem) { // Note: No bits set (None) means "Relaxed" @@ -687,13 +641,10 @@ const char* MemorySemanticsString(int mem) case 10: return "AtomicCounterMemory"; case 11: return "ImageMemory"; - case MemorySemanticsCeiling: default: return "Bad"; } } -const int MemoryAccessCeiling = 3; - const char* MemoryAccessString(int mem) { switch (mem) { @@ -701,13 +652,10 @@ const char* MemoryAccessString(int mem) case 1: return "Aligned"; case 2: return "Nontemporal"; - case MemoryAccessCeiling: default: return "Bad"; } } -const int ScopeCeiling = 5; - const char* ScopeString(int mem) { switch (mem) { @@ -717,29 +665,29 @@ const char* ScopeString(int mem) case 3: return "Subgroup"; case 4: return "Invocation"; - case ScopeCeiling: default: return "Bad"; } } -const int GroupOperationCeiling = 3; - const char* GroupOperationString(int gop) { switch (gop) { - case 0: return "Reduce"; - case 1: return "InclusiveScan"; - case 2: return "ExclusiveScan"; + case GroupOperationReduce: return "Reduce"; + case GroupOperationInclusiveScan: return "InclusiveScan"; + case GroupOperationExclusiveScan: return "ExclusiveScan"; + case GroupOperationClusteredReduce: return "ClusteredReduce"; +#ifdef NV_EXTENSIONS + case GroupOperationPartitionedReduceNV: return "PartitionedReduceNV"; + case GroupOperationPartitionedInclusiveScanNV: return "PartitionedInclusiveScanNV"; + case GroupOperationPartitionedExclusiveScanNV: return "PartitionedExclusiveScanNV"; +#endif - case GroupOperationCeiling: default: return "Bad"; } } -const int KernelEnqueueFlagsCeiling = 3; - const char* KernelEnqueueFlagsString(int flag) { switch (flag) @@ -748,26 +696,20 @@ const char* KernelEnqueueFlagsString(int flag) case 1: return "WaitKernel"; case 2: return "WaitWorkGroup"; - case KernelEnqueueFlagsCeiling: default: return "Bad"; } } -const int KernelProfilingInfoCeiling = 1; - const char* KernelProfilingInfoString(int info) { switch (info) { case 0: return "CmdExecTime"; - case KernelProfilingInfoCeiling: default: return "Bad"; } } -const int CapabilityCeiling = 58; - const char* CapabilityString(int info) { switch (info) @@ -830,38 +772,63 @@ const char* CapabilityString(int info) case 55: return "StorageImageReadWithoutFormat"; case 56: return "StorageImageWriteWithoutFormat"; case 57: return "MultiViewport"; + case 61: return "GroupNonUniform"; + case 62: return "GroupNonUniformVote"; + case 63: return "GroupNonUniformArithmetic"; + case 64: return "GroupNonUniformBallot"; + case 65: return "GroupNonUniformShuffle"; + case 66: return "GroupNonUniformShuffleRelative"; + case 67: return "GroupNonUniformClustered"; + case 68: return "GroupNonUniformQuad"; - case 4423: return "SubgroupBallotKHR"; - case 4427: return "DrawParameters"; - case 4431: return "SubgroupVoteKHR"; + case CapabilitySubgroupBallotKHR: return "SubgroupBallotKHR"; + case CapabilityDrawParameters: return "DrawParameters"; + case CapabilitySubgroupVoteKHR: return "SubgroupVoteKHR"; - case 4433: return "StorageUniformBufferBlock16"; - case 4434: return "StorageUniform16"; - case 4435: return "StoragePushConstant16"; - case 4436: return "StorageInputOutput16"; + case CapabilityStorageUniformBufferBlock16: return "StorageUniformBufferBlock16"; + case CapabilityStorageUniform16: return "StorageUniform16"; + case CapabilityStoragePushConstant16: return "StoragePushConstant16"; + case CapabilityStorageInputOutput16: return "StorageInputOutput16"; - case 4437: return "DeviceGroup"; - case 4439: return "MultiView"; + case CapabilityDeviceGroup: return "DeviceGroup"; + case CapabilityMultiView: return "MultiView"; - case 5013: return "StencilExportEXT"; + case CapabilityStencilExportEXT: return "StencilExportEXT"; #ifdef AMD_EXTENSIONS - case 5009: return "ImageGatherBiasLodAMD"; - case 5015: return "ImageReadWriteLodAMD"; + case CapabilityFloat16ImageAMD: return "Float16ImageAMD"; + case CapabilityImageGatherBiasLodAMD: return "ImageGatherBiasLodAMD"; + case CapabilityFragmentMaskAMD: return "FragmentMaskAMD"; + case CapabilityImageReadWriteLodAMD: return "ImageReadWriteLodAMD"; #endif - case 4445: return "AtomicStorageOps"; + case CapabilityAtomicStorageOps: return "AtomicStorageOps"; - case 4447: return "SampleMaskPostDepthCoverage"; + case CapabilitySampleMaskPostDepthCoverage: return "SampleMaskPostDepthCoverage"; #ifdef NV_EXTENSIONS - case 5251: return "GeometryShaderPassthroughNV"; - case 5254: return "ShaderViewportIndexLayerNV"; - case 5255: return "ShaderViewportMaskNV"; - case 5259: return "ShaderStereoViewNV"; - case 5260: return "PerViewAttributesNV"; + case CapabilityGeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV"; + case CapabilityShaderViewportIndexLayerNV: return "ShaderViewportIndexLayerNV"; + case CapabilityShaderViewportMaskNV: return "ShaderViewportMaskNV"; + case CapabilityShaderStereoViewNV: return "ShaderStereoViewNV"; + case CapabilityPerViewAttributesNV: return "PerViewAttributesNV"; + case CapabilityGroupNonUniformPartitionedNV: return "GroupNonUniformPartitionedNV"; #endif - case CapabilityCeiling: + case CapabilityFragmentFullyCoveredEXT: return "FragmentFullyCoveredEXT"; + + case CapabilityShaderNonUniformEXT: return "CapabilityShaderNonUniformEXT"; + case CapabilityRuntimeDescriptorArrayEXT: return "CapabilityRuntimeDescriptorArrayEXT"; + case CapabilityInputAttachmentArrayDynamicIndexingEXT: return "CapabilityInputAttachmentArrayDynamicIndexingEXT"; + case CapabilityUniformTexelBufferArrayDynamicIndexingEXT: return "CapabilityUniformTexelBufferArrayDynamicIndexingEXT"; + case CapabilityStorageTexelBufferArrayDynamicIndexingEXT: return "CapabilityStorageTexelBufferArrayDynamicIndexingEXT"; + case CapabilityUniformBufferArrayNonUniformIndexingEXT: return "CapabilityUniformBufferArrayNonUniformIndexingEXT"; + case CapabilitySampledImageArrayNonUniformIndexingEXT: return "CapabilitySampledImageArrayNonUniformIndexingEXT"; + case CapabilityStorageBufferArrayNonUniformIndexingEXT: return "CapabilityStorageBufferArrayNonUniformIndexingEXT"; + case CapabilityStorageImageArrayNonUniformIndexingEXT: return "CapabilityStorageImageArrayNonUniformIndexingEXT"; + case CapabilityInputAttachmentArrayNonUniformIndexingEXT: return "CapabilityInputAttachmentArrayNonUniformIndexingEXT"; + case CapabilityUniformTexelBufferArrayNonUniformIndexingEXT: return "CapabilityUniformTexelBufferArrayNonUniformIndexingEXT"; + case CapabilityStorageTexelBufferArrayNonUniformIndexingEXT: return "CapabilityStorageTexelBufferArrayNonUniformIndexingEXT"; + default: return "Bad"; } } @@ -1191,6 +1158,44 @@ const char* OpcodeString(int op) case 319: return "OpAtomicFlagClear"; case 320: return "OpImageSparseRead"; + case OpModuleProcessed: return "OpModuleProcessed"; + case OpDecorateId: return "OpDecorateId"; + + case 333: return "OpGroupNonUniformElect"; + case 334: return "OpGroupNonUniformAll"; + case 335: return "OpGroupNonUniformAny"; + case 336: return "OpGroupNonUniformAllEqual"; + case 337: return "OpGroupNonUniformBroadcast"; + case 338: return "OpGroupNonUniformBroadcastFirst"; + case 339: return "OpGroupNonUniformBallot"; + case 340: return "OpGroupNonUniformInverseBallot"; + case 341: return "OpGroupNonUniformBallotBitExtract"; + case 342: return "OpGroupNonUniformBallotBitCount"; + case 343: return "OpGroupNonUniformBallotFindLSB"; + case 344: return "OpGroupNonUniformBallotFindMSB"; + case 345: return "OpGroupNonUniformShuffle"; + case 346: return "OpGroupNonUniformShuffleXor"; + case 347: return "OpGroupNonUniformShuffleUp"; + case 348: return "OpGroupNonUniformShuffleDown"; + case 349: return "OpGroupNonUniformIAdd"; + case 350: return "OpGroupNonUniformFAdd"; + case 351: return "OpGroupNonUniformIMul"; + case 352: return "OpGroupNonUniformFMul"; + case 353: return "OpGroupNonUniformSMin"; + case 354: return "OpGroupNonUniformUMin"; + case 355: return "OpGroupNonUniformFMin"; + case 356: return "OpGroupNonUniformSMax"; + case 357: return "OpGroupNonUniformUMax"; + case 358: return "OpGroupNonUniformFMax"; + case 359: return "OpGroupNonUniformBitwiseAnd"; + case 360: return "OpGroupNonUniformBitwiseOr"; + case 361: return "OpGroupNonUniformBitwiseXor"; + case 362: return "OpGroupNonUniformLogicalAnd"; + case 363: return "OpGroupNonUniformLogicalOr"; + case 364: return "OpGroupNonUniformLogicalXor"; + case 365: return "OpGroupNonUniformQuadBroadcast"; + case 366: return "OpGroupNonUniformQuadSwap"; + case 4421: return "OpSubgroupBallotKHR"; case 4422: return "OpSubgroupFirstInvocationKHR"; case 4428: return "OpSubgroupAllKHR"; @@ -1207,9 +1212,17 @@ const char* OpcodeString(int op) case 5005: return "OpGroupFMaxNonUniformAMD"; case 5006: return "OpGroupUMaxNonUniformAMD"; case 5007: return "OpGroupSMaxNonUniformAMD"; + + case 5011: return "OpFragmentMaskFetchAMD"; + case 5012: return "OpFragmentFetchAMD"; #endif - case OpcodeCeiling: + case OpDecorateStringGOOGLE: return "OpDecorateStringGOOGLE"; + case OpMemberDecorateStringGOOGLE: return "OpMemberDecorateStringGOOGLE"; + +#ifdef NV_EXTENSIONS + case OpGroupNonUniformPartitionNV: return "OpGroupNonUniformPartitionNV"; +#endif default: return "Bad"; } @@ -1222,35 +1235,12 @@ OperandParameters ExecutionModeOperands[ExecutionModeCeiling]; OperandParameters DecorationOperands[DecorationCeiling]; EnumDefinition OperandClassParams[OperandCount]; -EnumParameters ExecutionModelParams[ExecutionModelCeiling]; -EnumParameters AddressingParams[AddressingModelCeiling]; -EnumParameters MemoryParams[MemoryModelCeiling]; EnumParameters ExecutionModeParams[ExecutionModeCeiling]; -EnumParameters StorageParams[StorageClassCeiling]; -EnumParameters SamplerAddressingModeParams[SamplerAddressingModeCeiling]; -EnumParameters SamplerFilterModeParams[SamplerFilterModeCeiling]; -EnumParameters ImageFormatParams[ImageFormatCeiling]; -EnumParameters ImageChannelOrderParams[ImageChannelOrderCeiling]; -EnumParameters ImageChannelDataTypeParams[ImageChannelDataTypeCeiling]; EnumParameters ImageOperandsParams[ImageOperandsCeiling]; -EnumParameters FPFastMathParams[FPFastMathCeiling]; -EnumParameters FPRoundingModeParams[FPRoundingModeCeiling]; -EnumParameters LinkageTypeParams[LinkageTypeCeiling]; EnumParameters DecorationParams[DecorationCeiling]; -EnumParameters BuiltInParams[BuiltInCeiling]; -EnumParameters DimensionalityParams[DimensionCeiling]; -EnumParameters FuncParamAttrParams[FuncParamAttrCeiling]; -EnumParameters AccessQualifierParams[AccessQualifierCeiling]; -EnumParameters GroupOperationParams[GroupOperationCeiling]; EnumParameters LoopControlParams[FunctionControlCeiling]; EnumParameters SelectionControlParams[SelectControlCeiling]; EnumParameters FunctionControlParams[FunctionControlCeiling]; -EnumParameters MemorySemanticsParams[MemorySemanticsCeiling]; -EnumParameters MemoryAccessParams[MemoryAccessCeiling]; -EnumParameters ScopeParams[ScopeCeiling]; -EnumParameters KernelEnqueueFlagsParams[KernelEnqueueFlagsCeiling]; -EnumParameters KernelProfilingInfoParams[KernelProfilingInfoCeiling]; -EnumParameters CapabilityParams[CapabilityCeiling]; // Set up all the parameterizing descriptions of the opcodes, operands, etc. void Parameterize() @@ -1300,7 +1290,10 @@ void Parameterize() InstructionDesc[OpImageWrite].setResultAndType(false, false); InstructionDesc[OpDecorationGroup].setResultAndType(true, false); InstructionDesc[OpDecorate].setResultAndType(false, false); + InstructionDesc[OpDecorateId].setResultAndType(false, false); + InstructionDesc[OpDecorateStringGOOGLE].setResultAndType(false, false); InstructionDesc[OpMemberDecorate].setResultAndType(false, false); + InstructionDesc[OpMemberDecorateStringGOOGLE].setResultAndType(false, false); InstructionDesc[OpGroupDecorate].setResultAndType(false, false); InstructionDesc[OpGroupMemberDecorate].setResultAndType(false, false); InstructionDesc[OpName].setResultAndType(false, false); @@ -1339,6 +1332,7 @@ void Parameterize() InstructionDesc[OpReleaseEvent].setResultAndType(false, false); InstructionDesc[OpGroupWaitEvents].setResultAndType(false, false); InstructionDesc[OpAtomicFlagClear].setResultAndType(false, false); + InstructionDesc[OpModuleProcessed].setResultAndType(false, false); // Specific additional context-dependent operands @@ -1376,354 +1370,39 @@ void Parameterize() DecorationOperands[DecorationInputAttachmentIndex].push(OperandLiteralNumber, "'Attachment Index'"); DecorationOperands[DecorationAlignment].push(OperandLiteralNumber, "'Alignment'"); - OperandClassParams[OperandSource].set(SourceLanguageCeiling, SourceString, 0); - OperandClassParams[OperandExecutionModel].set(ExecutionModelCeiling, ExecutionModelString, ExecutionModelParams); - OperandClassParams[OperandAddressing].set(AddressingModelCeiling, AddressingString, AddressingParams); - OperandClassParams[OperandMemory].set(MemoryModelCeiling, MemoryString, MemoryParams); + OperandClassParams[OperandSource].set(0, SourceString, 0); + OperandClassParams[OperandExecutionModel].set(0, ExecutionModelString, nullptr); + OperandClassParams[OperandAddressing].set(0, AddressingString, nullptr); + OperandClassParams[OperandMemory].set(0, MemoryString, nullptr); OperandClassParams[OperandExecutionMode].set(ExecutionModeCeiling, ExecutionModeString, ExecutionModeParams); OperandClassParams[OperandExecutionMode].setOperands(ExecutionModeOperands); - OperandClassParams[OperandStorage].set(StorageClassCeiling, StorageClassString, StorageParams); - OperandClassParams[OperandDimensionality].set(DimensionCeiling, DimensionString, DimensionalityParams); - OperandClassParams[OperandSamplerAddressingMode].set(SamplerAddressingModeCeiling, SamplerAddressingModeString, SamplerAddressingModeParams); - OperandClassParams[OperandSamplerFilterMode].set(SamplerFilterModeCeiling, SamplerFilterModeString, SamplerFilterModeParams); - OperandClassParams[OperandSamplerImageFormat].set(ImageFormatCeiling, ImageFormatString, ImageFormatParams); - OperandClassParams[OperandImageChannelOrder].set(ImageChannelOrderCeiling, ImageChannelOrderString, ImageChannelOrderParams); - OperandClassParams[OperandImageChannelDataType].set(ImageChannelDataTypeCeiling, ImageChannelDataTypeString, ImageChannelDataTypeParams); + OperandClassParams[OperandStorage].set(0, StorageClassString, nullptr); + OperandClassParams[OperandDimensionality].set(0, DimensionString, nullptr); + OperandClassParams[OperandSamplerAddressingMode].set(0, SamplerAddressingModeString, nullptr); + OperandClassParams[OperandSamplerFilterMode].set(0, SamplerFilterModeString, nullptr); + OperandClassParams[OperandSamplerImageFormat].set(0, ImageFormatString, nullptr); + OperandClassParams[OperandImageChannelOrder].set(0, ImageChannelOrderString, nullptr); + OperandClassParams[OperandImageChannelDataType].set(0, ImageChannelDataTypeString, nullptr); OperandClassParams[OperandImageOperands].set(ImageOperandsCeiling, ImageOperandsString, ImageOperandsParams, true); - OperandClassParams[OperandFPFastMath].set(FPFastMathCeiling, FPFastMathString, FPFastMathParams, true); - OperandClassParams[OperandFPRoundingMode].set(FPRoundingModeCeiling, FPRoundingModeString, FPRoundingModeParams); - OperandClassParams[OperandLinkageType].set(LinkageTypeCeiling, LinkageTypeString, LinkageTypeParams); - OperandClassParams[OperandFuncParamAttr].set(FuncParamAttrCeiling, FuncParamAttrString, FuncParamAttrParams); - OperandClassParams[OperandAccessQualifier].set(AccessQualifierCeiling, AccessQualifierString, AccessQualifierParams); + OperandClassParams[OperandFPFastMath].set(0, FPFastMathString, nullptr, true); + OperandClassParams[OperandFPRoundingMode].set(0, FPRoundingModeString, nullptr); + OperandClassParams[OperandLinkageType].set(0, LinkageTypeString, nullptr); + OperandClassParams[OperandFuncParamAttr].set(0, FuncParamAttrString, nullptr); + OperandClassParams[OperandAccessQualifier].set(0, AccessQualifierString, nullptr); OperandClassParams[OperandDecoration].set(DecorationCeiling, DecorationString, DecorationParams); OperandClassParams[OperandDecoration].setOperands(DecorationOperands); - OperandClassParams[OperandBuiltIn].set(BuiltInCeiling, BuiltInString, BuiltInParams); + OperandClassParams[OperandBuiltIn].set(0, BuiltInString, nullptr); OperandClassParams[OperandSelect].set(SelectControlCeiling, SelectControlString, SelectionControlParams, true); OperandClassParams[OperandLoop].set(LoopControlCeiling, LoopControlString, LoopControlParams, true); OperandClassParams[OperandFunction].set(FunctionControlCeiling, FunctionControlString, FunctionControlParams, true); - OperandClassParams[OperandMemorySemantics].set(MemorySemanticsCeiling, MemorySemanticsString, MemorySemanticsParams, true); - OperandClassParams[OperandMemoryAccess].set(MemoryAccessCeiling, MemoryAccessString, MemoryAccessParams, true); - OperandClassParams[OperandScope].set(ScopeCeiling, ScopeString, ScopeParams); - OperandClassParams[OperandGroupOperation].set(GroupOperationCeiling, GroupOperationString, GroupOperationParams); - OperandClassParams[OperandKernelEnqueueFlags].set(KernelEnqueueFlagsCeiling, KernelEnqueueFlagsString, KernelEnqueueFlagsParams); - OperandClassParams[OperandKernelProfilingInfo].set(KernelProfilingInfoCeiling, KernelProfilingInfoString, KernelProfilingInfoParams, true); - OperandClassParams[OperandCapability].set(CapabilityCeiling, CapabilityString, CapabilityParams); - OperandClassParams[OperandOpcode].set(OpcodeCeiling, OpcodeString, 0); - - CapabilityParams[CapabilityShader].caps.push_back(CapabilityMatrix); - CapabilityParams[CapabilityGeometry].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityTessellation].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityVector16].caps.push_back(CapabilityKernel); - CapabilityParams[CapabilityFloat16Buffer].caps.push_back(CapabilityKernel); - CapabilityParams[CapabilityInt64Atomics].caps.push_back(CapabilityInt64); - CapabilityParams[CapabilityImageBasic].caps.push_back(CapabilityKernel); - CapabilityParams[CapabilityImageReadWrite].caps.push_back(CapabilityImageBasic); - CapabilityParams[CapabilityImageMipmap].caps.push_back(CapabilityImageBasic); - CapabilityParams[CapabilityPipes].caps.push_back(CapabilityKernel); - CapabilityParams[CapabilityDeviceEnqueue].caps.push_back(CapabilityKernel); - CapabilityParams[CapabilityLiteralSampler].caps.push_back(CapabilityKernel); - CapabilityParams[CapabilityAtomicStorage].caps.push_back(CapabilityShader); - CapabilityParams[CapabilitySampleRateShading].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityTessellationPointSize].caps.push_back(CapabilityTessellation); - CapabilityParams[CapabilityGeometryPointSize].caps.push_back(CapabilityGeometry); - CapabilityParams[CapabilityImageGatherExtended].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityStorageImageExtendedFormats].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityStorageImageMultisample].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityUniformBufferArrayDynamicIndexing].caps.push_back(CapabilityShader); - CapabilityParams[CapabilitySampledImageArrayDynamicIndexing].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityStorageBufferArrayDynamicIndexing].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityStorageImageArrayDynamicIndexing].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityClipDistance].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityCullDistance].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityGenericPointer].caps.push_back(CapabilityAddresses); - CapabilityParams[CapabilityInt8].caps.push_back(CapabilityKernel); - CapabilityParams[CapabilityInputAttachment].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityMinLod].caps.push_back(CapabilityShader); - CapabilityParams[CapabilitySparseResidency].caps.push_back(CapabilityShader); - CapabilityParams[CapabilitySampled1D].caps.push_back(CapabilityShader); - CapabilityParams[CapabilitySampledRect].caps.push_back(CapabilityShader); - CapabilityParams[CapabilitySampledBuffer].caps.push_back(CapabilityShader); - CapabilityParams[CapabilitySampledCubeArray].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityImageMSArray].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityImage1D].caps.push_back(CapabilitySampled1D); - CapabilityParams[CapabilityImageRect].caps.push_back(CapabilitySampledRect); - CapabilityParams[CapabilityImageBuffer].caps.push_back(CapabilitySampledBuffer); - CapabilityParams[CapabilityImageCubeArray].caps.push_back(CapabilitySampledCubeArray); - CapabilityParams[CapabilityImageQuery].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityDerivativeControl].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityInterpolationFunction].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityTransformFeedback].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityGeometryStreams].caps.push_back(CapabilityGeometry); - CapabilityParams[CapabilityStorageImageReadWithoutFormat].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityStorageImageWriteWithoutFormat].caps.push_back(CapabilityShader); - CapabilityParams[CapabilityMultiViewport].caps.push_back(CapabilityGeometry); - - AddressingParams[AddressingModelPhysical32].caps.push_back(CapabilityAddresses); - AddressingParams[AddressingModelPhysical64].caps.push_back(CapabilityAddresses); - - MemoryParams[MemoryModelSimple].caps.push_back(CapabilityShader); - MemoryParams[MemoryModelGLSL450].caps.push_back(CapabilityShader); - MemoryParams[MemoryModelOpenCL].caps.push_back(CapabilityKernel); - - MemorySemanticsParams[MemorySemanticsUniformMemoryShift].caps.push_back(CapabilityShader); - MemorySemanticsParams[MemorySemanticsAtomicCounterMemoryShift].caps.push_back(CapabilityAtomicStorage); - - ExecutionModelParams[ExecutionModelVertex].caps.push_back(CapabilityShader); - ExecutionModelParams[ExecutionModelTessellationControl].caps.push_back(CapabilityTessellation); - ExecutionModelParams[ExecutionModelTessellationEvaluation].caps.push_back(CapabilityTessellation); - ExecutionModelParams[ExecutionModelGeometry].caps.push_back(CapabilityGeometry); - ExecutionModelParams[ExecutionModelFragment].caps.push_back(CapabilityShader); - ExecutionModelParams[ExecutionModelGLCompute].caps.push_back(CapabilityShader); - ExecutionModelParams[ExecutionModelKernel].caps.push_back(CapabilityKernel); - - // Storage capabilites - StorageParams[StorageClassInput].caps.push_back(CapabilityShader); - StorageParams[StorageClassUniform].caps.push_back(CapabilityShader); - StorageParams[StorageClassOutput].caps.push_back(CapabilityShader); - StorageParams[StorageClassPrivate].caps.push_back(CapabilityShader); - StorageParams[StorageClassGeneric].caps.push_back(CapabilityKernel); - StorageParams[StorageClassAtomicCounter].caps.push_back(CapabilityAtomicStorage); - StorageParams[StorageClassPushConstant].caps.push_back(CapabilityShader); - - // Sampler Filter & Addressing mode capabilities - SamplerAddressingModeParams[SamplerAddressingModeNone].caps.push_back(CapabilityKernel); - SamplerAddressingModeParams[SamplerAddressingModeClampToEdge].caps.push_back(CapabilityKernel); - SamplerAddressingModeParams[SamplerAddressingModeClamp].caps.push_back(CapabilityKernel); - SamplerAddressingModeParams[SamplerAddressingModeRepeat].caps.push_back(CapabilityKernel); - SamplerAddressingModeParams[SamplerAddressingModeRepeatMirrored].caps.push_back(CapabilityKernel); - - SamplerFilterModeParams[SamplerFilterModeNearest].caps.push_back(CapabilityKernel); - SamplerFilterModeParams[SamplerFilterModeLinear].caps.push_back(CapabilityKernel); - - // image format capabilities - - // ES/Desktop float - ImageFormatParams[ImageFormatRgba32f].caps.push_back(CapabilityShader); - ImageFormatParams[ImageFormatRgba16f].caps.push_back(CapabilityShader); - ImageFormatParams[ImageFormatR32f].caps.push_back(CapabilityShader); - ImageFormatParams[ImageFormatRgba8].caps.push_back(CapabilityShader); - ImageFormatParams[ImageFormatRgba8Snorm].caps.push_back(CapabilityShader); - - // Desktop float - ImageFormatParams[ImageFormatRg32f].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRg16f].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatR11fG11fB10f].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatR16f].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRgba16].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRgb10A2].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRg16].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRg8].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatR16].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatR8].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRgba16Snorm].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRg16Snorm].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRg8Snorm].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatR16Snorm].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatR8Snorm].caps.push_back(CapabilityStorageImageExtendedFormats); - - // ES/Desktop int - ImageFormatParams[ImageFormatRgba32i].caps.push_back(CapabilityShader); - ImageFormatParams[ImageFormatRgba16i].caps.push_back(CapabilityShader); - ImageFormatParams[ImageFormatRgba8i].caps.push_back(CapabilityShader); - ImageFormatParams[ImageFormatR32i].caps.push_back(CapabilityShader); - - // Desktop int - ImageFormatParams[ImageFormatRg32i].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRg16i].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRg8i].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatR16i].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatR8i].caps.push_back(CapabilityStorageImageExtendedFormats); - - // ES/Desktop uint - ImageFormatParams[ImageFormatRgba32ui].caps.push_back(CapabilityShader); - ImageFormatParams[ImageFormatRgba16ui].caps.push_back(CapabilityShader); - ImageFormatParams[ImageFormatRgba8ui].caps.push_back(CapabilityShader); - ImageFormatParams[ImageFormatR32ui].caps.push_back(CapabilityShader); - - // Desktop uint - ImageFormatParams[ImageFormatRgb10a2ui].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRg32ui].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRg16ui].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatRg8ui].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatR16ui].caps.push_back(CapabilityStorageImageExtendedFormats); - ImageFormatParams[ImageFormatR8ui].caps.push_back(CapabilityStorageImageExtendedFormats); - - // image channel order capabilities - for (int i = 0; i < ImageChannelOrderCeiling; ++i) { - ImageChannelOrderParams[i].caps.push_back(CapabilityKernel); - } - - // image channel type capabilities - for (int i = 0; i < ImageChannelDataTypeCeiling; ++i) { - ImageChannelDataTypeParams[i].caps.push_back(CapabilityKernel); - } - - // image lookup operands - ImageOperandsParams[ImageOperandsBiasShift].caps.push_back(CapabilityShader); - ImageOperandsParams[ImageOperandsOffsetShift].caps.push_back(CapabilityImageGatherExtended); - ImageOperandsParams[ImageOperandsMinLodShift].caps.push_back(CapabilityMinLod); - - // fast math flags capabilities - for (int i = 0; i < FPFastMathCeiling; ++i) { - FPFastMathParams[i].caps.push_back(CapabilityKernel); - } - - // fp rounding mode capabilities - for (int i = 0; i < FPRoundingModeCeiling; ++i) { - FPRoundingModeParams[i].caps.push_back(CapabilityKernel); - } - - // linkage types - for (int i = 0; i < LinkageTypeCeiling; ++i) { - LinkageTypeParams[i].caps.push_back(CapabilityLinkage); - } - - // function argument types - for (int i = 0; i < FuncParamAttrCeiling; ++i) { - FuncParamAttrParams[i].caps.push_back(CapabilityKernel); - } - - // function argument types - for (int i = 0; i < AccessQualifierCeiling; ++i) { - AccessQualifierParams[i].caps.push_back(CapabilityKernel); - } - - ExecutionModeParams[ExecutionModeInvocations].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeSpacingEqual].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModeSpacingFractionalEven].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModeSpacingFractionalOdd].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModeVertexOrderCw].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModeVertexOrderCcw].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModePixelCenterInteger].caps.push_back(CapabilityShader); - ExecutionModeParams[ExecutionModeOriginUpperLeft].caps.push_back(CapabilityShader); - ExecutionModeParams[ExecutionModeOriginLowerLeft].caps.push_back(CapabilityShader); - ExecutionModeParams[ExecutionModeEarlyFragmentTests].caps.push_back(CapabilityShader); - ExecutionModeParams[ExecutionModePointMode].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModeXfb].caps.push_back(CapabilityTransformFeedback); - ExecutionModeParams[ExecutionModeDepthReplacing].caps.push_back(CapabilityShader); - ExecutionModeParams[ExecutionModeDepthGreater].caps.push_back(CapabilityShader); - ExecutionModeParams[ExecutionModeDepthLess].caps.push_back(CapabilityShader); - ExecutionModeParams[ExecutionModeDepthUnchanged].caps.push_back(CapabilityShader); - ExecutionModeParams[ExecutionModeLocalSizeHint].caps.push_back(CapabilityKernel); - ExecutionModeParams[ExecutionModeInputPoints].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeInputLines].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeInputLinesAdjacency].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeTriangles].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeTriangles].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModeInputTrianglesAdjacency].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeQuads].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModeIsolines].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModeOutputVertices].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeOutputVertices].caps.push_back(CapabilityTessellation); - ExecutionModeParams[ExecutionModeOutputPoints].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeOutputLineStrip].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeOutputTriangleStrip].caps.push_back(CapabilityGeometry); - ExecutionModeParams[ExecutionModeVecTypeHint].caps.push_back(CapabilityKernel); - ExecutionModeParams[ExecutionModeContractionOff].caps.push_back(CapabilityKernel); - - DecorationParams[DecorationRelaxedPrecision].caps.push_back(CapabilityShader); - DecorationParams[DecorationBlock].caps.push_back(CapabilityShader); - DecorationParams[DecorationBufferBlock].caps.push_back(CapabilityShader); - DecorationParams[DecorationRowMajor].caps.push_back(CapabilityMatrix); - DecorationParams[DecorationColMajor].caps.push_back(CapabilityMatrix); - DecorationParams[DecorationGLSLShared].caps.push_back(CapabilityShader); - DecorationParams[DecorationGLSLPacked].caps.push_back(CapabilityShader); - DecorationParams[DecorationNoPerspective].caps.push_back(CapabilityShader); - DecorationParams[DecorationFlat].caps.push_back(CapabilityShader); - DecorationParams[DecorationPatch].caps.push_back(CapabilityTessellation); - DecorationParams[DecorationCentroid].caps.push_back(CapabilityShader); - DecorationParams[DecorationSample].caps.push_back(CapabilitySampleRateShading); - DecorationParams[DecorationInvariant].caps.push_back(CapabilityShader); - DecorationParams[DecorationConstant].caps.push_back(CapabilityKernel); - DecorationParams[DecorationUniform].caps.push_back(CapabilityShader); - DecorationParams[DecorationCPacked].caps.push_back(CapabilityKernel); - DecorationParams[DecorationSaturatedConversion].caps.push_back(CapabilityKernel); - DecorationParams[DecorationStream].caps.push_back(CapabilityGeometryStreams); - DecorationParams[DecorationLocation].caps.push_back(CapabilityShader); - DecorationParams[DecorationComponent].caps.push_back(CapabilityShader); - DecorationParams[DecorationOffset].caps.push_back(CapabilityShader); - DecorationParams[DecorationIndex].caps.push_back(CapabilityShader); - DecorationParams[DecorationBinding].caps.push_back(CapabilityShader); - DecorationParams[DecorationDescriptorSet].caps.push_back(CapabilityShader); - DecorationParams[DecorationXfbBuffer].caps.push_back(CapabilityTransformFeedback); - DecorationParams[DecorationXfbStride].caps.push_back(CapabilityTransformFeedback); - DecorationParams[DecorationArrayStride].caps.push_back(CapabilityShader); - DecorationParams[DecorationMatrixStride].caps.push_back(CapabilityMatrix); - DecorationParams[DecorationFuncParamAttr].caps.push_back(CapabilityKernel); - DecorationParams[DecorationFPRoundingMode].caps.push_back(CapabilityKernel); - DecorationParams[DecorationFPFastMathMode].caps.push_back(CapabilityKernel); - DecorationParams[DecorationLinkageAttributes].caps.push_back(CapabilityLinkage); - DecorationParams[DecorationSpecId].caps.push_back(CapabilityShader); - DecorationParams[DecorationNoContraction].caps.push_back(CapabilityShader); - DecorationParams[DecorationInputAttachmentIndex].caps.push_back(CapabilityInputAttachment); - DecorationParams[DecorationAlignment].caps.push_back(CapabilityKernel); - - BuiltInParams[BuiltInPosition].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInPointSize].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInClipDistance].caps.push_back(CapabilityClipDistance); - BuiltInParams[BuiltInCullDistance].caps.push_back(CapabilityCullDistance); - - BuiltInParams[BuiltInVertexId].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInVertexId].desc = "Vertex ID, which takes on values 0, 1, 2, . . . ."; - - BuiltInParams[BuiltInInstanceId].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInInstanceId].desc = "Instance ID, which takes on values 0, 1, 2, . . . ."; - - BuiltInParams[BuiltInVertexIndex].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInVertexIndex].desc = "Vertex index, which takes on values base, base+1, base+2, . . . ."; - - BuiltInParams[BuiltInInstanceIndex].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInInstanceIndex].desc = "Instance index, which takes on values base, base+1, base+2, . . . ."; - - BuiltInParams[BuiltInPrimitiveId].caps.push_back(CapabilityGeometry); - BuiltInParams[BuiltInPrimitiveId].caps.push_back(CapabilityTessellation); - BuiltInParams[BuiltInInvocationId].caps.push_back(CapabilityGeometry); - BuiltInParams[BuiltInInvocationId].caps.push_back(CapabilityTessellation); - BuiltInParams[BuiltInLayer].caps.push_back(CapabilityGeometry); - BuiltInParams[BuiltInViewportIndex].caps.push_back(CapabilityMultiViewport); - BuiltInParams[BuiltInTessLevelOuter].caps.push_back(CapabilityTessellation); - BuiltInParams[BuiltInTessLevelInner].caps.push_back(CapabilityTessellation); - BuiltInParams[BuiltInTessCoord].caps.push_back(CapabilityTessellation); - BuiltInParams[BuiltInPatchVertices].caps.push_back(CapabilityTessellation); - BuiltInParams[BuiltInFragCoord].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInPointCoord].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInFrontFacing].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInSampleId].caps.push_back(CapabilitySampleRateShading); - BuiltInParams[BuiltInSamplePosition].caps.push_back(CapabilitySampleRateShading); - BuiltInParams[BuiltInSampleMask].caps.push_back(CapabilitySampleRateShading); - BuiltInParams[BuiltInFragDepth].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInHelperInvocation].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInWorkDim].caps.push_back(CapabilityKernel); - BuiltInParams[BuiltInGlobalSize].caps.push_back(CapabilityKernel); - BuiltInParams[BuiltInEnqueuedWorkgroupSize].caps.push_back(CapabilityKernel); - BuiltInParams[BuiltInGlobalOffset].caps.push_back(CapabilityKernel); - BuiltInParams[BuiltInGlobalLinearId].caps.push_back(CapabilityKernel); - - BuiltInParams[BuiltInSubgroupSize].caps.push_back(CapabilityKernel); - BuiltInParams[BuiltInSubgroupMaxSize].caps.push_back(CapabilityKernel); - BuiltInParams[BuiltInNumSubgroups].caps.push_back(CapabilityKernel); - BuiltInParams[BuiltInNumEnqueuedSubgroups].caps.push_back(CapabilityKernel); - BuiltInParams[BuiltInSubgroupId].caps.push_back(CapabilityKernel); - BuiltInParams[BuiltInSubgroupLocalInvocationId].caps.push_back(CapabilityKernel); - - DimensionalityParams[Dim1D].caps.push_back(CapabilitySampled1D); - DimensionalityParams[DimCube].caps.push_back(CapabilityShader); - DimensionalityParams[DimRect].caps.push_back(CapabilitySampledRect); - DimensionalityParams[DimBuffer].caps.push_back(CapabilitySampledBuffer); - DimensionalityParams[DimSubpassData].caps.push_back(CapabilityInputAttachment); - - // Group Operations - for (int i = 0; i < GroupOperationCeiling; ++i) { - GroupOperationParams[i].caps.push_back(CapabilityKernel); - } - - // Enqueue flags - for (int i = 0; i < KernelEnqueueFlagsCeiling; ++i) { - KernelEnqueueFlagsParams[i].caps.push_back(CapabilityKernel); - } - - // Profiling info - KernelProfilingInfoParams[0].caps.push_back(CapabilityKernel); + OperandClassParams[OperandMemorySemantics].set(0, MemorySemanticsString, nullptr, true); + OperandClassParams[OperandMemoryAccess].set(0, MemoryAccessString, nullptr, true); + OperandClassParams[OperandScope].set(0, ScopeString, nullptr); + OperandClassParams[OperandGroupOperation].set(0, GroupOperationString, nullptr); + OperandClassParams[OperandKernelEnqueueFlags].set(0, KernelEnqueueFlagsString, nullptr); + OperandClassParams[OperandKernelProfilingInfo].set(0, KernelProfilingInfoString, nullptr, true); + OperandClassParams[OperandCapability].set(0, CapabilityString, nullptr); + OperandClassParams[OperandOpcode].set(OpCodeMask + 1, OpcodeString, 0); // set name of operator, an initial set of style operands, and the description @@ -1775,7 +1454,6 @@ void Parameterize() InstructionDesc[OpTypeVector].operands.push(OperandId, "'Component Type'"); InstructionDesc[OpTypeVector].operands.push(OperandLiteralNumber, "'Component Count'"); - InstructionDesc[OpTypeMatrix].capabilities.push_back(CapabilityMatrix); InstructionDesc[OpTypeMatrix].operands.push(OperandId, "'Column Type'"); InstructionDesc[OpTypeMatrix].operands.push(OperandLiteralNumber, "'Column Count'"); @@ -1793,31 +1471,19 @@ void Parameterize() InstructionDesc[OpTypeArray].operands.push(OperandId, "'Element Type'"); InstructionDesc[OpTypeArray].operands.push(OperandId, "'Length'"); - InstructionDesc[OpTypeRuntimeArray].capabilities.push_back(CapabilityShader); InstructionDesc[OpTypeRuntimeArray].operands.push(OperandId, "'Element Type'"); InstructionDesc[OpTypeStruct].operands.push(OperandVariableIds, "'Member 0 type', +\n'member 1 type', +\n..."); - InstructionDesc[OpTypeOpaque].capabilities.push_back(CapabilityKernel); InstructionDesc[OpTypeOpaque].operands.push(OperandLiteralString, "The name of the opaque type."); InstructionDesc[OpTypePointer].operands.push(OperandStorage, ""); InstructionDesc[OpTypePointer].operands.push(OperandId, "'Type'"); - InstructionDesc[OpTypeForwardPointer].capabilities.push_back(CapabilityAddresses); InstructionDesc[OpTypeForwardPointer].operands.push(OperandId, "'Pointer Type'"); InstructionDesc[OpTypeForwardPointer].operands.push(OperandStorage, ""); - InstructionDesc[OpTypeEvent].capabilities.push_back(CapabilityKernel); - - InstructionDesc[OpTypeDeviceEvent].capabilities.push_back(CapabilityDeviceEnqueue); - - InstructionDesc[OpTypeReserveId].capabilities.push_back(CapabilityPipes); - - InstructionDesc[OpTypeQueue].capabilities.push_back(CapabilityDeviceEnqueue); - InstructionDesc[OpTypePipe].operands.push(OperandAccessQualifier, "'Qualifier'"); - InstructionDesc[OpTypePipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpTypeFunction].operands.push(OperandId, "'Return Type'"); InstructionDesc[OpTypeFunction].operands.push(OperandVariableIds, "'Parameter 0 Type', +\n'Parameter 1 Type', +\n..."); @@ -1826,7 +1492,6 @@ void Parameterize() InstructionDesc[OpConstantComposite].operands.push(OperandVariableIds, "'Constituents'"); - InstructionDesc[OpConstantSampler].capabilities.push_back(CapabilityLiteralSampler); InstructionDesc[OpConstantSampler].operands.push(OperandSamplerAddressingMode, ""); InstructionDesc[OpConstantSampler].operands.push(OperandLiteralNumber, "'Param'"); InstructionDesc[OpConstantSampler].operands.push(OperandSamplerFilterMode, ""); @@ -1864,11 +1529,24 @@ void Parameterize() InstructionDesc[OpDecorate].operands.push(OperandDecoration, ""); InstructionDesc[OpDecorate].operands.push(OperandVariableLiterals, "See <>."); + InstructionDesc[OpDecorateId].operands.push(OperandId, "'Target'"); + InstructionDesc[OpDecorateId].operands.push(OperandDecoration, ""); + InstructionDesc[OpDecorateId].operands.push(OperandVariableIds, "See <>."); + + InstructionDesc[OpDecorateStringGOOGLE].operands.push(OperandId, "'Target'"); + InstructionDesc[OpDecorateStringGOOGLE].operands.push(OperandDecoration, ""); + InstructionDesc[OpDecorateStringGOOGLE].operands.push(OperandLiteralString, "'Literal String'"); + InstructionDesc[OpMemberDecorate].operands.push(OperandId, "'Structure Type'"); InstructionDesc[OpMemberDecorate].operands.push(OperandLiteralNumber, "'Member'"); InstructionDesc[OpMemberDecorate].operands.push(OperandDecoration, ""); InstructionDesc[OpMemberDecorate].operands.push(OperandVariableLiterals, "See <>."); + InstructionDesc[OpMemberDecorateStringGOOGLE].operands.push(OperandId, "'Structure Type'"); + InstructionDesc[OpMemberDecorateStringGOOGLE].operands.push(OperandLiteralNumber, "'Member'"); + InstructionDesc[OpMemberDecorateStringGOOGLE].operands.push(OperandDecoration, ""); + InstructionDesc[OpMemberDecorateStringGOOGLE].operands.push(OperandLiteralString, "'Literal String'"); + InstructionDesc[OpGroupDecorate].operands.push(OperandId, "'Decoration Group'"); InstructionDesc[OpGroupDecorate].operands.push(OperandVariableIds, "'Targets'"); @@ -1906,8 +1584,6 @@ void Parameterize() InstructionDesc[OpCopyMemorySized].operands.push(OperandId, "'Size'"); InstructionDesc[OpCopyMemorySized].operands.push(OperandMemoryAccess, "", true); - InstructionDesc[OpCopyMemorySized].capabilities.push_back(CapabilityAddresses); - InstructionDesc[OpSampledImage].operands.push(OperandId, "'Image'"); InstructionDesc[OpSampledImage].operands.push(OperandId, "'Sampler'"); @@ -1928,7 +1604,6 @@ void Parameterize() InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSampleImplicitLod].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageSampleExplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleExplicitLod].operands.push(OperandId, "'Coordinate'"); @@ -1940,40 +1615,34 @@ void Parameterize() InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandId, "'D~ref~'"); InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSampleDrefImplicitLod].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandId, "'D~ref~'"); InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSampleDrefExplicitLod].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSampleProjImplicitLod].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSampleProjExplicitLod].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandId, "'D~ref~'"); InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSampleProjDrefImplicitLod].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandId, "'D~ref~'"); InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSampleProjDrefExplicitLod].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageFetch].operands.push(OperandId, "'Image'"); InstructionDesc[OpImageFetch].operands.push(OperandId, "'Coordinate'"); @@ -1985,122 +1654,96 @@ void Parameterize() InstructionDesc[OpImageGather].operands.push(OperandId, "'Component'"); InstructionDesc[OpImageGather].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageGather].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageGather].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageDrefGather].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageDrefGather].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageDrefGather].operands.push(OperandId, "'D~ref~'"); InstructionDesc[OpImageDrefGather].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageDrefGather].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageDrefGather].capabilities.push_back(CapabilityShader); InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseSampleImplicitLod].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseSampleExplicitLod].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandId, "'D~ref~'"); InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseSampleDrefImplicitLod].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandId, "'D~ref~'"); InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseSampleDrefExplicitLod].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseSampleProjImplicitLod].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseSampleProjExplicitLod].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandId, "'D~ref~'"); InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandId, "'D~ref~'"); InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseFetch].operands.push(OperandId, "'Image'"); InstructionDesc[OpImageSparseFetch].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseFetch].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseFetch].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseFetch].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseGather].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSparseGather].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseGather].operands.push(OperandId, "'Component'"); InstructionDesc[OpImageSparseGather].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseGather].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseGather].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseDrefGather].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSparseDrefGather].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseDrefGather].operands.push(OperandId, "'D~ref~'"); InstructionDesc[OpImageSparseDrefGather].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseDrefGather].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseDrefGather].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseRead].operands.push(OperandId, "'Image'"); InstructionDesc[OpImageSparseRead].operands.push(OperandId, "'Coordinate'"); InstructionDesc[OpImageSparseRead].operands.push(OperandImageOperands, "", true); InstructionDesc[OpImageSparseRead].operands.push(OperandVariableIds, "", true); - InstructionDesc[OpImageSparseRead].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageSparseTexelsResident].operands.push(OperandId, "'Resident Code'"); - InstructionDesc[OpImageSparseTexelsResident].capabilities.push_back(CapabilitySparseResidency); InstructionDesc[OpImageQuerySizeLod].operands.push(OperandId, "'Image'"); InstructionDesc[OpImageQuerySizeLod].operands.push(OperandId, "'Level of Detail'"); - InstructionDesc[OpImageQuerySizeLod].capabilities.push_back(CapabilityKernel); - InstructionDesc[OpImageQuerySizeLod].capabilities.push_back(CapabilityImageQuery); InstructionDesc[OpImageQuerySize].operands.push(OperandId, "'Image'"); - InstructionDesc[OpImageQuerySize].capabilities.push_back(CapabilityKernel); - InstructionDesc[OpImageQuerySize].capabilities.push_back(CapabilityImageQuery); InstructionDesc[OpImageQueryLod].operands.push(OperandId, "'Image'"); InstructionDesc[OpImageQueryLod].operands.push(OperandId, "'Coordinate'"); - InstructionDesc[OpImageQueryLod].capabilities.push_back(CapabilityImageQuery); InstructionDesc[OpImageQueryLevels].operands.push(OperandId, "'Image'"); - InstructionDesc[OpImageQueryLevels].capabilities.push_back(CapabilityKernel); - InstructionDesc[OpImageQueryLevels].capabilities.push_back(CapabilityImageQuery); InstructionDesc[OpImageQuerySamples].operands.push(OperandId, "'Image'"); - InstructionDesc[OpImageQuerySamples].capabilities.push_back(CapabilityKernel); - InstructionDesc[OpImageQuerySamples].capabilities.push_back(CapabilityImageQuery); InstructionDesc[OpImageQueryFormat].operands.push(OperandId, "'Image'"); - InstructionDesc[OpImageQueryFormat].capabilities.push_back(CapabilityKernel); InstructionDesc[OpImageQueryOrder].operands.push(OperandId, "'Image'"); - InstructionDesc[OpImageQueryOrder].capabilities.push_back(CapabilityKernel); InstructionDesc[OpAccessChain].operands.push(OperandId, "'Base'"); InstructionDesc[OpAccessChain].operands.push(OperandVariableIds, "'Indexes'"); @@ -2111,12 +1754,10 @@ void Parameterize() InstructionDesc[OpPtrAccessChain].operands.push(OperandId, "'Base'"); InstructionDesc[OpPtrAccessChain].operands.push(OperandId, "'Element'"); InstructionDesc[OpPtrAccessChain].operands.push(OperandVariableIds, "'Indexes'"); - InstructionDesc[OpPtrAccessChain].capabilities.push_back(CapabilityAddresses); InstructionDesc[OpInBoundsPtrAccessChain].operands.push(OperandId, "'Base'"); InstructionDesc[OpInBoundsPtrAccessChain].operands.push(OperandId, "'Element'"); InstructionDesc[OpInBoundsPtrAccessChain].operands.push(OperandVariableIds, "'Indexes'"); - InstructionDesc[OpInBoundsPtrAccessChain].capabilities.push_back(CapabilityAddresses); InstructionDesc[OpSNegate].operands.push(OperandId, "'Operand'"); @@ -2143,65 +1784,49 @@ void Parameterize() InstructionDesc[OpFConvert].operands.push(OperandId, "'Float Value'"); InstructionDesc[OpSatConvertSToU].operands.push(OperandId, "'Signed Value'"); - InstructionDesc[OpSatConvertSToU].capabilities.push_back(CapabilityKernel); InstructionDesc[OpSatConvertUToS].operands.push(OperandId, "'Unsigned Value'"); - InstructionDesc[OpSatConvertUToS].capabilities.push_back(CapabilityKernel); InstructionDesc[OpConvertPtrToU].operands.push(OperandId, "'Pointer'"); - InstructionDesc[OpConvertPtrToU].capabilities.push_back(CapabilityAddresses); InstructionDesc[OpConvertUToPtr].operands.push(OperandId, "'Integer Value'"); - InstructionDesc[OpConvertUToPtr].capabilities.push_back(CapabilityAddresses); InstructionDesc[OpPtrCastToGeneric].operands.push(OperandId, "'Pointer'"); - InstructionDesc[OpPtrCastToGeneric].capabilities.push_back(CapabilityKernel); InstructionDesc[OpGenericCastToPtr].operands.push(OperandId, "'Pointer'"); - InstructionDesc[OpGenericCastToPtr].capabilities.push_back(CapabilityKernel); InstructionDesc[OpGenericCastToPtrExplicit].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpGenericCastToPtrExplicit].operands.push(OperandStorage, "'Storage'"); - InstructionDesc[OpGenericCastToPtrExplicit].capabilities.push_back(CapabilityKernel); InstructionDesc[OpGenericPtrMemSemantics].operands.push(OperandId, "'Pointer'"); - InstructionDesc[OpGenericPtrMemSemantics].capabilities.push_back(CapabilityKernel); InstructionDesc[OpBitcast].operands.push(OperandId, "'Operand'"); InstructionDesc[OpQuantizeToF16].operands.push(OperandId, "'Value'"); - InstructionDesc[OpTranspose].capabilities.push_back(CapabilityMatrix); InstructionDesc[OpTranspose].operands.push(OperandId, "'Matrix'"); InstructionDesc[OpIsNan].operands.push(OperandId, "'x'"); InstructionDesc[OpIsInf].operands.push(OperandId, "'x'"); - InstructionDesc[OpIsFinite].capabilities.push_back(CapabilityKernel); InstructionDesc[OpIsFinite].operands.push(OperandId, "'x'"); - InstructionDesc[OpIsNormal].capabilities.push_back(CapabilityKernel); InstructionDesc[OpIsNormal].operands.push(OperandId, "'x'"); - InstructionDesc[OpSignBitSet].capabilities.push_back(CapabilityKernel); InstructionDesc[OpSignBitSet].operands.push(OperandId, "'x'"); - InstructionDesc[OpLessOrGreater].capabilities.push_back(CapabilityKernel); InstructionDesc[OpLessOrGreater].operands.push(OperandId, "'x'"); InstructionDesc[OpLessOrGreater].operands.push(OperandId, "'y'"); - InstructionDesc[OpOrdered].capabilities.push_back(CapabilityKernel); InstructionDesc[OpOrdered].operands.push(OperandId, "'x'"); InstructionDesc[OpOrdered].operands.push(OperandId, "'y'"); - InstructionDesc[OpUnordered].capabilities.push_back(CapabilityKernel); InstructionDesc[OpUnordered].operands.push(OperandId, "'x'"); InstructionDesc[OpUnordered].operands.push(OperandId, "'y'"); InstructionDesc[OpArrayLength].operands.push(OperandId, "'Structure'"); InstructionDesc[OpArrayLength].operands.push(OperandLiteralNumber, "'Array member'"); - InstructionDesc[OpArrayLength].capabilities.push_back(CapabilityShader); InstructionDesc[OpIAdd].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpIAdd].operands.push(OperandId, "'Operand 2'"); @@ -2248,23 +1873,18 @@ void Parameterize() InstructionDesc[OpVectorTimesScalar].operands.push(OperandId, "'Vector'"); InstructionDesc[OpVectorTimesScalar].operands.push(OperandId, "'Scalar'"); - InstructionDesc[OpMatrixTimesScalar].capabilities.push_back(CapabilityMatrix); InstructionDesc[OpMatrixTimesScalar].operands.push(OperandId, "'Matrix'"); InstructionDesc[OpMatrixTimesScalar].operands.push(OperandId, "'Scalar'"); - InstructionDesc[OpVectorTimesMatrix].capabilities.push_back(CapabilityMatrix); InstructionDesc[OpVectorTimesMatrix].operands.push(OperandId, "'Vector'"); InstructionDesc[OpVectorTimesMatrix].operands.push(OperandId, "'Matrix'"); - InstructionDesc[OpMatrixTimesVector].capabilities.push_back(CapabilityMatrix); InstructionDesc[OpMatrixTimesVector].operands.push(OperandId, "'Matrix'"); InstructionDesc[OpMatrixTimesVector].operands.push(OperandId, "'Vector'"); - InstructionDesc[OpMatrixTimesMatrix].capabilities.push_back(CapabilityMatrix); InstructionDesc[OpMatrixTimesMatrix].operands.push(OperandId, "'LeftMatrix'"); InstructionDesc[OpMatrixTimesMatrix].operands.push(OperandId, "'RightMatrix'"); - InstructionDesc[OpOuterProduct].capabilities.push_back(CapabilityMatrix); InstructionDesc[OpOuterProduct].operands.push(OperandId, "'Vector 1'"); InstructionDesc[OpOuterProduct].operands.push(OperandId, "'Vector 2'"); @@ -2315,23 +1935,19 @@ void Parameterize() InstructionDesc[OpBitwiseAnd].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpBitwiseAnd].operands.push(OperandId, "'Operand 2'"); - InstructionDesc[OpBitFieldInsert].capabilities.push_back(CapabilityShader); InstructionDesc[OpBitFieldInsert].operands.push(OperandId, "'Base'"); InstructionDesc[OpBitFieldInsert].operands.push(OperandId, "'Insert'"); InstructionDesc[OpBitFieldInsert].operands.push(OperandId, "'Offset'"); InstructionDesc[OpBitFieldInsert].operands.push(OperandId, "'Count'"); - - InstructionDesc[OpBitFieldSExtract].capabilities.push_back(CapabilityShader); + InstructionDesc[OpBitFieldSExtract].operands.push(OperandId, "'Base'"); InstructionDesc[OpBitFieldSExtract].operands.push(OperandId, "'Offset'"); InstructionDesc[OpBitFieldSExtract].operands.push(OperandId, "'Count'"); - InstructionDesc[OpBitFieldUExtract].capabilities.push_back(CapabilityShader); InstructionDesc[OpBitFieldUExtract].operands.push(OperandId, "'Base'"); InstructionDesc[OpBitFieldUExtract].operands.push(OperandId, "'Offset'"); InstructionDesc[OpBitFieldUExtract].operands.push(OperandId, "'Count'"); - InstructionDesc[OpBitReverse].capabilities.push_back(CapabilityShader); InstructionDesc[OpBitReverse].operands.push(OperandId, "'Base'"); InstructionDesc[OpBitCount].operands.push(OperandId, "'Base'"); @@ -2406,42 +2022,27 @@ void Parameterize() InstructionDesc[OpFUnordGreaterThanEqual].operands.push(OperandId, "'Operand 1'"); InstructionDesc[OpFUnordGreaterThanEqual].operands.push(OperandId, "'Operand 2'"); - InstructionDesc[OpDPdx].capabilities.push_back(CapabilityShader); InstructionDesc[OpDPdx].operands.push(OperandId, "'P'"); - InstructionDesc[OpDPdy].capabilities.push_back(CapabilityShader); InstructionDesc[OpDPdy].operands.push(OperandId, "'P'"); - InstructionDesc[OpFwidth].capabilities.push_back(CapabilityShader); InstructionDesc[OpFwidth].operands.push(OperandId, "'P'"); - InstructionDesc[OpDPdxFine].capabilities.push_back(CapabilityDerivativeControl); InstructionDesc[OpDPdxFine].operands.push(OperandId, "'P'"); - InstructionDesc[OpDPdyFine].capabilities.push_back(CapabilityDerivativeControl); InstructionDesc[OpDPdyFine].operands.push(OperandId, "'P'"); - InstructionDesc[OpFwidthFine].capabilities.push_back(CapabilityDerivativeControl); InstructionDesc[OpFwidthFine].operands.push(OperandId, "'P'"); - InstructionDesc[OpDPdxCoarse].capabilities.push_back(CapabilityDerivativeControl); InstructionDesc[OpDPdxCoarse].operands.push(OperandId, "'P'"); - InstructionDesc[OpDPdyCoarse].capabilities.push_back(CapabilityDerivativeControl); InstructionDesc[OpDPdyCoarse].operands.push(OperandId, "'P'"); - InstructionDesc[OpFwidthCoarse].capabilities.push_back(CapabilityDerivativeControl); InstructionDesc[OpFwidthCoarse].operands.push(OperandId, "'P'"); - InstructionDesc[OpEmitVertex].capabilities.push_back(CapabilityGeometry); - - InstructionDesc[OpEndPrimitive].capabilities.push_back(CapabilityGeometry); - InstructionDesc[OpEmitStreamVertex].operands.push(OperandId, "'Stream'"); - InstructionDesc[OpEmitStreamVertex].capabilities.push_back(CapabilityGeometryStreams); InstructionDesc[OpEndStreamPrimitive].operands.push(OperandId, "'Stream'"); - InstructionDesc[OpEndStreamPrimitive].capabilities.push_back(CapabilityGeometryStreams); InstructionDesc[OpControlBarrier].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpControlBarrier].operands.push(OperandScope, "'Memory'"); @@ -2481,7 +2082,6 @@ void Parameterize() InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandMemorySemantics, "'Unequal'"); InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandId, "'Value'"); InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandId, "'Comparator'"); - InstructionDesc[OpAtomicCompareExchangeWeak].capabilities.push_back(CapabilityKernel); InstructionDesc[OpAtomicIIncrement].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicIIncrement].operands.push(OperandScope, "'Scope'"); @@ -2539,16 +2139,15 @@ void Parameterize() InstructionDesc[OpAtomicFlagTestAndSet].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicFlagTestAndSet].operands.push(OperandScope, "'Scope'"); InstructionDesc[OpAtomicFlagTestAndSet].operands.push(OperandMemorySemantics, "'Semantics'"); - InstructionDesc[OpAtomicFlagTestAndSet].capabilities.push_back(CapabilityKernel); InstructionDesc[OpAtomicFlagClear].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpAtomicFlagClear].operands.push(OperandScope, "'Scope'"); InstructionDesc[OpAtomicFlagClear].operands.push(OperandMemorySemantics, "'Semantics'"); - InstructionDesc[OpAtomicFlagClear].capabilities.push_back(CapabilityKernel); InstructionDesc[OpLoopMerge].operands.push(OperandId, "'Merge Block'"); InstructionDesc[OpLoopMerge].operands.push(OperandId, "'Continue Target'"); InstructionDesc[OpLoopMerge].operands.push(OperandLoop, ""); + InstructionDesc[OpLoopMerge].operands.push(OperandOptionalLiteral, ""); InstructionDesc[OpSelectionMerge].operands.push(OperandId, "'Merge Block'"); InstructionDesc[OpSelectionMerge].operands.push(OperandSelect, ""); @@ -2564,19 +2163,15 @@ void Parameterize() InstructionDesc[OpSwitch].operands.push(OperandId, "'Default'"); InstructionDesc[OpSwitch].operands.push(OperandVariableLiteralId, "'Target'"); - InstructionDesc[OpKill].capabilities.push_back(CapabilityShader); InstructionDesc[OpReturnValue].operands.push(OperandId, "'Value'"); InstructionDesc[OpLifetimeStart].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpLifetimeStart].operands.push(OperandLiteralNumber, "'Size'"); - InstructionDesc[OpLifetimeStart].capabilities.push_back(CapabilityKernel); InstructionDesc[OpLifetimeStop].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpLifetimeStop].operands.push(OperandLiteralNumber, "'Size'"); - InstructionDesc[OpLifetimeStop].capabilities.push_back(CapabilityKernel); - InstructionDesc[OpGroupAsyncCopy].capabilities.push_back(CapabilityKernel); InstructionDesc[OpGroupAsyncCopy].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Destination'"); InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Source'"); @@ -2584,77 +2179,62 @@ void Parameterize() InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Stride'"); InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Event'"); - InstructionDesc[OpGroupWaitEvents].capabilities.push_back(CapabilityKernel); InstructionDesc[OpGroupWaitEvents].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupWaitEvents].operands.push(OperandId, "'Num Events'"); InstructionDesc[OpGroupWaitEvents].operands.push(OperandId, "'Events List'"); - InstructionDesc[OpGroupAll].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupAll].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupAll].operands.push(OperandId, "'Predicate'"); - InstructionDesc[OpGroupAny].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupAny].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupAny].operands.push(OperandId, "'Predicate'"); - InstructionDesc[OpGroupBroadcast].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupBroadcast].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupBroadcast].operands.push(OperandId, "'Value'"); InstructionDesc[OpGroupBroadcast].operands.push(OperandId, "'LocalId'"); - InstructionDesc[OpGroupIAdd].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupIAdd].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupIAdd].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupIAdd].operands.push(OperandId, "'X'"); - InstructionDesc[OpGroupFAdd].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupFAdd].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupFAdd].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupFAdd].operands.push(OperandId, "'X'"); - InstructionDesc[OpGroupUMin].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupUMin].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupUMin].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupUMin].operands.push(OperandId, "'X'"); - InstructionDesc[OpGroupSMin].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupSMin].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupSMin].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupSMin].operands.push(OperandId, "X"); - InstructionDesc[OpGroupFMin].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupFMin].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupFMin].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupFMin].operands.push(OperandId, "X"); - InstructionDesc[OpGroupUMax].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupUMax].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupUMax].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupUMax].operands.push(OperandId, "X"); - InstructionDesc[OpGroupSMax].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupSMax].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupSMax].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupSMax].operands.push(OperandId, "X"); - InstructionDesc[OpGroupFMax].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupFMax].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupFMax].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupFMax].operands.push(OperandId, "X"); - InstructionDesc[OpReadPipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpReadPipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpReadPipe].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpReadPipe].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpReadPipe].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpWritePipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpWritePipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpWritePipe].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpWritePipe].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpWritePipe].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpReservedReadPipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Reserve Id'"); InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Index'"); @@ -2662,7 +2242,6 @@ void Parameterize() InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpReservedWritePipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Reserve Id'"); InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Index'"); @@ -2670,127 +2249,99 @@ void Parameterize() InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpReserveReadPipePackets].capabilities.push_back(CapabilityPipes); InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Num Packets'"); InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpReserveWritePipePackets].capabilities.push_back(CapabilityPipes); InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Num Packets'"); InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpCommitReadPipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Reserve Id'"); InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpCommitWritePipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Reserve Id'"); InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpIsValidReserveId].capabilities.push_back(CapabilityPipes); InstructionDesc[OpIsValidReserveId].operands.push(OperandId, "'Reserve Id'"); - InstructionDesc[OpGetNumPipePackets].capabilities.push_back(CapabilityPipes); InstructionDesc[OpGetNumPipePackets].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpGetNumPipePackets].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpGetNumPipePackets].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpGetMaxPipePackets].capabilities.push_back(CapabilityPipes); InstructionDesc[OpGetMaxPipePackets].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpGetMaxPipePackets].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpGetMaxPipePackets].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpGroupReserveReadPipePackets].capabilities.push_back(CapabilityPipes); InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Num Packets'"); InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpGroupReserveWritePipePackets].capabilities.push_back(CapabilityPipes); InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Num Packets'"); InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpGroupCommitReadPipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Reserve Id'"); InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpGroupCommitWritePipe].capabilities.push_back(CapabilityPipes); InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Pipe'"); InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Reserve Id'"); InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Packet Size'"); InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Packet Alignment'"); - InstructionDesc[OpBuildNDRange].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpBuildNDRange].operands.push(OperandId, "'GlobalWorkSize'"); InstructionDesc[OpBuildNDRange].operands.push(OperandId, "'LocalWorkSize'"); InstructionDesc[OpBuildNDRange].operands.push(OperandId, "'GlobalWorkOffset'"); - InstructionDesc[OpGetDefaultQueue].capabilities.push_back(CapabilityDeviceEnqueue); - - InstructionDesc[OpCaptureEventProfilingInfo].capabilities.push_back(CapabilityDeviceEnqueue); - InstructionDesc[OpCaptureEventProfilingInfo].operands.push(OperandId, "'Event'"); InstructionDesc[OpCaptureEventProfilingInfo].operands.push(OperandId, "'Profiling Info'"); InstructionDesc[OpCaptureEventProfilingInfo].operands.push(OperandId, "'Value'"); - InstructionDesc[OpSetUserEventStatus].capabilities.push_back(CapabilityDeviceEnqueue); - InstructionDesc[OpSetUserEventStatus].operands.push(OperandId, "'Event'"); InstructionDesc[OpSetUserEventStatus].operands.push(OperandId, "'Status'"); - InstructionDesc[OpIsValidEvent].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpIsValidEvent].operands.push(OperandId, "'Event'"); - InstructionDesc[OpCreateUserEvent].capabilities.push_back(CapabilityDeviceEnqueue); - - InstructionDesc[OpRetainEvent].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpRetainEvent].operands.push(OperandId, "'Event'"); - InstructionDesc[OpReleaseEvent].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpReleaseEvent].operands.push(OperandId, "'Event'"); - InstructionDesc[OpGetKernelWorkGroupSize].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId, "'Invoke'"); InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId, "'Param'"); InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId, "'Param Size'"); InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId, "'Param Align'"); - InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId, "'Invoke'"); InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId, "'Param'"); InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId, "'Param Size'"); InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId, "'Param Align'"); - InstructionDesc[OpGetKernelNDrangeSubGroupCount].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'ND Range'"); InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'Invoke'"); InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'Param'"); InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'Param Size'"); InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'Param Align'"); - InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'ND Range'"); InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'Invoke'"); InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'Param'"); InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'Param Size'"); InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'Param Align'"); - InstructionDesc[OpEnqueueKernel].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Queue'"); InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Flags'"); InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'ND Range'"); @@ -2803,72 +2354,214 @@ void Parameterize() InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Param Align'"); InstructionDesc[OpEnqueueKernel].operands.push(OperandVariableIds, "'Local Size'"); - InstructionDesc[OpEnqueueMarker].capabilities.push_back(CapabilityDeviceEnqueue); InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Queue'"); InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Num Events'"); InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Wait Events'"); InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Ret Event'"); + InstructionDesc[OpGroupNonUniformElect].operands.push(OperandScope, "'Execution'"); + + InstructionDesc[OpGroupNonUniformAll].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformAll].operands.push(OperandId, "X"); + + InstructionDesc[OpGroupNonUniformAny].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformAny].operands.push(OperandId, "X"); + + InstructionDesc[OpGroupNonUniformAllEqual].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformAllEqual].operands.push(OperandId, "X"); + + InstructionDesc[OpGroupNonUniformBroadcast].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformBroadcast].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformBroadcast].operands.push(OperandId, "ID"); + + InstructionDesc[OpGroupNonUniformBroadcastFirst].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformBroadcastFirst].operands.push(OperandId, "X"); + + InstructionDesc[OpGroupNonUniformBallot].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformBallot].operands.push(OperandId, "X"); + + InstructionDesc[OpGroupNonUniformInverseBallot].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformInverseBallot].operands.push(OperandId, "X"); + + InstructionDesc[OpGroupNonUniformBallotBitExtract].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformBallotBitExtract].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformBallotBitExtract].operands.push(OperandId, "Bit"); + + InstructionDesc[OpGroupNonUniformBallotBitCount].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformBallotBitCount].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformBallotBitCount].operands.push(OperandId, "X"); + + InstructionDesc[OpGroupNonUniformBallotFindLSB].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformBallotFindLSB].operands.push(OperandId, "X"); + + InstructionDesc[OpGroupNonUniformBallotFindMSB].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformBallotFindMSB].operands.push(OperandId, "X"); + + InstructionDesc[OpGroupNonUniformShuffle].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformShuffle].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformShuffle].operands.push(OperandId, "'Id'"); + + InstructionDesc[OpGroupNonUniformShuffleXor].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformShuffleXor].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformShuffleXor].operands.push(OperandId, "Mask"); + + InstructionDesc[OpGroupNonUniformShuffleUp].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformShuffleUp].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformShuffleUp].operands.push(OperandId, "Offset"); + + InstructionDesc[OpGroupNonUniformShuffleDown].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformShuffleDown].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformShuffleDown].operands.push(OperandId, "Offset"); + + InstructionDesc[OpGroupNonUniformIAdd].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformIAdd].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformIAdd].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformIAdd].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformFAdd].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformFAdd].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformFAdd].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformFAdd].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformIMul].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformIMul].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformIMul].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformIMul].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformFMul].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformFMul].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformFMul].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformFMul].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformSMin].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformSMin].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformSMin].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformSMin].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformUMin].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformUMin].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformUMin].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformUMin].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformFMin].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformFMin].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformFMin].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformFMin].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformSMax].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformSMax].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformSMax].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformSMax].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformUMax].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformUMax].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformUMax].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformUMax].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformFMax].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformFMax].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformFMax].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformFMax].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformBitwiseAnd].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformBitwiseAnd].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformBitwiseAnd].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformBitwiseAnd].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformBitwiseOr].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformBitwiseOr].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformBitwiseOr].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformBitwiseOr].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformBitwiseXor].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformBitwiseXor].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformBitwiseXor].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformBitwiseXor].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformLogicalAnd].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformLogicalAnd].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformLogicalAnd].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformLogicalAnd].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformLogicalOr].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformLogicalOr].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformLogicalOr].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformLogicalOr].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformLogicalXor].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformLogicalXor].operands.push(OperandGroupOperation, "'Operation'"); + InstructionDesc[OpGroupNonUniformLogicalXor].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformLogicalXor].operands.push(OperandId, "'ClusterSize'", true); + + InstructionDesc[OpGroupNonUniformQuadBroadcast].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformQuadBroadcast].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformQuadBroadcast].operands.push(OperandId, "'Id'"); + + InstructionDesc[OpGroupNonUniformQuadSwap].operands.push(OperandScope, "'Execution'"); + InstructionDesc[OpGroupNonUniformQuadSwap].operands.push(OperandId, "X"); + InstructionDesc[OpGroupNonUniformQuadSwap].operands.push(OperandLiteralNumber, "'Direction'"); + InstructionDesc[OpSubgroupBallotKHR].operands.push(OperandId, "'Predicate'"); InstructionDesc[OpSubgroupFirstInvocationKHR].operands.push(OperandId, "'Value'"); - InstructionDesc[OpSubgroupAnyKHR].capabilities.push_back(CapabilitySubgroupVoteKHR); InstructionDesc[OpSubgroupAnyKHR].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpSubgroupAnyKHR].operands.push(OperandId, "'Predicate'"); - InstructionDesc[OpSubgroupAllKHR].capabilities.push_back(CapabilitySubgroupVoteKHR); InstructionDesc[OpSubgroupAllKHR].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpSubgroupAllKHR].operands.push(OperandId, "'Predicate'"); - InstructionDesc[OpSubgroupAllEqualKHR].capabilities.push_back(CapabilitySubgroupVoteKHR); InstructionDesc[OpSubgroupAllEqualKHR].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpSubgroupAllEqualKHR].operands.push(OperandId, "'Predicate'"); - InstructionDesc[OpSubgroupReadInvocationKHR].capabilities.push_back(CapabilityGroups); InstructionDesc[OpSubgroupReadInvocationKHR].operands.push(OperandId, "'Value'"); InstructionDesc[OpSubgroupReadInvocationKHR].operands.push(OperandId, "'Index'"); + InstructionDesc[OpModuleProcessed].operands.push(OperandLiteralString, "'process'"); + #ifdef AMD_EXTENSIONS - InstructionDesc[OpGroupIAddNonUniformAMD].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandId, "'X'"); - InstructionDesc[OpGroupFAddNonUniformAMD].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupFAddNonUniformAMD].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupFAddNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupFAddNonUniformAMD].operands.push(OperandId, "'X'"); - InstructionDesc[OpGroupUMinNonUniformAMD].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupUMinNonUniformAMD].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupUMinNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupUMinNonUniformAMD].operands.push(OperandId, "'X'"); - InstructionDesc[OpGroupSMinNonUniformAMD].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupSMinNonUniformAMD].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupSMinNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupSMinNonUniformAMD].operands.push(OperandId, "X"); - InstructionDesc[OpGroupFMinNonUniformAMD].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupFMinNonUniformAMD].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupFMinNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupFMinNonUniformAMD].operands.push(OperandId, "X"); - InstructionDesc[OpGroupUMaxNonUniformAMD].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupUMaxNonUniformAMD].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupUMaxNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupUMaxNonUniformAMD].operands.push(OperandId, "X"); - InstructionDesc[OpGroupSMaxNonUniformAMD].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupSMaxNonUniformAMD].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupSMaxNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupSMaxNonUniformAMD].operands.push(OperandId, "X"); - InstructionDesc[OpGroupFMaxNonUniformAMD].capabilities.push_back(CapabilityGroups); InstructionDesc[OpGroupFMaxNonUniformAMD].operands.push(OperandScope, "'Execution'"); InstructionDesc[OpGroupFMaxNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'"); InstructionDesc[OpGroupFMaxNonUniformAMD].operands.push(OperandId, "X"); + + InstructionDesc[OpFragmentMaskFetchAMD].operands.push(OperandId, "'Image'"); + InstructionDesc[OpFragmentMaskFetchAMD].operands.push(OperandId, "'Coordinate'"); + + InstructionDesc[OpFragmentFetchAMD].operands.push(OperandId, "'Image'"); + InstructionDesc[OpFragmentFetchAMD].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[OpFragmentFetchAMD].operands.push(OperandId, "'Fragment Index'"); +#endif + +#ifdef NV_EXTENSIONS + InstructionDesc[OpGroupNonUniformPartitionNV].operands.push(OperandId, "X"); #endif } diff --git a/deps/glslang/SPIRV/doc.h b/deps/glslang/SPIRV/doc.h index 710ca1a5..7d0475d3 100644 --- a/deps/glslang/SPIRV/doc.h +++ b/deps/glslang/SPIRV/doc.h @@ -190,7 +190,6 @@ class OperandParameters { class EnumParameters { public: EnumParameters() : desc(0) { } - EnumCaps caps; const char* desc; }; @@ -235,7 +234,6 @@ class InstructionParameters { bool hasType() const { return typePresent != 0; } const char* opDesc; - EnumCaps capabilities; OpcodeClass opClass; OperandParameters operands; @@ -244,8 +242,6 @@ class InstructionParameters { int resultPresent : 1; }; -const int OpcodeCeiling = 321; - // The set of objects that hold all the instruction/operand // parameterization information. extern InstructionParameters InstructionDesc[]; diff --git a/deps/glslang/SPIRV/spirv.hpp b/deps/glslang/SPIRV/spirv.hpp index 8bddf7e5..e21762db 100644 --- a/deps/glslang/SPIRV/spirv.hpp +++ b/deps/glslang/SPIRV/spirv.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2014-2017 The Khronos Group Inc. +// Copyright (c) 2014-2018 The Khronos Group Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and/or associated documentation files (the "Materials"), @@ -46,12 +46,12 @@ namespace spv { typedef unsigned int Id; -#define SPV_VERSION 0x10000 -#define SPV_REVISION 12 +#define SPV_VERSION 0x10300 +#define SPV_REVISION 1 static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 0x00010000; -static const unsigned int Revision = 12; +static const unsigned int Version = 0x00010300; +static const unsigned int Revision = 1; static const unsigned int OpCodeMask = 0xffff; static const unsigned int WordCountShift = 16; @@ -122,7 +122,15 @@ enum ExecutionMode { ExecutionModeOutputTriangleStrip = 29, ExecutionModeVecTypeHint = 30, ExecutionModeContractionOff = 31, + ExecutionModeInitializer = 33, + ExecutionModeFinalizer = 34, + ExecutionModeSubgroupSize = 35, + ExecutionModeSubgroupsPerWorkgroup = 36, + ExecutionModeSubgroupsPerWorkgroupId = 37, + ExecutionModeLocalSizeId = 38, + ExecutionModeLocalSizeHintId = 39, ExecutionModePostDepthCoverage = 4446, + ExecutionModeStencilRefReplacingEXT = 5027, ExecutionModeMax = 0x7fffffff, }; @@ -377,11 +385,17 @@ enum Decoration { DecorationNoContraction = 42, DecorationInputAttachmentIndex = 43, DecorationAlignment = 44, + DecorationMaxByteOffset = 45, + DecorationAlignmentId = 46, + DecorationMaxByteOffsetId = 47, DecorationExplicitInterpAMD = 4999, DecorationOverrideCoverageNV = 5248, DecorationPassthroughNV = 5250, DecorationViewportRelativeNV = 5252, DecorationSecondaryViewportRelativeNV = 5256, + DecorationNonUniformEXT = 5300, + DecorationHlslCounterBufferGOOGLE = 5634, + DecorationHlslSemanticGOOGLE = 5635, DecorationMax = 0x7fffffff, }; @@ -427,10 +441,15 @@ enum BuiltIn { BuiltInSubgroupLocalInvocationId = 41, BuiltInVertexIndex = 42, BuiltInInstanceIndex = 43, + BuiltInSubgroupEqMask = 4416, BuiltInSubgroupEqMaskKHR = 4416, + BuiltInSubgroupGeMask = 4417, BuiltInSubgroupGeMaskKHR = 4417, + BuiltInSubgroupGtMask = 4418, BuiltInSubgroupGtMaskKHR = 4418, + BuiltInSubgroupLeMask = 4419, BuiltInSubgroupLeMaskKHR = 4419, + BuiltInSubgroupLtMask = 4420, BuiltInSubgroupLtMaskKHR = 4420, BuiltInBaseVertex = 4424, BuiltInBaseInstance = 4425, @@ -450,6 +469,7 @@ enum BuiltIn { BuiltInSecondaryViewportMaskNV = 5258, BuiltInPositionPerViewNV = 5261, BuiltInViewportMaskPerViewNV = 5262, + BuiltInFullyCoveredEXT = 5264, BuiltInMax = 0x7fffffff, }; @@ -468,6 +488,8 @@ enum SelectionControlMask { enum LoopControlShift { LoopControlUnrollShift = 0, LoopControlDontUnrollShift = 1, + LoopControlDependencyInfiniteShift = 2, + LoopControlDependencyLengthShift = 3, LoopControlMax = 0x7fffffff, }; @@ -475,6 +497,8 @@ enum LoopControlMask { LoopControlMaskNone = 0, LoopControlUnrollMask = 0x00000001, LoopControlDontUnrollMask = 0x00000002, + LoopControlDependencyInfiniteMask = 0x00000004, + LoopControlDependencyLengthMask = 0x00000008, }; enum FunctionControlShift { @@ -548,6 +572,10 @@ enum GroupOperation { GroupOperationReduce = 0, GroupOperationInclusiveScan = 1, GroupOperationExclusiveScan = 2, + GroupOperationClusteredReduce = 3, + GroupOperationPartitionedReduceNV = 6, + GroupOperationPartitionedInclusiveScanNV = 7, + GroupOperationPartitionedExclusiveScanNV = 8, GroupOperationMax = 0x7fffffff, }; @@ -625,6 +653,17 @@ enum Capability { CapabilityStorageImageReadWithoutFormat = 55, CapabilityStorageImageWriteWithoutFormat = 56, CapabilityMultiViewport = 57, + CapabilitySubgroupDispatch = 58, + CapabilityNamedBarrier = 59, + CapabilityPipeStorage = 60, + CapabilityGroupNonUniform = 61, + CapabilityGroupNonUniformVote = 62, + CapabilityGroupNonUniformArithmetic = 63, + CapabilityGroupNonUniformBallot = 64, + CapabilityGroupNonUniformShuffle = 65, + CapabilityGroupNonUniformShuffleRelative = 66, + CapabilityGroupNonUniformClustered = 67, + CapabilityGroupNonUniformQuad = 68, CapabilitySubgroupBallotKHR = 4423, CapabilityDrawParameters = 4427, CapabilitySubgroupVoteKHR = 4431, @@ -640,8 +679,11 @@ enum Capability { CapabilityVariablePointers = 4442, CapabilityAtomicStorageOps = 4445, CapabilitySampleMaskPostDepthCoverage = 4447, + CapabilityFloat16ImageAMD = 5008, CapabilityImageGatherBiasLodAMD = 5009, + CapabilityFragmentMaskAMD = 5010, CapabilityStencilExportEXT = 5013, + CapabilityImageReadWriteLodAMD = 5015, CapabilitySampleMaskOverrideCoverageNV = 5249, CapabilityGeometryShaderPassthroughNV = 5251, CapabilityShaderViewportIndexLayerEXT = 5254, @@ -649,6 +691,23 @@ enum Capability { CapabilityShaderViewportMaskNV = 5255, CapabilityShaderStereoViewNV = 5259, CapabilityPerViewAttributesNV = 5260, + CapabilityFragmentFullyCoveredEXT = 5265, + CapabilityGroupNonUniformPartitionedNV = 5297, + CapabilityShaderNonUniformEXT = 5301, + CapabilityRuntimeDescriptorArrayEXT = 5302, + CapabilityInputAttachmentArrayDynamicIndexingEXT = 5303, + CapabilityUniformTexelBufferArrayDynamicIndexingEXT = 5304, + CapabilityStorageTexelBufferArrayDynamicIndexingEXT = 5305, + CapabilityUniformBufferArrayNonUniformIndexingEXT = 5306, + CapabilitySampledImageArrayNonUniformIndexingEXT = 5307, + CapabilityStorageBufferArrayNonUniformIndexingEXT = 5308, + CapabilityStorageImageArrayNonUniformIndexingEXT = 5309, + CapabilityInputAttachmentArrayNonUniformIndexingEXT = 5310, + CapabilityUniformTexelBufferArrayNonUniformIndexingEXT = 5311, + CapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312, + CapabilitySubgroupShuffleINTEL = 5568, + CapabilitySubgroupBufferBlockIOINTEL = 5569, + CapabilitySubgroupImageBlockIOINTEL = 5570, CapabilityMax = 0x7fffffff, }; @@ -947,6 +1006,52 @@ enum Op { OpAtomicFlagTestAndSet = 318, OpAtomicFlagClear = 319, OpImageSparseRead = 320, + OpSizeOf = 321, + OpTypePipeStorage = 322, + OpConstantPipeStorage = 323, + OpCreatePipeFromPipeStorage = 324, + OpGetKernelLocalSizeForSubgroupCount = 325, + OpGetKernelMaxNumSubgroups = 326, + OpTypeNamedBarrier = 327, + OpNamedBarrierInitialize = 328, + OpMemoryNamedBarrier = 329, + OpModuleProcessed = 330, + OpExecutionModeId = 331, + OpDecorateId = 332, + OpGroupNonUniformElect = 333, + OpGroupNonUniformAll = 334, + OpGroupNonUniformAny = 335, + OpGroupNonUniformAllEqual = 336, + OpGroupNonUniformBroadcast = 337, + OpGroupNonUniformBroadcastFirst = 338, + OpGroupNonUniformBallot = 339, + OpGroupNonUniformInverseBallot = 340, + OpGroupNonUniformBallotBitExtract = 341, + OpGroupNonUniformBallotBitCount = 342, + OpGroupNonUniformBallotFindLSB = 343, + OpGroupNonUniformBallotFindMSB = 344, + OpGroupNonUniformShuffle = 345, + OpGroupNonUniformShuffleXor = 346, + OpGroupNonUniformShuffleUp = 347, + OpGroupNonUniformShuffleDown = 348, + OpGroupNonUniformIAdd = 349, + OpGroupNonUniformFAdd = 350, + OpGroupNonUniformIMul = 351, + OpGroupNonUniformFMul = 352, + OpGroupNonUniformSMin = 353, + OpGroupNonUniformUMin = 354, + OpGroupNonUniformFMin = 355, + OpGroupNonUniformSMax = 356, + OpGroupNonUniformUMax = 357, + OpGroupNonUniformFMax = 358, + OpGroupNonUniformBitwiseAnd = 359, + OpGroupNonUniformBitwiseOr = 360, + OpGroupNonUniformBitwiseXor = 361, + OpGroupNonUniformLogicalAnd = 362, + OpGroupNonUniformLogicalOr = 363, + OpGroupNonUniformLogicalXor = 364, + OpGroupNonUniformQuadBroadcast = 365, + OpGroupNonUniformQuadSwap = 366, OpSubgroupBallotKHR = 4421, OpSubgroupFirstInvocationKHR = 4422, OpSubgroupAllKHR = 4428, @@ -961,6 +1066,19 @@ enum Op { OpGroupFMaxNonUniformAMD = 5005, OpGroupUMaxNonUniformAMD = 5006, OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpGroupNonUniformPartitionNV = 5296, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateStringGOOGLE = 5633, OpMax = 0x7fffffff, }; diff --git a/deps/glslang/SPIRV/spvIR.h b/deps/glslang/SPIRV/spvIR.h index 087a53f2..faa2701f 100644 --- a/deps/glslang/SPIRV/spvIR.h +++ b/deps/glslang/SPIRV/spvIR.h @@ -65,12 +65,17 @@ const Id NoResult = 0; const Id NoType = 0; const Decoration NoPrecision = DecorationMax; + +#ifdef __GNUC__ +# define POTENTIALLY_UNUSED __attribute__((unused)) +#else +# define POTENTIALLY_UNUSED +#endif + +POTENTIALLY_UNUSED const MemorySemanticsMask MemorySemanticsAllMemory = - (MemorySemanticsMask)(MemorySemanticsSequentiallyConsistentMask | - MemorySemanticsUniformMemoryMask | - MemorySemanticsSubgroupMemoryMask | + (MemorySemanticsMask)(MemorySemanticsUniformMemoryMask | MemorySemanticsWorkgroupMemoryMask | - MemorySemanticsCrossWorkgroupMemoryMask | MemorySemanticsAtomicCounterMemoryMask | MemorySemanticsImageMemoryMask); diff --git a/deps/glslang/SetupLinux.sh b/deps/glslang/SetupLinux.sh deleted file mode 100644 index 2a6ff6a4..00000000 --- a/deps/glslang/SetupLinux.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -rm -rf build -mkdir build -pushd build -cmake .. -cmake .. -make -j 2 -make install -install/bin/glslangValidator -i ../Test/sample.vert ../Test/sample.frag -popd diff --git a/deps/glslang/glslang/CMakeLists.txt b/deps/glslang/glslang/CMakeLists.txt index 8d4615c8..7a50ab67 100644 --- a/deps/glslang/glslang/CMakeLists.txt +++ b/deps/glslang/glslang/CMakeLists.txt @@ -9,6 +9,7 @@ endif(WIN32) set(SOURCES MachineIndependent/glslang.y MachineIndependent/glslang_tab.cpp + MachineIndependent/attribute.cpp MachineIndependent/Constant.cpp MachineIndependent/iomapper.cpp MachineIndependent/InfoSink.cpp @@ -51,6 +52,7 @@ set(HEADERS Include/revision.h Include/ShHandle.h Include/Types.h + MachineIndependent/attribute.h MachineIndependent/glslang_tab.cpp.h MachineIndependent/gl_types.h MachineIndependent/Initialize.h @@ -79,7 +81,8 @@ set(HEADERS # set(BISON_GLSLParser_OUTPUT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp) add_library(glslang STATIC ${BISON_GLSLParser_OUTPUT_SOURCE} ${SOURCES} ${HEADERS}) -set_property(TARGET glslang PROPERTY FOLDER glslang POSITION_INDEPENDENT_CODE ON) +set_property(TARGET glslang PROPERTY FOLDER glslang) +set_property(TARGET glslang PROPERTY POSITION_INDEPENDENT_CODE ON) target_link_libraries(glslang OGLCompiler OSDependent) if(ENABLE_HLSL) target_link_libraries(glslang HLSL) @@ -93,12 +96,14 @@ if(WIN32) source_group("MachineIndependent\\Preprocessor" REGULAR_EXPRESSION "MachineIndependent/preprocessor/*") endif(WIN32) -#>> Disabled for Anvil -#install(TARGETS glslang -# ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -# -#foreach(file ${HEADERS}) -# get_filename_component(dir ${file} DIRECTORY) -# install(FILES ${file} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glslang/${dir}) -#endforeach() -#<< \ No newline at end of file +if(ENABLE_GLSLANG_INSTALL) + install(TARGETS glslang + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +endif(ENABLE_GLSLANG_INSTALL) + +if(ENABLE_GLSLANG_INSTALL) + foreach(file ${HEADERS}) + get_filename_component(dir ${file} DIRECTORY) + install(FILES ${file} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glslang/${dir}) + endforeach() +endif(ENABLE_GLSLANG_INSTALL) diff --git a/deps/glslang/glslang/Include/BaseTypes.h b/deps/glslang/glslang/Include/BaseTypes.h index 08fb623a..46fe159b 100644 --- a/deps/glslang/glslang/Include/BaseTypes.h +++ b/deps/glslang/glslang/Include/BaseTypes.h @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -46,17 +47,15 @@ enum TBasicType { EbtVoid, EbtFloat, EbtDouble, -#ifdef AMD_EXTENSIONS EbtFloat16, -#endif + EbtInt8, + EbtUint8, + EbtInt16, + EbtUint16, EbtInt, EbtUint, EbtInt64, EbtUint64, -#ifdef AMD_EXTENSIONS - EbtInt16, - EbtUint16, -#endif EbtBool, EbtAtomicUint, EbtSampler, @@ -141,6 +140,8 @@ enum TBuiltInVariable { EbvLocalInvocationId, EbvGlobalInvocationId, EbvLocalInvocationIndex, + EbvNumSubgroups, + EbvSubgroupID, EbvSubGroupSize, EbvSubGroupInvocation, EbvSubGroupEqMask, @@ -148,6 +149,13 @@ enum TBuiltInVariable { EbvSubGroupGtMask, EbvSubGroupLeMask, EbvSubGroupLtMask, + EbvSubgroupSize2, + EbvSubgroupInvocation2, + EbvSubgroupEqMask2, + EbvSubgroupGeMask2, + EbvSubgroupGtMask2, + EbvSubgroupLeMask2, + EbvSubgroupLtMask2, EbvVertexId, EbvInstanceId, EbvVertexIndex, @@ -198,6 +206,7 @@ enum TBuiltInVariable { EbvSamplePosition, EbvSampleMask, EbvHelperInvocation, + #ifdef AMD_EXTENSIONS EbvBaryCoordNoPersp, EbvBaryCoordNoPerspCentroid, @@ -217,6 +226,7 @@ enum TBuiltInVariable { EbvSecondaryViewportMaskNV, EbvPositionPerViewNV, EbvViewportMaskPerViewNV, + EbvFragFullyCoveredNV, #endif // HLSL built-ins that live only temporarily, until they get remapped @@ -334,6 +344,7 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v) case EbvSamplePosition: return "SamplePosition"; case EbvSampleMask: return "SampleMaskIn"; case EbvHelperInvocation: return "HelperInvocation"; + #ifdef AMD_EXTENSIONS case EbvBaryCoordNoPersp: return "BaryCoordNoPersp"; case EbvBaryCoordNoPerspCentroid: return "BaryCoordNoPerspCentroid"; @@ -353,6 +364,7 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v) case EbvSecondaryViewportMaskNV: return "SecondaryViewportMaskNV"; case EbvPositionPerViewNV: return "PositionPerViewNV"; case EbvViewportMaskPerViewNV: return "ViewportMaskPerViewNV"; + case EbvFragFullyCoveredNV: return "FragFullyCoveredNV"; #endif default: return "unknown built-in variable"; } @@ -369,7 +381,7 @@ enum TPrecisionQualifier { __inline const char* GetPrecisionQualifierString(TPrecisionQualifier p) { - switch(p) { + switch (p) { case EpqNone: return ""; break; case EpqLow: return "lowp"; break; case EpqMedium: return "mediump"; break; @@ -378,6 +390,75 @@ __inline const char* GetPrecisionQualifierString(TPrecisionQualifier p) } } +__inline bool isTypeSignedInt(TBasicType type) +{ + switch (type) { + case EbtInt8: + case EbtInt16: + case EbtInt: + case EbtInt64: + return true; + default: + return false; + } +} + +__inline bool isTypeUnsignedInt(TBasicType type) +{ + switch (type) { + case EbtUint8: + case EbtUint16: + case EbtUint: + case EbtUint64: + return true; + default: + return false; + } +} + +__inline bool isTypeInt(TBasicType type) +{ + return isTypeSignedInt(type) || isTypeUnsignedInt(type); +} + +__inline bool isTypeFloat(TBasicType type) +{ + switch (type) { + case EbtFloat: + case EbtDouble: + case EbtFloat16: + return true; + default: + return false; + } +} + +__inline int getTypeRank(TBasicType type) { + int res = -1; + switch(type) { + case EbtInt8: + case EbtUint8: + res = 0; + break; + case EbtInt16: + case EbtUint16: + res = 1; + break; + case EbtInt: + case EbtUint: + res = 2; + break; + case EbtInt64: + case EbtUint64: + res = 3; + break; + default: + assert(false); + break; + } + return res; +} + } // end namespace glslang #endif // _BASICTYPES_INCLUDED_ diff --git a/deps/glslang/glslang/Include/Common.h b/deps/glslang/glslang/Include/Common.h index 08201548..35eaa310 100644 --- a/deps/glslang/glslang/Include/Common.h +++ b/deps/glslang/glslang/Include/Common.h @@ -37,9 +37,24 @@ #ifndef _COMMON_INCLUDED_ #define _COMMON_INCLUDED_ + +#if defined(__ANDROID__) || _MSC_VER < 1700 +#include +namespace std { +template +std::string to_string(const T& val) { + std::ostringstream os; + os << val; + return os.str(); +} +} +#endif + #if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) || defined MINGW_HAS_SECURE_API #include + #ifndef snprintf #define snprintf sprintf_s + #endif #define safe_vsprintf(buf,max,format,args) vsnprintf_s((buf), (max), (max), (format), (args)) #elif defined (solaris) #define safe_vsprintf(buf,max,format,args) vsnprintf((buf), (max), (format), (args)) @@ -51,31 +66,24 @@ #define UINT_PTR uintptr_t #endif -#if defined(__ANDROID__) || _MSC_VER < 1700 -#include -namespace std { -template -std::string to_string(const T& val) { - std::ostringstream os; - os << val; - return os.str(); -} -} +#if defined(_MSC_VER) && _MSC_VER < 1800 + #include + inline long long int strtoll (const char* str, char** endptr, int base) + { + return _strtoi64(str, endptr, base); + } + inline unsigned long long int strtoull (const char* str, char** endptr, int base) + { + return _strtoui64(str, endptr, base); + } + inline long long int atoll (const char* str) + { + return strtoll(str, NULL, 10); + } #endif -#if defined(_MSC_VER) && _MSC_VER < 1800 -inline long long int strtoll (const char* str, char** endptr, int base) -{ - return _strtoi64(str, endptr, base); -} -inline unsigned long long int strtoull (const char* str, char** endptr, int base) -{ - return _strtoui64(str, endptr, base); -} -inline long long int atoll (const char* str) -{ - return strtoll(str, NULL, 10); -} +#if defined(_MSC_VER) +#define strdup _strdup #endif /* windows only pragma */ @@ -151,7 +159,7 @@ inline TString* NewPoolTString(const char* s) return new(memory) TString(s); } -template inline T* NewPoolObject(T) +template inline T* NewPoolObject(T*) { return new(GetThreadPoolAllocator().allocate(sizeof(T))) T; } @@ -222,6 +230,7 @@ inline const TString String(const int i, const int /*base*/ = 10) struct TSourceLoc { void init() { name = nullptr; string = 0; line = 0; column = 0; } + void init(int stringNum) { init(); string = stringNum; } // Returns the name if it exists. Otherwise, returns the string number. std::string getStringNameOrNum(bool quoteStringName = true) const { @@ -235,7 +244,10 @@ struct TSourceLoc { int column; }; -typedef TMap TPragmaTable; +class TPragmaTable : public TMap { +public: + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) +}; const int MaxTokenLength = 1024; diff --git a/deps/glslang/glslang/Include/ConstantUnion.h b/deps/glslang/glslang/Include/ConstantUnion.h index f66a7ff5..3e933401 100644 --- a/deps/glslang/glslang/Include/ConstantUnion.h +++ b/deps/glslang/glslang/Include/ConstantUnion.h @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -37,6 +38,9 @@ #ifndef _CONSTANT_UNION_INCLUDED_ #define _CONSTANT_UNION_INCLUDED_ +#include "../Include/Common.h" +#include "../Include/BaseTypes.h" + namespace glslang { class TConstUnion { @@ -45,6 +49,30 @@ class TConstUnion { TConstUnion() : iConst(0), type(EbtInt) { } + void setI8Const(signed char i) + { + i8Const = i; + type = EbtInt8; + } + + void setU8Const(unsigned char u) + { + u8Const = u; + type = EbtUint8; + } + + void setI16Const(signed short i) + { + i16Const = i; + type = EbtInt16; + } + + void setU16Const(unsigned short u) + { + u16Const = u; + type = EbtUint16; + } + void setIConst(int i) { iConst = i; @@ -87,6 +115,10 @@ class TConstUnion { type = EbtString; } + signed char getI8Const() const { return i8Const; } + unsigned char getU8Const() const { return u8Const; } + signed short getI16Const() const { return i16Const; } + unsigned short getU16Const() const { return u16Const; } int getIConst() const { return iConst; } unsigned int getUConst() const { return uConst; } long long getI64Const() const { return i64Const; } @@ -95,6 +127,38 @@ class TConstUnion { bool getBConst() const { return bConst; } const TString* getSConst() const { return sConst; } + bool operator==(const signed char i) const + { + if (i == i8Const) + return true; + + return false; + } + + bool operator==(const unsigned char u) const + { + if (u == u8Const) + return true; + + return false; + } + + bool operator==(const signed short i) const + { + if (i == i16Const) + return true; + + return false; + } + + bool operator==(const unsigned short u) const + { + if (u == u16Const) + return true; + + return false; + } + bool operator==(const int i) const { if (i == iConst) @@ -149,6 +213,26 @@ class TConstUnion { return false; switch (type) { + case EbtInt16: + if (constant.i16Const == i16Const) + return true; + + break; + case EbtUint16: + if (constant.u16Const == u16Const) + return true; + + break; + case EbtInt8: + if (constant.i8Const == i8Const) + return true; + + break; + case EbtUint8: + if (constant.u8Const == u8Const) + return true; + + break; case EbtInt: if (constant.iConst == iConst) return true; @@ -186,6 +270,26 @@ class TConstUnion { return false; } + bool operator!=(const signed char i) const + { + return !operator==(i); + } + + bool operator!=(const unsigned char u) const + { + return !operator==(u); + } + + bool operator!=(const signed short i) const + { + return !operator==(i); + } + + bool operator!=(const unsigned short u) const + { + return !operator==(u); + } + bool operator!=(const int i) const { return !operator==(i); @@ -225,6 +329,26 @@ class TConstUnion { { assert(type == constant.type); switch (type) { + case EbtInt8: + if (i8Const > constant.i8Const) + return true; + + return false; + case EbtUint8: + if (u8Const > constant.u8Const) + return true; + + return false; + case EbtInt16: + if (i16Const > constant.i16Const) + return true; + + return false; + case EbtUint16: + if (u16Const > constant.u16Const) + return true; + + return false; case EbtInt: if (iConst > constant.iConst) return true; @@ -260,6 +384,26 @@ class TConstUnion { { assert(type == constant.type); switch (type) { + case EbtInt8: + if (i8Const < constant.i8Const) + return true; + + return false; + case EbtUint8: + if (u8Const < constant.u8Const) + return true; + + return false; + case EbtInt16: + if (i16Const < constant.i16Const) + return true; + + return false; + case EbtUint16: + if (u16Const < constant.u16Const) + return true; + + return false; case EbtInt: if (iConst < constant.iConst) return true; @@ -296,9 +440,13 @@ class TConstUnion { TConstUnion returnValue; assert(type == constant.type); switch (type) { - case EbtInt: returnValue.setIConst(iConst + constant.iConst); break; - case EbtInt64: returnValue.setI64Const(i64Const + constant.i64Const); break; - case EbtUint: returnValue.setUConst(uConst + constant.uConst); break; + case EbtInt8: returnValue.setI8Const(i8Const + constant.i8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const + constant.i16Const); break; + case EbtInt: returnValue.setIConst(iConst + constant.iConst); break; + case EbtInt64: returnValue.setI64Const(i64Const + constant.i64Const); break; + case EbtUint8: returnValue.setU8Const(u8Const + constant.u8Const); break; + case EbtUint16: returnValue.setU16Const(u16Const + constant.u16Const); break; + case EbtUint: returnValue.setUConst(uConst + constant.uConst); break; case EbtUint64: returnValue.setU64Const(u64Const + constant.u64Const); break; case EbtDouble: returnValue.setDConst(dConst + constant.dConst); break; default: assert(false && "Default missing"); @@ -312,9 +460,13 @@ class TConstUnion { TConstUnion returnValue; assert(type == constant.type); switch (type) { - case EbtInt: returnValue.setIConst(iConst - constant.iConst); break; - case EbtInt64: returnValue.setI64Const(i64Const - constant.i64Const); break; - case EbtUint: returnValue.setUConst(uConst - constant.uConst); break; + case EbtInt8: returnValue.setI8Const(i8Const - constant.i8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const - constant.i16Const); break; + case EbtInt: returnValue.setIConst(iConst - constant.iConst); break; + case EbtInt64: returnValue.setI64Const(i64Const - constant.i64Const); break; + case EbtUint8: returnValue.setU8Const(u8Const - constant.u8Const); break; + case EbtUint16: returnValue.setU16Const(u16Const - constant.u16Const); break; + case EbtUint: returnValue.setUConst(uConst - constant.uConst); break; case EbtUint64: returnValue.setU64Const(u64Const - constant.u64Const); break; case EbtDouble: returnValue.setDConst(dConst - constant.dConst); break; default: assert(false && "Default missing"); @@ -328,9 +480,13 @@ class TConstUnion { TConstUnion returnValue; assert(type == constant.type); switch (type) { - case EbtInt: returnValue.setIConst(iConst * constant.iConst); break; - case EbtInt64: returnValue.setI64Const(i64Const * constant.i64Const); break; - case EbtUint: returnValue.setUConst(uConst * constant.uConst); break; + case EbtInt8: returnValue.setI8Const(i8Const * constant.i8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const * constant.i16Const); break; + case EbtInt: returnValue.setIConst(iConst * constant.iConst); break; + case EbtInt64: returnValue.setI64Const(i64Const * constant.i64Const); break; + case EbtUint8: returnValue.setU8Const(u8Const * constant.u8Const); break; + case EbtUint16: returnValue.setU16Const(u16Const * constant.u16Const); break; + case EbtUint: returnValue.setUConst(uConst * constant.uConst); break; case EbtUint64: returnValue.setU64Const(u64Const * constant.u64Const); break; case EbtDouble: returnValue.setDConst(dConst * constant.dConst); break; default: assert(false && "Default missing"); @@ -344,9 +500,13 @@ class TConstUnion { TConstUnion returnValue; assert(type == constant.type); switch (type) { - case EbtInt: returnValue.setIConst(iConst % constant.iConst); break; - case EbtInt64: returnValue.setI64Const(i64Const % constant.i64Const); break; - case EbtUint: returnValue.setUConst(uConst % constant.uConst); break; + case EbtInt8: returnValue.setI8Const(i8Const % constant.i8Const); break; + case EbtInt16: returnValue.setI8Const(i8Const % constant.i16Const); break; + case EbtInt: returnValue.setIConst(iConst % constant.iConst); break; + case EbtInt64: returnValue.setI64Const(i64Const % constant.i64Const); break; + case EbtUint8: returnValue.setU8Const(u8Const % constant.u8Const); break; + case EbtUint16: returnValue.setU16Const(u16Const % constant.u16Const); break; + case EbtUint: returnValue.setUConst(uConst % constant.uConst); break; case EbtUint64: returnValue.setU64Const(u64Const % constant.u64Const); break; default: assert(false && "Default missing"); } @@ -358,8 +518,64 @@ class TConstUnion { { TConstUnion returnValue; switch (type) { + case EbtInt8: + switch (constant.type) { + case EbtInt8: returnValue.setI8Const(i8Const >> constant.i8Const); break; + case EbtUint8: returnValue.setI8Const(i8Const >> constant.u8Const); break; + case EbtInt16: returnValue.setI8Const(i8Const >> constant.i16Const); break; + case EbtUint16: returnValue.setI8Const(i8Const >> constant.u16Const); break; + case EbtInt: returnValue.setI8Const(i8Const >> constant.iConst); break; + case EbtUint: returnValue.setI8Const(i8Const >> constant.uConst); break; + case EbtInt64: returnValue.setI8Const(i8Const >> constant.i64Const); break; + case EbtUint64: returnValue.setI8Const(i8Const >> constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtUint8: + switch (constant.type) { + case EbtInt8: returnValue.setU8Const(u8Const >> constant.i8Const); break; + case EbtUint8: returnValue.setU8Const(u8Const >> constant.u8Const); break; + case EbtInt16: returnValue.setU8Const(u8Const >> constant.i16Const); break; + case EbtUint16: returnValue.setU8Const(u8Const >> constant.u16Const); break; + case EbtInt: returnValue.setU8Const(u8Const >> constant.iConst); break; + case EbtUint: returnValue.setU8Const(u8Const >> constant.uConst); break; + case EbtInt64: returnValue.setU8Const(u8Const >> constant.i64Const); break; + case EbtUint64: returnValue.setU8Const(u8Const >> constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtInt16: + switch (constant.type) { + case EbtInt8: returnValue.setI16Const(i16Const >> constant.i8Const); break; + case EbtUint8: returnValue.setI16Const(i16Const >> constant.u8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const >> constant.i16Const); break; + case EbtUint16: returnValue.setI16Const(i16Const >> constant.u16Const); break; + case EbtInt: returnValue.setI16Const(i16Const >> constant.iConst); break; + case EbtUint: returnValue.setI16Const(i16Const >> constant.uConst); break; + case EbtInt64: returnValue.setI16Const(i16Const >> constant.i64Const); break; + case EbtUint64: returnValue.setI16Const(i16Const >> constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtUint16: + switch (constant.type) { + case EbtInt8: returnValue.setU16Const(u16Const >> constant.i8Const); break; + case EbtUint8: returnValue.setU16Const(u16Const >> constant.u8Const); break; + case EbtInt16: returnValue.setU16Const(u16Const >> constant.i16Const); break; + case EbtUint16: returnValue.setU16Const(u16Const >> constant.u16Const); break; + case EbtInt: returnValue.setU16Const(u16Const >> constant.iConst); break; + case EbtUint: returnValue.setU16Const(u16Const >> constant.uConst); break; + case EbtInt64: returnValue.setU16Const(u16Const >> constant.i64Const); break; + case EbtUint64: returnValue.setU16Const(u16Const >> constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; case EbtInt: switch (constant.type) { + case EbtInt8: returnValue.setIConst(iConst >> constant.i8Const); break; + case EbtUint8: returnValue.setIConst(iConst >> constant.u8Const); break; + case EbtInt16: returnValue.setIConst(iConst >> constant.i16Const); break; + case EbtUint16: returnValue.setIConst(iConst >> constant.u16Const); break; case EbtInt: returnValue.setIConst(iConst >> constant.iConst); break; case EbtUint: returnValue.setIConst(iConst >> constant.uConst); break; case EbtInt64: returnValue.setIConst(iConst >> constant.i64Const); break; @@ -369,6 +585,10 @@ class TConstUnion { break; case EbtUint: switch (constant.type) { + case EbtInt8: returnValue.setUConst(uConst >> constant.i8Const); break; + case EbtUint8: returnValue.setUConst(uConst >> constant.u8Const); break; + case EbtInt16: returnValue.setUConst(uConst >> constant.i16Const); break; + case EbtUint16: returnValue.setUConst(uConst >> constant.u16Const); break; case EbtInt: returnValue.setUConst(uConst >> constant.iConst); break; case EbtUint: returnValue.setUConst(uConst >> constant.uConst); break; case EbtInt64: returnValue.setUConst(uConst >> constant.i64Const); break; @@ -378,6 +598,10 @@ class TConstUnion { break; case EbtInt64: switch (constant.type) { + case EbtInt8: returnValue.setI64Const(i64Const >> constant.i8Const); break; + case EbtUint8: returnValue.setI64Const(i64Const >> constant.u8Const); break; + case EbtInt16: returnValue.setI64Const(i64Const >> constant.i16Const); break; + case EbtUint16: returnValue.setI64Const(i64Const >> constant.u16Const); break; case EbtInt: returnValue.setI64Const(i64Const >> constant.iConst); break; case EbtUint: returnValue.setI64Const(i64Const >> constant.uConst); break; case EbtInt64: returnValue.setI64Const(i64Const >> constant.i64Const); break; @@ -387,6 +611,10 @@ class TConstUnion { break; case EbtUint64: switch (constant.type) { + case EbtInt8: returnValue.setU64Const(u64Const >> constant.i8Const); break; + case EbtUint8: returnValue.setU64Const(u64Const >> constant.u8Const); break; + case EbtInt16: returnValue.setU64Const(u64Const >> constant.i16Const); break; + case EbtUint16: returnValue.setU64Const(u64Const >> constant.u16Const); break; case EbtInt: returnValue.setU64Const(u64Const >> constant.iConst); break; case EbtUint: returnValue.setU64Const(u64Const >> constant.uConst); break; case EbtInt64: returnValue.setU64Const(u64Const >> constant.i64Const); break; @@ -404,8 +632,64 @@ class TConstUnion { { TConstUnion returnValue; switch (type) { + case EbtInt8: + switch (constant.type) { + case EbtInt8: returnValue.setI8Const(i8Const << constant.i8Const); break; + case EbtUint8: returnValue.setI8Const(i8Const << constant.u8Const); break; + case EbtInt16: returnValue.setI8Const(i8Const << constant.i16Const); break; + case EbtUint16: returnValue.setI8Const(i8Const << constant.u16Const); break; + case EbtInt: returnValue.setI8Const(i8Const << constant.iConst); break; + case EbtUint: returnValue.setI8Const(i8Const << constant.uConst); break; + case EbtInt64: returnValue.setI8Const(i8Const << constant.i64Const); break; + case EbtUint64: returnValue.setI8Const(i8Const << constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtUint8: + switch (constant.type) { + case EbtInt8: returnValue.setU8Const(u8Const << constant.i8Const); break; + case EbtUint8: returnValue.setU8Const(u8Const << constant.u8Const); break; + case EbtInt16: returnValue.setU8Const(u8Const << constant.i16Const); break; + case EbtUint16: returnValue.setU8Const(u8Const << constant.u16Const); break; + case EbtInt: returnValue.setU8Const(u8Const << constant.iConst); break; + case EbtUint: returnValue.setU8Const(u8Const << constant.uConst); break; + case EbtInt64: returnValue.setU8Const(u8Const << constant.i64Const); break; + case EbtUint64: returnValue.setU8Const(u8Const << constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtInt16: + switch (constant.type) { + case EbtInt8: returnValue.setI16Const(i16Const << constant.i8Const); break; + case EbtUint8: returnValue.setI16Const(i16Const << constant.u8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const << constant.i16Const); break; + case EbtUint16: returnValue.setI16Const(i16Const << constant.u16Const); break; + case EbtInt: returnValue.setI16Const(i16Const << constant.iConst); break; + case EbtUint: returnValue.setI16Const(i16Const << constant.uConst); break; + case EbtInt64: returnValue.setI16Const(i16Const << constant.i64Const); break; + case EbtUint64: returnValue.setI16Const(i16Const << constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtUint16: + switch (constant.type) { + case EbtInt8: returnValue.setU16Const(u16Const << constant.i8Const); break; + case EbtUint8: returnValue.setU16Const(u16Const << constant.u8Const); break; + case EbtInt16: returnValue.setU16Const(u16Const << constant.i16Const); break; + case EbtUint16: returnValue.setU16Const(u16Const << constant.u16Const); break; + case EbtInt: returnValue.setU16Const(u16Const << constant.iConst); break; + case EbtUint: returnValue.setU16Const(u16Const << constant.uConst); break; + case EbtInt64: returnValue.setU16Const(u16Const << constant.i64Const); break; + case EbtUint64: returnValue.setU16Const(u16Const << constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; case EbtInt: switch (constant.type) { + case EbtInt8: returnValue.setIConst(iConst << constant.i8Const); break; + case EbtUint8: returnValue.setIConst(iConst << constant.u8Const); break; + case EbtInt16: returnValue.setIConst(iConst << constant.i16Const); break; + case EbtUint16: returnValue.setIConst(iConst << constant.u16Const); break; case EbtInt: returnValue.setIConst(iConst << constant.iConst); break; case EbtUint: returnValue.setIConst(iConst << constant.uConst); break; case EbtInt64: returnValue.setIConst(iConst << constant.i64Const); break; @@ -415,6 +699,10 @@ class TConstUnion { break; case EbtUint: switch (constant.type) { + case EbtInt8: returnValue.setUConst(uConst << constant.i8Const); break; + case EbtUint8: returnValue.setUConst(uConst << constant.u8Const); break; + case EbtInt16: returnValue.setUConst(uConst << constant.i16Const); break; + case EbtUint16: returnValue.setUConst(uConst << constant.u16Const); break; case EbtInt: returnValue.setUConst(uConst << constant.iConst); break; case EbtUint: returnValue.setUConst(uConst << constant.uConst); break; case EbtInt64: returnValue.setUConst(uConst << constant.i64Const); break; @@ -422,8 +710,12 @@ class TConstUnion { default: assert(false && "Default missing"); } break; - case EbtInt64: + case EbtInt64: switch (constant.type) { + case EbtInt8: returnValue.setI64Const(i64Const << constant.i8Const); break; + case EbtUint8: returnValue.setI64Const(i64Const << constant.u8Const); break; + case EbtInt16: returnValue.setI64Const(i64Const << constant.i16Const); break; + case EbtUint16: returnValue.setI64Const(i64Const << constant.u16Const); break; case EbtInt: returnValue.setI64Const(i64Const << constant.iConst); break; case EbtUint: returnValue.setI64Const(i64Const << constant.uConst); break; case EbtInt64: returnValue.setI64Const(i64Const << constant.i64Const); break; @@ -433,6 +725,10 @@ class TConstUnion { break; case EbtUint64: switch (constant.type) { + case EbtInt8: returnValue.setU64Const(u64Const << constant.i8Const); break; + case EbtUint8: returnValue.setU64Const(u64Const << constant.u8Const); break; + case EbtInt16: returnValue.setU64Const(u64Const << constant.i16Const); break; + case EbtUint16: returnValue.setU64Const(u64Const << constant.u16Const); break; case EbtInt: returnValue.setU64Const(u64Const << constant.iConst); break; case EbtUint: returnValue.setU64Const(u64Const << constant.uConst); break; case EbtInt64: returnValue.setU64Const(u64Const << constant.i64Const); break; @@ -451,8 +747,12 @@ class TConstUnion { TConstUnion returnValue; assert(type == constant.type); switch (type) { - case EbtInt: returnValue.setIConst(iConst & constant.iConst); break; - case EbtUint: returnValue.setUConst(uConst & constant.uConst); break; + case EbtInt8: returnValue.setI8Const(i8Const & constant.i8Const); break; + case EbtUint8: returnValue.setU8Const(u8Const & constant.u8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const & constant.i16Const); break; + case EbtUint16: returnValue.setU16Const(u16Const & constant.u16Const); break; + case EbtInt: returnValue.setIConst(iConst & constant.iConst); break; + case EbtUint: returnValue.setUConst(uConst & constant.uConst); break; case EbtInt64: returnValue.setI64Const(i64Const & constant.i64Const); break; case EbtUint64: returnValue.setU64Const(u64Const & constant.u64Const); break; default: assert(false && "Default missing"); @@ -466,8 +766,12 @@ class TConstUnion { TConstUnion returnValue; assert(type == constant.type); switch (type) { - case EbtInt: returnValue.setIConst(iConst | constant.iConst); break; - case EbtUint: returnValue.setUConst(uConst | constant.uConst); break; + case EbtInt8: returnValue.setI8Const(i8Const | constant.i8Const); break; + case EbtUint8: returnValue.setU8Const(u8Const | constant.u8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const | constant.i16Const); break; + case EbtUint16: returnValue.setU16Const(u16Const | constant.u16Const); break; + case EbtInt: returnValue.setIConst(iConst | constant.iConst); break; + case EbtUint: returnValue.setUConst(uConst | constant.uConst); break; case EbtInt64: returnValue.setI64Const(i64Const | constant.i64Const); break; case EbtUint64: returnValue.setU64Const(u64Const | constant.u64Const); break; default: assert(false && "Default missing"); @@ -481,8 +785,12 @@ class TConstUnion { TConstUnion returnValue; assert(type == constant.type); switch (type) { - case EbtInt: returnValue.setIConst(iConst ^ constant.iConst); break; - case EbtUint: returnValue.setUConst(uConst ^ constant.uConst); break; + case EbtInt8: returnValue.setI8Const(i8Const ^ constant.i8Const); break; + case EbtUint8: returnValue.setU8Const(u8Const ^ constant.u8Const); break; + case EbtInt16: returnValue.setI16Const(i16Const ^ constant.i16Const); break; + case EbtUint16: returnValue.setU16Const(u16Const ^ constant.u16Const); break; + case EbtInt: returnValue.setIConst(iConst ^ constant.iConst); break; + case EbtUint: returnValue.setUConst(uConst ^ constant.uConst); break; case EbtInt64: returnValue.setI64Const(i64Const ^ constant.i64Const); break; case EbtUint64: returnValue.setU64Const(u64Const ^ constant.u64Const); break; default: assert(false && "Default missing"); @@ -495,8 +803,12 @@ class TConstUnion { { TConstUnion returnValue; switch (type) { - case EbtInt: returnValue.setIConst(~iConst); break; - case EbtUint: returnValue.setUConst(~uConst); break; + case EbtInt8: returnValue.setI8Const(~i8Const); break; + case EbtUint8: returnValue.setU8Const(~u8Const); break; + case EbtInt16: returnValue.setI16Const(~i16Const); break; + case EbtUint16: returnValue.setU16Const(~u16Const); break; + case EbtInt: returnValue.setIConst(~iConst); break; + case EbtUint: returnValue.setUConst(~uConst); break; case EbtInt64: returnValue.setI64Const(~i64Const); break; case EbtUint64: returnValue.setU64Const(~u64Const); break; default: assert(false && "Default missing"); @@ -533,6 +845,10 @@ class TConstUnion { private: union { + signed char i8Const; // used for i8vec, scalar int8s + unsigned char u8Const; // used for u8vec, scalar uint8s + signed short i16Const; // used for i16vec, scalar int16s + unsigned short u16Const; // used for u16vec, scalar uint16s int iConst; // used for ivec, scalar ints unsigned int uConst; // used for uvec, scalar uints long long i64Const; // used for i64vec, scalar int64s @@ -595,9 +911,6 @@ class TConstUnionArray { if (! unionArray || ! rhs.unionArray) return false; - if (! unionArray || ! rhs.unionArray) - return false; - return *unionArray == *rhs.unionArray; } bool operator!=(const TConstUnionArray& rhs) const { return ! operator==(rhs); } diff --git a/deps/glslang/glslang/Include/InitializeGlobals.h b/deps/glslang/glslang/Include/InitializeGlobals.h index 4cf2dca7..95d0a40e 100644 --- a/deps/glslang/glslang/Include/InitializeGlobals.h +++ b/deps/glslang/glslang/Include/InitializeGlobals.h @@ -37,10 +37,7 @@ namespace glslang { -void InitializeMemoryPools(); -void FreeGlobalPools(); bool InitializePoolIndex(); -void FreePoolIndex(); } // end namespace glslang diff --git a/deps/glslang/glslang/Include/PoolAlloc.h b/deps/glslang/glslang/Include/PoolAlloc.h index 69bacb15..0e237a6a 100644 --- a/deps/glslang/glslang/Include/PoolAlloc.h +++ b/deps/glslang/glslang/Include/PoolAlloc.h @@ -250,15 +250,8 @@ class TPoolAllocator { // different times. But a simple use is to have a global pop // with everyone using the same global allocator. // -typedef TPoolAllocator* PoolAllocatorPointer; extern TPoolAllocator& GetThreadPoolAllocator(); - -struct TThreadMemoryPools -{ - TPoolAllocator* threadPoolAllocator; -}; - -void SetThreadPoolAllocator(TPoolAllocator& poolAllocator); +void SetThreadPoolAllocator(TPoolAllocator* poolAllocator); // // This STL compatible allocator is intended to be used as the allocator diff --git a/deps/glslang/glslang/Include/ShHandle.h b/deps/glslang/glslang/Include/ShHandle.h index 64ba6d63..df07bd8e 100644 --- a/deps/glslang/glslang/Include/ShHandle.h +++ b/deps/glslang/glslang/Include/ShHandle.h @@ -56,11 +56,14 @@ class TUniformMap; // class TShHandleBase { public: - TShHandleBase() { } - virtual ~TShHandleBase() { } + TShHandleBase() { pool = new glslang::TPoolAllocator; } + virtual ~TShHandleBase() { delete pool; } virtual TCompiler* getAsCompiler() { return 0; } virtual TLinker* getAsLinker() { return 0; } virtual TUniformMap* getAsUniformMap() { return 0; } + virtual glslang::TPoolAllocator* getPool() const { return pool; } +private: + glslang::TPoolAllocator* pool; }; // diff --git a/deps/glslang/glslang/Include/Types.h b/deps/glslang/glslang/Include/Types.h index b5b91f52..39d6737c 100644 --- a/deps/glslang/glslang/Include/Types.h +++ b/deps/glslang/glslang/Include/Types.h @@ -2,6 +2,7 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2016 LunarG, Inc. // Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -204,9 +205,18 @@ struct TSampler { // misnomer now; includes images, textures without sampler, } switch (type) { - case EbtFloat: break; - case EbtInt: s.append("i"); break; - case EbtUint: s.append("u"); break; + case EbtFloat: break; +#ifdef AMD_EXTENSIONS + case EbtFloat16: s.append("f16"); break; +#endif + case EbtInt8: s.append("i8"); break; + case EbtUint16: s.append("u8"); break; + case EbtInt16: s.append("i16"); break; + case EbtUint8: s.append("u16"); break; + case EbtInt: s.append("i"); break; + case EbtUint: s.append("u"); break; + case EbtInt64: s.append("i64"); break; + case EbtUint64: s.append("u64"); break; default: break; // some compilers want this } if (image) { @@ -427,6 +437,7 @@ class TQualifier { clearInterstage(); clearMemory(); specConstant = false; + nonUniform = false; clearLayout(); } @@ -460,7 +471,7 @@ class TQualifier { // Drop just the storage qualification, which perhaps should // never be done, as it is fundamentally inconsistent, but need to // explore what downstream consumers need. - // E.g., in a deference, it is an inconsistency between: + // E.g., in a dereference, it is an inconsistency between: // A) partially dereferenced resource is still in the storage class it started in // B) partially dereferenced resource is a new temporary object // If A, then nothing should change, if B, then everything should change, but this is half way. @@ -468,6 +479,7 @@ class TQualifier { { storage = EvqTemporary; specConstant = false; + nonUniform = false; } const char* semanticName; @@ -492,6 +504,7 @@ class TQualifier { bool readonly : 1; bool writeonly : 1; bool specConstant : 1; // having a constant_id is not sufficient: expressions have no id, but are still specConstant + bool nonUniform : 1; bool isMemory() const { @@ -505,6 +518,12 @@ class TQualifier { return flat || smooth || nopersp; #endif } +#ifdef AMD_EXTENSIONS + bool isExplicitInterpolation() const + { + return explicitInterp; + } +#endif bool isAuxiliary() const { return centroid || patch || sample; @@ -650,15 +669,19 @@ class TQualifier { layoutXfbOffset = layoutXfbOffsetEnd; } - bool hasLayout() const + bool hasNonXfbLayout() const { return hasUniformLayout() || hasAnyLocation() || hasStream() || - hasXfb() || hasFormat() || layoutPushConstant; } + bool hasLayout() const + { + return hasNonXfbLayout() || + hasXfb(); + } TLayoutMatrix layoutMatrix : 3; TLayoutPacking layoutPacking : 4; int layoutOffset; @@ -813,6 +836,10 @@ class TQualifier { // true front-end constant. return specConstant; } + bool isNonUniform() const + { + return nonUniform; + } bool isFrontEndConstant() const { // True if the front-end knows the final constant value. @@ -1152,6 +1179,7 @@ class TType { sampler.clear(); qualifier.clear(); qualifier.storage = q; + assert(!(isMatrix() && vectorSize != 0)); // prevent vectorSize != 0 on matrices } // for explicit precision qualifier TType(TBasicType t, TStorageQualifier q, TPrecisionQualifier p, int vs = 1, int mc = 0, int mr = 0, @@ -1164,6 +1192,7 @@ class TType { qualifier.storage = q; qualifier.precision = p; assert(p >= EpqNone && p <= EpqHigh); + assert(!(isMatrix() && vectorSize != 0)); // prevent vectorSize != 0 on matrices } // for turning a TPublicType into a TType, using a shallow copy explicit TType(const TPublicType& p) : @@ -1293,31 +1322,9 @@ class TType { void makeVector() { vector1 = true; } - // Merge type from parent, where a parentType is at the beginning of a declaration, - // establishing some characteristics for all subsequent names, while this type - // is on the individual names. - void mergeType(const TPublicType& parentType) - { - // arrayness is currently the only child aspect that has to be preserved - basicType = parentType.basicType; - vectorSize = parentType.vectorSize; - matrixCols = parentType.matrixCols; - matrixRows = parentType.matrixRows; - vector1 = false; // TPublicType is only GLSL which so far has no vec1 - qualifier = parentType.qualifier; - sampler = parentType.sampler; - if (parentType.arraySizes) - newArraySizes(*parentType.arraySizes); - if (parentType.userDef) { - structure = parentType.userDef->getWritableStruct(); - setTypeName(parentType.userDef->getTypeName()); - } - } - virtual void hideMember() { basicType = EbtVoid; vectorSize = 1; } virtual bool hiddenMember() const { return basicType == EbtVoid; } - virtual void setTypeName(const TString& n) { typeName = NewPoolTString(n.c_str()); } virtual void setFieldName(const TString& n) { fieldName = NewPoolTString(n.c_str()); } virtual const TString& getTypeName() const { @@ -1347,33 +1354,31 @@ class TType { virtual bool isArrayOfArrays() const { return arraySizes != nullptr && arraySizes->getNumDims() > 1; } virtual int getImplicitArraySize() const { return arraySizes->getImplicitSize(); } virtual const TArraySizes* getArraySizes() const { return arraySizes; } - virtual TArraySizes& getArraySizes() { assert(arraySizes != nullptr); return *arraySizes; } + virtual TArraySizes* getArraySizes() { return arraySizes; } virtual bool isScalar() const { return ! isVector() && ! isMatrix() && ! isStruct() && ! isArray(); } virtual bool isScalarOrVec1() const { return isScalar() || vector1; } virtual bool isVector() const { return vectorSize > 1 || vector1; } virtual bool isMatrix() const { return matrixCols ? true : false; } virtual bool isArray() const { return arraySizes != nullptr; } - virtual bool isExplicitlySizedArray() const { return isArray() && getOuterArraySize() != UnsizedArraySize; } - virtual bool isImplicitlySizedArray() const { return isArray() && getOuterArraySize() == UnsizedArraySize && qualifier.storage != EvqBuffer; } - virtual bool isRuntimeSizedArray() const { return isArray() && getOuterArraySize() == UnsizedArraySize && qualifier.storage == EvqBuffer; } + virtual bool isSizedArray() const { return isArray() && arraySizes->isSized(); } + virtual bool isUnsizedArray() const { return isArray() && !arraySizes->isSized(); } + virtual bool isArrayVariablyIndexed() const { assert(isArray()); return arraySizes->isVariablyIndexed(); } + virtual void setArrayVariablyIndexed() { assert(isArray()); arraySizes->setVariablyIndexed(); } + virtual void updateImplicitArraySize(int size) { assert(isArray()); arraySizes->updateImplicitSize(size); } virtual bool isStruct() const { return structure != nullptr; } -#ifdef AMD_EXTENSIONS virtual bool isFloatingDomain() const { return basicType == EbtFloat || basicType == EbtDouble || basicType == EbtFloat16; } -#else - virtual bool isFloatingDomain() const { return basicType == EbtFloat || basicType == EbtDouble; } -#endif virtual bool isIntegerDomain() const { switch (basicType) { + case EbtInt8: + case EbtUint8: + case EbtInt16: + case EbtUint16: case EbtInt: case EbtUint: case EbtInt64: case EbtUint64: -#ifdef AMD_EXTENSIONS - case EbtInt16: - case EbtUint16: -#endif case EbtAtomicUint: return true; default: @@ -1385,11 +1390,12 @@ class TType { virtual bool isBuiltIn() const { return getQualifier().builtIn != EbvNone; } // "Image" is a superset of "Subpass" - virtual bool isImage() const { return basicType == EbtSampler && getSampler().isImage(); } + virtual bool isImage() const { return basicType == EbtSampler && getSampler().isImage(); } virtual bool isSubpass() const { return basicType == EbtSampler && getSampler().isSubpass(); } + virtual bool isTexture() const { return basicType == EbtSampler && getSampler().isTexture(); } // return true if this type contains any subtype which satisfies the given predicate. - template + template bool contains(P predicate) const { if (predicate(this)) @@ -1418,10 +1424,10 @@ class TType { return contains([this](const TType* t) { return t != this && t->isStruct(); } ); } - // Recursively check the structure for any implicitly-sized arrays, needed for triggering a copyUp(). - virtual bool containsImplicitlySizedArray() const + // Recursively check the structure for any unsized arrays, needed for triggering a copyUp(). + virtual bool containsUnsizedArray() const { - return contains([](const TType* t) { return t->isImplicitlySizedArray(); } ); + return contains([](const TType* t) { return t->isUnsizedArray(); } ); } virtual bool containsOpaque() const @@ -1442,17 +1448,15 @@ class TType { case EbtVoid: case EbtFloat: case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif + case EbtInt8: + case EbtUint8: + case EbtInt16: + case EbtUint16: case EbtInt: case EbtUint: case EbtInt64: case EbtUint64: -#ifdef AMD_EXTENSIONS - case EbtInt16: - case EbtUint16: -#endif case EbtBool: return true; default: @@ -1487,34 +1491,51 @@ class TType { assert(type.arraySizes != nullptr); *arraySizes = *type.arraySizes; } - void newArraySizes(const TArraySizes& s) + void copyArraySizes(const TArraySizes& s) { // For setting a fresh new set of array sizes, not yet worrying about sharing. arraySizes = new TArraySizes; *arraySizes = s; } + void transferArraySizes(TArraySizes* s) + { + // For setting an already allocated set of sizes that this type can use + // (no copy made). + arraySizes = s; + } void clearArraySizes() { - arraySizes = 0; + arraySizes = nullptr; } - void addArrayOuterSizes(const TArraySizes& s) + + // Add inner array sizes, to any existing sizes, via copy; the + // sizes passed in can still be reused for other purposes. + void copyArrayInnerSizes(const TArraySizes* s) { - if (arraySizes == nullptr) - newArraySizes(s); - else - arraySizes->addOuterSizes(s); + if (s != nullptr) { + if (arraySizes == nullptr) + copyArraySizes(*s); + else + arraySizes->addInnerSizes(*s); + } } void changeOuterArraySize(int s) { arraySizes->changeOuterSize(s); } - void setImplicitArraySize(int s) { arraySizes->setImplicitSize(s); } - // Recursively make the implicit array size the explicit array size, through the type tree. - void adoptImplicitArraySizes() + // Recursively make the implicit array size the explicit array size. + // Expicit arrays are compile-time or link-time sized, never run-time sized. + // Sometimes, policy calls for an array to be run-time sized even if it was + // never variably indexed: Don't turn a 'skipNonvariablyIndexed' array into + // an explicit array. + void adoptImplicitArraySizes(bool skipNonvariablyIndexed) { - if (isImplicitlySizedArray()) + if (isUnsizedArray() && !(skipNonvariablyIndexed || isArrayVariablyIndexed())) changeOuterArraySize(getImplicitArraySize()); - if (isStruct()) { - for (int i = 0; i < (int)structure->size(); ++i) - (*structure)[i].type->adoptImplicitArraySizes(); + if (isStruct() && structure->size() > 0) { + int lastMember = (int)structure->size() - 1; + for (int i = 0; i < lastMember; ++i) + (*structure)[i].type->adoptImplicitArraySizes(false); + // implement the "last member of an SSBO" policy + (*structure)[lastMember].type->adoptImplicitArraySizes(getQualifier().storage == EvqBuffer); } } @@ -1529,17 +1550,15 @@ class TType { case EbtVoid: return "void"; case EbtFloat: return "float"; case EbtDouble: return "double"; -#ifdef AMD_EXTENSIONS case EbtFloat16: return "float16_t"; -#endif + case EbtInt8: return "int8_t"; + case EbtUint8: return "uint8_t"; + case EbtInt16: return "int16_t"; + case EbtUint16: return "uint16_t"; case EbtInt: return "int"; case EbtUint: return "uint"; case EbtInt64: return "int64_t"; case EbtUint64: return "uint64_t"; -#ifdef AMD_EXTENSIONS - case EbtInt16: return "int16_t"; - case EbtUint16: return "uint16_t"; -#endif case EbtBool: return "bool"; case EbtAtomicUint: return "atomic_uint"; case EbtSampler: return "sampler/image"; @@ -1678,16 +1697,26 @@ class TType { appendStr(" writeonly"); if (qualifier.specConstant) appendStr(" specialization-constant"); + if (qualifier.nonUniform) + appendStr(" nonuniform"); appendStr(" "); appendStr(getStorageQualifierString()); if (isArray()) { for(int i = 0; i < (int)arraySizes->getNumDims(); ++i) { int size = arraySizes->getDimSize(i); - if (size == 0) - appendStr(" implicitly-sized array of"); + if (size == UnsizedArraySize && i == 0 && arraySizes->isVariablyIndexed()) + appendStr(" runtime-sized array of"); else { - appendStr(" "); - appendInt(arraySizes->getDimSize(i)); + if (size == UnsizedArraySize) { + appendStr(" unsized"); + if (i == 0) { + appendStr(" "); + appendInt(arraySizes->getImplicitSize()); + } + } else { + appendStr(" "); + appendInt(arraySizes->getDimSize(i)); + } appendStr("-element array of"); } } diff --git a/deps/glslang/glslang/Include/arrays.h b/deps/glslang/glslang/Include/arrays.h index bc21c6c5..7e1f9396 100644 --- a/deps/glslang/glslang/Include/arrays.h +++ b/deps/glslang/glslang/Include/arrays.h @@ -41,6 +41,12 @@ #ifndef _ARRAYS_INCLUDED #define _ARRAYS_INCLUDED +#include + +#ifdef max +#undef max +#endif + namespace glslang { // This is used to mean there is no size yet (unsized), it is waiting to get a size from somewhere else. @@ -130,10 +136,10 @@ struct TSmallArrayVector { sizes->push_back(pair); } - void push_front(const TSmallArrayVector& newDims) + void push_back(const TSmallArrayVector& newDims) { alloc(); - sizes->insert(sizes->begin(), newDims.sizes->begin(), newDims.sizes->end()); + sizes->insert(sizes->end(), newDims.sizes->begin(), newDims.sizes->end()); } void pop_front() @@ -220,12 +226,13 @@ struct TSmallArrayVector { struct TArraySizes { POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) - TArraySizes() : implicitArraySize(1) { } + TArraySizes() : implicitArraySize(1), variablyIndexed(false) { } // For breaking into two non-shared copies, independently modifiable. TArraySizes& operator=(const TArraySizes& from) { implicitArraySize = from.implicitArraySize; + variablyIndexed = from.variablyIndexed; sizes = from.sizes; return *this; @@ -252,10 +259,11 @@ struct TArraySizes { void addInnerSize(int s) { addInnerSize((unsigned)s, nullptr); } void addInnerSize(int s, TIntermTyped* n) { sizes.push_back((unsigned)s, n); } void addInnerSize(TArraySize pair) { sizes.push_back(pair.size, pair.node); } + void addInnerSizes(const TArraySizes& s) { sizes.push_back(s.sizes); } void changeOuterSize(int s) { sizes.changeFront((unsigned)s); } - int getImplicitSize() const { return (int)implicitArraySize; } - void setImplicitSize(int s) { implicitArraySize = s; } - bool isInnerImplicit() const + int getImplicitSize() const { return implicitArraySize; } + void updateImplicitSize(int s) { implicitArraySize = std::max(implicitArraySize, s); } + bool isInnerUnsized() const { for (int d = 1; d < sizes.size(); ++d) { if (sizes.getDimSize(d) == (unsigned)UnsizedArraySize) @@ -264,6 +272,15 @@ struct TArraySizes { return false; } + bool clearInnerUnsized() + { + for (int d = 1; d < sizes.size(); ++d) { + if (sizes.getDimSize(d) == (unsigned)UnsizedArraySize) + setDimSize(d, 1); + } + + return false; + } bool isInnerSpecialization() const { for (int d = 1; d < sizes.size(); ++d) { @@ -278,8 +295,8 @@ struct TArraySizes { return sizes.getDimNode(0) != nullptr; } - bool isImplicit() const { return getOuterSize() == UnsizedArraySize || isInnerImplicit(); } - void addOuterSizes(const TArraySizes& s) { sizes.push_front(s.sizes); } + bool hasUnsized() const { return getOuterSize() == UnsizedArraySize || isInnerUnsized(); } + bool isSized() const { return getOuterSize() != UnsizedArraySize; } void dereference() { sizes.pop_front(); } void copyDereferenced(const TArraySizes& rhs) { @@ -302,6 +319,9 @@ struct TArraySizes { return true; } + void setVariablyIndexed() { variablyIndexed = true; } + bool isVariablyIndexed() const { return variablyIndexed; } + bool operator==(const TArraySizes& rhs) { return sizes == rhs.sizes; } bool operator!=(const TArraySizes& rhs) { return sizes != rhs.sizes; } @@ -310,9 +330,12 @@ struct TArraySizes { TArraySizes(const TArraySizes&); - // for tracking maximum referenced index, before an explicit size is given - // applies only to the outer-most dimension + // For tracking maximum referenced compile-time constant index. + // Applies only to the outer-most dimension. Potentially becomes + // the implicit size of the array, if not variably indexed and + // otherwise legal. int implicitArraySize; + bool variablyIndexed; // true if array is indexed with a non compile-time constant }; } // end namespace glslang diff --git a/deps/glslang/glslang/Include/intermediate.h b/deps/glslang/glslang/Include/intermediate.h index 6149b19b..19eb7aa8 100644 --- a/deps/glslang/glslang/Include/intermediate.h +++ b/deps/glslang/glslang/Include/intermediate.h @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2016 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -46,7 +47,7 @@ #ifndef __INTERMEDIATE_H #define __INTERMEDIATE_H -#if _MSC_VER >= 1900 +#if defined(_MSC_VER) && _MSC_VER >= 1900 #pragma warning(disable : 4464) // relative include path contains '..' #pragma warning(disable : 5026) // 'glslang::TIntermUnary': move constructor was implicitly defined as deleted #endif @@ -84,100 +85,189 @@ enum TOperator { EOpPreIncrement, EOpPreDecrement, + // (u)int* -> bool + EOpConvInt8ToBool, + EOpConvUint8ToBool, + EOpConvInt16ToBool, + EOpConvUint16ToBool, EOpConvIntToBool, EOpConvUintToBool, - EOpConvFloatToBool, - EOpConvDoubleToBool, EOpConvInt64ToBool, EOpConvUint64ToBool, - EOpConvBoolToFloat, - EOpConvIntToFloat, - EOpConvUintToFloat, - EOpConvDoubleToFloat, - EOpConvInt64ToFloat, - EOpConvUint64ToFloat, - EOpConvUintToInt, - EOpConvFloatToInt, + + // float* -> bool + EOpConvFloat16ToBool, + EOpConvFloatToBool, + EOpConvDoubleToBool, + + // bool -> (u)int* + EOpConvBoolToInt8, + EOpConvBoolToUint8, + EOpConvBoolToInt16, + EOpConvBoolToUint16, EOpConvBoolToInt, - EOpConvDoubleToInt, - EOpConvInt64ToInt, - EOpConvUint64ToInt, - EOpConvIntToUint, - EOpConvFloatToUint, EOpConvBoolToUint, - EOpConvDoubleToUint, - EOpConvInt64ToUint, - EOpConvUint64ToUint, - EOpConvIntToDouble, - EOpConvUintToDouble, - EOpConvFloatToDouble, - EOpConvBoolToDouble, - EOpConvInt64ToDouble, - EOpConvUint64ToDouble, EOpConvBoolToInt64, - EOpConvIntToInt64, - EOpConvUintToInt64, - EOpConvFloatToInt64, - EOpConvDoubleToInt64, - EOpConvUint64ToInt64, EOpConvBoolToUint64, + + // bool -> float* + EOpConvBoolToFloat16, + EOpConvBoolToFloat, + EOpConvBoolToDouble, + + // int8_t -> (u)int* + EOpConvInt8ToInt16, + EOpConvInt8ToInt, + EOpConvInt8ToInt64, + EOpConvInt8ToUint8, + EOpConvInt8ToUint16, + EOpConvInt8ToUint, + EOpConvInt8ToUint64, + + // uint8_t -> (u)int* + EOpConvUint8ToInt8, + EOpConvUint8ToInt16, + EOpConvUint8ToInt, + EOpConvUint8ToInt64, + EOpConvUint8ToUint16, + EOpConvUint8ToUint, + EOpConvUint8ToUint64, + + // int8_t -> float* + EOpConvInt8ToFloat16, + EOpConvInt8ToFloat, + EOpConvInt8ToDouble, + + // uint8_t -> float* + EOpConvUint8ToFloat16, + EOpConvUint8ToFloat, + EOpConvUint8ToDouble, + + // int16_t -> (u)int* + EOpConvInt16ToInt8, + EOpConvInt16ToInt, + EOpConvInt16ToInt64, + EOpConvInt16ToUint8, + EOpConvInt16ToUint16, + EOpConvInt16ToUint, + EOpConvInt16ToUint64, + + // uint16_t -> (u)int* + EOpConvUint16ToInt8, + EOpConvUint16ToInt16, + EOpConvUint16ToInt, + EOpConvUint16ToInt64, + EOpConvUint16ToUint8, + EOpConvUint16ToUint, + EOpConvUint16ToUint64, + + // int16_t -> float* + EOpConvInt16ToFloat16, + EOpConvInt16ToFloat, + EOpConvInt16ToDouble, + + // uint16_t -> float* + EOpConvUint16ToFloat16, + EOpConvUint16ToFloat, + EOpConvUint16ToDouble, + + // int32_t -> (u)int* + EOpConvIntToInt8, + EOpConvIntToInt16, + EOpConvIntToInt64, + EOpConvIntToUint8, + EOpConvIntToUint16, + EOpConvIntToUint, EOpConvIntToUint64, + + // uint32_t -> (u)int* + EOpConvUintToInt8, + EOpConvUintToInt16, + EOpConvUintToInt, + EOpConvUintToInt64, + EOpConvUintToUint8, + EOpConvUintToUint16, EOpConvUintToUint64, - EOpConvFloatToUint64, - EOpConvDoubleToUint64, - EOpConvInt64ToUint64, -#ifdef AMD_EXTENSIONS - EOpConvBoolToFloat16, + + // int32_t -> float* EOpConvIntToFloat16, + EOpConvIntToFloat, + EOpConvIntToDouble, + + // uint32_t -> float* EOpConvUintToFloat16, - EOpConvFloatToFloat16, - EOpConvDoubleToFloat16, + EOpConvUintToFloat, + EOpConvUintToDouble, + + // int64_t -> (u)int* + EOpConvInt64ToInt8, + EOpConvInt64ToInt16, + EOpConvInt64ToInt, + EOpConvInt64ToUint8, + EOpConvInt64ToUint16, + EOpConvInt64ToUint, + EOpConvInt64ToUint64, + + // uint64_t -> (u)int* + EOpConvUint64ToInt8, + EOpConvUint64ToInt16, + EOpConvUint64ToInt, + EOpConvUint64ToInt64, + EOpConvUint64ToUint8, + EOpConvUint64ToUint16, + EOpConvUint64ToUint, + + // int64_t -> float* EOpConvInt64ToFloat16, + EOpConvInt64ToFloat, + EOpConvInt64ToDouble, + + // uint64_t -> float* EOpConvUint64ToFloat16, - EOpConvFloat16ToBool, + EOpConvUint64ToFloat, + EOpConvUint64ToDouble, + + // float16_t -> (u)int* + EOpConvFloat16ToInt8, + EOpConvFloat16ToInt16, EOpConvFloat16ToInt, + EOpConvFloat16ToInt64, + EOpConvFloat16ToUint8, + EOpConvFloat16ToUint16, EOpConvFloat16ToUint, + EOpConvFloat16ToUint64, + + // float16_t -> float* EOpConvFloat16ToFloat, EOpConvFloat16ToDouble, - EOpConvFloat16ToInt64, - EOpConvFloat16ToUint64, - EOpConvBoolToInt16, - EOpConvIntToInt16, - EOpConvUintToInt16, + // float -> (u)int* + EOpConvFloatToInt8, EOpConvFloatToInt16, - EOpConvDoubleToInt16, - EOpConvFloat16ToInt16, - EOpConvInt64ToInt16, - EOpConvUint64ToInt16, - EOpConvUint16ToInt16, - EOpConvInt16ToBool, - EOpConvInt16ToInt, - EOpConvInt16ToUint, - EOpConvInt16ToFloat, - EOpConvInt16ToDouble, - EOpConvInt16ToFloat16, - EOpConvInt16ToInt64, - EOpConvInt16ToUint64, - - EOpConvBoolToUint16, - EOpConvIntToUint16, - EOpConvUintToUint16, + EOpConvFloatToInt, + EOpConvFloatToInt64, + EOpConvFloatToUint8, EOpConvFloatToUint16, + EOpConvFloatToUint, + EOpConvFloatToUint64, + + // float -> float* + EOpConvFloatToFloat16, + EOpConvFloatToDouble, + + // float64 _t-> (u)int* + EOpConvDoubleToInt8, + EOpConvDoubleToInt16, + EOpConvDoubleToInt, + EOpConvDoubleToInt64, + EOpConvDoubleToUint8, EOpConvDoubleToUint16, - EOpConvFloat16ToUint16, - EOpConvInt64ToUint16, - EOpConvUint64ToUint16, - EOpConvInt16ToUint16, - EOpConvUint16ToBool, - EOpConvUint16ToInt, - EOpConvUint16ToUint, - EOpConvUint16ToFloat, - EOpConvUint16ToDouble, - EOpConvUint16ToFloat16, - EOpConvUint16ToInt64, - EOpConvUint16ToUint64, -#endif + EOpConvDoubleToUint, + EOpConvDoubleToUint64, + + // float64_t -> float* + EOpConvDoubleToFloat16, + EOpConvDoubleToFloat, // // binary operations @@ -280,12 +370,10 @@ enum TOperator { EOpDoubleBitsToUint64, EOpInt64BitsToDouble, EOpUint64BitsToDouble, -#ifdef AMD_EXTENSIONS EOpFloat16BitsToInt16, EOpFloat16BitsToUint16, EOpInt16BitsToFloat16, EOpUint16BitsToFloat16, -#endif EOpPackSnorm2x16, EOpUnpackSnorm2x16, EOpPackUnorm2x16, @@ -302,7 +390,6 @@ enum TOperator { EOpUnpackInt2x32, EOpPackUint2x32, EOpUnpackUint2x32, -#ifdef AMD_EXTENSIONS EOpPackFloat2x16, EOpUnpackFloat2x16, EOpPackInt2x16, @@ -313,7 +400,12 @@ enum TOperator { EOpUnpackInt4x16, EOpPackUint4x16, EOpUnpackUint4x16, -#endif + EOpPack16, + EOpPack32, + EOpPack64, + EOpUnpack32, + EOpUnpack16, + EOpUnpack8, EOpLength, EOpDistance, @@ -379,6 +471,90 @@ enum TOperator { EOpAllInvocations, EOpAllInvocationsEqual, + EOpSubgroupGuardStart, + EOpSubgroupBarrier, + EOpSubgroupMemoryBarrier, + EOpSubgroupMemoryBarrierBuffer, + EOpSubgroupMemoryBarrierImage, + EOpSubgroupMemoryBarrierShared, // compute only + EOpSubgroupElect, + EOpSubgroupAll, + EOpSubgroupAny, + EOpSubgroupAllEqual, + EOpSubgroupBroadcast, + EOpSubgroupBroadcastFirst, + EOpSubgroupBallot, + EOpSubgroupInverseBallot, + EOpSubgroupBallotBitExtract, + EOpSubgroupBallotBitCount, + EOpSubgroupBallotInclusiveBitCount, + EOpSubgroupBallotExclusiveBitCount, + EOpSubgroupBallotFindLSB, + EOpSubgroupBallotFindMSB, + EOpSubgroupShuffle, + EOpSubgroupShuffleXor, + EOpSubgroupShuffleUp, + EOpSubgroupShuffleDown, + EOpSubgroupAdd, + EOpSubgroupMul, + EOpSubgroupMin, + EOpSubgroupMax, + EOpSubgroupAnd, + EOpSubgroupOr, + EOpSubgroupXor, + EOpSubgroupInclusiveAdd, + EOpSubgroupInclusiveMul, + EOpSubgroupInclusiveMin, + EOpSubgroupInclusiveMax, + EOpSubgroupInclusiveAnd, + EOpSubgroupInclusiveOr, + EOpSubgroupInclusiveXor, + EOpSubgroupExclusiveAdd, + EOpSubgroupExclusiveMul, + EOpSubgroupExclusiveMin, + EOpSubgroupExclusiveMax, + EOpSubgroupExclusiveAnd, + EOpSubgroupExclusiveOr, + EOpSubgroupExclusiveXor, + EOpSubgroupClusteredAdd, + EOpSubgroupClusteredMul, + EOpSubgroupClusteredMin, + EOpSubgroupClusteredMax, + EOpSubgroupClusteredAnd, + EOpSubgroupClusteredOr, + EOpSubgroupClusteredXor, + EOpSubgroupQuadBroadcast, + EOpSubgroupQuadSwapHorizontal, + EOpSubgroupQuadSwapVertical, + EOpSubgroupQuadSwapDiagonal, + +#ifdef NV_EXTENSIONS + EOpSubgroupPartition, + EOpSubgroupPartitionedAdd, + EOpSubgroupPartitionedMul, + EOpSubgroupPartitionedMin, + EOpSubgroupPartitionedMax, + EOpSubgroupPartitionedAnd, + EOpSubgroupPartitionedOr, + EOpSubgroupPartitionedXor, + EOpSubgroupPartitionedInclusiveAdd, + EOpSubgroupPartitionedInclusiveMul, + EOpSubgroupPartitionedInclusiveMin, + EOpSubgroupPartitionedInclusiveMax, + EOpSubgroupPartitionedInclusiveAnd, + EOpSubgroupPartitionedInclusiveOr, + EOpSubgroupPartitionedInclusiveXor, + EOpSubgroupPartitionedExclusiveAdd, + EOpSubgroupPartitionedExclusiveMul, + EOpSubgroupPartitionedExclusiveMin, + EOpSubgroupPartitionedExclusiveMax, + EOpSubgroupPartitionedExclusiveAnd, + EOpSubgroupPartitionedExclusiveOr, + EOpSubgroupPartitionedExclusiveXor, +#endif + + EOpSubgroupGuardStop, + #ifdef AMD_EXTENSIONS EOpMinInvocations, EOpMaxInvocations, @@ -417,8 +593,8 @@ enum TOperator { EOpAtomicExchange, EOpAtomicCompSwap, - EOpAtomicCounterIncrement, - EOpAtomicCounterDecrement, + EOpAtomicCounterIncrement, // results in pre-increment value + EOpAtomicCounterDecrement, // results in post-decrement value EOpAtomicCounter, EOpAtomicCounterAdd, EOpAtomicCounterSubtract, @@ -451,32 +627,36 @@ enum TOperator { EOpConstructGuardStart, EOpConstructInt, // these first scalar forms also identify what implicit conversion is needed EOpConstructUint, - EOpConstructInt64, - EOpConstructUint64, -#ifdef AMD_EXTENSIONS + EOpConstructInt8, + EOpConstructUint8, EOpConstructInt16, EOpConstructUint16, -#endif + EOpConstructInt64, + EOpConstructUint64, EOpConstructBool, EOpConstructFloat, EOpConstructDouble, -#ifdef AMD_EXTENSIONS - EOpConstructFloat16, -#endif EOpConstructVec2, EOpConstructVec3, EOpConstructVec4, EOpConstructDVec2, EOpConstructDVec3, EOpConstructDVec4, -#ifdef AMD_EXTENSIONS - EOpConstructF16Vec2, - EOpConstructF16Vec3, - EOpConstructF16Vec4, -#endif EOpConstructBVec2, EOpConstructBVec3, EOpConstructBVec4, + EOpConstructI8Vec2, + EOpConstructI8Vec3, + EOpConstructI8Vec4, + EOpConstructU8Vec2, + EOpConstructU8Vec3, + EOpConstructU8Vec4, + EOpConstructI16Vec2, + EOpConstructI16Vec3, + EOpConstructI16Vec4, + EOpConstructU16Vec2, + EOpConstructU16Vec3, + EOpConstructU16Vec4, EOpConstructIVec2, EOpConstructIVec3, EOpConstructIVec4, @@ -489,14 +669,6 @@ enum TOperator { EOpConstructU64Vec2, EOpConstructU64Vec3, EOpConstructU64Vec4, -#ifdef AMD_EXTENSIONS - EOpConstructI16Vec2, - EOpConstructI16Vec3, - EOpConstructI16Vec4, - EOpConstructU16Vec2, - EOpConstructU16Vec3, - EOpConstructU16Vec4, -#endif EOpConstructMat2x2, EOpConstructMat2x3, EOpConstructMat2x4, @@ -542,7 +714,10 @@ enum TOperator { EOpConstructBMat4x2, EOpConstructBMat4x3, EOpConstructBMat4x4, -#ifdef AMD_EXTENSIONS + EOpConstructFloat16, + EOpConstructF16Vec2, + EOpConstructF16Vec3, + EOpConstructF16Vec4, EOpConstructF16Mat2x2, EOpConstructF16Mat2x3, EOpConstructF16Mat2x4, @@ -552,9 +727,9 @@ enum TOperator { EOpConstructF16Mat4x2, EOpConstructF16Mat4x3, EOpConstructF16Mat4x4, -#endif EOpConstructStruct, EOpConstructTextureSampler, + EOpConstructNonuniform, // expected to be transformed away, not present in final AST EOpConstructGuardEnd, // @@ -581,7 +756,11 @@ enum TOperator { // Array operators // - EOpArrayLength, // "Array" distinguishes from length(v) built-in function, but it applies to vectors and matrices as well. + // Can apply to arrays, vectors, or matrices. + // Can be decomposed to a constant at compile time, but this does not always happen, + // due to link-time effects. So, consumer can expect either a link-time sized or + // run-time sized array. + EOpArrayLength, // // Image operations @@ -653,6 +832,8 @@ enum TOperator { EOpTextureGatherLod, EOpTextureGatherLodOffset, EOpTextureGatherLodOffsets, + EOpFragmentMaskFetch, + EOpFragmentFetch, #endif EOpSparseTextureGuardBegin, @@ -720,7 +901,8 @@ enum TOperator { EOpInterlockedOr, // ... EOpInterlockedXor, // ... EOpAllMemoryBarrierWithGroupSync, // memory barriers without non-hlsl AST equivalents - EOpGroupMemoryBarrierWithGroupSync, // ... + EOpDeviceMemoryBarrier, // ... + EOpDeviceMemoryBarrierWithGroupSync, // ... EOpWorkgroupMemoryBarrier, // ... EOpWorkgroupMemoryBarrierWithGroupSync, // ... EOpEvaluateAttributeSnapped, // InterpolateAtOffset with int position on 16x16 grid @@ -774,6 +956,12 @@ enum TOperator { // matrix EOpMatrixSwizzle, // select multiple matrix components (non-column) + + // SM6 wave ops + EOpWaveGetLaneCount, // Will decompose to gl_SubgroupSize. + EOpWaveGetLaneIndex, // Will decompose to gl_SubgroupInvocationID. + EOpWaveActiveCountBits, // Will decompose to subgroupBallotBitCount(subgroupBallot()). + EOpWavePrefixCountBits, // Will decompose to subgroupBallotInclusiveBitCount(subgroupBallot()). }; class TIntermTraverser; @@ -788,6 +976,7 @@ class TIntermBranch; class TIntermTyped; class TIntermMethod; class TIntermSymbol; +class TIntermLoop; } // end namespace glslang @@ -815,6 +1004,7 @@ class TIntermNode { virtual glslang::TIntermMethod* getAsMethodNode() { return 0; } virtual glslang::TIntermSymbol* getAsSymbolNode() { return 0; } virtual glslang::TIntermBranch* getAsBranchNode() { return 0; } + virtual glslang::TIntermLoop* getAsLoopNode() { return 0; } virtual const glslang::TIntermTyped* getAsTyped() const { return 0; } virtual const glslang::TIntermOperator* getAsOperator() const { return 0; } @@ -827,6 +1017,7 @@ class TIntermNode { virtual const glslang::TIntermMethod* getAsMethodNode() const { return 0; } virtual const glslang::TIntermSymbol* getAsSymbolNode() const { return 0; } virtual const glslang::TIntermBranch* getAsBranchNode() const { return 0; } + virtual const glslang::TIntermLoop* getAsLoopNode() const { return 0; } virtual ~TIntermNode() { } protected: @@ -870,6 +1061,8 @@ class TIntermTyped : public TIntermNode { virtual bool isVector() const { return type.isVector(); } virtual bool isScalar() const { return type.isScalar(); } virtual bool isStruct() const { return type.isStruct(); } + virtual bool isFloatingDomain() const { return type.isFloatingDomain(); } + virtual bool isIntegerDomain() const { return type.isIntegerDomain(); } TString getCompleteString() const { return type.getCompleteString(); } protected: @@ -877,24 +1070,6 @@ class TIntermTyped : public TIntermNode { TType type; }; -// -// Selection control hints -// -enum TSelectionControl { - ESelectionControlNone, - ESelectionControlFlatten, - ESelectionControlDontFlatten, -}; - -// -// Loop control hints -// -enum TLoopControl { - ELoopControlNone, - ELoopControlUnroll, - ELoopControlDontUnroll, -}; - // // Handle for, do-while, and while loops. // @@ -905,24 +1080,36 @@ class TIntermLoop : public TIntermNode { test(aTest), terminal(aTerminal), first(testFirst), - control(ELoopControlNone) + unroll(false), + dontUnroll(false), + dependency(0) { } + virtual TIntermLoop* getAsLoopNode() { return this; } + virtual const TIntermLoop* getAsLoopNode() const { return this; } virtual void traverse(TIntermTraverser*); TIntermNode* getBody() const { return body; } TIntermTyped* getTest() const { return test; } TIntermTyped* getTerminal() const { return terminal; } bool testFirst() const { return first; } - void setLoopControl(TLoopControl c) { control = c; } - TLoopControl getLoopControl() const { return control; } + void setUnroll() { unroll = true; } + void setDontUnroll() { dontUnroll = true; } + bool getUnroll() const { return unroll; } + bool getDontUnroll() const { return dontUnroll; } + + static const unsigned int dependencyInfinite = 0xFFFFFFFF; + void setLoopDependency(int d) { dependency = d; } + int getLoopDependency() const { return dependency; } protected: TIntermNode* body; // code to loop over TIntermTyped* test; // exit condition associated with loop, could be 0 for 'for' loops TIntermTyped* terminal; // exists for for-loops bool first; // true for while and for, not for do-while - TLoopControl control; // loop control hint + bool unroll; // true if unroll requested + bool dontUnroll; // true if request to not unroll + unsigned int dependency; // loop dependency hint; 0 means not set or unknown }; // @@ -990,6 +1177,10 @@ class TIntermSymbol : public TIntermTyped { int getFlattenSubset() const { return flattenSubset; } // -1 means full object #endif + // This is meant for cases where a node has already been constructed, and + // later on, it becomes necessary to switch to a different symbol. + virtual void switchId(int newId) { id = newId; } + protected: int id; // the unique id of the symbol this node represents #ifdef ENABLE_HLSL @@ -1032,6 +1223,9 @@ struct TCrackedTextureOp { bool grad; bool subpass; bool lodClamp; +#ifdef AMD_EXTENSIONS + bool fragMask; +#endif }; // @@ -1079,6 +1273,9 @@ class TIntermOperator : public TIntermTyped { cracked.grad = false; cracked.subpass = false; cracked.lodClamp = false; +#ifdef AMD_EXTENSIONS + cracked.fragMask = false; +#endif switch (op) { case EOpImageQuerySize: @@ -1210,6 +1407,14 @@ class TIntermOperator : public TIntermTyped { case EOpSparseImageLoadLod: cracked.lod = true; break; + case EOpFragmentMaskFetch: + cracked.subpass = sampler.dim == EsdSubpass; + cracked.fragMask = true; + break; + case EOpFragmentFetch: + cracked.subpass = sampler.dim == EsdSubpass; + cracked.fragMask = true; + break; #endif case EOpSubpassLoad: case EOpSubpassLoadMS: @@ -1270,14 +1475,14 @@ class TIntermUnary : public TIntermOperator { }; typedef TVector TIntermSequence; -typedef TVector TQualifierList; +typedef TVector TQualifierList; // // Nodes that operate on an arbitrary sized set of children. // class TIntermAggregate : public TIntermOperator { public: - TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(0) { } - TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(0) { } + TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(nullptr) { } + TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(nullptr) { } ~TIntermAggregate() { delete pragmaTable; } virtual TIntermAggregate* getAsAggregate() { return this; } virtual const TIntermAggregate* getAsAggregate() const { return this; } @@ -1295,7 +1500,7 @@ class TIntermAggregate : public TIntermOperator { void setDebug(bool d) { debug = d; } bool getOptimize() const { return optimize; } bool getDebug() const { return debug; } - void addToPragmaTable(const TPragmaTable& pTable); + void setPragmaTable(const TPragmaTable& pTable); const TPragmaTable& getPragmaTable() const { return *pragmaTable; } protected: TIntermAggregate(const TIntermAggregate&); // disallow copy constructor @@ -1315,22 +1520,35 @@ class TIntermAggregate : public TIntermOperator { class TIntermSelection : public TIntermTyped { public: TIntermSelection(TIntermTyped* cond, TIntermNode* trueB, TIntermNode* falseB) : - TIntermTyped(EbtVoid), condition(cond), trueBlock(trueB), falseBlock(falseB), control(ESelectionControlNone) {} + TIntermTyped(EbtVoid), condition(cond), trueBlock(trueB), falseBlock(falseB), + shortCircuit(true), + flatten(false), dontFlatten(false) {} TIntermSelection(TIntermTyped* cond, TIntermNode* trueB, TIntermNode* falseB, const TType& type) : - TIntermTyped(type), condition(cond), trueBlock(trueB), falseBlock(falseB), control(ESelectionControlNone) {} + TIntermTyped(type), condition(cond), trueBlock(trueB), falseBlock(falseB), + shortCircuit(true), + flatten(false), dontFlatten(false) {} virtual void traverse(TIntermTraverser*); virtual TIntermTyped* getCondition() const { return condition; } virtual TIntermNode* getTrueBlock() const { return trueBlock; } virtual TIntermNode* getFalseBlock() const { return falseBlock; } virtual TIntermSelection* getAsSelectionNode() { return this; } virtual const TIntermSelection* getAsSelectionNode() const { return this; } - void setSelectionControl(TSelectionControl c) { control = c; } - TSelectionControl getSelectionControl() const { return control; } + + void setNoShortCircuit() { shortCircuit = false; } + bool getShortCircuit() const { return shortCircuit; } + + void setFlatten() { flatten = true; } + void setDontFlatten() { dontFlatten = true; } + bool getFlatten() const { return flatten; } + bool getDontFlatten() const { return dontFlatten; } + protected: TIntermTyped* condition; TIntermNode* trueBlock; TIntermNode* falseBlock; - TSelectionControl control; // selection control hint + bool shortCircuit; // normally all if-then-else and all GLSL ?: short-circuit, but HLSL ?: does not + bool flatten; // true if flatten requested + bool dontFlatten; // true if requested to not flatten }; // @@ -1341,18 +1559,24 @@ class TIntermSelection : public TIntermTyped { // class TIntermSwitch : public TIntermNode { public: - TIntermSwitch(TIntermTyped* cond, TIntermAggregate* b) : condition(cond), body(b), control(ESelectionControlNone) { } + TIntermSwitch(TIntermTyped* cond, TIntermAggregate* b) : condition(cond), body(b), + flatten(false), dontFlatten(false) {} virtual void traverse(TIntermTraverser*); virtual TIntermNode* getCondition() const { return condition; } virtual TIntermAggregate* getBody() const { return body; } virtual TIntermSwitch* getAsSwitchNode() { return this; } virtual const TIntermSwitch* getAsSwitchNode() const { return this; } - void setSelectionControl(TSelectionControl c) { control = c; } - TSelectionControl getSelectionControl() const { return control; } + + void setFlatten() { flatten = true; } + void setDontFlatten() { dontFlatten = true; } + bool getFlatten() const { return flatten; } + bool getDontFlatten() const { return dontFlatten; } + protected: TIntermTyped* condition; TIntermAggregate* body; - TSelectionControl control; // selection control hint + bool flatten; // true if flatten requested + bool dontFlatten; // true if requested to not flatten }; enum TVisit diff --git a/deps/glslang/glslang/Include/revision.h b/deps/glslang/glslang/Include/revision.h index 218f8b67..ea5e30cb 100644 --- a/deps/glslang/glslang/Include/revision.h +++ b/deps/glslang/glslang/Include/revision.h @@ -1,6 +1,3 @@ // This header is generated by the make-revision script. -// For the version, it uses the latest git tag followed by the number of commits. -// For the date, it uses the current date (when then script is run). -#define GLSLANG_REVISION "Overload400-PrecQual.2000" -#define GLSLANG_DATE "12-Apr-2017" +#define GLSLANG_PATCH_LEVEL 2691 diff --git a/deps/glslang/glslang/MachineIndependent/Constant.cpp b/deps/glslang/glslang/MachineIndependent/Constant.cpp index 625b8e94..142492dc 100644 --- a/deps/glslang/glslang/MachineIndependent/Constant.cpp +++ b/deps/glslang/glslang/MachineIndependent/Constant.cpp @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -38,6 +39,7 @@ #include #include #include +#include namespace { @@ -176,11 +178,40 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right switch (getType().getBasicType()) { case EbtDouble: case EbtFloat: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif newConstArray[i].setDConst(leftUnionArray[i].getDConst() / rightUnionArray[i].getDConst()); break; + case EbtInt8: + if (rightUnionArray[i] == 0) + newConstArray[i].setI8Const(0x7F); + else if (rightUnionArray[i].getI8Const() == -1 && leftUnionArray[i].getI8Const() == (signed char)0x80) + newConstArray[i].setI8Const((signed char)0x80); + else + newConstArray[i].setI8Const(leftUnionArray[i].getI8Const() / rightUnionArray[i].getI8Const()); + break; + + case EbtUint8: + if (rightUnionArray[i] == 0) { + newConstArray[i].setU8Const(0xFF); + } else + newConstArray[i].setU8Const(leftUnionArray[i].getU8Const() / rightUnionArray[i].getU8Const()); + break; + + case EbtInt16: + if (rightUnionArray[i] == 0) + newConstArray[i].setI16Const(0x7FFF); + else if (rightUnionArray[i].getI16Const() == -1 && leftUnionArray[i].getI16Const() == (signed short)0x8000) + newConstArray[i].setI16Const(short(0x8000)); + else + newConstArray[i].setI16Const(leftUnionArray[i].getI16Const() / rightUnionArray[i].getI16Const()); + break; + + case EbtUint16: + if (rightUnionArray[i] == 0) { + newConstArray[i].setU16Const(0xFFFF); + } else + newConstArray[i].setU16Const(leftUnionArray[i].getU16Const() / rightUnionArray[i].getU16Const()); + break; case EbtInt: if (rightUnionArray[i] == 0) @@ -213,23 +244,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right } else newConstArray[i].setU64Const(leftUnionArray[i].getU64Const() / rightUnionArray[i].getU64Const()); break; -#ifdef AMD_EXTENSIONS - case EbtInt16: - if (rightUnionArray[i] == 0) - newConstArray[i].setIConst(0x7FFF); - else if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == (int)0x8000) - newConstArray[i].setIConst(0x8000); - else - newConstArray[i].setIConst(leftUnionArray[i].getIConst() / rightUnionArray[i].getIConst()); - break; - - case EbtUint16: - if (rightUnionArray[i] == 0) { - newConstArray[i].setUConst(0xFFFFu); - } else - newConstArray[i].setUConst(leftUnionArray[i].getUConst() / rightUnionArray[i].getUConst()); - break; -#endif default: return 0; } @@ -263,8 +277,31 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right for (int i = 0; i < newComps; i++) { if (rightUnionArray[i] == 0) newConstArray[i] = leftUnionArray[i]; - else - newConstArray[i] = leftUnionArray[i] % rightUnionArray[i]; + else { + switch (getType().getBasicType()) { + case EbtInt: + if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == INT_MIN) { + newConstArray[i].setIConst(0); + break; + } else goto modulo_default; + + case EbtInt64: + if (rightUnionArray[i].getI64Const() == -1 && leftUnionArray[i].getI64Const() == LLONG_MIN) { + newConstArray[i].setI64Const(0); + break; + } else goto modulo_default; +#ifdef AMD_EXTENSIONS + case EbtInt16: + if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == SHRT_MIN) { + newConstArray[i].setIConst(0); + break; + } else goto modulo_default; +#endif + default: + modulo_default: + newConstArray[i] = leftUnionArray[i] % rightUnionArray[i]; + } + } } break; @@ -387,6 +424,12 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType) resultSize = 2; break; + case EOpPack16: + case EOpPack32: + case EOpPack64: + case EOpUnpack32: + case EOpUnpack16: + case EOpUnpack8: case EOpNormalize: componentWise = false; resultSize = objectSize; @@ -445,6 +488,12 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType) case EOpPackSnorm2x16: case EOpPackUnorm2x16: case EOpPackHalf2x16: + case EOpPack16: + case EOpPack32: + case EOpPack64: + case EOpUnpack32: + case EOpUnpack16: + case EOpUnpack8: case EOpUnpackSnorm2x16: case EOpUnpackUnorm2x16: @@ -470,17 +519,13 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType) case EOpNegative: switch (getType().getBasicType()) { case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif case EbtFloat: newConstArray[i].setDConst(-unionArray[i].getDConst()); break; -#ifdef AMD_EXTENSIONS - case EbtInt16: -#endif + case EbtInt8: newConstArray[i].setI8Const(-unionArray[i].getI8Const()); break; + case EbtUint8: newConstArray[i].setU8Const(static_cast(-static_cast(unionArray[i].getU8Const()))); break; + case EbtInt16: newConstArray[i].setI16Const(-unionArray[i].getI16Const()); break; + case EbtUint16:newConstArray[i].setU16Const(static_cast(-static_cast(unionArray[i].getU16Const()))); break; case EbtInt: newConstArray[i].setIConst(-unionArray[i].getIConst()); break; -#ifdef AMD_EXTENSIONS - case EbtUint16: -#endif case EbtUint: newConstArray[i].setUConst(static_cast(-static_cast(unionArray[i].getUConst()))); break; case EbtInt64: newConstArray[i].setI64Const(-unionArray[i].getI64Const()); break; case EbtUint64: newConstArray[i].setU64Const(static_cast(-static_cast(unionArray[i].getU64Const()))); break; @@ -635,13 +680,10 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType) case EOpDoubleBitsToUint64: case EOpInt64BitsToDouble: case EOpUint64BitsToDouble: -#ifdef AMD_EXTENSIONS case EOpFloat16BitsToInt16: case EOpFloat16BitsToUint16: case EOpInt16BitsToFloat16: case EOpUint16BitsToFloat16: -#endif - default: return 0; } @@ -725,20 +767,6 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode) for (unsigned int arg = 0; arg < children.size(); ++arg) childConstUnions.push_back(children[arg]->getAsConstantUnion()->getConstArray()); - // Second, do the actual folding - - bool isFloatingPoint = children[0]->getAsTyped()->getBasicType() == EbtFloat || -#ifdef AMD_EXTENSIONS - children[0]->getAsTyped()->getBasicType() == EbtFloat16 || -#endif - children[0]->getAsTyped()->getBasicType() == EbtDouble; - bool isSigned = children[0]->getAsTyped()->getBasicType() == EbtInt || -#ifdef AMD_EXTENSIONS - children[0]->getAsTyped()->getBasicType() == EbtInt16 || -#endif - children[0]->getAsTyped()->getBasicType() == EbtInt64; - bool isInt64 = children[0]->getAsTyped()->getBasicType() == EbtInt64 || - children[0]->getAsTyped()->getBasicType() == EbtUint64; if (componentwise) { for (int comp = 0; comp < objectSize; comp++) { @@ -759,53 +787,114 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode) newConstArray[comp].setDConst(pow(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst())); break; case EOpMin: - if (isFloatingPoint) + switch(children[0]->getAsTyped()->getBasicType()) { + case EbtFloat16: + case EbtFloat: + case EbtDouble: newConstArray[comp].setDConst(std::min(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst())); - else if (isSigned) { - if (isInt64) - newConstArray[comp].setI64Const(std::min(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const())); - else - newConstArray[comp].setIConst(std::min(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst())); - } else { - if (isInt64) - newConstArray[comp].setU64Const(std::min(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const())); - else - newConstArray[comp].setUConst(std::min(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst())); + break; + case EbtInt8: + newConstArray[comp].setI8Const(std::min(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const())); + break; + case EbtUint8: + newConstArray[comp].setU8Const(std::min(childConstUnions[0][arg0comp].getU8Const(), childConstUnions[1][arg1comp].getU8Const())); + break; + case EbtInt16: + newConstArray[comp].setI16Const(std::min(childConstUnions[0][arg0comp].getI16Const(), childConstUnions[1][arg1comp].getI16Const())); + break; + case EbtUint16: + newConstArray[comp].setU16Const(std::min(childConstUnions[0][arg0comp].getU16Const(), childConstUnions[1][arg1comp].getU16Const())); + break; + case EbtInt: + newConstArray[comp].setIConst(std::min(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst())); + break; + case EbtUint: + newConstArray[comp].setUConst(std::min(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst())); + break; + case EbtInt64: + newConstArray[comp].setI64Const(std::min(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const())); + break; + case EbtUint64: + newConstArray[comp].setU64Const(std::min(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const())); + break; + default: assert(false && "Default missing"); } break; case EOpMax: - if (isFloatingPoint) + switch(children[0]->getAsTyped()->getBasicType()) { + case EbtFloat16: + case EbtFloat: + case EbtDouble: newConstArray[comp].setDConst(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst())); - else if (isSigned) { - if (isInt64) - newConstArray[comp].setI64Const(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const())); - else - newConstArray[comp].setIConst(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst())); - } else { - if (isInt64) - newConstArray[comp].setU64Const(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const())); - else - newConstArray[comp].setUConst(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst())); + break; + case EbtInt8: + newConstArray[comp].setI8Const(std::max(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const())); + break; + case EbtUint8: + newConstArray[comp].setU8Const(std::max(childConstUnions[0][arg0comp].getU8Const(), childConstUnions[1][arg1comp].getU8Const())); + break; + case EbtInt16: + newConstArray[comp].setI16Const(std::max(childConstUnions[0][arg0comp].getI16Const(), childConstUnions[1][arg1comp].getI16Const())); + break; + case EbtUint16: + newConstArray[comp].setU16Const(std::max(childConstUnions[0][arg0comp].getU16Const(), childConstUnions[1][arg1comp].getU16Const())); + break; + case EbtInt: + newConstArray[comp].setIConst(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst())); + break; + case EbtUint: + newConstArray[comp].setUConst(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst())); + break; + case EbtInt64: + newConstArray[comp].setI64Const(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const())); + break; + case EbtUint64: + newConstArray[comp].setU64Const(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const())); + break; + default: assert(false && "Default missing"); } break; case EOpClamp: - if (isFloatingPoint) + switch(children[0]->getAsTyped()->getBasicType()) { + case EbtFloat16: + case EbtFloat: + case EbtDouble: newConstArray[comp].setDConst(std::min(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()), childConstUnions[2][arg2comp].getDConst())); - else if (isSigned) { - if (isInt64) - newConstArray[comp].setI64Const(std::min(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()), - childConstUnions[2][arg2comp].getI64Const())); - else - newConstArray[comp].setIConst(std::min(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()), + break; + case EbtInt8: + newConstArray[comp].setI8Const(std::min(std::max(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const()), + childConstUnions[2][arg2comp].getI8Const())); + break; + case EbtUint8: + newConstArray[comp].setU8Const(std::min(std::max(childConstUnions[0][arg0comp].getU8Const(), childConstUnions[1][arg1comp].getU8Const()), + childConstUnions[2][arg2comp].getU8Const())); + break; + case EbtInt16: + newConstArray[comp].setI16Const(std::min(std::max(childConstUnions[0][arg0comp].getI16Const(), childConstUnions[1][arg1comp].getI16Const()), + childConstUnions[2][arg2comp].getI16Const())); + break; + case EbtUint16: + newConstArray[comp].setU16Const(std::min(std::max(childConstUnions[0][arg0comp].getU16Const(), childConstUnions[1][arg1comp].getU16Const()), + childConstUnions[2][arg2comp].getU16Const())); + break; + case EbtInt: + newConstArray[comp].setIConst(std::min(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()), childConstUnions[2][arg2comp].getIConst())); - } else { - if (isInt64) - newConstArray[comp].setU64Const(std::min(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()), - childConstUnions[2][arg2comp].getU64Const())); - else - newConstArray[comp].setUConst(std::min(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()), + break; + case EbtUint: + newConstArray[comp].setUConst(std::min(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()), childConstUnions[2][arg2comp].getUConst())); + break; + case EbtInt64: + newConstArray[comp].setI64Const(std::min(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()), + childConstUnions[2][arg2comp].getI64Const())); + break; + case EbtUint64: + newConstArray[comp].setU64Const(std::min(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()), + childConstUnions[2][arg2comp].getU64Const())); + break; + default: assert(false && "Default missing"); } break; case EOpLessThan: diff --git a/deps/glslang/glslang/MachineIndependent/Initialize.cpp b/deps/glslang/glslang/MachineIndependent/Initialize.cpp index 6e6660e8..5ae4dbd0 100644 --- a/deps/glslang/glslang/MachineIndependent/Initialize.cpp +++ b/deps/glslang/glslang/MachineIndependent/Initialize.cpp @@ -1,7 +1,8 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2016 LunarG, Inc. -// Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2015-2017 Google, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -83,6 +84,13 @@ TBuiltIns::TBuiltIns() // Set up textual representations for making all the permutations // of texturing/imaging functions. prefixes[EbtFloat] = ""; +#ifdef AMD_EXTENSIONS + prefixes[EbtFloat16] = "f16"; +#endif + prefixes[EbtInt8] = "i8"; + prefixes[EbtUint8] = "u8"; + prefixes[EbtInt16] = "i16"; + prefixes[EbtUint16] = "u16"; prefixes[EbtInt] = "i"; prefixes[EbtUint] = "u"; postfixes[2] = "2"; @@ -799,7 +807,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "bvec3 notEqual(u64vec3, u64vec3);" "bvec4 notEqual(u64vec4, u64vec4);" -#ifdef AMD_EXTENSIONS "int findLSB(int64_t);" "ivec2 findLSB(i64vec2);" "ivec3 findLSB(i64vec3);" @@ -819,7 +826,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "ivec2 findMSB(u64vec2);" "ivec3 findMSB(u64vec3);" "ivec4 findMSB(u64vec4);" -#endif + "\n" ); } @@ -888,6 +895,36 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f16vec3 mid3(f16vec3, f16vec3, f16vec3);" "f16vec4 mid3(f16vec4, f16vec4, f16vec4);" + "int16_t min3(int16_t, int16_t, int16_t);" + "i16vec2 min3(i16vec2, i16vec2, i16vec2);" + "i16vec3 min3(i16vec3, i16vec3, i16vec3);" + "i16vec4 min3(i16vec4, i16vec4, i16vec4);" + + "int16_t max3(int16_t, int16_t, int16_t);" + "i16vec2 max3(i16vec2, i16vec2, i16vec2);" + "i16vec3 max3(i16vec3, i16vec3, i16vec3);" + "i16vec4 max3(i16vec4, i16vec4, i16vec4);" + + "int16_t mid3(int16_t, int16_t, int16_t);" + "i16vec2 mid3(i16vec2, i16vec2, i16vec2);" + "i16vec3 mid3(i16vec3, i16vec3, i16vec3);" + "i16vec4 mid3(i16vec4, i16vec4, i16vec4);" + + "uint16_t min3(uint16_t, uint16_t, uint16_t);" + "u16vec2 min3(u16vec2, u16vec2, u16vec2);" + "u16vec3 min3(u16vec3, u16vec3, u16vec3);" + "u16vec4 min3(u16vec4, u16vec4, u16vec4);" + + "uint16_t max3(uint16_t, uint16_t, uint16_t);" + "u16vec2 max3(u16vec2, u16vec2, u16vec2);" + "u16vec3 max3(u16vec3, u16vec3, u16vec3);" + "u16vec4 max3(u16vec4, u16vec4, u16vec4);" + + "uint16_t mid3(uint16_t, uint16_t, uint16_t);" + "u16vec2 mid3(u16vec2, u16vec2, u16vec2);" + "u16vec3 mid3(u16vec3, u16vec3, u16vec3);" + "u16vec4 mid3(u16vec4, u16vec4, u16vec4);" + "\n" ); } @@ -923,6 +960,32 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } +#ifdef NV_EXTENSIONS + if (profile != EEsProfile && version >= 440) { + commonBuiltins.append( + "uint64_t atomicMin(coherent volatile inout uint64_t, uint64_t);" + " int64_t atomicMin(coherent volatile inout int64_t, int64_t);" + + "uint64_t atomicMax(coherent volatile inout uint64_t, uint64_t);" + " int64_t atomicMax(coherent volatile inout int64_t, int64_t);" + + "uint64_t atomicAnd(coherent volatile inout uint64_t, uint64_t);" + " int64_t atomicAnd(coherent volatile inout int64_t, int64_t);" + + "uint64_t atomicOr (coherent volatile inout uint64_t, uint64_t);" + " int64_t atomicOr (coherent volatile inout int64_t, int64_t);" + + "uint64_t atomicXor(coherent volatile inout uint64_t, uint64_t);" + " int64_t atomicXor(coherent volatile inout int64_t, int64_t);" + + " int64_t atomicAdd(coherent volatile inout int64_t, int64_t);" + " int64_t atomicExchange(coherent volatile inout int64_t, int64_t);" + " int64_t atomicCompSwap(coherent volatile inout int64_t, int64_t, int64_t);" + + "\n"); + } +#endif + if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 450)) { commonBuiltins.append( @@ -1324,10 +1387,25 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV if (profile == EEsProfile) { if (spvVersion.spv == 0) { + if (version < 300) { + commonBuiltins.append( + "vec4 texture2D(samplerExternalOES, vec2 coord);" // GL_OES_EGL_image_external + "vec4 texture2DProj(samplerExternalOES, vec3);" // GL_OES_EGL_image_external + "vec4 texture2DProj(samplerExternalOES, vec4);" // GL_OES_EGL_image_external + "\n"); + } else { + commonBuiltins.append( + "highp ivec2 textureSize(samplerExternalOES, int lod);" // GL_OES_EGL_image_external_essl3 + "vec4 texture(samplerExternalOES, vec2);" // GL_OES_EGL_image_external_essl3 + "vec4 texture(samplerExternalOES, vec2, float bias);" // GL_OES_EGL_image_external_essl3 + "vec4 textureProj(samplerExternalOES, vec3);" // GL_OES_EGL_image_external_essl3 + "vec4 textureProj(samplerExternalOES, vec3, float bias);" // GL_OES_EGL_image_external_essl3 + "vec4 textureProj(samplerExternalOES, vec4);" // GL_OES_EGL_image_external_essl3 + "vec4 textureProj(samplerExternalOES, vec4, float bias);" // GL_OES_EGL_image_external_essl3 + "vec4 texelFetch(samplerExternalOES, ivec2, int lod);" // GL_OES_EGL_image_external_essl3 + "\n"); + } commonBuiltins.append( - "vec4 texture2D(samplerExternalOES, vec2 coord);" // GL_OES_EGL_image_external, caught by keyword check - "vec4 texture2DProj(samplerExternalOES, vec3);" // GL_OES_EGL_image_external, caught by keyword check - "vec4 texture2DProj(samplerExternalOES, vec4);" // GL_OES_EGL_image_external, caught by keyword check "vec4 texture2DGradEXT(sampler2D, vec2, vec2, vec2);" // GL_EXT_shader_texture_lod "vec4 texture2DProjGradEXT(sampler2D, vec3, vec2, vec2);" // GL_EXT_shader_texture_lod "vec4 texture2DProjGradEXT(sampler2D, vec4, vec2, vec2);" // GL_EXT_shader_texture_lod @@ -1343,7 +1421,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV // // Noise functions. // - if (profile != EEsProfile) { + if (spvVersion.spv == 0 && profile != EEsProfile) { commonBuiltins.append( "float noise1(float x);" "float noise1(vec2 x);" @@ -1586,6 +1664,1087 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } + // GL_KHR_shader_subgroup + if (spvVersion.vulkan > 0) { + commonBuiltins.append( + "void subgroupBarrier();" + "void subgroupMemoryBarrier();" + "void subgroupMemoryBarrierBuffer();" + "void subgroupMemoryBarrierImage();" + "bool subgroupElect();" + + "bool subgroupAll(bool);\n" + "bool subgroupAny(bool);\n" + + "bool subgroupAllEqual(float);\n" + "bool subgroupAllEqual(vec2);\n" + "bool subgroupAllEqual(vec3);\n" + "bool subgroupAllEqual(vec4);\n" + "bool subgroupAllEqual(int);\n" + "bool subgroupAllEqual(ivec2);\n" + "bool subgroupAllEqual(ivec3);\n" + "bool subgroupAllEqual(ivec4);\n" + "bool subgroupAllEqual(uint);\n" + "bool subgroupAllEqual(uvec2);\n" + "bool subgroupAllEqual(uvec3);\n" + "bool subgroupAllEqual(uvec4);\n" + "bool subgroupAllEqual(bool);\n" + "bool subgroupAllEqual(bvec2);\n" + "bool subgroupAllEqual(bvec3);\n" + "bool subgroupAllEqual(bvec4);\n" + + "float subgroupBroadcast(float, uint);\n" + "vec2 subgroupBroadcast(vec2, uint);\n" + "vec3 subgroupBroadcast(vec3, uint);\n" + "vec4 subgroupBroadcast(vec4, uint);\n" + "int subgroupBroadcast(int, uint);\n" + "ivec2 subgroupBroadcast(ivec2, uint);\n" + "ivec3 subgroupBroadcast(ivec3, uint);\n" + "ivec4 subgroupBroadcast(ivec4, uint);\n" + "uint subgroupBroadcast(uint, uint);\n" + "uvec2 subgroupBroadcast(uvec2, uint);\n" + "uvec3 subgroupBroadcast(uvec3, uint);\n" + "uvec4 subgroupBroadcast(uvec4, uint);\n" + "bool subgroupBroadcast(bool, uint);\n" + "bvec2 subgroupBroadcast(bvec2, uint);\n" + "bvec3 subgroupBroadcast(bvec3, uint);\n" + "bvec4 subgroupBroadcast(bvec4, uint);\n" + + "float subgroupBroadcastFirst(float);\n" + "vec2 subgroupBroadcastFirst(vec2);\n" + "vec3 subgroupBroadcastFirst(vec3);\n" + "vec4 subgroupBroadcastFirst(vec4);\n" + "int subgroupBroadcastFirst(int);\n" + "ivec2 subgroupBroadcastFirst(ivec2);\n" + "ivec3 subgroupBroadcastFirst(ivec3);\n" + "ivec4 subgroupBroadcastFirst(ivec4);\n" + "uint subgroupBroadcastFirst(uint);\n" + "uvec2 subgroupBroadcastFirst(uvec2);\n" + "uvec3 subgroupBroadcastFirst(uvec3);\n" + "uvec4 subgroupBroadcastFirst(uvec4);\n" + "bool subgroupBroadcastFirst(bool);\n" + "bvec2 subgroupBroadcastFirst(bvec2);\n" + "bvec3 subgroupBroadcastFirst(bvec3);\n" + "bvec4 subgroupBroadcastFirst(bvec4);\n" + + "uvec4 subgroupBallot(bool);\n" + "bool subgroupInverseBallot(uvec4);\n" + "bool subgroupBallotBitExtract(uvec4, uint);\n" + "uint subgroupBallotBitCount(uvec4);\n" + "uint subgroupBallotInclusiveBitCount(uvec4);\n" + "uint subgroupBallotExclusiveBitCount(uvec4);\n" + "uint subgroupBallotFindLSB(uvec4);\n" + "uint subgroupBallotFindMSB(uvec4);\n" + + "float subgroupShuffle(float, uint);\n" + "vec2 subgroupShuffle(vec2, uint);\n" + "vec3 subgroupShuffle(vec3, uint);\n" + "vec4 subgroupShuffle(vec4, uint);\n" + "int subgroupShuffle(int, uint);\n" + "ivec2 subgroupShuffle(ivec2, uint);\n" + "ivec3 subgroupShuffle(ivec3, uint);\n" + "ivec4 subgroupShuffle(ivec4, uint);\n" + "uint subgroupShuffle(uint, uint);\n" + "uvec2 subgroupShuffle(uvec2, uint);\n" + "uvec3 subgroupShuffle(uvec3, uint);\n" + "uvec4 subgroupShuffle(uvec4, uint);\n" + "bool subgroupShuffle(bool, uint);\n" + "bvec2 subgroupShuffle(bvec2, uint);\n" + "bvec3 subgroupShuffle(bvec3, uint);\n" + "bvec4 subgroupShuffle(bvec4, uint);\n" + + "float subgroupShuffleXor(float, uint);\n" + "vec2 subgroupShuffleXor(vec2, uint);\n" + "vec3 subgroupShuffleXor(vec3, uint);\n" + "vec4 subgroupShuffleXor(vec4, uint);\n" + "int subgroupShuffleXor(int, uint);\n" + "ivec2 subgroupShuffleXor(ivec2, uint);\n" + "ivec3 subgroupShuffleXor(ivec3, uint);\n" + "ivec4 subgroupShuffleXor(ivec4, uint);\n" + "uint subgroupShuffleXor(uint, uint);\n" + "uvec2 subgroupShuffleXor(uvec2, uint);\n" + "uvec3 subgroupShuffleXor(uvec3, uint);\n" + "uvec4 subgroupShuffleXor(uvec4, uint);\n" + "bool subgroupShuffleXor(bool, uint);\n" + "bvec2 subgroupShuffleXor(bvec2, uint);\n" + "bvec3 subgroupShuffleXor(bvec3, uint);\n" + "bvec4 subgroupShuffleXor(bvec4, uint);\n" + + "float subgroupShuffleUp(float, uint delta);\n" + "vec2 subgroupShuffleUp(vec2, uint delta);\n" + "vec3 subgroupShuffleUp(vec3, uint delta);\n" + "vec4 subgroupShuffleUp(vec4, uint delta);\n" + "int subgroupShuffleUp(int, uint delta);\n" + "ivec2 subgroupShuffleUp(ivec2, uint delta);\n" + "ivec3 subgroupShuffleUp(ivec3, uint delta);\n" + "ivec4 subgroupShuffleUp(ivec4, uint delta);\n" + "uint subgroupShuffleUp(uint, uint delta);\n" + "uvec2 subgroupShuffleUp(uvec2, uint delta);\n" + "uvec3 subgroupShuffleUp(uvec3, uint delta);\n" + "uvec4 subgroupShuffleUp(uvec4, uint delta);\n" + "bool subgroupShuffleUp(bool, uint delta);\n" + "bvec2 subgroupShuffleUp(bvec2, uint delta);\n" + "bvec3 subgroupShuffleUp(bvec3, uint delta);\n" + "bvec4 subgroupShuffleUp(bvec4, uint delta);\n" + + "float subgroupShuffleDown(float, uint delta);\n" + "vec2 subgroupShuffleDown(vec2, uint delta);\n" + "vec3 subgroupShuffleDown(vec3, uint delta);\n" + "vec4 subgroupShuffleDown(vec4, uint delta);\n" + "int subgroupShuffleDown(int, uint delta);\n" + "ivec2 subgroupShuffleDown(ivec2, uint delta);\n" + "ivec3 subgroupShuffleDown(ivec3, uint delta);\n" + "ivec4 subgroupShuffleDown(ivec4, uint delta);\n" + "uint subgroupShuffleDown(uint, uint delta);\n" + "uvec2 subgroupShuffleDown(uvec2, uint delta);\n" + "uvec3 subgroupShuffleDown(uvec3, uint delta);\n" + "uvec4 subgroupShuffleDown(uvec4, uint delta);\n" + "bool subgroupShuffleDown(bool, uint delta);\n" + "bvec2 subgroupShuffleDown(bvec2, uint delta);\n" + "bvec3 subgroupShuffleDown(bvec3, uint delta);\n" + "bvec4 subgroupShuffleDown(bvec4, uint delta);\n" + + "float subgroupAdd(float);\n" + "vec2 subgroupAdd(vec2);\n" + "vec3 subgroupAdd(vec3);\n" + "vec4 subgroupAdd(vec4);\n" + "int subgroupAdd(int);\n" + "ivec2 subgroupAdd(ivec2);\n" + "ivec3 subgroupAdd(ivec3);\n" + "ivec4 subgroupAdd(ivec4);\n" + "uint subgroupAdd(uint);\n" + "uvec2 subgroupAdd(uvec2);\n" + "uvec3 subgroupAdd(uvec3);\n" + "uvec4 subgroupAdd(uvec4);\n" + + "float subgroupMul(float);\n" + "vec2 subgroupMul(vec2);\n" + "vec3 subgroupMul(vec3);\n" + "vec4 subgroupMul(vec4);\n" + "int subgroupMul(int);\n" + "ivec2 subgroupMul(ivec2);\n" + "ivec3 subgroupMul(ivec3);\n" + "ivec4 subgroupMul(ivec4);\n" + "uint subgroupMul(uint);\n" + "uvec2 subgroupMul(uvec2);\n" + "uvec3 subgroupMul(uvec3);\n" + "uvec4 subgroupMul(uvec4);\n" + + "float subgroupMin(float);\n" + "vec2 subgroupMin(vec2);\n" + "vec3 subgroupMin(vec3);\n" + "vec4 subgroupMin(vec4);\n" + "int subgroupMin(int);\n" + "ivec2 subgroupMin(ivec2);\n" + "ivec3 subgroupMin(ivec3);\n" + "ivec4 subgroupMin(ivec4);\n" + "uint subgroupMin(uint);\n" + "uvec2 subgroupMin(uvec2);\n" + "uvec3 subgroupMin(uvec3);\n" + "uvec4 subgroupMin(uvec4);\n" + + "float subgroupMax(float);\n" + "vec2 subgroupMax(vec2);\n" + "vec3 subgroupMax(vec3);\n" + "vec4 subgroupMax(vec4);\n" + "int subgroupMax(int);\n" + "ivec2 subgroupMax(ivec2);\n" + "ivec3 subgroupMax(ivec3);\n" + "ivec4 subgroupMax(ivec4);\n" + "uint subgroupMax(uint);\n" + "uvec2 subgroupMax(uvec2);\n" + "uvec3 subgroupMax(uvec3);\n" + "uvec4 subgroupMax(uvec4);\n" + + "int subgroupAnd(int);\n" + "ivec2 subgroupAnd(ivec2);\n" + "ivec3 subgroupAnd(ivec3);\n" + "ivec4 subgroupAnd(ivec4);\n" + "uint subgroupAnd(uint);\n" + "uvec2 subgroupAnd(uvec2);\n" + "uvec3 subgroupAnd(uvec3);\n" + "uvec4 subgroupAnd(uvec4);\n" + "bool subgroupAnd(bool);\n" + "bvec2 subgroupAnd(bvec2);\n" + "bvec3 subgroupAnd(bvec3);\n" + "bvec4 subgroupAnd(bvec4);\n" + + "int subgroupOr(int);\n" + "ivec2 subgroupOr(ivec2);\n" + "ivec3 subgroupOr(ivec3);\n" + "ivec4 subgroupOr(ivec4);\n" + "uint subgroupOr(uint);\n" + "uvec2 subgroupOr(uvec2);\n" + "uvec3 subgroupOr(uvec3);\n" + "uvec4 subgroupOr(uvec4);\n" + "bool subgroupOr(bool);\n" + "bvec2 subgroupOr(bvec2);\n" + "bvec3 subgroupOr(bvec3);\n" + "bvec4 subgroupOr(bvec4);\n" + + "int subgroupXor(int);\n" + "ivec2 subgroupXor(ivec2);\n" + "ivec3 subgroupXor(ivec3);\n" + "ivec4 subgroupXor(ivec4);\n" + "uint subgroupXor(uint);\n" + "uvec2 subgroupXor(uvec2);\n" + "uvec3 subgroupXor(uvec3);\n" + "uvec4 subgroupXor(uvec4);\n" + "bool subgroupXor(bool);\n" + "bvec2 subgroupXor(bvec2);\n" + "bvec3 subgroupXor(bvec3);\n" + "bvec4 subgroupXor(bvec4);\n" + + "float subgroupInclusiveAdd(float);\n" + "vec2 subgroupInclusiveAdd(vec2);\n" + "vec3 subgroupInclusiveAdd(vec3);\n" + "vec4 subgroupInclusiveAdd(vec4);\n" + "int subgroupInclusiveAdd(int);\n" + "ivec2 subgroupInclusiveAdd(ivec2);\n" + "ivec3 subgroupInclusiveAdd(ivec3);\n" + "ivec4 subgroupInclusiveAdd(ivec4);\n" + "uint subgroupInclusiveAdd(uint);\n" + "uvec2 subgroupInclusiveAdd(uvec2);\n" + "uvec3 subgroupInclusiveAdd(uvec3);\n" + "uvec4 subgroupInclusiveAdd(uvec4);\n" + + "float subgroupInclusiveMul(float);\n" + "vec2 subgroupInclusiveMul(vec2);\n" + "vec3 subgroupInclusiveMul(vec3);\n" + "vec4 subgroupInclusiveMul(vec4);\n" + "int subgroupInclusiveMul(int);\n" + "ivec2 subgroupInclusiveMul(ivec2);\n" + "ivec3 subgroupInclusiveMul(ivec3);\n" + "ivec4 subgroupInclusiveMul(ivec4);\n" + "uint subgroupInclusiveMul(uint);\n" + "uvec2 subgroupInclusiveMul(uvec2);\n" + "uvec3 subgroupInclusiveMul(uvec3);\n" + "uvec4 subgroupInclusiveMul(uvec4);\n" + + "float subgroupInclusiveMin(float);\n" + "vec2 subgroupInclusiveMin(vec2);\n" + "vec3 subgroupInclusiveMin(vec3);\n" + "vec4 subgroupInclusiveMin(vec4);\n" + "int subgroupInclusiveMin(int);\n" + "ivec2 subgroupInclusiveMin(ivec2);\n" + "ivec3 subgroupInclusiveMin(ivec3);\n" + "ivec4 subgroupInclusiveMin(ivec4);\n" + "uint subgroupInclusiveMin(uint);\n" + "uvec2 subgroupInclusiveMin(uvec2);\n" + "uvec3 subgroupInclusiveMin(uvec3);\n" + "uvec4 subgroupInclusiveMin(uvec4);\n" + + "float subgroupInclusiveMax(float);\n" + "vec2 subgroupInclusiveMax(vec2);\n" + "vec3 subgroupInclusiveMax(vec3);\n" + "vec4 subgroupInclusiveMax(vec4);\n" + "int subgroupInclusiveMax(int);\n" + "ivec2 subgroupInclusiveMax(ivec2);\n" + "ivec3 subgroupInclusiveMax(ivec3);\n" + "ivec4 subgroupInclusiveMax(ivec4);\n" + "uint subgroupInclusiveMax(uint);\n" + "uvec2 subgroupInclusiveMax(uvec2);\n" + "uvec3 subgroupInclusiveMax(uvec3);\n" + "uvec4 subgroupInclusiveMax(uvec4);\n" + + "int subgroupInclusiveAnd(int);\n" + "ivec2 subgroupInclusiveAnd(ivec2);\n" + "ivec3 subgroupInclusiveAnd(ivec3);\n" + "ivec4 subgroupInclusiveAnd(ivec4);\n" + "uint subgroupInclusiveAnd(uint);\n" + "uvec2 subgroupInclusiveAnd(uvec2);\n" + "uvec3 subgroupInclusiveAnd(uvec3);\n" + "uvec4 subgroupInclusiveAnd(uvec4);\n" + "bool subgroupInclusiveAnd(bool);\n" + "bvec2 subgroupInclusiveAnd(bvec2);\n" + "bvec3 subgroupInclusiveAnd(bvec3);\n" + "bvec4 subgroupInclusiveAnd(bvec4);\n" + + "int subgroupInclusiveOr(int);\n" + "ivec2 subgroupInclusiveOr(ivec2);\n" + "ivec3 subgroupInclusiveOr(ivec3);\n" + "ivec4 subgroupInclusiveOr(ivec4);\n" + "uint subgroupInclusiveOr(uint);\n" + "uvec2 subgroupInclusiveOr(uvec2);\n" + "uvec3 subgroupInclusiveOr(uvec3);\n" + "uvec4 subgroupInclusiveOr(uvec4);\n" + "bool subgroupInclusiveOr(bool);\n" + "bvec2 subgroupInclusiveOr(bvec2);\n" + "bvec3 subgroupInclusiveOr(bvec3);\n" + "bvec4 subgroupInclusiveOr(bvec4);\n" + + "int subgroupInclusiveXor(int);\n" + "ivec2 subgroupInclusiveXor(ivec2);\n" + "ivec3 subgroupInclusiveXor(ivec3);\n" + "ivec4 subgroupInclusiveXor(ivec4);\n" + "uint subgroupInclusiveXor(uint);\n" + "uvec2 subgroupInclusiveXor(uvec2);\n" + "uvec3 subgroupInclusiveXor(uvec3);\n" + "uvec4 subgroupInclusiveXor(uvec4);\n" + "bool subgroupInclusiveXor(bool);\n" + "bvec2 subgroupInclusiveXor(bvec2);\n" + "bvec3 subgroupInclusiveXor(bvec3);\n" + "bvec4 subgroupInclusiveXor(bvec4);\n" + + "float subgroupExclusiveAdd(float);\n" + "vec2 subgroupExclusiveAdd(vec2);\n" + "vec3 subgroupExclusiveAdd(vec3);\n" + "vec4 subgroupExclusiveAdd(vec4);\n" + "int subgroupExclusiveAdd(int);\n" + "ivec2 subgroupExclusiveAdd(ivec2);\n" + "ivec3 subgroupExclusiveAdd(ivec3);\n" + "ivec4 subgroupExclusiveAdd(ivec4);\n" + "uint subgroupExclusiveAdd(uint);\n" + "uvec2 subgroupExclusiveAdd(uvec2);\n" + "uvec3 subgroupExclusiveAdd(uvec3);\n" + "uvec4 subgroupExclusiveAdd(uvec4);\n" + + "float subgroupExclusiveMul(float);\n" + "vec2 subgroupExclusiveMul(vec2);\n" + "vec3 subgroupExclusiveMul(vec3);\n" + "vec4 subgroupExclusiveMul(vec4);\n" + "int subgroupExclusiveMul(int);\n" + "ivec2 subgroupExclusiveMul(ivec2);\n" + "ivec3 subgroupExclusiveMul(ivec3);\n" + "ivec4 subgroupExclusiveMul(ivec4);\n" + "uint subgroupExclusiveMul(uint);\n" + "uvec2 subgroupExclusiveMul(uvec2);\n" + "uvec3 subgroupExclusiveMul(uvec3);\n" + "uvec4 subgroupExclusiveMul(uvec4);\n" + + "float subgroupExclusiveMin(float);\n" + "vec2 subgroupExclusiveMin(vec2);\n" + "vec3 subgroupExclusiveMin(vec3);\n" + "vec4 subgroupExclusiveMin(vec4);\n" + "int subgroupExclusiveMin(int);\n" + "ivec2 subgroupExclusiveMin(ivec2);\n" + "ivec3 subgroupExclusiveMin(ivec3);\n" + "ivec4 subgroupExclusiveMin(ivec4);\n" + "uint subgroupExclusiveMin(uint);\n" + "uvec2 subgroupExclusiveMin(uvec2);\n" + "uvec3 subgroupExclusiveMin(uvec3);\n" + "uvec4 subgroupExclusiveMin(uvec4);\n" + + "float subgroupExclusiveMax(float);\n" + "vec2 subgroupExclusiveMax(vec2);\n" + "vec3 subgroupExclusiveMax(vec3);\n" + "vec4 subgroupExclusiveMax(vec4);\n" + "int subgroupExclusiveMax(int);\n" + "ivec2 subgroupExclusiveMax(ivec2);\n" + "ivec3 subgroupExclusiveMax(ivec3);\n" + "ivec4 subgroupExclusiveMax(ivec4);\n" + "uint subgroupExclusiveMax(uint);\n" + "uvec2 subgroupExclusiveMax(uvec2);\n" + "uvec3 subgroupExclusiveMax(uvec3);\n" + "uvec4 subgroupExclusiveMax(uvec4);\n" + + "int subgroupExclusiveAnd(int);\n" + "ivec2 subgroupExclusiveAnd(ivec2);\n" + "ivec3 subgroupExclusiveAnd(ivec3);\n" + "ivec4 subgroupExclusiveAnd(ivec4);\n" + "uint subgroupExclusiveAnd(uint);\n" + "uvec2 subgroupExclusiveAnd(uvec2);\n" + "uvec3 subgroupExclusiveAnd(uvec3);\n" + "uvec4 subgroupExclusiveAnd(uvec4);\n" + "bool subgroupExclusiveAnd(bool);\n" + "bvec2 subgroupExclusiveAnd(bvec2);\n" + "bvec3 subgroupExclusiveAnd(bvec3);\n" + "bvec4 subgroupExclusiveAnd(bvec4);\n" + + "int subgroupExclusiveOr(int);\n" + "ivec2 subgroupExclusiveOr(ivec2);\n" + "ivec3 subgroupExclusiveOr(ivec3);\n" + "ivec4 subgroupExclusiveOr(ivec4);\n" + "uint subgroupExclusiveOr(uint);\n" + "uvec2 subgroupExclusiveOr(uvec2);\n" + "uvec3 subgroupExclusiveOr(uvec3);\n" + "uvec4 subgroupExclusiveOr(uvec4);\n" + "bool subgroupExclusiveOr(bool);\n" + "bvec2 subgroupExclusiveOr(bvec2);\n" + "bvec3 subgroupExclusiveOr(bvec3);\n" + "bvec4 subgroupExclusiveOr(bvec4);\n" + + "int subgroupExclusiveXor(int);\n" + "ivec2 subgroupExclusiveXor(ivec2);\n" + "ivec3 subgroupExclusiveXor(ivec3);\n" + "ivec4 subgroupExclusiveXor(ivec4);\n" + "uint subgroupExclusiveXor(uint);\n" + "uvec2 subgroupExclusiveXor(uvec2);\n" + "uvec3 subgroupExclusiveXor(uvec3);\n" + "uvec4 subgroupExclusiveXor(uvec4);\n" + "bool subgroupExclusiveXor(bool);\n" + "bvec2 subgroupExclusiveXor(bvec2);\n" + "bvec3 subgroupExclusiveXor(bvec3);\n" + "bvec4 subgroupExclusiveXor(bvec4);\n" + + "float subgroupClusteredAdd(float, uint);\n" + "vec2 subgroupClusteredAdd(vec2, uint);\n" + "vec3 subgroupClusteredAdd(vec3, uint);\n" + "vec4 subgroupClusteredAdd(vec4, uint);\n" + "int subgroupClusteredAdd(int, uint);\n" + "ivec2 subgroupClusteredAdd(ivec2, uint);\n" + "ivec3 subgroupClusteredAdd(ivec3, uint);\n" + "ivec4 subgroupClusteredAdd(ivec4, uint);\n" + "uint subgroupClusteredAdd(uint, uint);\n" + "uvec2 subgroupClusteredAdd(uvec2, uint);\n" + "uvec3 subgroupClusteredAdd(uvec3, uint);\n" + "uvec4 subgroupClusteredAdd(uvec4, uint);\n" + + "float subgroupClusteredMul(float, uint);\n" + "vec2 subgroupClusteredMul(vec2, uint);\n" + "vec3 subgroupClusteredMul(vec3, uint);\n" + "vec4 subgroupClusteredMul(vec4, uint);\n" + "int subgroupClusteredMul(int, uint);\n" + "ivec2 subgroupClusteredMul(ivec2, uint);\n" + "ivec3 subgroupClusteredMul(ivec3, uint);\n" + "ivec4 subgroupClusteredMul(ivec4, uint);\n" + "uint subgroupClusteredMul(uint, uint);\n" + "uvec2 subgroupClusteredMul(uvec2, uint);\n" + "uvec3 subgroupClusteredMul(uvec3, uint);\n" + "uvec4 subgroupClusteredMul(uvec4, uint);\n" + + "float subgroupClusteredMin(float, uint);\n" + "vec2 subgroupClusteredMin(vec2, uint);\n" + "vec3 subgroupClusteredMin(vec3, uint);\n" + "vec4 subgroupClusteredMin(vec4, uint);\n" + "int subgroupClusteredMin(int, uint);\n" + "ivec2 subgroupClusteredMin(ivec2, uint);\n" + "ivec3 subgroupClusteredMin(ivec3, uint);\n" + "ivec4 subgroupClusteredMin(ivec4, uint);\n" + "uint subgroupClusteredMin(uint, uint);\n" + "uvec2 subgroupClusteredMin(uvec2, uint);\n" + "uvec3 subgroupClusteredMin(uvec3, uint);\n" + "uvec4 subgroupClusteredMin(uvec4, uint);\n" + + "float subgroupClusteredMax(float, uint);\n" + "vec2 subgroupClusteredMax(vec2, uint);\n" + "vec3 subgroupClusteredMax(vec3, uint);\n" + "vec4 subgroupClusteredMax(vec4, uint);\n" + "int subgroupClusteredMax(int, uint);\n" + "ivec2 subgroupClusteredMax(ivec2, uint);\n" + "ivec3 subgroupClusteredMax(ivec3, uint);\n" + "ivec4 subgroupClusteredMax(ivec4, uint);\n" + "uint subgroupClusteredMax(uint, uint);\n" + "uvec2 subgroupClusteredMax(uvec2, uint);\n" + "uvec3 subgroupClusteredMax(uvec3, uint);\n" + "uvec4 subgroupClusteredMax(uvec4, uint);\n" + + "int subgroupClusteredAnd(int, uint);\n" + "ivec2 subgroupClusteredAnd(ivec2, uint);\n" + "ivec3 subgroupClusteredAnd(ivec3, uint);\n" + "ivec4 subgroupClusteredAnd(ivec4, uint);\n" + "uint subgroupClusteredAnd(uint, uint);\n" + "uvec2 subgroupClusteredAnd(uvec2, uint);\n" + "uvec3 subgroupClusteredAnd(uvec3, uint);\n" + "uvec4 subgroupClusteredAnd(uvec4, uint);\n" + "bool subgroupClusteredAnd(bool, uint);\n" + "bvec2 subgroupClusteredAnd(bvec2, uint);\n" + "bvec3 subgroupClusteredAnd(bvec3, uint);\n" + "bvec4 subgroupClusteredAnd(bvec4, uint);\n" + + "int subgroupClusteredOr(int, uint);\n" + "ivec2 subgroupClusteredOr(ivec2, uint);\n" + "ivec3 subgroupClusteredOr(ivec3, uint);\n" + "ivec4 subgroupClusteredOr(ivec4, uint);\n" + "uint subgroupClusteredOr(uint, uint);\n" + "uvec2 subgroupClusteredOr(uvec2, uint);\n" + "uvec3 subgroupClusteredOr(uvec3, uint);\n" + "uvec4 subgroupClusteredOr(uvec4, uint);\n" + "bool subgroupClusteredOr(bool, uint);\n" + "bvec2 subgroupClusteredOr(bvec2, uint);\n" + "bvec3 subgroupClusteredOr(bvec3, uint);\n" + "bvec4 subgroupClusteredOr(bvec4, uint);\n" + + "int subgroupClusteredXor(int, uint);\n" + "ivec2 subgroupClusteredXor(ivec2, uint);\n" + "ivec3 subgroupClusteredXor(ivec3, uint);\n" + "ivec4 subgroupClusteredXor(ivec4, uint);\n" + "uint subgroupClusteredXor(uint, uint);\n" + "uvec2 subgroupClusteredXor(uvec2, uint);\n" + "uvec3 subgroupClusteredXor(uvec3, uint);\n" + "uvec4 subgroupClusteredXor(uvec4, uint);\n" + "bool subgroupClusteredXor(bool, uint);\n" + "bvec2 subgroupClusteredXor(bvec2, uint);\n" + "bvec3 subgroupClusteredXor(bvec3, uint);\n" + "bvec4 subgroupClusteredXor(bvec4, uint);\n" + + "float subgroupQuadBroadcast(float, uint);\n" + "vec2 subgroupQuadBroadcast(vec2, uint);\n" + "vec3 subgroupQuadBroadcast(vec3, uint);\n" + "vec4 subgroupQuadBroadcast(vec4, uint);\n" + "int subgroupQuadBroadcast(int, uint);\n" + "ivec2 subgroupQuadBroadcast(ivec2, uint);\n" + "ivec3 subgroupQuadBroadcast(ivec3, uint);\n" + "ivec4 subgroupQuadBroadcast(ivec4, uint);\n" + "uint subgroupQuadBroadcast(uint, uint);\n" + "uvec2 subgroupQuadBroadcast(uvec2, uint);\n" + "uvec3 subgroupQuadBroadcast(uvec3, uint);\n" + "uvec4 subgroupQuadBroadcast(uvec4, uint);\n" + "bool subgroupQuadBroadcast(bool, uint);\n" + "bvec2 subgroupQuadBroadcast(bvec2, uint);\n" + "bvec3 subgroupQuadBroadcast(bvec3, uint);\n" + "bvec4 subgroupQuadBroadcast(bvec4, uint);\n" + + "float subgroupQuadSwapHorizontal(float);\n" + "vec2 subgroupQuadSwapHorizontal(vec2);\n" + "vec3 subgroupQuadSwapHorizontal(vec3);\n" + "vec4 subgroupQuadSwapHorizontal(vec4);\n" + "int subgroupQuadSwapHorizontal(int);\n" + "ivec2 subgroupQuadSwapHorizontal(ivec2);\n" + "ivec3 subgroupQuadSwapHorizontal(ivec3);\n" + "ivec4 subgroupQuadSwapHorizontal(ivec4);\n" + "uint subgroupQuadSwapHorizontal(uint);\n" + "uvec2 subgroupQuadSwapHorizontal(uvec2);\n" + "uvec3 subgroupQuadSwapHorizontal(uvec3);\n" + "uvec4 subgroupQuadSwapHorizontal(uvec4);\n" + "bool subgroupQuadSwapHorizontal(bool);\n" + "bvec2 subgroupQuadSwapHorizontal(bvec2);\n" + "bvec3 subgroupQuadSwapHorizontal(bvec3);\n" + "bvec4 subgroupQuadSwapHorizontal(bvec4);\n" + + "float subgroupQuadSwapVertical(float);\n" + "vec2 subgroupQuadSwapVertical(vec2);\n" + "vec3 subgroupQuadSwapVertical(vec3);\n" + "vec4 subgroupQuadSwapVertical(vec4);\n" + "int subgroupQuadSwapVertical(int);\n" + "ivec2 subgroupQuadSwapVertical(ivec2);\n" + "ivec3 subgroupQuadSwapVertical(ivec3);\n" + "ivec4 subgroupQuadSwapVertical(ivec4);\n" + "uint subgroupQuadSwapVertical(uint);\n" + "uvec2 subgroupQuadSwapVertical(uvec2);\n" + "uvec3 subgroupQuadSwapVertical(uvec3);\n" + "uvec4 subgroupQuadSwapVertical(uvec4);\n" + "bool subgroupQuadSwapVertical(bool);\n" + "bvec2 subgroupQuadSwapVertical(bvec2);\n" + "bvec3 subgroupQuadSwapVertical(bvec3);\n" + "bvec4 subgroupQuadSwapVertical(bvec4);\n" + + "float subgroupQuadSwapDiagonal(float);\n" + "vec2 subgroupQuadSwapDiagonal(vec2);\n" + "vec3 subgroupQuadSwapDiagonal(vec3);\n" + "vec4 subgroupQuadSwapDiagonal(vec4);\n" + "int subgroupQuadSwapDiagonal(int);\n" + "ivec2 subgroupQuadSwapDiagonal(ivec2);\n" + "ivec3 subgroupQuadSwapDiagonal(ivec3);\n" + "ivec4 subgroupQuadSwapDiagonal(ivec4);\n" + "uint subgroupQuadSwapDiagonal(uint);\n" + "uvec2 subgroupQuadSwapDiagonal(uvec2);\n" + "uvec3 subgroupQuadSwapDiagonal(uvec3);\n" + "uvec4 subgroupQuadSwapDiagonal(uvec4);\n" + "bool subgroupQuadSwapDiagonal(bool);\n" + "bvec2 subgroupQuadSwapDiagonal(bvec2);\n" + "bvec3 subgroupQuadSwapDiagonal(bvec3);\n" + "bvec4 subgroupQuadSwapDiagonal(bvec4);\n" + +#ifdef NV_EXTENSIONS + "uvec4 subgroupPartitionNV(float);\n" + "uvec4 subgroupPartitionNV(vec2);\n" + "uvec4 subgroupPartitionNV(vec3);\n" + "uvec4 subgroupPartitionNV(vec4);\n" + "uvec4 subgroupPartitionNV(int);\n" + "uvec4 subgroupPartitionNV(ivec2);\n" + "uvec4 subgroupPartitionNV(ivec3);\n" + "uvec4 subgroupPartitionNV(ivec4);\n" + "uvec4 subgroupPartitionNV(uint);\n" + "uvec4 subgroupPartitionNV(uvec2);\n" + "uvec4 subgroupPartitionNV(uvec3);\n" + "uvec4 subgroupPartitionNV(uvec4);\n" + "uvec4 subgroupPartitionNV(bool);\n" + "uvec4 subgroupPartitionNV(bvec2);\n" + "uvec4 subgroupPartitionNV(bvec3);\n" + "uvec4 subgroupPartitionNV(bvec4);\n" + + "float subgroupPartitionedAddNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedAddNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedAddNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedAddNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedAddNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedAddNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedAddNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedAddNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedAddNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedAddNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedAddNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedAddNV(uvec4, uvec4 ballot);\n" + + "float subgroupPartitionedMulNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedMulNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedMulNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedMulNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedMulNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedMulNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedMulNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedMulNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedMulNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedMulNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedMulNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedMulNV(uvec4, uvec4 ballot);\n" + + "float subgroupPartitionedMinNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedMinNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedMinNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedMinNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedMinNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedMinNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedMinNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedMinNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedMinNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedMinNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedMinNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedMinNV(uvec4, uvec4 ballot);\n" + + "float subgroupPartitionedMaxNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedMaxNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedMaxNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedMaxNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedMaxNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedMaxNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedMaxNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedMaxNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedMaxNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedMaxNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedMaxNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedMaxNV(uvec4, uvec4 ballot);\n" + + "int subgroupPartitionedAndNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedAndNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedAndNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedAndNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedAndNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedAndNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedAndNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedAndNV(uvec4, uvec4 ballot);\n" + "bool subgroupPartitionedAndNV(bool, uvec4 ballot);\n" + "bvec2 subgroupPartitionedAndNV(bvec2, uvec4 ballot);\n" + "bvec3 subgroupPartitionedAndNV(bvec3, uvec4 ballot);\n" + "bvec4 subgroupPartitionedAndNV(bvec4, uvec4 ballot);\n" + + "int subgroupPartitionedOrNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedOrNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedOrNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedOrNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedOrNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedOrNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedOrNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedOrNV(uvec4, uvec4 ballot);\n" + "bool subgroupPartitionedOrNV(bool, uvec4 ballot);\n" + "bvec2 subgroupPartitionedOrNV(bvec2, uvec4 ballot);\n" + "bvec3 subgroupPartitionedOrNV(bvec3, uvec4 ballot);\n" + "bvec4 subgroupPartitionedOrNV(bvec4, uvec4 ballot);\n" + + "int subgroupPartitionedXorNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedXorNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedXorNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedXorNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedXorNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedXorNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedXorNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedXorNV(uvec4, uvec4 ballot);\n" + "bool subgroupPartitionedXorNV(bool, uvec4 ballot);\n" + "bvec2 subgroupPartitionedXorNV(bvec2, uvec4 ballot);\n" + "bvec3 subgroupPartitionedXorNV(bvec3, uvec4 ballot);\n" + "bvec4 subgroupPartitionedXorNV(bvec4, uvec4 ballot);\n" + + "float subgroupPartitionedInclusiveAddNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedInclusiveAddNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedInclusiveAddNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedInclusiveAddNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedInclusiveAddNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedInclusiveAddNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedInclusiveAddNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedInclusiveAddNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedInclusiveAddNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedInclusiveAddNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedInclusiveAddNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedInclusiveAddNV(uvec4, uvec4 ballot);\n" + + "float subgroupPartitionedInclusiveMulNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedInclusiveMulNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedInclusiveMulNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedInclusiveMulNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedInclusiveMulNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedInclusiveMulNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedInclusiveMulNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedInclusiveMulNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedInclusiveMulNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedInclusiveMulNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedInclusiveMulNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedInclusiveMulNV(uvec4, uvec4 ballot);\n" + + "float subgroupPartitionedInclusiveMinNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedInclusiveMinNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedInclusiveMinNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedInclusiveMinNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedInclusiveMinNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedInclusiveMinNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedInclusiveMinNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedInclusiveMinNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedInclusiveMinNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedInclusiveMinNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedInclusiveMinNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedInclusiveMinNV(uvec4, uvec4 ballot);\n" + + "float subgroupPartitionedInclusiveMaxNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedInclusiveMaxNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedInclusiveMaxNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedInclusiveMaxNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedInclusiveMaxNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedInclusiveMaxNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedInclusiveMaxNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedInclusiveMaxNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedInclusiveMaxNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedInclusiveMaxNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedInclusiveMaxNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedInclusiveMaxNV(uvec4, uvec4 ballot);\n" + + "int subgroupPartitionedInclusiveAndNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedInclusiveAndNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedInclusiveAndNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedInclusiveAndNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedInclusiveAndNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedInclusiveAndNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedInclusiveAndNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedInclusiveAndNV(uvec4, uvec4 ballot);\n" + "bool subgroupPartitionedInclusiveAndNV(bool, uvec4 ballot);\n" + "bvec2 subgroupPartitionedInclusiveAndNV(bvec2, uvec4 ballot);\n" + "bvec3 subgroupPartitionedInclusiveAndNV(bvec3, uvec4 ballot);\n" + "bvec4 subgroupPartitionedInclusiveAndNV(bvec4, uvec4 ballot);\n" + + "int subgroupPartitionedInclusiveOrNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedInclusiveOrNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedInclusiveOrNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedInclusiveOrNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedInclusiveOrNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedInclusiveOrNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedInclusiveOrNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedInclusiveOrNV(uvec4, uvec4 ballot);\n" + "bool subgroupPartitionedInclusiveOrNV(bool, uvec4 ballot);\n" + "bvec2 subgroupPartitionedInclusiveOrNV(bvec2, uvec4 ballot);\n" + "bvec3 subgroupPartitionedInclusiveOrNV(bvec3, uvec4 ballot);\n" + "bvec4 subgroupPartitionedInclusiveOrNV(bvec4, uvec4 ballot);\n" + + "int subgroupPartitionedInclusiveXorNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedInclusiveXorNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedInclusiveXorNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedInclusiveXorNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedInclusiveXorNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedInclusiveXorNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedInclusiveXorNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedInclusiveXorNV(uvec4, uvec4 ballot);\n" + "bool subgroupPartitionedInclusiveXorNV(bool, uvec4 ballot);\n" + "bvec2 subgroupPartitionedInclusiveXorNV(bvec2, uvec4 ballot);\n" + "bvec3 subgroupPartitionedInclusiveXorNV(bvec3, uvec4 ballot);\n" + "bvec4 subgroupPartitionedInclusiveXorNV(bvec4, uvec4 ballot);\n" + + "float subgroupPartitionedExclusiveAddNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedExclusiveAddNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedExclusiveAddNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedExclusiveAddNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedExclusiveAddNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedExclusiveAddNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedExclusiveAddNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedExclusiveAddNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedExclusiveAddNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedExclusiveAddNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedExclusiveAddNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedExclusiveAddNV(uvec4, uvec4 ballot);\n" + + "float subgroupPartitionedExclusiveMulNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedExclusiveMulNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedExclusiveMulNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedExclusiveMulNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedExclusiveMulNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedExclusiveMulNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedExclusiveMulNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedExclusiveMulNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedExclusiveMulNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedExclusiveMulNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedExclusiveMulNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedExclusiveMulNV(uvec4, uvec4 ballot);\n" + + "float subgroupPartitionedExclusiveMinNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedExclusiveMinNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedExclusiveMinNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedExclusiveMinNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedExclusiveMinNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedExclusiveMinNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedExclusiveMinNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedExclusiveMinNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedExclusiveMinNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedExclusiveMinNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedExclusiveMinNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedExclusiveMinNV(uvec4, uvec4 ballot);\n" + + "float subgroupPartitionedExclusiveMaxNV(float, uvec4 ballot);\n" + "vec2 subgroupPartitionedExclusiveMaxNV(vec2, uvec4 ballot);\n" + "vec3 subgroupPartitionedExclusiveMaxNV(vec3, uvec4 ballot);\n" + "vec4 subgroupPartitionedExclusiveMaxNV(vec4, uvec4 ballot);\n" + "int subgroupPartitionedExclusiveMaxNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedExclusiveMaxNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedExclusiveMaxNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedExclusiveMaxNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedExclusiveMaxNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedExclusiveMaxNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedExclusiveMaxNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedExclusiveMaxNV(uvec4, uvec4 ballot);\n" + + "int subgroupPartitionedExclusiveAndNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedExclusiveAndNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedExclusiveAndNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedExclusiveAndNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedExclusiveAndNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedExclusiveAndNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedExclusiveAndNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedExclusiveAndNV(uvec4, uvec4 ballot);\n" + "bool subgroupPartitionedExclusiveAndNV(bool, uvec4 ballot);\n" + "bvec2 subgroupPartitionedExclusiveAndNV(bvec2, uvec4 ballot);\n" + "bvec3 subgroupPartitionedExclusiveAndNV(bvec3, uvec4 ballot);\n" + "bvec4 subgroupPartitionedExclusiveAndNV(bvec4, uvec4 ballot);\n" + + "int subgroupPartitionedExclusiveOrNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedExclusiveOrNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedExclusiveOrNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedExclusiveOrNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedExclusiveOrNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedExclusiveOrNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedExclusiveOrNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedExclusiveOrNV(uvec4, uvec4 ballot);\n" + "bool subgroupPartitionedExclusiveOrNV(bool, uvec4 ballot);\n" + "bvec2 subgroupPartitionedExclusiveOrNV(bvec2, uvec4 ballot);\n" + "bvec3 subgroupPartitionedExclusiveOrNV(bvec3, uvec4 ballot);\n" + "bvec4 subgroupPartitionedExclusiveOrNV(bvec4, uvec4 ballot);\n" + + "int subgroupPartitionedExclusiveXorNV(int, uvec4 ballot);\n" + "ivec2 subgroupPartitionedExclusiveXorNV(ivec2, uvec4 ballot);\n" + "ivec3 subgroupPartitionedExclusiveXorNV(ivec3, uvec4 ballot);\n" + "ivec4 subgroupPartitionedExclusiveXorNV(ivec4, uvec4 ballot);\n" + "uint subgroupPartitionedExclusiveXorNV(uint, uvec4 ballot);\n" + "uvec2 subgroupPartitionedExclusiveXorNV(uvec2, uvec4 ballot);\n" + "uvec3 subgroupPartitionedExclusiveXorNV(uvec3, uvec4 ballot);\n" + "uvec4 subgroupPartitionedExclusiveXorNV(uvec4, uvec4 ballot);\n" + "bool subgroupPartitionedExclusiveXorNV(bool, uvec4 ballot);\n" + "bvec2 subgroupPartitionedExclusiveXorNV(bvec2, uvec4 ballot);\n" + "bvec3 subgroupPartitionedExclusiveXorNV(bvec3, uvec4 ballot);\n" + "bvec4 subgroupPartitionedExclusiveXorNV(bvec4, uvec4 ballot);\n" +#endif + + "\n"); + + if (profile != EEsProfile && version >= 400) { + commonBuiltins.append( + "bool subgroupAllEqual(double);\n" + "bool subgroupAllEqual(dvec2);\n" + "bool subgroupAllEqual(dvec3);\n" + "bool subgroupAllEqual(dvec4);\n" + + "double subgroupBroadcast(double, uint);\n" + "dvec2 subgroupBroadcast(dvec2, uint);\n" + "dvec3 subgroupBroadcast(dvec3, uint);\n" + "dvec4 subgroupBroadcast(dvec4, uint);\n" + + "double subgroupBroadcastFirst(double);\n" + "dvec2 subgroupBroadcastFirst(dvec2);\n" + "dvec3 subgroupBroadcastFirst(dvec3);\n" + "dvec4 subgroupBroadcastFirst(dvec4);\n" + + "double subgroupShuffle(double, uint);\n" + "dvec2 subgroupShuffle(dvec2, uint);\n" + "dvec3 subgroupShuffle(dvec3, uint);\n" + "dvec4 subgroupShuffle(dvec4, uint);\n" + + "double subgroupShuffleXor(double, uint);\n" + "dvec2 subgroupShuffleXor(dvec2, uint);\n" + "dvec3 subgroupShuffleXor(dvec3, uint);\n" + "dvec4 subgroupShuffleXor(dvec4, uint);\n" + + "double subgroupShuffleUp(double, uint delta);\n" + "dvec2 subgroupShuffleUp(dvec2, uint delta);\n" + "dvec3 subgroupShuffleUp(dvec3, uint delta);\n" + "dvec4 subgroupShuffleUp(dvec4, uint delta);\n" + + "double subgroupShuffleDown(double, uint delta);\n" + "dvec2 subgroupShuffleDown(dvec2, uint delta);\n" + "dvec3 subgroupShuffleDown(dvec3, uint delta);\n" + "dvec4 subgroupShuffleDown(dvec4, uint delta);\n" + + "double subgroupAdd(double);\n" + "dvec2 subgroupAdd(dvec2);\n" + "dvec3 subgroupAdd(dvec3);\n" + "dvec4 subgroupAdd(dvec4);\n" + + "double subgroupMul(double);\n" + "dvec2 subgroupMul(dvec2);\n" + "dvec3 subgroupMul(dvec3);\n" + "dvec4 subgroupMul(dvec4);\n" + + "double subgroupMin(double);\n" + "dvec2 subgroupMin(dvec2);\n" + "dvec3 subgroupMin(dvec3);\n" + "dvec4 subgroupMin(dvec4);\n" + + "double subgroupMax(double);\n" + "dvec2 subgroupMax(dvec2);\n" + "dvec3 subgroupMax(dvec3);\n" + "dvec4 subgroupMax(dvec4);\n" + + "double subgroupInclusiveAdd(double);\n" + "dvec2 subgroupInclusiveAdd(dvec2);\n" + "dvec3 subgroupInclusiveAdd(dvec3);\n" + "dvec4 subgroupInclusiveAdd(dvec4);\n" + + "double subgroupInclusiveMul(double);\n" + "dvec2 subgroupInclusiveMul(dvec2);\n" + "dvec3 subgroupInclusiveMul(dvec3);\n" + "dvec4 subgroupInclusiveMul(dvec4);\n" + + "double subgroupInclusiveMin(double);\n" + "dvec2 subgroupInclusiveMin(dvec2);\n" + "dvec3 subgroupInclusiveMin(dvec3);\n" + "dvec4 subgroupInclusiveMin(dvec4);\n" + + "double subgroupInclusiveMax(double);\n" + "dvec2 subgroupInclusiveMax(dvec2);\n" + "dvec3 subgroupInclusiveMax(dvec3);\n" + "dvec4 subgroupInclusiveMax(dvec4);\n" + + "double subgroupExclusiveAdd(double);\n" + "dvec2 subgroupExclusiveAdd(dvec2);\n" + "dvec3 subgroupExclusiveAdd(dvec3);\n" + "dvec4 subgroupExclusiveAdd(dvec4);\n" + + "double subgroupExclusiveMul(double);\n" + "dvec2 subgroupExclusiveMul(dvec2);\n" + "dvec3 subgroupExclusiveMul(dvec3);\n" + "dvec4 subgroupExclusiveMul(dvec4);\n" + + "double subgroupExclusiveMin(double);\n" + "dvec2 subgroupExclusiveMin(dvec2);\n" + "dvec3 subgroupExclusiveMin(dvec3);\n" + "dvec4 subgroupExclusiveMin(dvec4);\n" + + "double subgroupExclusiveMax(double);\n" + "dvec2 subgroupExclusiveMax(dvec2);\n" + "dvec3 subgroupExclusiveMax(dvec3);\n" + "dvec4 subgroupExclusiveMax(dvec4);\n" + + "double subgroupClusteredAdd(double, uint);\n" + "dvec2 subgroupClusteredAdd(dvec2, uint);\n" + "dvec3 subgroupClusteredAdd(dvec3, uint);\n" + "dvec4 subgroupClusteredAdd(dvec4, uint);\n" + + "double subgroupClusteredMul(double, uint);\n" + "dvec2 subgroupClusteredMul(dvec2, uint);\n" + "dvec3 subgroupClusteredMul(dvec3, uint);\n" + "dvec4 subgroupClusteredMul(dvec4, uint);\n" + + "double subgroupClusteredMin(double, uint);\n" + "dvec2 subgroupClusteredMin(dvec2, uint);\n" + "dvec3 subgroupClusteredMin(dvec3, uint);\n" + "dvec4 subgroupClusteredMin(dvec4, uint);\n" + + "double subgroupClusteredMax(double, uint);\n" + "dvec2 subgroupClusteredMax(dvec2, uint);\n" + "dvec3 subgroupClusteredMax(dvec3, uint);\n" + "dvec4 subgroupClusteredMax(dvec4, uint);\n" + + "double subgroupQuadBroadcast(double, uint);\n" + "dvec2 subgroupQuadBroadcast(dvec2, uint);\n" + "dvec3 subgroupQuadBroadcast(dvec3, uint);\n" + "dvec4 subgroupQuadBroadcast(dvec4, uint);\n" + + "double subgroupQuadSwapHorizontal(double);\n" + "dvec2 subgroupQuadSwapHorizontal(dvec2);\n" + "dvec3 subgroupQuadSwapHorizontal(dvec3);\n" + "dvec4 subgroupQuadSwapHorizontal(dvec4);\n" + + "double subgroupQuadSwapVertical(double);\n" + "dvec2 subgroupQuadSwapVertical(dvec2);\n" + "dvec3 subgroupQuadSwapVertical(dvec3);\n" + "dvec4 subgroupQuadSwapVertical(dvec4);\n" + + "double subgroupQuadSwapDiagonal(double);\n" + "dvec2 subgroupQuadSwapDiagonal(dvec2);\n" + "dvec3 subgroupQuadSwapDiagonal(dvec3);\n" + "dvec4 subgroupQuadSwapDiagonal(dvec4);\n" + + +#ifdef NV_EXTENSIONS + "uvec4 subgroupPartitionNV(double);\n" + "uvec4 subgroupPartitionNV(dvec2);\n" + "uvec4 subgroupPartitionNV(dvec3);\n" + "uvec4 subgroupPartitionNV(dvec4);\n" + + "double subgroupPartitionedAddNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedAddNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedAddNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedAddNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedMulNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedMulNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedMulNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedMulNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedMinNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedMinNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedMinNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedMinNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedMaxNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedMaxNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedMaxNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedMaxNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedInclusiveAddNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedInclusiveAddNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedInclusiveAddNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedInclusiveAddNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedInclusiveMulNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedInclusiveMulNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedInclusiveMulNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedInclusiveMulNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedInclusiveMinNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedInclusiveMinNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedInclusiveMinNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedInclusiveMinNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedInclusiveMaxNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedInclusiveMaxNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedInclusiveMaxNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedInclusiveMaxNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedExclusiveAddNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedExclusiveAddNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedExclusiveAddNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedExclusiveAddNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedExclusiveMulNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedExclusiveMulNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedExclusiveMulNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedExclusiveMulNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedExclusiveMinNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedExclusiveMinNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedExclusiveMinNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedExclusiveMinNV(dvec4, uvec4 ballot);\n" + + "double subgroupPartitionedExclusiveMaxNV(double, uvec4 ballot);\n" + "dvec2 subgroupPartitionedExclusiveMaxNV(dvec2, uvec4 ballot);\n" + "dvec3 subgroupPartitionedExclusiveMaxNV(dvec3, uvec4 ballot);\n" + "dvec4 subgroupPartitionedExclusiveMaxNV(dvec4, uvec4 ballot);\n" +#endif + + "\n"); + } + + stageBuiltins[EShLangCompute].append( + "void subgroupMemoryBarrierShared();" + + "\n" + ); + } + if (profile != EEsProfile && version >= 460) { commonBuiltins.append( "bool anyInvocation(bool);" @@ -1634,6 +2793,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f16vec3 minInvocationsAMD(f16vec3);" "f16vec4 minInvocationsAMD(f16vec4);" + "int16_t minInvocationsAMD(int16_t);" + "i16vec2 minInvocationsAMD(i16vec2);" + "i16vec3 minInvocationsAMD(i16vec3);" + "i16vec4 minInvocationsAMD(i16vec4);" + + "uint16_t minInvocationsAMD(uint16_t);" + "u16vec2 minInvocationsAMD(u16vec2);" + "u16vec3 minInvocationsAMD(u16vec3);" + "u16vec4 minInvocationsAMD(u16vec4);" + "float minInvocationsInclusiveScanAMD(float);" "vec2 minInvocationsInclusiveScanAMD(vec2);" "vec3 minInvocationsInclusiveScanAMD(vec3);" @@ -1669,6 +2838,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f16vec3 minInvocationsInclusiveScanAMD(f16vec3);" "f16vec4 minInvocationsInclusiveScanAMD(f16vec4);" + "int16_t minInvocationsInclusiveScanAMD(int16_t);" + "i16vec2 minInvocationsInclusiveScanAMD(i16vec2);" + "i16vec3 minInvocationsInclusiveScanAMD(i16vec3);" + "i16vec4 minInvocationsInclusiveScanAMD(i16vec4);" + + "uint16_t minInvocationsInclusiveScanAMD(uint16_t);" + "u16vec2 minInvocationsInclusiveScanAMD(u16vec2);" + "u16vec3 minInvocationsInclusiveScanAMD(u16vec3);" + "u16vec4 minInvocationsInclusiveScanAMD(u16vec4);" + "float minInvocationsExclusiveScanAMD(float);" "vec2 minInvocationsExclusiveScanAMD(vec2);" "vec3 minInvocationsExclusiveScanAMD(vec3);" @@ -1704,6 +2883,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f16vec3 minInvocationsExclusiveScanAMD(f16vec3);" "f16vec4 minInvocationsExclusiveScanAMD(f16vec4);" + "int16_t minInvocationsExclusiveScanAMD(int16_t);" + "i16vec2 minInvocationsExclusiveScanAMD(i16vec2);" + "i16vec3 minInvocationsExclusiveScanAMD(i16vec3);" + "i16vec4 minInvocationsExclusiveScanAMD(i16vec4);" + + "uint16_t minInvocationsExclusiveScanAMD(uint16_t);" + "u16vec2 minInvocationsExclusiveScanAMD(u16vec2);" + "u16vec3 minInvocationsExclusiveScanAMD(u16vec3);" + "u16vec4 minInvocationsExclusiveScanAMD(u16vec4);" + "float maxInvocationsAMD(float);" "vec2 maxInvocationsAMD(vec2);" "vec3 maxInvocationsAMD(vec3);" @@ -1739,6 +2928,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f16vec3 maxInvocationsAMD(f16vec3);" "f16vec4 maxInvocationsAMD(f16vec4);" + "int16_t maxInvocationsAMD(int16_t);" + "i16vec2 maxInvocationsAMD(i16vec2);" + "i16vec3 maxInvocationsAMD(i16vec3);" + "i16vec4 maxInvocationsAMD(i16vec4);" + + "uint16_t maxInvocationsAMD(uint16_t);" + "u16vec2 maxInvocationsAMD(u16vec2);" + "u16vec3 maxInvocationsAMD(u16vec3);" + "u16vec4 maxInvocationsAMD(u16vec4);" + "float maxInvocationsInclusiveScanAMD(float);" "vec2 maxInvocationsInclusiveScanAMD(vec2);" "vec3 maxInvocationsInclusiveScanAMD(vec3);" @@ -1774,6 +2973,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f16vec3 maxInvocationsInclusiveScanAMD(f16vec3);" "f16vec4 maxInvocationsInclusiveScanAMD(f16vec4);" + "int16_t maxInvocationsInclusiveScanAMD(int16_t);" + "i16vec2 maxInvocationsInclusiveScanAMD(i16vec2);" + "i16vec3 maxInvocationsInclusiveScanAMD(i16vec3);" + "i16vec4 maxInvocationsInclusiveScanAMD(i16vec4);" + + "uint16_t maxInvocationsInclusiveScanAMD(uint16_t);" + "u16vec2 maxInvocationsInclusiveScanAMD(u16vec2);" + "u16vec3 maxInvocationsInclusiveScanAMD(u16vec3);" + "u16vec4 maxInvocationsInclusiveScanAMD(u16vec4);" + "float maxInvocationsExclusiveScanAMD(float);" "vec2 maxInvocationsExclusiveScanAMD(vec2);" "vec3 maxInvocationsExclusiveScanAMD(vec3);" @@ -1809,6 +3018,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f16vec3 maxInvocationsExclusiveScanAMD(f16vec3);" "f16vec4 maxInvocationsExclusiveScanAMD(f16vec4);" + "int16_t maxInvocationsExclusiveScanAMD(int16_t);" + "i16vec2 maxInvocationsExclusiveScanAMD(i16vec2);" + "i16vec3 maxInvocationsExclusiveScanAMD(i16vec3);" + "i16vec4 maxInvocationsExclusiveScanAMD(i16vec4);" + + "uint16_t maxInvocationsExclusiveScanAMD(uint16_t);" + "u16vec2 maxInvocationsExclusiveScanAMD(u16vec2);" + "u16vec3 maxInvocationsExclusiveScanAMD(u16vec3);" + "u16vec4 maxInvocationsExclusiveScanAMD(u16vec4);" + "float addInvocationsAMD(float);" "vec2 addInvocationsAMD(vec2);" "vec3 addInvocationsAMD(vec3);" @@ -1844,6 +3063,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f16vec3 addInvocationsAMD(f16vec3);" "f16vec4 addInvocationsAMD(f16vec4);" + "int16_t addInvocationsAMD(int16_t);" + "i16vec2 addInvocationsAMD(i16vec2);" + "i16vec3 addInvocationsAMD(i16vec3);" + "i16vec4 addInvocationsAMD(i16vec4);" + + "uint16_t addInvocationsAMD(uint16_t);" + "u16vec2 addInvocationsAMD(u16vec2);" + "u16vec3 addInvocationsAMD(u16vec3);" + "u16vec4 addInvocationsAMD(u16vec4);" + "float addInvocationsInclusiveScanAMD(float);" "vec2 addInvocationsInclusiveScanAMD(vec2);" "vec3 addInvocationsInclusiveScanAMD(vec3);" @@ -1879,6 +3108,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f16vec3 addInvocationsInclusiveScanAMD(f16vec3);" "f16vec4 addInvocationsInclusiveScanAMD(f16vec4);" + "int16_t addInvocationsInclusiveScanAMD(int16_t);" + "i16vec2 addInvocationsInclusiveScanAMD(i16vec2);" + "i16vec3 addInvocationsInclusiveScanAMD(i16vec3);" + "i16vec4 addInvocationsInclusiveScanAMD(i16vec4);" + + "uint16_t addInvocationsInclusiveScanAMD(uint16_t);" + "u16vec2 addInvocationsInclusiveScanAMD(u16vec2);" + "u16vec3 addInvocationsInclusiveScanAMD(u16vec3);" + "u16vec4 addInvocationsInclusiveScanAMD(u16vec4);" + "float addInvocationsExclusiveScanAMD(float);" "vec2 addInvocationsExclusiveScanAMD(vec2);" "vec3 addInvocationsExclusiveScanAMD(vec3);" @@ -1914,6 +3153,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f16vec3 addInvocationsExclusiveScanAMD(f16vec3);" "f16vec4 addInvocationsExclusiveScanAMD(f16vec4);" + "int16_t addInvocationsExclusiveScanAMD(int16_t);" + "i16vec2 addInvocationsExclusiveScanAMD(i16vec2);" + "i16vec3 addInvocationsExclusiveScanAMD(i16vec3);" + "i16vec4 addInvocationsExclusiveScanAMD(i16vec4);" + + "uint16_t addInvocationsExclusiveScanAMD(uint16_t);" + "u16vec2 addInvocationsExclusiveScanAMD(u16vec2);" + "u16vec3 addInvocationsExclusiveScanAMD(u16vec3);" + "u16vec4 addInvocationsExclusiveScanAMD(u16vec4);" + "float minInvocationsNonUniformAMD(float);" "vec2 minInvocationsNonUniformAMD(vec2);" "vec3 minInvocationsNonUniformAMD(vec3);" @@ -1949,6 +3198,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f16vec3 minInvocationsNonUniformAMD(f16vec3);" "f16vec4 minInvocationsNonUniformAMD(f16vec4);" + "int16_t minInvocationsNonUniformAMD(int16_t);" + "i16vec2 minInvocationsNonUniformAMD(i16vec2);" + "i16vec3 minInvocationsNonUniformAMD(i16vec3);" + "i16vec4 minInvocationsNonUniformAMD(i16vec4);" + + "uint16_t minInvocationsNonUniformAMD(uint16_t);" + "u16vec2 minInvocationsNonUniformAMD(u16vec2);" + "u16vec3 minInvocationsNonUniformAMD(u16vec3);" + "u16vec4 minInvocationsNonUniformAMD(u16vec4);" + "float minInvocationsInclusiveScanNonUniformAMD(float);" "vec2 minInvocationsInclusiveScanNonUniformAMD(vec2);" "vec3 minInvocationsInclusiveScanNonUniformAMD(vec3);" @@ -1984,6 +3243,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f16vec3 minInvocationsInclusiveScanNonUniformAMD(f16vec3);" "f16vec4 minInvocationsInclusiveScanNonUniformAMD(f16vec4);" + "int16_t minInvocationsInclusiveScanNonUniformAMD(int16_t);" + "i16vec2 minInvocationsInclusiveScanNonUniformAMD(i16vec2);" + "i16vec3 minInvocationsInclusiveScanNonUniformAMD(i16vec3);" + "i16vec4 minInvocationsInclusiveScanNonUniformAMD(i16vec4);" + + "uint16_t minInvocationsInclusiveScanNonUniformAMD(uint16_t);" + "u16vec2 minInvocationsInclusiveScanNonUniformAMD(u16vec2);" + "u16vec3 minInvocationsInclusiveScanNonUniformAMD(u16vec3);" + "u16vec4 minInvocationsInclusiveScanNonUniformAMD(u16vec4);" + "float minInvocationsExclusiveScanNonUniformAMD(float);" "vec2 minInvocationsExclusiveScanNonUniformAMD(vec2);" "vec3 minInvocationsExclusiveScanNonUniformAMD(vec3);" @@ -2019,6 +3288,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f16vec3 minInvocationsExclusiveScanNonUniformAMD(f16vec3);" "f16vec4 minInvocationsExclusiveScanNonUniformAMD(f16vec4);" + "int16_t minInvocationsExclusiveScanNonUniformAMD(int16_t);" + "i16vec2 minInvocationsExclusiveScanNonUniformAMD(i16vec2);" + "i16vec3 minInvocationsExclusiveScanNonUniformAMD(i16vec3);" + "i16vec4 minInvocationsExclusiveScanNonUniformAMD(i16vec4);" + + "uint16_t minInvocationsExclusiveScanNonUniformAMD(uint16_t);" + "u16vec2 minInvocationsExclusiveScanNonUniformAMD(u16vec2);" + "u16vec3 minInvocationsExclusiveScanNonUniformAMD(u16vec3);" + "u16vec4 minInvocationsExclusiveScanNonUniformAMD(u16vec4);" + "float maxInvocationsNonUniformAMD(float);" "vec2 maxInvocationsNonUniformAMD(vec2);" "vec3 maxInvocationsNonUniformAMD(vec3);" @@ -2054,6 +3333,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f16vec3 maxInvocationsNonUniformAMD(f16vec3);" "f16vec4 maxInvocationsNonUniformAMD(f16vec4);" + "int16_t maxInvocationsNonUniformAMD(int16_t);" + "i16vec2 maxInvocationsNonUniformAMD(i16vec2);" + "i16vec3 maxInvocationsNonUniformAMD(i16vec3);" + "i16vec4 maxInvocationsNonUniformAMD(i16vec4);" + + "uint16_t maxInvocationsNonUniformAMD(uint16_t);" + "u16vec2 maxInvocationsNonUniformAMD(u16vec2);" + "u16vec3 maxInvocationsNonUniformAMD(u16vec3);" + "u16vec4 maxInvocationsNonUniformAMD(u16vec4);" + "float maxInvocationsInclusiveScanNonUniformAMD(float);" "vec2 maxInvocationsInclusiveScanNonUniformAMD(vec2);" "vec3 maxInvocationsInclusiveScanNonUniformAMD(vec3);" @@ -2089,6 +3378,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f16vec3 maxInvocationsInclusiveScanNonUniformAMD(f16vec3);" "f16vec4 maxInvocationsInclusiveScanNonUniformAMD(f16vec4);" + "int16_t maxInvocationsInclusiveScanNonUniformAMD(int16_t);" + "i16vec2 maxInvocationsInclusiveScanNonUniformAMD(i16vec2);" + "i16vec3 maxInvocationsInclusiveScanNonUniformAMD(i16vec3);" + "i16vec4 maxInvocationsInclusiveScanNonUniformAMD(i16vec4);" + + "uint16_t maxInvocationsInclusiveScanNonUniformAMD(uint16_t);" + "u16vec2 maxInvocationsInclusiveScanNonUniformAMD(u16vec2);" + "u16vec3 maxInvocationsInclusiveScanNonUniformAMD(u16vec3);" + "u16vec4 maxInvocationsInclusiveScanNonUniformAMD(u16vec4);" + "float maxInvocationsExclusiveScanNonUniformAMD(float);" "vec2 maxInvocationsExclusiveScanNonUniformAMD(vec2);" "vec3 maxInvocationsExclusiveScanNonUniformAMD(vec3);" @@ -2124,6 +3423,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f16vec3 maxInvocationsExclusiveScanNonUniformAMD(f16vec3);" "f16vec4 maxInvocationsExclusiveScanNonUniformAMD(f16vec4);" + "int16_t maxInvocationsExclusiveScanNonUniformAMD(int16_t);" + "i16vec2 maxInvocationsExclusiveScanNonUniformAMD(i16vec2);" + "i16vec3 maxInvocationsExclusiveScanNonUniformAMD(i16vec3);" + "i16vec4 maxInvocationsExclusiveScanNonUniformAMD(i16vec4);" + + "uint16_t maxInvocationsExclusiveScanNonUniformAMD(uint16_t);" + "u16vec2 maxInvocationsExclusiveScanNonUniformAMD(u16vec2);" + "u16vec3 maxInvocationsExclusiveScanNonUniformAMD(u16vec3);" + "u16vec4 maxInvocationsExclusiveScanNonUniformAMD(u16vec4);" + "float addInvocationsNonUniformAMD(float);" "vec2 addInvocationsNonUniformAMD(vec2);" "vec3 addInvocationsNonUniformAMD(vec3);" @@ -2159,6 +3468,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f16vec3 addInvocationsNonUniformAMD(f16vec3);" "f16vec4 addInvocationsNonUniformAMD(f16vec4);" + "int16_t addInvocationsNonUniformAMD(int16_t);" + "i16vec2 addInvocationsNonUniformAMD(i16vec2);" + "i16vec3 addInvocationsNonUniformAMD(i16vec3);" + "i16vec4 addInvocationsNonUniformAMD(i16vec4);" + + "uint16_t addInvocationsNonUniformAMD(uint16_t);" + "u16vec2 addInvocationsNonUniformAMD(u16vec2);" + "u16vec3 addInvocationsNonUniformAMD(u16vec3);" + "u16vec4 addInvocationsNonUniformAMD(u16vec4);" + "float addInvocationsInclusiveScanNonUniformAMD(float);" "vec2 addInvocationsInclusiveScanNonUniformAMD(vec2);" "vec3 addInvocationsInclusiveScanNonUniformAMD(vec3);" @@ -2194,6 +3513,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f16vec3 addInvocationsInclusiveScanNonUniformAMD(f16vec3);" "f16vec4 addInvocationsInclusiveScanNonUniformAMD(f16vec4);" + "int16_t addInvocationsInclusiveScanNonUniformAMD(int16_t);" + "i16vec2 addInvocationsInclusiveScanNonUniformAMD(i16vec2);" + "i16vec3 addInvocationsInclusiveScanNonUniformAMD(i16vec3);" + "i16vec4 addInvocationsInclusiveScanNonUniformAMD(i16vec4);" + + "uint16_t addInvocationsInclusiveScanNonUniformAMD(uint16_t);" + "u16vec2 addInvocationsInclusiveScanNonUniformAMD(u16vec2);" + "u16vec3 addInvocationsInclusiveScanNonUniformAMD(u16vec3);" + "u16vec4 addInvocationsInclusiveScanNonUniformAMD(u16vec4);" + "float addInvocationsExclusiveScanNonUniformAMD(float);" "vec2 addInvocationsExclusiveScanNonUniformAMD(vec2);" "vec3 addInvocationsExclusiveScanNonUniformAMD(vec3);" @@ -2229,6 +3558,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f16vec3 addInvocationsExclusiveScanNonUniformAMD(f16vec3);" "f16vec4 addInvocationsExclusiveScanNonUniformAMD(f16vec4);" + "int16_t addInvocationsExclusiveScanNonUniformAMD(int16_t);" + "i16vec2 addInvocationsExclusiveScanNonUniformAMD(i16vec2);" + "i16vec3 addInvocationsExclusiveScanNonUniformAMD(i16vec3);" + "i16vec4 addInvocationsExclusiveScanNonUniformAMD(i16vec4);" + + "uint16_t addInvocationsExclusiveScanNonUniformAMD(uint16_t);" + "u16vec2 addInvocationsExclusiveScanNonUniformAMD(u16vec2);" + "u16vec3 addInvocationsExclusiveScanNonUniformAMD(u16vec3);" + "u16vec4 addInvocationsExclusiveScanNonUniformAMD(u16vec4);" + "float swizzleInvocationsAMD(float, uvec4);" "vec2 swizzleInvocationsAMD(vec2, uvec4);" "vec3 swizzleInvocationsAMD(vec3, uvec4);" @@ -2283,13 +3622,37 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV if (profile != EEsProfile && version >= 450) { commonBuiltins.append( "float cubeFaceIndexAMD(vec3);" - "vec2 cubeFaceCoordAMD(vec3);" + "vec2 cubeFaceCoordAMD(vec3);" "uint64_t timeAMD();" "\n"); } - // GL_AMD_gpu_shader_half_float + // GL_AMD_shader_fragment_mask + if (profile != EEsProfile && version >= 450) { + commonBuiltins.append( + "uint fragmentMaskFetchAMD(sampler2DMS, ivec2);" + "uint fragmentMaskFetchAMD(isampler2DMS, ivec2);" + "uint fragmentMaskFetchAMD(usampler2DMS, ivec2);" + + "uint fragmentMaskFetchAMD(sampler2DMSArray, ivec3);" + "uint fragmentMaskFetchAMD(isampler2DMSArray, ivec3);" + "uint fragmentMaskFetchAMD(usampler2DMSArray, ivec3);" + + "vec4 fragmentFetchAMD(sampler2DMS, ivec2, uint);" + "ivec4 fragmentFetchAMD(isampler2DMS, ivec2, uint);" + "uvec4 fragmentFetchAMD(usampler2DMS, ivec2, uint);" + + "vec4 fragmentFetchAMD(sampler2DMSArray, ivec3, uint);" + "ivec4 fragmentFetchAMD(isampler2DMSArray, ivec3, uint);" + "uvec4 fragmentFetchAMD(usampler2DMSArray, ivec3, uint);" + + "\n"); + } + +#endif // AMD_EXTENSIONS + + // GL_AMD_gpu_shader_half_float/Explicit types if (profile != EEsProfile && version >= 450) { commonBuiltins.append( "float16_t radians(float16_t);" @@ -2637,9 +4000,168 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } - // GL_AMD_gpu_shader_int16 + // Explicit types if (profile != EEsProfile && version >= 450) { commonBuiltins.append( + "int8_t abs(int8_t);" + "i8vec2 abs(i8vec2);" + "i8vec3 abs(i8vec3);" + "i8vec4 abs(i8vec4);" + + "int8_t sign(int8_t);" + "i8vec2 sign(i8vec2);" + "i8vec3 sign(i8vec3);" + "i8vec4 sign(i8vec4);" + + "int8_t min(int8_t x, int8_t y);" + "i8vec2 min(i8vec2 x, int8_t y);" + "i8vec3 min(i8vec3 x, int8_t y);" + "i8vec4 min(i8vec4 x, int8_t y);" + "i8vec2 min(i8vec2 x, i8vec2 y);" + "i8vec3 min(i8vec3 x, i8vec3 y);" + "i8vec4 min(i8vec4 x, i8vec4 y);" + + "uint8_t min(uint8_t x, uint8_t y);" + "u8vec2 min(u8vec2 x, uint8_t y);" + "u8vec3 min(u8vec3 x, uint8_t y);" + "u8vec4 min(u8vec4 x, uint8_t y);" + "u8vec2 min(u8vec2 x, u8vec2 y);" + "u8vec3 min(u8vec3 x, u8vec3 y);" + "u8vec4 min(u8vec4 x, u8vec4 y);" + + "int8_t max(int8_t x, int8_t y);" + "i8vec2 max(i8vec2 x, int8_t y);" + "i8vec3 max(i8vec3 x, int8_t y);" + "i8vec4 max(i8vec4 x, int8_t y);" + "i8vec2 max(i8vec2 x, i8vec2 y);" + "i8vec3 max(i8vec3 x, i8vec3 y);" + "i8vec4 max(i8vec4 x, i8vec4 y);" + + "uint8_t max(uint8_t x, uint8_t y);" + "u8vec2 max(u8vec2 x, uint8_t y);" + "u8vec3 max(u8vec3 x, uint8_t y);" + "u8vec4 max(u8vec4 x, uint8_t y);" + "u8vec2 max(u8vec2 x, u8vec2 y);" + "u8vec3 max(u8vec3 x, u8vec3 y);" + "u8vec4 max(u8vec4 x, u8vec4 y);" + + "int8_t clamp(int8_t x, int8_t minVal, int8_t maxVal);" + "i8vec2 clamp(i8vec2 x, int8_t minVal, int8_t maxVal);" + "i8vec3 clamp(i8vec3 x, int8_t minVal, int8_t maxVal);" + "i8vec4 clamp(i8vec4 x, int8_t minVal, int8_t maxVal);" + "i8vec2 clamp(i8vec2 x, i8vec2 minVal, i8vec2 maxVal);" + "i8vec3 clamp(i8vec3 x, i8vec3 minVal, i8vec3 maxVal);" + "i8vec4 clamp(i8vec4 x, i8vec4 minVal, i8vec4 maxVal);" + + "uint8_t clamp(uint8_t x, uint8_t minVal, uint8_t maxVal);" + "u8vec2 clamp(u8vec2 x, uint8_t minVal, uint8_t maxVal);" + "u8vec3 clamp(u8vec3 x, uint8_t minVal, uint8_t maxVal);" + "u8vec4 clamp(u8vec4 x, uint8_t minVal, uint8_t maxVal);" + "u8vec2 clamp(u8vec2 x, u8vec2 minVal, u8vec2 maxVal);" + "u8vec3 clamp(u8vec3 x, u8vec3 minVal, u8vec3 maxVal);" + "u8vec4 clamp(u8vec4 x, u8vec4 minVal, u8vec4 maxVal);" + + "int8_t mix(int8_t, int8_t, bool);" + "i8vec2 mix(i8vec2, i8vec2, bvec2);" + "i8vec3 mix(i8vec3, i8vec3, bvec3);" + "i8vec4 mix(i8vec4, i8vec4, bvec4);" + "uint8_t mix(uint8_t, uint8_t, bool);" + "u8vec2 mix(u8vec2, u8vec2, bvec2);" + "u8vec3 mix(u8vec3, u8vec3, bvec3);" + "u8vec4 mix(u8vec4, u8vec4, bvec4);" + + "bvec2 lessThan(i8vec2, i8vec2);" + "bvec3 lessThan(i8vec3, i8vec3);" + "bvec4 lessThan(i8vec4, i8vec4);" + "bvec2 lessThan(u8vec2, u8vec2);" + "bvec3 lessThan(u8vec3, u8vec3);" + "bvec4 lessThan(u8vec4, u8vec4);" + + "bvec2 lessThanEqual(i8vec2, i8vec2);" + "bvec3 lessThanEqual(i8vec3, i8vec3);" + "bvec4 lessThanEqual(i8vec4, i8vec4);" + "bvec2 lessThanEqual(u8vec2, u8vec2);" + "bvec3 lessThanEqual(u8vec3, u8vec3);" + "bvec4 lessThanEqual(u8vec4, u8vec4);" + + "bvec2 greaterThan(i8vec2, i8vec2);" + "bvec3 greaterThan(i8vec3, i8vec3);" + "bvec4 greaterThan(i8vec4, i8vec4);" + "bvec2 greaterThan(u8vec2, u8vec2);" + "bvec3 greaterThan(u8vec3, u8vec3);" + "bvec4 greaterThan(u8vec4, u8vec4);" + + "bvec2 greaterThanEqual(i8vec2, i8vec2);" + "bvec3 greaterThanEqual(i8vec3, i8vec3);" + "bvec4 greaterThanEqual(i8vec4, i8vec4);" + "bvec2 greaterThanEqual(u8vec2, u8vec2);" + "bvec3 greaterThanEqual(u8vec3, u8vec3);" + "bvec4 greaterThanEqual(u8vec4, u8vec4);" + + "bvec2 equal(i8vec2, i8vec2);" + "bvec3 equal(i8vec3, i8vec3);" + "bvec4 equal(i8vec4, i8vec4);" + "bvec2 equal(u8vec2, u8vec2);" + "bvec3 equal(u8vec3, u8vec3);" + "bvec4 equal(u8vec4, u8vec4);" + + "bvec2 notEqual(i8vec2, i8vec2);" + "bvec3 notEqual(i8vec3, i8vec3);" + "bvec4 notEqual(i8vec4, i8vec4);" + "bvec2 notEqual(u8vec2, u8vec2);" + "bvec3 notEqual(u8vec3, u8vec3);" + "bvec4 notEqual(u8vec4, u8vec4);" + + " int8_t bitfieldExtract( int8_t, int8_t, int8_t);" + "i8vec2 bitfieldExtract(i8vec2, int8_t, int8_t);" + "i8vec3 bitfieldExtract(i8vec3, int8_t, int8_t);" + "i8vec4 bitfieldExtract(i8vec4, int8_t, int8_t);" + + " uint8_t bitfieldExtract( uint8_t, int8_t, int8_t);" + "u8vec2 bitfieldExtract(u8vec2, int8_t, int8_t);" + "u8vec3 bitfieldExtract(u8vec3, int8_t, int8_t);" + "u8vec4 bitfieldExtract(u8vec4, int8_t, int8_t);" + + " int8_t bitfieldInsert( int8_t base, int8_t, int8_t, int8_t);" + "i8vec2 bitfieldInsert(i8vec2 base, i8vec2, int8_t, int8_t);" + "i8vec3 bitfieldInsert(i8vec3 base, i8vec3, int8_t, int8_t);" + "i8vec4 bitfieldInsert(i8vec4 base, i8vec4, int8_t, int8_t);" + + " uint8_t bitfieldInsert( uint8_t base, uint8_t, int8_t, int8_t);" + "u8vec2 bitfieldInsert(u8vec2 base, u8vec2, int8_t, int8_t);" + "u8vec3 bitfieldInsert(u8vec3 base, u8vec3, int8_t, int8_t);" + "u8vec4 bitfieldInsert(u8vec4 base, u8vec4, int8_t, int8_t);" + + " int8_t bitCount( int8_t);" + "i8vec2 bitCount(i8vec2);" + "i8vec3 bitCount(i8vec3);" + "i8vec4 bitCount(i8vec4);" + + " int8_t bitCount( uint8_t);" + "i8vec2 bitCount(u8vec2);" + "i8vec3 bitCount(u8vec3);" + "i8vec4 bitCount(u8vec4);" + + " int8_t findLSB( int8_t);" + "i8vec2 findLSB(i8vec2);" + "i8vec3 findLSB(i8vec3);" + "i8vec4 findLSB(i8vec4);" + + " int8_t findLSB( uint8_t);" + "i8vec2 findLSB(u8vec2);" + "i8vec3 findLSB(u8vec3);" + "i8vec4 findLSB(u8vec4);" + + " int8_t findMSB( int8_t);" + "i8vec2 findMSB(i8vec2);" + "i8vec3 findMSB(i8vec3);" + "i8vec4 findMSB(i8vec4);" + + " int8_t findMSB( uint8_t);" + "i8vec2 findMSB(u8vec2);" + "i8vec3 findMSB(u8vec3);" + "i8vec4 findMSB(u8vec4);" + "int16_t abs(int16_t);" "i16vec2 abs(i16vec2);" "i16vec3 abs(i16vec3);" @@ -2650,50 +4172,53 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "i16vec3 sign(i16vec3);" "i16vec4 sign(i16vec4);" - "int16_t min(int16_t, int16_t);" - "i16vec2 min(i16vec2, int16_t);" - "i16vec3 min(i16vec3, int16_t);" - "i16vec4 min(i16vec4, int16_t);" - "i16vec2 min(i16vec2, i16vec2);" - "i16vec3 min(i16vec3, i16vec3);" - "i16vec4 min(i16vec4, i16vec4);" - "uint16_t min(uint16_t, uint16_t);" - "u16vec2 min(u16vec2, uint16_t);" - "u16vec3 min(u16vec3, uint16_t);" - "u16vec4 min(u16vec4, uint16_t);" - "u16vec2 min(u16vec2, u16vec2);" - "u16vec3 min(u16vec3, u16vec3);" - "u16vec4 min(u16vec4, u16vec4);" - - "int16_t max(int16_t, int16_t);" - "i16vec2 max(i16vec2, int16_t);" - "i16vec3 max(i16vec3, int16_t);" - "i16vec4 max(i16vec4, int16_t);" - "i16vec2 max(i16vec2, i16vec2);" - "i16vec3 max(i16vec3, i16vec3);" - "i16vec4 max(i16vec4, i16vec4);" - "uint16_t max(uint16_t, uint16_t);" - "u16vec2 max(u16vec2, uint16_t);" - "u16vec3 max(u16vec3, uint16_t);" - "u16vec4 max(u16vec4, uint16_t);" - "u16vec2 max(u16vec2, u16vec2);" - "u16vec3 max(u16vec3, u16vec3);" - "u16vec4 max(u16vec4, u16vec4);" - - "int16_t clamp(int16_t, int16_t, int16_t);" - "i16vec2 clamp(i16vec2, int16_t, int16_t);" - "i16vec3 clamp(i16vec3, int16_t, int16_t);" - "i16vec4 clamp(i16vec4, int16_t, int16_t);" - "i16vec2 clamp(i16vec2, i16vec2, i16vec2);" - "i16vec3 clamp(i16vec3, i16vec3, i16vec3);" - "i16vec4 clamp(i16vec4, i16vec4, i16vec4);" - "uint16_t clamp(uint16_t, uint16_t, uint16_t);" - "u16vec2 clamp(u16vec2, uint16_t, uint16_t);" - "u16vec3 clamp(u16vec3, uint16_t, uint16_t);" - "u16vec4 clamp(u16vec4, uint16_t, uint16_t);" - "u16vec2 clamp(u16vec2, u16vec2, u16vec2);" - "u16vec3 clamp(u16vec3, u16vec3, u16vec3);" - "u16vec4 clamp(u16vec4, u16vec4, u16vec4);" + "int16_t min(int16_t x, int16_t y);" + "i16vec2 min(i16vec2 x, int16_t y);" + "i16vec3 min(i16vec3 x, int16_t y);" + "i16vec4 min(i16vec4 x, int16_t y);" + "i16vec2 min(i16vec2 x, i16vec2 y);" + "i16vec3 min(i16vec3 x, i16vec3 y);" + "i16vec4 min(i16vec4 x, i16vec4 y);" + + "uint16_t min(uint16_t x, uint16_t y);" + "u16vec2 min(u16vec2 x, uint16_t y);" + "u16vec3 min(u16vec3 x, uint16_t y);" + "u16vec4 min(u16vec4 x, uint16_t y);" + "u16vec2 min(u16vec2 x, u16vec2 y);" + "u16vec3 min(u16vec3 x, u16vec3 y);" + "u16vec4 min(u16vec4 x, u16vec4 y);" + + "int16_t max(int16_t x, int16_t y);" + "i16vec2 max(i16vec2 x, int16_t y);" + "i16vec3 max(i16vec3 x, int16_t y);" + "i16vec4 max(i16vec4 x, int16_t y);" + "i16vec2 max(i16vec2 x, i16vec2 y);" + "i16vec3 max(i16vec3 x, i16vec3 y);" + "i16vec4 max(i16vec4 x, i16vec4 y);" + + "uint16_t max(uint16_t x, uint16_t y);" + "u16vec2 max(u16vec2 x, uint16_t y);" + "u16vec3 max(u16vec3 x, uint16_t y);" + "u16vec4 max(u16vec4 x, uint16_t y);" + "u16vec2 max(u16vec2 x, u16vec2 y);" + "u16vec3 max(u16vec3 x, u16vec3 y);" + "u16vec4 max(u16vec4 x, u16vec4 y);" + + "int16_t clamp(int16_t x, int16_t minVal, int16_t maxVal);" + "i16vec2 clamp(i16vec2 x, int16_t minVal, int16_t maxVal);" + "i16vec3 clamp(i16vec3 x, int16_t minVal, int16_t maxVal);" + "i16vec4 clamp(i16vec4 x, int16_t minVal, int16_t maxVal);" + "i16vec2 clamp(i16vec2 x, i16vec2 minVal, i16vec2 maxVal);" + "i16vec3 clamp(i16vec3 x, i16vec3 minVal, i16vec3 maxVal);" + "i16vec4 clamp(i16vec4 x, i16vec4 minVal, i16vec4 maxVal);" + + "uint16_t clamp(uint16_t x, uint16_t minVal, uint16_t maxVal);" + "u16vec2 clamp(u16vec2 x, uint16_t minVal, uint16_t maxVal);" + "u16vec3 clamp(u16vec3 x, uint16_t minVal, uint16_t maxVal);" + "u16vec4 clamp(u16vec4 x, uint16_t minVal, uint16_t maxVal);" + "u16vec2 clamp(u16vec2 x, u16vec2 minVal, u16vec2 maxVal);" + "u16vec3 clamp(u16vec3 x, u16vec3 minVal, u16vec3 maxVal);" + "u16vec4 clamp(u16vec4 x, u16vec4 minVal, u16vec4 maxVal);" "int16_t mix(int16_t, int16_t, bool);" "i16vec2 mix(i16vec2, i16vec2, bvec2);" @@ -2714,6 +4239,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f16vec3 ldexp(f16vec3, i16vec3);" "f16vec4 ldexp(f16vec4, i16vec4);" + "int16_t halfBitsToInt16(float16_t);" + "i16vec2 halfBitsToInt16(f16vec2);" + "i16vec3 halhBitsToInt16(f16vec3);" + "i16vec4 halfBitsToInt16(f16vec4);" + + "uint16_t halfBitsToUint16(float16_t);" + "u16vec2 halfBitsToUint16(f16vec2);" + "u16vec3 halfBitsToUint16(f16vec3);" + "u16vec4 halfBitsToUint16(f16vec4);" + "int16_t float16BitsToInt16(float16_t);" "i16vec2 float16BitsToInt16(f16vec2);" "i16vec3 float16BitsToInt16(f16vec3);" @@ -2734,6 +4269,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f16vec3 uint16BitsToFloat16(u16vec3);" "f16vec4 uint16BitsToFloat16(u16vec4);" + "float16_t int16BitsToHalf(int16_t);" + "f16vec2 int16BitsToHalf(i16vec2);" + "f16vec3 int16BitsToHalf(i16vec3);" + "f16vec4 int16BitsToHalf(i16vec4);" + + "float16_t uint16BitsToHalf(uint16_t);" + "f16vec2 uint16BitsToHalf(u16vec2);" + "f16vec3 uint16BitsToHalf(u16vec3);" + "f16vec4 uint16BitsToHalf(u16vec4);" + "int packInt2x16(i16vec2);" "uint packUint2x16(u16vec2);" "int64_t packInt4x16(i16vec4);" @@ -2785,9 +4330,244 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "bvec3 notEqual(u16vec3, u16vec3);" "bvec4 notEqual(u16vec4, u16vec4);" + " int16_t bitfieldExtract( int16_t, int16_t, int16_t);" + "i16vec2 bitfieldExtract(i16vec2, int16_t, int16_t);" + "i16vec3 bitfieldExtract(i16vec3, int16_t, int16_t);" + "i16vec4 bitfieldExtract(i16vec4, int16_t, int16_t);" + + " uint16_t bitfieldExtract( uint16_t, int16_t, int16_t);" + "u16vec2 bitfieldExtract(u16vec2, int16_t, int16_t);" + "u16vec3 bitfieldExtract(u16vec3, int16_t, int16_t);" + "u16vec4 bitfieldExtract(u16vec4, int16_t, int16_t);" + + " int16_t bitfieldInsert( int16_t base, int16_t, int16_t, int16_t);" + "i16vec2 bitfieldInsert(i16vec2 base, i16vec2, int16_t, int16_t);" + "i16vec3 bitfieldInsert(i16vec3 base, i16vec3, int16_t, int16_t);" + "i16vec4 bitfieldInsert(i16vec4 base, i16vec4, int16_t, int16_t);" + + " uint16_t bitfieldInsert( uint16_t base, uint16_t, int16_t, int16_t);" + "u16vec2 bitfieldInsert(u16vec2 base, u16vec2, int16_t, int16_t);" + "u16vec3 bitfieldInsert(u16vec3 base, u16vec3, int16_t, int16_t);" + "u16vec4 bitfieldInsert(u16vec4 base, u16vec4, int16_t, int16_t);" + + " int16_t bitCount( int16_t);" + "i16vec2 bitCount(i16vec2);" + "i16vec3 bitCount(i16vec3);" + "i16vec4 bitCount(i16vec4);" + + " int16_t bitCount( uint16_t);" + "i16vec2 bitCount(u16vec2);" + "i16vec3 bitCount(u16vec3);" + "i16vec4 bitCount(u16vec4);" + + " int16_t findLSB( int16_t);" + "i16vec2 findLSB(i16vec2);" + "i16vec3 findLSB(i16vec3);" + "i16vec4 findLSB(i16vec4);" + + " int16_t findLSB( uint16_t);" + "i16vec2 findLSB(u16vec2);" + "i16vec3 findLSB(u16vec3);" + "i16vec4 findLSB(u16vec4);" + + " int16_t findMSB( int16_t);" + "i16vec2 findMSB(i16vec2);" + "i16vec3 findMSB(i16vec3);" + "i16vec4 findMSB(i16vec4);" + + " int16_t findMSB( uint16_t);" + "i16vec2 findMSB(u16vec2);" + "i16vec3 findMSB(u16vec3);" + "i16vec4 findMSB(u16vec4);" + + "int16_t pack16(i8vec2);" + "uint16_t pack16(u8vec2);" + "int32_t pack32(i8vec4);" + "uint32_t pack32(u8vec4);" + "int32_t pack32(i16vec2);" + "uint32_t pack32(u16vec2);" + "int64_t pack64(i16vec4);" + "uint64_t pack64(u16vec4);" + "int64_t pack64(i32vec2);" + "uint64_t pack64(u32vec2);" + + "i8vec2 unpack8(int16_t);" + "u8vec2 unpack8(uint16_t);" + "i8vec4 unpack8(int32_t);" + "u8vec4 unpack8(uint32_t);" + "i16vec2 unpack16(int32_t);" + "u16vec2 unpack16(uint32_t);" + "i16vec4 unpack16(int64_t);" + "u16vec4 unpack16(uint64_t);" + "i32vec2 unpack32(int64_t);" + "u32vec2 unpack32(uint64_t);" + + "float64_t radians(float64_t);" + "f64vec2 radians(f64vec2);" + "f64vec3 radians(f64vec3);" + "f64vec4 radians(f64vec4);" + + "float64_t degrees(float64_t);" + "f64vec2 degrees(f64vec2);" + "f64vec3 degrees(f64vec3);" + "f64vec4 degrees(f64vec4);" + + "float64_t sin(float64_t);" + "f64vec2 sin(f64vec2);" + "f64vec3 sin(f64vec3);" + "f64vec4 sin(f64vec4);" + + "float64_t cos(float64_t);" + "f64vec2 cos(f64vec2);" + "f64vec3 cos(f64vec3);" + "f64vec4 cos(f64vec4);" + + "float64_t tan(float64_t);" + "f64vec2 tan(f64vec2);" + "f64vec3 tan(f64vec3);" + "f64vec4 tan(f64vec4);" + + "float64_t asin(float64_t);" + "f64vec2 asin(f64vec2);" + "f64vec3 asin(f64vec3);" + "f64vec4 asin(f64vec4);" + + "float64_t acos(float64_t);" + "f64vec2 acos(f64vec2);" + "f64vec3 acos(f64vec3);" + "f64vec4 acos(f64vec4);" + + "float64_t atan(float64_t, float64_t);" + "f64vec2 atan(f64vec2, f64vec2);" + "f64vec3 atan(f64vec3, f64vec3);" + "f64vec4 atan(f64vec4, f64vec4);" + + "float64_t atan(float64_t);" + "f64vec2 atan(f64vec2);" + "f64vec3 atan(f64vec3);" + "f64vec4 atan(f64vec4);" + + "float64_t sinh(float64_t);" + "f64vec2 sinh(f64vec2);" + "f64vec3 sinh(f64vec3);" + "f64vec4 sinh(f64vec4);" + + "float64_t cosh(float64_t);" + "f64vec2 cosh(f64vec2);" + "f64vec3 cosh(f64vec3);" + "f64vec4 cosh(f64vec4);" + + "float64_t tanh(float64_t);" + "f64vec2 tanh(f64vec2);" + "f64vec3 tanh(f64vec3);" + "f64vec4 tanh(f64vec4);" + + "float64_t asinh(float64_t);" + "f64vec2 asinh(f64vec2);" + "f64vec3 asinh(f64vec3);" + "f64vec4 asinh(f64vec4);" + + "float64_t acosh(float64_t);" + "f64vec2 acosh(f64vec2);" + "f64vec3 acosh(f64vec3);" + "f64vec4 acosh(f64vec4);" + + "float64_t atanh(float64_t);" + "f64vec2 atanh(f64vec2);" + "f64vec3 atanh(f64vec3);" + "f64vec4 atanh(f64vec4);" + + "float64_t pow(float64_t, float64_t);" + "f64vec2 pow(f64vec2, f64vec2);" + "f64vec3 pow(f64vec3, f64vec3);" + "f64vec4 pow(f64vec4, f64vec4);" + + "float64_t exp(float64_t);" + "f64vec2 exp(f64vec2);" + "f64vec3 exp(f64vec3);" + "f64vec4 exp(f64vec4);" + + "float64_t log(float64_t);" + "f64vec2 log(f64vec2);" + "f64vec3 log(f64vec3);" + "f64vec4 log(f64vec4);" + + "float64_t exp2(float64_t);" + "f64vec2 exp2(f64vec2);" + "f64vec3 exp2(f64vec3);" + "f64vec4 exp2(f64vec4);" + + "float64_t log2(float64_t);" + "f64vec2 log2(f64vec2);" + "f64vec3 log2(f64vec3);" + "f64vec4 log2(f64vec4);" "\n"); + } + if (profile != EEsProfile && version >= 450) { + stageBuiltins[EShLangFragment].append( + "float64_t dFdx(float64_t);" + "f64vec2 dFdx(f64vec2);" + "f64vec3 dFdx(f64vec3);" + "f64vec4 dFdx(f64vec4);" + + "float64_t dFdy(float64_t);" + "f64vec2 dFdy(f64vec2);" + "f64vec3 dFdy(f64vec3);" + "f64vec4 dFdy(f64vec4);" + + "float64_t dFdxFine(float64_t);" + "f64vec2 dFdxFine(f64vec2);" + "f64vec3 dFdxFine(f64vec3);" + "f64vec4 dFdxFine(f64vec4);" + + "float64_t dFdyFine(float64_t);" + "f64vec2 dFdyFine(f64vec2);" + "f64vec3 dFdyFine(f64vec3);" + "f64vec4 dFdyFine(f64vec4);" + + "float64_t dFdxCoarse(float64_t);" + "f64vec2 dFdxCoarse(f64vec2);" + "f64vec3 dFdxCoarse(f64vec3);" + "f64vec4 dFdxCoarse(f64vec4);" + + "float64_t dFdyCoarse(float64_t);" + "f64vec2 dFdyCoarse(f64vec2);" + "f64vec3 dFdyCoarse(f64vec3);" + "f64vec4 dFdyCoarse(f64vec4);" + + "float64_t fwidth(float64_t);" + "f64vec2 fwidth(f64vec2);" + "f64vec3 fwidth(f64vec3);" + "f64vec4 fwidth(f64vec4);" + + "float64_t fwidthFine(float64_t);" + "f64vec2 fwidthFine(f64vec2);" + "f64vec3 fwidthFine(f64vec3);" + "f64vec4 fwidthFine(f64vec4);" + + "float64_t fwidthCoarse(float64_t);" + "f64vec2 fwidthCoarse(f64vec2);" + "f64vec3 fwidthCoarse(f64vec3);" + "f64vec4 fwidthCoarse(f64vec4);" + + "float64_t interpolateAtCentroid(float64_t);" + "f64vec2 interpolateAtCentroid(f64vec2);" + "f64vec3 interpolateAtCentroid(f64vec3);" + "f64vec4 interpolateAtCentroid(f64vec4);" + + "float64_t interpolateAtSample(float64_t, int);" + "f64vec2 interpolateAtSample(f64vec2, int);" + "f64vec3 interpolateAtSample(f64vec3, int);" + "f64vec4 interpolateAtSample(f64vec4, int);" + + "float64_t interpolateAtOffset(float64_t, f64vec2);" + "f64vec2 interpolateAtOffset(f64vec2, f64vec2);" + "f64vec3 interpolateAtOffset(f64vec3, f64vec2);" + "f64vec4 interpolateAtOffset(f64vec4, f64vec2);" + + "\n"); + } -#endif //============================================================================ // @@ -3126,6 +4906,20 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } + + // GL_AMD_shader_fragment_mask + if (profile != EEsProfile && version >= 450 && spvVersion.vulkan > 0) { + stageBuiltins[EShLangFragment].append( + "uint fragmentMaskFetchAMD(subpassInputMS);" + "uint fragmentMaskFetchAMD(isubpassInputMS);" + "uint fragmentMaskFetchAMD(usubpassInputMS);" + + "vec4 fragmentFetchAMD(subpassInputMS, uint);" + "ivec4 fragmentFetchAMD(isubpassInputMS, uint);" + "uvec4 fragmentFetchAMD(usubpassInputMS, uint);" + + "\n"); + } #endif //============================================================================ @@ -3413,7 +5207,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV stageBuiltins[EShLangVertex].append( "int gl_InstanceID;" // needs qualifier fixed later ); - if (spvVersion.vulkan >= 100 && version >= 140) + if (spvVersion.vulkan > 0 && version >= 140) stageBuiltins[EShLangVertex].append( "in int gl_VertexIndex;" "in int gl_InstanceIndex;" @@ -3425,6 +5219,12 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "in int gl_DrawIDARB;" ); } + if (version >= 410) { + stageBuiltins[EShLangVertex].append( + "out int gl_ViewportIndex;" + "out int gl_Layer;" + ); + } if (version >= 460) { stageBuiltins[EShLangVertex].append( "in int gl_BaseVertex;" @@ -3436,8 +5236,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV #ifdef NV_EXTENSIONS if (version >= 450) stageBuiltins[EShLangVertex].append( - "out int gl_ViewportIndex;" - "out int gl_Layer;" "out int gl_ViewportMask[];" // GL_NV_viewport_array2 "out int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering "out vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering @@ -3459,7 +5257,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "in highp int gl_VertexID;" // needs qualifier fixed later "in highp int gl_InstanceID;" // needs qualifier fixed later ); - if (spvVersion.vulkan >= 100) + if (spvVersion.vulkan > 0) stageBuiltins[EShLangVertex].append( "in highp int gl_VertexIndex;" "in highp int gl_InstanceIndex;" @@ -3554,6 +5352,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "out int gl_PrimitiveID;" "out int gl_Layer;"); + if (version >= 150) + stageBuiltins[EShLangGeometry].append( + "out int gl_ViewportIndex;" + ); + if (profile == ECompatibilityProfile && version < 400) stageBuiltins[EShLangGeometry].append( "out vec4 gl_ClipVertex;" @@ -3563,11 +5366,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV stageBuiltins[EShLangGeometry].append( "in int gl_InvocationID;" ); - // GL_ARB_viewport_array - if (version >= 150) - stageBuiltins[EShLangGeometry].append( - "out int gl_ViewportIndex;" - ); #ifdef NV_EXTENSIONS if (version >= 450) @@ -3644,8 +5442,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV stageBuiltins[EShLangTessControl].append( "float gl_CullDistance[];" #ifdef NV_EXTENSIONS - "int gl_ViewportIndex;" - "int gl_Layer;" "int gl_ViewportMask[];" // GL_NV_viewport_array2 "vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering "int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering @@ -3659,6 +5455,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "patch out float gl_TessLevelOuter[4];" "patch out float gl_TessLevelInner[2];" "\n"); + + if (version >= 410) + stageBuiltins[EShLangTessControl].append( + "out int gl_ViewportIndex;" + "out int gl_Layer;" + "\n"); + } else { // Note: "in gl_PerVertex {...} gl_in[gl_MaxPatchVertices];" is declared in initialize() below, // as it depends on the resource sizing of gl_MaxPatchVertices. @@ -3730,11 +5533,15 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "};" "\n"); + if (version >= 410) + stageBuiltins[EShLangTessEvaluation].append( + "out int gl_ViewportIndex;" + "out int gl_Layer;" + "\n"); + #ifdef NV_EXTENSIONS if (version >= 450) stageBuiltins[EShLangTessEvaluation].append( - "out int gl_ViewportIndex;" - "out int gl_Layer;" "out int gl_ViewportMask[];" // GL_NV_viewport_array2 "out vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering "out int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering @@ -3872,6 +5679,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "in vec3 gl_BaryCoordPullModelAMD;" ); #endif + +#ifdef NV_EXTENSIONS + if (version >= 430) + stageBuiltins[EShLangFragment].append( + "in bool gl_FragFullyCoveredNV;" + ); +#endif } else { // ES profile @@ -3920,17 +5734,30 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV // GL_ARB_shader_ballot if (profile != EEsProfile && version >= 450) { - commonBuiltins.append( + const char* ballotDecls = "uniform uint gl_SubGroupSizeARB;" - "in uint gl_SubGroupInvocationARB;" "in uint64_t gl_SubGroupEqMaskARB;" "in uint64_t gl_SubGroupGeMaskARB;" "in uint64_t gl_SubGroupGtMaskARB;" "in uint64_t gl_SubGroupLeMaskARB;" "in uint64_t gl_SubGroupLtMaskARB;" - - "\n"); + "\n"; + const char* fragmentBallotDecls = + "uniform uint gl_SubGroupSizeARB;" + "flat in uint gl_SubGroupInvocationARB;" + "flat in uint64_t gl_SubGroupEqMaskARB;" + "flat in uint64_t gl_SubGroupGeMaskARB;" + "flat in uint64_t gl_SubGroupGtMaskARB;" + "flat in uint64_t gl_SubGroupLeMaskARB;" + "flat in uint64_t gl_SubGroupLtMaskARB;" + "\n"; + stageBuiltins[EShLangVertex] .append(ballotDecls); + stageBuiltins[EShLangTessControl] .append(ballotDecls); + stageBuiltins[EShLangTessEvaluation].append(ballotDecls); + stageBuiltins[EShLangGeometry] .append(ballotDecls); + stageBuiltins[EShLangCompute] .append(ballotDecls); + stageBuiltins[EShLangFragment] .append(fragmentBallotDecls); } if ((profile != EEsProfile && version >= 140) || @@ -3941,6 +5768,39 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } + // GL_KHR_shader_subgroup + if (spvVersion.vulkan > 0) { + const char* ballotDecls = + "in mediump uint gl_SubgroupSize;" + "in mediump uint gl_SubgroupInvocationID;" + "in highp uvec4 gl_SubgroupEqMask;" + "in highp uvec4 gl_SubgroupGeMask;" + "in highp uvec4 gl_SubgroupGtMask;" + "in highp uvec4 gl_SubgroupLeMask;" + "in highp uvec4 gl_SubgroupLtMask;" + "\n"; + const char* fragmentBallotDecls = + "flat in mediump uint gl_SubgroupSize;" + "flat in mediump uint gl_SubgroupInvocationID;" + "flat in highp uvec4 gl_SubgroupEqMask;" + "flat in highp uvec4 gl_SubgroupGeMask;" + "flat in highp uvec4 gl_SubgroupGtMask;" + "flat in highp uvec4 gl_SubgroupLeMask;" + "flat in highp uvec4 gl_SubgroupLtMask;" + "\n"; + stageBuiltins[EShLangVertex] .append(ballotDecls); + stageBuiltins[EShLangTessControl] .append(ballotDecls); + stageBuiltins[EShLangTessEvaluation].append(ballotDecls); + stageBuiltins[EShLangGeometry] .append(ballotDecls); + stageBuiltins[EShLangCompute] .append(ballotDecls); + stageBuiltins[EShLangFragment] .append(fragmentBallotDecls); + + stageBuiltins[EShLangCompute].append( + "highp in uint gl_NumSubgroups;" + "highp in uint gl_SubgroupID;" + "\n"); + } + if (version >= 300 /* both ES and non-ES */) { stageBuiltins[EShLangFragment].append( "flat in highp uint gl_ViewID_OVR;" // GL_OVR_multiview, GL_OVR_multiview2 @@ -3961,8 +5821,11 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c // In this function proper, enumerate the types, then calls the next set of functions // to enumerate all the uses for that type. // - +#ifdef AMD_EXTENSIONS + TBasicType bTypes[4] = { EbtFloat, EbtFloat16, EbtInt, EbtUint }; +#else TBasicType bTypes[3] = { EbtFloat, EbtInt, EbtUint }; +#endif bool skipBuffer = (profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 140); bool skipCubeArrayed = (profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 130); @@ -4002,12 +5865,20 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c continue; if (ms && arrayed && profile == EEsProfile && version < 310) continue; +#ifdef AMD_EXTENSIONS + for (int bType = 0; bType < 4; ++bType) { // float, float16, int, uint results + if (shadow && bType > 1) + continue; + + if (bTypes[bType] == EbtFloat16 && (profile == EEsProfile ||version < 450)) + continue; +#else for (int bType = 0; bType < 3; ++bType) { // float, int, uint results if (shadow && bType > 0) continue; - +#endif if (dim == EsdRect && version < 140 && bType > 0) continue; @@ -4125,15 +5996,37 @@ void TBuiltIns::addQueryFunctions(TSampler sampler, const TString& typeName, int // if (profile != EEsProfile && version >= 400 && ! sampler.image && sampler.dim != EsdRect && ! sampler.ms && sampler.dim != EsdBuffer) { - stageBuiltins[EShLangFragment].append("vec2 textureQueryLod("); - stageBuiltins[EShLangFragment].append(typeName); - if (dimMap[sampler.dim] == 1) - stageBuiltins[EShLangFragment].append(", float"); - else { - stageBuiltins[EShLangFragment].append(", vec"); - stageBuiltins[EShLangFragment].append(postfixes[dimMap[sampler.dim]]); +#ifdef AMD_EXTENSIONS + for (int f16TexAddr = 0; f16TexAddr < 2; ++f16TexAddr) { + if (f16TexAddr && sampler.type != EbtFloat16) + continue; +#endif + stageBuiltins[EShLangFragment].append("vec2 textureQueryLod("); + stageBuiltins[EShLangFragment].append(typeName); + if (dimMap[sampler.dim] == 1) +#ifdef AMD_EXTENSIONS + if (f16TexAddr) + stageBuiltins[EShLangFragment].append(", float16_t"); + else + stageBuiltins[EShLangFragment].append(", float"); +#else + stageBuiltins[EShLangFragment].append(", float"); +#endif + else { +#ifdef AMD_EXTENSIONS + if (f16TexAddr) + stageBuiltins[EShLangFragment].append(", f16vec"); + else + stageBuiltins[EShLangFragment].append(", vec"); +#else + stageBuiltins[EShLangFragment].append(", vec"); +#endif + stageBuiltins[EShLangFragment].append(postfixes[dimMap[sampler.dim]]); + } + stageBuiltins[EShLangFragment].append(");\n"); +#ifdef AMD_EXTENSIONS } - stageBuiltins[EShLangFragment].append(");\n"); +#endif } // @@ -4323,7 +6216,7 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName, if (bias && (lod || sampler.ms)) continue; - if (bias && sampler.dim == Esd2D && sampler.shadow && sampler.arrayed) + if (bias && (sampler.dim == Esd2D || sampler.dim == EsdCube) && sampler.shadow && sampler.arrayed) continue; if (bias && (sampler.dim == EsdRect || sampler.dim == EsdBuffer)) continue; @@ -4372,149 +6265,237 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName, continue; if (extraProj && (sampler.dim == Esd3D || sampler.shadow)) continue; +#ifdef AMD_EXTENSIONS + for (int f16TexAddr = 0; f16TexAddr <= 1; ++f16TexAddr) { // loop over 16-bit floating-point texel addressing - for (int lodClamp = 0; lodClamp <= 1 ;++lodClamp) { // loop over "bool" lod clamp - - if (lodClamp && (profile == EEsProfile || version < 450)) - continue; - if (lodClamp && (proj || lod || fetch)) + if (f16TexAddr && sampler.type != EbtFloat16) continue; + if (f16TexAddr && sampler.shadow && ! compare) { + compare = true; // compare argument is always present + totalDims--; + } +#endif + for (int lodClamp = 0; lodClamp <= 1 ;++lodClamp) { // loop over "bool" lod clamp - for (int sparse = 0; sparse <= 1; ++sparse) { // loop over "bool" sparse or not - - if (sparse && (profile == EEsProfile || version < 450)) + if (lodClamp && (profile == EEsProfile || version < 450)) continue; - // Sparse sampling is not for 1D/1D array texture, buffer texture, and projective texture - if (sparse && (sampler.dim == Esd1D || sampler.dim == EsdBuffer || proj)) + if (lodClamp && (proj || lod || fetch)) continue; - TString s; + for (int sparse = 0; sparse <= 1; ++sparse) { // loop over "bool" sparse or not + + if (sparse && (profile == EEsProfile || version < 450)) + continue; + // Sparse sampling is not for 1D/1D array texture, buffer texture, and projective texture + if (sparse && (sampler.dim == Esd1D || sampler.dim == EsdBuffer || proj)) + continue; - // return type - if (sparse) - s.append("int "); - else { - if (sampler.shadow) - s.append("float "); + TString s; + + // return type + if (sparse) + s.append("int "); else { - s.append(prefixes[sampler.type]); - s.append("vec4 "); + if (sampler.shadow) +#ifdef AMD_EXTENSIONS + if (sampler.type == EbtFloat16) + s.append("float16_t "); + else + s.append("float "); +#else + s.append("float "); +#endif + else { + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } } - } - // name - if (sparse) { - if (fetch) - s.append("sparseTexel"); - else - s.append("sparseTexture"); - } else { - if (fetch) - s.append("texel"); - else - s.append("texture"); - } - if (proj) - s.append("Proj"); - if (lod) - s.append("Lod"); - if (grad) - s.append("Grad"); - if (fetch) - s.append("Fetch"); - if (offset) - s.append("Offset"); - if (lodClamp) - s.append("Clamp"); - if (lodClamp || sparse) - s.append("ARB"); - s.append("("); - - // sampler type - s.append(typeName); - - // P coordinate - if (extraProj) - s.append(",vec4"); - else { - s.append(","); - TBasicType t = fetch ? EbtInt : EbtFloat; - if (totalDims == 1) - s.append(TType::getBasicString(t)); + // name + if (sparse) { + if (fetch) + s.append("sparseTexel"); + else + s.append("sparseTexture"); + } else { - s.append(prefixes[t]); - s.append("vec"); - s.append(postfixes[totalDims]); + if (fetch) + s.append("texel"); + else + s.append("texture"); } - } - - if (bias && compare) - continue; - - // non-optional lod argument (lod that's not driven by lod loop) or sample - if ((fetch && sampler.dim != EsdBuffer && sampler.dim != EsdRect && !sampler.ms) || - (sampler.ms && fetch)) - s.append(",int"); - - // non-optional lod - if (lod) - s.append(",float"); - - // gradient arguments - if (grad) { - if (dimMap[sampler.dim] == 1) - s.append(",float,float"); + if (proj) + s.append("Proj"); + if (lod) + s.append("Lod"); + if (grad) + s.append("Grad"); + if (fetch) + s.append("Fetch"); + if (offset) + s.append("Offset"); + if (lodClamp) + s.append("Clamp"); + if (lodClamp || sparse) + s.append("ARB"); + s.append("("); + + // sampler type + s.append(typeName); +#ifdef AMD_EXTENSIONS + // P coordinate + if (extraProj) { + if (f16TexAddr) + s.append(",f16vec4"); + else + s.append(",vec4"); + } else { + s.append(","); + TBasicType t = fetch ? EbtInt : (f16TexAddr ? EbtFloat16 : EbtFloat); + if (totalDims == 1) + s.append(TType::getBasicString(t)); + else { + s.append(prefixes[t]); + s.append("vec"); + s.append(postfixes[totalDims]); + } + } +#else + // P coordinate + if (extraProj) + s.append(",vec4"); else { - s.append(",vec"); - s.append(postfixes[dimMap[sampler.dim]]); - s.append(",vec"); - s.append(postfixes[dimMap[sampler.dim]]); + s.append(","); + TBasicType t = fetch ? EbtInt : EbtFloat; + if (totalDims == 1) + s.append(TType::getBasicString(t)); + else { + s.append(prefixes[t]); + s.append("vec"); + s.append(postfixes[totalDims]); + } } - } +#endif + // non-optional compare + if (compare) + s.append(",float"); - // offset - if (offset) { - if (dimMap[sampler.dim] == 1) + // non-optional lod argument (lod that's not driven by lod loop) or sample + if ((fetch && sampler.dim != EsdBuffer && sampler.dim != EsdRect && !sampler.ms) || + (sampler.ms && fetch)) s.append(",int"); - else { - s.append(",ivec"); - s.append(postfixes[dimMap[sampler.dim]]); +#ifdef AMD_EXTENSIONS + // non-optional lod + if (lod) { + if (f16TexAddr) + s.append(",float16_t"); + else + s.append(",float"); } - } - - // non-optional compare - if (compare) - s.append(",float"); - // lod clamp - if (lodClamp) - s.append(",float"); - - // texel out (for sparse texture) - if (sparse) { - s.append(",out "); - if (sampler.shadow) - s.append("float "); - else { - s.append(prefixes[sampler.type]); - s.append("vec4 "); + // gradient arguments + if (grad) { + if (dimMap[sampler.dim] == 1) { + if (f16TexAddr) + s.append(",float16_t,float16_t"); + else + s.append(",float,float"); + } else { + if (f16TexAddr) + s.append(",f16vec"); + else + s.append(",vec"); + s.append(postfixes[dimMap[sampler.dim]]); + if (f16TexAddr) + s.append(",f16vec"); + else + s.append(",vec"); + s.append(postfixes[dimMap[sampler.dim]]); + } + } +#else + // non-optional lod + if (lod) + s.append(",float"); + + // gradient arguments + if (grad) { + if (dimMap[sampler.dim] == 1) + s.append(",float,float"); + else { + s.append(",vec"); + s.append(postfixes[dimMap[sampler.dim]]); + s.append(",vec"); + s.append(postfixes[dimMap[sampler.dim]]); + } + } +#endif + // offset + if (offset) { + if (dimMap[sampler.dim] == 1) + s.append(",int"); + else { + s.append(",ivec"); + s.append(postfixes[dimMap[sampler.dim]]); + } } - } - - // optional bias - if (bias) - s.append(",float"); - s.append(");\n"); +#ifdef AMD_EXTENSIONS + // lod clamp + if (lodClamp) { + if (f16TexAddr) + s.append(",float16_t"); + else + s.append(",float"); + } +#else + // lod clamp + if (lodClamp) + s.append(",float"); +#endif + // texel out (for sparse texture) + if (sparse) { + s.append(",out "); + if (sampler.shadow) +#ifdef AMD_EXTENSIONS + if (sampler.type == EbtFloat16) + s.append("float16_t"); + else + s.append("float"); +#else + s.append("float"); +#endif + else { + s.append(prefixes[sampler.type]); + s.append("vec4"); + } + } +#ifdef AMD_EXTENSIONS + // optional bias + if (bias) { + if (f16TexAddr) + s.append(",float16_t"); + else + s.append(",float"); + } +#else + // optional bias + if (bias) + s.append(",float"); +#endif + s.append(");\n"); - // Add to the per-language set of built-ins + // Add to the per-language set of built-ins + if (bias || lodClamp) + stageBuiltins[EShLangFragment].append(s); + else + commonBuiltins.append(s); - if (bias || lodClamp) - stageBuiltins[EShLangFragment].append(s); - else - commonBuiltins.append(s); + } } +#ifdef AMD_EXTENSIONS } +#endif } } } @@ -4547,81 +6528,96 @@ void TBuiltIns::addGatherFunctions(TSampler sampler, const TString& typeName, in if (version < 140 && sampler.dim == EsdRect && sampler.type != EbtFloat) return; - for (int offset = 0; offset < 3; ++offset) { // loop over three forms of offset in the call name: none, Offset, and Offsets +#ifdef AMD_EXTENSIONS + for (int f16TexAddr = 0; f16TexAddr <= 1; ++f16TexAddr) { // loop over 16-bit floating-point texel addressing - for (int comp = 0; comp < 2; ++comp) { // loop over presence of comp argument + if (f16TexAddr && sampler.type != EbtFloat16) + continue; +#endif + for (int offset = 0; offset < 3; ++offset) { // loop over three forms of offset in the call name: none, Offset, and Offsets - if (comp > 0 && sampler.shadow) - continue; + for (int comp = 0; comp < 2; ++comp) { // loop over presence of comp argument - if (offset > 0 && sampler.dim == EsdCube) - continue; + if (comp > 0 && sampler.shadow) + continue; - for (int sparse = 0; sparse <= 1; ++sparse) { // loop over "bool" sparse or not - if (sparse && (profile == EEsProfile || version < 450)) + if (offset > 0 && sampler.dim == EsdCube) continue; - TString s; + for (int sparse = 0; sparse <= 1; ++sparse) { // loop over "bool" sparse or not + if (sparse && (profile == EEsProfile || version < 450)) + continue; - // return type - if (sparse) - s.append("int "); - else { - s.append(prefixes[sampler.type]); - s.append("vec4 "); - } + TString s; - // name - if (sparse) - s.append("sparseTextureGather"); - else - s.append("textureGather"); - switch (offset) { - case 1: - s.append("Offset"); - break; - case 2: - s.append("Offsets"); - default: - break; - } + // return type + if (sparse) + s.append("int "); + else { + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } - if (sparse) - s.append("ARB"); - s.append("("); + // name + if (sparse) + s.append("sparseTextureGather"); + else + s.append("textureGather"); + switch (offset) { + case 1: + s.append("Offset"); + break; + case 2: + s.append("Offsets"); + default: + break; + } + if (sparse) + s.append("ARB"); + s.append("("); - // sampler type argument - s.append(typeName); + // sampler type argument + s.append(typeName); - // P coordinate argument - s.append(",vec"); - int totalDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0); - s.append(postfixes[totalDims]); + // P coordinate argument +#ifdef AMD_EXTENSIONS + if (f16TexAddr) + s.append(",f16vec"); + else + s.append(",vec"); +#else + s.append(",vec"); +#endif + int totalDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0); + s.append(postfixes[totalDims]); + + // refZ argument + if (sampler.shadow) + s.append(",float"); + + // offset argument + if (offset > 0) { + s.append(",ivec2"); + if (offset == 2) + s.append("[4]"); + } - // refZ argument - if (sampler.shadow) - s.append(",float"); + // texel out (for sparse texture) + if (sparse) { + s.append(",out "); + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } - // offset argument - if (offset > 0) { - s.append(",ivec2"); - if (offset == 2) - s.append("[4]"); - } + // comp argument + if (comp) + s.append(",int"); - // texel out (for sparse texture) - if (sparse) { - s.append(",out "); - s.append(prefixes[sampler.type]); - s.append("vec4 "); + s.append(");\n"); + commonBuiltins.append(s); +#ifdef AMD_EXTENSIONS } - - // comp argument - if (comp) - s.append(",int"); - - s.append(");\n"); - commonBuiltins.append(s); +#endif } } } @@ -4640,95 +6636,112 @@ void TBuiltIns::addGatherFunctions(TSampler sampler, const TString& typeName, in if ((lod && bias) || (lod == 0 && bias == 0)) continue; - for (int offset = 0; offset < 3; ++offset) { // loop over three forms of offset in the call name: none, Offset, and Offsets + for (int f16TexAddr = 0; f16TexAddr <= 1; ++f16TexAddr) { // loop over 16-bit floating-point texel addressing - for (int comp = 0; comp < 2; ++comp) { // loop over presence of comp argument + if (f16TexAddr && sampler.type != EbtFloat16) + continue; - if (comp == 0 && bias) - continue; + for (int offset = 0; offset < 3; ++offset) { // loop over three forms of offset in the call name: none, Offset, and Offsets - if (offset > 0 && sampler.dim == EsdCube) - continue; + for (int comp = 0; comp < 2; ++comp) { // loop over presence of comp argument - for (int sparse = 0; sparse <= 1; ++sparse) { // loop over "bool" sparse or not - if (sparse && (profile == EEsProfile || version < 450)) + if (comp == 0 && bias) continue; - TString s; + if (offset > 0 && sampler.dim == EsdCube) + continue; - // return type - if (sparse) - s.append("int "); - else { - s.append(prefixes[sampler.type]); - s.append("vec4 "); - } + for (int sparse = 0; sparse <= 1; ++sparse) { // loop over "bool" sparse or not + if (sparse && (profile == EEsProfile || version < 450)) + continue; - // name - if (sparse) - s.append("sparseTextureGather"); - else - s.append("textureGather"); - - if (lod) - s.append("Lod"); - - switch (offset) { - case 1: - s.append("Offset"); - break; - case 2: - s.append("Offsets"); - default: - break; - } + TString s; - if (lod) - s.append("AMD"); - else if (sparse) - s.append("ARB"); + // return type + if (sparse) + s.append("int "); + else { + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } - s.append("("); + // name + if (sparse) + s.append("sparseTextureGather"); + else + s.append("textureGather"); + + if (lod) + s.append("Lod"); + + switch (offset) { + case 1: + s.append("Offset"); + break; + case 2: + s.append("Offsets"); + default: + break; + } - // sampler type argument - s.append(typeName); + if (lod) + s.append("AMD"); + else if (sparse) + s.append("ARB"); + + s.append("("); + + // sampler type argument + s.append(typeName); + + // P coordinate argument + if (f16TexAddr) + s.append(",f16vec"); + else + s.append(",vec"); + int totalDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0); + s.append(postfixes[totalDims]); + + // lod argument + if (lod) { + if (f16TexAddr) + s.append(",float16_t"); + else + s.append(",float"); + } - // P coordinate argument - s.append(",vec"); - int totalDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0); - s.append(postfixes[totalDims]); - - // lod argument - if (lod) - s.append(",float"); - - // offset argument - if (offset > 0) { - s.append(",ivec2"); - if (offset == 2) - s.append("[4]"); - } + // offset argument + if (offset > 0) { + s.append(",ivec2"); + if (offset == 2) + s.append("[4]"); + } - // texel out (for sparse texture) - if (sparse) { - s.append(",out "); - s.append(prefixes[sampler.type]); - s.append("vec4 "); - } + // texel out (for sparse texture) + if (sparse) { + s.append(",out "); + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } - // comp argument - if (comp) - s.append(",int"); + // comp argument + if (comp) + s.append(",int"); - // bias argument - if (bias) - s.append(",float"); + // bias argument + if (bias) { + if (f16TexAddr) + s.append(",float16_t"); + else + s.append(",float"); + } - s.append(");\n"); - if (bias) - stageBuiltins[EShLangFragment].append(s); - else - commonBuiltins.append(s); + s.append(");\n"); + if (bias) + stageBuiltins[EShLangFragment].append(s); + else + commonBuiltins.append(s); + } } } } @@ -5315,9 +7328,11 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable); BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable); - if (spvVersion.vulkan >= 100) + if (spvVersion.vulkan > 0) // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable); + else + BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); if (version >= 430) { symbolTable.setFunctionExtensions("anyInvocationARB", 1, &E_GL_ARB_shader_group_vote); @@ -5364,6 +7379,11 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setFunctionExtensions("cubeFaceCoordAMD", 1, &E_GL_AMD_gcn_shader); symbolTable.setFunctionExtensions("timeAMD", 1, &E_GL_AMD_gcn_shader); } + + if (profile != EEsProfile) { + symbolTable.setFunctionExtensions("fragmentMaskFetchAMD", 1, &E_GL_AMD_shader_fragment_mask); + symbolTable.setFunctionExtensions("fragmentFetchAMD", 1, &E_GL_AMD_shader_fragment_mask); + } #endif // Compatibility variables, vertex only @@ -5411,7 +7431,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion SpecialQualifier("gl_InstanceID", EvqInstanceId, EbvInstanceId, symbolTable); } - if (spvVersion.vulkan >= 100) { + if (spvVersion.vulkan > 0) { BuiltInVariable("gl_VertexIndex", EbvVertexIndex, symbolTable); BuiltInVariable("gl_InstanceIndex", EbvInstanceIndex, symbolTable); } @@ -5467,6 +7487,14 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setVariableExtensions("gl_Layer", Num_viewportEXTs, viewportEXTs); symbolTable.setVariableExtensions("gl_ViewportIndex", Num_viewportEXTs, viewportEXTs); } +#else + if (language != EShLangGeometry && version >= 410) { + symbolTable.setVariableExtensions("gl_Layer", 1, &E_GL_ARB_shader_viewport_layer_array); + symbolTable.setVariableExtensions("gl_ViewportIndex", 1, &E_GL_ARB_shader_viewport_layer_array); + } +#endif + +#ifdef NV_EXTENSIONS symbolTable.setVariableExtensions("gl_ViewportMask", 1, &E_GL_NV_viewport_array2); symbolTable.setVariableExtensions("gl_SecondaryPositionNV", 1, &E_GL_NV_stereo_view_rendering); symbolTable.setVariableExtensions("gl_SecondaryViewportMaskNV", 1, &E_GL_NV_stereo_view_rendering); @@ -5483,8 +7511,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_in", "gl_SecondaryPositionNV", EbvSecondaryPositionNV, symbolTable); BuiltInVariable("gl_in", "gl_PositionPerViewNV", EbvPositionPerViewNV, symbolTable); } - BuiltInVariable("gl_out", "gl_Layer", EbvLayer, symbolTable); - BuiltInVariable("gl_out", "gl_ViewportIndex", EbvViewportIndex, symbolTable); BuiltInVariable("gl_out", "gl_ViewportMask", EbvViewportMaskNV, symbolTable); BuiltInVariable("gl_out", "gl_SecondaryPositionNV", EbvSecondaryPositionNV, symbolTable); BuiltInVariable("gl_out", "gl_SecondaryViewportMaskNV", EbvSecondaryViewportMaskNV, symbolTable); @@ -5545,6 +7571,25 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview); BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable); } + + // GL_KHR_shader_subgroup + if (spvVersion.vulkan > 0) { + symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + + BuiltInVariable("gl_SubgroupSize", EbvSubgroupSize2, symbolTable); + BuiltInVariable("gl_SubgroupInvocationID", EbvSubgroupInvocation2, symbolTable); + BuiltInVariable("gl_SubgroupEqMask", EbvSubgroupEqMask2, symbolTable); + BuiltInVariable("gl_SubgroupGeMask", EbvSubgroupGeMask2, symbolTable); + BuiltInVariable("gl_SubgroupGtMask", EbvSubgroupGtMask2, symbolTable); + BuiltInVariable("gl_SubgroupLeMask", EbvSubgroupLeMask2, symbolTable); + BuiltInVariable("gl_SubgroupLtMask", EbvSubgroupLtMask2, symbolTable); + } break; @@ -5756,6 +7801,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion } #endif +#ifdef NV_EXTENSIONS + if (profile != EEsProfile && version >= 430) { + symbolTable.setVariableExtensions("gl_FragFullyCoveredNV", 1, &E_GL_NV_conservative_raster_underestimation); + BuiltInVariable("gl_FragFullyCoveredNV", EbvFragFullyCoveredNV, symbolTable); + } +#endif + symbolTable.setVariableExtensions("gl_FragDepthEXT", 1, &E_GL_EXT_frag_depth); if (profile == EEsProfile && version < 320) { @@ -5783,6 +7835,130 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_ViewID_OVR", EbvViewIndex, symbolTable); } + // GL_ARB_shader_ballot + if (profile != EEsProfile) { + symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupInvocationARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupEqMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGtMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLtMaskARB", 1, &E_GL_ARB_shader_ballot); + + BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable); + BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable); + BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable); + BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable); + BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable); + BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable); + + if (spvVersion.vulkan > 0) + // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan + SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable); + else + BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); + } + + // GL_KHR_shader_subgroup + if (spvVersion.vulkan > 0) { + symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + + BuiltInVariable("gl_SubgroupSize", EbvSubgroupSize2, symbolTable); + BuiltInVariable("gl_SubgroupInvocationID", EbvSubgroupInvocation2, symbolTable); + BuiltInVariable("gl_SubgroupEqMask", EbvSubgroupEqMask2, symbolTable); + BuiltInVariable("gl_SubgroupGeMask", EbvSubgroupGeMask2, symbolTable); + BuiltInVariable("gl_SubgroupGtMask", EbvSubgroupGtMask2, symbolTable); + BuiltInVariable("gl_SubgroupLeMask", EbvSubgroupLeMask2, symbolTable); + BuiltInVariable("gl_SubgroupLtMask", EbvSubgroupLtMask2, symbolTable); + + symbolTable.setFunctionExtensions("subgroupBarrier", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setFunctionExtensions("subgroupMemoryBarrier", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setFunctionExtensions("subgroupMemoryBarrierBuffer", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setFunctionExtensions("subgroupMemoryBarrierImage", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setFunctionExtensions("subgroupElect", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setFunctionExtensions("subgroupAll", 1, &E_GL_KHR_shader_subgroup_vote); + symbolTable.setFunctionExtensions("subgroupAny", 1, &E_GL_KHR_shader_subgroup_vote); + symbolTable.setFunctionExtensions("subgroupAllEqual", 1, &E_GL_KHR_shader_subgroup_vote); + symbolTable.setFunctionExtensions("subgroupBroadcast", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBroadcastFirst", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBallot", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupInverseBallot", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBallotBitExtract", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBallotBitCount", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBallotInclusiveBitCount", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBallotExclusiveBitCount", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBallotFindLSB", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupBallotFindMSB", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setFunctionExtensions("subgroupShuffle", 1, &E_GL_KHR_shader_subgroup_shuffle); + symbolTable.setFunctionExtensions("subgroupShuffleXor", 1, &E_GL_KHR_shader_subgroup_shuffle); + symbolTable.setFunctionExtensions("subgroupShuffleUp", 1, &E_GL_KHR_shader_subgroup_shuffle_relative); + symbolTable.setFunctionExtensions("subgroupShuffleDown", 1, &E_GL_KHR_shader_subgroup_shuffle_relative); + symbolTable.setFunctionExtensions("subgroupAdd", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupMul", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupMin", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupMax", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupAnd", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupOr", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupXor", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupInclusiveAdd", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupInclusiveMul", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupInclusiveMin", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupInclusiveMax", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupInclusiveAnd", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupInclusiveOr", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupInclusiveXor", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupExclusiveAdd", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupExclusiveMul", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupExclusiveMin", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupExclusiveMax", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupExclusiveAnd", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupExclusiveOr", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupExclusiveXor", 1, &E_GL_KHR_shader_subgroup_arithmetic); + symbolTable.setFunctionExtensions("subgroupClusteredAdd", 1, &E_GL_KHR_shader_subgroup_clustered); + symbolTable.setFunctionExtensions("subgroupClusteredMul", 1, &E_GL_KHR_shader_subgroup_clustered); + symbolTable.setFunctionExtensions("subgroupClusteredMin", 1, &E_GL_KHR_shader_subgroup_clustered); + symbolTable.setFunctionExtensions("subgroupClusteredMax", 1, &E_GL_KHR_shader_subgroup_clustered); + symbolTable.setFunctionExtensions("subgroupClusteredAnd", 1, &E_GL_KHR_shader_subgroup_clustered); + symbolTable.setFunctionExtensions("subgroupClusteredOr", 1, &E_GL_KHR_shader_subgroup_clustered); + symbolTable.setFunctionExtensions("subgroupClusteredXor", 1, &E_GL_KHR_shader_subgroup_clustered); + symbolTable.setFunctionExtensions("subgroupQuadBroadcast", 1, &E_GL_KHR_shader_subgroup_quad); + symbolTable.setFunctionExtensions("subgroupQuadSwapHorizontal", 1, &E_GL_KHR_shader_subgroup_quad); + symbolTable.setFunctionExtensions("subgroupQuadSwapVertical", 1, &E_GL_KHR_shader_subgroup_quad); + symbolTable.setFunctionExtensions("subgroupQuadSwapDiagonal", 1, &E_GL_KHR_shader_subgroup_quad); + +#ifdef NV_EXTENSIONS + symbolTable.setFunctionExtensions("subgroupPartitionNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedAddNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedMulNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedMinNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedMaxNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedAndNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedOrNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedXorNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveAddNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveMulNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveMinNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveMaxNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveAndNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveOrNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveXorNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveAddNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveMulNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveMinNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveMaxNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveAndNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveOrNV", 1, &E_GL_NV_shader_subgroup_partitioned); + symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveXorNV", 1, &E_GL_NV_shader_subgroup_partitioned); +#endif + + } + if (profile == EEsProfile) { symbolTable.setFunctionExtensions("shadow2DEXT", 1, &E_GL_EXT_shadow_samplers); symbolTable.setFunctionExtensions("shadow2DProjEXT", 1, &E_GL_EXT_shadow_samplers); @@ -5821,6 +7997,49 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setFunctionExtensions("groupMemoryBarrier", 1, &E_GL_ARB_compute_shader); } + // GL_ARB_shader_ballot + if (profile != EEsProfile) { + symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupInvocationARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupEqMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGtMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLtMaskARB", 1, &E_GL_ARB_shader_ballot); + + BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable); + BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable); + BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable); + BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable); + BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable); + BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable); + + if (spvVersion.vulkan > 0) + // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan + SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable); + else + BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); + } + + // GL_ARB_shader_ballot + if (spvVersion.vulkan > 0) { + symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + + BuiltInVariable("gl_SubgroupSize", EbvSubgroupSize2, symbolTable); + BuiltInVariable("gl_SubgroupInvocationID", EbvSubgroupInvocation2, symbolTable); + BuiltInVariable("gl_SubgroupEqMask", EbvSubgroupEqMask2, symbolTable); + BuiltInVariable("gl_SubgroupGeMask", EbvSubgroupGeMask2, symbolTable); + BuiltInVariable("gl_SubgroupGtMask", EbvSubgroupGtMask2, symbolTable); + BuiltInVariable("gl_SubgroupLeMask", EbvSubgroupLeMask2, symbolTable); + BuiltInVariable("gl_SubgroupLtMask", EbvSubgroupLtMask2, symbolTable); + } + if ((profile != EEsProfile && version >= 140) || (profile == EEsProfile && version >= 310)) { symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); @@ -5829,6 +8048,16 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable); } + // GL_KHR_shader_subgroup + if (spvVersion.vulkan > 0) { + symbolTable.setVariableExtensions("gl_NumSubgroups", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupID", 1, &E_GL_KHR_shader_subgroup_basic); + + BuiltInVariable("gl_NumSubgroups", EbvNumSubgroups, symbolTable); + BuiltInVariable("gl_SubgroupID", EbvSubgroupID, symbolTable); + + symbolTable.setFunctionExtensions("subgroupMemoryBarrierShared", 1, &E_GL_KHR_shader_subgroup_basic); + } break; default: @@ -5914,12 +8143,15 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("doubleBitsToUint64", EOpDoubleBitsToUint64); symbolTable.relateToOperator("int64BitsToDouble", EOpInt64BitsToDouble); symbolTable.relateToOperator("uint64BitsToDouble", EOpUint64BitsToDouble); -#ifdef AMD_EXTENSIONS + symbolTable.relateToOperator("halfBitsToInt16", EOpFloat16BitsToInt16); + symbolTable.relateToOperator("halfBitsToUint16", EOpFloat16BitsToUint16); symbolTable.relateToOperator("float16BitsToInt16", EOpFloat16BitsToInt16); symbolTable.relateToOperator("float16BitsToUint16", EOpFloat16BitsToUint16); symbolTable.relateToOperator("int16BitsToFloat16", EOpInt16BitsToFloat16); symbolTable.relateToOperator("uint16BitsToFloat16", EOpUint16BitsToFloat16); -#endif + + symbolTable.relateToOperator("int16BitsToHalf", EOpInt16BitsToFloat16); + symbolTable.relateToOperator("uint16BitsToHalf", EOpUint16BitsToFloat16); symbolTable.relateToOperator("packSnorm2x16", EOpPackSnorm2x16); symbolTable.relateToOperator("unpackSnorm2x16", EOpUnpackSnorm2x16); @@ -5942,7 +8174,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("packUint2x32", EOpPackUint2x32); symbolTable.relateToOperator("unpackUint2x32", EOpUnpackUint2x32); -#ifdef AMD_EXTENSIONS symbolTable.relateToOperator("packInt2x16", EOpPackInt2x16); symbolTable.relateToOperator("unpackInt2x16", EOpUnpackInt2x16); symbolTable.relateToOperator("packUint2x16", EOpPackUint2x16); @@ -5952,10 +8183,16 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("unpackInt4x16", EOpUnpackInt4x16); symbolTable.relateToOperator("packUint4x16", EOpPackUint4x16); symbolTable.relateToOperator("unpackUint4x16", EOpUnpackUint4x16); - symbolTable.relateToOperator("packFloat2x16", EOpPackFloat2x16); symbolTable.relateToOperator("unpackFloat2x16", EOpUnpackFloat2x16); -#endif + + symbolTable.relateToOperator("pack16", EOpPack16); + symbolTable.relateToOperator("pack32", EOpPack32); + symbolTable.relateToOperator("pack64", EOpPack64); + + symbolTable.relateToOperator("unpack32", EOpUnpack32); + symbolTable.relateToOperator("unpack16", EOpUnpack16); + symbolTable.relateToOperator("unpack8", EOpUnpack8); symbolTable.relateToOperator("length", EOpLength); symbolTable.relateToOperator("distance", EOpDistance); @@ -6194,8 +8431,95 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("imageLoadLodAMD", EOpImageLoadLod); symbolTable.relateToOperator("imageStoreLodAMD", EOpImageStoreLod); symbolTable.relateToOperator("sparseImageLoadLodAMD", EOpSparseImageLoadLod); + + symbolTable.relateToOperator("fragmentMaskFetchAMD", EOpFragmentMaskFetch); + symbolTable.relateToOperator("fragmentFetchAMD", EOpFragmentFetch); #endif } + + // GL_KHR_shader_subgroup + if (spvVersion.vulkan > 0) { + symbolTable.relateToOperator("subgroupBarrier", EOpSubgroupBarrier); + symbolTable.relateToOperator("subgroupMemoryBarrier", EOpSubgroupMemoryBarrier); + symbolTable.relateToOperator("subgroupMemoryBarrierBuffer", EOpSubgroupMemoryBarrierBuffer); + symbolTable.relateToOperator("subgroupMemoryBarrierImage", EOpSubgroupMemoryBarrierImage); + symbolTable.relateToOperator("subgroupElect", EOpSubgroupElect); + symbolTable.relateToOperator("subgroupAll", EOpSubgroupAll); + symbolTable.relateToOperator("subgroupAny", EOpSubgroupAny); + symbolTable.relateToOperator("subgroupAllEqual", EOpSubgroupAllEqual); + symbolTable.relateToOperator("subgroupBroadcast", EOpSubgroupBroadcast); + symbolTable.relateToOperator("subgroupBroadcastFirst", EOpSubgroupBroadcastFirst); + symbolTable.relateToOperator("subgroupBallot", EOpSubgroupBallot); + symbolTable.relateToOperator("subgroupInverseBallot", EOpSubgroupInverseBallot); + symbolTable.relateToOperator("subgroupBallotBitExtract", EOpSubgroupBallotBitExtract); + symbolTable.relateToOperator("subgroupBallotBitCount", EOpSubgroupBallotBitCount); + symbolTable.relateToOperator("subgroupBallotInclusiveBitCount", EOpSubgroupBallotInclusiveBitCount); + symbolTable.relateToOperator("subgroupBallotExclusiveBitCount", EOpSubgroupBallotExclusiveBitCount); + symbolTable.relateToOperator("subgroupBallotFindLSB", EOpSubgroupBallotFindLSB); + symbolTable.relateToOperator("subgroupBallotFindMSB", EOpSubgroupBallotFindMSB); + symbolTable.relateToOperator("subgroupShuffle", EOpSubgroupShuffle); + symbolTable.relateToOperator("subgroupShuffleXor", EOpSubgroupShuffleXor); + symbolTable.relateToOperator("subgroupShuffleUp", EOpSubgroupShuffleUp); + symbolTable.relateToOperator("subgroupShuffleDown", EOpSubgroupShuffleDown); + symbolTable.relateToOperator("subgroupAdd", EOpSubgroupAdd); + symbolTable.relateToOperator("subgroupMul", EOpSubgroupMul); + symbolTable.relateToOperator("subgroupMin", EOpSubgroupMin); + symbolTable.relateToOperator("subgroupMax", EOpSubgroupMax); + symbolTable.relateToOperator("subgroupAnd", EOpSubgroupAnd); + symbolTable.relateToOperator("subgroupOr", EOpSubgroupOr); + symbolTable.relateToOperator("subgroupXor", EOpSubgroupXor); + symbolTable.relateToOperator("subgroupInclusiveAdd", EOpSubgroupInclusiveAdd); + symbolTable.relateToOperator("subgroupInclusiveMul", EOpSubgroupInclusiveMul); + symbolTable.relateToOperator("subgroupInclusiveMin", EOpSubgroupInclusiveMin); + symbolTable.relateToOperator("subgroupInclusiveMax", EOpSubgroupInclusiveMax); + symbolTable.relateToOperator("subgroupInclusiveAnd", EOpSubgroupInclusiveAnd); + symbolTable.relateToOperator("subgroupInclusiveOr", EOpSubgroupInclusiveOr); + symbolTable.relateToOperator("subgroupInclusiveXor", EOpSubgroupInclusiveXor); + symbolTable.relateToOperator("subgroupExclusiveAdd", EOpSubgroupExclusiveAdd); + symbolTable.relateToOperator("subgroupExclusiveMul", EOpSubgroupExclusiveMul); + symbolTable.relateToOperator("subgroupExclusiveMin", EOpSubgroupExclusiveMin); + symbolTable.relateToOperator("subgroupExclusiveMax", EOpSubgroupExclusiveMax); + symbolTable.relateToOperator("subgroupExclusiveAnd", EOpSubgroupExclusiveAnd); + symbolTable.relateToOperator("subgroupExclusiveOr", EOpSubgroupExclusiveOr); + symbolTable.relateToOperator("subgroupExclusiveXor", EOpSubgroupExclusiveXor); + symbolTable.relateToOperator("subgroupClusteredAdd", EOpSubgroupClusteredAdd); + symbolTable.relateToOperator("subgroupClusteredMul", EOpSubgroupClusteredMul); + symbolTable.relateToOperator("subgroupClusteredMin", EOpSubgroupClusteredMin); + symbolTable.relateToOperator("subgroupClusteredMax", EOpSubgroupClusteredMax); + symbolTable.relateToOperator("subgroupClusteredAnd", EOpSubgroupClusteredAnd); + symbolTable.relateToOperator("subgroupClusteredOr", EOpSubgroupClusteredOr); + symbolTable.relateToOperator("subgroupClusteredXor", EOpSubgroupClusteredXor); + symbolTable.relateToOperator("subgroupQuadBroadcast", EOpSubgroupQuadBroadcast); + symbolTable.relateToOperator("subgroupQuadSwapHorizontal", EOpSubgroupQuadSwapHorizontal); + symbolTable.relateToOperator("subgroupQuadSwapVertical", EOpSubgroupQuadSwapVertical); + symbolTable.relateToOperator("subgroupQuadSwapDiagonal", EOpSubgroupQuadSwapDiagonal); + +#ifdef NV_EXTENSIONS + symbolTable.relateToOperator("subgroupPartitionNV", EOpSubgroupPartition); + symbolTable.relateToOperator("subgroupPartitionedAddNV", EOpSubgroupPartitionedAdd); + symbolTable.relateToOperator("subgroupPartitionedMulNV", EOpSubgroupPartitionedMul); + symbolTable.relateToOperator("subgroupPartitionedMinNV", EOpSubgroupPartitionedMin); + symbolTable.relateToOperator("subgroupPartitionedMaxNV", EOpSubgroupPartitionedMax); + symbolTable.relateToOperator("subgroupPartitionedAndNV", EOpSubgroupPartitionedAnd); + symbolTable.relateToOperator("subgroupPartitionedOrNV", EOpSubgroupPartitionedOr); + symbolTable.relateToOperator("subgroupPartitionedXorNV", EOpSubgroupPartitionedXor); + symbolTable.relateToOperator("subgroupPartitionedInclusiveAddNV", EOpSubgroupPartitionedInclusiveAdd); + symbolTable.relateToOperator("subgroupPartitionedInclusiveMulNV", EOpSubgroupPartitionedInclusiveMul); + symbolTable.relateToOperator("subgroupPartitionedInclusiveMinNV", EOpSubgroupPartitionedInclusiveMin); + symbolTable.relateToOperator("subgroupPartitionedInclusiveMaxNV", EOpSubgroupPartitionedInclusiveMax); + symbolTable.relateToOperator("subgroupPartitionedInclusiveAndNV", EOpSubgroupPartitionedInclusiveAnd); + symbolTable.relateToOperator("subgroupPartitionedInclusiveOrNV", EOpSubgroupPartitionedInclusiveOr); + symbolTable.relateToOperator("subgroupPartitionedInclusiveXorNV", EOpSubgroupPartitionedInclusiveXor); + symbolTable.relateToOperator("subgroupPartitionedExclusiveAddNV", EOpSubgroupPartitionedExclusiveAdd); + symbolTable.relateToOperator("subgroupPartitionedExclusiveMulNV", EOpSubgroupPartitionedExclusiveMul); + symbolTable.relateToOperator("subgroupPartitionedExclusiveMinNV", EOpSubgroupPartitionedExclusiveMin); + symbolTable.relateToOperator("subgroupPartitionedExclusiveMaxNV", EOpSubgroupPartitionedExclusiveMax); + symbolTable.relateToOperator("subgroupPartitionedExclusiveAndNV", EOpSubgroupPartitionedExclusiveAnd); + symbolTable.relateToOperator("subgroupPartitionedExclusiveOrNV", EOpSubgroupPartitionedExclusiveOr); + symbolTable.relateToOperator("subgroupPartitionedExclusiveXorNV", EOpSubgroupPartitionedExclusiveXor); +#endif + } + if (profile == EEsProfile) { symbolTable.relateToOperator("shadow2DEXT", EOpTexture); symbolTable.relateToOperator("shadow2DProjEXT", EOpTextureProj); @@ -6236,12 +8560,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion #ifdef AMD_EXTENSIONS if (profile != EEsProfile) symbolTable.relateToOperator("interpolateAtVertexAMD", EOpInterpolateAtVertex); - break; #endif + break; case EShLangCompute: - symbolTable.relateToOperator("memoryBarrierShared", EOpMemoryBarrierShared); - symbolTable.relateToOperator("groupMemoryBarrier", EOpGroupMemoryBarrier); + symbolTable.relateToOperator("memoryBarrierShared", EOpMemoryBarrierShared); + symbolTable.relateToOperator("groupMemoryBarrier", EOpGroupMemoryBarrier); + symbolTable.relateToOperator("subgroupMemoryBarrierShared", EOpSubgroupMemoryBarrierShared); break; default: @@ -6277,9 +8602,9 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion if (version == 100 || IncludeLegacy(version, profile, spvVersion) || (! ForwardCompatibility && profile != EEsProfile && version < 420)) { TPrecisionQualifier pq = profile == EEsProfile ? EpqMedium : EpqNone; TType fragData(EbtFloat, EvqFragColor, pq, 4); - TArraySizes& arraySizes = *new TArraySizes; - arraySizes.addInnerSize(resources.maxDrawBuffers); - fragData.newArraySizes(arraySizes); + TArraySizes* arraySizes = new TArraySizes; + arraySizes->addInnerSize(resources.maxDrawBuffers); + fragData.transferArraySizes(arraySizes); symbolTable.insert(*new TVariable(NewPoolTString("gl_FragData"), fragData)); SpecialQualifier("gl_FragData", EvqFragColor, EbvFragData, symbolTable); } diff --git a/deps/glslang/glslang/MachineIndependent/Initialize.h b/deps/glslang/glslang/MachineIndependent/Initialize.h index 6b54c4da..b5de3242 100644 --- a/deps/glslang/glslang/MachineIndependent/Initialize.h +++ b/deps/glslang/glslang/MachineIndependent/Initialize.h @@ -67,7 +67,6 @@ class TBuiltInParseables { virtual const TString& getStageString(EShLanguage language) const { return stageBuiltins[language]; } virtual void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable) = 0; - virtual void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources) = 0; protected: @@ -89,7 +88,6 @@ class TBuiltIns : public TBuiltInParseables { void initialize(const TBuiltInResource& resources, int version, EProfile, const SpvVersion& spvVersion, EShLanguage); void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable); - void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources); protected: diff --git a/deps/glslang/glslang/MachineIndependent/Intermediate.cpp b/deps/glslang/glslang/MachineIndependent/Intermediate.cpp index 04a45e03..0333e5d0 100644 --- a/deps/glslang/glslang/MachineIndependent/Intermediate.cpp +++ b/deps/glslang/glslang/MachineIndependent/Intermediate.cpp @@ -2,6 +2,7 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2015 LunarG, Inc. // Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -46,6 +47,7 @@ #include #include +#include namespace glslang { @@ -118,16 +120,12 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn return nullptr; // Try converting the children's base types to compatible types. - TIntermTyped* child = addConversion(op, left->getType(), right); - if (child) - right = child; - else { - child = addConversion(op, right->getType(), left); - if (child) - left = child; - else - return nullptr; - } + auto children = addConversion(op, left, right); + left = std::get<0>(children); + right = std::get<1>(children); + + if (left == nullptr || right == nullptr) + return nullptr; // Convert the children's type shape to be compatible. addBiShapeConversion(op, left, right); @@ -161,6 +159,11 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn if (specConstantPropagates(*node->getLeft(), *node->getRight()) && isSpecializationOperation(*node)) node->getWritableType().getQualifier().makeSpecConstant(); + // If must propagate nonuniform, make a nonuniform. + if ((node->getLeft()->getQualifier().nonUniform || node->getRight()->getQualifier().nonUniform) && + isNonuniformPropagating(node->getOp())) + node->getWritableType().getQualifier().nonUniform = true; + return node; } @@ -304,20 +307,18 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo // TBasicType newType = EbtVoid; switch (op) { + case EOpConstructInt8: newType = EbtInt8; break; + case EOpConstructUint8: newType = EbtUint8; break; + case EOpConstructInt16: newType = EbtInt16; break; + case EOpConstructUint16: newType = EbtUint16; break; case EOpConstructInt: newType = EbtInt; break; case EOpConstructUint: newType = EbtUint; break; case EOpConstructInt64: newType = EbtInt64; break; case EOpConstructUint64: newType = EbtUint64; break; -#ifdef AMD_EXTENSIONS - case EOpConstructInt16: newType = EbtInt16; break; - case EOpConstructUint16: newType = EbtUint16; break; -#endif case EOpConstructBool: newType = EbtBool; break; case EOpConstructFloat: newType = EbtFloat; break; case EOpConstructDouble: newType = EbtDouble; break; -#ifdef AMD_EXTENSIONS case EOpConstructFloat16: newType = EbtFloat16; break; -#endif default: break; // some compilers want this } @@ -336,20 +337,18 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo // TODO: but, did this bypass constant folding? // switch (op) { + case EOpConstructInt8: + case EOpConstructUint8: + case EOpConstructInt16: + case EOpConstructUint16: case EOpConstructInt: case EOpConstructUint: case EOpConstructInt64: case EOpConstructUint64: -#ifdef AMD_EXTENSIONS - case EOpConstructInt16: - case EOpConstructUint16: -#endif case EOpConstructBool: case EOpConstructFloat: case EOpConstructDouble: -#ifdef AMD_EXTENSIONS case EOpConstructFloat16: -#endif return child; default: break; // some compilers want this } @@ -373,10 +372,15 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo if (node->getOperand()->getType().getQualifier().isSpecConstant() && isSpecializationOperation(*node)) node->getWritableType().getQualifier().makeSpecConstant(); + // If must propagate nonuniform, make a nonuniform. + if (node->getOperand()->getQualifier().nonUniform && isNonuniformPropagating(node->getOp())) + node->getWritableType().getQualifier().nonUniform = true; + return node; } -TIntermTyped* TIntermediate::addBuiltInFunctionCall(const TSourceLoc& loc, TOperator op, bool unary, TIntermNode* childNode, const TType& returnType) +TIntermTyped* TIntermediate::addBuiltInFunctionCall(const TSourceLoc& loc, TOperator op, bool unary, + TIntermNode* childNode, const TType& returnType) { if (unary) { // @@ -420,7 +424,7 @@ TIntermTyped* TIntermediate::setAggregateOperator(TIntermNode* node, TOperator o // // Make sure we have an aggregate. If not turn it into one. // - if (node) { + if (node != nullptr) { aggNode = node->getAsAggregate(); if (aggNode == nullptr || aggNode->getOp() != EOpNull) { // @@ -446,27 +450,14 @@ TIntermTyped* TIntermediate::setAggregateOperator(TIntermNode* node, TOperator o return fold(aggNode); } -// -// Convert the node's type to the given type, as allowed by the operation involved: 'op'. -// For implicit conversions, 'op' is not the requested conversion, it is the explicit -// operation requiring the implicit conversion. -// -// Returns a node representing the conversion, which could be the same -// node passed in if no conversion was needed. -// -// Generally, this is focused on basic type conversion, not shape conversion. -// See addShapeConversion(). -// -// Return nullptr if a conversion can't be done. -// -TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TIntermTyped* node) const +bool TIntermediate::isConversionAllowed(TOperator op, TIntermTyped* node) const { // // Does the base type even allow the operation? // switch (node->getBasicType()) { case EbtVoid: - return nullptr; + return false; case EbtAtomicUint: case EbtSampler: // opaque types can be passed to functions @@ -484,188 +475,19 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt break; // otherwise, opaque types can't even be operated on, let alone converted - return nullptr; + return false; default: break; } - // Otherwise, if types are identical, no problem - if (type == node->getType()) - return node; - - // If one's a structure, then no conversions. - if (type.isStruct() || node->isStruct()) - return nullptr; - - // If one's an array, then no conversions. - if (type.isArray() || node->getType().isArray()) - return nullptr; - - // Note: callers are responsible for other aspects of shape, - // like vector and matrix sizes. - - TBasicType promoteTo; - - switch (op) { - // - // Explicit conversions (unary operations) - // - case EOpConstructBool: - promoteTo = EbtBool; - break; - case EOpConstructFloat: - promoteTo = EbtFloat; - break; - case EOpConstructDouble: - promoteTo = EbtDouble; - break; -#ifdef AMD_EXTENSIONS - case EOpConstructFloat16: - promoteTo = EbtFloat16; - break; -#endif - case EOpConstructInt: - promoteTo = EbtInt; - break; - case EOpConstructUint: - promoteTo = EbtUint; - break; - case EOpConstructInt64: - promoteTo = EbtInt64; - break; - case EOpConstructUint64: - promoteTo = EbtUint64; - break; -#ifdef AMD_EXTENSIONS - case EOpConstructInt16: - promoteTo = EbtInt16; - break; - case EOpConstructUint16: - promoteTo = EbtUint16; - break; -#endif - - // - // List all the binary ops that can implicitly convert one operand to the other's type; - // This implements the 'policy' for implicit type conversion. - // - case EOpLessThan: - case EOpGreaterThan: - case EOpLessThanEqual: - case EOpGreaterThanEqual: - case EOpEqual: - case EOpNotEqual: - - case EOpAdd: - case EOpSub: - case EOpMul: - case EOpDiv: - case EOpMod: - - case EOpVectorTimesScalar: - case EOpVectorTimesMatrix: - case EOpMatrixTimesVector: - case EOpMatrixTimesScalar: - - case EOpAnd: - case EOpInclusiveOr: - case EOpExclusiveOr: - case EOpAndAssign: - case EOpInclusiveOrAssign: - case EOpExclusiveOrAssign: - case EOpLogicalNot: - case EOpLogicalAnd: - case EOpLogicalOr: - case EOpLogicalXor: - - case EOpFunctionCall: - case EOpReturn: - case EOpAssign: - case EOpAddAssign: - case EOpSubAssign: - case EOpMulAssign: - case EOpVectorTimesScalarAssign: - case EOpMatrixTimesScalarAssign: - case EOpDivAssign: - case EOpModAssign: - - case EOpAtan: - case EOpClamp: - case EOpCross: - case EOpDistance: - case EOpDot: - case EOpDst: - case EOpFaceForward: - case EOpFma: - case EOpFrexp: - case EOpLdexp: - case EOpMix: - case EOpLit: - case EOpMax: - case EOpMin: - case EOpModf: - case EOpPow: - case EOpReflect: - case EOpRefract: - case EOpSmoothStep: - case EOpStep: - - case EOpSequence: - case EOpConstructStruct: - - if (type.getBasicType() == node->getType().getBasicType()) - return node; - - if (canImplicitlyPromote(node->getType().getBasicType(), type.getBasicType(), op)) - promoteTo = type.getBasicType(); - else - return nullptr; - - break; - - // Shifts can have mixed types as long as they are integer, without converting. - // It's the left operand's type that determines the resulting type, so no issue - // with assign shift ops either. - case EOpLeftShift: - case EOpRightShift: - case EOpLeftShiftAssign: - case EOpRightShiftAssign: - if ((type.getBasicType() == EbtInt || - type.getBasicType() == EbtUint || -#ifdef AMD_EXTENSIONS - type.getBasicType() == EbtInt16 || - type.getBasicType() == EbtUint16 || -#endif - type.getBasicType() == EbtInt64 || - type.getBasicType() == EbtUint64) && - (node->getType().getBasicType() == EbtInt || - node->getType().getBasicType() == EbtUint || -#ifdef AMD_EXTENSIONS - node->getType().getBasicType() == EbtInt16 || - node->getType().getBasicType() == EbtUint16 || -#endif - node->getType().getBasicType() == EbtInt64 || - node->getType().getBasicType() == EbtUint64)) - - return node; - else if (source == EShSourceHlsl && node->getType().getBasicType() == EbtBool) { - promoteTo = type.getBasicType(); - break; - } else - return nullptr; - - default: - // default is to require a match; all exceptions should have case statements above - - if (type.getBasicType() == node->getType().getBasicType()) - return node; - else - return nullptr; - } - - if (node->getAsConstantUnion()) - return promoteConstantUnion(promoteTo, node->getAsConstantUnion()); + return true; +} +// This is 'mechanism' here, it does any conversion told. +// It is about basic type, not about shape. +// The policy comes from the shader or the calling code. +TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped* node) const +{ // // Add a new newNode for the conversion. // @@ -673,50 +495,47 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt TOperator newOp = EOpNull; - // This is 'mechanism' here, it does any conversion told. The policy comes - // from the shader or the above code. - switch (promoteTo) { + switch (convertTo) { case EbtDouble: switch (node->getBasicType()) { - case EbtInt: newOp = EOpConvIntToDouble; break; - case EbtUint: newOp = EOpConvUintToDouble; break; - case EbtBool: newOp = EOpConvBoolToDouble; break; - case EbtFloat: newOp = EOpConvFloatToDouble; break; -#ifdef AMD_EXTENSIONS + case EbtInt8: newOp = EOpConvInt8ToDouble; break; + case EbtUint8: newOp = EOpConvUint8ToDouble; break; + case EbtInt16: newOp = EOpConvInt16ToDouble; break; + case EbtUint16: newOp = EOpConvUint16ToDouble; break; + case EbtInt: newOp = EOpConvIntToDouble; break; + case EbtUint: newOp = EOpConvUintToDouble; break; + case EbtBool: newOp = EOpConvBoolToDouble; break; + case EbtFloat: newOp = EOpConvFloatToDouble; break; case EbtFloat16: newOp = EOpConvFloat16ToDouble; break; -#endif - case EbtInt64: newOp = EOpConvInt64ToDouble; break; - case EbtUint64: newOp = EOpConvUint64ToDouble; break; -#ifdef AMD_EXTENSIONS - case EbtInt16: newOp = EOpConvInt16ToDouble; break; - case EbtUint16: newOp = EOpConvUint16ToDouble; break; -#endif + case EbtInt64: newOp = EOpConvInt64ToDouble; break; + case EbtUint64: newOp = EOpConvUint64ToDouble; break; default: return nullptr; } break; case EbtFloat: switch (node->getBasicType()) { - case EbtInt: newOp = EOpConvIntToFloat; break; - case EbtUint: newOp = EOpConvUintToFloat; break; - case EbtBool: newOp = EOpConvBoolToFloat; break; - case EbtDouble: newOp = EOpConvDoubleToFloat; break; -#ifdef AMD_EXTENSIONS + case EbtInt8: newOp = EOpConvInt8ToFloat; break; + case EbtUint8: newOp = EOpConvUint8ToFloat; break; + case EbtInt16: newOp = EOpConvInt16ToFloat; break; + case EbtUint16: newOp = EOpConvUint16ToFloat; break; + case EbtInt: newOp = EOpConvIntToFloat; break; + case EbtUint: newOp = EOpConvUintToFloat; break; + case EbtBool: newOp = EOpConvBoolToFloat; break; + case EbtDouble: newOp = EOpConvDoubleToFloat; break; case EbtFloat16: newOp = EOpConvFloat16ToFloat; break; -#endif - case EbtInt64: newOp = EOpConvInt64ToFloat; break; - case EbtUint64: newOp = EOpConvUint64ToFloat; break; -#ifdef AMD_EXTENSIONS - case EbtInt16: newOp = EOpConvInt16ToFloat; break; - case EbtUint16: newOp = EOpConvUint16ToFloat; break; -#endif + case EbtInt64: newOp = EOpConvInt64ToFloat; break; + case EbtUint64: newOp = EOpConvUint64ToFloat; break; default: return nullptr; } break; -#ifdef AMD_EXTENSIONS case EbtFloat16: switch (node->getBasicType()) { + case EbtInt8: newOp = EOpConvInt8ToFloat16; break; + case EbtUint8: newOp = EOpConvUint8ToFloat16; break; + case EbtInt16: newOp = EOpConvInt16ToFloat16; break; + case EbtUint16: newOp = EOpConvUint16ToFloat16; break; case EbtInt: newOp = EOpConvIntToFloat16; break; case EbtUint: newOp = EOpConvUintToFloat16; break; case EbtBool: newOp = EOpConvBoolToFloat16; break; @@ -724,145 +543,170 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EbtDouble: newOp = EOpConvDoubleToFloat16; break; case EbtInt64: newOp = EOpConvInt64ToFloat16; break; case EbtUint64: newOp = EOpConvUint64ToFloat16; break; - case EbtInt16: newOp = EOpConvInt16ToFloat16; break; - case EbtUint16: newOp = EOpConvUint16ToFloat16; break; default: return nullptr; } break; -#endif case EbtBool: switch (node->getBasicType()) { - case EbtInt: newOp = EOpConvIntToBool; break; - case EbtUint: newOp = EOpConvUintToBool; break; - case EbtFloat: newOp = EOpConvFloatToBool; break; - case EbtDouble: newOp = EOpConvDoubleToBool; break; -#ifdef AMD_EXTENSIONS + case EbtInt8: newOp = EOpConvInt8ToBool; break; + case EbtUint8: newOp = EOpConvUint8ToBool; break; + case EbtInt16: newOp = EOpConvInt16ToBool; break; + case EbtUint16: newOp = EOpConvUint16ToBool; break; + case EbtInt: newOp = EOpConvIntToBool; break; + case EbtUint: newOp = EOpConvUintToBool; break; + case EbtFloat: newOp = EOpConvFloatToBool; break; + case EbtDouble: newOp = EOpConvDoubleToBool; break; case EbtFloat16: newOp = EOpConvFloat16ToBool; break; -#endif - case EbtInt64: newOp = EOpConvInt64ToBool; break; - case EbtUint64: newOp = EOpConvUint64ToBool; break; -#ifdef AMD_EXTENSIONS - case EbtInt16: newOp = EOpConvInt16ToBool; break; - case EbtUint16: newOp = EOpConvUint16ToBool; break; -#endif - default: - return nullptr; - } - break; - case EbtInt: - switch (node->getBasicType()) { - case EbtUint: newOp = EOpConvUintToInt; break; - case EbtBool: newOp = EOpConvBoolToInt; break; - case EbtFloat: newOp = EOpConvFloatToInt; break; - case EbtDouble: newOp = EOpConvDoubleToInt; break; -#ifdef AMD_EXTENSIONS - case EbtFloat16: newOp = EOpConvFloat16ToInt; break; -#endif - case EbtInt64: newOp = EOpConvInt64ToInt; break; - case EbtUint64: newOp = EOpConvUint64ToInt; break; -#ifdef AMD_EXTENSIONS - case EbtInt16: newOp = EOpConvInt16ToInt; break; - case EbtUint16: newOp = EOpConvUint16ToInt; break; -#endif - default: - return nullptr; - } - break; - case EbtUint: - switch (node->getBasicType()) { - case EbtInt: newOp = EOpConvIntToUint; break; - case EbtBool: newOp = EOpConvBoolToUint; break; - case EbtFloat: newOp = EOpConvFloatToUint; break; - case EbtDouble: newOp = EOpConvDoubleToUint; break; -#ifdef AMD_EXTENSIONS - case EbtFloat16: newOp = EOpConvFloat16ToUint; break; -#endif - case EbtInt64: newOp = EOpConvInt64ToUint; break; - case EbtUint64: newOp = EOpConvUint64ToUint; break; -#ifdef AMD_EXTENSIONS - case EbtInt16: newOp = EOpConvInt16ToUint; break; - case EbtUint16: newOp = EOpConvUint16ToUint; break; -#endif + case EbtInt64: newOp = EOpConvInt64ToBool; break; + case EbtUint64: newOp = EOpConvUint64ToBool; break; default: return nullptr; } break; - case EbtInt64: + case EbtInt8: switch (node->getBasicType()) { - case EbtInt: newOp = EOpConvIntToInt64; break; - case EbtUint: newOp = EOpConvUintToInt64; break; - case EbtBool: newOp = EOpConvBoolToInt64; break; - case EbtFloat: newOp = EOpConvFloatToInt64; break; - case EbtDouble: newOp = EOpConvDoubleToInt64; break; -#ifdef AMD_EXTENSIONS - case EbtFloat16: newOp = EOpConvFloat16ToInt64; break; -#endif - case EbtUint64: newOp = EOpConvUint64ToInt64; break; -#ifdef AMD_EXTENSIONS - case EbtInt16: newOp = EOpConvInt16ToInt64; break; - case EbtUint16: newOp = EOpConvUint16ToInt64; break; -#endif + case EbtUint8: newOp = EOpConvUint8ToInt8; break; + case EbtInt16: newOp = EOpConvInt16ToInt8; break; + case EbtUint16: newOp = EOpConvUint16ToInt8; break; + case EbtInt: newOp = EOpConvIntToInt8; break; + case EbtUint: newOp = EOpConvUintToInt8; break; + case EbtInt64: newOp = EOpConvInt64ToInt8; break; + case EbtUint64: newOp = EOpConvUint64ToInt8; break; + case EbtBool: newOp = EOpConvBoolToInt8; break; + case EbtFloat: newOp = EOpConvFloatToInt8; break; + case EbtDouble: newOp = EOpConvDoubleToInt8; break; + case EbtFloat16: newOp = EOpConvFloat16ToInt8; break; default: return nullptr; } break; - case EbtUint64: + case EbtUint8: switch (node->getBasicType()) { - case EbtInt: newOp = EOpConvIntToUint64; break; - case EbtUint: newOp = EOpConvUintToUint64; break; - case EbtBool: newOp = EOpConvBoolToUint64; break; - case EbtFloat: newOp = EOpConvFloatToUint64; break; - case EbtDouble: newOp = EOpConvDoubleToUint64; break; -#ifdef AMD_EXTENSIONS - case EbtFloat16: newOp = EOpConvFloat16ToUint64; break; -#endif - case EbtInt64: newOp = EOpConvInt64ToUint64; break; -#ifdef AMD_EXTENSIONS - case EbtInt16: newOp = EOpConvInt16ToUint64; break; - case EbtUint16: newOp = EOpConvUint16ToUint64; break; -#endif + case EbtInt8: newOp = EOpConvInt8ToUint8; break; + case EbtInt16: newOp = EOpConvInt16ToUint8; break; + case EbtUint16: newOp = EOpConvUint16ToUint8; break; + case EbtInt: newOp = EOpConvIntToUint8; break; + case EbtUint: newOp = EOpConvUintToUint8; break; + case EbtInt64: newOp = EOpConvInt64ToUint8; break; + case EbtUint64: newOp = EOpConvUint64ToUint8; break; + case EbtBool: newOp = EOpConvBoolToUint8; break; + case EbtFloat: newOp = EOpConvFloatToUint8; break; + case EbtDouble: newOp = EOpConvDoubleToUint8; break; + case EbtFloat16: newOp = EOpConvFloat16ToUint8; break; default: return nullptr; } break; -#ifdef AMD_EXTENSIONS + case EbtInt16: switch (node->getBasicType()) { + case EbtUint8: newOp = EOpConvUint8ToInt16; break; + case EbtInt8: newOp = EOpConvInt8ToInt16; break; + case EbtUint16: newOp = EOpConvUint16ToInt16; break; case EbtInt: newOp = EOpConvIntToInt16; break; case EbtUint: newOp = EOpConvUintToInt16; break; + case EbtInt64: newOp = EOpConvInt64ToInt16; break; + case EbtUint64: newOp = EOpConvUint64ToInt16; break; case EbtBool: newOp = EOpConvBoolToInt16; break; case EbtFloat: newOp = EOpConvFloatToInt16; break; case EbtDouble: newOp = EOpConvDoubleToInt16; break; case EbtFloat16: newOp = EOpConvFloat16ToInt16; break; - case EbtInt64: newOp = EOpConvInt64ToInt16; break; - case EbtUint64: newOp = EOpConvUint64ToInt16; break; - case EbtUint16: newOp = EOpConvUint16ToInt16; break; default: return nullptr; } break; case EbtUint16: switch (node->getBasicType()) { + case EbtInt8: newOp = EOpConvInt8ToUint16; break; + case EbtUint8: newOp = EOpConvUint8ToUint16; break; + case EbtInt16: newOp = EOpConvInt16ToUint16; break; case EbtInt: newOp = EOpConvIntToUint16; break; case EbtUint: newOp = EOpConvUintToUint16; break; + case EbtInt64: newOp = EOpConvInt64ToUint16; break; + case EbtUint64: newOp = EOpConvUint64ToUint16; break; case EbtBool: newOp = EOpConvBoolToUint16; break; case EbtFloat: newOp = EOpConvFloatToUint16; break; case EbtDouble: newOp = EOpConvDoubleToUint16; break; case EbtFloat16: newOp = EOpConvFloat16ToUint16; break; - case EbtInt64: newOp = EOpConvInt64ToUint16; break; - case EbtUint64: newOp = EOpConvUint64ToUint16; break; - case EbtInt16: newOp = EOpConvInt16ToUint16; break; default: return nullptr; } break; -#endif + + case EbtInt: + switch (node->getBasicType()) { + case EbtInt8: newOp = EOpConvInt8ToInt; break; + case EbtUint8: newOp = EOpConvUint8ToInt; break; + case EbtInt16: newOp = EOpConvInt16ToInt; break; + case EbtUint16: newOp = EOpConvUint16ToInt; break; + case EbtUint: newOp = EOpConvUintToInt; break; + case EbtBool: newOp = EOpConvBoolToInt; break; + case EbtFloat: newOp = EOpConvFloatToInt; break; + case EbtDouble: newOp = EOpConvDoubleToInt; break; + case EbtFloat16: newOp = EOpConvFloat16ToInt; break; + case EbtInt64: newOp = EOpConvInt64ToInt; break; + case EbtUint64: newOp = EOpConvUint64ToInt; break; + default: + return nullptr; + } + break; + case EbtUint: + switch (node->getBasicType()) { + case EbtInt8: newOp = EOpConvInt8ToUint; break; + case EbtUint8: newOp = EOpConvUint8ToUint; break; + case EbtInt16: newOp = EOpConvInt16ToUint; break; + case EbtUint16: newOp = EOpConvUint16ToUint; break; + case EbtInt: newOp = EOpConvIntToUint; break; + case EbtBool: newOp = EOpConvBoolToUint; break; + case EbtFloat: newOp = EOpConvFloatToUint; break; + case EbtDouble: newOp = EOpConvDoubleToUint; break; + case EbtFloat16: newOp = EOpConvFloat16ToUint; break; + case EbtInt64: newOp = EOpConvInt64ToUint; break; + case EbtUint64: newOp = EOpConvUint64ToUint; break; + default: + return nullptr; + } + break; + case EbtInt64: + switch (node->getBasicType()) { + case EbtInt8: newOp = EOpConvInt8ToInt64; break; + case EbtUint8: newOp = EOpConvUint8ToInt64; break; + case EbtInt16: newOp = EOpConvInt16ToInt64; break; + case EbtUint16: newOp = EOpConvUint16ToInt64; break; + case EbtInt: newOp = EOpConvIntToInt64; break; + case EbtUint: newOp = EOpConvUintToInt64; break; + case EbtBool: newOp = EOpConvBoolToInt64; break; + case EbtFloat: newOp = EOpConvFloatToInt64; break; + case EbtDouble: newOp = EOpConvDoubleToInt64; break; + case EbtFloat16: newOp = EOpConvFloat16ToInt64; break; + case EbtUint64: newOp = EOpConvUint64ToInt64; break; + default: + return nullptr; + } + break; + case EbtUint64: + switch (node->getBasicType()) { + case EbtInt8: newOp = EOpConvInt8ToUint64; break; + case EbtUint8: newOp = EOpConvUint8ToUint64; break; + case EbtInt16: newOp = EOpConvInt16ToUint64; break; + case EbtUint16: newOp = EOpConvUint16ToUint64; break; + case EbtInt: newOp = EOpConvIntToUint64; break; + case EbtUint: newOp = EOpConvUintToUint64; break; + case EbtBool: newOp = EOpConvBoolToUint64; break; + case EbtFloat: newOp = EOpConvFloatToUint64; break; + case EbtDouble: newOp = EOpConvDoubleToUint64; break; + case EbtFloat16: newOp = EOpConvFloat16ToUint64; break; + case EbtInt64: newOp = EOpConvInt64ToUint64; break; + default: + return nullptr; + } + break; default: return nullptr; } - TType newType(promoteTo, EvqTemporary, node->getVectorSize(), node->getMatrixCols(), node->getMatrixRows()); + TType newType(convertTo, EvqTemporary, node->getVectorSize(), node->getMatrixCols(), node->getMatrixRows()); newNode = addUnaryNode(newOp, node, node->getLoc(), newType); // TODO: it seems that some unary folding operations should occur here, but are not @@ -874,6 +718,298 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt return newNode; } +// For converting a pair of operands to a binary operation to compatible +// types with each other, relative to the operation in 'op'. +// This does not cover assignment operations, which is asymmetric in that the +// left type is not changeable. +// See addConversion(op, type, node) for assignments and unary operation +// conversions. +// +// Generally, this is focused on basic type conversion, not shape conversion. +// See addShapeConversion() for shape conversions. +// +// Returns the converted pair of nodes. +// Returns when there is no conversion. +std::tuple +TIntermediate::addConversion(TOperator op, TIntermTyped* node0, TIntermTyped* node1) const +{ + if (!isConversionAllowed(op, node0) || !isConversionAllowed(op, node1)) + return std::make_tuple(nullptr, nullptr); + + if (node0->getType() != node1->getType()) { + // If differing structure, then no conversions. + if (node0->isStruct() || node1->isStruct()) + return std::make_tuple(nullptr, nullptr); + + // If differing arrays, then no conversions. + if (node0->getType().isArray() || node1->getType().isArray()) + return std::make_tuple(nullptr, nullptr); + } + + auto promoteTo = std::make_tuple(EbtNumTypes, EbtNumTypes); + + switch (op) { + // + // List all the binary ops that can implicitly convert one operand to the other's type; + // This implements the 'policy' for implicit type conversion. + // + case EOpLessThan: + case EOpGreaterThan: + case EOpLessThanEqual: + case EOpGreaterThanEqual: + case EOpEqual: + case EOpNotEqual: + + case EOpAdd: + case EOpSub: + case EOpMul: + case EOpDiv: + case EOpMod: + + case EOpVectorTimesScalar: + case EOpVectorTimesMatrix: + case EOpMatrixTimesVector: + case EOpMatrixTimesScalar: + + case EOpAnd: + case EOpInclusiveOr: + case EOpExclusiveOr: + + case EOpSequence: // used by ?: + + if (node0->getBasicType() == node1->getBasicType()) + return std::make_tuple(node0, node1); + + promoteTo = getConversionDestinatonType(node0->getBasicType(), node1->getBasicType(), op); + if (std::get<0>(promoteTo) == EbtNumTypes || std::get<1>(promoteTo) == EbtNumTypes) + return std::make_tuple(nullptr, nullptr); + + break; + + case EOpLogicalAnd: + case EOpLogicalOr: + case EOpLogicalXor: + if (source == EShSourceHlsl) + promoteTo = std::make_tuple(EbtBool, EbtBool); + else + return std::make_tuple(node0, node1); + break; + + // There are no conversions needed for GLSL; the shift amount just needs to be an + // integer type, as does the base. + // HLSL can promote bools to ints to make this work. + case EOpLeftShift: + case EOpRightShift: + if (source == EShSourceHlsl) { + TBasicType node0BasicType = node0->getBasicType(); + if (node0BasicType == EbtBool) + node0BasicType = EbtInt; + if (node1->getBasicType() == EbtBool) + promoteTo = std::make_tuple(node0BasicType, EbtInt); + else + promoteTo = std::make_tuple(node0BasicType, node1->getBasicType()); + } else { + if (isTypeInt(node0->getBasicType()) && isTypeInt(node1->getBasicType())) + return std::make_tuple(node0, node1); + else + return std::make_tuple(nullptr, nullptr); + } + break; + + default: + if (node0->getType() == node1->getType()) + return std::make_tuple(node0, node1); + + return std::make_tuple(nullptr, nullptr); + } + + TIntermTyped* newNode0; + TIntermTyped* newNode1; + + if (std::get<0>(promoteTo) != node0->getType().getBasicType()) { + if (node0->getAsConstantUnion()) + newNode0 = promoteConstantUnion(std::get<0>(promoteTo), node0->getAsConstantUnion()); + else + newNode0 = createConversion(std::get<0>(promoteTo), node0); + } else + newNode0 = node0; + + if (std::get<1>(promoteTo) != node1->getType().getBasicType()) { + if (node1->getAsConstantUnion()) + newNode1 = promoteConstantUnion(std::get<1>(promoteTo), node1->getAsConstantUnion()); + else + newNode1 = createConversion(std::get<1>(promoteTo), node1); + } else + newNode1 = node1; + + return std::make_tuple(newNode0, newNode1); +} + +// +// Convert the node's type to the given type, as allowed by the operation involved: 'op'. +// For implicit conversions, 'op' is not the requested conversion, it is the explicit +// operation requiring the implicit conversion. +// +// Binary operation conversions should be handled by addConversion(op, node, node), not here. +// +// Returns a node representing the conversion, which could be the same +// node passed in if no conversion was needed. +// +// Generally, this is focused on basic type conversion, not shape conversion. +// See addShapeConversion() for shape conversions. +// +// Return nullptr if a conversion can't be done. +// +TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TIntermTyped* node) const +{ + if (!isConversionAllowed(op, node)) + return nullptr; + + // Otherwise, if types are identical, no problem + if (type == node->getType()) + return node; + + // If one's a structure, then no conversions. + if (type.isStruct() || node->isStruct()) + return nullptr; + + // If one's an array, then no conversions. + if (type.isArray() || node->getType().isArray()) + return nullptr; + + // Note: callers are responsible for other aspects of shape, + // like vector and matrix sizes. + + TBasicType promoteTo; + + switch (op) { + // + // Explicit conversions (unary operations) + // + case EOpConstructBool: + promoteTo = EbtBool; + break; + case EOpConstructFloat: + promoteTo = EbtFloat; + break; + case EOpConstructDouble: + promoteTo = EbtDouble; + break; + case EOpConstructFloat16: + promoteTo = EbtFloat16; + break; + case EOpConstructInt8: + promoteTo = EbtInt8; + break; + case EOpConstructUint8: + promoteTo = EbtUint8; + break; + case EOpConstructInt16: + promoteTo = EbtInt16; + break; + case EOpConstructUint16: + promoteTo = EbtUint16; + break; + case EOpConstructInt: + promoteTo = EbtInt; + break; + case EOpConstructUint: + promoteTo = EbtUint; + break; + case EOpConstructInt64: + promoteTo = EbtInt64; + break; + case EOpConstructUint64: + promoteTo = EbtUint64; + break; + + case EOpLogicalNot: + + case EOpFunctionCall: + + case EOpReturn: + case EOpAssign: + case EOpAddAssign: + case EOpSubAssign: + case EOpMulAssign: + case EOpVectorTimesScalarAssign: + case EOpMatrixTimesScalarAssign: + case EOpDivAssign: + case EOpModAssign: + case EOpAndAssign: + case EOpInclusiveOrAssign: + case EOpExclusiveOrAssign: + + case EOpAtan: + case EOpClamp: + case EOpCross: + case EOpDistance: + case EOpDot: + case EOpDst: + case EOpFaceForward: + case EOpFma: + case EOpFrexp: + case EOpLdexp: + case EOpMix: + case EOpLit: + case EOpMax: + case EOpMin: + case EOpModf: + case EOpPow: + case EOpReflect: + case EOpRefract: + case EOpSmoothStep: + case EOpStep: + + case EOpSequence: + case EOpConstructStruct: + + if (type.getBasicType() == node->getType().getBasicType()) + return node; + + if (canImplicitlyPromote(node->getBasicType(), type.getBasicType(), op)) + promoteTo = type.getBasicType(); + else + return nullptr; + break; + + // For GLSL, there are no conversions needed; the shift amount just needs to be an + // integer type, as do the base/result. + // HLSL can convert the shift from a bool to an int. + case EOpLeftShiftAssign: + case EOpRightShiftAssign: + { + if (source == EShSourceHlsl && node->getType().getBasicType() == EbtBool) + promoteTo = type.getBasicType(); + else { + if (isTypeInt(type.getBasicType()) && isTypeInt(node->getBasicType())) + return node; + else + return nullptr; + } + break; + } + + default: + // default is to require a match; all exceptions should have case statements above + + if (type.getBasicType() == node->getType().getBasicType()) + return node; + else + return nullptr; + } + + if (node->getAsConstantUnion()) + return promoteConstantUnion(promoteTo, node->getAsConstantUnion()); + + // + // Add a new newNode for the conversion. + // + TIntermUnary* newNode = createConversion(promoteTo, node); + + return newNode; +} + // Convert the node's shape of type for the given type, as allowed by the // operation involved: 'op'. This is for situations where there is only one // direction to consider doing the shape conversion. @@ -1019,12 +1155,11 @@ void TIntermediate::addBiShapeConversion(TOperator op, TIntermTyped*& lhsNode, T rhsNode = addShapeConversion(lhsNode->getType(), rhsNode); } -// Convert the node's shape of type for the given type. It's not necessarily -// an error if they are different and not converted, as some operations accept -// mixed types. Promotion will do final shape checking. +// Convert the node's shape of type for the given type, as allowed by the +// operation involved: 'op'. // -// If there is a chance of two nodes, with conversions possible in each direction, -// the policy for what to ask for must be in the caller; this will do what is asked. +// Generally, the AST represents allowed GLSL shapes, so this isn't needed +// for GLSL. Bad shapes are caught in conversion or promotion. // // Return 'node' if no conversion was done. Promotion handles final shape // checking. @@ -1080,6 +1215,166 @@ TIntermTyped* TIntermediate::addShapeConversion(const TType& type, TIntermTyped* return node; } +bool TIntermediate::isIntegralPromotion(TBasicType from, TBasicType to) const +{ + // integral promotions + if (to == EbtInt) { + switch(from) { + case EbtInt8: + case EbtInt16: + case EbtUint8: + case EbtUint16: + return true; + default: + break; + } + } + return false; +} + +bool TIntermediate::isFPPromotion(TBasicType from, TBasicType to) const +{ + // floating-point promotions + if (to == EbtDouble) { + switch(from) { + case EbtFloat16: + case EbtFloat: + return true; + default: + break; + } + } + return false; +} + +bool TIntermediate::isIntegralConversion(TBasicType from, TBasicType to) const +{ + switch (from) { + case EbtInt8: + switch (to) { + case EbtUint8: + case EbtInt16: + case EbtUint16: + case EbtUint: + case EbtInt64: + case EbtUint64: + return true; + default: + break; + } + break; + case EbtUint8: + switch (to) { + case EbtInt16: + case EbtUint16: + case EbtUint: + case EbtInt64: + case EbtUint64: + return true; + default: + break; + } + break; + case EbtInt16: + switch(to) { + case EbtUint16: + case EbtUint: + case EbtInt64: + case EbtUint64: + return true; + default: + break; + } + break; + case EbtUint16: + switch(to) { + case EbtUint: + case EbtInt64: + case EbtUint64: + return true; + default: + break; + } + break; + case EbtInt: + switch(to) { + case EbtUint: + return version >= 400 || (source == EShSourceHlsl); + case EbtInt64: + case EbtUint64: + return true; + default: + break; + } + break; + case EbtUint: + switch(to) { + case EbtInt64: + case EbtUint64: + return true; + default: + break; + } + break; + case EbtInt64: + if (to == EbtUint64) { + return true; + } + break; + default: + break; + } + return false; +} + +bool TIntermediate::isFPConversion(TBasicType from, TBasicType to) const +{ + if (to == EbtFloat && from == EbtFloat16) { + return true; + } else { + return false; + } +} + +bool TIntermediate::isFPIntegralConversion(TBasicType from, TBasicType to) const +{ + switch (from) { + case EbtInt8: + case EbtUint8: + case EbtInt16: + case EbtUint16: + switch (to) { + case EbtFloat16: + case EbtFloat: + case EbtDouble: + return true; + default: + break; + } + break; + case EbtInt: + case EbtUint: + switch(to) { + case EbtFloat: + case EbtDouble: + return true; + default: + break; + } + break; + case EbtInt64: + case EbtUint64: + if (to == EbtDouble) { + return true; + } + break; + + default: + break; + } + return false; +} + // // See if the 'from' type is allowed to be implicitly converted to the // 'to' type. This is not about vector/array/struct, only about basic type. @@ -1125,120 +1420,337 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat } } - switch (to) { - case EbtDouble: - switch (from) { - case EbtInt: - case EbtUint: - case EbtInt64: - case EbtUint64: -#ifdef AMD_EXTENSIONS - case EbtInt16: - case EbtUint16: -#endif - case EbtFloat: + bool explicitTypesEnabled = extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types) || + extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_int8) || + extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_int16) || + extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_int32) || + extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_int64) || + extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_float16) || + extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_float32) || + extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_float64); + + if (explicitTypesEnabled) { + // integral promotions + if (isIntegralPromotion(from, to)) { + return true; + } + + // floating-point promotions + if (isFPPromotion(from, to)) { + return true; + } + + // integral conversions + if (isIntegralConversion(from, to)) { + return true; + } + + // floating-point conversions + if (isFPConversion(from, to)) { + return true; + } + + // floating-integral conversions + if (isFPIntegralConversion(from, to)) { + return true; + } + + // hlsl supported conversions + if (source == EShSourceHlsl) { + if (from == EbtBool && (to == EbtInt || to == EbtUint || to == EbtFloat)) + return true; + } + } else { + switch (to) { case EbtDouble: + switch (from) { + case EbtInt: + case EbtUint: + case EbtInt64: + case EbtUint64: #ifdef AMD_EXTENSIONS - case EbtFloat16: + case EbtInt16: + case EbtUint16: #endif - return true; - default: - return false; - } - case EbtFloat: - switch (from) { - case EbtInt: - case EbtUint: + case EbtFloat: + case EbtDouble: #ifdef AMD_EXTENSIONS - case EbtInt16: - case EbtUint16: + case EbtFloat16: #endif + return true; + default: + return false; + } case EbtFloat: + switch (from) { + case EbtInt: + case EbtUint: #ifdef AMD_EXTENSIONS - case EbtFloat16: + case EbtInt16: + case EbtUint16: #endif - return true; - case EbtBool: - return (source == EShSourceHlsl); - default: - return false; - } - case EbtUint: - switch (from) { - case EbtInt: - return version >= 400 || (source == EShSourceHlsl); + case EbtFloat: +#ifdef AMD_EXTENSIONS + case EbtFloat16: +#endif + return true; + case EbtBool: + return (source == EShSourceHlsl); + default: + return false; + } case EbtUint: + switch (from) { + case EbtInt: + return version >= 400 || (source == EShSourceHlsl); + case EbtUint: #ifdef AMD_EXTENSIONS - case EbtInt16: - case EbtUint16: + case EbtInt16: + case EbtUint16: #endif - return true; - case EbtBool: - return (source == EShSourceHlsl); - default: - return false; - } - case EbtInt: - switch (from) { + return true; + case EbtBool: + return (source == EShSourceHlsl); + default: + return false; + } case EbtInt: + switch (from) { + case EbtInt: #ifdef AMD_EXTENSIONS - case EbtInt16: + case EbtInt16: +#endif + return true; + case EbtBool: + return (source == EShSourceHlsl); + default: + return false; + } + case EbtUint64: + switch (from) { + case EbtInt: + case EbtUint: + case EbtInt64: + case EbtUint64: +#ifdef AMD_EXTENSIONS + case EbtInt16: + case EbtUint16: +#endif + return true; + default: + return false; + } + case EbtInt64: + switch (from) { + case EbtInt: + case EbtInt64: +#ifdef AMD_EXTENSIONS + case EbtInt16: +#endif + return true; + default: + return false; + } +#ifdef AMD_EXTENSIONS + case EbtFloat16: + switch (from) { + case EbtInt16: + case EbtUint16: + case EbtFloat16: + return true; + default: + return false; + } + case EbtUint16: + switch (from) { + case EbtInt16: + case EbtUint16: + return true; + default: + return false; + } #endif - return true; - case EbtBool: - return (source == EShSourceHlsl); default: return false; } - case EbtUint64: - switch (from) { - case EbtInt: + } + + return false; +} + +static bool canSignedIntTypeRepresentAllUnsignedValues(TBasicType sintType, TBasicType uintType) { + switch(sintType) { + case EbtInt8: + switch(uintType) { + case EbtUint8: + case EbtUint16: case EbtUint: - case EbtInt64: case EbtUint64: -#ifdef AMD_EXTENSIONS - case EbtInt16: - case EbtUint16: -#endif - return true; + return false; default: + assert(false); return false; } - case EbtInt64: - switch (from) { - case EbtInt: - case EbtInt64: -#ifdef AMD_EXTENSIONS - case EbtInt16: -#endif + break; + case EbtInt16: + switch(uintType) { + case EbtUint8: return true; + case EbtUint16: + case EbtUint: + case EbtUint64: + return false; default: + assert(false); return false; } -#ifdef AMD_EXTENSIONS - case EbtFloat16: - switch (from) { - case EbtInt16: + break; + case EbtInt: + switch(uintType) { + case EbtUint8: case EbtUint16: - case EbtFloat16: return true; + case EbtUint: + return false; default: + assert(false); return false; } - case EbtUint16: - switch (from) { - case EbtInt16: + break; + case EbtInt64: + switch(uintType) { + case EbtUint8: case EbtUint16: + case EbtUint: return true; + case EbtUint64: + return false; default: + assert(false); return false; } -#endif + break; default: + assert(false); return false; } } + +static TBasicType getCorrespondingUnsignedType(TBasicType type) { + switch(type) { + case EbtInt8: + return EbtUint8; + case EbtInt16: + return EbtUint16; + case EbtInt: + return EbtUint; + case EbtInt64: + return EbtUint64; + default: + assert(false); + return EbtNumTypes; + } +} + +// Implements the following rules +// - If either operand has type float64_t or derived from float64_t, +// the other shall be converted to float64_t or derived type. +// - Otherwise, if either operand has type float32_t or derived from +// float32_t, the other shall be converted to float32_t or derived type. +// - Otherwise, if either operand has type float16_t or derived from +// float16_t, the other shall be converted to float16_t or derived type. +// - Otherwise, if both operands have integer types the following rules +// shall be applied to the operands: +// - If both operands have the same type, no further conversion +// is needed. +// - Otherwise, if both operands have signed integer types or both +// have unsigned integer types, the operand with the type of lesser +// integer conversion rank shall be converted to the type of the +// operand with greater rank. +// - Otherwise, if the operand that has unsigned integer type has rank +// greater than or equal to the rank of the type of the other +// operand, the operand with signed integer type shall be converted +// to the type of the operand with unsigned integer type. +// - Otherwise, if the type of the operand with signed integer type can +// represent all of the values of the type of the operand with +// unsigned integer type, the operand with unsigned integer type +// shall be converted to the type of the operand with signed +// integer type. +// - Otherwise, both operands shall be converted to the unsigned +// integer type corresponding to the type of the operand with signed +// integer type. + +std::tuple TIntermediate::getConversionDestinatonType(TBasicType type0, TBasicType type1, TOperator op) const +{ + TBasicType res0 = EbtNumTypes; + TBasicType res1 = EbtNumTypes; + + if (profile == EEsProfile || version == 110) + return std::make_tuple(res0, res1);; + + if (source == EShSourceHlsl) { + if (canImplicitlyPromote(type1, type0, op)) { + res0 = type0; + res1 = type0; + } else if (canImplicitlyPromote(type0, type1, op)) { + res0 = type1; + res1 = type1; + } + return std::make_tuple(res0, res1); + } + + if ((type0 == EbtDouble && canImplicitlyPromote(type1, EbtDouble, op)) || + (type1 == EbtDouble && canImplicitlyPromote(type0, EbtDouble, op)) ) { + res0 = EbtDouble; + res1 = EbtDouble; + } else if ((type0 == EbtFloat && canImplicitlyPromote(type1, EbtFloat, op)) || + (type1 == EbtFloat && canImplicitlyPromote(type0, EbtFloat, op)) ) { + res0 = EbtFloat; + res1 = EbtFloat; + } else if ((type0 == EbtFloat16 && canImplicitlyPromote(type1, EbtFloat16, op)) || + (type1 == EbtFloat16 && canImplicitlyPromote(type0, EbtFloat16, op)) ) { + res0 = EbtFloat16; + res1 = EbtFloat16; + } else if (isTypeInt(type0) && isTypeInt(type1) && + (canImplicitlyPromote(type0, type1, op) || canImplicitlyPromote(type1, type0, op))) { + if ((isTypeSignedInt(type0) && isTypeSignedInt(type1)) || + (isTypeUnsignedInt(type0) && isTypeUnsignedInt(type1))) { + if (getTypeRank(type0) < getTypeRank(type1)) { + res0 = type1; + res1 = type1; + } else { + res0 = type0; + res1 = type0; + } + } else if (isTypeUnsignedInt(type0) && (getTypeRank(type0) > getTypeRank(type1))) { + res0 = type0; + res1 = type0; + } else if (isTypeUnsignedInt(type1) && (getTypeRank(type1) > getTypeRank(type0))) { + res0 = type1; + res1 = type1; + } else if (isTypeSignedInt(type0)) { + if (canSignedIntTypeRepresentAllUnsignedValues(type0, type1)) { + res0 = type0; + res1 = type0; + } else { + res0 = getCorrespondingUnsignedType(type0); + res1 = getCorrespondingUnsignedType(type0); + } + } else if (isTypeSignedInt(type1)) { + if (canSignedIntTypeRepresentAllUnsignedValues(type1, type0)) { + res0 = type1; + res1 = type1; + } else { + res0 = getCorrespondingUnsignedType(type1); + res1 = getCorrespondingUnsignedType(type1); + } + } + } + + return std::make_tuple(res0, res1); +} + // // Given a type, find what operation would fully construct it. // @@ -1246,6 +1758,9 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const { TOperator op = EOpNull; + if (type.getQualifier().nonUniform) + return EOpConstructNonuniform; + switch (type.getBasicType()) { case EbtStruct: op = EOpConstructStruct; @@ -1331,7 +1846,6 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const } } break; -#ifdef AMD_EXTENSIONS case EbtFloat16: if (type.getMatrixCols()) { switch (type.getMatrixCols()) { @@ -1371,7 +1885,42 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const } } break; -#endif + case EbtInt8: + switch(type.getVectorSize()) { + case 1: op = EOpConstructInt8; break; + case 2: op = EOpConstructI8Vec2; break; + case 3: op = EOpConstructI8Vec3; break; + case 4: op = EOpConstructI8Vec4; break; + default: break; // some compilers want this + } + break; + case EbtUint8: + switch(type.getVectorSize()) { + case 1: op = EOpConstructUint8; break; + case 2: op = EOpConstructU8Vec2; break; + case 3: op = EOpConstructU8Vec3; break; + case 4: op = EOpConstructU8Vec4; break; + default: break; // some compilers want this + } + break; + case EbtInt16: + switch(type.getVectorSize()) { + case 1: op = EOpConstructInt16; break; + case 2: op = EOpConstructI16Vec2; break; + case 3: op = EOpConstructI16Vec3; break; + case 4: op = EOpConstructI16Vec4; break; + default: break; // some compilers want this + } + break; + case EbtUint16: + switch(type.getVectorSize()) { + case 1: op = EOpConstructUint16; break; + case 2: op = EOpConstructU16Vec2; break; + case 3: op = EOpConstructU16Vec3; break; + case 4: op = EOpConstructU16Vec4; break; + default: break; // some compilers want this + } + break; case EbtInt: if (type.getMatrixCols()) { switch (type.getMatrixCols()) { @@ -1466,26 +2015,6 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const default: break; // some compilers want this } break; -#ifdef AMD_EXTENSIONS - case EbtInt16: - switch(type.getVectorSize()) { - case 1: op = EOpConstructInt16; break; - case 2: op = EOpConstructI16Vec2; break; - case 3: op = EOpConstructI16Vec3; break; - case 4: op = EOpConstructI16Vec4; break; - default: break; // some compilers want this - } - break; - case EbtUint16: - switch(type.getVectorSize()) { - case 1: op = EOpConstructUint16; break; - case 2: op = EOpConstructU16Vec2; break; - case 3: op = EOpConstructU16Vec3; break; - case 4: op = EOpConstructU16Vec4; break; - default: break; // some compilers want this - } - break; -#endif case EbtBool: if (type.getMatrixCols()) { switch (type.getMatrixCols()) { @@ -1614,7 +2143,7 @@ TIntermAggregate* TIntermediate::makeAggregate(const TSourceLoc& loc) // // Returns the selection node created. // -TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermNodePair nodePair, const TSourceLoc& loc, TSelectionControl control) +TIntermSelection* TIntermediate::addSelection(TIntermTyped* cond, TIntermNodePair nodePair, const TSourceLoc& loc) { // // Don't prune the false path for compile-time constants; it's needed @@ -1623,7 +2152,6 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermNodePair no TIntermSelection* node = new TIntermSelection(cond, nodePair.node1, nodePair.node2); node->setLoc(loc); - node->setSelectionControl(control); return node; } @@ -1666,27 +2194,28 @@ TIntermTyped* TIntermediate::addMethod(TIntermTyped* object, const TType& type, // // Returns the selection node created, or nullptr if one could not be. // -TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, const TSourceLoc& loc, TSelectionControl control) +TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, + const TSourceLoc& loc) { // If it's void, go to the if-then-else selection() if (trueBlock->getBasicType() == EbtVoid && falseBlock->getBasicType() == EbtVoid) { TIntermNodePair pair = { trueBlock, falseBlock }; - return addSelection(cond, pair, loc, control); + TIntermSelection* selection = addSelection(cond, pair, loc); + if (getSource() == EShSourceHlsl) + selection->setNoShortCircuit(); + + return selection; } // // Get compatible types. // - TIntermTyped* child = addConversion(EOpSequence, trueBlock->getType(), falseBlock); - if (child) - falseBlock = child; - else { - child = addConversion(EOpSequence, falseBlock->getType(), trueBlock); - if (child) - trueBlock = child; - else - return nullptr; - } + auto children = addConversion(EOpSequence, trueBlock, falseBlock); + trueBlock = std::get<0>(children); + falseBlock = std::get<1>(children); + + if (trueBlock == nullptr || falseBlock == nullptr) + return nullptr; // Handle a vector condition as a mix if (!cond->getType().isScalarOrVec1()) { @@ -1742,6 +2271,9 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true else node->getQualifier().makeTemporary(); + if (getSource() == EShSourceHlsl) + node->setNoShortCircuit(); + return node; } @@ -1761,6 +2293,37 @@ TIntermConstantUnion* TIntermediate::addConstantUnion(const TConstUnionArray& un return node; } +TIntermConstantUnion* TIntermediate::addConstantUnion(signed char i8, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setI8Const(i8); + + return addConstantUnion(unionArray, TType(EbtInt8, EvqConst), loc, literal); +} + +TIntermConstantUnion* TIntermediate::addConstantUnion(unsigned char u8, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setUConst(u8); + + return addConstantUnion(unionArray, TType(EbtUint8, EvqConst), loc, literal); +} + +TIntermConstantUnion* TIntermediate::addConstantUnion(signed short i16, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setI16Const(i16); + + return addConstantUnion(unionArray, TType(EbtInt16, EvqConst), loc, literal); +} + +TIntermConstantUnion* TIntermediate::addConstantUnion(unsigned short u16, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setU16Const(u16); + + return addConstantUnion(unionArray, TType(EbtUint16, EvqConst), loc, literal); +} TIntermConstantUnion* TIntermediate::addConstantUnion(int i, const TSourceLoc& loc, bool literal) const { @@ -1794,24 +2357,6 @@ TIntermConstantUnion* TIntermediate::addConstantUnion(unsigned long long u64, co return addConstantUnion(unionArray, TType(EbtUint64, EvqConst), loc, literal); } -#ifdef AMD_EXTENSIONS -TIntermConstantUnion* TIntermediate::addConstantUnion(short i16, const TSourceLoc& loc, bool literal) const -{ - TConstUnionArray unionArray(1); - unionArray[0].setIConst(i16); - - return addConstantUnion(unionArray, TType(EbtInt16, EvqConst), loc, literal); -} - -TIntermConstantUnion* TIntermediate::addConstantUnion(unsigned short u16, const TSourceLoc& loc, bool literal) const -{ - TConstUnionArray unionArray(1); - unionArray[0].setUConst(u16); - - return addConstantUnion(unionArray, TType(EbtUint16, EvqConst), loc, literal); -} -#endif - TIntermConstantUnion* TIntermediate::addConstantUnion(bool b, const TSourceLoc& loc, bool literal) const { TConstUnionArray unionArray(1); @@ -1822,11 +2367,7 @@ TIntermConstantUnion* TIntermediate::addConstantUnion(bool b, const TSourceLoc& TIntermConstantUnion* TIntermediate::addConstantUnion(double d, TBasicType baseType, const TSourceLoc& loc, bool literal) const { -#ifdef AMD_EXTENSIONS assert(baseType == EbtFloat || baseType == EbtDouble || baseType == EbtFloat16); -#else - assert(baseType == EbtFloat || baseType == EbtDouble); -#endif TConstUnionArray unionArray(1); unionArray[0].setDConst(d); @@ -1909,11 +2450,11 @@ const TIntermTyped* TIntermediate::findLValueBase(const TIntermTyped* node, bool // // Create while and do-while loop nodes. // -TIntermLoop* TIntermediate::addLoop(TIntermNode* body, TIntermTyped* test, TIntermTyped* terminal, bool testFirst, const TSourceLoc& loc, TLoopControl control) +TIntermLoop* TIntermediate::addLoop(TIntermNode* body, TIntermTyped* test, TIntermTyped* terminal, bool testFirst, + const TSourceLoc& loc) { TIntermLoop* node = new TIntermLoop(body, test, terminal, testFirst); node->setLoc(loc); - node->setLoopControl(control); return node; } @@ -1921,11 +2462,11 @@ TIntermLoop* TIntermediate::addLoop(TIntermNode* body, TIntermTyped* test, TInte // // Create a for-loop sequence. // -TIntermAggregate* TIntermediate::addForLoop(TIntermNode* body, TIntermNode* initializer, TIntermTyped* test, TIntermTyped* terminal, bool testFirst, const TSourceLoc& loc, TLoopControl control) +TIntermAggregate* TIntermediate::addForLoop(TIntermNode* body, TIntermNode* initializer, TIntermTyped* test, + TIntermTyped* terminal, bool testFirst, const TSourceLoc& loc, TIntermLoop*& node) { - TIntermLoop* node = new TIntermLoop(body, test, terminal, testFirst); + node = new TIntermLoop(body, test, terminal, testFirst); node->setLoc(loc); - node->setLoopControl(control); // make a sequence of the initializer and statement, but try to reuse the // aggregate already created for whatever is in the initializer, if there is one @@ -2121,12 +2662,10 @@ bool TIntermediate::isSpecializationOperation(const TIntermOperator& node) const case EOpVectorSwizzle: case EOpConvFloatToDouble: case EOpConvDoubleToFloat: -#ifdef AMD_EXTENSIONS case EOpConvFloat16ToFloat: case EOpConvFloatToFloat16: case EOpConvFloat16ToDouble: case EOpConvDoubleToFloat16: -#endif return true; default: return false; @@ -2150,51 +2689,97 @@ bool TIntermediate::isSpecializationOperation(const TIntermOperator& node) const case EOpIndexDirectStruct: case EOpVectorSwizzle: - // conversion constructors + // (u)int* -> bool + case EOpConvInt8ToBool: + case EOpConvInt16ToBool: case EOpConvIntToBool: + case EOpConvInt64ToBool: + case EOpConvUint8ToBool: + case EOpConvUint16ToBool: case EOpConvUintToBool: - case EOpConvUintToInt: + case EOpConvUint64ToBool: + + // bool -> (u)int* + case EOpConvBoolToInt8: + case EOpConvBoolToInt16: case EOpConvBoolToInt: - case EOpConvIntToUint: - case EOpConvBoolToUint: - case EOpConvInt64ToBool: case EOpConvBoolToInt64: - case EOpConvUint64ToBool: + case EOpConvBoolToUint8: + case EOpConvBoolToUint16: + case EOpConvBoolToUint: case EOpConvBoolToUint64: - case EOpConvInt64ToInt: - case EOpConvIntToInt64: - case EOpConvUint64ToUint: - case EOpConvUintToUint64: - case EOpConvInt64ToUint64: - case EOpConvUint64ToInt64: - case EOpConvInt64ToUint: - case EOpConvUintToInt64: - case EOpConvUint64ToInt: - case EOpConvIntToUint64: -#ifdef AMD_EXTENSIONS - case EOpConvInt16ToBool: - case EOpConvBoolToInt16: + + // int8_t -> (u)int* + case EOpConvInt8ToInt16: + case EOpConvInt8ToInt: + case EOpConvInt8ToInt64: + case EOpConvInt8ToUint8: + case EOpConvInt8ToUint16: + case EOpConvInt8ToUint: + case EOpConvInt8ToUint64: + + // int16_t -> (u)int* + case EOpConvInt16ToInt8: case EOpConvInt16ToInt: - case EOpConvIntToInt16: - case EOpConvInt16ToUint: - case EOpConvUintToInt16: case EOpConvInt16ToInt64: - case EOpConvInt64ToInt16: + case EOpConvInt16ToUint8: + case EOpConvInt16ToUint16: + case EOpConvInt16ToUint: case EOpConvInt16ToUint64: - case EOpConvUint64ToInt16: - case EOpConvUint16ToBool: - case EOpConvBoolToUint16: - case EOpConvUint16ToInt: + + // int32_t -> (u)int* + case EOpConvIntToInt8: + case EOpConvIntToInt16: + case EOpConvIntToInt64: + case EOpConvIntToUint8: case EOpConvIntToUint16: - case EOpConvUint16ToUint: - case EOpConvUintToUint16: - case EOpConvUint16ToInt64: + case EOpConvIntToUint: + case EOpConvIntToUint64: + + // int64_t -> (u)int* + case EOpConvInt64ToInt8: + case EOpConvInt64ToInt16: + case EOpConvInt64ToInt: + case EOpConvInt64ToUint8: case EOpConvInt64ToUint16: + case EOpConvInt64ToUint: + case EOpConvInt64ToUint64: + + // uint8_t -> (u)int* + case EOpConvUint8ToInt8: + case EOpConvUint8ToInt16: + case EOpConvUint8ToInt: + case EOpConvUint8ToInt64: + case EOpConvUint8ToUint16: + case EOpConvUint8ToUint: + case EOpConvUint8ToUint64: + + // uint16_t -> (u)int* + case EOpConvUint16ToInt8: + case EOpConvUint16ToInt16: + case EOpConvUint16ToInt: + case EOpConvUint16ToInt64: + case EOpConvUint16ToUint8: + case EOpConvUint16ToUint: case EOpConvUint16ToUint64: + + // uint32_t -> (u)int* + case EOpConvUintToInt8: + case EOpConvUintToInt16: + case EOpConvUintToInt: + case EOpConvUintToInt64: + case EOpConvUintToUint8: + case EOpConvUintToUint16: + case EOpConvUintToUint64: + + // uint64_t -> (u)int* + case EOpConvUint64ToInt8: + case EOpConvUint64ToInt16: + case EOpConvUint64ToInt: + case EOpConvUint64ToInt64: + case EOpConvUint64ToUint8: case EOpConvUint64ToUint16: - case EOpConvInt16ToUint16: - case EOpConvUint16ToInt16: -#endif + case EOpConvUint64ToUint: // unary operations case EOpNegative: @@ -2228,6 +2813,64 @@ bool TIntermediate::isSpecializationOperation(const TIntermOperator& node) const } } +// Is the operation one that must propagate nonuniform? +bool TIntermediate::isNonuniformPropagating(TOperator op) const +{ + // "* All Operators in Section 5.1 (Operators), except for assignment, + // arithmetic assignment, and sequence + // * Component selection in Section 5.5 + // * Matrix components in Section 5.6 + // * Structure and Array Operations in Section 5.7, except for the length + // method." + switch (op) { + case EOpPostIncrement: + case EOpPostDecrement: + case EOpPreIncrement: + case EOpPreDecrement: + + case EOpNegative: + case EOpLogicalNot: + case EOpVectorLogicalNot: + case EOpBitwiseNot: + + case EOpAdd: + case EOpSub: + case EOpMul: + case EOpDiv: + case EOpMod: + case EOpRightShift: + case EOpLeftShift: + case EOpAnd: + case EOpInclusiveOr: + case EOpExclusiveOr: + case EOpEqual: + case EOpNotEqual: + case EOpLessThan: + case EOpGreaterThan: + case EOpLessThanEqual: + case EOpGreaterThanEqual: + case EOpVectorTimesScalar: + case EOpVectorTimesMatrix: + case EOpMatrixTimesVector: + case EOpMatrixTimesScalar: + + case EOpLogicalOr: + case EOpLogicalXor: + case EOpLogicalAnd: + + case EOpIndexDirect: + case EOpIndexIndirect: + case EOpIndexDirectStruct: + case EOpVectorSwizzle: + return true; + + default: + break; + } + + return false; +} + //////////////////////////////////////////////////////////////// // // Member functions of the nodes used for building the tree. @@ -2312,7 +2955,7 @@ bool TIntermediate::promoteUnary(TIntermUnary& node) // Convert operand to a boolean type if (operand->getBasicType() != EbtBool) { // Add constructor to boolean type. If that fails, we can't do it, so return false. - TIntermTyped* converted = convertToBasicType(op, EbtBool, operand); + TIntermTyped* converted = addConversion(op, TType(EbtBool), operand); if (converted == nullptr) return false; @@ -2321,15 +2964,7 @@ bool TIntermediate::promoteUnary(TIntermUnary& node) } break; case EOpBitwiseNot: - if (operand->getBasicType() != EbtInt && - operand->getBasicType() != EbtUint && -#ifdef AMD_EXTENSIONS - operand->getBasicType() != EbtInt16 && - operand->getBasicType() != EbtUint16 && -#endif - operand->getBasicType() != EbtInt64 && - operand->getBasicType() != EbtUint64) - + if (!isTypeInt(operand->getBasicType())) return false; break; case EOpNegative: @@ -2337,18 +2972,9 @@ bool TIntermediate::promoteUnary(TIntermUnary& node) case EOpPostDecrement: case EOpPreIncrement: case EOpPreDecrement: - if (operand->getBasicType() != EbtInt && - operand->getBasicType() != EbtUint && - operand->getBasicType() != EbtInt64 && - operand->getBasicType() != EbtUint64 && -#ifdef AMD_EXTENSIONS - operand->getBasicType() != EbtInt16 && - operand->getBasicType() != EbtUint16 && -#endif + if (!isTypeInt(operand->getBasicType()) && operand->getBasicType() != EbtFloat && -#ifdef AMD_EXTENSIONS operand->getBasicType() != EbtFloat16 && -#endif operand->getBasicType() != EbtDouble) return false; @@ -2368,34 +2994,12 @@ bool TIntermediate::promoteUnary(TIntermUnary& node) void TIntermUnary::updatePrecision() { -#ifdef AMD_EXTENSIONS if (getBasicType() == EbtInt || getBasicType() == EbtUint || getBasicType() == EbtFloat || getBasicType() == EbtFloat16) { -#else - if (getBasicType() == EbtInt || getBasicType() == EbtUint || getBasicType() == EbtFloat) { -#endif if (operand->getQualifier().precision > getQualifier().precision) getQualifier().precision = operand->getQualifier().precision; } } -// If it is not already, convert this node to the given basic type. -TIntermTyped* TIntermediate::convertToBasicType(TOperator op, TBasicType basicType, TIntermTyped* node) const -{ - if (node == nullptr) - return nullptr; - - // It's already this basic type: nothing needs to be done, so use the node directly. - if (node->getBasicType() == basicType) - return node; - - const TType& type = node->getType(); - const TType newType(basicType, type.getQualifier().storage, - type.getVectorSize(), type.getMatrixCols(), type.getMatrixRows(), type.isVector()); - - // Add constructor to the right vectorness of the right type. If that fails, we can't do it, so return nullptr. - return addConversion(op, newType, node); -} - // // See TIntermediate::promote // @@ -2468,12 +3072,19 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) case EOpSub: case EOpDiv: case EOpMul: - left = addConversion(op, TType(EbtInt, EvqTemporary, left->getVectorSize()), left); - right = addConversion(op, TType(EbtInt, EvqTemporary, right->getVectorSize()), right); + if (left->getBasicType() == EbtBool) + left = createConversion(EbtInt, left); + if (right->getBasicType() == EbtBool) + right = createConversion(EbtInt, right); if (left == nullptr || right == nullptr) return false; node.setLeft(left); node.setRight(right); + + // Update the original base assumption on result type.. + node.setType(left->getType()); + node.getWritableType().getQualifier().clear(); + break; default: @@ -2515,21 +3126,17 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) case EOpLogicalAnd: case EOpLogicalOr: case EOpLogicalXor: - if (getSource() == EShSourceHlsl) { - TIntermTyped* convertedL = convertToBasicType(op, EbtBool, left); - TIntermTyped* convertedR = convertToBasicType(op, EbtBool, right); - if (convertedL == nullptr || convertedR == nullptr) + // logical ops operate only on Booleans or vectors of Booleans. + if (left->getBasicType() != EbtBool || left->isMatrix()) return false; - node.setLeft(left = convertedL); // also updates stack variable - node.setRight(right = convertedR); // also updates stack variable - } else { + + if (getSource() == EShSourceGlsl) { // logical ops operate only on scalar Booleans and will promote to scalar Boolean. - if (left->getBasicType() != EbtBool || left->isVector() || left->isMatrix()) + if (left->isVector()) return false; } node.setType(TType(EbtBool, EvqTemporary, left->getVectorSize())); - break; case EOpRightShift: @@ -2550,16 +3157,7 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) break; // Check for integer-only operands. - if ((left->getBasicType() != EbtInt && left->getBasicType() != EbtUint && -#ifdef AMD_EXTENSIONS - left->getBasicType() != EbtInt16 && left->getBasicType() != EbtUint16 && -#endif - left->getBasicType() != EbtInt64 && left->getBasicType() != EbtUint64) || - (right->getBasicType() != EbtInt && right->getBasicType() != EbtUint && -#ifdef AMD_EXTENSIONS - right->getBasicType() != EbtInt16 && right->getBasicType() != EbtUint16 && -#endif - right->getBasicType() != EbtInt64 && right->getBasicType() != EbtUint64)) + if (!isTypeInt(left->getBasicType()) && !isTypeInt(right->getBasicType())) return false; if (left->isMatrix() || right->isMatrix()) return false; @@ -2700,7 +3298,7 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) node.setOp(op = EOpMatrixTimesScalarAssign); } } else if (left->isMatrix() && right->isMatrix()) { - if (left->getMatrixCols() != left->getMatrixRows() || left->getMatrixCols() != right->getMatrixCols() || left->getMatrixCols() != right->getMatrixRows()) + if (left->getMatrixCols() != right->getMatrixCols() || left->getMatrixCols() != right->getMatrixRows()) return false; node.setOp(op = EOpMatrixTimesMatrixAssign); } else if (!left->isMatrix() && !right->isMatrix()) { @@ -2860,11 +3458,7 @@ bool TIntermediate::promoteAggregate(TIntermAggregate& node) void TIntermBinary::updatePrecision() { -#ifdef AMD_EXTENSIONS if (getBasicType() == EbtInt || getBasicType() == EbtUint || getBasicType() == EbtFloat || getBasicType() == EbtFloat16) { -#else - if (getBasicType() == EbtInt || getBasicType() == EbtUint || getBasicType() == EbtFloat) { -#endif getQualifier().precision = std::max(right->getQualifier().precision, left->getQualifier().precision); if (getQualifier().precision != EpqNone) { left->propagatePrecision(getQualifier().precision); @@ -2875,11 +3469,7 @@ void TIntermBinary::updatePrecision() void TIntermTyped::propagatePrecision(TPrecisionQualifier newPrecision) { -#ifdef AMD_EXTENSIONS if (getQualifier().precision != EpqNone || (getBasicType() != EbtInt && getBasicType() != EbtUint && getBasicType() != EbtFloat && getBasicType() != EbtFloat16)) -#else - if (getQualifier().precision != EpqNone || (getBasicType() != EbtInt && getBasicType() != EbtUint && getBasicType() != EbtFloat)) -#endif return; getQualifier().precision = newPrecision; @@ -2954,9 +3544,7 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC break; case EbtFloat: case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif leftUnionArray[i] = rightUnionArray[i]; break; default: @@ -2982,16 +3570,13 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC break; case EbtFloat: case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif leftUnionArray[i] = rightUnionArray[i]; break; default: return node; } break; -#ifdef AMD_EXTENSIONS case EbtFloat16: switch (node->getType().getBasicType()) { case EbtInt: @@ -3018,7 +3603,6 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC return node; } break; -#endif case EbtInt: switch (node->getType().getBasicType()) { case EbtInt: @@ -3038,9 +3622,7 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC break; case EbtFloat: case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif leftUnionArray[i].setIConst(static_cast(rightUnionArray[i].getDConst())); break; default: @@ -3066,9 +3648,7 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC break; case EbtFloat: case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif leftUnionArray[i].setUConst(static_cast(rightUnionArray[i].getDConst())); break; default: @@ -3094,9 +3674,7 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC break; case EbtFloat: case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif leftUnionArray[i].setBConst(rightUnionArray[i].getDConst() != 0.0); break; default: @@ -3122,9 +3700,7 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC break; case EbtFloat: case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif leftUnionArray[i].setI64Const(static_cast(rightUnionArray[i].getDConst())); break; default: @@ -3150,9 +3726,7 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC break; case EbtFloat: case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif leftUnionArray[i].setU64Const(static_cast(rightUnionArray[i].getDConst())); break; default: @@ -3170,10 +3744,10 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC node->getLoc()); } -void TIntermAggregate::addToPragmaTable(const TPragmaTable& pTable) +void TIntermAggregate::setPragmaTable(const TPragmaTable& pTable) { - assert(!pragmaTable); - pragmaTable = new TPragmaTable(); + assert(pragmaTable == nullptr); + pragmaTable = new TPragmaTable; *pragmaTable = pTable; } @@ -3222,4 +3796,20 @@ void TIntermediate::performTextureUpgradeAndSamplerRemovalTransformation(TInterm root->traverse(&transform); } +const char* TIntermediate::getResourceName(TResourceType res) +{ + switch (res) { + case EResSampler: return "shift-sampler-binding"; + case EResTexture: return "shift-texture-binding"; + case EResImage: return "shift-image-binding"; + case EResUbo: return "shift-UBO-binding"; + case EResSsbo: return "shift-ssbo-binding"; + case EResUav: return "shift-uav-binding"; + default: + assert(0); // internal error: should only be called with valid resource types. + return nullptr; + } +} + + } // end namespace glslang diff --git a/deps/glslang/glslang/MachineIndependent/ParseContextBase.cpp b/deps/glslang/glslang/MachineIndependent/ParseContextBase.cpp index 44fc0b47..bfa9de4d 100644 --- a/deps/glslang/glslang/MachineIndependent/ParseContextBase.cpp +++ b/deps/glslang/glslang/MachineIndependent/ParseContextBase.cpp @@ -228,12 +228,38 @@ void TParseContextBase::rValueErrorCheck(const TSourceLoc& loc, const char* op, // must still be valid. // It is okay if the symbol's type will be subsequently edited; // the modifications will be tracked. +// Order is preserved, to avoid creating novel forward references. void TParseContextBase::trackLinkage(TSymbol& symbol) { if (!parsingBuiltins) linkageSymbols.push_back(&symbol); } +// Ensure index is in bounds, correct if necessary. +// Give an error if not. +void TParseContextBase::checkIndex(const TSourceLoc& loc, const TType& type, int& index) +{ + if (index < 0) { + error(loc, "", "[", "index out of range '%d'", index); + index = 0; + } else if (type.isArray()) { + if (type.isSizedArray() && index >= type.getOuterArraySize()) { + error(loc, "", "[", "array index out of range '%d'", index); + index = type.getOuterArraySize() - 1; + } + } else if (type.isVector()) { + if (index >= type.getVectorSize()) { + error(loc, "", "[", "vector index out of range '%d'", index); + index = type.getVectorSize() - 1; + } + } else if (type.isMatrix()) { + if (index >= type.getMatrixCols()) { + error(loc, "", "[", "matrix index out of range '%d'", index); + index = type.getMatrixCols() - 1; + } + } +} + // Make a shared symbol have a non-shared version that can be edited by the current // compile, such that editing its type will not change the shared version and will // effect all nodes already sharing it (non-shallow type), @@ -544,6 +570,10 @@ void TParseContextBase::growGlobalUniformBlock(const TSourceLoc& loc, TType& mem firstNewMember = 0; } + // Update with binding and set + globalUniformBlock->getWritableType().getQualifier().layoutBinding = globalUniformBinding; + globalUniformBlock->getWritableType().getQualifier().layoutSet = globalUniformSet; + // Add the requested member as a member to the global block. TType* type = new TType; type->shallowCopy(memberType); @@ -573,7 +603,7 @@ void TParseContextBase::finish() if (parsingBuiltins) return; - // Transfer the linkage symbols to AST nodes + // Transfer the linkage symbols to AST nodes, preserving order. TIntermAggregate* linkage = new TIntermAggregate; for (auto i = linkageSymbols.begin(); i != linkageSymbols.end(); ++i) intermediate.addSymbolLinkageNode(linkage, **i); diff --git a/deps/glslang/glslang/MachineIndependent/ParseHelper.cpp b/deps/glslang/glslang/MachineIndependent/ParseHelper.cpp index 6decfea7..45c050d4 100644 --- a/deps/glslang/glslang/MachineIndependent/ParseHelper.cpp +++ b/deps/glslang/glslang/MachineIndependent/ParseHelper.cpp @@ -2,6 +2,7 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2015 LunarG, Inc. // Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -49,9 +50,10 @@ namespace glslang { TParseContext::TParseContext(TSymbolTable& symbolTable, TIntermediate& interm, bool parsingBuiltins, int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, - TInfoSink& infoSink, bool forwardCompatible, EShMessages messages) : + TInfoSink& infoSink, bool forwardCompatible, EShMessages messages, + const TString* entryPoint) : TParseContextBase(symbolTable, interm, parsingBuiltins, version, profile, spvVersion, language, - infoSink, forwardCompatible, messages), + infoSink, forwardCompatible, messages, entryPoint), inMain(false), blockName(nullptr), limits(resources.limits), @@ -88,6 +90,9 @@ TParseContext::TParseContext(TSymbolTable& symbolTable, TIntermediate& interm, b if (language == EShLangGeometry) globalOutputDefaults.layoutStream = 0; + + if (entryPoint != nullptr && entryPoint->size() > 0 && *entryPoint != "main") + infoSink.info.message(EPrefixError, "Source entry point must be \"main\""); } TParseContext::~TParseContext() @@ -122,11 +127,6 @@ void TParseContext::setPrecisionDefaults() sampler.set(EbtFloat, Esd2D); sampler.external = true; defaultSamplerPrecision[computeSamplerTypeIndex(sampler)] = EpqLow; - } else { - // Non-ES profile - // All default to highp. - for (int type = 0; type < maxSamplerIndex; ++type) - defaultSamplerPrecision[type] = EpqHigh; } // If we are parsing built-in computational variables/functions, it is meaningful to record @@ -142,6 +142,13 @@ void TParseContext::setPrecisionDefaults() defaultPrecision[EbtUint] = EpqHigh; defaultPrecision[EbtFloat] = EpqHigh; } + + if (profile != EEsProfile) { + // Non-ES profile + // All sampler precisions default to highp. + for (int type = 0; type < maxSamplerIndex; ++type) + defaultSamplerPrecision[type] = EpqHigh; + } } defaultPrecision[EbtSampler] = EpqLow; @@ -260,6 +267,8 @@ void TParseContext::handlePragma(const TSourceLoc& loc, const TVector& if (tokens.size() != 1) error(loc, "extra tokens", "#pragma", ""); intermediate.setUseStorageBuffer(); + } else if (tokens[0].compare("once") == 0) { + warn(loc, "not implemented", "#pragma once", ""); } } @@ -275,17 +284,17 @@ TIntermTyped* TParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symb requireExtensions(loc, symbol->getNumExtensions(), symbol->getExtensions(), symbol->getName().c_str()); if (symbol && symbol->isReadOnly()) { - // All shared things containing an implicitly sized array must be copied up + // All shared things containing an unsized array must be copied up // on first use, so that all future references will share its array structure, // so that editing the implicit size will effect all nodes consuming it, // and so that editing the implicit size won't change the shared one. // // If this is a variable or a block, check it and all it contains, but if this // is a member of an anonymous block, check the whole block, as the whole block - // will need to be copied up if it contains an implicitly-sized array. - if (symbol->getType().containsImplicitlySizedArray() || + // will need to be copied up if it contains an unsized array. + if (symbol->getType().containsUnsizedArray() || (symbol->getAsAnonMember() && - symbol->getAsAnonMember()->getAnonContainer().getType().containsImplicitlySizedArray())) + symbol->getAsAnonMember()->getAnonContainer().getType().containsUnsizedArray())) makeEditable(symbol); } @@ -363,21 +372,29 @@ TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIn } else { // at least one of base and index is not a front-end constant variable... + if (index->getQualifier().isFrontEndConstant()) + checkIndex(loc, base->getType(), indexValue); + if (base->getAsSymbolNode() && isIoResizeArray(base->getType())) handleIoResizeArrayAccess(loc, base); if (index->getQualifier().isFrontEndConstant()) { - if (base->getType().isImplicitlySizedArray()) - updateImplicitArraySize(loc, base, indexValue); + if (base->getType().isUnsizedArray()) + base->getWritableType().updateImplicitArraySize(indexValue + 1); else checkIndex(loc, base->getType(), indexValue); result = intermediate.addIndex(EOpIndexDirect, base, index, loc); } else { - if (base->getType().isImplicitlySizedArray()) { + if (base->getType().isUnsizedArray()) { + // we have a variable index into an unsized array, which is okay, + // depending on the situation if (base->getAsSymbolNode() && isIoResizeArray(base->getType())) error(loc, "", "[", "array must be sized by a redeclaration or layout qualifier before being indexed with a variable"); - else - error(loc, "", "[", "array must be redeclared with a size before being indexed with a variable"); + else { + // it is okay for a run-time sized array + checkRuntimeSizable(loc, *base); + } + base->getWritableType().setArrayVariablyIndexed(); } if (base->getBasicType() == EbtBlock) { if (base->getQualifier().storage == EvqBuffer) @@ -418,6 +435,10 @@ TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIn } result->setType(newType); + // Propagate nonuniform + if (base->getQualifier().isNonUniform() || index->getQualifier().isNonUniform()) + result->getWritableType().getQualifier().nonUniform = true; + if (anyIndexLimits) handleIndexLimits(loc, base, index); } @@ -425,29 +446,6 @@ TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIn return result; } -void TParseContext::checkIndex(const TSourceLoc& loc, const TType& type, int& index) -{ - if (index < 0) { - error(loc, "", "[", "index out of range '%d'", index); - index = 0; - } else if (type.isArray()) { - if (type.isExplicitlySizedArray() && index >= type.getOuterArraySize()) { - error(loc, "", "[", "array index out of range '%d'", index); - index = type.getOuterArraySize() - 1; - } - } else if (type.isVector()) { - if (index >= type.getVectorSize()) { - error(loc, "", "[", "vector index out of range '%d'", index); - index = type.getVectorSize() - 1; - } - } else if (type.isMatrix()) { - if (index >= type.getMatrixCols()) { - error(loc, "", "[", "matrix index out of range '%d'", index); - index = type.getMatrixCols() - 1; - } - } -} - // for ES 2.0 (version 100) limitations for almost all index operations except vertex-shader uniforms void TParseContext::handleIndexLimits(const TSourceLoc& /*loc*/, TIntermTyped* base, TIntermTyped* index) { @@ -499,7 +497,7 @@ void TParseContext::fixIoArraySize(const TSourceLoc& loc, TType& type) if (language == EShLangTessControl || language == EShLangTessEvaluation) { if (type.getOuterArraySize() != resources.maxPatchVertices) { - if (type.isExplicitlySizedArray()) + if (type.isSizedArray()) error(loc, "tessellation input array size must be gl_MaxPatchVertices or implicitly sized", "[]", ""); type.changeOuterArraySize(resources.maxPatchVertices); } @@ -532,7 +530,7 @@ void TParseContext::handleIoResizeArrayAccess(const TSourceLoc& /*loc*/, TInterm return; // fix array size, if it can be fixed and needs to be fixed (will allow variable indexing) - if (symbolNode->getType().isImplicitlySizedArray()) { + if (symbolNode->getType().isUnsizedArray()) { int newSize = getIoArrayImplicitSize(); if (newSize > 0) symbolNode->getWritableType().changeOuterArraySize(newSize); @@ -582,7 +580,7 @@ int TParseContext::getIoArrayImplicitSize() const void TParseContext::checkIoArrayConsistency(const TSourceLoc& loc, int requiredSize, const char* feature, TType& type, const TString& name) { - if (type.isImplicitlySizedArray()) + if (type.isUnsizedArray()) type.changeOuterArraySize(requiredSize); else if (type.getOuterArraySize() != requiredSize) { if (language == EShLangGeometry) @@ -682,7 +680,8 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm // leaving swizzles and struct/block dereferences. TIntermTyped* result = base; - if (base->isVector() || base->isScalar()) { + if ((base->isVector() || base->isScalar()) && + (base->isFloatingDomain() || base->isIntegerDomain() || base->getBasicType() == EbtBool)) { if (base->isScalar()) { const char* dotFeature = "scalar swizzle"; requireProfile(loc, ~EEsProfile, dotFeature); @@ -748,6 +747,10 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm if (base->getQualifier().noContraction) result->getWritableType().getQualifier().noContraction = true; + // Propagate nonuniform + if (base->getQualifier().isNonUniform()) + result->getWritableType().getQualifier().nonUniform = true; + return result; } @@ -792,7 +795,7 @@ TFunction* TParseContext::handleFunctionDeclarator(const TSourceLoc& loc, TFunct if (prevDec->isPrototyped() && prototype) profileRequires(loc, EEsProfile, 300, nullptr, "multiple prototypes for same function"); if (prevDec->getType() != function.getType()) - error(loc, "overloaded functions must have the same return type", function.getType().getBasicTypeString().c_str(), ""); + error(loc, "overloaded functions must have the same return type", function.getName().c_str(), ""); for (int i = 0; i < prevDec->getParamCount(); ++i) { if ((*prevDec)[i].type->getQualifier().storage != function[i].type->getQualifier().storage) error(loc, "overloaded functions must have the same parameter storage qualifiers for argument", function[i].type->getStorageQualifierString(), "%d", i+1); @@ -966,7 +969,7 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction if (builtIn && fnCandidate->getNumExtensions()) requireExtensions(loc, fnCandidate->getNumExtensions(), fnCandidate->getExtensions(), fnCandidate->getName().c_str()); - if (arguments) { + if (arguments != nullptr) { // Make sure qualifications work for these arguments. TIntermAggregate* aggregate = arguments->getAsAggregate(); for (int i = 0; i < fnCandidate->getParamCount(); ++i) { @@ -1004,7 +1007,7 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction if (builtIn && fnCandidate->getBuiltInOp() != EOpNull) { // A function call mapped to a built-in operation. - result = handleBuiltInFunctionCall(loc, *arguments, *fnCandidate); + result = handleBuiltInFunctionCall(loc, arguments, *fnCandidate); } else { // This is a function call not mapped to built-in operator. // It could still be a built-in function, but only if PureOperatorBuiltins == false. @@ -1052,20 +1055,24 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction return result; } -TIntermTyped* TParseContext::handleBuiltInFunctionCall(TSourceLoc loc, TIntermNode& arguments, +TIntermTyped* TParseContext::handleBuiltInFunctionCall(TSourceLoc loc, TIntermNode* arguments, const TFunction& function) { checkLocation(loc, function.getBuiltInOp()); TIntermTyped *result = intermediate.addBuiltInFunctionCall(loc, function.getBuiltInOp(), function.getParamCount() == 1, - &arguments, function.getType()); + arguments, function.getType()); if (obeyPrecisionQualifiers()) computeBuiltinPrecisions(*result, function); - if (result == nullptr) { - error(arguments.getLoc(), " wrong operand type", "Internal Error", - "built in unary operator function. Type: %s", - static_cast(&arguments)->getCompleteString().c_str()); + if (result == nullptr) { + if (arguments == nullptr) + error(loc, " wrong operand type", "Internal Error", + "built in unary operator function. Type: %s", ""); + else + error(arguments->getLoc(), " wrong operand type", "Internal Error", + "built in unary operator function. Type: %s", + static_cast(arguments)->getCompleteString().c_str()); } else if (result->getAsOperator()) builtInOpCheck(loc, function, *result->getAsOperator()); @@ -1224,10 +1231,7 @@ TIntermTyped* TParseContext::handleLengthMethod(const TSourceLoc& loc, TFunction else { const TType& type = intermNode->getAsTyped()->getType(); if (type.isArray()) { - if (type.isRuntimeSizedArray()) { - // Create a unary op and let the back end handle it - return intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, intermNode, TType(EbtInt)); - } else if (type.isImplicitlySizedArray()) { + if (type.isUnsizedArray()) { if (intermNode->getAsSymbolNode() && isIoResizeArray(type)) { // We could be between a layout declaration that gives a built-in io array implicit size and // a user redeclaration of that array, meaning we have to substitute its implicit size here @@ -1240,7 +1244,10 @@ TIntermTyped* TParseContext::handleLengthMethod(const TSourceLoc& loc, TFunction if (length == 0) { if (intermNode->getAsSymbolNode() && isIoResizeArray(type)) error(loc, "", function->getName().c_str(), "array must first be sized by a redeclaration or layout qualifier"); - else + else if (isRuntimeLength(*intermNode->getAsTyped())) { + // Create a unary op and let the back end handle it + return intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, intermNode, TType(EbtInt)); + } else error(loc, "", function->getName().c_str(), "array must be declared with a size before using this method"); } } else if (type.getOuterArrayNode()) { @@ -1394,6 +1401,8 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan arg0 = unaryArg; } + TString featureString; + const char* feature = nullptr; switch (callNode.getOp()) { case EOpTextureGather: case EOpTextureGatherOffset: @@ -1402,8 +1411,9 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan // Figure out which variants are allowed by what extensions, // and what arguments must be constant for which situations. - TString featureString = fnCandidate.getName() + "(...)"; - const char* feature = featureString.c_str(); + featureString = fnCandidate.getName(); + featureString += "(...)"; + feature = featureString.c_str(); profileRequires(loc, EEsProfile, 310, nullptr, feature); int compArg = -1; // track which argument, if any, is the constant component argument switch (callNode.getOp()) { @@ -1459,8 +1469,9 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan bias = fnCandidate.getParamCount() > 4; if (bias) { - TString biasFeatureString = fnCandidate.getName() + "with bias argument"; - const char* feature = biasFeatureString.c_str(); + featureString = fnCandidate.getName(); + featureString += "with bias argument"; + feature = featureString.c_str(); profileRequires(loc, ~EEsProfile, 450, nullptr, feature); requireExtensions(loc, 1, &E_GL_AMD_texture_gather_bias_lod, feature); } @@ -1482,8 +1493,9 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan bias = fnCandidate.getParamCount() > 5; if (bias) { - TString featureString = fnCandidate.getName() + "with bias argument"; - const char* feature = featureString.c_str(); + featureString = fnCandidate.getName(); + featureString += "with bias argument"; + feature = featureString.c_str(); profileRequires(loc, ~EEsProfile, 450, nullptr, feature); requireExtensions(loc, 1, &E_GL_AMD_texture_gather_bias_lod, feature); } @@ -1498,6 +1510,39 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan requireExtensions(loc, 1, &E_GL_ARB_sparse_texture2, fnCandidate.getName().c_str()); break; } + + case EOpSwizzleInvocations: + { + if (! (*argp)[1]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "offset", ""); + else { + unsigned offset[4] = {}; + offset[0] = (*argp)[1]->getAsConstantUnion()->getConstArray()[0].getUConst(); + offset[1] = (*argp)[1]->getAsConstantUnion()->getConstArray()[1].getUConst(); + offset[2] = (*argp)[1]->getAsConstantUnion()->getConstArray()[2].getUConst(); + offset[3] = (*argp)[1]->getAsConstantUnion()->getConstArray()[3].getUConst(); + if (offset[0] > 3 || offset[1] > 3 || offset[2] > 3 || offset[3] > 3) + error(loc, "components must be in the range [0, 3]", "offset", ""); + } + + break; + } + + case EOpSwizzleInvocationsMasked: + { + if (! (*argp)[1]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "mask", ""); + else { + unsigned mask[3] = {}; + mask[0] = (*argp)[1]->getAsConstantUnion()->getConstArray()[0].getUConst(); + mask[1] = (*argp)[1]->getAsConstantUnion()->getConstArray()[1].getUConst(); + mask[2] = (*argp)[1]->getAsConstantUnion()->getConstArray()[2].getUConst(); + if (mask[0] > 31 || mask[1] > 31 || mask[2] > 31) + error(loc, "components must be in the range [0, 31]", "mask", ""); + } + + break; + } #endif case EOpTextureOffset: @@ -1525,6 +1570,12 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan } if (arg > 0) { + +#ifdef AMD_EXTENSIONS + bool f16ShadowCompare = (*argp)[1]->getAsTyped()->getBasicType() == EbtFloat16 && arg0->getType().getSampler().shadow; + if (f16ShadowCompare) + ++arg; +#endif if (! (*argp)[arg]->getAsConstantUnion()) error(loc, "argument must be compile-time constant", "texel offset", ""); else { @@ -1570,9 +1621,29 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan break; } +#ifdef NV_EXTENSIONS + case EOpAtomicAdd: + case EOpAtomicMin: + case EOpAtomicMax: + case EOpAtomicAnd: + case EOpAtomicOr: + case EOpAtomicXor: + case EOpAtomicExchange: + case EOpAtomicCompSwap: + { + if (arg0->getType().getBasicType() == EbtInt64 || arg0->getType().getBasicType() == EbtUint64) + requireExtensions(loc, 1, &E_GL_NV_shader_atomic_int64, fnCandidate.getName().c_str()); + + break; + } +#endif + case EOpInterpolateAtCentroid: case EOpInterpolateAtSample: case EOpInterpolateAtOffset: +#ifdef AMD_EXTENSIONS + case EOpInterpolateAtVertex: +#endif // Make sure the first argument is an interpolant, or an array element of an interpolant if (arg0->getType().getQualifier().storage != EvqVaryingIn) { // It might still be an array element. @@ -1587,6 +1658,23 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan if (base == nullptr || base->getType().getQualifier().storage != EvqVaryingIn) error(loc, "first argument must be an interpolant, or interpolant-array element", fnCandidate.getName().c_str(), ""); } + +#ifdef AMD_EXTENSIONS + if (callNode.getOp() == EOpInterpolateAtVertex) { + if (!arg0->getType().getQualifier().isExplicitInterpolation()) + error(loc, "argument must be qualified as __explicitInterpAMD in", "interpolant", ""); + else { + if (! (*argp)[1]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "vertex index", ""); + else { + unsigned vertexIdx = (*argp)[1]->getAsConstantUnion()->getConstArray()[0].getUConst(); + if (vertexIdx > 2) + error(loc, "must be in the range [0, 2]", "vertex index", ""); + } + } + } +#endif + break; case EOpEmitStreamVertex: @@ -1594,9 +1682,33 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan intermediate.setMultiStream(); break; + case EOpSubgroupClusteredAdd: + case EOpSubgroupClusteredMul: + case EOpSubgroupClusteredMin: + case EOpSubgroupClusteredMax: + case EOpSubgroupClusteredAnd: + case EOpSubgroupClusteredOr: + case EOpSubgroupClusteredXor: + if ((*argp)[1]->getAsConstantUnion() == nullptr) + error(loc, "argument must be compile-time constant", "cluster size", ""); + else { + int size = (*argp)[1]->getAsConstantUnion()->getConstArray()[0].getIConst(); + if (size < 1) + error(loc, "argument must be at least 1", "cluster size", ""); + else if (!IsPow2(size)) + error(loc, "argument must be a power of 2", "cluster size", ""); + } + break; + default: break; } + + if (callNode.getOp() > EOpSubgroupGuardStart && callNode.getOp() < EOpSubgroupGuardStop) { + // these require SPIR-V 1.3 + if (spvVersion.spv > 0 && spvVersion.spv < EShTargetSpv_1_3) + error(loc, "requires SPIR-V 1.3", "subgroup op", ""); + } } extern bool PureOperatorBuiltins; @@ -2158,7 +2270,6 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T case EOpConstructDMat4x2: case EOpConstructDMat4x3: case EOpConstructDMat4x4: -#ifdef AMD_EXTENSIONS case EOpConstructF16Mat2x2: case EOpConstructF16Mat2x3: case EOpConstructF16Mat2x4: @@ -2168,7 +2279,6 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T case EOpConstructF16Mat4x2: case EOpConstructF16Mat4x3: case EOpConstructF16Mat4x4: -#endif constructingMatrix = true; break; default: @@ -2189,7 +2299,7 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T bool floatArgument = false; for (int arg = 0; arg < function.getParamCount(); ++arg) { if (function[arg].type->isArray()) { - if (! function[arg].type->isExplicitlySizedArray()) { + if (function[arg].type->isUnsizedArray()) { // Can't construct from an unsized array. error(loc, "array argument must be sized", "constructor", ""); return true; @@ -2225,18 +2335,30 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T // Finish pinning down spec-const semantics if (specConstType) { switch (op) { + case EOpConstructInt8: + case EOpConstructUint8: + case EOpConstructInt16: + case EOpConstructUint16: case EOpConstructInt: case EOpConstructUint: case EOpConstructInt64: case EOpConstructUint64: -#ifdef AMD_EXTENSIONS - case EOpConstructInt16: - case EOpConstructUint16: -#endif case EOpConstructBool: case EOpConstructBVec2: case EOpConstructBVec3: case EOpConstructBVec4: + case EOpConstructI8Vec2: + case EOpConstructI8Vec3: + case EOpConstructI8Vec4: + case EOpConstructU8Vec2: + case EOpConstructU8Vec3: + case EOpConstructU8Vec4: + case EOpConstructI16Vec2: + case EOpConstructI16Vec3: + case EOpConstructI16Vec4: + case EOpConstructU16Vec2: + case EOpConstructU16Vec3: + case EOpConstructU16Vec4: case EOpConstructIVec2: case EOpConstructIVec3: case EOpConstructIVec4: @@ -2249,14 +2371,6 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T case EOpConstructU64Vec2: case EOpConstructU64Vec3: case EOpConstructU64Vec4: -#ifdef AMD_EXTENSIONS - case EOpConstructI16Vec2: - case EOpConstructI16Vec3: - case EOpConstructI16Vec4: - case EOpConstructU16Vec2: - case EOpConstructU16Vec3: - case EOpConstructU16Vec4: -#endif // This was the list of valid ones, if they aren't converting from float // and aren't making an array. makeSpecConst = ! floatArgument && ! type.isArray(); @@ -2283,7 +2397,7 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T return true; } - if (type.isImplicitlySizedArray()) { + if (type.isUnsizedArray()) { // auto adapt the constructor type to the number of arguments type.changeOuterArraySize(function.getParamCount()); } else if (type.getOuterArraySize() != function.getParamCount()) { @@ -2295,20 +2409,21 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T // Types have to match, but we're still making the type. // Finish making the type, and the comparison is done later // when checking for conversion. - TArraySizes& arraySizes = type.getArraySizes(); + TArraySizes& arraySizes = *type.getArraySizes(); // At least the dimensionalities have to match. - if (! function[0].type->isArray() || arraySizes.getNumDims() != function[0].type->getArraySizes().getNumDims() + 1) { + if (! function[0].type->isArray() || + arraySizes.getNumDims() != function[0].type->getArraySizes()->getNumDims() + 1) { error(loc, "array constructor argument not correct type to construct array element", "constructor", ""); return true; } - if (arraySizes.isInnerImplicit()) { + if (arraySizes.isInnerUnsized()) { // "Arrays of arrays ..., and the size for any dimension is optional" // That means we need to adopt (from the first argument) the other array sizes into the type. for (int d = 1; d < arraySizes.getNumDims(); ++d) { if (arraySizes.getDimSize(d) == UnsizedArraySize) { - arraySizes.setDimSize(d, function[0].type->getArraySizes().getDimSize(d - 1)); + arraySizes.setDimSize(d, function[0].type->getArraySizes()->getDimSize(d - 1)); } } } @@ -2457,6 +2572,16 @@ void TParseContext::boolCheck(const TSourceLoc& loc, const TPublicType& pType) void TParseContext::samplerCheck(const TSourceLoc& loc, const TType& type, const TString& identifier, TIntermTyped* /*initializer*/) { + // Check that the appropriate extension is enabled if external sampler is used. + // There are two extensions. The correct one must be used based on GLSL version. + if (type.getBasicType() == EbtSampler && type.getSampler().external) { + if (version < 300) { + requireExtensions(loc, 1, &E_GL_OES_EGL_image_external, "samplerExternalOES"); + } else { + requireExtensions(loc, 1, &E_GL_OES_EGL_image_external_essl3, "samplerExternalOES"); + } + } + if (type.getQualifier().storage == EvqUniform) return; @@ -2499,17 +2624,33 @@ void TParseContext::transparentOpaqueCheck(const TSourceLoc& loc, const TType& t } } +// +// Qualifier checks knowing the qualifier and that it is a member of a struct/block. +// +void TParseContext::memberQualifierCheck(glslang::TPublicType& publicType) +{ + globalQualifierFixCheck(publicType.loc, publicType.qualifier); + checkNoShaderLayouts(publicType.loc, publicType.shaderQualifiers); + if (publicType.qualifier.isNonUniform()) { + error(publicType.loc, "not allowed on block or structure members", "nonuniformEXT", ""); + publicType.qualifier.nonUniform = false; + } +} + // // Check/fix just a full qualifier (no variables or types yet, but qualifier is complete) at global level. // void TParseContext::globalQualifierFixCheck(const TSourceLoc& loc, TQualifier& qualifier) { + bool nonuniformOkay = false; + // move from parameter/unknown qualifiers to pipeline in/out qualifiers switch (qualifier.storage) { case EvqIn: profileRequires(loc, ENoProfile, 130, nullptr, "in for stage inputs"); profileRequires(loc, EEsProfile, 300, nullptr, "in for stage inputs"); qualifier.storage = EvqVaryingIn; + nonuniformOkay = true; break; case EvqOut: profileRequires(loc, ENoProfile, 130, nullptr, "out for stage outputs"); @@ -2520,10 +2661,17 @@ void TParseContext::globalQualifierFixCheck(const TSourceLoc& loc, TQualifier& q qualifier.storage = EvqVaryingIn; error(loc, "cannot use 'inout' at global scope", "", ""); break; + case EvqGlobal: + case EvqTemporary: + nonuniformOkay = true; + break; default: break; } + if (!nonuniformOkay && qualifier.nonUniform) + error(loc, "for non-parameter, can only apply to 'in' or no storage qualifier", "nonuniformEXT", ""); + invariantCheck(loc, qualifier); } @@ -2549,17 +2697,12 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali // now, knowing it is a shader in/out, do all the in/out semantic checks - if (publicType.basicType == EbtBool) { + if (publicType.basicType == EbtBool && !parsingBuiltins) { error(loc, "cannot be bool", GetStorageQualifierString(qualifier.storage), ""); return; } - if (publicType.basicType == EbtInt || publicType.basicType == EbtUint || -#ifdef AMD_EXTENSIONS - publicType.basicType == EbtInt16 || publicType.basicType == EbtUint16 || -#endif - publicType.basicType == EbtInt64 || publicType.basicType == EbtUint64 || - publicType.basicType == EbtDouble) + if (isTypeInt(publicType.basicType) || publicType.basicType == EbtDouble) profileRequires(loc, EEsProfile, 300, nullptr, "shader input/output"); #ifdef AMD_EXTENSIONS @@ -2567,13 +2710,13 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali #else if (!qualifier.flat) { #endif - if (publicType.basicType == EbtInt || publicType.basicType == EbtUint || -#ifdef AMD_EXTENSIONS - publicType.basicType == EbtInt16 || publicType.basicType == EbtUint16 || -#endif - publicType.basicType == EbtInt64 || publicType.basicType == EbtUint64 || + if (isTypeInt(publicType.basicType) || publicType.basicType == EbtDouble || - (publicType.userDef && (publicType.userDef->containsBasicType(EbtInt) || + (publicType.userDef && (publicType.userDef->containsBasicType(EbtInt8) || + publicType.userDef->containsBasicType(EbtUint8) || + publicType.userDef->containsBasicType(EbtInt16) || + publicType.userDef->containsBasicType(EbtUint16) || + publicType.userDef->containsBasicType(EbtInt) || publicType.userDef->containsBasicType(EbtUint) || publicType.userDef->containsBasicType(EbtInt64) || publicType.userDef->containsBasicType(EbtUint64) || @@ -2675,8 +2818,8 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali error(loc, "can't use auxiliary qualifier on a fragment output", "centroid/sample/patch", ""); if (qualifier.isInterpolation()) error(loc, "can't use interpolation qualifier on a fragment output", "flat/smooth/noperspective", ""); - if (publicType.basicType == EbtDouble) - error(loc, "cannot contain a double", GetStorageQualifierString(qualifier.storage), ""); + if (publicType.basicType == EbtDouble || publicType.basicType == EbtInt64 || publicType.basicType == EbtUint64) + error(loc, "cannot contain a double, int64, or uint64", GetStorageQualifierString(qualifier.storage), ""); break; case EShLangCompute: @@ -2777,6 +2920,7 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons MERGE_SINGLETON(readonly); MERGE_SINGLETON(writeonly); MERGE_SINGLETON(specConstant); + MERGE_SINGLETON(nonUniform); if (repeated) error(loc, "replicated qualifiers", "", ""); @@ -2977,7 +3121,7 @@ bool TParseContext::arrayError(const TSourceLoc& loc, const TType& type) // void TParseContext::arraySizeRequiredCheck(const TSourceLoc& loc, const TArraySizes& arraySizes) { - if (arraySizes.isImplicit()) + if (arraySizes.hasUnsized()) error(loc, "array size required", "", ""); } @@ -2991,7 +3135,7 @@ void TParseContext::structArrayCheck(const TSourceLoc& /*loc*/, const TType& typ } } -void TParseContext::arraySizesCheck(const TSourceLoc& loc, const TQualifier& qualifier, const TArraySizes* arraySizes, bool initializer, bool lastMember) +void TParseContext::arraySizesCheck(const TSourceLoc& loc, const TQualifier& qualifier, TArraySizes* arraySizes, bool initializer, bool lastMember) { assert(arraySizes); @@ -3004,8 +3148,10 @@ void TParseContext::arraySizesCheck(const TSourceLoc& loc, const TQualifier& qua return; // No environment allows any non-outer-dimension to be implicitly sized - if (arraySizes->isInnerImplicit()) + if (arraySizes->isInnerUnsized()) { error(loc, "only outermost dimension of an array of arrays can be implicitly sized", "[]", ""); + arraySizes->clearInnerUnsized(); + } if (arraySizes->isInnerSpecialization()) error(loc, "only outermost dimension of an array of arrays can be a specialization constant", "[]", ""); @@ -3050,8 +3196,11 @@ void TParseContext::arraySizesCheck(const TSourceLoc& loc, const TQualifier& qua arraySizeRequiredCheck(loc, *arraySizes); } -void TParseContext::arrayOfArrayVersionCheck(const TSourceLoc& loc) +void TParseContext::arrayOfArrayVersionCheck(const TSourceLoc& loc, const TArraySizes* sizes) { + if (sizes == nullptr || sizes->getNumDims() == 1) + return; + const char* feature = "arrays of arrays"; requireProfile(loc, EEsProfile | ECoreProfile | ECompatibilityProfile, feature); @@ -3059,36 +3208,6 @@ void TParseContext::arrayOfArrayVersionCheck(const TSourceLoc& loc) profileRequires(loc, ECoreProfile | ECompatibilityProfile, 430, nullptr, feature); } -void TParseContext::arrayDimCheck(const TSourceLoc& loc, const TArraySizes* sizes1, const TArraySizes* sizes2) -{ - if ((sizes1 && sizes2) || - (sizes1 && sizes1->getNumDims() > 1) || - (sizes2 && sizes2->getNumDims() > 1)) - arrayOfArrayVersionCheck(loc); -} - -void TParseContext::arrayDimCheck(const TSourceLoc& loc, const TType* type, const TArraySizes* sizes2) -{ - // skip checking for multiple dimensions on the type; it was caught earlier - if ((type && type->isArray() && sizes2) || - (sizes2 && sizes2->getNumDims() > 1)) - arrayOfArrayVersionCheck(loc); -} - -// Merge array dimensions listed in 'sizes' onto the type's array dimensions. -// -// From the spec: "vec4[2] a[3]; // size-3 array of size-2 array of vec4" -// -// That means, the 'sizes' go in front of the 'type' as outermost sizes. -// 'type' is the type part of the declaration (to the left) -// 'sizes' is the arrayness tagged on the identifier (to the right) -// -void TParseContext::arrayDimMerge(TType& type, const TArraySizes* sizes) -{ - if (sizes) - type.addArrayOuterSizes(*sizes); -} - // // Do all the semantic checking for declaring or redeclaring an array, with and // without a size, and make the right changes to the symbol table. @@ -3158,7 +3277,7 @@ void TParseContext::declareArray(const TSourceLoc& loc, const TString& identifie return; } - if (existingType.isExplicitlySizedArray()) { + if (existingType.isSizedArray()) { // be more leniant for input arrays to geometry shaders and tessellation control outputs, where the redeclaration is the same size if (! (isIoResizeArray(type) && existingType.getOuterArraySize() == type.getOuterArraySize())) error(loc, "redeclaration of array with size", identifier.c_str(), ""); @@ -3173,64 +3292,37 @@ void TParseContext::declareArray(const TSourceLoc& loc, const TString& identifie checkIoArraysConsistency(loc); } -void TParseContext::updateImplicitArraySize(const TSourceLoc& loc, TIntermNode *node, int index) +// Policy and error check for needing a runtime sized array. +void TParseContext::checkRuntimeSizable(const TSourceLoc& loc, const TIntermTyped& base) { - // maybe there is nothing to do... - TIntermTyped* typedNode = node->getAsTyped(); - if (typedNode->getType().getImplicitArraySize() > index) + // runtime length implies runtime sizeable, so no problem + if (isRuntimeLength(base)) return; - // something to do... - - // Figure out what symbol to lookup, as we will use its type to edit for the size change, - // as that type will be shared through shallow copies for future references. - TSymbol* symbol = nullptr; - int blockIndex = -1; - const TString* lookupName = nullptr; - if (node->getAsSymbolNode()) - lookupName = &node->getAsSymbolNode()->getName(); - else if (node->getAsBinaryNode()) { - const TIntermBinary* deref = node->getAsBinaryNode(); - // This has to be the result of a block dereference, unless it's bad shader code - // If it's a uniform block, then an error will be issued elsewhere, but - // return early now to avoid crashing later in this function. - if (deref->getLeft()->getBasicType() != EbtBlock || - deref->getLeft()->getType().getQualifier().storage == EvqUniform || - deref->getRight()->getAsConstantUnion() == nullptr) - return; - - const TIntermTyped* left = deref->getLeft(); - const TIntermTyped* right = deref->getRight(); + // check for additional things allowed by GL_EXT_nonuniform_qualifier + if (base.getBasicType() == EbtSampler || + (base.getBasicType() == EbtBlock && base.getType().getQualifier().isUniformOrBuffer())) + requireExtensions(loc, 1, &E_GL_EXT_nonuniform_qualifier, "variable index"); + else + error(loc, "", "[", "array must be redeclared with a size before being indexed with a variable"); +} - if (left->getAsBinaryNode()) { - left = left->getAsBinaryNode()->getLeft(); // Block array access - assert(left->isArray()); +// Policy decision for whether a run-time .length() is allowed. +bool TParseContext::isRuntimeLength(const TIntermTyped& base) const +{ + if (base.getType().getQualifier().storage == EvqBuffer) { + // in a buffer block + const TIntermBinary* binary = base.getAsBinaryNode(); + if (binary != nullptr && binary->getOp() == EOpIndexDirectStruct) { + // is it the last member? + const int index = binary->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst(); + const int memberCount = (int)binary->getLeft()->getType().getStruct()->size(); + if (index == memberCount - 1) + return true; } - - if (! left->getAsSymbolNode()) - return; - - blockIndex = right->getAsConstantUnion()->getConstArray()[0].getIConst(); - - lookupName = &left->getAsSymbolNode()->getName(); - if (IsAnonymous(*lookupName)) - lookupName = &(*left->getType().getStruct())[blockIndex].type->getFieldName(); - } - - // Lookup the symbol, should only fail if shader code is incorrect - symbol = symbolTable.find(*lookupName); - if (symbol == nullptr) - return; - - if (symbol->getAsFunction()) { - error(loc, "array variable name expected", symbol->getName().c_str(), ""); - return; } - if (symbol->getType().isStruct() && blockIndex != -1) - (*symbol->getWritableType().getStruct())[blockIndex].type->setImplicitArraySize(index + 1); - else - symbol->getWritableType().setImplicitArraySize(index + 1); + return false; } // Returns true if the first argument to the #line directive is the line number for the next line. @@ -3465,17 +3557,25 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT return; } + // Fix XFB stuff up, it applies to the order of the redeclaration, not + // the order of the original members. + if (currentBlockQualifier.storage == EvqVaryingOut && globalOutputDefaults.hasXfbBuffer()) { + if (!currentBlockQualifier.hasXfbBuffer()) + currentBlockQualifier.layoutXfbBuffer = globalOutputDefaults.layoutXfbBuffer; + fixBlockXfbOffsets(currentBlockQualifier, newTypeList); + } + // Edit and error check the container against the redeclaration // - remove unused members // - ensure remaining qualifiers/types match + TType& type = block->getWritableType(); #ifdef NV_EXTENSIONS // if gl_PerVertex is redeclared for the purpose of passing through "gl_Position" - // for passthrough purpose, the redclared block should have the same qualifers as + // for passthrough purpose, the redeclared block should have the same qualifers as // the current one - if (currentBlockQualifier.layoutPassthrough) - { + if (currentBlockQualifier.layoutPassthrough) { type.getQualifier().layoutPassthrough = currentBlockQualifier.layoutPassthrough; type.getQualifier().storage = currentBlockQualifier.storage; type.getQualifier().layoutStream = currentBlockQualifier.layoutStream; @@ -3510,16 +3610,19 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT error(memberLoc, "cannot redeclare block member with a different type", member->type->getFieldName().c_str(), ""); if (oldType.isArray() != newType.isArray()) error(memberLoc, "cannot change arrayness of redeclared block member", member->type->getFieldName().c_str(), ""); - else if (! oldType.sameArrayness(newType) && oldType.isExplicitlySizedArray()) + else if (! oldType.sameArrayness(newType) && oldType.isSizedArray()) error(memberLoc, "cannot change array size of redeclared block member", member->type->getFieldName().c_str(), ""); else if (newType.isArray()) arrayLimitCheck(loc, member->type->getFieldName(), newType.getOuterArraySize()); if (newType.getQualifier().isMemory()) error(memberLoc, "cannot add memory qualifier to redeclared block member", member->type->getFieldName().c_str(), ""); - if (newType.getQualifier().hasLayout()) - error(memberLoc, "cannot add layout to redeclared block member", member->type->getFieldName().c_str(), ""); + if (newType.getQualifier().hasNonXfbLayout()) + error(memberLoc, "cannot add non-XFB layout to redeclared block member", member->type->getFieldName().c_str(), ""); if (newType.getQualifier().patch) error(memberLoc, "cannot add patch to redeclared block member", member->type->getFieldName().c_str(), ""); + if (newType.getQualifier().hasXfbBuffer() && + newType.getQualifier().layoutXfbBuffer != currentBlockQualifier.layoutXfbBuffer) + error(memberLoc, "member cannot contradict block (or what block inherited from global)", "xfb_buffer", ""); oldType.getQualifier().centroid = newType.getQualifier().centroid; oldType.getQualifier().sample = newType.getQualifier().sample; oldType.getQualifier().invariant = newType.getQualifier().invariant; @@ -3527,18 +3630,21 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT oldType.getQualifier().smooth = newType.getQualifier().smooth; oldType.getQualifier().flat = newType.getQualifier().flat; oldType.getQualifier().nopersp = newType.getQualifier().nopersp; - -#ifdef NV_EXTENSIONS - if (member->type->getFieldName() == "gl_Layer") { - if (!newType.getQualifier().layoutViewportRelative && newType.getQualifier().layoutSecondaryViewportRelativeOffset == -2048) - error(loc, "redeclaration only allowed for viewport_relative or secondary_view_offset layout", "redeclaration", member->type->getFieldName().c_str()); - oldType.getQualifier().layoutViewportRelative = newType.getQualifier().layoutViewportRelative; - oldType.getQualifier().layoutSecondaryViewportRelativeOffset = newType.getQualifier().layoutSecondaryViewportRelativeOffset; + oldType.getQualifier().layoutXfbOffset = newType.getQualifier().layoutXfbOffset; + oldType.getQualifier().layoutXfbBuffer = newType.getQualifier().layoutXfbBuffer; + oldType.getQualifier().layoutXfbStride = newType.getQualifier().layoutXfbStride; + if (oldType.getQualifier().layoutXfbOffset != TQualifier::layoutXfbBufferEnd) { + // if any member as an xfb_offset, then the block's xfb_buffer inherents current xfb_buffer, + // and for xfb processing, the member needs it as well, along with xfb_stride + type.getQualifier().layoutXfbBuffer = currentBlockQualifier.layoutXfbBuffer; + oldType.getQualifier().layoutXfbBuffer = currentBlockQualifier.layoutXfbBuffer; } -#endif - if (oldType.isImplicitlySizedArray() && newType.isExplicitlySizedArray()) + if (oldType.isUnsizedArray() && newType.isSizedArray()) oldType.changeOuterArraySize(newType.getOuterArraySize()); + // check and process the member's type, which will include managing xfb information + layoutTypeCheck(loc, oldType); + // go to next member ++member; } else { @@ -3559,11 +3665,11 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT if (type.isArray() != (arraySizes != nullptr)) error(loc, "cannot change arrayness of redeclared block", blockName.c_str(), ""); else if (type.isArray()) { - if (type.isExplicitlySizedArray() && arraySizes->getOuterSize() == UnsizedArraySize) - error(loc, "block already declared with size, can't redeclare as implicitly-sized", blockName.c_str(), ""); - else if (type.isExplicitlySizedArray() && type.getArraySizes() != *arraySizes) + if (type.isSizedArray() && !arraySizes->isSized()) + error(loc, "block already declared with size, can't redeclare as unsized", blockName.c_str(), ""); + else if (type.isSizedArray() && *type.getArraySizes() != *arraySizes) error(loc, "cannot change array size of redeclared block", blockName.c_str(), ""); - else if (type.isImplicitlySizedArray() && arraySizes->getOuterSize() != UnsizedArraySize) + else if (!type.isSizedArray() && arraySizes->isSized()) type.changeOuterArraySize(arraySizes->getOuterSize()); } @@ -3583,7 +3689,7 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT trackLinkage(*block); } -void TParseContext::paramCheckFix(const TSourceLoc& loc, const TStorageQualifier& qualifier, TType& type) +void TParseContext::paramCheckFixStorage(const TSourceLoc& loc, const TStorageQualifier& qualifier, TType& type) { switch (qualifier) { case EvqConst: @@ -3629,8 +3735,10 @@ void TParseContext::paramCheckFix(const TSourceLoc& loc, const TQualifier& quali else warn(loc, "qualifier has no effect on non-output parameters", "precise", ""); } + if (qualifier.isNonUniform()) + type.getQualifier().nonUniform = qualifier.nonUniform; - paramCheckFix(loc, qualifier.storage, type); + paramCheckFixStorage(loc, qualifier.storage, type); } void TParseContext::nestedBlockCheck(const TSourceLoc& loc) @@ -3869,6 +3977,28 @@ void TParseContext::finish() default: break; } + +#ifdef NV_EXTENSIONS + // Set default outputs for GL_NV_geometry_shader_passthrough + if (language == EShLangGeometry && extensionTurnedOn(E_SPV_NV_geometry_shader_passthrough)) { + if (intermediate.getOutputPrimitive() == ElgNone) { + switch (intermediate.getInputPrimitive()) { + case ElgPoints: intermediate.setOutputPrimitive(ElgPoints); break; + case ElgLines: intermediate.setOutputPrimitive(ElgLineStrip); break; + case ElgTriangles: intermediate.setOutputPrimitive(ElgTriangles); break; + default: break; + } + } + if (intermediate.getVertices() == TQualifier::layoutNotSet) { + switch (intermediate.getInputPrimitive()) { + case ElgPoints: intermediate.setVertices(1); break; + case ElgLines: intermediate.setVertices(2); break; + case ElgTriangles: intermediate.setVertices(3); break; + default: break; + } + } + } +#endif } // @@ -4458,8 +4588,8 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb switch (qualifier.storage) { case EvqVaryingIn: case EvqVaryingOut: - if (type.getBasicType() != EbtBlock || - (!(*type.getStruct())[0].type->getQualifier().hasLocation() && + if (type.getBasicType() != EbtBlock || + (!(*type.getStruct())[0].type->getQualifier().hasLocation() && (*type.getStruct())[0].type->getQualifier().builtIn == EbvNone)) error(loc, "SPIR-V requires location for user input/output", "location", ""); break; @@ -4502,7 +4632,8 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb // they are not allowed on block members. For arrayed interfaces (those generally having an // extra level of arrayness due to interface expansion), the outer array is stripped before // applying this rule." -void TParseContext::layoutMemberLocationArrayCheck(const TSourceLoc& loc, bool memberWithLocation, TArraySizes* arraySizes) +void TParseContext::layoutMemberLocationArrayCheck(const TSourceLoc& loc, bool memberWithLocation, + TArraySizes* arraySizes) { if (memberWithLocation && arraySizes != nullptr) { if (arraySizes->getNumDims() > (currentBlockQualifier.isArrayedIo(language) ? 1 : 0)) @@ -4551,6 +4682,8 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) break; case EvqUniform: case EvqBuffer: + if (type.getBasicType() == EbtBlock) + error(loc, "cannot apply to uniform or buffer block", "location", ""); break; default: error(loc, "can only apply to uniform, buffer, in, or out storage qualifiers", "location", ""); @@ -4577,11 +4710,9 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) // containing a double, the offset must also be a multiple of 8..." if (type.containsBasicType(EbtDouble) && ! IsMultipleOfPow2(qualifier.layoutXfbOffset, 8)) error(loc, "type contains double; xfb_offset must be a multiple of 8", "xfb_offset", ""); -#ifdef AMD_EXTENSIONS // ..., if applied to an aggregate containing a float16_t, the offset must also be a multiple of 2..." else if (type.containsBasicType(EbtFloat16) && !IsMultipleOfPow2(qualifier.layoutXfbOffset, 2)) error(loc, "type contains half float; xfb_offset must be a multiple of 2", "xfb_offset", ""); -#endif else if (! IsMultipleOfPow2(qualifier.layoutXfbOffset, 4)) error(loc, "must be a multiple of size of first component", "xfb_offset", ""); } @@ -4605,13 +4736,19 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) if (type.getBasicType() == EbtSampler) { int lastBinding = qualifier.layoutBinding; if (type.isArray()) { - if (type.isImplicitlySizedArray()) { + if (spvVersion.vulkan > 0) lastBinding += 1; - warn(loc, "assuming array size of one for compile-time checking of binding numbers for implicitly-sized array", "[]", ""); - } else - lastBinding += type.getCumulativeArraySize(); + else { + if (type.isSizedArray()) + lastBinding += type.getCumulativeArraySize(); + else { + lastBinding += 1; + if (spvVersion.vulkan == 0) + warn(loc, "assuming binding count of one for compile-time checking of binding numbers for unsized array", "[]", ""); + } + } } - if (lastBinding >= resources.maxCombinedTextureImageUnits) + if (spvVersion.vulkan == 0 && lastBinding >= resources.maxCombinedTextureImageUnits) error(loc, "sampler binding not less than gl_MaxCombinedTextureImageUnits", "binding", type.isArray() ? "(using array)" : ""); } if (type.getBasicType() == EbtAtomicUint) { @@ -4620,12 +4757,23 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) return; } } - } + } else if (!intermediate.getAutoMapBindings()) { + // some types require bindings - // atomic_uint - if (type.getBasicType() == EbtAtomicUint) { - if (! type.getQualifier().hasBinding()) + // atomic_uint + if (type.getBasicType() == EbtAtomicUint) error(loc, "layout(binding=X) is required", "atomic_uint", ""); + + // SPIR-V + if (spvVersion.spv > 0) { + if (qualifier.isUniformOrBuffer()) { + if (type.getBasicType() == EbtBlock && !qualifier.layoutPushConstant && + !qualifier.layoutAttachment) + error(loc, "uniform/buffer blocks require layout(binding=X)", "binding", ""); + else if (spvVersion.vulkan > 0 && type.getBasicType() == EbtSampler) + error(loc, "sampler/texture/image requires layout(binding=X)", "binding", ""); + } + } } // "The offset qualifier can only be used on block members of blocks..." @@ -4681,20 +4829,18 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) error(loc, "can only be applied to a scalar", "constant_id", ""); switch (type.getBasicType()) { + case EbtInt8: + case EbtUint8: + case EbtInt16: + case EbtUint16: case EbtInt: case EbtUint: case EbtInt64: case EbtUint64: -#ifdef AMD_EXTENSIONS - case EbtInt16: - case EbtUint16: -#endif case EbtBool: case EbtFloat: case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif break; default: error(loc, "cannot be applied to this type", "constant_id", ""); @@ -4780,11 +4926,11 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier error(loc, "requires uniform or buffer storage qualifier", "binding", ""); } if (qualifier.hasStream()) { - if (qualifier.storage != EvqVaryingOut) + if (!qualifier.isPipeOutput()) error(loc, "can only be used on an output", "stream", ""); } if (qualifier.hasXfb()) { - if (qualifier.storage != EvqVaryingOut) + if (!qualifier.isPipeOutput()) error(loc, "can only be used on an output", "xfb layout qualifier", ""); } if (qualifier.hasUniformLayout()) { @@ -4860,7 +5006,7 @@ void TParseContext::fixOffset(const TSourceLoc& loc, TSymbol& symbol) // Check for overlap int numOffsets = 4; if (symbol.getType().isArray()) { - if (symbol.getType().isExplicitlySizedArray()) + if (symbol.getType().isSizedArray() && !symbol.getType().getArraySizes()->isInnerUnsized()) numOffsets *= symbol.getType().getCumulativeArraySize(); else { // "It is a compile-time error to declare an unsized array of atomic_uint." @@ -4891,10 +5037,21 @@ const TFunction* TParseContext::findFunction(const TSourceLoc& loc, const TFunct return nullptr; } + bool explicitTypesEnabled = extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || + extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int8) || + extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int16) || + extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int32) || + extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int64) || + extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float16) || + extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float32) || + extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float64); + if (profile == EEsProfile || version < 120) function = findFunctionExact(loc, call, builtIn); else if (version < 400) function = findFunction120(loc, call, builtIn); + else if (explicitTypesEnabled) + function = findFunctionExplicitTypes(loc, call, builtIn); else function = findFunction400(loc, call, builtIn); @@ -5079,6 +5236,85 @@ const TFunction* TParseContext::findFunction400(const TSourceLoc& loc, const TFu return bestMatch; } +// "To determine whether the conversion for a single argument in one match +// is better than that for another match, the conversion is assigned of the +// three ranks ordered from best to worst: +// 1. Exact match: no conversion. +// 2. Promotion: integral or floating-point promotion. +// 3. Conversion: integral conversion, floating-point conversion, +// floating-integral conversion. +// A conversion C1 is better than a conversion C2 if the rank of C1 is +// better than the rank of C2." +const TFunction* TParseContext::findFunctionExplicitTypes(const TSourceLoc& loc, const TFunction& call, bool& builtIn) +{ + // first, look for an exact match + TSymbol* symbol = symbolTable.find(call.getMangledName(), &builtIn); + if (symbol) + return symbol->getAsFunction(); + + // no exact match, use the generic selector, parameterized by the GLSL rules + + // create list of candidates to send + TVector candidateList; + symbolTable.findFunctionNameList(call.getMangledName(), candidateList, builtIn); + + // can 'from' convert to 'to'? + const auto convertible = [this](const TType& from, const TType& to, TOperator, int) -> bool { + if (from == to) + return true; + if (from.isArray() || to.isArray() || ! from.sameElementShape(to)) + return false; + return intermediate.canImplicitlyPromote(from.getBasicType(), to.getBasicType()); + }; + + // Is 'to2' a better conversion than 'to1'? + // Ties should not be considered as better. + // Assumes 'convertible' already said true. + const auto better = [this](const TType& from, const TType& to1, const TType& to2) -> bool { + // 1. exact match + if (from == to2) + return from != to1; + if (from == to1) + return false; + + // 2. Promotion (integral, floating-point) is better + TBasicType from_type = from.getBasicType(); + TBasicType to1_type = to1.getBasicType(); + TBasicType to2_type = to2.getBasicType(); + bool isPromotion1 = (intermediate.isIntegralPromotion(from_type, to1_type) || + intermediate.isFPPromotion(from_type, to1_type)); + bool isPromotion2 = (intermediate.isIntegralPromotion(from_type, to2_type) || + intermediate.isFPPromotion(from_type, to2_type)); + if (isPromotion2) + return !isPromotion1; + if(isPromotion1) + return false; + + // 3. Conversion (integral, floating-point , floating-integral) + bool isConversion1 = (intermediate.isIntegralConversion(from_type, to1_type) || + intermediate.isFPConversion(from_type, to1_type) || + intermediate.isFPIntegralConversion(from_type, to1_type)); + bool isConversion2 = (intermediate.isIntegralConversion(from_type, to2_type) || + intermediate.isFPConversion(from_type, to2_type) || + intermediate.isFPIntegralConversion(from_type, to2_type)); + + return isConversion2 && !isConversion1; + }; + + // for ambiguity reporting + bool tie = false; + + // send to the generic selector + const TFunction* bestMatch = selectFunction(candidateList, call, convertible, better, tie); + + if (bestMatch == nullptr) + error(loc, "no matching overloaded function found", call.getName().c_str(), ""); + else if (tie) + error(loc, "ambiguous best function under implicit type conversion", call.getName().c_str(), ""); + + return bestMatch; +} + // When a declaration includes a type, but not a variable name, it can be // to establish defaults. void TParseContext::declareTypeDefaults(const TSourceLoc& loc, const TPublicType& publicType) @@ -5107,15 +5343,15 @@ void TParseContext::declareTypeDefaults(const TSourceLoc& loc, const TPublicType // 'publicType' is the type part of the declaration (to the left) // 'arraySizes' is the arrayness tagged on the identifier (to the right) // -TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& identifier, const TPublicType& publicType, TArraySizes* arraySizes, TIntermTyped* initializer) +TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& identifier, const TPublicType& publicType, + TArraySizes* arraySizes, TIntermTyped* initializer) { - TType type(publicType); // shallow copy; 'type' shares the arrayness and structure definition with 'publicType' - if (type.isImplicitlySizedArray()) { - // Because "int[] a = int[2](...), b = int[3](...)" makes two arrays a and b - // of different sizes, for this case sharing the shallow copy of arrayness - // with the publicType oversubscribes it, so get a deep copy of the arrayness. - type.newArraySizes(*publicType.arraySizes); - } + // Make a fresh type that combines the characteristics from the individual + // identifier syntax and the declaration-type syntax. + TType type(publicType); + type.transferArraySizes(arraySizes); + type.copyArrayInnerSizes(publicType.arraySizes); + arrayOfArrayVersionCheck(loc, type.getArraySizes()); if (voidErrorCheck(loc, identifier, type.getBasicType())) return nullptr; @@ -5142,15 +5378,9 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden inheritGlobalDefaults(type.getQualifier()); // Declare the variable - if (arraySizes || type.isArray()) { - // Arrayness is potentially coming both from the type and from the - // variable: "int[] a[];" or just one or the other. - // Merge it all to the type, so all arrayness is part of the type. - arrayDimCheck(loc, &type, arraySizes); - arrayDimMerge(type, arraySizes); - + if (type.isArray()) { // Check that implicit sizing is only where allowed. - arraySizesCheck(loc, type.getQualifier(), &type.getArraySizes(), initializer != nullptr, false); + arraySizesCheck(loc, type.getQualifier(), type.getArraySizes(), initializer != nullptr, false); if (! arrayQualifierError(loc, type.getQualifier()) && ! arrayError(loc, type)) declareArray(loc, identifier, type, symbol); @@ -5281,8 +5511,7 @@ TIntermNode* TParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyp } // Fix outer arrayness if variable is unsized, getting size from the initializer - if (initializer->getType().isExplicitlySizedArray() && - variable->getType().isImplicitlySizedArray()) + if (initializer->getType().isSizedArray() && variable->getType().isUnsizedArray()) variable->getWritableType().changeOuterArraySize(initializer->getType().getOuterArraySize()); // Inner arrayness can also get set by an initializer @@ -5291,8 +5520,10 @@ TIntermNode* TParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyp variable->getType().getArraySizes()->getNumDims()) { // adopt unsized sizes from the initializer's sizes for (int d = 1; d < variable->getType().getArraySizes()->getNumDims(); ++d) { - if (variable->getType().getArraySizes()->getDimSize(d) == UnsizedArraySize) - variable->getWritableType().getArraySizes().setDimSize(d, initializer->getType().getArraySizes()->getDimSize(d)); + if (variable->getType().getArraySizes()->getDimSize(d) == UnsizedArraySize) { + variable->getWritableType().getArraySizes()->setDimSize(d, + initializer->getType().getArraySizes()->getDimSize(d)); + } } } @@ -5403,16 +5634,16 @@ TIntermTyped* TParseContext::convertInitializerList(const TSourceLoc& loc, const // Later on, initializer execution code will deal with array size logic. TType arrayType; arrayType.shallowCopy(type); // sharing struct stuff is fine - arrayType.newArraySizes(*type.getArraySizes()); // but get a fresh copy of the array information, to edit below + arrayType.copyArraySizes(*type.getArraySizes()); // but get a fresh copy of the array information, to edit below // edit array sizes to fill in unsized dimensions arrayType.changeOuterArraySize((int)initList->getSequence().size()); TIntermTyped* firstInit = initList->getSequence()[0]->getAsTyped(); if (arrayType.isArrayOfArrays() && firstInit->getType().isArray() && - arrayType.getArraySizes().getNumDims() == firstInit->getType().getArraySizes()->getNumDims() + 1) { - for (int d = 1; d < arrayType.getArraySizes().getNumDims(); ++d) { - if (arrayType.getArraySizes().getDimSize(d) == UnsizedArraySize) - arrayType.getArraySizes().setDimSize(d, firstInit->getType().getArraySizes()->getDimSize(d - 1)); + arrayType.getArraySizes()->getNumDims() == firstInit->getType().getArraySizes()->getNumDims() + 1) { + for (int d = 1; d < arrayType.getArraySizes()->getNumDims(); ++d) { + if (arrayType.getArraySizes()->getDimSize(d) == UnsizedArraySize) + arrayType.getArraySizes()->setDimSize(d, firstInit->getType().getArraySizes()->getDimSize(d - 1)); } } @@ -5501,7 +5732,7 @@ TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode* bool singleArg; if (aggrNode) { - if (aggrNode->getOp() != EOpNull || aggrNode->getSequence().size() == 1) + if (aggrNode->getOp() != EOpNull) singleArg = true; else singleArg = false; @@ -5562,8 +5793,22 @@ TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode* // // Returns nullptr for an error or the constructed node. // -TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, TIntermTyped* node, const TSourceLoc& loc, bool subset) +TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, TIntermTyped* node, const TSourceLoc& loc, + bool subset) { + // If we are changing a matrix in both domain of basic type and to a non matrix, + // do the shape change first (by default, below, basic type is changed before shape). + // This avoids requesting a matrix of a new type that is going to be discarded anyway. + // TODO: This could be generalized to more type combinations, but that would require + // more extensive testing and full algorithm rework. For now, the need to do two changes makes + // the recursive call work, and avoids the most aggregious case of creating integer matrices. + if (node->getType().isMatrix() && (type.isScalar() || type.isVector()) && + type.isFloatingDomain() != node->getType().isFloatingDomain()) { + TType transitionType(node->getBasicType(), glslang::EvqTemporary, type.getVectorSize(), 0, 0, node->isVector()); + TOperator transitionOp = intermediate.mapTypeToConstructorOp(transitionType); + node = constructBuiltIn(transitionType, transitionOp, node, loc, false); + } + TIntermTyped* newNode; TOperator basicOp; @@ -5603,7 +5848,6 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T basicOp = EOpConstructDouble; break; -#ifdef AMD_EXTENSIONS case EOpConstructF16Vec2: case EOpConstructF16Vec3: case EOpConstructF16Vec4: @@ -5619,7 +5863,34 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T case EOpConstructFloat16: basicOp = EOpConstructFloat16; break; -#endif + + case EOpConstructI8Vec2: + case EOpConstructI8Vec3: + case EOpConstructI8Vec4: + case EOpConstructInt8: + basicOp = EOpConstructInt8; + break; + + case EOpConstructU8Vec2: + case EOpConstructU8Vec3: + case EOpConstructU8Vec4: + case EOpConstructUint8: + basicOp = EOpConstructUint8; + break; + + case EOpConstructI16Vec2: + case EOpConstructI16Vec3: + case EOpConstructI16Vec4: + case EOpConstructInt16: + basicOp = EOpConstructInt16; + break; + + case EOpConstructU16Vec2: + case EOpConstructU16Vec3: + case EOpConstructU16Vec4: + case EOpConstructUint16: + basicOp = EOpConstructUint16; + break; case EOpConstructIVec2: case EOpConstructIVec3: @@ -5649,22 +5920,6 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T basicOp = EOpConstructUint64; break; -#ifdef AMD_EXTENSIONS - case EOpConstructI16Vec2: - case EOpConstructI16Vec3: - case EOpConstructI16Vec4: - case EOpConstructInt16: - basicOp = EOpConstructInt16; - break; - - case EOpConstructU16Vec2: - case EOpConstructU16Vec3: - case EOpConstructU16Vec4: - case EOpConstructUint16: - basicOp = EOpConstructUint16; - break; -#endif - case EOpConstructBVec2: case EOpConstructBVec3: case EOpConstructBVec4: @@ -5672,6 +5927,11 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T basicOp = EOpConstructBool; break; + case EOpConstructNonuniform: + node->getWritableType().getQualifier().nonUniform = true; + return node; + break; + default: error(loc, "unsupported construction", "", ""); @@ -5716,13 +5976,14 @@ TIntermTyped* TParseContext::constructAggregate(TIntermNode* node, const TType& // // Do everything needed to add an interface block. // -void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, const TString* instanceName, TArraySizes* arraySizes) +void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, const TString* instanceName, + TArraySizes* arraySizes) { blockStageIoCheck(loc, currentBlockQualifier); blockQualifierCheck(loc, currentBlockQualifier, instanceName != nullptr); - if (arraySizes) { + if (arraySizes != nullptr) { arraySizesCheck(loc, currentBlockQualifier, arraySizes, false, false); - arrayDimCheck(loc, arraySizes, 0); + arrayOfArrayVersionCheck(loc, arraySizes); if (arraySizes->getNumDims() > 1) requireProfile(loc, ~EEsProfile, "array-of-array of block"); } @@ -5739,7 +6000,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con if ((currentBlockQualifier.storage == EvqUniform || currentBlockQualifier.storage == EvqBuffer) && (memberQualifier.isInterpolation() || memberQualifier.isAuxiliary())) error(memberLoc, "member of uniform or buffer block cannot have an auxiliary or interpolation qualifier", memberType.getFieldName().c_str(), ""); if (memberType.isArray()) - arraySizesCheck(memberLoc, currentBlockQualifier, &memberType.getArraySizes(), false, member == typeList.size() - 1); + arraySizesCheck(memberLoc, currentBlockQualifier, memberType.getArraySizes(), false, member == typeList.size() - 1); if (memberQualifier.hasOffset()) { if (spvVersion.spv == 0) { requireProfile(memberLoc, ~EEsProfile, "offset on block member"); @@ -5861,8 +6122,8 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con // TType blockType(&typeList, *blockName, currentBlockQualifier); - if (arraySizes) - blockType.newArraySizes(*arraySizes); + if (arraySizes != nullptr) + blockType.transferArraySizes(arraySizes); else ioArrayCheck(loc, blockType, instanceName ? *instanceName : *blockName); @@ -6029,7 +6290,8 @@ void TParseContext::fixBlockLocations(const TSourceLoc& loc, TQualifier& qualifi memberQualifier.layoutLocation = nextLocation; memberQualifier.layoutComponent = TQualifier::layoutComponentEnd; } - nextLocation = memberQualifier.layoutLocation + intermediate.computeTypeLocationSize(*typeList[member].type); + nextLocation = memberQualifier.layoutLocation + intermediate.computeTypeLocationSize( + *typeList[member].type, language); } } } diff --git a/deps/glslang/glslang/MachineIndependent/ParseHelper.h b/deps/glslang/glslang/MachineIndependent/ParseHelper.h index d04607a0..21779c71 100644 --- a/deps/glslang/glslang/MachineIndependent/ParseHelper.h +++ b/deps/glslang/glslang/MachineIndependent/ParseHelper.h @@ -44,13 +44,15 @@ #ifndef _PARSER_HELPER_INCLUDED_ #define _PARSER_HELPER_INCLUDED_ +#include +#include + #include "parseVersions.h" #include "../Include/ShHandle.h" #include "SymbolTable.h" #include "localintermediate.h" #include "Scan.h" -#include -#include +#include "attribute.h" namespace glslang { @@ -74,7 +76,8 @@ class TParseContextBase : public TParseVersions { public: TParseContextBase(TSymbolTable& symbolTable, TIntermediate& interm, bool parsingBuiltins, int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, - TInfoSink& infoSink, bool forwardCompatible, EShMessages messages) + TInfoSink& infoSink, bool forwardCompatible, EShMessages messages, + const TString* entryPoint = nullptr) : TParseVersions(interm, version, profile, spvVersion, language, infoSink, forwardCompatible, messages), scopeMangler("::"), symbolTable(symbolTable), @@ -83,8 +86,13 @@ class TParseContextBase : public TParseVersions { contextPragma(true, false), parsingBuiltins(parsingBuiltins), scanContext(nullptr), ppContext(nullptr), limits(resources.limits), - globalUniformBlock(nullptr) - { } + globalUniformBlock(nullptr), + globalUniformBinding(TQualifier::layoutBindingEnd), + globalUniformSet(TQualifier::layoutSetEnd) + { + if (entryPoint != nullptr) + sourceEntryPointName = *entryPoint; + } virtual ~TParseContextBase() { } virtual void C_DECL error(const TSourceLoc&, const char* szReason, const char* szToken, @@ -98,6 +106,8 @@ class TParseContextBase : public TParseVersions { virtual void setLimits(const TBuiltInResource&) = 0; + void checkIndex(const TSourceLoc&, const TType&, int& index); + EShLanguage getLanguage() const { return language; } void setScanContext(TScanContext* c) { scanContext = c; } TScanContext* getScanContext() const { return scanContext; } @@ -141,6 +151,15 @@ class TParseContextBase : public TParseVersions { // Manage the global uniform block (default uniforms in GLSL, $Global in HLSL) virtual void growGlobalUniformBlock(const TSourceLoc&, TType&, const TString& memberName, TTypeList* typeList = nullptr); + // Potentially rename shader entry point function + void renameShaderFunction(TString*& name) const + { + // Replace the entry point name given in the shader with the real entry point name, + // if there is a substitution. + if (name != nullptr && *name == sourceEntryPointName && intermediate.getEntryPointName().size() > 0) + name = NewPoolTString(intermediate.getEntryPointName().c_str()); + } + virtual bool lValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*); virtual void rValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*); @@ -168,11 +187,12 @@ class TParseContextBase : public TParseVersions { TParseContextBase& operator=(TParseContextBase&); const bool parsingBuiltins; // true if parsing built-in symbols/functions - TVector linkageSymbols; // these need to be transferred to 'linkage', after all editing is done + TVector linkageSymbols; // will be transferred to 'linkage', after all editing is done, order preserving TScanContext* scanContext; TPpContext* ppContext; TBuiltInResource resources; TLimits& limits; + TString sourceEntryPointName; // These, if set, will be called when a line, pragma ... is preprocessed. // They will be called with any parameters to the original directive. @@ -192,8 +212,10 @@ class TParseContextBase : public TParseVersions { TSwizzleSelectors&); // Manage the global uniform block (default uniforms in GLSL, $Global in HLSL) - TVariable* globalUniformBlock; // the actual block, inserted into the symbol table - int firstNewMember; // the index of the first member not yet inserted into the symbol table + TVariable* globalUniformBlock; // the actual block, inserted into the symbol table + unsigned int globalUniformBinding; // the block's binding number + unsigned int globalUniformSet; // the block's set number + int firstNewMember; // the index of the first member not yet inserted into the symbol table // override this to set the language-specific name virtual const char* getGlobalUniformBlockName() const { return ""; } virtual void setUniformBlockDefaults(TType&) const { } @@ -249,7 +271,8 @@ class TPrecisionManager { class TParseContext : public TParseContextBase { public: TParseContext(TSymbolTable&, TIntermediate&, bool parsingBuiltins, int version, EProfile, const SpvVersion& spvVersion, EShLanguage, TInfoSink&, - bool forwardCompatible = false, EShMessages messages = EShMsgDefault); + bool forwardCompatible = false, EShMessages messages = EShMsgDefault, + const TString* entryPoint = nullptr); virtual ~TParseContext(); bool obeyPrecisionQualifiers() const { return precisionManager.respectingPrecisionQualifiers(); }; @@ -268,7 +291,6 @@ class TParseContext : public TParseContextBase { void handlePragma(const TSourceLoc&, const TVector&) override; TIntermTyped* handleVariable(const TSourceLoc&, TSymbol* symbol, const TString* string); TIntermTyped* handleBracketDereference(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index); - void checkIndex(const TSourceLoc&, const TType&, int& index); void handleIndexLimits(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index); void makeEditable(TSymbol*&) override; @@ -287,7 +309,7 @@ class TParseContext : public TParseContextBase { TFunction* handleFunctionDeclarator(const TSourceLoc&, TFunction& function, bool prototype); TIntermAggregate* handleFunctionDefinition(const TSourceLoc&, TFunction&); TIntermTyped* handleFunctionCall(const TSourceLoc&, TFunction*, TIntermNode*); - TIntermTyped* handleBuiltInFunctionCall(TSourceLoc, TIntermNode& arguments, const TFunction& function); + TIntermTyped* handleBuiltInFunctionCall(TSourceLoc, TIntermNode* arguments, const TFunction& function); void computeBuiltinPrecisions(TIntermTyped&, const TFunction&); TIntermNode* handleReturnValue(const TSourceLoc&, TIntermTyped*); void checkLocation(const TSourceLoc&, TOperator); @@ -318,17 +340,15 @@ class TParseContext : public TParseContextBase { bool arrayError(const TSourceLoc&, const TType&); void arraySizeRequiredCheck(const TSourceLoc&, const TArraySizes&); void structArrayCheck(const TSourceLoc&, const TType& structure); - void arraySizesCheck(const TSourceLoc&, const TQualifier&, const TArraySizes*, bool initializer, bool lastMember); - void arrayOfArrayVersionCheck(const TSourceLoc&); - void arrayDimCheck(const TSourceLoc&, const TArraySizes* sizes1, const TArraySizes* sizes2); - void arrayDimCheck(const TSourceLoc&, const TType*, const TArraySizes*); - void arrayDimMerge(TType& type, const TArraySizes* sizes); + void arraySizesCheck(const TSourceLoc&, const TQualifier&, TArraySizes*, bool initializer, bool lastMember); + void arrayOfArrayVersionCheck(const TSourceLoc&, const TArraySizes*); bool voidErrorCheck(const TSourceLoc&, const TString&, TBasicType); void boolCheck(const TSourceLoc&, const TIntermTyped*); void boolCheck(const TSourceLoc&, const TPublicType&); void samplerCheck(const TSourceLoc&, const TType&, const TString& identifier, TIntermTyped* initializer); void atomicUintCheck(const TSourceLoc&, const TType&, const TString& identifier); void transparentOpaqueCheck(const TSourceLoc&, const TType&, const TString& identifier); + void memberQualifierCheck(glslang::TPublicType&); void globalQualifierFixCheck(const TSourceLoc&, TQualifier&); void globalQualifierTypeCheck(const TSourceLoc&, const TQualifier&, const TPublicType&); bool structQualifierErrorCheck(const TSourceLoc&, const TPublicType& pType); @@ -341,7 +361,7 @@ class TParseContext : public TParseContextBase { bool containsFieldWithBasicType(const TType& type ,TBasicType basicType); TSymbol* redeclareBuiltinVariable(const TSourceLoc&, const TString&, const TQualifier&, const TShaderQualifiers&); void redeclareBuiltinBlock(const TSourceLoc&, TTypeList& typeList, const TString& blockName, const TString* instanceName, TArraySizes* arraySizes); - void paramCheckFix(const TSourceLoc&, const TStorageQualifier&, TType& type); + void paramCheckFixStorage(const TSourceLoc&, const TStorageQualifier&, TType& type); void paramCheckFix(const TSourceLoc&, const TQualifier&, TType& type); void nestedBlockCheck(const TSourceLoc&); void nestedStructCheck(const TSourceLoc&); @@ -370,6 +390,7 @@ class TParseContext : public TParseContextBase { const TFunction* findFunctionExact(const TSourceLoc& loc, const TFunction& call, bool& builtIn); const TFunction* findFunction120(const TSourceLoc& loc, const TFunction& call, bool& builtIn); const TFunction* findFunction400(const TSourceLoc& loc, const TFunction& call, bool& builtIn); + const TFunction* findFunctionExplicitTypes(const TSourceLoc& loc, const TFunction& call, bool& builtIn); void declareTypeDefaults(const TSourceLoc&, const TPublicType&); TIntermNode* declareVariable(const TSourceLoc&, TString& identifier, const TPublicType&, TArraySizes* typeArray = 0, TIntermTyped* initializer = 0); TIntermTyped* addConstructor(const TSourceLoc&, TIntermNode*, const TType&); @@ -388,7 +409,17 @@ class TParseContext : public TParseContextBase { void wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode); TIntermNode* addSwitch(const TSourceLoc&, TIntermTyped* expression, TIntermAggregate* body); - void updateImplicitArraySize(const TSourceLoc&, TIntermNode*, int index); + TAttributeType attributeFromName(const TString& name) const; + TAttributes* makeAttributes(const TString& identifier) const; + TAttributes* makeAttributes(const TString& identifier, TIntermNode* node) const; + TAttributes* mergeAttributes(TAttributes*, TAttributes*) const; + + // Determine selection control from attributes + void handleSelectionAttributes(const TAttributes& attributes, TIntermNode*); + void handleSwitchAttributes(const TAttributes& attributes, TIntermNode*); + + // Determine loop control from attributes + void handleLoopAttributes(const TAttributes& attributes, TIntermNode*); protected: void nonInitConstCheck(const TSourceLoc&, TString& identifier, TType& type); @@ -396,6 +427,8 @@ class TParseContext : public TParseContextBase { TVariable* makeInternalVariable(const char* name, const TType&) const; TVariable* declareNonArray(const TSourceLoc&, const TString& identifier, const TType&); void declareArray(const TSourceLoc&, const TString& identifier, const TType&, TSymbol*&); + void checkRuntimeSizable(const TSourceLoc&, const TIntermTyped&); + bool isRuntimeLength(const TIntermTyped&) const; TIntermNode* executeInitializer(const TSourceLoc&, TIntermTyped* initializer, TVariable* variable); TIntermTyped* convertInitializerList(const TSourceLoc&, const TType&, TIntermTyped* initializer); void finish() override; diff --git a/deps/glslang/glslang/MachineIndependent/PoolAlloc.cpp b/deps/glslang/glslang/MachineIndependent/PoolAlloc.cpp index 4007c386..84c40f4e 100644 --- a/deps/glslang/glslang/MachineIndependent/PoolAlloc.cpp +++ b/deps/glslang/glslang/MachineIndependent/PoolAlloc.cpp @@ -40,35 +40,22 @@ namespace glslang { +// Process-wide TLS index OS_TLSIndex PoolIndex; -void InitializeMemoryPools() +// Return the thread-specific current pool. +TPoolAllocator& GetThreadPoolAllocator() { - TThreadMemoryPools* pools = static_cast(OS_GetTLSValue(PoolIndex)); - if (pools) - return; - - TPoolAllocator *threadPoolAllocator = new TPoolAllocator(); - - TThreadMemoryPools* threadData = new TThreadMemoryPools(); - - threadData->threadPoolAllocator = threadPoolAllocator; - - OS_SetTLSValue(PoolIndex, threadData); + return *static_cast(OS_GetTLSValue(PoolIndex)); } -void FreeGlobalPools() +// Set the thread-specific current pool. +void SetThreadPoolAllocator(TPoolAllocator* poolAllocator) { - // Release the allocated memory for this thread. - TThreadMemoryPools* globalPools = static_cast(OS_GetTLSValue(PoolIndex)); - if (! globalPools) - return; - - GetThreadPoolAllocator().popAll(); - delete &GetThreadPoolAllocator(); - delete globalPools; + OS_SetTLSValue(PoolIndex, poolAllocator); } +// Process-wide set up of the TLS pool storage. bool InitializePoolIndex() { // Allocate a TLS index. @@ -78,26 +65,6 @@ bool InitializePoolIndex() return true; } -void FreePoolIndex() -{ - // Release the TLS index. - OS_FreeTLSIndex(PoolIndex); -} - -TPoolAllocator& GetThreadPoolAllocator() -{ - TThreadMemoryPools* threadData = static_cast(OS_GetTLSValue(PoolIndex)); - - return *threadData->threadPoolAllocator; -} - -void SetThreadPoolAllocator(TPoolAllocator& poolAllocator) -{ - TThreadMemoryPools* threadData = static_cast(OS_GetTLSValue(PoolIndex)); - - threadData->threadPoolAllocator = &poolAllocator; -} - // // Implement the functionality of the TPoolAllocator class, which // is documented in PoolAlloc.h. @@ -234,13 +201,16 @@ void TPoolAllocator::pop() currentPageOffset = stack.back().offset; while (inUseList != page) { - // invoke destructor to free allocation list - inUseList->~tHeader(); - tHeader* nextInUse = inUseList->nextPage; - if (inUseList->pageCount > 1) + size_t pageCount = inUseList->pageCount; + + // This technically ends the lifetime of the header as C++ object, + // but we will still control the memory and reuse it. + inUseList->~tHeader(); // currently, just a debug allocation checker + + if (pageCount > 1) { delete [] reinterpret_cast(inUseList); - else { + } else { inUseList->nextPage = freeList; freeList = inUseList; } diff --git a/deps/glslang/glslang/MachineIndependent/Scan.cpp b/deps/glslang/glslang/MachineIndependent/Scan.cpp index 25122eec..7232baeb 100644 --- a/deps/glslang/glslang/MachineIndependent/Scan.cpp +++ b/deps/glslang/glslang/MachineIndependent/Scan.cpp @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -45,6 +46,7 @@ #include "../Include/Types.h" #include "SymbolTable.h" #include "ParseHelper.h" +#include "attribute.h" #include "glslang_tab.cpp.h" #include "ScanContext.h" #include "Scan.h" @@ -339,6 +341,7 @@ void TScanContext::fillInKeywordMap() (*KeywordMap)["const"] = CONST; (*KeywordMap)["uniform"] = UNIFORM; + (*KeywordMap)["nonuniformEXT"] = NONUNIFORM; (*KeywordMap)["in"] = IN; (*KeywordMap)["out"] = OUT; (*KeywordMap)["inout"] = INOUT; @@ -463,16 +466,34 @@ void TScanContext::fillInKeywordMap() (*KeywordMap)["u64vec3"] = U64VEC3; (*KeywordMap)["u64vec4"] = U64VEC4; -#ifdef AMD_EXTENSIONS + // GL_KHX_shader_explicit_arithmetic_types + (*KeywordMap)["int8_t"] = INT8_T; + (*KeywordMap)["i8vec2"] = I8VEC2; + (*KeywordMap)["i8vec3"] = I8VEC3; + (*KeywordMap)["i8vec4"] = I8VEC4; + (*KeywordMap)["uint8_t"] = UINT8_T; + (*KeywordMap)["u8vec2"] = U8VEC2; + (*KeywordMap)["u8vec3"] = U8VEC3; + (*KeywordMap)["u8vec4"] = U8VEC4; + (*KeywordMap)["int16_t"] = INT16_T; - (*KeywordMap)["uint16_t"] = UINT16_T; (*KeywordMap)["i16vec2"] = I16VEC2; (*KeywordMap)["i16vec3"] = I16VEC3; (*KeywordMap)["i16vec4"] = I16VEC4; + (*KeywordMap)["uint16_t"] = UINT16_T; (*KeywordMap)["u16vec2"] = U16VEC2; (*KeywordMap)["u16vec3"] = U16VEC3; (*KeywordMap)["u16vec4"] = U16VEC4; + (*KeywordMap)["int32_t"] = INT32_T; + (*KeywordMap)["i32vec2"] = I32VEC2; + (*KeywordMap)["i32vec3"] = I32VEC3; + (*KeywordMap)["i32vec4"] = I32VEC4; + (*KeywordMap)["uint32_t"] = UINT32_T; + (*KeywordMap)["u32vec2"] = U32VEC2; + (*KeywordMap)["u32vec3"] = U32VEC3; + (*KeywordMap)["u32vec4"] = U32VEC4; + (*KeywordMap)["float16_t"] = FLOAT16_T; (*KeywordMap)["f16vec2"] = F16VEC2; (*KeywordMap)["f16vec3"] = F16VEC3; @@ -489,7 +510,39 @@ void TScanContext::fillInKeywordMap() (*KeywordMap)["f16mat4x2"] = F16MAT4X2; (*KeywordMap)["f16mat4x3"] = F16MAT4X3; (*KeywordMap)["f16mat4x4"] = F16MAT4X4; -#endif + + (*KeywordMap)["float32_t"] = FLOAT32_T; + (*KeywordMap)["f32vec2"] = F32VEC2; + (*KeywordMap)["f32vec3"] = F32VEC3; + (*KeywordMap)["f32vec4"] = F32VEC4; + (*KeywordMap)["f32mat2"] = F32MAT2; + (*KeywordMap)["f32mat3"] = F32MAT3; + (*KeywordMap)["f32mat4"] = F32MAT4; + (*KeywordMap)["f32mat2x2"] = F32MAT2X2; + (*KeywordMap)["f32mat2x3"] = F32MAT2X3; + (*KeywordMap)["f32mat2x4"] = F32MAT2X4; + (*KeywordMap)["f32mat3x2"] = F32MAT3X2; + (*KeywordMap)["f32mat3x3"] = F32MAT3X3; + (*KeywordMap)["f32mat3x4"] = F32MAT3X4; + (*KeywordMap)["f32mat4x2"] = F32MAT4X2; + (*KeywordMap)["f32mat4x3"] = F32MAT4X3; + (*KeywordMap)["f32mat4x4"] = F32MAT4X4; + (*KeywordMap)["float64_t"] = FLOAT64_T; + (*KeywordMap)["f64vec2"] = F64VEC2; + (*KeywordMap)["f64vec3"] = F64VEC3; + (*KeywordMap)["f64vec4"] = F64VEC4; + (*KeywordMap)["f64mat2"] = F64MAT2; + (*KeywordMap)["f64mat3"] = F64MAT3; + (*KeywordMap)["f64mat4"] = F64MAT4; + (*KeywordMap)["f64mat2x2"] = F64MAT2X2; + (*KeywordMap)["f64mat2x3"] = F64MAT2X3; + (*KeywordMap)["f64mat2x4"] = F64MAT2X4; + (*KeywordMap)["f64mat3x2"] = F64MAT3X2; + (*KeywordMap)["f64mat3x3"] = F64MAT3X3; + (*KeywordMap)["f64mat3x4"] = F64MAT3X4; + (*KeywordMap)["f64mat4x2"] = F64MAT4X2; + (*KeywordMap)["f64mat4x3"] = F64MAT4X3; + (*KeywordMap)["f64mat4x4"] = F64MAT4X4; (*KeywordMap)["sampler2D"] = SAMPLER2D; (*KeywordMap)["samplerCube"] = SAMPLERCUBE; @@ -578,6 +631,54 @@ void TScanContext::fillInKeywordMap() (*KeywordMap)["usubpassInput"] = USUBPASSINPUT; (*KeywordMap)["usubpassInputMS"] = USUBPASSINPUTMS; +#ifdef AMD_EXTENSIONS + (*KeywordMap)["f16sampler1D"] = F16SAMPLER1D; + (*KeywordMap)["f16sampler2D"] = F16SAMPLER2D; + (*KeywordMap)["f16sampler3D"] = F16SAMPLER3D; + (*KeywordMap)["f16sampler2DRect"] = F16SAMPLER2DRECT; + (*KeywordMap)["f16samplerCube"] = F16SAMPLERCUBE; + (*KeywordMap)["f16sampler1DArray"] = F16SAMPLER1DARRAY; + (*KeywordMap)["f16sampler2DArray"] = F16SAMPLER2DARRAY; + (*KeywordMap)["f16samplerCubeArray"] = F16SAMPLERCUBEARRAY; + (*KeywordMap)["f16samplerBuffer"] = F16SAMPLERBUFFER; + (*KeywordMap)["f16sampler2DMS"] = F16SAMPLER2DMS; + (*KeywordMap)["f16sampler2DMSArray"] = F16SAMPLER2DMSARRAY; + (*KeywordMap)["f16sampler1DShadow"] = F16SAMPLER1DSHADOW; + (*KeywordMap)["f16sampler2DShadow"] = F16SAMPLER2DSHADOW; + (*KeywordMap)["f16sampler2DRectShadow"] = F16SAMPLER2DRECTSHADOW; + (*KeywordMap)["f16samplerCubeShadow"] = F16SAMPLERCUBESHADOW; + (*KeywordMap)["f16sampler1DArrayShadow"] = F16SAMPLER1DARRAYSHADOW; + (*KeywordMap)["f16sampler2DArrayShadow"] = F16SAMPLER2DARRAYSHADOW; + (*KeywordMap)["f16samplerCubeArrayShadow"] = F16SAMPLERCUBEARRAYSHADOW; + + (*KeywordMap)["f16image1D"] = F16IMAGE1D; + (*KeywordMap)["f16image2D"] = F16IMAGE2D; + (*KeywordMap)["f16image3D"] = F16IMAGE3D; + (*KeywordMap)["f16image2DRect"] = F16IMAGE2DRECT; + (*KeywordMap)["f16imageCube"] = F16IMAGECUBE; + (*KeywordMap)["f16image1DArray"] = F16IMAGE1DARRAY; + (*KeywordMap)["f16image2DArray"] = F16IMAGE2DARRAY; + (*KeywordMap)["f16imageCubeArray"] = F16IMAGECUBEARRAY; + (*KeywordMap)["f16imageBuffer"] = F16IMAGEBUFFER; + (*KeywordMap)["f16image2DMS"] = F16IMAGE2DMS; + (*KeywordMap)["f16image2DMSArray"] = F16IMAGE2DMSARRAY; + + (*KeywordMap)["f16texture1D"] = F16TEXTURE1D; + (*KeywordMap)["f16texture2D"] = F16TEXTURE2D; + (*KeywordMap)["f16texture3D"] = F16TEXTURE3D; + (*KeywordMap)["f16texture2DRect"] = F16TEXTURE2DRECT; + (*KeywordMap)["f16textureCube"] = F16TEXTURECUBE; + (*KeywordMap)["f16texture1DArray"] = F16TEXTURE1DARRAY; + (*KeywordMap)["f16texture2DArray"] = F16TEXTURE2DARRAY; + (*KeywordMap)["f16textureCubeArray"] = F16TEXTURECUBEARRAY; + (*KeywordMap)["f16textureBuffer"] = F16TEXTUREBUFFER; + (*KeywordMap)["f16texture2DMS"] = F16TEXTURE2DMS; + (*KeywordMap)["f16texture2DMSArray"] = F16TEXTURE2DMSARRAY; + + (*KeywordMap)["f16subpassInput"] = F16SUBPASSINPUT; + (*KeywordMap)["f16subpassInputMS"] = F16SUBPASSINPUTMS; +#endif + (*KeywordMap)["noperspective"] = NOPERSPECTIVE; (*KeywordMap)["smooth"] = SMOOTH; (*KeywordMap)["flat"] = FLAT; @@ -714,19 +815,15 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token) parseContext.error(loc, "not supported", "::", ""); break; - case PpAtomConstInt: parserToken->sType.lex.i = ppToken.ival; return INTCONSTANT; - case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT; - case PpAtomConstInt64: parserToken->sType.lex.i64 = ppToken.i64val; return INT64CONSTANT; - case PpAtomConstUint64: parserToken->sType.lex.i64 = ppToken.i64val; return UINT64CONSTANT; -#ifdef AMD_EXTENSIONS - case PpAtomConstInt16: parserToken->sType.lex.i = ppToken.ival; return INT16CONSTANT; - case PpAtomConstUint16: parserToken->sType.lex.i = ppToken.ival; return UINT16CONSTANT; -#endif - case PpAtomConstFloat: parserToken->sType.lex.d = ppToken.dval; return FLOATCONSTANT; - case PpAtomConstDouble: parserToken->sType.lex.d = ppToken.dval; return DOUBLECONSTANT; -#ifdef AMD_EXTENSIONS - case PpAtomConstFloat16: parserToken->sType.lex.d = ppToken.dval; return FLOAT16CONSTANT; -#endif + case PpAtomConstInt: parserToken->sType.lex.i = ppToken.ival; return INTCONSTANT; + case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT; + case PpAtomConstInt16: parserToken->sType.lex.i = ppToken.ival; return INT16CONSTANT; + case PpAtomConstUint16: parserToken->sType.lex.i = ppToken.ival; return UINT16CONSTANT; + case PpAtomConstInt64: parserToken->sType.lex.i64 = ppToken.i64val; return INT64CONSTANT; + case PpAtomConstUint64: parserToken->sType.lex.i64 = ppToken.i64val; return UINT64CONSTANT; + case PpAtomConstFloat: parserToken->sType.lex.d = ppToken.dval; return FLOATCONSTANT; + case PpAtomConstDouble: parserToken->sType.lex.d = ppToken.dval; return DOUBLECONSTANT; + case PpAtomConstFloat16: parserToken->sType.lex.d = ppToken.dval; return FLOAT16CONSTANT; case PpAtomIdentifier: { int token = tokenizeIdentifier(); @@ -777,6 +874,12 @@ int TScanContext::tokenizeIdentifier() case CASE: return keyword; + case NONUNIFORM: + if (parseContext.extensionTurnedOn(E_GL_EXT_nonuniform_qualifier)) + return keyword; + else + return identifierOrType(); + case SWITCH: case DEFAULT: if ((parseContext.profile == EEsProfile && parseContext.version < 300) || @@ -841,7 +944,8 @@ int TScanContext::tokenizeIdentifier() case VOLATILE: if (parseContext.profile == EEsProfile && parseContext.version >= 310) return keyword; - if (! parseContext.symbolTable.atBuiltInLevel() && (parseContext.profile == EEsProfile || (parseContext.version < 420 && ! parseContext.extensionTurnedOn(E_GL_ARB_shader_image_load_store)))) + if (! parseContext.symbolTable.atBuiltInLevel() && (parseContext.profile == EEsProfile || + (parseContext.version < 420 && ! parseContext.extensionTurnedOn(E_GL_ARB_shader_image_load_store)))) reservedWord(); return keyword; @@ -865,7 +969,7 @@ int TScanContext::tokenizeIdentifier() case PATCH: if (parseContext.symbolTable.atBuiltInLevel() || (parseContext.profile == EEsProfile && - (parseContext.version >= 320 || + (parseContext.version >= 320 || parseContext.extensionsTurnedOn(Num_AEP_tessellation_shader, AEP_tessellation_shader))) || (parseContext.profile != EEsProfile && parseContext.extensionTurnedOn(E_GL_ARB_tessellation_shader))) return keyword; @@ -985,12 +1089,29 @@ int TScanContext::tokenizeIdentifier() case U64VEC4: afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || - (parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_int64) && - parseContext.profile != EEsProfile && parseContext.version >= 450)) + (parseContext.profile != EEsProfile && parseContext.version >= 450 && + (parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_int64) || + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int64)))) + return keyword; + return identifierOrType(); + + case INT8_T: + case UINT8_T: + case I8VEC2: + case I8VEC3: + case I8VEC4: + case U8VEC2: + case U8VEC3: + case U8VEC4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + ((parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int8)) && + parseContext.profile != EEsProfile && parseContext.version >= 450)) return keyword; return identifierOrType(); -#ifdef AMD_EXTENSIONS case INT16_T: case UINT16_T: case I16VEC2: @@ -1001,10 +1122,77 @@ int TScanContext::tokenizeIdentifier() case U16VEC4: afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || - (parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_int16) && + (parseContext.profile != EEsProfile && parseContext.version >= 450 && + ( +#ifdef AMD_EXTENSIONS + parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_int16) || +#endif + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int16)))) + return keyword; + return identifierOrType(); + case INT32_T: + case UINT32_T: + case I32VEC2: + case I32VEC3: + case I32VEC4: + case U32VEC2: + case U32VEC3: + case U32VEC4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + ((parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int32)) && parseContext.profile != EEsProfile && parseContext.version >= 450)) return keyword; return identifierOrType(); + case FLOAT32_T: + case F32VEC2: + case F32VEC3: + case F32VEC4: + case F32MAT2: + case F32MAT3: + case F32MAT4: + case F32MAT2X2: + case F32MAT2X3: + case F32MAT2X4: + case F32MAT3X2: + case F32MAT3X3: + case F32MAT3X4: + case F32MAT4X2: + case F32MAT4X3: + case F32MAT4X4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + ((parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float32)) && + parseContext.profile != EEsProfile && parseContext.version >= 450)) + return keyword; + return identifierOrType(); + + case FLOAT64_T: + case F64VEC2: + case F64VEC3: + case F64VEC4: + case F64MAT2: + case F64MAT3: + case F64MAT4: + case F64MAT2X2: + case F64MAT2X3: + case F64MAT2X4: + case F64MAT3X2: + case F64MAT3X3: + case F64MAT3X4: + case F64MAT4X2: + case F64MAT4X3: + case F64MAT4X4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + ((parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float64)) && + parseContext.profile != EEsProfile && parseContext.version >= 450)) + return keyword; + return identifierOrType(); case FLOAT16_T: case F16VEC2: @@ -1024,11 +1212,16 @@ int TScanContext::tokenizeIdentifier() case F16MAT4X4: afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || - (parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float) && - parseContext.profile != EEsProfile && parseContext.version >= 450)) + (parseContext.profile != EEsProfile && parseContext.version >= 450 && + ( +#ifdef AMD_EXTENSIONS + parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float) || +#endif + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float16)))) return keyword; + return identifierOrType(); -#endif case SAMPLERCUBEARRAY: case SAMPLERCUBEARRAYSHADOW: @@ -1115,7 +1308,7 @@ int TScanContext::tokenizeIdentifier() case SAMPLER3D: afterType = true; if (parseContext.profile == EEsProfile && parseContext.version < 300) { - if (! parseContext.extensionTurnedOn(E_GL_OES_texture_3D)) + if (!parseContext.extensionTurnedOn(E_GL_OES_texture_3D)) reservedWord(); } return keyword; @@ -1152,7 +1345,9 @@ int TScanContext::tokenizeIdentifier() case SAMPLEREXTERNALOES: afterType = true; - if (parseContext.symbolTable.atBuiltInLevel() || parseContext.extensionTurnedOn(E_GL_OES_EGL_image_external)) + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_OES_EGL_image_external) || + parseContext.extensionTurnedOn(E_GL_OES_EGL_image_external_essl3)) return keyword; return identifierOrType(); @@ -1191,7 +1386,7 @@ int TScanContext::tokenizeIdentifier() case TEXTURE1DARRAY: case SAMPLER: case SAMPLERSHADOW: - if (parseContext.spvVersion.vulkan >= 100) + if (parseContext.spvVersion.vulkan > 0) return keyword; else return identifierOrType(); @@ -1202,12 +1397,71 @@ int TScanContext::tokenizeIdentifier() case ISUBPASSINPUTMS: case USUBPASSINPUT: case USUBPASSINPUTMS: - if (parseContext.spvVersion.vulkan >= 100) + if (parseContext.spvVersion.vulkan > 0) return keyword; else return identifierOrType(); +#ifdef AMD_EXTENSIONS + case F16SAMPLER1D: + case F16SAMPLER2D: + case F16SAMPLER3D: + case F16SAMPLER2DRECT: + case F16SAMPLERCUBE: + case F16SAMPLER1DARRAY: + case F16SAMPLER2DARRAY: + case F16SAMPLERCUBEARRAY: + case F16SAMPLERBUFFER: + case F16SAMPLER2DMS: + case F16SAMPLER2DMSARRAY: + case F16SAMPLER1DSHADOW: + case F16SAMPLER2DSHADOW: + case F16SAMPLER1DARRAYSHADOW: + case F16SAMPLER2DARRAYSHADOW: + case F16SAMPLER2DRECTSHADOW: + case F16SAMPLERCUBESHADOW: + case F16SAMPLERCUBEARRAYSHADOW: + + case F16IMAGE1D: + case F16IMAGE2D: + case F16IMAGE3D: + case F16IMAGE2DRECT: + case F16IMAGECUBE: + case F16IMAGE1DARRAY: + case F16IMAGE2DARRAY: + case F16IMAGECUBEARRAY: + case F16IMAGEBUFFER: + case F16IMAGE2DMS: + case F16IMAGE2DMSARRAY: + + case F16TEXTURE1D: + case F16TEXTURE2D: + case F16TEXTURE3D: + case F16TEXTURE2DRECT: + case F16TEXTURECUBE: + case F16TEXTURE1DARRAY: + case F16TEXTURE2DARRAY: + case F16TEXTURECUBEARRAY: + case F16TEXTUREBUFFER: + case F16TEXTURE2DMS: + case F16TEXTURE2DMSARRAY: + + case F16SUBPASSINPUT: + case F16SUBPASSINPUTMS: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + (parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float_fetch) && + parseContext.profile != EEsProfile && parseContext.version >= 450)) + return keyword; + return identifierOrType(); +#endif + case NOPERSPECTIVE: +#ifdef NV_EXTENSIONS + if (parseContext.profile == EEsProfile && parseContext.version >= 300 && + parseContext.extensionTurnedOn(E_GL_NV_shader_noperspective_interpolation)) + return keyword; +#endif return es30ReservedFromGLSL(130); case SMOOTH: @@ -1401,7 +1655,8 @@ int TScanContext::dMat() int TScanContext::firstGenerationImage(bool inEs310) { if (parseContext.symbolTable.atBuiltInLevel() || - (parseContext.profile != EEsProfile && (parseContext.version >= 420 || parseContext.extensionTurnedOn(E_GL_ARB_shader_image_load_store))) || + (parseContext.profile != EEsProfile && (parseContext.version >= 420 || + parseContext.extensionTurnedOn(E_GL_ARB_shader_image_load_store))) || (inEs310 && parseContext.profile == EEsProfile && parseContext.version >= 310)) return keyword; diff --git a/deps/glslang/glslang/MachineIndependent/Scan.h b/deps/glslang/glslang/MachineIndependent/Scan.h index 9b8f2d45..2c26c2ef 100644 --- a/deps/glslang/glslang/MachineIndependent/Scan.h +++ b/deps/glslang/glslang/MachineIndependent/Scan.h @@ -51,25 +51,24 @@ const int EndOfInput = -1; // class TInputScanner { public: - TInputScanner(int n, const char* const s[], size_t L[], const char* const* names = nullptr, int b = 0, int f = 0, bool single = false) : + TInputScanner(int n, const char* const s[], size_t L[], const char* const* names = nullptr, + int b = 0, int f = 0, bool single = false) : numSources(n), - sources(reinterpret_cast(s)), // up to this point, common usage is "char*", but now we need positive 8-bit characters - lengths(L), currentSource(0), currentChar(0), stringBias(b), finale(f), singleLogical(single), endOfFileReached(false) + // up to this point, common usage is "char*", but now we need positive 8-bit characters + sources(reinterpret_cast(s)), + lengths(L), currentSource(0), currentChar(0), stringBias(b), finale(f), singleLogical(single), + endOfFileReached(false) { loc = new TSourceLoc[numSources]; for (int i = 0; i < numSources; ++i) { - loc[i].init(); + loc[i].init(i - stringBias); } if (names != nullptr) { for (int i = 0; i < numSources; ++i) loc[i].name = names[i]; } - loc[currentSource].string = -stringBias; loc[currentSource].line = 1; - loc[currentSource].column = 0; - logicalSourceLoc.string = 0; - logicalSourceLoc.line = 1; - logicalSourceLoc.column = 0; + logicalSourceLoc.init(1); logicalSourceLoc.name = loc[0].name; } diff --git a/deps/glslang/glslang/MachineIndependent/ShaderLang.cpp b/deps/glslang/glslang/MachineIndependent/ShaderLang.cpp index 2a904f45..4f39f345 100644 --- a/deps/glslang/glslang/MachineIndependent/ShaderLang.cpp +++ b/deps/glslang/glslang/MachineIndependent/ShaderLang.cpp @@ -69,6 +69,10 @@ namespace { // anonymous namespace for file-local functions and symbols +// Total number of successful initializers of glslang: a refcount +// Shared global; access should be protected by a global mutex/critical section. +int NumberOfClients = 0; + using namespace glslang; // Create a language specific version of parseables. @@ -91,18 +95,16 @@ TParseContextBase* CreateParseContext(TSymbolTable& symbolTable, TIntermediate& int version, EProfile profile, EShSource source, EShLanguage language, TInfoSink& infoSink, SpvVersion spvVersion, bool forwardCompatible, EShMessages messages, - bool parsingBuiltIns, const std::string sourceEntryPointName = "") + bool parsingBuiltIns, std::string sourceEntryPointName = "") { -#ifndef ENABLE_HLSL - (void)sourceEntryPointName; // Unused argument. -#endif - switch (source) { - case EShSourceGlsl: - intermediate.setEntryPointName("main"); + case EShSourceGlsl: { + if (sourceEntryPointName.size() == 0) + intermediate.setEntryPointName("main"); + TString entryPoint = sourceEntryPointName.c_str(); return new TParseContext(symbolTable, intermediate, parsingBuiltIns, version, profile, spvVersion, - language, infoSink, forwardCompatible, messages); - + language, infoSink, forwardCompatible, messages, &entryPoint); + } #ifdef ENABLE_HLSL case EShSourceHlsl: return new HlslParseContext(symbolTable, intermediate, parsingBuiltIns, version, profile, spvVersion, @@ -219,7 +221,7 @@ enum EPrecisionClass { TSymbolTable* CommonSymbolTable[VersionCount][SpvVersionCount][ProfileCount][SourceCount][EPcCount] = {}; TSymbolTable* SharedSymbolTables[VersionCount][SpvVersionCount][ProfileCount][SourceCount][EShLangCount] = {}; -TPoolAllocator* PerProcessGPA = 0; +TPoolAllocator* PerProcessGPA = nullptr; // // Parse and add to the given symbol table the content of the given shader string. @@ -363,7 +365,7 @@ bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& inf // pool allocator intact, so: // - Switch to a new pool for parsing the built-ins // - Do the parsing, which builds the symbol table, using the new pool -// - Switch to the process-global pool to save a copy the resulting symbol table +// - Switch to the process-global pool to save a copy of the resulting symbol table // - Free up the new pool used to parse the built-ins // - Switch back to the original thread's pool // @@ -390,8 +392,8 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& sp // Switch to a new pool TPoolAllocator& previousAllocator = GetThreadPoolAllocator(); - TPoolAllocator* builtInPoolAllocator = new TPoolAllocator(); - SetThreadPoolAllocator(*builtInPoolAllocator); + TPoolAllocator* builtInPoolAllocator = new TPoolAllocator; + SetThreadPoolAllocator(builtInPoolAllocator); // Dynamically allocate the local symbol tables so we can control when they are deallocated WRT when the pool is popped. TSymbolTable* commonTable[EPcCount]; @@ -405,7 +407,7 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& sp InitializeSymbolTables(infoSink, commonTable, stageTables, version, profile, spvVersion, source); // Switch to the process-global pool - SetThreadPoolAllocator(*PerProcessGPA); + SetThreadPoolAllocator(PerProcessGPA); // Copy the local symbol tables from the new pool to the global tables using the process-global pool for (int precClass = 0; precClass < EPcCount; ++precClass) { @@ -432,7 +434,7 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& sp delete stageTables[stage]; delete builtInPoolAllocator; - SetThreadPoolAllocator(previousAllocator); + SetThreadPoolAllocator(&previousAllocator); glslang::ReleaseGlobalLock(); } @@ -576,7 +578,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo if (spvVersion.spv != 0) { switch (profile) { case EEsProfile: - if (spvVersion.vulkan >= 100 && version < 310) { + if (spvVersion.vulkan > 0 && version < 310) { correct = false; infoSink.info.message(EPrefixError, "#version: ES shaders for Vulkan SPIR-V require version 310 or higher"); version = 310; @@ -591,7 +593,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo infoSink.info.message(EPrefixError, "#version: compilation for SPIR-V does not support the compatibility profile"); break; default: - if (spvVersion.vulkan >= 100 && version < 140) { + if (spvVersion.vulkan > 0 && version < 140) { correct = false; infoSink.info.message(EPrefixError, "#version: Desktop shaders for Vulkan SPIR-V require version 140 or higher"); version = 140; @@ -617,9 +619,9 @@ void TranslateEnvironment(const TEnvironment* environment, EShMessages& messages { // Set up environmental defaults, first ignoring 'environment'. if (messages & EShMsgSpvRules) - spvVersion.spv = 0x00010000; + spvVersion.spv = EShTargetSpv_1_0; if (messages & EShMsgVulkanRules) { - spvVersion.vulkan = 100; + spvVersion.vulkan = EShTargetVulkan_1_0; spvVersion.vulkanGlsl = 100; } else if (spvVersion.spv != 0) spvVersion.openGl = 100; @@ -724,9 +726,6 @@ bool ProcessDeferred( const std::string sourceEntryPointName = "", const TEnvironment* environment = nullptr) // optional way of fully setting all versions, overriding the above { - if (! InitThread()) - return false; - // This must be undone (.pop()) by the caller, after it finishes consuming the created tree. GetThreadPoolAllocator().push(); @@ -745,9 +744,9 @@ bool ProcessDeferred( const int numPre = 2; const int numPost = requireNonempty? 1 : 0; const int numTotal = numPre + numStrings + numPost; - size_t* lengths = new size_t[numTotal]; - const char** strings = new const char*[numTotal]; - const char** names = new const char*[numTotal]; + std::unique_ptr lengths(new size_t[numTotal]); + std::unique_ptr strings(new const char*[numTotal]); + std::unique_ptr names(new const char*[numTotal]); for (int s = 0; s < numStrings; ++s) { strings[s + numPre] = shaderStrings[s]; if (inputLengths == nullptr || inputLengths[s] < 0) @@ -769,6 +768,8 @@ bool ProcessDeferred( SpvVersion spvVersion; EShLanguage stage = compiler->getLanguage(); TranslateEnvironment(environment, messages, source, stage, spvVersion); + if (environment != nullptr && environment->target.hlslFunctionality1) + intermediate.setHlslFunctionality1(); // First, without using the preprocessor or parser, find the #version, so we know what // symbol tables, processing rules, etc. to set up. This does not need the extra strings @@ -815,7 +816,7 @@ bool ProcessDeferred( intermediate.setProfile(profile); intermediate.setSpv(spvVersion); RecordProcesses(intermediate, messages, sourceEntryPointName); - if (spvVersion.vulkan >= 100) + if (spvVersion.vulkan > 0) intermediate.setOriginUpperLeft(); if ((messages & EShMsgHlslOffsets) || source == EShSourceHlsl) intermediate.setHlslOffsets(); @@ -833,25 +834,24 @@ bool ProcessDeferred( [stage]; // Dynamically allocate the symbol table so we can control when it is deallocated WRT the pool. - TSymbolTable* symbolTableMemory = new TSymbolTable; - TSymbolTable& symbolTable = *symbolTableMemory; + std::unique_ptr symbolTable(new TSymbolTable); if (cachedTable) - symbolTable.adoptLevels(*cachedTable); + symbolTable->adoptLevels(*cachedTable); // Add built-in symbols that are potentially context dependent; // they get popped again further down. - if (! AddContextSpecificSymbols(resources, compiler->infoSink, symbolTable, version, profile, spvVersion, - stage, source)) + if (! AddContextSpecificSymbols(resources, compiler->infoSink, *symbolTable, version, profile, spvVersion, + stage, source)) { return false; + } // // Now we can process the full shader under proper symbols and rules. // - TParseContextBase* parseContext = CreateParseContext(symbolTable, intermediate, version, profile, source, - stage, compiler->infoSink, - spvVersion, forwardCompatible, messages, false, sourceEntryPointName); - + std::unique_ptr parseContext(CreateParseContext(*symbolTable, intermediate, version, profile, source, + stage, compiler->infoSink, + spvVersion, forwardCompatible, messages, false, sourceEntryPointName)); TPpContext ppContext(*parseContext, names[numPre] ? names[numPre] : "", includer); // only GLSL (bison triggered, really) needs an externally set scan context @@ -887,23 +887,14 @@ bool ProcessDeferred( lengths[postIndex] = strlen(strings[numStrings + numPre]); names[postIndex] = nullptr; } - TInputScanner fullInput(numStrings + numPre + numPost, strings, lengths, names, numPre, numPost); + TInputScanner fullInput(numStrings + numPre + numPost, strings.get(), lengths.get(), names.get(), numPre, numPost); // Push a new symbol allocation scope that will get used for the shader's globals. - symbolTable.push(); + symbolTable->push(); bool success = processingContext(*parseContext, ppContext, fullInput, - versionWillBeError, symbolTable, + versionWillBeError, *symbolTable, intermediate, optLevel, messages); - - // Clean up the symbol table. The AST is self-sufficient now. - delete symbolTableMemory; - - delete parseContext; - delete [] lengths; - delete [] strings; - delete [] names; - return success; } @@ -913,7 +904,7 @@ bool ProcessDeferred( class SourceLineSynchronizer { public: SourceLineSynchronizer(const std::function& lastSourceIndex, - std::stringstream* output) + std::string* output) : getLastSourceIndex(lastSourceIndex), output(output), lastSource(-1), lastLine(0) {} // SourceLineSynchronizer(const SourceLineSynchronizer&) = delete; // SourceLineSynchronizer& operator=(const SourceLineSynchronizer&) = delete; @@ -928,7 +919,7 @@ class SourceLineSynchronizer { // used. We also need to output a newline to separate the output // from the previous source string (if there is one). if (lastSource != -1 || lastLine != 0) - *output << std::endl; + *output += '\n'; lastSource = getLastSourceIndex(); lastLine = -1; return true; @@ -943,7 +934,7 @@ class SourceLineSynchronizer { syncToMostRecentString(); const bool newLineStarted = lastLine < tokenLine; for (; lastLine < tokenLine; ++lastLine) { - if (lastLine > 0) *output << std::endl; + if (lastLine > 0) *output += '\n'; } return newLineStarted; } @@ -957,8 +948,8 @@ class SourceLineSynchronizer { // A function for getting the index of the last valid source string we've // read tokens from. const std::function getLastSourceIndex; - // output stream for newlines. - std::stringstream* output; + // output string for newlines. + std::string* output; // lastSource is the source string index (starting from 0) of the last token // processed. It is tracked in order for newlines to be inserted when a new // source string starts. -1 means we haven't started processing any source @@ -989,27 +980,33 @@ struct DoPreprocessing { parseContext.setScanner(&input); ppContext.setInput(input, versionWillBeError); - std::stringstream outputStream; + std::string outputBuffer; SourceLineSynchronizer lineSync( - std::bind(&TInputScanner::getLastValidSourceIndex, &input), &outputStream); + std::bind(&TInputScanner::getLastValidSourceIndex, &input), &outputBuffer); - parseContext.setExtensionCallback([&lineSync, &outputStream]( + parseContext.setExtensionCallback([&lineSync, &outputBuffer]( int line, const char* extension, const char* behavior) { lineSync.syncToLine(line); - outputStream << "#extension " << extension << " : " << behavior; + outputBuffer += "#extension "; + outputBuffer += extension; + outputBuffer += " : "; + outputBuffer += behavior; }); - parseContext.setLineCallback([&lineSync, &outputStream, &parseContext]( + parseContext.setLineCallback([&lineSync, &outputBuffer, &parseContext]( int curLineNum, int newLineNum, bool hasSource, int sourceNum, const char* sourceName) { // SourceNum is the number of the source-string that is being parsed. lineSync.syncToLine(curLineNum); - outputStream << "#line " << newLineNum; + outputBuffer += "#line "; + outputBuffer += std::to_string(newLineNum); if (hasSource) { - outputStream << " "; + outputBuffer += ' '; if (sourceName != nullptr) { - outputStream << "\"" << sourceName << "\""; + outputBuffer += '\"'; + outputBuffer += sourceName; + outputBuffer += '\"'; } else { - outputStream << sourceNum; + outputBuffer += std::to_string(sourceNum); } } if (parseContext.lineDirectiveShouldSetNextLine()) { @@ -1017,33 +1014,36 @@ struct DoPreprocessing { // directive. So the new line number for the current line is newLineNum -= 1; } - outputStream << std::endl; + outputBuffer += '\n'; // And we are at the next line of the #line directive now. lineSync.setLineNum(newLineNum + 1); }); parseContext.setVersionCallback( - [&lineSync, &outputStream](int line, int version, const char* str) { + [&lineSync, &outputBuffer](int line, int version, const char* str) { lineSync.syncToLine(line); - outputStream << "#version " << version; + outputBuffer += "#version "; + outputBuffer += std::to_string(version); if (str) { - outputStream << " " << str; + outputBuffer += ' '; + outputBuffer += str; } }); - parseContext.setPragmaCallback([&lineSync, &outputStream]( + parseContext.setPragmaCallback([&lineSync, &outputBuffer]( int line, const glslang::TVector& ops) { lineSync.syncToLine(line); - outputStream << "#pragma "; + outputBuffer += "#pragma "; for(size_t i = 0; i < ops.size(); ++i) { - outputStream << ops[i]; + outputBuffer += ops[i].c_str(); } }); - parseContext.setErrorCallback([&lineSync, &outputStream]( + parseContext.setErrorCallback([&lineSync, &outputBuffer]( int line, const char* errorMessage) { lineSync.syncToLine(line); - outputStream << "#error " << errorMessage; + outputBuffer += "#error "; + outputBuffer += errorMessage; }); int lastToken = EndOfInput; // lastToken records the last token processed. @@ -1059,7 +1059,7 @@ struct DoPreprocessing { // Don't emit whitespace onto empty lines. // Copy any whitespace characters at the start of a line // from the input to the output. - outputStream << std::string(ppToken.loc.column - 1, ' '); + outputBuffer += std::string(ppToken.loc.column - 1, ' '); } // Output a space in between tokens, but not at the start of a line, @@ -1069,13 +1069,13 @@ struct DoPreprocessing { (unNeededSpaceTokens.find((char)token) == std::string::npos) && (unNeededSpaceTokens.find((char)lastToken) == std::string::npos) && (noSpaceBeforeTokens.find((char)token) == std::string::npos)) { - outputStream << " "; + outputBuffer += ' '; } lastToken = token; - outputStream << ppToken.name; + outputBuffer += ppToken.name; } while (true); - outputStream << std::endl; - *outputString = outputStream.str(); + outputBuffer += '\n'; + *outputString = std::move(outputBuffer); bool success = true; if (parseContext.getNumErrors() > 0) { @@ -1198,7 +1198,11 @@ int ShInitialize() if (! InitProcess()) return 0; - if (! PerProcessGPA) + glslang::GetGlobalLock(); + ++NumberOfClients; + glslang::ReleaseGlobalLock(); + + if (PerProcessGPA == nullptr) PerProcessGPA = new TPoolAllocator(); glslang::TScanContext::fillInKeywordMap(); @@ -1264,6 +1268,14 @@ void ShDestruct(ShHandle handle) // int __fastcall ShFinalize() { + glslang::GetGlobalLock(); + --NumberOfClients; + assert(NumberOfClients >= 0); + bool finalize = NumberOfClients == 0; + glslang::ReleaseGlobalLock(); + if (! finalize) + return 1; + for (int version = 0; version < VersionCount; ++version) { for (int spvVersion = 0; spvVersion < SpvVersionCount; ++spvVersion) { for (int p = 0; p < ProfileCount; ++p) { @@ -1290,10 +1302,9 @@ int __fastcall ShFinalize() } } - if (PerProcessGPA) { - PerProcessGPA->popAll(); + if (PerProcessGPA != nullptr) { delete PerProcessGPA; - PerProcessGPA = 0; + PerProcessGPA = nullptr; } glslang::TScanContext::deleteKeywordMap(); @@ -1334,6 +1345,8 @@ int ShCompile( if (compiler == 0) return 0; + SetThreadPoolAllocator(compiler->getPool()); + compiler->infoSink.info.erase(); compiler->infoSink.debug.erase(); @@ -1391,6 +1404,8 @@ int ShLinkExt( TShHandleBase* base = reinterpret_cast(linkHandle); TLinker* linker = static_cast(base->getAsLinker()); + SetThreadPoolAllocator(linker->getPool()); + if (linker == 0) return 0; @@ -1425,9 +1440,6 @@ void ShSetEncryptionMethod(ShHandle handle) // const char* ShGetInfoLog(const ShHandle handle) { - if (!InitThread()) - return 0; - if (handle == 0) return 0; @@ -1451,9 +1463,6 @@ const char* ShGetInfoLog(const ShHandle handle) // const void* ShGetExecutable(const ShHandle handle) { - if (!InitThread()) - return 0; - if (handle == 0) return 0; @@ -1476,9 +1485,6 @@ const void* ShGetExecutable(const ShHandle handle) // int ShSetVirtualAttributeBindings(const ShHandle handle, const ShBindingTable* table) { - if (!InitThread()) - return 0; - if (handle == 0) return 0; @@ -1498,9 +1504,6 @@ int ShSetVirtualAttributeBindings(const ShHandle handle, const ShBindingTable* t // int ShSetFixedAttributeBindings(const ShHandle handle, const ShBindingTable* table) { - if (!InitThread()) - return 0; - if (handle == 0) return 0; @@ -1519,9 +1522,6 @@ int ShSetFixedAttributeBindings(const ShHandle handle, const ShBindingTable* tab // int ShExcludeAttributes(const ShHandle handle, int *attributes, int count) { - if (!InitThread()) - return 0; - if (handle == 0) return 0; @@ -1543,9 +1543,6 @@ int ShExcludeAttributes(const ShHandle handle, int *attributes, int count) // int ShGetUniformLocation(const ShHandle handle, const char* name) { - if (!InitThread()) - return 0; - if (handle == 0) return -1; @@ -1572,14 +1569,17 @@ namespace glslang { #include "../Include/revision.h" +#define QUOTE(s) #s +#define STR(n) QUOTE(n) + const char* GetEsslVersionString() { - return "OpenGL ES GLSL 3.00 glslang LunarG Khronos." GLSLANG_REVISION " " GLSLANG_DATE; + return "OpenGL ES GLSL 3.20 glslang Khronos. " STR(GLSLANG_MINOR_VERSION) "." STR(GLSLANG_PATCH_LEVEL); } const char* GetGlslVersionString() { - return "4.20 glslang LunarG Khronos." GLSLANG_REVISION " " GLSLANG_DATE; + return "4.60 glslang Khronos. " STR(GLSLANG_MINOR_VERSION) "." STR(GLSLANG_PATCH_LEVEL); } int GetKhronosToolId() @@ -1604,8 +1604,9 @@ class TDeferredCompiler : public TCompiler { }; TShader::TShader(EShLanguage s) - : pool(0), stage(s), lengths(nullptr), stringNames(nullptr), preamble("") + : stage(s), lengths(nullptr), stringNames(nullptr), preamble("") { + pool = new TPoolAllocator; infoSink = new TInfoSink; compiler = new TDeferredCompiler(stage, *infoSink); intermediate = new TIntermediate(s); @@ -1615,6 +1616,7 @@ TShader::TShader(EShLanguage s) environment.input.dialect = EShClientNone; environment.client.client = EShClientNone; environment.target.language = EShTargetNone; + environment.target.hlslFunctionality1 = false; } TShader::~TShader() @@ -1663,22 +1665,34 @@ void TShader::addProcesses(const std::vector& p) intermediate->addProcesses(p); } +// Set binding base for given resource type +void TShader::setShiftBinding(TResourceType res, unsigned int base) { + intermediate->setShiftBinding(res, base); +} + +// Set binding base for given resource type for a given binding set. +void TShader::setShiftBindingForSet(TResourceType res, unsigned int base, unsigned int set) { + intermediate->setShiftBindingForSet(res, base, set); +} + // Set binding base for sampler types -void TShader::setShiftSamplerBinding(unsigned int base) { intermediate->setShiftSamplerBinding(base); } +void TShader::setShiftSamplerBinding(unsigned int base) { setShiftBinding(EResSampler, base); } // Set binding base for texture types (SRV) -void TShader::setShiftTextureBinding(unsigned int base) { intermediate->setShiftTextureBinding(base); } +void TShader::setShiftTextureBinding(unsigned int base) { setShiftBinding(EResTexture, base); } // Set binding base for image types -void TShader::setShiftImageBinding(unsigned int base) { intermediate->setShiftImageBinding(base); } +void TShader::setShiftImageBinding(unsigned int base) { setShiftBinding(EResImage, base); } // Set binding base for uniform buffer objects (CBV) -void TShader::setShiftUboBinding(unsigned int base) { intermediate->setShiftUboBinding(base); } +void TShader::setShiftUboBinding(unsigned int base) { setShiftBinding(EResUbo, base); } // Synonym for setShiftUboBinding, to match HLSL language. -void TShader::setShiftCbufferBinding(unsigned int base) { intermediate->setShiftUboBinding(base); } +void TShader::setShiftCbufferBinding(unsigned int base) { setShiftBinding(EResUbo, base); } // Set binding base for UAV (unordered access view) -void TShader::setShiftUavBinding(unsigned int base) { intermediate->setShiftUavBinding(base); } +void TShader::setShiftUavBinding(unsigned int base) { setShiftBinding(EResUav, base); } // Set binding base for SSBOs -void TShader::setShiftSsboBinding(unsigned int base) { intermediate->setShiftSsboBinding(base); } +void TShader::setShiftSsboBinding(unsigned int base) { setShiftBinding(EResSsbo, base); } // Enables binding automapping using TIoMapper void TShader::setAutoMapBindings(bool map) { intermediate->setAutoMapBindings(map); } +// Enables position.Y output negation in vertex shader +void TShader::setInvertY(bool invert) { intermediate->setInvertY(invert); } // Fragile: currently within one stage: simple auto-assignment of location void TShader::setAutoMapLocations(bool map) { intermediate->setAutoMapLocations(map); } // See comment above TDefaultHlslIoMapper in iomapper.cpp: @@ -1698,9 +1712,8 @@ bool TShader::parse(const TBuiltInResource* builtInResources, int defaultVersion { if (! InitThread()) return false; + SetThreadPoolAllocator(pool); - pool = new TPoolAllocator(); - SetThreadPoolAllocator(*pool); if (! preamble) preamble = ""; @@ -1722,9 +1735,8 @@ bool TShader::preprocess(const TBuiltInResource* builtInResources, { if (! InitThread()) return false; + SetThreadPoolAllocator(pool); - pool = new TPoolAllocator(); - SetThreadPoolAllocator(*pool); if (! preamble) preamble = ""; @@ -1744,8 +1756,9 @@ const char* TShader::getInfoDebugLog() return infoSink->debug.c_str(); } -TProgram::TProgram() : pool(0), reflection(0), ioMapper(nullptr), linked(false) +TProgram::TProgram() : reflection(0), ioMapper(nullptr), linked(false) { + pool = new TPoolAllocator; infoSink = new TInfoSink; for (int s = 0; s < EShLangCount; ++s) { intermediate[s] = 0; @@ -1780,8 +1793,7 @@ bool TProgram::link(EShMessages messages) bool error = false; - pool = new TPoolAllocator(); - SetThreadPoolAllocator(*pool); + SetThreadPoolAllocator(pool); for (int s = 0; s < EShLangCount; ++s) { if (! linkStage((EShLanguage)s, messages)) @@ -1898,6 +1910,7 @@ const char* TProgram::getUniformBlockName(int index) const { return reflection int TProgram::getUniformBlockSize(int index) const { return reflection->getUniformBlock(index).size; } int TProgram::getUniformIndex(const char* name) const { return reflection->getIndex(name); } int TProgram::getUniformBinding(int index) const { return reflection->getUniform(index).getBinding(); } +int TProgram::getUniformBlockBinding(int index) const { return reflection->getUniformBlock(index).getBinding(); } int TProgram::getUniformBlockIndex(int index) const { return reflection->getUniform(index).index; } int TProgram::getUniformBlockCounterIndex(int index) const { return reflection->getUniformBlock(index).counterIndex; } int TProgram::getUniformType(int index) const { return reflection->getUniform(index).glDefineType; } diff --git a/deps/glslang/glslang/MachineIndependent/SymbolTable.cpp b/deps/glslang/glslang/MachineIndependent/SymbolTable.cpp index 233033e7..db46e107 100644 --- a/deps/glslang/glslang/MachineIndependent/SymbolTable.cpp +++ b/deps/glslang/glslang/MachineIndependent/SymbolTable.cpp @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -60,21 +61,22 @@ void TType::buildMangledName(TString& mangledName) const switch (basicType) { case EbtFloat: mangledName += 'f'; break; case EbtDouble: mangledName += 'd'; break; -#ifdef AMD_EXTENSIONS case EbtFloat16: mangledName += "f16"; break; -#endif case EbtInt: mangledName += 'i'; break; case EbtUint: mangledName += 'u'; break; - case EbtInt64: mangledName += "i64"; break; - case EbtUint64: mangledName += "u64"; break; -#ifdef AMD_EXTENSIONS + case EbtInt8: mangledName += "i8"; break; + case EbtUint8: mangledName += "u8"; break; case EbtInt16: mangledName += "i16"; break; case EbtUint16: mangledName += "u16"; break; -#endif + case EbtInt64: mangledName += "i64"; break; + case EbtUint64: mangledName += "u64"; break; case EbtBool: mangledName += 'b'; break; case EbtAtomicUint: mangledName += "au"; break; case EbtSampler: switch (sampler.type) { +#ifdef AMD_EXTENSIONS + case EbtFloat16: mangledName += "f16"; break; +#endif case EbtInt: mangledName += "i"; break; case EbtUint: mangledName += "u"; break; default: break; // some compilers want this diff --git a/deps/glslang/glslang/MachineIndependent/Versions.cpp b/deps/glslang/glslang/MachineIndependent/Versions.cpp index 531aa159..51b64308 100644 --- a/deps/glslang/glslang/MachineIndependent/Versions.cpp +++ b/deps/glslang/glslang/MachineIndependent/Versions.cpp @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -154,6 +155,7 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_OES_standard_derivatives] = EBhDisable; extensionBehavior[E_GL_EXT_frag_depth] = EBhDisable; extensionBehavior[E_GL_OES_EGL_image_external] = EBhDisable; + extensionBehavior[E_GL_OES_EGL_image_external_essl3] = EBhDisable; extensionBehavior[E_GL_EXT_shader_texture_lod] = EBhDisable; extensionBehavior[E_GL_EXT_shadow_samplers] = EBhDisable; extensionBehavior[E_GL_ARB_texture_rectangle] = EBhDisable; @@ -184,9 +186,20 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_ARB_post_depth_coverage] = EBhDisable; extensionBehavior[E_GL_ARB_shader_viewport_layer_array] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_basic] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_vote] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_arithmetic] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_ballot] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_shuffle] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_shuffle_relative] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_clustered] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_quad] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_non_constant_global_initializers] = EBhDisable; extensionBehavior[E_GL_EXT_shader_image_load_formatted] = EBhDisable; extensionBehavior[E_GL_EXT_post_depth_coverage] = EBhDisable; + extensionBehavior[E_GL_EXT_control_flow_attributes] = EBhDisable; + extensionBehavior[E_GL_EXT_nonuniform_qualifier] = EBhDisable; // #line and #include extensionBehavior[E_GL_GOOGLE_cpp_style_line_directive] = EBhDisable; @@ -201,6 +214,8 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_AMD_texture_gather_bias_lod] = EBhDisable; extensionBehavior[E_GL_AMD_gpu_shader_int16] = EBhDisable; extensionBehavior[E_GL_AMD_shader_image_load_store_lod] = EBhDisable; + extensionBehavior[E_GL_AMD_shader_fragment_mask] = EBhDisable; + extensionBehavior[E_GL_AMD_gpu_shader_half_float_fetch] = EBhDisable; #endif #ifdef NV_EXTENSIONS @@ -209,6 +224,10 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_NV_viewport_array2] = EBhDisable; extensionBehavior[E_GL_NV_stereo_view_rendering] = EBhDisable; extensionBehavior[E_GL_NVX_multiview_per_view_attributes] = EBhDisable; + extensionBehavior[E_GL_NV_shader_atomic_int64] = EBhDisable; + extensionBehavior[E_GL_NV_conservative_raster_underestimation] = EBhDisable; + extensionBehavior[E_GL_NV_shader_noperspective_interpolation] = EBhDisable; + extensionBehavior[E_GL_NV_shader_subgroup_partitioned] = EBhDisable; #endif // AEP @@ -246,6 +265,16 @@ void TParseVersions::initializeExtensionBehavior() // OVR extensions extensionBehavior[E_GL_OVR_multiview] = EBhDisable; extensionBehavior[E_GL_OVR_multiview2] = EBhDisable; + + // explicit types + extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types] = EBhDisable; + extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_int8] = EBhDisable; + extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_int16] = EBhDisable; + extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_int32] = EBhDisable; + extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_int64] = EBhDisable; + extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_float16] = EBhDisable; + extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_float32] = EBhDisable; + extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_float64] = EBhDisable; } // Get code that is not part of a shared symbol table, is specific to this shader, @@ -260,6 +289,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_OES_standard_derivatives 1\n" "#define GL_EXT_frag_depth 1\n" "#define GL_OES_EGL_image_external 1\n" + "#define GL_OES_EGL_image_external_essl3 1\n" "#define GL_EXT_shader_texture_lod 1\n" "#define GL_EXT_shadow_samplers 1\n" @@ -292,6 +322,13 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_OES_texture_cube_map_array 1\n" "#define GL_EXT_shader_non_constant_global_initializers 1\n" ; + +#ifdef NV_EXTENSIONS + if (profile == EEsProfile && version >= 300) { + preamble += "#define GL_NV_shader_noperspective_interpolation 1\n"; + } +#endif + } else { preamble = "#define GL_FRAGMENT_PRECISION_HIGH 1\n" @@ -323,6 +360,18 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_EXT_shader_non_constant_global_initializers 1\n" "#define GL_EXT_shader_image_load_formatted 1\n" "#define GL_EXT_post_depth_coverage 1\n" + "#define GL_EXT_control_flow_attributes 1\n" + "#define GL_EXT_nonuniform_qualifier 1\n" + + // GL_KHR_shader_subgroup + "#define GL_KHR_shader_subgroup_basic 1\n" + "#define GL_KHR_shader_subgroup_vote 1\n" + "#define GL_KHR_shader_subgroup_arithmetic 1\n" + "#define GL_KHR_shader_subgroup_ballot 1\n" + "#define GL_KHR_shader_subgroup_shuffle 1\n" + "#define GL_KHR_shader_subgroup_shuffle_relative 1\n" + "#define GL_KHR_shader_subgroup_clustered 1\n" + "#define GL_KHR_shader_subgroup_quad 1\n" #ifdef AMD_EXTENSIONS "#define GL_AMD_shader_ballot 1\n" @@ -333,13 +382,26 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_AMD_texture_gather_bias_lod 1\n" "#define GL_AMD_gpu_shader_int16 1\n" "#define GL_AMD_shader_image_load_store_lod 1\n" + "#define GL_AMD_shader_fragment_mask 1\n" + "#define GL_AMD_gpu_shader_half_float_fetch 1\n" #endif #ifdef NV_EXTENSIONS "#define GL_NV_sample_mask_override_coverage 1\n" "#define GL_NV_geometry_shader_passthrough 1\n" "#define GL_NV_viewport_array2 1\n" + "#define GL_NV_shader_atomic_int64 1\n" + "#define GL_NV_conservative_raster_underestimation 1\n" + "#define GL_NV_shader_subgroup_partitioned 1\n" #endif + "#define GL_KHX_shader_explicit_arithmetic_types 1\n" + "#define GL_KHX_shader_explicit_arithmetic_types_int8 1\n" + "#define GL_KHX_shader_explicit_arithmetic_types_int16 1\n" + "#define GL_KHX_shader_explicit_arithmetic_types_int32 1\n" + "#define GL_KHX_shader_explicit_arithmetic_types_int64 1\n" + "#define GL_KHX_shader_explicit_arithmetic_types_float16 1\n" + "#define GL_KHX_shader_explicit_arithmetic_types_float32 1\n" + "#define GL_KHX_shader_explicit_arithmetic_types_float64 1\n" ; if (version >= 150) { @@ -562,7 +624,8 @@ bool TParseVersions::checkExtensionsRequested(const TSourceLoc& loc, int numExte // void TParseVersions::requireExtensions(const TSourceLoc& loc, int numExtensions, const char* const extensions[], const char* featureDesc) { - if (checkExtensionsRequested(loc, numExtensions, extensions, featureDesc)) return; + if (checkExtensionsRequested(loc, numExtensions, extensions, featureDesc)) + return; // If we get this far, give errors explaining what extensions are needed if (numExtensions == 1) @@ -580,7 +643,8 @@ void TParseVersions::requireExtensions(const TSourceLoc& loc, int numExtensions, // void TParseVersions::ppRequireExtensions(const TSourceLoc& loc, int numExtensions, const char* const extensions[], const char* featureDesc) { - if (checkExtensionsRequested(loc, numExtensions, extensions, featureDesc)) return; + if (checkExtensionsRequested(loc, numExtensions, extensions, featureDesc)) + return; // If we get this far, give errors explaining what extensions are needed if (numExtensions == 1) @@ -618,7 +682,8 @@ bool TParseVersions::extensionTurnedOn(const char* const extension) bool TParseVersions::extensionsTurnedOn(int numExtensions, const char* const extensions[]) { for (int i = 0; i < numExtensions; ++i) { - if (extensionTurnedOn(extensions[i])) return true; + if (extensionTurnedOn(extensions[i])) + return true; } return false; } @@ -674,6 +739,25 @@ void TParseVersions::updateExtensionBehavior(int line, const char* extension, co updateExtensionBehavior(line, "GL_OES_shader_io_blocks", behaviorString); else if (strcmp(extension, "GL_GOOGLE_include_directive") == 0) updateExtensionBehavior(line, "GL_GOOGLE_cpp_style_line_directive", behaviorString); + // subgroup_* to subgroup_basic + else if (strcmp(extension, "GL_KHR_shader_subgroup_vote") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); + else if (strcmp(extension, "GL_KHR_shader_subgroup_arithmetic") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); + else if (strcmp(extension, "GL_KHR_shader_subgroup_ballot") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); + else if (strcmp(extension, "GL_KHR_shader_subgroup_shuffle") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); + else if (strcmp(extension, "GL_KHR_shader_subgroup_shuffle_relative") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); + else if (strcmp(extension, "GL_KHR_shader_subgroup_clustered") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); + else if (strcmp(extension, "GL_KHR_shader_subgroup_quad") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); +#ifdef NV_EXTENSIONS + else if (strcmp(extension, "GL_NV_shader_subgroup_partitioned") == 0) + updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString); +#endif } void TParseVersions::updateExtensionBehavior(const char* extension, TExtensionBehavior behavior) @@ -731,23 +815,71 @@ void TParseVersions::doubleCheck(const TSourceLoc& loc, const char* op) profileRequires(loc, ECompatibilityProfile, 400, nullptr, op); } -#ifdef AMD_EXTENSIONS -// Call for any operation needing GLSL 16-bit integer data-type support. -void TParseVersions::int16Check(const TSourceLoc& loc, const char* op, bool builtIn) +// Call for any operation needing GLSL float16 data-type support. +void TParseVersions::float16Check(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { +#if AMD_EXTENSIONS + const char* const extensions[3] = {E_GL_AMD_gpu_shader_half_float, + E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_float16}; + +#else + const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_float16}; +#endif + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, "explicit types"); + requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); + profileRequires(loc, ECoreProfile, 450, nullptr, op); + profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + } +} + +// Call for any operation needing GLSL float32 data-type support. +void TParseVersions::explicitFloat32Check(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_float32}; + requireExtensions(loc, 2, extensions, "explicit types"); + requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); + profileRequires(loc, ECoreProfile, 450, nullptr, op); + profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + } +} + +// Call for any operation needing GLSL float64 data-type support. +void TParseVersions::explicitFloat64Check(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_float64}; + requireExtensions(loc, 2, extensions, "explicit types"); + requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); + profileRequires(loc, ECoreProfile, 450, nullptr, op); + profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + } +} + +// Call for any operation needing GLSL explicit int8 data-type support. +void TParseVersions::explicitInt8Check(const TSourceLoc& loc, const char* op, bool builtIn) { if (! builtIn) { - requireExtensions(loc, 1, &E_GL_AMD_gpu_shader_int16, "shader int16"); + const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_int8}; + requireExtensions(loc, 2, extensions, "explicit types"); requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); profileRequires(loc, ECoreProfile, 450, nullptr, op); profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); } } -// Call for any operation needing GLSL float16 data-type support. -void TParseVersions::float16Check(const TSourceLoc& loc, const char* op, bool builtIn) +#ifdef AMD_EXTENSIONS +// Call for any operation needing GLSL float16 opaque-type support +void TParseVersions::float16OpaqueCheck(const TSourceLoc& loc, const char* op, bool builtIn) { if (! builtIn) { - requireExtensions(loc, 1, &E_GL_AMD_gpu_shader_half_float, "shader half float"); + requireExtensions(loc, 1, &E_GL_AMD_gpu_shader_half_float_fetch, op); requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); profileRequires(loc, ECoreProfile, 450, nullptr, op); profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); @@ -755,11 +887,46 @@ void TParseVersions::float16Check(const TSourceLoc& loc, const char* op, bool bu } #endif +// Call for any operation needing GLSL explicit int16 data-type support. +void TParseVersions::explicitInt16Check(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (! builtIn) { +#if AMD_EXTENSIONS + const char* const extensions[3] = {E_GL_AMD_gpu_shader_int16, + E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_int16}; +#else + const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_int16}; +#endif + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, "explicit types"); + requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); + profileRequires(loc, ECoreProfile, 450, nullptr, op); + profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + } +} + +// Call for any operation needing GLSL explicit int32 data-type support. +void TParseVersions::explicitInt32Check(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (! builtIn) { + const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_int32}; + requireExtensions(loc, 2, extensions, "explicit types"); + requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); + profileRequires(loc, ECoreProfile, 450, nullptr, op); + profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + } +} + // Call for any operation needing GLSL 64-bit integer data-type support. void TParseVersions::int64Check(const TSourceLoc& loc, const char* op, bool builtIn) { if (! builtIn) { - requireExtensions(loc, 1, &E_GL_ARB_gpu_shader_int64, "shader int64"); + const char* const extensions[3] = {E_GL_ARB_gpu_shader_int64, + E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_int64}; + requireExtensions(loc, 3, extensions, "shader int64"); requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); profileRequires(loc, ECoreProfile, 450, nullptr, op); profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); @@ -776,7 +943,7 @@ void TParseVersions::spvRemoved(const TSourceLoc& loc, const char* op) // Call for any operation removed because Vulkan SPIR-V is being generated. void TParseVersions::vulkanRemoved(const TSourceLoc& loc, const char* op) { - if (spvVersion.vulkan >= 100) + if (spvVersion.vulkan > 0) error(loc, "not allowed when using GLSL for Vulkan", op, ""); } diff --git a/deps/glslang/glslang/MachineIndependent/Versions.h b/deps/glslang/glslang/MachineIndependent/Versions.h index 78a9b286..b297d27b 100644 --- a/deps/glslang/glslang/MachineIndependent/Versions.h +++ b/deps/glslang/glslang/MachineIndependent/Versions.h @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -83,7 +84,7 @@ struct SpvVersion { SpvVersion() : spv(0), vulkanGlsl(0), vulkan(0), openGl(0) {} unsigned int spv; // the version of SPIR-V to target, as defined by "word 1" of the SPIR-V binary header int vulkanGlsl; // the version of GLSL semantics for Vulkan, from GL_KHR_vulkan_glsl, for "#define VULKAN XXX" - int vulkan; // the version of Vulkan, for which SPIR-V execution environment rules to use (100 means 1.0) + int vulkan; // the version of Vulkan, for which SPIR-V execution environment rules to use int openGl; // the version of GLSL semantics for OpenGL, from GL_ARB_gl_spirv, for "#define GL_SPIRV XXX" }; @@ -107,6 +108,7 @@ const char* const E_GL_OES_texture_3D = "GL_OES_texture_3D"; const char* const E_GL_OES_standard_derivatives = "GL_OES_standard_derivatives"; const char* const E_GL_EXT_frag_depth = "GL_EXT_frag_depth"; const char* const E_GL_OES_EGL_image_external = "GL_OES_EGL_image_external"; +const char* const E_GL_OES_EGL_image_external_essl3 = "GL_OES_EGL_image_external_essl3"; const char* const E_GL_EXT_shader_texture_lod = "GL_EXT_shader_texture_lod"; const char* const E_GL_EXT_shadow_samplers = "GL_EXT_shadow_samplers"; @@ -138,6 +140,15 @@ const char* const E_GL_ARB_shader_stencil_export = "GL_ARB_shader_stencil const char* const E_GL_ARB_post_depth_coverage = "GL_ARB_post_depth_coverage"; const char* const E_GL_ARB_shader_viewport_layer_array = "GL_ARB_shader_viewport_layer_array"; +const char* const E_GL_KHR_shader_subgroup_basic = "GL_KHR_shader_subgroup_basic"; +const char* const E_GL_KHR_shader_subgroup_vote = "GL_KHR_shader_subgroup_vote"; +const char* const E_GL_KHR_shader_subgroup_arithmetic = "GL_KHR_shader_subgroup_arithmetic"; +const char* const E_GL_KHR_shader_subgroup_ballot = "GL_KHR_shader_subgroup_ballot"; +const char* const E_GL_KHR_shader_subgroup_shuffle = "GL_KHR_shader_subgroup_shuffle"; +const char* const E_GL_KHR_shader_subgroup_shuffle_relative = "GL_KHR_shader_subgroup_shuffle_relative"; +const char* const E_GL_KHR_shader_subgroup_clustered = "GL_KHR_shader_subgroup_clustered"; +const char* const E_GL_KHR_shader_subgroup_quad = "GL_KHR_shader_subgroup_quad"; + const char* const E_GL_EXT_shader_non_constant_global_initializers = "GL_EXT_shader_non_constant_global_initializers"; const char* const E_GL_EXT_shader_image_load_formatted = "GL_EXT_shader_image_load_formatted"; @@ -145,6 +156,8 @@ const char* const E_GL_EXT_shader_image_load_formatted = "GL_EXT_shader_image_lo const char* const E_GL_EXT_device_group = "GL_EXT_device_group"; const char* const E_GL_EXT_multiview = "GL_EXT_multiview"; const char* const E_GL_EXT_post_depth_coverage = "GL_EXT_post_depth_coverage"; +const char* const E_GL_EXT_control_flow_attributes = "GL_EXT_control_flow_attributes"; +const char* const E_GL_EXT_nonuniform_qualifier = "GL_EXT_nonuniform_qualifier"; // Arrays of extensions for the above viewportEXTs duplications @@ -171,6 +184,8 @@ const char* const E_GL_AMD_gpu_shader_half_float = "GL_AMD_gpu_sh const char* const E_GL_AMD_texture_gather_bias_lod = "GL_AMD_texture_gather_bias_lod"; const char* const E_GL_AMD_gpu_shader_int16 = "GL_AMD_gpu_shader_int16"; const char* const E_GL_AMD_shader_image_load_store_lod = "GL_AMD_shader_image_load_store_lod"; +const char* const E_GL_AMD_shader_fragment_mask = "GL_AMD_shader_fragment_mask"; +const char* const E_GL_AMD_gpu_shader_half_float_fetch = "GL_AMD_gpu_shader_half_float_fetch"; #endif #ifdef NV_EXTENSIONS @@ -180,6 +195,10 @@ const char* const E_SPV_NV_geometry_shader_passthrough = "GL_NV_geometr const char* const E_GL_NV_viewport_array2 = "GL_NV_viewport_array2"; const char* const E_GL_NV_stereo_view_rendering = "GL_NV_stereo_view_rendering"; const char* const E_GL_NVX_multiview_per_view_attributes = "GL_NVX_multiview_per_view_attributes"; +const char* const E_GL_NV_shader_atomic_int64 = "GL_NV_shader_atomic_int64"; +const char* const E_GL_NV_conservative_raster_underestimation = "GL_NV_conservative_raster_underestimation"; +const char* const E_GL_NV_shader_noperspective_interpolation = "GL_NV_shader_noperspective_interpolation"; +const char* const E_GL_NV_shader_subgroup_partitioned = "GL_NV_shader_subgroup_partitioned"; // Arrays of extensions for the above viewportEXTs duplications @@ -215,6 +234,16 @@ const char* const E_GL_OES_tessellation_point_size = "GL_OES_tessel const char* const E_GL_OES_texture_buffer = "GL_OES_texture_buffer"; const char* const E_GL_OES_texture_cube_map_array = "GL_OES_texture_cube_map_array"; +// KHX +const char* const E_GL_KHX_shader_explicit_arithmetic_types = "GL_KHX_shader_explicit_arithmetic_types"; +const char* const E_GL_KHX_shader_explicit_arithmetic_types_int8 = "GL_KHX_shader_explicit_arithmetic_types_int8"; +const char* const E_GL_KHX_shader_explicit_arithmetic_types_int16 = "GL_KHX_shader_explicit_arithmetic_types_int16"; +const char* const E_GL_KHX_shader_explicit_arithmetic_types_int32 = "GL_KHX_shader_explicit_arithmetic_types_int32"; +const char* const E_GL_KHX_shader_explicit_arithmetic_types_int64 = "GL_KHX_shader_explicit_arithmetic_types_int64"; +const char* const E_GL_KHX_shader_explicit_arithmetic_types_float16 = "GL_KHX_shader_explicit_arithmetic_types_float16"; +const char* const E_GL_KHX_shader_explicit_arithmetic_types_float32 = "GL_KHX_shader_explicit_arithmetic_types_float32"; +const char* const E_GL_KHX_shader_explicit_arithmetic_types_float64 = "GL_KHX_shader_explicit_arithmetic_types_float64"; + // Arrays of extensions for the above AEP duplications const char* const AEP_geometry_shader[] = { E_GL_EXT_geometry_shader, E_GL_OES_geometry_shader }; diff --git a/deps/glslang/glslang/MachineIndependent/attribute.cpp b/deps/glslang/glslang/MachineIndependent/attribute.cpp new file mode 100644 index 00000000..73b665d8 --- /dev/null +++ b/deps/glslang/glslang/MachineIndependent/attribute.cpp @@ -0,0 +1,257 @@ +// +// Copyright (C) 2017 LunarG, Inc. +// Copyright (C) 2018 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "attribute.h" +#include "../Include/intermediate.h" +#include "ParseHelper.h" + +namespace glslang { + +// extract integers out of attribute arguments stored in attribute aggregate +bool TAttributeArgs::getInt(int& value, int argNum) const +{ + const TConstUnion* intConst = getConstUnion(EbtInt, argNum); + + if (intConst == nullptr) + return false; + + value = intConst->getIConst(); + return true; +} + +// extract strings out of attribute arguments stored in attribute aggregate. +// convert to lower case if converToLower is true (for case-insensitive compare convenience) +bool TAttributeArgs::getString(TString& value, int argNum, bool convertToLower) const +{ + const TConstUnion* stringConst = getConstUnion(EbtString, argNum); + + if (stringConst == nullptr) + return false; + + value = *stringConst->getSConst(); + + // Convenience. + if (convertToLower) + std::transform(value.begin(), value.end(), value.begin(), ::tolower); + + return true; +} + +// How many arguments were supplied? +int TAttributeArgs::size() const +{ + return args == nullptr ? 0 : (int)args->getSequence().size(); +} + +// Helper to get attribute const union. Returns nullptr on failure. +const TConstUnion* TAttributeArgs::getConstUnion(TBasicType basicType, int argNum) const +{ + if (args == nullptr) + return nullptr; + + if (argNum >= (int)args->getSequence().size()) + return nullptr; + + const TConstUnion* constVal = &args->getSequence()[argNum]->getAsConstantUnion()->getConstArray()[0]; + if (constVal == nullptr || constVal->getType() != basicType) + return nullptr; + + return constVal; +} + +// Implementation of TParseContext parts of attributes +TAttributeType TParseContext::attributeFromName(const TString& name) const +{ + if (name == "branch" || name == "dont_flatten") + return EatBranch; + else if (name == "flatten") + return EatFlatten; + else if (name == "unroll") + return EatUnroll; + else if (name == "loop" || name == "dont_unroll") + return EatLoop; + else if (name == "dependency_infinite") + return EatDependencyInfinite; + else if (name == "dependency_length") + return EatDependencyLength; + else + return EatNone; +} + +// Make an initial leaf for the grammar from a no-argument attribute +TAttributes* TParseContext::makeAttributes(const TString& identifier) const +{ + TAttributes *attributes = nullptr; + attributes = NewPoolObject(attributes); + TAttributeArgs args = { attributeFromName(identifier), nullptr }; + attributes->push_back(args); + return attributes; +} + +// Make an initial leaf for the grammar from a one-argument attribute +TAttributes* TParseContext::makeAttributes(const TString& identifier, TIntermNode* node) const +{ + TAttributes *attributes = nullptr; + attributes = NewPoolObject(attributes); + + // for now, node is always a simple single expression, but other code expects + // a list, so make it so + TIntermAggregate* agg = intermediate.makeAggregate(node); + TAttributeArgs args = { attributeFromName(identifier), agg }; + attributes->push_back(args); + return attributes; +} + +// Merge two sets of attributes into a single set. +// The second argument is destructively consumed. +TAttributes* TParseContext::mergeAttributes(TAttributes* attr1, TAttributes* attr2) const +{ + attr1->splice(attr1->end(), *attr2); + return attr1; +} + +// +// Selection attributes +// +void TParseContext::handleSelectionAttributes(const TAttributes& attributes, TIntermNode* node) +{ + TIntermSelection* selection = node->getAsSelectionNode(); + if (selection == nullptr) + return; + + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + if (it->size() > 0) { + warn(node->getLoc(), "attribute with arguments not recognized, skipping", "", ""); + continue; + } + + switch (it->name) { + case EatFlatten: + selection->setFlatten(); + break; + case EatBranch: + selection->setDontFlatten(); + break; + default: + warn(node->getLoc(), "attribute does not apply to a selection", "", ""); + break; + } + } +} + +// +// Switch attributes +// +void TParseContext::handleSwitchAttributes(const TAttributes& attributes, TIntermNode* node) +{ + TIntermSwitch* selection = node->getAsSwitchNode(); + if (selection == nullptr) + return; + + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + if (it->size() > 0) { + warn(node->getLoc(), "attribute with arguments not recognized, skipping", "", ""); + continue; + } + + switch (it->name) { + case EatFlatten: + selection->setFlatten(); + break; + case EatBranch: + selection->setDontFlatten(); + break; + default: + warn(node->getLoc(), "attribute does not apply to a switch", "", ""); + break; + } + } +} + +// +// Loop attributes +// +void TParseContext::handleLoopAttributes(const TAttributes& attributes, TIntermNode* node) +{ + TIntermLoop* loop = node->getAsLoopNode(); + if (loop == nullptr) { + // the actual loop might be part of a sequence + TIntermAggregate* agg = node->getAsAggregate(); + if (agg == nullptr) + return; + for (auto it = agg->getSequence().begin(); it != agg->getSequence().end(); ++it) { + loop = (*it)->getAsLoopNode(); + if (loop != nullptr) + break; + } + if (loop == nullptr) + return; + } + + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + if (it->name != EatDependencyLength && it->size() > 0) { + warn(node->getLoc(), "attribute with arguments not recognized, skipping", "", ""); + continue; + } + + int value; + switch (it->name) { + case EatUnroll: + loop->setUnroll(); + break; + case EatLoop: + loop->setDontUnroll(); + break; + case EatDependencyInfinite: + loop->setLoopDependency(TIntermLoop::dependencyInfinite); + break; + case EatDependencyLength: + if (it->size() == 1 && it->getInt(value)) { + if (value <= 0) + error(node->getLoc(), "must be positive", "dependency_length", ""); + loop->setLoopDependency(value); + } else + warn(node->getLoc(), "expected a single integer argument", "dependency_length", ""); + break; + default: + warn(node->getLoc(), "attribute does not apply to a loop", "", ""); + break; + } + } +} + + +} // end namespace glslang diff --git a/deps/glslang/glslang/MachineIndependent/attribute.h b/deps/glslang/glslang/MachineIndependent/attribute.h new file mode 100644 index 00000000..8d0c5bca --- /dev/null +++ b/deps/glslang/glslang/MachineIndependent/attribute.h @@ -0,0 +1,102 @@ +// +// Copyright (C) 2017 LunarG, Inc. +// Copyright (C) 2018 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef _ATTRIBUTE_INCLUDED_ +#define _ATTRIBUTE_INCLUDED_ + +#include "../Include/Common.h" +#include "../Include/ConstantUnion.h" + +namespace glslang { + + enum TAttributeType { + EatNone, + EatAllow_uav_condition, + EatBranch, + EatCall, + EatDomain, + EatEarlyDepthStencil, + EatFastOpt, + EatFlatten, + EatForceCase, + EatInstance, + EatMaxTessFactor, + EatNumThreads, + EatMaxVertexCount, + EatOutputControlPoints, + EatOutputTopology, + EatPartitioning, + EatPatchConstantFunc, + EatPatchSize, + EatUnroll, + EatLoop, + EatBinding, + EatGlobalBinding, + EatLocation, + EatInputAttachment, + EatBuiltIn, + EatPushConstant, + EatConstantId, + EatDependencyInfinite, + EatDependencyLength + }; + + class TIntermAggregate; + + struct TAttributeArgs { + TAttributeType name; + const TIntermAggregate* args; + + // Obtain attribute as integer + // Return false if it cannot be obtained + bool getInt(int& value, int argNum = 0) const; + + // Obtain attribute as string, with optional to-lower transform + // Return false if it cannot be obtained + bool getString(TString& value, int argNum = 0, bool convertToLower = true) const; + + // How many arguments were provided to the attribute? + int size() const; + + protected: + const TConstUnion* getConstUnion(TBasicType basicType, int argNum) const; + }; + + typedef TList TAttributes; + +} // end namespace glslang + +#endif // _ATTRIBUTE_INCLUDED_ diff --git a/deps/glslang/glslang/MachineIndependent/gl_types.h b/deps/glslang/glslang/MachineIndependent/gl_types.h index ae00ae57..c9fee9ec 100644 --- a/deps/glslang/glslang/MachineIndependent/gl_types.h +++ b/deps/glslang/glslang/MachineIndependent/gl_types.h @@ -117,6 +117,40 @@ #define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C #define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D +#ifdef AMD_EXTENSIONS +#define GL_FLOAT16_SAMPLER_1D_AMD 0x91CE +#define GL_FLOAT16_SAMPLER_2D_AMD 0x91CF +#define GL_FLOAT16_SAMPLER_3D_AMD 0x91D0 +#define GL_FLOAT16_SAMPLER_CUBE_AMD 0x91D1 +#define GL_FLOAT16_SAMPLER_2D_RECT_AMD 0x91D2 +#define GL_FLOAT16_SAMPLER_1D_ARRAY_AMD 0x91D3 +#define GL_FLOAT16_SAMPLER_2D_ARRAY_AMD 0x91D4 +#define GL_FLOAT16_SAMPLER_CUBE_MAP_ARRAY_AMD 0x91D5 +#define GL_FLOAT16_SAMPLER_BUFFER_AMD 0x91D6 +#define GL_FLOAT16_SAMPLER_2D_MULTISAMPLE_AMD 0x91D7 +#define GL_FLOAT16_SAMPLER_2D_MULTISAMPLE_ARRAY_AMD 0x91D8 + +#define GL_FLOAT16_SAMPLER_1D_SHADOW_AMD 0x91D9 +#define GL_FLOAT16_SAMPLER_2D_SHADOW_AMD 0x91DA +#define GL_FLOAT16_SAMPLER_2D_RECT_SHADOW_AMD 0x91DB +#define GL_FLOAT16_SAMPLER_1D_ARRAY_SHADOW_AMD 0x91DC +#define GL_FLOAT16_SAMPLER_2D_ARRAY_SHADOW_AMD 0x91DD +#define GL_FLOAT16_SAMPLER_CUBE_SHADOW_AMD 0x91DE +#define GL_FLOAT16_SAMPLER_CUBE_MAP_ARRAY_SHADOW_AMD 0x91DF + +#define GL_FLOAT16_IMAGE_1D_AMD 0x91E0 +#define GL_FLOAT16_IMAGE_2D_AMD 0x91E1 +#define GL_FLOAT16_IMAGE_3D_AMD 0x91E2 +#define GL_FLOAT16_IMAGE_2D_RECT_AMD 0x91E3 +#define GL_FLOAT16_IMAGE_CUBE_AMD 0x91E4 +#define GL_FLOAT16_IMAGE_1D_ARRAY_AMD 0x91E5 +#define GL_FLOAT16_IMAGE_2D_ARRAY_AMD 0x91E6 +#define GL_FLOAT16_IMAGE_CUBE_MAP_ARRAY_AMD 0x91E7 +#define GL_FLOAT16_IMAGE_BUFFER_AMD 0x91E8 +#define GL_FLOAT16_IMAGE_2D_MULTISAMPLE_AMD 0x91E9 +#define GL_FLOAT16_IMAGE_2D_MULTISAMPLE_ARRAY_AMD 0x91EA +#endif + #define GL_INT_SAMPLER_1D 0x8DC9 #define GL_INT_SAMPLER_2D 0x8DCA #define GL_INT_SAMPLER_3D 0x8DCB diff --git a/deps/glslang/glslang/MachineIndependent/glslang.y b/deps/glslang/glslang/MachineIndependent/glslang.y index cd6df7b0..e65483a8 100644 --- a/deps/glslang/glslang/MachineIndependent/glslang.y +++ b/deps/glslang/glslang/MachineIndependent/glslang.y @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -58,6 +59,7 @@ Jutta Degener, 1995 #include "SymbolTable.h" #include "ParseHelper.h" #include "../Public/ShaderLang.h" +#include "attribute.h" using namespace glslang; @@ -86,6 +88,7 @@ using namespace glslang; TIntermNode* intermNode; glslang::TIntermNodePair nodePair; glslang::TIntermTyped* intermTypedNode; + glslang::TAttributes* attributes; }; union { glslang::TPublicType type; @@ -121,15 +124,28 @@ extern int yylex(YYSTYPE*, TParseContext&); %expect 1 // One shift reduce conflict because of if | else %token ATTRIBUTE VARYING -%token CONST BOOL FLOAT DOUBLE INT UINT INT64_T UINT64_T INT16_T UINT16_T FLOAT16_T +%token FLOAT16_T FLOAT FLOAT32_T DOUBLE FLOAT64_T +%token CONST BOOL INT UINT INT64_T UINT64_T INT32_T UINT32_T INT16_T UINT16_T INT8_T UINT8_T %token BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT SUBROUTINE -%token BVEC2 BVEC3 BVEC4 IVEC2 IVEC3 IVEC4 I64VEC2 I64VEC3 I64VEC4 UVEC2 UVEC3 UVEC4 U64VEC2 U64VEC3 U64VEC4 VEC2 VEC3 VEC4 +%token BVEC2 BVEC3 BVEC4 +%token IVEC2 IVEC3 IVEC4 +%token UVEC2 UVEC3 UVEC4 +%token I64VEC2 I64VEC3 I64VEC4 +%token U64VEC2 U64VEC3 U64VEC4 +%token I32VEC2 I32VEC3 I32VEC4 +%token U32VEC2 U32VEC3 U32VEC4 +%token I16VEC2 I16VEC3 I16VEC4 +%token U16VEC2 U16VEC3 U16VEC4 +%token I8VEC2 I8VEC3 I8VEC4 +%token U8VEC2 U8VEC3 U8VEC4 +%token VEC2 VEC3 VEC4 %token MAT2 MAT3 MAT4 CENTROID IN OUT INOUT -%token UNIFORM PATCH SAMPLE BUFFER SHARED +%token UNIFORM PATCH SAMPLE BUFFER SHARED NONUNIFORM %token COHERENT VOLATILE RESTRICT READONLY WRITEONLY %token DVEC2 DVEC3 DVEC4 DMAT2 DMAT3 DMAT4 %token F16VEC2 F16VEC3 F16VEC4 F16MAT2 F16MAT3 F16MAT4 -%token I16VEC2 I16VEC3 I16VEC4 U16VEC2 U16VEC3 U16VEC4 +%token F32VEC2 F32VEC3 F32VEC4 F32MAT2 F32MAT3 F32MAT4 +%token F64VEC2 F64VEC3 F64VEC4 F64MAT2 F64MAT3 F64MAT4 %token NOPERSPECTIVE FLAT SMOOTH LAYOUT __EXPLICITINTERPAMD %token MAT2X2 MAT2X3 MAT2X4 @@ -141,6 +157,12 @@ extern int yylex(YYSTYPE*, TParseContext&); %token F16MAT2X2 F16MAT2X3 F16MAT2X4 %token F16MAT3X2 F16MAT3X3 F16MAT3X4 %token F16MAT4X2 F16MAT4X3 F16MAT4X4 +%token F32MAT2X2 F32MAT2X3 F32MAT2X4 +%token F32MAT3X2 F32MAT3X3 F32MAT3X4 +%token F32MAT4X2 F32MAT4X3 F32MAT4X4 +%token F64MAT2X2 F64MAT2X3 F64MAT2X4 +%token F64MAT3X2 F64MAT3X3 F64MAT3X4 +%token F64MAT4X2 F64MAT4X3 F64MAT4X4 %token ATOMIC_UINT // combined image/sampler @@ -157,6 +179,12 @@ extern int yylex(YYSTYPE*, TParseContext&); %token SAMPLER2DMSARRAY ISAMPLER2DMSARRAY USAMPLER2DMSARRAY %token SAMPLEREXTERNALOES +%token F16SAMPLER1D F16SAMPLER2D F16SAMPLER3D F16SAMPLER2DRECT F16SAMPLERCUBE +%token F16SAMPLER1DARRAY F16SAMPLER2DARRAY F16SAMPLERCUBEARRAY +%token F16SAMPLERBUFFER F16SAMPLER2DMS F16SAMPLER2DMSARRAY +%token F16SAMPLER1DSHADOW F16SAMPLER2DSHADOW F16SAMPLER1DARRAYSHADOW F16SAMPLER2DARRAYSHADOW +%token F16SAMPLER2DRECTSHADOW F16SAMPLERCUBESHADOW F16SAMPLERCUBEARRAYSHADOW + // pure sampler %token SAMPLER SAMPLERSHADOW @@ -172,8 +200,13 @@ extern int yylex(YYSTYPE*, TParseContext&); %token TEXTURE2DMS ITEXTURE2DMS UTEXTURE2DMS %token TEXTURE2DMSARRAY ITEXTURE2DMSARRAY UTEXTURE2DMSARRAY +%token F16TEXTURE1D F16TEXTURE2D F16TEXTURE3D F16TEXTURE2DRECT F16TEXTURECUBE +%token F16TEXTURE1DARRAY F16TEXTURE2DARRAY F16TEXTURECUBEARRAY +%token F16TEXTUREBUFFER F16TEXTURE2DMS F16TEXTURE2DMSARRAY + // input attachments %token SUBPASSINPUT SUBPASSINPUTMS ISUBPASSINPUT ISUBPASSINPUTMS USUBPASSINPUT USUBPASSINPUTMS +%token F16SUBPASSINPUT F16SUBPASSINPUTMS %token IMAGE1D IIMAGE1D UIMAGE1D IMAGE2D IIMAGE2D %token UIMAGE2D IMAGE3D IIMAGE3D UIMAGE3D @@ -186,10 +219,14 @@ extern int yylex(YYSTYPE*, TParseContext&); %token IMAGE2DMS IIMAGE2DMS UIMAGE2DMS %token IMAGE2DMSARRAY IIMAGE2DMSARRAY UIMAGE2DMSARRAY +%token F16IMAGE1D F16IMAGE2D F16IMAGE3D F16IMAGE2DRECT +%token F16IMAGECUBE F16IMAGE1DARRAY F16IMAGE2DARRAY F16IMAGECUBEARRAY +%token F16IMAGEBUFFER F16IMAGE2DMS F16IMAGE2DMSARRAY + %token STRUCT VOID WHILE %token IDENTIFIER TYPE_NAME -%token FLOATCONSTANT DOUBLECONSTANT INTCONSTANT UINTCONSTANT INT64CONSTANT UINT64CONSTANT INT16CONSTANT UINT16CONSTANT BOOLCONSTANT FLOAT16CONSTANT +%token FLOATCONSTANT DOUBLECONSTANT INT16CONSTANT UINT16CONSTANT INT32CONSTANT UINT32CONSTANT INTCONSTANT UINTCONSTANT INT64CONSTANT UINT64CONSTANT BOOLCONSTANT FLOAT16CONSTANT %token LEFT_OP RIGHT_OP %token INC_OP DEC_OP LE_OP GE_OP EQ_OP NE_OP %token AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN @@ -218,12 +255,12 @@ extern int yylex(YYSTYPE*, TParseContext&); %type translation_unit function_definition %type statement simple_statement %type statement_list switch_statement_list compound_statement -%type declaration_statement selection_statement expression_statement -%type switch_statement case_label +%type declaration_statement selection_statement selection_statement_nonattributed expression_statement +%type switch_statement switch_statement_nonattributed case_label %type declaration external_declaration %type for_init_statement compound_statement_no_new_scope %type selection_rest_statement for_rest_statement -%type iteration_statement jump_statement statement_no_new_scope statement_scoped +%type iteration_statement iteration_statement_nonattributed jump_statement statement_no_new_scope statement_scoped %type single_declaration init_declarator_list %type parameter_declaration parameter_declarator parameter_type_specifier @@ -231,6 +268,7 @@ extern int yylex(YYSTYPE*, TParseContext&); %type array_specifier %type precise_qualifier invariant_qualifier interpolation_qualifier storage_qualifier precision_qualifier %type layout_qualifier layout_qualifier_id_list layout_qualifier_id +%type non_uniform_qualifier %type type_qualifier fully_specified_type type_specifier %type single_type_qualifier @@ -246,6 +284,8 @@ extern int yylex(YYSTYPE*, TParseContext&); %type identifier_list +%type attribute attribute_list single_attribute + %start translation_unit %% @@ -259,6 +299,14 @@ primary_expression : variable_identifier { $$ = $1; } + | INT32CONSTANT { + parseContext.explicitInt32Check($1.loc, "32-bit signed literal"); + $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true); + } + | UINT32CONSTANT { + parseContext.explicitInt32Check($1.loc, "32-bit signed literal"); + $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true); + } | INTCONSTANT { $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true); } @@ -275,16 +323,12 @@ primary_expression $$ = parseContext.intermediate.addConstantUnion($1.u64, $1.loc, true); } | INT16CONSTANT { -#ifdef AMD_EXTENSIONS - parseContext.int16Check($1.loc, "16-bit integer literal"); + parseContext.explicitInt16Check($1.loc, "16-bit integer literal"); $$ = parseContext.intermediate.addConstantUnion((short)$1.i, $1.loc, true); -#endif } | UINT16CONSTANT { -#ifdef AMD_EXTENSIONS - parseContext.int16Check($1.loc, "16-bit unsigned integer literal"); + parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer literal"); $$ = parseContext.intermediate.addConstantUnion((unsigned short)$1.u, $1.loc, true); -#endif } | FLOATCONSTANT { $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true); @@ -294,10 +338,8 @@ primary_expression $$ = parseContext.intermediate.addConstantUnion($1.d, EbtDouble, $1.loc, true); } | FLOAT16CONSTANT { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float literal"); $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat16, $1.loc, true); -#endif } | BOOLCONSTANT { $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true); @@ -432,6 +474,11 @@ function_identifier $$.function = new TFunction(&empty, TType(EbtVoid), EOpNull); } } + | non_uniform_qualifier { + // Constructor + $$.intermNode = 0; + $$.function = parseContext.handleConstructorCall($1.loc, $1); + } ; unary_expression @@ -860,6 +907,11 @@ function_header // Add the function as a prototype after parsing it (we do not support recursion) TFunction *function; TType type($1); + + // Potentially rename shader entry point function. No-op most of the time. + parseContext.renameShaderFunction($2.string); + + // Make the function function = new TFunction($2.string, type); $$ = function; } @@ -888,14 +940,16 @@ parameter_declarator parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type"); parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes); } - parseContext.arrayDimCheck($2.loc, $1.arraySizes, $3.arraySizes); + TType* type = new TType($1); + type->transferArraySizes($3.arraySizes); + type->copyArrayInnerSizes($1.arraySizes); + parseContext.arrayOfArrayVersionCheck($2.loc, type->getArraySizes()); parseContext.arraySizeRequiredCheck($3.loc, *$3.arraySizes); parseContext.reservedErrorCheck($2.loc, *$2.string); - $1.arraySizes = $3.arraySizes; + TParameter param = { $2.string, type }; - TParameter param = { $2.string, new TType($1)}; $$.loc = $2.loc; $$.param = param; } @@ -920,7 +974,7 @@ parameter_declaration $$ = $1; parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type); - parseContext.paramCheckFix($1.loc, EvqTemporary, *$$.param.type); + parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type); parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier()); } // @@ -940,7 +994,7 @@ parameter_declaration $$ = $1; parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type); - parseContext.paramCheckFix($1.loc, EvqTemporary, *$$.param.type); + parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type); parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier()); } ; @@ -1029,7 +1083,7 @@ fully_specified_type } if ($2.arraySizes && parseContext.arrayQualifierError($2.loc, $1.qualifier)) - $2.arraySizes = 0; + $2.arraySizes = nullptr; parseContext.checkNoShaderLayouts($2.loc, $1.shaderQualifiers); $2.shaderQualifiers.merge($1.shaderQualifiers); @@ -1071,7 +1125,11 @@ interpolation_qualifier } | NOPERSPECTIVE { parseContext.globalCheck($1.loc, "noperspective"); +#ifdef NV_EXTENSIONS + parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_NV_shader_noperspective_interpolation, "noperspective"); +#else parseContext.requireProfile($1.loc, ~EEsProfile, "noperspective"); +#endif parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "noperspective"); $$.init($1.loc); $$.qualifier.nopersp = true; @@ -1165,6 +1223,9 @@ single_type_qualifier // allow inheritance of storage qualifier from block declaration $$ = $1; } + | non_uniform_qualifier { + $$ = $1; + } ; storage_qualifier @@ -1285,6 +1346,13 @@ storage_qualifier } ; +non_uniform_qualifier + : NONUNIFORM { + $$.init($1.loc); + $$.qualifier.nonUniform = true; + } + ; + type_name_list : IDENTIFIER { // TODO @@ -1302,7 +1370,7 @@ type_specifier $$.qualifier.precision = parseContext.getDefaultPrecision($$); } | type_specifier_nonarray array_specifier { - parseContext.arrayDimCheck($2.loc, $2.arraySizes, 0); + parseContext.arrayOfArrayVersionCheck($2.loc, $2.arraySizes); $$ = $1; $$.qualifier.precision = parseContext.getDefaultPrecision($$); $$.arraySizes = $2.arraySizes; @@ -1351,11 +1419,19 @@ type_specifier_nonarray $$.basicType = EbtDouble; } | FLOAT16_T { -#ifdef AMD_EXTENSIONS - parseContext.float16Check($1.loc, "half float", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16Check($1.loc, "float16_t", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; -#endif + } + | FLOAT32_T { + parseContext.explicitFloat32Check($1.loc, "float32_t", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + } + | FLOAT64_T { + parseContext.explicitFloat64Check($1.loc, "float64_t", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; } | INT { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); @@ -1366,29 +1442,45 @@ type_specifier_nonarray $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtUint; } - | INT64_T { - parseContext.int64Check($1.loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); + | INT8_T { + parseContext.explicitInt8Check($1.loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtInt64; + $$.basicType = EbtInt8; } - | UINT64_T { - parseContext.int64Check($1.loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + | UINT8_T { + parseContext.explicitInt8Check($1.loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtUint64; + $$.basicType = EbtUint8; } | INT16_T { -#ifdef AMD_EXTENSIONS - parseContext.int16Check($1.loc, "16-bit integer", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitInt16Check($1.loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtInt16; -#endif } | UINT16_T { -#ifdef AMD_EXTENSIONS - parseContext.int16Check($1.loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtUint16; -#endif + } + | INT32_T { + parseContext.explicitInt32Check($1.loc, "32-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt; + } + | UINT32_T { + parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint; + } + | INT64_T { + parseContext.int64Check($1.loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt64; + } + | UINT64_T { + parseContext.int64Check($1.loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint64; } | BOOL { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); @@ -1428,28 +1520,58 @@ type_specifier_nonarray $$.setVector(4); } | F16VEC2 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setVector(2); -#endif } | F16VEC3 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setVector(3); -#endif } | F16VEC4 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setVector(4); -#endif + } + | F32VEC2 { + parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setVector(2); + } + | F32VEC3 { + parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setVector(3); + } + | F32VEC4 { + parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setVector(4); + } + | F64VEC2 { + parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setVector(2); + } + | F64VEC3 { + parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setVector(3); + } + | F64VEC4 { + parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setVector(4); } | BVEC2 { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); @@ -1481,47 +1603,77 @@ type_specifier_nonarray $$.basicType = EbtInt; $$.setVector(4); } - | I64VEC2 { - parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + | I8VEC2 { + parseContext.explicitInt8Check($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt8; + $$.setVector(2); + } + | I8VEC3 { + parseContext.explicitInt8Check($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt8; + $$.setVector(3); + } + | I8VEC4 { + parseContext.explicitInt8Check($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt8; + $$.setVector(4); + } + | I16VEC2 { + parseContext.explicitInt16Check($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt16; + $$.setVector(2); + } + | I16VEC3 { + parseContext.explicitInt16Check($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt16; + $$.setVector(3); + } + | I16VEC4 { + parseContext.explicitInt16Check($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt16; + $$.setVector(4); + } + | I32VEC2 { + parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtInt64; + $$.basicType = EbtInt; $$.setVector(2); } - | I64VEC3 { - parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + | I32VEC3 { + parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtInt64; + $$.basicType = EbtInt; $$.setVector(3); } - | I64VEC4 { - parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + | I32VEC4 { + parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtInt64; + $$.basicType = EbtInt; $$.setVector(4); } - | I16VEC2 { -#ifdef AMD_EXTENSIONS - parseContext.int16Check($1.loc, "16-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + | I64VEC2 { + parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtInt16; + $$.basicType = EbtInt64; $$.setVector(2); -#endif } - | I16VEC3 { -#ifdef AMD_EXTENSIONS - parseContext.int16Check($1.loc, "16-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + | I64VEC3 { + parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtInt16; + $$.basicType = EbtInt64; $$.setVector(3); -#endif } - | I16VEC4 { -#ifdef AMD_EXTENSIONS - parseContext.int16Check($1.loc, "16-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + | I64VEC4 { + parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtInt16; + $$.basicType = EbtInt64; $$.setVector(4); -#endif } | UVEC2 { parseContext.fullIntegerCheck($1.loc, "unsigned integer vector"); @@ -1541,47 +1693,77 @@ type_specifier_nonarray $$.basicType = EbtUint; $$.setVector(4); } - | U64VEC2 { - parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + | U8VEC2 { + parseContext.explicitInt8Check($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtUint64; + $$.basicType = EbtUint8; $$.setVector(2); } - | U64VEC3 { - parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + | U8VEC3 { + parseContext.explicitInt8Check($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtUint64; + $$.basicType = EbtInt8; $$.setVector(3); } - | U64VEC4 { - parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + | U8VEC4 { + parseContext.explicitInt8Check($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtUint64; + $$.basicType = EbtUint8; $$.setVector(4); } | U16VEC2 { -#ifdef AMD_EXTENSIONS - parseContext.int16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtUint16; $$.setVector(2); -#endif } | U16VEC3 { -#ifdef AMD_EXTENSIONS - parseContext.int16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtUint16; $$.setVector(3); -#endif } | U16VEC4 { -#ifdef AMD_EXTENSIONS - parseContext.int16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtUint16; $$.setVector(4); -#endif + } + | U32VEC2 { + parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint; + $$.setVector(2); + } + | U32VEC3 { + parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint; + $$.setVector(3); + } + | U32VEC4 { + parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint; + $$.setVector(4); + } + | U64VEC2 { + parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint64; + $$.setVector(2); + } + | U64VEC3 { + parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint64; + $$.setVector(3); + } + | U64VEC4 { + parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint64; + $$.setVector(4); } | MAT2 { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); @@ -1716,156 +1898,276 @@ type_specifier_nonarray $$.setMatrix(4, 4); } | F16MAT2 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(2, 2); -#endif } | F16MAT3 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(3, 3); -#endif } | F16MAT4 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(4, 4); -#endif } | F16MAT2X2 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(2, 2); -#endif } | F16MAT2X3 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(2, 3); -#endif } | F16MAT2X4 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(2, 4); -#endif } | F16MAT3X2 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(3, 2); -#endif } | F16MAT3X3 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(3, 3); -#endif } | F16MAT3X4 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(3, 4); -#endif } | F16MAT4X2 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(4, 2); -#endif } | F16MAT4X3 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(4, 3); -#endif } | F16MAT4X4 { -#ifdef AMD_EXTENSIONS parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setMatrix(4, 4); -#endif } - | ATOMIC_UINT { - parseContext.vulkanRemoved($1.loc, "atomic counter types"); + | F32MAT2 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtAtomicUint; + $$.basicType = EbtFloat; + $$.setMatrix(2, 2); } - | SAMPLER1D { + | F32MAT3 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, Esd1D); + $$.basicType = EbtFloat; + $$.setMatrix(3, 3); } - | SAMPLER2D { + | F32MAT4 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, Esd2D); + $$.basicType = EbtFloat; + $$.setMatrix(4, 4); } - | SAMPLER3D { + | F32MAT2X2 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, Esd3D); + $$.basicType = EbtFloat; + $$.setMatrix(2, 2); } - | SAMPLERCUBE { + | F32MAT2X3 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, EsdCube); + $$.basicType = EbtFloat; + $$.setMatrix(2, 3); } - | SAMPLER1DSHADOW { + | F32MAT2X4 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, Esd1D, false, true); + $$.basicType = EbtFloat; + $$.setMatrix(2, 4); } - | SAMPLER2DSHADOW { + | F32MAT3X2 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, Esd2D, false, true); + $$.basicType = EbtFloat; + $$.setMatrix(3, 2); } - | SAMPLERCUBESHADOW { + | F32MAT3X3 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, EsdCube, false, true); + $$.basicType = EbtFloat; + $$.setMatrix(3, 3); } - | SAMPLER1DARRAY { + | F32MAT3X4 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, Esd1D, true); + $$.basicType = EbtFloat; + $$.setMatrix(3, 4); } - | SAMPLER2DARRAY { + | F32MAT4X2 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, Esd2D, true); + $$.basicType = EbtFloat; + $$.setMatrix(4, 2); } - | SAMPLER1DARRAYSHADOW { + | F32MAT4X3 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, Esd1D, true, true); - } + $$.basicType = EbtFloat; + $$.setMatrix(4, 3); + } + | F32MAT4X4 { + parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtFloat; + $$.setMatrix(4, 4); + } + | F64MAT2 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(2, 2); + } + | F64MAT3 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(3, 3); + } + | F64MAT4 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(4, 4); + } + | F64MAT2X2 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(2, 2); + } + | F64MAT2X3 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(2, 3); + } + | F64MAT2X4 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(2, 4); + } + | F64MAT3X2 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(3, 2); + } + | F64MAT3X3 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(3, 3); + } + | F64MAT3X4 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(3, 4); + } + | F64MAT4X2 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(4, 2); + } + | F64MAT4X3 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(4, 3); + } + | F64MAT4X4 { + parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtDouble; + $$.setMatrix(4, 4); + } + | ATOMIC_UINT { + parseContext.vulkanRemoved($1.loc, "atomic counter types"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtAtomicUint; + } + | SAMPLER1D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd1D); + } + | SAMPLER2D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd2D); + } + | SAMPLER3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd3D); + } + | SAMPLERCUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, EsdCube); + } + | SAMPLER1DSHADOW { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd1D, false, true); + } + | SAMPLER2DSHADOW { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd2D, false, true); + } + | SAMPLERCUBESHADOW { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, EsdCube, false, true); + } + | SAMPLER1DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd1D, true); + } + | SAMPLER2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd2D, true); + } + | SAMPLER1DARRAYSHADOW { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd1D, true, true); + } | SAMPLER2DARRAYSHADOW { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -1881,6 +2183,110 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.set(EbtFloat, EsdCube, true, true); } + | F16SAMPLER1D { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd1D); +#endif + } + | F16SAMPLER2D { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd2D); +#endif + } + | F16SAMPLER3D { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd3D); +#endif + } + | F16SAMPLERCUBE { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, EsdCube); +#endif + } + | F16SAMPLER1DSHADOW { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd1D, false, true); +#endif + } + | F16SAMPLER2DSHADOW { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd2D, false, true); +#endif + } + | F16SAMPLERCUBESHADOW { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, EsdCube, false, true); +#endif + } + | F16SAMPLER1DARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd1D, true); +#endif + } + | F16SAMPLER2DARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd2D, true); +#endif + } + | F16SAMPLER1DARRAYSHADOW { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd1D, true, true); +#endif + } + | F16SAMPLER2DARRAYSHADOW { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd2D, true, true); +#endif + } + | F16SAMPLERCUBEARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, EsdCube, true); +#endif + } + | F16SAMPLERCUBEARRAYSHADOW { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, EsdCube, true, true); +#endif + } | ISAMPLER1D { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -1961,6 +2367,22 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.set(EbtFloat, EsdRect, false, true); } + | F16SAMPLER2DRECT { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, EsdRect); +#endif + } + | F16SAMPLER2DRECTSHADOW { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, EsdRect, false, true); +#endif + } | ISAMPLER2DRECT { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -1976,6 +2398,14 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.set(EbtFloat, EsdBuffer); } + | F16SAMPLERBUFFER { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, EsdBuffer); +#endif + } | ISAMPLERBUFFER { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -1991,6 +2421,14 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.set(EbtFloat, Esd2D, false, false, true); } + | F16SAMPLER2DMS { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd2D, false, false, true); +#endif + } | ISAMPLER2DMS { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2006,6 +2444,14 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.set(EbtFloat, Esd2D, true, false, true); } + | F16SAMPLER2DMSARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat16, Esd2D, true, false, true); +#endif + } | ISAMPLER2DMSARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2031,36 +2477,92 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, Esd1D); } + | F16TEXTURE1D { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, Esd1D); +#endif + } | TEXTURE2D { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, Esd2D); } + | F16TEXTURE2D { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, Esd2D); +#endif + } | TEXTURE3D { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, Esd3D); } + | F16TEXTURE3D { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, Esd3D); +#endif + } | TEXTURECUBE { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, EsdCube); } + | F16TEXTURECUBE { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, EsdCube); +#endif + } | TEXTURE1DARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, Esd1D, true); } + | F16TEXTURE1DARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, Esd1D, true); +#endif + } | TEXTURE2DARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, Esd2D, true); } + | F16TEXTURE2DARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, Esd2D, true); +#endif + } | TEXTURECUBEARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, EsdCube, true); } + | F16TEXTURECUBEARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, EsdCube, true); +#endif + } | ITEXTURE1D { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2136,6 +2638,14 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, EsdRect); } + | F16TEXTURE2DRECT { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, EsdRect); +#endif + } | ITEXTURE2DRECT { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2151,6 +2661,14 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, EsdBuffer); } + | F16TEXTUREBUFFER { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, EsdBuffer); +#endif + } | ITEXTUREBUFFER { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2166,6 +2684,14 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, Esd2D, false, false, true); } + | F16TEXTURE2DMS { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, Esd2D, false, false, true); +#endif + } | ITEXTURE2DMS { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2181,6 +2707,14 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat, Esd2D, true, false, true); } + | F16TEXTURE2DMSARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat16, Esd2D, true, false, true); +#endif + } | ITEXTURE2DMSARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2196,6 +2730,14 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, Esd1D); } + | F16IMAGE1D { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, Esd1D); +#endif + } | IIMAGE1D { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2211,6 +2753,14 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, Esd2D); } + | F16IMAGE2D { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, Esd2D); +#endif + } | IIMAGE2D { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2226,6 +2776,14 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, Esd3D); } + | F16IMAGE3D { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, Esd3D); +#endif + } | IIMAGE3D { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2241,6 +2799,14 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, EsdRect); } + | F16IMAGE2DRECT { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, EsdRect); +#endif + } | IIMAGE2DRECT { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2256,6 +2822,14 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, EsdCube); } + | F16IMAGECUBE { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, EsdCube); +#endif + } | IIMAGECUBE { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2271,6 +2845,14 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, EsdBuffer); } + | F16IMAGEBUFFER { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, EsdBuffer); +#endif + } | IIMAGEBUFFER { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2286,6 +2868,14 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, Esd1D, true); } + | F16IMAGE1DARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, Esd1D, true); +#endif + } | IIMAGE1DARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2301,6 +2891,14 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, Esd2D, true); } + | F16IMAGE2DARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, Esd2D, true); +#endif + } | IIMAGE2DARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2316,6 +2914,14 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, EsdCube, true); } + | F16IMAGECUBEARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, EsdCube, true); +#endif + } | IIMAGECUBEARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2331,6 +2937,14 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, Esd2D, false, false, true); } + | F16IMAGE2DMS { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, Esd2D, false, false, true); +#endif + } | IIMAGE2DMS { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2346,6 +2960,14 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.setImage(EbtFloat, Esd2D, true, false, true); } + | F16IMAGE2DMSARRAY { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setImage(EbtFloat16, Esd2D, true, false, true); +#endif + } | IIMAGE2DMSARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2374,6 +2996,24 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.setSubpass(EbtFloat, true); } + | F16SUBPASSINPUT { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtFloat16); +#endif + } + | F16SUBPASSINPUTMS { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck($1.loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtFloat16, true); +#endif + } | ISUBPASSINPUT { parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); @@ -2488,12 +3128,15 @@ struct_declaration parseContext.precisionQualifierCheck($1.loc, $1.basicType, $1.qualifier); for (unsigned int i = 0; i < $$->size(); ++i) { - parseContext.arrayDimCheck($1.loc, (*$$)[i].type, $1.arraySizes); - (*$$)[i].type->mergeType($1); + TType type($1); + type.setFieldName((*$$)[i].type->getFieldName()); + type.transferArraySizes((*$$)[i].type->getArraySizes()); + type.copyArrayInnerSizes($1.arraySizes); + parseContext.arrayOfArrayVersionCheck((*$$)[i].loc, type.getArraySizes()); + (*$$)[i].type->shallowCopy(type); } } | type_qualifier type_specifier struct_declarator_list SEMICOLON { - parseContext.globalQualifierFixCheck($1.loc, $1.qualifier); if ($2.arraySizes) { parseContext.profileRequires($2.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); parseContext.profileRequires($2.loc, EEsProfile, 300, 0, "arrayed type"); @@ -2503,14 +3146,18 @@ struct_declaration $$ = $3; - parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers); + parseContext.memberQualifierCheck($1); parseContext.voidErrorCheck($2.loc, (*$3)[0].type->getFieldName(), $2.basicType); parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true); parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier); for (unsigned int i = 0; i < $$->size(); ++i) { - parseContext.arrayDimCheck($1.loc, (*$$)[i].type, $2.arraySizes); - (*$$)[i].type->mergeType($2); + TType type($2); + type.setFieldName((*$$)[i].type->getFieldName()); + type.transferArraySizes((*$$)[i].type->getArraySizes()); + type.copyArrayInnerSizes($2.arraySizes); + parseContext.arrayOfArrayVersionCheck((*$$)[i].loc, type.getArraySizes()); + (*$$)[i].type->shallowCopy(type); } } ; @@ -2532,12 +3179,12 @@ struct_declarator $$.type->setFieldName(*$1.string); } | IDENTIFIER array_specifier { - parseContext.arrayDimCheck($1.loc, $2.arraySizes, 0); + parseContext.arrayOfArrayVersionCheck($1.loc, $2.arraySizes); $$.type = new TType(EbtVoid); $$.loc = $1.loc; $$.type->setFieldName(*$1.string); - $$.type->newArraySizes(*$2.arraySizes); + $$.type->transferArraySizes($2.arraySizes); } ; @@ -2668,6 +3315,15 @@ expression_statement ; selection_statement + : selection_statement_nonattributed { + $$ = $1; + } + | attribute selection_statement_nonattributed { + parseContext.handleSelectionAttributes(*$1, $2); + $$ = $2; + } + +selection_statement_nonattributed : IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement { parseContext.boolCheck($1.loc, $3); $$ = parseContext.intermediate.addSelection($3, $5, $1.loc); @@ -2704,6 +3360,15 @@ condition ; switch_statement + : switch_statement_nonattributed { + $$ = $1; + } + | attribute switch_statement_nonattributed { + parseContext.handleSwitchAttributes(*$1, $2); + $$ = $2; + } + +switch_statement_nonattributed : SWITCH LEFT_PAREN expression RIGHT_PAREN { // start new switch sequence on the switch stack ++parseContext.controlFlowNestingLevel; @@ -2757,6 +3422,15 @@ case_label ; iteration_statement + : iteration_statement_nonattributed { + $$ = $1; + } + | attribute iteration_statement_nonattributed { + parseContext.handleLoopAttributes(*$1, $2); + $$ = $2; + } + +iteration_statement_nonattributed : WHILE LEFT_PAREN { if (! parseContext.limits.whileLoops) parseContext.error($1.loc, "while loops not available", "limitation", ""); @@ -2911,8 +3585,30 @@ function_definition // information. This information can be queried from the parse tree $$->getAsAggregate()->setOptimize(parseContext.contextPragma.optimize); $$->getAsAggregate()->setDebug(parseContext.contextPragma.debug); - $$->getAsAggregate()->addToPragmaTable(parseContext.contextPragma.pragmaTable); + $$->getAsAggregate()->setPragmaTable(parseContext.contextPragma.pragmaTable); } ; +attribute + : LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET { + $$ = $3; + parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_control_flow_attributes, "attribute"); + } + +attribute_list + : single_attribute { + $$ = $1; + } + | attribute_list COMMA single_attribute { + $$ = parseContext.mergeAttributes($1, $3); + } + +single_attribute + : IDENTIFIER { + $$ = parseContext.makeAttributes(*$1.string); + } + | IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN { + $$ = parseContext.makeAttributes(*$1.string, $3); + } + %% diff --git a/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp b/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp index c6bae9ff..38672d67 100644 --- a/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp +++ b/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ +/* A Bison parser, made by GNU Bison 3.0. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.0.4" +#define YYBISON_VERSION "3.0" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -62,7 +62,7 @@ /* Copy the first part of user declarations. */ -#line 41 "MachineIndependent/glslang.y" /* yacc.c:339 */ +#line 42 "MachineIndependent/glslang.y" /* yacc.c:339 */ /* Based on: @@ -83,17 +83,18 @@ Jutta Degener, 1995 #include "SymbolTable.h" #include "ParseHelper.h" #include "../Public/ShaderLang.h" +#include "attribute.h" using namespace glslang; -#line 91 "MachineIndependent/glslang_tab.cpp" /* yacc.c:339 */ +#line 92 "MachineIndependent/glslang_tab.cpp" /* yacc.c:339 */ -# ifndef YY_NULLPTR +# ifndef YY_NULL # if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULLPTR nullptr +# define YY_NULL nullptr # else -# define YY_NULLPTR 0 +# define YY_NULL 0 # endif # endif @@ -124,308 +125,401 @@ extern int yydebug; { ATTRIBUTE = 258, VARYING = 259, - CONST = 260, - BOOL = 261, - FLOAT = 262, + FLOAT16_T = 260, + FLOAT = 261, + FLOAT32_T = 262, DOUBLE = 263, - INT = 264, - UINT = 265, - INT64_T = 266, - UINT64_T = 267, - INT16_T = 268, - UINT16_T = 269, - FLOAT16_T = 270, - BREAK = 271, - CONTINUE = 272, - DO = 273, - ELSE = 274, - FOR = 275, - IF = 276, - DISCARD = 277, - RETURN = 278, - SWITCH = 279, - CASE = 280, - DEFAULT = 281, - SUBROUTINE = 282, - BVEC2 = 283, - BVEC3 = 284, - BVEC4 = 285, - IVEC2 = 286, - IVEC3 = 287, - IVEC4 = 288, - I64VEC2 = 289, - I64VEC3 = 290, - I64VEC4 = 291, - UVEC2 = 292, - UVEC3 = 293, - UVEC4 = 294, - U64VEC2 = 295, - U64VEC3 = 296, - U64VEC4 = 297, - VEC2 = 298, - VEC3 = 299, - VEC4 = 300, - MAT2 = 301, - MAT3 = 302, - MAT4 = 303, - CENTROID = 304, - IN = 305, - OUT = 306, - INOUT = 307, - UNIFORM = 308, - PATCH = 309, - SAMPLE = 310, - BUFFER = 311, - SHARED = 312, - COHERENT = 313, - VOLATILE = 314, - RESTRICT = 315, - READONLY = 316, - WRITEONLY = 317, - DVEC2 = 318, - DVEC3 = 319, - DVEC4 = 320, - DMAT2 = 321, - DMAT3 = 322, - DMAT4 = 323, - F16VEC2 = 324, - F16VEC3 = 325, - F16VEC4 = 326, - F16MAT2 = 327, - F16MAT3 = 328, - F16MAT4 = 329, - I16VEC2 = 330, - I16VEC3 = 331, - I16VEC4 = 332, - U16VEC2 = 333, - U16VEC3 = 334, - U16VEC4 = 335, - NOPERSPECTIVE = 336, - FLAT = 337, - SMOOTH = 338, - LAYOUT = 339, - __EXPLICITINTERPAMD = 340, - MAT2X2 = 341, - MAT2X3 = 342, - MAT2X4 = 343, - MAT3X2 = 344, - MAT3X3 = 345, - MAT3X4 = 346, - MAT4X2 = 347, - MAT4X3 = 348, - MAT4X4 = 349, - DMAT2X2 = 350, - DMAT2X3 = 351, - DMAT2X4 = 352, - DMAT3X2 = 353, - DMAT3X3 = 354, - DMAT3X4 = 355, - DMAT4X2 = 356, - DMAT4X3 = 357, - DMAT4X4 = 358, - F16MAT2X2 = 359, - F16MAT2X3 = 360, - F16MAT2X4 = 361, - F16MAT3X2 = 362, - F16MAT3X3 = 363, - F16MAT3X4 = 364, - F16MAT4X2 = 365, - F16MAT4X3 = 366, - F16MAT4X4 = 367, - ATOMIC_UINT = 368, - SAMPLER1D = 369, - SAMPLER2D = 370, - SAMPLER3D = 371, - SAMPLERCUBE = 372, - SAMPLER1DSHADOW = 373, - SAMPLER2DSHADOW = 374, - SAMPLERCUBESHADOW = 375, - SAMPLER1DARRAY = 376, - SAMPLER2DARRAY = 377, - SAMPLER1DARRAYSHADOW = 378, - SAMPLER2DARRAYSHADOW = 379, - ISAMPLER1D = 380, - ISAMPLER2D = 381, - ISAMPLER3D = 382, - ISAMPLERCUBE = 383, - ISAMPLER1DARRAY = 384, - ISAMPLER2DARRAY = 385, - USAMPLER1D = 386, - USAMPLER2D = 387, - USAMPLER3D = 388, - USAMPLERCUBE = 389, - USAMPLER1DARRAY = 390, - USAMPLER2DARRAY = 391, - SAMPLER2DRECT = 392, - SAMPLER2DRECTSHADOW = 393, - ISAMPLER2DRECT = 394, - USAMPLER2DRECT = 395, - SAMPLERBUFFER = 396, - ISAMPLERBUFFER = 397, - USAMPLERBUFFER = 398, - SAMPLERCUBEARRAY = 399, - SAMPLERCUBEARRAYSHADOW = 400, - ISAMPLERCUBEARRAY = 401, - USAMPLERCUBEARRAY = 402, - SAMPLER2DMS = 403, - ISAMPLER2DMS = 404, - USAMPLER2DMS = 405, - SAMPLER2DMSARRAY = 406, - ISAMPLER2DMSARRAY = 407, - USAMPLER2DMSARRAY = 408, - SAMPLEREXTERNALOES = 409, - SAMPLER = 410, - SAMPLERSHADOW = 411, - TEXTURE1D = 412, - TEXTURE2D = 413, - TEXTURE3D = 414, - TEXTURECUBE = 415, - TEXTURE1DARRAY = 416, - TEXTURE2DARRAY = 417, - ITEXTURE1D = 418, - ITEXTURE2D = 419, - ITEXTURE3D = 420, - ITEXTURECUBE = 421, - ITEXTURE1DARRAY = 422, - ITEXTURE2DARRAY = 423, - UTEXTURE1D = 424, - UTEXTURE2D = 425, - UTEXTURE3D = 426, - UTEXTURECUBE = 427, - UTEXTURE1DARRAY = 428, - UTEXTURE2DARRAY = 429, - TEXTURE2DRECT = 430, - ITEXTURE2DRECT = 431, - UTEXTURE2DRECT = 432, - TEXTUREBUFFER = 433, - ITEXTUREBUFFER = 434, - UTEXTUREBUFFER = 435, - TEXTURECUBEARRAY = 436, - ITEXTURECUBEARRAY = 437, - UTEXTURECUBEARRAY = 438, - TEXTURE2DMS = 439, - ITEXTURE2DMS = 440, - UTEXTURE2DMS = 441, - TEXTURE2DMSARRAY = 442, - ITEXTURE2DMSARRAY = 443, - UTEXTURE2DMSARRAY = 444, - SUBPASSINPUT = 445, - SUBPASSINPUTMS = 446, - ISUBPASSINPUT = 447, - ISUBPASSINPUTMS = 448, - USUBPASSINPUT = 449, - USUBPASSINPUTMS = 450, - IMAGE1D = 451, - IIMAGE1D = 452, - UIMAGE1D = 453, - IMAGE2D = 454, - IIMAGE2D = 455, - UIMAGE2D = 456, - IMAGE3D = 457, - IIMAGE3D = 458, - UIMAGE3D = 459, - IMAGE2DRECT = 460, - IIMAGE2DRECT = 461, - UIMAGE2DRECT = 462, - IMAGECUBE = 463, - IIMAGECUBE = 464, - UIMAGECUBE = 465, - IMAGEBUFFER = 466, - IIMAGEBUFFER = 467, - UIMAGEBUFFER = 468, - IMAGE1DARRAY = 469, - IIMAGE1DARRAY = 470, - UIMAGE1DARRAY = 471, - IMAGE2DARRAY = 472, - IIMAGE2DARRAY = 473, - UIMAGE2DARRAY = 474, - IMAGECUBEARRAY = 475, - IIMAGECUBEARRAY = 476, - UIMAGECUBEARRAY = 477, - IMAGE2DMS = 478, - IIMAGE2DMS = 479, - UIMAGE2DMS = 480, - IMAGE2DMSARRAY = 481, - IIMAGE2DMSARRAY = 482, - UIMAGE2DMSARRAY = 483, - STRUCT = 484, - VOID = 485, - WHILE = 486, - IDENTIFIER = 487, - TYPE_NAME = 488, - FLOATCONSTANT = 489, - DOUBLECONSTANT = 490, - INTCONSTANT = 491, - UINTCONSTANT = 492, - INT64CONSTANT = 493, - UINT64CONSTANT = 494, - INT16CONSTANT = 495, - UINT16CONSTANT = 496, - BOOLCONSTANT = 497, - FLOAT16CONSTANT = 498, - LEFT_OP = 499, - RIGHT_OP = 500, - INC_OP = 501, - DEC_OP = 502, - LE_OP = 503, - GE_OP = 504, - EQ_OP = 505, - NE_OP = 506, - AND_OP = 507, - OR_OP = 508, - XOR_OP = 509, - MUL_ASSIGN = 510, - DIV_ASSIGN = 511, - ADD_ASSIGN = 512, - MOD_ASSIGN = 513, - LEFT_ASSIGN = 514, - RIGHT_ASSIGN = 515, - AND_ASSIGN = 516, - XOR_ASSIGN = 517, - OR_ASSIGN = 518, - SUB_ASSIGN = 519, - LEFT_PAREN = 520, - RIGHT_PAREN = 521, - LEFT_BRACKET = 522, - RIGHT_BRACKET = 523, - LEFT_BRACE = 524, - RIGHT_BRACE = 525, - DOT = 526, - COMMA = 527, - COLON = 528, - EQUAL = 529, - SEMICOLON = 530, - BANG = 531, - DASH = 532, - TILDE = 533, - PLUS = 534, - STAR = 535, - SLASH = 536, - PERCENT = 537, - LEFT_ANGLE = 538, - RIGHT_ANGLE = 539, - VERTICAL_BAR = 540, - CARET = 541, - AMPERSAND = 542, - QUESTION = 543, - INVARIANT = 544, - PRECISE = 545, - HIGH_PRECISION = 546, - MEDIUM_PRECISION = 547, - LOW_PRECISION = 548, - PRECISION = 549, - PACKED = 550, - RESOURCE = 551, - SUPERP = 552 + FLOAT64_T = 264, + CONST = 265, + BOOL = 266, + INT = 267, + UINT = 268, + INT64_T = 269, + UINT64_T = 270, + INT32_T = 271, + UINT32_T = 272, + INT16_T = 273, + UINT16_T = 274, + INT8_T = 275, + UINT8_T = 276, + BREAK = 277, + CONTINUE = 278, + DO = 279, + ELSE = 280, + FOR = 281, + IF = 282, + DISCARD = 283, + RETURN = 284, + SWITCH = 285, + CASE = 286, + DEFAULT = 287, + SUBROUTINE = 288, + BVEC2 = 289, + BVEC3 = 290, + BVEC4 = 291, + IVEC2 = 292, + IVEC3 = 293, + IVEC4 = 294, + UVEC2 = 295, + UVEC3 = 296, + UVEC4 = 297, + I64VEC2 = 298, + I64VEC3 = 299, + I64VEC4 = 300, + U64VEC2 = 301, + U64VEC3 = 302, + U64VEC4 = 303, + I32VEC2 = 304, + I32VEC3 = 305, + I32VEC4 = 306, + U32VEC2 = 307, + U32VEC3 = 308, + U32VEC4 = 309, + I16VEC2 = 310, + I16VEC3 = 311, + I16VEC4 = 312, + U16VEC2 = 313, + U16VEC3 = 314, + U16VEC4 = 315, + I8VEC2 = 316, + I8VEC3 = 317, + I8VEC4 = 318, + U8VEC2 = 319, + U8VEC3 = 320, + U8VEC4 = 321, + VEC2 = 322, + VEC3 = 323, + VEC4 = 324, + MAT2 = 325, + MAT3 = 326, + MAT4 = 327, + CENTROID = 328, + IN = 329, + OUT = 330, + INOUT = 331, + UNIFORM = 332, + PATCH = 333, + SAMPLE = 334, + BUFFER = 335, + SHARED = 336, + NONUNIFORM = 337, + COHERENT = 338, + VOLATILE = 339, + RESTRICT = 340, + READONLY = 341, + WRITEONLY = 342, + DVEC2 = 343, + DVEC3 = 344, + DVEC4 = 345, + DMAT2 = 346, + DMAT3 = 347, + DMAT4 = 348, + F16VEC2 = 349, + F16VEC3 = 350, + F16VEC4 = 351, + F16MAT2 = 352, + F16MAT3 = 353, + F16MAT4 = 354, + F32VEC2 = 355, + F32VEC3 = 356, + F32VEC4 = 357, + F32MAT2 = 358, + F32MAT3 = 359, + F32MAT4 = 360, + F64VEC2 = 361, + F64VEC3 = 362, + F64VEC4 = 363, + F64MAT2 = 364, + F64MAT3 = 365, + F64MAT4 = 366, + NOPERSPECTIVE = 367, + FLAT = 368, + SMOOTH = 369, + LAYOUT = 370, + __EXPLICITINTERPAMD = 371, + MAT2X2 = 372, + MAT2X3 = 373, + MAT2X4 = 374, + MAT3X2 = 375, + MAT3X3 = 376, + MAT3X4 = 377, + MAT4X2 = 378, + MAT4X3 = 379, + MAT4X4 = 380, + DMAT2X2 = 381, + DMAT2X3 = 382, + DMAT2X4 = 383, + DMAT3X2 = 384, + DMAT3X3 = 385, + DMAT3X4 = 386, + DMAT4X2 = 387, + DMAT4X3 = 388, + DMAT4X4 = 389, + F16MAT2X2 = 390, + F16MAT2X3 = 391, + F16MAT2X4 = 392, + F16MAT3X2 = 393, + F16MAT3X3 = 394, + F16MAT3X4 = 395, + F16MAT4X2 = 396, + F16MAT4X3 = 397, + F16MAT4X4 = 398, + F32MAT2X2 = 399, + F32MAT2X3 = 400, + F32MAT2X4 = 401, + F32MAT3X2 = 402, + F32MAT3X3 = 403, + F32MAT3X4 = 404, + F32MAT4X2 = 405, + F32MAT4X3 = 406, + F32MAT4X4 = 407, + F64MAT2X2 = 408, + F64MAT2X3 = 409, + F64MAT2X4 = 410, + F64MAT3X2 = 411, + F64MAT3X3 = 412, + F64MAT3X4 = 413, + F64MAT4X2 = 414, + F64MAT4X3 = 415, + F64MAT4X4 = 416, + ATOMIC_UINT = 417, + SAMPLER1D = 418, + SAMPLER2D = 419, + SAMPLER3D = 420, + SAMPLERCUBE = 421, + SAMPLER1DSHADOW = 422, + SAMPLER2DSHADOW = 423, + SAMPLERCUBESHADOW = 424, + SAMPLER1DARRAY = 425, + SAMPLER2DARRAY = 426, + SAMPLER1DARRAYSHADOW = 427, + SAMPLER2DARRAYSHADOW = 428, + ISAMPLER1D = 429, + ISAMPLER2D = 430, + ISAMPLER3D = 431, + ISAMPLERCUBE = 432, + ISAMPLER1DARRAY = 433, + ISAMPLER2DARRAY = 434, + USAMPLER1D = 435, + USAMPLER2D = 436, + USAMPLER3D = 437, + USAMPLERCUBE = 438, + USAMPLER1DARRAY = 439, + USAMPLER2DARRAY = 440, + SAMPLER2DRECT = 441, + SAMPLER2DRECTSHADOW = 442, + ISAMPLER2DRECT = 443, + USAMPLER2DRECT = 444, + SAMPLERBUFFER = 445, + ISAMPLERBUFFER = 446, + USAMPLERBUFFER = 447, + SAMPLERCUBEARRAY = 448, + SAMPLERCUBEARRAYSHADOW = 449, + ISAMPLERCUBEARRAY = 450, + USAMPLERCUBEARRAY = 451, + SAMPLER2DMS = 452, + ISAMPLER2DMS = 453, + USAMPLER2DMS = 454, + SAMPLER2DMSARRAY = 455, + ISAMPLER2DMSARRAY = 456, + USAMPLER2DMSARRAY = 457, + SAMPLEREXTERNALOES = 458, + F16SAMPLER1D = 459, + F16SAMPLER2D = 460, + F16SAMPLER3D = 461, + F16SAMPLER2DRECT = 462, + F16SAMPLERCUBE = 463, + F16SAMPLER1DARRAY = 464, + F16SAMPLER2DARRAY = 465, + F16SAMPLERCUBEARRAY = 466, + F16SAMPLERBUFFER = 467, + F16SAMPLER2DMS = 468, + F16SAMPLER2DMSARRAY = 469, + F16SAMPLER1DSHADOW = 470, + F16SAMPLER2DSHADOW = 471, + F16SAMPLER1DARRAYSHADOW = 472, + F16SAMPLER2DARRAYSHADOW = 473, + F16SAMPLER2DRECTSHADOW = 474, + F16SAMPLERCUBESHADOW = 475, + F16SAMPLERCUBEARRAYSHADOW = 476, + SAMPLER = 477, + SAMPLERSHADOW = 478, + TEXTURE1D = 479, + TEXTURE2D = 480, + TEXTURE3D = 481, + TEXTURECUBE = 482, + TEXTURE1DARRAY = 483, + TEXTURE2DARRAY = 484, + ITEXTURE1D = 485, + ITEXTURE2D = 486, + ITEXTURE3D = 487, + ITEXTURECUBE = 488, + ITEXTURE1DARRAY = 489, + ITEXTURE2DARRAY = 490, + UTEXTURE1D = 491, + UTEXTURE2D = 492, + UTEXTURE3D = 493, + UTEXTURECUBE = 494, + UTEXTURE1DARRAY = 495, + UTEXTURE2DARRAY = 496, + TEXTURE2DRECT = 497, + ITEXTURE2DRECT = 498, + UTEXTURE2DRECT = 499, + TEXTUREBUFFER = 500, + ITEXTUREBUFFER = 501, + UTEXTUREBUFFER = 502, + TEXTURECUBEARRAY = 503, + ITEXTURECUBEARRAY = 504, + UTEXTURECUBEARRAY = 505, + TEXTURE2DMS = 506, + ITEXTURE2DMS = 507, + UTEXTURE2DMS = 508, + TEXTURE2DMSARRAY = 509, + ITEXTURE2DMSARRAY = 510, + UTEXTURE2DMSARRAY = 511, + F16TEXTURE1D = 512, + F16TEXTURE2D = 513, + F16TEXTURE3D = 514, + F16TEXTURE2DRECT = 515, + F16TEXTURECUBE = 516, + F16TEXTURE1DARRAY = 517, + F16TEXTURE2DARRAY = 518, + F16TEXTURECUBEARRAY = 519, + F16TEXTUREBUFFER = 520, + F16TEXTURE2DMS = 521, + F16TEXTURE2DMSARRAY = 522, + SUBPASSINPUT = 523, + SUBPASSINPUTMS = 524, + ISUBPASSINPUT = 525, + ISUBPASSINPUTMS = 526, + USUBPASSINPUT = 527, + USUBPASSINPUTMS = 528, + F16SUBPASSINPUT = 529, + F16SUBPASSINPUTMS = 530, + IMAGE1D = 531, + IIMAGE1D = 532, + UIMAGE1D = 533, + IMAGE2D = 534, + IIMAGE2D = 535, + UIMAGE2D = 536, + IMAGE3D = 537, + IIMAGE3D = 538, + UIMAGE3D = 539, + IMAGE2DRECT = 540, + IIMAGE2DRECT = 541, + UIMAGE2DRECT = 542, + IMAGECUBE = 543, + IIMAGECUBE = 544, + UIMAGECUBE = 545, + IMAGEBUFFER = 546, + IIMAGEBUFFER = 547, + UIMAGEBUFFER = 548, + IMAGE1DARRAY = 549, + IIMAGE1DARRAY = 550, + UIMAGE1DARRAY = 551, + IMAGE2DARRAY = 552, + IIMAGE2DARRAY = 553, + UIMAGE2DARRAY = 554, + IMAGECUBEARRAY = 555, + IIMAGECUBEARRAY = 556, + UIMAGECUBEARRAY = 557, + IMAGE2DMS = 558, + IIMAGE2DMS = 559, + UIMAGE2DMS = 560, + IMAGE2DMSARRAY = 561, + IIMAGE2DMSARRAY = 562, + UIMAGE2DMSARRAY = 563, + F16IMAGE1D = 564, + F16IMAGE2D = 565, + F16IMAGE3D = 566, + F16IMAGE2DRECT = 567, + F16IMAGECUBE = 568, + F16IMAGE1DARRAY = 569, + F16IMAGE2DARRAY = 570, + F16IMAGECUBEARRAY = 571, + F16IMAGEBUFFER = 572, + F16IMAGE2DMS = 573, + F16IMAGE2DMSARRAY = 574, + STRUCT = 575, + VOID = 576, + WHILE = 577, + IDENTIFIER = 578, + TYPE_NAME = 579, + FLOATCONSTANT = 580, + DOUBLECONSTANT = 581, + INT16CONSTANT = 582, + UINT16CONSTANT = 583, + INT32CONSTANT = 584, + UINT32CONSTANT = 585, + INTCONSTANT = 586, + UINTCONSTANT = 587, + INT64CONSTANT = 588, + UINT64CONSTANT = 589, + BOOLCONSTANT = 590, + FLOAT16CONSTANT = 591, + LEFT_OP = 592, + RIGHT_OP = 593, + INC_OP = 594, + DEC_OP = 595, + LE_OP = 596, + GE_OP = 597, + EQ_OP = 598, + NE_OP = 599, + AND_OP = 600, + OR_OP = 601, + XOR_OP = 602, + MUL_ASSIGN = 603, + DIV_ASSIGN = 604, + ADD_ASSIGN = 605, + MOD_ASSIGN = 606, + LEFT_ASSIGN = 607, + RIGHT_ASSIGN = 608, + AND_ASSIGN = 609, + XOR_ASSIGN = 610, + OR_ASSIGN = 611, + SUB_ASSIGN = 612, + LEFT_PAREN = 613, + RIGHT_PAREN = 614, + LEFT_BRACKET = 615, + RIGHT_BRACKET = 616, + LEFT_BRACE = 617, + RIGHT_BRACE = 618, + DOT = 619, + COMMA = 620, + COLON = 621, + EQUAL = 622, + SEMICOLON = 623, + BANG = 624, + DASH = 625, + TILDE = 626, + PLUS = 627, + STAR = 628, + SLASH = 629, + PERCENT = 630, + LEFT_ANGLE = 631, + RIGHT_ANGLE = 632, + VERTICAL_BAR = 633, + CARET = 634, + AMPERSAND = 635, + QUESTION = 636, + INVARIANT = 637, + PRECISE = 638, + HIGH_PRECISION = 639, + MEDIUM_PRECISION = 640, + LOW_PRECISION = 641, + PRECISION = 642, + PACKED = 643, + RESOURCE = 644, + SUPERP = 645 }; #endif /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - +typedef union YYSTYPE YYSTYPE; union YYSTYPE { -#line 68 "MachineIndependent/glslang.y" /* yacc.c:355 */ +#line 70 "MachineIndependent/glslang.y" /* yacc.c:355 */ struct { glslang::TSourceLoc loc; @@ -447,6 +541,7 @@ union YYSTYPE TIntermNode* intermNode; glslang::TIntermNodePair nodePair; glslang::TIntermTyped* intermTypedNode; + glslang::TAttributes* attributes; }; union { glslang::TPublicType type; @@ -459,10 +554,8 @@ union YYSTYPE }; } interm; -#line 463 "MachineIndependent/glslang_tab.cpp" /* yacc.c:355 */ +#line 558 "MachineIndependent/glslang_tab.cpp" /* yacc.c:355 */ }; - -typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif @@ -474,7 +567,7 @@ int yyparse (glslang::TParseContext* pParseContext); #endif /* !YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED */ /* Copy the second part of user declarations. */ -#line 102 "MachineIndependent/glslang.y" /* yacc.c:358 */ +#line 105 "MachineIndependent/glslang.y" /* yacc.c:358 */ /* windows only pragma */ @@ -490,7 +583,7 @@ int yyparse (glslang::TParseContext* pParseContext); extern int yylex(YYSTYPE*, TParseContext&); -#line 494 "MachineIndependent/glslang_tab.cpp" /* yacc.c:358 */ +#line 587 "MachineIndependent/glslang_tab.cpp" /* yacc.c:358 */ #ifdef short # undef short @@ -547,30 +640,11 @@ typedef short int yytype_int16; # endif #endif -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif - -#ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) -#endif - -#if !defined _Noreturn \ - && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) -# if defined _MSC_VER && 1200 <= _MSC_VER -# define _Noreturn __declspec (noreturn) -# else -# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +#ifndef __attribute__ +/* This feature is available in gcc versions 2.5 and later. */ +# if (! defined __GNUC__ || __GNUC__ < 2 \ + || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)) +# define __attribute__(Spec) /* empty */ # endif #endif @@ -730,23 +804,23 @@ union yyalloc #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 274 +#define YYFINAL 366 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 6614 +#define YYLAST 8949 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 298 +#define YYNTOKENS 391 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 100 +#define YYNNTS 107 /* YYNRULES -- Number of rules. */ -#define YYNRULES 450 +#define YYNRULES 556 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 582 +#define YYNSTATES 697 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 552 +#define YYMAXUTOK 645 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -810,59 +884,78 @@ static const yytype_uint16 yytranslate[] = 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297 + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 388, 389, 390 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 253, 253, 259, 262, 265, 269, 273, 277, 283, - 289, 292, 296, 302, 305, 313, 316, 319, 322, 325, - 330, 338, 345, 352, 358, 362, 369, 372, 378, 385, - 395, 403, 408, 438, 444, 448, 452, 472, 473, 474, - 475, 481, 482, 487, 492, 501, 502, 507, 515, 516, - 522, 531, 532, 537, 542, 547, 555, 556, 564, 575, - 576, 585, 586, 595, 596, 605, 606, 614, 615, 623, - 624, 632, 633, 633, 651, 652, 667, 671, 675, 679, - 684, 688, 692, 696, 700, 704, 708, 715, 718, 729, - 736, 741, 746, 754, 758, 762, 766, 771, 776, 785, - 785, 796, 800, 807, 814, 817, 824, 832, 852, 870, - 885, 908, 919, 929, 939, 949, 958, 961, 965, 969, - 974, 982, 987, 992, 997, 1002, 1011, 1022, 1049, 1058, - 1065, 1072, 1079, 1091, 1097, 1100, 1107, 1111, 1115, 1123, - 1132, 1135, 1146, 1149, 1152, 1156, 1160, 1164, 1171, 1175, - 1187, 1201, 1206, 1212, 1218, 1225, 1231, 1236, 1241, 1246, - 1254, 1258, 1262, 1266, 1270, 1274, 1280, 1289, 1292, 1300, - 1304, 1313, 1318, 1326, 1330, 1340, 1344, 1348, 1353, 1360, - 1364, 1369, 1374, 1379, 1386, 1393, 1397, 1402, 1407, 1412, - 1418, 1424, 1430, 1438, 1446, 1454, 1459, 1464, 1469, 1474, - 1479, 1484, 1490, 1496, 1502, 1510, 1518, 1526, 1532, 1538, - 1544, 1550, 1556, 1562, 1570, 1578, 1586, 1591, 1596, 1601, - 1606, 1611, 1616, 1621, 1626, 1631, 1636, 1641, 1646, 1652, - 1658, 1664, 1670, 1676, 1682, 1688, 1694, 1700, 1706, 1712, - 1718, 1726, 1734, 1742, 1750, 1758, 1766, 1774, 1782, 1790, - 1798, 1806, 1814, 1819, 1824, 1829, 1834, 1839, 1844, 1849, - 1854, 1859, 1864, 1869, 1874, 1879, 1884, 1889, 1894, 1899, - 1904, 1909, 1914, 1919, 1924, 1929, 1934, 1939, 1944, 1949, - 1954, 1959, 1964, 1969, 1974, 1979, 1984, 1989, 1994, 1999, - 2004, 2009, 2014, 2019, 2024, 2029, 2034, 2039, 2044, 2049, - 2054, 2059, 2064, 2069, 2074, 2079, 2084, 2089, 2094, 2099, - 2104, 2109, 2114, 2119, 2124, 2129, 2134, 2139, 2144, 2149, - 2154, 2159, 2164, 2169, 2174, 2179, 2184, 2189, 2194, 2199, - 2204, 2209, 2214, 2219, 2224, 2229, 2234, 2239, 2244, 2249, - 2254, 2259, 2264, 2269, 2274, 2279, 2284, 2289, 2294, 2299, - 2304, 2309, 2314, 2319, 2324, 2329, 2334, 2339, 2344, 2349, - 2354, 2359, 2365, 2371, 2377, 2383, 2389, 2395, 2401, 2406, - 2422, 2427, 2432, 2440, 2440, 2451, 2451, 2461, 2464, 2477, - 2495, 2519, 2523, 2529, 2534, 2545, 2548, 2554, 2563, 2566, - 2572, 2576, 2577, 2583, 2584, 2585, 2586, 2587, 2588, 2589, - 2593, 2594, 2598, 2594, 2610, 2611, 2615, 2615, 2622, 2622, - 2636, 2639, 2647, 2655, 2666, 2667, 2671, 2678, 2682, 2690, - 2694, 2707, 2707, 2727, 2730, 2736, 2748, 2760, 2760, 2775, - 2775, 2791, 2791, 2812, 2815, 2821, 2824, 2830, 2834, 2841, - 2846, 2851, 2858, 2861, 2870, 2874, 2883, 2886, 2889, 2897, - 2897 + 0, 293, 293, 299, 302, 306, 310, 313, 317, 321, + 325, 329, 333, 336, 340, 344, 347, 355, 358, 361, + 364, 367, 372, 380, 387, 394, 400, 404, 411, 414, + 420, 427, 437, 445, 450, 477, 485, 491, 495, 499, + 519, 520, 521, 522, 528, 529, 534, 539, 548, 549, + 554, 562, 563, 569, 578, 579, 584, 589, 594, 602, + 603, 611, 622, 623, 632, 633, 642, 643, 652, 653, + 661, 662, 670, 671, 679, 680, 680, 698, 699, 714, + 718, 722, 726, 731, 735, 739, 743, 747, 751, 755, + 762, 765, 776, 783, 788, 793, 801, 805, 809, 813, + 818, 823, 832, 832, 843, 847, 854, 861, 864, 871, + 879, 899, 922, 937, 962, 973, 983, 993, 1003, 1012, + 1015, 1019, 1023, 1028, 1036, 1041, 1046, 1051, 1056, 1065, + 1076, 1103, 1112, 1119, 1126, 1137, 1149, 1155, 1158, 1165, + 1169, 1173, 1181, 1190, 1193, 1204, 1207, 1210, 1214, 1218, + 1222, 1226, 1232, 1236, 1248, 1262, 1267, 1273, 1279, 1286, + 1292, 1297, 1302, 1307, 1315, 1319, 1323, 1327, 1331, 1335, + 1341, 1350, 1357, 1360, 1368, 1372, 1381, 1386, 1394, 1398, + 1408, 1412, 1416, 1421, 1426, 1431, 1436, 1440, 1445, 1450, + 1455, 1460, 1465, 1470, 1475, 1480, 1485, 1489, 1494, 1499, + 1504, 1510, 1516, 1522, 1528, 1534, 1540, 1546, 1552, 1558, + 1564, 1570, 1576, 1581, 1586, 1591, 1596, 1601, 1606, 1612, + 1618, 1624, 1630, 1636, 1642, 1648, 1654, 1660, 1666, 1672, + 1678, 1684, 1690, 1696, 1702, 1708, 1714, 1720, 1726, 1732, + 1738, 1744, 1750, 1756, 1762, 1768, 1773, 1778, 1783, 1788, + 1793, 1798, 1803, 1808, 1813, 1818, 1823, 1828, 1834, 1840, + 1846, 1852, 1858, 1864, 1870, 1876, 1882, 1888, 1894, 1900, + 1906, 1912, 1918, 1924, 1930, 1936, 1942, 1948, 1954, 1960, + 1966, 1972, 1978, 1984, 1990, 1996, 2002, 2008, 2014, 2020, + 2026, 2032, 2038, 2044, 2050, 2056, 2062, 2068, 2074, 2080, + 2086, 2092, 2098, 2104, 2110, 2116, 2121, 2126, 2131, 2136, + 2141, 2146, 2151, 2156, 2161, 2166, 2171, 2176, 2181, 2186, + 2194, 2202, 2210, 2218, 2226, 2234, 2242, 2250, 2258, 2266, + 2274, 2282, 2290, 2295, 2300, 2305, 2310, 2315, 2320, 2325, + 2330, 2335, 2340, 2345, 2350, 2355, 2360, 2365, 2370, 2378, + 2386, 2391, 2396, 2401, 2409, 2414, 2419, 2424, 2432, 2437, + 2442, 2447, 2455, 2460, 2465, 2470, 2475, 2480, 2488, 2493, + 2501, 2506, 2514, 2519, 2527, 2532, 2540, 2545, 2553, 2558, + 2566, 2571, 2576, 2581, 2586, 2591, 2596, 2601, 2606, 2611, + 2616, 2621, 2626, 2631, 2636, 2641, 2649, 2654, 2659, 2664, + 2672, 2677, 2682, 2687, 2695, 2700, 2705, 2710, 2718, 2723, + 2728, 2733, 2741, 2746, 2751, 2756, 2764, 2769, 2774, 2779, + 2787, 2792, 2797, 2802, 2810, 2815, 2820, 2825, 2833, 2838, + 2843, 2848, 2856, 2861, 2866, 2871, 2879, 2884, 2889, 2894, + 2902, 2907, 2912, 2917, 2925, 2930, 2935, 2940, 2948, 2953, + 2958, 2963, 2971, 2976, 2981, 2987, 2993, 2999, 3008, 3017, + 3023, 3029, 3035, 3041, 3046, 3062, 3067, 3072, 3080, 3080, + 3091, 3091, 3101, 3104, 3117, 3139, 3166, 3170, 3176, 3181, + 3192, 3195, 3201, 3210, 3213, 3219, 3223, 3224, 3230, 3231, + 3232, 3233, 3234, 3235, 3236, 3240, 3241, 3245, 3241, 3257, + 3258, 3262, 3262, 3269, 3269, 3283, 3286, 3294, 3302, 3313, + 3314, 3318, 3321, 3327, 3334, 3338, 3346, 3350, 3363, 3366, + 3372, 3372, 3392, 3395, 3401, 3413, 3425, 3428, 3434, 3434, + 3449, 3449, 3465, 3465, 3486, 3489, 3495, 3498, 3504, 3508, + 3515, 3520, 3525, 3532, 3535, 3544, 3548, 3557, 3560, 3563, + 3571, 3571, 3593, 3599, 3602, 3607, 3610 }; #endif @@ -871,25 +964,34 @@ static const yytype_uint16 yyrline[] = First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "ATTRIBUTE", "VARYING", "CONST", "BOOL", - "FLOAT", "DOUBLE", "INT", "UINT", "INT64_T", "UINT64_T", "INT16_T", - "UINT16_T", "FLOAT16_T", "BREAK", "CONTINUE", "DO", "ELSE", "FOR", "IF", - "DISCARD", "RETURN", "SWITCH", "CASE", "DEFAULT", "SUBROUTINE", "BVEC2", - "BVEC3", "BVEC4", "IVEC2", "IVEC3", "IVEC4", "I64VEC2", "I64VEC3", - "I64VEC4", "UVEC2", "UVEC3", "UVEC4", "U64VEC2", "U64VEC3", "U64VEC4", - "VEC2", "VEC3", "VEC4", "MAT2", "MAT3", "MAT4", "CENTROID", "IN", "OUT", - "INOUT", "UNIFORM", "PATCH", "SAMPLE", "BUFFER", "SHARED", "COHERENT", - "VOLATILE", "RESTRICT", "READONLY", "WRITEONLY", "DVEC2", "DVEC3", - "DVEC4", "DMAT2", "DMAT3", "DMAT4", "F16VEC2", "F16VEC3", "F16VEC4", - "F16MAT2", "F16MAT3", "F16MAT4", "I16VEC2", "I16VEC3", "I16VEC4", - "U16VEC2", "U16VEC3", "U16VEC4", "NOPERSPECTIVE", "FLAT", "SMOOTH", - "LAYOUT", "__EXPLICITINTERPAMD", "MAT2X2", "MAT2X3", "MAT2X4", "MAT3X2", - "MAT3X3", "MAT3X4", "MAT4X2", "MAT4X3", "MAT4X4", "DMAT2X2", "DMAT2X3", - "DMAT2X4", "DMAT3X2", "DMAT3X3", "DMAT3X4", "DMAT4X2", "DMAT4X3", - "DMAT4X4", "F16MAT2X2", "F16MAT2X3", "F16MAT2X4", "F16MAT3X2", - "F16MAT3X3", "F16MAT3X4", "F16MAT4X2", "F16MAT4X3", "F16MAT4X4", - "ATOMIC_UINT", "SAMPLER1D", "SAMPLER2D", "SAMPLER3D", "SAMPLERCUBE", - "SAMPLER1DSHADOW", "SAMPLER2DSHADOW", "SAMPLERCUBESHADOW", + "$end", "error", "$undefined", "ATTRIBUTE", "VARYING", "FLOAT16_T", + "FLOAT", "FLOAT32_T", "DOUBLE", "FLOAT64_T", "CONST", "BOOL", "INT", + "UINT", "INT64_T", "UINT64_T", "INT32_T", "UINT32_T", "INT16_T", + "UINT16_T", "INT8_T", "UINT8_T", "BREAK", "CONTINUE", "DO", "ELSE", + "FOR", "IF", "DISCARD", "RETURN", "SWITCH", "CASE", "DEFAULT", + "SUBROUTINE", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3", "IVEC4", + "UVEC2", "UVEC3", "UVEC4", "I64VEC2", "I64VEC3", "I64VEC4", "U64VEC2", + "U64VEC3", "U64VEC4", "I32VEC2", "I32VEC3", "I32VEC4", "U32VEC2", + "U32VEC3", "U32VEC4", "I16VEC2", "I16VEC3", "I16VEC4", "U16VEC2", + "U16VEC3", "U16VEC4", "I8VEC2", "I8VEC3", "I8VEC4", "U8VEC2", "U8VEC3", + "U8VEC4", "VEC2", "VEC3", "VEC4", "MAT2", "MAT3", "MAT4", "CENTROID", + "IN", "OUT", "INOUT", "UNIFORM", "PATCH", "SAMPLE", "BUFFER", "SHARED", + "NONUNIFORM", "COHERENT", "VOLATILE", "RESTRICT", "READONLY", + "WRITEONLY", "DVEC2", "DVEC3", "DVEC4", "DMAT2", "DMAT3", "DMAT4", + "F16VEC2", "F16VEC3", "F16VEC4", "F16MAT2", "F16MAT3", "F16MAT4", + "F32VEC2", "F32VEC3", "F32VEC4", "F32MAT2", "F32MAT3", "F32MAT4", + "F64VEC2", "F64VEC3", "F64VEC4", "F64MAT2", "F64MAT3", "F64MAT4", + "NOPERSPECTIVE", "FLAT", "SMOOTH", "LAYOUT", "__EXPLICITINTERPAMD", + "MAT2X2", "MAT2X3", "MAT2X4", "MAT3X2", "MAT3X3", "MAT3X4", "MAT4X2", + "MAT4X3", "MAT4X4", "DMAT2X2", "DMAT2X3", "DMAT2X4", "DMAT3X2", + "DMAT3X3", "DMAT3X4", "DMAT4X2", "DMAT4X3", "DMAT4X4", "F16MAT2X2", + "F16MAT2X3", "F16MAT2X4", "F16MAT3X2", "F16MAT3X3", "F16MAT3X4", + "F16MAT4X2", "F16MAT4X3", "F16MAT4X4", "F32MAT2X2", "F32MAT2X3", + "F32MAT2X4", "F32MAT3X2", "F32MAT3X3", "F32MAT3X4", "F32MAT4X2", + "F32MAT4X3", "F32MAT4X4", "F64MAT2X2", "F64MAT2X3", "F64MAT2X4", + "F64MAT3X2", "F64MAT3X3", "F64MAT3X4", "F64MAT4X2", "F64MAT4X3", + "F64MAT4X4", "ATOMIC_UINT", "SAMPLER1D", "SAMPLER2D", "SAMPLER3D", + "SAMPLERCUBE", "SAMPLER1DSHADOW", "SAMPLER2DSHADOW", "SAMPLERCUBESHADOW", "SAMPLER1DARRAY", "SAMPLER2DARRAY", "SAMPLER1DARRAYSHADOW", "SAMPLER2DARRAYSHADOW", "ISAMPLER1D", "ISAMPLER2D", "ISAMPLER3D", "ISAMPLERCUBE", "ISAMPLER1DARRAY", "ISAMPLER2DARRAY", "USAMPLER1D", @@ -899,27 +1001,41 @@ static const char *const yytname[] = "USAMPLERBUFFER", "SAMPLERCUBEARRAY", "SAMPLERCUBEARRAYSHADOW", "ISAMPLERCUBEARRAY", "USAMPLERCUBEARRAY", "SAMPLER2DMS", "ISAMPLER2DMS", "USAMPLER2DMS", "SAMPLER2DMSARRAY", "ISAMPLER2DMSARRAY", - "USAMPLER2DMSARRAY", "SAMPLEREXTERNALOES", "SAMPLER", "SAMPLERSHADOW", - "TEXTURE1D", "TEXTURE2D", "TEXTURE3D", "TEXTURECUBE", "TEXTURE1DARRAY", - "TEXTURE2DARRAY", "ITEXTURE1D", "ITEXTURE2D", "ITEXTURE3D", - "ITEXTURECUBE", "ITEXTURE1DARRAY", "ITEXTURE2DARRAY", "UTEXTURE1D", - "UTEXTURE2D", "UTEXTURE3D", "UTEXTURECUBE", "UTEXTURE1DARRAY", - "UTEXTURE2DARRAY", "TEXTURE2DRECT", "ITEXTURE2DRECT", "UTEXTURE2DRECT", - "TEXTUREBUFFER", "ITEXTUREBUFFER", "UTEXTUREBUFFER", "TEXTURECUBEARRAY", - "ITEXTURECUBEARRAY", "UTEXTURECUBEARRAY", "TEXTURE2DMS", "ITEXTURE2DMS", - "UTEXTURE2DMS", "TEXTURE2DMSARRAY", "ITEXTURE2DMSARRAY", - "UTEXTURE2DMSARRAY", "SUBPASSINPUT", "SUBPASSINPUTMS", "ISUBPASSINPUT", - "ISUBPASSINPUTMS", "USUBPASSINPUT", "USUBPASSINPUTMS", "IMAGE1D", - "IIMAGE1D", "UIMAGE1D", "IMAGE2D", "IIMAGE2D", "UIMAGE2D", "IMAGE3D", - "IIMAGE3D", "UIMAGE3D", "IMAGE2DRECT", "IIMAGE2DRECT", "UIMAGE2DRECT", - "IMAGECUBE", "IIMAGECUBE", "UIMAGECUBE", "IMAGEBUFFER", "IIMAGEBUFFER", - "UIMAGEBUFFER", "IMAGE1DARRAY", "IIMAGE1DARRAY", "UIMAGE1DARRAY", - "IMAGE2DARRAY", "IIMAGE2DARRAY", "UIMAGE2DARRAY", "IMAGECUBEARRAY", - "IIMAGECUBEARRAY", "UIMAGECUBEARRAY", "IMAGE2DMS", "IIMAGE2DMS", - "UIMAGE2DMS", "IMAGE2DMSARRAY", "IIMAGE2DMSARRAY", "UIMAGE2DMSARRAY", - "STRUCT", "VOID", "WHILE", "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT", - "DOUBLECONSTANT", "INTCONSTANT", "UINTCONSTANT", "INT64CONSTANT", - "UINT64CONSTANT", "INT16CONSTANT", "UINT16CONSTANT", "BOOLCONSTANT", + "USAMPLER2DMSARRAY", "SAMPLEREXTERNALOES", "F16SAMPLER1D", + "F16SAMPLER2D", "F16SAMPLER3D", "F16SAMPLER2DRECT", "F16SAMPLERCUBE", + "F16SAMPLER1DARRAY", "F16SAMPLER2DARRAY", "F16SAMPLERCUBEARRAY", + "F16SAMPLERBUFFER", "F16SAMPLER2DMS", "F16SAMPLER2DMSARRAY", + "F16SAMPLER1DSHADOW", "F16SAMPLER2DSHADOW", "F16SAMPLER1DARRAYSHADOW", + "F16SAMPLER2DARRAYSHADOW", "F16SAMPLER2DRECTSHADOW", + "F16SAMPLERCUBESHADOW", "F16SAMPLERCUBEARRAYSHADOW", "SAMPLER", + "SAMPLERSHADOW", "TEXTURE1D", "TEXTURE2D", "TEXTURE3D", "TEXTURECUBE", + "TEXTURE1DARRAY", "TEXTURE2DARRAY", "ITEXTURE1D", "ITEXTURE2D", + "ITEXTURE3D", "ITEXTURECUBE", "ITEXTURE1DARRAY", "ITEXTURE2DARRAY", + "UTEXTURE1D", "UTEXTURE2D", "UTEXTURE3D", "UTEXTURECUBE", + "UTEXTURE1DARRAY", "UTEXTURE2DARRAY", "TEXTURE2DRECT", "ITEXTURE2DRECT", + "UTEXTURE2DRECT", "TEXTUREBUFFER", "ITEXTUREBUFFER", "UTEXTUREBUFFER", + "TEXTURECUBEARRAY", "ITEXTURECUBEARRAY", "UTEXTURECUBEARRAY", + "TEXTURE2DMS", "ITEXTURE2DMS", "UTEXTURE2DMS", "TEXTURE2DMSARRAY", + "ITEXTURE2DMSARRAY", "UTEXTURE2DMSARRAY", "F16TEXTURE1D", "F16TEXTURE2D", + "F16TEXTURE3D", "F16TEXTURE2DRECT", "F16TEXTURECUBE", + "F16TEXTURE1DARRAY", "F16TEXTURE2DARRAY", "F16TEXTURECUBEARRAY", + "F16TEXTUREBUFFER", "F16TEXTURE2DMS", "F16TEXTURE2DMSARRAY", + "SUBPASSINPUT", "SUBPASSINPUTMS", "ISUBPASSINPUT", "ISUBPASSINPUTMS", + "USUBPASSINPUT", "USUBPASSINPUTMS", "F16SUBPASSINPUT", + "F16SUBPASSINPUTMS", "IMAGE1D", "IIMAGE1D", "UIMAGE1D", "IMAGE2D", + "IIMAGE2D", "UIMAGE2D", "IMAGE3D", "IIMAGE3D", "UIMAGE3D", "IMAGE2DRECT", + "IIMAGE2DRECT", "UIMAGE2DRECT", "IMAGECUBE", "IIMAGECUBE", "UIMAGECUBE", + "IMAGEBUFFER", "IIMAGEBUFFER", "UIMAGEBUFFER", "IMAGE1DARRAY", + "IIMAGE1DARRAY", "UIMAGE1DARRAY", "IMAGE2DARRAY", "IIMAGE2DARRAY", + "UIMAGE2DARRAY", "IMAGECUBEARRAY", "IIMAGECUBEARRAY", "UIMAGECUBEARRAY", + "IMAGE2DMS", "IIMAGE2DMS", "UIMAGE2DMS", "IMAGE2DMSARRAY", + "IIMAGE2DMSARRAY", "UIMAGE2DMSARRAY", "F16IMAGE1D", "F16IMAGE2D", + "F16IMAGE3D", "F16IMAGE2DRECT", "F16IMAGECUBE", "F16IMAGE1DARRAY", + "F16IMAGE2DARRAY", "F16IMAGECUBEARRAY", "F16IMAGEBUFFER", "F16IMAGE2DMS", + "F16IMAGE2DMSARRAY", "STRUCT", "VOID", "WHILE", "IDENTIFIER", + "TYPE_NAME", "FLOATCONSTANT", "DOUBLECONSTANT", "INT16CONSTANT", + "UINT16CONSTANT", "INT32CONSTANT", "UINT32CONSTANT", "INTCONSTANT", + "UINTCONSTANT", "INT64CONSTANT", "UINT64CONSTANT", "BOOLCONSTANT", "FLOAT16CONSTANT", "LEFT_OP", "RIGHT_OP", "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP", "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN", "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", @@ -949,20 +1065,24 @@ static const char *const yytname[] = "fully_specified_type", "invariant_qualifier", "interpolation_qualifier", "layout_qualifier", "layout_qualifier_id_list", "layout_qualifier_id", "precise_qualifier", "type_qualifier", "single_type_qualifier", - "storage_qualifier", "type_name_list", "type_specifier", - "array_specifier", "type_specifier_nonarray", "precision_qualifier", - "struct_specifier", "$@3", "$@4", "struct_declaration_list", - "struct_declaration", "struct_declarator_list", "struct_declarator", - "initializer", "initializer_list", "declaration_statement", "statement", + "storage_qualifier", "non_uniform_qualifier", "type_name_list", + "type_specifier", "array_specifier", "type_specifier_nonarray", + "precision_qualifier", "struct_specifier", "$@3", "$@4", + "struct_declaration_list", "struct_declaration", + "struct_declarator_list", "struct_declarator", "initializer", + "initializer_list", "declaration_statement", "statement", "simple_statement", "compound_statement", "$@5", "$@6", "statement_no_new_scope", "statement_scoped", "$@7", "$@8", "compound_statement_no_new_scope", "statement_list", "expression_statement", "selection_statement", - "selection_rest_statement", "condition", "switch_statement", "$@9", - "switch_statement_list", "case_label", "iteration_statement", "$@10", - "$@11", "$@12", "for_init_statement", "conditionopt", - "for_rest_statement", "jump_statement", "translation_unit", - "external_declaration", "function_definition", "$@13", YY_NULLPTR + "selection_statement_nonattributed", "selection_rest_statement", + "condition", "switch_statement", "switch_statement_nonattributed", "$@9", + "switch_statement_list", "case_label", "iteration_statement", + "iteration_statement_nonattributed", "$@10", "$@11", "$@12", + "for_init_statement", "conditionopt", "for_rest_statement", + "jump_statement", "translation_unit", "external_declaration", + "function_definition", "$@13", "attribute", "attribute_list", + "single_attribute", YY_NULL }; #endif @@ -1000,16 +1120,26 @@ static const yytype_uint16 yytoknum[] = 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, - 545, 546, 547, 548, 549, 550, 551, 552 + 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, + 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, + 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, + 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, + 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, + 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, + 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, + 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645 }; # endif -#define YYPACT_NINF -525 +#define YYPACT_NINF -634 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-525))) + (!!((Yystate) == (-634))) -#define YYTABLE_NINF -407 +#define YYTABLE_NINF -502 #define yytable_value_is_error(Yytable_value) \ 0 @@ -1018,65 +1148,76 @@ static const yytype_uint16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - 2619, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -243, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -228, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -215, -525, -525, -525, - -525, -525, -525, -525, -525, -157, -525, -216, -218, -205, - -141, 4260, -165, -525, -94, -525, -525, -525, -525, 3183, - -525, -525, -525, -117, -525, -525, 575, -525, -525, -80, - -48, -114, -525, 6381, -242, -525, -525, -113, -525, 4260, - -525, -525, -525, 4260, -75, -74, -525, -235, -190, -525, - -525, -525, 4765, -108, -525, -525, -525, -186, -525, -112, - -178, -525, -525, 4260, -115, -525, -226, 867, -525, -525, - -525, -525, -117, -229, -525, 5039, -224, -525, -71, -525, - -158, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, 5861, 5861, 5861, -525, -525, -525, -525, -525, - -525, -525, -223, -525, -525, -525, -102, -177, 6121, -100, - -525, 5861, -204, -171, -132, -221, -199, -124, -120, -111, - -84, -83, -233, -98, -525, 5313, -525, -60, 5861, -525, - -48, 4260, 4260, -59, 3456, -525, -525, -525, -99, -97, - -525, -90, -88, -96, 5587, -85, 5861, -92, -79, -81, - -525, -525, -191, -525, -525, -153, -525, -218, -78, -525, - -525, -525, -525, 1159, -525, -525, -525, -525, -525, -525, - -108, 5039, -193, 5039, -525, -525, 5039, 4260, -525, -47, - -525, -525, -525, -176, -525, -525, 5861, -42, -525, -525, - 5861, -73, -525, -525, -525, 5861, 5861, 5861, 5861, 5861, - 5861, 5861, 5861, 5861, 5861, 5861, 5861, 5861, 5861, 5861, - 5861, 5861, 5861, 5861, -525, -525, -525, -76, -525, -525, - -525, -525, 3724, -59, -117, -152, -525, -525, -525, -525, - -525, 1451, -525, 5861, -525, -525, -143, 5861, -180, -525, - -525, -525, 1451, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, 5861, 5861, -525, -525, -525, -525, - 5039, -525, -133, -525, 3992, -525, -525, -72, -77, -525, - -525, -525, -525, -525, -204, -204, -171, -171, -132, -132, - -132, -132, -221, -221, -199, -124, -120, -111, -84, -83, - 5861, -525, -525, -142, -108, -59, -525, -37, 2327, -175, - -525, -163, -525, 2892, 1451, -525, -525, -525, -525, 4491, - -525, -525, -129, -525, -525, -68, -525, -525, 2892, -70, - -525, -77, -32, 4260, -63, -66, -525, -525, 5861, 5861, - -525, -69, -61, 188, -58, 2035, -525, -56, -57, 1743, - -525, -525, -161, 5861, 1743, -70, -525, -525, 1451, 5039, - -525, -525, -525, -67, -77, -525, -525, 1451, -54, -525, - -525, -525 + 3391, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -311, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -295, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -301, -634, -634, + -634, -634, -634, -634, -634, -634, -241, -634, -302, -342, + -290, -254, 5696, -300, -634, -210, -634, -634, -634, -634, + 4160, -634, -634, -634, -634, -219, -634, -634, 696, -634, + -634, -189, -69, -207, -634, 8625, -320, -634, -634, -203, + -634, 5696, -634, -634, -634, 5696, -155, -154, -634, -324, + -288, -634, -634, -634, 6417, -190, -634, -634, -634, -292, + -634, -196, -287, -634, -634, 5696, -195, -634, -306, 1081, + -634, -634, -634, -634, -219, -325, -634, 6785, -310, -634, + -151, -634, -277, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, 7889, 7889, 7889, -634, + -634, -634, -634, -634, -634, -634, -309, -634, -634, -634, + -185, -283, 8257, -183, -634, 7889, -227, -263, -299, -318, + -194, -204, -202, -200, -165, -166, -321, -179, -634, -634, + 7153, -634, -140, 7889, -634, -69, 5696, 5696, -139, 4544, + -634, -634, -634, -182, -180, -634, -173, -169, -178, 7521, + -164, 7889, -174, -163, -167, -162, -634, -634, -252, -634, + -634, -237, -634, -342, -161, -158, -634, -634, -634, -634, + 1466, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -19, -190, 6785, -296, 6785, -634, -634, 6785, 5696, -634, + -127, -634, -634, -634, -278, -634, -634, 7889, -121, -634, + -634, 7889, -156, -634, -634, -634, 7889, 7889, 7889, 7889, + 7889, 7889, 7889, 7889, 7889, 7889, 7889, 7889, 7889, 7889, + 7889, 7889, 7889, 7889, 7889, -634, -634, -634, -157, -634, + -634, -634, -634, 4928, -139, -219, -236, -634, -634, -634, + -634, -634, 1851, -634, 7889, -634, -634, -230, 7889, -213, + -634, -634, -118, -634, 1851, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, 7889, 7889, -634, -634, + -634, -634, -634, -634, -634, 6785, -634, -270, -634, 5312, + -634, -634, -153, -150, -634, -634, -634, -634, -634, -227, + -227, -263, -263, -299, -299, -299, -299, -318, -318, -194, + -204, -202, -200, -165, -166, 7889, -634, -634, -226, -190, + -139, -634, -113, 3006, -275, -634, -253, -634, 3776, -148, + -282, -634, 1851, -634, -634, -634, -634, 6049, -634, -634, + -208, -634, -634, -147, -634, -634, 3776, -146, -634, -150, + -111, 5696, -145, 7889, -144, -118, -143, -634, -634, 7889, + 7889, -634, -149, -141, 196, -136, 2621, -634, -116, -120, + 2236, -137, -634, -634, -634, -634, -239, 7889, 2236, -146, + -634, -634, 1851, 6785, -634, -634, -634, -634, -119, -150, + -634, -634, 1851, -112, -634, -634, -634 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1084,95 +1225,108 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_uint16 yydefact[] = { - 0, 149, 150, 148, 185, 176, 177, 179, 180, 181, - 182, 183, 184, 178, 165, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 207, 208, 209, 210, 211, 212, - 186, 187, 188, 216, 217, 218, 154, 152, 153, 151, - 157, 155, 156, 158, 159, 160, 161, 162, 163, 164, - 189, 190, 191, 228, 229, 230, 192, 193, 194, 240, - 241, 242, 204, 205, 206, 213, 214, 215, 131, 130, - 129, 0, 132, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 266, 267, 268, 269, 270, 271, 273, 274, - 275, 276, 277, 278, 280, 281, 282, 283, 284, 285, - 286, 264, 265, 272, 279, 287, 288, 289, 290, 291, - 292, 361, 293, 294, 295, 296, 297, 298, 299, 300, - 302, 303, 304, 305, 306, 307, 309, 310, 311, 312, - 313, 314, 316, 317, 318, 319, 320, 321, 301, 308, - 315, 322, 323, 324, 325, 326, 327, 362, 363, 364, - 365, 366, 367, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 0, 175, 369, 448, - 128, 139, 370, 371, 372, 0, 447, 0, 449, 0, - 105, 104, 0, 116, 121, 146, 145, 143, 147, 0, - 140, 142, 126, 169, 144, 368, 0, 444, 446, 0, - 0, 0, 375, 0, 0, 93, 90, 0, 103, 0, - 112, 106, 114, 0, 115, 0, 91, 122, 0, 96, - 141, 127, 0, 170, 1, 445, 167, 0, 138, 136, - 0, 134, 373, 0, 0, 94, 0, 0, 450, 107, - 111, 113, 109, 117, 108, 0, 123, 99, 0, 97, - 0, 2, 10, 11, 4, 5, 6, 7, 8, 9, - 13, 12, 0, 0, 0, 171, 39, 38, 40, 37, - 3, 15, 33, 17, 22, 23, 0, 0, 27, 0, - 41, 0, 45, 48, 51, 56, 59, 61, 63, 65, - 67, 69, 71, 0, 31, 0, 166, 0, 0, 133, - 0, 0, 0, 0, 0, 377, 92, 95, 0, 0, - 429, 0, 0, 0, 0, 0, 0, 0, 0, 401, - 410, 414, 41, 74, 87, 0, 390, 0, 126, 393, - 412, 392, 391, 0, 394, 395, 396, 397, 398, 399, - 110, 0, 118, 0, 385, 125, 0, 0, 101, 0, - 98, 34, 35, 0, 19, 20, 0, 0, 25, 24, - 0, 175, 28, 30, 36, 0, 0, 0, 0, 0, + 0, 153, 154, 183, 181, 184, 182, 185, 152, 196, + 186, 187, 194, 195, 192, 193, 190, 191, 188, 189, + 169, 212, 213, 214, 215, 216, 217, 230, 231, 232, + 227, 228, 229, 242, 243, 244, 224, 225, 226, 239, + 240, 241, 221, 222, 223, 236, 237, 238, 218, 219, + 220, 233, 234, 235, 197, 198, 199, 245, 246, 247, + 158, 156, 157, 155, 161, 159, 160, 162, 163, 171, + 164, 165, 166, 167, 168, 200, 201, 202, 257, 258, + 259, 203, 204, 205, 269, 270, 271, 206, 207, 208, + 281, 282, 283, 209, 210, 211, 293, 294, 295, 134, + 133, 132, 0, 135, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 332, 333, 334, 335, 336, 337, 339, 340, 341, + 342, 343, 344, 346, 347, 350, 351, 352, 354, 355, + 317, 318, 338, 345, 356, 358, 359, 360, 362, 363, + 454, 319, 320, 321, 348, 322, 326, 327, 330, 353, + 357, 361, 323, 324, 328, 329, 349, 325, 331, 364, + 365, 366, 368, 370, 372, 374, 376, 380, 381, 382, + 383, 384, 385, 387, 388, 389, 390, 391, 392, 394, + 396, 397, 398, 400, 401, 378, 386, 393, 402, 404, + 405, 406, 408, 409, 367, 369, 371, 395, 373, 375, + 377, 379, 399, 403, 407, 455, 456, 459, 460, 461, + 462, 457, 458, 410, 412, 413, 414, 416, 417, 418, + 420, 421, 422, 424, 425, 426, 428, 429, 430, 432, + 433, 434, 436, 437, 438, 440, 441, 442, 444, 445, + 446, 448, 449, 450, 452, 453, 411, 415, 419, 423, + 427, 435, 439, 443, 431, 447, 451, 0, 180, 464, + 549, 131, 142, 465, 466, 467, 0, 548, 0, 550, + 0, 108, 107, 0, 119, 124, 149, 148, 146, 150, + 0, 143, 145, 151, 129, 174, 147, 463, 0, 545, + 547, 0, 0, 0, 470, 0, 0, 96, 93, 0, + 106, 0, 115, 109, 117, 0, 118, 0, 94, 125, + 0, 99, 144, 130, 0, 175, 1, 546, 172, 0, + 141, 139, 0, 137, 468, 0, 0, 97, 0, 0, + 551, 110, 114, 116, 112, 120, 111, 0, 126, 102, + 0, 100, 0, 2, 12, 13, 10, 11, 4, 5, + 6, 7, 8, 9, 15, 14, 0, 0, 0, 176, + 42, 41, 43, 40, 3, 17, 36, 19, 24, 25, + 0, 0, 29, 0, 44, 0, 48, 51, 54, 59, + 62, 64, 66, 68, 70, 72, 74, 0, 35, 33, + 0, 170, 0, 0, 136, 0, 0, 0, 0, 0, + 472, 95, 98, 0, 0, 530, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 496, 505, 509, 44, 77, + 90, 0, 485, 0, 151, 129, 488, 507, 487, 486, + 0, 489, 490, 511, 491, 518, 492, 493, 526, 494, + 0, 113, 0, 121, 0, 480, 128, 0, 0, 104, + 0, 101, 37, 38, 0, 21, 22, 0, 0, 27, + 26, 0, 180, 30, 32, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 72, 172, 173, 0, 168, 89, - 137, 135, 0, 0, 383, 0, 381, 376, 378, 440, - 439, 0, 431, 0, 443, 441, 0, 0, 0, 426, - 427, 400, 0, 77, 78, 80, 79, 82, 83, 84, - 85, 86, 81, 76, 0, 0, 415, 411, 413, 120, - 0, 388, 0, 124, 0, 102, 14, 0, 21, 18, - 29, 42, 43, 44, 47, 46, 49, 50, 54, 55, - 52, 53, 57, 58, 60, 62, 64, 66, 68, 70, - 0, 174, 374, 0, 384, 0, 379, 0, 0, 0, - 442, 0, 425, 0, 402, 75, 88, 119, 386, 0, - 100, 16, 0, 380, 382, 0, 434, 433, 436, 408, - 421, 419, 0, 0, 0, 0, 387, 389, 0, 0, - 435, 0, 0, 418, 0, 0, 416, 0, 0, 0, - 403, 73, 0, 437, 0, 408, 407, 409, 423, 0, - 405, 428, 404, 0, 438, 432, 417, 424, 0, 420, - 430, 422 + 0, 0, 0, 0, 0, 75, 177, 178, 0, 173, + 92, 140, 138, 0, 0, 478, 0, 476, 471, 473, + 541, 540, 0, 532, 0, 544, 542, 0, 0, 0, + 525, 528, 0, 495, 0, 80, 81, 83, 82, 85, + 86, 87, 88, 89, 84, 79, 0, 0, 510, 506, + 508, 512, 519, 527, 123, 0, 483, 0, 127, 0, + 105, 16, 0, 23, 20, 31, 45, 46, 47, 50, + 49, 52, 53, 57, 58, 55, 56, 60, 61, 63, + 65, 67, 69, 71, 73, 0, 179, 469, 0, 479, + 0, 474, 0, 0, 0, 543, 0, 524, 0, 555, + 0, 553, 497, 78, 91, 122, 481, 0, 103, 18, + 0, 475, 477, 0, 535, 534, 537, 503, 520, 516, + 0, 0, 0, 0, 0, 0, 0, 482, 484, 0, + 0, 536, 0, 0, 515, 0, 0, 513, 0, 0, + 0, 0, 552, 554, 498, 76, 0, 538, 0, 503, + 502, 504, 522, 0, 500, 529, 499, 556, 0, 539, + 533, 514, 523, 0, 517, 531, 521 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, - -525, -525, -103, -525, -278, -274, -297, -273, -214, -211, - -210, -212, -209, -208, -525, -261, -525, -292, -525, -308, - -525, 4, -525, -525, -525, 5, -525, -525, -525, -41, - -38, -39, -525, -525, -504, -525, -525, -525, -525, -123, - -525, -230, -237, -525, -525, 0, -246, -525, 1, -525, - -525, -525, -337, -342, -207, -286, -378, -525, -285, -376, - -524, -322, -525, -525, -330, -327, -525, -525, -22, -452, - -275, -525, -525, -298, -525, -525, -525, -525, -525, -525, - -525, -525, -525, -525, -525, -525, -525, -2, -525, -525 + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -289, -634, -358, -355, -401, -364, -279, -307, + -276, -280, -273, -281, -634, -354, -634, -378, -634, -367, + -397, 1, -634, -634, -634, 2, -634, -634, -634, -98, + -93, -92, -634, -634, -600, -634, -634, -634, -634, -181, + -634, -319, -326, -634, 6, -634, 0, -332, -634, -54, + -634, -634, -634, -428, -433, -272, -353, -477, -634, -357, + -467, -633, -400, -634, -634, -410, -408, -634, -634, -80, + -545, -350, -634, -216, -634, -371, -634, -214, -634, -634, + -634, -634, -212, -634, -634, -634, -634, -634, -634, -634, + -634, -61, -634, -634, -634, -634, -375 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 320, 321, 322, 487, 323, 324, 325, 326, 327, - 328, 329, 372, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 373, 510, 374, 474, 375, - 440, 376, 227, 397, 300, 377, 229, 230, 231, 260, - 261, 262, 232, 233, 234, 235, 236, 237, 280, 281, - 238, 239, 240, 241, 277, 344, 273, 243, 244, 245, - 351, 283, 354, 355, 445, 446, 395, 482, 379, 380, - 381, 382, 462, 545, 571, 553, 554, 555, 572, 383, - 384, 385, 556, 544, 386, 557, 578, 387, 388, 523, - 451, 518, 538, 551, 552, 389, 246, 247, 248, 257 + -1, 414, 415, 416, 592, 417, 418, 419, 420, 421, + 422, 423, 468, 425, 426, 427, 428, 429, 430, 431, + 432, 433, 434, 435, 436, 469, 615, 470, 576, 471, + 541, 472, 318, 498, 392, 473, 320, 321, 322, 352, + 353, 354, 323, 324, 325, 326, 327, 328, 372, 373, + 329, 330, 331, 332, 438, 369, 439, 365, 335, 336, + 337, 446, 375, 449, 450, 546, 547, 496, 587, 476, + 477, 478, 479, 564, 656, 685, 664, 665, 666, 686, + 480, 481, 482, 483, 667, 652, 484, 485, 668, 693, + 486, 487, 488, 628, 552, 623, 646, 662, 663, 489, + 338, 339, 340, 349, 490, 630, 631 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1180,155 +1334,118 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 242, 263, 270, 394, 226, 228, 403, 478, 286, 278, - 524, 343, 448, 479, 442, 481, 254, 251, 483, 542, - 433, 296, 249, 404, 405, 272, 270, 422, 423, 263, - 294, 567, 272, 285, 542, 570, 412, 250, 272, 295, - 570, 345, -32, 345, 406, 391, 390, 392, 407, 357, - 396, 426, 427, 352, 252, 434, 456, 256, 458, 255, - 484, 258, 424, 425, 463, 464, 465, 466, 467, 468, - 469, 470, 471, 472, 345, 517, 415, 416, 417, 297, - 346, 480, 298, 473, 437, 299, 347, 439, 349, 409, - 486, 539, 475, 522, 350, 410, 475, 475, 488, 394, - 448, 394, 527, 540, 394, 573, 418, 265, 419, 475, - 266, 475, 420, 421, 399, 270, 577, 400, 490, 475, - 515, 352, 476, 516, 352, 498, 499, 500, 501, 475, - 515, 259, 520, 533, 222, 223, 224, 528, 267, 529, - 494, 495, 448, 475, 548, 519, 496, 497, 478, 521, - 272, 547, 276, 502, 503, 282, 287, 292, 293, 345, - 356, 398, 348, 428, 408, 413, 429, 352, 431, 330, - 435, 432, 438, 444, 430, 452, 449, 453, 450, 454, - 457, 459, 525, 526, 279, 485, 460, -31, 394, 461, - 489, 579, 511, -26, 535, 475, 531, 549, 514, -406, - 558, 478, 532, 559, 560, 564, 563, 565, 580, 401, - 402, 369, 352, 568, 504, 541, 581, 569, 505, 507, - 506, 289, 290, 508, 291, 509, 253, 441, 414, 534, - 541, 264, 566, 536, 575, 288, 513, 394, 576, 271, - 550, 562, 330, 537, 275, 330, 242, 0, 0, 0, - 226, 228, 0, 284, 352, 574, 561, 0, 0, 264, - 0, 0, 0, 264, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 394, 0, 0, - 0, 0, 0, 353, 0, 0, 0, 378, 0, 0, - 0, 0, 0, 543, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 270, 0, 543, 0, - 0, 0, 491, 492, 493, 330, 330, 330, 330, 330, - 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, - 330, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 353, 443, 0, 353, 0, 0, 0, 0, 0, + 334, 317, 319, 355, 362, 455, 333, 456, 457, 495, + 437, 460, 370, 580, 378, 584, 549, 586, 543, 632, + 588, 346, 343, 523, 524, 534, 348, 388, 650, 362, + 505, 506, 355, 681, 386, 364, 364, 684, 521, 522, + 364, 504, 492, 387, 513, 684, 650, 341, 377, -34, + 440, 507, 491, 493, 440, 508, 447, 497, 525, 526, + 535, 344, 452, 342, 440, 357, 347, 441, 358, 350, + 589, 585, 444, 442, 389, 424, 510, 390, 445, 654, + 391, 591, 511, 655, 647, 622, 538, 577, 500, 540, + 577, 501, 557, 636, 559, 637, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 648, 519, 635, 520, + 549, 351, 577, 359, 495, 575, 495, 502, 503, 495, + 688, 362, 603, 604, 605, 606, 577, 447, 577, 620, + 447, 578, 621, 595, 368, 577, 515, 692, 625, 620, + 593, 364, 641, 313, 314, 315, 516, 517, 518, 527, + 528, 424, 577, 627, 424, 374, 549, 577, 659, 379, + 658, 599, 600, 607, 608, 580, 601, 602, 384, 385, + 440, 443, 499, 451, 509, 514, 529, 530, 531, 447, + 532, 533, 536, 539, 545, 553, 550, 624, 551, 554, + 555, 626, 560, 562, 558, 561, 590, -35, 633, 634, + -33, 563, 594, -28, 616, 629, 694, 495, 639, 643, + 653, 660, 669, 619, 670, 577, -501, 672, 678, 677, + 674, 679, 687, 610, 447, 580, 465, 596, 597, 598, + 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, + 424, 424, 424, 424, 424, 424, 682, 683, 640, 695, + 609, 696, 612, 614, 371, 611, 671, 382, 381, 495, + 613, 649, 345, 383, 542, 680, 644, 642, 690, 380, + 447, 691, 618, 645, 581, 661, 582, 367, 583, 649, + 673, 675, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 676, 0, 0, 0, 0, 0, 540, + 0, 0, 0, 463, 0, 495, 0, 0, 0, 651, + 689, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 356, 0, 0, 362, 0, 651, 333, 0, + 363, 0, 0, 0, 0, 0, 333, 0, 334, 317, + 319, 0, 0, 0, 333, 376, 0, 0, 0, 0, + 0, 356, 0, 0, 0, 356, 0, 333, 0, 0, + 0, 333, 0, 0, 424, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 448, 0, 0, 0, 475, + 0, 333, 0, 0, 0, 474, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 378, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 448, 544, 0, 448, + 0, 0, 333, 333, 0, 333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 353, 0, 0, 0, 0, 0, 0, 0, - 0, 378, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 378, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 353, 0, 0, 0, 0, 0, + 475, 0, 0, 0, 0, 0, 474, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 448, 0, + 0, 0, 0, 0, 333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 378, 0, - 0, 0, 0, 378, 378, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 378, 0, - 0, 0, 0, 271, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 378, 0, 0, 0, 378, - 0, 0, 0, 0, 378, 0, 0, 0, 378, 0, - 0, 0, 0, 0, 0, 274, 0, 378, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 0, 0, 218, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 448, 0, 0, 0, 0, 0, 333, + 0, 0, 475, 0, 0, 0, 0, 0, 474, 0, + 0, 0, 0, 0, 475, 0, 0, 0, 0, 0, + 474, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 448, + 0, 0, 0, 0, 0, 333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 475, 0, 0, 0, 0, 475, 474, + 0, 0, 475, 0, 474, 0, 0, 0, 474, 0, + 0, 0, 0, 0, 0, 0, 475, 0, 0, 0, + 0, 363, 474, 0, 0, 0, 0, 333, 0, 0, + 0, 0, 0, 0, 0, 0, 475, 0, 0, 0, + 475, 0, 474, 0, 0, 0, 474, 0, 475, 0, + 0, 0, 475, 0, 474, 0, 0, 0, 474, 0, + 0, 0, 475, 0, 0, 0, 366, 0, 474, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 0, 0, + 309, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 219, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 220, 221, 222, 223, 224, 225, - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 358, 359, 360, 0, 361, 362, 363, - 364, 365, 366, 367, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 368, 301, - 218, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 0, 0, 312, 313, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 314, 0, 0, 0, 369, 370, 0, 0, - 0, 0, 371, 316, 317, 318, 319, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 220, 221, 222, 223, - 224, 225, 1, 2, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 358, 359, 360, 0, 361, - 362, 363, 364, 365, 366, 367, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 368, 301, 218, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 0, 0, 312, 313, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 314, 0, 0, 0, 369, 477, - 0, 0, 0, 0, 371, 316, 317, 318, 319, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 220, 221, - 222, 223, 224, 225, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 358, 359, 360, - 0, 361, 362, 363, 364, 365, 366, 367, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 0, 0, 0, 0, 310, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 311, 312, + 313, 314, 315, 316, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 453, 454, 455, 0, 456, 457, 458, + 459, 460, 461, 462, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, @@ -1348,187 +1465,25 @@ static const yytype_int16 yytable[] = 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 368, 301, 218, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 0, 0, 312, 313, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 314, 0, 0, 0, - 369, 0, 0, 0, 0, 0, 371, 316, 317, 318, - 319, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 220, 221, 222, 223, 224, 225, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 358, - 359, 360, 0, 361, 362, 363, 364, 365, 366, 367, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 368, 301, 218, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 0, 0, 312, - 313, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 314, 0, - 0, 0, 287, 0, 0, 0, 0, 0, 371, 316, - 317, 318, 319, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 220, 221, 222, 223, 224, 225, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 358, 359, 360, 0, 361, 362, 363, 364, 365, - 366, 367, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 368, 301, 218, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 0, - 0, 312, 313, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 314, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 371, 316, 317, 318, 319, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 220, 221, 222, 223, 224, 225, - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 0, 301, - 218, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 0, 0, 312, 313, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 314, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 371, 316, 317, 318, 319, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 220, 221, 222, 223, - 224, 225, 1, 2, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 0, 0, 218, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 219, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 220, 221, - 222, 223, 224, 225, 0, 0, 0, 0, 0, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 0, 301, 218, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 0, 0, 312, 313, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 314, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 316, 317, - 318, 319, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 220, 221, 222, 223, 224, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 0, 268, 218, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 269, 1, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 463, 393, 309, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 0, 0, + 406, 407, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 408, + 0, 464, 0, 465, 466, 0, 0, 0, 0, 467, + 410, 411, 412, 413, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 311, 312, 313, 314, 315, 316, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 220, 221, 222, 223, 224, 0, 0, 0, - 0, 0, 0, 14, 15, 16, 17, 18, 19, 20, + 12, 13, 14, 15, 16, 17, 18, 19, 453, 454, + 455, 0, 456, 457, 458, 459, 460, 461, 462, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, @@ -1548,259 +1503,31 @@ static const yytype_int16 yytable[] = 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 0, 0, 218, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 463, 393, + 309, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 0, 0, 406, 407, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 447, 1, 2, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 0, 0, 0, 0, 0, 220, 221, 222, 223, 224, - 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 0, 0, 218, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 512, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 0, 0, - 0, 0, 0, 220, 221, 222, 223, 224, 0, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 0, 0, 218, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 530, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 0, 0, 0, 0, - 0, 220, 221, 222, 223, 224, 0, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 0, 0, 218, 0, 0, 0, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 220, - 221, 222, 223, 224, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 0, 0, 0, 0, 0, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 0, 301, 218, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 0, 0, 312, 313, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 314, 0, 0, 0, - 393, 546, 0, 0, 0, 0, 0, 316, 317, 318, - 319, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 0, 0, 0, 0, - 0, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 0, 301, 218, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 0, - 0, 312, 313, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 314, 0, 0, 315, 0, 0, 0, 0, 0, 0, - 0, 316, 317, 318, 319, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 0, 0, 0, 0, 0, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 0, 301, 218, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 0, 0, 312, 313, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 314, 0, 0, 0, 393, 0, - 0, 0, 0, 0, 0, 316, 317, 318, 319, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 0, 0, 0, 0, 0, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 0, 301, 218, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 0, 0, 312, - 313, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 314, 0, - 0, 436, 0, 0, 0, 0, 0, 0, 0, 316, - 317, 318, 319, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 0, 0, - 0, 0, 0, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 0, 301, - 218, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 0, 0, 312, 313, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 314, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 455, 316, 317, 318, 319, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 0, 0, 0, 0, 0, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 0, 301, 218, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 0, 0, 312, 313, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 314, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 316, 317, 318, - 319, 0, 0, 0, 0, 0, 0, 0, 0, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 0, 0, 0, 0, 408, 0, 464, 0, 465, 579, + 0, 0, 0, 0, 467, 410, 411, 412, 413, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 311, 312, + 313, 314, 315, 316, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 453, 454, 455, 0, 456, 457, 458, + 459, 460, 461, 462, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 50, 51, 52, 53, 54, 55, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 0, 0, 0, 0, 0, 73, 74, 75, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, @@ -1815,18 +1542,69 @@ static const yytype_int16 yytable[] = 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 411, 0, 301, 218, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 0, 0, 312, 313, 0, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 463, 393, 309, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 0, 0, + 406, 407, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 408, + 0, 464, 0, 465, 0, 0, 0, 0, 0, 467, + 410, 411, 412, 413, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 311, 312, 313, 314, 315, 316, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 453, 454, + 455, 0, 456, 457, 458, 459, 460, 461, 462, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 463, 393, + 309, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 0, 0, 406, 407, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 314, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 316, 317, 318, - 319, 0, 0, 0, 0, 0, 0, 0, 0, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 0, 0, 0, 0, 408, 0, 464, 0, 379, 0, + 0, 0, 0, 0, 467, 410, 411, 412, 413, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 311, 312, + 313, 314, 315, 316, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 453, 454, 455, 0, 456, 457, 458, + 459, 460, 461, 462, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 50, 51, 52, 53, 54, 55, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 0, 0, 0, 0, 0, 73, 74, 75, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, @@ -1841,129 +1619,25 @@ static const yytype_int16 yytable[] = 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 0, 0, 218 -}; - -static const yytype_int16 yycheck[] = -{ - 0, 231, 239, 295, 0, 0, 314, 383, 254, 57, - 462, 272, 354, 391, 351, 393, 232, 232, 396, 523, - 253, 267, 265, 246, 247, 267, 263, 248, 249, 259, - 265, 555, 267, 275, 538, 559, 328, 265, 267, 274, - 564, 267, 265, 267, 267, 274, 292, 293, 271, 275, - 274, 250, 251, 283, 269, 288, 364, 275, 366, 275, - 397, 266, 283, 284, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 267, 451, 280, 281, 282, 269, - 266, 274, 272, 274, 345, 275, 272, 348, 266, 266, - 266, 266, 272, 273, 272, 272, 272, 272, 406, 391, - 442, 393, 480, 266, 396, 266, 277, 272, 279, 272, - 275, 272, 244, 245, 272, 352, 568, 275, 410, 272, - 272, 351, 275, 275, 354, 422, 423, 424, 425, 272, - 272, 272, 275, 275, 291, 292, 293, 270, 232, 272, - 418, 419, 484, 272, 273, 453, 420, 421, 524, 457, - 267, 529, 232, 426, 427, 269, 269, 232, 232, 267, - 275, 232, 274, 287, 266, 265, 286, 397, 252, 272, - 268, 254, 232, 232, 285, 265, 275, 265, 275, 275, - 265, 273, 474, 475, 232, 232, 265, 265, 480, 270, - 232, 569, 268, 266, 231, 272, 268, 265, 444, 269, - 232, 577, 510, 266, 270, 266, 275, 19, 275, 312, - 313, 269, 442, 269, 428, 523, 270, 274, 429, 431, - 430, 259, 263, 432, 263, 433, 225, 350, 331, 515, - 538, 231, 554, 518, 564, 257, 443, 529, 565, 239, - 538, 549, 345, 518, 246, 348, 246, -1, -1, -1, - 246, 246, -1, 253, 484, 563, 548, -1, -1, 259, - -1, -1, -1, 263, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 569, -1, -1, - -1, -1, -1, 283, -1, -1, -1, 287, -1, -1, - -1, -1, -1, 523, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 543, -1, 538, -1, - -1, -1, 415, 416, 417, 418, 419, 420, 421, 422, - 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 351, 352, -1, 354, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 383, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 397, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 442, -1, -1, -1, -1, -1, -1, -1, - -1, 451, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 462, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 484, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 518, -1, - -1, -1, -1, 523, 524, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 538, -1, - -1, -1, -1, 543, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 555, -1, -1, -1, 559, - -1, -1, -1, -1, 564, -1, -1, -1, 568, -1, - -1, -1, -1, -1, -1, 0, -1, 577, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, -1, -1, 233, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 275, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 289, 290, 291, 292, 293, 294, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, -1, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, -1, -1, 246, 247, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 265, -1, -1, -1, 269, 270, -1, -1, - -1, -1, 275, 276, 277, 278, 279, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 289, 290, 291, 292, - 293, 294, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, -1, 20, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 463, 393, 309, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 0, 0, + 406, 407, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 408, + 0, 464, 0, 0, 0, 0, 0, 0, 0, 467, + 410, 411, 412, 413, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 311, 312, 313, 314, 315, 316, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, @@ -1986,43 +1660,100 @@ static const yytype_int16 yycheck[] = 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, -1, -1, 246, 247, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 265, -1, -1, -1, 269, 270, - -1, -1, -1, -1, 275, 276, 277, 278, 279, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 289, 290, - 291, 292, 293, 294, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, -1, -1, 246, 247, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 265, -1, -1, -1, - 269, -1, -1, -1, -1, -1, 275, 276, 277, 278, - 279, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 289, 290, 291, 292, 293, 294, 3, 4, 5, 6, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 0, 393, + 309, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 0, 0, 406, 407, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 408, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 467, 410, 411, 412, 413, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 311, 312, + 313, 314, 315, 316, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, -1, 20, 21, 22, 23, 24, 25, 26, + 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 0, 0, 309, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 310, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 311, 312, 313, 314, 315, 316, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 0, 393, + 309, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 0, 0, 406, 407, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 408, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 410, 411, 412, 413, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 311, 312, + 313, 314, 315, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, @@ -2044,14 +1775,100 @@ static const yytype_int16 yycheck[] = 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, -1, -1, 246, - 247, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 265, -1, - -1, -1, 269, -1, -1, -1, -1, -1, 275, 276, - 277, 278, 279, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 289, 290, 291, 292, 293, 294, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, -1, 20, 21, 22, 23, 24, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 0, 360, 309, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 361, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 311, 312, 313, 314, 315, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 0, 0, 309, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 548, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 311, 312, 313, 314, + 315, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 0, 0, 309, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 617, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 311, 312, 313, 314, 315, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, @@ -2073,44 +1890,24 @@ static const yytype_int16 yycheck[] = 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, -1, - -1, 246, 247, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 265, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 275, 276, 277, 278, 279, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 289, 290, 291, 292, 293, 294, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, -1, -1, 246, 247, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 265, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 275, 276, 277, 278, 279, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 289, 290, 291, 292, - 293, 294, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 27, 28, 29, 30, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 0, 0, 309, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 638, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 311, 312, 313, 314, 315, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, @@ -2131,21 +1928,29 @@ static const yytype_int16 yycheck[] = 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - -1, -1, 233, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 275, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 289, 290, - 291, 292, 293, 294, -1, -1, -1, -1, -1, 27, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 0, 0, + 309, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 4, 5, 6, 7, 0, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 0, 0, 0, 0, 0, 0, 0, 311, 312, + 313, 314, 315, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 58, 59, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 69, 0, 0, 0, 0, 0, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 98, 0, 0, 0, 0, 0, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, @@ -2158,50 +1963,104 @@ static const yytype_int16 yycheck[] = 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, -1, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, -1, -1, 246, 247, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 265, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 276, 277, - 278, 279, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 289, 290, 291, 292, 293, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, -1, 232, 233, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 275, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 289, 290, 291, 292, 293, -1, -1, -1, - -1, -1, -1, 27, 28, 29, 30, 31, 32, 33, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 0, 393, 309, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 405, 0, 0, 406, 407, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 408, 0, 0, + 0, 494, 657, 0, 0, 0, 0, 0, 410, 411, + 412, 413, 3, 4, 5, 6, 7, 0, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, + 0, 0, 0, 0, 0, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 0, + 0, 0, 0, 0, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 0, + 393, 309, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 0, 0, 406, 407, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 408, 0, 0, 409, 0, + 0, 0, 0, 0, 0, 0, 410, 411, 412, 413, + 3, 4, 5, 6, 7, 0, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 69, 0, 0, + 0, 0, 0, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 0, 0, 0, + 0, 0, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 0, 393, 309, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, + 404, 405, 0, 0, 406, 407, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 408, 0, 0, 0, 494, 0, 0, + 0, 0, 0, 0, 410, 411, 412, 413, 3, 4, + 5, 6, 7, 0, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 54, 55, 56, 57, 58, 59, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, + 0, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 94, 95, 96, 97, 98, 0, 0, 0, 0, 0, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, @@ -2214,21 +2073,31 @@ static const yytype_int16 yycheck[] = 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 270, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - -1, -1, -1, -1, -1, 289, 290, 291, 292, 293, - -1, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 0, 393, 309, 394, 395, + 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, + 0, 0, 406, 407, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 408, 0, 0, 537, 0, 0, 0, 0, 0, + 0, 0, 410, 411, 412, 413, 3, 4, 5, 6, + 7, 0, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 56, 57, 58, 59, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 69, 0, 0, 0, 0, 0, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 96, 97, 98, 0, 0, 0, 0, 0, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, @@ -2241,21 +2110,31 @@ static const yytype_int16 yycheck[] = 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, -1, -1, 233, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 270, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, -1, -1, - -1, -1, -1, 289, 290, 291, 292, 293, -1, 27, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 0, 393, 309, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 0, 0, + 406, 407, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 408, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 556, + 410, 411, 412, 413, 3, 4, 5, 6, 7, 0, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 58, 59, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 69, 0, 0, 0, 0, 0, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 98, 0, 0, 0, 0, 0, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, @@ -2268,21 +2147,31 @@ static const yytype_int16 yycheck[] = 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, -1, -1, 233, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 270, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, - -1, 289, 290, 291, 292, 293, -1, 27, 28, 29, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 0, 393, 309, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 405, 0, 0, 406, 407, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 408, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 410, 411, + 412, 413, 3, 4, 5, 6, 7, 0, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, + 0, 0, 0, 0, 0, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 0, + 0, 0, 0, 0, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, @@ -2295,15 +2184,172 @@ static const yytype_int16 yycheck[] = 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, -1, -1, 233, -1, -1, -1, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 28, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 512, 0, + 393, 309, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 0, 0, 406, 407, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 408, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 410, 411, 412, 413, + 3, 4, 5, 6, 7, 0, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 0, 0, 0, + 0, 0, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 0, 0, 309 +}; + +static const yytype_int16 yycheck[] = +{ + 0, 0, 0, 322, 330, 24, 0, 26, 27, 387, + 364, 30, 81, 480, 346, 492, 449, 494, 446, 564, + 497, 323, 323, 341, 342, 346, 368, 359, 628, 355, + 339, 340, 351, 666, 358, 360, 360, 670, 337, 338, + 360, 408, 367, 367, 422, 678, 646, 358, 368, 358, + 360, 360, 384, 385, 360, 364, 375, 367, 376, 377, + 381, 362, 368, 358, 360, 365, 368, 359, 368, 359, + 498, 367, 359, 365, 362, 364, 359, 365, 365, 361, + 368, 359, 365, 365, 359, 552, 440, 365, 365, 443, + 365, 368, 459, 363, 461, 365, 348, 349, 350, 351, + 352, 353, 354, 355, 356, 357, 359, 370, 585, 372, + 543, 365, 365, 323, 492, 367, 494, 406, 407, 497, + 359, 447, 523, 524, 525, 526, 365, 446, 365, 365, + 449, 368, 368, 511, 323, 365, 425, 682, 368, 365, + 507, 360, 368, 384, 385, 386, 373, 374, 375, 343, + 344, 440, 365, 366, 443, 362, 589, 365, 366, 362, + 637, 519, 520, 527, 528, 632, 521, 522, 323, 323, + 360, 367, 323, 368, 359, 358, 380, 379, 378, 498, + 345, 347, 361, 323, 323, 358, 368, 554, 368, 358, + 368, 558, 366, 360, 358, 358, 323, 358, 576, 577, + 358, 363, 323, 359, 361, 323, 683, 585, 361, 322, + 358, 358, 323, 545, 359, 365, 362, 361, 359, 368, + 363, 25, 359, 530, 543, 692, 362, 516, 517, 518, + 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, + 529, 530, 531, 532, 533, 534, 362, 367, 615, 368, + 529, 363, 532, 534, 323, 531, 653, 355, 351, 637, + 533, 628, 316, 355, 445, 665, 623, 620, 678, 349, + 589, 679, 544, 623, 490, 646, 490, 338, 490, 646, + 655, 659, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 660, -1, -1, -1, -1, -1, 653, + -1, -1, -1, 322, -1, 683, -1, -1, -1, 628, + 677, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 322, -1, -1, 651, -1, 646, 322, -1, + 330, -1, -1, -1, -1, -1, 330, -1, 338, 338, + 338, -1, -1, -1, 338, 345, -1, -1, -1, -1, + -1, 351, -1, -1, -1, 355, -1, 351, -1, -1, + -1, 355, -1, -1, 653, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 375, -1, -1, -1, 379, + -1, 375, -1, -1, -1, 379, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 446, 447, -1, 449, + -1, -1, 446, 447, -1, 449, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 480, -1, -1, -1, -1, -1, 480, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 498, -1, + -1, -1, -1, -1, 498, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 543, -1, -1, -1, -1, -1, 543, + -1, -1, 552, -1, -1, -1, -1, -1, 552, -1, + -1, -1, -1, -1, 564, -1, -1, -1, -1, -1, + 564, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 589, + -1, -1, -1, -1, -1, 589, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 623, -1, -1, -1, -1, 628, 623, + -1, -1, 632, -1, 628, -1, -1, -1, 632, -1, + -1, -1, -1, -1, -1, -1, 646, -1, -1, -1, + -1, 651, 646, -1, -1, -1, -1, 651, -1, -1, + -1, -1, -1, -1, -1, -1, 666, -1, -1, -1, + 670, -1, 666, -1, -1, -1, 670, -1, 678, -1, + -1, -1, 682, -1, 678, -1, -1, -1, 682, -1, + -1, -1, 692, -1, -1, -1, 0, -1, 692, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, -1, -1, + 324, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 368, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 382, 383, + 384, 385, 386, 387, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 289, - 290, 291, 292, 293, 63, 64, 65, 66, 67, 68, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, -1, -1, -1, -1, -1, 86, 87, 88, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, @@ -2318,129 +2364,69 @@ static const yytype_int16 yycheck[] = 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, -1, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, -1, -1, 246, 247, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 265, -1, -1, -1, - 269, 270, -1, -1, -1, -1, -1, 276, 277, 278, - 279, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, -1, -1, -1, -1, - -1, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, -1, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, -1, - -1, 246, 247, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 265, -1, -1, 268, -1, -1, -1, -1, -1, -1, - -1, 276, 277, 278, 279, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - -1, -1, -1, -1, -1, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - -1, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, -1, -1, 246, 247, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 265, -1, -1, -1, 269, -1, - -1, -1, -1, -1, -1, 276, 277, 278, 279, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, -1, -1, -1, -1, -1, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, -1, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, -1, -1, 246, - 247, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 265, -1, - -1, 268, -1, -1, -1, -1, -1, -1, -1, 276, - 277, 278, 279, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, -1, -1, - -1, -1, -1, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, -1, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, -1, -1, 246, 247, -1, -1, -1, -1, -1, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, -1, -1, + 339, 340, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 358, + -1, 360, -1, 362, 363, -1, -1, -1, -1, 368, + 369, 370, 371, 372, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 382, 383, 384, 385, 386, 387, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, -1, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, -1, -1, 339, 340, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 265, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 275, 276, 277, 278, 279, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 28, + -1, -1, -1, -1, 358, -1, 360, -1, 362, 363, + -1, -1, -1, -1, 368, 369, 370, 371, 372, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 382, 383, + 384, 385, 386, 387, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 63, 64, 65, 66, 67, 68, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, -1, -1, -1, -1, -1, 86, 87, 88, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, @@ -2455,18 +2441,69 @@ static const yytype_int16 yycheck[] = 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, -1, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, -1, -1, 246, 247, -1, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, -1, -1, + 339, 340, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 358, + -1, 360, -1, 362, -1, -1, -1, -1, -1, 368, + 369, 370, 371, 372, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 382, 383, 384, 385, 386, 387, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, -1, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, -1, -1, 339, 340, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 265, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 276, 277, 278, - 279, -1, -1, -1, -1, -1, -1, -1, -1, 28, + -1, -1, -1, -1, 358, -1, 360, -1, 362, -1, + -1, -1, -1, -1, 368, 369, 370, 371, 372, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 382, 383, + 384, 385, 386, 387, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 63, 64, 65, 66, 67, 68, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, -1, -1, -1, -1, -1, 86, 87, 88, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, @@ -2481,18 +2518,69 @@ static const yytype_int16 yycheck[] = 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, -1, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, -1, -1, 246, 247, -1, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, -1, -1, + 339, 340, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 358, + -1, 360, -1, -1, -1, -1, -1, -1, -1, 368, + 369, 370, 371, 372, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 382, 383, 384, 385, 386, 387, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, -1, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, -1, -1, 339, 340, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 265, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 276, 277, 278, - 279, -1, -1, -1, -1, -1, -1, -1, -1, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + -1, -1, -1, -1, 358, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 368, 369, 370, 371, 372, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 382, 383, + 384, 385, 386, 387, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 63, 64, 65, 66, 67, 68, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, -1, -1, -1, -1, -1, 86, 87, 88, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, @@ -2507,152 +2595,699 @@ static const yytype_int16 yycheck[] = 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, -1, -1, 233 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint16 yystos[] = -{ - 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 233, 275, - 289, 290, 291, 292, 293, 294, 329, 330, 333, 334, - 335, 336, 340, 341, 342, 343, 344, 345, 348, 349, - 350, 351, 353, 355, 356, 357, 394, 395, 396, 265, - 265, 232, 269, 356, 232, 275, 275, 397, 266, 272, - 337, 338, 339, 349, 353, 272, 275, 232, 232, 275, - 350, 353, 267, 354, 0, 395, 232, 352, 57, 232, - 346, 347, 269, 359, 353, 275, 354, 269, 376, 338, - 337, 339, 232, 232, 265, 274, 354, 269, 272, 275, - 332, 232, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 246, 247, 265, 268, 276, 277, 278, 279, - 299, 300, 301, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 320, 321, 322, 323, 353, 267, 266, 272, 274, 266, - 272, 358, 349, 353, 360, 361, 275, 275, 16, 17, - 18, 20, 21, 22, 23, 24, 25, 26, 231, 269, - 270, 275, 310, 323, 325, 327, 329, 333, 353, 366, - 367, 368, 369, 377, 378, 379, 382, 385, 386, 393, - 354, 274, 354, 269, 325, 364, 274, 331, 232, 272, - 275, 310, 310, 327, 246, 247, 267, 271, 266, 266, - 272, 230, 325, 265, 310, 280, 281, 282, 277, 279, - 244, 245, 248, 249, 283, 284, 250, 251, 287, 286, - 285, 252, 254, 253, 288, 268, 268, 323, 232, 323, - 328, 347, 360, 353, 232, 362, 363, 270, 361, 275, - 275, 388, 265, 265, 275, 275, 327, 265, 327, 273, - 265, 270, 370, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 274, 326, 272, 275, 270, 367, 364, - 274, 364, 365, 364, 360, 232, 266, 302, 327, 232, - 325, 310, 310, 310, 312, 312, 313, 313, 314, 314, - 314, 314, 315, 315, 316, 317, 318, 319, 320, 321, - 324, 268, 270, 362, 354, 272, 275, 367, 389, 327, - 275, 327, 273, 387, 377, 325, 325, 364, 270, 272, - 270, 268, 327, 275, 363, 231, 366, 378, 390, 266, - 266, 327, 342, 349, 381, 371, 270, 364, 273, 265, - 381, 391, 392, 373, 374, 375, 380, 383, 232, 266, - 270, 325, 327, 275, 266, 19, 369, 368, 269, 274, - 368, 372, 376, 266, 327, 372, 373, 377, 384, 364, - 275, 270 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint16 yyr1[] = -{ - 0, 298, 299, 300, 300, 300, 300, 300, 300, 300, - 300, 300, 300, 300, 300, 301, 301, 301, 301, 301, - 301, 302, 303, 304, 305, 305, 306, 306, 307, 307, - 308, 309, 309, 310, 310, 310, 310, 311, 311, 311, - 311, 312, 312, 312, 312, 313, 313, 313, 314, 314, - 314, 315, 315, 315, 315, 315, 316, 316, 316, 317, - 317, 318, 318, 319, 319, 320, 320, 321, 321, 322, - 322, 323, 324, 323, 325, 325, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 327, 327, 328, - 329, 329, 329, 329, 329, 329, 329, 329, 329, 331, - 330, 332, 332, 333, 334, 334, 335, 335, 336, 337, - 337, 338, 338, 338, 338, 339, 340, 340, 340, 340, - 340, 341, 341, 341, 341, 341, 342, 342, 343, 344, - 344, 344, 344, 345, 346, 346, 347, 347, 347, 348, - 349, 349, 350, 350, 350, 350, 350, 350, 351, 351, - 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, - 351, 351, 351, 351, 351, 351, 351, 352, 352, 353, - 353, 354, 354, 354, 354, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 356, 356, 356, 358, 357, 359, 357, 360, 360, 361, - 361, 362, 362, 363, 363, 364, 364, 364, 365, 365, - 366, 367, 367, 368, 368, 368, 368, 368, 368, 368, - 369, 370, 371, 369, 372, 372, 374, 373, 375, 373, - 376, 376, 377, 377, 378, 378, 379, 380, 380, 381, - 381, 383, 382, 384, 384, 385, 385, 387, 386, 388, - 386, 389, 386, 390, 390, 391, 391, 392, 392, 393, - 393, 393, 393, 393, 394, 394, 395, 395, 395, 397, - 396 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 1, 4, 1, 3, 2, - 2, 1, 1, 1, 2, 2, 2, 1, 2, 3, - 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, - 1, 1, 3, 3, 3, 1, 3, 3, 1, 3, - 3, 1, 3, 3, 3, 3, 1, 3, 3, 1, - 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 0, 6, 1, 3, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, - 2, 2, 4, 2, 3, 4, 2, 3, 4, 0, - 6, 2, 3, 2, 1, 1, 2, 3, 3, 2, - 3, 2, 1, 2, 1, 1, 1, 3, 4, 6, - 5, 1, 2, 3, 5, 4, 1, 2, 1, 1, - 1, 1, 1, 4, 1, 3, 1, 3, 1, 1, - 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 4, 1, 3, 1, - 2, 2, 3, 3, 4, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, -1, -1, 324, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 368, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 382, 383, 384, 385, 386, 387, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, -1, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, -1, -1, 339, 340, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 358, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 369, 370, 371, 372, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 382, 383, + 384, 385, 386, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, -1, 323, 324, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 368, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 382, 383, 384, 385, 386, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, -1, -1, 324, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 363, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 382, 383, 384, 385, + 386, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + -1, -1, 324, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 363, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 382, 383, 384, 385, 386, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, -1, -1, 324, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 363, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 382, 383, 384, 385, 386, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, -1, -1, + 324, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 5, 6, 7, 8, 9, -1, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, -1, -1, -1, -1, -1, -1, -1, 382, 383, + 384, 385, 386, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 82, -1, -1, -1, -1, -1, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, -1, -1, -1, -1, -1, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, -1, -1, 339, 340, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 358, -1, -1, + -1, 362, 363, -1, -1, -1, -1, -1, 369, 370, + 371, 372, 5, 6, 7, 8, 9, -1, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, + -1, -1, -1, -1, -1, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, + -1, -1, -1, -1, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, -1, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, -1, -1, 339, 340, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 358, -1, -1, 361, -1, + -1, -1, -1, -1, -1, -1, 369, 370, 371, 372, + 5, 6, 7, 8, 9, -1, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 82, -1, -1, + -1, -1, -1, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, -1, -1, -1, + -1, -1, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, -1, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, -1, -1, 339, 340, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 358, -1, -1, -1, 362, -1, -1, + -1, -1, -1, -1, 369, 370, 371, 372, 5, 6, + 7, 8, 9, -1, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 82, -1, -1, -1, -1, + -1, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, -1, -1, -1, -1, -1, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, -1, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + -1, -1, 339, 340, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 358, -1, -1, 361, -1, -1, -1, -1, -1, + -1, -1, 369, 370, 371, 372, 5, 6, 7, 8, + 9, -1, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 82, -1, -1, -1, -1, -1, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, -1, -1, -1, -1, -1, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, -1, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, -1, -1, + 339, 340, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 358, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 368, + 369, 370, 371, 372, 5, 6, 7, 8, 9, -1, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 82, -1, -1, -1, -1, -1, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, -1, -1, -1, -1, -1, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, -1, -1, 339, 340, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 358, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 369, 370, + 371, 372, 5, 6, 7, 8, 9, -1, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, + -1, -1, -1, -1, -1, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, + -1, -1, -1, -1, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, -1, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, -1, -1, 339, 340, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 358, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 369, 370, 371, 372, + 5, 6, 7, 8, 9, -1, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, -1, -1, -1, + -1, -1, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, -1, -1, 324 +}; + + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint16 yystos[] = +{ + 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 324, + 368, 382, 383, 384, 385, 386, 387, 422, 423, 426, + 427, 428, 429, 433, 434, 435, 436, 437, 438, 441, + 442, 443, 444, 445, 447, 449, 450, 451, 491, 492, + 493, 358, 358, 323, 362, 450, 323, 368, 368, 494, + 359, 365, 430, 431, 432, 442, 447, 365, 368, 323, + 323, 368, 443, 447, 360, 448, 0, 492, 323, 446, + 81, 323, 439, 440, 362, 453, 447, 368, 448, 362, + 470, 431, 430, 432, 323, 323, 358, 367, 448, 362, + 365, 368, 425, 323, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 339, 340, 358, 361, + 369, 370, 371, 372, 392, 393, 394, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, 415, 416, 445, 447, + 360, 359, 365, 367, 359, 365, 452, 442, 447, 454, + 455, 368, 368, 22, 23, 24, 26, 27, 28, 29, + 30, 31, 32, 322, 360, 362, 363, 368, 403, 416, + 418, 420, 422, 426, 445, 447, 460, 461, 462, 463, + 471, 472, 473, 474, 477, 478, 481, 482, 483, 490, + 495, 448, 367, 448, 362, 418, 458, 367, 424, 323, + 365, 368, 403, 403, 420, 339, 340, 360, 364, 359, + 359, 365, 321, 418, 358, 403, 373, 374, 375, 370, + 372, 337, 338, 341, 342, 376, 377, 343, 344, 380, + 379, 378, 345, 347, 346, 381, 361, 361, 416, 323, + 416, 421, 440, 454, 447, 323, 456, 457, 363, 455, + 368, 368, 485, 358, 358, 368, 368, 420, 358, 420, + 366, 358, 360, 363, 464, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 367, 419, 365, 368, 363, + 461, 474, 478, 483, 458, 367, 458, 459, 458, 454, + 323, 359, 395, 420, 323, 418, 403, 403, 403, 405, + 405, 406, 406, 407, 407, 407, 407, 408, 408, 409, + 410, 411, 412, 413, 414, 417, 361, 363, 456, 448, + 365, 368, 461, 486, 420, 368, 420, 366, 484, 323, + 496, 497, 471, 418, 418, 458, 363, 365, 363, 361, + 420, 368, 457, 322, 460, 472, 487, 359, 359, 420, + 435, 442, 476, 358, 361, 365, 465, 363, 458, 366, + 358, 476, 488, 489, 467, 468, 469, 475, 479, 323, + 359, 421, 361, 497, 363, 418, 420, 368, 359, 25, + 463, 462, 362, 367, 462, 466, 470, 359, 359, 420, + 466, 467, 471, 480, 458, 368, 363 +}; + + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint16 yyr1[] = +{ + 0, 391, 392, 393, 393, 393, 393, 393, 393, 393, + 393, 393, 393, 393, 393, 393, 393, 394, 394, 394, + 394, 394, 394, 395, 396, 397, 398, 398, 399, 399, + 400, 400, 401, 402, 402, 402, 403, 403, 403, 403, + 404, 404, 404, 404, 405, 405, 405, 405, 406, 406, + 406, 407, 407, 407, 408, 408, 408, 408, 408, 409, + 409, 409, 410, 410, 411, 411, 412, 412, 413, 413, + 414, 414, 415, 415, 416, 417, 416, 418, 418, 419, + 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, + 420, 420, 421, 422, 422, 422, 422, 422, 422, 422, + 422, 422, 424, 423, 425, 425, 426, 427, 427, 428, + 428, 429, 430, 430, 431, 431, 431, 431, 432, 433, + 433, 433, 433, 433, 434, 434, 434, 434, 434, 435, + 435, 436, 437, 437, 437, 437, 438, 439, 439, 440, + 440, 440, 441, 442, 442, 443, 443, 443, 443, 443, + 443, 443, 444, 444, 444, 444, 444, 444, 444, 444, + 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, + 444, 445, 446, 446, 447, 447, 448, 448, 448, 448, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 450, 450, 450, 452, 451, + 453, 451, 454, 454, 455, 455, 456, 456, 457, 457, + 458, 458, 458, 459, 459, 460, 461, 461, 462, 462, + 462, 462, 462, 462, 462, 463, 464, 465, 463, 466, + 466, 468, 467, 469, 467, 470, 470, 471, 471, 472, + 472, 473, 473, 474, 475, 475, 476, 476, 477, 477, + 479, 478, 480, 480, 481, 481, 482, 482, 484, 483, + 485, 483, 486, 483, 487, 487, 488, 488, 489, 489, + 490, 490, 490, 490, 490, 491, 491, 492, 492, 492, + 494, 493, 495, 496, 496, 497, 497 +}; + + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 3, 1, 4, 1, + 3, 2, 2, 1, 1, 1, 2, 2, 2, 1, + 2, 3, 2, 1, 1, 1, 1, 2, 2, 2, + 1, 1, 1, 1, 1, 3, 3, 3, 1, 3, + 3, 1, 3, 3, 1, 3, 3, 3, 3, 1, + 3, 3, 1, 3, 1, 3, 1, 3, 1, 3, + 1, 3, 1, 3, 1, 0, 6, 1, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 1, 2, 2, 4, 2, 3, 4, 2, + 3, 4, 0, 6, 2, 3, 2, 1, 1, 2, + 3, 3, 2, 3, 2, 1, 2, 1, 1, 1, + 3, 4, 6, 5, 1, 2, 3, 5, 4, 1, + 2, 1, 1, 1, 1, 1, 4, 1, 3, 1, + 3, 1, 1, 1, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 4, 1, 1, 3, 1, 2, 2, 3, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -2666,4514 +3301,5602 @@ static const yytype_uint8 yyr2[] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 6, 0, 5, 1, 2, 3, - 4, 1, 3, 1, 2, 1, 3, 4, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 0, 0, 5, 1, 1, 0, 2, 0, 2, - 2, 3, 1, 2, 1, 2, 5, 3, 1, 1, - 4, 0, 8, 0, 1, 3, 2, 0, 6, 0, - 8, 0, 7, 1, 1, 1, 0, 2, 3, 2, - 2, 2, 3, 2, 1, 2, 1, 1, 1, 0, - 3 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 6, + 0, 5, 1, 2, 3, 4, 1, 3, 1, 2, + 1, 3, 4, 1, 3, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 0, 0, 5, 1, + 1, 0, 2, 0, 2, 2, 3, 1, 2, 1, + 2, 1, 2, 5, 3, 1, 1, 4, 1, 2, + 0, 8, 0, 1, 3, 2, 1, 2, 0, 6, + 0, 8, 0, 7, 1, 1, 1, 0, 2, 3, + 2, 2, 2, 3, 2, 1, 2, 1, 1, 1, + 0, 3, 5, 1, 3, 1, 4 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (pParseContext, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (0) + +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 + + + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif + + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value, pParseContext); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ + +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, glslang::TParseContext* pParseContext) +{ + FILE *yyo = yyoutput; + YYUSE (yyo); + YYUSE (pParseContext); + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# endif + YYUSE (yytype); +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, glslang::TParseContext* pParseContext) +{ + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep, pParseContext); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +static void +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +static void +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, glslang::TParseContext* pParseContext) +{ + unsigned long int yylno = yyrline[yyrule]; + int yynrhs = yyr2[yyrule]; + int yyi; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + , pParseContext); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule, pParseContext); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +static YYSIZE_T +yystrlen (const char *yystr) +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +yystpcpy (char *yydest, const char *yysrc) +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) +{ + YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULL; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; + + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) + { + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } + } + } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } + + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; +} +#endif /* YYERROR_VERBOSE */ + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, glslang::TParseContext* pParseContext) +{ + YYUSE (yyvaluep); + YYUSE (pParseContext); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + + + +/*----------. +| yyparse. | +`----------*/ + +int +yyparse (glslang::TParseContext* pParseContext) +{ +/* The lookahead symbol. */ +int yychar; + + +/* The semantic value of the lookahead symbol. */ +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab + /* Number of syntax errors so far. */ + int yynerrs; + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; -#define YYRECOVERING() (!!yyerrstatus) + /* The stacks and their tools: + 'yyss': related to states. + 'yyvs': related to semantic values. -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (pParseContext, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) + Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + YYSIZE_T yystacksize; -/* Enable debugging if requested. */ -#if YYDEBUG + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken = 0; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; + yystacksize = YYINITDEPTH; -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, pParseContext); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) + YYDPRINTF ((stderr, "Starting parse\n")); + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + goto yysetstate; -/*----------------------------------------. -| Print this symbol's value on YYOUTPUT. | -`----------------------------------------*/ +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, glslang::TParseContext* pParseContext) -{ - FILE *yyo = yyoutput; - YYUSE (yyo); - YYUSE (pParseContext); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); -} + yysetstate: + *yyssp = yystate; + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, glslang::TParseContext* pParseContext) -{ - YYFPRINTF (yyoutput, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); - yy_symbol_value_print (yyoutput, yytype, yyvaluep, pParseContext); - YYFPRINTF (yyoutput, ")"); -} + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; } - YYFPRINTF (stderr, "\n"); -} -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + if (yystate == YYFINAL) + YYACCEPT; -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ + goto yybackup; -static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, glslang::TParseContext* pParseContext) -{ - unsigned long int yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default (yyn)) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = yylex (&yylval, parseContext); + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , pParseContext); - YYFPRINTF (stderr, "\n"); + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } -} -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule, pParseContext); \ -} while (0) + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yytable_value_is_error (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif + /* Discard the shifted token. */ + yychar = YYEMPTY; -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). + yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ + goto yynewstate; -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; -#if YYERROR_VERBOSE -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; + /* If YYLEN is nonzero, implement the default value of the action: + '$$ = $1'. - while ((*yyd++ = *yys++) != '\0') - continue; + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; - return yyd - 1; -} -# endif -# endif -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') + YY_REDUCE_PRINT (yyn); + switch (yyn) { - YYSIZE_T yyn = 0; - char const *yyp = yystr; + case 2: +#line 293 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleVariable((yyvsp[0].lex).loc, (yyvsp[0].lex).symbol, (yyvsp[0].lex).string); + } +#line 4016 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; + case 3: +#line 299 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } +#line 4024 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; + case 4: +#line 302 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); + } +#line 4033 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; + case 5: +#line 306 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } +#line 4042 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - if (! yyres) - return yystrlen (yystr); + case 6: +#line 310 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); + } +#line 4050 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - return yystpcpy (yyres, yystr) - yyres; -} -# endif + case 7: +#line 313 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); + } +#line 4059 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. + case 8: +#line 317 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i64, (yyvsp[0].lex).loc, true); + } +#line 4068 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; + case 9: +#line 321 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u64, (yyvsp[0].lex).loc, true); + } +#line 4077 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) + case 10: +#line 325 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit integer literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((short)(yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); + } +#line 4086 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 11: +#line 329 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((unsigned short)(yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); + } +#line 4095 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } + case 12: +#line 333 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } +#line 4103 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - switch (yycount) + case 13: +#line 336 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ + parseContext.doubleCheck((yyvsp[0].lex).loc, "double literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtDouble, (yyvsp[0].lex).loc, true); } +#line 4112 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } + case 14: +#line 340 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat16, (yyvsp[0].lex).loc, true); + } +#line 4121 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - if (*yymsg_alloc < yysize) + case 15: +#line 344 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } +#line 4129 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ + case 16: +#line 347 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); + if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) + (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); + } +#line 4139 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ + case 17: +#line 355 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } +#line 4147 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, glslang::TParseContext* pParseContext) -{ - YYUSE (yyvaluep); - YYUSE (pParseContext); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + case 18: +#line 358 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBracketDereference((yyvsp[-2].lex).loc, (yyvsp[-3].interm.intermTypedNode), (yyvsp[-1].interm.intermTypedNode)); + } +#line 4155 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} + case 19: +#line 361 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } +#line 4163 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + case 20: +#line 364 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleDotDereference((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode), *(yyvsp[0].lex).string); + } +#line 4171 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + case 21: +#line 367 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); + parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "++", (yyvsp[-1].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "++", EOpPostIncrement, (yyvsp[-1].interm.intermTypedNode)); + } +#line 4181 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + case 22: +#line 372 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); + parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "--", (yyvsp[-1].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "--", EOpPostDecrement, (yyvsp[-1].interm.intermTypedNode)); + } +#line 4191 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/*----------. -| yyparse. | -`----------*/ + case 23: +#line 380 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.integerCheck((yyvsp[0].interm.intermTypedNode), "[]"); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } +#line 4200 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -int -yyparse (glslang::TParseContext* pParseContext) -{ -/* The lookahead symbol. */ -int yychar; + case 24: +#line 387 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleFunctionCall((yyvsp[0].interm).loc, (yyvsp[0].interm).function, (yyvsp[0].interm).intermNode); + delete (yyvsp[0].interm).function; + } +#line 4209 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + case 25: +#line 394 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm) = (yyvsp[0].interm); + } +#line 4217 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/* The semantic value of the lookahead symbol. */ -/* Default value used for initialization, for pacifying older GCCs - or non-GCC compilers. */ -YY_INITIAL_VALUE (static YYSTYPE yyval_default;) -YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); + case 26: +#line 400 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm) = (yyvsp[-1].interm); + (yyval.interm).loc = (yyvsp[0].lex).loc; + } +#line 4226 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* Number of syntax errors so far. */ - int yynerrs; + case 27: +#line 404 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm) = (yyvsp[-1].interm); + (yyval.interm).loc = (yyvsp[0].lex).loc; + } +#line 4235 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; + case 28: +#line 411 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm) = (yyvsp[-1].interm); + } +#line 4243 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. + case 29: +#line 414 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm) = (yyvsp[0].interm); + } +#line 4251 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ + case 30: +#line 420 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + TParameter param = { 0, new TType }; + param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); + (yyvsp[-1].interm).function->addParameter(param); + (yyval.interm).function = (yyvsp[-1].interm).function; + (yyval.interm).intermNode = (yyvsp[0].interm.intermTypedNode); + } +#line 4263 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; + case 31: +#line 427 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + TParameter param = { 0, new TType }; + param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); + (yyvsp[-2].interm).function->addParameter(param); + (yyval.interm).function = (yyvsp[-2].interm).function; + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); + } +#line 4275 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 32: +#line 437 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm) = (yyvsp[-1].interm); + } +#line 4283 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 33: +#line 445 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + // Constructor + (yyval.interm).intermNode = 0; + (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); + } +#line 4293 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; + case 34: +#line 450 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + // + // Should be a method or subroutine call, but we haven't recognized the arguments yet. + // + (yyval.interm).function = 0; + (yyval.interm).intermNode = 0; - YYSIZE_T yystacksize; + TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode(); + if (method) { + (yyval.interm).function = new TFunction(&method->getMethodName(), TType(EbtInt), EOpArrayLength); + (yyval.interm).intermNode = method->getObject(); + } else { + TIntermSymbol* symbol = (yyvsp[0].interm.intermTypedNode)->getAsSymbolNode(); + if (symbol) { + parseContext.reservedErrorCheck(symbol->getLoc(), symbol->getName()); + TFunction *function = new TFunction(&symbol->getName(), TType(EbtVoid)); + (yyval.interm).function = function; + } else + parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "function call, method, or subroutine call expected", "", ""); + } - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; + if ((yyval.interm).function == 0) { + // error recover + TString empty(""); + (yyval.interm).function = new TFunction(&empty, TType(EbtVoid), EOpNull); + } + } +#line 4325 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif + case 35: +#line 477 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + // Constructor + (yyval.interm).intermNode = 0; + (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); + } +#line 4335 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + case 36: +#line 485 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.variableCheck((yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + if (TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode()) + parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "incomplete method syntax", method->getMethodName().c_str(), ""); + } +#line 4346 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; + case 37: +#line 491 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "++", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "++", EOpPreIncrement, (yyvsp[0].interm.intermTypedNode)); + } +#line 4355 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; + case 38: +#line 495 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "--", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "--", EOpPreDecrement, (yyvsp[0].interm.intermTypedNode)); + } +#line 4364 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - YYDPRINTF ((stderr, "Starting parse\n")); + case 39: +#line 499 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + if ((yyvsp[-1].interm).op != EOpNull) { + char errorOp[2] = {0, 0}; + switch((yyvsp[-1].interm).op) { + case EOpNegative: errorOp[0] = '-'; break; + case EOpLogicalNot: errorOp[0] = '!'; break; + case EOpBitwiseNot: errorOp[0] = '~'; break; + default: break; // some compilers want this + } + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].interm).loc, errorOp, (yyvsp[-1].interm).op, (yyvsp[0].interm.intermTypedNode)); + } else { + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) + (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); + } + } +#line 4385 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; + case 40: +#line 519 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNull; } +#line 4391 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; + case 41: +#line 520 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNegative; } +#line 4397 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - yysetstate: - *yyssp = yystate; + case 42: +#line 521 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLogicalNot; } +#line 4403 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + case 43: +#line 522 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpBitwiseNot; + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise not"); } +#line 4410 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; + case 44: +#line 528 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4416 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); + case 45: +#line 529 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "*", EOpMul, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 4426 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + case 46: +#line 534 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "/", EOpDiv, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 4436 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ + case 47: +#line 539 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "%"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "%", EOpMod, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 4447 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; + case 48: +#line 548 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4453 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + case 49: +#line 549 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "+", EOpAdd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 4463 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + case 50: +#line 554 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "-", EOpSub, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } +#line 4473 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + case 51: +#line 562 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4479 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - if (yystate == YYFINAL) - YYACCEPT; + case 52: +#line 563 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift left"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<<", EOpLeftShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 4490 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - goto yybackup; + case 53: +#line 569 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift right"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">>", EOpRightShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 4501 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/*-----------. -| yybackup. | -`-----------*/ -yybackup: + case 54: +#line 578 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4507 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ + case 55: +#line 579 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<", EOpLessThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 4517 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; + case 56: +#line 584 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">", EOpGreaterThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 4527 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* Not known => get a lookahead token if don't already have one. */ + case 57: +#line 589 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<=", EOpLessThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 4537 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) + case 58: +#line 594 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (&yylval, parseContext); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">=", EOpGreaterThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } +#line 4547 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - if (yychar <= YYEOF) + case 59: +#line 602 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4553 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 60: +#line 603 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); + parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); + parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); + parseContext.specializationCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "==", EOpEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } - else +#line 4566 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 61: +#line 611 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); + parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); + parseContext.specializationCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "!=", EOpNotEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } +#line 4579 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) + case 62: +#line 622 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4585 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 63: +#line 623 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise and"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&", EOpAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } +#line 4596 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; + case 64: +#line 632 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4602 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + case 65: +#line 633 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise exclusive or"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^", EOpExclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 4613 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* Discard the shifted token. */ - yychar = YYEMPTY; + case 66: +#line 642 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4619 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END + case 67: +#line 643 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise inclusive or"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "|", EOpInclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 4630 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - goto yynewstate; + case 68: +#line 652 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4636 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + case 69: +#line 653 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&&", EOpLogicalAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 4646 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; + case 70: +#line 661 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4652 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + case 71: +#line 662 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^^", EOpLogicalXor, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 4662 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; + case 72: +#line 670 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4668 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. + case 73: +#line 671 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "||", EOpLogicalOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 4678 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; + case 74: +#line 679 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4684 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + case 75: +#line 680 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + ++parseContext.controlFlowNestingLevel; + } +#line 4692 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - YY_REDUCE_PRINT (yyn); - switch (yyn) + case 76: +#line 683 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - case 2: -#line 253 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + --parseContext.controlFlowNestingLevel; + parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-5].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[-4].lex).loc, "?", (yyvsp[-5].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[-1].lex).loc, ":", (yyvsp[-2].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[-1].lex).loc, ":", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addSelection((yyvsp[-5].interm.intermTypedNode), (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-4].lex).loc); + if ((yyval.interm.intermTypedNode) == 0) { + parseContext.binaryOpError((yyvsp[-4].lex).loc, ":", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(), (yyvsp[0].interm.intermTypedNode)->getCompleteString()); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } + } +#line 4709 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 77: +#line 698 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4715 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 78: +#line 699 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleVariable((yyvsp[0].lex).loc, (yyvsp[0].lex).symbol, (yyvsp[0].lex).string); + parseContext.arrayObjectCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array assignment"); + parseContext.opaqueCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); + parseContext.specializationCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); + parseContext.lValueErrorCheck((yyvsp[-1].interm).loc, "assign", (yyvsp[-2].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[-1].interm).loc, "assign", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addAssign((yyvsp[-1].interm).op, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].interm).loc); + if ((yyval.interm.intermTypedNode) == 0) { + parseContext.assignError((yyvsp[-1].interm).loc, "assign", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(), (yyvsp[0].interm.intermTypedNode)->getCompleteString()); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } } -#line 3365 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4732 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 3: -#line 259 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 79: +#line 714 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpAssign; } -#line 3373 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4741 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 4: -#line 262 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 80: +#line 718 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpMulAssign; } -#line 3381 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4750 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 5: -#line 265 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 81: +#line 722 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned literal"); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpDivAssign; } -#line 3390 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4759 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 6: -#line 269 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 82: +#line 726 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer literal"); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i64, (yyvsp[0].lex).loc, true); + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "%="); + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpModAssign; } -#line 3399 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4769 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 7: -#line 273 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 83: +#line 731 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer literal"); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u64, (yyvsp[0].lex).loc, true); + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpAddAssign; } -#line 3408 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4778 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 8: -#line 277 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 84: +#line 735 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.int16Check((yyvsp[0].lex).loc, "16-bit integer literal"); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((short)(yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); -#endif + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpSubAssign; + } +#line 4787 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 85: +#line 739 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift left assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLeftShiftAssign; } -#line 3419 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4796 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 9: -#line 283 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 86: +#line 743 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.int16Check((yyvsp[0].lex).loc, "16-bit unsigned integer literal"); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((unsigned short)(yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); -#endif + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift right assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpRightShiftAssign; } -#line 3430 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4805 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 10: -#line 289 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 87: +#line 747 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-and assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAndAssign; } -#line 3438 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4814 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 11: -#line 292 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 88: +#line 751 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double literal"); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtDouble, (yyvsp[0].lex).loc, true); + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-xor assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpExclusiveOrAssign; } -#line 3447 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4823 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 12: -#line 296 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 89: +#line 755 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float literal"); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat16, (yyvsp[0].lex).loc, true); -#endif + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-or assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpInclusiveOrAssign; } -#line 3458 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4832 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 13: -#line 302 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 90: +#line 762 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3466 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4840 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 14: -#line 305 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 91: +#line 765 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); - if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) - (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); + parseContext.samplerConstructorLocationCheck((yyvsp[-1].lex).loc, ",", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addComma((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); + if ((yyval.interm.intermTypedNode) == 0) { + parseContext.binaryOpError((yyvsp[-1].lex).loc, ",", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(), (yyvsp[0].interm.intermTypedNode)->getCompleteString()); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } } -#line 3476 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4853 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 15: -#line 313 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 92: +#line 776 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.constantValueCheck((yyvsp[0].interm.intermTypedNode), ""); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3484 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4862 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 16: -#line 316 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 93: +#line 783 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBracketDereference((yyvsp[-2].lex).loc, (yyvsp[-3].interm.intermTypedNode), (yyvsp[-1].interm.intermTypedNode)); + parseContext.handleFunctionDeclarator((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).function, true /* prototype */); + (yyval.interm.intermNode) = 0; + // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature } -#line 3492 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4872 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 17: -#line 319 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 94: +#line 788 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + if ((yyvsp[-1].interm).intermNode && (yyvsp[-1].interm).intermNode->getAsAggregate()) + (yyvsp[-1].interm).intermNode->getAsAggregate()->setOperator(EOpSequence); + (yyval.interm.intermNode) = (yyvsp[-1].interm).intermNode; } -#line 3500 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4882 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 18: -#line 322 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 95: +#line 793 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleDotDereference((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode), *(yyvsp[0].lex).string); + parseContext.profileRequires((yyvsp[-3].lex).loc, ENoProfile, 130, 0, "precision statement"); + + // lazy setting of the previous scope's defaults, has effect only the first time it is called in a particular scope + parseContext.symbolTable.setPreviousDefaultPrecisions(&parseContext.defaultPrecision[0]); + parseContext.setDefaultPrecision((yyvsp[-3].lex).loc, (yyvsp[-1].interm.type), (yyvsp[-2].interm.type).qualifier.precision); + (yyval.interm.intermNode) = 0; } -#line 3508 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4895 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 19: -#line 325 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 96: +#line 801 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); - parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "++", (yyvsp[-1].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "++", EOpPostIncrement, (yyvsp[-1].interm.intermTypedNode)); + parseContext.declareBlock((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).typeList); + (yyval.interm.intermNode) = 0; } -#line 3518 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4904 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 20: -#line 330 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 97: +#line 805 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); - parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "--", (yyvsp[-1].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "--", EOpPostDecrement, (yyvsp[-1].interm.intermTypedNode)); + parseContext.declareBlock((yyvsp[-2].interm).loc, *(yyvsp[-2].interm).typeList, (yyvsp[-1].lex).string); + (yyval.interm.intermNode) = 0; } -#line 3528 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4913 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 21: -#line 338 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 98: +#line 809 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.integerCheck((yyvsp[0].interm.intermTypedNode), "[]"); - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + parseContext.declareBlock((yyvsp[-3].interm).loc, *(yyvsp[-3].interm).typeList, (yyvsp[-2].lex).string, (yyvsp[-1].interm).arraySizes); + (yyval.interm.intermNode) = 0; } -#line 3537 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4922 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 22: -#line 345 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 99: +#line 813 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleFunctionCall((yyvsp[0].interm).loc, (yyvsp[0].interm).function, (yyvsp[0].interm).intermNode); - delete (yyvsp[0].interm).function; + parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); + parseContext.updateStandaloneQualifierDefaults((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type)); + (yyval.interm.intermNode) = 0; } -#line 3546 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4932 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 23: -#line 352 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 100: +#line 818 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[0].interm); + parseContext.checkNoShaderLayouts((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).shaderQualifiers); + parseContext.addQualifierToExisting((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, *(yyvsp[-1].lex).string); + (yyval.interm.intermNode) = 0; } -#line 3554 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4942 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 24: -#line 358 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 101: +#line 823 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[-1].interm); - (yyval.interm).loc = (yyvsp[0].lex).loc; + parseContext.checkNoShaderLayouts((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).shaderQualifiers); + (yyvsp[-1].interm.identifierList)->push_back((yyvsp[-2].lex).string); + parseContext.addQualifierToExisting((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).qualifier, *(yyvsp[-1].interm.identifierList)); + (yyval.interm.intermNode) = 0; } -#line 3563 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4953 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 25: -#line 362 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 102: +#line 832 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { parseContext.nestedBlockCheck((yyvsp[-2].interm.type).loc); } +#line 4959 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 103: +#line 832 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[-1].interm); - (yyval.interm).loc = (yyvsp[0].lex).loc; + --parseContext.structNestingLevel; + parseContext.blockName = (yyvsp[-4].lex).string; + parseContext.globalQualifierFixCheck((yyvsp[-5].interm.type).loc, (yyvsp[-5].interm.type).qualifier); + parseContext.checkNoShaderLayouts((yyvsp[-5].interm.type).loc, (yyvsp[-5].interm.type).shaderQualifiers); + parseContext.currentBlockQualifier = (yyvsp[-5].interm.type).qualifier; + (yyval.interm).loc = (yyvsp[-5].interm.type).loc; + (yyval.interm).typeList = (yyvsp[-1].interm.typeList); } -#line 3572 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4973 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 26: -#line 369 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 104: +#line 843 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[-1].interm); + (yyval.interm.identifierList) = new TIdentifierList; + (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } -#line 3580 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4982 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 27: -#line 372 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 105: +#line 847 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[0].interm); + (yyval.interm.identifierList) = (yyvsp[-2].interm.identifierList); + (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } -#line 3588 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4991 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 28: -#line 378 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 106: +#line 854 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - TParameter param = { 0, new TType }; - param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); - (yyvsp[-1].interm).function->addParameter(param); - (yyval.interm).function = (yyvsp[-1].interm).function; - (yyval.interm).intermNode = (yyvsp[0].interm.intermTypedNode); + (yyval.interm).function = (yyvsp[-1].interm.function); + (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 3600 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5000 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 29: -#line 385 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 107: +#line 861 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - TParameter param = { 0, new TType }; - param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); - (yyvsp[-2].interm).function->addParameter(param); - (yyval.interm).function = (yyvsp[-2].interm).function; - (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); + (yyval.interm.function) = (yyvsp[0].interm.function); } -#line 3612 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5008 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 30: -#line 395 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 108: +#line 864 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[-1].interm); + (yyval.interm.function) = (yyvsp[0].interm.function); } -#line 3620 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5016 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 31: -#line 403 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 109: +#line 871 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // Constructor - (yyval.interm).intermNode = 0; - (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); + // Add the parameter + (yyval.interm.function) = (yyvsp[-1].interm.function); + if ((yyvsp[0].interm).param.type->getBasicType() != EbtVoid) + (yyvsp[-1].interm.function)->addParameter((yyvsp[0].interm).param); + else + delete (yyvsp[0].interm).param.type; } -#line 3630 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5029 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 32: -#line 408 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 110: +#line 879 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // - // Should be a method or subroutine call, but we haven't recognized the arguments yet. + // Only first parameter of one-parameter functions can be void + // The check for named parameters not being void is done in parameter_declarator // - (yyval.interm).function = 0; - (yyval.interm).intermNode = 0; - - TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode(); - if (method) { - (yyval.interm).function = new TFunction(&method->getMethodName(), TType(EbtInt), EOpArrayLength); - (yyval.interm).intermNode = method->getObject(); + if ((yyvsp[0].interm).param.type->getBasicType() == EbtVoid) { + // + // This parameter > first is void + // + parseContext.error((yyvsp[-1].lex).loc, "cannot be an argument type except for '(void)'", "void", ""); + delete (yyvsp[0].interm).param.type; } else { - TIntermSymbol* symbol = (yyvsp[0].interm.intermTypedNode)->getAsSymbolNode(); - if (symbol) { - parseContext.reservedErrorCheck(symbol->getLoc(), symbol->getName()); - TFunction *function = new TFunction(&symbol->getName(), TType(EbtVoid)); - (yyval.interm).function = function; - } else - parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "function call, method, or subroutine call expected", "", ""); - } - - if ((yyval.interm).function == 0) { - // error recover - TString empty(""); - (yyval.interm).function = new TFunction(&empty, TType(EbtVoid), EOpNull); + // Add the parameter + (yyval.interm.function) = (yyvsp[-2].interm.function); + (yyvsp[-2].interm.function)->addParameter((yyvsp[0].interm).param); } } -#line 3662 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5051 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 33: -#line 438 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 111: +#line 899 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.variableCheck((yyvsp[0].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); - if (TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode()) - parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "incomplete method syntax", method->getMethodName().c_str(), ""); - } -#line 3673 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; + if ((yyvsp[-2].interm.type).qualifier.storage != EvqGlobal && (yyvsp[-2].interm.type).qualifier.storage != EvqTemporary) { + parseContext.error((yyvsp[-1].lex).loc, "no qualifiers allowed for function return", + GetStorageQualifierString((yyvsp[-2].interm.type).qualifier.storage), ""); + } + if ((yyvsp[-2].interm.type).arraySizes) + parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes); - case 34: -#line 444 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "++", (yyvsp[0].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "++", EOpPreIncrement, (yyvsp[0].interm.intermTypedNode)); - } -#line 3682 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; + // Add the function as a prototype after parsing it (we do not support recursion) + TFunction *function; + TType type((yyvsp[-2].interm.type)); - case 35: -#line 448 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "--", (yyvsp[0].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "--", EOpPreDecrement, (yyvsp[0].interm.intermTypedNode)); + // Potentially rename shader entry point function. No-op most of the time. + parseContext.renameShaderFunction((yyvsp[-1].lex).string); + + // Make the function + function = new TFunction((yyvsp[-1].lex).string, type); + (yyval.interm.function) = function; } -#line 3691 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5075 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 36: -#line 452 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 112: +#line 922 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - if ((yyvsp[-1].interm).op != EOpNull) { - char errorOp[2] = {0, 0}; - switch((yyvsp[-1].interm).op) { - case EOpNegative: errorOp[0] = '-'; break; - case EOpLogicalNot: errorOp[0] = '!'; break; - case EOpBitwiseNot: errorOp[0] = '~'; break; - default: break; // some compilers want this - } - (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].interm).loc, errorOp, (yyvsp[-1].interm).op, (yyvsp[0].interm.intermTypedNode)); - } else { - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); - if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) - (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); + if ((yyvsp[-1].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[-1].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[-1].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + parseContext.arraySizeRequiredCheck((yyvsp[-1].interm.type).loc, *(yyvsp[-1].interm.type).arraySizes); } - } -#line 3712 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; + if ((yyvsp[-1].interm.type).basicType == EbtVoid) { + parseContext.error((yyvsp[0].lex).loc, "illegal use of type 'void'", (yyvsp[0].lex).string->c_str(), ""); + } + parseContext.reservedErrorCheck((yyvsp[0].lex).loc, *(yyvsp[0].lex).string); - case 37: -#line 472 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNull; } -#line 3718 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + TParameter param = {(yyvsp[0].lex).string, new TType((yyvsp[-1].interm.type))}; + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).param = param; + } +#line 5095 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 38: -#line 473 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNegative; } -#line 3724 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; + case 113: +#line 937 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + if ((yyvsp[-2].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[-2].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes); + } + TType* type = new TType((yyvsp[-2].interm.type)); + type->transferArraySizes((yyvsp[0].interm).arraySizes); + type->copyArrayInnerSizes((yyvsp[-2].interm.type).arraySizes); - case 39: -#line 474 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLogicalNot; } -#line 3730 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; + parseContext.arrayOfArrayVersionCheck((yyvsp[-1].lex).loc, type->getArraySizes()); + parseContext.arraySizeRequiredCheck((yyvsp[0].interm).loc, *(yyvsp[0].interm).arraySizes); + parseContext.reservedErrorCheck((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string); - case 40: -#line 475 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpBitwiseNot; - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise not"); } -#line 3737 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; + TParameter param = { (yyvsp[-1].lex).string, type }; - case 41: -#line 481 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3743 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + (yyval.interm).loc = (yyvsp[-1].lex).loc; + (yyval.interm).param = param; + } +#line 5119 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 42: -#line 482 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 114: +#line 962 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "*", EOpMul, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + (yyval.interm) = (yyvsp[0].interm); + if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) + (yyval.interm).param.type->getQualifier().precision = (yyvsp[-1].interm.type).qualifier.precision; + parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); + + parseContext.checkNoShaderLayouts((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); + parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); + parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); + } -#line 3753 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5135 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 43: -#line 487 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 115: +#line 973 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "/", EOpDiv, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + (yyval.interm) = (yyvsp[0].interm); + + parseContext.parameterTypeCheck((yyvsp[0].interm).loc, EvqIn, *(yyvsp[0].interm).param.type); + parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); + parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); } -#line 3763 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5147 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 44: -#line 492 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 116: +#line 983 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "%"); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "%", EOpMod, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); - } -#line 3774 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; + (yyval.interm) = (yyvsp[0].interm); + if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) + (yyval.interm).param.type->getQualifier().precision = (yyvsp[-1].interm.type).qualifier.precision; + parseContext.precisionQualifierCheck((yyvsp[-1].interm.type).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); - case 45: -#line 501 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3780 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + parseContext.checkNoShaderLayouts((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); + parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); + parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); + } +#line 5162 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 46: -#line 502 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 117: +#line 993 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "+", EOpAdd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + (yyval.interm) = (yyvsp[0].interm); + + parseContext.parameterTypeCheck((yyvsp[0].interm).loc, EvqIn, *(yyvsp[0].interm).param.type); + parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); + parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); } -#line 3790 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5174 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 47: -#line 507 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 118: +#line 1003 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "-", EOpSub, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + TParameter param = { 0, new TType((yyvsp[0].interm.type)) }; + (yyval.interm).param = param; + if ((yyvsp[0].interm.type).arraySizes) + parseContext.arraySizeRequiredCheck((yyvsp[0].interm.type).loc, *(yyvsp[0].interm.type).arraySizes); } -#line 3800 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 48: -#line 515 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3806 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5185 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 49: -#line 516 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 119: +#line 1012 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift left"); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<<", EOpLeftShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + (yyval.interm) = (yyvsp[0].interm); } -#line 3817 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5193 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 50: -#line 522 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 120: +#line 1015 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift right"); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">>", EOpRightShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + (yyval.interm) = (yyvsp[-2].interm); + parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-2].interm).type); } -#line 3828 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 51: -#line 531 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3834 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5202 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 52: -#line 532 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 121: +#line 1019 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<", EOpLessThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + (yyval.interm) = (yyvsp[-3].interm); + parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-3].interm).type, (yyvsp[0].interm).arraySizes); } -#line 3844 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5211 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 53: -#line 537 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 122: +#line 1023 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">", EOpGreaterThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + (yyval.interm).type = (yyvsp[-5].interm).type; + TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-5].interm).type, (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-5].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } -#line 3854 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5221 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 54: -#line 542 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 123: +#line 1028 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<=", EOpLessThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + (yyval.interm).type = (yyvsp[-4].interm).type; + TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-4].interm).type, 0, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-4].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } -#line 3864 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5231 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 55: -#line 547 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 124: +#line 1036 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">=", EOpGreaterThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + (yyval.interm).type = (yyvsp[0].interm.type); + (yyval.interm).intermNode = 0; + parseContext.declareTypeDefaults((yyval.interm).loc, (yyval.interm).type); } -#line 3874 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 56: -#line 555 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3880 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5241 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 57: -#line 556 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 125: +#line 1041 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); - parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); - parseContext.specializationCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "==", EOpEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + (yyval.interm).type = (yyvsp[-1].interm.type); + (yyval.interm).intermNode = 0; + parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-1].interm.type)); } -#line 3893 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5251 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 58: -#line 564 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 126: +#line 1046 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); - parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); - parseContext.specializationCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "!=", EOpNotEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + (yyval.interm).type = (yyvsp[-2].interm.type); + (yyval.interm).intermNode = 0; + parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-2].interm.type), (yyvsp[0].interm).arraySizes); } -#line 3906 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 59: -#line 575 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3912 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5261 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 60: -#line 576 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 127: +#line 1051 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise and"); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&", EOpAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + (yyval.interm).type = (yyvsp[-4].interm.type); + TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-4].interm.type), (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); } -#line 3923 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 61: -#line 585 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3929 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5271 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 62: -#line 586 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 128: +#line 1056 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise exclusive or"); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^", EOpExclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + (yyval.interm).type = (yyvsp[-3].interm.type); + TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); } -#line 3940 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5281 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 63: -#line 595 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3946 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + case 129: +#line 1065 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type) = (yyvsp[0].interm.type); + + parseContext.globalQualifierTypeCheck((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier, (yyval.interm.type)); + if ((yyvsp[0].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[0].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[0].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + } + + parseContext.precisionQualifierCheck((yyval.interm.type).loc, (yyval.interm.type).basicType, (yyval.interm.type).qualifier); + } +#line 5297 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 64: -#line 596 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 130: +#line 1076 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise inclusive or"); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "|", EOpInclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); + parseContext.globalQualifierTypeCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, (yyvsp[0].interm.type)); + + if ((yyvsp[0].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[0].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[0].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + } + + if ((yyvsp[0].interm.type).arraySizes && parseContext.arrayQualifierError((yyvsp[0].interm.type).loc, (yyvsp[-1].interm.type).qualifier)) + (yyvsp[0].interm.type).arraySizes = nullptr; + + parseContext.checkNoShaderLayouts((yyvsp[0].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); + (yyvsp[0].interm.type).shaderQualifiers.merge((yyvsp[-1].interm.type).shaderQualifiers); + parseContext.mergeQualifiers((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier, (yyvsp[-1].interm.type).qualifier, true); + parseContext.precisionQualifierCheck((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).basicType, (yyvsp[0].interm.type).qualifier); + + (yyval.interm.type) = (yyvsp[0].interm.type); + + if (! (yyval.interm.type).qualifier.isInterpolation() && + ((parseContext.language == EShLangVertex && (yyval.interm.type).qualifier.storage == EvqVaryingOut) || + (parseContext.language == EShLangFragment && (yyval.interm.type).qualifier.storage == EvqVaryingIn))) + (yyval.interm.type).qualifier.smooth = true; } -#line 3957 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5326 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 65: -#line 605 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3963 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + case 131: +#line 1103 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.globalCheck((yyvsp[0].lex).loc, "invariant"); + parseContext.profileRequires((yyval.interm.type).loc, ENoProfile, 120, 0, "invariant"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.invariant = true; + } +#line 5337 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 66: -#line 606 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 132: +#line 1112 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&&", EOpLogicalAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + parseContext.globalCheck((yyvsp[0].lex).loc, "smooth"); + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "smooth"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "smooth"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.smooth = true; } -#line 3973 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5349 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 67: -#line 614 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3979 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + case 133: +#line 1119 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.globalCheck((yyvsp[0].lex).loc, "flat"); + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "flat"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "flat"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.flat = true; + } +#line 5361 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 68: -#line 615 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 134: +#line 1126 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^^", EOpLogicalXor, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + parseContext.globalCheck((yyvsp[0].lex).loc, "noperspective"); +#ifdef NV_EXTENSIONS + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 0, E_GL_NV_shader_noperspective_interpolation, "noperspective"); +#else + parseContext.requireProfile((yyvsp[0].lex).loc, ~EEsProfile, "noperspective"); +#endif + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "noperspective"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.nopersp = true; } -#line 3989 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5377 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 69: -#line 623 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 3995 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + case 135: +#line 1137 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef AMD_EXTENSIONS + parseContext.globalCheck((yyvsp[0].lex).loc, "__explicitInterpAMD"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECompatibilityProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.explicitInterp = true; +#endif + } +#line 5391 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 70: -#line 624 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 136: +#line 1149 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "||", EOpLogicalOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + (yyval.interm.type) = (yyvsp[-1].interm.type); } -#line 4005 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5399 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 71: -#line 632 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4011 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + case 137: +#line 1155 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type) = (yyvsp[0].interm.type); + } +#line 5407 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 72: -#line 633 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 138: +#line 1158 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - ++parseContext.controlFlowNestingLevel; + (yyval.interm.type) = (yyvsp[-2].interm.type); + (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); + parseContext.mergeObjectLayoutQualifiers((yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } -#line 4019 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5417 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 73: -#line 636 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 139: +#line 1165 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - --parseContext.controlFlowNestingLevel; - parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-5].interm.intermTypedNode)); - parseContext.rValueErrorCheck((yyvsp[-4].lex).loc, "?", (yyvsp[-5].interm.intermTypedNode)); - parseContext.rValueErrorCheck((yyvsp[-1].lex).loc, ":", (yyvsp[-2].interm.intermTypedNode)); - parseContext.rValueErrorCheck((yyvsp[-1].lex).loc, ":", (yyvsp[0].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addSelection((yyvsp[-5].interm.intermTypedNode), (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-4].lex).loc); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext.binaryOpError((yyvsp[-4].lex).loc, ":", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(), (yyvsp[0].interm.intermTypedNode)->getCompleteString()); - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); - } + (yyval.interm.type).init((yyvsp[0].lex).loc); + parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), *(yyvsp[0].lex).string); } -#line 4036 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5426 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 74: -#line 651 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4042 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + case 140: +#line 1169 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[-2].lex).loc); + parseContext.setLayoutQualifier((yyvsp[-2].lex).loc, (yyval.interm.type), *(yyvsp[-2].lex).string, (yyvsp[0].interm.intermTypedNode)); + } +#line 5435 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 75: -#line 652 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.arrayObjectCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array assignment"); - parseContext.opaqueCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); - parseContext.specializationCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); - parseContext.lValueErrorCheck((yyvsp[-1].interm).loc, "assign", (yyvsp[-2].interm.intermTypedNode)); - parseContext.rValueErrorCheck((yyvsp[-1].interm).loc, "assign", (yyvsp[0].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addAssign((yyvsp[-1].interm).op, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].interm).loc); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext.assignError((yyvsp[-1].interm).loc, "assign", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(), (yyvsp[0].interm.intermTypedNode)->getCompleteString()); - (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); - } + case 141: +#line 1173 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { // because "shared" is both an identifier and a keyword + (yyval.interm.type).init((yyvsp[0].lex).loc); + TString strShared("shared"); + parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), strShared); } -#line 4059 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5445 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 76: -#line 667 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 142: +#line 1181 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[0].lex).loc; - (yyval.interm).op = EOpAssign; + parseContext.profileRequires((yyval.interm.type).loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.noContraction = true; } -#line 4068 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5456 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 77: -#line 671 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 143: +#line 1190 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[0].lex).loc; - (yyval.interm).op = EOpMulAssign; + (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 4077 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5464 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 78: -#line 675 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 144: +#line 1193 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[0].lex).loc; - (yyval.interm).op = EOpDivAssign; + (yyval.interm.type) = (yyvsp[-1].interm.type); + if ((yyval.interm.type).basicType == EbtVoid) + (yyval.interm.type).basicType = (yyvsp[0].interm.type).basicType; + + (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); + parseContext.mergeQualifiers((yyval.interm.type).loc, (yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } -#line 4086 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5477 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 79: -#line 679 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 145: +#line 1204 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "%="); - (yyval.interm).loc = (yyvsp[0].lex).loc; - (yyval.interm).op = EOpModAssign; + (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 4096 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5485 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 80: -#line 684 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 146: +#line 1207 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[0].lex).loc; - (yyval.interm).op = EOpAddAssign; + (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 4105 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5493 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 81: -#line 688 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 147: +#line 1210 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[0].lex).loc; - (yyval.interm).op = EOpSubAssign; + parseContext.checkPrecisionQualifier((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier.precision); + (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 4114 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5502 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 82: -#line 692 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 148: +#line 1214 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift left assign"); - (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLeftShiftAssign; + // allow inheritance of storage qualifier from block declaration + (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 4123 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5511 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 83: -#line 696 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 149: +#line 1218 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift right assign"); - (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpRightShiftAssign; + // allow inheritance of storage qualifier from block declaration + (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 4132 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5520 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 84: -#line 700 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 150: +#line 1222 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-and assign"); - (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAndAssign; + // allow inheritance of storage qualifier from block declaration + (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 4141 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5529 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 85: -#line 704 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 151: +#line 1226 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-xor assign"); - (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpExclusiveOrAssign; + (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 4150 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5537 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 86: -#line 708 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 152: +#line 1232 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-or assign"); - (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpInclusiveOrAssign; + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant } -#line 4159 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5546 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 87: -#line 715 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 153: +#line 1236 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangVertex, "attribute"); + parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "attribute"); + parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "attribute"); + parseContext.requireNotRemoved((yyvsp[0].lex).loc, ECoreProfile, 420, "attribute"); + parseContext.requireNotRemoved((yyvsp[0].lex).loc, EEsProfile, 300, "attribute"); + + parseContext.globalCheck((yyvsp[0].lex).loc, "attribute"); + + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqVaryingIn; } -#line 4167 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5563 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 88: -#line 718 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 154: +#line 1248 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.samplerConstructorLocationCheck((yyvsp[-1].lex).loc, ",", (yyvsp[0].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addComma((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext.binaryOpError((yyvsp[-1].lex).loc, ",", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(), (yyvsp[0].interm.intermTypedNode)->getCompleteString()); - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); - } + parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "varying"); + parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "varying"); + parseContext.requireNotRemoved((yyvsp[0].lex).loc, ECoreProfile, 420, "varying"); + parseContext.requireNotRemoved((yyvsp[0].lex).loc, EEsProfile, 300, "varying"); + + parseContext.globalCheck((yyvsp[0].lex).loc, "varying"); + + (yyval.interm.type).init((yyvsp[0].lex).loc); + if (parseContext.language == EShLangVertex) + (yyval.interm.type).qualifier.storage = EvqVaryingOut; + else + (yyval.interm.type).qualifier.storage = EvqVaryingIn; } -#line 4180 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5582 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 89: -#line 729 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 155: +#line 1262 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.constantValueCheck((yyvsp[0].interm.intermTypedNode), ""); - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + parseContext.globalCheck((yyvsp[0].lex).loc, "inout"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqInOut; } -#line 4189 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5592 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 90: -#line 736 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 156: +#line 1267 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.handleFunctionDeclarator((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).function, true /* prototype */); - (yyval.interm.intermNode) = 0; - // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature + parseContext.globalCheck((yyvsp[0].lex).loc, "in"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later + (yyval.interm.type).qualifier.storage = EvqIn; } -#line 4199 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5603 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 91: -#line 741 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 157: +#line 1273 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - if ((yyvsp[-1].interm).intermNode && (yyvsp[-1].interm).intermNode->getAsAggregate()) - (yyvsp[-1].interm).intermNode->getAsAggregate()->setOperator(EOpSequence); - (yyval.interm.intermNode) = (yyvsp[-1].interm).intermNode; + parseContext.globalCheck((yyvsp[0].lex).loc, "out"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later + (yyval.interm.type).qualifier.storage = EvqOut; } -#line 4209 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5614 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 92: -#line 746 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 158: +#line 1279 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.profileRequires((yyvsp[-3].lex).loc, ENoProfile, 130, 0, "precision statement"); - - // lazy setting of the previous scope's defaults, has effect only the first time it is called in a particular scope - parseContext.symbolTable.setPreviousDefaultPrecisions(&parseContext.defaultPrecision[0]); - parseContext.setDefaultPrecision((yyvsp[-3].lex).loc, (yyvsp[-1].interm.type), (yyvsp[-2].interm.type).qualifier.precision); - (yyval.interm.intermNode) = 0; + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 120, 0, "centroid"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "centroid"); + parseContext.globalCheck((yyvsp[0].lex).loc, "centroid"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.centroid = true; } -#line 4222 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5626 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 93: -#line 754 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 159: +#line 1286 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.declareBlock((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).typeList); - (yyval.interm.intermNode) = 0; + parseContext.globalCheck((yyvsp[0].lex).loc, "patch"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.patch = true; } -#line 4231 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5637 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 94: -#line 758 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 160: +#line 1292 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.declareBlock((yyvsp[-2].interm).loc, *(yyvsp[-2].interm).typeList, (yyvsp[-1].lex).string); - (yyval.interm.intermNode) = 0; + parseContext.globalCheck((yyvsp[0].lex).loc, "sample"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.sample = true; } -#line 4240 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5647 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 95: -#line 762 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 161: +#line 1297 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.declareBlock((yyvsp[-3].interm).loc, *(yyvsp[-3].interm).typeList, (yyvsp[-2].lex).string, (yyvsp[-1].interm).arraySizes); - (yyval.interm.intermNode) = 0; + parseContext.globalCheck((yyvsp[0].lex).loc, "uniform"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqUniform; } -#line 4249 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5657 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 96: -#line 766 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 162: +#line 1302 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); - parseContext.updateStandaloneQualifierDefaults((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type)); - (yyval.interm.intermNode) = 0; + parseContext.globalCheck((yyvsp[0].lex).loc, "buffer"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqBuffer; } -#line 4259 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5667 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 97: -#line 771 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 163: +#line 1307 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.checkNoShaderLayouts((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).shaderQualifiers); - parseContext.addQualifierToExisting((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, *(yyvsp[-1].lex).string); - (yyval.interm.intermNode) = 0; + parseContext.globalCheck((yyvsp[0].lex).loc, "shared"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 310, 0, "shared"); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangCompute, "shared"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqShared; } -#line 4269 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5680 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 98: -#line 776 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 164: +#line 1315 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.checkNoShaderLayouts((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).shaderQualifiers); - (yyvsp[-1].interm.identifierList)->push_back((yyvsp[-2].lex).string); - parseContext.addQualifierToExisting((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).qualifier, *(yyvsp[-1].interm.identifierList)); - (yyval.interm.intermNode) = 0; + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.coherent = true; } -#line 4280 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5689 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 99: -#line 785 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { parseContext.nestedBlockCheck((yyvsp[-2].interm.type).loc); } -#line 4286 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 100: -#line 785 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 165: +#line 1319 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - --parseContext.structNestingLevel; - parseContext.blockName = (yyvsp[-4].lex).string; - parseContext.globalQualifierFixCheck((yyvsp[-5].interm.type).loc, (yyvsp[-5].interm.type).qualifier); - parseContext.checkNoShaderLayouts((yyvsp[-5].interm.type).loc, (yyvsp[-5].interm.type).shaderQualifiers); - parseContext.currentBlockQualifier = (yyvsp[-5].interm.type).qualifier; - (yyval.interm).loc = (yyvsp[-5].interm.type).loc; - (yyval.interm).typeList = (yyvsp[-1].interm.typeList); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.volatil = true; } -#line 4300 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5698 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 101: -#line 796 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 166: +#line 1323 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.identifierList) = new TIdentifierList; - (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.restrict = true; } -#line 4309 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5707 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 102: -#line 800 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 167: +#line 1327 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.identifierList) = (yyvsp[-2].interm.identifierList); - (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.readonly = true; } -#line 4318 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5716 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 103: -#line 807 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 168: +#line 1331 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).function = (yyvsp[-1].interm.function); - (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.writeonly = true; } -#line 4327 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5725 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 104: -#line 814 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 169: +#line 1335 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.function) = (yyvsp[0].interm.function); + parseContext.spvRemoved((yyvsp[0].lex).loc, "subroutine"); + parseContext.globalCheck((yyvsp[0].lex).loc, "subroutine"); + parseContext.unimplemented((yyvsp[0].lex).loc, "subroutine"); + (yyval.interm.type).init((yyvsp[0].lex).loc); } -#line 4335 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5736 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 105: -#line 817 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 170: +#line 1341 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.function) = (yyvsp[0].interm.function); + parseContext.spvRemoved((yyvsp[-3].lex).loc, "subroutine"); + parseContext.globalCheck((yyvsp[-3].lex).loc, "subroutine"); + parseContext.unimplemented((yyvsp[-3].lex).loc, "subroutine"); + (yyval.interm.type).init((yyvsp[-3].lex).loc); } -#line 4343 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5747 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 106: -#line 824 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 171: +#line 1350 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // Add the parameter - (yyval.interm.function) = (yyvsp[-1].interm.function); - if ((yyvsp[0].interm).param.type->getBasicType() != EbtVoid) - (yyvsp[-1].interm.function)->addParameter((yyvsp[0].interm).param); - else - delete (yyvsp[0].interm).param.type; + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.nonUniform = true; } -#line 4356 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5756 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 107: -#line 832 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 172: +#line 1357 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // - // Only first parameter of one-parameter functions can be void - // The check for named parameters not being void is done in parameter_declarator - // - if ((yyvsp[0].interm).param.type->getBasicType() == EbtVoid) { - // - // This parameter > first is void - // - parseContext.error((yyvsp[-1].lex).loc, "cannot be an argument type except for '(void)'", "void", ""); - delete (yyvsp[0].interm).param.type; - } else { - // Add the parameter - (yyval.interm.function) = (yyvsp[-2].interm.function); - (yyvsp[-2].interm.function)->addParameter((yyvsp[0].interm).param); - } + // TODO } -#line 4378 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5764 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 108: -#line 852 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 173: +#line 1360 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - if ((yyvsp[-2].interm.type).qualifier.storage != EvqGlobal && (yyvsp[-2].interm.type).qualifier.storage != EvqTemporary) { - parseContext.error((yyvsp[-1].lex).loc, "no qualifiers allowed for function return", - GetStorageQualifierString((yyvsp[-2].interm.type).qualifier.storage), ""); - } - if ((yyvsp[-2].interm.type).arraySizes) - parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes); - - // Add the function as a prototype after parsing it (we do not support recursion) - TFunction *function; - TType type((yyvsp[-2].interm.type)); - function = new TFunction((yyvsp[-1].lex).string, type); - (yyval.interm.function) = function; + // TODO: 4.0 semantics: subroutines + // 1) make sure each identifier is a type declared earlier with SUBROUTINE + // 2) save all of the identifiers for future comparison with the declared function } -#line 4397 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5774 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 109: -#line 870 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 174: +#line 1368 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - if ((yyvsp[-1].interm.type).arraySizes) { - parseContext.profileRequires((yyvsp[-1].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); - parseContext.profileRequires((yyvsp[-1].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); - parseContext.arraySizeRequiredCheck((yyvsp[-1].interm.type).loc, *(yyvsp[-1].interm.type).arraySizes); - } - if ((yyvsp[-1].interm.type).basicType == EbtVoid) { - parseContext.error((yyvsp[0].lex).loc, "illegal use of type 'void'", (yyvsp[0].lex).string->c_str(), ""); - } - parseContext.reservedErrorCheck((yyvsp[0].lex).loc, *(yyvsp[0].lex).string); - - TParameter param = {(yyvsp[0].lex).string, new TType((yyvsp[-1].interm.type))}; - (yyval.interm).loc = (yyvsp[0].lex).loc; - (yyval.interm).param = param; + (yyval.interm.type) = (yyvsp[0].interm.type); + (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); } -#line 4417 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5783 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 110: -#line 885 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 175: +#line 1372 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - if ((yyvsp[-2].interm.type).arraySizes) { - parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); - parseContext.profileRequires((yyvsp[-2].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); - parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes); - } - parseContext.arrayDimCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.type).arraySizes, (yyvsp[0].interm).arraySizes); - - parseContext.arraySizeRequiredCheck((yyvsp[0].interm).loc, *(yyvsp[0].interm).arraySizes); - parseContext.reservedErrorCheck((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string); - - (yyvsp[-2].interm.type).arraySizes = (yyvsp[0].interm).arraySizes; - - TParameter param = { (yyvsp[-1].lex).string, new TType((yyvsp[-2].interm.type))}; - (yyval.interm).loc = (yyvsp[-1].lex).loc; - (yyval.interm).param = param; + parseContext.arrayOfArrayVersionCheck((yyvsp[0].interm).loc, (yyvsp[0].interm).arraySizes); + (yyval.interm.type) = (yyvsp[-1].interm.type); + (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); + (yyval.interm.type).arraySizes = (yyvsp[0].interm).arraySizes; } -#line 4439 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5794 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 111: -#line 908 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 176: +#line 1381 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[0].interm); - if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) - (yyval.interm).param.type->getQualifier().precision = (yyvsp[-1].interm.type).qualifier.precision; - parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); - - parseContext.checkNoShaderLayouts((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); - parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); - parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); - + (yyval.interm).loc = (yyvsp[-1].lex).loc; + (yyval.interm).arraySizes = new TArraySizes; + (yyval.interm).arraySizes->addInnerSize(); } -#line 4455 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5804 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 112: -#line 919 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 177: +#line 1386 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[0].interm); + (yyval.interm).loc = (yyvsp[-2].lex).loc; + (yyval.interm).arraySizes = new TArraySizes; - parseContext.parameterTypeCheck((yyvsp[0].interm).loc, EvqIn, *(yyvsp[0].interm).param.type); - parseContext.paramCheckFix((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); - parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); + TArraySize size; + parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size); + (yyval.interm).arraySizes->addInnerSize(size); } -#line 4467 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5817 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 113: -#line 929 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 178: +#line 1394 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[0].interm); - if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) - (yyval.interm).param.type->getQualifier().precision = (yyvsp[-1].interm.type).qualifier.precision; - parseContext.precisionQualifierCheck((yyvsp[-1].interm.type).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); - - parseContext.checkNoShaderLayouts((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); - parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); - parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); + (yyval.interm) = (yyvsp[-2].interm); + (yyval.interm).arraySizes->addInnerSize(); } -#line 4482 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5826 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 114: -#line 939 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 179: +#line 1398 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[0].interm); + (yyval.interm) = (yyvsp[-3].interm); - parseContext.parameterTypeCheck((yyvsp[0].interm).loc, EvqIn, *(yyvsp[0].interm).param.type); - parseContext.paramCheckFix((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); - parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); + TArraySize size; + parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size); + (yyval.interm).arraySizes->addInnerSize(size); } -#line 4494 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5838 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 115: -#line 949 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 180: +#line 1408 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - TParameter param = { 0, new TType((yyvsp[0].interm.type)) }; - (yyval.interm).param = param; - if ((yyvsp[0].interm.type).arraySizes) - parseContext.arraySizeRequiredCheck((yyvsp[0].interm.type).loc, *(yyvsp[0].interm.type).arraySizes); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtVoid; } -#line 4505 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5847 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 116: -#line 958 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 181: +#line 1412 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[0].interm); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; } -#line 4513 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5856 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 117: -#line 961 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 182: +#line 1416 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[-2].interm); - parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-2].interm).type); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; } -#line 4522 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5866 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 118: -#line 965 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 183: +#line 1421 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[-3].interm); - parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-3].interm).type, (yyvsp[0].interm).arraySizes); + parseContext.float16Check((yyvsp[0].lex).loc, "float16_t", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; } -#line 4531 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5876 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 119: -#line 969 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 184: +#line 1426 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[-5].interm).type; - TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-5].interm).type, (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); - (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-5].interm).intermNode, initNode, (yyvsp[-1].lex).loc); + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; } -#line 4541 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5886 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 120: -#line 974 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 185: +#line 1431 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[-4].interm).type; - TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-4].interm).type, 0, (yyvsp[0].interm.intermTypedNode)); - (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-4].interm).intermNode, initNode, (yyvsp[-1].lex).loc); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; } -#line 4551 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5896 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 121: -#line 982 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 186: +#line 1436 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[0].interm.type); - (yyval.interm).intermNode = 0; - parseContext.declareTypeDefaults((yyval.interm).loc, (yyval.interm).type); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; } -#line 4561 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5905 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 122: -#line 987 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 187: +#line 1440 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[-1].interm.type); - (yyval.interm).intermNode = 0; - parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-1].interm.type)); + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; } -#line 4571 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5915 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 123: -#line 992 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 188: +#line 1445 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[-2].interm.type); - (yyval.interm).intermNode = 0; - parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-2].interm.type), (yyvsp[0].interm).arraySizes); + parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; } -#line 4581 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5925 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 124: -#line 997 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 189: +#line 1450 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[-4].interm.type); - TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-4].interm.type), (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); - (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); + parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint8; } -#line 4591 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5935 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 125: -#line 1002 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 190: +#line 1455 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[-3].interm.type); - TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); - (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; } -#line 4601 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5945 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 126: -#line 1011 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 191: +#line 1460 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[0].interm.type); - - parseContext.globalQualifierTypeCheck((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier, (yyval.interm.type)); - if ((yyvsp[0].interm.type).arraySizes) { - parseContext.profileRequires((yyvsp[0].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); - parseContext.profileRequires((yyvsp[0].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); - } - - parseContext.precisionQualifierCheck((yyval.interm.type).loc, (yyval.interm.type).basicType, (yyval.interm.type).qualifier); + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; } -#line 4617 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5955 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 127: -#line 1022 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 192: +#line 1465 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); - parseContext.globalQualifierTypeCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, (yyvsp[0].interm.type)); - - if ((yyvsp[0].interm.type).arraySizes) { - parseContext.profileRequires((yyvsp[0].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); - parseContext.profileRequires((yyvsp[0].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); - } - - if ((yyvsp[0].interm.type).arraySizes && parseContext.arrayQualifierError((yyvsp[0].interm.type).loc, (yyvsp[-1].interm.type).qualifier)) - (yyvsp[0].interm.type).arraySizes = 0; - - parseContext.checkNoShaderLayouts((yyvsp[0].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); - (yyvsp[0].interm.type).shaderQualifiers.merge((yyvsp[-1].interm.type).shaderQualifiers); - parseContext.mergeQualifiers((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier, (yyvsp[-1].interm.type).qualifier, true); - parseContext.precisionQualifierCheck((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).basicType, (yyvsp[0].interm.type).qualifier); - - (yyval.interm.type) = (yyvsp[0].interm.type); - - if (! (yyval.interm.type).qualifier.isInterpolation() && - ((parseContext.language == EShLangVertex && (yyval.interm.type).qualifier.storage == EvqVaryingOut) || - (parseContext.language == EShLangFragment && (yyval.interm.type).qualifier.storage == EvqVaryingIn))) - (yyval.interm.type).qualifier.smooth = true; + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; } -#line 4646 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5965 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 128: -#line 1049 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 193: +#line 1470 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "invariant"); - parseContext.profileRequires((yyval.interm.type).loc, ENoProfile, 120, 0, "invariant"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.invariant = true; + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; } -#line 4657 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5975 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 129: -#line 1058 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 194: +#line 1475 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "smooth"); - parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "smooth"); - parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "smooth"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.smooth = true; + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; } -#line 4669 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5985 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 130: -#line 1065 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 195: +#line 1480 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "flat"); - parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "flat"); - parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "flat"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.flat = true; + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint64; } -#line 4681 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5995 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 131: -#line 1072 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 196: +#line 1485 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "noperspective"); - parseContext.requireProfile((yyvsp[0].lex).loc, ~EEsProfile, "noperspective"); - parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "noperspective"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.nopersp = true; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; } -#line 4693 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6004 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 132: -#line 1079 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 197: +#line 1489 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.globalCheck((yyvsp[0].lex).loc, "__explicitInterpAMD"); - parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); - parseContext.profileRequires((yyvsp[0].lex).loc, ECompatibilityProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.explicitInterp = true; -#endif + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(2); } -#line 4707 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6014 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 133: -#line 1091 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 198: +#line 1494 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[-1].interm.type); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(3); } -#line 4715 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6024 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 134: -#line 1097 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 199: +#line 1499 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[0].interm.type); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(4); } -#line 4723 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6034 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 135: -#line 1100 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 200: +#line 1504 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[-2].interm.type); - (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); - parseContext.mergeObjectLayoutQualifiers((yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(2); } -#line 4733 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6045 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 136: -#line 1107 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 201: +#line 1510 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[0].lex).loc); - parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), *(yyvsp[0].lex).string); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(3); } -#line 4742 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6056 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 137: -#line 1111 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 202: +#line 1516 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[-2].lex).loc); - parseContext.setLayoutQualifier((yyvsp[-2].lex).loc, (yyval.interm.type), *(yyvsp[-2].lex).string, (yyvsp[0].interm.intermTypedNode)); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(4); } -#line 4751 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6067 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 138: -#line 1115 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { // because "shared" is both an identifier and a keyword - (yyval.interm.type).init((yyvsp[0].lex).loc); - TString strShared("shared"); - parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), strShared); + case 203: +#line 1522 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setVector(2); } -#line 4761 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6078 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 139: -#line 1123 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 204: +#line 1528 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.profileRequires((yyval.interm.type).loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise"); - parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.noContraction = true; + parseContext.float16Check((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setVector(3); } -#line 4772 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6089 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 140: -#line 1132 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 205: +#line 1534 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[0].interm.type); + parseContext.float16Check((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setVector(4); } -#line 4780 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6100 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 141: -#line 1135 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 206: +#line 1540 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[-1].interm.type); - if ((yyval.interm.type).basicType == EbtVoid) - (yyval.interm.type).basicType = (yyvsp[0].interm.type).basicType; - - (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); - parseContext.mergeQualifiers((yyval.interm.type).loc, (yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(2); } -#line 4793 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6111 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 142: -#line 1146 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 207: +#line 1546 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[0].interm.type); + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(3); } -#line 4801 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6122 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 143: -#line 1149 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 208: +#line 1552 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[0].interm.type); + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(4); } -#line 4809 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6133 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 144: -#line 1152 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 209: +#line 1558 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.checkPrecisionQualifier((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier.precision); - (yyval.interm.type) = (yyvsp[0].interm.type); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(2); } -#line 4818 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6144 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 145: -#line 1156 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 210: +#line 1564 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // allow inheritance of storage qualifier from block declaration - (yyval.interm.type) = (yyvsp[0].interm.type); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(3); } -#line 4827 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6155 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 146: -#line 1160 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 211: +#line 1570 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // allow inheritance of storage qualifier from block declaration - (yyval.interm.type) = (yyvsp[0].interm.type); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(4); } -#line 4836 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6166 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 147: -#line 1164 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 212: +#line 1576 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // allow inheritance of storage qualifier from block declaration - (yyval.interm.type) = (yyvsp[0].interm.type); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(2); } -#line 4845 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6176 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 148: -#line 1171 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 213: +#line 1581 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(3); } -#line 4854 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6186 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 149: -#line 1175 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 214: +#line 1586 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.requireStage((yyvsp[0].lex).loc, EShLangVertex, "attribute"); - parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "attribute"); - parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "attribute"); - parseContext.requireNotRemoved((yyvsp[0].lex).loc, ECoreProfile, 420, "attribute"); - parseContext.requireNotRemoved((yyvsp[0].lex).loc, EEsProfile, 300, "attribute"); - - parseContext.globalCheck((yyvsp[0].lex).loc, "attribute"); - - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.storage = EvqVaryingIn; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(4); } -#line 4871 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6196 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 150: -#line 1187 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 215: +#line 1591 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "varying"); - parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "varying"); - parseContext.requireNotRemoved((yyvsp[0].lex).loc, ECoreProfile, 420, "varying"); - parseContext.requireNotRemoved((yyvsp[0].lex).loc, EEsProfile, 300, "varying"); - - parseContext.globalCheck((yyvsp[0].lex).loc, "varying"); - - (yyval.interm.type).init((yyvsp[0].lex).loc); - if (parseContext.language == EShLangVertex) - (yyval.interm.type).qualifier.storage = EvqVaryingOut; - else - (yyval.interm.type).qualifier.storage = EvqVaryingIn; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(2); } -#line 4890 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6206 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 151: -#line 1201 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 216: +#line 1596 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "inout"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.storage = EvqInOut; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(3); } -#line 4900 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6216 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 152: -#line 1206 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 217: +#line 1601 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "in"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later - (yyval.interm.type).qualifier.storage = EvqIn; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(4); } -#line 4911 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6226 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 153: -#line 1212 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 218: +#line 1606 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "out"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later - (yyval.interm.type).qualifier.storage = EvqOut; + parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; + (yyval.interm.type).setVector(2); } -#line 4922 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6237 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 154: -#line 1218 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 219: +#line 1612 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 120, 0, "centroid"); - parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "centroid"); - parseContext.globalCheck((yyvsp[0].lex).loc, "centroid"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.centroid = true; + parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; + (yyval.interm.type).setVector(3); } -#line 4934 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6248 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 155: -#line 1225 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 220: +#line 1618 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "patch"); - parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.patch = true; + parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; + (yyval.interm.type).setVector(4); } -#line 4945 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6259 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 156: -#line 1231 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 221: +#line 1624 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "sample"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.sample = true; + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).setVector(2); } -#line 4955 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6270 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 157: -#line 1236 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 222: +#line 1630 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "uniform"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.storage = EvqUniform; + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).setVector(3); } -#line 4965 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6281 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 158: -#line 1241 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 223: +#line 1636 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "buffer"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.storage = EvqBuffer; + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).setVector(4); } -#line 4975 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6292 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 159: -#line 1246 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 224: +#line 1642 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "shared"); - parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared"); - parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 310, 0, "shared"); - parseContext.requireStage((yyvsp[0].lex).loc, EShLangCompute, "shared"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.storage = EvqShared; + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(2); } -#line 4988 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6303 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 160: -#line 1254 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 225: +#line 1648 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.coherent = true; + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(3); } -#line 4997 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6314 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 161: -#line 1258 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 226: +#line 1654 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.volatil = true; + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(4); } -#line 5006 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6325 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 162: -#line 1262 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 227: +#line 1660 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.restrict = true; + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).setVector(2); } -#line 5015 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6336 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 163: -#line 1266 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 228: +#line 1666 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.readonly = true; + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).setVector(3); } -#line 5024 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6347 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 164: -#line 1270 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 229: +#line 1672 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.writeonly = true; + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).setVector(4); } -#line 5033 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6358 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 165: -#line 1274 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 230: +#line 1678 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.spvRemoved((yyvsp[0].lex).loc, "subroutine"); - parseContext.globalCheck((yyvsp[0].lex).loc, "subroutine"); - parseContext.unimplemented((yyvsp[0].lex).loc, "subroutine"); - (yyval.interm.type).init((yyvsp[0].lex).loc); + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(2); } -#line 5044 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6369 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 166: -#line 1280 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 231: +#line 1684 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.spvRemoved((yyvsp[-3].lex).loc, "subroutine"); - parseContext.globalCheck((yyvsp[-3].lex).loc, "subroutine"); - parseContext.unimplemented((yyvsp[-3].lex).loc, "subroutine"); - (yyval.interm.type).init((yyvsp[-3].lex).loc); + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(3); } -#line 5055 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6380 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 167: -#line 1289 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 232: +#line 1690 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // TODO + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(4); } -#line 5063 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6391 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 168: -#line 1292 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 233: +#line 1696 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // TODO: 4.0 semantics: subroutines - // 1) make sure each identifier is a type declared earlier with SUBROUTINE - // 2) save all of the identifiers for future comparison with the declared function + parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint8; + (yyval.interm.type).setVector(2); } -#line 5073 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6402 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 169: -#line 1300 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 234: +#line 1702 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[0].interm.type); - (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); + parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; + (yyval.interm.type).setVector(3); } -#line 5082 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6413 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 170: -#line 1304 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 235: +#line 1708 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.arrayDimCheck((yyvsp[0].interm).loc, (yyvsp[0].interm).arraySizes, 0); - (yyval.interm.type) = (yyvsp[-1].interm.type); - (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); - (yyval.interm.type).arraySizes = (yyvsp[0].interm).arraySizes; + parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint8; + (yyval.interm.type).setVector(4); } -#line 5093 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6424 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 171: -#line 1313 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 236: +#line 1714 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[-1].lex).loc; - (yyval.interm).arraySizes = new TArraySizes; - (yyval.interm).arraySizes->addInnerSize(); + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; + (yyval.interm.type).setVector(2); } -#line 5103 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6435 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 172: -#line 1318 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 237: +#line 1720 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[-2].lex).loc; - (yyval.interm).arraySizes = new TArraySizes; - - TArraySize size; - parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size); - (yyval.interm).arraySizes->addInnerSize(size); + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; + (yyval.interm.type).setVector(3); } -#line 5116 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6446 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 173: -#line 1326 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 238: +#line 1726 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[-2].interm); - (yyval.interm).arraySizes->addInnerSize(); + parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; + (yyval.interm.type).setVector(4); } -#line 5125 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6457 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 174: -#line 1330 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 239: +#line 1732 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[-3].interm); - - TArraySize size; - parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size); - (yyval.interm).arraySizes->addInnerSize(size); + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(2); } -#line 5137 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6468 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 175: -#line 1340 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 240: +#line 1738 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtVoid; + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(3); } -#line 5146 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6479 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 176: -#line 1344 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 241: +#line 1744 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(4); } -#line 5155 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6490 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 177: -#line 1348 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 242: +#line 1750 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double"); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).basicType = EbtUint64; + (yyval.interm.type).setVector(2); } -#line 5165 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6501 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 178: -#line 1353 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 243: +#line 1756 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; -#endif + (yyval.interm.type).basicType = EbtUint64; + (yyval.interm.type).setVector(3); } -#line 5177 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6512 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 179: -#line 1360 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 244: +#line 1762 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).basicType = EbtUint64; + (yyval.interm.type).setVector(4); } -#line 5186 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6523 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 180: -#line 1364 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 245: +#line 1768 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 2); } -#line 5196 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6533 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 181: -#line 1369 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 246: +#line 1773 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 3); } -#line 5206 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6543 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 182: -#line 1374 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 247: +#line 1778 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint64; + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 4); } -#line 5216 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6553 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 183: -#line 1379 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 248: +#line 1783 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.int16Check((yyvsp[0].lex).loc, "16-bit integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt16; -#endif + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 2); } -#line 5228 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6563 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 184: -#line 1386 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 249: +#line 1788 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.int16Check((yyvsp[0].lex).loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint16; -#endif + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 3); } -#line 5240 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6573 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 185: -#line 1393 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 250: +#line 1793 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 4); } -#line 5249 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6583 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 186: -#line 1397 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 251: +#line 1798 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(2); + (yyval.interm.type).setMatrix(3, 2); } -#line 5259 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6593 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 187: -#line 1402 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 252: +#line 1803 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(3); + (yyval.interm.type).setMatrix(3, 3); } -#line 5269 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6603 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 188: -#line 1407 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 253: +#line 1808 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(4); + (yyval.interm.type).setMatrix(3, 4); } -#line 5279 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6613 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 189: -#line 1412 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 254: +#line 1813 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(2); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 2); } -#line 5290 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6623 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 190: -#line 1418 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 255: +#line 1818 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(3); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 3); } -#line 5301 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6633 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 191: -#line 1424 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 256: +#line 1823 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(4); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 4); } -#line 5312 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6643 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 192: -#line 1430 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 257: +#line 1828 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setVector(2); -#endif + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 2); } -#line 5325 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6654 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 193: -#line 1438 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 258: +#line 1834 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setVector(3); -#endif + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 3); } -#line 5338 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6665 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 194: -#line 1446 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 259: +#line 1840 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setVector(4); -#endif + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 4); } -#line 5351 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6676 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 195: -#line 1454 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 260: +#line 1846 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; - (yyval.interm.type).setVector(2); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 2); } -#line 5361 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6687 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 196: -#line 1459 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 261: +#line 1852 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; - (yyval.interm.type).setVector(3); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 3); } -#line 5371 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6698 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 197: -#line 1464 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 262: +#line 1858 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; - (yyval.interm.type).setVector(4); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 4); } -#line 5381 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6709 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 198: -#line 1469 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 263: +#line 1864 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; - (yyval.interm.type).setVector(2); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 2); } -#line 5391 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6720 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 199: -#line 1474 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 264: +#line 1870 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; - (yyval.interm.type).setVector(3); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 3); } -#line 5401 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6731 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 200: -#line 1479 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 265: +#line 1876 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; - (yyval.interm.type).setVector(4); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 4); } -#line 5411 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6742 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 201: -#line 1484 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 266: +#line 1882 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt64; - (yyval.interm.type).setVector(2); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 2); } -#line 5422 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6753 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 202: -#line 1490 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 267: +#line 1888 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt64; - (yyval.interm.type).setVector(3); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 3); } -#line 5433 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6764 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 203: -#line 1496 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 268: +#line 1894 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt64; - (yyval.interm.type).setVector(4); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 4); } -#line 5444 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6775 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 204: -#line 1502 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 269: +#line 1900 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.int16Check((yyvsp[0].lex).loc, "16-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt16; - (yyval.interm.type).setVector(2); -#endif + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(2, 2); } -#line 5457 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6786 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 205: -#line 1510 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 270: +#line 1906 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.int16Check((yyvsp[0].lex).loc, "16-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt16; - (yyval.interm.type).setVector(3); -#endif + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(3, 3); } -#line 5470 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6797 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 206: -#line 1518 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 271: +#line 1912 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.int16Check((yyvsp[0].lex).loc, "16-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt16; - (yyval.interm.type).setVector(4); -#endif + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(4, 4); } -#line 5483 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6808 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 207: -#line 1526 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 272: +#line 1918 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint; - (yyval.interm.type).setVector(2); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(2, 2); } -#line 5494 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6819 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 208: -#line 1532 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 273: +#line 1924 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint; - (yyval.interm.type).setVector(3); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(2, 3); } -#line 5505 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6830 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 209: -#line 1538 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 274: +#line 1930 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint; - (yyval.interm.type).setVector(4); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(2, 4); } -#line 5516 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6841 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 210: -#line 1544 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 275: +#line 1936 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint64; - (yyval.interm.type).setVector(2); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(3, 2); } -#line 5527 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6852 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 211: -#line 1550 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 276: +#line 1942 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint64; - (yyval.interm.type).setVector(3); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(3, 3); } -#line 5538 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6863 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 212: -#line 1556 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 277: +#line 1948 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint64; - (yyval.interm.type).setVector(4); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(3, 4); } -#line 5549 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6874 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 213: -#line 1562 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 278: +#line 1954 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.int16Check((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint16; - (yyval.interm.type).setVector(2); -#endif + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(4, 2); } -#line 5562 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6885 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 214: -#line 1570 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 279: +#line 1960 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.int16Check((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint16; - (yyval.interm.type).setVector(3); -#endif + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(4, 3); } -#line 5575 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6896 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 215: -#line 1578 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 280: +#line 1966 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.int16Check((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint16; - (yyval.interm.type).setVector(4); -#endif + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(4, 4); } -#line 5588 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6907 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 216: -#line 1586 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 281: +#line 1972 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 5598 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6918 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 217: -#line 1591 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 282: +#line 1978 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 5608 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6929 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 218: -#line 1596 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 283: +#line 1984 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 5618 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6940 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 219: -#line 1601 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 284: +#line 1990 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 5628 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6951 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 220: -#line 1606 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 285: +#line 1996 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 3); } -#line 5638 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6962 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 221: -#line 1611 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 286: +#line 2002 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 4); } -#line 5648 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6973 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 222: -#line 1616 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 287: +#line 2008 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 2); } -#line 5658 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6984 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 223: -#line 1621 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 288: +#line 2014 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 5668 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6995 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 224: -#line 1626 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 289: +#line 2020 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 4); } -#line 5678 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7006 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 225: -#line 1631 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 290: +#line 2026 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 2); } -#line 5688 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7017 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 226: -#line 1636 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 291: +#line 2032 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 3); } -#line 5698 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7028 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 227: -#line 1641 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 292: +#line 2038 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 5708 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7039 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 228: -#line 1646 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 293: +#line 2044 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 5719 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7050 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 229: -#line 1652 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 294: +#line 2050 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 5730 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7061 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 230: -#line 1658 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 295: +#line 2056 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 5741 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7072 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 231: -#line 1664 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 296: +#line 2062 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 5752 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7083 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 232: -#line 1670 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 297: +#line 2068 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 3); } -#line 5763 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7094 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 233: -#line 1676 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 298: +#line 2074 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 4); } -#line 5774 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7105 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 234: -#line 1682 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 299: +#line 2080 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 2); } -#line 5785 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7116 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 235: -#line 1688 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 300: +#line 2086 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 5796 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7127 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 236: -#line 1694 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 301: +#line 2092 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 4); } -#line 5807 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7138 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 237: -#line 1700 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 302: +#line 2098 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 2); } -#line 5818 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7149 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 238: -#line 1706 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 303: +#line 2104 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 3); } -#line 5829 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7160 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 239: -#line 1712 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 304: +#line 2110 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 5840 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7171 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 240: -#line 1718 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 305: +#line 2116 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + parseContext.vulkanRemoved((yyvsp[0].lex).loc, "atomic counter types"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(2, 2); -#endif + (yyval.interm.type).basicType = EbtAtomicUint; } -#line 5853 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7181 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 241: -#line 1726 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 306: +#line 2121 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { -#ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(3, 3); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd1D); + } +#line 7191 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 307: +#line 2126 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D); + } +#line 7201 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 308: +#line 2131 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd3D); + } +#line 7211 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 309: +#line 2136 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdCube); + } +#line 7221 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 310: +#line 2141 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd1D, false, true); + } +#line 7231 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 311: +#line 2146 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, true); + } +#line 7241 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 312: +#line 2151 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdCube, false, true); + } +#line 7251 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 313: +#line 2156 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true); + } +#line 7261 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 314: +#line 2161 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true); + } +#line 7271 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 315: +#line 2166 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true, true); + } +#line 7281 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 316: +#line 2171 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, true); + } +#line 7291 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 317: +#line 2176 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true); + } +#line 7301 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 318: +#line 2181 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true, true); + } +#line 7311 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 319: +#line 2186 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd1D); #endif } -#line 5866 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7324 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 242: -#line 1734 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 320: +#line 2194 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(4, 4); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd2D); #endif } -#line 5879 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7337 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 243: -#line 1742 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 321: +#line 2202 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(2, 2); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd3D); #endif } -#line 5892 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7350 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 244: -#line 1750 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 322: +#line 2210 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(2, 3); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, EsdCube); #endif } -#line 5905 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7363 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 245: -#line 1758 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 323: +#line 2218 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(2, 4); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, false, true); #endif } -#line 5918 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7376 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 246: -#line 1766 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 324: +#line 2226 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(3, 2); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, true); #endif } -#line 5931 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7389 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 247: -#line 1774 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 325: +#line 2234 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(3, 3); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, false, true); #endif } -#line 5944 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7402 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 248: -#line 1782 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 326: +#line 2242 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(3, 4); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true); #endif } -#line 5957 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7415 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 249: -#line 1790 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 327: +#line 2250 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(4, 2); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true); #endif } -#line 5970 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7428 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 250: -#line 1798 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 328: +#line 2258 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(4, 3); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true, true); #endif } -#line 5983 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7441 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 251: -#line 1806 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 329: +#line 2266 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(4, 4); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, true); #endif } -#line 5996 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7454 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 252: -#line 1814 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 330: +#line 2274 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.vulkanRemoved((yyvsp[0].lex).loc, "atomic counter types"); +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtAtomicUint; + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true); +#endif } -#line 6006 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7467 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 253: -#line 1819 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 331: +#line 2282 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd1D); + (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true, true); +#endif } -#line 6016 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7480 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 254: -#line 1824 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 332: +#line 2290 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd2D); + (yyval.interm.type).sampler.set(EbtInt, Esd1D); } -#line 6026 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7490 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 255: -#line 1829 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 333: +#line 2295 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd3D); + (yyval.interm.type).sampler.set(EbtInt, Esd2D); } -#line 6036 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7500 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 256: -#line 1834 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 334: +#line 2300 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdCube); + (yyval.interm.type).sampler.set(EbtInt, Esd3D); } -#line 6046 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7510 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 257: -#line 1839 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 335: +#line 2305 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd1D, false, true); + (yyval.interm.type).sampler.set(EbtInt, EsdCube); } -#line 6056 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7520 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 258: -#line 1844 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 336: +#line 2310 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, true); + (yyval.interm.type).sampler.set(EbtInt, Esd1D, true); } -#line 6066 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7530 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 259: -#line 1849 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 337: +#line 2315 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdCube, false, true); + (yyval.interm.type).sampler.set(EbtInt, Esd2D, true); } -#line 6076 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7540 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 260: -#line 1854 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 338: +#line 2320 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true); + (yyval.interm.type).sampler.set(EbtInt, EsdCube, true); } -#line 6086 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7550 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 261: -#line 1859 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 339: +#line 2325 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true); + (yyval.interm.type).sampler.set(EbtUint, Esd1D); } -#line 6096 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7560 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 262: -#line 1864 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 340: +#line 2330 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true, true); + (yyval.interm.type).sampler.set(EbtUint, Esd2D); } -#line 6106 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7570 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 263: -#line 1869 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 341: +#line 2335 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, true); + (yyval.interm.type).sampler.set(EbtUint, Esd3D); } -#line 6116 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7580 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 264: -#line 1874 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 342: +#line 2340 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true); + (yyval.interm.type).sampler.set(EbtUint, EsdCube); } -#line 6126 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7590 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 265: -#line 1879 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 343: +#line 2345 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true, true); + (yyval.interm.type).sampler.set(EbtUint, Esd1D, true); } -#line 6136 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7600 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 266: -#line 1884 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 344: +#line 2350 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd1D); + (yyval.interm.type).sampler.set(EbtUint, Esd2D, true); } -#line 6146 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7610 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 267: -#line 1889 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 345: +#line 2355 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd2D); + (yyval.interm.type).sampler.set(EbtUint, EsdCube, true); } -#line 6156 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7620 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 268: -#line 1894 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 346: +#line 2360 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd3D); + (yyval.interm.type).sampler.set(EbtFloat, EsdRect); } -#line 6166 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7630 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 269: -#line 1899 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 347: +#line 2365 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, EsdCube); + (yyval.interm.type).sampler.set(EbtFloat, EsdRect, false, true); } -#line 6176 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7640 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 270: -#line 1904 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 348: +#line 2370 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd1D, true); + (yyval.interm.type).sampler.set(EbtFloat16, EsdRect); +#endif } -#line 6186 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7653 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 271: -#line 1909 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 349: +#line 2378 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd2D, true); + (yyval.interm.type).sampler.set(EbtFloat16, EsdRect, false, true); +#endif } -#line 6196 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7666 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 272: -#line 1914 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 350: +#line 2386 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, EsdCube, true); + (yyval.interm.type).sampler.set(EbtInt, EsdRect); } -#line 6206 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7676 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 273: -#line 1919 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 351: +#line 2391 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd1D); + (yyval.interm.type).sampler.set(EbtUint, EsdRect); } -#line 6216 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7686 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 274: -#line 1924 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 352: +#line 2396 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd2D); + (yyval.interm.type).sampler.set(EbtFloat, EsdBuffer); } -#line 6226 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7696 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 275: -#line 1929 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 353: +#line 2401 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd3D); + (yyval.interm.type).sampler.set(EbtFloat16, EsdBuffer); +#endif } -#line 6236 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7709 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 276: -#line 1934 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 354: +#line 2409 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, EsdCube); + (yyval.interm.type).sampler.set(EbtInt, EsdBuffer); } -#line 6246 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7719 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 277: -#line 1939 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 355: +#line 2414 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd1D, true); + (yyval.interm.type).sampler.set(EbtUint, EsdBuffer); } -#line 6256 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7729 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 278: -#line 1944 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 356: +#line 2419 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd2D, true); + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, false, true); } -#line 6266 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7739 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 279: -#line 1949 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 357: +#line 2424 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, EsdCube, true); + (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, false, true); +#endif } -#line 6276 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7752 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 280: -#line 1954 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 358: +#line 2432 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdRect); + (yyval.interm.type).sampler.set(EbtInt, Esd2D, false, false, true); } -#line 6286 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7762 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 281: -#line 1959 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 359: +#line 2437 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdRect, false, true); + (yyval.interm.type).sampler.set(EbtUint, Esd2D, false, false, true); } -#line 6296 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7772 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 282: -#line 1964 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 360: +#line 2442 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, EsdRect); + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, false, true); } -#line 6306 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7782 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 283: -#line 1969 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 361: +#line 2447 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, EsdRect); + (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, false, true); +#endif } -#line 6316 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7795 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 284: -#line 1974 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 362: +#line 2455 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdBuffer); + (yyval.interm.type).sampler.set(EbtInt, Esd2D, true, false, true); } -#line 6326 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7805 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 285: -#line 1979 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 363: +#line 2460 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, EsdBuffer); + (yyval.interm.type).sampler.set(EbtUint, Esd2D, true, false, true); } -#line 6336 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7815 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 286: -#line 1984 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 364: +#line 2465 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, EsdBuffer); + (yyval.interm.type).sampler.setPureSampler(false); } -#line 6346 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7825 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 287: -#line 1989 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 365: +#line 2470 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, false, true); + (yyval.interm.type).sampler.setPureSampler(true); } -#line 6356 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7835 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 288: -#line 1994 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 366: +#line 2475 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd2D, false, false, true); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D); } -#line 6366 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7845 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 289: -#line 1999 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 367: +#line 2480 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd2D, false, false, true); + (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D); +#endif } -#line 6376 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7858 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 290: -#line 2004 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 368: +#line 2488 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, false, true); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D); } -#line 6386 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7868 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 291: -#line 2009 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 369: +#line 2493 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd2D, true, false, true); + (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D); +#endif } -#line 6396 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7881 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 292: -#line 2014 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 370: +#line 2501 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd2D, true, false, true); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd3D); } -#line 6406 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7891 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 293: -#line 2019 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 371: +#line 2506 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setPureSampler(false); + (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd3D); +#endif } -#line 6416 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7904 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 294: -#line 2024 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 372: +#line 2514 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setPureSampler(true); + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube); } -#line 6426 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7914 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 295: -#line 2029 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 373: +#line 2519 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D); + (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube); +#endif } -#line 6436 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7927 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 296: -#line 2034 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 374: +#line 2527 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D, true); } -#line 6446 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7937 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 297: -#line 2039 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 375: +#line 2532 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd3D); + (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D, true); +#endif } -#line 6456 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7950 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 298: -#line 2044 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 376: +#line 2540 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true); } -#line 6466 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7960 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 299: -#line 2049 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 377: +#line 2545 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D, true); + (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true); +#endif } -#line 6476 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7973 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 300: -#line 2054 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 378: +#line 2553 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true); + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube, true); } -#line 6486 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7983 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 301: -#line 2059 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 379: +#line 2558 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube, true); + (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube, true); +#endif } -#line 6496 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7996 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 302: -#line 2064 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 380: +#line 2566 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D); } -#line 6506 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8006 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 303: -#line 2069 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 381: +#line 2571 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D); } -#line 6516 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8016 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 304: -#line 2074 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 382: +#line 2576 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd3D); } -#line 6526 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8026 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 305: -#line 2079 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 383: +#line 2581 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube); } -#line 6536 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8036 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 306: -#line 2084 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 384: +#line 2586 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D, true); } -#line 6546 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8046 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 307: -#line 2089 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 385: +#line 2591 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true); } -#line 6556 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8056 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 308: -#line 2094 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 386: +#line 2596 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube, true); } -#line 6566 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8066 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 309: -#line 2099 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 387: +#line 2601 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D); } -#line 6576 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8076 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 310: -#line 2104 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 388: +#line 2606 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D); } -#line 6586 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8086 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 311: -#line 2109 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 389: +#line 2611 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd3D); } -#line 6596 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8096 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 312: -#line 2114 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 390: +#line 2616 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube); } -#line 6606 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8106 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 313: -#line 2119 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 391: +#line 2621 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D, true); } -#line 6616 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8116 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 314: -#line 2124 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 392: +#line 2626 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true); } -#line 6626 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8126 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 315: -#line 2129 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 393: +#line 2631 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube, true); } -#line 6636 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8136 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 316: -#line 2134 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 394: +#line 2636 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdRect); } -#line 6646 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8146 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 317: -#line 2139 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 395: +#line 2641 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdRect); +#endif + } +#line 8159 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 396: +#line 2649 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdRect); } -#line 6656 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8169 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 318: -#line 2144 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 397: +#line 2654 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdRect); } -#line 6666 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8179 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 319: -#line 2149 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 398: +#line 2659 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdBuffer); } -#line 6676 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8189 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 320: -#line 2154 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 399: +#line 2664 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdBuffer); +#endif + } +#line 8202 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 400: +#line 2672 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdBuffer); } -#line 6686 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8212 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 321: -#line 2159 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 401: +#line 2677 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdBuffer); } -#line 6696 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8222 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 322: -#line 2164 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 402: +#line 2682 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, false, false, true); } -#line 6706 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8232 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 323: -#line 2169 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 403: +#line 2687 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, false, false, true); +#endif + } +#line 8245 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 404: +#line 2695 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, false, false, true); } -#line 6716 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8255 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 324: -#line 2174 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 405: +#line 2700 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, false, false, true); } -#line 6726 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8265 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 325: -#line 2179 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 406: +#line 2705 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true, false, true); } -#line 6736 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8275 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 326: -#line 2184 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 407: +#line 2710 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true, false, true); +#endif + } +#line 8288 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 408: +#line 2718 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true, false, true); } -#line 6746 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8298 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 327: -#line 2189 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 409: +#line 2723 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true, false, true); } -#line 6756 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8308 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 328: -#line 2194 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 410: +#line 2728 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D); } -#line 6766 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8318 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 329: -#line 2199 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 411: +#line 2733 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D); +#endif + } +#line 8331 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 412: +#line 2741 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd1D); } -#line 6776 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8341 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 330: -#line 2204 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 413: +#line 2746 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd1D); } -#line 6786 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8351 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 331: -#line 2209 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 414: +#line 2751 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D); } -#line 6796 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8361 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 332: -#line 2214 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 415: +#line 2756 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D); +#endif + } +#line 8374 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 416: +#line 2764 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D); } -#line 6806 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8384 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 333: -#line 2219 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 417: +#line 2769 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D); } -#line 6816 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8394 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 334: -#line 2224 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 418: +#line 2774 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd3D); } -#line 6826 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8404 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 335: -#line 2229 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 419: +#line 2779 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat16, Esd3D); +#endif + } +#line 8417 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 420: +#line 2787 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd3D); } -#line 6836 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8427 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 336: -#line 2234 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 421: +#line 2792 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd3D); } -#line 6846 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8437 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 337: -#line 2239 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 422: +#line 2797 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdRect); } -#line 6856 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8447 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 338: -#line 2244 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 423: +#line 2802 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat16, EsdRect); +#endif + } +#line 8460 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 424: +#line 2810 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdRect); } -#line 6866 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8470 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 339: -#line 2249 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 425: +#line 2815 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdRect); } -#line 6876 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8480 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 340: -#line 2254 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 426: +#line 2820 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube); } -#line 6886 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8490 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 341: -#line 2259 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 427: +#line 2825 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube); +#endif + } +#line 8503 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 428: +#line 2833 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdCube); } -#line 6896 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8513 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 342: -#line 2264 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 429: +#line 2838 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdCube); } -#line 6906 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8523 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 343: -#line 2269 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 430: +#line 2843 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdBuffer); } -#line 6916 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8533 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 344: -#line 2274 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 431: +#line 2848 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat16, EsdBuffer); +#endif + } +#line 8546 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 432: +#line 2856 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdBuffer); } -#line 6926 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8556 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 433: +#line 2861 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, EsdBuffer); + } +#line 8566 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 345: -#line 2279 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 434: +#line 2866 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, EsdBuffer); + (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D, true); } -#line 6936 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8576 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 346: -#line 2284 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 435: +#line 2871 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D, true); + (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D, true); +#endif } -#line 6946 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8589 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 347: -#line 2289 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 436: +#line 2879 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd1D, true); } -#line 6956 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8599 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 348: -#line 2294 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 437: +#line 2884 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd1D, true); } -#line 6966 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8609 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 349: -#line 2299 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 438: +#line 2889 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true); } -#line 6976 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8619 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 350: -#line 2304 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 439: +#line 2894 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true); +#endif + } +#line 8632 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 440: +#line 2902 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true); } -#line 6986 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8642 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 351: -#line 2309 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 441: +#line 2907 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true); } -#line 6996 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8652 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 352: -#line 2314 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 442: +#line 2912 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube, true); } -#line 7006 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8662 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 353: -#line 2319 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 443: +#line 2917 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube, true); +#endif + } +#line 8675 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 444: +#line 2925 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdCube, true); } -#line 7016 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8685 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 354: -#line 2324 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 445: +#line 2930 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdCube, true); } -#line 7026 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8695 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 355: -#line 2329 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 446: +#line 2935 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, false, false, true); } -#line 7036 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8705 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 356: -#line 2334 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 447: +#line 2940 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, false, false, true); +#endif + } +#line 8718 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 448: +#line 2948 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, false, false, true); } -#line 7046 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8728 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 357: -#line 2339 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 449: +#line 2953 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, false, false, true); } -#line 7056 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8738 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 358: -#line 2344 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 450: +#line 2958 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true, false, true); } -#line 7066 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8748 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 359: -#line 2349 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 451: +#line 2963 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true, false, true); +#endif + } +#line 8761 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 452: +#line 2971 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true, false, true); } -#line 7076 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8771 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 360: -#line 2354 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 453: +#line 2976 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true, false, true); } -#line 7086 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8781 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 361: -#line 2359 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 454: +#line 2981 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // GL_OES_EGL_image_external (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); (yyval.interm.type).sampler.external = true; } -#line 7097 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8792 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 362: -#line 2365 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 455: +#line 2987 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat); } -#line 7108 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8803 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 363: -#line 2371 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 456: +#line 2993 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat, true); } -#line 7119 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8814 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 364: -#line 2377 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 457: +#line 2999 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setSubpass(EbtFloat16); +#endif + } +#line 8828 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 458: +#line 3008 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef AMD_EXTENSIONS + parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setSubpass(EbtFloat16, true); +#endif + } +#line 8842 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 459: +#line 3017 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt); } -#line 7130 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8853 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 365: -#line 2383 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 460: +#line 3023 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt, true); } -#line 7141 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8864 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 366: -#line 2389 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 461: +#line 3029 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint); } -#line 7152 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8875 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 367: -#line 2395 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 462: +#line 3035 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint, true); } -#line 7163 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8886 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 368: -#line 2401 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 463: +#line 3041 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[0].interm.type); (yyval.interm.type).qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; parseContext.structTypeCheck((yyval.interm.type).loc, (yyval.interm.type)); } -#line 7173 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8896 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 369: -#line 2406 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 464: +#line 3046 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // // This is for user defined type names. The lexical phase looked up the @@ -7187,47 +8910,47 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); } else parseContext.error((yyvsp[0].lex).loc, "expected type name", (yyvsp[0].lex).string->c_str(), ""); } -#line 7191 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8914 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 370: -#line 2422 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 465: +#line 3062 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "highp precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqHigh); } -#line 7201 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8924 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 371: -#line 2427 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 466: +#line 3067 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "mediump precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqMedium); } -#line 7211 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8934 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 372: -#line 2432 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 467: +#line 3072 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "lowp precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqLow); } -#line 7221 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8944 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 373: -#line 2440 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 468: +#line 3080 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.nestedStructCheck((yyvsp[-2].lex).loc); } -#line 7227 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8950 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 374: -#line 2440 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 469: +#line 3080 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { TType* structure = new TType((yyvsp[-1].interm.typeList), *(yyvsp[-4].lex).string); parseContext.structArrayCheck((yyvsp[-4].lex).loc, *structure); @@ -7239,17 +8962,17 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 7243 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8966 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 375: -#line 2451 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 470: +#line 3091 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.nestedStructCheck((yyvsp[-1].lex).loc); } -#line 7249 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8972 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 376: -#line 2451 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 471: +#line 3091 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { TType* structure = new TType((yyvsp[-1].interm.typeList), TString("")); (yyval.interm.type).init((yyvsp[-4].lex).loc); @@ -7257,19 +8980,19 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 7261 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8984 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 377: -#line 2461 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 472: +#line 3101 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeList) = (yyvsp[0].interm.typeList); } -#line 7269 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8992 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 378: -#line 2464 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 473: +#line 3104 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); for (unsigned int i = 0; i < (yyvsp[0].interm.typeList)->size(); ++i) { @@ -7280,11 +9003,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.typeList)->push_back((*(yyvsp[0].interm.typeList))[i]); } } -#line 7284 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9007 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 379: -#line 2477 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 474: +#line 3117 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -7299,17 +9022,20 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.precisionQualifierCheck((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).basicType, (yyvsp[-2].interm.type).qualifier); for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) { - parseContext.arrayDimCheck((yyvsp[-2].interm.type).loc, (*(yyval.interm.typeList))[i].type, (yyvsp[-2].interm.type).arraySizes); - (*(yyval.interm.typeList))[i].type->mergeType((yyvsp[-2].interm.type)); + TType type((yyvsp[-2].interm.type)); + type.setFieldName((*(yyval.interm.typeList))[i].type->getFieldName()); + type.transferArraySizes((*(yyval.interm.typeList))[i].type->getArraySizes()); + type.copyArrayInnerSizes((yyvsp[-2].interm.type).arraySizes); + parseContext.arrayOfArrayVersionCheck((*(yyval.interm.typeList))[i].loc, type.getArraySizes()); + (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 7307 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9034 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 380: -#line 2495 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 475: +#line 3139 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalQualifierFixCheck((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).qualifier); if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); parseContext.profileRequires((yyvsp[-2].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); @@ -7319,269 +9045,273 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); - parseContext.checkNoShaderLayouts((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).shaderQualifiers); + parseContext.memberQualifierCheck((yyvsp[-3].interm.type)); parseContext.voidErrorCheck((yyvsp[-2].interm.type).loc, (*(yyvsp[-1].interm.typeList))[0].type->getFieldName(), (yyvsp[-2].interm.type).basicType); parseContext.mergeQualifiers((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, (yyvsp[-3].interm.type).qualifier, true); parseContext.precisionQualifierCheck((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).basicType, (yyvsp[-2].interm.type).qualifier); for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) { - parseContext.arrayDimCheck((yyvsp[-3].interm.type).loc, (*(yyval.interm.typeList))[i].type, (yyvsp[-2].interm.type).arraySizes); - (*(yyval.interm.typeList))[i].type->mergeType((yyvsp[-2].interm.type)); + TType type((yyvsp[-2].interm.type)); + type.setFieldName((*(yyval.interm.typeList))[i].type->getFieldName()); + type.transferArraySizes((*(yyval.interm.typeList))[i].type->getArraySizes()); + type.copyArrayInnerSizes((yyvsp[-2].interm.type).arraySizes); + parseContext.arrayOfArrayVersionCheck((*(yyval.interm.typeList))[i].loc, type.getArraySizes()); + (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 7333 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9063 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 381: -#line 2519 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 476: +#line 3166 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeList) = new TTypeList; (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 7342 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9072 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 382: -#line 2523 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 477: +#line 3170 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 7350 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9080 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 383: -#line 2529 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 478: +#line 3176 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeLine).type = new TType(EbtVoid); (yyval.interm.typeLine).loc = (yyvsp[0].lex).loc; (yyval.interm.typeLine).type->setFieldName(*(yyvsp[0].lex).string); } -#line 7360 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9090 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 384: -#line 2534 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 479: +#line 3181 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.arrayDimCheck((yyvsp[-1].lex).loc, (yyvsp[0].interm).arraySizes, 0); + parseContext.arrayOfArrayVersionCheck((yyvsp[-1].lex).loc, (yyvsp[0].interm).arraySizes); (yyval.interm.typeLine).type = new TType(EbtVoid); (yyval.interm.typeLine).loc = (yyvsp[-1].lex).loc; (yyval.interm.typeLine).type->setFieldName(*(yyvsp[-1].lex).string); - (yyval.interm.typeLine).type->newArraySizes(*(yyvsp[0].interm).arraySizes); + (yyval.interm.typeLine).type->transferArraySizes((yyvsp[0].interm).arraySizes); } -#line 7373 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9103 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 385: -#line 2545 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 480: +#line 3192 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 7381 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9111 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 386: -#line 2548 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 481: +#line 3195 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { const char* initFeature = "{ } style initializers"; parseContext.requireProfile((yyvsp[-2].lex).loc, ~EEsProfile, initFeature); parseContext.profileRequires((yyvsp[-2].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); } -#line 7392 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9122 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 387: -#line 2554 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 482: +#line 3201 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { const char* initFeature = "{ } style initializers"; parseContext.requireProfile((yyvsp[-3].lex).loc, ~EEsProfile, initFeature); parseContext.profileRequires((yyvsp[-3].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 7403 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9133 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 388: -#line 2563 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 483: +#line 3210 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(0, (yyvsp[0].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)->getLoc()); } -#line 7411 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9141 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 389: -#line 2566 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 484: +#line 3213 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); } -#line 7419 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9149 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 390: -#line 2572 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 485: +#line 3219 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7425 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9155 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 391: -#line 2576 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 486: +#line 3223 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7431 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9161 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 392: -#line 2577 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 487: +#line 3224 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7437 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9167 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 393: -#line 2583 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 488: +#line 3230 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7443 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9173 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 394: -#line 2584 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 489: +#line 3231 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7449 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9179 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 395: -#line 2585 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 490: +#line 3232 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7455 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9185 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 396: -#line 2586 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 491: +#line 3233 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7461 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9191 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 397: -#line 2587 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 492: +#line 3234 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7467 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9197 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 398: -#line 2588 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 493: +#line 3235 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7473 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9203 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 399: -#line 2589 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 494: +#line 3236 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7479 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9209 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 400: -#line 2593 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 495: +#line 3240 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; } -#line 7485 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9215 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 401: -#line 2594 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 496: +#line 3241 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; } -#line 7494 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9224 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 402: -#line 2598 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 497: +#line 3245 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; } -#line 7503 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9233 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 403: -#line 2602 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 498: +#line 3249 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-2].interm.intermNode) && (yyvsp[-2].interm.intermNode)->getAsAggregate()) (yyvsp[-2].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-2].interm.intermNode); } -#line 7513 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9243 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 404: -#line 2610 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 499: +#line 3257 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7519 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9249 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 405: -#line 2611 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 500: +#line 3258 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7525 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9255 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 406: -#line 2615 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 501: +#line 3262 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { ++parseContext.controlFlowNestingLevel; } -#line 7533 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9263 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 407: -#line 2618 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 502: +#line 3265 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7542 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9272 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 408: -#line 2622 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 503: +#line 3269 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 7552 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9282 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 409: -#line 2627 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 504: +#line 3274 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7563 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9293 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 410: -#line 2636 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 505: +#line 3283 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; } -#line 7571 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9301 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 411: -#line 2639 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 506: +#line 3286 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-1].interm.intermNode) && (yyvsp[-1].interm.intermNode)->getAsAggregate()) (yyvsp[-1].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-1].interm.intermNode); } -#line 7581 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9311 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 412: -#line 2647 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 507: +#line 3294 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || @@ -7590,11 +9320,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case } } -#line 7594 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9324 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 413: -#line 2655 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 508: +#line 3302 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || (yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) { @@ -7603,59 +9333,76 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); } else (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 7607 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9337 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 414: -#line 2666 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 509: +#line 3313 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; } -#line 7613 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9343 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 415: -#line 2667 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 510: +#line 3314 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = static_cast((yyvsp[-1].interm.intermTypedNode)); } -#line 7619 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9349 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 416: -#line 2671 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 511: +#line 3318 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 9357 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 512: +#line 3321 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.handleSelectionAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 9366 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 513: +#line 3327 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-2].interm.intermTypedNode)); (yyval.interm.intermNode) = parseContext.intermediate.addSelection((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.nodePair), (yyvsp[-4].lex).loc); } -#line 7628 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9375 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 417: -#line 2678 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 514: +#line 3334 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermNode); } -#line 7637 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9384 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 418: -#line 2682 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 515: +#line 3338 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.nodePair).node1 = (yyvsp[0].interm.intermNode); (yyval.interm.nodePair).node2 = 0; } -#line 7646 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9393 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 419: -#line 2690 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 516: +#line 3346 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); parseContext.boolCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)); } -#line 7655 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9402 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 420: -#line 2694 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 517: +#line 3350 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.boolCheck((yyvsp[-2].lex).loc, (yyvsp[-3].interm.type)); @@ -7666,11 +9413,28 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); else (yyval.interm.intermTypedNode) = 0; } -#line 7670 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9417 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 421: -#line 2707 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 518: +#line 3363 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 9425 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 519: +#line 3366 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.handleSwitchAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 9434 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 520: +#line 3372 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // start new switch sequence on the switch stack ++parseContext.controlFlowNestingLevel; @@ -7679,11 +9443,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.switchLevel.push_back(parseContext.statementNestingLevel); parseContext.symbolTable.push(); } -#line 7683 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9447 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 422: -#line 2715 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 521: +#line 3380 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = parseContext.addSwitch((yyvsp[-7].lex).loc, (yyvsp[-5].interm.intermTypedNode), (yyvsp[-1].interm.intermNode) ? (yyvsp[-1].interm.intermNode)->getAsAggregate() : 0); delete parseContext.switchSequenceStack.back(); @@ -7693,27 +9457,27 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 7697 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9461 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 423: -#line 2727 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 522: +#line 3392 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; } -#line 7705 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9469 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 424: -#line 2730 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 523: +#line 3395 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7713 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9477 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 425: -#line 2736 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 524: +#line 3401 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) @@ -7726,11 +9490,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpCase, (yyvsp[-1].interm.intermTypedNode), (yyvsp[-2].lex).loc); } } -#line 7730 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9494 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 426: -#line 2748 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 525: +#line 3413 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) @@ -7740,11 +9504,28 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); else (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDefault, (yyvsp[-1].lex).loc); } -#line 7744 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9508 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 427: -#line 2760 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 526: +#line 3425 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 9516 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 527: +#line 3428 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.handleLoopAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 9525 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 528: +#line 3434 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if (! parseContext.limits.whileLoops) parseContext.error((yyvsp[-1].lex).loc, "while loops not available", "limitation", ""); @@ -7753,11 +9534,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 7757 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9538 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 428: -#line 2768 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 529: +#line 3442 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); (yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[0].interm.intermNode), (yyvsp[-2].interm.intermTypedNode), 0, true, (yyvsp[-5].lex).loc); @@ -7765,21 +9546,21 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 7769 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9550 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 429: -#line 2775 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 530: +#line 3449 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 7779 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9560 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 430: -#line 2780 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 531: +#line 3454 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if (! parseContext.limits.whileLoops) parseContext.error((yyvsp[-7].lex).loc, "do-while loops not available", "limitation", ""); @@ -7791,22 +9572,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 7795 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9576 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 431: -#line 2791 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 532: +#line 3465 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 7806 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9587 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 432: -#line 2797 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 533: +#line 3471 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[-3].interm.intermNode), (yyvsp[-5].lex).loc); @@ -7819,81 +9600,81 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 7823 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9604 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 433: -#line 2812 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 534: +#line 3486 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7831 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9612 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 434: -#line 2815 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 535: +#line 3489 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7839 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9620 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 435: -#line 2821 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 536: +#line 3495 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 7847 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9628 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 436: -#line 2824 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 537: +#line 3498 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = 0; } -#line 7855 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9636 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 437: -#line 2830 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 538: +#line 3504 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.nodePair).node1 = (yyvsp[-1].interm.intermTypedNode); (yyval.interm.nodePair).node2 = 0; } -#line 7864 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9645 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 438: -#line 2834 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 539: +#line 3508 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermTypedNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermTypedNode); } -#line 7873 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9654 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 439: -#line 2841 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 540: +#line 3515 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if (parseContext.loopNestingLevel <= 0) parseContext.error((yyvsp[-1].lex).loc, "continue statement only allowed in loops", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpContinue, (yyvsp[-1].lex).loc); } -#line 7883 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9664 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 440: -#line 2846 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 541: +#line 3520 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if (parseContext.loopNestingLevel + parseContext.switchSequenceStack.size() <= 0) parseContext.error((yyvsp[-1].lex).loc, "break statement only allowed in switch and loops", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpBreak, (yyvsp[-1].lex).loc); } -#line 7893 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9674 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 441: -#line 2851 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 542: +#line 3525 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[-1].lex).loc); if (parseContext.currentFunctionType->getBasicType() != EbtVoid) @@ -7901,83 +9682,83 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); if (parseContext.inMain) parseContext.postEntryPointReturn = true; } -#line 7905 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9686 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 442: -#line 2858 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 543: +#line 3532 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = parseContext.handleReturnValue((yyvsp[-2].lex).loc, (yyvsp[-1].interm.intermTypedNode)); } -#line 7913 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9694 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 443: -#line 2861 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 544: +#line 3535 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "discard"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpKill, (yyvsp[-1].lex).loc); } -#line 7922 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9703 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 444: -#line 2870 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 545: +#line 3544 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } -#line 7931 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9712 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 445: -#line 2874 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 546: +#line 3548 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[0].interm.intermNode) != nullptr) { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } } -#line 7942 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9723 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 446: -#line 2883 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 547: +#line 3557 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7950 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9731 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 447: -#line 2886 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 548: +#line 3560 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 7958 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9739 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 448: -#line 2889 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 549: +#line 3563 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireProfile((yyvsp[0].lex).loc, ~EEsProfile, "extraneous semicolon"); parseContext.profileRequires((yyvsp[0].lex).loc, ~EEsProfile, 460, nullptr, "extraneous semicolon"); (yyval.interm.intermNode) = nullptr; } -#line 7968 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9749 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 449: -#line 2897 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 550: +#line 3571 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyvsp[0].interm).function = parseContext.handleFunctionDeclarator((yyvsp[0].interm).loc, *(yyvsp[0].interm).function, false /* not prototype */); (yyvsp[0].interm).intermNode = parseContext.handleFunctionDefinition((yyvsp[0].interm).loc, *(yyvsp[0].interm).function); } -#line 7977 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9758 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 450: -#line 2901 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 551: +#line 3575 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // May be best done as post process phase on intermediate code if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue) @@ -7991,13 +9772,54 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); // information. This information can be queried from the parse tree (yyval.interm.intermNode)->getAsAggregate()->setOptimize(parseContext.contextPragma.optimize); (yyval.interm.intermNode)->getAsAggregate()->setDebug(parseContext.contextPragma.debug); - (yyval.interm.intermNode)->getAsAggregate()->addToPragmaTable(parseContext.contextPragma.pragmaTable); + (yyval.interm.intermNode)->getAsAggregate()->setPragmaTable(parseContext.contextPragma.pragmaTable); + } +#line 9778 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 552: +#line 3593 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.attributes) = (yyvsp[-2].interm.attributes); + parseContext.requireExtensions((yyvsp[-4].lex).loc, 1, &E_GL_EXT_control_flow_attributes, "attribute"); + } +#line 9787 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 553: +#line 3599 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.attributes) = (yyvsp[0].interm.attributes); + } +#line 9795 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 554: +#line 3602 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.attributes) = parseContext.mergeAttributes((yyvsp[-2].interm.attributes), (yyvsp[0].interm.attributes)); + } +#line 9803 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 555: +#line 3607 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[0].lex).string); + } +#line 9811 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 556: +#line 3610 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[-3].lex).string, (yyvsp[-1].interm.intermTypedNode)); } -#line 7997 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9819 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; -#line 8001 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9823 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -8225,5 +10047,5 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); #endif return yyresult; } -#line 2918 "MachineIndependent/glslang.y" /* yacc.c:1906 */ +#line 3614 "MachineIndependent/glslang.y" /* yacc.c:1906 */ diff --git a/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp.h b/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp.h index b8e78d6c..7cfb7976 100644 --- a/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp.h +++ b/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp.h @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ +/* A Bison parser, made by GNU Bison 3.0. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -47,308 +47,401 @@ extern int yydebug; { ATTRIBUTE = 258, VARYING = 259, - CONST = 260, - BOOL = 261, - FLOAT = 262, + FLOAT16_T = 260, + FLOAT = 261, + FLOAT32_T = 262, DOUBLE = 263, - INT = 264, - UINT = 265, - INT64_T = 266, - UINT64_T = 267, - INT16_T = 268, - UINT16_T = 269, - FLOAT16_T = 270, - BREAK = 271, - CONTINUE = 272, - DO = 273, - ELSE = 274, - FOR = 275, - IF = 276, - DISCARD = 277, - RETURN = 278, - SWITCH = 279, - CASE = 280, - DEFAULT = 281, - SUBROUTINE = 282, - BVEC2 = 283, - BVEC3 = 284, - BVEC4 = 285, - IVEC2 = 286, - IVEC3 = 287, - IVEC4 = 288, - I64VEC2 = 289, - I64VEC3 = 290, - I64VEC4 = 291, - UVEC2 = 292, - UVEC3 = 293, - UVEC4 = 294, - U64VEC2 = 295, - U64VEC3 = 296, - U64VEC4 = 297, - VEC2 = 298, - VEC3 = 299, - VEC4 = 300, - MAT2 = 301, - MAT3 = 302, - MAT4 = 303, - CENTROID = 304, - IN = 305, - OUT = 306, - INOUT = 307, - UNIFORM = 308, - PATCH = 309, - SAMPLE = 310, - BUFFER = 311, - SHARED = 312, - COHERENT = 313, - VOLATILE = 314, - RESTRICT = 315, - READONLY = 316, - WRITEONLY = 317, - DVEC2 = 318, - DVEC3 = 319, - DVEC4 = 320, - DMAT2 = 321, - DMAT3 = 322, - DMAT4 = 323, - F16VEC2 = 324, - F16VEC3 = 325, - F16VEC4 = 326, - F16MAT2 = 327, - F16MAT3 = 328, - F16MAT4 = 329, - I16VEC2 = 330, - I16VEC3 = 331, - I16VEC4 = 332, - U16VEC2 = 333, - U16VEC3 = 334, - U16VEC4 = 335, - NOPERSPECTIVE = 336, - FLAT = 337, - SMOOTH = 338, - LAYOUT = 339, - __EXPLICITINTERPAMD = 340, - MAT2X2 = 341, - MAT2X3 = 342, - MAT2X4 = 343, - MAT3X2 = 344, - MAT3X3 = 345, - MAT3X4 = 346, - MAT4X2 = 347, - MAT4X3 = 348, - MAT4X4 = 349, - DMAT2X2 = 350, - DMAT2X3 = 351, - DMAT2X4 = 352, - DMAT3X2 = 353, - DMAT3X3 = 354, - DMAT3X4 = 355, - DMAT4X2 = 356, - DMAT4X3 = 357, - DMAT4X4 = 358, - F16MAT2X2 = 359, - F16MAT2X3 = 360, - F16MAT2X4 = 361, - F16MAT3X2 = 362, - F16MAT3X3 = 363, - F16MAT3X4 = 364, - F16MAT4X2 = 365, - F16MAT4X3 = 366, - F16MAT4X4 = 367, - ATOMIC_UINT = 368, - SAMPLER1D = 369, - SAMPLER2D = 370, - SAMPLER3D = 371, - SAMPLERCUBE = 372, - SAMPLER1DSHADOW = 373, - SAMPLER2DSHADOW = 374, - SAMPLERCUBESHADOW = 375, - SAMPLER1DARRAY = 376, - SAMPLER2DARRAY = 377, - SAMPLER1DARRAYSHADOW = 378, - SAMPLER2DARRAYSHADOW = 379, - ISAMPLER1D = 380, - ISAMPLER2D = 381, - ISAMPLER3D = 382, - ISAMPLERCUBE = 383, - ISAMPLER1DARRAY = 384, - ISAMPLER2DARRAY = 385, - USAMPLER1D = 386, - USAMPLER2D = 387, - USAMPLER3D = 388, - USAMPLERCUBE = 389, - USAMPLER1DARRAY = 390, - USAMPLER2DARRAY = 391, - SAMPLER2DRECT = 392, - SAMPLER2DRECTSHADOW = 393, - ISAMPLER2DRECT = 394, - USAMPLER2DRECT = 395, - SAMPLERBUFFER = 396, - ISAMPLERBUFFER = 397, - USAMPLERBUFFER = 398, - SAMPLERCUBEARRAY = 399, - SAMPLERCUBEARRAYSHADOW = 400, - ISAMPLERCUBEARRAY = 401, - USAMPLERCUBEARRAY = 402, - SAMPLER2DMS = 403, - ISAMPLER2DMS = 404, - USAMPLER2DMS = 405, - SAMPLER2DMSARRAY = 406, - ISAMPLER2DMSARRAY = 407, - USAMPLER2DMSARRAY = 408, - SAMPLEREXTERNALOES = 409, - SAMPLER = 410, - SAMPLERSHADOW = 411, - TEXTURE1D = 412, - TEXTURE2D = 413, - TEXTURE3D = 414, - TEXTURECUBE = 415, - TEXTURE1DARRAY = 416, - TEXTURE2DARRAY = 417, - ITEXTURE1D = 418, - ITEXTURE2D = 419, - ITEXTURE3D = 420, - ITEXTURECUBE = 421, - ITEXTURE1DARRAY = 422, - ITEXTURE2DARRAY = 423, - UTEXTURE1D = 424, - UTEXTURE2D = 425, - UTEXTURE3D = 426, - UTEXTURECUBE = 427, - UTEXTURE1DARRAY = 428, - UTEXTURE2DARRAY = 429, - TEXTURE2DRECT = 430, - ITEXTURE2DRECT = 431, - UTEXTURE2DRECT = 432, - TEXTUREBUFFER = 433, - ITEXTUREBUFFER = 434, - UTEXTUREBUFFER = 435, - TEXTURECUBEARRAY = 436, - ITEXTURECUBEARRAY = 437, - UTEXTURECUBEARRAY = 438, - TEXTURE2DMS = 439, - ITEXTURE2DMS = 440, - UTEXTURE2DMS = 441, - TEXTURE2DMSARRAY = 442, - ITEXTURE2DMSARRAY = 443, - UTEXTURE2DMSARRAY = 444, - SUBPASSINPUT = 445, - SUBPASSINPUTMS = 446, - ISUBPASSINPUT = 447, - ISUBPASSINPUTMS = 448, - USUBPASSINPUT = 449, - USUBPASSINPUTMS = 450, - IMAGE1D = 451, - IIMAGE1D = 452, - UIMAGE1D = 453, - IMAGE2D = 454, - IIMAGE2D = 455, - UIMAGE2D = 456, - IMAGE3D = 457, - IIMAGE3D = 458, - UIMAGE3D = 459, - IMAGE2DRECT = 460, - IIMAGE2DRECT = 461, - UIMAGE2DRECT = 462, - IMAGECUBE = 463, - IIMAGECUBE = 464, - UIMAGECUBE = 465, - IMAGEBUFFER = 466, - IIMAGEBUFFER = 467, - UIMAGEBUFFER = 468, - IMAGE1DARRAY = 469, - IIMAGE1DARRAY = 470, - UIMAGE1DARRAY = 471, - IMAGE2DARRAY = 472, - IIMAGE2DARRAY = 473, - UIMAGE2DARRAY = 474, - IMAGECUBEARRAY = 475, - IIMAGECUBEARRAY = 476, - UIMAGECUBEARRAY = 477, - IMAGE2DMS = 478, - IIMAGE2DMS = 479, - UIMAGE2DMS = 480, - IMAGE2DMSARRAY = 481, - IIMAGE2DMSARRAY = 482, - UIMAGE2DMSARRAY = 483, - STRUCT = 484, - VOID = 485, - WHILE = 486, - IDENTIFIER = 487, - TYPE_NAME = 488, - FLOATCONSTANT = 489, - DOUBLECONSTANT = 490, - INTCONSTANT = 491, - UINTCONSTANT = 492, - INT64CONSTANT = 493, - UINT64CONSTANT = 494, - INT16CONSTANT = 495, - UINT16CONSTANT = 496, - BOOLCONSTANT = 497, - FLOAT16CONSTANT = 498, - LEFT_OP = 499, - RIGHT_OP = 500, - INC_OP = 501, - DEC_OP = 502, - LE_OP = 503, - GE_OP = 504, - EQ_OP = 505, - NE_OP = 506, - AND_OP = 507, - OR_OP = 508, - XOR_OP = 509, - MUL_ASSIGN = 510, - DIV_ASSIGN = 511, - ADD_ASSIGN = 512, - MOD_ASSIGN = 513, - LEFT_ASSIGN = 514, - RIGHT_ASSIGN = 515, - AND_ASSIGN = 516, - XOR_ASSIGN = 517, - OR_ASSIGN = 518, - SUB_ASSIGN = 519, - LEFT_PAREN = 520, - RIGHT_PAREN = 521, - LEFT_BRACKET = 522, - RIGHT_BRACKET = 523, - LEFT_BRACE = 524, - RIGHT_BRACE = 525, - DOT = 526, - COMMA = 527, - COLON = 528, - EQUAL = 529, - SEMICOLON = 530, - BANG = 531, - DASH = 532, - TILDE = 533, - PLUS = 534, - STAR = 535, - SLASH = 536, - PERCENT = 537, - LEFT_ANGLE = 538, - RIGHT_ANGLE = 539, - VERTICAL_BAR = 540, - CARET = 541, - AMPERSAND = 542, - QUESTION = 543, - INVARIANT = 544, - PRECISE = 545, - HIGH_PRECISION = 546, - MEDIUM_PRECISION = 547, - LOW_PRECISION = 548, - PRECISION = 549, - PACKED = 550, - RESOURCE = 551, - SUPERP = 552 + FLOAT64_T = 264, + CONST = 265, + BOOL = 266, + INT = 267, + UINT = 268, + INT64_T = 269, + UINT64_T = 270, + INT32_T = 271, + UINT32_T = 272, + INT16_T = 273, + UINT16_T = 274, + INT8_T = 275, + UINT8_T = 276, + BREAK = 277, + CONTINUE = 278, + DO = 279, + ELSE = 280, + FOR = 281, + IF = 282, + DISCARD = 283, + RETURN = 284, + SWITCH = 285, + CASE = 286, + DEFAULT = 287, + SUBROUTINE = 288, + BVEC2 = 289, + BVEC3 = 290, + BVEC4 = 291, + IVEC2 = 292, + IVEC3 = 293, + IVEC4 = 294, + UVEC2 = 295, + UVEC3 = 296, + UVEC4 = 297, + I64VEC2 = 298, + I64VEC3 = 299, + I64VEC4 = 300, + U64VEC2 = 301, + U64VEC3 = 302, + U64VEC4 = 303, + I32VEC2 = 304, + I32VEC3 = 305, + I32VEC4 = 306, + U32VEC2 = 307, + U32VEC3 = 308, + U32VEC4 = 309, + I16VEC2 = 310, + I16VEC3 = 311, + I16VEC4 = 312, + U16VEC2 = 313, + U16VEC3 = 314, + U16VEC4 = 315, + I8VEC2 = 316, + I8VEC3 = 317, + I8VEC4 = 318, + U8VEC2 = 319, + U8VEC3 = 320, + U8VEC4 = 321, + VEC2 = 322, + VEC3 = 323, + VEC4 = 324, + MAT2 = 325, + MAT3 = 326, + MAT4 = 327, + CENTROID = 328, + IN = 329, + OUT = 330, + INOUT = 331, + UNIFORM = 332, + PATCH = 333, + SAMPLE = 334, + BUFFER = 335, + SHARED = 336, + NONUNIFORM = 337, + COHERENT = 338, + VOLATILE = 339, + RESTRICT = 340, + READONLY = 341, + WRITEONLY = 342, + DVEC2 = 343, + DVEC3 = 344, + DVEC4 = 345, + DMAT2 = 346, + DMAT3 = 347, + DMAT4 = 348, + F16VEC2 = 349, + F16VEC3 = 350, + F16VEC4 = 351, + F16MAT2 = 352, + F16MAT3 = 353, + F16MAT4 = 354, + F32VEC2 = 355, + F32VEC3 = 356, + F32VEC4 = 357, + F32MAT2 = 358, + F32MAT3 = 359, + F32MAT4 = 360, + F64VEC2 = 361, + F64VEC3 = 362, + F64VEC4 = 363, + F64MAT2 = 364, + F64MAT3 = 365, + F64MAT4 = 366, + NOPERSPECTIVE = 367, + FLAT = 368, + SMOOTH = 369, + LAYOUT = 370, + __EXPLICITINTERPAMD = 371, + MAT2X2 = 372, + MAT2X3 = 373, + MAT2X4 = 374, + MAT3X2 = 375, + MAT3X3 = 376, + MAT3X4 = 377, + MAT4X2 = 378, + MAT4X3 = 379, + MAT4X4 = 380, + DMAT2X2 = 381, + DMAT2X3 = 382, + DMAT2X4 = 383, + DMAT3X2 = 384, + DMAT3X3 = 385, + DMAT3X4 = 386, + DMAT4X2 = 387, + DMAT4X3 = 388, + DMAT4X4 = 389, + F16MAT2X2 = 390, + F16MAT2X3 = 391, + F16MAT2X4 = 392, + F16MAT3X2 = 393, + F16MAT3X3 = 394, + F16MAT3X4 = 395, + F16MAT4X2 = 396, + F16MAT4X3 = 397, + F16MAT4X4 = 398, + F32MAT2X2 = 399, + F32MAT2X3 = 400, + F32MAT2X4 = 401, + F32MAT3X2 = 402, + F32MAT3X3 = 403, + F32MAT3X4 = 404, + F32MAT4X2 = 405, + F32MAT4X3 = 406, + F32MAT4X4 = 407, + F64MAT2X2 = 408, + F64MAT2X3 = 409, + F64MAT2X4 = 410, + F64MAT3X2 = 411, + F64MAT3X3 = 412, + F64MAT3X4 = 413, + F64MAT4X2 = 414, + F64MAT4X3 = 415, + F64MAT4X4 = 416, + ATOMIC_UINT = 417, + SAMPLER1D = 418, + SAMPLER2D = 419, + SAMPLER3D = 420, + SAMPLERCUBE = 421, + SAMPLER1DSHADOW = 422, + SAMPLER2DSHADOW = 423, + SAMPLERCUBESHADOW = 424, + SAMPLER1DARRAY = 425, + SAMPLER2DARRAY = 426, + SAMPLER1DARRAYSHADOW = 427, + SAMPLER2DARRAYSHADOW = 428, + ISAMPLER1D = 429, + ISAMPLER2D = 430, + ISAMPLER3D = 431, + ISAMPLERCUBE = 432, + ISAMPLER1DARRAY = 433, + ISAMPLER2DARRAY = 434, + USAMPLER1D = 435, + USAMPLER2D = 436, + USAMPLER3D = 437, + USAMPLERCUBE = 438, + USAMPLER1DARRAY = 439, + USAMPLER2DARRAY = 440, + SAMPLER2DRECT = 441, + SAMPLER2DRECTSHADOW = 442, + ISAMPLER2DRECT = 443, + USAMPLER2DRECT = 444, + SAMPLERBUFFER = 445, + ISAMPLERBUFFER = 446, + USAMPLERBUFFER = 447, + SAMPLERCUBEARRAY = 448, + SAMPLERCUBEARRAYSHADOW = 449, + ISAMPLERCUBEARRAY = 450, + USAMPLERCUBEARRAY = 451, + SAMPLER2DMS = 452, + ISAMPLER2DMS = 453, + USAMPLER2DMS = 454, + SAMPLER2DMSARRAY = 455, + ISAMPLER2DMSARRAY = 456, + USAMPLER2DMSARRAY = 457, + SAMPLEREXTERNALOES = 458, + F16SAMPLER1D = 459, + F16SAMPLER2D = 460, + F16SAMPLER3D = 461, + F16SAMPLER2DRECT = 462, + F16SAMPLERCUBE = 463, + F16SAMPLER1DARRAY = 464, + F16SAMPLER2DARRAY = 465, + F16SAMPLERCUBEARRAY = 466, + F16SAMPLERBUFFER = 467, + F16SAMPLER2DMS = 468, + F16SAMPLER2DMSARRAY = 469, + F16SAMPLER1DSHADOW = 470, + F16SAMPLER2DSHADOW = 471, + F16SAMPLER1DARRAYSHADOW = 472, + F16SAMPLER2DARRAYSHADOW = 473, + F16SAMPLER2DRECTSHADOW = 474, + F16SAMPLERCUBESHADOW = 475, + F16SAMPLERCUBEARRAYSHADOW = 476, + SAMPLER = 477, + SAMPLERSHADOW = 478, + TEXTURE1D = 479, + TEXTURE2D = 480, + TEXTURE3D = 481, + TEXTURECUBE = 482, + TEXTURE1DARRAY = 483, + TEXTURE2DARRAY = 484, + ITEXTURE1D = 485, + ITEXTURE2D = 486, + ITEXTURE3D = 487, + ITEXTURECUBE = 488, + ITEXTURE1DARRAY = 489, + ITEXTURE2DARRAY = 490, + UTEXTURE1D = 491, + UTEXTURE2D = 492, + UTEXTURE3D = 493, + UTEXTURECUBE = 494, + UTEXTURE1DARRAY = 495, + UTEXTURE2DARRAY = 496, + TEXTURE2DRECT = 497, + ITEXTURE2DRECT = 498, + UTEXTURE2DRECT = 499, + TEXTUREBUFFER = 500, + ITEXTUREBUFFER = 501, + UTEXTUREBUFFER = 502, + TEXTURECUBEARRAY = 503, + ITEXTURECUBEARRAY = 504, + UTEXTURECUBEARRAY = 505, + TEXTURE2DMS = 506, + ITEXTURE2DMS = 507, + UTEXTURE2DMS = 508, + TEXTURE2DMSARRAY = 509, + ITEXTURE2DMSARRAY = 510, + UTEXTURE2DMSARRAY = 511, + F16TEXTURE1D = 512, + F16TEXTURE2D = 513, + F16TEXTURE3D = 514, + F16TEXTURE2DRECT = 515, + F16TEXTURECUBE = 516, + F16TEXTURE1DARRAY = 517, + F16TEXTURE2DARRAY = 518, + F16TEXTURECUBEARRAY = 519, + F16TEXTUREBUFFER = 520, + F16TEXTURE2DMS = 521, + F16TEXTURE2DMSARRAY = 522, + SUBPASSINPUT = 523, + SUBPASSINPUTMS = 524, + ISUBPASSINPUT = 525, + ISUBPASSINPUTMS = 526, + USUBPASSINPUT = 527, + USUBPASSINPUTMS = 528, + F16SUBPASSINPUT = 529, + F16SUBPASSINPUTMS = 530, + IMAGE1D = 531, + IIMAGE1D = 532, + UIMAGE1D = 533, + IMAGE2D = 534, + IIMAGE2D = 535, + UIMAGE2D = 536, + IMAGE3D = 537, + IIMAGE3D = 538, + UIMAGE3D = 539, + IMAGE2DRECT = 540, + IIMAGE2DRECT = 541, + UIMAGE2DRECT = 542, + IMAGECUBE = 543, + IIMAGECUBE = 544, + UIMAGECUBE = 545, + IMAGEBUFFER = 546, + IIMAGEBUFFER = 547, + UIMAGEBUFFER = 548, + IMAGE1DARRAY = 549, + IIMAGE1DARRAY = 550, + UIMAGE1DARRAY = 551, + IMAGE2DARRAY = 552, + IIMAGE2DARRAY = 553, + UIMAGE2DARRAY = 554, + IMAGECUBEARRAY = 555, + IIMAGECUBEARRAY = 556, + UIMAGECUBEARRAY = 557, + IMAGE2DMS = 558, + IIMAGE2DMS = 559, + UIMAGE2DMS = 560, + IMAGE2DMSARRAY = 561, + IIMAGE2DMSARRAY = 562, + UIMAGE2DMSARRAY = 563, + F16IMAGE1D = 564, + F16IMAGE2D = 565, + F16IMAGE3D = 566, + F16IMAGE2DRECT = 567, + F16IMAGECUBE = 568, + F16IMAGE1DARRAY = 569, + F16IMAGE2DARRAY = 570, + F16IMAGECUBEARRAY = 571, + F16IMAGEBUFFER = 572, + F16IMAGE2DMS = 573, + F16IMAGE2DMSARRAY = 574, + STRUCT = 575, + VOID = 576, + WHILE = 577, + IDENTIFIER = 578, + TYPE_NAME = 579, + FLOATCONSTANT = 580, + DOUBLECONSTANT = 581, + INT16CONSTANT = 582, + UINT16CONSTANT = 583, + INT32CONSTANT = 584, + UINT32CONSTANT = 585, + INTCONSTANT = 586, + UINTCONSTANT = 587, + INT64CONSTANT = 588, + UINT64CONSTANT = 589, + BOOLCONSTANT = 590, + FLOAT16CONSTANT = 591, + LEFT_OP = 592, + RIGHT_OP = 593, + INC_OP = 594, + DEC_OP = 595, + LE_OP = 596, + GE_OP = 597, + EQ_OP = 598, + NE_OP = 599, + AND_OP = 600, + OR_OP = 601, + XOR_OP = 602, + MUL_ASSIGN = 603, + DIV_ASSIGN = 604, + ADD_ASSIGN = 605, + MOD_ASSIGN = 606, + LEFT_ASSIGN = 607, + RIGHT_ASSIGN = 608, + AND_ASSIGN = 609, + XOR_ASSIGN = 610, + OR_ASSIGN = 611, + SUB_ASSIGN = 612, + LEFT_PAREN = 613, + RIGHT_PAREN = 614, + LEFT_BRACKET = 615, + RIGHT_BRACKET = 616, + LEFT_BRACE = 617, + RIGHT_BRACE = 618, + DOT = 619, + COMMA = 620, + COLON = 621, + EQUAL = 622, + SEMICOLON = 623, + BANG = 624, + DASH = 625, + TILDE = 626, + PLUS = 627, + STAR = 628, + SLASH = 629, + PERCENT = 630, + LEFT_ANGLE = 631, + RIGHT_ANGLE = 632, + VERTICAL_BAR = 633, + CARET = 634, + AMPERSAND = 635, + QUESTION = 636, + INVARIANT = 637, + PRECISE = 638, + HIGH_PRECISION = 639, + MEDIUM_PRECISION = 640, + LOW_PRECISION = 641, + PRECISION = 642, + PACKED = 643, + RESOURCE = 644, + SUPERP = 645 }; #endif /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - +typedef union YYSTYPE YYSTYPE; union YYSTYPE { -#line 68 "MachineIndependent/glslang.y" /* yacc.c:1909 */ +#line 70 "MachineIndependent/glslang.y" /* yacc.c:1909 */ struct { glslang::TSourceLoc loc; @@ -370,6 +463,7 @@ union YYSTYPE TIntermNode* intermNode; glslang::TIntermNodePair nodePair; glslang::TIntermTyped* intermTypedNode; + glslang::TAttributes* attributes; }; union { glslang::TPublicType type; @@ -382,10 +476,8 @@ union YYSTYPE }; } interm; -#line 386 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */ +#line 480 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */ }; - -typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif diff --git a/deps/glslang/glslang/MachineIndependent/intermOut.cpp b/deps/glslang/glslang/MachineIndependent/intermOut.cpp index 30240fcc..4d6ad040 100644 --- a/deps/glslang/glslang/MachineIndependent/intermOut.cpp +++ b/deps/glslang/glslang/MachineIndependent/intermOut.cpp @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2016 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -196,6 +197,7 @@ bool TOutputTraverser::visitBinary(TVisit /* visit */, TIntermBinary* node) case EOpLogicalOr: out.debug << "logical-or"; break; case EOpLogicalXor: out.debug << "logical-xor"; break; case EOpLogicalAnd: out.debug << "logical-and"; break; + default: out.debug << ""; } @@ -223,48 +225,192 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpPreIncrement: out.debug << "Pre-Increment"; break; case EOpPreDecrement: out.debug << "Pre-Decrement"; break; + // * -> bool + case EOpConvInt8ToBool: out.debug << "Convert int8_t to bool"; break; + case EOpConvUint8ToBool: out.debug << "Convert uint8_t to bool"; break; + case EOpConvInt16ToBool: out.debug << "Convert int16_t to bool"; break; + case EOpConvUint16ToBool: out.debug << "Convert uint16_t to bool";break; case EOpConvIntToBool: out.debug << "Convert int to bool"; break; case EOpConvUintToBool: out.debug << "Convert uint to bool"; break; - case EOpConvFloatToBool: out.debug << "Convert float to bool"; break; - case EOpConvDoubleToBool: out.debug << "Convert double to bool"; break; case EOpConvInt64ToBool: out.debug << "Convert int64 to bool"; break; case EOpConvUint64ToBool: out.debug << "Convert uint64 to bool"; break; - case EOpConvIntToFloat: out.debug << "Convert int to float"; break; - case EOpConvUintToFloat: out.debug << "Convert uint to float"; break; - case EOpConvDoubleToFloat: out.debug << "Convert double to float"; break; - case EOpConvInt64ToFloat: out.debug << "Convert int64 to float"; break; - case EOpConvUint64ToFloat: out.debug << "Convert uint64 to float"; break; - case EOpConvBoolToFloat: out.debug << "Convert bool to float"; break; - case EOpConvUintToInt: out.debug << "Convert uint to int"; break; - case EOpConvFloatToInt: out.debug << "Convert float to int"; break; - case EOpConvDoubleToInt: out.debug << "Convert double to int"; break; - case EOpConvBoolToInt: out.debug << "Convert bool to int"; break; - case EOpConvInt64ToInt: out.debug << "Convert int64 to int"; break; - case EOpConvUint64ToInt: out.debug << "Convert uint64 to int"; break; - case EOpConvIntToUint: out.debug << "Convert int to uint"; break; - case EOpConvFloatToUint: out.debug << "Convert float to uint"; break; - case EOpConvDoubleToUint: out.debug << "Convert double to uint"; break; + case EOpConvFloat16ToBool: out.debug << "Convert float16_t to bool"; break; + case EOpConvFloatToBool: out.debug << "Convert float to bool"; break; + case EOpConvDoubleToBool: out.debug << "Convert double to bool"; break; + + // bool -> * + case EOpConvBoolToInt8: out.debug << "Convert bool to int8_t"; break; + case EOpConvBoolToUint8: out.debug << "Convert bool to uint8_t"; break; + case EOpConvBoolToInt16: out.debug << "Convert bool to in16t_t"; break; + case EOpConvBoolToUint16: out.debug << "Convert bool to uint16_t";break; + case EOpConvBoolToInt: out.debug << "Convert bool to int" ; break; case EOpConvBoolToUint: out.debug << "Convert bool to uint"; break; - case EOpConvInt64ToUint: out.debug << "Convert int64 to uint"; break; - case EOpConvUint64ToUint: out.debug << "Convert uint64 to uint"; break; + case EOpConvBoolToInt64: out.debug << "Convert bool to int64"; break; + case EOpConvBoolToUint64: out.debug << "Convert bool to uint64";break; + case EOpConvBoolToFloat16: out.debug << "Convert bool to float16_t"; break; + case EOpConvBoolToFloat: out.debug << "Convert bool to float"; break; + case EOpConvBoolToDouble: out.debug << "Convert bool to double"; break; + + // int8_t -> (u)int* + case EOpConvInt8ToInt16: out.debug << "Convert int8_t to int16_t";break; + case EOpConvInt8ToInt: out.debug << "Convert int8_t to int"; break; + case EOpConvInt8ToInt64: out.debug << "Convert int8_t to int64"; break; + case EOpConvInt8ToUint8: out.debug << "Convert int8_t to uint8_t";break; + case EOpConvInt8ToUint16: out.debug << "Convert int8_t to uint16_t";break; + case EOpConvInt8ToUint: out.debug << "Convert int8_t to uint"; break; + case EOpConvInt8ToUint64: out.debug << "Convert int8_t to uint64"; break; + + // uint8_t -> (u)int* + case EOpConvUint8ToInt8: out.debug << "Convert uint8_t to int8_t";break; + case EOpConvUint8ToInt16: out.debug << "Convert uint8_t to int16_t";break; + case EOpConvUint8ToInt: out.debug << "Convert uint8_t to int"; break; + case EOpConvUint8ToInt64: out.debug << "Convert uint8_t to int64"; break; + case EOpConvUint8ToUint16: out.debug << "Convert uint8_t to uint16_t";break; + case EOpConvUint8ToUint: out.debug << "Convert uint8_t to uint"; break; + case EOpConvUint8ToUint64: out.debug << "Convert uint8_t to uint64"; break; + + // int8_t -> float* + case EOpConvInt8ToFloat16: out.debug << "Convert int8_t to float16_t";break; + case EOpConvInt8ToFloat: out.debug << "Convert int8_t to float"; break; + case EOpConvInt8ToDouble: out.debug << "Convert int8_t to double"; break; + + // uint8_t -> float* + case EOpConvUint8ToFloat16: out.debug << "Convert uint8_t to float16_t";break; + case EOpConvUint8ToFloat: out.debug << "Convert uint8_t to float"; break; + case EOpConvUint8ToDouble: out.debug << "Convert uint8_t to double"; break; + + // int16_t -> (u)int* + case EOpConvInt16ToInt8: out.debug << "Convert int16_t to int8_t";break; + case EOpConvInt16ToInt: out.debug << "Convert int16_t to int"; break; + case EOpConvInt16ToInt64: out.debug << "Convert int16_t to int64"; break; + case EOpConvInt16ToUint8: out.debug << "Convert int16_t to uint8_t";break; + case EOpConvInt16ToUint16: out.debug << "Convert int16_t to uint16_t";break; + case EOpConvInt16ToUint: out.debug << "Convert int16_t to uint"; break; + case EOpConvInt16ToUint64: out.debug << "Convert int16_t to uint64"; break; + + // int16_t -> float* + case EOpConvInt16ToFloat16: out.debug << "Convert int16_t to float16_t";break; + case EOpConvInt16ToFloat: out.debug << "Convert int16_t to float"; break; + case EOpConvInt16ToDouble: out.debug << "Convert int16_t to double"; break; + + // uint16_t -> (u)int* + case EOpConvUint16ToInt8: out.debug << "Convert uint16_t to int8_t";break; + case EOpConvUint16ToInt16: out.debug << "Convert uint16_t to int16_t";break; + case EOpConvUint16ToInt: out.debug << "Convert uint16_t to int"; break; + case EOpConvUint16ToInt64: out.debug << "Convert uint16_t to int64"; break; + case EOpConvUint16ToUint8: out.debug << "Convert uint16_t to uint8_t";break; + case EOpConvUint16ToUint: out.debug << "Convert uint16_t to uint"; break; + case EOpConvUint16ToUint64: out.debug << "Convert uint16_t to uint64"; break; + + // uint16_t -> float* + case EOpConvUint16ToFloat16: out.debug << "Convert uint16_t to float16_t";break; + case EOpConvUint16ToFloat: out.debug << "Convert uint16_t to float"; break; + case EOpConvUint16ToDouble: out.debug << "Convert uint16_t to double"; break; + + // int32_t -> (u)int* + case EOpConvIntToInt8: out.debug << "Convert int to int8_t";break; + case EOpConvIntToInt16: out.debug << "Convert int to int16_t";break; + case EOpConvIntToInt64: out.debug << "Convert int to int64"; break; + case EOpConvIntToUint8: out.debug << "Convert int to uint8_t";break; + case EOpConvIntToUint16: out.debug << "Convert int to uint16_t";break; + case EOpConvIntToUint: out.debug << "Convert int to uint"; break; + case EOpConvIntToUint64: out.debug << "Convert int to uint64"; break; + + // int32_t -> float* + case EOpConvIntToFloat16: out.debug << "Convert int to float16_t";break; + case EOpConvIntToFloat: out.debug << "Convert int to float"; break; case EOpConvIntToDouble: out.debug << "Convert int to double"; break; - case EOpConvUintToDouble: out.debug << "Convert uint to double"; break; - case EOpConvFloatToDouble: out.debug << "Convert float to double"; break; - case EOpConvBoolToDouble: out.debug << "Convert bool to double"; break; - case EOpConvInt64ToDouble: out.debug << "Convert int64 to double"; break; - case EOpConvUint64ToDouble: out.debug << "Convert uint64 to double"; break; - case EOpConvBoolToInt64: out.debug << "Convert bool to int64"; break; - case EOpConvIntToInt64: out.debug << "Convert int to int64"; break; + + // uint32_t -> (u)int* + case EOpConvUintToInt8: out.debug << "Convert uint to int8_t";break; + case EOpConvUintToInt16: out.debug << "Convert uint to int16_t";break; + case EOpConvUintToInt: out.debug << "Convert uint to int";break; case EOpConvUintToInt64: out.debug << "Convert uint to int64"; break; - case EOpConvFloatToInt64: out.debug << "Convert float to int64"; break; - case EOpConvDoubleToInt64: out.debug << "Convert double to int64"; break; - case EOpConvUint64ToInt64: out.debug << "Convert uint64 to int64"; break; - case EOpConvBoolToUint64: out.debug << "Convert bool to uint64"; break; - case EOpConvIntToUint64: out.debug << "Convert int to uint64"; break; - case EOpConvUintToUint64: out.debug << "Convert uint to uint64"; break; + case EOpConvUintToUint8: out.debug << "Convert uint to uint8_t";break; + case EOpConvUintToUint16: out.debug << "Convert uint to uint16_t";break; + case EOpConvUintToUint64: out.debug << "Convert uint to uint64"; break; + + // uint32_t -> float* + case EOpConvUintToFloat16: out.debug << "Convert uint to float16_t";break; + case EOpConvUintToFloat: out.debug << "Convert uint to float"; break; + case EOpConvUintToDouble: out.debug << "Convert uint to double"; break; + + // int64 -> (u)int* + case EOpConvInt64ToInt8: out.debug << "Convert int64 to int8_t"; break; + case EOpConvInt64ToInt16: out.debug << "Convert int64 to int16_t"; break; + case EOpConvInt64ToInt: out.debug << "Convert int64 to int"; break; + case EOpConvInt64ToUint8: out.debug << "Convert int64 to uint8_t";break; + case EOpConvInt64ToUint16: out.debug << "Convert int64 to uint16_t";break; + case EOpConvInt64ToUint: out.debug << "Convert int64 to uint"; break; + case EOpConvInt64ToUint64: out.debug << "Convert int64 to uint64"; break; + + // int64 -> float* + case EOpConvInt64ToFloat16: out.debug << "Convert int64 to float16_t";break; + case EOpConvInt64ToFloat: out.debug << "Convert int64 to float"; break; + case EOpConvInt64ToDouble: out.debug << "Convert int64 to double"; break; + + // uint64 -> (u)int* + case EOpConvUint64ToInt8: out.debug << "Convert uint64 to int8_t";break; + case EOpConvUint64ToInt16: out.debug << "Convert uint64 to int16_t";break; + case EOpConvUint64ToInt: out.debug << "Convert uint64 to int"; break; + case EOpConvUint64ToInt64: out.debug << "Convert uint64 to int64"; break; + case EOpConvUint64ToUint8: out.debug << "Convert uint64 to uint8_t";break; + case EOpConvUint64ToUint16: out.debug << "Convert uint64 to uint16"; break; + case EOpConvUint64ToUint: out.debug << "Convert uint64 to uint"; break; + + // uint64 -> float* + case EOpConvUint64ToFloat16: out.debug << "Convert uint64 to float16_t";break; + case EOpConvUint64ToFloat: out.debug << "Convert uint64 to float"; break; + case EOpConvUint64ToDouble: out.debug << "Convert uint64 to double"; break; + + // float16_t -> int* + case EOpConvFloat16ToInt8: out.debug << "Convert float16_t to int8_t"; break; + case EOpConvFloat16ToInt16: out.debug << "Convert float16_t to int16_t"; break; + case EOpConvFloat16ToInt: out.debug << "Convert float16_t to int"; break; + case EOpConvFloat16ToInt64: out.debug << "Convert float16_t to int64"; break; + + // float16_t -> uint* + case EOpConvFloat16ToUint8: out.debug << "Convert float16_t to uint8_t"; break; + case EOpConvFloat16ToUint16: out.debug << "Convert float16_t to uint16_t"; break; + case EOpConvFloat16ToUint: out.debug << "Convert float16_t to uint"; break; + case EOpConvFloat16ToUint64: out.debug << "Convert float16_t to uint64"; break; + + // float16_t -> float* + case EOpConvFloat16ToFloat: out.debug << "Convert float16_t to float"; break; + case EOpConvFloat16ToDouble: out.debug << "Convert float16_t to double"; break; + + // float32 -> float* + case EOpConvFloatToFloat16: out.debug << "Convert float to float16_t"; break; + case EOpConvFloatToDouble: out.debug << "Convert float to double"; break; + + // float32_t -> int* + case EOpConvFloatToInt8: out.debug << "Convert float to int8_t"; break; + case EOpConvFloatToInt16: out.debug << "Convert float to int16_t"; break; + case EOpConvFloatToInt: out.debug << "Convert float to int"; break; + case EOpConvFloatToInt64: out.debug << "Convert float to int64"; break; + + // float32_t -> uint* + case EOpConvFloatToUint8: out.debug << "Convert float to uint8_t"; break; + case EOpConvFloatToUint16: out.debug << "Convert float to uint16_t"; break; + case EOpConvFloatToUint: out.debug << "Convert float to uint"; break; case EOpConvFloatToUint64: out.debug << "Convert float to uint64"; break; + + // double -> float* + case EOpConvDoubleToFloat16: out.debug << "Convert double to float16_t"; break; + case EOpConvDoubleToFloat: out.debug << "Convert double to float"; break; + + // double -> int* + case EOpConvDoubleToInt8: out.debug << "Convert double to int8_t"; break; + case EOpConvDoubleToInt16: out.debug << "Convert double to int16_t"; break; + case EOpConvDoubleToInt: out.debug << "Convert double to int"; break; + case EOpConvDoubleToInt64: out.debug << "Convert double to int64"; break; + + // float32_t -> uint* + case EOpConvDoubleToUint8: out.debug << "Convert double to uint8_t"; break; + case EOpConvDoubleToUint16: out.debug << "Convert double to uint16_t"; break; + case EOpConvDoubleToUint: out.debug << "Convert double to uint"; break; case EOpConvDoubleToUint64: out.debug << "Convert double to uint64"; break; - case EOpConvInt64ToUint64: out.debug << "Convert uint64 to uint64"; break; + case EOpRadians: out.debug << "radians"; break; case EOpDegrees: out.debug << "degrees"; break; @@ -308,12 +454,10 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpDoubleBitsToUint64: out.debug << "doubleBitsToUint64"; break; case EOpInt64BitsToDouble: out.debug << "int64BitsToDouble"; break; case EOpUint64BitsToDouble: out.debug << "uint64BitsToDouble"; break; -#ifdef AMD_EXTENSIONS case EOpFloat16BitsToInt16: out.debug << "float16BitsToInt16"; break; case EOpFloat16BitsToUint16: out.debug << "float16BitsToUint16"; break; case EOpInt16BitsToFloat16: out.debug << "int16BitsToFloat16"; break; case EOpUint16BitsToFloat16: out.debug << "uint16BitsToFloat16"; break; -#endif case EOpPackSnorm2x16: out.debug << "packSnorm2x16"; break; case EOpUnpackSnorm2x16:out.debug << "unpackSnorm2x16"; break; @@ -321,6 +465,12 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpUnpackUnorm2x16:out.debug << "unpackUnorm2x16"; break; case EOpPackHalf2x16: out.debug << "packHalf2x16"; break; case EOpUnpackHalf2x16: out.debug << "unpackHalf2x16"; break; + case EOpPack16: out.debug << "pack16"; break; + case EOpPack32: out.debug << "pack32"; break; + case EOpPack64: out.debug << "pack64"; break; + case EOpUnpack32: out.debug << "unpack32"; break; + case EOpUnpack16: out.debug << "unpack16"; break; + case EOpUnpack8: out.debug << "unpack8"; break; case EOpPackSnorm4x8: out.debug << "PackSnorm4x8"; break; case EOpUnpackSnorm4x8: out.debug << "UnpackSnorm4x8"; break; @@ -334,7 +484,6 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpPackUint2x32: out.debug << "packUint2x32"; break; case EOpUnpackUint2x32: out.debug << "unpackUint2x32"; break; -#ifdef AMD_EXTENSIONS case EOpPackInt2x16: out.debug << "packInt2x16"; break; case EOpUnpackInt2x16: out.debug << "unpackInt2x16"; break; case EOpPackUint2x16: out.debug << "packUint2x16"; break; @@ -344,10 +493,8 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpUnpackInt4x16: out.debug << "unpackInt4x16"; break; case EOpPackUint4x16: out.debug << "packUint4x16"; break; case EOpUnpackUint4x16: out.debug << "unpackUint4x16"; break; - case EOpPackFloat2x16: out.debug << "packFloat2x16"; break; case EOpUnpackFloat2x16: out.debug << "unpackFloat2x16"; break; -#endif case EOpLength: out.debug << "length"; break; case EOpNormalize: out.debug << "normalize"; break; @@ -401,6 +548,82 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpAllInvocations: out.debug << "allInvocations"; break; case EOpAllInvocationsEqual: out.debug << "allInvocationsEqual"; break; + case EOpSubgroupElect: out.debug << "subgroupElect"; break; + case EOpSubgroupAll: out.debug << "subgroupAll"; break; + case EOpSubgroupAny: out.debug << "subgroupAny"; break; + case EOpSubgroupAllEqual: out.debug << "subgroupAllEqual"; break; + case EOpSubgroupBroadcast: out.debug << "subgroupBroadcast"; break; + case EOpSubgroupBroadcastFirst: out.debug << "subgroupBroadcastFirst"; break; + case EOpSubgroupBallot: out.debug << "subgroupBallot"; break; + case EOpSubgroupInverseBallot: out.debug << "subgroupInverseBallot"; break; + case EOpSubgroupBallotBitExtract: out.debug << "subgroupBallotBitExtract"; break; + case EOpSubgroupBallotBitCount: out.debug << "subgroupBallotBitCount"; break; + case EOpSubgroupBallotInclusiveBitCount: out.debug << "subgroupBallotInclusiveBitCount"; break; + case EOpSubgroupBallotExclusiveBitCount: out.debug << "subgroupBallotExclusiveBitCount"; break; + case EOpSubgroupBallotFindLSB: out.debug << "subgroupBallotFindLSB"; break; + case EOpSubgroupBallotFindMSB: out.debug << "subgroupBallotFindMSB"; break; + case EOpSubgroupShuffle: out.debug << "subgroupShuffle"; break; + case EOpSubgroupShuffleXor: out.debug << "subgroupShuffleXor"; break; + case EOpSubgroupShuffleUp: out.debug << "subgroupShuffleUp"; break; + case EOpSubgroupShuffleDown: out.debug << "subgroupShuffleDown"; break; + case EOpSubgroupAdd: out.debug << "subgroupAdd"; break; + case EOpSubgroupMul: out.debug << "subgroupMul"; break; + case EOpSubgroupMin: out.debug << "subgroupMin"; break; + case EOpSubgroupMax: out.debug << "subgroupMax"; break; + case EOpSubgroupAnd: out.debug << "subgroupAnd"; break; + case EOpSubgroupOr: out.debug << "subgroupOr"; break; + case EOpSubgroupXor: out.debug << "subgroupXor"; break; + case EOpSubgroupInclusiveAdd: out.debug << "subgroupInclusiveAdd"; break; + case EOpSubgroupInclusiveMul: out.debug << "subgroupInclusiveMul"; break; + case EOpSubgroupInclusiveMin: out.debug << "subgroupInclusiveMin"; break; + case EOpSubgroupInclusiveMax: out.debug << "subgroupInclusiveMax"; break; + case EOpSubgroupInclusiveAnd: out.debug << "subgroupInclusiveAnd"; break; + case EOpSubgroupInclusiveOr: out.debug << "subgroupInclusiveOr"; break; + case EOpSubgroupInclusiveXor: out.debug << "subgroupInclusiveXor"; break; + case EOpSubgroupExclusiveAdd: out.debug << "subgroupExclusiveAdd"; break; + case EOpSubgroupExclusiveMul: out.debug << "subgroupExclusiveMul"; break; + case EOpSubgroupExclusiveMin: out.debug << "subgroupExclusiveMin"; break; + case EOpSubgroupExclusiveMax: out.debug << "subgroupExclusiveMax"; break; + case EOpSubgroupExclusiveAnd: out.debug << "subgroupExclusiveAnd"; break; + case EOpSubgroupExclusiveOr: out.debug << "subgroupExclusiveOr"; break; + case EOpSubgroupExclusiveXor: out.debug << "subgroupExclusiveXor"; break; + case EOpSubgroupClusteredAdd: out.debug << "subgroupClusteredAdd"; break; + case EOpSubgroupClusteredMul: out.debug << "subgroupClusteredMul"; break; + case EOpSubgroupClusteredMin: out.debug << "subgroupClusteredMin"; break; + case EOpSubgroupClusteredMax: out.debug << "subgroupClusteredMax"; break; + case EOpSubgroupClusteredAnd: out.debug << "subgroupClusteredAnd"; break; + case EOpSubgroupClusteredOr: out.debug << "subgroupClusteredOr"; break; + case EOpSubgroupClusteredXor: out.debug << "subgroupClusteredXor"; break; + case EOpSubgroupQuadBroadcast: out.debug << "subgroupQuadBroadcast"; break; + case EOpSubgroupQuadSwapHorizontal: out.debug << "subgroupQuadSwapHorizontal"; break; + case EOpSubgroupQuadSwapVertical: out.debug << "subgroupQuadSwapVertical"; break; + case EOpSubgroupQuadSwapDiagonal: out.debug << "subgroupQuadSwapDiagonal"; break; + +#ifdef NV_EXTENSIONS + case EOpSubgroupPartition: out.debug << "subgroupPartitionNV"; break; + case EOpSubgroupPartitionedAdd: out.debug << "subgroupPartitionedAddNV"; break; + case EOpSubgroupPartitionedMul: out.debug << "subgroupPartitionedMulNV"; break; + case EOpSubgroupPartitionedMin: out.debug << "subgroupPartitionedMinNV"; break; + case EOpSubgroupPartitionedMax: out.debug << "subgroupPartitionedMaxNV"; break; + case EOpSubgroupPartitionedAnd: out.debug << "subgroupPartitionedAndNV"; break; + case EOpSubgroupPartitionedOr: out.debug << "subgroupPartitionedOrNV"; break; + case EOpSubgroupPartitionedXor: out.debug << "subgroupPartitionedXorNV"; break; + case EOpSubgroupPartitionedInclusiveAdd: out.debug << "subgroupPartitionedInclusiveAddNV"; break; + case EOpSubgroupPartitionedInclusiveMul: out.debug << "subgroupPartitionedInclusiveMulNV"; break; + case EOpSubgroupPartitionedInclusiveMin: out.debug << "subgroupPartitionedInclusiveMinNV"; break; + case EOpSubgroupPartitionedInclusiveMax: out.debug << "subgroupPartitionedInclusiveMaxNV"; break; + case EOpSubgroupPartitionedInclusiveAnd: out.debug << "subgroupPartitionedInclusiveAndNV"; break; + case EOpSubgroupPartitionedInclusiveOr: out.debug << "subgroupPartitionedInclusiveOrNV"; break; + case EOpSubgroupPartitionedInclusiveXor: out.debug << "subgroupPartitionedInclusiveXorNV"; break; + case EOpSubgroupPartitionedExclusiveAdd: out.debug << "subgroupPartitionedExclusiveAddNV"; break; + case EOpSubgroupPartitionedExclusiveMul: out.debug << "subgroupPartitionedExclusiveMulNV"; break; + case EOpSubgroupPartitionedExclusiveMin: out.debug << "subgroupPartitionedExclusiveMinNV"; break; + case EOpSubgroupPartitionedExclusiveMax: out.debug << "subgroupPartitionedExclusiveMaxNV"; break; + case EOpSubgroupPartitionedExclusiveAnd: out.debug << "subgroupPartitionedExclusiveAndNV"; break; + case EOpSubgroupPartitionedExclusiveOr: out.debug << "subgroupPartitionedExclusiveOrNV"; break; + case EOpSubgroupPartitionedExclusiveXor: out.debug << "subgroupPartitionedExclusiveXorNV"; break; +#endif + case EOpClip: out.debug << "clip"; break; case EOpIsFinite: out.debug << "isfinite"; break; case EOpLog10: out.debug << "log10"; break; @@ -431,63 +654,18 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpMaxInvocationsExclusiveScanNonUniform: out.debug << "maxInvocationsExclusiveScanNonUniform"; break; case EOpAddInvocationsExclusiveScanNonUniform: out.debug << "addInvocationsExclusiveScanNonUniform"; break; - case EOpMbcnt: out.debug << "mbcnt"; break; - - case EOpCubeFaceIndex: out.debug << "cubeFaceIndex"; break; - case EOpCubeFaceCoord: out.debug << "cubeFaceCoord"; break; - - case EOpConvBoolToFloat16: out.debug << "Convert bool to float16"; break; - case EOpConvIntToFloat16: out.debug << "Convert int to float16"; break; - case EOpConvUintToFloat16: out.debug << "Convert uint to float16"; break; - case EOpConvFloatToFloat16: out.debug << "Convert float to float16"; break; - case EOpConvDoubleToFloat16: out.debug << "Convert double to float16"; break; - case EOpConvInt64ToFloat16: out.debug << "Convert int64 to float16"; break; - case EOpConvUint64ToFloat16: out.debug << "Convert uint64 to float16"; break; - case EOpConvFloat16ToBool: out.debug << "Convert float16 to bool"; break; - case EOpConvFloat16ToInt: out.debug << "Convert float16 to int"; break; - case EOpConvFloat16ToUint: out.debug << "Convert float16 to uint"; break; - case EOpConvFloat16ToFloat: out.debug << "Convert float16 to float"; break; - case EOpConvFloat16ToDouble: out.debug << "Convert float16 to double"; break; - case EOpConvFloat16ToInt64: out.debug << "Convert float16 to int64"; break; - case EOpConvFloat16ToUint64: out.debug << "Convert float16 to uint64"; break; - - case EOpConvBoolToInt16: out.debug << "Convert bool to int16"; break; - case EOpConvIntToInt16: out.debug << "Convert int to int16"; break; - case EOpConvUintToInt16: out.debug << "Convert uint to int16"; break; - case EOpConvFloatToInt16: out.debug << "Convert float to int16"; break; - case EOpConvDoubleToInt16: out.debug << "Convert double to int16"; break; - case EOpConvFloat16ToInt16: out.debug << "Convert float16 to int16"; break; - case EOpConvInt64ToInt16: out.debug << "Convert int64 to int16"; break; - case EOpConvUint64ToInt16: out.debug << "Convert uint64 to int16"; break; - case EOpConvUint16ToInt16: out.debug << "Convert uint16 to int16"; break; - case EOpConvInt16ToBool: out.debug << "Convert int16 to bool"; break; - case EOpConvInt16ToInt: out.debug << "Convert int16 to int"; break; - case EOpConvInt16ToUint: out.debug << "Convert int16 to uint"; break; - case EOpConvInt16ToFloat: out.debug << "Convert int16 to float"; break; - case EOpConvInt16ToDouble: out.debug << "Convert int16 to double"; break; - case EOpConvInt16ToFloat16: out.debug << "Convert int16 to float16"; break; - case EOpConvInt16ToInt64: out.debug << "Convert int16 to int64"; break; - case EOpConvInt16ToUint64: out.debug << "Convert int16 to uint64"; break; - - case EOpConvBoolToUint16: out.debug << "Convert bool to uint16"; break; - case EOpConvIntToUint16: out.debug << "Convert int to uint16"; break; - case EOpConvUintToUint16: out.debug << "Convert uint to uint16"; break; - case EOpConvFloatToUint16: out.debug << "Convert float to uint16"; break; - case EOpConvDoubleToUint16: out.debug << "Convert double to uint16"; break; - case EOpConvFloat16ToUint16: out.debug << "Convert float16 to uint16"; break; - case EOpConvInt64ToUint16: out.debug << "Convert int64 to uint16"; break; - case EOpConvUint64ToUint16: out.debug << "Convert uint64 to uint16"; break; - case EOpConvInt16ToUint16: out.debug << "Convert int16 to uint16"; break; - case EOpConvUint16ToBool: out.debug << "Convert uint16 to bool"; break; - case EOpConvUint16ToInt: out.debug << "Convert uint16 to int"; break; - case EOpConvUint16ToUint: out.debug << "Convert uint16 to uint"; break; - case EOpConvUint16ToFloat: out.debug << "Convert uint16 to float"; break; - case EOpConvUint16ToDouble: out.debug << "Convert uint16 to double"; break; - case EOpConvUint16ToFloat16: out.debug << "Convert uint16 to float16"; break; - case EOpConvUint16ToInt64: out.debug << "Convert uint16 to int64"; break; - case EOpConvUint16ToUint64: out.debug << "Convert uint16 to uint64"; break; + case EOpMbcnt: out.debug << "mbcnt"; break; + + case EOpFragmentMaskFetch: out.debug << "fragmentMaskFetchAMD"; break; + case EOpFragmentFetch: out.debug << "fragmentFetchAMD"; break; + + case EOpCubeFaceIndex: out.debug << "cubeFaceIndex"; break; + case EOpCubeFaceCoord: out.debug << "cubeFaceCoord"; break; #endif + case EOpSubpassLoad: out.debug << "subpassLoad"; break; + case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break; + default: out.debug.message(EPrefixError, "Bad unary op"); } @@ -530,23 +708,30 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpConstructBVec2: out.debug << "Construct bvec2"; break; case EOpConstructBVec3: out.debug << "Construct bvec3"; break; case EOpConstructBVec4: out.debug << "Construct bvec4"; break; + case EOpConstructInt8: out.debug << "Construct int8_t"; break; + case EOpConstructI8Vec2: out.debug << "Construct i8vec2"; break; + case EOpConstructI8Vec3: out.debug << "Construct i8vec3"; break; + case EOpConstructI8Vec4: out.debug << "Construct i8vec4"; break; case EOpConstructInt: out.debug << "Construct int"; break; case EOpConstructIVec2: out.debug << "Construct ivec2"; break; case EOpConstructIVec3: out.debug << "Construct ivec3"; break; case EOpConstructIVec4: out.debug << "Construct ivec4"; break; + case EOpConstructUint8: out.debug << "Construct uint8_t"; break; + case EOpConstructU8Vec2: out.debug << "Construct u8vec2"; break; + case EOpConstructU8Vec3: out.debug << "Construct u8vec3"; break; + case EOpConstructU8Vec4: out.debug << "Construct u8vec4"; break; case EOpConstructUint: out.debug << "Construct uint"; break; case EOpConstructUVec2: out.debug << "Construct uvec2"; break; case EOpConstructUVec3: out.debug << "Construct uvec3"; break; case EOpConstructUVec4: out.debug << "Construct uvec4"; break; - case EOpConstructInt64: out.debug << "Construct int64_t"; break; + case EOpConstructInt64: out.debug << "Construct int64"; break; case EOpConstructI64Vec2: out.debug << "Construct i64vec2"; break; case EOpConstructI64Vec3: out.debug << "Construct i64vec3"; break; case EOpConstructI64Vec4: out.debug << "Construct i64vec4"; break; - case EOpConstructUint64: out.debug << "Construct uint64_t"; break; + case EOpConstructUint64: out.debug << "Construct uint64"; break; case EOpConstructU64Vec2: out.debug << "Construct u64vec2"; break; case EOpConstructU64Vec3: out.debug << "Construct u64vec3"; break; case EOpConstructU64Vec4: out.debug << "Construct u64vec4"; break; -#ifdef AMD_EXTENSIONS case EOpConstructInt16: out.debug << "Construct int16_t"; break; case EOpConstructI16Vec2: out.debug << "Construct i16vec2"; break; case EOpConstructI16Vec3: out.debug << "Construct i16vec3"; break; @@ -555,7 +740,6 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpConstructU16Vec2: out.debug << "Construct u16vec2"; break; case EOpConstructU16Vec3: out.debug << "Construct u16vec3"; break; case EOpConstructU16Vec4: out.debug << "Construct u16vec4"; break; -#endif case EOpConstructMat2x2: out.debug << "Construct mat2"; break; case EOpConstructMat2x3: out.debug << "Construct mat2x3"; break; case EOpConstructMat2x4: out.debug << "Construct mat2x4"; break; @@ -601,7 +785,6 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpConstructBMat4x2: out.debug << "Construct bmat4x2"; break; case EOpConstructBMat4x3: out.debug << "Construct bmat4x3"; break; case EOpConstructBMat4x4: out.debug << "Construct bmat4"; break; -#ifdef AMD_EXTENSIONS case EOpConstructFloat16: out.debug << "Construct float16_t"; break; case EOpConstructF16Vec2: out.debug << "Construct f16vec2"; break; case EOpConstructF16Vec3: out.debug << "Construct f16vec3"; break; @@ -615,7 +798,6 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpConstructF16Mat4x2: out.debug << "Construct f16mat4x2"; break; case EOpConstructF16Mat4x3: out.debug << "Construct f16mat4x3"; break; case EOpConstructF16Mat4x4: out.debug << "Construct f16mat4"; break; -#endif case EOpConstructStruct: out.debug << "Construct structure"; break; case EOpConstructTextureSampler: out.debug << "Construct combined texture-sampler"; break; @@ -784,10 +966,70 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpGenMul: out.debug << "mul"; break; case EOpAllMemoryBarrierWithGroupSync: out.debug << "AllMemoryBarrierWithGroupSync"; break; - case EOpGroupMemoryBarrierWithGroupSync: out.debug << "GroupMemoryBarrierWithGroupSync"; break; + case EOpDeviceMemoryBarrier: out.debug << "DeviceMemoryBarrier"; break; + case EOpDeviceMemoryBarrierWithGroupSync: out.debug << "DeviceMemoryBarrierWithGroupSync"; break; case EOpWorkgroupMemoryBarrier: out.debug << "WorkgroupMemoryBarrier"; break; case EOpWorkgroupMemoryBarrierWithGroupSync: out.debug << "WorkgroupMemoryBarrierWithGroupSync"; break; + case EOpSubgroupBarrier: out.debug << "subgroupBarrier"; break; + case EOpSubgroupMemoryBarrier: out.debug << "subgroupMemoryBarrier"; break; + case EOpSubgroupMemoryBarrierBuffer: out.debug << "subgroupMemoryBarrierBuffer"; break; + case EOpSubgroupMemoryBarrierImage: out.debug << "subgroupMemoryBarrierImage"; break; + case EOpSubgroupMemoryBarrierShared: out.debug << "subgroupMemoryBarrierShared"; break; + case EOpSubgroupElect: out.debug << "subgroupElect"; break; + case EOpSubgroupAll: out.debug << "subgroupAll"; break; + case EOpSubgroupAny: out.debug << "subgroupAny"; break; + case EOpSubgroupAllEqual: out.debug << "subgroupAllEqual"; break; + case EOpSubgroupBroadcast: out.debug << "subgroupBroadcast"; break; + case EOpSubgroupBroadcastFirst: out.debug << "subgroupBroadcastFirst"; break; + case EOpSubgroupBallot: out.debug << "subgroupBallot"; break; + case EOpSubgroupInverseBallot: out.debug << "subgroupInverseBallot"; break; + case EOpSubgroupBallotBitExtract: out.debug << "subgroupBallotBitExtract"; break; + case EOpSubgroupBallotBitCount: out.debug << "subgroupBallotBitCount"; break; + case EOpSubgroupBallotInclusiveBitCount: out.debug << "subgroupBallotInclusiveBitCount"; break; + case EOpSubgroupBallotExclusiveBitCount: out.debug << "subgroupBallotExclusiveBitCount"; break; + case EOpSubgroupBallotFindLSB: out.debug << "subgroupBallotFindLSB"; break; + case EOpSubgroupBallotFindMSB: out.debug << "subgroupBallotFindMSB"; break; + case EOpSubgroupShuffle: out.debug << "subgroupShuffle"; break; + case EOpSubgroupShuffleXor: out.debug << "subgroupShuffleXor"; break; + case EOpSubgroupShuffleUp: out.debug << "subgroupShuffleUp"; break; + case EOpSubgroupShuffleDown: out.debug << "subgroupShuffleDown"; break; + case EOpSubgroupAdd: out.debug << "subgroupAdd"; break; + case EOpSubgroupMul: out.debug << "subgroupMul"; break; + case EOpSubgroupMin: out.debug << "subgroupMin"; break; + case EOpSubgroupMax: out.debug << "subgroupMax"; break; + case EOpSubgroupAnd: out.debug << "subgroupAnd"; break; + case EOpSubgroupOr: out.debug << "subgroupOr"; break; + case EOpSubgroupXor: out.debug << "subgroupXor"; break; + case EOpSubgroupInclusiveAdd: out.debug << "subgroupInclusiveAdd"; break; + case EOpSubgroupInclusiveMul: out.debug << "subgroupInclusiveMul"; break; + case EOpSubgroupInclusiveMin: out.debug << "subgroupInclusiveMin"; break; + case EOpSubgroupInclusiveMax: out.debug << "subgroupInclusiveMax"; break; + case EOpSubgroupInclusiveAnd: out.debug << "subgroupInclusiveAnd"; break; + case EOpSubgroupInclusiveOr: out.debug << "subgroupInclusiveOr"; break; + case EOpSubgroupInclusiveXor: out.debug << "subgroupInclusiveXor"; break; + case EOpSubgroupExclusiveAdd: out.debug << "subgroupExclusiveAdd"; break; + case EOpSubgroupExclusiveMul: out.debug << "subgroupExclusiveMul"; break; + case EOpSubgroupExclusiveMin: out.debug << "subgroupExclusiveMin"; break; + case EOpSubgroupExclusiveMax: out.debug << "subgroupExclusiveMax"; break; + case EOpSubgroupExclusiveAnd: out.debug << "subgroupExclusiveAnd"; break; + case EOpSubgroupExclusiveOr: out.debug << "subgroupExclusiveOr"; break; + case EOpSubgroupExclusiveXor: out.debug << "subgroupExclusiveXor"; break; + case EOpSubgroupClusteredAdd: out.debug << "subgroupClusteredAdd"; break; + case EOpSubgroupClusteredMul: out.debug << "subgroupClusteredMul"; break; + case EOpSubgroupClusteredMin: out.debug << "subgroupClusteredMin"; break; + case EOpSubgroupClusteredMax: out.debug << "subgroupClusteredMax"; break; + case EOpSubgroupClusteredAnd: out.debug << "subgroupClusteredAnd"; break; + case EOpSubgroupClusteredOr: out.debug << "subgroupClusteredOr"; break; + case EOpSubgroupClusteredXor: out.debug << "subgroupClusteredXor"; break; + case EOpSubgroupQuadBroadcast: out.debug << "subgroupQuadBroadcast"; break; + case EOpSubgroupQuadSwapHorizontal: out.debug << "subgroupQuadSwapHorizontal"; break; + case EOpSubgroupQuadSwapVertical: out.debug << "subgroupQuadSwapVertical"; break; + case EOpSubgroupQuadSwapDiagonal: out.debug << "subgroupQuadSwapDiagonal"; break; + + case EOpSubpassLoad: out.debug << "subpassLoad"; break; + case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break; + default: out.debug.message(EPrefixError, "Bad aggregation op"); } @@ -806,7 +1048,15 @@ bool TOutputTraverser::visitSelection(TVisit /* visit */, TIntermSelection* node OutputTreeText(out, node, depth); out.debug << "Test condition and select"; - out.debug << " (" << node->getCompleteString() << ")\n"; + out.debug << " (" << node->getCompleteString() << ")"; + + if (node->getShortCircuit() == false) + out.debug << ": no shortcircuit"; + if (node->getFlatten()) + out.debug << ": Flatten"; + if (node->getDontFlatten()) + out.debug << ": DontFlatten"; + out.debug << "\n"; ++depth; @@ -851,9 +1101,7 @@ static void OutputConstantUnion(TInfoSink& out, const TIntermTyped* node, const break; case EbtFloat: case EbtDouble: -#ifdef AMD_EXTENSIONS case EbtFloat16: -#endif { const double value = constUnion[i].getDConst(); // Print infinities and NaNs in a portable way. @@ -873,62 +1121,78 @@ static void OutputConstantUnion(TInfoSink& out, const TIntermTyped* node, const } } break; - case EbtInt: + case EbtInt8: { const int maxSize = 300; char buf[maxSize]; - snprintf(buf, maxSize, "%d (%s)", constUnion[i].getIConst(), "const int"); + snprintf(buf, maxSize, "%d (%s)", constUnion[i].getI8Const(), "const int8_t"); out.debug << buf << "\n"; } break; - case EbtUint: + case EbtUint8: { const int maxSize = 300; char buf[maxSize]; - snprintf(buf, maxSize, "%u (%s)", constUnion[i].getUConst(), "const uint"); + snprintf(buf, maxSize, "%u (%s)", constUnion[i].getU8Const(), "const uint8_t"); out.debug << buf << "\n"; } break; - case EbtInt64: + case EbtInt16: { const int maxSize = 300; char buf[maxSize]; - snprintf(buf, maxSize, "%lld (%s)", constUnion[i].getI64Const(), "const int64_t"); + snprintf(buf, maxSize, "%d (%s)", constUnion[i].getI16Const(), "const int16_t"); out.debug << buf << "\n"; } break; - case EbtUint64: + case EbtUint16: { const int maxSize = 300; char buf[maxSize]; - snprintf(buf, maxSize, "%llu (%s)", constUnion[i].getU64Const(), "const uint64_t"); + snprintf(buf, maxSize, "%u (%s)", constUnion[i].getU16Const(), "const uint16_t"); out.debug << buf << "\n"; } break; -#ifdef AMD_EXTENSIONS - case EbtInt16: + case EbtInt: { const int maxSize = 300; char buf[maxSize]; - snprintf(buf, maxSize, "%d (%s)", constUnion[i].getIConst(), "const int16_t"); + snprintf(buf, maxSize, "%d (%s)", constUnion[i].getIConst(), "const int"); out.debug << buf << "\n"; } break; - case EbtUint16: + case EbtUint: { const int maxSize = 300; char buf[maxSize]; - snprintf(buf, maxSize, "%u (%s)", constUnion[i].getUConst(), "const uint16_t"); + snprintf(buf, maxSize, "%u (%s)", constUnion[i].getUConst(), "const uint"); + + out.debug << buf << "\n"; + } + break; + case EbtInt64: + { + const int maxSize = 300; + char buf[maxSize]; + snprintf(buf, maxSize, "%lld (%s)", constUnion[i].getI64Const(), "const int64_t"); + + out.debug << buf << "\n"; + } + break; + case EbtUint64: + { + const int maxSize = 300; + char buf[maxSize]; + snprintf(buf, maxSize, "%llu (%s)", constUnion[i].getU64Const(), "const uint64_t"); out.debug << buf << "\n"; } break; -#endif default: out.info.message(EPrefixInternalError, "Unknown constant", node->getLoc()); break; @@ -968,7 +1232,17 @@ bool TOutputTraverser::visitLoop(TVisit /* visit */, TIntermLoop* node) out.debug << "Loop with condition "; if (! node->testFirst()) out.debug << "not "; - out.debug << "tested first\n"; + out.debug << "tested first"; + + if (node->getUnroll()) + out.debug << ": Unroll"; + if (node->getDontUnroll()) + out.debug << ": DontUnroll"; + if (node->getLoopDependency()) { + out.debug << ": Dependency "; + out.debug << node->getLoopDependency(); + } + out.debug << "\n"; ++depth; @@ -1029,7 +1303,13 @@ bool TOutputTraverser::visitSwitch(TVisit /* visit */, TIntermSwitch* node) TInfoSink& out = infoSink; OutputTreeText(out, node, depth); - out.debug << "switch\n"; + out.debug << "switch"; + + if (node->getFlatten()) + out.debug << ": Flatten"; + if (node->getDontFlatten()) + out.debug << ": DontFlatten"; + out.debug << "\n"; OutputTreeText(out, node, depth); out.debug << "condition\n"; diff --git a/deps/glslang/glslang/MachineIndependent/iomapper.cpp b/deps/glslang/glslang/MachineIndependent/iomapper.cpp index 59db1ade..ad22353b 100644 --- a/deps/glslang/glslang/MachineIndependent/iomapper.cpp +++ b/deps/glslang/glslang/MachineIndependent/iomapper.cpp @@ -351,16 +351,23 @@ struct TResolverInOutAdaptor // Base class for shared TIoMapResolver services, used by several derivations. struct TDefaultIoResolverBase : public glslang::TIoMapResolver { - int baseSamplerBinding; - int baseTextureBinding; - int baseImageBinding; - int baseUboBinding; - int baseSsboBinding; - int baseUavBinding; - std::vector baseResourceSetBinding; - bool doAutoBindingMapping; - bool doAutoLocationMapping; - int nextUniformLocation; + TDefaultIoResolverBase(const TIntermediate &intermediate) : + intermediate(intermediate), + nextUniformLocation(0), + nextInputLocation(0), + nextOutputLocation(0) + { } + + int getBaseBinding(TResourceType res, unsigned int set) const { + return selectBaseBinding(intermediate.getShiftBinding(res), + intermediate.getShiftBindingForSet(res, set)); + } + + const std::vector& getResourceSetBinding() const { return intermediate.getResourceSetBinding(); } + + bool doAutoBindingMapping() const { return intermediate.getAutoMapBindings(); } + bool doAutoLocationMapping() const { return intermediate.getAutoMapLocations(); } + typedef std::vector TSlotSet; typedef std::unordered_map TSlotSetMap; TSlotSetMap slots; @@ -411,20 +418,22 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver return type.getQualifier().layoutSet; // If a command line or API option requested a single descriptor set, use that (if not overrided by spaceN) - if (baseResourceSetBinding.size() == 1) - return atoi(baseResourceSetBinding[0].c_str()); + if (getResourceSetBinding().size() == 1) + return atoi(getResourceSetBinding()[0].c_str()); return 0; } - int resolveUniformLocation(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool is_live) override + int resolveUniformLocation(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool /*is_live*/) override { // kick out of not doing this - if (!doAutoLocationMapping) + if (!doAutoLocationMapping()) return -1; // no locations added if already present, a built-in variable, a block, or an opaque if (type.getQualifier().hasLocation() || type.isBuiltIn() || - type.getBasicType() == EbtBlock || type.containsOpaque()) + type.getBasicType() == EbtBlock || + type.getBasicType() == EbtAtomicUint || + (type.containsOpaque() && intermediate.getSpv().openGl == 0)) return -1; // no locations on blocks of built-in variables @@ -435,16 +444,20 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver return -1; } - return nextUniformLocation++; + int location = nextUniformLocation; + + nextUniformLocation += TIntermediate::computeTypeUniformLocationSize(type); + + return location; } bool validateInOut(EShLanguage /*stage*/, const char* /*name*/, const TType& /*type*/, bool /*is_live*/) override { return true; } - int resolveInOutLocation(EShLanguage /*stage*/, const char* /*name*/, const TType& type, bool /*is_live*/) override + int resolveInOutLocation(EShLanguage stage, const char* /*name*/, const TType& type, bool /*is_live*/) override { // kick out of not doing this - if (!doAutoLocationMapping) + if (!doAutoLocationMapping()) return -1; // no locations added if already present, or a built-in variable @@ -459,14 +472,15 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver return -1; } - // Placeholder. - // TODO: It would be nice to flesh this out using - // intermediate->computeTypeLocationSize(type), or functions that call it like - // intermediate->addUsedLocation() - // These in turn would want the intermediate, which is not available here, but - // is available in many places, and a lot of copying from it could be saved if - // it were just available. - return 0; + // point to the right input or output location counter + int& nextLocation = type.getQualifier().isPipeInput() ? nextInputLocation : nextOutputLocation; + + // Placeholder. This does not do proper cross-stage lining up, nor + // work with mixed location/no-location declarations. + int location = nextLocation; + nextLocation += TIntermediate::computeTypeLocationSize(type, stage); + + return location; } int resolveInOutComponent(EShLanguage /*stage*/, const char* /*name*/, const TType& /*type*/, bool /*is_live*/) override { @@ -485,6 +499,16 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver void endResolve(EShLanguage) override {} protected: + const TIntermediate &intermediate; + int nextUniformLocation; + int nextInputLocation; + int nextOutputLocation; + + // Return descriptor set specific base if there is one, and the generic base otherwise. + int selectBaseBinding(int base, int descriptorSetBase) const { + return descriptorSetBase != -1 ? descriptorSetBase : base; + } + static int getLayoutSet(const glslang::TType& type) { if (type.getQualifier().hasSet()) return type.getQualifier().layoutSet; @@ -497,7 +521,8 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver } static bool isTextureType(const glslang::TType& type) { - return type.getBasicType() == glslang::EbtSampler && type.getSampler().isTexture(); + return (type.getBasicType() == glslang::EbtSampler && + (type.getSampler().isTexture() || type.getSampler().isSubpass())); } static bool isUboType(const glslang::TType& type) { @@ -517,6 +542,8 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver */ struct TDefaultIoResolver : public TDefaultIoResolverBase { + TDefaultIoResolver(const TIntermediate &intermediate) : TDefaultIoResolverBase(intermediate) { } + bool validateBinding(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& /*type*/, bool /*is_live*/) override { return true; @@ -528,37 +555,37 @@ struct TDefaultIoResolver : public TDefaultIoResolverBase if (type.getQualifier().hasBinding()) { if (isImageType(type)) - return reserveSlot(set, baseImageBinding + type.getQualifier().layoutBinding); + return reserveSlot(set, getBaseBinding(EResImage, set) + type.getQualifier().layoutBinding); if (isTextureType(type)) - return reserveSlot(set, baseTextureBinding + type.getQualifier().layoutBinding); + return reserveSlot(set, getBaseBinding(EResTexture, set) + type.getQualifier().layoutBinding); if (isSsboType(type)) - return reserveSlot(set, baseSsboBinding + type.getQualifier().layoutBinding); + return reserveSlot(set, getBaseBinding(EResSsbo, set) + type.getQualifier().layoutBinding); if (isSamplerType(type)) - return reserveSlot(set, baseSamplerBinding + type.getQualifier().layoutBinding); + return reserveSlot(set, getBaseBinding(EResSampler, set) + type.getQualifier().layoutBinding); if (isUboType(type)) - return reserveSlot(set, baseUboBinding + type.getQualifier().layoutBinding); - } else if (is_live && doAutoBindingMapping) { + return reserveSlot(set, getBaseBinding(EResUbo, set) + type.getQualifier().layoutBinding); + } else if (is_live && doAutoBindingMapping()) { // find free slot, the caller did make sure it passes all vars with binding // first and now all are passed that do not have a binding and needs one if (isImageType(type)) - return getFreeSlot(set, baseImageBinding); + return getFreeSlot(set, getBaseBinding(EResImage, set)); if (isTextureType(type)) - return getFreeSlot(set, baseTextureBinding); + return getFreeSlot(set, getBaseBinding(EResTexture, set)); if (isSsboType(type)) - return getFreeSlot(set, baseSsboBinding); + return getFreeSlot(set, getBaseBinding(EResSsbo, set)); if (isSamplerType(type)) - return getFreeSlot(set, baseSamplerBinding); + return getFreeSlot(set, getBaseBinding(EResSampler, set)); if (isUboType(type)) - return getFreeSlot(set, baseUboBinding); + return getFreeSlot(set, getBaseBinding(EResUbo, set)); } return -1; @@ -577,7 +604,7 @@ struct TDefaultIoResolver : public TDefaultIoResolverBase /******************************************************************************** The following IO resolver maps types in HLSL register space, as follows: -t – for shader resource views (SRV) +t - for shader resource views (SRV) TEXTURE1D TEXTURE1DARRAY TEXTURE2D @@ -592,7 +619,7 @@ t – for shader resource views (SRV) BUFFER TBUFFER -s – for samplers +s - for samplers SAMPLER SAMPLER1D SAMPLER2D @@ -601,7 +628,7 @@ s – for samplers SAMPLERSTATE SAMPLERCOMPARISONSTATE -u – for unordered access views (UAV) +u - for unordered access views (UAV) RWBYTEADDRESSBUFFER RWSTRUCTUREDBUFFER APPENDSTRUCTUREDBUFFER @@ -613,12 +640,14 @@ u – for unordered access views (UAV) RWTEXTURE2DARRAY RWTEXTURE3D -b – for constant buffer views (CBV) +b - for constant buffer views (CBV) CBUFFER CONSTANTBUFFER ********************************************************************************/ struct TDefaultHlslIoResolver : public TDefaultIoResolverBase { + TDefaultHlslIoResolver(const TIntermediate &intermediate) : TDefaultIoResolverBase(intermediate) { } + bool validateBinding(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& /*type*/, bool /*is_live*/) override { return true; @@ -630,31 +659,31 @@ struct TDefaultHlslIoResolver : public TDefaultIoResolverBase if (type.getQualifier().hasBinding()) { if (isUavType(type)) - return reserveSlot(set, baseUavBinding + type.getQualifier().layoutBinding); + return reserveSlot(set, getBaseBinding(EResUav, set) + type.getQualifier().layoutBinding); if (isSrvType(type)) - return reserveSlot(set, baseTextureBinding + type.getQualifier().layoutBinding); + return reserveSlot(set, getBaseBinding(EResTexture, set) + type.getQualifier().layoutBinding); if (isSamplerType(type)) - return reserveSlot(set, baseSamplerBinding + type.getQualifier().layoutBinding); + return reserveSlot(set, getBaseBinding(EResSampler, set) + type.getQualifier().layoutBinding); if (isUboType(type)) - return reserveSlot(set, baseUboBinding + type.getQualifier().layoutBinding); - } else if (is_live && doAutoBindingMapping) { + return reserveSlot(set, getBaseBinding(EResUbo, set) + type.getQualifier().layoutBinding); + } else if (is_live && doAutoBindingMapping()) { // find free slot, the caller did make sure it passes all vars with binding // first and now all are passed that do not have a binding and needs one if (isUavType(type)) - return getFreeSlot(set, baseUavBinding); + return getFreeSlot(set, getBaseBinding(EResUav, set)); if (isSrvType(type)) - return getFreeSlot(set, baseTextureBinding); + return getFreeSlot(set, getBaseBinding(EResTexture, set)); if (isSamplerType(type)) - return getFreeSlot(set, baseSamplerBinding); + return getFreeSlot(set, getBaseBinding(EResSampler, set)); if (isUboType(type)) - return getFreeSlot(set, baseUboBinding); + return getFreeSlot(set, getBaseBinding(EResUbo, set)); } return -1; @@ -683,17 +712,17 @@ struct TDefaultHlslIoResolver : public TDefaultIoResolverBase // Returns false if the input is too malformed to do this. bool TIoMapper::addStage(EShLanguage stage, TIntermediate &intermediate, TInfoSink &infoSink, TIoMapResolver *resolver) { - // Trivial return if there is nothing to do. - if (intermediate.getShiftSamplerBinding() == 0 && - intermediate.getShiftTextureBinding() == 0 && - intermediate.getShiftImageBinding() == 0 && - intermediate.getShiftUboBinding() == 0 && - intermediate.getShiftSsboBinding() == 0 && - intermediate.getShiftUavBinding() == 0 && - intermediate.getResourceSetBinding().empty() && - intermediate.getAutoMapBindings() == false && - intermediate.getAutoMapLocations() == false && - resolver == nullptr) + bool somethingToDo = !intermediate.getResourceSetBinding().empty() || + intermediate.getAutoMapBindings() || + intermediate.getAutoMapLocations(); + + for (int res = 0; res < EResCount; ++res) { + somethingToDo = somethingToDo || + (intermediate.getShiftBinding(TResourceType(res)) != 0) || + intermediate.hasShiftBindingForSet(TResourceType(res)); + } + + if (!somethingToDo && resolver == nullptr) return true; if (intermediate.getNumEntryPoints() != 1 || intermediate.isRecursive()) @@ -704,30 +733,15 @@ bool TIoMapper::addStage(EShLanguage stage, TIntermediate &intermediate, TInfoSi return false; // if no resolver is provided, use the default resolver with the given shifts and auto map settings - TDefaultIoResolver defaultResolver; - TDefaultHlslIoResolver defaultHlslResolver; + TDefaultIoResolver defaultResolver(intermediate); + TDefaultHlslIoResolver defaultHlslResolver(intermediate); if (resolver == nullptr) { - TDefaultIoResolverBase* resolverBase; - // TODO: use a passed in IO mapper for this if (intermediate.usingHlslIoMapping()) - resolverBase = &defaultHlslResolver; + resolver = &defaultHlslResolver; else - resolverBase = &defaultResolver; - - resolverBase->baseSamplerBinding = intermediate.getShiftSamplerBinding(); - resolverBase->baseTextureBinding = intermediate.getShiftTextureBinding(); - resolverBase->baseImageBinding = intermediate.getShiftImageBinding(); - resolverBase->baseUboBinding = intermediate.getShiftUboBinding(); - resolverBase->baseSsboBinding = intermediate.getShiftSsboBinding(); - resolverBase->baseUavBinding = intermediate.getShiftUavBinding(); - resolverBase->baseResourceSetBinding = intermediate.getResourceSetBinding(); - resolverBase->doAutoBindingMapping = intermediate.getAutoMapBindings(); - resolverBase->doAutoLocationMapping = intermediate.getAutoMapLocations(); - resolverBase->nextUniformLocation = 0; - - resolver = resolverBase; + resolver = &defaultResolver; } TVarLiveMap inVarMap, outVarMap, uniformVarMap; diff --git a/deps/glslang/glslang/MachineIndependent/linkValidate.cpp b/deps/glslang/glslang/MachineIndependent/linkValidate.cpp index 9ca1557b..c80fdb36 100644 --- a/deps/glslang/glslang/MachineIndependent/linkValidate.cpp +++ b/deps/glslang/glslang/MachineIndependent/linkValidate.cpp @@ -1,5 +1,6 @@ // // Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -267,10 +268,13 @@ void TIntermediate::mergeLinkerObjects(TInfoSink& infoSink, TIntermSequence& lin // Recursively merge the implicit array sizes through the objects' respective type trees. void TIntermediate::mergeImplicitArraySizes(TType& type, const TType& unitType) { - if (type.isImplicitlySizedArray() && unitType.isArray()) { - int newImplicitArraySize = unitType.isImplicitlySizedArray() ? unitType.getImplicitArraySize() : unitType.getOuterArraySize(); - if (newImplicitArraySize > type.getImplicitArraySize ()) - type.setImplicitArraySize(newImplicitArraySize); + if (type.isUnsizedArray()) { + if (unitType.isUnsizedArray()) { + type.updateImplicitArraySize(unitType.getImplicitArraySize()); + if (unitType.isArrayVariablyIndexed()) + type.setArrayVariablyIndexed(); + } else if (unitType.isSizedArray()) + type.changeOuterArraySize(unitType.getOuterArraySize()); } // Type mismatches are caught and reported after this, just be careful for now. @@ -293,8 +297,13 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy // Types have to match if (symbol.getType() != unitSymbol.getType()) { - error(infoSink, "Types must match:"); - writeTypeComparison = true; + // but, we make an exception if one is an implicit array and the other is sized + if (! (symbol.getType().isArray() && unitSymbol.getType().isArray() && + symbol.getType().sameElementType(unitSymbol.getType()) && + (symbol.getType().isUnsizedArray() || unitSymbol.getType().isUnsizedArray()))) { + error(infoSink, "Types must match:"); + writeTypeComparison = true; + } } // Qualifiers have to (almost) match @@ -510,7 +519,9 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled) virtual void visitSymbol(TIntermSymbol* symbol) { // Implicitly size arrays. - symbol->getWritableType().adoptImplicitArraySizes(); + // If an unsized array is left as unsized, it effectively + // becomes run-time sized. + symbol->getWritableType().adoptImplicitArraySizes(false); } } finalLinkTraverser; @@ -765,7 +776,7 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ int size; if (qualifier.isUniformOrBuffer()) { - if (type.isExplicitlySizedArray()) + if (type.isSizedArray()) size = type.getCumulativeArraySize(); else size = 1; @@ -773,9 +784,9 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ // Strip off the outer array dimension for those having an extra one. if (type.isArray() && qualifier.isArrayedIo(language)) { TType elementType(type, 0); - size = computeTypeLocationSize(elementType); + size = computeTypeLocationSize(elementType, language); } else - size = computeTypeLocationSize(type); + size = computeTypeLocationSize(type, language); } // Locations, and components within locations. @@ -907,18 +918,18 @@ bool TIntermediate::addUsedConstantId(int id) // Recursively figure out how many locations are used up by an input or output type. // Return the size of type, as measured by "locations". -int TIntermediate::computeTypeLocationSize(const TType& type) const +int TIntermediate::computeTypeLocationSize(const TType& type, EShLanguage stage) { // "If the declared input is an array of size n and each element takes m locations, it will be assigned m * n // consecutive locations..." if (type.isArray()) { // TODO: perf: this can be flattened by using getCumulativeArraySize(), and a deref that discards all arrayness + // TODO: are there valid cases of having an unsized array with a location? If so, running this code too early. TType elementType(type, 0); - if (type.isImplicitlySizedArray()) { - // TODO: are there valid cases of having an implicitly-sized array with a location? If so, running this code too early. - return computeTypeLocationSize(elementType); - } else - return type.getOuterArraySize() * computeTypeLocationSize(elementType); + if (type.isSizedArray()) + return type.getOuterArraySize() * computeTypeLocationSize(elementType, stage); + else + return computeTypeLocationSize(elementType, stage); } // "The locations consumed by block and structure members are determined by applying the rules above @@ -927,7 +938,7 @@ int TIntermediate::computeTypeLocationSize(const TType& type) const int size = 0; for (int member = 0; member < (int)type.getStruct()->size(); ++member) { TType memberType(type, member); - size += computeTypeLocationSize(memberType); + size += computeTypeLocationSize(memberType, stage); } return size; } @@ -941,7 +952,7 @@ int TIntermediate::computeTypeLocationSize(const TType& type) const if (type.isScalar()) return 1; if (type.isVector()) { - if (language == EShLangVertex && type.getQualifier().isPipeInput()) + if (stage == EShLangVertex && type.getQualifier().isPipeInput()) return 1; if (type.getBasicType() == EbtDouble && type.getVectorSize() > 2) return 2; @@ -954,13 +965,44 @@ int TIntermediate::computeTypeLocationSize(const TType& type) const // for an n-element array of m-component vectors..." if (type.isMatrix()) { TType columnType(type, 0); - return type.getMatrixCols() * computeTypeLocationSize(columnType); + return type.getMatrixCols() * computeTypeLocationSize(columnType, stage); } assert(0); return 1; } +// Same as computeTypeLocationSize but for uniforms +int TIntermediate::computeTypeUniformLocationSize(const TType& type) +{ + // "Individual elements of a uniform array are assigned + // consecutive locations with the first element taking location + // location." + if (type.isArray()) { + // TODO: perf: this can be flattened by using getCumulativeArraySize(), and a deref that discards all arrayness + TType elementType(type, 0); + if (type.isSizedArray()) { + return type.getOuterArraySize() * computeTypeUniformLocationSize(elementType); + } else { + // TODO: are there valid cases of having an implicitly-sized array with a location? If so, running this code too early. + return computeTypeUniformLocationSize(elementType); + } + } + + // "Each subsequent inner-most member or element gets incremental + // locations for the entire structure or array." + if (type.isStruct()) { + int size = 0; + for (int member = 0; member < (int)type.getStruct()->size(); ++member) { + TType memberType(type, member); + size += computeTypeUniformLocationSize(memberType); + } + return size; + } + + return 1; +} + // Accumulate xfb buffer ranges and check for collisions as the accumulation is done. // // Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value. @@ -1005,7 +1047,7 @@ unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& contains if (type.isArray()) { // TODO: perf: this can be flattened by using getCumulativeArraySize(), and a deref that discards all arrayness - assert(type.isExplicitlySizedArray()); + assert(type.isSizedArray()); TType elementType(type, 0); return type.getOuterArraySize() * computeTypeXfbSize(elementType, containsDouble); } @@ -1064,11 +1106,11 @@ int TIntermediate::getBaseAlignmentScalar(const TType& type, int& size) case EbtInt64: case EbtUint64: case EbtDouble: size = 8; return 8; -#ifdef AMD_EXTENSIONS - case EbtInt16: - case EbtUint16: case EbtFloat16: size = 2; return 2; -#endif + case EbtInt8: + case EbtUint8: size = 1; return 1; + case EbtInt16: + case EbtUint16: size = 2; return 2; default: size = 4; return 4; } } @@ -1197,6 +1239,8 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, b if (type.isVector()) { int scalarAlign = getBaseAlignmentScalar(type, size); switch (type.getVectorSize()) { + case 1: // HLSL has this, GLSL does not + return scalarAlign; case 2: size *= 2; return 2 * scalarAlign; diff --git a/deps/glslang/glslang/MachineIndependent/localintermediate.h b/deps/glslang/glslang/MachineIndependent/localintermediate.h index 9f6e3da2..17e07651 100644 --- a/deps/glslang/glslang/MachineIndependent/localintermediate.h +++ b/deps/glslang/glslang/MachineIndependent/localintermediate.h @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2016 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -42,6 +43,7 @@ #include #include +#include class TInfoSink; @@ -77,7 +79,7 @@ class TSwizzleSelectors { assert(i < MaxSwizzleSelectors); return components[i]; } - + private: int size_; selectorType components[MaxSwizzleSelectors]; @@ -208,7 +210,7 @@ class TVariable; class TIntermediate { public: explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) : - implicitThisName("@this"), + implicitThisName("@this"), implicitCounterName("@count"), language(l), source(EShSourceNone), profile(p), version(v), treeRoot(0), numEntryPoints(0), numErrors(0), numPushConstants(0), recursive(false), invocations(TQualifier::layoutNotSet), vertices(TQualifier::layoutNotSet), @@ -216,25 +218,22 @@ class TIntermediate { pixelCenterInteger(false), originUpperLeft(false), vertexSpacing(EvsNone), vertexOrder(EvoNone), pointMode(false), earlyFragmentTests(false), postDepthCoverage(false), depthLayout(EldNone), depthReplacing(false), + hlslFunctionality1(false), blendEquations(0), xfbMode(false), multiStream(false), #ifdef NV_EXTENSIONS layoutOverrideCoverage(false), geoPassthroughEXT(false), #endif - shiftSamplerBinding(0), - shiftTextureBinding(0), - shiftImageBinding(0), - shiftUboBinding(0), - shiftSsboBinding(0), - shiftUavBinding(0), autoMapBindings(false), autoMapLocations(false), + invertY(false), flattenUniformArrays(false), useUnknownFormat(false), hlslOffsets(false), useStorageBuffer(false), hlslIoMapping(false), - textureSamplerTransformMode(EShTexSampTransKeep) + textureSamplerTransformMode(EShTexSampTransKeep), + needToLegalize(false) { localSize[0] = 1; localSize[1] = 1; @@ -243,6 +242,8 @@ class TIntermediate { localSizeSpecId[1] = TQualifier::layoutNotSet; localSizeSpecId[2] = TQualifier::layoutNotSet; xfbBuffers.resize(TQualifier::layoutXfbBufferEnd); + + shiftBinding.fill(0); } void setLimits(const TBuiltInResource& r) { resources = r; } @@ -262,42 +263,39 @@ class TIntermediate { const std::string& getEntryPointName() const { return entryPointName; } const std::string& getEntryPointMangledName() const { return entryPointMangledName; } - void setShiftSamplerBinding(unsigned int shift) - { - shiftSamplerBinding = shift; - processes.addIfNonZero("shift-sampler-binding", shift); - } - unsigned int getShiftSamplerBinding() const { return shiftSamplerBinding; } - void setShiftTextureBinding(unsigned int shift) - { - shiftTextureBinding = shift; - processes.addIfNonZero("shift-texture-binding", shift); - } - unsigned int getShiftTextureBinding() const { return shiftTextureBinding; } - void setShiftImageBinding(unsigned int shift) - { - shiftImageBinding = shift; - processes.addIfNonZero("shift-image-binding", shift); - } - unsigned int getShiftImageBinding() const { return shiftImageBinding; } - void setShiftUboBinding(unsigned int shift) + void setShiftBinding(TResourceType res, unsigned int shift) { - shiftUboBinding = shift; - processes.addIfNonZero("shift-UBO-binding", shift); + shiftBinding[res] = shift; + + const char* name = getResourceName(res); + if (name != nullptr) + processes.addIfNonZero(name, shift); } - unsigned int getShiftUboBinding() const { return shiftUboBinding; } - void setShiftSsboBinding(unsigned int shift) + + unsigned int getShiftBinding(TResourceType res) const { return shiftBinding[res]; } + + void setShiftBindingForSet(TResourceType res, unsigned int shift, unsigned int set) { - shiftSsboBinding = shift; - processes.addIfNonZero("shift-ssbo-binding", shift); + if (shift == 0) // ignore if there's no shift: it's a no-op. + return; + + shiftBindingForSet[res][set] = shift; + + const char* name = getResourceName(res); + if (name != nullptr) { + processes.addProcess(name); + processes.addArgument(shift); + processes.addArgument(set); + } } - unsigned int getShiftSsboBinding() const { return shiftSsboBinding; } - void setShiftUavBinding(unsigned int shift) + + int getShiftBindingForSet(TResourceType res, unsigned int set) const { - shiftUavBinding = shift; - processes.addIfNonZero("shift-uav-binding", shift); + const auto shift = shiftBindingForSet[res].find(set); + return shift == shiftBindingForSet[res].end() ? -1 : shift->second; } - unsigned int getShiftUavBinding() const { return shiftUavBinding; } + bool hasShiftBindingForSet(TResourceType res) const { return !shiftBindingForSet[res].empty(); } + void setResourceSetBinding(const std::vector& shift) { resourceSetBinding = shift; @@ -322,6 +320,14 @@ class TIntermediate { processes.addProcess("auto-map-locations"); } bool getAutoMapLocations() const { return autoMapLocations; } + void setInvertY(bool invert) + { + invertY = invert; + if (invertY) + processes.addProcess("invert-y"); + } + bool getInvertY() const { return invertY; } + void setFlattenUniformArrays(bool flatten) { flattenUniformArrays = flatten; @@ -357,6 +363,13 @@ class TIntermediate { } bool usingHlslIoMapping() { return hlslIoMapping; } + template T addCounterBufferName(const T& name) const { return name + implicitCounterName; } + bool hasCounterBufferName(const TString& name) const { + size_t len = strlen(implicitCounterName); + return name.size() > len && + name.compare(name.size() - len, len, implicitCounterName) == 0; + } + void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode) { textureSamplerTransformMode = mode; } void setVersion(int v) { version = v; } @@ -374,7 +387,7 @@ class TIntermediate { processes.addProcess("client opengl100"); // target-environment processes - if (spvVersion.vulkan == 100) + if (spvVersion.vulkan > 0) processes.addProcess("target-env vulkan1.0"); else if (spvVersion.vulkan > 0) processes.addProcess("target-env vulkanUnknown"); @@ -399,6 +412,7 @@ class TIntermediate { TIntermSymbol* addSymbol(const TType&, const TSourceLoc&); TIntermSymbol* addSymbol(const TIntermSymbol&); TIntermTyped* addConversion(TOperator, const TType&, TIntermTyped*) const; + std::tuple addConversion(TOperator op, TIntermTyped* node0, TIntermTyped* node1) const; TIntermTyped* addUniShapeConversion(TOperator, const TType&, TIntermTyped*); void addBiShapeConversion(TOperator, TIntermTyped*& lhsNode, TIntermTyped*& rhsNode); TIntermTyped* addShapeConversion(const TType&, TIntermTyped*); @@ -408,6 +422,11 @@ class TIntermediate { TIntermTyped* addUnaryMath(TOperator, TIntermTyped* child, TSourceLoc); TIntermTyped* addBuiltInFunctionCall(const TSourceLoc& line, TOperator, bool unary, TIntermNode*, const TType& returnType); bool canImplicitlyPromote(TBasicType from, TBasicType to, TOperator op = EOpNull) const; + bool isIntegralPromotion(TBasicType from, TBasicType to) const; + bool isFPPromotion(TBasicType from, TBasicType to) const; + bool isIntegralConversion(TBasicType from, TBasicType to) const; + bool isFPConversion(TBasicType from, TBasicType to) const; + bool isFPIntegralConversion(TBasicType from, TBasicType to) const; TOperator mapTypeToConstructorOp(const TType&) const; TIntermAggregate* growAggregate(TIntermNode* left, TIntermNode* right); TIntermAggregate* growAggregate(TIntermNode* left, TIntermNode* right, const TSourceLoc&); @@ -416,27 +435,27 @@ class TIntermediate { TIntermAggregate* makeAggregate(const TSourceLoc&); TIntermTyped* setAggregateOperator(TIntermNode*, TOperator, const TType& type, TSourceLoc); bool areAllChildConst(TIntermAggregate* aggrNode); - TIntermTyped* addSelection(TIntermTyped* cond, TIntermNodePair code, const TSourceLoc&, TSelectionControl = ESelectionControlNone); - TIntermTyped* addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, const TSourceLoc&, TSelectionControl = ESelectionControlNone); + TIntermSelection* addSelection(TIntermTyped* cond, TIntermNodePair code, const TSourceLoc&); + TIntermTyped* addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, const TSourceLoc&); TIntermTyped* addComma(TIntermTyped* left, TIntermTyped* right, const TSourceLoc&); TIntermTyped* addMethod(TIntermTyped*, const TType&, const TString*, const TSourceLoc&); TIntermConstantUnion* addConstantUnion(const TConstUnionArray&, const TType&, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(signed char, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(unsigned char, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(signed short, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(unsigned short, const TSourceLoc&, bool literal = false) const; TIntermConstantUnion* addConstantUnion(int, const TSourceLoc&, bool literal = false) const; TIntermConstantUnion* addConstantUnion(unsigned int, const TSourceLoc&, bool literal = false) const; TIntermConstantUnion* addConstantUnion(long long, const TSourceLoc&, bool literal = false) const; TIntermConstantUnion* addConstantUnion(unsigned long long, const TSourceLoc&, bool literal = false) const; -#ifdef AMD_EXTENSIONS - TIntermConstantUnion* addConstantUnion(short, const TSourceLoc&, bool literal = false) const; - TIntermConstantUnion* addConstantUnion(unsigned short, const TSourceLoc&, bool literal = false) const; - -#endif TIntermConstantUnion* addConstantUnion(bool, const TSourceLoc&, bool literal = false) const; TIntermConstantUnion* addConstantUnion(double, TBasicType, const TSourceLoc&, bool literal = false) const; TIntermConstantUnion* addConstantUnion(const TString*, const TSourceLoc&, bool literal = false) const; TIntermTyped* promoteConstantUnion(TBasicType, TIntermConstantUnion*) const; bool parseConstTree(TIntermNode*, TConstUnionArray, TOperator, const TType&, bool singleConstantParam = false); - TIntermLoop* addLoop(TIntermNode*, TIntermTyped*, TIntermTyped*, bool testFirst, const TSourceLoc&, TLoopControl = ELoopControlNone); - TIntermAggregate* addForLoop(TIntermNode*, TIntermNode*, TIntermTyped*, TIntermTyped*, bool testFirst, const TSourceLoc&, TLoopControl = ELoopControlNone); + TIntermLoop* addLoop(TIntermNode*, TIntermTyped*, TIntermTyped*, bool testFirst, const TSourceLoc&); + TIntermAggregate* addForLoop(TIntermNode*, TIntermNode*, TIntermTyped*, TIntermTyped*, bool testFirst, + const TSourceLoc&, TIntermLoop*&); TIntermBranch* addBranch(TOperator, const TSourceLoc&); TIntermBranch* addBranch(TOperator, TIntermTyped*, const TSourceLoc&); template TIntermTyped* addSwizzle(TSwizzleSelectors&, const TSourceLoc&); @@ -448,9 +467,6 @@ class TIntermediate { TIntermUnary* addUnaryNode(TOperator op, TIntermTyped* child, TSourceLoc) const; TIntermUnary* addUnaryNode(TOperator op, TIntermTyped* child, TSourceLoc, const TType&) const; - // Add conversion from node's type to given basic type. - TIntermTyped* convertToBasicType(TOperator op, TBasicType basicType, TIntermTyped* node) const; - // Constant folding (in Constant.cpp) TIntermTyped* fold(TIntermAggregate* aggrNode); TIntermTyped* foldConstructor(TIntermAggregate* aggrNode); @@ -556,6 +572,9 @@ class TIntermediate { void setDepthReplacing() { depthReplacing = true; } bool isDepthReplacing() const { return depthReplacing; } + void setHlslFunctionality1() { hlslFunctionality1 = true; } + bool getHlslFunctionality1() const { return hlslFunctionality1; } + void addBlendEquation(TBlendEquationShift b) { blendEquations |= (1 << b); } unsigned int getBlendEquations() const { return blendEquations; } @@ -570,7 +589,8 @@ class TIntermediate { int checkLocationRange(int set, const TIoRange& range, const TType&, bool& typeCollision); int addUsedOffsets(int binding, int offset, int numOffsets); bool addUsedConstantId(int id); - int computeTypeLocationSize(const TType&) const; + static int computeTypeLocationSize(const TType&, EShLanguage); + static int computeTypeUniformLocationSize(const TType&); bool setXfbBufferStride(int buffer, unsigned stride) { @@ -579,6 +599,7 @@ class TIntermediate { xfbBuffers[buffer].stride = stride; return true; } + unsigned getXfbStride(int buffer) const { return xfbBuffers[buffer].stride; } int addXfbBufferOffset(const TType&); unsigned int computeTypeXfbSize(const TType&, bool& containsDouble) const; static int getBaseAlignmentScalar(const TType&, int& size); @@ -598,7 +619,7 @@ class TIntermediate { return semanticNameSet.insert(name).first->c_str(); } - void setSourceFile(const char* file) { sourceFile = file; } + void setSourceFile(const char* file) { if (file != nullptr) sourceFile = file; } const std::string& getSourceFile() const { return sourceFile; } void addSourceText(const char* text) { sourceText = sourceText + text; } const std::string& getSourceText() const { return sourceText; } @@ -610,7 +631,11 @@ class TIntermediate { void addProcessArgument(const std::string& arg) { processes.addArgument(arg); } const std::vector& getProcesses() const { return processes.getProcesses(); } + void setNeedsLegalization() { needToLegalize = true; } + bool needsLegalization() const { return needToLegalize; } + const char* const implicitThisName; + const char* const implicitCounterName; protected: TIntermSymbol* addSymbol(int Id, const TString&, const TType&, const TConstUnionArray&, TIntermTyped* subtree, const TSourceLoc&); @@ -626,6 +651,7 @@ class TIntermediate { TIntermSequence& findLinkerObjects() const; bool userOutputUsed() const; bool isSpecializationOperation(const TIntermOperator&) const; + bool isNonuniformPropagating(TOperator) const; bool promoteUnary(TIntermUnary&); bool promoteBinary(TIntermBinary&); void addSymbolLinkageNode(TIntermAggregate*& linkage, TSymbolTable&, const TString&); @@ -634,14 +660,19 @@ class TIntermediate { void pushSelector(TIntermSequence&, const TMatrixSelector&, const TSourceLoc&); bool specConstantPropagates(const TIntermTyped&, const TIntermTyped&); void performTextureUpgradeAndSamplerRemovalTransformation(TIntermNode* root); + bool isConversionAllowed(TOperator op, TIntermTyped* node) const; + TIntermUnary* createConversion(TBasicType convertTo, TIntermTyped* node) const; + std::tuple getConversionDestinatonType(TBasicType type0, TBasicType type1, TOperator op) const; + bool extensionRequested(const char *extension) const {return requestedExtensions.find(extension) != requestedExtensions.end();} + static const char* getResourceName(TResourceType); const EShLanguage language; // stage, known at construction time EShSource source; // source language, known a bit later std::string entryPointName; std::string entryPointMangledName; - EProfile profile; - int version; + EProfile profile; // source profile + int version; // source version SpvVersion spvVersion; TIntermNode* treeRoot; std::set requestedExtensions; // cumulation of all enabled or required extensions; not connected to what subset of the shader used them @@ -665,6 +696,7 @@ class TIntermediate { bool postDepthCoverage; TLayoutDepth depthLayout; bool depthReplacing; + bool hlslFunctionality1; int blendEquations; // an 'or'ing of masks of shifts of TBlendEquationShift bool xfbMode; bool multiStream; @@ -674,15 +706,16 @@ class TIntermediate { bool geoPassthroughEXT; #endif - unsigned int shiftSamplerBinding; - unsigned int shiftTextureBinding; - unsigned int shiftImageBinding; - unsigned int shiftUboBinding; - unsigned int shiftSsboBinding; - unsigned int shiftUavBinding; + // Base shift values + std::array shiftBinding; + + // Per-descriptor-set shift values + std::array, EResCount> shiftBindingForSet; + std::vector resourceSetBinding; bool autoMapBindings; bool autoMapLocations; + bool invertY; bool flattenUniformArrays; bool useUnknownFormat; bool hlslOffsets; @@ -708,6 +741,8 @@ class TIntermediate { // for OpModuleProcessed, or equivalent TProcesses processes; + bool needToLegalize; + private: void operator=(TIntermediate&); // prevent assignments }; diff --git a/deps/glslang/glslang/MachineIndependent/parseVersions.h b/deps/glslang/glslang/MachineIndependent/parseVersions.h index 5f26b437..b2aaa399 100644 --- a/deps/glslang/glslang/MachineIndependent/parseVersions.h +++ b/deps/glslang/glslang/MachineIndependent/parseVersions.h @@ -1,5 +1,6 @@ // // Copyright (C) 2016 Google, Inc. +// Copyright (C) 2017 ARM Limited. // // All rights reserved. // @@ -77,11 +78,16 @@ class TParseVersions { virtual void updateExtensionBehavior(int line, const char* const extension, const char* behavior); virtual void fullIntegerCheck(const TSourceLoc&, const char* op); virtual void doubleCheck(const TSourceLoc&, const char* op); -#ifdef AMD_EXTENSIONS - virtual void int16Check(const TSourceLoc& loc, const char* op, bool builtIn = false); virtual void float16Check(const TSourceLoc&, const char* op, bool builtIn = false); +#ifdef AMD_EXTENSIONS + virtual void float16OpaqueCheck(const TSourceLoc&, const char* op, bool builtIn = false); #endif virtual void int64Check(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void explicitInt8Check(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void explicitInt16Check(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void explicitInt32Check(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void explicitFloat32Check(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void explicitFloat64Check(const TSourceLoc&, const char* op, bool builtIn = false); virtual void spvRemoved(const TSourceLoc&, const char* op); virtual void vulkanRemoved(const TSourceLoc&, const char* op); virtual void requireVulkan(const TSourceLoc&, const char* op); @@ -113,6 +119,7 @@ class TParseVersions { bool relaxedErrors() const { return (messages & EShMsgRelaxedErrors) != 0; } bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; } bool isReadingHLSL() const { return (messages & EShMsgReadHlsl) == EShMsgReadHlsl; } + bool hlslEnable16BitTypes() const { return (messages & EShMsgHlslEnable16BitTypes) != 0; } TInfoSink& infoSink; diff --git a/deps/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp b/deps/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp index ecda34cd..8048fa51 100644 --- a/deps/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp +++ b/deps/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp @@ -84,6 +84,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include "PpContext.h" #include "PpTokens.h" @@ -241,15 +242,20 @@ int TPpContext::CPPelse(int matchelse, TPpToken* ppToken) int nextAtom = atomStrings.getAtom(ppToken->name); if (nextAtom == PpAtomIf || nextAtom == PpAtomIfdef || nextAtom == PpAtomIfndef) { depth++; - ifdepth++; - elsetracker++; + if (ifdepth >= maxIfNesting || elsetracker >= maxIfNesting) { + parseContext.ppError(ppToken->loc, "maximum nesting depth exceeded", "#if/#ifdef/#ifndef", ""); + return EndOfInput; + } else { + ifdepth++; + elsetracker++; + } } else if (nextAtom == PpAtomEndif) { token = extraTokenCheck(nextAtom, ppToken, scanToken(ppToken)); elseSeen[elsetracker] = false; --elsetracker; if (depth == 0) { // found the #endif we are looking for - if (ifdepth) + if (ifdepth > 0) --ifdepth; break; } @@ -266,7 +272,7 @@ int TPpContext::CPPelse(int matchelse, TPpToken* ppToken) parseContext.ppError(ppToken->loc, "#elif after #else", "#elif", ""); /* we decrement ifdepth here, because CPPif will increment * it and we really want to leave it alone */ - if (ifdepth) { + if (ifdepth > 0) { --ifdepth; elseSeen[elsetracker] = false; --elsetracker; @@ -345,8 +351,8 @@ namespace { int op_add(int a, int b) { return a + b; } int op_sub(int a, int b) { return a - b; } int op_mul(int a, int b) { return a * b; } - int op_div(int a, int b) { return a / b; } - int op_mod(int a, int b) { return a % b; } + int op_div(int a, int b) { return a == INT_MIN && b == -1 ? 0 : a / b; } + int op_mod(int a, int b) { return a == INT_MIN && b == -1 ? 0 : a % b; } int op_pos(int a) { return a; } int op_neg(int a) { return -a; } int op_cmpl(int a) { return ~a; } @@ -536,11 +542,12 @@ int TPpContext::evalToToken(int token, bool shortCircuit, int& res, bool& err, T int TPpContext::CPPif(TPpToken* ppToken) { int token = scanToken(ppToken); - elsetracker++; - ifdepth++; - if (ifdepth > maxIfNesting) { + if (ifdepth >= maxIfNesting || elsetracker >= maxIfNesting) { parseContext.ppError(ppToken->loc, "maximum nesting depth exceeded", "#if", ""); - return 0; + return EndOfInput; + } else { + elsetracker++; + ifdepth++; } int res = 0; bool err = false; @@ -556,11 +563,14 @@ int TPpContext::CPPif(TPpToken* ppToken) int TPpContext::CPPifdef(int defined, TPpToken* ppToken) { int token = scanToken(ppToken); - if (++ifdepth > maxIfNesting) { + if (ifdepth > maxIfNesting || elsetracker > maxIfNesting) { parseContext.ppError(ppToken->loc, "maximum nesting depth exceeded", "#ifdef", ""); - return 0; + return EndOfInput; + } else { + elsetracker++; + ifdepth++; } - elsetracker++; + if (token != PpAtomIdentifier) { if (defined) parseContext.ppError(ppToken->loc, "must be followed by macro name", "#ifdef", ""); @@ -721,12 +731,10 @@ int TPpContext::CPPerror(TPpToken* ppToken) TSourceLoc loc = ppToken->loc; while (token != '\n' && token != EndOfInput) { - if (token == PpAtomConstInt || token == PpAtomConstUint || + if (token == PpAtomConstInt16 || token == PpAtomConstUint16 || + token == PpAtomConstInt || token == PpAtomConstUint || token == PpAtomConstInt64 || token == PpAtomConstUint64 || -#ifdef AMD_EXTENSIONS - token == PpAtomConstInt16 || token == PpAtomConstUint16 || token == PpAtomConstFloat16 || -#endif token == PpAtomConstFloat || token == PpAtomConstDouble) { message.append(ppToken->name); } else if (token == PpAtomIdentifier || token == PpAtomConstString) { @@ -765,9 +773,7 @@ int TPpContext::CPPpragma(TPpToken* ppToken) #endif case PpAtomConstFloat: case PpAtomConstDouble: -#ifdef AMD_EXTENSIONS case PpAtomConstFloat16: -#endif tokens.push_back(ppToken->name); break; default: @@ -886,16 +892,16 @@ int TPpContext::readCPPline(TPpToken* ppToken) token = CPPdefine(ppToken); break; case PpAtomElse: - if (elsetracker[elseSeen]) + if (elseSeen[elsetracker]) parseContext.ppError(ppToken->loc, "#else after #else", "#else", ""); - elsetracker[elseSeen] = true; - if (! ifdepth) + elseSeen[elsetracker] = true; + if (ifdepth == 0) parseContext.ppError(ppToken->loc, "mismatched statements", "#else", ""); token = extraTokenCheck(PpAtomElse, ppToken, scanToken(ppToken)); token = CPPelse(0, ppToken); break; case PpAtomElif: - if (! ifdepth) + if (ifdepth == 0) parseContext.ppError(ppToken->loc, "mismatched statements", "#elif", ""); if (elseSeen[elsetracker]) parseContext.ppError(ppToken->loc, "#elif after #else", "#elif", ""); @@ -906,7 +912,7 @@ int TPpContext::readCPPline(TPpToken* ppToken) token = CPPelse(0, ppToken); break; case PpAtomEndif: - if (! ifdepth) + if (ifdepth == 0) parseContext.ppError(ppToken->loc, "mismatched statements", "#endif", ""); else { elseSeen[elsetracker] = false; @@ -1147,7 +1153,6 @@ int TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOka } MacroSymbol* macro = macroAtom == 0 ? nullptr : lookupMacroDef(macroAtom); - int token; int depth = 0; // no recursive expansions @@ -1169,13 +1174,12 @@ int TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOka TSourceLoc loc = ppToken->loc; // in case we go to the next line before discovering the error in->mac = macro; if (macro->args.size() > 0 || macro->emptyArgs) { - token = scanToken(ppToken); + int token = scanToken(ppToken); if (newLineOkay) { while (token == '\n') token = scanToken(ppToken); } if (token != '(') { - parseContext.ppError(loc, "expected '(' following", "macro expansion", atomStrings.getString(macroAtom)); UngetToken(token, ppToken); delete in; return 0; diff --git a/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.h b/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.h index de48e279..854bbbad 100644 --- a/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.h +++ b/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.h @@ -309,7 +309,7 @@ class TPpContext { bool endOfReplacementList() { return inputStack.empty() || inputStack.back()->endOfReplacementList(); } bool isMacroInput() { return inputStack.size() > 0 && inputStack.back()->isMacroInput(); } - static const int maxIfNesting = 64; + static const int maxIfNesting = 65; int ifdepth; // current #if-#else-#endif nesting in the cpp.c file (pre-processor) bool elseSeen[maxIfNesting]; // Keep a track of whether an else has been seen at a particular depth diff --git a/deps/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp b/deps/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp index fa01549d..f4eaf57d 100644 --- a/deps/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp +++ b/deps/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2017 ARM Limited. // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -103,17 +104,6 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken) { bool HasDecimalOrExponent = false; int isDouble = 0; - bool generateFloat16 = false; - bool acceptFloat16 = parseContext.intermediate.getSource() == EShSourceHlsl; - bool isFloat16 = false; - bool requireHF = false; -#ifdef AMD_EXTENSIONS - if (parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float)) { - acceptFloat16 = true; - generateFloat16 = true; - requireHF = true; - } -#endif const auto saveName = [&](int ch) { if (len <= MaxTokenLength) @@ -128,7 +118,7 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken) ch = getChar(); // 1.#INF or -1.#INF - if (ch == '#') { + if (ch == '#' && (ifdepth > 0 || parseContext.intermediate.getSource() == EShSourceHlsl)) { if ((len < 2) || (len == 2 && ppToken->name[0] != '1') || (len == 3 && ppToken->name[1] != '1' && !(ppToken->name[0] == '-' || ppToken->name[0] == '+')) || @@ -182,28 +172,32 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken) } // Suffix: - + bool isFloat16 = false; if (ch == 'l' || ch == 'L') { - parseContext.doubleCheck(ppToken->loc, "double floating-point suffix"); - if (! HasDecimalOrExponent) + if (ifdepth == 0 && parseContext.intermediate.getSource() == EShSourceGlsl) + parseContext.doubleCheck(ppToken->loc, "double floating-point suffix"); + if (ifdepth == 0 && !HasDecimalOrExponent) parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", ""); - int ch2 = getChar(); - if (ch2 != 'f' && ch2 != 'F') { - ungetChar(); - ungetChar(); - } else { + if (parseContext.intermediate.getSource() == EShSourceGlsl) { + int ch2 = getChar(); + if (ch2 != 'f' && ch2 != 'F') { + ungetChar(); + ungetChar(); + } else { + saveName(ch); + saveName(ch2); + isDouble = 1; + } + } else if (parseContext.intermediate.getSource() == EShSourceHlsl) { saveName(ch); - saveName(ch2); isDouble = 1; } - } else if (acceptFloat16 && (ch == 'h' || ch == 'H')) { -#ifdef AMD_EXTENSIONS - if (generateFloat16) + } else if (ch == 'h' || ch == 'H') { + if (ifdepth == 0 && parseContext.intermediate.getSource() == EShSourceGlsl) parseContext.float16Check(ppToken->loc, "half floating-point suffix"); -#endif - if (!HasDecimalOrExponent) + if (ifdepth == 0 && !HasDecimalOrExponent) parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", ""); - if (requireHF) { + if (parseContext.intermediate.getSource() == EShSourceGlsl) { int ch2 = getChar(); if (ch2 != 'f' && ch2 != 'F') { ungetChar(); @@ -211,17 +205,18 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken) } else { saveName(ch); saveName(ch2); - isFloat16 = generateFloat16; + isFloat16 = true; } - } else { + } else if (parseContext.intermediate.getSource() == EShSourceHlsl) { saveName(ch); - isFloat16 = generateFloat16; + isFloat16 = true; } } else if (ch == 'f' || ch == 'F') { - parseContext.profileRequires(ppToken->loc, EEsProfile, 300, nullptr, "floating-point suffix"); - if (! parseContext.relaxedErrors()) + if (ifdepth == 0) + parseContext.profileRequires(ppToken->loc, EEsProfile, 300, nullptr, "floating-point suffix"); + if (ifdepth == 0 && !parseContext.relaxedErrors()) parseContext.profileRequires(ppToken->loc, ~EEsProfile, 120, nullptr, "floating-point suffix"); - if (! HasDecimalOrExponent) + if (ifdepth == 0 && !HasDecimalOrExponent) parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", ""); saveName(ch); } else @@ -333,19 +328,23 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) int ch = 0; int ii = 0; unsigned long long ival = 0; - bool enableInt64 = pp->parseContext.version >= 450 && pp->parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_int64); -#ifdef AMD_EXTENSIONS - bool enableInt16 = pp->parseContext.version >= 450 && pp->parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_int16); -#endif - bool acceptHalf = pp->parseContext.intermediate.getSource() == EShSourceHlsl; -#ifdef AMD_EXTENSIONS - if (pp->parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float)) - acceptHalf = true; -#endif - const auto floatingPointChar = [&](int ch) { return ch == '.' || ch == 'e' || ch == 'E' || ch == 'f' || ch == 'F' || - (acceptHalf && (ch == 'h' || ch == 'H')); }; + ch == 'h' || ch == 'H'; }; + + static const char* const Int64_Extensions[] = { + E_GL_ARB_gpu_shader_int64, + E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_int64 }; + static const int Num_Int64_Extensions = sizeof(Int64_Extensions) / sizeof(Int64_Extensions[0]); + + static const char* const Int16_Extensions[] = { +#ifdef AMD_EXTENSIONS + E_GL_AMD_gpu_shader_int16, +#endif + E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_int16 }; + static const int Num_Int16_Extensions = sizeof(Int16_Extensions) / sizeof(Int16_Extensions[0]); ppToken->ival = 0; ppToken->i64val = 0; @@ -409,9 +408,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) bool isUnsigned = false; bool isInt64 = false; -#ifdef AMD_EXTENSIONS bool isInt16 = false; -#endif ppToken->name[len++] = (char)ch; ch = getch(); if ((ch >= '0' && ch <= '9') || @@ -420,7 +417,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) ival = 0; do { - if (ival <= 0x0fffffffu || (enableInt64 && ival <= 0x0fffffffffffffffull)) { + if (len < MaxTokenLength && ival <= 0x0fffffffffffffffull) { ppToken->name[len++] = (char)ch; if (ch >= '0' && ch <= '9') { ii = ch - '0'; @@ -433,7 +430,10 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) ival = (ival << 4) | ii; } else { if (! AlreadyComplained) { - pp->parseContext.ppError(ppToken->loc, "hexadecimal literal too big", "", ""); + if(len < MaxTokenLength) + pp->parseContext.ppError(ppToken->loc, "hexadecimal literal too big", "", ""); + else + pp->parseContext.ppError(ppToken->loc, "hexadecimal literal too long", "", ""); AlreadyComplained = 1; } ival = 0xffffffffffffffffull; @@ -450,33 +450,31 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) ppToken->name[len++] = (char)ch; isUnsigned = true; - if (enableInt64) { - int nextCh = getch(); - if ((ch == 'u' && nextCh == 'l') || (ch == 'U' && nextCh == 'L')) { - if (len < MaxTokenLength) - ppToken->name[len++] = (char)nextCh; - isInt64 = true; - } else - ungetch(); - } + int nextCh = getch(); + if (nextCh == 'l' || nextCh == 'L') { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt64 = true; + } else + ungetch(); #ifdef AMD_EXTENSIONS - if (enableInt16) { - int nextCh = getch(); - if ((ch == 'u' && nextCh == 's') || (ch == 'U' && nextCh == 'S')) { - if (len < MaxTokenLength) - ppToken->name[len++] = (char)nextCh; - isInt16 = true; - } else - ungetch(); - } + nextCh = getch(); + if ((nextCh == 's' || nextCh == 'S') && + pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt16 = true; + } else + ungetch(); #endif - } else if (enableInt64 && (ch == 'l' || ch == 'L')) { + } else if (ch == 'l' || ch == 'L') { if (len < MaxTokenLength) ppToken->name[len++] = (char)ch; isInt64 = true; #ifdef AMD_EXTENSIONS - } else if (enableInt16 && (ch == 's' || ch == 'S')) { + } else if ((ch == 's' || ch == 'S') && + pp->parseContext.intermediate.getSource() == EShSourceGlsl) { if (len < MaxTokenLength) ppToken->name[len++] = (char)ch; isInt16 = true; @@ -485,15 +483,29 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) ungetch(); ppToken->name[len] = '\0'; - if (isInt64) { + if (isInt64 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (pp->ifdepth == 0) { + pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, + "64-bit hexadecimal literal"); + pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, + Num_Int64_Extensions, Int64_Extensions, "64-bit hexadecimal literal"); + } ppToken->i64val = ival; return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64; -#ifdef AMD_EXTENSIONS } else if (isInt16) { + if (pp->ifdepth == 0) { + if (pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, + "16-bit hexadecimal literal"); + pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, + Num_Int16_Extensions, Int16_Extensions, "16-bit hexadecimal literal"); + } + } ppToken->ival = (int)ival; return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16; -#endif } else { + if (ival > 0xffffffffu && !AlreadyComplained) + pp->parseContext.ppError(ppToken->loc, "hexadecimal literal too big", "", ""); ppToken->ival = (int)ival; return isUnsigned ? PpAtomConstUint : PpAtomConstInt; } @@ -502,9 +514,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) bool isUnsigned = false; bool isInt64 = false; -#ifdef AMD_EXTENSIONS bool isInt16 = false; -#endif bool octalOverflow = false; bool nonOctal = false; ival = 0; @@ -517,7 +527,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) pp->parseContext.ppError(ppToken->loc, "numeric literal too long", "", ""); AlreadyComplained = 1; } - if (ival <= 0x1fffffffu || (enableInt64 && ival <= 0x1fffffffffffffffull)) { + if (ival <= 0x1fffffffffffffffull) { ii = ch - '0'; ival = (ival << 3) | ii; } else @@ -550,33 +560,31 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) ppToken->name[len++] = (char)ch; isUnsigned = true; - if (enableInt64) { - int nextCh = getch(); - if ((ch == 'u' && nextCh == 'l') || (ch == 'U' && nextCh == 'L')) { - if (len < MaxTokenLength) - ppToken->name[len++] = (char)nextCh; - isInt64 = true; - } else - ungetch(); - } + int nextCh = getch(); + if (nextCh == 'l' || nextCh == 'L') { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt64 = true; + } else + ungetch(); #ifdef AMD_EXTENSIONS - if (enableInt16) { - int nextCh = getch(); - if ((ch == 'u' && nextCh == 's') || (ch == 'U' && nextCh == 'S')) { - if (len < MaxTokenLength) - ppToken->name[len++] = (char)nextCh; - isInt16 = true; - } else - ungetch(); - } + nextCh = getch(); + if ((nextCh == 's' || nextCh == 'S') && + pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt16 = true; + } else + ungetch(); #endif - } else if (enableInt64 && (ch == 'l' || ch == 'L')) { + } else if (ch == 'l' || ch == 'L') { if (len < MaxTokenLength) ppToken->name[len++] = (char)ch; isInt64 = true; #ifdef AMD_EXTENSIONS - } else if (enableInt16 && (ch == 's' || ch == 'S')) { + } else if ((ch == 's' || ch == 'S') && + pp->parseContext.intermediate.getSource() == EShSourceGlsl) { if (len < MaxTokenLength) ppToken->name[len++] = (char)ch; isInt16 = true; @@ -585,17 +593,32 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) ungetch(); ppToken->name[len] = '\0'; + if (!isInt64 && ival > 0xffffffffu) + octalOverflow = true; + if (octalOverflow) pp->parseContext.ppError(ppToken->loc, "octal literal too big", "", ""); - if (isInt64) { + if (isInt64 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (pp->ifdepth == 0) { + pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, + "64-bit octal literal"); + pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, + Num_Int64_Extensions, Int64_Extensions, "64-bit octal literal"); + } ppToken->i64val = ival; return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64; -#ifdef AMD_EXTENSIONS } else if (isInt16) { + if (pp->ifdepth == 0) { + if (pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, + "16-bit octal literal"); + pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, + Num_Int16_Extensions, Int16_Extensions, "16-bit octal literal"); + } + } ppToken->ival = (int)ival; return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16; -#endif } else { ppToken->ival = (int)ival; return isUnsigned ? PpAtomConstUint : PpAtomConstInt; @@ -622,41 +645,37 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) int numericLen = len; bool isUnsigned = false; bool isInt64 = false; -#ifdef AMD_EXTENSIONS bool isInt16 = false; -#endif if (ch == 'u' || ch == 'U') { if (len < MaxTokenLength) ppToken->name[len++] = (char)ch; isUnsigned = true; - if (enableInt64) { - int nextCh = getch(); - if ((ch == 'u' && nextCh == 'l') || (ch == 'U' && nextCh == 'L')) { - if (len < MaxTokenLength) - ppToken->name[len++] = (char)nextCh; - isInt64 = true; - } else - ungetch(); - } + int nextCh = getch(); + if (nextCh == 'l' || nextCh == 'L') { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt64 = true; + } else + ungetch(); #ifdef AMD_EXTENSIONS - if (enableInt16) { - int nextCh = getch(); - if ((ch == 'u' && nextCh == 's') || (ch == 'U' && nextCh == 'S')) { - if (len < MaxTokenLength) - ppToken->name[len++] = (char)nextCh; - isInt16 = true; - } else - ungetch(); - } + nextCh = getch(); + if ((nextCh == 's' || nextCh == 'S') && + pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt16 = true; + } else + ungetch(); #endif - } else if (enableInt64 && (ch == 'l' || ch == 'L')) { + } else if (ch == 'l' || ch == 'L') { if (len < MaxTokenLength) ppToken->name[len++] = (char)ch; isInt64 = true; #ifdef AMD_EXTENSIONS - } else if (enableInt16 && (ch == 's' || ch == 'S')) { + } else if ((ch == 's' || ch == 'S') && + pp->parseContext.intermediate.getSource() == EShSourceGlsl) { if (len < MaxTokenLength) ppToken->name[len++] = (char)ch; isInt16 = true; @@ -670,19 +689,15 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) const unsigned remainderMaxInt = 0xFFFFFFFFu - 10 * oneTenthMaxInt; const unsigned long long oneTenthMaxInt64 = 0xFFFFFFFFFFFFFFFFull / 10; const unsigned long long remainderMaxInt64 = 0xFFFFFFFFFFFFFFFFull - 10 * oneTenthMaxInt64; -#ifdef AMD_EXTENSIONS const unsigned short oneTenthMaxInt16 = 0xFFFFu / 10; const unsigned short remainderMaxInt16 = 0xFFFFu - 10 * oneTenthMaxInt16; -#endif for (int i = 0; i < numericLen; i++) { ch = ppToken->name[i] - '0'; bool overflow = false; if (isInt64) overflow = (ival > oneTenthMaxInt64 || (ival == oneTenthMaxInt64 && (unsigned long long)ch > remainderMaxInt64)); -#ifdef AMD_EXTENSIONS else if (isInt16) overflow = (ival > oneTenthMaxInt16 || (ival == oneTenthMaxInt16 && (unsigned short)ch > remainderMaxInt16)); -#endif else overflow = (ival > oneTenthMaxInt || (ival == oneTenthMaxInt && (unsigned)ch > remainderMaxInt)); if (overflow) { @@ -693,14 +708,24 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) ival = ival * 10 + ch; } - if (isInt64) { + if (isInt64 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + if (pp->ifdepth == 0) { + pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, + "64-bit literal"); + pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, + Num_Int64_Extensions, Int64_Extensions, "64-bit literal"); + } ppToken->i64val = ival; return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64; -#ifdef AMD_EXTENSIONS } else if (isInt16) { + if (pp->ifdepth == 0 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) { + pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, + "16-bit literal"); + pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, + Num_Int16_Extensions, Int16_Extensions, "16-bit literal"); + } ppToken->ival = (int)ival; return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16; -#endif } else { ppToken->ival = (int)ival; return isUnsigned ? PpAtomConstUint : PpAtomConstInt; @@ -950,19 +975,15 @@ int TPpContext::tokenize(TPpToken& ppToken) case PpAtomConstFloat: case PpAtomConstInt64: case PpAtomConstUint64: -#ifdef AMD_EXTENSIONS case PpAtomConstInt16: case PpAtomConstUint16: -#endif case PpAtomConstDouble: -#ifdef AMD_EXTENSIONS case PpAtomConstFloat16: -#endif if (ppToken.name[0] == '\0') continue; break; case PpAtomConstString: - if (parseContext.intermediate.getSource() != EShSourceHlsl) { + if (ifdepth == 0 && parseContext.intermediate.getSource() != EShSourceHlsl) { // HLSL allows string literals. parseContext.ppError(ppToken.loc, "string literals not supported", "\"\"", ""); continue; diff --git a/deps/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp b/deps/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp index bc145e25..31e0d1f9 100644 --- a/deps/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp +++ b/deps/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp @@ -147,9 +147,7 @@ void TPpContext::TokenStream::putToken(int token, TPpToken* ppToken) #endif case PpAtomConstFloat: case PpAtomConstDouble: -#ifdef AMD_EXTENSIONS case PpAtomConstFloat16: -#endif str = ppToken->name; while (*str) { putSubtoken(*str); @@ -187,9 +185,7 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken case PpAtomIdentifier: case PpAtomConstFloat: case PpAtomConstDouble: -#ifdef AMD_EXTENSIONS case PpAtomConstFloat16: -#endif case PpAtomConstInt: case PpAtomConstUint: case PpAtomConstInt64: @@ -219,9 +215,7 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken break; case PpAtomConstFloat: case PpAtomConstDouble: -#ifdef AMD_EXTENSIONS case PpAtomConstFloat16: -#endif ppToken->dval = atof(ppToken->name); break; case PpAtomConstInt: diff --git a/deps/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h b/deps/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h index d56df576..7b0f8155 100644 --- a/deps/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h +++ b/deps/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h @@ -127,10 +127,8 @@ enum EFixedAtoms { PpAtomConstUint, PpAtomConstInt64, PpAtomConstUint64, -#ifdef AMD_EXTENSIONS PpAtomConstInt16, PpAtomConstUint16, -#endif PpAtomConstFloat, PpAtomConstDouble, PpAtomConstFloat16, diff --git a/deps/glslang/glslang/MachineIndependent/reflection.cpp b/deps/glslang/glslang/MachineIndependent/reflection.cpp index 50fb6027..4818b108 100644 --- a/deps/glslang/glslang/MachineIndependent/reflection.cpp +++ b/deps/glslang/glslang/MachineIndependent/reflection.cpp @@ -415,6 +415,36 @@ class TReflectionTraverser : public TLiveTraverser { case EsdBuffer: return GL_SAMPLER_BUFFER; } +#ifdef AMD_EXTENSIONS + case EbtFloat16: + switch ((int)sampler.dim) { + case Esd1D: + switch ((int)sampler.shadow) { + case false: return sampler.arrayed ? GL_FLOAT16_SAMPLER_1D_ARRAY_AMD : GL_FLOAT16_SAMPLER_1D_AMD; + case true: return sampler.arrayed ? GL_FLOAT16_SAMPLER_1D_ARRAY_SHADOW_AMD : GL_FLOAT16_SAMPLER_1D_SHADOW_AMD; + } + case Esd2D: + switch ((int)sampler.ms) { + case false: + switch ((int)sampler.shadow) { + case false: return sampler.arrayed ? GL_FLOAT16_SAMPLER_2D_ARRAY_AMD : GL_FLOAT16_SAMPLER_2D_AMD; + case true: return sampler.arrayed ? GL_FLOAT16_SAMPLER_2D_ARRAY_SHADOW_AMD : GL_FLOAT16_SAMPLER_2D_SHADOW_AMD; + } + case true: return sampler.arrayed ? GL_FLOAT16_SAMPLER_2D_MULTISAMPLE_ARRAY_AMD : GL_FLOAT16_SAMPLER_2D_MULTISAMPLE_AMD; + } + case Esd3D: + return GL_FLOAT16_SAMPLER_3D_AMD; + case EsdCube: + switch ((int)sampler.shadow) { + case false: return sampler.arrayed ? GL_FLOAT16_SAMPLER_CUBE_MAP_ARRAY_AMD : GL_FLOAT16_SAMPLER_CUBE_AMD; + case true: return sampler.arrayed ? GL_FLOAT16_SAMPLER_CUBE_MAP_ARRAY_SHADOW_AMD : GL_FLOAT16_SAMPLER_CUBE_SHADOW_AMD; + } + case EsdRect: + return sampler.shadow ? GL_FLOAT16_SAMPLER_2D_RECT_SHADOW_AMD : GL_FLOAT16_SAMPLER_2D_RECT_AMD; + case EsdBuffer: + return GL_FLOAT16_SAMPLER_BUFFER_AMD; + } +#endif case EbtInt: switch ((int)sampler.dim) { case Esd1D: @@ -477,6 +507,26 @@ class TReflectionTraverser : public TLiveTraverser { case EsdBuffer: return GL_IMAGE_BUFFER; } +#ifdef AMD_EXTENSIONS + case EbtFloat16: + switch ((int)sampler.dim) { + case Esd1D: + return sampler.arrayed ? GL_FLOAT16_IMAGE_1D_ARRAY_AMD : GL_FLOAT16_IMAGE_1D_AMD; + case Esd2D: + switch ((int)sampler.ms) { + case false: return sampler.arrayed ? GL_FLOAT16_IMAGE_2D_ARRAY_AMD : GL_FLOAT16_IMAGE_2D_AMD; + case true: return sampler.arrayed ? GL_FLOAT16_IMAGE_2D_MULTISAMPLE_ARRAY_AMD : GL_FLOAT16_IMAGE_2D_MULTISAMPLE_AMD; + } + case Esd3D: + return GL_FLOAT16_IMAGE_3D_AMD; + case EsdCube: + return sampler.arrayed ? GL_FLOAT16_IMAGE_CUBE_MAP_ARRAY_AMD : GL_FLOAT16_IMAGE_CUBE_AMD; + case EsdRect: + return GL_FLOAT16_IMAGE_2D_RECT_AMD; + case EsdBuffer: + return GL_FLOAT16_IMAGE_BUFFER_AMD; + } +#endif case EbtInt: switch ((int)sampler.dim) { case Esd1D: @@ -716,11 +766,11 @@ void TReflection::buildAttributeReflection(EShLanguage stage, const TIntermediat } // build counter block index associations for buffers -void TReflection::buildCounterIndices() +void TReflection::buildCounterIndices(const TIntermediate& intermediate) { // search for ones that have counters for (int i = 0; i < int(indexToUniformBlock.size()); ++i) { - const TString counterName(indexToUniformBlock[i].name + "@count"); + const TString counterName(intermediate.addCounterBufferName(indexToUniformBlock[i].name)); const int index = getIndex(counterName); if (index >= 0) @@ -752,7 +802,7 @@ bool TReflection::addStage(EShLanguage stage, const TIntermediate& intermediate) function->traverse(&it); } - buildCounterIndices(); + buildCounterIndices(intermediate); return true; } diff --git a/deps/glslang/glslang/MachineIndependent/reflection.h b/deps/glslang/glslang/MachineIndependent/reflection.h index fedfbe8d..bf233e33 100644 --- a/deps/glslang/glslang/MachineIndependent/reflection.h +++ b/deps/glslang/glslang/MachineIndependent/reflection.h @@ -156,7 +156,7 @@ class TReflection { protected: friend class glslang::TReflectionTraverser; - void buildCounterIndices(); + void buildCounterIndices(const TIntermediate&); void buildAttributeReflection(EShLanguage, const TIntermediate&); // Need a TString hash: typedef std::unordered_map TNameToIndex; diff --git a/deps/glslang/glslang/Public/ShaderLang.h b/deps/glslang/glslang/Public/ShaderLang.h index b36e384f..911fc310 100644 --- a/deps/glslang/glslang/Public/ShaderLang.h +++ b/deps/glslang/glslang/Public/ShaderLang.h @@ -67,16 +67,20 @@ extern "C" { #endif +// This should always increase, as some paths to do not consume +// a more major number. +// It should increment by one when new functionality is added. +#define GLSLANG_MINOR_VERSION 6 + // -// Driver must call this first, once, before doing any other -// compiler/linker operations. +// Call before doing any other compiler/linker operations. // // (Call once per process, not once per thread.) // SH_IMPORT_EXPORT int ShInitialize(); // -// Driver should call this at process shutdown. +// Call this at process shutdown to clean up memory. // SH_IMPORT_EXPORT int __fastcall ShFinalize(); @@ -120,9 +124,23 @@ typedef enum { typedef enum { EShTargetNone, - EshTargetSpv, + EShTargetSpv, // preferred spelling + EshTargetSpv = EShTargetSpv, // legacy spelling } EShTargetLanguage; +typedef enum { + EShTargetVulkan_1_0 = (1 << 22), + EShTargetVulkan_1_1 = (1 << 22) | (1 << 12), + EShTargetOpenGL_450 = 450, +} EShTargetClientVersion; + +typedef EShTargetClientVersion EshTargetClientVersion; + +typedef enum { + EShTargetSpv_1_0 = (1 << 16), + EShTargetSpv_1_3 = (1 << 16) | (3 << 8), +} EShTargetLanguageVersion; + struct TInputLanguage { EShSource languageFamily; // redundant information with other input, this one overrides when not EShSourceNone EShLanguage stage; // redundant information with other input, this one overrides when not EShSourceNone @@ -132,12 +150,13 @@ struct TInputLanguage { struct TClient { EShClient client; - int version; // version of client itself (not the client's input dialect) + EShTargetClientVersion version; // version of client itself (not the client's input dialect) }; struct TTarget { EShTargetLanguage language; - unsigned int version; // the version to target, if SPIR-V, defined by "word 1" of the SPIR-V binary header + EShTargetLanguageVersion version; // version to target, if SPIR-V, defined by "word 1" of the SPIR-V header + bool hlslFunctionality1; // can target hlsl_functionality1 extension(s) }; // All source/client/target versions and settings. @@ -195,6 +214,8 @@ enum EShMessages { EShMsgKeepUncalled = (1 << 8), // for testing, don't eliminate uncalled functions EShMsgHlslOffsets = (1 << 9), // allow block offsets to follow HLSL rules instead of GLSL rules EShMsgDebugInfo = (1 << 10), // save debug information + EShMsgHlslEnable16BitTypes = (1 << 11), // enable use of 16-bit types in SPIR-V for HLSL + EShMsgHlslLegalization = (1 << 12), // enable HLSL Legalization messages }; // @@ -290,7 +311,7 @@ SH_IMPORT_EXPORT int ShGetUniformLocation(const ShHandle uniformMap, const char* // Deferred-Lowering C++ Interface // ----------------------------------- // -// Below is a new alternate C++ interface that might potentially replace the above +// Below is a new alternate C++ interface, which deprecates the above // opaque handle-based interface. // // The below is further designed to handle multiple compilation units per stage, where @@ -324,11 +345,26 @@ bool InitializeProcess(); // Call once per process to tear down everything void FinalizeProcess(); -// Make one TShader per shader that you will link into a program. Then provide -// the shader through setStrings() or setStringsWithLengths(), then call parse(), -// then query the info logs. -// Optionally use setPreamble() to set a special shader string that will be -// processed before all others but won't affect the validity of #version. +// Resource type for IO resolver +enum TResourceType { + EResSampler, + EResTexture, + EResImage, + EResUbo, + EResSsbo, + EResUav, + EResCount +}; + +// Make one TShader per shader that you will link into a program. Then +// - provide the shader through setStrings() or setStringsWithLengths() +// - optionally call setEnv*(), see below for more detail +// - optionally use setPreamble() to set a special shader string that will be +// processed before all others but won't affect the validity of #version +// - call parse(): source language and target environment must be selected +// either by correct setting of EShMessages sent to parse(), or by +// explicitly calling setEnv*() +// - query the info logs // // N.B.: Does not yet support having the same TShader instance being linked into // multiple programs. @@ -347,22 +383,30 @@ class TShader { void setEntryPoint(const char* entryPoint); void setSourceEntryPoint(const char* sourceEntryPointName); void addProcesses(const std::vector&); - void setShiftSamplerBinding(unsigned int base); - void setShiftTextureBinding(unsigned int base); - void setShiftImageBinding(unsigned int base); - void setShiftUboBinding(unsigned int base); - void setShiftUavBinding(unsigned int base); - void setShiftCbufferBinding(unsigned int base); // synonym for setShiftUboBinding - void setShiftSsboBinding(unsigned int base); + + // IO resolver binding data: see comments in ShaderLang.cpp + void setShiftBinding(TResourceType res, unsigned int base); + void setShiftSamplerBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftTextureBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftImageBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftUboBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftUavBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftCbufferBinding(unsigned int base); // synonym for setShiftUboBinding + void setShiftSsboBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftBindingForSet(TResourceType res, unsigned int base, unsigned int set); void setResourceSetBinding(const std::vector& base); void setAutoMapBindings(bool map); void setAutoMapLocations(bool map); + void setInvertY(bool invert); void setHlslIoMapping(bool hlslIoMap); void setFlattenUniformArrays(bool flatten); void setNoStorageFormat(bool useUnknownFormat); void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode); - // For setting up the environment (initialized in the constructor): + // For setting up the environment (cleared to nothingness in the constructor). + // These must be called so that parsing is done for the right source language and + // target environment, either indirectly through TranslateEnvironment() based on + // EShMessages et. al., or directly by the user. void setEnvInput(EShSource lang, EShLanguage envStage, EShClient client, int version) { environment.input.languageFamily = lang; @@ -370,16 +414,18 @@ class TShader { environment.input.dialect = client; environment.input.dialectVersion = version; } - void setEnvClient(EShClient client, int version) + void setEnvClient(EShClient client, EShTargetClientVersion version) { environment.client.client = client; environment.client.version = version; } - void setEnvTarget(EShTargetLanguage lang, unsigned int version) + void setEnvTarget(EShTargetLanguage lang, EShTargetLanguageVersion version) { environment.target.language = lang; environment.target.version = version; } + void setEnvTargetHlslFunctionality1() { environment.target.hlslFunctionality1 = true; } + bool getEnvTargetHlslFunctionality1() const { return environment.target.hlslFunctionality1; } // Interface to #include handlers. // @@ -493,8 +539,8 @@ class TShader { const char* getInfoLog(); const char* getInfoDebugLog(); - EShLanguage getStage() const { return stage; } + TIntermediate* getIntermediate() const { return intermediate; } protected: TPoolAllocator* pool; @@ -625,6 +671,7 @@ class TProgram { int getUniformBlockSize(int blockIndex) const; // can be used for glGetActiveUniformBlockiv(UNIFORM_BLOCK_DATA_SIZE) int getUniformIndex(const char* name) const; // can be used for glGetUniformIndices() int getUniformBinding(int index) const; // returns the binding number + int getUniformBlockBinding(int index) const; // returns the block binding number int getUniformBlockIndex(int index) const; // can be used for glGetActiveUniformsiv(GL_UNIFORM_BLOCK_INDEX) int getUniformBlockCounterIndex(int index) const; // returns block index of associated counter. int getUniformType(int index) const; // can be used for glGetActiveUniformsiv(GL_UNIFORM_TYPE) diff --git a/deps/glslang/hlsl/CMakeLists.txt b/deps/glslang/hlsl/CMakeLists.txt index 3160dbff..a3b643f0 100644 --- a/deps/glslang/hlsl/CMakeLists.txt +++ b/deps/glslang/hlsl/CMakeLists.txt @@ -7,7 +7,7 @@ set(SOURCES hlslGrammar.cpp hlslParseables.cpp) - set(HEADERS +set(HEADERS hlslAttributes.h hlslParseHelper.h hlslTokens.h @@ -17,9 +17,19 @@ set(SOURCES hlslGrammar.h hlslParseables.h) -add_library(HLSL STATIC ${SOURCES} ${HEADERS}) +add_library(HLSL ${LIB_TYPE} ${SOURCES} ${HEADERS}) set_property(TARGET HLSL PROPERTY FOLDER hlsl) +set_property(TARGET HLSL PROPERTY POSITION_INDEPENDENT_CODE ON) + +if(WIN32 AND BUILD_SHARED_LIBS) + set_target_properties(HLSL PROPERTIES PREFIX "") +endif() if(WIN32) source_group("Source" FILES ${SOURCES} ${HEADERS}) endif(WIN32) + +if(ENABLE_GLSLANG_INSTALL) + install(TARGETS HLSL + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +endif(ENABLE_GLSLANG_INSTALL) diff --git a/deps/glslang/hlsl/hlslAttributes.cpp b/deps/glslang/hlsl/hlslAttributes.cpp index 14f7a7bd..261cec34 100644 --- a/deps/glslang/hlsl/hlslAttributes.cpp +++ b/deps/glslang/hlsl/hlslAttributes.cpp @@ -34,85 +34,73 @@ // #include "hlslAttributes.h" -#include -#include +#include "hlslParseHelper.h" namespace glslang { // Map the given string to an attribute enum from TAttributeType, // or EatNone if invalid. - TAttributeType TAttributeMap::attributeFromName(const TString& name) + TAttributeType HlslParseContext::attributeFromName(const TString& nameSpace, const TString& name) const { - // These are case insensitive. - TString lowername(name); - std::transform(lowername.begin(), lowername.end(), lowername.begin(), ::tolower); + // handle names within a namespace - if (lowername == "allow_uav_condition") + if (nameSpace == "vk") { + if (name == "input_attachment_index") + return EatInputAttachment; + else if (name == "location") + return EatLocation; + else if (name == "binding") + return EatBinding; + else if (name == "global_cbuffer_binding") + return EatGlobalBinding; + else if (name == "builtin") + return EatBuiltIn; + else if (name == "constant_id") + return EatConstantId; + else if (name == "push_constant") + return EatPushConstant; + } else if (nameSpace.size() > 0) + return EatNone; + + // handle names with no namespace + + if (name == "allow_uav_condition") return EatAllow_uav_condition; - else if (lowername == "branch") + else if (name == "branch") return EatBranch; - else if (lowername == "call") + else if (name == "call") return EatCall; - else if (lowername == "domain") + else if (name == "domain") return EatDomain; - else if (lowername == "earlydepthstencil") + else if (name == "earlydepthstencil") return EatEarlyDepthStencil; - else if (lowername == "fastopt") + else if (name == "fastopt") return EatFastOpt; - else if (lowername == "flatten") + else if (name == "flatten") return EatFlatten; - else if (lowername == "forcecase") + else if (name == "forcecase") return EatForceCase; - else if (lowername == "instance") + else if (name == "instance") return EatInstance; - else if (lowername == "maxtessfactor") + else if (name == "maxtessfactor") return EatMaxTessFactor; - else if (lowername == "maxvertexcount") + else if (name == "maxvertexcount") return EatMaxVertexCount; - else if (lowername == "numthreads") + else if (name == "numthreads") return EatNumThreads; - else if (lowername == "outputcontrolpoints") + else if (name == "outputcontrolpoints") return EatOutputControlPoints; - else if (lowername == "outputtopology") + else if (name == "outputtopology") return EatOutputTopology; - else if (lowername == "partitioning") + else if (name == "partitioning") return EatPartitioning; - else if (lowername == "patchconstantfunc") + else if (name == "patchconstantfunc") return EatPatchConstantFunc; - else if (lowername == "unroll") + else if (name == "unroll") return EatUnroll; - else if (lowername == "loop") + else if (name == "loop") return EatLoop; else return EatNone; } - // Look up entry, inserting if it's not there, and if name is a valid attribute name - // as known by attributeFromName. - TAttributeType TAttributeMap::setAttribute(const TString* name, TIntermAggregate* value) - { - if (name == nullptr) - return EatNone; - - const TAttributeType attr = attributeFromName(*name); - - if (attr != EatNone) - attributes[attr] = value; - - return attr; - } - - // Look up entry (const version), and return aggregate node. This cannot change the map. - const TIntermAggregate* TAttributeMap::operator[](TAttributeType attr) const - { - const auto entry = attributes.find(attr); - - return (entry == attributes.end()) ? nullptr : entry->second; - } - - // True if entry exists in map (even if value is nullptr) - bool TAttributeMap::contains(TAttributeType attr) const - { - return attributes.find(attr) != attributes.end(); - } - } // end namespace glslang diff --git a/deps/glslang/hlsl/hlslAttributes.h b/deps/glslang/hlsl/hlslAttributes.h index b32a53cb..b1cc0372 100644 --- a/deps/glslang/hlsl/hlslAttributes.h +++ b/deps/glslang/hlsl/hlslAttributes.h @@ -38,75 +38,22 @@ #include #include -#include "hlslScanContext.h" -#include "../glslang/Include/Common.h" - -namespace glslang { - enum TAttributeType { - EatNone, - EatAllow_uav_condition, - EatBranch, - EatCall, - EatDomain, - EatEarlyDepthStencil, - EatFastOpt, - EatFlatten, - EatForceCase, - EatInstance, - EatMaxTessFactor, - EatNumThreads, - EatMaxVertexCount, - EatOutputControlPoints, - EatOutputTopology, - EatPartitioning, - EatPatchConstantFunc, - EatPatchSize, - EatUnroll, - EatLoop, - }; -} -namespace std { - // Allow use of TAttributeType enum in hash_map without calling code having to cast. - template <> struct hash { - std::size_t operator()(glslang::TAttributeType attr) const { - return std::hash()(int(attr)); - } - }; -} // end namespace std +#include "../glslang/MachineIndependent/attribute.h" +#include "../glslang/MachineIndependent/SymbolTable.h" +#include "hlslScanContext.h" namespace glslang { - class TIntermAggregate; - - class TAttributeMap { - public: - // Search for and potentially add the attribute into the map. Return the - // attribute type enum for it, if found, else EatNone. - TAttributeType setAttribute(const TString* name, TIntermAggregate* value); - - // Const lookup: search for (but do not modify) the attribute in the map. - const TIntermAggregate* operator[](TAttributeType) const; - - // True if entry exists in map (even if value is nullptr) - bool contains(TAttributeType) const; - - protected: - // Find an attribute enum given its name. - static TAttributeType attributeFromName(const TString&); - - std::unordered_map attributes; - }; class TFunctionDeclarator { public: TFunctionDeclarator() : function(nullptr), body(nullptr) { } TSourceLoc loc; TFunction* function; - TAttributeMap attributes; + TAttributes attributes; TVector* body; }; } // end namespace glslang - #endif // HLSLATTRIBUTES_H_ diff --git a/deps/glslang/hlsl/hlslGrammar.cpp b/deps/glslang/hlsl/hlslGrammar.cpp index 2f687c5a..cb058779 100644 --- a/deps/glslang/hlsl/hlslGrammar.cpp +++ b/deps/glslang/hlsl/hlslGrammar.cpp @@ -295,13 +295,16 @@ bool HlslGrammar::acceptSamplerDeclarationDX9(TType& /*type*/) } // declaration +// : attributes attributed_declaration +// | NAMESPACE IDENTIFIER LEFT_BRACE declaration_list RIGHT_BRACE +// +// attributed_declaration // : sampler_declaration_dx9 post_decls SEMICOLON // | fully_specified_type // for cbuffer/tbuffer // | fully_specified_type declarator_list SEMICOLON // for non cbuffer/tbuffer // | fully_specified_type identifier function_parameters post_decls compound_statement // function definition // | fully_specified_type identifier sampler_state post_decls compound_statement // sampler definition // | typedef declaration -// | NAMESPACE IDENTIFIER LEFT_BRACE declaration_list RIGHT_BRACE // // declarator_list // : declarator COMMA declarator COMMA declarator... // zero or more declarators @@ -373,7 +376,7 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList) bool forbidDeclarators = (peekTokenClass(EHTokCBuffer) || peekTokenClass(EHTokTBuffer)); // fully_specified_type - if (! acceptFullySpecifiedType(declaredType, nodeList)) + if (! acceptFullySpecifiedType(declaredType, nodeList, declarator.attributes, forbidDeclarators)) return false; // cbuffer and tbuffer end with the closing '}'. @@ -387,12 +390,15 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList) HlslToken idToken; TIntermAggregate* initializers = nullptr; while (acceptIdentifier(idToken)) { - const TString *fullName = idToken.string; + TString *fullName = idToken.string; if (parseContext.symbolTable.atGlobalLevel()) parseContext.getFullNamespaceName(fullName); if (peekTokenClass(EHTokLeftParen)) { // looks like function parameters + // merge in the attributes into the return type + parseContext.transferTypeAttributes(token.loc, declarator.attributes, declaredType, true); + // Potentially rename shader entry point function. No-op most of the time. parseContext.renameShaderFunction(fullName); @@ -420,32 +426,30 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList) parseContext.handleFunctionDeclarator(declarator.loc, *declarator.function, true); } } else { - // A variable declaration. Fix the storage qualifier if it's a global. + // A variable declaration. + + // merge in the attributes, the first time around, into the shared type + if (! declarator_list) + parseContext.transferTypeAttributes(token.loc, declarator.attributes, declaredType); + + // Fix the storage qualifier if it's a global. if (declaredType.getQualifier().storage == EvqTemporary && parseContext.symbolTable.atGlobalLevel()) declaredType.getQualifier().storage = EvqUniform; + // recognize array_specifier + TArraySizes* arraySizes = nullptr; + acceptArraySpecifier(arraySizes); + // We can handle multiple variables per type declaration, so // the number of types can expand when arrayness is different. TType variableType; variableType.shallowCopy(declaredType); - // recognize array_specifier - TArraySizes* arraySizes = nullptr; - acceptArraySpecifier(arraySizes); - - // Fix arrayness in the variableType - if (declaredType.isImplicitlySizedArray()) { - // Because "int[] a = int[2](...), b = int[3](...)" makes two arrays a and b - // of different sizes, for this case sharing the shallow copy of arrayness - // with the parseType oversubscribes it, so get a deep copy of the arrayness. - variableType.newArraySizes(declaredType.getArraySizes()); - } - if (arraySizes || variableType.isArray()) { - // In the most general case, arrayness is potentially coming both from the - // declared type and from the variable: "int[] a[];" or just one or the other. - // Merge it all to the variableType, so all arrayness is part of the variableType. - parseContext.arrayDimMerge(variableType, arraySizes); - } + // In the most general case, arrayness is potentially coming both from the + // declared type and from the variable: "int[] a[];" or just one or the other. + // Merge it all to the variableType, so all arrayness is part of the variableType. + variableType.transferArraySizes(arraySizes); + variableType.copyArrayInnerSizes(declaredType.getArraySizes()); // samplers accept immediate sampler state if (variableType.getBasicType() == EbtSampler) { @@ -473,8 +477,9 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList) if (typedefDecl) parseContext.declareTypedef(idToken.loc, *fullName, variableType); else if (variableType.getBasicType() == EbtBlock) { - parseContext.declareBlock(idToken.loc, variableType, fullName, - variableType.isArray() ? &variableType.getArraySizes() : nullptr); + if (expressionNode) + parseContext.error(idToken.loc, "buffer aliasing not yet supported", "block initializer", ""); + parseContext.declareBlock(idToken.loc, variableType, fullName); parseContext.declareStructBufferCounter(idToken.loc, variableType, *fullName); } else { if (variableType.getQualifier().storage == EvqUniform && ! variableType.containsOpaque()) { @@ -531,12 +536,16 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList) bool HlslGrammar::acceptControlDeclaration(TIntermNode*& node) { node = nullptr; + TAttributes attributes; // fully_specified_type TType type; - if (! acceptFullySpecifiedType(type)) + if (! acceptFullySpecifiedType(type, attributes)) return false; + if (attributes.size() > 0) + parseContext.warn(token.loc, "attributes don't apply to control declaration", "", ""); + // filter out type casts if (peekTokenClass(EHTokLeftParen)) { recedeToken(); @@ -572,12 +581,12 @@ bool HlslGrammar::acceptControlDeclaration(TIntermNode*& node) // : type_specifier // | type_qualifier type_specifier // -bool HlslGrammar::acceptFullySpecifiedType(TType& type) +bool HlslGrammar::acceptFullySpecifiedType(TType& type, const TAttributes& attributes) { TIntermNode* nodeList = nullptr; - return acceptFullySpecifiedType(type, nodeList); + return acceptFullySpecifiedType(type, nodeList, attributes); } -bool HlslGrammar::acceptFullySpecifiedType(TType& type, TIntermNode*& nodeList) +bool HlslGrammar::acceptFullySpecifiedType(TType& type, TIntermNode*& nodeList, const TAttributes& attributes, bool forbidDeclarators) { // type_qualifier TQualifier qualifier; @@ -596,11 +605,18 @@ bool HlslGrammar::acceptFullySpecifiedType(TType& type, TIntermNode*& nodeList) return false; } + if (type.getBasicType() == EbtBlock) { // the type was a block, which set some parts of the qualifier parseContext.mergeQualifiers(type.getQualifier(), qualifier); + + // merge in the attributes + parseContext.transferTypeAttributes(token.loc, attributes, type); + // further, it can create an anonymous instance of the block - if (peek() != EHTokIdentifier) + // (cbuffer and tbuffer don't consume the next identifier, and + // should set forbidDeclarators) + if (forbidDeclarators || peek() != EHTokIdentifier) parseContext.declareBlock(loc, type); } else { // Some qualifiers are set when parsing the type. Merge those with @@ -619,7 +635,7 @@ bool HlslGrammar::acceptFullySpecifiedType(TType& type, TIntermNode*& nodeList) if (type.isBuiltIn()) qualifier.builtIn = type.getQualifier().builtIn; - type.getQualifier() = qualifier; + type.getQualifier() = qualifier; } return true; @@ -1011,7 +1027,7 @@ bool HlslGrammar::acceptTessellationPatchTemplateType(TType& type) TArraySizes* arraySizes = new TArraySizes; arraySizes->addInnerSize(size->getAsConstantUnion()->getConstArray()[0].getIConst()); - type.newArraySizes(*arraySizes); + type.transferArraySizes(arraySizes); type.getQualifier().builtIn = patchType; if (! acceptTokenClass(EHTokRightAngle)) { @@ -1083,6 +1099,69 @@ bool HlslGrammar::acceptAnnotations(TQualifier&) return true; } +// subpass input type +// : SUBPASSINPUT +// | SUBPASSINPUT VECTOR LEFT_ANGLE template_type RIGHT_ANGLE +// | SUBPASSINPUTMS +// | SUBPASSINPUTMS VECTOR LEFT_ANGLE template_type RIGHT_ANGLE +bool HlslGrammar::acceptSubpassInputType(TType& type) +{ + // read subpass type + const EHlslTokenClass subpassInputType = peek(); + + bool multisample; + + switch (subpassInputType) { + case EHTokSubpassInput: multisample = false; break; + case EHTokSubpassInputMS: multisample = true; break; + default: + return false; // not a subpass input declaration + } + + advanceToken(); // consume the sampler type keyword + + TType subpassType(EbtFloat, EvqUniform, 4); // default type is float4 + + if (acceptTokenClass(EHTokLeftAngle)) { + if (! acceptType(subpassType)) { + expected("scalar or vector type"); + return false; + } + + const TBasicType basicRetType = subpassType.getBasicType() ; + + switch (basicRetType) { + case EbtFloat: + case EbtUint: + case EbtInt: + case EbtStruct: + break; + default: + unimplemented("basic type in subpass input"); + return false; + } + + if (! acceptTokenClass(EHTokRightAngle)) { + expected("right angle bracket"); + return false; + } + } + + const TBasicType subpassBasicType = subpassType.isStruct() ? (*subpassType.getStruct())[0].type->getBasicType() + : subpassType.getBasicType(); + + TSampler sampler; + sampler.setSubpass(subpassBasicType, multisample); + + // Remember the declared return type. Function returns false on error. + if (!parseContext.setTextureReturnType(sampler, subpassType, token.loc)) + return false; + + type.shallowCopy(TType(sampler, EvqUniform)); + + return true; +} + // sampler_type // : SAMPLER // | SAMPLER1D @@ -1289,14 +1368,15 @@ bool HlslGrammar::acceptType(TType& type) } bool HlslGrammar::acceptType(TType& type, TIntermNode*& nodeList) { - // Basic types for min* types, broken out here in case of future - // changes, e.g, to use native halfs. - static const TBasicType min16float_bt = EbtFloat; - static const TBasicType min10float_bt = EbtFloat; - static const TBasicType half_bt = EbtFloat; - static const TBasicType min16int_bt = EbtInt; - static const TBasicType min12int_bt = EbtInt; - static const TBasicType min16uint_bt = EbtUint; + // Basic types for min* types, use native halfs if the option allows them. + bool enable16BitTypes = parseContext.hlslEnable16BitTypes(); + + const TBasicType min16float_bt = enable16BitTypes ? EbtFloat16 : EbtFloat; + const TBasicType min10float_bt = enable16BitTypes ? EbtFloat16 : EbtFloat; + const TBasicType half_bt = enable16BitTypes ? EbtFloat16 : EbtFloat; + const TBasicType min16int_bt = enable16BitTypes ? EbtInt16 : EbtInt; + const TBasicType min12int_bt = enable16BitTypes ? EbtInt16 : EbtInt; + const TBasicType min16uint_bt = enable16BitTypes ? EbtUint16 : EbtUint; // Some types might have turned into identifiers. Take the hit for checking // when this has happened. @@ -1310,6 +1390,23 @@ bool HlslGrammar::acceptType(TType& type, TIntermNode*& nodeList) } } + bool isUnorm = false; + bool isSnorm = false; + + // Accept snorm and unorm. Presently, this is ignored, save for an error check below. + switch (peek()) { + case EHTokUnorm: + isUnorm = true; + advanceToken(); // eat the token + break; + case EHTokSNorm: + isSnorm = true; + advanceToken(); // eat the token + break; + default: + break; + } + switch (peek()) { case EHTokVector: return acceptVectorTemplateType(type); @@ -1352,6 +1449,11 @@ bool HlslGrammar::acceptType(TType& type, TIntermNode*& nodeList) return acceptSamplerType(type); break; + case EHTokSubpassInput: // fall through + case EHTokSubpassInputMS: // ... + return acceptSubpassInputType(type); + break; + case EHTokBuffer: // fall through case EHTokTexture1d: // ... case EHTokTexture1darray: // ... @@ -1380,6 +1482,10 @@ bool HlslGrammar::acceptType(TType& type, TIntermNode*& nodeList) return acceptStructBufferType(type); break; + case EHTokTextureBuffer: + return acceptTextureBufferType(type); + break; + case EHTokConstantBuffer: return acceptConstantBufferType(type); @@ -1476,6 +1582,10 @@ bool HlslGrammar::acceptType(TType& type, TIntermNode*& nodeList) new(&type) TType(EbtUint, EvqTemporary, 4); break; + case EHTokUint64: + new(&type) TType(EbtUint64); + break; + case EHTokBool: new(&type) TType(EbtBool); break; @@ -1895,6 +2005,11 @@ bool HlslGrammar::acceptType(TType& type, TIntermNode*& nodeList) advanceToken(); + if ((isUnorm || isSnorm) && !type.isFloatingDomain()) { + parseContext.error(token.loc, "unorm and snorm only valid in floating point domain", "", ""); + return false; + } + return true; } @@ -1930,10 +2045,18 @@ bool HlslGrammar::acceptStruct(TType& type, TIntermNode*& nodeList) // Now known to be one of CBUFFER, TBUFFER, CLASS, or STRUCT - // IDENTIFIER + + // IDENTIFIER. It might also be a keyword which can double as an identifier. + // For example: 'cbuffer ConstantBuffer' or 'struct ConstantBuffer' is legal. + // 'cbuffer int' is also legal, and 'struct int' appears rejected only because + // it attempts to redefine the 'int' type. + const char* idString = getTypeString(peek()); TString structName = ""; - if (peekTokenClass(EHTokIdentifier)) { - structName = *token.string; + if (peekTokenClass(EHTokIdentifier) || idString != nullptr) { + if (idString != nullptr) + structName = *idString; + else + structName = *token.string; advanceToken(); } @@ -2054,6 +2177,43 @@ bool HlslGrammar::acceptConstantBufferType(TType& type) } } +// texture_buffer +// : TEXTUREBUFFER LEFT_ANGLE type RIGHT_ANGLE +bool HlslGrammar::acceptTextureBufferType(TType& type) +{ + if (! acceptTokenClass(EHTokTextureBuffer)) + return false; + + if (! acceptTokenClass(EHTokLeftAngle)) { + expected("left angle bracket"); + return false; + } + + TType templateType; + if (! acceptType(templateType)) { + expected("type"); + return false; + } + + if (! acceptTokenClass(EHTokRightAngle)) { + expected("right angle bracket"); + return false; + } + + templateType.getQualifier().storage = EvqBuffer; + templateType.getQualifier().readonly = true; + + TType blockType(templateType.getWritableStruct(), "", templateType.getQualifier()); + + blockType.getQualifier().storage = EvqBuffer; + blockType.getQualifier().readonly = true; + + type.shallowCopy(blockType); + + return true; +} + + // struct_buffer // : APPENDSTRUCTUREDBUFFER // | BYTEADDRESSBUFFER @@ -2126,9 +2286,9 @@ bool HlslGrammar::acceptStructBufferType(TType& type) // Create an unsized array out of that type. // TODO: does this work if it's already an array type? - TArraySizes unsizedArray; - unsizedArray.addInnerSize(UnsizedArraySize); - templateType->newArraySizes(unsizedArray); + TArraySizes* unsizedArray = new TArraySizes; + unsizedArray->addInnerSize(UnsizedArraySize); + templateType->transferArraySizes(unsizedArray); templateType->getQualifier().storage = storage; // field name is canonical for all structbuffers @@ -2158,8 +2318,8 @@ bool HlslGrammar::acceptStructBufferType(TType& type) // : struct_declaration SEMI_COLON struct_declaration SEMI_COLON ... // // struct_declaration -// : fully_specified_type struct_declarator COMMA struct_declarator ... -// | fully_specified_type IDENTIFIER function_parameters post_decls compound_statement // member-function definition +// : attributes fully_specified_type struct_declarator COMMA struct_declarator ... +// | attributes fully_specified_type IDENTIFIER function_parameters post_decls compound_statement // member-function definition // // struct_declarator // : IDENTIFIER post_decls @@ -2178,15 +2338,22 @@ bool HlslGrammar::acceptStructDeclarationList(TTypeList*& typeList, TIntermNode* break; // struct_declaration - + + // attributes + TAttributes attributes; + acceptAttributes(attributes); + bool declarator_list = false; // fully_specified_type TType memberType; - if (! acceptFullySpecifiedType(memberType, nodeList)) { + if (! acceptFullySpecifiedType(memberType, nodeList, attributes)) { expected("member type"); return false; } + + // merge in the attributes + parseContext.transferTypeAttributes(token.loc, attributes, memberType); // struct_declarator COMMA struct_declarator ... bool functionDefinitionAccepted = false; @@ -2219,7 +2386,7 @@ bool HlslGrammar::acceptStructDeclarationList(TTypeList*& typeList, TIntermNode* TArraySizes* arraySizes = nullptr; acceptArraySpecifier(arraySizes); if (arraySizes) - typeList->back().type->newArraySizes(*arraySizes); + typeList->back().type->transferArraySizes(arraySizes); acceptPostDecls(member.type->getQualifier()); @@ -2263,12 +2430,12 @@ bool HlslGrammar::acceptStructDeclarationList(TTypeList*& typeList, TIntermNode* // // Expects type to have EvqGlobal for a static member and // EvqTemporary for non-static member. -bool HlslGrammar::acceptMemberFunctionDefinition(TIntermNode*& nodeList, const TType& type, const TString& memberName, +bool HlslGrammar::acceptMemberFunctionDefinition(TIntermNode*& nodeList, const TType& type, TString& memberName, TFunctionDeclarator& declarator) { bool accepted = false; - const TString* functionName = &memberName; + TString* functionName = &memberName; parseContext.getFullNamespaceName(functionName); declarator.function = new TFunction(functionName, type); if (type.getQualifier().storage == EvqTemporary) @@ -2353,6 +2520,9 @@ bool HlslGrammar::acceptDefaultParameterDeclaration(const TType& type, TIntermTy node = parseContext.handleFunctionCall(token.loc, constructor, node); } + if (node == nullptr) + return false; + // If this is simply a constant, we can use it directly. if (node->getAsConstantUnion()) return true; @@ -2371,16 +2541,26 @@ bool HlslGrammar::acceptDefaultParameterDeclaration(const TType& type, TIntermTy } // parameter_declaration +// : attributes attributed_declaration +// +// attributed_declaration // : fully_specified_type post_decls [ = default_parameter_declaration ] // | fully_specified_type identifier array_specifier post_decls [ = default_parameter_declaration ] // bool HlslGrammar::acceptParameterDeclaration(TFunction& function) { + // attributes + TAttributes attributes; + acceptAttributes(attributes); + // fully_specified_type TType* type = new TType; - if (! acceptFullySpecifiedType(*type)) + if (! acceptFullySpecifiedType(*type, attributes)) return false; + // merge in the attributes + parseContext.transferTypeAttributes(token.loc, attributes, *type); + // identifier HlslToken idToken; acceptIdentifier(idToken); @@ -2389,12 +2569,12 @@ bool HlslGrammar::acceptParameterDeclaration(TFunction& function) TArraySizes* arraySizes = nullptr; acceptArraySpecifier(arraySizes); if (arraySizes) { - if (arraySizes->isImplicit()) { - parseContext.error(token.loc, "function parameter array cannot be implicitly sized", "", ""); + if (arraySizes->hasUnsized()) { + parseContext.error(token.loc, "function parameter requires array size", "[]", ""); return false; } - type->newArraySizes(*arraySizes); + type->transferArraySizes(arraySizes); } // post_decls @@ -2470,6 +2650,8 @@ bool HlslGrammar::acceptFunctionBody(TFunctionDeclarator& declarator, TIntermNod // bool HlslGrammar::acceptParenExpression(TIntermTyped*& expression) { + expression = nullptr; + // LEFT_PAREN if (! acceptTokenClass(EHTokLeftParen)) expected("("); @@ -2763,7 +2945,7 @@ bool HlslGrammar::acceptUnaryExpression(TIntermTyped*& node) TArraySizes* arraySizes = nullptr; acceptArraySpecifier(arraySizes); if (arraySizes != nullptr) - castType.newArraySizes(*arraySizes); + castType.transferArraySizes(arraySizes); TSourceLoc loc = token.loc; if (acceptTokenClass(EHTokRightParen)) { // We've matched "(type)" now, get the expression to cast @@ -2780,7 +2962,7 @@ bool HlslGrammar::acceptUnaryExpression(TIntermTyped*& node) parseContext.handleFunctionArgument(constructorFunction, arguments, node); node = parseContext.handleFunctionCall(loc, constructorFunction, arguments); - return true; + return node != nullptr; } else { // This could be a parenthesized constructor, ala (int(3)), and we just accepted // the '(int' part. We must back up twice. @@ -2880,6 +3062,8 @@ bool HlslGrammar::acceptPostfixExpression(TIntermTyped*& node) } if (! peekTokenClass(EHTokLeftParen)) { node = parseContext.handleVariable(idToken.loc, fullName); + if (node == nullptr) + return false; } else if (acceptFunctionCall(idToken.loc, *fullName, node, nullptr)) { // function_call (nothing else to do yet) } else { @@ -2990,7 +3174,7 @@ bool HlslGrammar::acceptConstructor(TIntermTyped*& node) // hook it up node = parseContext.handleFunctionCall(arguments->getLoc(), constructorFunction, arguments); - return true; + return node != nullptr; } return false; @@ -3038,7 +3222,7 @@ bool HlslGrammar::acceptFunctionCall(const TSourceLoc& loc, TString& name, TInte // call node = parseContext.handleFunctionCall(loc, function, arguments); - return true; + return node != nullptr; } // arguments @@ -3090,6 +3274,9 @@ bool HlslGrammar::acceptLiteral(TIntermTyped*& node) case EHTokUintConstant: node = intermediate.addConstantUnion(token.u, token.loc, true); break; + case EHTokFloat16Constant: + node = intermediate.addConstantUnion(token.d, EbtFloat16, token.loc, true); + break; case EHTokFloatConstant: node = intermediate.addConstantUnion(token.d, EbtFloat, token.loc, true); break; @@ -3213,7 +3400,7 @@ bool HlslGrammar::acceptStatement(TIntermNode*& statement) statement = nullptr; // attributes - TAttributeMap attributes; + TAttributes attributes; acceptAttributes(attributes); // attributed_statement @@ -3256,7 +3443,15 @@ bool HlslGrammar::acceptStatement(TIntermNode*& statement) } // attributes -// : list of zero or more of: LEFT_BRACKET attribute RIGHT_BRACKET +// : [zero or more:] bracketed-attribute +// +// bracketed-attribute: +// : LEFT_BRACKET scoped-attribute RIGHT_BRACKET +// : LEFT_BRACKET LEFT_BRACKET scoped-attribute RIGHT_BRACKET RIGHT_BRACKET +// +// scoped-attribute: +// : attribute +// | namespace COLON COLON attribute // // attribute: // : UNROLL @@ -3277,24 +3472,39 @@ bool HlslGrammar::acceptStatement(TIntermNode*& statement) // | PATCHCONSTANTFUNC // | NUMTHREADS LEFT_PAREN x_size, y_size,z z_size RIGHT_PAREN // -void HlslGrammar::acceptAttributes(TAttributeMap& attributes) +void HlslGrammar::acceptAttributes(TAttributes& attributes) { // For now, accept the [ XXX(X) ] syntax, but drop all but // numthreads, which is used to set the CS local size. // TODO: subset to correct set? Pass on? do { - HlslToken idToken; + HlslToken attributeToken; // LEFT_BRACKET? if (! acceptTokenClass(EHTokLeftBracket)) return; + // another LEFT_BRACKET? + bool doubleBrackets = false; + if (acceptTokenClass(EHTokLeftBracket)) + doubleBrackets = true; + + // attribute? (could be namespace; will adjust later) + if (!acceptIdentifier(attributeToken)) { + if (!peekTokenClass(EHTokRightBracket)) { + expected("namespace or attribute identifier"); + advanceToken(); + } + } - // attribute - if (acceptIdentifier(idToken)) { - // 'idToken.string' is the attribute - } else if (! peekTokenClass(EHTokRightBracket)) { - expected("identifier"); - advanceToken(); + TString nameSpace; + if (acceptTokenClass(EHTokColonColon)) { + // namespace COLON COLON + nameSpace = *attributeToken.string; + // attribute + if (!acceptIdentifier(attributeToken)) { + expected("attribute identifier"); + return; + } } TIntermAggregate* expressions = nullptr; @@ -3327,10 +3537,22 @@ void HlslGrammar::acceptAttributes(TAttributeMap& attributes) expected("]"); return; } + // another RIGHT_BRACKET? + if (doubleBrackets && !acceptTokenClass(EHTokRightBracket)) { + expected("]]"); + return; + } - // Add any values we found into the attribute map. This accepts - // (and ignores) values not mapping to a known TAttributeType; - attributes.setAttribute(idToken.string, expressions); + // Add any values we found into the attribute map. + if (attributeToken.string != nullptr) { + TAttributeType attributeType = parseContext.attributeFromName(nameSpace, *attributeToken.string); + if (attributeType == EatNone) + parseContext.warn(attributeToken.loc, "unrecognized attribute", attributeToken.string->c_str(), ""); + else { + TAttributeArgs attributeArgs = { attributeType, expressions }; + attributes.push_back(attributeArgs); + } + } } while (true); } @@ -3338,12 +3560,10 @@ void HlslGrammar::acceptAttributes(TAttributeMap& attributes) // : IF LEFT_PAREN expression RIGHT_PAREN statement // : IF LEFT_PAREN expression RIGHT_PAREN statement ELSE statement // -bool HlslGrammar::acceptSelectionStatement(TIntermNode*& statement, const TAttributeMap& attributes) +bool HlslGrammar::acceptSelectionStatement(TIntermNode*& statement, const TAttributes& attributes) { TSourceLoc loc = token.loc; - const TSelectionControl control = parseContext.handleSelectionControl(attributes); - // IF if (! acceptTokenClass(EHTokIf)) return false; @@ -3381,7 +3601,9 @@ bool HlslGrammar::acceptSelectionStatement(TIntermNode*& statement, const TAttri } // Put the pieces together - statement = intermediate.addSelection(condition, thenElse, loc, control); + statement = intermediate.addSelection(condition, thenElse, loc); + parseContext.handleSelectionAttributes(loc, statement->getAsSelectionNode(), attributes); + parseContext.popScope(); --parseContext.controlFlowNestingLevel; @@ -3391,13 +3613,11 @@ bool HlslGrammar::acceptSelectionStatement(TIntermNode*& statement, const TAttri // switch_statement // : SWITCH LEFT_PAREN expression RIGHT_PAREN compound_statement // -bool HlslGrammar::acceptSwitchStatement(TIntermNode*& statement, const TAttributeMap& attributes) +bool HlslGrammar::acceptSwitchStatement(TIntermNode*& statement, const TAttributes& attributes) { // SWITCH TSourceLoc loc = token.loc; - const TSelectionControl control = parseContext.handleSelectionControl(attributes); - if (! acceptTokenClass(EHTokSwitch)) return false; @@ -3417,7 +3637,8 @@ bool HlslGrammar::acceptSwitchStatement(TIntermNode*& statement, const TAttribut --parseContext.controlFlowNestingLevel; if (statementOkay) - statement = parseContext.addSwitch(loc, switchExpression, statement ? statement->getAsAggregate() : nullptr, control); + statement = parseContext.addSwitch(loc, switchExpression, statement ? statement->getAsAggregate() : nullptr, + attributes); parseContext.popSwitchSequence(); parseContext.popScope(); @@ -3431,7 +3652,7 @@ bool HlslGrammar::acceptSwitchStatement(TIntermNode*& statement, const TAttribut // | FOR LEFT_PAREN for_init_statement for_rest_statement RIGHT_PAREN statement // // Non-speculative, only call if it needs to be found; WHILE or DO or FOR already seen. -bool HlslGrammar::acceptIterationStatement(TIntermNode*& statement, const TAttributeMap& attributes) +bool HlslGrammar::acceptIterationStatement(TIntermNode*& statement, const TAttributes& attributes) { TSourceLoc loc = token.loc; TIntermTyped* condition = nullptr; @@ -3441,9 +3662,8 @@ bool HlslGrammar::acceptIterationStatement(TIntermNode*& statement, const TAttri // WHILE or DO or FOR advanceToken(); - - const TLoopControl control = parseContext.handleLoopControl(attributes); + TIntermLoop* loopNode = nullptr; switch (loop) { case EHTokWhile: // so that something declared in the condition is scoped to the lifetime @@ -3469,9 +3689,9 @@ bool HlslGrammar::acceptIterationStatement(TIntermNode*& statement, const TAttri parseContext.popScope(); --parseContext.controlFlowNestingLevel; - statement = intermediate.addLoop(statement, condition, nullptr, true, loc, control); - - return true; + loopNode = intermediate.addLoop(statement, condition, nullptr, true, loc); + statement = loopNode; + break; case EHTokDo: parseContext.nestLooping(); // this only needs to work right if no errors @@ -3490,7 +3710,6 @@ bool HlslGrammar::acceptIterationStatement(TIntermNode*& statement, const TAttri } // LEFT_PAREN condition RIGHT_PAREN - TIntermTyped* condition; if (! acceptParenExpression(condition)) return false; condition = parseContext.convertConditionalExpression(loc, condition); @@ -3503,9 +3722,9 @@ bool HlslGrammar::acceptIterationStatement(TIntermNode*& statement, const TAttri parseContext.unnestLooping(); --parseContext.controlFlowNestingLevel; - statement = intermediate.addLoop(statement, condition, 0, false, loc, control); - - return true; + loopNode = intermediate.addLoop(statement, condition, 0, false, loc); + statement = loopNode; + break; case EHTokFor: { @@ -3547,18 +3766,21 @@ bool HlslGrammar::acceptIterationStatement(TIntermNode*& statement, const TAttri return false; } - statement = intermediate.addForLoop(statement, initNode, condition, iterator, true, loc, control); + statement = intermediate.addForLoop(statement, initNode, condition, iterator, true, loc, loopNode); parseContext.popScope(); parseContext.unnestLooping(); --parseContext.controlFlowNestingLevel; - return true; + break; } default: return false; } + + parseContext.handleLoopAttributes(loc, loopNode, attributes); + return true; } // jump_statement @@ -3586,9 +3808,17 @@ bool HlslGrammar::acceptJumpStatement(TIntermNode*& statement) switch (jump) { case EHTokContinue: statement = intermediate.addBranch(EOpContinue, token.loc); + if (parseContext.loopNestingLevel == 0) { + expected("loop"); + return false; + } break; case EHTokBreak: statement = intermediate.addBranch(EOpBreak, token.loc); + if (parseContext.loopNestingLevel == 0 && parseContext.switchSequenceStack.size() == 0) { + expected("loop or switch"); + return false; + } break; case EHTokDiscard: statement = intermediate.addBranch(EOpKill, token.loc); @@ -3880,6 +4110,8 @@ const char* HlslGrammar::getTypeString(EHlslTokenClass tokenClass) const case EHTokMin10float: return "min10float"; case EHTokMin16int: return "min16int"; case EHTokMin12int: return "min12int"; + case EHTokConstantBuffer: return "ConstantBuffer"; + case EHTokLayout: return "layout"; default: return nullptr; } diff --git a/deps/glslang/hlsl/hlslGrammar.h b/deps/glslang/hlsl/hlslGrammar.h index ded8e966..046f7957 100644 --- a/deps/glslang/hlsl/hlslGrammar.h +++ b/deps/glslang/hlsl/hlslGrammar.h @@ -43,7 +43,6 @@ namespace glslang { - class TAttributeMap; class TFunctionDeclarator; // Should just be the grammar aspect of HLSL. @@ -71,8 +70,8 @@ namespace glslang { bool acceptControlDeclaration(TIntermNode*& node); bool acceptSamplerDeclarationDX9(TType&); bool acceptSamplerState(); - bool acceptFullySpecifiedType(TType&); - bool acceptFullySpecifiedType(TType&, TIntermNode*& nodeList); + bool acceptFullySpecifiedType(TType&, const TAttributes&); + bool acceptFullySpecifiedType(TType&, TIntermNode*& nodeList, const TAttributes&, bool forbidDeclarators = false); bool acceptQualifier(TQualifier&); bool acceptLayoutQualifierList(TQualifier&); bool acceptType(TType&); @@ -87,11 +86,13 @@ namespace glslang { bool acceptAnnotations(TQualifier&); bool acceptSamplerType(TType&); bool acceptTextureType(TType&); + bool acceptSubpassInputType(TType&); bool acceptStructBufferType(TType&); + bool acceptTextureBufferType(TType&); bool acceptConstantBufferType(TType&); bool acceptStruct(TType&, TIntermNode*& nodeList); bool acceptStructDeclarationList(TTypeList*&, TIntermNode*& nodeList, TVector&); - bool acceptMemberFunctionDefinition(TIntermNode*& nodeList, const TType&, const TString& memberName, + bool acceptMemberFunctionDefinition(TIntermNode*& nodeList, const TType&, TString& memberName, TFunctionDeclarator&); bool acceptFunctionParameters(TFunction&); bool acceptParameterDeclaration(TFunction&); @@ -115,10 +116,10 @@ namespace glslang { bool acceptScopedCompoundStatement(TIntermNode*&); bool acceptStatement(TIntermNode*&); bool acceptNestedStatement(TIntermNode*&); - void acceptAttributes(TAttributeMap&); - bool acceptSelectionStatement(TIntermNode*&, const TAttributeMap&); - bool acceptSwitchStatement(TIntermNode*&, const TAttributeMap&); - bool acceptIterationStatement(TIntermNode*&, const TAttributeMap&); + void acceptAttributes(TAttributes&); + bool acceptSelectionStatement(TIntermNode*&, const TAttributes&); + bool acceptSwitchStatement(TIntermNode*&, const TAttributes&); + bool acceptIterationStatement(TIntermNode*&, const TAttributes&); bool acceptJumpStatement(TIntermNode*&); bool acceptCaseLabel(TIntermNode*&); bool acceptDefaultLabel(TIntermNode*&); diff --git a/deps/glslang/hlsl/hlslParseHelper.cpp b/deps/glslang/hlsl/hlslParseHelper.cpp index 929bf419..47836879 100644 --- a/deps/glslang/hlsl/hlslParseHelper.cpp +++ b/deps/glslang/hlsl/hlslParseHelper.cpp @@ -1,6 +1,6 @@ // -// Copyright (C) 2016 Google, Inc. -// Copyright (C) 2016 LunarG, Inc. +// Copyright (C) 2017 Google, Inc. +// Copyright (C) 2017 LunarG, Inc. // // All rights reserved. // @@ -58,16 +58,17 @@ HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& int const TString sourceEntryPointName, bool forwardCompatible, EShMessages messages) : TParseContextBase(symbolTable, interm, parsingBuiltins, version, profile, spvVersion, language, infoSink, - forwardCompatible, messages), + forwardCompatible, messages, &sourceEntryPointName), annotationNestingLevel(0), inputPatch(nullptr), nextInLocation(0), nextOutLocation(0), - sourceEntryPointName(sourceEntryPointName), entryPointFunction(nullptr), entryPointFunctionBody(nullptr), gsStreamOutput(nullptr), - clipDistanceVariable(nullptr), - cullDistanceVariable(nullptr) + clipDistanceOutput(nullptr), + cullDistanceOutput(nullptr), + clipDistanceInput(nullptr), + cullDistanceInput(nullptr) { globalUniformDefaults.clear(); globalUniformDefaults.layoutMatrix = ElmRowMajor; @@ -80,8 +81,10 @@ HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& int globalInputDefaults.clear(); globalOutputDefaults.clear(); - clipSemanticNSize.fill(0); - cullSemanticNSize.fill(0); + clipSemanticNSizeIn.fill(0); + cullSemanticNSizeIn.fill(0); + clipSemanticNSizeOut.fill(0); + cullSemanticNSizeOut.fill(0); // "Shaders in the transform // feedback capturing mode have an initial global default of @@ -163,11 +166,6 @@ bool HlslParseContext::shouldConvertLValue(const TIntermNode* node) const if (lhsAsAggregate != nullptr && lhsAsAggregate->getOp() == EOpImageLoad) return true; - // If it's a syntactic write to a sampler, we will use that to establish - // a compile-time alias. - if (node->getAsTyped()->getBasicType() == EbtSampler) - return true; - return false; } @@ -236,6 +234,13 @@ bool HlslParseContext::lValueErrorCheck(const TSourceLoc& loc, const char* op, T } } + // We tolerate samplers as l-values, even though they are nominally + // illegal, because we expect a later optimization to eliminate them. + if (node->getType().getBasicType() == EbtSampler) { + intermediate.setNeedsLegalization(); + return false; + } + // Let the base class check errors return TParseContextBase::lValueErrorCheck(loc, op, node); } @@ -271,10 +276,6 @@ TIntermTyped* HlslParseContext::handleLvalue(const TSourceLoc& loc, const char* // *** If we get here, we're going to apply some conversion to an l-value. - // Spin off sampler aliasing - if (node->getAsTyped()->getBasicType() == EbtSampler) - return handleSamplerLvalue(loc, op, node); - // Helper to create a load. const auto makeLoad = [&](TIntermSymbol* rhsTmp, TIntermTyped* object, TIntermTyped* coord, const TType& derefType) { TIntermAggregate* loadOp = new TIntermAggregate(EOpImageLoad); @@ -521,58 +522,6 @@ TIntermTyped* HlslParseContext::handleLvalue(const TSourceLoc& loc, const char* return node; } -// Deal with sampler aliasing: turning assignments into aliases -// Return a placeholder node for higher-level code that think assignments must -// generate code. -TIntermTyped* HlslParseContext::handleSamplerLvalue(const TSourceLoc& loc, const char* op, TIntermTyped*& node) -{ - // Can only alias an assignment: "s1 = s2" - TIntermBinary* binary = node->getAsBinaryNode(); - if (binary == nullptr || node->getAsOperator()->getOp() != EOpAssign || - binary->getLeft()->getAsSymbolNode() == nullptr || - binary->getRight()->getAsSymbolNode() == nullptr) { - error(loc, "can't modify sampler", op, ""); - return node; - } - - if (controlFlowNestingLevel > 0) - warn(loc, "sampler or image aliased under control flow; consumption must be in same path", op, ""); - - TIntermTyped* set = setOpaqueLvalue(binary->getLeft(), binary->getRight()); - if (set == nullptr) - warn(loc, "could not create alias for sampler", op, ""); - else - node = set; - - return node; -} - -// Do an opaque assignment that needs to turn into an alias. -// Return nullptr if it can't be done, otherwise return a placeholder -// node for higher-level code that think assignments must generate code. -TIntermTyped* HlslParseContext::setOpaqueLvalue(TIntermTyped* leftTyped, TIntermTyped* rightTyped) -{ - // Best is if we are aliasing a flattened struct member "S.s1 = s2", - // in which case we want to update the flattening information with the alias, - // making everything else work seamlessly. - TIntermSymbol* left = leftTyped->getAsSymbolNode(); - TIntermSymbol* right = rightTyped->getAsSymbolNode(); - for (auto fit = flattenMap.begin(); fit != flattenMap.end(); ++fit) { - for (auto mit = fit->second.members.begin(); mit != fit->second.members.end(); ++mit) { - if ((*mit)->getUniqueId() == left->getId()) { - // found it: update with alias to the existing variable, and don't emit any code - (*mit) = new TVariable(&right->getName(), right->getType()); - (*mit)->setUniqueId(right->getId()); - // replace node (rest of compiler expects either an error or code to generate) - // with pointless access - return right; - } - } - } - - return nullptr; -} - void HlslParseContext::handlePragma(const TSourceLoc& loc, const TVector& tokens) { if (pragmaCallback) @@ -601,6 +550,13 @@ void HlslParseContext::handlePragma(const TSourceLoc& loc, const TVectorgetQualifier().storage == EvqConst) { + if (index->getQualifier().isFrontEndConstant()) indexValue = index->getAsConstantUnion()->getConstArray()[0].getIConst(); - checkIndex(loc, base->getType(), indexValue); - } variableCheck(base); if (! base->isArray() && ! base->isMatrix() && ! base->isVector()) { @@ -868,25 +822,33 @@ TIntermTyped* HlslParseContext::handleBracketDereference(const TSourceLoc& loc, base->getAsSymbolNode()->getName().c_str(), ""); else error(loc, " left of '[' is not of type array, matrix, or vector ", "expression", ""); - } else if (base->getType().getQualifier().storage == EvqConst && index->getQualifier().storage == EvqConst) + } else if (base->getType().getQualifier().storage == EvqConst && index->getQualifier().storage == EvqConst) { + // both base and index are front-end constants + checkIndex(loc, base->getType(), indexValue); return intermediate.foldDereference(base, indexValue, loc); - else { + } else { // at least one of base and index is variable... - if (base->getAsSymbolNode() && wasFlattened(base)) { + if (index->getQualifier().isFrontEndConstant()) + checkIndex(loc, base->getType(), indexValue); + + if (base->getType().isScalarOrVec1()) + result = base; + else if (base->getAsSymbolNode() && wasFlattened(base)) { if (index->getQualifier().storage != EvqConst) error(loc, "Invalid variable index to flattened array", base->getAsSymbolNode()->getName().c_str(), ""); result = flattenAccess(base, indexValue); flattened = (result != base); } else { - if (index->getQualifier().storage == EvqConst) { - if (base->getType().isImplicitlySizedArray()) - updateImplicitArraySize(loc, base, indexValue); + if (index->getQualifier().isFrontEndConstant()) { + if (base->getType().isUnsizedArray()) + base->getWritableType().updateImplicitArraySize(indexValue + 1); + else + checkIndex(loc, base->getType(), indexValue); result = intermediate.addIndex(EOpIndexDirect, base, index, loc); - } else { + } else result = intermediate.addIndex(EOpIndexIndirect, base, index, loc); - } } } @@ -911,11 +873,6 @@ TIntermTyped* HlslParseContext::handleBracketDereference(const TSourceLoc& loc, return result; } -void HlslParseContext::checkIndex(const TSourceLoc& /*loc*/, const TType& /*type*/, int& /*index*/) -{ - // HLSL todo: any rules for index fixups? -} - // Handle seeing a binary node with a math operation. TIntermTyped* HlslParseContext::handleBinaryMath(const TSourceLoc& loc, const char* str, TOperator op, TIntermTyped* left, TIntermTyped* right) @@ -1150,9 +1107,7 @@ void HlslParseContext::splitBuiltIn(const TString& baseName, const TType& member TVariable* ioVar = makeInternalVariable(baseName + "." + memberType.getFieldName(), memberType); if (arraySizes != nullptr && !memberType.isArray()) - ioVar->getWritableType().newArraySizes(*arraySizes); - - fixBuiltInIoType(ioVar->getWritableType()); + ioVar->getWritableType().copyArraySizes(*arraySizes); splitBuiltIns[tInterstageIoData(memberType.getQualifier().builtIn, outerQualifier.storage)] = ioVar; if (!isClipOrCullDistance(ioVar->getType())) @@ -1160,6 +1115,12 @@ void HlslParseContext::splitBuiltIn(const TString& baseName, const TType& member // Merge qualifier from the user structure mergeQualifiers(ioVar->getWritableType().getQualifier(), outerQualifier); + + // Fix the builtin type if needed (e.g, some types require fixed array sizes, no matter how the + // shader declared them). This is done after mergeQualifiers(), in case fixBuiltInIoType looks + // at the qualifier to determine e.g, in or out qualifications. + fixBuiltInIoType(ioVar->getWritableType()); + // But, not location, we're losing that ioVar->getWritableType().getQualifier().layoutLocation = TQualifier::layoutLocationEnd; } @@ -1196,13 +1157,22 @@ const TType& HlslParseContext::split(const TType& type, const TString& name, con return type; } -// Is this a uniform array or structure which should be flattened? -bool HlslParseContext::shouldFlatten(const TType& type) const +// Is this an aggregate that should be flattened? +// Can be applied to intermediate levels of type in a hierarchy. +// Some things like flattening uniform arrays are only about the top level +// of the aggregate, triggered on 'topLevel'. +bool HlslParseContext::shouldFlatten(const TType& type, TStorageQualifier qualifier, bool topLevel) const { - const TStorageQualifier qualifier = type.getQualifier().storage; - - return (qualifier == EvqUniform && type.isArray() && intermediate.getFlattenUniformArrays()) || - (type.isStruct() && type.containsOpaque()); + switch (qualifier) { + case EvqVaryingIn: + case EvqVaryingOut: + return type.isStruct() || type.isArray(); + case EvqUniform: + return (type.isArray() && intermediate.getFlattenUniformArrays() && topLevel) || + (type.isStruct() && type.containsOpaque()); + default: + return false; + }; } // Top level variable flattening: construct data @@ -1273,7 +1243,7 @@ int HlslParseContext::addFlattenedMember(const TVariable& variable, const TType& const TQualifier& outerQualifier, const TArraySizes* builtInArraySizes) { - if (isFinalFlattening(type)) { + if (!shouldFlatten(type, outerQualifier.storage, false)) { // This is as far as we flatten. Insert the variable. TVariable* memberVariable = makeInternalVariable(memberName, type); mergeQualifiers(memberVariable->getWritableType().getQualifier(), variable.getType().getQualifier()); @@ -1288,7 +1258,7 @@ int HlslParseContext::addFlattenedMember(const TVariable& variable, const TType& // inherited locations must be auto bumped, not replicated if (flattenData.nextLocation != TQualifier::layoutLocationEnd) { memberVariable->getWritableType().getQualifier().layoutLocation = flattenData.nextLocation; - flattenData.nextLocation += intermediate.computeTypeLocationSize(memberVariable->getType()); + flattenData.nextLocation += intermediate.computeTypeLocationSize(memberVariable->getType(), language); nextOutLocation = std::max(nextOutLocation, flattenData.nextLocation); } } @@ -1333,7 +1303,7 @@ int HlslParseContext::flattenStruct(const TVariable& variable, const TType& type name + "." + dereferencedType.getFieldName(), linkage, outerQualifier, builtInArraySizes == nullptr && dereferencedType.isArray() - ? &dereferencedType.getArraySizes() + ? dereferencedType.getArraySizes() : builtInArraySizes); flattenData.offsets[pos++] = mpos; } @@ -1350,7 +1320,7 @@ int HlslParseContext::flattenArray(const TVariable& variable, const TType& type, TFlattenData& flattenData, TString name, bool linkage, const TQualifier& outerQualifier) { - assert(type.isArray() && !type.isImplicitlySizedArray()); + assert(type.isSizedArray()); const int size = type.getOuterArraySize(); const TType dereferencedType(type, 0); @@ -1397,11 +1367,13 @@ TIntermTyped* HlslParseContext::flattenAccess(TIntermTyped* base, int member) { const TType dereferencedType(base->getType(), member); // dereferenced type const TIntermSymbol& symbolNode = *base->getAsSymbolNode(); - TIntermTyped* flattened = flattenAccess(symbolNode.getId(), member, dereferencedType, symbolNode.getFlattenSubset()); + TIntermTyped* flattened = flattenAccess(symbolNode.getId(), member, base->getQualifier().storage, + dereferencedType, symbolNode.getFlattenSubset()); return flattened ? flattened : base; } -TIntermTyped* HlslParseContext::flattenAccess(int uniqueId, int member, const TType& dereferencedType, int subset) +TIntermTyped* HlslParseContext::flattenAccess(int uniqueId, int member, TStorageQualifier outerStorage, + const TType& dereferencedType, int subset) { const auto flattenData = flattenMap.find(uniqueId); @@ -1412,7 +1384,7 @@ TIntermTyped* HlslParseContext::flattenAccess(int uniqueId, int member, const TT int newSubset = flattenData->second.offsets[subset >= 0 ? subset + member : member]; TIntermSymbol* subsetSymbol; - if (isFinalFlattening(dereferencedType)) { + if (!shouldFlatten(dereferencedType, outerStorage, false)) { // Finished flattening: create symbol for variable member = flattenData->second.offsets[newSubset]; const TVariable* memberVariable = flattenData->second.members[member]; @@ -1429,6 +1401,44 @@ TIntermTyped* HlslParseContext::flattenAccess(int uniqueId, int member, const TT return subsetSymbol; } +// For finding where the first leaf is in a subtree of a multi-level aggregate +// that is just getting a subset assigned. Follows the same logic as flattenAccess, +// but logically going down the "left-most" tree branch each step of the way. +// +// Returns the offset into the first leaf of the subset. +int HlslParseContext::findSubtreeOffset(const TIntermNode& node) const +{ + const TIntermSymbol* sym = node.getAsSymbolNode(); + if (sym == nullptr) + return 0; + if (!sym->isArray() && !sym->isStruct()) + return 0; + int subset = sym->getFlattenSubset(); + if (subset == -1) + return 0; + + // Getting this far means a partial aggregate is identified by the flatten subset. + // Find the first leaf of the subset. + + const auto flattenData = flattenMap.find(sym->getId()); + if (flattenData == flattenMap.end()) + return 0; + + return findSubtreeOffset(sym->getType(), subset, flattenData->second.offsets); + + do { + subset = flattenData->second.offsets[subset]; + } while (true); +} +// Recursively do the desent +int HlslParseContext::findSubtreeOffset(const TType& type, int subset, const TVector& offsets) const +{ + if (!type.isArray() && !type.isStruct()) + return offsets[subset]; + TType derefType(type, 0); + return findSubtreeOffset(derefType, offsets[subset], offsets); +}; + // Find and return the split IO TVariable for id, or nullptr if none. TVariable* HlslParseContext::getSplitNonIoVar(int id) const { @@ -1483,10 +1493,18 @@ void HlslParseContext::fixBuiltInIoType(TType& type) } default: if (isClipOrCullDistance(type)) { + const int loc = type.getQualifier().layoutLocation; + if (type.getQualifier().builtIn == EbvClipDistance) { - clipSemanticNSize[type.getQualifier().layoutLocation] = type.getVectorSize(); + if (type.getQualifier().storage == EvqVaryingIn) + clipSemanticNSizeIn[loc] = type.getVectorSize(); + else + clipSemanticNSizeOut[loc] = type.getVectorSize(); } else { - cullSemanticNSize[type.getQualifier().layoutLocation] = type.getVectorSize(); + if (type.getQualifier().storage == EvqVaryingIn) + cullSemanticNSizeIn[loc] = type.getVectorSize(); + else + cullSemanticNSizeOut[loc] = type.getVectorSize(); } } @@ -1496,9 +1514,9 @@ void HlslParseContext::fixBuiltInIoType(TType& type) // Alter or set array size as needed. if (requiredArraySize > 0) { if (!type.isArray() || type.getOuterArraySize() != requiredArraySize) { - TArraySizes arraySizes; - arraySizes.addInnerSize(requiredArraySize); - type.newArraySizes(arraySizes); + TArraySizes* arraySizes = new TArraySizes; + arraySizes->addInnerSize(requiredArraySize); + type.transferArraySizes(arraySizes); } } } @@ -1520,9 +1538,9 @@ void HlslParseContext::assignToInterface(TVariable& variable) int size; if (type.isArray() && qualifier.isArrayedIo(language)) { TType elementType(type, 0); - size = intermediate.computeTypeLocationSize(elementType); + size = intermediate.computeTypeLocationSize(elementType, language); } else - size = intermediate.computeTypeLocationSize(type); + size = intermediate.computeTypeLocationSize(type, language); if (qualifier.storage == EvqVaryingIn) { variable.getWritableType().getQualifier().layoutLocation = nextInLocation; @@ -1592,7 +1610,7 @@ void HlslParseContext::addStructBufferHiddenCounterParam(const TSourceLoc& loc, if (! hasStructBuffCounter(*param.type)) return; - const TString counterBlockName(getStructBuffCounterName(*param.name)); + const TString counterBlockName(intermediate.addCounterBufferName(*param.name)); TType counterType; counterBufferType(loc, counterType); @@ -1613,7 +1631,7 @@ void HlslParseContext::addStructBufferHiddenCounterParam(const TSourceLoc& loc, // Returns an aggregate of parameter-symbol nodes. // TIntermAggregate* HlslParseContext::handleFunctionDefinition(const TSourceLoc& loc, TFunction& function, - const TAttributeMap& attributes, + const TAttributes& attributes, TIntermNode*& entryPointTree) { currentCaller = function.getMangledName(); @@ -1674,7 +1692,7 @@ TIntermAggregate* HlslParseContext::handleFunctionDefinition(const TSourceLoc& l error(loc, "redefinition", variable->getName().c_str(), ""); // Add parameters to the AST list. - if (shouldFlatten(variable->getType())) { + if (shouldFlatten(variable->getType(), variable->getType().getQualifier().storage, true)) { // Expand the AST parameter nodes (but not the name mangling or symbol table view) // for structures that need to be flattened. flatten(*variable, false); @@ -1682,7 +1700,8 @@ TIntermAggregate* HlslParseContext::handleFunctionDefinition(const TSourceLoc& l for (int mem = 0; mem < (int)structure->size(); ++mem) { paramNodes = intermediate.growAggregate(paramNodes, flattenAccess(variable->getUniqueId(), mem, - *(*structure)[mem].type), + variable->getType().getQualifier().storage, + *(*structure)[mem].type), loc); } } else { @@ -1708,151 +1727,217 @@ TIntermAggregate* HlslParseContext::handleFunctionDefinition(const TSourceLoc& l return paramNodes; } - // Handle all [attrib] attribute for the shader entry point -void HlslParseContext::handleEntryPointAttributes(const TSourceLoc& loc, const TAttributeMap& attributes) +void HlslParseContext::handleEntryPointAttributes(const TSourceLoc& loc, const TAttributes& attributes) { - // Handle entry-point function attributes - const TIntermAggregate* numThreads = attributes[EatNumThreads]; - if (numThreads != nullptr) { - const TIntermSequence& sequence = numThreads->getSequence(); - - for (int lid = 0; lid < int(sequence.size()); ++lid) - intermediate.setLocalSize(lid, sequence[lid]->getAsConstantUnion()->getConstArray()[0].getIConst()); - } - - // MaxVertexCount - const TIntermAggregate* maxVertexCount = attributes[EatMaxVertexCount]; - if (maxVertexCount != nullptr) { - if (! intermediate.setVertices(maxVertexCount->getSequence()[0]->getAsConstantUnion()-> - getConstArray()[0].getIConst())) { - error(loc, "cannot change previously set maxvertexcount attribute", "", ""); - } - } - - // Handle [patchconstantfunction("...")] - const TIntermAggregate* pcfAttr = attributes[EatPatchConstantFunc]; - if (pcfAttr != nullptr) { - const TConstUnion& pcfName = pcfAttr->getSequence()[0]->getAsConstantUnion()->getConstArray()[0]; - - if (pcfName.getType() != EbtString) { - error(loc, "invalid patch constant function", "", ""); - } else { - patchConstantFunctionName = *pcfName.getSConst(); + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + switch (it->name) { + case EatNumThreads: + { + const TIntermSequence& sequence = it->args->getSequence(); + for (int lid = 0; lid < int(sequence.size()); ++lid) + intermediate.setLocalSize(lid, sequence[lid]->getAsConstantUnion()->getConstArray()[0].getIConst()); + break; } - } - - // Handle [domain("...")] - const TIntermAggregate* domainAttr = attributes[EatDomain]; - if (domainAttr != nullptr) { - const TConstUnion& domainType = domainAttr->getSequence()[0]->getAsConstantUnion()->getConstArray()[0]; - if (domainType.getType() != EbtString) { - error(loc, "invalid domain", "", ""); - } else { - TString domainStr = *domainType.getSConst(); - std::transform(domainStr.begin(), domainStr.end(), domainStr.begin(), ::tolower); - - TLayoutGeometry domain = ElgNone; + case EatMaxVertexCount: + { + int maxVertexCount; - if (domainStr == "tri") { - domain = ElgTriangles; - } else if (domainStr == "quad") { - domain = ElgQuads; - } else if (domainStr == "isoline") { - domain = ElgIsolines; + if (! it->getInt(maxVertexCount)) { + error(loc, "invalid maxvertexcount", "", ""); } else { - error(loc, "unsupported domain type", domainStr.c_str(), ""); + if (! intermediate.setVertices(maxVertexCount)) + error(loc, "cannot change previously set maxvertexcount attribute", "", ""); } - - if (language == EShLangTessEvaluation) { - if (! intermediate.setInputPrimitive(domain)) - error(loc, "cannot change previously set domain", TQualifier::getGeometryString(domain), ""); + break; + } + case EatPatchConstantFunc: + { + TString pcfName; + if (! it->getString(pcfName, 0, false)) { + error(loc, "invalid patch constant function", "", ""); } else { - if (! intermediate.setOutputPrimitive(domain)) - error(loc, "cannot change previously set domain", TQualifier::getGeometryString(domain), ""); + patchConstantFunctionName = pcfName; } + break; } - } - - // Handle [outputtopology("...")] - const TIntermAggregate* topologyAttr = attributes[EatOutputTopology]; - if (topologyAttr != nullptr) { - const TConstUnion& topoType = topologyAttr->getSequence()[0]->getAsConstantUnion()->getConstArray()[0]; - if (topoType.getType() != EbtString) { - error(loc, "invalid outputtopology", "", ""); - } else { - TString topologyStr = *topoType.getSConst(); - std::transform(topologyStr.begin(), topologyStr.end(), topologyStr.begin(), ::tolower); - - TVertexOrder vertexOrder = EvoNone; - TLayoutGeometry primitive = ElgNone; - - if (topologyStr == "point") { - intermediate.setPointMode(); - } else if (topologyStr == "line") { - primitive = ElgIsolines; - } else if (topologyStr == "triangle_cw") { - vertexOrder = EvoCw; - primitive = ElgTriangles; - } else if (topologyStr == "triangle_ccw") { - vertexOrder = EvoCcw; - primitive = ElgTriangles; + case EatDomain: + { + // Handle [domain("...")] + TString domainStr; + if (! it->getString(domainStr)) { + error(loc, "invalid domain", "", ""); } else { - error(loc, "unsupported outputtopology type", topologyStr.c_str(), ""); - } + TLayoutGeometry domain = ElgNone; + + if (domainStr == "tri") { + domain = ElgTriangles; + } else if (domainStr == "quad") { + domain = ElgQuads; + } else if (domainStr == "isoline") { + domain = ElgIsolines; + } else { + error(loc, "unsupported domain type", domainStr.c_str(), ""); + } - if (vertexOrder != EvoNone) { - if (! intermediate.setVertexOrder(vertexOrder)) { - error(loc, "cannot change previously set outputtopology", - TQualifier::getVertexOrderString(vertexOrder), ""); + if (language == EShLangTessEvaluation) { + if (! intermediate.setInputPrimitive(domain)) + error(loc, "cannot change previously set domain", TQualifier::getGeometryString(domain), ""); + } else { + if (! intermediate.setOutputPrimitive(domain)) + error(loc, "cannot change previously set domain", TQualifier::getGeometryString(domain), ""); } } - if (primitive != ElgNone) - intermediate.setOutputPrimitive(primitive); + break; } - } - - // Handle [partitioning("...")] - const TIntermAggregate* partitionAttr = attributes[EatPartitioning]; - if (partitionAttr != nullptr) { - const TConstUnion& partType = partitionAttr->getSequence()[0]->getAsConstantUnion()->getConstArray()[0]; - if (partType.getType() != EbtString) { - error(loc, "invalid partitioning", "", ""); - } else { - TString partitionStr = *partType.getSConst(); - std::transform(partitionStr.begin(), partitionStr.end(), partitionStr.begin(), ::tolower); + case EatOutputTopology: + { + // Handle [outputtopology("...")] + TString topologyStr; + if (! it->getString(topologyStr)) { + error(loc, "invalid outputtopology", "", ""); + } else { + TVertexOrder vertexOrder = EvoNone; + TLayoutGeometry primitive = ElgNone; + + if (topologyStr == "point") { + intermediate.setPointMode(); + } else if (topologyStr == "line") { + primitive = ElgIsolines; + } else if (topologyStr == "triangle_cw") { + vertexOrder = EvoCw; + primitive = ElgTriangles; + } else if (topologyStr == "triangle_ccw") { + vertexOrder = EvoCcw; + primitive = ElgTriangles; + } else { + error(loc, "unsupported outputtopology type", topologyStr.c_str(), ""); + } - TVertexSpacing partitioning = EvsNone; + if (vertexOrder != EvoNone) { + if (! intermediate.setVertexOrder(vertexOrder)) { + error(loc, "cannot change previously set outputtopology", + TQualifier::getVertexOrderString(vertexOrder), ""); + } + } + if (primitive != ElgNone) + intermediate.setOutputPrimitive(primitive); + } + break; + } + case EatPartitioning: + { + // Handle [partitioning("...")] + TString partitionStr; + if (! it->getString(partitionStr)) { + error(loc, "invalid partitioning", "", ""); + } else { + TVertexSpacing partitioning = EvsNone; - if (partitionStr == "integer") { - partitioning = EvsEqual; - } else if (partitionStr == "fractional_even") { - partitioning = EvsFractionalEven; - } else if (partitionStr == "fractional_odd") { - partitioning = EvsFractionalOdd; - //} else if (partition == "pow2") { // TODO: currently nothing to map this to. + if (partitionStr == "integer") { + partitioning = EvsEqual; + } else if (partitionStr == "fractional_even") { + partitioning = EvsFractionalEven; + } else if (partitionStr == "fractional_odd") { + partitioning = EvsFractionalOdd; + //} else if (partition == "pow2") { // TODO: currently nothing to map this to. + } else { + error(loc, "unsupported partitioning type", partitionStr.c_str(), ""); + } + + if (! intermediate.setVertexSpacing(partitioning)) + error(loc, "cannot change previously set partitioning", + TQualifier::getVertexSpacingString(partitioning), ""); + } + break; + } + case EatOutputControlPoints: + { + // Handle [outputcontrolpoints("...")] + int ctrlPoints; + if (! it->getInt(ctrlPoints)) { + error(loc, "invalid outputcontrolpoints", "", ""); } else { - error(loc, "unsupported partitioning type", partitionStr.c_str(), ""); + if (! intermediate.setVertices(ctrlPoints)) { + error(loc, "cannot change previously set outputcontrolpoints attribute", "", ""); + } } - - if (! intermediate.setVertexSpacing(partitioning)) - error(loc, "cannot change previously set partitioning", - TQualifier::getVertexSpacingString(partitioning), ""); + break; + } + case EatBuiltIn: + case EatLocation: + // tolerate these because of dual use of entrypoint and type attributes + break; + default: + warn(loc, "attribute does not apply to entry point", "", ""); + break; } } +} - // Handle [outputcontrolpoints("...")] - const TIntermAggregate* outputControlPoints = attributes[EatOutputControlPoints]; - if (outputControlPoints != nullptr) { - const TConstUnion& ctrlPointConst = - outputControlPoints->getSequence()[0]->getAsConstantUnion()->getConstArray()[0]; - if (ctrlPointConst.getType() != EbtInt) { - error(loc, "invalid outputcontrolpoints", "", ""); - } else { - const int ctrlPoints = ctrlPointConst.getIConst(); - if (! intermediate.setVertices(ctrlPoints)) { - error(loc, "cannot change previously set outputcontrolpoints attribute", "", ""); +// Update the given type with any type-like attribute information in the +// attributes. +void HlslParseContext::transferTypeAttributes(const TSourceLoc& loc, const TAttributes& attributes, TType& type, + bool allowEntry) +{ + if (attributes.size() == 0) + return; + + int value; + TString builtInString; + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + switch (it->name) { + case EatLocation: + // location + if (it->getInt(value)) + type.getQualifier().layoutLocation = value; + break; + case EatBinding: + // binding + if (it->getInt(value)) { + type.getQualifier().layoutBinding = value; + type.getQualifier().layoutSet = 0; + } + // set + if (it->getInt(value, 1)) + type.getQualifier().layoutSet = value; + break; + case EatGlobalBinding: + // global cbuffer binding + if (it->getInt(value)) + globalUniformBinding = value; + // global cbuffer binding + if (it->getInt(value, 1)) + globalUniformSet = value; + break; + case EatInputAttachment: + // input attachment + if (it->getInt(value)) + type.getQualifier().layoutAttachment = value; + break; + case EatBuiltIn: + // PointSize built-in + if (it->getString(builtInString, 0, false)) { + if (builtInString == "PointSize") + type.getQualifier().builtIn = EbvPointSize; + } + break; + case EatPushConstant: + // push_constant + type.getQualifier().layoutPushConstant = true; + break; + case EatConstantId: + // specialization constant + if (it->getInt(value)) { + TSourceLoc loc; + loc.init(); + setSpecConstantId(loc, type.getQualifier(), value); } + break; + default: + if (! allowEntry) + warn(loc, "attribute does not apply to a type", "", ""); + break; } } } @@ -1890,7 +1975,7 @@ void HlslParseContext::handleEntryPointAttributes(const TSourceLoc& loc, const T // a subtree that creates the entry point. // TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunction& userFunction, - const TAttributeMap& attributes) + const TAttributes& attributes) { // Return true if this is a tessellation patch constant function input to a domain shader. const auto isDsPcfInput = [this](const TType& type) { @@ -1926,7 +2011,7 @@ TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunct if (variable.getType().getQualifier().isArrayedIo(language)) { if (variable.getType().containsBuiltIn()) split(variable); - } else + } else if (shouldFlatten(variable.getType(), EvqVaryingIn /* not assigned yet, but close enough */, true)) flatten(variable, false /* don't track linkage here, it will be tracked in assignToInterface() */); } // TODO: flatten arrays too @@ -1984,6 +2069,11 @@ TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunct TParameter& param = userFunction[i]; argVars.push_back(makeInternalVariable(*param.name, *param.type)); argVars.back()->getWritableType().getQualifier().makeTemporary(); + + // Track the input patch, which is the only non-builtin supported by hull shader PCF. + if (param.getDeclaredBuiltIn() == EbvInputPatch) + inputPatch = argVars.back(); + TIntermSymbol* arg = intermediate.addSymbol(*argVars.back()); handleFunctionArgument(&callee, callingArgs, arg); if (param.type->getQualifier().isParamInput()) { @@ -2024,7 +2114,10 @@ TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunct TIntermTyped* element = intermediate.addIndex(EOpIndexIndirect, intermediate.addSymbol(*entryPointOutput), invocationIdSym, loc); - element->setType(callReturn->getType()); + + // Set the type of the array element being dereferenced + const TType derefElementType(entryPointOutput->getType(), 0); + element->setType(derefElementType); returnAssign = handleAssign(loc, EOpAssign, element, callReturn); } else { @@ -2182,9 +2275,9 @@ void HlslParseContext::remapEntryPointIO(TFunction& function, TVariable*& return outputType.shallowCopy(function.getType()); // vertices has necessarily already been set when handling entry point attributes. - TArraySizes arraySizes; - arraySizes.addInnerSize(intermediate.getVertices()); - outputType.newArraySizes(arraySizes); + TArraySizes* arraySizes = new TArraySizes; + arraySizes->addInnerSize(intermediate.getVertices()); + outputType.transferArraySizes(arraySizes); clearUniformInputOutput(function.getWritableType().getQualifier()); returnValue = makeIoVariable("@entryPointOutput", outputType, EvqVaryingOut); @@ -2200,9 +2293,6 @@ void HlslParseContext::remapEntryPointIO(TFunction& function, TVariable*& return synthesizeEditedInput(paramType); TVariable* argAsGlobal = makeIoVariable(function[i].name->c_str(), paramType, EvqVaryingIn); inputs.push_back(argAsGlobal); - - if (function[i].getDeclaredBuiltIn() == EbvInputPatch) - inputPatch = argAsGlobal; } if (paramType.getQualifier().isParamOutput()) { TVariable* argAsGlobal = makeIoVariable(function[i].name->c_str(), paramType, EvqVaryingOut); @@ -2261,6 +2351,63 @@ void HlslParseContext::handleFunctionArgument(TFunction* function, arguments = newArg; } +// Position may require special handling: we can optionally invert Y. +// See: https://github.com/KhronosGroup/glslang/issues/1173 +// https://github.com/KhronosGroup/glslang/issues/494 +TIntermTyped* HlslParseContext::assignPosition(const TSourceLoc& loc, TOperator op, + TIntermTyped* left, TIntermTyped* right) +{ + // If we are not asked for Y inversion, use a plain old assign. + if (!intermediate.getInvertY()) + return intermediate.addAssign(op, left, right, loc); + + // If we get here, we should invert Y. + TIntermAggregate* assignList = nullptr; + + // If this is a complex rvalue, we don't want to dereference it many times. Create a temporary. + TVariable* rhsTempVar = nullptr; + rhsTempVar = makeInternalVariable("@position", right->getType()); + rhsTempVar->getWritableType().getQualifier().makeTemporary(); + + { + TIntermTyped* rhsTempSym = intermediate.addSymbol(*rhsTempVar, loc); + assignList = intermediate.growAggregate(assignList, + intermediate.addAssign(EOpAssign, rhsTempSym, right, loc), loc); + } + + // pos.y = -pos.y + { + const int Y = 1; + + TIntermTyped* tempSymL = intermediate.addSymbol(*rhsTempVar, loc); + TIntermTyped* tempSymR = intermediate.addSymbol(*rhsTempVar, loc); + TIntermTyped* index = intermediate.addConstantUnion(Y, loc); + + TIntermTyped* lhsElement = intermediate.addIndex(EOpIndexDirect, tempSymL, index, loc); + TIntermTyped* rhsElement = intermediate.addIndex(EOpIndexDirect, tempSymR, index, loc); + + const TType derefType(right->getType(), 0); + + lhsElement->setType(derefType); + rhsElement->setType(derefType); + + TIntermTyped* yNeg = intermediate.addUnaryMath(EOpNegative, rhsElement, loc); + + assignList = intermediate.growAggregate(assignList, intermediate.addAssign(EOpAssign, lhsElement, yNeg, loc)); + } + + // Assign the rhs temp (now with Y inversion) to the final output + { + TIntermTyped* rhsTempSym = intermediate.addSymbol(*rhsTempVar, loc); + assignList = intermediate.growAggregate(assignList, intermediate.addAssign(op, left, rhsTempSym, loc)); + } + + assert(assignList != nullptr); + assignList->setOperator(EOpSequence); + + return assignList; +} + // Clip and cull distance require special handling due to a semantic mismatch. In HLSL, // these can be float scalar, float vector, or arrays of float scalar or float vector. // In SPIR-V, they are arrays of scalar floats in all cases. We must copy individual components @@ -2274,6 +2421,7 @@ TIntermAggregate* HlslParseContext::assignClipCullDistance(const TSourceLoc& loc switch (language) { case EShLangFragment: case EShLangVertex: + case EShLangGeometry: break; default: error(loc, "unimplemented: clip/cull not currently implemented for this stage", "", ""); @@ -2292,17 +2440,17 @@ TIntermAggregate* HlslParseContext::assignClipCullDistance(const TSourceLoc& loc const TBuiltInVariable builtInType = clipCullNode->getQualifier().builtIn; - decltype(clipSemanticNSize)* semanticNSize = nullptr; + decltype(clipSemanticNSizeIn)* semanticNSize = nullptr; // Refer to either the clip or the cull distance, depending on semantic. switch (builtInType) { case EbvClipDistance: - clipCullVar = &clipDistanceVariable; - semanticNSize = &clipSemanticNSize; + clipCullVar = isOutput ? &clipDistanceOutput : &clipDistanceInput; + semanticNSize = isOutput ? &clipSemanticNSizeOut : &clipSemanticNSizeIn; break; case EbvCullDistance: - clipCullVar = &cullDistanceVariable; - semanticNSize = &cullSemanticNSize; + clipCullVar = isOutput ? &cullDistanceOutput : &cullDistanceInput; + semanticNSize = isOutput ? &cullSemanticNSizeOut : &cullSemanticNSizeIn; break; // called invalidly: we expected a clip or a cull distance. @@ -2328,29 +2476,49 @@ TIntermAggregate* HlslParseContext::assignClipCullDistance(const TSourceLoc& loc vecItems += (*semanticNSize)[x]; arrayLoc += (*semanticNSize)[x]; } - - // array sizes, or 1 if it's not an array: - const int internalNodeArraySize = (internalNode->getType().isArray() ? internalNode->getType().getOuterArraySize() : 1); + + + // It can have up to 2 array dimensions (in the case of geometry shader inputs) + const TArraySizes* const internalArraySizes = internalNode->getType().getArraySizes(); + const int internalArrayDims = internalNode->getType().isArray() ? internalArraySizes->getNumDims() : 0; // vector sizes: - const int internalNodeVectorSize = internalNode->getType().getVectorSize(); + const int internalVectorSize = internalNode->getType().getVectorSize(); + // array sizes, or 1 if it's not an array: + const int internalInnerArraySize = (internalArrayDims > 0 ? internalArraySizes->getDimSize(internalArrayDims-1) : 1); + const int internalOuterArraySize = (internalArrayDims > 1 ? internalArraySizes->getDimSize(0) : 1); + + // The created type may be an array of arrays, e.g, for geometry shader inputs. + const bool isImplicitlyArrayed = (language == EShLangGeometry && !isOutput); // If we haven't created the output already, create it now. if (*clipCullVar == nullptr) { // ClipDistance and CullDistance are handled specially in the entry point input/output copy // algorithm, because they may need to be unpacked from components of vectors (or a scalar) // into a float array, or vice versa. Here, we make the array the right size and type, - // which depends on the incoming data, which has several potential dimensions: Semantic ID - // vector size array size Of those, semantic ID and array size cannot appear - // simultaneously. - const int requiredArraySize = arrayLoc * internalNodeArraySize; + // which depends on the incoming data, which has several potential dimensions: + // * Semantic ID + // * vector size + // * array size + // Of those, semantic ID and array size cannot appear simultaneously. + // + // Also to note: for implicitly arrayed forms (e.g, geometry shader inputs), we need to create two + // array dimensions. The shader's declaration may have one or two array dimensions. One is always + // the geometry's dimension. + + const bool useInnerSize = internalArrayDims > 1 || !isImplicitlyArrayed; + + const int requiredInnerArraySize = arrayLoc * (useInnerSize ? internalInnerArraySize : 1); + const int requiredOuterArraySize = (internalArrayDims > 0) ? internalArraySizes->getDimSize(0) : 1; TType clipCullType(EbtFloat, clipCullNode->getType().getQualifier().storage, 1); clipCullType.getQualifier() = clipCullNode->getType().getQualifier(); // Create required array dimension - TArraySizes arraySizes; - arraySizes.addInnerSize(requiredArraySize); - clipCullType.newArraySizes(arraySizes); + TArraySizes* arraySizes = new TArraySizes; + if (isImplicitlyArrayed) + arraySizes->addInnerSize(requiredOuterArraySize); + arraySizes->addInnerSize(requiredInnerArraySize); + clipCullType.transferArraySizes(arraySizes); // Obtain symbol name: we'll use that for the symbol we introduce. TIntermSymbol* sym = clipCullNode->getAsSymbolNode(); @@ -2369,10 +2537,13 @@ TIntermAggregate* HlslParseContext::assignClipCullDistance(const TSourceLoc& loc // Create symbol for the clip or cull variable. TIntermSymbol* clipCullSym = intermediate.addSymbol(**clipCullVar); - // array sizes, or 1 if it's not an array: - const int clipCullSymArraySize = (clipCullSym->getType().isArray() ? clipCullSym->getType().getOuterArraySize() : 1); // vector sizes: - const int clipCullSymVectorSize = clipCullSym->getType().getVectorSize(); + const int clipCullVectorSize = clipCullSym->getType().getVectorSize(); + + // array sizes, or 1 if it's not an array: + const TArraySizes* const clipCullArraySizes = clipCullSym->getType().getArraySizes(); + const int clipCullOuterArraySize = isImplicitlyArrayed ? clipCullArraySizes->getDimSize(0) : 1; + const int clipCullInnerArraySize = clipCullArraySizes->getDimSize(isImplicitlyArrayed ? 1 : 0); // clipCullSym has got to be an array of scalar floats, per SPIR-V semantics. // fixBuiltInIoType() should have handled that upstream. @@ -2390,8 +2561,9 @@ TIntermAggregate* HlslParseContext::assignClipCullDistance(const TSourceLoc& loc // If the types are homomorphic, use a simple assign. No need to mess about with // individual components. if (clipCullSym->getType().isArray() == internalNode->getType().isArray() && - clipCullSymArraySize == internalNodeArraySize && - clipCullSymVectorSize == internalNodeVectorSize) { + clipCullInnerArraySize == internalInnerArraySize && + clipCullOuterArraySize == internalOuterArraySize && + clipCullVectorSize == internalVectorSize) { if (isOutput) clipCullAssign = intermediate.addAssign(op, clipCullSym, internalNode, loc); @@ -2407,47 +2579,61 @@ TIntermAggregate* HlslParseContext::assignClipCullDistance(const TSourceLoc& loc // We are going to copy each component of the internal (per array element if indicated) to sequential // array elements of the clipCullSym. This tracks the lhs element we're writing to as we go along. // We may be starting in the middle - e.g, for a non-zero semantic ID calculated above. - int clipCullArrayPos = semanticOffset[semanticId]; + int clipCullInnerArrayPos = semanticOffset[semanticId]; + int clipCullOuterArrayPos = 0; + + // Lambda to add an index to a node, set the type of the result, and return the new node. + const auto addIndex = [this, &loc](TIntermTyped* node, int pos) -> TIntermTyped* { + const TType derefType(node->getType(), 0); + node = intermediate.addIndex(EOpIndexDirect, node, intermediate.addConstantUnion(pos, loc), loc); + node->setType(derefType); + return node; + }; // Loop through every component of every element of the internal, and copy to or from the matching external. - for (int internalArrayPos = 0; internalArrayPos < internalNodeArraySize; ++internalArrayPos) { - for (int internalComponent = 0; internalComponent < internalNodeVectorSize; ++internalComponent) { - TIntermTyped* clipCullMember = clipCullSym; + for (int internalOuterArrayPos = 0; internalOuterArrayPos < internalOuterArraySize; ++internalOuterArrayPos) { + for (int internalInnerArrayPos = 0; internalInnerArrayPos < internalInnerArraySize; ++internalInnerArrayPos) { + for (int internalComponent = 0; internalComponent < internalVectorSize; ++internalComponent) { + // clip/cull array member to read from / write to: + TIntermTyped* clipCullMember = clipCullSym; + + // If implicitly arrayed, there is an outer array dimension involved + if (isImplicitlyArrayed) + clipCullMember = addIndex(clipCullMember, clipCullOuterArrayPos); + + // Index into proper array position for clip cull member + clipCullMember = addIndex(clipCullMember, clipCullInnerArrayPos++); + + // if needed, start over with next outer array slice. + if (isImplicitlyArrayed && clipCullInnerArrayPos >= clipCullInnerArraySize) { + clipCullInnerArrayPos = semanticOffset[semanticId]; + ++clipCullOuterArrayPos; + } - // array member to read from / write to: - { - const TType derefType(clipCullMember->getType(), 0); - clipCullMember = intermediate.addIndex(EOpIndexDirect, clipCullMember, - intermediate.addConstantUnion(clipCullArrayPos++, loc), loc); - clipCullMember->setType(derefType); - } + // internal member to read from / write to: + TIntermTyped* internalMember = internalNode; - TIntermTyped* internalMember = internalNode; + // If internal node has outer array dimension, index appropriately. + if (internalArrayDims > 1) + internalMember = addIndex(internalMember, internalOuterArrayPos); - // If internal node is an array, extract the element of interest - if (internalNode->getType().isArray()) { - const TType derefType(internalMember->getType(), 0); - internalMember = intermediate.addIndex(EOpIndexDirect, internalMember, - intermediate.addConstantUnion(internalArrayPos, loc), loc); - internalMember->setType(derefType); - } + // If internal node has inner array dimension, index appropriately. + if (internalArrayDims > 0) + internalMember = addIndex(internalMember, internalInnerArrayPos); - // If internal node is a vector, extract the component of interest. - if (internalNode->getType().isVector()) { - const TType derefType(internalMember->getType(), 0); - internalMember = intermediate.addIndex(EOpIndexDirect, internalMember, - intermediate.addConstantUnion(internalComponent, loc), loc); - internalMember->setType(derefType); - } + // If internal node is a vector, extract the component of interest. + if (internalNode->getType().isVector()) + internalMember = addIndex(internalMember, internalComponent); - // Create an assignment: output from internal to clip cull, or input from clip cull to internal. - if (isOutput) - clipCullAssign = intermediate.addAssign(op, clipCullMember, internalMember, loc); - else - clipCullAssign = intermediate.addAssign(op, internalMember, clipCullMember, loc); + // Create an assignment: output from internal to clip cull, or input from clip cull to internal. + if (isOutput) + clipCullAssign = intermediate.addAssign(op, clipCullMember, internalMember, loc); + else + clipCullAssign = intermediate.addAssign(op, internalMember, clipCullMember, loc); - // Track assignment in the sequence. - assignList = intermediate.growAggregate(assignList, clipCullAssign); + // Track assignment in the sequence. + assignList = intermediate.growAggregate(assignList, clipCullAssign); + } } } @@ -2457,41 +2643,6 @@ TIntermAggregate* HlslParseContext::assignClipCullDistance(const TSourceLoc& loc return assignList; } -// For a declaration with an initializer, where the initialized symbol is flattened, -// and possibly contains opaque values, such that the initializer should never exist -// as emitted code, because even creating the initializer would write opaques. -// -// If possible, decompose this into individual member-wise assignments, which themselves -// are expected to then not exist for opaque types, because they will turn into aliases. -// -// Return a node that contains the non-aliased assignments that must continue to exist. -TIntermTyped* HlslParseContext::executeFlattenedInitializer(const TSourceLoc& loc, TIntermSymbol* symbol, - TIntermAggregate& initializer) -{ - // We need individual RHS initializers per member to do this - const TTypeList* typeList = symbol->getType().getStruct(); - if (typeList == nullptr || initializer.getSequence().size() != typeList->size()) { - warn(loc, "cannot do member-wise aliasing for opaque members with this initializer", "=", ""); - return handleAssign(loc, EOpAssign, symbol, &initializer); - } - - TIntermAggregate* initList = nullptr; - // synthesize an access to each member, and then an assignment to it - for (int member = 0; member < (int)typeList->size(); ++member) { - TIntermTyped* memberInitializer = initializer.getSequence()[member]->getAsTyped(); - TIntermTyped* flattenedMember = flattenAccess(symbol, member); - if (flattenedMember->getType().containsOpaque()) - setOpaqueLvalue(flattenedMember, memberInitializer); - else - initList = intermediate.growAggregate(initList, handleAssign(loc, EOpAssign, flattenedMember, - memberInitializer)); - } - - if (initList) - initList->setOperator(EOpSequence); - return initList; -} - // Some simple source assignments need to be flattened to a sequence // of AST assignments. Catch these and flatten, otherwise, pass through // to intermediate.addAssign(). @@ -2504,17 +2655,38 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op if (left == nullptr || right == nullptr) return nullptr; + // writing to opaques will require fixing transforms + if (left->getType().containsOpaque()) + intermediate.setNeedsLegalization(); + if (left->getAsOperator() && left->getAsOperator()->getOp() == EOpMatrixSwizzle) return handleAssignToMatrixSwizzle(loc, op, left, right); - const bool isSplitLeft = wasSplit(left); - const bool isSplitRight = wasSplit(right); + // Return true if the given node is an index operation into a split variable. + const auto indexesSplit = [this](const TIntermTyped* node) -> bool { + const TIntermBinary* binaryNode = node->getAsBinaryNode(); + + if (binaryNode == nullptr) + return false; + + return (binaryNode->getOp() == EOpIndexDirect || binaryNode->getOp() == EOpIndexIndirect) && + wasSplit(binaryNode->getLeft()); + }; + + // Return true if this stage assigns clip position with potentially inverted Y + const auto assignsClipPos = [this](const TIntermTyped* node) -> bool { + return node->getType().getQualifier().builtIn == EbvPosition && + (language == EShLangVertex || language == EShLangGeometry || language == EShLangTessEvaluation); + }; + + const bool isSplitLeft = wasSplit(left) || indexesSplit(left); + const bool isSplitRight = wasSplit(right) || indexesSplit(right); const bool isFlattenLeft = wasFlattened(left); const bool isFlattenRight = wasFlattened(right); - // OK to do a single assign if both are split, or both are unsplit. But if one is and the other - // isn't, we fall back to a member-wise copy. + // OK to do a single assign if neither side is split or flattened. Otherwise, + // fall through to a member-wise copy. if (!isFlattenLeft && !isFlattenRight && !isSplitLeft && !isSplitRight) { // Clip and cull distance requires more processing. See comment above assignClipCullDistance. if (isClipOrCullDistance(left->getType()) || isClipOrCullDistance(right->getType())) { @@ -2522,6 +2694,9 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op const int semanticId = (isOutput ? left : right)->getType().getQualifier().layoutLocation; return assignClipCullDistance(loc, op, semanticId, left, right); + } else if (assignsClipPos(left)) { + // Position can require special handling: see comment above assignPosition + return assignPosition(loc, op, left, right); } return intermediate.addAssign(op, left, right, loc); @@ -2576,30 +2751,29 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op } } - int memberIdx = 0; - // When dealing with split arrayed structures of built-ins, the arrayness is moved to the extracted built-in // variables, which is awkward when copying between split and unsplit structures. This variable tracks // array indirections so they can be percolated from outer structs to inner variables. std::vector arrayElement; - // We track the outer-most aggregate, so that we can use its storage class later. - const TIntermTyped* outerLeft = left; - const TIntermTyped* outerRight = right; + TStorageQualifier leftStorage = left->getType().getQualifier().storage; + TStorageQualifier rightStorage = right->getType().getQualifier().storage; - const auto getMember = [&](bool isLeft, TIntermTyped* node, int member, TIntermTyped* splitNode, int splitMember) + int leftOffset = findSubtreeOffset(*left); + int rightOffset = findSubtreeOffset(*right); + + const auto getMember = [&](bool isLeft, const TType& type, int member, TIntermTyped* splitNode, int splitMember, + bool flattened) -> TIntermTyped * { - const bool flattened = isLeft ? isFlattenLeft : isFlattenRight; const bool split = isLeft ? isSplitLeft : isSplitRight; TIntermTyped* subTree; - const TType derefType(node->getType(), member); + const TType derefType(type, member); const TVariable* builtInVar = nullptr; if ((flattened || split) && derefType.isBuiltIn()) { - const TIntermTyped* outer = isLeft ? outerLeft : outerRight; auto splitPair = splitBuiltIns.find(HlslParseContext::tInterstageIoData( derefType.getQualifier().builtIn, - outer->getType().getQualifier().storage)); + isLeft ? leftStorage : rightStorage)); if (splitPair != splitBuiltIns.end()) builtInVar = splitPair->second; } @@ -2607,21 +2781,33 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op // copy from interstage IO built-in if needed subTree = intermediate.addSymbol(*builtInVar); - // Arrayness of builtIn symbols isn't handled by the normal recursion: - // it's been extracted and moved to the built-in. - if (subTree->getType().isArray() && !arrayElement.empty()) { - const TType splitDerefType(subTree->getType(), arrayElement.back()); - subTree = intermediate.addIndex(EOpIndexDirect, subTree, - intermediate.addConstantUnion(arrayElement.back(), loc), loc); - subTree->setType(splitDerefType); + if (subTree->getType().isArray()) { + // Arrayness of builtIn symbols isn't handled by the normal recursion: + // it's been extracted and moved to the built-in. + if (!arrayElement.empty()) { + const TType splitDerefType(subTree->getType(), arrayElement.back()); + subTree = intermediate.addIndex(EOpIndexDirect, subTree, + intermediate.addConstantUnion(arrayElement.back(), loc), loc); + subTree->setType(splitDerefType); + } else if (splitNode->getAsOperator() != nullptr && (splitNode->getAsOperator()->getOp() == EOpIndexIndirect)) { + // This might also be a stage with arrayed outputs, in which case there's an index + // operation we should transfer to the output builtin. + + const TType splitDerefType(subTree->getType(), 0); + subTree = intermediate.addIndex(splitNode->getAsOperator()->getOp(), subTree, + splitNode->getAsBinaryNode()->getRight(), loc); + subTree->setType(splitDerefType); + } } - } else if (flattened && isFinalFlattening(derefType)) { - const TVector& flatVariables = isLeft ? *leftVariables : *rightVariables; - subTree = intermediate.addSymbol(*flatVariables[memberIdx++]); + } else if (flattened && !shouldFlatten(derefType, isLeft ? leftStorage : rightStorage, false)) { + if (isLeft) + subTree = intermediate.addSymbol(*(*leftVariables)[leftOffset++]); + else + subTree = intermediate.addSymbol(*(*rightVariables)[rightOffset++]); } else { // Index operator if it's an aggregate, else EOpNull - const TOperator accessOp = node->getType().isArray() ? EOpIndexDirect - : node->getType().isStruct() ? EOpIndexDirectStruct + const TOperator accessOp = type.isArray() ? EOpIndexDirect + : type.isStruct() ? EOpIndexDirectStruct : EOpNull; if (accessOp == EOpNull) { subTree = splitNode; @@ -2644,16 +2830,24 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op // Cannot use auto here, because this is recursive, and auto can't work out the type without seeing the // whole thing. So, we'll resort to an explicit type via std::function. - const std::function - traverse = [&](TIntermTyped* left, TIntermTyped* right, TIntermTyped* splitLeft, TIntermTyped* splitRight) -> void { + const std::function + traverse = [&](TIntermTyped* left, TIntermTyped* right, TIntermTyped* splitLeft, TIntermTyped* splitRight, + bool topLevel) -> void { // If we get here, we are assigning to or from a whole array or struct that must be // flattened, so have to do member-by-member assignment: - if (left->getType().isArray() || right->getType().isArray()) { + bool shouldFlattenSubsetLeft = isFlattenLeft && shouldFlatten(left->getType(), leftStorage, topLevel); + bool shouldFlattenSubsetRight = isFlattenRight && shouldFlatten(right->getType(), rightStorage, topLevel); + + if ((left->getType().isArray() || right->getType().isArray()) && + (shouldFlattenSubsetLeft || isSplitLeft || + shouldFlattenSubsetRight || isSplitRight)) { const int elementsL = left->getType().isArray() ? left->getType().getOuterArraySize() : 1; const int elementsR = right->getType().isArray() ? right->getType().getOuterArraySize() : 1; - // The arrays may not be the same size, e.g, if the size has been forced for EbvTessLevelInner or Outer. + // The arrays might not be the same size, + // e.g., if the size has been forced for EbvTessLevelInner/Outer. const int elementsToCopy = std::min(elementsL, elementsR); // array case @@ -2661,19 +2855,24 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op arrayElement.push_back(element); // Add a new AST symbol node if we have a temp variable holding a complex RHS. - TIntermTyped* subLeft = getMember(true, left, element, left, element); - TIntermTyped* subRight = getMember(false, right, element, right, element); + TIntermTyped* subLeft = getMember(true, left->getType(), element, left, element, + shouldFlattenSubsetLeft); + TIntermTyped* subRight = getMember(false, right->getType(), element, right, element, + shouldFlattenSubsetRight); - TIntermTyped* subSplitLeft = isSplitLeft ? getMember(true, left, element, splitLeft, element) + TIntermTyped* subSplitLeft = isSplitLeft ? getMember(true, left->getType(), element, splitLeft, + element, shouldFlattenSubsetLeft) : subLeft; - TIntermTyped* subSplitRight = isSplitRight ? getMember(false, right, element, splitRight, element) + TIntermTyped* subSplitRight = isSplitRight ? getMember(false, right->getType(), element, splitRight, + element, shouldFlattenSubsetRight) : subRight; - traverse(subLeft, subRight, subSplitLeft, subSplitRight); + traverse(subLeft, subRight, subSplitLeft, subSplitRight, false); arrayElement.pop_back(); } - } else if (left->getType().isStruct()) { + } else if (left->getType().isStruct() && (shouldFlattenSubsetLeft || isSplitLeft || + shouldFlattenSubsetRight || isSplitRight)) { // struct case const auto& membersL = *left->getType().getStruct(); const auto& membersR = *right->getType().getStruct(); @@ -2691,13 +2890,17 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op const TType& typeL = *membersL[member].type; const TType& typeR = *membersR[member].type; - TIntermTyped* subLeft = getMember(true, left, member, left, member); - TIntermTyped* subRight = getMember(false, right, member, right, member); + TIntermTyped* subLeft = getMember(true, left->getType(), member, left, member, + shouldFlattenSubsetLeft); + TIntermTyped* subRight = getMember(false, right->getType(), member, right, member, + shouldFlattenSubsetRight); // If there is no splitting, use the same values to avoid inefficiency. - TIntermTyped* subSplitLeft = isSplitLeft ? getMember(true, left, member, splitLeft, memberL) + TIntermTyped* subSplitLeft = isSplitLeft ? getMember(true, left->getType(), member, splitLeft, + memberL, shouldFlattenSubsetLeft) : subLeft; - TIntermTyped* subSplitRight = isSplitRight ? getMember(false, right, member, splitRight, memberR) + TIntermTyped* subSplitRight = isSplitRight ? getMember(false, right->getType(), member, splitRight, + memberR, shouldFlattenSubsetRight) : subRight; if (isClipOrCullDistance(subSplitLeft->getType()) || isClipOrCullDistance(subSplitRight->getType())) { @@ -2715,10 +2918,12 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op subSplitLeft, subSplitRight); assignList = intermediate.growAggregate(assignList, clipCullAssign, loc); - - } else if (!isFlattenLeft && !isFlattenRight && - !typeL.containsBuiltIn() && - !typeR.containsBuiltIn()) { + } else if (assignsClipPos(subSplitLeft)) { + // Position can require special handling: see comment above assignPosition + TIntermTyped* positionAssign = assignPosition(loc, op, subSplitLeft, subSplitRight); + assignList = intermediate.growAggregate(assignList, positionAssign, loc); + } else if (!shouldFlattenSubsetLeft && !shouldFlattenSubsetRight && + !typeL.containsBuiltIn() && !typeR.containsBuiltIn()) { // If this is the final flattening (no nested types below to flatten) // we'll copy the member, else recurse into the type hierarchy. // However, if splitting the struct, that means we can copy a whole @@ -2731,7 +2936,7 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op intermediate.addAssign(op, subSplitLeft, subSplitRight, loc), loc); } else { - traverse(subLeft, subRight, subSplitLeft, subSplitRight); + traverse(subLeft, subRight, subSplitLeft, subSplitRight, false); } memberL += (typeL.isBuiltIn() ? 0 : 1); @@ -2749,14 +2954,31 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op // If either left or right was a split structure, we must read or write it, but still have to // parallel-recurse through the unsplit structure to identify the built-in IO vars. - if (isSplitLeft) - splitLeft = intermediate.addSymbol(*getSplitNonIoVar(left->getAsSymbolNode()->getId()), loc); + // The left can be either a symbol, or an index into a symbol (e.g, array reference) + if (isSplitLeft) { + if (indexesSplit(left)) { + // Index case: Refer to the indexed symbol, if the left is an index operator. + const TIntermSymbol* symNode = left->getAsBinaryNode()->getLeft()->getAsSymbolNode(); + + TIntermTyped* splitLeftNonIo = intermediate.addSymbol(*getSplitNonIoVar(symNode->getId()), loc); + + splitLeft = intermediate.addIndex(left->getAsBinaryNode()->getOp(), splitLeftNonIo, + left->getAsBinaryNode()->getRight(), loc); + + const TType derefType(splitLeftNonIo->getType(), 0); + splitLeft->setType(derefType); + } else { + // Symbol case: otherwise, if not indexed, we have the symbol directly. + const TIntermSymbol* symNode = left->getAsSymbolNode(); + splitLeft = intermediate.addSymbol(*getSplitNonIoVar(symNode->getId()), loc); + } + } if (isSplitRight) splitRight = intermediate.addSymbol(*getSplitNonIoVar(right->getAsSymbolNode()->getId()), loc); // This makes the whole assignment, recursing through subtypes as needed. - traverse(left, right, splitLeft, splitRight); + traverse(left, right, splitLeft, splitRight, true); assert(assignList != nullptr); assignList->setOperator(EOpSequence); @@ -2860,7 +3082,66 @@ TIntermAggregate* HlslParseContext::handleSamplerTextureCombine(const TSourceLoc TSampler samplerType = argTex->getType().getSampler(); samplerType.combined = true; - samplerType.shadow = argSampler->getType().getSampler().shadow; + + // TODO: + // This block exists until the spec no longer requires shadow modes on texture objects. + // It can be deleted after that, along with the shadowTextureVariant member. + { + const bool shadowMode = argSampler->getType().getSampler().shadow; + + TIntermSymbol* texSymbol = argTex->getAsSymbolNode(); + + if (texSymbol == nullptr) + texSymbol = argTex->getAsBinaryNode()->getLeft()->getAsSymbolNode(); + + if (texSymbol == nullptr) { + error(loc, "unable to find texture symbol", "", ""); + return nullptr; + } + + // This forces the texture's shadow state to be the sampler's + // shadow state. This depends on downstream optimization to + // DCE one variant in [shadow, nonshadow] if both are present, + // or the SPIR-V module would be invalid. + int newId = texSymbol->getId(); + + // Check to see if this texture has been given a shadow mode already. + // If so, look up the one we already have. + const auto textureShadowEntry = textureShadowVariant.find(texSymbol->getId()); + + if (textureShadowEntry != textureShadowVariant.end()) + newId = textureShadowEntry->second->get(shadowMode); + else + textureShadowVariant[texSymbol->getId()] = new tShadowTextureSymbols; + + // Sometimes we have to create another symbol (if this texture has been seen before, + // and we haven't created the form for this shadow mode). + if (newId == -1) { + TType texType; + texType.shallowCopy(argTex->getType()); + texType.getSampler().shadow = shadowMode; // set appropriate shadow mode. + globalQualifierFix(loc, texType.getQualifier()); + + TVariable* newTexture = makeInternalVariable(texSymbol->getName(), texType); + + trackLinkage(*newTexture); + + newId = newTexture->getUniqueId(); + } + + assert(newId != -1); + + if (textureShadowVariant.find(newId) == textureShadowVariant.end()) + textureShadowVariant[newId] = textureShadowVariant[texSymbol->getId()]; + + textureShadowVariant[newId]->set(shadowMode, newId); + + // Remember this shadow mode in the texture and the merged type. + argTex->getWritableType().getSampler().shadow = shadowMode; + samplerType.shadow = shadowMode; + + texSymbol->switchId(newId); + } txcombine->setType(TType(samplerType, EvqTemporary)); txcombine->setLoc(loc); @@ -2883,8 +3164,8 @@ bool HlslParseContext::hasStructBuffCounter(const TType& type) const void HlslParseContext::counterBufferType(const TSourceLoc& loc, TType& type) { // Counter type - TType* counterType = new TType(EbtInt, EvqBuffer); - counterType->setFieldName("@count"); + TType* counterType = new TType(EbtUint, EvqBuffer); + counterType->setFieldName(intermediate.implicitCounterName); TTypeList* blockStruct = new TTypeList; TTypeLoc member = { counterType, loc }; @@ -2897,12 +3178,6 @@ void HlslParseContext::counterBufferType(const TSourceLoc& loc, TType& type) shareStructBufferType(type); } -// knowledge of how to construct block name, in one place instead of N places. -TString HlslParseContext::getStructBuffCounterName(const TString& blockName) const -{ - return blockName + "@count"; -} - // declare counter for a structured buffer type void HlslParseContext::declareStructBufferCounter(const TSourceLoc& loc, const TType& bufferType, const TString& name) { @@ -2916,9 +3191,9 @@ void HlslParseContext::declareStructBufferCounter(const TSourceLoc& loc, const T TType blockType; counterBufferType(loc, blockType); - TString* blockName = new TString(getStructBuffCounterName(name)); + TString* blockName = new TString(intermediate.addCounterBufferName(name)); - // Counter buffer does not have its own counter buffer. TODO: there should be a better way to track this. + // Counter buffer is not yet in use structBufferCounter[*blockName] = false; shareStructBufferType(blockType); @@ -2932,7 +3207,7 @@ TIntermTyped* HlslParseContext::getStructBufferCounter(const TSourceLoc& loc, TI if (buffer == nullptr || ! isStructBufferType(buffer->getType())) return nullptr; - const TString counterBlockName(getStructBuffCounterName(buffer->getAsSymbolNode()->getName())); + const TString counterBlockName(intermediate.addCounterBufferName(buffer->getAsSymbolNode()->getName())); // Mark the counter as being used structBufferCounter[counterBlockName] = true; @@ -2941,11 +3216,10 @@ TIntermTyped* HlslParseContext::getStructBufferCounter(const TSourceLoc& loc, TI TIntermTyped* index = intermediate.addConstantUnion(0, loc); // index to counter inside block struct TIntermTyped* counterMember = intermediate.addIndex(EOpIndexDirectStruct, counterVar, index, loc); - counterMember->setType(TType(EbtInt)); + counterMember->setType(TType(EbtUint)); return counterMember; } - // // Decompose structure buffer methods into AST // @@ -2975,7 +3249,7 @@ void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TInte // Some methods require a hidden internal counter, obtained via getStructBufferCounter(). // This lambda adds something to it and returns the old value. const auto incDecCounter = [&](int incval) -> TIntermTyped* { - TIntermTyped* incrementValue = intermediate.addConstantUnion(incval, loc, true); + TIntermTyped* incrementValue = intermediate.addConstantUnion(static_cast(incval), loc, true); TIntermTyped* counter = getStructBufferCounter(loc, bufferObj); // obtain the counter member if (counter == nullptr) @@ -3071,7 +3345,13 @@ void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TInte const TOperator idxOp = (offsetIdx->getQualifier().storage == EvqConst) ? EOpIndexDirect : EOpIndexIndirect; - vec = intermediate.growAggregate(vec, intermediate.addIndex(idxOp, argArray, offsetIdx, loc)); + TIntermTyped* indexVal = intermediate.addIndex(idxOp, argArray, offsetIdx, loc); + + TType derefType(argArray->getType(), 0); + derefType.getQualifier().makeTemporary(); + indexVal->setType(derefType); + + vec = intermediate.growAggregate(vec, indexVal); } vec->setType(TType(argArray->getBasicType(), EvqTemporary, size)); @@ -3096,7 +3376,7 @@ void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TInte // Index into the array to find the item being loaded. // Byte address buffers index in bytes (only multiples of 4 permitted... not so much a byte address - // buffer then, but that's what it calls itself. + // buffer then, but that's what it calls itself). int size = 0; @@ -3132,8 +3412,17 @@ void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TInte : EOpIndexIndirect; TIntermTyped* lValue = intermediate.addIndex(idxOp, argArray, offsetIdx, loc); - TIntermTyped* rValue = (size == 1) ? argValue : - intermediate.addIndex(EOpIndexDirect, argValue, idxConst, loc); + const TType derefType(argArray->getType(), 0); + lValue->setType(derefType); + + TIntermTyped* rValue; + if (size == 1) { + rValue = argValue; + } else { + rValue = intermediate.addIndex(EOpIndexDirect, argValue, idxConst, loc); + const TType indexType(argValue->getType(), 0); + rValue->setType(indexType); + } TIntermTyped* assign = intermediate.addAssign(EOpAssign, lValue, rValue, loc); @@ -3155,16 +3444,16 @@ void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TInte TIntermAggregate* body = nullptr; // Length output: - if (argArray->getType().isRuntimeSizedArray()) { - TIntermTyped* lengthCall = intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, argArray, - argNumItems->getType()); - TIntermTyped* assign = intermediate.addAssign(EOpAssign, argNumItems, lengthCall, loc); - body = intermediate.growAggregate(body, assign, loc); - } else { + if (argArray->getType().isSizedArray()) { const int length = argArray->getType().getOuterArraySize(); TIntermTyped* assign = intermediate.addAssign(EOpAssign, argNumItems, intermediate.addConstantUnion(length, loc, true), loc); body = intermediate.growAggregate(body, assign, loc); + } else { + TIntermTyped* lengthCall = intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, argArray, + argNumItems->getType()); + TIntermTyped* assign = intermediate.addAssign(EOpAssign, argNumItems, lengthCall, loc); + body = intermediate.growAggregate(body, assign, loc); } // Stride output: @@ -3325,9 +3614,9 @@ TIntermConstantUnion* HlslParseContext::getSamplePosArray(int count) TType retType(EbtFloat, EvqConst, 2); if (numSamples != 1) { - TArraySizes arraySizes; - arraySizes.addInnerSize(numSamples); - retType.newArraySizes(arraySizes); + TArraySizes* arraySizes = new TArraySizes; + arraySizes->addInnerSize(numSamples); + retType.transferArraySizes(arraySizes); } return new TIntermConstantUnion(*values, retType); @@ -4024,9 +4313,9 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType // we construct an array from the separate args. if (hasOffset4) { TType arrayType(EbtInt, EvqTemporary, 2); - TArraySizes arraySizes; - arraySizes.addInnerSize(4); - arrayType.newArraySizes(arraySizes); + TArraySizes* arraySizes = new TArraySizes; + arraySizes->addInnerSize(4); + arrayType.transferArraySizes(arraySizes); TIntermAggregate* initList = new TIntermAggregate(EOpNull); @@ -4148,6 +4437,25 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType break; } + case EOpSubpassLoad: + { + const TIntermTyped* argSubpass = + argAggregate ? argAggregate->getSequence()[0]->getAsTyped() : + arguments->getAsTyped(); + + const TSampler& sampler = argSubpass->getType().getSampler(); + + // subpass load: the multisample form is overloaded. Here, we convert that to + // the EOpSubpassLoadMS opcode. + if (argAggregate != nullptr && argAggregate->getSequence().size() > 1) + node->getAsOperator()->setOp(EOpSubpassLoadMS); + + node = convertReturn(node, sampler); + + break; + } + + default: break; // most pass through unchanged } @@ -4246,6 +4554,22 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*& return imageAggregate != nullptr && imageAggregate->getOp() == EOpImageLoad; }; + const auto lookupBuiltinVariable = [&](const char* name, TBuiltInVariable builtin, TType& type) -> TIntermTyped* { + TSymbol* symbol = symbolTable.find(name); + if (nullptr == symbol) { + type.getQualifier().builtIn = builtin; + + TVariable* variable = new TVariable(new TString(name), type); + + symbolTable.insert(*variable); + + symbol = symbolTable.find(name); + assert(symbol && "Inserted symbol could not be found!"); + } + + return intermediate.addSymbol(*(symbol->getAsVariable()), loc); + }; + // HLSL intrinsics can be pass through to native AST opcodes, or decomposed here to existing AST // opcodes for compatibility with existing software stacks. static const bool decomposeHlslIntrinsics = true; @@ -4377,14 +4701,21 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*& std::max(arg0->getType().getMatrixRows(), 1); TConstUnion zero; - zero.setDConst(0.0); + if (arg0->getType().isIntegerDomain()) + zero.setDConst(0); + else + zero.setDConst(0.0); TConstUnionArray zeros(constComponentCount, zero); less->getSequence().push_back(intermediate.addConstantUnion(zeros, arg0->getType(), loc, true)); compareNode = intermediate.addBuiltInFunctionCall(loc, EOpAny, true, less, TType(EbtBool)); } else { - TIntermTyped* zero = intermediate.addConstantUnion(0, type0, loc, true); + TIntermTyped* zero; + if (arg0->getType().isIntegerDomain()) + zero = intermediate.addConstantUnion(0, loc, true); + else + zero = intermediate.addConstantUnion(0.0, type0, loc, true); compareNode = handleBinaryMath(loc, "clip", EOpLessThan, arg0, zero); } @@ -4795,7 +5126,65 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*& break; } - + case EOpWaveGetLaneCount: + { + // Mapped to gl_SubgroupSize builtin (We preprend @ to the symbol + // so that it inhabits the symbol table, but has a user-invalid name + // in-case some source HLSL defined the symbol also). + TType type(EbtUint, EvqVaryingIn); + node = lookupBuiltinVariable("@gl_SubgroupSize", EbvSubgroupSize2, type); + break; + } + case EOpWaveGetLaneIndex: + { + // Mapped to gl_SubgroupInvocationID builtin (We preprend @ to the + // symbol so that it inhabits the symbol table, but has a + // user-invalid name in-case some source HLSL defined the symbol + // also). + TType type(EbtUint, EvqVaryingIn); + node = lookupBuiltinVariable("@gl_SubgroupInvocationID", EbvSubgroupInvocation2, type); + break; + } + case EOpWaveActiveCountBits: + { + // Mapped to subgroupBallotBitCount(subgroupBallot()) builtin + + // uvec4 type. + TType uvec4Type(EbtUint, EvqTemporary, 4); + + // Get the uvec4 return from subgroupBallot(). + TIntermTyped* res = intermediate.addBuiltInFunctionCall(loc, + EOpSubgroupBallot, true, arguments, uvec4Type); + + // uint type. + TType uintType(EbtUint, EvqTemporary); + + node = intermediate.addBuiltInFunctionCall(loc, + EOpSubgroupBallotBitCount, true, res, uintType); + + break; + } + case EOpWavePrefixCountBits: + { + // Mapped to subgroupBallotInclusiveBitCount(subgroupBallot()) + // builtin + + // uvec4 type. + TType uvec4Type(EbtUint, EvqTemporary, 4); + + // Get the uvec4 return from subgroupBallot(). + TIntermTyped* res = intermediate.addBuiltInFunctionCall(loc, + EOpSubgroupBallot, true, arguments, uvec4Type); + + // uint type. + TType uintType(EbtUint, EvqTemporary); + + node = intermediate.addBuiltInFunctionCall(loc, + EOpSubgroupBallotInclusiveBitCount, true, res, uintType); + + break; + } + default: break; // most pass through unchanged } @@ -4827,8 +5216,10 @@ TIntermTyped* HlslParseContext::handleFunctionCall(const TSourceLoc& loc, TFunct // It's a constructor, of type 'type'. // result = handleConstructor(loc, arguments, type); - if (result == nullptr) + if (result == nullptr) { error(loc, "cannot construct with these arguments", type.getCompleteString().c_str(), ""); + return nullptr; + } } } else { // @@ -4838,6 +5229,12 @@ TIntermTyped* HlslParseContext::handleFunctionCall(const TSourceLoc& loc, TFunct bool builtIn = false; int thisDepth = 0; + // For mat mul, the situation is unusual: we have to compare vector sizes to mat row or col sizes, + // and clamp the opposite arg. Since that's complex, we farm it off to a separate method. + // It doesn't naturally fall out of processing an argument at a time in isolation. + if (function->getName() == "mul") + addGenMulArgumentConversion(loc, *function, arguments); + TIntermAggregate* aggregate = arguments ? arguments->getAsAggregate() : nullptr; // TODO: this needs improvement: there's no way at present to look up a signature in @@ -4955,7 +5352,8 @@ TIntermTyped* HlslParseContext::handleFunctionCall(const TSourceLoc& loc, TFunct // add buffer and counter buffer argument qualifier qualifierList.push_back(qual); qualifierList.push_back(qual); - } else if (shouldFlatten(*(*fnCandidate)[i].type)) { + } else if (shouldFlatten(*(*fnCandidate)[i].type, (*fnCandidate)[i].type->getQualifier().storage, + true)) { // add structure member expansion for (int memb = 0; memb < (int)(*fnCandidate)[i].type->getStruct()->size(); ++memb) qualifierList.push_back(qual); @@ -4998,6 +5396,83 @@ void HlslParseContext::pushFrontArguments(TIntermTyped* front, TIntermTyped*& ar arguments = intermediate.growAggregate(front, arguments); } +// +// HLSL allows mismatched dimensions on vec*mat, mat*vec, vec*vec, and mat*mat. This is a +// situation not well suited to resolution in intrinsic selection, but we can do so here, since we +// can look at both arguments insert explicit shape changes if required. +// +void HlslParseContext::addGenMulArgumentConversion(const TSourceLoc& loc, TFunction& call, TIntermTyped*& args) +{ + TIntermAggregate* argAggregate = args ? args->getAsAggregate() : nullptr; + + if (argAggregate == nullptr || argAggregate->getSequence().size() != 2) { + // It really ought to have two arguments. + error(loc, "expected: mul arguments", "", ""); + return; + } + + TIntermTyped* arg0 = argAggregate->getSequence()[0]->getAsTyped(); + TIntermTyped* arg1 = argAggregate->getSequence()[1]->getAsTyped(); + + if (arg0->isVector() && arg1->isVector()) { + // For: + // vec * vec: it's handled during intrinsic selection, so while we could do it here, + // we can also ignore it, which is easier. + } else if (arg0->isVector() && arg1->isMatrix()) { + // vec * mat: we clamp the vec if the mat col is smaller, else clamp the mat col. + if (arg0->getVectorSize() < arg1->getMatrixCols()) { + // vec is smaller, so truncate larger mat dimension + const TType truncType(arg1->getBasicType(), arg1->getQualifier().storage, arg1->getQualifier().precision, + 0, arg0->getVectorSize(), arg1->getMatrixRows()); + arg1 = addConstructor(loc, arg1, truncType); + } else if (arg0->getVectorSize() > arg1->getMatrixCols()) { + // vec is larger, so truncate vec to mat size + const TType truncType(arg0->getBasicType(), arg0->getQualifier().storage, arg0->getQualifier().precision, + arg1->getMatrixCols()); + arg0 = addConstructor(loc, arg0, truncType); + } + } else if (arg0->isMatrix() && arg1->isVector()) { + // mat * vec: we clamp the vec if the mat col is smaller, else clamp the mat col. + if (arg1->getVectorSize() < arg0->getMatrixRows()) { + // vec is smaller, so truncate larger mat dimension + const TType truncType(arg0->getBasicType(), arg0->getQualifier().storage, arg0->getQualifier().precision, + 0, arg0->getMatrixCols(), arg1->getVectorSize()); + arg0 = addConstructor(loc, arg0, truncType); + } else if (arg1->getVectorSize() > arg0->getMatrixRows()) { + // vec is larger, so truncate vec to mat size + const TType truncType(arg1->getBasicType(), arg1->getQualifier().storage, arg1->getQualifier().precision, + arg0->getMatrixRows()); + arg1 = addConstructor(loc, arg1, truncType); + } + } else if (arg0->isMatrix() && arg1->isMatrix()) { + // mat * mat: we clamp the smaller inner dimension to match the other matrix size. + // Remember, HLSL Mrc = GLSL/SPIRV Mcr. + if (arg0->getMatrixRows() > arg1->getMatrixCols()) { + const TType truncType(arg0->getBasicType(), arg0->getQualifier().storage, arg0->getQualifier().precision, + 0, arg0->getMatrixCols(), arg1->getMatrixCols()); + arg0 = addConstructor(loc, arg0, truncType); + } else if (arg0->getMatrixRows() < arg1->getMatrixCols()) { + const TType truncType(arg1->getBasicType(), arg1->getQualifier().storage, arg1->getQualifier().precision, + 0, arg0->getMatrixRows(), arg1->getMatrixRows()); + arg1 = addConstructor(loc, arg1, truncType); + } + } else { + // It's something with scalars: we'll just leave it alone. Function selection will handle it + // downstream. + } + + // Warn if we altered one of the arguments + if (arg0 != argAggregate->getSequence()[0] || arg1 != argAggregate->getSequence()[1]) + warn(loc, "mul() matrix size mismatch", "", ""); + + // Put arguments back. (They might be unchanged, in which case this is harmless). + argAggregate->getSequence()[0] = arg0; + argAggregate->getSequence()[1] = arg1; + + call[0].type = &arg0->getWritableType(); + call[1].type = &arg1->getWritableType(); +} + // // Add any needed implicit conversions for function-call arguments to input parameters. // @@ -5044,7 +5519,7 @@ void HlslParseContext::addInputArgumentConversions(const TFunction& function, TI if (wasFlattened(arg)) { // If both formal and calling arg are to be flattened, leave that to argument // expansion, not conversion. - if (!shouldFlatten(*function[param].type)) { + if (!shouldFlatten(*function[param].type, function[param].type->getQualifier().storage, true)) { // Will make a two-level subtree. // The deepest will copy member-by-member to build the structure to pass. // The level above that will be a two-operand EOpComma sequence that follows the copy by the @@ -5121,7 +5596,7 @@ void HlslParseContext::expandArguments(const TSourceLoc& loc, const TFunction& f aggregate->getSequence()[param + functionParamNumberOffset]->getAsTyped() : arguments->getAsTyped()); - if (wasFlattened(arg) && shouldFlatten(*function[param].type)) { + if (wasFlattened(arg) && shouldFlatten(*function[param].type, function[param].type->getQualifier().storage, true)) { // Need to pass the structure members instead of the structure. TVector memberArgs; for (int memb = 0; memb < (int)arg->getType().getStruct()->size(); ++memb) @@ -5263,12 +5738,11 @@ void HlslParseContext::addStructBuffArguments(const TSourceLoc& loc, TIntermAggr TType counterType; counterBufferType(loc, counterType); - const TString counterBlockName(getStructBuffCounterName(blockSym->getName())); + const TString counterBlockName(intermediate.addCounterBufferName(blockSym->getName())); TVariable* variable = makeInternalVariable(counterBlockName, counterType); - // Mark this buffer as requiring a counter block. TODO: there should be a better - // way to track it. + // Mark this buffer's counter block as being in use structBufferCounter[counterBlockName] = true; TIntermSymbol* sym = intermediate.addSymbol(*variable, loc); @@ -5510,7 +5984,8 @@ void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, TBu break; } - qualifier.builtIn = builtIn; + if (qualifier.builtIn == EbvNone) + qualifier.builtIn = builtIn; qualifier.semanticName = intermediate.addSemanticName(upperCase); } @@ -5589,7 +6064,10 @@ void HlslParseContext::handleRegister(const TSourceLoc& loc, TQualifier& qualifi case 'c': case 's': case 'u': - qualifier.layoutBinding = regNumber + subComponent; + // if nothing else has set the binding, do so now + // (other mechanisms override this one) + if (!qualifier.hasBinding()) + qualifier.layoutBinding = regNumber + subComponent; // This handles per-register layout sets numbers. For the global mode which sets // every symbol to the same value, see setLinkageLayoutSets(). @@ -5623,7 +6101,9 @@ void HlslParseContext::handleRegister(const TSourceLoc& loc, TQualifier& qualifi return true; }; - if (spaceDesc) { + // if nothing else has set the set, do so now + // (other mechanisms override this one) + if (spaceDesc && !qualifier.hasSet()) { if (! crackSpace()) { error(loc, "expected spaceN", "register", ""); return; @@ -5817,7 +6297,7 @@ bool HlslParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node bool arrayArg = false; for (int arg = 0; arg < function.getParamCount(); ++arg) { if (function[arg].type->isArray()) { - if (! function[arg].type->isExplicitlySizedArray()) { + if (function[arg].type->isUnsizedArray()) { // Can't construct from an unsized array. error(loc, "array argument must be sized", "constructor", ""); return true; @@ -5852,11 +6332,10 @@ bool HlslParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node return true; } - if (type.isImplicitlySizedArray()) { + if (type.isUnsizedArray()) { // auto adapt the constructor type to the number of arguments type.changeOuterArraySize(function.getParamCount()); - } else if (type.getOuterArraySize() != function.getParamCount() && - type.computeNumComponents() > size) { + } else if (type.getOuterArraySize() != function.getParamCount() && type.computeNumComponents() > size) { error(loc, "array constructor needs one argument per array element", "constructor", ""); return true; } @@ -5865,21 +6344,21 @@ bool HlslParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node // Types have to match, but we're still making the type. // Finish making the type, and the comparison is done later // when checking for conversion. - TArraySizes& arraySizes = type.getArraySizes(); + TArraySizes& arraySizes = *type.getArraySizes(); // At least the dimensionalities have to match. if (! function[0].type->isArray() || - arraySizes.getNumDims() != function[0].type->getArraySizes().getNumDims() + 1) { + arraySizes.getNumDims() != function[0].type->getArraySizes()->getNumDims() + 1) { error(loc, "array constructor argument not correct type to construct array element", "constructor", ""); return true; } - if (arraySizes.isInnerImplicit()) { + if (arraySizes.isInnerUnsized()) { // "Arrays of arrays ..., and the size for any dimension is optional" // That means we need to adopt (from the first argument) the other array sizes into the type. for (int d = 1; d < arraySizes.getNumDims(); ++d) { if (arraySizes.getDimSize(d) == UnsizedArraySize) { - arraySizes.setDimSize(d, function[0].type->getArraySizes().getDimSize(d - 1)); + arraySizes.setDimSize(d, function[0].type->getArraySizes()->getDimSize(d - 1)); } } } @@ -6074,6 +6553,7 @@ void HlslParseContext::mergeQualifiers(TQualifier& dst, const TQualifier& src) MERGE_SINGLETON(readonly); MERGE_SINGLETON(writeonly); MERGE_SINGLETON(specConstant); + MERGE_SINGLETON(nonUniform); } // used to flatten the sampler type space into a single dimension @@ -6129,7 +6609,7 @@ void HlslParseContext::arraySizeCheck(const TSourceLoc& loc, TIntermTyped* expr, // void HlslParseContext::arraySizeRequiredCheck(const TSourceLoc& loc, const TArraySizes& arraySizes) { - if (arraySizes.isImplicit()) + if (arraySizes.hasUnsized()) error(loc, "array size required", "", ""); } @@ -6143,20 +6623,6 @@ void HlslParseContext::structArrayCheck(const TSourceLoc& /*loc*/, const TType& } } -// Merge array dimensions listed in 'sizes' onto the type's array dimensions. -// -// From the spec: "vec4[2] a[3]; // size-3 array of size-2 array of vec4" -// -// That means, the 'sizes' go in front of the 'type' as outermost sizes. -// 'type' is the type part of the declaration (to the left) -// 'sizes' is the arrayness tagged on the identifier (to the right) -// -void HlslParseContext::arrayDimMerge(TType& type, const TArraySizes* sizes) -{ - if (sizes) - type.addArrayOuterSizes(*sizes); -} - // // Do all the semantic checking for declaring or redeclaring an array, with and // without a size, and make the right changes to the symbol table. @@ -6203,7 +6669,7 @@ void HlslParseContext::declareArray(const TSourceLoc& loc, const TString& identi // redeclareBuiltinVariable() should have already done the copyUp() TType& existingType = symbol->getWritableType(); - if (existingType.isExplicitlySizedArray()) { + if (existingType.isSizedArray()) { // be more lenient for input arrays to geometry shaders and tessellation control outputs, // where the redeclaration is the same size return; @@ -6212,52 +6678,6 @@ void HlslParseContext::declareArray(const TSourceLoc& loc, const TString& identi existingType.updateArraySizes(type); } -void HlslParseContext::updateImplicitArraySize(const TSourceLoc& loc, TIntermNode *node, int index) -{ - // maybe there is nothing to do... - TIntermTyped* typedNode = node->getAsTyped(); - if (typedNode->getType().getImplicitArraySize() > index) - return; - - // something to do... - - // Figure out what symbol to lookup, as we will use its type to edit for the size change, - // as that type will be shared through shallow copies for future references. - TSymbol* symbol = nullptr; - int blockIndex = -1; - const TString* lookupName = nullptr; - if (node->getAsSymbolNode()) - lookupName = &node->getAsSymbolNode()->getName(); - else if (node->getAsBinaryNode()) { - const TIntermBinary* deref = node->getAsBinaryNode(); - // This has to be the result of a block dereference, unless it's bad shader code - // If it's a uniform block, then an error will be issued elsewhere, but - // return early now to avoid crashing later in this function. - if (! deref->getLeft()->getAsSymbolNode() || deref->getLeft()->getBasicType() != EbtBlock || - deref->getLeft()->getType().getQualifier().storage == EvqUniform || - deref->getRight()->getAsConstantUnion() == nullptr) - return; - - blockIndex = deref->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst(); - - lookupName = &deref->getLeft()->getAsSymbolNode()->getName(); - if (IsAnonymous(*lookupName)) - lookupName = &(*deref->getLeft()->getType().getStruct())[blockIndex].type->getFieldName(); - } - - // Lookup the symbol, should only fail if shader code is incorrect - symbol = symbolTable.find(*lookupName); - if (symbol == nullptr) - return; - - if (symbol->getAsFunction()) { - error(loc, "array variable name expected", symbol->getName().c_str(), ""); - return; - } - - symbol->getWritableType().setImplicitArraySize(index + 1); -} - // // Enforce non-initializer type/qualifier rules. // @@ -6321,7 +6741,7 @@ TIntermTyped* HlslParseContext::indexStructBufferContent(const TSourceLoc& loc, // TType* HlslParseContext::getStructBufferContentType(const TType& type) const { - if (type.getBasicType() != EbtBlock) + if (type.getBasicType() != EbtBlock || type.getQualifier().storage != EvqBuffer) return nullptr; const int memberCount = (int)type.getStruct()->size(); @@ -6329,7 +6749,7 @@ TType* HlslParseContext::getStructBufferContentType(const TType& type) const TType* contentType = (*type.getStruct())[memberCount-1].type; - return contentType->isRuntimeSizedArray() ? contentType : nullptr; + return contentType->isUnsizedArray() ? contentType : nullptr; } // @@ -6677,15 +7097,7 @@ void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TQualifier& qua return; } if (id == "constant_id") { - requireSpv(loc, "constant_id"); - if (value >= (int)TQualifier::layoutSpecConstantIdEnd) { - error(loc, "specialization-constant id is too large", id.c_str(), ""); - } else { - qualifier.layoutSpecConstantId = value; - qualifier.specConstant = true; - if (! intermediate.addUsedConstantId(value)) - error(loc, "specialization-constant id already used", id.c_str(), ""); - } + setSpecConstantId(loc, qualifier, value); return; } @@ -6780,6 +7192,19 @@ void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TQualifier& qua error(loc, "there is no such layout identifier for this stage taking an assigned value", id.c_str(), ""); } +void HlslParseContext::setSpecConstantId(const TSourceLoc& loc, TQualifier& qualifier, int value) +{ + if (value >= (int)TQualifier::layoutSpecConstantIdEnd) { + error(loc, "specialization-constant id is too large", "constant_id", ""); + } else { + qualifier.layoutSpecConstantId = value; + qualifier.specConstant = true; + if (! intermediate.addUsedConstantId(value)) + error(loc, "specialization-constant id already used", "constant_id", ""); + } + return; +} + // Merge any layout qualifier information from src into dst, leaving everything else in dst alone // // "More than one layout qualifier may appear in a single declaration. @@ -6844,6 +7269,7 @@ void HlslParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQuali } } + // // Look up a function name in the symbol table, and make sure it is a function. // @@ -7028,8 +7454,8 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, TFunction } }; - return std::abs(linearize(to2.getBasicType()) - linearize(from.getBasicType())) < - std::abs(linearize(to1.getBasicType()) - linearize(from.getBasicType())); + return abs(linearize(to2.getBasicType()) - linearize(from.getBasicType())) < + abs(linearize(to1.getBasicType()) - linearize(from.getBasicType())); }; // for ambiguity reporting @@ -7304,7 +7730,7 @@ TIntermNode* HlslParseContext::declareVariable(const TSourceLoc& loc, const TStr inheritGlobalDefaults(type.getQualifier()); - const bool flattenVar = shouldFlatten(type); + const bool flattenVar = shouldFlatten(type, type.getQualifier().storage, true); // correct IO in the type switch (type.getQualifier().storage) { @@ -7353,7 +7779,7 @@ TIntermNode* HlslParseContext::declareVariable(const TSourceLoc& loc, const TStr error(loc, "initializer requires a variable, not a member", identifier.c_str(), ""); return nullptr; } - return executeInitializer(loc, initializer, variable, flattenVar); + return executeInitializer(loc, initializer, variable); } // Pick up global defaults from the provide global defaults into dst. @@ -7421,8 +7847,7 @@ TVariable* HlslParseContext::declareNonArray(const TSourceLoc& loc, const TStrin // Returning nullptr just means there is no code to execute to handle the // initializer, which will, for example, be the case for constant initializers. // -TIntermNode* HlslParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyped* initializer, TVariable* variable, - bool flattened) +TIntermNode* HlslParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyped* initializer, TVariable* variable) { // // Identifier must be of type constant, a global, or a temporary, and @@ -7453,8 +7878,7 @@ TIntermNode* HlslParseContext::executeInitializer(const TSourceLoc& loc, TInterm } // Fix outer arrayness if variable is unsized, getting size from the initializer - if (initializer->getType().isExplicitlySizedArray() && - variable->getType().isImplicitlySizedArray()) + if (initializer->getType().isSizedArray() && variable->getType().isUnsizedArray()) variable->getWritableType().changeOuterArraySize(initializer->getType().getOuterArraySize()); // Inner arrayness can also get set by an initializer @@ -7463,8 +7887,10 @@ TIntermNode* HlslParseContext::executeInitializer(const TSourceLoc& loc, TInterm variable->getType().getArraySizes()->getNumDims()) { // adopt unsized sizes from the initializer's sizes for (int d = 1; d < variable->getType().getArraySizes()->getNumDims(); ++d) { - if (variable->getType().getArraySizes()->getDimSize(d) == UnsizedArraySize) - variable->getWritableType().getArraySizes().setDimSize(d, initializer->getType().getArraySizes()->getDimSize(d)); + if (variable->getType().getArraySizes()->getDimSize(d) == UnsizedArraySize) { + variable->getWritableType().getArraySizes()->setDimSize(d, + initializer->getType().getArraySizes()->getDimSize(d)); + } } } @@ -7502,20 +7928,10 @@ TIntermNode* HlslParseContext::executeInitializer(const TSourceLoc& loc, TInterm // normal assigning of a value to a variable... specializationCheck(loc, initializer->getType(), "initializer"); TIntermSymbol* intermSymbol = intermediate.addSymbol(*variable, loc); - - // If we are flattening, it could be due to setting opaques, which must be handled - // as aliases, and the 'initializer' node cannot actually be emitted, because it - // itself stores the result of the constructor, and we can't store to opaques. - // handleAssign() will emit the initializer. - TIntermNode* initNode = nullptr; - if (flattened && intermSymbol->getType().containsOpaque()) - return executeFlattenedInitializer(loc, intermSymbol, *initializer->getAsAggregate()); - else { - initNode = handleAssign(loc, EOpAssign, intermSymbol, initializer); - if (initNode == nullptr) - assignError(loc, "=", intermSymbol->getCompleteString(), initializer->getCompleteString()); - return initNode; - } + TIntermNode* initNode = handleAssign(loc, EOpAssign, intermSymbol, initializer); + if (initNode == nullptr) + assignError(loc, "=", intermSymbol->getCompleteString(), initializer->getCompleteString()); + return initNode; } return nullptr; @@ -7561,20 +7977,20 @@ TIntermTyped* HlslParseContext::convertInitializerList(const TSourceLoc& loc, co // Later on, initializer execution code will deal with array size logic. TType arrayType; arrayType.shallowCopy(type); // sharing struct stuff is fine - arrayType.newArraySizes(*type.getArraySizes()); // but get a fresh copy of the array information, to edit below + arrayType.copyArraySizes(*type.getArraySizes()); // but get a fresh copy of the array information, to edit below // edit array sizes to fill in unsized dimensions - if (type.isImplicitlySizedArray()) + if (type.isUnsizedArray()) arrayType.changeOuterArraySize((int)initList->getSequence().size()); // set unsized array dimensions that can be derived from the initializer's first element if (arrayType.isArrayOfArrays() && initList->getSequence().size() > 0) { TIntermTyped* firstInit = initList->getSequence()[0]->getAsTyped(); if (firstInit->getType().isArray() && - arrayType.getArraySizes().getNumDims() == firstInit->getType().getArraySizes()->getNumDims() + 1) { - for (int d = 1; d < arrayType.getArraySizes().getNumDims(); ++d) { - if (arrayType.getArraySizes().getDimSize(d) == UnsizedArraySize) - arrayType.getArraySizes().setDimSize(d, firstInit->getType().getArraySizes()->getDimSize(d - 1)); + arrayType.getArraySizes()->getNumDims() == firstInit->getType().getArraySizes()->getNumDims() + 1) { + for (int d = 1; d < arrayType.getArraySizes()->getNumDims(); ++d) { + if (arrayType.getArraySizes()->getDimSize(d) == UnsizedArraySize) + arrayType.getArraySizes()->setDimSize(d, firstInit->getType().getArraySizes()->getDimSize(d - 1)); } } } @@ -7593,6 +8009,14 @@ TIntermTyped* HlslParseContext::convertInitializerList(const TSourceLoc& loc, co return addConstructor(loc, initList, arrayType); } else if (type.isStruct()) { + // do we have implicit assignments to opaques? + for (size_t i = initList->getSequence().size(); i < type.getStruct()->size(); ++i) { + if ((*type.getStruct())[i].type->containsOpaque()) { + error(loc, "cannot implicitly initialize opaque members", "initializer list", ""); + return nullptr; + } + } + // lengthen list to be long enough lengthenList(loc, initList->getSequence(), static_cast(type.getStruct()->size()), scalarInit); @@ -7723,12 +8147,13 @@ TIntermTyped* HlslParseContext::handleConstructor(const TSourceLoc& loc, TInterm // TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyped* node, const TType& type) { + TIntermAggregate* aggrNode = node->getAsAggregate(); TOperator op = intermediate.mapTypeToConstructorOp(type); // Combined texture-sampler constructors are completely semantic checked // in constructorTextureSamplerError() if (op == EOpConstructTextureSampler) - return intermediate.setAggregateOperator(node->getAsAggregate(), op, type, loc); + return intermediate.setAggregateOperator(aggrNode, op, type, loc); TTypeList::const_iterator memberTypes; if (op == EOpConstructStruct) @@ -7742,9 +8167,8 @@ TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyp elementType.shallowCopy(type); bool singleArg; - TIntermAggregate* aggrNode = node->getAsAggregate(); if (aggrNode != nullptr) { - if (aggrNode->getOp() != EOpNull || aggrNode->getSequence().size() == 1) + if (aggrNode->getOp() != EOpNull) singleArg = true; else singleArg = false; @@ -7760,7 +8184,7 @@ TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyp newNode = convertArray(node, type); // If structure constructor or array constructor is being called - // for only one parameter inside the structure, we need to call constructAggregate function once. + // for only one parameter inside the aggregate, we need to call constructAggregate function once. else if (type.isArray()) newNode = constructAggregate(node, elementType, 1, node->getLoc()); else if (op == EOpConstructStruct) @@ -7784,7 +8208,7 @@ TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyp // // Handle list of arguments. // - TIntermSequence &sequenceVector = aggrNode->getSequence(); // Stores the information about the parameter to the constructor + TIntermSequence& sequenceVector = aggrNode->getSequence(); // Stores the information about the parameter to the constructor // if the structure constructor contains more than one parameter, then construct // each parameter @@ -7831,6 +8255,22 @@ TIntermTyped* HlslParseContext::constructBuiltIn(const TType& type, TOperator op // First, convert types as needed. // switch (op) { + case EOpConstructF16Vec2: + case EOpConstructF16Vec3: + case EOpConstructF16Vec4: + case EOpConstructF16Mat2x2: + case EOpConstructF16Mat2x3: + case EOpConstructF16Mat2x4: + case EOpConstructF16Mat3x2: + case EOpConstructF16Mat3x3: + case EOpConstructF16Mat3x4: + case EOpConstructF16Mat4x2: + case EOpConstructF16Mat4x3: + case EOpConstructF16Mat4x4: + case EOpConstructFloat16: + basicOp = EOpConstructFloat16; + break; + case EOpConstructVec2: case EOpConstructVec3: case EOpConstructVec4: @@ -7863,6 +8303,13 @@ TIntermTyped* HlslParseContext::constructBuiltIn(const TType& type, TOperator op basicOp = EOpConstructDouble; break; + case EOpConstructI16Vec2: + case EOpConstructI16Vec3: + case EOpConstructI16Vec4: + case EOpConstructInt16: + basicOp = EOpConstructInt16; + break; + case EOpConstructIVec2: case EOpConstructIVec3: case EOpConstructIVec4: @@ -7879,6 +8326,13 @@ TIntermTyped* HlslParseContext::constructBuiltIn(const TType& type, TOperator op basicOp = EOpConstructInt; break; + case EOpConstructU16Vec2: + case EOpConstructU16Vec3: + case EOpConstructU16Vec4: + case EOpConstructUint16: + basicOp = EOpConstructUint16; + break; + case EOpConstructUVec2: case EOpConstructUVec3: case EOpConstructUVec4: @@ -8028,7 +8482,7 @@ TIntermTyped* HlslParseContext::constructAggregate(TIntermNode* node, const TTyp // // Do everything needed to add an interface block. // -void HlslParseContext::declareBlock(const TSourceLoc& loc, TType& type, const TString* instanceName, TArraySizes* arraySizes) +void HlslParseContext::declareBlock(const TSourceLoc& loc, TType& type, const TString* instanceName) { assert(type.getWritableStruct() != nullptr); @@ -8156,8 +8610,8 @@ void HlslParseContext::declareBlock(const TSourceLoc& loc, TType& type, const TS const TString& interfaceName = (instanceName && !instanceName->empty()) ? *instanceName : type.getTypeName(); TType blockType(&typeList, interfaceName, type.getQualifier()); - if (arraySizes) - blockType.newArraySizes(*arraySizes); + if (type.isArray()) + blockType.transferArraySizes(type.getArraySizes()); // Add the variable, as anonymous or named instanceName. // Make an anonymous variable if no name was provided. @@ -8176,7 +8630,8 @@ void HlslParseContext::declareBlock(const TSourceLoc& loc, TType& type, const TS } // Save it in the AST for linker use. - trackLinkage(variable); + if (symbolTable.atGlobalLevel()) + trackLinkage(variable); } // @@ -8217,7 +8672,7 @@ void HlslParseContext::fixBlockLocations(const TSourceLoc& loc, TQualifier& qual memberQualifier.layoutComponent = 0; } nextLocation = memberQualifier.layoutLocation + - intermediate.computeTypeLocationSize(*typeList[member].type); + intermediate.computeTypeLocationSize(*typeList[member].type, language); } } } @@ -8390,6 +8845,11 @@ bool HlslParseContext::handleInputGeometry(const TSourceLoc& loc, const TLayoutG // bool HlslParseContext::handleOutputGeometry(const TSourceLoc& loc, const TLayoutGeometry& geometry) { + // If this is not a geometry shader, ignore. It might be a mixed shader including several stages. + // Since that's an OK situation, return true for success. + if (language != EShLangGeometry) + return true; + switch (geometry) { case ElgPoints: case ElgLineStrip: @@ -8408,29 +8868,75 @@ bool HlslParseContext::handleOutputGeometry(const TSourceLoc& loc, const TLayout } // -// Selection hints +// Selection attributes // -TSelectionControl HlslParseContext::handleSelectionControl(const TAttributeMap& attributes) const +void HlslParseContext::handleSelectionAttributes(const TSourceLoc& loc, TIntermSelection* selection, + const TAttributes& attributes) { - if (attributes.contains(EatFlatten)) - return ESelectionControlFlatten; - else if (attributes.contains(EatBranch)) - return ESelectionControlDontFlatten; - else - return ESelectionControlNone; + if (selection == nullptr) + return; + + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + switch (it->name) { + case EatFlatten: + selection->setFlatten(); + break; + case EatBranch: + selection->setDontFlatten(); + break; + default: + warn(loc, "attribute does not apply to a selection", "", ""); + break; + } + } } // -// Loop hints +// Switch attributes // -TLoopControl HlslParseContext::handleLoopControl(const TAttributeMap& attributes) const +void HlslParseContext::handleSwitchAttributes(const TSourceLoc& loc, TIntermSwitch* selection, + const TAttributes& attributes) { - if (attributes.contains(EatUnroll)) - return ELoopControlUnroll; - else if (attributes.contains(EatLoop)) - return ELoopControlDontUnroll; - else - return ELoopControlNone; + if (selection == nullptr) + return; + + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + switch (it->name) { + case EatFlatten: + selection->setFlatten(); + break; + case EatBranch: + selection->setDontFlatten(); + break; + default: + warn(loc, "attribute does not apply to a switch", "", ""); + break; + } + } +} + +// +// Loop attributes +// +void HlslParseContext::handleLoopAttributes(const TSourceLoc& loc, TIntermLoop* loop, + const TAttributes& attributes) +{ + if (loop == nullptr) + return; + + for (auto it = attributes.begin(); it != attributes.end(); ++it) { + switch (it->name) { + case EatUnroll: + loop->setUnroll(); + break; + case EatLoop: + loop->setDontUnroll(); + break; + default: + warn(loc, "attribute does not apply to a loop", "", ""); + break; + } + } } // @@ -8575,7 +9081,7 @@ void HlslParseContext::wrapupSwitchSubsequence(TIntermAggregate* statements, TIn // into a switch node. // TIntermNode* HlslParseContext::addSwitch(const TSourceLoc& loc, TIntermTyped* expression, - TIntermAggregate* lastStatements, TSelectionControl control) + TIntermAggregate* lastStatements, const TAttributes& attributes) { wrapupSwitchSubsequence(lastStatements, nullptr); @@ -8602,7 +9108,7 @@ TIntermNode* HlslParseContext::addSwitch(const TSourceLoc& loc, TIntermTyped* ex TIntermSwitch* switchNode = new TIntermSwitch(expression, body); switchNode->setLoc(loc); - switchNode->setSelectionControl(control); + handleSwitchAttributes(loc, switchNode, attributes); return switchNode; } @@ -8655,7 +9161,7 @@ void HlslParseContext::popNamespace() // Use the class/struct nesting string to create a global name for // a member of a class/struct. -void HlslParseContext::getFullNamespaceName(const TString*& name) const +void HlslParseContext::getFullNamespaceName(TString*& name) const { if (currentTypePrefix.size() == 0) return; @@ -8671,15 +9177,6 @@ void HlslParseContext::addScopeMangler(TString& name) name.append(scopeMangler); } -// Potentially rename shader entry point function -void HlslParseContext::renameShaderFunction(const TString*& name) const -{ - // Replace the entry point name given in the shader with the real entry point name, - // if there is a substitution. - if (name != nullptr && *name == sourceEntryPointName) - name = NewPoolTString(intermediate.getEntryPointName().c_str()); -} - // Return true if this has uniform-interface like decorations. bool HlslParseContext::hasUniform(const TQualifier& qualifier) const { @@ -8733,7 +9230,7 @@ bool HlslParseContext::isInputBuiltIn(const TQualifier& qualifier) const case EbvVertexIndex: return language == EShLangVertex; case EbvPrimitiveId: - return language == EShLangGeometry || language == EShLangFragment; + return language == EShLangGeometry || language == EShLangFragment || language == EShLangTessControl; case EbvTessLevelInner: case EbvTessLevelOuter: return language == EShLangTessEvaluation; @@ -8779,9 +9276,9 @@ bool HlslParseContext::isOutputBuiltIn(const TQualifier& qualifier) const return language == EShLangFragment; case EbvLayer: case EbvViewportIndex: - return language == EShLangGeometry; + return language == EShLangGeometry || language == EShLangVertex; case EbvPrimitiveId: - return language == EShLangGeometry || language == EShLangTessControl || language == EShLangTessEvaluation; + return language == EShLangGeometry; case EbvTessLevelInner: case EbvTessLevelOuter: return language == EShLangTessControl; @@ -8905,6 +9402,12 @@ bool HlslParseContext::setTextureReturnType(TSampler& sampler, const TType& retT return false; } + // TODO: Subpass doesn't handle struct returns, due to some oddities with fn overloading. + if (sampler.isSubpass()) { + error(loc, "Unimplemented: structure template type in subpass input", "", ""); + return false; + } + TTypeList* members = retType.getWritableStruct(); // Check for too many or not enough structure members. @@ -8990,19 +9493,12 @@ TIntermSymbol* HlslParseContext::findTessLinkageSymbol(TBuiltInVariable biType) return intermediate.addSymbol(*it->second->getAsVariable()); } -// Finalization step: Add patch constant function invocation -void HlslParseContext::addPatchConstantInvocation() +// Find the patch constant function (issues error, returns nullptr if not found) +const TFunction* HlslParseContext::findPatchConstantFunction(const TSourceLoc& loc) { - TSourceLoc loc; - loc.init(); - - // If there's no patch constant function, or we're not a HS, do nothing. - if (patchConstantFunctionName.empty() || language != EShLangTessControl) - return; - if (symbolTable.isFunctionNameVariable(patchConstantFunctionName)) { error(loc, "can't use variable in patch constant function", patchConstantFunctionName.c_str(), ""); - return; + return nullptr; } const TString mangledName = patchConstantFunctionName + "("; @@ -9016,7 +9512,7 @@ void HlslParseContext::addPatchConstantInvocation() // allow any disambiguation of overloads. if (candidateList.empty()) { error(loc, "patch constant function not found", patchConstantFunctionName.c_str(), ""); - return; + return nullptr; } // Based on directed experiments, it appears that if there are overloaded patchconstantfunctions, @@ -9024,9 +9520,22 @@ void HlslParseContext::addPatchConstantInvocation() // out if there is more than one candidate. if (candidateList.size() > 1) { error(loc, "ambiguous patch constant function", patchConstantFunctionName.c_str(), ""); - return; + return nullptr; } + return candidateList[0]; +} + +// Finalization step: Add patch constant function invocation +void HlslParseContext::addPatchConstantInvocation() +{ + TSourceLoc loc; + loc.init(); + + // If there's no patch constant function, or we're not a HS, do nothing. + if (patchConstantFunctionName.empty() || language != EShLangTessControl) + return; + // Look for built-in variables in a function's parameter list. const auto findBuiltIns = [&](const TFunction& function, std::set& builtIns) { for (int p=0; p(*candidateList[0]); + TFunction* patchConstantFunctionPtr = const_cast(findPatchConstantFunction(loc)); + + if (patchConstantFunctionPtr == nullptr) + return; + + TFunction& patchConstantFunction = *patchConstantFunctionPtr; + const int pcfParamCount = patchConstantFunction.getParamCount(); TIntermSymbol* invocationIdSym = findTessLinkageSymbol(EbvInvocationId); TIntermSequence& epBodySeq = entryPointFunctionBody->getAsAggregate()->getSequence(); @@ -9172,10 +9687,9 @@ void HlslParseContext::addPatchConstantInvocation() // ================ Step 1B: Argument synthesis ================ // Create pcfArguments for synthesis of patchconstantfunction invocation - // TODO: handle struct or array inputs { for (int p=0; pgetWritableType().getSampler(); + + if (sampler.isTexture()) { + const auto shadowMode = textureShadowVariant.find((*symbol)->getUniqueId()); + if (shadowMode != textureShadowVariant.end()) { + + if (shadowMode->second->overloaded()) + // Texture needs legalization if it's been seen with both shadow and non-shadow modes. + intermediate.setNeedsLegalization(); + + sampler.shadow = shadowMode->second->isShadowId((*symbol)->getUniqueId()); + } + } + } +} + // post-processing void HlslParseContext::finish() { @@ -9383,6 +9923,12 @@ void HlslParseContext::finish() removeUnusedStructBufferCounters(); addPatchConstantInvocation(); + fixTextureShadowModes(); + + // Communicate out (esp. for command line) that we formed AST that will make + // illegal AST SPIR-V and it needs transforms to legalize it. + if (intermediate.needsLegalization() && (messages & EShMsgHlslLegalization)) + infoSink.info << "WARNING: AST will form illegal SPIR-V; need to transform to legalize"; TParseContextBase::finish(); } diff --git a/deps/glslang/hlsl/hlslParseHelper.h b/deps/glslang/hlsl/hlslParseHelper.h index e545109c..b16a8c2c 100644 --- a/deps/glslang/hlsl/hlslParseHelper.h +++ b/deps/glslang/hlsl/hlslParseHelper.h @@ -38,12 +38,12 @@ #include "../glslang/MachineIndependent/parseVersions.h" #include "../glslang/MachineIndependent/ParseHelper.h" +#include "../glslang/MachineIndependent/attribute.h" #include namespace glslang { -class TAttributeMap; // forward declare class TFunctionDeclarator; class HlslParseContext : public TParseContextBase { @@ -73,7 +73,6 @@ class HlslParseContext : public TParseContextBase { TIntermTyped* handleVariable(const TSourceLoc&, const TString* string); TIntermTyped* handleBracketDereference(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index); TIntermTyped* handleBracketOperator(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index); - void checkIndex(const TSourceLoc&, const TType&, int& index); TIntermTyped* handleBinaryMath(const TSourceLoc&, const char* str, TOperator op, TIntermTyped* left, TIntermTyped* right); TIntermTyped* handleUnaryMath(const TSourceLoc&, const char* str, TOperator op, TIntermTyped* childNode); @@ -81,19 +80,20 @@ class HlslParseContext : public TParseContextBase { bool isBuiltInMethod(const TSourceLoc&, TIntermTyped* base, const TString& field); void assignToInterface(TVariable& variable); void handleFunctionDeclarator(const TSourceLoc&, TFunction& function, bool prototype); - TIntermAggregate* handleFunctionDefinition(const TSourceLoc&, TFunction&, const TAttributeMap&, TIntermNode*& entryPointTree); - TIntermNode* transformEntryPoint(const TSourceLoc&, TFunction&, const TAttributeMap&); - void handleEntryPointAttributes(const TSourceLoc&, const TAttributeMap&); + TIntermAggregate* handleFunctionDefinition(const TSourceLoc&, TFunction&, const TAttributes&, TIntermNode*& entryPointTree); + TIntermNode* transformEntryPoint(const TSourceLoc&, TFunction&, const TAttributes&); + void handleEntryPointAttributes(const TSourceLoc&, const TAttributes&); + void transferTypeAttributes(const TSourceLoc&, const TAttributes&, TType&, bool allowEntry = false); void handleFunctionBody(const TSourceLoc&, TFunction&, TIntermNode* functionBody, TIntermNode*& node); void remapEntryPointIO(TFunction& function, TVariable*& returnValue, TVector& inputs, TVector& outputs); void remapNonEntryPointIO(TFunction& function); TIntermNode* handleReturnValue(const TSourceLoc&, TIntermTyped*); void handleFunctionArgument(TFunction*, TIntermTyped*& arguments, TIntermTyped* newArg); - TIntermTyped* executeFlattenedInitializer(const TSourceLoc&, TIntermSymbol*, TIntermAggregate&); TIntermTyped* handleAssign(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right); TIntermTyped* handleAssignToMatrixSwizzle(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right); TIntermTyped* handleFunctionCall(const TSourceLoc&, TFunction*, TIntermTyped*); TIntermAggregate* assignClipCullDistance(const TSourceLoc&, TOperator, int semanticId, TIntermTyped* left, TIntermTyped* right); + TIntermTyped* assignPosition(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right); void decomposeIntrinsic(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments); void decomposeSampleMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments); void decomposeStructBufferMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments); @@ -126,7 +126,6 @@ class HlslParseContext : public TParseContextBase { void arraySizeCheck(const TSourceLoc&, TIntermTyped* expr, TArraySize&); void arraySizeRequiredCheck(const TSourceLoc&, const TArraySizes&); void structArrayCheck(const TSourceLoc&, const TType& structure); - void arrayDimMerge(TType& type, const TArraySizes* sizes); bool voidErrorCheck(const TSourceLoc&, const TString&, TBasicType); void globalQualifierFix(const TSourceLoc&, TQualifier&); bool structQualifierErrorCheck(const TSourceLoc&, const TPublicType& pType); @@ -138,10 +137,12 @@ class HlslParseContext : public TParseContextBase { void setLayoutQualifier(const TSourceLoc&, TQualifier&, TString&); void setLayoutQualifier(const TSourceLoc&, TQualifier&, TString&, const TIntermTyped*); + void setSpecConstantId(const TSourceLoc&, TQualifier&, int value); void mergeObjectLayoutQualifiers(TQualifier& dest, const TQualifier& src, bool inheritOnly); void checkNoShaderLayouts(const TSourceLoc&, const TShaderQualifiers&); const TFunction* findFunction(const TSourceLoc& loc, TFunction& call, bool& builtIn, int& thisDepth, TIntermTyped*& args); + void addGenMulArgumentConversion(const TSourceLoc& loc, TFunction& call, TIntermTyped*& args); void declareTypedef(const TSourceLoc&, const TString& identifier, const TType&); void declareStruct(const TSourceLoc&, TString& structName, TType&); TSymbol* lookupUserType(const TString&, TType&); @@ -152,7 +153,7 @@ class HlslParseContext : public TParseContextBase { TIntermTyped* convertArray(TIntermTyped*, const TType&); TIntermTyped* constructAggregate(TIntermNode*, const TType&, int, const TSourceLoc&); TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, const TSourceLoc&, bool subset); - void declareBlock(const TSourceLoc&, TType&, const TString* instanceName = 0, TArraySizes* arraySizes = 0); + void declareBlock(const TSourceLoc&, TType&, const TString* instanceName = 0); void declareStructBufferCounter(const TSourceLoc& loc, const TType& bufferType, const TString& name); void fixBlockLocations(const TSourceLoc&, TQualifier&, TTypeList&, bool memberWithLocation, bool memberWithoutLocation); void fixBlockXfbOffsets(TQualifier&, TTypeList&); @@ -161,9 +162,7 @@ class HlslParseContext : public TParseContextBase { void addQualifierToExisting(const TSourceLoc&, TQualifier, TIdentifierList&); void updateStandaloneQualifierDefaults(const TSourceLoc&, const TPublicType&); void wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode); - TIntermNode* addSwitch(const TSourceLoc&, TIntermTyped* expression, TIntermAggregate* body, TSelectionControl control); - - void updateImplicitArraySize(const TSourceLoc&, TIntermNode*, int index); + TIntermNode* addSwitch(const TSourceLoc&, TIntermTyped* expression, TIntermAggregate* body, const TAttributes&); void nestLooping() { ++loopNestingLevel; } void unnestLooping() { --loopNestingLevel; } @@ -182,18 +181,17 @@ class HlslParseContext : public TParseContextBase { void pushNamespace(const TString& name); void popNamespace(); - void getFullNamespaceName(const TString*&) const; + void getFullNamespaceName(TString*&) const; void addScopeMangler(TString&); void pushSwitchSequence(TIntermSequence* sequence) { switchSequenceStack.push_back(sequence); } void popSwitchSequence() { switchSequenceStack.pop_back(); } - virtual void growGlobalUniformBlock(const TSourceLoc&, TType&, const TString& memberName, TTypeList* typeList = nullptr) override; + virtual void growGlobalUniformBlock(const TSourceLoc&, TType&, const TString& memberName, + TTypeList* typeList = nullptr) override; // Apply L-value conversions. E.g, turning a write to a RWTexture into an ImageStore. TIntermTyped* handleLvalue(const TSourceLoc&, const char* op, TIntermTyped*& node); - TIntermTyped* handleSamplerLvalue(const TSourceLoc&, const char* op, TIntermTyped*& node); - TIntermTyped* setOpaqueLvalue(TIntermTyped* left, TIntermTyped* right); bool lValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*) override; TLayoutFormat getLayoutFromTxType(const TSourceLoc&, const TType&); @@ -202,13 +200,11 @@ class HlslParseContext : public TParseContextBase { bool handleInputGeometry(const TSourceLoc&, const TLayoutGeometry& geometry); // Determine selection control from attributes - TSelectionControl handleSelectionControl(const TAttributeMap& attributes) const; + void handleSelectionAttributes(const TSourceLoc& loc, TIntermSelection*, const TAttributes& attributes); + void handleSwitchAttributes(const TSourceLoc& loc, TIntermSwitch*, const TAttributes& attributes); // Determine loop control from attributes - TLoopControl handleLoopControl(const TAttributeMap& attributes) const; - - // Potentially rename shader entry point function - void renameShaderFunction(const TString*& name) const; + void handleLoopAttributes(const TSourceLoc& loc, TIntermLoop*, const TAttributes& attributes); // Share struct buffer deep types void shareStructBufferType(TType&); @@ -219,6 +215,8 @@ class HlslParseContext : public TParseContextBase { // Obtain the sampler return type of the given sampler in retType. void getTextureReturnType(const TSampler& sampler, TType& retType) const; + TAttributeType attributeFromName(const TString& nameSpace, const TString& name) const; + protected: struct TFlattenData { TFlattenData() : nextBinding(TQualifier::layoutBindingEnd), @@ -240,7 +238,7 @@ class HlslParseContext : public TParseContextBase { TIntermSymbol* makeInternalVariableNode(const TSourceLoc&, const char* name, const TType&) const; TVariable* declareNonArray(const TSourceLoc&, const TString& identifier, const TType&, bool track); void declareArray(const TSourceLoc&, const TString& identifier, const TType&, TSymbol*&, bool track); - TIntermNode* executeInitializer(const TSourceLoc&, TIntermTyped* initializer, TVariable* variable, bool flattened); + TIntermNode* executeInitializer(const TSourceLoc&, TIntermTyped* initializer, TVariable* variable); TIntermTyped* convertInitializerList(const TSourceLoc&, const TType&, TIntermTyped* initializer, TIntermTyped* scalarInit); bool isScalarConstructor(const TIntermNode*); TOperator mapAtomicOp(const TSourceLoc& loc, TOperator op, bool isImage); @@ -250,13 +248,14 @@ class HlslParseContext : public TParseContextBase { // Array and struct flattening TIntermTyped* flattenAccess(TIntermTyped* base, int member); - TIntermTyped* flattenAccess(int uniqueId, int member, const TType&, int subset = -1); - bool shouldFlatten(const TType&) const; + TIntermTyped* flattenAccess(int uniqueId, int member, TStorageQualifier outerStorage, const TType&, int subset = -1); + int findSubtreeOffset(const TIntermNode&) const; + int findSubtreeOffset(const TType&, int subset, const TVector& offsets) const; + bool shouldFlatten(const TType&, TStorageQualifier, bool topLevel) const; bool wasFlattened(const TIntermTyped* node) const; bool wasFlattened(int id) const { return flattenMap.find(id) != flattenMap.end(); } int addFlattenedMember(const TVariable&, const TType&, TFlattenData&, const TString& name, bool linkage, const TQualifier& outerQualifier, const TArraySizes* builtInArraySizes); - bool isFinalFlattening(const TType& type) const { return !(type.isStruct() || type.isArray()); } // Structure splitting (splits interstage built-in types into its own struct) void split(const TVariable&); @@ -266,6 +265,7 @@ class HlslParseContext : public TParseContextBase { bool wasSplit(int id) const { return splitNonIoVars.find(id) != splitNonIoVars.end(); } TVariable* getSplitNonIoVar(int id) const; void addPatchConstantInvocation(); + void fixTextureShadowModes(); TIntermTyped* makeIntegerIndex(TIntermTyped*); void fixBuiltInIoType(TType&); @@ -319,6 +319,9 @@ class HlslParseContext : public TParseContextBase { static bool isClipOrCullDistance(const TQualifier& qual) { return isClipOrCullDistance(qual.builtIn); } static bool isClipOrCullDistance(const TType& type) { return isClipOrCullDistance(type.getQualifier()); } + // Find the patch constant function (issues error, returns nullptr if not found) + const TFunction* findPatchConstantFunction(const TSourceLoc& loc); + // Pass through to base class after remembering built-in mappings. using TParseContextBase::trackLinkage; void trackLinkage(TSymbol& variable) override; @@ -399,7 +402,7 @@ class HlslParseContext : public TParseContextBase { // may fit in TSampler::structReturnIndex. TVector textureReturnStruct; - TMap structBufferCounter; + TMap structBufferCounter; // true if counter buffer is in use // The built-in interstage IO map considers e.g, EvqPosition on input and output separately, so that we // can build the linkage correctly if position appears on both sides. Otherwise, multiple positions @@ -418,12 +421,12 @@ class HlslParseContext : public TParseContextBase { }; TMap splitBuiltIns; // split built-ins, indexed by built-in type. - TVariable* inputPatch; + TVariable* inputPatch; // input patch is special for PCF: it's the only non-builtin PCF input, + // and is handled as a pseudo-builtin. unsigned int nextInLocation; unsigned int nextOutLocation; - TString sourceEntryPointName; TFunction* entryPointFunction; TIntermNode* entryPointFunctionBody; @@ -435,12 +438,16 @@ class HlslParseContext : public TParseContextBase { TVariable* gsStreamOutput; // geometry shader stream outputs, for emit (Append method) - TVariable* clipDistanceVariable; // synthesized clip distance variable (shader might have >1) - TVariable* cullDistanceVariable; // synthesized cull distance variable (shader might have >1) + TVariable* clipDistanceOutput; // synthesized clip distance out variable (shader might have >1) + TVariable* cullDistanceOutput; // synthesized cull distance out variable (shader might have >1) + TVariable* clipDistanceInput; // synthesized clip distance in variable (shader might have >1) + TVariable* cullDistanceInput; // synthesized cull distance in variable (shader might have >1) static const int maxClipCullRegs = 2; - std::array clipSemanticNSize; // vector, indexed by clip semantic ID - std::array cullSemanticNSize; // vector, indexed by cull semantic ID + std::array clipSemanticNSizeIn; // vector, indexed by clip semantic ID + std::array cullSemanticNSizeIn; // vector, indexed by cull semantic ID + std::array clipSemanticNSizeOut; // vector, indexed by clip semantic ID + std::array cullSemanticNSizeOut; // vector, indexed by cull semantic ID // This tracks the first (mip level) argument to the .mips[][] operator. Since this can be nested as // in tx.mips[tx.mips[0][1].x][2], we need a stack. We also track the TSourceLoc for error reporting @@ -452,6 +459,30 @@ class HlslParseContext : public TParseContextBase { }; TVector mipsOperatorMipArg; + + // A texture object may be used with shadow and non-shadow samplers, but both may not be + // alive post-DCE in the same shader. We do not know at compilation time which are alive: that's + // only known post-DCE. If a texture is used both ways, we create two textures, and + // leave the elimiation of one to the optimizer. This maps the shader variant to + // the shadow variant. + // + // This can be removed if and when the texture shadow code in + // HlslParseContext::handleSamplerTextureCombine is removed. + struct tShadowTextureSymbols { + tShadowTextureSymbols() { symId.fill(-1); } + + void set(bool shadow, int id) { symId[int(shadow)] = id; } + int get(bool shadow) const { return symId[int(shadow)]; } + + // True if this texture has been seen with both shadow and non-shadow modes + bool overloaded() const { return symId[0] != -1 && symId[1] != -1; } + bool isShadowId(int id) const { return symId[1] == id; } + + private: + std::array symId; + }; + + TMap textureShadowVariant; }; // This is the prefix we use for built-in methods to avoid namespace collisions with diff --git a/deps/glslang/hlsl/hlslParseables.cpp b/deps/glslang/hlsl/hlslParseables.cpp index db67c39d..cc847ae2 100644 --- a/deps/glslang/hlsl/hlslParseables.cpp +++ b/deps/glslang/hlsl/hlslParseables.cpp @@ -68,14 +68,21 @@ const char* BaseTypeName(const char argOrder, const char* scalarName, const char } } -bool IsSamplerType(const char argType) { return argType == 'S' || argType == 's'; } -bool IsArrayed(const char argOrder) { return argOrder == '@' || argOrder == '&' || argOrder == '#'; } -bool IsTextureMS(const char argOrder) { return argOrder == '$' || argOrder == '&'; } -bool IsBuffer(const char argOrder) { return argOrder == '*' || argOrder == '~'; } -bool IsImage(const char argOrder) { return argOrder == '!' || argOrder == '#' || argOrder == '~'; } +// arg order queries +bool IsSamplerType(const char argType) { return argType == 'S' || argType == 's'; } +bool IsArrayed(const char argOrder) { return argOrder == '@' || argOrder == '&' || argOrder == '#'; } +bool IsTextureNonMS(const char argOrder) { return argOrder == '%'; } +bool IsSubpassInput(const char argOrder) { return argOrder == '[' || argOrder == ']'; } +bool IsArrayedTexture(const char argOrder) { return argOrder == '@'; } +bool IsTextureMS(const char argOrder) { return argOrder == '$' || argOrder == '&'; } +bool IsMS(const char argOrder) { return IsTextureMS(argOrder) || argOrder == ']'; } +bool IsBuffer(const char argOrder) { return argOrder == '*' || argOrder == '~'; } +bool IsImage(const char argOrder) { return argOrder == '!' || argOrder == '#' || argOrder == '~'; } + bool IsTextureType(const char argOrder) { - return argOrder == '%' || argOrder == '@' || IsTextureMS(argOrder) || IsBuffer(argOrder) | IsImage(argOrder); + return IsTextureNonMS(argOrder) || IsArrayedTexture(argOrder) || + IsTextureMS(argOrder) || IsBuffer(argOrder) || IsImage(argOrder); } // Reject certain combinations that are illegal sample methods. For example, @@ -222,15 +229,16 @@ glslang::TString& AppendTypeName(glslang::TString& s, const char* argOrder, cons const bool isTexture = IsTextureType(argOrder[0]); const bool isArrayed = IsArrayed(argOrder[0]); const bool isSampler = IsSamplerType(argType[0]); - const bool isMS = IsTextureMS(argOrder[0]); + const bool isMS = IsMS(argOrder[0]); const bool isBuffer = IsBuffer(argOrder[0]); const bool isImage = IsImage(argOrder[0]); + const bool isSubpass = IsSubpassInput(argOrder[0]); char type = *argType; if (isTranspose) { // Take transpose of matrix dimensions std::swap(dim0, dim1); - } else if (isTexture) { + } else if (isTexture || isSubpass) { if (type == 'F') // map base type to texture of that type. type = 'T'; // e.g, int -> itexture, uint -> utexture, etc. else if (type == 'I') @@ -251,20 +259,29 @@ glslang::TString& AppendTypeName(glslang::TString& s, const char* argOrder, cons case 'D': s += "double"; break; case 'I': s += "int"; break; case 'U': s += "uint"; break; + case 'L': s += "int64_t"; break; + case 'M': s += "uint64_t"; break; case 'B': s += "bool"; break; case 'S': s += "sampler"; break; case 's': s += "SamplerComparisonState"; break; case 'T': s += ((isBuffer && isImage) ? "RWBuffer" : + isSubpass ? "SubpassInput" : isBuffer ? "Buffer" : isImage ? "RWTexture" : "Texture"); break; case 'i': s += ((isBuffer && isImage) ? "RWBuffer" : + isSubpass ? "SubpassInput" : isBuffer ? "Buffer" : isImage ? "RWTexture" : "Texture"); break; case 'u': s += ((isBuffer && isImage) ? "RWBuffer" : + isSubpass ? "SubpassInput" : isBuffer ? "Buffer" : isImage ? "RWTexture" : "Texture"); break; default: s += "UNKNOWN_TYPE"; break; } + + if (isSubpass && isMS) + s += "MS"; + } else { switch (type) { case '-': s += "void"; break; @@ -282,6 +299,7 @@ glslang::TString& AppendTypeName(glslang::TString& s, const char* argOrder, cons s += type; s += ((isImage && isBuffer) ? "imageBuffer" : + isSubpass ? "subpassInput" : isImage ? "image" : isBuffer ? "samplerBuffer" : "texture"); @@ -296,6 +314,9 @@ glslang::TString& AppendTypeName(glslang::TString& s, const char* argOrder, cons if (fixedVecSize != 0) dim0 = dim1 = fixedVecSize; + const char dim0Char = ('0' + char(dim0)); + const char dim1Char = ('0' + char(dim1)); + // Add sampler dimensions if (isSampler || isTexture) { if ((order == 'V' || isTexture) && !isBuffer) { @@ -320,12 +341,12 @@ glslang::TString& AppendTypeName(glslang::TString& s, const char* argOrder, cons case '-': break; // no dimensions for voids case 'S': break; // no dimensions on scalars case 'V': - s += ('0' + char(dim0)); + s += dim0Char; break; case 'M': - s += ('0' + char(dim0)); + s += dim0Char; s += 'x'; - s += ('0' + char(dim1)); + s += dim1Char; break; default: break; @@ -339,9 +360,9 @@ glslang::TString& AppendTypeName(glslang::TString& s, const char* argOrder, cons // For HLSL, append return type for texture types if (UseHlslTypes) { switch (type) { - case 'i': s += ""; break; - case 'u': s += ""; break; - case 'T': s += ""; break; + case 'i': s += "' as first letter of order creates an output parameter // '<' as first letter of order creates an input parameter @@ -537,6 +558,7 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c // '!' as first letter of order creates image object // '#' as first letter of order creates arrayed image object // '~' as first letter of order creates an image buffer object + // '[' / ']' as first letter of order creates a SubpassInput/SubpassInputMS object static const struct { const char* name; // intrinsic name @@ -547,8 +569,8 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c unsigned int stage; // stage mask bool method; // true if it's a method. } hlslIntrinsics[] = { - // name retOrd retType argOrder argType stage mask - // ----------------------------------------------------------------------------------------------- + // name retOrd retType argOrder argType stage mask method + // ---------------------------------------------------------------------------------------------------------------- { "abort", nullptr, nullptr, "-", "-", EShLangAll, false }, { "abs", nullptr, nullptr, "SVM", "DFUI", EShLangAll, false }, { "acos", nullptr, nullptr, "SVM", "F", EShLangAll, false }, @@ -560,14 +582,14 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c { "asdouble", "V2", "D", "V2,", "UI,", EShLangAll, false }, { "asfloat", nullptr, "F", "SVM", "BFIU", EShLangAll, false }, { "asin", nullptr, nullptr, "SVM", "F", EShLangAll, false }, - { "asint", nullptr, "I", "SVM", "FU", EShLangAll, false }, - { "asuint", nullptr, "U", "SVM", "FU", EShLangAll, false }, + { "asint", nullptr, "I", "SVM", "FIU", EShLangAll, false }, + { "asuint", nullptr, "U", "SVM", "FIU", EShLangAll, false }, { "atan", nullptr, nullptr, "SVM", "F", EShLangAll, false }, { "atan2", nullptr, nullptr, "SVM,", "F,", EShLangAll, false }, { "ceil", nullptr, nullptr, "SVM", "F", EShLangAll, false }, { "CheckAccessFullyMapped", "S", "B" , "S", "U", EShLangPSCS, false }, { "clamp", nullptr, nullptr, "SVM,,", "FUI,,", EShLangAll, false }, - { "clip", "-", "-", "SVM", "F", EShLangPS, false }, + { "clip", "-", "-", "SVM", "FUI", EShLangPS, false }, { "cos", nullptr, nullptr, "SVM", "F", EShLangAll, false }, { "cosh", nullptr, nullptr, "SVM", "F", EShLangAll, false }, { "countbits", nullptr, nullptr, "SV", "UI", EShLangAll, false }, @@ -882,6 +904,39 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c { "DecrementCounter", nullptr, nullptr, "-", "-", EShLangAll, true }, { "Consume", nullptr, nullptr, "-", "-", EShLangAll, true }, + // SM 6.0 + + { "WaveIsFirstLane", "S", "B", "-", "-", EShLangPSCS, false}, + { "WaveGetLaneCount", "S", "U", "-", "-", EShLangPSCS, false}, + { "WaveGetLaneIndex", "S", "U", "-", "-", EShLangPSCS, false}, + { "WaveActiveAnyTrue", "S", "B", "S", "B", EShLangPSCS, false}, + { "WaveActiveAllTrue", "S", "B", "S", "B", EShLangPSCS, false}, + { "WaveActiveBallot", "V4", "U", "S", "B", EShLangPSCS, false}, + { "WaveReadLaneAt", nullptr, nullptr, "SV,S", "DFUI,U", EShLangPSCS, false}, + { "WaveReadLaneFirst", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveAllEqual", "S", "B", "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveAllEqualBool", "S", "B", "S", "B", EShLangPSCS, false}, + { "WaveActiveCountBits", "S", "U", "S", "B", EShLangPSCS, false}, + + { "WaveActiveSum", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveProduct", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveBitAnd", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveBitOr", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveBitXor", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveMin", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WaveActiveMax", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WavePrefixSum", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WavePrefixProduct", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "WavePrefixCountBits", "S", "U", "S", "B", EShLangPSCS, false}, + { "QuadReadAcrossX", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "QuadReadAcrossY", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "QuadReadAcrossDiagonal", nullptr, nullptr, "SV", "DFUI", EShLangPSCS, false}, + { "QuadReadLaneAt", nullptr, nullptr, "SV,S", "DFUI,U", EShLangPSCS, false}, + + // Methods for subpass input objects + { "SubpassLoad", "V4", nullptr, "[", "FIU", EShLangPS, true }, + { "SubpassLoad", "V4", nullptr, "],S", "FIU,I", EShLangPS, true }, + // Mark end of list, since we want to avoid a range-based for, as some compilers don't handle it yet. { nullptr, nullptr, nullptr, nullptr, nullptr, 0, false }, }; @@ -1063,8 +1118,8 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int /*version*/, EProfile /*profil symbolTable.relateToOperator("ddy_fine", EOpDPdyFine); symbolTable.relateToOperator("degrees", EOpDegrees); symbolTable.relateToOperator("determinant", EOpDeterminant); - symbolTable.relateToOperator("DeviceMemoryBarrier", EOpGroupMemoryBarrier); - symbolTable.relateToOperator("DeviceMemoryBarrierWithGroupSync", EOpGroupMemoryBarrierWithGroupSync); // ... + symbolTable.relateToOperator("DeviceMemoryBarrier", EOpDeviceMemoryBarrier); + symbolTable.relateToOperator("DeviceMemoryBarrierWithGroupSync", EOpDeviceMemoryBarrierWithGroupSync); symbolTable.relateToOperator("distance", EOpDistance); symbolTable.relateToOperator("dot", EOpDot); symbolTable.relateToOperator("dst", EOpDst); @@ -1219,6 +1274,37 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int /*version*/, EProfile /*profil // GS methods symbolTable.relateToOperator(BUILTIN_PREFIX "Append", EOpMethodAppend); symbolTable.relateToOperator(BUILTIN_PREFIX "RestartStrip", EOpMethodRestartStrip); + + // Wave ops + symbolTable.relateToOperator("WaveIsFirstLane", EOpSubgroupElect); + symbolTable.relateToOperator("WaveGetLaneCount", EOpWaveGetLaneCount); + symbolTable.relateToOperator("WaveGetLaneIndex", EOpWaveGetLaneIndex); + symbolTable.relateToOperator("WaveActiveAnyTrue", EOpSubgroupAny); + symbolTable.relateToOperator("WaveActiveAllTrue", EOpSubgroupAll); + symbolTable.relateToOperator("WaveActiveBallot", EOpSubgroupBallot); + symbolTable.relateToOperator("WaveReadLaneFirst", EOpSubgroupBroadcastFirst); + symbolTable.relateToOperator("WaveReadLaneAt", EOpSubgroupShuffle); + symbolTable.relateToOperator("WaveActiveAllEqual", EOpSubgroupAllEqual); + symbolTable.relateToOperator("WaveActiveAllEqualBool", EOpSubgroupAllEqual); + symbolTable.relateToOperator("WaveActiveCountBits", EOpWaveActiveCountBits); + symbolTable.relateToOperator("WaveActiveSum", EOpSubgroupAdd); + symbolTable.relateToOperator("WaveActiveProduct", EOpSubgroupMul); + symbolTable.relateToOperator("WaveActiveBitAnd", EOpSubgroupAnd); + symbolTable.relateToOperator("WaveActiveBitOr", EOpSubgroupOr); + symbolTable.relateToOperator("WaveActiveBitXor", EOpSubgroupXor); + symbolTable.relateToOperator("WaveActiveMin", EOpSubgroupMin); + symbolTable.relateToOperator("WaveActiveMax", EOpSubgroupMax); + symbolTable.relateToOperator("WavePrefixSum", EOpSubgroupInclusiveAdd); + symbolTable.relateToOperator("WavePrefixProduct", EOpSubgroupInclusiveMul); + symbolTable.relateToOperator("WavePrefixCountBits", EOpWavePrefixCountBits); + symbolTable.relateToOperator("QuadReadAcrossX", EOpSubgroupQuadSwapHorizontal); + symbolTable.relateToOperator("QuadReadAcrossY", EOpSubgroupQuadSwapVertical); + symbolTable.relateToOperator("QuadReadAcrossDiagonal", EOpSubgroupQuadSwapDiagonal); + symbolTable.relateToOperator("QuadReadLaneAt", EOpSubgroupQuadBroadcast); + + // Subpass input methods + symbolTable.relateToOperator(BUILTIN_PREFIX "SubpassLoad", EOpSubpassLoad); + symbolTable.relateToOperator(BUILTIN_PREFIX "SubpassLoadMS", EOpSubpassLoadMS); } // diff --git a/deps/glslang/hlsl/hlslScanContext.cpp b/deps/glslang/hlsl/hlslScanContext.cpp index 392efeb5..28a66bb4 100644 --- a/deps/glslang/hlsl/hlslScanContext.cpp +++ b/deps/glslang/hlsl/hlslScanContext.cpp @@ -143,6 +143,7 @@ void HlslScanContext::fillInKeywordMap() (*KeywordMap)["bool"] = EHTokBool; (*KeywordMap)["int"] = EHTokInt; (*KeywordMap)["uint"] = EHTokUint; + (*KeywordMap)["uint64_t"] = EHTokUint64; (*KeywordMap)["dword"] = EHTokDword; (*KeywordMap)["half"] = EHTokHalf; (*KeywordMap)["float"] = EHTokFloat; @@ -336,6 +337,8 @@ void HlslScanContext::fillInKeywordMap() (*KeywordMap)["RWTexture2DArray"] = EHTokRWTexture2darray; (*KeywordMap)["RWTexture3D"] = EHTokRWTexture3d; (*KeywordMap)["RWBuffer"] = EHTokRWBuffer; + (*KeywordMap)["SubpassInput"] = EHTokSubpassInput; + (*KeywordMap)["SubpassInputMS"] = EHTokSubpassInputMS; (*KeywordMap)["AppendStructuredBuffer"] = EHTokAppendStructuredBuffer; (*KeywordMap)["ByteAddressBuffer"] = EHTokByteAddressBuffer; @@ -343,6 +346,7 @@ void HlslScanContext::fillInKeywordMap() (*KeywordMap)["RWByteAddressBuffer"] = EHTokRWByteAddressBuffer; (*KeywordMap)["RWStructuredBuffer"] = EHTokRWStructuredBuffer; (*KeywordMap)["StructuredBuffer"] = EHTokStructuredBuffer; + (*KeywordMap)["TextureBuffer"] = EHTokTextureBuffer; (*KeywordMap)["class"] = EHTokClass; (*KeywordMap)["struct"] = EHTokStruct; @@ -546,6 +550,7 @@ EHlslTokenClass HlslScanContext::tokenizeClass(HlslToken& token) case PpAtomConstInt: parserToken->i = ppToken.ival; return EHTokIntConstant; case PpAtomConstUint: parserToken->i = ppToken.ival; return EHTokUintConstant; + case PpAtomConstFloat16: parserToken->d = ppToken.dval; return EHTokFloat16Constant; case PpAtomConstFloat: parserToken->d = ppToken.dval; return EHTokFloatConstant; case PpAtomConstDouble: parserToken->d = ppToken.dval; return EHTokDoubleConstant; case PpAtomIdentifier: @@ -562,10 +567,15 @@ EHlslTokenClass HlslScanContext::tokenizeClass(HlslToken& token) case EndOfInput: return EHTokNone; default: - char buf[2]; - buf[0] = (char)token; - buf[1] = 0; - parseContext.error(loc, "unexpected token", buf, ""); + if (token < PpAtomMaxSingle) { + char buf[2]; + buf[0] = (char)token; + buf[1] = 0; + parseContext.error(loc, "unexpected token", buf, ""); + } else if (tokenText[0] != 0) + parseContext.error(loc, "unexpected token", tokenText, ""); + else + parseContext.error(loc, "unexpected token", "", ""); break; } } while (true); @@ -642,6 +652,7 @@ EHlslTokenClass HlslScanContext::tokenizeIdentifier() case EHTokBool: case EHTokInt: case EHTokUint: + case EHTokUint64: case EHTokDword: case EHTokHalf: case EHTokFloat: @@ -827,6 +838,9 @@ EHlslTokenClass HlslScanContext::tokenizeIdentifier() case EHTokRWByteAddressBuffer: case EHTokRWStructuredBuffer: case EHTokStructuredBuffer: + case EHTokTextureBuffer: + case EHTokSubpassInput: + case EHTokSubpassInputMS: return keyword; // variable, user type, ... diff --git a/deps/glslang/hlsl/hlslTokens.h b/deps/glslang/hlsl/hlslTokens.h index 15de63ab..4426bcce 100644 --- a/deps/glslang/hlsl/hlslTokens.h +++ b/deps/glslang/hlsl/hlslTokens.h @@ -95,6 +95,7 @@ enum EHlslTokenClass { EHTokBool, EHTokInt, EHTokUint, + EHTokUint64, EHTokDword, EHTokHalf, EHTokFloat, @@ -273,6 +274,8 @@ enum EHlslTokenClass { EHTokRWTexture2darray, EHTokRWTexture3d, EHTokRWBuffer, + EHTokSubpassInput, + EHTokSubpassInputMS, // Structure buffer variants EHTokAppendStructuredBuffer, @@ -281,6 +284,7 @@ enum EHlslTokenClass { EHTokRWByteAddressBuffer, EHTokRWStructuredBuffer, EHTokStructuredBuffer, + EHTokTextureBuffer, // variable, user type, ... EHTokIdentifier, @@ -294,6 +298,7 @@ enum EHlslTokenClass { EHTokConstantBuffer, // constant + EHTokFloat16Constant, EHTokFloatConstant, EHTokDoubleConstant, EHTokIntConstant, diff --git a/deps/glslang/index.php b/deps/glslang/index.php deleted file mode 100644 index 9a4bbcd9..00000000 --- a/deps/glslang/index.php +++ /dev/null @@ -1,81 +0,0 @@ - - - - GLSL Reference Parser - - - - -

- [About] - - - -

-

About GLSL Reference Parser

-

- The GLSL Reference Parser provides a front end for parsing and - operating on OpenGL Shading Language code. It was originally - developed by 3Dlabs and is being maintained and updated by LunarG. The README has some additional information. -

- -

- You can download the source from the - Khronos public-access Subversion server . For example, using the Subversion - command-line client: -

- -

- svn checkout --username anonymous --password anonymous - https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang/ glslang -

- -
- -

Requirements

-

TBD. Builds on Windows and Linux.

- - -
- - -
-

- Get BuGLe at SourceForge.net. Fast, secure and Free Open Source software downloads - - - diff --git a/examples/DynamicBuffers/src/app.cpp b/examples/DynamicBuffers/src/app.cpp index b1ef0613..3dff0ae0 100644 --- a/examples/DynamicBuffers/src/app.cpp +++ b/examples/DynamicBuffers/src/app.cpp @@ -30,13 +30,19 @@ #include #include #include "config.h" -#include "misc/compute_pipeline_info.h" +#include "misc/buffer_create_info.h" +#include "misc/compute_pipeline_create_info.h" +#include "misc/framebuffer_create_info.h" #include "misc/glsl_to_spirv.h" -#include "misc/graphics_pipeline_info.h" +#include "misc/graphics_pipeline_create_info.h" +#include "misc/image_create_info.h" +#include "misc/image_view_create_info.h" #include "misc/io.h" #include "misc/memory_allocator.h" #include "misc/object_tracker.h" -#include "misc/render_pass_info.h" +#include "misc/render_pass_create_info.h" +#include "misc/semaphore_create_info.h" +#include "misc/swapchain_create_info.h" #include "misc/time.h" #include "misc/window_factory.h" #include "wrappers/buffer.h" @@ -412,11 +418,15 @@ void App::init_buffers() /* Prepare a buffer object to hold the sine offset data. Note that we fill it with data * after memory allocator actually assigns it a memory block. */ - m_sine_offset_data_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), - m_sine_offset_data_buffer_size, - Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_CONCURRENT, - VK_BUFFER_USAGE_STORAGE_BUFFER_BIT); + { + auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), + m_sine_offset_data_buffer_size, + Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_CONCURRENT, + VK_BUFFER_USAGE_STORAGE_BUFFER_BIT); + + m_sine_offset_data_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); + } m_sine_offset_data_buffer_ptr->set_name("Sine offset data buffer"); @@ -450,11 +460,15 @@ void App::init_buffers() m_sine_data_buffer_size *= 2; - m_sine_data_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), - m_sine_data_buffer_size, - Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_CONCURRENT, - VK_BUFFER_USAGE_STORAGE_BUFFER_BIT); + { + auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), + m_sine_data_buffer_size, + Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_CONCURRENT, + VK_BUFFER_USAGE_STORAGE_BUFFER_BIT); + + m_sine_data_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); + } m_sine_data_buffer_ptr->set_name("Sine data buffer"); @@ -469,11 +483,15 @@ void App::init_buffers() m_sine_props_data_buffer_size_per_swapchain_image = sine_props_data_buffer_size_per_swapchain_image; - m_sine_props_data_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), - sine_props_data_buffer_size_total, - Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_CONCURRENT, - VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT); + { + auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), + sine_props_data_buffer_size_total, + Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_CONCURRENT, + VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT); + + m_sine_props_data_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); + } m_sine_props_data_buffer_ptr->set_name("Sine properties data buffer"); @@ -503,11 +521,15 @@ void App::init_buffers() color_buffer_data_traveller_ptr ++; } - m_sine_color_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), - m_sine_color_buffer_size, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_VERTEX_BUFFER_BIT); + { + auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), + m_sine_color_buffer_size, + Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_EXCLUSIVE, + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT); + + m_sine_color_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); + } m_sine_color_buffer_ptr->set_name("Sine color data buffer"); @@ -516,11 +538,11 @@ void App::init_buffers() /* Assign memory blocks to buffers and fill them with data */ m_sine_offset_data_buffer_ptr->write(0, /* start_offset */ - m_sine_offset_data_buffer_ptr->get_size(), + m_sine_offset_data_buffer_ptr->get_create_info_ptr()->get_size(), sine_offset_data_raw_buffer_ptr.get() ); m_sine_color_buffer_ptr->write(0, /* start_offset */ - m_sine_color_buffer_ptr->get_size(), + m_sine_color_buffer_ptr->get_create_info_ptr()->get_size(), color_buffer_data_ptr.get() ); } @@ -528,7 +550,7 @@ void App::init_buffers() void App::init_command_buffers() { auto gfx_pipeline_manager_ptr (m_device_ptr->get_graphics_pipeline_manager() ); - const bool is_debug_marker_ext_present (m_device_ptr->is_ext_debug_marker_extension_enabled() ); + const bool is_debug_marker_ext_present (m_device_ptr->get_extension_info()->ext_debug_marker() ); Anvil::PipelineLayout* producer_pipeline_layout_ptr(nullptr); VkImageSubresourceRange subresource_range; Anvil::Queue* universal_queue_ptr (m_device_ptr->get_universal_queue(0) ); @@ -789,14 +811,14 @@ void App::init_compute_pipelines() bool result; /* Create & configure the compute pipeline */ - auto producer_pipeline_info_ptr = Anvil::ComputePipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - *m_producer_cs_ptr); - - producer_pipeline_info_ptr->attach_push_constant_range(0, /* offset */ - 4, /* size */ - VK_SHADER_STAGE_COMPUTE_BIT); - producer_pipeline_info_ptr->set_descriptor_set_info (m_producer_dsg_ptr->get_descriptor_set_info() ); + auto producer_pipeline_info_ptr = Anvil::ComputePipelineCreateInfo::create_regular(false, /* in_disable_optimizations */ + false, /* in_allow_derivatives */ + *m_producer_cs_ptr); + + producer_pipeline_info_ptr->attach_push_constant_range (0, /* offset */ + 4, /* size */ + VK_SHADER_STAGE_COMPUTE_BIT); + producer_pipeline_info_ptr->set_descriptor_set_create_info(m_producer_dsg_ptr->get_descriptor_set_create_info() ); result = compute_manager_ptr->add_pipeline(std::move(producer_pipeline_info_ptr), &m_producer_pipeline_id); @@ -808,39 +830,39 @@ void App::init_compute_pipelines() void App::init_dsgs() { - auto consumer_dsg_info_ptrs = std::vector(2); - auto producer_dsg_info_ptrs = std::vector(2); - - consumer_dsg_info_ptrs[0] = Anvil::DescriptorSetInfo::create(); - consumer_dsg_info_ptrs[1] = Anvil::DescriptorSetInfo::create(); - producer_dsg_info_ptrs[0] = Anvil::DescriptorSetInfo::create(); - producer_dsg_info_ptrs[1] = Anvil::DescriptorSetInfo::create(); - - consumer_dsg_info_ptrs[0]->add_binding(0, /* binding */ - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, - 1, /* n_elements */ - VK_SHADER_STAGE_VERTEX_BIT); - consumer_dsg_info_ptrs[1]->add_binding(0, /* binding */ - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, - 1, /* n_elements */ - VK_SHADER_STAGE_VERTEX_BIT); - - producer_dsg_info_ptrs[0]->add_binding(0, /* binding */ - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, - 1, /* n_elements */ - VK_SHADER_STAGE_COMPUTE_BIT); - producer_dsg_info_ptrs[0]->add_binding(1, /* binding */ - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, - 1, /* n_elements */ - VK_SHADER_STAGE_COMPUTE_BIT); - producer_dsg_info_ptrs[1]->add_binding(0, /* binding */ - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, - 1, /* n_elements */ - VK_SHADER_STAGE_COMPUTE_BIT); + auto consumer_dsg_create_info_ptrs = std::vector(2); + auto producer_dsg_create_info_ptrs = std::vector(2); + + consumer_dsg_create_info_ptrs[0] = Anvil::DescriptorSetCreateInfo::create(); + consumer_dsg_create_info_ptrs[1] = Anvil::DescriptorSetCreateInfo::create(); + producer_dsg_create_info_ptrs[0] = Anvil::DescriptorSetCreateInfo::create(); + producer_dsg_create_info_ptrs[1] = Anvil::DescriptorSetCreateInfo::create(); + + consumer_dsg_create_info_ptrs[0]->add_binding(0, /* binding */ + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, + 1, /* n_elements */ + VK_SHADER_STAGE_VERTEX_BIT); + consumer_dsg_create_info_ptrs[1]->add_binding(0, /* binding */ + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, + 1, /* n_elements */ + VK_SHADER_STAGE_VERTEX_BIT); + + producer_dsg_create_info_ptrs[0]->add_binding(0, /* binding */ + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, + 1, /* n_elements */ + VK_SHADER_STAGE_COMPUTE_BIT); + producer_dsg_create_info_ptrs[0]->add_binding(1, /* binding */ + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, + 1, /* n_elements */ + VK_SHADER_STAGE_COMPUTE_BIT); + producer_dsg_create_info_ptrs[1]->add_binding(0, /* binding */ + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, + 1, /* n_elements */ + VK_SHADER_STAGE_COMPUTE_BIT); /* Create the descriptor set layouts for the generator program. */ m_producer_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), - producer_dsg_info_ptrs, + producer_dsg_create_info_ptrs, false); /* releaseable_sets */ @@ -862,7 +884,7 @@ void App::init_dsgs() /* Set up the descriptor set layout for the renderer program. */ m_consumer_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), - consumer_dsg_info_ptrs, + consumer_dsg_create_info_ptrs, false); /* releaseable_sets */ @@ -893,20 +915,24 @@ void App::init_framebuffers() { Anvil::FramebufferUniquePtr result_fb_ptr; - result_fb_ptr = Anvil::Framebuffer::create(m_device_ptr.get(), - WINDOW_WIDTH, - WINDOW_HEIGHT, - 1); /* n_layers */ + { + auto create_info_ptr = Anvil::FramebufferCreateInfo::create(m_device_ptr.get(), + WINDOW_WIDTH, + WINDOW_HEIGHT, + 1); /* n_layers */ - result_fb_ptr->set_name_formatted("Framebuffer for swapchain image [%d]", - n_swapchain_image); + result = create_info_ptr->add_attachment(m_swapchain_ptr->get_image_view(n_swapchain_image), + nullptr); /* out_opt_attachment_id_ptr */ + anvil_assert(result); - result = result_fb_ptr->add_attachment(m_swapchain_ptr->get_image_view(n_swapchain_image), - nullptr); /* out_opt_attachment_id_ptr */ - anvil_assert(result); + result = create_info_ptr->add_attachment(m_depth_image_views[n_swapchain_image].get(), + nullptr); /* out_opt_attachment_id_ptr */ - result = result_fb_ptr->add_attachment(m_depth_image_views[n_swapchain_image].get(), - nullptr); /* out_opt_attachment_id_ptr */ + result_fb_ptr = Anvil::Framebuffer::create(std::move(create_info_ptr) ); + } + + result_fb_ptr->set_name_formatted("Framebuffer for swapchain image [%d]", + n_swapchain_image); m_fbos[n_swapchain_image] = std::move(result_fb_ptr); } @@ -914,8 +940,8 @@ void App::init_framebuffers() void App::init_gfx_pipelines() { - auto gfx_manager_ptr = m_device_ptr->get_graphics_pipeline_manager(); - auto renderpass_info_ptr = Anvil::RenderPassInfoUniquePtr(new Anvil::RenderPassInfo(m_device_ptr.get() ) ); + auto gfx_manager_ptr = m_device_ptr->get_graphics_pipeline_manager(); + auto renderpass_create_info_ptr = Anvil::RenderPassCreateInfoUniquePtr(new Anvil::RenderPassCreateInfo(m_device_ptr.get() ) ); /* Create a renderpass instance */ #ifdef ENABLE_OFFSCREEN_RENDERING @@ -928,70 +954,70 @@ void App::init_gfx_pipelines() Anvil::RenderPassAttachmentID render_pass_depth_attachment_id = -1; Anvil::SubPassID render_pass_subpass_id = -1; - renderpass_info_ptr->add_color_attachment(m_swapchain_ptr->get_image_format(), - VK_SAMPLE_COUNT_1_BIT, - VK_ATTACHMENT_LOAD_OP_CLEAR, - VK_ATTACHMENT_STORE_OP_STORE, - VK_IMAGE_LAYOUT_UNDEFINED, - final_layout, - false, /* may_alias */ - &render_pass_color_attachment_id); - - renderpass_info_ptr->add_depth_stencil_attachment(m_depth_images[0]->get_image_format(), - m_depth_images[0]->get_image_sample_count(), - VK_ATTACHMENT_LOAD_OP_CLEAR, /* depth_load_op */ - VK_ATTACHMENT_STORE_OP_DONT_CARE, /* depth_store_op */ - VK_ATTACHMENT_LOAD_OP_DONT_CARE, /* stencil_load_op */ - VK_ATTACHMENT_STORE_OP_DONT_CARE, /* stencil_store_op */ - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* initial_layout */ - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* final_layout */ - false, /* may_alias */ - &render_pass_depth_attachment_id); - - renderpass_info_ptr->add_subpass(&render_pass_subpass_id); - - renderpass_info_ptr->add_subpass_color_attachment (render_pass_subpass_id, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - render_pass_color_attachment_id, - 0, /* location */ - nullptr); /* opt_attachment_resolve_id_ptr */ - renderpass_info_ptr->add_subpass_depth_stencil_attachment(render_pass_subpass_id, - render_pass_depth_attachment_id, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); - - m_consumer_render_pass_ptr = Anvil::RenderPass::create(std::move(renderpass_info_ptr), + renderpass_create_info_ptr->add_color_attachment(m_swapchain_ptr->get_create_info_ptr()->get_format(), + VK_SAMPLE_COUNT_1_BIT, + VK_ATTACHMENT_LOAD_OP_CLEAR, + VK_ATTACHMENT_STORE_OP_STORE, + VK_IMAGE_LAYOUT_UNDEFINED, + final_layout, + false, /* may_alias */ + &render_pass_color_attachment_id); + + renderpass_create_info_ptr->add_depth_stencil_attachment(m_depth_images[0]->get_create_info_ptr()->get_format(), + m_depth_images[0]->get_create_info_ptr()->get_sample_count(), + VK_ATTACHMENT_LOAD_OP_CLEAR, /* depth_load_op */ + VK_ATTACHMENT_STORE_OP_DONT_CARE, /* depth_store_op */ + VK_ATTACHMENT_LOAD_OP_DONT_CARE, /* stencil_load_op */ + VK_ATTACHMENT_STORE_OP_DONT_CARE, /* stencil_store_op */ + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* initial_layout */ + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* final_layout */ + false, /* may_alias */ + &render_pass_depth_attachment_id); + + renderpass_create_info_ptr->add_subpass(&render_pass_subpass_id); + + renderpass_create_info_ptr->add_subpass_color_attachment (render_pass_subpass_id, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + render_pass_color_attachment_id, + 0, /* location */ + nullptr); /* opt_attachment_resolve_id_ptr */ + renderpass_create_info_ptr->add_subpass_depth_stencil_attachment(render_pass_subpass_id, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + render_pass_depth_attachment_id); + + m_consumer_render_pass_ptr = Anvil::RenderPass::create(std::move(renderpass_create_info_ptr), m_swapchain_ptr.get() ); m_consumer_render_pass_ptr->set_name("Consumer renderpass"); /* Set up the graphics pipeline for the main subpass */ - auto consumer_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - m_consumer_render_pass_ptr.get(), - render_pass_subpass_id, - *m_consumer_fs_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader */ - *m_consumer_vs_ptr); - - consumer_pipeline_info_ptr->add_vertex_attribute (0, /* location */ - VK_FORMAT_R8G8_UNORM, - 0, /* offset_in_bytes */ - sizeof(char) * 2, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_INSTANCE); - consumer_pipeline_info_ptr->set_descriptor_set_info (m_consumer_dsg_ptr->get_descriptor_set_info() ); - consumer_pipeline_info_ptr->set_primitive_topology (VK_PRIMITIVE_TOPOLOGY_LINE_STRIP); - consumer_pipeline_info_ptr->set_rasterization_properties (VK_POLYGON_MODE_FILL, - VK_CULL_MODE_NONE, - VK_FRONT_FACE_COUNTER_CLOCKWISE, - 1.0f /* line_width */); - consumer_pipeline_info_ptr->toggle_depth_test (true, /* should_enable */ - VK_COMPARE_OP_LESS_OR_EQUAL); - consumer_pipeline_info_ptr->toggle_depth_writes (true); /* should_enable */ - consumer_pipeline_info_ptr->toggle_dynamic_states (true, /* should_enable */ - Anvil::DYNAMIC_STATE_LINE_WIDTH_BIT); + auto consumer_pipeline_info_ptr = Anvil::GraphicsPipelineCreateInfo::create_regular(false, /* in_disable_optimizations */ + false, /* in_allow_derivatives */ + m_consumer_render_pass_ptr.get(), + render_pass_subpass_id, + *m_consumer_fs_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader */ + *m_consumer_vs_ptr); + + consumer_pipeline_info_ptr->add_vertex_attribute (0, /* location */ + VK_FORMAT_R8G8_UNORM, + 0, /* offset_in_bytes */ + sizeof(char) * 2, /* stride_in_bytes */ + VK_VERTEX_INPUT_RATE_INSTANCE); + consumer_pipeline_info_ptr->set_descriptor_set_create_info(m_consumer_dsg_ptr->get_descriptor_set_create_info() ); + consumer_pipeline_info_ptr->set_primitive_topology (VK_PRIMITIVE_TOPOLOGY_LINE_STRIP); + consumer_pipeline_info_ptr->set_rasterization_properties (VK_POLYGON_MODE_FILL, + VK_CULL_MODE_NONE, + VK_FRONT_FACE_COUNTER_CLOCKWISE, + 1.0f /* line_width */); + consumer_pipeline_info_ptr->toggle_depth_test (true, /* should_enable */ + VK_COMPARE_OP_LESS_OR_EQUAL); + consumer_pipeline_info_ptr->toggle_depth_writes (true); /* should_enable */ + consumer_pipeline_info_ptr->toggle_dynamic_states (true, /* should_enable */ + Anvil::DYNAMIC_STATE_LINE_WIDTH_BIT); gfx_manager_ptr->add_pipeline(std::move(consumer_pipeline_info_ptr), &m_consumer_pipeline_id); @@ -1003,36 +1029,44 @@ void App::init_images() n_depth_image < N_SWAPCHAIN_IMAGES; ++n_depth_image) { - m_depth_images[n_depth_image] = Anvil::Image::create_nonsparse(m_device_ptr.get(), - VK_IMAGE_TYPE_2D, - VK_FORMAT_D16_UNORM, - VK_IMAGE_TILING_OPTIMAL, - VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, - WINDOW_WIDTH, - WINDOW_HEIGHT, - 1, /* in_base_mipmap_depth */ - 1, /* in_n_layers */ - VK_SAMPLE_COUNT_1_BIT, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - false, /* in_use_full_mipmap_chain */ - 0, /* in_memory_features */ - 0, /* in_create_flags */ - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, - nullptr); /* in_mipmaps_ptr */ - - m_depth_image_views[n_depth_image] = Anvil::ImageView::create_2D(m_device_ptr.get(), + { + auto create_info_ptr = Anvil::ImageCreateInfo::create_nonsparse_alloc(m_device_ptr.get(), + VK_IMAGE_TYPE_2D, + VK_FORMAT_D16_UNORM, + VK_IMAGE_TILING_OPTIMAL, + VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, + WINDOW_WIDTH, + WINDOW_HEIGHT, + 1, /* in_base_mipmap_depth */ + 1, /* in_n_layers */ + VK_SAMPLE_COUNT_1_BIT, + Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_EXCLUSIVE, + false, /* in_use_full_mipmap_chain */ + 0, /* in_memory_features */ + 0, /* in_create_flags */ + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + nullptr); /* in_mipmaps_ptr */ + + m_depth_images[n_depth_image] = Anvil::Image::create(std::move(create_info_ptr) ); + } + + { + auto create_info_ptr = Anvil::ImageViewCreateInfo::create_2D(m_device_ptr.get(), m_depth_images[n_depth_image].get(), 0, /* n_base_layer */ 0, /* n_base_mipmap_level */ 1, /* n_mipmaps */ VK_IMAGE_ASPECT_DEPTH_BIT, - m_depth_images[n_depth_image]->get_image_format(), + m_depth_images[n_depth_image]->get_create_info_ptr()->get_format(), VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY); + m_depth_image_views[n_depth_image] = Anvil::ImageView::create(std::move(create_info_ptr) ); + } + m_depth_images [n_depth_image]->set_name_formatted("Depth image [%d]", n_depth_image); m_depth_image_views[n_depth_image]->set_name_formatted("Depth image view [%d]", @@ -1046,13 +1080,26 @@ void App::init_semaphores() n_semaphore < m_n_swapchain_images; ++n_semaphore) { - auto new_signal_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); - auto new_wait_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); + Anvil::SemaphoreUniquePtr new_signal_semaphore_ptr; + Anvil::SemaphoreUniquePtr new_wait_semaphore_ptr; - new_signal_semaphore_ptr->set_name_formatted("Signal semaphore [%d]", - n_semaphore); - new_wait_semaphore_ptr->set_name_formatted ("Wait semaphore [%d]", - n_semaphore); + { + auto create_info_ptr = Anvil::SemaphoreCreateInfo::create(m_device_ptr.get() ); + + new_signal_semaphore_ptr = Anvil::Semaphore::create(std::move(create_info_ptr) ); + + new_signal_semaphore_ptr->set_name_formatted("Signal semaphore [%d]", + n_semaphore); + } + + { + auto create_info_ptr = Anvil::SemaphoreCreateInfo::create(m_device_ptr.get() ); + + new_wait_semaphore_ptr = Anvil::Semaphore::create(std::move(create_info_ptr) ); + + new_wait_semaphore_ptr->set_name_formatted("Wait semaphore [%d]", + n_semaphore); + } m_frame_signal_semaphores.push_back(std::move(new_signal_semaphore_ptr) ); m_frame_wait_semaphores.push_back (std::move(new_wait_semaphore_ptr) ); diff --git a/examples/MultiViewport/src/app.cpp b/examples/MultiViewport/src/app.cpp index 20b8abfe..888b5c3b 100644 --- a/examples/MultiViewport/src/app.cpp +++ b/examples/MultiViewport/src/app.cpp @@ -29,10 +29,14 @@ #include #include #include "config.h" +#include "misc/buffer_create_info.h" +#include "misc/framebuffer_create_info.h" #include "misc/glsl_to_spirv.h" -#include "misc/graphics_pipeline_info.h" +#include "misc/graphics_pipeline_create_info.h" #include "misc/object_tracker.h" -#include "misc/render_pass_info.h" +#include "misc/render_pass_create_info.h" +#include "misc/semaphore_create_info.h" +#include "misc/swapchain_create_info.h" #include "misc/time.h" #include "misc/window_factory.h" #include "wrappers/buffer.h" @@ -469,14 +473,16 @@ void App::init_buffers() auto mesh_data_ptr = get_mesh_data(); /* Initialize the buffer object */ - m_mesh_data_buffer_ptr = Anvil::Buffer::create_nonsparse( - m_device_ptr.get(), - get_mesh_data_size(), - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, - 0, /* in_memory_features */ - mesh_data_ptr.get() ); + auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr.get(), + get_mesh_data_size(), + Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_EXCLUSIVE, + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, + 0); /* in_memory_features */ + + create_info_ptr->set_client_data(mesh_data_ptr.get() ); + + m_mesh_data_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } void App::init_command_buffers() @@ -635,17 +641,21 @@ void App::init_framebuffers() n_swapchain_image < N_SWAPCHAIN_IMAGES; ++n_swapchain_image) { - m_fbos[n_swapchain_image] = Anvil::Framebuffer::create(m_device_ptr.get(), - WINDOW_WIDTH, - WINDOW_HEIGHT, - 1 /* n_layers */); + { + auto fb_create_info_ptr = Anvil::FramebufferCreateInfo::create(m_device_ptr.get(), + WINDOW_WIDTH, + WINDOW_HEIGHT, + 1 /* n_layers */); + + result = fb_create_info_ptr->add_attachment(m_swapchain_ptr->get_image_view(n_swapchain_image), + nullptr /* out_opt_attachment_id_ptrs */); + anvil_assert(result); + + m_fbos[n_swapchain_image] = Anvil::Framebuffer::create(std::move(fb_create_info_ptr) ); + } m_fbos[n_swapchain_image]->set_name_formatted("Framebuffer used to render to swapchain image [%d]", n_swapchain_image); - - result = m_fbos[n_swapchain_image]->add_attachment(m_swapchain_ptr->get_image_view(n_swapchain_image), - nullptr /* out_opt_attachment_id_ptrs */); - anvil_assert(result); } } @@ -658,103 +668,103 @@ void App::init_gfx_pipelines() const uint32_t n_mesh_vertex_components(get_mesh_vertex_data_n_components ()); /* Create a render pass for the pipeline */ - Anvil::GraphicsPipelineInfoUniquePtr gfx_pipeline_info_ptr; - Anvil::RenderPassAttachmentID render_pass_color_attachment_id; - Anvil::SubPassID render_pass_subpass_id; - VkRect2D scissors[4]; + Anvil::GraphicsPipelineCreateInfoUniquePtr gfx_pipeline_create_info_ptr; + Anvil::RenderPassAttachmentID render_pass_color_attachment_id; + Anvil::SubPassID render_pass_subpass_id; + VkRect2D scissors[4]; get_scissor_viewport_info(scissors, nullptr); /* viewports */ { - Anvil::RenderPassInfoUniquePtr render_pass_info_ptr(new Anvil::RenderPassInfo(m_device_ptr.get() ) ); - - render_pass_info_ptr->add_color_attachment (m_swapchain_ptr->get_image_format(), - VK_SAMPLE_COUNT_1_BIT, - VK_ATTACHMENT_LOAD_OP_CLEAR, - VK_ATTACHMENT_STORE_OP_STORE, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - false, /* may_alias */ - &render_pass_color_attachment_id); - render_pass_info_ptr->add_subpass (&render_pass_subpass_id); - render_pass_info_ptr->add_subpass_color_attachment(render_pass_subpass_id, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - render_pass_color_attachment_id, - 0, /* in_location */ - nullptr); /* in_opt_attachment_resolve_id_ptr */ - - m_renderpass_ptr = Anvil::RenderPass::create(std::move(render_pass_info_ptr), + Anvil::RenderPassCreateInfoUniquePtr render_pass_create_info_ptr(new Anvil::RenderPassCreateInfo(m_device_ptr.get() ) ); + + render_pass_create_info_ptr->add_color_attachment (m_swapchain_ptr->get_create_info_ptr()->get_format(), + VK_SAMPLE_COUNT_1_BIT, + VK_ATTACHMENT_LOAD_OP_CLEAR, + VK_ATTACHMENT_STORE_OP_STORE, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + false, /* may_alias */ + &render_pass_color_attachment_id); + render_pass_create_info_ptr->add_subpass (&render_pass_subpass_id); + render_pass_create_info_ptr->add_subpass_color_attachment(render_pass_subpass_id, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + render_pass_color_attachment_id, + 0, /* in_location */ + nullptr); /* in_opt_attachment_resolve_id_ptr */ + + m_renderpass_ptr = Anvil::RenderPass::create(std::move(render_pass_create_info_ptr), m_swapchain_ptr.get() ); } m_renderpass_ptr->set_name("Main renderpass"); /* Configure the graphics pipeline */ - gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - m_renderpass_ptr.get(), - render_pass_subpass_id, - *m_fs_ptr, - *m_gs_ptr, - Anvil::ShaderModuleStageEntryPoint(), - Anvil::ShaderModuleStageEntryPoint(), - *m_vs_ptr); - - gfx_pipeline_info_ptr->set_n_dynamic_viewports (sizeof(scissors) / sizeof(scissors[0]) ); - gfx_pipeline_info_ptr->set_primitive_topology (VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN); - gfx_pipeline_info_ptr->set_rasterization_properties(VK_POLYGON_MODE_FILL, - VK_CULL_MODE_NONE, - VK_FRONT_FACE_COUNTER_CLOCKWISE, - 1.0f /* line_width */); - gfx_pipeline_info_ptr->toggle_dynamic_states (true, /* should_enable */ - Anvil::DYNAMIC_STATE_VIEWPORT_BIT); - gfx_pipeline_info_ptr->toggle_primitive_restart (true /* should_enable */); - - gfx_pipeline_info_ptr->add_vertex_attribute(g_vertex_attribute_location, - mesh_vertex_data_format, - 0, /* offset_in_bytes */ - sizeof(float) * n_mesh_vertex_components, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX, - g_vertex_attribute_binding); - gfx_pipeline_info_ptr->add_vertex_attribute(g_color1_attribute_location, - mesh_color_data_format, - 0, /* offset_in_bytes */ - sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX, - g_color1_attribute_binding); - gfx_pipeline_info_ptr->add_vertex_attribute(g_color2_attribute_location, - mesh_color_data_format, - 0, /* offset_in_bytes */ - sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX, - g_color2_attribute_binding); - gfx_pipeline_info_ptr->add_vertex_attribute(g_color3_attribute_location, - mesh_color_data_format, - 0, /* offset_in_bytes */ - sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX, - g_color3_attribute_binding); - gfx_pipeline_info_ptr->add_vertex_attribute(g_color4_attribute_location, - mesh_color_data_format, - 0, /* offset_in_bytes */ - sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX, - g_color4_attribute_binding); + gfx_pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create_regular(false, /* in_disable_optimizations */ + false, /* in_allow_derivatives */ + m_renderpass_ptr.get(), + render_pass_subpass_id, + *m_fs_ptr, + *m_gs_ptr, + Anvil::ShaderModuleStageEntryPoint(), + Anvil::ShaderModuleStageEntryPoint(), + *m_vs_ptr); + + gfx_pipeline_create_info_ptr->set_n_dynamic_viewports (sizeof(scissors) / sizeof(scissors[0]) ); + gfx_pipeline_create_info_ptr->set_primitive_topology (VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN); + gfx_pipeline_create_info_ptr->set_rasterization_properties(VK_POLYGON_MODE_FILL, + VK_CULL_MODE_NONE, + VK_FRONT_FACE_COUNTER_CLOCKWISE, + 1.0f /* line_width */); + gfx_pipeline_create_info_ptr->toggle_dynamic_states (true, /* should_enable */ + Anvil::DYNAMIC_STATE_VIEWPORT_BIT); + gfx_pipeline_create_info_ptr->toggle_primitive_restart (true /* should_enable */); + + gfx_pipeline_create_info_ptr->add_vertex_attribute(g_vertex_attribute_location, + mesh_vertex_data_format, + 0, /* offset_in_bytes */ + sizeof(float) * n_mesh_vertex_components, /* stride_in_bytes */ + VK_VERTEX_INPUT_RATE_VERTEX, + g_vertex_attribute_binding); + gfx_pipeline_create_info_ptr->add_vertex_attribute(g_color1_attribute_location, + mesh_color_data_format, + 0, /* offset_in_bytes */ + sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ + VK_VERTEX_INPUT_RATE_VERTEX, + g_color1_attribute_binding); + gfx_pipeline_create_info_ptr->add_vertex_attribute(g_color2_attribute_location, + mesh_color_data_format, + 0, /* offset_in_bytes */ + sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ + VK_VERTEX_INPUT_RATE_VERTEX, + g_color2_attribute_binding); + gfx_pipeline_create_info_ptr->add_vertex_attribute(g_color3_attribute_location, + mesh_color_data_format, + 0, /* offset_in_bytes */ + sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ + VK_VERTEX_INPUT_RATE_VERTEX, + g_color3_attribute_binding); + gfx_pipeline_create_info_ptr->add_vertex_attribute(g_color4_attribute_location, + mesh_color_data_format, + 0, /* offset_in_bytes */ + sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ + VK_VERTEX_INPUT_RATE_VERTEX, + g_color4_attribute_binding); for (uint32_t n_scissor_box = 0; n_scissor_box < sizeof(scissors) / sizeof(scissors[0]); ++n_scissor_box) { - gfx_pipeline_info_ptr->set_scissor_box_properties(n_scissor_box, - scissors[n_scissor_box].offset.x, - scissors[n_scissor_box].offset.y, - scissors[n_scissor_box].extent.width, - scissors[n_scissor_box].extent.height); + gfx_pipeline_create_info_ptr->set_scissor_box_properties(n_scissor_box, + scissors[n_scissor_box].offset.x, + scissors[n_scissor_box].offset.y, + scissors[n_scissor_box].extent.width, + scissors[n_scissor_box].extent.height); } - gfx_pipeline_manager_ptr->add_pipeline(std::move(gfx_pipeline_info_ptr), + gfx_pipeline_manager_ptr->add_pipeline(std::move(gfx_pipeline_create_info_ptr), &m_pipeline_id); } @@ -764,8 +774,19 @@ void App::init_semaphores() n_semaphore < m_n_swapchain_images; ++n_semaphore) { - auto new_signal_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); - auto new_wait_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); + Anvil::SemaphoreUniquePtr new_signal_semaphore_ptr; + Anvil::SemaphoreUniquePtr new_wait_semaphore_ptr; + + { + auto create_info_ptr = Anvil::SemaphoreCreateInfo::create(m_device_ptr.get() ); + + new_signal_semaphore_ptr = Anvil::Semaphore::create(std::move(create_info_ptr) ); + } + { + auto create_info_ptr = Anvil::SemaphoreCreateInfo::create(m_device_ptr.get() ); + + new_wait_semaphore_ptr = Anvil::Semaphore::create(std::move(create_info_ptr) ); + } new_signal_semaphore_ptr->set_name_formatted("Signal semaphore [%d]", n_semaphore); diff --git a/examples/OcclusionQuery/src/app.cpp b/examples/OcclusionQuery/src/app.cpp index 9cff37a3..56fd072f 100644 --- a/examples/OcclusionQuery/src/app.cpp +++ b/examples/OcclusionQuery/src/app.cpp @@ -28,11 +28,18 @@ #include "config.h" #include +#include "misc/buffer_create_info.h" +#include "misc/event_create_info.h" +#include "misc/framebuffer_create_info.h" #include "misc/glsl_to_spirv.h" -#include "misc/graphics_pipeline_info.h" +#include "misc/graphics_pipeline_create_info.h" +#include "misc/image_create_info.h" +#include "misc/image_view_create_info.h" #include "misc/io.h" #include "misc/object_tracker.h" -#include "misc/render_pass_info.h" +#include "misc/render_pass_create_info.h" +#include "misc/semaphore_create_info.h" +#include "misc/swapchain_create_info.h" #include "misc/time.h" #include "misc/window_factory.h" #include "wrappers/buffer.h" @@ -342,28 +349,34 @@ void App::init_buffers() m_time_n_bytes_per_swapchain_image = static_cast(Anvil::Utils::round_up(sizeof(float), uniform_alignment_req) ); - m_query_bo_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), - m_n_bytes_per_query * N_SWAPCHAIN_IMAGES, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT, - 0, /* in_memory_features */ - nullptr); /* opt_client_data */ - - m_time_bo_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), - m_time_n_bytes_per_swapchain_image * N_SWAPCHAIN_IMAGES, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, - Anvil::MEMORY_FEATURE_FLAG_MAPPABLE, - nullptr); /* opt_client_data */ + { + auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr.get(), + m_n_bytes_per_query * N_SWAPCHAIN_IMAGES, + Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_EXCLUSIVE, + VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT, + 0); /* in_memory_features */ + + m_query_bo_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); + } + + { + auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr.get(), + m_time_n_bytes_per_swapchain_image * N_SWAPCHAIN_IMAGES, + Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_EXCLUSIVE, + VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, + Anvil::MEMORY_FEATURE_FLAG_MAPPABLE); + + m_time_bo_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); + } } void App::init_command_buffers() { VkClearValue clear_values[2]; auto gfx_pipeline_manager_ptr (m_device_ptr->get_graphics_pipeline_manager() ); - const bool is_ext_debug_marker_supported(m_device_ptr->is_ext_debug_marker_extension_enabled() ); + const bool is_ext_debug_marker_supported(m_device_ptr->get_extension_info()->ext_debug_marker() ); VkRect2D render_area; auto tri_1stpass_ds0_ptr (m_1stpass_dsg_ptr->get_descriptor_set (0) ); auto quad_2ndpass_ds0_ptr (m_2ndpass_quad_dsg_ptr->get_descriptor_set(0) ); @@ -571,36 +584,36 @@ void App::init_command_buffers() void App::init_dsgs() { - std::vector dsg_1stpass_info_ptrs (1); - std::vector quad_dsg_2ndpass_info_ptrs(1); - std::vector tri_dsg_2ndpass_info_ptrs (1); - - dsg_1stpass_info_ptrs [0] = Anvil::DescriptorSetInfo::create(); - quad_dsg_2ndpass_info_ptrs[0] = Anvil::DescriptorSetInfo::create(); - tri_dsg_2ndpass_info_ptrs [0] = Anvil::DescriptorSetInfo::create(); - - - dsg_1stpass_info_ptrs[0]->add_binding (0, /* binding */ - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, - 1, /* n_elements */ - VK_SHADER_STAGE_VERTEX_BIT); - tri_dsg_2ndpass_info_ptrs[0]->add_binding (0, /* binding */ - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, - 1, /* n_elements */ - VK_SHADER_STAGE_VERTEX_BIT); - quad_dsg_2ndpass_info_ptrs[0]->add_binding(0, /* binding */ - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, - 1, /* n_elements */ - VK_SHADER_STAGE_VERTEX_BIT); + std::vector dsg_1stpass_create_info_ptrs (1); + std::vector quad_dsg_2ndpass_create_info_ptrs(1); + std::vector tri_dsg_2ndpass_create_info_ptrs (1); + + dsg_1stpass_create_info_ptrs [0] = Anvil::DescriptorSetCreateInfo::create(); + quad_dsg_2ndpass_create_info_ptrs[0] = Anvil::DescriptorSetCreateInfo::create(); + tri_dsg_2ndpass_create_info_ptrs [0] = Anvil::DescriptorSetCreateInfo::create(); + + + dsg_1stpass_create_info_ptrs[0]->add_binding (0, /* binding */ + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, + 1, /* n_elements */ + VK_SHADER_STAGE_VERTEX_BIT); + tri_dsg_2ndpass_create_info_ptrs[0]->add_binding (0, /* binding */ + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, + 1, /* n_elements */ + VK_SHADER_STAGE_VERTEX_BIT); + quad_dsg_2ndpass_create_info_ptrs[0]->add_binding(0, /* binding */ + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, + 1, /* n_elements */ + VK_SHADER_STAGE_VERTEX_BIT); m_1stpass_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), - dsg_1stpass_info_ptrs, + dsg_1stpass_create_info_ptrs, false); /* in_releaseable_sets */ m_2ndpass_tri_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), - tri_dsg_2ndpass_info_ptrs, + tri_dsg_2ndpass_create_info_ptrs, false); /* in_releaseable_sets */ m_2ndpass_quad_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), - quad_dsg_2ndpass_info_ptrs, + quad_dsg_2ndpass_create_info_ptrs, false); /* in_releaseable_sets */ m_1stpass_dsg_ptr->set_binding_item (0, /* n_set */ @@ -622,8 +635,9 @@ void App::init_dsgs() void App::init_events() { - m_query_data_copied_event = Anvil::Event::create(m_device_ptr.get() ); + auto create_info_ptr = Anvil::EventCreateInfo::create(m_device_ptr.get() ); + m_query_data_copied_event = Anvil::Event::create(std::move(create_info_ptr) ); m_query_data_copied_event->set_name("Query data copied event"); } @@ -633,52 +647,65 @@ void App::init_framebuffers() n_swapchain_image < N_SWAPCHAIN_IMAGES; ++n_swapchain_image) { - m_fbos[n_swapchain_image] = Anvil::Framebuffer::create(m_device_ptr.get(), - WINDOW_WIDTH, - WINDOW_HEIGHT, - 1); /* n_layers */ + { + auto create_info_ptr = Anvil::FramebufferCreateInfo::create(m_device_ptr.get(), + WINDOW_WIDTH, + WINDOW_HEIGHT, + 1); /* n_layers */ + + create_info_ptr->add_attachment(m_swapchain_ptr->get_image_view(n_swapchain_image), + nullptr); /* out_opt_attachment_id_ptr */ + create_info_ptr->add_attachment(m_depth_image_view_ptr.get(), + nullptr); /* out_opt_attachment_id_ptr */ + + m_fbos[n_swapchain_image] = Anvil::Framebuffer::create(std::move(create_info_ptr) ); + } m_fbos[n_swapchain_image]->set_name_formatted("Framebuffer for swapchain image [%d]", n_swapchain_image); - m_fbos[n_swapchain_image]->add_attachment(m_swapchain_ptr->get_image_view(n_swapchain_image), - nullptr); /* out_opt_attachment_id_ptr */ - m_fbos[n_swapchain_image]->add_attachment(m_depth_image_view_ptr.get(), - nullptr); /* out_opt_attachment_id_ptr */ } } void App::init_images() { - m_depth_image_ptr = Anvil::Image::create_nonsparse(m_device_ptr.get(), - VK_IMAGE_TYPE_2D, - VK_FORMAT_D16_UNORM, - VK_IMAGE_TILING_OPTIMAL, - VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, - WINDOW_WIDTH, - WINDOW_HEIGHT, - 1, /* base_mipmap_depth */ - 1, /* n_layers */ - VK_SAMPLE_COUNT_1_BIT, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - false, /* use_full_mipmap_chain */ - 0, /* in_memory_features */ - false, /* is_mutable */ - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, - nullptr); - - m_depth_image_view_ptr = Anvil::ImageView::create_2D(m_device_ptr.get(), - m_depth_image_ptr.get(), - 0, /* n_base_layer */ - 0, /* n_base_mipmap_level */ - 1, /* n_mipmaps */ - VK_IMAGE_ASPECT_DEPTH_BIT, - m_depth_image_ptr->get_image_format(), - VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY); + { + auto create_info_ptr = Anvil::ImageCreateInfo::create_nonsparse_alloc(m_device_ptr.get(), + VK_IMAGE_TYPE_2D, + VK_FORMAT_D16_UNORM, + VK_IMAGE_TILING_OPTIMAL, + VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, + WINDOW_WIDTH, + WINDOW_HEIGHT, + 1, /* base_mipmap_depth */ + 1, /* n_layers */ + VK_SAMPLE_COUNT_1_BIT, + Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_EXCLUSIVE, + false, /* use_full_mipmap_chain */ + 0, /* in_memory_features */ + false, /* is_mutable */ + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + nullptr); + + m_depth_image_ptr = Anvil::Image::create(std::move(create_info_ptr) ); + } + + { + auto create_info_ptr = Anvil::ImageViewCreateInfo::create_2D(m_device_ptr.get(), + m_depth_image_ptr.get(), + 0, /* n_base_layer */ + 0, /* n_base_mipmap_level */ + 1, /* n_mipmaps */ + VK_IMAGE_ASPECT_DEPTH_BIT, + m_depth_image_ptr->get_create_info_ptr()->get_format(), + VK_COMPONENT_SWIZZLE_IDENTITY, + VK_COMPONENT_SWIZZLE_IDENTITY, + VK_COMPONENT_SWIZZLE_IDENTITY, + VK_COMPONENT_SWIZZLE_IDENTITY); + + m_depth_image_view_ptr = Anvil::ImageView::create(std::move(create_info_ptr) ); + } } void App::init_query_pool() @@ -703,11 +730,11 @@ void App::init_renderpasses() Anvil::RenderPassUniquePtr renderpass_ptr; { - Anvil::RenderPassInfoUniquePtr renderpass_info_ptr( - new Anvil::RenderPassInfo(m_device_ptr.get() ) + Anvil::RenderPassCreateInfoUniquePtr renderpass_info_ptr( + new Anvil::RenderPassCreateInfo(m_device_ptr.get() ) ); - renderpass_info_ptr->add_color_attachment(m_swapchain_ptr->get_image_format(), + renderpass_info_ptr->add_color_attachment(m_swapchain_ptr->get_create_info_ptr()->get_format(), VK_SAMPLE_COUNT_1_BIT, (!is_2nd_renderpass) ? VK_ATTACHMENT_LOAD_OP_CLEAR : VK_ATTACHMENT_LOAD_OP_LOAD, @@ -721,7 +748,7 @@ void App::init_renderpasses() false, /* may_alias */ &color_attachment_id); - renderpass_info_ptr->add_depth_stencil_attachment(m_depth_image_ptr->get_image_format(), + renderpass_info_ptr->add_depth_stencil_attachment(m_depth_image_ptr->get_create_info_ptr()->get_format(), VK_SAMPLE_COUNT_1_BIT, (!is_2nd_renderpass) ? VK_ATTACHMENT_LOAD_OP_CLEAR : VK_ATTACHMENT_LOAD_OP_LOAD, @@ -777,11 +804,11 @@ void App::init_renderpasses() nullptr); /* opt_attachment_resolve_ptr */ renderpass_info_ptr->add_subpass_depth_stencil_attachment(m_renderpass_1stpass_depth_test_always_subpass_id, - ds_attachment_id, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + ds_attachment_id); renderpass_info_ptr->add_subpass_depth_stencil_attachment(m_renderpass_1stpass_depth_test_equal_ot_subpass_id, - ds_attachment_id, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + ds_attachment_id); /* depth_test_equal_ot subpass must not start before depth_test_always subpass finishes rasterizing */ @@ -803,75 +830,75 @@ void App::init_renderpasses() if (is_2nd_renderpass) { - auto depth_test_off_tri_subpass_gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - renderpass_ptr.get(), - m_renderpass_2ndpass_depth_test_off_tri_subpass_id, - *m_tri_fs_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* in_geometry_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* in_tess_control_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* in_tess_evaluation_shader_entrypoint */ - *m_tri_vs_ptr); - auto depth_test_off_quad_subpass_gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - renderpass_ptr.get(), - m_renderpass_2ndpass_depth_test_off_quad_subpass_id, - *m_quad_fs_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader_entrypoint */ - *m_quad_vs_ptr); - - - - depth_test_off_tri_subpass_gfx_pipeline_info_ptr->set_descriptor_set_info (m_2ndpass_tri_dsg_ptr->get_descriptor_set_info() ); - depth_test_off_quad_subpass_gfx_pipeline_info_ptr->set_descriptor_set_info(m_2ndpass_quad_dsg_ptr->get_descriptor_set_info() ); - - depth_test_off_quad_subpass_gfx_pipeline_info_ptr->set_primitive_topology(VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP); - - - gfx_pipeline_manager_ptr->add_pipeline(std::move(depth_test_off_quad_subpass_gfx_pipeline_info_ptr), + auto depth_test_off_tri_subpass_gfx_pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create_regular(false, /* in_disable_optimizations */ + false, /* in_allow_derivatives */ + renderpass_ptr.get(), + m_renderpass_2ndpass_depth_test_off_tri_subpass_id, + *m_tri_fs_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* in_geometry_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* in_tess_control_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* in_tess_evaluation_shader_entrypoint */ + *m_tri_vs_ptr); + auto depth_test_off_quad_subpass_gfx_pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create_regular(false, /* in_disable_optimizations */ + false, /* in_allow_derivatives */ + renderpass_ptr.get(), + m_renderpass_2ndpass_depth_test_off_quad_subpass_id, + *m_quad_fs_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader_entrypoint */ + *m_quad_vs_ptr); + + + + depth_test_off_tri_subpass_gfx_pipeline_create_info_ptr->set_descriptor_set_create_info (m_2ndpass_tri_dsg_ptr->get_descriptor_set_create_info () ); + depth_test_off_quad_subpass_gfx_pipeline_create_info_ptr->set_descriptor_set_create_info(m_2ndpass_quad_dsg_ptr->get_descriptor_set_create_info() ); + + depth_test_off_quad_subpass_gfx_pipeline_create_info_ptr->set_primitive_topology(VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP); + + + gfx_pipeline_manager_ptr->add_pipeline(std::move(depth_test_off_quad_subpass_gfx_pipeline_create_info_ptr), &m_2ndpass_depth_test_off_quad_pipeline_id); - gfx_pipeline_manager_ptr->add_pipeline(std::move(depth_test_off_tri_subpass_gfx_pipeline_info_ptr), + gfx_pipeline_manager_ptr->add_pipeline(std::move(depth_test_off_tri_subpass_gfx_pipeline_create_info_ptr), &m_2ndpass_depth_test_off_tri_pipeline_id); m_renderpass_quad_ptr = std::move(renderpass_ptr); } else { - auto depth_test_always_subpass_gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - renderpass_ptr.get(), - m_renderpass_1stpass_depth_test_always_subpass_id, - *m_tri_fs_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader_entrypoint */ - *m_tri_vs_ptr); - auto depth_test_equal_ot_subpass_gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - renderpass_ptr.get(), - m_renderpass_1stpass_depth_test_equal_ot_subpass_id, - *m_tri_fs_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader_entrypoint */ - *m_tri_vs_ptr); - - depth_test_always_subpass_gfx_pipeline_info_ptr->set_descriptor_set_info(m_1stpass_dsg_ptr->get_descriptor_set_info() ); - depth_test_always_subpass_gfx_pipeline_info_ptr->toggle_depth_test (true, /* in_should_enable */ - VK_COMPARE_OP_ALWAYS); - depth_test_always_subpass_gfx_pipeline_info_ptr->toggle_depth_writes (true); /* in_should_enable */ - - depth_test_equal_ot_subpass_gfx_pipeline_info_ptr->set_descriptor_set_info(m_1stpass_dsg_ptr->get_descriptor_set_info() ); - depth_test_equal_ot_subpass_gfx_pipeline_info_ptr->toggle_depth_test (true, /* in_should_enable */ - VK_COMPARE_OP_EQUAL); - depth_test_equal_ot_subpass_gfx_pipeline_info_ptr->toggle_depth_writes (true); /* in_should_enable */ - - - gfx_pipeline_manager_ptr->add_pipeline(std::move(depth_test_always_subpass_gfx_pipeline_info_ptr), + auto depth_test_always_subpass_gfx_pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create_regular(false, /* in_disable_optimizations */ + false, /* in_allow_derivatives */ + renderpass_ptr.get(), + m_renderpass_1stpass_depth_test_always_subpass_id, + *m_tri_fs_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader_entrypoint */ + *m_tri_vs_ptr); + auto depth_test_equal_ot_subpass_gfx_pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create_regular(false, /* in_disable_optimizations */ + false, /* in_allow_derivatives */ + renderpass_ptr.get(), + m_renderpass_1stpass_depth_test_equal_ot_subpass_id, + *m_tri_fs_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader_entrypoint */ + *m_tri_vs_ptr); + + depth_test_always_subpass_gfx_pipeline_create_info_ptr->set_descriptor_set_create_info(m_1stpass_dsg_ptr->get_descriptor_set_create_info() ); + depth_test_always_subpass_gfx_pipeline_create_info_ptr->toggle_depth_test (true, /* in_should_enable */ + VK_COMPARE_OP_ALWAYS); + depth_test_always_subpass_gfx_pipeline_create_info_ptr->toggle_depth_writes (true); /* in_should_enable */ + + depth_test_equal_ot_subpass_gfx_pipeline_create_info_ptr->set_descriptor_set_create_info(m_1stpass_dsg_ptr->get_descriptor_set_create_info() ); + depth_test_equal_ot_subpass_gfx_pipeline_create_info_ptr->toggle_depth_test (true, /* in_should_enable */ + VK_COMPARE_OP_EQUAL); + depth_test_equal_ot_subpass_gfx_pipeline_create_info_ptr->toggle_depth_writes (true); /* in_should_enable */ + + + gfx_pipeline_manager_ptr->add_pipeline(std::move(depth_test_always_subpass_gfx_pipeline_create_info_ptr), &m_1stpass_depth_test_always_pipeline_id); - gfx_pipeline_manager_ptr->add_pipeline(std::move(depth_test_equal_ot_subpass_gfx_pipeline_info_ptr), + gfx_pipeline_manager_ptr->add_pipeline(std::move(depth_test_equal_ot_subpass_gfx_pipeline_create_info_ptr), &m_1stpass_depth_test_equal_pipeline_id); m_renderpass_tris_ptr = std::move(renderpass_ptr); @@ -885,13 +912,25 @@ void App::init_semaphores() n_semaphore < m_n_swapchain_images; ++n_semaphore) { - auto new_signal_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); - auto new_wait_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); + Anvil::SemaphoreUniquePtr new_signal_semaphore_ptr; + Anvil::SemaphoreUniquePtr new_wait_semaphore_ptr; + + { + auto create_info_ptr = Anvil::SemaphoreCreateInfo::create(m_device_ptr.get() ); + + new_signal_semaphore_ptr = Anvil::Semaphore::create(std::move(create_info_ptr) ); + } + + { + auto create_info_ptr = Anvil::SemaphoreCreateInfo::create(m_device_ptr.get() ); + + new_wait_semaphore_ptr = Anvil::Semaphore::create(std::move(create_info_ptr) ); + } new_signal_semaphore_ptr->set_name_formatted("Frame signal semaphore [%d]", n_semaphore); - new_wait_semaphore_ptr->set_name_formatted ("Frame wait semaphore [%d]", - n_semaphore); + new_wait_semaphore_ptr->set_name_formatted("Frame wait semaphore [%d]", + n_semaphore); m_frame_signal_semaphores.push_back(std::move(new_signal_semaphore_ptr) ); m_frame_wait_semaphores.push_back (std::move(new_wait_semaphore_ptr) ); diff --git a/examples/OutOfOrderRasterization/include/app.h b/examples/OutOfOrderRasterization/include/app.h index 9c86a88d..0397d7ef 100644 --- a/examples/OutOfOrderRasterization/include/app.h +++ b/examples/OutOfOrderRasterization/include/app.h @@ -95,7 +95,6 @@ class App std::unique_ptr m_teapot_props_data_ptr; Anvil::Time m_time; - std::vector m_frame_acquisition_wait_semaphores; std::vector m_frame_signal_semaphores; std::vector m_frame_wait_semaphores; diff --git a/examples/OutOfOrderRasterization/src/app.cpp b/examples/OutOfOrderRasterization/src/app.cpp index 9fd974b4..44be3923 100644 --- a/examples/OutOfOrderRasterization/src/app.cpp +++ b/examples/OutOfOrderRasterization/src/app.cpp @@ -29,12 +29,18 @@ #include #include "config.h" +#include "misc/buffer_create_info.h" +#include "misc/framebuffer_create_info.h" #include "misc/glsl_to_spirv.h" -#include "misc/graphics_pipeline_info.h" +#include "misc/graphics_pipeline_create_info.h" +#include "misc/image_create_info.h" +#include "misc/image_view_create_info.h" #include "misc/io.h" #include "misc/memory_allocator.h" #include "misc/object_tracker.h" -#include "misc/render_pass_info.h" +#include "misc/render_pass_create_info.h" +#include "misc/semaphore_create_info.h" +#include "misc/swapchain_create_info.h" #include "misc/time.h" #include "misc/window_factory.h" #include "wrappers/buffer.h" @@ -59,6 +65,17 @@ #include "teapot_data.h" #include "app.h" +#if defined(_WIN32) + #if !defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) && !defined(ENABLE_OFFSCREEN_RENDERING) + #error Anvil has not been built with Win32/64 window system support. The application can only be built in offscreen rendering mode. + #endif +#else + #if !defined(ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT) && !defined(ENABLE_OFFSCREEN_RENDERING) + #error Anvil has not been built with XCB window system support. The application can only be built in offscreen rendering mode. + #endif +#endif + + /* Low-level #defines follow.. */ /* When offscreen rendering is enabled, N_FRAMES_TO_RENDER tells how many frames should be @@ -153,15 +170,15 @@ static const char* vs_body = App::App() - :m_general_pipeline_id (-1), - m_n_frames_drawn ( 0), - m_n_indices ( 0), - m_n_last_semaphore_used (-1), - m_n_swapchain_images (N_SWAPCHAIN_IMAGES), - m_ooo_disabled_pipeline_id(-1), - m_ooo_enabled (false), - m_ooo_enabled_pipeline_id (-1), - m_should_rotate (true) + :m_general_pipeline_id (-1), + m_n_frames_drawn ( 0), + m_n_indices ( 0), + m_n_last_semaphore_used (-1), + m_n_swapchain_images (N_SWAPCHAIN_IMAGES), + m_ooo_disabled_pipeline_id (-1), + m_ooo_enabled (false), + m_ooo_enabled_pipeline_id (-1), + m_should_rotate (true) { memset(m_frame_drawn_status, 0, @@ -247,23 +264,46 @@ void App::deinit() void App::draw_frame() { - const Anvil::DeviceType device_type = m_device_ptr->get_type(); - static const VkPipelineStageFlags dst_stage_mask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; - Anvil::Semaphore* frame_ready_for_present_semaphore_ptr = nullptr; - uint32_t n_swapchain_image; - Anvil::PrimaryCommandBuffer* render_cmdbuffer_ptr = nullptr; - const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; + const Anvil::DeviceType device_type = m_device_ptr->get_type(); + static const VkPipelineStageFlags dst_stage_mask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; + Anvil::Semaphore* frame_ready_for_present_semaphore_ptr = nullptr; + Anvil::Semaphore* frame_ready_to_render_semaphore_ptr = nullptr; + uint32_t n_swapchain_image; + const Anvil::PhysicalDevice* physical_device_ptr = nullptr; + Anvil::PrimaryCommandBuffer* render_cmdbuffer_ptr = nullptr; + const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; + + switch (device_type) + { + case Anvil::DEVICE_TYPE_SINGLE_GPU: + { + const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr.get() ) ); + + physical_device_ptr = sgpu_device_ptr->get_physical_device(); + break; + } + + default: + { + anvil_assert(false); + } + } /* Determine the signal + wait semaphores to use for drawing this frame */ m_n_last_semaphore_used = (m_n_last_semaphore_used + 1) % m_n_swapchain_images; - auto curr_frame_signal_semaphore_ptr = m_frame_signal_semaphores.at(m_n_last_semaphore_used).get(); - auto curr_frame_wait_semaphore_ptr = m_frame_wait_semaphores.at (m_n_last_semaphore_used).get(); + auto& curr_frame_signal_semaphore_ptr = m_frame_signal_semaphores.at(m_n_last_semaphore_used); + auto& curr_frame_wait_semaphore_ptr = m_frame_wait_semaphores.at (m_n_last_semaphore_used); + auto& curr_frame_acqusition_wait_semaphore_ptr = curr_frame_wait_semaphore_ptr; /* Determine the semaphore which the swapchain image */ - n_swapchain_image = m_swapchain_ptr->acquire_image(curr_frame_wait_semaphore_ptr, + n_swapchain_image = m_swapchain_ptr->acquire_image(curr_frame_acqusition_wait_semaphore_ptr.get(), true); /* in_should_block */ + /* Set up semaphores we're going to use to render this frame. */ + frame_ready_for_present_semaphore_ptr = curr_frame_signal_semaphore_ptr.get(); + frame_ready_to_render_semaphore_ptr = curr_frame_wait_semaphore_ptr.get(); + /* if the frame has already been rendered to in the past, then given the fact we use FIFO presentation mode, * we should be safe to extract the timestamps which must have been written by now. */ @@ -274,11 +314,6 @@ void App::draw_frame() /* TODO: Do better than this. */ vkDeviceWaitIdle(m_device_ptr->get_device_vk() ); - const uint32_t n_iterations = 1; - - for (uint32_t n_iteration = 0; - n_iteration < n_iterations; - ++n_iteration) { m_query_results_buffer_ptr->read(n_swapchain_image * sizeof(uint64_t) * 2, /* top of pipe, bottom of pipe */ sizeof(timestamps), @@ -308,19 +343,23 @@ void App::draw_frame() render_cmdbuffer_ptr = m_render_cmdbuffers_ooo_off.at(n_swapchain_image).get(); } - m_present_queue_ptr->submit_command_buffer_with_signal_wait_semaphores(render_cmdbuffer_ptr, - 1, /* n_semaphores_to_signal */ - &curr_frame_signal_semaphore_ptr, - 1, /* n_semaphores_to_wait_on */ - &curr_frame_wait_semaphore_ptr, - &wait_stage_mask, - false /* should_block */); - - m_present_queue_ptr->present(m_swapchain_ptr.get(), - n_swapchain_image, - 1, /* n_wait_semaphores */ - &curr_frame_signal_semaphore_ptr); - + { + m_present_queue_ptr->submit_command_buffer_with_signal_wait_semaphores(render_cmdbuffer_ptr, + 1, /* n_semaphores_to_signal */ + &frame_ready_for_present_semaphore_ptr, + 1, /* n_semaphores_to_wait_on */ + &frame_ready_to_render_semaphore_ptr, + &wait_stage_mask, + false /* should_block */); + } + + { + m_present_queue_ptr->present(m_swapchain_ptr.get(), + n_swapchain_image, + 1, /* n_wait_semaphores */ + &frame_ready_for_present_semaphore_ptr); + } + ++m_n_frames_drawn; m_frame_drawn_status[n_swapchain_image] = true; @@ -361,39 +400,52 @@ void App::init_buffers() const VkDeviceSize index_data_size = data.get_index_data_size(); const VkDeviceSize properties_data_size = N_TEAPOTS * sizeof(float) * 8; /* rot_xyzX + pos_xyzX */ + const Anvil::MemoryFeatureFlags required_feature_flags = 0; const VkDeviceSize vertex_data_size = data.get_vertex_data_size(); allocator_ptr = Anvil::MemoryAllocator::create_oneshot(m_device_ptr.get() ); - m_index_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), - index_data_size, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_INDEX_BUFFER_BIT); + { + auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), + index_data_size, + Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_EXCLUSIVE, + VK_BUFFER_USAGE_INDEX_BUFFER_BIT); - m_query_results_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), - sizeof(uint64_t) * m_n_swapchain_images * 2, /* top of pipe, bottom of pipe */ - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT); + m_index_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); + } + + { + auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), + sizeof(uint64_t) * m_n_swapchain_images * 2, /* top of pipe, bottom of pipe */ + Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_EXCLUSIVE, + VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT); - m_vertex_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), - vertex_data_size, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_VERTEX_BUFFER_BIT); + m_query_results_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); + } + + { + auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), + vertex_data_size, + Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_EXCLUSIVE, + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT); + + m_vertex_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); + } m_index_buffer_ptr->set_name ("Teapot index buffer"); m_query_results_buffer_ptr->set_name("Query results buffer"); m_vertex_buffer_ptr->set_name ("Teapot vertex buffer"); allocator_ptr->add_buffer(m_query_results_buffer_ptr.get(), - 0); /* in_required_memory_features */ + /* Anvil::MEMORY_FEATURE_FLAG_MAPPABLE | */ required_feature_flags); allocator_ptr->add_buffer(m_index_buffer_ptr.get(), - 0); /* in_required_memory_features */ + required_feature_flags); allocator_ptr->add_buffer(m_vertex_buffer_ptr.get(), - 0); /* in_required_memory_features */ + required_feature_flags); for (uint32_t n_swapchain_image = 0; n_swapchain_image < m_n_swapchain_images; @@ -401,16 +453,20 @@ void App::init_buffers() { Anvil::BufferUniquePtr new_buffer_ptr; - new_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), - properties_data_size, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_STORAGE_BUFFER_BIT); + { + auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), + properties_data_size, + Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_EXCLUSIVE, + VK_BUFFER_USAGE_STORAGE_BUFFER_BIT); + + new_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); + } new_buffer_ptr->set_name("Properties buffer"); allocator_ptr->add_buffer(new_buffer_ptr.get(), - 0); /* in_required_memory_features */ + required_feature_flags); /* in_required_memory_features */ m_properties_buffer_ptrs.push_back( std::move(new_buffer_ptr) @@ -432,7 +488,7 @@ void App::init_command_buffers() VkClearValue clear_values[2]; const Anvil::DeviceType device_type = m_device_ptr->get_type(); auto gfx_manager_ptr = m_device_ptr->get_graphics_pipeline_manager(); - const uint32_t n_swapchain_images = m_swapchain_ptr->get_n_images(); + const uint32_t n_swapchain_images = m_swapchain_ptr->get_create_info_ptr()->get_n_images(); const uint32_t universal_queue_family_index = m_device_ptr->get_universal_queue(0)->get_queue_family_index(); Anvil::Buffer* vertex_buffers[] = { @@ -452,6 +508,7 @@ void App::init_command_buffers() anvil_assert (m_render_cmdbuffers_ooo_on.size() == 0); anvil_assert (m_renderpasses.size() == n_swapchain_images); + const uint32_t n_physical_device_iterations(1); VkRect2D render_area; render_area.extent.height = m_window_ptr->get_height_at_creation_time(); @@ -465,6 +522,9 @@ void App::init_command_buffers() clear_values[0].color.float32[3] = 1.0f; clear_values[1].depthStencil.depth = 1.0f; + for (uint32_t n_physical_device_iteration = 0; + n_physical_device_iteration < n_physical_device_iterations; + ++n_physical_device_iteration) { for (uint32_t n_ooo_iteration = 0; n_ooo_iteration < 2; /* off, on */ @@ -527,14 +587,18 @@ void App::init_command_buffers() m_query_pool_ptr.get(), n_render_cmdbuffer * 2 /* top of pipe, bottom of pipe*/ + 0); - cmdbuffer_ptr->record_begin_render_pass(sizeof(clear_values) / sizeof(clear_values[0]), - clear_values, - framebuffer_ptr, - render_area, - renderpass_ptr, - VK_SUBPASS_CONTENTS_INLINE); + { + cmdbuffer_ptr->record_begin_render_pass(sizeof(clear_values) / sizeof(clear_values[0]), + clear_values, + framebuffer_ptr, + render_area, + renderpass_ptr, + VK_SUBPASS_CONTENTS_INLINE); + } { + const uint32_t n_physical_devices(1); + cmdbuffer_ptr->record_bind_pipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline_id); @@ -554,12 +618,17 @@ void App::init_command_buffers() vertex_buffers, vertex_buffer_offsets); - /* Draw the teapots! */ - cmdbuffer_ptr->record_draw_indexed(m_n_indices, - N_TEAPOTS, /* in_instance_count */ - 0, /* in_first_index */ - 0, /* in_vertex_offset */ - 0); /* in_first_instance */ + for (uint32_t n_physical_device = 0; + n_physical_device < n_physical_devices; + ++n_physical_device) + { + /* Draw the teapots! */ + cmdbuffer_ptr->record_draw_indexed(m_n_indices, + N_TEAPOTS, /* in_instance_count */ + 0, /* in_first_index */ + 0, /* in_vertex_offset */ + 0); /* in_first_instance */ + } } cmdbuffer_ptr->record_end_render_pass(); @@ -603,17 +672,17 @@ void App::init_dsgs() Anvil::DescriptorSetGroupUniquePtr new_dsg_ptr; { - std::vector new_dsg_info_ptr(1); + std::vector new_dsg_create_info_ptr(1); - new_dsg_info_ptr[0] = Anvil::DescriptorSetInfo::create(); + new_dsg_create_info_ptr[0] = Anvil::DescriptorSetCreateInfo::create(); - new_dsg_info_ptr[0]->add_binding(0, /* in_binding */ - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, - 1, /* in_n_elements */ - VK_SHADER_STAGE_VERTEX_BIT); + new_dsg_create_info_ptr[0]->add_binding(0, /* in_binding */ + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, + 1, /* in_n_elements */ + VK_SHADER_STAGE_VERTEX_BIT); new_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), - new_dsg_info_ptr, + new_dsg_create_info_ptr, false); /* in_releaseable_sets */ } @@ -645,46 +714,46 @@ void App::init_gfx_pipelines() : &m_ooo_enabled_pipeline_id; { - auto pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - m_renderpasses[0].get(), - 0, /* in_subpass_id */ - *m_fs_entrypoint_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* in_gs_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* in_tc_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* in_te_entrypoint */ - *m_vs_entrypoint_ptr); - - pipeline_info_ptr->add_vertex_attribute(0, /* location */ - VK_FORMAT_R32G32B32_SFLOAT, - 0, /* offset_in_bytes */ - sizeof(float) * 3, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX); - - pipeline_info_ptr->set_descriptor_set_info(m_dsg_ptrs[0]->get_descriptor_set_info() ); - - pipeline_info_ptr->set_primitive_topology (VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST); - pipeline_info_ptr->set_rasterization_properties(VK_POLYGON_MODE_FILL, - VK_CULL_MODE_BACK_BIT, - VK_FRONT_FACE_CLOCKWISE, - 4.0f); /* line_width */ - pipeline_info_ptr->toggle_depth_test (true, /* should_enable */ - VK_COMPARE_OP_LESS); - pipeline_info_ptr->toggle_depth_writes (true); + auto pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create_regular(false, /* in_disable_optimizations */ + false, /* in_allow_derivatives */ + m_renderpasses[0].get(), + 0, /* in_subpass_id */ + *m_fs_entrypoint_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* in_gs_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* in_tc_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* in_te_entrypoint */ + *m_vs_entrypoint_ptr); + + pipeline_create_info_ptr->add_vertex_attribute(0, /* location */ + VK_FORMAT_R32G32B32_SFLOAT, + 0, /* offset_in_bytes */ + sizeof(float) * 3, /* stride_in_bytes */ + VK_VERTEX_INPUT_RATE_VERTEX); + + pipeline_create_info_ptr->set_descriptor_set_create_info(m_dsg_ptrs[0]->get_descriptor_set_create_info() ); + + pipeline_create_info_ptr->set_primitive_topology (VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST); + pipeline_create_info_ptr->set_rasterization_properties(VK_POLYGON_MODE_FILL, + VK_CULL_MODE_BACK_BIT, + VK_FRONT_FACE_CLOCKWISE, + 4.0f); /* line_width */ + pipeline_create_info_ptr->toggle_depth_test (true, /* should_enable */ + VK_COMPARE_OP_LESS); + pipeline_create_info_ptr->toggle_depth_writes (true); if (!is_ooo_disabled) { if (m_device_ptr->is_extension_enabled("VK_AMD_rasterization_order") ) { - pipeline_info_ptr->set_rasterization_order(VK_RASTERIZATION_ORDER_RELAXED_AMD); + pipeline_create_info_ptr->set_rasterization_order(VK_RASTERIZATION_ORDER_RELAXED_AMD); } } else { - pipeline_info_ptr->set_rasterization_order(VK_RASTERIZATION_ORDER_STRICT_AMD); + pipeline_create_info_ptr->set_rasterization_order(VK_RASTERIZATION_ORDER_STRICT_AMD); } - gfx_manager_ptr->add_pipeline(std::move(pipeline_info_ptr), + gfx_manager_ptr->add_pipeline(std::move(pipeline_create_info_ptr), pipeline_id_ptr); } } @@ -692,35 +761,43 @@ void App::init_gfx_pipelines() void App::init_images() { - m_depth_image_ptr = Anvil::Image::create_nonsparse(m_device_ptr.get(), - VK_IMAGE_TYPE_2D, - VK_FORMAT_D32_SFLOAT, - VK_IMAGE_TILING_OPTIMAL, - VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, - m_window_ptr->get_width_at_creation_time (), - m_window_ptr->get_height_at_creation_time(), - 1, /* base_mipmap_depth */ - 1, /* n_layers */ - VK_SAMPLE_COUNT_1_BIT, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - false, /* in_use_full_mipmap_chain */ - 0, /* in_memory_features */ - false, /* in_is_mutable */ - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* in_final_image_layout */ - nullptr); /* in_mipmaps_ptr */ - - m_depth_image_view_ptr = Anvil::ImageView::create_2D(m_device_ptr.get(), - m_depth_image_ptr.get(), - 0, /* n_base_layer */ - 0, /* n_base_mipmap_level */ - 1, /* n_mipmaps */ - VK_IMAGE_ASPECT_DEPTH_BIT, - m_depth_image_ptr->get_image_format(), - VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY); + { + auto create_info_ptr = Anvil::ImageCreateInfo::create_nonsparse_alloc(m_device_ptr.get(), + VK_IMAGE_TYPE_2D, + VK_FORMAT_D32_SFLOAT, + VK_IMAGE_TILING_OPTIMAL, + VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, + m_window_ptr->get_width_at_creation_time (), + m_window_ptr->get_height_at_creation_time(), + 1, /* base_mipmap_depth */ + 1, /* n_layers */ + VK_SAMPLE_COUNT_1_BIT, + Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_EXCLUSIVE, + false, /* in_use_full_mipmap_chain */ + 0, /* in_memory_features */ + false, /* in_is_mutable */ + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* in_final_image_layout */ + nullptr); /* in_mipmaps_ptr */ + + m_depth_image_ptr = Anvil::Image::create(std::move(create_info_ptr) ); + } + + { + auto create_info_ptr = Anvil::ImageViewCreateInfo::create_2D(m_device_ptr.get(), + m_depth_image_ptr.get(), + 0, /* n_base_layer */ + 0, /* n_base_mipmap_level */ + 1, /* n_mipmaps */ + VK_IMAGE_ASPECT_DEPTH_BIT, + m_depth_image_ptr->get_create_info_ptr()->get_format(), + VK_COMPONENT_SWIZZLE_IDENTITY, + VK_COMPONENT_SWIZZLE_IDENTITY, + VK_COMPONENT_SWIZZLE_IDENTITY, + VK_COMPONENT_SWIZZLE_IDENTITY); + + m_depth_image_view_ptr = Anvil::ImageView::create(std::move(create_info_ptr) ); + } } void App::init_query_pool() @@ -743,46 +820,46 @@ void App::init_renderpasses() Anvil::SubPassID subpass_id; { - Anvil::RenderPassInfoUniquePtr renderpass_info_ptr(new Anvil::RenderPassInfo(m_device_ptr.get() ) ); + Anvil::RenderPassCreateInfoUniquePtr renderpass_create_info_ptr(new Anvil::RenderPassCreateInfo(m_device_ptr.get() ) ); - renderpass_info_ptr->add_color_attachment(m_swapchain_ptr->get_image_format(), - VK_SAMPLE_COUNT_1_BIT, - VK_ATTACHMENT_LOAD_OP_CLEAR, - VK_ATTACHMENT_STORE_OP_STORE, + renderpass_create_info_ptr->add_color_attachment(m_swapchain_ptr->get_create_info_ptr()->get_format(), + VK_SAMPLE_COUNT_1_BIT, + VK_ATTACHMENT_LOAD_OP_CLEAR, + VK_ATTACHMENT_STORE_OP_STORE, #ifndef ENABLE_OFFSCREEN_RENDERING - VK_IMAGE_LAYOUT_UNDEFINED, - VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, + VK_IMAGE_LAYOUT_UNDEFINED, + VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, #else - VK_IMAGE_LAYOUT_GENERAL, - VK_IMAGE_LAYOUT_GENERAL, + VK_IMAGE_LAYOUT_GENERAL, + VK_IMAGE_LAYOUT_GENERAL, #endif - false, /* may_alias */ - &color_attachment_id); - - renderpass_info_ptr->add_depth_stencil_attachment(m_depth_image_ptr->get_image_format(), - VK_SAMPLE_COUNT_1_BIT, - VK_ATTACHMENT_LOAD_OP_CLEAR, - VK_ATTACHMENT_STORE_OP_STORE, - VK_ATTACHMENT_LOAD_OP_DONT_CARE, - VK_ATTACHMENT_STORE_OP_DONT_CARE, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, - false, /* may_alias */ - &depth_attachment_id); + false, /* may_alias */ + &color_attachment_id); + + renderpass_create_info_ptr->add_depth_stencil_attachment(m_depth_image_ptr->get_create_info_ptr()->get_format(), + VK_SAMPLE_COUNT_1_BIT, + VK_ATTACHMENT_LOAD_OP_CLEAR, + VK_ATTACHMENT_STORE_OP_STORE, + VK_ATTACHMENT_LOAD_OP_DONT_CARE, + VK_ATTACHMENT_STORE_OP_DONT_CARE, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + false, /* may_alias */ + &depth_attachment_id); /* Define the only subpass we're going to use there */ - renderpass_info_ptr->add_subpass (&subpass_id); - renderpass_info_ptr->add_subpass_color_attachment (subpass_id, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - color_attachment_id, - 0, /* in_location */ - nullptr); /* in_opt_attachment_resolve_id_ptr */ - renderpass_info_ptr->add_subpass_depth_stencil_attachment(subpass_id, - depth_attachment_id, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); - - renderpass_ptr = Anvil::RenderPass::create(std::move(renderpass_info_ptr), + renderpass_create_info_ptr->add_subpass (&subpass_id); + renderpass_create_info_ptr->add_subpass_color_attachment (subpass_id, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + color_attachment_id, + 0, /* in_location */ + nullptr); /* in_opt_attachment_resolve_id_ptr */ + renderpass_create_info_ptr->add_subpass_depth_stencil_attachment(subpass_id, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + depth_attachment_id); + + renderpass_ptr = Anvil::RenderPass::create(std::move(renderpass_create_info_ptr), m_swapchain_ptr.get() ); } @@ -796,25 +873,25 @@ void App::init_renderpasses() **/ if (m_general_pipeline_id == -1) { - auto gfx_manager_ptr = m_device_ptr->get_graphics_pipeline_manager (); - auto gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - renderpass_ptr.get(), - subpass_id, - *m_fs_entrypoint_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* in_gs_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* in_tc_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* in_te_entrypoint */ - *m_vs_entrypoint_ptr); - - gfx_pipeline_info_ptr->add_vertex_attribute (0, /* location */ - VK_FORMAT_R32G32B32_SFLOAT, - 0, /* offset_in_bytes */ - sizeof(float) * 3, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX); - gfx_pipeline_info_ptr->set_descriptor_set_info(m_dsg_ptrs[0]->get_descriptor_set_info() ); - - gfx_manager_ptr->add_pipeline(std::move(gfx_pipeline_info_ptr), + auto gfx_manager_ptr = m_device_ptr->get_graphics_pipeline_manager (); + auto gfx_pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create_regular(false, /* in_disable_optimizations */ + false, /* in_allow_derivatives */ + renderpass_ptr.get(), + subpass_id, + *m_fs_entrypoint_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* in_gs_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* in_tc_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* in_te_entrypoint */ + *m_vs_entrypoint_ptr); + + gfx_pipeline_create_info_ptr->add_vertex_attribute (0, /* location */ + VK_FORMAT_R32G32B32_SFLOAT, + 0, /* offset_in_bytes */ + sizeof(float) * 3, /* stride_in_bytes */ + VK_VERTEX_INPUT_RATE_VERTEX); + gfx_pipeline_create_info_ptr->set_descriptor_set_create_info(m_dsg_ptrs[0]->get_descriptor_set_create_info() ); + + gfx_manager_ptr->add_pipeline(std::move(gfx_pipeline_create_info_ptr), &m_general_pipeline_id); } @@ -825,17 +902,25 @@ void App::init_renderpasses() /* Set up a framebuffer we will use for the renderpass */ Anvil::FramebufferUniquePtr framebuffer_ptr; - framebuffer_ptr = Anvil::Framebuffer::create(m_device_ptr.get(), - m_window_ptr->get_width_at_creation_time (), - m_window_ptr->get_height_at_creation_time(), - 1); /* n_layers */ + { + auto create_info_ptr = Anvil::FramebufferCreateInfo::create(m_device_ptr.get(), + m_window_ptr->get_width_at_creation_time (), + m_window_ptr->get_height_at_creation_time(), + 1); /* n_layers */ + + { + create_info_ptr->add_attachment(m_swapchain_ptr->get_image_view(n_swapchain_image), + nullptr); + } + + create_info_ptr->add_attachment(m_depth_image_view_ptr.get(), + nullptr); + + framebuffer_ptr = Anvil::Framebuffer::create(std::move(create_info_ptr) ); + } framebuffer_ptr->set_name("Main framebuffer"); - framebuffer_ptr->add_attachment(m_swapchain_ptr->get_image_view(n_swapchain_image), - nullptr); - framebuffer_ptr->add_attachment(m_depth_image_view_ptr.get(), - nullptr); m_framebuffers.push_back( std::move(framebuffer_ptr) @@ -845,25 +930,48 @@ void App::init_renderpasses() void App::init_semaphores() { + uint32_t n_physical_devices(0); + + switch (m_device_ptr->get_type() ) + { + case Anvil::DEVICE_TYPE_SINGLE_GPU: + { + n_physical_devices = 1; + + break; + } + + default: + { + anvil_assert(false); + } + } + for (uint32_t n_swapchain_image = 0; n_swapchain_image < m_n_swapchain_images; ++n_swapchain_image) { - auto new_frame_acquisition_wait_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); + Anvil::SemaphoreUniquePtr new_signal_semaphore_ptr; + Anvil::SemaphoreUniquePtr new_wait_semaphore_ptr; - new_frame_acquisition_wait_semaphore_ptr->set_name_formatted("New frame acquisition wait semaphore [%d]", - n_swapchain_image); + { + auto create_info_ptr = Anvil::SemaphoreCreateInfo::create(m_device_ptr.get() ); - auto new_signal_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); - auto new_wait_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); + new_signal_semaphore_ptr = Anvil::Semaphore::create(std::move(create_info_ptr) ); + } + { + auto create_info_ptr = Anvil::SemaphoreCreateInfo::create(m_device_ptr.get() ); + + new_wait_semaphore_ptr = Anvil::Semaphore::create(std::move(create_info_ptr) ); + } new_signal_semaphore_ptr->set_name_formatted("Signal semaphore [%d]", n_swapchain_image); new_wait_semaphore_ptr->set_name_formatted ("Wait semaphore [%d]", n_swapchain_image); - m_frame_signal_semaphores.push_back(std::move(new_signal_semaphore_ptr )); - m_frame_wait_semaphores.push_back (std::move(new_wait_semaphore_ptr) ); + m_frame_signal_semaphores.push_back(std::move(new_signal_semaphore_ptr)); + m_frame_wait_semaphores.push_back (std::move(new_wait_semaphore_ptr)); } } @@ -910,7 +1018,6 @@ void App::init_shaders() void App::init_swapchain() { - Anvil::SGPUDevice* sgpu_device_ptr (dynamic_cast(m_device_ptr.get() ) ); static const VkFormat swapchain_format (VK_FORMAT_B8G8R8A8_UNORM); static const VkPresentModeKHR swapchain_present_mode(VK_PRESENT_MODE_FIFO_KHR); static const VkImageUsageFlags swapchain_usage (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT); @@ -921,24 +1028,39 @@ void App::init_swapchain() m_rendering_surface_ptr->set_name("Main rendering surface"); - m_swapchain_ptr = sgpu_device_ptr->create_swapchain(m_rendering_surface_ptr.get(), - m_window_ptr.get (), - swapchain_format, - swapchain_present_mode, - swapchain_usage, - m_n_swapchain_images); - - /* Cache the queue we are going to use for presentation */ - const std::vector* present_queue_fams_ptr = nullptr; - if (!m_rendering_surface_ptr->get_queue_families_with_present_support(&present_queue_fams_ptr) ) + switch (m_device_ptr->get_type() ) { - anvil_assert_fail(); - } + case Anvil::DEVICE_TYPE_SINGLE_GPU: + { + Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr.get() ) ); + + m_swapchain_ptr = sgpu_device_ptr->create_swapchain(m_rendering_surface_ptr.get(), + m_window_ptr.get (), + swapchain_format, + swapchain_present_mode, + swapchain_usage, + m_n_swapchain_images); - m_present_queue_ptr = sgpu_device_ptr->get_queue_for_queue_family_index(present_queue_fams_ptr->at(0), - 0); /* in_n_queue */ + /* Cache the queue we are going to use for presentation */ + const std::vector* present_queue_fams_ptr = nullptr; + if (!m_rendering_surface_ptr->get_queue_families_with_present_support(&present_queue_fams_ptr) ) + { + anvil_assert_fail(); + } + + m_present_queue_ptr = sgpu_device_ptr->get_queue_for_queue_family_index(present_queue_fams_ptr->at(0), + 0); /* in_n_queue */ + + break; + } + + default: + { + anvil_assert(false); + } + } } void App::init_window() @@ -987,13 +1109,16 @@ void App::init_vulkan() #endif false); /* in_mt_safe */ - /* Create a Vulkan device */ - m_device_ptr = Anvil::SGPUDevice::create(m_instance_ptr->get_physical_device(0), - true, /* in_enable_shader_module_cache */ - Anvil::DeviceExtensionConfiguration(), - std::vector(), /* in_layers */ - false, /* in_transient_command_buffer_allocs_only */ - false); /* in_support_resettable_command_buffers */ + /* Determine which extensions we need to request for */ + { + /* Create a Vulkan device */ + m_device_ptr = Anvil::SGPUDevice::create(m_instance_ptr->get_physical_device(0), + true, /* in_enable_shader_module_cache */ + Anvil::DeviceExtensionConfiguration(), + std::vector(), /* in_layers */ + false, /* in_transient_command_buffer_allocs_only */ + false); /* in_support_resettable_command_buffers */ + } } void App::on_keypress_event(Anvil::CallbackArgument* callback_data_raw_ptr) diff --git a/examples/PushConstants/src/app.cpp b/examples/PushConstants/src/app.cpp index 25bc6e1a..f704345c 100644 --- a/examples/PushConstants/src/app.cpp +++ b/examples/PushConstants/src/app.cpp @@ -30,12 +30,18 @@ #include #include #include "config.h" +#include "misc/buffer_create_info.h" +#include "misc/framebuffer_create_info.h" #include "misc/glsl_to_spirv.h" -#include "misc/graphics_pipeline_info.h" +#include "misc/graphics_pipeline_create_info.h" +#include "misc/image_create_info.h" +#include "misc/image_view_create_info.h" #include "misc/io.h" #include "misc/memory_allocator.h" #include "misc/object_tracker.h" -#include "misc/render_pass_info.h" +#include "misc/render_pass_create_info.h" +#include "misc/semaphore_create_info.h" +#include "misc/swapchain_create_info.h" #include "misc/time.h" #include "misc/window_factory.h" #include "wrappers/buffer.h" @@ -407,11 +413,15 @@ void App::init_buffers() auto allocator_ptr = Anvil::MemoryAllocator::create_oneshot(m_device_ptr.get() ); /* Set up a buffer to hold uniform data */ - m_data_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), - ub_data_size_total, - Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT); + { + auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), + ub_data_size_total, + Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_EXCLUSIVE, + VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT); + + m_data_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); + } m_data_buffer_ptr->set_name("Data buffer"); @@ -419,11 +429,15 @@ void App::init_buffers() 0); /* in_required_memory_features */ /* Set up a buffer to hold mesh data */ - m_mesh_data_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr.get(), - get_mesh_data_size(), - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_VERTEX_BUFFER_BIT); + { + auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), + get_mesh_data_size(), + Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_EXCLUSIVE, + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT); + + m_mesh_data_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); + } m_mesh_data_buffer_ptr->set_name("Mesh vertexdata buffer"); @@ -574,17 +588,17 @@ void App::init_command_buffers() void App::init_dsgs() { { - auto dsg_info_ptrs = std::vector(1); + auto dsg_create_info_ptrs = std::vector(1); - dsg_info_ptrs[0] = Anvil::DescriptorSetInfo::create(); + dsg_create_info_ptrs[0] = Anvil::DescriptorSetCreateInfo::create(); - dsg_info_ptrs[0]->add_binding(0, /* n_binding */ - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, - 1, /* n_elements */ - VK_SHADER_STAGE_VERTEX_BIT); + dsg_create_info_ptrs[0]->add_binding(0, /* n_binding */ + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, + 1, /* n_elements */ + VK_SHADER_STAGE_VERTEX_BIT); m_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), - dsg_info_ptrs, + dsg_create_info_ptrs, false); /* releaseable_sets */ } @@ -614,104 +628,107 @@ void App::init_framebuffers() attachment_image_view_ptr = m_swapchain_ptr->get_image_view(n_fbo); /* Create the internal framebuffer object */ - m_fbos[n_fbo] = Anvil::Framebuffer::create(m_device_ptr.get(), - WINDOW_WIDTH, - WINDOW_HEIGHT, - 1 /* n_layers */); + { + auto create_info_ptr = Anvil::FramebufferCreateInfo::create(m_device_ptr.get(), + WINDOW_WIDTH, + WINDOW_HEIGHT, + 1 /* n_layers */); - m_fbos[n_fbo]->set_name_formatted("Framebuffer for swapchain image [%d]", - n_fbo); + result = create_info_ptr->add_attachment(attachment_image_view_ptr, + nullptr /* out_opt_attachment_id_ptr */); + anvil_assert(result); - result = m_fbos[n_fbo]->add_attachment(attachment_image_view_ptr, - nullptr /* out_opt_attachment_id_ptr */); + m_fbos[n_fbo] = Anvil::Framebuffer::create(std::move(create_info_ptr) ); + } - anvil_assert(result); + m_fbos[n_fbo]->set_name_formatted("Framebuffer for swapchain image [%d]", + n_fbo); } } void App::init_gfx_pipelines() { - Anvil::GraphicsPipelineInfoUniquePtr gfx_pipeline_info_ptr; - auto gfx_pipeline_manager_ptr(m_device_ptr->get_graphics_pipeline_manager() ); + Anvil::GraphicsPipelineCreateInfoUniquePtr gfx_pipeline_create_info_ptr; + auto gfx_pipeline_manager_ptr(m_device_ptr->get_graphics_pipeline_manager() ); /* Create a renderpass for the pipeline */ Anvil::RenderPassAttachmentID render_pass_color_attachment_id; Anvil::SubPassID render_pass_subpass_id; { - Anvil::RenderPassInfoUniquePtr render_pass_info_ptr(new Anvil::RenderPassInfo(m_device_ptr.get() ) ); + Anvil::RenderPassCreateInfoUniquePtr render_pass_create_info_ptr(new Anvil::RenderPassCreateInfo(m_device_ptr.get() ) ); - render_pass_info_ptr->add_color_attachment(m_swapchain_ptr->get_image_format(), - VK_SAMPLE_COUNT_1_BIT, - VK_ATTACHMENT_LOAD_OP_CLEAR, - VK_ATTACHMENT_STORE_OP_STORE, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + render_pass_create_info_ptr->add_color_attachment(m_swapchain_ptr->get_create_info_ptr()->get_format(), + VK_SAMPLE_COUNT_1_BIT, + VK_ATTACHMENT_LOAD_OP_CLEAR, + VK_ATTACHMENT_STORE_OP_STORE, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, #ifdef ENABLE_OFFSCREEN_RENDERING - VK_IMAGE_LAYOUT_GENERAL, + VK_IMAGE_LAYOUT_GENERAL, #else - VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, + VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, #endif - false, /* may_alias */ - &render_pass_color_attachment_id); + false, /* may_alias */ + &render_pass_color_attachment_id); - render_pass_info_ptr->add_subpass (&render_pass_subpass_id); - render_pass_info_ptr->add_subpass_color_attachment(render_pass_subpass_id, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - render_pass_color_attachment_id, - 0, /* location */ - nullptr); /* opt_attachment_resolve_id_ptr */ + render_pass_create_info_ptr->add_subpass (&render_pass_subpass_id); + render_pass_create_info_ptr->add_subpass_color_attachment(render_pass_subpass_id, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + render_pass_color_attachment_id, + 0, /* location */ + nullptr); /* opt_attachment_resolve_id_ptr */ - m_renderpass_ptr = Anvil::RenderPass::create(std::move(render_pass_info_ptr), + m_renderpass_ptr = Anvil::RenderPass::create(std::move(render_pass_create_info_ptr), m_swapchain_ptr.get() ); } m_renderpass_ptr->set_name("Main renderpass"); - gfx_pipeline_info_ptr = Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - m_renderpass_ptr.get(), - render_pass_subpass_id, - *m_fs_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* in_geometry_shader */ - Anvil::ShaderModuleStageEntryPoint(), /* in_tess_control_shader */ - Anvil::ShaderModuleStageEntryPoint(), /* in_tess_evaluation_shader */ - *m_vs_ptr); - - - - gfx_pipeline_info_ptr->set_descriptor_set_info (m_dsg_ptr->get_descriptor_set_info() ); - gfx_pipeline_info_ptr->attach_push_constant_range (0, /* in_offset */ - sizeof(float) * 4 /* vec4 */ * 4 /* vec4 values */, - VK_SHADER_STAGE_FRAGMENT_BIT | VK_SHADER_STAGE_VERTEX_BIT); - gfx_pipeline_info_ptr->set_rasterization_properties (VK_POLYGON_MODE_FILL, - VK_CULL_MODE_NONE, - VK_FRONT_FACE_COUNTER_CLOCKWISE, - 1.0f); /* in_line_width */ - gfx_pipeline_info_ptr->set_color_blend_attachment_properties(0, /* in_attachment_id */ - true, /* in_blending_enabled */ - VK_BLEND_OP_ADD, - VK_BLEND_OP_ADD, - VK_BLEND_FACTOR_SRC_ALPHA, - VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, - VK_BLEND_FACTOR_SRC_ALPHA, - VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, - VK_COLOR_COMPONENT_A_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_R_BIT); - - gfx_pipeline_info_ptr->add_vertex_attribute(0, /* in_location */ - get_mesh_data_position_format(), - get_mesh_data_position_start_offset(), - get_mesh_data_position_stride(), - VK_VERTEX_INPUT_RATE_VERTEX); - gfx_pipeline_info_ptr->add_vertex_attribute(1, /* location */ - get_mesh_data_color_format (), - get_mesh_data_color_start_offset(), - get_mesh_data_color_stride (), - VK_VERTEX_INPUT_RATE_VERTEX); - - - gfx_pipeline_manager_ptr->add_pipeline(std::move(gfx_pipeline_info_ptr), + gfx_pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create_regular(false, /* in_disable_optimizations */ + false, /* in_allow_derivatives */ + m_renderpass_ptr.get(), + render_pass_subpass_id, + *m_fs_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* in_geometry_shader */ + Anvil::ShaderModuleStageEntryPoint(), /* in_tess_control_shader */ + Anvil::ShaderModuleStageEntryPoint(), /* in_tess_evaluation_shader */ + *m_vs_ptr); + + + + gfx_pipeline_create_info_ptr->set_descriptor_set_create_info (m_dsg_ptr->get_descriptor_set_create_info() ); + gfx_pipeline_create_info_ptr->attach_push_constant_range (0, /* in_offset */ + sizeof(float) * 4 /* vec4 */ * 4 /* vec4 values */, + VK_SHADER_STAGE_FRAGMENT_BIT | VK_SHADER_STAGE_VERTEX_BIT); + gfx_pipeline_create_info_ptr->set_rasterization_properties (VK_POLYGON_MODE_FILL, + VK_CULL_MODE_NONE, + VK_FRONT_FACE_COUNTER_CLOCKWISE, + 1.0f); /* in_line_width */ + gfx_pipeline_create_info_ptr->set_color_blend_attachment_properties(0, /* in_attachment_id */ + true, /* in_blending_enabled */ + VK_BLEND_OP_ADD, + VK_BLEND_OP_ADD, + VK_BLEND_FACTOR_SRC_ALPHA, + VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, + VK_BLEND_FACTOR_SRC_ALPHA, + VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, + VK_COLOR_COMPONENT_A_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_R_BIT); + + gfx_pipeline_create_info_ptr->add_vertex_attribute(0, /* in_location */ + get_mesh_data_position_format(), + get_mesh_data_position_start_offset(), + get_mesh_data_position_stride(), + VK_VERTEX_INPUT_RATE_VERTEX); + gfx_pipeline_create_info_ptr->add_vertex_attribute(1, /* location */ + get_mesh_data_color_format (), + get_mesh_data_color_start_offset(), + get_mesh_data_color_stride (), + VK_VERTEX_INPUT_RATE_VERTEX); + + + gfx_pipeline_manager_ptr->add_pipeline(std::move(gfx_pipeline_create_info_ptr), &m_pipeline_id); } @@ -726,8 +743,20 @@ void App::init_semaphores() n_semaphore < m_n_swapchain_images; ++n_semaphore) { - auto new_signal_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); - auto new_wait_semaphore_ptr = Anvil::Semaphore::create(m_device_ptr.get() ); + Anvil::SemaphoreUniquePtr new_signal_semaphore_ptr; + Anvil::SemaphoreUniquePtr new_wait_semaphore_ptr; + + { + auto create_info_ptr = Anvil::SemaphoreCreateInfo::create(m_device_ptr.get() ); + + new_signal_semaphore_ptr = Anvil::Semaphore::create(std::move(create_info_ptr) ); + } + + { + auto create_info_ptr = Anvil::SemaphoreCreateInfo::create(m_device_ptr.get() ); + + new_wait_semaphore_ptr = Anvil::Semaphore::create(std::move(create_info_ptr) ); + } new_signal_semaphore_ptr->set_name_formatted("Signal semaphore [%d]", n_semaphore); diff --git a/include/misc/base_pipeline_info.h b/include/misc/base_pipeline_create_info.h similarity index 66% rename from include/misc/base_pipeline_info.h rename to include/misc/base_pipeline_create_info.h index 494d86de..551fac6f 100644 --- a/include/misc/base_pipeline_info.h +++ b/include/misc/base_pipeline_create_info.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -19,20 +19,20 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // -#ifndef ANVIL_BASE_PIPELINE_INFO_H -#define ANVIL_BASE_PIPELINE_INFO_H +#ifndef ANVIL_BASE_PIPELINE_CREATE_INFO_H +#define ANVIL_BASE_PIPELINE_CREATE_INFO_H #include "misc/mt_safety.h" #include "misc/types.h" namespace Anvil { - class BasePipelineInfo + class BasePipelineCreateInfo { public: /* Public functions */ - virtual ~BasePipelineInfo(); + virtual ~BasePipelineCreateInfo(); bool allows_derivatives() const { @@ -49,9 +49,9 @@ namespace Anvil return m_base_pipeline_id; } - const std::vector* get_ds_info_items() const + const std::vector* get_ds_create_info_items() const { - return &m_ds_info_items; + return &m_ds_create_info_items; } const PushConstantRanges& get_push_constant_ranges() const @@ -77,12 +77,12 @@ namespace Anvil return m_is_proxy; } - void set_descriptor_set_info(const std::vector* in_ds_info_vec_ptr); + void set_descriptor_set_create_info(const std::vector* in_ds_create_info_vec_ptr); protected: /* Protected functions */ - BasePipelineInfo(); + BasePipelineCreateInfo(); /** Adds a new specialization constant. * @@ -100,20 +100,20 @@ namespace Anvil uint32_t in_n_data_bytes, const void* in_data_ptr); - void init_derivative_pipeline_info(bool in_disable_optimizations, - bool in_allow_derivatives, - uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, - Anvil::PipelineID in_base_pipeline_id, - const std::vector* in_opt_ds_info_vec_ptr = nullptr); - void init_proxy_pipeline_info (); - void init_regular_pipeline_info (bool in_disable_optimizations, - bool in_allow_derivatives, - uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, - const std::vector* in_opt_ds_info_vec_ptr = nullptr); + void init_derivative(bool in_disable_optimizations, + bool in_allow_derivatives, + uint32_t in_n_shader_module_stage_entrypoints, + const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, + Anvil::PipelineID in_base_pipeline_id, + const std::vector* in_opt_ds_create_info_vec_ptr = nullptr); + void init_proxy (); + void init_regular (bool in_disable_optimizations, + bool in_allow_derivatives, + uint32_t in_n_shader_module_stage_entrypoints, + const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, + const std::vector* in_opt_ds_create_info_vec_ptr = nullptr); - void copy_state_from(const BasePipelineInfo* in_src_pipeline_info_ptr); + void copy_state_from(const BasePipelineCreateInfo* in_src_pipeline_create_info_ptr); /* Protected type definitions */ @@ -122,10 +122,10 @@ namespace Anvil /* Protected variables */ Anvil::PipelineID m_base_pipeline_id; - std::vector m_ds_info_items; - PushConstantRanges m_push_constant_ranges; - std::vector m_specialization_constants_data_buffer; - ShaderStageToSpecializationConstantsMap m_specialization_constants_map; + std::vector m_ds_create_info_items; + PushConstantRanges m_push_constant_ranges; + std::vector m_specialization_constants_data_buffer; + ShaderStageToSpecializationConstantsMap m_specialization_constants_map; bool m_allow_derivatives; bool m_disable_optimizations; @@ -144,5 +144,5 @@ namespace Anvil }; -#endif /* ANVIL_BASE_PIPELINE_INFO_H */ +#endif /* ANVIL_BASE_PIPELINE_CREATE_INFO_H */ diff --git a/include/misc/base_pipeline_manager.h b/include/misc/base_pipeline_manager.h index a68d651e..f63eb033 100644 --- a/include/misc/base_pipeline_manager.h +++ b/include/misc/base_pipeline_manager.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -37,7 +37,7 @@ #ifndef MISC_BASE_PIPELINE_MANAGER_H #define MISC_BASE_PIPELINE_MANAGER_H -#include "misc/base_pipeline_info.h" +#include "misc/base_pipeline_create_info.h" #include "misc/callbacks.h" #include "misc/debug.h" #include "misc/mt_safety.h" @@ -71,8 +71,8 @@ namespace Anvil virtual ~BasePipelineManager(); /** TODO */ - bool add_pipeline(Anvil::BasePipelineInfoUniquePtr in_pipeline_info_ptr, - PipelineID* out_pipeline_id_ptr); + bool add_pipeline(Anvil::BasePipelineCreateInfoUniquePtr in_pipeline_create_info_ptr, + PipelineID* out_pipeline_id_ptr); /** TODO */ virtual bool bake() = 0; @@ -97,7 +97,7 @@ namespace Anvil **/ VkPipeline get_pipeline(PipelineID in_pipeline_id); - const Anvil::BasePipelineInfo* get_pipeline_info(PipelineID in_pipeline_id) const; + const Anvil::BasePipelineCreateInfo* get_pipeline_create_info(PipelineID in_pipeline_id) const; /** Retrieves a PipelineLayout instance associated with the specified pipeline ID. * @@ -152,19 +152,19 @@ namespace Anvil /** Internal pipeline object descriptor */ typedef struct Pipeline : public MTSafetySupportProvider { - VkPipeline baked_pipeline; - const BaseDevice* device_ptr; - Anvil::PipelineLayoutUniquePtr layout_ptr; - Anvil::BasePipelineInfoUniquePtr pipeline_info_ptr; - - Pipeline(const Anvil::BaseDevice* in_device_ptr, - Anvil::BasePipelineInfoUniquePtr in_pipeline_info_ptr, - bool in_mt_safe) + VkPipeline baked_pipeline; + const BaseDevice* device_ptr; + Anvil::PipelineLayoutUniquePtr layout_ptr; + Anvil::BasePipelineCreateInfoUniquePtr pipeline_create_info_ptr; + + Pipeline(const Anvil::BaseDevice* in_device_ptr, + Anvil::BasePipelineCreateInfoUniquePtr in_pipeline_create_info_ptr, + bool in_mt_safe) :MTSafetySupportProvider(in_mt_safe) { - baked_pipeline = VK_NULL_HANDLE; - device_ptr = in_device_ptr; - pipeline_info_ptr = std::move(in_pipeline_info_ptr); + baked_pipeline = VK_NULL_HANDLE; + device_ptr = in_device_ptr; + pipeline_create_info_ptr = std::move(in_pipeline_create_info_ptr); } /** Destrutor. Releases the internally managed Vulkan objects. */ diff --git a/include/misc/buffer_create_info.h b/include/misc/buffer_create_info.h new file mode 100644 index 00000000..77d533d0 --- /dev/null +++ b/include/misc/buffer_create_info.h @@ -0,0 +1,312 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef MISC_BUFFER_CREATE_INFO_H +#define MISC_BUFFER_CREATE_INFO_H + +#include "misc/types.h" + + +namespace Anvil +{ + class BufferCreateInfo + { + public: + /* Public functions */ + + /** Creates a create info for a NON-SPARSE buffer object. + * + * A buffer instance created using the returned info instance WILL ALLOCATE and have a unique memory block BOUND to the object. + * Do NOT call Buffer::set_memory() to configure the binding. + * + * The constructor can optionally upload data to the initialized memory. + * + * The following default values are assumed, unless specified with separate set_..() invocations issued against the result instance: + * + * - Client data to fill the result bullfer with after mem alloc is bound to the buffer: none + * - External memory handle types: none + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * + * @param in_device_ptr Device to use. + * @param in_size Size of the buffer object to be initialized. + * @param in_queue_families Queue families which the buffer object is going to be used with. + * One or more user queue family bits can be enabled. + * @param in_sharing_mode VkSharingMode value, which is going to be passed to the vkCreateBuffer() + * call. + * @param in_usage_flags Usage flags to set in the VkBufferCreateInfo descriptor, passed to + * to the vkCreateBuffer() call. + * @param in_memory_freatures Required memory features. + **/ + static Anvil::BufferCreateInfoUniquePtr create_nonsparse_alloc(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + VkBufferUsageFlags in_usage_flags, + Anvil::MemoryFeatureFlags in_memory_features); + + /** Creates a create info for a NON-SPARSE buffer object. + * + * A buffer instance created using the returned info instance will NOT allocate or have any memory blocks bound + * to itself. It is user's responsibility to call Buffer::set_memory() to configure the binding. + * + * The following default values are assumed, unless specified with separate set_..() invocations issued against the result instance: + * + * - External memory handle types: none + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * + * @param in_device_ptr Device to use. + * @param in_size Size of the buffer object to be initialized. + * @param in_queue_families Queue families which the buffer object is going to be used with. + * One or more user queue family bits can be enabled. + * @param in_sharing_mode VkSharingMode value, which is going to be passed to the vkCreateBuffer() + * call. + * @param in_usage_flags Usage flags to set in the VkBufferCreateInfo descriptor, passed to + * to the vkCreateBuffer() call. + **/ + static Anvil::BufferCreateInfoUniquePtr create_nonsparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + VkBufferUsageFlags in_usage_flags); + + /** Creates a create info for a NON-SPARSE buffer object. + * + * The new NON-SPARSE buffer will reuse a region of the specified buffer's storage, instead of creating one's own. + * + * It is user's responsibility to ensure memory aliasing or synchronization is used, according + * to the spec rules. + * + * @param in_parent_buffer_ptr Specifies the buffer, whose memory block should be used. Must not be + * nullptr. MUST BE NON-SPARSE. + * @param in_start_offset Memory region's start offset. + * @param in_size Size of the memory region to "claim". + **/ + static Anvil::BufferCreateInfoUniquePtr create_nonsparse_no_alloc_child(Anvil::Buffer* in_parent_nonsparse_buffer_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size); + + /** Creates a create info for a SPARSE buffer object. + * + * A buffer instance created using the returned info instance will NOT allocate or have any memory blocks bound + * to itself. It is user's responsibility to call Queue::bind_sparse_memory() afterward to update page configuration. + * + * @param in_device_ptr Device to use. + * @param in_size Size of the buffer object to be initialized. + * @param in_queue_families Queue families which the buffer object is going to be used with. + * One or more user queue family bits can be enabled. + * @param in_sharing_mode VkSharingMode value, which is going to be passed to the vkCreateBuffer() + * call. + * @param in_usage_flags Usage flags to set in the VkBufferCreateInfo descriptor, passed to + * to the vkCreateBuffer() call. + * @param in_residency_scope Scope of residency to support for the buffer. + * @param in_external_memory_handle_types If the buffer is going to be exported to another process or Vulkan instance, use + * this field to specify which handle types the allocation needs to support. Please see + * documentation of Anvil::ExternalMemoryHandleTypeFlags for more details. + **/ + static Anvil::BufferCreateInfoUniquePtr create_sparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + VkBufferUsageFlags in_usage_flags, + Anvil::SparseResidencyScope in_residency_scope, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); + + const void* const get_client_data() const + { + return m_client_data_ptr; + } + + const Anvil::BaseDevice* get_device() const + { + return m_device_ptr; + } + + const Anvil::ExternalMemoryHandleTypeFlags& get_external_memory_handle_types() const + { + return m_external_memory_handle_types; + } + + const Anvil::MemoryFeatureFlags& get_memory_features() const + { + return m_memory_features; + } + + const Anvil::MTSafety& get_mt_safety() const + { + return m_mt_safety; + } + + /** Returns a pointer to the parent buffer, if one was specified at creation time */ + Anvil::Buffer* get_parent_buffer_ptr() const + { + return m_parent_buffer_ptr; + } + + /** Returns info about queue families this buffer has been created for */ + QueueFamilyBits get_queue_families() const + { + return m_queue_families; + } + + /** Returns the residency scope. + * + * Triggers an assertion failure if called for non-sparse images + */ + Anvil::SparseResidencyScope get_residency_scope() const + { + anvil_assert(m_type == Anvil::BufferType::SPARSE_NO_ALLOC); + + return m_residency_scope; + } + + /** Returns sharing mode of the buffer */ + VkSharingMode get_sharing_mode() const + { + return m_sharing_mode; + } + + /** Returns size of the encapsulated Vulkan buffer memory region. + * + * @return >= 0 if successful, UINT64_MAX otherwise */ + VkDeviceSize get_size() const + { + anvil_assert(m_size != 0); + + return m_size; + } + + /** Returns start offset of the encapsulated Vulkan buffer memory region. + * + * @return >= 0 if successful, UINT64_MAX otherwise */ + VkDeviceSize get_start_offset() const + { + return m_start_offset; + } + + const Anvil::BufferType& get_type() const + { + return m_type; + } + + const VkBufferUsageFlags get_usage_flags() const + { + return m_usage_flags; + } + + void set_client_data(const void* const in_client_data_ptr) + { + m_client_data_ptr = in_client_data_ptr; + } + + void set_device(const Anvil::BaseDevice* in_device_ptr) + { + m_device_ptr = in_device_ptr; + } + + void set_external_memory_handle_types(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) + { + m_external_memory_handle_types = in_external_memory_handle_types; + } + + void set_memory_features(const Anvil::MemoryFeatureFlags& in_memory_features) + { + m_memory_features = in_memory_features; + } + + void set_mt_safety(const Anvil::MTSafety& in_mt_safety) + { + m_mt_safety = in_mt_safety; + } + + void get_queue_families(const QueueFamilyBits& in_queue_families) + { + m_queue_families = in_queue_families; + } + + void set_sharing_mode(const VkSharingMode& in_sharing_mode) + { + m_sharing_mode = in_sharing_mode; + } + + void set_size(const VkDeviceSize& in_size) + { + m_size = in_size; + } + + void set_start_offset(const VkDeviceSize& in_start_offset) + { + m_start_offset = in_start_offset; + } + + void set_usage_flags(const VkBufferUsageFlags& in_usage_flags) + { + m_usage_flags = in_usage_flags; + } + + private: + /* Private type definitions */ + + /* Private functions */ + + BufferCreateInfo(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + VkBufferUsageFlags in_usage_flags, + Anvil::SparseResidencyScope in_residency_scope, + MTSafety in_mt_safety, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types); + BufferCreateInfo(const Anvil::BufferType& in_buffer_type, + const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + VkBufferUsageFlags in_usage_flags, + MemoryFeatureFlags in_memory_features, + MTSafety in_mt_safety, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types, + const void* in_opt_client_data_ptr); + BufferCreateInfo(Anvil::Buffer* in_parent_buffer_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size); + + + /* Private variables */ + const void* m_client_data_ptr; + const Anvil::BaseDevice* m_device_ptr; + Anvil::ExternalMemoryHandleTypeFlags m_external_memory_handle_types; + Anvil::MemoryFeatureFlags m_memory_features; + MTSafety m_mt_safety; + Anvil::Buffer* const m_parent_buffer_ptr; + Anvil::QueueFamilyBits m_queue_families; + const Anvil::SparseResidencyScope m_residency_scope; + VkSharingMode m_sharing_mode; + VkDeviceSize m_size; + VkDeviceSize m_start_offset; + const BufferType m_type; + VkBufferUsageFlags m_usage_flags; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(BufferCreateInfo); + ANVIL_DISABLE_COPY_CONSTRUCTOR(BufferCreateInfo); + }; +}; /* namespace Anvil */ +#endif /* MISC_BUFFER_CREATE_INFO_H */ \ No newline at end of file diff --git a/include/misc/buffer_view_create_info.h b/include/misc/buffer_view_create_info.h new file mode 100644 index 00000000..05e308a6 --- /dev/null +++ b/include/misc/buffer_view_create_info.h @@ -0,0 +1,135 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef MISC_BUFFER_VIEW_CREATE_INFO_H +#define MISC_BUFFER_VIEW_CREATE_INFO_H + +#include "misc/types.h" + + +namespace Anvil +{ + class BufferViewCreateInfo + { + public: + /* Public functions */ + + /* TODO. + * + * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: + * + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + */ + static Anvil::BufferViewCreateInfoUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + Anvil::Buffer* in_buffer_ptr, + VkFormat in_format, + VkDeviceSize in_start_offset, + VkDeviceSize in_size); + + const Anvil::BaseDevice* get_device() const + { + return m_device_ptr; + } + + /** Returns format used by the buffer view */ + VkFormat get_format() const + { + return m_format; + } + + const Anvil::MTSafety& get_mt_safety() const + { + return m_mt_safety; + } + + /** Returns pointer to the parent buffer instance */ + Anvil::Buffer* get_parent_buffer() const + { + return m_buffer_ptr; + } + + /** Returns size of the encapsulated buffer memory region */ + VkDeviceSize get_size() const + { + return m_size; + } + + /** Returns start offset of the encapsulated buffer memory region */ + VkDeviceSize get_start_offset() const + { + return m_start_offset; + } + + void set_device(const Anvil::BaseDevice* in_device_ptr) + { + m_device_ptr = in_device_ptr; + } + + void set_format(const VkFormat& in_format) + { + m_format = in_format; + } + + void set_mt_safety(const Anvil::MTSafety& in_mt_safety) + { + m_mt_safety = in_mt_safety; + } + + /** Returns pointer to the parent buffer instance */ + void set_parent_buffer(Anvil::Buffer* in_buffer_ptr) + { + m_buffer_ptr = in_buffer_ptr; + } + + void set_size(const VkDeviceSize& in_size) + { + m_size = in_size; + } + + void set_start_offset(const VkDeviceSize& in_start_offset) + { + m_start_offset = in_start_offset; + } + + private: + /* Private functions */ + + BufferViewCreateInfo(const Anvil::BaseDevice* in_device_ptr, + Anvil::Buffer* in_buffer_ptr, + VkFormat in_format, + VkDeviceSize in_start_offset, + VkDeviceSize in_size, + MTSafety in_mt_safety); + + + /* Private variables */ + Anvil::Buffer* m_buffer_ptr; + const Anvil::BaseDevice* m_device_ptr; + VkFormat m_format; + Anvil::MTSafety m_mt_safety; + VkDeviceSize m_size; + VkDeviceSize m_start_offset; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(BufferViewCreateInfo); + ANVIL_DISABLE_COPY_CONSTRUCTOR(BufferViewCreateInfo); + }; +}; /* namespace Anvil */ +#endif /* MISC_BUFFER_VIEW_CREATE_INFO_H */ \ No newline at end of file diff --git a/include/misc/callbacks.h b/include/misc/callbacks.h index a80cc185..4f04819f 100644 --- a/include/misc/callbacks.h +++ b/include/misc/callbacks.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/misc/compute_pipeline_info.h b/include/misc/compute_pipeline_create_info.h similarity index 66% rename from include/misc/compute_pipeline_info.h rename to include/misc/compute_pipeline_create_info.h index 9d9706ef..aa719054 100644 --- a/include/misc/compute_pipeline_info.h +++ b/include/misc/compute_pipeline_create_info.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -20,26 +20,26 @@ // THE SOFTWARE. // -#ifndef ANVIL_COMPUTE_PIPELINE_INFO_H -#define ANVIL_COMPUTE_PIPELINE_INFO_H +#ifndef ANVIL_COMPUTE_PIPELINE_CREATE_INFO_H +#define ANVIL_COMPUTE_PIPELINE_CREATE_INFO_H -#include "misc/base_pipeline_info.h" +#include "misc/base_pipeline_create_info.h" namespace Anvil { - class ComputePipelineInfo : public BasePipelineInfo + class ComputePipelineCreateInfo : public BasePipelineCreateInfo { public: /* Public functions */ - static ComputePipelineInfoUniquePtr create_derivative_pipeline_info(bool in_disable_optimizations, - bool in_allow_derivatives, - const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info, - Anvil::PipelineID in_base_pipeline_id); - static ComputePipelineInfoUniquePtr create_proxy_pipeline_info (); - static ComputePipelineInfoUniquePtr create_regular_pipeline_info (bool in_disable_optimizations, - bool in_allow_derivatives, - const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info); + static ComputePipelineCreateInfoUniquePtr create_derivative(bool in_disable_optimizations, + bool in_allow_derivatives, + const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info, + Anvil::PipelineID in_base_pipeline_id); + static ComputePipelineCreateInfoUniquePtr create_proxy (); + static ComputePipelineCreateInfoUniquePtr create_regular (bool in_disable_optimizations, + bool in_allow_derivatives, + const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info); /** Adds a new specialization constant. * @@ -54,17 +54,17 @@ namespace Anvil uint32_t in_n_data_bytes, const void* in_data_ptr) { - return BasePipelineInfo::add_specialization_constant(Anvil::SHADER_STAGE_COMPUTE, - in_constant_id, - in_n_data_bytes, - in_data_ptr); + return BasePipelineCreateInfo::add_specialization_constant(Anvil::SHADER_STAGE_COMPUTE, + in_constant_id, + in_n_data_bytes, + in_data_ptr); } - ~ComputePipelineInfo(); + ~ComputePipelineCreateInfo(); private: - ComputePipelineInfo(); + ComputePipelineCreateInfo(); }; }; -#endif /* ANVIL_COMPUTE_PIPELINE_INFO_H */ +#endif /* ANVIL_COMPUTE_PIPELINE_CREATE_INFO_H */ diff --git a/include/misc/debug.h b/include/misc/debug.h index a4ed34a8..0bd4d5ed 100644 --- a/include/misc/debug.h +++ b/include/misc/debug.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/misc/debug_marker.h b/include/misc/debug_marker.h index 47995faf..221d0973 100644 --- a/include/misc/debug_marker.h +++ b/include/misc/debug_marker.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/misc/descriptor_set_info.h b/include/misc/descriptor_set_create_info.h similarity index 70% rename from include/misc/descriptor_set_info.h rename to include/misc/descriptor_set_create_info.h index 1cd3d293..c981cd49 100644 --- a/include/misc/descriptor_set_info.h +++ b/include/misc/descriptor_set_create_info.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -20,8 +20,8 @@ // THE SOFTWARE. // -#ifndef MISC_DESCRIPTOR_SET_INFO_H -#define MISC_DESCRIPTOR_SET_INFO_H +#ifndef MISC_DESCRIPTOR_SET_CREATE_INFO_H +#define MISC_DESCRIPTOR_SET_CREATE_INFO_H #include "misc/types.h" #include "misc/struct_chainer.h" @@ -30,20 +30,25 @@ namespace Anvil { struct DescriptorSetLayoutCreateInfoContainer { + std::vector binding_flags_vec; std::vector binding_info_items; std::vector sampler_items; Anvil::StructChainUniquePtr struct_chain_ptr; }; - class DescriptorSetInfo + class DescriptorSetCreateInfo { public: /* Public functions */ /** Destructor. */ - ~DescriptorSetInfo(); + ~DescriptorSetCreateInfo(); /** Adds a new binding. + * + * If @param in_flags includes DESCRIPTOR_BINDING_FLAG_VARIABLE_DESCRIPTOR_COUNT_BIT, @param in_descriptor_array_size + * tells the maximum number of descriptors the binding can take. The actual number of descriptors which is going to be + * specified for the binding needs to be specified by separately calling set_binding_variable_descriptor_count(). * * It is an error to attempt to add a binding at an index, for which another binding has * already been specified. @@ -62,14 +67,38 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool add_binding(uint32_t in_binding_index, - VkDescriptorType in_descriptor_type, - uint32_t in_descriptor_array_size, - VkShaderStageFlags in_stage_flags, - const Anvil::Sampler* const* in_opt_immutable_sampler_ptr_ptr = nullptr); + bool add_binding(uint32_t in_binding_index, + VkDescriptorType in_descriptor_type, + uint32_t in_descriptor_array_size, + VkShaderStageFlags in_stage_flags, + const Anvil::DescriptorBindingFlags& in_flags = 0, + const Anvil::Sampler* const* in_opt_immutable_sampler_ptr_ptr = nullptr); + + /** Tells if the DS info structure contains a variable descriptor count binding. + * + * @param out_opt_binding_index_ptr If not null, deref will be set to the index of the variable descriptor + * count binding. + * @param out_opt_binding_size_ptr If not null, deref will be set to the variable descriptor count binding's size. + * + * @return true if such a binding has been defined, false otherwise. + */ + bool contains_variable_descriptor_count_binding(uint32_t* out_opt_binding_index_ptr = nullptr, + uint32_t* out_opt_binding_size_ptr = nullptr) const + { + if (out_opt_binding_index_ptr != nullptr) + { + *out_opt_binding_index_ptr = m_n_variable_descriptor_count_binding; + } + + if (out_opt_binding_size_ptr != nullptr) + { + *out_opt_binding_size_ptr = m_variable_descriptor_count_binding_size; + } + + return (m_n_variable_descriptor_count_binding != UINT32_MAX); + } - /** Creates a new DescriptorSetInfo instance. **/ - static DescriptorSetInfoUniquePtr create(); + static DescriptorSetCreateInfoUniquePtr create(); /* Fills & returns a VkDescriptorSetLayoutCreateInfo structure holding all information necessary to spawn * a new descriptor set layout instance. @@ -91,14 +120,17 @@ namespace Anvil * @param out_opt_immutable_samplers_enabled_ptr May be nullptr. If not, deref will be set to true if immutable samplers * have been defined for the specified binding; otherwise, it will be * set to false. + * @param out_opt_flags_ptr May be nullptr. If not, deref will be set to the flags specified at binding + * addition time. * * @return true if successful, false otherwise. **/ - bool get_binding_properties_by_binding_index(uint32_t in_binding_index, - VkDescriptorType* out_opt_descriptor_type_ptr = nullptr, - uint32_t* out_opt_descriptor_array_size_ptr = nullptr, - VkShaderStageFlags* out_opt_stage_flags_ptr = nullptr, - bool* out_opt_immutable_samplers_enabled_ptr = nullptr) const; + bool get_binding_properties_by_binding_index(uint32_t in_binding_index, + VkDescriptorType* out_opt_descriptor_type_ptr = nullptr, + uint32_t* out_opt_descriptor_array_size_ptr = nullptr, + VkShaderStageFlags* out_opt_stage_flags_ptr = nullptr, + bool* out_opt_immutable_samplers_enabled_ptr = nullptr, + Anvil::DescriptorBindingFlags* out_opt_flags_ptr = nullptr) const; /** Retrieves properties of a binding at a given index number. * @@ -124,7 +156,8 @@ namespace Anvil VkDescriptorType* out_opt_descriptor_type_ptr = nullptr, uint32_t* out_opt_descriptor_array_size_ptr = nullptr, VkShaderStageFlags* out_opt_stage_flags_ptr = nullptr, - bool* out_opt_immutable_samplers_enabled_ptr = nullptr) const; + bool* out_opt_immutable_samplers_enabled_ptr = nullptr, + Anvil::DescriptorBindingFlags* out_opt_flags_ptr = nullptr) const; /** Returns the number of bindings defined for the layout. */ uint32_t get_n_bindings() const @@ -132,7 +165,14 @@ namespace Anvil return static_cast(m_bindings.size() ); } - bool operator==(const Anvil::DescriptorSetInfo& in_ds) const; + /* Sets the number of descriptors to be used for a variable descriptor count binding. + * + * A variable descriptor count binding must have been added to this DS info instance before this function + * can be called. + */ + bool set_binding_variable_descriptor_count(const uint32_t& in_count); + + bool operator==(const Anvil::DescriptorSetCreateInfo& in_ds) const; private: /* Private type definitions */ @@ -142,6 +182,7 @@ namespace Anvil { uint32_t descriptor_array_size; VkDescriptorType descriptor_type; + Anvil::DescriptorBindingFlags flags; std::vector immutable_samplers; VkShaderStageFlagsVariable(stage_flags); @@ -151,6 +192,7 @@ namespace Anvil { descriptor_array_size = 0; descriptor_type = VK_DESCRIPTOR_TYPE_MAX_ENUM; + flags = 0; stage_flags = static_cast(0); } @@ -161,10 +203,12 @@ namespace Anvil Binding(uint32_t in_descriptor_array_size, VkDescriptorType in_descriptor_type, VkShaderStageFlags in_stage_flags, - const Anvil::Sampler* const* in_immutable_sampler_ptrs) + const Anvil::Sampler* const* in_immutable_sampler_ptrs, + Anvil::DescriptorBindingFlags in_flags) { descriptor_array_size = in_descriptor_array_size; descriptor_type = in_descriptor_type; + flags = in_flags; stage_flags = static_cast(in_stage_flags); if (in_immutable_sampler_ptrs != nullptr) @@ -182,6 +226,7 @@ namespace Anvil { return (descriptor_array_size == in_binding.descriptor_array_size) && (descriptor_type == in_binding.descriptor_type) && + (flags == in_binding.flags) && (immutable_samplers == in_binding.immutable_samplers) && (stage_flags == in_binding.stage_flags); } @@ -192,13 +237,16 @@ namespace Anvil /* Private functions */ /* Please see create() documentation for more details */ - DescriptorSetInfo(); + DescriptorSetCreateInfo(); /* Private variables */ BindingIndexToBindingMap m_bindings; - ANVIL_DISABLE_ASSIGNMENT_OPERATOR(DescriptorSetInfo); + uint32_t m_n_variable_descriptor_count_binding; + uint32_t m_variable_descriptor_count_binding_size; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(DescriptorSetCreateInfo); }; }; /* namespace Anvil */ -#endif /* MISC_DESCRIPTOR_SET_INFO */ \ No newline at end of file +#endif /* MISC_DESCRIPTOR_SET_CREATE_INFO */ \ No newline at end of file diff --git a/include/misc/dummy_window.h b/include/misc/dummy_window.h index f8f33e26..fb31be3a 100644 --- a/include/misc/dummy_window.h +++ b/include/misc/dummy_window.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/misc/event_create_info.h b/include/misc/event_create_info.h new file mode 100644 index 00000000..68e4b35d --- /dev/null +++ b/include/misc/event_create_info.h @@ -0,0 +1,78 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef MISC_EVENT_CREATE_INFO_H +#define MISC_EVENT_CREATE_INFO_H + +#include "misc/types.h" + +namespace Anvil +{ + class EventCreateInfo + { + public: + /* Public functions */ + + /* TODO. + * + * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: + * + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + */ + static Anvil::EventCreateInfoUniquePtr create(const Anvil::BaseDevice* in_device_ptr); + + const Anvil::BaseDevice* get_device() const + { + return m_device_ptr; + } + + const MTSafety& get_mt_safety() const + { + return m_mt_safety; + } + + + void set_device(const Anvil::BaseDevice* in_device_ptr) + { + m_device_ptr = in_device_ptr; + } + + void set_mt_safety(const MTSafety& in_mt_safety) + { + m_mt_safety = in_mt_safety; + } + + private: + /* Private functions */ + EventCreateInfo(const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety); + + /* Private variables */ + const Anvil::BaseDevice* m_device_ptr; + Anvil::MTSafety m_mt_safety; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(EventCreateInfo); + ANVIL_DISABLE_COPY_CONSTRUCTOR(EventCreateInfo); + }; + +}; /* namespace Anvil */ + +#endif /* MISC_EVENT_CREATE_INFO_H */ \ No newline at end of file diff --git a/include/misc/extensions.h b/include/misc/extensions.h new file mode 100644 index 00000000..5a493ee3 --- /dev/null +++ b/include/misc/extensions.h @@ -0,0 +1,628 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef MISC_EXTENSIONS_H +#define MISC_EXTENSIONS_H + +#include "misc/debug.h" +#include "misc/types.h" + +namespace Anvil +{ + namespace Internal + { + template + struct DeviceExtensions + { + ValueType amd_draw_indirect_count; + ValueType amd_gcn_shader; + ValueType amd_gpu_shader_half_float; + ValueType amd_gpu_shader_int16; + ValueType amd_negative_viewport_height; + ValueType amd_rasterization_order; + ValueType amd_shader_ballot; + ValueType amd_shader_core_properties; + ValueType amd_shader_explicit_vertex_parameter; + ValueType amd_shader_fragment_mask; + ValueType amd_shader_image_load_store_lod; + ValueType amd_shader_info; + ValueType amd_shader_trinary_minmax; + ValueType amd_texture_gather_bias_lod; + ValueType ext_debug_marker; + ValueType ext_descriptor_indexing; + ValueType ext_shader_stencil_export; + ValueType ext_shader_subgroup_ballot; + ValueType ext_shader_subgroup_vote; + ValueType khr_16bit_storage; + ValueType khr_bind_memory2; + ValueType khr_descriptor_update_template; + ValueType khr_external_memory; + ValueType khr_maintenance1; + ValueType khr_maintenance3; + ValueType khr_storage_buffer_storage_class; + ValueType khr_swapchain; + + std::map values_by_extension_names; + + + DeviceExtensions(const std::map& in_values_by_extension_names, + const ValueType& in_unspecified_extension_name_value) + { + typedef struct ExtensionData + { + const char* name; + ValueType* out_result_ptr; + + ExtensionData(const char* in_name, + ValueType* in_out_result_ptr) + :name (in_name), + out_result_ptr(in_out_result_ptr) + { + /* Stub */ + } + } ExtensionData; + + std::vector recognized_extensions = + { + {ExtensionData(VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME, &amd_draw_indirect_count)}, + {ExtensionData(VK_AMD_GCN_SHADER_EXTENSION_NAME, &amd_gcn_shader)}, + {ExtensionData(VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME, &amd_gpu_shader_half_float)}, + {ExtensionData(VK_AMD_GPU_SHADER_INT16_EXTENSION_NAME, &amd_gpu_shader_int16)}, + {ExtensionData(VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME, &amd_negative_viewport_height)}, + {ExtensionData(VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME, &amd_rasterization_order)}, + {ExtensionData(VK_AMD_SHADER_BALLOT_EXTENSION_NAME, &amd_shader_ballot)}, + {ExtensionData("VK_AMD_shader_core_properties", &amd_shader_core_properties)}, + {ExtensionData(VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME, &amd_shader_explicit_vertex_parameter)}, + {ExtensionData(VK_AMD_SHADER_FRAGMENT_MASK_EXTENSION_NAME, &amd_shader_fragment_mask)}, + {ExtensionData(VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_EXTENSION_NAME, &amd_shader_image_load_store_lod)}, + {ExtensionData(VK_AMD_SHADER_INFO_EXTENSION_NAME, &amd_shader_info)}, + {ExtensionData(VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME, &amd_shader_trinary_minmax)}, + {ExtensionData(VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME, &amd_texture_gather_bias_lod)}, + {ExtensionData(VK_EXT_DEBUG_MARKER_EXTENSION_NAME, &ext_debug_marker)}, + {ExtensionData(VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, &ext_descriptor_indexing)}, + {ExtensionData(VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME, &ext_shader_stencil_export)}, + {ExtensionData(VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME, &ext_shader_subgroup_ballot)}, + {ExtensionData(VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME, &ext_shader_subgroup_vote)}, + {ExtensionData(VK_KHR_16BIT_STORAGE_EXTENSION_NAME, &khr_16bit_storage)}, + {ExtensionData(VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME, &khr_descriptor_update_template)}, + {ExtensionData(VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME, &khr_external_memory)}, + {ExtensionData(VK_KHR_MAINTENANCE1_EXTENSION_NAME, &khr_maintenance1)}, + {ExtensionData(VK_KHR_MAINTENANCE3_EXTENSION_NAME, &khr_maintenance3)}, + {ExtensionData(VK_KHR_BIND_MEMORY_2_EXTENSION_NAME, &khr_bind_memory2)}, + {ExtensionData(VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_EXTENSION_NAME, &khr_storage_buffer_storage_class)}, + {ExtensionData(VK_KHR_SWAPCHAIN_EXTENSION_NAME, &khr_swapchain)}, + }; + + values_by_extension_names = in_values_by_extension_names; + + for (const auto& current_extension_data : recognized_extensions) + { + auto extension_iterator = in_values_by_extension_names.find(current_extension_data.name); + + if (extension_iterator != in_values_by_extension_names.end() ) + { + *current_extension_data.out_result_ptr = extension_iterator->second; + } + else + { + *current_extension_data.out_result_ptr = in_unspecified_extension_name_value; + values_by_extension_names[current_extension_data.name] = in_unspecified_extension_name_value; + } + } + } + + }; + + template + struct InstanceExtensions + { + ValueType khr_external_memory_capabilities; + ValueType khr_get_physical_device_properties2; + ValueType khr_surface; + + #ifdef _WIN32 + ValueType khr_win32_surface; + #else + ValueType khr_xcb_surface; + #endif + + std::map values_by_extension_names; + + + InstanceExtensions(const std::map& in_values_by_extension_names, + const ValueType& in_unspecified_extension_name_value) + { + typedef struct ExtensionData + { + const char* name; + ValueType* out_result_ptr; + + ExtensionData(const char* in_name, + ValueType* in_out_result_ptr) + :name (in_name), + out_result_ptr(in_out_result_ptr) + { + /* Stub */ + } + } ExtensionData; + + std::vector recognized_extensions = + { + {ExtensionData(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME, &khr_external_memory_capabilities)}, + {ExtensionData(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, &khr_get_physical_device_properties2)}, + {ExtensionData(VK_KHR_SURFACE_EXTENSION_NAME, &khr_surface)}, + + #ifdef _WIN32 + {ExtensionData(VK_KHR_WIN32_SURFACE_EXTENSION_NAME, &khr_win32_surface)}, + #else + {ExtensionData(VK_KHR_XCB_SURFACE_EXTENSION_NAME, &khr_xcb_surface)}, + #endif + }; + + values_by_extension_names = in_values_by_extension_names; + + for (const auto& current_extension_data : recognized_extensions) + { + auto extension_iterator = in_values_by_extension_names.find(current_extension_data.name); + + if (extension_iterator != in_values_by_extension_names.end() ) + { + *current_extension_data.out_result_ptr = extension_iterator->second; + } + else + { + *current_extension_data.out_result_ptr = in_unspecified_extension_name_value; + values_by_extension_names[current_extension_data.name] = in_unspecified_extension_name_value; + } + } + } + }; + }; + + template + class IExtensionInfoDevice + { + public: + virtual ~IExtensionInfoDevice() + { + /* Stub */ + } + + virtual ValueType amd_draw_indirect_count () const = 0; + virtual ValueType amd_gcn_shader () const = 0; + virtual ValueType amd_gpu_shader_half_float () const = 0; + virtual ValueType amd_gpu_shader_int16 () const = 0; + virtual ValueType amd_negative_viewport_height () const = 0; + virtual ValueType amd_rasterization_order () const = 0; + virtual ValueType amd_shader_ballot () const = 0; + virtual ValueType amd_shader_core_properties () const = 0; + virtual ValueType amd_shader_explicit_vertex_parameter() const = 0; + virtual ValueType amd_shader_fragment_mask () const = 0; + virtual ValueType amd_shader_image_load_store_lod () const = 0; + virtual ValueType amd_shader_info () const = 0; + virtual ValueType amd_shader_trinary_minmax () const = 0; + virtual ValueType amd_texture_gather_bias_lod () const = 0; + virtual ValueType ext_debug_marker () const = 0; + virtual ValueType ext_descriptor_indexing () const = 0; + virtual ValueType ext_shader_stencil_export () const = 0; + virtual ValueType ext_shader_subgroup_ballot () const = 0; + virtual ValueType ext_shader_subgroup_vote () const = 0; + virtual ValueType khr_16bit_storage () const = 0; + virtual ValueType khr_bind_memory2 () const = 0; + virtual ValueType khr_descriptor_update_template () const = 0; + virtual ValueType khr_external_memory () const = 0; + virtual ValueType khr_maintenance1 () const = 0; + virtual ValueType khr_maintenance3 () const = 0; + virtual ValueType khr_storage_buffer_storage_class () const = 0; + virtual ValueType khr_swapchain () const = 0; + + virtual ValueType by_name(const std::string& in_name) const = 0; + }; + + template + class IExtensionInfoInstance + { + public: + virtual ~IExtensionInfoInstance() + { + /* Stub */ + } + + virtual bool khr_external_memory_capabilities () const = 0; + virtual bool khr_get_physical_device_properties2() const = 0; + virtual bool khr_surface () const = 0; + + #ifdef _WIN32 + virtual bool khr_win32_surface() const = 0; + #else + virtual bool khr_xcb_surface() const = 0; + #endif + + virtual bool by_name(const std::string& in_name) const = 0; + }; + + template + class ExtensionInfo : private IExtensionInfoDevice, + private IExtensionInfoInstance + { + public: + /* Public functions */ + static std::unique_ptr > create_device_extension_info(const std::map& in_values_by_extension_names, + const ValueType& in_unspecified_extension_name_value) + { + std::unique_ptr > result_ptr; + + result_ptr.reset( + new ExtensionInfo(true, /* in_device_extensions */ + in_values_by_extension_names, + in_unspecified_extension_name_value) + ); + + return result_ptr; + } + + static std::unique_ptr create_instance_extension_info(const std::map& in_values_by_extension_names, + const ValueType& in_unspecified_extension_name_value) + { + std::unique_ptr > result_ptr; + + result_ptr.reset( + new ExtensionInfo(false, /* in_device_extensions */ + in_values_by_extension_names, + in_unspecified_extension_name_value) + ); + + return result_ptr; + } + + const IExtensionInfoDevice* get_device_extension_info() const + { + anvil_assert(m_expose_device_extensions); + + return this; + } + + const IExtensionInfoInstance* get_instance_extension_info() const + { + anvil_assert(!m_expose_device_extensions); + + return this; + } + + private: + /* Private functions */ + + ExtensionInfo(const bool& in_device_extensions, + const std::map& in_values_by_extension_names, + const ValueType& in_unspecified_extension_name_value) + :m_expose_device_extensions(in_device_extensions) + { + if (in_device_extensions) + { + m_device_extensions_ptr.reset( + new Internal::DeviceExtensions(in_values_by_extension_names, + in_unspecified_extension_name_value) + ); + } + else + { + m_instance_extensions_ptr.reset( + new Internal::InstanceExtensions(in_values_by_extension_names, + in_unspecified_extension_name_value) + ); + } + /* Stub */ + } + + ValueType by_name(const std::string& in_name) const final + { + if (m_expose_device_extensions) + { + return m_device_extensions_ptr->values_by_extension_names.at(in_name); + } + else + { + return m_instance_extensions_ptr->values_by_extension_names.at(in_name); + } + } + + /* IExtensionInfoDevice */ + + ValueType amd_draw_indirect_count() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->amd_draw_indirect_count; + } + + ValueType amd_gcn_shader() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->amd_gcn_shader; + } + + ValueType amd_gpu_shader_half_float() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->amd_gpu_shader_half_float; + } + + ValueType amd_gpu_shader_int16() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->amd_gpu_shader_int16; + } + + ValueType amd_negative_viewport_height() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->amd_negative_viewport_height; + } + + ValueType amd_rasterization_order() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->amd_rasterization_order; + } + + ValueType amd_shader_ballot() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->amd_shader_ballot; + } + + ValueType amd_shader_explicit_vertex_parameter() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->amd_shader_explicit_vertex_parameter; + } + + ValueType amd_shader_fragment_mask() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->amd_shader_fragment_mask; + } + + ValueType amd_shader_image_load_store_lod() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->amd_shader_image_load_store_lod; + } + + ValueType amd_shader_core_properties() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->amd_shader_core_properties; + } + + ValueType amd_shader_info() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->amd_shader_info; + } + + ValueType amd_shader_trinary_minmax() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->amd_shader_trinary_minmax; + } + + ValueType amd_texture_gather_bias_lod() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->amd_texture_gather_bias_lod; + } + + ValueType ext_debug_marker() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_debug_marker; + } + + ValueType ext_descriptor_indexing() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_descriptor_indexing; + } + + ValueType ext_shader_stencil_export() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_shader_stencil_export; + } + + ValueType ext_shader_subgroup_ballot() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_shader_subgroup_ballot; + } + + ValueType ext_shader_subgroup_vote() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_shader_subgroup_vote; + } + + ValueType khr_16bit_storage() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_16bit_storage; + } + + ValueType khr_bind_memory2() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_bind_memory2; + } + + ValueType khr_descriptor_update_template() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_descriptor_update_template; + } + + ValueType khr_external_memory() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_external_memory; + } + + ValueType khr_maintenance1() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_maintenance1; + } + + ValueType khr_maintenance3() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_maintenance3; + } + + ValueType khr_storage_buffer_storage_class() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_storage_buffer_storage_class; + } + + ValueType khr_swapchain() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_swapchain; + } + + /* IExtensionInfoInstance */ + + ValueType khr_external_memory_capabilities() const final + { + anvil_assert(!m_expose_device_extensions); + + return m_instance_extensions_ptr->khr_external_memory_capabilities; + } + + ValueType khr_get_physical_device_properties2() const final + { + anvil_assert(!m_expose_device_extensions); + + return m_instance_extensions_ptr->khr_get_physical_device_properties2; + } + + ValueType khr_surface() const final + { + anvil_assert(!m_expose_device_extensions); + + return m_instance_extensions_ptr->khr_surface; + } + + + #ifdef _WIN32 + ValueType khr_win32_surface() const final + { + anvil_assert(!m_expose_device_extensions); + + return m_instance_extensions_ptr->khr_win32_surface; + } + #else + ValueType khr_xcb_surface() const final + { + anvil_assert(!m_expose_device_extensions); + + return m_instance_extensions_ptr->khr_xcb_surface; + } + #endif + + /* Private variables */ + + std::unique_ptr > m_device_extensions_ptr; + bool m_expose_device_extensions; + std::unique_ptr > m_instance_extensions_ptr; + }; + + /** A struct which tells which extensions must (or should, if supported by the physical device) be enabled + * at device creation time. + */ + typedef struct DeviceExtensionConfiguration + { + DeviceExtensionConfiguration() + { + /* NOTE: By default, Anvil enables all extensions it has support implemented for, which are reported + * as available. + */ + { + Internal::DeviceExtensions reference(std::map(), + false); /* in_unspecified_extension_name_value */ + + for (const auto& current_extension_data : reference.values_by_extension_names) + { + extension_status[current_extension_data.first] = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; + } + } + + /* + * A few exceptions exist. + * + * 1. VK_AMD_negative_viewport_height interacts with KHR_maintenance1, apps will have to enable it manually. */ + extension_status[VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME] = EXTENSION_AVAILABILITY_IGNORE; + + /* 2. VK_EXT_debug_marker is only useful for debugging. */ + #if !defined(_DEBUG) + { + extension_status[VK_EXT_DEBUG_MARKER_EXTENSION_NAME] = EXTENSION_AVAILABILITY_IGNORE; + } + #endif + } + + std::map extension_status; + + bool operator==(const DeviceExtensionConfiguration& in_config) const + { + return (extension_status == in_config.extension_status); + } + } DeviceExtensionConfiguration; +}; + +#endif /* MISC_EXTENSIONS_H */ \ No newline at end of file diff --git a/include/misc/fence_create_info.h b/include/misc/fence_create_info.h new file mode 100644 index 00000000..d10b5739 --- /dev/null +++ b/include/misc/fence_create_info.h @@ -0,0 +1,91 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef MISC_FENCE_CREATE_INFO_H +#define MISC_FENCE_CREATE_INFO_H + +#include "misc/types.h" + +namespace Anvil +{ + class FenceCreateInfo + { + public: + /* Public functions */ + + /* TODO. + * + * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: + * + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + */ + static Anvil::FenceCreateInfoUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + bool in_create_signalled); + + const Anvil::BaseDevice* get_device() const + { + return m_device_ptr; + } + + const MTSafety& get_mt_safety() const + { + return m_mt_safety; + } + + const bool& should_create_signalled() const + { + return m_create_signalled; + } + + + void set_device(const Anvil::BaseDevice* in_device_ptr) + { + m_device_ptr = in_device_ptr; + } + + void set_mt_safety(const MTSafety& in_mt_safety) + { + m_mt_safety = in_mt_safety; + } + + void set_should_create_signalled(const bool& in_create_signalled) + { + m_create_signalled = in_create_signalled; + } + + private: + /* Private functions */ + FenceCreateInfo(const Anvil::BaseDevice* in_device_ptr, + bool in_create_signalled, + MTSafety in_mt_safety); + + /* Private variables */ + bool m_create_signalled; + const Anvil::BaseDevice* m_device_ptr; + Anvil::MTSafety m_mt_safety; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(FenceCreateInfo); + ANVIL_DISABLE_COPY_CONSTRUCTOR(FenceCreateInfo); + }; + +}; /* namespace Anvil */ + +#endif /* MISC_FENCE_CREATE_INFO_H */ \ No newline at end of file diff --git a/include/misc/formats.h b/include/misc/formats.h index ad81b672..adc5d460 100644 --- a/include/misc/formats.h +++ b/include/misc/formats.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -112,6 +112,7 @@ namespace Anvil /** Tells whether @param in_format format is a block format. */ static bool is_format_compressed(VkFormat in_format); + }; }; diff --git a/include/misc/fp16.h b/include/misc/fp16.h index c30d4799..eb34d7d5 100644 --- a/include/misc/fp16.h +++ b/include/misc/fp16.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/misc/framebuffer_create_info.h b/include/misc/framebuffer_create_info.h new file mode 100644 index 00000000..f7263d63 --- /dev/null +++ b/include/misc/framebuffer_create_info.h @@ -0,0 +1,184 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef MISC_FRAMEBUFFER_CREATE_INFO_H +#define MISC_FRAMEBUFFER_CREATE_INFO_H + +#include "misc/types.h" + + +namespace Anvil +{ + class FramebufferCreateInfo + { + public: + /* Public functions */ + + /* TODO. + * + * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: + * + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + */ + static Anvil::FramebufferCreateInfoUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + const uint32_t& in_width, + const uint32_t& in_height, + const uint32_t& in_n_layers); + + bool add_attachment(ImageView* in_image_view_ptr, + FramebufferAttachmentID* out_opt_attachment_id_ptr); + + /* Returns an attachment at user-specified index */ + bool get_attachment_at_index(uint32_t in_attachment_index, + ImageView** out_image_view_ptr_ptr) const; + + /** Checks if an attachment has already been created for the specified image view and, if so, + * returns the attachment's ID. + * + * @param in_image_view_ptr Image view to use for the query. Must not be nullptr. + * @param out_attachment_id_ptr If the function executes successfully, deref will be set to + * the found attachment's ID, in which case the pointer must not + * be nullptr. Otherwise, ignored. + * + * @return true if successful (eg. the attachment corresponding to the specified image view was + * found), false otherwise. + **/ + bool get_attachment_id_for_image_view(ImageView* in_image_view_ptr, + FramebufferAttachmentID* out_attachment_id_ptr) const; + + const Anvil::BaseDevice* get_device() const + { + return m_device_ptr; + } + + uint32_t get_height() const + { + return m_height; + } + + Anvil::MTSafety get_mt_safety() const + { + return m_mt_safety; + } + + /** Returns the number of attachments defined for the framebuffer. */ + uint32_t get_n_attachments() const + { + return static_cast(m_attachments.size() ); + } + + uint32_t get_n_layers() const + { + return m_n_layers; + } + + /** Returns framebuffer size, specified at creation time */ + void get_size(uint32_t* out_framebuffer_width_ptr, + uint32_t* out_framebuffer_height_ptr, + uint32_t* out_framebuffer_depth_ptr) const; + + uint32_t get_width() const + { + return m_width; + } + + void set_device(const Anvil::BaseDevice* in_device_ptr) + { + m_device_ptr = in_device_ptr; + } + + void set_height(const uint32_t& in_height) + { + m_height = in_height; + } + + void set_mt_safety(const Anvil::MTSafety& in_mt_safety) + { + m_mt_safety = in_mt_safety; + } + + void set_n_layers(const uint32_t& in_n_layers) + { + m_n_layers = in_n_layers; + } + + void set_width(const uint32_t& in_width) + { + m_width = in_width; + } + + private: + /* Private type definitions */ + + typedef struct FramebufferAttachment + { + ImageView* image_view_ptr; + + /** Constructor. Retains the input image view instance. + * + * @param in_image_view_ptr Image view instance to use for the FB attachment. Must not + * be nullptr. + **/ + FramebufferAttachment(ImageView* in_image_view_ptr); + + /** Destructor. Releases the encapsulated image view instance. */ + ~FramebufferAttachment(); + + /** Copy constructor */ + FramebufferAttachment(const FramebufferAttachment& in); + + /** Assignment operator */ + FramebufferAttachment& operator=(const FramebufferAttachment& in); + + /** Returns true if the encapsulated image view instance is the same as the one + * specified uner @param in_image_view_ptr argument. + **/ + bool operator==(const ImageView* in_image_view_ptr) const + { + return (image_view_ptr == in_image_view_ptr); + } + } FramebufferAttachment; + + typedef std::vector FramebufferAttachments; + + /* Private functions */ + + FramebufferCreateInfo(const Anvil::BaseDevice* in_device_ptr, + const uint32_t& in_width, + const uint32_t& in_height, + const uint32_t& in_n_layers, + MTSafety in_mt_safety); + + /* Private variables */ + FramebufferAttachments m_attachments; + + const Anvil::BaseDevice* m_device_ptr; + uint32_t m_height; + MTSafety m_mt_safety; + uint32_t m_n_layers; + uint32_t m_width; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(FramebufferCreateInfo); + ANVIL_DISABLE_COPY_CONSTRUCTOR(FramebufferCreateInfo); + }; +}; /* namespace Anvil */ + +#endif /* MISC_FRAMEBUFFER_CREATE_INFO_H */ \ No newline at end of file diff --git a/include/misc/glsl_to_spirv.h b/include/misc/glsl_to_spirv.h index 1c6c759a..30c77466 100644 --- a/include/misc/glsl_to_spirv.h +++ b/include/misc/glsl_to_spirv.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -227,6 +227,11 @@ namespace Anvil std::string get_extension_behavior_glsl_code(const ExtensionBehavior& in_value) const; #ifdef ANVIL_LINK_WITH_GLSLANG + const std::string& get_debug_info_log() const + { + return m_debug_info_log; + } + /** Returns info log which contains detailed information regarding the program linking process. * * Call if get_spirv_blob() returns nullptr to find out more about shader issues which @@ -288,15 +293,10 @@ namespace Anvil { if (m_spirv_blob.size() == 0) { - bool result = bake_spirv_blob(); - - ANVIL_REDUNDANT_VARIABLE(result); - - anvil_assert(result); - anvil_assert(m_spirv_blob.size() != 0); + bake_spirv_blob(); } - return &m_spirv_blob.at(0); + return (m_spirv_blob.size() != 0) ? &m_spirv_blob.at(0) : nullptr; } /** Returns the number of bytes the SPIR-V blob, accessible via get_spirv_blob(), takes. */ @@ -304,16 +304,9 @@ namespace Anvil { if (m_spirv_blob.size() == 0) { - bool result = bake_spirv_blob(); - - ANVIL_REDUNDANT_VARIABLE(result); - - anvil_assert(result); - anvil_assert(m_spirv_blob.size() != 0); + bake_spirv_blob(); } - anvil_assert(m_spirv_blob.size() > 0); - return static_cast(m_spirv_blob.size() ); } @@ -344,6 +337,7 @@ namespace Anvil /* Private members */ #ifdef ANVIL_LINK_WITH_GLSLANG + mutable std::string m_debug_info_log; std::unique_ptr m_limits_ptr; mutable std::string m_program_info_log; mutable std::string m_shader_info_log; diff --git a/include/misc/graphics_pipeline_info.h b/include/misc/graphics_pipeline_create_info.h similarity index 95% rename from include/misc/graphics_pipeline_info.h rename to include/misc/graphics_pipeline_create_info.h index 432b3131..f6bc9196 100644 --- a/include/misc/graphics_pipeline_info.h +++ b/include/misc/graphics_pipeline_create_info.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -19,41 +19,41 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // -#ifndef ANVIL_GRAPHICS_PIPELINE_INFO_H -#define ANVIL_GRAPHICS_PIPELINE_INFO_H +#ifndef ANVIL_GRAPHICS_PIPELINE_CREATE_INFO_H +#define ANVIL_GRAPHICS_PIPELINE_CREATE_INFO_H -#include "misc/base_pipeline_info.h" +#include "misc/base_pipeline_create_info.h" namespace Anvil { - class GraphicsPipelineInfo : public BasePipelineInfo + class GraphicsPipelineCreateInfo : public BasePipelineCreateInfo { public: /* Public functions */ - static Anvil::GraphicsPipelineInfoUniquePtr create_derivative_pipeline_info(bool in_disable_optimizations, - bool in_allow_derivatives, - const RenderPass* in_renderpass_ptr, - SubPassID in_subpass_id, - const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, - Anvil::PipelineID in_base_pipeline_id); - static Anvil::GraphicsPipelineInfoUniquePtr create_proxy_pipeline_info (); - static Anvil::GraphicsPipelineInfoUniquePtr create_regular_pipeline_info (bool in_disable_optimizations, - bool in_allow_derivatives, - const RenderPass* in_renderpass_ptr, - SubPassID in_subpass_id, - const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, - const Anvil::GraphicsPipelineInfo* in_opt_reference_pipeline_info_ptr = nullptr); - - ~GraphicsPipelineInfo(); + static Anvil::GraphicsPipelineCreateInfoUniquePtr create_derivative(bool in_disable_optimizations, + bool in_allow_derivatives, + const RenderPass* in_renderpass_ptr, + SubPassID in_subpass_id, + const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, + Anvil::PipelineID in_base_pipeline_id); + static Anvil::GraphicsPipelineCreateInfoUniquePtr create_proxy(); + static Anvil::GraphicsPipelineCreateInfoUniquePtr create_regular(bool in_disable_optimizations, + bool in_allow_derivatives, + const RenderPass* in_renderpass_ptr, + SubPassID in_subpass_id, + const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, + const Anvil::GraphicsPipelineCreateInfo* in_opt_reference_pipeline_create_info_ptr = nullptr); + + ~GraphicsPipelineCreateInfo(); /** Adds a new specialization constant. * @@ -86,10 +86,10 @@ namespace Anvil return false; } - return BasePipelineInfo::add_specialization_constant(in_shader_stage, - in_constant_id, - in_n_data_bytes, - in_data_ptr); + return BasePipelineCreateInfo::add_specialization_constant(in_shader_stage, + in_constant_id, + in_n_data_bytes, + in_data_ptr); } /** Adds a new vertex attribute descriptor to the specified graphics pipeline. This data will be used @@ -883,10 +883,10 @@ namespace Anvil typedef std::map InternalViewports; /* Private functions */ - explicit GraphicsPipelineInfo(const RenderPass* in_renderpass_ptr, - SubPassID in_subpass_id); + explicit GraphicsPipelineCreateInfo(const RenderPass* in_renderpass_ptr, + SubPassID in_subpass_id); - bool copy_gfx_state_from(const Anvil::GraphicsPipelineInfo* in_src_pipeline_info_ptr); + bool copy_gfx_state_from(const Anvil::GraphicsPipelineCreateInfo* in_src_pipeline_create_info_ptr); /* Private variables */ bool m_depth_bounds_test_enabled; @@ -944,4 +944,4 @@ namespace Anvil }; -#endif /* ANVIL_GRAPHICS_PIPELINE_INFO_H */ +#endif /* ANVIL_GRAPHICS_PIPELINE_CREATE_INFO_H */ diff --git a/include/misc/image_create_info.h b/include/misc/image_create_info.h new file mode 100644 index 00000000..4cdf1f32 --- /dev/null +++ b/include/misc/image_create_info.h @@ -0,0 +1,530 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#ifndef MISC_IMAGE_CREATE_INFO_H +#define MISC_IMAGE_CREATE_INFO_H + +#include "misc/types.h" + +namespace Anvil +{ + class ImageCreateInfo + { + public: + /* Public functions */ + + void clear_mipmaps_to_upload() + { + m_mipmaps_to_upload.clear(); + } + + /** Returns an instance of the "create info" item which can be used to instantiate a new non-sparse Image + * instance *WITH* a memory backing. + * + * This constructor assumes the image should be initialized in UNDEFINED layout, if no mipmap data + * is specified, or PREINITIALIZED otherwise. In the latter case, it will then proceed with filling + * the storage with mipmap data (if @param in_mipmaps_ptr is not nullptr), and finally transition + * the image to the @param in_post_create_image_layout layout. + * + * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: + * + * - External memory handle types: none + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * + * @param in_device_ptr Device to use. + * @param in_type Vulkan image type to use. + * @param in_format Vulkan format to use. + * @param in_tiling Vulkan image tiling to use. + * @param in_usage Vulkan image usage pattern to use. + * @param in_base_mipmap_width Width of the base mip-map. + * @param in_base_mipmap_height Height of the base mip-map. Must be at least 1 for all image types. + * @param in_base_mipmap_depth Depth of the base mip-map. Must be at least 1 for all image types. + * @param in_n_layers Number of layers to use. Must be at least 1 for all image types. + * @param in_sample_count Sample count to use. + * @param in_queue_families A combination of Anvil::QUEUE_FAMILY_* bits, indicating which device queues + * the image is going to be accessed by. + * @param in_sharing_mode Vulkan sharing mode to use. + * @param in_use_full_mipmap_chain true if all mipmaps should be created for the image. False to only allocate + * storage for the base mip-map. + * @param in_memory_features Memory features for the memory backing. + * @param in_create_flags Optional image features that the created image should support. + * @param in_post_alloc_image_layout Image layout to transfer the image to after it is created, assigned memory, + * and optionally uploaded mip data (if @param in_opt_mipmaps_ptr is not null). + * @param in_opt_mipmaps_ptr If not nullptr, specified MipmapRawData items will be used to drive the mipmap contents + * initialization process. Ignored if nullptr. + * Specifying a non-NULL in_opt_mipmaps_ptr argument will make the function OR + * @param in_usage with VK_IMAGE_USAGE_TRANSFER_DST_BIT. + * + * @return New image instance, if successful, or nullptr otherwise. + **/ + static ImageCreateInfoUniquePtr create_nonsparse_alloc(const Anvil::BaseDevice* in_device_ptr, + VkImageType in_type, + VkFormat in_format, + VkImageTiling in_tiling, + VkImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + VkSampleCountFlagBits in_sample_count, + Anvil::QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + bool in_use_full_mipmap_chain, + MemoryFeatureFlags in_memory_features, + ImageCreateFlags in_create_flags, + VkImageLayout in_post_alloc_image_layout, + const std::vector* in_opt_mipmaps_ptr = nullptr); + + /** Returns an instance of the "create info" item which can be used to instantiate a new non-sparse Image + * instance *without* a memory backing. A memory region should be bound to the object by calling + * Image::set_memory() before using the object for any operations. + * + * The function can also optionally fill the image with data, as soon as memory backing is + * attached. To make it do so, pass a non-null ptr to a MipmapRawData vector via the @param + * mipmaps_ptr argument. + * + * If this constructor is used, the image can be transformed automatically to the right layout + * at set_memory() call time by setting @param in_final_image_layout argument to a value other + * than VK_IMAGE_LAYOUT_UNDEFINED and VK_IMAGE_LAYOUT_PREINITIALIZED. + * + * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: + * + * - External memory handle types: none + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * + * @param in_device_ptr Device to use. + * @param in_type Vulkan image type to use. + * @param in_format Vulkan format to use. + * @param in_tiling Vulkan image tiling to use. + * @param in_usage Vulkan image usage pattern to use. + * @param in_base_mipmap_width Width of the base mip-map. + * @param in_base_mipmap_height Height of the base mip-map. Must be at least 1 for all image types. + * @param in_base_mipmap_depth Depth of the base mip-map. Must be at least 1 for all image types. + * @param in_n_layers Number of layers to use. Must be at least 1 for all image types. + * @param in_sample_count Sample count to use. + * @param in_queue_families A combination of Anvil::QUEUE_FAMILY_* bits, indicating which device queues + * the image is going to be accessed by. + * @param in_sharing_mode Vulkan sharing mode to use. + * @param in_use_full_mipmap_chain true, if all mipmaps should be created for the image. False to only allocate + * storage for the base mip-map. + * @param in_create_flags Optional image features that the created image should support. + * @param in_post_alloc_image_layout Image layout to transfer the image to after it is created, assigned memory, + * and optionally uploaded mip data (if @param in_opt_mipmaps_ptr is not null). + * @param in_opt_mipmaps_ptr If not NULL, specified data will be used to initialize created image's mipmaps + * with content, as soon as the image is assigned a memory backing. + * Specifying a non-NULL @param in_opt_mipmaps_ptr argument will make the function OR + * @param in_usage with VK_IMAGE_USAGE_TRANSFER_DST_BIT. + * + * @return New image instance, if successful, or nullptr otherwise. + **/ + static ImageCreateInfoUniquePtr create_nonsparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, + VkImageType in_type, + VkFormat in_format, + VkImageTiling in_tiling, + VkImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + VkSampleCountFlagBits in_sample_count, + Anvil::QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + bool in_use_full_mipmap_chain, + ImageCreateFlags in_create_flags, + VkImageLayout in_post_alloc_image_layout, + const std::vector* in_opt_mipmaps_ptr = nullptr); + + /** Returns an instance of the "create info" item which can be used to instantiate a new sparse Image + * instance *without* a physical memory backing. + * + * Memory region(s) should be bound to the object by calling Image::set_memory_block() before using the object + * for any operations. Whether or not all tiles need to be assigned memory blocks prior to accessing + * image contents depends on whether sparse binding or sparse residency has been requested at + * creation time. + * + * If NONALIASED or ALIASED residency is requested and the device does not support requested image + * configuration, a NULL image will be returned. + * + * User must manually configure sparse bindings for the image by using Queue::bind_sparse_memory(), + * before uploading any mip data. The mips can be uploaded using upload_mipmaps(). + * + * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: + * + * - External memory handle types: none + * - Initial layout: VK_IMAGE_LAYOUT_UNDEFINED + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * + * @param in_device_ptr Device to use. + * @param in_type Vulkan image type to use. + * @param in_format Vulkan format to use. + * @param in_tiling Vulkan image tiling to use. + * @param in_usage Vulkan image usage pattern to use. + * @param in_base_mipmap_width Width of the base mip-map. Must be at least 1 for all image types. + * @param in_base_mipmap_height Height of the base mip-map. Must be at least 1 for all image types. + * @param in_base_mipmap_depth Depth of the base mip-map. Must be at least 1 for all image types. + * @param in_n_layers Number of layers to use. Must be at least 1 for all image types. + * @param in_sample_count Sample count to use. + * @param in_queue_families A combination of Anvil::QUEUE_FAMILY_* bits, indicating which device queues + * the image is going to be accessed by. + * @param in_sharing_mode Vulkan sharing mode to use. + * @param in_use_full_mipmap_chain true, if all mipmaps should be created for the image. False to make the image + * only use one mip. + * @param in_create_flags Optional image features that the created image should support. + * @param in_sparse_residency_scope Scope of sparse residency to request for the image. + * @param in_initial_layout Initial layout to use for the image. Must either be VK_IMAGE_LAYOUT_UNDEFINED or + * VK_IMAGE_LAYOUT_PREINITIALIZED. + * + * @return New image instance, if successful, or nullptr otherwise. + **/ + static ImageCreateInfoUniquePtr create_sparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, + VkImageType in_type, + VkFormat in_format, + VkImageTiling in_tiling, + VkImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + VkSampleCountFlagBits in_sample_count, + Anvil::QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + bool in_use_full_mipmap_chain, + ImageCreateFlags in_create_flags, + Anvil::SparseResidencyScope in_residency_scope); + + /** Returns an instance of the "create info" item which can be used to instantiate a special type of an Image, + * useful for embedding a swapchain image instance. Object instantiated with this create item will NOT + * release the specified VkImage instance at its tear-down time. + * + * The image will NOT be transitioned to any specific image layout. + * + * For argument discussion, see specification of the other create() functions. + * + * + * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: + * + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + **/ + static ImageCreateInfoUniquePtr create_swapchain_wrapper(const Anvil::BaseDevice* in_device_ptr, + const Anvil::Swapchain* in_swapchain_ptr, + const VkImage& in_image, + const uint32_t& in_n_swapchain_image); + + const uint32_t& get_base_mip_depth() const + { + return m_depth; + } + + const uint32_t& get_base_mip_height() const + { + return m_height; + } + + const uint32_t& get_base_mip_width() const + { + return m_width; + } + + const Anvil::ImageCreateFlags& get_create_flags() const + { + return m_create_flags; + } + + const Anvil::BaseDevice* get_device() const + { + return m_device_ptr; + } + + const Anvil::ExternalMemoryHandleTypeFlags& get_external_memory_handle_types() const + { + return m_external_memory_handle_types; + } + + const VkFormat& get_format() const + { + return m_format; + } + + const Anvil::MemoryFeatureFlags& get_memory_features() const + { + return m_memory_features; + } + + /* NOTE: This func is a const since it should only be accessed by Anvil::Image. */ + const std::vector& get_mipmaps_to_upload() + { + return m_mipmaps_to_upload; + } + + const Anvil::MTSafety& get_mt_safety() const + { + return m_mt_safety; + } + + const uint32_t& get_n_layers() const + { + return m_n_layers; + } + + const VkImageLayout& get_post_alloc_image_layout() const + { + return m_post_alloc_layout; + } + + const VkImageLayout& get_post_create_image_layout() const + { + return m_post_create_layout; + } + + /** Returns queue families compatible with the image */ + const Anvil::QueueFamilyBits& get_queue_families() const + { + return m_queue_families; + } + + VkSampleCountFlagBits get_sample_count() const + { + return static_cast(m_sample_count); + } + + const SparseResidencyScope& get_residency_scope() const + { + return m_residency_scope; + } + + const VkSharingMode& get_sharing_mode() const + { + return m_sharing_mode; + } + + const Anvil::Swapchain* get_swapchain() const + { + anvil_assert(m_type == Anvil::ImageType::SWAPCHAIN_WRAPPER); + + return m_swapchain_ptr; + } + + const VkImage& get_swapchain_image() const + { + anvil_assert(m_type == Anvil::ImageType::SWAPCHAIN_WRAPPER); + + return m_swapchain_image; + } + + const uint32_t& get_swapchain_image_index() const + { + anvil_assert(m_type == Anvil::ImageType::SWAPCHAIN_WRAPPER); + + return m_n_swapchain_image; + } + + /** Returns image tiling */ + const VkImageTiling& get_tiling() const + { + return m_tiling; + } + + const Anvil::ImageType& get_type() const + { + return m_type; + } + + const VkImageType& get_type_vk() const + { + return m_type_vk; + } + + const VkImageUsageFlags& get_usage_flags() const + { + return m_usage_flags; + } + + /** Tells whether this Image wrapper instance holds a sparse image */ + bool is_sparse() const + { + return (m_type == Anvil::ImageType::SPARSE_NO_ALLOC); + } + + //- + void set_create_flags(const Anvil::ImageCreateFlags& in_create_flags) + { + m_create_flags = in_create_flags; + } + + void set_depth(const uint32_t& in_depth) + { + m_depth = in_depth; + } + + void set_external_memory_handle_types(const ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) + { + m_external_memory_handle_types = in_external_memory_handle_types; + } + + void set_format(const VkFormat& in_format) + { + m_format = in_format; + } + + void set_height(const uint32_t& in_height) + { + m_height = in_height; + } + + void set_memory_features(const Anvil::MemoryFeatureFlags& in_memory_features) + { + m_memory_features = in_memory_features; + } + + void set_mipmaps_to_upload(const std::vector& in_mipmaps_to_upload) + { + m_mipmaps_to_upload = in_mipmaps_to_upload; + } + + void set_mt_safety(const Anvil::MTSafety& in_mt_safety) + { + m_mt_safety = in_mt_safety; + } + + void set_n_layers(const uint32_t& in_n_layers) + { + m_n_layers = in_n_layers; + } + + void set_post_alloc_layout(const VkImageLayout& in_post_alloc_layout) + { + m_post_alloc_layout = in_post_alloc_layout; + } + + void set_post_create_layout(const VkImageLayout& in_post_create_layout) + { + m_post_create_layout = in_post_create_layout; + } + + void set_queue_families(const Anvil::QueueFamilyBits& in_queue_families) + { + m_queue_families = in_queue_families; + } + + void set_residency_scope(const Anvil::SparseResidencyScope& in_residency_scope) + { + m_residency_scope = in_residency_scope; + } + + void set_sample_count(const VkSampleCountFlags& in_sample_count) + { + m_sample_count = in_sample_count; + } + + void set_sharing_mode(const VkSharingMode& in_sharing_mode) + { + m_sharing_mode = in_sharing_mode; + } + + void set_tiling(const VkImageTiling& in_tiling) + { + m_tiling = in_tiling; + } + + void set_usage_flags(const VkImageUsageFlags& in_usage_flags) + { + m_usage_flags = in_usage_flags; + } + + void set_uses_full_mipmap_chain(const bool& in_use_full_mipmap_chain) + { + m_use_full_mipmap_chain = in_use_full_mipmap_chain; + } + + void set_width(const uint32_t& in_width) + { + m_width = in_width; + } + + const bool& uses_full_mipmap_chain() const + { + return m_use_full_mipmap_chain; + } + + private: + /* Private functions */ + + ImageCreateInfo(Anvil::ImageType in_type, + const Anvil::BaseDevice* in_device_ptr, + VkImageType in_type_vk, + VkFormat in_format, + VkImageTiling in_tiling, + VkSharingMode in_sharing_mode, + VkImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + VkSampleCountFlagBits in_sample_count, + bool in_use_full_mipmap_chain, + ImageCreateFlags in_create_flags, + Anvil::QueueFamilyBits in_queue_families, + VkImageLayout in_post_create_image_layout, + const VkImageLayout& in_post_alloc_image_layout, + const std::vector* in_opt_mipmaps_ptr, + const Anvil::MTSafety& in_mt_safety, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types, + const Anvil::MemoryFeatureFlags& in_memory_features, + const Anvil::SparseResidencyScope& in_residency_scope); + + /* Private variables */ + + Anvil::ImageCreateFlags m_create_flags; + uint32_t m_depth; + const Anvil::BaseDevice* m_device_ptr; + Anvil::ExternalMemoryHandleTypeFlags m_external_memory_handle_types; + VkFormat m_format; + uint32_t m_height; + Anvil::MemoryFeatureFlags m_memory_features; + std::vector m_mipmaps_to_upload; + Anvil::MTSafety m_mt_safety; + uint32_t m_n_layers; + VkImageLayout m_post_alloc_layout; + VkImageLayout m_post_create_layout; + Anvil::QueueFamilyBits m_queue_families; + Anvil::SparseResidencyScope m_residency_scope; + VkSampleCountFlags m_sample_count; + VkSharingMode m_sharing_mode; + VkImageTiling m_tiling; + const Anvil::ImageType m_type; + const VkImageType m_type_vk; + VkImageUsageFlags m_usage_flags; + bool m_use_full_mipmap_chain; + uint32_t m_width; + + /* Only used for swapchain wrapper images */ + uint32_t m_n_swapchain_image; + VkImage m_swapchain_image; + const Anvil::Swapchain* m_swapchain_ptr; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(ImageCreateInfo); + ANVIL_DISABLE_COPY_CONSTRUCTOR(ImageCreateInfo); + }; + +}; /* namespace Anvil */ + +#endif /* MISC_IMAGE_CREATE_INFO_H */ \ No newline at end of file diff --git a/include/misc/image_view_create_info.h b/include/misc/image_view_create_info.h new file mode 100644 index 00000000..f24c22f8 --- /dev/null +++ b/include/misc/image_view_create_info.h @@ -0,0 +1,441 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef MISC_IMAGE_VIEW_CREATE_INFO_H +#define MISC_IMAGE_VIEW_CREATE_INFO_H + +#include "misc/types.h" + + +namespace Anvil +{ + class ImageViewCreateInfo + { + public: + /* Public functions */ + + /** Use this function if you need to create a single-sample 1D image view wrapper instance. + * + * @param in_device_ptr Device to use. + * @param in_image_ptr Image instance to create a view for. Must not be nullptr. The specified + * object will be retained and release at ImageView release time. + * @param in_n_base_layer Base layer index. + * @param in_n_base_mipmap_level Base mipmap level. + * @param in_n_mipmaps Number of mipmaps to include in the view. + * @param in_aspect_mask Image aspect mask to use when creating the Vulkan image view instance. + * @param in_format Image view format. + * @param in_swizzle_red Channel to use for the red component when sampling the view. + * @param in_swizzle_green Channel to use for the green component when sampling the view. + * @param in_swizzle_blue Channel to use for the blue component when sampling the view. + * @param in_swizzle_alpha Channel to use for the alpha component when sampling the view. + * + * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: + * + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * + * @return New ImageView instance, if function executes successfully; nullptr otherwise. + **/ + static Anvil::ImageViewCreateInfoUniquePtr create_1D(const Anvil::BaseDevice* in_device_ptr, + Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha); + + /** Use this function if you need to create a single-sample 1D array image view wrapper instance. + * + * @param in_device_ptr Device to use. + * @param in_image_ptr Image instance to create a view for. Must not be nullptr. The specified + * object will be retained and release at ImageView release time. + * @param in_n_base_layer Base layer index. + * @param in_n_layers Number of layers to include in the view. + * @param in_n_base_mipmap_level Base mipmap level. + * @param in_n_mipmaps Number of mipmaps to include in the view. + * @param in_aspect_mask Image aspect mask to use when creating the Vulkan image view instance. + * @param in_format Image view format. + * @param in_swizzle_red Channel to use for the red component when sampling the view. + * @param in_swizzle_green Channel to use for the green component when sampling the view. + * @param in_swizzle_blue Channel to use for the blue component when sampling the view. + * @param in_swizzle_alpha Channel to use for the alpha component when sampling the view. + * + * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: + * + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * + * @return New ImageView instance, if function executes successfully; nullptr otherwise. + **/ + static Anvil::ImageViewCreateInfoUniquePtr create_1D_array(const Anvil::BaseDevice* in_device_ptr, + Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_layers, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha); + + + /** Use this function if you need to create a single-sample or a multi-sample 2D image view wrapper instance. The view will be + * single-sample if @param in_image_ptr uses 1 sample per texel, and multi-sample otherwise. + * + * @param in_device_ptr Device to use + * @param in_image_ptr Image instance to create a view for. Must not be nullptr. The specified + * object will be retained and release at ImageView release time. + * @param in_n_base_layer Base layer index. + * @param in_n_base_mipmap_level Base mipmap level. + * @param in_n_mipmaps Number of mipmaps to include in the view. + * @param in_aspect_mask Image aspect mask to use when creating the Vulkan image view instance. + * @param in_format Image view format. + * @param in_swizzle_red Channel to use for the red component when sampling the view. + * @param in_swizzle_green Channel to use for the green component when sampling the view. + * @param in_swizzle_blue Channel to use for the blue component when sampling the view. + * @param in_swizzle_alpha Channel to use for the alpha component when sampling the view. + * + * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: + * + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * + * @return New ImageView instance, if function executes successfully; nullptr otherwise. + **/ + static Anvil::ImageViewCreateInfoUniquePtr create_2D(const Anvil::BaseDevice* in_device_ptr, + Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha); + + /** Use this function if you need to create a single-sample or a multi-sample 2D array image view wrapper instance. The view will be + * single-sample if @param in_image_ptr uses 1 sample per texel, and multi-sample otherwise. + * + * @param in_device_ptr Device to use. + * @param in_image_ptr Image instance to create a view for. Must not be nullptr. The specified + * object will be retained and release at ImageView release time. + * @param in_n_base_layer Base layer index. + * @param in_n_layers Number of layers to include in the view. + * @param in_n_base_mipmap_level Base mipmap level. + * @param in_n_mipmaps Number of mipmaps to include in the view. + * @param in_aspect_mask Image aspect mask to use when creating the Vulkan image view instance. + * @param in_format Image view format. + * @param in_swizzle_red Channel to use for the red component when sampling the view. + * @param in_swizzle_green Channel to use for the green component when sampling the view. + * @param in_swizzle_blue Channel to use for the blue component when sampling the view. + * @param in_swizzle_alpha Channel to use for the alpha component when sampling the view. + * + * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: + * + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * + * @return New ImageView instance, if function executes successfully; nullptr otherwise. + **/ + static Anvil::ImageViewCreateInfoUniquePtr create_2D_array(const Anvil::BaseDevice* in_device_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_layers, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha); + + /** Use this function if you need to create a single-sample 3D image view wrapper instance. + * + * @param in_device_ptr Device to use. + * @param in_image_ptr Image instance to create a view for. Must not be nullptr. The specified + * object will be retained and release at ImageView release time. + * @param in_n_base_slice Base slice index. + * @param in_n_slices Number of slices to include in the view. + * @param in_n_base_mipmap_level Base mipmap level. + * @param in_n_mipmaps Number of mipmaps to include in the view. + * @param in_aspect_mask Image aspect mask to use when creating the Vulkan image view instance. + * @param in_format Image view format. + * @param in_swizzle_red Channel to use for the red component when sampling the view. + * @param in_swizzle_green Channel to use for the green component when sampling the view. + * @param in_swizzle_blue Channel to use for the blue component when sampling the view. + * @param in_swizzle_alpha Channel to use for the alpha component when sampling the view. + * + * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: + * + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * + * @return New ImageView instance, if function executes successfully; nullptr otherwise. + **/ + static Anvil::ImageViewCreateInfoUniquePtr create_3D(const Anvil::BaseDevice* in_device_ptr, + Image* in_image_ptr, + uint32_t in_n_base_slice, + uint32_t in_n_slices, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha); + + /** Use this function if you need to create a cube-map image view wrapper instance. + * + * @param in_device_ptr Device to use. + * @param in_image_ptr Image instance to create a view for. Must not be nullptr. The specified + * object will be retained and release at ImageView release time. + * @param in_n_base_layer Base layer index. + * @param in_n_base_mipmap_level Base mipmap level. + * @param in_n_mipmaps Number of mipmaps to include in the view. + * @param in_aspect_mask Image aspect mask to use when creating the Vulkan image view instance. + * @param in_format Image view format. + * @param in_swizzle_red Channel to use for the red component when sampling the view. + * @param in_swizzle_green Channel to use for the green component when sampling the view. + * @param in_swizzle_blue Channel to use for the blue component when sampling the view. + * @param in_swizzle_alpha Channel to use for the alpha component when sampling the view. + * + * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: + * + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * + * @return New ImageView instance, if function executes successfully; nullptr otherwise. + **/ + static Anvil::ImageViewCreateInfoUniquePtr create_cube_map(const Anvil::BaseDevice* in_device_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha); + + /** Use this function if you need to create a cube-map array image view wrapper instance. + * + * @param in_device_ptr Device to use. + * @param in_image_ptr Image instance to create a view for. Must not be nullptr. The specified + * object will be retained and release at ImageView release time. + * @param in_n_base_layer Base layer index. + * @param in_n_cube_maps Number of cube-maps to include in the view. The number of layers created + * for the view will be equal to @param in_n_cube_maps * 6. + * @param in_n_base_mipmap_level Base mipmap level. + * @param in_n_mipmaps Number of mipmaps to include in the view. + * @param in_aspect_mask Image aspect mask to use when creating the Vulkan image view instance. + * @param in_format Image view format. + * @param in_swizzle_red Channel to use for the red component when sampling the view. + * @param in_swizzle_green Channel to use for the green component when sampling the view. + * @param in_swizzle_blue Channel to use for the blue component when sampling the view. + * @param in_swizzle_alpha Channel to use for the alpha component when sampling the view. + * + * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: + * + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * + * @return New ImageView instance, if function executes successfully; nullptr otherwise. + **/ + static Anvil::ImageViewCreateInfoUniquePtr create_cube_map_array(const Anvil::BaseDevice* in_device_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_cube_maps, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha); + + /* Returns the aspect assigned to the image view */ + VkImageAspectFlags get_aspect() const + { + return m_aspect_mask; + } + + /* Returns base layer index used by the image view */ + uint32_t get_base_layer() const + { + return m_n_base_layer; + } + + /* Returns base mip level used by the image view */ + uint32_t get_base_mipmap_level() const + { + return m_n_base_mipmap_level; + } + + const Anvil::BaseDevice* get_device() const + { + return m_device_ptr; + } + + /** Returns image view's format */ + const VkFormat get_format() const + { + return m_format; + } + + const Anvil::MTSafety& get_mt_safety() const + { + return m_mt_safety; + } + + /** Returns number of layers encapsulated by the image view */ + uint32_t get_n_layers() const + { + return m_n_layers; + } + + /** Returns number of mipmaps encapsulated by the image view */ + uint32_t get_n_mipmaps() const + { + return m_n_mipmaps; + } + + /** Returns number of slices encapsulated by the image view */ + uint32_t get_n_slices() const + { + return m_n_slices; + } + + /** Returns a pointer to the parent image, from which the image view has been created. */ + Anvil::Image* get_parent_image() const + { + return m_parent_image_ptr; + } + + /** Returns swizzle array assigned to the image view */ + const std::array& get_swizzle_array() const + { + return m_swizzle_array; + } + + /** Returns image view type of the image view instance */ + const VkImageViewType get_type() const + { + return m_type; + } + + void set_aspect(const VkImageAspectFlags& in_aspect) + { + m_aspect_mask = in_aspect; + } + + void set_base_layer(const uint32_t& in_n_base_layer) + { + m_n_base_layer = in_n_base_layer; + } + + void set_base_mipmap_level(const uint32_t& in_n_base_mipmap_level) + { + m_n_base_mipmap_level = in_n_base_mipmap_level; + } + + void set_device(const Anvil::BaseDevice* in_device_ptr) + { + m_device_ptr = in_device_ptr; + } + + void set_format(const VkFormat& in_format) + { + m_format = in_format; + } + + void set_mt_safety(const Anvil::MTSafety& in_mt_safety) + { + m_mt_safety = in_mt_safety; + } + + void set_n_layers(const uint32_t& in_n_layers) + { + m_n_layers = in_n_layers; + } + + void set_n_mipmaps(const uint32_t& in_n_mipmaps) + { + m_n_mipmaps = in_n_mipmaps; + } + + void set_n_slices(const uint32_t& in_n_slices) + { + m_n_slices = in_n_slices; + } + + void set_parent_image(Anvil::Image* in_parent_image_ptr) + { + m_parent_image_ptr = in_parent_image_ptr; + } + + void set_swizzle_array(const std::array& in_swizzle_array) + { + m_swizzle_array = in_swizzle_array; + } + + private: + + /* Private functions */ + ImageViewCreateInfo(const VkImageAspectFlags& in_aspect_mask, + const Anvil::BaseDevice* in_device_ptr, + const VkFormat in_format, + const uint32_t in_n_base_layer, + const uint32_t in_n_base_mipmap_level, + const uint32_t in_n_layers, + const uint32_t in_n_mipmaps, + const uint32_t in_n_slices, + Anvil::Image* in_parent_image_ptr, + const VkComponentSwizzle* in_swizzle_array_ptr, + const VkImageViewType in_type, + const Anvil::MTSafety& in_mt_safety); + + /* Private variables */ + + VkImageAspectFlagsVariable(m_aspect_mask); + + const Anvil::BaseDevice* m_device_ptr; + VkFormat m_format; + Anvil::MTSafety m_mt_safety; + uint32_t m_n_base_layer; + uint32_t m_n_base_mipmap_level; + uint32_t m_n_layers; + uint32_t m_n_mipmaps; + uint32_t m_n_slices; + Anvil::Image* m_parent_image_ptr; + std::array m_swizzle_array; + const VkImageViewType m_type; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(ImageViewCreateInfo); + ANVIL_DISABLE_COPY_CONSTRUCTOR(ImageViewCreateInfo); + }; + +}; /* namespace Anvil */ + +#endif/* MISC_IMAGE_VIEW_CREATE_INFO_H */ \ No newline at end of file diff --git a/include/misc/io.h b/include/misc/io.h index 6a330c6c..4d9b80ab 100644 --- a/include/misc/io.h +++ b/include/misc/io.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/misc/memalloc_backends/backend_oneshot.h b/include/misc/memalloc_backends/backend_oneshot.h index 81aed926..27e8eeb5 100644 --- a/include/misc/memalloc_backends/backend_oneshot.h +++ b/include/misc/memalloc_backends/backend_oneshot.h @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -61,8 +61,14 @@ namespace Anvil private: /* IMemoryAllocatorBackend functions */ - bool bake (Anvil::MemoryAllocator::Items& in_items); - bool supports_baking() const; + bool bake (Anvil::MemoryAllocator::Items& in_items) final; + VkResult map (void* in_memory_object, + VkDeviceSize in_start_offset, + VkDeviceSize in_size, + void** out_result_ptr) final; + bool supports_baking () const final; + bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const final; + void unmap (void* in_memory_object) final; /* Private functions */ diff --git a/include/misc/memalloc_backends/backend_vma.h b/include/misc/memalloc_backends/backend_vma.h index 254d0ca3..c19726c1 100644 --- a/include/misc/memalloc_backends/backend_vma.h +++ b/include/misc/memalloc_backends/backend_vma.h @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -96,8 +96,10 @@ namespace Anvil * * @param in_memory_block_ptr Raw pointer to the memory block which is about to be destroyed. * Must NOT be null. Must be valid at call time. + * @param in_vma_allocation TODO. */ - void on_vma_alloced_mem_block_gone_out_of_scope(Anvil::MemoryBlock* in_memory_block_ptr); + void on_vma_alloced_mem_block_gone_out_of_scope(Anvil::MemoryBlock* in_memory_block_ptr, + VmaAllocation in_vma_allocation); private: /* Private functions */ @@ -121,8 +123,14 @@ namespace Anvil /* IMemoryAllocatorBackend functions */ - bool bake (Anvil::MemoryAllocator::Items& in_items); - bool supports_baking() const; + bool bake (Anvil::MemoryAllocator::Items& in_items) final; + VkResult map (void* in_memory_object, + VkDeviceSize in_start_offset, + VkDeviceSize in_size, + void** out_result_ptr); + bool supports_baking () const final; + bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const final; + void unmap (void* in_memory_object); /* Private variables */ const Anvil::BaseDevice* m_device_ptr; diff --git a/include/misc/memory_allocator.h b/include/misc/memory_allocator.h index f5855149..4cb1f7b9 100644 --- a/include/misc/memory_allocator.h +++ b/include/misc/memory_allocator.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -69,14 +69,15 @@ namespace Anvil ItemType type; - MemoryBlockUniquePtr alloc_memory_block_ptr; - uint32_t alloc_memory_final_type; - VkDeviceSize alloc_memory_required_alignment; - MemoryFeatureFlags alloc_memory_required_features; - uint32_t alloc_memory_supported_memory_types; - uint32_t alloc_memory_types; - VkDeviceSize alloc_offset; - VkDeviceSize alloc_size; + Anvil::ExternalMemoryHandleTypeFlags alloc_external_memory_handle_types; + MemoryBlockUniquePtr alloc_memory_block_ptr; + uint32_t alloc_memory_final_type; + VkDeviceSize alloc_memory_required_alignment; + MemoryFeatureFlags alloc_memory_required_features; + uint32_t alloc_memory_supported_memory_types; + uint32_t alloc_memory_types; + VkDeviceSize alloc_offset; + VkDeviceSize alloc_size; VkExtent3D extent; bool is_baked; @@ -85,56 +86,56 @@ namespace Anvil VkOffset3D offset; VkImageSubresource subresource; - Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types); - - Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_alloc_offset, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types); - - Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - uint32_t in_n_layer, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_miptail_offset, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types); - - Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - const VkExtent3D& in_extent, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types); - - Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types); - - Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment); + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + Anvil::ExternalMemoryHandleTypeFlags in_alloc_external_memory_handle_types); + + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_alloc_offset, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + Anvil::ExternalMemoryHandleTypeFlags in_alloc_external_memory_handle_types); + + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_layer, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_miptail_offset, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + Anvil::ExternalMemoryHandleTypeFlags in_alloc_external_memory_handle_types); + + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + const VkExtent3D& in_extent, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + Anvil::ExternalMemoryHandleTypeFlags in_alloc_external_memory_handle_types); + + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + Anvil::ExternalMemoryHandleTypeFlags in_alloc_external_memory_handle_types); /** TODO */ ~Item(); @@ -159,7 +160,8 @@ namespace Anvil /* Stub */ } - virtual bool bake(Items& in_items) = 0; + virtual bool bake (Items& in_items) = 0; + virtual bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const = 0; }; /* Public functions */ @@ -167,59 +169,79 @@ namespace Anvil /** Adds a new Buffer object which should use storage coming from the buffer memory * maintained by the Memory Allocator. * - * @param in_buffer_ptr Buffer to configure storage for at bake() call time. Must not - * be nullptr. - * @param in_data_ptr The buffer will be filled with data extracted from the specified - * location. The number of bytes which will be stored is defined by - * buffer size. - * @param in_data_vector_ptr The buffer will be filled with data extracted from the specified - * vector. Total number of bytes defined in the vector must match - * buffer size. - * @param in_required_memory_features Memory features the assigned memory must support. - * See MemoryFeatureFlagBits for more details. + * @param in_buffer_ptr Buffer to configure storage for at bake() call time. Must not + * be nullptr. + * @param in_data_ptr The buffer will be filled with data extracted from the specified + * location. The number of bytes which will be stored is defined by + * buffer size. + * @param in_data_vector_ptr The buffer will be filled with data extracted from the specified + * vector. Total number of bytes defined in the vector must match + * buffer size. + * @param in_required_memory_features Memory features the assigned memory must support. + * See MemoryFeatureFlagBits for more details. + * @param in_external_memory_handle_types If the allocation is going to be exported to another process or Vulkan instance, use + * this field to specify which handle types the allocation needs to support. Please see + * documentation of Anvil::ExternalMemoryHandleTypeFlags for more details. + * If 0 is specified, handle types specified for @param in_buffer_ptr at creation time + * will be used instead. * * @return true if the buffer has been successfully scheduled for baking, false otherwise. **/ bool add_buffer (Anvil::Buffer* in_buffer_ptr, - MemoryFeatureFlags in_required_memory_features); + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); bool add_buffer_with_float_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, - MemoryFeatureFlags in_required_memory_features); + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); bool add_buffer_with_float_data_vector_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, - MemoryFeatureFlags in_required_memory_features); + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); bool add_buffer_with_float_data_vector_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, const std::vector* in_data_vector_ptr, - MemoryFeatureFlags in_required_memory_features); + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); bool add_buffer_with_uchar8_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, - MemoryFeatureFlags in_required_memory_features); + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); bool add_buffer_with_uchar8_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, - MemoryFeatureFlags in_required_memory_features); + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); bool add_buffer_with_uint32_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, - MemoryFeatureFlags in_required_memory_features); + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); bool add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, - MemoryFeatureFlags in_required_memory_features); + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); bool add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, const std::vector* in_data_vector_ptr, - MemoryFeatureFlags in_required_memory_features); + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); /** TODO * - * @param in_buffer_ptr TODO - * @param in_offset TODO. Must be divisible by VkMemoryRequirements::alignment - * @param in_size TODO. - * @param in_required_memory_features TODO + * @param in_buffer_ptr TODO + * @param in_offset TODO. Must be divisible by VkMemoryRequirements::alignment + * @param in_size TODO. + * @param in_required_memory_features TODO + * @param in_external_memory_handle_types If the allocation is going to be exported to another process or Vulkan instance, use + * this field to specify which handle types the allocation needs to support. Please see + * documentation of Anvil::ExternalMemoryHandleTypeFlags for more details. + * If 0 is specified, handle types specified for @param in_buffer_ptr at creation time + * will be used instead. * * @return TODO */ - bool add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_offset, - VkDeviceSize in_size, - MemoryFeatureFlags in_required_memory_features); + bool add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkDeviceSize in_size, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); /** Adds an Image object which should be assigned storage coming from memory objects * maintained by the Memory Allocator. At baking time, all subresources of the image, @@ -227,15 +249,21 @@ namespace Anvil * * This function can be used against both non-sparse and sparse images. * - * @param image_ptr Image to configure storage for at bake() call time. Must not - * be nullptr. - * @param in_required_memory_features Memory features the assigned memory must support. - * See MemoryFeatureFlagBits for more details. + * @param image_ptr Image to configure storage for at bake() call time. Must not + * be nullptr. + * @param in_required_memory_features Memory features the assigned memory must support. + * See MemoryFeatureFlagBits for more details. + * @param in_external_memory_handle_types If the allocation is going to be exported to another process or Vulkan instance, use + * this field to specify which handle types the allocation needs to support. Please see + * documentation of Anvil::ExternalMemoryHandleTypeFlags for more details. + * If 0 is specified, handle types specified for @param in_image_ptr at creation time + * will be used instead. * * @return true if the image has been successfully scheduled for baking, false otherwise. **/ - bool add_image_whole(Anvil::Image* in_image_ptr, - MemoryFeatureFlags in_required_memory_features); + bool add_image_whole(Anvil::Image* in_image_ptr, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); /** Adds a new Image object whose layer @param in_n_layer 's miptail for @param in_aspect * aspect should be assigned a physical memory backing. The miptail will be bound a memory @@ -246,42 +274,54 @@ namespace Anvil * * This function can only be used for sparse resident images. * - * @param in_image_ptr Image to use for the request. Must not be null. - * @param in_aspect Aspect to be used for the request. - * @param in_n_layer Index of the layer to attach the miptail to. - * @param in_required_memory_features Memory features the assigned memory must support. - * See MemoryFeatureFlagBits for more details. + * @param in_image_ptr Image to use for the request. Must not be null. + * @param in_aspect Aspect to be used for the request. + * @param in_n_layer Index of the layer to attach the miptail to. + * @param in_required_memory_features Memory features the assigned memory must support. + * See MemoryFeatureFlagBits for more details. + * @param in_external_memory_handle_types If the allocation is going to be exported to another process or Vulkan instance, use + * this field to specify which handle types the allocation needs to support. Please see + * documentation of Anvil::ExternalMemoryHandleTypeFlags for more details. + * If 0 is specified, handle types specified for @param in_image_ptr at creation time + * will be used instead. * * @return true if the miptail has been successfully scheduled for baking, false otherwise. */ - bool add_sparse_image_miptail(Anvil::Image* in_image_ptr, - VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - MemoryFeatureFlags in_required_memory_features); + bool add_sparse_image_miptail(Anvil::Image* in_image_ptr, + VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); /** Adds a single subresource which should be assigned memory backing. * * This function does NOT alloc memory for the miptail. It is user's responsibilty to call * add_sparse_image_miptail() for any layers which require a miptail. * - * @param in_image_ptr Image to use for the request. Must not be null. - * @param in_subresource Specifies details of the subresource to attach memory backing to. - * @param in_offset XYZ offset, from which the memory backing should be attached. Must - * be rounded up to tile size of the aspect @param in_subresource - * refers to. - * @param in_extent Size of the region to assign memory backing to. Must be rounded up - * to tile size of the aspect @param in_subresource refers to, UNLESS - * @param in_offset + @param in_extent touches the subresource border. - * @param in_required_memory_features Memory features the assigned memory must support. - * See MemoryFeatureFlagBits for more details. + * @param in_image_ptr Image to use for the request. Must not be null. + * @param in_subresource Specifies details of the subresource to attach memory backing to. + * @param in_offset XYZ offset, from which the memory backing should be attached. Must + * be rounded up to tile size of the aspect @param in_subresource + * refers to. + * @param in_extent Size of the region to assign memory backing to. Must be rounded up + * to tile size of the aspect @param in_subresource refers to, UNLESS + * @param in_offset + @param in_extent touches the subresource border. + * @param in_required_memory_features Memory features the assigned memory must support. + * See MemoryFeatureFlagBits for more details. + * @param in_external_memory_handle_types If the allocation is going to be exported to another process or Vulkan instance, use + * this field to specify which handle types the allocation needs to support. Please see + * documentation of Anvil::ExternalMemoryHandleTypeFlags for more details. + * If 0 is specified, handle types specified for @param in_image_ptr at creation time + * will be used instead. * * @return true if the subresource has been successfully scheduled for baking, false otherwise. **/ - bool add_sparse_image_subresource(Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - VkExtent3D in_extent, - MemoryFeatureFlags in_required_memory_features); + bool add_sparse_image_subresource(Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + VkExtent3D in_extent, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); /** TODO */ bool bake(); @@ -298,6 +338,7 @@ namespace Anvil /** Creates a new VMA memory allocator instance. * * This type of allocator supports an arbitrary number of implicit or explicit bake invocations. + * This type of allocator does NOT support external handles of any type. * * @param in_device_ptr Device to use. **/ @@ -323,11 +364,14 @@ namespace Anvil private: /* Private functions */ - bool add_buffer_internal(Anvil::Buffer* in_buffer_ptr, - MemoryFeatureFlags in_required_memory_features); - bool is_alloc_supported (uint32_t in_memory_types, - Anvil::MemoryFeatureFlags in_memory_features, - uint32_t* out_opt_filtered_memory_types_ptr) const; + bool add_buffer_internal(Anvil::Buffer* in_buffer_ptr, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types); + + bool do_external_memory_handle_type_sanity_checks(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const; + bool is_alloc_supported (uint32_t in_memory_types, + Anvil::MemoryFeatureFlags in_memory_features, + uint32_t* out_opt_filtered_memory_types_ptr) const; void on_is_alloc_pending_for_buffer_query(CallbackArgument* in_callback_arg_ptr); void on_is_alloc_pending_for_image_query (CallbackArgument* in_callback_arg_ptr); diff --git a/include/misc/mt_safety.h b/include/misc/mt_safety.h index 10a6d75e..82174056 100644 --- a/include/misc/mt_safety.h +++ b/include/misc/mt_safety.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/misc/object_tracker.h b/include/misc/object_tracker.h index 9ba25087..bb2ae66e 100644 --- a/include/misc/object_tracker.h +++ b/include/misc/object_tracker.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/misc/page_tracker.h b/include/misc/page_tracker.h index 47599a29..ba02da12 100644 --- a/include/misc/page_tracker.h +++ b/include/misc/page_tracker.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/misc/pools.h b/include/misc/pools.h index b41eef4b..b4e54dff 100644 --- a/include/misc/pools.h +++ b/include/misc/pools.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/misc/ref_counter.h b/include/misc/ref_counter.h index d9176630..a6c749b1 100644 --- a/include/misc/ref_counter.h +++ b/include/misc/ref_counter.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/misc/render_pass_info.h b/include/misc/render_pass_create_info.h similarity index 97% rename from include/misc/render_pass_info.h rename to include/misc/render_pass_create_info.h index c063053b..76bc5331 100644 --- a/include/misc/render_pass_info.h +++ b/include/misc/render_pass_create_info.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -19,18 +19,18 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // -#ifndef MISC_RENDERPASS_INFO_H -#define MISC_RENDERPASS_INFO_H +#ifndef MISC_RENDERPASS_CREATE_INFO_H +#define MISC_RENDERPASS_CREATE_INFO_H #include "misc/types.h" namespace Anvil { - class RenderPassInfo + class RenderPassCreateInfo { public: - RenderPassInfo(const Anvil::BaseDevice* in_device_ptr); - ~RenderPassInfo(); + RenderPassCreateInfo(const Anvil::BaseDevice* in_device_ptr); + ~RenderPassCreateInfo(); /** Adds a new render-pass color attachment to the internal data model. * @@ -142,19 +142,20 @@ namespace Anvil * it marks the RenderPass as dirty, which will cause the object to be re-created * at next bake() or get_render_pass() request. * - * @param in_subpass_id ID of the subpass to update the depth+stencil attachment for. - * The subpass must have been earlier created with an add_subpass() call. - * @param in_attachment_id ID of the render-pass attachment the depth-stencil attachment should refer to. - * @param in_layout Layout to use for the attachment when executing the subpass. - * Driver takes care of transforming the attachment to the requested layout - * before subpass commands starts executing. + * @param in_subpass_id ID of the subpass to update the depth+stencil attachment for. + * The subpass must have been earlier created with an add_subpass() call. + * @param in_layout Layout to use for the attachment when executing the subpass. + * Driver takes care of transforming the attachment to the requested layout + * before subpass commands starts executing. + * @param in_attachment_id ID of the render-pass attachment the depth-stencil attachment should refer to. + * * @return true if the function executed successfully, false otherwise. * */ bool add_subpass_depth_stencil_attachment(SubPassID in_subpass_id, - RenderPassAttachmentID in_attachment_id, - VkImageLayout in_layout); + VkImageLayout in_layout, + RenderPassAttachmentID in_attachment_id); /** Adds a new input attachment to the RenderPass instance's specified subpass. * @@ -429,6 +430,11 @@ namespace Anvil AttachmentType in_attachment_type, uint32_t* out_n_attachments_ptr) const; + void set_device_ptr(const Anvil::BaseDevice* in_device_ptr) + { + m_device_ptr = in_device_ptr; + } + private: /* Private type definitions */ @@ -769,4 +775,4 @@ namespace Anvil }; }; -#endif /* MISC_RENDERPASS_INFO_H */ +#endif /* MISC_RENDERPASS_CREATE_INFO_H */ diff --git a/include/misc/sampler_create_info.h b/include/misc/sampler_create_info.h new file mode 100644 index 00000000..b1662df0 --- /dev/null +++ b/include/misc/sampler_create_info.h @@ -0,0 +1,260 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef MISC_SAMPLER_CREATE_INFO_H +#define MISC_SAMPLER_CREATE_INFO_H + +#include "misc/types.h" + +namespace Anvil +{ + class SamplerCreateInfo + { + public: + /* Public functions */ + + /** TODO + * + * For argument discussion, please consult Vulkan API specification. + */ + static SamplerCreateInfoUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + VkFilter in_mag_filter, + VkFilter in_min_filter, + VkSamplerMipmapMode in_mipmap_mode, + VkSamplerAddressMode in_address_mode_u, + VkSamplerAddressMode in_address_mode_v, + VkSamplerAddressMode in_address_mode_w, + float in_lod_bias, + float in_max_anisotropy, + bool in_compare_enable, + VkCompareOp in_compare_op, + float in_min_lod, + float in_max_lod, + VkBorderColor in_border_color, + bool in_use_unnormalized_coordinates, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + + const VkSamplerAddressMode& get_address_mode_u() const + { + return m_address_mode_u; + } + + const VkSamplerAddressMode& get_address_mode_v() const + { + return m_address_mode_v; + } + + const VkSamplerAddressMode& get_address_mode_w() const + { + return m_address_mode_w; + } + + const VkBorderColor& get_border_color() const + { + return m_border_color; + } + + const VkCompareOp& get_compare_op() const + { + return m_compare_op; + } + + const Anvil::BaseDevice* get_device() const + { + return m_device_ptr; + } + + const float& get_lod_bias() const + { + return m_lod_bias; + } + + const VkFilter& get_mag_filter() const + { + return m_mag_filter; + } + + const float& get_max_anisotropy() const + { + return m_max_anisotropy; + } + + const float& get_max_lod() const + { + return m_max_lod; + } + + const VkFilter& get_min_filter() const + { + return m_min_filter; + } + + const float& get_min_lod() const + { + return m_min_lod; + } + + const VkSamplerMipmapMode& get_mipmap_mode() const + { + return m_mipmap_mode; + } + + const Anvil::MTSafety& get_mt_safety() const + { + return m_mt_safety; + } + + const bool& is_compare_enabled() const + { + return m_compare_enable; + } + + void set_address_mode_u(const VkSamplerAddressMode& in_address_mode_u) + { + m_address_mode_u = in_address_mode_u; + } + + void set_address_mode_v(const VkSamplerAddressMode& in_address_mode_v) + { + m_address_mode_v = in_address_mode_v; + } + + void set_address_mode_w(const VkSamplerAddressMode& in_address_mode_w) + { + m_address_mode_w = in_address_mode_w; + } + + void set_border_color(const VkBorderColor& in_border_color) + { + m_border_color = in_border_color; + } + + void set_compare_op(const VkCompareOp& in_compare_op) + { + m_compare_op = in_compare_op; + } + + void set_device(const Anvil::BaseDevice* in_device_ptr) + { + m_device_ptr = in_device_ptr; + } + + void set_lod_bias(const float& in_lod_bias) + { + m_lod_bias = in_lod_bias; + } + + void set_mag_filter(const VkFilter& in_mag_filter) + { + m_mag_filter = in_mag_filter; + } + + void set_max_anisotropy(const float& in_max_anisotropy) + { + m_max_anisotropy = in_max_anisotropy; + } + + void set_max_lod(const float& in_max_lod) + { + m_max_lod = in_max_lod; + } + + void set_min_filter(const VkFilter& in_min_filter) + { + m_min_filter = in_min_filter; + } + + void set_min_lod(const float& in_min_lod) + { + m_min_lod = in_min_lod; + } + + void set_mipmap_mode(const VkSamplerMipmapMode& in_mipmap_mode) + { + m_mipmap_mode = in_mipmap_mode; + } + + void set_mt_safety(const Anvil::MTSafety& in_mt_safety) + { + m_mt_safety = in_mt_safety; + } + + void set_is_compare_enabled(const bool& in_compare_enable) + { + m_compare_enable = in_compare_enable; + } + + void set_uses_unnormalized_coordinates(const bool& in_use_unnormalized_coordinates) + { + m_use_unnormalized_coordinates = in_use_unnormalized_coordinates; + } + + const bool& uses_unnormalized_coordinates() const + { + return m_use_unnormalized_coordinates; + } + + private: + /* Private functions */ + + SamplerCreateInfo(const Anvil::BaseDevice* in_device_ptr, + VkFilter in_mag_filter, + VkFilter in_min_filter, + VkSamplerMipmapMode in_mipmap_mode, + VkSamplerAddressMode in_address_mode_u, + VkSamplerAddressMode in_address_mode_v, + VkSamplerAddressMode in_address_mode_w, + float in_lod_bias, + float in_max_anisotropy, + bool in_compare_enable, + VkCompareOp in_compare_op, + float in_min_lod, + float in_max_lod, + VkBorderColor in_border_color, + bool in_use_unnormalized_coordinates, + MTSafety in_mt_safety); + + /* Private variables */ + + VkSamplerAddressMode m_address_mode_u; + VkSamplerAddressMode m_address_mode_v; + VkSamplerAddressMode m_address_mode_w; + VkBorderColor m_border_color; + bool m_compare_enable; + VkCompareOp m_compare_op; + float m_lod_bias; + VkFilter m_mag_filter; + float m_max_anisotropy; + float m_max_lod; + VkFilter m_min_filter; + float m_min_lod; + VkSamplerMipmapMode m_mipmap_mode; + Anvil::MTSafety m_mt_safety; + bool m_use_unnormalized_coordinates; + + const Anvil::BaseDevice* m_device_ptr; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(SamplerCreateInfo); + ANVIL_DISABLE_COPY_CONSTRUCTOR(SamplerCreateInfo); + }; +}; /* namespace Anvil */ + +#endif /* MISC_SAMPLER_CREATE_INFO_H */ \ No newline at end of file diff --git a/include/misc/semaphore_create_info.h b/include/misc/semaphore_create_info.h new file mode 100644 index 00000000..8ca608cd --- /dev/null +++ b/include/misc/semaphore_create_info.h @@ -0,0 +1,71 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef MISC_SEMAPHORE_CREATE_INFO_H +#define MISC_SEMAPHORE_CREATE_INFO_H + +#include "misc/types.h" + +namespace Anvil +{ + class SemaphoreCreateInfo + { + public: + /* Public functions */ + static Anvil::SemaphoreCreateInfoUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + + const Anvil::BaseDevice* get_device() const + { + return m_device_ptr; + } + + const MTSafety& get_mt_safety() const + { + return m_mt_safety; + } + + void set_device(const Anvil::BaseDevice* in_device_ptr) + { + m_device_ptr = in_device_ptr; + } + + void set_mt_safety(const MTSafety& in_mt_safety) + { + m_mt_safety = in_mt_safety; + } + + private: + /* Private functions */ + SemaphoreCreateInfo(const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety); + + /* Private variables */ + const Anvil::BaseDevice* m_device_ptr; + Anvil::MTSafety m_mt_safety; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(SemaphoreCreateInfo); + ANVIL_DISABLE_COPY_CONSTRUCTOR(SemaphoreCreateInfo); + }; + +}; /* namespace Anvil */ + +#endif /* MISC_SEMAPHORE_CREATE_INFO_H */ \ No newline at end of file diff --git a/include/misc/shader_module_cache.h b/include/misc/shader_module_cache.h index 4b07b7a3..d4dafd2e 100644 --- a/include/misc/shader_module_cache.h +++ b/include/misc/shader_module_cache.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/misc/swapchain_create_info.h b/include/misc/swapchain_create_info.h new file mode 100644 index 00000000..f32cd555 --- /dev/null +++ b/include/misc/swapchain_create_info.h @@ -0,0 +1,180 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef MISC_SWAPCHAIN_CREATE_INFO_H +#define MISC_SWAPCHAIN_CREATE_INFO_H + +#include "misc/types.h" + +namespace Anvil +{ + class SwapchainCreateInfo + { + public: + /* Public functions */ + + /* TODO. + * + * NOTE: By default, the following parameters take default values as below. + * + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - Swapchain create flags: 0 + * + * To modify these, use corresponding set_..() functions. + */ + static SwapchainCreateInfoUniquePtr create(Anvil::BaseDevice* in_device_ptr, + Anvil::RenderingSurface* in_parent_surface_ptr, + Anvil::Window* in_window_ptr, + VkFormat in_format, + VkPresentModeKHR in_present_mode, + VkImageUsageFlags in_usage_flags, + uint32_t in_n_images); + + /** Returns device instance which has been used to create the swapchain */ + const Anvil::BaseDevice* get_device() const + { + return m_device_ptr; + } + + /** Returns flags used to create the swapchain. */ + const VkSwapchainCreateFlagsKHR& get_flags() const + { + return m_flags; + } + + /** Returns format used by swapchain image and image views */ + VkFormat get_format() const + { + return m_format; + } + + const MTSafety& get_mt_safety() const + { + return m_mt_safety; + } + + /** Tells how many images the swap-chain encapsulates. */ + uint32_t get_n_images() const + { + return m_n_images; + } + + VkPresentModeKHR get_present_mode() const + { + return m_present_mode; + } + + /** Retrieves parent rendering surface. */ + const Anvil::RenderingSurface* get_rendering_surface() const + { + return m_parent_surface_ptr; + } + + const VkImageUsageFlags& get_usage_flags() const + { + return m_usage_flags; + } + + /** Retrieves a window, to which the swapchain is bound. Note that under certain + * circumstances no window may be assigned. */ + Anvil::Window* get_window() const + { + return m_window_ptr; + } + + void set_device(const Anvil::BaseDevice* in_device_ptr) + { + m_device_ptr = in_device_ptr; + } + + void set_flags(const VkSwapchainCreateFlagsKHR& in_flags) + { + m_flags = in_flags; + } + + void set_format(const VkFormat& in_format) + { + m_format = in_format; + } + + void set_mt_safety(const MTSafety& in_mt_safety) + { + m_mt_safety = in_mt_safety; + } + + void set_n_images(const uint32_t& in_n_images) + { + m_n_images = in_n_images; + } + + void set_present_mode(const VkPresentModeKHR& in_present_mode) + { + m_present_mode = in_present_mode; + } + + void set_rendering_surface(Anvil::RenderingSurface* in_rendering_surface_ptr) + { + m_parent_surface_ptr = in_rendering_surface_ptr; + } + + void set_usage_flags(VkImageUsageFlags in_new_usage_flags) + { + m_usage_flags = in_new_usage_flags; + } + + void set_window(Anvil::Window* in_window_ptr) + { + m_window_ptr = in_window_ptr; + } + + + private: + /* Private functions */ + + SwapchainCreateInfo(Anvil::BaseDevice* in_device_ptr, + Anvil::RenderingSurface* in_parent_surface_ptr, + Anvil::Window* in_window_ptr, + VkFormat in_format, + VkPresentModeKHR in_present_mode, + VkImageUsageFlags in_usage_flags, + uint32_t in_n_images, + MTSafety in_mt_safety, + VkSwapchainCreateFlagsKHR in_flags); + + /* Private variables */ + + const Anvil::BaseDevice* m_device_ptr; + VkSwapchainCreateFlagsKHR m_flags; + VkFormat m_format; + Anvil::MTSafety m_mt_safety; + uint32_t m_n_images; + Anvil::RenderingSurface* m_parent_surface_ptr; + VkPresentModeKHR m_present_mode; + Anvil::Window* m_window_ptr; + + VkImageUsageFlagsVariable(m_usage_flags); + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(SwapchainCreateInfo); + ANVIL_DISABLE_COPY_CONSTRUCTOR(SwapchainCreateInfo); + }; +}; /* namespace Anvil */ + +#endif /* MISC_SWAPCHAIN_CREATE_INFO_H */ \ No newline at end of file diff --git a/include/misc/time.h b/include/misc/time.h index 730ca9c1..3c728dc3 100644 --- a/include/misc/time.h +++ b/include/misc/time.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/misc/types.h b/include/misc/types.h index 859a5c6e..e4dfc8f2 100644 --- a/include/misc/types.h +++ b/include/misc/types.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -107,444 +107,40 @@ #include #include -/* Sanity checks */ -#if !defined(VK_AMD_rasterization_order) - #error Vulkan SDK header used in the compilation process is too old. Please ensure deps\anvil\include\vulkan.h is used. -#endif - -/* Wrappers for some of the Vulkan enums we use across Anvil */ -#ifdef ANVIL_LITTLE_ENDIAN - #define VkAccessFlagsVariable(name) \ - union \ - { \ - VkAccessFlags name; \ - \ - struct \ - { \ - uint8_t VK_ACCESS_INDIRECT_COMMAND_READ_BIT : 1; \ - uint8_t VK_ACCESS_INDEX_READ_BIT : 1; \ - uint8_t VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT : 1; \ - uint8_t VK_ACCESS_UNIFORM_READ_BIT : 1; \ - uint8_t VK_ACCESS_INPUT_ATTACHMENT_READ_BIT : 1; \ - uint8_t VK_ACCESS_SHADER_READ_BIT : 1; \ - uint8_t VK_ACCESS_SHADER_WRITE_BIT : 1; \ - uint8_t VK_ACCESS_COLOR_ATTACHMENT_READ_BIT : 1; \ - uint8_t VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT : 1; \ - uint8_t VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT : 1; \ - uint8_t VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT : 1; \ - uint8_t VK_ACCESS_TRANSFER_READ_BIT : 1; \ - uint8_t VK_ACCESS_TRANSFER_WRITE_BIT : 1; \ - uint8_t VK_ACCESS_HOST_READ_BIT : 1; \ - uint8_t VK_ACCESS_HOST_WRITE_BIT : 1; \ - uint8_t VK_ACCESS_MEMORY_READ_BIT : 1; \ - uint8_t VK_ACCESS_MEMORY_WRITE_BIT : 1; \ - uint32_t OTHER: 15; \ - } name##_flags; \ - }; - - #define VkBufferCreateFlagsVariable(name) \ - union \ - { \ - VkBufferCreateFlags name; \ - \ - struct \ - { \ - uint8_t VK_BUFFER_CREATE_SPARSE_BINDING_BIT : 1; \ - uint8_t VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT : 1; \ - uint8_t VK_BUFFER_CREATE_SPARSE_ALIASED_BIT : 1; \ - uint32_t OTHER: 29; \ - } name##_flags; \ - }; - - #define VkBufferUsageFlagsVariable(name) \ - union \ - { \ - VkBufferUsageFlags name; \ - \ - struct \ - { \ - uint8_t VK_BUFFER_USAGE_TRANSFER_SRC_BIT : 1; \ - uint8_t VK_BUFFER_USAGE_TRANSFER_DST_BIT : 1; \ - uint8_t VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT : 1; \ - uint8_t VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT : 1; \ - uint8_t VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT : 1; \ - uint8_t VK_BUFFER_USAGE_STORAGE_BUFFER_BIT : 1; \ - uint8_t VK_BUFFER_USAGE_INDEX_BUFFER_BIT : 1; \ - uint8_t VK_BUFFER_USAGE_VERTEX_BUFFER_BIT : 1; \ - uint8_t VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT : 1; \ - uint32_t OTHER: 23; \ - } name##_flags; \ - }; - - #define VkColorComponentFlagsVariable(name) \ - union \ - { \ - VkColorComponentFlags name; \ - \ - struct \ - { \ - uint8_t VK_COLOR_COMPONENT_R_BIT : 1; \ - uint8_t VK_COLOR_COMPONENT_G_BIT : 1; \ - uint8_t VK_COLOR_COMPONENT_B_BIT : 1; \ - uint8_t VK_COLOR_COMPONENT_A_BIT : 1; \ - uint32_t OTHER: 28; \ - } name##_flags; \ - }; - - #define VkCompositeAlphaFlagsKHRVariable(name) \ - union \ - { \ - VkCompositeAlphaFlagsKHR name; \ - \ - struct \ - { \ - uint8_t VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR : 1; \ - uint8_t VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR : 1; \ - uint8_t VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR : 1; \ - uint8_t VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR : 1; \ - uint32_t OTHER: 28; \ - } name##_flags; \ - }; - - #define VkCullModeFlagsVariable(name) \ - union \ - { \ - VkCullModeFlags name; \ - \ - struct \ - { \ - uint8_t VK_CULL_MODE_FRONT_BIT : 1; \ - uint8_t VK_CULL_MODE_BACK_BIT : 1; \ - uint32_t OTHER: 30; \ - } name##_flags; \ - }; - - #define VkDependencyFlagsVariable(name) \ - union \ - { \ - VkDependencyFlags name; \ - \ - struct \ - { \ - uint8_t VK_DEPENDENCY_BY_REGION_BIT : 1; \ - uint32_t OTHER: 29; \ - } name##_flags; \ - }; - - #define VkFormatFeatureFlagsVariable(name) \ - union \ - { \ - VkFormatFeatureFlags name; \ - \ - struct \ - { \ - uint8_t VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_BLIT_SRC_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_BLIT_DST_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG : 1; \ - uint8_t VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR : 1; \ - uint8_t VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR : 1; \ - uint32_t OTHER: 16; \ - } name##_flags; \ - }; - - #define VkImageAspectFlagsVariable(name) \ - union \ - { \ - VkImageAspectFlags name; \ - \ - struct \ - { \ - uint8_t VK_IMAGE_ASPECT_COLOR_BIT : 1; \ - uint8_t VK_IMAGE_ASPECT_DEPTH_BIT : 1; \ - uint8_t VK_IMAGE_ASPECT_STENCIL_BIT : 1; \ - uint8_t VK_IMAGE_ASPECT_METADATA_BIT : 1; \ - uint32_t OTHER: 28; \ - } name##_flags; \ - }; - - #define VkImageUsageFlagsVariable(name) \ - union \ - { \ - VkImageUsageFlags name; \ - \ - struct \ - { \ - uint8_t VK_IMAGE_USAGE_TRANSFER_SRC_BIT : 1; \ - uint8_t VK_IMAGE_USAGE_TRANSFER_DST_BIT : 1; \ - uint8_t VK_IMAGE_USAGE_SAMPLED_BIT : 1; \ - uint8_t VK_IMAGE_USAGE_STORAGE_BIT : 1; \ - uint8_t VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT : 1; \ - uint8_t VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT : 1; \ - uint8_t VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT : 1; \ - uint8_t VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT : 1; \ - uint32_t OTHER: 24; \ - } name##_flags; \ - }; - - #define VkMemoryHeapFlagsVariable(name) \ - union \ - { \ - VkMemoryHeapFlags name; \ - \ - struct \ - { \ - uint8_t VK_MEMORY_HEAP_DEVICE_LOCAL_BIT : 1; \ - uint32_t OTHER: 31; \ - } name##_flags; \ - }; - - #define VkMemoryPropertyFlagsVariable(name) \ - union \ - { \ - VkMemoryPropertyFlags name; \ - \ - struct \ - { \ - uint8_t VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT : 1; \ - uint8_t VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT : 1; \ - uint8_t VK_MEMORY_PROPERTY_HOST_COHERENT_BIT : 1; \ - uint8_t VK_MEMORY_PROPERTY_HOST_CACHED_BIT : 1; \ - uint8_t VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT : 1; \ - uint32_t OTHER: 27; \ - } name##_flags; \ - }; - - #define VkPipelineStageFlagsVariable(name) \ - union \ - { \ - VkPipelineStageFlags name; \ - \ - struct \ - { \ - uint8_t VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_VERTEX_INPUT_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_VERTEX_SHADER_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_TRANSFER_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_HOST_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_ALL_COMMANDS_BIT : 1; \ - uint32_t OTHER: 15; \ - } name##_flags; \ - }; - - #define VkQueryControlFlagsVariable(name) \ - union \ - { \ - VkQueryControlFlags name; \ - \ - struct \ - { \ - uint8_t VK_QUERY_CONTROL_PRECISE_BIT : 1; \ - uint32_t OTHER: 31; \ - } name##_flags; \ - }; - - #define VkQueryPipelineStatisticFlagsVariable(name) \ - union \ - { \ - VkQueryPipelineStatisticFlags name; \ - \ - struct \ - { \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT : 1; \ - uint32_t OTHER: 21; \ - } name##_flags; \ - }; - - #define VkQueryResultFlagsVariable(name) \ - union \ - { \ - VkQueryResultFlags name; \ - \ - struct \ - { \ - uint8_t VK_QUERY_RESULT_64_BIT : 1; \ - uint8_t VK_QUERY_RESULT_WAIT_BIT : 1; \ - uint8_t VK_QUERY_RESULT_WITH_AVAILABILITY_BIT : 1; \ - uint8_t VK_QUERY_RESULT_PARTIAL_BIT : 1; \ - uint32_t OTHER: 28; \ - } name##_flags; \ - }; - - #define VkQueueFlagsVariable(name) \ - union \ - { \ - VkQueueFlags name; \ - \ - struct \ - { \ - uint8_t VK_QUEUE_GRAPHICS_BIT : 1; \ - uint8_t VK_QUEUE_COMPUTE_BIT : 1; \ - uint8_t VK_QUEUE_TRANSFER_BIT : 1; \ - uint8_t VK_QUEUE_SPARSE_BINDING_BIT : 1; \ - uint32_t OTHER: 28; \ - } name##_flags; \ - }; - - #define VkSampleCountFlagsVariable(name) \ - union \ - { \ - VkSampleCountFlags name; \ - \ - struct \ - { \ - uint8_t VK_SAMPLE_COUNT_1_BIT : 1; \ - uint8_t VK_SAMPLE_COUNT_2_BIT : 1; \ - uint8_t VK_SAMPLE_COUNT_4_BIT : 1; \ - uint8_t VK_SAMPLE_COUNT_8_BIT : 1; \ - uint8_t VK_SAMPLE_COUNT_16_BIT : 1; \ - uint8_t VK_SAMPLE_COUNT_32_BIT : 1; \ - uint8_t VK_SAMPLE_COUNT_64_BIT : 1; \ - uint32_t OTHER: 25; \ - } name##_flags; \ - }; - - #define VkShaderStageFlagsVariable(name) \ - union \ - { \ - VkShaderStageFlags name; \ - \ - struct \ - { \ - uint8_t VK_SHADER_STAGE_VERTEX_BIT : 1; \ - uint8_t VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT : 1; \ - uint8_t VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT : 1; \ - uint8_t VK_SHADER_STAGE_GEOMETRY_BIT : 1; \ - uint8_t VK_SHADER_STAGE_FRAGMENT_BIT : 1; \ - uint8_t VK_SHADER_STAGE_COMPUTE_BIT : 1; \ - uint32_t OTHER: 26; \ - } name##_flags; \ - }; - - #define VkSparseImageFormatFlagsVariable(name) \ - union \ - { \ - VkSparseImageFormatFlags name; \ - \ - struct \ - { \ - uint8_t VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT : 1; \ - uint8_t VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT: 1; \ - uint8_t VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT: 1; \ - uint32_t OTHER: 29; \ - } name##_flags; \ - }; - - #define VkSparseMemoryBindFlagsVariable(name) \ - union \ - { \ - VkSparseMemoryBindFlags name; \ - \ - struct \ - { \ - uint8_t VK_SPARSE_MEMORY_BIND_METADATA_BIT : 1; \ - uint32_t OTHER: 31; \ - } name##_flags; \ - }; - - #define VkStencilFaceFlagsVariable(name) \ - union \ - { \ - VkStencilFaceFlags name; \ - \ - struct \ - { \ - uint8_t VK_STENCIL_FACE_FRONT_BIT : 1; \ - uint8_t VK_STENCIL_FACE_BACK_BIT : 1; \ - uint32_t OTHER: 30; \ - } name##_flags; \ - }; - - #define VkSurfaceTransformFlagsKHRVariable(name) \ - union \ - { \ - VkSurfaceTransformFlagsKHR name; \ - \ - struct \ - { \ - uint8_t VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR : 1; \ - uint32_t OTHER: 23; \ - } name##_flags; \ - }; -#else - #error "Big-endian arch's are not supported" -#endif - -/* Helper macros */ -#define ANVIL_DISABLE_ASSIGNMENT_OPERATOR(x) private: x& operator=(const x&); -#define ANVIL_DISABLE_COPY_CONSTRUCTOR(x) private: x(const x&); -#define ANVIL_REDUNDANT_ARGUMENT(x) x = x; -#define ANVIL_REDUNDANT_ARGUMENT_CONST(x) x; -#define ANVIL_REDUNDANT_VARIABLE(x) x = x; -#define ANVIL_REDUNDANT_VARIABLE_CONST(x) x; - -/* Defines various enums used by Vulkan API wrapper classes. */ +/* Forward declarations */ namespace Anvil { - /* Forward declarations */ class BaseDevice; - class BasePipelineInfo; + class BasePipelineCreateInfo; class Buffer; + class BufferCreateInfo; class BufferView; + class BufferViewCreateInfo; struct CallbackArgument; class CommandBufferBase; class CommandPool; - class ComputePipelineInfo; + class ComputePipelineCreateInfo; class ComputePipelineManager; class DescriptorPool; class DescriptorSet; + class DescriptorSetCreateInfo; class DescriptorSetGroup; - class DescriptorSetInfo; class DescriptorSetLayout; class DescriptorSetLayoutManager; class DescriptorUpdateTemplate; class Event; + class EventCreateInfo; class Fence; + class FenceCreateInfo; class Framebuffer; + class FramebufferCreateInfo; class GLSLShaderToSPIRVGenerator; - class GraphicsPipelineInfo; + class GraphicsPipelineCreateInfo; class GraphicsPipelineManager; class Image; + class ImageCreateInfo; class ImageView; + class ImageViewCreateInfo; class Instance; class MemoryAllocator; class MemoryBlock; @@ -560,37 +156,47 @@ namespace Anvil class Queue; class RenderingSurface; class RenderPass; - class RenderPassInfo; + class RenderPassCreateInfo; class Sampler; + class SamplerCreateInfo; class SecondaryCommandBuffer; class Semaphore; + class SemaphoreCreateInfo; class SGPUDevice; class ShaderModule; class ShaderModuleCache; class Swapchain; + class SwapchainCreateInfo; class Window; typedef std::unique_ptr > BaseDeviceUniquePtr; - typedef std::unique_ptr BasePipelineInfoUniquePtr; + typedef std::unique_ptr BasePipelineCreateInfoUniquePtr; + typedef std::unique_ptr BufferCreateInfoUniquePtr; typedef std::unique_ptr > BufferUniquePtr; + typedef std::unique_ptr BufferViewCreateInfoUniquePtr; typedef std::unique_ptr > BufferViewUniquePtr; typedef std::unique_ptr > CommandBufferBaseUniquePtr; typedef std::unique_ptr > CommandPoolUniquePtr; - typedef std::unique_ptr ComputePipelineInfoUniquePtr; + typedef std::unique_ptr ComputePipelineCreateInfoUniquePtr; typedef std::unique_ptr > DescriptorPoolUniquePtr; + typedef std::unique_ptr DescriptorSetCreateInfoUniquePtr; typedef std::unique_ptr > DescriptorSetGroupUniquePtr; - typedef std::unique_ptr DescriptorSetInfoUniquePtr; typedef std::unique_ptr > DescriptorSetLayoutUniquePtr; typedef std::unique_ptr > DescriptorSetLayoutManagerUniquePtr; typedef std::unique_ptr > DescriptorSetUniquePtr; typedef std::unique_ptr > DescriptorUpdateTemplateUniquePtr; + typedef std::unique_ptr EventCreateInfoUniquePtr; typedef std::unique_ptr > EventUniquePtr; + typedef std::unique_ptr FenceCreateInfoUniquePtr; typedef std::unique_ptr > FenceUniquePtr; + typedef std::unique_ptr FramebufferCreateInfoUniquePtr; typedef std::unique_ptr > FramebufferUniquePtr; typedef std::unique_ptr > GLSLShaderToSPIRVGeneratorUniquePtr; - typedef std::unique_ptr GraphicsPipelineInfoUniquePtr; + typedef std::unique_ptr GraphicsPipelineCreateInfoUniquePtr; typedef std::unique_ptr GraphicsPipelineManagerUniquePtr; + typedef std::unique_ptr ImageCreateInfoUniquePtr; typedef std::unique_ptr > ImageUniquePtr; + typedef std::unique_ptr ImageViewCreateInfoUniquePtr; typedef std::unique_ptr > ImageViewUniquePtr; typedef std::unique_ptr > InstanceUniquePtr; typedef std::unique_ptr > MemoryAllocatorUniquePtr; @@ -601,1725 +207,37 @@ namespace Anvil typedef std::unique_ptr > PrimaryCommandBufferUniquePtr; typedef std::unique_ptr > QueryPoolUniquePtr; typedef std::unique_ptr > RenderingSurfaceUniquePtr; + typedef std::unique_ptr RenderPassCreateInfoUniquePtr; typedef std::unique_ptr > RenderPassUniquePtr; - typedef std::unique_ptr RenderPassInfoUniquePtr; + typedef std::unique_ptr SamplerCreateInfoUniquePtr; typedef std::unique_ptr > SamplerUniquePtr; typedef std::unique_ptr > SecondaryCommandBufferUniquePtr; + typedef std::unique_ptr SemaphoreCreateInfoUniquePtr; typedef std::unique_ptr > SemaphoreUniquePtr; typedef std::unique_ptr > SGPUDeviceUniquePtr; typedef std::unique_ptr > ShaderModuleCacheUniquePtr; typedef std::unique_ptr > ShaderModuleUniquePtr; + typedef std::unique_ptr SwapchainCreateInfoUniquePtr; typedef std::unique_ptr > SwapchainUniquePtr; typedef std::unique_ptr > WindowUniquePtr; +}; - /* Describes recognized subpass attachment types */ - enum AttachmentType - { - ATTACHMENT_TYPE_FIRST, - - ATTACHMENT_TYPE_COLOR = ATTACHMENT_TYPE_FIRST, - ATTACHMENT_TYPE_DEPTH_STENCIL, - ATTACHMENT_TYPE_INPUT, - ATTACHMENT_TYPE_PRESERVE, - ATTACHMENT_TYPE_RESOLVE, - - ATTACHMENT_TYPE_COUNT, - ATTACHMENT_TYPE_UNKNOWN = ATTACHMENT_TYPE_COUNT - }; - - typedef enum - { - DYNAMIC_STATE_BLEND_CONSTANTS_BIT = 1 << 0, - DYNAMIC_STATE_DEPTH_BIAS_BIT = 1 << 1, - DYNAMIC_STATE_DEPTH_BOUNDS_BIT = 1 << 2, - DYNAMIC_STATE_LINE_WIDTH_BIT = 1 << 3, - DYNAMIC_STATE_SCISSOR_BIT = 1 << 4, - DYNAMIC_STATE_STENCIL_COMPARE_MASK_BIT = 1 << 5, - DYNAMIC_STATE_STENCIL_REFERENCE_BIT = 1 << 6, - DYNAMIC_STATE_STENCIL_WRITE_MASK_BIT = 1 << 7, - DYNAMIC_STATE_VIEWPORT_BIT = 1 << 8, - } DynamicStateBits; - - typedef uint32_t DynamicStateBitfield; - - /** Describes a buffer memory barrier. */ - typedef struct BufferBarrier - { - VkAccessFlagsVariable(dst_access_mask); - VkAccessFlagsVariable(src_access_mask); - - VkBuffer buffer; - VkBufferMemoryBarrier buffer_barrier_vk; - Anvil::Buffer* buffer_ptr; - uint32_t dst_queue_family_index; - VkDeviceSize offset; - VkDeviceSize size; - uint32_t src_queue_family_index; - - /** Constructor. - * - * Note that @param in_buffer_ptr is retained by this function. - * - * @param in_source_access_mask Source access mask to use for the barrier. - * @param in_destination_access_mask Destination access mask to use for the barrier. - * @param in_src_queue_family_index Source queue family index to use for the barrier. - * @param in_dst_queue_family_index Destination queue family index to use for the barrier. - * @param in_buffer_ptr Pointer to a Buffer instance the instantiated barrier - * refers to. Must not be nullptr. - * @param in_offset Start offset of the region described by the barrier. - * @param in_size Size of the region described by the barrier. - **/ - explicit BufferBarrier(VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - uint32_t in_src_queue_family_index, - uint32_t in_dst_queue_family_index, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_offset, - VkDeviceSize in_size); - - /** Destructor. - * - * Releases the encapsulated Buffer instance. - **/ - virtual ~BufferBarrier(); - - /** Copy constructor. - * - * Retains the Buffer instance stored in the input barrier. - * - * @param in Barrier instance to copy data from. - **/ - BufferBarrier(const BufferBarrier& in); - - /** Returns a Vulkan buffer memory barrier descriptor, whose configuration corresponds to - * to the configuration of this descriptor. - **/ - virtual VkBufferMemoryBarrier get_barrier_vk() const - { - return buffer_barrier_vk; - } - - /** Returns a pointer to the Vulkan descriptor, whose configuration corresponds to - * the configuration of this descriptor. - * - * The returned pointer remains valid for the duration of the Barrier descriptor's - * life-time. - **/ - const VkBufferMemoryBarrier* get_barrier_vk_ptr() const - { - return &buffer_barrier_vk; - } - - private: - BufferBarrier& operator=(const BufferBarrier&); - } BufferBarrier; - - /** Describes component layout of a format */ - typedef enum - { - /* NOTE: If the ordering used below needs to be changed, make sure to also update formats.cpp::layout_to_n_components */ - COMPONENT_LAYOUT_ABGR, - COMPONENT_LAYOUT_ARGB, - COMPONENT_LAYOUT_BGR, - COMPONENT_LAYOUT_BGRA, - COMPONENT_LAYOUT_D, - COMPONENT_LAYOUT_DS, - COMPONENT_LAYOUT_EBGR, - COMPONENT_LAYOUT_R, - COMPONENT_LAYOUT_RG, - COMPONENT_LAYOUT_RGB, - COMPONENT_LAYOUT_RGBA, - COMPONENT_LAYOUT_S, - COMPONENT_LAYOUT_XD, - - COMPONENT_LAYOUT_UNKNOWN - } ComponentLayout; - - typedef enum - { - /* When set, descriptor set allocations will return back to the pool at release time.*/ - DESCRIPTOR_POOL_FLAG_CREATE_FREE_DESCRIPTOR_SET_BIT = 1 << 0, - } DescriptorPoolFlagBits; - - typedef uint32_t DescriptorPoolFlags; - - typedef struct DescriptorSetAllocation - { - /* Descriptor set layout to use for the allocation request */ - const Anvil::DescriptorSetLayout* ds_layout_ptr; - - /* Dummy constructor. Do not use as input for DS allocation functions. */ - DescriptorSetAllocation() - { - ds_layout_ptr = nullptr; - } - - /* Constructor. */ - DescriptorSetAllocation(const Anvil::DescriptorSetLayout* in_ds_layout_ptr); - } DescriptorSetAllocation; - - typedef enum - { - /* Updates dirty DS bindings using vkUpdateDescriptorSet() which is available on all Vulkan implementations. */ - DESCRIPTOR_SET_UPDATE_METHOD_CORE, - - /* Updates dirty DS bindings using vkUpdateDescriptorSetWithTemplateKHR(). Templates are cached across update operations, - * and are release at DescriptorSet release time. - * - * This setting is recommended if you are going to be updating the same set of descriptor set bindings more than once. - * - * Only available on devices supporting VK_KHR_descriptor_update_template extension. - */ - DESCRIPTOR_SET_UPDATE_METHOD_TEMPLATE, - } DescriptorSetUpdateMethod; - - typedef struct DescriptorUpdateTemplateEntry - { - VkDescriptorType descriptor_type; - uint32_t n_descriptors; - uint32_t n_destination_array_element; - uint32_t n_destination_binding; - size_t offset; - size_t stride; - - DescriptorUpdateTemplateEntry() - :descriptor_type (VK_DESCRIPTOR_TYPE_MAX_ENUM), - n_descriptors (UINT32_MAX), - n_destination_array_element(UINT32_MAX), - n_destination_binding (UINT32_MAX), - offset (SIZE_MAX), - stride (SIZE_MAX) - { - /* Stub */ - } - - DescriptorUpdateTemplateEntry(const VkDescriptorType& in_descriptor_type, - const uint32_t& in_n_destination_array_element, - const uint32_t& in_n_destination_binding, - const uint32_t& in_n_descriptors, - const size_t& in_offset, - const size_t& in_stride) - :descriptor_type (in_descriptor_type), - n_descriptors (in_n_descriptors), - n_destination_array_element(in_n_destination_array_element), - n_destination_binding (in_n_destination_binding), - offset (in_offset), - stride (in_stride) - { - /* Stub */ - } - - VkDescriptorUpdateTemplateEntryKHR get_vk_descriptor_update_template_entry_khr() const; - - bool operator==(const DescriptorUpdateTemplateEntry& in_entry) const - { - return (in_entry.descriptor_type == descriptor_type) && - (in_entry.n_descriptors == n_descriptors) && - (in_entry.n_destination_array_element == n_destination_array_element) && - (in_entry.n_destination_binding == n_destination_binding) && - (in_entry.offset == offset) && - (in_entry.stride == stride); - } - - bool operator<(const DescriptorUpdateTemplateEntry& in_entry) const - { - if (in_entry.descriptor_type < descriptor_type) - { - return true; - } - else - if (in_entry.descriptor_type > descriptor_type) - { - return false; - } - - if (in_entry.n_descriptors < n_descriptors) - { - return true; - } - else - if (in_entry.n_descriptors > n_descriptors) - { - return false; - } - - if (in_entry.n_destination_array_element < n_destination_array_element) - { - return true; - } - else - if (in_entry.n_destination_array_element > n_destination_array_element) - { - return false; - } - - if (in_entry.n_destination_binding < n_destination_binding) - { - return true; - } - else - if (in_entry.n_destination_binding > n_destination_binding) - { - return false; - } - - if (in_entry.offset < offset) - { - return true; - } - else - if (in_entry.offset > offset) - { - return false; - } - - if (in_entry.stride < stride) - { - return true; - } - - return false; - } - } DescriptorUpdateTemplateEntry; - - typedef enum - { - EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE, - EXTENSION_AVAILABILITY_IGNORE, - EXTENSION_AVAILABILITY_REQUIRE, - } ExtensionAvailability; - - typedef std::pair DeviceExtensionConfigurationItem; - - /** A struct which tells which extensions must (or should, if supported by the physical device) be enabled - * at device creation time. - */ - typedef struct DeviceExtensionConfiguration - { - ExtensionAvailability amd_draw_indirect_count; - ExtensionAvailability amd_gcn_shader; - ExtensionAvailability amd_gpu_shader_half_float; - ExtensionAvailability amd_gpu_shader_int16; - ExtensionAvailability amd_negative_viewport_height; - ExtensionAvailability amd_rasterization_order; - ExtensionAvailability amd_shader_ballot; - ExtensionAvailability amd_shader_explicit_vertex_parameter; - ExtensionAvailability amd_shader_fragment_mask; - ExtensionAvailability amd_shader_image_load_store_lod; - ExtensionAvailability amd_shader_info; - ExtensionAvailability amd_shader_trinary_minmax; - ExtensionAvailability amd_texture_gather_bias_lod; - - ExtensionAvailability ext_debug_marker; - ExtensionAvailability ext_shader_stencil_export; - ExtensionAvailability ext_shader_subgroup_ballot; - ExtensionAvailability ext_shader_subgroup_vote; - ExtensionAvailability khr_16bit_storage; - ExtensionAvailability khr_bind_memory2; - ExtensionAvailability khr_descriptor_update_template; - ExtensionAvailability khr_maintenance1; - ExtensionAvailability khr_maintenance3; - ExtensionAvailability khr_storage_buffer_storage_class; - ExtensionAvailability khr_surface; - ExtensionAvailability khr_swapchain; - - std::vector other_extensions; - - - DeviceExtensionConfiguration(); - - bool is_supported_by_physical_device(const Anvil::PhysicalDevice* in_physical_device_ptr, - std::vector* out_opt_unsupported_extensions_ptr = nullptr) const; - bool operator== (const DeviceExtensionConfiguration& in) const; - } DeviceExtensionConfiguration; - - /** Tells the type of an Anvil::BaseDevice instance */ - typedef enum - { - /* BaseDevice is implemented by SGPUDevice class */ - DEVICE_TYPE_SINGLE_GPU, - - } DeviceType; - - /** Holds properties of a single Vulkan Extension */ - typedef struct Extension - { - std::string name; - uint32_t version; - - /** Constructor. Initializes the instance using data provided by the driver. - * - * @param in_extension_props Vulkan structure to use for initialization. - **/ - explicit Extension(const VkExtensionProperties& in_extension_props) - { - name = in_extension_props.extensionName; - version = in_extension_props.specVersion; - } - - /** Returns true if @param in_extension_name matches the extension described by the instance. */ - bool operator==(const std::string& in_extension_name) const - { - return name == in_extension_name; - } - } Extension; - - typedef std::vector Extensions; - - typedef struct ExtensionAMDDrawIndirectCountEntrypoints - { - PFN_vkCmdDrawIndexedIndirectCountAMD vkCmdDrawIndexedIndirectCountAMD; - PFN_vkCmdDrawIndirectCountAMD vkCmdDrawIndirectCountAMD; - - ExtensionAMDDrawIndirectCountEntrypoints() - { - vkCmdDrawIndexedIndirectCountAMD = nullptr; - vkCmdDrawIndirectCountAMD = nullptr; - } - } ExtensionAMDDrawIndirectCountEntrypoints; - - typedef struct ExtensionAMDShaderInfoEntrypoints - { - PFN_vkGetShaderInfoAMD vkGetShaderInfoAMD; - - ExtensionAMDShaderInfoEntrypoints() - { - vkGetShaderInfoAMD = nullptr; - } - } ExtensionAMDShaderInfoEntrypoints; - - typedef struct ExtensionEXTDebugMarkerEntrypoints - { - PFN_vkCmdDebugMarkerBeginEXT vkCmdDebugMarkerBeginEXT; - PFN_vkCmdDebugMarkerEndEXT vkCmdDebugMarkerEndEXT; - PFN_vkCmdDebugMarkerInsertEXT vkCmdDebugMarkerInsertEXT; - PFN_vkDebugMarkerSetObjectNameEXT vkDebugMarkerSetObjectNameEXT; - PFN_vkDebugMarkerSetObjectTagEXT vkDebugMarkerSetObjectTagEXT; - - ExtensionEXTDebugMarkerEntrypoints() - { - vkCmdDebugMarkerBeginEXT = nullptr; - vkCmdDebugMarkerEndEXT = nullptr; - vkCmdDebugMarkerInsertEXT = nullptr; - vkDebugMarkerSetObjectNameEXT = nullptr; - vkDebugMarkerSetObjectTagEXT = nullptr; - } - } ExtensionEXTDebugMarkerEntrypoints; - - typedef struct ExtensionEXTDebugReportEntrypoints - { - PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallbackEXT; - PFN_vkDestroyDebugReportCallbackEXT vkDestroyDebugReportCallbackEXT; - - ExtensionEXTDebugReportEntrypoints() - { - vkCreateDebugReportCallbackEXT = nullptr; - vkDestroyDebugReportCallbackEXT = nullptr; - } - } ExtensionEXTDebugReportEntrypoints; - - typedef struct ExtensionKHRBindMemory2Entrypoints - { - PFN_vkBindBufferMemory2KHR vkBindBufferMemory2KHR; - PFN_vkBindImageMemory2KHR vkBindImageMemory2KHR; - - ExtensionKHRBindMemory2Entrypoints() - { - vkBindBufferMemory2KHR = nullptr; - vkBindImageMemory2KHR = nullptr; - } - } ExtensionKHRBindMemory2Entrypoints; - - typedef struct ExtensionKHRDescriptorUpdateTemplateEntrypoints - { - PFN_vkCreateDescriptorUpdateTemplateKHR vkCreateDescriptorUpdateTemplateKHR; - PFN_vkDestroyDescriptorUpdateTemplateKHR vkDestroyDescriptorUpdateTemplateKHR; - PFN_vkUpdateDescriptorSetWithTemplateKHR vkUpdateDescriptorSetWithTemplateKHR; - - ExtensionKHRDescriptorUpdateTemplateEntrypoints() - { - vkCreateDescriptorUpdateTemplateKHR = nullptr; - vkDestroyDescriptorUpdateTemplateKHR = nullptr; - vkUpdateDescriptorSetWithTemplateKHR = nullptr; - } - } ExtensionKHRDescriptorUpdateTemplateEntrypoints; - - typedef struct ExtensionKHRGetPhysicalDeviceProperties2 - { - PFN_vkGetPhysicalDeviceFeatures2KHR vkGetPhysicalDeviceFeatures2KHR; - PFN_vkGetPhysicalDeviceFormatProperties2KHR vkGetPhysicalDeviceFormatProperties2KHR; - PFN_vkGetPhysicalDeviceImageFormatProperties2KHR vkGetPhysicalDeviceImageFormatProperties2KHR; - PFN_vkGetPhysicalDeviceMemoryProperties2KHR vkGetPhysicalDeviceMemoryProperties2KHR; - PFN_vkGetPhysicalDeviceProperties2KHR vkGetPhysicalDeviceProperties2KHR; - PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR vkGetPhysicalDeviceQueueFamilyProperties2KHR; - PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR vkGetPhysicalDeviceSparseImageFormatProperties2KHR; - - ExtensionKHRGetPhysicalDeviceProperties2() - { - vkGetPhysicalDeviceFeatures2KHR = nullptr; - vkGetPhysicalDeviceFormatProperties2KHR = nullptr; - vkGetPhysicalDeviceImageFormatProperties2KHR = nullptr; - vkGetPhysicalDeviceMemoryProperties2KHR = nullptr; - vkGetPhysicalDeviceProperties2KHR = nullptr; - vkGetPhysicalDeviceQueueFamilyProperties2KHR = nullptr; - vkGetPhysicalDeviceSparseImageFormatProperties2KHR = nullptr; - } - } ExtensionKHRGetPhysicalDeviceProperties2; - - typedef struct ExtensionKHRMaintenance1Entrypoints - { - PFN_vkTrimCommandPoolKHR vkTrimCommandPoolKHR; - - ExtensionKHRMaintenance1Entrypoints() - { - vkTrimCommandPoolKHR = nullptr; - } - } ExtensionKHRMaintenance1Entrypoints; - - typedef struct ExtensionKHRMaintenance3Entrypoints - { - PFN_vkGetDescriptorSetLayoutSupportKHR vkGetDescriptorSetLayoutSupportKHR; - - ExtensionKHRMaintenance3Entrypoints() - { - vkGetDescriptorSetLayoutSupportKHR = nullptr; - } - } ExtensionKHRMaintenance3Entrypoints; - - typedef struct ExtensionKHRSurfaceEntrypoints - { - PFN_vkDestroySurfaceKHR vkDestroySurfaceKHR; - PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR; - PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR; - PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR; - PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupportKHR; - - ExtensionKHRSurfaceEntrypoints() - { - vkDestroySurfaceKHR = nullptr; - vkGetPhysicalDeviceSurfaceCapabilitiesKHR = nullptr; - vkGetPhysicalDeviceSurfaceFormatsKHR = nullptr; - vkGetPhysicalDeviceSurfacePresentModesKHR = nullptr; - vkGetPhysicalDeviceSurfaceSupportKHR = nullptr; - } - } ExtensionKHRSurfaceEntrypoints; - - typedef struct ExtensionKHRSwapchainEntrypoints - { - PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR; - PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR; - PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR; - PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR; - PFN_vkQueuePresentKHR vkQueuePresentKHR; - - ExtensionKHRSwapchainEntrypoints() - { - vkAcquireNextImageKHR = nullptr; - vkCreateSwapchainKHR = nullptr; - vkDestroySwapchainKHR = nullptr; - vkGetSwapchainImagesKHR = nullptr; - vkQueuePresentKHR = nullptr; - } - } ExtensionKHRSwapchainEntrypoints; - - #ifdef _WIN32 - #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) - typedef struct ExtensionKHRWin32SurfaceEntrypoints - { - PFN_vkCreateWin32SurfaceKHR vkCreateWin32SurfaceKHR; - PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR vkGetPhysicalDeviceWin32PresentationSupportKHR; - - ExtensionKHRWin32SurfaceEntrypoints() - { - vkCreateWin32SurfaceKHR = nullptr; - vkGetPhysicalDeviceWin32PresentationSupportKHR = nullptr; - } - } ExtensionKHRWin32SurfaceEntrypoints; - #endif - #else - #if defined(ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT) - typedef struct ExtensionKHRXcbSurfaceEntrypoints - { - PFN_vkCreateXcbSurfaceKHR vkCreateXcbSurfaceKHR; - - ExtensionKHRXcbSurfaceEntrypoints() - { - vkCreateXcbSurfaceKHR = nullptr; - } - } ExtensionKHRXcbSurfaceEntrypoints; - #endif - #endif - - /** Holds driver-specific format capabilities */ - typedef struct FormatProperties - { - VkFormatFeatureFlagsVariable(buffer_capabilities); - VkFormatFeatureFlagsVariable(linear_tiling_capabilities); - VkFormatFeatureFlagsVariable(optimal_tiling_capabilities); - - /* Tells whether the format can be used with functions introduced in VK_AMD_texture_gather_bias_lod */ - bool supports_amd_texture_gather_bias_lod; - - /** Dummy constructor */ - FormatProperties() - { - memset(this, - 0, - sizeof(*this) ); - } - - /** Constructor. Initializes the instance using data provided by the driver. - * - * @param in_format_props Vulkan structure to use for initialization. - **/ - FormatProperties(const VkFormatProperties& in_format_props) - { - buffer_capabilities = in_format_props.bufferFeatures; - linear_tiling_capabilities = in_format_props.linearTilingFeatures; - optimal_tiling_capabilities = in_format_props.optimalTilingFeatures; - supports_amd_texture_gather_bias_lod = false; - } - } FormatProperties; - - extern bool operator==(const FormatProperties& in1, - const FormatProperties& in2); - - typedef enum - { - FORMAT_TYPE_SFLOAT, - FORMAT_TYPE_SFLOAT_UINT, - FORMAT_TYPE_SINT, - FORMAT_TYPE_SNORM, - FORMAT_TYPE_SRGB, - FORMAT_TYPE_SSCALED, - FORMAT_TYPE_UFLOAT, - FORMAT_TYPE_UINT, - FORMAT_TYPE_UNORM, - FORMAT_TYPE_UNORM_UINT, - FORMAT_TYPE_USCALED, - - FORMAT_TYPE_UNKNOWN, - } FormatType; - +/* Defines various enums used by Vulkan API wrapper classes. */ +namespace Anvil +{ /** ID of an Anvil framebuffer's attachment */ typedef uint32_t FramebufferAttachmentID; - /** Describes an image memory barrier. */ - typedef struct ImageBarrier - { - VkAccessFlagsVariable(dst_access_mask); - VkAccessFlagsVariable(src_access_mask); - - bool by_region; - uint32_t dst_queue_family_index; - VkImage image; - VkImageMemoryBarrier image_barrier_vk; - Anvil::Image* image_ptr; - VkImageLayout new_layout; - VkImageLayout old_layout; - uint32_t src_queue_family_index; - VkImageSubresourceRange subresource_range; - - /** Constructor. - * - * Note that @param in_image_ptr is retained by this function. - * - * @param in_source_access_mask Source access mask to use for the barrier. - * @param in_destination_access_mask Destination access mask to use for the barrier. - * @param in_by_region_barrier true if this is a by-region barrier. - * @param in_old_layout Old layout of @param in_image_ptr to use for the barrier. - * @param in_new_layout New layout of @param in_image_ptr to use for the barrier. - * @param in_src_queue_family_index Source queue family index to use for the barrier. - * @param in_dst_queue_family_index Destination queue family index to use for the barrier. - * @param in_image_ptr Image instance the barrier refers to. May be nullptr, in which case - * "image" and "image_ptr" fields will be set to nullptr. - * The instance will be retained by this function. - * @param in_image_subresource_range Subresource range to use for the barrier. - * - **/ - ImageBarrier(VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region_barrier, - VkImageLayout in_old_layout, - VkImageLayout in_new_layout, - uint32_t in_src_queue_family_index, - uint32_t in_dst_queue_family_index, - Anvil::Image* in_image_ptr, - VkImageSubresourceRange in_image_subresource_range); - - /** Destructor. - * - * Releases the encapsulated Image instance. - **/ - virtual ~ImageBarrier(); - - /** Copy constructor. - * - * Retains the Image instance stored in the input barrier. - * - * @param in Barrier instance to copy data from. - **/ - ImageBarrier(const ImageBarrier& in); - - /** Returns a Vulkan memory barrier descriptor, whose configuration corresponds to - * to the configuration of this descriptor. - **/ - virtual VkImageMemoryBarrier get_barrier_vk() const - { - return image_barrier_vk; - } - - /** Returns a pointer to the Vulkan descriptor, whose configuration corresponds to - * the configuration of this descriptor. - * - * The returned pointer remains valid for the duration of the Barrier descriptor's - * life-time. - **/ - const VkImageMemoryBarrier* get_barrier_vk_ptr() const - { - return &image_barrier_vk; - } - - private: - ImageBarrier& operator=(const ImageBarrier&); - } ImageBarrier; - - enum ImageCreateFlagBits - { - IMAGE_CREATE_FLAG_MUTABLE_FORMAT_BIT = 1 << 0, - IMAGE_CREATE_FLAG_CUBE_COMPATIBLE_BIT = 1 << 1, - - /* NOTE: Requires VK_KHR_maintenance1 */ - IMAGE_CREATE_FLAG_2D_ARRAY_COMPATIBLE_BIT = 1 << 2, - }; - typedef uint32_t ImageCreateFlags; - - class IMemoryAllocatorBackendBase - { - public: - virtual ~IMemoryAllocatorBackendBase() - { - /* Stub */ - } - - virtual bool supports_baking() const = 0; - }; - - /* Holds 16-bit storage features */ - typedef struct KHR16BitStorageFeatures - { - bool is_input_output_storage_supported; - bool is_push_constant_16_bit_storage_supported; - bool is_storage_buffer_16_bit_access_supported; - bool is_uniform_and_storage_buffer_16_bit_access_supported; - - KHR16BitStorageFeatures() - { - is_input_output_storage_supported = false; - is_push_constant_16_bit_storage_supported = false; - is_storage_buffer_16_bit_access_supported = false; - is_uniform_and_storage_buffer_16_bit_access_supported = false; - } - - KHR16BitStorageFeatures(const VkPhysicalDevice16BitStorageFeaturesKHR& in_features); - - VkPhysicalDevice16BitStorageFeaturesKHR get_vk_physical_device_16_bit_storage_features() const; - - bool operator==(const KHR16BitStorageFeatures& in_features) const; - } KHR16BitStorageFeatures; - - typedef struct KHRMaintenance3Properties - { - VkDeviceSize max_memory_allocation_size; - uint32_t max_per_set_descriptors; - - KHRMaintenance3Properties(); - KHRMaintenance3Properties(const VkPhysicalDeviceMaintenance3PropertiesKHR& in_props); - - bool operator==(const KHRMaintenance3Properties&) const; - - } KHRMaintenance3Properties; - - /** Holds properties of a single Vulkan Layer. */ - typedef struct Layer - { - std::string description; - std::vector extensions; - uint32_t implementation_version; - std::string name; - uint32_t spec_version; - - /** Dummy constructor. - * - * @param in_layer_name Name to use for the layer. - **/ - Layer(const std::string& in_layer_name) - { - implementation_version = 0; - name = in_layer_name; - spec_version = 0; - } - - /** Constructor. Initializes the instance using data provided by the driver. - * - * @param in_layer_props Vulkan structure to use for initialization. - **/ - Layer(const VkLayerProperties& in_layer_props) - { - description = in_layer_props.description; - implementation_version = in_layer_props.implementationVersion; - name = in_layer_props.layerName; - spec_version = in_layer_props.specVersion; - } - - /** Returns true if @param in_layer_name matches the layer name described by the instance. */ - bool operator==(const std::string& in_layer_name) const - { - return name == in_layer_name; - } - } Layer; - - typedef std::vector Layers; - - /** Describes a Vulkan memory barrier. */ - typedef struct MemoryBarrier - { - VkAccessFlagsVariable(destination_access_mask); - VkAccessFlagsVariable(source_access_mask); - - VkMemoryBarrier memory_barrier_vk; - - /** Constructor. - * - * @param in_source_access_mask Source access mask of the Vulkan memory barrier. - * @param in_destination_access_mask Destination access mask of the Vulkan memory barrier. - * - **/ - explicit MemoryBarrier(VkAccessFlags in_destination_access_mask, - VkAccessFlags in_source_access_mask) - { - destination_access_mask = static_cast(in_destination_access_mask); - source_access_mask = static_cast(in_source_access_mask); - - memory_barrier_vk.dstAccessMask = destination_access_mask; - memory_barrier_vk.pNext = nullptr; - memory_barrier_vk.srcAccessMask = source_access_mask; - memory_barrier_vk.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER; - } - - /** Destructor. */ - virtual ~MemoryBarrier() - { - /* Stub */ - } - - /** Returns a Vulkan memory barrier descriptor, whose configuration corresponds to - * to the configuration of this descriptor. - **/ - virtual VkMemoryBarrier get_barrier_vk() const - { - return memory_barrier_vk; - } - - /** Returns a pointer to the Vulkan descriptor, whose configuration corresponds to - * the configuration of this descriptor. - * - * The returned pointer remains valid for the duration of the Barrier descriptor's - * life-time. - **/ - virtual const VkMemoryBarrier* get_barrier_vk_ptr() const - { - return &memory_barrier_vk; - } - } MemoryBarrier; - - /** Holds properties of a single Vulkan Memory Heap. */ - typedef struct MemoryHeap - { - VkMemoryHeapFlagsVariable(flags); - - VkDeviceSize size; - - /** Stub constructor */ - MemoryHeap() - { - flags = 0; - size = 0; - } - } MemoryHeap; - - extern bool operator==(const MemoryHeap& in1, - const MemoryHeap& in2); - - typedef std::vector MemoryHeaps; - - enum MemoryFeatureFlagBits - { - /* NOTE: If more memory feature flags are added here, make sure to also update Anvil::Utils::get_vk_property_flags_from_memory_feature_flags() - * and Anvil::Utils::get_memory_feature_flags_from_vk_property_flags() - */ - - MEMORY_FEATURE_FLAG_DEVICE_LOCAL = 1 << 0, - MEMORY_FEATURE_FLAG_HOST_CACHED = 1 << 1, - MEMORY_FEATURE_FLAG_HOST_COHERENT = 1 << 2, - MEMORY_FEATURE_FLAG_LAZILY_ALLOCATED = 1 << 3, - MEMORY_FEATURE_FLAG_MAPPABLE = 1 << 4, - }; - typedef uint32_t MemoryFeatureFlags; - - /** Holds properties of a single Vulkan Memory Type. */ - typedef struct MemoryType - { - MemoryFeatureFlags features; - MemoryHeap* heap_ptr; - - VkMemoryPropertyFlagsVariable(flags); - - /** Constructor. Initializes the instance using data provided by the driver. - * - * @param in_type Vulkan structure to use for initialization. - * @param in_memory_props_ptr Used to initialize the MemoryHeap pointer member. Must not be nullptr. - **/ - explicit MemoryType(const VkMemoryType& in_type, - struct MemoryProperties* in_memory_props_ptr); - } MemoryType; - - extern bool operator==(const MemoryType& in1, - const MemoryType& in2); - - typedef std::vector MemoryTypes; - - /** Holds information about available memory heaps & types for a specific physical device. */ - typedef struct MemoryProperties - { - MemoryHeap* heaps; - uint32_t n_heaps; - MemoryTypes types; - - MemoryProperties() - { - heaps = nullptr; - n_heaps = 0; - } - - /** Destructor */ - ~MemoryProperties() - { - if (heaps != nullptr) - { - delete [] heaps; - - heaps = nullptr; - } - } - - /** Constructor. Initializes the instance using data provided by the driver. - * - * @param in_mem_properties Vulkan structure to use for initialization. - **/ - void init(const VkPhysicalDeviceMemoryProperties& in_mem_properties); - - private: - MemoryProperties (const MemoryProperties&); - MemoryProperties& operator=(const MemoryProperties&); - } MemoryProperties; - - extern bool operator==(const MemoryProperties& in1, - const MemoryProperties& in2); - - /** Defines data for a single image mip-map. - * - * Use one of the static create_() functions to set up structure fields according to the target - * image type. - **/ - typedef struct MipmapRawData - { - /* Image aspect the mip-map data is specified for. */ - VkImageAspectFlagBits aspect; - - /* Start layer index */ - uint32_t n_layer; - - /* Number of layers to update */ - uint32_t n_layers; - - /* Number of 3D texture slices to update. For non-3D texture types, this field - * should be set to 1. */ - uint32_t n_slices; - - - /* Index of the mip-map to update. */ - uint32_t n_mipmap; - - - /* Pointer to a buffer holding raw data representation. The data structure is characterized by - * data_size, row_size and slice_size fields. - * - * It is assumed the data under the pointer is tightly packed, and stored in column->row->slice->layer - * order. - */ - std::shared_ptr linear_tightly_packed_data_uchar_ptr; - const unsigned char* linear_tightly_packed_data_uchar_raw_ptr; - std::shared_ptr > linear_tightly_packed_data_uchar_vec_ptr; - - - /* Total number of bytes available for reading under linear_tightly_packed_data_ptr */ - uint32_t data_size; - - /* Number of bytes each row takes */ - uint32_t row_size; - - - /** Creates a MipmapRawData instance which can be used to upload data to 1D Image instances: - * - * @param in_aspect Image aspect to modify. - * @param in_n_mipmap Index of the mipmap to be updated. - * @param in_linear_tightly_packed_data_ptr Pointer to raw mip-map data. - * @param in_linear_tightly_packed_data_vector_ptr Vector holding raw mip-map data. - * @param in_row_size Number of bytes each texture row takes. - * - * NOTE: Mipmap contents is NOT cached at call time. This implies raw pointers are ASSUMED to - * be valid at baking time. - * - * @return As per description. - **/ - static MipmapRawData create_1D_from_uchar_ptr (VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - std::shared_ptr in_linear_tightly_packed_data_ptr, - uint32_t in_row_size); - static MipmapRawData create_1D_from_uchar_ptr (VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - const unsigned char* in_linear_tightly_packed_data_vector_ptr, - uint32_t in_row_size); - static MipmapRawData create_1D_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - std::shared_ptr > in_linear_tightly_packed_data_ptr, - uint32_t in_row_size); - - /** Creates a MipmapRawData instance which can be used to upload data to 1D Array Image instances: - * - * @param in_aspect Image aspect to modify. - * @param in_n_layer Index of a texture layer the mip-map data should be uploaded to. - * @param in_n_layers Number of texture layers to be updated. - * @param in_n_mipmap Index of the mipmap to be updated. - * @param in_linear_tightly_packed_data_ptr Pointer to raw mip-map data. - * @param in_linear_tightly_packed_data_vector_ptr Vector holding raw mip-map data. - * @param in_row_size Number of bytes each texture row takes. - * @param in_data_size Number of bytes available for reading under @param in_linear_tightly_packed_data_ptr. - * - * @return As per description. - **/ - static MipmapRawData create_1D_array_from_uchar_ptr (VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - std::shared_ptr in_linear_tightly_packed_data_ptr, - uint32_t in_row_size, - uint32_t in_data_size); - static MipmapRawData create_1D_array_from_uchar_ptr (VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - const unsigned char* in_linear_tightly_packed_data_ptr, - uint32_t in_row_size, - uint32_t in_data_size); - static MipmapRawData create_1D_array_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - std::shared_ptr > in_linear_tightly_packed_data_ptr, - uint32_t in_row_size, - uint32_t in_data_size); - - /** Creates a MipmapRawData instance which can be used to upload data to 2D Image instances: - * - * @param in_aspect Image aspect to modify. - * @param in_n_mipmap Index of the mipmap to be updated. - * @param in_linear_tightly_packed_data_ptr Pointer to raw mip-map data. - * @param in_linear_tightly_packed_data_vector_ptr Vector holding raw mip-map data. - * @param in_data_size Number of bytes available for reading under @param in_linear_tightly_packed_data_ptr. - * @param in_row_size Number of bytes each texture row takes. - * - * @return As per description. - **/ - static MipmapRawData create_2D_from_uchar_ptr (VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - std::shared_ptr in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size); - static MipmapRawData create_2D_from_uchar_ptr (VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - const unsigned char* in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size); - static MipmapRawData create_2D_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - std::shared_ptr > in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size); - - /** Creates a MipmapRawData instance which can be used to upload data to 2D Array Image instances: - * - * @param in_aspect Image aspect to modify. - * @param in_n_layer Index of a texture layer the mip-map data should be uploaded to. - * @param in_n_layers Number of texture layers to be updated. - * @param in_n_mipmap Index of the mipmap to be updated. - * @param in_linear_tightly_packed_data_ptr Pointer to raw mip-map data. - * @param in_linear_tightly_packed_data_vector_ptr Vector holding raw mip-map data. - * @param in_data_size Number of bytes available for reading under @param in_linear_tightly_packed_data_ptr. - * @param in_row_size Number of bytes each texture row takes. - * - * @return As per description. - **/ - static MipmapRawData create_2D_array_from_uchar_ptr (VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - std::shared_ptr in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size); - static MipmapRawData create_2D_array_from_uchar_ptr (VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - const unsigned char* in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size); - static MipmapRawData create_2D_array_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - std::shared_ptr > in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size); - - /** Creates a MipmapRawData instnce which can be used to upload data to 3D Image instances: - * - * @param in_aspect Image aspect to modify. - * @param in_n_layer Index of a texture layer the mip-map data should be uploaded to. - * @param in_n_slices Number of texture slices to be updated. - * @param in_n_mipmap Index of the mipmap to be updated. - * @param in_linear_tightly_packed_data_ptr Pointer to raw mip-map data. - * @param in_linear_tightly_packed_data_vector_ptr Vector holding raw mip-map data. - * @param in_slice_data_size Number of bytes available for reading under @param in_linear_tightly_packed_data_ptr for a single slice. - * @param in_row_size Number of bytes each texture row takes. - * - * @return As per description. - **/ - static MipmapRawData create_3D_from_uchar_ptr (VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layer_slices, - uint32_t in_n_mipmap, - std::shared_ptr in_linear_tightly_packed_data_ptr, - uint32_t in_slice_data_size, - uint32_t in_row_size); - static MipmapRawData create_3D_from_uchar_ptr (VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layer_slices, - uint32_t in_n_mipmap, - const unsigned char* in_linear_tightly_packed_data_ptr, - uint32_t in_slice_data_size, - uint32_t in_row_size); - static MipmapRawData create_3D_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layer_slices, - uint32_t in_n_mipmap, - std::shared_ptr > in_linear_tightly_packed_data_ptr, - uint32_t in_slice_data_size, - uint32_t in_row_size); - - /** Creates a MipmapRawData instance which can be used to upload data to Cube Map Image instances: - * - * @param in_aspect Image aspect to modify. - * @param in_n_layer Index of a texture layer the mip-map data should be uploaded to. - * Valid values and corresponding cube map faces: 0: -X, 1: -Y, 2: -Z, 3: +X, 4: +Y, 5: +Z - * @param in_n_mipmap Index of the mipmap to be updated. - * @param in_linear_tightly_packed_data_ptr Pointer to raw mip-map data. - * @param in_linear_tightly_packed_data_vector_ptr Vector holding raw mip-map data. - * @param in_data_size Number of bytes available for reading under @param in_linear_tightly_packed_data_ptr. - * @param in_row_size Number of bytes each texture row takes. - * - * @return As per description. - **/ - static MipmapRawData create_cube_map_from_uchar_ptr (VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_mipmap, - std::shared_ptr in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size); - static MipmapRawData create_cube_map_from_uchar_ptr (VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_mipmap, - const unsigned char* in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size); - static MipmapRawData create_cube_map_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_mipmap, - std::shared_ptr > in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size); - - /** Creates a MipmapRawData instance which can be used to upload data to Cube Map Array Image instances: - * - * @param in_aspect Image aspect to modify. - * @param in_n_layer Index of a texture layer the mip-map data should be uploaded to. - * Cube map faces, as selected for layer at index (n_layer % 6), are: - * 0: -X, 1: -Y, 2: -Z, 3: +X, 4: +Y, 5: +Z - * @param in_n_layers Number of texture layers to update. - * @param in_n_mipmap Index of the mipmap to be updated. - * @param in_linear_tightly_packed_data_ptr Pointer to raw mip-map data. - * @param in_linear_tightly_packed_data_vector_ptr Vector holding raw mip-map data. - * @param in_data_size Number of bytes available for reading under @param in_linear_tightly_packed_data_ptr. - * @param in_row_size Number of bytes each texture row takes. - * - * @return As per description. - **/ - static MipmapRawData create_cube_map_array_from_uchar_ptr (VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - std::shared_ptr in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size); - static MipmapRawData create_cube_map_array_from_uchar_ptr (VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - const unsigned char* in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size); - static MipmapRawData create_cube_map_array_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - std::shared_ptr > in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size); - - private: - static MipmapRawData create_1D (VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - uint32_t in_row_size); - static MipmapRawData create_1D_array(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - uint32_t in_row_size, - uint32_t in_data_size); - static MipmapRawData create_2D (VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - uint32_t in_data_size, - uint32_t in_row_size); - static MipmapRawData create_2D_array(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - uint32_t in_data_size, - uint32_t in_row_size); - static MipmapRawData create_3D (VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_slices, - uint32_t in_n_mipmap, - uint32_t in_data_size, - uint32_t in_row_size); - } MipmapRawData; - - typedef enum - { - MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, - MT_SAFETY_ENABLED, - MT_SAFETY_DISABLED - } MTSafety; - - /* Dummy delete functor */ - template - struct NullDeleter - { - void operator()(Type* in_unused_ptr) - { - in_unused_ptr; - } - }; - - typedef enum - { - /* NOTE: If new entries are added or existing entry order is modified, make sure to - * update Anvil::ObjectTracker::get_object_type_name(). - */ - OBJECT_TYPE_FIRST, - - OBJECT_TYPE_BUFFER = OBJECT_TYPE_FIRST, - OBJECT_TYPE_BUFFER_VIEW, - OBJECT_TYPE_COMMAND_BUFFER, - OBJECT_TYPE_COMMAND_POOL, - OBJECT_TYPE_COMPUTE_PIPELINE_MANAGER, - OBJECT_TYPE_DESCRIPTOR_POOL, - OBJECT_TYPE_DESCRIPTOR_SET, - OBJECT_TYPE_DESCRIPTOR_SET_GROUP, - OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT, - OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_MANAGER, - OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE, - OBJECT_TYPE_DEVICE, - OBJECT_TYPE_EVENT, - OBJECT_TYPE_FENCE, - OBJECT_TYPE_FRAMEBUFFER, - OBJECT_TYPE_GRAPHICS_PIPELINE_MANAGER, - OBJECT_TYPE_IMAGE, - OBJECT_TYPE_IMAGE_VIEW, - OBJECT_TYPE_INSTANCE, - OBJECT_TYPE_MEMORY_BLOCK, - OBJECT_TYPE_PHYSICAL_DEVICE, - OBJECT_TYPE_PIPELINE_CACHE, - OBJECT_TYPE_PIPELINE_LAYOUT, - OBJECT_TYPE_PIPELINE_LAYOUT_MANAGER, - OBJECT_TYPE_QUERY_POOL, - OBJECT_TYPE_QUEUE, - OBJECT_TYPE_RENDER_PASS, - OBJECT_TYPE_RENDERING_SURFACE, - OBJECT_TYPE_SAMPLER, - OBJECT_TYPE_SEMAPHORE, - OBJECT_TYPE_SHADER_MODULE, - OBJECT_TYPE_SWAPCHAIN, - - OBJECT_TYPE_GLSL_SHADER_TO_SPIRV_GENERATOR, - OBJECT_TYPE_GRAPHICS_PIPELINE, - - /* Always last */ - OBJECT_TYPE_COUNT, - OBJECT_TYPE_UNKNOWN = OBJECT_TYPE_COUNT - } ObjectType; - - /** Defines, to what extent occlusion queries are going to be used. - * - * Only used for second-level command buffer recording policy declaration. - **/ - typedef enum - { - /** Occlusion queries are not going to be used */ - OCCLUSION_QUERY_SUPPORT_SCOPE_NOT_REQUIRED, - - /** Non-precise occlusion queries may be used */ - OCCLUSION_QUERY_SUPPORT_SCOPE_REQUIRED_NONPRECISE, - - /** Pprecise occlusion queries may be used */ - OCCLUSION_QUERY_SUPPORT_SCOPE_REQUIRED_PRECISE, - } OcclusionQuerySupportScope; - - typedef struct PhysicalDeviceFeaturesCoreVK10 - { - bool alpha_to_one; - bool depth_bias_clamp; - bool depth_bounds; - bool depth_clamp; - bool draw_indirect_first_instance; - bool dual_src_blend; - bool fill_mode_non_solid; - bool fragment_stores_and_atomics; - bool full_draw_index_uint32; - bool geometry_shader; - bool image_cube_array; - bool independent_blend; - bool inherited_queries; - bool large_points; - bool logic_ip; - bool multi_draw_indirect; - bool multi_viewport; - bool occlusion_query_precise; - bool pipeline_statistics_query; - bool robust_buffer_access; - bool sampler_anisotropy; - bool sample_rate_shading; - bool shader_clip_distance; - bool shader_cull_distance; - bool shader_float64; - bool shader_image_gather_extended; - bool shader_int16; - bool shader_int64; - bool shader_resource_residency; - bool shader_resource_min_lod; - bool shader_sampled_image_array_dynamic_indexing; - bool shader_storage_buffer_array_dynamic_indexing; - bool shader_storage_image_array_dynamic_indexing; - bool shader_storage_image_extended_formats; - bool shader_storage_image_multisample; - bool shader_storage_image_read_without_format; - bool shader_storage_image_write_without_format; - bool shader_tessellation_and_geometry_point_size; - bool shader_uniform_buffer_array_dynamic_indexing; - bool sparse_binding; - bool sparse_residency_2_samples; - bool sparse_residency_4_samples; - bool sparse_residency_8_samples; - bool sparse_residency_16_samples; - bool sparse_residency_aliased; - bool sparse_residency_buffer; - bool sparse_residency_image_2D; - bool sparse_residency_image_3D; - bool tessellation_shader; - bool texture_compression_ASTC_LDR; - bool texture_compression_BC; - bool texture_compression_ETC2; - bool variable_multisample_rate; - bool vertex_pipeline_stores_and_atomics; - bool wide_lines; - - VkPhysicalDeviceFeatures get_vk_physical_device_features() const; - bool operator== (const PhysicalDeviceFeaturesCoreVK10& in_data) const; - - PhysicalDeviceFeaturesCoreVK10(); - PhysicalDeviceFeaturesCoreVK10(const VkPhysicalDeviceFeatures& in_physical_device_features); - - } PhysicalDeviceFeaturesCoreVK10; - - typedef struct PhysicalDeviceFeatures - { - const PhysicalDeviceFeaturesCoreVK10* core_vk1_0_features_ptr; - const KHR16BitStorageFeatures* khr_16bit_storage_features_ptr; - - PhysicalDeviceFeatures() - { - core_vk1_0_features_ptr = nullptr; - khr_16bit_storage_features_ptr = nullptr; - } - - PhysicalDeviceFeatures(const PhysicalDeviceFeaturesCoreVK10* in_core_vk1_0_features_ptr, - const KHR16BitStorageFeatures* in_khr_16_bit_storage_features_ptr) - { - core_vk1_0_features_ptr = in_core_vk1_0_features_ptr; - khr_16bit_storage_features_ptr = in_khr_16_bit_storage_features_ptr; - } - - bool operator==(const PhysicalDeviceFeatures& in_physical_device_features) const; - } PhysicalDeviceFeatures; - - typedef struct PhysicalDeviceLimits - { - VkDeviceSize buffer_image_granularity; - uint32_t discrete_queue_priorities; - VkSampleCountFlags framebuffer_color_sample_counts; - VkSampleCountFlags framebuffer_depth_sample_counts; - VkSampleCountFlags framebuffer_no_attachments_sample_counts; - VkSampleCountFlags framebuffer_stencil_sample_counts; - float line_width_granularity; - float line_width_range[2]; - uint32_t max_bound_descriptor_sets; - uint32_t max_clip_distances; - uint32_t max_color_attachments; - uint32_t max_combined_clip_and_cull_distances; - uint32_t max_compute_shared_memory_size; - uint32_t max_compute_work_group_count[3]; - uint32_t max_compute_work_group_invocations; - uint32_t max_compute_work_group_size[3]; - uint32_t max_cull_distances; - uint32_t max_descriptor_set_input_attachments; - uint32_t max_descriptor_set_sampled_images; - uint32_t max_descriptor_set_samplers; - uint32_t max_descriptor_set_storage_buffers; - uint32_t max_descriptor_set_storage_buffers_dynamic; - uint32_t max_descriptor_set_storage_images; - uint32_t max_descriptor_set_uniform_buffers; - uint32_t max_descriptor_set_uniform_buffers_dynamic; - uint32_t max_draw_indexed_index_value; - uint32_t max_draw_indirect_count; - uint32_t max_fragment_combined_output_resources; - uint32_t max_fragment_dual_src_attachments; - uint32_t max_fragment_input_components; - uint32_t max_fragment_output_attachments; - uint32_t max_framebuffer_height; - uint32_t max_framebuffer_layers; - uint32_t max_framebuffer_width; - uint32_t max_geometry_input_components; - uint32_t max_geometry_output_components; - uint32_t max_geometry_output_vertices; - uint32_t max_geometry_shader_invocations; - uint32_t max_geometry_total_output_components; - uint32_t max_image_array_layers; - uint32_t max_image_dimension_1D; - uint32_t max_image_dimension_2D; - uint32_t max_image_dimension_3D; - uint32_t max_image_dimension_cube; - float max_interpolation_offset; - uint32_t max_memory_allocation_count; - uint32_t max_per_stage_descriptor_input_attachments; - uint32_t max_per_stage_descriptor_sampled_images; - uint32_t max_per_stage_descriptor_samplers; - uint32_t max_per_stage_descriptor_storage_buffers; - uint32_t max_per_stage_descriptor_storage_images; - uint32_t max_per_stage_descriptor_uniform_buffers; - uint32_t max_per_stage_resources; - uint32_t max_push_constants_size; - uint32_t max_sample_mask_words; - uint32_t max_sampler_allocation_count; - float max_sampler_anisotropy; - float max_sampler_lod_bias; - uint32_t max_storage_buffer_range; - uint32_t max_viewport_dimensions[2]; - uint32_t max_viewports; - uint32_t max_tessellation_control_per_patch_output_components; - uint32_t max_tessellation_control_per_vertex_input_components; - uint32_t max_tessellation_control_per_vertex_output_components; - uint32_t max_tessellation_control_total_output_components; - uint32_t max_tessellation_evaluation_input_components; - uint32_t max_tessellation_evaluation_output_components; - uint32_t max_tessellation_generation_level; - uint32_t max_tessellation_patch_size; - uint32_t max_texel_buffer_elements; - uint32_t max_texel_gather_offset; - uint32_t max_texel_offset; - uint32_t max_uniform_buffer_range; - uint32_t max_vertex_input_attributes; - uint32_t max_vertex_input_attribute_offset; - uint32_t max_vertex_input_bindings; - uint32_t max_vertex_input_binding_stride; - uint32_t max_vertex_output_components; - float min_interpolation_offset; - size_t min_memory_map_alignment; - VkDeviceSize min_storage_buffer_offset_alignment; - VkDeviceSize min_texel_buffer_offset_alignment; - int32_t min_texel_gather_offset; - int32_t min_texel_offset; - VkDeviceSize min_uniform_buffer_offset_alignment; - uint32_t mipmap_precision_bits; - VkDeviceSize non_coherent_atom_size; - VkDeviceSize optimal_buffer_copy_offset_alignment; - VkDeviceSize optimal_buffer_copy_row_pitch_alignment; - float point_size_granularity; - float point_size_range[2]; - VkSampleCountFlags sampled_image_color_sample_counts; - VkSampleCountFlags sampled_image_depth_sample_counts; - VkSampleCountFlags sampled_image_integer_sample_counts; - VkSampleCountFlags sampled_image_stencil_sample_counts; - VkDeviceSize sparse_address_space_size; - bool standard_sample_locations; - VkSampleCountFlags storage_image_sample_counts; - bool strict_lines; - uint32_t sub_pixel_interpolation_offset_bits; - uint32_t sub_pixel_precision_bits; - uint32_t sub_texel_precision_bits; - bool timestamp_compute_and_graphics; - float timestamp_period; - float viewport_bounds_range[2]; - uint32_t viewport_sub_pixel_bits; - - PhysicalDeviceLimits(); - PhysicalDeviceLimits(const VkPhysicalDeviceLimits& in_device_limits); - - bool operator==(const PhysicalDeviceLimits& in_device_limits) const; - } PhysicalDeviceLimits; - - typedef struct PhysicalDeviceSparseProperties - { - bool residency_standard_2D_block_shape; - bool residency_standard_2D_multisample_block_shape; - bool residency_standard_3D_block_shape; - bool residency_aligned_mip_size; - bool residency_non_resident_strict; - - PhysicalDeviceSparseProperties(); - PhysicalDeviceSparseProperties(const VkPhysicalDeviceSparseProperties& in_sparse_props); - - bool operator==(const PhysicalDeviceSparseProperties& in_props) const; - } PhysicalDeviceSparseProperties; - - typedef struct PhysicalDevicePropertiesCoreVK10 - { - uint32_t api_version; - uint32_t device_id; - char device_name [VK_MAX_PHYSICAL_DEVICE_NAME_SIZE]; - VkPhysicalDeviceType device_type; - uint32_t driver_version; - uint8_t pipeline_cache_uuid[VK_UUID_SIZE]; - uint32_t vendor_id; - - PhysicalDeviceLimits limits; - PhysicalDeviceSparseProperties sparse_properties; - - bool operator==(const PhysicalDevicePropertiesCoreVK10& in_props) const; - - PhysicalDevicePropertiesCoreVK10() - :api_version (UINT32_MAX), - device_id (UINT32_MAX), - device_type (VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM), - driver_version(UINT32_MAX), - vendor_id (UINT32_MAX) - { - memset(device_name, - 0xFF, - sizeof(device_name) ); - memset(pipeline_cache_uuid, - 0xFF, - sizeof(pipeline_cache_uuid) ); - } - - PhysicalDevicePropertiesCoreVK10(const VkPhysicalDeviceProperties& in_physical_device_properties); - } PhysicalDevicePropertiesCoreVK10; - - typedef struct PhysicalDeviceProperties - { - const PhysicalDevicePropertiesCoreVK10* core_vk1_0_properties_ptr; - const KHRMaintenance3Properties* khr_maintenance3_properties_ptr; - - PhysicalDeviceProperties() - { - core_vk1_0_properties_ptr = nullptr; - khr_maintenance3_properties_ptr = nullptr; - } - - PhysicalDeviceProperties(const PhysicalDevicePropertiesCoreVK10* in_core_vk1_0_properties_ptr, - const KHRMaintenance3Properties* in_khr_maintenance3_properties_ptr) - :core_vk1_0_properties_ptr (in_core_vk1_0_properties_ptr), - khr_maintenance3_properties_ptr(in_khr_maintenance3_properties_ptr) - { - /* Stub */ - } - - bool operator==(const PhysicalDeviceProperties& in_props) const; - } PhysicalDeviceProperties; - - /* A single push constant range descriptor */ - typedef struct PushConstantRange - { - uint32_t offset; - uint32_t size; - VkShaderStageFlagBits stages; - - /** Constructor - * - * @param in_offset Start offset for the range. - * @param in_size Size of the range. - * @param in_stages Valid pipeline stages for the range. - */ - PushConstantRange(uint32_t in_offset, - uint32_t in_size, - VkShaderStageFlags in_stages) - { - offset = in_offset; - size = in_size; - stages = static_cast(in_stages); - } - - /** Comparison operator. Used internally. */ - bool operator==(const PushConstantRange& in) const - { - return (offset == in.offset && - size == in.size && - stages == in.stages); - } - } PushConstantRange; - typedef uint32_t BindingElementIndex; typedef uint32_t BindingIndex; typedef uint32_t NumberOfBindingElements; typedef BindingElementIndex StartBindingElementIndex; typedef std::pair BindingElementArrayRange; - typedef std::vector PushConstantRanges; - - /** Holds information about a single Vulkan Queue Family. */ - typedef struct QueueFamilyInfo - { - VkQueueFlagsVariable(flags); - - VkExtent3D min_image_transfer_granularity; - uint32_t n_queues; - uint32_t n_timestamp_bits; - - /** Constructor. Initializes the instance using data provided by the driver. - * - * @param in_props Vulkan structure to use for initialization. - **/ - explicit QueueFamilyInfo(const VkQueueFamilyProperties& in_props) - { - flags = in_props.queueFlags; - min_image_transfer_granularity = in_props.minImageTransferGranularity; - n_queues = in_props.queueCount; - n_timestamp_bits = in_props.timestampValidBits; - } - } QueueFamilyInfo; - - extern bool operator==(const QueueFamilyInfo& in1, - const QueueFamilyInfo& in2); - - typedef std::vector QueueFamilyInfoItems; - - /** Enumerates all available queue family types */ - enum class QueueFamilyType - { - /* Holds queues that support COMPUTE operations but do NOT support GRAPHICS operations. */ - COMPUTE, - - /* Holds queues that support TRANSFER operations and which have not been classified - * as COMPUTE or UNIVERSAL queue family members. */ - TRANSFER, - - /* Holds queues that support GRAPHICS operations and which have not been classified - * as COMPUTE queue family members. */ - UNIVERSAL, - - /* Always last */ - COUNT, - FIRST = COMPUTE, - UNDEFINED = COUNT - }; /** Base pipeline ID. Internal type, used to represent compute / graphics pipeline IDs */ typedef uint32_t PipelineID; - /** A bitmask defining one or more queue family usage.*/ - typedef enum - { - QUEUE_FAMILY_COMPUTE_BIT = 1 << 0, - QUEUE_FAMILY_DMA_BIT = 1 << 1, - QUEUE_FAMILY_GRAPHICS_BIT = 1 << 2, - - QUEUE_FAMILY_FIRST_BIT = QUEUE_FAMILY_COMPUTE_BIT, - QUEUE_FAMILY_LAST_BIT = QUEUE_FAMILY_GRAPHICS_BIT - } QueueFamily; - typedef int QueueFamilyBits; - - /* Used internally by Buffer and Image to track page occupancy status */ - typedef union - { - uint32_t raw; - - struct - { - uint8_t page_bit_0 : 1; - uint8_t page_bit_1 : 1; - uint8_t page_bit_2 : 1; - uint8_t page_bit_3 : 1; - uint8_t page_bit_4 : 1; - uint8_t page_bit_5 : 1; - uint8_t page_bit_6 : 1; - uint8_t page_bit_7 : 1; - uint8_t page_bit_8 : 1; - uint8_t page_bit_9 : 1; - uint8_t page_bit_10 : 1; - uint8_t page_bit_11 : 1; - uint8_t page_bit_12 : 1; - uint8_t page_bit_13 : 1; - uint8_t page_bit_14 : 1; - uint8_t page_bit_15 : 1; - uint8_t page_bit_16 : 1; - uint8_t page_bit_17 : 1; - uint8_t page_bit_18 : 1; - uint8_t page_bit_19 : 1; - uint8_t page_bit_20 : 1; - uint8_t page_bit_21 : 1; - uint8_t page_bit_22 : 1; - uint8_t page_bit_23 : 1; - uint8_t page_bit_24 : 1; - uint8_t page_bit_25 : 1; - uint8_t page_bit_26 : 1; - uint8_t page_bit_27 : 1; - uint8_t page_bit_28 : 1; - uint8_t page_bit_29 : 1; - uint8_t page_bit_30 : 1; - uint8_t page_bit_31 : 1; - } page_bits; - } PageOccupancyStatus; - /* Index of a query within parent query pool instance */ typedef uint32_t QueryIndex; @@ -2329,777 +247,21 @@ namespace Anvil /* A pair of 32-bit FP values which describes a sample location */ typedef std::pair SampleLocation; - /* Specifies one of the compute / rendering pipeline stages. */ - typedef enum - { - SHADER_STAGE_FIRST, - - SHADER_STAGE_COMPUTE = SHADER_STAGE_FIRST, - SHADER_STAGE_FRAGMENT, - SHADER_STAGE_GEOMETRY, - SHADER_STAGE_TESSELLATION_CONTROL, - SHADER_STAGE_TESSELLATION_EVALUATION, - SHADER_STAGE_VERTEX, - - SHADER_STAGE_COUNT, - SHADER_STAGE_UNKNOWN = SHADER_STAGE_COUNT - } ShaderStage; - - /* Specifies the type of query for post-compile information about pipeline shaders */ - typedef enum - { - SHADER_INFO_FIRST, - - SHADER_INFO_TYPE_BINARY = SHADER_INFO_FIRST, - SHADER_INFO_TYPE_DISASSEMBLY, - SHADER_INFO_COUNT, - SHADER_INFO_UNKNOWN = SHADER_INFO_COUNT - } ShaderInfoType; - - /** Holds all information related to a specific shader module stage entry-point. */ - typedef struct ShaderModuleStageEntryPoint - { - std::string name; - ShaderModuleUniquePtr shader_module_owned_ptr; - Anvil::ShaderModule* shader_module_ptr; - Anvil::ShaderStage stage; - - /** Dummy constructor */ - ShaderModuleStageEntryPoint(); - - /** Copy constructor. */ - ShaderModuleStageEntryPoint(const ShaderModuleStageEntryPoint& in); - - /** Constructor. - * - * @param in_name Entry-point name. Must not be nullptr. - * @param in_shader_module_ptr ShaderModule instance to use. - * @param in_stage Shader stage the entry-point implements. - */ - ShaderModuleStageEntryPoint(const std::string& in_name, - ShaderModule* in_shader_module_ptr, - ShaderStage in_stage); - ShaderModuleStageEntryPoint(const std::string& in_name, - ShaderModuleUniquePtr in_shader_module_ptr, - ShaderStage in_stage); - - /** Destructor. */ - ~ShaderModuleStageEntryPoint(); - - ShaderModuleStageEntryPoint& operator=(const ShaderModuleStageEntryPoint&); - } ShaderModuleStageEntryPoint; - - /* Describes sparse properties for an image format */ - typedef struct SparseImageAspectProperties - { - VkImageAspectFlagsVariable (aspect_mask); - VkSparseImageFormatFlagsVariable(flags); - - VkExtent3D granularity; - uint32_t mip_tail_first_lod; - VkDeviceSize mip_tail_offset; - VkDeviceSize mip_tail_size; - VkDeviceSize mip_tail_stride; - - SparseImageAspectProperties() - { - memset(this, - 0, - sizeof(*this) ); - } - - SparseImageAspectProperties(const VkSparseImageMemoryRequirements& in_req) - { - aspect_mask = in_req.formatProperties.aspectMask; - flags = in_req.formatProperties.flags; - granularity = in_req.formatProperties.imageGranularity; - mip_tail_first_lod = in_req.imageMipTailFirstLod; - mip_tail_offset = in_req.imageMipTailOffset; - mip_tail_size = in_req.imageMipTailSize; - mip_tail_stride = in_req.imageMipTailStride; - } - } SparseImageAspectProperties; - /* Unique ID of a sparse memory bind update */ typedef uint32_t SparseMemoryBindInfoID; - typedef enum - { - /* Support sparse binding only */ - SPARSE_RESIDENCY_SCOPE_NONE, - - /* Support sparse residency, do not support sparse aliased residency */ - SPARSE_RESIDENCY_SCOPE_NONALIASED, - - /* Support sparse aliased residency */ - SPARSE_RESIDENCY_SCOPE_ALIASED, - - SPARSE_RESIDENCY_SCOPE_UNDEFINED - } SparseResidencyScope; - - typedef struct SpecializationConstant - { - uint32_t constant_id; - uint32_t n_bytes; - uint32_t start_offset; - - /** Dummy constructor. Should only be used by STL containers. */ - SpecializationConstant() - { - constant_id = UINT32_MAX; - n_bytes = UINT32_MAX; - start_offset = UINT32_MAX; - } - - /** Constructor. - * - * @param in_constant_id Specialization constant ID. - * @param in_n_bytes Number of bytes consumed by the constant. - * @param in_start_offset Start offset, at which the constant data starts. - */ - SpecializationConstant(uint32_t in_constant_id, - uint32_t in_n_bytes, - uint32_t in_start_offset) - { - constant_id = in_constant_id; - n_bytes = in_n_bytes; - start_offset = in_start_offset; - } - } SpecializationConstant; - - typedef std::vector SpecializationConstants; - /* Unique ID of a render-pass' sub-pass attachment within scope of a RenderPass instance. */ typedef uint32_t SubPassAttachmentID; /* Unique ID of a sub-pass within scope of a RenderPass instance. */ typedef uint32_t SubPassID; +}; - /** Defines supported timestamp capture modes. */ - typedef enum - { - /* No timestamps should be captured */ - TIMESTAMP_CAPTURE_MODE_DISABLED, - - /* Two timestamps should be captured: - * - * 1. top-of-pipe timestamp, preceding actual commands. - * 2. tof-of-pipe timestamp, after all commands are recorded. - */ - TIMESTAMP_CAPTURE_MODE_ENABLED_COMMAND_SUBMISSION_TIME, - - /* Two timestamps should be captured: - * - * 1. top-of-pipe timestamp, preceding actual commands. - * 2. bottom-of-pipe timestamp, after all commands are recorded. - */ - TIMESTAMP_CAPTURE_MODE_ENABLED_COMMAND_EXECUTION_TIME - } TimestampCaptureMode; - - namespace Utils - { - MTSafety convert_boolean_to_mt_safety_enum(bool in_mt_safe); - - bool convert_mt_safety_enum_to_boolean(MTSafety in_mt_safety, - const Anvil::BaseDevice* in_device_ptr); - - Anvil::QueueFamilyBits get_queue_family_bits_from_queue_family_type(Anvil::QueueFamilyType in_queue_family_type); - - /** Converts a Anvil::QueueFamilyBits bitfield value to an array of queue family indices. - * - * @param in_queue_families Input value to convert from. - * @param out_opt_queue_family_indices_ptr If not NULL, deref will be updated with *@param out_opt_n_queue_family_indices_ptr - * values, corresponding to queue family indices, as specified under @param in_queue_families. - * @param out_opt_n_queue_family_indices_ptr If not NULL, deref will be set to the number of items that would be or were written - * under @param out_opt_queue_family_indices_ptr. - * - **/ - void convert_queue_family_bits_to_family_indices(const Anvil::BaseDevice* in_device_ptr, - Anvil::QueueFamilyBits in_queue_families, - uint32_t* out_opt_queue_family_indices_ptr, - uint32_t* out_opt_n_queue_family_indices_ptr); - - /** Returns an access mask which has all the access bits, relevant to the user-specified image layout, - * enabled. - * - * The access mask can be further restricted to the specified queue family type. - */ - VkAccessFlags get_access_mask_from_image_layout(VkImageLayout in_layout, - Anvil::QueueFamilyType in_queue_family_type = Anvil::QueueFamilyType::UNDEFINED); - - /** Converts a pair of VkMemoryPropertyFlags and VkMemoryHeapFlags bitfields to a corresponding Anvil::MemoryFeatureFlags - * enum. - * - * @param in_opt_mem_type_flags Vulkan memory property flags. May be 0. - * @param in_opt_mem_heap_flags Vulkan memory heap flags. May be 0. - * - * @return Result bitfield. - */ - Anvil::MemoryFeatureFlags get_memory_feature_flags_from_vk_property_flags(VkMemoryPropertyFlags in_opt_mem_type_flags, - VkMemoryHeapFlags in_opt_mem_heap_flags); - - /** Converts the specified queue family type to a raw string - * - * @param in_queue_family_type Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(Anvil::QueueFamilyType in_queue_family_type); - - /** Converts the specified VkAttachmentLoadOp value to a raw string - * - * @param in_load_op Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(VkAttachmentLoadOp in_load_op); - - /** Converts the specified VkAttachmentStoreOp value to a raw string - * - * @param in_store_op Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(VkAttachmentStoreOp in_store_op); - - /** Converts the specified VkBlendFactor value to a raw string - * - * @param in_blend_factor Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(VkBlendFactor in_blend_factor); - - /** Converts the specified VkBlendOp value to a raw string - * - * @param in_blend_op Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(VkBlendOp in_blend_op); - - /** Converts the specified VkCompareOp value to a raw string - * - * @param in_compare_op Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(VkCompareOp in_compare_op); - - /** Converts the specified VkCullModeFlagBits value to a raw string - * - * @param in_cull_mode Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(VkCullModeFlagBits in_cull_mode); - - /** Converts the specified VkDescriptorType value to a raw string - * - * @param in_descriptor_type Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(VkDescriptorType in_descriptor_type); - - /** Converts the specified VkFrontFace value to a raw string - * - * @param in_front_face Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(VkFrontFace in_front_face); - - /** Converts the specified VkImageAspectFlagBits value to a raw string - * - * @param in_image_aspect_flag Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(VkImageAspectFlagBits in_image_aspect_flag); - - /** Converts the specified VkImageLayout value to a raw string - * - * @param in_image_layout Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(VkImageLayout in_image_layout); - - /** Converts the specified VkImageTiling value to a raw string - * - * @param in_image_tiling Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(VkImageTiling in_image_tiling); - - /** Converts the specified VkImageType value to a raw string - * - * @param in_image_type Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(VkImageType in_image_type); - - /** Converts the specified VkImageViewType value to a raw string - * - * @param in_image_view_type Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(VkImageViewType in_image_view_type); - - /** Converts the specified VkLogicOp value to a raw string - * - * @param in_logic_op Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(VkLogicOp in_logic_op); - - /** Converts the specified VkPolygonMode value to a raw string - * - * @param in_polygon_mode Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(VkPolygonMode in_polygon_mode); - - /** Converts the specified VkPrimitiveTopology value to a raw string - * - * @param in_topology Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(VkPrimitiveTopology in_topology); +#include "misc/types_enums.h" +#include "misc/types_macro.h" - /** Converts the specified VkSampleCountFlagBits value to a raw string - * - * @param in_sample_count Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(VkSampleCountFlagBits in_sample_count); - - /** Converts the specified Anvil::ShaderStage value to a raw string - * - * @param in_shader_stage Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(Anvil::ShaderStage in_shader_stage); - - /** Converts the specified VkShaderStageFlagBits value to a raw string - * - * @param in_shader_stage Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(VkShaderStageFlagBits in_shader_stage); - - /** Converts the specified VkSharingMode value to a raw string - * - * @param in_sharing_mode Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(VkSharingMode in_sharing_mode); - - /** Converts the specified VkStencilOp value to a raw string - * - * @param in_stencil_op Input value. - * - * @return Non-NULL value if successful, NULL otherwise. - */ - const char* get_raw_string(VkStencilOp in_stencil_op); - - /* Returns Vulkan equivalent of @param in_shader_stage */ - VkShaderStageFlagBits get_shader_stage_flag_bits_from_shader_stage(Anvil::ShaderStage in_shader_stage); - - /** Converts an Anvil::MemoryFeatureFlags value to a pair of corresponding Vulkan enum values. - * - * @param in_mem_feature_flags Anvil memory feature flags to use for conversion. - * @param out_mem_type_flags_ptr Deref will be set to a corresponding VkMemoryPropertyFlags value. Must not - * be nullptr. - * @param out_mem_heap_flags_ptr Deref will be set to a corresponding VkMemoryHeapFlags value. Must not - * be nullptr. - **/ - void get_vk_property_flags_from_memory_feature_flags(Anvil::MemoryFeatureFlags in_mem_feature_flags, - VkMemoryPropertyFlags* out_mem_type_flags_ptr, - VkMemoryHeapFlags* out_mem_heap_flags_ptr); - - /** Tells whether @param in_value is a power-of-two. */ - template - type is_pow2(const type in_value) - { - return ((in_value & (in_value - 1)) == 0); - } - - /** Rounds down @param in_value to a multiple of @param in_base */ - template - type round_down(const type in_value, const type in_base) - { - if ((in_value % in_base) == 0) - { - return in_value; - } - else - { - return in_value - (in_value % in_base); - } - } - - /** Rounds up @param in_value to a multiple of @param in_base */ - template - type round_up(const type in_value, const type in_base) - { - if ((in_value % in_base) == 0) - { - return in_value; - } - else - { - return in_value + (in_base - in_value % in_base); - } - } - - /** Container for sparse memory binding updates */ - class SparseMemoryBindingUpdateInfo - { - public: - /* Public functions */ - - /** Constructor. - * - * Marks the container as dirty by default. - */ - SparseMemoryBindingUpdateInfo(); - - /** Adds a new bind info to the container. The application can then append buffer memory updates - * to the bind info by calling append_buffer_memory_update(). - * - * @param in_n_signal_semaphores Number of semaphores to signal after the bind info is processed. Can be 0. - * @param in_opt_signal_semaphores_ptrs_ptr Ptr to an array of semaphores (sized @param in_n_signal_semaphores) to signal. - * Should be null if @param in_n_signal_semaphores is 0. - * @param in_n_wait_semaphores Number of semaphores to wait on before the bind info should start being - * processed. Can be 0. - * @param in_opt_wait_semaphores_ptrs_ptr Ptr to an array of semaphores (sized @param in_n_wait_semaphores) to wait on, - * before processing the bind info. Should be null if @param in_n_wait_semaphores - * is 0. - * - * @return ID of the new bind info. - **/ - SparseMemoryBindInfoID add_bind_info(uint32_t in_n_signal_semaphores, - Anvil::Semaphore* const* in_opt_signal_semaphores_ptrs_ptr, - uint32_t in_n_wait_semaphores, - Anvil::Semaphore* const* in_opt_wait_semaphores_ptrs_ptr); - - /** Appends a new buffer memory block update to the bind info. - * - * @param in_bind_info_id ID of the bind info to append the update to. - * @param in_buffer_ptr Buffer instance to update. Must not be NULL. - * @param in_buffer_memory_start_offset Start offset of the target memory region. - * @param in_opt_memory_block_ptr Memory block to use for the binding. May be NULL. - * @param in_opt_memory_block_start_offset Start offset of the source memory region. Ignored - * if @param in_memory_block_ptr is NULL. - * @param in_opt_memory_block_owned_by_buffer TODO. - * @param in_size Size of the memory block to update. - **/ - void append_buffer_memory_update(SparseMemoryBindInfoID in_bind_info_id, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_buffer_memory_start_offset, - Anvil::MemoryBlock* in_opt_memory_block_ptr, - VkDeviceSize in_opt_memory_block_start_offset, - bool in_opt_memory_block_owned_by_buffer, - VkDeviceSize in_size); - - /** Appends a new non-opaque image memory update to the bind info. - * - * @param in_bind_info_id ID of the bind info to append the update to. - * @param in_image_ptr Image instance to update. Must not be NULL. - * @param in_subresource Subresource which should be used for the update operation. - * @param in_offset Image region offset for the update operation. - * @param in_extent Extent of the update operation. - * @param in_flags VkSparseMemoryBindFlags value to use for the update. - * @param in_opt_memory_block_ptr Memory block to use for the update operation. May be NULL. - * @param in_opt_memory_block_start_offset Start offset of the source memory region. ignored if - * @param in_opt_memory_block_ptr is NULL. - * @param in_opt_memory_block_owned_by_image TODO - **/ - void append_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, - Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - const VkExtent3D& in_extent, - VkSparseMemoryBindFlags in_flags, - Anvil::MemoryBlock* in_opt_memory_block_ptr, - VkDeviceSize in_opt_memory_block_start_offset, - bool in_opt_memory_block_owned_by_image); - - /** Appends a new opaque image memory update to the bind info. - * - * @param in_bind_info_id ID of the bind info to append the update to. - * @param in_image_ptr Image instance to update. Must not be NULL. - * @param in_resource_offset Raw memory image start offset to use for the update. - * @param in_size Number of bytes to update. - * @param in_flags VkSparseMemoryBindFlags value to use for the update. - * @param in_opt_memory_block_ptr Memory block to use for the update operation. May be NULL. - * @param in_opt_memory_block_start_offset Start offset of the source memory region. Ignored if - * @param in_opt_memory_block_ptr is NULL. - * @param in_opt_memory_block_owned_by_image TODO - **/ - void append_opaque_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, - Anvil::Image* in_image_ptr, - VkDeviceSize in_resource_offset, - VkDeviceSize in_size, - VkSparseMemoryBindFlags in_flags, - Anvil::MemoryBlock* in_opt_memory_block_ptr, - VkDeviceSize in_opt_memory_block_start_offset, - bool in_opt_memory_block_owned_by_image); - - /** Retrieves bind info properties. - * - * @param in_bind_info_id ID of the bind info to retrieve properties of. - * @param out_opt_n_buffer_memory_updates_ptr Deref will be set to the number of buffer memory updates, assigned - * to the specified bind info item. May be NULL. - * @param out_opt_n_image_memory_updates_ptr Deref will be set to the number of non-opaque image memory updates, assigned - * to the specified bind info item. May be NULL. - * @param out_opt_n_image_opaque_memory_updates_ptr Deref will be set to the number of image opaque memory updates, assigned - * to the specified bind info item. May be NULL. - * @param out_opt_fence_to_set_ptr Deref will be set to the fence, which is going to be set once all - * updates assigned to the bind info item are executed. May be NULL. - * @param out_opt_n_signal_semaphores_ptr Deref will be set to the number of semaphores, which should be - * signalled after bindings are applied. May be NULL. - * @param out_opt_signal_semaphores_ptr_ptr_ptr Deref will be set to a ptr to an array of signal semaphores. May be NULL. - * @param out_opt_n_wait_semaphores_ptr Deref will be set to the number of semaphores, which should be - * waited on before bindings are applied. May be NULL. - * @param out_opt_wait_semaphores_ptr_ptr_ptr Deref will be set to a ptr to an array of wait semaphores. May be NULL. - * - * @return true if successful, false otherwise. - **/ - bool get_bind_info_properties(SparseMemoryBindInfoID in_bind_info_id, - uint32_t* const out_opt_n_buffer_memory_updates_ptr, - uint32_t* const out_opt_n_image_memory_updates_ptr, - uint32_t* const out_opt_n_image_opaque_memory_updates_ptr, - uint32_t* const out_opt_n_signal_semaphores_ptr, - Anvil::Semaphore*** out_opt_signal_semaphores_ptr_ptr_ptr, - uint32_t* const out_opt_n_wait_semaphores_ptr, - Anvil::Semaphore*** out_opt_wait_semaphores_ptr_ptr_ptr); - - /** Retrieves Vulkan descriptors which should be used for the vkQueueBindSparse() call. - * - * This call will trigger baking, if the container is marked as dirty. - * - * @param out_bind_info_count_ptr Deref will be set to the value which should be passed in the - * argument of the call. Must not be NULL. - * @param out_bind_info_ptrs_ptr Deref will be set to a pointer to an array, which should be - * passed in the argument of the call. Must not be NULL. - * @param out_fence_to_set_ptrs_ptr Deref will be set to the fence, which should be set by the implementation - * after all bindings are in place. Note that the fence itself is optional - * and may be null. - **/ - void get_bind_sparse_call_args(uint32_t* out_bind_info_count_ptr, - const VkBindSparseInfo** out_bind_info_ptrs_ptr, - Anvil::Fence** out_fence_to_set_ptr_ptr); - - /** Retrieves details of buffer memory binding updates, cached for user-specified bind info. - * - * @param in_bind_info_id ID of the bind info, which owns the update, whose properties are - * being queried. - * @param in_n_update Index of the buffer memory update to retrieve properties of. - * @param out_opt_buffer_ptr If not NULL, deref will be set to the buffer, whose sparse memory - * binding should be updated. Otherwise ignored. - * @param out_opt_buffer_memory_start_offset_ptr If not NULL, deref will be set to the start offset of the buffer, - * at which the memory block should be bound. Otherwise ignored. - * @param out_opt_memory_block_ptr If not NULL, deref will be set to the memory block, which should - * be used for the binding. Otherwise ignored. - * @param out_opt_memory_block_start_offset_ptr If not NULL, deref will be set to the start offset of the memory block, - * from which the memory region, which should be used for the binding, - * starts. Otherwise ignored. - * @param out_opt_memory_block_owned_by_buffer_ptr TODO. - * @param out_opt_size_ptr If not NULL, deref will be set to the size of the memory region, - * which should be used for the binding. Otherwise ignored. - * - * @return true if successful, false otherwise. - **/ - bool get_buffer_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, - uint32_t in_n_update, - Anvil::Buffer** out_opt_buffer_ptr_ptr, - VkDeviceSize* out_opt_buffer_memory_start_offset_ptr, - Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, - VkDeviceSize* out_opt_memory_block_start_offset_ptr, - bool* out_opt_memory_block_owned_by_buffer_ptr, - VkDeviceSize* out_opt_size_ptr) const; - - /** Retrieves the fence, if one was earlier assigned to the instance */ - const Anvil::Fence* get_fence() const - { - return m_fence_ptr; - } - - /** Retrieves properties of a non-opaque image memory update with a given ID. - * - * @param in_bind_info_id ID of the bind info, which owns the update, and whose properties are - * being queried. - * @param in_n_update Index of the image memory update to retrieve properties of. - * @param out_opt_image_ptr_ptr If not NULL, deref will be set to the image which should be updated. - * Otherwise ignored. - * @param out_opt_subresouce_ptr If not NULL, deref will be set to the subresource to be used for the - * update. Otherwise ignored. - * @param out_opt_offset_ptr If not NULL, deref will be set to image start offset, at which - * the memory block should be bound. Otherwise ignored. - * @param out_opt_extent_ptr If not NULL, deref will be set to the extent of the update. Otherwise - * ignored. - * @param out_opt_flags_ptr If not NULL, deref will be set to VkSparseMemoryBindFlags value which - * is going to be used for the update. Otherwise ignored. - * @param out_opt_memory_block_ptr_ptr If not NULL, deref will be set to pointer to the memory block, which - * is going to be used for the bind operation. Otherwise ignored. - * @param out_opt_memory_block_start_offset_ptr If not NULL, deref will be set to the start offset of the memory block, - * which should be used for the binding operation. Otherwise ignored. - * @param out_opt_memory_block_owned_by_image_ptr TODO - * - * @return true if successful, false otherwise. - **/ - bool get_image_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, - uint32_t in_n_update, - Anvil::Image** out_opt_image_ptr_ptr, - VkImageSubresource* out_opt_subresource_ptr, - VkOffset3D* out_opt_offset_ptr, - VkExtent3D* out_opt_extent_ptr, - VkSparseMemoryBindFlags* out_opt_flags_ptr, - Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, - VkDeviceSize* out_opt_memory_block_start_offset_ptr, - bool* out_opt_memory_block_owned_by_image_ptr) const; - - /** Retrieves properties of an opaque image memory updated with a given ID. - * - * @param in_bind_info_id ID of the bind info, which owns the update, and whose properties are being - * queried. - * @param in_n_update Index of the opaque image memory update to retrieve properties of. - * @param out_opt_image_ptr_ptr If not NULL, deref will be set to the image which should be updated. Otherwise - * ignored. - * @param out_opt_resource_offset_ptr If not NULL, deref will be set to the raw image memory offset, which should - * be used for the update. Otherwise ignored. - * @param out_opt_size_ptr If not NULL, deref will be set to the size of the image memory which should - * be used for the update. Otherwise ignored. - * @param out_opt_flags_ptr If not NULL, deref will be set to the VkSParseMemoryBindFlags value which is - * going to be used for the update. Otherwise igfnored. - * @param out_opt_memory_block_ptr_ptr If not NULL, deref will be set to pointer to the memory block, which is going - * to be used for the bind operation. Otherwise ignored. - * @param out_opt_memory_block_start_offset_ptr If not NULL, deref will be set to the start offset of the memory block, which - * should be used for the binding operation. Otherwise ignored. - * @param out_opt_memory_block_owned_by_image_ptr TODO - * - * @return true if successful, false otherwise. - */ - bool get_image_opaque_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, - uint32_t in_n_update, - Anvil::Image** out_opt_image_ptr_ptr, - VkDeviceSize* out_opt_resource_offset_ptr, - VkDeviceSize* out_opt_size_ptr, - VkSparseMemoryBindFlags* out_opt_flags_ptr, - Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, - VkDeviceSize* out_opt_memory_block_start_offset_ptr, - bool* out_opt_memory_block_owned_by_image_ptr) const; - - /** Tells how many bind info items have been assigned to the descriptor */ - uint32_t get_n_bind_info_items() const - { - return static_cast(m_bindings.size() ); - } - - /* Changes the fence (null by default), which should be set by the Vulkan implementation after it finishes - * updating the bindings. - **/ - void set_fence(Anvil::Fence* in_fence_ptr) - { - m_fence_ptr = in_fence_ptr; - } - - private: - /* Private type definitions */ - typedef struct GeneralBindInfo - { - VkDeviceSize start_offset; - bool memory_block_owned_by_target; - Anvil::MemoryBlock* memory_block_ptr; - VkDeviceSize memory_block_start_offset; - VkDeviceSize size; - - VkSparseMemoryBindFlagsVariable(flags); - - GeneralBindInfo() - { - memory_block_owned_by_target = false; - memory_block_ptr = nullptr; - } - } GeneralBindInfo; - - typedef struct ImageBindInfo - { - VkExtent3D extent; - VkOffset3D offset; - bool memory_block_owned_by_image; - Anvil::MemoryBlock* memory_block_ptr; - VkDeviceSize memory_block_start_offset; - VkImageSubresource subresource; - - VkSparseMemoryBindFlagsVariable(flags); - - ImageBindInfo() - { - memory_block_owned_by_image = false; - memory_block_ptr = nullptr; - } - } ImageBindInfo; - - typedef std::map, std::vector >> BufferBindUpdateMap; - typedef std::map, std::vector >> ImageBindUpdateMap; - typedef std::map, std::vector >> ImageOpaqueBindUpdateMap; - - typedef struct BindingInfo - { - BufferBindUpdateMap buffer_updates; - ImageOpaqueBindUpdateMap image_opaque_updates; - ImageBindUpdateMap image_updates; - - std::vector signal_semaphores; - std::vector signal_semaphores_vk; - std::vector wait_semaphores; - std::vector wait_semaphores_vk; - } BindingInfo; - - std::vector m_bindings; - bool m_dirty; - Anvil::Fence* m_fence_ptr; - - std::vector m_bindings_vk; - std::vector m_buffer_bindings_vk; - std::vector m_image_bindings_vk; - std::vector m_image_opaque_bindings_vk; - - /* Private functions */ - SparseMemoryBindingUpdateInfo (const SparseMemoryBindingUpdateInfo&); - SparseMemoryBindingUpdateInfo operator=(const SparseMemoryBindingUpdateInfo&); - - void bake(); - }; - }; - - /* Represents a Vulkan structure header */ - typedef struct - { - VkStructureType type; - const void* next_ptr; - } VkStructHeader; - -}; /* Anvil namespace */ - -/* Work around compilers complaining about MemoryBlock class being unrecognized. - * - * This should be removed when types is split into smaller headers. - */ -#include "wrappers/memory_block.h" +#include "misc/types_classes.h" +#include "misc/types_struct.h" +#include "misc/types_utils.h" #endif /* MISC_TYPES_H */ diff --git a/include/misc/types_classes.h b/include/misc/types_classes.h new file mode 100644 index 00000000..b5666aec --- /dev/null +++ b/include/misc/types_classes.h @@ -0,0 +1,371 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef TYPES_CLASSES_H +#define TYPES_CLASSES_H + +namespace Anvil +{ + class IMemoryAllocatorBackendBase + { + public: + virtual ~IMemoryAllocatorBackendBase() + { + /* Stub */ + } + + virtual VkResult map (void* in_memory_object, + VkDeviceSize in_start_offset, + VkDeviceSize in_size, + void** out_result_ptr) = 0; + virtual bool supports_baking() const = 0; + virtual void unmap (void* in_memory_object) = 0; + }; + + /** Container for sparse memory binding updates */ + class SparseMemoryBindingUpdateInfo + { + public: + /* Public functions */ + + /** Constructor. + * + * Marks the container as dirty by default. + */ + SparseMemoryBindingUpdateInfo(); + + /** Adds a new bind info to the container. The application can then append buffer memory updates + * to the bind info by calling append_buffer_memory_update(). + * + * @param in_n_signal_semaphores Number of semaphores to signal after the bind info is processed. Can be 0. + * @param in_opt_signal_semaphores_ptrs_ptr Ptr to an array of semaphores (sized @param in_n_signal_semaphores) to signal. + * Should be null if @param in_n_signal_semaphores is 0. + * @param in_n_wait_semaphores Number of semaphores to wait on before the bind info should start being + * processed. Can be 0. + * @param in_opt_wait_semaphores_ptrs_ptr Ptr to an array of semaphores (sized @param in_n_wait_semaphores) to wait on, + * before processing the bind info. Should be null if @param in_n_wait_semaphores + * is 0. + * + * @return ID of the new bind info. + **/ + SparseMemoryBindInfoID add_bind_info(uint32_t in_n_signal_semaphores, + Anvil::Semaphore* const* in_opt_signal_semaphores_ptrs_ptr, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_opt_wait_semaphores_ptrs_ptr); + + /** Appends a new buffer memory block update to the bind info. + * + * @param in_bind_info_id ID of the bind info to append the update to. + * @param in_buffer_ptr Buffer instance to update. Must not be NULL. + * @param in_buffer_memory_start_offset Start offset of the target memory region. + * @param in_opt_memory_block_ptr Memory block to use for the binding. May be NULL. + * @param in_opt_memory_block_start_offset Start offset of the source memory region. Ignored + * if @param in_memory_block_ptr is NULL. + * @param in_opt_memory_block_owned_by_buffer TODO. + * @param in_size Size of the memory block to update. + **/ + void append_buffer_memory_update(SparseMemoryBindInfoID in_bind_info_id, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_buffer_memory_start_offset, + Anvil::MemoryBlock* in_opt_memory_block_ptr, + VkDeviceSize in_opt_memory_block_start_offset, + bool in_opt_memory_block_owned_by_buffer, + VkDeviceSize in_size); + + /** Appends a new non-opaque image memory update to the bind info. + * + * @param in_bind_info_id ID of the bind info to append the update to. + * @param in_image_ptr Image instance to update. Must not be NULL. + * @param in_subresource Subresource which should be used for the update operation. + * @param in_offset Image region offset for the update operation. + * @param in_extent Extent of the update operation. + * @param in_flags VkSparseMemoryBindFlags value to use for the update. + * @param in_opt_memory_block_ptr Memory block to use for the update operation. May be NULL. + * @param in_opt_memory_block_start_offset Start offset of the source memory region. ignored if + * @param in_opt_memory_block_ptr is NULL. + * @param in_opt_memory_block_owned_by_image TODO + **/ + void append_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, + Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + const VkExtent3D& in_extent, + VkSparseMemoryBindFlags in_flags, + Anvil::MemoryBlock* in_opt_memory_block_ptr, + VkDeviceSize in_opt_memory_block_start_offset, + bool in_opt_memory_block_owned_by_image); + + /** Appends a new opaque image memory update to the bind info. + * + * @param in_bind_info_id ID of the bind info to append the update to. + * @param in_image_ptr Image instance to update. Must not be NULL. + * @param in_resource_offset Raw memory image start offset to use for the update. + * @param in_size Number of bytes to update. + * @param in_flags VkSparseMemoryBindFlags value to use for the update. + * @param in_opt_memory_block_ptr Memory block to use for the update operation. May be NULL. + * @param in_opt_memory_block_start_offset Start offset of the source memory region. Ignored if + * @param in_opt_memory_block_ptr is NULL. + * @param in_opt_memory_block_owned_by_image TODO + **/ + void append_opaque_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, + Anvil::Image* in_image_ptr, + VkDeviceSize in_resource_offset, + VkDeviceSize in_size, + VkSparseMemoryBindFlags in_flags, + Anvil::MemoryBlock* in_opt_memory_block_ptr, + VkDeviceSize in_opt_memory_block_start_offset, + bool in_opt_memory_block_owned_by_image); + + /** Retrieves bind info properties. + * + * @param in_bind_info_id ID of the bind info to retrieve properties of. + * @param out_opt_n_buffer_memory_updates_ptr Deref will be set to the number of buffer memory updates, assigned + * to the specified bind info item. May be NULL. + * @param out_opt_n_image_memory_updates_ptr Deref will be set to the number of non-opaque image memory updates, assigned + * to the specified bind info item. May be NULL. + * @param out_opt_n_image_opaque_memory_updates_ptr Deref will be set to the number of image opaque memory updates, assigned + * to the specified bind info item. May be NULL. + * @param out_opt_fence_to_set_ptr Deref will be set to the fence, which is going to be set once all + * updates assigned to the bind info item are executed. May be NULL. + * @param out_opt_n_signal_semaphores_ptr Deref will be set to the number of semaphores, which should be + * signalled after bindings are applied. May be NULL. + * @param out_opt_signal_semaphores_ptr_ptr_ptr Deref will be set to a ptr to an array of signal semaphores. May be NULL. + * @param out_opt_n_wait_semaphores_ptr Deref will be set to the number of semaphores, which should be + * waited on before bindings are applied. May be NULL. + * @param out_opt_wait_semaphores_ptr_ptr_ptr Deref will be set to a ptr to an array of wait semaphores. May be NULL. + * + * @return true if successful, false otherwise. + **/ + bool get_bind_info_properties(SparseMemoryBindInfoID in_bind_info_id, + uint32_t* const out_opt_n_buffer_memory_updates_ptr, + uint32_t* const out_opt_n_image_memory_updates_ptr, + uint32_t* const out_opt_n_image_opaque_memory_updates_ptr, + uint32_t* const out_opt_n_signal_semaphores_ptr, + Anvil::Semaphore*** out_opt_signal_semaphores_ptr_ptr_ptr, + uint32_t* const out_opt_n_wait_semaphores_ptr, + Anvil::Semaphore*** out_opt_wait_semaphores_ptr_ptr_ptr); + + /** Retrieves Vulkan descriptors which should be used for the vkQueueBindSparse() call. + * + * This call will trigger baking, if the container is marked as dirty. + * + * @param out_bind_info_count_ptr Deref will be set to the value which should be passed in the + * argument of the call. Must not be NULL. + * @param out_bind_info_ptrs_ptr Deref will be set to a pointer to an array, which should be + * passed in the argument of the call. Must not be NULL. + * @param out_fence_to_set_ptrs_ptr Deref will be set to the fence, which should be set by the implementation + * after all bindings are in place. Note that the fence itself is optional + * and may be null. + **/ + void get_bind_sparse_call_args(uint32_t* out_bind_info_count_ptr, + const VkBindSparseInfo** out_bind_info_ptrs_ptr, + Anvil::Fence** out_fence_to_set_ptr_ptr); + + /** Retrieves details of buffer memory binding updates, cached for user-specified bind info. + * + * @param in_bind_info_id ID of the bind info, which owns the update, whose properties are + * being queried. + * @param in_n_update Index of the buffer memory update to retrieve properties of. + * @param out_opt_buffer_ptr If not NULL, deref will be set to the buffer, whose sparse memory + * binding should be updated. Otherwise ignored. + * @param out_opt_buffer_memory_start_offset_ptr If not NULL, deref will be set to the start offset of the buffer, + * at which the memory block should be bound. Otherwise ignored. + * @param out_opt_memory_block_ptr If not NULL, deref will be set to the memory block, which should + * be used for the binding. Otherwise ignored. + * @param out_opt_memory_block_start_offset_ptr If not NULL, deref will be set to the start offset of the memory block, + * from which the memory region, which should be used for the binding, + * starts. Otherwise ignored. + * @param out_opt_memory_block_owned_by_buffer_ptr TODO. + * @param out_opt_size_ptr If not NULL, deref will be set to the size of the memory region, + * which should be used for the binding. Otherwise ignored. + * + * @return true if successful, false otherwise. + **/ + bool get_buffer_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, + uint32_t in_n_update, + Anvil::Buffer** out_opt_buffer_ptr_ptr, + VkDeviceSize* out_opt_buffer_memory_start_offset_ptr, + Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, + VkDeviceSize* out_opt_memory_block_start_offset_ptr, + bool* out_opt_memory_block_owned_by_buffer_ptr, + VkDeviceSize* out_opt_size_ptr) const; + + /** Retrieves the fence, if one was earlier assigned to the instance */ + const Anvil::Fence* get_fence() const + { + return m_fence_ptr; + } + + /** Retrieves properties of a non-opaque image memory update with a given ID. + * + * @param in_bind_info_id ID of the bind info, which owns the update, and whose properties are + * being queried. + * @param in_n_update Index of the image memory update to retrieve properties of. + * @param out_opt_image_ptr_ptr If not NULL, deref will be set to the image which should be updated. + * Otherwise ignored. + * @param out_opt_subresouce_ptr If not NULL, deref will be set to the subresource to be used for the + * update. Otherwise ignored. + * @param out_opt_offset_ptr If not NULL, deref will be set to image start offset, at which + * the memory block should be bound. Otherwise ignored. + * @param out_opt_extent_ptr If not NULL, deref will be set to the extent of the update. Otherwise + * ignored. + * @param out_opt_flags_ptr If not NULL, deref will be set to VkSparseMemoryBindFlags value which + * is going to be used for the update. Otherwise ignored. + * @param out_opt_memory_block_ptr_ptr If not NULL, deref will be set to pointer to the memory block, which + * is going to be used for the bind operation. Otherwise ignored. + * @param out_opt_memory_block_start_offset_ptr If not NULL, deref will be set to the start offset of the memory block, + * which should be used for the binding operation. Otherwise ignored. + * @param out_opt_memory_block_owned_by_image_ptr TODO + * + * @return true if successful, false otherwise. + **/ + bool get_image_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, + uint32_t in_n_update, + Anvil::Image** out_opt_image_ptr_ptr, + VkImageSubresource* out_opt_subresource_ptr, + VkOffset3D* out_opt_offset_ptr, + VkExtent3D* out_opt_extent_ptr, + VkSparseMemoryBindFlags* out_opt_flags_ptr, + Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, + VkDeviceSize* out_opt_memory_block_start_offset_ptr, + bool* out_opt_memory_block_owned_by_image_ptr) const; + + /** Retrieves properties of an opaque image memory updated with a given ID. + * + * @param in_bind_info_id ID of the bind info, which owns the update, and whose properties are being + * queried. + * @param in_n_update Index of the opaque image memory update to retrieve properties of. + * @param out_opt_image_ptr_ptr If not NULL, deref will be set to the image which should be updated. Otherwise + * ignored. + * @param out_opt_resource_offset_ptr If not NULL, deref will be set to the raw image memory offset, which should + * be used for the update. Otherwise ignored. + * @param out_opt_size_ptr If not NULL, deref will be set to the size of the image memory which should + * be used for the update. Otherwise ignored. + * @param out_opt_flags_ptr If not NULL, deref will be set to the VkSParseMemoryBindFlags value which is + * going to be used for the update. Otherwise igfnored. + * @param out_opt_memory_block_ptr_ptr If not NULL, deref will be set to pointer to the memory block, which is going + * to be used for the bind operation. Otherwise ignored. + * @param out_opt_memory_block_start_offset_ptr If not NULL, deref will be set to the start offset of the memory block, which + * should be used for the binding operation. Otherwise ignored. + * @param out_opt_memory_block_owned_by_image_ptr TODO + * + * @return true if successful, false otherwise. + */ + bool get_image_opaque_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, + uint32_t in_n_update, + Anvil::Image** out_opt_image_ptr_ptr, + VkDeviceSize* out_opt_resource_offset_ptr, + VkDeviceSize* out_opt_size_ptr, + VkSparseMemoryBindFlags* out_opt_flags_ptr, + Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, + VkDeviceSize* out_opt_memory_block_start_offset_ptr, + bool* out_opt_memory_block_owned_by_image_ptr) const; + + /** Tells how many bind info items have been assigned to the descriptor */ + uint32_t get_n_bind_info_items() const + { + return static_cast(m_bindings.size() ); + } + + /* Changes the fence (null by default), which should be set by the Vulkan implementation after it finishes + * updating the bindings. + **/ + void set_fence(Anvil::Fence* in_fence_ptr) + { + m_fence_ptr = in_fence_ptr; + } + + private: + /* Private type definitions */ + typedef struct GeneralBindInfo + { + VkDeviceSize start_offset; + bool memory_block_owned_by_target; + Anvil::MemoryBlock* memory_block_ptr; + VkDeviceSize memory_block_start_offset; + VkDeviceSize size; + + VkSparseMemoryBindFlagsVariable(flags); + + GeneralBindInfo() + { + memory_block_owned_by_target = false; + memory_block_ptr = nullptr; + } + } GeneralBindInfo; + + typedef struct ImageBindInfo + { + VkExtent3D extent; + VkOffset3D offset; + bool memory_block_owned_by_image; + Anvil::MemoryBlock* memory_block_ptr; + VkDeviceSize memory_block_start_offset; + VkImageSubresource subresource; + + VkSparseMemoryBindFlagsVariable(flags); + + ImageBindInfo() + { + memory_block_owned_by_image = false; + memory_block_ptr = nullptr; + } + } ImageBindInfo; + + typedef std::map, std::vector >> BufferBindUpdateMap; + typedef std::map, std::vector >> ImageBindUpdateMap; + typedef std::map, std::vector >> ImageOpaqueBindUpdateMap; + + typedef struct BindingInfo + { + BufferBindUpdateMap buffer_updates; + ImageOpaqueBindUpdateMap image_opaque_updates; + ImageBindUpdateMap image_updates; + + std::vector signal_semaphores; + std::vector signal_semaphores_vk; + std::vector wait_semaphores; + std::vector wait_semaphores_vk; + + BindingInfo() + { + /* Stub */ + } + } BindingInfo; + + std::vector m_bindings; + bool m_dirty; + Anvil::Fence* m_fence_ptr; + + std::vector m_bindings_vk; + std::vector m_buffer_bindings_vk; + std::vector m_image_bindings_vk; + std::vector m_image_opaque_bindings_vk; + + /* Private functions */ + SparseMemoryBindingUpdateInfo (const SparseMemoryBindingUpdateInfo&); + SparseMemoryBindingUpdateInfo operator=(const SparseMemoryBindingUpdateInfo&); + + void bake(); + }; +}; /* namespace Anvil */ + +#endif /* TYPES_CLASSES_H */ \ No newline at end of file diff --git a/include/misc/types_enums.h b/include/misc/types_enums.h new file mode 100644 index 00000000..38d21396 --- /dev/null +++ b/include/misc/types_enums.h @@ -0,0 +1,388 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef TYPES_ENUMS_H +#define TYPES_ENUMS_H + +namespace Anvil +{ + /* Describes recognized subpass attachment types */ + enum AttachmentType + { + ATTACHMENT_TYPE_FIRST, + + ATTACHMENT_TYPE_COLOR = ATTACHMENT_TYPE_FIRST, + ATTACHMENT_TYPE_DEPTH_STENCIL, + ATTACHMENT_TYPE_INPUT, + ATTACHMENT_TYPE_PRESERVE, + ATTACHMENT_TYPE_RESOLVE, + + ATTACHMENT_TYPE_COUNT, + ATTACHMENT_TYPE_UNKNOWN = ATTACHMENT_TYPE_COUNT + }; + + typedef enum class BufferType + { + NONSPARSE_ALLOC, + NONSPARSE_NO_ALLOC, + NONSPARSE_NO_ALLOC_CHILD, + SPARSE_NO_ALLOC, + } BufferType; + + typedef enum + { + DYNAMIC_STATE_BLEND_CONSTANTS_BIT = 1 << 0, + DYNAMIC_STATE_DEPTH_BIAS_BIT = 1 << 1, + DYNAMIC_STATE_DEPTH_BOUNDS_BIT = 1 << 2, + DYNAMIC_STATE_LINE_WIDTH_BIT = 1 << 3, + DYNAMIC_STATE_SCISSOR_BIT = 1 << 4, + DYNAMIC_STATE_STENCIL_COMPARE_MASK_BIT = 1 << 5, + DYNAMIC_STATE_STENCIL_REFERENCE_BIT = 1 << 6, + DYNAMIC_STATE_STENCIL_WRITE_MASK_BIT = 1 << 7, + DYNAMIC_STATE_VIEWPORT_BIT = 1 << 8, + } DynamicStateBits; + typedef uint32_t DynamicStateBitfield; + + typedef enum + { + /* todo .. */ + + } ExternalMemoryHandleTypeFlag; + typedef uint32_t ExternalMemoryHandleTypeFlags; + + /** Describes component layout of a format */ + typedef enum + { + /* NOTE: If the ordering used below needs to be changed, make sure to also update formats.cpp::layout_to_n_components */ + COMPONENT_LAYOUT_ABGR, + COMPONENT_LAYOUT_ARGB, + COMPONENT_LAYOUT_BGR, + COMPONENT_LAYOUT_BGRA, + COMPONENT_LAYOUT_D, + COMPONENT_LAYOUT_DS, + COMPONENT_LAYOUT_EBGR, + COMPONENT_LAYOUT_R, + COMPONENT_LAYOUT_RG, + COMPONENT_LAYOUT_RGB, + COMPONENT_LAYOUT_RGBA, + COMPONENT_LAYOUT_S, + COMPONENT_LAYOUT_XD, + + COMPONENT_LAYOUT_UNKNOWN + } ComponentLayout; + + typedef enum + { + /* When specified for a binding, the binding can be modified after having been bound to a pipeline + * in a command buffer, without invalidating that command buffer. + * The updated binding becomes visible to following submissions as soon as the update function leaves. + * + * Requires VK_EXT_descriptor_indexing. + */ + DESCRIPTOR_BINDING_FLAG_UPDATE_AFTER_BIND_BIT = 1 << 0, + + /* When specified for a binding, the binding can be modified after having been bound to a pipeline + * in a command buffer, as long as it is NOT used by the command buffer. Doing so no longer invalidyates + * the command buffer. + * + * Requires VK_EXT_descriptor_indexing. + */ + DESCRIPTOR_BINDING_FLAG_UPDATE_UNUSED_WHILE_PENDING_BIT = 1 << 1, + + /* When specified for a binding, the binding needs not be assigned valid descriptor(s), as long as none of + * the shader invocations execute an instruction that performs any memory access using the descriptor. + * + * Requires VK_EXT_descriptor_indexing. + */ + DESCRIPTOR_BINDING_FLAG_PARTIALLY_BOUND_BIT = 1 << 2, + + /* When specified for a binding, the binding gets a variable size which is specified each time a descriptor + * set is allocated using this layout. The in_descriptor_array_size field specified at DescriptorSetCreateInfo::add_binding() + * call time acts as an upper bound for the number of elements the binding can handle. + * + * Can only be specified for the last binding in the DS layout. + * + * Requires VK_EXT_descriptor_indexing. + */ + DESCRIPTOR_BINDING_FLAG_VARIABLE_DESCRIPTOR_COUNT_BIT = 1 << 3, + + } DescriptorBindingFlagBits; + typedef uint32_t DescriptorBindingFlags; + + typedef enum + { + /* When set, descriptor set allocations will return back to the pool at release time.*/ + DESCRIPTOR_POOL_FLAG_CREATE_FREE_DESCRIPTOR_SET_BIT = 1 << 0, + + /* When set, descriptor sets allocated from this pool can be created with the DESCRIPTOR_BINDING_FLAG_UPDATE_AFTER_BIND_BIT flag. + * + * Requires VK_EXT_descriptor_indexing. + **/ + DESCRIPTOR_POOL_FLAG_CREATE_UPDATE_AFTER_BIND_BIT = 1 << 1, + + } DescriptorPoolFlagBits; + typedef uint32_t DescriptorPoolFlags; + + typedef enum + { + /* Updates dirty DS bindings using vkUpdateDescriptorSet() which is available on all Vulkan implementations. */ + DESCRIPTOR_SET_UPDATE_METHOD_CORE, + + /* Updates dirty DS bindings using vkUpdateDescriptorSetWithTemplateKHR(). Templates are cached across update operations, + * and are release at DescriptorSet release time. + * + * This setting is recommended if you are going to be updating the same set of descriptor set bindings more than once. + * + * Only available on devices supporting VK_KHR_descriptor_update_template extension. + */ + DESCRIPTOR_SET_UPDATE_METHOD_TEMPLATE, + } DescriptorSetUpdateMethod; + + typedef enum + { + EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE, + EXTENSION_AVAILABILITY_IGNORE, + EXTENSION_AVAILABILITY_REQUIRE, + } ExtensionAvailability; + + /** Tells the type of an Anvil::BaseDevice instance */ + typedef enum + { + /* BaseDevice is implemented by SGPUDevice class */ + DEVICE_TYPE_SINGLE_GPU, + } DeviceType; + + typedef enum + { + FORMAT_TYPE_SFLOAT, + FORMAT_TYPE_SFLOAT_UINT, + FORMAT_TYPE_SINT, + FORMAT_TYPE_SNORM, + FORMAT_TYPE_SRGB, + FORMAT_TYPE_SSCALED, + FORMAT_TYPE_UFLOAT, + FORMAT_TYPE_UINT, + FORMAT_TYPE_UNORM, + FORMAT_TYPE_UNORM_UINT, + FORMAT_TYPE_USCALED, + + FORMAT_TYPE_UNKNOWN, + } FormatType; + + enum ImageCreateFlagBits + { + IMAGE_CREATE_FLAG_MUTABLE_FORMAT_BIT = 1 << 0, + IMAGE_CREATE_FLAG_CUBE_COMPATIBLE_BIT = 1 << 1, + + /* NOTE: Requires VK_KHR_maintenance1 */ + IMAGE_CREATE_FLAG_2D_ARRAY_COMPATIBLE_BIT = 1 << 2, + }; + typedef uint32_t ImageCreateFlags; + + typedef enum class ImageType + { + NONSPARSE_ALLOC, + NONSPARSE_NO_ALLOC, + SPARSE_NO_ALLOC, + SWAPCHAIN_WRAPPER + } ImageType; + + enum MemoryFeatureFlagBits + { + /* NOTE: If more memory feature flags are added here, make sure to also update Anvil::Utils::get_vk_property_flags_from_memory_feature_flags() + * and Anvil::Utils::get_memory_feature_flags_from_vk_property_flags() + */ + + MEMORY_FEATURE_FLAG_DEVICE_LOCAL = 1 << 0, + MEMORY_FEATURE_FLAG_HOST_CACHED = 1 << 1, + MEMORY_FEATURE_FLAG_HOST_COHERENT = 1 << 2, + MEMORY_FEATURE_FLAG_LAZILY_ALLOCATED = 1 << 3, + MEMORY_FEATURE_FLAG_MAPPABLE = 1 << 4, + }; + typedef uint32_t MemoryFeatureFlags; + + typedef enum + { + MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + MT_SAFETY_ENABLED, + MT_SAFETY_DISABLED + } MTSafety; + + typedef enum + { + /* NOTE: If new entries are added or existing entry order is modified, make sure to + * update Anvil::ObjectTracker::get_object_type_name(). + */ + OBJECT_TYPE_FIRST, + + OBJECT_TYPE_BUFFER = OBJECT_TYPE_FIRST, + OBJECT_TYPE_BUFFER_VIEW, + OBJECT_TYPE_COMMAND_BUFFER, + OBJECT_TYPE_COMMAND_POOL, + OBJECT_TYPE_COMPUTE_PIPELINE_MANAGER, + OBJECT_TYPE_DESCRIPTOR_POOL, + OBJECT_TYPE_DESCRIPTOR_SET, + OBJECT_TYPE_DESCRIPTOR_SET_GROUP, + OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT, + OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_MANAGER, + OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE, + OBJECT_TYPE_DEVICE, + OBJECT_TYPE_EVENT, + OBJECT_TYPE_FENCE, + OBJECT_TYPE_FRAMEBUFFER, + OBJECT_TYPE_GRAPHICS_PIPELINE_MANAGER, + OBJECT_TYPE_IMAGE, + OBJECT_TYPE_IMAGE_VIEW, + OBJECT_TYPE_INSTANCE, + OBJECT_TYPE_MEMORY_BLOCK, + OBJECT_TYPE_PHYSICAL_DEVICE, + OBJECT_TYPE_PIPELINE_CACHE, + OBJECT_TYPE_PIPELINE_LAYOUT, + OBJECT_TYPE_PIPELINE_LAYOUT_MANAGER, + OBJECT_TYPE_QUERY_POOL, + OBJECT_TYPE_QUEUE, + OBJECT_TYPE_RENDER_PASS, + OBJECT_TYPE_RENDERING_SURFACE, + OBJECT_TYPE_SAMPLER, + OBJECT_TYPE_SEMAPHORE, + OBJECT_TYPE_SHADER_MODULE, + OBJECT_TYPE_SWAPCHAIN, + + OBJECT_TYPE_GLSL_SHADER_TO_SPIRV_GENERATOR, + OBJECT_TYPE_GRAPHICS_PIPELINE, + + /* Always last */ + OBJECT_TYPE_COUNT, + OBJECT_TYPE_UNKNOWN = OBJECT_TYPE_COUNT + } ObjectType; + + /** Defines, to what extent occlusion queries are going to be used. + * + * Only used for second-level command buffer recording policy declaration. + **/ + typedef enum + { + /** Occlusion queries are not going to be used */ + OCCLUSION_QUERY_SUPPORT_SCOPE_NOT_REQUIRED, + + /** Non-precise occlusion queries may be used */ + OCCLUSION_QUERY_SUPPORT_SCOPE_REQUIRED_NONPRECISE, + + /** Pprecise occlusion queries may be used */ + OCCLUSION_QUERY_SUPPORT_SCOPE_REQUIRED_PRECISE, + } OcclusionQuerySupportScope; + + /** A bitmask defining one or more queue family usage.*/ + typedef enum + { + QUEUE_FAMILY_COMPUTE_BIT = 1 << 0, + QUEUE_FAMILY_DMA_BIT = 1 << 1, + QUEUE_FAMILY_GRAPHICS_BIT = 1 << 2, + + QUEUE_FAMILY_FIRST_BIT = QUEUE_FAMILY_COMPUTE_BIT, + QUEUE_FAMILY_LAST_BIT = QUEUE_FAMILY_GRAPHICS_BIT + } QueueFamily; + typedef int QueueFamilyBits; + + /** Enumerates all available queue family types */ + enum class QueueFamilyType + { + /* Holds queues that support COMPUTE operations but do NOT support GRAPHICS operations. */ + COMPUTE, + + /* Holds queues that support TRANSFER operations and which have not been classified + * as COMPUTE or UNIVERSAL queue family members. */ + TRANSFER, + + /* Holds queues that support GRAPHICS operations and which have not been classified + * as COMPUTE queue family members. */ + UNIVERSAL, + + /* Always last */ + COUNT, + FIRST = COMPUTE, + UNDEFINED = COUNT + }; + + /* Specifies one of the compute / rendering pipeline stages. */ + typedef enum + { + SHADER_STAGE_FIRST, + + SHADER_STAGE_COMPUTE = SHADER_STAGE_FIRST, + SHADER_STAGE_FRAGMENT, + SHADER_STAGE_GEOMETRY, + SHADER_STAGE_TESSELLATION_CONTROL, + SHADER_STAGE_TESSELLATION_EVALUATION, + SHADER_STAGE_VERTEX, + + SHADER_STAGE_COUNT, + SHADER_STAGE_UNKNOWN = SHADER_STAGE_COUNT + } ShaderStage; + + /* Specifies the type of query for post-compile information about pipeline shaders */ + typedef enum + { + SHADER_INFO_FIRST, + + SHADER_INFO_TYPE_BINARY = SHADER_INFO_FIRST, + SHADER_INFO_TYPE_DISASSEMBLY, + SHADER_INFO_COUNT, + SHADER_INFO_UNKNOWN = SHADER_INFO_COUNT + } ShaderInfoType; + + typedef enum + { + /* Support sparse binding only */ + SPARSE_RESIDENCY_SCOPE_NONE, + + /* Support sparse residency, do not support sparse aliased residency */ + SPARSE_RESIDENCY_SCOPE_NONALIASED, + + /* Support sparse aliased residency */ + SPARSE_RESIDENCY_SCOPE_ALIASED, + + SPARSE_RESIDENCY_SCOPE_UNDEFINED + } SparseResidencyScope; + + /** Defines supported timestamp capture modes. */ + typedef enum + { + /* No timestamps should be captured */ + TIMESTAMP_CAPTURE_MODE_DISABLED, + + /* Two timestamps should be captured: + * + * 1. top-of-pipe timestamp, preceding actual commands. + * 2. tof-of-pipe timestamp, after all commands are recorded. + */ + TIMESTAMP_CAPTURE_MODE_ENABLED_COMMAND_SUBMISSION_TIME, + + /* Two timestamps should be captured: + * + * 1. top-of-pipe timestamp, preceding actual commands. + * 2. bottom-of-pipe timestamp, after all commands are recorded. + */ + TIMESTAMP_CAPTURE_MODE_ENABLED_COMMAND_EXECUTION_TIME + } TimestampCaptureMode; +}; /* namespace Anvil */ + +#endif /* TYPES_ENUMS_H */ \ No newline at end of file diff --git a/include/misc/types_macro.h b/include/misc/types_macro.h new file mode 100644 index 00000000..5aa0ff20 --- /dev/null +++ b/include/misc/types_macro.h @@ -0,0 +1,430 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef TYPES_MACRO_H +#define TYPES_MACRO_H + +/* Wrappers for some of the Vulkan enums we use across Anvil */ +#ifdef ANVIL_LITTLE_ENDIAN + #define VkAccessFlagsVariable(name) \ + union \ + { \ + VkAccessFlags name; \ + \ + struct \ + { \ + uint8_t VK_ACCESS_INDIRECT_COMMAND_READ_BIT : 1; \ + uint8_t VK_ACCESS_INDEX_READ_BIT : 1; \ + uint8_t VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT : 1; \ + uint8_t VK_ACCESS_UNIFORM_READ_BIT : 1; \ + uint8_t VK_ACCESS_INPUT_ATTACHMENT_READ_BIT : 1; \ + uint8_t VK_ACCESS_SHADER_READ_BIT : 1; \ + uint8_t VK_ACCESS_SHADER_WRITE_BIT : 1; \ + uint8_t VK_ACCESS_COLOR_ATTACHMENT_READ_BIT : 1; \ + uint8_t VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT : 1; \ + uint8_t VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT : 1; \ + uint8_t VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT : 1; \ + uint8_t VK_ACCESS_TRANSFER_READ_BIT : 1; \ + uint8_t VK_ACCESS_TRANSFER_WRITE_BIT : 1; \ + uint8_t VK_ACCESS_HOST_READ_BIT : 1; \ + uint8_t VK_ACCESS_HOST_WRITE_BIT : 1; \ + uint8_t VK_ACCESS_MEMORY_READ_BIT : 1; \ + uint8_t VK_ACCESS_MEMORY_WRITE_BIT : 1; \ + uint32_t OTHER: 15; \ + } name##_flags; \ + }; + + #define VkBufferCreateFlagsVariable(name) \ + union \ + { \ + VkBufferCreateFlags name; \ + \ + struct \ + { \ + uint8_t VK_BUFFER_CREATE_SPARSE_BINDING_BIT : 1; \ + uint8_t VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT : 1; \ + uint8_t VK_BUFFER_CREATE_SPARSE_ALIASED_BIT : 1; \ + uint32_t OTHER: 29; \ + } name##_flags; \ + }; + + #define VkBufferUsageFlagsVariable(name) \ + union \ + { \ + VkBufferUsageFlags name; \ + \ + struct \ + { \ + uint8_t VK_BUFFER_USAGE_TRANSFER_SRC_BIT : 1; \ + uint8_t VK_BUFFER_USAGE_TRANSFER_DST_BIT : 1; \ + uint8_t VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT : 1; \ + uint8_t VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT : 1; \ + uint8_t VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT : 1; \ + uint8_t VK_BUFFER_USAGE_STORAGE_BUFFER_BIT : 1; \ + uint8_t VK_BUFFER_USAGE_INDEX_BUFFER_BIT : 1; \ + uint8_t VK_BUFFER_USAGE_VERTEX_BUFFER_BIT : 1; \ + uint8_t VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT : 1; \ + uint32_t OTHER: 23; \ + } name##_flags; \ + }; + + #define VkColorComponentFlagsVariable(name) \ + union \ + { \ + VkColorComponentFlags name; \ + \ + struct \ + { \ + uint8_t VK_COLOR_COMPONENT_R_BIT : 1; \ + uint8_t VK_COLOR_COMPONENT_G_BIT : 1; \ + uint8_t VK_COLOR_COMPONENT_B_BIT : 1; \ + uint8_t VK_COLOR_COMPONENT_A_BIT : 1; \ + uint32_t OTHER: 28; \ + } name##_flags; \ + }; + + #define VkCompositeAlphaFlagsKHRVariable(name) \ + union \ + { \ + VkCompositeAlphaFlagsKHR name; \ + \ + struct \ + { \ + uint8_t VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR : 1; \ + uint8_t VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR : 1; \ + uint8_t VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR : 1; \ + uint8_t VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR : 1; \ + uint32_t OTHER: 28; \ + } name##_flags; \ + }; + + #define VkCullModeFlagsVariable(name) \ + union \ + { \ + VkCullModeFlags name; \ + \ + struct \ + { \ + uint8_t VK_CULL_MODE_FRONT_BIT : 1; \ + uint8_t VK_CULL_MODE_BACK_BIT : 1; \ + uint32_t OTHER: 30; \ + } name##_flags; \ + }; + + #define VkDependencyFlagsVariable(name) \ + union \ + { \ + VkDependencyFlags name; \ + \ + struct \ + { \ + uint8_t VK_DEPENDENCY_BY_REGION_BIT : 1; \ + uint32_t OTHER: 31; \ + } name##_flags; \ + }; + + #define VkFormatFeatureFlagsVariable(name) \ + union \ + { \ + VkFormatFeatureFlags name; \ + \ + struct \ + { \ + uint8_t VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_BLIT_SRC_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_BLIT_DST_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG : 1; \ + uint8_t VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR : 1; \ + uint8_t VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR : 1; \ + uint32_t OTHER: 16; \ + } name##_flags; \ + }; + + #define VkImageAspectFlagsVariable(name) \ + union \ + { \ + VkImageAspectFlags name; \ + \ + struct \ + { \ + uint8_t VK_IMAGE_ASPECT_COLOR_BIT : 1; \ + uint8_t VK_IMAGE_ASPECT_DEPTH_BIT : 1; \ + uint8_t VK_IMAGE_ASPECT_STENCIL_BIT : 1; \ + uint8_t VK_IMAGE_ASPECT_METADATA_BIT : 1; \ + uint32_t OTHER: 28; \ + } name##_flags; \ + }; + + #define VkImageUsageFlagsVariable(name) \ + union \ + { \ + VkImageUsageFlags name; \ + \ + struct \ + { \ + uint8_t VK_IMAGE_USAGE_TRANSFER_SRC_BIT : 1; \ + uint8_t VK_IMAGE_USAGE_TRANSFER_DST_BIT : 1; \ + uint8_t VK_IMAGE_USAGE_SAMPLED_BIT : 1; \ + uint8_t VK_IMAGE_USAGE_STORAGE_BIT : 1; \ + uint8_t VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT : 1; \ + uint8_t VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT : 1; \ + uint8_t VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT : 1; \ + uint8_t VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT : 1; \ + uint32_t OTHER: 24; \ + } name##_flags; \ + }; + + #define VkMemoryHeapFlagsVariable(name) \ + union \ + { \ + VkMemoryHeapFlags name; \ + \ + struct \ + { \ + uint8_t VK_MEMORY_HEAP_DEVICE_LOCAL_BIT : 1; \ + uint32_t OTHER: 31; \ + } name##_flags; \ + }; + + #define VkMemoryPropertyFlagsVariable(name) \ + union \ + { \ + VkMemoryPropertyFlags name; \ + \ + struct \ + { \ + uint8_t VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT : 1; \ + uint8_t VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT : 1; \ + uint8_t VK_MEMORY_PROPERTY_HOST_COHERENT_BIT : 1; \ + uint8_t VK_MEMORY_PROPERTY_HOST_CACHED_BIT : 1; \ + uint8_t VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT : 1; \ + uint32_t OTHER: 27; \ + } name##_flags; \ + }; + + #define VkPipelineStageFlagsVariable(name) \ + union \ + { \ + VkPipelineStageFlags name; \ + \ + struct \ + { \ + uint8_t VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_VERTEX_INPUT_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_VERTEX_SHADER_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_TRANSFER_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_HOST_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_ALL_COMMANDS_BIT : 1; \ + uint32_t OTHER: 15; \ + } name##_flags; \ + }; + + #define VkQueryControlFlagsVariable(name) \ + union \ + { \ + VkQueryControlFlags name; \ + \ + struct \ + { \ + uint8_t VK_QUERY_CONTROL_PRECISE_BIT : 1; \ + uint32_t OTHER: 31; \ + } name##_flags; \ + }; + + #define VkQueryPipelineStatisticFlagsVariable(name) \ + union \ + { \ + VkQueryPipelineStatisticFlags name; \ + \ + struct \ + { \ + uint8_t VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT : 1; \ + uint8_t VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT : 1; \ + uint8_t VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT : 1; \ + uint8_t VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT : 1; \ + uint8_t VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT : 1; \ + uint8_t VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT : 1; \ + uint8_t VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT : 1; \ + uint8_t VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT : 1; \ + uint8_t VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT : 1; \ + uint8_t VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT : 1; \ + uint8_t VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT : 1; \ + uint32_t OTHER: 21; \ + } name##_flags; \ + }; + + #define VkQueryResultFlagsVariable(name) \ + union \ + { \ + VkQueryResultFlags name; \ + \ + struct \ + { \ + uint8_t VK_QUERY_RESULT_64_BIT : 1; \ + uint8_t VK_QUERY_RESULT_WAIT_BIT : 1; \ + uint8_t VK_QUERY_RESULT_WITH_AVAILABILITY_BIT : 1; \ + uint8_t VK_QUERY_RESULT_PARTIAL_BIT : 1; \ + uint32_t OTHER: 28; \ + } name##_flags; \ + }; + + #define VkQueueFlagsVariable(name) \ + union \ + { \ + VkQueueFlags name; \ + \ + struct \ + { \ + uint8_t VK_QUEUE_GRAPHICS_BIT : 1; \ + uint8_t VK_QUEUE_COMPUTE_BIT : 1; \ + uint8_t VK_QUEUE_TRANSFER_BIT : 1; \ + uint8_t VK_QUEUE_SPARSE_BINDING_BIT : 1; \ + uint32_t OTHER: 28; \ + } name##_flags; \ + }; + + #define VkSampleCountFlagsVariable(name) \ + union \ + { \ + VkSampleCountFlags name; \ + \ + struct \ + { \ + uint8_t VK_SAMPLE_COUNT_1_BIT : 1; \ + uint8_t VK_SAMPLE_COUNT_2_BIT : 1; \ + uint8_t VK_SAMPLE_COUNT_4_BIT : 1; \ + uint8_t VK_SAMPLE_COUNT_8_BIT : 1; \ + uint8_t VK_SAMPLE_COUNT_16_BIT : 1; \ + uint8_t VK_SAMPLE_COUNT_32_BIT : 1; \ + uint8_t VK_SAMPLE_COUNT_64_BIT : 1; \ + uint32_t OTHER: 25; \ + } name##_flags; \ + }; + + #define VkShaderStageFlagsVariable(name) \ + union \ + { \ + VkShaderStageFlags name; \ + \ + struct \ + { \ + uint8_t VK_SHADER_STAGE_VERTEX_BIT : 1; \ + uint8_t VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT : 1; \ + uint8_t VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT : 1; \ + uint8_t VK_SHADER_STAGE_GEOMETRY_BIT : 1; \ + uint8_t VK_SHADER_STAGE_FRAGMENT_BIT : 1; \ + uint8_t VK_SHADER_STAGE_COMPUTE_BIT : 1; \ + uint32_t OTHER: 26; \ + } name##_flags; \ + }; + + #define VkSparseImageFormatFlagsVariable(name) \ + union \ + { \ + VkSparseImageFormatFlags name; \ + \ + struct \ + { \ + uint8_t VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT : 1; \ + uint8_t VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT: 1; \ + uint8_t VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT: 1; \ + uint32_t OTHER: 29; \ + } name##_flags; \ + }; + + #define VkSparseMemoryBindFlagsVariable(name) \ + union \ + { \ + VkSparseMemoryBindFlags name; \ + \ + struct \ + { \ + uint8_t VK_SPARSE_MEMORY_BIND_METADATA_BIT : 1; \ + uint32_t OTHER: 31; \ + } name##_flags; \ + }; + + #define VkStencilFaceFlagsVariable(name) \ + union \ + { \ + VkStencilFaceFlags name; \ + \ + struct \ + { \ + uint8_t VK_STENCIL_FACE_FRONT_BIT : 1; \ + uint8_t VK_STENCIL_FACE_BACK_BIT : 1; \ + uint32_t OTHER: 30; \ + } name##_flags; \ + }; + + #define VkSurfaceTransformFlagsKHRVariable(name) \ + union \ + { \ + VkSurfaceTransformFlagsKHR name; \ + \ + struct \ + { \ + uint8_t VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR : 1; \ + uint8_t VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR : 1; \ + uint8_t VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR : 1; \ + uint8_t VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR : 1; \ + uint8_t VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR : 1; \ + uint8_t VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR : 1; \ + uint8_t VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR : 1; \ + uint8_t VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR : 1; \ + uint8_t VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR : 1; \ + uint32_t OTHER: 23; \ + } name##_flags; \ + }; +#else + #error "Big-endian arch's are not supported" +#endif + +/* Helper macros */ +#define ANVIL_DISABLE_ASSIGNMENT_OPERATOR(x) private: x& operator=(const x&); +#define ANVIL_DISABLE_COPY_CONSTRUCTOR(x) private: x(const x&); +#define ANVIL_REDUNDANT_ARGUMENT(x) x = x; +#define ANVIL_REDUNDANT_ARGUMENT_CONST(x) x; +#define ANVIL_REDUNDANT_VARIABLE(x) x = x; +#define ANVIL_REDUNDANT_VARIABLE_CONST(x) x; + +#endif /* TYPES_MACRO_H */ \ No newline at end of file diff --git a/include/misc/types_struct.h b/include/misc/types_struct.h new file mode 100644 index 00000000..e7bf2c1d --- /dev/null +++ b/include/misc/types_struct.h @@ -0,0 +1,1378 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef TYPES_STRUCT_H +#define TYPES_STRUCT_H + +namespace Anvil +{ + /* Holds shader core properties pertaining to a physical device */ + typedef struct AMDShaderCoreProperties + { + uint32_t shader_engine_count; ///< Number of shader engines. + uint32_t shader_arrays_per_engine_count; ///< Number of shader arrays. + uint32_t compute_units_per_shader_array; ///< Number of CUs per shader array. + uint32_t simd_per_compute_unit; ///< Number of SIMDs per compute unit. + uint32_t wavefronts_per_simd; ///< Number of wavefront slots in each SIMD. + uint32_t wavefront_size; ///< Wavefront size. + uint32_t sgprs_per_simd; ///< Number of physical SGPRs per SIMD. + uint32_t min_sgpr_allocation; ///< Minimum number of SGPRs that can be allocated by a wave. + uint32_t max_sgpr_allocation; ///< Number of available SGPRs. + uint32_t sgpr_allocation_granularity; ///< SGPRs are allocated in groups of this size. Meaning, if your shader + /// only uses 1 SGPR, you will still end up reserving this number of + /// SGPRs. + uint32_t vgprs_per_simd; ///< Number of physical VGPRs per SIMD. + uint32_t min_vgpr_allocation; ///< Minimum number of VGPRs that can be allocated by a wave. + uint32_t max_vgpr_allocation; ///< Number of available VGPRs. + uint32_t vgpr_allocation_granularity; ///< VGPRs are allocated in groups of this size. Meaning, if your shader + /// only uses 1 VGPR, you will still end up reserving this number of + /// VGPRs. + + AMDShaderCoreProperties(); + AMDShaderCoreProperties(const VkPhysicalDeviceShaderCorePropertiesAMD& in_props); + + bool operator==(const AMDShaderCoreProperties& in_props) const; + } AMDShaderCoreProperties; + + /** Describes a buffer memory barrier. */ + typedef struct BufferBarrier + { + VkAccessFlagsVariable(dst_access_mask); + VkAccessFlagsVariable(src_access_mask); + + VkBuffer buffer; + VkBufferMemoryBarrier buffer_barrier_vk; + Anvil::Buffer* buffer_ptr; + uint32_t dst_queue_family_index; + VkDeviceSize offset; + VkDeviceSize size; + uint32_t src_queue_family_index; + + /** Constructor. + * + * Note that @param in_buffer_ptr is retained by this function. + * + * @param in_source_access_mask Source access mask to use for the barrier. + * @param in_destination_access_mask Destination access mask to use for the barrier. + * @param in_src_queue_family_index Source queue family index to use for the barrier. + * @param in_dst_queue_family_index Destination queue family index to use for the barrier. + * @param in_buffer_ptr Pointer to a Buffer instance the instantiated barrier + * refers to. Must not be nullptr. + * @param in_offset Start offset of the region described by the barrier. + * @param in_size Size of the region described by the barrier. + **/ + explicit BufferBarrier(VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + uint32_t in_src_queue_family_index, + uint32_t in_dst_queue_family_index, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkDeviceSize in_size); + + /** Destructor. + * + * Releases the encapsulated Buffer instance. + **/ + virtual ~BufferBarrier(); + + /** Copy constructor. + * + * Retains the Buffer instance stored in the input barrier. + * + * @param in Barrier instance to copy data from. + **/ + BufferBarrier(const BufferBarrier& in); + + /** Returns a Vulkan buffer memory barrier descriptor, whose configuration corresponds to + * to the configuration of this descriptor. + **/ + virtual VkBufferMemoryBarrier get_barrier_vk() const + { + return buffer_barrier_vk; + } + + /** Returns a pointer to the Vulkan descriptor, whose configuration corresponds to + * the configuration of this descriptor. + * + * The returned pointer remains valid for the duration of the Barrier descriptor's + * life-time. + **/ + const VkBufferMemoryBarrier* get_barrier_vk_ptr() const + { + return &buffer_barrier_vk; + } + + private: + BufferBarrier& operator=(const BufferBarrier&); + } BufferBarrier; + + typedef struct BufferMemoryBindingUpdate + { + Anvil::Buffer* buffer_ptr; + bool memory_block_owned_by_buffer; + Anvil::MemoryBlock* memory_block_ptr; + + /* May either be empty or hold the physical device, from which the logical device has been created */ + std::vector physical_devices; + + BufferMemoryBindingUpdate(); + } BufferMemoryBindingUpdate; + + typedef struct EXTDescriptorIndexingFeatures + { + bool descriptor_binding_partially_bound; + bool descriptor_binding_sampled_image_update_after_bind; + bool descriptor_binding_storage_buffer_update_after_bind; + bool descriptor_binding_storage_image_update_after_bind; + bool descriptor_binding_storage_texel_buffer_update_after_bind; + bool descriptor_binding_uniform_buffer_update_after_bind; + bool descriptor_binding_uniform_texel_buffer_update_after_bind; + bool descriptor_binding_update_unused_while_pending; + bool descriptor_binding_variable_descriptor_count; + bool runtime_descriptor_array; + bool shader_input_attachment_array_dynamic_indexing; + bool shader_input_attachment_array_non_uniform_indexing; + bool shader_sampled_image_array_non_uniform_indexing; + bool shader_storage_buffer_array_non_uniform_indexing; + bool shader_storage_image_array_non_uniform_indexing; + bool shader_storage_texel_buffer_array_dynamic_indexing; + bool shader_storage_texel_buffer_array_non_uniform_indexing; + bool shader_uniform_buffer_array_non_uniform_indexing; + bool shader_uniform_texel_buffer_array_dynamic_indexing; + bool shader_uniform_texel_buffer_array_non_uniform_indexing; + + EXTDescriptorIndexingFeatures(); + EXTDescriptorIndexingFeatures(const VkPhysicalDeviceDescriptorIndexingFeaturesEXT& in_features); + + VkPhysicalDeviceDescriptorIndexingFeaturesEXT get_vk_physical_device_descriptor_indexing_features() const; + + bool operator==(const EXTDescriptorIndexingFeatures& in_features) const; + } EXTDescriptorIndexingFeatures; + + typedef struct EXTDescriptorIndexingProperties + { + uint32_t max_descriptor_set_update_after_bind_input_attachments; + uint32_t max_descriptor_set_update_after_bind_sampled_images; + uint32_t max_descriptor_set_update_after_bind_samplers; + uint32_t max_descriptor_set_update_after_bind_storage_buffers; + uint32_t max_descriptor_set_update_after_bind_storage_buffers_dynamic; + uint32_t max_descriptor_set_update_after_bind_storage_images; + uint32_t max_descriptor_set_update_after_bind_uniform_buffers; + uint32_t max_descriptor_set_update_after_bind_uniform_buffers_dynamic; + uint32_t max_per_stage_descriptor_update_after_bind_input_attachments; + uint32_t max_per_stage_descriptor_update_after_bind_sampled_images; + uint32_t max_per_stage_descriptor_update_after_bind_samplers; + uint32_t max_per_stage_descriptor_update_after_bind_storage_buffers; + uint32_t max_per_stage_descriptor_update_after_bind_storage_images; + uint32_t max_per_stage_descriptor_update_after_bind_uniform_buffers; + uint32_t max_per_stage_update_after_bind_resources; + uint32_t max_update_after_bind_descriptors_in_all_pools; + bool shader_input_attachment_array_non_uniform_indexing_native; + bool shader_sampled_image_array_non_uniform_indexing_native; + bool shader_storage_buffer_array_non_uniform_indexing_native; + bool shader_storage_image_array_non_uniform_indexing_native; + bool shader_uniform_buffer_array_non_uniform_indexing_native; + + EXTDescriptorIndexingProperties(); + EXTDescriptorIndexingProperties(const VkPhysicalDeviceDescriptorIndexingPropertiesEXT& in_props); + + bool operator==(const EXTDescriptorIndexingProperties& in_props) const; + } EXTDescriptorIndexingProperties; + + typedef struct DescriptorSetAllocation + { + /* Descriptor set layout to use for the allocation request */ + const Anvil::DescriptorSetLayout* ds_layout_ptr; + + /* Number of descriptors to use for the variable descriptor binding defined in the DS layout. + * + * This value is only required if ds_layout_ptr contains a binding created with the + * DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT flag. Otherwise, it is ignored. + * + */ + uint32_t n_variable_descriptor_bindings; + + /* Dummy constructor. Do not use as input for DS allocation functions. */ + DescriptorSetAllocation() + { + ds_layout_ptr = nullptr; + n_variable_descriptor_bindings = UINT32_MAX; + } + + /* Constructor. + * + * Use if you need to allocate a descriptor set using a descriptor set layout which + * does NOT contain a variable count descriptor binding. + */ + DescriptorSetAllocation(const Anvil::DescriptorSetLayout* in_ds_layout_ptr); + + /* Constructor. + * + * Use if you need to allocate a descriptor set using a descriptor set layout which + * CONTAINS a variable count descriptor binding. + */ + DescriptorSetAllocation(const Anvil::DescriptorSetLayout* in_ds_layout_ptr, + const uint32_t& in_n_variable_descriptor_bindings); + } DescriptorSetAllocation; + + typedef struct DescriptorUpdateTemplateEntry + { + VkDescriptorType descriptor_type; + uint32_t n_descriptors; + uint32_t n_destination_array_element; + uint32_t n_destination_binding; + size_t offset; + size_t stride; + + DescriptorUpdateTemplateEntry(); + DescriptorUpdateTemplateEntry(const VkDescriptorType& in_descriptor_type, + const uint32_t& in_n_destination_array_element, + const uint32_t& in_n_destination_binding, + const uint32_t& in_n_descriptors, + const size_t& in_offset, + const size_t& in_stride); + + VkDescriptorUpdateTemplateEntryKHR get_vk_descriptor_update_template_entry_khr() const; + + bool operator==(const DescriptorUpdateTemplateEntry& in_entry) const; + bool operator< (const DescriptorUpdateTemplateEntry& in_entry) const; + } DescriptorUpdateTemplateEntry; + + typedef struct ExtensionAMDDrawIndirectCountEntrypoints + { + PFN_vkCmdDrawIndexedIndirectCountAMD vkCmdDrawIndexedIndirectCountAMD; + PFN_vkCmdDrawIndirectCountAMD vkCmdDrawIndirectCountAMD; + + ExtensionAMDDrawIndirectCountEntrypoints(); + } ExtensionAMDDrawIndirectCountEntrypoints; + + typedef struct ExtensionAMDShaderInfoEntrypoints + { + PFN_vkGetShaderInfoAMD vkGetShaderInfoAMD; + + ExtensionAMDShaderInfoEntrypoints(); + } ExtensionAMDShaderInfoEntrypoints; + + typedef struct ExtensionEXTDebugMarkerEntrypoints + { + PFN_vkCmdDebugMarkerBeginEXT vkCmdDebugMarkerBeginEXT; + PFN_vkCmdDebugMarkerEndEXT vkCmdDebugMarkerEndEXT; + PFN_vkCmdDebugMarkerInsertEXT vkCmdDebugMarkerInsertEXT; + PFN_vkDebugMarkerSetObjectNameEXT vkDebugMarkerSetObjectNameEXT; + PFN_vkDebugMarkerSetObjectTagEXT vkDebugMarkerSetObjectTagEXT; + + ExtensionEXTDebugMarkerEntrypoints(); + } ExtensionEXTDebugMarkerEntrypoints; + + typedef struct ExtensionEXTDebugReportEntrypoints + { + PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallbackEXT; + PFN_vkDestroyDebugReportCallbackEXT vkDestroyDebugReportCallbackEXT; + + ExtensionEXTDebugReportEntrypoints(); + } ExtensionEXTDebugReportEntrypoints; + + typedef struct ExtensionKHRBindMemory2Entrypoints + { + PFN_vkBindBufferMemory2KHR vkBindBufferMemory2KHR; + PFN_vkBindImageMemory2KHR vkBindImageMemory2KHR; + + ExtensionKHRBindMemory2Entrypoints(); + } ExtensionKHRBindMemory2Entrypoints; + + typedef struct ExtensionKHRDescriptorUpdateTemplateEntrypoints + { + PFN_vkCreateDescriptorUpdateTemplateKHR vkCreateDescriptorUpdateTemplateKHR; + PFN_vkDestroyDescriptorUpdateTemplateKHR vkDestroyDescriptorUpdateTemplateKHR; + PFN_vkUpdateDescriptorSetWithTemplateKHR vkUpdateDescriptorSetWithTemplateKHR; + + ExtensionKHRDescriptorUpdateTemplateEntrypoints(); + } ExtensionKHRDescriptorUpdateTemplateEntrypoints; + + typedef struct ExtensionKHRGetPhysicalDeviceProperties2 + { + PFN_vkGetPhysicalDeviceFeatures2KHR vkGetPhysicalDeviceFeatures2KHR; + PFN_vkGetPhysicalDeviceFormatProperties2KHR vkGetPhysicalDeviceFormatProperties2KHR; + PFN_vkGetPhysicalDeviceImageFormatProperties2KHR vkGetPhysicalDeviceImageFormatProperties2KHR; + PFN_vkGetPhysicalDeviceMemoryProperties2KHR vkGetPhysicalDeviceMemoryProperties2KHR; + PFN_vkGetPhysicalDeviceProperties2KHR vkGetPhysicalDeviceProperties2KHR; + PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR vkGetPhysicalDeviceQueueFamilyProperties2KHR; + PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR vkGetPhysicalDeviceSparseImageFormatProperties2KHR; + + ExtensionKHRGetPhysicalDeviceProperties2(); + } ExtensionKHRGetPhysicalDeviceProperties2; + + typedef struct ExtensionKHRMaintenance1Entrypoints + { + PFN_vkTrimCommandPoolKHR vkTrimCommandPoolKHR; + + ExtensionKHRMaintenance1Entrypoints(); + } ExtensionKHRMaintenance1Entrypoints; + + typedef struct ExtensionKHRMaintenance3Entrypoints + { + PFN_vkGetDescriptorSetLayoutSupportKHR vkGetDescriptorSetLayoutSupportKHR; + + ExtensionKHRMaintenance3Entrypoints(); + } ExtensionKHRMaintenance3Entrypoints; + + typedef struct ExtensionKHRSurfaceEntrypoints + { + PFN_vkDestroySurfaceKHR vkDestroySurfaceKHR; + PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR; + PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR; + PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR; + PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupportKHR; + + ExtensionKHRSurfaceEntrypoints(); + } ExtensionKHRSurfaceEntrypoints; + + typedef struct ExtensionKHRSwapchainEntrypoints + { + PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR; + PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR; + PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR; + PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR; + PFN_vkQueuePresentKHR vkQueuePresentKHR; + + ExtensionKHRSwapchainEntrypoints(); + } ExtensionKHRSwapchainEntrypoints; + + #ifdef _WIN32 + #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) + typedef struct ExtensionKHRWin32SurfaceEntrypoints + { + PFN_vkCreateWin32SurfaceKHR vkCreateWin32SurfaceKHR; + PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR vkGetPhysicalDeviceWin32PresentationSupportKHR; + + ExtensionKHRWin32SurfaceEntrypoints(); + } ExtensionKHRWin32SurfaceEntrypoints; + #endif + #else + #if defined(ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT) + typedef struct ExtensionKHRXcbSurfaceEntrypoints + { + PFN_vkCreateXcbSurfaceKHR vkCreateXcbSurfaceKHR; + + ExtensionKHRXcbSurfaceEntrypoints(); + } ExtensionKHRXcbSurfaceEntrypoints; + #endif + #endif + + typedef struct ExtensionKHRDeviceGroupCreationEntrypoints + { + PFN_vkEnumeratePhysicalDeviceGroupsKHR vkEnumeratePhysicalDeviceGroupsKHR; + + ExtensionKHRDeviceGroupCreationEntrypoints(); + } ExtensionKHRDeviceGroupCreationEntrypoints; + + /** Holds driver-specific format capabilities */ + typedef struct FormatProperties + { + VkFormatFeatureFlagsVariable(buffer_capabilities); + VkFormatFeatureFlagsVariable(linear_tiling_capabilities); + VkFormatFeatureFlagsVariable(optimal_tiling_capabilities); + + /* Tells whether the format can be used with functions introduced in VK_AMD_texture_gather_bias_lod */ + bool supports_amd_texture_gather_bias_lod; + + /** Dummy constructor */ + FormatProperties(); + + /** Constructor. Initializes the instance using data provided by the driver. + * + * @param in_format_props Vulkan structure to use for initialization. + **/ + FormatProperties(const VkFormatProperties& in_format_props); + } FormatProperties; + + extern bool operator==(const FormatProperties& in1, + const FormatProperties& in2); + + /** Describes an image memory barrier. */ + typedef struct ImageBarrier + { + VkAccessFlagsVariable(dst_access_mask); + VkAccessFlagsVariable(src_access_mask); + + bool by_region; + uint32_t dst_queue_family_index; + VkImage image; + VkImageMemoryBarrier image_barrier_vk; + Anvil::Image* image_ptr; + VkImageLayout new_layout; + VkImageLayout old_layout; + uint32_t src_queue_family_index; + VkImageSubresourceRange subresource_range; + + /** Constructor. + * + * Note that @param in_image_ptr is retained by this function. + * + * @param in_source_access_mask Source access mask to use for the barrier. + * @param in_destination_access_mask Destination access mask to use for the barrier. + * @param in_by_region_barrier true if this is a by-region barrier. + * @param in_old_layout Old layout of @param in_image_ptr to use for the barrier. + * @param in_new_layout New layout of @param in_image_ptr to use for the barrier. + * @param in_src_queue_family_index Source queue family index to use for the barrier. + * @param in_dst_queue_family_index Destination queue family index to use for the barrier. + * @param in_image_ptr Image instance the barrier refers to. May be nullptr, in which case + * "image" and "image_ptr" fields will be set to nullptr. + * The instance will be retained by this function. + * @param in_image_subresource_range Subresource range to use for the barrier. + * + **/ + ImageBarrier(VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region_barrier, + VkImageLayout in_old_layout, + VkImageLayout in_new_layout, + uint32_t in_src_queue_family_index, + uint32_t in_dst_queue_family_index, + Anvil::Image* in_image_ptr, + VkImageSubresourceRange in_image_subresource_range); + + /** Destructor. + * + * Releases the encapsulated Image instance. + **/ + virtual ~ImageBarrier(); + + /** Copy constructor. + * + * Retains the Image instance stored in the input barrier. + * + * @param in Barrier instance to copy data from. + **/ + ImageBarrier(const ImageBarrier& in); + + /** Returns a Vulkan memory barrier descriptor, whose configuration corresponds to + * to the configuration of this descriptor. + **/ + virtual VkImageMemoryBarrier get_barrier_vk() const + { + return image_barrier_vk; + } + + /** Returns a pointer to the Vulkan descriptor, whose configuration corresponds to + * the configuration of this descriptor. + * + * The returned pointer remains valid for the duration of the Barrier descriptor's + * life-time. + **/ + const VkImageMemoryBarrier* get_barrier_vk_ptr() const + { + return &image_barrier_vk; + } + + private: + ImageBarrier& operator=(const ImageBarrier&); + } ImageBarrier; + + /* Holds 16-bit storage features */ + typedef struct KHR16BitStorageFeatures + { + bool is_input_output_storage_supported; + bool is_push_constant_16_bit_storage_supported; + bool is_storage_buffer_16_bit_access_supported; + bool is_uniform_and_storage_buffer_16_bit_access_supported; + + KHR16BitStorageFeatures(); + KHR16BitStorageFeatures(const VkPhysicalDevice16BitStorageFeaturesKHR& in_features); + + VkPhysicalDevice16BitStorageFeaturesKHR get_vk_physical_device_16_bit_storage_features() const; + + bool operator==(const KHR16BitStorageFeatures& in_features) const; + } KHR16BitStorageFeatures; + + typedef struct KHRMaintenance3Properties + { + VkDeviceSize max_memory_allocation_size; + uint32_t max_per_set_descriptors; + + KHRMaintenance3Properties(); + KHRMaintenance3Properties(const VkPhysicalDeviceMaintenance3PropertiesKHR& in_props); + + bool operator==(const KHRMaintenance3Properties&) const; + + } KHRMaintenance3Properties; + + /** Holds properties of a single Vulkan Layer. */ + typedef struct Layer + { + std::string description; + std::vector extensions; + uint32_t implementation_version; + std::string name; + uint32_t spec_version; + + /** Dummy constructor. + * + * @param in_layer_name Name to use for the layer. + **/ + Layer(const std::string& in_layer_name); + + /** Constructor. Initializes the instance using data provided by the driver. + * + * @param in_layer_props Vulkan structure to use for initialization. + **/ + Layer(const VkLayerProperties& in_layer_props); + + /** Returns true if @param in_layer_name matches the layer name described by the instance. */ + bool operator==(const std::string& in_layer_name) const; + } Layer; + + typedef std::vector Layers; + + /** Describes a Vulkan memory barrier. */ + typedef struct MemoryBarrier + { + VkAccessFlagsVariable(destination_access_mask); + VkAccessFlagsVariable(source_access_mask); + + VkMemoryBarrier memory_barrier_vk; + + /** Constructor. + * + * @param in_source_access_mask Source access mask of the Vulkan memory barrier. + * @param in_destination_access_mask Destination access mask of the Vulkan memory barrier. + * + **/ + explicit MemoryBarrier(VkAccessFlags in_destination_access_mask, + VkAccessFlags in_source_access_mask); + + /** Destructor. */ + virtual ~MemoryBarrier() + { + /* Stub */ + } + + /** Returns a Vulkan memory barrier descriptor, whose configuration corresponds to + * to the configuration of this descriptor. + **/ + virtual VkMemoryBarrier get_barrier_vk() const + { + return memory_barrier_vk; + } + + /** Returns a pointer to the Vulkan descriptor, whose configuration corresponds to + * the configuration of this descriptor. + * + * The returned pointer remains valid for the duration of the Barrier descriptor's + * life-time. + **/ + virtual const VkMemoryBarrier* get_barrier_vk_ptr() const + { + return &memory_barrier_vk; + } + } MemoryBarrier; + + /** Holds properties of a single Vulkan Memory Heap. */ + typedef struct MemoryHeap + { + VkMemoryHeapFlagsVariable(flags); + + VkDeviceSize size; + + /** Stub constructor */ + MemoryHeap(); + } MemoryHeap; + + typedef std::vector MemoryHeaps; + + extern bool operator==(const MemoryHeap& in1, + const MemoryHeap& in2); + + /** Holds properties of a single Vulkan Memory Type. */ + typedef struct MemoryType + { + MemoryFeatureFlags features; + MemoryHeap* heap_ptr; + + VkMemoryPropertyFlagsVariable(flags); + + /** Constructor. Initializes the instance using data provided by the driver. + * + * @param in_type Vulkan structure to use for initialization. + * @param in_memory_props_ptr Used to initialize the MemoryHeap pointer member. Must not be nullptr. + **/ + explicit MemoryType(const VkMemoryType& in_type, + struct MemoryProperties* in_memory_props_ptr); + } MemoryType; + + typedef std::vector MemoryTypes; + + extern bool operator==(const MemoryType& in1, + const MemoryType& in2); + + /** Holds information about available memory heaps & types for a specific physical device. */ + typedef struct MemoryProperties + { + MemoryHeap* heaps; + uint32_t n_heaps; + MemoryTypes types; + + MemoryProperties(); + + /** Destructor */ + ~MemoryProperties(); + + /** Constructor. Initializes the instance using data provided by the driver. + * + * @param in_mem_properties Vulkan structure to use for initialization. + **/ + void init(const VkPhysicalDeviceMemoryProperties& in_mem_properties); + + private: + MemoryProperties (const MemoryProperties&); + MemoryProperties& operator=(const MemoryProperties&); + } MemoryProperties; + + extern bool operator==(const MemoryProperties& in1, + const MemoryProperties& in2); + + /** Defines data for a single image mip-map. + * + * Use one of the static create_() functions to set up structure fields according to the target + * image type. + **/ + typedef struct MipmapRawData + { + /* Image aspect the mip-map data is specified for. */ + VkImageAspectFlagBits aspect; + + /* Start layer index */ + uint32_t n_layer; + + /* Number of layers to update */ + uint32_t n_layers; + + /* Number of 3D texture slices to update. For non-3D texture types, this field + * should be set to 1. */ + uint32_t n_slices; + + + /* Index of the mip-map to update. */ + uint32_t n_mipmap; + + + /* Pointer to a buffer holding raw data representation. The data structure is characterized by + * data_size, row_size and slice_size fields. + * + * It is assumed the data under the pointer is tightly packed, and stored in column->row->slice->layer + * order. + */ + std::shared_ptr linear_tightly_packed_data_uchar_ptr; + const unsigned char* linear_tightly_packed_data_uchar_raw_ptr; + std::shared_ptr > linear_tightly_packed_data_uchar_vec_ptr; + + + /* Total number of bytes available for reading under linear_tightly_packed_data_ptr */ + uint32_t data_size; + + /* Number of bytes each row takes */ + uint32_t row_size; + + + /** Creates a MipmapRawData instance which can be used to upload data to 1D Image instances: + * + * @param in_aspect Image aspect to modify. + * @param in_n_mipmap Index of the mipmap to be updated. + * @param in_linear_tightly_packed_data_ptr Pointer to raw mip-map data. + * @param in_linear_tightly_packed_data_vector_ptr Vector holding raw mip-map data. + * @param in_row_size Number of bytes each texture row takes. + * + * NOTE: Mipmap contents is NOT cached at call time. This implies raw pointers are ASSUMED to + * be valid at baking time. + * + * @return As per description. + **/ + static MipmapRawData create_1D_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + std::shared_ptr in_linear_tightly_packed_data_ptr, + uint32_t in_row_size); + static MipmapRawData create_1D_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + const unsigned char* in_linear_tightly_packed_data_vector_ptr, + uint32_t in_row_size); + static MipmapRawData create_1D_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + std::shared_ptr > in_linear_tightly_packed_data_ptr, + uint32_t in_row_size); + + /** Creates a MipmapRawData instance which can be used to upload data to 1D Array Image instances: + * + * @param in_aspect Image aspect to modify. + * @param in_n_layer Index of a texture layer the mip-map data should be uploaded to. + * @param in_n_layers Number of texture layers to be updated. + * @param in_n_mipmap Index of the mipmap to be updated. + * @param in_linear_tightly_packed_data_ptr Pointer to raw mip-map data. + * @param in_linear_tightly_packed_data_vector_ptr Vector holding raw mip-map data. + * @param in_row_size Number of bytes each texture row takes. + * @param in_data_size Number of bytes available for reading under @param in_linear_tightly_packed_data_ptr. + * + * @return As per description. + **/ + static MipmapRawData create_1D_array_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + std::shared_ptr in_linear_tightly_packed_data_ptr, + uint32_t in_row_size, + uint32_t in_data_size); + static MipmapRawData create_1D_array_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + const unsigned char* in_linear_tightly_packed_data_ptr, + uint32_t in_row_size, + uint32_t in_data_size); + static MipmapRawData create_1D_array_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + std::shared_ptr > in_linear_tightly_packed_data_ptr, + uint32_t in_row_size, + uint32_t in_data_size); + + /** Creates a MipmapRawData instance which can be used to upload data to 2D Image instances: + * + * @param in_aspect Image aspect to modify. + * @param in_n_mipmap Index of the mipmap to be updated. + * @param in_linear_tightly_packed_data_ptr Pointer to raw mip-map data. + * @param in_linear_tightly_packed_data_vector_ptr Vector holding raw mip-map data. + * @param in_data_size Number of bytes available for reading under @param in_linear_tightly_packed_data_ptr. + * @param in_row_size Number of bytes each texture row takes. + * + * @return As per description. + **/ + static MipmapRawData create_2D_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + std::shared_ptr in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size); + static MipmapRawData create_2D_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + const unsigned char* in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size); + static MipmapRawData create_2D_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + std::shared_ptr > in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size); + + /** Creates a MipmapRawData instance which can be used to upload data to 2D Array Image instances: + * + * @param in_aspect Image aspect to modify. + * @param in_n_layer Index of a texture layer the mip-map data should be uploaded to. + * @param in_n_layers Number of texture layers to be updated. + * @param in_n_mipmap Index of the mipmap to be updated. + * @param in_linear_tightly_packed_data_ptr Pointer to raw mip-map data. + * @param in_linear_tightly_packed_data_vector_ptr Vector holding raw mip-map data. + * @param in_data_size Number of bytes available for reading under @param in_linear_tightly_packed_data_ptr. + * @param in_row_size Number of bytes each texture row takes. + * + * @return As per description. + **/ + static MipmapRawData create_2D_array_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + std::shared_ptr in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size); + static MipmapRawData create_2D_array_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + const unsigned char* in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size); + static MipmapRawData create_2D_array_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + std::shared_ptr > in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size); + + /** Creates a MipmapRawData instnce which can be used to upload data to 3D Image instances: + * + * @param in_aspect Image aspect to modify. + * @param in_n_layer Index of a texture layer the mip-map data should be uploaded to. + * @param in_n_slices Number of texture slices to be updated. + * @param in_n_mipmap Index of the mipmap to be updated. + * @param in_linear_tightly_packed_data_ptr Pointer to raw mip-map data. + * @param in_linear_tightly_packed_data_vector_ptr Vector holding raw mip-map data. + * @param in_slice_data_size Number of bytes available for reading under @param in_linear_tightly_packed_data_ptr for a single slice. + * @param in_row_size Number of bytes each texture row takes. + * + * @return As per description. + **/ + static MipmapRawData create_3D_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layer_slices, + uint32_t in_n_mipmap, + std::shared_ptr in_linear_tightly_packed_data_ptr, + uint32_t in_slice_data_size, + uint32_t in_row_size); + static MipmapRawData create_3D_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layer_slices, + uint32_t in_n_mipmap, + const unsigned char* in_linear_tightly_packed_data_ptr, + uint32_t in_slice_data_size, + uint32_t in_row_size); + static MipmapRawData create_3D_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layer_slices, + uint32_t in_n_mipmap, + std::shared_ptr > in_linear_tightly_packed_data_ptr, + uint32_t in_slice_data_size, + uint32_t in_row_size); + + /** Creates a MipmapRawData instance which can be used to upload data to Cube Map Image instances: + * + * @param in_aspect Image aspect to modify. + * @param in_n_layer Index of a texture layer the mip-map data should be uploaded to. + * Valid values and corresponding cube map faces: 0: -X, 1: -Y, 2: -Z, 3: +X, 4: +Y, 5: +Z + * @param in_n_mipmap Index of the mipmap to be updated. + * @param in_linear_tightly_packed_data_ptr Pointer to raw mip-map data. + * @param in_linear_tightly_packed_data_vector_ptr Vector holding raw mip-map data. + * @param in_data_size Number of bytes available for reading under @param in_linear_tightly_packed_data_ptr. + * @param in_row_size Number of bytes each texture row takes. + * + * @return As per description. + **/ + static MipmapRawData create_cube_map_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_mipmap, + std::shared_ptr in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size); + static MipmapRawData create_cube_map_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_mipmap, + const unsigned char* in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size); + static MipmapRawData create_cube_map_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_mipmap, + std::shared_ptr > in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size); + + /** Creates a MipmapRawData instance which can be used to upload data to Cube Map Array Image instances: + * + * @param in_aspect Image aspect to modify. + * @param in_n_layer Index of a texture layer the mip-map data should be uploaded to. + * Cube map faces, as selected for layer at index (n_layer % 6), are: + * 0: -X, 1: -Y, 2: -Z, 3: +X, 4: +Y, 5: +Z + * @param in_n_layers Number of texture layers to update. + * @param in_n_mipmap Index of the mipmap to be updated. + * @param in_linear_tightly_packed_data_ptr Pointer to raw mip-map data. + * @param in_linear_tightly_packed_data_vector_ptr Vector holding raw mip-map data. + * @param in_data_size Number of bytes available for reading under @param in_linear_tightly_packed_data_ptr. + * @param in_row_size Number of bytes each texture row takes. + * + * @return As per description. + **/ + static MipmapRawData create_cube_map_array_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + std::shared_ptr in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size); + static MipmapRawData create_cube_map_array_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + const unsigned char* in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size); + static MipmapRawData create_cube_map_array_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + std::shared_ptr > in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size); + + private: + static MipmapRawData create_1D (VkImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + uint32_t in_row_size); + static MipmapRawData create_1D_array(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + uint32_t in_row_size, + uint32_t in_data_size); + static MipmapRawData create_2D (VkImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + uint32_t in_data_size, + uint32_t in_row_size); + static MipmapRawData create_2D_array(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + uint32_t in_data_size, + uint32_t in_row_size); + static MipmapRawData create_3D (VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_slices, + uint32_t in_n_mipmap, + uint32_t in_data_size, + uint32_t in_row_size); + } MipmapRawData; + + /* Dummy delete functor */ + template + struct NullDeleter + { + void operator()(Type* in_unused_ptr) + { + in_unused_ptr; + } + }; + + /* Used internally by Buffer and Image to track page occupancy status */ + typedef union + { + uint32_t raw; + + struct + { + uint8_t page_bit_0 : 1; + uint8_t page_bit_1 : 1; + uint8_t page_bit_2 : 1; + uint8_t page_bit_3 : 1; + uint8_t page_bit_4 : 1; + uint8_t page_bit_5 : 1; + uint8_t page_bit_6 : 1; + uint8_t page_bit_7 : 1; + uint8_t page_bit_8 : 1; + uint8_t page_bit_9 : 1; + uint8_t page_bit_10 : 1; + uint8_t page_bit_11 : 1; + uint8_t page_bit_12 : 1; + uint8_t page_bit_13 : 1; + uint8_t page_bit_14 : 1; + uint8_t page_bit_15 : 1; + uint8_t page_bit_16 : 1; + uint8_t page_bit_17 : 1; + uint8_t page_bit_18 : 1; + uint8_t page_bit_19 : 1; + uint8_t page_bit_20 : 1; + uint8_t page_bit_21 : 1; + uint8_t page_bit_22 : 1; + uint8_t page_bit_23 : 1; + uint8_t page_bit_24 : 1; + uint8_t page_bit_25 : 1; + uint8_t page_bit_26 : 1; + uint8_t page_bit_27 : 1; + uint8_t page_bit_28 : 1; + uint8_t page_bit_29 : 1; + uint8_t page_bit_30 : 1; + uint8_t page_bit_31 : 1; + } page_bits; + } PageOccupancyStatus; + + typedef struct PhysicalDeviceFeaturesCoreVK10 + { + bool alpha_to_one; + bool depth_bias_clamp; + bool depth_bounds; + bool depth_clamp; + bool draw_indirect_first_instance; + bool dual_src_blend; + bool fill_mode_non_solid; + bool fragment_stores_and_atomics; + bool full_draw_index_uint32; + bool geometry_shader; + bool image_cube_array; + bool independent_blend; + bool inherited_queries; + bool large_points; + bool logic_ip; + bool multi_draw_indirect; + bool multi_viewport; + bool occlusion_query_precise; + bool pipeline_statistics_query; + bool robust_buffer_access; + bool sampler_anisotropy; + bool sample_rate_shading; + bool shader_clip_distance; + bool shader_cull_distance; + bool shader_float64; + bool shader_image_gather_extended; + bool shader_int16; + bool shader_int64; + bool shader_resource_residency; + bool shader_resource_min_lod; + bool shader_sampled_image_array_dynamic_indexing; + bool shader_storage_buffer_array_dynamic_indexing; + bool shader_storage_image_array_dynamic_indexing; + bool shader_storage_image_extended_formats; + bool shader_storage_image_multisample; + bool shader_storage_image_read_without_format; + bool shader_storage_image_write_without_format; + bool shader_tessellation_and_geometry_point_size; + bool shader_uniform_buffer_array_dynamic_indexing; + bool sparse_binding; + bool sparse_residency_2_samples; + bool sparse_residency_4_samples; + bool sparse_residency_8_samples; + bool sparse_residency_16_samples; + bool sparse_residency_aliased; + bool sparse_residency_buffer; + bool sparse_residency_image_2D; + bool sparse_residency_image_3D; + bool tessellation_shader; + bool texture_compression_ASTC_LDR; + bool texture_compression_BC; + bool texture_compression_ETC2; + bool variable_multisample_rate; + bool vertex_pipeline_stores_and_atomics; + bool wide_lines; + + VkPhysicalDeviceFeatures get_vk_physical_device_features() const; + bool operator== (const PhysicalDeviceFeaturesCoreVK10& in_data) const; + + PhysicalDeviceFeaturesCoreVK10(); + PhysicalDeviceFeaturesCoreVK10(const VkPhysicalDeviceFeatures& in_physical_device_features); + + } PhysicalDeviceFeaturesCoreVK10; + + typedef struct PhysicalDeviceFeatures + { + const PhysicalDeviceFeaturesCoreVK10* core_vk1_0_features_ptr; + const EXTDescriptorIndexingFeatures* ext_descriptor_indexing_features_ptr; + const KHR16BitStorageFeatures* khr_16bit_storage_features_ptr; + + PhysicalDeviceFeatures(); + PhysicalDeviceFeatures(const PhysicalDeviceFeaturesCoreVK10* in_core_vk1_0_features_ptr, + const EXTDescriptorIndexingFeatures* in_ext_descriptor_indexing_features_ptr, + const KHR16BitStorageFeatures* in_khr_16_bit_storage_features_ptr); + + bool operator==(const PhysicalDeviceFeatures& in_physical_device_features) const; + } PhysicalDeviceFeatures; + + typedef struct PhysicalDeviceLimits + { + VkDeviceSize buffer_image_granularity; + uint32_t discrete_queue_priorities; + VkSampleCountFlags framebuffer_color_sample_counts; + VkSampleCountFlags framebuffer_depth_sample_counts; + VkSampleCountFlags framebuffer_no_attachments_sample_counts; + VkSampleCountFlags framebuffer_stencil_sample_counts; + float line_width_granularity; + float line_width_range[2]; + uint32_t max_bound_descriptor_sets; + uint32_t max_clip_distances; + uint32_t max_color_attachments; + uint32_t max_combined_clip_and_cull_distances; + uint32_t max_compute_shared_memory_size; + uint32_t max_compute_work_group_count[3]; + uint32_t max_compute_work_group_invocations; + uint32_t max_compute_work_group_size[3]; + uint32_t max_cull_distances; + uint32_t max_descriptor_set_input_attachments; + uint32_t max_descriptor_set_sampled_images; + uint32_t max_descriptor_set_samplers; + uint32_t max_descriptor_set_storage_buffers; + uint32_t max_descriptor_set_storage_buffers_dynamic; + uint32_t max_descriptor_set_storage_images; + uint32_t max_descriptor_set_uniform_buffers; + uint32_t max_descriptor_set_uniform_buffers_dynamic; + uint32_t max_draw_indexed_index_value; + uint32_t max_draw_indirect_count; + uint32_t max_fragment_combined_output_resources; + uint32_t max_fragment_dual_src_attachments; + uint32_t max_fragment_input_components; + uint32_t max_fragment_output_attachments; + uint32_t max_framebuffer_height; + uint32_t max_framebuffer_layers; + uint32_t max_framebuffer_width; + uint32_t max_geometry_input_components; + uint32_t max_geometry_output_components; + uint32_t max_geometry_output_vertices; + uint32_t max_geometry_shader_invocations; + uint32_t max_geometry_total_output_components; + uint32_t max_image_array_layers; + uint32_t max_image_dimension_1D; + uint32_t max_image_dimension_2D; + uint32_t max_image_dimension_3D; + uint32_t max_image_dimension_cube; + float max_interpolation_offset; + uint32_t max_memory_allocation_count; + uint32_t max_per_stage_descriptor_input_attachments; + uint32_t max_per_stage_descriptor_sampled_images; + uint32_t max_per_stage_descriptor_samplers; + uint32_t max_per_stage_descriptor_storage_buffers; + uint32_t max_per_stage_descriptor_storage_images; + uint32_t max_per_stage_descriptor_uniform_buffers; + uint32_t max_per_stage_resources; + uint32_t max_push_constants_size; + uint32_t max_sample_mask_words; + uint32_t max_sampler_allocation_count; + float max_sampler_anisotropy; + float max_sampler_lod_bias; + uint32_t max_storage_buffer_range; + uint32_t max_viewport_dimensions[2]; + uint32_t max_viewports; + uint32_t max_tessellation_control_per_patch_output_components; + uint32_t max_tessellation_control_per_vertex_input_components; + uint32_t max_tessellation_control_per_vertex_output_components; + uint32_t max_tessellation_control_total_output_components; + uint32_t max_tessellation_evaluation_input_components; + uint32_t max_tessellation_evaluation_output_components; + uint32_t max_tessellation_generation_level; + uint32_t max_tessellation_patch_size; + uint32_t max_texel_buffer_elements; + uint32_t max_texel_gather_offset; + uint32_t max_texel_offset; + uint32_t max_uniform_buffer_range; + uint32_t max_vertex_input_attributes; + uint32_t max_vertex_input_attribute_offset; + uint32_t max_vertex_input_bindings; + uint32_t max_vertex_input_binding_stride; + uint32_t max_vertex_output_components; + float min_interpolation_offset; + size_t min_memory_map_alignment; + VkDeviceSize min_storage_buffer_offset_alignment; + VkDeviceSize min_texel_buffer_offset_alignment; + int32_t min_texel_gather_offset; + int32_t min_texel_offset; + VkDeviceSize min_uniform_buffer_offset_alignment; + uint32_t mipmap_precision_bits; + VkDeviceSize non_coherent_atom_size; + VkDeviceSize optimal_buffer_copy_offset_alignment; + VkDeviceSize optimal_buffer_copy_row_pitch_alignment; + float point_size_granularity; + float point_size_range[2]; + VkSampleCountFlags sampled_image_color_sample_counts; + VkSampleCountFlags sampled_image_depth_sample_counts; + VkSampleCountFlags sampled_image_integer_sample_counts; + VkSampleCountFlags sampled_image_stencil_sample_counts; + VkDeviceSize sparse_address_space_size; + bool standard_sample_locations; + VkSampleCountFlags storage_image_sample_counts; + bool strict_lines; + uint32_t sub_pixel_interpolation_offset_bits; + uint32_t sub_pixel_precision_bits; + uint32_t sub_texel_precision_bits; + bool timestamp_compute_and_graphics; + float timestamp_period; + float viewport_bounds_range[2]; + uint32_t viewport_sub_pixel_bits; + + PhysicalDeviceLimits(); + PhysicalDeviceLimits(const VkPhysicalDeviceLimits& in_device_limits); + + bool operator==(const PhysicalDeviceLimits& in_device_limits) const; + } PhysicalDeviceLimits; + + typedef struct PhysicalDeviceSparseProperties + { + bool residency_standard_2D_block_shape; + bool residency_standard_2D_multisample_block_shape; + bool residency_standard_3D_block_shape; + bool residency_aligned_mip_size; + bool residency_non_resident_strict; + + PhysicalDeviceSparseProperties(); + PhysicalDeviceSparseProperties(const VkPhysicalDeviceSparseProperties& in_sparse_props); + + bool operator==(const PhysicalDeviceSparseProperties& in_props) const; + } PhysicalDeviceSparseProperties; + + typedef struct PhysicalDevicePropertiesCoreVK10 + { + uint32_t api_version; + uint32_t device_id; + char device_name [VK_MAX_PHYSICAL_DEVICE_NAME_SIZE]; + VkPhysicalDeviceType device_type; + uint32_t driver_version; + uint8_t pipeline_cache_uuid[VK_UUID_SIZE]; + uint32_t vendor_id; + + PhysicalDeviceLimits limits; + PhysicalDeviceSparseProperties sparse_properties; + + bool operator==(const PhysicalDevicePropertiesCoreVK10& in_props) const; + + PhysicalDevicePropertiesCoreVK10(); + PhysicalDevicePropertiesCoreVK10(const VkPhysicalDeviceProperties& in_physical_device_properties); + } PhysicalDevicePropertiesCoreVK10; + + typedef struct PhysicalDeviceProperties + { + const AMDShaderCoreProperties* amd_shader_core_properties_ptr; + const PhysicalDevicePropertiesCoreVK10* core_vk1_0_properties_ptr; + const EXTDescriptorIndexingProperties* ext_descriptor_indexing_properties_ptr; + const KHRMaintenance3Properties* khr_maintenance3_properties_ptr; + + PhysicalDeviceProperties(); + PhysicalDeviceProperties(const AMDShaderCoreProperties* in_amd_shader_core_properties_ptr, + const PhysicalDevicePropertiesCoreVK10* in_core_vk1_0_properties_ptr, + const EXTDescriptorIndexingProperties* in_ext_descriptor_indexing_properties_ptr, + const KHRMaintenance3Properties* in_khr_maintenance3_properties_ptr); + + bool operator==(const PhysicalDeviceProperties& in_props) const; + } PhysicalDeviceProperties; + + /* A single push constant range descriptor */ + typedef struct PushConstantRange + { + uint32_t offset; + uint32_t size; + VkShaderStageFlagBits stages; + + /** Constructor + * + * @param in_offset Start offset for the range. + * @param in_size Size of the range. + * @param in_stages Valid pipeline stages for the range. + */ + PushConstantRange(uint32_t in_offset, + uint32_t in_size, + VkShaderStageFlags in_stages); + + /** Comparison operator. Used internally. */ + bool operator==(const PushConstantRange& in) const; + } PushConstantRange; + + typedef std::vector PushConstantRanges; + + /** Holds information about a single Vulkan Queue Family. */ + typedef struct QueueFamilyInfo + { + VkQueueFlagsVariable(flags); + + VkExtent3D min_image_transfer_granularity; + uint32_t n_queues; + uint32_t n_timestamp_bits; + + /** Constructor. Initializes the instance using data provided by the driver. + * + * @param in_props Vulkan structure to use for initialization. + **/ + explicit QueueFamilyInfo(const VkQueueFamilyProperties& in_props); + } QueueFamilyInfo; + + typedef std::vector QueueFamilyInfoItems; + + extern bool operator==(const QueueFamilyInfo& in1, + const QueueFamilyInfo& in2); + + /** Describes a physical device group */ + typedef struct PhysicalDeviceGroup + { + std::vector physical_device_ptrs; + bool supports_subset_allocations; + + explicit PhysicalDeviceGroup(); + } PhysicalDeviceGroup; + + /** Holds all information related to a specific shader module stage entry-point. */ + typedef struct ShaderModuleStageEntryPoint + { + std::string name; + ShaderModuleUniquePtr shader_module_owned_ptr; + Anvil::ShaderModule* shader_module_ptr; + Anvil::ShaderStage stage; + + /** Dummy constructor */ + ShaderModuleStageEntryPoint(); + + /** Copy constructor. */ + ShaderModuleStageEntryPoint(const ShaderModuleStageEntryPoint& in); + + /** Constructor. + * + * @param in_name Entry-point name. Must not be nullptr. + * @param in_shader_module_ptr ShaderModule instance to use. + * @param in_stage Shader stage the entry-point implements. + */ + ShaderModuleStageEntryPoint(const std::string& in_name, + ShaderModule* in_shader_module_ptr, + ShaderStage in_stage); + ShaderModuleStageEntryPoint(const std::string& in_name, + ShaderModuleUniquePtr in_shader_module_ptr, + ShaderStage in_stage); + + /** Destructor. */ + ~ShaderModuleStageEntryPoint(); + + ShaderModuleStageEntryPoint& operator=(const ShaderModuleStageEntryPoint&); + } ShaderModuleStageEntryPoint; + + /* Describes sparse properties for an image format */ + typedef struct SparseImageAspectProperties + { + VkImageAspectFlagsVariable (aspect_mask); + VkSparseImageFormatFlagsVariable(flags); + + VkExtent3D granularity; + uint32_t mip_tail_first_lod; + VkDeviceSize mip_tail_offset; + VkDeviceSize mip_tail_size; + VkDeviceSize mip_tail_stride; + + SparseImageAspectProperties(); + SparseImageAspectProperties(const VkSparseImageMemoryRequirements& in_req); + } SparseImageAspectProperties; + + typedef struct SpecializationConstant + { + uint32_t constant_id; + uint32_t n_bytes; + uint32_t start_offset; + + /** Dummy constructor. Should only be used by STL containers. */ + SpecializationConstant(); + + /** Constructor. + * + * @param in_constant_id Specialization constant ID. + * @param in_n_bytes Number of bytes consumed by the constant. + * @param in_start_offset Start offset, at which the constant data starts. + */ + SpecializationConstant(uint32_t in_constant_id, + uint32_t in_n_bytes, + uint32_t in_start_offset); + } SpecializationConstant; + + typedef std::vector SpecializationConstants; + + /* Represents a Vulkan structure header */ + typedef struct + { + VkStructureType type; + const void* next_ptr; + } VkStructHeader; + +}; /* namespace Anvil */ +#endif diff --git a/include/misc/types_utils.h b/include/misc/types_utils.h new file mode 100644 index 00000000..d8261d47 --- /dev/null +++ b/include/misc/types_utils.h @@ -0,0 +1,299 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef TYPES_UTILS_H +#define TYPES_UTILS_H + +namespace Anvil +{ + namespace Utils + { + MTSafety convert_boolean_to_mt_safety_enum(bool in_mt_safe); + + VkExternalMemoryHandleTypeFlagsKHR convert_external_memory_handle_types_to_vk_external_memory_handle_type_flags(const Anvil::ExternalMemoryHandleTypeFlags& in_flags); + + bool convert_mt_safety_enum_to_boolean(MTSafety in_mt_safety, + const Anvil::BaseDevice* in_device_ptr); + + Anvil::QueueFamilyBits get_queue_family_bits_from_queue_family_type(Anvil::QueueFamilyType in_queue_family_type); + + /** Converts a Anvil::QueueFamilyBits bitfield value to an array of queue family indices. + * + * @param in_queue_families Input value to convert from. + * @param out_opt_queue_family_indices_ptr If not NULL, deref will be updated with *@param out_opt_n_queue_family_indices_ptr + * values, corresponding to queue family indices, as specified under @param in_queue_families. + * @param out_opt_n_queue_family_indices_ptr If not NULL, deref will be set to the number of items that would be or were written + * under @param out_opt_queue_family_indices_ptr. + * + **/ + void convert_queue_family_bits_to_family_indices(const Anvil::BaseDevice* in_device_ptr, + Anvil::QueueFamilyBits in_queue_families, + uint32_t* out_opt_queue_family_indices_ptr, + uint32_t* out_opt_n_queue_family_indices_ptr); + + /** Returns an access mask which has all the access bits, relevant to the user-specified image layout, + * enabled. + * + * The access mask can be further restricted to the specified queue family type. + */ + VkAccessFlags get_access_mask_from_image_layout(VkImageLayout in_layout, + Anvil::QueueFamilyType in_queue_family_type = Anvil::QueueFamilyType::UNDEFINED); + + /** Converts a pair of VkMemoryPropertyFlags and VkMemoryHeapFlags bitfields to a corresponding Anvil::MemoryFeatureFlags + * enum. + * + * @param in_opt_mem_type_flags Vulkan memory property flags. May be 0. + * @param in_opt_mem_heap_flags Vulkan memory heap flags. May be 0. + * + * @return Result bitfield. + */ + Anvil::MemoryFeatureFlags get_memory_feature_flags_from_vk_property_flags(VkMemoryPropertyFlags in_opt_mem_type_flags, + VkMemoryHeapFlags in_opt_mem_heap_flags); + + /** Converts the specified queue family type to a raw string + * + * @param in_queue_family_type Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(Anvil::QueueFamilyType in_queue_family_type); + + /** Converts the specified VkAttachmentLoadOp value to a raw string + * + * @param in_load_op Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(VkAttachmentLoadOp in_load_op); + + /** Converts the specified VkAttachmentStoreOp value to a raw string + * + * @param in_store_op Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(VkAttachmentStoreOp in_store_op); + + /** Converts the specified VkBlendFactor value to a raw string + * + * @param in_blend_factor Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(VkBlendFactor in_blend_factor); + + /** Converts the specified VkBlendOp value to a raw string + * + * @param in_blend_op Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(VkBlendOp in_blend_op); + + /** Converts the specified VkCompareOp value to a raw string + * + * @param in_compare_op Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(VkCompareOp in_compare_op); + + /** Converts the specified VkCullModeFlagBits value to a raw string + * + * @param in_cull_mode Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(VkCullModeFlagBits in_cull_mode); + + /** Converts the specified VkDescriptorType value to a raw string + * + * @param in_descriptor_type Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(VkDescriptorType in_descriptor_type); + + /** Converts the specified VkFrontFace value to a raw string + * + * @param in_front_face Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(VkFrontFace in_front_face); + + /** Converts the specified VkImageAspectFlagBits value to a raw string + * + * @param in_image_aspect_flag Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(VkImageAspectFlagBits in_image_aspect_flag); + + /** Converts the specified VkImageLayout value to a raw string + * + * @param in_image_layout Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(VkImageLayout in_image_layout); + + /** Converts the specified VkImageTiling value to a raw string + * + * @param in_image_tiling Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(VkImageTiling in_image_tiling); + + /** Converts the specified VkImageType value to a raw string + * + * @param in_image_type Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(VkImageType in_image_type); + + /** Converts the specified VkImageViewType value to a raw string + * + * @param in_image_view_type Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(VkImageViewType in_image_view_type); + + /** Converts the specified VkLogicOp value to a raw string + * + * @param in_logic_op Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(VkLogicOp in_logic_op); + + /** Converts the specified VkPolygonMode value to a raw string + * + * @param in_polygon_mode Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(VkPolygonMode in_polygon_mode); + + /** Converts the specified VkPrimitiveTopology value to a raw string + * + * @param in_topology Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(VkPrimitiveTopology in_topology); + + /** Converts the specified VkSampleCountFlagBits value to a raw string + * + * @param in_sample_count Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(VkSampleCountFlagBits in_sample_count); + + /** Converts the specified Anvil::ShaderStage value to a raw string + * + * @param in_shader_stage Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(Anvil::ShaderStage in_shader_stage); + + /** Converts the specified VkShaderStageFlagBits value to a raw string + * + * @param in_shader_stage Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(VkShaderStageFlagBits in_shader_stage); + + /** Converts the specified VkSharingMode value to a raw string + * + * @param in_sharing_mode Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(VkSharingMode in_sharing_mode); + + /** Converts the specified VkStencilOp value to a raw string + * + * @param in_stencil_op Input value. + * + * @return Non-NULL value if successful, NULL otherwise. + */ + const char* get_raw_string(VkStencilOp in_stencil_op); + + /* Returns Vulkan equivalent of @param in_shader_stage */ + VkShaderStageFlagBits get_shader_stage_flag_bits_from_shader_stage(Anvil::ShaderStage in_shader_stage); + + /** Converts an Anvil::MemoryFeatureFlags value to a pair of corresponding Vulkan enum values. + * + * @param in_mem_feature_flags Anvil memory feature flags to use for conversion. + * @param out_mem_type_flags_ptr Deref will be set to a corresponding VkMemoryPropertyFlags value. Must not + * be nullptr. + * @param out_mem_heap_flags_ptr Deref will be set to a corresponding VkMemoryHeapFlags value. Must not + * be nullptr. + **/ + void get_vk_property_flags_from_memory_feature_flags(Anvil::MemoryFeatureFlags in_mem_feature_flags, + VkMemoryPropertyFlags* out_mem_type_flags_ptr, + VkMemoryHeapFlags* out_mem_heap_flags_ptr); + + /** Tells whether @param in_value is a power-of-two. */ + template + type is_pow2(const type in_value) + { + return ((in_value & (in_value - 1)) == 0); + } + + /** Rounds down @param in_value to a multiple of @param in_base */ + template + type round_down(const type in_value, const type in_base) + { + if ((in_value % in_base) == 0) + { + return in_value; + } + else + { + return in_value - (in_value % in_base); + } + } + + /** Rounds up @param in_value to a multiple of @param in_base */ + template + type round_up(const type in_value, const type in_base) + { + if ((in_value % in_base) == 0) + { + return in_value; + } + else + { + return in_value + (in_base - in_value % in_base); + } + } + }; +}; /* Anvil namespace */ + +#endif /* TYPES_UTILS_H */ \ No newline at end of file diff --git a/include/misc/window.h b/include/misc/window.h index 4c99802e..6a53ed8b 100644 --- a/include/misc/window.h +++ b/include/misc/window.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/misc/window_factory.h b/include/misc/window_factory.h index c23a04af..e4a3215e 100644 --- a/include/misc/window_factory.h +++ b/include/misc/window_factory.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/misc/window_win3264.h b/include/misc/window_win3264.h index 4b0c083d..042c6411 100644 --- a/include/misc/window_win3264.h +++ b/include/misc/window_win3264.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/vulkan/vulkan_android.h b/include/vulkan/vulkan_android.h new file mode 100644 index 00000000..07aaeda2 --- /dev/null +++ b/include/vulkan/vulkan_android.h @@ -0,0 +1,126 @@ +#ifndef VULKAN_ANDROID_H_ +#define VULKAN_ANDROID_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_KHR_android_surface 1 +struct ANativeWindow; + +#define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6 +#define VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface" + +typedef VkFlags VkAndroidSurfaceCreateFlagsKHR; + +typedef struct VkAndroidSurfaceCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkAndroidSurfaceCreateFlagsKHR flags; + struct ANativeWindow* window; +} VkAndroidSurfaceCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR( + VkInstance instance, + const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); +#endif + +#define VK_ANDROID_external_memory_android_hardware_buffer 1 +struct AHardwareBuffer; + +#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 3 +#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME "VK_ANDROID_external_memory_android_hardware_buffer" + +typedef struct VkAndroidHardwareBufferUsageANDROID { + VkStructureType sType; + void* pNext; + uint64_t androidHardwareBufferUsage; +} VkAndroidHardwareBufferUsageANDROID; + +typedef struct VkAndroidHardwareBufferPropertiesANDROID { + VkStructureType sType; + void* pNext; + VkDeviceSize allocationSize; + uint32_t memoryTypeBits; +} VkAndroidHardwareBufferPropertiesANDROID; + +typedef struct VkAndroidHardwareBufferFormatPropertiesANDROID { + VkStructureType sType; + void* pNext; + VkFormat format; + uint64_t externalFormat; + VkFormatFeatureFlags formatFeatures; + VkComponentMapping samplerYcbcrConversionComponents; + VkSamplerYcbcrModelConversion suggestedYcbcrModel; + VkSamplerYcbcrRange suggestedYcbcrRange; + VkChromaLocation suggestedXChromaOffset; + VkChromaLocation suggestedYChromaOffset; +} VkAndroidHardwareBufferFormatPropertiesANDROID; + +typedef struct VkImportAndroidHardwareBufferInfoANDROID { + VkStructureType sType; + const void* pNext; + struct AHardwareBuffer* buffer; +} VkImportAndroidHardwareBufferInfoANDROID; + +typedef struct VkMemoryGetAndroidHardwareBufferInfoANDROID { + VkStructureType sType; + const void* pNext; + VkDeviceMemory memory; +} VkMemoryGetAndroidHardwareBufferInfoANDROID; + +typedef struct VkExternalFormatANDROID { + VkStructureType sType; + void* pNext; + uint64_t externalFormat; +} VkExternalFormatANDROID; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetAndroidHardwareBufferPropertiesANDROID)(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties); +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryAndroidHardwareBufferANDROID)(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetAndroidHardwareBufferPropertiesANDROID( + VkDevice device, + const struct AHardwareBuffer* buffer, + VkAndroidHardwareBufferPropertiesANDROID* pProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryAndroidHardwareBufferANDROID( + VkDevice device, + const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, + struct AHardwareBuffer** pBuffer); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/vulkan/vulkan_core.h b/include/vulkan/vulkan_core.h index c115fa66..ed0d596f 100644 --- a/include/vulkan/vulkan_core.h +++ b/include/vulkan/vulkan_core.h @@ -43,7 +43,7 @@ extern "C" { #define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) #define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff) // Version of this file -#define VK_HEADER_VERSION 70 +#define VK_HEADER_VERSION 72 #define VK_NULL_HANDLE 0 @@ -147,6 +147,7 @@ typedef enum VkResult { VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001, VK_ERROR_VALIDATION_FAILED_EXT = -1000011001, VK_ERROR_INVALID_SHADER_NV = -1000012000, + VK_ERROR_FRAGMENTATION_EXT = -1000161000, VK_ERROR_NOT_PERMITTED_EXT = -1000174001, VK_ERROR_OUT_OF_POOL_MEMORY_KHR = VK_ERROR_OUT_OF_POOL_MEMORY, VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR = VK_ERROR_INVALID_EXTERNAL_HANDLE, @@ -356,6 +357,12 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT = 1000128002, VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT = 1000128003, VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT = 1000128004, + VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID = 1000129000, + VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID = 1000129001, + VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID = 1000129002, + VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID = 1000129003, + VK_STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID = 1000129004, + VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID = 1000129005, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT = 1000130000, VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT = 1000130001, VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT = 1000143000, @@ -371,10 +378,16 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV = 1000152000, VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160000, VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160001, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT = 1000161000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT = 1000161001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT = 1000161002, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT = 1000161003, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT_EXT = 1000161004, VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT = 1000174000, VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT = 1000178000, VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT = 1000178001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT = 1000178002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD = 1000185000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT = 1000190000, VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT = 1000190001, VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO, @@ -1492,12 +1505,14 @@ typedef VkFlags VkSamplerCreateFlags; typedef enum VkDescriptorSetLayoutCreateFlagBits { VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR = 0x00000001, + VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT = 0x00000002, VK_DESCRIPTOR_SET_LAYOUT_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkDescriptorSetLayoutCreateFlagBits; typedef VkFlags VkDescriptorSetLayoutCreateFlags; typedef enum VkDescriptorPoolCreateFlagBits { VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001, + VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT = 0x00000002, VK_DESCRIPTOR_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkDescriptorPoolCreateFlagBits; typedef VkFlags VkDescriptorPoolCreateFlags; @@ -3732,6 +3747,7 @@ typedef enum VkSubgroupFeatureFlagBits { VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT = 0x00000020, VK_SUBGROUP_FEATURE_CLUSTERED_BIT = 0x00000040, VK_SUBGROUP_FEATURE_QUAD_BIT = 0x00000080, + VK_SUBGROUP_FEATURE_PARTITIONED_BIT_NV = 0x00000100, VK_SUBGROUP_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkSubgroupFeatureFlagBits; typedef VkFlags VkSubgroupFeatureFlags; @@ -3767,6 +3783,7 @@ typedef enum VkExternalMemoryHandleTypeFlagBits { VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT = 0x00000020, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT = 0x00000040, VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT = 0x00000200, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID = 0x00000400, VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT = 0x00000080, VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT = 0x00000100, VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT, @@ -5090,7 +5107,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdDispatchBaseKHR( #define VK_KHR_maintenance1 1 -#define VK_KHR_MAINTENANCE1_SPEC_VERSION 1 +#define VK_KHR_MAINTENANCE1_SPEC_VERSION 2 #define VK_KHR_MAINTENANCE1_EXTENSION_NAME "VK_KHR_maintenance1" typedef VkCommandPoolTrimFlags VkCommandPoolTrimFlagsKHR; @@ -7225,6 +7242,95 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetValidationCacheDataEXT( void* pData); #endif +#define VK_EXT_descriptor_indexing 1 +#define VK_EXT_DESCRIPTOR_INDEXING_SPEC_VERSION 2 +#define VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME "VK_EXT_descriptor_indexing" + + +typedef enum VkDescriptorBindingFlagBitsEXT { + VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT = 0x00000001, + VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT = 0x00000002, + VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT = 0x00000004, + VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT = 0x00000008, + VK_DESCRIPTOR_BINDING_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDescriptorBindingFlagBitsEXT; +typedef VkFlags VkDescriptorBindingFlagsEXT; + +typedef struct VkDescriptorSetLayoutBindingFlagsCreateInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t bindingCount; + const VkDescriptorBindingFlagsEXT* pBindingFlags; +} VkDescriptorSetLayoutBindingFlagsCreateInfoEXT; + +typedef struct VkPhysicalDeviceDescriptorIndexingFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 shaderInputAttachmentArrayDynamicIndexing; + VkBool32 shaderUniformTexelBufferArrayDynamicIndexing; + VkBool32 shaderStorageTexelBufferArrayDynamicIndexing; + VkBool32 shaderUniformBufferArrayNonUniformIndexing; + VkBool32 shaderSampledImageArrayNonUniformIndexing; + VkBool32 shaderStorageBufferArrayNonUniformIndexing; + VkBool32 shaderStorageImageArrayNonUniformIndexing; + VkBool32 shaderInputAttachmentArrayNonUniformIndexing; + VkBool32 shaderUniformTexelBufferArrayNonUniformIndexing; + VkBool32 shaderStorageTexelBufferArrayNonUniformIndexing; + VkBool32 descriptorBindingUniformBufferUpdateAfterBind; + VkBool32 descriptorBindingSampledImageUpdateAfterBind; + VkBool32 descriptorBindingStorageImageUpdateAfterBind; + VkBool32 descriptorBindingStorageBufferUpdateAfterBind; + VkBool32 descriptorBindingUniformTexelBufferUpdateAfterBind; + VkBool32 descriptorBindingStorageTexelBufferUpdateAfterBind; + VkBool32 descriptorBindingUpdateUnusedWhilePending; + VkBool32 descriptorBindingPartiallyBound; + VkBool32 descriptorBindingVariableDescriptorCount; + VkBool32 runtimeDescriptorArray; +} VkPhysicalDeviceDescriptorIndexingFeaturesEXT; + +typedef struct VkPhysicalDeviceDescriptorIndexingPropertiesEXT { + VkStructureType sType; + void* pNext; + uint32_t maxUpdateAfterBindDescriptorsInAllPools; + VkBool32 shaderUniformBufferArrayNonUniformIndexingNative; + VkBool32 shaderSampledImageArrayNonUniformIndexingNative; + VkBool32 shaderStorageBufferArrayNonUniformIndexingNative; + VkBool32 shaderStorageImageArrayNonUniformIndexingNative; + VkBool32 shaderInputAttachmentArrayNonUniformIndexingNative; + VkBool32 robustBufferAccessUpdateAfterBind; + VkBool32 quadDivergentImplicitLod; + uint32_t maxPerStageDescriptorUpdateAfterBindSamplers; + uint32_t maxPerStageDescriptorUpdateAfterBindUniformBuffers; + uint32_t maxPerStageDescriptorUpdateAfterBindStorageBuffers; + uint32_t maxPerStageDescriptorUpdateAfterBindSampledImages; + uint32_t maxPerStageDescriptorUpdateAfterBindStorageImages; + uint32_t maxPerStageDescriptorUpdateAfterBindInputAttachments; + uint32_t maxPerStageUpdateAfterBindResources; + uint32_t maxDescriptorSetUpdateAfterBindSamplers; + uint32_t maxDescriptorSetUpdateAfterBindUniformBuffers; + uint32_t maxDescriptorSetUpdateAfterBindUniformBuffersDynamic; + uint32_t maxDescriptorSetUpdateAfterBindStorageBuffers; + uint32_t maxDescriptorSetUpdateAfterBindStorageBuffersDynamic; + uint32_t maxDescriptorSetUpdateAfterBindSampledImages; + uint32_t maxDescriptorSetUpdateAfterBindStorageImages; + uint32_t maxDescriptorSetUpdateAfterBindInputAttachments; +} VkPhysicalDeviceDescriptorIndexingPropertiesEXT; + +typedef struct VkDescriptorSetVariableDescriptorCountAllocateInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t descriptorSetCount; + const uint32_t* pDescriptorCounts; +} VkDescriptorSetVariableDescriptorCountAllocateInfoEXT; + +typedef struct VkDescriptorSetVariableDescriptorCountLayoutSupportEXT { + VkStructureType sType; + void* pNext; + uint32_t maxVariableDescriptorCount; +} VkDescriptorSetVariableDescriptorCountLayoutSupportEXT; + + + #define VK_EXT_shader_viewport_index_layer 1 #define VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_SPEC_VERSION 1 #define VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME "VK_EXT_shader_viewport_index_layer" @@ -7303,6 +7409,31 @@ VKAPI_ATTR void VKAPI_CALL vkCmdWriteBufferMarkerAMD( uint32_t marker); #endif +#define VK_AMD_shader_core_properties 1 +#define VK_AMD_SHADER_CORE_PROPERTIES_SPEC_VERSION 1 +#define VK_AMD_SHADER_CORE_PROPERTIES_EXTENSION_NAME "VK_AMD_shader_core_properties" + +typedef struct VkPhysicalDeviceShaderCorePropertiesAMD { + VkStructureType sType; + void* pNext; + uint32_t shaderEngineCount; + uint32_t shaderArraysPerEngineCount; + uint32_t computeUnitsPerShaderArray; + uint32_t simdPerComputeUnit; + uint32_t wavefrontsPerSimd; + uint32_t wavefrontSize; + uint32_t sgprsPerSimd; + uint32_t minSgprAllocation; + uint32_t maxSgprAllocation; + uint32_t sgprAllocationGranularity; + uint32_t vgprsPerSimd; + uint32_t minVgprAllocation; + uint32_t maxVgprAllocation; + uint32_t vgprAllocationGranularity; +} VkPhysicalDeviceShaderCorePropertiesAMD; + + + #define VK_EXT_vertex_attribute_divisor 1 #define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION 1 #define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME "VK_EXT_vertex_attribute_divisor" @@ -7327,6 +7458,11 @@ typedef struct VkPipelineVertexInputDivisorStateCreateInfoEXT { +#define VK_NV_shader_subgroup_partitioned 1 +#define VK_NV_SHADER_SUBGROUP_PARTITIONED_SPEC_VERSION 1 +#define VK_NV_SHADER_SUBGROUP_PARTITIONED_EXTENSION_NAME "VK_NV_shader_subgroup_partitioned" + + #ifdef __cplusplus } #endif diff --git a/include/vulkan/vulkan_ios.h b/include/vulkan/vulkan_ios.h new file mode 100644 index 00000000..a0924816 --- /dev/null +++ b/include/vulkan/vulkan_ios.h @@ -0,0 +1,58 @@ +#ifndef VULKAN_IOS_H_ +#define VULKAN_IOS_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_MVK_ios_surface 1 +#define VK_MVK_IOS_SURFACE_SPEC_VERSION 2 +#define VK_MVK_IOS_SURFACE_EXTENSION_NAME "VK_MVK_ios_surface" + +typedef VkFlags VkIOSSurfaceCreateFlagsMVK; + +typedef struct VkIOSSurfaceCreateInfoMVK { + VkStructureType sType; + const void* pNext; + VkIOSSurfaceCreateFlagsMVK flags; + const void* pView; +} VkIOSSurfaceCreateInfoMVK; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateIOSSurfaceMVK)(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateIOSSurfaceMVK( + VkInstance instance, + const VkIOSSurfaceCreateInfoMVK* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/vulkan/vulkan_macos.h b/include/vulkan/vulkan_macos.h new file mode 100644 index 00000000..ff0b7018 --- /dev/null +++ b/include/vulkan/vulkan_macos.h @@ -0,0 +1,58 @@ +#ifndef VULKAN_MACOS_H_ +#define VULKAN_MACOS_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_MVK_macos_surface 1 +#define VK_MVK_MACOS_SURFACE_SPEC_VERSION 2 +#define VK_MVK_MACOS_SURFACE_EXTENSION_NAME "VK_MVK_macos_surface" + +typedef VkFlags VkMacOSSurfaceCreateFlagsMVK; + +typedef struct VkMacOSSurfaceCreateInfoMVK { + VkStructureType sType; + const void* pNext; + VkMacOSSurfaceCreateFlagsMVK flags; + const void* pView; +} VkMacOSSurfaceCreateInfoMVK; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateMacOSSurfaceMVK)(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateMacOSSurfaceMVK( + VkInstance instance, + const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/vulkan/vulkan_mir.h b/include/vulkan/vulkan_mir.h new file mode 100644 index 00000000..7d24ed27 --- /dev/null +++ b/include/vulkan/vulkan_mir.h @@ -0,0 +1,65 @@ +#ifndef VULKAN_MIR_H_ +#define VULKAN_MIR_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_KHR_mir_surface 1 +#define VK_KHR_MIR_SURFACE_SPEC_VERSION 4 +#define VK_KHR_MIR_SURFACE_EXTENSION_NAME "VK_KHR_mir_surface" + +typedef VkFlags VkMirSurfaceCreateFlagsKHR; + +typedef struct VkMirSurfaceCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkMirSurfaceCreateFlagsKHR flags; + MirConnection* connection; + MirSurface* mirSurface; +} VkMirSurfaceCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateMirSurfaceKHR)(VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); +typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, MirConnection* connection); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateMirSurfaceKHR( + VkInstance instance, + const VkMirSurfaceCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); + +VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceMirPresentationSupportKHR( + VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + MirConnection* connection); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/vulkan/vulkan_vi.h b/include/vulkan/vulkan_vi.h new file mode 100644 index 00000000..015166bf --- /dev/null +++ b/include/vulkan/vulkan_vi.h @@ -0,0 +1,58 @@ +#ifndef VULKAN_VI_H_ +#define VULKAN_VI_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_NN_vi_surface 1 +#define VK_NN_VI_SURFACE_SPEC_VERSION 1 +#define VK_NN_VI_SURFACE_EXTENSION_NAME "VK_NN_vi_surface" + +typedef VkFlags VkViSurfaceCreateFlagsNN; + +typedef struct VkViSurfaceCreateInfoNN { + VkStructureType sType; + const void* pNext; + VkViSurfaceCreateFlagsNN flags; + void* window; +} VkViSurfaceCreateInfoNN; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateViSurfaceNN)(VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateViSurfaceNN( + VkInstance instance, + const VkViSurfaceCreateInfoNN* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/vulkan/vulkan_wayland.h b/include/vulkan/vulkan_wayland.h new file mode 100644 index 00000000..5ba0827a --- /dev/null +++ b/include/vulkan/vulkan_wayland.h @@ -0,0 +1,65 @@ +#ifndef VULKAN_WAYLAND_H_ +#define VULKAN_WAYLAND_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_KHR_wayland_surface 1 +#define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 6 +#define VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME "VK_KHR_wayland_surface" + +typedef VkFlags VkWaylandSurfaceCreateFlagsKHR; + +typedef struct VkWaylandSurfaceCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkWaylandSurfaceCreateFlagsKHR flags; + struct wl_display* display; + struct wl_surface* surface; +} VkWaylandSurfaceCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateWaylandSurfaceKHR)(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); +typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR( + VkInstance instance, + const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); + +VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWaylandPresentationSupportKHR( + VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + struct wl_display* display); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/vulkan/vulkan_xlib.h b/include/vulkan/vulkan_xlib.h new file mode 100644 index 00000000..e1d967e0 --- /dev/null +++ b/include/vulkan/vulkan_xlib.h @@ -0,0 +1,66 @@ +#ifndef VULKAN_XLIB_H_ +#define VULKAN_XLIB_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_KHR_xlib_surface 1 +#define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6 +#define VK_KHR_XLIB_SURFACE_EXTENSION_NAME "VK_KHR_xlib_surface" + +typedef VkFlags VkXlibSurfaceCreateFlagsKHR; + +typedef struct VkXlibSurfaceCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkXlibSurfaceCreateFlagsKHR flags; + Display* dpy; + Window window; +} VkXlibSurfaceCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateXlibSurfaceKHR)(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); +typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR( + VkInstance instance, + const VkXlibSurfaceCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); + +VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXlibPresentationSupportKHR( + VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + Display* dpy, + VisualID visualID); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/vulkan/vulkan_xlib_xrandr.h b/include/vulkan/vulkan_xlib_xrandr.h new file mode 100644 index 00000000..117d0179 --- /dev/null +++ b/include/vulkan/vulkan_xlib_xrandr.h @@ -0,0 +1,54 @@ +#ifndef VULKAN_XLIB_XRANDR_H_ +#define VULKAN_XLIB_XRANDR_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_EXT_acquire_xlib_display 1 +#define VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION 1 +#define VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME "VK_EXT_acquire_xlib_display" + +typedef VkResult (VKAPI_PTR *PFN_vkAcquireXlibDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, VkDisplayKHR display); +typedef VkResult (VKAPI_PTR *PFN_vkGetRandROutputDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkAcquireXlibDisplayEXT( + VkPhysicalDevice physicalDevice, + Display* dpy, + VkDisplayKHR display); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetRandROutputDisplayEXT( + VkPhysicalDevice physicalDevice, + Display* dpy, + RROutput rrOutput, + VkDisplayKHR* pDisplay); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/wrappers/buffer.h b/include/wrappers/buffer.h index f4a897b1..568d2ac3 100644 --- a/include/wrappers/buffer.h +++ b/include/wrappers/buffer.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -77,96 +77,11 @@ namespace Anvil public: /* Public functions */ - /** Initializes a new NON-SPARSE buffer object using user-specified parameters. - * - * Does NOT allocate and bind any memory blocks to the object. It is user's responsibility - * to call Buffer::set_memory() to configure the binding. - * - * @param in_device_ptr Device to use. - * @param in_size Size of the buffer object to be initialized. - * @param in_queue_families Queue families which the buffer object is going to be used with. - * One or more user queue family bits can be enabled. - * @param in_queue_sharing_mode VkSharingMode value, which is going to be passed to the vkCreateBuffer() - * call. - * @param in_usage_flags Usage flags to set in the VkBufferCreateInfo descriptor, passed to - * to the vkCreateBuffer() call. - **/ - static Anvil::BufferUniquePtr create_nonsparse(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - VkSharingMode in_queue_sharing_mode, - VkBufferUsageFlags in_usage_flags, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); - - /** Initializes a new NON-SPARSE buffer object using user-specified parameters. - * - * This version of create() ALLOCATES and BINDS a unique memory block to the object. Do NOT - * call Buffer::set_memory() to configure the binding. - * - * The constructor can optionally upload data to the initialized memory. - * - * @param in_device_ptr Device to use. - * @param in_size Size of the buffer object to be initialized. - * @param in_queue_families Queue families which the buffer object is going to be used with. - * One or more user queue family bits can be enabled. - * @param in_queue_sharing_mode VkSharingMode value, which is going to be passed to the vkCreateBuffer() - * call. - * @param in_usage_flags Usage flags to set in the VkBufferCreateInfo descriptor, passed to - * to the vkCreateBuffer() call. - * @param in_memory_freatures Required memory features. - * @param in_opt_client_data if not nullptr, exactly @param in_size bytes will be copied to the allocated - * buffer memory. - **/ - static Anvil::BufferUniquePtr create_nonsparse(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - VkSharingMode in_queue_sharing_mode, - VkBufferUsageFlags in_usage_flags, - Anvil::MemoryFeatureFlags in_memory_features, - const void* in_opt_client_data, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); - - /** Creates a new Buffer wrapper instance. The new NON-SPARSE buffer will reuse a region of the specified - * buffer's storage, instead of creating one's own. - * - * It is user's responsibility to ensure memory aliasing or synchronization is used, according - * to the spec rules. - * - * @param in_parent_buffer_ptr Specifies the buffer, whose memory block should be used. Must not be - * nullptr. MUST BE NON-SPARSE. - * @param in_start_offset Memory region's start offset. - * @param in_size Size of the memory region to "claim". - **/ - static Anvil::BufferUniquePtr create_nonsparse(Anvil::Buffer* in_parent_nonsparse_buffer_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size); - - /** Initializes a new SPARSE buffer object using user-specified parameters. - * - * Does NOT bind any memory regions to the object. It is user's responsibility to call - * Queue::bind_sparse_memory() afterward to update page configuration. - * - * @param in_device_ptr Device to use. - * @param in_size Size of the buffer object to be initialized. - * @param in_queue_families Queue families which the buffer object is going to be used with. - * One or more user queue family bits can be enabled. - * @param in_queue_sharing_mode VkSharingMode value, which is going to be passed to the vkCreateBuffer() - * call. - * @param in_usage_flags Usage flags to set in the VkBufferCreateInfo descriptor, passed to - * to the vkCreateBuffer() call. - * @param in_residency_scope Scope of residency to support for the buffer. - **/ - static Anvil::BufferUniquePtr create_sparse(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - VkSharingMode in_queue_sharing_mode, - VkBufferUsageFlags in_usage_flags, - Anvil::SparseResidencyScope in_residency_scope, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); - /** Destroys the Vulkan objects and unregister the Buffer instance from Object Tracker. */ virtual ~Buffer(); + static Anvil::BufferUniquePtr create(Anvil::BufferCreateInfoUniquePtr in_create_info_ptr); + /** Returns the lowest-level Buffer instance which stores the data exposed by this Buffer instance. */ const Anvil::Buffer* get_base_buffer(); @@ -186,6 +101,11 @@ namespace Anvil return &m_buffer; } + const Anvil::BufferCreateInfo* get_create_info_ptr() const + { + return m_create_info_ptr.get(); + } + /** Returns a pointer to the underlying memory block wrapper instance. * * For non-sparse buffers, in case no memory block has been assigned to the buffer, @@ -200,87 +120,16 @@ namespace Anvil Anvil::MemoryBlock* get_memory_block(uint32_t in_n_memory_block); /** Returns memory requirements for the buffer */ - VkMemoryRequirements get_memory_requirements() const - { - if (m_parent_buffer_ptr != nullptr) - { - return m_parent_buffer_ptr->get_memory_requirements(); - } - else - { - return m_buffer_memory_reqs; - } - } + VkMemoryRequirements get_memory_requirements() const; /** Returns the number of memory blocks assigned to the buffer. */ - uint32_t get_n_memory_blocks() const - { - if (m_is_sparse) - { - return m_page_tracker_ptr->get_n_memory_blocks(); - } - else - { - return 1; - } - } + uint32_t get_n_memory_blocks() const; const Anvil::PageTracker* get_page_tracker() const { return m_page_tracker_ptr.get(); } - /** Returns a pointer to the parent buffer, if one was specified at creation time */ - Anvil::Buffer* get_parent_buffer_ptr() const - { - return m_parent_buffer_ptr; - } - - /** Returns info about queue families this buffer has been created for */ - QueueFamilyBits get_queue_families() const - { - return m_queue_families; - } - - /** Returns the residency scope. - * - * Triggers an assertion failure if called for non-sparse images - */ - Anvil::SparseResidencyScope get_residency_scope() const - { - anvil_assert(m_is_sparse); - - return m_residency_scope; - } - - /** Returns sharing mode of the buffer */ - VkSharingMode get_sharing_mode() const - { - return m_sharing_mode; - } - - /** Returns size of the encapsulated Vulkan buffer memory region. - * - * @return >= 0 if successful, UINT64_MAX otherwise */ - VkDeviceSize get_size() const; - - /** Returns start offset of the encapsulated Vulkan buffer memory region. - * - * @return >= 0 if successful, UINT64_MAX otherwise */ - VkDeviceSize get_start_offset() const; - - /** Tells whether or not the buffer is sparse */ - bool is_sparse() const - { - return m_is_sparse; - } - - /** Returns usage defined for the buffer */ - VkBufferUsageFlags get_usage() const - { - return m_usage_flags; - } - /** Reads @param in_size bytes, starting from @param in_start_offset, from the wrapped memory object. * * If the buffer object uses mappable storage memory, the affected region will be mapped into process space, @@ -292,8 +141,6 @@ namespace Anvil * executed either on the transfer queue (if available), or on the universal queue. Afterward, the staging buffer * will be released. * - * This function must not be used to read data from buffers, whose memory backing comes from a multi-instance heap. - * * This function blocks until the transfer completes. * * @param in_start_offset As per description. Must be smaller than the underlying memory object's size. @@ -321,6 +168,8 @@ namespace Anvil * * @param in_memory_block_ptr Memory block to attach to the buffer object. Must not be NULL. * @param in_memory_block_owned_by_buffer TODO + * @param in_n_physical_devices Describes the number of physical devices available under @param in_opt_physical_devices_ptr. + * @param in_physical_devices_ptr Physical devices to use to form the device mask. * * @return true if successful, false otherwise. **/ @@ -328,6 +177,14 @@ namespace Anvil bool set_nonsparse_memory(MemoryBlock* in_memory_block_ptr, bool in_memory_block_owned_by_buffer); + bool set_nonsparse_memory(MemoryBlockUniquePtr in_memory_block_ptr, + uint32_t in_n_physical_devices, + const Anvil::PhysicalDevice* in_physical_devices_ptr); + bool set_nonsparse_memory(MemoryBlock* in_memory_block_ptr, + bool in_memory_block_owned_by_buffer, + uint32_t in_n_physical_devices, + const Anvil::PhysicalDevice* in_physical_devices_ptr); + /** Writes @param in_size bytes, starting from @param in_start_offset, into the wrapped memory object. * * If the buffer object uses mappable storage memory, the affected region will be mapped into process space, @@ -339,10 +196,6 @@ namespace Anvil * transfer the new contents to the target buffer. The operation will be submitted via a transfer queue, if one * is available, or a universal queue otherwise. * - * This function must not be used to read data from buffers, whose memory backing comes from a multi-instance heap. - * - * The function prototype without @param in_physical_device_ptr argument should be used for single-GPU devices only. - * * If the buffer instance uses an exclusive sharing mode and supports more than just one queue family type AND memory * backing the buffer is not mappable, you MUST specify a queue instance that should be used to perform a buffer->buffer * copy op. The queue MUST support transfer ops. @@ -368,58 +221,38 @@ namespace Anvil private: /* Private functions */ - explicit Buffer(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - VkSharingMode in_queue_sharing_mode, - VkBufferUsageFlags in_usage_flags, - Anvil::SparseResidencyScope in_residency_scope, - bool in_mt_safe); - explicit Buffer(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - VkSharingMode in_queue_sharing_mode, - VkBufferUsageFlags in_usage_flags, - MemoryFeatureFlags in_memory_features, - bool in_mt_safe); - explicit Buffer(Anvil::Buffer* in_parent_buffer_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size); - - Buffer (const Buffer&); - Buffer& operator=(const Buffer&); - - void create_buffer (Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - VkDeviceSize in_size); - bool set_memory_sparse(MemoryBlock* in_memory_block_ptr, - bool in_memory_block_owned_by_buffer, - VkDeviceSize in_memory_start_offset, - VkDeviceSize in_start_offset, - VkDeviceSize in_size); - - bool set_memory_nonsparse_internal(MemoryBlockUniquePtr in_memory_block_ptr); + + Buffer(Anvil::BufferCreateInfoUniquePtr in_create_info_ptr); + + bool init (); + bool set_memory_sparse(MemoryBlock* in_memory_block_ptr, + bool in_memory_block_owned_by_buffer, + VkDeviceSize in_memory_start_offset, + VkDeviceSize in_start_offset, + VkDeviceSize in_size); + + bool set_memory_nonsparse_internal(MemoryBlockUniquePtr in_memory_block_ptr, + uint32_t in_n_physical_devices, + const Anvil::PhysicalDevice* in_physical_devices_ptr); + + bool do_external_memory_handle_type_sanity_checks() const; /* Private members */ - VkBuffer m_buffer; - VkMemoryRequirements m_buffer_memory_reqs; - VkDeviceSize m_buffer_size; - const Anvil::BaseDevice* m_device_ptr; - bool m_is_sparse; - Anvil::MemoryBlock* m_memory_block_ptr; // only used by non-sparse buffers - std::unique_ptr m_page_tracker_ptr; // only used by sparse buffers - Anvil::Buffer* m_parent_buffer_ptr; - Anvil::QueueFamilyBits m_queue_families; - Anvil::SparseResidencyScope m_residency_scope; - VkSharingMode m_sharing_mode; - VkDeviceSize m_start_offset; + VkBuffer m_buffer; + VkMemoryRequirements m_buffer_memory_reqs; + std::unique_ptr m_create_info_ptr; - std::vector m_owned_memory_blocks; + Anvil::MemoryBlock* m_memory_block_ptr; // only used by non-sparse buffers + std::unique_ptr m_page_tracker_ptr; // only used by sparse buffers VkBufferCreateFlagsVariable(m_create_flags); - VkBufferUsageFlagsVariable (m_usage_flags); + + std::vector m_owned_memory_blocks; friend class Anvil::Queue; /* set_memory_sparse() */ + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(Buffer); + ANVIL_DISABLE_COPY_CONSTRUCTOR(Buffer); }; }; /* namespace Anvil */ diff --git a/include/wrappers/buffer_view.h b/include/wrappers/buffer_view.h index 52b5c4ce..598a30bd 100644 --- a/include/wrappers/buffer_view.h +++ b/include/wrappers/buffer_view.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -44,12 +44,7 @@ namespace Anvil /** Creates a single Vulkan buffer view instance and registers the object in Object Tracker. * For argument documentation, please see Vulkan API specification. */ - static BufferViewUniquePtr create(const Anvil::BaseDevice* in_device_ptr, - Anvil::Buffer* in_buffer_ptr, - VkFormat in_format, - VkDeviceSize in_start_offset, - VkDeviceSize in_size, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static BufferViewUniquePtr create(Anvil::BufferViewCreateInfoUniquePtr in_create_info_ptr); /** Destructor */ virtual ~BufferView(); @@ -66,49 +61,23 @@ namespace Anvil return &m_buffer_view; } - /** Returns format used by the buffer view */ - VkFormat get_format() const + const Anvil::BufferViewCreateInfo* get_create_info_ptr() const { - return m_format; - } - - /** Returns pointer to the parent buffer instance */ - Anvil::Buffer* get_parent_buffer() const - { - return m_buffer_ptr; - } - - /** Returns size of the encapsulated buffer memory region */ - VkDeviceSize get_size() const - { - return m_size; - } - - /** Returns start offset of the encapsulated buffer memory region */ - VkDeviceSize get_start_offset() const - { - return m_start_offset; + return m_create_info_ptr.get(); } private: /* Private functions */ - BufferView(const Anvil::BaseDevice* in_device_ptr, - Anvil::Buffer* in_buffer_ptr, - VkFormat in_format, - VkDeviceSize in_start_offset, - VkDeviceSize in_size, - bool in_mt_safe); + BufferView(Anvil::BufferViewCreateInfoUniquePtr in_create_info_ptr); - BufferView (const BufferView&); - BufferView& operator=(const BufferView&); + bool init(); /* Private variables */ - Anvil::Buffer* m_buffer_ptr; - VkBufferView m_buffer_view; - const Anvil::BaseDevice* m_device_ptr; - VkFormat m_format; - VkDeviceSize m_size; - VkDeviceSize m_start_offset; + VkBufferView m_buffer_view; + Anvil::BufferViewCreateInfoUniquePtr m_create_info_ptr; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(BufferView); + ANVIL_DISABLE_COPY_CONSTRUCTOR(BufferView); }; }; /* namespace Anvil */ diff --git a/include/wrappers/command_buffer.h b/include/wrappers/command_buffer.h index f911b83e..85e0d4a7 100644 --- a/include/wrappers/command_buffer.h +++ b/include/wrappers/command_buffer.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -162,12 +162,11 @@ namespace Anvil */ typedef struct BeginRenderPassCommand : public Command { - std::vector clear_values; - VkSubpassContents contents; - Anvil::Framebuffer* fbo_ptr; - const Anvil::PhysicalDevice* physical_device_ptr; - VkRect2D render_area; - Anvil::RenderPass* render_pass_ptr; + std::vector clear_values; + VkSubpassContents contents; + Anvil::Framebuffer* fbo_ptr; + VkRect2D render_area; + Anvil::RenderPass* render_pass_ptr; /** Constructor. * @@ -175,13 +174,12 @@ namespace Anvil * * Arguments as per Vulkan API. **/ - explicit BeginRenderPassCommand(uint32_t in_n_clear_values, - const VkClearValue* in_clear_value_ptrs, - Anvil::Framebuffer* in_fbo_ptr, - const Anvil::PhysicalDevice* in_physical_device_ptr, - const VkRect2D& in_render_area, - Anvil::RenderPass* in_render_pass_ptr, - VkSubpassContents in_contents); + explicit BeginRenderPassCommand(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + const VkRect2D& in_render_area, + Anvil::RenderPass* in_render_pass_ptr, + VkSubpassContents in_contents); /** Destructor. * @@ -1156,10 +1154,10 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_update_buffer(Anvil::Buffer* in_dst_buffer_ptr, - VkDeviceSize in_dst_offset, - VkDeviceSize in_data_size, - const uint32_t* in_data_ptr); + bool record_update_buffer(Anvil::Buffer* in_dst_buffer_ptr, + VkDeviceSize in_dst_offset, + VkDeviceSize in_data_size, + const void* in_data_ptr); /** Issues a vkCmdWaitEvents() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -1547,7 +1545,6 @@ namespace Anvil ClearDepthStencilImageCommand& operator=(const ClearDepthStencilImageCommand& in); } ClearDepthStencilImageCommand; - /** Holds all arguments passed to a vkCmdCopyBuffer() command. */ typedef struct CopyBufferCommand : public Command { @@ -1759,7 +1756,6 @@ namespace Anvil } } DispatchCommand; - /** Holds all arguments passed to a vkCmdDispatchIndirect() command. */ typedef struct DispatchIndirectCommand : public Command { @@ -2308,17 +2304,17 @@ namespace Anvil /** Holds all arguments passed to a vkCmdUpdateBuffer() command. **/ typedef struct UpdateBufferCommand : public Command { - const uint32_t* data_ptr; + const void* data_ptr; VkDeviceSize data_size; VkBuffer dst_buffer; Anvil::Buffer* dst_buffer_ptr; VkDeviceSize dst_offset; /** Constructor **/ - explicit UpdateBufferCommand(Anvil::Buffer* in_dst_buffer_ptr, - VkDeviceSize in_dst_offset, - VkDeviceSize in_data_size, - const uint32_t* in_data_ptr); + explicit UpdateBufferCommand(Anvil::Buffer* in_dst_buffer_ptr, + VkDeviceSize in_dst_offset, + VkDeviceSize in_data_size, + const void* in_data_ptr); /** Destructor. */ virtual ~UpdateBufferCommand() diff --git a/include/wrappers/command_pool.h b/include/wrappers/command_pool.h index c2566aa1..1fe6375e 100644 --- a/include/wrappers/command_pool.h +++ b/include/wrappers/command_pool.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/wrappers/compute_pipeline_manager.h b/include/wrappers/compute_pipeline_manager.h index fefc6077..272a943e 100644 --- a/include/wrappers/compute_pipeline_manager.h +++ b/include/wrappers/compute_pipeline_manager.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/wrappers/descriptor_pool.h b/include/wrappers/descriptor_pool.h index b6e1cea4..12631e11 100644 --- a/include/wrappers/descriptor_pool.h +++ b/include/wrappers/descriptor_pool.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/wrappers/descriptor_set.h b/include/wrappers/descriptor_set.h index 0e658049..98050792 100644 --- a/include/wrappers/descriptor_set.h +++ b/include/wrappers/descriptor_set.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/wrappers/descriptor_set_group.h b/include/wrappers/descriptor_set_group.h index 73adac78..627d874b 100644 --- a/include/wrappers/descriptor_set_group.h +++ b/include/wrappers/descriptor_set_group.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -51,7 +51,7 @@ #ifndef WRAPPERS_DESCRIPTOR_SET_GROUP_H #define WRAPPERS_DESCRIPTOR_SET_GROUP_H -#include "misc/descriptor_set_info.h" +#include "misc/descriptor_set_create_info.h" #include "misc/mt_safety.h" #include "misc/types.h" #include "wrappers/descriptor_set.h" @@ -97,14 +97,17 @@ namespace Anvil * takes a ptr to DescriptorSetGroup instance, causing objects created in such fashion to treat the * specified DescriptorSetGroup instance as a parent. * - * @param in_device_ptr Device to use. - * @param in_ds_info_ptrs TODO. + * @param in_device_ptr Device to use. + * @param in_ds_create_info_ptrs TODO. + * @param in_opt_pool_extra_flags Flags to include when creating a descriptor pool. Note that DSG may also specify + * other flags not included in this set, too. */ - static Anvil::DescriptorSetGroupUniquePtr create(const Anvil::BaseDevice* in_device_ptr, - std::vector& in_ds_info_ptrs, - bool in_releaseable_sets, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, - const std::vector& in_opt_overhead_allocations = std::vector() ); + static Anvil::DescriptorSetGroupUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + std::vector& in_ds_create_info_ptrs, + bool in_releaseable_sets, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + const std::vector& in_opt_overhead_allocations = std::vector(), + const Anvil::DescriptorPoolFlags& in_opt_pool_extra_flags = 0); /** Creates a new DescriptorSetGroup instance. * @@ -130,8 +133,8 @@ namespace Anvil **/ Anvil::DescriptorSet* get_descriptor_set(uint32_t in_n_set); - const std::vector* get_descriptor_set_info() const; - const Anvil::DescriptorSetInfo* get_descriptor_set_info(uint32_t in_n_set) const; + const std::vector* get_descriptor_set_create_info() const; + const Anvil::DescriptorSetCreateInfo* get_descriptor_set_create_info(uint32_t in_n_set) const; /** Retrieves a Vulkan instace of the descriptor set layout, as configured for the DSG instance's * set at index @param in_n_set. @@ -151,7 +154,7 @@ namespace Anvil **/ uint32_t get_n_descriptor_sets() const { - return static_cast(m_ds_info_ptrs.size() ); + return static_cast(m_ds_create_info_ptrs.size() ); } /** This function should be set to assign physical Vulkan objects to a descriptor binding @@ -269,11 +272,12 @@ namespace Anvil /* Private functions */ /** Please see create() documentation for more details. */ - DescriptorSetGroup(const Anvil::BaseDevice* in_device_ptr, - std::vector in_ds_info_ptrs, - bool in_releaseable_sets, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, - const std::vector& in_opt_overhead_allocations = std::vector() ); + DescriptorSetGroup(const Anvil::BaseDevice* in_device_ptr, + std::vector in_ds_create_info_ptrs, + bool in_releaseable_sets, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + const std::vector& in_opt_overhead_allocations = std::vector(), + const Anvil::DescriptorPoolFlags& in_opt_pool_extra_flags = 0 ); /** Please see create() documentation for more details. */ DescriptorSetGroup(const DescriptorSetGroup* in_parent_dsg_ptr, @@ -286,13 +290,14 @@ namespace Anvil mutable DescriptorPoolUniquePtr m_descriptor_pool_ptr; mutable std::map > m_descriptor_sets; const Anvil::BaseDevice* m_device_ptr; - std::vector m_ds_info_ptrs; + std::vector m_ds_create_info_ptrs; uint32_t m_overhead_allocations [VK_DESCRIPTOR_TYPE_RANGE_SIZE]; uint32_t m_pool_size_per_descriptor_type[VK_DESCRIPTOR_TYPE_RANGE_SIZE]; uint32_t m_n_unique_dses; const Anvil::DescriptorSetGroup* m_parent_dsg_ptr; bool m_releaseable_sets; + const Anvil::DescriptorPoolFlags m_user_specified_pool_flags; ANVIL_DISABLE_ASSIGNMENT_OPERATOR(DescriptorSetGroup); ANVIL_DISABLE_COPY_CONSTRUCTOR(DescriptorSetGroup); diff --git a/include/wrappers/descriptor_set_layout.h b/include/wrappers/descriptor_set_layout.h index d676ff76..dca94d63 100644 --- a/include/wrappers/descriptor_set_layout.h +++ b/include/wrappers/descriptor_set_layout.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -61,13 +61,13 @@ namespace Anvil * @param in_device_ptr Device the layout will be created for. * **/ - static DescriptorSetLayoutUniquePtr create(DescriptorSetInfoUniquePtr in_ds_info_ptr, - const Anvil::BaseDevice* in_device_ptr, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static DescriptorSetLayoutUniquePtr create(DescriptorSetCreateInfoUniquePtr in_ds_create_info_ptr, + const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); - const Anvil::DescriptorSetInfo* get_info() const + const Anvil::DescriptorSetCreateInfo* get_create_info() const { - return m_info_ptr.get(); + return m_create_info_ptr.get(); } /** Bakes a Vulkan object, if one is needed, and returns Vulkan DS layout handle. @@ -84,6 +84,16 @@ namespace Anvil return m_layout; } + /* Returns the maximum number of variable descriptor count binding size supported for the specified descriptor set layout. + * + * Requires VK_KHR_maintenance3 and VK_KHR_descriptor_indexing. + * + * @param in_ds_create_info_ptr Instance obtained by calling DescriptorSetInfo::create_descriptor_set_layout_create_info(). + * Must not be null. + */ + static uint32_t get_maximum_variable_descriptor_count(const DescriptorSetLayoutCreateInfoContainer* in_ds_create_info_ptr, + const Anvil::BaseDevice* in_device_ptr); + /* Checks if the specified descriptor set layout create info structure can be used to create a descriptor set layout instance. * * The app should call this function if the DS create info structure defines a number of descriptors that exceeds the @@ -110,17 +120,17 @@ namespace Anvil bool init(); /* Please see create() documentation for more details */ - DescriptorSetLayout(DescriptorSetInfoUniquePtr in_ds_info_ptr, - const Anvil::BaseDevice* in_device_ptr, - bool in_mt_safe); + DescriptorSetLayout(DescriptorSetCreateInfoUniquePtr in_ds_create_info_ptr, + const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe); DescriptorSetLayout (const DescriptorSetLayout&); DescriptorSetLayout& operator=(const DescriptorSetLayout&); /* Private variables */ - const Anvil::BaseDevice* m_device_ptr; - DescriptorSetInfoUniquePtr m_info_ptr; - VkDescriptorSetLayout m_layout; + DescriptorSetCreateInfoUniquePtr m_create_info_ptr; + const Anvil::BaseDevice* m_device_ptr; + VkDescriptorSetLayout m_layout; }; }; /* namespace Anvil */ diff --git a/include/wrappers/descriptor_set_layout_manager.h b/include/wrappers/descriptor_set_layout_manager.h index 711594f3..18f61383 100644 --- a/include/wrappers/descriptor_set_layout_manager.h +++ b/include/wrappers/descriptor_set_layout_manager.h @@ -36,7 +36,7 @@ namespace Anvil /** Destructor */ ~DescriptorSetLayoutManager(); - bool get_layout(const DescriptorSetInfo* in_ds_info_ptr, + bool get_layout(const DescriptorSetCreateInfo* in_ds_create_info_ptr, Anvil::DescriptorSetLayoutUniquePtr* out_ds_layout_ptr_ptr); protected: diff --git a/include/wrappers/descriptor_update_template.h b/include/wrappers/descriptor_update_template.h index 6b9ec2a4..d50b1ca6 100644 --- a/include/wrappers/descriptor_update_template.h +++ b/include/wrappers/descriptor_update_template.h @@ -88,9 +88,9 @@ namespace Anvil ANVIL_DISABLE_COPY_CONSTRUCTOR (DescriptorUpdateTemplate); /* Private variables */ - const Anvil::BaseDevice* m_device_ptr; - Anvil::DescriptorSetInfoUniquePtr m_ds_info_ptr; - VkDescriptorUpdateTemplateKHR m_vk_object; + const Anvil::BaseDevice* m_device_ptr; + Anvil::DescriptorSetCreateInfoUniquePtr m_ds_create_info_ptr; + VkDescriptorUpdateTemplateKHR m_vk_object; }; }; /* namespace Anvil */ diff --git a/include/wrappers/device.h b/include/wrappers/device.h index 210a2ebd..dc497b19 100644 --- a/include/wrappers/device.h +++ b/include/wrappers/device.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -32,6 +32,7 @@ #define WRAPPERS_DEVICE_H #include "misc/debug.h" +#include "misc/extensions.h" #include "misc/mt_safety.h" #include "misc/struct_chainer.h" #include "misc/types.h" @@ -121,7 +122,7 @@ namespace Anvil **/ const ExtensionAMDDrawIndirectCountEntrypoints& get_extension_amd_draw_indirect_count_entrypoints() const { - anvil_assert(m_amd_draw_indirect_count_enabled); + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->amd_draw_indirect_count() ); return m_amd_draw_indirect_count_extension_entrypoints; } @@ -132,7 +133,7 @@ namespace Anvil **/ const ExtensionAMDShaderInfoEntrypoints& get_extension_amd_shader_info_entrypoints() const { - anvil_assert(m_amd_shader_info_enabled); + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->amd_shader_info() ); return m_amd_shader_info_extension_entrypoints; } @@ -143,7 +144,7 @@ namespace Anvil **/ const ExtensionEXTDebugMarkerEntrypoints& get_extension_ext_debug_marker_entrypoints() const { - anvil_assert(m_ext_debug_marker_enabled); + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->ext_debug_marker() ); return m_ext_debug_marker_extension_entrypoints; } @@ -151,7 +152,7 @@ namespace Anvil /** Returns a container with entry-points to functions introduced by VK_KHR_bind_memory2 extension. **/ const ExtensionKHRBindMemory2Entrypoints& get_extension_khr_bind_memory2_entrypoints() const { - anvil_assert(m_khr_bind_memory2_enabled); + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_bind_memory2() ); return m_khr_bind_memory2_extension_entrypoints; } @@ -159,7 +160,7 @@ namespace Anvil /** Returns a container with entry-points to functions introduced by VK_KHR_descriptor_update_template extension. **/ const ExtensionKHRDescriptorUpdateTemplateEntrypoints& get_extension_khr_descriptor_update_template_entrypoints() const { - anvil_assert(m_khr_descriptor_update_template_enabled); + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_descriptor_update_template() ); return m_khr_descriptor_update_template_extension_entrypoints; } @@ -167,7 +168,7 @@ namespace Anvil /** Returns a container with entry-points to functions introduced by VK_KHR_maintenance1 extension. **/ const ExtensionKHRMaintenance1Entrypoints& get_extension_khr_maintenance1_entrypoints() const { - anvil_assert(m_khr_maintenance1_enabled); + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_maintenance1() ); return m_khr_maintenance1_extension_entrypoints; } @@ -175,7 +176,7 @@ namespace Anvil /** Returns a container with entry-points to functions introduced by VK_KHR_maintenance3 extension. **/ const ExtensionKHRMaintenance3Entrypoints& get_extension_khr_maintenance3_entrypoints() const { - anvil_assert(m_khr_maintenance3_enabled); + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_maintenance3() ); return m_khr_maintenance3_extension_entrypoints; } @@ -186,7 +187,7 @@ namespace Anvil **/ const ExtensionKHRSwapchainEntrypoints& get_extension_khr_swapchain_entrypoints() const { - anvil_assert(m_khr_swapchain_enabled); + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_swapchain() ); return m_khr_swapchain_extension_entrypoints; } @@ -224,9 +225,9 @@ namespace Anvil switch (in_family_type) { - case Anvil::QueueFamilyType::COMPUTE: result = static_cast(m_compute_queues.size() ); break; - case Anvil::QueueFamilyType::TRANSFER: result = static_cast(m_transfer_queues.size() ); break; - case Anvil::QueueFamilyType::UNIVERSAL: result = static_cast(m_universal_queues.size() ); break; + case Anvil::QueueFamilyType::COMPUTE: result = static_cast(m_compute_queues.size() ); break; + case Anvil::QueueFamilyType::TRANSFER: result = static_cast(m_transfer_queues.size() ); break; + case Anvil::QueueFamilyType::UNIVERSAL: result = static_cast(m_universal_queues.size() ); break; default: { @@ -483,76 +484,11 @@ namespace Anvil /* Tells what type this device instance is */ virtual DeviceType get_type() const = 0; - bool is_amd_draw_indirect_count_extension_enabled() const - { - return m_amd_draw_indirect_count_enabled; - } - - bool is_amd_gcn_shader_extension_enabled() const - { - return m_amd_gcn_shader_enabled; - } - - bool is_amd_gpu_shader_half_float_extension_enabled() const - { - return m_amd_gpu_shader_half_float_enabled; - } - - bool is_amd_gpu_shader_int16_extension_enabled() const - { - return m_amd_gpu_shader_int16_enabled; - } - - bool is_amd_negative_viewport_height_extension_enabled() const - { - return m_amd_negative_viewport_height_enabled; - } - - bool is_amd_rasterization_order_extension_enabled() const - { - return m_amd_rasterization_order_enabled; - } - - bool is_amd_shader_ballot_extension_enabled() const - { - return m_amd_shader_ballot_enabled; - } - - bool is_amd_shader_explicit_vertex_parameter_extension_enabled() const - { - return m_amd_shader_explicit_vertex_parameter_enabled; - } - - bool is_amd_shader_fragment_mask_extension_enabled() const - { - return m_amd_shader_fragment_mask_enabled; - } - - bool is_amd_shader_image_load_store_lod_enabled() const - { - return m_amd_shader_image_load_store_lod_enabled; - } - - bool is_amd_shader_info_extension_enabled() const - { - return m_amd_shader_info_enabled; - } - - bool is_amd_shader_trinary_minmax_extension_enabled() const - { - return m_amd_shader_trinary_minmax_enabled; - } - - bool is_amd_texture_gather_bias_lod_extension_enabled() const - { - return m_amd_texture_gather_bias_lod_enabled; - } - bool is_compute_queue_family_index(const uint32_t& in_queue_family_index) const; - bool is_ext_shader_stencil_export_extension_enabled() const + const Anvil::IExtensionInfoDevice* get_extension_info() const { - return m_ext_shader_stencil_export_enabled; + return m_extension_enabled_info_ptr->get_device_extension_info(); } /* Tells whether the device has been created with the specified extension enabled. @@ -563,70 +499,17 @@ namespace Anvil **/ bool is_extension_enabled(const std::string& in_extension_name) const { - return std::find(m_enabled_extensions.begin(), - m_enabled_extensions.end(), - in_extension_name) != m_enabled_extensions.end(); - } - - bool is_ext_debug_marker_extension_enabled() const - { - return m_ext_debug_marker_enabled; - } - - bool is_ext_shader_subgroup_ballot_extension_enabled() const - { - return m_ext_shader_subgroup_ballot_enabled; - } - - bool is_ext_shader_subgroup_vote_extension_enabled() const - { - return m_ext_shader_subgroup_vote_enabled; - } - - bool is_khr_16bit_storage_extension_enabled() const - { - return m_khr_16bit_storage_enabled; - } - - bool is_khr_descriptor_update_template_extension_enabled() const - { - return m_khr_descriptor_update_template_enabled; - } - - bool is_khr_bind_memory2_extension_enabled() const - { - return m_khr_bind_memory2_enabled; - } - - bool is_khr_maintenance1_extension_enabled() const - { - return m_khr_maintenance1_enabled; - } - - bool is_khr_maintenance3_extension_enabled() const - { - return m_khr_maintenance3_enabled; - } + anvil_assert(m_extension_enabled_info_ptr != nullptr); - bool is_khr_storage_buffer_storage_class_enabled() const - { - return m_khr_storage_buffer_storage_class_enabled; - } - - bool is_khr_surface_extension_enabled() const - { - return m_khr_surface_enabled; - } - - bool is_khr_swapchain_extension_enabled() const - { - return m_khr_swapchain_enabled; + return m_extension_enabled_info_ptr->get_device_extension_info()->by_name(in_extension_name); } bool is_transfer_queue_family_index(const uint32_t& in_queue_family_index) const; bool is_universal_queue_family_index(const uint32_t& in_queue_family_index) const; + bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags& in_types) const; + bool wait_idle() const; protected: @@ -666,7 +549,7 @@ namespace Anvil /* Protected functions */ - std::unique_ptr > get_physical_device_features_chain() const; + std::unique_ptr > get_physical_device_features_chain(const VkPhysicalDeviceFeatures* in_opt_features_ptr) const; std::vector get_queue_priorities(const QueueFamilyInfo* in_queue_family_info_ptr) const; void init (const DeviceExtensionConfiguration& in_extensions, @@ -678,7 +561,7 @@ namespace Anvil BaseDevice& operator=(const BaseDevice&); BaseDevice (const BaseDevice&); - /** Retrieves family indices of compute, DMA, graphics, transfer queue families for the specified physical device. + /** Retrieves family indices of compute, DMA, graphics, and transfer queue families for the specified physical device. * * @param in_physical_device_ptr Physical device to use for the query. * @param out_device_queue_family_info_ptr Deref will be used to store the result info. Must not be null. @@ -723,37 +606,12 @@ namespace Anvil private: /* Private variables */ - bool m_amd_draw_indirect_count_enabled; - bool m_amd_gcn_shader_enabled; - bool m_amd_gpu_shader_half_float_enabled; - bool m_amd_gpu_shader_int16_enabled; - bool m_amd_negative_viewport_height_enabled; - bool m_amd_rasterization_order_enabled; - bool m_amd_shader_ballot_enabled; - bool m_amd_shader_explicit_vertex_parameter_enabled; - bool m_amd_shader_fragment_mask_enabled; - bool m_amd_shader_image_load_store_lod_enabled; - bool m_amd_shader_info_enabled; - bool m_amd_shader_trinary_minmax_enabled; - bool m_amd_texture_gather_bias_lod_enabled; - bool m_ext_debug_marker_enabled; - bool m_ext_shader_stencil_export_enabled; - bool m_ext_shader_subgroup_ballot_enabled; - bool m_ext_shader_subgroup_vote_enabled; - bool m_khr_16bit_storage_enabled; - bool m_khr_bind_memory2_enabled; - bool m_khr_descriptor_update_template_enabled; - bool m_khr_maintenance1_enabled; - bool m_khr_maintenance3_enabled; - bool m_khr_storage_buffer_storage_class_enabled; - bool m_khr_surface_enabled; - bool m_khr_swapchain_enabled; std::unique_ptr m_compute_pipeline_manager_ptr; DescriptorSetLayoutManagerUniquePtr m_descriptor_set_layout_manager_ptr; Anvil::DescriptorSetGroupUniquePtr m_dummy_dsg_ptr; - std::vector m_enabled_extensions; + std::unique_ptr > m_extension_enabled_info_ptr; GraphicsPipelineManagerUniquePtr m_graphics_pipeline_manager_ptr; const Anvil::Instance* m_parent_instance_ptr; PipelineCacheUniquePtr m_pipeline_cache_ptr; diff --git a/include/wrappers/event.h b/include/wrappers/event.h index 3a1c47fc..9216accd 100644 --- a/include/wrappers/event.h +++ b/include/wrappers/event.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -47,11 +47,8 @@ namespace Anvil /** Creates a new Event instance. * * Creates a single Vulkan event instance and registers the object in Object Tracker. - * - * @param in_device_ptr Device to use. */ - static Anvil::EventUniquePtr create(const Anvil::BaseDevice* in_device_ptr, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::EventUniquePtr create(Anvil::EventCreateInfoUniquePtr in_create_info_ptr); /** Destructor. * @@ -59,6 +56,11 @@ namespace Anvil **/ virtual ~Event(); + const Anvil::EventCreateInfo* get_create_info_ptr() const + { + return m_create_info_ptr.get(); + } + /** Retrieves a raw Vulkan handle for the underlying VkEvent instance. */ VkEvent get_event() const { @@ -92,17 +94,17 @@ namespace Anvil /* Private functions */ /* Constructor. */ - Event(const Anvil::BaseDevice* in_device_ptr, - bool in_mt_safe); + Event(Anvil::EventCreateInfoUniquePtr in_create_info_ptr); Event (const Event&); Event& operator=(const Event&); + bool init (); void release_event(); /* Private variables */ - const Anvil::BaseDevice* m_device_ptr; - VkEvent m_event; + Anvil::EventCreateInfoUniquePtr m_create_info_ptr; + VkEvent m_event; }; }; /* namespace Anvil */ diff --git a/include/wrappers/fence.h b/include/wrappers/fence.h index 064818ce..e95024fe 100644 --- a/include/wrappers/fence.h +++ b/include/wrappers/fence.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -53,14 +53,13 @@ namespace Anvil /** Creates a new Fence instance. * * Creates a single Vulkan fence instance and registers the object in Object Tracker. - * - * @param in_device_ptr Device to use. - * @param in_create_signalled true if the fence should be created as a signalled entity. - * False to make it unsignalled at creation time. */ - static Anvil::FenceUniquePtr create(const Anvil::BaseDevice* in_device_ptr, - bool in_create_signalled, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::FenceUniquePtr create(Anvil::FenceCreateInfoUniquePtr in_create_info_ptr); + + const Anvil::FenceCreateInfo* get_create_info_ptr() const + { + return m_create_info_ptr.get(); + } /** Retrieves a raw handle to the underlying Vulkan fence instance */ VkFence get_fence() const @@ -109,19 +108,18 @@ namespace Anvil * * Please see documentation of create() for specification */ - Fence(const Anvil::BaseDevice* in_device_ptr, - bool in_create_signalled, - bool in_mt_safe); + Fence(Anvil::FenceCreateInfoUniquePtr in_create_info_ptr); Fence (const Fence&); Fence& operator=(const Fence&); + bool init (); void release_fence(); /* Private variables */ - const Anvil::BaseDevice* m_device_ptr; - VkFence m_fence; - mutable bool m_possibly_set; + Anvil::FenceCreateInfoUniquePtr m_create_info_ptr; + VkFence m_fence; + mutable bool m_possibly_set; }; }; /* namespace Anvil */ diff --git a/include/wrappers/framebuffer.h b/include/wrappers/framebuffer.h index 2d8e317f..62ee8715 100644 --- a/include/wrappers/framebuffer.h +++ b/include/wrappers/framebuffer.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -41,84 +41,20 @@ namespace Anvil public: /* Public functions */ - /** Constructor. - * - * Verifies input arguments and initializes the internal ref counter to 1. - * - * @param in_device_ptr Device to use. - * @param in_width Framebuffer width. Must be at least 1. - * @param in_height Framebuffer height. Must be at least 1. - * @param in_n_layers Number of layers the framebuffer should use. Must be at least 1. - **/ - static Anvil::FramebufferUniquePtr create(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_width, - uint32_t in_height, - uint32_t in_n_layers, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::FramebufferUniquePtr create(Anvil::FramebufferCreateInfoUniquePtr in_create_info_ptr); /** Destructor. * * Destroys baked Vulkan counterparts and unregisters the wrapper instance from the object tracker. **/ - virtual ~Framebuffer(); - - /** Adds a new attachment to the framebuffer. - * - * If this function succeeds, the maintained framebuffer objects will NOT be automatically - * re-created. Instead, the user should either call bake() at a suitable moment, or expect - * it to be called at the next get_framebuffer() call. - * - * @param in_image_view_ptr Image view instance to use as a framebuffer attachment. - * Must not be nullptr. This object will be retained. - * @param out_opt_attachment_id_ptr If not nullptr, deref will be set to a unique ID, under which - * the attachment can be accessed. - * - * @return true if the function was successful, false otherwise. - **/ - bool add_attachment(ImageView* in_image_view_ptr, - FramebufferAttachmentID* out_opt_attachment_id_ptr); - - /** Re-creates a Vulkan framebuffer object for the specified render pass instance. If a FB - * has already been created in the past, the instance will be released. - * - * At least one attachment must be defined for this function to succeed. - * - * @param in_render_pass_ptr Render pass instance to create the new Vulkan framebuffer object - * for. Must not be nullptr. - * - * @return true if the function was successful, false otherwise. - * */ - bool bake(Anvil::RenderPass* in_render_pass_ptr); + ~Framebuffer(); - /* Returns an attachment at user-specified index */ - bool get_attachment_at_index(uint32_t in_attachment_index, - ImageView** out_image_view_ptr_ptr) const; - - /** Checks if an attachment has already been created for the specified image view and, if so, - * returns the attachment's ID. - * - * @param in_image_view_ptr Image view to use for the query. Must not be nullptr. - * @param out_attachment_id_ptr If the function executes successfully, deref will be set to - * the found attachment's ID, in which case the pointer must not - * be nullptr. Otherwise, ignored. - * - * @return true if successful (eg. the attachment corresponding to the specified image view was - * found), false otherwise. - **/ - bool get_attachment_id_for_image_view(ImageView* in_image_view_ptr, - FramebufferAttachmentID* out_attachment_id_ptr); - - /** Returns the number of attachments defined for the framebuffer. */ - uint32_t get_n_attachments() const + const Anvil::FramebufferCreateInfo* get_create_info_ptr() const { - return static_cast(m_attachments.size() ); + return m_create_info_ptr.get(); } /** Returns a Vulkan framebuffer object instance for the specified render pass instance. - * - * If the object needs to be baked (because an attachment has been added since the last - * baking time, or if the object is being requested for the first time), a bake() call - * will be made automatically. * * @param in_render_pass_ptr Render pass to return the framebuffer for. * @@ -126,11 +62,6 @@ namespace Anvil **/ const VkFramebuffer get_framebuffer(Anvil::RenderPass* in_render_pass_ptr); - /** Returns framebuffer size, specified at creation time */ - void get_size(uint32_t* out_framebuffer_width_ptr, - uint32_t* out_framebuffer_height_ptr, - uint32_t* out_framebuffer_depth_ptr) const; - private: /* Private type declarations */ typedef struct BakedFramebufferData @@ -145,35 +76,6 @@ namespace Anvil } } BakedFramebufferData; - typedef struct FramebufferAttachment - { - ImageView* image_view_ptr; - - /** Constructor. Retains the input image view instance. - * - * @param in_image_view_ptr Image view instance to use for the FB attachment. Must not - * be nullptr. - **/ - FramebufferAttachment(ImageView* in_image_view_ptr); - - /** Destructor. Releases the encapsulated image view instance. */ - ~FramebufferAttachment(); - - /** Copy constructor */ - FramebufferAttachment(const FramebufferAttachment& in); - - /** Assignment operator */ - FramebufferAttachment& operator=(const FramebufferAttachment& in); - - /** Returns true if the encapsulated image view instance is the same as the one - * specified uner @param in_image_view_ptr argument. - **/ - bool operator==(const ImageView* in_image_view_ptr) const - { - return (image_view_ptr == in_image_view_ptr); - } - } FramebufferAttachment; - struct RenderPassComparator { bool operator()(Anvil::RenderPass* in_a_ptr, @@ -181,25 +83,31 @@ namespace Anvil }; typedef std::map BakedFramebufferMap; - typedef std::vector FramebufferAttachments; /* Private functions */ /* Constructor. Please see specification of create() for more details */ - Framebuffer(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_width, - uint32_t in_height, - uint32_t in_n_layers, - bool in_mt_safe); + Framebuffer(Anvil::FramebufferCreateInfoUniquePtr in_create_info_ptr); Framebuffer& operator=(const Framebuffer&); Framebuffer (const Framebuffer&); + /** Re-creates a Vulkan framebuffer object for the specified render pass instance. If a FB + * has already been created in the past, the instance will be released. + * + * At least one attachment must be defined for this function to succeed. + * + * @param in_render_pass_ptr Render pass instance to create the new Vulkan framebuffer object + * for. Must not be nullptr. + * + * @return true if the function was successful, false otherwise. + * */ + bool bake(Anvil::RenderPass* in_render_pass_ptr); + /* Private members */ - FramebufferAttachments m_attachments; - BakedFramebufferMap m_baked_framebuffers; - const Anvil::BaseDevice* m_device_ptr; - uint32_t m_framebuffer_size[3]; + BakedFramebufferMap m_baked_framebuffers; + Anvil::FramebufferCreateInfoUniquePtr m_create_info_ptr; + const Anvil::BaseDevice* m_device_ptr; }; }; diff --git a/include/wrappers/graphics_pipeline_manager.h b/include/wrappers/graphics_pipeline_manager.h index 2250a508..0235ba50 100644 --- a/include/wrappers/graphics_pipeline_manager.h +++ b/include/wrappers/graphics_pipeline_manager.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -119,13 +119,13 @@ namespace Anvil typedef struct GraphicsPipelineData { AttributeLocationToBindingIndexMap attribute_location_to_binding_index_map; - const Anvil::GraphicsPipelineInfo* pipeline_info_ptr; + const Anvil::GraphicsPipelineCreateInfo* pipeline_create_info_ptr; std::vector vk_input_attributes; std::vector vk_input_bindings; - explicit GraphicsPipelineData(const Anvil::GraphicsPipelineInfo* in_pipeline_info_ptr) + explicit GraphicsPipelineData(const Anvil::GraphicsPipelineCreateInfo* in_pipeline_create_info_ptr) { - pipeline_info_ptr = in_pipeline_info_ptr; + pipeline_create_info_ptr = in_pipeline_create_info_ptr; bake_vk_attributes_and_bindings(); } diff --git a/include/wrappers/image.h b/include/wrappers/image.h index d080c96c..ca6419cd 100644 --- a/include/wrappers/image.h +++ b/include/wrappers/image.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -74,6 +74,8 @@ namespace Anvil public: /* Public functions */ + static Anvil::ImageUniquePtr create(Anvil::ImageCreateInfoUniquePtr in_create_info_ptr); + /* Transitions the image from one layout to another. * * This is a blocking call. @@ -107,179 +109,6 @@ namespace Anvil const uint32_t in_opt_n_set_semaphores = 0, Anvil::Semaphore* const* in_opt_set_semaphore_ptrs = nullptr); - /** Initializes a new non-sparse Image instance *without* a memory backing. A memory region should be bound - * to the object by calling Image::set_memory() before using the object for any operations. - * - * The function can also optionally fill the image with data, as soon as memory backing is - * attached. To make it do so, pass a non-null ptr to a MipmapRawData vector via the @param - * mipmaps_ptr argument. - * - * If this constructor is used, the image can be transformed automatically to the right layout - * at set_memory() call time by setting @param in_final_image_layout argument to a value other - * than VK_IMAGE_LAYOUT_UNDEFINED and VK_IMAGE_LAYOUT_PREINITIALIZED. - * - * @param in_device_ptr Device to use. - * @param in_type Vulkan image type to use. - * @param in_format Vulkan format to use. - * @param in_tiling Vulkan image tiling to use. - * @param in_usage Vulkan image usage pattern to use. - * @param in_base_mipmap_width Width of the base mip-map. - * @param in_base_mipmap_height Height of the base mip-map. Must be at least 1 for all image types. - * @param in_base_mipmap_depth Depth of the base mip-map. Must be at least 1 for all image types. - * @param in_n_layers Number of layers to use. Must be at least 1 for all image types. - * @param in_sample_count Sample count to use. - * @param in_queue_families A combination of Anvil::QUEUE_FAMILY_* bits, indicating which device queues - * the image is going to be accessed by. - * @param in_sharing_mode Vulkan sharing mode to use. - * @param in_use_full_mipmap_chain true, if all mipmaps should be created for the image. False to only allocate - * storage for the base mip-map. - * @param in_create_flags Optional image features that the created image should support. - * @param in_post_create_image_layout Image layout to transfer the image to after it is created AND assigned memory - * backing. In order to leave the image intact, set this argument to - * VK_IMAGE_LAYOUT_UNDEFINED if @param in_opt_mipmaps_ptr is NULL, or to - * VK_IMAGE_LAYOUT_PREINITIALIZED if @param in_opt_mipmaps_ptr is not NULL. - * (which depends on what value is passed to @param in_opt_mipmaps_ptr), - * @param in_opt_mipmaps_ptr If not NULL, specified data will be used to initialize created image's mipmaps - * with content, as soon as the image is assigned a memory backing. - * Specifying a non-NULL @param in_opt_mipmaps_ptr argument will make the function OR - * @param in_usage with VK_IMAGE_USAGE_TRANSFER_DST_BIT. - * - * @return New image instance, if successful, or nullptr otherwise. - **/ - static ImageUniquePtr create_nonsparse(const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - ImageCreateFlags in_flags, - VkImageLayout in_post_create_image_layout, - const std::vector* in_opt_mipmaps_ptr, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); - - /** Initializes a new non-sparse Image instance, along with a memory backing. - * - * This constructor assumes the image should be initialized in UNDEFINED layout, if no mipmap data - * is specified, or PREINITIALIZED otherwise. In the latter case, it will then proceed with filling - * the storage with mipmap data (if @param in_mipmaps_ptr is not nullptr), and finally transition - * the image to the @param in_post_create_image_layout layout. - * - * @param in_device_ptr Device to use. - * @param in_type Vulkan image type to use. - * @param in_format Vulkan format to use. - * @param in_tiling Vulkan image tiling to use. - * @param in_usage Vulkan image usage pattern to use. - * @param in_base_mipmap_width Width of the base mip-map. - * @param in_base_mipmap_height Height of the base mip-map. Must be at least 1 for all image types. - * @param in_base_mipmap_depth Depth of the base mip-map. Must be at least 1 for all image types. - * @param in_n_layers Number of layers to use. Must be at least 1 for all image types. - * @param in_sample_count Sample count to use. - * @param in_queue_families A combination of Anvil::QUEUE_FAMILY_* bits, indicating which device queues - * the image is going to be accessed by. - * @param in_sharing_mode Vulkan sharing mode to use. - * @param in_use_full_mipmap_chain true if all mipmaps should be created for the image. False to only allocate - * storage for the base mip-map. - * @param in_memory_features Memory features for the memory backing. - * @param in_create_flags Optional image features that the created image should support. - * @param in_post_create_image_layout Layout to transition the new image to. Must not be VK_IMAGE_LAYOUT_UNDEFINED or - * VK_IMAGE_LAYOUT_PREINITIALIZED. - * @param in_opt_mipmaps_ptr If not nullptr, specified MipmapRawData items will be used to drive the mipmap contents - * initialization process. Ignored if nullptr. - * Specifying a non-NULL in_opt_mipmaps_ptr argument will make the function OR - * @param in_usage with VK_IMAGE_USAGE_TRANSFER_DST_BIT. - * - * @return New image instance, if successful, or nullptr otherwise. - **/ - static ImageUniquePtr create_nonsparse(const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - MemoryFeatureFlags in_memory_features, - ImageCreateFlags in_create_flags, - VkImageLayout in_post_create_image_layout, - const std::vector* in_opt_mipmaps_ptr, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); - - /** Wrapper constructor for existing VkImage instances, as reported for - * swapchain images. Object instantiated with this constructor will NOT - * release the specified VkImage instance. - * - * The image will NOT be transitioned to any specific image layout. - * - * For argument discussion, see specification of the other create() functions. - **/ - static ImageUniquePtr create_nonsparse(const Anvil::BaseDevice* in_device_ptr, - const VkSwapchainCreateInfoKHR& in_swapchain_create_info, - VkImage in_image, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); - - /** Initializes a new sparse Image instance *without* physical memory backing. Memory region(s) - * should be bound to the object by calling Image::set_memory_block() before using the object - * for any operations. Whether or not all tiles need to be assigned memory blocks prior to accessing - * image contents depends on whether sparse binding or sparse residency has been requested at - * creation time. - * - * If NONALIASED or ALIASED residency is requested and the device does not support requested image - * configuration, a NULL image will be returned. - * - * User must manually configure sparse bindings for the image by using Queue::bind_sparse_memory(), - * before uploading any mip data. The mips can be uploaded using upload_mipmaps(). - * - * @param in_device_ptr Device to use. - * @param in_type Vulkan image type to use. - * @param in_format Vulkan format to use. - * @param in_tiling Vulkan image tiling to use. - * @param in_usage Vulkan image usage pattern to use. - * @param in_base_mipmap_width Width of the base mip-map. Must be at least 1 for all image types. - * @param in_base_mipmap_height Height of the base mip-map. Must be at least 1 for all image types. - * @param in_base_mipmap_depth Depth of the base mip-map. Must be at least 1 for all image types. - * @param in_n_layers Number of layers to use. Must be at least 1 for all image types. - * @param in_sample_count Sample count to use. - * @param in_queue_families A combination of Anvil::QUEUE_FAMILY_* bits, indicating which device queues - * the image is going to be accessed by. - * @param in_sharing_mode Vulkan sharing mode to use. - * @param in_use_full_mipmap_chain true, if all mipmaps should be created for the image. False to make the image - * only use one mip. - * @param in_create_flags Optional image features that the created image should support. - * @param in_sparse_residency_scope Scope of sparse residency to request for the image. - * @param in_initial_layout Initial layout to use for the image. Must either be VK_IMAGE_LAYOUT_UNDEFINED or - * VK_IMAGE_LAYOUT_PREINITIALIZED. - * - * @return New image instance, if successful, or nullptr otherwise. - **/ - static ImageUniquePtr create_sparse(const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - ImageCreateFlags in_create_flags, - Anvil::SparseResidencyScope in_residency_scope, - VkImageLayout in_initial_layout = VK_IMAGE_LAYOUT_UNDEFINED, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); /** Destructor */ virtual ~Image(); @@ -296,6 +125,11 @@ namespace Anvil uint32_t in_n_mip, VkSubresourceLayout* out_subresource_layout_ptr) const; + const Anvil::ImageCreateInfo* get_create_info_ptr() const + { + return m_create_info_ptr.get(); + } + /** Returns the underlying VkImage instance. * * For non-sparse images, in case no memory block has been assigned to the image, @@ -315,13 +149,6 @@ namespace Anvil return m_alignment; } - /** Returns flags specified at image creation time. - **/ - Anvil::ImageCreateFlags get_image_create_flags() const - { - return m_create_flags; - } - /** Returns extent of a user-specified image mip as a VkExtent2D structure. * * @param in_n_mipmap Index of the mipmap to use for the query. @@ -338,12 +165,6 @@ namespace Anvil */ VkExtent3D get_image_extent_3D(uint32_t in_n_mipmap) const; - /** Returns information about the image format used to create the underlying VkImage instance */ - VkFormat get_image_format() const - { - return m_format; - } - /** Returns information about the memory types the underlying VkImage instance supports */ uint32_t get_image_memory_types() const { @@ -367,47 +188,6 @@ namespace Anvil uint32_t* out_opt_height_ptr, uint32_t* out_opt_depth_ptr) const; - /** Returns information about the number of layers stored by the underlying VkImage instance */ - uint32_t get_image_n_layers() const - { - return m_n_layers; - } - - /** Returns information about the number of mipmaps stored by the underlying VkImage instance */ - uint32_t get_image_n_mipmaps() const - { - return m_n_mipmaps; - } - - /** Returns queue families compatible with the image */ - Anvil::QueueFamilyBits get_image_queue_families() const - { - return m_queue_families; - } - - /** Returns information about the number of samples stored by the underlying VkImage instance */ - VkSampleCountFlagBits get_image_sample_count() const - { - return static_cast(m_sample_count); - } - - SparseResidencyScope get_image_residency_scope() const - { - return m_residency_scope; - } - - /** Returns image tiling */ - VkImageTiling get_image_tiling() const - { - return m_tiling; - } - - /** Returns image sharing mode, as specified at creation time */ - VkSharingMode get_image_sharing_mode() const - { - return m_sharing_mode; - } - /** Returns information about the amount of memory the underlying VkImage instance requires * to work correctly. **/ @@ -416,18 +196,6 @@ namespace Anvil return m_storage_size; } - /* Returns image type */ - VkImageType get_image_type() const - { - return m_type; - } - - /* Returns image usage flags */ - VkImageUsageFlags get_image_usage() const - { - return m_usage; - } - /** Returns a pointer to the underlying memory block wrapper instance. * * In case no memory block has been assigned to the non-sparse image OR some pages of @@ -447,10 +215,9 @@ namespace Anvil return m_memory_reqs; } - /** Returns swapchain, from which the image has been created. */ - const Anvil::Swapchain* get_parent_swapchain() const + const uint32_t& get_n_mipmaps() const { - return m_swapchain_ptr; + return m_n_mipmaps; } /** Returns a structure filled with details required to correctly bind tiles to a sparse image. @@ -492,17 +259,7 @@ namespace Anvil uint32_t in_y, uint32_t in_z) const; - /** Tells whether this Image wrapper instance holds a sparse image */ - bool is_sparse() const - { - return m_is_sparse; - } - - /** Tells whether this Image wrapper instance holds a swapchain image */ - bool is_swapchain_image() const - { - return m_is_swapchain_image; - } + /** Binds the specified region of a Vulkan memory object to an Image and caches information * about the new binding. @@ -673,91 +430,12 @@ namespace Anvil } AspectPageOccupancyData; /* Private functions */ - /** See corresponding create_nonsparse() function for specification */ - Image(const Anvil::BaseDevice* in_device_ptr, - Anvil::Swapchain* in_swapchain_ptr, - bool in_mt_safe); - - /** See corresponding create_nonsparse() function for specification */ - Image(const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkSharingMode in_sharing_mode, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - bool in_use_full_mipmap_chain, - ImageCreateFlags in_create_flags, - Anvil::QueueFamilyBits in_queue_families, - VkImageLayout in_post_create_image_layout, - const std::vector* in_opt_mipmaps_ptr, - bool in_mt_safe); - - /** See corresponding create_nonsparse() function for specification **/ - Image(const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkSharingMode in_sharing_mode, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, - bool in_use_full_mipmap_chain, - ImageCreateFlags in_create_flags, - VkImageLayout in_post_create_image_layout, - const std::vector* in_opt_mipmaps_ptr, - bool in_mt_safe); - - /** See corresponding create_nonsparse() function for specification **/ - Image(const Anvil::BaseDevice* in_device_ptr, - VkImage in_image, - VkFormat in_format, - VkImageTiling in_tiling, - VkSharingMode in_sharing_mode, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - uint32_t in_n_mipmaps, - VkSampleCountFlagBits in_sample_count, - uint32_t in_n_slices, - Anvil::ImageCreateFlags in_create_flags, - Anvil::QueueFamilyBits in_queue_families, - bool in_mt_safe); - - /** See corresponding create_sparse() function for specification **/ - Image(const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - ImageCreateFlags in_create_flags, - Anvil::SparseResidencyScope in_residency_scope, - bool in_mt_safe); - - Image (const Image&); - Image& operator=(const Image&); - - void init (bool in_use_full_mipmap_chain, - MemoryFeatureFlags in_memory_features, - const VkImageLayout* in_start_image_layout_ptr); + + Image(Anvil::ImageCreateInfoUniquePtr in_create_info_ptr); + + bool do_sanity_checks_for_external_memory_handle_types(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const; + + bool init (); void init_mipmap_props (); void init_page_occupancy(const std::vector& in_memory_reqs); @@ -776,8 +454,8 @@ namespace Anvil VkDeviceSize in_memory_block_start_offset, bool in_memory_block_owned_by_image); - void transition_to_post_create_image_layout(VkAccessFlags in_src_access_mask, - VkImageLayout in_src_layout); + void transition_to_post_alloc_image_layout(VkAccessFlags in_src_access_mask, + VkImageLayout in_src_layout); /** TODO. * @@ -786,54 +464,35 @@ namespace Anvil static VkImageCreateInfo get_create_info_for_swapchain(const Anvil::Swapchain* in_swapchain_ptr); /* Private members */ - VkSampleCountFlagsVariable(m_sample_count); - VkImageUsageFlagsVariable (m_usage); - typedef std::pair LayerMipKey; typedef std::map LayerMipToSubresourceLayoutMap; typedef std::map AspectToLayerMipToSubresourceLayoutMap; VkDeviceSize m_alignment; AspectToLayerMipToSubresourceLayoutMap m_aspects; /* only used for linear images */ - Anvil::ImageCreateFlags m_create_flags; - uint32_t m_depth; - const Anvil::BaseDevice* m_device_ptr; - VkFormat m_format; - bool m_has_transitioned_to_post_create_layout; - uint32_t m_height; + Anvil::ImageCreateInfoUniquePtr m_create_info_ptr; + bool m_has_transitioned_to_post_alloc_layout; VkImage m_image; - bool m_image_owner; - bool m_is_sparse; - bool m_is_swapchain_image; VkMemoryRequirements m_memory_reqs; uint32_t m_memory_types; Mipmaps m_mipmaps; - uint32_t m_n_layers; uint32_t m_n_mipmaps; - uint32_t m_n_slices; - VkImageLayout m_post_create_layout; - Anvil::QueueFamilyBits m_queue_families; - Anvil::SparseResidencyScope m_residency_scope; - VkSharingMode m_sharing_mode; VkDeviceSize m_storage_size; - bool m_swapchain_memory_assigned; /* only used for images which can be bound swapchain memory */ - Anvil::Swapchain* m_swapchain_ptr; /* only used for images which can be bound a swapchain */ - VkImageTiling m_tiling; - VkImageType m_type; + bool m_swapchain_memory_assigned; bool m_uses_full_mipmap_chain; - uint32_t m_width; MemoryBlockUniquePtr m_metadata_memory_block_ptr; std::vector m_memory_blocks_owned; - bool m_memory_set_by_world; - std::vector m_mipmaps_to_upload; std::unique_ptr m_page_tracker_ptr; /* only used for sparse non-resident images */ std::map m_sparse_aspect_page_occupancy; std::vector > m_sparse_aspect_page_occupancy_data_items_owned; std::map m_sparse_aspect_props; friend class Anvil::Queue; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(Image); + ANVIL_DISABLE_COPY_CONSTRUCTOR(Image); }; }; /* Vulkan namespace */ diff --git a/include/wrappers/image_view.h b/include/wrappers/image_view.h index c34b41db..242504c8 100644 --- a/include/wrappers/image_view.h +++ b/include/wrappers/image_view.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -40,227 +40,7 @@ namespace Anvil public: /* Public functions */ - /** Creates a single-sample 1D image view wrapper instance. - * - * @param in_device_ptr Device to use. - * @param in_image_ptr Image instance to create a view for. Must not be nullptr. The specified - * object will be retained and release at ImageView release time. - * @param in_n_base_layer Base layer index. - * @param in_n_base_mipmap_level Base mipmap level. - * @param in_n_mipmaps Number of mipmaps to include in the view. - * @param in_aspect_mask Image aspect mask to use when creating the Vulkan image view instance. - * @param in_format Image view format. - * @param in_swizzle_red Channel to use for the red component when sampling the view. - * @param in_swizzle_green Channel to use for the green component when sampling the view. - * @param in_swizzle_blue Channel to use for the blue component when sampling the view. - * @param in_swizzle_alpha Channel to use for the alpha component when sampling the view. - * - * @return New ImageView instance, if function executes successfully; nullptr otherwise. - **/ - static Anvil::ImageViewUniquePtr create_1D(const Anvil::BaseDevice* in_device_ptr, - Image* in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); - - /** Creates a single-sample 1D array image view wrapper instance. - * - * @param in_device_ptr Device to use. - * @param in_image_ptr Image instance to create a view for. Must not be nullptr. The specified - * object will be retained and release at ImageView release time. - * @param in_n_base_layer Base layer index. - * @param in_n_layers Number of layers to include in the view. - * @param in_n_base_mipmap_level Base mipmap level. - * @param in_n_mipmaps Number of mipmaps to include in the view. - * @param in_aspect_mask Image aspect mask to use when creating the Vulkan image view instance. - * @param in_format Image view format. - * @param in_swizzle_red Channel to use for the red component when sampling the view. - * @param in_swizzle_green Channel to use for the green component when sampling the view. - * @param in_swizzle_blue Channel to use for the blue component when sampling the view. - * @param in_swizzle_alpha Channel to use for the alpha component when sampling the view. - * - * @return New ImageView instance, if function executes successfully; nullptr otherwise. - **/ - static Anvil::ImageViewUniquePtr create_1D_array(const Anvil::BaseDevice* in_device_ptr, - Image* in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_layers, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); - - - /** Creates a single-sample or a multi-sample 2D image view wrapper instance. The view will be - * single-sample if @param in_image_ptr uses 1 sample per texel, and multi-sample otherwise. - * - * @param in_device_ptr Device to use - * @param in_image_ptr Image instance to create a view for. Must not be nullptr. The specified - * object will be retained and release at ImageView release time. - * @param in_n_base_layer Base layer index. - * @param in_n_base_mipmap_level Base mipmap level. - * @param in_n_mipmaps Number of mipmaps to include in the view. - * @param in_aspect_mask Image aspect mask to use when creating the Vulkan image view instance. - * @param in_format Image view format. - * @param in_swizzle_red Channel to use for the red component when sampling the view. - * @param in_swizzle_green Channel to use for the green component when sampling the view. - * @param in_swizzle_blue Channel to use for the blue component when sampling the view. - * @param in_swizzle_alpha Channel to use for the alpha component when sampling the view. - * - * @return New ImageView instance, if function executes successfully; nullptr otherwise. - **/ - static Anvil::ImageViewUniquePtr create_2D(const Anvil::BaseDevice* in_device_ptr, - Image* in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); - - /** Creates a single-sample or a multi-sample 2D array image view wrapper instance. The view will be - * single-sample if @param in_image_ptr uses 1 sample per texel, and multi-sample otherwise. - * - * @param in_device_ptr Device to use. - * @param in_image_ptr Image instance to create a view for. Must not be nullptr. The specified - * object will be retained and release at ImageView release time. - * @param in_n_base_layer Base layer index. - * @param in_n_layers Number of layers to include in the view. - * @param in_n_base_mipmap_level Base mipmap level. - * @param in_n_mipmaps Number of mipmaps to include in the view. - * @param in_aspect_mask Image aspect mask to use when creating the Vulkan image view instance. - * @param in_format Image view format. - * @param in_swizzle_red Channel to use for the red component when sampling the view. - * @param in_swizzle_green Channel to use for the green component when sampling the view. - * @param in_swizzle_blue Channel to use for the blue component when sampling the view. - * @param in_swizzle_alpha Channel to use for the alpha component when sampling the view. - * - * @return New ImageView instance, if function executes successfully; nullptr otherwise. - **/ - static Anvil::ImageViewUniquePtr create_2D_array(const Anvil::BaseDevice* in_device_ptr, - Anvil::Image* in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_layers, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); - - /** Creates a single-sample 3D image view wrapper instance. - * - * @param in_device_ptr Device to use. - * @param in_image_ptr Image instance to create a view for. Must not be nullptr. The specified - * object will be retained and release at ImageView release time. - * @param in_n_base_slice Base slice index. - * @param in_n_slices Number of slices to include in the view. - * @param in_n_base_mipmap_level Base mipmap level. - * @param in_n_mipmaps Number of mipmaps to include in the view. - * @param in_aspect_mask Image aspect mask to use when creating the Vulkan image view instance. - * @param in_format Image view format. - * @param in_swizzle_red Channel to use for the red component when sampling the view. - * @param in_swizzle_green Channel to use for the green component when sampling the view. - * @param in_swizzle_blue Channel to use for the blue component when sampling the view. - * @param in_swizzle_alpha Channel to use for the alpha component when sampling the view. - * - * @return New ImageView instance, if function executes successfully; nullptr otherwise. - **/ - static Anvil::ImageViewUniquePtr create_3D(const Anvil::BaseDevice* in_device_ptr, - Image* in_image_ptr, - uint32_t in_n_base_slice, - uint32_t in_n_slices, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); - - /** Creates a cube-map image view wrapper instance. - * - * @param in_device_ptr Device to use. - * @param in_image_ptr Image instance to create a view for. Must not be nullptr. The specified - * object will be retained and release at ImageView release time. - * @param in_n_base_layer Base layer index. - * @param in_n_base_mipmap_level Base mipmap level. - * @param in_n_mipmaps Number of mipmaps to include in the view. - * @param in_aspect_mask Image aspect mask to use when creating the Vulkan image view instance. - * @param in_format Image view format. - * @param in_swizzle_red Channel to use for the red component when sampling the view. - * @param in_swizzle_green Channel to use for the green component when sampling the view. - * @param in_swizzle_blue Channel to use for the blue component when sampling the view. - * @param in_swizzle_alpha Channel to use for the alpha component when sampling the view. - * - * @return New ImageView instance, if function executes successfully; nullptr otherwise. - **/ - static Anvil::ImageViewUniquePtr create_cube_map(const Anvil::BaseDevice* in_device_ptr, - Anvil::Image* in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); - - /** Creates a cube-map array image view wrapper instance. - * - * @param in_device_ptr Device to use. - * @param in_image_ptr Image instance to create a view for. Must not be nullptr. The specified - * object will be retained and release at ImageView release time. - * @param in_n_base_layer Base layer index. - * @param in_n_cube_maps Number of cube-maps to include in the view. The number of layers created - * for the view will be equal to @param in_n_cube_maps * 6. - * @param in_n_base_mipmap_level Base mipmap level. - * @param in_n_mipmaps Number of mipmaps to include in the view. - * @param in_aspect_mask Image aspect mask to use when creating the Vulkan image view instance. - * @param in_format Image view format. - * @param in_swizzle_red Channel to use for the red component when sampling the view. - * @param in_swizzle_green Channel to use for the green component when sampling the view. - * @param in_swizzle_blue Channel to use for the blue component when sampling the view. - * @param in_swizzle_alpha Channel to use for the alpha component when sampling the view. - * - * @return New ImageView instance, if function executes successfully; nullptr otherwise. - **/ - static Anvil::ImageViewUniquePtr create_cube_map_array(const Anvil::BaseDevice* in_device_ptr, - Anvil::Image* in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_cube_maps, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::ImageViewUniquePtr create(Anvil::ImageViewCreateInfoUniquePtr in_create_info_ptr); /** Destructor. Should only be called when the reference counter drops to zero. * @@ -268,24 +48,6 @@ namespace Anvil **/ virtual ~ImageView(); - /* Returns the aspect assigned to the image view */ - VkImageAspectFlags get_aspect() const - { - return m_aspect_mask; - } - - /* Returns base layer index used by the image view */ - uint32_t get_base_layer() const - { - return m_n_base_layer; - } - - /* Returns base mip level used by the image view */ - uint32_t get_base_mipmap_level() const - { - return m_n_base_mipmap_level; - } - /** Returns dimensions of the base mipmap, as seen from the image view. * * @param out_opt_base_mipmap_width_ptr If not nullptr, deref will be set to mipmap's width. @@ -297,10 +59,9 @@ namespace Anvil uint32_t* out_opt_base_mipmap_height_ptr, uint32_t* out_opt_base_mipmap_depth_ptr) const; - /** Returns image view's format */ - const VkFormat get_image_format() const + const Anvil::ImageViewCreateInfo* get_create_info_ptr() const { - return m_format; + return m_create_info_ptr.get(); } /** Returns the encapsulated raw Vulkan image view handle. */ @@ -309,64 +70,10 @@ namespace Anvil return m_image_view; } - /** Returns number of layers encapsulated by the image view */ - uint32_t get_n_layers() const - { - return m_n_layers; - } - - /** Returns number of mipmaps encapsulated by the image view */ - uint32_t get_n_mipmaps() const - { - return m_n_mipmaps; - } - - /** Returns number of slices encapsulated by the image view */ - uint32_t get_n_slices() const - { - return m_n_slices; - } - - /** Returns a pointer to the parent image, from which the image view has been created. */ - const Anvil::Image* get_parent_image() const - { - return m_parent_image_ptr; - } - - Anvil::Image* get_parent_image() - { - return m_parent_image_ptr; - } - /** Returns a VkImageSubresourceRange struct that describes the range of subresources covered * by this image view. */ - VkImageSubresourceRange get_subresource_range() const - { - VkImageSubresourceRange result; - - result.aspectMask = m_aspect_mask; - result.baseArrayLayer = m_n_base_layer; - result.baseMipLevel = m_n_base_mipmap_level; - result.layerCount = m_n_layers; /* TODO: do NOT use m_n_slices here, subresource ranges never describe number of slices via .layerCount */ - result.levelCount = m_n_mipmaps; - - return result; - } - - /** Returns swizzle array assigned to the image view */ - void get_swizzle_array(VkComponentSwizzle* out_swizzle_array_ptr) const - { - memcpy(out_swizzle_array_ptr, - m_swizzle_array, - sizeof(m_swizzle_array) ); - } - - /** Returns image view type of the image view instance */ - const VkImageViewType get_type() const - { - return m_type; - } + VkImageSubresourceRange get_subresource_range() const; /** Tells whether the subresource range described by this image view intersects * with another image view's subres range. @@ -384,35 +91,13 @@ namespace Anvil ImageView (const ImageView&); ImageView& operator=(const ImageView&); - ImageView(const Anvil::BaseDevice* in_device_ptr, - Anvil::Image* in_parent_image_ptr, - bool in_mt_safe); + ImageView(Anvil::ImageViewCreateInfoUniquePtr in_create_info_ptr); - bool init(VkImageViewType in_image_view_type, - uint32_t in_n_base_layer, - uint32_t in_n_layers, - uint32_t in_n_slices, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - const VkComponentSwizzle* in_swizzle_rgba_ptr); + bool init(); /* Private members */ - const Anvil::BaseDevice* m_device_ptr; - VkImageView m_image_view; - Anvil::Image* m_parent_image_ptr; - - VkImageAspectFlagsVariable(m_aspect_mask); - - VkFormat m_format; - uint32_t m_n_base_layer; - uint32_t m_n_base_mipmap_level; - uint32_t m_n_layers; - uint32_t m_n_mipmaps; - uint32_t m_n_slices; - VkComponentSwizzle m_swizzle_array[4]; - VkImageViewType m_type; + Anvil::ImageViewCreateInfoUniquePtr m_create_info_ptr; + VkImageView m_image_view; }; }; diff --git a/include/wrappers/instance.h b/include/wrappers/instance.h index 21dd7660..376d8e34 100644 --- a/include/wrappers/instance.h +++ b/include/wrappers/instance.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -31,6 +31,7 @@ #ifndef WRAPPERS_INSTANCE_H #define WRAPPERS_INSTANCE_H +#include "misc/extensions.h" #include "misc/mt_safety.h" #include "misc/types.h" @@ -81,6 +82,11 @@ namespace Anvil bool in_mt_safe, const std::vector& in_opt_disallowed_instance_level_extensions = std::vector() ); + const Anvil::IExtensionInfoInstance* get_enabled_extensions_info() const + { + return m_enabled_extensions_info_ptr->get_instance_extension_info(); + } + /** Returns a container with entry-points to functions introduced by VK_KHR_get_physical_device_properties2. * * Will fire an assertion failure if the extension is not supported. @@ -213,7 +219,9 @@ namespace Anvil const std::string m_engine_name; DebugCallbackFunction m_validation_callback_function; - std::vector m_enabled_extensions; + std::unique_ptr > m_enabled_extensions_info_ptr; + std::unique_ptr > m_supported_extensions_info_ptr; + Anvil::Layer m_global_layer; std::vector > m_physical_devices; std::vector m_supported_layers; diff --git a/include/wrappers/memory_block.h b/include/wrappers/memory_block.h index c75c7aa5..f6c3465b 100644 --- a/include/wrappers/memory_block.h +++ b/include/wrappers/memory_block.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -52,7 +52,8 @@ namespace Anvil /* Stub */ } - virtual void set_parent_memory_allocator_backend_ptr(std::shared_ptr in_backend_ptr) = 0; + virtual void set_parent_memory_allocator_backend_ptr(std::shared_ptr in_backend_ptr, + void* in_backend_object) = 0; } IMemoryBlockBackendSupport; /** Wrapper class for memory objects. Please see header for more details */ @@ -64,16 +65,20 @@ namespace Anvil /** Create and bind a new device memory object to the instantiated MemoryBlock object. * - * @param in_device_ptr Device to use. - * @param in_allowed_memory_bits Memory type bits which meet the allocation requirements. - * @param in_size Required allocation size. - * @param in_memory_features Required memory features. + * @param in_device_ptr Device to use. + * @param in_allowed_memory_bits Memory type bits which meet the allocation requirements. + * @param in_size Required allocation size. + * @param in_memory_features Required memory features. + * @param in_external_memory_handle_types If the memory block is going to be exported to another process or Vulkan instance, use + * this field to specify which handle types the allocation needs to support. Please see + * documentation of Anvil::ExternalMemoryHandleTypeFlags for more details. **/ - static MemoryBlockUniquePtr create(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_allowed_memory_bits, - VkDeviceSize in_size, - Anvil::MemoryFeatureFlags in_memory_features, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static MemoryBlockUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_allowed_memory_bits, + VkDeviceSize in_size, + Anvil::MemoryFeatureFlags in_memory_features, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); /** Create a memory block whose storage space is maintained by another MemoryBlock instance. * @@ -105,7 +110,8 @@ namespace Anvil uint32_t in_memory_type_index, VkDeviceSize in_size, VkDeviceSize in_start_offset, - OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function); + OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types); /** Releases the Vulkan counterpart and unregisters the wrapper instance from the object tracker */ virtual ~MemoryBlock(); @@ -248,18 +254,19 @@ namespace Anvil /* Private functions */ bool init(); + /** Please see create() for documentation */ + MemoryBlock(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_allowed_memory_bits, + VkDeviceSize in_size, + Anvil::MemoryFeatureFlags in_memory_features, + bool in_mt_safe, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types); + /** Please see create() for documentation */ MemoryBlock(MemoryBlock* in_parent_memory_block_ptr, VkDeviceSize in_start_offset, VkDeviceSize in_size); - /** Please see create() for documentation */ - MemoryBlock(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_allowed_memory_bits, - VkDeviceSize in_size, - Anvil::MemoryFeatureFlags in_memory_features, - bool in_mt_safe); - /** Please see create_derived_with_custom_delete_proc() for documentation */ MemoryBlock(const Anvil::BaseDevice* in_device_ptr, VkDeviceMemory in_memory, @@ -268,7 +275,8 @@ namespace Anvil uint32_t in_memory_type_index, VkDeviceSize in_size, VkDeviceSize in_start_offset, - OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function); + OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types); MemoryBlock (const MemoryBlock&); MemoryBlock& operator=(const MemoryBlock&); @@ -279,11 +287,29 @@ namespace Anvil bool open_gpu_memory_access (); /* IMemoryBlockBackendSupport */ - void set_parent_memory_allocator_backend_ptr(std::shared_ptr in_backend_ptr) + void set_parent_memory_allocator_backend_ptr(std::shared_ptr in_backend_ptr, + void* in_backend_object) { - anvil_assert(m_parent_memory_allocator_backend_ptr == nullptr); + anvil_assert(m_owned_parent_memory_allocator_backend_ptr == nullptr); - m_parent_memory_allocator_backend_ptr = in_backend_ptr; + m_backend_object = in_backend_object; + m_owned_parent_memory_allocator_backend_ptr = in_backend_ptr; + m_parent_memory_allocator_backend_ptr = m_owned_parent_memory_allocator_backend_ptr.get(); + + { + auto parent_memory_block_ptr = m_parent_memory_block_ptr; + + while (parent_memory_block_ptr != nullptr) + { + anvil_assert(parent_memory_block_ptr->m_parent_memory_allocator_backend_ptr == nullptr || + parent_memory_block_ptr->m_parent_memory_allocator_backend_ptr == in_backend_ptr.get() ); + + parent_memory_block_ptr->m_backend_object = in_backend_object; + parent_memory_block_ptr->m_parent_memory_allocator_backend_ptr = in_backend_ptr.get(); + + parent_memory_block_ptr = parent_memory_block_ptr->m_parent_memory_block_ptr; + } + } } /* Private members */ @@ -292,16 +318,19 @@ namespace Anvil std::atomic m_gpu_data_map_count; /* Only set for root memory blocks */ void* m_gpu_data_ptr; /* Only set for root memory blocks */ - uint32_t m_allowed_memory_bits; - const Anvil::BaseDevice* m_device_ptr; - VkDeviceMemory m_memory; - Anvil::MemoryFeatureFlags m_memory_features; - uint32_t m_memory_type_index; - Anvil::MemoryBlock* m_parent_memory_block_ptr; - VkDeviceSize m_size; - VkDeviceSize m_start_offset; - - std::shared_ptr m_parent_memory_allocator_backend_ptr; + uint32_t m_allowed_memory_bits; + void* m_backend_object; + const Anvil::BaseDevice* m_device_ptr; + Anvil::ExternalMemoryHandleTypeFlags m_external_memory_handle_types; + VkDeviceMemory m_memory; + Anvil::MemoryFeatureFlags m_memory_features; + uint32_t m_memory_type_index; + Anvil::MemoryBlock* m_parent_memory_block_ptr; + VkDeviceSize m_size; + VkDeviceSize m_start_offset; + + std::shared_ptr m_owned_parent_memory_allocator_backend_ptr; + Anvil::IMemoryAllocatorBackendBase* m_parent_memory_allocator_backend_ptr; }; }; /* Vulkan namespace */ diff --git a/include/wrappers/physical_device.h b/include/wrappers/physical_device.h index a19ff6cc..120ae408 100644 --- a/include/wrappers/physical_device.h +++ b/include/wrappers/physical_device.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -32,6 +32,7 @@ #define WRAPPERS_PHYSICAL_DEVICE_H #include "misc/debug.h" +#include "misc/extensions.h" #include "misc/types.h" namespace Anvil @@ -273,11 +274,11 @@ namespace Anvil explicit PhysicalDevice(Anvil::Instance* in_instance_ptr, uint32_t in_index, VkPhysicalDevice in_physical_device) - :m_device_LUID_available (false), - m_device_UUID_available (false), - m_index (in_index), - m_instance_ptr (in_instance_ptr), - m_physical_device (in_physical_device) + :m_device_LUID_available(false), + m_device_UUID_available(false), + m_index (in_index), + m_instance_ptr (in_instance_ptr), + m_physical_device (in_physical_device) { anvil_assert(in_physical_device != VK_NULL_HANDLE); } @@ -288,20 +289,23 @@ namespace Anvil bool init(); /* Private variables */ - FormatProperties m_dummy; - Anvil::Extensions m_extensions; - uint32_t m_index; - Anvil::Instance* m_instance_ptr; - Anvil::PhysicalDeviceFeatures m_features; - FormatPropertiesMap m_format_properties; - Anvil::Layers m_layers; - MemoryProperties m_memory_properties; - VkPhysicalDevice m_physical_device; - QueueFamilyInfoItems m_queue_families; - Anvil::PhysicalDeviceProperties m_properties; - + FormatProperties m_dummy; + std::unique_ptr > m_extension_info_ptr; + uint32_t m_index; + Anvil::Instance* m_instance_ptr; + Anvil::PhysicalDeviceFeatures m_features; + FormatPropertiesMap m_format_properties; + Anvil::Layers m_layers; + MemoryProperties m_memory_properties; + VkPhysicalDevice m_physical_device; + QueueFamilyInfoItems m_queue_families; + Anvil::PhysicalDeviceProperties m_properties; + + std::unique_ptr m_amd_shader_core_properties_ptr; std::unique_ptr m_core_features_vk10_ptr; std::unique_ptr m_core_properties_vk10_ptr; + std::unique_ptr m_ext_descriptor_indexing_features_ptr; + std::unique_ptr m_ext_descriptor_indexing_properties_ptr; std::unique_ptr m_khr_16_bit_storage_features_ptr; std::unique_ptr m_khr_maintenance3_properties_ptr; diff --git a/include/wrappers/pipeline_cache.h b/include/wrappers/pipeline_cache.h index e79fad3e..031f2caa 100644 --- a/include/wrappers/pipeline_cache.h +++ b/include/wrappers/pipeline_cache.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/wrappers/pipeline_layout.h b/include/wrappers/pipeline_layout.h index fb8555c9..959e2f61 100644 --- a/include/wrappers/pipeline_layout.h +++ b/include/wrappers/pipeline_layout.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -57,9 +57,9 @@ namespace Anvil return m_push_constant_ranges; } - const std::vector* get_ds_info_ptrs() const + const std::vector* get_ds_create_info_ptrs() const { - return &m_ds_info_ptrs; + return &m_ds_create_info_ptrs; } /** Retrieves a raw Vulkan pipeline layout handle. @@ -88,7 +88,7 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool bake(const std::vector* in_ds_info_items_ptr); + bool bake(const std::vector* in_ds_create_info_items_ptr); /** Initializes a new wrapper instance using information extracted from user-specified descriptor set groups (appended * one after another, in the user-defined order). @@ -97,22 +97,22 @@ namespace Anvil * is set to true, attach_dsg() and attach_push_constant_range() calls invoked for such object * will result in a failure. * - * @param in_device_ptr Device to use. Must not be nullptr. - * @param in_ds_info_items_ptr TODO - * @param in_push_constant_ranges Push constant ranges to define for the pipeline layout. + * @param in_device_ptr Device to use. Must not be nullptr. + * @param in_ds_create_info_items_ptr TODO + * @param in_push_constant_ranges Push constant ranges to define for the pipeline layout. * **/ - static PipelineLayoutUniquePtr create(const Anvil::BaseDevice* in_device_ptr, - const std::vector* in_ds_info_items_ptr, - const PushConstantRanges& in_push_constant_ranges, - bool in_mt_safe); + static PipelineLayoutUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + const std::vector* in_ds_create_info_items_ptr, + const PushConstantRanges& in_push_constant_ranges, + bool in_mt_safe); /* Private variables */ - const Anvil::BaseDevice* m_device_ptr; - std::vector m_ds_info_ptrs; - std::vector m_ds_layout_ptrs; - VkPipelineLayout m_layout_vk; - PushConstantRanges m_push_constant_ranges; + const Anvil::BaseDevice* m_device_ptr; + std::vector m_ds_create_info_ptrs; + std::vector m_ds_layout_ptrs; + VkPipelineLayout m_layout_vk; + PushConstantRanges m_push_constant_ranges; friend class PipelineLayoutManager; }; diff --git a/include/wrappers/pipeline_layout_manager.h b/include/wrappers/pipeline_layout_manager.h index 12893135..ccf8f093 100644 --- a/include/wrappers/pipeline_layout_manager.h +++ b/include/wrappers/pipeline_layout_manager.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -47,7 +47,7 @@ namespace Anvil /** Returns a pipeline layout wrapper matching the specified DSG + push constant range configuration. * If such pipeline layout has never been defined before, it will be created at the call time. * - * @param in_ds_info_items_ptr TODO. + * @param in_ds_create_info_items_ptr TODO. * @param in_push_constant_ranges A vector of PushConstantRange descriptor, describing the push constant ranges * the layout should define. * @param out_pipeline_layout_ptr_ptr Deref will be set to a ptr to the pipeline layout wrapper instance, matching the described @@ -55,9 +55,9 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool get_layout(const std::vector* in_ds_info_items_ptr, - const PushConstantRanges& in_push_constant_ranges, - Anvil::PipelineLayoutUniquePtr* out_pipeline_layout_ptr_ptr); + bool get_layout(const std::vector* in_ds_create_info_items_ptr, + const PushConstantRanges& in_push_constant_ranges, + Anvil::PipelineLayoutUniquePtr* out_pipeline_layout_ptr_ptr); protected: /* Protected functions */ diff --git a/include/wrappers/query_pool.h b/include/wrappers/query_pool.h index a0f74502..b0544ceb 100644 --- a/include/wrappers/query_pool.h +++ b/include/wrappers/query_pool.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/wrappers/queue.h b/include/wrappers/queue.h index 666929fc..778bf1d5 100644 --- a/include/wrappers/queue.h +++ b/include/wrappers/queue.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -81,7 +81,7 @@ namespace Anvil * * @param in_update Detailed information about the update to be carried out. **/ - bool bind_sparse_memory(Anvil::Utils::SparseMemoryBindingUpdateInfo& in_update); + bool bind_sparse_memory(Anvil::SparseMemoryBindingUpdateInfo& in_update); /** Retrieves parent device instance */ const Anvil::BaseDevice* get_parent_device() const @@ -277,27 +277,22 @@ namespace Anvil private: /* Private functions */ - VkResult present_internal (uint32_t in_n_swapchains, - Anvil::Swapchain* const* in_swapchains, - const uint32_t* in_swapchain_image_indices, - uint32_t in_n_wait_semaphores, - Anvil::Semaphore* const* in_wait_semaphore_ptrs); - void present_lock_unlock(uint32_t in_n_swapchains, - const Anvil::Swapchain* const* in_swapchains, - uint32_t in_n_wait_semaphores, - Anvil::Semaphore* const* in_wait_semaphore_ptrs, - bool in_should_lock); + void present_lock_unlock(uint32_t in_n_swapchains, + const Anvil::Swapchain* const* in_swapchains, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs, + bool in_should_lock); - void bind_sparse_memory_lock_unlock (Anvil::Utils::SparseMemoryBindingUpdateInfo& in_update, - bool in_should_lock); - void submit_command_buffers_lock_unlock(uint32_t in_n_command_buffers, - Anvil::CommandBufferBase* const* in_opt_cmd_buffer_ptrs_ptr, - uint32_t in_n_semaphores_to_signal, - Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, - uint32_t in_n_semaphores_to_wait_on, - Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, - Anvil::Fence* in_opt_fence_ptr, - bool in_should_lock); + void bind_sparse_memory_lock_unlock (Anvil::SparseMemoryBindingUpdateInfo& in_update, + bool in_should_lock); + void submit_command_buffers_lock_unlock(uint32_t in_n_command_buffers, + Anvil::CommandBufferBase* const* in_opt_cmd_buffer_ptrs_ptr, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, + Anvil::Fence* in_opt_fence_ptr, + bool in_should_lock); /* Constructor. Please see create() for specification */ Queue(const Anvil::BaseDevice* in_device_ptr, diff --git a/include/wrappers/render_pass.h b/include/wrappers/render_pass.h index fc883f71..dc8f103c 100644 --- a/include/wrappers/render_pass.h +++ b/include/wrappers/render_pass.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -45,13 +45,13 @@ namespace Anvil * throw a NPE if it ever needs to deduce the window size. * * - * @param in_renderpass_info_ptr TODO - * @param in_opt_swapchain_ptr Swapchain, that the render-pass will render to. See brief for more information. - * May be nullptr. + * @param in_renderpass_create_info_ptr TODO + * @param in_opt_swapchain_ptr Swapchain, that the render-pass will render to. See brief for more information. + * May be nullptr. * **/ - static Anvil::RenderPassUniquePtr create(Anvil::RenderPassInfoUniquePtr in_renderpass_info_ptr, - Anvil::Swapchain* in_opt_swapchain_ptr); + static Anvil::RenderPassUniquePtr create(Anvil::RenderPassCreateInfoUniquePtr in_renderpass_create_info_ptr, + Anvil::Swapchain* in_opt_swapchain_ptr); /** Destructor. * @@ -67,9 +67,9 @@ namespace Anvil return m_render_pass; } - const Anvil::RenderPassInfo* get_render_pass_info() const + const Anvil::RenderPassCreateInfo* get_render_pass_create_info() const { - return m_render_pass_info_ptr.get(); + return m_render_pass_create_info_ptr.get(); } /** Returns the Swapchain instance, associated with the RenderPass wrapper instance at creation time. */ @@ -86,16 +86,16 @@ namespace Anvil bool init(); /* Constructor. Please see create() for specification */ - RenderPass(Anvil::RenderPassInfoUniquePtr in_renderpass_info_ptr, - Anvil::Swapchain* in_opt_swapchain_ptr); + RenderPass(Anvil::RenderPassCreateInfoUniquePtr in_renderpass_create_info_ptr, + Anvil::Swapchain* in_opt_swapchain_ptr); RenderPass& operator=(const RenderPass&); RenderPass (const RenderPass&); /* Private members */ - VkRenderPass m_render_pass; - Anvil::RenderPassInfoUniquePtr m_render_pass_info_ptr; - Swapchain* m_swapchain_ptr; + VkRenderPass m_render_pass; + Anvil::RenderPassCreateInfoUniquePtr m_render_pass_create_info_ptr; + Swapchain* m_swapchain_ptr; }; }; diff --git a/include/wrappers/rendering_surface.h b/include/wrappers/rendering_surface.h index 8a318a59..cccddb01 100644 --- a/include/wrappers/rendering_surface.h +++ b/include/wrappers/rendering_surface.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -111,10 +111,10 @@ namespace Anvil bool get_supported_composite_alpha_flags(VkCompositeAlphaFlagsKHR* out_result_ptr) const; /** Returns transformations supported by the rendering surface */ - bool get_supported_transformations(VkSurfaceTransformFlagsKHR* out_result_ptr) const; + bool get_supported_transformations(VkSurfaceTransformFlagsKHR* out_result_ptr) const; /** Returns flags corresponding to image usage supported by the rendering surface */ - bool get_supported_usages(VkImageUsageFlags* out_result_ptr) const; + bool get_supported_usages(VkImageUsageFlags* out_result_ptr) const; /** Retrieves a raw handle to the underlying Vulkan Rendering Surface */ VkSurfaceKHR get_surface() const @@ -147,6 +147,8 @@ namespace Anvil private: /* Private type definitions */ + typedef uint32_t DeviceGroupIndex; + typedef struct PhysicalDeviceCapabilities { VkSurfaceCapabilitiesKHR capabilities; @@ -186,11 +188,11 @@ namespace Anvil const Anvil::BaseDevice* m_device_ptr; Anvil::Instance* m_instance_ptr; - uint32_t m_height; - PhysicalDeviceCapabilities m_physical_device_capabilities; - VkSurfaceKHR m_surface; - uint32_t m_width; - const Anvil::Window* m_window_ptr; + uint32_t m_height; + std::map m_physical_device_capabilities; + VkSurfaceKHR m_surface; + uint32_t m_width; + const Anvil::Window* m_window_ptr; }; }; /* namespace Anvil */ diff --git a/include/wrappers/sampler.h b/include/wrappers/sampler.h index c00a09e6..0ccfacc6 100644 --- a/include/wrappers/sampler.h +++ b/include/wrappers/sampler.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -50,22 +50,7 @@ namespace Anvil * * For argument discussion, please consult Vulkan API specification. */ - static Anvil::SamplerUniquePtr create(const Anvil::BaseDevice* in_device_ptr, - VkFilter in_mag_filter, - VkFilter in_min_filter, - VkSamplerMipmapMode in_mipmap_mode, - VkSamplerAddressMode in_address_mode_u, - VkSamplerAddressMode in_address_mode_v, - VkSamplerAddressMode in_address_mode_w, - float in_lod_bias, - float in_max_anisotropy, - bool in_compare_enable, - VkCompareOp in_compare_op, - float in_min_lod, - float in_max_lod, - VkBorderColor in_border_color, - bool in_use_unnormalized_coordinates, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::SamplerUniquePtr create(Anvil::SamplerCreateInfoUniquePtr in_create_info_ptr); /** Destructor. * @@ -74,29 +59,9 @@ namespace Anvil **/ virtual ~Sampler(); - VkSamplerAddressMode get_address_mode_u() const + const SamplerCreateInfo* get_create_info_ptr() const { - return m_address_mode_u; - } - - VkSamplerAddressMode get_address_mode_v() const - { - return m_address_mode_v; - } - - VkSamplerAddressMode get_address_mode_w() const - { - return m_address_mode_w; - } - - VkBorderColor get_border_color() const - { - return m_border_color; - } - - VkCompareOp get_compare_op() const - { - return m_compare_op; + return m_create_info_ptr.get(); } /** Retrieves a raw Vulkan handle for the underlying VkSampler instance. */ @@ -105,99 +70,26 @@ namespace Anvil return m_sampler; } - float get_lod_bias() const - { - return m_lod_bias; - } - - VkFilter get_mag_filter() const - { - return m_mag_filter; - } - - float get_max_anisotropy() const - { - return m_max_anisotropy; - } - - float get_max_lod() const - { - return m_max_lod; - } - - VkFilter get_min_filter() const - { - return m_min_filter; - } - - float get_min_lod() const - { - return m_min_lod; - } - - VkSamplerMipmapMode get_mipmap_mode() const - { - return m_mipmap_mode; - } - /** Retrieves a pointer to the raw Vulkan handle for the underlying VkSampler instance. */ const VkSampler* get_sampler_ptr() const { return &m_sampler; } - bool is_compare_enabled() const - { - return m_compare_enable; - } - - bool uses_unnormalized_coordinates() const - { - return m_use_unnormalized_coordinates; - } - private: /* Private functions */ + bool init(); + /* Please see create() for specification */ - Sampler(const Anvil::BaseDevice* in_device_ptr, - VkFilter in_mag_filter, - VkFilter in_min_filter, - VkSamplerMipmapMode in_mipmap_mode, - VkSamplerAddressMode in_address_mode_u, - VkSamplerAddressMode in_address_mode_v, - VkSamplerAddressMode in_address_mode_w, - float in_lod_bias, - float in_max_anisotropy, - bool in_compare_enable, - VkCompareOp in_compare_op, - float in_min_lod, - float in_max_lod, - VkBorderColor in_border_color, - bool in_use_unnormalized_coordinates, - bool in_mt_safe); + Sampler(Anvil::SamplerCreateInfoUniquePtr in_create_info_ptr); Sampler (const Sampler&); Sampler& operator=(const Sampler&); /* Private variables */ - VkSamplerAddressMode m_address_mode_u; - VkSamplerAddressMode m_address_mode_v; - VkSamplerAddressMode m_address_mode_w; - VkBorderColor m_border_color; - bool m_compare_enable; - VkCompareOp m_compare_op; - float m_lod_bias; - VkFilter m_mag_filter; - float m_max_anisotropy; - float m_max_lod; - VkFilter m_min_filter; - float m_min_lod; - VkSamplerMipmapMode m_mipmap_mode; - bool m_use_unnormalized_coordinates; - - const Anvil::BaseDevice* m_device_ptr; - VkSampler m_sampler; + SamplerCreateInfoUniquePtr m_create_info_ptr; + VkSampler m_sampler; }; }; /* namespace Anvil */ diff --git a/include/wrappers/semaphore.h b/include/wrappers/semaphore.h index 90fade94..71f0531a 100644 --- a/include/wrappers/semaphore.h +++ b/include/wrappers/semaphore.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -45,8 +45,7 @@ namespace Anvil /* Public functions */ /** Creates a single Vulkan semaphore instance and registers the object in Object Tracker. */ - static Anvil::SemaphoreUniquePtr create(const Anvil::BaseDevice* in_device_ptr, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::SemaphoreUniquePtr create(Anvil::SemaphoreCreateInfoUniquePtr in_create_info_ptr); /** Destructor. * @@ -54,6 +53,11 @@ namespace Anvil **/ virtual ~Semaphore(); + const Anvil::SemaphoreCreateInfo* get_create_info_ptr() const + { + return m_create_info_ptr.get(); + } + /** Retrieves a raw handle to the underlying Vulkan semaphore instance */ VkSemaphore get_semaphore() const { @@ -67,24 +71,23 @@ namespace Anvil } /** Releases the underlying Vulkan Semaphore instance and creates a new Vulkan object. */ - void reset(); + bool reset(); private: /* Private functions */ /* Constructor. Please see create() for specification */ - Semaphore(const Anvil::BaseDevice* in_device_ptr, - bool in_mt_safe); - - Semaphore (const Semaphore&); - Semaphore& operator=(const Semaphore&); + Semaphore(Anvil::SemaphoreCreateInfoUniquePtr in_create_info_ptr); void release_semaphore(); /* Private variables */ - const Anvil::BaseDevice* m_device_ptr; - VkSemaphore m_semaphore; + Anvil::SemaphoreCreateInfoUniquePtr m_create_info_ptr; + VkSemaphore m_semaphore; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(Semaphore); + ANVIL_DISABLE_COPY_CONSTRUCTOR(Semaphore); }; }; /* namespace Anvil */ diff --git a/include/wrappers/shader_module.h b/include/wrappers/shader_module.h index 80a79d32..506ef884 100644 --- a/include/wrappers/shader_module.h +++ b/include/wrappers/shader_module.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/wrappers/swapchain.h b/include/wrappers/swapchain.h index 73a604f7..06f4e2b1 100644 --- a/include/wrappers/swapchain.h +++ b/include/wrappers/swapchain.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -50,30 +50,7 @@ namespace Anvil public: /* Public functions */ - /** Constructor. - * - * @param in_device_ptr Device to initialize the swapchain for. - * @param in_parent_surface_ptr Rendering surface the swapchain is to be created for. Must - * not be nullptr. - * @param in_window_ptr current window to create the swapchain for. Must not be nullptr. - * @param in_format Format to use for the swapchain image. - * @param in_present_mode Presentation mode to use for the swapchain. - * @param in_usage_flags Image usage flags to use for the swapchain. - * @param in_n_images Number of swapchain images to use for the swapchain. - * @param in_khr_swapchain_entrypoints VK_KHR_swapchain entrypoint container. - * @param in_flags Swapchain create flags to pass, when creating the swapchain. - * - */ - static Anvil::SwapchainUniquePtr create(const Anvil::BaseDevice* in_device_ptr, - Anvil::RenderingSurface* in_parent_surface_ptr, - Anvil::Window* in_window_ptr, - VkFormat in_format, - VkPresentModeKHR in_present_mode, - VkImageUsageFlags in_usage_flags, - uint32_t in_n_images, - const ExtensionKHRSwapchainEntrypoints& in_khr_swapchain_entrypoints, - MTSafety in_mt_safety, - VkSwapchainCreateFlagsKHR in_flags = 0); + static Anvil::SwapchainUniquePtr create(Anvil::SwapchainCreateInfoUniquePtr in_create_info_ptr); /** Destructor. * @@ -95,25 +72,9 @@ namespace Anvil uint32_t acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, bool in_should_block = false); - /* By default, swapchain instance will transparently destroy the underlying Vulkan swapchain handle, right before - * the window is closed. - * - * There are certain use cases where we want the order to be reversed (ie. the swapchain handle should be destroyed only after - * the window is closed). This function can be used to enable this behavior. - * - */ - void disable_destroy_swapchain_before_parent_window_closes_behavior(); - - /** Returns device instance which has been used to create the swapchain */ - const Anvil::BaseDevice* get_device() const + const SwapchainCreateInfo* get_create_info_ptr() const { - return m_device_ptr; - } - - /** Returns flags used to create the swapchain. */ - const VkSwapchainCreateFlagsKHR& get_flags() const - { - return m_flags; + return m_create_info_ptr.get(); } /** Returns height of the swapchain, as specified at creation time */ @@ -122,18 +83,6 @@ namespace Anvil return m_size.height; } - /** Returns format used by swapchain images */ - VkFormat get_image_format() const - { - return m_image_format; - } - - /** Returns format used by swapchain image views. */ - VkFormat get_image_view_format() const - { - return m_image_view_format; - } - /** Retrieves an Image instance associated with a swapchain image at index * @param in_n_swapchain_image. * @@ -169,18 +118,6 @@ namespace Anvil return m_last_acquired_image_index; } - /** Tells how many images the swap-chain encapsulates. */ - uint32_t get_n_images() const - { - return m_n_swapchain_images; - } - - /** Retrieves parent rendering surface. */ - const Anvil::RenderingSurface* get_rendering_surface() const - { - return m_parent_surface_ptr; - } - /** Retrieves a pointer to the raw Vulkan swapchain handle. */ const VkSwapchainKHR* get_swapchain_ptr() const { @@ -192,64 +129,53 @@ namespace Anvil return m_swapchain; } - /** Returns width of the swapchain, as specified at creation time */ + /** Returns width of the swapchain. */ uint32_t get_width() const { return m_size.width; } - /** Retrieves a window, to which the swapchain is bound. Note that under certain - * circumstances no window may be assigned. */ - Anvil::Window* get_window() const + /* By default, swapchain instance will transparently destroy the underlying Vulkan swapchain handle, right before + * the window is closed. + * + * There are certain use cases where we want the order to be reversed (ie. the swapchain handle should be destroyed only after + * the window is closed). This behavior can be enabled by calling this function with @param in_value set to false. + */ + void set_should_destroy_swapchain_before_parent_window_closes(const bool& in_value) + { + m_destroy_swapchain_before_parent_window_closes = in_value; + } + + const bool& should_destroy_swapchain_before_parent_window_closes() { - return m_window_ptr; + return m_destroy_swapchain_before_parent_window_closes; } private: /* Private functions */ /* Constructor. Please see create() for specification */ - Swapchain(const Anvil::BaseDevice* in_device_ptr, - Anvil::RenderingSurface* in_parent_surface_ptr, - Anvil::Window* in_window_ptr, - VkFormat in_format, - VkPresentModeKHR in_present_mode, - VkImageUsageFlags in_usage_flags, - uint32_t in_n_images, - VkSwapchainCreateFlagsKHR in_flags, - const ExtensionKHRSwapchainEntrypoints& in_khr_swapchain_entrypoints, - bool in_mt_safe); + Swapchain(Anvil::SwapchainCreateInfoUniquePtr in_create_info_ptr); Swapchain (const Swapchain&); Swapchain& operator=(const Swapchain&); void destroy_swapchain(); - void init (); + bool init (); void on_parent_window_about_to_close(); void on_present_request_issued (Anvil::CallbackArgument* in_callback_raw_ptr); /* Private variables */ - bool m_destroy_swapchain_before_parent_window_closes; - const Anvil::BaseDevice* m_device_ptr; - VkSwapchainCreateFlagsKHR m_flags; - Anvil::FenceUniquePtr m_image_available_fence_ptr; - VkFormat m_image_format; - std::vector m_image_ptrs; - VkFormat m_image_view_format; - std::vector m_image_view_ptrs; - uint32_t m_last_acquired_image_index; - uint32_t m_n_swapchain_images; - Anvil::RenderingSurface* m_parent_surface_ptr; - VkPresentModeKHR m_present_mode; - VkSwapchainKHR m_swapchain; - Anvil::Window* m_window_ptr; - - VkExtent2D m_size; - - VkImageUsageFlagsVariable(m_usage_flags); - - const ExtensionKHRSwapchainEntrypoints m_khr_swapchain_entrypoints; + Anvil::SwapchainCreateInfoUniquePtr m_create_info_ptr; + Anvil::FenceUniquePtr m_image_available_fence_ptr; + std::vector m_image_ptrs; + std::vector m_image_view_ptrs; + uint32_t m_last_acquired_image_index; + VkExtent2D m_size; + VkSwapchainKHR m_swapchain; + + bool m_destroy_swapchain_before_parent_window_closes; volatile uint64_t m_n_acquire_counter; volatile uint32_t m_n_acquire_counter_rounded; diff --git a/src/misc/base_pipeline_info.cpp b/src/misc/base_pipeline_create_info.cpp similarity index 52% rename from src/misc/base_pipeline_info.cpp rename to src/misc/base_pipeline_create_info.cpp index 9527dcc7..f7990540 100644 --- a/src/misc/base_pipeline_info.cpp +++ b/src/misc/base_pipeline_create_info.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -19,26 +19,26 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // -#include "misc/base_pipeline_info.h" -#include "misc/descriptor_set_info.h" +#include "misc/base_pipeline_create_info.h" +#include "misc/descriptor_set_create_info.h" #include "wrappers/descriptor_set_group.h" #include -Anvil::BasePipelineInfo::BasePipelineInfo() +Anvil::BasePipelineCreateInfo::BasePipelineCreateInfo() { /* Stub */ } -Anvil::BasePipelineInfo::~BasePipelineInfo() +Anvil::BasePipelineCreateInfo::~BasePipelineCreateInfo() { /* Stub */ } -bool Anvil::BasePipelineInfo::add_specialization_constant(Anvil::ShaderStage in_shader_stage, - uint32_t in_constant_id, - uint32_t in_n_data_bytes, - const void* in_data_ptr) +bool Anvil::BasePipelineCreateInfo::add_specialization_constant(Anvil::ShaderStage in_shader_stage, + uint32_t in_constant_id, + uint32_t in_n_data_bytes, + const void* in_data_ptr) { uint32_t data_buffer_size = 0; bool result = false; @@ -84,9 +84,9 @@ bool Anvil::BasePipelineInfo::add_specialization_constant(Anvil::ShaderStage in_ } /* Please see header for specification */ -bool Anvil::BasePipelineInfo::attach_push_constant_range(uint32_t in_offset, - uint32_t in_size, - VkShaderStageFlags in_stages) +bool Anvil::BasePipelineCreateInfo::attach_push_constant_range(uint32_t in_offset, + uint32_t in_size, + VkShaderStageFlags in_stages) { bool result = false; @@ -113,31 +113,31 @@ bool Anvil::BasePipelineInfo::attach_push_constant_range(uint32_t in_o return result; } -void Anvil::BasePipelineInfo::copy_state_from(const BasePipelineInfo* in_src_pipeline_info_ptr) +void Anvil::BasePipelineCreateInfo::copy_state_from(const BasePipelineCreateInfo* in_src_pipeline_create_info_ptr) { - m_base_pipeline_id = in_src_pipeline_info_ptr->m_base_pipeline_id; + m_base_pipeline_id = in_src_pipeline_create_info_ptr->m_base_pipeline_id; - for (auto& current_ds_info_item_ptr : in_src_pipeline_info_ptr->m_ds_info_items) + for (auto& current_ds_create_info_item_ptr : in_src_pipeline_create_info_ptr->m_ds_create_info_items) { - m_ds_info_items.push_back( - Anvil::DescriptorSetInfoUniquePtr( - new DescriptorSetInfo(*current_ds_info_item_ptr.get() ) + m_ds_create_info_items.push_back( + Anvil::DescriptorSetCreateInfoUniquePtr( + new DescriptorSetCreateInfo(*current_ds_create_info_item_ptr.get() ) ) ); } - m_push_constant_ranges = in_src_pipeline_info_ptr->m_push_constant_ranges; + m_push_constant_ranges = in_src_pipeline_create_info_ptr->m_push_constant_ranges; - m_allow_derivatives = in_src_pipeline_info_ptr->m_allow_derivatives; - m_disable_optimizations = in_src_pipeline_info_ptr->m_disable_optimizations; - m_shader_stages = in_src_pipeline_info_ptr->m_shader_stages; + m_allow_derivatives = in_src_pipeline_create_info_ptr->m_allow_derivatives; + m_disable_optimizations = in_src_pipeline_create_info_ptr->m_disable_optimizations; + m_shader_stages = in_src_pipeline_create_info_ptr->m_shader_stages; - m_specialization_constants_data_buffer = in_src_pipeline_info_ptr->m_specialization_constants_data_buffer; - m_specialization_constants_map = in_src_pipeline_info_ptr->m_specialization_constants_map; + m_specialization_constants_data_buffer = in_src_pipeline_create_info_ptr->m_specialization_constants_data_buffer; + m_specialization_constants_map = in_src_pipeline_create_info_ptr->m_specialization_constants_map; } -bool Anvil::BasePipelineInfo::get_shader_stage_properties(Anvil::ShaderStage in_shader_stage, - const ShaderModuleStageEntryPoint** out_opt_result_ptr_ptr) const +bool Anvil::BasePipelineCreateInfo::get_shader_stage_properties(Anvil::ShaderStage in_shader_stage, + const ShaderModuleStageEntryPoint** out_opt_result_ptr_ptr) const { bool result = false; auto shader_stage_iterator = m_shader_stages.find(in_shader_stage); @@ -155,9 +155,9 @@ bool Anvil::BasePipelineInfo::get_shader_stage_properties(Anvil::ShaderStage return result; } -bool Anvil::BasePipelineInfo::get_specialization_constants(Anvil::ShaderStage in_shader_stage, - const SpecializationConstants** out_opt_spec_constants_ptr, - const unsigned char** out_opt_spec_constants_data_buffer_ptr) const +bool Anvil::BasePipelineCreateInfo::get_specialization_constants(Anvil::ShaderStage in_shader_stage, + const SpecializationConstants** out_opt_spec_constants_ptr, + const unsigned char** out_opt_spec_constants_data_buffer_ptr) const { bool result = false; const auto sc_map_iterator = m_specialization_constants_map.find(in_shader_stage); @@ -181,28 +181,28 @@ bool Anvil::BasePipelineInfo::get_specialization_constants(Anvil::ShaderStage return result; } -void Anvil::BasePipelineInfo::init_derivative_pipeline_info(bool in_disable_optimizations, - bool in_allow_derivatives, - uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, - Anvil::PipelineID in_base_pipeline_id, - const std::vector* in_opt_ds_info_vec_ptr) +void Anvil::BasePipelineCreateInfo::init_derivative(bool in_disable_optimizations, + bool in_allow_derivatives, + uint32_t in_n_shader_module_stage_entrypoints, + const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, + Anvil::PipelineID in_base_pipeline_id, + const std::vector* in_opt_ds_create_info_vec_ptr) { m_allow_derivatives = in_allow_derivatives; m_base_pipeline_id = in_base_pipeline_id; m_disable_optimizations = in_disable_optimizations; m_is_proxy = false; - if (in_opt_ds_info_vec_ptr != nullptr) + if (in_opt_ds_create_info_vec_ptr != nullptr) { - set_descriptor_set_info(in_opt_ds_info_vec_ptr); + set_descriptor_set_create_info(in_opt_ds_create_info_vec_ptr); } init_shader_modules(in_n_shader_module_stage_entrypoints, in_shader_module_stage_entrypoint_ptrs); } -void Anvil::BasePipelineInfo::init_proxy_pipeline_info() +void Anvil::BasePipelineCreateInfo::init_proxy() { m_allow_derivatives = false; m_base_pipeline_id = UINT32_MAX; @@ -210,28 +210,28 @@ void Anvil::BasePipelineInfo::init_proxy_pipeline_info() m_is_proxy = true; } -void Anvil::BasePipelineInfo::init_regular_pipeline_info(bool in_disable_optimizations, - bool in_allow_derivatives, - uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, - const std::vector* in_opt_ds_info_vec_ptr) +void Anvil::BasePipelineCreateInfo::init_regular(bool in_disable_optimizations, + bool in_allow_derivatives, + uint32_t in_n_shader_module_stage_entrypoints, + const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, + const std::vector* in_opt_ds_create_info_vec_ptr) { m_allow_derivatives = in_allow_derivatives; m_base_pipeline_id = UINT32_MAX; m_disable_optimizations = in_disable_optimizations; m_is_proxy = false; - if (in_opt_ds_info_vec_ptr != nullptr) + if (in_opt_ds_create_info_vec_ptr != nullptr) { - set_descriptor_set_info(in_opt_ds_info_vec_ptr); + set_descriptor_set_create_info(in_opt_ds_create_info_vec_ptr); } init_shader_modules(in_n_shader_module_stage_entrypoints, in_shader_module_stage_entrypoint_ptrs); } -void Anvil::BasePipelineInfo::init_shader_modules(uint32_t in_n_shader_module_stage_entrypoints, - const Anvil::ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs) +void Anvil::BasePipelineCreateInfo::init_shader_modules(uint32_t in_n_shader_module_stage_entrypoints, + const Anvil::ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs) { for (uint32_t n_shader_module_stage_entrypoint = 0; n_shader_module_stage_entrypoint < in_n_shader_module_stage_entrypoints; @@ -249,28 +249,28 @@ void Anvil::BasePipelineInfo::init_shader_modules(uint32_t } } -void Anvil::BasePipelineInfo::set_descriptor_set_info(const std::vector* in_ds_info_vec_ptr) +void Anvil::BasePipelineCreateInfo::set_descriptor_set_create_info(const std::vector* in_ds_create_info_vec_ptr) { - const uint32_t n_descriptor_sets = static_cast(in_ds_info_vec_ptr->size() ); + const uint32_t n_descriptor_sets = static_cast(in_ds_create_info_vec_ptr->size() ); for (uint32_t n_descriptor_set = 0; n_descriptor_set < n_descriptor_sets; ++n_descriptor_set) { - const auto reference_ds_info_ptr = in_ds_info_vec_ptr->at(n_descriptor_set); + const auto reference_ds_create_info_ptr = in_ds_create_info_vec_ptr->at(n_descriptor_set); - if (reference_ds_info_ptr == nullptr) + if (reference_ds_create_info_ptr == nullptr) { - m_ds_info_items.push_back( - Anvil::DescriptorSetInfoUniquePtr() + m_ds_create_info_items.push_back( + Anvil::DescriptorSetCreateInfoUniquePtr() ); continue; } - m_ds_info_items.push_back( - Anvil::DescriptorSetInfoUniquePtr( - new Anvil::DescriptorSetInfo(*reference_ds_info_ptr) + m_ds_create_info_items.push_back( + Anvil::DescriptorSetCreateInfoUniquePtr( + new Anvil::DescriptorSetCreateInfo(*reference_ds_create_info_ptr) ) ); } diff --git a/src/misc/base_pipeline_manager.cpp b/src/misc/base_pipeline_manager.cpp index ecc5883b..3b4c7f62 100644 --- a/src/misc/base_pipeline_manager.cpp +++ b/src/misc/base_pipeline_manager.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -20,7 +20,7 @@ // THE SOFTWARE. // -#include "misc/base_pipeline_info.h" +#include "misc/base_pipeline_create_info.h" #include "misc/base_pipeline_manager.h" #include "misc/debug.h" #include "wrappers/descriptor_set_group.h" @@ -99,10 +99,10 @@ void Anvil::BasePipelineManager::Pipeline::release_pipeline() /* Please see header for specification */ -bool Anvil::BasePipelineManager::add_pipeline(Anvil::BasePipelineInfoUniquePtr in_pipeline_info_ptr, - PipelineID* out_pipeline_id_ptr) +bool Anvil::BasePipelineManager::add_pipeline(Anvil::BasePipelineCreateInfoUniquePtr in_pipeline_create_info_ptr, + PipelineID* out_pipeline_id_ptr) { - const Anvil::PipelineID base_pipeline_id = in_pipeline_info_ptr->get_base_pipeline_id(); + const Anvil::PipelineID base_pipeline_id = in_pipeline_create_info_ptr->get_base_pipeline_id(); auto callback_arg = Anvil::OnNewPipelineCreatedCallbackData(UINT32_MAX); std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -119,8 +119,8 @@ bool Anvil::BasePipelineManager::add_pipeline(Anvil::BasePipelineInfoUniquePtr i if (base_pipeline_id != UINT32_MAX) { - auto base_pipeline_iterator = m_baked_pipelines.find(base_pipeline_id); - Anvil::BasePipelineInfo* base_pipeline_info_ptr = nullptr; + Anvil::BasePipelineCreateInfo* base_pipeline_create_info_ptr = nullptr; + auto base_pipeline_iterator = m_baked_pipelines.find(base_pipeline_id); if (base_pipeline_iterator == m_baked_pipelines.end() ) { @@ -128,22 +128,22 @@ bool Anvil::BasePipelineManager::add_pipeline(Anvil::BasePipelineInfoUniquePtr i if (base_pipeline_iterator != m_outstanding_pipelines.end() ) { - base_pipeline_info_ptr = base_pipeline_iterator->second->pipeline_info_ptr.get(); + base_pipeline_create_info_ptr = base_pipeline_iterator->second->pipeline_create_info_ptr.get(); } } else { - base_pipeline_info_ptr = base_pipeline_iterator->second->pipeline_info_ptr.get(); + base_pipeline_create_info_ptr = base_pipeline_iterator->second->pipeline_create_info_ptr.get(); } - if (base_pipeline_info_ptr != nullptr) + if (base_pipeline_create_info_ptr != nullptr) { - anvil_assert(base_pipeline_info_ptr->allows_derivatives() ); + anvil_assert(base_pipeline_create_info_ptr->allows_derivatives() ); } else { /* Base pipeline ID is invalid */ - anvil_assert(base_pipeline_info_ptr != nullptr); + anvil_assert(base_pipeline_create_info_ptr != nullptr); goto end; } @@ -152,15 +152,15 @@ bool Anvil::BasePipelineManager::add_pipeline(Anvil::BasePipelineInfoUniquePtr i /* Create & store the new descriptor */ new_pipeline_id = (m_pipeline_counter.fetch_add(1) ); - /* NOTE: in_pipeline_info_ptr becomes NULL after the call below */ + /* NOTE: in_pipeline_create_info_ptr becomes NULL after the call below */ new_pipeline_ptr.reset( new Pipeline( m_device_ptr, - std::move(in_pipeline_info_ptr), + std::move(in_pipeline_create_info_ptr), is_mt_safe() ) ); - if (new_pipeline_ptr->pipeline_info_ptr->is_proxy() ) + if (new_pipeline_ptr->pipeline_create_info_ptr->is_proxy() ) { m_baked_pipelines[new_pipeline_id] = std::move(new_pipeline_ptr); } @@ -296,9 +296,9 @@ VkPipeline Anvil::BasePipelineManager::get_pipeline(PipelineID in_pipeline_id) pipeline_ptr = pipeline_iterator->second.get(); - if (pipeline_ptr->pipeline_info_ptr->is_proxy() ) + if (pipeline_ptr->pipeline_create_info_ptr->is_proxy() ) { - anvil_assert(!pipeline_ptr->pipeline_info_ptr->is_proxy() ); + anvil_assert(!pipeline_ptr->pipeline_create_info_ptr->is_proxy() ); goto end; } @@ -309,13 +309,13 @@ VkPipeline Anvil::BasePipelineManager::get_pipeline(PipelineID in_pipeline_id) return result; } -const Anvil::BasePipelineInfo* Anvil::BasePipelineManager::get_pipeline_info(PipelineID in_pipeline_id) const +const Anvil::BasePipelineCreateInfo* Anvil::BasePipelineManager::get_pipeline_create_info(PipelineID in_pipeline_id) const { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); Pipelines::const_iterator pipeline_iterator; Pipeline* pipeline_ptr = nullptr; - const Anvil::BasePipelineInfo* result_ptr = nullptr; + const Anvil::BasePipelineCreateInfo* result_ptr = nullptr; if (mutex_ptr != nullptr) { @@ -339,7 +339,7 @@ const Anvil::BasePipelineInfo* Anvil::BasePipelineManager::get_pipeline_info(Pip } pipeline_ptr = pipeline_iterator->second.get(); - result_ptr = pipeline_ptr->pipeline_info_ptr.get(); + result_ptr = pipeline_ptr->pipeline_create_info_ptr.get(); end: return result_ptr; @@ -377,17 +377,17 @@ Anvil::PipelineLayout* Anvil::BasePipelineManager::get_pipeline_layout(PipelineI pipeline_ptr = pipeline_iterator->second.get(); - if (pipeline_ptr->pipeline_info_ptr->is_proxy() ) + if (pipeline_ptr->pipeline_create_info_ptr->is_proxy() ) { - anvil_assert(!pipeline_ptr->pipeline_info_ptr->is_proxy() ); + anvil_assert(!pipeline_ptr->pipeline_create_info_ptr->is_proxy() ); goto end; } if (pipeline_ptr->layout_ptr == nullptr) { - if (!m_pipeline_layout_manager_ptr->get_layout(pipeline_ptr->pipeline_info_ptr->get_ds_info_items (), - pipeline_ptr->pipeline_info_ptr->get_push_constant_ranges(), + if (!m_pipeline_layout_manager_ptr->get_layout(pipeline_ptr->pipeline_create_info_ptr->get_ds_create_info_items(), + pipeline_ptr->pipeline_create_info_ptr->get_push_constant_ranges(), &pipeline_ptr->layout_ptr) ) { anvil_assert_fail(); diff --git a/src/misc/buffer_create_info.cpp b/src/misc/buffer_create_info.cpp new file mode 100644 index 00000000..141d8017 --- /dev/null +++ b/src/misc/buffer_create_info.cpp @@ -0,0 +1,220 @@ +// +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#include "misc/buffer_create_info.h" +#include "wrappers/buffer.h" +#include "wrappers/device.h" + + +Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_nonsparse_alloc(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + VkBufferUsageFlags in_usage_flags, + Anvil::MemoryFeatureFlags in_memory_features) +{ + Anvil::BufferCreateInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); + + result_ptr.reset( + new Anvil::BufferCreateInfo(BufferType::NONSPARSE_ALLOC, + in_device_ptr, + in_size, + in_queue_families, + in_sharing_mode, + in_usage_flags, + in_memory_features, + Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + 0, /* in_external_memory_handle_types */ + nullptr) /* in_opt_client_data_ptr */ + ); + + return result_ptr; +} + +Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_nonsparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + VkBufferUsageFlags in_usage_flags) +{ + Anvil::BufferCreateInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); + + result_ptr.reset( + new Anvil::BufferCreateInfo(BufferType::NONSPARSE_NO_ALLOC, + in_device_ptr, + in_size, + in_queue_families, + in_sharing_mode, + in_usage_flags, + 0, /* in_memory_features */ + Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + 0, /* in_external_memory_handle_types */ + nullptr) /* in_opt_client_data_ptr */ + ); + + return result_ptr; +} + +Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_nonsparse_no_alloc_child(Anvil::Buffer* in_parent_nonsparse_buffer_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size) +{ + Anvil::BufferCreateInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); + + result_ptr.reset( + new Anvil::BufferCreateInfo(in_parent_nonsparse_buffer_ptr, + in_start_offset, + in_size) + ); + + return result_ptr; +} + +Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_sparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + VkBufferUsageFlags in_usage_flags, + Anvil::SparseResidencyScope in_residency_scope, + MTSafety in_mt_safety, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) +{ + Anvil::BufferCreateInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); + + result_ptr.reset( + new Anvil::BufferCreateInfo(in_device_ptr, + in_size, + in_queue_families, + in_sharing_mode, + in_usage_flags, + in_residency_scope, + in_mt_safety, + in_external_memory_handle_types) + ); + + return result_ptr; +} + +Anvil::BufferCreateInfo::BufferCreateInfo(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + VkBufferUsageFlags in_usage_flags, + Anvil::SparseResidencyScope in_residency_scope, + MTSafety in_mt_safety, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) + :m_client_data_ptr (nullptr), + m_device_ptr (in_device_ptr), + m_external_memory_handle_types(in_external_memory_handle_types), + m_memory_features (0), + m_mt_safety (in_mt_safety), + m_parent_buffer_ptr (nullptr), + m_queue_families (in_queue_families), + m_residency_scope (in_residency_scope), + m_sharing_mode (in_sharing_mode), + m_size (in_size), + m_start_offset (0), + m_type (BufferType::SPARSE_NO_ALLOC), + m_usage_flags (in_usage_flags) +{ + /* Sanity checks */ + const auto& physical_device_features(in_device_ptr->get_physical_device_features() ); + + if (!physical_device_features.core_vk1_0_features_ptr->sparse_binding) + { + anvil_assert(physical_device_features.core_vk1_0_features_ptr->sparse_binding); + } + + if ((in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED || + in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_NONALIASED) && + !physical_device_features.core_vk1_0_features_ptr->sparse_residency_buffer) + { + anvil_assert((in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED || + in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_NONALIASED) && + physical_device_features.core_vk1_0_features_ptr->sparse_residency_buffer); + } + + if ( in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED && + !physical_device_features.core_vk1_0_features_ptr->sparse_residency_aliased) + { + anvil_assert(in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED && + physical_device_features.core_vk1_0_features_ptr->sparse_residency_aliased); + } +} + +Anvil::BufferCreateInfo::BufferCreateInfo(const Anvil::BufferType& in_buffer_type, + const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + VkBufferUsageFlags in_usage_flags, + MemoryFeatureFlags in_memory_features, + MTSafety in_mt_safety, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types, + const void* in_opt_client_data_ptr) + :m_client_data_ptr (in_opt_client_data_ptr), + m_device_ptr (in_device_ptr), + m_external_memory_handle_types(in_external_memory_handle_types), + m_memory_features (in_memory_features), + m_mt_safety (in_mt_safety), + m_parent_buffer_ptr (nullptr), + m_queue_families (in_queue_families), + m_residency_scope (Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED), + m_sharing_mode (in_sharing_mode), + m_size (in_size), + m_start_offset (0), + m_type (in_buffer_type), + m_usage_flags (in_usage_flags) +{ + if ((in_memory_features & MEMORY_FEATURE_FLAG_MAPPABLE) == 0) + { + anvil_assert((in_memory_features & MEMORY_FEATURE_FLAG_HOST_COHERENT) == 0) + } +} + +Anvil::BufferCreateInfo::BufferCreateInfo(Anvil::Buffer* in_parent_buffer_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size) + :m_client_data_ptr (nullptr), + m_device_ptr (in_parent_buffer_ptr->get_create_info_ptr()->m_device_ptr), + m_external_memory_handle_types(in_parent_buffer_ptr->get_create_info_ptr()->m_external_memory_handle_types), + m_memory_features (in_parent_buffer_ptr->get_create_info_ptr()->m_memory_features), + m_mt_safety (in_parent_buffer_ptr->get_create_info_ptr()->m_mt_safety), + m_parent_buffer_ptr (in_parent_buffer_ptr), + m_queue_families (in_parent_buffer_ptr->get_create_info_ptr()->m_queue_families), + m_residency_scope (in_parent_buffer_ptr->get_create_info_ptr()->m_residency_scope), + m_sharing_mode (in_parent_buffer_ptr->get_create_info_ptr()->m_sharing_mode), + m_size (in_size), + m_start_offset (in_start_offset), + m_type (BufferType::NONSPARSE_NO_ALLOC_CHILD), + m_usage_flags (in_parent_buffer_ptr->get_create_info_ptr()->m_usage_flags) +{ + /* Sanity checks */ + anvil_assert(in_parent_buffer_ptr != nullptr); + anvil_assert(in_size > 0); + + anvil_assert(in_parent_buffer_ptr->get_create_info_ptr()->m_type != Anvil::BufferType::SPARSE_NO_ALLOC); + anvil_assert(in_parent_buffer_ptr->get_memory_block (0 /* in_n_memory_block */) != nullptr); +} diff --git a/src/misc/buffer_view_create_info.cpp b/src/misc/buffer_view_create_info.cpp new file mode 100644 index 00000000..ad29e855 --- /dev/null +++ b/src/misc/buffer_view_create_info.cpp @@ -0,0 +1,59 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#include "misc/buffer_view_create_info.h" + +Anvil::BufferViewCreateInfoUniquePtr Anvil::BufferViewCreateInfo::create(const Anvil::BaseDevice* in_device_ptr, + Anvil::Buffer* in_buffer_ptr, + VkFormat in_format, + VkDeviceSize in_start_offset, + VkDeviceSize in_size) +{ + Anvil::BufferViewCreateInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); + + result_ptr.reset( + new Anvil::BufferViewCreateInfo(in_device_ptr, + in_buffer_ptr, + in_format, + in_start_offset, + in_size, + Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + ); + + return result_ptr; +} + +Anvil::BufferViewCreateInfo::BufferViewCreateInfo(const Anvil::BaseDevice* in_device_ptr, + Anvil::Buffer* in_buffer_ptr, + VkFormat in_format, + VkDeviceSize in_start_offset, + VkDeviceSize in_size, + MTSafety in_mt_safety) + :m_buffer_ptr (in_buffer_ptr), + m_device_ptr (in_device_ptr), + m_format (in_format), + m_mt_safety (in_mt_safety), + m_size (in_size), + m_start_offset(in_start_offset) +{ + /* Stub */ +} \ No newline at end of file diff --git a/src/misc/compute_pipeline_create_info.cpp b/src/misc/compute_pipeline_create_info.cpp new file mode 100644 index 00000000..ef99c6ff --- /dev/null +++ b/src/misc/compute_pipeline_create_info.cpp @@ -0,0 +1,95 @@ +// +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#include "misc/compute_pipeline_create_info.h" + +Anvil::ComputePipelineCreateInfo::ComputePipelineCreateInfo() +{ + /* Stub */ +} + +Anvil::ComputePipelineCreateInfo::~ComputePipelineCreateInfo() +{ + /* Stub */ +} + +Anvil::ComputePipelineCreateInfoUniquePtr Anvil::ComputePipelineCreateInfo::create_derivative(bool in_disable_optimizations, + bool in_allow_derivatives, + const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info, + Anvil::PipelineID in_base_pipeline_id) +{ + Anvil::ComputePipelineCreateInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); + + result_ptr.reset( + new ComputePipelineCreateInfo() + ); + + if (result_ptr != nullptr) + { + result_ptr->init_derivative(in_disable_optimizations, + in_allow_derivatives, + 1, /* in_n_shader_module_stage_entrypoints */ + &in_compute_shader_stage_entrypoint_info, + in_base_pipeline_id); + } + + return result_ptr; +} + +Anvil::ComputePipelineCreateInfoUniquePtr Anvil::ComputePipelineCreateInfo::create_proxy() +{ + Anvil::ComputePipelineCreateInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); + + result_ptr.reset( + new ComputePipelineCreateInfo() + ); + + if (result_ptr != nullptr) + { + result_ptr->init_proxy(); + } + + return result_ptr; +} + +Anvil::ComputePipelineCreateInfoUniquePtr Anvil::ComputePipelineCreateInfo::create_regular(bool in_disable_optimizations, + bool in_allow_derivatives, + const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info) +{ + Anvil::ComputePipelineCreateInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); + + result_ptr.reset( + new ComputePipelineCreateInfo() + ); + + if (result_ptr != nullptr) + { + result_ptr->init_regular(in_disable_optimizations, + in_allow_derivatives, + 1, /* in_n_shader_module_stage_entrypoints */ + &in_compute_shader_stage_entrypoint_info); + } + + return result_ptr; +} \ No newline at end of file diff --git a/src/misc/compute_pipeline_info.cpp b/src/misc/compute_pipeline_info.cpp deleted file mode 100644 index 8f3a6750..00000000 --- a/src/misc/compute_pipeline_info.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -#include "misc/compute_pipeline_info.h" - -Anvil::ComputePipelineInfo::ComputePipelineInfo() -{ - /* Stub */ -} - -Anvil::ComputePipelineInfo::~ComputePipelineInfo() -{ - /* Stub */ -} - -Anvil::ComputePipelineInfoUniquePtr Anvil::ComputePipelineInfo::create_derivative_pipeline_info(bool in_disable_optimizations, - bool in_allow_derivatives, - const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info, - Anvil::PipelineID in_base_pipeline_id) -{ - Anvil::ComputePipelineInfoUniquePtr result_ptr(nullptr, - std::default_delete() ); - - result_ptr.reset( - new ComputePipelineInfo() - ); - - if (result_ptr != nullptr) - { - result_ptr->init_derivative_pipeline_info(in_disable_optimizations, - in_allow_derivatives, - 1, /* in_n_shader_module_stage_entrypoints */ - &in_compute_shader_stage_entrypoint_info, - in_base_pipeline_id); - } - - return result_ptr; -} - -Anvil::ComputePipelineInfoUniquePtr Anvil::ComputePipelineInfo::create_proxy_pipeline_info() -{ - Anvil::ComputePipelineInfoUniquePtr result_ptr(nullptr, - std::default_delete() ); - - result_ptr.reset( - new ComputePipelineInfo() - ); - - if (result_ptr != nullptr) - { - result_ptr->init_proxy_pipeline_info(); - } - - return result_ptr; -} - -Anvil::ComputePipelineInfoUniquePtr Anvil::ComputePipelineInfo::create_regular_pipeline_info(bool in_disable_optimizations, - bool in_allow_derivatives, - const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info) -{ - Anvil::ComputePipelineInfoUniquePtr result_ptr(nullptr, - std::default_delete() ); - - result_ptr.reset( - new ComputePipelineInfo() - ); - - if (result_ptr != nullptr) - { - result_ptr->init_regular_pipeline_info(in_disable_optimizations, - in_allow_derivatives, - 1, /* in_n_shader_module_stage_entrypoints */ - &in_compute_shader_stage_entrypoint_info); - } - - return result_ptr; -} \ No newline at end of file diff --git a/src/misc/debug.cpp b/src/misc/debug.cpp index 827bf48e..7a3f1605 100644 --- a/src/misc/debug.cpp +++ b/src/misc/debug.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/misc/debug_marker.cpp b/src/misc/debug_marker.cpp index e9c06c05..6a1e98eb 100644 --- a/src/misc/debug_marker.cpp +++ b/src/misc/debug_marker.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -32,7 +32,7 @@ Anvil::DebugMarkerSupportProviderWorker::DebugMarkerSupportProviderWorker(const m_vk_object_handle(VK_NULL_HANDLE), m_vk_object_type (in_vk_object_type) { - m_is_ext_debug_marker_available = m_device_ptr->is_ext_debug_marker_extension_enabled(); + m_is_ext_debug_marker_available = m_device_ptr->get_extension_info()->ext_debug_marker(); m_object_tag_name = 0; } diff --git a/src/misc/descriptor_set_info.cpp b/src/misc/descriptor_set_create_info.cpp similarity index 57% rename from src/misc/descriptor_set_info.cpp rename to src/misc/descriptor_set_create_info.cpp index 4c34a054..f961d210 100644 --- a/src/misc/descriptor_set_info.cpp +++ b/src/misc/descriptor_set_create_info.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -20,29 +20,32 @@ // THE SOFTWARE. // -#include "misc/descriptor_set_info.h" +#include "misc/descriptor_set_create_info.h" #include "misc/struct_chainer.h" #include "wrappers/device.h" #include "wrappers/sampler.h" /** Please see header for specification */ -Anvil::DescriptorSetInfo::DescriptorSetInfo() +Anvil::DescriptorSetCreateInfo::DescriptorSetCreateInfo() + :m_n_variable_descriptor_count_binding (UINT32_MAX), + m_variable_descriptor_count_binding_size(0) { /* Stub */ } /** Please see header for specification */ -Anvil::DescriptorSetInfo::~DescriptorSetInfo() +Anvil::DescriptorSetCreateInfo::~DescriptorSetCreateInfo() { /* Stub */ } /** Please see header for specification */ -bool Anvil::DescriptorSetInfo::add_binding(uint32_t in_binding_index, - VkDescriptorType in_descriptor_type, - uint32_t in_descriptor_array_size, - VkShaderStageFlags in_stage_flags, - const Anvil::Sampler* const* in_immutable_sampler_ptrs) +bool Anvil::DescriptorSetCreateInfo::add_binding(uint32_t in_binding_index, + VkDescriptorType in_descriptor_type, + uint32_t in_descriptor_array_size, + VkShaderStageFlags in_stage_flags, + const Anvil::DescriptorBindingFlags& in_flags, + const Anvil::Sampler* const* in_immutable_sampler_ptrs) { bool result = false; @@ -66,12 +69,27 @@ bool Anvil::DescriptorSetInfo::add_binding(uint32_t in_bindi } } + if (in_flags & Anvil::DESCRIPTOR_BINDING_FLAG_VARIABLE_DESCRIPTOR_COUNT_BIT) + { + if (m_n_variable_descriptor_count_binding != UINT32_MAX) + { + /* If this assertion check fails, you're attempting to add more than 1 variable descriptor count binding + * which is illegal! */ + anvil_assert(m_n_variable_descriptor_count_binding == UINT32_MAX); + + goto end; + } + + m_n_variable_descriptor_count_binding = in_binding_index; + } + /* Add a new binding entry and mark the layout as dirty, so that it is re-baked next time * the user calls the getter func */ m_bindings[in_binding_index] = Binding(in_descriptor_array_size, in_descriptor_type, in_stage_flags, - in_immutable_sampler_ptrs); + in_immutable_sampler_ptrs, + in_flags); result = true; end: @@ -79,29 +97,28 @@ bool Anvil::DescriptorSetInfo::add_binding(uint32_t in_bindi } /** Please see header for specification */ -Anvil::DescriptorSetInfoUniquePtr Anvil::DescriptorSetInfo::create() +Anvil::DescriptorSetCreateInfoUniquePtr Anvil::DescriptorSetCreateInfo::create() { - Anvil::DescriptorSetInfoUniquePtr result_ptr(nullptr, - std::default_delete() ); + Anvil::DescriptorSetCreateInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( - new Anvil::DescriptorSetInfo() + new Anvil::DescriptorSetCreateInfo() ); return result_ptr; } /** Please see header for specification */ -std::unique_ptr Anvil::DescriptorSetInfo::create_descriptor_set_layout_create_info(const Anvil::BaseDevice* in_device_ptr) const +std::unique_ptr Anvil::DescriptorSetCreateInfo::create_descriptor_set_layout_create_info(const Anvil::BaseDevice* in_device_ptr) const { - uint32_t n_binding = 0; - uint32_t n_bindings_defined = 0; - uint32_t n_samplers_defined = 0; + uint32_t n_binding = 0; + uint32_t n_bindings_defined = 0; + uint32_t n_samplers_defined = 0; std::unique_ptr result_ptr; + bool should_chain_binding_flags_struct = false; Anvil::StructChainer struct_chainer; - ANVIL_REDUNDANT_ARGUMENT_CONST(in_device_ptr); - result_ptr.reset( new Anvil::DescriptorSetLayoutCreateInfoContainer() ); @@ -160,6 +177,7 @@ std::unique_ptr Anvil::Descriptor ++binding_iterator, ++n_binding) { const auto& binding_data = binding_iterator->second; + VkDescriptorBindingFlagsEXT binding_flags = 0; const BindingIndex& binding_index = binding_iterator->first; VkDescriptorSetLayoutBinding& binding_vk = result_ptr->binding_info_items.at(n_binding); @@ -193,6 +211,33 @@ std::unique_ptr Anvil::Descriptor { binding_vk.pImmutableSamplers = nullptr; } + + if (binding_iterator->second.flags & Anvil::DESCRIPTOR_BINDING_FLAG_UPDATE_AFTER_BIND_BIT) + { + binding_flags |= VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT; + create_info.flags |= VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT; + should_chain_binding_flags_struct = true; + } + + if (binding_iterator->second.flags & Anvil::DESCRIPTOR_BINDING_FLAG_UPDATE_UNUSED_WHILE_PENDING_BIT) + { + binding_flags |= VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT; + should_chain_binding_flags_struct = true; + } + + if (binding_iterator->second.flags & Anvil::DESCRIPTOR_BINDING_FLAG_PARTIALLY_BOUND_BIT) + { + binding_flags |= VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT; + should_chain_binding_flags_struct = true; + } + + if (binding_iterator->second.flags & Anvil::DESCRIPTOR_BINDING_FLAG_VARIABLE_DESCRIPTOR_COUNT_BIT) + { + binding_flags |= VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT; + should_chain_binding_flags_struct = true; + } + + result_ptr->binding_flags_vec.push_back(binding_flags); } } @@ -208,6 +253,32 @@ std::unique_ptr Anvil::Descriptor struct_chainer.append_struct(create_info); } + if (should_chain_binding_flags_struct) + { + VkDescriptorSetLayoutBindingFlagsCreateInfoEXT binding_flags_struct; + + if (!in_device_ptr->get_extension_info()->ext_descriptor_indexing() ) + { + /* The bindings have been assigned flags which are only available on implementations + * that report support for VK_EXT_descriptor_indexing extension! + */ + anvil_assert(in_device_ptr->get_extension_info()->ext_descriptor_indexing() ); + + result_ptr.reset(); + goto end; + } + + anvil_assert(result_ptr->binding_flags_vec.size() > 0); + anvil_assert(result_ptr->binding_flags_vec.size() == struct_chainer.get_root_struct()->bindingCount); + + binding_flags_struct.bindingCount = static_cast(result_ptr->binding_flags_vec.size() ); + binding_flags_struct.pBindingFlags = &result_ptr->binding_flags_vec.at(0); + binding_flags_struct.pNext = nullptr; + binding_flags_struct.sType = static_cast(VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT); + + struct_chainer.append_struct(binding_flags_struct); + } + result_ptr->struct_chain_ptr = struct_chainer.create_chain(); end: @@ -215,11 +286,12 @@ std::unique_ptr Anvil::Descriptor } /** Please see header for specification */ -bool Anvil::DescriptorSetInfo::get_binding_properties_by_binding_index(uint32_t in_binding_index, - VkDescriptorType* out_opt_descriptor_type_ptr, - uint32_t* out_opt_descriptor_array_size_ptr, - VkShaderStageFlags* out_opt_stage_flags_ptr, - bool* out_opt_immutable_samplers_enabled_ptr) const +bool Anvil::DescriptorSetCreateInfo::get_binding_properties_by_binding_index(uint32_t in_binding_index, + VkDescriptorType* out_opt_descriptor_type_ptr, + uint32_t* out_opt_descriptor_array_size_ptr, + VkShaderStageFlags* out_opt_stage_flags_ptr, + bool* out_opt_immutable_samplers_enabled_ptr, + Anvil::DescriptorBindingFlags* out_opt_flags_ptr) const { auto binding_iterator = m_bindings.find(in_binding_index); bool result = false; @@ -249,6 +321,11 @@ bool Anvil::DescriptorSetInfo::get_binding_properties_by_binding_index(uint32_t *out_opt_stage_flags_ptr = binding_iterator->second.stage_flags; } + if (out_opt_flags_ptr != nullptr) + { + *out_opt_flags_ptr = binding_iterator->second.flags; + } + result = true; end: @@ -256,12 +333,13 @@ bool Anvil::DescriptorSetInfo::get_binding_properties_by_binding_index(uint32_t } /** Please see header for specification */ -bool Anvil::DescriptorSetInfo::get_binding_properties_by_index_number(uint32_t in_n_binding, - uint32_t* out_opt_binding_index_ptr, - VkDescriptorType* out_opt_descriptor_type_ptr, - uint32_t* out_opt_descriptor_array_size_ptr, - VkShaderStageFlags* out_opt_stage_flags_ptr, - bool* out_opt_immutable_samplers_enabled_ptr) const +bool Anvil::DescriptorSetCreateInfo::get_binding_properties_by_index_number(uint32_t in_n_binding, + uint32_t* out_opt_binding_index_ptr, + VkDescriptorType* out_opt_descriptor_type_ptr, + uint32_t* out_opt_descriptor_array_size_ptr, + VkShaderStageFlags* out_opt_stage_flags_ptr, + bool* out_opt_immutable_samplers_enabled_ptr, + Anvil::DescriptorBindingFlags* out_opt_flags_ptr) const { auto binding_iterator = m_bindings.begin(); bool result = false; @@ -305,6 +383,11 @@ bool Anvil::DescriptorSetInfo::get_binding_properties_by_index_number(uint32_t *out_opt_stage_flags_ptr = binding_iterator->second.stage_flags; } + if (out_opt_flags_ptr != nullptr) + { + *out_opt_flags_ptr = binding_iterator->second.flags; + } + result = true; } @@ -312,8 +395,30 @@ bool Anvil::DescriptorSetInfo::get_binding_properties_by_index_number(uint32_t return result; } +bool Anvil::DescriptorSetCreateInfo::set_binding_variable_descriptor_count(const uint32_t& in_count) +{ + uint32_t binding_index = UINT32_MAX; + bool result = false; + + if (!contains_variable_descriptor_count_binding(&binding_index) ) + { + /* This descriptor set info instance does not define a variable descriptor count binding! */ + anvil_assert_fail(); + + goto end; + } + + m_variable_descriptor_count_binding_size = in_count; + result = true; + +end: + return result; +} + /** Please see header for specification */ -bool Anvil::DescriptorSetInfo::operator==(const Anvil::DescriptorSetInfo& in_ds) const +bool Anvil::DescriptorSetCreateInfo::operator==(const Anvil::DescriptorSetCreateInfo& in_ds) const { - return (m_bindings == in_ds.m_bindings); + return (m_bindings == in_ds.m_bindings && + m_n_variable_descriptor_count_binding == in_ds.m_n_variable_descriptor_count_binding && + m_variable_descriptor_count_binding_size == in_ds.m_variable_descriptor_count_binding_size); } \ No newline at end of file diff --git a/src/misc/dummy_window.cpp b/src/misc/dummy_window.cpp index c2a96b3e..a924feda 100644 --- a/src/misc/dummy_window.cpp +++ b/src/misc/dummy_window.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -19,8 +19,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // +#include "misc/buffer_create_info.h" #include "misc/dummy_window.h" +#include "misc/image_create_info.h" #include "misc/io.h" +#include "misc/swapchain_create_info.h" #include "wrappers/buffer.h" #include "wrappers/command_buffer.h" #include "wrappers/command_pool.h" @@ -162,10 +165,10 @@ Anvil::DummyWindowWithPNGSnapshots::DummyWindowWithPNGSnapshots(const std::strin /** Please see header for specification */ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_image_raw_r8g8b8a8_unorm_data(Anvil::Image* in_swapchain_image_ptr) { - const Anvil::BaseDevice* device_ptr (m_swapchain_ptr->get_device() ); + const Anvil::BaseDevice* device_ptr (m_swapchain_ptr->get_create_info_ptr()->get_device() ); std::unique_ptr result_ptr; - VkFormat swapchain_image_format (in_swapchain_image_ptr->get_image_format () ); - const VkImageSubresourceRange swapchain_image_subresource_range(in_swapchain_image_ptr->get_subresource_range() ); + VkFormat swapchain_image_format (in_swapchain_image_ptr->get_create_info_ptr()->get_format() ); + const VkImageSubresourceRange swapchain_image_subresource_range(in_swapchain_image_ptr->get_subresource_range () ); /* Sanity checks .. */ ANVIL_REDUNDANT_VARIABLE(swapchain_image_format); @@ -189,38 +192,46 @@ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_ima result_ptr.reset(new unsigned char[raw_image_size]); - raw_image_buffer_ptr = Anvil::Buffer::create_nonsparse(device_ptr, - raw_image_size, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_TRANSFER_DST_BIT, - Anvil::MEMORY_FEATURE_FLAG_MAPPABLE, - nullptr, /* opt_client_data */ - MT_SAFETY_DISABLED); + { + auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(device_ptr, + raw_image_size, + Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_EXCLUSIVE, + VK_BUFFER_USAGE_TRANSFER_DST_BIT, + Anvil::MEMORY_FEATURE_FLAG_MAPPABLE); + + create_info_ptr->set_mt_safety(MT_SAFETY_DISABLED); + + raw_image_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); + } /* 2. Create the intermediate image */ VkImageBlit intermediate_image_blit; ImageUniquePtr intermediate_image_ptr; - intermediate_image_ptr = Anvil::Image::create_nonsparse(device_ptr, - VK_IMAGE_TYPE_2D, - VK_FORMAT_R8G8B8A8_UNORM, - VK_IMAGE_TILING_OPTIMAL, - VK_IMAGE_USAGE_TRANSFER_SRC_BIT | - VK_IMAGE_USAGE_TRANSFER_DST_BIT, - swapchain_image_width, - swapchain_image_height, - 1, /* in_base_mipmap_depth */ - 1, /* in_n_layers */ - VK_SAMPLE_COUNT_1_BIT, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - false, /* in_use_full_mipmap_chain */ - 0, /* in_memory_features */ - 0, /* in_create_flags */ - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, - nullptr, /* in_ mipmaps_ptr */ - MT_SAFETY_DISABLED); + { + auto create_info_ptr = Anvil::ImageCreateInfo::create_nonsparse_alloc(device_ptr, + VK_IMAGE_TYPE_2D, + VK_FORMAT_R8G8B8A8_UNORM, + VK_IMAGE_TILING_OPTIMAL, + VK_IMAGE_USAGE_TRANSFER_SRC_BIT | + VK_IMAGE_USAGE_TRANSFER_DST_BIT, + swapchain_image_width, + swapchain_image_height, + 1, /* in_base_mipmap_depth */ + 1, /* in_n_layers */ + VK_SAMPLE_COUNT_1_BIT, + Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_EXCLUSIVE, + false, /* in_use_full_mipmap_chain */ + 0, /* in_memory_features */ + 0, /* in_create_flags */ + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL); + + create_info_ptr->set_mt_safety(MT_SAFETY_DISABLED); + + intermediate_image_ptr = Anvil::Image::create(std::move(create_info_ptr) ); + } /* 3. Set up the command buffer */ auto command_buffer_ptr = Anvil::PrimaryCommandBufferUniquePtr(); diff --git a/src/misc/event_create_info.cpp b/src/misc/event_create_info.cpp new file mode 100644 index 00000000..b4069474 --- /dev/null +++ b/src/misc/event_create_info.cpp @@ -0,0 +1,43 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#include "misc/event_create_info.h" + +Anvil::EventCreateInfoUniquePtr Anvil::EventCreateInfo::create(const Anvil::BaseDevice* in_device_ptr) +{ + Anvil::EventCreateInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); + + result_ptr.reset( + new Anvil::EventCreateInfo(in_device_ptr, + Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + ); + + return result_ptr; +} + +Anvil::EventCreateInfo::EventCreateInfo(const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety) + :m_device_ptr(in_device_ptr), + m_mt_safety (in_mt_safety) +{ + /* Stub */ +} \ No newline at end of file diff --git a/src/misc/fence_create_info.cpp b/src/misc/fence_create_info.cpp new file mode 100644 index 00000000..106cce8a --- /dev/null +++ b/src/misc/fence_create_info.cpp @@ -0,0 +1,47 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#include "misc/fence_create_info.h" + +Anvil::FenceCreateInfoUniquePtr Anvil::FenceCreateInfo::create(const Anvil::BaseDevice* in_device_ptr, + bool in_create_signalled) +{ + Anvil::FenceCreateInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); + + result_ptr.reset( + new Anvil::FenceCreateInfo(in_device_ptr, + in_create_signalled, + Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + ); + + return result_ptr; +} + +Anvil::FenceCreateInfo::FenceCreateInfo(const Anvil::BaseDevice* in_device_ptr, + bool in_create_signalled, + MTSafety in_mt_safety) + :m_create_signalled(in_create_signalled), + m_device_ptr (in_device_ptr), + m_mt_safety (in_mt_safety) +{ + /* Stub */ +} \ No newline at end of file diff --git a/src/misc/formats.cpp b/src/misc/formats.cpp index 1dd59ea1..fc458758 100644 --- a/src/misc/formats.cpp +++ b/src/misc/formats.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/misc/fp16.cpp b/src/misc/fp16.cpp index 3c1b7cc2..2db33e99 100644 --- a/src/misc/fp16.cpp +++ b/src/misc/fp16.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/misc/framebuffer_create_info.cpp b/src/misc/framebuffer_create_info.cpp new file mode 100644 index 00000000..62dc04cd --- /dev/null +++ b/src/misc/framebuffer_create_info.cpp @@ -0,0 +1,179 @@ +// +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#include "misc/framebuffer_create_info.h" +#include "misc/image_view_create_info.h" +#include "wrappers/image.h" +#include "wrappers/image_view.h" + +Anvil::FramebufferCreateInfo::FramebufferAttachment::FramebufferAttachment(ImageView* in_image_view_ptr) + :image_view_ptr(in_image_view_ptr) +{ + anvil_assert(in_image_view_ptr != nullptr); +} + +Anvil::FramebufferCreateInfo::FramebufferAttachment::~FramebufferAttachment() +{ + /* Stub */ +} + +Anvil::FramebufferCreateInfo::FramebufferAttachment::FramebufferAttachment(const FramebufferAttachment& in) +{ + image_view_ptr = in.image_view_ptr; +} + +Anvil::FramebufferCreateInfo::FramebufferAttachment& Anvil::FramebufferCreateInfo::FramebufferAttachment::operator=(const Anvil::FramebufferCreateInfo::FramebufferAttachment& in) +{ + image_view_ptr = in.image_view_ptr; + + return *this; +} + +Anvil::FramebufferCreateInfo::FramebufferCreateInfo(const Anvil::BaseDevice* in_device_ptr, + const uint32_t& in_width, + const uint32_t& in_height, + const uint32_t& in_n_layers, + MTSafety in_mt_safety) + :m_device_ptr(in_device_ptr), + m_height (in_height), + m_mt_safety (in_mt_safety), + m_n_layers (in_n_layers), + m_width (in_width) +{ + anvil_assert(in_device_ptr != nullptr); + anvil_assert(in_height >= 1); + anvil_assert(in_n_layers >= 1); + anvil_assert(in_width >= 1); +} + +bool Anvil::FramebufferCreateInfo::add_attachment(ImageView* in_image_view_ptr, + FramebufferAttachmentID* out_opt_attachment_id_ptr) +{ + const Anvil::Image* parent_image_ptr; + bool result = false; + uint32_t view_size[3]; + + /* Sanity checks: Input image view must not be nullptr */ + anvil_assert(in_image_view_ptr != nullptr); + + /* Sanity checks: make sure the image views have the same, or larger size than the framebuffer's. */ + parent_image_ptr = in_image_view_ptr->get_create_info_ptr()->get_parent_image(); + + anvil_assert(parent_image_ptr != nullptr); + + if (!parent_image_ptr->get_image_mipmap_size(in_image_view_ptr->get_create_info_ptr()->get_base_mipmap_level(), + view_size + 0, + view_size + 1, + view_size + 2) ) + { + /* Why is the mipmap index invalid? */ + anvil_assert_fail(); + + goto end; + } + + if (view_size[0] < m_width || + view_size[1] < m_height) + { + /* Attachment size is wrong */ + anvil_assert_fail(); + + goto end; + } + + /* Spawn & store a new descriptor for the attachment. */ + if (out_opt_attachment_id_ptr != nullptr) + { + *out_opt_attachment_id_ptr = static_cast(m_attachments.size() ); + } + + m_attachments.push_back(FramebufferAttachment(in_image_view_ptr) ); + + /* All done */ + result = true; + +end: + return result; +} + +Anvil::FramebufferCreateInfoUniquePtr Anvil::FramebufferCreateInfo::create(const Anvil::BaseDevice* in_device_ptr, + const uint32_t& in_width, + const uint32_t& in_height, + const uint32_t& in_n_layers) +{ + Anvil::FramebufferCreateInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); + + result_ptr.reset( + new Anvil::FramebufferCreateInfo(in_device_ptr, + in_width, + in_height, + in_n_layers, + MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + ); + + return result_ptr; +} + +bool Anvil::FramebufferCreateInfo::get_attachment_at_index(uint32_t in_attachment_index, + ImageView** out_image_view_ptr_ptr) const +{ + bool result = false; + + if (m_attachments.size() <= in_attachment_index) + { + goto end; + } + else + { + *out_image_view_ptr_ptr = m_attachments.at(in_attachment_index).image_view_ptr; + result = true; + } + +end: + return result; +} + +bool Anvil::FramebufferCreateInfo::get_attachment_id_for_image_view(ImageView* in_image_view_ptr, + FramebufferAttachmentID* out_attachment_id_ptr) const +{ + bool result = false; + auto attachment_iterator = std::find(m_attachments.cbegin(), + m_attachments.cend(), + in_image_view_ptr); + + if (attachment_iterator != m_attachments.end() ) + { + *out_attachment_id_ptr = static_cast(attachment_iterator - m_attachments.begin() ); + result = true; + } + + return result; +} + +void Anvil::FramebufferCreateInfo::get_size(uint32_t* out_framebuffer_width_ptr, + uint32_t* out_framebuffer_height_ptr, + uint32_t* out_framebuffer_depth_ptr) const +{ + *out_framebuffer_width_ptr = m_width; + *out_framebuffer_height_ptr = m_height; + *out_framebuffer_depth_ptr = m_n_layers; +} diff --git a/src/misc/glsl_to_spirv.cpp b/src/misc/glsl_to_spirv.cpp index ec6939d3..8006749c 100644 --- a/src/misc/glsl_to_spirv.cpp +++ b/src/misc/glsl_to_spirv.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -609,6 +609,7 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() const false, /* forwardCompatible */ (EShMessages) (EShMsgDefault | EShMsgSpvRules | EShMsgVulkanRules) ); + m_debug_info_log = new_shader_ptr->getInfoDebugLog(); m_shader_info_log = new_shader_ptr->getInfoLog(); if (!result) @@ -662,6 +663,7 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() const memcpy(&m_spirv_blob.at(0), &spirv_blob[0], m_spirv_blob.size() ); + } callback(GLSL_SHADER_TO_SPIRV_GENERATOR_CALLBACK_ID_CONVERSION_FINISHED, diff --git a/src/misc/graphics_pipeline_info.cpp b/src/misc/graphics_pipeline_create_info.cpp similarity index 50% rename from src/misc/graphics_pipeline_info.cpp rename to src/misc/graphics_pipeline_create_info.cpp index 4d123ee3..221f5d46 100644 --- a/src/misc/graphics_pipeline_info.cpp +++ b/src/misc/graphics_pipeline_create_info.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -19,36 +19,36 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // -#include "misc/graphics_pipeline_info.h" +#include "misc/graphics_pipeline_create_info.h" -Anvil::GraphicsPipelineInfo::GraphicsPipelineInfo(const RenderPass* in_renderpass_ptr, - SubPassID in_subpass_id) +Anvil::GraphicsPipelineCreateInfo::GraphicsPipelineCreateInfo(const RenderPass* in_renderpass_ptr, + SubPassID in_subpass_id) { - m_alpha_to_coverage_enabled = false; - m_alpha_to_one_enabled = false; - m_depth_bias_clamp = 0.0f; - m_depth_bias_constant_factor = 0.0f; - m_depth_bias_enabled = false; - m_depth_bias_slope_factor = 1.0f; - m_depth_bounds_test_enabled = false; - m_depth_clamp_enabled = false; - m_depth_test_compare_op = VK_COMPARE_OP_ALWAYS; - m_depth_test_enabled = false; - m_depth_writes_enabled = false; - m_enabled_dynamic_states = 0; - m_front_face = VK_FRONT_FACE_COUNTER_CLOCKWISE; - m_logic_op = VK_LOGIC_OP_NO_OP; - m_logic_op_enabled = false; - m_max_depth_bounds = 1.0f; - m_min_depth_bounds = 0.0f; - m_n_dynamic_scissor_boxes = 0; - m_n_dynamic_viewports = 0; - m_n_patch_control_points = 1; - m_primitive_restart_enabled = false; - m_rasterizer_discard_enabled = false; - m_sample_mask_enabled = false; - m_sample_shading_enabled = false; - m_stencil_test_enabled = false; + m_alpha_to_coverage_enabled = false; + m_alpha_to_one_enabled = false; + m_depth_bias_clamp = 0.0f; + m_depth_bias_constant_factor = 0.0f; + m_depth_bias_enabled = false; + m_depth_bias_slope_factor = 1.0f; + m_depth_bounds_test_enabled = false; + m_depth_clamp_enabled = false; + m_depth_test_compare_op = VK_COMPARE_OP_ALWAYS; + m_depth_test_enabled = false; + m_depth_writes_enabled = false; + m_enabled_dynamic_states = 0; + m_front_face = VK_FRONT_FACE_COUNTER_CLOCKWISE; + m_logic_op = VK_LOGIC_OP_NO_OP; + m_logic_op_enabled = false; + m_max_depth_bounds = 1.0f; + m_min_depth_bounds = 0.0f; + m_n_dynamic_scissor_boxes = 0; + m_n_dynamic_viewports = 0; + m_n_patch_control_points = 1; + m_primitive_restart_enabled = false; + m_rasterizer_discard_enabled = false; + m_sample_mask_enabled = false; + m_sample_shading_enabled = false; + m_stencil_test_enabled = false; m_renderpass_ptr = in_renderpass_ptr; m_subpass_id = in_subpass_id; @@ -77,17 +77,17 @@ Anvil::GraphicsPipelineInfo::GraphicsPipelineInfo(const RenderPass* in_renderpas m_sample_mask = ~0u; } -Anvil::GraphicsPipelineInfo::~GraphicsPipelineInfo() +Anvil::GraphicsPipelineCreateInfo::~GraphicsPipelineCreateInfo() { /* Stub */ } -bool Anvil::GraphicsPipelineInfo::add_vertex_attribute(uint32_t in_location, - VkFormat in_format, - uint32_t in_offset_in_bytes, - uint32_t in_stride_in_bytes, - VkVertexInputRate in_step_rate, - uint32_t in_explicit_binding_index) +bool Anvil::GraphicsPipelineCreateInfo::add_vertex_attribute(uint32_t in_location, + VkFormat in_format, + uint32_t in_offset_in_bytes, + uint32_t in_stride_in_bytes, + VkVertexInputRate in_step_rate, + uint32_t in_explicit_binding_index) { bool result = false; @@ -140,97 +140,97 @@ bool Anvil::GraphicsPipelineInfo::add_vertex_attribute(uint32_t in_loc return result; } -bool Anvil::GraphicsPipelineInfo::are_depth_writes_enabled() const +bool Anvil::GraphicsPipelineCreateInfo::are_depth_writes_enabled() const { return m_depth_writes_enabled; } -bool Anvil::GraphicsPipelineInfo::copy_gfx_state_from(const Anvil::GraphicsPipelineInfo* in_src_pipeline_info_ptr) +bool Anvil::GraphicsPipelineCreateInfo::copy_gfx_state_from(const Anvil::GraphicsPipelineCreateInfo* in_src_pipeline_create_info_ptr) { bool result = false; - if (in_src_pipeline_info_ptr == nullptr) + if (in_src_pipeline_create_info_ptr == nullptr) { - anvil_assert(in_src_pipeline_info_ptr != nullptr); + anvil_assert(in_src_pipeline_create_info_ptr != nullptr); goto end; } /* GFX pipeline info-level data */ - m_max_depth_bounds = in_src_pipeline_info_ptr->m_max_depth_bounds; - m_min_depth_bounds = in_src_pipeline_info_ptr->m_min_depth_bounds; - - m_depth_bias_enabled = in_src_pipeline_info_ptr->m_depth_bias_enabled; - m_depth_bias_clamp = in_src_pipeline_info_ptr->m_depth_bias_clamp; - m_depth_bias_constant_factor = in_src_pipeline_info_ptr->m_depth_bias_constant_factor; - m_depth_bias_slope_factor = in_src_pipeline_info_ptr->m_depth_bias_slope_factor; - m_depth_test_enabled = in_src_pipeline_info_ptr->m_depth_test_enabled; - m_depth_test_compare_op = in_src_pipeline_info_ptr->m_depth_test_compare_op; - - m_enabled_dynamic_states = in_src_pipeline_info_ptr->m_enabled_dynamic_states; - - m_alpha_to_coverage_enabled = in_src_pipeline_info_ptr->m_alpha_to_coverage_enabled; - m_alpha_to_one_enabled = in_src_pipeline_info_ptr->m_alpha_to_one_enabled; - m_depth_clamp_enabled = in_src_pipeline_info_ptr->m_depth_clamp_enabled; - m_depth_writes_enabled = in_src_pipeline_info_ptr->m_depth_writes_enabled; - m_logic_op_enabled = in_src_pipeline_info_ptr->m_logic_op_enabled; - m_primitive_restart_enabled = in_src_pipeline_info_ptr->m_primitive_restart_enabled; - m_rasterizer_discard_enabled = in_src_pipeline_info_ptr->m_rasterizer_discard_enabled; - m_sample_mask_enabled = in_src_pipeline_info_ptr->m_sample_mask_enabled; - m_sample_shading_enabled = in_src_pipeline_info_ptr->m_sample_shading_enabled; - - m_stencil_test_enabled = in_src_pipeline_info_ptr->m_stencil_test_enabled; - m_stencil_state_back_face = in_src_pipeline_info_ptr->m_stencil_state_back_face; - m_stencil_state_front_face = in_src_pipeline_info_ptr->m_stencil_state_front_face; - - m_rasterization_order = in_src_pipeline_info_ptr->m_rasterization_order; - - m_attributes = in_src_pipeline_info_ptr->m_attributes; - m_blend_constant[0] = in_src_pipeline_info_ptr->m_blend_constant[0]; - m_blend_constant[1] = in_src_pipeline_info_ptr->m_blend_constant[1]; - m_blend_constant[2] = in_src_pipeline_info_ptr->m_blend_constant[2]; - m_blend_constant[3] = in_src_pipeline_info_ptr->m_blend_constant[3]; - m_polygon_mode = in_src_pipeline_info_ptr->m_polygon_mode; - m_front_face = in_src_pipeline_info_ptr->m_front_face; - m_line_width = in_src_pipeline_info_ptr->m_line_width; - m_logic_op = in_src_pipeline_info_ptr->m_logic_op; - m_min_sample_shading = in_src_pipeline_info_ptr->m_min_sample_shading; - m_n_dynamic_scissor_boxes = in_src_pipeline_info_ptr->m_n_dynamic_scissor_boxes; - m_n_dynamic_viewports = in_src_pipeline_info_ptr->m_n_dynamic_viewports; - m_n_patch_control_points = in_src_pipeline_info_ptr->m_n_patch_control_points; - m_primitive_topology = in_src_pipeline_info_ptr->m_primitive_topology; - m_sample_mask = in_src_pipeline_info_ptr->m_sample_mask; - m_scissor_boxes = in_src_pipeline_info_ptr->m_scissor_boxes; - m_subpass_attachment_blending_properties = in_src_pipeline_info_ptr->m_subpass_attachment_blending_properties; - m_viewports = in_src_pipeline_info_ptr->m_viewports; - - m_cull_mode = in_src_pipeline_info_ptr->m_cull_mode; - m_sample_count = in_src_pipeline_info_ptr->m_sample_count; - - BasePipelineInfo::copy_state_from(in_src_pipeline_info_ptr); + m_max_depth_bounds = in_src_pipeline_create_info_ptr->m_max_depth_bounds; + m_min_depth_bounds = in_src_pipeline_create_info_ptr->m_min_depth_bounds; + + m_depth_bias_enabled = in_src_pipeline_create_info_ptr->m_depth_bias_enabled; + m_depth_bias_clamp = in_src_pipeline_create_info_ptr->m_depth_bias_clamp; + m_depth_bias_constant_factor = in_src_pipeline_create_info_ptr->m_depth_bias_constant_factor; + m_depth_bias_slope_factor = in_src_pipeline_create_info_ptr->m_depth_bias_slope_factor; + m_depth_test_enabled = in_src_pipeline_create_info_ptr->m_depth_test_enabled; + m_depth_test_compare_op = in_src_pipeline_create_info_ptr->m_depth_test_compare_op; + + m_enabled_dynamic_states = in_src_pipeline_create_info_ptr->m_enabled_dynamic_states; + + m_alpha_to_coverage_enabled = in_src_pipeline_create_info_ptr->m_alpha_to_coverage_enabled; + m_alpha_to_one_enabled = in_src_pipeline_create_info_ptr->m_alpha_to_one_enabled; + m_depth_clamp_enabled = in_src_pipeline_create_info_ptr->m_depth_clamp_enabled; + m_depth_writes_enabled = in_src_pipeline_create_info_ptr->m_depth_writes_enabled; + m_logic_op_enabled = in_src_pipeline_create_info_ptr->m_logic_op_enabled; + m_primitive_restart_enabled = in_src_pipeline_create_info_ptr->m_primitive_restart_enabled; + m_rasterizer_discard_enabled = in_src_pipeline_create_info_ptr->m_rasterizer_discard_enabled; + m_sample_mask_enabled = in_src_pipeline_create_info_ptr->m_sample_mask_enabled; + m_sample_shading_enabled = in_src_pipeline_create_info_ptr->m_sample_shading_enabled; + + m_stencil_test_enabled = in_src_pipeline_create_info_ptr->m_stencil_test_enabled; + m_stencil_state_back_face = in_src_pipeline_create_info_ptr->m_stencil_state_back_face; + m_stencil_state_front_face = in_src_pipeline_create_info_ptr->m_stencil_state_front_face; + + m_rasterization_order = in_src_pipeline_create_info_ptr->m_rasterization_order; + + m_attributes = in_src_pipeline_create_info_ptr->m_attributes; + m_blend_constant[0] = in_src_pipeline_create_info_ptr->m_blend_constant[0]; + m_blend_constant[1] = in_src_pipeline_create_info_ptr->m_blend_constant[1]; + m_blend_constant[2] = in_src_pipeline_create_info_ptr->m_blend_constant[2]; + m_blend_constant[3] = in_src_pipeline_create_info_ptr->m_blend_constant[3]; + m_polygon_mode = in_src_pipeline_create_info_ptr->m_polygon_mode; + m_front_face = in_src_pipeline_create_info_ptr->m_front_face; + m_line_width = in_src_pipeline_create_info_ptr->m_line_width; + m_logic_op = in_src_pipeline_create_info_ptr->m_logic_op; + m_min_sample_shading = in_src_pipeline_create_info_ptr->m_min_sample_shading; + m_n_dynamic_scissor_boxes = in_src_pipeline_create_info_ptr->m_n_dynamic_scissor_boxes; + m_n_dynamic_viewports = in_src_pipeline_create_info_ptr->m_n_dynamic_viewports; + m_n_patch_control_points = in_src_pipeline_create_info_ptr->m_n_patch_control_points; + m_primitive_topology = in_src_pipeline_create_info_ptr->m_primitive_topology; + m_sample_mask = in_src_pipeline_create_info_ptr->m_sample_mask; + m_scissor_boxes = in_src_pipeline_create_info_ptr->m_scissor_boxes; + m_subpass_attachment_blending_properties = in_src_pipeline_create_info_ptr->m_subpass_attachment_blending_properties; + m_viewports = in_src_pipeline_create_info_ptr->m_viewports; + + m_cull_mode = in_src_pipeline_create_info_ptr->m_cull_mode; + m_sample_count = in_src_pipeline_create_info_ptr->m_sample_count; + + BasePipelineCreateInfo::copy_state_from(in_src_pipeline_create_info_ptr); result = true; end: return result; } -Anvil::GraphicsPipelineInfoUniquePtr Anvil::GraphicsPipelineInfo::create_derivative_pipeline_info(bool in_disable_optimizations, - bool in_allow_derivatives, - const RenderPass* in_renderpass_ptr, - SubPassID in_subpass_id, - const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, - Anvil::PipelineID in_base_pipeline_id) +Anvil::GraphicsPipelineCreateInfoUniquePtr Anvil::GraphicsPipelineCreateInfo::create_derivative(bool in_disable_optimizations, + bool in_allow_derivatives, + const RenderPass* in_renderpass_ptr, + SubPassID in_subpass_id, + const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, + Anvil::PipelineID in_base_pipeline_id) { - Anvil::GraphicsPipelineInfoUniquePtr result_ptr(nullptr, - std::default_delete() ); + Anvil::GraphicsPipelineCreateInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( - new GraphicsPipelineInfo(in_renderpass_ptr, - in_subpass_id) + new GraphicsPipelineCreateInfo(in_renderpass_ptr, + in_subpass_id) ); if (result_ptr != nullptr) @@ -244,51 +244,51 @@ Anvil::GraphicsPipelineInfoUniquePtr Anvil::GraphicsPipelineInfo::create_derivat in_vertex_shader_shader_stage_entrypoint_info }; - result_ptr->init_derivative_pipeline_info(in_disable_optimizations, - in_allow_derivatives, - sizeof(stages) / sizeof(stages[0]), - stages, - in_base_pipeline_id); + result_ptr->init_derivative(in_disable_optimizations, + in_allow_derivatives, + sizeof(stages) / sizeof(stages[0]), + stages, + in_base_pipeline_id); } return result_ptr; } -Anvil::GraphicsPipelineInfoUniquePtr Anvil::GraphicsPipelineInfo::create_proxy_pipeline_info() +Anvil::GraphicsPipelineCreateInfoUniquePtr Anvil::GraphicsPipelineCreateInfo::create_proxy() { - Anvil::GraphicsPipelineInfoUniquePtr result_ptr(nullptr, - std::default_delete() ); + Anvil::GraphicsPipelineCreateInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( - new GraphicsPipelineInfo(nullptr, /* in_renderpass_ptr */ - UINT32_MAX) + new GraphicsPipelineCreateInfo(nullptr, /* in_renderpass_ptr */ + UINT32_MAX) ); if (result_ptr != nullptr) { - result_ptr->init_proxy_pipeline_info(); + result_ptr->init_proxy(); } return result_ptr; } -Anvil::GraphicsPipelineInfoUniquePtr Anvil::GraphicsPipelineInfo::create_regular_pipeline_info(bool in_disable_optimizations, - bool in_allow_derivatives, - const RenderPass* in_renderpass_ptr, - SubPassID in_subpass_id, - const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, - const Anvil::GraphicsPipelineInfo* in_opt_reference_pipeline_info_ptr) +Anvil::GraphicsPipelineCreateInfoUniquePtr Anvil::GraphicsPipelineCreateInfo::create_regular(bool in_disable_optimizations, + bool in_allow_derivatives, + const RenderPass* in_renderpass_ptr, + SubPassID in_subpass_id, + const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, + const Anvil::GraphicsPipelineCreateInfo* in_opt_reference_pipeline_info_ptr) { - Anvil::GraphicsPipelineInfoUniquePtr result_ptr(nullptr, - std::default_delete() ); + Anvil::GraphicsPipelineCreateInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); result_ptr.reset( - new GraphicsPipelineInfo(in_renderpass_ptr, - in_subpass_id) + new GraphicsPipelineCreateInfo(in_renderpass_ptr, + in_subpass_id) ); if (result_ptr != nullptr) @@ -312,17 +312,17 @@ Anvil::GraphicsPipelineInfoUniquePtr Anvil::GraphicsPipelineInfo::create_regular } } - result_ptr->init_regular_pipeline_info(in_disable_optimizations, - in_allow_derivatives, - sizeof(stages) / sizeof(stages[0]), - stages); + result_ptr->init_regular(in_disable_optimizations, + in_allow_derivatives, + sizeof(stages) / sizeof(stages[0]), + stages); } return result_ptr; } -void Anvil::GraphicsPipelineInfo::get_blending_properties(const float** out_opt_blend_constant_vec4_ptr_ptr, - uint32_t* out_opt_n_blend_attachments_ptr) const +void Anvil::GraphicsPipelineCreateInfo::get_blending_properties(const float** out_opt_blend_constant_vec4_ptr_ptr, + uint32_t* out_opt_n_blend_attachments_ptr) const { if (out_opt_blend_constant_vec4_ptr_ptr != nullptr) { @@ -335,15 +335,15 @@ void Anvil::GraphicsPipelineInfo::get_blending_properties(const float** out_opt_ } } -bool Anvil::GraphicsPipelineInfo::get_color_blend_attachment_properties(SubPassAttachmentID in_attachment_id, - bool* out_opt_blending_enabled_ptr, - VkBlendOp* out_opt_blend_op_color_ptr, - VkBlendOp* out_opt_blend_op_alpha_ptr, - VkBlendFactor* out_opt_src_color_blend_factor_ptr, - VkBlendFactor* out_opt_dst_color_blend_factor_ptr, - VkBlendFactor* out_opt_src_alpha_blend_factor_ptr, - VkBlendFactor* out_opt_dst_alpha_blend_factor_ptr, - VkColorComponentFlags* out_opt_channel_write_mask_ptr) const +bool Anvil::GraphicsPipelineCreateInfo::get_color_blend_attachment_properties(SubPassAttachmentID in_attachment_id, + bool* out_opt_blending_enabled_ptr, + VkBlendOp* out_opt_blend_op_color_ptr, + VkBlendOp* out_opt_blend_op_alpha_ptr, + VkBlendFactor* out_opt_src_color_blend_factor_ptr, + VkBlendFactor* out_opt_dst_color_blend_factor_ptr, + VkBlendFactor* out_opt_src_alpha_blend_factor_ptr, + VkBlendFactor* out_opt_dst_alpha_blend_factor_ptr, + VkColorComponentFlags* out_opt_channel_write_mask_ptr) const { SubPassAttachmentToBlendingPropertiesMap::const_iterator props_iterator; bool result = false; @@ -400,10 +400,10 @@ bool Anvil::GraphicsPipelineInfo::get_color_blend_attachment_properties(SubPassA return result; } -void Anvil::GraphicsPipelineInfo::get_depth_bias_state(bool* out_opt_is_enabled_ptr, - float* out_opt_depth_bias_constant_factor_ptr, - float* out_opt_depth_bias_clamp_ptr, - float* out_opt_depth_bias_slope_factor_ptr) const +void Anvil::GraphicsPipelineCreateInfo::get_depth_bias_state(bool* out_opt_is_enabled_ptr, + float* out_opt_depth_bias_constant_factor_ptr, + float* out_opt_depth_bias_clamp_ptr, + float* out_opt_depth_bias_slope_factor_ptr) const { if (out_opt_is_enabled_ptr != nullptr) @@ -427,9 +427,9 @@ void Anvil::GraphicsPipelineInfo::get_depth_bias_state(bool* out_opt_is_enabled } } -void Anvil::GraphicsPipelineInfo::get_depth_bounds_state(bool* out_opt_is_enabled_ptr, - float* out_opt_min_depth_bounds_ptr, - float* out_opt_max_depth_bounds_ptr) const +void Anvil::GraphicsPipelineCreateInfo::get_depth_bounds_state(bool* out_opt_is_enabled_ptr, + float* out_opt_min_depth_bounds_ptr, + float* out_opt_max_depth_bounds_ptr) const { if (out_opt_is_enabled_ptr != nullptr) { @@ -447,8 +447,8 @@ void Anvil::GraphicsPipelineInfo::get_depth_bounds_state(bool* out_opt_is_enabl } } -void Anvil::GraphicsPipelineInfo::get_depth_test_state(bool* out_opt_is_enabled_ptr, - VkCompareOp* out_opt_compare_op_ptr) const +void Anvil::GraphicsPipelineCreateInfo::get_depth_test_state(bool* out_opt_is_enabled_ptr, + VkCompareOp* out_opt_compare_op_ptr) const { if (out_opt_is_enabled_ptr != nullptr) { @@ -461,16 +461,16 @@ void Anvil::GraphicsPipelineInfo::get_depth_test_state(bool* out_opt_is_e } } -Anvil::DynamicStateBitfield Anvil::GraphicsPipelineInfo::get_enabled_dynamic_states() const +Anvil::DynamicStateBitfield Anvil::GraphicsPipelineCreateInfo::get_enabled_dynamic_states() const { return m_enabled_dynamic_states; } -void Anvil::GraphicsPipelineInfo::get_graphics_pipeline_properties(uint32_t* out_opt_n_scissors_ptr, - uint32_t* out_opt_n_viewports_ptr, - uint32_t* out_opt_n_vertex_attributes_ptr, - const RenderPass** out_opt_renderpass_ptr_ptr, - SubPassID* out_opt_subpass_id_ptr) const +void Anvil::GraphicsPipelineCreateInfo::get_graphics_pipeline_properties(uint32_t* out_opt_n_scissors_ptr, + uint32_t* out_opt_n_viewports_ptr, + uint32_t* out_opt_n_vertex_attributes_ptr, + const RenderPass** out_opt_renderpass_ptr_ptr, + SubPassID* out_opt_subpass_id_ptr) const { if (out_opt_n_scissors_ptr != nullptr) { @@ -498,8 +498,8 @@ void Anvil::GraphicsPipelineInfo::get_graphics_pipeline_properties(uint32_t* } } -void Anvil::GraphicsPipelineInfo::get_logic_op_state(bool* out_opt_is_enabled_ptr, - VkLogicOp* out_opt_logic_op_ptr) const +void Anvil::GraphicsPipelineCreateInfo::get_logic_op_state(bool* out_opt_is_enabled_ptr, + VkLogicOp* out_opt_logic_op_ptr) const { if (out_opt_is_enabled_ptr != nullptr) { @@ -512,8 +512,8 @@ void Anvil::GraphicsPipelineInfo::get_logic_op_state(bool* out_opt_is_enabl } } -void Anvil::GraphicsPipelineInfo::get_multisampling_properties(VkSampleCountFlags* out_opt_sample_count_ptr, - VkSampleMask* out_opt_sample_mask_ptr) const +void Anvil::GraphicsPipelineCreateInfo::get_multisampling_properties(VkSampleCountFlags* out_opt_sample_count_ptr, + VkSampleMask* out_opt_sample_mask_ptr) const { if (out_opt_sample_count_ptr != nullptr) { @@ -526,40 +526,40 @@ void Anvil::GraphicsPipelineInfo::get_multisampling_properties(VkSampleCountFlag } } -uint32_t Anvil::GraphicsPipelineInfo::get_n_dynamic_scissor_boxes() const +uint32_t Anvil::GraphicsPipelineCreateInfo::get_n_dynamic_scissor_boxes() const { return m_n_dynamic_scissor_boxes; } -uint32_t Anvil::GraphicsPipelineInfo::get_n_dynamic_viewports() const +uint32_t Anvil::GraphicsPipelineCreateInfo::get_n_dynamic_viewports() const { return m_n_dynamic_viewports; } -uint32_t Anvil::GraphicsPipelineInfo::get_n_scissor_boxes() const +uint32_t Anvil::GraphicsPipelineCreateInfo::get_n_scissor_boxes() const { return static_cast(m_scissor_boxes.size() ); } -uint32_t Anvil::GraphicsPipelineInfo::get_n_viewports() const +uint32_t Anvil::GraphicsPipelineCreateInfo::get_n_viewports() const { return static_cast(m_viewports.size() ); } -VkPrimitiveTopology Anvil::GraphicsPipelineInfo::get_primitive_topology() const +VkPrimitiveTopology Anvil::GraphicsPipelineCreateInfo::get_primitive_topology() const { return m_primitive_topology; } -VkRasterizationOrderAMD Anvil::GraphicsPipelineInfo::get_rasterization_order() const +VkRasterizationOrderAMD Anvil::GraphicsPipelineCreateInfo::get_rasterization_order() const { return m_rasterization_order; } -void Anvil::GraphicsPipelineInfo::get_rasterization_properties(VkPolygonMode* out_opt_polygon_mode_ptr, - VkCullModeFlags* out_opt_cull_mode_ptr, - VkFrontFace* out_opt_front_face_ptr, - float* out_opt_line_width_ptr) const +void Anvil::GraphicsPipelineCreateInfo::get_rasterization_properties(VkPolygonMode* out_opt_polygon_mode_ptr, + VkCullModeFlags* out_opt_cull_mode_ptr, + VkFrontFace* out_opt_front_face_ptr, + float* out_opt_line_width_ptr) const { if (out_opt_polygon_mode_ptr != nullptr) { @@ -582,8 +582,8 @@ void Anvil::GraphicsPipelineInfo::get_rasterization_properties(VkPolygonMode* } } -void Anvil::GraphicsPipelineInfo::get_sample_shading_state(bool* out_opt_is_enabled_ptr, - float* out_opt_min_sample_shading_ptr) const +void Anvil::GraphicsPipelineCreateInfo::get_sample_shading_state(bool* out_opt_is_enabled_ptr, + float* out_opt_min_sample_shading_ptr) const { if (out_opt_is_enabled_ptr != nullptr) { @@ -596,11 +596,11 @@ void Anvil::GraphicsPipelineInfo::get_sample_shading_state(bool* out_opt_is_ena } } -bool Anvil::GraphicsPipelineInfo::get_scissor_box_properties(uint32_t in_n_scissor_box, - int32_t* out_opt_x_ptr, - int32_t* out_opt_y_ptr, - uint32_t* out_opt_width_ptr, - uint32_t* out_opt_height_ptr) const +bool Anvil::GraphicsPipelineCreateInfo::get_scissor_box_properties(uint32_t in_n_scissor_box, + int32_t* out_opt_x_ptr, + int32_t* out_opt_y_ptr, + uint32_t* out_opt_width_ptr, + uint32_t* out_opt_height_ptr) const { bool result = false; const InternalScissorBox* scissor_box_props_ptr = nullptr; @@ -641,21 +641,21 @@ bool Anvil::GraphicsPipelineInfo::get_scissor_box_properties(uint32_t in_n_scis return result; } -void Anvil::GraphicsPipelineInfo::get_stencil_test_properties(bool* out_opt_is_enabled_ptr, - VkStencilOp* out_opt_front_stencil_fail_op_ptr, - VkStencilOp* out_opt_front_stencil_pass_op_ptr, - VkStencilOp* out_opt_front_stencil_depth_fail_op_ptr, - VkCompareOp* out_opt_front_stencil_compare_op_ptr, - uint32_t* out_opt_front_stencil_compare_mask_ptr, - uint32_t* out_opt_front_stencil_write_mask_ptr, - uint32_t* out_opt_front_stencil_reference_ptr, - VkStencilOp* out_opt_back_stencil_fail_op_ptr, - VkStencilOp* out_opt_back_stencil_pass_op_ptr, - VkStencilOp* out_opt_back_stencil_depth_fail_op_ptr, - VkCompareOp* out_opt_back_stencil_compare_op_ptr, - uint32_t* out_opt_back_stencil_compare_mask_ptr, - uint32_t* out_opt_back_stencil_write_mask_ptr, - uint32_t* out_opt_back_stencil_reference_ptr) const +void Anvil::GraphicsPipelineCreateInfo::get_stencil_test_properties(bool* out_opt_is_enabled_ptr, + VkStencilOp* out_opt_front_stencil_fail_op_ptr, + VkStencilOp* out_opt_front_stencil_pass_op_ptr, + VkStencilOp* out_opt_front_stencil_depth_fail_op_ptr, + VkCompareOp* out_opt_front_stencil_compare_op_ptr, + uint32_t* out_opt_front_stencil_compare_mask_ptr, + uint32_t* out_opt_front_stencil_write_mask_ptr, + uint32_t* out_opt_front_stencil_reference_ptr, + VkStencilOp* out_opt_back_stencil_fail_op_ptr, + VkStencilOp* out_opt_back_stencil_pass_op_ptr, + VkStencilOp* out_opt_back_stencil_depth_fail_op_ptr, + VkCompareOp* out_opt_back_stencil_compare_op_ptr, + uint32_t* out_opt_back_stencil_compare_mask_ptr, + uint32_t* out_opt_back_stencil_write_mask_ptr, + uint32_t* out_opt_back_stencil_reference_ptr) const { if (out_opt_is_enabled_ptr != nullptr) { @@ -733,18 +733,18 @@ void Anvil::GraphicsPipelineInfo::get_stencil_test_properties(bool* out_o } } -uint32_t Anvil::GraphicsPipelineInfo::get_n_patch_control_points() const +uint32_t Anvil::GraphicsPipelineCreateInfo::get_n_patch_control_points() const { return m_n_patch_control_points; } -bool Anvil::GraphicsPipelineInfo::get_vertex_attribute_properties(uint32_t in_n_vertex_input_attribute, - uint32_t* out_opt_location_ptr, - VkFormat* out_opt_format_ptr, - uint32_t* out_opt_offset_ptr, - uint32_t* out_opt_explicit_vertex_binding_index_ptr, - uint32_t* out_opt_stride_ptr, - VkVertexInputRate* out_opt_rate_ptr) const +bool Anvil::GraphicsPipelineCreateInfo::get_vertex_attribute_properties(uint32_t in_n_vertex_input_attribute, + uint32_t* out_opt_location_ptr, + VkFormat* out_opt_format_ptr, + uint32_t* out_opt_offset_ptr, + uint32_t* out_opt_explicit_vertex_binding_index_ptr, + uint32_t* out_opt_stride_ptr, + VkVertexInputRate* out_opt_rate_ptr) const { const InternalVertexAttribute* attribute_ptr = nullptr; bool result = false; @@ -794,13 +794,13 @@ bool Anvil::GraphicsPipelineInfo::get_vertex_attribute_properties(uint32_t return result; } -bool Anvil::GraphicsPipelineInfo::get_viewport_properties(uint32_t in_n_viewport, - float* out_opt_origin_x_ptr, - float* out_opt_origin_y_ptr, - float* out_opt_width_ptr, - float* out_opt_height_ptr, - float* out_opt_min_depth_ptr, - float* out_opt_max_depth_ptr) const +bool Anvil::GraphicsPipelineCreateInfo::get_viewport_properties(uint32_t in_n_viewport, + float* out_opt_origin_x_ptr, + float* out_opt_origin_y_ptr, + float* out_opt_width_ptr, + float* out_opt_height_ptr, + float* out_opt_min_depth_ptr, + float* out_opt_max_depth_ptr) const { bool result = false; const InternalViewport* viewport_props_ptr; @@ -851,52 +851,52 @@ bool Anvil::GraphicsPipelineInfo::get_viewport_properties(uint32_t in_n_viewport return result; } -bool Anvil::GraphicsPipelineInfo::is_alpha_to_coverage_enabled() const +bool Anvil::GraphicsPipelineCreateInfo::is_alpha_to_coverage_enabled() const { return m_alpha_to_coverage_enabled; } -bool Anvil::GraphicsPipelineInfo::is_alpha_to_one_enabled() const +bool Anvil::GraphicsPipelineCreateInfo::is_alpha_to_one_enabled() const { return m_alpha_to_one_enabled; } -bool Anvil::GraphicsPipelineInfo::is_depth_clamp_enabled() const +bool Anvil::GraphicsPipelineCreateInfo::is_depth_clamp_enabled() const { return m_depth_clamp_enabled; } -bool Anvil::GraphicsPipelineInfo::is_primitive_restart_enabled() const +bool Anvil::GraphicsPipelineCreateInfo::is_primitive_restart_enabled() const { return m_primitive_restart_enabled; } -bool Anvil::GraphicsPipelineInfo::is_rasterizer_discard_enabled() const +bool Anvil::GraphicsPipelineCreateInfo::is_rasterizer_discard_enabled() const { return m_rasterizer_discard_enabled; } -bool Anvil::GraphicsPipelineInfo::is_sample_mask_enabled() const +bool Anvil::GraphicsPipelineCreateInfo::is_sample_mask_enabled() const { return m_sample_mask_enabled; } -void Anvil::GraphicsPipelineInfo::set_blending_properties(const float* in_blend_constant_vec4) +void Anvil::GraphicsPipelineCreateInfo::set_blending_properties(const float* in_blend_constant_vec4) { memcpy(m_blend_constant, in_blend_constant_vec4, sizeof(m_blend_constant) ); } -void Anvil::GraphicsPipelineInfo::set_color_blend_attachment_properties(SubPassAttachmentID in_attachment_id, - bool in_blending_enabled, - VkBlendOp in_blend_op_color, - VkBlendOp in_blend_op_alpha, - VkBlendFactor in_src_color_blend_factor, - VkBlendFactor in_dst_color_blend_factor, - VkBlendFactor in_src_alpha_blend_factor, - VkBlendFactor in_dst_alpha_blend_factor, - VkColorComponentFlags in_channel_write_mask) +void Anvil::GraphicsPipelineCreateInfo::set_color_blend_attachment_properties(SubPassAttachmentID in_attachment_id, + bool in_blending_enabled, + VkBlendOp in_blend_op_color, + VkBlendOp in_blend_op_alpha, + VkBlendFactor in_src_color_blend_factor, + VkBlendFactor in_dst_color_blend_factor, + VkBlendFactor in_src_alpha_blend_factor, + VkBlendFactor in_dst_alpha_blend_factor, + VkColorComponentFlags in_channel_write_mask) { BlendingProperties* attachment_blending_props_ptr = &m_subpass_attachment_blending_properties[in_attachment_id]; @@ -910,44 +910,44 @@ void Anvil::GraphicsPipelineInfo::set_color_blend_attachment_properties(SubPassA attachment_blending_props_ptr->src_color_blend_factor = in_src_color_blend_factor; } -void Anvil::GraphicsPipelineInfo::set_multisampling_properties(VkSampleCountFlagBits in_sample_count, - float in_min_sample_shading, - const VkSampleMask in_sample_mask) +void Anvil::GraphicsPipelineCreateInfo::set_multisampling_properties(VkSampleCountFlagBits in_sample_count, + float in_min_sample_shading, + const VkSampleMask in_sample_mask) { m_min_sample_shading = in_min_sample_shading; m_sample_count = in_sample_count; m_sample_mask = in_sample_mask; } -void Anvil::GraphicsPipelineInfo::set_n_dynamic_scissor_boxes(uint32_t in_n_dynamic_scissor_boxes) +void Anvil::GraphicsPipelineCreateInfo::set_n_dynamic_scissor_boxes(uint32_t in_n_dynamic_scissor_boxes) { m_n_dynamic_scissor_boxes = in_n_dynamic_scissor_boxes; } -void Anvil::GraphicsPipelineInfo::set_n_dynamic_viewports(uint32_t in_n_dynamic_viewports) +void Anvil::GraphicsPipelineCreateInfo::set_n_dynamic_viewports(uint32_t in_n_dynamic_viewports) { m_n_dynamic_viewports = in_n_dynamic_viewports; } -void Anvil::GraphicsPipelineInfo::set_n_patch_control_points(uint32_t in_n_patch_control_points) +void Anvil::GraphicsPipelineCreateInfo::set_n_patch_control_points(uint32_t in_n_patch_control_points) { m_n_patch_control_points = in_n_patch_control_points; } -void Anvil::GraphicsPipelineInfo::set_primitive_topology(VkPrimitiveTopology in_primitive_topology) +void Anvil::GraphicsPipelineCreateInfo::set_primitive_topology(VkPrimitiveTopology in_primitive_topology) { m_primitive_topology = in_primitive_topology; } -void Anvil::GraphicsPipelineInfo::set_rasterization_order(VkRasterizationOrderAMD in_rasterization_order) +void Anvil::GraphicsPipelineCreateInfo::set_rasterization_order(VkRasterizationOrderAMD in_rasterization_order) { m_rasterization_order = in_rasterization_order; } -void Anvil::GraphicsPipelineInfo::set_rasterization_properties(VkPolygonMode in_polygon_mode, - VkCullModeFlags in_cull_mode, - VkFrontFace in_front_face, - float in_line_width) +void Anvil::GraphicsPipelineCreateInfo::set_rasterization_properties(VkPolygonMode in_polygon_mode, + VkCullModeFlags in_cull_mode, + VkFrontFace in_front_face, + float in_line_width) { m_cull_mode = in_cull_mode; m_front_face = in_front_face; @@ -955,11 +955,11 @@ void Anvil::GraphicsPipelineInfo::set_rasterization_properties(VkPolygonMode i m_polygon_mode = in_polygon_mode; } -void Anvil::GraphicsPipelineInfo::set_scissor_box_properties(uint32_t in_n_scissor_box, - int32_t in_x, - int32_t in_y, - uint32_t in_width, - uint32_t in_height) +void Anvil::GraphicsPipelineCreateInfo::set_scissor_box_properties(uint32_t in_n_scissor_box, + int32_t in_x, + int32_t in_y, + uint32_t in_width, + uint32_t in_height) { m_scissor_boxes[in_n_scissor_box] = InternalScissorBox(in_x, in_y, @@ -967,14 +967,14 @@ void Anvil::GraphicsPipelineInfo::set_scissor_box_properties(uint32_t in_n_sciss in_height); } -void Anvil::GraphicsPipelineInfo::set_stencil_test_properties(bool in_update_front_face_state, - VkStencilOp in_stencil_fail_op, - VkStencilOp in_stencil_pass_op, - VkStencilOp in_stencil_depth_fail_op, - VkCompareOp in_stencil_compare_op, - uint32_t in_stencil_compare_mask, - uint32_t in_stencil_write_mask, - uint32_t in_stencil_reference) +void Anvil::GraphicsPipelineCreateInfo::set_stencil_test_properties(bool in_update_front_face_state, + VkStencilOp in_stencil_fail_op, + VkStencilOp in_stencil_pass_op, + VkStencilOp in_stencil_depth_fail_op, + VkCompareOp in_stencil_compare_op, + uint32_t in_stencil_compare_mask, + uint32_t in_stencil_write_mask, + uint32_t in_stencil_reference) { VkStencilOpState* const stencil_op_state_ptr = (in_update_front_face_state) ? &m_stencil_state_front_face : &m_stencil_state_back_face; @@ -988,13 +988,13 @@ void Anvil::GraphicsPipelineInfo::set_stencil_test_properties(bool in_upd stencil_op_state_ptr->writeMask = in_stencil_write_mask; } -void Anvil::GraphicsPipelineInfo::set_viewport_properties(uint32_t in_n_viewport, - float in_origin_x, - float in_origin_y, - float in_width, - float in_height, - float in_min_depth, - float in_max_depth) +void Anvil::GraphicsPipelineCreateInfo::set_viewport_properties(uint32_t in_n_viewport, + float in_origin_x, + float in_origin_y, + float in_width, + float in_height, + float in_min_depth, + float in_max_depth) { m_viewports[in_n_viewport] = InternalViewport(in_origin_x, in_origin_y, @@ -1004,20 +1004,20 @@ void Anvil::GraphicsPipelineInfo::set_viewport_properties(uint32_t in_n_viewport in_max_depth); } -void Anvil::GraphicsPipelineInfo::toggle_alpha_to_coverage(bool in_should_enable) +void Anvil::GraphicsPipelineCreateInfo::toggle_alpha_to_coverage(bool in_should_enable) { m_alpha_to_coverage_enabled = in_should_enable; } -void Anvil::GraphicsPipelineInfo::toggle_alpha_to_one(bool in_should_enable) +void Anvil::GraphicsPipelineCreateInfo::toggle_alpha_to_one(bool in_should_enable) { m_alpha_to_one_enabled = in_should_enable; } -void Anvil::GraphicsPipelineInfo::toggle_depth_bias(bool in_should_enable, - float in_depth_bias_constant_factor, - float in_depth_bias_clamp, - float in_depth_bias_slope_factor) +void Anvil::GraphicsPipelineCreateInfo::toggle_depth_bias(bool in_should_enable, + float in_depth_bias_constant_factor, + float in_depth_bias_clamp, + float in_depth_bias_slope_factor) { m_depth_bias_constant_factor = in_depth_bias_constant_factor; m_depth_bias_clamp = in_depth_bias_clamp; @@ -1025,34 +1025,34 @@ void Anvil::GraphicsPipelineInfo::toggle_depth_bias(bool in_should_enable, m_depth_bias_slope_factor = in_depth_bias_slope_factor; } -void Anvil::GraphicsPipelineInfo::toggle_depth_bounds_test(bool in_should_enable, - float in_min_depth_bounds, - float in_max_depth_bounds) +void Anvil::GraphicsPipelineCreateInfo::toggle_depth_bounds_test(bool in_should_enable, + float in_min_depth_bounds, + float in_max_depth_bounds) { m_depth_bounds_test_enabled = in_should_enable; m_max_depth_bounds = in_max_depth_bounds; m_min_depth_bounds = in_min_depth_bounds; } -void Anvil::GraphicsPipelineInfo::toggle_depth_clamp(bool in_should_enable) +void Anvil::GraphicsPipelineCreateInfo::toggle_depth_clamp(bool in_should_enable) { m_depth_clamp_enabled = in_should_enable; } -void Anvil::GraphicsPipelineInfo::toggle_depth_test(bool in_should_enable, - VkCompareOp in_compare_op) +void Anvil::GraphicsPipelineCreateInfo::toggle_depth_test(bool in_should_enable, + VkCompareOp in_compare_op) { m_depth_test_enabled = in_should_enable; m_depth_test_compare_op = in_compare_op; } -void Anvil::GraphicsPipelineInfo::toggle_depth_writes(bool in_should_enable) +void Anvil::GraphicsPipelineCreateInfo::toggle_depth_writes(bool in_should_enable) { m_depth_writes_enabled = in_should_enable; } -void Anvil::GraphicsPipelineInfo::toggle_dynamic_states(bool in_should_enable, - DynamicStateBitfield in_dynamic_state_bits) +void Anvil::GraphicsPipelineCreateInfo::toggle_dynamic_states(bool in_should_enable, + DynamicStateBitfield in_dynamic_state_bits) { if (in_should_enable) { @@ -1064,34 +1064,34 @@ void Anvil::GraphicsPipelineInfo::toggle_dynamic_states(bool in_ } } -void Anvil::GraphicsPipelineInfo::toggle_logic_op(bool in_should_enable, - VkLogicOp in_logic_op) +void Anvil::GraphicsPipelineCreateInfo::toggle_logic_op(bool in_should_enable, + VkLogicOp in_logic_op) { m_logic_op = in_logic_op; m_logic_op_enabled = in_should_enable; } -void Anvil::GraphicsPipelineInfo::toggle_primitive_restart(bool in_should_enable) +void Anvil::GraphicsPipelineCreateInfo::toggle_primitive_restart(bool in_should_enable) { m_primitive_restart_enabled = in_should_enable; } -void Anvil::GraphicsPipelineInfo::toggle_rasterizer_discard(bool in_should_enable) +void Anvil::GraphicsPipelineCreateInfo::toggle_rasterizer_discard(bool in_should_enable) { m_rasterizer_discard_enabled = in_should_enable; } -void Anvil::GraphicsPipelineInfo::toggle_sample_mask(bool in_should_enable) +void Anvil::GraphicsPipelineCreateInfo::toggle_sample_mask(bool in_should_enable) { m_sample_mask_enabled = in_should_enable; } -void Anvil::GraphicsPipelineInfo::toggle_sample_shading(bool in_should_enable) +void Anvil::GraphicsPipelineCreateInfo::toggle_sample_shading(bool in_should_enable) { m_sample_shading_enabled = in_should_enable; } -void Anvil::GraphicsPipelineInfo::toggle_stencil_test(bool in_should_enable) +void Anvil::GraphicsPipelineCreateInfo::toggle_stencil_test(bool in_should_enable) { m_stencil_test_enabled = in_should_enable; } diff --git a/src/misc/image_create_info.cpp b/src/misc/image_create_info.cpp new file mode 100644 index 00000000..27ffe84b --- /dev/null +++ b/src/misc/image_create_info.cpp @@ -0,0 +1,262 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#include "misc/image_create_info.h" +#include "misc/swapchain_create_info.h" +#include "wrappers/swapchain.h" + +Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, + VkImageType in_type, + VkFormat in_format, + VkImageTiling in_tiling, + VkImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + VkSampleCountFlagBits in_sample_count, + Anvil::QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + bool in_use_full_mipmap_chain, + ImageCreateFlags in_create_flags, + VkImageLayout in_post_alloc_image_layout, + const std::vector* in_opt_mipmaps_ptr) +{ + Anvil::ImageCreateInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); + + result_ptr.reset( + new ImageCreateInfo(Anvil::ImageType::NONSPARSE_NO_ALLOC, + in_device_ptr, + in_type, + in_format, + in_tiling, + in_sharing_mode, + in_usage, + in_base_mipmap_width, + in_base_mipmap_height, + in_base_mipmap_depth, + in_n_layers, + in_sample_count, + in_use_full_mipmap_chain, + in_create_flags, + in_queue_families, + ((in_opt_mipmaps_ptr != nullptr) && (in_opt_mipmaps_ptr->size() > 0)) ? VK_IMAGE_LAYOUT_PREINITIALIZED : VK_IMAGE_LAYOUT_UNDEFINED, + in_post_alloc_image_layout, + in_opt_mipmaps_ptr, + Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + 0, /* in_external_memory_handle_types */ + 0, /* in_memory_features */ + Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED) + ); + + return result_ptr; +} + +Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_alloc(const Anvil::BaseDevice* in_device_ptr, + VkImageType in_type, + VkFormat in_format, + VkImageTiling in_tiling, + VkImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + VkSampleCountFlagBits in_sample_count, + Anvil::QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + bool in_use_full_mipmap_chain, + MemoryFeatureFlags in_memory_features, + ImageCreateFlags in_create_flags, + VkImageLayout in_post_alloc_image_layout, + const std::vector* in_opt_mipmaps_ptr) +{ + Anvil::ImageCreateInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); + + result_ptr.reset( + new ImageCreateInfo(Anvil::ImageType::NONSPARSE_ALLOC, + in_device_ptr, + in_type, + in_format, + in_tiling, + in_sharing_mode, + in_usage, + in_base_mipmap_width, + in_base_mipmap_height, + in_base_mipmap_depth, + in_n_layers, + in_sample_count, + in_use_full_mipmap_chain, + in_create_flags, + in_queue_families, + ((in_opt_mipmaps_ptr != nullptr) && (in_opt_mipmaps_ptr->size() > 0)) ? VK_IMAGE_LAYOUT_PREINITIALIZED : VK_IMAGE_LAYOUT_UNDEFINED, + in_post_alloc_image_layout, + in_opt_mipmaps_ptr, + Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + 0, /* in_external_memory_handle_types */ + in_memory_features, + Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED) + ); + + return result_ptr; +} + +Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_sparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, + VkImageType in_type, + VkFormat in_format, + VkImageTiling in_tiling, + VkImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + VkSampleCountFlagBits in_sample_count, + Anvil::QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + bool in_use_full_mipmap_chain, + ImageCreateFlags in_create_flags, + Anvil::SparseResidencyScope in_residency_scope) +{ + Anvil::ImageCreateInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); + + result_ptr.reset( + new ImageCreateInfo(Anvil::ImageType::SPARSE_NO_ALLOC, + in_device_ptr, + in_type, + in_format, + in_tiling, + in_sharing_mode, + in_usage, + in_base_mipmap_width, + in_base_mipmap_height, + in_base_mipmap_depth, + in_n_layers, + in_sample_count, + in_use_full_mipmap_chain, + in_create_flags, + in_queue_families, + VK_IMAGE_LAYOUT_UNDEFINED, + VK_IMAGE_LAYOUT_UNDEFINED, + nullptr, /* in_opt_mipmaps_ptr */ + Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + 0, /* in_external_memory_handle_types */ + 0, /* in_memory_features */ + in_residency_scope) + ); + + return result_ptr; +} + +Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_swapchain_wrapper(const Anvil::BaseDevice* in_device_ptr, + const Anvil::Swapchain* in_swapchain_ptr, + const VkImage& in_image, + const uint32_t& in_n_swapchain_image) +{ + Anvil::ImageCreateInfoUniquePtr result_ptr (nullptr, + std::default_delete() ); + const auto& swapchain_create_info_ptr(in_swapchain_ptr->get_create_info_ptr() ); + + result_ptr.reset( + new Anvil::ImageCreateInfo(Anvil::ImageType::SWAPCHAIN_WRAPPER, + in_device_ptr, + VK_IMAGE_TYPE_2D, + swapchain_create_info_ptr->get_format(), + VK_IMAGE_TILING_OPTIMAL, + VK_SHARING_MODE_EXCLUSIVE, + swapchain_create_info_ptr->get_usage_flags(), + swapchain_create_info_ptr->get_rendering_surface()->get_width (), + swapchain_create_info_ptr->get_rendering_surface()->get_height(), + 1, /* base_mipmap_depth */ + 1, /* in_n_layers */ + VK_SAMPLE_COUNT_1_BIT, + false, /* in_use_full_mipmap_chain */ + 0, /* in_create_flags */ + 0, /* in_queue_families */ + VK_IMAGE_LAYOUT_UNDEFINED, + VK_IMAGE_LAYOUT_UNDEFINED, + nullptr, /* in_opt_mipmaps_ptr */ + Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + 0, /* in_external_memory_handle_types */ + 0, /* in_memory_features */ + Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED) + ); + + if (result_ptr != nullptr) + { + result_ptr->m_swapchain_image = in_image; + result_ptr->m_n_swapchain_image = in_n_swapchain_image; + result_ptr->m_swapchain_ptr = in_swapchain_ptr; + } + + return result_ptr; +} + +Anvil::ImageCreateInfo::ImageCreateInfo(Anvil::ImageType in_type, + const Anvil::BaseDevice* in_device_ptr, + VkImageType in_type_vk, + VkFormat in_format, + VkImageTiling in_tiling, + VkSharingMode in_sharing_mode, + VkImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + VkSampleCountFlagBits in_sample_count, + bool in_use_full_mipmap_chain, + ImageCreateFlags in_create_flags, + Anvil::QueueFamilyBits in_queue_families, + VkImageLayout in_post_create_image_layout, + const VkImageLayout& in_post_alloc_image_layout, + const std::vector* in_opt_mipmaps_ptr, + const Anvil::MTSafety& in_mt_safety, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types, + const Anvil::MemoryFeatureFlags& in_memory_features, + const Anvil::SparseResidencyScope& in_residency_scope) + :m_create_flags (in_create_flags), + m_depth (in_base_mipmap_depth), + m_device_ptr (in_device_ptr), + m_external_memory_handle_types(in_external_memory_handle_types), + m_format (in_format), + m_height (in_base_mipmap_height), + m_memory_features (in_memory_features), + m_mipmaps_to_upload ((in_opt_mipmaps_ptr != nullptr) ? *in_opt_mipmaps_ptr : std::vector() ), + m_mt_safety (in_mt_safety), + m_n_layers (in_n_layers), + m_n_swapchain_image (UINT32_MAX), + m_post_alloc_layout (in_post_alloc_image_layout), + m_post_create_layout (in_post_create_image_layout), + m_queue_families (in_queue_families), + m_residency_scope (in_residency_scope), + m_sample_count (in_sample_count), + m_sharing_mode (in_sharing_mode), + m_swapchain_ptr (nullptr), + m_tiling (in_tiling), + m_type (in_type), + m_type_vk (in_type_vk), + m_usage_flags (static_cast(in_usage)), + m_use_full_mipmap_chain (in_use_full_mipmap_chain), + m_width (in_base_mipmap_width) +{ + /* Stub */ +} diff --git a/src/misc/image_view_create_info.cpp b/src/misc/image_view_create_info.cpp new file mode 100644 index 00000000..c546b4a0 --- /dev/null +++ b/src/misc/image_view_create_info.cpp @@ -0,0 +1,334 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#include "misc/image_view_create_info.h" + +Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_1D(const Anvil::BaseDevice* in_device_ptr, + Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha) +{ + Anvil::ImageViewCreateInfoUniquePtr result_ptr (nullptr, + std::default_delete() ); + const VkComponentSwizzle swizzle_rgba[] = + { + in_swizzle_red, + in_swizzle_green, + in_swizzle_blue, + in_swizzle_alpha + }; + + result_ptr.reset( + new Anvil::ImageViewCreateInfo(in_aspect_mask, + in_device_ptr, + in_format, + in_n_base_layer, + in_n_base_mipmap_level, + 1, /* in_n_layers */ + in_n_mipmaps, + 1, /* in_n_slices */ + in_image_ptr, + swizzle_rgba, + VK_IMAGE_VIEW_TYPE_1D, + Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + ); + + return result_ptr; +} + +Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_1D_array(const Anvil::BaseDevice* in_device_ptr, + Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_layers, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha) +{ + Anvil::ImageViewCreateInfoUniquePtr result_ptr (nullptr, + std::default_delete() ); + const VkComponentSwizzle swizzle_rgba[] = + { + in_swizzle_red, + in_swizzle_green, + in_swizzle_blue, + in_swizzle_alpha + }; + + result_ptr.reset( + new Anvil::ImageViewCreateInfo(in_aspect_mask, + in_device_ptr, + in_format, + in_n_base_layer, + in_n_base_mipmap_level, + in_n_layers, + in_n_mipmaps, + 1, /* in_n_slices */ + in_image_ptr, + swizzle_rgba, + VK_IMAGE_VIEW_TYPE_1D_ARRAY, + Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + ); + + return result_ptr; +} + +Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_2D(const Anvil::BaseDevice* in_device_ptr, + Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha) +{ + Anvil::ImageViewCreateInfoUniquePtr result_ptr (nullptr, + std::default_delete() ); + const VkComponentSwizzle swizzle_rgba[] = + { + in_swizzle_red, + in_swizzle_green, + in_swizzle_blue, + in_swizzle_alpha + }; + + result_ptr.reset( + new Anvil::ImageViewCreateInfo(in_aspect_mask, + in_device_ptr, + in_format, + in_n_base_layer, + in_n_base_mipmap_level, + 1, /* in_n_layers */ + in_n_mipmaps, + 1, /* in_n_slices */ + in_image_ptr, + swizzle_rgba, + VK_IMAGE_VIEW_TYPE_2D, + Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + ); + + return result_ptr; +} + +Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_2D_array(const Anvil::BaseDevice* in_device_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_layers, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha) +{ + Anvil::ImageViewCreateInfoUniquePtr result_ptr (nullptr, + std::default_delete() ); + const VkComponentSwizzle swizzle_rgba[] = + { + in_swizzle_red, + in_swizzle_green, + in_swizzle_blue, + in_swizzle_alpha + }; + + result_ptr.reset( + new Anvil::ImageViewCreateInfo(in_aspect_mask, + in_device_ptr, + in_format, + in_n_base_layer, + in_n_base_mipmap_level, + in_n_layers, + in_n_mipmaps, + 1, /* in_n_slices */ + in_image_ptr, + swizzle_rgba, + VK_IMAGE_VIEW_TYPE_2D_ARRAY, + Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + ); + + return result_ptr; +} + +Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_3D(const Anvil::BaseDevice* in_device_ptr, + Image* in_image_ptr, + uint32_t in_n_base_slice, + uint32_t in_n_slices, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha) +{ + Anvil::ImageViewCreateInfoUniquePtr result_ptr (nullptr, + std::default_delete() ); + const VkComponentSwizzle swizzle_rgba[] = + { + in_swizzle_red, + in_swizzle_green, + in_swizzle_blue, + in_swizzle_alpha + }; + + result_ptr.reset( + new Anvil::ImageViewCreateInfo(in_aspect_mask, + in_device_ptr, + in_format, + in_n_base_slice, + in_n_base_mipmap_level, + 1, /* in_n_layers */ + in_n_mipmaps, + in_n_slices, + in_image_ptr, + swizzle_rgba, + VK_IMAGE_VIEW_TYPE_3D, + Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + ); + + return result_ptr; +} + +Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_cube_map(const Anvil::BaseDevice* in_device_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha) +{ + Anvil::ImageViewCreateInfoUniquePtr result_ptr (nullptr, + std::default_delete() ); + const VkComponentSwizzle swizzle_rgba[] = + { + in_swizzle_red, + in_swizzle_green, + in_swizzle_blue, + in_swizzle_alpha + }; + + result_ptr.reset( + new Anvil::ImageViewCreateInfo(in_aspect_mask, + in_device_ptr, + in_format, + in_n_base_layer, + in_n_base_mipmap_level, + 6, /* in_n_layers */ + in_n_mipmaps, + 1, /* in_n_slices */ + in_image_ptr, + swizzle_rgba, + VK_IMAGE_VIEW_TYPE_CUBE, + Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + ); + + return result_ptr; +} + +Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_cube_map_array(const Anvil::BaseDevice* in_device_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_base_layer, + uint32_t in_n_cube_maps, + uint32_t in_n_base_mipmap_level, + uint32_t in_n_mipmaps, + VkImageAspectFlags in_aspect_mask, + VkFormat in_format, + VkComponentSwizzle in_swizzle_red, + VkComponentSwizzle in_swizzle_green, + VkComponentSwizzle in_swizzle_blue, + VkComponentSwizzle in_swizzle_alpha) +{ + Anvil::ImageViewCreateInfoUniquePtr result_ptr (nullptr, + std::default_delete() ); + const VkComponentSwizzle swizzle_rgba[] = + { + in_swizzle_red, + in_swizzle_green, + in_swizzle_blue, + in_swizzle_alpha + }; + + result_ptr.reset( + new Anvil::ImageViewCreateInfo(in_aspect_mask, + in_device_ptr, + in_format, + in_n_base_layer, + in_n_base_mipmap_level, + in_n_cube_maps * 6, + in_n_mipmaps, + 1, /* in_n_slices */ + in_image_ptr, + swizzle_rgba, + VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, + Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + ); + + return result_ptr; +} + +Anvil::ImageViewCreateInfo::ImageViewCreateInfo(const VkImageAspectFlags& in_aspect_mask, + const Anvil::BaseDevice* in_device_ptr, + const VkFormat in_format, + const uint32_t in_n_base_layer, + const uint32_t in_n_base_mipmap_level, + const uint32_t in_n_layers, + const uint32_t in_n_mipmaps, + const uint32_t in_n_slices, + Anvil::Image* in_parent_image_ptr, + const VkComponentSwizzle* in_swizzle_array_ptr, + const VkImageViewType in_type, + const Anvil::MTSafety& in_mt_safety) + :m_aspect_mask (in_aspect_mask), + m_device_ptr (in_device_ptr), + m_format (in_format), + m_mt_safety (in_mt_safety), + m_n_base_layer (in_n_base_layer), + m_n_base_mipmap_level(in_n_base_mipmap_level), + m_n_layers (in_n_layers), + m_n_mipmaps (in_n_mipmaps), + m_n_slices (in_n_slices), + m_parent_image_ptr (in_parent_image_ptr), + m_swizzle_array ({in_swizzle_array_ptr[0], in_swizzle_array_ptr[1], in_swizzle_array_ptr[2], in_swizzle_array_ptr[3]}), + m_type (in_type) +{ + anvil_assert(in_parent_image_ptr != nullptr); +} diff --git a/src/misc/io.cpp b/src/misc/io.cpp index 5dd4a251..dca14a6c 100644 --- a/src/misc/io.cpp +++ b/src/misc/io.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/misc/memalloc_backends/backend_oneshot.cpp b/src/misc/memalloc_backends/backend_oneshot.cpp index a52e81e9..30c735ea 100644 --- a/src/misc/memalloc_backends/backend_oneshot.cpp +++ b/src/misc/memalloc_backends/backend_oneshot.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -152,7 +152,8 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items current_item_ptr->is_baked = true; } - dynamic_cast(current_item_ptr->alloc_memory_block_ptr.get() )->set_parent_memory_allocator_backend_ptr(shared_from_this() ); + dynamic_cast(current_item_ptr->alloc_memory_block_ptr.get() )->set_parent_memory_allocator_backend_ptr(shared_from_this(), + reinterpret_cast(new_memory_block_ptr->get_memory() )); } m_memory_blocks.push_back( @@ -172,6 +173,19 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items return result; } +VkResult Anvil::MemoryAllocatorBackends::OneShot::map(void* in_memory_object, + VkDeviceSize in_start_offset, + VkDeviceSize in_size, + void** out_result_ptr) +{ + return vkMapMemory(m_device_ptr->get_device_vk(), + reinterpret_cast(in_memory_object), + in_start_offset, + in_size, + 0, /* flags */ + out_result_ptr); +} + /** Tells whether or not the backend is ready to handle allocation request. * * One-shot memory allocator backend will return true until the first bake() invocation, @@ -181,4 +195,15 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items bool Anvil::MemoryAllocatorBackends::OneShot::supports_baking() const { return !m_is_baked; -} \ No newline at end of file +} + +bool Anvil::MemoryAllocatorBackends::OneShot::supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const +{ + return (in_external_memory_handle_types == 0); +} + +void Anvil::MemoryAllocatorBackends::OneShot::unmap(void* in_memory_object) +{ + vkUnmapMemory(m_device_ptr->get_device_vk(), + reinterpret_cast(in_memory_object) ); +} diff --git a/src/misc/memalloc_backends/backend_vma.cpp b/src/misc/memalloc_backends/backend_vma.cpp index 8c665d65..757a935e 100644 --- a/src/misc/memalloc_backends/backend_vma.cpp +++ b/src/misc/memalloc_backends/backend_vma.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -95,8 +95,8 @@ std::shared_ptr Anvil::Memory **/ bool Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::init() { - VmaAllocatorCreateInfo create_info; - VkResult result (VK_ERROR_DEVICE_LOST); + VmaAllocatorCreateInfo create_info = {}; + VkResult result (VK_ERROR_DEVICE_LOST); switch (m_device_ptr->get_type() ) { @@ -117,7 +117,6 @@ bool Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::init() create_info.device = m_device_ptr->get_device_vk(); create_info.pAllocationCallbacks = nullptr; create_info.preferredLargeHeapBlockSize = 0; - create_info.preferredSmallHeapBlockSize = 0; result = vmaCreateAllocator(&create_info, &m_allocator); @@ -164,13 +163,13 @@ bool Anvil::MemoryAllocatorBackends::VMA::bake(Anvil::MemoryAllocator::Items& in MemoryBlockUniquePtr new_memory_block_ptr(nullptr, std::default_delete() ); + VmaAllocation allocation = VK_NULL_HANDLE; + VmaAllocationCreateInfo allocation_create_info = {}; + VmaAllocationInfo allocation_info = {}; VkMemoryRequirements memory_requirements_vk; - VmaMemoryRequirements memory_requirements_vma; Anvil::OnMemoryBlockReleaseCallbackFunction release_callback_function; VkMemoryHeapFlags required_mem_heap_flags = 0; VkMemoryPropertyFlags required_mem_property_flags = 0; - uint32_t result_mem_type_index = UINT32_MAX; - VkMappedMemoryRange result_mem_range; Anvil::Utils::get_vk_property_flags_from_memory_feature_flags(current_item_ptr->alloc_memory_required_features, &required_mem_property_flags, @@ -183,17 +182,13 @@ bool Anvil::MemoryAllocatorBackends::VMA::bake(Anvil::MemoryAllocator::Items& in memory_requirements_vk.memoryTypeBits = current_item_ptr->alloc_memory_supported_memory_types; memory_requirements_vk.size = current_item_ptr->alloc_size; - memory_requirements_vma.neverAllocate = false; - memory_requirements_vma.ownMemory = false; - memory_requirements_vma.preferredFlags = 0; - memory_requirements_vma.requiredFlags = required_mem_property_flags; - memory_requirements_vma.usage = VMA_MEMORY_USAGE_UNKNOWN; + allocation_create_info.requiredFlags = required_mem_property_flags; result_vk = vmaAllocateMemory(m_vma_allocator_ptr->get_handle(), &memory_requirements_vk, - &memory_requirements_vma, - &result_mem_range, - &result_mem_type_index); + &allocation_create_info, + &allocation, + &allocation_info); if (!is_vk_call_successful(result_vk) ) { @@ -202,24 +197,23 @@ bool Anvil::MemoryAllocatorBackends::VMA::bake(Anvil::MemoryAllocator::Items& in continue; } - anvil_assert(result_mem_range.pNext == nullptr); - anvil_assert(result_mem_range.sType == VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE); - /* Bake the block and stash it */ release_callback_function = std::bind( &VMAAllocator::on_vma_alloced_mem_block_gone_out_of_scope, m_vma_allocator_ptr, - std::placeholders::_1 + std::placeholders::_1, + allocation ); new_memory_block_ptr = Anvil::MemoryBlock::create_derived_with_custom_delete_proc(m_device_ptr, - result_mem_range.memory, + allocation_info.deviceMemory, memory_requirements_vk.memoryTypeBits, current_item_ptr->alloc_memory_required_features, - result_mem_type_index, + allocation_info.memoryType, memory_requirements_vk.size, - result_mem_range.offset, - release_callback_function); + allocation_info.offset, + release_callback_function, + 0); /* in_external_memory_handle_types */ if (new_memory_block_ptr == nullptr) { @@ -229,7 +223,8 @@ bool Anvil::MemoryAllocatorBackends::VMA::bake(Anvil::MemoryAllocator::Items& in continue; } - dynamic_cast(new_memory_block_ptr.get() )->set_parent_memory_allocator_backend_ptr(shared_from_this() ); + dynamic_cast(new_memory_block_ptr.get() )->set_parent_memory_allocator_backend_ptr(shared_from_this(), + allocation); current_item_ptr->alloc_memory_block_ptr = std::move(new_memory_block_ptr); current_item_ptr->alloc_size = memory_requirements_vk.size; @@ -272,6 +267,21 @@ bool Anvil::MemoryAllocatorBackends::VMA::init() return (m_vma_allocator_ptr != nullptr); } +VkResult Anvil::MemoryAllocatorBackends::VMA::map(void* in_memory_object, + VkDeviceSize in_start_offset, + VkDeviceSize in_size, + void** out_result_ptr) +{ + ANVIL_REDUNDANT_ARGUMENT(in_size); + ANVIL_REDUNDANT_ARGUMENT(in_start_offset); + + anvil_assert(in_start_offset == 0); + + return vmaMapMemory(m_vma_allocator_ptr->get_handle(), + static_cast(in_memory_object), + out_result_ptr); +} + /** Please see header for specification */ void Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::on_new_vma_mem_block_alloced() { @@ -287,21 +297,14 @@ void Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::on_new_vma_mem_block_all } /** Please see header for specification */ -void Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::on_vma_alloced_mem_block_gone_out_of_scope(Anvil::MemoryBlock* in_memory_block_ptr) +void Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::on_vma_alloced_mem_block_gone_out_of_scope(Anvil::MemoryBlock* in_memory_block_ptr, + VmaAllocation in_vma_allocation) { - VkMappedMemoryRange mem_range; - /* Only physically deallocate those memory blocks that are not derivatives of another memory blocks! */ if (in_memory_block_ptr->get_parent_memory_block() == nullptr) { - mem_range.memory = in_memory_block_ptr->get_memory (); - mem_range.offset = in_memory_block_ptr->get_start_offset(); - mem_range.pNext = nullptr; - mem_range.size = in_memory_block_ptr->get_size(); - mem_range.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE; - vmaFreeMemory(get_handle(), - &mem_range); + in_vma_allocation); /* Remove one cached pointer to the VMA wrapper class instance. This means that VMA instance * is going to be destroyed in case the vector's size reaches zero! @@ -318,4 +321,18 @@ void Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::on_vma_alloced_mem_block bool Anvil::MemoryAllocatorBackends::VMA::supports_baking() const { return true; -} \ No newline at end of file +} + +bool Anvil::MemoryAllocatorBackends::VMA::supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const +{ + /* Vulkan Memory Allocator does NOT support external memory handles */ + ANVIL_REDUNDANT_VARIABLE_CONST(in_external_memory_handle_types); + + return false; +} + +void Anvil::MemoryAllocatorBackends::VMA::unmap(void* in_memory_object) +{ + vmaUnmapMemory(m_vma_allocator_ptr->get_handle(), + static_cast(in_memory_object) ); +} diff --git a/src/misc/memory_allocator.cpp b/src/misc/memory_allocator.cpp index d46360dc..b7508c2f 100644 --- a/src/misc/memory_allocator.cpp +++ b/src/misc/memory_allocator.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -20,7 +20,10 @@ // THE SOFTWARE. // +#include "misc/buffer_create_info.h" +#include "misc/fence_create_info.h" #include "misc/formats.h" +#include "misc/image_create_info.h" #include "misc/memory_allocator.h" #include "misc/memalloc_backends/backend_oneshot.h" #include "misc/memalloc_backends/backend_vma.h" @@ -32,17 +35,19 @@ #include "wrappers/queue.h" /* Please see header for specification */ -Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types) +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + Anvil::ExternalMemoryHandleTypeFlags in_alloc_external_memory_handle_types) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); + alloc_external_memory_handle_types = in_alloc_external_memory_handle_types; alloc_memory_final_type = UINT32_MAX; alloc_memory_required_alignment = in_alloc_alignment; alloc_memory_required_features = in_alloc_required_memory_features; @@ -58,18 +63,20 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_p register_for_callbacks(); } -Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_alloc_offset, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types) +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_alloc_offset, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + Anvil::ExternalMemoryHandleTypeFlags in_alloc_external_memory_handle_types) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); + alloc_external_memory_handle_types = in_alloc_external_memory_handle_types; alloc_memory_final_type = UINT32_MAX; alloc_memory_required_alignment = in_alloc_alignment; alloc_memory_required_features = in_alloc_required_memory_features; @@ -87,19 +94,21 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_p } /* Please see header for specification */ -Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - uint32_t in_n_layer, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_miptail_offset, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types) +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_layer, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_miptail_offset, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + Anvil::ExternalMemoryHandleTypeFlags in_alloc_external_memory_handle_types) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); + alloc_external_memory_handle_types = in_alloc_external_memory_handle_types; alloc_memory_final_type = UINT32_MAX; alloc_memory_required_alignment = in_alloc_alignment; alloc_memory_required_features = in_alloc_required_memory_features; @@ -119,20 +128,22 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_p } /* Please see header for specification */ -Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - const VkExtent3D& in_extent, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types) +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + const VkExtent3D& in_extent, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + Anvil::ExternalMemoryHandleTypeFlags in_alloc_external_memory_handle_types) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); + alloc_external_memory_handle_types = in_alloc_external_memory_handle_types; alloc_memory_final_type = UINT32_MAX; alloc_memory_types = in_alloc_memory_types; alloc_memory_required_alignment = in_alloc_alignment; @@ -153,17 +164,19 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator } /* Please see header for specification */ -Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types) +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + Anvil::ExternalMemoryHandleTypeFlags in_alloc_external_memory_handle_types) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); + alloc_external_memory_handle_types = in_alloc_external_memory_handle_types; alloc_memory_final_type = UINT32_MAX; alloc_memory_required_alignment = in_alloc_alignment; alloc_memory_required_features = in_alloc_required_memory_features; @@ -341,8 +354,9 @@ Anvil::MemoryAllocator::~MemoryAllocator() /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* in_buffer_ptr, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* in_buffer_ptr, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -355,7 +369,8 @@ bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* in_buffer_ptr, } return add_buffer_internal(in_buffer_ptr, - in_required_memory_features); + in_required_memory_features, + in_external_memory_handle_types); } /** Determines the amount of memory, supported memory type and required alignment for the specified @@ -363,15 +378,18 @@ bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* in_buffer_ptr, * * @param buffer_ptr Buffer instance to assign a memory block at baking time. **/ -bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* in_buffer_ptr, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* in_buffer_ptr, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) { - IMemoryAllocatorBackend* backend_interface_ptr = dynamic_cast(m_backend_ptr.get() ); - VkDeviceSize buffer_alignment = 0; - uint32_t buffer_memory_types = 0; - VkDeviceSize buffer_storage_size = 0; - std::unique_ptr new_item_ptr; - bool result = true; + IMemoryAllocatorBackend* backend_interface_ptr = dynamic_cast(m_backend_ptr.get() ); + VkDeviceSize buffer_alignment = 0; + uint32_t buffer_memory_types = 0; + VkDeviceSize buffer_storage_size = 0; + uint32_t filtered_memory_types = 0; + const VkMemoryRequirements memory_reqs = in_buffer_ptr->get_memory_requirements(); + std::unique_ptr new_item_ptr; + bool result = true; ANVIL_REDUNDANT_VARIABLE(backend_interface_ptr); @@ -379,11 +397,21 @@ bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* in_buffer_pt anvil_assert(backend_interface_ptr->supports_baking() ); anvil_assert(in_buffer_ptr != nullptr); + /* Extract external memory handle types from the specified buffer, if none were specified. */ + if (in_external_memory_handle_types == 0) + { + in_external_memory_handle_types = in_buffer_ptr->get_create_info_ptr()->get_external_memory_handle_types(); + } + + if (!do_external_memory_handle_type_sanity_checks(in_external_memory_handle_types) ) + { + result = false; + + goto end; + } + /* Determine how much space we're going to need, what alignment we need * to consider, and so on. */ - uint32_t filtered_memory_types = 0; - const VkMemoryRequirements memory_reqs = in_buffer_ptr->get_memory_requirements(); - buffer_alignment = memory_reqs.alignment; buffer_memory_types = memory_reqs.memoryTypeBits; buffer_storage_size = memory_reqs.size; @@ -405,7 +433,8 @@ bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* in_buffer_pt buffer_memory_types, buffer_alignment, in_required_memory_features, - filtered_memory_types) + filtered_memory_types, + in_external_memory_handle_types) ); m_items.push_back( @@ -421,9 +450,10 @@ bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* in_buffer_pt } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - std::unique_ptr in_data_ptr, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr in_data_ptr, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -437,7 +467,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvi } result = add_buffer_internal(in_buffer_ptr, - in_required_memory_features); + in_required_memory_features, + in_external_memory_handle_types); if (result) { @@ -450,7 +481,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvi /* Please see header for specification */ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, - MemoryFeatureFlags in_required_memory_features) + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -463,10 +495,11 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi ); } - anvil_assert(in_data_vector_ptr->size() * sizeof(float) == in_buffer_ptr->get_size() ); + anvil_assert(in_data_vector_ptr->size() * sizeof(float) == in_buffer_ptr->get_create_info_ptr()->get_size() ); result = add_buffer_internal(in_buffer_ptr, - in_required_memory_features); + in_required_memory_features, + in_external_memory_handle_types); if (result) { @@ -477,9 +510,10 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - const std::vector* in_data_vector_ptr, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + const std::vector* in_data_vector_ptr, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -497,10 +531,11 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi ); } - anvil_assert(in_data_vector_ptr->size() * sizeof(uint32_t) == in_buffer_ptr->get_size() ); + anvil_assert(in_data_vector_ptr->size() * sizeof(uint32_t) == in_buffer_ptr->get_create_info_ptr()->get_size() ); result = add_buffer_internal(in_buffer_ptr, - in_required_memory_features); + in_required_memory_features, + in_external_memory_handle_types); if (result) { @@ -511,9 +546,10 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - std::unique_ptr in_data_ptr, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr in_data_ptr, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -527,7 +563,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anv } result = add_buffer_internal(in_buffer_ptr, - in_required_memory_features); + in_required_memory_features, + in_external_memory_handle_types); if (result) { @@ -540,7 +577,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anv /* Please see header for specification */ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, - MemoryFeatureFlags in_required_memory_features) + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -553,10 +591,11 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_vector_ptr_based_post_f ); } - anvil_assert(in_data_vector_ptr->size() == in_buffer_ptr->get_size() ); + anvil_assert(in_data_vector_ptr->size() == in_buffer_ptr->get_create_info_ptr()->get_size() ); result = add_buffer_internal(in_buffer_ptr, - in_required_memory_features); + in_required_memory_features, + in_external_memory_handle_types); if (result) { @@ -567,9 +606,10 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_vector_ptr_based_post_f } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - std::unique_ptr in_data_ptr, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr in_data_ptr, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -583,7 +623,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anv } result = add_buffer_internal(in_buffer_ptr, - in_required_memory_features); + in_required_memory_features, + in_external_memory_handle_types); if (result) { @@ -596,7 +637,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anv /* Please see header for specification */ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, - MemoryFeatureFlags in_required_memory_features) + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -609,10 +651,11 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f ); } - anvil_assert(in_data_vector_ptr->size() * sizeof(uint32_t) == in_buffer_ptr->get_size() ); + anvil_assert(in_data_vector_ptr->size() * sizeof(uint32_t) == in_buffer_ptr->get_create_info_ptr()->get_size() ); result = add_buffer_internal(in_buffer_ptr, - in_required_memory_features); + in_required_memory_features, + in_external_memory_handle_types); if (result) { @@ -623,9 +666,10 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f } /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - const std::vector* in_data_vector_ptr, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + const std::vector* in_data_vector_ptr, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -643,10 +687,11 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f ); } - anvil_assert(in_data_vector_ptr->size() * sizeof(uint32_t) == in_buffer_ptr->get_size() ); + anvil_assert(in_data_vector_ptr->size() * sizeof(uint32_t) == in_buffer_ptr->get_create_info_ptr()->get_size() ); result = add_buffer_internal(in_buffer_ptr, - in_required_memory_features); + in_required_memory_features, + in_external_memory_handle_types); if (result) { @@ -657,8 +702,9 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f } /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* in_image_ptr, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* in_image_ptr, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) { uint32_t filtered_memory_types = 0; VkDeviceSize image_alignment = 0; @@ -680,6 +726,19 @@ bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* in_image_ptr, anvil_assert(m_backend_ptr->supports_baking() ); anvil_assert(in_image_ptr != nullptr); + /* Extract external memory handle types from the specified image, if none were specified. */ + if (in_external_memory_handle_types == 0) + { + in_external_memory_handle_types = in_image_ptr->get_create_info_ptr()->get_external_memory_handle_types(); + } + + if (!do_external_memory_handle_type_sanity_checks(in_external_memory_handle_types) ) + { + result = false; + + goto end; + } + /* Determine how much size is needed for the image's storage, as well as what * the allocation requirements are */ image_alignment = in_image_ptr->get_image_alignment(); @@ -703,7 +762,8 @@ bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* in_image_ptr, image_memory_types, image_alignment, in_required_memory_features, - filtered_memory_types) + filtered_memory_types, + in_external_memory_handle_types) ); m_items.push_back( @@ -716,21 +776,24 @@ bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* in_image_ptr, } /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_offset, - VkDeviceSize in_size, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkDeviceSize in_size, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) { + uint32_t filtered_memory_types = 0; + const auto& memory_reqs = in_buffer_ptr->get_memory_requirements(); std::unique_lock mutex_lock; - auto mutex_ptr = get_mutex(); + auto mutex_ptr = get_mutex(); std::unique_ptr new_item_ptr; - bool result = true; + bool result = true; /* Sanity checks */ - anvil_assert(in_buffer_ptr != nullptr); - anvil_assert(m_backend_ptr->supports_baking () ); - anvil_assert(in_buffer_ptr->is_sparse () ); - anvil_assert(in_buffer_ptr->get_memory_requirements().size >= in_offset + in_size); + anvil_assert(in_buffer_ptr != nullptr); + anvil_assert(m_backend_ptr->supports_baking () ); + anvil_assert(in_buffer_ptr->get_create_info_ptr()->get_type() == Anvil::BufferType::SPARSE_NO_ALLOC); + anvil_assert(in_buffer_ptr->get_memory_requirements().size >= in_offset + in_size); if (mutex_ptr != nullptr) { @@ -739,11 +802,21 @@ bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* in_buff ); } + /* Extract external memory handle types from the specified buffer, if none were specified. */ + if (in_external_memory_handle_types == 0) + { + in_external_memory_handle_types = in_buffer_ptr->get_create_info_ptr()->get_external_memory_handle_types(); + } + + if (!do_external_memory_handle_type_sanity_checks(in_external_memory_handle_types) ) + { + result = false; + + goto end; + } + /* Determine how much space we're going to need, what alignment we need * to consider, and so on. */ - uint32_t filtered_memory_types = 0; - const auto& memory_reqs = in_buffer_ptr->get_memory_requirements(); - anvil_assert((in_offset % memory_reqs.alignment) == 0); if (!is_alloc_supported(memory_reqs.memoryTypeBits, @@ -764,7 +837,8 @@ bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* in_buff memory_reqs.memoryTypeBits, memory_reqs.alignment, in_required_memory_features, - filtered_memory_types) + filtered_memory_types, + in_external_memory_handle_types) ); m_items.push_back( @@ -780,10 +854,11 @@ bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* in_buff } /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* in_image_ptr, - VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* in_image_ptr, + VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) { const Anvil::SparseImageAspectProperties* aspect_props_ptr = nullptr; uint32_t filtered_memory_types = 0; @@ -798,11 +873,11 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* in_i ANVIL_REDUNDANT_VARIABLE(result); /* Sanity checks */ - anvil_assert(in_image_ptr != nullptr); - anvil_assert(m_backend_ptr->supports_baking () ); - anvil_assert(in_image_ptr->is_sparse () ); - anvil_assert(in_image_ptr->get_image_n_layers() > in_n_layer); - anvil_assert(in_image_ptr->has_aspects (in_aspect) ); + anvil_assert(in_image_ptr != nullptr); + anvil_assert(m_backend_ptr->supports_baking () ); + anvil_assert(in_image_ptr->get_create_info_ptr()->get_residency_scope() != Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED); + anvil_assert(in_image_ptr->get_create_info_ptr()->get_n_layers () > in_n_layer); + anvil_assert(in_image_ptr->has_aspects (in_aspect) ); if (mutex_ptr != nullptr) { @@ -811,6 +886,19 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* in_i ); } + /* Extract external memory handle types from the specified image, if none were specified. */ + if (in_external_memory_handle_types == 0) + { + in_external_memory_handle_types = in_image_ptr->get_create_info_ptr()->get_external_memory_handle_types(); + } + + if (!do_external_memory_handle_type_sanity_checks(in_external_memory_handle_types) ) + { + result = false; + + goto end; + } + /* Extract aspect-specific properties which includes all the miptail data we're going to need */ result = in_image_ptr->get_sparse_image_aspect_properties(in_aspect, &aspect_props_ptr); @@ -847,7 +935,8 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* in_i miptail_offset, in_image_ptr->get_image_alignment(), in_required_memory_features, - filtered_memory_types) + filtered_memory_types, + in_external_memory_handle_types) ); m_items.push_back( @@ -861,32 +950,34 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* in_i } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - VkExtent3D in_extent, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + VkExtent3D in_extent, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) { const Anvil::SparseImageAspectProperties* aspect_props_ptr = nullptr; uint32_t component_size_bits[4] = {0}; uint32_t filtered_memory_types = 0; - const auto image_format = in_image_ptr->get_image_format(); + const auto image_format = in_image_ptr->get_create_info_ptr()->get_format(); uint32_t mip_size[3]; std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); std::unique_ptr new_item_ptr; bool result = true; + const VkDeviceSize tile_size = in_image_ptr->get_memory_requirements().alignment; VkDeviceSize total_region_size_in_bytes = 0; ANVIL_REDUNDANT_VARIABLE(result); /* Sanity checks */ anvil_assert(in_image_ptr != nullptr); - anvil_assert(m_backend_ptr->supports_baking () ); - anvil_assert(in_image_ptr->is_sparse () ); - anvil_assert(in_image_ptr->has_aspects (in_subresource.aspectMask) ); - anvil_assert(in_image_ptr->get_image_n_mipmaps() > in_subresource.mipLevel); - anvil_assert(in_image_ptr->get_image_n_layers () > in_subresource.arrayLayer); + anvil_assert(m_backend_ptr->supports_baking () ); + anvil_assert(in_image_ptr->get_create_info_ptr()->get_residency_scope() != Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED); + anvil_assert(in_image_ptr->has_aspects (in_subresource.aspectMask) ); + anvil_assert(in_image_ptr->get_n_mipmaps () > in_subresource.mipLevel); + anvil_assert(in_image_ptr->get_create_info_ptr()->get_n_layers () > in_subresource.arrayLayer); anvil_assert(in_extent.depth >= 1); anvil_assert(in_extent.height >= 1); @@ -901,9 +992,20 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* ); } - /* Extract image properties needed for calculations below. */ - const VkDeviceSize tile_size = in_image_ptr->get_memory_requirements().alignment; + /* Extract external memory handle types from the specified image, if none were specified. */ + if (in_external_memory_handle_types == 0) + { + in_external_memory_handle_types = in_image_ptr->get_create_info_ptr()->get_external_memory_handle_types(); + } + if (!do_external_memory_handle_type_sanity_checks(in_external_memory_handle_types) ) + { + result = false; + + goto end; + } + + /* Extract image properties needed for calculations below. */ result = in_image_ptr->get_sparse_image_aspect_properties(static_cast(in_subresource.aspectMask), &aspect_props_ptr); anvil_assert(result); @@ -1033,7 +1135,8 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* in_image_ptr->get_image_memory_types(), tile_size, in_required_memory_features, - filtered_memory_types) + filtered_memory_types, + in_external_memory_handle_types) ); m_items.push_back( @@ -1049,14 +1152,14 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* /* Please see header for specification */ bool Anvil::MemoryAllocator::bake() { - std::vector fences; - std::unique_lock mutex_lock; - auto mutex_ptr = get_mutex(); - bool needs_sparse_memory_binding = false; - bool result = false; - Anvil::SparseMemoryBindInfoID sparse_memory_bind_info_id = UINT32_MAX; - Anvil::Utils::SparseMemoryBindingUpdateInfo sparse_memory_binding; - std::shared_ptr this_ptr; + std::vector fences; + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + bool needs_sparse_memory_binding = false; + bool result = false; + Anvil::SparseMemoryBindInfoID sparse_memory_bind_info_id = UINT32_MAX; + Anvil::SparseMemoryBindingUpdateInfo sparse_memory_binding; + std::shared_ptr this_ptr; if (mutex_ptr != nullptr) { @@ -1073,8 +1176,12 @@ bool Anvil::MemoryAllocator::bake() goto end; } - /* Sanity checks */ - anvil_assert(m_items.size() > 0); + if (m_items.size() == 0) + { + result = true; + + goto end; + } result = m_backend_ptr->bake(m_items); anvil_assert(result); @@ -1089,7 +1196,7 @@ bool Anvil::MemoryAllocator::bake() case Anvil::MemoryAllocator::ITEM_TYPE_BUFFER: case Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_BUFFER_REGION: { - needs_sparse_memory_binding |= (*item_iterator)->buffer_ptr->is_sparse(); + needs_sparse_memory_binding |= ((*item_iterator)->buffer_ptr->get_create_info_ptr()->get_type() == Anvil::BufferType::SPARSE_NO_ALLOC); break; } @@ -1098,7 +1205,7 @@ bool Anvil::MemoryAllocator::bake() case Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_IMAGE_MIPTAIL: case Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_IMAGE_SUBRESOURCE: { - needs_sparse_memory_binding |= (*item_iterator)->image_ptr->is_sparse(); + needs_sparse_memory_binding |= ((*item_iterator)->image_ptr->get_create_info_ptr()->get_residency_scope() != Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED); break; } @@ -1112,9 +1219,16 @@ bool Anvil::MemoryAllocator::bake() if (needs_sparse_memory_binding) { - auto wait_fence_ptr = Anvil::Fence::create(m_device_ptr, - false, /* create_signalled */ - MT_SAFETY_DISABLED); + Anvil::FenceUniquePtr wait_fence_ptr; + + { + auto create_info_ptr = Anvil::FenceCreateInfo::create(m_device_ptr, + false); /* create_signalled */ + + create_info_ptr->set_mt_safety(MT_SAFETY_DISABLED); + + wait_fence_ptr = Anvil::Fence::create(std::move(create_info_ptr) ); + } sparse_memory_binding.set_fence(wait_fence_ptr.get() ); fences.push_back (std::move(wait_fence_ptr) ); @@ -1144,7 +1258,7 @@ bool Anvil::MemoryAllocator::bake() { case Anvil::MemoryAllocator::ITEM_TYPE_BUFFER: { - if (!item_ptr->buffer_ptr->is_sparse() ) + if (item_ptr->buffer_ptr->get_create_info_ptr()->get_type() != Anvil::BufferType::SPARSE_NO_ALLOC) { item_ptr->buffer_ptr->set_nonsparse_memory( std::move(item_ptr->alloc_memory_block_ptr) @@ -1166,7 +1280,7 @@ bool Anvil::MemoryAllocator::bake() case Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_BUFFER_REGION: { - anvil_assert(item_ptr->buffer_ptr->is_sparse() ); + anvil_assert(item_ptr->buffer_ptr->get_create_info_ptr()->get_type() == Anvil::BufferType::SPARSE_NO_ALLOC); sparse_memory_binding.append_buffer_memory_update(sparse_memory_bind_info_id, item_ptr->buffer_ptr, @@ -1181,7 +1295,7 @@ bool Anvil::MemoryAllocator::bake() case Anvil::MemoryAllocator::ITEM_TYPE_IMAGE_WHOLE: { - if (!item_ptr->image_ptr->is_sparse() ) + if (item_ptr->image_ptr->get_create_info_ptr()->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED) { item_ptr->image_ptr->set_memory( std::move(item_ptr->alloc_memory_block_ptr) @@ -1310,7 +1424,7 @@ bool Anvil::MemoryAllocator::bake() continue; } - buffer_size = current_item_ptr->buffer_ptr->get_size(); + buffer_size = current_item_ptr->buffer_ptr->get_create_info_ptr()->get_size(); if (current_item_ptr->buffer_ref_float_data_ptr != nullptr) { @@ -1421,6 +1535,30 @@ Anvil::MemoryAllocatorUniquePtr Anvil::MemoryAllocator::create_vma(const Anvil:: return std::move(result_ptr); } +bool Anvil::MemoryAllocator::do_external_memory_handle_type_sanity_checks(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const +{ + bool result = true; + + if (in_external_memory_handle_types != 0) + { + if (!m_device_ptr->supports_external_memory_handles(in_external_memory_handle_types) ) + { + anvil_assert(!m_device_ptr->supports_external_memory_handles(in_external_memory_handle_types) ); + + result = false; + } + else + if (!m_backend_ptr->supports_external_memory_handles(in_external_memory_handle_types) ) + { + anvil_assert(m_backend_ptr->supports_external_memory_handles(in_external_memory_handle_types) ); + + result = false; + } + } + + return result; +} + /** Tells whether or not a given set of memory types supports the requested memory features. */ bool Anvil::MemoryAllocator::is_alloc_supported(uint32_t in_memory_types, Anvil::MemoryFeatureFlags in_memory_features, @@ -1439,11 +1577,11 @@ bool Anvil::MemoryAllocator::is_alloc_supported(uint32_t in_mem (1u << n_memory_type) <= in_memory_types; ++n_memory_type) { - if ((is_coherent_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)) || - (is_device_local_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) || - (is_host_cached_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT)) || - (is_lazily_allocated_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT)) || - (is_mappable_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)) ) + if ((is_coherent_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)) || + (is_device_local_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) || + (is_host_cached_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT)) || + (is_lazily_allocated_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT)) || + (is_mappable_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)) ) { in_memory_types &= ~(1 << n_memory_type); } diff --git a/src/misc/object_tracker.cpp b/src/misc/object_tracker.cpp index f68cefc4..e92fda61 100644 --- a/src/misc/object_tracker.cpp +++ b/src/misc/object_tracker.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/misc/page_tracker.cpp b/src/misc/page_tracker.cpp index 3a3be343..3687af65 100644 --- a/src/misc/page_tracker.cpp +++ b/src/misc/page_tracker.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/misc/pools.cpp b/src/misc/pools.cpp index a90ae4fc..56ec2f5e 100644 --- a/src/misc/pools.cpp +++ b/src/misc/pools.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/misc/render_pass_info.cpp b/src/misc/render_pass_create_info.cpp similarity index 79% rename from src/misc/render_pass_info.cpp rename to src/misc/render_pass_create_info.cpp index 7219230d..975e63a8 100644 --- a/src/misc/render_pass_info.cpp +++ b/src/misc/render_pass_create_info.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -20,33 +20,33 @@ // THE SOFTWARE. // -#include "misc/render_pass_info.h" +#include "misc/render_pass_create_info.h" #include "wrappers/device.h" #include #include -Anvil::RenderPassInfo::RenderPassInfo(const Anvil::BaseDevice* in_device_ptr) +Anvil::RenderPassCreateInfo::RenderPassCreateInfo(const Anvil::BaseDevice* in_device_ptr) :m_device_ptr (in_device_ptr), m_update_preserved_attachments(false) { anvil_assert(in_device_ptr != nullptr); } -Anvil::RenderPassInfo::~RenderPassInfo() +Anvil::RenderPassCreateInfo::~RenderPassCreateInfo() { /* Stub */ } /* Please see haeder for specification */ -bool Anvil::RenderPassInfo::add_color_attachment(VkFormat in_format, - VkSampleCountFlags in_sample_count, - VkAttachmentLoadOp in_load_op, - VkAttachmentStoreOp in_store_op, - VkImageLayout in_initial_layout, - VkImageLayout in_final_layout, - bool in_may_alias, - RenderPassAttachmentID* out_attachment_id_ptr) +bool Anvil::RenderPassCreateInfo::add_color_attachment(VkFormat in_format, + VkSampleCountFlags in_sample_count, + VkAttachmentLoadOp in_load_op, + VkAttachmentStoreOp in_store_op, + VkImageLayout in_initial_layout, + VkImageLayout in_final_layout, + bool in_may_alias, + RenderPassAttachmentID* out_attachment_id_ptr) { uint32_t new_attachment_index = UINT32_MAX; bool result = false; @@ -91,13 +91,13 @@ bool Anvil::RenderPassInfo::add_color_attachment(VkFormat in_form * @return true if the dependency was added successfully; false otherwise. * **/ -bool Anvil::RenderPassInfo::add_dependency(SubPass* in_destination_subpass_ptr, - SubPass* in_source_subpass_ptr, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) +bool Anvil::RenderPassCreateInfo::add_dependency(SubPass* in_destination_subpass_ptr, + SubPass* in_source_subpass_ptr, + VkPipelineStageFlags in_source_stage_mask, + VkPipelineStageFlags in_destination_stage_mask, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region) { auto new_dep = SubPassDependency(in_destination_stage_mask, in_destination_subpass_ptr, @@ -118,16 +118,16 @@ bool Anvil::RenderPassInfo::add_dependency(SubPass* in_destination_s } /* Please see header for specification */ -bool Anvil::RenderPassInfo::add_depth_stencil_attachment(VkFormat in_format, - VkSampleCountFlags in_sample_count, - VkAttachmentLoadOp in_depth_load_op, - VkAttachmentStoreOp in_depth_store_op, - VkAttachmentLoadOp in_stencil_load_op, - VkAttachmentStoreOp in_stencil_store_op, - VkImageLayout in_initial_layout, - VkImageLayout in_final_layout, - bool in_may_alias, - RenderPassAttachmentID* out_attachment_id_ptr) +bool Anvil::RenderPassCreateInfo::add_depth_stencil_attachment(VkFormat in_format, + VkSampleCountFlags in_sample_count, + VkAttachmentLoadOp in_depth_load_op, + VkAttachmentStoreOp in_depth_store_op, + VkAttachmentLoadOp in_stencil_load_op, + VkAttachmentStoreOp in_stencil_store_op, + VkImageLayout in_initial_layout, + VkImageLayout in_final_layout, + bool in_may_alias, + RenderPassAttachmentID* out_attachment_id_ptr) { uint32_t new_attachment_index = UINT32_MAX; bool result = false; @@ -159,12 +159,12 @@ bool Anvil::RenderPassInfo::add_depth_stencil_attachment(VkFormat } /* Please see header for specification */ -bool Anvil::RenderPassInfo::add_external_to_subpass_dependency(SubPassID in_destination_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) +bool Anvil::RenderPassCreateInfo::add_external_to_subpass_dependency(SubPassID in_destination_subpass_id, + VkPipelineStageFlags in_source_stage_mask, + VkPipelineStageFlags in_destination_stage_mask, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region) { SubPass* destination_subpass_ptr = nullptr; bool result = false; @@ -190,12 +190,12 @@ bool Anvil::RenderPassInfo::add_external_to_subpass_dependency(SubPassID } /* Please see header for specification */ -bool Anvil::RenderPassInfo::add_self_subpass_dependency(SubPassID in_destination_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) +bool Anvil::RenderPassCreateInfo::add_self_subpass_dependency(SubPassID in_destination_subpass_id, + VkPipelineStageFlags in_source_stage_mask, + VkPipelineStageFlags in_destination_stage_mask, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region) { SubPass* destination_subpass_ptr = nullptr; bool result = false; @@ -220,8 +220,7 @@ bool Anvil::RenderPassInfo::add_self_subpass_dependency(SubPassID in_ } /* Please see header for specification */ -bool Anvil::RenderPassInfo::add_subpass(SubPassID* out_subpass_id_ptr) - +bool Anvil::RenderPassCreateInfo::add_subpass(SubPassID* out_subpass_id_ptr) { uint32_t new_subpass_index = UINT32_MAX; bool result = false; @@ -274,13 +273,13 @@ bool Anvil::RenderPassInfo::add_subpass(SubPassID* out_subpass_id_ptr) * @return true if the function executed successfully, false otherwise. * **/ -bool Anvil::RenderPassInfo::add_subpass_attachment(SubPassID in_subpass_id, - bool in_is_color_attachment, - VkImageLayout in_layout, - RenderPassAttachmentID in_attachment_id, - uint32_t in_attachment_location, - bool in_should_resolve, - RenderPassAttachmentID in_resolve_attachment_id) +bool Anvil::RenderPassCreateInfo::add_subpass_attachment(SubPassID in_subpass_id, + bool in_is_color_attachment, + VkImageLayout in_layout, + RenderPassAttachmentID in_attachment_id, + uint32_t in_attachment_location, + bool in_should_resolve, + RenderPassAttachmentID in_resolve_attachment_id) { bool result = false; LocationToSubPassAttachmentMap* subpass_attachments_ptr = nullptr; @@ -348,11 +347,11 @@ bool Anvil::RenderPassInfo::add_subpass_attachment(SubPassID in_sub } /* Please see header for specification */ -bool Anvil::RenderPassInfo::add_subpass_color_attachment(SubPassID in_subpass_id, - VkImageLayout in_input_layout, - RenderPassAttachmentID in_attachment_id, - uint32_t in_location, - const RenderPassAttachmentID* in_attachment_resolve_id_ptr) +bool Anvil::RenderPassCreateInfo::add_subpass_color_attachment(SubPassID in_subpass_id, + VkImageLayout in_input_layout, + RenderPassAttachmentID in_attachment_id, + uint32_t in_location, + const RenderPassAttachmentID* in_attachment_resolve_id_ptr) { return add_subpass_attachment(in_subpass_id, true, /* is_color_attachment */ @@ -365,9 +364,9 @@ bool Anvil::RenderPassInfo::add_subpass_color_attachment(SubPassID } /* Please see header for specification */ -bool Anvil::RenderPassInfo::add_subpass_depth_stencil_attachment(SubPassID in_subpass_id, - RenderPassAttachmentID in_attachment_id, - VkImageLayout in_layout) +bool Anvil::RenderPassCreateInfo::add_subpass_depth_stencil_attachment(SubPassID in_subpass_id, + VkImageLayout in_layout, + RenderPassAttachmentID in_attachment_id) { bool result = false; SubPass* subpass_ptr = nullptr; @@ -411,10 +410,10 @@ bool Anvil::RenderPassInfo::add_subpass_depth_stencil_attachment(SubPassID } /* Please see header for specification */ -bool Anvil::RenderPassInfo::add_subpass_input_attachment(SubPassID in_subpass_id, - VkImageLayout in_layout, - RenderPassAttachmentID in_attachment_id, - uint32_t in_attachment_index) +bool Anvil::RenderPassCreateInfo::add_subpass_input_attachment(SubPassID in_subpass_id, + VkImageLayout in_layout, + RenderPassAttachmentID in_attachment_id, + uint32_t in_attachment_index) { return add_subpass_attachment(in_subpass_id, false, /* is_color_attachment */ @@ -426,12 +425,12 @@ bool Anvil::RenderPassInfo::add_subpass_input_attachment(SubPassID } /* Please see header for specification */ -bool Anvil::RenderPassInfo::add_subpass_to_external_dependency(SubPassID in_source_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) +bool Anvil::RenderPassCreateInfo::add_subpass_to_external_dependency(SubPassID in_source_subpass_id, + VkPipelineStageFlags in_source_stage_mask, + VkPipelineStageFlags in_destination_stage_mask, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region) { bool result = false; SubPass* source_subpass_ptr = nullptr; @@ -457,13 +456,13 @@ bool Anvil::RenderPassInfo::add_subpass_to_external_dependency(SubPassID } /* Please see header for specification */ -bool Anvil::RenderPassInfo::add_subpass_to_subpass_dependency(SubPassID in_source_subpass_id, - SubPassID in_destination_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) +bool Anvil::RenderPassCreateInfo::add_subpass_to_subpass_dependency(SubPassID in_source_subpass_id, + SubPassID in_destination_subpass_id, + VkPipelineStageFlags in_source_stage_mask, + VkPipelineStageFlags in_destination_stage_mask, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region) { SubPass* destination_subpass_ptr = nullptr; bool result = false; @@ -503,7 +502,7 @@ bool Anvil::RenderPassInfo::add_subpass_to_subpass_dependency(SubPassID * * @return As per description. **/ -VkAttachmentReference Anvil::RenderPassInfo::get_attachment_reference_from_renderpass_attachment(const RenderPassAttachment& in_renderpass_attachment) const +VkAttachmentReference Anvil::RenderPassCreateInfo::get_attachment_reference_from_renderpass_attachment(const RenderPassAttachment& in_renderpass_attachment) const { VkAttachmentReference attachment_vk; @@ -519,7 +518,7 @@ VkAttachmentReference Anvil::RenderPassInfo::get_attachment_reference_from_rende * * @return As per description. **/ -VkAttachmentReference Anvil::RenderPassInfo::get_attachment_reference_from_subpass_attachment(const SubPassAttachment& in_subpass_attachment) const +VkAttachmentReference Anvil::RenderPassCreateInfo::get_attachment_reference_from_subpass_attachment(const SubPassAttachment& in_subpass_attachment) const { VkAttachmentReference attachment_vk; @@ -536,8 +535,8 @@ VkAttachmentReference Anvil::RenderPassInfo::get_attachment_reference_from_subpa * * @return As per description. **/ -VkAttachmentReference Anvil::RenderPassInfo::get_attachment_reference_for_resolve_attachment(const SubPassesConstIterator& in_subpass_iterator, - const LocationToSubPassAttachmentMapConstIterator& in_location_to_subpass_att_map_iterator) const +VkAttachmentReference Anvil::RenderPassCreateInfo::get_attachment_reference_for_resolve_attachment(const SubPassesConstIterator& in_subpass_iterator, + const LocationToSubPassAttachmentMapConstIterator& in_location_to_subpass_att_map_iterator) const { VkAttachmentReference result; @@ -550,8 +549,8 @@ VkAttachmentReference Anvil::RenderPassInfo::get_attachment_reference_for_resolv } /* Please see header for specification */ -bool Anvil::RenderPassInfo::get_attachment_type(RenderPassAttachmentID in_attachment_id, - AttachmentType* out_attachment_type_ptr) const +bool Anvil::RenderPassCreateInfo::get_attachment_type(RenderPassAttachmentID in_attachment_id, + AttachmentType* out_attachment_type_ptr) const { bool result = false; @@ -571,13 +570,13 @@ bool Anvil::RenderPassInfo::get_attachment_type(RenderPassAttachmentID in_attach } /* Please see header for specification */ -bool Anvil::RenderPassInfo::get_color_attachment_properties(RenderPassAttachmentID in_attachment_id, - VkSampleCountFlagBits* out_opt_sample_count_ptr, - VkAttachmentLoadOp* out_opt_load_op_ptr, - VkAttachmentStoreOp* out_opt_store_op_ptr, - VkImageLayout* out_opt_initial_layout_ptr, - VkImageLayout* out_opt_final_layout_ptr, - bool* out_opt_may_alias_ptr) const +bool Anvil::RenderPassCreateInfo::get_color_attachment_properties(RenderPassAttachmentID in_attachment_id, + VkSampleCountFlagBits* out_opt_sample_count_ptr, + VkAttachmentLoadOp* out_opt_load_op_ptr, + VkAttachmentStoreOp* out_opt_store_op_ptr, + VkImageLayout* out_opt_initial_layout_ptr, + VkImageLayout* out_opt_final_layout_ptr, + bool* out_opt_may_alias_ptr) const { bool result = false; @@ -622,17 +621,17 @@ bool Anvil::RenderPassInfo::get_color_attachment_properties(RenderPassAttachment } /** Please see header for specification */ -bool Anvil::RenderPassInfo::get_dependency_properties(uint32_t in_n_dependency, - SubPassID* out_destination_subpass_id_ptr, - SubPassID* out_source_subpass_id_ptr, - VkPipelineStageFlags* out_destination_stage_mask_ptr, - VkPipelineStageFlags* out_source_stage_mask_ptr, - VkAccessFlags* out_destination_access_mask_ptr, - VkAccessFlags* out_source_access_mask_ptr, - bool* out_by_region_ptr) const +bool Anvil::RenderPassCreateInfo::get_dependency_properties(uint32_t in_n_dependency, + SubPassID* out_destination_subpass_id_ptr, + SubPassID* out_source_subpass_id_ptr, + VkPipelineStageFlags* out_destination_stage_mask_ptr, + VkPipelineStageFlags* out_source_stage_mask_ptr, + VkAccessFlags* out_destination_access_mask_ptr, + VkAccessFlags* out_source_access_mask_ptr, + bool* out_by_region_ptr) const { - const Anvil::RenderPassInfo::SubPassDependency* dep_ptr = nullptr; - bool result = false; + const Anvil::RenderPassCreateInfo::SubPassDependency* dep_ptr = nullptr; + bool result = false; if (m_subpass_dependencies.size() <= in_n_dependency) { @@ -660,14 +659,14 @@ bool Anvil::RenderPassInfo::get_dependency_properties(uint32_t in_n } /** Please see header for specification */ -bool Anvil::RenderPassInfo::get_depth_stencil_attachment_properties(RenderPassAttachmentID in_attachment_id, - VkAttachmentLoadOp* out_opt_depth_load_op_ptr, - VkAttachmentStoreOp* out_opt_depth_store_op_ptr, - VkAttachmentLoadOp* out_opt_stencil_load_op_ptr, - VkAttachmentStoreOp* out_opt_stencil_store_op_ptr, - VkImageLayout* out_opt_initial_layout_ptr, - VkImageLayout* out_opt_final_layout_ptr, - bool* out_opt_may_alias_ptr) const +bool Anvil::RenderPassCreateInfo::get_depth_stencil_attachment_properties(RenderPassAttachmentID in_attachment_id, + VkAttachmentLoadOp* out_opt_depth_load_op_ptr, + VkAttachmentStoreOp* out_opt_depth_store_op_ptr, + VkAttachmentLoadOp* out_opt_stencil_load_op_ptr, + VkAttachmentStoreOp* out_opt_stencil_store_op_ptr, + VkImageLayout* out_opt_initial_layout_ptr, + VkImageLayout* out_opt_final_layout_ptr, + bool* out_opt_may_alias_ptr) const { bool result = false; @@ -717,9 +716,9 @@ bool Anvil::RenderPassInfo::get_depth_stencil_attachment_properties(RenderPassAt } /* Please see header for specification */ -bool Anvil::RenderPassInfo::get_subpass_n_attachments(SubPassID in_subpass_id, - AttachmentType in_attachment_type, - uint32_t* out_n_attachments_ptr) const +bool Anvil::RenderPassCreateInfo::get_subpass_n_attachments(SubPassID in_subpass_id, + AttachmentType in_attachment_type, + uint32_t* out_n_attachments_ptr) const { bool result = false; @@ -769,11 +768,11 @@ bool Anvil::RenderPassInfo::get_subpass_n_attachments(SubPassID in_subpass_ } /* Please see header for specification */ -bool Anvil::RenderPassInfo::get_subpass_attachment_properties(SubPassID in_subpass_id, - AttachmentType in_attachment_type, - uint32_t in_n_subpass_attachment, - RenderPassAttachmentID* out_renderpass_attachment_id_ptr, - VkImageLayout* out_layout_ptr) const +bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID in_subpass_id, + AttachmentType in_attachment_type, + uint32_t in_n_subpass_attachment, + RenderPassAttachmentID* out_renderpass_attachment_id_ptr, + VkImageLayout* out_layout_ptr) const { SubPassAttachment attachment; bool result = false; @@ -883,7 +882,7 @@ bool Anvil::RenderPassInfo::get_subpass_attachment_properties(SubPassID * * This function should be considered expensive. **/ -void Anvil::RenderPassInfo::update_preserved_attachments() const +void Anvil::RenderPassCreateInfo::update_preserved_attachments() const { anvil_assert(m_update_preserved_attachments); @@ -1055,7 +1054,7 @@ void Anvil::RenderPassInfo::update_preserved_attachments() const } /** Please see header for specification */ -Anvil::RenderPassInfo::SubPass::~SubPass() +Anvil::RenderPassCreateInfo::SubPass::~SubPass() { /* Stub */ } diff --git a/src/misc/sampler_create_info.cpp b/src/misc/sampler_create_info.cpp new file mode 100644 index 00000000..e7006fa7 --- /dev/null +++ b/src/misc/sampler_create_info.cpp @@ -0,0 +1,100 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#include "misc/sampler_create_info.h" + +Anvil::SamplerCreateInfoUniquePtr Anvil::SamplerCreateInfo::create(const Anvil::BaseDevice* in_device_ptr, + VkFilter in_mag_filter, + VkFilter in_min_filter, + VkSamplerMipmapMode in_mipmap_mode, + VkSamplerAddressMode in_address_mode_u, + VkSamplerAddressMode in_address_mode_v, + VkSamplerAddressMode in_address_mode_w, + float in_lod_bias, + float in_max_anisotropy, + bool in_compare_enable, + VkCompareOp in_compare_op, + float in_min_lod, + float in_max_lod, + VkBorderColor in_border_color, + bool in_use_unnormalized_coordinates, + MTSafety in_mt_safety) +{ + Anvil::SamplerCreateInfoUniquePtr result_ptr; + + result_ptr.reset( + new Anvil::SamplerCreateInfo(in_device_ptr, + in_mag_filter, + in_min_filter, + in_mipmap_mode, + in_address_mode_u, + in_address_mode_v, + in_address_mode_w, + in_lod_bias, + in_max_anisotropy, + in_compare_enable, + in_compare_op, + in_min_lod, + in_max_lod, + in_border_color, + in_use_unnormalized_coordinates, + in_mt_safety) + ); + + return result_ptr; +} + +Anvil::SamplerCreateInfo::SamplerCreateInfo(const Anvil::BaseDevice* in_device_ptr, + VkFilter in_mag_filter, + VkFilter in_min_filter, + VkSamplerMipmapMode in_mipmap_mode, + VkSamplerAddressMode in_address_mode_u, + VkSamplerAddressMode in_address_mode_v, + VkSamplerAddressMode in_address_mode_w, + float in_lod_bias, + float in_max_anisotropy, + bool in_compare_enable, + VkCompareOp in_compare_op, + float in_min_lod, + float in_max_lod, + VkBorderColor in_border_color, + bool in_use_unnormalized_coordinates, + MTSafety in_mt_safety) + :m_address_mode_u (in_address_mode_u), + m_address_mode_v (in_address_mode_v), + m_address_mode_w (in_address_mode_w), + m_border_color (in_border_color), + m_compare_enable (in_compare_enable), + m_compare_op (in_compare_op), + m_device_ptr (in_device_ptr), + m_lod_bias (in_lod_bias), + m_mag_filter (in_mag_filter), + m_max_anisotropy (in_max_anisotropy), + m_max_lod (in_max_lod), + m_min_filter (in_min_filter), + m_min_lod (in_min_lod), + m_mipmap_mode (in_mipmap_mode), + m_mt_safety (in_mt_safety), + m_use_unnormalized_coordinates(in_use_unnormalized_coordinates) +{ + /* Stub */ +} diff --git a/src/misc/semaphore_create_info.cpp b/src/misc/semaphore_create_info.cpp new file mode 100644 index 00000000..925a49c6 --- /dev/null +++ b/src/misc/semaphore_create_info.cpp @@ -0,0 +1,44 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#include "misc/semaphore_create_info.h" + +Anvil::SemaphoreCreateInfoUniquePtr Anvil::SemaphoreCreateInfo::create(const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety) +{ + Anvil::SemaphoreCreateInfoUniquePtr result_ptr(nullptr, + std::default_delete() ); + + result_ptr.reset( + new Anvil::SemaphoreCreateInfo(in_device_ptr, + in_mt_safety) + ); + + return result_ptr; +} + +Anvil::SemaphoreCreateInfo::SemaphoreCreateInfo(const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety) + :m_device_ptr(in_device_ptr), + m_mt_safety (in_mt_safety) +{ + /* Stub */ +} \ No newline at end of file diff --git a/src/misc/shader_module_cache.cpp b/src/misc/shader_module_cache.cpp index 4eb6d87f..f70fef3e 100644 --- a/src/misc/shader_module_cache.cpp +++ b/src/misc/shader_module_cache.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/misc/swapchain_create_info.cpp b/src/misc/swapchain_create_info.cpp new file mode 100644 index 00000000..0b548528 --- /dev/null +++ b/src/misc/swapchain_create_info.cpp @@ -0,0 +1,74 @@ +// +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#include "misc/swapchain_create_info.h" + + +Anvil::SwapchainCreateInfoUniquePtr Anvil::SwapchainCreateInfo::create(Anvil::BaseDevice* in_device_ptr, + Anvil::RenderingSurface* in_parent_surface_ptr, + Anvil::Window* in_window_ptr, + VkFormat in_format, + VkPresentModeKHR in_present_mode, + VkImageUsageFlags in_usage_flags, + uint32_t in_n_images) +{ + SwapchainCreateInfoUniquePtr result_ptr = SwapchainCreateInfoUniquePtr(nullptr, + std::default_delete() ); + + result_ptr.reset( + new SwapchainCreateInfo(in_device_ptr, + in_parent_surface_ptr, + in_window_ptr, + in_format, + in_present_mode, + in_usage_flags, + in_n_images, + Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + 0) /* in_flags */ + ); + + return result_ptr; +} + +Anvil::SwapchainCreateInfo::SwapchainCreateInfo(Anvil::BaseDevice* in_device_ptr, + Anvil::RenderingSurface* in_parent_surface_ptr, + Anvil::Window* in_window_ptr, + VkFormat in_format, + VkPresentModeKHR in_present_mode, + VkImageUsageFlags in_usage_flags, + uint32_t in_n_images, + MTSafety in_mt_safety, + VkSwapchainCreateFlagsKHR in_flags) + :m_device_ptr (in_device_ptr), + m_flags (in_flags), + m_format (in_format), + m_mt_safety (in_mt_safety), + m_n_images (in_n_images), + m_parent_surface_ptr(in_parent_surface_ptr), + m_present_mode (in_present_mode), + m_usage_flags (in_usage_flags), + m_window_ptr (in_window_ptr) +{ + anvil_assert(in_n_images > 0); + anvil_assert(in_parent_surface_ptr != nullptr); + anvil_assert(in_usage_flags != 0); +} diff --git a/src/misc/time.cpp b/src/misc/time.cpp index dea7fbfc..ef8a3661 100644 --- a/src/misc/time.cpp +++ b/src/misc/time.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/misc/types.cpp b/src/misc/types.cpp index 6d77aec0..a1776a31 100644 --- a/src/misc/types.cpp +++ b/src/misc/types.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -20,3351 +20,4 @@ // THE SOFTWARE. // -#include -#include -#include "misc/debug.h" -#include "misc/descriptor_set_info.h" -#include "wrappers/buffer.h" -#include "wrappers/descriptor_set_layout.h" -#include "wrappers/device.h" -#include "wrappers/image.h" -#include "wrappers/memory_block.h" -#include "wrappers/physical_device.h" -#include "wrappers/semaphore.h" -#include "wrappers/shader_module.h" -#define BOOL_TO_VK_BOOL32(x) ((x) ? VK_TRUE : VK_FALSE); -#define VK_BOOL32_TO_BOOL(x) ((x == VK_FALSE) ? false : true) - -#ifdef max - #undef max -#endif - -/** Please see header for specification */ -Anvil::BufferBarrier::BufferBarrier(const BufferBarrier& in) -{ - buffer = in.buffer; - buffer_barrier_vk = in.buffer_barrier_vk; - buffer_ptr = in.buffer_ptr; - dst_access_mask = in.dst_access_mask; - dst_queue_family_index = in.dst_queue_family_index; - offset = in.offset; - size = in.size; - src_access_mask = in.src_access_mask; - src_queue_family_index = in.src_queue_family_index; -} - -/** Please see header for specification */ -Anvil::BufferBarrier::BufferBarrier(VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - uint32_t in_src_queue_family_index, - uint32_t in_dst_queue_family_index, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_offset, - VkDeviceSize in_size) -{ - buffer = in_buffer_ptr->get_buffer(); - buffer_ptr = in_buffer_ptr; - dst_access_mask = static_cast(in_destination_access_mask); - dst_queue_family_index = in_dst_queue_family_index; - offset = in_offset; - size = in_size; - src_access_mask = static_cast(in_source_access_mask); - src_queue_family_index = in_src_queue_family_index; - - buffer_barrier_vk.buffer = in_buffer_ptr->get_buffer(); - buffer_barrier_vk.dstAccessMask = in_destination_access_mask; - buffer_barrier_vk.dstQueueFamilyIndex = in_dst_queue_family_index; - buffer_barrier_vk.offset = in_offset; - buffer_barrier_vk.pNext = nullptr; - buffer_barrier_vk.size = in_size; - buffer_barrier_vk.srcAccessMask = in_source_access_mask, - buffer_barrier_vk.srcQueueFamilyIndex = in_src_queue_family_index; - buffer_barrier_vk.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER; - - /* NOTE: For an image barrier to work correctly, the underlying subresource range must be assigned memory. - * Query for a memory block in order to force any listening memory allocators to bake */ - auto memory_block_ptr = buffer_ptr->get_memory_block(0 /* in_n_memory_block */); - - ANVIL_REDUNDANT_VARIABLE(memory_block_ptr); -} - -/** Please see header for specification */ -Anvil::BufferBarrier::~BufferBarrier() -{ - /* Stub */ -} - -Anvil::DescriptorSetAllocation::DescriptorSetAllocation(const Anvil::DescriptorSetLayout* in_ds_layout_ptr) -{ - anvil_assert( in_ds_layout_ptr != nullptr); - - ds_layout_ptr = in_ds_layout_ptr; -} - -/** Please see header for specification */ -VkDescriptorUpdateTemplateEntryKHR Anvil::DescriptorUpdateTemplateEntry::get_vk_descriptor_update_template_entry_khr() const -{ - VkDescriptorUpdateTemplateEntryKHR result; - - result.descriptorCount = n_descriptors; - result.descriptorType = descriptor_type; - result.dstArrayElement = n_destination_array_element; - result.dstBinding = n_destination_binding; - result.offset = offset; - result.stride = stride; - - return result; -} - -/** Please see header for specification */ -Anvil::DeviceExtensionConfiguration::DeviceExtensionConfiguration() -{ - amd_draw_indirect_count = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - amd_gcn_shader = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - amd_gpu_shader_half_float = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - amd_gpu_shader_int16 = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - amd_rasterization_order = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - amd_shader_ballot = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - amd_shader_explicit_vertex_parameter = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - amd_shader_fragment_mask = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - amd_shader_image_load_store_lod = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - amd_shader_info = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - amd_shader_trinary_minmax = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - amd_texture_gather_bias_lod = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - ext_shader_stencil_export = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - ext_shader_subgroup_ballot = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - ext_shader_subgroup_vote = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - khr_16bit_storage = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - khr_bind_memory2 = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - khr_descriptor_update_template = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - khr_maintenance1 = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - khr_maintenance3 = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - khr_storage_buffer_storage_class = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - khr_surface = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - khr_swapchain = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - - /* VK_AMD_negative_viewport_height interacts with KHR_maintenance1, hence it needs - * to be enabled manually. - */ - amd_negative_viewport_height = EXTENSION_AVAILABILITY_IGNORE; - - /* VK_EXT_debug_marker is only useful for debugging. */ - #if defined(_DEBUG) - { - ext_debug_marker = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; - } - #else - { - ext_debug_marker = EXTENSION_AVAILABILITY_IGNORE; - } - #endif - -} - -/** Please see header for specification */ -bool Anvil::DeviceExtensionConfiguration::is_supported_by_physical_device(const Anvil::PhysicalDevice* in_physical_device_ptr, - std::vector* out_opt_unsupported_extensions_ptr) const -{ - typedef struct ExtensionItem - { - const char* extension_name; - bool is_required; - - ExtensionItem(const char* in_extension_name, - const bool& in_is_required) - { - extension_name = in_extension_name; - is_required = in_is_required; - } - } ExtensionItem; - - bool result = true; - std::vector extensions = - { - ExtensionItem(VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME, amd_draw_indirect_count == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_AMD_GCN_SHADER_EXTENSION_NAME, amd_gcn_shader == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME, amd_gpu_shader_half_float == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_AMD_GPU_SHADER_INT16_EXTENSION_NAME, amd_gpu_shader_int16 == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME, amd_negative_viewport_height == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME, amd_rasterization_order == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_AMD_SHADER_BALLOT_EXTENSION_NAME, amd_shader_ballot == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME, amd_shader_explicit_vertex_parameter == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_AMD_SHADER_FRAGMENT_MASK_EXTENSION_NAME, amd_shader_fragment_mask == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_EXTENSION_NAME, amd_shader_image_load_store_lod == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_AMD_SHADER_INFO_EXTENSION_NAME, amd_shader_info == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME, amd_shader_trinary_minmax == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME, amd_texture_gather_bias_lod == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_EXT_DEBUG_MARKER_EXTENSION_NAME, ext_debug_marker == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem("VK_EXT_shader_stencil_export", ext_shader_stencil_export == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME, ext_shader_subgroup_ballot == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME, ext_shader_subgroup_vote == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_KHR_16BIT_STORAGE_EXTENSION_NAME, khr_16bit_storage == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_KHR_BIND_MEMORY_2_EXTENSION_NAME, khr_bind_memory2 == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME, khr_descriptor_update_template == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_KHR_MAINTENANCE1_EXTENSION_NAME, khr_maintenance1 == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_KHR_MAINTENANCE3_EXTENSION_NAME, khr_maintenance3 == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem("VK_KHR_storage_buffer_storage_class", khr_storage_buffer_storage_class == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_KHR_SURFACE_EXTENSION_NAME, khr_surface == Anvil::EXTENSION_AVAILABILITY_REQUIRE), - ExtensionItem(VK_KHR_SWAPCHAIN_EXTENSION_NAME, khr_swapchain == Anvil::EXTENSION_AVAILABILITY_REQUIRE) - }; - - if (out_opt_unsupported_extensions_ptr != nullptr) - { - out_opt_unsupported_extensions_ptr->clear(); - } - - for (const auto& extension : other_extensions) - { - if (extension.second == Anvil::EXTENSION_AVAILABILITY_REQUIRE) - { - extensions.push_back( - ExtensionItem(extension.first.c_str(), - true) - ); - } - } - - for (const auto& current_extension : extensions) - { - if (!in_physical_device_ptr->is_device_extension_supported(current_extension.extension_name) && - current_extension.is_required) - { - result = false; - - if (out_opt_unsupported_extensions_ptr == nullptr) - { - break; - } - else - { - out_opt_unsupported_extensions_ptr->push_back(current_extension.extension_name); - } - } - } - - return result; -} - -bool Anvil::DeviceExtensionConfiguration::operator==(const Anvil::DeviceExtensionConfiguration& in_config) const -{ - bool result; - - result = (amd_draw_indirect_count == in_config.amd_draw_indirect_count) && - (amd_gcn_shader == in_config.amd_gcn_shader) && - (amd_gpu_shader_half_float == in_config.amd_gpu_shader_half_float) && - (amd_gpu_shader_int16 == in_config.amd_gpu_shader_int16) && - (amd_negative_viewport_height == in_config.amd_negative_viewport_height) && - (amd_rasterization_order == in_config.amd_rasterization_order) && - (amd_shader_ballot == in_config.amd_shader_ballot) && - (amd_shader_explicit_vertex_parameter == in_config.amd_shader_explicit_vertex_parameter) && - (amd_shader_fragment_mask == in_config.amd_shader_fragment_mask) && - (amd_shader_image_load_store_lod == in_config.amd_shader_image_load_store_lod) && - (amd_shader_info == in_config.amd_shader_info) && - (amd_shader_trinary_minmax == in_config.amd_shader_trinary_minmax) && - (amd_texture_gather_bias_lod == in_config.amd_texture_gather_bias_lod) && - (ext_debug_marker == in_config.ext_debug_marker) && - (ext_shader_stencil_export == in_config.ext_shader_stencil_export) && - (ext_shader_subgroup_ballot == in_config.ext_shader_subgroup_ballot) && - (ext_shader_subgroup_vote == in_config.ext_shader_subgroup_vote) && - (khr_16bit_storage == in_config.khr_16bit_storage) && - (khr_bind_memory2 == in_config.khr_bind_memory2) && - (khr_descriptor_update_template == in_config.khr_descriptor_update_template) && - (khr_maintenance1 == in_config.khr_maintenance1) && - (khr_maintenance3 == in_config.khr_maintenance3) && - (khr_storage_buffer_storage_class == in_config.khr_storage_buffer_storage_class) && - (khr_surface == in_config.khr_surface) && - (khr_swapchain == in_config.khr_swapchain); - - if (result) - { - for (const auto& current_other_extension : other_extensions) - { - auto iterator = std::find(in_config.other_extensions.begin(), - in_config.other_extensions.end(), - current_other_extension); - - if (iterator == in_config.other_extensions.end() ) - { - result = false; - - break; - } - } - } - - return result; -} - -/** Please see header for specification */ -bool Anvil::operator==(const Anvil::FormatProperties& in1, - const Anvil::FormatProperties& in2) -{ - return memcmp(&in1, - &in2, - sizeof(Anvil::FormatProperties) ) == 0; -} - -/** Please see header for specification */ -Anvil::ImageBarrier::ImageBarrier(const ImageBarrier& in) -{ - dst_access_mask = in.dst_access_mask; - dst_queue_family_index = in.dst_queue_family_index; - image = in.image; - image_barrier_vk = in.image_barrier_vk; - image_ptr = in.image_ptr; - new_layout = in.new_layout; - old_layout = in.old_layout; - src_access_mask = in.src_access_mask; - src_queue_family_index = in.src_queue_family_index; - subresource_range = in.subresource_range; -} - -/** Please see header for specification */ -Anvil::ImageBarrier::ImageBarrier(VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region_barrier, - VkImageLayout in_old_layout, - VkImageLayout in_new_layout, - uint32_t in_src_queue_family_index, - uint32_t in_dst_queue_family_index, - Anvil::Image* in_image_ptr, - VkImageSubresourceRange in_image_subresource_range) -{ - by_region = in_by_region_barrier; - dst_access_mask = static_cast(in_destination_access_mask); - dst_queue_family_index = in_dst_queue_family_index; - image = (in_image_ptr != VK_NULL_HANDLE) ? in_image_ptr->get_image() - : VK_NULL_HANDLE; - image_ptr = in_image_ptr; - new_layout = in_new_layout; - old_layout = in_old_layout; - src_access_mask = static_cast(in_source_access_mask); - src_queue_family_index = in_src_queue_family_index; - subresource_range = in_image_subresource_range; - - image_barrier_vk.dstAccessMask = in_destination_access_mask; - image_barrier_vk.dstQueueFamilyIndex = in_dst_queue_family_index; - image_barrier_vk.image = (in_image_ptr != nullptr) ? in_image_ptr->get_image() - : VK_NULL_HANDLE; - image_barrier_vk.newLayout = in_new_layout; - image_barrier_vk.oldLayout = in_old_layout; - image_barrier_vk.pNext = nullptr; - image_barrier_vk.srcAccessMask = in_source_access_mask; - image_barrier_vk.srcQueueFamilyIndex = in_src_queue_family_index; - image_barrier_vk.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; - image_barrier_vk.subresourceRange = in_image_subresource_range; - - /* NOTE: For an image barrier to work correctly, the underlying subresource range must be assigned memory. - * Query for a memory block in order to force any listening memory allocators to bake */ - auto memory_block_ptr = image_ptr->get_memory_block(); - - ANVIL_REDUNDANT_VARIABLE(memory_block_ptr); -} - -/** Please see header for specification */ -Anvil::ImageBarrier::~ImageBarrier() -{ - /* Stub */ -} - -Anvil::KHR16BitStorageFeatures::KHR16BitStorageFeatures(const VkPhysicalDevice16BitStorageFeaturesKHR& in_features) -{ - is_input_output_storage_supported = VK_BOOL32_TO_BOOL(in_features.storageInputOutput16); - is_push_constant_16_bit_storage_supported = VK_BOOL32_TO_BOOL(in_features.storagePushConstant16); - is_storage_buffer_16_bit_access_supported = VK_BOOL32_TO_BOOL(in_features.storageBuffer16BitAccess); - is_uniform_and_storage_buffer_16_bit_access_supported = VK_BOOL32_TO_BOOL(in_features.uniformAndStorageBuffer16BitAccess); -} - -bool Anvil::KHR16BitStorageFeatures::operator==(const KHR16BitStorageFeatures& in_features) const -{ - return (in_features.is_input_output_storage_supported == is_input_output_storage_supported && - in_features.is_push_constant_16_bit_storage_supported == is_push_constant_16_bit_storage_supported && - in_features.is_storage_buffer_16_bit_access_supported == is_storage_buffer_16_bit_access_supported && - in_features.is_uniform_and_storage_buffer_16_bit_access_supported == is_uniform_and_storage_buffer_16_bit_access_supported); -} - -VkPhysicalDevice16BitStorageFeaturesKHR Anvil::KHR16BitStorageFeatures::get_vk_physical_device_16_bit_storage_features() const -{ - VkPhysicalDevice16BitStorageFeaturesKHR result; - - result.pNext = nullptr; - result.storageBuffer16BitAccess = BOOL_TO_VK_BOOL32(is_storage_buffer_16_bit_access_supported); - result.storageInputOutput16 = BOOL_TO_VK_BOOL32(is_input_output_storage_supported); - result.storagePushConstant16 = BOOL_TO_VK_BOOL32(is_push_constant_16_bit_storage_supported); - result.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR; - result.uniformAndStorageBuffer16BitAccess = BOOL_TO_VK_BOOL32(is_uniform_and_storage_buffer_16_bit_access_supported); - - return result; - -} - -Anvil::KHRMaintenance3Properties::KHRMaintenance3Properties() - :max_memory_allocation_size(std::numeric_limits::max() ), - max_per_set_descriptors (UINT32_MAX) -{ - /* Stub */ -} - -Anvil::KHRMaintenance3Properties::KHRMaintenance3Properties(const VkPhysicalDeviceMaintenance3PropertiesKHR& in_props) - :max_memory_allocation_size(in_props.maxMemoryAllocationSize), - max_per_set_descriptors (in_props.maxPerSetDescriptors) -{ - /* Stub */ -} - -bool Anvil::KHRMaintenance3Properties::operator==(const Anvil::KHRMaintenance3Properties& in_props) const -{ - return (max_memory_allocation_size == in_props.max_memory_allocation_size && - max_per_set_descriptors == in_props.max_per_set_descriptors); -} - -/* Please see header for specification */ -bool Anvil::operator==(const MemoryProperties& in1, - const MemoryProperties& in2) -{ - bool result = (in1.types.size() == in2.types.size() ); - - if (result) - { - for (uint32_t n_type = 0; - n_type < static_cast(in1.types.size() ) && result; - ++n_type) - { - const auto& current_type_in1 = in1.types.at(n_type); - const auto& current_type_in2 = in2.types.at(n_type); - - result &= (current_type_in1 == current_type_in2); - } - } - - return result; -} - -/* Please see header for specification */ -void Anvil::MemoryProperties::init(const VkPhysicalDeviceMemoryProperties& in_mem_properties) -{ - n_heaps = in_mem_properties.memoryHeapCount; - - heaps = new Anvil::MemoryHeap[n_heaps]; - anvil_assert(heaps != nullptr); - - for (unsigned int n_heap = 0; - n_heap < in_mem_properties.memoryHeapCount; - ++n_heap) - { - heaps[n_heap].flags = static_cast(in_mem_properties.memoryHeaps[n_heap].flags); - heaps[n_heap].size = in_mem_properties.memoryHeaps[n_heap].size; - } - - types.reserve(in_mem_properties.memoryTypeCount); - - for (unsigned int n_type = 0; - n_type < in_mem_properties.memoryTypeCount; - ++n_type) - { - types.push_back(MemoryType(in_mem_properties.memoryTypes[n_type], - this) ); - } -} - -/** Please see header for specification */ -bool Anvil::operator==(const MemoryHeap& in1, - const MemoryHeap& in2) -{ - return (in1.flags == in2.flags && - in1.size == in2.size); -} - -/* Please see header for specification */ -Anvil::MemoryType::MemoryType(const VkMemoryType& in_type, - struct MemoryProperties* in_memory_props_ptr) -{ - flags = static_cast(in_type.propertyFlags); - heap_ptr = &in_memory_props_ptr->heaps[in_type.heapIndex]; - - features = Anvil::Utils::get_memory_feature_flags_from_vk_property_flags(flags, - heap_ptr->flags); -} - -/* Please see header for specification */ -bool Anvil::operator==(const Anvil::MemoryType& in1, - const Anvil::MemoryType& in2) -{ - return ( in1.flags == in2.flags && - *in1.heap_ptr == *in2.heap_ptr); -} - -/** Returns a filled MipmapRawData structure for a 1D mip. - * - * NOTE: It is caller's responsibility to configure one of the data storage pointer members. - */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_1D(VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - uint32_t in_row_size) -{ - MipmapRawData result; - - memset(&result, - 0, - sizeof(result) ); - - result.aspect = in_aspect; - result.data_size = in_row_size; - result.row_size = in_row_size; - result.n_layers = 1; - result.n_slices = 1; - result.n_mipmap = in_n_mipmap; - - return result; -} - -/** Returns a filled MipmapRawData structure for a 1D Array mip. - * - * NOTE: It is caller's responsibility to configure one of the data storage pointer members. - */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_array(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - uint32_t in_row_size, - uint32_t in_data_size) -{ - MipmapRawData result; - - memset(&result, - 0, - sizeof(result) ); - - result.aspect = in_aspect; - result.data_size = in_data_size; - result.n_layer = in_n_layer; - result.n_layers = in_n_layers; - result.n_mipmap = in_n_mipmap; - result.n_slices = 1; - result.row_size = in_row_size; - - return result; -} - -/** Returns a filled MipmapRawData structure for a 2D mip. - * - * NOTE: It is caller's responsibility to configure one of the data storage pointer members. - */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_2D(VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - uint32_t in_data_size, - uint32_t in_row_size) -{ - MipmapRawData result; - - memset(&result, - 0, - sizeof(result) ); - - result.aspect = in_aspect; - result.data_size = in_data_size; - result.n_layers = 1; - result.n_mipmap = in_n_mipmap; - result.n_slices = 1; - result.row_size = in_row_size; - - return result; -} - -/** Returns a filled MipmapRawData structure for a 2D array mip. - * - * NOTE: It is caller's responsibility to configure one of the data storage pointer members. - */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_array(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - uint32_t in_data_size, - uint32_t in_row_size) -{ - MipmapRawData result; - - memset(&result, - 0, - sizeof(result) ); - - result.aspect = in_aspect; - result.data_size = in_data_size; - result.n_layer = in_n_layer; - result.n_layers = in_n_layers; - result.n_mipmap = in_n_mipmap; - result.n_slices = 1; - result.row_size = in_row_size; - - return result; -} - -/** Returns a filled MipmapRawData structure for a 3D mip. - * - * NOTE: It is caller's responsibility to configure one of the data storage pointer members. - */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_3D(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_slices, - uint32_t in_n_mipmap, - uint32_t in_data_size, - uint32_t in_row_size) -{ - MipmapRawData result; - - memset(&result, - 0, - sizeof(result) ); - - result.aspect = in_aspect; - result.data_size = in_data_size; - result.n_layers = 1; - result.n_layer = in_n_layer; - result.n_slices = in_n_slices; - result.n_mipmap = in_n_mipmap; - result.row_size = in_row_size; - - return result; -} - - -/* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_from_uchar_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - std::shared_ptr in_linear_tightly_packed_data_ptr, - uint32_t in_row_size) -{ - MipmapRawData result = create_1D(in_aspect, - in_n_mipmap, - in_row_size); - - result.linear_tightly_packed_data_uchar_ptr = in_linear_tightly_packed_data_ptr; - - return result; -} - -/* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_from_uchar_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - const unsigned char* in_linear_tightly_packed_data_ptr, - uint32_t in_row_size) -{ - MipmapRawData result = create_1D(in_aspect, - in_n_mipmap, - in_row_size); - - result.linear_tightly_packed_data_uchar_raw_ptr = in_linear_tightly_packed_data_ptr; - - return result; -} - -/* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - std::shared_ptr > in_linear_tightly_packed_data_ptr, - uint32_t in_row_size) -{ - MipmapRawData result = create_1D(in_aspect, - in_n_mipmap, - in_row_size); - - result.linear_tightly_packed_data_uchar_vec_ptr = in_linear_tightly_packed_data_ptr; - - return result; -} - -/* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_array_from_uchar_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - std::shared_ptr in_linear_tightly_packed_data_ptr, - uint32_t in_row_size, - uint32_t in_data_size) -{ - MipmapRawData result = create_1D_array(in_aspect, - in_n_layer, - in_n_layers, - in_n_mipmap, - in_row_size, - in_data_size); - - result.linear_tightly_packed_data_uchar_ptr = in_linear_tightly_packed_data_ptr; - - return result; -} - -/* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_array_from_uchar_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - const unsigned char* in_linear_tightly_packed_data_ptr, - uint32_t in_row_size, - uint32_t in_data_size) -{ - MipmapRawData result = create_1D_array(in_aspect, - in_n_layer, - in_n_layers, - in_n_mipmap, - in_row_size, - in_data_size); - - result.linear_tightly_packed_data_uchar_raw_ptr = in_linear_tightly_packed_data_ptr; - - return result; -} - -/* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_array_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - std::shared_ptr > in_linear_tightly_packed_data_ptr, - uint32_t in_row_size, - uint32_t in_data_size) -{ - MipmapRawData result = create_1D_array(in_aspect, - in_n_layer, - in_n_layers, - in_n_mipmap, - in_row_size, - in_data_size); - - result.linear_tightly_packed_data_uchar_vec_ptr = in_linear_tightly_packed_data_ptr; - - return result; -} - -/* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_from_uchar_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - std::shared_ptr in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size) -{ - MipmapRawData result = create_2D(in_aspect, - in_n_mipmap, - in_data_size, - in_row_size); - - result.linear_tightly_packed_data_uchar_ptr = in_linear_tightly_packed_data_ptr; - - return result; -} - -/* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_from_uchar_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - const unsigned char* in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size) -{ - MipmapRawData result = create_2D(in_aspect, - in_n_mipmap, - in_data_size, - in_row_size); - - result.linear_tightly_packed_data_uchar_raw_ptr = in_linear_tightly_packed_data_ptr; - - return result; -} - -/* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - std::shared_ptr > in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size) -{ - MipmapRawData result = create_2D(in_aspect, - in_n_mipmap, - in_data_size, - in_row_size); - - result.linear_tightly_packed_data_uchar_vec_ptr = in_linear_tightly_packed_data_ptr; - - return result; -} - -/* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_array_from_uchar_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - std::shared_ptr in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size) -{ - MipmapRawData result = create_2D_array(in_aspect, - in_n_layer, - in_n_layers, - in_n_mipmap, - in_data_size, - in_row_size); - - result.linear_tightly_packed_data_uchar_ptr = in_linear_tightly_packed_data_ptr; - - return result; -} - -/* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_array_from_uchar_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - const unsigned char* in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size) -{ - MipmapRawData result = create_2D_array(in_aspect, - in_n_layer, - in_n_layers, - in_n_mipmap, - in_data_size, - in_row_size); - - result.linear_tightly_packed_data_uchar_raw_ptr = in_linear_tightly_packed_data_ptr; - - return result; -} - -/* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_array_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - std::shared_ptr > in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size) -{ - MipmapRawData result = create_2D_array(in_aspect, - in_n_layer, - in_n_layers, - in_n_mipmap, - in_data_size, - in_row_size); - - result.linear_tightly_packed_data_uchar_vec_ptr = in_linear_tightly_packed_data_ptr; - - return result; -} - - - -/* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_3D_from_uchar_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layer_slices, - uint32_t in_n_mipmap, - std::shared_ptr in_linear_tightly_packed_data_ptr, - uint32_t in_slice_data_size, - uint32_t in_row_size) -{ - MipmapRawData result = create_3D(in_aspect, - in_n_layer, - in_n_layer_slices, - in_n_mipmap, - in_slice_data_size, - in_row_size); - - result.linear_tightly_packed_data_uchar_ptr = in_linear_tightly_packed_data_ptr; - - return result; -} - -/* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_3D_from_uchar_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layer_slices, - uint32_t in_n_mipmap, - const unsigned char* in_linear_tightly_packed_data_ptr, - uint32_t in_slice_data_size, - uint32_t in_row_size) -{ - MipmapRawData result = create_3D(in_aspect, - in_n_layer, - in_n_layer_slices, - in_n_mipmap, - in_slice_data_size, - in_row_size); - - result.linear_tightly_packed_data_uchar_raw_ptr = in_linear_tightly_packed_data_ptr; - - return result; -} - -/* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_3D_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layer_slices, - uint32_t in_n_mipmap, - std::shared_ptr > in_linear_tightly_packed_data_ptr, - uint32_t in_slice_data_size, - uint32_t in_row_size) -{ - MipmapRawData result = create_3D(in_aspect, - in_n_layer, - in_n_layer_slices, - in_n_mipmap, - in_slice_data_size, - in_row_size); - - result.linear_tightly_packed_data_uchar_vec_ptr = in_linear_tightly_packed_data_ptr; - - return result; -} - - -/* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_from_uchar_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_mipmap, - std::shared_ptr in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size) -{ - anvil_assert(in_n_layer < 6); - - MipmapRawData result = create_2D_array(in_aspect, - in_n_layer, - 1, /* n_layer_slices */ - in_n_mipmap, - in_data_size, - in_row_size); - - result.linear_tightly_packed_data_uchar_ptr = in_linear_tightly_packed_data_ptr; - - return result; -} - -/* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_from_uchar_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_mipmap, - const unsigned char* in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size) -{ - anvil_assert(in_n_layer < 6); - - MipmapRawData result = create_2D_array(in_aspect, - in_n_layer, - 1, /* n_layer_slices */ - in_n_mipmap, - in_data_size, - in_row_size); - - result.linear_tightly_packed_data_uchar_raw_ptr = in_linear_tightly_packed_data_ptr; - - return result; -} - -/* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_mipmap, - std::shared_ptr > in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size) -{ - anvil_assert(in_n_layer < 6); - - MipmapRawData result = create_2D_array(in_aspect, - in_n_layer, - 1, /* n_layer_slices */ - in_n_mipmap, - in_data_size, - in_row_size); - - result.linear_tightly_packed_data_uchar_vec_ptr = in_linear_tightly_packed_data_ptr; - - return result; -} - - -/* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_array_from_uchar_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - std::shared_ptr in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size) -{ - MipmapRawData result = create_2D_array(in_aspect, - in_n_layer, - in_n_layers, - in_n_mipmap, - in_data_size, - in_row_size); - - result.linear_tightly_packed_data_uchar_ptr = in_linear_tightly_packed_data_ptr; - - return result; -} - -/* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_array_from_uchar_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - const unsigned char* in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size) -{ - MipmapRawData result = create_2D_array(in_aspect, - in_n_layer, - in_n_layers, - in_n_mipmap, - in_data_size, - in_row_size); - - result.linear_tightly_packed_data_uchar_raw_ptr = in_linear_tightly_packed_data_ptr; - - return result; -} - -/* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_array_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - std::shared_ptr > in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size) -{ - MipmapRawData result = create_2D_array(in_aspect, - in_n_layer, - in_n_layers, - in_n_mipmap, - in_data_size, - in_row_size); - - result.linear_tightly_packed_data_uchar_vec_ptr = in_linear_tightly_packed_data_ptr; - - return result; -} - -Anvil::PhysicalDeviceLimits::PhysicalDeviceLimits() - :buffer_image_granularity (std::numeric_limits::max() ), - discrete_queue_priorities (UINT32_MAX), - framebuffer_color_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), - framebuffer_depth_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), - framebuffer_no_attachments_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), - framebuffer_stencil_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), - line_width_granularity (FLT_MAX), - max_bound_descriptor_sets (UINT32_MAX), - max_clip_distances (UINT32_MAX), - max_color_attachments (UINT32_MAX), - max_combined_clip_and_cull_distances (UINT32_MAX), - max_compute_shared_memory_size (UINT32_MAX), - max_compute_work_group_invocations (UINT32_MAX), - max_cull_distances (UINT32_MAX), - max_descriptor_set_input_attachments (UINT32_MAX), - max_descriptor_set_sampled_images (UINT32_MAX), - max_descriptor_set_samplers (UINT32_MAX), - max_descriptor_set_storage_buffers (UINT32_MAX), - max_descriptor_set_storage_buffers_dynamic (UINT32_MAX), - max_descriptor_set_storage_images (UINT32_MAX), - max_descriptor_set_uniform_buffers (UINT32_MAX), - max_descriptor_set_uniform_buffers_dynamic (UINT32_MAX), - max_draw_indexed_index_value (UINT32_MAX), - max_draw_indirect_count (UINT32_MAX), - max_fragment_combined_output_resources (UINT32_MAX), - max_fragment_dual_src_attachments (UINT32_MAX), - max_fragment_input_components (UINT32_MAX), - max_fragment_output_attachments (UINT32_MAX), - max_framebuffer_height (UINT32_MAX), - max_framebuffer_layers (UINT32_MAX), - max_framebuffer_width (UINT32_MAX), - max_geometry_input_components (UINT32_MAX), - max_geometry_output_components (UINT32_MAX), - max_geometry_output_vertices (UINT32_MAX), - max_geometry_shader_invocations (UINT32_MAX), - max_geometry_total_output_components (UINT32_MAX), - max_image_array_layers (UINT32_MAX), - max_image_dimension_1D (UINT32_MAX), - max_image_dimension_2D (UINT32_MAX), - max_image_dimension_3D (UINT32_MAX), - max_image_dimension_cube (UINT32_MAX), - max_interpolation_offset (FLT_MAX), - max_memory_allocation_count (UINT32_MAX), - max_per_stage_descriptor_input_attachments (UINT32_MAX), - max_per_stage_descriptor_sampled_images (UINT32_MAX), - max_per_stage_descriptor_samplers (UINT32_MAX), - max_per_stage_descriptor_storage_buffers (UINT32_MAX), - max_per_stage_descriptor_storage_images (UINT32_MAX), - max_per_stage_descriptor_uniform_buffers (UINT32_MAX), - max_per_stage_resources (UINT32_MAX), - max_push_constants_size (UINT32_MAX), - max_sample_mask_words (UINT32_MAX), - max_sampler_allocation_count (UINT32_MAX), - max_sampler_anisotropy (FLT_MAX), - max_sampler_lod_bias (FLT_MAX), - max_storage_buffer_range (UINT32_MAX), - max_viewports (UINT32_MAX), - max_tessellation_control_per_patch_output_components (UINT32_MAX), - max_tessellation_control_per_vertex_input_components (UINT32_MAX), - max_tessellation_control_per_vertex_output_components(UINT32_MAX), - max_tessellation_control_total_output_components (UINT32_MAX), - max_tessellation_evaluation_input_components (UINT32_MAX), - max_tessellation_evaluation_output_components (UINT32_MAX), - max_tessellation_generation_level (UINT32_MAX), - max_tessellation_patch_size (UINT32_MAX), - max_texel_buffer_elements (UINT32_MAX), - max_texel_gather_offset (UINT32_MAX), - max_texel_offset (UINT32_MAX), - max_uniform_buffer_range (UINT32_MAX), - max_vertex_input_attributes (UINT32_MAX), - max_vertex_input_attribute_offset (UINT32_MAX), - max_vertex_input_bindings (UINT32_MAX), - max_vertex_input_binding_stride (UINT32_MAX), - max_vertex_output_components (UINT32_MAX), - min_interpolation_offset (FLT_MAX), - min_memory_map_alignment (std::numeric_limits::max () ), - min_storage_buffer_offset_alignment (std::numeric_limits::max() ), - min_texel_buffer_offset_alignment (std::numeric_limits::max() ), - min_texel_gather_offset (INT32_MAX), - min_texel_offset (INT32_MAX), - min_uniform_buffer_offset_alignment (std::numeric_limits::max() ), - mipmap_precision_bits (UINT32_MAX), - non_coherent_atom_size (std::numeric_limits::max() ), - optimal_buffer_copy_offset_alignment (std::numeric_limits::max() ), - optimal_buffer_copy_row_pitch_alignment (std::numeric_limits::max() ), - point_size_granularity (FLT_MAX), - sampled_image_color_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), - sampled_image_depth_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), - sampled_image_integer_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), - sampled_image_stencil_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), - sparse_address_space_size (std::numeric_limits::max() ), - standard_sample_locations (false), - storage_image_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), - strict_lines (false), - sub_pixel_interpolation_offset_bits (UINT32_MAX), - sub_pixel_precision_bits (UINT32_MAX), - sub_texel_precision_bits (UINT32_MAX), - timestamp_compute_and_graphics (false), - timestamp_period (FLT_MAX), - viewport_sub_pixel_bits (UINT32_MAX) -{ - line_width_range[0] = FLT_MAX; - line_width_range[1] = FLT_MAX; - - max_compute_work_group_count[0] = UINT32_MAX; - max_compute_work_group_count[1] = UINT32_MAX; - max_compute_work_group_count[2] = UINT32_MAX; - - max_compute_work_group_size[0] = UINT32_MAX; - max_compute_work_group_size[1] = UINT32_MAX; - max_compute_work_group_size[2] = UINT32_MAX; - - max_viewport_dimensions[0] = UINT32_MAX; - max_viewport_dimensions[1] = UINT32_MAX; - - point_size_range[0] = FLT_MAX; - point_size_range[1] = FLT_MAX; - - viewport_bounds_range[0] = FLT_MAX; - viewport_bounds_range[1] = FLT_MAX; -} - -Anvil::PhysicalDeviceLimits::PhysicalDeviceLimits(const VkPhysicalDeviceLimits& in_device_limits) - :buffer_image_granularity (in_device_limits.bufferImageGranularity), - discrete_queue_priorities (in_device_limits.discreteQueuePriorities), - framebuffer_color_sample_counts (in_device_limits.framebufferColorSampleCounts), - framebuffer_depth_sample_counts (in_device_limits.framebufferDepthSampleCounts), - framebuffer_no_attachments_sample_counts (in_device_limits.framebufferNoAttachmentsSampleCounts), - framebuffer_stencil_sample_counts (in_device_limits.framebufferStencilSampleCounts), - line_width_granularity (in_device_limits.lineWidthGranularity), - max_bound_descriptor_sets (in_device_limits.maxBoundDescriptorSets), - max_clip_distances (in_device_limits.maxClipDistances), - max_color_attachments (in_device_limits.maxColorAttachments), - max_combined_clip_and_cull_distances (in_device_limits.maxCombinedClipAndCullDistances), - max_compute_shared_memory_size (in_device_limits.maxComputeSharedMemorySize), - max_compute_work_group_invocations (in_device_limits.maxComputeWorkGroupInvocations), - max_cull_distances (in_device_limits.maxCullDistances), - max_descriptor_set_input_attachments (in_device_limits.maxDescriptorSetInputAttachments), - max_descriptor_set_sampled_images (in_device_limits.maxDescriptorSetSampledImages), - max_descriptor_set_samplers (in_device_limits.maxDescriptorSetSamplers), - max_descriptor_set_storage_buffers (in_device_limits.maxDescriptorSetStorageBuffers), - max_descriptor_set_storage_buffers_dynamic (in_device_limits.maxDescriptorSetStorageBuffersDynamic), - max_descriptor_set_storage_images (in_device_limits.maxDescriptorSetStorageImages), - max_descriptor_set_uniform_buffers (in_device_limits.maxDescriptorSetUniformBuffers), - max_descriptor_set_uniform_buffers_dynamic (in_device_limits.maxDescriptorSetUniformBuffersDynamic), - max_draw_indexed_index_value (in_device_limits.maxDrawIndexedIndexValue), - max_draw_indirect_count (in_device_limits.maxDrawIndirectCount), - max_fragment_combined_output_resources (in_device_limits.maxFragmentCombinedOutputResources), - max_fragment_dual_src_attachments (in_device_limits.maxFragmentDualSrcAttachments), - max_fragment_input_components (in_device_limits.maxFragmentInputComponents), - max_fragment_output_attachments (in_device_limits.maxFragmentOutputAttachments), - max_framebuffer_height (in_device_limits.maxFramebufferHeight), - max_framebuffer_layers (in_device_limits.maxFramebufferLayers), - max_framebuffer_width (in_device_limits.maxFramebufferWidth), - max_geometry_input_components (in_device_limits.maxGeometryInputComponents), - max_geometry_output_components (in_device_limits.maxGeometryOutputComponents), - max_geometry_output_vertices (in_device_limits.maxGeometryOutputVertices), - max_geometry_shader_invocations (in_device_limits.maxGeometryShaderInvocations), - max_geometry_total_output_components (in_device_limits.maxGeometryTotalOutputComponents), - max_image_array_layers (in_device_limits.maxImageArrayLayers), - max_image_dimension_1D (in_device_limits.maxImageDimension1D), - max_image_dimension_2D (in_device_limits.maxImageDimension2D), - max_image_dimension_3D (in_device_limits.maxImageDimension3D), - max_image_dimension_cube (in_device_limits.maxImageDimensionCube), - max_interpolation_offset (in_device_limits.maxInterpolationOffset), - max_memory_allocation_count (in_device_limits.maxMemoryAllocationCount), - max_per_stage_descriptor_input_attachments (in_device_limits.maxPerStageDescriptorInputAttachments), - max_per_stage_descriptor_sampled_images (in_device_limits.maxPerStageDescriptorSampledImages), - max_per_stage_descriptor_samplers (in_device_limits.maxPerStageDescriptorSamplers), - max_per_stage_descriptor_storage_buffers (in_device_limits.maxPerStageDescriptorStorageBuffers), - max_per_stage_descriptor_storage_images (in_device_limits.maxPerStageDescriptorStorageImages), - max_per_stage_descriptor_uniform_buffers (in_device_limits.maxPerStageDescriptorUniformBuffers), - max_per_stage_resources (in_device_limits.maxPerStageResources), - max_push_constants_size (in_device_limits.maxPushConstantsSize), - max_sample_mask_words (in_device_limits.maxSampleMaskWords), - max_sampler_allocation_count (in_device_limits.maxSamplerAllocationCount), - max_sampler_anisotropy (in_device_limits.maxSamplerAnisotropy), - max_sampler_lod_bias (in_device_limits.maxSamplerLodBias), - max_storage_buffer_range (in_device_limits.maxStorageBufferRange), - max_viewports (in_device_limits.maxViewports), - max_tessellation_control_per_patch_output_components (in_device_limits.maxTessellationControlPerPatchOutputComponents), - max_tessellation_control_per_vertex_input_components (in_device_limits.maxTessellationControlPerVertexInputComponents), - max_tessellation_control_per_vertex_output_components(in_device_limits.maxTessellationControlPerVertexOutputComponents), - max_tessellation_control_total_output_components (in_device_limits.maxTessellationControlTotalOutputComponents), - max_tessellation_evaluation_input_components (in_device_limits.maxTessellationEvaluationInputComponents), - max_tessellation_evaluation_output_components (in_device_limits.maxTessellationEvaluationOutputComponents), - max_tessellation_generation_level (in_device_limits.maxTessellationGenerationLevel), - max_tessellation_patch_size (in_device_limits.maxTessellationPatchSize), - max_texel_buffer_elements (in_device_limits.maxTexelBufferElements), - max_texel_gather_offset (in_device_limits.maxTexelGatherOffset), - max_texel_offset (in_device_limits.maxTexelOffset), - max_uniform_buffer_range (in_device_limits.maxUniformBufferRange), - max_vertex_input_attributes (in_device_limits.maxVertexInputAttributes), - max_vertex_input_attribute_offset (in_device_limits.maxVertexInputAttributeOffset), - max_vertex_input_bindings (in_device_limits.maxVertexInputBindings), - max_vertex_input_binding_stride (in_device_limits.maxVertexInputBindingStride), - max_vertex_output_components (in_device_limits.maxVertexOutputComponents), - min_interpolation_offset (in_device_limits.minInterpolationOffset), - min_memory_map_alignment (in_device_limits.minMemoryMapAlignment), - min_storage_buffer_offset_alignment (in_device_limits.minStorageBufferOffsetAlignment), - min_texel_buffer_offset_alignment (in_device_limits.minTexelBufferOffsetAlignment), - min_texel_gather_offset (in_device_limits.minTexelGatherOffset), - min_texel_offset (in_device_limits.minTexelOffset), - min_uniform_buffer_offset_alignment (in_device_limits.minUniformBufferOffsetAlignment), - mipmap_precision_bits (in_device_limits.mipmapPrecisionBits), - non_coherent_atom_size (in_device_limits.nonCoherentAtomSize), - optimal_buffer_copy_offset_alignment (in_device_limits.optimalBufferCopyOffsetAlignment), - optimal_buffer_copy_row_pitch_alignment (in_device_limits.optimalBufferCopyRowPitchAlignment), - point_size_granularity (in_device_limits.pointSizeGranularity), - sampled_image_color_sample_counts (in_device_limits.sampledImageColorSampleCounts), - sampled_image_depth_sample_counts (in_device_limits.sampledImageDepthSampleCounts), - sampled_image_integer_sample_counts (in_device_limits.sampledImageIntegerSampleCounts), - sampled_image_stencil_sample_counts (in_device_limits.sampledImageStencilSampleCounts), - sparse_address_space_size (in_device_limits.sparseAddressSpaceSize), - standard_sample_locations (VK_BOOL32_TO_BOOL(in_device_limits.standardSampleLocations) ), - storage_image_sample_counts (in_device_limits.storageImageSampleCounts), - strict_lines (VK_BOOL32_TO_BOOL(in_device_limits.strictLines) ), - sub_pixel_interpolation_offset_bits (in_device_limits.subPixelInterpolationOffsetBits), - sub_pixel_precision_bits (in_device_limits.subPixelPrecisionBits), - sub_texel_precision_bits (in_device_limits.subTexelPrecisionBits), - timestamp_compute_and_graphics (VK_BOOL32_TO_BOOL(in_device_limits.timestampComputeAndGraphics) ), - timestamp_period (in_device_limits.timestampPeriod), - viewport_sub_pixel_bits (in_device_limits.viewportSubPixelBits) -{ - memcpy(line_width_range, - in_device_limits.lineWidthRange, - sizeof(line_width_range) ); - - memcpy(max_compute_work_group_count, - in_device_limits.maxComputeWorkGroupCount, - sizeof(max_compute_work_group_count) ); - - memcpy(max_compute_work_group_size, - in_device_limits.maxComputeWorkGroupSize, - sizeof(max_compute_work_group_size) ); - - memcpy(max_viewport_dimensions, - in_device_limits.maxViewportDimensions, - sizeof(max_viewport_dimensions) ); - - memcpy(point_size_range, - in_device_limits.pointSizeRange, - sizeof(point_size_range) ); - - memcpy(viewport_bounds_range, - in_device_limits.viewportBoundsRange, - sizeof(viewport_bounds_range) ); -} - -bool Anvil::PhysicalDeviceLimits::operator==(const Anvil::PhysicalDeviceLimits& in_device_limits) const -{ - bool result = false; - - if (buffer_image_granularity == in_device_limits.buffer_image_granularity && - discrete_queue_priorities == in_device_limits.discrete_queue_priorities && - framebuffer_color_sample_counts == in_device_limits.framebuffer_color_sample_counts && - framebuffer_depth_sample_counts == in_device_limits.framebuffer_depth_sample_counts && - framebuffer_no_attachments_sample_counts == in_device_limits.framebuffer_no_attachments_sample_counts && - framebuffer_stencil_sample_counts == in_device_limits.framebuffer_stencil_sample_counts && - max_bound_descriptor_sets == in_device_limits.max_bound_descriptor_sets && - max_clip_distances == in_device_limits.max_clip_distances && - max_color_attachments == in_device_limits.max_color_attachments && - max_combined_clip_and_cull_distances == in_device_limits.max_combined_clip_and_cull_distances && - max_compute_shared_memory_size == in_device_limits.max_compute_shared_memory_size && - max_compute_work_group_count[0] == in_device_limits.max_compute_work_group_count[0] && - max_compute_work_group_count[1] == in_device_limits.max_compute_work_group_count[1] && - max_compute_work_group_count[2] == in_device_limits.max_compute_work_group_count[2] && - max_compute_work_group_invocations == in_device_limits.max_compute_work_group_invocations && - max_compute_work_group_size[0] == in_device_limits.max_compute_work_group_size[0] && - max_compute_work_group_size[1] == in_device_limits.max_compute_work_group_size[1] && - max_compute_work_group_size[2] == in_device_limits.max_compute_work_group_size[2] && - max_cull_distances == in_device_limits.max_cull_distances && - max_descriptor_set_input_attachments == in_device_limits.max_descriptor_set_input_attachments && - max_descriptor_set_sampled_images == in_device_limits.max_descriptor_set_sampled_images && - max_descriptor_set_samplers == in_device_limits.max_descriptor_set_samplers && - max_descriptor_set_storage_buffers == in_device_limits.max_descriptor_set_storage_buffers && - max_descriptor_set_storage_buffers_dynamic == in_device_limits.max_descriptor_set_storage_buffers_dynamic && - max_descriptor_set_storage_images == in_device_limits.max_descriptor_set_storage_images && - max_descriptor_set_uniform_buffers == in_device_limits.max_descriptor_set_uniform_buffers && - max_descriptor_set_uniform_buffers_dynamic == in_device_limits.max_descriptor_set_uniform_buffers_dynamic && - max_draw_indexed_index_value == in_device_limits.max_draw_indexed_index_value && - max_draw_indirect_count == in_device_limits.max_draw_indirect_count && - max_fragment_combined_output_resources == in_device_limits.max_fragment_combined_output_resources && - max_fragment_dual_src_attachments == in_device_limits.max_fragment_dual_src_attachments && - max_fragment_input_components == in_device_limits.max_fragment_input_components && - max_fragment_output_attachments == in_device_limits.max_fragment_output_attachments && - max_framebuffer_height == in_device_limits.max_framebuffer_height && - max_framebuffer_layers == in_device_limits.max_framebuffer_layers && - max_framebuffer_width == in_device_limits.max_framebuffer_width && - max_geometry_input_components == in_device_limits.max_geometry_input_components && - max_geometry_output_components == in_device_limits.max_geometry_output_components && - max_geometry_output_vertices == in_device_limits.max_geometry_output_vertices && - max_geometry_shader_invocations == in_device_limits.max_geometry_shader_invocations && - max_geometry_total_output_components == in_device_limits.max_geometry_total_output_components && - max_image_array_layers == in_device_limits.max_image_array_layers && - max_image_dimension_1D == in_device_limits.max_image_dimension_1D && - max_image_dimension_2D == in_device_limits.max_image_dimension_2D && - max_image_dimension_3D == in_device_limits.max_image_dimension_3D && - max_image_dimension_cube == in_device_limits.max_image_dimension_cube && - max_memory_allocation_count == in_device_limits.max_memory_allocation_count && - max_per_stage_descriptor_input_attachments == in_device_limits.max_per_stage_descriptor_input_attachments && - max_per_stage_descriptor_sampled_images == in_device_limits.max_per_stage_descriptor_sampled_images && - max_per_stage_descriptor_samplers == in_device_limits.max_per_stage_descriptor_samplers && - max_per_stage_descriptor_storage_buffers == in_device_limits.max_per_stage_descriptor_storage_buffers && - max_per_stage_descriptor_storage_images == in_device_limits.max_per_stage_descriptor_storage_images && - max_per_stage_descriptor_uniform_buffers == in_device_limits.max_per_stage_descriptor_uniform_buffers && - max_per_stage_resources == in_device_limits.max_per_stage_resources && - max_push_constants_size == in_device_limits.max_push_constants_size && - max_sample_mask_words == in_device_limits.max_sample_mask_words && - max_sampler_allocation_count == in_device_limits.max_sampler_allocation_count && - max_storage_buffer_range == in_device_limits.max_storage_buffer_range && - max_viewport_dimensions[0] == in_device_limits.max_viewport_dimensions[0] && - max_viewport_dimensions[1] == in_device_limits.max_viewport_dimensions[1] && - max_viewports == in_device_limits.max_viewports && - max_tessellation_control_per_patch_output_components == in_device_limits.max_tessellation_control_per_patch_output_components && - max_tessellation_control_per_vertex_input_components == in_device_limits.max_tessellation_control_per_vertex_input_components && - max_tessellation_control_per_vertex_output_components == in_device_limits.max_tessellation_control_per_vertex_output_components && - max_tessellation_control_total_output_components == in_device_limits.max_tessellation_control_total_output_components && - max_tessellation_evaluation_input_components == in_device_limits.max_tessellation_evaluation_input_components && - max_tessellation_evaluation_output_components == in_device_limits.max_tessellation_evaluation_output_components && - max_tessellation_generation_level == in_device_limits.max_tessellation_generation_level && - max_tessellation_patch_size == in_device_limits.max_tessellation_patch_size && - max_texel_buffer_elements == in_device_limits.max_texel_buffer_elements && - max_texel_gather_offset == in_device_limits.max_texel_gather_offset && - max_texel_offset == in_device_limits.max_texel_offset && - max_uniform_buffer_range == in_device_limits.max_uniform_buffer_range && - max_vertex_input_attributes == in_device_limits.max_vertex_input_attributes && - max_vertex_input_attribute_offset == in_device_limits.max_vertex_input_attribute_offset && - max_vertex_input_bindings == in_device_limits.max_vertex_input_bindings && - max_vertex_input_binding_stride == in_device_limits.max_vertex_input_binding_stride && - max_vertex_output_components == in_device_limits.max_vertex_output_components && - min_memory_map_alignment == in_device_limits.min_memory_map_alignment && - min_storage_buffer_offset_alignment == in_device_limits.min_storage_buffer_offset_alignment && - min_texel_buffer_offset_alignment == in_device_limits.min_texel_buffer_offset_alignment && - min_texel_gather_offset == in_device_limits.min_texel_gather_offset && - min_texel_offset == in_device_limits.min_texel_offset && - min_uniform_buffer_offset_alignment == in_device_limits.min_uniform_buffer_offset_alignment && - mipmap_precision_bits == in_device_limits.mipmap_precision_bits && - non_coherent_atom_size == in_device_limits.non_coherent_atom_size && - optimal_buffer_copy_offset_alignment == in_device_limits.optimal_buffer_copy_offset_alignment && - optimal_buffer_copy_row_pitch_alignment == in_device_limits.optimal_buffer_copy_row_pitch_alignment && - sampled_image_color_sample_counts == in_device_limits.sampled_image_color_sample_counts && - sampled_image_depth_sample_counts == in_device_limits.sampled_image_depth_sample_counts && - sampled_image_integer_sample_counts == in_device_limits.sampled_image_integer_sample_counts && - sampled_image_stencil_sample_counts == in_device_limits.sampled_image_stencil_sample_counts && - sparse_address_space_size == in_device_limits.sparse_address_space_size && - standard_sample_locations == in_device_limits.standard_sample_locations && - storage_image_sample_counts == in_device_limits.storage_image_sample_counts && - strict_lines == in_device_limits.strict_lines && - sub_pixel_interpolation_offset_bits == in_device_limits.sub_pixel_interpolation_offset_bits && - sub_pixel_precision_bits == in_device_limits.sub_pixel_precision_bits && - sub_texel_precision_bits == in_device_limits.sub_texel_precision_bits && - timestamp_compute_and_graphics == in_device_limits.timestamp_compute_and_graphics && - viewport_sub_pixel_bits == in_device_limits.viewport_sub_pixel_bits) - { - /* Floats */ - if (fabs(line_width_range[0] - in_device_limits.line_width_range[0]) < 1e-5f && - fabs(line_width_range[1] - in_device_limits.line_width_range[1]) < 1e-5f && - fabs(line_width_granularity - in_device_limits.line_width_granularity) < 1e-5f && - fabs(max_interpolation_offset - in_device_limits.max_interpolation_offset) < 1e-5f && - fabs(max_sampler_anisotropy - in_device_limits.max_sampler_anisotropy) < 1e-5f && - fabs(max_sampler_lod_bias - in_device_limits.max_sampler_lod_bias) < 1e-5f && - fabs(min_interpolation_offset - in_device_limits.min_interpolation_offset) < 1e-5f && - fabs(point_size_granularity - in_device_limits.point_size_granularity) < 1e-5f && - fabs(point_size_range[0] - in_device_limits.point_size_range[0]) < 1e-5f && - fabs(point_size_range[1] - in_device_limits.point_size_range[1]) < 1e-5f && - fabs(timestamp_period - in_device_limits.timestamp_period) < 1e-5f && - fabs(viewport_bounds_range[0] - in_device_limits.viewport_bounds_range[0]) < 1e-5f && - fabs(viewport_bounds_range[1] - in_device_limits.viewport_bounds_range[1]) < 1e-5f) - { - result = true; - } - } - - return result; -} - -Anvil::PhysicalDevicePropertiesCoreVK10::PhysicalDevicePropertiesCoreVK10(const VkPhysicalDeviceProperties& in_physical_device_properties) - :api_version (in_physical_device_properties.apiVersion), - device_id (in_physical_device_properties.deviceID), - device_type (in_physical_device_properties.deviceType), - driver_version (in_physical_device_properties.driverVersion), - limits (PhysicalDeviceLimits (in_physical_device_properties.limits) ), - sparse_properties(PhysicalDeviceSparseProperties(in_physical_device_properties.sparseProperties) ), - vendor_id (in_physical_device_properties.vendorID) -{ - memcpy(device_name, - in_physical_device_properties.deviceName, - sizeof(device_name) ); - memcpy(pipeline_cache_uuid, - in_physical_device_properties.pipelineCacheUUID, - sizeof(pipeline_cache_uuid) ); -} - -bool Anvil::PhysicalDevicePropertiesCoreVK10::operator==(const PhysicalDevicePropertiesCoreVK10& in_props) const -{ - bool result = false; - - if (in_props.api_version == api_version && - in_props.device_id == device_id && - in_props.device_type == device_type && - in_props.driver_version == driver_version && - in_props.limits == limits && - in_props.sparse_properties == sparse_properties && - in_props.vendor_id == vendor_id) - { - if (memcmp(device_name, - in_props.device_name, - sizeof(device_name) ) == 0 && - memcmp(pipeline_cache_uuid, - in_props.pipeline_cache_uuid, - sizeof(pipeline_cache_uuid) ) == 0) - { - result = true; - } - } - - return result; -} - -Anvil::PhysicalDeviceSparseProperties::PhysicalDeviceSparseProperties() - :residency_standard_2D_block_shape (false), - residency_standard_2D_multisample_block_shape(false), - residency_standard_3D_block_shape (false), - residency_aligned_mip_size (false), - residency_non_resident_strict (false) -{ - /* Stub */ -} - -Anvil::PhysicalDeviceSparseProperties::PhysicalDeviceSparseProperties(const VkPhysicalDeviceSparseProperties& in_sparse_props) - :residency_standard_2D_block_shape (VK_BOOL32_TO_BOOL(in_sparse_props.residencyStandard2DBlockShape) ), - residency_standard_2D_multisample_block_shape(VK_BOOL32_TO_BOOL(in_sparse_props.residencyStandard2DMultisampleBlockShape) ), - residency_standard_3D_block_shape (VK_BOOL32_TO_BOOL(in_sparse_props.residencyStandard3DBlockShape) ), - residency_aligned_mip_size (VK_BOOL32_TO_BOOL(in_sparse_props.residencyAlignedMipSize) ), - residency_non_resident_strict (VK_BOOL32_TO_BOOL(in_sparse_props.residencyNonResidentStrict) ) -{ - /* Stub */ -} - -bool Anvil::PhysicalDeviceSparseProperties::operator==(const Anvil::PhysicalDeviceSparseProperties& in_props) const -{ - return (residency_standard_2D_block_shape == in_props.residency_standard_2D_block_shape && - residency_standard_2D_multisample_block_shape == in_props.residency_standard_2D_multisample_block_shape && - residency_standard_3D_block_shape == in_props.residency_standard_3D_block_shape && - residency_aligned_mip_size == in_props.residency_aligned_mip_size && - residency_non_resident_strict == in_props.residency_non_resident_strict); -} - -/** Please see header for specification */ -bool Anvil::operator==(const Anvil::QueueFamilyInfo& in1, - const Anvil::QueueFamilyInfo& in2) -{ - return (in1.flags == in2.flags && - in1.min_image_transfer_granularity.depth == in2.min_image_transfer_granularity.depth && - in1.min_image_transfer_granularity.height == in2.min_image_transfer_granularity.height && - in1.min_image_transfer_granularity.width == in2.min_image_transfer_granularity.width && - in1.n_queues == in2.n_queues && - in1.n_timestamp_bits == in2.n_timestamp_bits); -} - -/** Please see header for specification */ -Anvil::ShaderModuleStageEntryPoint::ShaderModuleStageEntryPoint() -{ - shader_module_ptr = nullptr; - stage = SHADER_STAGE_UNKNOWN; -} - -/** Please see header for specification */ -Anvil::ShaderModuleStageEntryPoint::ShaderModuleStageEntryPoint(const std::string& in_name, - ShaderModule* in_shader_module_ptr, - ShaderStage in_stage) -{ - anvil_assert(in_shader_module_ptr != nullptr); - - name = in_name; - shader_module_ptr = in_shader_module_ptr; - stage = in_stage; -} - -Anvil::ShaderModuleStageEntryPoint::ShaderModuleStageEntryPoint(const std::string& in_name, - ShaderModuleUniquePtr in_shader_module_ptr, - ShaderStage in_stage) -{ - anvil_assert(in_shader_module_ptr != nullptr); - - name = in_name; - shader_module_ptr = in_shader_module_ptr.get(); - stage = in_stage; - - shader_module_owned_ptr = std::move(in_shader_module_ptr); -} - -/** Please see header for specification */ -Anvil::ShaderModuleStageEntryPoint::ShaderModuleStageEntryPoint(const ShaderModuleStageEntryPoint& in) -{ - name = in.name; - shader_module_ptr = in.shader_module_ptr; - stage = in.stage; -} - -/** Please see header for specification */ -Anvil::ShaderModuleStageEntryPoint::~ShaderModuleStageEntryPoint() -{ - /* Stub */ -} - -/** Please see header for specification */ -Anvil::ShaderModuleStageEntryPoint& Anvil::ShaderModuleStageEntryPoint::operator=(const Anvil::ShaderModuleStageEntryPoint& in) -{ - name = in.name; - shader_module_ptr = in.shader_module_ptr; - stage = in.stage; - - return *this; -} - -/** Please see header for specification */ -Anvil::Utils::SparseMemoryBindingUpdateInfo::SparseMemoryBindingUpdateInfo() -{ - m_dirty = true; -} - -bool Anvil::PhysicalDeviceFeatures::operator==(const PhysicalDeviceFeatures& in_physical_device_features) const -{ - const bool core_vk1_0_features_match = (*core_vk1_0_features_ptr == *in_physical_device_features.core_vk1_0_features_ptr); - bool khr_16bit_storage_features_match = false; - - if (khr_16bit_storage_features_ptr != nullptr && - in_physical_device_features.khr_16bit_storage_features_ptr != nullptr) - { - khr_16bit_storage_features_match = (*khr_16bit_storage_features_ptr == *in_physical_device_features.khr_16bit_storage_features_ptr); - } - else - { - khr_16bit_storage_features_match = (khr_16bit_storage_features_ptr == nullptr && - in_physical_device_features.khr_16bit_storage_features_ptr == nullptr); - } - - return core_vk1_0_features_match && - khr_16bit_storage_features_match; -} - -Anvil::PhysicalDeviceFeaturesCoreVK10::PhysicalDeviceFeaturesCoreVK10() - :alpha_to_one (false), - depth_bias_clamp (false), - depth_bounds (false), - depth_clamp (false), - draw_indirect_first_instance (false), - dual_src_blend (false), - fill_mode_non_solid (false), - fragment_stores_and_atomics (false), - full_draw_index_uint32 (false), - geometry_shader (false), - image_cube_array (false), - independent_blend (false), - inherited_queries (false), - large_points (false), - logic_ip (false), - multi_draw_indirect (false), - multi_viewport (false), - occlusion_query_precise (false), - pipeline_statistics_query (false), - robust_buffer_access (false), - sampler_anisotropy (false), - sample_rate_shading (false), - shader_clip_distance (false), - shader_cull_distance (false), - shader_float64 (false), - shader_image_gather_extended (false), - shader_int16 (false), - shader_int64 (false), - shader_resource_residency (false), - shader_resource_min_lod (false), - shader_sampled_image_array_dynamic_indexing (false), - shader_storage_buffer_array_dynamic_indexing(false), - shader_storage_image_array_dynamic_indexing (false), - shader_storage_image_extended_formats (false), - shader_storage_image_multisample (false), - shader_storage_image_read_without_format (false), - shader_storage_image_write_without_format (false), - shader_tessellation_and_geometry_point_size (false), - shader_uniform_buffer_array_dynamic_indexing(false), - sparse_binding (false), - sparse_residency_2_samples (false), - sparse_residency_4_samples (false), - sparse_residency_8_samples (false), - sparse_residency_16_samples (false), - sparse_residency_aliased (false), - sparse_residency_buffer (false), - sparse_residency_image_2D (false), - sparse_residency_image_3D (false), - tessellation_shader (false), - texture_compression_ASTC_LDR (false), - texture_compression_BC (false), - texture_compression_ETC2 (false), - variable_multisample_rate (false), - vertex_pipeline_stores_and_atomics (false), - wide_lines (false) -{ - /* Stub */ -} - -Anvil::PhysicalDeviceFeaturesCoreVK10::PhysicalDeviceFeaturesCoreVK10(const VkPhysicalDeviceFeatures& in_physical_device_features) - :alpha_to_one (VK_BOOL32_TO_BOOL(in_physical_device_features.alphaToOne) ), - depth_bias_clamp (VK_BOOL32_TO_BOOL(in_physical_device_features.depthBiasClamp) ), - depth_bounds (VK_BOOL32_TO_BOOL(in_physical_device_features.depthBounds) ), - depth_clamp (VK_BOOL32_TO_BOOL(in_physical_device_features.depthClamp) ), - draw_indirect_first_instance (VK_BOOL32_TO_BOOL(in_physical_device_features.drawIndirectFirstInstance) ), - dual_src_blend (VK_BOOL32_TO_BOOL(in_physical_device_features.dualSrcBlend) ), - fill_mode_non_solid (VK_BOOL32_TO_BOOL(in_physical_device_features.fillModeNonSolid) ), - fragment_stores_and_atomics (VK_BOOL32_TO_BOOL(in_physical_device_features.fragmentStoresAndAtomics) ), - full_draw_index_uint32 (VK_BOOL32_TO_BOOL(in_physical_device_features.fullDrawIndexUint32) ), - geometry_shader (VK_BOOL32_TO_BOOL(in_physical_device_features.geometryShader) ), - image_cube_array (VK_BOOL32_TO_BOOL(in_physical_device_features.imageCubeArray) ), - independent_blend (VK_BOOL32_TO_BOOL(in_physical_device_features.independentBlend) ), - inherited_queries (VK_BOOL32_TO_BOOL(in_physical_device_features.inheritedQueries) ), - large_points (VK_BOOL32_TO_BOOL(in_physical_device_features.largePoints) ), - logic_ip (VK_BOOL32_TO_BOOL(in_physical_device_features.logicOp) ), - multi_draw_indirect (VK_BOOL32_TO_BOOL(in_physical_device_features.multiDrawIndirect) ), - multi_viewport (VK_BOOL32_TO_BOOL(in_physical_device_features.multiViewport) ), - occlusion_query_precise (VK_BOOL32_TO_BOOL(in_physical_device_features.occlusionQueryPrecise) ), - pipeline_statistics_query (VK_BOOL32_TO_BOOL(in_physical_device_features.pipelineStatisticsQuery) ), - robust_buffer_access (VK_BOOL32_TO_BOOL(in_physical_device_features.robustBufferAccess) ), - sampler_anisotropy (VK_BOOL32_TO_BOOL(in_physical_device_features.samplerAnisotropy) ), - sample_rate_shading (VK_BOOL32_TO_BOOL(in_physical_device_features.sampleRateShading) ), - shader_clip_distance (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderClipDistance) ), - shader_cull_distance (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderCullDistance) ), - shader_float64 (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderFloat64) ), - shader_image_gather_extended (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderImageGatherExtended) ), - shader_int16 (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderInt16) ), - shader_int64 (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderInt64) ), - shader_resource_residency (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderResourceResidency) ), - shader_resource_min_lod (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderResourceMinLod) ), - shader_sampled_image_array_dynamic_indexing (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderSampledImageArrayDynamicIndexing) ), - shader_storage_buffer_array_dynamic_indexing(VK_BOOL32_TO_BOOL(in_physical_device_features.shaderStorageBufferArrayDynamicIndexing) ), - shader_storage_image_array_dynamic_indexing (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderStorageImageArrayDynamicIndexing) ), - shader_storage_image_extended_formats (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderStorageImageExtendedFormats) ), - shader_storage_image_multisample (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderStorageImageMultisample) ), - shader_storage_image_read_without_format (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderStorageImageReadWithoutFormat) ), - shader_storage_image_write_without_format (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderStorageImageWriteWithoutFormat) ), - shader_tessellation_and_geometry_point_size (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderTessellationAndGeometryPointSize) ), - shader_uniform_buffer_array_dynamic_indexing(VK_BOOL32_TO_BOOL(in_physical_device_features.shaderUniformBufferArrayDynamicIndexing) ), - sparse_binding (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseBinding) ), - sparse_residency_2_samples (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidency2Samples) ), - sparse_residency_4_samples (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidency4Samples) ), - sparse_residency_8_samples (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidency8Samples) ), - sparse_residency_16_samples (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidency16Samples) ), - sparse_residency_aliased (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidencyAliased) ), - sparse_residency_buffer (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidencyBuffer) ), - sparse_residency_image_2D (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidencyImage2D) ), - sparse_residency_image_3D (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidencyImage3D) ), - tessellation_shader (VK_BOOL32_TO_BOOL(in_physical_device_features.tessellationShader) ), - texture_compression_ASTC_LDR (VK_BOOL32_TO_BOOL(in_physical_device_features.textureCompressionASTC_LDR) ), - texture_compression_BC (VK_BOOL32_TO_BOOL(in_physical_device_features.textureCompressionBC) ), - texture_compression_ETC2 (VK_BOOL32_TO_BOOL(in_physical_device_features.textureCompressionETC2) ), - variable_multisample_rate (VK_BOOL32_TO_BOOL(in_physical_device_features.variableMultisampleRate) ), - vertex_pipeline_stores_and_atomics (VK_BOOL32_TO_BOOL(in_physical_device_features.vertexPipelineStoresAndAtomics) ), - wide_lines (VK_BOOL32_TO_BOOL(in_physical_device_features.wideLines) ) -{ - /* Stub */ -} - -VkPhysicalDeviceFeatures Anvil::PhysicalDeviceFeaturesCoreVK10::get_vk_physical_device_features() const -{ - VkPhysicalDeviceFeatures result; - - result.alphaToOne = BOOL_TO_VK_BOOL32(alpha_to_one); - result.depthBiasClamp = BOOL_TO_VK_BOOL32(depth_bias_clamp); - result.depthBounds = BOOL_TO_VK_BOOL32(depth_bounds); - result.depthClamp = BOOL_TO_VK_BOOL32(depth_clamp); - result.drawIndirectFirstInstance = BOOL_TO_VK_BOOL32(draw_indirect_first_instance); - result.dualSrcBlend = BOOL_TO_VK_BOOL32(dual_src_blend); - result.fillModeNonSolid = BOOL_TO_VK_BOOL32(fill_mode_non_solid); - result.fragmentStoresAndAtomics = BOOL_TO_VK_BOOL32(fragment_stores_and_atomics); - result.fullDrawIndexUint32 = BOOL_TO_VK_BOOL32(full_draw_index_uint32); - result.geometryShader = BOOL_TO_VK_BOOL32(geometry_shader); - result.imageCubeArray = BOOL_TO_VK_BOOL32(image_cube_array); - result.independentBlend = BOOL_TO_VK_BOOL32(independent_blend); - result.inheritedQueries = BOOL_TO_VK_BOOL32(inherited_queries); - result.largePoints = BOOL_TO_VK_BOOL32(large_points); - result.logicOp = BOOL_TO_VK_BOOL32(logic_ip); - result.multiDrawIndirect = BOOL_TO_VK_BOOL32(multi_draw_indirect); - result.multiViewport = BOOL_TO_VK_BOOL32(multi_viewport); - result.occlusionQueryPrecise = BOOL_TO_VK_BOOL32(occlusion_query_precise); - result.pipelineStatisticsQuery = BOOL_TO_VK_BOOL32(pipeline_statistics_query); - result.robustBufferAccess = BOOL_TO_VK_BOOL32(robust_buffer_access); - result.samplerAnisotropy = BOOL_TO_VK_BOOL32(sampler_anisotropy); - result.sampleRateShading = BOOL_TO_VK_BOOL32(sample_rate_shading); - result.shaderClipDistance = BOOL_TO_VK_BOOL32(shader_clip_distance); - result.shaderCullDistance = BOOL_TO_VK_BOOL32(shader_cull_distance); - result.shaderFloat64 = BOOL_TO_VK_BOOL32(shader_float64); - result.shaderImageGatherExtended = BOOL_TO_VK_BOOL32(shader_image_gather_extended); - result.shaderInt16 = BOOL_TO_VK_BOOL32(shader_int16); - result.shaderInt64 = BOOL_TO_VK_BOOL32(shader_int64); - result.shaderResourceResidency = BOOL_TO_VK_BOOL32(shader_resource_residency); - result.shaderResourceMinLod = BOOL_TO_VK_BOOL32(shader_resource_min_lod); - result.shaderSampledImageArrayDynamicIndexing = BOOL_TO_VK_BOOL32(shader_sampled_image_array_dynamic_indexing); - result.shaderStorageBufferArrayDynamicIndexing = BOOL_TO_VK_BOOL32(shader_storage_buffer_array_dynamic_indexing); - result.shaderStorageImageArrayDynamicIndexing = BOOL_TO_VK_BOOL32(shader_storage_image_array_dynamic_indexing); - result.shaderStorageImageExtendedFormats = BOOL_TO_VK_BOOL32(shader_storage_image_extended_formats); - result.shaderStorageImageMultisample = BOOL_TO_VK_BOOL32(shader_storage_image_multisample); - result.shaderStorageImageReadWithoutFormat = BOOL_TO_VK_BOOL32(shader_storage_image_read_without_format); - result.shaderStorageImageWriteWithoutFormat = BOOL_TO_VK_BOOL32(shader_storage_image_write_without_format); - result.shaderTessellationAndGeometryPointSize = BOOL_TO_VK_BOOL32(shader_tessellation_and_geometry_point_size); - result.shaderUniformBufferArrayDynamicIndexing = BOOL_TO_VK_BOOL32(shader_uniform_buffer_array_dynamic_indexing); - result.sparseBinding = BOOL_TO_VK_BOOL32(sparse_binding); - result.sparseResidency2Samples = BOOL_TO_VK_BOOL32(sparse_residency_2_samples); - result.sparseResidency4Samples = BOOL_TO_VK_BOOL32(sparse_residency_4_samples); - result.sparseResidency8Samples = BOOL_TO_VK_BOOL32(sparse_residency_8_samples); - result.sparseResidency16Samples = BOOL_TO_VK_BOOL32(sparse_residency_16_samples); - result.sparseResidencyAliased = BOOL_TO_VK_BOOL32(sparse_residency_aliased); - result.sparseResidencyBuffer = BOOL_TO_VK_BOOL32(sparse_residency_buffer); - result.sparseResidencyImage2D = BOOL_TO_VK_BOOL32(sparse_residency_image_2D); - result.sparseResidencyImage3D = BOOL_TO_VK_BOOL32(sparse_residency_image_3D); - result.tessellationShader = BOOL_TO_VK_BOOL32(tessellation_shader); - result.textureCompressionASTC_LDR = BOOL_TO_VK_BOOL32(texture_compression_ASTC_LDR); - result.textureCompressionBC = BOOL_TO_VK_BOOL32(texture_compression_BC); - result.textureCompressionETC2 = BOOL_TO_VK_BOOL32(texture_compression_ETC2); - result.variableMultisampleRate = BOOL_TO_VK_BOOL32(variable_multisample_rate); - result.vertexPipelineStoresAndAtomics = BOOL_TO_VK_BOOL32(vertex_pipeline_stores_and_atomics); - result.wideLines = BOOL_TO_VK_BOOL32(wide_lines); - - return result; -} - -bool Anvil::PhysicalDeviceFeaturesCoreVK10::operator==(const Anvil::PhysicalDeviceFeaturesCoreVK10& in_data) const -{ - return (alpha_to_one == in_data.alpha_to_one) && - (depth_bias_clamp == in_data.depth_bias_clamp) && - (depth_bounds == in_data.depth_bounds) && - (depth_clamp == in_data.depth_clamp) && - (draw_indirect_first_instance == in_data.draw_indirect_first_instance) && - (dual_src_blend == in_data.dual_src_blend) && - (fill_mode_non_solid == in_data.fill_mode_non_solid) && - (fragment_stores_and_atomics == in_data.fragment_stores_and_atomics) && - (full_draw_index_uint32 == in_data.full_draw_index_uint32) && - (geometry_shader == in_data.geometry_shader) && - (image_cube_array == in_data.image_cube_array) && - (independent_blend == in_data.independent_blend) && - (inherited_queries == in_data.inherited_queries) && - (large_points == in_data.large_points) && - (logic_ip == in_data.logic_ip) && - (multi_draw_indirect == in_data.multi_draw_indirect) && - (multi_viewport == in_data.multi_viewport) && - (occlusion_query_precise == in_data.occlusion_query_precise) && - (pipeline_statistics_query == in_data.pipeline_statistics_query) && - (robust_buffer_access == in_data.robust_buffer_access) && - (sampler_anisotropy == in_data.sampler_anisotropy) && - (sample_rate_shading == in_data.sample_rate_shading) && - (shader_clip_distance == in_data.shader_clip_distance) && - (shader_cull_distance == in_data.shader_cull_distance) && - (shader_float64 == in_data.shader_float64) && - (shader_image_gather_extended == in_data.shader_image_gather_extended) && - (shader_int16 == in_data.shader_int16) && - (shader_int64 == in_data.shader_int64) && - (shader_resource_residency == in_data.shader_resource_residency) && - (shader_resource_min_lod == in_data.shader_resource_min_lod) && - (shader_sampled_image_array_dynamic_indexing == in_data.shader_sampled_image_array_dynamic_indexing) && - (shader_storage_buffer_array_dynamic_indexing == in_data.shader_storage_buffer_array_dynamic_indexing) && - (shader_storage_image_array_dynamic_indexing == in_data.shader_storage_image_array_dynamic_indexing) && - (shader_storage_image_extended_formats == in_data.shader_storage_image_extended_formats) && - (shader_storage_image_multisample == in_data.shader_storage_image_multisample) && - (shader_storage_image_read_without_format == in_data.shader_storage_image_read_without_format) && - (shader_storage_image_write_without_format == in_data.shader_storage_image_write_without_format) && - (shader_tessellation_and_geometry_point_size == in_data.shader_tessellation_and_geometry_point_size) && - (shader_uniform_buffer_array_dynamic_indexing == in_data.shader_uniform_buffer_array_dynamic_indexing) && - (sparse_binding == in_data.sparse_binding) && - (sparse_residency_2_samples == in_data.sparse_residency_2_samples) && - (sparse_residency_4_samples == in_data.sparse_residency_4_samples) && - (sparse_residency_8_samples == in_data.sparse_residency_8_samples) && - (sparse_residency_16_samples == in_data.sparse_residency_16_samples) && - (sparse_residency_aliased == in_data.sparse_residency_aliased) && - (sparse_residency_buffer == in_data.sparse_residency_buffer) && - (sparse_residency_image_2D == in_data.sparse_residency_image_2D) && - (sparse_residency_image_3D == in_data.sparse_residency_image_3D) && - (tessellation_shader == in_data.tessellation_shader) && - (texture_compression_ASTC_LDR == in_data.texture_compression_ASTC_LDR) && - (texture_compression_BC == in_data.texture_compression_BC) && - (texture_compression_ETC2 == in_data.texture_compression_ETC2) && - (variable_multisample_rate == in_data.variable_multisample_rate) && - (vertex_pipeline_stores_and_atomics == in_data.vertex_pipeline_stores_and_atomics) && - (wide_lines == in_data.wide_lines); -} - -bool Anvil::PhysicalDeviceProperties::operator==(const PhysicalDeviceProperties& in_props) const -{ - const bool core_vk1_0_features_match = (*core_vk1_0_properties_ptr == *in_props.core_vk1_0_properties_ptr); - bool khr_maintenance3_properties_match = false; - - if (khr_maintenance3_properties_ptr != nullptr && - in_props.khr_maintenance3_properties_ptr != nullptr) - { - khr_maintenance3_properties_match = (*khr_maintenance3_properties_ptr == *in_props.khr_maintenance3_properties_ptr); - } - else - { - khr_maintenance3_properties_match = (khr_maintenance3_properties_ptr == nullptr && - in_props.khr_maintenance3_properties_ptr == nullptr); - } - - return core_vk1_0_features_match && - khr_maintenance3_properties_match; -} - - -/** Please see header for specification */ -Anvil::SparseMemoryBindInfoID Anvil::Utils::SparseMemoryBindingUpdateInfo::add_bind_info(uint32_t in_n_signal_semaphores, - Anvil::Semaphore* const* in_opt_signal_semaphores_ptr, - uint32_t in_n_wait_semaphores, - Anvil::Semaphore* const* in_opt_wait_semaphores_ptr) -{ - Anvil::SparseMemoryBindInfoID result_id = static_cast(m_bindings.size() ); - BindingInfo new_binding; - - for (uint32_t n_signal_sem = 0; - n_signal_sem < in_n_signal_semaphores; - ++n_signal_sem) - { - new_binding.signal_semaphores.push_back(in_opt_signal_semaphores_ptr[n_signal_sem]); - } - - for (uint32_t n_wait_sem = 0; - n_wait_sem < in_n_wait_semaphores; - ++n_wait_sem) - { - new_binding.wait_semaphores.push_back(in_opt_wait_semaphores_ptr[n_wait_sem]); - } - - m_bindings.push_back(new_binding); - - return result_id; -} - -/** Please see header for specification */ -void Anvil::Utils::SparseMemoryBindingUpdateInfo::append_buffer_memory_update(SparseMemoryBindInfoID in_bind_info_id, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_buffer_memory_start_offset, - Anvil::MemoryBlock* in_memory_block_ptr, - VkDeviceSize in_memory_block_start_offset, - bool in_memory_block_owned_by_buffer, - VkDeviceSize in_size) -{ - /* Sanity checks */ - anvil_assert(in_buffer_ptr != nullptr); - anvil_assert(m_bindings.size() > in_bind_info_id); - anvil_assert(in_buffer_ptr->get_memory_requirements().size >= in_buffer_memory_start_offset + in_size); - - if (in_memory_block_ptr != nullptr) - { - anvil_assert(in_memory_block_ptr->get_size() >= in_memory_block_start_offset + in_size); - } - - /* Cache the update */ - auto& binding = m_bindings.at(in_bind_info_id); - GeneralBindInfo update; - VkSparseMemoryBind update_vk; - - update.memory_block_owned_by_target = in_memory_block_owned_by_buffer; - update.memory_block_ptr = in_memory_block_ptr; - update.memory_block_start_offset = in_memory_block_start_offset; - update.size = in_size; - update.start_offset = in_buffer_memory_start_offset; - - update_vk.flags = 0; - update_vk.memory = (in_memory_block_ptr != nullptr) ? in_memory_block_ptr->get_memory() - : VK_NULL_HANDLE; - update_vk.memoryOffset = (in_memory_block_ptr != nullptr) ? (in_memory_block_ptr->get_start_offset() + in_memory_block_start_offset) - : UINT32_MAX; - update_vk.resourceOffset = (in_buffer_ptr->get_start_offset() + in_buffer_memory_start_offset); - update_vk.size = in_size; - - binding.buffer_updates[in_buffer_ptr].first.push_back (update); - binding.buffer_updates[in_buffer_ptr].second.push_back(update_vk); -} - -/** Please see header for specification */ -void Anvil::Utils::SparseMemoryBindingUpdateInfo::append_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, - Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - const VkExtent3D& in_extent, - VkSparseMemoryBindFlags in_flags, - Anvil::MemoryBlock* in_opt_memory_block_ptr, - VkDeviceSize in_opt_memory_block_start_offset, - bool in_opt_memory_block_owned_by_image) -{ - /* Sanity checks .. */ - anvil_assert(in_image_ptr != nullptr); - anvil_assert(in_flags == 0); - anvil_assert(m_bindings.size() > in_bind_info_id); - - anvil_assert(in_image_ptr->get_image_n_layers() > in_subresource.arrayLayer); - anvil_assert(in_image_ptr->get_image_n_mipmaps() > in_subresource.mipLevel); - anvil_assert(in_image_ptr->has_aspects(in_subresource.aspectMask) ); - - if (in_opt_memory_block_ptr != nullptr) - { - anvil_assert(in_opt_memory_block_ptr->get_size() > in_opt_memory_block_start_offset); - } - - /* Cache the update */ - auto& binding = m_bindings.at(in_bind_info_id); - ImageBindInfo update; - VkSparseImageMemoryBind update_vk; - - update.extent = in_extent; - update.flags = in_flags; - update.memory_block_owned_by_image = in_opt_memory_block_owned_by_image; - update.memory_block_ptr = in_opt_memory_block_ptr; - update.memory_block_start_offset = in_opt_memory_block_start_offset; - update.offset = in_offset; - update.subresource = in_subresource; - - update_vk.extent = in_extent; - update_vk.flags = in_flags; - update_vk.memory = (in_opt_memory_block_ptr != nullptr) ? in_opt_memory_block_ptr->get_memory() - : VK_NULL_HANDLE; - update_vk.memoryOffset = (in_opt_memory_block_ptr != nullptr) ? in_opt_memory_block_ptr->get_start_offset() + in_opt_memory_block_start_offset - : UINT32_MAX; - update_vk.offset = in_offset; - update_vk.subresource = in_subresource; - - binding.image_updates[in_image_ptr].first.push_back (update); - binding.image_updates[in_image_ptr].second.push_back(update_vk); -} - -/** Please see header for specification */ -void Anvil::Utils::SparseMemoryBindingUpdateInfo::append_opaque_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, - Anvil::Image* in_image_ptr, - VkDeviceSize in_resource_offset, - VkDeviceSize in_size, - VkSparseMemoryBindFlags in_flags, - Anvil::MemoryBlock* in_opt_memory_block_ptr, - VkDeviceSize in_opt_memory_block_start_offset, - bool in_opt_memory_block_owned_by_image) -{ - /* Sanity checks */ - anvil_assert(in_image_ptr != nullptr); - anvil_assert(m_bindings.size() > in_bind_info_id); - anvil_assert(in_image_ptr->get_memory_requirements().size >= in_resource_offset + in_size); - - if (in_opt_memory_block_ptr != nullptr) - { - anvil_assert(in_opt_memory_block_ptr->get_size() >= in_opt_memory_block_start_offset + in_size); - } - - /* Cache the update */ - auto& binding = m_bindings.at(in_bind_info_id); - GeneralBindInfo update; - VkSparseMemoryBind update_vk; - - update.flags = in_flags; - update.memory_block_owned_by_target = in_opt_memory_block_owned_by_image; - update.memory_block_ptr = in_opt_memory_block_ptr; - update.memory_block_start_offset = in_opt_memory_block_start_offset; - update.size = in_size; - update.start_offset = in_resource_offset; - - update_vk.flags = in_flags; - update_vk.memory = (in_opt_memory_block_ptr != nullptr) ? in_opt_memory_block_ptr->get_memory() - : VK_NULL_HANDLE; - update_vk.memoryOffset = (in_opt_memory_block_ptr != nullptr) ? (in_opt_memory_block_ptr->get_start_offset() + in_opt_memory_block_start_offset) - : UINT32_MAX; - update_vk.resourceOffset = in_resource_offset; - update_vk.size = in_size; - - binding.image_opaque_updates[in_image_ptr].first.push_back (update); - binding.image_opaque_updates[in_image_ptr].second.push_back(update_vk); -} - -/** Please see header for specification */ -void Anvil::Utils::SparseMemoryBindingUpdateInfo::bake() -{ - const uint32_t n_bindings = static_cast(m_bindings.size() ); - - anvil_assert(m_dirty); - - if (n_bindings > 0) - { - m_bindings_vk.resize(n_bindings); - - m_buffer_bindings_vk.clear(); - - for (uint32_t n_binding = 0; - n_binding < n_bindings; - ++n_binding) - { - auto& bind_info = m_bindings [n_binding]; - uint32_t n_buffer_bindings_start_index = ~0u; - uint32_t n_image_bindings_start_index = ~0u; - uint32_t n_image_opaque_bindings_start_index = ~0u; - auto& vk_binding = m_bindings_vk[n_binding]; - - bind_info.signal_semaphores_vk.clear(); - bind_info.wait_semaphores_vk.clear (); - - bind_info.signal_semaphores_vk.reserve(bind_info.signal_semaphores.size() ); - bind_info.wait_semaphores_vk.reserve (bind_info.wait_semaphores.size () ); - - for (auto& signal_semaphore_ptr : bind_info.signal_semaphores) - { - bind_info.signal_semaphores_vk.push_back(signal_semaphore_ptr->get_semaphore() ); - } - - for (auto& wait_semaphore_ptr : bind_info.wait_semaphores) - { - bind_info.wait_semaphores_vk.push_back(wait_semaphore_ptr->get_semaphore() ); - } - - vk_binding.bufferBindCount = static_cast(bind_info.buffer_updates.size() ); - vk_binding.imageBindCount = static_cast(bind_info.image_updates.size() ); - vk_binding.imageOpaqueBindCount = static_cast(bind_info.image_opaque_updates.size() ); - vk_binding.pNext = nullptr; - vk_binding.pSignalSemaphores = (bind_info.signal_semaphores_vk.size() > 0) ? &bind_info.signal_semaphores_vk[0] : nullptr; - vk_binding.pWaitSemaphores = (bind_info.wait_semaphores_vk.size() > 0) ? &bind_info.wait_semaphores_vk [0] : nullptr; - vk_binding.signalSemaphoreCount = static_cast(bind_info.signal_semaphores_vk.size() ); - vk_binding.sType = VK_STRUCTURE_TYPE_BIND_SPARSE_INFO; - vk_binding.waitSemaphoreCount = static_cast(bind_info.wait_semaphores_vk.size() ); - - n_buffer_bindings_start_index = static_cast(m_buffer_bindings_vk.size() ); - n_image_bindings_start_index = static_cast(m_image_bindings_vk.size() ); - n_image_opaque_bindings_start_index = static_cast(m_image_opaque_bindings_vk.size() ); - - for (auto& buffer_update : bind_info.buffer_updates) - { - const VkBuffer current_buffer_vk = buffer_update.first->get_buffer(); - VkSparseBufferMemoryBindInfo buffer_bind_info; - - anvil_assert(buffer_update.second.second.size() > 0); - - buffer_bind_info.bindCount = static_cast(buffer_update.second.second.size() ); - buffer_bind_info.buffer = current_buffer_vk; - buffer_bind_info.pBinds = &buffer_update.second.second[0]; - - m_buffer_bindings_vk.push_back(buffer_bind_info); - } - - for (auto& image_update : bind_info.image_updates) - { - const VkImage current_image_vk = image_update.first->get_image(); - VkSparseImageMemoryBindInfo image_bind_info; - - anvil_assert(image_update.second.second.size() > 0); - - image_bind_info.bindCount = static_cast(image_update.second.second.size() ); - image_bind_info.image = current_image_vk; - image_bind_info.pBinds = &image_update.second.second[0]; - - m_image_bindings_vk.push_back(image_bind_info); - } - - for (auto& image_opaque_update : bind_info.image_opaque_updates) - { - const VkImage current_image_vk = image_opaque_update.first->get_image(); - VkSparseImageOpaqueMemoryBindInfo image_opaque_bind_info; - - anvil_assert(image_opaque_update.second.second.size() > 0); - - image_opaque_bind_info.bindCount = static_cast(image_opaque_update.second.second.size() ); - image_opaque_bind_info.image = current_image_vk; - image_opaque_bind_info.pBinds = &image_opaque_update.second.second[0]; - - m_image_opaque_bindings_vk.push_back(image_opaque_bind_info); - } - - vk_binding.pBufferBinds = (bind_info.buffer_updates.size() > 0) ? &m_buffer_bindings_vk [n_buffer_bindings_start_index] : nullptr; - vk_binding.pImageBinds = (bind_info.image_updates.size() > 0) ? &m_image_bindings_vk [n_image_bindings_start_index] : nullptr; - vk_binding.pImageOpaqueBinds = (bind_info.image_opaque_updates.size() > 0) ? &m_image_opaque_bindings_vk[n_image_opaque_bindings_start_index] : nullptr; - } - } - else - { - m_bindings_vk.clear(); - } - - m_dirty = false; -} - -/** Please see header for specification */ -bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_bind_info_properties(SparseMemoryBindInfoID in_bind_info_id, - uint32_t* const out_opt_n_buffer_memory_updates_ptr, - uint32_t* const out_opt_n_image_memory_updates_ptr, - uint32_t* const out_opt_n_image_opaque_memory_updates_ptr, - uint32_t* const out_opt_n_signal_semaphores_ptr, - Anvil::Semaphore*** out_opt_signal_semaphores_ptr_ptr_ptr, - uint32_t* const out_opt_n_wait_semaphores_ptr, - Anvil::Semaphore*** out_opt_wait_semaphores_ptr_ptr_ptr) -{ - decltype(m_bindings)::iterator binding_iterator; - bool result = false; - - if (m_bindings.size() <= in_bind_info_id) - { - anvil_assert(m_bindings.size() > in_bind_info_id); - - goto end; - } - - binding_iterator = m_bindings.begin() + static_cast(in_bind_info_id); - - if (out_opt_n_buffer_memory_updates_ptr != nullptr) - { - uint32_t n_buffer_mem_updates = 0; - - for (const auto& buffer_update_iterator : binding_iterator->buffer_updates) - { - n_buffer_mem_updates += static_cast(buffer_update_iterator.second.first.size() ); - } - - *out_opt_n_buffer_memory_updates_ptr = n_buffer_mem_updates; - } - - if (out_opt_n_image_memory_updates_ptr != nullptr) - { - uint32_t n_image_mem_updates = 0; - - for (const auto& image_update_iterator : binding_iterator->image_updates) - { - n_image_mem_updates += static_cast(image_update_iterator.second.first.size() ); - } - - *out_opt_n_image_memory_updates_ptr = n_image_mem_updates; - } - - if (out_opt_n_image_opaque_memory_updates_ptr != nullptr) - { - uint32_t n_image_opaque_mem_updates = 0; - - for (const auto& image_opaque_update_iterator : binding_iterator->image_opaque_updates) - { - n_image_opaque_mem_updates += static_cast(image_opaque_update_iterator.second.first.size() ); - } - - *out_opt_n_image_opaque_memory_updates_ptr = n_image_opaque_mem_updates; - } - - if (out_opt_n_signal_semaphores_ptr != nullptr) - { - *out_opt_n_signal_semaphores_ptr = static_cast(binding_iterator->signal_semaphores.size() ); - } - - if (out_opt_signal_semaphores_ptr_ptr_ptr != nullptr && - binding_iterator->signal_semaphores.size() > 0) - { - *out_opt_signal_semaphores_ptr_ptr_ptr = &binding_iterator->signal_semaphores.at(0); - } - - if (out_opt_n_wait_semaphores_ptr != nullptr) - { - *out_opt_n_wait_semaphores_ptr = static_cast(binding_iterator->wait_semaphores.size() ); - } - - if (out_opt_wait_semaphores_ptr_ptr_ptr != nullptr && - binding_iterator->wait_semaphores.size() > 0) - { - *out_opt_wait_semaphores_ptr_ptr_ptr = &binding_iterator->wait_semaphores.at(0); - } - - /* All done */ - result = true; -end: - return result; -} - -/** Please see header for specification */ -void Anvil::Utils::SparseMemoryBindingUpdateInfo::get_bind_sparse_call_args(uint32_t* out_bind_info_count_ptr, - const VkBindSparseInfo** out_bind_info_ptr, - Anvil::Fence** out_fence_to_set_ptr) -{ - if (m_dirty) - { - bake(); - - anvil_assert(!m_dirty); - } - - *out_bind_info_count_ptr = static_cast(m_bindings.size() ); - *out_bind_info_ptr = (m_bindings_vk.size() > 0) ? &m_bindings_vk.at(0) : nullptr; - *out_fence_to_set_ptr = m_fence_ptr; -} - -/** Please see header for specification */ -bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_buffer_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, - uint32_t in_n_update, - Anvil::Buffer** out_opt_buffer_ptr_ptr, - VkDeviceSize* out_opt_buffer_memory_start_offset_ptr, - Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, - VkDeviceSize* out_opt_memory_block_start_offset_ptr, - bool* out_opt_memory_block_owned_by_buffer_ptr, - VkDeviceSize* out_opt_size_ptr) const -{ - GeneralBindInfo buffer_bind; - BufferBindUpdateMap::const_iterator buffer_binding_map_iterator; - decltype(m_bindings)::const_iterator binding_iterator; - uint32_t n_current_update = 0; - bool result = false; - - if (m_bindings.size() <= in_bind_info_id) - { - anvil_assert(!(m_bindings.size() <= in_bind_info_id) ); - - goto end; - } - - binding_iterator = m_bindings.cbegin() + static_cast(in_bind_info_id); - buffer_binding_map_iterator = binding_iterator->buffer_updates.begin(); - - while (buffer_binding_map_iterator != binding_iterator->buffer_updates.end() ) - { - const uint32_t n_buffer_bindings = static_cast(buffer_binding_map_iterator->second.first.size() ); - - if (n_current_update + n_buffer_bindings > in_n_update) - { - buffer_bind = buffer_binding_map_iterator->second.first.at(in_n_update - n_current_update); - - break; - } - else - { - n_current_update += n_buffer_bindings; - buffer_binding_map_iterator ++; - } - } - - if (buffer_binding_map_iterator == binding_iterator->buffer_updates.end() ) - { - anvil_assert(!(buffer_binding_map_iterator == binding_iterator->buffer_updates.end()) ); - - goto end; - } - - if (out_opt_buffer_ptr_ptr != nullptr) - { - *out_opt_buffer_ptr_ptr = buffer_binding_map_iterator->first; - } - - if (out_opt_buffer_memory_start_offset_ptr != nullptr) - { - *out_opt_buffer_memory_start_offset_ptr = buffer_bind.start_offset; - } - - if (out_opt_memory_block_owned_by_buffer_ptr != nullptr) - { - *out_opt_memory_block_owned_by_buffer_ptr = buffer_bind.memory_block_owned_by_target; - } - - if (out_opt_memory_block_ptr_ptr != nullptr) - { - *out_opt_memory_block_ptr_ptr = buffer_bind.memory_block_ptr; - } - - if (out_opt_memory_block_start_offset_ptr != nullptr) - { - *out_opt_memory_block_start_offset_ptr = buffer_bind.memory_block_start_offset; - } - - if (out_opt_size_ptr != nullptr) - { - *out_opt_size_ptr = buffer_bind.size; - } - - /* All done */ - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_image_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, - uint32_t in_n_update, - Anvil::Image** out_opt_image_ptr_ptr, - VkImageSubresource* out_opt_subresource_ptr, - VkOffset3D* out_opt_offset_ptr, - VkExtent3D* out_opt_extent_ptr, - VkSparseMemoryBindFlags* out_opt_flags_ptr, - Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, - VkDeviceSize* out_opt_memory_block_start_offset_ptr, - bool* out_opt_memory_block_owned_by_image_ptr) const -{ - decltype(m_bindings)::const_iterator binding_iterator; - ImageBindInfo image_bind; - ImageBindUpdateMap::const_iterator image_binding_map_iterator; - uint32_t n_current_update = 0; - bool result = false; - - if (m_bindings.size() <= in_bind_info_id) - { - anvil_assert(!(m_bindings.size() <= in_bind_info_id) ); - - goto end; - } - - binding_iterator = m_bindings.cbegin() + static_cast(in_bind_info_id); - image_binding_map_iterator = binding_iterator->image_updates.begin(); - - while (image_binding_map_iterator != binding_iterator->image_updates.end() ) - { - const uint32_t n_image_bindings = static_cast(image_binding_map_iterator->second.first.size() ); - - if (n_current_update + n_image_bindings > in_n_update) - { - image_bind = image_binding_map_iterator->second.first.at(in_n_update - n_current_update); - - break; - } - else - { - n_current_update += n_image_bindings; - image_binding_map_iterator ++; - } - } - - if (image_binding_map_iterator == binding_iterator->image_updates.end() ) - { - anvil_assert(!(image_binding_map_iterator == binding_iterator->image_updates.end()) ); - - goto end; - } - - if (out_opt_image_ptr_ptr != nullptr) - { - *out_opt_image_ptr_ptr = image_binding_map_iterator->first; - } - - if (out_opt_subresource_ptr != nullptr) - { - *out_opt_subresource_ptr = image_bind.subresource; - } - - if (out_opt_offset_ptr != nullptr) - { - *out_opt_offset_ptr = image_bind.offset; - } - - if (out_opt_extent_ptr != nullptr) - { - *out_opt_extent_ptr = image_bind.extent; - } - - if (out_opt_flags_ptr != nullptr) - { - *out_opt_flags_ptr = image_bind.flags; - } - - if (out_opt_memory_block_ptr_ptr != nullptr) - { - *out_opt_memory_block_ptr_ptr = image_bind.memory_block_ptr; - } - - if (out_opt_memory_block_start_offset_ptr != nullptr) - { - *out_opt_memory_block_start_offset_ptr = image_bind.memory_block_start_offset; - } - - if (out_opt_memory_block_owned_by_image_ptr != nullptr) - { - *out_opt_memory_block_owned_by_image_ptr = image_bind.memory_block_owned_by_image; - } - - /* All done */ - result = true; -end: - return result; -} - -/** Please see header for specification */ -bool Anvil::Utils::SparseMemoryBindingUpdateInfo::get_image_opaque_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, - uint32_t in_n_update, - Anvil::Image** out_opt_image_ptr_ptr, - VkDeviceSize* out_opt_resource_offset_ptr, - VkDeviceSize* out_opt_size_ptr, - VkSparseMemoryBindFlags* out_opt_flags_ptr, - Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, - VkDeviceSize* out_opt_memory_block_start_offset_ptr, - bool* out_opt_memory_block_owned_by_image_ptr) const -{ - decltype(m_bindings)::const_iterator binding_iterator; - GeneralBindInfo image_opaque_bind; - ImageOpaqueBindUpdateMap::const_iterator image_opaque_binding_map_iterator; - uint32_t n_current_update = 0; - bool result = false; - - if (m_bindings.size() <= in_bind_info_id) - { - anvil_assert(!(m_bindings.size() <= in_bind_info_id) ); - - goto end; - } - - binding_iterator = m_bindings.cbegin() + static_cast(in_bind_info_id); - image_opaque_binding_map_iterator = binding_iterator->image_opaque_updates.begin(); - - while (image_opaque_binding_map_iterator != binding_iterator->image_opaque_updates.end() ) - { - const uint32_t n_image_opaque_bindings = static_cast(image_opaque_binding_map_iterator->second.first.size() ); - - if (n_current_update + n_image_opaque_bindings > in_n_update) - { - image_opaque_bind = image_opaque_binding_map_iterator->second.first.at(in_n_update - n_current_update); - - break; - } - else - { - n_current_update += n_image_opaque_bindings; - image_opaque_binding_map_iterator ++; - } - } - - if (image_opaque_binding_map_iterator == binding_iterator->image_opaque_updates.end() ) - { - anvil_assert(!(image_opaque_binding_map_iterator == binding_iterator->image_opaque_updates.end()) ); - - goto end; - } - - if (out_opt_image_ptr_ptr != nullptr) - { - *out_opt_image_ptr_ptr = image_opaque_binding_map_iterator->first; - } - - if (out_opt_resource_offset_ptr != nullptr) - { - *out_opt_resource_offset_ptr = image_opaque_bind.start_offset; - } - - if (out_opt_size_ptr != nullptr) - { - *out_opt_size_ptr = image_opaque_bind.size; - } - - if (out_opt_flags_ptr != nullptr) - { - *out_opt_flags_ptr = image_opaque_bind.flags; - } - - if (out_opt_memory_block_ptr_ptr != nullptr) - { - *out_opt_memory_block_ptr_ptr = image_opaque_bind.memory_block_ptr; - } - - if (out_opt_memory_block_start_offset_ptr != nullptr) - { - *out_opt_memory_block_start_offset_ptr = image_opaque_bind.memory_block_start_offset; - } - - if (out_opt_memory_block_owned_by_image_ptr != nullptr) - { - *out_opt_memory_block_owned_by_image_ptr = image_opaque_bind.memory_block_owned_by_target; - } - - /* All done */ - result = true; -end: - return result; -} - -/** Please see header for specification */ -Anvil::MemoryFeatureFlags Anvil::Utils::get_memory_feature_flags_from_vk_property_flags(VkMemoryPropertyFlags in_mem_type_flags, - VkMemoryHeapFlags in_mem_heap_flags) -{ - Anvil::MemoryFeatureFlags result = 0; - - ANVIL_REDUNDANT_ARGUMENT(in_mem_heap_flags); - - if ((in_mem_type_flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0) - { - result |= MEMORY_FEATURE_FLAG_DEVICE_LOCAL; - } - - if ((in_mem_type_flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0) - { - result |= MEMORY_FEATURE_FLAG_MAPPABLE; - } - - if ((in_mem_type_flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) != 0) - { - result |= MEMORY_FEATURE_FLAG_HOST_COHERENT; - } - - if ((in_mem_type_flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) != 0) - { - result |= MEMORY_FEATURE_FLAG_HOST_CACHED; - } - - if ((in_mem_type_flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) != 0) - { - result |= MEMORY_FEATURE_FLAG_LAZILY_ALLOCATED; - } - - return result; -} - -Anvil::MTSafety Anvil::Utils::convert_boolean_to_mt_safety_enum(bool in_mt_safe) -{ - return (in_mt_safe) ? MT_SAFETY_ENABLED - : MT_SAFETY_DISABLED; -} - -bool Anvil::Utils::convert_mt_safety_enum_to_boolean(Anvil::MTSafety in_mt_safety, - const Anvil::BaseDevice* in_device_ptr) -{ - bool result = false; - - switch (in_mt_safety) - { - case MT_SAFETY_DISABLED: result = false; break; - case MT_SAFETY_ENABLED: result = true; break; - - case MT_SAFETY_INHERIT_FROM_PARENT_DEVICE: - { - anvil_assert(in_device_ptr != nullptr); - - result = in_device_ptr->is_mt_safe(); - break; - } - - default: - { - anvil_assert_fail(); - } - } - - return result; -} - -/** Please see header for specification */ -void Anvil::Utils::convert_queue_family_bits_to_family_indices(const Anvil::BaseDevice* in_device_ptr, - Anvil::QueueFamilyBits in_queue_families, - uint32_t* out_opt_queue_family_indices_ptr, - uint32_t* out_opt_n_queue_family_indices_ptr) -{ - uint32_t n_result_queue_family_indices(0); - - static const struct - { - Anvil::QueueFamily queue_family; - Anvil::QueueFamilyType queue_family_type; - } queue_family_data[] = - { - {Anvil::QUEUE_FAMILY_COMPUTE_BIT, Anvil::QueueFamilyType::COMPUTE}, - {Anvil::QUEUE_FAMILY_DMA_BIT, Anvil::QueueFamilyType::TRANSFER}, - {Anvil::QUEUE_FAMILY_GRAPHICS_BIT, Anvil::QueueFamilyType::UNIVERSAL}, - }; - - for (const auto& current_queue_fam_data : queue_family_data) - { - if ((in_queue_families & current_queue_fam_data.queue_family) != 0) - { - uint32_t n_queue_family_indices = 0; - const uint32_t* queue_family_indices_ptr = nullptr; - - in_device_ptr->get_queue_family_indices_for_queue_family_type(current_queue_fam_data.queue_family_type, - &n_queue_family_indices, - &queue_family_indices_ptr); - - if (out_opt_queue_family_indices_ptr != nullptr) - { - for (uint32_t n_queue_family_index = 0; - n_queue_family_index < n_queue_family_indices; - ++n_queue_family_index, ++n_result_queue_family_indices) - { - out_opt_queue_family_indices_ptr[n_result_queue_family_indices] = queue_family_indices_ptr[n_queue_family_index]; - } - } - else - { - n_result_queue_family_indices += n_queue_family_indices; - } - } - } - - if (out_opt_n_queue_family_indices_ptr != nullptr) - { - *out_opt_n_queue_family_indices_ptr = n_result_queue_family_indices; - } -} - -/** Please see header for specification */ -VkAccessFlags Anvil::Utils::get_access_mask_from_image_layout(VkImageLayout in_layout, - Anvil::QueueFamilyType in_queue_family_type) -{ - VkAccessFlags result = 0; - - switch (in_layout) - { - case VK_IMAGE_LAYOUT_UNDEFINED: - { - result = 0; - - break; - } - - case VK_IMAGE_LAYOUT_GENERAL: - { - result = VK_ACCESS_INDIRECT_COMMAND_READ_BIT | - VK_ACCESS_INDEX_READ_BIT | - VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT | - VK_ACCESS_UNIFORM_READ_BIT | - VK_ACCESS_INPUT_ATTACHMENT_READ_BIT | - VK_ACCESS_SHADER_READ_BIT | - VK_ACCESS_SHADER_WRITE_BIT | - VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_TRANSFER_READ_BIT | - VK_ACCESS_TRANSFER_WRITE_BIT | - VK_ACCESS_HOST_READ_BIT | - VK_ACCESS_HOST_WRITE_BIT | - VK_ACCESS_MEMORY_READ_BIT | - VK_ACCESS_MEMORY_WRITE_BIT; - - break; - } - - case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL: - { - result = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; - - break; - } - - case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL: - { - result = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; - - break; - } - - case VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL: - { - result = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT; - - break; - } - - case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL: - { - result = VK_ACCESS_SHADER_READ_BIT; - - break; - } - - case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL: - { - result = VK_ACCESS_TRANSFER_READ_BIT; - - break; - } - - case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL: - { - result = VK_ACCESS_TRANSFER_WRITE_BIT; - - break; - } - - case VK_IMAGE_LAYOUT_PREINITIALIZED: - { - result = VK_ACCESS_SHADER_READ_BIT; - - break; - } - - case VK_IMAGE_LAYOUT_PRESENT_SRC_KHR: - { - result = VK_ACCESS_MEMORY_READ_BIT; - - break; - } - - default: - { - /* Invalid VkImageLayout argument value */ - anvil_assert_fail(); - } - } - - switch (in_queue_family_type) - { - case Anvil::QueueFamilyType::COMPUTE: - { - result &= (VK_ACCESS_INDIRECT_COMMAND_READ_BIT | - VK_ACCESS_MEMORY_READ_BIT | - VK_ACCESS_MEMORY_WRITE_BIT | - VK_ACCESS_SHADER_READ_BIT | - VK_ACCESS_SHADER_WRITE_BIT | - VK_ACCESS_TRANSFER_READ_BIT | - VK_ACCESS_TRANSFER_WRITE_BIT | - VK_ACCESS_UNIFORM_READ_BIT); - - break; - } - - case Anvil::QueueFamilyType::TRANSFER: - { - result &= (VK_ACCESS_MEMORY_READ_BIT | - VK_ACCESS_MEMORY_WRITE_BIT | - VK_ACCESS_TRANSFER_READ_BIT | - VK_ACCESS_TRANSFER_WRITE_BIT); - - break; - } - - case Anvil::QueueFamilyType::UNIVERSAL: - { - result &= (VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_INDIRECT_COMMAND_READ_BIT | - VK_ACCESS_INDEX_READ_BIT | - VK_ACCESS_MEMORY_READ_BIT | - VK_ACCESS_MEMORY_WRITE_BIT | - VK_ACCESS_SHADER_READ_BIT | - VK_ACCESS_SHADER_WRITE_BIT | - VK_ACCESS_TRANSFER_READ_BIT | - VK_ACCESS_TRANSFER_WRITE_BIT | - VK_ACCESS_UNIFORM_READ_BIT | - VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT); - - break; - } - - case Anvil::QueueFamilyType::UNDEFINED: - { - break; - } - - default: - { - anvil_assert_fail(); - } - } - - return result; -} - -/* Please see header for specification */ -Anvil::QueueFamilyBits Anvil::Utils::get_queue_family_bits_from_queue_family_type(Anvil::QueueFamilyType in_queue_family_type) -{ - Anvil::QueueFamilyBits result = 0; - - switch (in_queue_family_type) - { - case Anvil::QueueFamilyType::COMPUTE: result = Anvil::QUEUE_FAMILY_COMPUTE_BIT; break; - case Anvil::QueueFamilyType::TRANSFER: result = Anvil::QUEUE_FAMILY_DMA_BIT; break; - case Anvil::QueueFamilyType::UNIVERSAL: result = Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT; break; - - default: - { - anvil_assert_fail(); - } - } - - return result; -} - -/* Please see header for specification */ -const char* Anvil::Utils::get_raw_string(Anvil::QueueFamilyType in_queue_family_type) -{ - static const char* result_strings[] = - { - "Compute", - "Transfer", - "Universal", - }; - static const uint32_t n_result_strings = sizeof(result_strings) / sizeof(result_strings[0]); - - static_assert(n_result_strings == static_cast(Anvil::QueueFamilyType::COUNT), ""); - - return result_strings[static_cast(in_queue_family_type)]; -} - -/* Please see header for specification */ -const char* Anvil::Utils::get_raw_string(VkAttachmentLoadOp in_load_op) -{ - static const char* attachment_load_op_strings[] = - { - "VK_ATTACHMENT_LOAD_OP_LOAD", - "VK_ATTACHMENT_LOAD_OP_CLEAR", - "VK_ATTACHMENT_LOAD_OP_DONT_CARE", - }; - static const uint32_t n_attachment_load_op_strings = sizeof(attachment_load_op_strings) / sizeof(attachment_load_op_strings[0]); - - static_assert(n_attachment_load_op_strings == VK_ATTACHMENT_LOAD_OP_RANGE_SIZE, ""); - anvil_assert (in_load_op <= VK_ATTACHMENT_LOAD_OP_END_RANGE); - - return attachment_load_op_strings[in_load_op]; -} - -/* Please see header for specification */ -const char* Anvil::Utils::get_raw_string(VkAttachmentStoreOp in_store_op) -{ - static const char* attachment_store_op_strings[] = - { - "VK_ATTACHMENT_STORE_OP_STORE", - "VK_ATTACHMENT_STORE_OP_DONT_CARE", - }; - static const uint32_t n_attachment_store_op_strings = sizeof(attachment_store_op_strings) / sizeof(attachment_store_op_strings[0]); - - static_assert(n_attachment_store_op_strings == VK_ATTACHMENT_STORE_OP_RANGE_SIZE, ""); - anvil_assert (in_store_op <= VK_ATTACHMENT_STORE_OP_END_RANGE); - - return attachment_store_op_strings[in_store_op]; -} - -/* Please see header for specification */ -const char* Anvil::Utils::get_raw_string(VkBlendFactor in_blend_factor) -{ - const char* result = "?"; - - switch (in_blend_factor) - { - case VK_BLEND_FACTOR_ZERO: result = "VK_BLEND_FACTOR_ZERO"; break; - case VK_BLEND_FACTOR_ONE: result = "VK_BLEND_FACTOR_ONE"; break; - case VK_BLEND_FACTOR_SRC_COLOR: result = "VK_BLEND_FACTOR_SRC_COLOR"; break; - case VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR: result = "VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR"; break; - case VK_BLEND_FACTOR_DST_COLOR: result = "VK_BLEND_FACTOR_DST_COLOR"; break; - case VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR: result = "VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR"; break; - case VK_BLEND_FACTOR_SRC_ALPHA: result = "VK_BLEND_FACTOR_SRC_ALPHA"; break; - case VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA: result = "VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA"; break; - case VK_BLEND_FACTOR_DST_ALPHA: result = "VK_BLEND_FACTOR_DST_ALPHA"; break; - case VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA: result = "VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA"; break; - case VK_BLEND_FACTOR_CONSTANT_COLOR: result = "VK_BLEND_FACTOR_CONSTANT_COLOR"; break; - case VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR: result = "VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR"; break; - case VK_BLEND_FACTOR_CONSTANT_ALPHA: result = "VK_BLEND_FACTOR_CONSTANT_ALPHA"; break; - case VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA: result = "VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA"; break; - case VK_BLEND_FACTOR_SRC_ALPHA_SATURATE: result = "VK_BLEND_FACTOR_SRC_ALPHA_SATURATE"; break; - case VK_BLEND_FACTOR_SRC1_COLOR: result = "VK_BLEND_FACTOR_SRC1_COLOR"; break; - case VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR: result = "VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR"; break; - case VK_BLEND_FACTOR_SRC1_ALPHA: result = "VK_BLEND_FACTOR_SRC1_ALPHA"; break; - case VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA: result = "VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA"; break; - - default: - { - anvil_assert_fail(); - } - } - - return result; -} - -/* Please see header for specification */ -const char* Anvil::Utils::get_raw_string(VkBlendOp in_blend_op) -{ - const char* result = "?"; - - switch (in_blend_op) - { - case VK_BLEND_OP_ADD: result = "VK_BLEND_OP_ADD"; break; - case VK_BLEND_OP_SUBTRACT: result = "VK_BLEND_OP_SUBTRACT"; break; - case VK_BLEND_OP_REVERSE_SUBTRACT: result = "VK_BLEND_OP_REVERSE_SUBTRACT"; break; - case VK_BLEND_OP_MIN: result = "VK_BLEND_OP_MIN"; break; - case VK_BLEND_OP_MAX: result = "VK_BLEND_OP_MAX"; break; - - default: - { - anvil_assert_fail(); - } - } - - return result; -} - -/* Please see header for specification */ -const char* Anvil::Utils::get_raw_string(VkCompareOp in_compare_op) -{ - const char* result = "?"; - - switch (in_compare_op) - { - case VK_COMPARE_OP_NEVER: result = "VK_COMPARE_OP_NEVER"; break; - case VK_COMPARE_OP_LESS: result = "VK_COMPARE_OP_LESS"; break; - case VK_COMPARE_OP_EQUAL: result = "VK_COMPARE_OP_EQUAL"; break; - case VK_COMPARE_OP_LESS_OR_EQUAL: result = "VK_COMPARE_OP_LESS_OR_EQUAL"; break; - case VK_COMPARE_OP_GREATER: result = "VK_COMPARE_OP_GREATER"; break; - case VK_COMPARE_OP_NOT_EQUAL: result = "VK_COMPARE_OP_NOT_EQUAL"; break; - case VK_COMPARE_OP_GREATER_OR_EQUAL: result = "VK_COMPARE_OP_GREATER_OR_EQUAL"; break; - case VK_COMPARE_OP_ALWAYS: result = "VK_COMPARE_OP_ALWAYS"; break; - - default: - { - anvil_assert_fail(); - } - } - - return result; -} - -/* Please see header for specification */ -const char* Anvil::Utils::get_raw_string(VkCullModeFlagBits in_cull_mode) -{ - const char* result = "?"; - - switch (in_cull_mode) - { - case VK_CULL_MODE_NONE: result = "VK_CULL_MODE_NONE"; break; - case VK_CULL_MODE_FRONT_BIT: result = "VK_CULL_MODE_FRONT_BIT"; break; - case VK_CULL_MODE_BACK_BIT: result = "VK_CULL_MODE_BACK_BIT"; break; - case VK_CULL_MODE_FRONT_AND_BACK: result = "VK_CULL_MODE_FRONT_AND_BACK"; break; - - default: - { - anvil_assert_fail(); - } - } - - return result; -} - -/* Please see header for specification */ -const char* Anvil::Utils::get_raw_string(VkDescriptorType in_descriptor_type) -{ - const char* result = "?"; - - switch (in_descriptor_type) - { - case VK_DESCRIPTOR_TYPE_SAMPLER: result = "VK_DESCRIPTOR_TYPE_SAMPLER"; break; - case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER: result = "VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER"; break; - case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE: result = "VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE"; break; - case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: result = "VK_DESCRIPTOR_TYPE_STORAGE_IMAGE"; break; - case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: result = "VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER"; break; - case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: result = "VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER"; break; - case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER: result = "VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER"; break; - case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: result = "VK_DESCRIPTOR_TYPE_STORAGE_BUFFER"; break; - case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: result = "VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC"; break; - case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: result = "VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC"; break; - case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT: result = "VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT"; break; - - default: - { - anvil_assert_fail(); - } - } - - return result; -} - -/* Please see header for specification */ -const char* Anvil::Utils::get_raw_string(VkFrontFace in_front_face) -{ - const char* result = "?"; - - switch (in_front_face) - { - case VK_FRONT_FACE_COUNTER_CLOCKWISE: result = "VK_FRONT_FACE_COUNTER_CLOCKWISE"; break; - case VK_FRONT_FACE_CLOCKWISE: result = "VK_FRONT_FACE_CLOCKWISE"; break; - - default: - { - anvil_assert_fail(); - } - } - - return result; -} - -/* Please see header for specification */ -const char* Anvil::Utils::get_raw_string(VkImageAspectFlagBits in_image_aspect_flag) -{ - const char* result = "?"; - - switch (in_image_aspect_flag) - { - case VK_IMAGE_ASPECT_COLOR_BIT: result = "VK_IMAGE_ASPECT_COLOR_BIT"; break; - case VK_IMAGE_ASPECT_DEPTH_BIT: result = "VK_IMAGE_ASPECT_DEPTH_BIT"; break; - case VK_IMAGE_ASPECT_STENCIL_BIT: result = "VK_IMAGE_ASPECT_STENCIL_BIT"; break; - case VK_IMAGE_ASPECT_METADATA_BIT: result = "VK_IMAGE_ASPECT_METADATA_BIT"; break; - - default: - { - anvil_assert_fail(); - } - } - - return result; - -} - -/* Please see header for specification */ -const char* Anvil::Utils::get_raw_string(VkImageLayout in_image_layout) -{ - const char* result = "?!"; - - /* Note: we can't use an array-based solution here because of PRESENT_SRC_KHR */ - switch (in_image_layout) - { - case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL: result = "VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL"; break; - case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL: result = "VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL"; break; - case VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL: result = "VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL"; break; - case VK_IMAGE_LAYOUT_GENERAL: result = "VK_IMAGE_LAYOUT_GENERAL"; break; - case VK_IMAGE_LAYOUT_PREINITIALIZED: result = "VK_IMAGE_LAYOUT_PREINITIALIZED"; break; - case VK_IMAGE_LAYOUT_PRESENT_SRC_KHR: result = "VK_IMAGE_LAYOUT_PRESENT_SRC_KHR"; break; - case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL: result = "VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL"; break; - case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL: result = "VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL"; break; - case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL: result = "VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL"; break; - case VK_IMAGE_LAYOUT_UNDEFINED: result = "VK_IMAGE_LAYOUT_UNDEFINED"; break; - - default: - { - anvil_assert_fail(); - - break; - } - } - - return result; -} - -/* Please see header for specification */ -const char* Anvil::Utils::get_raw_string(VkImageTiling in_image_tiling) -{ - static const char* image_tilings[] = - { - "VK_IMAGE_TILING_OPTIMAL", - "VK_IMAGE_TILING_LINEAR" - }; - static const int32_t n_image_tilings = sizeof(image_tilings) / sizeof(image_tilings[0]); - - static_assert(n_image_tilings == VK_IMAGE_TILING_RANGE_SIZE, ""); - anvil_assert (in_image_tiling < n_image_tilings); - - return image_tilings[in_image_tiling]; -} - -/* Please see header for specification */ -const char* Anvil::Utils::get_raw_string(VkImageType in_image_type) -{ - static const char* image_types[] = - { - "VK_IMAGE_TYPE_1D", - "VK_IMAGE_TYPE_2D", - "VK_IMAGE_TYPE_3D" - }; - static const uint32_t n_image_types = sizeof(image_types) / sizeof(image_types[0]); - - static_assert(n_image_types == VK_IMAGE_TYPE_RANGE_SIZE, ""); - anvil_assert (in_image_type < VK_IMAGE_TYPE_RANGE_SIZE); - - return image_types[in_image_type]; -} - -/** Please see header for specification */ -const char* Anvil::Utils::get_raw_string(VkImageViewType in_image_view_type) -{ - static const char* image_view_types[] = - { - "VK_IMAGE_VIEW_TYPE_1D", - "VK_IMAGE_VIEW_TYPE_2D", - "VK_IMAGE_VIEW_TYPE_3D", - "VK_IMAGE_VIEW_TYPE_CUBE", - "VK_IMAGE_VIEW_TYPE_1D_ARRAY", - "VK_IMAGE_VIEW_TYPE_2D_ARRAY", - "VK_IMAGE_VIEW_TYPE_CUBE_ARRAY", - }; - static const uint32_t n_image_view_types = sizeof(image_view_types) / sizeof(image_view_types[0]); - - static_assert(n_image_view_types == VK_IMAGE_VIEW_TYPE_RANGE_SIZE, ""); - anvil_assert (in_image_view_type < VK_IMAGE_VIEW_TYPE_RANGE_SIZE); - - return image_view_types[in_image_view_type]; -} - -/* Please see header for specification */ -const char* Anvil::Utils::get_raw_string(VkLogicOp in_logic_op) -{ - const char* result = "?"; - - switch (in_logic_op) - { - case VK_LOGIC_OP_CLEAR: result = "VK_LOGIC_OP_CLEAR"; break; - case VK_LOGIC_OP_AND: result = "VK_LOGIC_OP_AND"; break; - case VK_LOGIC_OP_AND_REVERSE: result = "VK_LOGIC_OP_AND_REVERSE"; break; - case VK_LOGIC_OP_COPY: result = "VK_LOGIC_OP_COPY"; break; - case VK_LOGIC_OP_AND_INVERTED: result = "VK_LOGIC_OP_AND_INVERTED"; break; - case VK_LOGIC_OP_NO_OP: result = "VK_LOGIC_OP_NO_OP"; break; - case VK_LOGIC_OP_XOR: result = "VK_LOGIC_OP_XOR"; break; - case VK_LOGIC_OP_OR: result = "VK_LOGIC_OP_OR"; break; - case VK_LOGIC_OP_NOR: result = "VK_LOGIC_OP_NOR"; break; - case VK_LOGIC_OP_EQUIVALENT: result = "VK_LOGIC_OP_EQUIVALENT"; break; - case VK_LOGIC_OP_INVERT: result = "VK_LOGIC_OP_INVERT"; break; - case VK_LOGIC_OP_OR_REVERSE: result = "VK_LOGIC_OP_OR_REVERSE"; break; - case VK_LOGIC_OP_COPY_INVERTED: result = "VK_LOGIC_OP_COPY_INVERTED"; break; - case VK_LOGIC_OP_OR_INVERTED: result = "VK_LOGIC_OP_OR_INVERTED"; break; - case VK_LOGIC_OP_NAND: result = "VK_LOGIC_OP_NAND"; break; - case VK_LOGIC_OP_SET: result = "VK_LOGIC_OP_SET"; break; - - default: - { - anvil_assert_fail(); - } - } - - return result; -} - -/* Please see header for specification */ -const char* Anvil::Utils::get_raw_string(VkPolygonMode in_polygon_mode) -{ - const char* result = "?"; - - switch (in_polygon_mode) - { - case VK_POLYGON_MODE_FILL: result = "VK_POLYGON_MODE_FILL"; break; - case VK_POLYGON_MODE_LINE: result = "VK_POLYGON_MODE_LINE"; break; - case VK_POLYGON_MODE_POINT: result = "VK_POLYGON_MODE_POINT"; break; - - default: - { - anvil_assert_fail(); - } - } - - return result; -} - -/* Please see header for specification */ -const char* Anvil::Utils::get_raw_string(VkPrimitiveTopology in_topology) -{ - const char* result = "?"; - - switch (in_topology) - { - case VK_PRIMITIVE_TOPOLOGY_POINT_LIST: result = "VK_PRIMITIVE_TOPOLOGY_POINT_LIST"; break; - case VK_PRIMITIVE_TOPOLOGY_LINE_LIST: result = "VK_PRIMITIVE_TOPOLOGY_LINE_LIST"; break; - case VK_PRIMITIVE_TOPOLOGY_LINE_STRIP: result = "VK_PRIMITIVE_TOPOLOGY_LINE_STRIP"; break; - case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST: result = "VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST"; break; - case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP: result = "VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP"; break; - case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN: result = "VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN"; break; - case VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY: result = "VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY"; break; - case VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY: result = "VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY"; break; - case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY: result = "VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY"; break; - case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY: result = "VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY"; break; - case VK_PRIMITIVE_TOPOLOGY_PATCH_LIST: result = "VK_PRIMITIVE_TOPOLOGY_PATCH_LIST"; break; - - default: - { - anvil_assert_fail(); - } - } - - return result; -} - -/* Please see header for specification */ -const char* Anvil::Utils::get_raw_string(VkSampleCountFlagBits in_sample_count) -{ - const char* result = "?"; - - switch (in_sample_count) - { - case VK_SAMPLE_COUNT_1_BIT: result = "VK_SAMPLE_COUNT_1_BIT"; break; - case VK_SAMPLE_COUNT_2_BIT: result = "VK_SAMPLE_COUNT_2_BIT"; break; - case VK_SAMPLE_COUNT_4_BIT: result = "VK_SAMPLE_COUNT_4_BIT"; break; - case VK_SAMPLE_COUNT_8_BIT: result = "VK_SAMPLE_COUNT_8_BIT"; break; - case VK_SAMPLE_COUNT_16_BIT: result = "VK_SAMPLE_COUNT_16_BIT"; break; - case VK_SAMPLE_COUNT_32_BIT: result = "VK_SAMPLE_COUNT_32_BIT"; break; - case VK_SAMPLE_COUNT_64_BIT: result = "VK_SAMPLE_COUNT_64_BIT"; break; - - default: - { - anvil_assert_fail(); - } - } - - return result; -} - -/* Please see header for specification */ -const char* Anvil::Utils::get_raw_string(Anvil::ShaderStage in_shader_stage) -{ - const char* result = "?"; - - switch (in_shader_stage) - { - case SHADER_STAGE_COMPUTE: result = "SHADER_STAGE_COMPUTE"; break; - case SHADER_STAGE_FRAGMENT: result = "SHADER_STAGE_FRAGMENT"; break; - case SHADER_STAGE_GEOMETRY: result = "SHADER_STAGE_GEOMETRY"; break; - case SHADER_STAGE_TESSELLATION_CONTROL: result = "SHADER_STAGE_TESSELLATION_CONTROL"; break; - case SHADER_STAGE_TESSELLATION_EVALUATION: result = "SHADER_STAGE_TESSELLATION_EVALUATION"; break; - case SHADER_STAGE_VERTEX: result = "SHADER_STAGE_VERTEX"; break; - - default: - { - anvil_assert_fail(); - } - } - - return result; -} - -/* Please see header for specification */ -const char* Anvil::Utils::get_raw_string(VkShaderStageFlagBits in_shader_stage) -{ - const char* result = "?"; - - switch (in_shader_stage) - { - case VK_SHADER_STAGE_ALL_GRAPHICS: result = "VK_SHADER_STAGE_ALL_GRAPHICS"; break; - case VK_SHADER_STAGE_COMPUTE_BIT: result = "VK_SHADER_STAGE_COMPUTE_BIT"; break; - case VK_SHADER_STAGE_FRAGMENT_BIT: result = "VK_SHADER_STAGE_FRAGMENT_BIT"; break; - case VK_SHADER_STAGE_GEOMETRY_BIT: result = "VK_SHADER_STAGE_GEOMETRY_BIT"; break; - case VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT: result = "VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT"; break; - case VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT: result = "VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT"; break; - case VK_SHADER_STAGE_VERTEX_BIT: result = "VK_SHADER_STAGE_VERTEX_BIT"; break; - - default: - { - anvil_assert_fail(); - } - } - - return result; -} - -/* Please see header for specification */ -const char* Anvil::Utils::get_raw_string(VkSharingMode in_sharing_mode) -{ - static const char* sharing_modes[] = - { - "VK_SHARING_MODE_EXCLUSIVE", - "VK_SHARING_MODE_CONCURRENT" - }; - static const int32_t n_sharing_modes = sizeof(sharing_modes) / sizeof(sharing_modes[0]); - - static_assert(n_sharing_modes == VK_SHARING_MODE_RANGE_SIZE, ""); - anvil_assert (in_sharing_mode < n_sharing_modes); - - return sharing_modes[in_sharing_mode]; -} - -/* Please see header for specification */ -const char* Anvil::Utils::get_raw_string(VkStencilOp in_stencil_op) -{ - const char* result = "?"; - - switch (in_stencil_op) - { - case VK_STENCIL_OP_KEEP: result = "VK_STENCIL_OP_KEEP"; break; - case VK_STENCIL_OP_ZERO: result = "VK_STENCIL_OP_ZERO"; break; - case VK_STENCIL_OP_REPLACE: result = "VK_STENCIL_OP_REPLACE"; break; - case VK_STENCIL_OP_INCREMENT_AND_CLAMP: result = "VK_STENCIL_OP_INCREMENT_AND_CLAMP"; break; - case VK_STENCIL_OP_DECREMENT_AND_CLAMP: result = "VK_STENCIL_OP_DECREMENT_AND_CLAMP"; break; - case VK_STENCIL_OP_INVERT: result = "VK_STENCIL_OP_INVERT"; break; - case VK_STENCIL_OP_INCREMENT_AND_WRAP: result = "VK_STENCIL_OP_INCREMENT_AND_WRAP"; break; - case VK_STENCIL_OP_DECREMENT_AND_WRAP: result = "VK_STENCIL_OP_DECREMENT_AND_WRAP"; break; - - default: - { - anvil_assert_fail(); - } - } - - return result; -} - -/* Please see header for specification */ -VkShaderStageFlagBits Anvil::Utils::get_shader_stage_flag_bits_from_shader_stage(Anvil::ShaderStage in_shader_stage) -{ - VkShaderStageFlagBits result = VK_SHADER_STAGE_FLAG_BITS_MAX_ENUM; - - switch (in_shader_stage) - { - case Anvil::ShaderStage::SHADER_STAGE_COMPUTE: result = VK_SHADER_STAGE_COMPUTE_BIT; break; - case Anvil::ShaderStage::SHADER_STAGE_FRAGMENT: result = VK_SHADER_STAGE_FRAGMENT_BIT; break; - case Anvil::ShaderStage::SHADER_STAGE_GEOMETRY: result = VK_SHADER_STAGE_GEOMETRY_BIT; break; - case Anvil::ShaderStage::SHADER_STAGE_TESSELLATION_CONTROL: result = VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT; break; - case Anvil::ShaderStage::SHADER_STAGE_TESSELLATION_EVALUATION: result = VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT; break; - case Anvil::ShaderStage::SHADER_STAGE_VERTEX: result = VK_SHADER_STAGE_VERTEX_BIT; break; - - default: - { - anvil_assert_fail(); - } - } - - return result; -} - -/* Please see header for specification */ -void Anvil::Utils::get_vk_property_flags_from_memory_feature_flags(Anvil::MemoryFeatureFlags in_mem_feature_flags, - VkMemoryPropertyFlags* out_mem_type_flags_ptr, - VkMemoryHeapFlags* out_mem_heap_flags_ptr) -{ - VkMemoryHeapFlags result_mem_heap_flags = 0; - VkMemoryPropertyFlags result_mem_type_flags = 0; - - if ((in_mem_feature_flags & MEMORY_FEATURE_FLAG_DEVICE_LOCAL) != 0) - { - result_mem_type_flags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; - } - - if ((in_mem_feature_flags & MEMORY_FEATURE_FLAG_MAPPABLE) != 0) - { - result_mem_type_flags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT; - } - - if ((in_mem_feature_flags & MEMORY_FEATURE_FLAG_HOST_COHERENT) != 0) - { - result_mem_type_flags |= VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; - } - - if ((in_mem_feature_flags & MEMORY_FEATURE_FLAG_HOST_CACHED) != 0) - { - result_mem_type_flags |= VK_MEMORY_PROPERTY_HOST_CACHED_BIT; - } - - if ((in_mem_feature_flags & MEMORY_FEATURE_FLAG_LAZILY_ALLOCATED) != 0) - { - result_mem_type_flags |= VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT; - } - - *out_mem_heap_flags_ptr = result_mem_heap_flags; - *out_mem_type_flags_ptr = result_mem_type_flags; -} diff --git a/src/misc/types_classes.cpp b/src/misc/types_classes.cpp new file mode 100644 index 00000000..49f5f8e2 --- /dev/null +++ b/src/misc/types_classes.cpp @@ -0,0 +1,680 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#include "misc/buffer_create_info.h" +#include "misc/image_create_info.h" +#include "misc/types.h" +#include "wrappers/buffer.h" +#include "wrappers/image.h" +#include "wrappers/memory_block.h" +#include "wrappers/semaphore.h" + +/** Please see header for specification */ +Anvil::SparseMemoryBindInfoID Anvil::SparseMemoryBindingUpdateInfo::add_bind_info(uint32_t in_n_signal_semaphores, + Anvil::Semaphore* const* in_opt_signal_semaphores_ptr, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_opt_wait_semaphores_ptr) +{ + Anvil::SparseMemoryBindInfoID result_id = static_cast(m_bindings.size() ); + BindingInfo new_binding; + + for (uint32_t n_signal_sem = 0; + n_signal_sem < in_n_signal_semaphores; + ++n_signal_sem) + { + new_binding.signal_semaphores.push_back(in_opt_signal_semaphores_ptr[n_signal_sem]); + } + + for (uint32_t n_wait_sem = 0; + n_wait_sem < in_n_wait_semaphores; + ++n_wait_sem) + { + new_binding.wait_semaphores.push_back(in_opt_wait_semaphores_ptr[n_wait_sem]); + } + + m_bindings.push_back(new_binding); + + return result_id; +} + +/** Please see header for specification */ +void Anvil::SparseMemoryBindingUpdateInfo::append_buffer_memory_update(SparseMemoryBindInfoID in_bind_info_id, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_buffer_memory_start_offset, + Anvil::MemoryBlock* in_memory_block_ptr, + VkDeviceSize in_memory_block_start_offset, + bool in_memory_block_owned_by_buffer, + VkDeviceSize in_size) +{ + /* Sanity checks */ + anvil_assert(in_buffer_ptr != nullptr); + anvil_assert(m_bindings.size() > in_bind_info_id); + anvil_assert(in_buffer_ptr->get_memory_requirements().size >= in_buffer_memory_start_offset + in_size); + + if (in_memory_block_ptr != nullptr) + { + anvil_assert(in_memory_block_ptr->get_size() >= in_memory_block_start_offset + in_size); + } + + /* Cache the update */ + auto& binding = m_bindings.at(in_bind_info_id); + GeneralBindInfo update; + VkSparseMemoryBind update_vk; + + update.memory_block_owned_by_target = in_memory_block_owned_by_buffer; + update.memory_block_ptr = in_memory_block_ptr; + update.memory_block_start_offset = in_memory_block_start_offset; + update.size = in_size; + update.start_offset = in_buffer_memory_start_offset; + + update_vk.flags = 0; + update_vk.memory = (in_memory_block_ptr != nullptr) ? in_memory_block_ptr->get_memory() + : VK_NULL_HANDLE; + update_vk.memoryOffset = (in_memory_block_ptr != nullptr) ? (in_memory_block_ptr->get_start_offset() + in_memory_block_start_offset) + : UINT32_MAX; + update_vk.resourceOffset = (in_buffer_ptr->get_create_info_ptr()->get_start_offset() + in_buffer_memory_start_offset); + update_vk.size = in_size; + + binding.buffer_updates[in_buffer_ptr].first.push_back (update); + binding.buffer_updates[in_buffer_ptr].second.push_back(update_vk); +} + +/** Please see header for specification */ +void Anvil::SparseMemoryBindingUpdateInfo::append_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, + Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + const VkExtent3D& in_extent, + VkSparseMemoryBindFlags in_flags, + Anvil::MemoryBlock* in_opt_memory_block_ptr, + VkDeviceSize in_opt_memory_block_start_offset, + bool in_opt_memory_block_owned_by_image) +{ + /* Sanity checks .. */ + anvil_assert(in_image_ptr != nullptr); + anvil_assert(in_flags == 0); + anvil_assert(m_bindings.size() > in_bind_info_id); + + anvil_assert(in_image_ptr->get_create_info_ptr()->get_n_layers() > in_subresource.arrayLayer); + anvil_assert(in_image_ptr->get_n_mipmaps () > in_subresource.mipLevel); + anvil_assert(in_image_ptr->has_aspects (in_subresource.aspectMask) ); + + if (in_opt_memory_block_ptr != nullptr) + { + anvil_assert(in_opt_memory_block_ptr->get_size() > in_opt_memory_block_start_offset); + } + + /* Cache the update */ + auto& binding = m_bindings.at(in_bind_info_id); + ImageBindInfo update; + VkSparseImageMemoryBind update_vk; + + update.extent = in_extent; + update.flags = in_flags; + update.memory_block_owned_by_image = in_opt_memory_block_owned_by_image; + update.memory_block_ptr = in_opt_memory_block_ptr; + update.memory_block_start_offset = in_opt_memory_block_start_offset; + update.offset = in_offset; + update.subresource = in_subresource; + + update_vk.extent = in_extent; + update_vk.flags = in_flags; + update_vk.memory = (in_opt_memory_block_ptr != nullptr) ? in_opt_memory_block_ptr->get_memory() + : VK_NULL_HANDLE; + update_vk.memoryOffset = (in_opt_memory_block_ptr != nullptr) ? in_opt_memory_block_ptr->get_start_offset() + in_opt_memory_block_start_offset + : UINT32_MAX; + update_vk.offset = in_offset; + update_vk.subresource = in_subresource; + + binding.image_updates[in_image_ptr].first.push_back (update); + binding.image_updates[in_image_ptr].second.push_back(update_vk); +} + +/** Please see header for specification */ +void Anvil::SparseMemoryBindingUpdateInfo::append_opaque_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, + Anvil::Image* in_image_ptr, + VkDeviceSize in_resource_offset, + VkDeviceSize in_size, + VkSparseMemoryBindFlags in_flags, + Anvil::MemoryBlock* in_opt_memory_block_ptr, + VkDeviceSize in_opt_memory_block_start_offset, + bool in_opt_memory_block_owned_by_image) +{ + /* Sanity checks */ + anvil_assert(in_image_ptr != nullptr); + anvil_assert(m_bindings.size() > in_bind_info_id); + anvil_assert(in_image_ptr->get_memory_requirements().size >= in_resource_offset + in_size); + + if (in_opt_memory_block_ptr != nullptr) + { + anvil_assert(in_opt_memory_block_ptr->get_size() >= in_opt_memory_block_start_offset + in_size); + } + + /* Cache the update */ + auto& binding = m_bindings.at(in_bind_info_id); + GeneralBindInfo update; + VkSparseMemoryBind update_vk; + + update.flags = in_flags; + update.memory_block_owned_by_target = in_opt_memory_block_owned_by_image; + update.memory_block_ptr = in_opt_memory_block_ptr; + update.memory_block_start_offset = in_opt_memory_block_start_offset; + update.size = in_size; + update.start_offset = in_resource_offset; + + update_vk.flags = in_flags; + update_vk.memory = (in_opt_memory_block_ptr != nullptr) ? in_opt_memory_block_ptr->get_memory() + : VK_NULL_HANDLE; + update_vk.memoryOffset = (in_opt_memory_block_ptr != nullptr) ? (in_opt_memory_block_ptr->get_start_offset() + in_opt_memory_block_start_offset) + : UINT32_MAX; + update_vk.resourceOffset = in_resource_offset; + update_vk.size = in_size; + + binding.image_opaque_updates[in_image_ptr].first.push_back (update); + binding.image_opaque_updates[in_image_ptr].second.push_back(update_vk); +} + +/** Please see header for specification */ +void Anvil::SparseMemoryBindingUpdateInfo::bake() +{ + const uint32_t n_bindings = static_cast(m_bindings.size() ); + + anvil_assert(m_dirty); + + if (n_bindings > 0) + { + m_bindings_vk.resize(n_bindings); + + m_buffer_bindings_vk.clear(); + + for (uint32_t n_binding = 0; + n_binding < n_bindings; + ++n_binding) + { + auto& bind_info = m_bindings [n_binding]; + uint32_t n_buffer_bindings_start_index = ~0u; + uint32_t n_image_bindings_start_index = ~0u; + uint32_t n_image_opaque_bindings_start_index = ~0u; + auto& vk_binding = m_bindings_vk[n_binding]; + + bind_info.signal_semaphores_vk.clear(); + bind_info.wait_semaphores_vk.clear (); + + bind_info.signal_semaphores_vk.reserve(bind_info.signal_semaphores.size() ); + bind_info.wait_semaphores_vk.reserve (bind_info.wait_semaphores.size () ); + + for (auto& signal_semaphore_ptr : bind_info.signal_semaphores) + { + bind_info.signal_semaphores_vk.push_back(signal_semaphore_ptr->get_semaphore() ); + } + + for (auto& wait_semaphore_ptr : bind_info.wait_semaphores) + { + bind_info.wait_semaphores_vk.push_back(wait_semaphore_ptr->get_semaphore() ); + } + + vk_binding.bufferBindCount = static_cast(bind_info.buffer_updates.size() ); + vk_binding.imageBindCount = static_cast(bind_info.image_updates.size() ); + vk_binding.imageOpaqueBindCount = static_cast(bind_info.image_opaque_updates.size() ); + vk_binding.pNext = nullptr; + vk_binding.pSignalSemaphores = (bind_info.signal_semaphores_vk.size() > 0) ? &bind_info.signal_semaphores_vk[0] : nullptr; + vk_binding.pWaitSemaphores = (bind_info.wait_semaphores_vk.size() > 0) ? &bind_info.wait_semaphores_vk [0] : nullptr; + vk_binding.signalSemaphoreCount = static_cast(bind_info.signal_semaphores_vk.size() ); + vk_binding.sType = VK_STRUCTURE_TYPE_BIND_SPARSE_INFO; + vk_binding.waitSemaphoreCount = static_cast(bind_info.wait_semaphores_vk.size() ); + + n_buffer_bindings_start_index = static_cast(m_buffer_bindings_vk.size() ); + n_image_bindings_start_index = static_cast(m_image_bindings_vk.size() ); + n_image_opaque_bindings_start_index = static_cast(m_image_opaque_bindings_vk.size() ); + + for (auto& buffer_update : bind_info.buffer_updates) + { + const VkBuffer current_buffer_vk = buffer_update.first->get_buffer(); + VkSparseBufferMemoryBindInfo buffer_bind_info; + + anvil_assert(buffer_update.second.second.size() > 0); + + buffer_bind_info.bindCount = static_cast(buffer_update.second.second.size() ); + buffer_bind_info.buffer = current_buffer_vk; + buffer_bind_info.pBinds = &buffer_update.second.second[0]; + + m_buffer_bindings_vk.push_back(buffer_bind_info); + } + + for (auto& image_update : bind_info.image_updates) + { + const VkImage current_image_vk = image_update.first->get_image(); + VkSparseImageMemoryBindInfo image_bind_info; + + anvil_assert(image_update.second.second.size() > 0); + + image_bind_info.bindCount = static_cast(image_update.second.second.size() ); + image_bind_info.image = current_image_vk; + image_bind_info.pBinds = &image_update.second.second[0]; + + m_image_bindings_vk.push_back(image_bind_info); + } + + for (auto& image_opaque_update : bind_info.image_opaque_updates) + { + const VkImage current_image_vk = image_opaque_update.first->get_image(); + VkSparseImageOpaqueMemoryBindInfo image_opaque_bind_info; + + anvil_assert(image_opaque_update.second.second.size() > 0); + + image_opaque_bind_info.bindCount = static_cast(image_opaque_update.second.second.size() ); + image_opaque_bind_info.image = current_image_vk; + image_opaque_bind_info.pBinds = &image_opaque_update.second.second[0]; + + m_image_opaque_bindings_vk.push_back(image_opaque_bind_info); + } + + vk_binding.pBufferBinds = (bind_info.buffer_updates.size() > 0) ? &m_buffer_bindings_vk [n_buffer_bindings_start_index] : nullptr; + vk_binding.pImageBinds = (bind_info.image_updates.size() > 0) ? &m_image_bindings_vk [n_image_bindings_start_index] : nullptr; + vk_binding.pImageOpaqueBinds = (bind_info.image_opaque_updates.size() > 0) ? &m_image_opaque_bindings_vk[n_image_opaque_bindings_start_index] : nullptr; + } + } + else + { + m_bindings_vk.clear(); + } + + m_dirty = false; +} + +/** Please see header for specification */ +bool Anvil::SparseMemoryBindingUpdateInfo::get_bind_info_properties(SparseMemoryBindInfoID in_bind_info_id, + uint32_t* const out_opt_n_buffer_memory_updates_ptr, + uint32_t* const out_opt_n_image_memory_updates_ptr, + uint32_t* const out_opt_n_image_opaque_memory_updates_ptr, + uint32_t* const out_opt_n_signal_semaphores_ptr, + Anvil::Semaphore*** out_opt_signal_semaphores_ptr_ptr_ptr, + uint32_t* const out_opt_n_wait_semaphores_ptr, + Anvil::Semaphore*** out_opt_wait_semaphores_ptr_ptr_ptr) +{ + decltype(m_bindings)::iterator binding_iterator; + bool result = false; + + if (m_bindings.size() <= in_bind_info_id) + { + anvil_assert(m_bindings.size() > in_bind_info_id); + + goto end; + } + + binding_iterator = m_bindings.begin() + static_cast(in_bind_info_id); + + if (out_opt_n_buffer_memory_updates_ptr != nullptr) + { + uint32_t n_buffer_mem_updates = 0; + + for (const auto& buffer_update_iterator : binding_iterator->buffer_updates) + { + n_buffer_mem_updates += static_cast(buffer_update_iterator.second.first.size() ); + } + + *out_opt_n_buffer_memory_updates_ptr = n_buffer_mem_updates; + } + + if (out_opt_n_image_memory_updates_ptr != nullptr) + { + uint32_t n_image_mem_updates = 0; + + for (const auto& image_update_iterator : binding_iterator->image_updates) + { + n_image_mem_updates += static_cast(image_update_iterator.second.first.size() ); + } + + *out_opt_n_image_memory_updates_ptr = n_image_mem_updates; + } + + if (out_opt_n_image_opaque_memory_updates_ptr != nullptr) + { + uint32_t n_image_opaque_mem_updates = 0; + + for (const auto& image_opaque_update_iterator : binding_iterator->image_opaque_updates) + { + n_image_opaque_mem_updates += static_cast(image_opaque_update_iterator.second.first.size() ); + } + + *out_opt_n_image_opaque_memory_updates_ptr = n_image_opaque_mem_updates; + } + + if (out_opt_n_signal_semaphores_ptr != nullptr) + { + *out_opt_n_signal_semaphores_ptr = static_cast(binding_iterator->signal_semaphores.size() ); + } + + if (out_opt_signal_semaphores_ptr_ptr_ptr != nullptr && + binding_iterator->signal_semaphores.size() > 0) + { + *out_opt_signal_semaphores_ptr_ptr_ptr = &binding_iterator->signal_semaphores.at(0); + } + + if (out_opt_n_wait_semaphores_ptr != nullptr) + { + *out_opt_n_wait_semaphores_ptr = static_cast(binding_iterator->wait_semaphores.size() ); + } + + if (out_opt_wait_semaphores_ptr_ptr_ptr != nullptr && + binding_iterator->wait_semaphores.size() > 0) + { + *out_opt_wait_semaphores_ptr_ptr_ptr = &binding_iterator->wait_semaphores.at(0); + } + + /* All done */ + result = true; +end: + return result; +} + +/** Please see header for specification */ +void Anvil::SparseMemoryBindingUpdateInfo::get_bind_sparse_call_args(uint32_t* out_bind_info_count_ptr, + const VkBindSparseInfo** out_bind_info_ptr, + Anvil::Fence** out_fence_to_set_ptr) +{ + if (m_dirty) + { + bake(); + + anvil_assert(!m_dirty); + } + + *out_bind_info_count_ptr = static_cast(m_bindings.size() ); + *out_bind_info_ptr = (m_bindings_vk.size() > 0) ? &m_bindings_vk.at(0) : nullptr; + *out_fence_to_set_ptr = m_fence_ptr; +} + +/** Please see header for specification */ +bool Anvil::SparseMemoryBindingUpdateInfo::get_buffer_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, + uint32_t in_n_update, + Anvil::Buffer** out_opt_buffer_ptr_ptr, + VkDeviceSize* out_opt_buffer_memory_start_offset_ptr, + Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, + VkDeviceSize* out_opt_memory_block_start_offset_ptr, + bool* out_opt_memory_block_owned_by_buffer_ptr, + VkDeviceSize* out_opt_size_ptr) const +{ + GeneralBindInfo buffer_bind; + BufferBindUpdateMap::const_iterator buffer_binding_map_iterator; + decltype(m_bindings)::const_iterator binding_iterator; + uint32_t n_current_update = 0; + bool result = false; + + if (m_bindings.size() <= in_bind_info_id) + { + anvil_assert(!(m_bindings.size() <= in_bind_info_id) ); + + goto end; + } + + binding_iterator = m_bindings.cbegin() + static_cast(in_bind_info_id); + buffer_binding_map_iterator = binding_iterator->buffer_updates.begin(); + + while (buffer_binding_map_iterator != binding_iterator->buffer_updates.end() ) + { + const uint32_t n_buffer_bindings = static_cast(buffer_binding_map_iterator->second.first.size() ); + + if (n_current_update + n_buffer_bindings > in_n_update) + { + buffer_bind = buffer_binding_map_iterator->second.first.at(in_n_update - n_current_update); + + break; + } + else + { + n_current_update += n_buffer_bindings; + buffer_binding_map_iterator ++; + } + } + + if (buffer_binding_map_iterator == binding_iterator->buffer_updates.end() ) + { + anvil_assert(!(buffer_binding_map_iterator == binding_iterator->buffer_updates.end()) ); + + goto end; + } + + if (out_opt_buffer_ptr_ptr != nullptr) + { + *out_opt_buffer_ptr_ptr = buffer_binding_map_iterator->first; + } + + if (out_opt_buffer_memory_start_offset_ptr != nullptr) + { + *out_opt_buffer_memory_start_offset_ptr = buffer_bind.start_offset; + } + + if (out_opt_memory_block_owned_by_buffer_ptr != nullptr) + { + *out_opt_memory_block_owned_by_buffer_ptr = buffer_bind.memory_block_owned_by_target; + } + + if (out_opt_memory_block_ptr_ptr != nullptr) + { + *out_opt_memory_block_ptr_ptr = buffer_bind.memory_block_ptr; + } + + if (out_opt_memory_block_start_offset_ptr != nullptr) + { + *out_opt_memory_block_start_offset_ptr = buffer_bind.memory_block_start_offset; + } + + if (out_opt_size_ptr != nullptr) + { + *out_opt_size_ptr = buffer_bind.size; + } + + /* All done */ + result = true; +end: + return result; +} + +/** Please see header for specification */ +bool Anvil::SparseMemoryBindingUpdateInfo::get_image_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, + uint32_t in_n_update, + Anvil::Image** out_opt_image_ptr_ptr, + VkImageSubresource* out_opt_subresource_ptr, + VkOffset3D* out_opt_offset_ptr, + VkExtent3D* out_opt_extent_ptr, + VkSparseMemoryBindFlags* out_opt_flags_ptr, + Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, + VkDeviceSize* out_opt_memory_block_start_offset_ptr, + bool* out_opt_memory_block_owned_by_image_ptr) const +{ + decltype(m_bindings)::const_iterator binding_iterator; + ImageBindInfo image_bind; + ImageBindUpdateMap::const_iterator image_binding_map_iterator; + uint32_t n_current_update = 0; + bool result = false; + + if (m_bindings.size() <= in_bind_info_id) + { + anvil_assert(!(m_bindings.size() <= in_bind_info_id) ); + + goto end; + } + + binding_iterator = m_bindings.cbegin() + static_cast(in_bind_info_id); + image_binding_map_iterator = binding_iterator->image_updates.begin(); + + while (image_binding_map_iterator != binding_iterator->image_updates.end() ) + { + const uint32_t n_image_bindings = static_cast(image_binding_map_iterator->second.first.size() ); + + if (n_current_update + n_image_bindings > in_n_update) + { + image_bind = image_binding_map_iterator->second.first.at(in_n_update - n_current_update); + + break; + } + else + { + n_current_update += n_image_bindings; + image_binding_map_iterator ++; + } + } + + if (image_binding_map_iterator == binding_iterator->image_updates.end() ) + { + anvil_assert(!(image_binding_map_iterator == binding_iterator->image_updates.end()) ); + + goto end; + } + + if (out_opt_image_ptr_ptr != nullptr) + { + *out_opt_image_ptr_ptr = image_binding_map_iterator->first; + } + + if (out_opt_subresource_ptr != nullptr) + { + *out_opt_subresource_ptr = image_bind.subresource; + } + + if (out_opt_offset_ptr != nullptr) + { + *out_opt_offset_ptr = image_bind.offset; + } + + if (out_opt_extent_ptr != nullptr) + { + *out_opt_extent_ptr = image_bind.extent; + } + + if (out_opt_flags_ptr != nullptr) + { + *out_opt_flags_ptr = image_bind.flags; + } + + if (out_opt_memory_block_ptr_ptr != nullptr) + { + *out_opt_memory_block_ptr_ptr = image_bind.memory_block_ptr; + } + + if (out_opt_memory_block_start_offset_ptr != nullptr) + { + *out_opt_memory_block_start_offset_ptr = image_bind.memory_block_start_offset; + } + + if (out_opt_memory_block_owned_by_image_ptr != nullptr) + { + *out_opt_memory_block_owned_by_image_ptr = image_bind.memory_block_owned_by_image; + } + + /* All done */ + result = true; +end: + return result; +} + +/** Please see header for specification */ +bool Anvil::SparseMemoryBindingUpdateInfo::get_image_opaque_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, + uint32_t in_n_update, + Anvil::Image** out_opt_image_ptr_ptr, + VkDeviceSize* out_opt_resource_offset_ptr, + VkDeviceSize* out_opt_size_ptr, + VkSparseMemoryBindFlags* out_opt_flags_ptr, + Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, + VkDeviceSize* out_opt_memory_block_start_offset_ptr, + bool* out_opt_memory_block_owned_by_image_ptr) const +{ + decltype(m_bindings)::const_iterator binding_iterator; + GeneralBindInfo image_opaque_bind; + ImageOpaqueBindUpdateMap::const_iterator image_opaque_binding_map_iterator; + uint32_t n_current_update = 0; + bool result = false; + + if (m_bindings.size() <= in_bind_info_id) + { + anvil_assert(!(m_bindings.size() <= in_bind_info_id) ); + + goto end; + } + + binding_iterator = m_bindings.cbegin() + static_cast(in_bind_info_id); + image_opaque_binding_map_iterator = binding_iterator->image_opaque_updates.begin(); + + while (image_opaque_binding_map_iterator != binding_iterator->image_opaque_updates.end() ) + { + const uint32_t n_image_opaque_bindings = static_cast(image_opaque_binding_map_iterator->second.first.size() ); + + if (n_current_update + n_image_opaque_bindings > in_n_update) + { + image_opaque_bind = image_opaque_binding_map_iterator->second.first.at(in_n_update - n_current_update); + + break; + } + else + { + n_current_update += n_image_opaque_bindings; + image_opaque_binding_map_iterator ++; + } + } + + if (image_opaque_binding_map_iterator == binding_iterator->image_opaque_updates.end() ) + { + anvil_assert(!(image_opaque_binding_map_iterator == binding_iterator->image_opaque_updates.end()) ); + + goto end; + } + + if (out_opt_image_ptr_ptr != nullptr) + { + *out_opt_image_ptr_ptr = image_opaque_binding_map_iterator->first; + } + + if (out_opt_resource_offset_ptr != nullptr) + { + *out_opt_resource_offset_ptr = image_opaque_bind.start_offset; + } + + if (out_opt_size_ptr != nullptr) + { + *out_opt_size_ptr = image_opaque_bind.size; + } + + if (out_opt_flags_ptr != nullptr) + { + *out_opt_flags_ptr = image_opaque_bind.flags; + } + + if (out_opt_memory_block_ptr_ptr != nullptr) + { + *out_opt_memory_block_ptr_ptr = image_opaque_bind.memory_block_ptr; + } + + if (out_opt_memory_block_start_offset_ptr != nullptr) + { + *out_opt_memory_block_start_offset_ptr = image_opaque_bind.memory_block_start_offset; + } + + if (out_opt_memory_block_owned_by_image_ptr != nullptr) + { + *out_opt_memory_block_owned_by_image_ptr = image_opaque_bind.memory_block_owned_by_target; + } + + /* All done */ + result = true; +end: + return result; +} diff --git a/src/misc/types_struct.cpp b/src/misc/types_struct.cpp new file mode 100644 index 00000000..4cb60cab --- /dev/null +++ b/src/misc/types_struct.cpp @@ -0,0 +1,2356 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#include "misc/types.h" +#include "misc/descriptor_set_create_info.h" +#include "wrappers/buffer.h" +#include "wrappers/descriptor_set_layout.h" +#include "wrappers/image.h" +#include +#include + +#define BOOL_TO_VK_BOOL32(x) ((x) ? VK_TRUE : VK_FALSE); +#define VK_BOOL32_TO_BOOL(x) ((x == VK_FALSE) ? false : true) + +#ifdef max + #undef max +#endif + +Anvil::AMDShaderCoreProperties::AMDShaderCoreProperties() +{ + memset(this, + 0, + sizeof(*this)); +} + +Anvil::AMDShaderCoreProperties::AMDShaderCoreProperties(const VkPhysicalDeviceShaderCorePropertiesAMD& in_props) +{ + compute_units_per_shader_array = in_props.computeUnitsPerShaderArray; + max_sgpr_allocation = in_props.maxSgprAllocation; + max_vgpr_allocation = in_props.maxVgprAllocation; + min_sgpr_allocation = in_props.minSgprAllocation; + min_vgpr_allocation = in_props.minVgprAllocation; + shader_arrays_per_engine_count = in_props.shaderArraysPerEngineCount; + shader_engine_count = in_props.shaderEngineCount; + sgpr_allocation_granularity = in_props.sgprAllocationGranularity; + sgprs_per_simd = in_props.sgprsPerSimd; + simd_per_compute_unit = in_props.simdPerComputeUnit; + vgpr_allocation_granularity = in_props.vgprAllocationGranularity; + vgprs_per_simd = in_props.vgprsPerSimd; + wavefronts_per_simd = in_props.wavefrontsPerSimd; + wavefront_size = in_props.wavefrontSize; +} + +bool Anvil::AMDShaderCoreProperties::operator==(const Anvil::AMDShaderCoreProperties& in_props) const +{ + return (compute_units_per_shader_array == in_props.compute_units_per_shader_array && + max_sgpr_allocation == in_props.max_sgpr_allocation && + max_vgpr_allocation == in_props.max_vgpr_allocation && + min_sgpr_allocation == in_props.min_sgpr_allocation && + min_vgpr_allocation == in_props.min_vgpr_allocation && + sgprs_per_simd == in_props.sgprs_per_simd && + sgpr_allocation_granularity == in_props.sgpr_allocation_granularity && + shader_arrays_per_engine_count == in_props.shader_arrays_per_engine_count && + shader_engine_count == in_props.shader_engine_count && + simd_per_compute_unit == in_props.simd_per_compute_unit && + wavefronts_per_simd == in_props.wavefronts_per_simd && + wavefront_size == in_props.wavefront_size && + vgpr_allocation_granularity == in_props.vgpr_allocation_granularity && + vgprs_per_simd == in_props.vgprs_per_simd); +} + +/** Please see header for specification */ +Anvil::BufferBarrier::BufferBarrier(const BufferBarrier& in) +{ + buffer = in.buffer; + buffer_barrier_vk = in.buffer_barrier_vk; + buffer_ptr = in.buffer_ptr; + dst_access_mask = in.dst_access_mask; + dst_queue_family_index = in.dst_queue_family_index; + offset = in.offset; + size = in.size; + src_access_mask = in.src_access_mask; + src_queue_family_index = in.src_queue_family_index; +} + +/** Please see header for specification */ +Anvil::BufferBarrier::BufferBarrier(VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + uint32_t in_src_queue_family_index, + uint32_t in_dst_queue_family_index, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkDeviceSize in_size) +{ + buffer = in_buffer_ptr->get_buffer(); + buffer_ptr = in_buffer_ptr; + dst_access_mask = static_cast(in_destination_access_mask); + dst_queue_family_index = in_dst_queue_family_index; + offset = in_offset; + size = in_size; + src_access_mask = static_cast(in_source_access_mask); + src_queue_family_index = in_src_queue_family_index; + + buffer_barrier_vk.buffer = in_buffer_ptr->get_buffer(); + buffer_barrier_vk.dstAccessMask = in_destination_access_mask; + buffer_barrier_vk.dstQueueFamilyIndex = in_dst_queue_family_index; + buffer_barrier_vk.offset = in_offset; + buffer_barrier_vk.pNext = nullptr; + buffer_barrier_vk.size = in_size; + buffer_barrier_vk.srcAccessMask = in_source_access_mask, + buffer_barrier_vk.srcQueueFamilyIndex = in_src_queue_family_index; + buffer_barrier_vk.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER; + + /* NOTE: For an image barrier to work correctly, the underlying subresource range must be assigned memory. + * Query for a memory block in order to force any listening memory allocators to bake */ + auto memory_block_ptr = buffer_ptr->get_memory_block(0 /* in_n_memory_block */); + + ANVIL_REDUNDANT_VARIABLE(memory_block_ptr); +} + +/** Please see header for specification */ +Anvil::BufferBarrier::~BufferBarrier() +{ + /* Stub */ +} + +Anvil::BufferMemoryBindingUpdate::BufferMemoryBindingUpdate() +{ + buffer_ptr = nullptr; + memory_block_owned_by_buffer = false; + memory_block_ptr = nullptr; +} + +Anvil::DescriptorSetAllocation::DescriptorSetAllocation(const Anvil::DescriptorSetLayout* in_ds_layout_ptr) +{ + anvil_assert( in_ds_layout_ptr != nullptr); + anvil_assert(!in_ds_layout_ptr->get_create_info()->contains_variable_descriptor_count_binding() ); + + ds_layout_ptr = in_ds_layout_ptr; + n_variable_descriptor_bindings = UINT32_MAX; +} + +/* Constructor. + * + * Use if you need to allocate a descriptor set using a descriptor set layout which + * CONTAINS a variable count descriptor binding. + */ +Anvil::DescriptorSetAllocation::DescriptorSetAllocation(const Anvil::DescriptorSetLayout* in_ds_layout_ptr, + const uint32_t& in_n_variable_descriptor_bindings) +{ + anvil_assert(in_ds_layout_ptr != nullptr); + + uint32_t binding_array_size = 0; + uint32_t binding_index = UINT32_MAX; + const auto ds_create_info_ptr = in_ds_layout_ptr->get_create_info(); + + ds_create_info_ptr->contains_variable_descriptor_count_binding(&binding_index); + anvil_assert(binding_index != UINT32_MAX); + + ds_create_info_ptr->get_binding_properties_by_binding_index(binding_index, + nullptr, /* out_opt_descriptor_type_ptr */ + &binding_array_size); + anvil_assert(in_n_variable_descriptor_bindings <= binding_array_size); + + ds_layout_ptr = in_ds_layout_ptr; + n_variable_descriptor_bindings = in_n_variable_descriptor_bindings; +} + +Anvil::DescriptorUpdateTemplateEntry::DescriptorUpdateTemplateEntry() + :descriptor_type (VK_DESCRIPTOR_TYPE_MAX_ENUM), + n_descriptors (UINT32_MAX), + n_destination_array_element(UINT32_MAX), + n_destination_binding (UINT32_MAX), + offset (SIZE_MAX), + stride (SIZE_MAX) +{ + /* Stub */ +} + +Anvil::DescriptorUpdateTemplateEntry::DescriptorUpdateTemplateEntry(const VkDescriptorType& in_descriptor_type, + const uint32_t& in_n_destination_array_element, + const uint32_t& in_n_destination_binding, + const uint32_t& in_n_descriptors, + const size_t& in_offset, + const size_t& in_stride) + :descriptor_type (in_descriptor_type), + n_descriptors (in_n_descriptors), + n_destination_array_element(in_n_destination_array_element), + n_destination_binding (in_n_destination_binding), + offset (in_offset), + stride (in_stride) +{ + /* Stub */ +} + +bool Anvil::DescriptorUpdateTemplateEntry::operator==(const Anvil::DescriptorUpdateTemplateEntry& in_entry) const +{ + return (in_entry.descriptor_type == descriptor_type) && + (in_entry.n_descriptors == n_descriptors) && + (in_entry.n_destination_array_element == n_destination_array_element) && + (in_entry.n_destination_binding == n_destination_binding) && + (in_entry.offset == offset) && + (in_entry.stride == stride); +} + +bool Anvil::DescriptorUpdateTemplateEntry::operator<(const Anvil::DescriptorUpdateTemplateEntry& in_entry) const +{ + if (in_entry.descriptor_type < descriptor_type) + { + return true; + } + else + if (in_entry.descriptor_type > descriptor_type) + { + return false; + } + + if (in_entry.n_descriptors < n_descriptors) + { + return true; + } + else + if (in_entry.n_descriptors > n_descriptors) + { + return false; + } + + if (in_entry.n_destination_array_element < n_destination_array_element) + { + return true; + } + else + if (in_entry.n_destination_array_element > n_destination_array_element) + { + return false; + } + + if (in_entry.n_destination_binding < n_destination_binding) + { + return true; + } + else + if (in_entry.n_destination_binding > n_destination_binding) + { + return false; + } + + if (in_entry.offset < offset) + { + return true; + } + else + if (in_entry.offset > offset) + { + return false; + } + + if (in_entry.stride < stride) + { + return true; + } + + return false; +} + +/** Please see header for specification */ +VkDescriptorUpdateTemplateEntryKHR Anvil::DescriptorUpdateTemplateEntry::get_vk_descriptor_update_template_entry_khr() const +{ + VkDescriptorUpdateTemplateEntryKHR result; + + result.descriptorCount = n_descriptors; + result.descriptorType = descriptor_type; + result.dstArrayElement = n_destination_array_element; + result.dstBinding = n_destination_binding; + result.offset = offset; + result.stride = stride; + + return result; +} + +Anvil::ExtensionAMDDrawIndirectCountEntrypoints::ExtensionAMDDrawIndirectCountEntrypoints() +{ + vkCmdDrawIndexedIndirectCountAMD = nullptr; + vkCmdDrawIndirectCountAMD = nullptr; +} + +Anvil::ExtensionAMDShaderInfoEntrypoints::ExtensionAMDShaderInfoEntrypoints() +{ + vkGetShaderInfoAMD = nullptr; +} + +Anvil::ExtensionEXTDebugMarkerEntrypoints::ExtensionEXTDebugMarkerEntrypoints() +{ + vkCmdDebugMarkerBeginEXT = nullptr; + vkCmdDebugMarkerEndEXT = nullptr; + vkCmdDebugMarkerInsertEXT = nullptr; + vkDebugMarkerSetObjectNameEXT = nullptr; + vkDebugMarkerSetObjectTagEXT = nullptr; +} + +Anvil::ExtensionEXTDebugReportEntrypoints::ExtensionEXTDebugReportEntrypoints() +{ + vkCreateDebugReportCallbackEXT = nullptr; + vkDestroyDebugReportCallbackEXT = nullptr; +} + +Anvil::ExtensionKHRBindMemory2Entrypoints::ExtensionKHRBindMemory2Entrypoints() +{ + vkBindBufferMemory2KHR = nullptr; + vkBindImageMemory2KHR = nullptr; +} + +Anvil::ExtensionKHRDescriptorUpdateTemplateEntrypoints::ExtensionKHRDescriptorUpdateTemplateEntrypoints() +{ + vkCreateDescriptorUpdateTemplateKHR = nullptr; + vkDestroyDescriptorUpdateTemplateKHR = nullptr; + vkUpdateDescriptorSetWithTemplateKHR = nullptr; +} + +Anvil::ExtensionKHRDeviceGroupCreationEntrypoints::ExtensionKHRDeviceGroupCreationEntrypoints() +{ + vkEnumeratePhysicalDeviceGroupsKHR = nullptr; +} + +Anvil::ExtensionKHRMaintenance1Entrypoints::ExtensionKHRMaintenance1Entrypoints() +{ + vkTrimCommandPoolKHR = nullptr; +} + +Anvil::ExtensionKHRMaintenance3Entrypoints::ExtensionKHRMaintenance3Entrypoints() +{ + vkGetDescriptorSetLayoutSupportKHR = nullptr; +} + +Anvil::ExtensionKHRSurfaceEntrypoints::ExtensionKHRSurfaceEntrypoints() +{ + vkDestroySurfaceKHR = nullptr; + vkGetPhysicalDeviceSurfaceCapabilitiesKHR = nullptr; + vkGetPhysicalDeviceSurfaceFormatsKHR = nullptr; + vkGetPhysicalDeviceSurfacePresentModesKHR = nullptr; + vkGetPhysicalDeviceSurfaceSupportKHR = nullptr; +} + +Anvil::ExtensionKHRSwapchainEntrypoints::ExtensionKHRSwapchainEntrypoints() +{ + vkAcquireNextImageKHR = nullptr; + vkCreateSwapchainKHR = nullptr; + vkDestroySwapchainKHR = nullptr; + vkGetSwapchainImagesKHR = nullptr; + vkQueuePresentKHR = nullptr; +} + +#ifdef _WIN32 + #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) + Anvil::ExtensionKHRWin32SurfaceEntrypoints::ExtensionKHRWin32SurfaceEntrypoints() + { + vkCreateWin32SurfaceKHR = nullptr; + vkGetPhysicalDeviceWin32PresentationSupportKHR = nullptr; + } + #endif +#else + #if defined(ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT) + Anvil::ExtensionKHRXcbSurfaceEntrypoints::ExtensionKHRXcbSurfaceEntrypoints() + { + vkCreateXcbSurfaceKHR = nullptr; + } + #endif +#endif + +Anvil::ExtensionKHRGetPhysicalDeviceProperties2::ExtensionKHRGetPhysicalDeviceProperties2() +{ + vkGetPhysicalDeviceFeatures2KHR = nullptr; + vkGetPhysicalDeviceFormatProperties2KHR = nullptr; + vkGetPhysicalDeviceImageFormatProperties2KHR = nullptr; + vkGetPhysicalDeviceMemoryProperties2KHR = nullptr; + vkGetPhysicalDeviceProperties2KHR = nullptr; + vkGetPhysicalDeviceQueueFamilyProperties2KHR = nullptr; + vkGetPhysicalDeviceSparseImageFormatProperties2KHR = nullptr; +} + +Anvil::EXTDescriptorIndexingFeatures::EXTDescriptorIndexingFeatures() + :descriptor_binding_partially_bound (false), + descriptor_binding_sampled_image_update_after_bind (false), + descriptor_binding_storage_buffer_update_after_bind (false), + descriptor_binding_storage_image_update_after_bind (false), + descriptor_binding_storage_texel_buffer_update_after_bind(false), + descriptor_binding_uniform_buffer_update_after_bind (false), + descriptor_binding_uniform_texel_buffer_update_after_bind(false), + descriptor_binding_update_unused_while_pending (false), + descriptor_binding_variable_descriptor_count (false), + runtime_descriptor_array (false), + shader_input_attachment_array_dynamic_indexing (false), + shader_input_attachment_array_non_uniform_indexing (false), + shader_sampled_image_array_non_uniform_indexing (false), + shader_storage_buffer_array_non_uniform_indexing (false), + shader_storage_image_array_non_uniform_indexing (false), + shader_storage_texel_buffer_array_dynamic_indexing (false), + shader_storage_texel_buffer_array_non_uniform_indexing (false), + shader_uniform_buffer_array_non_uniform_indexing (false), + shader_uniform_texel_buffer_array_dynamic_indexing (false), + shader_uniform_texel_buffer_array_non_uniform_indexing (false) +{ + /* Stub */ +} + +Anvil::EXTDescriptorIndexingFeatures::EXTDescriptorIndexingFeatures(const VkPhysicalDeviceDescriptorIndexingFeaturesEXT& in_features) + :descriptor_binding_partially_bound (VK_BOOL32_TO_BOOL(in_features.descriptorBindingPartiallyBound) ), + descriptor_binding_sampled_image_update_after_bind (VK_BOOL32_TO_BOOL(in_features.descriptorBindingSampledImageUpdateAfterBind) ), + descriptor_binding_storage_buffer_update_after_bind (VK_BOOL32_TO_BOOL(in_features.descriptorBindingStorageBufferUpdateAfterBind) ), + descriptor_binding_storage_image_update_after_bind (VK_BOOL32_TO_BOOL(in_features.descriptorBindingStorageImageUpdateAfterBind) ), + descriptor_binding_storage_texel_buffer_update_after_bind(VK_BOOL32_TO_BOOL(in_features.descriptorBindingStorageTexelBufferUpdateAfterBind) ), + descriptor_binding_uniform_buffer_update_after_bind (VK_BOOL32_TO_BOOL(in_features.descriptorBindingUniformBufferUpdateAfterBind) ), + descriptor_binding_uniform_texel_buffer_update_after_bind(VK_BOOL32_TO_BOOL(in_features.descriptorBindingUniformTexelBufferUpdateAfterBind) ), + descriptor_binding_update_unused_while_pending (VK_BOOL32_TO_BOOL(in_features.descriptorBindingUpdateUnusedWhilePending) ), + descriptor_binding_variable_descriptor_count (VK_BOOL32_TO_BOOL(in_features.descriptorBindingVariableDescriptorCount) ), + runtime_descriptor_array (VK_BOOL32_TO_BOOL(in_features.runtimeDescriptorArray) ), + shader_input_attachment_array_dynamic_indexing (VK_BOOL32_TO_BOOL(in_features.shaderInputAttachmentArrayDynamicIndexing) ), + shader_input_attachment_array_non_uniform_indexing (VK_BOOL32_TO_BOOL(in_features.shaderInputAttachmentArrayNonUniformIndexing) ), + shader_sampled_image_array_non_uniform_indexing (VK_BOOL32_TO_BOOL(in_features.shaderSampledImageArrayNonUniformIndexing) ), + shader_storage_buffer_array_non_uniform_indexing (VK_BOOL32_TO_BOOL(in_features.shaderStorageBufferArrayNonUniformIndexing) ), + shader_storage_image_array_non_uniform_indexing (VK_BOOL32_TO_BOOL(in_features.shaderStorageImageArrayNonUniformIndexing) ), + shader_storage_texel_buffer_array_dynamic_indexing (VK_BOOL32_TO_BOOL(in_features.shaderStorageTexelBufferArrayDynamicIndexing) ), + shader_storage_texel_buffer_array_non_uniform_indexing (VK_BOOL32_TO_BOOL(in_features.shaderStorageTexelBufferArrayNonUniformIndexing) ), + shader_uniform_buffer_array_non_uniform_indexing (VK_BOOL32_TO_BOOL(in_features.shaderUniformBufferArrayNonUniformIndexing) ), + shader_uniform_texel_buffer_array_dynamic_indexing (VK_BOOL32_TO_BOOL(in_features.shaderUniformTexelBufferArrayDynamicIndexing) ), + shader_uniform_texel_buffer_array_non_uniform_indexing (VK_BOOL32_TO_BOOL(in_features.shaderUniformTexelBufferArrayNonUniformIndexing) ) +{ + /* Stub */ +} + +bool Anvil::EXTDescriptorIndexingFeatures::operator==(const EXTDescriptorIndexingFeatures& in_features) const +{ + return (descriptor_binding_partially_bound == in_features.descriptor_binding_partially_bound && + descriptor_binding_sampled_image_update_after_bind == in_features.descriptor_binding_sampled_image_update_after_bind && + descriptor_binding_storage_buffer_update_after_bind == in_features.descriptor_binding_storage_buffer_update_after_bind && + descriptor_binding_storage_image_update_after_bind == in_features.descriptor_binding_storage_image_update_after_bind && + descriptor_binding_storage_texel_buffer_update_after_bind == in_features.descriptor_binding_storage_texel_buffer_update_after_bind && + descriptor_binding_uniform_buffer_update_after_bind == in_features.descriptor_binding_uniform_buffer_update_after_bind && + descriptor_binding_uniform_texel_buffer_update_after_bind == in_features.descriptor_binding_uniform_texel_buffer_update_after_bind && + descriptor_binding_update_unused_while_pending == in_features.descriptor_binding_update_unused_while_pending && + descriptor_binding_variable_descriptor_count == in_features.descriptor_binding_variable_descriptor_count && + runtime_descriptor_array == in_features.runtime_descriptor_array && + shader_input_attachment_array_dynamic_indexing == in_features.shader_input_attachment_array_dynamic_indexing && + shader_input_attachment_array_non_uniform_indexing == in_features.shader_input_attachment_array_non_uniform_indexing && + shader_sampled_image_array_non_uniform_indexing == in_features.shader_sampled_image_array_non_uniform_indexing && + shader_storage_buffer_array_non_uniform_indexing == in_features.shader_storage_buffer_array_non_uniform_indexing && + shader_storage_image_array_non_uniform_indexing == in_features.shader_storage_image_array_non_uniform_indexing && + shader_storage_texel_buffer_array_dynamic_indexing == in_features.shader_storage_texel_buffer_array_dynamic_indexing && + shader_storage_texel_buffer_array_non_uniform_indexing == in_features.shader_storage_texel_buffer_array_non_uniform_indexing && + shader_uniform_buffer_array_non_uniform_indexing == in_features.shader_uniform_buffer_array_non_uniform_indexing && + shader_uniform_texel_buffer_array_dynamic_indexing == in_features.shader_uniform_texel_buffer_array_dynamic_indexing && + shader_uniform_texel_buffer_array_non_uniform_indexing == in_features.shader_uniform_texel_buffer_array_non_uniform_indexing); +} + +VkPhysicalDeviceDescriptorIndexingFeaturesEXT Anvil::EXTDescriptorIndexingFeatures::get_vk_physical_device_descriptor_indexing_features() const +{ + VkPhysicalDeviceDescriptorIndexingFeaturesEXT result; + + result.descriptorBindingPartiallyBound = BOOL_TO_VK_BOOL32(descriptor_binding_partially_bound); + result.descriptorBindingSampledImageUpdateAfterBind = BOOL_TO_VK_BOOL32(descriptor_binding_sampled_image_update_after_bind); + result.descriptorBindingStorageBufferUpdateAfterBind = BOOL_TO_VK_BOOL32(descriptor_binding_storage_buffer_update_after_bind); + result.descriptorBindingStorageImageUpdateAfterBind = BOOL_TO_VK_BOOL32(descriptor_binding_storage_image_update_after_bind); + result.descriptorBindingStorageTexelBufferUpdateAfterBind = BOOL_TO_VK_BOOL32(descriptor_binding_storage_texel_buffer_update_after_bind); + result.descriptorBindingUniformBufferUpdateAfterBind = BOOL_TO_VK_BOOL32(descriptor_binding_uniform_buffer_update_after_bind); + result.descriptorBindingUniformTexelBufferUpdateAfterBind = BOOL_TO_VK_BOOL32(descriptor_binding_uniform_texel_buffer_update_after_bind); + result.descriptorBindingUpdateUnusedWhilePending = BOOL_TO_VK_BOOL32(descriptor_binding_update_unused_while_pending); + result.descriptorBindingVariableDescriptorCount = BOOL_TO_VK_BOOL32(descriptor_binding_variable_descriptor_count); + result.pNext = nullptr; + result.runtimeDescriptorArray = BOOL_TO_VK_BOOL32(runtime_descriptor_array); + result.shaderInputAttachmentArrayDynamicIndexing = BOOL_TO_VK_BOOL32(shader_input_attachment_array_dynamic_indexing); + result.shaderInputAttachmentArrayNonUniformIndexing = BOOL_TO_VK_BOOL32(shader_input_attachment_array_non_uniform_indexing); + result.shaderSampledImageArrayNonUniformIndexing = BOOL_TO_VK_BOOL32(shader_sampled_image_array_non_uniform_indexing); + result.shaderStorageBufferArrayNonUniformIndexing = BOOL_TO_VK_BOOL32(shader_storage_buffer_array_non_uniform_indexing); + result.shaderStorageImageArrayNonUniformIndexing = BOOL_TO_VK_BOOL32(shader_storage_image_array_non_uniform_indexing); + result.shaderStorageTexelBufferArrayDynamicIndexing = BOOL_TO_VK_BOOL32(shader_storage_texel_buffer_array_dynamic_indexing); + result.shaderStorageTexelBufferArrayNonUniformIndexing = BOOL_TO_VK_BOOL32(shader_storage_texel_buffer_array_non_uniform_indexing); + result.shaderUniformBufferArrayNonUniformIndexing = BOOL_TO_VK_BOOL32(shader_uniform_buffer_array_non_uniform_indexing); + result.shaderUniformTexelBufferArrayDynamicIndexing = BOOL_TO_VK_BOOL32(shader_uniform_texel_buffer_array_dynamic_indexing); + result.shaderUniformTexelBufferArrayNonUniformIndexing = BOOL_TO_VK_BOOL32(shader_uniform_texel_buffer_array_non_uniform_indexing); + result.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT); + + return result; +} + +Anvil::EXTDescriptorIndexingProperties::EXTDescriptorIndexingProperties() + :max_descriptor_set_update_after_bind_input_attachments (UINT32_MAX), + max_descriptor_set_update_after_bind_sampled_images (UINT32_MAX), + max_descriptor_set_update_after_bind_samplers (UINT32_MAX), + max_descriptor_set_update_after_bind_storage_buffers (UINT32_MAX), + max_descriptor_set_update_after_bind_storage_buffers_dynamic(UINT32_MAX), + max_descriptor_set_update_after_bind_storage_images (UINT32_MAX), + max_descriptor_set_update_after_bind_uniform_buffers (UINT32_MAX), + max_descriptor_set_update_after_bind_uniform_buffers_dynamic(UINT32_MAX), + max_per_stage_descriptor_update_after_bind_input_attachments(UINT32_MAX), + max_per_stage_descriptor_update_after_bind_sampled_images (UINT32_MAX), + max_per_stage_descriptor_update_after_bind_samplers (UINT32_MAX), + max_per_stage_descriptor_update_after_bind_storage_buffers (UINT32_MAX), + max_per_stage_descriptor_update_after_bind_storage_images (UINT32_MAX), + max_per_stage_descriptor_update_after_bind_uniform_buffers (UINT32_MAX), + max_per_stage_update_after_bind_resources (UINT32_MAX), + max_update_after_bind_descriptors_in_all_pools (UINT32_MAX), + shader_input_attachment_array_non_uniform_indexing_native (false), + shader_sampled_image_array_non_uniform_indexing_native (false), + shader_storage_buffer_array_non_uniform_indexing_native (false), + shader_storage_image_array_non_uniform_indexing_native (false), + shader_uniform_buffer_array_non_uniform_indexing_native (false) +{ + /* Stub */ +} + +Anvil::EXTDescriptorIndexingProperties::EXTDescriptorIndexingProperties(const VkPhysicalDeviceDescriptorIndexingPropertiesEXT& in_props) + :max_descriptor_set_update_after_bind_input_attachments (in_props.maxDescriptorSetUpdateAfterBindInputAttachments), + max_descriptor_set_update_after_bind_sampled_images (in_props.maxDescriptorSetUpdateAfterBindSampledImages), + max_descriptor_set_update_after_bind_samplers (in_props.maxDescriptorSetUpdateAfterBindSamplers), + max_descriptor_set_update_after_bind_storage_buffers (in_props.maxDescriptorSetUpdateAfterBindStorageBuffers), + max_descriptor_set_update_after_bind_storage_buffers_dynamic(in_props.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic), + max_descriptor_set_update_after_bind_storage_images (in_props.maxDescriptorSetUpdateAfterBindStorageImages), + max_descriptor_set_update_after_bind_uniform_buffers (in_props.maxDescriptorSetUpdateAfterBindUniformBuffers), + max_descriptor_set_update_after_bind_uniform_buffers_dynamic(in_props.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic), + max_per_stage_descriptor_update_after_bind_input_attachments(in_props.maxPerStageDescriptorUpdateAfterBindInputAttachments), + max_per_stage_descriptor_update_after_bind_sampled_images (in_props.maxPerStageDescriptorUpdateAfterBindSampledImages), + max_per_stage_descriptor_update_after_bind_samplers (in_props.maxPerStageDescriptorUpdateAfterBindSamplers), + max_per_stage_descriptor_update_after_bind_storage_buffers (in_props.maxPerStageDescriptorUpdateAfterBindStorageBuffers), + max_per_stage_descriptor_update_after_bind_storage_images (in_props.maxPerStageDescriptorUpdateAfterBindStorageImages), + max_per_stage_descriptor_update_after_bind_uniform_buffers (in_props.maxPerStageDescriptorUpdateAfterBindUniformBuffers), + max_per_stage_update_after_bind_resources (in_props.maxPerStageUpdateAfterBindResources), + max_update_after_bind_descriptors_in_all_pools (in_props.maxUpdateAfterBindDescriptorsInAllPools), + shader_input_attachment_array_non_uniform_indexing_native (VK_BOOL32_TO_BOOL(in_props.shaderInputAttachmentArrayNonUniformIndexingNative) ), + shader_sampled_image_array_non_uniform_indexing_native (VK_BOOL32_TO_BOOL(in_props.shaderSampledImageArrayNonUniformIndexingNative) ), + shader_storage_buffer_array_non_uniform_indexing_native (VK_BOOL32_TO_BOOL(in_props.shaderStorageBufferArrayNonUniformIndexingNative) ), + shader_storage_image_array_non_uniform_indexing_native (VK_BOOL32_TO_BOOL(in_props.shaderStorageImageArrayNonUniformIndexingNative) ), + shader_uniform_buffer_array_non_uniform_indexing_native (VK_BOOL32_TO_BOOL(in_props.shaderUniformBufferArrayNonUniformIndexingNative) ) +{ + /* Stub */ +} + +bool Anvil::EXTDescriptorIndexingProperties::operator==(const EXTDescriptorIndexingProperties& in_props) const +{ + return (max_descriptor_set_update_after_bind_input_attachments == in_props.max_descriptor_set_update_after_bind_input_attachments && + max_descriptor_set_update_after_bind_sampled_images == in_props.max_descriptor_set_update_after_bind_sampled_images && + max_descriptor_set_update_after_bind_samplers == in_props.max_descriptor_set_update_after_bind_samplers && + max_descriptor_set_update_after_bind_storage_buffers == in_props.max_descriptor_set_update_after_bind_storage_buffers && + max_descriptor_set_update_after_bind_storage_buffers_dynamic == in_props.max_descriptor_set_update_after_bind_storage_buffers_dynamic && + max_descriptor_set_update_after_bind_storage_images == in_props.max_descriptor_set_update_after_bind_storage_images && + max_descriptor_set_update_after_bind_uniform_buffers == in_props.max_descriptor_set_update_after_bind_uniform_buffers && + max_descriptor_set_update_after_bind_uniform_buffers_dynamic == in_props.max_descriptor_set_update_after_bind_uniform_buffers_dynamic && + max_per_stage_descriptor_update_after_bind_input_attachments == in_props.max_per_stage_descriptor_update_after_bind_input_attachments && + max_per_stage_descriptor_update_after_bind_sampled_images == in_props.max_per_stage_descriptor_update_after_bind_sampled_images && + max_per_stage_descriptor_update_after_bind_samplers == in_props.max_per_stage_descriptor_update_after_bind_samplers && + max_per_stage_descriptor_update_after_bind_storage_buffers == in_props.max_per_stage_descriptor_update_after_bind_storage_buffers && + max_per_stage_descriptor_update_after_bind_storage_images == in_props.max_per_stage_descriptor_update_after_bind_storage_images && + max_per_stage_descriptor_update_after_bind_uniform_buffers == in_props.max_per_stage_descriptor_update_after_bind_uniform_buffers && + max_per_stage_update_after_bind_resources == in_props.max_per_stage_update_after_bind_resources && + max_update_after_bind_descriptors_in_all_pools == in_props.max_update_after_bind_descriptors_in_all_pools && + shader_input_attachment_array_non_uniform_indexing_native == in_props.shader_input_attachment_array_non_uniform_indexing_native && + shader_sampled_image_array_non_uniform_indexing_native == in_props.shader_sampled_image_array_non_uniform_indexing_native && + shader_storage_buffer_array_non_uniform_indexing_native == in_props.shader_storage_buffer_array_non_uniform_indexing_native && + shader_storage_image_array_non_uniform_indexing_native == in_props.shader_storage_image_array_non_uniform_indexing_native && + shader_uniform_buffer_array_non_uniform_indexing_native == in_props.shader_uniform_buffer_array_non_uniform_indexing_native); +} + +Anvil::FormatProperties::FormatProperties() +{ + memset(this, + 0, + sizeof(*this) ); +} + +Anvil::FormatProperties::FormatProperties(const VkFormatProperties& in_format_props) +{ + buffer_capabilities = in_format_props.bufferFeatures; + linear_tiling_capabilities = in_format_props.linearTilingFeatures; + optimal_tiling_capabilities = in_format_props.optimalTilingFeatures; + supports_amd_texture_gather_bias_lod = false; +} + +/** Please see header for specification */ +bool Anvil::operator==(const Anvil::FormatProperties& in1, + const Anvil::FormatProperties& in2) +{ + return memcmp(&in1, + &in2, + sizeof(Anvil::FormatProperties) ) == 0; +} + +/** Please see header for specification */ +Anvil::ImageBarrier::ImageBarrier(const ImageBarrier& in) +{ + dst_access_mask = in.dst_access_mask; + dst_queue_family_index = in.dst_queue_family_index; + image = in.image; + image_barrier_vk = in.image_barrier_vk; + image_ptr = in.image_ptr; + new_layout = in.new_layout; + old_layout = in.old_layout; + src_access_mask = in.src_access_mask; + src_queue_family_index = in.src_queue_family_index; + subresource_range = in.subresource_range; +} + +/** Please see header for specification */ +Anvil::ImageBarrier::ImageBarrier(VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region_barrier, + VkImageLayout in_old_layout, + VkImageLayout in_new_layout, + uint32_t in_src_queue_family_index, + uint32_t in_dst_queue_family_index, + Anvil::Image* in_image_ptr, + VkImageSubresourceRange in_image_subresource_range) +{ + by_region = in_by_region_barrier; + dst_access_mask = static_cast(in_destination_access_mask); + dst_queue_family_index = in_dst_queue_family_index; + image = (in_image_ptr != VK_NULL_HANDLE) ? in_image_ptr->get_image() + : VK_NULL_HANDLE; + image_ptr = in_image_ptr; + new_layout = in_new_layout; + old_layout = in_old_layout; + src_access_mask = static_cast(in_source_access_mask); + src_queue_family_index = in_src_queue_family_index; + subresource_range = in_image_subresource_range; + + image_barrier_vk.dstAccessMask = in_destination_access_mask; + image_barrier_vk.dstQueueFamilyIndex = in_dst_queue_family_index; + image_barrier_vk.image = (in_image_ptr != nullptr) ? in_image_ptr->get_image() + : VK_NULL_HANDLE; + image_barrier_vk.newLayout = in_new_layout; + image_barrier_vk.oldLayout = in_old_layout; + image_barrier_vk.pNext = nullptr; + image_barrier_vk.srcAccessMask = in_source_access_mask; + image_barrier_vk.srcQueueFamilyIndex = in_src_queue_family_index; + image_barrier_vk.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; + image_barrier_vk.subresourceRange = in_image_subresource_range; + + /* NOTE: For an image barrier to work correctly, the underlying subresource range must be assigned memory. + * Query for a memory block in order to force any listening memory allocators to bake */ + auto memory_block_ptr = image_ptr->get_memory_block(); + + ANVIL_REDUNDANT_VARIABLE(memory_block_ptr); +} + +/** Please see header for specification */ +Anvil::ImageBarrier::~ImageBarrier() +{ + /* Stub */ +} + +Anvil::KHR16BitStorageFeatures::KHR16BitStorageFeatures() +{ + is_input_output_storage_supported = false; + is_push_constant_16_bit_storage_supported = false; + is_storage_buffer_16_bit_access_supported = false; + is_uniform_and_storage_buffer_16_bit_access_supported = false; +} + +Anvil::KHR16BitStorageFeatures::KHR16BitStorageFeatures(const VkPhysicalDevice16BitStorageFeaturesKHR& in_features) +{ + is_input_output_storage_supported = VK_BOOL32_TO_BOOL(in_features.storageInputOutput16); + is_push_constant_16_bit_storage_supported = VK_BOOL32_TO_BOOL(in_features.storagePushConstant16); + is_storage_buffer_16_bit_access_supported = VK_BOOL32_TO_BOOL(in_features.storageBuffer16BitAccess); + is_uniform_and_storage_buffer_16_bit_access_supported = VK_BOOL32_TO_BOOL(in_features.uniformAndStorageBuffer16BitAccess); +} + +bool Anvil::KHR16BitStorageFeatures::operator==(const KHR16BitStorageFeatures& in_features) const +{ + return (in_features.is_input_output_storage_supported == is_input_output_storage_supported && + in_features.is_push_constant_16_bit_storage_supported == is_push_constant_16_bit_storage_supported && + in_features.is_storage_buffer_16_bit_access_supported == is_storage_buffer_16_bit_access_supported && + in_features.is_uniform_and_storage_buffer_16_bit_access_supported == is_uniform_and_storage_buffer_16_bit_access_supported); +} + +VkPhysicalDevice16BitStorageFeaturesKHR Anvil::KHR16BitStorageFeatures::get_vk_physical_device_16_bit_storage_features() const +{ + VkPhysicalDevice16BitStorageFeaturesKHR result; + + result.pNext = nullptr; + result.storageBuffer16BitAccess = BOOL_TO_VK_BOOL32(is_storage_buffer_16_bit_access_supported); + result.storageInputOutput16 = BOOL_TO_VK_BOOL32(is_input_output_storage_supported); + result.storagePushConstant16 = BOOL_TO_VK_BOOL32(is_push_constant_16_bit_storage_supported); + result.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR; + result.uniformAndStorageBuffer16BitAccess = BOOL_TO_VK_BOOL32(is_uniform_and_storage_buffer_16_bit_access_supported); + + return result; + +} + +Anvil::KHRMaintenance3Properties::KHRMaintenance3Properties() + :max_memory_allocation_size(std::numeric_limits::max() ), + max_per_set_descriptors (UINT32_MAX) +{ + /* Stub */ +} + +Anvil::KHRMaintenance3Properties::KHRMaintenance3Properties(const VkPhysicalDeviceMaintenance3PropertiesKHR& in_props) + :max_memory_allocation_size(in_props.maxMemoryAllocationSize), + max_per_set_descriptors (in_props.maxPerSetDescriptors) +{ + /* Stub */ +} + +bool Anvil::KHRMaintenance3Properties::operator==(const Anvil::KHRMaintenance3Properties& in_props) const +{ + return (max_memory_allocation_size == in_props.max_memory_allocation_size && + max_per_set_descriptors == in_props.max_per_set_descriptors); +} + +Anvil::Layer::Layer(const std::string& in_layer_name) +{ + implementation_version = 0; + name = in_layer_name; + spec_version = 0; +} + +Anvil::Layer::Layer(const VkLayerProperties& in_layer_props) +{ + description = in_layer_props.description; + implementation_version = in_layer_props.implementationVersion; + name = in_layer_props.layerName; + spec_version = in_layer_props.specVersion; +} + +bool Anvil::Layer::operator==(const std::string& in_layer_name) const +{ + return name == in_layer_name; +} + +Anvil::MemoryBarrier::MemoryBarrier(VkAccessFlags in_destination_access_mask, + VkAccessFlags in_source_access_mask) +{ + destination_access_mask = static_cast(in_destination_access_mask); + source_access_mask = static_cast(in_source_access_mask); + + memory_barrier_vk.dstAccessMask = destination_access_mask; + memory_barrier_vk.pNext = nullptr; + memory_barrier_vk.srcAccessMask = source_access_mask; + memory_barrier_vk.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER; +} + +Anvil::MemoryHeap::MemoryHeap() +{ + flags = 0; + size = 0; +} + +/* Please see header for specification */ +bool Anvil::operator==(const MemoryProperties& in1, + const MemoryProperties& in2) +{ + bool result = (in1.types.size() == in2.types.size() ); + + if (result) + { + for (uint32_t n_type = 0; + n_type < static_cast(in1.types.size() ) && result; + ++n_type) + { + const auto& current_type_in1 = in1.types.at(n_type); + const auto& current_type_in2 = in2.types.at(n_type); + + result &= (current_type_in1 == current_type_in2); + } + } + + return result; +} + +Anvil::MemoryProperties::MemoryProperties() +{ + heaps = nullptr; + n_heaps = 0; +} + +/** Destructor */ +Anvil::MemoryProperties::~MemoryProperties() +{ + if (heaps != nullptr) + { + delete [] heaps; + + heaps = nullptr; + } +} + +/* Please see header for specification */ +void Anvil::MemoryProperties::init(const VkPhysicalDeviceMemoryProperties& in_mem_properties) +{ + n_heaps = in_mem_properties.memoryHeapCount; + + heaps = new Anvil::MemoryHeap[n_heaps]; + anvil_assert(heaps != nullptr); + + for (unsigned int n_heap = 0; + n_heap < in_mem_properties.memoryHeapCount; + ++n_heap) + { + heaps[n_heap].flags = static_cast(in_mem_properties.memoryHeaps[n_heap].flags); + heaps[n_heap].size = in_mem_properties.memoryHeaps[n_heap].size; + } + + types.reserve(in_mem_properties.memoryTypeCount); + + for (unsigned int n_type = 0; + n_type < in_mem_properties.memoryTypeCount; + ++n_type) + { + types.push_back(MemoryType(in_mem_properties.memoryTypes[n_type], + this) ); + } +} + +/** Please see header for specification */ +bool Anvil::operator==(const MemoryHeap& in1, + const MemoryHeap& in2) +{ + return (in1.flags == in2.flags && + in1.size == in2.size); +} + +/* Please see header for specification */ +Anvil::MemoryType::MemoryType(const VkMemoryType& in_type, + struct MemoryProperties* in_memory_props_ptr) +{ + flags = static_cast(in_type.propertyFlags); + heap_ptr = &in_memory_props_ptr->heaps[in_type.heapIndex]; + + features = Anvil::Utils::get_memory_feature_flags_from_vk_property_flags(flags, + heap_ptr->flags); +} + +/* Please see header for specification */ +bool Anvil::operator==(const Anvil::MemoryType& in1, + const Anvil::MemoryType& in2) +{ + return ( in1.flags == in2.flags && + *in1.heap_ptr == *in2.heap_ptr); +} + +/** Returns a filled MipmapRawData structure for a 1D mip. + * + * NOTE: It is caller's responsibility to configure one of the data storage pointer members. + */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_1D(VkImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + uint32_t in_row_size) +{ + MipmapRawData result; + + memset(&result, + 0, + sizeof(result) ); + + result.aspect = in_aspect; + result.data_size = in_row_size; + result.row_size = in_row_size; + result.n_layers = 1; + result.n_slices = 1; + result.n_mipmap = in_n_mipmap; + + return result; +} + +/** Returns a filled MipmapRawData structure for a 1D Array mip. + * + * NOTE: It is caller's responsibility to configure one of the data storage pointer members. + */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_array(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + uint32_t in_row_size, + uint32_t in_data_size) +{ + MipmapRawData result; + + memset(&result, + 0, + sizeof(result) ); + + result.aspect = in_aspect; + result.data_size = in_data_size; + result.n_layer = in_n_layer; + result.n_layers = in_n_layers; + result.n_mipmap = in_n_mipmap; + result.n_slices = 1; + result.row_size = in_row_size; + + return result; +} + +/** Returns a filled MipmapRawData structure for a 2D mip. + * + * NOTE: It is caller's responsibility to configure one of the data storage pointer members. + */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_2D(VkImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + uint32_t in_data_size, + uint32_t in_row_size) +{ + MipmapRawData result; + + memset(&result, + 0, + sizeof(result) ); + + result.aspect = in_aspect; + result.data_size = in_data_size; + result.n_layers = 1; + result.n_mipmap = in_n_mipmap; + result.n_slices = 1; + result.row_size = in_row_size; + + return result; +} + +/** Returns a filled MipmapRawData structure for a 2D array mip. + * + * NOTE: It is caller's responsibility to configure one of the data storage pointer members. + */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_array(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + uint32_t in_data_size, + uint32_t in_row_size) +{ + MipmapRawData result; + + memset(&result, + 0, + sizeof(result) ); + + result.aspect = in_aspect; + result.data_size = in_data_size; + result.n_layer = in_n_layer; + result.n_layers = in_n_layers; + result.n_mipmap = in_n_mipmap; + result.n_slices = 1; + result.row_size = in_row_size; + + return result; +} + +/** Returns a filled MipmapRawData structure for a 3D mip. + * + * NOTE: It is caller's responsibility to configure one of the data storage pointer members. + */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_3D(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_slices, + uint32_t in_n_mipmap, + uint32_t in_data_size, + uint32_t in_row_size) +{ + MipmapRawData result; + + memset(&result, + 0, + sizeof(result) ); + + result.aspect = in_aspect; + result.data_size = in_data_size; + result.n_layers = 1; + result.n_layer = in_n_layer; + result.n_slices = in_n_slices; + result.n_mipmap = in_n_mipmap; + result.row_size = in_row_size; + + return result; +} + + +/* Please see header for specification */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_from_uchar_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + std::shared_ptr in_linear_tightly_packed_data_ptr, + uint32_t in_row_size) +{ + MipmapRawData result = create_1D(in_aspect, + in_n_mipmap, + in_row_size); + + result.linear_tightly_packed_data_uchar_ptr = in_linear_tightly_packed_data_ptr; + + return result; +} + +/* Please see header for specification */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_from_uchar_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + const unsigned char* in_linear_tightly_packed_data_ptr, + uint32_t in_row_size) +{ + MipmapRawData result = create_1D(in_aspect, + in_n_mipmap, + in_row_size); + + result.linear_tightly_packed_data_uchar_raw_ptr = in_linear_tightly_packed_data_ptr; + + return result; +} + +/* Please see header for specification */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + std::shared_ptr > in_linear_tightly_packed_data_ptr, + uint32_t in_row_size) +{ + MipmapRawData result = create_1D(in_aspect, + in_n_mipmap, + in_row_size); + + result.linear_tightly_packed_data_uchar_vec_ptr = in_linear_tightly_packed_data_ptr; + + return result; +} + +/* Please see header for specification */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_array_from_uchar_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + std::shared_ptr in_linear_tightly_packed_data_ptr, + uint32_t in_row_size, + uint32_t in_data_size) +{ + MipmapRawData result = create_1D_array(in_aspect, + in_n_layer, + in_n_layers, + in_n_mipmap, + in_row_size, + in_data_size); + + result.linear_tightly_packed_data_uchar_ptr = in_linear_tightly_packed_data_ptr; + + return result; +} + +/* Please see header for specification */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_array_from_uchar_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + const unsigned char* in_linear_tightly_packed_data_ptr, + uint32_t in_row_size, + uint32_t in_data_size) +{ + MipmapRawData result = create_1D_array(in_aspect, + in_n_layer, + in_n_layers, + in_n_mipmap, + in_row_size, + in_data_size); + + result.linear_tightly_packed_data_uchar_raw_ptr = in_linear_tightly_packed_data_ptr; + + return result; +} + +/* Please see header for specification */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_array_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + std::shared_ptr > in_linear_tightly_packed_data_ptr, + uint32_t in_row_size, + uint32_t in_data_size) +{ + MipmapRawData result = create_1D_array(in_aspect, + in_n_layer, + in_n_layers, + in_n_mipmap, + in_row_size, + in_data_size); + + result.linear_tightly_packed_data_uchar_vec_ptr = in_linear_tightly_packed_data_ptr; + + return result; +} + +/* Please see header for specification */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_from_uchar_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + std::shared_ptr in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size) +{ + MipmapRawData result = create_2D(in_aspect, + in_n_mipmap, + in_data_size, + in_row_size); + + result.linear_tightly_packed_data_uchar_ptr = in_linear_tightly_packed_data_ptr; + + return result; +} + +/* Please see header for specification */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_from_uchar_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + const unsigned char* in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size) +{ + MipmapRawData result = create_2D(in_aspect, + in_n_mipmap, + in_data_size, + in_row_size); + + result.linear_tightly_packed_data_uchar_raw_ptr = in_linear_tightly_packed_data_ptr; + + return result; +} + +/* Please see header for specification */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + std::shared_ptr > in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size) +{ + MipmapRawData result = create_2D(in_aspect, + in_n_mipmap, + in_data_size, + in_row_size); + + result.linear_tightly_packed_data_uchar_vec_ptr = in_linear_tightly_packed_data_ptr; + + return result; +} + +/* Please see header for specification */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_array_from_uchar_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + std::shared_ptr in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size) +{ + MipmapRawData result = create_2D_array(in_aspect, + in_n_layer, + in_n_layers, + in_n_mipmap, + in_data_size, + in_row_size); + + result.linear_tightly_packed_data_uchar_ptr = in_linear_tightly_packed_data_ptr; + + return result; +} + +/* Please see header for specification */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_array_from_uchar_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + const unsigned char* in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size) +{ + MipmapRawData result = create_2D_array(in_aspect, + in_n_layer, + in_n_layers, + in_n_mipmap, + in_data_size, + in_row_size); + + result.linear_tightly_packed_data_uchar_raw_ptr = in_linear_tightly_packed_data_ptr; + + return result; +} + +/* Please see header for specification */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_array_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + std::shared_ptr > in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size) +{ + MipmapRawData result = create_2D_array(in_aspect, + in_n_layer, + in_n_layers, + in_n_mipmap, + in_data_size, + in_row_size); + + result.linear_tightly_packed_data_uchar_vec_ptr = in_linear_tightly_packed_data_ptr; + + return result; +} + + + +/* Please see header for specification */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_3D_from_uchar_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layer_slices, + uint32_t in_n_mipmap, + std::shared_ptr in_linear_tightly_packed_data_ptr, + uint32_t in_slice_data_size, + uint32_t in_row_size) +{ + MipmapRawData result = create_3D(in_aspect, + in_n_layer, + in_n_layer_slices, + in_n_mipmap, + in_slice_data_size, + in_row_size); + + result.linear_tightly_packed_data_uchar_ptr = in_linear_tightly_packed_data_ptr; + + return result; +} + +/* Please see header for specification */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_3D_from_uchar_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layer_slices, + uint32_t in_n_mipmap, + const unsigned char* in_linear_tightly_packed_data_ptr, + uint32_t in_slice_data_size, + uint32_t in_row_size) +{ + MipmapRawData result = create_3D(in_aspect, + in_n_layer, + in_n_layer_slices, + in_n_mipmap, + in_slice_data_size, + in_row_size); + + result.linear_tightly_packed_data_uchar_raw_ptr = in_linear_tightly_packed_data_ptr; + + return result; +} + +/* Please see header for specification */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_3D_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layer_slices, + uint32_t in_n_mipmap, + std::shared_ptr > in_linear_tightly_packed_data_ptr, + uint32_t in_slice_data_size, + uint32_t in_row_size) +{ + MipmapRawData result = create_3D(in_aspect, + in_n_layer, + in_n_layer_slices, + in_n_mipmap, + in_slice_data_size, + in_row_size); + + result.linear_tightly_packed_data_uchar_vec_ptr = in_linear_tightly_packed_data_ptr; + + return result; +} + + +/* Please see header for specification */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_from_uchar_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_mipmap, + std::shared_ptr in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size) +{ + anvil_assert(in_n_layer < 6); + + MipmapRawData result = create_2D_array(in_aspect, + in_n_layer, + 1, /* n_layer_slices */ + in_n_mipmap, + in_data_size, + in_row_size); + + result.linear_tightly_packed_data_uchar_ptr = in_linear_tightly_packed_data_ptr; + + return result; +} + +/* Please see header for specification */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_from_uchar_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_mipmap, + const unsigned char* in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size) +{ + anvil_assert(in_n_layer < 6); + + MipmapRawData result = create_2D_array(in_aspect, + in_n_layer, + 1, /* n_layer_slices */ + in_n_mipmap, + in_data_size, + in_row_size); + + result.linear_tightly_packed_data_uchar_raw_ptr = in_linear_tightly_packed_data_ptr; + + return result; +} + +/* Please see header for specification */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_mipmap, + std::shared_ptr > in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size) +{ + anvil_assert(in_n_layer < 6); + + MipmapRawData result = create_2D_array(in_aspect, + in_n_layer, + 1, /* n_layer_slices */ + in_n_mipmap, + in_data_size, + in_row_size); + + result.linear_tightly_packed_data_uchar_vec_ptr = in_linear_tightly_packed_data_ptr; + + return result; +} + + +/* Please see header for specification */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_array_from_uchar_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + std::shared_ptr in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size) +{ + MipmapRawData result = create_2D_array(in_aspect, + in_n_layer, + in_n_layers, + in_n_mipmap, + in_data_size, + in_row_size); + + result.linear_tightly_packed_data_uchar_ptr = in_linear_tightly_packed_data_ptr; + + return result; +} + +/* Please see header for specification */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_array_from_uchar_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + const unsigned char* in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size) +{ + MipmapRawData result = create_2D_array(in_aspect, + in_n_layer, + in_n_layers, + in_n_mipmap, + in_data_size, + in_row_size); + + result.linear_tightly_packed_data_uchar_raw_ptr = in_linear_tightly_packed_data_ptr; + + return result; +} + +/* Please see header for specification */ +Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_array_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + std::shared_ptr > in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size) +{ + MipmapRawData result = create_2D_array(in_aspect, + in_n_layer, + in_n_layers, + in_n_mipmap, + in_data_size, + in_row_size); + + result.linear_tightly_packed_data_uchar_vec_ptr = in_linear_tightly_packed_data_ptr; + + return result; +} + +Anvil::PhysicalDeviceProperties::PhysicalDeviceProperties() +{ + amd_shader_core_properties_ptr = nullptr; + core_vk1_0_properties_ptr = nullptr; + ext_descriptor_indexing_properties_ptr = nullptr; + khr_maintenance3_properties_ptr = nullptr; +} + +Anvil::PhysicalDeviceProperties::PhysicalDeviceProperties(const AMDShaderCoreProperties* in_amd_shader_core_properties_ptr, + const PhysicalDevicePropertiesCoreVK10* in_core_vk1_0_properties_ptr, + const EXTDescriptorIndexingProperties* in_ext_descriptor_indexing_properties_ptr, + const KHRMaintenance3Properties* in_khr_maintenance3_properties_ptr) + :amd_shader_core_properties_ptr (in_amd_shader_core_properties_ptr), + core_vk1_0_properties_ptr (in_core_vk1_0_properties_ptr), + ext_descriptor_indexing_properties_ptr(in_ext_descriptor_indexing_properties_ptr), + khr_maintenance3_properties_ptr (in_khr_maintenance3_properties_ptr) +{ + /* Stub */ +} + +Anvil::PhysicalDevicePropertiesCoreVK10::PhysicalDevicePropertiesCoreVK10() + :api_version (UINT32_MAX), + device_id (UINT32_MAX), + device_type (VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM), + driver_version(UINT32_MAX), + vendor_id (UINT32_MAX) +{ + memset(device_name, + 0xFF, + sizeof(device_name) ); + memset(pipeline_cache_uuid, + 0xFF, + sizeof(pipeline_cache_uuid) ); +} + +Anvil::PhysicalDeviceFeatures::PhysicalDeviceFeatures() +{ + core_vk1_0_features_ptr = nullptr; + ext_descriptor_indexing_features_ptr = nullptr; + khr_16bit_storage_features_ptr = nullptr; +} + +Anvil::PhysicalDeviceFeatures::PhysicalDeviceFeatures(const PhysicalDeviceFeaturesCoreVK10* in_core_vk1_0_features_ptr, + const EXTDescriptorIndexingFeatures* in_ext_descriptor_indexing_features_ptr, + const KHR16BitStorageFeatures* in_khr_16_bit_storage_features_ptr) +{ + core_vk1_0_features_ptr = in_core_vk1_0_features_ptr; + ext_descriptor_indexing_features_ptr = in_ext_descriptor_indexing_features_ptr; + khr_16bit_storage_features_ptr = in_khr_16_bit_storage_features_ptr; +} + +Anvil::PhysicalDeviceGroup::PhysicalDeviceGroup() +{ + supports_subset_allocations = false; +} + +Anvil::PhysicalDeviceLimits::PhysicalDeviceLimits() + :buffer_image_granularity (std::numeric_limits::max() ), + discrete_queue_priorities (UINT32_MAX), + framebuffer_color_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), + framebuffer_depth_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), + framebuffer_no_attachments_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), + framebuffer_stencil_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), + line_width_granularity (FLT_MAX), + max_bound_descriptor_sets (UINT32_MAX), + max_clip_distances (UINT32_MAX), + max_color_attachments (UINT32_MAX), + max_combined_clip_and_cull_distances (UINT32_MAX), + max_compute_shared_memory_size (UINT32_MAX), + max_compute_work_group_invocations (UINT32_MAX), + max_cull_distances (UINT32_MAX), + max_descriptor_set_input_attachments (UINT32_MAX), + max_descriptor_set_sampled_images (UINT32_MAX), + max_descriptor_set_samplers (UINT32_MAX), + max_descriptor_set_storage_buffers (UINT32_MAX), + max_descriptor_set_storage_buffers_dynamic (UINT32_MAX), + max_descriptor_set_storage_images (UINT32_MAX), + max_descriptor_set_uniform_buffers (UINT32_MAX), + max_descriptor_set_uniform_buffers_dynamic (UINT32_MAX), + max_draw_indexed_index_value (UINT32_MAX), + max_draw_indirect_count (UINT32_MAX), + max_fragment_combined_output_resources (UINT32_MAX), + max_fragment_dual_src_attachments (UINT32_MAX), + max_fragment_input_components (UINT32_MAX), + max_fragment_output_attachments (UINT32_MAX), + max_framebuffer_height (UINT32_MAX), + max_framebuffer_layers (UINT32_MAX), + max_framebuffer_width (UINT32_MAX), + max_geometry_input_components (UINT32_MAX), + max_geometry_output_components (UINT32_MAX), + max_geometry_output_vertices (UINT32_MAX), + max_geometry_shader_invocations (UINT32_MAX), + max_geometry_total_output_components (UINT32_MAX), + max_image_array_layers (UINT32_MAX), + max_image_dimension_1D (UINT32_MAX), + max_image_dimension_2D (UINT32_MAX), + max_image_dimension_3D (UINT32_MAX), + max_image_dimension_cube (UINT32_MAX), + max_interpolation_offset (FLT_MAX), + max_memory_allocation_count (UINT32_MAX), + max_per_stage_descriptor_input_attachments (UINT32_MAX), + max_per_stage_descriptor_sampled_images (UINT32_MAX), + max_per_stage_descriptor_samplers (UINT32_MAX), + max_per_stage_descriptor_storage_buffers (UINT32_MAX), + max_per_stage_descriptor_storage_images (UINT32_MAX), + max_per_stage_descriptor_uniform_buffers (UINT32_MAX), + max_per_stage_resources (UINT32_MAX), + max_push_constants_size (UINT32_MAX), + max_sample_mask_words (UINT32_MAX), + max_sampler_allocation_count (UINT32_MAX), + max_sampler_anisotropy (FLT_MAX), + max_sampler_lod_bias (FLT_MAX), + max_storage_buffer_range (UINT32_MAX), + max_viewports (UINT32_MAX), + max_tessellation_control_per_patch_output_components (UINT32_MAX), + max_tessellation_control_per_vertex_input_components (UINT32_MAX), + max_tessellation_control_per_vertex_output_components(UINT32_MAX), + max_tessellation_control_total_output_components (UINT32_MAX), + max_tessellation_evaluation_input_components (UINT32_MAX), + max_tessellation_evaluation_output_components (UINT32_MAX), + max_tessellation_generation_level (UINT32_MAX), + max_tessellation_patch_size (UINT32_MAX), + max_texel_buffer_elements (UINT32_MAX), + max_texel_gather_offset (UINT32_MAX), + max_texel_offset (UINT32_MAX), + max_uniform_buffer_range (UINT32_MAX), + max_vertex_input_attributes (UINT32_MAX), + max_vertex_input_attribute_offset (UINT32_MAX), + max_vertex_input_bindings (UINT32_MAX), + max_vertex_input_binding_stride (UINT32_MAX), + max_vertex_output_components (UINT32_MAX), + min_interpolation_offset (FLT_MAX), + min_memory_map_alignment (std::numeric_limits::max () ), + min_storage_buffer_offset_alignment (std::numeric_limits::max() ), + min_texel_buffer_offset_alignment (std::numeric_limits::max() ), + min_texel_gather_offset (INT32_MAX), + min_texel_offset (INT32_MAX), + min_uniform_buffer_offset_alignment (std::numeric_limits::max() ), + mipmap_precision_bits (UINT32_MAX), + non_coherent_atom_size (std::numeric_limits::max() ), + optimal_buffer_copy_offset_alignment (std::numeric_limits::max() ), + optimal_buffer_copy_row_pitch_alignment (std::numeric_limits::max() ), + point_size_granularity (FLT_MAX), + sampled_image_color_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), + sampled_image_depth_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), + sampled_image_integer_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), + sampled_image_stencil_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), + sparse_address_space_size (std::numeric_limits::max() ), + standard_sample_locations (false), + storage_image_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), + strict_lines (false), + sub_pixel_interpolation_offset_bits (UINT32_MAX), + sub_pixel_precision_bits (UINT32_MAX), + sub_texel_precision_bits (UINT32_MAX), + timestamp_compute_and_graphics (false), + timestamp_period (FLT_MAX), + viewport_sub_pixel_bits (UINT32_MAX) +{ + line_width_range[0] = FLT_MAX; + line_width_range[1] = FLT_MAX; + + max_compute_work_group_count[0] = UINT32_MAX; + max_compute_work_group_count[1] = UINT32_MAX; + max_compute_work_group_count[2] = UINT32_MAX; + + max_compute_work_group_size[0] = UINT32_MAX; + max_compute_work_group_size[1] = UINT32_MAX; + max_compute_work_group_size[2] = UINT32_MAX; + + max_viewport_dimensions[0] = UINT32_MAX; + max_viewport_dimensions[1] = UINT32_MAX; + + point_size_range[0] = FLT_MAX; + point_size_range[1] = FLT_MAX; + + viewport_bounds_range[0] = FLT_MAX; + viewport_bounds_range[1] = FLT_MAX; +} + +Anvil::PhysicalDeviceLimits::PhysicalDeviceLimits(const VkPhysicalDeviceLimits& in_device_limits) + :buffer_image_granularity (in_device_limits.bufferImageGranularity), + discrete_queue_priorities (in_device_limits.discreteQueuePriorities), + framebuffer_color_sample_counts (in_device_limits.framebufferColorSampleCounts), + framebuffer_depth_sample_counts (in_device_limits.framebufferDepthSampleCounts), + framebuffer_no_attachments_sample_counts (in_device_limits.framebufferNoAttachmentsSampleCounts), + framebuffer_stencil_sample_counts (in_device_limits.framebufferStencilSampleCounts), + line_width_granularity (in_device_limits.lineWidthGranularity), + max_bound_descriptor_sets (in_device_limits.maxBoundDescriptorSets), + max_clip_distances (in_device_limits.maxClipDistances), + max_color_attachments (in_device_limits.maxColorAttachments), + max_combined_clip_and_cull_distances (in_device_limits.maxCombinedClipAndCullDistances), + max_compute_shared_memory_size (in_device_limits.maxComputeSharedMemorySize), + max_compute_work_group_invocations (in_device_limits.maxComputeWorkGroupInvocations), + max_cull_distances (in_device_limits.maxCullDistances), + max_descriptor_set_input_attachments (in_device_limits.maxDescriptorSetInputAttachments), + max_descriptor_set_sampled_images (in_device_limits.maxDescriptorSetSampledImages), + max_descriptor_set_samplers (in_device_limits.maxDescriptorSetSamplers), + max_descriptor_set_storage_buffers (in_device_limits.maxDescriptorSetStorageBuffers), + max_descriptor_set_storage_buffers_dynamic (in_device_limits.maxDescriptorSetStorageBuffersDynamic), + max_descriptor_set_storage_images (in_device_limits.maxDescriptorSetStorageImages), + max_descriptor_set_uniform_buffers (in_device_limits.maxDescriptorSetUniformBuffers), + max_descriptor_set_uniform_buffers_dynamic (in_device_limits.maxDescriptorSetUniformBuffersDynamic), + max_draw_indexed_index_value (in_device_limits.maxDrawIndexedIndexValue), + max_draw_indirect_count (in_device_limits.maxDrawIndirectCount), + max_fragment_combined_output_resources (in_device_limits.maxFragmentCombinedOutputResources), + max_fragment_dual_src_attachments (in_device_limits.maxFragmentDualSrcAttachments), + max_fragment_input_components (in_device_limits.maxFragmentInputComponents), + max_fragment_output_attachments (in_device_limits.maxFragmentOutputAttachments), + max_framebuffer_height (in_device_limits.maxFramebufferHeight), + max_framebuffer_layers (in_device_limits.maxFramebufferLayers), + max_framebuffer_width (in_device_limits.maxFramebufferWidth), + max_geometry_input_components (in_device_limits.maxGeometryInputComponents), + max_geometry_output_components (in_device_limits.maxGeometryOutputComponents), + max_geometry_output_vertices (in_device_limits.maxGeometryOutputVertices), + max_geometry_shader_invocations (in_device_limits.maxGeometryShaderInvocations), + max_geometry_total_output_components (in_device_limits.maxGeometryTotalOutputComponents), + max_image_array_layers (in_device_limits.maxImageArrayLayers), + max_image_dimension_1D (in_device_limits.maxImageDimension1D), + max_image_dimension_2D (in_device_limits.maxImageDimension2D), + max_image_dimension_3D (in_device_limits.maxImageDimension3D), + max_image_dimension_cube (in_device_limits.maxImageDimensionCube), + max_interpolation_offset (in_device_limits.maxInterpolationOffset), + max_memory_allocation_count (in_device_limits.maxMemoryAllocationCount), + max_per_stage_descriptor_input_attachments (in_device_limits.maxPerStageDescriptorInputAttachments), + max_per_stage_descriptor_sampled_images (in_device_limits.maxPerStageDescriptorSampledImages), + max_per_stage_descriptor_samplers (in_device_limits.maxPerStageDescriptorSamplers), + max_per_stage_descriptor_storage_buffers (in_device_limits.maxPerStageDescriptorStorageBuffers), + max_per_stage_descriptor_storage_images (in_device_limits.maxPerStageDescriptorStorageImages), + max_per_stage_descriptor_uniform_buffers (in_device_limits.maxPerStageDescriptorUniformBuffers), + max_per_stage_resources (in_device_limits.maxPerStageResources), + max_push_constants_size (in_device_limits.maxPushConstantsSize), + max_sample_mask_words (in_device_limits.maxSampleMaskWords), + max_sampler_allocation_count (in_device_limits.maxSamplerAllocationCount), + max_sampler_anisotropy (in_device_limits.maxSamplerAnisotropy), + max_sampler_lod_bias (in_device_limits.maxSamplerLodBias), + max_storage_buffer_range (in_device_limits.maxStorageBufferRange), + max_viewports (in_device_limits.maxViewports), + max_tessellation_control_per_patch_output_components (in_device_limits.maxTessellationControlPerPatchOutputComponents), + max_tessellation_control_per_vertex_input_components (in_device_limits.maxTessellationControlPerVertexInputComponents), + max_tessellation_control_per_vertex_output_components(in_device_limits.maxTessellationControlPerVertexOutputComponents), + max_tessellation_control_total_output_components (in_device_limits.maxTessellationControlTotalOutputComponents), + max_tessellation_evaluation_input_components (in_device_limits.maxTessellationEvaluationInputComponents), + max_tessellation_evaluation_output_components (in_device_limits.maxTessellationEvaluationOutputComponents), + max_tessellation_generation_level (in_device_limits.maxTessellationGenerationLevel), + max_tessellation_patch_size (in_device_limits.maxTessellationPatchSize), + max_texel_buffer_elements (in_device_limits.maxTexelBufferElements), + max_texel_gather_offset (in_device_limits.maxTexelGatherOffset), + max_texel_offset (in_device_limits.maxTexelOffset), + max_uniform_buffer_range (in_device_limits.maxUniformBufferRange), + max_vertex_input_attributes (in_device_limits.maxVertexInputAttributes), + max_vertex_input_attribute_offset (in_device_limits.maxVertexInputAttributeOffset), + max_vertex_input_bindings (in_device_limits.maxVertexInputBindings), + max_vertex_input_binding_stride (in_device_limits.maxVertexInputBindingStride), + max_vertex_output_components (in_device_limits.maxVertexOutputComponents), + min_interpolation_offset (in_device_limits.minInterpolationOffset), + min_memory_map_alignment (in_device_limits.minMemoryMapAlignment), + min_storage_buffer_offset_alignment (in_device_limits.minStorageBufferOffsetAlignment), + min_texel_buffer_offset_alignment (in_device_limits.minTexelBufferOffsetAlignment), + min_texel_gather_offset (in_device_limits.minTexelGatherOffset), + min_texel_offset (in_device_limits.minTexelOffset), + min_uniform_buffer_offset_alignment (in_device_limits.minUniformBufferOffsetAlignment), + mipmap_precision_bits (in_device_limits.mipmapPrecisionBits), + non_coherent_atom_size (in_device_limits.nonCoherentAtomSize), + optimal_buffer_copy_offset_alignment (in_device_limits.optimalBufferCopyOffsetAlignment), + optimal_buffer_copy_row_pitch_alignment (in_device_limits.optimalBufferCopyRowPitchAlignment), + point_size_granularity (in_device_limits.pointSizeGranularity), + sampled_image_color_sample_counts (in_device_limits.sampledImageColorSampleCounts), + sampled_image_depth_sample_counts (in_device_limits.sampledImageDepthSampleCounts), + sampled_image_integer_sample_counts (in_device_limits.sampledImageIntegerSampleCounts), + sampled_image_stencil_sample_counts (in_device_limits.sampledImageStencilSampleCounts), + sparse_address_space_size (in_device_limits.sparseAddressSpaceSize), + standard_sample_locations (VK_BOOL32_TO_BOOL(in_device_limits.standardSampleLocations) ), + storage_image_sample_counts (in_device_limits.storageImageSampleCounts), + strict_lines (VK_BOOL32_TO_BOOL(in_device_limits.strictLines) ), + sub_pixel_interpolation_offset_bits (in_device_limits.subPixelInterpolationOffsetBits), + sub_pixel_precision_bits (in_device_limits.subPixelPrecisionBits), + sub_texel_precision_bits (in_device_limits.subTexelPrecisionBits), + timestamp_compute_and_graphics (VK_BOOL32_TO_BOOL(in_device_limits.timestampComputeAndGraphics) ), + timestamp_period (in_device_limits.timestampPeriod), + viewport_sub_pixel_bits (in_device_limits.viewportSubPixelBits) +{ + memcpy(line_width_range, + in_device_limits.lineWidthRange, + sizeof(line_width_range) ); + + memcpy(max_compute_work_group_count, + in_device_limits.maxComputeWorkGroupCount, + sizeof(max_compute_work_group_count) ); + + memcpy(max_compute_work_group_size, + in_device_limits.maxComputeWorkGroupSize, + sizeof(max_compute_work_group_size) ); + + memcpy(max_viewport_dimensions, + in_device_limits.maxViewportDimensions, + sizeof(max_viewport_dimensions) ); + + memcpy(point_size_range, + in_device_limits.pointSizeRange, + sizeof(point_size_range) ); + + memcpy(viewport_bounds_range, + in_device_limits.viewportBoundsRange, + sizeof(viewport_bounds_range) ); +} + +bool Anvil::PhysicalDeviceLimits::operator==(const Anvil::PhysicalDeviceLimits& in_device_limits) const +{ + bool result = false; + + if (buffer_image_granularity == in_device_limits.buffer_image_granularity && + discrete_queue_priorities == in_device_limits.discrete_queue_priorities && + framebuffer_color_sample_counts == in_device_limits.framebuffer_color_sample_counts && + framebuffer_depth_sample_counts == in_device_limits.framebuffer_depth_sample_counts && + framebuffer_no_attachments_sample_counts == in_device_limits.framebuffer_no_attachments_sample_counts && + framebuffer_stencil_sample_counts == in_device_limits.framebuffer_stencil_sample_counts && + max_bound_descriptor_sets == in_device_limits.max_bound_descriptor_sets && + max_clip_distances == in_device_limits.max_clip_distances && + max_color_attachments == in_device_limits.max_color_attachments && + max_combined_clip_and_cull_distances == in_device_limits.max_combined_clip_and_cull_distances && + max_compute_shared_memory_size == in_device_limits.max_compute_shared_memory_size && + max_compute_work_group_count[0] == in_device_limits.max_compute_work_group_count[0] && + max_compute_work_group_count[1] == in_device_limits.max_compute_work_group_count[1] && + max_compute_work_group_count[2] == in_device_limits.max_compute_work_group_count[2] && + max_compute_work_group_invocations == in_device_limits.max_compute_work_group_invocations && + max_compute_work_group_size[0] == in_device_limits.max_compute_work_group_size[0] && + max_compute_work_group_size[1] == in_device_limits.max_compute_work_group_size[1] && + max_compute_work_group_size[2] == in_device_limits.max_compute_work_group_size[2] && + max_cull_distances == in_device_limits.max_cull_distances && + max_descriptor_set_input_attachments == in_device_limits.max_descriptor_set_input_attachments && + max_descriptor_set_sampled_images == in_device_limits.max_descriptor_set_sampled_images && + max_descriptor_set_samplers == in_device_limits.max_descriptor_set_samplers && + max_descriptor_set_storage_buffers == in_device_limits.max_descriptor_set_storage_buffers && + max_descriptor_set_storage_buffers_dynamic == in_device_limits.max_descriptor_set_storage_buffers_dynamic && + max_descriptor_set_storage_images == in_device_limits.max_descriptor_set_storage_images && + max_descriptor_set_uniform_buffers == in_device_limits.max_descriptor_set_uniform_buffers && + max_descriptor_set_uniform_buffers_dynamic == in_device_limits.max_descriptor_set_uniform_buffers_dynamic && + max_draw_indexed_index_value == in_device_limits.max_draw_indexed_index_value && + max_draw_indirect_count == in_device_limits.max_draw_indirect_count && + max_fragment_combined_output_resources == in_device_limits.max_fragment_combined_output_resources && + max_fragment_dual_src_attachments == in_device_limits.max_fragment_dual_src_attachments && + max_fragment_input_components == in_device_limits.max_fragment_input_components && + max_fragment_output_attachments == in_device_limits.max_fragment_output_attachments && + max_framebuffer_height == in_device_limits.max_framebuffer_height && + max_framebuffer_layers == in_device_limits.max_framebuffer_layers && + max_framebuffer_width == in_device_limits.max_framebuffer_width && + max_geometry_input_components == in_device_limits.max_geometry_input_components && + max_geometry_output_components == in_device_limits.max_geometry_output_components && + max_geometry_output_vertices == in_device_limits.max_geometry_output_vertices && + max_geometry_shader_invocations == in_device_limits.max_geometry_shader_invocations && + max_geometry_total_output_components == in_device_limits.max_geometry_total_output_components && + max_image_array_layers == in_device_limits.max_image_array_layers && + max_image_dimension_1D == in_device_limits.max_image_dimension_1D && + max_image_dimension_2D == in_device_limits.max_image_dimension_2D && + max_image_dimension_3D == in_device_limits.max_image_dimension_3D && + max_image_dimension_cube == in_device_limits.max_image_dimension_cube && + max_memory_allocation_count == in_device_limits.max_memory_allocation_count && + max_per_stage_descriptor_input_attachments == in_device_limits.max_per_stage_descriptor_input_attachments && + max_per_stage_descriptor_sampled_images == in_device_limits.max_per_stage_descriptor_sampled_images && + max_per_stage_descriptor_samplers == in_device_limits.max_per_stage_descriptor_samplers && + max_per_stage_descriptor_storage_buffers == in_device_limits.max_per_stage_descriptor_storage_buffers && + max_per_stage_descriptor_storage_images == in_device_limits.max_per_stage_descriptor_storage_images && + max_per_stage_descriptor_uniform_buffers == in_device_limits.max_per_stage_descriptor_uniform_buffers && + max_per_stage_resources == in_device_limits.max_per_stage_resources && + max_push_constants_size == in_device_limits.max_push_constants_size && + max_sample_mask_words == in_device_limits.max_sample_mask_words && + max_sampler_allocation_count == in_device_limits.max_sampler_allocation_count && + max_storage_buffer_range == in_device_limits.max_storage_buffer_range && + max_viewport_dimensions[0] == in_device_limits.max_viewport_dimensions[0] && + max_viewport_dimensions[1] == in_device_limits.max_viewport_dimensions[1] && + max_viewports == in_device_limits.max_viewports && + max_tessellation_control_per_patch_output_components == in_device_limits.max_tessellation_control_per_patch_output_components && + max_tessellation_control_per_vertex_input_components == in_device_limits.max_tessellation_control_per_vertex_input_components && + max_tessellation_control_per_vertex_output_components == in_device_limits.max_tessellation_control_per_vertex_output_components && + max_tessellation_control_total_output_components == in_device_limits.max_tessellation_control_total_output_components && + max_tessellation_evaluation_input_components == in_device_limits.max_tessellation_evaluation_input_components && + max_tessellation_evaluation_output_components == in_device_limits.max_tessellation_evaluation_output_components && + max_tessellation_generation_level == in_device_limits.max_tessellation_generation_level && + max_tessellation_patch_size == in_device_limits.max_tessellation_patch_size && + max_texel_buffer_elements == in_device_limits.max_texel_buffer_elements && + max_texel_gather_offset == in_device_limits.max_texel_gather_offset && + max_texel_offset == in_device_limits.max_texel_offset && + max_uniform_buffer_range == in_device_limits.max_uniform_buffer_range && + max_vertex_input_attributes == in_device_limits.max_vertex_input_attributes && + max_vertex_input_attribute_offset == in_device_limits.max_vertex_input_attribute_offset && + max_vertex_input_bindings == in_device_limits.max_vertex_input_bindings && + max_vertex_input_binding_stride == in_device_limits.max_vertex_input_binding_stride && + max_vertex_output_components == in_device_limits.max_vertex_output_components && + min_memory_map_alignment == in_device_limits.min_memory_map_alignment && + min_storage_buffer_offset_alignment == in_device_limits.min_storage_buffer_offset_alignment && + min_texel_buffer_offset_alignment == in_device_limits.min_texel_buffer_offset_alignment && + min_texel_gather_offset == in_device_limits.min_texel_gather_offset && + min_texel_offset == in_device_limits.min_texel_offset && + min_uniform_buffer_offset_alignment == in_device_limits.min_uniform_buffer_offset_alignment && + mipmap_precision_bits == in_device_limits.mipmap_precision_bits && + non_coherent_atom_size == in_device_limits.non_coherent_atom_size && + optimal_buffer_copy_offset_alignment == in_device_limits.optimal_buffer_copy_offset_alignment && + optimal_buffer_copy_row_pitch_alignment == in_device_limits.optimal_buffer_copy_row_pitch_alignment && + sampled_image_color_sample_counts == in_device_limits.sampled_image_color_sample_counts && + sampled_image_depth_sample_counts == in_device_limits.sampled_image_depth_sample_counts && + sampled_image_integer_sample_counts == in_device_limits.sampled_image_integer_sample_counts && + sampled_image_stencil_sample_counts == in_device_limits.sampled_image_stencil_sample_counts && + sparse_address_space_size == in_device_limits.sparse_address_space_size && + standard_sample_locations == in_device_limits.standard_sample_locations && + storage_image_sample_counts == in_device_limits.storage_image_sample_counts && + strict_lines == in_device_limits.strict_lines && + sub_pixel_interpolation_offset_bits == in_device_limits.sub_pixel_interpolation_offset_bits && + sub_pixel_precision_bits == in_device_limits.sub_pixel_precision_bits && + sub_texel_precision_bits == in_device_limits.sub_texel_precision_bits && + timestamp_compute_and_graphics == in_device_limits.timestamp_compute_and_graphics && + viewport_sub_pixel_bits == in_device_limits.viewport_sub_pixel_bits) + { + /* Floats */ + if (fabs(line_width_range[0] - in_device_limits.line_width_range[0]) < 1e-5f && + fabs(line_width_range[1] - in_device_limits.line_width_range[1]) < 1e-5f && + fabs(line_width_granularity - in_device_limits.line_width_granularity) < 1e-5f && + fabs(max_interpolation_offset - in_device_limits.max_interpolation_offset) < 1e-5f && + fabs(max_sampler_anisotropy - in_device_limits.max_sampler_anisotropy) < 1e-5f && + fabs(max_sampler_lod_bias - in_device_limits.max_sampler_lod_bias) < 1e-5f && + fabs(min_interpolation_offset - in_device_limits.min_interpolation_offset) < 1e-5f && + fabs(point_size_granularity - in_device_limits.point_size_granularity) < 1e-5f && + fabs(point_size_range[0] - in_device_limits.point_size_range[0]) < 1e-5f && + fabs(point_size_range[1] - in_device_limits.point_size_range[1]) < 1e-5f && + fabs(timestamp_period - in_device_limits.timestamp_period) < 1e-5f && + fabs(viewport_bounds_range[0] - in_device_limits.viewport_bounds_range[0]) < 1e-5f && + fabs(viewport_bounds_range[1] - in_device_limits.viewport_bounds_range[1]) < 1e-5f) + { + result = true; + } + } + + return result; +} + +Anvil::PhysicalDevicePropertiesCoreVK10::PhysicalDevicePropertiesCoreVK10(const VkPhysicalDeviceProperties& in_physical_device_properties) + :api_version (in_physical_device_properties.apiVersion), + device_id (in_physical_device_properties.deviceID), + device_type (in_physical_device_properties.deviceType), + driver_version (in_physical_device_properties.driverVersion), + limits (PhysicalDeviceLimits (in_physical_device_properties.limits) ), + sparse_properties(PhysicalDeviceSparseProperties(in_physical_device_properties.sparseProperties) ), + vendor_id (in_physical_device_properties.vendorID) +{ + memcpy(device_name, + in_physical_device_properties.deviceName, + sizeof(device_name) ); + memcpy(pipeline_cache_uuid, + in_physical_device_properties.pipelineCacheUUID, + sizeof(pipeline_cache_uuid) ); +} + +bool Anvil::PhysicalDevicePropertiesCoreVK10::operator==(const PhysicalDevicePropertiesCoreVK10& in_props) const +{ + bool result = false; + + if (in_props.api_version == api_version && + in_props.device_id == device_id && + in_props.device_type == device_type && + in_props.driver_version == driver_version && + in_props.limits == limits && + in_props.sparse_properties == sparse_properties && + in_props.vendor_id == vendor_id) + { + if (memcmp(device_name, + in_props.device_name, + sizeof(device_name) ) == 0 && + memcmp(pipeline_cache_uuid, + in_props.pipeline_cache_uuid, + sizeof(pipeline_cache_uuid) ) == 0) + { + result = true; + } + } + + return result; +} + +Anvil::PhysicalDeviceSparseProperties::PhysicalDeviceSparseProperties() + :residency_standard_2D_block_shape (false), + residency_standard_2D_multisample_block_shape(false), + residency_standard_3D_block_shape (false), + residency_aligned_mip_size (false), + residency_non_resident_strict (false) +{ + /* Stub */ +} + +Anvil::PhysicalDeviceSparseProperties::PhysicalDeviceSparseProperties(const VkPhysicalDeviceSparseProperties& in_sparse_props) + :residency_standard_2D_block_shape (VK_BOOL32_TO_BOOL(in_sparse_props.residencyStandard2DBlockShape) ), + residency_standard_2D_multisample_block_shape(VK_BOOL32_TO_BOOL(in_sparse_props.residencyStandard2DMultisampleBlockShape) ), + residency_standard_3D_block_shape (VK_BOOL32_TO_BOOL(in_sparse_props.residencyStandard3DBlockShape) ), + residency_aligned_mip_size (VK_BOOL32_TO_BOOL(in_sparse_props.residencyAlignedMipSize) ), + residency_non_resident_strict (VK_BOOL32_TO_BOOL(in_sparse_props.residencyNonResidentStrict) ) +{ + /* Stub */ +} + +bool Anvil::PhysicalDeviceSparseProperties::operator==(const Anvil::PhysicalDeviceSparseProperties& in_props) const +{ + return (residency_standard_2D_block_shape == in_props.residency_standard_2D_block_shape && + residency_standard_2D_multisample_block_shape == in_props.residency_standard_2D_multisample_block_shape && + residency_standard_3D_block_shape == in_props.residency_standard_3D_block_shape && + residency_aligned_mip_size == in_props.residency_aligned_mip_size && + residency_non_resident_strict == in_props.residency_non_resident_strict); +} + +Anvil::PushConstantRange::PushConstantRange(uint32_t in_offset, + uint32_t in_size, + VkShaderStageFlags in_stages) +{ + offset = in_offset; + size = in_size; + stages = static_cast(in_stages); +} + +bool Anvil::PushConstantRange::operator==(const PushConstantRange& in) const +{ + return (offset == in.offset && + size == in.size && + stages == in.stages); +} + +Anvil::QueueFamilyInfo::QueueFamilyInfo(const VkQueueFamilyProperties& in_props) +{ + flags = in_props.queueFlags; + min_image_transfer_granularity = in_props.minImageTransferGranularity; + n_queues = in_props.queueCount; + n_timestamp_bits = in_props.timestampValidBits; +} + +/** Please see header for specification */ +bool Anvil::operator==(const Anvil::QueueFamilyInfo& in1, + const Anvil::QueueFamilyInfo& in2) +{ + return (in1.flags == in2.flags && + in1.min_image_transfer_granularity.depth == in2.min_image_transfer_granularity.depth && + in1.min_image_transfer_granularity.height == in2.min_image_transfer_granularity.height && + in1.min_image_transfer_granularity.width == in2.min_image_transfer_granularity.width && + in1.n_queues == in2.n_queues && + in1.n_timestamp_bits == in2.n_timestamp_bits); +} + +/** Please see header for specification */ +Anvil::ShaderModuleStageEntryPoint::ShaderModuleStageEntryPoint() +{ + shader_module_ptr = nullptr; + stage = SHADER_STAGE_UNKNOWN; +} + +/** Please see header for specification */ +Anvil::ShaderModuleStageEntryPoint::ShaderModuleStageEntryPoint(const std::string& in_name, + ShaderModule* in_shader_module_ptr, + ShaderStage in_stage) +{ + anvil_assert(in_shader_module_ptr != nullptr); + + name = in_name; + shader_module_ptr = in_shader_module_ptr; + stage = in_stage; +} + +Anvil::ShaderModuleStageEntryPoint::ShaderModuleStageEntryPoint(const std::string& in_name, + ShaderModuleUniquePtr in_shader_module_ptr, + ShaderStage in_stage) +{ + anvil_assert(in_shader_module_ptr != nullptr); + + name = in_name; + shader_module_ptr = in_shader_module_ptr.get(); + stage = in_stage; + + shader_module_owned_ptr = std::move(in_shader_module_ptr); +} + +/** Please see header for specification */ +Anvil::ShaderModuleStageEntryPoint::ShaderModuleStageEntryPoint(const ShaderModuleStageEntryPoint& in) +{ + name = in.name; + shader_module_ptr = in.shader_module_ptr; + stage = in.stage; +} + +/** Please see header for specification */ +Anvil::ShaderModuleStageEntryPoint::~ShaderModuleStageEntryPoint() +{ + /* Stub */ +} + +/** Please see header for specification */ +Anvil::ShaderModuleStageEntryPoint& Anvil::ShaderModuleStageEntryPoint::operator=(const Anvil::ShaderModuleStageEntryPoint& in) +{ + name = in.name; + shader_module_ptr = in.shader_module_ptr; + stage = in.stage; + + return *this; +} + +Anvil::SparseImageAspectProperties::SparseImageAspectProperties() +{ + memset(this, + 0, + sizeof(*this) ); +} + +Anvil::SparseImageAspectProperties::SparseImageAspectProperties(const VkSparseImageMemoryRequirements& in_req) +{ + aspect_mask = in_req.formatProperties.aspectMask; + flags = in_req.formatProperties.flags; + granularity = in_req.formatProperties.imageGranularity; + mip_tail_first_lod = in_req.imageMipTailFirstLod; + mip_tail_offset = in_req.imageMipTailOffset; + mip_tail_size = in_req.imageMipTailSize; + mip_tail_stride = in_req.imageMipTailStride; +} + +Anvil::SparseMemoryBindingUpdateInfo::SparseMemoryBindingUpdateInfo() +{ + m_dirty = true; + m_fence_ptr = nullptr; +} + +Anvil::SpecializationConstant::SpecializationConstant() +{ + constant_id = UINT32_MAX; + n_bytes = UINT32_MAX; + start_offset = UINT32_MAX; +} + +Anvil::SpecializationConstant::SpecializationConstant(uint32_t in_constant_id, + uint32_t in_n_bytes, + uint32_t in_start_offset) +{ + constant_id = in_constant_id; + n_bytes = in_n_bytes; + start_offset = in_start_offset; +} + +bool Anvil::PhysicalDeviceFeatures::operator==(const PhysicalDeviceFeatures& in_physical_device_features) const +{ + const bool core_vk1_0_features_match = (*core_vk1_0_features_ptr == *in_physical_device_features.core_vk1_0_features_ptr); + bool ext_descriptor_indexing_features_match = false; + bool khr_16bit_storage_features_match = false; + + if (khr_16bit_storage_features_ptr != nullptr && + in_physical_device_features.khr_16bit_storage_features_ptr != nullptr) + { + khr_16bit_storage_features_match = (*khr_16bit_storage_features_ptr == *in_physical_device_features.khr_16bit_storage_features_ptr); + } + else + { + khr_16bit_storage_features_match = (khr_16bit_storage_features_ptr == nullptr && + in_physical_device_features.khr_16bit_storage_features_ptr == nullptr); + } + + if (ext_descriptor_indexing_features_ptr != nullptr && + in_physical_device_features.ext_descriptor_indexing_features_ptr != nullptr) + { + ext_descriptor_indexing_features_match = (*ext_descriptor_indexing_features_ptr == *in_physical_device_features.ext_descriptor_indexing_features_ptr); + } + else + { + ext_descriptor_indexing_features_match = (ext_descriptor_indexing_features_ptr == nullptr && + in_physical_device_features.ext_descriptor_indexing_features_ptr == nullptr); + } + + return core_vk1_0_features_match && + ext_descriptor_indexing_features_match && + khr_16bit_storage_features_match; +} + +Anvil::PhysicalDeviceFeaturesCoreVK10::PhysicalDeviceFeaturesCoreVK10() + :alpha_to_one (false), + depth_bias_clamp (false), + depth_bounds (false), + depth_clamp (false), + draw_indirect_first_instance (false), + dual_src_blend (false), + fill_mode_non_solid (false), + fragment_stores_and_atomics (false), + full_draw_index_uint32 (false), + geometry_shader (false), + image_cube_array (false), + independent_blend (false), + inherited_queries (false), + large_points (false), + logic_ip (false), + multi_draw_indirect (false), + multi_viewport (false), + occlusion_query_precise (false), + pipeline_statistics_query (false), + robust_buffer_access (false), + sampler_anisotropy (false), + sample_rate_shading (false), + shader_clip_distance (false), + shader_cull_distance (false), + shader_float64 (false), + shader_image_gather_extended (false), + shader_int16 (false), + shader_int64 (false), + shader_resource_residency (false), + shader_resource_min_lod (false), + shader_sampled_image_array_dynamic_indexing (false), + shader_storage_buffer_array_dynamic_indexing(false), + shader_storage_image_array_dynamic_indexing (false), + shader_storage_image_extended_formats (false), + shader_storage_image_multisample (false), + shader_storage_image_read_without_format (false), + shader_storage_image_write_without_format (false), + shader_tessellation_and_geometry_point_size (false), + shader_uniform_buffer_array_dynamic_indexing(false), + sparse_binding (false), + sparse_residency_2_samples (false), + sparse_residency_4_samples (false), + sparse_residency_8_samples (false), + sparse_residency_16_samples (false), + sparse_residency_aliased (false), + sparse_residency_buffer (false), + sparse_residency_image_2D (false), + sparse_residency_image_3D (false), + tessellation_shader (false), + texture_compression_ASTC_LDR (false), + texture_compression_BC (false), + texture_compression_ETC2 (false), + variable_multisample_rate (false), + vertex_pipeline_stores_and_atomics (false), + wide_lines (false) +{ + /* Stub */ +} + +Anvil::PhysicalDeviceFeaturesCoreVK10::PhysicalDeviceFeaturesCoreVK10(const VkPhysicalDeviceFeatures& in_physical_device_features) + :alpha_to_one (VK_BOOL32_TO_BOOL(in_physical_device_features.alphaToOne) ), + depth_bias_clamp (VK_BOOL32_TO_BOOL(in_physical_device_features.depthBiasClamp) ), + depth_bounds (VK_BOOL32_TO_BOOL(in_physical_device_features.depthBounds) ), + depth_clamp (VK_BOOL32_TO_BOOL(in_physical_device_features.depthClamp) ), + draw_indirect_first_instance (VK_BOOL32_TO_BOOL(in_physical_device_features.drawIndirectFirstInstance) ), + dual_src_blend (VK_BOOL32_TO_BOOL(in_physical_device_features.dualSrcBlend) ), + fill_mode_non_solid (VK_BOOL32_TO_BOOL(in_physical_device_features.fillModeNonSolid) ), + fragment_stores_and_atomics (VK_BOOL32_TO_BOOL(in_physical_device_features.fragmentStoresAndAtomics) ), + full_draw_index_uint32 (VK_BOOL32_TO_BOOL(in_physical_device_features.fullDrawIndexUint32) ), + geometry_shader (VK_BOOL32_TO_BOOL(in_physical_device_features.geometryShader) ), + image_cube_array (VK_BOOL32_TO_BOOL(in_physical_device_features.imageCubeArray) ), + independent_blend (VK_BOOL32_TO_BOOL(in_physical_device_features.independentBlend) ), + inherited_queries (VK_BOOL32_TO_BOOL(in_physical_device_features.inheritedQueries) ), + large_points (VK_BOOL32_TO_BOOL(in_physical_device_features.largePoints) ), + logic_ip (VK_BOOL32_TO_BOOL(in_physical_device_features.logicOp) ), + multi_draw_indirect (VK_BOOL32_TO_BOOL(in_physical_device_features.multiDrawIndirect) ), + multi_viewport (VK_BOOL32_TO_BOOL(in_physical_device_features.multiViewport) ), + occlusion_query_precise (VK_BOOL32_TO_BOOL(in_physical_device_features.occlusionQueryPrecise) ), + pipeline_statistics_query (VK_BOOL32_TO_BOOL(in_physical_device_features.pipelineStatisticsQuery) ), + robust_buffer_access (VK_BOOL32_TO_BOOL(in_physical_device_features.robustBufferAccess) ), + sampler_anisotropy (VK_BOOL32_TO_BOOL(in_physical_device_features.samplerAnisotropy) ), + sample_rate_shading (VK_BOOL32_TO_BOOL(in_physical_device_features.sampleRateShading) ), + shader_clip_distance (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderClipDistance) ), + shader_cull_distance (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderCullDistance) ), + shader_float64 (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderFloat64) ), + shader_image_gather_extended (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderImageGatherExtended) ), + shader_int16 (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderInt16) ), + shader_int64 (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderInt64) ), + shader_resource_residency (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderResourceResidency) ), + shader_resource_min_lod (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderResourceMinLod) ), + shader_sampled_image_array_dynamic_indexing (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderSampledImageArrayDynamicIndexing) ), + shader_storage_buffer_array_dynamic_indexing(VK_BOOL32_TO_BOOL(in_physical_device_features.shaderStorageBufferArrayDynamicIndexing) ), + shader_storage_image_array_dynamic_indexing (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderStorageImageArrayDynamicIndexing) ), + shader_storage_image_extended_formats (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderStorageImageExtendedFormats) ), + shader_storage_image_multisample (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderStorageImageMultisample) ), + shader_storage_image_read_without_format (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderStorageImageReadWithoutFormat) ), + shader_storage_image_write_without_format (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderStorageImageWriteWithoutFormat) ), + shader_tessellation_and_geometry_point_size (VK_BOOL32_TO_BOOL(in_physical_device_features.shaderTessellationAndGeometryPointSize) ), + shader_uniform_buffer_array_dynamic_indexing(VK_BOOL32_TO_BOOL(in_physical_device_features.shaderUniformBufferArrayDynamicIndexing) ), + sparse_binding (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseBinding) ), + sparse_residency_2_samples (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidency2Samples) ), + sparse_residency_4_samples (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidency4Samples) ), + sparse_residency_8_samples (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidency8Samples) ), + sparse_residency_16_samples (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidency16Samples) ), + sparse_residency_aliased (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidencyAliased) ), + sparse_residency_buffer (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidencyBuffer) ), + sparse_residency_image_2D (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidencyImage2D) ), + sparse_residency_image_3D (VK_BOOL32_TO_BOOL(in_physical_device_features.sparseResidencyImage3D) ), + tessellation_shader (VK_BOOL32_TO_BOOL(in_physical_device_features.tessellationShader) ), + texture_compression_ASTC_LDR (VK_BOOL32_TO_BOOL(in_physical_device_features.textureCompressionASTC_LDR) ), + texture_compression_BC (VK_BOOL32_TO_BOOL(in_physical_device_features.textureCompressionBC) ), + texture_compression_ETC2 (VK_BOOL32_TO_BOOL(in_physical_device_features.textureCompressionETC2) ), + variable_multisample_rate (VK_BOOL32_TO_BOOL(in_physical_device_features.variableMultisampleRate) ), + vertex_pipeline_stores_and_atomics (VK_BOOL32_TO_BOOL(in_physical_device_features.vertexPipelineStoresAndAtomics) ), + wide_lines (VK_BOOL32_TO_BOOL(in_physical_device_features.wideLines) ) +{ + /* Stub */ +} + +VkPhysicalDeviceFeatures Anvil::PhysicalDeviceFeaturesCoreVK10::get_vk_physical_device_features() const +{ + VkPhysicalDeviceFeatures result; + + result.alphaToOne = BOOL_TO_VK_BOOL32(alpha_to_one); + result.depthBiasClamp = BOOL_TO_VK_BOOL32(depth_bias_clamp); + result.depthBounds = BOOL_TO_VK_BOOL32(depth_bounds); + result.depthClamp = BOOL_TO_VK_BOOL32(depth_clamp); + result.drawIndirectFirstInstance = BOOL_TO_VK_BOOL32(draw_indirect_first_instance); + result.dualSrcBlend = BOOL_TO_VK_BOOL32(dual_src_blend); + result.fillModeNonSolid = BOOL_TO_VK_BOOL32(fill_mode_non_solid); + result.fragmentStoresAndAtomics = BOOL_TO_VK_BOOL32(fragment_stores_and_atomics); + result.fullDrawIndexUint32 = BOOL_TO_VK_BOOL32(full_draw_index_uint32); + result.geometryShader = BOOL_TO_VK_BOOL32(geometry_shader); + result.imageCubeArray = BOOL_TO_VK_BOOL32(image_cube_array); + result.independentBlend = BOOL_TO_VK_BOOL32(independent_blend); + result.inheritedQueries = BOOL_TO_VK_BOOL32(inherited_queries); + result.largePoints = BOOL_TO_VK_BOOL32(large_points); + result.logicOp = BOOL_TO_VK_BOOL32(logic_ip); + result.multiDrawIndirect = BOOL_TO_VK_BOOL32(multi_draw_indirect); + result.multiViewport = BOOL_TO_VK_BOOL32(multi_viewport); + result.occlusionQueryPrecise = BOOL_TO_VK_BOOL32(occlusion_query_precise); + result.pipelineStatisticsQuery = BOOL_TO_VK_BOOL32(pipeline_statistics_query); + result.robustBufferAccess = BOOL_TO_VK_BOOL32(robust_buffer_access); + result.samplerAnisotropy = BOOL_TO_VK_BOOL32(sampler_anisotropy); + result.sampleRateShading = BOOL_TO_VK_BOOL32(sample_rate_shading); + result.shaderClipDistance = BOOL_TO_VK_BOOL32(shader_clip_distance); + result.shaderCullDistance = BOOL_TO_VK_BOOL32(shader_cull_distance); + result.shaderFloat64 = BOOL_TO_VK_BOOL32(shader_float64); + result.shaderImageGatherExtended = BOOL_TO_VK_BOOL32(shader_image_gather_extended); + result.shaderInt16 = BOOL_TO_VK_BOOL32(shader_int16); + result.shaderInt64 = BOOL_TO_VK_BOOL32(shader_int64); + result.shaderResourceResidency = BOOL_TO_VK_BOOL32(shader_resource_residency); + result.shaderResourceMinLod = BOOL_TO_VK_BOOL32(shader_resource_min_lod); + result.shaderSampledImageArrayDynamicIndexing = BOOL_TO_VK_BOOL32(shader_sampled_image_array_dynamic_indexing); + result.shaderStorageBufferArrayDynamicIndexing = BOOL_TO_VK_BOOL32(shader_storage_buffer_array_dynamic_indexing); + result.shaderStorageImageArrayDynamicIndexing = BOOL_TO_VK_BOOL32(shader_storage_image_array_dynamic_indexing); + result.shaderStorageImageExtendedFormats = BOOL_TO_VK_BOOL32(shader_storage_image_extended_formats); + result.shaderStorageImageMultisample = BOOL_TO_VK_BOOL32(shader_storage_image_multisample); + result.shaderStorageImageReadWithoutFormat = BOOL_TO_VK_BOOL32(shader_storage_image_read_without_format); + result.shaderStorageImageWriteWithoutFormat = BOOL_TO_VK_BOOL32(shader_storage_image_write_without_format); + result.shaderTessellationAndGeometryPointSize = BOOL_TO_VK_BOOL32(shader_tessellation_and_geometry_point_size); + result.shaderUniformBufferArrayDynamicIndexing = BOOL_TO_VK_BOOL32(shader_uniform_buffer_array_dynamic_indexing); + result.sparseBinding = BOOL_TO_VK_BOOL32(sparse_binding); + result.sparseResidency2Samples = BOOL_TO_VK_BOOL32(sparse_residency_2_samples); + result.sparseResidency4Samples = BOOL_TO_VK_BOOL32(sparse_residency_4_samples); + result.sparseResidency8Samples = BOOL_TO_VK_BOOL32(sparse_residency_8_samples); + result.sparseResidency16Samples = BOOL_TO_VK_BOOL32(sparse_residency_16_samples); + result.sparseResidencyAliased = BOOL_TO_VK_BOOL32(sparse_residency_aliased); + result.sparseResidencyBuffer = BOOL_TO_VK_BOOL32(sparse_residency_buffer); + result.sparseResidencyImage2D = BOOL_TO_VK_BOOL32(sparse_residency_image_2D); + result.sparseResidencyImage3D = BOOL_TO_VK_BOOL32(sparse_residency_image_3D); + result.tessellationShader = BOOL_TO_VK_BOOL32(tessellation_shader); + result.textureCompressionASTC_LDR = BOOL_TO_VK_BOOL32(texture_compression_ASTC_LDR); + result.textureCompressionBC = BOOL_TO_VK_BOOL32(texture_compression_BC); + result.textureCompressionETC2 = BOOL_TO_VK_BOOL32(texture_compression_ETC2); + result.variableMultisampleRate = BOOL_TO_VK_BOOL32(variable_multisample_rate); + result.vertexPipelineStoresAndAtomics = BOOL_TO_VK_BOOL32(vertex_pipeline_stores_and_atomics); + result.wideLines = BOOL_TO_VK_BOOL32(wide_lines); + + return result; +} + +bool Anvil::PhysicalDeviceFeaturesCoreVK10::operator==(const Anvil::PhysicalDeviceFeaturesCoreVK10& in_data) const +{ + return (alpha_to_one == in_data.alpha_to_one) && + (depth_bias_clamp == in_data.depth_bias_clamp) && + (depth_bounds == in_data.depth_bounds) && + (depth_clamp == in_data.depth_clamp) && + (draw_indirect_first_instance == in_data.draw_indirect_first_instance) && + (dual_src_blend == in_data.dual_src_blend) && + (fill_mode_non_solid == in_data.fill_mode_non_solid) && + (fragment_stores_and_atomics == in_data.fragment_stores_and_atomics) && + (full_draw_index_uint32 == in_data.full_draw_index_uint32) && + (geometry_shader == in_data.geometry_shader) && + (image_cube_array == in_data.image_cube_array) && + (independent_blend == in_data.independent_blend) && + (inherited_queries == in_data.inherited_queries) && + (large_points == in_data.large_points) && + (logic_ip == in_data.logic_ip) && + (multi_draw_indirect == in_data.multi_draw_indirect) && + (multi_viewport == in_data.multi_viewport) && + (occlusion_query_precise == in_data.occlusion_query_precise) && + (pipeline_statistics_query == in_data.pipeline_statistics_query) && + (robust_buffer_access == in_data.robust_buffer_access) && + (sampler_anisotropy == in_data.sampler_anisotropy) && + (sample_rate_shading == in_data.sample_rate_shading) && + (shader_clip_distance == in_data.shader_clip_distance) && + (shader_cull_distance == in_data.shader_cull_distance) && + (shader_float64 == in_data.shader_float64) && + (shader_image_gather_extended == in_data.shader_image_gather_extended) && + (shader_int16 == in_data.shader_int16) && + (shader_int64 == in_data.shader_int64) && + (shader_resource_residency == in_data.shader_resource_residency) && + (shader_resource_min_lod == in_data.shader_resource_min_lod) && + (shader_sampled_image_array_dynamic_indexing == in_data.shader_sampled_image_array_dynamic_indexing) && + (shader_storage_buffer_array_dynamic_indexing == in_data.shader_storage_buffer_array_dynamic_indexing) && + (shader_storage_image_array_dynamic_indexing == in_data.shader_storage_image_array_dynamic_indexing) && + (shader_storage_image_extended_formats == in_data.shader_storage_image_extended_formats) && + (shader_storage_image_multisample == in_data.shader_storage_image_multisample) && + (shader_storage_image_read_without_format == in_data.shader_storage_image_read_without_format) && + (shader_storage_image_write_without_format == in_data.shader_storage_image_write_without_format) && + (shader_tessellation_and_geometry_point_size == in_data.shader_tessellation_and_geometry_point_size) && + (shader_uniform_buffer_array_dynamic_indexing == in_data.shader_uniform_buffer_array_dynamic_indexing) && + (sparse_binding == in_data.sparse_binding) && + (sparse_residency_2_samples == in_data.sparse_residency_2_samples) && + (sparse_residency_4_samples == in_data.sparse_residency_4_samples) && + (sparse_residency_8_samples == in_data.sparse_residency_8_samples) && + (sparse_residency_16_samples == in_data.sparse_residency_16_samples) && + (sparse_residency_aliased == in_data.sparse_residency_aliased) && + (sparse_residency_buffer == in_data.sparse_residency_buffer) && + (sparse_residency_image_2D == in_data.sparse_residency_image_2D) && + (sparse_residency_image_3D == in_data.sparse_residency_image_3D) && + (tessellation_shader == in_data.tessellation_shader) && + (texture_compression_ASTC_LDR == in_data.texture_compression_ASTC_LDR) && + (texture_compression_BC == in_data.texture_compression_BC) && + (texture_compression_ETC2 == in_data.texture_compression_ETC2) && + (variable_multisample_rate == in_data.variable_multisample_rate) && + (vertex_pipeline_stores_and_atomics == in_data.vertex_pipeline_stores_and_atomics) && + (wide_lines == in_data.wide_lines); +} + +bool Anvil::PhysicalDeviceProperties::operator==(const PhysicalDeviceProperties& in_props) const +{ + bool amd_shader_core_properties_match = false; + const bool core_vk1_0_features_match = (*core_vk1_0_properties_ptr == *in_props.core_vk1_0_properties_ptr); + bool ext_descriptor_indexing_properties_match = false; + bool khr_maintenance3_properties_match = false; + + if (amd_shader_core_properties_ptr != nullptr && + in_props.amd_shader_core_properties_ptr != nullptr) + { + amd_shader_core_properties_match = (*amd_shader_core_properties_ptr == *in_props.amd_shader_core_properties_ptr); + } + else + { + amd_shader_core_properties_match = (amd_shader_core_properties_ptr == nullptr && + in_props.amd_shader_core_properties_ptr == nullptr); + } + + if (ext_descriptor_indexing_properties_ptr != nullptr && + in_props.ext_descriptor_indexing_properties_ptr != nullptr) + { + ext_descriptor_indexing_properties_match = (*ext_descriptor_indexing_properties_ptr == *in_props.ext_descriptor_indexing_properties_ptr); + } + else + { + ext_descriptor_indexing_properties_match = (ext_descriptor_indexing_properties_ptr == nullptr && + in_props.ext_descriptor_indexing_properties_ptr == nullptr); + } + + if (khr_maintenance3_properties_ptr != nullptr && + in_props.khr_maintenance3_properties_ptr != nullptr) + { + khr_maintenance3_properties_match = (*khr_maintenance3_properties_ptr == *in_props.khr_maintenance3_properties_ptr); + } + else + { + khr_maintenance3_properties_match = (khr_maintenance3_properties_ptr == nullptr && + in_props.khr_maintenance3_properties_ptr == nullptr); + } + + return amd_shader_core_properties_match && + core_vk1_0_features_match && + ext_descriptor_indexing_properties_match && + khr_maintenance3_properties_match; +} diff --git a/src/misc/types_utils.cpp b/src/misc/types_utils.cpp new file mode 100644 index 00000000..1c9a5b62 --- /dev/null +++ b/src/misc/types_utils.cpp @@ -0,0 +1,894 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#include "misc/types.h" +#include "wrappers/device.h" + +/** Please see header for specification */ +Anvil::MemoryFeatureFlags Anvil::Utils::get_memory_feature_flags_from_vk_property_flags(VkMemoryPropertyFlags in_mem_type_flags, + VkMemoryHeapFlags in_mem_heap_flags) +{ + Anvil::MemoryFeatureFlags result = 0; + + ANVIL_REDUNDANT_ARGUMENT(in_mem_heap_flags); + + if ((in_mem_type_flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0) + { + result |= MEMORY_FEATURE_FLAG_DEVICE_LOCAL; + } + + if ((in_mem_type_flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0) + { + result |= MEMORY_FEATURE_FLAG_MAPPABLE; + } + + if ((in_mem_type_flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) != 0) + { + result |= MEMORY_FEATURE_FLAG_HOST_COHERENT; + } + + if ((in_mem_type_flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) != 0) + { + result |= MEMORY_FEATURE_FLAG_HOST_CACHED; + } + + if ((in_mem_type_flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) != 0) + { + result |= MEMORY_FEATURE_FLAG_LAZILY_ALLOCATED; + } + + return result; +} + +Anvil::MTSafety Anvil::Utils::convert_boolean_to_mt_safety_enum(bool in_mt_safe) +{ + return (in_mt_safe) ? MT_SAFETY_ENABLED + : MT_SAFETY_DISABLED; +} + +VkExternalMemoryHandleTypeFlagsKHR Anvil::Utils::convert_external_memory_handle_types_to_vk_external_memory_handle_type_flags(const Anvil::ExternalMemoryHandleTypeFlags& in_flags) +{ + ANVIL_REDUNDANT_ARGUMENT_CONST(in_flags); + anvil_assert (in_flags == 0); + + return 0; +} + +bool Anvil::Utils::convert_mt_safety_enum_to_boolean(Anvil::MTSafety in_mt_safety, + const Anvil::BaseDevice* in_device_ptr) +{ + bool result = false; + + switch (in_mt_safety) + { + case MT_SAFETY_DISABLED: result = false; break; + case MT_SAFETY_ENABLED: result = true; break; + + case MT_SAFETY_INHERIT_FROM_PARENT_DEVICE: + { + anvil_assert(in_device_ptr != nullptr); + + result = in_device_ptr->is_mt_safe(); + break; + } + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + +/** Please see header for specification */ +void Anvil::Utils::convert_queue_family_bits_to_family_indices(const Anvil::BaseDevice* in_device_ptr, + Anvil::QueueFamilyBits in_queue_families, + uint32_t* out_opt_queue_family_indices_ptr, + uint32_t* out_opt_n_queue_family_indices_ptr) +{ + uint32_t n_result_queue_family_indices(0); + + static const struct + { + Anvil::QueueFamily queue_family; + Anvil::QueueFamilyType queue_family_type; + } queue_family_data[] = + { + {Anvil::QUEUE_FAMILY_COMPUTE_BIT, Anvil::QueueFamilyType::COMPUTE}, + {Anvil::QUEUE_FAMILY_DMA_BIT, Anvil::QueueFamilyType::TRANSFER}, + {Anvil::QUEUE_FAMILY_GRAPHICS_BIT, Anvil::QueueFamilyType::UNIVERSAL}, + }; + + for (const auto& current_queue_fam_data : queue_family_data) + { + if ((in_queue_families & current_queue_fam_data.queue_family) != 0) + { + uint32_t n_queue_family_indices = 0; + const uint32_t* queue_family_indices_ptr = nullptr; + + in_device_ptr->get_queue_family_indices_for_queue_family_type(current_queue_fam_data.queue_family_type, + &n_queue_family_indices, + &queue_family_indices_ptr); + + if (out_opt_queue_family_indices_ptr != nullptr) + { + for (uint32_t n_queue_family_index = 0; + n_queue_family_index < n_queue_family_indices; + ++n_queue_family_index, ++n_result_queue_family_indices) + { + out_opt_queue_family_indices_ptr[n_result_queue_family_indices] = queue_family_indices_ptr[n_queue_family_index]; + } + } + else + { + n_result_queue_family_indices += n_queue_family_indices; + } + } + } + + if (out_opt_n_queue_family_indices_ptr != nullptr) + { + *out_opt_n_queue_family_indices_ptr = n_result_queue_family_indices; + } +} + +/** Please see header for specification */ +VkAccessFlags Anvil::Utils::get_access_mask_from_image_layout(VkImageLayout in_layout, + Anvil::QueueFamilyType in_queue_family_type) +{ + VkAccessFlags result = 0; + + switch (in_layout) + { + case VK_IMAGE_LAYOUT_UNDEFINED: + { + result = 0; + + break; + } + + case VK_IMAGE_LAYOUT_GENERAL: + { + result = VK_ACCESS_INDIRECT_COMMAND_READ_BIT | + VK_ACCESS_INDEX_READ_BIT | + VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT | + VK_ACCESS_UNIFORM_READ_BIT | + VK_ACCESS_INPUT_ATTACHMENT_READ_BIT | + VK_ACCESS_SHADER_READ_BIT | + VK_ACCESS_SHADER_WRITE_BIT | + VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | + VK_ACCESS_TRANSFER_READ_BIT | + VK_ACCESS_TRANSFER_WRITE_BIT | + VK_ACCESS_HOST_READ_BIT | + VK_ACCESS_HOST_WRITE_BIT | + VK_ACCESS_MEMORY_READ_BIT | + VK_ACCESS_MEMORY_WRITE_BIT; + + break; + } + + case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL: + { + result = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; + + break; + } + + case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL: + { + result = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; + + break; + } + + case VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL: + { + result = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT; + + break; + } + + case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL: + { + result = VK_ACCESS_SHADER_READ_BIT; + + break; + } + + case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL: + { + result = VK_ACCESS_TRANSFER_READ_BIT; + + break; + } + + case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL: + { + result = VK_ACCESS_TRANSFER_WRITE_BIT; + + break; + } + + case VK_IMAGE_LAYOUT_PREINITIALIZED: + { + result = VK_ACCESS_SHADER_READ_BIT; + + break; + } + + case VK_IMAGE_LAYOUT_PRESENT_SRC_KHR: + { + result = VK_ACCESS_MEMORY_READ_BIT; + + break; + } + + default: + { + /* Invalid VkImageLayout argument value */ + anvil_assert_fail(); + } + } + + switch (in_queue_family_type) + { + case Anvil::QueueFamilyType::COMPUTE: + { + result &= (VK_ACCESS_INDIRECT_COMMAND_READ_BIT | + VK_ACCESS_MEMORY_READ_BIT | + VK_ACCESS_MEMORY_WRITE_BIT | + VK_ACCESS_SHADER_READ_BIT | + VK_ACCESS_SHADER_WRITE_BIT | + VK_ACCESS_TRANSFER_READ_BIT | + VK_ACCESS_TRANSFER_WRITE_BIT | + VK_ACCESS_UNIFORM_READ_BIT); + + break; + } + + case Anvil::QueueFamilyType::TRANSFER: + { + result &= (VK_ACCESS_MEMORY_READ_BIT | + VK_ACCESS_MEMORY_WRITE_BIT | + VK_ACCESS_TRANSFER_READ_BIT | + VK_ACCESS_TRANSFER_WRITE_BIT); + + break; + } + + case Anvil::QueueFamilyType::UNIVERSAL: + { + result &= (VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | + VK_ACCESS_INDIRECT_COMMAND_READ_BIT | + VK_ACCESS_INDEX_READ_BIT | + VK_ACCESS_MEMORY_READ_BIT | + VK_ACCESS_MEMORY_WRITE_BIT | + VK_ACCESS_SHADER_READ_BIT | + VK_ACCESS_SHADER_WRITE_BIT | + VK_ACCESS_TRANSFER_READ_BIT | + VK_ACCESS_TRANSFER_WRITE_BIT | + VK_ACCESS_UNIFORM_READ_BIT | + VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT); + + break; + } + + case Anvil::QueueFamilyType::UNDEFINED: + { + break; + } + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + +/* Please see header for specification */ +Anvil::QueueFamilyBits Anvil::Utils::get_queue_family_bits_from_queue_family_type(Anvil::QueueFamilyType in_queue_family_type) +{ + Anvil::QueueFamilyBits result = 0; + + switch (in_queue_family_type) + { + case Anvil::QueueFamilyType::COMPUTE: result = Anvil::QUEUE_FAMILY_COMPUTE_BIT; break; + case Anvil::QueueFamilyType::TRANSFER: result = Anvil::QUEUE_FAMILY_DMA_BIT; break; + case Anvil::QueueFamilyType::UNIVERSAL: result = Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT; break; + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(Anvil::QueueFamilyType in_queue_family_type) +{ + static const char* result_strings[] = + { + "Compute", + "Transfer", + "Universal", + }; + static const uint32_t n_result_strings = sizeof(result_strings) / sizeof(result_strings[0]); + + static_assert(n_result_strings == static_cast(Anvil::QueueFamilyType::COUNT), ""); + + return result_strings[static_cast(in_queue_family_type)]; +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(VkAttachmentLoadOp in_load_op) +{ + static const char* attachment_load_op_strings[] = + { + "VK_ATTACHMENT_LOAD_OP_LOAD", + "VK_ATTACHMENT_LOAD_OP_CLEAR", + "VK_ATTACHMENT_LOAD_OP_DONT_CARE", + }; + static const uint32_t n_attachment_load_op_strings = sizeof(attachment_load_op_strings) / sizeof(attachment_load_op_strings[0]); + + static_assert(n_attachment_load_op_strings == VK_ATTACHMENT_LOAD_OP_RANGE_SIZE, ""); + anvil_assert (in_load_op <= VK_ATTACHMENT_LOAD_OP_END_RANGE); + + return attachment_load_op_strings[in_load_op]; +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(VkAttachmentStoreOp in_store_op) +{ + static const char* attachment_store_op_strings[] = + { + "VK_ATTACHMENT_STORE_OP_STORE", + "VK_ATTACHMENT_STORE_OP_DONT_CARE", + }; + static const uint32_t n_attachment_store_op_strings = sizeof(attachment_store_op_strings) / sizeof(attachment_store_op_strings[0]); + + static_assert(n_attachment_store_op_strings == VK_ATTACHMENT_STORE_OP_RANGE_SIZE, ""); + anvil_assert (in_store_op <= VK_ATTACHMENT_STORE_OP_END_RANGE); + + return attachment_store_op_strings[in_store_op]; +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(VkBlendFactor in_blend_factor) +{ + const char* result = "?"; + + switch (in_blend_factor) + { + case VK_BLEND_FACTOR_ZERO: result = "VK_BLEND_FACTOR_ZERO"; break; + case VK_BLEND_FACTOR_ONE: result = "VK_BLEND_FACTOR_ONE"; break; + case VK_BLEND_FACTOR_SRC_COLOR: result = "VK_BLEND_FACTOR_SRC_COLOR"; break; + case VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR: result = "VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR"; break; + case VK_BLEND_FACTOR_DST_COLOR: result = "VK_BLEND_FACTOR_DST_COLOR"; break; + case VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR: result = "VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR"; break; + case VK_BLEND_FACTOR_SRC_ALPHA: result = "VK_BLEND_FACTOR_SRC_ALPHA"; break; + case VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA: result = "VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA"; break; + case VK_BLEND_FACTOR_DST_ALPHA: result = "VK_BLEND_FACTOR_DST_ALPHA"; break; + case VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA: result = "VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA"; break; + case VK_BLEND_FACTOR_CONSTANT_COLOR: result = "VK_BLEND_FACTOR_CONSTANT_COLOR"; break; + case VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR: result = "VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR"; break; + case VK_BLEND_FACTOR_CONSTANT_ALPHA: result = "VK_BLEND_FACTOR_CONSTANT_ALPHA"; break; + case VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA: result = "VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA"; break; + case VK_BLEND_FACTOR_SRC_ALPHA_SATURATE: result = "VK_BLEND_FACTOR_SRC_ALPHA_SATURATE"; break; + case VK_BLEND_FACTOR_SRC1_COLOR: result = "VK_BLEND_FACTOR_SRC1_COLOR"; break; + case VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR: result = "VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR"; break; + case VK_BLEND_FACTOR_SRC1_ALPHA: result = "VK_BLEND_FACTOR_SRC1_ALPHA"; break; + case VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA: result = "VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA"; break; + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(VkBlendOp in_blend_op) +{ + const char* result = "?"; + + switch (in_blend_op) + { + case VK_BLEND_OP_ADD: result = "VK_BLEND_OP_ADD"; break; + case VK_BLEND_OP_SUBTRACT: result = "VK_BLEND_OP_SUBTRACT"; break; + case VK_BLEND_OP_REVERSE_SUBTRACT: result = "VK_BLEND_OP_REVERSE_SUBTRACT"; break; + case VK_BLEND_OP_MIN: result = "VK_BLEND_OP_MIN"; break; + case VK_BLEND_OP_MAX: result = "VK_BLEND_OP_MAX"; break; + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(VkCompareOp in_compare_op) +{ + const char* result = "?"; + + switch (in_compare_op) + { + case VK_COMPARE_OP_NEVER: result = "VK_COMPARE_OP_NEVER"; break; + case VK_COMPARE_OP_LESS: result = "VK_COMPARE_OP_LESS"; break; + case VK_COMPARE_OP_EQUAL: result = "VK_COMPARE_OP_EQUAL"; break; + case VK_COMPARE_OP_LESS_OR_EQUAL: result = "VK_COMPARE_OP_LESS_OR_EQUAL"; break; + case VK_COMPARE_OP_GREATER: result = "VK_COMPARE_OP_GREATER"; break; + case VK_COMPARE_OP_NOT_EQUAL: result = "VK_COMPARE_OP_NOT_EQUAL"; break; + case VK_COMPARE_OP_GREATER_OR_EQUAL: result = "VK_COMPARE_OP_GREATER_OR_EQUAL"; break; + case VK_COMPARE_OP_ALWAYS: result = "VK_COMPARE_OP_ALWAYS"; break; + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(VkCullModeFlagBits in_cull_mode) +{ + const char* result = "?"; + + switch (in_cull_mode) + { + case VK_CULL_MODE_NONE: result = "VK_CULL_MODE_NONE"; break; + case VK_CULL_MODE_FRONT_BIT: result = "VK_CULL_MODE_FRONT_BIT"; break; + case VK_CULL_MODE_BACK_BIT: result = "VK_CULL_MODE_BACK_BIT"; break; + case VK_CULL_MODE_FRONT_AND_BACK: result = "VK_CULL_MODE_FRONT_AND_BACK"; break; + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(VkDescriptorType in_descriptor_type) +{ + const char* result = "?"; + + switch (in_descriptor_type) + { + case VK_DESCRIPTOR_TYPE_SAMPLER: result = "VK_DESCRIPTOR_TYPE_SAMPLER"; break; + case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER: result = "VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER"; break; + case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE: result = "VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE"; break; + case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: result = "VK_DESCRIPTOR_TYPE_STORAGE_IMAGE"; break; + case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: result = "VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER"; break; + case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: result = "VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER"; break; + case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER: result = "VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER"; break; + case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: result = "VK_DESCRIPTOR_TYPE_STORAGE_BUFFER"; break; + case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: result = "VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC"; break; + case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: result = "VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC"; break; + case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT: result = "VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT"; break; + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(VkFrontFace in_front_face) +{ + const char* result = "?"; + + switch (in_front_face) + { + case VK_FRONT_FACE_COUNTER_CLOCKWISE: result = "VK_FRONT_FACE_COUNTER_CLOCKWISE"; break; + case VK_FRONT_FACE_CLOCKWISE: result = "VK_FRONT_FACE_CLOCKWISE"; break; + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(VkImageAspectFlagBits in_image_aspect_flag) +{ + const char* result = "?"; + + switch (in_image_aspect_flag) + { + case VK_IMAGE_ASPECT_COLOR_BIT: result = "VK_IMAGE_ASPECT_COLOR_BIT"; break; + case VK_IMAGE_ASPECT_DEPTH_BIT: result = "VK_IMAGE_ASPECT_DEPTH_BIT"; break; + case VK_IMAGE_ASPECT_STENCIL_BIT: result = "VK_IMAGE_ASPECT_STENCIL_BIT"; break; + case VK_IMAGE_ASPECT_METADATA_BIT: result = "VK_IMAGE_ASPECT_METADATA_BIT"; break; + + default: + { + anvil_assert_fail(); + } + } + + return result; + +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(VkImageLayout in_image_layout) +{ + const char* result = "?!"; + + /* Note: we can't use an array-based solution here because of PRESENT_SRC_KHR */ + switch (in_image_layout) + { + case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL: result = "VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL"; break; + case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL: result = "VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL"; break; + case VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL: result = "VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL"; break; + case VK_IMAGE_LAYOUT_GENERAL: result = "VK_IMAGE_LAYOUT_GENERAL"; break; + case VK_IMAGE_LAYOUT_PREINITIALIZED: result = "VK_IMAGE_LAYOUT_PREINITIALIZED"; break; + case VK_IMAGE_LAYOUT_PRESENT_SRC_KHR: result = "VK_IMAGE_LAYOUT_PRESENT_SRC_KHR"; break; + case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL: result = "VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL"; break; + case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL: result = "VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL"; break; + case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL: result = "VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL"; break; + case VK_IMAGE_LAYOUT_UNDEFINED: result = "VK_IMAGE_LAYOUT_UNDEFINED"; break; + + default: + { + anvil_assert_fail(); + + break; + } + } + + return result; +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(VkImageTiling in_image_tiling) +{ + static const char* image_tilings[] = + { + "VK_IMAGE_TILING_OPTIMAL", + "VK_IMAGE_TILING_LINEAR" + }; + static const int32_t n_image_tilings = sizeof(image_tilings) / sizeof(image_tilings[0]); + + static_assert(n_image_tilings == VK_IMAGE_TILING_RANGE_SIZE, ""); + anvil_assert (in_image_tiling < n_image_tilings); + + return image_tilings[in_image_tiling]; +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(VkImageType in_image_type) +{ + static const char* image_types[] = + { + "VK_IMAGE_TYPE_1D", + "VK_IMAGE_TYPE_2D", + "VK_IMAGE_TYPE_3D" + }; + static const uint32_t n_image_types = sizeof(image_types) / sizeof(image_types[0]); + + static_assert(n_image_types == VK_IMAGE_TYPE_RANGE_SIZE, ""); + anvil_assert (in_image_type < VK_IMAGE_TYPE_RANGE_SIZE); + + return image_types[in_image_type]; +} + +/** Please see header for specification */ +const char* Anvil::Utils::get_raw_string(VkImageViewType in_image_view_type) +{ + static const char* image_view_types[] = + { + "VK_IMAGE_VIEW_TYPE_1D", + "VK_IMAGE_VIEW_TYPE_2D", + "VK_IMAGE_VIEW_TYPE_3D", + "VK_IMAGE_VIEW_TYPE_CUBE", + "VK_IMAGE_VIEW_TYPE_1D_ARRAY", + "VK_IMAGE_VIEW_TYPE_2D_ARRAY", + "VK_IMAGE_VIEW_TYPE_CUBE_ARRAY", + }; + static const uint32_t n_image_view_types = sizeof(image_view_types) / sizeof(image_view_types[0]); + + static_assert(n_image_view_types == VK_IMAGE_VIEW_TYPE_RANGE_SIZE, ""); + anvil_assert (in_image_view_type < VK_IMAGE_VIEW_TYPE_RANGE_SIZE); + + return image_view_types[in_image_view_type]; +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(VkLogicOp in_logic_op) +{ + const char* result = "?"; + + switch (in_logic_op) + { + case VK_LOGIC_OP_CLEAR: result = "VK_LOGIC_OP_CLEAR"; break; + case VK_LOGIC_OP_AND: result = "VK_LOGIC_OP_AND"; break; + case VK_LOGIC_OP_AND_REVERSE: result = "VK_LOGIC_OP_AND_REVERSE"; break; + case VK_LOGIC_OP_COPY: result = "VK_LOGIC_OP_COPY"; break; + case VK_LOGIC_OP_AND_INVERTED: result = "VK_LOGIC_OP_AND_INVERTED"; break; + case VK_LOGIC_OP_NO_OP: result = "VK_LOGIC_OP_NO_OP"; break; + case VK_LOGIC_OP_XOR: result = "VK_LOGIC_OP_XOR"; break; + case VK_LOGIC_OP_OR: result = "VK_LOGIC_OP_OR"; break; + case VK_LOGIC_OP_NOR: result = "VK_LOGIC_OP_NOR"; break; + case VK_LOGIC_OP_EQUIVALENT: result = "VK_LOGIC_OP_EQUIVALENT"; break; + case VK_LOGIC_OP_INVERT: result = "VK_LOGIC_OP_INVERT"; break; + case VK_LOGIC_OP_OR_REVERSE: result = "VK_LOGIC_OP_OR_REVERSE"; break; + case VK_LOGIC_OP_COPY_INVERTED: result = "VK_LOGIC_OP_COPY_INVERTED"; break; + case VK_LOGIC_OP_OR_INVERTED: result = "VK_LOGIC_OP_OR_INVERTED"; break; + case VK_LOGIC_OP_NAND: result = "VK_LOGIC_OP_NAND"; break; + case VK_LOGIC_OP_SET: result = "VK_LOGIC_OP_SET"; break; + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(VkPolygonMode in_polygon_mode) +{ + const char* result = "?"; + + switch (in_polygon_mode) + { + case VK_POLYGON_MODE_FILL: result = "VK_POLYGON_MODE_FILL"; break; + case VK_POLYGON_MODE_LINE: result = "VK_POLYGON_MODE_LINE"; break; + case VK_POLYGON_MODE_POINT: result = "VK_POLYGON_MODE_POINT"; break; + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(VkPrimitiveTopology in_topology) +{ + const char* result = "?"; + + switch (in_topology) + { + case VK_PRIMITIVE_TOPOLOGY_POINT_LIST: result = "VK_PRIMITIVE_TOPOLOGY_POINT_LIST"; break; + case VK_PRIMITIVE_TOPOLOGY_LINE_LIST: result = "VK_PRIMITIVE_TOPOLOGY_LINE_LIST"; break; + case VK_PRIMITIVE_TOPOLOGY_LINE_STRIP: result = "VK_PRIMITIVE_TOPOLOGY_LINE_STRIP"; break; + case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST: result = "VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST"; break; + case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP: result = "VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP"; break; + case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN: result = "VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN"; break; + case VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY: result = "VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY"; break; + case VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY: result = "VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY"; break; + case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY: result = "VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY"; break; + case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY: result = "VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY"; break; + case VK_PRIMITIVE_TOPOLOGY_PATCH_LIST: result = "VK_PRIMITIVE_TOPOLOGY_PATCH_LIST"; break; + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(VkSampleCountFlagBits in_sample_count) +{ + const char* result = "?"; + + switch (in_sample_count) + { + case VK_SAMPLE_COUNT_1_BIT: result = "VK_SAMPLE_COUNT_1_BIT"; break; + case VK_SAMPLE_COUNT_2_BIT: result = "VK_SAMPLE_COUNT_2_BIT"; break; + case VK_SAMPLE_COUNT_4_BIT: result = "VK_SAMPLE_COUNT_4_BIT"; break; + case VK_SAMPLE_COUNT_8_BIT: result = "VK_SAMPLE_COUNT_8_BIT"; break; + case VK_SAMPLE_COUNT_16_BIT: result = "VK_SAMPLE_COUNT_16_BIT"; break; + case VK_SAMPLE_COUNT_32_BIT: result = "VK_SAMPLE_COUNT_32_BIT"; break; + case VK_SAMPLE_COUNT_64_BIT: result = "VK_SAMPLE_COUNT_64_BIT"; break; + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(Anvil::ShaderStage in_shader_stage) +{ + const char* result = "?"; + + switch (in_shader_stage) + { + case SHADER_STAGE_COMPUTE: result = "SHADER_STAGE_COMPUTE"; break; + case SHADER_STAGE_FRAGMENT: result = "SHADER_STAGE_FRAGMENT"; break; + case SHADER_STAGE_GEOMETRY: result = "SHADER_STAGE_GEOMETRY"; break; + case SHADER_STAGE_TESSELLATION_CONTROL: result = "SHADER_STAGE_TESSELLATION_CONTROL"; break; + case SHADER_STAGE_TESSELLATION_EVALUATION: result = "SHADER_STAGE_TESSELLATION_EVALUATION"; break; + case SHADER_STAGE_VERTEX: result = "SHADER_STAGE_VERTEX"; break; + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(VkShaderStageFlagBits in_shader_stage) +{ + const char* result = "?"; + + switch (in_shader_stage) + { + case VK_SHADER_STAGE_ALL_GRAPHICS: result = "VK_SHADER_STAGE_ALL_GRAPHICS"; break; + case VK_SHADER_STAGE_COMPUTE_BIT: result = "VK_SHADER_STAGE_COMPUTE_BIT"; break; + case VK_SHADER_STAGE_FRAGMENT_BIT: result = "VK_SHADER_STAGE_FRAGMENT_BIT"; break; + case VK_SHADER_STAGE_GEOMETRY_BIT: result = "VK_SHADER_STAGE_GEOMETRY_BIT"; break; + case VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT: result = "VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT"; break; + case VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT: result = "VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT"; break; + case VK_SHADER_STAGE_VERTEX_BIT: result = "VK_SHADER_STAGE_VERTEX_BIT"; break; + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(VkSharingMode in_sharing_mode) +{ + static const char* sharing_modes[] = + { + "VK_SHARING_MODE_EXCLUSIVE", + "VK_SHARING_MODE_CONCURRENT" + }; + static const int32_t n_sharing_modes = sizeof(sharing_modes) / sizeof(sharing_modes[0]); + + static_assert(n_sharing_modes == VK_SHARING_MODE_RANGE_SIZE, ""); + anvil_assert (in_sharing_mode < n_sharing_modes); + + return sharing_modes[in_sharing_mode]; +} + +/* Please see header for specification */ +const char* Anvil::Utils::get_raw_string(VkStencilOp in_stencil_op) +{ + const char* result = "?"; + + switch (in_stencil_op) + { + case VK_STENCIL_OP_KEEP: result = "VK_STENCIL_OP_KEEP"; break; + case VK_STENCIL_OP_ZERO: result = "VK_STENCIL_OP_ZERO"; break; + case VK_STENCIL_OP_REPLACE: result = "VK_STENCIL_OP_REPLACE"; break; + case VK_STENCIL_OP_INCREMENT_AND_CLAMP: result = "VK_STENCIL_OP_INCREMENT_AND_CLAMP"; break; + case VK_STENCIL_OP_DECREMENT_AND_CLAMP: result = "VK_STENCIL_OP_DECREMENT_AND_CLAMP"; break; + case VK_STENCIL_OP_INVERT: result = "VK_STENCIL_OP_INVERT"; break; + case VK_STENCIL_OP_INCREMENT_AND_WRAP: result = "VK_STENCIL_OP_INCREMENT_AND_WRAP"; break; + case VK_STENCIL_OP_DECREMENT_AND_WRAP: result = "VK_STENCIL_OP_DECREMENT_AND_WRAP"; break; + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + +/* Please see header for specification */ +VkShaderStageFlagBits Anvil::Utils::get_shader_stage_flag_bits_from_shader_stage(Anvil::ShaderStage in_shader_stage) +{ + VkShaderStageFlagBits result = VK_SHADER_STAGE_FLAG_BITS_MAX_ENUM; + + switch (in_shader_stage) + { + case Anvil::ShaderStage::SHADER_STAGE_COMPUTE: result = VK_SHADER_STAGE_COMPUTE_BIT; break; + case Anvil::ShaderStage::SHADER_STAGE_FRAGMENT: result = VK_SHADER_STAGE_FRAGMENT_BIT; break; + case Anvil::ShaderStage::SHADER_STAGE_GEOMETRY: result = VK_SHADER_STAGE_GEOMETRY_BIT; break; + case Anvil::ShaderStage::SHADER_STAGE_TESSELLATION_CONTROL: result = VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT; break; + case Anvil::ShaderStage::SHADER_STAGE_TESSELLATION_EVALUATION: result = VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT; break; + case Anvil::ShaderStage::SHADER_STAGE_VERTEX: result = VK_SHADER_STAGE_VERTEX_BIT; break; + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + +/* Please see header for specification */ +void Anvil::Utils::get_vk_property_flags_from_memory_feature_flags(Anvil::MemoryFeatureFlags in_mem_feature_flags, + VkMemoryPropertyFlags* out_mem_type_flags_ptr, + VkMemoryHeapFlags* out_mem_heap_flags_ptr) +{ + VkMemoryHeapFlags result_mem_heap_flags = 0; + VkMemoryPropertyFlags result_mem_type_flags = 0; + + if ((in_mem_feature_flags & MEMORY_FEATURE_FLAG_DEVICE_LOCAL) != 0) + { + result_mem_type_flags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; + } + + if ((in_mem_feature_flags & MEMORY_FEATURE_FLAG_MAPPABLE) != 0) + { + result_mem_type_flags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT; + } + + if ((in_mem_feature_flags & MEMORY_FEATURE_FLAG_HOST_COHERENT) != 0) + { + result_mem_type_flags |= VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; + } + + if ((in_mem_feature_flags & MEMORY_FEATURE_FLAG_HOST_CACHED) != 0) + { + result_mem_type_flags |= VK_MEMORY_PROPERTY_HOST_CACHED_BIT; + } + + if ((in_mem_feature_flags & MEMORY_FEATURE_FLAG_LAZILY_ALLOCATED) != 0) + { + result_mem_type_flags |= VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT; + } + + *out_mem_heap_flags_ptr = result_mem_heap_flags; + *out_mem_type_flags_ptr = result_mem_type_flags; +} diff --git a/src/misc/window.cpp b/src/misc/window.cpp index 1ee05e88..98123052 100644 --- a/src/misc/window.cpp +++ b/src/misc/window.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/misc/window_factory.cpp b/src/misc/window_factory.cpp index 73f6c340..6797eb0d 100644 --- a/src/misc/window_factory.cpp +++ b/src/misc/window_factory.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/misc/window_win3264.cpp b/src/misc/window_win3264.cpp index 879c47cd..678c10f4 100644 --- a/src/misc/window_win3264.cpp +++ b/src/misc/window_win3264.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/wrappers/buffer.cpp b/src/wrappers/buffer.cpp index 06aed601..1b8c1c83 100644 --- a/src/wrappers/buffer.cpp +++ b/src/wrappers/buffer.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -20,6 +20,7 @@ // THE SOFTWARE. // +#include "misc/buffer_create_info.h" #include "misc/debug.h" #include "misc/object_tracker.h" #include "misc/struct_chainer.h" @@ -32,115 +33,104 @@ #include "wrappers/physical_device.h" #include "wrappers/queue.h" -/* Please see header for specification */ -Anvil::Buffer::Buffer(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - VkSharingMode in_queue_sharing_mode, - VkBufferUsageFlags in_usage_flags, - Anvil::SparseResidencyScope in_residency_scope, - bool in_mt_safe) +Anvil::Buffer::Buffer(Anvil::BufferCreateInfoUniquePtr in_create_info_ptr) :CallbacksSupportProvider (BUFFER_CALLBACK_ID_COUNT), - DebugMarkerSupportProvider(in_device_ptr, + DebugMarkerSupportProvider(in_create_info_ptr->get_device(), VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT), - MTSafetySupportProvider (in_mt_safe), - m_buffer (VK_NULL_HANDLE), - m_buffer_size (in_size), - m_create_flags (0), - m_device_ptr (in_device_ptr), - m_is_sparse (true), - m_memory_block_ptr (nullptr), - m_parent_buffer_ptr (nullptr), - m_queue_families (in_queue_families), - m_residency_scope (in_residency_scope), - m_sharing_mode (in_queue_sharing_mode), - m_start_offset (0) + MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), + in_create_info_ptr->get_device () )), + m_buffer (VK_NULL_HANDLE), + m_create_flags (0), + m_memory_block_ptr(nullptr) { - switch (in_residency_scope) + switch (in_create_info_ptr->get_type() ) { - case Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED: m_create_flags = VK_BUFFER_CREATE_SPARSE_ALIASED_BIT | VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT | VK_BUFFER_CREATE_SPARSE_BINDING_BIT; break; - case Anvil::SPARSE_RESIDENCY_SCOPE_NONALIASED: m_create_flags = VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT | VK_BUFFER_CREATE_SPARSE_BINDING_BIT; break; - case Anvil::SPARSE_RESIDENCY_SCOPE_NONE: m_create_flags = VK_BUFFER_CREATE_SPARSE_BINDING_BIT; break; + case BufferType::NONSPARSE_ALLOC: + { + /* Nothing to do */ + break; + } - default: + case BufferType::NONSPARSE_NO_ALLOC: { - anvil_assert_fail(); + if ((in_create_info_ptr->get_memory_features() & MEMORY_FEATURE_FLAG_MAPPABLE) == 0) + { + /* For host->gpu writes to work in this case, we will need the buffer to work as a target + * for buffer->buffer copy operations. Same goes for the other way around. + */ + auto usage_flags = in_create_info_ptr->get_usage_flags(); + + usage_flags |= static_cast(VK_BUFFER_USAGE_TRANSFER_DST_BIT | + VK_BUFFER_USAGE_TRANSFER_SRC_BIT); + + in_create_info_ptr->set_usage_flags(usage_flags); + } + + break; } - } - /* Assume the user may try to bind memory from non-mappable memory heap, in which case - * we're going to need to copy data from a staging buffer to this buffer if the user - * ever uses write(), and vice versa. */ - m_usage_flags = static_cast(in_usage_flags | - VK_BUFFER_USAGE_TRANSFER_DST_BIT | - VK_BUFFER_USAGE_TRANSFER_SRC_BIT); -} + case BufferType::NONSPARSE_NO_ALLOC_CHILD: + { + m_create_flags = in_create_info_ptr->get_parent_buffer_ptr()->m_create_flags; -/* Please see header for specification */ -Anvil::Buffer::Buffer(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_queue_sharing_mode, - VkBufferUsageFlags in_usage_flags, - Anvil::MemoryFeatureFlags in_memory_features, - bool in_mt_safe) - :CallbacksSupportProvider (BUFFER_CALLBACK_ID_COUNT), - DebugMarkerSupportProvider(in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT), - MTSafetySupportProvider (in_mt_safe), - m_buffer (VK_NULL_HANDLE), - m_buffer_size (in_size), - m_create_flags (0), - m_device_ptr (in_device_ptr), - m_is_sparse (false), - m_memory_block_ptr (nullptr), - m_parent_buffer_ptr (nullptr), - m_queue_families (in_queue_families), - m_residency_scope (Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED), - m_sharing_mode (in_queue_sharing_mode), - m_start_offset (0), - m_usage_flags (static_cast(in_usage_flags) ) -{ - /* Sanity checks */ - if ((in_memory_features & MEMORY_FEATURE_FLAG_MAPPABLE) == 0) - { - anvil_assert((in_memory_features & MEMORY_FEATURE_FLAG_HOST_COHERENT) == 0) + in_create_info_ptr->set_usage_flags(in_create_info_ptr->get_usage_flags() ); - /* For host->gpu writes to work in this case, we will need the buffer to work as a target - * for buffer->buffer copy operations. Same goes for the other way around. - */ - m_usage_flags |= static_cast(m_usage_flags | VK_BUFFER_USAGE_TRANSFER_DST_BIT - | VK_BUFFER_USAGE_TRANSFER_SRC_BIT); - } -} + break; + } -/* Please see header for specification */ -Anvil::Buffer::Buffer(Anvil::Buffer* in_parent_buffer_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size) - :CallbacksSupportProvider (BUFFER_CALLBACK_ID_COUNT), - DebugMarkerSupportProvider(in_parent_buffer_ptr->m_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT), - MTSafetySupportProvider (false), - m_buffer (VK_NULL_HANDLE), - m_buffer_size (in_size), - m_create_flags (0), - m_device_ptr (nullptr), - m_is_sparse (false), - m_memory_block_ptr (nullptr), - m_parent_buffer_ptr (in_parent_buffer_ptr), - m_residency_scope (Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED), - m_sharing_mode (VK_SHARING_MODE_MAX_ENUM), - m_start_offset (in_start_offset) -{ - /* Sanity checks */ - anvil_assert(in_parent_buffer_ptr != nullptr); - anvil_assert(in_size > 0); + case BufferType::SPARSE_NO_ALLOC: + { + switch (in_create_info_ptr->get_residency_scope() ) + { + case Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED: + { + m_create_flags = VK_BUFFER_CREATE_SPARSE_ALIASED_BIT | VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT | VK_BUFFER_CREATE_SPARSE_BINDING_BIT; + + break; + } + + case Anvil::SPARSE_RESIDENCY_SCOPE_NONALIASED: + { + m_create_flags = VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT | VK_BUFFER_CREATE_SPARSE_BINDING_BIT; + + break; + } + + case Anvil::SPARSE_RESIDENCY_SCOPE_NONE: + { + m_create_flags = VK_BUFFER_CREATE_SPARSE_BINDING_BIT; + + break; + } - anvil_assert(!in_parent_buffer_ptr->is_sparse() ); + default: + { + anvil_assert_fail(); + } + } + + /* Assume the user may try to bind memory from non-mappable memory heap, in which case + * we're going to need to copy data from a staging buffer to this buffer if the user + * ever uses write(), and vice versa. */ + { + auto usage_flags = in_create_info_ptr->get_usage_flags(); + + usage_flags |= static_cast(VK_BUFFER_USAGE_TRANSFER_DST_BIT | + VK_BUFFER_USAGE_TRANSFER_SRC_BIT); + + in_create_info_ptr->set_usage_flags(usage_flags); + } + + break; + } - m_create_flags = in_parent_buffer_ptr->m_create_flags; - m_usage_flags = in_parent_buffer_ptr->m_usage_flags; + default: + { + anvil_assert_fail(); + } + } + + m_create_info_ptr = std::move(in_create_info_ptr); } @@ -151,8 +141,8 @@ Anvil::Buffer::~Buffer() Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_BUFFER, this); - if (m_buffer != VK_NULL_HANDLE && - m_parent_buffer_ptr == nullptr) + if (m_buffer != VK_NULL_HANDLE && + m_create_info_ptr->get_parent_buffer_ptr() == nullptr) { lock(); { @@ -164,92 +154,22 @@ Anvil::Buffer::~Buffer() m_buffer = VK_NULL_HANDLE; } - - m_parent_buffer_ptr = nullptr; } -/** Please see header for specification */ -Anvil::BufferUniquePtr Anvil::Buffer::create_nonsparse(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - VkSharingMode in_queue_sharing_mode, - VkBufferUsageFlags in_usage_flags, - MTSafety in_mt_safety) +Anvil::BufferUniquePtr Anvil::Buffer::create(Anvil::BufferCreateInfoUniquePtr in_create_info_ptr) { - const auto is_mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); Anvil::BufferUniquePtr new_buffer_ptr(nullptr, std::default_delete() ); new_buffer_ptr.reset( - new Anvil::Buffer(in_device_ptr, - in_size, - in_queue_families, - in_queue_sharing_mode, - in_usage_flags, - 0, /* in_memory_features */ - is_mt_safe) + new Anvil::Buffer(std::move(in_create_info_ptr) ) ); - /* Initialize */ - new_buffer_ptr->create_buffer(in_queue_families, - in_queue_sharing_mode, - in_size); - - /* Register the object */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_BUFFER, - new_buffer_ptr.get() ); - - return new_buffer_ptr; -} - -/** Please see header for specification */ -Anvil::BufferUniquePtr Anvil::Buffer::create_nonsparse(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - VkSharingMode in_queue_sharing_mode, - VkBufferUsageFlags in_usage_flags, - Anvil::MemoryFeatureFlags in_memory_features, - const void* in_opt_client_data, - MTSafety in_mt_safety) -{ - const auto is_mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - Anvil::BufferUniquePtr new_buffer_ptr = Anvil::BufferUniquePtr(nullptr, - std::default_delete() ); - - new_buffer_ptr.reset( - new Anvil::Buffer(in_device_ptr, - in_size, - in_queue_families, - in_queue_sharing_mode, - in_usage_flags, - in_memory_features, - is_mt_safe) - ); - - /* Initialize */ - new_buffer_ptr->create_buffer(in_queue_families, - in_queue_sharing_mode, - in_size); - - /* Create a memory object and preallocate as much space as we need */ + if (new_buffer_ptr != nullptr) { - auto memory_block_ptr = Anvil::MemoryBlock::create(in_device_ptr, - new_buffer_ptr->m_buffer_memory_reqs.memoryTypeBits, - new_buffer_ptr->m_buffer_memory_reqs.size, - in_memory_features, - in_mt_safety); - - new_buffer_ptr->set_nonsparse_memory( - std::move(memory_block_ptr) - ); - - if (in_opt_client_data != nullptr) + if (!new_buffer_ptr->init() ) { - new_buffer_ptr->write(0, - in_size, - in_opt_client_data); + new_buffer_ptr.reset(); } } @@ -260,179 +180,22 @@ Anvil::BufferUniquePtr Anvil::Buffer::create_nonsparse(const Anvil::BaseDevice* return new_buffer_ptr; } -/** Please see header for specification */ -Anvil::BufferUniquePtr Anvil::Buffer::create_nonsparse(Anvil::Buffer* in_parent_nonsparse_buffer_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size) +bool Anvil::Buffer::do_external_memory_handle_type_sanity_checks() const { - Anvil::BufferUniquePtr new_buffer_ptr(nullptr, - std::default_delete() ); - - if (in_parent_nonsparse_buffer_ptr->is_sparse() ) - { - anvil_assert(!in_parent_nonsparse_buffer_ptr->is_sparse() ); - - goto end; - } - - new_buffer_ptr.reset( - new Anvil::Buffer(in_parent_nonsparse_buffer_ptr, - in_start_offset, - in_size) - ); - - /* Initialize */ + const auto& external_memory_handle_types = m_create_info_ptr->get_external_memory_handle_types(); + bool result = true; - anvil_assert(in_parent_nonsparse_buffer_ptr->get_memory_block(0 /* in_n_memory_block */) != nullptr); - - new_buffer_ptr->m_owned_memory_blocks.push_back( - Anvil::MemoryBlock::create_derived(in_parent_nonsparse_buffer_ptr->get_memory_block(0 /* in_n_memory_block */), - in_start_offset, - in_size) - ); - - new_buffer_ptr->m_buffer = in_parent_nonsparse_buffer_ptr->m_buffer; - new_buffer_ptr->m_memory_block_ptr = new_buffer_ptr->m_owned_memory_blocks.back().get(); - new_buffer_ptr->m_queue_families = in_parent_nonsparse_buffer_ptr->get_queue_families(); - new_buffer_ptr->m_sharing_mode = in_parent_nonsparse_buffer_ptr->get_sharing_mode (); - new_buffer_ptr->m_usage_flags = in_parent_nonsparse_buffer_ptr->get_usage (); - - anvil_assert(new_buffer_ptr->m_memory_block_ptr != nullptr); - - /* Register the object */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_BUFFER, - new_buffer_ptr.get() ); - -end: - return new_buffer_ptr; -} - -/** Please see header for specification */ -Anvil::BufferUniquePtr Anvil::Buffer::create_sparse(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - VkSharingMode in_queue_sharing_mode, - VkBufferUsageFlags in_usage_flags, - Anvil::SparseResidencyScope in_residency_scope, - MTSafety in_mt_safety) -{ - const auto is_mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); - const auto& physical_device_features(in_device_ptr->get_physical_device_features () ); - Anvil::BufferUniquePtr result_ptr (nullptr, - std::default_delete() ); - - /* Sanity checks */ - if (!physical_device_features.core_vk1_0_features_ptr->sparse_binding) + if (external_memory_handle_types != 0) { - anvil_assert(physical_device_features.core_vk1_0_features_ptr->sparse_binding); - - goto end; - } - - if ((in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED || - in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_NONALIASED) && - !physical_device_features.core_vk1_0_features_ptr->sparse_residency_buffer) - { - anvil_assert((in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED || - in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_NONALIASED) && - physical_device_features.core_vk1_0_features_ptr->sparse_residency_buffer); - - goto end; - } - - if ( in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED && - !physical_device_features.core_vk1_0_features_ptr->sparse_residency_aliased) - { - anvil_assert(in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED && - physical_device_features.core_vk1_0_features_ptr->sparse_residency_aliased); + if (!m_device_ptr->supports_external_memory_handles(external_memory_handle_types) ) + { + anvil_assert(!m_device_ptr->supports_external_memory_handles(external_memory_handle_types) ); - goto end; + result = false; + } } - result_ptr.reset( - new Anvil::Buffer(in_device_ptr, - in_size, - in_queue_families, - in_queue_sharing_mode, - in_usage_flags, - in_residency_scope, - is_mt_safe) - ); - - /* Initialize */ - result_ptr->create_buffer(in_queue_families, - in_queue_sharing_mode, - in_size); - - result_ptr->m_page_tracker_ptr.reset( - new Anvil::PageTracker(Anvil::Utils::round_up(in_size, - result_ptr->m_buffer_memory_reqs.alignment), - result_ptr->m_buffer_memory_reqs.alignment) - ); - - /* Register the object */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_BUFFER, - result_ptr.get() ); - -end: - return result_ptr; -} - - - -/* Creates a new Vulkan buffer object and caches memory requirements for the created buffer. - * - * @param in_queue_families Queue families the buffer needs to support. - * @param in_sharing_mode Sharing mode the buffer needs to support. - * @param in_size Size of the buffer. - **/ -void Anvil::Buffer::create_buffer(Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - VkDeviceSize in_size) -{ - VkBufferCreateInfo buffer_create_info; - uint32_t n_queue_family_indices; - uint32_t queue_family_indices[8]; - VkResult result(VK_ERROR_INITIALIZATION_FAILED); - - ANVIL_REDUNDANT_VARIABLE(result); - - /* Determine which queues the buffer should be available to. */ - Anvil::Utils::convert_queue_family_bits_to_family_indices(m_device_ptr, - in_queue_families, - queue_family_indices, - &n_queue_family_indices); - - anvil_assert(n_queue_family_indices > 0); - anvil_assert(n_queue_family_indices < sizeof(queue_family_indices) / sizeof(queue_family_indices[0]) ); - - /* Prepare the create info structure */ - buffer_create_info.flags = m_create_flags; - buffer_create_info.pNext = nullptr; - buffer_create_info.pQueueFamilyIndices = queue_family_indices; - buffer_create_info.queueFamilyIndexCount = n_queue_family_indices; - buffer_create_info.sharingMode = (n_queue_family_indices == 1) ? VK_SHARING_MODE_EXCLUSIVE : in_sharing_mode; - buffer_create_info.size = in_size; - buffer_create_info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO; - buffer_create_info.usage = m_usage_flags; - - /* Create the buffer object */ - result = vkCreateBuffer(m_device_ptr->get_device_vk(), - &buffer_create_info, - nullptr, /* pAllocator */ - &m_buffer); - anvil_assert_vk_call_succeeded(result); - - if (is_vk_call_successful(result) ) - { - set_vk_handle(m_buffer); - - /* Cache buffer data memory requirements */ - vkGetBufferMemoryRequirements(m_device_ptr->get_device_vk(), - m_buffer, - &m_buffer_memory_reqs); - } + return result; } /* Please see header for specification */ @@ -441,7 +204,7 @@ const Anvil::Buffer* Anvil::Buffer::get_base_buffer() const Anvil::Buffer* result_ptr = this; Anvil::Buffer* parent_ptr = nullptr; - if ( (parent_ptr = result_ptr->get_parent_buffer_ptr()) != nullptr) + if ( (parent_ptr = result_ptr->get_create_info_ptr()->get_parent_buffer_ptr()) != nullptr) { result_ptr = parent_ptr; } @@ -452,7 +215,7 @@ const Anvil::Buffer* Anvil::Buffer::get_base_buffer() /* Please see header for specification */ VkBuffer Anvil::Buffer::get_buffer() { - if (!m_is_sparse) + if (get_create_info_ptr()->get_type() != Anvil::BufferType::SPARSE_NO_ALLOC) { if (m_memory_block_ptr == nullptr) { @@ -466,9 +229,10 @@ VkBuffer Anvil::Buffer::get_buffer() /* Please see header for specification */ Anvil::MemoryBlock* Anvil::Buffer::get_memory_block(uint32_t in_n_memory_block) { - bool is_callback_needed = false; + bool is_callback_needed = false; + const auto is_sparse = (get_create_info_ptr()->get_type() == Anvil::BufferType::SPARSE_NO_ALLOC); - if (m_is_sparse) + if (is_sparse) { IsBufferMemoryAllocPendingQueryCallbackArgument callback_arg(this); @@ -486,13 +250,13 @@ Anvil::MemoryBlock* Anvil::Buffer::get_memory_block(uint32_t in_n_memory_block) { OnMemoryBlockNeededForBufferCallbackArgument callback_argument(this); - anvil_assert(m_parent_buffer_ptr == nullptr); + anvil_assert(m_create_info_ptr->get_parent_buffer_ptr() == nullptr); callback_safe(BUFFER_CALLBACK_ID_MEMORY_BLOCK_NEEDED, &callback_argument); } - if (m_is_sparse) + if (is_sparse) { return m_page_tracker_ptr->get_memory_block(in_n_memory_block); } @@ -500,21 +264,203 @@ Anvil::MemoryBlock* Anvil::Buffer::get_memory_block(uint32_t in_n_memory_block) { return m_memory_block_ptr; } - } -/* Please see header for specification */ -VkDeviceSize Anvil::Buffer::get_size() const +VkMemoryRequirements Anvil::Buffer::get_memory_requirements() const { - anvil_assert(m_buffer_size != 0); + auto parent_buffer_ptr = m_create_info_ptr->get_parent_buffer_ptr(); + + if (parent_buffer_ptr != nullptr) + { + return parent_buffer_ptr->get_memory_requirements(); + } + else + { + return m_buffer_memory_reqs; + } +} - return m_buffer_size; +uint32_t Anvil::Buffer::get_n_memory_blocks() const +{ + if (m_create_info_ptr->get_type() == Anvil::BufferType::SPARSE_NO_ALLOC) + { + return m_page_tracker_ptr->get_n_memory_blocks(); + } + else + { + return 1; + } } -/* Please see header for specification */ -VkDeviceSize Anvil::Buffer::get_start_offset() const +bool Anvil::Buffer::init() { - return m_start_offset; + uint32_t n_queue_family_indices; + uint32_t queue_family_indices [8]; + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + Anvil::StructChainer struct_chainer; + + if ( m_create_info_ptr->get_client_data () != nullptr && + (m_create_info_ptr->get_memory_features() & Anvil::MEMORY_FEATURE_FLAG_MAPPABLE) == 0) + { + m_create_info_ptr->set_usage_flags(m_create_info_ptr->get_usage_flags() | VK_BUFFER_USAGE_TRANSFER_DST_BIT); + } + + if (m_create_info_ptr->get_type() != BufferType::NONSPARSE_NO_ALLOC_CHILD) + { + if (!do_external_memory_handle_type_sanity_checks() ) + { + goto end; + } + + /* Determine which queues the buffer should be available to. */ + Anvil::Utils::convert_queue_family_bits_to_family_indices(m_device_ptr, + m_create_info_ptr->get_queue_families(), + queue_family_indices, + &n_queue_family_indices); + + anvil_assert(n_queue_family_indices > 0); + anvil_assert(n_queue_family_indices < sizeof(queue_family_indices) / sizeof(queue_family_indices[0]) ); + + /* Prepare the create info structure */ + { + VkBufferCreateInfo buffer_create_info; + + buffer_create_info.flags = m_create_flags; + buffer_create_info.pNext = nullptr; + buffer_create_info.pQueueFamilyIndices = queue_family_indices; + buffer_create_info.queueFamilyIndexCount = n_queue_family_indices; + buffer_create_info.sharingMode = (n_queue_family_indices == 1) ? VK_SHARING_MODE_EXCLUSIVE : m_create_info_ptr->get_sharing_mode(); + buffer_create_info.size = m_create_info_ptr->get_size(); + buffer_create_info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO; + buffer_create_info.usage = m_create_info_ptr->get_usage_flags(); + + struct_chainer.append_struct(buffer_create_info); + } + + { + const auto& external_memory_handle_types = m_create_info_ptr->get_external_memory_handle_types(); + + if (external_memory_handle_types != 0) + { + VkExternalMemoryBufferCreateInfoKHR external_memory_buffer_create_info; + + external_memory_buffer_create_info.handleTypes = Anvil::Utils::convert_external_memory_handle_types_to_vk_external_memory_handle_type_flags(external_memory_handle_types); + external_memory_buffer_create_info.pNext = nullptr; + external_memory_buffer_create_info.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR; + + struct_chainer.append_struct(external_memory_buffer_create_info); + } + } + + /* Create the buffer object */ + { + auto struct_chain_ptr = struct_chainer.create_chain(); + + result = vkCreateBuffer(m_device_ptr->get_device_vk(), + struct_chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_buffer); + } + + anvil_assert_vk_call_succeeded(result); + if (is_vk_call_successful(result) ) + { + set_vk_handle(m_buffer); + + /* Cache buffer data memory requirements */ + vkGetBufferMemoryRequirements(m_device_ptr->get_device_vk(), + m_buffer, + &m_buffer_memory_reqs); + } + } + else + { + m_buffer = m_create_info_ptr->get_parent_buffer_ptr()->m_buffer; + + anvil_assert(m_buffer != VK_NULL_HANDLE); + if (m_buffer != VK_NULL_HANDLE) + { + result = VK_SUCCESS; + } + } + + switch (m_create_info_ptr->get_type() ) + { + case Anvil::BufferType::NONSPARSE_ALLOC: + { + /* Create a memory object and preallocate as much space as we need */ + auto client_data_ptr = m_create_info_ptr->get_client_data(); + auto memory_block_ptr = Anvil::MemoryBlock::create(m_create_info_ptr->get_device(), + m_buffer_memory_reqs.memoryTypeBits, + m_buffer_memory_reqs.size, + m_create_info_ptr->get_memory_features(), + m_create_info_ptr->get_mt_safety () ); + + if (!set_nonsparse_memory( std::move(memory_block_ptr) )) + { + anvil_assert_fail(); + + result = VK_ERROR_INITIALIZATION_FAILED; + + goto end; + } + + if (client_data_ptr != nullptr) + { + if (!write(0, /* in_start_offset */ + m_create_info_ptr->get_size(), + client_data_ptr) ) + { + anvil_assert_fail(); + + result = VK_ERROR_INITIALIZATION_FAILED; + + goto end; + } + } + + break; + } + + case Anvil::BufferType::NONSPARSE_NO_ALLOC_CHILD: + { + m_owned_memory_blocks.push_back( + Anvil::MemoryBlock::create_derived(m_create_info_ptr->get_parent_buffer_ptr()->get_memory_block(0 /* in_n_memory_block */), + m_create_info_ptr->get_start_offset(), + m_create_info_ptr->get_size() ) + ); + + m_memory_block_ptr = m_owned_memory_blocks.back().get(); + anvil_assert(m_memory_block_ptr != nullptr); + + break; + } + + case BufferType::NONSPARSE_NO_ALLOC: + { + /* No special action needed */ + break; + } + + case BufferType::SPARSE_NO_ALLOC: + { + m_page_tracker_ptr.reset( + new Anvil::PageTracker(Anvil::Utils::round_up(m_create_info_ptr->get_size(), + m_buffer_memory_reqs.alignment), + m_buffer_memory_reqs.alignment) + ); + + break; + } + + default: + { + anvil_assert_fail(); + } + } + +end: + return is_vk_call_successful(result); } /* Please see header for specification */ @@ -538,10 +484,10 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, auto memory_block_ptr (get_memory_block(0 /* in_n_memory_block */) ); bool result (false); - ANVIL_REDUNDANT_ARGUMENT_CONST(in_physical_device_ptr); + ANVIL_REDUNDANT_ARGUMENT(in_physical_device_ptr); /* TODO: Support for sparse buffers */ - anvil_assert(!is_sparse()); + anvil_assert(m_create_info_ptr->get_type() != Anvil::BufferType::SPARSE_NO_ALLOC); if ((memory_block_ptr->get_memory_features() & MEMORY_FEATURE_FLAG_MAPPABLE) != 0) { @@ -568,15 +514,18 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, goto end; } - staging_buffer_ptr = Anvil::Buffer::create_nonsparse( - m_device_ptr, - in_size, - staging_buffer_queue_fam_bits, - VK_SHARING_MODE_CONCURRENT, - VK_BUFFER_USAGE_TRANSFER_DST_BIT, - MEMORY_FEATURE_FLAG_MAPPABLE, - nullptr, - MT_SAFETY_DISABLED); /* in_mt_safe */ + { + auto buffer_create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr, + in_size, + staging_buffer_queue_fam_bits, + VK_SHARING_MODE_CONCURRENT, + VK_BUFFER_USAGE_TRANSFER_DST_BIT, + MEMORY_FEATURE_FLAG_MAPPABLE); + + buffer_create_info_ptr->set_mt_safety(MT_SAFETY_DISABLED); + + staging_buffer_ptr = Anvil::Buffer::create(std::move(buffer_create_info_ptr) ); + } if (staging_buffer_ptr == nullptr) { @@ -590,7 +539,6 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, copy_cmdbuf_ptr->start_recording(true, /* one_time_submit */ false); /* simultaneous_use_allowed */ } - { Anvil::BufferBarrier buffer_barrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, @@ -598,7 +546,7 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, VK_QUEUE_FAMILY_IGNORED, staging_buffer_ptr.get(), 0, /* in_offset */ - staging_buffer_ptr->get_size() ); + staging_buffer_ptr->get_create_info_ptr()->get_size() ); VkBufferCopy copy_region; copy_region.dstOffset = 0; @@ -636,10 +584,16 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, return result; } -bool Anvil::Buffer::set_memory_nonsparse_internal(MemoryBlockUniquePtr in_memory_block_ptr) +bool Anvil::Buffer::set_memory_nonsparse_internal(MemoryBlockUniquePtr in_memory_block_ptr, + uint32_t in_n_physical_devices, + const Anvil::PhysicalDevice* in_physical_devices_ptr) { - bool result (false); - VkResult result_vk; + const Anvil::DeviceType device_type (m_device_ptr->get_type() ); + bool result (false); + VkResult result_vk; + + ANVIL_REDUNDANT_ARGUMENT(in_physical_devices_ptr); + if (in_memory_block_ptr == nullptr) { @@ -655,13 +609,19 @@ bool Anvil::Buffer::set_memory_nonsparse_internal(MemoryBlockUniquePtr in_memory goto end; } - if (m_is_sparse) + if (m_create_info_ptr->get_type() == Anvil::BufferType::SPARSE_NO_ALLOC) { - anvil_assert(!m_is_sparse); + anvil_assert(m_create_info_ptr->get_type() != Anvil::BufferType::SPARSE_NO_ALLOC); goto end; } + if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU && + in_n_physical_devices == 0) + { + in_n_physical_devices = 1; + } + /* Bind the memory object to the buffer object */ lock(); { @@ -698,7 +658,7 @@ bool Anvil::Buffer::set_memory_sparse(MemoryBlock* in_memory_block_ptr, VkDeviceSize in_start_offset, VkDeviceSize in_size) { - anvil_assert(m_is_sparse); + anvil_assert(m_create_info_ptr->get_type() == Anvil::BufferType::SPARSE_NO_ALLOC); if (m_page_tracker_ptr->set_binding(in_memory_block_ptr, in_memory_block_start_offset, @@ -751,7 +711,49 @@ bool Anvil::Buffer::set_nonsparse_memory(MemoryBlock* in_memory_block_ptr, }); } - return set_memory_nonsparse_internal(std::move(memory_block_ptr) ); + return set_memory_nonsparse_internal(std::move(memory_block_ptr), + 0, /* n_physical_devices */ + nullptr); /* physical_devices_ptr */ +} + +/* Please see header for specification */ +bool Anvil::Buffer::set_nonsparse_memory(MemoryBlockUniquePtr in_memory_block_ptr, + uint32_t in_n_physical_devices, + const Anvil::PhysicalDevice* in_physical_devices_ptr) +{ + MemoryBlockUniquePtr memory_block_ptr = MemoryBlockUniquePtr(in_memory_block_ptr.release(), + std::default_delete() ); + + return set_memory_nonsparse_internal(std::move(memory_block_ptr), + in_n_physical_devices, + in_physical_devices_ptr); +} + +/* Please see header for specification */ +bool Anvil::Buffer::set_nonsparse_memory(MemoryBlock* in_memory_block_ptr, + bool in_memory_block_owned_by_buffer, + uint32_t in_n_physical_devices, + const Anvil::PhysicalDevice* in_physical_devices_ptr) +{ + MemoryBlockUniquePtr memory_block_ptr; + + if (in_memory_block_owned_by_buffer) + { + memory_block_ptr = MemoryBlockUniquePtr(in_memory_block_ptr, + std::default_delete() ); + } + else + { + memory_block_ptr = MemoryBlockUniquePtr(in_memory_block_ptr, + [](MemoryBlock*) + { + /* Stub */ + }); + } + + return set_memory_nonsparse_internal(std::move(memory_block_ptr), + in_n_physical_devices, + in_physical_devices_ptr); } /* Please see header for specification */ @@ -779,10 +781,11 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, ANVIL_REDUNDANT_ARGUMENT(in_physical_device_ptr); + /** TODO: Support for sparse-resident buffers whose n_memory_blocks > 1 */ Anvil::MemoryBlock* memory_block_ptr(get_memory_block(0) ); - if (m_is_sparse) + if (m_create_info_ptr->get_type() == Anvil::BufferType::SPARSE_NO_ALLOC) { anvil_assert(m_page_tracker_ptr->get_n_memory_blocks() == 1); } @@ -801,19 +804,20 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, /* The buffer memory is not mappable. We need to create a staging memory, * upload user's data there, and then issue a copy op. */ Anvil::PrimaryCommandBufferUniquePtr copy_cmdbuf_ptr; + const auto queue_fams = m_create_info_ptr->get_queue_families(); Anvil::Queue* queue_ptr = nullptr; Anvil::BufferUniquePtr staging_buffer_ptr; Anvil::QueueFamilyBits staging_buffer_queue_fam_bits = 0; - if (m_sharing_mode == VK_SHARING_MODE_EXCLUSIVE) + if (m_create_info_ptr->get_sharing_mode() == VK_SHARING_MODE_EXCLUSIVE) { /* We need to use a user-specified queue, since we can't tell which queue fam the buffer is currently configured to be compatible with. * * This can be worked around if the buffer can only be used with a specific queue family type. */ - if (Anvil::Utils::is_pow2(m_queue_families) ) + if (Anvil::Utils::is_pow2(queue_fams) ) { - switch (m_queue_families) + switch (queue_fams) { case Anvil::QUEUE_FAMILY_COMPUTE_BIT: queue_ptr = m_device_ptr->get_compute_queue (0); break; case Anvil::QUEUE_FAMILY_DMA_BIT: queue_ptr = m_device_ptr->get_transfer_queue (0); break; @@ -849,20 +853,20 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, else { /* We can use any queue from the list of queue fams this buffer is compatible, in order to perform the copy op. */ - if ((m_queue_families & Anvil::QUEUE_FAMILY_GRAPHICS_BIT) != 0) + if ((queue_fams & Anvil::QUEUE_FAMILY_GRAPHICS_BIT) != 0) { queue_ptr = m_device_ptr->get_universal_queue(0); staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_GRAPHICS_BIT; } else - if ((m_queue_families & Anvil::QUEUE_FAMILY_DMA_BIT) != 0) + if ((queue_fams & Anvil::QUEUE_FAMILY_DMA_BIT) != 0) { queue_ptr = m_device_ptr->get_transfer_queue(0); staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_DMA_BIT; } else { - anvil_assert((m_queue_families & Anvil::QUEUE_FAMILY_COMPUTE_BIT) != 0) + anvil_assert((queue_fams & Anvil::QUEUE_FAMILY_COMPUTE_BIT) != 0) queue_ptr = m_device_ptr->get_compute_queue(0); staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_COMPUTE_BIT; @@ -878,15 +882,19 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, goto end; } - staging_buffer_ptr = Anvil::Buffer::create_nonsparse( - m_device_ptr, - in_size, - staging_buffer_queue_fam_bits, - VK_SHARING_MODE_CONCURRENT, - VK_BUFFER_USAGE_TRANSFER_SRC_BIT, - Anvil::MEMORY_FEATURE_FLAG_MAPPABLE, - in_data, - MT_SAFETY_DISABLED); + { + auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr, + in_size, + staging_buffer_queue_fam_bits, + VK_SHARING_MODE_CONCURRENT, + VK_BUFFER_USAGE_TRANSFER_SRC_BIT, + Anvil::MEMORY_FEATURE_FLAG_MAPPABLE); + + create_info_ptr->set_client_data(in_data); + create_info_ptr->set_mt_safety (MT_SAFETY_DISABLED); + + staging_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); + } if (staging_buffer_ptr == nullptr) { @@ -900,7 +908,6 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, copy_cmdbuf_ptr->start_recording(true, /* one_time_submit */ false); /* simultaneous_use_allowed */ } - { BufferBarrier buffer_barrier(VK_ACCESS_HOST_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT, @@ -908,7 +915,7 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, VK_QUEUE_FAMILY_IGNORED, staging_buffer_ptr.get(), 0, /* in_offset */ - staging_buffer_ptr->get_size() ); + staging_buffer_ptr->get_create_info_ptr()->get_size() ); VkBufferCopy copy_region; copy_region.dstOffset = in_start_offset; diff --git a/src/wrappers/buffer_view.cpp b/src/wrappers/buffer_view.cpp index 328ec3c0..ee7e54cc 100644 --- a/src/wrappers/buffer_view.cpp +++ b/src/wrappers/buffer_view.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -20,6 +20,7 @@ // THE SOFTWARE. // +#include "misc/buffer_view_create_info.h" #include "misc/debug.h" #include "misc/object_tracker.h" #include "wrappers/buffer.h" @@ -27,45 +28,17 @@ #include "wrappers/device.h" /** Please see header for specification */ -Anvil::BufferView::BufferView(const Anvil::BaseDevice* in_device_ptr, - Anvil::Buffer* in_buffer_ptr, - VkFormat in_format, - VkDeviceSize in_start_offset, - VkDeviceSize in_size, - bool in_mt_safe) - :DebugMarkerSupportProvider(in_device_ptr, +Anvil::BufferView::BufferView(Anvil::BufferViewCreateInfoUniquePtr in_create_info_ptr) + :DebugMarkerSupportProvider(in_create_info_ptr->get_device(), VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT), - MTSafetySupportProvider (in_mt_safe), - m_buffer_ptr (in_buffer_ptr), - m_device_ptr (in_device_ptr), - m_format (in_format), - m_size (in_size), - m_start_offset(in_start_offset) + MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), + in_create_info_ptr->get_device () )) { - VkBufferViewCreateInfo buffer_view_create_info; - VkResult result (VK_ERROR_INITIALIZATION_FAILED); - - ANVIL_REDUNDANT_VARIABLE(result); - - /* Spawn a new Vulkan buffer view */ - buffer_view_create_info.buffer = in_buffer_ptr->get_buffer(); - buffer_view_create_info.flags = 0; - buffer_view_create_info.format = in_format; - buffer_view_create_info.offset = in_start_offset; - buffer_view_create_info.pNext = nullptr; - buffer_view_create_info.range = in_size; - buffer_view_create_info.sType = VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO; + m_create_info_ptr = std::move(in_create_info_ptr); - result = vkCreateBufferView(in_device_ptr->get_device_vk(), - &buffer_view_create_info, - nullptr, /* pAllocator */ - &m_buffer_view); - - anvil_assert_vk_call_succeeded(result); - if (is_vk_call_successful(result) ) - { - set_vk_handle(m_buffer_view); - } + /* Register the buffer view instance */ + Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_BUFFER_VIEW, + this); } /** Destructor. @@ -89,33 +62,55 @@ Anvil::BufferView::~BufferView() m_buffer_view = VK_NULL_HANDLE; } -/** Please see header for specification */ -Anvil::BufferViewUniquePtr Anvil::BufferView::create(const Anvil::BaseDevice* in_device_ptr, - Anvil::Buffer* in_buffer_ptr, - VkFormat in_format, - VkDeviceSize in_start_offset, - VkDeviceSize in_size, - MTSafety in_mt_safety) +Anvil::BufferViewUniquePtr Anvil::BufferView::create(Anvil::BufferViewCreateInfoUniquePtr in_create_info_ptr) { - const bool is_mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - BufferViewUniquePtr result_ptr = BufferViewUniquePtr(nullptr, - std::default_delete() ); + Anvil::BufferViewUniquePtr result_ptr(nullptr, + std::default_delete() ); - /* Instantiate the object */ result_ptr.reset( - new BufferView( - in_device_ptr, - in_buffer_ptr, - in_format, - in_start_offset, - in_size, - is_mt_safe) + new Anvil::BufferView(std::move(in_create_info_ptr) ) ); - /* Register the buffer view instance */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_BUFFER_VIEW, - result_ptr.get() ); + if (result_ptr != nullptr) + { + if (!result_ptr->init() ) + { + result_ptr.reset(); + } + } return result_ptr; -} \ No newline at end of file +} + +bool Anvil::BufferView::init() +{ + VkBufferViewCreateInfo buffer_view_create_info; + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + + ANVIL_REDUNDANT_VARIABLE(result); + + /* Spawn a new Vulkan buffer view */ + buffer_view_create_info.buffer = m_create_info_ptr->get_parent_buffer()->get_buffer(); + buffer_view_create_info.flags = 0; + buffer_view_create_info.format = m_create_info_ptr->get_format (); + buffer_view_create_info.offset = m_create_info_ptr->get_start_offset(); + buffer_view_create_info.pNext = nullptr; + buffer_view_create_info.range = m_create_info_ptr->get_size(); + buffer_view_create_info.sType = VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO; + + result = vkCreateBufferView(m_create_info_ptr->get_device()->get_device_vk(), + &buffer_view_create_info, + nullptr, /* pAllocator */ + &m_buffer_view); + + if (is_vk_call_successful(result) ) + { + anvil_assert_vk_call_succeeded(result); + if (is_vk_call_successful(result) ) + { + set_vk_handle(m_buffer_view); + } + } + + return is_vk_call_successful(result); +} diff --git a/src/wrappers/command_buffer.cpp b/src/wrappers/command_buffer.cpp index 6760d41c..b7c9fba9 100644 --- a/src/wrappers/command_buffer.cpp +++ b/src/wrappers/command_buffer.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -20,10 +20,9 @@ // THE SOFTWARE. // -#include "misc/base_pipeline_info.h" #include "misc/callbacks.h" #include "misc/debug.h" -#include "misc/descriptor_set_info.h" +#include "misc/descriptor_set_create_info.h" #include "misc/struct_chainer.h" #include "wrappers/buffer.h" #include "wrappers/buffer_view.h" @@ -61,13 +60,12 @@ Anvil::CommandBufferBase::BeginQueryCommand::BeginQueryCommand(Anvil::QueryPool* } /** Please see header for specification */ -Anvil::BeginRenderPassCommand::BeginRenderPassCommand(uint32_t in_n_clear_values, - const VkClearValue* in_clear_value_ptrs, - Anvil::Framebuffer* in_fbo_ptr, - const Anvil::PhysicalDevice* in_physical_device_ptr, - const VkRect2D& in_render_area, - Anvil::RenderPass* in_render_pass_ptr, - VkSubpassContents in_contents) +Anvil::BeginRenderPassCommand::BeginRenderPassCommand(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + const VkRect2D& in_render_area, + Anvil::RenderPass* in_render_pass_ptr, + VkSubpassContents in_contents) :Command(COMMAND_TYPE_BEGIN_RENDER_PASS) { contents = in_contents; @@ -81,8 +79,6 @@ Anvil::BeginRenderPassCommand::BeginRenderPassCommand(uint32_t { clear_values.push_back(in_clear_value_ptrs[n_clear_value]); } - - physical_device_ptr = in_physical_device_ptr; } /** Please see header for specification */ @@ -788,10 +784,10 @@ Anvil::CommandBufferBase::SetViewportCommand::SetViewportCommand(uint32_t } /** Please see header for specification */ -Anvil::CommandBufferBase::UpdateBufferCommand::UpdateBufferCommand(Anvil::Buffer* in_dst_buffer_ptr, - VkDeviceSize in_dst_offset, - VkDeviceSize in_data_size, - const uint32_t* in_data_ptr) +Anvil::CommandBufferBase::UpdateBufferCommand::UpdateBufferCommand(Anvil::Buffer* in_dst_buffer_ptr, + VkDeviceSize in_dst_offset, + VkDeviceSize in_data_size, + const void* in_data_ptr) :Command(COMMAND_TYPE_UPDATE_BUFFER) { data_ptr = in_data_ptr; @@ -981,8 +977,6 @@ bool Anvil::CommandBufferBase::record_bind_descriptor_sets(VkPipelineBindPoint auto dss_vk = std::vector(in_set_count); bool result = false; - anvil_assert(in_set_count < sizeof(dss_vk) / sizeof(dss_vk[0]) ); - for (uint32_t n_set = 0; n_set < in_set_count; ++n_set) @@ -1741,7 +1735,7 @@ bool Anvil::CommandBufferBase::record_debug_marker_begin_EXT(const std::string& } #endif - anvil_assert(m_device_ptr->is_ext_debug_marker_extension_enabled() ); + anvil_assert(m_device_ptr->get_extension_info()->ext_debug_marker() ); if (in_opt_color != nullptr) { @@ -1786,7 +1780,7 @@ bool Anvil::CommandBufferBase::record_debug_marker_end_EXT() goto end; } - anvil_assert(m_device_ptr->is_ext_debug_marker_extension_enabled() ); + anvil_assert(m_device_ptr->get_extension_info()->ext_debug_marker() ); #ifdef STORE_COMMAND_BUFFER_COMMANDS @@ -1824,7 +1818,7 @@ bool Anvil::CommandBufferBase::record_debug_marker_insert_EXT(const std::string& goto end; } - anvil_assert(m_device_ptr->is_ext_debug_marker_extension_enabled() ); + anvil_assert(m_device_ptr->get_extension_info()->ext_debug_marker() ); #ifdef STORE_COMMAND_BUFFER_COMMANDS @@ -2093,7 +2087,7 @@ bool Anvil::CommandBufferBase::record_draw_indexed_indirect_count_AMD(Anvil::Buf goto end; } - anvil_assert(m_device_ptr->is_amd_draw_indirect_count_extension_enabled() ); + anvil_assert(m_device_ptr->get_extension_info()->amd_draw_indirect_count() ); #ifdef STORE_COMMAND_BUFFER_COMMANDS @@ -2207,7 +2201,7 @@ bool Anvil::CommandBufferBase::record_draw_indirect_count_AMD(Anvil::Buffer* in_ goto end; } - anvil_assert(m_device_ptr->is_amd_draw_indirect_count_extension_enabled() ); + anvil_assert(m_device_ptr->get_extension_info()->amd_draw_indirect_count() ); #ifdef STORE_COMMAND_BUFFER_COMMANDS @@ -2635,6 +2629,7 @@ bool Anvil::CommandBufferBase::record_resolve_image(Anvil::Image* in_src return result; } + /* Please see header for specification */ bool Anvil::CommandBufferBase::record_set_blend_constants(const float in_blend_constants[4]) { @@ -2756,7 +2751,8 @@ bool Anvil::CommandBufferBase::record_set_depth_bounds(float in_min_depth_bounds bool Anvil::CommandBufferBase::record_set_event(Anvil::Event* in_event_ptr, VkPipelineStageFlags in_stage_mask) { - bool result = false; + const Anvil::DeviceType device_type = m_device_ptr->get_type(); + bool result = false; if (m_is_renderpass_active) { @@ -3035,10 +3031,10 @@ bool Anvil::CommandBufferBase::record_set_viewport(uint32_t in_first_vi } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_update_buffer(Anvil::Buffer* in_dst_buffer_ptr, - VkDeviceSize in_dst_offset, - VkDeviceSize in_data_size, - const uint32_t* in_data_ptr) +bool Anvil::CommandBufferBase::record_update_buffer(Anvil::Buffer* in_dst_buffer_ptr, + VkDeviceSize in_dst_offset, + VkDeviceSize in_data_size, + const void* in_data_ptr) { bool result = false; @@ -3240,12 +3236,14 @@ bool Anvil::CommandBufferBase::reset(bool in_should_release_resources) goto end; } + m_parent_command_pool_ptr->lock(); lock(); { result_vk = vkResetCommandBuffer(m_command_buffer, (in_should_release_resources) ? VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT : 0u); } unlock(); + m_parent_command_pool_ptr->unlock(); if (!is_vk_call_successful(result_vk) ) { @@ -3338,12 +3336,10 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t i Anvil::RenderPass* in_render_pass_ptr, VkSubpassContents in_contents) { - const Anvil::PhysicalDevice* physical_device_ptr = nullptr; + const Anvil::DeviceType device_type = m_device_ptr->get_type(); Anvil::StructChainer render_pass_begin_info_chain; bool result = false; - ANVIL_REDUNDANT_VARIABLE(physical_device_ptr); - if (m_is_renderpass_active) { anvil_assert(!m_is_renderpass_active); @@ -3358,14 +3354,6 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t i goto end; } - { - const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr) ); - - anvil_assert(sgpu_device_ptr != nullptr); /* User attempted to call this function prototype with in_n_physical_devices set to 0 */ - - physical_device_ptr = sgpu_device_ptr->get_physical_device(); - } - #ifdef STORE_COMMAND_BUFFER_COMMANDS { if (!m_command_stashing_disabled) @@ -3373,7 +3361,6 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t i m_commands.push_back(BeginRenderPassCommand(in_n_clear_values, in_clear_value_ptrs, in_fbo_ptr, - physical_device_ptr, in_render_area, in_render_pass_ptr, in_contents) ); diff --git a/src/wrappers/command_pool.cpp b/src/wrappers/command_pool.cpp index 06f81a26..4bbf8f28 100644 --- a/src/wrappers/command_pool.cpp +++ b/src/wrappers/command_pool.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -170,7 +170,7 @@ bool Anvil::CommandPool::reset(bool in_release_resources) /* Please see header for specification */ void Anvil::CommandPool::trim() { - if (m_device_ptr->is_khr_maintenance1_extension_enabled() ) + if (m_device_ptr->get_extension_info()->khr_maintenance1() ) { lock(); { @@ -182,6 +182,6 @@ void Anvil::CommandPool::trim() } else { - anvil_assert(m_device_ptr->is_khr_maintenance1_extension_enabled() ); + anvil_assert(m_device_ptr->get_extension_info()->khr_maintenance1() ); } } \ No newline at end of file diff --git a/src/wrappers/compute_pipeline_manager.cpp b/src/wrappers/compute_pipeline_manager.cpp index ce297199..079e491f 100644 --- a/src/wrappers/compute_pipeline_manager.cpp +++ b/src/wrappers/compute_pipeline_manager.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -20,7 +20,7 @@ // THE SOFTWARE. // -#include "misc/compute_pipeline_info.h" +#include "misc/compute_pipeline_create_info.h" #include "misc/debug.h" #include "misc/object_tracker.h" #include "wrappers/compute_pipeline_manager.h" @@ -111,7 +111,7 @@ bool Anvil::ComputePipelineManager::bake() { auto current_pipeline_id = pipeline_iterator->first; Pipeline* current_pipeline_ptr = pipeline_iterator->second.get(); - const auto current_pipeline_info_ptr = current_pipeline_ptr->pipeline_info_ptr.get(); + const auto current_pipeline_create_info_ptr = current_pipeline_ptr->pipeline_create_info_ptr.get(); VkComputePipelineCreateInfo pipeline_create_info; const Anvil::ShaderModuleStageEntryPoint* shader_stage_entry_point_ptr = nullptr; const unsigned char* specialization_constants_data_buffer_ptr = nullptr; @@ -126,9 +126,9 @@ bool Anvil::ComputePipelineManager::bake() anvil_assert(current_pipeline_ptr->layout_ptr != nullptr); } - current_pipeline_info_ptr->get_specialization_constants(Anvil::SHADER_STAGE_COMPUTE, - &specialization_constants_ptr, - &specialization_constants_data_buffer_ptr); + current_pipeline_create_info_ptr->get_specialization_constants(Anvil::SHADER_STAGE_COMPUTE, + &specialization_constants_ptr, + &specialization_constants_data_buffer_ptr); if (specialization_constants_ptr->size() > 0) { @@ -139,7 +139,7 @@ bool Anvil::ComputePipelineManager::bake() } /* Prepare the Vulkan create info descriptor & store it in the map for later baking */ - const auto current_pipeline_base_pipeline_id = current_pipeline_info_ptr->get_base_pipeline_id(); + const auto current_pipeline_base_pipeline_id = current_pipeline_create_info_ptr->get_base_pipeline_id(); if (current_pipeline_base_pipeline_id != UINT32_MAX) { @@ -156,7 +156,7 @@ bool Anvil::ComputePipelineManager::bake() auto& pipeline_vector = layout_to_bake_item_map[pipeline_create_info.layout]; auto base_pipeline_iterator = std::find(pipeline_vector.begin(), pipeline_vector.end(), - current_pipeline_ptr->pipeline_info_ptr->get_base_pipeline_id() ); + current_pipeline_ptr->pipeline_create_info_ptr->get_base_pipeline_id() ); if (base_pipeline_iterator != pipeline_vector.end() ) { @@ -187,8 +187,8 @@ bool Anvil::ComputePipelineManager::bake() anvil_assert(current_pipeline_ptr->layout_ptr != nullptr); - current_pipeline_info_ptr->get_shader_stage_properties(Anvil::SHADER_STAGE_COMPUTE, - &shader_stage_entry_point_ptr); + current_pipeline_create_info_ptr->get_shader_stage_properties(Anvil::SHADER_STAGE_COMPUTE, + &shader_stage_entry_point_ptr); pipeline_create_info.flags = 0; pipeline_create_info.layout = current_pipeline_ptr->layout_ptr->get_pipeline_layout(); @@ -212,8 +212,8 @@ bool Anvil::ComputePipelineManager::bake() pipeline_create_info.flags |= VK_PIPELINE_CREATE_DERIVATIVE_BIT; } - pipeline_create_info.flags |= ((current_pipeline_info_ptr->allows_derivatives () ) ? VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT : 0) | - ((current_pipeline_info_ptr->has_optimizations_disabled() ) ? VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT : 0); + pipeline_create_info.flags |= ((current_pipeline_create_info_ptr->allows_derivatives () ) ? VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT : 0) | + ((current_pipeline_create_info_ptr->has_optimizations_disabled() ) ? VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT : 0); layout_to_bake_item_map[pipeline_create_info.layout].push_back(BakeItem(pipeline_create_info, current_pipeline_id, diff --git a/src/wrappers/descriptor_pool.cpp b/src/wrappers/descriptor_pool.cpp index e7666698..16a62b54 100644 --- a/src/wrappers/descriptor_pool.cpp +++ b/src/wrappers/descriptor_pool.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -21,7 +21,7 @@ // #include "misc/debug.h" -#include "misc/descriptor_set_info.h" +#include "misc/descriptor_set_create_info.h" #include "misc/object_tracker.h" #include "misc/struct_chainer.h" #include "wrappers/descriptor_pool.h" @@ -132,9 +132,11 @@ bool Anvil::DescriptorPool::alloc_descriptor_sets(uint32_t VkDescriptorSet* out_descriptor_sets_vk_ptr, VkResult* out_opt_result_ptr) { - bool result (false); + bool result (false); VkResult result_vk; + bool should_chain_variable_descriptor_count_struct(false); Anvil::StructChainer struct_chainer; + std::vector variable_descriptor_counts; lock(); { @@ -146,6 +148,27 @@ bool Anvil::DescriptorPool::alloc_descriptor_sets(uint32_t { if (in_ds_allocations_ptr[n_set].ds_layout_ptr != nullptr) { + auto ds_create_info_ptr = in_ds_allocations_ptr[n_set].ds_layout_ptr->get_create_info(); + + if (ds_create_info_ptr->contains_variable_descriptor_count_binding() ) + { + if ((m_flags & Anvil::DESCRIPTOR_POOL_FLAG_CREATE_UPDATE_AFTER_BIND_BIT) != 0) + { + anvil_assert_fail(); + + result = false; + goto end; + } + + should_chain_variable_descriptor_count_struct = true; + + variable_descriptor_counts.push_back(in_ds_allocations_ptr[n_set].n_variable_descriptor_bindings); + } + else + { + variable_descriptor_counts.push_back(0); + } + m_ds_layout_cache[n_set] = in_ds_allocations_ptr[n_set].ds_layout_ptr->get_layout(); } else @@ -167,6 +190,20 @@ bool Anvil::DescriptorPool::alloc_descriptor_sets(uint32_t struct_chainer.append_struct(ds_alloc_info); } + if (should_chain_variable_descriptor_count_struct) + { + VkDescriptorSetVariableDescriptorCountAllocateInfoEXT variable_descriptor_count_struct; + + anvil_assert(variable_descriptor_counts.size() == in_n_sets); + + variable_descriptor_count_struct.descriptorSetCount = in_n_sets; + variable_descriptor_count_struct.pDescriptorCounts = &variable_descriptor_counts.at(0); + variable_descriptor_count_struct.pNext = nullptr; + variable_descriptor_count_struct.sType = static_cast(VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT); + + struct_chainer.append_struct(variable_descriptor_count_struct); + } + { auto chain_ptr = struct_chainer.create_chain(); @@ -184,6 +221,7 @@ bool Anvil::DescriptorPool::alloc_descriptor_sets(uint32_t result = is_vk_call_successful(result_vk); +end: return result; } @@ -227,6 +265,16 @@ bool Anvil::DescriptorPool::init() bool result (false); VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); + if ((m_flags & Anvil::DESCRIPTOR_POOL_FLAG_CREATE_UPDATE_AFTER_BIND_BIT) != 0) + { + if (!m_device_ptr->get_extension_info()->ext_descriptor_indexing() ) + { + anvil_assert_fail(); + + goto end; + } + } + /* Convert the counters to an arrayed, linear representation */ for (uint32_t n_descriptor_type = 0; n_descriptor_type < VK_DESCRIPTOR_TYPE_RANGE_SIZE; @@ -244,7 +292,8 @@ bool Anvil::DescriptorPool::init() } /* Set up the descriptor pool instance */ - descriptor_pool_create_info.flags = ((m_flags & Anvil::DESCRIPTOR_POOL_FLAG_CREATE_FREE_DESCRIPTOR_SET_BIT) ? VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT : 0u); + descriptor_pool_create_info.flags = ((m_flags & Anvil::DESCRIPTOR_POOL_FLAG_CREATE_FREE_DESCRIPTOR_SET_BIT) ? VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT : 0u) | + ((m_flags & Anvil::DESCRIPTOR_POOL_FLAG_CREATE_UPDATE_AFTER_BIND_BIT) ? VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT : 0u); descriptor_pool_create_info.maxSets = m_n_max_sets; descriptor_pool_create_info.pNext = nullptr; descriptor_pool_create_info.poolSizeCount = n_descriptor_types_used; diff --git a/src/wrappers/descriptor_set.cpp b/src/wrappers/descriptor_set.cpp index 2e10f88f..ccbbe2ad 100644 --- a/src/wrappers/descriptor_set.cpp +++ b/src/wrappers/descriptor_set.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -20,8 +20,9 @@ // THE SOFTWARE. // +#include "misc/buffer_create_info.h" #include "misc/debug.h" -#include "misc/descriptor_set_info.h" +#include "misc/descriptor_set_create_info.h" #include "misc/object_tracker.h" #include "wrappers/buffer.h" #include "wrappers/buffer_view.h" @@ -142,7 +143,7 @@ Anvil::DescriptorSet::BufferBindingElement::BufferBindingElement(Anvil::Buffer* if (in_size != VK_WHOLE_SIZE) { - anvil_assert(in_start_offset + in_size <= in_buffer_ptr->get_size() ); + anvil_assert(in_start_offset + in_size <= in_buffer_ptr->get_create_info_ptr()->get_size() ); } buffer_ptr = in_buffer_ptr; @@ -159,7 +160,9 @@ Anvil::DescriptorSet::BufferBindingElement::~BufferBindingElement() /** Please see header for specification */ Anvil::DescriptorSet::BufferBindingElement::BufferBindingElement(const BufferBindingElement& in) { - buffer_ptr = in.buffer_ptr; + buffer_ptr = in.buffer_ptr; + size = in.size; + start_offset = in.start_offset; } /** Please see header for specification */ @@ -296,11 +299,17 @@ Anvil::DescriptorSet::~DescriptorSet() **/ void Anvil::DescriptorSet::alloc_bindings() { - const auto layout_info_ptr = m_layout_ptr->get_info (); - const uint32_t n_bindings = layout_info_ptr->get_n_bindings(); + const auto layout_info_ptr = m_layout_ptr->get_create_info(); + bool has_variable_descriptor_count_binding = false; + const uint32_t n_bindings = layout_info_ptr->get_n_bindings(); + uint32_t variable_descriptor_count_binding_index = UINT32_MAX; + uint32_t variable_descriptor_count_binding_size = 0; m_cached_ds_write_items_vk.resize(n_bindings); + has_variable_descriptor_count_binding = layout_info_ptr->contains_variable_descriptor_count_binding(&variable_descriptor_count_binding_index, + &variable_descriptor_count_binding_size); + for (uint32_t n_binding = 0; n_binding < n_bindings; ++n_binding) @@ -313,7 +322,14 @@ void Anvil::DescriptorSet::alloc_bindings() nullptr, /* out_opt_descriptor_type_ptr */ &array_size, nullptr, /* out_opt_stage_flags_ptr */ - nullptr); /* out_opt_immutable_samplers_enabled_ptr */ + nullptr, /* out_opt_immutable_samplers_enabled_ptr */ + nullptr); /* out_opt_flags_ptr */ + + if (has_variable_descriptor_count_binding && + binding_index == variable_descriptor_count_binding_index) + { + array_size = variable_descriptor_count_binding_size; + } if (m_bindings[binding_index].size() != array_size) { @@ -359,8 +375,8 @@ void Anvil::DescriptorSet::fill_buffer_info_vk_descriptor(const Anvil::Descripto } else { - out_descriptor_ptr->offset = in_binding_item.buffer_ptr->get_start_offset(); - out_descriptor_ptr->range = in_binding_item.buffer_ptr->get_size (); + out_descriptor_ptr->offset = in_binding_item.buffer_ptr->get_create_info_ptr()->get_start_offset(); + out_descriptor_ptr->range = in_binding_item.buffer_ptr->get_create_info_ptr()->get_size (); } } @@ -647,7 +663,7 @@ bool Anvil::DescriptorSet::update(const DescriptorSetUpdateMethod& in_update_met /* Please see header for specification */ bool Anvil::DescriptorSet::update_using_core_method() const { - const auto layout_info_ptr = m_layout_ptr->get_info(); + const auto layout_info_ptr = m_layout_ptr->get_create_info(); bool result = false; anvil_assert(!m_unusable); @@ -683,6 +699,7 @@ bool Anvil::DescriptorSet::update_using_core_method() const n_binding < n_bindings; ++n_binding) { + Anvil::DescriptorBindingFlags current_binding_flags = 0; uint32_t current_binding_index; VkDescriptorType descriptor_type; bool immutable_samplers_enabled = false; @@ -696,7 +713,8 @@ bool Anvil::DescriptorSet::update_using_core_method() const &descriptor_type, nullptr, /* out_opt_descriptor_array_size_ptr */ nullptr, /* out_opt_stage_flags_ptr */ - &immutable_samplers_enabled) ) + &immutable_samplers_enabled, + ¤t_binding_flags) ) { anvil_assert_fail(); } @@ -755,6 +773,14 @@ bool Anvil::DescriptorSet::update_using_core_method() const } else { + /* Arrayed bindings are only permitted if the binding has been created with the PARTIALLY_BOUND flag */ + if ((current_binding_flags & Anvil::DESCRIPTOR_BINDING_FLAG_PARTIALLY_BOUND_BIT) == 0) + { + anvil_assert_fail(); + + goto end; + } + /* Need to cache a write item at this point since current binding has not been assigned a descriptor */ needs_write_item = true; } @@ -810,18 +836,21 @@ bool Anvil::DescriptorSet::update_using_core_method() const } result = true; + +end: + return result; } bool Anvil::DescriptorSet::update_using_template_method() const { std::vector data_vector; - const auto layout_info_ptr = m_layout_ptr->get_info(); + const auto layout_info_ptr = m_layout_ptr->get_create_info(); bool result = false; - if (!m_device_ptr->is_khr_descriptor_update_template_extension_enabled() ) + if (!m_device_ptr->get_extension_info()->khr_descriptor_update_template() ) { - anvil_assert(m_device_ptr->is_khr_descriptor_update_template_extension_enabled() ); + anvil_assert(m_device_ptr->get_extension_info()->khr_descriptor_update_template() ); goto end; } @@ -854,7 +883,8 @@ bool Anvil::DescriptorSet::update_using_template_method() const &descriptor_type, nullptr, /* out_opt_descriptor_array_size_ptr */ nullptr, /* out_opt_stage_flags_ptr */ - &immutable_samplers_enabled) ) + &immutable_samplers_enabled, + nullptr) ) /* out_opt_flags_ptr */ { anvil_assert_fail(); diff --git a/src/wrappers/descriptor_set_group.cpp b/src/wrappers/descriptor_set_group.cpp index 61c6f5f2..bb4b54e6 100644 --- a/src/wrappers/descriptor_set_group.cpp +++ b/src/wrappers/descriptor_set_group.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -32,17 +32,19 @@ #include /* Please see header for specification */ -Anvil::DescriptorSetGroup::DescriptorSetGroup(const Anvil::BaseDevice* in_device_ptr, - std::vector in_ds_info_ptrs, - bool in_releaseable_sets, - MTSafety in_mt_safety, - const std::vector& in_opt_overhead_allocations) - :MTSafetySupportProvider(Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ), - m_device_ptr (in_device_ptr), - m_n_unique_dses (0), - m_parent_dsg_ptr (nullptr), - m_releaseable_sets (in_releaseable_sets) +Anvil::DescriptorSetGroup::DescriptorSetGroup(const Anvil::BaseDevice* in_device_ptr, + std::vector in_ds_create_info_ptrs, + bool in_releaseable_sets, + MTSafety in_mt_safety, + const std::vector& in_opt_overhead_allocations, + const Anvil::DescriptorPoolFlags& in_opt_pool_extra_flags) + :MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ), + m_device_ptr (in_device_ptr), + m_n_unique_dses (0), + m_parent_dsg_ptr (nullptr), + m_releaseable_sets (in_releaseable_sets), + m_user_specified_pool_flags(in_opt_pool_extra_flags) { auto ds_layout_manager_ptr = m_device_ptr->get_descriptor_set_layout_manager(); @@ -59,13 +61,13 @@ Anvil::DescriptorSetGroup::DescriptorSetGroup(const Anvil::BaseDevice* } /* Initialize descriptor pool */ - m_n_unique_dses = static_cast(in_ds_info_ptrs.size() ); + m_n_unique_dses = static_cast(in_ds_create_info_ptrs.size() ); for (uint32_t n_layout_info_ptr = 0; - n_layout_info_ptr < static_cast(in_ds_info_ptrs.size() ); + n_layout_info_ptr < static_cast(in_ds_create_info_ptrs.size() ); ++n_layout_info_ptr) { - auto& current_layout_info_ptr = in_ds_info_ptrs.at(n_layout_info_ptr); + auto& current_layout_info_ptr = in_ds_create_info_ptrs.at(n_layout_info_ptr); m_descriptor_sets[n_layout_info_ptr].reset( new DescriptorSetInfoContainer() @@ -88,11 +90,11 @@ Anvil::DescriptorSetGroup::DescriptorSetGroup(const Anvil::BaseDevice* in_mt_safety); } - m_ds_info_ptrs.push_back(m_descriptor_sets.at(n_layout_info_ptr)->layout_ptr->get_info() ); + m_ds_create_info_ptrs.push_back(m_descriptor_sets.at(n_layout_info_ptr)->layout_ptr->get_create_info() ); } else { - m_ds_info_ptrs.push_back(nullptr); + m_ds_create_info_ptrs.push_back(nullptr); } } @@ -104,10 +106,11 @@ Anvil::DescriptorSetGroup::DescriptorSetGroup(const Anvil::BaseDevice* /* Please see header for specification */ Anvil::DescriptorSetGroup::DescriptorSetGroup(const DescriptorSetGroup* in_parent_dsg_ptr, bool in_releaseable_sets) - :MTSafetySupportProvider(in_parent_dsg_ptr->is_mt_safe() ), - m_device_ptr (in_parent_dsg_ptr->m_device_ptr), - m_parent_dsg_ptr (in_parent_dsg_ptr), - m_releaseable_sets (in_releaseable_sets) + :MTSafetySupportProvider (in_parent_dsg_ptr->is_mt_safe() ), + m_device_ptr (in_parent_dsg_ptr->m_device_ptr), + m_parent_dsg_ptr (in_parent_dsg_ptr), + m_releaseable_sets (in_releaseable_sets), + m_user_specified_pool_flags(in_parent_dsg_ptr->m_user_specified_pool_flags) { auto descriptor_set_layout_manager_ptr = m_device_ptr->get_descriptor_set_layout_manager(); @@ -142,7 +145,7 @@ Anvil::DescriptorSetGroup::DescriptorSetGroup(const DescriptorSetGroup* in_paren * manually reference-counts users of each instantiated layout, and the counter is only bumped at get_layout() * call time. */ - descriptor_set_layout_manager_ptr->get_layout(ds.second->layout_ptr->get_info(), + descriptor_set_layout_manager_ptr->get_layout(ds.second->layout_ptr->get_create_info(), &m_descriptor_sets.at(ds.first)->layout_ptr); anvil_assert(m_descriptor_sets.at(ds.first)->layout_ptr.get() == ds.second->layout_ptr.get() ); @@ -193,39 +196,57 @@ bool Anvil::DescriptorSetGroup::bake_descriptor_pool() for (auto& current_ds : m_descriptor_sets) { - const Anvil::DescriptorSetInfo* current_ds_layout_info_ptr = nullptr; - uint32_t n_ds_bindings; + const Anvil::DescriptorSetCreateInfo* current_ds_create_info_ptr = nullptr; + uint32_t n_ds_bindings; + uint32_t variable_descriptor_binding_index = UINT32_MAX; + uint32_t variable_descriptor_binding_size = 0; if (current_ds.second->layout_ptr == nullptr) { - current_ds_layout_info_ptr = m_device_ptr->get_dummy_descriptor_set_layout()->get_info(); + current_ds_create_info_ptr = m_device_ptr->get_dummy_descriptor_set_layout()->get_create_info(); } else { - current_ds_layout_info_ptr = current_ds.second->layout_ptr->get_info(); + current_ds_create_info_ptr = current_ds.second->layout_ptr->get_create_info(); } - n_ds_bindings = static_cast(current_ds_layout_info_ptr->get_n_bindings() ); + n_ds_bindings = static_cast(current_ds_create_info_ptr->get_n_bindings() ); + + current_ds_create_info_ptr->contains_variable_descriptor_count_binding(&variable_descriptor_binding_index, + &variable_descriptor_binding_size); for (uint32_t n_ds_binding = 0; n_ds_binding < n_ds_bindings; ++n_ds_binding) { - uint32_t ds_binding_array_size; - VkDescriptorType ds_binding_type; + uint32_t ds_binding_array_size; + Anvil::DescriptorBindingFlags ds_binding_flags = 0; + uint32_t ds_binding_index = UINT32_MAX; + VkDescriptorType ds_binding_type; - current_ds_layout_info_ptr->get_binding_properties_by_index_number(n_ds_binding, - nullptr, /* out_opt_binding_index_Ptr */ + current_ds_create_info_ptr->get_binding_properties_by_index_number(n_ds_binding, + &ds_binding_index, &ds_binding_type, &ds_binding_array_size, nullptr, /* out_opt_stage_flags_ptr */ - nullptr); /* out_opt_immutable_samplers_enabled_ptr */ + nullptr, /* out_opt_immutable_samplers_enabled_ptr */ + &ds_binding_flags); if (ds_binding_type > VK_DESCRIPTOR_TYPE_END_RANGE) { continue; } + if (ds_binding_index == variable_descriptor_binding_index) + { + ds_binding_array_size = variable_descriptor_binding_size; + } + + if (ds_binding_flags & Anvil::DESCRIPTOR_BINDING_FLAG_UPDATE_AFTER_BIND_BIT) + { + flags |= Anvil::DESCRIPTOR_POOL_FLAG_CREATE_UPDATE_AFTER_BIND_BIT; + } + n_descriptors_needed_array[ds_binding_type] += ds_binding_array_size; } } @@ -238,10 +259,21 @@ bool Anvil::DescriptorSetGroup::bake_descriptor_pool() m_pool_size_per_descriptor_type[n_descriptor_type] = n_descriptors_needed_array[n_descriptor_type] + m_overhead_allocations[n_descriptor_type]; } + /* Verify we can actually create the pool.. */ + if (flags & Anvil::DESCRIPTOR_POOL_FLAG_CREATE_UPDATE_AFTER_BIND_BIT) + { + if (!m_device_ptr->get_extension_info()->ext_descriptor_indexing() ) + { + anvil_assert(m_device_ptr->get_extension_info()->ext_descriptor_indexing() ); + + goto end; + } + } + /* Create the pool */ m_descriptor_pool_ptr = Anvil::DescriptorPool::create(m_device_ptr, m_n_unique_dses, - flags, + flags | m_user_specified_pool_flags, m_pool_size_per_descriptor_type, Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() )); @@ -293,9 +325,28 @@ bool Anvil::DescriptorSetGroup::bake_descriptor_sets() } else { - allocations.push_back( - Anvil::DescriptorSetAllocation(ds_ptr->layout_ptr.get() ) - ); + bool has_variable_descriptor_count_binding = false; + uint32_t variable_descriptor_count_binding_index = 0; + uint32_t variable_descriptor_count_binding_size = 0; + + has_variable_descriptor_count_binding = ds_ptr->layout_ptr->get_create_info()->contains_variable_descriptor_count_binding(&variable_descriptor_count_binding_index, + &variable_descriptor_count_binding_size); + + if (has_variable_descriptor_count_binding) + { + anvil_assert(variable_descriptor_count_binding_size != 0); + + allocations.push_back( + Anvil::DescriptorSetAllocation(ds_ptr->layout_ptr.get(), + variable_descriptor_count_binding_size) + ); + } + else + { + allocations.push_back( + Anvil::DescriptorSetAllocation(ds_ptr->layout_ptr.get() ) + ); + } } } @@ -330,21 +381,23 @@ bool Anvil::DescriptorSetGroup::bake_descriptor_sets() } /* Please see header for specification */ -Anvil::DescriptorSetGroupUniquePtr Anvil::DescriptorSetGroup::create(const Anvil::BaseDevice* in_device_ptr, - std::vector& in_ds_info_ptrs, - bool in_releaseable_sets, - MTSafety in_mt_safety, - const std::vector& in_opt_overhead_allocations) +Anvil::DescriptorSetGroupUniquePtr Anvil::DescriptorSetGroup::create(const Anvil::BaseDevice* in_device_ptr, + std::vector& in_ds_create_info_ptrs, + bool in_releaseable_sets, + MTSafety in_mt_safety, + const std::vector& in_opt_overhead_allocations, + const Anvil::DescriptorPoolFlags& in_opt_pool_extra_flags) { Anvil::DescriptorSetGroupUniquePtr result_ptr(nullptr, std::default_delete() ); result_ptr.reset( new Anvil::DescriptorSetGroup(in_device_ptr, - std::move(in_ds_info_ptrs), + std::move(in_ds_create_info_ptrs), in_releaseable_sets, in_mt_safety, - in_opt_overhead_allocations) + in_opt_overhead_allocations, + in_opt_pool_extra_flags) ); if (result_ptr != nullptr) @@ -405,11 +458,11 @@ Anvil::DescriptorSet* Anvil::DescriptorSetGroup::get_descriptor_set(uint32_t in_ return ds_iterator->second->descriptor_set_ptr.get(); } -const std::vector* Anvil::DescriptorSetGroup::get_descriptor_set_info() const +const std::vector* Anvil::DescriptorSetGroup::get_descriptor_set_create_info() const { - std::unique_lock mutex_lock; - auto mutex_ptr = get_mutex(); - const std::vector* result_ptr = nullptr; + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + const std::vector* result_ptr = nullptr; if (mutex_ptr != nullptr) { @@ -418,17 +471,17 @@ const std::vector* Anvil::DescriptorSetGroup::g ); } - result_ptr = &m_ds_info_ptrs; + result_ptr = &m_ds_create_info_ptrs; return result_ptr; } /* Please see header for specification */ -const Anvil::DescriptorSetInfo* Anvil::DescriptorSetGroup::get_descriptor_set_info(uint32_t in_n_set) const +const Anvil::DescriptorSetCreateInfo* Anvil::DescriptorSetGroup::get_descriptor_set_create_info(uint32_t in_n_set) const { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); - const Anvil::DescriptorSetInfo* result_ptr = nullptr; + const Anvil::DescriptorSetCreateInfo* result_ptr = nullptr; if (mutex_ptr != nullptr) { @@ -437,14 +490,14 @@ const Anvil::DescriptorSetInfo* Anvil::DescriptorSetGroup::get_descriptor_set_in ); } - if (m_ds_info_ptrs.size() < in_n_set) + if (m_ds_create_info_ptrs.size() < in_n_set) { anvil_assert_fail(); goto end; } - result_ptr = m_ds_info_ptrs.at(in_n_set); + result_ptr = m_ds_create_info_ptrs.at(in_n_set); end: return result_ptr; diff --git a/src/wrappers/descriptor_set_layout.cpp b/src/wrappers/descriptor_set_layout.cpp index a8018786..ce41c5a3 100644 --- a/src/wrappers/descriptor_set_layout.cpp +++ b/src/wrappers/descriptor_set_layout.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -21,7 +21,7 @@ // #include "misc/debug.h" -#include "misc/descriptor_set_info.h" +#include "misc/descriptor_set_create_info.h" #include "misc/object_tracker.h" #include "misc/struct_chainer.h" #include "wrappers/descriptor_set_layout.h" @@ -29,14 +29,14 @@ #include "wrappers/sampler.h" /** Please see header for specification */ -Anvil::DescriptorSetLayout::DescriptorSetLayout(Anvil::DescriptorSetInfoUniquePtr in_ds_info_ptr, - const Anvil::BaseDevice* in_device_ptr, - bool in_mt_safe) +Anvil::DescriptorSetLayout::DescriptorSetLayout(Anvil::DescriptorSetCreateInfoUniquePtr in_ds_create_info_ptr, + const Anvil::BaseDevice* in_device_ptr, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT), MTSafetySupportProvider (in_mt_safe), + m_create_info_ptr (std::move(in_ds_create_info_ptr) ), m_device_ptr (in_device_ptr), - m_info_ptr (std::move(in_ds_info_ptr) ), m_layout (VK_NULL_HANDLE) { Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT, @@ -64,9 +64,9 @@ Anvil::DescriptorSetLayout::~DescriptorSetLayout() } /** Please see header for specification */ -Anvil::DescriptorSetLayoutUniquePtr Anvil::DescriptorSetLayout::create(Anvil::DescriptorSetInfoUniquePtr in_ds_info_ptr, - const Anvil::BaseDevice* in_device_ptr, - MTSafety in_mt_safety) +Anvil::DescriptorSetLayoutUniquePtr Anvil::DescriptorSetLayout::create(Anvil::DescriptorSetCreateInfoUniquePtr in_ds_create_info_ptr, + const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety) { const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, in_device_ptr); @@ -74,7 +74,7 @@ Anvil::DescriptorSetLayoutUniquePtr Anvil::DescriptorSetLayout::create(Anvil::De std::default_delete() ); result_ptr.reset( - new Anvil::DescriptorSetLayout(std::move(in_ds_info_ptr), + new Anvil::DescriptorSetLayout(std::move(in_ds_create_info_ptr), in_device_ptr, mt_safe) ); @@ -90,6 +90,74 @@ Anvil::DescriptorSetLayoutUniquePtr Anvil::DescriptorSetLayout::create(Anvil::De return result_ptr; } +uint32_t Anvil::DescriptorSetLayout::get_maximum_variable_descriptor_count(const DescriptorSetLayoutCreateInfoContainer* in_ds_create_info_ptr, + const Anvil::BaseDevice* in_device_ptr) +{ + const Anvil::ExtensionKHRMaintenance3Entrypoints* entrypoints_ptr = nullptr; + Anvil::StructID query_struct_id = UINT32_MAX; + const VkDescriptorSetVariableDescriptorCountLayoutSupportEXT* query_struct_ptr = nullptr; + uint32_t result = 0; + Anvil::StructChainUniquePtr struct_chain_ptr; + Anvil::StructChainer struct_chainer; + + if (!in_device_ptr->get_extension_info()->ext_descriptor_indexing() ) + { + anvil_assert(in_device_ptr->get_extension_info()->ext_descriptor_indexing() ); + + goto end; + } + + if (!in_device_ptr->get_extension_info()->khr_maintenance3() ) + { + anvil_assert(in_device_ptr->get_extension_info()->khr_maintenance3()); + + goto end; + } + else + { + entrypoints_ptr = &in_device_ptr->get_extension_khr_maintenance3_entrypoints(); + } + + { + VkDescriptorSetLayoutSupportKHR root; + + root.pNext = nullptr; + root.sType = static_cast(VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT_KHR); + root.supported = VK_FALSE; + + struct_chainer.append_struct(root); + } + + { + VkDescriptorSetVariableDescriptorCountLayoutSupportEXT query; + + query.maxVariableDescriptorCount = 0; + query.pNext = nullptr; + query.sType = static_cast(VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT_EXT); + + query_struct_id = struct_chainer.append_struct(query); + } + + struct_chain_ptr = struct_chainer.create_chain (); + query_struct_ptr = struct_chain_ptr->get_struct_with_id(query_struct_id); + + if (query_struct_ptr == nullptr) + { + anvil_assert(query_struct_ptr != nullptr); + + goto end; + } + + entrypoints_ptr->vkGetDescriptorSetLayoutSupportKHR(in_device_ptr->get_device_vk(), + in_ds_create_info_ptr->struct_chain_ptr->get_root_struct(), + struct_chain_ptr->get_root_struct() ); + + result = query_struct_ptr->maxVariableDescriptorCount; + +end: + return result; +} + bool Anvil::DescriptorSetLayout::meets_max_per_set_descriptors_limit(const DescriptorSetLayoutCreateInfoContainer* in_ds_create_info_ptr, const Anvil::BaseDevice* in_device_ptr) { @@ -97,9 +165,9 @@ bool Anvil::DescriptorSetLayout::meets_max_per_set_descriptors_limit(const Descr VkDescriptorSetLayoutSupportKHR query; bool result = false; - if (!in_device_ptr->is_khr_maintenance3_extension_enabled() ) + if (!in_device_ptr->get_extension_info()->khr_maintenance3() ) { - anvil_assert(in_device_ptr->is_khr_maintenance3_extension_enabled()); + anvil_assert(in_device_ptr->get_extension_info()->khr_maintenance3()); goto end; } @@ -130,7 +198,7 @@ bool Anvil::DescriptorSetLayout::init() anvil_assert(m_layout == VK_NULL_HANDLE); /* Bake the Vulkan object */ - auto create_info_ptr = m_info_ptr->create_descriptor_set_layout_create_info(m_device_ptr); + auto create_info_ptr = m_create_info_ptr->create_descriptor_set_layout_create_info(m_device_ptr); if (create_info_ptr == nullptr) { diff --git a/src/wrappers/descriptor_set_layout_manager.cpp b/src/wrappers/descriptor_set_layout_manager.cpp index 3ca8e27d..1c4de7d2 100644 --- a/src/wrappers/descriptor_set_layout_manager.cpp +++ b/src/wrappers/descriptor_set_layout_manager.cpp @@ -21,7 +21,7 @@ // #include "misc/debug.h" -#include "misc/descriptor_set_info.h" +#include "misc/descriptor_set_create_info.h" #include "misc/object_tracker.h" #include "wrappers/descriptor_set_layout.h" #include "wrappers/descriptor_set_layout_manager.h" @@ -66,7 +66,7 @@ Anvil::DescriptorSetLayoutManagerUniquePtr Anvil::DescriptorSetLayoutManager::cr } /* Please see header for specification */ -bool Anvil::DescriptorSetLayoutManager::get_layout(const DescriptorSetInfo* in_ds_info_ptr, +bool Anvil::DescriptorSetLayoutManager::get_layout(const DescriptorSetCreateInfo* in_ds_create_info_ptr, Anvil::DescriptorSetLayoutUniquePtr* out_ds_layout_ptr_ptr) { std::unique_lock mutex_lock; @@ -74,7 +74,7 @@ bool Anvil::DescriptorSetLayoutManager::get_layout(const DescriptorSetInfo* bool result = false; Anvil::DescriptorSetLayout* result_ds_layout_ptr = nullptr; - anvil_assert(in_ds_info_ptr != nullptr); + anvil_assert(in_ds_create_info_ptr != nullptr); if (mutex_ptr != nullptr) { @@ -89,9 +89,9 @@ bool Anvil::DescriptorSetLayoutManager::get_layout(const DescriptorSetInfo* { auto& current_ds_layout_container_ptr = *layout_iterator; auto& current_ds_layout_ptr = current_ds_layout_container_ptr->ds_layout_ptr; - auto current_ds_info_ptr = current_ds_layout_ptr->get_info(); + auto current_ds_create_info_ptr = current_ds_layout_ptr->get_create_info(); - if (*in_ds_info_ptr == *current_ds_info_ptr) + if (*in_ds_create_info_ptr == *current_ds_create_info_ptr) { result = true; result_ds_layout_ptr = current_ds_layout_ptr.get(); @@ -104,9 +104,9 @@ bool Anvil::DescriptorSetLayoutManager::get_layout(const DescriptorSetInfo* if (!result) { - auto ds_info_clone_ptr = DescriptorSetInfoUniquePtr (new DescriptorSetInfo(*in_ds_info_ptr), - std::default_delete() ); - auto new_ds_layout_ptr = Anvil::DescriptorSetLayout::create (std::move(ds_info_clone_ptr), + auto ds_create_info_clone_ptr = DescriptorSetCreateInfoUniquePtr (new DescriptorSetCreateInfo(*in_ds_create_info_ptr), + std::default_delete() ); + auto new_ds_layout_ptr = Anvil::DescriptorSetLayout::create (std::move(ds_create_info_clone_ptr), m_device_ptr, Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() )); auto new_ds_layout_container_ptr = std::unique_ptr(new DescriptorSetLayoutContainer() ); diff --git a/src/wrappers/descriptor_update_template.cpp b/src/wrappers/descriptor_update_template.cpp index 19926640..40b6fcf0 100644 --- a/src/wrappers/descriptor_update_template.cpp +++ b/src/wrappers/descriptor_update_template.cpp @@ -21,7 +21,7 @@ // #include "misc/debug.h" -#include "misc/descriptor_set_info.h" +#include "misc/descriptor_set_create_info.h" #include "misc/object_tracker.h" #include "wrappers/descriptor_set.h" #include "wrappers/descriptor_set_layout.h" @@ -97,9 +97,9 @@ bool Anvil::DescriptorUpdateTemplate::init(const Anvil::DescriptorSetLayout* const Anvil::ExtensionKHRDescriptorUpdateTemplateEntrypoints* entrypoints_ptr = nullptr; bool result = true; - if (!m_device_ptr->is_khr_descriptor_update_template_extension_enabled() ) + if (!m_device_ptr->get_extension_info()->khr_descriptor_update_template() ) { - anvil_assert(m_device_ptr->is_khr_descriptor_update_template_extension_enabled() ); + anvil_assert(m_device_ptr->get_extension_info()->khr_descriptor_update_template() ); result = false; goto end; @@ -181,14 +181,14 @@ bool Anvil::DescriptorUpdateTemplate::init(const Anvil::DescriptorSetLayout* goto end; } - /* Finally, also cache descriptor set info using the user-specified DS layout */ - m_ds_info_ptr.reset( - new Anvil::DescriptorSetInfo(*in_descriptor_set_layout_ptr->get_info() ) + /* Finally, also cache descriptor set create info using the user-specified DS layout */ + m_ds_create_info_ptr.reset( + new Anvil::DescriptorSetCreateInfo(*in_descriptor_set_layout_ptr->get_create_info() ) ); - if (m_ds_info_ptr == nullptr) + if (m_ds_create_info_ptr == nullptr) { - anvil_assert(m_ds_info_ptr != nullptr); + anvil_assert(m_ds_create_info_ptr != nullptr); result = false; goto end; @@ -212,7 +212,7 @@ void Anvil::DescriptorUpdateTemplate::update_descriptor_set(const Anvil::Descrip #ifdef _DEBUG { - if (!(*inout_ds_ptr->get_descriptor_set_layout()->get_info() == *m_ds_info_ptr) ) + if (!(*inout_ds_ptr->get_descriptor_set_layout()->get_create_info() == *m_ds_create_info_ptr) ) { anvil_assert_fail(); diff --git a/src/wrappers/device.cpp b/src/wrappers/device.cpp index a2c07639..a61675ec 100644 --- a/src/wrappers/device.cpp +++ b/src/wrappers/device.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -20,11 +20,11 @@ // THE SOFTWARE. // -#include "misc/base_pipeline_info.h" #include "misc/debug.h" #include "misc/object_tracker.h" #include "misc/shader_module_cache.h" #include "misc/struct_chainer.h" +#include "misc/swapchain_create_info.h" #include "wrappers/command_pool.h" #include "wrappers/compute_pipeline_manager.h" #include "wrappers/descriptor_set.h" @@ -118,7 +118,7 @@ uint32_t Anvil::BaseDevice::get_n_queues(uint32_t in_n_queue_family) const } /* Please see header for specification */ -std::unique_ptr > Anvil::BaseDevice::get_physical_device_features_chain() const +std::unique_ptr > Anvil::BaseDevice::get_physical_device_features_chain(const VkPhysicalDeviceFeatures* in_opt_features_ptr) const { const auto& features = get_physical_device_features(); std::unique_ptr > struct_chainer_ptr; @@ -130,14 +130,20 @@ std::unique_ptr > Anvil::BaseD { VkPhysicalDeviceFeatures2KHR features_khr; - features_khr.features = features.core_vk1_0_features_ptr->get_vk_physical_device_features(); + features_khr.features = (in_opt_features_ptr != nullptr) ? *in_opt_features_ptr + : features.core_vk1_0_features_ptr->get_vk_physical_device_features(); features_khr.pNext = nullptr; features_khr.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR; struct_chainer_ptr->append_struct(features_khr); } - if (is_khr_16bit_storage_extension_enabled() ) + if (m_extension_enabled_info_ptr->get_device_extension_info()->ext_descriptor_indexing() ) + { + struct_chainer_ptr->append_struct(features.ext_descriptor_indexing_features_ptr->get_vk_physical_device_descriptor_indexing_features() ); + } + + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_16bit_storage() ) { struct_chainer_ptr->append_struct(features.khr_16bit_storage_features_ptr->get_vk_physical_device_16_bit_storage_features() ); } @@ -153,9 +159,9 @@ Anvil::Queue* Anvil::BaseDevice::get_queue(const Anvil::QueueFamilyType& in_queu switch (in_queue_family_type) { - case Anvil::QueueFamilyType::COMPUTE: result_ptr = get_compute_queue (in_n_queue); break; - case Anvil::QueueFamilyType::TRANSFER: result_ptr = get_transfer_queue (in_n_queue); break; - case Anvil::QueueFamilyType::UNIVERSAL: result_ptr = get_universal_queue(in_n_queue); break; + case Anvil::QueueFamilyType::COMPUTE: result_ptr = get_compute_queue (in_n_queue); break; + case Anvil::QueueFamilyType::TRANSFER: result_ptr = get_transfer_queue (in_n_queue); break; + case Anvil::QueueFamilyType::UNIVERSAL: result_ptr = get_universal_queue (in_n_queue); break; default: { @@ -170,7 +176,7 @@ Anvil::Queue* Anvil::BaseDevice::get_queue(const Anvil::QueueFamilyType& in_queu void Anvil::BaseDevice::get_queue_family_indices_for_physical_device(const Anvil::PhysicalDevice* in_physical_device_ptr, DeviceQueueFamilyInfo* out_device_queue_family_info_ptr) const { - const auto n_queue_families = static_cast(in_physical_device_ptr->get_queue_families().size() ); + const auto n_queue_families = static_cast(in_physical_device_ptr->get_queue_families().size() ); std::vector result_compute_queue_families; std::vector result_transfer_queue_families; std::vector result_universal_queue_families; @@ -470,12 +476,11 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, bool in_support_resettable_command_buffer_allocs, bool in_enable_shader_module_cache) { - - std::vector extensions_final; - VkPhysicalDeviceFeatures features_to_enable; - const bool is_validation_enabled(m_parent_instance_ptr->is_validation_enabled() ); - std::vector layers_final; - const auto mt_safety (Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); + std::map extensions_final_enabled_status; + VkPhysicalDeviceFeatures features_to_enable; + const bool is_validation_enabled(m_parent_instance_ptr->is_validation_enabled() ); + std::vector layers_final; + const auto mt_safety (Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); /* If validation is enabled, retrieve names of all suported validation layers and * append them to the list of layers the user has alreaedy specified. **/ @@ -500,136 +505,75 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, /* Go through the extension struct, verify availability of the requested extensions, * and cache the ones that have been requested and which are available in a linear vector. */ - typedef struct ExtensionItem { - const char* name; - ExtensionAvailability requested_availability; - bool* ext_enabled_flag_ptr; + bool is_amd_negative_viewport_height_defined = false; + bool is_khr_maintenance1_defined = false; - ExtensionItem(const char* in_name, - ExtensionAvailability in_availability, - bool* in_ext_enabled_flag_ptr) + for (const auto& current_extension : in_extensions.extension_status) { - ext_enabled_flag_ptr = in_ext_enabled_flag_ptr; - name = in_name; - requested_availability = in_availability; - } - } ExtensionItem; - - std::vector specified_extensions = - { - ExtensionItem(VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME, in_extensions.amd_draw_indirect_count, &m_amd_draw_indirect_count_enabled), - ExtensionItem(VK_AMD_GCN_SHADER_EXTENSION_NAME, in_extensions.amd_gcn_shader, &m_amd_gcn_shader_enabled), - ExtensionItem(VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME, in_extensions.amd_gpu_shader_half_float, &m_amd_gpu_shader_half_float_enabled), - ExtensionItem(VK_AMD_GPU_SHADER_INT16_EXTENSION_NAME, in_extensions.amd_gpu_shader_int16, &m_amd_gpu_shader_int16_enabled), - ExtensionItem(VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME, in_extensions.amd_negative_viewport_height, &m_amd_negative_viewport_height_enabled), - ExtensionItem(VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME, in_extensions.amd_rasterization_order, &m_amd_rasterization_order_enabled), - ExtensionItem(VK_AMD_SHADER_BALLOT_EXTENSION_NAME, in_extensions.amd_shader_ballot, &m_amd_shader_ballot_enabled), - ExtensionItem(VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME, in_extensions.amd_shader_explicit_vertex_parameter, &m_amd_shader_explicit_vertex_parameter_enabled), - ExtensionItem(VK_AMD_SHADER_FRAGMENT_MASK_EXTENSION_NAME, in_extensions.amd_shader_fragment_mask, &m_amd_shader_fragment_mask_enabled), - ExtensionItem(VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_EXTENSION_NAME, in_extensions.amd_shader_image_load_store_lod, &m_amd_shader_image_load_store_lod_enabled), - ExtensionItem(VK_AMD_SHADER_INFO_EXTENSION_NAME, in_extensions.amd_shader_info, &m_amd_shader_info_enabled), - ExtensionItem(VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME, in_extensions.amd_shader_trinary_minmax, &m_amd_shader_trinary_minmax_enabled), - ExtensionItem(VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME, in_extensions.amd_texture_gather_bias_lod, &m_amd_texture_gather_bias_lod_enabled), - ExtensionItem(VK_EXT_DEBUG_MARKER_EXTENSION_NAME, in_extensions.ext_debug_marker, &m_ext_debug_marker_enabled), - ExtensionItem("VK_EXT_shader_stencil_export", in_extensions.ext_shader_stencil_export, &m_ext_shader_stencil_export_enabled), - ExtensionItem(VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME, in_extensions.ext_shader_subgroup_ballot, &m_ext_shader_subgroup_ballot_enabled), - ExtensionItem(VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME, in_extensions.ext_shader_subgroup_vote, &m_ext_shader_subgroup_vote_enabled), - ExtensionItem(VK_KHR_16BIT_STORAGE_EXTENSION_NAME, in_extensions.khr_16bit_storage, &m_khr_16bit_storage_enabled), - ExtensionItem(VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME, in_extensions.khr_descriptor_update_template, &m_khr_descriptor_update_template_enabled), - ExtensionItem(VK_KHR_MAINTENANCE1_EXTENSION_NAME, in_extensions.khr_maintenance1, &m_khr_maintenance1_enabled), - ExtensionItem(VK_KHR_MAINTENANCE3_EXTENSION_NAME, in_extensions.khr_maintenance3, &m_khr_maintenance3_enabled), - ExtensionItem(VK_KHR_BIND_MEMORY_2_EXTENSION_NAME, in_extensions.khr_bind_memory2, &m_khr_bind_memory2_enabled), - ExtensionItem("VK_KHR_storage_buffer_storage_class", in_extensions.khr_storage_buffer_storage_class, &m_khr_storage_buffer_storage_class_enabled), - ExtensionItem(VK_KHR_SURFACE_EXTENSION_NAME, in_extensions.khr_surface, &m_khr_surface_enabled), - ExtensionItem(VK_KHR_SWAPCHAIN_EXTENSION_NAME, in_extensions.khr_swapchain, &m_khr_swapchain_enabled), - }; - - for (const auto& misc_extension : in_extensions.other_extensions) - { - specified_extensions.push_back( - ExtensionItem(misc_extension.first.c_str(), - misc_extension.second, - nullptr) - ); - } - - for (const auto& current_extension : specified_extensions) - { - const bool is_ext_supported = is_physical_device_extension_supported(current_extension.name); + const bool is_ext_supported = is_physical_device_extension_supported(current_extension.first); - if (current_extension.ext_enabled_flag_ptr != nullptr) - { - *current_extension.ext_enabled_flag_ptr = false; - } + is_amd_negative_viewport_height_defined |= (current_extension.first == VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME && + current_extension.second != EXTENSION_AVAILABILITY_IGNORE); + is_khr_maintenance1_defined |= (current_extension.first == VK_KHR_MAINTENANCE1_EXTENSION_NAME && + current_extension.second != EXTENSION_AVAILABILITY_IGNORE); - switch (current_extension.requested_availability) - { - case EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE: + switch (current_extension.second) { - if (is_ext_supported) + case EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE: { - extensions_final.push_back(current_extension.name); + extensions_final_enabled_status[current_extension.first] = is_ext_supported; + + break; } - break; - } + case EXTENSION_AVAILABILITY_IGNORE: + { + extensions_final_enabled_status[current_extension.first] = false; - case EXTENSION_AVAILABILITY_IGNORE: - { - continue; - } + break; + } - case EXTENSION_AVAILABILITY_REQUIRE: - { - if (!is_ext_supported) + case EXTENSION_AVAILABILITY_REQUIRE: { - char temp[1024]; - - if (snprintf(temp, - sizeof(temp), - "Device extension [%s] is unsupported", - current_extension.name) > 0) + if (!is_ext_supported) { - fprintf(stderr, - "%s", - temp); + char temp[1024]; + + if (snprintf(temp, + sizeof(temp), + "Device extension [%s] is unsupported", + current_extension.first.c_str() ) > 0) + { + fprintf(stderr, + "%s", + temp); + } + + anvil_assert_fail(); } - anvil_assert_fail(); - continue; + extensions_final_enabled_status[current_extension.first.c_str()] = is_ext_supported; + + break; } - if (is_ext_supported) + default: { - extensions_final.push_back(current_extension.name); + anvil_assert_fail(); } - - break; - } - - default: - { - anvil_assert_fail(); } } - if (is_ext_supported) - { - m_enabled_extensions.push_back(current_extension.name); - } - - if (current_extension.ext_enabled_flag_ptr != nullptr) + if (is_amd_negative_viewport_height_defined && + is_khr_maintenance1_defined) { - *current_extension.ext_enabled_flag_ptr = is_ext_supported; + /* VK_AMD_negative_viewport_height and VK_KHR_maintenance1 extensions are mutually exclusive. */ + anvil_assert_fail(); } - } - if (m_amd_negative_viewport_height_enabled && - m_khr_maintenance1_enabled) - { - /* VK_AMD_negative_viewport_height and VK_KHR_maintenance1 extensions are mutually exclusive. */ - anvil_assert_fail(); + m_extension_enabled_info_ptr = Anvil::ExtensionInfo::create_device_extension_info(extensions_final_enabled_status, + true); /* in_unspecified_extension_name_value */ } /* Instantiate the device. Actual behavior behind this is implemented by the overriding class. */ @@ -637,15 +581,26 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, anvil_assert(m_device == VK_NULL_HANDLE); { - create_device(extensions_final, + std::vector extension_name_raw_ptrs; + + extension_name_raw_ptrs.reserve(extensions_final_enabled_status.size() ); + + for (const auto& current_extension_data : extensions_final_enabled_status) + { + if (current_extension_data.second) + { + extension_name_raw_ptrs.push_back(current_extension_data.first.c_str() ); + } + } + + create_device(extension_name_raw_ptrs, layers_final, features_to_enable, &m_device_queue_families); } anvil_assert(m_device != VK_NULL_HANDLE); - /* Retrieve device-specific func pointers */ - if (m_amd_draw_indirect_count_enabled) + if (m_extension_enabled_info_ptr->get_device_extension_info()->amd_draw_indirect_count() ) { m_amd_draw_indirect_count_extension_entrypoints.vkCmdDrawIndexedIndirectCountAMD = reinterpret_cast(get_proc_address("vkCmdDrawIndexedIndirectCountAMD") ); m_amd_draw_indirect_count_extension_entrypoints.vkCmdDrawIndirectCountAMD = reinterpret_cast (get_proc_address("vkCmdDrawIndirectCountAMD") ); @@ -654,14 +609,14 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, anvil_assert(m_amd_draw_indirect_count_extension_entrypoints.vkCmdDrawIndirectCountAMD != nullptr); } - if (m_amd_shader_info_enabled) + if (m_extension_enabled_info_ptr->get_device_extension_info()->amd_shader_info() ) { m_amd_shader_info_extension_entrypoints.vkGetShaderInfoAMD = reinterpret_cast(get_proc_address("vkGetShaderInfoAMD") ); anvil_assert(m_amd_shader_info_extension_entrypoints.vkGetShaderInfoAMD != nullptr); } - if (m_ext_debug_marker_enabled) + if (m_extension_enabled_info_ptr->get_device_extension_info()->ext_debug_marker() ) { m_ext_debug_marker_extension_entrypoints.vkCmdDebugMarkerBeginEXT = reinterpret_cast (get_proc_address("vkCmdDebugMarkerBeginEXT") ); m_ext_debug_marker_extension_entrypoints.vkCmdDebugMarkerEndEXT = reinterpret_cast (get_proc_address("vkCmdDebugMarkerEndEXT") ); @@ -676,7 +631,7 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, anvil_assert(m_ext_debug_marker_extension_entrypoints.vkDebugMarkerSetObjectTagEXT != nullptr); } - if (m_khr_descriptor_update_template_enabled) + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_descriptor_update_template() ) { m_khr_descriptor_update_template_extension_entrypoints.vkCreateDescriptorUpdateTemplateKHR = reinterpret_cast (get_proc_address("vkCreateDescriptorUpdateTemplateKHR") ); m_khr_descriptor_update_template_extension_entrypoints.vkDestroyDescriptorUpdateTemplateKHR = reinterpret_cast(get_proc_address("vkDestroyDescriptorUpdateTemplateKHR") ); @@ -687,31 +642,31 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, anvil_assert(m_khr_descriptor_update_template_extension_entrypoints.vkUpdateDescriptorSetWithTemplateKHR != nullptr); } - if (m_khr_bind_memory2_enabled) + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_bind_memory2() ) { - m_khr_bind_memory2_extension_entrypoints.vkBindBufferMemory2KHR = reinterpret_cast (get_proc_address("vkBindBufferMemory2KHR")); - m_khr_bind_memory2_extension_entrypoints.vkBindImageMemory2KHR = reinterpret_cast (get_proc_address("vkBindImageMemory2KHR")); + m_khr_bind_memory2_extension_entrypoints.vkBindBufferMemory2KHR = reinterpret_cast(get_proc_address("vkBindBufferMemory2KHR")); + m_khr_bind_memory2_extension_entrypoints.vkBindImageMemory2KHR = reinterpret_cast (get_proc_address("vkBindImageMemory2KHR")); anvil_assert(m_khr_bind_memory2_extension_entrypoints.vkBindBufferMemory2KHR != nullptr); anvil_assert(m_khr_bind_memory2_extension_entrypoints.vkBindImageMemory2KHR != nullptr); } - if (m_khr_maintenance1_enabled) + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_maintenance1() ) { m_khr_maintenance1_extension_entrypoints.vkTrimCommandPoolKHR = reinterpret_cast(get_proc_address("vkTrimCommandPoolKHR") ); anvil_assert(m_khr_maintenance1_extension_entrypoints.vkTrimCommandPoolKHR != nullptr); } - if (m_khr_maintenance3_enabled) + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_maintenance3() ) { m_khr_maintenance3_extension_entrypoints.vkGetDescriptorSetLayoutSupportKHR = reinterpret_cast(get_proc_address("vkGetDescriptorSetLayoutSupportKHR") ); anvil_assert(m_khr_maintenance3_extension_entrypoints.vkGetDescriptorSetLayoutSupportKHR != nullptr); } - if (m_khr_swapchain_enabled) + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_swapchain() ) { m_khr_swapchain_extension_entrypoints.vkAcquireNextImageKHR = reinterpret_cast (get_proc_address("vkAcquireNextImageKHR") ); m_khr_swapchain_extension_entrypoints.vkCreateSwapchainKHR = reinterpret_cast (get_proc_address("vkCreateSwapchainKHR") ); @@ -772,11 +727,9 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, n_queue, is_mt_safe() ); - { - anvil_assert(out_queues_ptr != nullptr); + anvil_assert(out_queues_ptr != nullptr); - out_queues_ptr->push_back(new_queue_ptr.get() ); - } + out_queues_ptr->push_back(new_queue_ptr.get() ); /* If this queue supports sparse binding ops, cache it in a separate vector as well */ if (new_queue_ptr->supports_sparse_bindings() ) @@ -825,18 +778,25 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, /* Initialize a dummy descriptor set group */ { - std::vector dummy_ds_info_ptrs(1); + std::vector dummy_ds_create_info_ptrs(1); + std::vector dummy_overhead_allocs; + + dummy_overhead_allocs.push_back( + Anvil::OverheadAllocation(VK_DESCRIPTOR_TYPE_SAMPLER, + 1) /* in_n_overhead_allocs */ + ); - dummy_ds_info_ptrs[0] = Anvil::DescriptorSetInfo::create(); - dummy_ds_info_ptrs[0]->add_binding(0, /* n_binding */ - VK_DESCRIPTOR_TYPE_MAX_ENUM, - 0, /* n_elements */ - 0); /* stage_flags */ + dummy_ds_create_info_ptrs[0] = Anvil::DescriptorSetCreateInfo::create(); + dummy_ds_create_info_ptrs[0]->add_binding(0, /* n_binding */ + VK_DESCRIPTOR_TYPE_MAX_ENUM, + 0, /* n_elements */ + 0); /* stage_flags */ m_dummy_dsg_ptr = Anvil::DescriptorSetGroup::create(this, - dummy_ds_info_ptrs, + dummy_ds_create_info_ptrs, false, /* releaseable_sets */ - MT_SAFETY_DISABLED); + MT_SAFETY_DISABLED, + dummy_overhead_allocs); m_dummy_dsg_ptr->get_descriptor_set(0)->update(); } @@ -894,6 +854,16 @@ bool Anvil::BaseDevice::is_universal_queue_family_index(const uint32_t& in_queue (m_queue_family_index_to_type.at (in_queue_family_index) == Anvil::QueueFamilyType::UNIVERSAL); } +bool Anvil::BaseDevice::supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags& in_types) const +{ + bool result = m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_memory(); + + /* NOTE: Anvil does not support any external memory handle types YET. */ + result &= (in_types == 0); + + return result; +} + /* Please see header for specification */ bool Anvil::BaseDevice::wait_idle() const { @@ -928,7 +898,6 @@ bool Anvil::BaseDevice::wait_idle() const return is_vk_call_successful(result_vk); } - /* Please see header for specification */ Anvil::SGPUDevice::SGPUDevice(const Anvil::PhysicalDevice* in_physical_device_ptr, bool in_mt_safe) @@ -981,8 +950,8 @@ void Anvil::SGPUDevice::create_device(const std::vector& in_extensi VkDeviceCreateInfo create_info; std::vector device_queue_create_info_items; std::vector device_queue_priorities; - auto features_chain_ptr (get_physical_device_features_chain() ); - auto features_chain_root_struct_ptr(features_chain_ptr->get_root_struct() ); + auto features_chain_ptr (get_physical_device_features_chain (&in_features) ); + auto features_chain_root_struct_ptr(features_chain_ptr->get_root_struct () ); const auto& physical_device_queue_fams (m_parent_physical_device_ptr->get_queue_families() ); VkResult result (VK_ERROR_INITIALIZATION_FAILED); @@ -1030,9 +999,9 @@ void Anvil::SGPUDevice::create_device(const std::vector& in_extensi create_info.enabledExtensionCount = static_cast(in_extensions.size() ); create_info.enabledLayerCount = static_cast(in_layers.size() ); create_info.flags = 0; - create_info.pEnabledFeatures = &in_features; - create_info.pNext = (m_parent_physical_device_ptr->get_instance()->is_instance_extension_enabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME)) ? features_chain_root_struct_ptr - : features_chain_root_struct_ptr->pNext; + create_info.pEnabledFeatures = nullptr; + create_info.pNext = (m_parent_physical_device_ptr->get_instance()->get_enabled_extensions_info()->khr_get_physical_device_properties2() ) ? features_chain_root_struct_ptr + : features_chain_root_struct_ptr->pNext; create_info.ppEnabledExtensionNames = (in_extensions.size() > 0) ? &in_extensions[0] : nullptr; create_info.ppEnabledLayerNames = (in_layers.size() > 0) ? &in_layers [0] : nullptr; create_info.pQueueCreateInfos = &device_queue_create_info_items[0]; @@ -1060,15 +1029,19 @@ Anvil::SwapchainUniquePtr Anvil::SGPUDevice::create_swapchain(Anvil::RenderingSu SwapchainUniquePtr result_ptr(nullptr, std::default_delete() ); - result_ptr = Anvil::Swapchain::create(this, - in_parent_surface_ptr, - in_window_ptr, - in_image_format, - in_present_mode, - in_usage, - in_n_swapchain_images, - m_khr_swapchain_extension_entrypoints, - Anvil::MT_SAFETY_ENABLED); + { + auto create_info_ptr = Anvil::SwapchainCreateInfo::create(this, + in_parent_surface_ptr, + in_window_ptr, + in_image_format, + in_present_mode, + in_usage, + in_n_swapchain_images); + + create_info_ptr->set_mt_safety(Anvil::MT_SAFETY_ENABLED); + + result_ptr = Anvil::Swapchain::create(std::move(create_info_ptr) ); + } return result_ptr; } diff --git a/src/wrappers/event.cpp b/src/wrappers/event.cpp index 5c22b247..07c9649d 100644 --- a/src/wrappers/event.cpp +++ b/src/wrappers/event.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -21,39 +21,20 @@ // #include "misc/debug.h" +#include "misc/event_create_info.h" #include "misc/object_tracker.h" #include "wrappers/device.h" #include "wrappers/event.h" /* Please see header for specification */ -Anvil::Event::Event(const Anvil::BaseDevice* in_device_ptr, - bool in_mt_safe) - :DebugMarkerSupportProvider(in_device_ptr, +Anvil::Event::Event(Anvil::EventCreateInfoUniquePtr in_create_info_ptr) + :DebugMarkerSupportProvider(in_create_info_ptr->get_device(), VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT), - MTSafetySupportProvider (in_mt_safe), - m_device_ptr (in_device_ptr), + MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), + in_create_info_ptr->get_device () )), m_event (VK_NULL_HANDLE) { - VkEventCreateInfo event_create_info; - VkResult result (VK_ERROR_INITIALIZATION_FAILED); - - ANVIL_REDUNDANT_VARIABLE(result); - - /* Spawn a new event */ - event_create_info.flags = 0; - event_create_info.pNext = nullptr; - event_create_info.sType = VK_STRUCTURE_TYPE_EVENT_CREATE_INFO; - - result = vkCreateEvent(m_device_ptr->get_device_vk(), - &event_create_info, - nullptr, /* pAllocator */ - &m_event); - - anvil_assert_vk_call_succeeded(result); - if (is_vk_call_successful(result) ) - { - set_vk_handle(m_event); - } + m_create_info_ptr = std::move(in_create_info_ptr); /* Register the event instance */ Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_EVENT, @@ -74,22 +55,50 @@ Anvil::Event::~Event() } /* Please see header for specification */ -Anvil::EventUniquePtr Anvil::Event::create(const Anvil::BaseDevice* in_device_ptr, - MTSafety in_mt_safety) +Anvil::EventUniquePtr Anvil::Event::create(Anvil::EventCreateInfoUniquePtr in_create_info_ptr) { - const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); Anvil::EventUniquePtr result_ptr(nullptr, std::default_delete() ); result_ptr.reset( - new Anvil::Event(in_device_ptr, - mt_safe) + new Anvil::Event(std::move(in_create_info_ptr) ) ); + if (result_ptr != nullptr) + { + if (!result_ptr->init() ) + { + result_ptr.reset(); + } + } + return result_ptr; } +bool Anvil::Event::init() +{ + VkEventCreateInfo event_create_info; + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + + /* Spawn a new event */ + event_create_info.flags = 0; + event_create_info.pNext = nullptr; + event_create_info.sType = VK_STRUCTURE_TYPE_EVENT_CREATE_INFO; + + result = vkCreateEvent(m_device_ptr->get_device_vk(), + &event_create_info, + nullptr, /* pAllocator */ + &m_event); + + anvil_assert_vk_call_succeeded(result); + if (is_vk_call_successful(result) ) + { + set_vk_handle(m_event); + } + + return is_vk_call_successful(result); +} + /* Please see header for specification */ bool Anvil::Event::is_set() const { diff --git a/src/wrappers/fence.cpp b/src/wrappers/fence.cpp index 9a1907b3..0e922049 100644 --- a/src/wrappers/fence.cpp +++ b/src/wrappers/fence.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -21,43 +21,22 @@ // #include "misc/debug.h" +#include "misc/fence_create_info.h" #include "misc/object_tracker.h" #include "wrappers/device.h" #include "wrappers/fence.h" #include /* Please see header for specification */ -Anvil::Fence::Fence(const Anvil::BaseDevice* in_device_ptr, - bool in_create_signalled, - bool in_mt_safe) - :DebugMarkerSupportProvider(in_device_ptr, +Anvil::Fence::Fence(Anvil::FenceCreateInfoUniquePtr in_create_info_ptr) + :DebugMarkerSupportProvider(in_create_info_ptr->get_device(), VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT), - MTSafetySupportProvider (in_mt_safe), - m_device_ptr (in_device_ptr), + MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), + in_create_info_ptr->get_device () )), m_fence (VK_NULL_HANDLE), m_possibly_set (false) { - VkFenceCreateInfo fence_create_info; - VkResult result (VK_ERROR_INITIALIZATION_FAILED); - - ANVIL_REDUNDANT_VARIABLE(result); - - /* Spawn a new fence */ - fence_create_info.flags = (in_create_signalled) ? VK_FENCE_CREATE_SIGNALED_BIT - : 0u; - fence_create_info.pNext = nullptr; - fence_create_info.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO; - - result = vkCreateFence(m_device_ptr->get_device_vk(), - &fence_create_info, - nullptr, /* pAllocator */ - &m_fence); - - anvil_assert_vk_call_succeeded(result); - if (is_vk_call_successful(result) ) - { - set_vk_handle(m_fence); - } + m_create_info_ptr = std::move(in_create_info_ptr); /* Register the event instance */ Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_FENCE, @@ -74,24 +53,53 @@ Anvil::Fence::~Fence() } /* Please see header for specification */ -Anvil::FenceUniquePtr Anvil::Fence::create(const Anvil::BaseDevice* in_device_ptr, - bool in_create_signalled, - MTSafety in_mt_safety) +Anvil::FenceUniquePtr Anvil::Fence::create(Anvil::FenceCreateInfoUniquePtr in_create_info_ptr) { - const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); Anvil::FenceUniquePtr result_ptr(nullptr, std::default_delete() ); result_ptr.reset( - new Anvil::Fence(in_device_ptr, - in_create_signalled, - mt_safe) + new Anvil::Fence(std::move(in_create_info_ptr) ) ); + if (result_ptr != nullptr) + { + if (!result_ptr->init() ) + { + result_ptr.reset(); + } + } + return result_ptr; } +bool Anvil::Fence::init() +{ + VkFenceCreateInfo fence_create_info; + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + + ANVIL_REDUNDANT_VARIABLE(result); + + /* Spawn a new fence */ + fence_create_info.flags = (m_create_info_ptr->should_create_signalled() ) ? VK_FENCE_CREATE_SIGNALED_BIT + : 0u; + fence_create_info.pNext = nullptr; + fence_create_info.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO; + + result = vkCreateFence(m_device_ptr->get_device_vk(), + &fence_create_info, + nullptr, /* pAllocator */ + &m_fence); + + anvil_assert_vk_call_succeeded(result); + if (is_vk_call_successful(result) ) + { + set_vk_handle(m_fence); + } + + return is_vk_call_successful(result); +} + /* Please see header for specification */ bool Anvil::Fence::is_set() const { diff --git a/src/wrappers/framebuffer.cpp b/src/wrappers/framebuffer.cpp index 5af9dda4..9dbb6c8c 100644 --- a/src/wrappers/framebuffer.cpp +++ b/src/wrappers/framebuffer.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -21,8 +21,9 @@ // #include "misc/debug.h" +#include "misc/framebuffer_create_info.h" #include "misc/object_tracker.h" -#include "misc/render_pass_info.h" +#include "misc/render_pass_create_info.h" #include "wrappers/device.h" #include "wrappers/framebuffer.h" #include "wrappers/image.h" @@ -37,53 +38,16 @@ bool Anvil::Framebuffer::RenderPassComparator::operator()(Anvil::RenderPass* in_ } -/** Please see header for specification */ -Anvil::Framebuffer::FramebufferAttachment::FramebufferAttachment(ImageView* in_image_view_ptr) -{ - anvil_assert(in_image_view_ptr != nullptr); - - image_view_ptr = in_image_view_ptr; -} - -/** Please see header for specification */ -Anvil::Framebuffer::FramebufferAttachment::FramebufferAttachment(const FramebufferAttachment& in) -{ - image_view_ptr = in.image_view_ptr; -} - -/** Please see header for specification */ -Anvil::Framebuffer::FramebufferAttachment& Anvil::Framebuffer::FramebufferAttachment::operator=(const Anvil::Framebuffer::FramebufferAttachment& in) -{ - image_view_ptr = in.image_view_ptr; - - return *this; -} - -/** Destructor. Releases the wrapped image view instance. */ -Anvil::Framebuffer::FramebufferAttachment::~FramebufferAttachment() -{ - /* Stub */ -} - /* Please see header for specification */ -Anvil::Framebuffer::Framebuffer(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_width, - uint32_t in_height, - uint32_t in_n_layers, - bool in_mt_safe) - :DebugMarkerSupportProvider(in_device_ptr, +Anvil::Framebuffer::Framebuffer(Anvil::FramebufferCreateInfoUniquePtr in_create_info_ptr) + :DebugMarkerSupportProvider(in_create_info_ptr->get_device(), VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT, true), /* in_use_delegate_workers */ - MTSafetySupportProvider (in_mt_safe), - m_device_ptr (in_device_ptr) + MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), + in_create_info_ptr->get_device () )), + m_device_ptr (in_create_info_ptr->get_device () ) { - anvil_assert(in_width >= 1); - anvil_assert(in_height >= 1); - anvil_assert(in_n_layers >= 1); - - m_framebuffer_size[0] = in_width; - m_framebuffer_size[1] = in_height; - m_framebuffer_size[2] = in_n_layers; + m_create_info_ptr = std::move(in_create_info_ptr); /* Register the object */ Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_FRAMEBUFFER, @@ -118,66 +82,6 @@ Anvil::Framebuffer::~Framebuffer() } m_baked_framebuffers.clear(); - m_attachments.clear(); -} - -/* Please see header for specification */ -bool Anvil::Framebuffer::add_attachment(ImageView* in_image_view_ptr, - FramebufferAttachmentID* out_opt_attachment_id_ptr) -{ - const Anvil::Image* parent_image_ptr; - bool result = false; - uint32_t view_size[3]; - - /* Sanity checks: Input image view must not be nullptr */ - anvil_assert(in_image_view_ptr != nullptr); - - /* Sanity checks: make sure the image views have the same, or larger size than the framebuffer's. */ - parent_image_ptr = in_image_view_ptr->get_parent_image(); - - anvil_assert(parent_image_ptr != nullptr); - - if (!parent_image_ptr->get_image_mipmap_size(in_image_view_ptr->get_base_mipmap_level(), - view_size + 0, - view_size + 1, - view_size + 2) ) - { - /* Why is the mipmap index invalid? */ - anvil_assert_fail(); - - goto end; - } - - if (view_size[0] < m_framebuffer_size[0] || - view_size[1] < m_framebuffer_size[1]) - { - /* Attachment size is wrong */ - anvil_assert_fail(); - - goto end; - } - - /* Spawn & store a new descriptor for the attachment. */ - if (out_opt_attachment_id_ptr != nullptr) - { - *out_opt_attachment_id_ptr = static_cast(m_attachments.size() ); - } - - m_attachments.push_back(FramebufferAttachment(in_image_view_ptr) ); - - /* Mark all baked framebuffers as dirty. */ - for (auto baked_fb_iterator = m_baked_framebuffers.begin(); - baked_fb_iterator != m_baked_framebuffers.end(); - ++baked_fb_iterator) - { - baked_fb_iterator->second.dirty = true; - } - - /* All done */ - result = true; - -end: - return result; } /* Please see header for specification */ @@ -186,9 +90,10 @@ bool Anvil::Framebuffer::bake(Anvil::RenderPass* in_render_pass_ptr) BakedFramebufferMap::iterator baked_fb_iterator; VkFramebufferCreateInfo fb_create_info; std::vector image_view_attachments; - bool result = false; - VkFramebuffer result_fb = VK_NULL_HANDLE; - VkResult result_vk = VK_ERROR_INITIALIZATION_FAILED; + const auto n_attachments = m_create_info_ptr->get_n_attachments(); + bool result = false; + VkFramebuffer result_fb = VK_NULL_HANDLE; + VkResult result_vk = VK_ERROR_INITIALIZATION_FAILED; ANVIL_REDUNDANT_VARIABLE(result_vk); @@ -200,16 +105,6 @@ bool Anvil::Framebuffer::bake(Anvil::RenderPass* in_render_pass_ptr) goto end; } - /* Sanity checks: Make sure none of the FB size dimensions are 0 */ - if (m_framebuffer_size[0] < 1 || - m_framebuffer_size[1] < 1 || - m_framebuffer_size[2] < 1) - { - anvil_assert_fail(); - - goto end; - } - /* Release the existing Vulkan object handle, if one is already present * * TODO: Leverage the concept of render pass compatibility here! @@ -232,28 +127,40 @@ bool Anvil::Framebuffer::bake(Anvil::RenderPass* in_render_pass_ptr) } /* Prepare the image view array we will use as input for the create info descriptor */ - image_view_attachments.reserve(m_attachments.size() ); + image_view_attachments.reserve(n_attachments); - for (auto attachment_iterator = m_attachments.begin(); - attachment_iterator != m_attachments.end(); - ++attachment_iterator) + for (uint32_t n_attachment = 0; + n_attachment < n_attachments; + ++n_attachment) { - image_view_attachments.push_back(attachment_iterator->image_view_ptr->get_image_view() ); + Anvil::ImageView* image_view_ptr = nullptr; + + if (!m_create_info_ptr->get_attachment_at_index(n_attachment, + &image_view_ptr) ) + { + anvil_assert_fail(); + + goto end; + } + + anvil_assert(image_view_ptr != nullptr); + + image_view_attachments.push_back(image_view_ptr->get_image_view() ); } /* Prepare the create info descriptor */ - anvil_assert(in_render_pass_ptr->get_render_pass_info()->get_n_attachments() == image_view_attachments.size() ); + anvil_assert(in_render_pass_ptr->get_render_pass_create_info()->get_n_attachments() == image_view_attachments.size() ); fb_create_info.attachmentCount = static_cast(image_view_attachments.size() ); fb_create_info.flags = 0; - fb_create_info.height = m_framebuffer_size[1]; - fb_create_info.layers = m_framebuffer_size[2]; + fb_create_info.height = m_create_info_ptr->get_height (); + fb_create_info.layers = m_create_info_ptr->get_n_layers(); fb_create_info.pAttachments = (fb_create_info.attachmentCount > 0) ? &image_view_attachments[0] : nullptr; fb_create_info.pNext = nullptr; fb_create_info.renderPass = in_render_pass_ptr->get_render_pass(); fb_create_info.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO; - fb_create_info.width = m_framebuffer_size[0]; + fb_create_info.width = m_create_info_ptr->get_width(); /* Create the framebuffer instance and store it */ result_vk = vkCreateFramebuffer(m_device_ptr->get_device_vk(), @@ -280,66 +187,20 @@ bool Anvil::Framebuffer::bake(Anvil::RenderPass* in_render_pass_ptr) } /* Please see header for specification */ -Anvil::FramebufferUniquePtr Anvil::Framebuffer::create(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_width, - uint32_t in_height, - uint32_t in_n_layers, - MTSafety in_mt_safety) +Anvil::FramebufferUniquePtr Anvil::Framebuffer::create(Anvil::FramebufferCreateInfoUniquePtr in_create_info_ptr) { - const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); Anvil::FramebufferUniquePtr result_ptr(nullptr, std::default_delete() ); result_ptr.reset( - new Anvil::Framebuffer(in_device_ptr, - in_width, - in_height, - in_n_layers, - mt_safe) + new Anvil::Framebuffer( + std::move(in_create_info_ptr) + ) ); return result_ptr; } -/* Please see header for specification */ -bool Anvil::Framebuffer::get_attachment_at_index(uint32_t in_attachment_index, - ImageView** out_image_view_ptr_ptr) const -{ - bool result = false; - - if (m_attachments.size() <= in_attachment_index) - { - goto end; - } - else - { - *out_image_view_ptr_ptr = m_attachments[in_attachment_index].image_view_ptr; - result = true; - } - -end: - return result; -} - -/* Please see header for specification */ -bool Anvil::Framebuffer::get_attachment_id_for_image_view(ImageView* in_image_view_ptr, - FramebufferAttachmentID* out_attachment_id_ptr) -{ - bool result = false; - auto attachment_iterator = std::find(m_attachments.cbegin(), - m_attachments.cend(), - in_image_view_ptr); - - if (attachment_iterator != m_attachments.end() ) - { - *out_attachment_id_ptr = static_cast(attachment_iterator - m_attachments.begin() ); - result = true; - } - - return result; -} - /* Please see header for specification */ const VkFramebuffer Anvil::Framebuffer::get_framebuffer(Anvil::RenderPass* in_render_pass_ptr) { @@ -377,13 +238,3 @@ const VkFramebuffer Anvil::Framebuffer::get_framebuffer(Anvil::RenderPass* in_re end: return result_fb; } - -/* Please see header for specification */ -void Anvil::Framebuffer::get_size(uint32_t* out_framebuffer_width_ptr, - uint32_t* out_framebuffer_height_ptr, - uint32_t* out_framebuffer_depth_ptr) const -{ - *out_framebuffer_width_ptr = m_framebuffer_size[0]; - *out_framebuffer_height_ptr = m_framebuffer_size[1]; - *out_framebuffer_depth_ptr = m_framebuffer_size[2]; -} diff --git a/src/wrappers/graphics_pipeline_manager.cpp b/src/wrappers/graphics_pipeline_manager.cpp index b47e0f13..4eebf3c1 100644 --- a/src/wrappers/graphics_pipeline_manager.cpp +++ b/src/wrappers/graphics_pipeline_manager.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -21,12 +21,12 @@ // #include -#include "misc/base_pipeline_info.h" +#include "misc/base_pipeline_create_info.h" #include "misc/base_pipeline_manager.h" #include "misc/debug.h" -#include "misc/graphics_pipeline_info.h" +#include "misc/graphics_pipeline_create_info.h" #include "misc/object_tracker.h" -#include "misc/render_pass_info.h" +#include "misc/render_pass_create_info.h" #include "misc/struct_chainer.h" #include "wrappers/device.h" #include "wrappers/graphics_pipeline_manager.h" @@ -197,7 +197,7 @@ bool Anvil::GraphicsPipelineManager::bake() { bool color_blend_state_used = false; const PipelineID current_pipeline_id = bake_item_iterator->pipeline_id; - auto current_pipeline_info_ptr = dynamic_cast(bake_item_iterator->pipeline_ptr->pipeline_info_ptr.get() ); + auto current_pipeline_create_info_ptr = dynamic_cast(bake_item_iterator->pipeline_ptr->pipeline_create_info_ptr.get() ); Pipeline* current_pipeline_ptr = bake_item_iterator->pipeline_ptr; const Anvil::RenderPass* current_pipeline_renderpass_ptr = nullptr; Anvil::SubPassID current_pipeline_subpass_id; @@ -211,30 +211,30 @@ bool Anvil::GraphicsPipelineManager::bake() VkPipelineVertexInputStateCreateInfo vertex_input_state_create_info; bool viewport_state_used = false; - if (current_pipeline_info_ptr == nullptr) + if (current_pipeline_create_info_ptr == nullptr) { - anvil_assert(current_pipeline_info_ptr != nullptr); + anvil_assert(current_pipeline_create_info_ptr != nullptr); continue; } - current_pipeline_renderpass_ptr = current_pipeline_info_ptr->get_renderpass(); - current_pipeline_subpass_id = current_pipeline_info_ptr->get_subpass_id(); + current_pipeline_renderpass_ptr = current_pipeline_create_info_ptr->get_renderpass(); + current_pipeline_subpass_id = current_pipeline_create_info_ptr->get_subpass_id(); - if (current_pipeline_info_ptr->is_proxy() ) + if (current_pipeline_create_info_ptr->is_proxy() ) { continue; } /* Extract subpass information */ - current_pipeline_renderpass_ptr->get_render_pass_info()->get_subpass_n_attachments(current_pipeline_subpass_id, - ATTACHMENT_TYPE_COLOR, - &subpass_n_color_attachments); + current_pipeline_renderpass_ptr->get_render_pass_create_info()->get_subpass_n_attachments(current_pipeline_subpass_id, + ATTACHMENT_TYPE_COLOR, + &subpass_n_color_attachments); /* Form the color blend state create info descriptor, if needed */ { - if (!current_pipeline_info_ptr->is_rasterizer_discard_enabled() && - subpass_n_color_attachments > 0) + if (!current_pipeline_create_info_ptr->is_rasterizer_discard_enabled() && + subpass_n_color_attachments > 0) { const float* blend_constant_ptr = nullptr; VkPipelineColorBlendStateCreateInfo color_blend_state_create_info; @@ -242,11 +242,11 @@ bool Anvil::GraphicsPipelineManager::bake() bool logic_op_enabled = false; const uint32_t start_offset = static_cast(color_blend_attachment_states_vk_cache.size() ); - current_pipeline_info_ptr->get_blending_properties(&blend_constant_ptr, - nullptr); /* out_opt_n_blend_attachments_ptr */ + current_pipeline_create_info_ptr->get_blending_properties(&blend_constant_ptr, + nullptr); /* out_opt_n_blend_attachments_ptr */ - current_pipeline_info_ptr->get_logic_op_state(&logic_op_enabled, - &logic_op); + current_pipeline_create_info_ptr->get_logic_op_state(&logic_op_enabled, + &logic_op); color_blend_state_create_info.attachmentCount = subpass_n_color_attachments; color_blend_state_create_info.flags = 0; @@ -269,15 +269,15 @@ bool Anvil::GraphicsPipelineManager::bake() VkPipelineColorBlendAttachmentState* blend_attachment_state_ptr = &color_blend_attachment_states_vk_cache.back(); bool is_blending_enabled_for_attachment = false; - if (!current_pipeline_info_ptr->get_color_blend_attachment_properties(n_subpass_color_attachment, - &is_blending_enabled_for_attachment, - &blend_attachment_state_ptr->colorBlendOp, - &blend_attachment_state_ptr->alphaBlendOp, - &blend_attachment_state_ptr->srcColorBlendFactor, - &blend_attachment_state_ptr->dstColorBlendFactor, - &blend_attachment_state_ptr->srcAlphaBlendFactor, - &blend_attachment_state_ptr->dstAlphaBlendFactor, - &blend_attachment_state_ptr->colorWriteMask) ) + if (!current_pipeline_create_info_ptr->get_color_blend_attachment_properties(n_subpass_color_attachment, + &is_blending_enabled_for_attachment, + &blend_attachment_state_ptr->colorBlendOp, + &blend_attachment_state_ptr->alphaBlendOp, + &blend_attachment_state_ptr->srcColorBlendFactor, + &blend_attachment_state_ptr->dstColorBlendFactor, + &blend_attachment_state_ptr->srcAlphaBlendFactor, + &blend_attachment_state_ptr->dstAlphaBlendFactor, + &blend_attachment_state_ptr->colorWriteMask) ) { /* The user has not defined blending properties for current color attachment. Use default state values .. */ blend_attachment_state_ptr->blendEnable = VK_FALSE; @@ -311,8 +311,8 @@ bool Anvil::GraphicsPipelineManager::bake() /* No color attachments available. Make sure none of the dependent modes are enabled. */ bool logic_op_enabled = false; - current_pipeline_info_ptr->get_logic_op_state(&logic_op_enabled, - nullptr); /* out_opt_logic_op_ptr */ + current_pipeline_create_info_ptr->get_logic_op_state(&logic_op_enabled, + nullptr); /* out_opt_logic_op_ptr */ anvil_assert(!logic_op_enabled); @@ -331,39 +331,39 @@ bool Anvil::GraphicsPipelineManager::bake() float min_depth_bounds = std::numeric_limits::max(); uint32_t n_depth_stencil_attachments = 0; - current_pipeline_info_ptr->get_depth_bounds_state(&is_depth_bounds_test_enabled, - &min_depth_bounds, - &max_depth_bounds); - - current_pipeline_info_ptr->get_depth_test_state(&is_depth_test_enabled, - &depth_test_compare_op); - - current_pipeline_info_ptr->get_stencil_test_properties(&is_stencil_test_enabled, - &depth_stencil_state_create_info.front.failOp, - &depth_stencil_state_create_info.front.passOp, - &depth_stencil_state_create_info.front.depthFailOp, - &depth_stencil_state_create_info.front.compareOp, - &depth_stencil_state_create_info.front.compareMask, - &depth_stencil_state_create_info.front.writeMask, - &depth_stencil_state_create_info.front.reference, - &depth_stencil_state_create_info.back.failOp, - &depth_stencil_state_create_info.back.passOp, - &depth_stencil_state_create_info.back.depthFailOp, - &depth_stencil_state_create_info.back.compareOp, - &depth_stencil_state_create_info.back.compareMask, - &depth_stencil_state_create_info.back.writeMask, - &depth_stencil_state_create_info.back.reference); - - current_pipeline_renderpass_ptr->get_render_pass_info()->get_subpass_n_attachments(current_pipeline_info_ptr->get_subpass_id(), - ATTACHMENT_TYPE_DEPTH_STENCIL, - &n_depth_stencil_attachments); + current_pipeline_create_info_ptr->get_depth_bounds_state(&is_depth_bounds_test_enabled, + &min_depth_bounds, + &max_depth_bounds); + + current_pipeline_create_info_ptr->get_depth_test_state(&is_depth_test_enabled, + &depth_test_compare_op); + + current_pipeline_create_info_ptr->get_stencil_test_properties(&is_stencil_test_enabled, + &depth_stencil_state_create_info.front.failOp, + &depth_stencil_state_create_info.front.passOp, + &depth_stencil_state_create_info.front.depthFailOp, + &depth_stencil_state_create_info.front.compareOp, + &depth_stencil_state_create_info.front.compareMask, + &depth_stencil_state_create_info.front.writeMask, + &depth_stencil_state_create_info.front.reference, + &depth_stencil_state_create_info.back.failOp, + &depth_stencil_state_create_info.back.passOp, + &depth_stencil_state_create_info.back.depthFailOp, + &depth_stencil_state_create_info.back.compareOp, + &depth_stencil_state_create_info.back.compareMask, + &depth_stencil_state_create_info.back.writeMask, + &depth_stencil_state_create_info.back.reference); + + current_pipeline_renderpass_ptr->get_render_pass_create_info()->get_subpass_n_attachments(current_pipeline_create_info_ptr->get_subpass_id(), + ATTACHMENT_TYPE_DEPTH_STENCIL, + &n_depth_stencil_attachments); if (n_depth_stencil_attachments) { depth_stencil_state_create_info.depthBoundsTestEnable = is_depth_bounds_test_enabled ? VK_TRUE : VK_FALSE; depth_stencil_state_create_info.depthCompareOp = depth_test_compare_op; - depth_stencil_state_create_info.depthTestEnable = is_depth_test_enabled ? VK_TRUE : VK_FALSE; - depth_stencil_state_create_info.depthWriteEnable = current_pipeline_info_ptr->are_depth_writes_enabled() ? VK_TRUE : VK_FALSE; + depth_stencil_state_create_info.depthTestEnable = is_depth_test_enabled ? VK_TRUE : VK_FALSE; + depth_stencil_state_create_info.depthWriteEnable = current_pipeline_create_info_ptr->are_depth_writes_enabled() ? VK_TRUE : VK_FALSE; depth_stencil_state_create_info.flags = 0; depth_stencil_state_create_info.maxDepthBounds = max_depth_bounds; depth_stencil_state_create_info.minDepthBounds = min_depth_bounds; @@ -380,7 +380,7 @@ bool Anvil::GraphicsPipelineManager::bake() /* No depth/stencil attachment available. Make sure none of the dependent modes are enabled. */ anvil_assert(!is_depth_bounds_test_enabled); anvil_assert(!is_depth_test_enabled); - anvil_assert(!current_pipeline_info_ptr->are_depth_writes_enabled()); + anvil_assert(!current_pipeline_create_info_ptr->are_depth_writes_enabled()); anvil_assert(!is_stencil_test_enabled); depth_stencil_state_used = false; @@ -389,7 +389,7 @@ bool Anvil::GraphicsPipelineManager::bake() /* Form the dynamic state create info descriptor, if needed */ { - const auto& enabled_dynamic_states = current_pipeline_info_ptr->get_enabled_dynamic_states(); + const auto& enabled_dynamic_states = current_pipeline_create_info_ptr->get_enabled_dynamic_states(); if (enabled_dynamic_states != 0) { @@ -462,9 +462,9 @@ bool Anvil::GraphicsPipelineManager::bake() { input_assembly_state_create_info.flags = 0; input_assembly_state_create_info.pNext = nullptr; - input_assembly_state_create_info.primitiveRestartEnable = current_pipeline_info_ptr->is_primitive_restart_enabled() ? VK_TRUE : VK_FALSE; + input_assembly_state_create_info.primitiveRestartEnable = current_pipeline_create_info_ptr->is_primitive_restart_enabled() ? VK_TRUE : VK_FALSE; input_assembly_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO; - input_assembly_state_create_info.topology = current_pipeline_info_ptr->get_primitive_topology(); + input_assembly_state_create_info.topology = current_pipeline_create_info_ptr->get_primitive_topology(); input_assembly_state_create_info_items_vk_cache.push_back(input_assembly_state_create_info); } @@ -474,18 +474,18 @@ bool Anvil::GraphicsPipelineManager::bake() bool is_sample_shading_enabled = false; float min_sample_shading = std::numeric_limits::max(); - current_pipeline_info_ptr->get_sample_shading_state(&is_sample_shading_enabled, - &min_sample_shading); + current_pipeline_create_info_ptr->get_sample_shading_state(&is_sample_shading_enabled, + &min_sample_shading); - if (!current_pipeline_info_ptr->is_rasterizer_discard_enabled() ) + if (!current_pipeline_create_info_ptr->is_rasterizer_discard_enabled() ) { - const bool is_sample_mask_enabled = current_pipeline_info_ptr->is_sample_mask_enabled(); + const bool is_sample_mask_enabled = current_pipeline_create_info_ptr->is_sample_mask_enabled(); VkPipelineMultisampleStateCreateInfo multisample_state_create_info; VkSampleCountFlags sample_count = VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM; VkSampleMask sample_mask; - current_pipeline_info_ptr->get_multisampling_properties(&sample_count, - &sample_mask); + current_pipeline_create_info_ptr->get_multisampling_properties(&sample_count, + &sample_mask); /* If sample mask is not enabled, Vulkan spec will assume all samples need to pass. This is what the default sample mask value mimics. * @@ -495,8 +495,8 @@ bool Anvil::GraphicsPipelineManager::bake() anvil_assert((!is_sample_mask_enabled && sample_mask == ~0u) || is_sample_mask_enabled); - multisample_state_create_info.alphaToCoverageEnable = current_pipeline_info_ptr->is_alpha_to_coverage_enabled() ? VK_TRUE : VK_FALSE; - multisample_state_create_info.alphaToOneEnable = current_pipeline_info_ptr->is_alpha_to_one_enabled() ? VK_TRUE : VK_FALSE; + multisample_state_create_info.alphaToCoverageEnable = current_pipeline_create_info_ptr->is_alpha_to_coverage_enabled() ? VK_TRUE : VK_FALSE; + multisample_state_create_info.alphaToOneEnable = current_pipeline_create_info_ptr->is_alpha_to_one_enabled() ? VK_TRUE : VK_FALSE; multisample_state_create_info.flags = 0; multisample_state_create_info.minSampleShading = min_sample_shading; multisample_state_create_info.pNext = nullptr; @@ -512,8 +512,8 @@ bool Anvil::GraphicsPipelineManager::bake() else { /* Make sure any dependent modes are disabled */ - anvil_assert(!current_pipeline_info_ptr->is_alpha_to_coverage_enabled() ); - anvil_assert(!current_pipeline_info_ptr->is_alpha_to_one_enabled () ); + anvil_assert(!current_pipeline_create_info_ptr->is_alpha_to_coverage_enabled() ); + anvil_assert(!current_pipeline_create_info_ptr->is_alpha_to_one_enabled () ); anvil_assert(!is_sample_shading_enabled); multisample_state_used = false; @@ -532,14 +532,14 @@ bool Anvil::GraphicsPipelineManager::bake() VkPolygonMode polygon_mode = VK_POLYGON_MODE_MAX_ENUM; Anvil::StructChainer raster_state_create_info_chainer; - current_pipeline_info_ptr->get_depth_bias_state (&is_depth_bias_enabled, - &depth_bias_constant_factor, - &depth_bias_clamp, - &depth_bias_slope_factor); - current_pipeline_info_ptr->get_rasterization_properties(&polygon_mode, - &cull_mode, - &front_face, - &line_width); + current_pipeline_create_info_ptr->get_depth_bias_state (&is_depth_bias_enabled, + &depth_bias_constant_factor, + &depth_bias_clamp, + &depth_bias_slope_factor); + current_pipeline_create_info_ptr->get_rasterization_properties(&polygon_mode, + &cull_mode, + &front_face, + &line_width); { VkPipelineRasterizationStateCreateInfo raster_state_create_info; @@ -549,13 +549,13 @@ bool Anvil::GraphicsPipelineManager::bake() raster_state_create_info.depthBiasConstantFactor = depth_bias_constant_factor; raster_state_create_info.depthBiasEnable = is_depth_bias_enabled ? VK_TRUE : VK_FALSE; raster_state_create_info.depthBiasSlopeFactor = depth_bias_slope_factor; - raster_state_create_info.depthClampEnable = current_pipeline_info_ptr->is_depth_clamp_enabled() ? VK_TRUE : VK_FALSE; + raster_state_create_info.depthClampEnable = current_pipeline_create_info_ptr->is_depth_clamp_enabled() ? VK_TRUE : VK_FALSE; raster_state_create_info.flags = 0; raster_state_create_info.frontFace = front_face; raster_state_create_info.lineWidth = line_width; raster_state_create_info.pNext = nullptr; raster_state_create_info.polygonMode = polygon_mode; - raster_state_create_info.rasterizerDiscardEnable = current_pipeline_info_ptr->is_rasterizer_discard_enabled() ? VK_TRUE : VK_FALSE; + raster_state_create_info.rasterizerDiscardEnable = current_pipeline_create_info_ptr->is_rasterizer_discard_enabled() ? VK_TRUE : VK_FALSE; raster_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO; raster_state_create_info_chainer.append_struct(raster_state_create_info); @@ -566,9 +566,9 @@ bool Anvil::GraphicsPipelineManager::bake() /* Chain a predefined struct which will toggle the relaxed rasterization, as long as the device supports the * VK_AMD_rasterization_order extension. */ - if (current_pipeline_info_ptr->get_rasterization_order() != VK_RASTERIZATION_ORDER_STRICT_AMD) + if (current_pipeline_create_info_ptr->get_rasterization_order() != VK_RASTERIZATION_ORDER_STRICT_AMD) { - anvil_assert(current_pipeline_info_ptr->get_rasterization_order() == relaxed_rasterization_order_item.rasterizationOrder); + anvil_assert(current_pipeline_create_info_ptr->get_rasterization_order() == relaxed_rasterization_order_item.rasterizationOrder); raster_state_create_info_chainer.append_struct(relaxed_rasterization_order_item); } @@ -578,7 +578,7 @@ bool Anvil::GraphicsPipelineManager::bake() } } else - if (current_pipeline_info_ptr->get_rasterization_order() != VK_RASTERIZATION_ORDER_STRICT_AMD) + if (current_pipeline_create_info_ptr->get_rasterization_order() != VK_RASTERIZATION_ORDER_STRICT_AMD) { fprintf(stderr, "[!] Cannot enable out-of-order rasterization - VK_AMD_rasterization_order extension not enabled at device creation time\n"); @@ -605,8 +605,8 @@ bool Anvil::GraphicsPipelineManager::bake() { const Anvil::ShaderModuleStageEntryPoint* shader_stage_entry_point_ptr = nullptr; - current_pipeline_info_ptr->get_shader_stage_properties(current_graphics_shader_stage, - &shader_stage_entry_point_ptr); + current_pipeline_create_info_ptr->get_shader_stage_properties(current_graphics_shader_stage, + &shader_stage_entry_point_ptr); if (shader_stage_entry_point_ptr != nullptr) { @@ -617,9 +617,9 @@ bool Anvil::GraphicsPipelineManager::bake() specialization_info_vk_cache.push_back(VkSpecializationInfo() ); - current_pipeline_info_ptr->get_specialization_constants(current_graphics_shader_stage, - ¤t_shader_stage_specialization_constants_ptr, - ¤t_shader_stage_specialization_constants_data_buffer_ptr); + current_pipeline_create_info_ptr->get_specialization_constants(current_graphics_shader_stage, + ¤t_shader_stage_specialization_constants_ptr, + ¤t_shader_stage_specialization_constants_data_buffer_ptr); if (current_shader_stage_specialization_constants_ptr->size() > 0) { @@ -656,10 +656,10 @@ bool Anvil::GraphicsPipelineManager::bake() const Anvil::ShaderModuleStageEntryPoint* tc_shader_stage_entry_point_ptr = nullptr; const Anvil::ShaderModuleStageEntryPoint* te_shader_stage_entry_point_ptr = nullptr; - current_pipeline_info_ptr->get_shader_stage_properties(Anvil::SHADER_STAGE_TESSELLATION_CONTROL, - &tc_shader_stage_entry_point_ptr); - current_pipeline_info_ptr->get_shader_stage_properties(Anvil::SHADER_STAGE_TESSELLATION_EVALUATION, - &te_shader_stage_entry_point_ptr); + current_pipeline_create_info_ptr->get_shader_stage_properties(Anvil::SHADER_STAGE_TESSELLATION_CONTROL, + &tc_shader_stage_entry_point_ptr); + current_pipeline_create_info_ptr->get_shader_stage_properties(Anvil::SHADER_STAGE_TESSELLATION_EVALUATION, + &te_shader_stage_entry_point_ptr); if (tc_shader_stage_entry_point_ptr != nullptr && te_shader_stage_entry_point_ptr != nullptr) @@ -667,7 +667,7 @@ bool Anvil::GraphicsPipelineManager::bake() VkPipelineTessellationStateCreateInfo tessellation_state_create_info; tessellation_state_create_info.flags = 0; - tessellation_state_create_info.patchControlPoints = current_pipeline_info_ptr->get_n_patch_control_points(); + tessellation_state_create_info.patchControlPoints = current_pipeline_create_info_ptr->get_n_patch_control_points(); tessellation_state_create_info.pNext = nullptr; tessellation_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO; @@ -688,7 +688,7 @@ bool Anvil::GraphicsPipelineManager::bake() anvil_assert(m_pipeline_id_to_gfx_pipeline_data.find(current_pipeline_id) == m_pipeline_id_to_gfx_pipeline_data.end() ); current_pipeline_gfx_data_ptr.reset( - new GraphicsPipelineData(current_pipeline_info_ptr) + new GraphicsPipelineData(current_pipeline_create_info_ptr) ); if (current_pipeline_gfx_data_ptr == nullptr) @@ -715,13 +715,13 @@ bool Anvil::GraphicsPipelineManager::bake() } /* Form the viewport state create info descriptor, if needed */ - if (!current_pipeline_info_ptr->is_rasterizer_discard_enabled() ) + if (!current_pipeline_create_info_ptr->is_rasterizer_discard_enabled() ) { - const auto enabled_dynamic_states = current_pipeline_info_ptr->get_enabled_dynamic_states(); - uint32_t n_scissor_boxes = (enabled_dynamic_states & DYNAMIC_STATE_SCISSOR_BIT) ? current_pipeline_info_ptr->get_n_dynamic_scissor_boxes() - : current_pipeline_info_ptr->get_n_scissor_boxes (); - uint32_t n_viewports = (enabled_dynamic_states & DYNAMIC_STATE_VIEWPORT_BIT) ? current_pipeline_info_ptr->get_n_dynamic_viewports () - : current_pipeline_info_ptr->get_n_viewports (); + const auto enabled_dynamic_states = current_pipeline_create_info_ptr->get_enabled_dynamic_states(); + uint32_t n_scissor_boxes = (enabled_dynamic_states & DYNAMIC_STATE_SCISSOR_BIT) ? current_pipeline_create_info_ptr->get_n_dynamic_scissor_boxes() + : current_pipeline_create_info_ptr->get_n_scissor_boxes (); + uint32_t n_viewports = (enabled_dynamic_states & DYNAMIC_STATE_VIEWPORT_BIT) ? current_pipeline_create_info_ptr->get_n_dynamic_viewports () + : current_pipeline_create_info_ptr->get_n_viewports (); const uint32_t scissor_boxes_start_offset = static_cast(scissor_boxes_vk_cache.size() ); const uint32_t viewports_start_offset = static_cast(viewports_vk_cache.size() ); VkPipelineViewportStateCreateInfo viewport_state_create_info; @@ -731,7 +731,7 @@ bool Anvil::GraphicsPipelineManager::bake() if (n_scissor_boxes == 0) { /* No scissor boxes / viewport defined. Use default settings.. */ - auto swapchain_ptr = current_pipeline_info_ptr->get_renderpass()->get_swapchain(); + auto swapchain_ptr = current_pipeline_create_info_ptr->get_renderpass()->get_swapchain(); uint32_t window_size[2] = {0}; /* NOTE: If you hit this assertion, you either need to pass a Swapchain instance when this renderpass is being created, @@ -748,18 +748,18 @@ bool Anvil::GraphicsPipelineManager::bake() anvil_assert(window_size[0] != 0 && window_size[1] != 0); - current_pipeline_info_ptr->set_scissor_box_properties(0, /* in_n_scissor_box */ - 0, /* in_x */ - 0, /* in_y */ - window_size[0], - window_size[1]); - current_pipeline_info_ptr->set_viewport_properties (0, /* in_n_viewport */ - 0.0f, /* in_origin_x */ - 0.0f, /* in_origin_y */ - static_cast(window_size[0]), - static_cast(window_size[1]), - 0.0f, /* in_min_depth */ - 1.0f); /* in_max_depth */ + current_pipeline_create_info_ptr->set_scissor_box_properties(0, /* in_n_scissor_box */ + 0, /* in_x */ + 0, /* in_y */ + window_size[0], + window_size[1]); + current_pipeline_create_info_ptr->set_viewport_properties (0, /* in_n_viewport */ + 0.0f, /* in_origin_x */ + 0.0f, /* in_origin_y */ + static_cast(window_size[0]), + static_cast(window_size[1]), + 0.0f, /* in_min_depth */ + 1.0f); /* in_max_depth */ n_scissor_boxes = 1; n_viewports = 1; @@ -778,11 +778,11 @@ bool Anvil::GraphicsPipelineManager::bake() int32_t current_scissor_box_y = INT32_MAX; VkRect2D current_scissor_box_vk; - current_pipeline_info_ptr->get_scissor_box_properties(n_scissor_box, - ¤t_scissor_box_x, - ¤t_scissor_box_y, - ¤t_scissor_box_width, - ¤t_scissor_box_height); + current_pipeline_create_info_ptr->get_scissor_box_properties(n_scissor_box, + ¤t_scissor_box_x, + ¤t_scissor_box_y, + ¤t_scissor_box_width, + ¤t_scissor_box_height); current_scissor_box_vk.extent.height = current_scissor_box_height; current_scissor_box_vk.extent.width = current_scissor_box_width; current_scissor_box_vk.offset.x = current_scissor_box_x; @@ -806,13 +806,13 @@ bool Anvil::GraphicsPipelineManager::bake() float current_viewport_width = std::numeric_limits::max(); VkViewport current_viewport_vk; - current_pipeline_info_ptr->get_viewport_properties(n_viewport, - ¤t_viewport_origin_x, - ¤t_viewport_origin_y, - ¤t_viewport_width, - ¤t_viewport_height, - ¤t_viewport_min_depth, - ¤t_viewport_max_depth); + current_pipeline_create_info_ptr->get_viewport_properties(n_viewport, + ¤t_viewport_origin_x, + ¤t_viewport_origin_y, + ¤t_viewport_width, + ¤t_viewport_height, + ¤t_viewport_min_depth, + ¤t_viewport_max_depth); current_viewport_vk.height = current_viewport_height; current_viewport_vk.maxDepth = current_viewport_max_depth; @@ -850,10 +850,10 @@ bool Anvil::GraphicsPipelineManager::bake() /* Bake the GFX pipeline info struct chain */ { - VkGraphicsPipelineCreateInfo graphics_pipeline_create_info = {}; + VkGraphicsPipelineCreateInfo graphics_pipeline_create_info = {}; /* Configure base pipeline handle/indices fields of the create info descriptor */ - const auto current_pipeline_base_pipeline_id = current_pipeline_info_ptr->get_base_pipeline_id(); + const auto current_pipeline_base_pipeline_id = current_pipeline_create_info_ptr->get_base_pipeline_id(); if (current_pipeline_base_pipeline_id != UINT32_MAX) { @@ -921,18 +921,18 @@ bool Anvil::GraphicsPipelineManager::bake() graphics_pipeline_create_info.pVertexInputState = &vertex_input_state_create_info_items_vk_cache[vertex_input_state_create_info_items_vk_cache.size() - 1]; graphics_pipeline_create_info.pViewportState = (viewport_state_used) ? &viewport_state_create_info_items_vk_cache[viewport_state_create_info_items_vk_cache.size() - 1] : VK_NULL_HANDLE; - graphics_pipeline_create_info.renderPass = current_pipeline_info_ptr->get_renderpass()->get_render_pass(); + graphics_pipeline_create_info.renderPass = current_pipeline_create_info_ptr->get_renderpass()->get_render_pass(); graphics_pipeline_create_info.stageCount = static_cast(shader_stage_create_info_items_vk_cache.size() - shader_stage_start_offset); graphics_pipeline_create_info.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO; - graphics_pipeline_create_info.subpass = current_pipeline_info_ptr->get_subpass_id(); + graphics_pipeline_create_info.subpass = current_pipeline_create_info_ptr->get_subpass_id(); if (graphics_pipeline_create_info.basePipelineIndex != static_cast(UINT32_MAX) ) { graphics_pipeline_create_info.flags |= VK_PIPELINE_CREATE_DERIVATIVE_BIT; } - graphics_pipeline_create_info.flags |= ((current_pipeline_info_ptr->allows_derivatives () ) ? VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT : 0) | - ((current_pipeline_info_ptr->has_optimizations_disabled() ) ? VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT : 0); + graphics_pipeline_create_info.flags |= ((current_pipeline_create_info_ptr->allows_derivatives () ) ? VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT : 0) | + ((current_pipeline_create_info_ptr->has_optimizations_disabled() ) ? VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT : 0); graphics_pipeline_create_info_chainer.append_struct(graphics_pipeline_create_info); } @@ -1058,11 +1058,11 @@ void Anvil::GraphicsPipelineManager::GraphicsPipelineData::bake_vk_attributes_an anvil_assert(vk_input_attributes.size () == 0); anvil_assert(vk_input_bindings.size () == 0); - pipeline_info_ptr->get_graphics_pipeline_properties(nullptr, /* out_opt_n_scissors_ptr */ - nullptr, /* out_opt_n_viewports_ptr */ - &n_attributes, /* out_opt_n_vertex_attributes_ptr */ - nullptr, /* out_opt_renderpass_ptr */ - nullptr); /* out_opt_subpass_id_ptr */ + pipeline_create_info_ptr->get_graphics_pipeline_properties(nullptr, /* out_opt_n_scissors_ptr */ + nullptr, /* out_opt_n_viewports_ptr */ + &n_attributes, /* out_opt_n_vertex_attributes_ptr */ + nullptr, /* out_opt_renderpass_ptr */ + nullptr); /* out_opt_subpass_id_ptr */ for (uint32_t n_attribute = 0; n_attribute < n_attributes; @@ -1081,13 +1081,13 @@ void Anvil::GraphicsPipelineManager::GraphicsPipelineData::bake_vk_attributes_an uint32_t n_attribute_binding = UINT32_MAX; bool has_found = false; - if (!pipeline_info_ptr->get_vertex_attribute_properties(n_attribute, - ¤t_attribute_location, - ¤t_attribute_format, - ¤t_attribute_offset, - ¤t_attribute_explicit_vertex_binding_index, - ¤t_attribute_stride, - ¤t_attribute_rate) ) + if (!pipeline_create_info_ptr->get_vertex_attribute_properties(n_attribute, + ¤t_attribute_location, + ¤t_attribute_format, + ¤t_attribute_offset, + ¤t_attribute_explicit_vertex_binding_index, + ¤t_attribute_stride, + ¤t_attribute_rate) ) { anvil_assert_fail(); diff --git a/src/wrappers/image.cpp b/src/wrappers/image.cpp index efb90e98..f74d2fb5 100644 --- a/src/wrappers/image.cpp +++ b/src/wrappers/image.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -20,10 +20,13 @@ // THE SOFTWARE. // +#include "misc/buffer_create_info.h" #include "misc/debug.h" #include "misc/formats.h" +#include "misc/image_create_info.h" #include "misc/object_tracker.h" #include "misc/struct_chainer.h" +#include "misc/swapchain_create_info.h" #include "wrappers/buffer.h" #include "wrappers/command_buffer.h" #include "wrappers/command_pool.h" @@ -45,61 +48,21 @@ #endif /* Please see header for specification */ -Anvil::Image::Image(const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkSharingMode in_sharing_mode, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - bool in_use_full_mipmap_chain, - Anvil::ImageCreateFlags in_create_flags, - Anvil::QueueFamilyBits in_queue_families, - VkImageLayout in_post_create_image_layout, - const std::vector* in_opt_mipmaps_ptr, - bool in_mt_safe) - :CallbacksSupportProvider (IMAGE_CALLBACK_ID_COUNT), - DebugMarkerSupportProvider (in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT), - MTSafetySupportProvider (in_mt_safe), - m_alignment (UINT64_MAX), - m_create_flags (in_create_flags), - m_depth (in_base_mipmap_depth), - m_device_ptr (in_device_ptr), - m_format (in_format), - m_has_transitioned_to_post_create_layout(false), - m_height (in_base_mipmap_height), - m_image (VK_NULL_HANDLE), - m_image_owner (true), - m_is_sparse (false), - m_is_swapchain_image (false), - m_memory_set_by_world (true), - m_memory_types (0), - m_n_mipmaps (0), - m_n_layers (in_n_layers), - m_n_slices (0), - m_post_create_layout (in_post_create_image_layout), - m_queue_families (in_queue_families), - m_residency_scope (Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED), - m_sample_count (in_sample_count), - m_sharing_mode (in_sharing_mode), - m_storage_size (0), - m_swapchain_memory_assigned (false), - m_swapchain_ptr (nullptr), - m_tiling (in_tiling), - m_type (in_type), - m_usage (static_cast(in_usage)), - m_uses_full_mipmap_chain (in_use_full_mipmap_chain), - m_width (in_base_mipmap_width) +Anvil::Image::Image(Anvil::ImageCreateInfoUniquePtr in_create_info_ptr) + :CallbacksSupportProvider (IMAGE_CALLBACK_ID_COUNT), + DebugMarkerSupportProvider (in_create_info_ptr->get_device(), + VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT), + MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), + in_create_info_ptr->get_device () )), + m_alignment (UINT64_MAX), + m_has_transitioned_to_post_alloc_layout(false), + m_image (VK_NULL_HANDLE), + m_memory_types (0), + m_n_mipmaps (0), + m_storage_size (0), + m_swapchain_memory_assigned (false) { - if (in_opt_mipmaps_ptr != nullptr) - { - m_mipmaps_to_upload = *in_opt_mipmaps_ptr; - } + m_create_info_ptr = std::move(in_create_info_ptr); /* Register this instance */ Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_IMAGE, @@ -107,180 +70,6 @@ Anvil::Image::Image(const Anvil::BaseDevice* in_device_ptr, } -/* Please see header for specification */ -Anvil::Image::Image(const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkSharingMode in_sharing_mode, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, - bool in_use_full_mipmap_chain, - Anvil::ImageCreateFlags in_create_flags, - VkImageLayout in_post_create_image_layout, - const std::vector* in_mipmaps_ptr, - bool in_mt_safe) - :CallbacksSupportProvider (IMAGE_CALLBACK_ID_COUNT), - DebugMarkerSupportProvider (in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT), - MTSafetySupportProvider (in_mt_safe), - m_alignment (UINT64_MAX), - m_create_flags (in_create_flags), - m_depth (in_base_mipmap_depth), - m_device_ptr (in_device_ptr), - m_format (in_format), - m_has_transitioned_to_post_create_layout(false), - m_height (in_base_mipmap_height), - m_image (VK_NULL_HANDLE), - m_image_owner (true), - m_is_sparse (false), - m_is_swapchain_image (false), - m_memory_set_by_world (false), - m_memory_types (0), - m_n_layers (in_n_layers), - m_n_mipmaps (0), - m_n_slices (0), - m_post_create_layout (in_post_create_image_layout), - m_queue_families (in_queue_families), - m_residency_scope (Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED), - m_sample_count (in_sample_count), - m_sharing_mode (in_sharing_mode), - m_storage_size (0), - m_swapchain_memory_assigned (false), - m_swapchain_ptr (nullptr), - m_tiling (in_tiling), - m_type (in_type), - m_usage (static_cast(in_usage)), - m_uses_full_mipmap_chain (in_use_full_mipmap_chain), - m_width (in_base_mipmap_width) -{ - if (in_mipmaps_ptr != nullptr) - { - m_mipmaps_to_upload = *in_mipmaps_ptr; - } - - /* Register this instance */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_IMAGE, - this); -} - -/* Please see header for specification */ -Anvil::Image::Image(const Anvil::BaseDevice* in_device_ptr, - VkImage in_image, - VkFormat in_format, - VkImageTiling in_tiling, - VkSharingMode in_sharing_mode, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - uint32_t in_n_mipmaps, - VkSampleCountFlagBits in_sample_count, - uint32_t in_n_slices, - Anvil::ImageCreateFlags in_create_flags, - Anvil::QueueFamilyBits in_queue_families, - bool in_mt_safe) - :CallbacksSupportProvider (IMAGE_CALLBACK_ID_COUNT), - DebugMarkerSupportProvider (in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT), - MTSafetySupportProvider (in_mt_safe), - m_alignment (UINT64_MAX), - m_create_flags (in_create_flags), - m_depth (in_base_mipmap_depth), - m_device_ptr (in_device_ptr), - m_format (in_format), - m_has_transitioned_to_post_create_layout(true), - m_height (in_base_mipmap_height), - m_image (in_image), - m_image_owner (false), - m_is_sparse (false), - m_is_swapchain_image (false), - m_memory_set_by_world (false), - m_memory_types (0), - m_n_layers (in_n_layers), - m_n_mipmaps (in_n_mipmaps), - m_n_slices (in_n_slices), - m_post_create_layout (VK_IMAGE_LAYOUT_UNDEFINED), - m_queue_families (in_queue_families), - m_residency_scope (Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED), - m_sample_count (in_sample_count), - m_sharing_mode (in_sharing_mode), - m_storage_size (0), - m_swapchain_memory_assigned (false), - m_swapchain_ptr (nullptr), - m_tiling (in_tiling), - m_type (VK_IMAGE_TYPE_MAX_ENUM), - m_usage (static_cast(in_usage)), - m_uses_full_mipmap_chain (false), - m_width (in_base_mipmap_width) -{ - /* Register this instance */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_IMAGE, - this); -} - -/** Please see header for specification */ -Anvil::Image::Image(const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - Anvil::ImageCreateFlags in_create_flags, - Anvil::SparseResidencyScope in_residency_scope, - bool in_mt_safe) - :CallbacksSupportProvider (IMAGE_CALLBACK_ID_COUNT), - DebugMarkerSupportProvider (in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT), - MTSafetySupportProvider (in_mt_safe), - m_alignment (UINT64_MAX), - m_create_flags (in_create_flags), - m_depth (in_base_mipmap_depth), - m_device_ptr (in_device_ptr), - m_format (in_format), - m_has_transitioned_to_post_create_layout(true), - m_height (in_base_mipmap_height), - m_image (VK_NULL_HANDLE), - m_image_owner (true), - m_is_sparse (true), - m_is_swapchain_image (false), - m_memory_set_by_world (true), - m_memory_types (0), - m_n_layers (in_n_layers), - m_n_mipmaps (0), - m_n_slices (0), - m_post_create_layout (VK_IMAGE_LAYOUT_UNDEFINED), - m_queue_families (in_queue_families), - m_residency_scope (in_residency_scope), - m_sample_count (in_sample_count), - m_sharing_mode (in_sharing_mode), - m_storage_size (0), - m_swapchain_memory_assigned (false), - m_swapchain_ptr (nullptr), - m_tiling (in_tiling), - m_type (in_type), - m_usage (static_cast(in_usage)), - m_uses_full_mipmap_chain (in_use_full_mipmap_chain), - m_width (in_base_mipmap_width) -{ - /* Register this instance */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_IMAGE, - this); -} - /** Please see header for specification */ void Anvil::Image::change_image_layout(Anvil::Queue* in_queue_ptr, VkAccessFlags in_src_access_mask, @@ -309,15 +98,18 @@ void Anvil::Image::change_image_layout(Anvil::Queue* in_queue_p transition_command_buffer_ptr->start_recording(true, /* one_time_submit */ false); /* simultaneous_use_allowed */ { - Anvil::ImageBarrier image_barrier(in_src_access_mask, - in_dst_access_mask, - true, /* in_by_region_barrier */ - in_src_layout, - in_dst_layout, - (m_sharing_mode == VK_SHARING_MODE_CONCURRENT) ? VK_QUEUE_FAMILY_IGNORED : in_queue_family_index, - (m_sharing_mode == VK_SHARING_MODE_CONCURRENT) ? VK_QUEUE_FAMILY_IGNORED : in_queue_family_index, - this, - in_subresource_range); + const auto sharing_mode (m_create_info_ptr->get_sharing_mode() ); + const auto queue_fam_index((sharing_mode == VK_SHARING_MODE_CONCURRENT) ? VK_QUEUE_FAMILY_IGNORED : in_queue_family_index); + + Anvil::ImageBarrier image_barrier (in_src_access_mask, + in_dst_access_mask, + true, /* in_by_region_barrier */ + in_src_layout, + in_dst_layout, + queue_fam_index, + queue_fam_index, + this, + in_subresource_range); transition_command_buffer_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, @@ -344,240 +136,39 @@ void Anvil::Image::change_image_layout(Anvil::Queue* in_queue_p } /** Please see header for specification */ -Anvil::ImageUniquePtr Anvil::Image::create_nonsparse(const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - ImageCreateFlags in_create_flags, - VkImageLayout in_post_create_image_layout, - const std::vector* in_opt_mipmaps_ptr, - MTSafety in_mt_safety) -{ - const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - - if (in_opt_mipmaps_ptr != nullptr) - { - in_usage |= VK_IMAGE_USAGE_TRANSFER_DST_BIT; - } - - ImageUniquePtr result_ptr( - new Image(in_device_ptr, - in_type, - in_format, - in_tiling, - in_sharing_mode, - in_usage, - in_base_mipmap_width, - in_base_mipmap_height, - in_base_mipmap_depth, - in_n_layers, - in_sample_count, - in_use_full_mipmap_chain, - in_create_flags, - in_queue_families, - in_post_create_image_layout, - in_opt_mipmaps_ptr, - mt_safe), - std::default_delete() - ); - - result_ptr->init(in_use_full_mipmap_chain, - 0, /* in_memory_features */ - nullptr); /* start_image_layout_ptr - irrelevant */ - - return result_ptr; -} - -/** Please see header for specification */ -Anvil::ImageUniquePtr Anvil::Image::create_nonsparse(const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - MemoryFeatureFlags in_memory_features, - ImageCreateFlags in_create_flags, - VkImageLayout in_post_create_image_layout, - const std::vector* in_mipmaps_ptr, - MTSafety in_mt_safety) +Anvil::ImageUniquePtr Anvil::Image::create(Anvil::ImageCreateInfoUniquePtr in_create_info_ptr) { - const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); - const VkImageLayout start_image_layout = (in_mipmaps_ptr != nullptr && in_mipmaps_ptr->size() > 0) ? VK_IMAGE_LAYOUT_PREINITIALIZED - : VK_IMAGE_LAYOUT_UNDEFINED; - - if (in_mipmaps_ptr != nullptr) - { - in_usage |= VK_IMAGE_USAGE_TRANSFER_DST_BIT; - } - - ImageUniquePtr new_image_ptr( - new Anvil::Image(in_device_ptr, - in_type, - in_format, - in_tiling, - in_sharing_mode, - in_usage, - in_base_mipmap_width, - in_base_mipmap_height, - in_base_mipmap_depth, - in_n_layers, - in_sample_count, - in_queue_families, - in_use_full_mipmap_chain, - in_create_flags, - in_post_create_image_layout, - in_mipmaps_ptr, - mt_safe), - std::default_delete() - ); - - new_image_ptr->init(in_use_full_mipmap_chain, - in_memory_features, - &start_image_layout); - - return new_image_ptr; -} + ImageUniquePtr result_ptr(new Image(std::move(in_create_info_ptr) ), + std::default_delete() ); -/** Please see header for specification */ -Anvil::ImageUniquePtr Anvil::Image::create_nonsparse(const Anvil::BaseDevice* in_device_ptr, - const VkSwapchainCreateInfoKHR& in_swapchain_create_info, - VkImage in_image, - MTSafety in_mt_safety) -{ - const bool mt_safe(Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); - - ImageUniquePtr new_image_ptr( - new Anvil::Image(in_device_ptr, - in_image, - in_swapchain_create_info.imageFormat, - VK_IMAGE_TILING_OPTIMAL, - in_swapchain_create_info.imageSharingMode, - in_swapchain_create_info.imageUsage, - in_swapchain_create_info.imageExtent.width, - in_swapchain_create_info.imageExtent.height, - 1, /* base_mipmap_depth */ - in_swapchain_create_info.imageArrayLayers, - 1, /* n_mipmaps */ - VK_SAMPLE_COUNT_1_BIT, - 1, /* n_slices */ - 0, /* in_create_flags */ - 0, /* in_queue_families */ - mt_safe), - std::default_delete() - ); - - new_image_ptr->m_memory_types = 0; - new_image_ptr->m_storage_size = 0; - new_image_ptr->m_type = VK_IMAGE_TYPE_2D; - new_image_ptr->m_is_swapchain_image = true; - - new_image_ptr->init_mipmap_props(); - - return new_image_ptr; -} - -/** Please see header for specification */ -Anvil::ImageUniquePtr Anvil::Image::create_sparse(const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - ImageCreateFlags in_create_flags, - Anvil::SparseResidencyScope in_residency_scope, - VkImageLayout in_initial_layout, - MTSafety in_mt_safety) -{ - const auto& features (in_device_ptr->get_physical_device_features() ); - const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); - ImageUniquePtr result_ptr(nullptr, - std::default_delete() ); - - anvil_assert(in_initial_layout == VK_IMAGE_LAYOUT_PREINITIALIZED || - in_initial_layout == VK_IMAGE_LAYOUT_UNDEFINED); - - /* Make sure requested functionality is supported by the device */ - if (!features.core_vk1_0_features_ptr->sparse_binding) + if (result_ptr != nullptr) { - anvil_assert(features.core_vk1_0_features_ptr->sparse_binding); + const auto image_type = result_ptr->m_create_info_ptr->get_type(); - goto end; - } - - if (in_residency_scope != Anvil::SPARSE_RESIDENCY_SCOPE_NONE) - { - /* For sparse residency, we need to verify the device can actually support the requested configuration */ - std::vector result_properties; - - in_device_ptr->get_physical_device_sparse_image_format_properties(in_format, - in_type, - in_sample_count, - in_usage, - in_tiling, - result_properties); - - if (result_properties.size() == 0) - { - goto end; - } - - switch (in_type) + switch (image_type) { - case VK_IMAGE_TYPE_1D: + case Anvil::ImageType::NONSPARSE_ALLOC: + case Anvil::ImageType::NONSPARSE_NO_ALLOC: + case Anvil::ImageType::SPARSE_NO_ALLOC: { - /* Not supported in Vulkan 1.0 */ - anvil_assert_fail(); - - goto end; - } - - case VK_IMAGE_TYPE_2D: - { - if (!features.core_vk1_0_features_ptr->sparse_residency_image_2D) + if (!result_ptr->init() ) { - anvil_assert(features.core_vk1_0_features_ptr->sparse_residency_image_2D); - - goto end; + result_ptr.reset(); } break; } - case VK_IMAGE_TYPE_3D: + case Anvil::ImageType::SWAPCHAIN_WRAPPER: { - if (!features.core_vk1_0_features_ptr->sparse_residency_image_3D) - { - anvil_assert(features.core_vk1_0_features_ptr->sparse_residency_image_3D); + result_ptr->m_image = result_ptr->m_create_info_ptr->get_swapchain_image(); + result_ptr->m_memory_types = 0; + result_ptr->m_n_mipmaps = 1; + result_ptr->m_storage_size = 0; - goto end; - } + anvil_assert(result_ptr->m_image != VK_NULL_HANDLE); + + result_ptr->init_mipmap_props(); break; } @@ -586,101 +177,29 @@ Anvil::ImageUniquePtr Anvil::Image::create_sparse(const Anvil::BaseDevice* in { anvil_assert_fail(); - goto end; + result_ptr.reset(); } } + } - switch (in_sample_count) - { - case VK_SAMPLE_COUNT_1_BIT: - { - /* No validation required */ - break; - } - - case VK_SAMPLE_COUNT_2_BIT: - { - if (!features.core_vk1_0_features_ptr->sparse_residency_2_samples) - { - anvil_assert(features.core_vk1_0_features_ptr->sparse_residency_2_samples); - - goto end; - } - - break; - } - - case VK_SAMPLE_COUNT_4_BIT: - { - if (!features.core_vk1_0_features_ptr->sparse_residency_4_samples) - { - anvil_assert(features.core_vk1_0_features_ptr->sparse_residency_4_samples); - - goto end; - } - - break; - } - - case VK_SAMPLE_COUNT_8_BIT: - { - if (!features.core_vk1_0_features_ptr->sparse_residency_8_samples) - { - anvil_assert(features.core_vk1_0_features_ptr->sparse_residency_8_samples); - - goto end; - } - - break; - } - - case VK_SAMPLE_COUNT_16_BIT: - { - if (!features.core_vk1_0_features_ptr->sparse_residency_16_samples) - { - anvil_assert(features.core_vk1_0_features_ptr->sparse_residency_16_samples); - - goto end; - } + return result_ptr; +} - break; - } +bool Anvil::Image::do_sanity_checks_for_external_memory_handle_types(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const +{ + bool result = true; - default: - { - anvil_assert_fail(); + if (in_external_memory_handle_types != 0) + { + if (!m_device_ptr->supports_external_memory_handles(in_external_memory_handle_types) ) + { + anvil_assert(!m_device_ptr->supports_external_memory_handles(in_external_memory_handle_types) ); - goto end; - } + result = false; } } - /* Spawn a new Image instance and initialize it */ - result_ptr.reset( - new Anvil::Image(in_device_ptr, - in_type, - in_format, - in_tiling, - in_usage, - in_base_mipmap_width, - in_base_mipmap_height, - in_base_mipmap_depth, - in_n_layers, - in_sample_count, - in_queue_families, - in_sharing_mode, - in_use_full_mipmap_chain, - in_create_flags, - in_residency_scope, - mt_safe) - ); - - result_ptr->init(in_use_full_mipmap_chain, - 0, /* in_memory_features */ - &in_initial_layout); /* start_image_layout - irrelevant */ - -end: - return result_ptr; + return result; } /** Please see header for specification */ @@ -692,7 +211,7 @@ bool Anvil::Image::get_aspect_subresource_layout(VkImageAspectFlags in_aspect, auto aspect_iterator = m_aspects.find(static_cast(in_aspect) ); bool result = false; - anvil_assert(m_tiling == VK_IMAGE_TILING_LINEAR); + anvil_assert(m_create_info_ptr->get_tiling() == VK_IMAGE_TILING_LINEAR); if (aspect_iterator != m_aspects.end() ) { @@ -711,9 +230,10 @@ bool Anvil::Image::get_aspect_subresource_layout(VkImageAspectFlags in_aspect, /** Please see header for specification */ Anvil::MemoryBlock* Anvil::Image::get_memory_block() { - bool is_callback_needed = false; + bool is_callback_needed = false; + const auto is_sparse = (m_create_info_ptr->get_type() == Anvil::ImageType::SPARSE_NO_ALLOC); - if (m_is_sparse) + if (is_sparse) { IsImageMemoryAllocPendingQueryCallbackArgument callback_arg(this); @@ -736,9 +256,9 @@ Anvil::MemoryBlock* Anvil::Image::get_memory_block() &callback_argument); } - if (m_is_sparse) + if (is_sparse) { - if (m_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_NONE) + if (m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_NONE) { anvil_assert(m_page_tracker_ptr != nullptr); @@ -761,114 +281,124 @@ Anvil::MemoryBlock* Anvil::Image::get_memory_block() * * For argument discussion, please see documentation of the constructors. **/ -void Anvil::Image::init(bool in_use_full_mipmap_chain, - Anvil::MemoryFeatureFlags in_memory_features, - const VkImageLayout* in_start_image_layout_ptr) +bool Anvil::Image::init() { - std::vector aspects_used; - VkImageFormatProperties image_format_props; - uint32_t max_dimension; - uint32_t n_queue_family_indices = 0; - uint32_t queue_family_indices[3]; - VkResult result (VK_ERROR_INITIALIZATION_FAILED); - bool result_bool(false); - - ANVIL_REDUNDANT_VARIABLE(result); - ANVIL_REDUNDANT_VARIABLE(result_bool); - - if ((in_memory_features & MEMORY_FEATURE_FLAG_MAPPABLE) == 0) + std::vector aspects_used; + VkImageCreateFlags image_flags = 0; + VkImageFormatProperties image_format_props; + const auto memory_features = m_create_info_ptr->get_memory_features(); + uint32_t n_queue_family_indices = 0; + uint32_t queue_family_indices[3]; + VkResult result = VK_ERROR_INITIALIZATION_FAILED; + bool result_bool = false; + Anvil::StructChainer struct_chainer; + + if (!do_sanity_checks_for_external_memory_handle_types(m_create_info_ptr->get_external_memory_handle_types() )) { - anvil_assert((in_memory_features & MEMORY_FEATURE_FLAG_HOST_COHERENT) == 0); + goto end; } - /* Determine the maximum dimension size. */ - max_dimension = m_width; + if ((memory_features & MEMORY_FEATURE_FLAG_MAPPABLE) == 0) + { + anvil_assert((memory_features & MEMORY_FEATURE_FLAG_HOST_COHERENT) == 0); + } - if (max_dimension < m_height) + if (m_create_info_ptr->get_mipmaps_to_upload().size() > 0) { - max_dimension = m_height; + m_create_info_ptr->set_usage_flags(m_create_info_ptr->get_usage_flags() | VK_IMAGE_USAGE_TRANSFER_DST_BIT); } - if (max_dimension < m_depth) + if (m_create_info_ptr->get_type() == Anvil::ImageType::SWAPCHAIN_WRAPPER && + m_create_info_ptr->get_swapchain()->get_create_info_ptr()->get_flags() & VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR) { - max_dimension = m_depth; + anvil_assert(!m_create_info_ptr->uses_full_mipmap_chain() ); + anvil_assert(m_create_info_ptr->get_n_layers () == 1); + anvil_assert(m_create_info_ptr->get_type_vk () == VK_IMAGE_TYPE_2D); + anvil_assert(m_create_info_ptr->get_tiling () == VK_IMAGE_TILING_OPTIMAL); } /* Form the queue family array */ Anvil::Utils::convert_queue_family_bits_to_family_indices(m_device_ptr, - m_queue_families, + m_create_info_ptr->get_queue_families(), queue_family_indices, &n_queue_family_indices); /* Is the requested texture size valid? */ - result_bool = m_device_ptr->get_physical_device_image_format_properties(m_format, - m_type, - m_tiling, - m_usage, + result_bool = m_device_ptr->get_physical_device_image_format_properties(m_create_info_ptr->get_format (), + m_create_info_ptr->get_type_vk (), + m_create_info_ptr->get_tiling (), + m_create_info_ptr->get_usage_flags(), 0, /* flags */ image_format_props); - anvil_assert(result_bool); - anvil_assert(m_width >= 1 && - m_height >= 1 && - m_depth >= 1); + if (!result_bool) + { + anvil_assert(result_bool); + + goto end; + } - anvil_assert(m_width <= image_format_props.maxExtent.width); + anvil_assert(m_create_info_ptr->get_base_mip_width() <= image_format_props.maxExtent.width); - if (m_height > 1) + if (m_create_info_ptr->get_base_mip_height() > 1) { - anvil_assert(m_height <= image_format_props.maxExtent.height); + anvil_assert(m_create_info_ptr->get_base_mip_height() <= image_format_props.maxExtent.height); } - if (m_depth > 1) + if (m_create_info_ptr->get_base_mip_depth() > 1) { - anvil_assert(m_depth <= image_format_props.maxExtent.depth); + anvil_assert(m_create_info_ptr->get_base_mip_depth() <= image_format_props.maxExtent.depth); } - anvil_assert(m_n_layers >= 1); + anvil_assert(m_create_info_ptr->get_n_layers() >= 1); - if (m_n_layers > 1) + if (m_create_info_ptr->get_n_layers() > 1) { - anvil_assert(m_n_layers <= image_format_props.maxArrayLayers); + anvil_assert(m_create_info_ptr->get_n_layers() <= image_format_props.maxArrayLayers); } /* If multisample image is requested, make sure the number of samples is supported. */ - anvil_assert(m_sample_count >= 1); + anvil_assert(m_create_info_ptr->get_sample_count() >= 1); - if (m_sample_count > 1) + if (m_create_info_ptr->get_sample_count() > 1) { - anvil_assert((image_format_props.sampleCounts & m_sample_count) != 0); + anvil_assert((image_format_props.sampleCounts & m_create_info_ptr->get_sample_count() ) != 0); } /* Create the image object */ - VkImageCreateInfo image_create_info; - VkImageCreateFlags image_flags = 0; - - if ( (m_create_flags & Anvil::IMAGE_CREATE_FLAG_CUBE_COMPATIBLE_BIT) != 0) + if ( (m_create_info_ptr->get_create_flags() & Anvil::IMAGE_CREATE_FLAG_CUBE_COMPATIBLE_BIT) != 0) { - anvil_assert(m_type == VK_IMAGE_TYPE_2D); - anvil_assert((m_n_layers % 6) == 0); + anvil_assert(m_create_info_ptr->get_type_vk() == VK_IMAGE_TYPE_2D); + anvil_assert((m_create_info_ptr->get_n_layers() % 6) == 0); image_flags |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT; } - if ( (m_create_flags & Anvil::IMAGE_CREATE_FLAG_MUTABLE_FORMAT_BIT) != 0) + if ( (m_create_info_ptr->get_create_flags() & Anvil::IMAGE_CREATE_FLAG_MUTABLE_FORMAT_BIT) != 0) { image_flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT; } - if ( (m_create_flags & Anvil::IMAGE_CREATE_FLAG_2D_ARRAY_COMPATIBLE_BIT) != 0) + if ( (m_create_info_ptr->get_create_flags() & Anvil::IMAGE_CREATE_FLAG_2D_ARRAY_COMPATIBLE_BIT) != 0) { - anvil_assert(m_device_ptr->is_khr_maintenance1_extension_enabled() ); - anvil_assert(m_type == VK_IMAGE_TYPE_3D); + anvil_assert(m_device_ptr->get_extension_info()->khr_maintenance1() ); + anvil_assert(m_create_info_ptr->get_type_vk() == VK_IMAGE_TYPE_3D); image_flags |= VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR; } - if (m_is_sparse) + if (m_create_info_ptr->get_type() == Anvil::ImageType::SWAPCHAIN_WRAPPER) + { + if (m_create_info_ptr->get_swapchain()->get_create_info_ptr()->get_flags() & VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR) + { + image_flags |= VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR; + } + } + + if (m_create_info_ptr->get_type() == Anvil::ImageType::SPARSE_NO_ALLOC) { /* Convert residency scope to Vulkan image create flags */ - switch (m_residency_scope) + switch (m_create_info_ptr->get_residency_scope() ) { case Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED: image_flags |= VK_IMAGE_CREATE_SPARSE_ALIASED_BIT | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | VK_IMAGE_CREATE_SPARSE_BINDING_BIT; break; case Anvil::SPARSE_RESIDENCY_SCOPE_NONALIASED: image_flags |= VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | VK_IMAGE_CREATE_SPARSE_BINDING_BIT; break; @@ -881,41 +411,76 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, } } - image_create_info.arrayLayers = m_n_layers; - image_create_info.extent.depth = m_depth; - image_create_info.extent.height = m_height; - image_create_info.extent.width = m_width; - image_create_info.flags = image_flags; - image_create_info.format = m_format; - image_create_info.imageType = m_type; - image_create_info.initialLayout = (in_start_image_layout_ptr != nullptr) ? *in_start_image_layout_ptr - : (m_mipmaps_to_upload.size() > 0) ? VK_IMAGE_LAYOUT_PREINITIALIZED - : VK_IMAGE_LAYOUT_UNDEFINED; - image_create_info.mipLevels = static_cast((in_use_full_mipmap_chain) ? (1 + log2(max_dimension)) : 1); - image_create_info.pNext = nullptr; - image_create_info.pQueueFamilyIndices = queue_family_indices; - image_create_info.queueFamilyIndexCount = n_queue_family_indices; - image_create_info.samples = static_cast(m_sample_count); - image_create_info.sharingMode = m_sharing_mode; - image_create_info.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; - image_create_info.tiling = m_tiling; - image_create_info.usage = m_usage; - - result = vkCreateImage(m_device_ptr->get_device_vk(), - &image_create_info, - nullptr, /* pAllocator */ - &m_image); + { + const auto max_dimension = std::max(std::max(m_create_info_ptr->get_base_mip_depth(), + m_create_info_ptr->get_base_mip_height() ), + m_create_info_ptr->get_base_mip_width() ); - anvil_assert_vk_call_succeeded(result); - if (is_vk_call_successful(result) ) + m_n_mipmaps = static_cast((m_create_info_ptr->uses_full_mipmap_chain() ) ? (1 + log2(max_dimension)) + : 1); + } + + { + VkImageCreateInfo image_create_info; + + image_create_info.arrayLayers = m_create_info_ptr->get_n_layers (); + image_create_info.extent.depth = m_create_info_ptr->get_base_mip_depth (); + image_create_info.extent.height = m_create_info_ptr->get_base_mip_height(); + image_create_info.extent.width = m_create_info_ptr->get_base_mip_width (); + image_create_info.flags = image_flags; + image_create_info.format = m_create_info_ptr->get_format (); + image_create_info.imageType = m_create_info_ptr->get_type_vk (); + image_create_info.initialLayout = m_create_info_ptr->get_post_create_image_layout(); + image_create_info.mipLevels = m_n_mipmaps; + image_create_info.pNext = nullptr; + image_create_info.pQueueFamilyIndices = queue_family_indices; + image_create_info.queueFamilyIndexCount = n_queue_family_indices; + image_create_info.samples = static_cast(m_create_info_ptr->get_sample_count() ); + image_create_info.sharingMode = m_create_info_ptr->get_sharing_mode(); + image_create_info.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; + image_create_info.tiling = m_create_info_ptr->get_tiling (); + image_create_info.usage = m_create_info_ptr->get_usage_flags(); + + if (m_create_info_ptr->get_external_memory_handle_types() != 0) + { + anvil_assert(image_create_info.initialLayout == VK_IMAGE_LAYOUT_UNDEFINED); + } + + struct_chainer.append_struct(image_create_info); + } + + if (m_create_info_ptr->get_external_memory_handle_types() != 0) { - set_vk_handle(m_image); + VkExternalMemoryImageCreateInfoKHR external_memory_image_create_info; + const auto handle_types = m_create_info_ptr->get_external_memory_handle_types(); + + external_memory_image_create_info.handleTypes = Anvil::Utils::convert_external_memory_handle_types_to_vk_external_memory_handle_type_flags(handle_types); + external_memory_image_create_info.pNext = nullptr; + external_memory_image_create_info.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR; + + struct_chainer.append_struct(external_memory_image_create_info); + } + + { + auto struct_chain_ptr = struct_chainer.create_chain(); + + result = vkCreateImage(m_device_ptr->get_device_vk(), + struct_chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_image); } - m_n_mipmaps = image_create_info.mipLevels; - m_n_slices = (m_type == VK_IMAGE_TYPE_3D) ? m_depth : 1; + if (!is_vk_call_successful(result) ) + { + anvil_assert_vk_call_succeeded(result); + + result_bool = false; + goto end; + } + + set_vk_handle(m_image); - if (m_swapchain_ptr == nullptr) + if (m_create_info_ptr->get_type() != Anvil::ImageType::SWAPCHAIN_WRAPPER) { /* Extract various image properties we're going to need later */ vkGetImageMemoryRequirements(m_device_ptr->get_device_vk(), @@ -928,9 +493,11 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, } /* Cache aspect subresource properties if we're dealing with a linear image */ - if (m_tiling == VK_IMAGE_TILING_LINEAR) + if (m_create_info_ptr->get_tiling() == VK_IMAGE_TILING_LINEAR) { - Anvil::Formats::get_format_aspects(m_format, + const auto n_layers = m_create_info_ptr->get_n_layers(); + + Anvil::Formats::get_format_aspects(m_create_info_ptr->get_format(), &aspects_used); for (const auto& current_aspect : aspects_used) @@ -940,7 +507,7 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, subresource.aspectMask = current_aspect; for (uint32_t n_layer = 0; - n_layer < m_n_layers; + n_layer < n_layers; ++n_layer) { subresource.arrayLayer = n_layer; @@ -967,13 +534,13 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, /* Initialize mipmap props storage */ init_mipmap_props(); - if (m_is_sparse && - m_residency_scope != SPARSE_RESIDENCY_SCOPE_NONE) + if (m_create_info_ptr->get_residency_scope() == SPARSE_RESIDENCY_SCOPE_ALIASED || + m_create_info_ptr->get_residency_scope() == SPARSE_RESIDENCY_SCOPE_NONALIASED) { uint32_t n_reqs = 0; std::vector sparse_image_memory_reqs; - anvil_assert(m_swapchain_ptr == nullptr); /* TODO: can images, to which swapchains can be bound, be sparse? */ + anvil_assert(m_create_info_ptr->get_type() != Anvil::ImageType::SWAPCHAIN_WRAPPER); /* TODO: can images, to which swapchains can be bound, be sparse? */ /* Retrieve image aspect properties. Since Vulkan lets a single props structure to refer to more than * just a single aspect, we first cache the exposed info in a vec and then distribute the information to @@ -1013,52 +580,9 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, /* Continue by setting up storage for page occupancy data */ init_page_occupancy(sparse_image_memory_reqs); - - /* Finally, partially-resident images require metadata aspect to be bound memory before they can be - * accessed. Allocate & associate a dedicated memory block to the image */ - auto metadata_aspect_iterator = m_sparse_aspect_props.find(VK_IMAGE_ASPECT_METADATA_BIT); - - if (metadata_aspect_iterator != m_sparse_aspect_props.end() ) - { - Anvil::SparseMemoryBindInfoID metadata_binding_bind_info_id; - Anvil::Utils::SparseMemoryBindingUpdateInfo metadata_binding_update; - Anvil::Queue* sparse_queue_ptr(m_device_ptr->get_sparse_binding_queue(0) ); - - /* TODO: Right now, we only support cases where image uses only one metadata block, no matter how many - * layers there are. */ - anvil_assert((metadata_aspect_iterator->second.flags & VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT) != 0); - - /* Instantiate the memory block which is going to hold the metadata - * - * NOTE: We should use an instance-wide allocator, preferably resizable, for this. - */ - auto memory_block_ptr = Anvil::MemoryBlock::create(m_device_ptr, - m_memory_reqs.memoryTypeBits, - metadata_aspect_iterator->second.mip_tail_size, - 0, /* in_memory_features */ - Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); - - /* Set up bind info update structure. */ - metadata_binding_bind_info_id = metadata_binding_update.add_bind_info(0, /* n_signal_semaphores */ - nullptr, /* opt_signal_semaphores_ptr */ - 0, /* n_wait_semaphores */ - nullptr); /* opt_wait_semaphores_ptr */ - - metadata_binding_update.append_opaque_image_memory_update(metadata_binding_bind_info_id, - this, - metadata_aspect_iterator->second.mip_tail_offset, - metadata_aspect_iterator->second.mip_tail_size, - VK_SPARSE_MEMORY_BIND_METADATA_BIT, - memory_block_ptr.release(), - 0, /* opt_memory_block_start_offset */ - true); /* in_opt_memory_block_owned_by_image */ - - result_bool = sparse_queue_ptr->bind_sparse_memory(metadata_binding_update); - anvil_assert(result_bool); - } } else - if (m_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_NONE && m_is_sparse) + if (m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_NONE) { m_page_tracker_ptr.reset( new Anvil::PageTracker(m_storage_size, @@ -1066,21 +590,34 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, ); } - if (!m_memory_set_by_world) + if (m_create_info_ptr->get_type() == Anvil::ImageType::NONSPARSE_ALLOC) { - anvil_assert(!m_is_sparse); - /* Allocate memory for the image */ auto memory_block_ptr = Anvil::MemoryBlock::create(m_device_ptr, m_memory_reqs.memoryTypeBits, m_memory_reqs.size, - in_memory_features, + m_create_info_ptr->get_memory_features(), Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); - set_memory( - std::move(memory_block_ptr) - ); + if (memory_block_ptr == nullptr) + { + anvil_assert(memory_block_ptr != nullptr); + + result_bool = false; + goto end; + } + + if (!set_memory(std::move(memory_block_ptr) )) + { + anvil_assert_fail(); + + result_bool = false; + goto end; + } } + +end: + return result_bool; } /** Initializes page occupancy data. Should only be used for sparse images. @@ -1089,8 +626,8 @@ void Anvil::Image::init(bool in_use_full_mipmap_chain, **/ void Anvil::Image::init_page_occupancy(const std::vector& in_memory_reqs) { - anvil_assert(m_residency_scope != Anvil::SPARSE_RESIDENCY_SCOPE_NONE && - m_residency_scope != Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED); + anvil_assert(m_create_info_ptr->get_residency_scope() != Anvil::SPARSE_RESIDENCY_SCOPE_NONE && + m_create_info_ptr->get_residency_scope() != Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED); /* First, allocate space for an AspectPageOccupancyData instance for all aspects used by the image. * @@ -1174,7 +711,7 @@ void Anvil::Image::init_page_occupancy(const std::vectorget_n_layers(); ++n_layer) { page_occupancy_ptr->layers.push_back(AspectPageOccupancyLayerData() ); @@ -1229,8 +766,8 @@ void Anvil::Image::init_page_occupancy(const std::vectorget_type() != Anvil::ImageType::SWAPCHAIN_WRAPPER) { lock(); { @@ -1251,7 +788,7 @@ Anvil::Image::~Image() /* Please see header for specification */ const VkImage& Anvil::Image::get_image() { - if (!m_is_sparse) + if (m_create_info_ptr->get_type() != Anvil::ImageType::SPARSE_NO_ALLOC) { if (m_memory_blocks_owned.size() == 0) { @@ -1353,16 +890,16 @@ bool Anvil::Image::get_sparse_image_aspect_properties(const VkImageAspectFlagBit decltype(m_sparse_aspect_props)::const_iterator prop_iterator; bool result = false; - if (!m_is_sparse) + if (m_create_info_ptr->get_type() != Anvil::ImageType::SPARSE_NO_ALLOC) { - anvil_assert(m_is_sparse); + anvil_assert(m_create_info_ptr->get_type() == Anvil::ImageType::SPARSE_NO_ALLOC); goto end; } - if (m_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_NONE) + if (m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_NONE) { - anvil_assert(m_residency_scope != Anvil::SPARSE_RESIDENCY_SCOPE_NONE); + anvil_assert(m_create_info_ptr->get_residency_scope() != Anvil::SPARSE_RESIDENCY_SCOPE_NONE); goto end; } @@ -1394,8 +931,8 @@ VkImageCreateInfo Anvil::Image::get_create_info_for_swapchain(const Anvil::Swapc &result.arrayLayers); result.extent.depth = 1; - result.flags = in_swapchain_ptr->get_flags(); - result.format = in_swapchain_ptr->get_image_format(); + result.flags = in_swapchain_ptr->get_create_info_ptr()->get_flags (); + result.format = in_swapchain_ptr->get_create_info_ptr()->get_format(); result.imageType = VK_IMAGE_TYPE_2D; result.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; result.mipLevels = 1; @@ -1403,10 +940,10 @@ VkImageCreateInfo Anvil::Image::get_create_info_for_swapchain(const Anvil::Swapc result.pQueueFamilyIndices = nullptr; result.queueFamilyIndexCount = UINT32_MAX; result.samples = VK_SAMPLE_COUNT_1_BIT; - result.sharingMode = in_swapchain_ptr->get_image(0)->get_image_sharing_mode(); + result.sharingMode = in_swapchain_ptr->get_image(0)->get_create_info_ptr()->get_sharing_mode(); result.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; result.tiling = VK_IMAGE_TILING_OPTIMAL; - result.usage = in_swapchain_ptr->get_image(0)->get_image_usage(); + result.usage = in_swapchain_ptr->get_image(0)->get_create_info_ptr()->get_usage_flags(); return result; } @@ -1416,7 +953,7 @@ VkImageSubresourceRange Anvil::Image::get_subresource_range() const { VkImageSubresourceRange result; - switch (m_format) + switch (m_create_info_ptr->get_format() ) { case VK_FORMAT_D16_UNORM: case VK_FORMAT_D32_SFLOAT: @@ -1464,8 +1001,8 @@ bool Anvil::Image::has_aspects(VkImageAspectFlags in_aspects) const VkImageAspectFlags checked_aspects = 0; bool result = true; - if (m_is_sparse && - m_residency_scope != SPARSE_RESIDENCY_SCOPE_NONE) + if (m_create_info_ptr->get_residency_scope() == SPARSE_RESIDENCY_SCOPE_ALIASED || + m_create_info_ptr->get_residency_scope() == SPARSE_RESIDENCY_SCOPE_NONALIASED) { for (uint32_t n_bit = 0; n_bit < sizeof(uint32_t) * 8 /* bits in byte */ && result; @@ -1482,7 +1019,7 @@ bool Anvil::Image::has_aspects(VkImageAspectFlags in_aspects) const } else { - const Anvil::ComponentLayout component_layout = Anvil::Formats::get_format_component_layout(m_format); + const Anvil::ComponentLayout component_layout = Anvil::Formats::get_format_component_layout(m_create_info_ptr->get_format() ); bool has_color_components = false; bool has_depth_components = false; bool has_stencil_components = false; @@ -1566,9 +1103,9 @@ void Anvil::Image::init_mipmap_props() { uint32_t current_mipmap_size[3] = { - m_width, - m_height, - m_depth, + m_create_info_ptr->get_base_mip_width (), + m_create_info_ptr->get_base_mip_height(), + m_create_info_ptr->get_base_mip_depth () }; anvil_assert(m_n_mipmaps != 0); @@ -1585,7 +1122,7 @@ void Anvil::Image::init_mipmap_props() current_mipmap_size[0] /= 2; current_mipmap_size[1] /= 2; - if (m_type == VK_IMAGE_TYPE_3D) + if (m_create_info_ptr->get_type_vk() == VK_IMAGE_TYPE_3D) { current_mipmap_size[2] /= 2; } @@ -1618,12 +1155,11 @@ bool Anvil::Image::is_memory_bound_for_texel(VkImageAspectFlagBits in_aspect, bool result = false; /* Sanity checks */ - anvil_assert(m_is_sparse); - anvil_assert(m_residency_scope == SPARSE_RESIDENCY_SCOPE_ALIASED || - m_residency_scope == SPARSE_RESIDENCY_SCOPE_NONALIASED); + anvil_assert(m_create_info_ptr->get_residency_scope() == SPARSE_RESIDENCY_SCOPE_ALIASED || + m_create_info_ptr->get_residency_scope() == SPARSE_RESIDENCY_SCOPE_NONALIASED); - anvil_assert(m_n_layers > in_n_layer); - anvil_assert(m_n_mipmaps > in_n_mip); + anvil_assert(m_create_info_ptr->get_n_layers () > in_n_layer); + anvil_assert(m_n_mipmaps > in_n_mip); anvil_assert(m_sparse_aspect_page_occupancy.find(in_aspect) != m_sparse_aspect_page_occupancy.end() ); @@ -1670,14 +1206,14 @@ void Anvil::Image::on_memory_backing_opaque_update(VkDeviceSize in_resour const bool is_unbinding = (in_memory_block_ptr == nullptr); /* Sanity checks */ - anvil_assert(m_is_sparse); + anvil_assert(m_create_info_ptr->get_residency_scope() != Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED); if (in_memory_block_ptr != nullptr) { anvil_assert(in_memory_block_ptr->get_size() <= in_memory_block_start_offset + in_size); } - if (m_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_NONE) + if (m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_NONE) { /* Non-resident image: underlying memory is viewed as an opaque linear region. */ m_page_tracker_ptr->set_binding(in_memory_block_ptr, @@ -1745,7 +1281,7 @@ void Anvil::Image::on_memory_backing_opaque_update(VkDeviceSize in_resour is_miptail_tile_binding_operation = false; for (uint32_t n_layer = 0; - n_layer < m_n_layers; + n_layer < m_create_info_ptr->get_n_layers(); ++n_layer) { auto& current_layer = occupancy_data_ptr->layers.at(n_layer); @@ -1836,8 +1372,8 @@ void Anvil::Image::on_memory_backing_update(const VkImageSubresource& in_subreso decltype(m_sparse_aspect_page_occupancy)::iterator aspect_page_occupancy_iterator; decltype(m_sparse_aspect_props)::iterator aspect_props_iterator; - anvil_assert(m_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED || - m_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_NONALIASED); + anvil_assert(m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED || + m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_NONALIASED); ANVIL_REDUNDANT_ARGUMENT(in_memory_block_start_offset); @@ -1936,11 +1472,11 @@ bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, VkResult result (VK_ERROR_INITIALIZATION_FAILED); /* Sanity checks */ - anvil_assert(in_memory_block_ptr != nullptr); - anvil_assert(!m_is_sparse); - anvil_assert(m_mipmaps.size() > 0); - anvil_assert(m_memory_blocks_owned.size() == 0); - anvil_assert(m_swapchain_ptr == nullptr); + anvil_assert(in_memory_block_ptr != nullptr); + anvil_assert(m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED); + anvil_assert(m_mipmaps.size() > 0); + anvil_assert(m_memory_blocks_owned.size() == 0); + anvil_assert(m_create_info_ptr->get_type() != Anvil::ImageType::SWAPCHAIN_WRAPPER); /* Bind the memory object to the image object */ if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) @@ -1958,8 +1494,11 @@ bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, anvil_assert_vk_call_succeeded(result); if (is_vk_call_successful(result) ) { - VkImageLayout src_image_layout = (m_tiling == VK_IMAGE_TILING_LINEAR && m_mipmaps_to_upload.size() > 0) ? VK_IMAGE_LAYOUT_PREINITIALIZED - : VK_IMAGE_LAYOUT_UNDEFINED; + const auto& mips_to_upload = m_create_info_ptr->get_mipmaps_to_upload(); + const auto tiling = m_create_info_ptr->get_tiling (); + + VkImageLayout src_image_layout = (tiling == VK_IMAGE_TILING_LINEAR && mips_to_upload.size() > 0) ? VK_IMAGE_LAYOUT_PREINITIALIZED + : VK_IMAGE_LAYOUT_UNDEFINED; if (in_owned_by_image) { @@ -1970,22 +1509,21 @@ bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, } /* Fill the storage with mipmap contents, if mipmap data was specified at input */ - if (m_mipmaps_to_upload.size() > 0) + if (mips_to_upload.size() > 0) { - upload_mipmaps(&m_mipmaps_to_upload, + upload_mipmaps(&mips_to_upload, src_image_layout, &src_image_layout); } - if (m_post_create_layout != VK_IMAGE_LAYOUT_PREINITIALIZED && - m_post_create_layout != VK_IMAGE_LAYOUT_UNDEFINED) + if (m_create_info_ptr->get_post_alloc_image_layout() != m_create_info_ptr->get_post_create_image_layout() ) { - const uint32_t n_mipmaps_to_upload = static_cast(m_mipmaps_to_upload.size()); + const uint32_t n_mipmaps_to_upload = static_cast(mips_to_upload.size()); VkAccessFlags src_access_mask = 0; if (n_mipmaps_to_upload > 0) { - if (m_tiling == VK_IMAGE_TILING_LINEAR) + if (tiling == VK_IMAGE_TILING_LINEAR) { src_access_mask = VK_ACCESS_HOST_WRITE_BIT; } @@ -1995,34 +1533,31 @@ bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, } } - transition_to_post_create_image_layout(src_access_mask, - src_image_layout); + transition_to_post_alloc_image_layout(src_access_mask, + src_image_layout); } - m_mipmaps_to_upload.clear(); + m_create_info_ptr->clear_mipmaps_to_upload(); } return is_vk_call_successful(result); } -/* Transitions the underlying Vulkan image to the layout stored in m_post_create_layout. - * - * @param in_source_access_mask All access types used to fill the image with data. - * @param in_src_layout Layout to transition from. - **/ -void Anvil::Image::transition_to_post_create_image_layout(VkAccessFlags in_source_access_mask, - VkImageLayout in_src_layout) +void Anvil::Image::transition_to_post_alloc_image_layout(VkAccessFlags in_source_access_mask, + VkImageLayout in_src_layout) { - anvil_assert(!m_has_transitioned_to_post_create_layout); + const auto post_alloc_layout = m_create_info_ptr->get_post_alloc_image_layout(); + + anvil_assert(!m_has_transitioned_to_post_alloc_layout); change_image_layout(m_device_ptr->get_universal_queue(0), in_source_access_mask, in_src_layout, - Anvil::Utils::get_access_mask_from_image_layout(m_post_create_layout), - m_post_create_layout, + Anvil::Utils::get_access_mask_from_image_layout(post_alloc_layout), + post_alloc_layout, get_subresource_range() ); - m_has_transitioned_to_post_create_layout = true; + m_has_transitioned_to_post_alloc_layout = true; } /** Please see header for specification */ @@ -2064,10 +1599,10 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p image_subresource_range.aspectMask = image_aspects_touched; image_subresource_range.baseArrayLayer = 0; image_subresource_range.baseMipLevel = 0; - image_subresource_range.layerCount = m_n_layers; + image_subresource_range.layerCount = m_create_info_ptr->get_n_layers(); image_subresource_range.levelCount = m_n_mipmaps; - if (m_tiling == VK_IMAGE_TILING_LINEAR) + if (m_create_info_ptr->get_tiling() == VK_IMAGE_TILING_LINEAR) { /* TODO: Transition the subresource ranges, if necessary. */ anvil_assert(in_current_image_layout != VK_IMAGE_LAYOUT_UNDEFINED); @@ -2111,9 +1646,11 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p * * NOTE: Current implementation can only handle power-of-two textures. */ - anvil_assert(m_height == 1 || (m_height % 2) == 0); + const auto base_mip_height = m_create_info_ptr->get_base_mip_height(); + + anvil_assert(base_mip_height == 1 || (base_mip_height % 2) == 0); - current_mipmap_height = m_height / (1 << current_mipmap_raw_data_item_ptr->n_mipmap); + current_mipmap_height = base_mip_height / (1 << current_mipmap_raw_data_item_ptr->n_mipmap); if (current_mipmap_height < 1) { @@ -2145,14 +1682,14 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p Anvil::MemoryBlock* mem_block_ptr = nullptr; VkDeviceSize write_dst_slice_offset = dst_slice_offset; - if (!m_is_sparse) + if (m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED) { anvil_assert(m_memory_blocks_owned.size() == 1); mem_block_ptr = m_memory_blocks_owned.at(0).get(); } else - if (m_residency_scope == SPARSE_RESIDENCY_SCOPE_NONE) + if (m_create_info_ptr->get_residency_scope() == SPARSE_RESIDENCY_SCOPE_NONE) { const VkDeviceSize dst_slice_offset_page_aligned = Anvil::Utils::round_down(dst_slice_offset, sparse_page_size); @@ -2199,7 +1736,7 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p } else { - anvil_assert(m_tiling == VK_IMAGE_TILING_OPTIMAL); + anvil_assert(m_create_info_ptr->get_tiling() == VK_IMAGE_TILING_OPTIMAL); Anvil::BufferUniquePtr temp_buffer_ptr; Anvil::PrimaryCommandBufferUniquePtr temp_cmdbuf_ptr; @@ -2218,7 +1755,8 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p */ if ((total_raw_mips_size % 4) != 0) { - total_raw_mips_size += (4 - (total_raw_mips_size % 4)); + total_raw_mips_size = Anvil::Utils::round_up(total_raw_mips_size, + static_cast(4) ); } } @@ -2232,14 +1770,17 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p /* NOTE: The memcpy() call, as well as the way we implement copy op calls below, assume * POT resolution of the base mipmap */ - anvil_assert(m_height < 2 || (m_height % 2) == 0); + const auto base_mip_height = m_create_info_ptr->get_base_mip_height(); + + anvil_assert(base_mip_height < 2 || (base_mip_height % 2) == 0); for (auto mipmap_iterator = in_mipmaps_ptr->cbegin(); mipmap_iterator != in_mipmaps_ptr->cend(); ++mipmap_iterator) { - const auto& current_mipmap = *mipmap_iterator; + const auto& current_mipmap = *mipmap_iterator; const unsigned char* current_mipmap_data_ptr; + const auto current_mipmap_data_size = current_mipmap.n_slices * current_mipmap.data_size; current_mipmap_data_ptr = (mipmap_iterator->linear_tightly_packed_data_uchar_ptr != nullptr) ? mipmap_iterator->linear_tightly_packed_data_uchar_ptr.get() : (mipmap_iterator->linear_tightly_packed_data_uchar_raw_ptr != nullptr) ? mipmap_iterator->linear_tightly_packed_data_uchar_raw_ptr @@ -2247,9 +1788,11 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p mip_data_offsets.push_back(current_mip_offset); + anvil_assert(current_mip_offset + current_mipmap_data_size <= total_raw_mips_size); + memcpy(merged_mip_storage.get() + current_mip_offset, current_mipmap_data_ptr, - current_mipmap.n_slices * current_mipmap.data_size); + current_mipmap_data_size); current_mip_offset += current_mipmap.n_slices * current_mipmap.data_size; @@ -2263,14 +1806,19 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p } } - temp_buffer_ptr = Anvil::Buffer::create_nonsparse(m_device_ptr, - total_raw_mips_size, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_TRANSFER_SRC_BIT, - 0, /* in_memory_features */ - merged_mip_storage.get(), - Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() )); + { + auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr, + total_raw_mips_size, + Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_EXCLUSIVE, + VK_BUFFER_USAGE_TRANSFER_SRC_BIT, + 0); /* in_memory_features */ + + create_info_ptr->set_client_data(merged_mip_storage.get() ); + create_info_ptr->set_mt_safety (Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() )); + + temp_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); + } merged_mip_storage.reset(); @@ -2287,15 +1835,18 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p if (in_current_image_layout != VK_IMAGE_LAYOUT_GENERAL && in_current_image_layout != VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL) { - Anvil::ImageBarrier image_barrier(0, /* source_access_mask */ - VK_ACCESS_TRANSFER_WRITE_BIT, - false, - in_current_image_layout, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, - (m_sharing_mode == VK_SHARING_MODE_EXCLUSIVE) ? universal_queue_ptr->get_queue_family_index() : VK_QUEUE_FAMILY_IGNORED, - (m_sharing_mode == VK_SHARING_MODE_EXCLUSIVE) ? universal_queue_ptr->get_queue_family_index() : VK_QUEUE_FAMILY_IGNORED, - this, - image_subresource_range); + const auto sharing_mode (m_create_info_ptr->get_sharing_mode() ); + const auto queue_fam_index((sharing_mode == VK_SHARING_MODE_EXCLUSIVE) ? universal_queue_ptr->get_queue_family_index() : VK_QUEUE_FAMILY_IGNORED); + + Anvil::ImageBarrier image_barrier (0, /* source_access_mask */ + VK_ACCESS_TRANSFER_WRITE_BIT, + false, + in_current_image_layout, + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, + queue_fam_index, + queue_fam_index, + this, + image_subresource_range); temp_cmdbuf_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, @@ -2321,10 +1872,11 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p mipmap_iterator != in_mipmaps_ptr->cend(); ++mipmap_iterator) { + const auto base_mip_width = m_create_info_ptr->get_base_mip_width (); VkBufferImageCopy current_copy_region; - const auto& current_mipmap = *mipmap_iterator; + const auto& current_mipmap = *mipmap_iterator; - current_copy_region.bufferImageHeight = std::max(m_height / (1 << current_mipmap.n_mipmap), 1u); + current_copy_region.bufferImageHeight = std::max(base_mip_height / (1 << current_mipmap.n_mipmap), 1u); current_copy_region.bufferOffset = mip_data_offsets[static_cast(mipmap_iterator - in_mipmaps_ptr->cbegin()) ]; current_copy_region.bufferRowLength = 0; current_copy_region.imageOffset.x = 0; @@ -2335,8 +1887,8 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p current_copy_region.imageSubresource.aspectMask = current_mipmap.aspect; current_copy_region.imageSubresource.mipLevel = current_mipmap.n_mipmap; current_copy_region.imageExtent.depth = current_mipmap.n_slices; - current_copy_region.imageExtent.height = std::max(m_height / (1 << current_mipmap.n_mipmap), 1u); - current_copy_region.imageExtent.width = std::max(m_width / (1 << current_mipmap.n_mipmap), 1u); + current_copy_region.imageExtent.height = std::max(base_mip_height / (1 << current_mipmap.n_mipmap), 1u); + current_copy_region.imageExtent.width = std::max(base_mip_width / (1 << current_mipmap.n_mipmap), 1u); if (current_copy_region.imageExtent.depth < 1) { diff --git a/src/wrappers/image_view.cpp b/src/wrappers/image_view.cpp index cd0422d0..bbd34ff6 100644 --- a/src/wrappers/image_view.cpp +++ b/src/wrappers/image_view.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -21,6 +21,8 @@ // #include "misc/debug.h" +#include "misc/image_create_info.h" +#include "misc/image_view_create_info.h" #include "misc/object_tracker.h" #include "misc/struct_chainer.h" #include "wrappers/device.h" @@ -28,341 +30,33 @@ #include "wrappers/image_view.h" /* Please see header for specification */ -Anvil::ImageViewUniquePtr Anvil::ImageView::create_1D(const Anvil::BaseDevice* in_device_ptr, - Image* in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety) +Anvil::ImageViewUniquePtr Anvil::ImageView::create(Anvil::ImageViewCreateInfoUniquePtr in_create_info_ptr) { - const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); - ImageViewUniquePtr new_image_view_ptr (new ImageView(in_device_ptr, - in_image_ptr, - mt_safe), - std::default_delete() ); - const VkComponentSwizzle swizzle_rgba[] = - { - in_swizzle_red, - in_swizzle_green, - in_swizzle_blue, - in_swizzle_alpha - }; - - if (!new_image_view_ptr->init(VK_IMAGE_VIEW_TYPE_1D, - in_n_base_layer, - 1, /* n_layers */ - 1, /* n_slices */ - in_n_base_mipmap_level, - in_n_mipmaps, - in_aspect_mask, - in_format, - swizzle_rgba) ) - { - new_image_view_ptr = nullptr; - } - - return new_image_view_ptr; -} - -/* Please see header for specification */ -Anvil::ImageViewUniquePtr Anvil::ImageView::create_1D_array(const Anvil::BaseDevice* in_device_ptr, - Anvil::Image* in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_layers, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety) - -{ - const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); - ImageViewUniquePtr new_image_view_ptr(new ImageView(in_device_ptr, - in_image_ptr, - mt_safe), - std::default_delete() ); - const VkComponentSwizzle swizzle_rgba[] = - { - in_swizzle_red, - in_swizzle_green, - in_swizzle_blue, - in_swizzle_alpha - }; - - if (!new_image_view_ptr->init(VK_IMAGE_VIEW_TYPE_1D_ARRAY, - in_n_base_layer, - in_n_layers, - 1, /* n_slices */ - in_n_base_mipmap_level, - in_n_mipmaps, - in_aspect_mask, - in_format, - swizzle_rgba) ) - { - new_image_view_ptr = nullptr; - } - - return new_image_view_ptr; -} - -/* Please see header for specification */ -Anvil::ImageViewUniquePtr Anvil::ImageView::create_2D(const Anvil::BaseDevice* in_device_ptr, - Anvil::Image* in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety) -{ - const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); - ImageViewUniquePtr new_image_view_ptr(new ImageView(in_device_ptr, - in_image_ptr, - mt_safe) , - std::default_delete() ); - const VkComponentSwizzle swizzle_rgba[] = - { - in_swizzle_red, - in_swizzle_green, - in_swizzle_blue, - in_swizzle_alpha - }; - - if (!new_image_view_ptr->init(VK_IMAGE_VIEW_TYPE_2D, - in_n_base_layer, - 1, /* n_layers */ - 1, /* n_slices */ - in_n_base_mipmap_level, - in_n_mipmaps, - in_aspect_mask, - in_format, - swizzle_rgba) ) - { - new_image_view_ptr = nullptr; - } - - return new_image_view_ptr; -} - -/* Please see header for specification */ -Anvil::ImageViewUniquePtr Anvil::ImageView::create_2D_array(const Anvil::BaseDevice* in_device_ptr, - Anvil::Image* in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_layers, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety) -{ - const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); - ImageViewUniquePtr new_image_view_ptr(new ImageView(in_device_ptr, - in_image_ptr, - mt_safe), - std::default_delete() ); - const VkComponentSwizzle swizzle_rgba[] = - { - in_swizzle_red, - in_swizzle_green, - in_swizzle_blue, - in_swizzle_alpha - }; - - if (!new_image_view_ptr->init(VK_IMAGE_VIEW_TYPE_2D_ARRAY, - in_n_base_layer, - in_n_layers, - 1, /* n_slices */ - in_n_base_mipmap_level, - in_n_mipmaps, - in_aspect_mask, - in_format, - swizzle_rgba) ) - { - new_image_view_ptr = nullptr; - } + Anvil::ImageViewUniquePtr result_ptr = Anvil::ImageViewUniquePtr(nullptr, + std::default_delete() ); - return new_image_view_ptr; -} + result_ptr.reset( + new Anvil::ImageView(std::move(in_create_info_ptr) ) + ); -/* Please see header for specification */ -Anvil::ImageViewUniquePtr Anvil::ImageView::create_3D(const Anvil::BaseDevice* in_device_ptr, - Anvil::Image* in_image_ptr, - uint32_t in_n_base_slice, - uint32_t in_n_slices, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety) -{ - const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); - ImageViewUniquePtr new_image_view_ptr(new ImageView(in_device_ptr, - in_image_ptr, - mt_safe), - std::default_delete() ); - const VkComponentSwizzle swizzle_rgba[] = - { - in_swizzle_red, - in_swizzle_green, - in_swizzle_blue, - in_swizzle_alpha - }; - - if (!new_image_view_ptr->init(VK_IMAGE_VIEW_TYPE_3D, - in_n_base_slice, - 1, /* n_layers */ - in_n_slices, - in_n_base_mipmap_level, - in_n_mipmaps, - in_aspect_mask, - in_format, - swizzle_rgba) ) + if (result_ptr != nullptr) { - new_image_view_ptr = nullptr; - } - - return new_image_view_ptr; -} - -/* Please see header for specification */ -Anvil::ImageViewUniquePtr Anvil::ImageView::create_cube_map(const Anvil::BaseDevice* in_device_ptr, - Anvil::Image* in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety) -{ - const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); - ImageViewUniquePtr new_image_view_ptr(new ImageView(in_device_ptr, - in_image_ptr, - mt_safe), - std::default_delete() ); - const VkComponentSwizzle swizzle_rgba[] = - { - in_swizzle_red, - in_swizzle_green, - in_swizzle_blue, - in_swizzle_alpha - }; - - if (!new_image_view_ptr->init(VK_IMAGE_VIEW_TYPE_CUBE, - in_n_base_layer, - 6, /* n_layers */ - 1, /* n_slices */ - in_n_base_mipmap_level, - in_n_mipmaps, - in_aspect_mask, - in_format, - swizzle_rgba) ) - { - new_image_view_ptr = nullptr; - } - - return new_image_view_ptr; -} - -/* Please see header for specification */ -Anvil::ImageViewUniquePtr Anvil::ImageView::create_cube_map_array(const Anvil::BaseDevice* in_device_ptr, - Anvil::Image* in_image_ptr, - uint32_t in_n_base_layer, - uint32_t in_n_cube_maps, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha, - MTSafety in_mt_safety) -{ - const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); - ImageViewUniquePtr new_image_view_ptr(new ImageView(in_device_ptr, - in_image_ptr, - mt_safe), - std::default_delete() ); - const VkComponentSwizzle swizzle_rgba[] = - { - in_swizzle_red, - in_swizzle_green, - in_swizzle_blue, - in_swizzle_alpha - }; - - if (!new_image_view_ptr->init(VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, - in_n_base_layer, - in_n_cube_maps * 6, - 1, /* n_slices */ - in_n_base_mipmap_level, - in_n_mipmaps, - in_aspect_mask, - in_format, - swizzle_rgba) ) - { - new_image_view_ptr = nullptr; + if (!result_ptr->init() ) + { + result_ptr.reset(); + } } - return new_image_view_ptr; + return result_ptr; } -/** Constructor. Retains the user-specified Image instance and sets all members - * to default values. - * - * @param in_device_ptr Device to use. Must not be nullptr. - * @param in_parent_image_ptr Image to create the view for. Must not be nullptr. - **/ -Anvil::ImageView::ImageView(const Anvil::BaseDevice* in_device_ptr, - Anvil::Image* in_parent_image_ptr, - bool in_mt_safe) - :DebugMarkerSupportProvider(in_device_ptr, +Anvil::ImageView::ImageView(Anvil::ImageViewCreateInfoUniquePtr in_create_info_ptr) + :DebugMarkerSupportProvider(in_create_info_ptr->get_device(), VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT), - MTSafetySupportProvider (in_mt_safe) + MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), + in_create_info_ptr->get_device () )) { - anvil_assert(in_parent_image_ptr != nullptr); - - m_device_ptr = in_device_ptr; - m_format = VK_FORMAT_UNDEFINED; - m_image_view = VK_NULL_HANDLE; - m_n_base_mipmap_level = UINT32_MAX; - m_n_layers = UINT32_MAX; - m_n_mipmaps = UINT32_MAX; - m_n_slices = UINT32_MAX; - m_parent_image_ptr = in_parent_image_ptr; + m_create_info_ptr = std::move(in_create_info_ptr); /* Register the object */ Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_IMAGE_VIEW, @@ -394,26 +88,28 @@ void Anvil::ImageView::get_base_mipmap_size(uint32_t* out_opt_base_mipmap_width_ uint32_t* out_opt_base_mipmap_height_ptr, uint32_t* out_opt_base_mipmap_depth_ptr) const { - bool result (false); - uint32_t result_depth(0); + const auto n_base_mip_level(m_create_info_ptr->get_base_mipmap_level() ); + const auto parent_image_ptr(m_create_info_ptr->get_parent_image () ); + bool result (false); + uint32_t result_depth (0); ANVIL_REDUNDANT_VARIABLE(result); - result = m_parent_image_ptr->get_image_mipmap_size(m_n_base_mipmap_level, - out_opt_base_mipmap_width_ptr, - out_opt_base_mipmap_height_ptr, - nullptr); + result = parent_image_ptr->get_image_mipmap_size(n_base_mip_level, + out_opt_base_mipmap_width_ptr, + out_opt_base_mipmap_height_ptr, + nullptr); anvil_assert(result); - switch (m_type) + switch (m_create_info_ptr->get_type() ) { - case VK_IMAGE_VIEW_TYPE_1D: result_depth = 1; break; - case VK_IMAGE_VIEW_TYPE_1D_ARRAY: result_depth = m_n_layers; break; - case VK_IMAGE_VIEW_TYPE_2D: result_depth = 1; break; - case VK_IMAGE_VIEW_TYPE_2D_ARRAY: result_depth = m_n_layers; break; - case VK_IMAGE_VIEW_TYPE_3D: result_depth = m_n_slices; break; - case VK_IMAGE_VIEW_TYPE_CUBE: result_depth = m_n_layers; break; - case VK_IMAGE_VIEW_TYPE_CUBE_ARRAY: result_depth = m_n_layers; break; + case VK_IMAGE_VIEW_TYPE_1D: result_depth = 1; break; + case VK_IMAGE_VIEW_TYPE_1D_ARRAY: result_depth = m_create_info_ptr->get_n_layers(); break; + case VK_IMAGE_VIEW_TYPE_2D: result_depth = 1; break; + case VK_IMAGE_VIEW_TYPE_2D_ARRAY: result_depth = m_create_info_ptr->get_n_layers(); break; + case VK_IMAGE_VIEW_TYPE_3D: result_depth = m_create_info_ptr->get_n_slices(); break; + case VK_IMAGE_VIEW_TYPE_CUBE: result_depth = m_create_info_ptr->get_n_layers(); break; + case VK_IMAGE_VIEW_TYPE_CUBE_ARRAY: result_depth = m_create_info_ptr->get_n_layers(); break; default: { @@ -427,6 +123,19 @@ void Anvil::ImageView::get_base_mipmap_size(uint32_t* out_opt_base_mipmap_width_ } } +VkImageSubresourceRange Anvil::ImageView::get_subresource_range() const +{ + VkImageSubresourceRange result; + + result.aspectMask = m_create_info_ptr->get_aspect (); + result.baseArrayLayer = m_create_info_ptr->get_base_layer (); + result.baseMipLevel = m_create_info_ptr->get_base_mipmap_level(); + result.layerCount = m_create_info_ptr->get_n_layers (); + result.levelCount = m_create_info_ptr->get_n_mipmaps (); + + return result; +} + /** Performs a number of image view type-specific sanity checks and creates the requested * Vulkan image view instance. * @@ -434,95 +143,76 @@ void Anvil::ImageView::get_base_mipmap_size(uint32_t* out_opt_base_mipmap_width_ * * @return true if the function executed successfully, false otherwise. **/ -bool Anvil::ImageView::init(VkImageViewType in_image_view_type, - uint32_t in_n_base_layer, - uint32_t in_n_layers, - uint32_t in_n_slices, - uint32_t in_n_base_mipmap_level, - uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - const VkComponentSwizzle* in_swizzle_rgba_ptr) +bool Anvil::ImageView::init() { - VkFormat parent_image_format = VK_FORMAT_UNDEFINED; - uint32_t parent_image_n_layers = 0; - uint32_t parent_image_n_mipmaps = 0; - bool result = false; + const auto aspect_mask = m_create_info_ptr->get_aspect (); + const auto format = m_create_info_ptr->get_format (); + const auto image_view_type = m_create_info_ptr->get_type (); + const auto n_base_layer = m_create_info_ptr->get_base_layer (); + const auto n_base_mip = m_create_info_ptr->get_base_mipmap_level(); + const auto n_layers = m_create_info_ptr->get_n_layers (); + const auto n_mips = m_create_info_ptr->get_n_mipmaps (); + VkFormat parent_image_format = VK_FORMAT_UNDEFINED; + uint32_t parent_image_n_layers = 0; + uint32_t parent_image_n_mipmaps = 0; + auto parent_image_ptr = m_create_info_ptr->get_parent_image(); + bool result = false; VkResult result_vk; Anvil::StructChainer struct_chainer; + const auto& swizzle_array = m_create_info_ptr->get_swizzle_array(); - /* Sanity checks. Only focus on the basic stuff - hopefully more complicated issues - * will be caught by the validation layers. - */ - if (!(m_parent_image_ptr != nullptr) ) - { - anvil_assert(m_parent_image_ptr != nullptr); - - goto end; - } + parent_image_format = parent_image_ptr->get_create_info_ptr()->get_format(); + parent_image_n_mipmaps = parent_image_ptr->get_n_mipmaps (); - if (!m_parent_image_ptr->is_swapchain_image () && - !m_parent_image_ptr->is_sparse () && - m_parent_image_ptr->get_memory_block () == nullptr && - m_parent_image_ptr->get_parent_swapchain() == nullptr) + if (parent_image_ptr->get_create_info_ptr()->get_type_vk() != VK_IMAGE_TYPE_3D) { - anvil_assert(!(m_parent_image_ptr->get_memory_block() == nullptr)); - - goto end; - } - - parent_image_format = m_parent_image_ptr->get_image_format (); - parent_image_n_mipmaps = m_parent_image_ptr->get_image_n_mipmaps(); - - if (m_parent_image_ptr->get_image_type() != VK_IMAGE_TYPE_3D) - { - parent_image_n_layers = m_parent_image_ptr->get_image_n_layers (); + parent_image_n_layers = parent_image_ptr->get_create_info_ptr()->get_n_layers(); } else { - m_parent_image_ptr->get_image_mipmap_size(0, /* in_n_mipmap */ - nullptr, /* out_opt_width_ptr */ - nullptr, /* out_opt_height_ptr */ - &parent_image_n_layers); + parent_image_ptr->get_image_mipmap_size(0, /* in_n_mipmap */ + nullptr, /* out_opt_width_ptr */ + nullptr, /* out_opt_height_ptr */ + &parent_image_n_layers); } - if (!(parent_image_n_layers >= in_n_base_layer + in_n_layers)) + if (!(parent_image_n_layers >= n_base_layer + n_layers)) { - anvil_assert(parent_image_n_layers >= in_n_base_layer + in_n_layers); + anvil_assert(parent_image_n_layers >= n_base_layer + n_layers); goto end; } - if (!(parent_image_n_mipmaps >= in_n_base_mipmap_level + in_n_mipmaps)) + if (!(parent_image_n_mipmaps >= n_base_mip + n_mips)) { - anvil_assert(parent_image_n_mipmaps >= in_n_base_mipmap_level + in_n_mipmaps); + anvil_assert(parent_image_n_mipmaps >= n_base_mip + n_mips); goto end; } - if (((m_parent_image_ptr->get_image_create_flags() & Anvil::IMAGE_CREATE_FLAG_MUTABLE_FORMAT_BIT) == 0) && - (parent_image_format != in_format)) + if (((parent_image_ptr->get_create_info_ptr()->get_create_flags() & Anvil::IMAGE_CREATE_FLAG_MUTABLE_FORMAT_BIT) == 0) && + (parent_image_format != format)) { - anvil_assert(parent_image_format == in_format); + anvil_assert(parent_image_format == format); goto end; } - if (m_parent_image_ptr->get_image_type() == VK_IMAGE_TYPE_3D) + if (parent_image_ptr->get_create_info_ptr()->get_type_vk() == VK_IMAGE_TYPE_3D) { - if (in_image_view_type == VK_IMAGE_VIEW_TYPE_2D || - in_image_view_type == VK_IMAGE_VIEW_TYPE_2D_ARRAY) + if (image_view_type == VK_IMAGE_VIEW_TYPE_2D || + image_view_type == VK_IMAGE_VIEW_TYPE_2D_ARRAY) { - if (!m_device_ptr->is_khr_maintenance1_extension_enabled() ) + if (!m_device_ptr->get_extension_info()->khr_maintenance1() ) { - anvil_assert(m_device_ptr->is_khr_maintenance1_extension_enabled()); + anvil_assert(m_device_ptr->get_extension_info()->khr_maintenance1()); goto end; } - if ((m_parent_image_ptr->get_image_create_flags() & Anvil::IMAGE_CREATE_FLAG_2D_ARRAY_COMPATIBLE_BIT) == 0) + if ((parent_image_ptr->get_create_info_ptr()->get_create_flags() & Anvil::IMAGE_CREATE_FLAG_2D_ARRAY_COMPATIBLE_BIT) == 0) { - anvil_assert((m_parent_image_ptr->get_image_create_flags() & Anvil::IMAGE_CREATE_FLAG_2D_ARRAY_COMPATIBLE_BIT) != 0); + anvil_assert((parent_image_ptr->get_create_info_ptr()->get_create_flags() & Anvil::IMAGE_CREATE_FLAG_2D_ARRAY_COMPATIBLE_BIT) != 0); goto end; } @@ -533,21 +223,21 @@ bool Anvil::ImageView::init(VkImageViewType in_image_view_type, { VkImageViewCreateInfo image_view_create_info; - image_view_create_info.components.a = in_swizzle_rgba_ptr[3]; - image_view_create_info.components.b = in_swizzle_rgba_ptr[2]; - image_view_create_info.components.g = in_swizzle_rgba_ptr[1]; - image_view_create_info.components.r = in_swizzle_rgba_ptr[0]; + image_view_create_info.components.a = swizzle_array[3]; + image_view_create_info.components.b = swizzle_array[2]; + image_view_create_info.components.g = swizzle_array[1]; + image_view_create_info.components.r = swizzle_array[0]; image_view_create_info.flags = 0; - image_view_create_info.format = in_format; - image_view_create_info.image = m_parent_image_ptr->get_image(); + image_view_create_info.format = format; + image_view_create_info.image = parent_image_ptr->get_image(); image_view_create_info.pNext = nullptr; image_view_create_info.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; - image_view_create_info.subresourceRange.aspectMask = in_aspect_mask; - image_view_create_info.subresourceRange.baseArrayLayer = in_n_base_layer; - image_view_create_info.subresourceRange.baseMipLevel = in_n_base_mipmap_level; - image_view_create_info.subresourceRange.layerCount = in_n_layers; - image_view_create_info.subresourceRange.levelCount = in_n_mipmaps; - image_view_create_info.viewType = in_image_view_type; + image_view_create_info.subresourceRange.aspectMask = aspect_mask; + image_view_create_info.subresourceRange.baseArrayLayer = n_base_layer; + image_view_create_info.subresourceRange.baseMipLevel = n_base_mip; + image_view_create_info.subresourceRange.layerCount = n_layers; + image_view_create_info.subresourceRange.levelCount = n_mips; + image_view_create_info.viewType = image_view_type; struct_chainer.append_struct(image_view_create_info); } @@ -571,19 +261,6 @@ bool Anvil::ImageView::init(VkImageViewType in_image_view_type, /* Cache the properties */ set_vk_handle(m_image_view); - m_aspect_mask = in_aspect_mask; - m_format = in_format; - m_n_base_layer = in_n_base_layer; - m_n_base_mipmap_level = in_n_base_mipmap_level; - m_n_layers = in_n_layers; - m_n_mipmaps = in_n_mipmaps; - m_n_slices = in_n_slices; - m_type = in_image_view_type; - - memcpy(m_swizzle_array, - in_swizzle_rgba_ptr, - sizeof(m_swizzle_array) ); - /* All done */ result = true; @@ -594,9 +271,10 @@ bool Anvil::ImageView::init(VkImageViewType in_image_view_type, /* Please see header for specification */ bool Anvil::ImageView::intersects(const Anvil::ImageView* in_image_view_ptr) const { - bool result = false; + auto parent_image_ptr = m_create_info_ptr->get_parent_image(); + bool result = false; - if (get_parent_image() == in_image_view_ptr->get_parent_image() ) + if (parent_image_ptr == in_image_view_ptr->m_create_info_ptr->get_parent_image() ) { auto in_subresource_range = in_image_view_ptr->get_subresource_range(); auto this_subresource_range = get_subresource_range(); diff --git a/src/wrappers/instance.cpp b/src/wrappers/instance.cpp index 1c9df729..90f0429e 100644 --- a/src/wrappers/instance.cpp +++ b/src/wrappers/instance.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -224,7 +224,7 @@ void Anvil::Instance::enumerate_layer_extensions(Anvil::Layer* in_layer_ptr) n_extension < n_extensions; ++n_extension) { - in_layer_ptr->extensions.push_back(Anvil::Extension(extension_props[n_extension]) ); + in_layer_ptr->extensions.push_back(extension_props[n_extension].extensionName); } } } @@ -279,9 +279,7 @@ void Anvil::Instance::enumerate_physical_devices() /** Please see header for specification */ const Anvil::ExtensionKHRGetPhysicalDeviceProperties2& Anvil::Instance::get_extension_khr_get_physical_device_properties2_entrypoints() const { - anvil_assert(std::find(m_enabled_extensions.begin(), - m_enabled_extensions.end(), - VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME) != m_enabled_extensions.end() ); + anvil_assert(m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_get_physical_device_properties2() ); return m_khr_get_physical_device_properties2_entrypoints; } @@ -289,9 +287,7 @@ const Anvil::ExtensionKHRGetPhysicalDeviceProperties2& Anvil::Instance::get_exte /** Please see header for specification */ const Anvil::ExtensionKHRSurfaceEntrypoints& Anvil::Instance::get_extension_khr_surface_entrypoints() const { - anvil_assert(std::find(m_enabled_extensions.begin(), - m_enabled_extensions.end(), - VK_KHR_SURFACE_EXTENSION_NAME) != m_enabled_extensions.end() ); + anvil_assert(m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_surface() ); return m_khr_surface_entrypoints; } @@ -301,9 +297,7 @@ const Anvil::ExtensionKHRSurfaceEntrypoints& Anvil::Instance::get_extension_khr_ /** Please see header for specification */ const Anvil::ExtensionKHRWin32SurfaceEntrypoints& Anvil::Instance::get_extension_khr_win32_surface_entrypoints() const { - anvil_assert(std::find(m_enabled_extensions.begin(), - m_enabled_extensions.end(), - VK_KHR_WIN32_SURFACE_EXTENSION_NAME) != m_enabled_extensions.end() ); + anvil_assert(m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_win32_surface() ); return m_khr_win32_surface_entrypoints; } @@ -313,9 +307,7 @@ const Anvil::ExtensionKHRSurfaceEntrypoints& Anvil::Instance::get_extension_khr_ /** Please see header for specification */ const Anvil::ExtensionKHRXcbSurfaceEntrypoints& Anvil::Instance::get_extension_khr_xcb_surface_entrypoints() const { - anvil_assert(std::find(m_enabled_extensions.begin(), - m_enabled_extensions.end(), - VK_KHR_XCB_SURFACE_EXTENSION_NAME) != m_enabled_extensions.end() ); + anvil_assert(m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_xcb_surface() ); return m_khr_xcb_surface_entrypoints; } @@ -325,11 +317,12 @@ const Anvil::ExtensionKHRSurfaceEntrypoints& Anvil::Instance::get_extension_khr_ /** Initializes the wrapper. */ void Anvil::Instance::init(const std::vector& in_disallowed_instance_level_extensions) { - VkApplicationInfo app_info; - VkInstanceCreateInfo create_info; - std::vector enabled_layers; - size_t n_instance_layers = 0; - VkResult result = VK_ERROR_INITIALIZATION_FAILED; + VkApplicationInfo app_info; + VkInstanceCreateInfo create_info; + std::vector enabled_layers; + std::map extension_enabled_status; + size_t n_instance_layers = 0; + VkResult result = VK_ERROR_INITIALIZATION_FAILED; ANVIL_REDUNDANT_VARIABLE(result); @@ -368,31 +361,6 @@ void Anvil::Instance::init(const std::vector& in_disallowed_instanc #endif }; - if (m_validation_callback_function != nullptr) - { - for (uint32_t n_extension = 0; - n_extension < sizeof(desired_extensions_with_validation) / sizeof(desired_extensions_with_validation[0]); - ++n_extension) - { - if (is_instance_extension_supported(desired_extensions_with_validation[n_extension])) - { - m_enabled_extensions.push_back(desired_extensions_with_validation[n_extension]); - } - } - } - else - { - for (uint32_t n_extension = 0; - n_extension < sizeof(desired_extensions_without_validation) / sizeof(desired_extensions_without_validation[0]); - ++n_extension) - { - if (is_instance_extension_supported(desired_extensions_without_validation[n_extension])) - { - m_enabled_extensions.push_back(desired_extensions_without_validation[n_extension]); - } - } - } - /* Set up the app info descriptor **/ app_info.apiVersion = VK_MAKE_VERSION(1, 0, 0); app_info.applicationVersion = 0; @@ -413,8 +381,8 @@ void Anvil::Instance::init(const std::vector& in_disallowed_instanc n_instance_layer < n_instance_layers; ++n_instance_layer) { - const std::vector& layer_extensions = m_supported_layers[n_instance_layer].extensions; - const std::string& layer_name = m_supported_layers[n_instance_layer].name; + const auto& layer_extensions = m_supported_layers[n_instance_layer].extensions; + const std::string& layer_name = m_supported_layers[n_instance_layer].name; /* If validation is enabled and this is a layer which issues debug call-backs, cache it, so that * we can request for it at vkCreateInstance() call time */ @@ -427,39 +395,67 @@ void Anvil::Instance::init(const std::vector& in_disallowed_instanc } } - /* Enable known instance-level extensions by default */ - if (is_instance_extension_supported(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME) ) { - m_enabled_extensions.push_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); - } + if (m_validation_callback_function != nullptr) + { + for (uint32_t n_extension = 0; + n_extension < sizeof(desired_extensions_with_validation) / sizeof(desired_extensions_with_validation[0]); + ++n_extension) + { + if (is_instance_extension_supported(desired_extensions_with_validation[n_extension])) + { + extension_enabled_status[desired_extensions_with_validation[n_extension] ] = true; + } + } + } + else + { + for (uint32_t n_extension = 0; + n_extension < sizeof(desired_extensions_without_validation) / sizeof(desired_extensions_without_validation[0]); + ++n_extension) + { + if (is_instance_extension_supported(desired_extensions_without_validation[n_extension])) + { + extension_enabled_status[desired_extensions_without_validation[n_extension] ] = true; + } + } + } - if (is_instance_extension_supported(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME) ) - { - m_enabled_extensions.push_back(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME); - } + /* Enable known instance-level extensions by default */ + if (is_instance_extension_supported(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME) ) + { + extension_enabled_status[VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME] = true; + } - /* Filter out undesired extensions */ - for (const auto& current_extension_name : in_disallowed_instance_level_extensions) - { - auto iterator = std::find(m_enabled_extensions.begin(), - m_enabled_extensions.end (), - current_extension_name); + if (is_instance_extension_supported(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME) ) + { + extension_enabled_status[VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME] = true; + } - if (iterator != m_enabled_extensions.end() ) + /* Filter out undesired extensions */ + for (const auto& current_extension_name : in_disallowed_instance_level_extensions) { - m_enabled_extensions.erase(iterator); + auto ext_iterator = extension_enabled_status.find(current_extension_name); + + if (ext_iterator != extension_enabled_status.end() ) + { + extension_enabled_status.erase(ext_iterator); + } } + + m_enabled_extensions_info_ptr = Anvil::ExtensionInfo::create_instance_extension_info(extension_enabled_status, + false); /* in_unspecified_extension_name_value */ } /* We're ready to create a new Vulkan instance */ std::vector enabled_extensions_raw; - for (auto& ext_name : m_enabled_extensions) + for (auto& ext_name : extension_enabled_status) { - enabled_extensions_raw.push_back(ext_name.c_str() ); + enabled_extensions_raw.push_back(ext_name.first.c_str() ); } - create_info.enabledExtensionCount = static_cast(m_enabled_extensions.size() ); + create_info.enabledExtensionCount = static_cast(enabled_extensions_raw.size() ); create_info.enabledLayerCount = static_cast(enabled_layers.size() ); create_info.flags = 0; create_info.pApplicationInfo = &app_info; @@ -560,9 +556,7 @@ void Anvil::Instance::init_func_pointers() } #endif - if (std::find(m_enabled_extensions.begin(), - m_enabled_extensions.end(), - VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME) != m_enabled_extensions.end() ) + if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_get_physical_device_properties2() ) { m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceFeatures2KHR = reinterpret_cast (vkGetInstanceProcAddr(m_instance, "vkGetPhysicalDeviceFeatures2KHR") ); @@ -592,9 +586,7 @@ void Anvil::Instance::init_func_pointers() /** Please see header for specification */ bool Anvil::Instance::is_instance_extension_enabled(const char* in_extension_name) const { - return std::find(m_enabled_extensions.begin(), - m_enabled_extensions.end(), - in_extension_name) != m_enabled_extensions.end(); + return m_enabled_extensions_info_ptr->get_instance_extension_info()->by_name(in_extension_name); } /** Please see header for specification */ diff --git a/src/wrappers/memory_block.cpp b/src/wrappers/memory_block.cpp index b2db365b..6dcc7787 100644 --- a/src/wrappers/memory_block.cpp +++ b/src/wrappers/memory_block.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -30,21 +30,25 @@ #include "wrappers/physical_device.h" /* Please see header for specification */ -Anvil::MemoryBlock::MemoryBlock(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_allowed_memory_bits, - VkDeviceSize in_size, - Anvil::MemoryFeatureFlags in_memory_features, - bool in_mt_safe) - :MTSafetySupportProvider (in_mt_safe), - m_allowed_memory_bits (in_allowed_memory_bits), - m_device_ptr (in_device_ptr), - m_gpu_data_map_count (0), - m_gpu_data_ptr (nullptr), - m_memory (VK_NULL_HANDLE), - m_memory_features (in_memory_features), - m_parent_memory_block_ptr(nullptr), - m_size (in_size), - m_start_offset (0) +Anvil::MemoryBlock::MemoryBlock(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_allowed_memory_bits, + VkDeviceSize in_size, + Anvil::MemoryFeatureFlags in_memory_features, + bool in_mt_safe, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) + :MTSafetySupportProvider (in_mt_safe), + m_allowed_memory_bits (in_allowed_memory_bits), + m_backend_object (nullptr), + m_device_ptr (in_device_ptr), + m_external_memory_handle_types (in_external_memory_handle_types), + m_gpu_data_map_count (0), + m_gpu_data_ptr (nullptr), + m_memory (VK_NULL_HANDLE), + m_memory_features (in_memory_features), + m_parent_memory_allocator_backend_ptr(nullptr), + m_parent_memory_block_ptr (nullptr), + m_size (in_size), + m_start_offset (0) { /* Register the object */ Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_MEMORY_BLOCK, @@ -60,17 +64,20 @@ Anvil::MemoryBlock::MemoryBlock(MemoryBlock* in_parent_memory_block_ptr, anvil_assert(in_parent_memory_block_ptr != nullptr); anvil_assert(in_parent_memory_block_ptr->m_gpu_data_ptr == nullptr); - m_allowed_memory_bits = in_parent_memory_block_ptr->m_allowed_memory_bits; - m_device_ptr = in_parent_memory_block_ptr->m_device_ptr; - m_gpu_data_map_count = UINT32_MAX; - m_gpu_data_ptr = nullptr; - m_memory_features = in_parent_memory_block_ptr->m_memory_features; - m_memory = VK_NULL_HANDLE; - m_memory_type_index = UINT32_MAX; - m_on_release_callback_function = in_parent_memory_block_ptr->m_on_release_callback_function; - m_parent_memory_block_ptr = in_parent_memory_block_ptr; - m_size = in_size; - m_start_offset = in_start_offset + m_parent_memory_block_ptr->m_start_offset; + m_allowed_memory_bits = in_parent_memory_block_ptr->m_allowed_memory_bits; + m_backend_object = in_parent_memory_block_ptr->m_backend_object; + m_device_ptr = in_parent_memory_block_ptr->m_device_ptr; + m_external_memory_handle_types = in_parent_memory_block_ptr->m_external_memory_handle_types; + m_gpu_data_map_count = UINT32_MAX; + m_gpu_data_ptr = nullptr; + m_memory_features = in_parent_memory_block_ptr->m_memory_features; + m_memory = VK_NULL_HANDLE; + m_memory_type_index = UINT32_MAX; + m_on_release_callback_function = in_parent_memory_block_ptr->m_on_release_callback_function; + m_parent_memory_allocator_backend_ptr = in_parent_memory_block_ptr->m_parent_memory_allocator_backend_ptr; + m_parent_memory_block_ptr = in_parent_memory_block_ptr; + m_size = in_size; + m_start_offset = in_start_offset + m_parent_memory_block_ptr->m_start_offset; anvil_assert(m_start_offset >= m_parent_memory_block_ptr->m_start_offset); anvil_assert(m_start_offset + m_size <= m_parent_memory_block_ptr->m_start_offset + m_parent_memory_block_ptr->m_size); @@ -88,22 +95,26 @@ Anvil::MemoryBlock::MemoryBlock(const Anvil::BaseDevice* in_device_p uint32_t in_memory_type_index, VkDeviceSize in_size, VkDeviceSize in_start_offset, - OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function) + OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) :MTSafetySupportProvider(false) { anvil_assert(in_on_release_callback_function != nullptr); - m_allowed_memory_bits = in_allowed_memory_bits; - m_device_ptr = in_device_ptr; - m_gpu_data_map_count = 0; - m_gpu_data_ptr = nullptr; - m_memory_features = in_memory_features; - m_memory = in_memory; - m_memory_type_index = in_memory_type_index; - m_parent_memory_block_ptr = nullptr; - m_on_release_callback_function = in_on_release_callback_function; - m_size = in_size; - m_start_offset = in_start_offset; + m_allowed_memory_bits = in_allowed_memory_bits; + m_backend_object = nullptr; + m_device_ptr = in_device_ptr; + m_external_memory_handle_types = in_external_memory_handle_types; + m_gpu_data_map_count = 0; + m_gpu_data_ptr = nullptr; + m_memory_features = in_memory_features; + m_memory = in_memory; + m_memory_type_index = in_memory_type_index; + m_parent_memory_allocator_backend_ptr = nullptr; + m_parent_memory_block_ptr = nullptr; + m_on_release_callback_function = in_on_release_callback_function; + m_size = in_size; + m_start_offset = in_start_offset; /* Register the object */ Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_MEMORY_BLOCK, @@ -159,8 +170,16 @@ void Anvil::MemoryBlock::close_gpu_memory_access() { lock(); { - vkUnmapMemory(m_device_ptr->get_device_vk(), - m_memory); + if (m_parent_memory_allocator_backend_ptr != nullptr) + { + m_parent_memory_allocator_backend_ptr->unmap(m_backend_object); + } + else + { + /* This block will be entered for memory blocks instantiated without a memory allocator */ + vkUnmapMemory(m_device_ptr->get_device_vk(), + m_memory); + } } unlock(); @@ -170,11 +189,12 @@ void Anvil::MemoryBlock::close_gpu_memory_access() } /* Please see header for specification */ -Anvil::MemoryBlockUniquePtr Anvil::MemoryBlock::create(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_allowed_memory_bits, - VkDeviceSize in_size, - Anvil::MemoryFeatureFlags in_memory_features, - MTSafety in_mt_safety) +Anvil::MemoryBlockUniquePtr Anvil::MemoryBlock::create(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_allowed_memory_bits, + VkDeviceSize in_size, + Anvil::MemoryFeatureFlags in_memory_features, + MTSafety in_mt_safety, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) { const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, in_device_ptr); @@ -186,7 +206,8 @@ Anvil::MemoryBlockUniquePtr Anvil::MemoryBlock::create(const Anvil::BaseDevice* in_allowed_memory_bits, in_size, in_memory_features, - mt_safe) + mt_safe, + in_external_memory_handle_types) ); if (!result_ptr->init() ) @@ -205,20 +226,12 @@ Anvil::MemoryBlockUniquePtr Anvil::MemoryBlock::create_derived(MemoryBlock* in_p MemoryBlockUniquePtr result_ptr(nullptr, std::default_delete() ); - if (in_parent_memory_block_ptr == nullptr) - { - anvil_assert(in_parent_memory_block_ptr != nullptr); - - goto end; - } - result_ptr.reset( new Anvil::MemoryBlock(in_parent_memory_block_ptr, in_start_offset, in_size) ); -end: return result_ptr; } @@ -230,7 +243,8 @@ Anvil::MemoryBlockUniquePtr Anvil::MemoryBlock::create_derived_with_custom_delet uint32_t in_memory_type_index, VkDeviceSize in_size, VkDeviceSize in_start_offset, - OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function) + OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) { MemoryBlockUniquePtr result_ptr(nullptr, std::default_delete() ); @@ -243,7 +257,8 @@ Anvil::MemoryBlockUniquePtr Anvil::MemoryBlock::create_derived_with_custom_delet in_memory_type_index, in_size, in_start_offset, - in_on_release_callback_function) + in_on_release_callback_function, + in_external_memory_handle_types) ); return result_ptr; @@ -286,15 +301,15 @@ uint32_t Anvil::MemoryBlock::get_device_memory_type_index(uint32_t { const Anvil::MemoryType& current_memory_type = memory_types[n_memory_type]; - if (((is_coherent_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)) || - !is_coherent_memory_required) && - ((is_device_local_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) || - !is_device_local_memory_required) && - ((is_host_cached_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT)) || - !is_host_cached_memory_required) && - ((is_lazily_allocated_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT)) || - !is_lazily_allocated_memory_required) && - ((is_mappable_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)) || + if (((is_coherent_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)) || + !is_coherent_memory_required) && + ((is_device_local_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) || + !is_device_local_memory_required) && + ((is_host_cached_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT)) || + !is_host_cached_memory_required) && + ((is_lazily_allocated_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT)) || + !is_lazily_allocated_memory_required) && + ((is_mappable_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)) || !is_mappable_memory_required) ) { if ( (in_memory_type_bits & (1 << n_memory_type)) != 0) @@ -331,6 +346,17 @@ bool Anvil::MemoryBlock::init() struct_chainer.append_struct(buffer_data_alloc_info); } + if (m_external_memory_handle_types != 0) + { + VkExportMemoryAllocateInfoKHR export_memory_alloc_info; + + export_memory_alloc_info.handleTypes = Anvil::Utils::convert_external_memory_handle_types_to_vk_external_memory_handle_type_flags(m_external_memory_handle_types); + export_memory_alloc_info.pNext = nullptr; + export_memory_alloc_info.sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR; + + struct_chainer.append_struct(export_memory_alloc_info); + } + { auto chain_ptr = struct_chainer.create_chain(); @@ -457,12 +483,23 @@ bool Anvil::MemoryBlock::open_gpu_memory_access() /* Map the memory region into process space */ lock(); { - result_vk = vkMapMemory(m_device_ptr->get_device_vk(), - m_memory, - 0, /* offset */ - m_size, - 0, /* flags */ - (void**) &m_gpu_data_ptr); + if (m_parent_memory_allocator_backend_ptr != nullptr) + { + result_vk = m_parent_memory_allocator_backend_ptr->map(m_backend_object, + 0, /* in_start_offset */ + m_size, + static_cast(&m_gpu_data_ptr) ); + } + else + { + /* This block will be entered for memory blocks instantiated without a memory allocator */ + result_vk = vkMapMemory(m_device_ptr->get_device_vk(), + m_memory, + 0, /* offset */ + m_size, + 0, /* flags */ + static_cast(&m_gpu_data_ptr) ); + } } unlock(); diff --git a/src/wrappers/physical_device.cpp b/src/wrappers/physical_device.cpp index 311efcd1..2741b713 100644 --- a/src/wrappers/physical_device.cpp +++ b/src/wrappers/physical_device.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -81,7 +81,7 @@ bool Anvil::PhysicalDevice::init() anvil_assert(m_physical_device != VK_NULL_HANDLE); - if (m_instance_ptr->is_instance_extension_supported(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME) ) + if (m_instance_ptr->get_enabled_extensions_info()->khr_get_physical_device_properties2() ) { gpdp2_entrypoints_ptr = &m_instance_ptr->get_extension_khr_get_physical_device_properties2_entrypoints(); } @@ -102,6 +102,7 @@ bool Anvil::PhysicalDevice::init() if (n_extensions > 0) { + std::map extension_availability; std::vector extension_props; extension_props.resize(n_extensions); @@ -116,18 +117,64 @@ bool Anvil::PhysicalDevice::init() n_extension < n_extensions; ++n_extension) { - m_extensions.push_back(Anvil::Extension(extension_props[n_extension]) ); + extension_availability[extension_props[n_extension].extensionName] = true; } + + m_extension_info_ptr = Anvil::ExtensionInfo::create_device_extension_info(extension_availability, + false); /* in_unspecified_extension_name_value */ } /* Retrieve and cache device features */ { + Anvil::StructID descriptor_indexing_features_struct_id = UINT32_MAX; VkPhysicalDeviceFeatures features_vk; vkGetPhysicalDeviceFeatures(m_physical_device, &features_vk); - if (is_device_extension_supported(VK_KHR_16BIT_STORAGE_EXTENSION_NAME) ) + if (m_extension_info_ptr->get_device_extension_info()->ext_descriptor_indexing() ) + { + const auto& gpdp2_entrypoints = m_instance_ptr->get_extension_khr_get_physical_device_properties2_entrypoints(); + Anvil::StructChainUniquePtr struct_chain_ptr; + Anvil::StructChainer struct_chainer; + + { + VkPhysicalDeviceFeatures2KHR features; + + features.pNext = nullptr; + features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR; + + struct_chainer.append_struct(features); + } + + { + VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptor_indexing_features; + + descriptor_indexing_features.pNext = nullptr; + descriptor_indexing_features.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT); + + descriptor_indexing_features_struct_id = struct_chainer.append_struct(descriptor_indexing_features); + } + + struct_chain_ptr = struct_chainer.create_chain(); + + gpdp2_entrypoints.vkGetPhysicalDeviceFeatures2KHR(m_physical_device, + struct_chain_ptr->get_root_struct() ); + + m_ext_descriptor_indexing_features_ptr.reset( + new EXTDescriptorIndexingFeatures(*struct_chain_ptr->get_struct_with_id(descriptor_indexing_features_struct_id) ) + ); + + if (m_ext_descriptor_indexing_features_ptr == nullptr) + { + anvil_assert(m_ext_descriptor_indexing_features_ptr != nullptr); + + result = false; + goto end; + } + } + + if (m_extension_info_ptr->get_device_extension_info()->khr_16bit_storage() ) { const auto& gpdp2_entrypoints = m_instance_ptr->get_extension_khr_get_physical_device_properties2_entrypoints(); Anvil::StructID storage_features_struct_id = UINT32_MAX; @@ -182,12 +229,13 @@ bool Anvil::PhysicalDevice::init() goto end; } - m_features = Anvil::PhysicalDeviceFeatures(m_core_features_vk10_ptr.get (), - m_khr_16_bit_storage_features_ptr.get() ); + m_features = Anvil::PhysicalDeviceFeatures(m_core_features_vk10_ptr.get (), + m_ext_descriptor_indexing_features_ptr.get(), + m_khr_16_bit_storage_features_ptr.get () ); } /* Retrieve device format properties */ - texture_gather_bias_lod_support = is_device_extension_supported(VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME);; + texture_gather_bias_lod_support = m_extension_info_ptr->get_device_extension_info()->amd_texture_gather_bias_lod(); for (VkFormat current_format = static_cast(1); /* skip the _UNDEFINED format */ current_format < VK_FORMAT_RANGE_SIZE; @@ -250,11 +298,11 @@ bool Anvil::PhysicalDevice::init() } /* Retrieve additional device info */ - if (m_instance_ptr->is_instance_extension_supported(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME) ) + if (m_instance_ptr->get_enabled_extensions_info()->khr_get_physical_device_properties2() ) { const auto& gpdp2_entrypoints = m_instance_ptr->get_extension_khr_get_physical_device_properties2_entrypoints(); - if (m_instance_ptr->is_instance_extension_supported(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME) ) + if (m_instance_ptr->get_enabled_extensions_info()->khr_external_memory_capabilities() ) { Anvil::StructID device_id_props_struct_id = UINT32_MAX; const VkPhysicalDeviceIDPropertiesKHR* result_device_id_props_ptr = nullptr; @@ -313,7 +361,95 @@ bool Anvil::PhysicalDevice::init() m_driver_UUID_available = true; } - if (is_device_extension_supported(VK_KHR_MAINTENANCE3_EXTENSION_NAME) ) + if (m_extension_info_ptr->get_device_extension_info()->amd_shader_core_properties() ) + { + const VkPhysicalDeviceShaderCorePropertiesAMD* result_shader_core_props_ptr = nullptr; + Anvil::StructID shader_core_struct_id = UINT32_MAX; + Anvil::StructChainUniquePtr struct_chain_ptr; + Anvil::StructChainer struct_chainer; + + { + VkPhysicalDeviceProperties2KHR general_props; + + general_props.pNext = nullptr; + general_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; + + struct_chainer.append_struct(general_props); + } + + { + VkPhysicalDeviceShaderCorePropertiesAMD shader_core_properties; + + shader_core_properties.pNext = nullptr; + shader_core_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD; + + shader_core_struct_id = struct_chainer.append_struct(shader_core_properties); + } + + struct_chain_ptr = struct_chainer.create_chain(); + result_shader_core_props_ptr = struct_chain_ptr->get_struct_with_id(shader_core_struct_id); + + gpdp2_entrypoints.vkGetPhysicalDeviceProperties2KHR(m_physical_device, + struct_chain_ptr->get_root_struct() ); + + m_amd_shader_core_properties_ptr.reset( + new AMDShaderCoreProperties(*result_shader_core_props_ptr) + ); + + if (m_amd_shader_core_properties_ptr == nullptr) + { + anvil_assert(m_amd_shader_core_properties_ptr != nullptr); + + result = false; + goto end; + } + } + + if (m_extension_info_ptr->get_device_extension_info()->ext_descriptor_indexing() ) + { + Anvil::StructID descriptor_indexing_props_struct_id = UINT32_MAX; + const VkPhysicalDeviceDescriptorIndexingPropertiesEXT* result_descriptor_indexing_props_struct_ptr = nullptr; + Anvil::StructChainUniquePtr struct_chain_ptr; + Anvil::StructChainer struct_chainer; + + { + VkPhysicalDeviceProperties2KHR general_props; + + general_props.pNext = nullptr; + general_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; + + struct_chainer.append_struct(general_props); + } + + { + VkPhysicalDeviceDescriptorIndexingPropertiesEXT descriptor_indexing_properties; + + descriptor_indexing_properties.pNext = nullptr; + descriptor_indexing_properties.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT); + + descriptor_indexing_props_struct_id = struct_chainer.append_struct(descriptor_indexing_properties); + } + + struct_chain_ptr = struct_chainer.create_chain(); + result_descriptor_indexing_props_struct_ptr = struct_chain_ptr->get_struct_with_id(descriptor_indexing_props_struct_id); + + gpdp2_entrypoints.vkGetPhysicalDeviceProperties2KHR(m_physical_device, + struct_chain_ptr->get_root_struct() ); + + m_ext_descriptor_indexing_properties_ptr.reset( + new EXTDescriptorIndexingProperties(*result_descriptor_indexing_props_struct_ptr) + ); + + if (m_ext_descriptor_indexing_properties_ptr == nullptr) + { + anvil_assert(m_ext_descriptor_indexing_properties_ptr != nullptr); + + result = false; + goto end; + } + } + + if (m_extension_info_ptr->get_device_extension_info()->khr_maintenance3() ) { Anvil::StructID maintenance3_struct_id = UINT32_MAX; const VkPhysicalDeviceMaintenance3PropertiesKHR* result_maintenanc3_struct_ptr = nullptr; @@ -377,8 +513,10 @@ bool Anvil::PhysicalDevice::init() } } - m_properties = Anvil::PhysicalDeviceProperties(m_core_properties_vk10_ptr.get (), - m_khr_maintenance3_properties_ptr.get() ); + m_properties = Anvil::PhysicalDeviceProperties(m_amd_shader_core_properties_ptr.get (), + m_core_properties_vk10_ptr.get (), + m_ext_descriptor_indexing_properties_ptr.get(), + m_khr_maintenance3_properties_ptr.get () ); /* Retrieve device queue data */ vkGetPhysicalDeviceQueueFamilyProperties(m_physical_device, @@ -494,9 +632,9 @@ bool Anvil::PhysicalDevice::get_sparse_image_format_properties(VkFormat /* Please see header for specification */ bool Anvil::PhysicalDevice::is_device_extension_supported(const std::string& in_extension_name) const { - return std::find(m_extensions.begin(), - m_extensions.end(), - in_extension_name) != m_extensions.end(); + anvil_assert(m_extension_info_ptr != nullptr); + + return m_extension_info_ptr->get_device_extension_info()->by_name(in_extension_name); } /* Please see header for specification */ diff --git a/src/wrappers/pipeline_cache.cpp b/src/wrappers/pipeline_cache.cpp index a51ea569..7ad85faa 100644 --- a/src/wrappers/pipeline_cache.cpp +++ b/src/wrappers/pipeline_cache.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/wrappers/pipeline_layout.cpp b/src/wrappers/pipeline_layout.cpp index 1176ed48..10f47052 100644 --- a/src/wrappers/pipeline_layout.cpp +++ b/src/wrappers/pipeline_layout.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -63,7 +63,7 @@ Anvil::PipelineLayout::~PipelineLayout() } /** Please see header for specification */ -bool Anvil::PipelineLayout::bake(const std::vector* in_ds_info_items_ptr) +bool Anvil::PipelineLayout::bake(const std::vector* in_ds_create_info_items_ptr) { auto ds_layout_manager_ptr = m_device_ptr->get_descriptor_set_layout_manager(); std::vector ds_layouts_vk; @@ -74,24 +74,24 @@ bool Anvil::PipelineLayout::bake(const std::vector* /* Convert descriptor set layouts to Vulkan equivalents */ const VkDescriptorSetLayout dummy_ds_layout = m_device_ptr->get_dummy_descriptor_set_layout()->get_layout(); - ds_layouts_vk.resize(in_ds_info_items_ptr->size() + 1, + ds_layouts_vk.resize(in_ds_create_info_items_ptr->size() + 1, dummy_ds_layout); - if (in_ds_info_items_ptr != nullptr && - in_ds_info_items_ptr->size() > 0) + if (in_ds_create_info_items_ptr != nullptr && + in_ds_create_info_items_ptr->size() > 0) { - const uint32_t n_current_descriptor_sets = static_cast(in_ds_info_items_ptr->size() ); + const uint32_t n_current_descriptor_sets = static_cast(in_ds_create_info_items_ptr->size() ); for (uint32_t n_current_descriptor_set = 0; n_current_descriptor_set < n_current_descriptor_sets; ++n_current_descriptor_set) { - auto& current_ds_info_ptr = in_ds_info_items_ptr->at(n_current_descriptor_set); + auto& current_ds_create_info_ptr = in_ds_create_info_items_ptr->at(n_current_descriptor_set); - if (current_ds_info_ptr == nullptr) + if (current_ds_create_info_ptr == nullptr) { - m_ds_info_ptrs.push_back( - Anvil::DescriptorSetInfoUniquePtr() + m_ds_create_info_ptrs.push_back( + Anvil::DescriptorSetCreateInfoUniquePtr() ); continue; @@ -100,13 +100,13 @@ bool Anvil::PipelineLayout::bake(const std::vector* { Anvil::DescriptorSetLayoutUniquePtr new_ds_layout_ptr; - m_ds_info_ptrs.push_back( - Anvil::DescriptorSetInfoUniquePtr( - new Anvil::DescriptorSetInfo(*current_ds_info_ptr) + m_ds_create_info_ptrs.push_back( + Anvil::DescriptorSetCreateInfoUniquePtr( + new Anvil::DescriptorSetCreateInfo(*current_ds_create_info_ptr) ) ); - if (!ds_layout_manager_ptr->get_layout(current_ds_info_ptr.get(), + if (!ds_layout_manager_ptr->get_layout(current_ds_create_info_ptr.get(), &new_ds_layout_ptr) ) { anvil_assert_fail(); @@ -167,10 +167,10 @@ bool Anvil::PipelineLayout::bake(const std::vector* } /* Please see header for specification */ -Anvil::PipelineLayoutUniquePtr Anvil::PipelineLayout::create(const Anvil::BaseDevice* in_device_ptr, - const std::vector* in_ds_info_items_ptr, - const PushConstantRanges& in_push_constant_ranges, - bool in_mt_safe) +Anvil::PipelineLayoutUniquePtr Anvil::PipelineLayout::create(const Anvil::BaseDevice* in_device_ptr, + const std::vector* in_ds_create_info_items_ptr, + const PushConstantRanges& in_push_constant_ranges, + bool in_mt_safe) { PipelineLayoutUniquePtr result_ptr(nullptr, std::default_delete() ); @@ -183,7 +183,7 @@ Anvil::PipelineLayoutUniquePtr Anvil::PipelineLayout::create(const Anvil::BaseDe if (result_ptr != nullptr) { - if (!result_ptr->bake(in_ds_info_items_ptr) ) + if (!result_ptr->bake(in_ds_create_info_items_ptr) ) { result_ptr.reset(); } diff --git a/src/wrappers/pipeline_layout_manager.cpp b/src/wrappers/pipeline_layout_manager.cpp index e898f7d1..c3995f0d 100644 --- a/src/wrappers/pipeline_layout_manager.cpp +++ b/src/wrappers/pipeline_layout_manager.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -67,13 +67,13 @@ Anvil::PipelineLayoutManagerUniquePtr Anvil::PipelineLayoutManager::create(const } /* Please see header for specification */ -bool Anvil::PipelineLayoutManager::get_layout(const std::vector* in_ds_info_items_ptr, - const PushConstantRanges& in_push_constant_ranges, - Anvil::PipelineLayoutUniquePtr* out_pipeline_layout_ptr_ptr) +bool Anvil::PipelineLayoutManager::get_layout(const std::vector* in_ds_create_info_items_ptr, + const PushConstantRanges& in_push_constant_ranges, + Anvil::PipelineLayoutUniquePtr* out_pipeline_layout_ptr_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); - const uint32_t n_descriptor_sets_in_in_dsg = static_cast(in_ds_info_items_ptr->size() ); + const uint32_t n_descriptor_sets_in_in_dsg = static_cast(in_ds_create_info_items_ptr->size() ); bool result = false; Anvil::PipelineLayout* result_pipeline_layout_ptr = nullptr; @@ -90,9 +90,9 @@ bool Anvil::PipelineLayoutManager::get_layout(const std::vectorpipeline_layout_ptr; - auto current_pipeline_ds_info_ptrs = current_pipeline_layout_ptr->get_ds_info_ptrs(); + auto current_pipeline_ds_create_info_ptrs = current_pipeline_layout_ptr->get_ds_create_info_ptrs(); bool dss_match = true; - const auto n_descriptor_sets_in_current_pipeline_dsg = static_cast(current_pipeline_ds_info_ptrs->size() ); + const auto n_descriptor_sets_in_current_pipeline_dsg = static_cast(current_pipeline_ds_create_info_ptrs->size() ); if (n_descriptor_sets_in_current_pipeline_dsg != n_descriptor_sets_in_in_dsg) { @@ -108,21 +108,21 @@ bool Anvil::PipelineLayoutManager::get_layout(const std::vectorat (n_ds); - const auto& current_pipeline_dsg_ds_info_ptr = current_pipeline_ds_info_ptrs->at(n_ds); + auto& in_dsg_ds_create_info_ptr = in_ds_create_info_items_ptr->at (n_ds); + const auto& current_pipeline_dsg_ds_create_info_ptr = current_pipeline_ds_create_info_ptrs->at(n_ds); - if ((in_dsg_ds_info_ptr != nullptr && current_pipeline_dsg_ds_info_ptr == nullptr) || - (in_dsg_ds_info_ptr == nullptr && current_pipeline_dsg_ds_info_ptr != nullptr) ) + if ((in_dsg_ds_create_info_ptr != nullptr && current_pipeline_dsg_ds_create_info_ptr == nullptr) || + (in_dsg_ds_create_info_ptr == nullptr && current_pipeline_dsg_ds_create_info_ptr != nullptr) ) { dss_match = false; break; } - if (in_dsg_ds_info_ptr != nullptr && - current_pipeline_dsg_ds_info_ptr != nullptr) + if (in_dsg_ds_create_info_ptr != nullptr && + current_pipeline_dsg_ds_create_info_ptr != nullptr) { - if (!(*in_dsg_ds_info_ptr == *current_pipeline_dsg_ds_info_ptr) ) + if (!(*in_dsg_ds_create_info_ptr == *current_pipeline_dsg_ds_create_info_ptr) ) { dss_match = false; @@ -147,7 +147,7 @@ bool Anvil::PipelineLayoutManager::get_layout(const std::vector( diff --git a/src/wrappers/query_pool.cpp b/src/wrappers/query_pool.cpp index eeeaa606..3e6fd8af 100644 --- a/src/wrappers/query_pool.cpp +++ b/src/wrappers/query_pool.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/wrappers/queue.cpp b/src/wrappers/queue.cpp index 1a48ebc3..6c207328 100644 --- a/src/wrappers/queue.cpp +++ b/src/wrappers/queue.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -21,8 +21,10 @@ // #include "misc/debug.h" +#include "misc/fence_create_info.h" #include "misc/object_tracker.h" #include "misc/struct_chainer.h" +#include "misc/swapchain_create_info.h" #include "misc/window.h" #include "wrappers/buffer.h" #include "wrappers/command_buffer.h" @@ -64,9 +66,14 @@ Anvil::Queue::Queue(const Anvil::BaseDevice* in_device_ptr, m_supports_sparse_bindings = !!(m_device_ptr->get_queue_family_info(in_queue_family_index)->flags & VK_QUEUE_SPARSE_BINDING_BIT); /* Cache a fence that may be optionally used for submissions */ - m_submit_fence_ptr = Anvil::Fence::create(m_device_ptr, - false /* create_signalled */, - Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); + { + auto create_info_ptr = Anvil::FenceCreateInfo::create(m_device_ptr, + false); /* create_signalled */ + + create_info_ptr->set_mt_safety(Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); + + m_submit_fence_ptr = Anvil::Fence::create(std::move(create_info_ptr) ); + } /* OK, register the wrapper instance and leave */ Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_QUEUE, @@ -81,7 +88,7 @@ Anvil::Queue::~Queue() } /** Please see header for specification */ -bool Anvil::Queue::bind_sparse_memory(Anvil::Utils::SparseMemoryBindingUpdateInfo& in_update) +bool Anvil::Queue::bind_sparse_memory(Anvil::SparseMemoryBindingUpdateInfo& in_update) { const VkBindSparseInfo* bind_info_items = nullptr; Anvil::Fence* fence_ptr = nullptr; @@ -221,8 +228,8 @@ bool Anvil::Queue::bind_sparse_memory(Anvil::Utils::SparseMemoryBindingUpdateInf return (result == VK_SUCCESS); } -void Anvil::Queue::bind_sparse_memory_lock_unlock(Anvil::Utils::SparseMemoryBindingUpdateInfo& in_update, - bool in_should_lock) +void Anvil::Queue::bind_sparse_memory_lock_unlock(Anvil::SparseMemoryBindingUpdateInfo& in_update, + bool in_should_lock) { const VkBindSparseInfo* bind_info_items = nullptr; Anvil::Fence* fence_ptr = nullptr; @@ -407,22 +414,21 @@ VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, Anvil::Semaphore* const* in_wait_semaphore_ptrs) { const Anvil::DeviceType device_type (m_device_ptr->get_type() ); - VkResult presentation_result; + VkResult presentation_results [MAX_SWAPCHAINS]; VkResult result; Anvil::StructChainer struct_chainer; const ExtensionKHRSwapchainEntrypoints* swapchain_entrypoints_ptr(nullptr); - VkSwapchainKHR swapchain_vk; + VkSwapchainKHR swapchains_vk [MAX_SWAPCHAINS]; std::vector wait_semaphores_vk (in_n_wait_semaphores); /* If the application is only interested in off-screen rendering, do *not* post the present request, * since the fake swapchain image is not presentable. We still have to wait on the user-specified * semaphores though. */ - if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU && - in_swapchain_ptr != nullptr) + if (in_swapchain_ptr != nullptr) { Anvil::Window* window_ptr = nullptr; - window_ptr = in_swapchain_ptr->get_window(); + window_ptr = in_swapchain_ptr->get_create_info_ptr()->get_window(); if (window_ptr != nullptr) { @@ -439,10 +445,15 @@ VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, &dst_stage_mask, true); /* should_block */ - OnPresentRequestIssuedCallbackArgument callback_argument(in_swapchain_ptr); + for (uint32_t n_presentation = 0; + n_presentation < 1; + ++n_presentation) + { + OnPresentRequestIssuedCallbackArgument callback_argument(in_swapchain_ptr); - CallbacksSupportProvider::callback(QUEUE_CALLBACK_ID_PRESENT_REQUEST_ISSUED, - &callback_argument); + CallbacksSupportProvider::callback(QUEUE_CALLBACK_ID_PRESENT_REQUEST_ISSUED, + &callback_argument); + } result = VK_SUCCESS; goto end; @@ -451,7 +462,12 @@ VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, } /* Convert arrays of Anvil objects to raw Vulkan handle arrays */ - swapchain_vk = in_swapchain_ptr->get_swapchain_vk(); + for (uint32_t n_swapchain = 0; + n_swapchain < 1; + ++n_swapchain) + { + swapchains_vk[n_swapchain] = in_swapchain_ptr->get_swapchain_vk(); + } for (uint32_t n_wait_semaphore = 0; n_wait_semaphore < in_n_wait_semaphores; @@ -465,8 +481,8 @@ VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, image_presentation_info.pImageIndices = &in_swapchain_image_index; image_presentation_info.pNext = nullptr; - image_presentation_info.pResults = &presentation_result; - image_presentation_info.pSwapchains = &swapchain_vk; + image_presentation_info.pResults = presentation_results; + image_presentation_info.pSwapchains = swapchains_vk; image_presentation_info.pWaitSemaphores = (in_n_wait_semaphores != 0) ? &wait_semaphores_vk.at(0) : nullptr; image_presentation_info.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR; image_presentation_info.swapchainCount = 1; @@ -477,7 +493,7 @@ VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, swapchain_entrypoints_ptr = &m_device_ptr->get_extension_khr_swapchain_entrypoints(); - present_lock_unlock(1, /* in_n_swapchains */ + present_lock_unlock(1, &in_swapchain_ptr, in_n_wait_semaphores, in_wait_semaphore_ptrs, @@ -488,7 +504,7 @@ VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, result = swapchain_entrypoints_ptr->vkQueuePresentKHR(m_queue, chain_ptr->get_root_struct() ); } - present_lock_unlock(1, /* in_n_swapchains */ + present_lock_unlock(1, &in_swapchain_ptr, in_n_wait_semaphores, in_wait_semaphore_ptrs, @@ -498,56 +514,61 @@ VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, if (is_vk_call_successful(result) ) { - anvil_assert(is_vk_call_successful(presentation_result)); - - /* Return the most important error code reported */ - if (result != VK_ERROR_DEVICE_LOST) + for (uint32_t n_presentation = 0; + n_presentation < 1; + ++n_presentation) { - switch (presentation_result) + anvil_assert(is_vk_call_successful(presentation_results[n_presentation])); + + /* Return the most important error code reported */ + if (result != VK_ERROR_DEVICE_LOST) { - case VK_ERROR_DEVICE_LOST: + switch (presentation_results[n_presentation]) { - result = VK_ERROR_DEVICE_LOST; + case VK_ERROR_DEVICE_LOST: + { + result = VK_ERROR_DEVICE_LOST; - break; - } + break; + } - case VK_ERROR_SURFACE_LOST_KHR: - { - if (result != VK_ERROR_DEVICE_LOST) + case VK_ERROR_SURFACE_LOST_KHR: { - result = VK_ERROR_SURFACE_LOST_KHR; - } + if (result != VK_ERROR_DEVICE_LOST) + { + result = VK_ERROR_SURFACE_LOST_KHR; + } - break; - } + break; + } - case VK_ERROR_OUT_OF_DATE_KHR: - { - if (result != VK_ERROR_DEVICE_LOST && - result != VK_ERROR_SURFACE_LOST_KHR) + case VK_ERROR_OUT_OF_DATE_KHR: { - result = VK_ERROR_OUT_OF_DATE_KHR; - } + if (result != VK_ERROR_DEVICE_LOST && + result != VK_ERROR_SURFACE_LOST_KHR) + { + result = VK_ERROR_OUT_OF_DATE_KHR; + } - break; - } + break; + } - case VK_SUBOPTIMAL_KHR: - { - if (result != VK_ERROR_DEVICE_LOST && - result != VK_ERROR_SURFACE_LOST_KHR && - result != VK_ERROR_OUT_OF_DATE_KHR) + case VK_SUBOPTIMAL_KHR: { - result = VK_SUBOPTIMAL_KHR; + if (result != VK_ERROR_DEVICE_LOST && + result != VK_ERROR_SURFACE_LOST_KHR && + result != VK_ERROR_OUT_OF_DATE_KHR) + { + result = VK_SUBOPTIMAL_KHR; + } + + break; } - break; - } - - default: - { - anvil_assert(presentation_result == VK_SUCCESS); + default: + { + anvil_assert(presentation_results[n_presentation] == VK_SUCCESS); + } } } diff --git a/src/wrappers/render_pass.cpp b/src/wrappers/render_pass.cpp index 9bccb763..a748e2d0 100644 --- a/src/wrappers/render_pass.cpp +++ b/src/wrappers/render_pass.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -21,9 +21,8 @@ // #include "misc/debug.h" -#include "misc/graphics_pipeline_info.h" #include "misc/object_tracker.h" -#include "misc/render_pass_info.h" +#include "misc/render_pass_create_info.h" #include "wrappers/device.h" #include "wrappers/graphics_pipeline_manager.h" #include "wrappers/pipeline_layout.h" @@ -32,13 +31,13 @@ /** Contsructor. Initializes the Renderpass instance with default values. */ -Anvil::RenderPass::RenderPass(Anvil::RenderPassInfoUniquePtr in_renderpass_info_ptr, - Anvil::Swapchain* in_opt_swapchain_ptr) - :DebugMarkerSupportProvider(in_renderpass_info_ptr->get_device(), - VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT), - m_render_pass (VK_NULL_HANDLE), - m_render_pass_info_ptr (std::move(in_renderpass_info_ptr) ), - m_swapchain_ptr (in_opt_swapchain_ptr) +Anvil::RenderPass::RenderPass(Anvil::RenderPassCreateInfoUniquePtr in_renderpass_create_info_ptr, + Anvil::Swapchain* in_opt_swapchain_ptr) + :DebugMarkerSupportProvider (in_renderpass_create_info_ptr->get_device(), + VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT), + m_render_pass (VK_NULL_HANDLE), + m_render_pass_create_info_ptr(std::move(in_renderpass_create_info_ptr) ), + m_swapchain_ptr (in_opt_swapchain_ptr) { /* Register the object */ Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_RENDER_PASS, @@ -54,7 +53,7 @@ Anvil::RenderPass::~RenderPass() if (m_render_pass != VK_NULL_HANDLE) { - vkDestroyRenderPass(m_render_pass_info_ptr->get_device()->get_device_vk(), + vkDestroyRenderPass(m_render_pass_create_info_ptr->get_device()->get_device_vk(), m_render_pass, nullptr /* pAllocator */); @@ -69,7 +68,7 @@ bool Anvil::RenderPass::init() { std::vector renderpass_attachments_vk; VkRenderPassCreateInfo render_pass_create_info; - bool result (false); + bool result (false); VkResult result_vk; std::vector subpass_dependencies_vk; std::vector subpass_descriptions_vk; @@ -136,11 +135,11 @@ bool Anvil::RenderPass::init() anvil_assert(m_render_pass == VK_NULL_HANDLE); /* Set up helper descriptor storage space */ - subpass_dependencies_vk.reserve(m_render_pass_info_ptr->m_subpass_dependencies.size() ); - subpass_descriptions_vk.reserve(m_render_pass_info_ptr->m_subpasses.size() ); + subpass_dependencies_vk.reserve(m_render_pass_create_info_ptr->m_subpass_dependencies.size() ); + subpass_descriptions_vk.reserve(m_render_pass_create_info_ptr->m_subpasses.size() ); - for (auto renderpass_attachment_iterator = m_render_pass_info_ptr->m_attachments.cbegin(); - renderpass_attachment_iterator != m_render_pass_info_ptr->m_attachments.cend(); + for (auto renderpass_attachment_iterator = m_render_pass_create_info_ptr->m_attachments.cbegin(); + renderpass_attachment_iterator != m_render_pass_create_info_ptr->m_attachments.cend(); ++renderpass_attachment_iterator) { VkAttachmentDescription attachment_vk; @@ -159,8 +158,8 @@ bool Anvil::RenderPass::init() renderpass_attachments_vk.push_back(attachment_vk); } - for (auto subpass_dependency_iterator = m_render_pass_info_ptr->m_subpass_dependencies.cbegin(); - subpass_dependency_iterator != m_render_pass_info_ptr->m_subpass_dependencies.cend(); + for (auto subpass_dependency_iterator = m_render_pass_create_info_ptr->m_subpass_dependencies.cbegin(); + subpass_dependency_iterator != m_render_pass_create_info_ptr->m_subpass_dependencies.cend(); ++subpass_dependency_iterator) { VkSubpassDependency dependency_vk; @@ -179,14 +178,15 @@ bool Anvil::RenderPass::init() } /* We now have all the data needed to create Vulkan subpass instances. */ - for (auto subpass_iterator = m_render_pass_info_ptr->m_subpasses.cbegin(); - subpass_iterator != m_render_pass_info_ptr->m_subpasses.cend(); + for (auto subpass_iterator = m_render_pass_create_info_ptr->m_subpasses.cbegin(); + subpass_iterator != m_render_pass_create_info_ptr->m_subpasses.cend(); ++subpass_iterator) { std::unique_ptr current_subpass_attachment_set_ptr; uint32_t highest_subpass_color_attachment_location = UINT32_MAX; uint32_t highest_subpass_input_attachment_index = UINT32_MAX; bool need_color_resolve_attachments = false; + const uint32_t subpass_index = static_cast(subpass_iterator - m_render_pass_create_info_ptr->m_subpasses.begin() ); VkSubpassDescription subpass_vk; VkAttachmentReference unused_reference; @@ -261,21 +261,21 @@ bool Anvil::RenderPass::init() subpass_color_attachment_iterator != (*subpass_iterator)->color_attachments_map.cend(); ++subpass_color_attachment_iterator) { - current_subpass_attachment_set_ptr->color_attachments_vk[subpass_color_attachment_iterator->first] = m_render_pass_info_ptr->get_attachment_reference_from_subpass_attachment(subpass_color_attachment_iterator->second); + current_subpass_attachment_set_ptr->color_attachments_vk[subpass_color_attachment_iterator->first] = m_render_pass_create_info_ptr->get_attachment_reference_from_subpass_attachment(subpass_color_attachment_iterator->second); if (need_color_resolve_attachments) { if (subpass_color_attachment_iterator->second.resolve_attachment_index != UINT32_MAX) { - current_subpass_attachment_set_ptr->resolve_color_attachments_vk[subpass_color_attachment_iterator->first] = m_render_pass_info_ptr->get_attachment_reference_for_resolve_attachment(subpass_iterator, - subpass_color_attachment_iterator); + current_subpass_attachment_set_ptr->resolve_color_attachments_vk[subpass_color_attachment_iterator->first] = m_render_pass_create_info_ptr->get_attachment_reference_for_resolve_attachment(subpass_iterator, + subpass_color_attachment_iterator); } } } if ((*subpass_iterator)->depth_stencil_attachment.attachment_index != UINT32_MAX) { - current_subpass_attachment_set_ptr->depth_attachment_vk = m_render_pass_info_ptr->get_attachment_reference_from_subpass_attachment((*subpass_iterator)->depth_stencil_attachment); + current_subpass_attachment_set_ptr->depth_attachment_vk = m_render_pass_create_info_ptr->get_attachment_reference_from_subpass_attachment((*subpass_iterator)->depth_stencil_attachment); } else { @@ -286,7 +286,7 @@ bool Anvil::RenderPass::init() subpass_input_attachment_iterator != (*subpass_iterator)->input_attachments_map.cend(); ++subpass_input_attachment_iterator) { - current_subpass_attachment_set_ptr->input_attachments_vk[subpass_input_attachment_iterator->first] = m_render_pass_info_ptr->get_attachment_reference_from_subpass_attachment(subpass_input_attachment_iterator->second); + current_subpass_attachment_set_ptr->input_attachments_vk[subpass_input_attachment_iterator->first] = m_render_pass_create_info_ptr->get_attachment_reference_from_subpass_attachment(subpass_input_attachment_iterator->second); } /* Fill the preserved attachments vector. These do not use indices or locations, so the process is much simpler */ @@ -295,7 +295,7 @@ bool Anvil::RenderPass::init() ++subpass_preserve_attachment_iterator) { current_subpass_attachment_set_ptr->preserve_attachments_vk.push_back( - m_render_pass_info_ptr->m_attachments.at(subpass_preserve_attachment_iterator->attachment_index).index + m_render_pass_create_info_ptr->m_attachments.at(subpass_preserve_attachment_iterator->attachment_index).index ); } @@ -332,9 +332,9 @@ bool Anvil::RenderPass::init() } /* Set up a create info descriptor and spawn a new Vulkan RenderPass object. */ - render_pass_create_info.attachmentCount = static_cast(m_render_pass_info_ptr->m_attachments.size () ); - render_pass_create_info.dependencyCount = static_cast(m_render_pass_info_ptr->m_subpass_dependencies.size() ); - render_pass_create_info.subpassCount = static_cast(m_render_pass_info_ptr->m_subpasses.size () ); + render_pass_create_info.attachmentCount = static_cast(m_render_pass_create_info_ptr->m_attachments.size () ); + render_pass_create_info.dependencyCount = static_cast(m_render_pass_create_info_ptr->m_subpass_dependencies.size() ); + render_pass_create_info.subpassCount = static_cast(m_render_pass_create_info_ptr->m_subpasses.size () ); render_pass_create_info.flags = 0; render_pass_create_info.pAttachments = (render_pass_create_info.attachmentCount > 0) ? &renderpass_attachments_vk.at(0) : nullptr; @@ -366,14 +366,14 @@ bool Anvil::RenderPass::init() } /* Please see header for specification */ -Anvil::RenderPassUniquePtr Anvil::RenderPass::create(Anvil::RenderPassInfoUniquePtr in_renderpass_info_ptr, - Anvil::Swapchain* in_opt_swapchain_ptr) +Anvil::RenderPassUniquePtr Anvil::RenderPass::create(Anvil::RenderPassCreateInfoUniquePtr in_renderpass_create_info_ptr, + Anvil::Swapchain* in_opt_swapchain_ptr) { std::unique_ptr result_ptr(nullptr, std::default_delete() ); result_ptr.reset( - new Anvil::RenderPass(std::move(in_renderpass_info_ptr), + new Anvil::RenderPass(std::move(in_renderpass_create_info_ptr), in_opt_swapchain_ptr) ); diff --git a/src/wrappers/rendering_surface.cpp b/src/wrappers/rendering_surface.cpp index 28e99078..c60a97c5 100644 --- a/src/wrappers/rendering_surface.cpp +++ b/src/wrappers/rendering_surface.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -107,7 +107,7 @@ void Anvil::RenderingSurface::cache_surface_properties() switch (device_type) { - case Anvil::DEVICE_TYPE_SINGLE_GPU: n_physical_devices = 1;break; + case Anvil::DEVICE_TYPE_SINGLE_GPU: n_physical_devices = 1; break; default: { @@ -138,7 +138,7 @@ void Anvil::RenderingSurface::cache_surface_properties() } } - auto& result_caps = m_physical_device_capabilities; + auto& result_caps = m_physical_device_capabilities[0]; if (m_surface == VK_NULL_HANDLE) { @@ -252,45 +252,81 @@ Anvil::RenderingSurfaceUniquePtr Anvil::RenderingSurface::create(Anvil::Instance /* Please see header for specification */ bool Anvil::RenderingSurface::get_capabilities(VkSurfaceCapabilitiesKHR* out_surface_caps_ptr) const { - *out_surface_caps_ptr = m_physical_device_capabilities.capabilities; + auto caps_iterator = m_physical_device_capabilities.find(0); + bool result = false; - return true; + if (caps_iterator != m_physical_device_capabilities.end() ) + { + *out_surface_caps_ptr = caps_iterator->second.capabilities; + result = true; + } + + /* All done */ + return result; } /* Please see header for specification */ bool Anvil::RenderingSurface::get_queue_families_with_present_support(const std::vector** out_result_ptr) const { - *out_result_ptr = &m_physical_device_capabilities.present_capable_queue_fams; + auto caps_iterator = m_physical_device_capabilities.find(0); + bool result = false; + + if (caps_iterator != m_physical_device_capabilities.end() ) + { + *out_result_ptr = &caps_iterator->second.present_capable_queue_fams; + result = true; + } /* All done */ - return true; + return result; } /* Please see header for specification */ bool Anvil::RenderingSurface::get_supported_composite_alpha_flags(VkCompositeAlphaFlagsKHR* out_result_ptr) const { - *out_result_ptr = m_physical_device_capabilities.supported_composite_alpha_flags; + auto caps_iterator = m_physical_device_capabilities.find(0); + bool result = false; + + if (caps_iterator != m_physical_device_capabilities.end() ) + { + *out_result_ptr = caps_iterator->second.supported_composite_alpha_flags; + result = true; + } /* All done */ - return true; + return result; } /* Please see header for specification */ bool Anvil::RenderingSurface::get_supported_transformations(VkSurfaceTransformFlagsKHR* out_result_ptr) const { - *out_result_ptr = m_physical_device_capabilities.supported_transformations; + auto caps_iterator = m_physical_device_capabilities.find(0); + bool result = false; + + if (caps_iterator != m_physical_device_capabilities.end() ) + { + *out_result_ptr = caps_iterator->second.supported_transformations; + result = true; + } /* All done */ - return true; + return result; } /* Please see header for specification */ bool Anvil::RenderingSurface::get_supported_usages(VkImageUsageFlags* out_result_ptr) const { - *out_result_ptr = m_physical_device_capabilities.supported_usages; + auto caps_iterator = m_physical_device_capabilities.find(0); + bool result = false; + + if (caps_iterator != m_physical_device_capabilities.end() ) + { + *out_result_ptr = caps_iterator->second.supported_usages; + result = true; + } /* All done */ - return true; + return result; } /* Please see header for specification */ @@ -358,6 +394,7 @@ bool Anvil::RenderingSurface::init() &m_surface); } #endif + anvil_assert_vk_call_succeeded(result); if (is_vk_call_successful(result) ) { @@ -389,7 +426,7 @@ bool Anvil::RenderingSurface::init() const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr) ); physical_device_ptr = sgpu_device_ptr->get_physical_device(); - physical_device_caps_ptr = &m_physical_device_capabilities; + physical_device_caps_ptr = &m_physical_device_capabilities[0]; break; } @@ -438,7 +475,7 @@ bool Anvil::RenderingSurface::init() if (sgpu_device_ptr->get_n_universal_queues() > 0) { - auto& result_caps = m_physical_device_capabilities; + auto& result_caps = m_physical_device_capabilities[0]; result_caps.present_capable_queue_fams.push_back(sgpu_device_ptr->get_universal_queue(0)->get_queue_family_index() ); } @@ -480,20 +517,34 @@ bool Anvil::RenderingSurface::init() bool Anvil::RenderingSurface::is_compatible_with_image_format(VkFormat in_image_format, bool* out_result_ptr) const { - *out_result_ptr = std::find(m_physical_device_capabilities.supported_formats.begin(), - m_physical_device_capabilities.supported_formats.end(), - in_image_format) != m_physical_device_capabilities.supported_formats.end(); + auto caps_iterator = m_physical_device_capabilities.find(0); + bool result = false; - return true; + if (caps_iterator != m_physical_device_capabilities.end() ) + { + *out_result_ptr = std::find(caps_iterator->second.supported_formats.begin(), + caps_iterator->second.supported_formats.end(), + in_image_format) != caps_iterator->second.supported_formats.end(); + result = true; + } + + return result; } /* Please see header for specification */ bool Anvil::RenderingSurface::supports_presentation_mode(VkPresentModeKHR in_presentation_mode, bool* out_result_ptr) const { - *out_result_ptr = std::find(m_physical_device_capabilities.supported_presentation_modes.begin(), - m_physical_device_capabilities.supported_presentation_modes.end(), - in_presentation_mode) != m_physical_device_capabilities.supported_presentation_modes.end(); + auto caps_iterator = m_physical_device_capabilities.find(0); + bool result = false; + + if (caps_iterator != m_physical_device_capabilities.end() ) + { + *out_result_ptr = std::find(caps_iterator->second.supported_presentation_modes.begin(), + caps_iterator->second.supported_presentation_modes.end(), + in_presentation_mode) != caps_iterator->second.supported_presentation_modes.end(); + result = true; + } - return true; + return result; } \ No newline at end of file diff --git a/src/wrappers/sampler.cpp b/src/wrappers/sampler.cpp index 9bbaaeb3..9ab2e2a3 100644 --- a/src/wrappers/sampler.cpp +++ b/src/wrappers/sampler.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -22,97 +22,24 @@ #include "misc/debug.h" #include "misc/object_tracker.h" +#include "misc/sampler_create_info.h" #include "misc/struct_chainer.h" #include "wrappers/device.h" #include "wrappers/physical_device.h" #include "wrappers/sampler.h" /** Please see header for specification */ -Anvil::Sampler::Sampler(const Anvil::BaseDevice* in_device_ptr, - VkFilter in_mag_filter, - VkFilter in_min_filter, - VkSamplerMipmapMode in_mipmap_mode, - VkSamplerAddressMode in_address_mode_u, - VkSamplerAddressMode in_address_mode_v, - VkSamplerAddressMode in_address_mode_w, - float in_lod_bias, - float in_max_anisotropy, - bool in_compare_enable, - VkCompareOp in_compare_op, - float in_min_lod, - float in_max_lod, - VkBorderColor in_border_color, - bool in_use_unnormalized_coordinates, - bool in_mt_safe) - :DebugMarkerSupportProvider (in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT), - MTSafetySupportProvider (in_mt_safe), - m_address_mode_u (in_address_mode_u), - m_address_mode_v (in_address_mode_v), - m_address_mode_w (in_address_mode_w), - m_border_color (in_border_color), - m_compare_enable (in_compare_enable), - m_compare_op (in_compare_op), - m_device_ptr (in_device_ptr), - m_lod_bias (in_lod_bias), - m_mag_filter (in_mag_filter), - m_max_anisotropy (in_max_anisotropy), - m_max_lod (in_max_lod), - m_min_filter (in_min_filter), - m_min_lod (in_min_lod), - m_mipmap_mode (in_mipmap_mode), - m_sampler (VK_NULL_HANDLE), - m_use_unnormalized_coordinates(in_use_unnormalized_coordinates) +Anvil::Sampler::Sampler(Anvil::SamplerCreateInfoUniquePtr in_create_info_ptr) + :DebugMarkerSupportProvider(in_create_info_ptr->get_device(), + VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT), + MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), + in_create_info_ptr->get_device () )) { - VkResult result (VK_ERROR_INITIALIZATION_FAILED); - Anvil::StructChainer struct_chainer; - - ANVIL_REDUNDANT_VARIABLE(result); - - /* Spawn a new sampler */ - { - VkSamplerCreateInfo sampler_create_info; - - sampler_create_info.addressModeU = in_address_mode_u; - sampler_create_info.addressModeV = in_address_mode_v; - sampler_create_info.addressModeW = in_address_mode_w; - sampler_create_info.anisotropyEnable = static_cast((in_max_anisotropy > 1.0f) ? VK_TRUE : VK_FALSE); - sampler_create_info.borderColor = in_border_color; - sampler_create_info.compareEnable = static_cast(in_compare_enable ? VK_TRUE : VK_FALSE); - sampler_create_info.compareOp = in_compare_op; - sampler_create_info.flags = 0; - sampler_create_info.magFilter = in_mag_filter; - sampler_create_info.maxAnisotropy = in_max_anisotropy; - sampler_create_info.maxLod = in_max_lod; - sampler_create_info.minFilter = in_min_filter; - sampler_create_info.minLod = in_min_lod; - sampler_create_info.mipLodBias = in_lod_bias; - sampler_create_info.mipmapMode = in_mipmap_mode; - sampler_create_info.pNext = nullptr; - sampler_create_info.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO; - sampler_create_info.unnormalizedCoordinates = static_cast(in_use_unnormalized_coordinates ? VK_TRUE : VK_FALSE); - - struct_chainer.append_struct(sampler_create_info); - } - - { - auto chain_ptr = struct_chainer.create_chain(); - - result = vkCreateSampler(m_device_ptr->get_device_vk(), - chain_ptr->get_root_struct(), - nullptr, /* pAllocator */ - &m_sampler); - } - - anvil_assert_vk_call_succeeded(result); - if (is_vk_call_successful(result) ) - { - set_vk_handle(m_sampler); - } + m_create_info_ptr = std::move(in_create_info_ptr); /* Register the event instance */ Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_SAMPLER, - this); + this); } /* Please see header for specification */ @@ -136,46 +63,75 @@ Anvil::Sampler::~Sampler() } /* Please see header for specification */ -Anvil::SamplerUniquePtr Anvil::Sampler::create(const Anvil::BaseDevice* in_device_ptr, - VkFilter in_mag_filter, - VkFilter in_min_filter, - VkSamplerMipmapMode in_mipmap_mode, - VkSamplerAddressMode in_address_mode_u, - VkSamplerAddressMode in_address_mode_v, - VkSamplerAddressMode in_address_mode_w, - float in_lod_bias, - float in_max_anisotropy, - bool in_compare_enable, - VkCompareOp in_compare_op, - float in_min_lod, - float in_max_lod, - VkBorderColor in_border_color, - bool in_use_unnormalized_coordinates, - MTSafety in_mt_safety) +Anvil::SamplerUniquePtr Anvil::Sampler::create(Anvil::SamplerCreateInfoUniquePtr in_create_info_ptr) { - const bool mt_safe (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ); SamplerUniquePtr result_ptr(nullptr, std::default_delete() ); result_ptr.reset( - new Anvil::Sampler(in_device_ptr, - in_mag_filter, - in_min_filter, - in_mipmap_mode, - in_address_mode_u, - in_address_mode_v, - in_address_mode_w, - in_lod_bias, - in_max_anisotropy, - in_compare_enable, - in_compare_op, - in_min_lod, - in_max_lod, - in_border_color, - in_use_unnormalized_coordinates, - mt_safe) + new Anvil::Sampler(std::move(in_create_info_ptr) ) ); + if (result_ptr != nullptr) + { + if (!result_ptr->init() ) + { + result_ptr.reset(); + } + } + return result_ptr; +} + +bool Anvil::Sampler::init() +{ + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + Anvil::StructChainer struct_chainer; + + ANVIL_REDUNDANT_VARIABLE(result); + + /* Spawn a new sampler */ + { + const auto max_anisotropy = m_create_info_ptr->get_max_anisotropy(); + VkSamplerCreateInfo sampler_create_info; + + sampler_create_info.addressModeU = m_create_info_ptr->get_address_mode_u(); + sampler_create_info.addressModeV = m_create_info_ptr->get_address_mode_v(); + sampler_create_info.addressModeW = m_create_info_ptr->get_address_mode_w(); + sampler_create_info.anisotropyEnable = (max_anisotropy > 1.0f) ? VK_TRUE : VK_FALSE; + sampler_create_info.borderColor = m_create_info_ptr->get_border_color(); + sampler_create_info.compareEnable = m_create_info_ptr->is_compare_enabled() ? VK_TRUE : VK_FALSE; + sampler_create_info.compareOp = m_create_info_ptr->get_compare_op(); + sampler_create_info.flags = 0; + sampler_create_info.magFilter = m_create_info_ptr->get_mag_filter(); + sampler_create_info.maxAnisotropy = max_anisotropy; + sampler_create_info.maxLod = m_create_info_ptr->get_max_lod(); + sampler_create_info.minFilter = m_create_info_ptr->get_min_filter(); + sampler_create_info.minLod = m_create_info_ptr->get_min_lod(); + sampler_create_info.mipLodBias = m_create_info_ptr->get_lod_bias(); + sampler_create_info.mipmapMode = m_create_info_ptr->get_mipmap_mode(); + sampler_create_info.pNext = nullptr; + sampler_create_info.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO; + sampler_create_info.unnormalizedCoordinates = m_create_info_ptr->uses_unnormalized_coordinates() ? VK_TRUE : VK_FALSE; + + struct_chainer.append_struct(sampler_create_info); + } + + { + auto chain_ptr = struct_chainer.create_chain(); + + result = vkCreateSampler(m_device_ptr->get_device_vk(), + chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_sampler); + } + + anvil_assert_vk_call_succeeded(result); + if (is_vk_call_successful(result) ) + { + set_vk_handle(m_sampler); + } + + /* All done */ + return is_vk_call_successful(result); } \ No newline at end of file diff --git a/src/wrappers/semaphore.cpp b/src/wrappers/semaphore.cpp index ceaf4c53..ef2fe93f 100644 --- a/src/wrappers/semaphore.cpp +++ b/src/wrappers/semaphore.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -22,19 +22,19 @@ #include "misc/debug.h" #include "misc/object_tracker.h" +#include "misc/semaphore_create_info.h" #include "wrappers/device.h" #include "wrappers/semaphore.h" /* Please see header for specification */ -Anvil::Semaphore::Semaphore(const Anvil::BaseDevice* in_device_ptr, - bool in_mt_safe) - :DebugMarkerSupportProvider(in_device_ptr, +Anvil::Semaphore::Semaphore(Anvil::SemaphoreCreateInfoUniquePtr in_create_info_ptr) + :DebugMarkerSupportProvider(in_create_info_ptr->get_device(), VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT), - MTSafetySupportProvider (in_mt_safe), - m_device_ptr (in_device_ptr), + MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), + in_create_info_ptr->get_device () )), m_semaphore (VK_NULL_HANDLE) { - reset(); + m_create_info_ptr = std::move(in_create_info_ptr); Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_SEMAPHORE, this); @@ -50,19 +50,23 @@ Anvil::Semaphore::~Semaphore() } /** Please see header for specification */ -Anvil::SemaphoreUniquePtr Anvil::Semaphore::create(const Anvil::BaseDevice* in_device_ptr, - MTSafety in_mt_safety) +Anvil::SemaphoreUniquePtr Anvil::Semaphore::create(Anvil::SemaphoreCreateInfoUniquePtr in_create_info_ptr) { - const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); SemaphoreUniquePtr result_ptr(nullptr, std::default_delete() ); result_ptr.reset( - new Anvil::Semaphore(in_device_ptr, - mt_safe) + new Anvil::Semaphore(std::move(in_create_info_ptr) ) ); + if (result_ptr != nullptr) + { + if (!result_ptr->reset() ) + { + result_ptr.reset(); + } + } + return result_ptr; } @@ -85,10 +89,10 @@ void Anvil::Semaphore::release_semaphore() } /* Please see header for specification */ -void Anvil::Semaphore::reset() +bool Anvil::Semaphore::reset() { - VkResult result (VK_ERROR_INITIALIZATION_FAILED); - VkSemaphoreCreateInfo semaphore_create_info; + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + VkSemaphoreCreateInfo semaphore_create_info; ANVIL_REDUNDANT_VARIABLE(result); @@ -109,4 +113,6 @@ void Anvil::Semaphore::reset() { set_vk_handle(m_semaphore); } + + return is_vk_call_successful(result); } \ No newline at end of file diff --git a/src/wrappers/shader_module.cpp b/src/wrappers/shader_module.cpp index 0009e748..aebd0c1c 100644 --- a/src/wrappers/shader_module.cpp +++ b/src/wrappers/shader_module.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/wrappers/swapchain.cpp b/src/wrappers/swapchain.cpp index 6753cef5..8422afc0 100644 --- a/src/wrappers/swapchain.cpp +++ b/src/wrappers/swapchain.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -22,8 +22,12 @@ #include "misc/debug.h" #include "misc/dummy_window.h" +#include "misc/fence_create_info.h" +#include "misc/image_create_info.h" +#include "misc/image_view_create_info.h" #include "misc/object_tracker.h" #include "misc/struct_chainer.h" +#include "misc/swapchain_create_info.h" #include "misc/window.h" #include "wrappers/command_buffer.h" #include "wrappers/command_pool.h" @@ -32,47 +36,33 @@ #include "wrappers/swapchain.h" /** Please see header for specification */ -Anvil::Swapchain::Swapchain(const Anvil::BaseDevice* in_device_ptr, - Anvil::RenderingSurface* in_parent_surface_ptr, - Anvil::Window* in_window_ptr, - VkFormat in_format, - VkPresentModeKHR in_present_mode, - VkImageUsageFlags in_usage_flags, - VkSwapchainCreateFlagsKHR in_flags, - uint32_t in_n_images, - const ExtensionKHRSwapchainEntrypoints& in_khr_swapchain_entrypoints, - bool in_mt_safe) - :DebugMarkerSupportProvider (in_device_ptr, +Anvil::Swapchain::Swapchain(Anvil::SwapchainCreateInfoUniquePtr in_create_info_ptr) + :DebugMarkerSupportProvider (in_create_info_ptr->get_device(), VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT), - MTSafetySupportProvider (in_mt_safe), + MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), + in_create_info_ptr->get_device () )), m_destroy_swapchain_before_parent_window_closes(true), - m_device_ptr (in_device_ptr), - m_flags (in_flags), - m_image_format (in_format), m_last_acquired_image_index (UINT32_MAX), m_n_acquire_counter (0), m_n_acquire_counter_rounded (0), m_n_present_counter (0), - m_n_swapchain_images (in_n_images), - m_parent_surface_ptr (in_parent_surface_ptr), - m_present_mode (in_present_mode), - m_swapchain (0), - m_window_ptr (in_window_ptr), - m_usage_flags (static_cast(in_usage_flags) ), - m_khr_swapchain_entrypoints (in_khr_swapchain_entrypoints) + m_swapchain (VK_NULL_HANDLE) { - anvil_assert(in_n_images > 0); - anvil_assert(in_parent_surface_ptr != nullptr); - anvil_assert(in_usage_flags != 0); + const auto n_images = in_create_info_ptr->get_n_images(); - m_image_ptrs.resize (in_n_images); - m_image_view_ptrs.resize(in_n_images); + m_image_ptrs.resize (n_images); + m_image_view_ptrs.resize(n_images); - m_image_available_fence_ptr = Anvil::Fence::create(m_device_ptr, - false, /* create_signalled */ - Anvil::Utils::convert_boolean_to_mt_safety_enum(in_mt_safe) ); + { + auto create_info_ptr = Anvil::FenceCreateInfo::create(m_device_ptr, + false); /* create_signalled */ + + create_info_ptr->set_mt_safety(in_create_info_ptr->get_mt_safety() ); + + m_image_available_fence_ptr = Anvil::Fence::create(std::move(create_info_ptr) ); + } - init(); + m_create_info_ptr = std::move(in_create_info_ptr); Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_SWAPCHAIN, this); @@ -86,11 +76,6 @@ Anvil::Swapchain::~Swapchain() destroy_swapchain(); - if (m_parent_surface_ptr != nullptr) - { - m_parent_surface_ptr = nullptr; - } - m_image_ptrs.clear (); m_image_available_fence_ptr.reset(); m_image_view_ptrs.clear (); @@ -106,7 +91,7 @@ Anvil::Swapchain::~Swapchain() ); } - m_window_ptr->unregister_from_callbacks( + m_create_info_ptr->get_window()->unregister_from_callbacks( WINDOW_CALLBACK_ID_ABOUT_TO_CLOSE, std::bind(&Swapchain::on_parent_window_about_to_close, this), @@ -118,13 +103,15 @@ Anvil::Swapchain::~Swapchain() uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, bool in_should_block) { - uint32_t result (UINT32_MAX); - VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); - const WindowPlatform window_platform (m_window_ptr->get_platform()); - const bool is_offscreen_rendering_enabled((window_platform == WINDOW_PLATFORM_DUMMY || - window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS) ); + const Anvil::PhysicalDevice* physical_device_ptr (nullptr); + uint32_t result (UINT32_MAX); + VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); + const Anvil::SGPUDevice* sgpu_device_ptr (dynamic_cast(m_device_ptr) ); + const WindowPlatform window_platform (m_create_info_ptr->get_window()->get_platform() ); + const bool is_offscreen_rendering_enabled( (window_platform == WINDOW_PLATFORM_DUMMY || + window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS) ); - ANVIL_REDUNDANT_VARIABLE(result_vk); + physical_device_ptr = sgpu_device_ptr->get_physical_device(); if (!is_offscreen_rendering_enabled) { @@ -138,6 +125,8 @@ uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, m_image_available_fence_ptr->lock(); lock(); { + const auto& khr_swapchain_entrypoints = m_device_ptr->get_extension_khr_swapchain_entrypoints(); + if (in_should_block) { m_image_available_fence_ptr->reset(); @@ -145,12 +134,12 @@ uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, fence_handle = m_image_available_fence_ptr->get_fence(); } - result_vk = m_khr_swapchain_entrypoints.vkAcquireNextImageKHR(m_device_ptr->get_device_vk(), - m_swapchain, - UINT64_MAX, - (in_opt_semaphore_ptr != nullptr) ? in_opt_semaphore_ptr->get_semaphore() : VK_NULL_HANDLE, - fence_handle, - &result); + result_vk = khr_swapchain_entrypoints.vkAcquireNextImageKHR(m_device_ptr->get_device_vk(), + m_swapchain, + UINT64_MAX, + (in_opt_semaphore_ptr != nullptr) ? in_opt_semaphore_ptr->get_semaphore() : VK_NULL_HANDLE, + fence_handle, + &result); if (fence_handle != VK_NULL_HANDLE) { @@ -193,7 +182,7 @@ uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, } m_n_acquire_counter++; - m_n_acquire_counter_rounded = (m_n_acquire_counter_rounded + 1) % m_n_swapchain_images; + m_n_acquire_counter_rounded = (m_n_acquire_counter_rounded + 1) % m_create_info_ptr->get_n_images(); m_last_acquired_image_index = result; @@ -201,41 +190,35 @@ uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, } /** Please see header for specification */ -Anvil::SwapchainUniquePtr Anvil::Swapchain::create(const Anvil::BaseDevice* in_device_ptr, - Anvil::RenderingSurface* in_parent_surface_ptr, - Anvil::Window* in_window_ptr, - VkFormat in_format, - VkPresentModeKHR in_present_mode, - VkImageUsageFlags in_usage_flags, - uint32_t in_n_images, - const ExtensionKHRSwapchainEntrypoints& in_khr_swapchain_entrypoints, - MTSafety in_mt_safety, - VkSwapchainCreateFlagsKHR in_flags) +Anvil::SwapchainUniquePtr Anvil::Swapchain::create(Anvil::SwapchainCreateInfoUniquePtr in_create_info_ptr) { - const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); SwapchainUniquePtr result_ptr(nullptr, std::default_delete() ); + auto window_ptr(in_create_info_ptr->get_window() ); result_ptr.reset( - new Anvil::Swapchain(in_device_ptr, - in_parent_surface_ptr, - in_window_ptr, - in_format, - in_present_mode, - in_usage_flags, - in_flags, - in_n_images, - in_khr_swapchain_entrypoints, - mt_safe) + new Anvil::Swapchain( + std::move(in_create_info_ptr) + ) ); - if (in_window_ptr != nullptr && - in_window_ptr->get_platform() == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS) + if (result_ptr) { - dynamic_cast(in_window_ptr)->set_swapchain(result_ptr.get() ); + if (!result_ptr->init() ) + { + result_ptr.reset(); + + goto end; + } + + if (window_ptr != nullptr && + window_ptr->get_platform() == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS) + { + dynamic_cast(window_ptr)->set_swapchain(result_ptr.get() ); + } } +end: return result_ptr; } @@ -249,11 +232,13 @@ void Anvil::Swapchain::destroy_swapchain() { if (m_swapchain != VK_NULL_HANDLE) { + const auto& khr_swapchain_entrypoints = m_device_ptr->get_extension_khr_swapchain_entrypoints(); + anvil_assert(m_n_acquire_counter == m_n_present_counter); - m_khr_swapchain_entrypoints.vkDestroySwapchainKHR(m_device_ptr->get_device_vk(), - m_swapchain, - nullptr /* pAllocator */); + khr_swapchain_entrypoints.vkDestroySwapchainKHR(m_device_ptr->get_device_vk(), + m_swapchain, + nullptr /* pAllocator */); } m_swapchain = VK_NULL_HANDLE; @@ -261,53 +246,50 @@ void Anvil::Swapchain::destroy_swapchain() unlock(); } -/** Please see header for specification */ -void Anvil::Swapchain::disable_destroy_swapchain_before_parent_window_closes_behavior() -{ - m_destroy_swapchain_before_parent_window_closes = false; -} - /** Please see header for specification */ Anvil::Image* Anvil::Swapchain::get_image(uint32_t in_n_swapchain_image) const { - anvil_assert(in_n_swapchain_image < m_n_swapchain_images); + anvil_assert(in_n_swapchain_image < m_create_info_ptr->get_n_images() ); - return m_image_ptrs[in_n_swapchain_image].get(); + return m_image_ptrs.at(in_n_swapchain_image).get(); } /** Please see header for specification */ Anvil::ImageView* Anvil::Swapchain::get_image_view(uint32_t in_n_swapchain_image) const { - anvil_assert(in_n_swapchain_image < m_n_swapchain_images); + anvil_assert(in_n_swapchain_image < m_create_info_ptr->get_n_images()); - return m_image_view_ptrs[in_n_swapchain_image].get(); + return m_image_view_ptrs.at(in_n_swapchain_image).get(); } /** Initializes the swapchain object. */ -void Anvil::Swapchain::init() +bool Anvil::Swapchain::init() { uint32_t n_swapchain_images = 0; + auto parent_surface_ptr = m_create_info_ptr->get_rendering_surface(); VkResult result = VK_ERROR_INITIALIZATION_FAILED; Anvil::StructChainUniquePtr struct_chain_ptr; std::vector swapchain_images; const VkSurfaceTransformFlagBitsKHR swapchain_transformation = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR; - const WindowPlatform window_platform = m_window_ptr->get_platform(); + const WindowPlatform window_platform = m_create_info_ptr->get_window()->get_platform(); const bool is_offscreen_rendering_enabled = (window_platform == WINDOW_PLATFORM_DUMMY || window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS); - ANVIL_REDUNDANT_VARIABLE(result); - - m_image_view_format = m_image_format; - m_size.width = m_parent_surface_ptr->get_width (); - m_size.height = m_parent_surface_ptr->get_height(); + m_size.width = parent_surface_ptr->get_width (); + m_size.height = parent_surface_ptr->get_height(); /* not doing offscreen rendering */ if (!is_offscreen_rendering_enabled) { + const auto& khr_swapchain_entrypoints = m_device_ptr->get_extension_khr_swapchain_entrypoints(); Anvil::StructChainer struct_chainer; #ifdef _DEBUG { + const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr) ); + + const Anvil::DeviceType device_type = m_device_ptr->get_type(); + uint32_t n_physical_devices = 0; bool result_bool = false; const char* required_surface_extension_name = nullptr; VkSurfaceCapabilitiesKHR surface_caps; @@ -327,26 +309,53 @@ void Anvil::Swapchain::init() anvil_assert(required_surface_extension_name == nullptr || m_device_ptr->get_parent_instance()->is_instance_extension_supported(required_surface_extension_name) ); - /* Ensure opaque composite alpha mode is supported */ - anvil_assert(m_parent_surface_ptr->get_supported_composite_alpha_flags(&supported_composite_alpha_flags) ); + switch (device_type) + { + case Anvil::DEVICE_TYPE_SINGLE_GPU: n_physical_devices = 1; break; + + default: + { + anvil_assert_fail(); + } + } + + for (uint32_t n_physical_device = 0; + n_physical_device < n_physical_devices; + ++n_physical_device) + { + const Anvil::PhysicalDevice* current_physical_device_ptr = nullptr; + + switch (device_type) + { + case Anvil::DEVICE_TYPE_SINGLE_GPU: current_physical_device_ptr = sgpu_device_ptr->get_physical_device(); break; + + default: + { + anvil_assert_fail(); + } + } + + /* Ensure opaque composite alpha mode is supported */ + anvil_assert(parent_surface_ptr->get_supported_composite_alpha_flags(&supported_composite_alpha_flags) ); - anvil_assert(supported_composite_alpha_flags & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR); + anvil_assert(supported_composite_alpha_flags & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR); - /* Ensure we can use the swapchain image format */ - anvil_assert(m_parent_surface_ptr->is_compatible_with_image_format(m_image_format, - &result_bool) ); - anvil_assert(result_bool); + /* Ensure we can use the swapchain image format */ + anvil_assert(parent_surface_ptr->is_compatible_with_image_format(m_create_info_ptr->get_format(), + &result_bool) ); + anvil_assert(result_bool); - /* Ensure the transformation we're about to request is supported by the rendering surface */ - anvil_assert(m_parent_surface_ptr->get_supported_transformations(&supported_surface_transform_flags) ); + /* Ensure the transformation we're about to request is supported by the rendering surface */ + anvil_assert(parent_surface_ptr->get_supported_transformations(&supported_surface_transform_flags) ); - anvil_assert(supported_surface_transform_flags & swapchain_transformation); + anvil_assert(supported_surface_transform_flags & swapchain_transformation); - /* Ensure the requested number of swapchain images is reasonable*/ - anvil_assert(m_parent_surface_ptr->get_capabilities(&surface_caps) ); + /* Ensure the requested number of swapchain images is reasonable*/ + anvil_assert(parent_surface_ptr->get_capabilities(&surface_caps) ); - anvil_assert(surface_caps.maxImageCount == 0 || - surface_caps.maxImageCount >= m_n_swapchain_images); + anvil_assert(surface_caps.maxImageCount == 0 || + surface_caps.maxImageCount >= m_create_info_ptr->get_n_images() ); + } } #endif @@ -355,37 +364,37 @@ void Anvil::Swapchain::init() create_info.clipped = true; /* we won't be reading from the presentable images */ create_info.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; - create_info.flags = m_flags; + create_info.flags = m_create_info_ptr->get_flags(); create_info.imageArrayLayers = 1; create_info.imageColorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR; - create_info.imageExtent.height = m_parent_surface_ptr->get_height(); - create_info.imageExtent.width = m_parent_surface_ptr->get_width(); - create_info.imageFormat = m_image_format; + create_info.imageExtent.height = parent_surface_ptr->get_height(); + create_info.imageExtent.width = parent_surface_ptr->get_width (); + create_info.imageFormat = m_create_info_ptr->get_format (); create_info.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE; - create_info.imageUsage = m_usage_flags; - create_info.minImageCount = m_n_swapchain_images; + create_info.imageUsage = m_create_info_ptr->get_usage_flags(); + create_info.minImageCount = m_create_info_ptr->get_n_images (); create_info.oldSwapchain = VK_NULL_HANDLE; create_info.pNext = nullptr; create_info.pQueueFamilyIndices = nullptr; - create_info.presentMode = m_present_mode; + create_info.presentMode = m_create_info_ptr->get_present_mode(); create_info.preTransform = swapchain_transformation; create_info.queueFamilyIndexCount = 0; create_info.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR; - create_info.surface = m_parent_surface_ptr->get_surface(); + create_info.surface = parent_surface_ptr->get_surface(); struct_chainer.append_struct(create_info); } struct_chain_ptr = struct_chainer.create_chain(); - m_parent_surface_ptr->lock(); + parent_surface_ptr->lock(); { - result = m_khr_swapchain_entrypoints.vkCreateSwapchainKHR(m_device_ptr->get_device_vk(), - struct_chain_ptr->get_root_struct(), - nullptr, /* pAllocator */ - &m_swapchain); + result = khr_swapchain_entrypoints.vkCreateSwapchainKHR(m_device_ptr->get_device_vk(), + struct_chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_swapchain); } - m_parent_surface_ptr->unlock(); + parent_surface_ptr->unlock(); anvil_assert_vk_call_succeeded(result); if (is_vk_call_successful(result) ) @@ -394,79 +403,91 @@ void Anvil::Swapchain::init() } /* Retrieve swap-chain images */ - result = m_khr_swapchain_entrypoints.vkGetSwapchainImagesKHR(m_device_ptr->get_device_vk(), - m_swapchain, - &n_swapchain_images, - nullptr); /* pSwapchainImages */ + result = khr_swapchain_entrypoints.vkGetSwapchainImagesKHR(m_device_ptr->get_device_vk(), + m_swapchain, + &n_swapchain_images, + nullptr); /* pSwapchainImages */ anvil_assert_vk_call_succeeded(result); anvil_assert (n_swapchain_images > 0); swapchain_images.resize(n_swapchain_images); - result = m_khr_swapchain_entrypoints.vkGetSwapchainImagesKHR(m_device_ptr->get_device_vk(), - m_swapchain, - &n_swapchain_images, - &swapchain_images[0]); + result = khr_swapchain_entrypoints.vkGetSwapchainImagesKHR(m_device_ptr->get_device_vk(), + m_swapchain, + &n_swapchain_images, + &swapchain_images[0]); anvil_assert_vk_call_succeeded(result); } else /* offscreen rendering */ { - m_usage_flags = static_cast(static_cast(m_usage_flags) | VK_IMAGE_USAGE_TRANSFER_SRC_BIT); - n_swapchain_images = m_n_swapchain_images; + m_create_info_ptr->set_usage_flags(m_create_info_ptr->get_usage_flags() | VK_IMAGE_USAGE_TRANSFER_SRC_BIT); + + n_swapchain_images = m_create_info_ptr->get_n_images(); } - for (size_t n_result_image = 0; - n_result_image < n_swapchain_images; - ++n_result_image) + for (uint32_t n_result_image = 0; + n_result_image < n_swapchain_images; + ++n_result_image) { /* Spawn an Image wrapper class for the swap-chain image. */ if (!is_offscreen_rendering_enabled) { - /* NOTE: The constructor we use below is special, in that the wrapped VkImage instance will not be destroyed - * when the Image instance goes out of scope. - */ - m_image_ptrs[n_result_image] = Anvil::Image::create_nonsparse(m_device_ptr, - *struct_chain_ptr->get_root_struct(), - swapchain_images[n_result_image], - Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() ) ); + auto create_info_ptr = Anvil::ImageCreateInfo::create_swapchain_wrapper(m_device_ptr, + this, + swapchain_images[n_result_image], + n_result_image); + + create_info_ptr->set_mt_safety(Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() ) ); + + m_image_ptrs[n_result_image] = Anvil::Image::create(std::move(create_info_ptr) ); } else { - m_image_ptrs[n_result_image] = Anvil::Image::create_nonsparse(m_device_ptr, - VK_IMAGE_TYPE_2D, - m_image_format, - VK_IMAGE_TILING_OPTIMAL, - m_usage_flags, - m_size.width, - m_size.height, - 1, /* base_mipmap_depth */ - 1, - VK_SAMPLE_COUNT_1_BIT, - QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - false, /* in_use_full_mipmap_chain */ - 0, /* in_memory_features */ - 0, /* in_create_flags */ - VK_IMAGE_LAYOUT_GENERAL, - nullptr, - Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() ) ); + auto create_info_ptr = Anvil::ImageCreateInfo::create_nonsparse_alloc(m_device_ptr, + VK_IMAGE_TYPE_2D, + m_create_info_ptr->get_format(), + VK_IMAGE_TILING_OPTIMAL, + m_create_info_ptr->get_usage_flags(), + m_size.width, + m_size.height, + 1, /* base_mipmap_depth */ + 1, + VK_SAMPLE_COUNT_1_BIT, + QUEUE_FAMILY_GRAPHICS_BIT, + VK_SHARING_MODE_EXCLUSIVE, + false, /* in_use_full_mipmap_chain */ + 0, /* in_memory_features */ + 0, /* in_create_flags */ + VK_IMAGE_LAYOUT_GENERAL, + nullptr); + + create_info_ptr->set_mt_safety(Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() ) ); + + m_image_ptrs[n_result_image] = Anvil::Image::create(std::move(create_info_ptr) ); } /* For each swap-chain image, create a relevant view */ - m_image_view_ptrs[n_result_image] = Anvil::ImageView::create_2D(m_device_ptr, + { + auto create_info_ptr = Anvil::ImageViewCreateInfo::create_2D(m_device_ptr, m_image_ptrs[n_result_image].get(), 0, /* n_base_layer */ 0, /* n_base_mipmap_level */ 1, /* n_mipmaps */ VK_IMAGE_ASPECT_COLOR_BIT, - m_image_format, + m_create_info_ptr->get_format(), VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_G, VK_COMPONENT_SWIZZLE_B, - VK_COMPONENT_SWIZZLE_A, - Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() ) ); + VK_COMPONENT_SWIZZLE_A); + + create_info_ptr->set_mt_safety(Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() ) ); + + m_image_view_ptrs[n_result_image] = Anvil::ImageView::create(std::move(create_info_ptr) ); + } + + result = VK_SUCCESS; } /* Sign up for present submission notifications. This is needed to ensure that number of presented frames == @@ -475,37 +496,49 @@ void Anvil::Swapchain::init() { std::vector queues; - const std::vector* queue_fams_with_present_support_ptr(nullptr); - const Anvil::SGPUDevice* sgpu_device_ptr (dynamic_cast(m_device_ptr) ); - - m_parent_surface_ptr->get_queue_families_with_present_support(&queue_fams_with_present_support_ptr); - - if (queue_fams_with_present_support_ptr == nullptr) - { - anvil_assert(queue_fams_with_present_support_ptr != nullptr); - } - else + switch (m_device_ptr->get_type() ) { - for (const auto queue_fam : *queue_fams_with_present_support_ptr) + case Anvil::DEVICE_TYPE_SINGLE_GPU: { - const uint32_t n_queues = sgpu_device_ptr->get_n_queues(queue_fam); + const std::vector* queue_fams_with_present_support_ptr(nullptr); + const auto rendering_surface_ptr (m_create_info_ptr->get_rendering_surface() ); + const Anvil::SGPUDevice* sgpu_device_ptr (dynamic_cast(m_device_ptr) ); - for (uint32_t n_queue = 0; - n_queue < n_queues; - ++n_queue) + if (!rendering_surface_ptr->get_queue_families_with_present_support(&queue_fams_with_present_support_ptr) ) { - auto queue_ptr = sgpu_device_ptr->get_queue_for_queue_family_index(queue_fam, - n_queue); - - anvil_assert(queue_ptr != nullptr); + break; + } - if (std::find(queues.begin(), - queues.end(), - queue_ptr) == queues.end() ) + if (queue_fams_with_present_support_ptr == nullptr) + { + anvil_assert(queue_fams_with_present_support_ptr != nullptr); + } + else + { + for (const auto queue_fam : *queue_fams_with_present_support_ptr) { - queues.push_back(queue_ptr); + const uint32_t n_queues = sgpu_device_ptr->get_n_queues(queue_fam); + + for (uint32_t n_queue = 0; + n_queue < n_queues; + ++n_queue) + { + auto queue_ptr = sgpu_device_ptr->get_queue_for_queue_family_index(queue_fam, + n_queue); + + anvil_assert(queue_ptr != nullptr); + + if (std::find(queues.begin(), + queues.end(), + queue_ptr) == queues.end() ) + { + queues.push_back(queue_ptr); + } + } } } + + break; } } @@ -526,12 +559,14 @@ void Anvil::Swapchain::init() /* Sign up for "about to close the parent window" notifications. Swapchain instance SHOULD be deinitialized * before the window is destroyed, so we're going to act as nice citizens. */ - m_window_ptr->register_for_callbacks( + m_create_info_ptr->get_window()->register_for_callbacks( WINDOW_CALLBACK_ID_ABOUT_TO_CLOSE, std::bind(&Swapchain::on_parent_window_about_to_close, this), this ); + + return is_vk_call_successful(result); } /** TODO */ From 07d17511efbde6a649798a75ee124e89fd623c4d Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Thu, 12 Apr 2018 16:44:49 +0200 Subject: [PATCH 09/50] cmake glitches.. --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 395963fe..2e570cb7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,9 +9,10 @@ option(ANVIL_LINK_WITH_GLSLANG "Links with glslang, instead # Do not modify anything after this line, unless you know what you're doing. configure_file("include/config.h.in" "include/config.h") -include_directories("$(Anvil_SOURCE_DIR)" - "$(Anvil_SOURCE_DIR)/deps" - "$(Anvil_SOURCE_DIR)/include") +include_directories("${Anvil_BINARY_DIR}/include" + "${Anvil_SOURCE_DIR}" + "${Anvil_SOURCE_DIR}/deps" + "${Anvil_SOURCE_DIR}/include") if (WIN32) if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") From 888ddbc73f5df7e0d4d0ede02c224895f65716df Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Thu, 12 Apr 2018 16:55:41 +0200 Subject: [PATCH 10/50] gcc compilation fixes --- src/wrappers/command_buffer.cpp | 4 +--- src/wrappers/queue.cpp | 1 - src/wrappers/render_pass.cpp | 1 - src/wrappers/swapchain.cpp | 16 +++++++--------- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/wrappers/command_buffer.cpp b/src/wrappers/command_buffer.cpp index b7c9fba9..039de6d0 100644 --- a/src/wrappers/command_buffer.cpp +++ b/src/wrappers/command_buffer.cpp @@ -2751,8 +2751,7 @@ bool Anvil::CommandBufferBase::record_set_depth_bounds(float in_min_depth_bounds bool Anvil::CommandBufferBase::record_set_event(Anvil::Event* in_event_ptr, VkPipelineStageFlags in_stage_mask) { - const Anvil::DeviceType device_type = m_device_ptr->get_type(); - bool result = false; + bool result = false; if (m_is_renderpass_active) { @@ -3336,7 +3335,6 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t i Anvil::RenderPass* in_render_pass_ptr, VkSubpassContents in_contents) { - const Anvil::DeviceType device_type = m_device_ptr->get_type(); Anvil::StructChainer render_pass_begin_info_chain; bool result = false; diff --git a/src/wrappers/queue.cpp b/src/wrappers/queue.cpp index 6c207328..b0645dd1 100644 --- a/src/wrappers/queue.cpp +++ b/src/wrappers/queue.cpp @@ -413,7 +413,6 @@ VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, uint32_t in_n_wait_semaphores, Anvil::Semaphore* const* in_wait_semaphore_ptrs) { - const Anvil::DeviceType device_type (m_device_ptr->get_type() ); VkResult presentation_results [MAX_SWAPCHAINS]; VkResult result; Anvil::StructChainer struct_chainer; diff --git a/src/wrappers/render_pass.cpp b/src/wrappers/render_pass.cpp index a748e2d0..a9caae19 100644 --- a/src/wrappers/render_pass.cpp +++ b/src/wrappers/render_pass.cpp @@ -186,7 +186,6 @@ bool Anvil::RenderPass::init() uint32_t highest_subpass_color_attachment_location = UINT32_MAX; uint32_t highest_subpass_input_attachment_index = UINT32_MAX; bool need_color_resolve_attachments = false; - const uint32_t subpass_index = static_cast(subpass_iterator - m_render_pass_create_info_ptr->m_subpasses.begin() ); VkSubpassDescription subpass_vk; VkAttachmentReference unused_reference; diff --git a/src/wrappers/swapchain.cpp b/src/wrappers/swapchain.cpp index 8422afc0..b3c12837 100644 --- a/src/wrappers/swapchain.cpp +++ b/src/wrappers/swapchain.cpp @@ -103,15 +103,13 @@ Anvil::Swapchain::~Swapchain() uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, bool in_should_block) { - const Anvil::PhysicalDevice* physical_device_ptr (nullptr); - uint32_t result (UINT32_MAX); - VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); - const Anvil::SGPUDevice* sgpu_device_ptr (dynamic_cast(m_device_ptr) ); - const WindowPlatform window_platform (m_create_info_ptr->get_window()->get_platform() ); - const bool is_offscreen_rendering_enabled( (window_platform == WINDOW_PLATFORM_DUMMY || - window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS) ); - - physical_device_ptr = sgpu_device_ptr->get_physical_device(); + uint32_t result (UINT32_MAX); + VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); + const WindowPlatform window_platform (m_create_info_ptr->get_window()->get_platform() ); + const bool is_offscreen_rendering_enabled( (window_platform == WINDOW_PLATFORM_DUMMY || + window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS) ); + + ANVIL_REDUNDANT_VARIABLE(result_vk); if (!is_offscreen_rendering_enabled) { From d969279196f3de359a3da2d76469eec6f1179ba2 Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Mon, 23 Apr 2018 13:14:42 +0200 Subject: [PATCH 11/50] Add support for the following extensions: - VK_KHR_external_fence - VK_KHR_external_fence_fd - VK_KHR_external_fence_win32 - VK_KHR_external_memory_fd - VK_KHR_external_memory_win32 - VK_KHR_external_semaphore - VK_KHR_external_semaphore_fd - VK_KHR_external_semaphore_win32 Address #80: Change order of cleanup in BaseDevice::~BaseDevice() Address #81: No way to get query pool results on host? Address #82: Minor spelling error in PhysicalDeviceFeaturesCoreVK10 Address #83: ImageView::get_swizzle_array - required size for parameter? Address #84: Function definition for GraphicsPipelineInfo::get_pipeline_color_blend_attachment_state is missing? Other minor improvements & bug-fixes. --- CMakeLists.txt | 6 +- examples/DynamicBuffers/src/app.cpp | 17 +- examples/MultiViewport/src/app.cpp | 17 +- examples/OcclusionQuery/src/app.cpp | 18 +- examples/OutOfOrderRasterization/src/app.cpp | 16 +- examples/PushConstants/src/app.cpp | 16 +- include/misc/buffer_create_info.h | 90 +-- include/misc/extensions.h | 121 +++- include/misc/external_handle.h | 55 ++ include/misc/fence_create_info.h | 70 +- include/misc/image_create_info.h | 92 +-- .../misc/memalloc_backends/backend_oneshot.h | 14 +- include/misc/memalloc_backends/backend_vma.h | 14 +- include/misc/memory_allocator.h | 194 +++--- include/misc/memory_block_create_info.h | 317 +++++++++ include/misc/semaphore_create_info.h | 30 +- include/misc/types.h | 15 +- include/misc/types_enums.h | 88 ++- include/misc/types_struct.h | 620 +++++++++++++++++- include/misc/types_utils.h | 18 +- include/wrappers/buffer.h | 2 - include/wrappers/descriptor_pool.h | 2 +- include/wrappers/device.h | 125 +++- include/wrappers/fence.h | 45 +- include/wrappers/image.h | 2 - include/wrappers/instance.h | 15 +- include/wrappers/memory_block.h | 158 ++--- include/wrappers/physical_device.h | 159 ++--- include/wrappers/query_pool.h | 45 ++ include/wrappers/queue.h | 137 +--- include/wrappers/semaphore.h | 43 +- src/misc/buffer_create_info.cpp | 52 +- src/misc/dummy_window.cpp | 12 +- src/misc/external_handle.cpp | 64 ++ src/misc/fence_create_info.cpp | 10 +- src/misc/image_create_info.cpp | 44 +- .../memalloc_backends/backend_oneshot.cpp | 28 +- src/misc/memalloc_backends/backend_vma.cpp | 26 +- src/misc/memory_allocator.cpp | 197 +++--- src/misc/memory_block_create_info.cpp | 184 ++++++ src/misc/semaphore_create_info.cpp | 10 +- src/misc/types_classes.cpp | 6 +- src/misc/types_struct.cpp | 567 +++++++++++++++- src/misc/types_utils.cpp | 303 ++++++++- src/wrappers/buffer.cpp | 80 ++- src/wrappers/descriptor_pool.cpp | 1 - src/wrappers/device.cpp | 162 ++++- src/wrappers/fence.cpp | 267 +++++++- src/wrappers/image.cpp | 104 ++- src/wrappers/instance.cpp | 48 ++ src/wrappers/memory_block.cpp | 448 +++++++------ src/wrappers/physical_device.cpp | 391 ++++++++--- src/wrappers/query_pool.cpp | 84 ++- src/wrappers/queue.cpp | 206 ++++-- src/wrappers/semaphore.cpp | 248 ++++++- src/wrappers/swapchain.cpp | 8 +- 56 files changed, 4685 insertions(+), 1426 deletions(-) create mode 100644 include/misc/external_handle.h create mode 100644 include/misc/memory_block_create_info.h create mode 100644 src/misc/external_handle.cpp create mode 100644 src/misc/memory_block_create_info.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e570cb7..5259bc85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ include_directories("${Anvil_BINARY_DIR}/include" "${Anvil_SOURCE_DIR}" "${Anvil_SOURCE_DIR}/deps" "${Anvil_SOURCE_DIR}/include") - + if (WIN32) if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") link_directories ($ENV{VK_SDK_PATH}/Bin @@ -46,6 +46,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/include/misc/dummy_window.h" "${Anvil_SOURCE_DIR}/include/misc/event_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/extensions.h" + "${Anvil_SOURCE_DIR}/include/misc/external_handle.h" "${Anvil_SOURCE_DIR}/include/misc/fence_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/formats.h" "${Anvil_SOURCE_DIR}/include/misc/fp16.h" @@ -56,6 +57,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/include/misc/image_view_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/io.h" "${Anvil_SOURCE_DIR}/include/misc/memory_allocator.h" + "${Anvil_SOURCE_DIR}/include/misc/memory_block_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/mt_safety.h" "${Anvil_SOURCE_DIR}/include/misc/object_tracker.h" "${Anvil_SOURCE_DIR}/include/misc/page_tracker.h" @@ -120,6 +122,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/src/misc/debug_marker.cpp" "${Anvil_SOURCE_DIR}/src/misc/descriptor_set_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/dummy_window.cpp" + "${Anvil_SOURCE_DIR}/src/misc/external_handle.cpp" "${Anvil_SOURCE_DIR}/src/misc/event_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/fence_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/formats.cpp" @@ -131,6 +134,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/src/misc/image_view_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/io.cpp" "${Anvil_SOURCE_DIR}/src/misc/memory_allocator.cpp" + "${Anvil_SOURCE_DIR}/src/misc/memory_block_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/object_tracker.cpp" "${Anvil_SOURCE_DIR}/src/misc/page_tracker.cpp" "${Anvil_SOURCE_DIR}/src/misc/pools.cpp" diff --git a/examples/DynamicBuffers/src/app.cpp b/examples/DynamicBuffers/src/app.cpp index 3dff0ae0..e64174c8 100644 --- a/examples/DynamicBuffers/src/app.cpp +++ b/examples/DynamicBuffers/src/app.cpp @@ -303,14 +303,15 @@ void App::draw_frame() &t); /* Submit jobs to relevant queues and make sure they are correctly synchronized */ - m_device_ptr->get_universal_queue(0)->submit_command_buffer_with_signal_wait_semaphores(m_command_buffers[n_swapchain_image].get(), - 1, /* n_semaphores_to_signal */ - &curr_frame_signal_semaphore_ptr, - 1, /* n_semaphores_to_wait_on */ - &curr_frame_wait_semaphore_ptr, - &wait_stage_mask, - false, /* should_block */ - nullptr); + m_device_ptr->get_universal_queue(0)->submit( + Anvil::SubmitInfo::create_wait_execute_signal(m_command_buffers[n_swapchain_image].get(), + 1, /* n_semaphores_to_signal */ + &curr_frame_signal_semaphore_ptr, + 1, /* n_semaphores_to_wait_on */ + &curr_frame_wait_semaphore_ptr, + &wait_stage_mask, + false) /* should_block */ + ); m_present_queue_ptr->present(m_swapchain_ptr.get(), n_swapchain_image, diff --git a/examples/MultiViewport/src/app.cpp b/examples/MultiViewport/src/app.cpp index 888b5c3b..d7c24b17 100644 --- a/examples/MultiViewport/src/app.cpp +++ b/examples/MultiViewport/src/app.cpp @@ -243,14 +243,15 @@ void App::draw_frame() n_swapchain_image = m_swapchain_ptr->acquire_image(curr_frame_wait_semaphore_ptr); /* Submit work chunk and present */ - m_device_ptr->get_universal_queue(0)->submit_command_buffer_with_signal_wait_semaphores(m_command_buffers[n_swapchain_image].get(), - 1, /* n_semaphores_to_signal */ - &curr_frame_signal_semaphore_ptr, - 1, /* n_semaphores_to_wait_on */ - &curr_frame_wait_semaphore_ptr, - &wait_stage_mask, - false, /* should_block */ - nullptr); /* opt_fence_ptr */ + m_device_ptr->get_universal_queue(0)->submit( + Anvil::SubmitInfo::create_wait_execute_signal(m_command_buffers[n_swapchain_image].get(), + 1, /* n_semaphores_to_signal */ + &curr_frame_signal_semaphore_ptr, + 1, /* n_semaphores_to_wait_on */ + &curr_frame_wait_semaphore_ptr, + &wait_stage_mask, + false) /* should_block */ + ); present_queue_ptr->present(m_swapchain_ptr.get(), n_swapchain_image, diff --git a/examples/OcclusionQuery/src/app.cpp b/examples/OcclusionQuery/src/app.cpp index 56fd072f..56fd9789 100644 --- a/examples/OcclusionQuery/src/app.cpp +++ b/examples/OcclusionQuery/src/app.cpp @@ -295,14 +295,16 @@ void App::draw_frame() }; const uint32_t n_cmd_buffers = sizeof(cmd_buffers) / sizeof(cmd_buffers[0]); - present_queue_ptr->submit_command_buffers(n_cmd_buffers, - cmd_buffers, - 1, /* n_semaphores_to_signal */ - &curr_frame_signal_semaphore_ptr, - 1, /* n_semaphores_to_wait_on */ - &curr_frame_wait_semaphore_ptr, - &wait_stage_mask, - false); /* should_block */ + present_queue_ptr->submit( + Anvil::SubmitInfo::create_wait_execute_signal(cmd_buffers, + n_cmd_buffers, + 1, /* n_semaphores_to_signal */ + &curr_frame_signal_semaphore_ptr, + 1, /* n_semaphores_to_wait_on */ + &curr_frame_wait_semaphore_ptr, + &wait_stage_mask, + false) /* should_block */ + ); present_queue_ptr->present(m_swapchain_ptr.get(), n_swapchain_image, diff --git a/examples/OutOfOrderRasterization/src/app.cpp b/examples/OutOfOrderRasterization/src/app.cpp index 44be3923..2e2e63f2 100644 --- a/examples/OutOfOrderRasterization/src/app.cpp +++ b/examples/OutOfOrderRasterization/src/app.cpp @@ -344,13 +344,15 @@ void App::draw_frame() } { - m_present_queue_ptr->submit_command_buffer_with_signal_wait_semaphores(render_cmdbuffer_ptr, - 1, /* n_semaphores_to_signal */ - &frame_ready_for_present_semaphore_ptr, - 1, /* n_semaphores_to_wait_on */ - &frame_ready_to_render_semaphore_ptr, - &wait_stage_mask, - false /* should_block */); + m_present_queue_ptr->submit( + Anvil::SubmitInfo::create_wait_execute_signal(render_cmdbuffer_ptr, + 1, /* n_semaphores_to_signal */ + &frame_ready_for_present_semaphore_ptr, + 1, /* n_semaphores_to_wait_on */ + &frame_ready_to_render_semaphore_ptr, + &wait_stage_mask, + false /* should_block */) + ); } { diff --git a/examples/PushConstants/src/app.cpp b/examples/PushConstants/src/app.cpp index f704345c..2424d6b0 100644 --- a/examples/PushConstants/src/app.cpp +++ b/examples/PushConstants/src/app.cpp @@ -282,13 +282,15 @@ void App::draw_frame() /* Submit work chunk and present */ update_data_ub_contents(n_swapchain_image); - present_queue_ptr->submit_command_buffer_with_signal_wait_semaphores(m_command_buffers[n_swapchain_image].get(), - 1, /* n_semaphores_to_signal */ - &curr_frame_signal_semaphore_ptr, - 1, /* n_semaphores_to_wait_on */ - &curr_frame_wait_semaphore_ptr, - &wait_stage_mask, - false /* should_block */); + present_queue_ptr->submit( + Anvil::SubmitInfo::create(m_command_buffers[n_swapchain_image].get(), + 1, /* n_semaphores_to_signal */ + &curr_frame_signal_semaphore_ptr, + 1, /* n_semaphores_to_wait_on */ + &curr_frame_wait_semaphore_ptr, + &wait_stage_mask, + false /* should_block */) + ); present_queue_ptr->present(m_swapchain_ptr.get(), n_swapchain_image, diff --git a/include/misc/buffer_create_info.h b/include/misc/buffer_create_info.h index 77d533d0..5230fc6e 100644 --- a/include/misc/buffer_create_info.h +++ b/include/misc/buffer_create_info.h @@ -119,16 +119,16 @@ namespace Anvil * @param in_residency_scope Scope of residency to support for the buffer. * @param in_external_memory_handle_types If the buffer is going to be exported to another process or Vulkan instance, use * this field to specify which handle types the allocation needs to support. Please see - * documentation of Anvil::ExternalMemoryHandleTypeFlags for more details. + * documentation of Anvil::ExternalMemoryHandleTypeBits for more details. **/ - static Anvil::BufferCreateInfoUniquePtr create_sparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - VkBufferUsageFlags in_usage_flags, - Anvil::SparseResidencyScope in_residency_scope, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); + static Anvil::BufferCreateInfoUniquePtr create_sparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + VkBufferUsageFlags in_usage_flags, + Anvil::SparseResidencyScope in_residency_scope, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); const void* const get_client_data() const { @@ -140,7 +140,7 @@ namespace Anvil return m_device_ptr; } - const Anvil::ExternalMemoryHandleTypeFlags& get_external_memory_handle_types() const + const Anvil::ExternalMemoryHandleTypeBits& get_external_memory_handle_types() const { return m_external_memory_handle_types; } @@ -222,7 +222,7 @@ namespace Anvil m_device_ptr = in_device_ptr; } - void set_external_memory_handle_types(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) + void set_external_memory_handle_types(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) { m_external_memory_handle_types = in_external_memory_handle_types; } @@ -267,43 +267,43 @@ namespace Anvil /* Private functions */ - BufferCreateInfo(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - VkBufferUsageFlags in_usage_flags, - Anvil::SparseResidencyScope in_residency_scope, - MTSafety in_mt_safety, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types); - BufferCreateInfo(const Anvil::BufferType& in_buffer_type, - const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - VkBufferUsageFlags in_usage_flags, - MemoryFeatureFlags in_memory_features, - MTSafety in_mt_safety, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types, - const void* in_opt_client_data_ptr); - BufferCreateInfo(Anvil::Buffer* in_parent_buffer_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size); + BufferCreateInfo(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + VkBufferUsageFlags in_usage_flags, + Anvil::SparseResidencyScope in_residency_scope, + MTSafety in_mt_safety, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types); + BufferCreateInfo(const Anvil::BufferType& in_buffer_type, + const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + VkBufferUsageFlags in_usage_flags, + MemoryFeatureFlags in_memory_features, + MTSafety in_mt_safety, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types, + const void* in_opt_client_data_ptr); + BufferCreateInfo(Anvil::Buffer* in_parent_buffer_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size); /* Private variables */ - const void* m_client_data_ptr; - const Anvil::BaseDevice* m_device_ptr; - Anvil::ExternalMemoryHandleTypeFlags m_external_memory_handle_types; - Anvil::MemoryFeatureFlags m_memory_features; - MTSafety m_mt_safety; - Anvil::Buffer* const m_parent_buffer_ptr; - Anvil::QueueFamilyBits m_queue_families; - const Anvil::SparseResidencyScope m_residency_scope; - VkSharingMode m_sharing_mode; - VkDeviceSize m_size; - VkDeviceSize m_start_offset; - const BufferType m_type; - VkBufferUsageFlags m_usage_flags; + const void* m_client_data_ptr; + const Anvil::BaseDevice* m_device_ptr; + Anvil::ExternalMemoryHandleTypeBits m_external_memory_handle_types; + Anvil::MemoryFeatureFlags m_memory_features; + MTSafety m_mt_safety; + Anvil::Buffer* const m_parent_buffer_ptr; + Anvil::QueueFamilyBits m_queue_families; + const Anvil::SparseResidencyScope m_residency_scope; + VkSharingMode m_sharing_mode; + VkDeviceSize m_size; + VkDeviceSize m_start_offset; + const BufferType m_type; + VkBufferUsageFlags m_usage_flags; ANVIL_DISABLE_ASSIGNMENT_OPERATOR(BufferCreateInfo); ANVIL_DISABLE_COPY_CONSTRUCTOR(BufferCreateInfo); diff --git a/include/misc/extensions.h b/include/misc/extensions.h index 5a493ee3..8185a5ab 100644 --- a/include/misc/extensions.h +++ b/include/misc/extensions.h @@ -54,12 +54,24 @@ namespace Anvil ValueType khr_16bit_storage; ValueType khr_bind_memory2; ValueType khr_descriptor_update_template; + ValueType khr_external_fence; ValueType khr_external_memory; + ValueType khr_external_semaphore; ValueType khr_maintenance1; ValueType khr_maintenance3; ValueType khr_storage_buffer_storage_class; ValueType khr_swapchain; + #if defined(_WIN32) + ValueType khr_external_fence_win32; + ValueType khr_external_memory_win32; + ValueType khr_external_semaphore_win32; + #else + ValueType khr_external_fence_fd; + ValueType khr_external_memory_fd; + ValueType khr_external_semaphore_fd; + #endif + std::map values_by_extension_names; @@ -103,7 +115,18 @@ namespace Anvil {ExtensionData(VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME, &ext_shader_subgroup_vote)}, {ExtensionData(VK_KHR_16BIT_STORAGE_EXTENSION_NAME, &khr_16bit_storage)}, {ExtensionData(VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME, &khr_descriptor_update_template)}, + {ExtensionData(VK_KHR_EXTERNAL_FENCE_EXTENSION_NAME, &khr_external_fence)}, {ExtensionData(VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME, &khr_external_memory)}, + {ExtensionData(VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME, &khr_external_semaphore)}, + #if defined(_WIN32) + {ExtensionData(VK_KHR_EXTERNAL_FENCE_WIN32_EXTENSION_NAME, &khr_external_fence_win32)}, + {ExtensionData(VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, &khr_external_memory_win32)}, + {ExtensionData(VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME, &khr_external_semaphore_win32)}, + #else + {ExtensionData(VK_KHR_EXTERNAL_FENCE_FD_EXTENSION_NAME, &khr_external_fence_fd)}, + {ExtensionData(VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME, &khr_external_memory_fd)}, + {ExtensionData(VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME, &khr_external_semaphore_fd)}, + #endif {ExtensionData(VK_KHR_MAINTENANCE1_EXTENSION_NAME, &khr_maintenance1)}, {ExtensionData(VK_KHR_MAINTENANCE3_EXTENSION_NAME, &khr_maintenance3)}, {ExtensionData(VK_KHR_BIND_MEMORY_2_EXTENSION_NAME, &khr_bind_memory2)}, @@ -134,7 +157,9 @@ namespace Anvil template struct InstanceExtensions { + ValueType khr_external_fence_capabilities; ValueType khr_external_memory_capabilities; + ValueType khr_external_semaphore_capabilities; ValueType khr_get_physical_device_properties2; ValueType khr_surface; @@ -166,7 +191,9 @@ namespace Anvil std::vector recognized_extensions = { + {ExtensionData(VK_KHR_EXTERNAL_FENCE_CAPABILITIES_EXTENSION_NAME, &khr_external_fence_capabilities)}, {ExtensionData(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME, &khr_external_memory_capabilities)}, + {ExtensionData(VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME, &khr_external_semaphore_capabilities)}, {ExtensionData(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, &khr_get_physical_device_properties2)}, {ExtensionData(VK_KHR_SURFACE_EXTENSION_NAME, &khr_surface)}, @@ -228,7 +255,18 @@ namespace Anvil virtual ValueType khr_16bit_storage () const = 0; virtual ValueType khr_bind_memory2 () const = 0; virtual ValueType khr_descriptor_update_template () const = 0; + virtual ValueType khr_external_fence () const = 0; virtual ValueType khr_external_memory () const = 0; + virtual ValueType khr_external_semaphore () const = 0; + #if defined(_WIN32) + virtual ValueType khr_external_fence_win32 () const = 0; + virtual ValueType khr_external_memory_win32 () const = 0; + virtual ValueType khr_external_semaphore_win32() const = 0; + #else + virtual ValueType khr_external_fence_fd () const = 0; + virtual ValueType khr_external_memory_fd () const = 0; + virtual ValueType khr_external_semaphore_fd() const = 0; + #endif virtual ValueType khr_maintenance1 () const = 0; virtual ValueType khr_maintenance3 () const = 0; virtual ValueType khr_storage_buffer_storage_class () const = 0; @@ -246,7 +284,9 @@ namespace Anvil /* Stub */ } + virtual bool khr_external_fence_capabilities () const = 0; virtual bool khr_external_memory_capabilities () const = 0; + virtual bool khr_external_semaphore_capabilities() const = 0; virtual bool khr_get_physical_device_properties2() const = 0; virtual bool khr_surface () const = 0; @@ -500,6 +540,29 @@ namespace Anvil return m_device_extensions_ptr->khr_descriptor_update_template; } + ValueType khr_external_fence() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_external_fence; + } + + #if defined(_WIN32) + ValueType khr_external_fence_win32() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_external_fence_win32; + } + #else + ValueType khr_external_fence_fd() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_external_fence_fd; + } + #endif + ValueType khr_external_memory() const final { anvil_assert(m_expose_device_extensions); @@ -507,6 +570,45 @@ namespace Anvil return m_device_extensions_ptr->khr_external_memory; } + #if defined(_WIN32) + ValueType khr_external_memory_win32() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_external_memory_win32; + } + #else + ValueType khr_external_memory_fd() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_external_memory_fd; + } + #endif + + ValueType khr_external_semaphore() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_external_semaphore; + } + + #if defined(_WIN32) + ValueType khr_external_semaphore_win32() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_external_semaphore_win32; + } + #else + ValueType khr_external_semaphore_fd() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_external_semaphore_fd; + } + #endif + ValueType khr_maintenance1() const final { anvil_assert(m_expose_device_extensions); @@ -537,6 +639,13 @@ namespace Anvil /* IExtensionInfoInstance */ + ValueType khr_external_fence_capabilities() const final + { + anvil_assert(!m_expose_device_extensions); + + return m_instance_extensions_ptr->khr_external_fence_capabilities; + } + ValueType khr_external_memory_capabilities() const final { anvil_assert(!m_expose_device_extensions); @@ -544,6 +653,13 @@ namespace Anvil return m_instance_extensions_ptr->khr_external_memory_capabilities; } + ValueType khr_external_semaphore_capabilities() const final + { + anvil_assert(!m_expose_device_extensions); + + return m_instance_extensions_ptr->khr_external_semaphore_capabilities; + } + ValueType khr_get_physical_device_properties2() const final { anvil_assert(!m_expose_device_extensions); @@ -589,7 +705,7 @@ namespace Anvil { DeviceExtensionConfiguration() { - /* NOTE: By default, Anvil enables all extensions it has support implemented for, which are reported + /* NOTE: By default, Anvil enables nearly all extensions it has support implemented for, which are reported * as available. */ { @@ -614,6 +730,9 @@ namespace Anvil extension_status[VK_EXT_DEBUG_MARKER_EXTENSION_NAME] = EXTENSION_AVAILABILITY_IGNORE; } #endif + + /* 3. Disable VK_AMD_shader_info by default. */ + extension_status[VK_AMD_SHADER_INFO_EXTENSION_NAME] = EXTENSION_AVAILABILITY_IGNORE; } std::map extension_status; diff --git a/include/misc/external_handle.h b/include/misc/external_handle.h new file mode 100644 index 00000000..8b06d3d6 --- /dev/null +++ b/include/misc/external_handle.h @@ -0,0 +1,55 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef MISC_EXTERNAL_HANDLE_H +#define MISC_EXTERNAL_HANDLE_H + +#include "misc/types.h" + +namespace Anvil +{ + class ExternalHandle + { + public: + /* Public functions */ + static ExternalHandleUniquePtr create(const ExternalHandleType& in_handle, + const bool& in_close_at_destruction_time); + + ~ExternalHandle(); + + ExternalHandleType get_handle() const + { + return m_handle; + } + + private: + ExternalHandle(const ExternalHandleType& in_handle, + const bool& in_close_at_destruction_time); + + const bool m_close_at_destruction_time; + const ExternalHandleType m_handle; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(ExternalHandle); + ANVIL_DISABLE_COPY_CONSTRUCTOR(ExternalHandle); + }; +} /* namespace Anvil */ + +#endif /* MISC_EXTERNAL_HANDLE_H */ diff --git a/include/misc/fence_create_info.h b/include/misc/fence_create_info.h index d10b5739..5021c9c5 100644 --- a/include/misc/fence_create_info.h +++ b/include/misc/fence_create_info.h @@ -35,7 +35,8 @@ namespace Anvil * * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - Exportable external fence handle type: none + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE */ static Anvil::FenceCreateInfoUniquePtr create(const Anvil::BaseDevice* in_device_ptr, bool in_create_signalled); @@ -45,6 +46,31 @@ namespace Anvil return m_device_ptr; } + const Anvil::ExternalFenceHandleTypeBits& get_exportable_external_fence_handle_types() const + { + return m_exportable_external_fence_handle_types; + } + + #if defined(_WIN32) + /* Returns true if set_exportable_nt_handle_info() has been called prior to this call. + * Otherwise returns false. + * + * If the func returns true, *out_result_ptr is set to the queried data. + */ + bool get_exportable_nt_handle_info(const ExternalNTHandleInfo** out_result_ptr_ptr) const + { + bool result = false; + + if (m_exportable_nt_handle_info_specified) + { + *out_result_ptr_ptr = &m_exportable_nt_handle_info; + result = true; + } + + return result; + } + #endif + const MTSafety& get_mt_safety() const { return m_mt_safety; @@ -55,6 +81,36 @@ namespace Anvil return m_create_signalled; } + #if defined(_WIN32) + /* Lets the app specify additional details for exportable NT handles. + * + * If @param in_name is zero-sized, member of the VkExportFenceWin32HandleInfoKHR struct, as chained to the VkFenceCreateInfo struct chain, + * will be set to nullptr. + * + * Requires VK_KHR_external_fence_win32 + */ + void set_exportable_nt_handle_info(const SECURITY_ATTRIBUTES* in_opt_attributes_ptr, + const DWORD& in_access, + const std::wstring& in_name) + { + anvil_assert(!m_exportable_nt_handle_info_specified); + + m_exportable_nt_handle_info.access = in_access; + m_exportable_nt_handle_info.attributes_ptr = in_opt_attributes_ptr; + m_exportable_nt_handle_info.name = in_name; + + m_exportable_nt_handle_info_specified = true; + } + #endif + + /* TODO + * + * Requires VK_KHR_external_fence. + */ + void set_exportable_external_fence_handle_types(const Anvil::ExternalFenceHandleTypeBits& in_external_fence_handle_types) + { + m_exportable_external_fence_handle_types = in_external_fence_handle_types; + } void set_device(const Anvil::BaseDevice* in_device_ptr) { @@ -78,9 +134,15 @@ namespace Anvil MTSafety in_mt_safety); /* Private variables */ - bool m_create_signalled; - const Anvil::BaseDevice* m_device_ptr; - Anvil::MTSafety m_mt_safety; + bool m_create_signalled; + const Anvil::BaseDevice* m_device_ptr; + Anvil::ExternalFenceHandleTypeBits m_exportable_external_fence_handle_types; + Anvil::MTSafety m_mt_safety; + + #ifdef _WIN32 + ExternalNTHandleInfo m_exportable_nt_handle_info; + bool m_exportable_nt_handle_info_specified; + #endif ANVIL_DISABLE_ASSIGNMENT_OPERATOR(FenceCreateInfo); ANVIL_DISABLE_COPY_CONSTRUCTOR(FenceCreateInfo); diff --git a/include/misc/image_create_info.h b/include/misc/image_create_info.h index 4cdf1f32..e101bf0c 100644 --- a/include/misc/image_create_info.h +++ b/include/misc/image_create_info.h @@ -254,7 +254,7 @@ namespace Anvil return m_device_ptr; } - const Anvil::ExternalMemoryHandleTypeFlags& get_external_memory_handle_types() const + const Anvil::ExternalMemoryHandleTypeBits& get_external_memory_handle_types() const { return m_external_memory_handle_types; } @@ -375,7 +375,7 @@ namespace Anvil m_depth = in_depth; } - void set_external_memory_handle_types(const ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) + void set_external_memory_handle_types(const ExternalMemoryHandleTypeBits& in_external_memory_handle_types) { m_external_memory_handle_types = in_external_memory_handle_types; } @@ -468,53 +468,53 @@ namespace Anvil private: /* Private functions */ - ImageCreateInfo(Anvil::ImageType in_type, - const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type_vk, - VkFormat in_format, - VkImageTiling in_tiling, - VkSharingMode in_sharing_mode, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - bool in_use_full_mipmap_chain, - ImageCreateFlags in_create_flags, - Anvil::QueueFamilyBits in_queue_families, - VkImageLayout in_post_create_image_layout, - const VkImageLayout& in_post_alloc_image_layout, - const std::vector* in_opt_mipmaps_ptr, - const Anvil::MTSafety& in_mt_safety, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types, - const Anvil::MemoryFeatureFlags& in_memory_features, - const Anvil::SparseResidencyScope& in_residency_scope); + ImageCreateInfo(Anvil::ImageType in_type, + const Anvil::BaseDevice* in_device_ptr, + VkImageType in_type_vk, + VkFormat in_format, + VkImageTiling in_tiling, + VkSharingMode in_sharing_mode, + VkImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + VkSampleCountFlagBits in_sample_count, + bool in_use_full_mipmap_chain, + ImageCreateFlags in_create_flags, + Anvil::QueueFamilyBits in_queue_families, + VkImageLayout in_post_create_image_layout, + const VkImageLayout& in_post_alloc_image_layout, + const std::vector* in_opt_mipmaps_ptr, + const Anvil::MTSafety& in_mt_safety, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types, + const Anvil::MemoryFeatureFlags& in_memory_features, + const Anvil::SparseResidencyScope& in_residency_scope); /* Private variables */ - Anvil::ImageCreateFlags m_create_flags; - uint32_t m_depth; - const Anvil::BaseDevice* m_device_ptr; - Anvil::ExternalMemoryHandleTypeFlags m_external_memory_handle_types; - VkFormat m_format; - uint32_t m_height; - Anvil::MemoryFeatureFlags m_memory_features; - std::vector m_mipmaps_to_upload; - Anvil::MTSafety m_mt_safety; - uint32_t m_n_layers; - VkImageLayout m_post_alloc_layout; - VkImageLayout m_post_create_layout; - Anvil::QueueFamilyBits m_queue_families; - Anvil::SparseResidencyScope m_residency_scope; - VkSampleCountFlags m_sample_count; - VkSharingMode m_sharing_mode; - VkImageTiling m_tiling; - const Anvil::ImageType m_type; - const VkImageType m_type_vk; - VkImageUsageFlags m_usage_flags; - bool m_use_full_mipmap_chain; - uint32_t m_width; + Anvil::ImageCreateFlags m_create_flags; + uint32_t m_depth; + const Anvil::BaseDevice* m_device_ptr; + Anvil::ExternalMemoryHandleTypeBits m_external_memory_handle_types; + VkFormat m_format; + uint32_t m_height; + Anvil::MemoryFeatureFlags m_memory_features; + std::vector m_mipmaps_to_upload; + Anvil::MTSafety m_mt_safety; + uint32_t m_n_layers; + VkImageLayout m_post_alloc_layout; + VkImageLayout m_post_create_layout; + Anvil::QueueFamilyBits m_queue_families; + Anvil::SparseResidencyScope m_residency_scope; + VkSampleCountFlags m_sample_count; + VkSharingMode m_sharing_mode; + VkImageTiling m_tiling; + const Anvil::ImageType m_type; + const VkImageType m_type_vk; + VkImageUsageFlags m_usage_flags; + bool m_use_full_mipmap_chain; + uint32_t m_width; /* Only used for swapchain wrapper images */ uint32_t m_n_swapchain_image; diff --git a/include/misc/memalloc_backends/backend_oneshot.h b/include/misc/memalloc_backends/backend_oneshot.h index 27e8eeb5..5ac7fa7d 100644 --- a/include/misc/memalloc_backends/backend_oneshot.h +++ b/include/misc/memalloc_backends/backend_oneshot.h @@ -61,14 +61,14 @@ namespace Anvil private: /* IMemoryAllocatorBackend functions */ - bool bake (Anvil::MemoryAllocator::Items& in_items) final; - VkResult map (void* in_memory_object, - VkDeviceSize in_start_offset, - VkDeviceSize in_size, - void** out_result_ptr) final; + bool bake (Anvil::MemoryAllocator::Items& in_items) final; + VkResult map (void* in_memory_object, + VkDeviceSize in_start_offset, + VkDeviceSize in_size, + void** out_result_ptr) final; bool supports_baking () const final; - bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const final; - void unmap (void* in_memory_object) final; + bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) const final; + void unmap (void* in_memory_object) final; /* Private functions */ diff --git a/include/misc/memalloc_backends/backend_vma.h b/include/misc/memalloc_backends/backend_vma.h index c19726c1..8877a8e2 100644 --- a/include/misc/memalloc_backends/backend_vma.h +++ b/include/misc/memalloc_backends/backend_vma.h @@ -123,14 +123,14 @@ namespace Anvil /* IMemoryAllocatorBackend functions */ - bool bake (Anvil::MemoryAllocator::Items& in_items) final; - VkResult map (void* in_memory_object, - VkDeviceSize in_start_offset, - VkDeviceSize in_size, - void** out_result_ptr); + bool bake (Anvil::MemoryAllocator::Items& in_items) final; + VkResult map (void* in_memory_object, + VkDeviceSize in_start_offset, + VkDeviceSize in_size, + void** out_result_ptr); bool supports_baking () const final; - bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const final; - void unmap (void* in_memory_object); + bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) const final; + void unmap (void* in_memory_object); /* Private variables */ const Anvil::BaseDevice* m_device_ptr; diff --git a/include/misc/memory_allocator.h b/include/misc/memory_allocator.h index 4cb1f7b9..33eb9f8c 100644 --- a/include/misc/memory_allocator.h +++ b/include/misc/memory_allocator.h @@ -69,15 +69,15 @@ namespace Anvil ItemType type; - Anvil::ExternalMemoryHandleTypeFlags alloc_external_memory_handle_types; - MemoryBlockUniquePtr alloc_memory_block_ptr; - uint32_t alloc_memory_final_type; - VkDeviceSize alloc_memory_required_alignment; - MemoryFeatureFlags alloc_memory_required_features; - uint32_t alloc_memory_supported_memory_types; - uint32_t alloc_memory_types; - VkDeviceSize alloc_offset; - VkDeviceSize alloc_size; + Anvil::ExternalMemoryHandleTypeBits alloc_external_memory_handle_types; + MemoryBlockUniquePtr alloc_memory_block_ptr; + uint32_t alloc_memory_final_type; + VkDeviceSize alloc_memory_required_alignment; + MemoryFeatureFlags alloc_memory_required_features; + uint32_t alloc_memory_supported_memory_types; + uint32_t alloc_memory_types; + VkDeviceSize alloc_offset; + VkDeviceSize alloc_size; VkExtent3D extent; bool is_baked; @@ -86,56 +86,56 @@ namespace Anvil VkOffset3D offset; VkImageSubresource subresource; - Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - Anvil::ExternalMemoryHandleTypeFlags in_alloc_external_memory_handle_types); - - Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_alloc_offset, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - Anvil::ExternalMemoryHandleTypeFlags in_alloc_external_memory_handle_types); - - Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - uint32_t in_n_layer, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_miptail_offset, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - Anvil::ExternalMemoryHandleTypeFlags in_alloc_external_memory_handle_types); - - Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - const VkExtent3D& in_extent, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - Anvil::ExternalMemoryHandleTypeFlags in_alloc_external_memory_handle_types); - - Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - Anvil::ExternalMemoryHandleTypeFlags in_alloc_external_memory_handle_types); + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + Anvil::ExternalMemoryHandleTypeBits in_alloc_external_memory_handle_types); + + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_alloc_offset, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + Anvil::ExternalMemoryHandleTypeBits in_alloc_external_memory_handle_types); + + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_layer, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_miptail_offset, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + Anvil::ExternalMemoryHandleTypeBits in_alloc_external_memory_handle_types); + + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + const VkExtent3D& in_extent, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + Anvil::ExternalMemoryHandleTypeBits in_alloc_external_memory_handle_types); + + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + Anvil::ExternalMemoryHandleTypeBits in_alloc_external_memory_handle_types); /** TODO */ ~Item(); @@ -160,8 +160,8 @@ namespace Anvil /* Stub */ } - virtual bool bake (Items& in_items) = 0; - virtual bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const = 0; + virtual bool bake (Items& in_items) = 0; + virtual bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) const = 0; }; /* Public functions */ @@ -189,39 +189,39 @@ namespace Anvil **/ bool add_buffer (Anvil::Buffer* in_buffer_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); bool add_buffer_with_float_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); bool add_buffer_with_float_data_vector_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); bool add_buffer_with_float_data_vector_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, const std::vector* in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); bool add_buffer_with_uchar8_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); bool add_buffer_with_uchar8_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); bool add_buffer_with_uint32_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); bool add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); bool add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, const std::vector* in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); /** TODO * @@ -237,11 +237,11 @@ namespace Anvil * * @return TODO */ - bool add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_offset, - VkDeviceSize in_size, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); + bool add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkDeviceSize in_size, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); /** Adds an Image object which should be assigned storage coming from memory objects * maintained by the Memory Allocator. At baking time, all subresources of the image, @@ -261,9 +261,9 @@ namespace Anvil * * @return true if the image has been successfully scheduled for baking, false otherwise. **/ - bool add_image_whole(Anvil::Image* in_image_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); + bool add_image_whole(Anvil::Image* in_image_ptr, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); /** Adds a new Image object whose layer @param in_n_layer 's miptail for @param in_aspect * aspect should be assigned a physical memory backing. The miptail will be bound a memory @@ -287,11 +287,11 @@ namespace Anvil * * @return true if the miptail has been successfully scheduled for baking, false otherwise. */ - bool add_sparse_image_miptail(Anvil::Image* in_image_ptr, - VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); + bool add_sparse_image_miptail(Anvil::Image* in_image_ptr, + VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); /** Adds a single subresource which should be assigned memory backing. * @@ -316,12 +316,12 @@ namespace Anvil * * @return true if the subresource has been successfully scheduled for baking, false otherwise. **/ - bool add_sparse_image_subresource(Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - VkExtent3D in_extent, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); + bool add_sparse_image_subresource(Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + VkExtent3D in_extent, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); /** TODO */ bool bake(); @@ -364,14 +364,14 @@ namespace Anvil private: /* Private functions */ - bool add_buffer_internal(Anvil::Buffer* in_buffer_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types); - - bool do_external_memory_handle_type_sanity_checks(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const; - bool is_alloc_supported (uint32_t in_memory_types, - Anvil::MemoryFeatureFlags in_memory_features, - uint32_t* out_opt_filtered_memory_types_ptr) const; + bool add_buffer_internal(Anvil::Buffer* in_buffer_ptr, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types); + + bool do_external_memory_handle_type_sanity_checks(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) const; + bool is_alloc_supported (uint32_t in_memory_types, + Anvil::MemoryFeatureFlags in_memory_features, + uint32_t* out_opt_filtered_memory_types_ptr) const; void on_is_alloc_pending_for_buffer_query(CallbackArgument* in_callback_arg_ptr); void on_is_alloc_pending_for_image_query (CallbackArgument* in_callback_arg_ptr); diff --git a/include/misc/memory_block_create_info.h b/include/misc/memory_block_create_info.h new file mode 100644 index 00000000..2441e797 --- /dev/null +++ b/include/misc/memory_block_create_info.h @@ -0,0 +1,317 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef MISC_MEMORY_BLOCK_CREATE_INFO_H +#define MISC_MEMORY_BLOCK_CREATE_INFO_H + +#include "misc/types.h" + + +namespace Anvil +{ + class MemoryBlockCreateInfo + { + public: + /* Public functions */ + + /** Spawns a create info instance which can be used to instantiate a memory block whose storage space is maintained + * by another MemoryBlock instance. + * + * @param in_parent_memory_block_ptr MemoryBlock instance to use as a parent. Must not be nullptr. + * Parent memory block must not be mapped. + * @param in_start_offset Start offset of the storage maintained by the specified parent memory block, + * from which the new MemoryBlock instance's storage should start. + * Must not be equal to or larger than parent object's storage size. + * When added to @param in_size, the result value must not be be larger than the remaining + * storage size. + * @param in_size Region size to use for the derived memory block. + **/ + static MemoryBlockCreateInfoUniquePtr create_derived(MemoryBlock* in_parent_memory_block_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size); + + /** Spawns a create info instance which can be used to instantiate a memory block whose lifetime is maintained by a separate + * entity. While the memory block remains reference-counted as usual, the destruction process is carried out by an external + * party via the specified call-back. + * + * This implements a special case required for support of Vulkan Memory Allocator memory allocator backend. Applications + * are very unlikely to ever need to use this create() function. + * + * NOTE: The following parameters take the following default values: + * + * - Exportable external memory handle types: Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE + * - Importable external memory handle type: Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE + * + * These can be further adjusted by callingt corresponding set_..() functions prior to passing the CreateInfo instance + * to MemoryBlock::create(). + * + * TODO + */ + static MemoryBlockCreateInfoUniquePtr create_derived_with_custom_delete_proc(const Anvil::BaseDevice* in_device_ptr, + VkDeviceMemory in_memory, + uint32_t in_allowed_memory_bits, + Anvil::MemoryFeatureFlags in_memory_features, + uint32_t in_memory_type_index, + VkDeviceSize in_size, + VkDeviceSize in_start_offset, + OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function); + + /** Spawns a create info instance which can be used to instantiate a new memory block. + * + * NOTE: The following parameters take the following defautl values: + * + * - Exportable external memory handle types: Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE + * - Importable external memory handle type: Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE. + * + * These can be further adjusted by callingt corresponding set_..() functions prior to passing the CreateInfo instance + * to MemoryBlock::create(). + * + * @param in_device_ptr Device to use. + * @param in_allowed_memory_bits Memory type bits which meet the allocation requirements. + * @param in_size Required allocation size. + * @param in_memory_features Required memory features. + **/ + static MemoryBlockCreateInfoUniquePtr create_regular(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_allowed_memory_bits, + VkDeviceSize in_size, + Anvil::MemoryFeatureFlags in_memory_features); + + const uint32_t& get_allowed_memory_bits() const + { + return m_allowed_memory_bits; + } + + const Anvil::BaseDevice* get_device() const + { + return m_device_ptr; + } + + const Anvil::ExternalMemoryHandleTypeBits& get_exportable_external_memory_handle_types() const + { + return m_exportable_external_memory_handle_types; + } + + /* Returns true if set_external_handle_import_info() has been called prior to this call. + * Otherwise returns false. + * + * If the func returns true, *out_result_ptr is set to the queried data. + */ + bool get_external_handle_import_info(const ExternalMemoryHandleImportInfo** out_result_ptr_ptr) const + { + bool result = false; + + if (m_external_handle_import_info_specified) + { + *out_result_ptr_ptr = &m_external_handle_import_info; + result = true; + } + + return result; + } + + #if defined(_WIN32) + /* Returns true if set_external_nt_handle_import_info() has been called prior to this call. + * Otherwise returns false. + * + * If the func returns true, *out_result_ptr is set to the queried data. + */ + bool get_external_nt_handle_import_info(const ExternalNTHandleInfo** out_result_ptr_ptr) const + { + bool result = false; + + if (m_external_nt_handle_import_info_specified) + { + *out_result_ptr_ptr = &m_external_nt_handle_import_info; + result = true; + } + + return result; + } + #endif + + const Anvil::ExternalMemoryHandleTypeBit& get_imported_external_memory_handle_type() const + { + return m_imported_external_memory_handle_type; + } + + VkDeviceMemory get_memory() const + { + anvil_assert(m_type == Anvil::MemoryBlockType::DERIVED_WITH_CUSTOM_DELETE_PROC); + + return m_memory; + } + + /** Returns memory features of the underlying memory region */ + Anvil::MemoryFeatureFlags get_memory_features() const; + + /** Returns the memory type index the memory block was allocated from */ + uint32_t get_memory_type_index() const; + + const Anvil::MTSafety& get_mt_safety() const + { + return m_mt_safety; + } + + const Anvil::OnMemoryBlockReleaseCallbackFunction& get_on_release_callback_function() const + { + return m_on_release_callback_function; + } + + /* Returns parent memory block, if one has been defined for this instance */ + Anvil::MemoryBlock* get_parent_memory_block() const + { + return m_parent_memory_block_ptr; + } + + /* Returns the size of the memory block. */ + VkDeviceSize get_size() const + { + return m_size; + } + + /* Returns the start offset of the memory block. + * + * If the memory block has a parent, the returned start offset is NOT relative to the parent memory block's + * start offset (in other words: the returned value is an absolute offset which can be directly used against + * the memory block instance) + */ + VkDeviceSize get_start_offset() const + { + return m_start_offset; + } + + const Anvil::MemoryBlockType& get_type() const + { + return m_type; + } + + /* Requires VK_KHR_external_memory */ + void set_exportable_external_memory_handle_types(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) + { + m_exportable_external_memory_handle_types = in_external_memory_handle_types; + } + + /* Lets the app specify imported handle details. + * + * Under Windows, if @param in_name is zero-sized, member of the VkImportMemoryWin32HandleInfoKHR struct, as chained to the VkMemoryAllocateInfo struct chain, + * will be set to nullptr. + * + * NOTE: For NT handles, you also need to call set_external_nt_handle_import_info(). + * + * Requires VK_KHR_external_memory_fd under Windows. + * Requires VK_KHR_external_memory_win32 under Windows. + */ + #if defined(_WIN32) + void set_external_handle_import_info(ExternalHandleType in_handle, + const std::wstring& in_name) + #else + void set_external_handle_import_info(ExternalHandleType in_handle) + #endif + { + anvil_assert(!m_external_handle_import_info_specified); + + m_external_handle_import_info.handle = in_handle; + + #if defined(_WIN32) + { + m_external_handle_import_info.name = in_name; + } + #endif + + m_external_handle_import_info_specified = true; + } + + #if defined(_WIN32) + /* Lets the app specify additional details for exportable NT handles. + * + * If @param in_name is zero-sized, member of the VkExportMemoryWin32HandleInfoKHR struct, as chained to the VkMemoryAllocateInfo struct chain, + * will be set to nullptr. + * + * Requires VK_KHR_external_memory_win32 + */ + void set_external_nt_handle_import_info(const SECURITY_ATTRIBUTES* in_opt_attributes_ptr, + const DWORD& in_access, + const std::wstring& in_name) + { + anvil_assert(!m_external_nt_handle_import_info_specified); + + m_external_nt_handle_import_info.access = in_access; + m_external_nt_handle_import_info.attributes_ptr = in_opt_attributes_ptr; + m_external_nt_handle_import_info.name = in_name; + + m_external_nt_handle_import_info_specified = true; + } + #endif + + void set_imported_external_memory_handle_type(const Anvil::ExternalMemoryHandleTypeBit& in_memory_handle_type) + { + m_imported_external_memory_handle_type = in_memory_handle_type; + } + + void set_mt_safety(const Anvil::MTSafety& in_mt_safety) + { + m_mt_safety = in_mt_safety; + } + + private: + MemoryBlockCreateInfo(const Anvil::MemoryBlockType& in_type, + const uint32_t& in_allowed_memory_bits, + const Anvil::BaseDevice* in_device_ptr, + VkDeviceMemory in_memory, + const Anvil::MemoryFeatureFlags& in_memory_features, + const uint32_t& in_memory_type_index, + const uint32_t& in_n_physical_devices, + const Anvil::OnMemoryBlockReleaseCallbackFunction& in_on_release_callback_function, + const Anvil::PhysicalDevice* const* in_opt_physical_device_ptr_ptr, + Anvil::MemoryBlock* in_parent_memory_block_ptr, + const VkDeviceSize& in_size, + const VkDeviceSize& in_start_offset); + + uint32_t m_allowed_memory_bits; + const Anvil::BaseDevice* m_device_ptr; + Anvil::ExternalMemoryHandleTypeBits m_exportable_external_memory_handle_types; + Anvil::ExternalMemoryHandleTypeBit m_imported_external_memory_handle_type; + VkDeviceMemory m_memory; + Anvil::MemoryFeatureFlags m_memory_features; + uint32_t m_memory_type_index; + Anvil::MTSafety m_mt_safety; + Anvil::OnMemoryBlockReleaseCallbackFunction m_on_release_callback_function; + Anvil::MemoryBlock* m_parent_memory_block_ptr; + std::vector m_physical_devices; + VkDeviceSize m_size; + VkDeviceSize m_start_offset; + const Anvil::MemoryBlockType m_type; + + #ifdef _WIN32 + ExternalNTHandleInfo m_external_nt_handle_import_info; + bool m_external_nt_handle_import_info_specified; + #endif + + ExternalMemoryHandleImportInfo m_external_handle_import_info; + bool m_external_handle_import_info_specified; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(MemoryBlockCreateInfo); + ANVIL_DISABLE_COPY_CONSTRUCTOR(MemoryBlockCreateInfo); + }; +} /* namespace Anvil */ + +#endif /* MISC_MEMORY_BLOCK_CREATE_INFO_H */ \ No newline at end of file diff --git a/include/misc/semaphore_create_info.h b/include/misc/semaphore_create_info.h index 8ca608cd..5968fbf0 100644 --- a/include/misc/semaphore_create_info.h +++ b/include/misc/semaphore_create_info.h @@ -30,14 +30,26 @@ namespace Anvil { public: /* Public functions */ - static Anvil::SemaphoreCreateInfoUniquePtr create(const Anvil::BaseDevice* in_device_ptr, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + + /* TODO. + * + * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: + * + * - Exportable external semaphore handle type: none + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + */ + static Anvil::SemaphoreCreateInfoUniquePtr create(const Anvil::BaseDevice* in_device_ptr); const Anvil::BaseDevice* get_device() const { return m_device_ptr; } + const Anvil::ExternalSemaphoreHandleTypeBits& get_exportable_external_semaphore_handle_types() const + { + return m_exportable_external_semaphore_handle_types; + } + const MTSafety& get_mt_safety() const { return m_mt_safety; @@ -48,6 +60,15 @@ namespace Anvil m_device_ptr = in_device_ptr; } + /* TODO + * + * Requires VK_KHR_external_semaphore. + */ + void set_exportable_external_semaphore_handle_types(const Anvil::ExternalFenceHandleTypeBits& in_external_handle_types) + { + m_exportable_external_semaphore_handle_types = in_external_handle_types; + } + void set_mt_safety(const MTSafety& in_mt_safety) { m_mt_safety = in_mt_safety; @@ -59,8 +80,9 @@ namespace Anvil MTSafety in_mt_safety); /* Private variables */ - const Anvil::BaseDevice* m_device_ptr; - Anvil::MTSafety m_mt_safety; + const Anvil::BaseDevice* m_device_ptr; + Anvil::ExternalSemaphoreHandleTypeBits m_exportable_external_semaphore_handle_types; + Anvil::MTSafety m_mt_safety; ANVIL_DISABLE_ASSIGNMENT_OPERATOR(SemaphoreCreateInfo); ANVIL_DISABLE_COPY_CONSTRUCTOR(SemaphoreCreateInfo); diff --git a/include/misc/types.h b/include/misc/types.h index e4dfc8f2..1217e2dd 100644 --- a/include/misc/types.h +++ b/include/misc/types.h @@ -128,6 +128,7 @@ namespace Anvil class DescriptorSetLayout; class DescriptorSetLayoutManager; class DescriptorUpdateTemplate; + class ExternalHandle; class Event; class EventCreateInfo; class Fence; @@ -144,6 +145,7 @@ namespace Anvil class Instance; class MemoryAllocator; class MemoryBlock; + class MemoryBlockCreateInfo; struct MemoryHeap; struct MemoryProperties; struct MemoryType; @@ -185,6 +187,7 @@ namespace Anvil typedef std::unique_ptr > DescriptorSetLayoutManagerUniquePtr; typedef std::unique_ptr > DescriptorSetUniquePtr; typedef std::unique_ptr > DescriptorUpdateTemplateUniquePtr; + typedef std::unique_ptr > ExternalHandleUniquePtr; typedef std::unique_ptr EventCreateInfoUniquePtr; typedef std::unique_ptr > EventUniquePtr; typedef std::unique_ptr FenceCreateInfoUniquePtr; @@ -200,6 +203,7 @@ namespace Anvil typedef std::unique_ptr > ImageViewUniquePtr; typedef std::unique_ptr > InstanceUniquePtr; typedef std::unique_ptr > MemoryAllocatorUniquePtr; + typedef std::unique_ptr MemoryBlockCreateInfoUniquePtr; typedef std::unique_ptr > MemoryBlockUniquePtr; typedef std::unique_ptr > PipelineCacheUniquePtr; typedef std::unique_ptr > PipelineLayoutManagerUniquePtr; @@ -222,9 +226,15 @@ namespace Anvil typedef std::unique_ptr > WindowUniquePtr; }; -/* Defines various enums used by Vulkan API wrapper classes. */ +/* Defines various types used by Vulkan API wrapper classes. */ namespace Anvil { + #if defined(_WIN32) + typedef HANDLE ExternalHandleType; + #else + typedef int ExternalHandleType; + #endif + /** ID of an Anvil framebuffer's attachment */ typedef uint32_t FramebufferAttachmentID; @@ -235,6 +245,9 @@ namespace Anvil typedef std::pair BindingElementArrayRange; + /** "About to be deleted" call-back function prototype. */ + typedef std::function OnMemoryBlockReleaseCallbackFunction; + /** Base pipeline ID. Internal type, used to represent compute / graphics pipeline IDs */ typedef uint32_t PipelineID; diff --git a/include/misc/types_enums.h b/include/misc/types_enums.h index 38d21396..e89262fb 100644 --- a/include/misc/types_enums.h +++ b/include/misc/types_enums.h @@ -39,6 +39,14 @@ namespace Anvil ATTACHMENT_TYPE_UNKNOWN = ATTACHMENT_TYPE_COUNT }; + enum BufferCreateFlagBits + { + BUFFER_CREATE_FLAG_SPARSE_BINDING_BIT = 1 << 0, + BUFFER_CREATE_FLAG_SPARSE_RESIDENCY_BIT = 1 << 1, + BUFFER_CREATE_FLAG_SPARSE_ALIASED_BIT = 1 << 2, + }; + typedef uint32_t BufferCreateFlags; + typedef enum class BufferType { NONSPARSE_ALLOC, @@ -63,10 +71,52 @@ namespace Anvil typedef enum { - /* todo .. */ + EXTERNAL_FENCE_HANDLE_TYPE_NONE = 0, + + #if defined(_WIN32) + EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT = 1 << 0, + EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 1 << 1, + #else + EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT = 1 << 2, + EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT = 1 << 2, + #endif + + } ExternalFenceHandleTypeBit; + typedef uint32_t ExternalFenceHandleTypeBits; + + typedef enum + { + EXTERNAL_MEMORY_HANDLE_TYPE_NONE = 0, + + #if defined(_WIN32) + EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT = 1 << 0, + EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 1 << 1, + EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT = 1 << 2, + EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT = 1 << 3, + EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT = 1 << 4, + EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT = 1 << 5, + #else + EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT = 1 << 6, + #endif + + } ExternalMemoryHandleTypeBit; + typedef uint32_t ExternalMemoryHandleTypeBits; + + typedef enum + { + EXTERNAL_SEMAPHORE_HANDLE_TYPE_NONE = 0, - } ExternalMemoryHandleTypeFlag; - typedef uint32_t ExternalMemoryHandleTypeFlags; + #if defined(_WIN32) + EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT = 1 << 0, + EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 1 << 1, + EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT = 1 << 2, + #else + EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT = 1 << 3, + EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT = 1 << 4, + #endif + + } ExternalSemaphoreHandleTypeBit; + typedef uint32_t ExternalSemaphoreHandleTypeBits; /** Describes component layout of a format */ typedef enum @@ -205,6 +255,14 @@ namespace Anvil SWAPCHAIN_WRAPPER } ImageType; + typedef enum class MemoryBlockType + { + DERIVED, + DERIVED_WITH_CUSTOM_DELETE_PROC, + REGULAR + + } MemoryBlockType; + enum MemoryFeatureFlagBits { /* NOTE: If more memory feature flags are added here, make sure to also update Anvil::Utils::get_vk_property_flags_from_memory_feature_flags() @@ -322,6 +380,30 @@ namespace Anvil UNDEFINED = COUNT }; + typedef enum + { + /* Implementation should wait for each query's status to become available before retrieving its results + * + * Core VK 1.0 functionality + */ + QUERY_RESULT_WAIT_BIT = 1 << 0, + + /* Each query result value is going to be followed by a status value. Non-zero values indicate result is + * available. + * + * Core VK 1.0 functionality + */ + QUERY_RESULT_WITH_AVAILABILITY_BIT = 1 << 1, + + /* Indicates it is OK for the function to return result values for a sub-range of the requested query range. + * + * Core VK 1.0 frunctionality + */ + QUERY_RESULT_PARTIAL_BIT = 1 << 2, + + } QueryResultBit; + typedef uint32_t QueryResultBits; + /* Specifies one of the compute / rendering pipeline stages. */ typedef enum { diff --git a/include/misc/types_struct.h b/include/misc/types_struct.h index e7bf2c1d..cd4ccc19 100644 --- a/include/misc/types_struct.h +++ b/include/misc/types_struct.h @@ -24,6 +24,48 @@ namespace Anvil { + typedef struct ExternalFenceProperties + { + Anvil::ExternalFenceHandleTypeBits compatible_external_handle_types; + Anvil::ExternalFenceHandleTypeBits export_from_imported_external_handle_types; + + bool is_exportable; + bool is_importable; + + /* Dummy constructor */ + ExternalFenceProperties(); + + ExternalFenceProperties(const VkExternalFencePropertiesKHR& in_external_memory_props); + } ExternalFenceProperties; + + typedef struct ExternalMemoryProperties + { + Anvil::ExternalMemoryHandleTypeBits compatible_external_handle_types; + Anvil::ExternalMemoryHandleTypeBits export_from_imported_external_handle_types; + + bool is_exportable; + bool is_importable; + + /* Dummy constructor */ + ExternalMemoryProperties(); + + ExternalMemoryProperties(const VkExternalMemoryPropertiesKHR& in_external_memory_props); + } ExternalMemoryProperties; + + typedef struct ExternalSemaphoreProperties + { + Anvil::ExternalSemaphoreHandleTypeBits compatible_external_handle_types; + Anvil::ExternalSemaphoreHandleTypeBits export_from_imported_external_handle_types; + + bool is_exportable; + bool is_importable; + + /* Dummy constructor */ + ExternalSemaphoreProperties(); + + ExternalSemaphoreProperties(const VkExternalSemaphorePropertiesKHR& in_external_memory_props); + } ExternalSemaphoreProperties; + /* Holds shader core properties pertaining to a physical device */ typedef struct AMDShaderCoreProperties { @@ -124,17 +166,54 @@ namespace Anvil BufferBarrier& operator=(const BufferBarrier&); } BufferBarrier; - typedef struct BufferMemoryBindingUpdate + typedef struct BufferFormatProperties { - Anvil::Buffer* buffer_ptr; - bool memory_block_owned_by_buffer; - Anvil::MemoryBlock* memory_block_ptr; + ExternalMemoryProperties external_handle_properties; - /* May either be empty or hold the physical device, from which the logical device has been created */ - std::vector physical_devices; + BufferFormatProperties(); + BufferFormatProperties(const ExternalMemoryProperties& in_external_handle_properties); - BufferMemoryBindingUpdate(); - } BufferMemoryBindingUpdate; + BufferFormatProperties (const BufferFormatProperties&) = default; + BufferFormatProperties& operator=(const BufferFormatProperties&) = default; + } BufferFormatProperties; + + typedef struct BufferFormatPropertiesQuery + { + const Anvil::BufferCreateFlags create_flags; + const Anvil::ExternalMemoryHandleTypeBit external_memory_handle_type; + const VkFormat format; + const VkBufferUsageFlags usage_flags; + + explicit BufferFormatPropertiesQuery(const Anvil::BufferCreateFlags in_create_flags, + const Anvil::ExternalMemoryHandleTypeBit& in_external_memory_handle_type, + const VkFormat& in_format, + const VkBufferUsageFlags& in_usage_flags) + :create_flags (in_create_flags), + external_memory_handle_type(in_external_memory_handle_type), + format (in_format), + usage_flags (in_usage_flags) + { + /* Stub */ + } + + BufferFormatPropertiesQuery (const BufferFormatPropertiesQuery& in_query) = default; + BufferFormatPropertiesQuery& operator=(const BufferFormatPropertiesQuery& in_query) = delete; + } BufferFormatPropertiesQuery; + + #if defined(_WIN32) + typedef struct ExternalNTHandleInfo + { + DWORD access; + const SECURITY_ATTRIBUTES* attributes_ptr; + std::wstring name; + + ExternalNTHandleInfo() + { + access = 0; + attributes_ptr = nullptr; + } + } ExternalNTHandleInfo; + #endif typedef struct EXTDescriptorIndexingFeatures { @@ -307,6 +386,77 @@ namespace Anvil ExtensionKHRDescriptorUpdateTemplateEntrypoints(); } ExtensionKHRDescriptorUpdateTemplateEntrypoints; + typedef struct ExtensionKHRExternalFenceCapabilitiesEntrypoints + { + PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR vkGetPhysicalDeviceExternalFencePropertiesKHR; + + ExtensionKHRExternalFenceCapabilitiesEntrypoints(); + } ExtensionKHRExternalFenceCapabilitiesEntrypoints; + + typedef struct ExtensionKHRExternalMemoryCapabilitiesEntrypoints + { + PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR vkGetPhysicalDeviceExternalBufferPropertiesKHR; + + ExtensionKHRExternalMemoryCapabilitiesEntrypoints(); + } ExtensionKHRExternalMemoryCapabilitiesEntrypoints; + + typedef struct ExtensionKHRExternalSemaphoreCapabilitiesEntrypoints + { + PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR vkGetPhysicalDeviceExternalSemaphorePropertiesKHR; + + ExtensionKHRExternalSemaphoreCapabilitiesEntrypoints(); + } ExtensionKHRExternalSemaphoreCapabilitiesEntrypoints; + + #if defined(_WIN32) + typedef struct ExtensionKHRExternalFenceWin32Entrypoints + { + PFN_vkGetFenceWin32HandleKHR vkGetFenceWin32HandleKHR; + PFN_vkImportFenceWin32HandleKHR vkImportFenceWin32HandleKHR; + + ExtensionKHRExternalFenceWin32Entrypoints(); + } ExtensionKHRExternalFenceWin32Entrypoints; + + typedef struct ExtensionKHRExternalMemoryWin32Entrypoints + { + PFN_vkGetMemoryWin32HandleKHR vkGetMemoryWin32HandleKHR; + PFN_vkGetMemoryWin32HandlePropertiesKHR vkGetMemoryWin32HandlePropertiesKHR; + + ExtensionKHRExternalMemoryWin32Entrypoints(); + } ExtensionKHRExternalMemoryWin32Entrypoints; + + typedef struct ExtensionKHRExternalSemaphoreWin32Entrypoints + { + PFN_vkGetSemaphoreWin32HandleKHR vkGetSemaphoreWin32HandleKHR; + PFN_vkImportSemaphoreWin32HandleKHR vkImportSemaphoreWin32HandleKHR; + + ExtensionKHRExternalSemaphoreWin32Entrypoints(); + } ExtensionKHRExternalSemaphoreWin32Entrypoints; +#else + typedef struct ExtensionKHRExternalFenceFdEntrypoints + { + PFN_vkGetFenceFdKHR vkGetFenceFdKHR; + PFN_vkImportFenceFdKHR vkImportFenceFdKHR; + + ExtensionKHRExternalFenceFdEntrypoints(); + } ExtensionKHRExternalFenceFdEntrypoints; + + typedef struct ExtensionKHRExternalMemoryFdEntrypoints + { + PFN_vkGetMemoryFdKHR vkGetMemoryFdKHR; + PFN_vkGetMemoryFdPropertiesKHR vkGetMemoryFdPropertiesKHR; + + ExtensionKHRExternalMemoryFdEntrypoints(); + } ExtensionKHRExternalMemoryFdEntrypoints; + + typedef struct ExtensionKHRExternalSemaphoreFdEntrypoints + { + PFN_vkGetSemaphoreFdKHR vkGetSemaphoreFdKHR; + PFN_vkImportSemaphoreFdKHR vkImportSemaphoreFdKHR; + + ExtensionKHRExternalSemaphoreFdEntrypoints(); + } ExtensionKHRExternalSemaphoreFdEntrypoints; +#endif + typedef struct ExtensionKHRGetPhysicalDeviceProperties2 { PFN_vkGetPhysicalDeviceFeatures2KHR vkGetPhysicalDeviceFeatures2KHR; @@ -384,28 +534,104 @@ namespace Anvil ExtensionKHRDeviceGroupCreationEntrypoints(); } ExtensionKHRDeviceGroupCreationEntrypoints; - /** Holds driver-specific format capabilities */ + typedef struct FenceProperties + { + ExternalFenceProperties external_fence_properties; + + /* Dummy constructor */ + FenceProperties(); + + FenceProperties(const ExternalFenceProperties& in_external_fence_properties); + } FenceProperties; + + typedef struct FencePropertiesQuery + { + const Anvil::ExternalFenceHandleTypeBit external_fence_handle_type; + + explicit FencePropertiesQuery(const Anvil::ExternalFenceHandleTypeBit& in_external_fence_handle_type) + :external_fence_handle_type(in_external_fence_handle_type) + { + /* Stub */ + } + + FencePropertiesQuery (const FencePropertiesQuery&) = default; + FencePropertiesQuery& operator=(const FencePropertiesQuery&) = delete; + } FencePropertiesQuery; + typedef struct FormatProperties { VkFormatFeatureFlagsVariable(buffer_capabilities); VkFormatFeatureFlagsVariable(linear_tiling_capabilities); VkFormatFeatureFlagsVariable(optimal_tiling_capabilities); + FormatProperties(); + FormatProperties(const VkFormatProperties& in_format_props); + } FormatProperties; + + typedef struct ImageFormatProperties + { + ExternalMemoryProperties external_handle_properties; + + VkExtent3D max_extent; + VkDeviceSize max_resource_size; + uint32_t n_max_array_layers; + uint32_t n_max_mip_levels; + VkSampleCountFlags sample_counts; + /* Tells whether the format can be used with functions introduced in VK_AMD_texture_gather_bias_lod */ bool supports_amd_texture_gather_bias_lod; + /** Dummy constructor */ - FormatProperties(); + ImageFormatProperties(); /** Constructor. Initializes the instance using data provided by the driver. * * @param in_format_props Vulkan structure to use for initialization. **/ - FormatProperties(const VkFormatProperties& in_format_props); - } FormatProperties; + ImageFormatProperties(const VkImageFormatProperties& in_image_format_props, + const bool& in_supports_amd_texture_gather_bias_lod, + const ExternalMemoryProperties& in_external_handle_properties); + } ImageFormatProperties; + + typedef struct ImageFormatPropertiesQuery + { + /* TODO + * + * NOTE: In order to retrieve information regarding device's external handle support for a particular image + * configuration, make sure to call ImageFormatPropertiesQuery::set_external_memory_handle_type(), prior + * to passing the struct instance as an arg to get_image_format_properties(). + */ + explicit ImageFormatPropertiesQuery(const VkFormat& in_format, + const VkImageType& in_image_type, + const VkImageTiling& in_tiling, + const VkImageUsageFlags& in_usage_flags, + const VkImageCreateFlags& in_create_flags) + :create_flags (in_create_flags), + external_memory_handle_type(EXTERNAL_MEMORY_HANDLE_TYPE_NONE), + format (in_format), + image_type (in_image_type), + tiling (in_tiling), + usage_flags (in_usage_flags) + { + /* Stub */ + } + + void set_external_memory_handle_type(const Anvil::ExternalMemoryHandleTypeBit& in_external_memory_handle_type) + { + external_memory_handle_type = in_external_memory_handle_type; + } + + const VkImageCreateFlags create_flags; + Anvil::ExternalMemoryHandleTypeBit external_memory_handle_type; + const VkFormat format; + const VkImageType image_type; + const VkImageTiling tiling; + const VkImageUsageFlags usage_flags; - extern bool operator==(const FormatProperties& in1, - const FormatProperties& in2); + ImageFormatPropertiesQuery (const ImageFormatPropertiesQuery& in_query) = default; + ImageFormatPropertiesQuery& operator=(const ImageFormatPropertiesQuery& in_query) = delete; + } ImageFormatPropertiesQuery; /** Describes an image memory barrier. */ typedef struct ImageBarrier @@ -487,6 +713,24 @@ namespace Anvil ImageBarrier& operator=(const ImageBarrier&); } ImageBarrier; + typedef struct ExternalMemoryHandleImportInfo + { + ExternalHandleType handle; + + #if defined(_WIN32) + std::wstring name; + #endif + + ExternalMemoryHandleImportInfo() + { + #if defined(_WIN32) + handle = nullptr; + #else + handle = -1; + #endif + } + } ExternalMemoryHandleImportInfo; + /* Holds 16-bit storage features */ typedef struct KHR16BitStorageFeatures { @@ -503,6 +747,20 @@ namespace Anvil bool operator==(const KHR16BitStorageFeatures& in_features) const; } KHR16BitStorageFeatures; + typedef struct KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties + { + uint8_t device_luid[VK_LUID_SIZE]; + bool device_luid_valid; + + uint8_t device_uuid[VK_UUID_SIZE]; + uint8_t driver_uuid[VK_UUID_SIZE]; + + uint32_t device_node_mask; + + KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties(); + KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties(const VkPhysicalDeviceIDPropertiesKHR& in_properties); + } KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties; + typedef struct KHRMaintenance3Properties { VkDeviceSize max_memory_allocation_size; @@ -1015,7 +1273,7 @@ namespace Anvil bool independent_blend; bool inherited_queries; bool large_points; - bool logic_ip; + bool logic_op; bool multi_draw_indirect; bool multi_viewport; bool occlusion_query_precise; @@ -1229,16 +1487,18 @@ namespace Anvil typedef struct PhysicalDeviceProperties { - const AMDShaderCoreProperties* amd_shader_core_properties_ptr; - const PhysicalDevicePropertiesCoreVK10* core_vk1_0_properties_ptr; - const EXTDescriptorIndexingProperties* ext_descriptor_indexing_properties_ptr; - const KHRMaintenance3Properties* khr_maintenance3_properties_ptr; + const AMDShaderCoreProperties* amd_shader_core_properties_ptr; + const PhysicalDevicePropertiesCoreVK10* core_vk1_0_properties_ptr; + const EXTDescriptorIndexingProperties* ext_descriptor_indexing_properties_ptr; + const KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties* khr_external_memory_capabilities_physical_device_id_properties_ptr; + const KHRMaintenance3Properties* khr_maintenance3_properties_ptr; PhysicalDeviceProperties(); - PhysicalDeviceProperties(const AMDShaderCoreProperties* in_amd_shader_core_properties_ptr, - const PhysicalDevicePropertiesCoreVK10* in_core_vk1_0_properties_ptr, - const EXTDescriptorIndexingProperties* in_ext_descriptor_indexing_properties_ptr, - const KHRMaintenance3Properties* in_khr_maintenance3_properties_ptr); + PhysicalDeviceProperties(const AMDShaderCoreProperties* in_amd_shader_core_properties_ptr, + const PhysicalDevicePropertiesCoreVK10* in_core_vk1_0_properties_ptr, + const EXTDescriptorIndexingProperties* in_ext_descriptor_indexing_properties_ptr, + const KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties* in_khr_external_memory_caps_physical_device_id_props_ptr, + const KHRMaintenance3Properties* in_khr_maintenance3_properties_ptr); bool operator==(const PhysicalDeviceProperties& in_props) const; } PhysicalDeviceProperties; @@ -1296,6 +1556,30 @@ namespace Anvil explicit PhysicalDeviceGroup(); } PhysicalDeviceGroup; + typedef struct SemaphoreProperties + { + ExternalSemaphoreProperties external_semaphore_properties; + + /* Dummy constructor */ + SemaphoreProperties(); + + SemaphoreProperties(const ExternalSemaphoreProperties& in_external_semaphore_properties); + } SemaphoreProperties; + + typedef struct SemaphorePropertiesQuery + { + const Anvil::ExternalSemaphoreHandleTypeBit external_semaphore_handle_type; + + explicit SemaphorePropertiesQuery(const Anvil::ExternalSemaphoreHandleTypeBit& in_external_semaphore_handle_type) + :external_semaphore_handle_type(in_external_semaphore_handle_type) + { + /* Stub */ + } + + SemaphorePropertiesQuery (const SemaphorePropertiesQuery&) = default; + SemaphorePropertiesQuery& operator=(const SemaphorePropertiesQuery&) = delete; + } SemaphorePropertiesQuery; + /** Holds all information related to a specific shader module stage entry-point. */ typedef struct ShaderModuleStageEntryPoint { @@ -1367,6 +1651,296 @@ namespace Anvil typedef std::vector SpecializationConstants; + typedef enum class SubmissionType + { + SGPU + } SubmissionType; + + typedef struct SubmitInfo + { + /** Creates a submission info which, when submitted, waits on the semaphores specified by the user, + * executes user-defined command buffers, and then signals the semaphores passed by arguments. + * If a non-nullptr fence is specified, the function will also wait on the call to finish GPU-side + * before returning. + * + * It is valid to specify 0 command buffers or signal/wait semaphores, in which case + * these steps will be skipped. + * + * If @param in_should_block is true and @param in_opt_fence_ptr is nullptr, the function will create + * a new fence, wait on it, and then release it prior to leaving. This may come at a performance cost. + * + * NOTE: By default, the following values are associated with a new SubmitInfo instance: + * + * - D3D12 fence submit info: none + * + * To adjust these settings, please use corresponding set_..() functions, prior to passing the structure over to Queue::submit(). + * + * + * @param in_n_command_buffers Number of command buffers under @param in_opt_cmd_buffer_ptrs + * which should be executed. May be 0. + * @param in_opt_cmd_buffer_ptrs_ptr Ptr to an array of command buffers to execute. Can be nullptr if + * @param n_command_buffers is 0. + * @param in_n_semaphores_to_signal Number of semaphores to signal after command buffers finish + * executing. May be 0. + * @param in_opt_semaphore_to_signal_ptrs_ptr Ptr to an array of semaphores to signal after execution. May be nullptr if + * @param n_semaphores_to_signal is 0. + * @param in_n_semaphores_to_wait_on Number of semaphores to wait on before executing command buffers. + * May be 0. + * @param in_opt_semaphore_to_wait_on_ptrs_ptr Ptr to an array of semaphores to wait on prior to execution. May be nullptr + * if @param in_n_semaphores_to_wait_on is 0. + * @param in_opt_dst_stage_masks_to_wait_on_ptrs Array of size @param in_n_semaphores_to_wait_on, specifying stages + * at which the wait ops should be performed. May be nullptr if + * @param n_semaphores_to_wait_on is 0. + * @param in_should_block true if the function should wait for the scheduled commands to + * finish executing, false otherwise. + * @param in_opt_fence_ptr Fence to use when submitting the comamnd buffers to the queue. + * The fence will be waited on if @param in_should_block is true. + * If @param in_should_block is false, the fence will be passed at + * submit call time, but will not be waited on. + * + * @param in_command_buffer_submissions TODO + * @param in_semaphores_to_signal_ptr TODO + * @param in_semaphores_to_wait_on_ptr TODO + **/ + + static SubmitInfo create(Anvil::CommandBufferBase* in_opt_cmd_buffer_ptr, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr); + static SubmitInfo create(uint32_t in_n_cmd_buffers, + Anvil::CommandBufferBase* const* in_opt_cmd_buffer_ptrs_ptr, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr); + + static SubmitInfo create_execute(Anvil::CommandBufferBase* in_cmd_buffer_ptr, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr); + static SubmitInfo create_execute(Anvil::CommandBufferBase* const* in_cmd_buffer_ptrs_ptr, + uint32_t in_n_cmd_buffers, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr); + + static SubmitInfo create_execute_signal(Anvil::CommandBufferBase* in_cmd_buffer_ptr, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr); + static SubmitInfo create_execute_signal(Anvil::CommandBufferBase* const* in_cmd_buffer_ptrs_ptr, + uint32_t in_n_cmd_buffers, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr); + + /** TODO + * + * NOTE: This function always blocks. + */ + static SubmitInfo create_signal(uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, + Anvil::Fence* in_opt_fence_ptr = nullptr); + + static SubmitInfo create_signal_wait(uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr); + + /** TODO + * + * NOTE: This function always blocks. + */ + static SubmitInfo create_wait(uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + Anvil::Fence* in_opt_fence_ptr = nullptr); + + static SubmitInfo create_wait_execute(Anvil::CommandBufferBase* in_cmd_buffer_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr); + static SubmitInfo create_wait_execute(Anvil::CommandBufferBase* const* in_cmd_buffer_ptrs_ptr, + uint32_t in_n_cmd_buffers, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr); + + static SubmitInfo create_wait_execute_signal(Anvil::CommandBufferBase* in_cmd_buffer_ptr, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr); + static SubmitInfo create_wait_execute_signal(Anvil::CommandBufferBase* const* in_cmd_buffer_ptrs_ptr, + uint32_t in_n_cmd_buffers, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr); + + Anvil::CommandBufferBase* const* get_command_buffers_sgpu() const + { + return command_buffers_sgpu_ptr; + } + + #if defined(_WIN32) + bool get_d3d12_fence_semaphore_values(const uint64_t** out_d3d12_fence_signal_semaphore_values_ptr_ptr, + const uint64_t** out_d3d12_fence_wait_semaphore_values_ptr_ptr) const + { + bool result = (d3d12_fence_signal_semaphore_values_ptr != nullptr && n_signal_semaphores != 0) || + (d3d12_fence_wait_semaphore_values_ptr != nullptr && n_wait_semaphores != 0); + + *out_d3d12_fence_signal_semaphore_values_ptr_ptr = d3d12_fence_signal_semaphore_values_ptr; + *out_d3d12_fence_wait_semaphore_values_ptr_ptr = d3d12_fence_wait_semaphore_values_ptr; + + return result; + } + #endif + + const VkPipelineStageFlags* get_destination_stage_wait_masks() const + { + return dst_stage_wait_masks_ptr; + } + + Anvil::Fence* get_fence() const + { + return fence_ptr; + } + + const uint32_t& get_n_command_buffers() const + { + return n_command_buffers; + } + + const uint32_t& get_n_signal_semaphores() const + { + return n_signal_semaphores; + } + + const uint32_t& get_n_wait_semaphores() const + { + return n_wait_semaphores; + } + + Anvil::Semaphore* const* get_signal_semaphores_sgpu() const + { + return signal_semaphores_sgpu_ptr; + } + + const bool& get_should_block() const + { + return should_block; + } + + const SubmissionType& get_type() const + { + return type; + } + + Anvil::Semaphore* const* get_wait_semaphores_sgpu() const + { + return wait_semaphores_sgpu_ptr; + } + + #if defined(_WIN32) + /* Calling this function will make Anvil fill & chain a VkD3D12FenceSubmitInfoKHR struct at queue submission time. + * + * Requires VK_KHR_external_semaphore_win32 support. + * + * NOTE: The structure caches the provided pointers, not the contents available under derefs! Make sure the pointers remain valid + * for the time of the Queue::submit() call. + * + * @param in_signal_semaphore_values_ptr An array of exactly n_signal_semaphores values. Usage as per VkD3D12FenceSubmitInfoKHR::pSignalSemaphoreValues. + * Must not be nullptr unless n_signal_semaphores is 0. + * @param in_wait_semaphore_values_ptr An array of exactly n_wait_semaphores values. Usage as per VkD3D12FenceSubmitInfoKHR::pWaitSemaphoreValues. + * Must not be nullptr unless n_wait_semaphores is 0. + **/ + void set_d3d12_fence_semaphore_values(const uint64_t* in_signal_semaphore_values_ptr, + const uint32_t& in_n_signal_semaphore_values, + const uint64_t* in_wait_semaphore_values_ptr, + const uint32_t& in_n_wait_semaphore_values) + { + ANVIL_REDUNDANT_ARGUMENT_CONST(in_n_signal_semaphore_values); + ANVIL_REDUNDANT_ARGUMENT_CONST(in_n_wait_semaphore_values); + + anvil_assert((n_signal_semaphores != 0 && in_signal_semaphore_values_ptr != nullptr) || + (n_signal_semaphores == 0) ); + anvil_assert((n_wait_semaphores != 0 && in_wait_semaphore_values_ptr != nullptr) || + (n_wait_semaphores == 0) ); + + anvil_assert(in_n_signal_semaphore_values == n_signal_semaphores); + anvil_assert(in_n_wait_semaphore_values == n_wait_semaphores); + + d3d12_fence_signal_semaphore_values_ptr = in_signal_semaphore_values_ptr; + d3d12_fence_wait_semaphore_values_ptr = in_wait_semaphore_values_ptr; + } + #endif + + private: + SubmitInfo(Anvil::CommandBufferBase* in_cmd_buffer_ptr, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr); + + SubmitInfo(uint32_t in_n_command_buffers, + Anvil::CommandBufferBase* const* in_opt_cmd_buffer_ptrs_ptr, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr); + + Anvil::CommandBufferBase* helper_cmd_buffer_raw_ptr; + + Anvil::CommandBufferBase* const* command_buffers_sgpu_ptr; + uint32_t n_command_buffers; + + Anvil::Semaphore* const* signal_semaphores_sgpu_ptr; + uint32_t n_signal_semaphores; + + const VkPipelineStageFlags* dst_stage_wait_masks_ptr; + Anvil::Semaphore* const* wait_semaphores_sgpu_ptr; + uint32_t n_wait_semaphores; + + Anvil::Fence* fence_ptr; + + #if defined(_WIN32) + const uint64_t* d3d12_fence_signal_semaphore_values_ptr; + const uint64_t* d3d12_fence_wait_semaphore_values_ptr; + #endif + + bool should_block; + const SubmissionType type; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(SubmitInfo); + } SubmitInfo; + /* Represents a Vulkan structure header */ typedef struct { diff --git a/include/misc/types_utils.h b/include/misc/types_utils.h index d8261d47..5ca7f32e 100644 --- a/include/misc/types_utils.h +++ b/include/misc/types_utils.h @@ -28,7 +28,17 @@ namespace Anvil { MTSafety convert_boolean_to_mt_safety_enum(bool in_mt_safe); - VkExternalMemoryHandleTypeFlagsKHR convert_external_memory_handle_types_to_vk_external_memory_handle_type_flags(const Anvil::ExternalMemoryHandleTypeFlags& in_flags); + VkBufferCreateFlags convert_buffer_create_flags_to_vk_buffer_create_flags(const Anvil::BufferCreateFlags& in_create_flags); + Anvil::BufferCreateFlags convert_vk_buffer_create_flags_to_buffer_create_flags(const VkBufferCreateFlags& in_create_flags); + + VkExternalFenceHandleTypeFlagsKHR convert_external_fence_handle_type_bits_to_vk_external_fence_handle_type_flags(const Anvil::ExternalFenceHandleTypeBits& in_types); + Anvil::ExternalFenceHandleTypeBits convert_vk_external_fence_handle_type_flags_to_external_fence_handle_type_bits(const VkExternalFenceHandleTypeFlagsKHR& in_types); + + VkExternalMemoryHandleTypeFlagsKHR convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(const Anvil::ExternalMemoryHandleTypeBits& in_types); + Anvil::ExternalMemoryHandleTypeBits convert_vk_external_memory_handle_type_flags_to_external_memory_handle_type_bits(const VkExternalMemoryHandleTypeFlagsKHR& in_types); + + VkExternalSemaphoreHandleTypeFlagsKHR convert_external_semaphore_handle_type_bits_to_vk_external_semaphore_handle_type_flags(const Anvil::ExternalSemaphoreHandleTypeBits& in_types); + Anvil::ExternalSemaphoreHandleTypeBits convert_vk_external_semaphore_handle_type_flags_to_external_semaphore_handle_type_bits(const VkExternalSemaphoreHandleTypeFlagsKHR& in_types); bool convert_mt_safety_enum_to_boolean(MTSafety in_mt_safety, const Anvil::BaseDevice* in_device_ptr); @@ -259,6 +269,12 @@ namespace Anvil VkMemoryPropertyFlags* out_mem_type_flags_ptr, VkMemoryHeapFlags* out_mem_heap_flags_ptr); + #ifdef _WIN32 + bool is_nt_handle(const Anvil::ExternalFenceHandleTypeBit& in_type); + bool is_nt_handle(const Anvil::ExternalMemoryHandleTypeBit& in_type); + bool is_nt_handle(const Anvil::ExternalSemaphoreHandleTypeBit& in_type); + #endif + /** Tells whether @param in_value is a power-of-two. */ template type is_pow2(const type in_value) diff --git a/include/wrappers/buffer.h b/include/wrappers/buffer.h index 568d2ac3..f8a01329 100644 --- a/include/wrappers/buffer.h +++ b/include/wrappers/buffer.h @@ -235,8 +235,6 @@ namespace Anvil uint32_t in_n_physical_devices, const Anvil::PhysicalDevice* in_physical_devices_ptr); - bool do_external_memory_handle_type_sanity_checks() const; - /* Private members */ VkBuffer m_buffer; VkMemoryRequirements m_buffer_memory_reqs; diff --git a/include/wrappers/descriptor_pool.h b/include/wrappers/descriptor_pool.h index 12631e11..0c169e75 100644 --- a/include/wrappers/descriptor_pool.h +++ b/include/wrappers/descriptor_pool.h @@ -153,7 +153,7 @@ namespace Anvil std::vector m_ds_cache; std::vector m_ds_layout_cache; - const DescriptorPoolFlags& m_flags; + const DescriptorPoolFlags m_flags; }; }; /* namespace Anvil */ diff --git a/include/wrappers/device.h b/include/wrappers/device.h index dc497b19..dac3f5ce 100644 --- a/include/wrappers/device.h +++ b/include/wrappers/device.h @@ -165,6 +165,50 @@ namespace Anvil return m_khr_descriptor_update_template_extension_entrypoints; } + #if defined(_WIN32) + const ExtensionKHRExternalFenceWin32Entrypoints& get_extension_khr_external_fence_win32_entrypoints() const + { + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_fence_win32() ); + + return m_khr_external_fence_win32_extension_entrypoints; + } + + const ExtensionKHRExternalMemoryWin32Entrypoints& get_extension_khr_external_memory_win32_entrypoints() const + { + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_memory_win32() ); + + return m_khr_external_memory_win32_extension_entrypoints; + } + + const ExtensionKHRExternalSemaphoreWin32Entrypoints& get_extension_khr_external_semaphore_win32_entrypoints() const + { + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_semaphore_win32() ); + + return m_khr_external_semaphore_win32_extension_entrypoints; + } + #else + const ExtensionKHRExternalFenceFdEntrypoints& get_extension_khr_external_fence_fd_entrypoints() const + { + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_fence_fd() ); + + return m_khr_external_fence_fd_extension_entrypoints; + } + + const ExtensionKHRExternalMemoryFdEntrypoints& get_extension_khr_external_memory_fd_entrypoints() const + { + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_memory_fd() ); + + return m_khr_external_memory_fd_extension_entrypoints; + } + + const ExtensionKHRExternalSemaphoreFdEntrypoints& get_extension_khr_external_semaphore_fd_entrypoints() const + { + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_semaphore_fd() ); + + return m_khr_external_semaphore_fd_extension_entrypoints; + } + #endif + /** Returns a container with entry-points to functions introduced by VK_KHR_maintenance1 extension. **/ const ExtensionKHRMaintenance1Entrypoints& get_extension_khr_maintenance1_entrypoints() const { @@ -272,37 +316,21 @@ namespace Anvil return m_parent_instance_ptr; } + virtual bool get_physical_device_buffer_format_properties(const BufferFormatPropertiesQuery& in_query, + Anvil::BufferFormatProperties* out_opt_result_ptr = nullptr) const = 0; + /** Returns features supported by physical device(s) which have been used to instantiate * this logical device instance. **/ virtual const Anvil::PhysicalDeviceFeatures& get_physical_device_features() const = 0; - /** Returns format properties, as reported by physical device(s) which have been used to - * instantiate this logical device instance. - * - * @param in_format Format to use for the query. - */ - virtual const Anvil::FormatProperties& get_physical_device_format_properties(VkFormat in_format) const = 0; + virtual bool get_physical_device_fence_properties(const FencePropertiesQuery& in_query, + Anvil::FenceProperties* out_opt_result_ptr = nullptr) const = 0; - /** Returns image format properties, as reported by physical device(s) which have been used - * to instantiate this logical device instance. - * - * @param in_format Meaning as per Vulkan spec. - * @param in_type Meaning as per Vulkan spec. - * @param in_tiling Meaning as per Vulkan spec. - * @param in_usage Meaning as per Vulkan spec. - * @param in_flags Meaning as per Vulkan spec. - * @param out_result If the function returns true, the requested information will be stored - * at this location. - * - * @return true if successful, false otherwise. - **/ - virtual bool get_physical_device_image_format_properties(VkFormat in_format, - VkImageType in_type, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, - VkImageCreateFlags in_flags, - VkImageFormatProperties& out_result) const = 0; + virtual Anvil::FormatProperties get_physical_device_format_properties(VkFormat in_format) const = 0; + + virtual bool get_physical_device_image_format_properties(const ImageFormatPropertiesQuery& in_query, + Anvil::ImageFormatProperties* out_opt_result_ptr = nullptr) const = 0; /** Returns memory properties, as reported by physical device(s) which have been used * to instantiate this logical device instance. @@ -445,6 +473,24 @@ namespace Anvil Anvil::Queue* get_sparse_binding_queue(uint32_t in_n_queue, VkQueueFlags in_opt_required_queue_flags = 0) const; + /* Tells which memory types can be specified when creating an external memory handle for a Win32 handle @param in_handle + * + * Requires VK_KHR_external_memory_Fd under Windows. + * Requires VK_KHR_external_memory_win32 under Windows. + * + * @return true if successful, false otherwise. + * + * + * @param in_external_handle_type (Windows) must be either EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT or + * EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT. + * (Linux) must be EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT. + * @param out_supported_memory_type_bits_ptr Deref will be set to a set of bits where each index corresponds to support status + * of a memory type with corresponding index. Must not be null. + */ + bool get_memory_types_supported_for_external_handle(const Anvil::ExternalMemoryHandleTypeBit& in_external_handle_type, + ExternalHandleType in_handle, + uint32_t* out_supported_memory_type_bits) const; + /** Returns a Queue instance, corresponding to a transfer queue at index @param in_n_queue * * @param in_n_queue Index of the transfer queue to retrieve the wrapper instance for. @@ -508,8 +554,6 @@ namespace Anvil bool is_universal_queue_family_index(const uint32_t& in_queue_family_index) const; - bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags& in_types) const; - bool wait_idle() const; protected: @@ -604,6 +648,15 @@ namespace Anvil ExtensionKHRSurfaceEntrypoints m_khr_surface_extension_entrypoints; ExtensionKHRSwapchainEntrypoints m_khr_swapchain_extension_entrypoints; + #if defined(_WIN32) + ExtensionKHRExternalFenceWin32Entrypoints m_khr_external_fence_win32_extension_entrypoints; + ExtensionKHRExternalMemoryWin32Entrypoints m_khr_external_memory_win32_extension_entrypoints; + ExtensionKHRExternalSemaphoreWin32Entrypoints m_khr_external_semaphore_win32_extension_entrypoints; + #else + ExtensionKHRExternalFenceFdEntrypoints m_khr_external_fence_fd_extension_entrypoints; + ExtensionKHRExternalMemoryFdEntrypoints m_khr_external_memory_fd_extension_entrypoints; + ExtensionKHRExternalSemaphoreFdEntrypoints m_khr_external_semaphore_fd_extension_entrypoints; + #endif private: /* Private variables */ @@ -685,19 +738,19 @@ namespace Anvil return m_parent_physical_device_ptr; } + bool get_physical_device_buffer_format_properties(const BufferFormatPropertiesQuery& in_query, + Anvil::BufferFormatProperties* out_opt_result_ptr = nullptr) const override; + /** See documentation in BaseDevice for more details */ const Anvil::PhysicalDeviceFeatures& get_physical_device_features() const override; - /** See documentation in BaseDevice for more details */ - const Anvil::FormatProperties& get_physical_device_format_properties(VkFormat in_format) const override; + bool get_physical_device_fence_properties(const FencePropertiesQuery& in_query, + Anvil::FenceProperties* out_opt_result_ptr = nullptr) const override; - /** See documentation in BaseDevice for more details */ - bool get_physical_device_image_format_properties(VkFormat in_format, - VkImageType in_type, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, - VkImageCreateFlags in_flags, - VkImageFormatProperties& out_result) const override; + Anvil::FormatProperties get_physical_device_format_properties(VkFormat in_format) const override; + + bool get_physical_device_image_format_properties(const ImageFormatPropertiesQuery& in_query, + Anvil::ImageFormatProperties* out_opt_result_ptr = nullptr) const override; /** See documentation in BaseDevice for more details */ const Anvil::MemoryProperties& get_physical_device_memory_properties() const override; diff --git a/include/wrappers/fence.h b/include/wrappers/fence.h index e95024fe..cb5845be 100644 --- a/include/wrappers/fence.h +++ b/include/wrappers/fence.h @@ -56,6 +56,18 @@ namespace Anvil */ static Anvil::FenceUniquePtr create(Anvil::FenceCreateInfoUniquePtr in_create_info_ptr); + /* Creates a new external fence handle of the user-specified type. + * + * For NT handle types, the function can only be called once per each NT handle type. Subsequent + * calls will result in the function triggering an assertion failure and returning null. + * + * Returns nullptr if unsuccessful. + * + * Requires VK_KHR_external_fence_fd under Linux. + * Requires VK_KHR_external_fence_win32 under Windows. + */ + ExternalHandleUniquePtr export_to_external_handle(const Anvil::ExternalFenceHandleTypeBit& in_fence_handle_type); + const Anvil::FenceCreateInfo* get_create_info_ptr() const { return m_create_info_ptr.get(); @@ -75,6 +87,32 @@ namespace Anvil return &m_fence; } + /* TODO + * + * Requires VK_KHR_external_fence_fd under Linux. + * Requires VK_KHR_external_fence_win32 under Windows. + * + * + * @return true if successful, false otherwise. + * + * @param in_temporary_import True if a temporary import operation should be performed. False if + * a permanent import is being requested. + * @param in_handle_type Type of the handle that is being imported. + * @param in_handle (Linux): Handle to use. + * @param in_opt_handle (Windows): Handle to use. Must not be null if @param in_opt_name is null and vice versa. + * @param in_opt_name (Windows): Name of the handle to use. Must not be null if @param in_opt_handle is null and vice versa. + */ + #if defined(_WIN32) + bool import_from_external_handle(const bool& in_temporary_import, + const Anvil::ExternalFenceHandleTypeBit& in_handle_type, + const ExternalHandleType& in_opt_handle, + const std::wstring& in_opt_name); + #else + bool import_from_external_handle(const bool& in_temporary_import, + const Anvil::ExternalFenceHandleTypeBit& in_handle_type, + const ExternalHandleType& in_handle); + #endif + /** Tells whether the fence is signalled at the time of the call. * * @return true if the fence is set, false otherwise. @@ -117,9 +155,10 @@ namespace Anvil void release_fence(); /* Private variables */ - Anvil::FenceCreateInfoUniquePtr m_create_info_ptr; - VkFence m_fence; - mutable bool m_possibly_set; + Anvil::FenceCreateInfoUniquePtr m_create_info_ptr; + std::map m_external_fence_created_for_handle_type; + VkFence m_fence; + mutable bool m_possibly_set; }; }; /* namespace Anvil */ diff --git a/include/wrappers/image.h b/include/wrappers/image.h index ca6419cd..2f04dcae 100644 --- a/include/wrappers/image.h +++ b/include/wrappers/image.h @@ -433,8 +433,6 @@ namespace Anvil Image(Anvil::ImageCreateInfoUniquePtr in_create_info_ptr); - bool do_sanity_checks_for_external_memory_handle_types(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const; - bool init (); void init_mipmap_props (); void init_page_occupancy(const std::vector& in_memory_reqs); diff --git a/include/wrappers/instance.h b/include/wrappers/instance.h index 376d8e34..fd990fc5 100644 --- a/include/wrappers/instance.h +++ b/include/wrappers/instance.h @@ -87,6 +87,12 @@ namespace Anvil return m_enabled_extensions_info_ptr->get_instance_extension_info(); } + const ExtensionKHRExternalFenceCapabilitiesEntrypoints& get_extension_khr_external_fence_capabilities_entrypoints() const; + + const ExtensionKHRExternalMemoryCapabilitiesEntrypoints& get_extension_khr_external_memory_capabilities_entrypoints() const; + + const ExtensionKHRExternalSemaphoreCapabilitiesEntrypoints& get_extension_khr_external_semaphore_capabilities_entrypoints() const; + /** Returns a container with entry-points to functions introduced by VK_KHR_get_physical_device_properties2. * * Will fire an assertion failure if the extension is not supported. @@ -201,9 +207,12 @@ namespace Anvil /* DebugReport extension function pointers and data */ VkDebugReportCallbackEXT m_debug_callback_data; - ExtensionEXTDebugReportEntrypoints m_ext_debug_report_entrypoints; - ExtensionKHRGetPhysicalDeviceProperties2 m_khr_get_physical_device_properties2_entrypoints; - ExtensionKHRSurfaceEntrypoints m_khr_surface_entrypoints; + ExtensionEXTDebugReportEntrypoints m_ext_debug_report_entrypoints; + ExtensionKHRExternalFenceCapabilitiesEntrypoints m_khr_external_fence_capabilities_entrypoints; + ExtensionKHRExternalMemoryCapabilitiesEntrypoints m_khr_external_memory_capabilities_entrypoints; + ExtensionKHRExternalSemaphoreCapabilitiesEntrypoints m_khr_external_semaphore_capabilities_entrypoints; + ExtensionKHRGetPhysicalDeviceProperties2 m_khr_get_physical_device_properties2_entrypoints; + ExtensionKHRSurfaceEntrypoints m_khr_surface_entrypoints; #ifdef _WIN32 #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) diff --git a/include/wrappers/memory_block.h b/include/wrappers/memory_block.h index f6c3465b..ec9d928e 100644 --- a/include/wrappers/memory_block.h +++ b/include/wrappers/memory_block.h @@ -38,12 +38,10 @@ #include "misc/mt_safety.h" #include "misc/types.h" +#include "misc/memory_block_create_info.h" namespace Anvil { - /** "About to be deleted" call-back function prototype. */ - typedef std::function OnMemoryBlockReleaseCallbackFunction; - typedef class IMemoryBlockBackendSupport { public: @@ -63,7 +61,14 @@ namespace Anvil public: /* Public functions */ - /** Create and bind a new device memory object to the instantiated MemoryBlock object. + static MemoryBlockUniquePtr create(Anvil::MemoryBlockCreateInfoUniquePtr in_create_info_ptr); + + /* Creates a new external memory handle of the user-specified type. + * + * For NT handles, if one has been already created for this memory block instance & handle type, a cached instance + * of the handle will be returned instead. Otherwise, each create() call will return a new handle. + * + * Cached external memory handles will be destroyed & released at MemoryBlock's destruction time. * * @param in_device_ptr Device to use. * @param in_allowed_memory_bits Memory type bits which meet the allocation requirements. @@ -73,107 +78,53 @@ namespace Anvil * this field to specify which handle types the allocation needs to support. Please see * documentation of Anvil::ExternalMemoryHandleTypeFlags for more details. **/ - static MemoryBlockUniquePtr create(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_allowed_memory_bits, - VkDeviceSize in_size, - Anvil::MemoryFeatureFlags in_memory_features, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = 0); + static MemoryBlockUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_allowed_memory_bits, + VkDeviceSize in_size, + Anvil::MemoryFeatureFlags in_memory_features, + MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); /** Create a memory block whose storage space is maintained by another MemoryBlock instance. * - * @param in_parent_memory_block_ptr MemoryBlock instance to use as a parent. Must not be nullptr. - * Parent memory block must not be mapped. - * @param in_start_offset Start offset of the storage maintained by the specified parent memory block, - * from which the new MemoryBlock instance's storage should start. - * Must not be equal to or larger than parent object's storage size. - * When added to @param in_size, the result value must not be be larger than the remaining - * storage size. - * @param in_size Region size to use for the derived memory block. - **/ - static MemoryBlockUniquePtr create_derived(MemoryBlock* in_parent_memory_block_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size); - - /** Create a memory block whose lifetime is maintained by a separate entity. While the memory block remains reference-counted - * as usual, the destruction process is carried out by an external party via the specified call-back. + * Only supports REGULAR memory blocks. Derived memory blocks are NOT supported. * - * This implements a special case required for support of Vulkan Memory Allocator memory allocator backend. Applications - * are very unlikely to ever need to use this create() function. + * Returns nullptr if unsuccessful. * - * TODO + * Requires VK_KHR_external_memory_fd under Linux. + * Requires VK_KHR_external_memory_win32 under Windows. */ - static MemoryBlockUniquePtr create_derived_with_custom_delete_proc(const Anvil::BaseDevice* in_device_ptr, - VkDeviceMemory in_memory, - uint32_t in_allowed_memory_bits, - Anvil::MemoryFeatureFlags in_memory_features, - uint32_t in_memory_type_index, - VkDeviceSize in_size, - VkDeviceSize in_start_offset, - OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types); + ExternalHandleUniquePtr export_to_external_memory_handle(const Anvil::ExternalMemoryHandleTypeBit& in_memory_handle_type); /** Releases the Vulkan counterpart and unregisters the wrapper instance from the object tracker */ virtual ~MemoryBlock(); - /* Returns the underlying raw Vulkan VkDeviceMemory handle. */ - const VkDeviceMemory& get_memory() const + const Anvil::MemoryBlockCreateInfo* get_create_info_ptr() const { - if (m_parent_memory_block_ptr != nullptr) - { - return m_parent_memory_block_ptr->m_memory; - } - else - { - return m_memory; - } + return m_create_info_ptr.get(); } - /** Returns memory features of the underlying memory region */ - Anvil::MemoryFeatureFlags get_memory_features() const + /* Returns the underlying raw Vulkan VkDeviceMemory handle. */ + const VkDeviceMemory& get_memory() const { - if (m_parent_memory_block_ptr != nullptr) - { - return m_parent_memory_block_ptr->get_memory_features(); - } - else - { - return m_memory_features; - } - } + auto parent_mem_block_ptr = m_create_info_ptr->get_parent_memory_block(); - /** Returns the memory type index the memory block was allocated from */ - uint32_t get_memory_type_index() const - { - if (m_parent_memory_block_ptr != nullptr) + if (parent_mem_block_ptr != nullptr) { - return m_parent_memory_block_ptr->get_memory_type_index(); + return parent_mem_block_ptr->m_memory; } else { - return m_memory_type_index; + return m_memory; } } - /* Returns parent memory block, if one has been defined for this instance */ - const Anvil::MemoryBlock* get_parent_memory_block() const + const uint32_t& get_memory_type_index() const { - return m_parent_memory_block_ptr; + return m_memory_type_index; } - /* Returns the size of the memory block. */ - VkDeviceSize get_size() const - { - return m_size; - } - - /* Returns the start offset of the memory block. - * - * If the memory block has a parent, the returned start offset is NOT relative to the parent memory block's - * start offset (in other words: the returned value is an absolute offset which can be directly used against - * the memory block instance) - */ - VkDeviceSize get_start_offset() const + const VkDeviceSize& get_start_offset() const { return m_start_offset; } @@ -254,29 +205,7 @@ namespace Anvil /* Private functions */ bool init(); - /** Please see create() for documentation */ - MemoryBlock(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_allowed_memory_bits, - VkDeviceSize in_size, - Anvil::MemoryFeatureFlags in_memory_features, - bool in_mt_safe, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types); - - /** Please see create() for documentation */ - MemoryBlock(MemoryBlock* in_parent_memory_block_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size); - - /** Please see create_derived_with_custom_delete_proc() for documentation */ - MemoryBlock(const Anvil::BaseDevice* in_device_ptr, - VkDeviceMemory in_memory, - uint32_t in_allowed_memory_bits, - Anvil::MemoryFeatureFlags in_memory_features, - uint32_t in_memory_type_index, - VkDeviceSize in_size, - VkDeviceSize in_start_offset, - OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types); + MemoryBlock(Anvil::MemoryBlockCreateInfoUniquePtr in_create_info_ptr); MemoryBlock (const MemoryBlock&); MemoryBlock& operator=(const MemoryBlock&); @@ -297,7 +226,7 @@ namespace Anvil m_parent_memory_allocator_backend_ptr = m_owned_parent_memory_allocator_backend_ptr.get(); { - auto parent_memory_block_ptr = m_parent_memory_block_ptr; + auto parent_memory_block_ptr = m_create_info_ptr->get_parent_memory_block(); while (parent_memory_block_ptr != nullptr) { @@ -307,30 +236,25 @@ namespace Anvil parent_memory_block_ptr->m_backend_object = in_backend_object; parent_memory_block_ptr->m_parent_memory_allocator_backend_ptr = in_backend_ptr.get(); - parent_memory_block_ptr = parent_memory_block_ptr->m_parent_memory_block_ptr; + parent_memory_block_ptr = parent_memory_block_ptr->get_create_info_ptr()->get_parent_memory_block(); } } } /* Private members */ - OnMemoryBlockReleaseCallbackFunction m_on_release_callback_function; - std::atomic m_gpu_data_map_count; /* Only set for root memory blocks */ void* m_gpu_data_ptr; /* Only set for root memory blocks */ - uint32_t m_allowed_memory_bits; - void* m_backend_object; - const Anvil::BaseDevice* m_device_ptr; - Anvil::ExternalMemoryHandleTypeFlags m_external_memory_handle_types; - VkDeviceMemory m_memory; - Anvil::MemoryFeatureFlags m_memory_features; - uint32_t m_memory_type_index; - Anvil::MemoryBlock* m_parent_memory_block_ptr; - VkDeviceSize m_size; - VkDeviceSize m_start_offset; + void* m_backend_object; + Anvil::MemoryBlockCreateInfoUniquePtr m_create_info_ptr; + VkDeviceMemory m_memory; + uint32_t m_memory_type_index; + VkDeviceSize m_start_offset; std::shared_ptr m_owned_parent_memory_allocator_backend_ptr; Anvil::IMemoryAllocatorBackendBase* m_parent_memory_allocator_backend_ptr; + + std::map m_external_handle_type_to_external_handle; }; }; /* Vulkan namespace */ diff --git a/include/wrappers/physical_device.h b/include/wrappers/physical_device.h index 120ae408..3a5183d4 100644 --- a/include/wrappers/physical_device.h +++ b/include/wrappers/physical_device.h @@ -59,87 +59,12 @@ namespace Anvil /** Destructor */ virtual ~PhysicalDevice(); - /* Returns physical device's LUID. + /* TODO * - * Requires VK_KHR_external_memory support, as well as VkPhysicalDeviceIDPropertiesKHR::deviceLUIDValid - * to have been set to true by the driver owning the physical device, in order to report success. - * - * @param out_result_ptr Exactly VK_LUID_SIZE_KHR bytes will be copied under *out_result_ptr if - * function returns true. Must not be nullptr. - * - * @return true if successful, false otherwise. - **/ - bool get_device_LUID(uint8_t* out_result_ptr) const - { - bool result = false; - - if (m_device_LUID_available) - { - static_assert(sizeof(m_device_LUID) == VK_LUID_SIZE_KHR, ""); - - memcpy(out_result_ptr, - m_device_LUID, - VK_LUID_SIZE_KHR); - - result = true; - } - - return result; - } - - /* Returns physical device's UUID. - * - * Requires VK_KHR_external_memory support to return successfully. - * - * @param out_result_ptr Exactly VK_UUID_SIZE bytes will be copied under *out_result_ptr if - * function returns true. Must not be nullptr. - * - * @return true if successful, false otherwise. - **/ - bool get_device_UUID(uint8_t* out_result_ptr) const - { - bool result = false; - - if (m_device_UUID_available) - { - static_assert(sizeof(m_device_UUID) == VK_UUID_SIZE, ""); - - memcpy(out_result_ptr, - m_device_UUID, - VK_UUID_SIZE); - - result = true; - } - - return result; - } - - /* Returns UUID of the driver owning the physical device. - * - * Requires VK_KHR_external_memory support to return successfully. - * - * @param out_result_ptr Exactly VK_UUID_SIZE bytes will be copied under *out_result_ptr if - * function returns true. Must not be nullptr. - * - * @return true if successful, false otherwise. - **/ - bool get_driver_UUID(uint8_t* out_result_ptr) const - { - bool result = false; - - if (m_driver_UUID_available) - { - static_assert(sizeof(m_driver_UUID) == VK_UUID_SIZE, ""); - - memcpy(out_result_ptr, - m_driver_UUID, - VK_UUID_SIZE); - - result = true; - } - - return result; - } + * Requires VK_KHR_external_memory_capabilities. + */ + bool get_buffer_format_properties(const Anvil::BufferFormatPropertiesQuery& in_query, + Anvil::BufferFormatProperties* out_opt_result_ptr = nullptr) const; /** Retrieves features supported by the physical device */ const Anvil::PhysicalDeviceFeatures& get_device_features() const @@ -152,27 +77,27 @@ namespace Anvil return m_properties; } - /** Retrieves format properties, as reported by the wrapped physical device. + /* TODO + * + * Requires VK_KHR_external_fence_capabiltiies. + * + */ + bool get_fence_properties(const Anvil::FencePropertiesQuery& in_query, + Anvil::FenceProperties* out_opt_result_ptr = nullptr) const; + + Anvil::FormatProperties get_format_properties(VkFormat in_format) const; + + /** Retrieves image format properties, as reported by the wrapped physical device. + * + * For external memory handle capability queries, VK_KHR_external_memory_capabilities support is required. + * * * @param in_format Vulkan format to retrieve the filled structure for. * * @return As per description. **/ - const FormatProperties& get_format_properties(VkFormat in_format) const - { - auto format_props_iterator = m_format_properties.find(in_format); - - if (format_props_iterator != m_format_properties.end() ) - { - return format_props_iterator->second; - } - else - { - anvil_assert_fail(); - - return m_dummy; - } - } + bool get_image_format_properties(const ImageFormatPropertiesQuery& in_query, + Anvil::ImageFormatProperties* out_opt_result_ptr = nullptr) const; /** Returns index of the physical device. */ uint32_t get_index() const @@ -219,6 +144,14 @@ namespace Anvil return m_queue_families; } + /* TODO + * + * Requires VK_KHR_external_semaphore_capabiltiies. + * + */ + bool get_semaphore_properties(const Anvil::SemaphorePropertiesQuery& in_query, + Anvil::SemaphoreProperties* out_opt_result_ptr = nullptr) const; + /** Returns sparse image format properties for this physical device. See Vulkan spec * for vkGetPhysicalDeviceSparseImageFormatProperties() function for more details. * @@ -258,9 +191,6 @@ namespace Anvil bool is_layer_supported(const std::string& in_layer_name) const; private: - /* Private type definitions */ - typedef std::map FormatPropertiesMap; - /* Private functions */ /** Constructor. Retrieves properties & capabilities of a physical device at @@ -274,11 +204,9 @@ namespace Anvil explicit PhysicalDevice(Anvil::Instance* in_instance_ptr, uint32_t in_index, VkPhysicalDevice in_physical_device) - :m_device_LUID_available(false), - m_device_UUID_available(false), - m_index (in_index), - m_instance_ptr (in_instance_ptr), - m_physical_device (in_physical_device) + :m_index (in_index), + m_instance_ptr (in_instance_ptr), + m_physical_device(in_physical_device) { anvil_assert(in_physical_device != VK_NULL_HANDLE); } @@ -294,27 +222,20 @@ namespace Anvil uint32_t m_index; Anvil::Instance* m_instance_ptr; Anvil::PhysicalDeviceFeatures m_features; - FormatPropertiesMap m_format_properties; Anvil::Layers m_layers; MemoryProperties m_memory_properties; VkPhysicalDevice m_physical_device; QueueFamilyInfoItems m_queue_families; Anvil::PhysicalDeviceProperties m_properties; - std::unique_ptr m_amd_shader_core_properties_ptr; - std::unique_ptr m_core_features_vk10_ptr; - std::unique_ptr m_core_properties_vk10_ptr; - std::unique_ptr m_ext_descriptor_indexing_features_ptr; - std::unique_ptr m_ext_descriptor_indexing_properties_ptr; - std::unique_ptr m_khr_16_bit_storage_features_ptr; - std::unique_ptr m_khr_maintenance3_properties_ptr; - - bool m_device_LUID_available; - uint8_t m_device_LUID[VK_LUID_SIZE_KHR]; - bool m_device_UUID_available; - uint8_t m_device_UUID[VK_UUID_SIZE]; - uint8_t m_driver_UUID[VK_UUID_SIZE]; - bool m_driver_UUID_available; + std::unique_ptr m_amd_shader_core_properties_ptr; + std::unique_ptr m_core_features_vk10_ptr; + std::unique_ptr m_core_properties_vk10_ptr; + std::unique_ptr m_ext_descriptor_indexing_features_ptr; + std::unique_ptr m_ext_descriptor_indexing_properties_ptr; + std::unique_ptr m_khr_16_bit_storage_features_ptr; + std::unique_ptr m_khr_external_memory_capabilities_physical_device_id_properties_ptr; + std::unique_ptr m_khr_maintenance3_properties_ptr; friend class Anvil::Instance; }; diff --git a/include/wrappers/query_pool.h b/include/wrappers/query_pool.h index b0544ceb..177c11c9 100644 --- a/include/wrappers/query_pool.h +++ b/include/wrappers/query_pool.h @@ -87,6 +87,43 @@ namespace Anvil return m_query_pool_vk; } + /* Uses vkGetQueryPoolResults() to retrieve result values for the user-specified query range. + * + * NOTE: It is assumed result values are to be returned to a tightly-packed array of size + * @param in_n_queries * sizeof(query result type). if @param in_query_props includes QUERY_RESULT_WITH_AVAILABILITY_BIT, + * twice the amount of memory is needed for result storage. + * + * NOTE: It is caller's responsibility to follow the requirements listed in the spec which guarantee + * the results returned by this entrypoint are correct. + * + **/ + bool get_query_pool_results(const uint32_t& in_first_query_index, + const uint32_t& in_n_queries, + const QueryResultBits& in_query_props, + uint32_t* out_results_ptr, + bool* out_all_query_results_retrieved_ptr) + { + return get_query_pool_results_internal(in_first_query_index, + in_n_queries, + in_query_props, + false, /* should_return_uint64 */ + out_results_ptr, + out_all_query_results_retrieved_ptr); + } + + bool get_query_pool_results(const uint32_t& in_first_query_index, + const uint32_t& in_n_queries, + const QueryResultBits& in_query_props, + uint64_t* out_results_ptr, + bool* out_all_query_results_retrieved_ptr) + { + return get_query_pool_results_internal(in_first_query_index, + in_n_queries, + in_query_props, + true, /* should_return_uint64 */ + out_results_ptr, + out_all_query_results_retrieved_ptr); + } private: /* Constructor. Please see corresponding create() for specification */ @@ -102,6 +139,13 @@ namespace Anvil uint32_t in_n_max_concurrent_queries, bool in_mt_safe); + bool get_query_pool_results_internal(const uint32_t& in_first_query_index, + const uint32_t& in_n_queries, + const QueryResultBits& in_query_props, + const bool& in_should_return_uint64, + void* out_results_ptr, + bool* out_all_query_results_retrieved_ptr); + /** Initializes the Vulkan counterpart. * * @param in_query_type Type of the query to instantiate the pool for. @@ -117,6 +161,7 @@ namespace Anvil const Anvil::BaseDevice* m_device_ptr; uint32_t m_n_max_indices; VkQueryPool m_query_pool_vk; + const VkQueryType m_query_type; }; }; /* namespace Anvil */ diff --git a/include/wrappers/queue.h b/include/wrappers/queue.h index 778bf1d5..99d9f036 100644 --- a/include/wrappers/queue.h +++ b/include/wrappers/queue.h @@ -132,142 +132,7 @@ namespace Anvil uint32_t in_n_wait_semaphores, Anvil::Semaphore* const* in_wait_semaphore_ptrs_ptr); - /** Waits on the semaphores specified by the user, executes user-defined command buffers, - * and then signals the semaphores passed by arguments. If a non-nullptr fence is specified, - * the function will also wait on the call to finish GPU-side before returning. - * - * It is valid to specify 0 command buffers or signal/wait semaphores, in which case - * these steps will be skipped. - * - * If @param in_should_block is true and @param in_opt_fence_ptr is nullptr, the function will create - * a new fence, wait on it, and then release it prior to leaving. This may come at a performance cost. - * - * @param in_n_command_buffers Number of command buffers under @param in_opt_cmd_buffer_ptrs - * which should be executed. May be 0. - * @param in_opt_cmd_buffer_ptrs_ptr Ptr to an array of command buffers to execute. Can be nullptr if - * @param n_command_buffers is 0. - * @param in_n_semaphores_to_signal Number of semaphores to signal after command buffers finish - * executing. May be 0. - * @param in_opt_semaphore_to_signal_ptrs_ptr Ptr to an array of semaphores to signal after execution. May be nullptr if - * @param n_semaphores_to_signal is 0. - * @param in_n_semaphores_to_wait_on Number of semaphores to wait on before executing command buffers. - * May be 0. - * @param in_opt_semaphore_to_wait_on_ptrs_ptr Ptr to an array of semaphores to wait on prior to execution. May be nullptr - * if @param in_n_semaphores_to_wait_on is 0. - * @param in_opt_dst_stage_masks_to_wait_on_ptrs Array of size @param in_n_semaphores_to_wait_on, specifying stages - * at which the wait ops should be performed. May be nullptr if - * @param n_semaphores_to_wait_on is 0. - * @param in_should_block true if the function should wait for the scheduled commands to - * finish executing, false otherwise. - * @param in_opt_fence_ptr Fence to use when submitting the comamnd buffers to the queue. - * The fence will be waited on if @param in_should_block is true. - * If @param in_should_block is false, the fence will be passed at - * submit call time, but will not be waited on. - **/ - void submit_command_buffers(uint32_t in_n_command_buffers, - Anvil::CommandBufferBase* const* in_opt_cmd_buffer_ptrs_ptr, - uint32_t in_n_semaphores_to_signal, - Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptr_ptrs_ptr, - uint32_t in_n_semaphores_to_wait_on, - Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, - bool in_should_block, - Anvil::Fence* in_opt_fence_ptr = nullptr); - - /** Submits specified command buffer to the queue. Can optionally wait until the execution finishes. - * - * For argument discussion, please see submit_command_buffers() documentation - **/ - void submit_command_buffer(Anvil::CommandBufferBase* in_cmd_buffer_ptr, - bool in_should_block, - Anvil::Fence* in_opt_fence_ptr = nullptr) - { - submit_command_buffers(1, /* n_command_buffers */ - &in_cmd_buffer_ptr, - 0, /* n_semaphores_to_signal */ - nullptr, /* semaphore_to_signal_ptrs */ - 0, /* n_semaphoires_to_wait_on */ - nullptr, /* semaphore_to_wait_on_ptrs */ - nullptr, - in_should_block, - in_opt_fence_ptr); - } - - /** Submits specified command buffer to the queue. After the command buffer finishes executing - * GPU-side, user-specified semaphores will be signalled. - * - * Can optionally wait until the execution finishes. - * - * For argument discussion, please see submit_command_buffers() documentation - **/ - void submit_command_buffer_with_signal_semaphores(Anvil::CommandBufferBase* in_opt_cmd_buffer_ptr, - uint32_t in_n_semaphores_to_signal, - Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, - bool in_should_block, - Anvil::Fence* in_opt_fence_ptr = nullptr) - { - submit_command_buffers((in_opt_cmd_buffer_ptr != nullptr) ? 1u : 0u, - &in_opt_cmd_buffer_ptr, - in_n_semaphores_to_signal, - in_semaphore_to_signal_ptrs_ptr, - 0, /* n_semaphores_to_wait_on */ - nullptr, /* semaphore_to_wait_on_ptr_ptrs */ - nullptr, /* opt_dst_stage_masks_to_wait_on_ptrs */ - in_should_block, - in_opt_fence_ptr); - } - - /** Waits on the user-specified semaphores and submits specified command buffer to the queue. - * After the command buffer finishes executing GPU-side, user-specified semaphores will be - * signalled. - * - * Can optionally wait until the execution finishes. - * - * For argument discussion, please see submit_command_buffers() documentation - **/ - void submit_command_buffer_with_signal_wait_semaphores(Anvil::CommandBufferBase* in_opt_cmd_buffer_ptr, - uint32_t in_n_semaphores_to_signal, - Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, - uint32_t in_n_semaphores_to_wait_on, - Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, - bool in_should_block, - Anvil::Fence* in_opt_fence_ptr = nullptr) - { - submit_command_buffers((in_opt_cmd_buffer_ptr != nullptr) ? 1u : 0u, - &in_opt_cmd_buffer_ptr, - in_n_semaphores_to_signal, - in_semaphore_to_signal_ptrs_ptr, - in_n_semaphores_to_wait_on, - in_semaphore_to_wait_on_ptrs_ptr, - in_dst_stage_masks_to_wait_on_ptrs, - in_should_block, - in_opt_fence_ptr); - } - - /** Waits on the user-specified semaphores and submits specified command buffer to the queue. - * - * Can optionally wait until the execution finishes. - * - * For argument discussion, please see submit_command_buffers() documentation - **/ - void submit_command_buffer_with_wait_semaphores(Anvil::CommandBufferBase* in_cmd_buffer_ptr, - uint32_t in_n_semaphores_to_wait_on, - Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, - bool in_should_block, - Anvil::Fence* in_opt_fence_ptr = nullptr) - { - submit_command_buffers((in_cmd_buffer_ptr != nullptr) ? 1u : 0u, - &in_cmd_buffer_ptr, - 0u, /* n_semaphores_to_signal */ - nullptr, /* semaphore_to_signal_ptr_ptrs */ - in_n_semaphores_to_wait_on, - in_semaphore_to_wait_on_ptrs_ptr, - in_dst_stage_masks_to_wait_on_ptrs, - in_should_block, - in_opt_fence_ptr); - } + void submit(const SubmitInfo& in_submit_info); /** Tells whether the queue supports sparse bindings */ bool supports_sparse_bindings() const diff --git a/include/wrappers/semaphore.h b/include/wrappers/semaphore.h index 71f0531a..4a111576 100644 --- a/include/wrappers/semaphore.h +++ b/include/wrappers/semaphore.h @@ -47,6 +47,18 @@ namespace Anvil /** Creates a single Vulkan semaphore instance and registers the object in Object Tracker. */ static Anvil::SemaphoreUniquePtr create(Anvil::SemaphoreCreateInfoUniquePtr in_create_info_ptr); + /* Creates a new external semaphore handle of the user-specified type. + * + * For NT handle types, the function can only be called once per each NT handle type. Subsequent + * calls will result in the function triggering an assertion failure and returning null. + * + * Returns nullptr if unsuccessful. + * + * Requires VK_KHR_external_semaphore_fd under Linux. + * Requires VK_KHR_external_semaphore_win32 under Windows. + */ + ExternalHandleUniquePtr export_to_external_handle(const Anvil::ExternalSemaphoreHandleTypeBit& in_semaphore_handle_type); + /** Destructor. * * Destroys the Vulkan counterpart and unregisters the wrapper instance from the Object Tracker. @@ -70,6 +82,32 @@ namespace Anvil return &m_semaphore; } + /* TODO + * + * Requires VK_KHR_external_semaphore_fd under Linux. + * Requires VK_KHR_external_semaphore_win32 under Windows. + * + * + * @return true if successful, false otherwise. + * + * @param in_temporary_import True if a temporary import operation should be performed. False if + * a permanent import is being requested. + * @param in_handle_type Type of the handle that is being imported. + * @param in_handle (Linux): Handle to use. Must not be -1. + * @param in_opt_handle (Windows): Win32 NT handle to use. Must not be null if @param in_opt_name is null and vice versa. + * @param in_opt_name (Windows): Name of the handle to use. Must not be null if @param in_opt_handle is null and vice versa. + */ + #if defined(_WIN32) + bool import_from_external_handle(const bool& in_temporary_import, + const Anvil::ExternalSemaphoreHandleTypeBit& in_handle_type, + const ExternalHandleType& in_opt_handle, + const std::wstring& in_opt_name); + #else + bool import_from_external_handle(const bool& in_temporary_import, + const Anvil::ExternalSemaphoreHandleTypeBit& in_handle_type, + const ExternalHandleType& in_handle); + #endif + /** Releases the underlying Vulkan Semaphore instance and creates a new Vulkan object. */ bool reset(); @@ -83,8 +121,9 @@ namespace Anvil void release_semaphore(); /* Private variables */ - Anvil::SemaphoreCreateInfoUniquePtr m_create_info_ptr; - VkSemaphore m_semaphore; + Anvil::SemaphoreCreateInfoUniquePtr m_create_info_ptr; + std::map m_external_semaphore_created_for_handle_type; + VkSemaphore m_semaphore; ANVIL_DISABLE_ASSIGNMENT_OPERATOR(Semaphore); ANVIL_DISABLE_COPY_CONSTRUCTOR(Semaphore); diff --git a/src/misc/buffer_create_info.cpp b/src/misc/buffer_create_info.cpp index 141d8017..8da43b69 100644 --- a/src/misc/buffer_create_info.cpp +++ b/src/misc/buffer_create_info.cpp @@ -91,14 +91,14 @@ Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_nonsparse_no_al return result_ptr; } -Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_sparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - VkBufferUsageFlags in_usage_flags, - Anvil::SparseResidencyScope in_residency_scope, - MTSafety in_mt_safety, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) +Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_sparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + VkBufferUsageFlags in_usage_flags, + Anvil::SparseResidencyScope in_residency_scope, + MTSafety in_mt_safety, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) { Anvil::BufferCreateInfoUniquePtr result_ptr(nullptr, std::default_delete() ); @@ -117,14 +117,14 @@ Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_sparse_no_alloc return result_ptr; } -Anvil::BufferCreateInfo::BufferCreateInfo(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - VkBufferUsageFlags in_usage_flags, - Anvil::SparseResidencyScope in_residency_scope, - MTSafety in_mt_safety, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) +Anvil::BufferCreateInfo::BufferCreateInfo(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + VkBufferUsageFlags in_usage_flags, + Anvil::SparseResidencyScope in_residency_scope, + MTSafety in_mt_safety, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) :m_client_data_ptr (nullptr), m_device_ptr (in_device_ptr), m_external_memory_handle_types(in_external_memory_handle_types), @@ -164,16 +164,16 @@ Anvil::BufferCreateInfo::BufferCreateInfo(const Anvil::BaseDevice* i } } -Anvil::BufferCreateInfo::BufferCreateInfo(const Anvil::BufferType& in_buffer_type, - const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - VkBufferUsageFlags in_usage_flags, - MemoryFeatureFlags in_memory_features, - MTSafety in_mt_safety, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types, - const void* in_opt_client_data_ptr) +Anvil::BufferCreateInfo::BufferCreateInfo(const Anvil::BufferType& in_buffer_type, + const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + QueueFamilyBits in_queue_families, + VkSharingMode in_sharing_mode, + VkBufferUsageFlags in_usage_flags, + MemoryFeatureFlags in_memory_features, + MTSafety in_mt_safety, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types, + const void* in_opt_client_data_ptr) :m_client_data_ptr (in_opt_client_data_ptr), m_device_ptr (in_device_ptr), m_external_memory_handle_types(in_external_memory_handle_types), diff --git a/src/misc/dummy_window.cpp b/src/misc/dummy_window.cpp index a924feda..d3a101ac 100644 --- a/src/misc/dummy_window.cpp +++ b/src/misc/dummy_window.cpp @@ -174,8 +174,6 @@ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_ima ANVIL_REDUNDANT_VARIABLE(swapchain_image_format); anvil_assert(swapchain_image_subresource_range.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT); - anvil_assert(device_ptr->get_physical_device_format_properties(swapchain_image_format).optimal_tiling_capabilities & VK_FORMAT_FEATURE_BLIT_SRC_BIT); - anvil_assert(device_ptr->get_physical_device_format_properties(VK_FORMAT_R8G8B8A8_UNORM).optimal_tiling_capabilities & VK_FORMAT_FEATURE_BLIT_DST_BIT); /* Initialize storage for the raw R8G8B8A8 image data */ Anvil::BufferUniquePtr raw_image_buffer_ptr; @@ -356,8 +354,14 @@ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_ima command_buffer_ptr->stop_recording(); /* Execute the command buffer */ - universal_queue_ptr->submit_command_buffer(command_buffer_ptr.get(), - true); /* should_block */ + { + Anvil::CommandBufferBase* cmd_buffer_raw_ptr = command_buffer_ptr.get(); + + universal_queue_ptr->submit(Anvil::SubmitInfo::create_execute(&cmd_buffer_raw_ptr, + 1, /* in_n_cmd_buffers */ + true) /* should_block */ + ); + } /* Read back the result data */ raw_image_buffer_ptr->read(0, /* offset */ diff --git a/src/misc/external_handle.cpp b/src/misc/external_handle.cpp new file mode 100644 index 00000000..07b3720f --- /dev/null +++ b/src/misc/external_handle.cpp @@ -0,0 +1,64 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#include "misc/external_handle.h" + +#if !defined(_WIN32) + #include +#endif + +Anvil::ExternalHandle::ExternalHandle(const ExternalHandleType& in_handle, + const bool& in_close_at_destruction_time) + :m_close_at_destruction_time(in_close_at_destruction_time), + m_handle (in_handle) +{ + /* Stub */ +} + +Anvil::ExternalHandleUniquePtr Anvil::ExternalHandle::create(const ExternalHandleType& in_handle, + const bool& in_close_at_destruction_time) +{ + Anvil::ExternalHandleUniquePtr result_ptr(nullptr, + std::default_delete() ); + + result_ptr.reset( + new ExternalHandle(in_handle, + in_close_at_destruction_time) + ); + + return result_ptr; +} + +Anvil::ExternalHandle::~ExternalHandle() +{ + if (m_close_at_destruction_time) + { + #if defined(_WIN32) + { + ::CloseHandle(m_handle); + } + #else + { + close(m_handle); + } + #endif + } +} \ No newline at end of file diff --git a/src/misc/fence_create_info.cpp b/src/misc/fence_create_info.cpp index 106cce8a..90ed5403 100644 --- a/src/misc/fence_create_info.cpp +++ b/src/misc/fence_create_info.cpp @@ -39,9 +39,13 @@ Anvil::FenceCreateInfoUniquePtr Anvil::FenceCreateInfo::create(const Anvil::Base Anvil::FenceCreateInfo::FenceCreateInfo(const Anvil::BaseDevice* in_device_ptr, bool in_create_signalled, MTSafety in_mt_safety) - :m_create_signalled(in_create_signalled), - m_device_ptr (in_device_ptr), - m_mt_safety (in_mt_safety) + :m_create_signalled (in_create_signalled), + m_device_ptr (in_device_ptr), +#if defined(_WIN32) + m_exportable_nt_handle_info_specified (false), +#endif + m_exportable_external_fence_handle_types(Anvil::EXTERNAL_FENCE_HANDLE_TYPE_NONE), + m_mt_safety (in_mt_safety) { /* Stub */ } \ No newline at end of file diff --git a/src/misc/image_create_info.cpp b/src/misc/image_create_info.cpp index 27ffe84b..de2fff54 100644 --- a/src/misc/image_create_info.cpp +++ b/src/misc/image_create_info.cpp @@ -211,28 +211,28 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_swapchain_wrapper return result_ptr; } -Anvil::ImageCreateInfo::ImageCreateInfo(Anvil::ImageType in_type, - const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type_vk, - VkFormat in_format, - VkImageTiling in_tiling, - VkSharingMode in_sharing_mode, - VkImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, - bool in_use_full_mipmap_chain, - ImageCreateFlags in_create_flags, - Anvil::QueueFamilyBits in_queue_families, - VkImageLayout in_post_create_image_layout, - const VkImageLayout& in_post_alloc_image_layout, - const std::vector* in_opt_mipmaps_ptr, - const Anvil::MTSafety& in_mt_safety, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types, - const Anvil::MemoryFeatureFlags& in_memory_features, - const Anvil::SparseResidencyScope& in_residency_scope) +Anvil::ImageCreateInfo::ImageCreateInfo(Anvil::ImageType in_type, + const Anvil::BaseDevice* in_device_ptr, + VkImageType in_type_vk, + VkFormat in_format, + VkImageTiling in_tiling, + VkSharingMode in_sharing_mode, + VkImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + VkSampleCountFlagBits in_sample_count, + bool in_use_full_mipmap_chain, + ImageCreateFlags in_create_flags, + Anvil::QueueFamilyBits in_queue_families, + VkImageLayout in_post_create_image_layout, + const VkImageLayout& in_post_alloc_image_layout, + const std::vector* in_opt_mipmaps_ptr, + const Anvil::MTSafety& in_mt_safety, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types, + const Anvil::MemoryFeatureFlags& in_memory_features, + const Anvil::SparseResidencyScope& in_residency_scope) :m_create_flags (in_create_flags), m_depth (in_base_mipmap_depth), m_device_ptr (in_device_ptr), diff --git a/src/misc/memalloc_backends/backend_oneshot.cpp b/src/misc/memalloc_backends/backend_oneshot.cpp index 30c735ea..c43f23de 100644 --- a/src/misc/memalloc_backends/backend_oneshot.cpp +++ b/src/misc/memalloc_backends/backend_oneshot.cpp @@ -24,6 +24,7 @@ #include "misc/debug.h" #include "misc/formats.h" #include "misc/memory_allocator.h" +#include "misc/memory_block_create_info.h" #include "wrappers/buffer.h" #include "wrappers/device.h" #include "wrappers/image.h" @@ -126,11 +127,16 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items } /* Bake the block and stash it */ - new_memory_block_ptr = Anvil::MemoryBlock::create(m_device_ptr, - 1u << current_memory_type_index, - n_bytes_required, - (memory_props.types[current_memory_type_index].features), - Anvil::Utils::convert_boolean_to_mt_safety_enum(m_device_ptr->is_mt_safe()) ); + { + auto create_info_ptr = Anvil::MemoryBlockCreateInfo::create_regular(m_device_ptr, + 1u << current_memory_type_index, + n_bytes_required, + (memory_props.types[current_memory_type_index].features) ); + + create_info_ptr->set_mt_safety(Anvil::Utils::convert_boolean_to_mt_safety_enum(m_device_ptr->is_mt_safe()) ); + + new_memory_block_ptr = Anvil::MemoryBlock::create(std::move(create_info_ptr) ); + } if (new_memory_block_ptr == nullptr) { @@ -143,9 +149,13 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items /* Go through the items again and assign the result memory block */ for (auto& current_item_ptr : current_item_vector) { - current_item_ptr->alloc_memory_block_ptr = Anvil::MemoryBlock::create_derived(new_memory_block_ptr.get(), - alloc_offset_map.at(current_item_ptr), - current_item_ptr->alloc_size); + { + auto create_info_ptr = Anvil::MemoryBlockCreateInfo::create_derived(new_memory_block_ptr.get(), + alloc_offset_map.at(current_item_ptr), + current_item_ptr->alloc_size); + + current_item_ptr->alloc_memory_block_ptr = Anvil::MemoryBlock::create(std::move(create_info_ptr) ); + } if (current_item_ptr->alloc_memory_block_ptr != nullptr) { @@ -197,7 +207,7 @@ bool Anvil::MemoryAllocatorBackends::OneShot::supports_baking() const return !m_is_baked; } -bool Anvil::MemoryAllocatorBackends::OneShot::supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const +bool Anvil::MemoryAllocatorBackends::OneShot::supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) const { return (in_external_memory_handle_types == 0); } diff --git a/src/misc/memalloc_backends/backend_vma.cpp b/src/misc/memalloc_backends/backend_vma.cpp index 757a935e..53fccd42 100644 --- a/src/misc/memalloc_backends/backend_vma.cpp +++ b/src/misc/memalloc_backends/backend_vma.cpp @@ -21,6 +21,7 @@ // #include "misc/debug.h" +#include "misc/memory_block_create_info.h" #include "wrappers/device.h" #include "wrappers/memory_block.h" #include "wrappers/physical_device.h" @@ -205,15 +206,18 @@ bool Anvil::MemoryAllocatorBackends::VMA::bake(Anvil::MemoryAllocator::Items& in allocation ); - new_memory_block_ptr = Anvil::MemoryBlock::create_derived_with_custom_delete_proc(m_device_ptr, - allocation_info.deviceMemory, - memory_requirements_vk.memoryTypeBits, - current_item_ptr->alloc_memory_required_features, - allocation_info.memoryType, - memory_requirements_vk.size, - allocation_info.offset, - release_callback_function, - 0); /* in_external_memory_handle_types */ + { + auto create_info_ptr = Anvil::MemoryBlockCreateInfo::create_derived_with_custom_delete_proc(m_device_ptr, + allocation_info.deviceMemory, + memory_requirements_vk.memoryTypeBits, + current_item_ptr->alloc_memory_required_features, + allocation_info.memoryType, + memory_requirements_vk.size, + allocation_info.offset, + release_callback_function); + + new_memory_block_ptr = Anvil::MemoryBlock::create(std::move(create_info_ptr) ); + } if (new_memory_block_ptr == nullptr) { @@ -301,7 +305,7 @@ void Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::on_vma_alloced_mem_block VmaAllocation in_vma_allocation) { /* Only physically deallocate those memory blocks that are not derivatives of another memory blocks! */ - if (in_memory_block_ptr->get_parent_memory_block() == nullptr) + if (in_memory_block_ptr->get_create_info_ptr()->get_parent_memory_block() == nullptr) { vmaFreeMemory(get_handle(), in_vma_allocation); @@ -323,7 +327,7 @@ bool Anvil::MemoryAllocatorBackends::VMA::supports_baking() const return true; } -bool Anvil::MemoryAllocatorBackends::VMA::supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const +bool Anvil::MemoryAllocatorBackends::VMA::supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) const { /* Vulkan Memory Allocator does NOT support external memory handles */ ANVIL_REDUNDANT_VARIABLE_CONST(in_external_memory_handle_types); diff --git a/src/misc/memory_allocator.cpp b/src/misc/memory_allocator.cpp index b7508c2f..f45cb5e2 100644 --- a/src/misc/memory_allocator.cpp +++ b/src/misc/memory_allocator.cpp @@ -35,14 +35,14 @@ #include "wrappers/queue.h" /* Please see header for specification */ -Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - Anvil::ExternalMemoryHandleTypeFlags in_alloc_external_memory_handle_types) +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + Anvil::ExternalMemoryHandleTypeBits in_alloc_external_memory_handle_types) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -63,15 +63,15 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memor register_for_callbacks(); } -Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_alloc_offset, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - Anvil::ExternalMemoryHandleTypeFlags in_alloc_external_memory_handle_types) +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_alloc_offset, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + Anvil::ExternalMemoryHandleTypeBits in_alloc_external_memory_handle_types) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -94,16 +94,16 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memor } /* Please see header for specification */ -Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - uint32_t in_n_layer, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_miptail_offset, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - Anvil::ExternalMemoryHandleTypeFlags in_alloc_external_memory_handle_types) +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_layer, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_miptail_offset, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + Anvil::ExternalMemoryHandleTypeBits in_alloc_external_memory_handle_types) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -128,17 +128,17 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memor } /* Please see header for specification */ -Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - const VkExtent3D& in_extent, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - Anvil::ExternalMemoryHandleTypeFlags in_alloc_external_memory_handle_types) +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + const VkExtent3D& in_extent, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + Anvil::ExternalMemoryHandleTypeBits in_alloc_external_memory_handle_types) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -164,14 +164,14 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memor } /* Please see header for specification */ -Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - Anvil::ExternalMemoryHandleTypeFlags in_alloc_external_memory_handle_types) +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + Anvil::ExternalMemoryHandleTypeBits in_alloc_external_memory_handle_types) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -354,9 +354,9 @@ Anvil::MemoryAllocator::~MemoryAllocator() /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* in_buffer_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* in_buffer_ptr, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -378,9 +378,9 @@ bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* in_ * * @param buffer_ptr Buffer instance to assign a memory block at baking time. **/ -bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* in_buffer_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* in_buffer_ptr, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) { IMemoryAllocatorBackend* backend_interface_ptr = dynamic_cast(m_backend_ptr.get() ); VkDeviceSize buffer_alignment = 0; @@ -450,10 +450,10 @@ bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - std::unique_ptr in_data_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr in_data_ptr, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -482,7 +482,7 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvi bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -510,10 +510,10 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - const std::vector* in_data_vector_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + const std::vector* in_data_vector_ptr, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -546,10 +546,10 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - std::unique_ptr in_data_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr in_data_ptr, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -578,7 +578,7 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anv bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -606,10 +606,10 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_vector_ptr_based_post_f } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - std::unique_ptr in_data_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr in_data_ptr, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -638,7 +638,7 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anv bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -666,10 +666,10 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f } /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - const std::vector* in_data_vector_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + const std::vector* in_data_vector_ptr, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -702,9 +702,9 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f } /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* in_image_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* in_image_ptr, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) { uint32_t filtered_memory_types = 0; VkDeviceSize image_alignment = 0; @@ -776,11 +776,11 @@ bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* } /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_offset, - VkDeviceSize in_size, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkDeviceSize in_size, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) { uint32_t filtered_memory_types = 0; const auto& memory_reqs = in_buffer_ptr->get_memory_requirements(); @@ -854,11 +854,11 @@ bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* } /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* in_image_ptr, - VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* in_image_ptr, + VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) { const Anvil::SparseImageAspectProperties* aspect_props_ptr = nullptr; uint32_t filtered_memory_types = 0; @@ -950,12 +950,12 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - VkExtent3D in_extent, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + VkExtent3D in_extent, + MemoryFeatureFlags in_required_memory_features, + Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) { const Anvil::SparseImageAspectProperties* aspect_props_ptr = nullptr; uint32_t component_size_bits[4] = {0}; @@ -1535,19 +1535,12 @@ Anvil::MemoryAllocatorUniquePtr Anvil::MemoryAllocator::create_vma(const Anvil:: return std::move(result_ptr); } -bool Anvil::MemoryAllocator::do_external_memory_handle_type_sanity_checks(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const +bool Anvil::MemoryAllocator::do_external_memory_handle_type_sanity_checks(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) const { bool result = true; if (in_external_memory_handle_types != 0) { - if (!m_device_ptr->supports_external_memory_handles(in_external_memory_handle_types) ) - { - anvil_assert(!m_device_ptr->supports_external_memory_handles(in_external_memory_handle_types) ); - - result = false; - } - else if (!m_backend_ptr->supports_external_memory_handles(in_external_memory_handle_types) ) { anvil_assert(m_backend_ptr->supports_external_memory_handles(in_external_memory_handle_types) ); diff --git a/src/misc/memory_block_create_info.cpp b/src/misc/memory_block_create_info.cpp new file mode 100644 index 00000000..60f4be5a --- /dev/null +++ b/src/misc/memory_block_create_info.cpp @@ -0,0 +1,184 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#include "misc/memory_block_create_info.h" +#include "wrappers/device.h" +#include "wrappers/memory_block.h" + + +Anvil::MemoryBlockCreateInfoUniquePtr Anvil::MemoryBlockCreateInfo::create_derived(MemoryBlock* in_parent_memory_block_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size) +{ + const uint32_t n_physical_devices = static_cast(in_parent_memory_block_ptr->get_create_info_ptr()->m_physical_devices.size() ); + auto result_ptr = Anvil::MemoryBlockCreateInfoUniquePtr(nullptr, + std::default_delete() ); + + anvil_assert(in_start_offset + in_size <= in_parent_memory_block_ptr->get_create_info_ptr()->get_start_offset() + in_parent_memory_block_ptr->get_create_info_ptr()->get_size() ); + + result_ptr.reset( + new Anvil::MemoryBlockCreateInfo(Anvil::MemoryBlockType::DERIVED, + in_parent_memory_block_ptr->get_create_info_ptr()->m_allowed_memory_bits, + const_cast(in_parent_memory_block_ptr->get_create_info_ptr()->m_device_ptr), + VK_NULL_HANDLE, /* in_memory */ + in_parent_memory_block_ptr->get_create_info_ptr()->m_memory_features, + UINT32_MAX, /* in_memory_type_index */ + n_physical_devices, + Anvil::OnMemoryBlockReleaseCallbackFunction(), + (n_physical_devices != 0) ? &in_parent_memory_block_ptr->get_create_info_ptr()->m_physical_devices.at(0) + : nullptr, + in_parent_memory_block_ptr, + in_size, + in_start_offset) + ); + + return result_ptr; +} + +Anvil::MemoryBlockCreateInfoUniquePtr Anvil::MemoryBlockCreateInfo::create_derived_with_custom_delete_proc(const Anvil::BaseDevice* in_device_ptr, + VkDeviceMemory in_memory, + uint32_t in_allowed_memory_bits, + Anvil::MemoryFeatureFlags in_memory_features, + uint32_t in_memory_type_index, + VkDeviceSize in_size, + VkDeviceSize in_start_offset, + Anvil::OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function) +{ + auto result_ptr = Anvil::MemoryBlockCreateInfoUniquePtr(nullptr, + std::default_delete() ); + + anvil_assert(in_device_ptr->get_type() == Anvil::DEVICE_TYPE_SINGLE_GPU); /* todo: pass physical device array below accordingly */ + + result_ptr.reset( + new Anvil::MemoryBlockCreateInfo(Anvil::MemoryBlockType::DERIVED_WITH_CUSTOM_DELETE_PROC, + in_allowed_memory_bits, + in_device_ptr, + in_memory, + in_memory_features, + in_memory_type_index, + 0, /* in_n_physical_devices */ + in_on_release_callback_function, + nullptr, /* in_physical_device_ptr_ptr */ + nullptr, /* in_parent_memory_block_ptr */ + in_size, + in_start_offset) + ); + + return result_ptr; +} + +Anvil::MemoryBlockCreateInfoUniquePtr Anvil::MemoryBlockCreateInfo::create_regular(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_allowed_memory_bits, + VkDeviceSize in_size, + Anvil::MemoryFeatureFlags in_memory_features) +{ + auto result_ptr = Anvil::MemoryBlockCreateInfoUniquePtr(nullptr, + std::default_delete() ); + + anvil_assert(in_device_ptr->get_type() == Anvil::DEVICE_TYPE_SINGLE_GPU); /* todo: pass physical device array below accordingly */ + + result_ptr.reset( + new Anvil::MemoryBlockCreateInfo(Anvil::MemoryBlockType::REGULAR, + in_allowed_memory_bits, + in_device_ptr, + VK_NULL_HANDLE, /* in_memory */ + in_memory_features, + 0, /* in_memory_type_index */ + 0, /* in_n_physical_devices */ + OnMemoryBlockReleaseCallbackFunction(), + nullptr, /* in_physical_device_ptr_ptr */ + nullptr, /* in_parent_memory_block_ptr */ + in_size, + 0) /* in_start_offset */ + ); + + return result_ptr; +} + +Anvil::MemoryBlockCreateInfo::MemoryBlockCreateInfo(const Anvil::MemoryBlockType& in_type, + const uint32_t& in_allowed_memory_bits, + const Anvil::BaseDevice* in_device_ptr, + VkDeviceMemory in_memory, + const Anvil::MemoryFeatureFlags& in_memory_features, + const uint32_t& in_memory_type_index, + const uint32_t& in_n_physical_devices, + const Anvil::OnMemoryBlockReleaseCallbackFunction& in_on_release_callback_function, + const Anvil::PhysicalDevice* const* in_opt_physical_device_ptr_ptr, + Anvil::MemoryBlock* in_parent_memory_block_ptr, + const VkDeviceSize& in_size, + const VkDeviceSize& in_start_offset) + :m_allowed_memory_bits (in_allowed_memory_bits), + m_device_ptr (in_device_ptr), + m_exportable_external_memory_handle_types (Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE), + m_external_handle_import_info_specified (false), +#ifdef _WIN32 + m_external_nt_handle_import_info_specified(false), +#endif + m_imported_external_memory_handle_type (Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE), + m_memory (in_memory), + m_memory_features (in_memory_features), + m_memory_type_index (in_memory_type_index), + m_mt_safety (Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE), + m_on_release_callback_function (in_on_release_callback_function), + m_parent_memory_block_ptr (in_parent_memory_block_ptr), + m_size (in_size), + m_start_offset (in_start_offset), + m_type (in_type) +{ + if (in_n_physical_devices != 0) + { + anvil_assert(in_opt_physical_device_ptr_ptr != nullptr); + + m_physical_devices.resize(in_n_physical_devices); + + for (uint32_t n_physical_device = 0; + n_physical_device < in_n_physical_devices; + ++n_physical_device) + { + m_physical_devices.at(n_physical_device) = in_opt_physical_device_ptr_ptr[n_physical_device]; + } + } +} + +Anvil::MemoryFeatureFlags Anvil::MemoryBlockCreateInfo::get_memory_features() const +{ + if (m_parent_memory_block_ptr != nullptr) + { + return m_parent_memory_block_ptr->get_create_info_ptr()->get_memory_features(); + } + else + { + return m_memory_features; + } +} + +/** Returns the memory type index the memory block was allocated from */ +uint32_t Anvil::MemoryBlockCreateInfo::get_memory_type_index() const +{ + if (m_parent_memory_block_ptr != nullptr) + { + return m_parent_memory_block_ptr->get_create_info_ptr()->get_memory_type_index(); + } + else + { + return m_memory_type_index; + } +} diff --git a/src/misc/semaphore_create_info.cpp b/src/misc/semaphore_create_info.cpp index 925a49c6..745d0732 100644 --- a/src/misc/semaphore_create_info.cpp +++ b/src/misc/semaphore_create_info.cpp @@ -21,15 +21,14 @@ // #include "misc/semaphore_create_info.h" -Anvil::SemaphoreCreateInfoUniquePtr Anvil::SemaphoreCreateInfo::create(const Anvil::BaseDevice* in_device_ptr, - MTSafety in_mt_safety) +Anvil::SemaphoreCreateInfoUniquePtr Anvil::SemaphoreCreateInfo::create(const Anvil::BaseDevice* in_device_ptr) { Anvil::SemaphoreCreateInfoUniquePtr result_ptr(nullptr, std::default_delete() ); result_ptr.reset( new Anvil::SemaphoreCreateInfo(in_device_ptr, - in_mt_safety) + Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) ); return result_ptr; @@ -37,8 +36,9 @@ Anvil::SemaphoreCreateInfoUniquePtr Anvil::SemaphoreCreateInfo::create(const Anv Anvil::SemaphoreCreateInfo::SemaphoreCreateInfo(const Anvil::BaseDevice* in_device_ptr, MTSafety in_mt_safety) - :m_device_ptr(in_device_ptr), - m_mt_safety (in_mt_safety) + :m_device_ptr (in_device_ptr), + m_exportable_external_semaphore_handle_types(Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_NONE), + m_mt_safety (in_mt_safety) { /* Stub */ } \ No newline at end of file diff --git a/src/misc/types_classes.cpp b/src/misc/types_classes.cpp index 49f5f8e2..dd0358c3 100644 --- a/src/misc/types_classes.cpp +++ b/src/misc/types_classes.cpp @@ -71,7 +71,7 @@ void Anvil::SparseMemoryBindingUpdateInfo::append_buffer_memory_update(SparseMem if (in_memory_block_ptr != nullptr) { - anvil_assert(in_memory_block_ptr->get_size() >= in_memory_block_start_offset + in_size); + anvil_assert(in_memory_block_ptr->get_create_info_ptr()->get_size() >= in_memory_block_start_offset + in_size); } /* Cache the update */ @@ -119,7 +119,7 @@ void Anvil::SparseMemoryBindingUpdateInfo::append_image_memory_update(SparseMemo if (in_opt_memory_block_ptr != nullptr) { - anvil_assert(in_opt_memory_block_ptr->get_size() > in_opt_memory_block_start_offset); + anvil_assert(in_opt_memory_block_ptr->get_create_info_ptr()->get_size() > in_opt_memory_block_start_offset); } /* Cache the update */ @@ -165,7 +165,7 @@ void Anvil::SparseMemoryBindingUpdateInfo::append_opaque_image_memory_update(Spa if (in_opt_memory_block_ptr != nullptr) { - anvil_assert(in_opt_memory_block_ptr->get_size() >= in_opt_memory_block_start_offset + in_size); + anvil_assert(in_opt_memory_block_ptr->get_create_info_ptr()->get_size() >= in_opt_memory_block_start_offset + in_size); } /* Cache the update */ diff --git a/src/misc/types_struct.cpp b/src/misc/types_struct.cpp index 4cb60cab..c0eb3861 100644 --- a/src/misc/types_struct.cpp +++ b/src/misc/types_struct.cpp @@ -132,11 +132,15 @@ Anvil::BufferBarrier::~BufferBarrier() /* Stub */ } -Anvil::BufferMemoryBindingUpdate::BufferMemoryBindingUpdate() +Anvil::BufferFormatProperties::BufferFormatProperties() { - buffer_ptr = nullptr; - memory_block_owned_by_buffer = false; - memory_block_ptr = nullptr; + /* Stub */ +} + +Anvil::BufferFormatProperties::BufferFormatProperties(const ExternalMemoryProperties& in_external_handle_properties) + :external_handle_properties (in_external_handle_properties) +{ + /* Stub */ } Anvil::DescriptorSetAllocation::DescriptorSetAllocation(const Anvil::DescriptorSetLayout* in_ds_layout_ptr) @@ -330,6 +334,59 @@ Anvil::ExtensionKHRDeviceGroupCreationEntrypoints::ExtensionKHRDeviceGroupCreati vkEnumeratePhysicalDeviceGroupsKHR = nullptr; } +Anvil::ExtensionKHRExternalFenceCapabilitiesEntrypoints::ExtensionKHRExternalFenceCapabilitiesEntrypoints() +{ + vkGetPhysicalDeviceExternalFencePropertiesKHR = nullptr; +} + +Anvil::ExtensionKHRExternalMemoryCapabilitiesEntrypoints::ExtensionKHRExternalMemoryCapabilitiesEntrypoints() +{ + vkGetPhysicalDeviceExternalBufferPropertiesKHR = nullptr; +} + +Anvil::ExtensionKHRExternalSemaphoreCapabilitiesEntrypoints::ExtensionKHRExternalSemaphoreCapabilitiesEntrypoints() +{ + vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = nullptr; +} + +#ifdef _WIN32 + Anvil::ExtensionKHRExternalFenceWin32Entrypoints::ExtensionKHRExternalFenceWin32Entrypoints() + { + vkGetFenceWin32HandleKHR = nullptr; + vkImportFenceWin32HandleKHR = nullptr; + } + + Anvil::ExtensionKHRExternalMemoryWin32Entrypoints::ExtensionKHRExternalMemoryWin32Entrypoints() + { + vkGetMemoryWin32HandleKHR = nullptr; + vkGetMemoryWin32HandlePropertiesKHR = nullptr; + } + + Anvil::ExtensionKHRExternalSemaphoreWin32Entrypoints::ExtensionKHRExternalSemaphoreWin32Entrypoints() + { + vkGetSemaphoreWin32HandleKHR = nullptr; + vkImportSemaphoreWin32HandleKHR = nullptr; + } +#else + Anvil::ExtensionKHRExternalFenceFdEntrypoints::ExtensionKHRExternalFenceFdEntrypoints() + { + vkGetFenceFdKHR = nullptr; + vkImportFenceFdKHR = nullptr; + } + + Anvil::ExtensionKHRExternalMemoryFdEntrypoints::ExtensionKHRExternalMemoryFdEntrypoints() + { + vkGetMemoryFdKHR = nullptr; + vkGetMemoryFdPropertiesKHR = nullptr; + } + + Anvil::ExtensionKHRExternalSemaphoreFdEntrypoints::ExtensionKHRExternalSemaphoreFdEntrypoints() + { + vkGetSemaphoreFdKHR = nullptr; + vkImportSemaphoreFdKHR = nullptr; + } +#endif + Anvil::ExtensionKHRMaintenance1Entrypoints::ExtensionKHRMaintenance1Entrypoints() { vkTrimCommandPoolKHR = nullptr; @@ -567,6 +624,65 @@ bool Anvil::EXTDescriptorIndexingProperties::operator==(const EXTDescriptorIndex shader_uniform_buffer_array_non_uniform_indexing_native == in_props.shader_uniform_buffer_array_non_uniform_indexing_native); } +Anvil::ExternalFenceProperties::ExternalFenceProperties() +{ + compatible_external_handle_types = 0; + export_from_imported_external_handle_types = 0; + is_exportable = false; + is_importable = false; +} + +Anvil::ExternalFenceProperties::ExternalFenceProperties(const VkExternalFencePropertiesKHR& in_external_fence_props) +{ + compatible_external_handle_types = Anvil::Utils::convert_vk_external_fence_handle_type_flags_to_external_fence_handle_type_bits(in_external_fence_props.compatibleHandleTypes); + export_from_imported_external_handle_types = Anvil::Utils::convert_vk_external_fence_handle_type_flags_to_external_fence_handle_type_bits(in_external_fence_props.exportFromImportedHandleTypes); + is_exportable = (in_external_fence_props.externalFenceFeatures & VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT_KHR) != 0; + is_importable = (in_external_fence_props.externalFenceFeatures & VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT_KHR) != 0; +} + +Anvil::ExternalMemoryProperties::ExternalMemoryProperties() +{ + compatible_external_handle_types = 0; + export_from_imported_external_handle_types = 0; + is_exportable = false; + is_importable = false; +} + +Anvil::ExternalMemoryProperties::ExternalMemoryProperties(const VkExternalMemoryPropertiesKHR& in_external_memory_props) +{ + compatible_external_handle_types = Anvil::Utils::convert_vk_external_memory_handle_type_flags_to_external_memory_handle_type_bits(in_external_memory_props.compatibleHandleTypes); + export_from_imported_external_handle_types = Anvil::Utils::convert_vk_external_memory_handle_type_flags_to_external_memory_handle_type_bits(in_external_memory_props.exportFromImportedHandleTypes); + is_exportable = (in_external_memory_props.externalMemoryFeatures & VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHR) != 0; + is_importable = (in_external_memory_props.externalMemoryFeatures & VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHR) != 0; +} + +Anvil::ExternalSemaphoreProperties::ExternalSemaphoreProperties() +{ + compatible_external_handle_types = 0; + export_from_imported_external_handle_types = 0; + is_exportable = false; + is_importable = false; +} + +Anvil::ExternalSemaphoreProperties::ExternalSemaphoreProperties(const VkExternalSemaphorePropertiesKHR& in_external_semaphore_props) +{ + compatible_external_handle_types = Anvil::Utils::convert_vk_external_semaphore_handle_type_flags_to_external_semaphore_handle_type_bits(in_external_semaphore_props.compatibleHandleTypes); + export_from_imported_external_handle_types = Anvil::Utils::convert_vk_external_semaphore_handle_type_flags_to_external_semaphore_handle_type_bits(in_external_semaphore_props.exportFromImportedHandleTypes); + is_exportable = (in_external_semaphore_props.externalSemaphoreFeatures & VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT_KHR) != 0; + is_importable = (in_external_semaphore_props.externalSemaphoreFeatures & VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT_KHR) != 0; +} + +Anvil::FenceProperties::FenceProperties() +{ + /* Stub */ +} + +Anvil::FenceProperties::FenceProperties(const ExternalFenceProperties& in_external_fence_properties) + :external_fence_properties(in_external_fence_properties) +{ + /* Stub */ +} + Anvil::FormatProperties::FormatProperties() { memset(this, @@ -576,19 +692,29 @@ Anvil::FormatProperties::FormatProperties() Anvil::FormatProperties::FormatProperties(const VkFormatProperties& in_format_props) { - buffer_capabilities = in_format_props.bufferFeatures; - linear_tiling_capabilities = in_format_props.linearTilingFeatures; - optimal_tiling_capabilities = in_format_props.optimalTilingFeatures; - supports_amd_texture_gather_bias_lod = false; + buffer_capabilities = in_format_props.bufferFeatures; + linear_tiling_capabilities = in_format_props.linearTilingFeatures; + optimal_tiling_capabilities = in_format_props.optimalTilingFeatures; } -/** Please see header for specification */ -bool Anvil::operator==(const Anvil::FormatProperties& in1, - const Anvil::FormatProperties& in2) +Anvil::ImageFormatProperties::ImageFormatProperties() +{ + memset(this, + 0, + sizeof(*this) ); +} + +Anvil::ImageFormatProperties::ImageFormatProperties(const VkImageFormatProperties& in_image_format_props, + const bool& in_supports_amd_texture_gather_bias_lod, + const ExternalMemoryProperties& in_external_handle_properties) { - return memcmp(&in1, - &in2, - sizeof(Anvil::FormatProperties) ) == 0; + external_handle_properties = in_external_handle_properties; + max_extent = in_image_format_props.maxExtent; + max_resource_size = in_image_format_props.maxResourceSize; + n_max_array_layers = in_image_format_props.maxArrayLayers; + n_max_mip_levels = in_image_format_props.maxMipLevels; + sample_counts = in_image_format_props.sampleCounts; + supports_amd_texture_gather_bias_lod = in_supports_amd_texture_gather_bias_lod; } /** Please see header for specification */ @@ -1404,14 +1530,16 @@ Anvil::PhysicalDeviceProperties::PhysicalDeviceProperties() khr_maintenance3_properties_ptr = nullptr; } -Anvil::PhysicalDeviceProperties::PhysicalDeviceProperties(const AMDShaderCoreProperties* in_amd_shader_core_properties_ptr, - const PhysicalDevicePropertiesCoreVK10* in_core_vk1_0_properties_ptr, - const EXTDescriptorIndexingProperties* in_ext_descriptor_indexing_properties_ptr, - const KHRMaintenance3Properties* in_khr_maintenance3_properties_ptr) - :amd_shader_core_properties_ptr (in_amd_shader_core_properties_ptr), - core_vk1_0_properties_ptr (in_core_vk1_0_properties_ptr), - ext_descriptor_indexing_properties_ptr(in_ext_descriptor_indexing_properties_ptr), - khr_maintenance3_properties_ptr (in_khr_maintenance3_properties_ptr) +Anvil::PhysicalDeviceProperties::PhysicalDeviceProperties(const AMDShaderCoreProperties* in_amd_shader_core_properties_ptr, + const PhysicalDevicePropertiesCoreVK10* in_core_vk1_0_properties_ptr, + const EXTDescriptorIndexingProperties* in_ext_descriptor_indexing_properties_ptr, + const Anvil::KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties* in_khr_external_memory_caps_physical_device_id_props_ptr, + const KHRMaintenance3Properties* in_khr_maintenance3_properties_ptr) + :amd_shader_core_properties_ptr (in_amd_shader_core_properties_ptr), + core_vk1_0_properties_ptr (in_core_vk1_0_properties_ptr), + ext_descriptor_indexing_properties_ptr (in_ext_descriptor_indexing_properties_ptr), + khr_external_memory_capabilities_physical_device_id_properties_ptr(in_khr_external_memory_caps_physical_device_id_props_ptr), + khr_maintenance3_properties_ptr (in_khr_maintenance3_properties_ptr) { /* Stub */ } @@ -1830,6 +1958,40 @@ bool Anvil::PhysicalDeviceLimits::operator==(const Anvil::PhysicalDeviceLimits& return result; } +Anvil::KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties::KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties() +{ + device_luid_valid = false; + device_node_mask = 0; + + memset(device_luid, + 0, + VK_LUID_SIZE); + memset(device_uuid, + 0, + VK_UUID_SIZE); + memset(driver_uuid, + 0, + VK_UUID_SIZE); +} + +Anvil::KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties::KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties(const VkPhysicalDeviceIDPropertiesKHR& in_properties) +{ + anvil_assert(in_properties.pNext == nullptr); + + device_luid_valid = VK_BOOL32_TO_BOOL(in_properties.deviceLUIDValid); + device_node_mask = in_properties.deviceNodeMask; + + memcpy(device_luid, + in_properties.deviceLUID, + VK_LUID_SIZE); + memcpy(device_uuid, + in_properties.deviceUUID, + VK_UUID_SIZE); + memcpy(driver_uuid, + in_properties.driverUUID, + VK_UUID_SIZE); +} + Anvil::PhysicalDevicePropertiesCoreVK10::PhysicalDevicePropertiesCoreVK10(const VkPhysicalDeviceProperties& in_physical_device_properties) :api_version (in_physical_device_properties.apiVersion), device_id (in_physical_device_properties.deviceID), @@ -1938,6 +2100,19 @@ bool Anvil::operator==(const Anvil::QueueFamilyInfo& in1, in1.n_timestamp_bits == in2.n_timestamp_bits); } +/** Please see header for specification */ +Anvil::SemaphoreProperties::SemaphoreProperties() +{ + /* Stub */ +} + +/** Please see header for specification */ +Anvil::SemaphoreProperties::SemaphoreProperties(const ExternalSemaphoreProperties& in_external_semaphore_properties) + :external_semaphore_properties(in_external_semaphore_properties) +{ + /* Stub */ +} + /** Please see header for specification */ Anvil::ShaderModuleStageEntryPoint::ShaderModuleStageEntryPoint() { @@ -2082,7 +2257,7 @@ Anvil::PhysicalDeviceFeaturesCoreVK10::PhysicalDeviceFeaturesCoreVK10() independent_blend (false), inherited_queries (false), large_points (false), - logic_ip (false), + logic_op (false), multi_draw_indirect (false), multi_viewport (false), occlusion_query_precise (false), @@ -2142,7 +2317,7 @@ Anvil::PhysicalDeviceFeaturesCoreVK10::PhysicalDeviceFeaturesCoreVK10(const VkPh independent_blend (VK_BOOL32_TO_BOOL(in_physical_device_features.independentBlend) ), inherited_queries (VK_BOOL32_TO_BOOL(in_physical_device_features.inheritedQueries) ), large_points (VK_BOOL32_TO_BOOL(in_physical_device_features.largePoints) ), - logic_ip (VK_BOOL32_TO_BOOL(in_physical_device_features.logicOp) ), + logic_op (VK_BOOL32_TO_BOOL(in_physical_device_features.logicOp) ), multi_draw_indirect (VK_BOOL32_TO_BOOL(in_physical_device_features.multiDrawIndirect) ), multi_viewport (VK_BOOL32_TO_BOOL(in_physical_device_features.multiViewport) ), occlusion_query_precise (VK_BOOL32_TO_BOOL(in_physical_device_features.occlusionQueryPrecise) ), @@ -2205,7 +2380,7 @@ VkPhysicalDeviceFeatures Anvil::PhysicalDeviceFeaturesCoreVK10::get_vk_physical_ result.independentBlend = BOOL_TO_VK_BOOL32(independent_blend); result.inheritedQueries = BOOL_TO_VK_BOOL32(inherited_queries); result.largePoints = BOOL_TO_VK_BOOL32(large_points); - result.logicOp = BOOL_TO_VK_BOOL32(logic_ip); + result.logicOp = BOOL_TO_VK_BOOL32(logic_op); result.multiDrawIndirect = BOOL_TO_VK_BOOL32(multi_draw_indirect); result.multiViewport = BOOL_TO_VK_BOOL32(multi_viewport); result.occlusionQueryPrecise = BOOL_TO_VK_BOOL32(occlusion_query_precise); @@ -2266,7 +2441,7 @@ bool Anvil::PhysicalDeviceFeaturesCoreVK10::operator==(const Anvil::PhysicalDevi (independent_blend == in_data.independent_blend) && (inherited_queries == in_data.inherited_queries) && (large_points == in_data.large_points) && - (logic_ip == in_data.logic_ip) && + (logic_op == in_data.logic_op) && (multi_draw_indirect == in_data.multi_draw_indirect) && (multi_viewport == in_data.multi_viewport) && (occlusion_query_precise == in_data.occlusion_query_precise) && @@ -2354,3 +2529,343 @@ bool Anvil::PhysicalDeviceProperties::operator==(const PhysicalDeviceProperties& ext_descriptor_indexing_properties_match && khr_maintenance3_properties_match; } + +Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_buffers, + Anvil::CommandBufferBase* const* in_opt_cmd_buffer_ptrs_ptr, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) + :command_buffers_sgpu_ptr (in_opt_cmd_buffer_ptrs_ptr), +#if defined(_WIN32) + d3d12_fence_signal_semaphore_values_ptr(nullptr), + d3d12_fence_wait_semaphore_values_ptr (nullptr), +#endif + dst_stage_wait_masks_ptr (in_opt_dst_stage_masks_to_wait_on_ptrs), + fence_ptr (in_opt_fence_ptr), + n_command_buffers (in_n_command_buffers), + n_signal_semaphores (in_n_semaphores_to_signal), + n_wait_semaphores (in_n_semaphores_to_wait_on), + signal_semaphores_sgpu_ptr (in_opt_semaphore_to_signal_ptrs_ptr), + should_block (in_should_block), + type (SubmissionType::SGPU), + wait_semaphores_sgpu_ptr (in_opt_semaphore_to_wait_on_ptrs_ptr) +{ + anvil_assert((in_n_command_buffers == 0) || + (in_n_command_buffers != 0 && in_opt_cmd_buffer_ptrs_ptr != nullptr) ); + + anvil_assert((in_n_semaphores_to_signal == 0) || + (in_n_semaphores_to_signal != 0 && in_opt_semaphore_to_signal_ptrs_ptr != nullptr) ); + + anvil_assert((in_n_semaphores_to_wait_on == 0) || + (in_n_semaphores_to_wait_on != 0 && in_opt_semaphore_to_wait_on_ptrs_ptr != nullptr && in_opt_dst_stage_masks_to_wait_on_ptrs != nullptr) ); +} + +Anvil::SubmitInfo::SubmitInfo(Anvil::CommandBufferBase* in_cmd_buffer_ptr, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) + :command_buffers_sgpu_ptr (nullptr), +#if defined(_WIN32) + d3d12_fence_signal_semaphore_values_ptr(nullptr), + d3d12_fence_wait_semaphore_values_ptr (nullptr), +#endif + dst_stage_wait_masks_ptr (in_opt_dst_stage_masks_to_wait_on_ptrs), + fence_ptr (in_opt_fence_ptr), + n_command_buffers ((in_cmd_buffer_ptr != nullptr) ? 1 : 0), + n_signal_semaphores (in_n_semaphores_to_signal), + n_wait_semaphores (in_n_semaphores_to_wait_on), + signal_semaphores_sgpu_ptr (in_opt_semaphore_to_signal_ptrs_ptr), + should_block (in_should_block), + type (SubmissionType::SGPU), + wait_semaphores_sgpu_ptr (in_opt_semaphore_to_wait_on_ptrs_ptr) +{ + anvil_assert((in_n_semaphores_to_signal == 0) || + (in_n_semaphores_to_signal != 0 && in_opt_semaphore_to_signal_ptrs_ptr != nullptr) ); + + anvil_assert((in_n_semaphores_to_wait_on == 0) || + (in_n_semaphores_to_wait_on != 0 && in_opt_semaphore_to_wait_on_ptrs_ptr != nullptr && in_opt_dst_stage_masks_to_wait_on_ptrs != nullptr) ); + + helper_cmd_buffer_raw_ptr = in_cmd_buffer_ptr; + command_buffers_sgpu_ptr = &helper_cmd_buffer_raw_ptr; +} + +Anvil::SubmitInfo Anvil::SubmitInfo::create(Anvil::CommandBufferBase* in_opt_cmd_buffer_ptr, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) +{ + return Anvil::SubmitInfo(in_opt_cmd_buffer_ptr, + in_n_semaphores_to_signal, + in_opt_semaphore_to_signal_ptrs_ptr, + in_n_semaphores_to_wait_on, + in_opt_semaphore_to_wait_on_ptrs_ptr, + in_opt_dst_stage_masks_to_wait_on_ptrs, + in_should_block, + in_opt_fence_ptr); +} + +Anvil::SubmitInfo Anvil::SubmitInfo::create(uint32_t in_n_cmd_buffers, + Anvil::CommandBufferBase* const* in_opt_cmd_buffer_ptrs_ptr, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) +{ + return Anvil::SubmitInfo(in_n_cmd_buffers, + in_opt_cmd_buffer_ptrs_ptr, + in_n_semaphores_to_signal, + in_opt_semaphore_to_signal_ptrs_ptr, + in_n_semaphores_to_wait_on, + in_opt_semaphore_to_wait_on_ptrs_ptr, + in_opt_dst_stage_masks_to_wait_on_ptrs, + in_should_block, + in_opt_fence_ptr); +} + +Anvil::SubmitInfo Anvil::SubmitInfo::create_execute(Anvil::CommandBufferBase* in_cmd_buffer_ptr, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) +{ + anvil_assert(in_cmd_buffer_ptr != nullptr); + + return Anvil::SubmitInfo(in_cmd_buffer_ptr, + 0, /* in_n_semaphores_to_signal */ + nullptr, /* in_opt_semaphore_to_signal_ptrs_ptr */ + 0, /* in_n_semaphores_to_wait_on */ + nullptr, /* in_opt_semaphore_to_wait_on_ptrs_ptr */ + nullptr, /* in_opt_dst_stage_masks_to_wait_on_ptrs */ + in_should_block, + in_opt_fence_ptr); +} + +Anvil::SubmitInfo Anvil::SubmitInfo::create_execute(Anvil::CommandBufferBase* const* in_cmd_buffer_ptrs_ptr, + uint32_t in_n_cmd_buffers, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) +{ + anvil_assert(in_cmd_buffer_ptrs_ptr != nullptr); + anvil_assert(in_n_cmd_buffers > 0); + + return Anvil::SubmitInfo(in_n_cmd_buffers, + in_cmd_buffer_ptrs_ptr, + 0, /* in_n_semaphores_to_signal */ + nullptr, /* in_opt_semaphore_to_signal_ptrs_ptr */ + 0, /* in_n_semaphores_to_wait_on */ + nullptr, /* in_opt_semaphore_to_wait_on_ptrs_ptr */ + nullptr, /* in_opt_dst_stage_masks_to_wait_on_ptrs */ + in_should_block, + in_opt_fence_ptr); +} + +Anvil::SubmitInfo Anvil::SubmitInfo::create_execute_signal(Anvil::CommandBufferBase* in_cmd_buffer_ptr, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) +{ + anvil_assert(in_cmd_buffer_ptr != nullptr); + anvil_assert(in_semaphore_to_signal_ptrs_ptr != nullptr); + + return Anvil::SubmitInfo(in_cmd_buffer_ptr, + in_n_semaphores_to_signal, + in_semaphore_to_signal_ptrs_ptr, + 0, /* in_n_semaphores_to_wait_on */ + nullptr, /* in_opt_semaphore_to_wait_on_ptrs_ptr */ + nullptr, /* in_opt_dst_stage_masks_to_wait_on_ptrs */ + in_should_block, + in_opt_fence_ptr); +} + +Anvil::SubmitInfo Anvil::SubmitInfo::create_execute_signal(Anvil::CommandBufferBase* const* in_cmd_buffer_ptrs_ptr, + uint32_t in_n_cmd_buffers, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) +{ + anvil_assert(in_cmd_buffer_ptrs_ptr != nullptr); + anvil_assert(in_n_cmd_buffers > 0); + anvil_assert(in_semaphore_to_signal_ptrs_ptr != nullptr); + + return Anvil::SubmitInfo(in_n_cmd_buffers, + in_cmd_buffer_ptrs_ptr, + in_n_semaphores_to_signal, + in_semaphore_to_signal_ptrs_ptr, + 0, /* in_n_semaphores_to_wait_on */ + nullptr, /* in_opt_semaphore_to_wait_on_ptrs_ptr */ + nullptr, /* in_opt_dst_stage_masks_to_wait_on_ptrs */ + in_should_block, + in_opt_fence_ptr); +} + +Anvil::SubmitInfo Anvil::SubmitInfo::create_signal(uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, + Anvil::Fence* in_opt_fence_ptr) +{ + anvil_assert(in_n_semaphores_to_signal > 0); + anvil_assert(in_semaphore_to_signal_ptrs_ptr != nullptr); + + return Anvil::SubmitInfo(0, /* in_n_command_buffers */ + nullptr, /* in_cmd_buffer_ptr */ + in_n_semaphores_to_signal, + in_semaphore_to_signal_ptrs_ptr, + 0, /* in_n_semaphores_to_wait_on */ + nullptr, /* in_semaphore_to_wait_on_ptrs_ptr */ + nullptr, /* in_dst_stage_masks_to_wait_on_ptrs */ + true, /* in_should_block */ + in_opt_fence_ptr); +} + +Anvil::SubmitInfo Anvil::SubmitInfo::create_signal_wait(uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) +{ + anvil_assert(in_n_semaphores_to_signal > 0); + anvil_assert(in_semaphore_to_signal_ptrs_ptr != nullptr); + anvil_assert(in_n_semaphores_to_wait_on > 0); + anvil_assert(in_semaphore_to_wait_on_ptrs_ptr != nullptr); + + return Anvil::SubmitInfo(0, /* in_n_command_buffers */ + nullptr, /* in_cmd_buffer_ptr */ + in_n_semaphores_to_signal, + in_semaphore_to_signal_ptrs_ptr, + in_n_semaphores_to_wait_on, + in_semaphore_to_wait_on_ptrs_ptr, + in_dst_stage_masks_to_wait_on_ptrs, + in_should_block, + in_opt_fence_ptr); +} + +Anvil::SubmitInfo Anvil::SubmitInfo::create_wait(uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + Anvil::Fence* in_opt_fence_ptr) +{ + anvil_assert(in_dst_stage_masks_to_wait_on_ptrs != nullptr); + anvil_assert(in_n_semaphores_to_wait_on > 0); + anvil_assert(in_semaphore_to_wait_on_ptrs_ptr != nullptr); + + return Anvil::SubmitInfo(0, /* in_n_command_buffers */ + nullptr, /* in_cmd_buffer_ptr */ + 0, /* in_n_semaphores_to_signal */ + nullptr, /* in_semaphore_to_signal_ptrs_ptr */ + in_n_semaphores_to_wait_on, + in_semaphore_to_wait_on_ptrs_ptr, + in_dst_stage_masks_to_wait_on_ptrs, + true, /* in_should_block */ + in_opt_fence_ptr); +} + +Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute(Anvil::CommandBufferBase* in_cmd_buffer_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) +{ + anvil_assert(in_cmd_buffer_ptr != nullptr); + anvil_assert(in_dst_stage_masks_to_wait_on_ptrs != nullptr); + anvil_assert(in_semaphore_to_wait_on_ptrs_ptr != nullptr); + + return Anvil::SubmitInfo(in_cmd_buffer_ptr, + 0, /* in_n_semaphores_to_signal */ + nullptr, /* in_opt_semaphore_to_signal_ptrs_ptr */ + in_n_semaphores_to_wait_on, + in_semaphore_to_wait_on_ptrs_ptr, + in_dst_stage_masks_to_wait_on_ptrs, + in_should_block, + in_opt_fence_ptr); +} + +Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute(Anvil::CommandBufferBase* const* in_cmd_buffer_ptrs_ptr, + uint32_t in_n_cmd_buffers, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) +{ + anvil_assert(in_cmd_buffer_ptrs_ptr != nullptr); + anvil_assert(in_n_cmd_buffers > 0); + anvil_assert(in_dst_stage_masks_to_wait_on_ptrs != nullptr); + anvil_assert(in_semaphore_to_wait_on_ptrs_ptr != nullptr); + + return Anvil::SubmitInfo(in_n_cmd_buffers, + in_cmd_buffer_ptrs_ptr, + 0, /* in_n_semaphores_to_signal */ + nullptr, /* in_opt_semaphore_to_signal_ptrs_ptr */ + in_n_semaphores_to_wait_on, + in_semaphore_to_wait_on_ptrs_ptr, + in_dst_stage_masks_to_wait_on_ptrs, + in_should_block, + in_opt_fence_ptr); +} + +Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute_signal(Anvil::CommandBufferBase* in_cmd_buffer_ptr, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) +{ + anvil_assert(in_cmd_buffer_ptr != nullptr); + anvil_assert(in_semaphore_to_signal_ptrs_ptr != nullptr); + anvil_assert(in_semaphore_to_wait_on_ptrs_ptr != nullptr); + + return Anvil::SubmitInfo(in_cmd_buffer_ptr, + in_n_semaphores_to_signal, + in_semaphore_to_signal_ptrs_ptr, + in_n_semaphores_to_wait_on, + in_semaphore_to_wait_on_ptrs_ptr, + in_dst_stage_masks_to_wait_on_ptrs, + in_should_block, + in_opt_fence_ptr); +} + +Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute_signal(Anvil::CommandBufferBase* const* in_cmd_buffer_ptrs_ptr, + uint32_t in_n_cmd_buffers, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, + const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) +{ + anvil_assert(in_cmd_buffer_ptrs_ptr != nullptr); + anvil_assert(in_n_cmd_buffers > 0); + anvil_assert(in_semaphore_to_signal_ptrs_ptr != nullptr); + anvil_assert(in_semaphore_to_wait_on_ptrs_ptr != nullptr); + + return Anvil::SubmitInfo(in_n_cmd_buffers, + in_cmd_buffer_ptrs_ptr, + in_n_semaphores_to_signal, + in_semaphore_to_signal_ptrs_ptr, + in_n_semaphores_to_wait_on, + in_semaphore_to_wait_on_ptrs_ptr, + in_dst_stage_masks_to_wait_on_ptrs, + in_should_block, + in_opt_fence_ptr); +} + diff --git a/src/misc/types_utils.cpp b/src/misc/types_utils.cpp index 1c9a5b62..412c85fe 100644 --- a/src/misc/types_utils.cpp +++ b/src/misc/types_utils.cpp @@ -64,12 +64,183 @@ Anvil::MTSafety Anvil::Utils::convert_boolean_to_mt_safety_enum(bool in_mt_safe) : MT_SAFETY_DISABLED; } -VkExternalMemoryHandleTypeFlagsKHR Anvil::Utils::convert_external_memory_handle_types_to_vk_external_memory_handle_type_flags(const Anvil::ExternalMemoryHandleTypeFlags& in_flags) +VkBufferCreateFlags Anvil::Utils::convert_buffer_create_flags_to_vk_buffer_create_flags(const Anvil::BufferCreateFlags& in_create_flags) { - ANVIL_REDUNDANT_ARGUMENT_CONST(in_flags); - anvil_assert (in_flags == 0); + VkBufferCreateFlags result = 0; - return 0; + if (in_create_flags & Anvil::BUFFER_CREATE_FLAG_SPARSE_ALIASED_BIT) + { + result |= VK_BUFFER_CREATE_SPARSE_ALIASED_BIT; + } + + if (in_create_flags & Anvil::BUFFER_CREATE_FLAG_SPARSE_BINDING_BIT) + { + result |= VK_BUFFER_CREATE_SPARSE_BINDING_BIT; + } + + if (in_create_flags & Anvil::BUFFER_CREATE_FLAG_SPARSE_RESIDENCY_BIT) + { + result |= VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT; + } + + return result; +} + +VkExternalFenceHandleTypeFlagsKHR Anvil::Utils::convert_external_fence_handle_type_bits_to_vk_external_fence_handle_type_flags(const Anvil::ExternalFenceHandleTypeBits& in_types) +{ + VkExternalFenceHandleTypeFlagsKHR result = 0; + + #if defined(_WIN32) + { + if (in_types & Anvil::EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT) + { + result |= VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR; + } + + if (in_types & Anvil::EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT) + { + result |= VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR; + } + } + #else + { + if (in_types & Anvil::EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT) + { + result |= VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR; + } + + if (in_types & Anvil::EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT) + { + result |= VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT_KHR; + } + } + #endif + + return result; +} + +VkExternalMemoryHandleTypeFlagsKHR Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(const Anvil::ExternalMemoryHandleTypeBits& in_types) +{ + VkExternalMemoryHandleTypeFlagsKHR result = 0; + + #if defined(_WIN32) + { + if (in_types & Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT) + { + result |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR; + } + + if (in_types & Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT) + { + result |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR; + } + + if (in_types & Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT) + { + result |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR; + } + + if (in_types & Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT) + { + result |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR; + } + + if (in_types & Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT) + { + result |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR; + } + + if (in_types & Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT) + { + result |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR; + } + } + #else + { + if (in_types & Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) + { + result |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR; + } + } + #endif + + return result; +} + +VkExternalSemaphoreHandleTypeFlagsKHR Anvil::Utils::convert_external_semaphore_handle_type_bits_to_vk_external_semaphore_handle_type_flags(const Anvil::ExternalSemaphoreHandleTypeBits& in_types) +{ + VkExternalSemaphoreHandleTypeFlagsKHR result = 0; + + #if defined(_WIN32) + { + if (in_types & Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) + { + result |= VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT_KHR; + } + + if (in_types & Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT) + { + result |= VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR; + } + + if (in_types & Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT) + { + result |= VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR; + } + } + #else + { + if (in_types & Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT) + { + result |= VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR; + } + + if (in_types & Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT) + { + result |= VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR; + } + } + #endif + + return result; +} + +Anvil::ExternalSemaphoreHandleTypeBits Anvil::Utils::convert_vk_external_semaphore_handle_type_flags_to_external_semaphore_handle_type_bits(const VkExternalSemaphoreHandleTypeFlagsKHR& in_types) +{ + Anvil::ExternalSemaphoreHandleTypeBits result = 0; + + #if defined(_WIN32) + { + if (in_types & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT_KHR) + { + result |= Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT; + } + + if (in_types & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR) + { + result |= Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT; + } + + if (in_types & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR) + { + result |= Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT; + } + } + #else + { + if (in_types & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR) + { + result |= Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; + } + + if (in_types & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR) + { + result |= Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT; + } + } + #endif + + return result; } bool Anvil::Utils::convert_mt_safety_enum_to_boolean(Anvil::MTSafety in_mt_safety, @@ -856,6 +1027,109 @@ VkShaderStageFlagBits Anvil::Utils::get_shader_stage_flag_bits_from_shader_stage return result; } +Anvil::BufferCreateFlags Anvil::Utils::convert_vk_buffer_create_flags_to_buffer_create_flags(const VkBufferCreateFlags& in_create_flags) +{ + Anvil::BufferCreateFlags result = 0; + + if (in_create_flags & VK_BUFFER_CREATE_SPARSE_ALIASED_BIT) + { + result |= Anvil::BUFFER_CREATE_FLAG_SPARSE_ALIASED_BIT; + } + + if (in_create_flags & VK_BUFFER_CREATE_SPARSE_BINDING_BIT) + { + result |= Anvil::BUFFER_CREATE_FLAG_SPARSE_BINDING_BIT; + } + + if (in_create_flags & VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT) + { + result |= Anvil::BUFFER_CREATE_FLAG_SPARSE_RESIDENCY_BIT; + } + + return result; +} + +Anvil::ExternalFenceHandleTypeBits Anvil::Utils::convert_vk_external_fence_handle_type_flags_to_external_fence_handle_type_bits(const VkExternalFenceHandleTypeFlagsKHR& in_types) +{ + Anvil::ExternalFenceHandleTypeBits result = 0; + + #if defined(_WIN32) + { + if (in_types & VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR) + { + result |= Anvil::EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT; + } + + if (in_types & VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR) + { + result |= Anvil::EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT; + } + } + #else + { + if (in_types & VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR) + { + result |= Anvil::EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT; + } + + if (in_types & VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT_KHR) + { + result |= Anvil::EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT; + } + } + #endif + + return result; +} + +Anvil::ExternalMemoryHandleTypeBits Anvil::Utils::convert_vk_external_memory_handle_type_flags_to_external_memory_handle_type_bits(const VkExternalMemoryHandleTypeFlagsKHR& in_types) +{ + Anvil::ExternalMemoryHandleTypeBits result = 0; + + #if defined(_WIN32) + { + if (in_types & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR) + { + result |= Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT; + } + + if (in_types & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR) + { + result |= Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT; + } + + if (in_types & VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR) + { + result |= Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT; + } + + if (in_types & VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR) + { + result |= Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT; + } + + if (in_types & VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR) + { + result |= Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT; + } + + if (in_types & VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR) + { + result |= Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT; + } + } + #else + { + if (in_types & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR) + { + result |= Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; + } + } + #endif + + return result; +} + /* Please see header for specification */ void Anvil::Utils::get_vk_property_flags_from_memory_feature_flags(Anvil::MemoryFeatureFlags in_mem_feature_flags, VkMemoryPropertyFlags* out_mem_type_flags_ptr, @@ -892,3 +1166,24 @@ void Anvil::Utils::get_vk_property_flags_from_memory_feature_flags(Anvil::Memory *out_mem_heap_flags_ptr = result_mem_heap_flags; *out_mem_type_flags_ptr = result_mem_type_flags; } + +#ifdef _WIN32 + bool Anvil::Utils::is_nt_handle(const Anvil::ExternalFenceHandleTypeBit& in_type) + { + return (in_type == Anvil::EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT); + } + + bool Anvil::Utils::is_nt_handle(const Anvil::ExternalMemoryHandleTypeBit& in_type) + { + return (in_type == Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT || + in_type == Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT || + in_type == Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT || + in_type == Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT); + } + + bool Anvil::Utils::is_nt_handle(const Anvil::ExternalSemaphoreHandleTypeBit& in_type) + { + return (in_type == Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT || + in_type == Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT); + } +#endif \ No newline at end of file diff --git a/src/wrappers/buffer.cpp b/src/wrappers/buffer.cpp index 1b8c1c83..24e271e0 100644 --- a/src/wrappers/buffer.cpp +++ b/src/wrappers/buffer.cpp @@ -180,24 +180,6 @@ Anvil::BufferUniquePtr Anvil::Buffer::create(Anvil::BufferCreateInfoUniquePtr in return new_buffer_ptr; } -bool Anvil::Buffer::do_external_memory_handle_type_sanity_checks() const -{ - const auto& external_memory_handle_types = m_create_info_ptr->get_external_memory_handle_types(); - bool result = true; - - if (external_memory_handle_types != 0) - { - if (!m_device_ptr->supports_external_memory_handles(external_memory_handle_types) ) - { - anvil_assert(!m_device_ptr->supports_external_memory_handles(external_memory_handle_types) ); - - result = false; - } - } - - return result; -} - /* Please see header for specification */ const Anvil::Buffer* Anvil::Buffer::get_base_buffer() { @@ -307,11 +289,6 @@ bool Anvil::Buffer::init() if (m_create_info_ptr->get_type() != BufferType::NONSPARSE_NO_ALLOC_CHILD) { - if (!do_external_memory_handle_type_sanity_checks() ) - { - goto end; - } - /* Determine which queues the buffer should be available to. */ Anvil::Utils::convert_queue_family_bits_to_family_indices(m_device_ptr, m_create_info_ptr->get_queue_families(), @@ -344,7 +321,7 @@ bool Anvil::Buffer::init() { VkExternalMemoryBufferCreateInfoKHR external_memory_buffer_create_info; - external_memory_buffer_create_info.handleTypes = Anvil::Utils::convert_external_memory_handle_types_to_vk_external_memory_handle_type_flags(external_memory_handle_types); + external_memory_buffer_create_info.handleTypes = Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(external_memory_handle_types); external_memory_buffer_create_info.pNext = nullptr; external_memory_buffer_create_info.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR; @@ -389,12 +366,19 @@ bool Anvil::Buffer::init() case Anvil::BufferType::NONSPARSE_ALLOC: { /* Create a memory object and preallocate as much space as we need */ - auto client_data_ptr = m_create_info_ptr->get_client_data(); - auto memory_block_ptr = Anvil::MemoryBlock::create(m_create_info_ptr->get_device(), - m_buffer_memory_reqs.memoryTypeBits, - m_buffer_memory_reqs.size, - m_create_info_ptr->get_memory_features(), - m_create_info_ptr->get_mt_safety () ); + auto client_data_ptr = m_create_info_ptr->get_client_data(); + Anvil::MemoryBlockUniquePtr memory_block_ptr; + + { + auto create_info_ptr = Anvil::MemoryBlockCreateInfo::create_regular(m_create_info_ptr->get_device(), + m_buffer_memory_reqs.memoryTypeBits, + m_buffer_memory_reqs.size, + m_create_info_ptr->get_memory_features() ); + + create_info_ptr->set_mt_safety(m_create_info_ptr->get_mt_safety() ); + + memory_block_ptr = Anvil::MemoryBlock::create(std::move(create_info_ptr) ); + } if (!set_nonsparse_memory( std::move(memory_block_ptr) )) { @@ -424,11 +408,17 @@ bool Anvil::Buffer::init() case Anvil::BufferType::NONSPARSE_NO_ALLOC_CHILD: { - m_owned_memory_blocks.push_back( - Anvil::MemoryBlock::create_derived(m_create_info_ptr->get_parent_buffer_ptr()->get_memory_block(0 /* in_n_memory_block */), - m_create_info_ptr->get_start_offset(), - m_create_info_ptr->get_size() ) - ); + Anvil::MemoryBlockUniquePtr mem_block_ptr; + + { + auto create_info_ptr = Anvil::MemoryBlockCreateInfo::create_derived(m_create_info_ptr->get_parent_buffer_ptr()->get_memory_block(0 /* in_n_memory_block */), + m_create_info_ptr->get_start_offset(), + m_create_info_ptr->get_size() ); + + mem_block_ptr = Anvil::MemoryBlock::create(std::move(create_info_ptr) ); + } + + m_owned_memory_blocks.push_back(std::move(mem_block_ptr) ); m_memory_block_ptr = m_owned_memory_blocks.back().get(); anvil_assert(m_memory_block_ptr != nullptr); @@ -489,7 +479,7 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, /* TODO: Support for sparse buffers */ anvil_assert(m_create_info_ptr->get_type() != Anvil::BufferType::SPARSE_NO_ALLOC); - if ((memory_block_ptr->get_memory_features() & MEMORY_FEATURE_FLAG_MAPPABLE) != 0) + if ((memory_block_ptr->get_create_info_ptr()->get_memory_features() & MEMORY_FEATURE_FLAG_MAPPABLE) != 0) { result = memory_block_ptr->read(in_start_offset, in_size, @@ -571,8 +561,10 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) { - queue_ptr->submit_command_buffer(copy_cmdbuf_ptr.get(), - true /* should_block */); + queue_ptr->submit( + Anvil::SubmitInfo::create_execute(copy_cmdbuf_ptr.get(), + true /* should_block */) + ); } result = staging_buffer_ptr->read(0, @@ -790,10 +782,10 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, anvil_assert(m_page_tracker_ptr->get_n_memory_blocks() == 1); } - anvil_assert(memory_block_ptr != nullptr); - anvil_assert(memory_block_ptr->get_size() >= in_size); + anvil_assert(memory_block_ptr != nullptr); + anvil_assert(memory_block_ptr->get_create_info_ptr()->get_size() >= in_size); - if ((memory_block_ptr->get_memory_features() & MEMORY_FEATURE_FLAG_MAPPABLE) != 0) + if ((memory_block_ptr->get_create_info_ptr()->get_memory_features() & MEMORY_FEATURE_FLAG_MAPPABLE) != 0) { result = memory_block_ptr->write(in_start_offset, in_size, @@ -940,8 +932,10 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) { - queue_ptr->submit_command_buffer(copy_cmdbuf_ptr.get(), - true /* should_block */); + queue_ptr->submit( + Anvil::SubmitInfo::create_execute(copy_cmdbuf_ptr.get(), + true /* should_block */) + ); } result = true; diff --git a/src/wrappers/descriptor_pool.cpp b/src/wrappers/descriptor_pool.cpp index 16a62b54..2aef815a 100644 --- a/src/wrappers/descriptor_pool.cpp +++ b/src/wrappers/descriptor_pool.cpp @@ -220,7 +220,6 @@ bool Anvil::DescriptorPool::alloc_descriptor_sets(uint32_t } result = is_vk_call_successful(result_vk); - end: return result; } diff --git a/src/wrappers/device.cpp b/src/wrappers/device.cpp index a61675ec..54137431 100644 --- a/src/wrappers/device.cpp +++ b/src/wrappers/device.cpp @@ -71,9 +71,9 @@ Anvil::BaseDevice::~BaseDevice() m_command_pool_ptr_per_vk_queue_fam.clear(); m_compute_pipeline_manager_ptr.reset (); - m_descriptor_set_layout_manager_ptr.reset(); m_dummy_dsg_ptr.reset (); m_graphics_pipeline_manager_ptr.reset (); + m_descriptor_set_layout_manager_ptr.reset(); m_pipeline_cache_ptr.reset (); m_pipeline_layout_manager_ptr.reset (); m_owned_queues.clear (); @@ -103,6 +103,88 @@ Anvil::DescriptorSetLayout* Anvil::BaseDevice::get_dummy_descriptor_set_layout() return m_dummy_dsg_ptr->get_descriptor_set_layout(0); } +/** Please see header for specification */ +bool Anvil::BaseDevice::get_memory_types_supported_for_external_handle(const Anvil::ExternalMemoryHandleTypeBit& in_external_handle_type, + ExternalHandleType in_handle, + uint32_t* out_supported_memory_type_bits) const +{ + bool result = false; + + /* Sanity checks */ + #if defined(_WIN32) + { + if (!m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_memory_win32() ) + { + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_memory_win32() ); + + goto end; + } + + if (in_external_handle_type != Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT && + in_external_handle_type != Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT) + { + anvil_assert(in_external_handle_type == Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT || + in_external_handle_type == Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT); + + goto end; + } + } + #else + { + if (!m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_memory_fd() ) + { + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_memory_fd() ); + + goto end; + } + + if (in_external_handle_type != Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) + { + anvil_assert(in_external_handle_type == Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT); + + goto end; + } + } + #endif + + /* Go ahead with the query */ + #if defined(_WIN32) + VkMemoryWin32HandlePropertiesKHR result_props; + + result_props.pNext = nullptr; + result_props.sType = VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR; + #else + VkMemoryFdPropertiesKHR result_props; + + result_props.pNext = nullptr; + result_props.sType = VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR; + #endif + + #if defined(_WIN32) + if (m_khr_external_memory_win32_extension_entrypoints.vkGetMemoryWin32HandlePropertiesKHR(m_device, + static_cast(Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(in_external_handle_type) ), + in_handle, + &result_props) != VK_SUCCESS) + #else + if (m_khr_external_memory_fd_extension_entrypoints.vkGetMemoryFdPropertiesKHR(m_device, + static_cast(Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(in_external_handle_type) ), + in_handle, + &result_props) != VK_SUCCESS) + #endif + { + anvil_assert_fail(); + + goto end; + } + + *out_supported_memory_type_bits = result_props.memoryTypeBits; + + /* All done */ + result = true; +end: + return result; +} + /** Please see header for specification */ uint32_t Anvil::BaseDevice::get_n_queues(uint32_t in_n_queue_family) const { @@ -651,6 +733,36 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, anvil_assert(m_khr_bind_memory2_extension_entrypoints.vkBindImageMemory2KHR != nullptr); } + #if defined(_WIN32) + { + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_fence_win32() ) + { + m_khr_external_fence_win32_extension_entrypoints.vkGetFenceWin32HandleKHR = reinterpret_cast (get_proc_address("vkGetFenceWin32HandleKHR") ); + m_khr_external_fence_win32_extension_entrypoints.vkImportFenceWin32HandleKHR = reinterpret_cast(get_proc_address("vkImportFenceWin32HandleKHR") ); + + anvil_assert(m_khr_external_fence_win32_extension_entrypoints.vkGetFenceWin32HandleKHR != nullptr); + anvil_assert(m_khr_external_fence_win32_extension_entrypoints.vkImportFenceWin32HandleKHR != nullptr); + } + + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_memory_win32() ) + { + m_khr_external_memory_win32_extension_entrypoints.vkGetMemoryWin32HandleKHR = reinterpret_cast (get_proc_address("vkGetMemoryWin32HandleKHR")); + m_khr_external_memory_win32_extension_entrypoints.vkGetMemoryWin32HandlePropertiesKHR = reinterpret_cast(get_proc_address("vkGetMemoryWin32HandlePropertiesKHR")); + + anvil_assert(m_khr_external_memory_win32_extension_entrypoints.vkGetMemoryWin32HandleKHR != nullptr); + anvil_assert(m_khr_external_memory_win32_extension_entrypoints.vkGetMemoryWin32HandlePropertiesKHR != nullptr); + } + + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_semaphore_win32() ) + { + m_khr_external_semaphore_win32_extension_entrypoints.vkGetSemaphoreWin32HandleKHR = reinterpret_cast (get_proc_address("vkGetSemaphoreWin32HandleKHR")); + m_khr_external_semaphore_win32_extension_entrypoints.vkImportSemaphoreWin32HandleKHR = reinterpret_cast(get_proc_address("vkImportSemaphoreWin32HandleKHR")); + + anvil_assert(m_khr_external_semaphore_win32_extension_entrypoints.vkGetSemaphoreWin32HandleKHR != nullptr); + anvil_assert(m_khr_external_semaphore_win32_extension_entrypoints.vkImportSemaphoreWin32HandleKHR != nullptr); + } + } + #endif if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_maintenance1() ) { @@ -854,16 +966,6 @@ bool Anvil::BaseDevice::is_universal_queue_family_index(const uint32_t& in_queue (m_queue_family_index_to_type.at (in_queue_family_index) == Anvil::QueueFamilyType::UNIVERSAL); } -bool Anvil::BaseDevice::supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags& in_types) const -{ - bool result = m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_memory(); - - /* NOTE: Anvil does not support any external memory handle types YET. */ - result &= (in_types == 0); - - return result; -} - /* Please see header for specification */ bool Anvil::BaseDevice::wait_idle() const { @@ -1046,6 +1148,13 @@ Anvil::SwapchainUniquePtr Anvil::SGPUDevice::create_swapchain(Anvil::RenderingSu return result_ptr; } +bool Anvil::SGPUDevice::get_physical_device_buffer_format_properties(const BufferFormatPropertiesQuery& in_query, + Anvil::BufferFormatProperties* out_opt_result_ptr) const +{ + return m_parent_physical_device_ptr->get_buffer_format_properties(in_query, + out_opt_result_ptr); +} + /** Please see header for specification */ const Anvil::PhysicalDeviceFeatures& Anvil::SGPUDevice::get_physical_device_features() const { @@ -1053,30 +1162,25 @@ const Anvil::PhysicalDeviceFeatures& Anvil::SGPUDevice::get_physical_device_feat } /** Please see header for specification */ -const Anvil::FormatProperties& Anvil::SGPUDevice::get_physical_device_format_properties(VkFormat in_format) const +bool Anvil::SGPUDevice::get_physical_device_fence_properties(const FencePropertiesQuery& in_query, + Anvil::FenceProperties* out_opt_result_ptr) const { - return m_parent_physical_device_ptr->get_format_properties(in_format); + return m_parent_physical_device_ptr->get_fence_properties(in_query, + out_opt_result_ptr); } /** Please see header for specification */ -bool Anvil::SGPUDevice::get_physical_device_image_format_properties(VkFormat in_format, - VkImageType in_type, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, - VkImageCreateFlags in_flags, - VkImageFormatProperties& out_result) const +Anvil::FormatProperties Anvil::SGPUDevice::get_physical_device_format_properties(VkFormat in_format) const { - bool result; - - result = is_vk_call_successful(vkGetPhysicalDeviceImageFormatProperties(m_parent_physical_device_ptr->get_physical_device(), - in_format, - in_type, - in_tiling, - in_usage, - in_flags, - &out_result) ); + return m_parent_physical_device_ptr->get_format_properties(in_format); +} - return result; +/** Please see header for specification */ +bool Anvil::SGPUDevice::get_physical_device_image_format_properties(const ImageFormatPropertiesQuery& in_query, + Anvil::ImageFormatProperties* out_opt_result_ptr) const +{ + return m_parent_physical_device_ptr->get_image_format_properties(in_query, + out_opt_result_ptr); } /** Please see header for specification */ diff --git a/src/wrappers/fence.cpp b/src/wrappers/fence.cpp index 0e922049..aea1a154 100644 --- a/src/wrappers/fence.cpp +++ b/src/wrappers/fence.cpp @@ -21,12 +21,15 @@ // #include "misc/debug.h" +#include "misc/external_handle.h" #include "misc/fence_create_info.h" #include "misc/object_tracker.h" +#include "misc/struct_chainer.h" #include "wrappers/device.h" #include "wrappers/fence.h" #include + /* Please see header for specification */ Anvil::Fence::Fence(Anvil::FenceCreateInfoUniquePtr in_create_info_ptr) :DebugMarkerSupportProvider(in_create_info_ptr->get_device(), @@ -73,21 +76,268 @@ Anvil::FenceUniquePtr Anvil::Fence::create(Anvil::FenceCreateInfoUniquePtr in_cr return result_ptr; } +/* Please see header for specification */ +Anvil::ExternalHandleUniquePtr Anvil::Fence::export_to_external_handle(const Anvil::ExternalFenceHandleTypeBit& in_fence_handle_type) +{ + #if defined(_WIN32) + const auto invalid_handle = nullptr; + const bool is_autorelease_handle = Anvil::Utils::is_nt_handle(in_fence_handle_type); + const bool only_one_handle_ever_permitted = Anvil::Utils::is_nt_handle(in_fence_handle_type); + #else + const int invalid_handle = -1; + const bool is_autorelease_handle = true; + const bool only_one_handle_ever_permitted = false; + #endif + + ExternalHandleType result_handle = 0; + Anvil::ExternalHandleUniquePtr result_ptr; + + /* Sanity checks */ + #if defined(_WIN32) + { + if (!m_create_info_ptr->get_device()->get_extension_info()->khr_external_fence_win32() ) + { + anvil_assert(m_create_info_ptr->get_device()->get_extension_info()->khr_external_fence_win32() ); + + goto end; + } + } + #else + { + if (!m_create_info_ptr->get_device()->get_extension_info()->khr_external_fence_fd() ) + { + anvil_assert(m_create_info_ptr->get_device()->get_extension_info()->khr_external_fence_fd() ); + + goto end; + } + } + #endif + + if (only_one_handle_ever_permitted && + m_external_fence_created_for_handle_type.find(in_fence_handle_type) != m_external_fence_created_for_handle_type.end() ) + { + anvil_assert_fail(); + + goto end; + } + + /* Go and try to open a new handle. */ + #if defined(_WIN32) + { + const auto entrypoints_ptr = &m_create_info_ptr->get_device()->get_extension_khr_external_fence_win32_entrypoints(); + VkFenceGetWin32HandleInfoKHR info; + + anvil_assert(m_fence != VK_NULL_HANDLE); + + info.fence = m_fence; + info.handleType = static_cast(Anvil::Utils::convert_external_fence_handle_type_bits_to_vk_external_fence_handle_type_flags(in_fence_handle_type) ); + info.pNext = nullptr; + info.sType = VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR; + + if (entrypoints_ptr->vkGetFenceWin32HandleKHR(m_create_info_ptr->get_device()->get_device_vk(), + &info, + &result_handle) != VK_SUCCESS) + { + anvil_assert_fail(); + + goto end; + } + } + #else + { + const auto entrypoints_ptr = &m_create_info_ptr->get_device()->get_extension_khr_external_fence_fd_entrypoints(); + VkFenceGetFdInfoKHR info; + + anvil_assert(m_fence != VK_NULL_HANDLE); + + info.fence = m_fence; + info.handleType = static_cast(Anvil::Utils::convert_external_fence_handle_type_bits_to_vk_external_fence_handle_type_flags(in_fence_handle_type) ); + info.pNext = nullptr; + info.sType = VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR; + + if (entrypoints_ptr->vkGetFenceFdKHR(m_create_info_ptr->get_device()->get_device_vk(), + &info, + &result_handle) != VK_SUCCESS) + { + anvil_assert_fail(); + + goto end; + } + } + #endif + + if (result_handle == invalid_handle) + { + anvil_assert(result_handle != invalid_handle); + + goto end; + } + + /* If this is necessary, cache the newly created handle so that we do not let the app attempt to re-create the external handle + * for the same Vulkan fence handle. + */ + if (only_one_handle_ever_permitted) + { + m_external_fence_created_for_handle_type[in_fence_handle_type] = true; + } + + result_ptr = Anvil::ExternalHandle::create(result_handle, + is_autorelease_handle); /* in_close_at_destruction_time */ + +end: + return result_ptr; +} + +#if defined(_WIN32) + bool Anvil::Fence::import_from_external_handle(const bool& in_temporary_import, + const Anvil::ExternalFenceHandleTypeBit& in_handle_type, + const ExternalHandleType& in_opt_handle, + const std::wstring& in_opt_name) +#else + bool Anvil::Fence::import_from_external_handle(const bool& in_temporary_import, + const Anvil::ExternalFenceHandleTypeBit& in_handle_type, + const ExternalHandleType& in_handle) +#endif +{ + #if defined(_WIN32) + const auto entrypoints_ptr = &m_device_ptr->get_extension_khr_external_fence_win32_entrypoints(); + #else + const auto entrypoints_ptr = &m_device_ptr->get_extension_khr_external_fence_fd_entrypoints(); + #endif + + bool result = false; + + /* Sanity checks */ + #if defined(_WIN32) + { + if (!m_device_ptr->get_extension_info()->khr_external_fence_win32() ) + { + anvil_assert(m_device_ptr->get_extension_info()->khr_external_fence_win32() ); + + goto end; + } + } + #else + { + if (!m_device_ptr->get_extension_info()->khr_external_fence_fd() ) + { + anvil_assert(m_device_ptr->get_extension_info()->khr_external_fence_fd() ); + + goto end; + } + } + #endif + + /* Proceed */ + #if defined(_WIN32) + { + VkImportFenceWin32HandleInfoKHR info_vk; + + info_vk.fence = m_fence; + info_vk.flags = (in_temporary_import) ? VK_FENCE_IMPORT_TEMPORARY_BIT_KHR + : 0; + info_vk.handle = in_opt_handle; + info_vk.handleType = static_cast(Anvil::Utils::convert_external_fence_handle_type_bits_to_vk_external_fence_handle_type_flags(in_handle_type) ); + info_vk.name = (in_opt_name.size() > 0) ? &in_opt_name.at(0) + : nullptr; + info_vk.pNext = nullptr; + info_vk.sType = VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR; + + result = (entrypoints_ptr->vkImportFenceWin32HandleKHR(m_device_ptr->get_device_vk(), + &info_vk) == VK_SUCCESS); + } + #else + { + VkImportFenceFdInfoKHR info_vk; + + info_vk.fd = in_handle; + info_vk.fence = m_fence; + info_vk.flags = (in_temporary_import) ? VK_FENCE_IMPORT_TEMPORARY_BIT_KHR + : 0; + info_vk.handleType = static_cast(Anvil::Utils::convert_external_fence_handle_type_bits_to_vk_external_fence_handle_type_flags(in_handle_type) ); + info_vk.pNext = nullptr; + info_vk.sType = VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR; + + result = (entrypoints_ptr->vkImportFenceFdKHR(m_device_ptr->get_device_vk(), + &info_vk) == VK_SUCCESS); + } + #endif +end: + return result; +} + bool Anvil::Fence::init() { - VkFenceCreateInfo fence_create_info; - VkResult result (VK_ERROR_INITIALIZATION_FAILED); + VkFenceCreateInfo fence_create_info; + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + Anvil::StructChainer struct_chainer; + Anvil::StructChainUniquePtr struct_chain_ptr; - ANVIL_REDUNDANT_VARIABLE(result); + /* Sanity checks */ + if (m_create_info_ptr->get_exportable_external_fence_handle_types() != Anvil::EXTERNAL_FENCE_HANDLE_TYPE_NONE) + { + if (!m_device_ptr->get_extension_info()->khr_external_fence() ) + { + anvil_assert(m_device_ptr->get_extension_info()->khr_external_fence() ); + + goto end; + } + } /* Spawn a new fence */ - fence_create_info.flags = (m_create_info_ptr->should_create_signalled() ) ? VK_FENCE_CREATE_SIGNALED_BIT - : 0u; - fence_create_info.pNext = nullptr; - fence_create_info.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO; + { + fence_create_info.flags = (m_create_info_ptr->should_create_signalled() ) ? VK_FENCE_CREATE_SIGNALED_BIT + : 0u; + fence_create_info.pNext = nullptr; + fence_create_info.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO; + + struct_chainer.append_struct(fence_create_info); + } + + if (m_create_info_ptr->get_exportable_external_fence_handle_types() != Anvil::EXTERNAL_FENCE_HANDLE_TYPE_NONE) + { + VkExportFenceCreateInfo create_info; + + create_info.handleTypes = Anvil::Utils::convert_external_fence_handle_type_bits_to_vk_external_fence_handle_type_flags(m_create_info_ptr->get_exportable_external_fence_handle_types() ); + create_info.pNext = nullptr; + create_info.sType = VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO_KHR; + + struct_chainer.append_struct(create_info); + } + + #if defined(_WIN32) + { + const Anvil::ExternalNTHandleInfo* nt_handle_info_ptr = nullptr; + + if (m_create_info_ptr->get_exportable_nt_handle_info(&nt_handle_info_ptr) ) + { + VkExportFenceWin32HandleInfoKHR handle_info; + + anvil_assert(nt_handle_info_ptr != nullptr); + anvil_assert(m_create_info_ptr->get_exportable_external_fence_handle_types() & Anvil::EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT); + + handle_info.dwAccess = nt_handle_info_ptr->access; + handle_info.name = (nt_handle_info_ptr->name.size() > 0) ? &nt_handle_info_ptr->name.at(0) + : nullptr; + handle_info.pAttributes = nt_handle_info_ptr->attributes_ptr; + handle_info.pNext = nullptr; + handle_info.sType = VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR; + + struct_chainer.append_struct(handle_info); + } + } + #endif + + struct_chain_ptr = struct_chainer.create_chain(); + if (struct_chain_ptr == nullptr) + { + anvil_assert(struct_chain_ptr != nullptr); + + goto end; + } result = vkCreateFence(m_device_ptr->get_device_vk(), - &fence_create_info, + struct_chain_ptr->get_root_struct(), nullptr, /* pAllocator */ &m_fence); @@ -97,6 +347,7 @@ bool Anvil::Fence::init() set_vk_handle(m_fence); } +end: return is_vk_call_successful(result); } diff --git a/src/wrappers/image.cpp b/src/wrappers/image.cpp index f74d2fb5..08917e13 100644 --- a/src/wrappers/image.cpp +++ b/src/wrappers/image.cpp @@ -24,6 +24,7 @@ #include "misc/debug.h" #include "misc/formats.h" #include "misc/image_create_info.h" +#include "misc/memory_block_create_info.h" #include "misc/object_tracker.h" #include "misc/struct_chainer.h" #include "misc/swapchain_create_info.h" @@ -125,13 +126,18 @@ void Anvil::Image::change_image_layout(Anvil::Queue* in_queue_p if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) { - in_queue_ptr->submit_command_buffer_with_signal_wait_semaphores(transition_command_buffer_ptr.get(), - in_opt_n_set_semaphores, - in_opt_set_semaphore_ptrs, - in_opt_n_wait_semaphores, - in_opt_wait_semaphore_ptrs, - in_opt_wait_dst_stage_mask_ptrs, - true /* should_block */); + Anvil::CommandBufferBase* cmd_buffer_ptr = transition_command_buffer_ptr.get(); + + in_queue_ptr->submit( + Anvil::SubmitInfo::create(1, /* in_n_cmd_bufers */ + &cmd_buffer_ptr, + in_opt_n_set_semaphores, + in_opt_set_semaphore_ptrs, + in_opt_n_wait_semaphores, + in_opt_wait_semaphore_ptrs, + in_opt_wait_dst_stage_mask_ptrs, + true /* should_block */) + ); } } @@ -185,23 +191,6 @@ Anvil::ImageUniquePtr Anvil::Image::create(Anvil::ImageCreateInfoUniquePtr in_cr return result_ptr; } -bool Anvil::Image::do_sanity_checks_for_external_memory_handle_types(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const -{ - bool result = true; - - if (in_external_memory_handle_types != 0) - { - if (!m_device_ptr->supports_external_memory_handles(in_external_memory_handle_types) ) - { - anvil_assert(!m_device_ptr->supports_external_memory_handles(in_external_memory_handle_types) ); - - result = false; - } - } - - return result; -} - /** Please see header for specification */ bool Anvil::Image::get_aspect_subresource_layout(VkImageAspectFlags in_aspect, uint32_t in_n_layer, @@ -285,19 +274,14 @@ bool Anvil::Image::init() { std::vector aspects_used; VkImageCreateFlags image_flags = 0; - VkImageFormatProperties image_format_props; + Anvil::ImageFormatProperties image_format_props; const auto memory_features = m_create_info_ptr->get_memory_features(); uint32_t n_queue_family_indices = 0; uint32_t queue_family_indices[3]; VkResult result = VK_ERROR_INITIALIZATION_FAILED; - bool result_bool = false; + bool result_bool = true; Anvil::StructChainer struct_chainer; - if (!do_sanity_checks_for_external_memory_handle_types(m_create_info_ptr->get_external_memory_handle_types() )) - { - goto end; - } - if ((memory_features & MEMORY_FEATURE_FLAG_MAPPABLE) == 0) { anvil_assert((memory_features & MEMORY_FEATURE_FLAG_HOST_COHERENT) == 0); @@ -324,37 +308,35 @@ bool Anvil::Image::init() &n_queue_family_indices); /* Is the requested texture size valid? */ - result_bool = m_device_ptr->get_physical_device_image_format_properties(m_create_info_ptr->get_format (), - m_create_info_ptr->get_type_vk (), - m_create_info_ptr->get_tiling (), - m_create_info_ptr->get_usage_flags(), - 0, /* flags */ - image_format_props); - - if (!result_bool) + if (!m_device_ptr->get_physical_device_image_format_properties(Anvil::ImageFormatPropertiesQuery(m_create_info_ptr->get_format (), + m_create_info_ptr->get_type_vk (), + m_create_info_ptr->get_tiling (), + m_create_info_ptr->get_usage_flags (), + m_create_info_ptr->get_create_flags() ), + &image_format_props) ) { - anvil_assert(result_bool); + anvil_assert_fail(); goto end; } - anvil_assert(m_create_info_ptr->get_base_mip_width() <= image_format_props.maxExtent.width); + anvil_assert(m_create_info_ptr->get_base_mip_width() <= image_format_props.max_extent.width); if (m_create_info_ptr->get_base_mip_height() > 1) { - anvil_assert(m_create_info_ptr->get_base_mip_height() <= image_format_props.maxExtent.height); + anvil_assert(m_create_info_ptr->get_base_mip_height() <= image_format_props.max_extent.height); } if (m_create_info_ptr->get_base_mip_depth() > 1) { - anvil_assert(m_create_info_ptr->get_base_mip_depth() <= image_format_props.maxExtent.depth); + anvil_assert(m_create_info_ptr->get_base_mip_depth() <= image_format_props.max_extent.depth); } anvil_assert(m_create_info_ptr->get_n_layers() >= 1); if (m_create_info_ptr->get_n_layers() > 1) { - anvil_assert(m_create_info_ptr->get_n_layers() <= image_format_props.maxArrayLayers); + anvil_assert(m_create_info_ptr->get_n_layers() <= image_format_props.n_max_array_layers); } /* If multisample image is requested, make sure the number of samples is supported. */ @@ -362,7 +344,7 @@ bool Anvil::Image::init() if (m_create_info_ptr->get_sample_count() > 1) { - anvil_assert((image_format_props.sampleCounts & m_create_info_ptr->get_sample_count() ) != 0); + anvil_assert((image_format_props.sample_counts & m_create_info_ptr->get_sample_count() ) != 0); } /* Create the image object */ @@ -454,7 +436,7 @@ bool Anvil::Image::init() VkExternalMemoryImageCreateInfoKHR external_memory_image_create_info; const auto handle_types = m_create_info_ptr->get_external_memory_handle_types(); - external_memory_image_create_info.handleTypes = Anvil::Utils::convert_external_memory_handle_types_to_vk_external_memory_handle_type_flags(handle_types); + external_memory_image_create_info.handleTypes = Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(handle_types); external_memory_image_create_info.pNext = nullptr; external_memory_image_create_info.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR; @@ -593,11 +575,18 @@ bool Anvil::Image::init() if (m_create_info_ptr->get_type() == Anvil::ImageType::NONSPARSE_ALLOC) { /* Allocate memory for the image */ - auto memory_block_ptr = Anvil::MemoryBlock::create(m_device_ptr, - m_memory_reqs.memoryTypeBits, - m_memory_reqs.size, - m_create_info_ptr->get_memory_features(), - Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); + Anvil::MemoryBlockUniquePtr memory_block_ptr; + + { + auto create_info_ptr = Anvil::MemoryBlockCreateInfo::create_regular(m_device_ptr, + m_memory_reqs.memoryTypeBits, + m_memory_reqs.size, + m_create_info_ptr->get_memory_features() ); + + create_info_ptr->set_mt_safety(Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); + + memory_block_ptr = Anvil::MemoryBlock::create(std::move(create_info_ptr) ); + } if (memory_block_ptr == nullptr) { @@ -1210,7 +1199,7 @@ void Anvil::Image::on_memory_backing_opaque_update(VkDeviceSize in_resour if (in_memory_block_ptr != nullptr) { - anvil_assert(in_memory_block_ptr->get_size() <= in_memory_block_start_offset + in_size); + anvil_assert(in_memory_block_ptr->get_create_info_ptr()->get_size() <= in_memory_block_start_offset + in_size); } if (m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_NONE) @@ -1929,7 +1918,14 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p temp_cmdbuf_ptr->stop_recording(); /* Execute the command buffer */ - universal_queue_ptr->submit_command_buffer(temp_cmdbuf_ptr.get(), - true /* should_block */); + { + Anvil::CommandBufferBase* cmd_buffer_raw_ptr = temp_cmdbuf_ptr.get(); + + universal_queue_ptr->submit( + Anvil::SubmitInfo::create_execute(&cmd_buffer_raw_ptr, + 1, /* in_n_cmd_buffers */ + true) /* should_block */ + ); + } } } \ No newline at end of file diff --git a/src/wrappers/instance.cpp b/src/wrappers/instance.cpp index 90f0429e..e9dc49db 100644 --- a/src/wrappers/instance.cpp +++ b/src/wrappers/instance.cpp @@ -276,6 +276,30 @@ void Anvil::Instance::enumerate_physical_devices() } } +/** Please see header for specification */ +const Anvil::ExtensionKHRExternalFenceCapabilitiesEntrypoints& Anvil::Instance::get_extension_khr_external_fence_capabilities_entrypoints() const +{ + anvil_assert(m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_external_fence_capabilities() ); + + return m_khr_external_fence_capabilities_entrypoints; +} + +/** Please see header for specification */ +const Anvil::ExtensionKHRExternalMemoryCapabilitiesEntrypoints& Anvil::Instance::get_extension_khr_external_memory_capabilities_entrypoints() const +{ + anvil_assert(m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_external_memory_capabilities() ); + + return m_khr_external_memory_capabilities_entrypoints; +} + +/** Please see header for specification */ +const Anvil::ExtensionKHRExternalSemaphoreCapabilitiesEntrypoints& Anvil::Instance::get_extension_khr_external_semaphore_capabilities_entrypoints() const +{ + anvil_assert(m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_external_semaphore_capabilities() ); + + return m_khr_external_semaphore_capabilities_entrypoints; +} + /** Please see header for specification */ const Anvil::ExtensionKHRGetPhysicalDeviceProperties2& Anvil::Instance::get_extension_khr_get_physical_device_properties2_entrypoints() const { @@ -581,6 +605,30 @@ void Anvil::Instance::init_func_pointers() anvil_assert(m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceQueueFamilyProperties2KHR != nullptr); anvil_assert(m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceSparseImageFormatProperties2KHR != nullptr); } + + if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_external_fence_capabilities() ) + { + m_khr_external_fence_capabilities_entrypoints.vkGetPhysicalDeviceExternalFencePropertiesKHR = reinterpret_cast(vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceExternalFencePropertiesKHR") ); + + anvil_assert(m_khr_external_fence_capabilities_entrypoints.vkGetPhysicalDeviceExternalFencePropertiesKHR!= nullptr); + } + + if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_external_memory_capabilities() ) + { + m_khr_external_memory_capabilities_entrypoints.vkGetPhysicalDeviceExternalBufferPropertiesKHR = reinterpret_cast(vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceExternalBufferPropertiesKHR") ); + + anvil_assert(m_khr_external_memory_capabilities_entrypoints.vkGetPhysicalDeviceExternalBufferPropertiesKHR != nullptr); + } + + if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_external_semaphore_capabilities() ) + { + m_khr_external_semaphore_capabilities_entrypoints.vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = reinterpret_cast(vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR") ); + + anvil_assert(m_khr_external_semaphore_capabilities_entrypoints.vkGetPhysicalDeviceExternalSemaphorePropertiesKHR!= nullptr); + } } /** Please see header for specification */ diff --git a/src/wrappers/memory_block.cpp b/src/wrappers/memory_block.cpp index 6dcc7787..b477ed28 100644 --- a/src/wrappers/memory_block.cpp +++ b/src/wrappers/memory_block.cpp @@ -21,6 +21,7 @@ // #include "misc/debug.h" +#include "misc/external_handle.h" #include "misc/object_tracker.h" #include "misc/struct_chainer.h" #include "wrappers/buffer.h" @@ -30,108 +31,51 @@ #include "wrappers/physical_device.h" /* Please see header for specification */ -Anvil::MemoryBlock::MemoryBlock(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_allowed_memory_bits, - VkDeviceSize in_size, - Anvil::MemoryFeatureFlags in_memory_features, - bool in_mt_safe, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) - :MTSafetySupportProvider (in_mt_safe), - m_allowed_memory_bits (in_allowed_memory_bits), +Anvil::MemoryBlock::MemoryBlock(Anvil::MemoryBlockCreateInfoUniquePtr in_create_info_ptr) + :MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), + in_create_info_ptr->get_device () )), m_backend_object (nullptr), - m_device_ptr (in_device_ptr), - m_external_memory_handle_types (in_external_memory_handle_types), m_gpu_data_map_count (0), m_gpu_data_ptr (nullptr), m_memory (VK_NULL_HANDLE), - m_memory_features (in_memory_features), - m_parent_memory_allocator_backend_ptr(nullptr), - m_parent_memory_block_ptr (nullptr), - m_size (in_size), - m_start_offset (0) + m_memory_type_index (in_create_info_ptr->get_memory_type_index() ), + m_parent_memory_allocator_backend_ptr(nullptr) { - /* Register the object */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_MEMORY_BLOCK, - this); -} - -/* Please see header for specification */ -Anvil::MemoryBlock::MemoryBlock(MemoryBlock* in_parent_memory_block_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size) - :MTSafetySupportProvider(false) -{ - anvil_assert(in_parent_memory_block_ptr != nullptr); - anvil_assert(in_parent_memory_block_ptr->m_gpu_data_ptr == nullptr); - - m_allowed_memory_bits = in_parent_memory_block_ptr->m_allowed_memory_bits; - m_backend_object = in_parent_memory_block_ptr->m_backend_object; - m_device_ptr = in_parent_memory_block_ptr->m_device_ptr; - m_external_memory_handle_types = in_parent_memory_block_ptr->m_external_memory_handle_types; - m_gpu_data_map_count = UINT32_MAX; - m_gpu_data_ptr = nullptr; - m_memory_features = in_parent_memory_block_ptr->m_memory_features; - m_memory = VK_NULL_HANDLE; - m_memory_type_index = UINT32_MAX; - m_on_release_callback_function = in_parent_memory_block_ptr->m_on_release_callback_function; - m_parent_memory_allocator_backend_ptr = in_parent_memory_block_ptr->m_parent_memory_allocator_backend_ptr; - m_parent_memory_block_ptr = in_parent_memory_block_ptr; - m_size = in_size; - m_start_offset = in_start_offset + m_parent_memory_block_ptr->m_start_offset; - - anvil_assert(m_start_offset >= m_parent_memory_block_ptr->m_start_offset); - anvil_assert(m_start_offset + m_size <= m_parent_memory_block_ptr->m_start_offset + m_parent_memory_block_ptr->m_size); + m_create_info_ptr = std::move(in_create_info_ptr); - /* Register the object */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_MEMORY_BLOCK, - this); -} - -/* Please see header for specification */ -Anvil::MemoryBlock::MemoryBlock(const Anvil::BaseDevice* in_device_ptr, - VkDeviceMemory in_memory, - uint32_t in_allowed_memory_bits, - Anvil::MemoryFeatureFlags in_memory_features, - uint32_t in_memory_type_index, - VkDeviceSize in_size, - VkDeviceSize in_start_offset, - OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) - :MTSafetySupportProvider(false) -{ - anvil_assert(in_on_release_callback_function != nullptr); - - m_allowed_memory_bits = in_allowed_memory_bits; - m_backend_object = nullptr; - m_device_ptr = in_device_ptr; - m_external_memory_handle_types = in_external_memory_handle_types; - m_gpu_data_map_count = 0; - m_gpu_data_ptr = nullptr; - m_memory_features = in_memory_features; - m_memory = in_memory; - m_memory_type_index = in_memory_type_index; - m_parent_memory_allocator_backend_ptr = nullptr; - m_parent_memory_block_ptr = nullptr; - m_on_release_callback_function = in_on_release_callback_function; - m_size = in_size; - m_start_offset = in_start_offset; + if (m_create_info_ptr->get_parent_memory_block() != nullptr) + { + m_start_offset = m_create_info_ptr->get_start_offset() + m_create_info_ptr->get_parent_memory_block()->m_start_offset; + } + else + { + m_start_offset = m_create_info_ptr->get_start_offset(); + } /* Register the object */ Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_MEMORY_BLOCK, - this); + this); } /** Releases the underlying Vulkan memory object. */ Anvil::MemoryBlock::~MemoryBlock() { - if (m_parent_memory_block_ptr == nullptr) + auto on_release_callback_function = m_create_info_ptr->get_on_release_callback_function(); + + #ifdef _DEBUG { - anvil_assert(m_gpu_data_map_count.load() == 0); + auto parent_memory_block_ptr = m_create_info_ptr->get_parent_memory_block(); + + if (parent_memory_block_ptr == nullptr) + { + anvil_assert(m_gpu_data_map_count.load() == 0); + } } + #endif - if (m_on_release_callback_function != nullptr) + if (on_release_callback_function != nullptr) { - m_on_release_callback_function(this); + on_release_callback_function(this); } /* Unregister the object */ @@ -140,11 +84,11 @@ Anvil::MemoryBlock::~MemoryBlock() if (m_memory != VK_NULL_HANDLE) { - if (m_on_release_callback_function == nullptr) + if (on_release_callback_function == nullptr) { lock(); { - vkFreeMemory(m_device_ptr->get_device_vk(), + vkFreeMemory(m_create_info_ptr->get_device()->get_device_vk(), m_memory, nullptr /* pAllocator */); } @@ -158,9 +102,11 @@ Anvil::MemoryBlock::~MemoryBlock() /** Finishes the memory mapping process, opened earlier with a open_gpu_memory_access() call. */ void Anvil::MemoryBlock::close_gpu_memory_access() { - if (m_parent_memory_block_ptr != nullptr) + auto parent_memory_block_ptr = m_create_info_ptr->get_parent_memory_block(); + + if (parent_memory_block_ptr != nullptr) { - m_parent_memory_block_ptr->close_gpu_memory_access(); + parent_memory_block_ptr->close_gpu_memory_access(); } else { @@ -177,7 +123,7 @@ void Anvil::MemoryBlock::close_gpu_memory_access() else { /* This block will be entered for memory blocks instantiated without a memory allocator */ - vkUnmapMemory(m_device_ptr->get_device_vk(), + vkUnmapMemory(m_create_info_ptr->get_device()->get_device_vk(), m_memory); } } @@ -189,79 +135,157 @@ void Anvil::MemoryBlock::close_gpu_memory_access() } /* Please see header for specification */ -Anvil::MemoryBlockUniquePtr Anvil::MemoryBlock::create(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_allowed_memory_bits, - VkDeviceSize in_size, - Anvil::MemoryFeatureFlags in_memory_features, - MTSafety in_mt_safety, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) +Anvil::MemoryBlockUniquePtr Anvil::MemoryBlock::create(Anvil::MemoryBlockCreateInfoUniquePtr in_create_info_ptr) { - const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); MemoryBlockUniquePtr result_ptr(nullptr, std::default_delete() ); + const auto type (in_create_info_ptr->get_type() ); result_ptr.reset( - new Anvil::MemoryBlock(in_device_ptr, - in_allowed_memory_bits, - in_size, - in_memory_features, - mt_safe, - in_external_memory_handle_types) + new Anvil::MemoryBlock( + std::move(in_create_info_ptr) + ) ); - if (!result_ptr->init() ) + if (result_ptr != nullptr) { - result_ptr.reset(); + if (type == Anvil::MemoryBlockType::REGULAR) + { + if (!result_ptr->init() ) + { + result_ptr.reset(); + } + } + else + if (type == Anvil::MemoryBlockType::DERIVED_WITH_CUSTOM_DELETE_PROC) + { + result_ptr->m_memory = result_ptr->m_create_info_ptr->get_memory(); + } } return result_ptr; } -/* Please see header for specification */ -Anvil::MemoryBlockUniquePtr Anvil::MemoryBlock::create_derived(MemoryBlock* in_parent_memory_block_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size) +Anvil::ExternalHandleUniquePtr Anvil::MemoryBlock::export_to_external_memory_handle(const Anvil::ExternalMemoryHandleTypeBit& in_memory_handle_type) { - MemoryBlockUniquePtr result_ptr(nullptr, - std::default_delete() ); + #if defined(_WIN32) + const auto invalid_handle = nullptr; + const bool is_autorelease_handle = Anvil::Utils::is_nt_handle(in_memory_handle_type); + const bool only_one_handle_ever_permitted = Anvil::Utils::is_nt_handle(in_memory_handle_type); + #else + const auto invalid_handle = -1; + const bool is_autorelease_handle = true; + const bool only_one_handle_ever_permitted = false; + #endif + + ExternalHandleType result_handle = invalid_handle; + Anvil::ExternalHandleUniquePtr result_returned_ptr; - result_ptr.reset( - new Anvil::MemoryBlock(in_parent_memory_block_ptr, - in_start_offset, - in_size) - ); + /* Sanity checks */ + #if defined(_WIN32) + { + if (!m_create_info_ptr->get_device()->get_extension_info()->khr_external_memory_win32() ) + { + anvil_assert(m_create_info_ptr->get_device()->get_extension_info()->khr_external_memory_win32() ); - return result_ptr; -} + goto end; + } + } + #else + { + if (!m_create_info_ptr->get_device()->get_extension_info()->khr_external_memory_fd() ) + { + anvil_assert(m_create_info_ptr->get_device()->get_extension_info()->khr_external_memory_fd() ); -/* Please see header for specification */ -Anvil::MemoryBlockUniquePtr Anvil::MemoryBlock::create_derived_with_custom_delete_proc(const Anvil::BaseDevice* in_device_ptr, - VkDeviceMemory in_memory, - uint32_t in_allowed_memory_bits, - Anvil::MemoryFeatureFlags in_memory_features, - uint32_t in_memory_type_index, - VkDeviceSize in_size, - VkDeviceSize in_start_offset, - OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) -{ - MemoryBlockUniquePtr result_ptr(nullptr, - std::default_delete() ); + goto end; + } + } + #endif - result_ptr.reset( - new Anvil::MemoryBlock(in_device_ptr, - in_memory, - in_allowed_memory_bits, - in_memory_features, - in_memory_type_index, - in_size, - in_start_offset, - in_on_release_callback_function, - in_external_memory_handle_types) - ); + if (m_create_info_ptr->get_type() != Anvil::MemoryBlockType::REGULAR) + { + anvil_assert(m_create_info_ptr->get_type() == Anvil::MemoryBlockType::REGULAR); - return result_ptr; + goto end; + } + + anvil_assert(m_create_info_ptr->get_parent_memory_block() == nullptr); + + /* Should we try to return a handle which has already been created for this memory block? */ + if (only_one_handle_ever_permitted) + { + auto map_iterator = m_external_handle_type_to_external_handle.find(in_memory_handle_type); + if (map_iterator != m_external_handle_type_to_external_handle.end() ) + { + result_returned_ptr = Anvil::ExternalHandleUniquePtr(map_iterator->second.get(), + [](Anvil::ExternalHandle*){} ); + + goto end; + } + } + + /* Apparently not, go and try to open the new handle then. */ + { + #if defined(_WIN32) + const auto entrypoints_ptr = &m_create_info_ptr->get_device()->get_extension_khr_external_memory_win32_entrypoints(); + VkMemoryGetWin32HandleInfoKHR info; + #else + const auto entrypoints_ptr = &m_create_info_ptr->get_device()->get_extension_khr_external_memory_fd_entrypoints(); + VkMemoryGetFdInfoKHR info; + #endif + + anvil_assert(m_memory != VK_NULL_HANDLE); + + info.handleType = static_cast(Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(in_memory_handle_type) ); + info.memory = m_memory; + info.pNext = nullptr; + + #if defined(_WIN32) + { + info.sType = VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR; + } + #else + { + info.sType = VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR; + } + #endif + + #if defined(_WIN32) + if (entrypoints_ptr->vkGetMemoryWin32HandleKHR(m_create_info_ptr->get_device()->get_device_vk(), + &info, + &result_handle) != VK_SUCCESS) + #else + if (entrypoints_ptr->vkGetMemoryFdKHR(m_create_info_ptr->get_device()->get_device_vk(), + &info, + &result_handle) != VK_SUCCESS) + #endif + { + goto end; + } + } + + /* Cache the newly created handle if it's a NT handle */ + if (only_one_handle_ever_permitted) + { + Anvil::ExternalHandleUniquePtr result_owned_ptr; + + result_owned_ptr = Anvil::ExternalHandle::create (result_handle, + is_autorelease_handle); /* in_close_at_destruction_time */ + result_returned_ptr = Anvil::ExternalHandleUniquePtr(result_owned_ptr.get(), + [](Anvil::ExternalHandle*){} ); + + m_external_handle_type_to_external_handle[in_memory_handle_type] = std::move(result_owned_ptr); + } + else + { + result_returned_ptr = Anvil::ExternalHandle::create(result_handle, + false); /* in_close_at_destruction_time */ + } + + anvil_assert(result_returned_ptr != nullptr); + +end: + return result_returned_ptr; } /** Returns index of a memory type which meets the specified requirements @@ -285,7 +309,7 @@ uint32_t Anvil::MemoryBlock::get_device_memory_type_index(uint32_t const bool is_host_cached_memory_required ((in_memory_features & MEMORY_FEATURE_FLAG_HOST_CACHED) != 0); const bool is_lazily_allocated_memory_required((in_memory_features & MEMORY_FEATURE_FLAG_LAZILY_ALLOCATED) != 0); const bool is_mappable_memory_required ((in_memory_features & MEMORY_FEATURE_FLAG_MAPPABLE) != 0); - const Anvil::MemoryTypes& memory_types (m_device_ptr->get_physical_device_memory_properties().types); + const Anvil::MemoryTypes& memory_types (get_create_info_ptr()->get_device()->get_physical_device_memory_properties().types); if (!is_mappable_memory_required) { @@ -335,9 +359,9 @@ bool Anvil::MemoryBlock::init() { VkMemoryAllocateInfo buffer_data_alloc_info; - buffer_data_alloc_info.allocationSize = m_size; - buffer_data_alloc_info.memoryTypeIndex = get_device_memory_type_index(m_allowed_memory_bits, - m_memory_features); + buffer_data_alloc_info.allocationSize = m_create_info_ptr->get_size(); + buffer_data_alloc_info.memoryTypeIndex = get_device_memory_type_index(m_create_info_ptr->get_allowed_memory_bits(), + m_create_info_ptr->get_memory_features () ); buffer_data_alloc_info.pNext = nullptr; buffer_data_alloc_info.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO; @@ -346,21 +370,69 @@ bool Anvil::MemoryBlock::init() struct_chainer.append_struct(buffer_data_alloc_info); } - if (m_external_memory_handle_types != 0) + if (m_create_info_ptr->get_exportable_external_memory_handle_types() != Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE) { VkExportMemoryAllocateInfoKHR export_memory_alloc_info; - export_memory_alloc_info.handleTypes = Anvil::Utils::convert_external_memory_handle_types_to_vk_external_memory_handle_type_flags(m_external_memory_handle_types); + export_memory_alloc_info.handleTypes = Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(m_create_info_ptr->get_exportable_external_memory_handle_types() ); export_memory_alloc_info.pNext = nullptr; export_memory_alloc_info.sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR; struct_chainer.append_struct(export_memory_alloc_info); + + { + const Anvil::ExternalMemoryHandleImportInfo* handle_import_info_ptr = nullptr; + + if (m_create_info_ptr->get_external_handle_import_info(&handle_import_info_ptr) ) + { + #if defined(_WIN32) + VkImportMemoryWin32HandleInfoKHR handle_info_khr; + #else + VkImportMemoryFdInfoKHR handle_info_khr; + #endif + + handle_info_khr.handleType = static_cast(Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(static_cast(m_create_info_ptr->get_imported_external_memory_handle_type() )) ); + handle_info_khr.pNext = nullptr; + + #if defined(_WIN32) + handle_info_khr.handle = handle_import_info_ptr->handle; + handle_info_khr.name = (handle_import_info_ptr->name.size() > 0) ? handle_import_info_ptr->name.c_str() + : nullptr; + handle_info_khr.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR; + #else + handle_info_khr.fd = handle_import_info_ptr->handle; + handle_info_khr.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR; + #endif + + struct_chainer.append_struct(handle_info_khr); + } + } + + #if defined(_WIN32) + { + const Anvil::ExternalNTHandleInfo* nt_handle_import_info_ptr = nullptr; + + if (m_create_info_ptr->get_external_nt_handle_import_info(&nt_handle_import_info_ptr) ) + { + VkExportMemoryWin32HandleInfoKHR handle_info_khr; + + handle_info_khr.dwAccess = nt_handle_import_info_ptr->access; + handle_info_khr.name = (nt_handle_import_info_ptr->name.size() > 0) ? nt_handle_import_info_ptr->name.c_str() + : nullptr; + handle_info_khr.pAttributes = nt_handle_import_info_ptr->attributes_ptr; + handle_info_khr.pNext = nullptr; + handle_info_khr.sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR; + + struct_chainer.append_struct(handle_info_khr); + } + } + #endif } { auto chain_ptr = struct_chainer.create_chain(); - result = vkAllocateMemory(m_device_ptr->get_device_vk(), + result = vkAllocateMemory(m_create_info_ptr->get_device()->get_device_vk(), chain_ptr->get_root_struct(), nullptr, /* pAllocator */ &m_memory); @@ -385,10 +457,12 @@ bool Anvil::MemoryBlock::intersects(const Anvil::MemoryBlock* in_memory_block_pt if (result) { - if (!(m_start_offset < in_memory_block_ptr->m_start_offset && - m_start_offset + m_size < in_memory_block_ptr->m_start_offset && - in_memory_block_ptr->m_start_offset < m_start_offset && - in_memory_block_ptr->m_start_offset + m_size < m_start_offset) ) + const auto size = m_create_info_ptr->get_size(); + + if (!(m_start_offset < in_memory_block_ptr->m_start_offset && + m_start_offset + size < in_memory_block_ptr->m_start_offset && + in_memory_block_ptr->m_start_offset < m_start_offset && + in_memory_block_ptr->m_start_offset + size < m_start_offset) ) { result = true; } @@ -406,14 +480,15 @@ bool Anvil::MemoryBlock::map(VkDeviceSize in_start_offset, VkDeviceSize in_size, void** out_opt_data_ptr) { - bool result = false; + const auto memory_features = m_create_info_ptr->get_memory_features(); + bool result = false; /* Sanity checks */ - if (m_parent_memory_block_ptr != nullptr) + if (m_create_info_ptr->get_parent_memory_block() != nullptr) { - result = m_parent_memory_block_ptr->map(m_start_offset + in_start_offset, - in_size, - out_opt_data_ptr); + result = m_create_info_ptr->get_parent_memory_block()->map(m_start_offset + in_start_offset, + in_size, + out_opt_data_ptr); } else { @@ -424,7 +499,7 @@ bool Anvil::MemoryBlock::map(VkDeviceSize in_start_offset, goto end; } - if ((m_memory_features & Anvil::MEMORY_FEATURE_FLAG_HOST_COHERENT) == 0) + if ((memory_features & Anvil::MEMORY_FEATURE_FLAG_HOST_COHERENT) == 0) { /* Make sure the mapped region is invalidated before letting the user read from it */ VkMappedMemoryRange mapped_memory_range; @@ -438,7 +513,7 @@ bool Anvil::MemoryBlock::map(VkDeviceSize in_start_offset, mapped_memory_range.size = in_size; mapped_memory_range.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE; - result_vk = vkInvalidateMappedMemoryRanges(m_device_ptr->get_device_vk(), + result_vk = vkInvalidateMappedMemoryRanges(m_create_info_ptr->get_device()->get_device_vk(), 1, /* memRangeCount */ &mapped_memory_range); anvil_assert_vk_call_succeeded(result_vk); @@ -465,15 +540,16 @@ bool Anvil::MemoryBlock::map(VkDeviceSize in_start_offset, **/ bool Anvil::MemoryBlock::open_gpu_memory_access() { - bool result (false); - VkResult result_vk; + const auto memory_features(m_create_info_ptr->get_memory_features() ); + bool result (false); + VkResult result_vk; /* Sanity checks */ - anvil_assert(m_parent_memory_block_ptr == nullptr); + anvil_assert(m_create_info_ptr->get_parent_memory_block() == nullptr); - if ((m_memory_features & Anvil::MEMORY_FEATURE_FLAG_MAPPABLE) == 0) + if ((memory_features & Anvil::MEMORY_FEATURE_FLAG_MAPPABLE) == 0) { - anvil_assert((m_memory_features & Anvil::MEMORY_FEATURE_FLAG_MAPPABLE) != 0); + anvil_assert((memory_features & Anvil::MEMORY_FEATURE_FLAG_MAPPABLE) != 0); goto end; } @@ -487,16 +563,16 @@ bool Anvil::MemoryBlock::open_gpu_memory_access() { result_vk = m_parent_memory_allocator_backend_ptr->map(m_backend_object, 0, /* in_start_offset */ - m_size, + m_create_info_ptr->get_size(), static_cast(&m_gpu_data_ptr) ); } else { /* This block will be entered for memory blocks instantiated without a memory allocator */ - result_vk = vkMapMemory(m_device_ptr->get_device_vk(), + result_vk = vkMapMemory(m_create_info_ptr->get_device()->get_device_vk(), m_memory, 0, /* offset */ - m_size, + m_create_info_ptr->get_size(), 0, /* flags */ static_cast(&m_gpu_data_ptr) ); } @@ -523,14 +599,14 @@ bool Anvil::MemoryBlock::read(VkDeviceSize in_start_offset, bool result(false); anvil_assert(in_size > 0); - anvil_assert(in_start_offset + in_size <= m_size); - anvil_assert(out_result_ptr != nullptr); + anvil_assert(in_start_offset + in_size <= m_create_info_ptr->get_size() ); + anvil_assert(out_result_ptr != nullptr); - if (m_parent_memory_block_ptr != nullptr) + if (m_create_info_ptr->get_parent_memory_block() != nullptr) { - result = m_parent_memory_block_ptr->read(m_start_offset + in_start_offset, - in_size, - out_result_ptr); + result = m_create_info_ptr->get_parent_memory_block()->read(m_start_offset + in_start_offset, + in_size, + out_result_ptr); } else { @@ -541,7 +617,7 @@ bool Anvil::MemoryBlock::read(VkDeviceSize in_start_offset, goto end; } - if ((m_memory_features & Anvil::MEMORY_FEATURE_FLAG_HOST_COHERENT) == 0) + if ((m_create_info_ptr->get_memory_features() & Anvil::MEMORY_FEATURE_FLAG_HOST_COHERENT) == 0) { VkMappedMemoryRange mapped_memory_range; VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); @@ -555,7 +631,7 @@ bool Anvil::MemoryBlock::read(VkDeviceSize in_start_offset, mapped_memory_range.size = in_size; mapped_memory_range.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE; - result_vk = vkInvalidateMappedMemoryRanges(m_device_ptr->get_device_vk(), + result_vk = vkInvalidateMappedMemoryRanges(m_create_info_ptr->get_device()->get_device_vk(), 1, /* memRangeCount */ &mapped_memory_range); anvil_assert_vk_call_succeeded(result_vk); @@ -579,9 +655,9 @@ bool Anvil::MemoryBlock::unmap() { bool result = false; - if (m_parent_memory_block_ptr != nullptr) + if (m_create_info_ptr->get_parent_memory_block() != nullptr) { - result = m_parent_memory_block_ptr->unmap(); + result = m_create_info_ptr->get_parent_memory_block()->unmap(); goto end; } @@ -611,14 +687,14 @@ bool Anvil::MemoryBlock::write(VkDeviceSize in_start_offset, bool result(false); anvil_assert(in_size > 0); - anvil_assert(in_start_offset + in_size <= in_start_offset + m_size); + anvil_assert(in_start_offset + in_size <= in_start_offset + m_create_info_ptr->get_size() ); anvil_assert(in_data != nullptr); - if (m_parent_memory_block_ptr != nullptr) + if (m_create_info_ptr->get_parent_memory_block() != nullptr) { - result = m_parent_memory_block_ptr->write(m_start_offset + in_start_offset, - in_size, - in_data); + result = m_create_info_ptr->get_parent_memory_block()->write(m_start_offset + in_start_offset, + in_size, + in_data); } else { @@ -631,7 +707,7 @@ bool Anvil::MemoryBlock::write(VkDeviceSize in_start_offset, in_data, static_cast(in_size)); - if ((m_memory_features & Anvil::MEMORY_FEATURE_FLAG_HOST_COHERENT) == 0) + if ((m_create_info_ptr->get_memory_features() & Anvil::MEMORY_FEATURE_FLAG_HOST_COHERENT) == 0) { VkMappedMemoryRange mapped_memory_range; VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); @@ -644,7 +720,7 @@ bool Anvil::MemoryBlock::write(VkDeviceSize in_start_offset, mapped_memory_range.size = in_size; mapped_memory_range.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE; - result_vk = vkFlushMappedMemoryRanges(m_device_ptr->get_device_vk(), + result_vk = vkFlushMappedMemoryRanges(m_create_info_ptr->get_device()->get_device_vk(), 1, /* memRangeCount */ &mapped_memory_range); anvil_assert_vk_call_succeeded(result_vk); diff --git a/src/wrappers/physical_device.cpp b/src/wrappers/physical_device.cpp index 2741b713..d998efd8 100644 --- a/src/wrappers/physical_device.cpp +++ b/src/wrappers/physical_device.cpp @@ -70,22 +70,15 @@ Anvil::PhysicalDevice::~PhysicalDevice() **/ bool Anvil::PhysicalDevice::init() { - const Anvil::ExtensionKHRGetPhysicalDeviceProperties2* gpdp2_entrypoints_ptr = nullptr; - VkPhysicalDeviceMemoryProperties memory_properties; - uint32_t n_extensions = 0; - uint32_t n_physical_device_layers = 0; - uint32_t n_physical_device_queues = 0; - bool result = true; - VkResult result_vk = VK_ERROR_INITIALIZATION_FAILED; - bool texture_gather_bias_lod_support = false; + VkPhysicalDeviceMemoryProperties memory_properties; + uint32_t n_extensions = 0; + uint32_t n_physical_device_layers = 0; + uint32_t n_physical_device_queues = 0; + bool result = true; + VkResult result_vk = VK_ERROR_INITIALIZATION_FAILED; anvil_assert(m_physical_device != VK_NULL_HANDLE); - if (m_instance_ptr->get_enabled_extensions_info()->khr_get_physical_device_properties2() ) - { - gpdp2_entrypoints_ptr = &m_instance_ptr->get_extension_khr_get_physical_device_properties2_entrypoints(); - } - /* Retrieve device extensions */ result_vk = vkEnumerateDeviceExtensionProperties(m_physical_device, nullptr, /* pLayerName */ @@ -234,69 +227,6 @@ bool Anvil::PhysicalDevice::init() m_khr_16_bit_storage_features_ptr.get () ); } - /* Retrieve device format properties */ - texture_gather_bias_lod_support = m_extension_info_ptr->get_device_extension_info()->amd_texture_gather_bias_lod(); - - for (VkFormat current_format = static_cast(1); /* skip the _UNDEFINED format */ - current_format < VK_FORMAT_RANGE_SIZE; - current_format = static_cast(current_format + 1)) - { - VkFormatProperties format_props; - - vkGetPhysicalDeviceFormatProperties(m_physical_device, - current_format, - &format_props); - - m_format_properties[current_format] = FormatProperties(format_props); - - /* Can this format be used with VK_AMD_texture_gather_bias_lod? */ - if (gpdp2_entrypoints_ptr != nullptr && - texture_gather_bias_lod_support) - { - VkPhysicalDeviceImageFormatInfo2KHR format_info; - Anvil::StructChainUniquePtr struct_chain_ptr; - Anvil::StructChainer struct_chainer; - Anvil::StructID texture_lod_gather_support_struct_id = UINT32_MAX; - - format_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR; - format_info.pNext = nullptr; - format_info.format = current_format; - format_info.type = VK_IMAGE_TYPE_2D; // irrelevant - format_info.tiling = VK_IMAGE_TILING_LINEAR; // irrelevant - format_info.usage = VK_IMAGE_USAGE_SAMPLED_BIT; // irrelevant - format_info.flags = 0; // irrelevant - - { - VkImageFormatProperties2KHR image_format_props = {}; - - image_format_props.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR; - image_format_props.pNext = nullptr; - - struct_chainer.append_struct(image_format_props); - } - - { - VkTextureLODGatherFormatPropertiesAMD texture_lod_gather_support = {}; - - texture_lod_gather_support.sType = VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD; - texture_lod_gather_support.pNext = nullptr; - - texture_lod_gather_support_struct_id = struct_chainer.append_struct(texture_lod_gather_support); - } - - struct_chain_ptr = struct_chainer.create_chain(); - - if (gpdp2_entrypoints_ptr->vkGetPhysicalDeviceImageFormatProperties2KHR(m_physical_device, - &format_info, - struct_chain_ptr->get_root_struct() ) == VK_SUCCESS) - { - auto texture_lod_gather_support_ptr = struct_chain_ptr->get_struct_with_id(texture_lod_gather_support_struct_id); - - m_format_properties.at(current_format).supports_amd_texture_gather_bias_lod = (texture_lod_gather_support_ptr->supportsTextureGatherLODBiasAMD == VK_TRUE); - } - } - } - /* Retrieve additional device info */ if (m_instance_ptr->get_enabled_extensions_info()->khr_get_physical_device_properties2() ) { @@ -332,33 +262,9 @@ bool Anvil::PhysicalDevice::init() gpdp2_entrypoints.vkGetPhysicalDeviceProperties2KHR(m_physical_device, struct_chain_ptr->get_root_struct() ); - if (result_device_id_props_ptr->deviceLUIDValid) - { - static_assert(sizeof(m_device_LUID) == sizeof(result_device_id_props_ptr->deviceLUID), "Anvil asserts a LUID size different than the Vulkan header"); - - memcpy(m_device_LUID, - &result_device_id_props_ptr->deviceLUID, - sizeof(m_device_LUID) ); - - m_device_LUID_available = true; - } - else - { - m_device_LUID_available = false; - } - - static_assert(sizeof(m_device_UUID) == sizeof(result_device_id_props_ptr->deviceUUID), "Anvil asserts a UUID size different than the Vulkan header"); - static_assert(sizeof(m_driver_UUID) == sizeof(result_device_id_props_ptr->driverUUID), "Anvil asserts a UUID size different than the Vulkan header"); - - memcpy(m_device_UUID, - result_device_id_props_ptr->deviceUUID, - sizeof(m_device_UUID) ); - memcpy(m_driver_UUID, - result_device_id_props_ptr->driverUUID, - sizeof(m_driver_UUID) ); - - m_device_UUID_available = true; - m_driver_UUID_available = true; + m_khr_external_memory_capabilities_physical_device_id_properties_ptr.reset( + new KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties(*result_device_id_props_ptr) + ); } if (m_extension_info_ptr->get_device_extension_info()->amd_shader_core_properties() ) @@ -513,10 +419,11 @@ bool Anvil::PhysicalDevice::init() } } - m_properties = Anvil::PhysicalDeviceProperties(m_amd_shader_core_properties_ptr.get (), - m_core_properties_vk10_ptr.get (), - m_ext_descriptor_indexing_properties_ptr.get(), - m_khr_maintenance3_properties_ptr.get () ); + m_properties = Anvil::PhysicalDeviceProperties(m_amd_shader_core_properties_ptr.get (), + m_core_properties_vk10_ptr.get (), + m_ext_descriptor_indexing_properties_ptr.get (), + m_khr_external_memory_capabilities_physical_device_id_properties_ptr.get(), + m_khr_maintenance3_properties_ptr.get () ); /* Retrieve device queue data */ vkGetPhysicalDeviceQueueFamilyProperties(m_physical_device, @@ -590,6 +497,276 @@ bool Anvil::PhysicalDevice::init() return result; } +bool Anvil::PhysicalDevice::get_buffer_format_properties(const Anvil::BufferFormatPropertiesQuery& in_query, + Anvil::BufferFormatProperties* out_opt_result_ptr) const +{ + const Anvil::ExtensionKHRExternalMemoryCapabilitiesEntrypoints* emc_entrypoints_ptr = nullptr; + VkPhysicalDeviceExternalBufferInfoKHR input_struct; + VkExternalBufferPropertiesKHR result_struct; + bool result = false; + + if (!m_instance_ptr->get_enabled_extensions_info()->khr_external_memory_capabilities() ) + { + anvil_assert(m_instance_ptr->get_enabled_extensions_info()->khr_external_memory_capabilities() ); + + goto end; + } + else + { + emc_entrypoints_ptr = &m_instance_ptr->get_extension_khr_external_memory_capabilities_entrypoints(); + } + + input_struct.flags = Anvil::Utils::convert_buffer_create_flags_to_vk_buffer_create_flags(in_query.create_flags); + input_struct.handleType = static_cast(Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(in_query.external_memory_handle_type) ); + input_struct.pNext = nullptr; + input_struct.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHR; + input_struct.usage = in_query.usage_flags; + + result_struct.pNext = nullptr; + result_struct.sType = VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHR; + + emc_entrypoints_ptr->vkGetPhysicalDeviceExternalBufferPropertiesKHR(m_physical_device, + &input_struct, + &result_struct); + + if (out_opt_result_ptr != nullptr) + { + *out_opt_result_ptr = std::move(Anvil::BufferFormatProperties(ExternalMemoryProperties(result_struct.externalMemoryProperties) )); + } + + /* All done */ + result = true; + +end: + return result; +} + +bool Anvil::PhysicalDevice::get_fence_properties(const Anvil::FencePropertiesQuery& in_query, + Anvil::FenceProperties* out_opt_result_ptr) const +{ + const Anvil::ExtensionKHRExternalFenceCapabilitiesEntrypoints* entrypoints_ptr = nullptr; + VkPhysicalDeviceExternalFenceInfoKHR input_struct; + VkExternalFencePropertiesKHR result_struct; + bool result = false; + + if (!m_instance_ptr->get_enabled_extensions_info()->khr_external_fence_capabilities() ) + { + anvil_assert(m_instance_ptr->get_enabled_extensions_info()->khr_external_fence_capabilities() ); + + goto end; + } + else + { + entrypoints_ptr = &m_instance_ptr->get_extension_khr_external_fence_capabilities_entrypoints(); + } + + input_struct.handleType = static_cast(Anvil::Utils::convert_external_fence_handle_type_bits_to_vk_external_fence_handle_type_flags(in_query.external_fence_handle_type) ); + input_struct.pNext = nullptr; + input_struct.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO_KHR; + + result_struct.pNext = nullptr; + result_struct.sType = VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES_KHR; + + entrypoints_ptr->vkGetPhysicalDeviceExternalFencePropertiesKHR(m_physical_device, + &input_struct, + &result_struct); + + if (out_opt_result_ptr != nullptr) + { + *out_opt_result_ptr = std::move(Anvil::FenceProperties(ExternalFenceProperties(result_struct) )); + } + + /* All done */ + result = true; + +end: + return result; +} + +Anvil::FormatProperties Anvil::PhysicalDevice::get_format_properties(VkFormat in_format) const +{ + VkFormatProperties core_vk10_format_props; + + vkGetPhysicalDeviceFormatProperties(m_physical_device, + in_format, + &core_vk10_format_props); + + return Anvil::FormatProperties(core_vk10_format_props); +} + +/* Please see header for specification */ +bool Anvil::PhysicalDevice::get_image_format_properties(const ImageFormatPropertiesQuery& in_query, + Anvil::ImageFormatProperties* out_opt_result_ptr) const +{ + VkFormatProperties core_vk10_format_props; + VkImageFormatProperties core_vk10_image_format_properties; + Anvil::ExternalMemoryProperties external_handle_props; + const Anvil::ExtensionKHRGetPhysicalDeviceProperties2* gpdp2_entrypoints_ptr = nullptr; + bool result = false; + bool supports_amd_texture_gather_bias_lod = false; + + if (m_instance_ptr->get_enabled_extensions_info()->khr_get_physical_device_properties2() ) + { + gpdp2_entrypoints_ptr = &m_instance_ptr->get_extension_khr_get_physical_device_properties2_entrypoints(); + } + + /* Retrieve core VK1.0 information first. */ + vkGetPhysicalDeviceFormatProperties (m_physical_device, + in_query.format, + &core_vk10_format_props); + vkGetPhysicalDeviceImageFormatProperties(m_physical_device, + in_query.format, + in_query.image_type, + in_query.tiling, + in_query.usage_flags, + in_query.create_flags, + &core_vk10_image_format_properties); + + if (gpdp2_entrypoints_ptr != nullptr) + { + Anvil::StructID external_image_format_props_struct_id = UINT32_MAX; + Anvil::StructChainer input_struct_chainer; + auto instance_extensions_ptr = m_instance_ptr->get_enabled_extensions_info(); + Anvil::StructChainer output_struct_chainer; + Anvil::StructID texture_lod_gather_support_struct_id = UINT32_MAX; + + ANVIL_REDUNDANT_VARIABLE(instance_extensions_ptr); + + { + VkPhysicalDeviceImageFormatInfo2KHR format_info; + + format_info.flags = in_query.create_flags; + format_info.format = in_query.format; + format_info.pNext = nullptr; + format_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR; + format_info.tiling = in_query.tiling; + format_info.type = in_query.image_type; + format_info.usage = in_query.usage_flags; + + input_struct_chainer.append_struct(format_info); + } + + { + VkImageFormatProperties2KHR image_format_props = {}; + + image_format_props.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR; + image_format_props.pNext = nullptr; + + output_struct_chainer.append_struct(image_format_props); + } + + if (m_extension_info_ptr->get_device_extension_info()->amd_texture_gather_bias_lod() ) + { + VkTextureLODGatherFormatPropertiesAMD texture_lod_gather_support = {}; + + texture_lod_gather_support.sType = VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD; + texture_lod_gather_support.pNext = nullptr; + + texture_lod_gather_support_struct_id = output_struct_chainer.append_struct(texture_lod_gather_support); + } + + if (in_query.external_memory_handle_type != EXTERNAL_MEMORY_HANDLE_TYPE_NONE) + { + anvil_assert(instance_extensions_ptr->khr_external_memory_capabilities() ); + + VkPhysicalDeviceExternalImageFormatInfoKHR external_image_format_info; + VkExternalImageFormatPropertiesKHR external_image_format_props; + + external_image_format_info.handleType = static_cast(Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(in_query.external_memory_handle_type) ); + external_image_format_info.pNext = nullptr; + external_image_format_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHR; + + external_image_format_props.pNext = nullptr; + external_image_format_props.sType = VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHR; + + input_struct_chainer.append_struct(external_image_format_info); + + external_image_format_props_struct_id = output_struct_chainer.append_struct(external_image_format_props); + } + + auto input_struct_chain_ptr = input_struct_chainer.create_chain (); + auto output_struct_chain_ptr = output_struct_chainer.create_chain(); + + if (gpdp2_entrypoints_ptr->vkGetPhysicalDeviceImageFormatProperties2KHR(m_physical_device, + input_struct_chain_ptr->get_root_struct (), + output_struct_chain_ptr->get_root_struct() ) == VK_SUCCESS) + { + if (m_extension_info_ptr->get_device_extension_info()->amd_texture_gather_bias_lod() ) + { + /* Can this format be used with AMD_texture_lod_gather_bias? */ + auto texture_lod_gather_support_ptr = output_struct_chain_ptr->get_struct_with_id(texture_lod_gather_support_struct_id); + + supports_amd_texture_gather_bias_lod = (texture_lod_gather_support_ptr->supportsTextureGatherLODBiasAMD == VK_TRUE); + } + + if (in_query.external_memory_handle_type != EXTERNAL_MEMORY_HANDLE_TYPE_NONE) + { + auto image_format_props_ptr = output_struct_chain_ptr->get_struct_with_id(external_image_format_props_struct_id); + + external_handle_props = Anvil::ExternalMemoryProperties(image_format_props_ptr->externalMemoryProperties); + } + } + else + { + goto end; + } + } + + if (out_opt_result_ptr != nullptr) + { + *out_opt_result_ptr = Anvil::ImageFormatProperties(core_vk10_image_format_properties, + supports_amd_texture_gather_bias_lod, + external_handle_props); + } + + result = true; +end: + return result; +} + +/* Please see header for specification */ +bool Anvil::PhysicalDevice::get_semaphore_properties(const Anvil::SemaphorePropertiesQuery& in_query, + Anvil::SemaphoreProperties* out_opt_result_ptr) const +{ + const Anvil::ExtensionKHRExternalSemaphoreCapabilitiesEntrypoints* entrypoints_ptr = nullptr; + VkPhysicalDeviceExternalSemaphoreInfoKHR input_struct; + VkExternalSemaphorePropertiesKHR result_struct; + bool result = false; + + if (!m_instance_ptr->get_enabled_extensions_info()->khr_external_semaphore_capabilities() ) + { + anvil_assert(m_instance_ptr->get_enabled_extensions_info()->khr_external_semaphore_capabilities() ); + + goto end; + } + else + { + entrypoints_ptr = &m_instance_ptr->get_extension_khr_external_semaphore_capabilities_entrypoints(); + } + + input_struct.handleType = static_cast(Anvil::Utils::convert_external_semaphore_handle_type_bits_to_vk_external_semaphore_handle_type_flags(in_query.external_semaphore_handle_type) ); + input_struct.pNext = nullptr; + input_struct.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHR; + + result_struct.pNext = nullptr; + result_struct.sType = VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHR; + + entrypoints_ptr->vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(m_physical_device, + &input_struct, + &result_struct); + + if (out_opt_result_ptr != nullptr) + { + *out_opt_result_ptr = std::move(Anvil::SemaphoreProperties(ExternalSemaphoreProperties(result_struct) )); + } + + /* All done */ + result = true; + +end: + return result; +} + /* Please see header for specification */ bool Anvil::PhysicalDevice::get_sparse_image_format_properties(VkFormat in_format, VkImageType in_type, diff --git a/src/wrappers/query_pool.cpp b/src/wrappers/query_pool.cpp index 3e6fd8af..baf8a8c3 100644 --- a/src/wrappers/query_pool.cpp +++ b/src/wrappers/query_pool.cpp @@ -36,7 +36,8 @@ Anvil::QueryPool::QueryPool(const Anvil::BaseDevice* in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT), MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), - m_n_max_indices (in_n_max_concurrent_queries) + m_n_max_indices (in_n_max_concurrent_queries), + m_query_type (in_query_type) { anvil_assert(in_query_type == VK_QUERY_TYPE_OCCLUSION || in_query_type == VK_QUERY_TYPE_TIMESTAMP); @@ -60,7 +61,8 @@ Anvil::QueryPool::QueryPool(const Anvil::BaseDevice* in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT), MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), - m_n_max_indices (in_n_max_concurrent_queries) + m_n_max_indices (in_n_max_concurrent_queries), + m_query_type (in_query_type) { init(in_query_type, in_query_flags, @@ -136,6 +138,84 @@ Anvil::QueryPoolUniquePtr Anvil::QueryPool::create_ps_query_pool(const Anvil::Ba return result_ptr; } +bool Anvil::QueryPool::get_query_pool_results_internal(const uint32_t& in_first_query_index, + const uint32_t& in_n_queries, + const QueryResultBits& in_query_props, + const bool& in_should_return_uint64, + void* out_results_ptr, + bool* out_all_query_results_retrieved_ptr) +{ + VkQueryResultFlags flags = 0; + uint32_t result_query_size = 0; + bool result = false; + VkResult result_vk; + + if (in_first_query_index + in_n_queries > m_n_max_indices) + { + anvil_assert(in_first_query_index + in_n_queries <= m_n_max_indices); + + goto end; + } + + if (in_should_return_uint64) + { + flags |= VK_QUERY_RESULT_64_BIT; + result_query_size = sizeof(uint64_t); + } + else + { + result_query_size = sizeof(uint32_t); + } + + if (in_query_props & Anvil::QUERY_RESULT_PARTIAL_BIT) + { + flags |= VK_QUERY_RESULT_PARTIAL_BIT; + + if (m_query_type == VK_QUERY_TYPE_TIMESTAMP) + { + anvil_assert(m_query_type != VK_QUERY_TYPE_TIMESTAMP); + + goto end; + } + } + + if (in_query_props & Anvil::QUERY_RESULT_WAIT_BIT) + { + flags |= VK_QUERY_RESULT_WAIT_BIT; + } + + if (in_query_props & Anvil::QUERY_RESULT_WITH_AVAILABILITY_BIT) + { + flags |= VK_QUERY_RESULT_WITH_AVAILABILITY_BIT; + result_query_size *= 2; + } + + /* Execute the request */ + result_vk = vkGetQueryPoolResults(m_device_ptr->get_device_vk(), + m_query_pool_vk, + in_first_query_index, + in_n_queries, + result_query_size * in_n_queries, + out_results_ptr, + (in_should_return_uint64) ? sizeof(uint64_t) : sizeof(uint32_t), + flags); + + if (in_query_props & Anvil::QUERY_RESULT_PARTIAL_BIT) + { + result = is_vk_call_successful(result_vk); + *out_all_query_results_retrieved_ptr = (result_vk == VK_SUCCESS); + } + else + { + result = is_vk_call_successful(result_vk); + *out_all_query_results_retrieved_ptr = (result); + } + + /* All done */ +end: + return result; +} + /* Please see header for specification */ void Anvil::QueryPool::init(VkQueryType in_query_type, VkFlags in_query_flags, diff --git a/src/wrappers/queue.cpp b/src/wrappers/queue.cpp index b0645dd1..b52c0f0d 100644 --- a/src/wrappers/queue.cpp +++ b/src/wrappers/queue.cpp @@ -438,11 +438,15 @@ VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, { static const VkPipelineStageFlags dst_stage_mask(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT); - m_device_ptr->get_universal_queue(0)->submit_command_buffer_with_wait_semaphores(nullptr, /* cmd_buffer_ptr */ - in_n_wait_semaphores, - in_wait_semaphore_ptrs, - &dst_stage_mask, - true); /* should_block */ + m_device_ptr->get_universal_queue(0)->submit( + SubmitInfo::create(nullptr, + 0, /* in_n_semaphores_to_signal */ + nullptr, /* in_opt_semaphore_to_signal_ptrs_ptr */ + in_n_wait_semaphores, + in_wait_semaphore_ptrs, + &dst_stage_mask, + true) /* in_should_block */ + ); for (uint32_t n_presentation = 0; n_presentation < 1; @@ -630,77 +634,126 @@ void Anvil::Queue::present_lock_unlock(uint32_t in_n_swapc } /** Please see header for specification */ -void Anvil::Queue::submit_command_buffers(uint32_t in_n_command_buffers, - Anvil::CommandBufferBase* const* in_opt_cmd_buffer_ptrs, - uint32_t in_n_semaphores_to_signal, - Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptr_ptrs, - uint32_t in_n_semaphores_to_wait_on, - Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptr_ptrs, - const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, - bool in_should_block, - Anvil::Fence* in_opt_fence_ptr) +void Anvil::Queue::submit(const Anvil::SubmitInfo& in_submit_info) { - bool needs_fence_reset(false); - VkResult result (VK_ERROR_INITIALIZATION_FAILED); - VkSubmitInfo submit_info; + Anvil::Fence* fence_ptr (in_submit_info.get_fence() ); + bool needs_fence_reset(false); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + Anvil::StructChainer struct_chainer; - std::vector cmd_buffers_vk (in_n_command_buffers); - std::vector signal_semaphores_vk(in_n_semaphores_to_signal); - std::vector wait_semaphores_vk (in_n_semaphores_to_wait_on); + std::vector cmd_buffers_vk (in_submit_info.get_n_command_buffers () ); + std::vector signal_semaphores_vk(in_submit_info.get_n_signal_semaphores() ); + std::vector wait_semaphores_vk (in_submit_info.get_n_wait_semaphores () ); ANVIL_REDUNDANT_VARIABLE(result); /* Prepare for the submission */ - for (uint32_t n_command_buffer = 0; - n_command_buffer < in_n_command_buffers; - ++n_command_buffer) + switch (in_submit_info.get_type() ) { - cmd_buffers_vk.at(n_command_buffer) = in_opt_cmd_buffer_ptrs[n_command_buffer]->get_command_buffer(); + case SubmissionType::SGPU: + { + VkSubmitInfo submit_info; + + for (uint32_t n_command_buffer = 0; + n_command_buffer < in_submit_info.get_n_command_buffers(); + ++n_command_buffer) + { + cmd_buffers_vk.at(n_command_buffer) = in_submit_info.get_command_buffers_sgpu()[n_command_buffer]->get_command_buffer(); + } + + for (uint32_t n_signal_semaphore = 0; + n_signal_semaphore < in_submit_info.get_n_signal_semaphores(); + ++n_signal_semaphore) + { + auto sem_ptr = in_submit_info.get_signal_semaphores_sgpu()[n_signal_semaphore]; + + signal_semaphores_vk.at(n_signal_semaphore) = sem_ptr->get_semaphore(); + } + + for (uint32_t n_wait_semaphore = 0; + n_wait_semaphore < in_submit_info.get_n_wait_semaphores(); + ++n_wait_semaphore) + { + wait_semaphores_vk.at(n_wait_semaphore) = in_submit_info.get_wait_semaphores_sgpu()[n_wait_semaphore]->get_semaphore(); + } + + submit_info.commandBufferCount = in_submit_info.get_n_command_buffers (); + submit_info.pCommandBuffers = (in_submit_info.get_n_command_buffers() != 0) ? &cmd_buffers_vk.at(0) : nullptr; + submit_info.pNext = nullptr; + submit_info.pSignalSemaphores = (in_submit_info.get_n_signal_semaphores() != 0) ? &signal_semaphores_vk.at(0) : nullptr; + submit_info.pWaitDstStageMask = in_submit_info.get_destination_stage_wait_masks(); + submit_info.pWaitSemaphores = (in_submit_info.get_n_wait_semaphores() != 0) ? &wait_semaphores_vk.at(0) : nullptr; + submit_info.signalSemaphoreCount = in_submit_info.get_n_signal_semaphores(); + submit_info.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO; + submit_info.waitSemaphoreCount = in_submit_info.get_n_wait_semaphores(); + + struct_chainer.append_struct(submit_info); + + break; + } + + default: + { + anvil_assert_fail(); + } } - for (uint32_t n_signal_semaphore = 0; - n_signal_semaphore < in_n_semaphores_to_signal; - ++n_signal_semaphore) + /* Any additional structs to chain? */ + #if defined(_WIN32) { - auto sem_ptr = in_opt_semaphore_to_signal_ptr_ptrs[n_signal_semaphore]; + const uint64_t* d3d12_fence_signal_semaphore_values_ptr = nullptr; + const uint64_t* d3d12_fence_wait_semaphore_values_ptr = nullptr; + + if (in_submit_info.get_d3d12_fence_semaphore_values(&d3d12_fence_signal_semaphore_values_ptr, + &d3d12_fence_wait_semaphore_values_ptr) ) + { + VkD3D12FenceSubmitInfoKHR fence_info; + + fence_info.pNext = nullptr; + fence_info.pSignalSemaphoreValues = d3d12_fence_signal_semaphore_values_ptr; + fence_info.pWaitSemaphoreValues = d3d12_fence_wait_semaphore_values_ptr; + fence_info.signalSemaphoreValuesCount = in_submit_info.get_n_signal_semaphores(); + fence_info.sType = VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR; + fence_info.waitSemaphoreValuesCount = in_submit_info.get_n_wait_semaphores(); - signal_semaphores_vk.at(n_signal_semaphore) = sem_ptr->get_semaphore(); + struct_chainer.append_struct(fence_info); + } } + #endif - for (uint32_t n_wait_semaphore = 0; - n_wait_semaphore < in_n_semaphores_to_wait_on; - ++n_wait_semaphore) + /* Go for it */ + if (fence_ptr == nullptr && + in_submit_info.get_should_block() ) { - wait_semaphores_vk.at(n_wait_semaphore) = in_opt_semaphore_to_wait_on_ptr_ptrs[n_wait_semaphore]->get_semaphore(); + fence_ptr = m_submit_fence_ptr.get(); + needs_fence_reset = true; } - submit_info.commandBufferCount = in_n_command_buffers; - submit_info.pCommandBuffers = (in_n_command_buffers != 0) ? &cmd_buffers_vk.at(0) : nullptr; - submit_info.pNext = nullptr; - submit_info.pSignalSemaphores = (in_n_semaphores_to_signal != 0) ? &signal_semaphores_vk.at(0) : nullptr; - submit_info.pWaitDstStageMask = in_opt_dst_stage_masks_to_wait_on_ptrs; - submit_info.pWaitSemaphores = (in_n_semaphores_to_wait_on != 0) ? &wait_semaphores_vk.at(0) : nullptr; - submit_info.signalSemaphoreCount = in_n_semaphores_to_signal; - submit_info.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO; - submit_info.waitSemaphoreCount = in_n_semaphores_to_wait_on; - - /* Go for it */ - if (in_opt_fence_ptr == nullptr && - in_should_block) - { - in_opt_fence_ptr = m_submit_fence_ptr.get(); - needs_fence_reset = true; + switch (in_submit_info.get_type() ) + { + case SubmissionType::SGPU: + { + submit_command_buffers_lock_unlock(in_submit_info.get_n_command_buffers (), + in_submit_info.get_command_buffers_sgpu (), + in_submit_info.get_n_signal_semaphores (), + in_submit_info.get_signal_semaphores_sgpu(), + in_submit_info.get_n_wait_semaphores (), + in_submit_info.get_wait_semaphores_sgpu (), + fence_ptr, + true); /* in_should_lock */ + + break; + } + + default: + { + anvil_assert_fail(); + } } - submit_command_buffers_lock_unlock(in_n_command_buffers, - in_opt_cmd_buffer_ptrs, - in_n_semaphores_to_signal, - in_opt_semaphore_to_signal_ptr_ptrs, - in_n_semaphores_to_wait_on, - in_opt_semaphore_to_wait_on_ptr_ptrs, - in_opt_fence_ptr, - true); /* in_should_lock */ { + auto chain_ptr = struct_chainer.create_chain(); + if (needs_fence_reset) { m_submit_fence_ptr->reset(); @@ -708,31 +761,44 @@ void Anvil::Queue::submit_command_buffers(uint32_t in_n_ result = vkQueueSubmit(m_queue, 1, /* submitCount */ - &submit_info, - (in_opt_fence_ptr != nullptr) ? in_opt_fence_ptr->get_fence() - : VK_NULL_HANDLE); + chain_ptr->get_root_struct(), + (fence_ptr != nullptr) ? fence_ptr->get_fence() + : VK_NULL_HANDLE); - if (in_should_block) + if (in_submit_info.get_should_block() ) { /* Wait till initialization finishes GPU-side */ result = vkWaitForFences(m_device_ptr->get_device_vk(), 1, /* fenceCount */ - in_opt_fence_ptr->get_fence_ptr(), + fence_ptr->get_fence_ptr(), VK_TRUE, /* waitAll */ UINT64_MAX); /* timeout */ anvil_assert_vk_call_succeeded(result); } } - submit_command_buffers_lock_unlock(in_n_command_buffers, - in_opt_cmd_buffer_ptrs, - in_n_semaphores_to_signal, - in_opt_semaphore_to_signal_ptr_ptrs, - in_n_semaphores_to_wait_on, - in_opt_semaphore_to_wait_on_ptr_ptrs, - in_opt_fence_ptr, - false); /* in_should_lock */ + switch (in_submit_info.get_type() ) + { + case SubmissionType::SGPU: + { + submit_command_buffers_lock_unlock(in_submit_info.get_n_command_buffers (), + in_submit_info.get_command_buffers_sgpu (), + in_submit_info.get_n_signal_semaphores (), + in_submit_info.get_signal_semaphores_sgpu(), + in_submit_info.get_n_wait_semaphores (), + in_submit_info.get_wait_semaphores_sgpu (), + fence_ptr, + false); /* in_should_lock */ + + break; + } + + default: + { + anvil_assert_fail(); + } + } anvil_assert_vk_call_succeeded(result); } diff --git a/src/wrappers/semaphore.cpp b/src/wrappers/semaphore.cpp index ef2fe93f..c667b1b5 100644 --- a/src/wrappers/semaphore.cpp +++ b/src/wrappers/semaphore.cpp @@ -21,11 +21,14 @@ // #include "misc/debug.h" +#include "misc/external_handle.h" #include "misc/object_tracker.h" #include "misc/semaphore_create_info.h" +#include "misc/struct_chainer.h" #include "wrappers/device.h" #include "wrappers/semaphore.h" + /* Please see header for specification */ Anvil::Semaphore::Semaphore(Anvil::SemaphoreCreateInfoUniquePtr in_create_info_ptr) :DebugMarkerSupportProvider(in_create_info_ptr->get_device(), @@ -70,6 +73,199 @@ Anvil::SemaphoreUniquePtr Anvil::Semaphore::create(Anvil::SemaphoreCreateInfoUni return result_ptr; } +/* Please see header for specification */ +Anvil::ExternalHandleUniquePtr Anvil::Semaphore::export_to_external_handle(const Anvil::ExternalSemaphoreHandleTypeBit& in_semaphore_handle_type) +{ + #if defined(_WIN32) + const auto invalid_handle = nullptr; + const bool is_autorelease_handle = Anvil::Utils::is_nt_handle(in_semaphore_handle_type); + const bool only_one_handle_ever_permitted = Anvil::Utils::is_nt_handle(in_semaphore_handle_type); + #else + const int invalid_handle = -1; + const bool is_autorelease_handle = true; + const bool only_one_handle_ever_permitted = false; + #endif + + ExternalHandleType result_handle = invalid_handle; + Anvil::ExternalHandleUniquePtr result_ptr; + + /* Sanity checks */ + #if defined(_WIN32) + { + if (!m_create_info_ptr->get_device()->get_extension_info()->khr_external_semaphore_win32() ) + { + anvil_assert(m_create_info_ptr->get_device()->get_extension_info()->khr_external_semaphore_win32() ); + + goto end; + } + } + #else + { + if (!m_create_info_ptr->get_device()->get_extension_info()->khr_external_semaphore_fd() ) + { + anvil_assert(m_create_info_ptr->get_device()->get_extension_info()->khr_external_semaphore_fd() ); + + goto end; + } + } + #endif + + if (only_one_handle_ever_permitted && + m_external_semaphore_created_for_handle_type.find(in_semaphore_handle_type) != m_external_semaphore_created_for_handle_type.end() ) + { + anvil_assert_fail(); + + goto end; + } + + /* Go and try to open a new handle. */ + { + #if defined(_WIN32) + const auto entrypoints_ptr = &m_create_info_ptr->get_device()->get_extension_khr_external_semaphore_win32_entrypoints(); + VkSemaphoreGetWin32HandleInfoKHR info; + #else + const auto entrypoints_ptr = &m_create_info_ptr->get_device()->get_extension_khr_external_semaphore_fd_entrypoints(); + VkSemaphoreGetFdInfoKHR info; + #endif + + + anvil_assert(m_semaphore != VK_NULL_HANDLE); + + info.handleType = static_cast(Anvil::Utils::convert_external_semaphore_handle_type_bits_to_vk_external_semaphore_handle_type_flags(in_semaphore_handle_type) ); + info.pNext = nullptr; + info.semaphore = m_semaphore; + + #if defined(_WIN32) + { + info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR; + } + #else + { + info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR; + } + #endif + + #if defined(_WIN32) + if (entrypoints_ptr->vkGetSemaphoreWin32HandleKHR(m_create_info_ptr->get_device()->get_device_vk(), + &info, + &result_handle) != VK_SUCCESS) + #else + if (entrypoints_ptr->vkGetSemaphoreFdKHR(m_create_info_ptr->get_device()->get_device_vk(), + &info, + &result_handle) != VK_SUCCESS) + #endif + { + anvil_assert_fail(); + + goto end; + } + + if (result_handle == invalid_handle) + { + anvil_assert(result_handle != invalid_handle); + + goto end; + } + } + + /* Cache the newly created handle if it's a NT handle */ + if (only_one_handle_ever_permitted) + { + m_external_semaphore_created_for_handle_type[in_semaphore_handle_type] = true; + } + + result_ptr = Anvil::ExternalHandle::create(result_handle, + is_autorelease_handle); /* in_close_at_destruction_time */ + +end: + return result_ptr; +} + +#if defined(_WIN32) + bool Anvil::Semaphore::import_from_external_handle(const bool& in_temporary_import, + const Anvil::ExternalSemaphoreHandleTypeBit& in_handle_type, + const ExternalHandleType& in_opt_handle, + const std::wstring& in_opt_name) +#else + bool Anvil::Semaphore::import_from_external_handle(const bool& in_temporary_import, + const Anvil::ExternalSemaphoreHandleTypeBit& in_handle_type, + const ExternalHandleType& in_handle) +#endif +{ + #if defined(_WIN32) + const auto entrypoints_ptr = &m_device_ptr->get_extension_khr_external_semaphore_win32_entrypoints(); + #else + const auto entrypoints_ptr = &m_device_ptr->get_extension_khr_external_semaphore_fd_entrypoints(); + #endif + + bool result = false; + + /* Sanity checks */ + #if defined(_WIN32) + { + if (!m_device_ptr->get_extension_info()->khr_external_semaphore_win32() ) + { + anvil_assert(m_device_ptr->get_extension_info()->khr_external_semaphore_win32() ); + + goto end; + } + } + #else + { + if (!m_device_ptr->get_extension_info()->khr_external_semaphore_fd() ) + { + anvil_assert(m_device_ptr->get_extension_info()->khr_external_semaphore_fd() ); + + goto end; + } + } + #endif + + /* Proceed */ + { + #if defined(_WIN32) + VkImportSemaphoreWin32HandleInfoKHR info_vk; + #else + VkImportSemaphoreFdInfoKHR info_vk; + #endif + + info_vk.flags = (in_temporary_import) ? VK_SEMAPHORE_IMPORT_TEMPORARY_BIT_KHR + : 0; + info_vk.handleType = static_cast(Anvil::Utils::convert_external_semaphore_handle_type_bits_to_vk_external_semaphore_handle_type_flags(in_handle_type) ); + info_vk.pNext = nullptr; + info_vk.semaphore = m_semaphore; + + #if defined(_WIN32) + { + info_vk.handle = in_opt_handle; + info_vk.name = (in_opt_name.size() > 0) ? &in_opt_name.at(0) + : nullptr; + info_vk.sType = VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR; + } + #else + { + info_vk.fd = in_handle; + info_vk.sType = VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR; + } + #endif + + #if defined(_WIN32) + { + result = (entrypoints_ptr->vkImportSemaphoreWin32HandleKHR(m_device_ptr->get_device_vk(), + &info_vk) == VK_SUCCESS); + } + #else + { + result = (entrypoints_ptr->vkImportSemaphoreFdKHR(m_device_ptr->get_device_vk(), + &info_vk) == VK_SUCCESS); + } + #endif + } + +end: + return result; +} + /** Destroys the underlying Vulkan Semaphore instance. */ void Anvil::Semaphore::release_semaphore() { @@ -91,20 +287,55 @@ void Anvil::Semaphore::release_semaphore() /* Please see header for specification */ bool Anvil::Semaphore::reset() { - VkResult result (VK_ERROR_INITIALIZATION_FAILED); - VkSemaphoreCreateInfo semaphore_create_info; - - ANVIL_REDUNDANT_VARIABLE(result); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + Anvil::StructChainer struct_chainer; + Anvil::StructChainUniquePtr struct_chain_ptr; release_semaphore(); + /* Sanity checks */ + if (m_create_info_ptr->get_exportable_external_semaphore_handle_types() != Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_NONE) + { + if (!m_device_ptr->get_extension_info()->khr_external_semaphore() ) + { + anvil_assert(m_device_ptr->get_extension_info()->khr_external_semaphore() ); + + goto end; + } + } + /* Spawn a new semaphore */ - semaphore_create_info.flags = 0; - semaphore_create_info.pNext = nullptr; - semaphore_create_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; + { + VkSemaphoreCreateInfo semaphore_create_info; + + semaphore_create_info.flags = 0; + semaphore_create_info.pNext = nullptr; + semaphore_create_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; + + struct_chainer.append_struct(semaphore_create_info); + } + + if (m_create_info_ptr->get_exportable_external_semaphore_handle_types() != Anvil::EXTERNAL_FENCE_HANDLE_TYPE_NONE) + { + VkExportSemaphoreCreateInfo create_info; + + create_info.handleTypes = Anvil::Utils::convert_external_semaphore_handle_type_bits_to_vk_external_semaphore_handle_type_flags(m_create_info_ptr->get_exportable_external_semaphore_handle_types() ); + create_info.pNext = nullptr; + create_info.sType = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHR; + + struct_chainer.append_struct(create_info); + } + + struct_chain_ptr = struct_chainer.create_chain(); + if (struct_chain_ptr == nullptr) + { + anvil_assert(struct_chain_ptr != nullptr); + + goto end; + } result = vkCreateSemaphore(m_device_ptr->get_device_vk(), - &semaphore_create_info, + struct_chain_ptr->get_root_struct(), nullptr, /* pAllocator */ &m_semaphore); @@ -114,5 +345,6 @@ bool Anvil::Semaphore::reset() set_vk_handle(m_semaphore); } +end: return is_vk_call_successful(result); } \ No newline at end of file diff --git a/src/wrappers/swapchain.cpp b/src/wrappers/swapchain.cpp index b3c12837..b6cb4dc3 100644 --- a/src/wrappers/swapchain.cpp +++ b/src/wrappers/swapchain.cpp @@ -170,10 +170,10 @@ uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, if (in_opt_semaphore_ptr != nullptr) { /* We need to set the semaphore manually in this scenario */ - m_device_ptr->get_universal_queue(0)->submit_command_buffer_with_signal_semaphores(nullptr, /* cmd_buffer_ptr */ - 1, /* n_semaphores_to_signal */ - &in_opt_semaphore_ptr, - true); /* should_block */ + m_device_ptr->get_universal_queue(0)->submit( + Anvil::SubmitInfo::create_signal(1, /* n_semaphores_to_signal */ + &in_opt_semaphore_ptr) + ); } result = m_n_acquire_counter_rounded; From 36dd3c1dac222ede318637e425ffad8371561015 Mon Sep 17 00:00:00 2001 From: razvan1024 Date: Wed, 25 Apr 2018 14:08:59 +0200 Subject: [PATCH 12/50] Fix build without glslang While building Anvil without GLSLANG, we get a compilation error. This commit fixes this compilation error by not defining the get_disassembly function in the ShaderModule class, which was trying to return the m_disassembly variable (which is also not defined in this case). Also the commit removes depencies on the GLSLANG headers in this case. --- CMakeLists.txt | 20 +++++++++++++------- include/wrappers/shader_module.h | 2 ++ src/wrappers/shader_module.cpp | 4 ++-- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5259bc85..410ddcbf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,6 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/include/misc/formats.h" "${Anvil_SOURCE_DIR}/include/misc/fp16.h" "${Anvil_SOURCE_DIR}/include/misc/framebuffer_create_info.h" - "${Anvil_SOURCE_DIR}/include/misc/glsl_to_spirv.h" "${Anvil_SOURCE_DIR}/include/misc/graphics_pipeline_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/image_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/image_view_create_info.h" @@ -128,7 +127,6 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/src/misc/formats.cpp" "${Anvil_SOURCE_DIR}/src/misc/fp16.cpp" "${Anvil_SOURCE_DIR}/src/misc/framebuffer_create_info.cpp" - "${Anvil_SOURCE_DIR}/src/misc/glsl_to_spirv.cpp" "${Anvil_SOURCE_DIR}/src/misc/graphics_pipeline_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/image_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/image_view_create_info.cpp" @@ -187,6 +185,12 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/deps/VulkanMemoryAllocator/vk_mem_alloc.h" ) +if (ANVIL_LINK_WITH_GLSLANG) + list(APPEND SRC_LIST + "${Anvil_SOURCE_DIR}/include/misc/glsl_to_spirv.h" + "${Anvil_SOURCE_DIR}/src/misc/glsl_to_spirv.cpp") +endif() + # prepare source code files for different OS if(WIN32) if (ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) @@ -225,11 +229,13 @@ else() set(CMAKE_CXX_FLAGS "$(CMAKE_CXX_FLAGS) /EHsc /MP") endif() -# Add dependendencies -if (WIN32) - add_subdirectory("deps\\glslang") -else() - add_subdirectory("deps/glslang") +if (ANVIL_LINK_WITH_GLSLANG) + # Add dependendencies + if (WIN32) + add_subdirectory("deps\\glslang") + else() + add_subdirectory("deps/glslang") + endif() endif() # Enable level-4 warnings diff --git a/include/wrappers/shader_module.h b/include/wrappers/shader_module.h index 506ef884..8b976978 100644 --- a/include/wrappers/shader_module.h +++ b/include/wrappers/shader_module.h @@ -146,6 +146,7 @@ namespace Anvil return m_cs_entrypoint_name; } +#ifdef ANVIL_LINK_WITH_GLSLANG /** Returns a disassembly of the SPIR-V blob. * * The actual disassembly is retrieved from glslang and cached for subsequent requests. @@ -153,6 +154,7 @@ namespace Anvil * This function only returns a non-empty string if ANVIL_LINK_WITH_GLSLANG is enabled. */ const std::string& get_disassembly(); +#endif /** Returns name of the fragment shader stage entry-point, as defined at construction time. * diff --git a/src/wrappers/shader_module.cpp b/src/wrappers/shader_module.cpp index aebd0c1c..c34f58e5 100644 --- a/src/wrappers/shader_module.cpp +++ b/src/wrappers/shader_module.cpp @@ -287,10 +287,10 @@ void Anvil::ShaderModule::destroy() } } +#ifdef ANVIL_LINK_WITH_GLSLANG /** Please see header for specification */ const std::string& Anvil::ShaderModule::get_disassembly() { - #ifdef ANVIL_LINK_WITH_GLSLANG { if (m_disassembly.size() == 0) { @@ -303,10 +303,10 @@ const std::string& Anvil::ShaderModule::get_disassembly() m_disassembly = disassembly_sstream.str(); } } - #endif return m_disassembly; } +#endif /** Please see header for specification */ bool Anvil::ShaderModule::init_from_spirv_blob(const char* in_spirv_blob, From fea0930754dc298111a8a3476a48938aa7b48233 Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Fri, 27 Apr 2018 14:17:53 +0200 Subject: [PATCH 13/50] Bug-fixes & improvements --- include/misc/extensions.h | 48 +++++++++++++------- include/misc/external_handle.h | 16 ++++++- include/misc/graphics_pipeline_create_info.h | 3 -- include/misc/types.h | 4 +- include/misc/types_enums.h | 16 +++++-- include/wrappers/fence.h | 3 -- include/wrappers/queue.h | 2 + src/wrappers/fence.cpp | 9 +--- src/wrappers/instance.cpp | 20 +++++--- src/wrappers/queue.cpp | 9 ++++ 10 files changed, 85 insertions(+), 45 deletions(-) diff --git a/include/misc/extensions.h b/include/misc/extensions.h index 8185a5ab..4ade1132 100644 --- a/include/misc/extensions.h +++ b/include/misc/extensions.h @@ -164,9 +164,13 @@ namespace Anvil ValueType khr_surface; #ifdef _WIN32 - ValueType khr_win32_surface; + #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) + ValueType khr_win32_surface; + #endif #else - ValueType khr_xcb_surface; + #if defined(ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT) + ValueType khr_xcb_surface; + #endif #endif std::map values_by_extension_names; @@ -198,9 +202,13 @@ namespace Anvil {ExtensionData(VK_KHR_SURFACE_EXTENSION_NAME, &khr_surface)}, #ifdef _WIN32 - {ExtensionData(VK_KHR_WIN32_SURFACE_EXTENSION_NAME, &khr_win32_surface)}, + #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) + {ExtensionData(VK_KHR_WIN32_SURFACE_EXTENSION_NAME, &khr_win32_surface)}, + #endif #else - {ExtensionData(VK_KHR_XCB_SURFACE_EXTENSION_NAME, &khr_xcb_surface)}, + #if defined(ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT) + {ExtensionData(VK_KHR_XCB_SURFACE_EXTENSION_NAME, &khr_xcb_surface)}, + #endif #endif }; @@ -291,9 +299,13 @@ namespace Anvil virtual bool khr_surface () const = 0; #ifdef _WIN32 - virtual bool khr_win32_surface() const = 0; + #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) + virtual bool khr_win32_surface() const = 0; + #endif #else - virtual bool khr_xcb_surface() const = 0; + #if defined(ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT) + virtual bool khr_xcb_surface() const = 0; + #endif #endif virtual bool by_name(const std::string& in_name) const = 0; @@ -676,19 +688,23 @@ namespace Anvil #ifdef _WIN32 - ValueType khr_win32_surface() const final - { - anvil_assert(!m_expose_device_extensions); + #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) + ValueType khr_win32_surface() const final + { + anvil_assert(!m_expose_device_extensions); - return m_instance_extensions_ptr->khr_win32_surface; - } + return m_instance_extensions_ptr->khr_win32_surface; + } + #endif #else - ValueType khr_xcb_surface() const final - { - anvil_assert(!m_expose_device_extensions); + #if defined(ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT) + ValueType khr_xcb_surface() const final + { + anvil_assert(!m_expose_device_extensions); - return m_instance_extensions_ptr->khr_xcb_surface; - } + return m_instance_extensions_ptr->khr_xcb_surface; + } + #endif #endif /* Private variables */ diff --git a/include/misc/external_handle.h b/include/misc/external_handle.h index 8b06d3d6..6c028023 100644 --- a/include/misc/external_handle.h +++ b/include/misc/external_handle.h @@ -40,11 +40,25 @@ namespace Anvil return m_handle; } + #if defined(_WIN32) + /* If a payload of an object exported to a NT handle is imported to ano ther object, the ownership is passed + * to the new object. + * + * For NT handles, it is assumed the handle should be destroyed when th e wrapper goes out of scope. If the above + * import is performed, you MUST tell ExternalHandleWrapper to release the ownership of the handle, or else anything + * can happen. + */ + void release_ownership() + { + m_close_at_destruction_time = false; + } + #endif + private: ExternalHandle(const ExternalHandleType& in_handle, const bool& in_close_at_destruction_time); - const bool m_close_at_destruction_time; + bool m_close_at_destruction_time; const ExternalHandleType m_handle; ANVIL_DISABLE_ASSIGNMENT_OPERATOR(ExternalHandle); diff --git a/include/misc/graphics_pipeline_create_info.h b/include/misc/graphics_pipeline_create_info.h index f6bc9196..0a9199a3 100644 --- a/include/misc/graphics_pipeline_create_info.h +++ b/include/misc/graphics_pipeline_create_info.h @@ -258,9 +258,6 @@ namespace Anvil uint32_t get_n_viewports() const; - bool get_pipeline_color_blend_attachment_state(uint32_t in_n_subpass_color_attachment, - VkPipelineColorBlendAttachmentState* out_result_ptr) const; - /** Tells what primitive topology has been specified for this instance. **/ VkPrimitiveTopology get_primitive_topology() const; diff --git a/include/misc/types.h b/include/misc/types.h index 1217e2dd..87069d3e 100644 --- a/include/misc/types.h +++ b/include/misc/types.h @@ -50,9 +50,7 @@ /* The following #define is required to include Vulkan entry-point prototype declarations. */ #ifdef _WIN32 - #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) - #define VK_USE_PLATFORM_WIN32_KHR - #endif + #define VK_USE_PLATFORM_WIN32_KHR #else #if defined(ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT) #define VK_USE_PLATFORM_XCB_KHR diff --git a/include/misc/types_enums.h b/include/misc/types_enums.h index e89262fb..467b67c3 100644 --- a/include/misc/types_enums.h +++ b/include/misc/types_enums.h @@ -77,10 +77,12 @@ namespace Anvil EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT = 1 << 0, EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 1 << 1, #else - EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT = 1 << 2, - EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT = 1 << 2, + EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT = 1 << 0, + EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT = 1 << 1, #endif + /* Always last */ + EXTERNAL_FENCE_HANDLE_TYPE_COUNT } ExternalFenceHandleTypeBit; typedef uint32_t ExternalFenceHandleTypeBits; @@ -96,9 +98,11 @@ namespace Anvil EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT = 1 << 4, EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT = 1 << 5, #else - EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT = 1 << 6, + EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT = 1 << 0, #endif + /* Always last */ + EXTERNAL_MEMORY_HANDLE_TYPE_COUNT } ExternalMemoryHandleTypeBit; typedef uint32_t ExternalMemoryHandleTypeBits; @@ -111,10 +115,12 @@ namespace Anvil EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 1 << 1, EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT = 1 << 2, #else - EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT = 1 << 3, - EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT = 1 << 4, + EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT = 1 << 0, + EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT = 1 << 1, #endif + /* Always last */ + EXTERNAL_SEMAPHORE_HANDLE_TYPE_COUNT } ExternalSemaphoreHandleTypeBit; typedef uint32_t ExternalSemaphoreHandleTypeBits; diff --git a/include/wrappers/fence.h b/include/wrappers/fence.h index cb5845be..e8f2a45a 100644 --- a/include/wrappers/fence.h +++ b/include/wrappers/fence.h @@ -82,8 +82,6 @@ namespace Anvil /** Retrieves a pointer to the raw handle to the underlying Vulkan fence instance */ const VkFence* get_fence_ptr() const { - m_possibly_set = true; - return &m_fence; } @@ -158,7 +156,6 @@ namespace Anvil Anvil::FenceCreateInfoUniquePtr m_create_info_ptr; std::map m_external_fence_created_for_handle_type; VkFence m_fence; - mutable bool m_possibly_set; }; }; /* namespace Anvil */ diff --git a/include/wrappers/queue.h b/include/wrappers/queue.h index 99d9f036..51c408e7 100644 --- a/include/wrappers/queue.h +++ b/include/wrappers/queue.h @@ -140,6 +140,8 @@ namespace Anvil return m_supports_sparse_bindings; } + void wait_idle(); + private: /* Private functions */ void present_lock_unlock(uint32_t in_n_swapchains, diff --git a/src/wrappers/fence.cpp b/src/wrappers/fence.cpp index aea1a154..cd4ec807 100644 --- a/src/wrappers/fence.cpp +++ b/src/wrappers/fence.cpp @@ -36,8 +36,7 @@ Anvil::Fence::Fence(Anvil::FenceCreateInfoUniquePtr in_create_info_ptr) VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT), MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), in_create_info_ptr->get_device () )), - m_fence (VK_NULL_HANDLE), - m_possibly_set (false) + m_fence (VK_NULL_HANDLE) { m_create_info_ptr = std::move(in_create_info_ptr); @@ -395,10 +394,6 @@ bool Anvil::Fence::reset() } unlock(); - anvil_assert_vk_call_succeeded(result); - - m_possibly_set = false; - return (result == VK_SUCCESS); } @@ -435,8 +430,6 @@ bool Anvil::Fence::reset_fences(const uint32_t in_n_fences, device_ptr = current_fence.m_device_ptr; fence_cache[n_fence] = current_fence.m_fence; - current_fence.m_possibly_set = false; - current_fence.lock(); } { diff --git a/src/wrappers/instance.cpp b/src/wrappers/instance.cpp index e9dc49db..37bb0602 100644 --- a/src/wrappers/instance.cpp +++ b/src/wrappers/instance.cpp @@ -405,15 +405,13 @@ void Anvil::Instance::init(const std::vector& in_disallowed_instanc n_instance_layer < n_instance_layers; ++n_instance_layer) { - const auto& layer_extensions = m_supported_layers[n_instance_layer].extensions; - const std::string& layer_name = m_supported_layers[n_instance_layer].name; + const std::string& layer_description = m_supported_layers[n_instance_layer].description; + const std::string& layer_name = m_supported_layers[n_instance_layer].name; /* If validation is enabled and this is a layer which issues debug call-backs, cache it, so that * we can request for it at vkCreateInstance() call time */ - if (m_validation_callback_function != nullptr && - std::find(layer_extensions.begin(), - layer_extensions.end(), - VK_EXT_DEBUG_REPORT_EXTENSION_NAME) != layer_extensions.end() ) + if (m_validation_callback_function != nullptr && + layer_description.find("Validation") != std::string::npos) { enabled_layers.push_back(layer_name.c_str() ); } @@ -451,11 +449,21 @@ void Anvil::Instance::init(const std::vector& in_disallowed_instanc extension_enabled_status[VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME] = true; } + if (is_instance_extension_supported(VK_KHR_EXTERNAL_FENCE_CAPABILITIES_EXTENSION_NAME) ) + { + extension_enabled_status[VK_KHR_EXTERNAL_FENCE_CAPABILITIES_EXTENSION_NAME] = true; + } + if (is_instance_extension_supported(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME) ) { extension_enabled_status[VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME] = true; } + if (is_instance_extension_supported(VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME) ) + { + extension_enabled_status[VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME] = true; + } + /* Filter out undesired extensions */ for (const auto& current_extension_name : in_disallowed_instance_level_extensions) { diff --git a/src/wrappers/queue.cpp b/src/wrappers/queue.cpp index b52c0f0d..732de37d 100644 --- a/src/wrappers/queue.cpp +++ b/src/wrappers/queue.cpp @@ -875,3 +875,12 @@ void Anvil::Queue::submit_command_buffers_lock_unlock(uint32_t } } } + +void Anvil::Queue::wait_idle() +{ + lock(); + { + vkQueueWaitIdle(m_queue); + } + unlock(); +} From bfbeb87d7723c6f5cb0a4a79684f620285cb6758 Mon Sep 17 00:00:00 2001 From: Mesonnaise Date: Thu, 2 Aug 2018 11:20:47 -0700 Subject: [PATCH 14/50] Fixed the quatifier and label problem assocated with bake_spirv_by_swapning_glslang_process being split from bake_spirv_blob --- include/misc/glsl_to_spirv.h | 2 +- src/misc/glsl_to_spirv.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/misc/glsl_to_spirv.h b/include/misc/glsl_to_spirv.h index 30c77466..370ba379 100644 --- a/include/misc/glsl_to_spirv.h +++ b/include/misc/glsl_to_spirv.h @@ -332,7 +332,7 @@ namespace Anvil EShLanguage get_glslang_shader_stage () const; #else bool bake_spirv_blob_by_spawning_glslang_process(const std::string& in_glsl_filename_with_path, - const std::string& in_spirv_filename_with_path); + const std::string& in_spirv_filename_with_path) const; #endif /* Private members */ diff --git a/src/misc/glsl_to_spirv.cpp b/src/misc/glsl_to_spirv.cpp index 8006749c..e35a09d8 100644 --- a/src/misc/glsl_to_spirv.cpp +++ b/src/misc/glsl_to_spirv.cpp @@ -561,6 +561,8 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() const } #endif + end: + return result; } @@ -722,12 +724,13 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() const * @return true if successful, false otherwise. **/ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob_by_spawning_glslang_process(const std::string& in_glsl_filename_with_path, - const std::string& in_spirv_filename_with_path) + const std::string& in_spirv_filename_with_path) const { auto callback_arg = OnGLSLToSPIRVConversionAboutToBeStartedCallbackArgument(this); std::string glslangvalidator_params; bool result = false; size_t spirv_file_size = 0; + char* spirv_blob_ptr = nullptr; callback(GLSL_SHADER_TO_SPIRV_GENERATOR_CALLBACK_ID_CONVERSION_ABOUT_TO_START, &callback_arg); @@ -818,7 +821,7 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() const #endif /* Now, read the SPIR-V file contents */ - char* spirv_blob_ptr = nullptr; + Anvil::IO::read_file(in_spirv_filename_with_path.c_str(), false, /* is_text_file */ From 8e49dea14a754b76eba20317654eeb48012e79b9 Mon Sep 17 00:00:00 2001 From: Mesonnaise Date: Thu, 2 Aug 2018 11:50:37 -0700 Subject: [PATCH 15/50] Moved the label to avoid gcc compiling problems --- src/misc/glsl_to_spirv.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/misc/glsl_to_spirv.cpp b/src/misc/glsl_to_spirv.cpp index e35a09d8..1f4c2446 100644 --- a/src/misc/glsl_to_spirv.cpp +++ b/src/misc/glsl_to_spirv.cpp @@ -553,15 +553,18 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() const result = bake_spirv_blob_by_calling_glslang(m_glsl_source_code.c_str() ); } } + #else { /* We need to point glslangvalidator at a location where it can stash the SPIR-V blob. */ result = bake_spirv_blob_by_spawning_glslang_process(glsl_filename_with_path, "temp.spv"); } + +end: #endif - end: + return result; } From f53862a629ac1f5125b75c6b5d1dfdd28d93aee8 Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Thu, 16 Aug 2018 10:34:36 +0200 Subject: [PATCH 16/50] Add support for EXT_vertex_attribute_divisor Add support for KHR_dedicated_allocation Add support for VK_KHR_draw_indirect_count Add support for VK_KHR_get_memory_requirements2 Minor bug-fixes & improvements. Various interop support improvements Update Khronos Vulkan headers to v82 --- include/misc/buffer_create_info.h | 14 +- include/misc/extensions.h | 40 + include/misc/external_handle.h | 6 +- include/misc/fence_create_info.h | 22 +- include/misc/formats.h | 42 + include/misc/graphics_pipeline_create_info.h | 29 +- include/misc/image_create_info.h | 10 +- include/misc/memory_allocator.h | 364 +++++--- include/misc/memory_block_create_info.h | 79 +- include/misc/page_tracker.h | 2 - include/misc/semaphore_create_info.h | 61 ++ include/misc/types_struct.h | 72 +- include/misc/types_utils.h | 2 +- include/misc/window_factory.h | 4 +- include/misc/window_win3264.h | 6 +- include/misc/window_xcb.h | 5 +- include/vulkan/vulkan_core.h | 343 ++++++- include/wrappers/buffer.h | 17 +- include/wrappers/command_buffer.h | 118 ++- include/wrappers/device.h | 42 +- include/wrappers/fence.h | 3 +- include/wrappers/graphics_pipeline_manager.h | 30 + include/wrappers/image.h | 19 +- include/wrappers/physical_device.h | 5 +- include/wrappers/queue.h | 2 +- include/wrappers/semaphore.h | 3 +- src/misc/buffer_create_info.cpp | 82 +- src/misc/fence_create_info.cpp | 11 +- src/misc/formats.cpp | 664 +++++++++----- src/misc/graphics_pipeline_create_info.cpp | 12 +- src/misc/image_create_info.cpp | 56 +- .../memalloc_backends/backend_oneshot.cpp | 120 ++- src/misc/memalloc_backends/backend_vma.cpp | 35 +- src/misc/memory_allocator.cpp | 835 +++++++++++------- src/misc/memory_block_create_info.cpp | 9 +- src/misc/page_tracker.cpp | 51 +- src/misc/semaphore_create_info.cpp | 10 +- src/misc/types_struct.cpp | 55 +- src/misc/window_factory.cpp | 9 +- src/misc/window_win3264.cpp | 13 +- src/misc/window_xcb.cpp | 19 +- src/wrappers/buffer.cpp | 105 ++- src/wrappers/command_buffer.cpp | 164 ++++ src/wrappers/device.cpp | 65 +- src/wrappers/fence.cpp | 6 +- src/wrappers/graphics_pipeline_manager.cpp | 135 ++- src/wrappers/image.cpp | 137 ++- src/wrappers/instance.cpp | 8 +- src/wrappers/memory_block.cpp | 138 +-- src/wrappers/physical_device.cpp | 75 +- src/wrappers/queue.cpp | 8 +- src/wrappers/semaphore.cpp | 24 + 52 files changed, 3117 insertions(+), 1069 deletions(-) diff --git a/include/misc/buffer_create_info.h b/include/misc/buffer_create_info.h index 5230fc6e..0801f803 100644 --- a/include/misc/buffer_create_info.h +++ b/include/misc/buffer_create_info.h @@ -140,9 +140,9 @@ namespace Anvil return m_device_ptr; } - const Anvil::ExternalMemoryHandleTypeBits& get_external_memory_handle_types() const + const Anvil::ExternalMemoryHandleTypeBits& get_exportable_external_memory_handle_types() const { - return m_external_memory_handle_types; + return m_exportable_external_memory_handle_types; } const Anvil::MemoryFeatureFlags& get_memory_features() const @@ -222,9 +222,9 @@ namespace Anvil m_device_ptr = in_device_ptr; } - void set_external_memory_handle_types(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) + void set_exportable_external_memory_handle_types(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) { - m_external_memory_handle_types = in_external_memory_handle_types; + m_exportable_external_memory_handle_types = in_external_memory_handle_types; } void set_memory_features(const Anvil::MemoryFeatureFlags& in_memory_features) @@ -274,7 +274,7 @@ namespace Anvil VkBufferUsageFlags in_usage_flags, Anvil::SparseResidencyScope in_residency_scope, MTSafety in_mt_safety, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types); + Anvil::ExternalMemoryHandleTypeBits in_exportable_external_memory_handle_types); BufferCreateInfo(const Anvil::BufferType& in_buffer_type, const Anvil::BaseDevice* in_device_ptr, VkDeviceSize in_size, @@ -283,7 +283,7 @@ namespace Anvil VkBufferUsageFlags in_usage_flags, MemoryFeatureFlags in_memory_features, MTSafety in_mt_safety, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types, + Anvil::ExternalMemoryHandleTypeBits in_exportable_external_memory_handle_types, const void* in_opt_client_data_ptr); BufferCreateInfo(Anvil::Buffer* in_parent_buffer_ptr, VkDeviceSize in_start_offset, @@ -293,7 +293,7 @@ namespace Anvil /* Private variables */ const void* m_client_data_ptr; const Anvil::BaseDevice* m_device_ptr; - Anvil::ExternalMemoryHandleTypeBits m_external_memory_handle_types; + Anvil::ExternalMemoryHandleTypeBits m_exportable_external_memory_handle_types; Anvil::MemoryFeatureFlags m_memory_features; MTSafety m_mt_safety; Anvil::Buffer* const m_parent_buffer_ptr; diff --git a/include/misc/extensions.h b/include/misc/extensions.h index 4ade1132..7ba5c1f9 100644 --- a/include/misc/extensions.h +++ b/include/misc/extensions.h @@ -51,12 +51,16 @@ namespace Anvil ValueType ext_shader_stencil_export; ValueType ext_shader_subgroup_ballot; ValueType ext_shader_subgroup_vote; + ValueType ext_vertex_attribute_divisor; ValueType khr_16bit_storage; ValueType khr_bind_memory2; + ValueType khr_dedicated_allocation; ValueType khr_descriptor_update_template; + ValueType khr_draw_indirect_count; ValueType khr_external_fence; ValueType khr_external_memory; ValueType khr_external_semaphore; + ValueType khr_get_memory_requirements2; ValueType khr_maintenance1; ValueType khr_maintenance3; ValueType khr_storage_buffer_storage_class; @@ -113,8 +117,11 @@ namespace Anvil {ExtensionData(VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME, &ext_shader_stencil_export)}, {ExtensionData(VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME, &ext_shader_subgroup_ballot)}, {ExtensionData(VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME, &ext_shader_subgroup_vote)}, + {ExtensionData(VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, &ext_vertex_attribute_divisor)}, {ExtensionData(VK_KHR_16BIT_STORAGE_EXTENSION_NAME, &khr_16bit_storage)}, + {ExtensionData(VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME, &khr_dedicated_allocation)}, {ExtensionData(VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME, &khr_descriptor_update_template)}, + {ExtensionData(VK_KHR_DRAW_INDIRECT_COUNT_EXTENSION_NAME, &khr_draw_indirect_count)}, {ExtensionData(VK_KHR_EXTERNAL_FENCE_EXTENSION_NAME, &khr_external_fence)}, {ExtensionData(VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME, &khr_external_memory)}, {ExtensionData(VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME, &khr_external_semaphore)}, @@ -127,6 +134,7 @@ namespace Anvil {ExtensionData(VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME, &khr_external_memory_fd)}, {ExtensionData(VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME, &khr_external_semaphore_fd)}, #endif + {ExtensionData(VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME, &khr_get_memory_requirements2)}, {ExtensionData(VK_KHR_MAINTENANCE1_EXTENSION_NAME, &khr_maintenance1)}, {ExtensionData(VK_KHR_MAINTENANCE3_EXTENSION_NAME, &khr_maintenance3)}, {ExtensionData(VK_KHR_BIND_MEMORY_2_EXTENSION_NAME, &khr_bind_memory2)}, @@ -260,9 +268,12 @@ namespace Anvil virtual ValueType ext_shader_stencil_export () const = 0; virtual ValueType ext_shader_subgroup_ballot () const = 0; virtual ValueType ext_shader_subgroup_vote () const = 0; + virtual ValueType ext_vertex_attribute_divisor () const = 0; virtual ValueType khr_16bit_storage () const = 0; virtual ValueType khr_bind_memory2 () const = 0; + virtual ValueType khr_dedicated_allocation () const = 0; virtual ValueType khr_descriptor_update_template () const = 0; + virtual ValueType khr_draw_indirect_count () const = 0; virtual ValueType khr_external_fence () const = 0; virtual ValueType khr_external_memory () const = 0; virtual ValueType khr_external_semaphore () const = 0; @@ -275,6 +286,7 @@ namespace Anvil virtual ValueType khr_external_memory_fd () const = 0; virtual ValueType khr_external_semaphore_fd() const = 0; #endif + virtual ValueType khr_get_memory_requirements2 () const = 0; virtual ValueType khr_maintenance1 () const = 0; virtual ValueType khr_maintenance3 () const = 0; virtual ValueType khr_storage_buffer_storage_class () const = 0; @@ -510,6 +522,13 @@ namespace Anvil return m_device_extensions_ptr->ext_descriptor_indexing; } + ValueType ext_vertex_attribute_divisor() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_vertex_attribute_divisor; + } + ValueType ext_shader_stencil_export() const final { anvil_assert(m_expose_device_extensions); @@ -545,6 +564,13 @@ namespace Anvil return m_device_extensions_ptr->khr_bind_memory2; } + ValueType khr_dedicated_allocation() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_dedicated_allocation; + } + ValueType khr_descriptor_update_template() const final { anvil_assert(m_expose_device_extensions); @@ -552,6 +578,13 @@ namespace Anvil return m_device_extensions_ptr->khr_descriptor_update_template; } + ValueType khr_draw_indirect_count() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_draw_indirect_count; + } + ValueType khr_external_fence() const final { anvil_assert(m_expose_device_extensions); @@ -621,6 +654,13 @@ namespace Anvil } #endif + ValueType khr_get_memory_requirements2() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_get_memory_requirements2; + } + ValueType khr_maintenance1() const final { anvil_assert(m_expose_device_extensions); diff --git a/include/misc/external_handle.h b/include/misc/external_handle.h index 6c028023..79d3d65a 100644 --- a/include/misc/external_handle.h +++ b/include/misc/external_handle.h @@ -41,11 +41,11 @@ namespace Anvil } #if defined(_WIN32) - /* If a payload of an object exported to a NT handle is imported to ano ther object, the ownership is passed + /* If a payload of an object exported to a NT handle is imported to another object, the ownership is passed * to the new object. * - * For NT handles, it is assumed the handle should be destroyed when th e wrapper goes out of scope. If the above - * import is performed, you MUST tell ExternalHandleWrapper to release the ownership of the handle, or else anything + * For NT handles, it is assumed the handle should be destroyed when the wrapper goes out of scope. If the above + * import is performed, you MUST tell ExternalHandleWrapper to release the ownership of the handle, or else anything * can happen. */ void release_ownership() diff --git a/include/misc/fence_create_info.h b/include/misc/fence_create_info.h index 5021c9c5..16517b04 100644 --- a/include/misc/fence_create_info.h +++ b/include/misc/fence_create_info.h @@ -95,11 +95,23 @@ namespace Anvil { anvil_assert(!m_exportable_nt_handle_info_specified); - m_exportable_nt_handle_info.access = in_access; - m_exportable_nt_handle_info.attributes_ptr = in_opt_attributes_ptr; - m_exportable_nt_handle_info.name = in_name; + m_exportable_nt_handle_info.access = in_access; + m_exportable_nt_handle_info.name = in_name; + m_exportable_nt_handle_info_specified = true; + + if (in_opt_attributes_ptr != nullptr) + { + m_exportable_nt_handle_info_security_attributes = *in_opt_attributes_ptr; + m_exportable_nt_handle_info_security_attributes_specified = true; + + m_exportable_nt_handle_info.attributes_ptr = &m_exportable_nt_handle_info_security_attributes; + } + else + { + m_exportable_nt_handle_info.attributes_ptr = nullptr; + m_exportable_nt_handle_info_security_attributes_specified = false; + } - m_exportable_nt_handle_info_specified = true; } #endif @@ -141,6 +153,8 @@ namespace Anvil #ifdef _WIN32 ExternalNTHandleInfo m_exportable_nt_handle_info; + SECURITY_ATTRIBUTES m_exportable_nt_handle_info_security_attributes; + bool m_exportable_nt_handle_info_security_attributes_specified; bool m_exportable_nt_handle_info_specified; #endif diff --git a/include/misc/formats.h b/include/misc/formats.h index adc5d460..255067b7 100644 --- a/include/misc/formats.h +++ b/include/misc/formats.h @@ -73,6 +73,43 @@ namespace Anvil static bool get_format_aspects(VkFormat in_format, std::vector* out_aspects_ptr); + /** Returns bit layout for the specified format. + * + * NOTE: Only non-compressed formats are supported. + * NOTE: Components not used by the specified format have start and end bit indices set to UINT32_MAX. + * + * @param in_format Non-compressed format to use for the query. + * @param out_opt_red_component_start_bit_index_ptr If not null, deref will be set to the bit index, from which red component data starts. + * @param out_opt_red_component_end_bit_index_ptr If not null, deref will be set to the bit index, at which red component data ends. (data under the bit includes the data!) + * @param out_opt_green_component_start_bit_index_ptr If not null, deref will be set to the bit index, from which green component data starts. + * @param out_opt_green_component_end_bit_index_ptr If not null, deref will be set to the bit index, at which green component data ends. (data under the bit includes the data!) + * @param out_opt_blue_component_start_bit_index_ptr If not null, deref will be set to the bit index, from which blue component data starts. + * @param out_opt_blue_component_end_bit_index_ptr If not null, deref will be set to the bit index, at which blue component data ends. (data under the bit includes the data!) + * @param out_opt_alpha_component_start_bit_index_ptr If not null, deref will be set to the bit index, from which alpha component data starts. + * @param out_opt_alpha_component_end_bit_index_ptr If not null, deref will be set to the bit index, at which alpha component data ends. (data under the bit includes the data!) + * @param out_opt_shared_component_start_bit_index_ptr If not null, deref will be set to the bit index, from which shared component data starts. + * @param out_opt_shared_component_end_bit_index_ptr If not null, deref will be set to the bit index, at which shared component data ends. (data under the bit includes the data!) + * @param out_opt_depth_component_start_bit_index_ptr If not null, deref will be set to the bit index, from which depth component data starts. + * @param out_opt_depth_component_end_bit_index_ptr If not null, deref will be set to the bit index, at which depth component data ends. (data under the bit includes the data!) + * @param out_opt_stencil_component_start_bit_index_ptr If not null, deref will be set to the bit index, from which stencil component data starts. + * @param out_opt_stencil_component_end_bit_index_ptr If not null, deref will be set to the bit index, at which stencil component data ends. (data under the bit includes the data!) + */ + static void get_format_bit_layout(VkFormat in_format, + uint32_t* out_opt_red_component_start_bit_index_ptr = nullptr, + uint32_t* out_opt_red_component_end_bit_index_ptr = nullptr, + uint32_t* out_opt_green_component_start_bit_index_ptr = nullptr, + uint32_t* out_opt_green_component_end_bit_index_ptr = nullptr, + uint32_t* out_opt_blue_component_start_bit_index_ptr = nullptr, + uint32_t* out_opt_blue_component_end_bit_index_ptr = nullptr, + uint32_t* out_opt_alpha_component_start_bit_index_ptr = nullptr, + uint32_t* out_opt_alpha_component_end_bit_index_ptr = nullptr, + uint32_t* out_opt_shared_component_start_bit_index_ptr = nullptr, + uint32_t* out_opt_shared_component_end_bit_index_ptr = nullptr, + uint32_t* out_opt_depth_component_start_bit_index_ptr = nullptr, + uint32_t* out_opt_depth_component_end_bit_index_ptr = nullptr, + uint32_t* out_opt_stencil_component_start_bit_index_ptr = nullptr, + uint32_t* out_opt_stencil_component_end_bit_index_ptr = nullptr); + /** Tells what component layout is used by @param in_format. */ static ComponentLayout get_format_component_layout(VkFormat in_format); @@ -82,6 +119,9 @@ namespace Anvil /* Tells the number of bits used for each component in case of Vulkan format specified * under @param in_format. * + * NOTE: Number of bits reported for each component uses ordering as reported for the format + * via get_format_component_layout(). This is especially important in the context of packed formats. + * * @param in_format Vulkan format to use for the query. * @param out_channel0_bits_ptr Deref will be set to the number of bits used for channel 0. Must * not be nullptr. @@ -113,6 +153,8 @@ namespace Anvil /** Tells whether @param in_format format is a block format. */ static bool is_format_compressed(VkFormat in_format); + /** Tells whether @param in_format is a packed format */ + static bool is_format_packed(VkFormat in_format); }; }; diff --git a/include/misc/graphics_pipeline_create_info.h b/include/misc/graphics_pipeline_create_info.h index 0a9199a3..7f563ace 100644 --- a/include/misc/graphics_pipeline_create_info.h +++ b/include/misc/graphics_pipeline_create_info.h @@ -96,7 +96,7 @@ namespace Anvil * at baking time to configure input vertex attribute & bindings for the Vulkan pipeline object. * * By default, Anvil only assigns a unique binding to those vertex attributes, whose characteristics - * are unique (ie. whose input rate & stride match). This works well for most of the use cases, the + * are unique (ie. whose divisor & input rate & stride match). This works well for most of the use cases, the * only exception being when you need to associate a unique offset to a specific vertex binding. In * this case, you need to set @param in_explicit_binding_index to an index, under which your exclusive * binding is going to be stored. @@ -110,6 +110,9 @@ namespace Anvil * @param in_stride_in_bytes Stride of the vertex attribute data. * @param in_step_rate Step rate to use for the vertex attribute data. * @param in_explicit_binding_index Please see general description of the function for more details. + * @param in_divisor Divisor to use for the attribute. Please read EXT_vertex_attribute_divisor + * for more details. Only set to values different than 1 if the extension + * is reported as supported. * * @return true if successful, false otherwise. **/ @@ -118,7 +121,8 @@ namespace Anvil uint32_t in_offset_in_bytes, uint32_t in_stride_in_bytes, VkVertexInputRate in_step_rate, - uint32_t in_explicit_binding_index = UINT32_MAX); + uint32_t in_explicit_binding_index = UINT32_MAX, + uint32_t in_divisor = 1); /** Tells whether depth writes have been enabled. **/ bool are_depth_writes_enabled() const; @@ -386,16 +390,18 @@ namespace Anvil * @param out_opt_explicit_vertex_binding_index_ptr If not null, deref will be set to the specified attribute's explicit vertex binding index. * @param out_opt_stride_ptr If not null, deref will be set to the specified attribute's stride. * @param out_opt_rate_ptr If not null, deref will be set to the specified attribute's step rate. + * @param out_opt_divisor_ptr If not null, deref will be set to the specified attribute's divisor. * * @return true if successful, false otherwise. **/ bool get_vertex_attribute_properties(uint32_t in_n_vertex_input_attribute, - uint32_t* out_opt_location_ptr, - VkFormat* out_opt_format_ptr, - uint32_t* out_opt_offset_ptr, - uint32_t* out_opt_explicit_vertex_binding_index_ptr, - uint32_t* out_opt_stride_ptr, - VkVertexInputRate* out_opt_rate_ptr) const; + uint32_t* out_opt_location_ptr = nullptr, + VkFormat* out_opt_format_ptr = nullptr, + uint32_t* out_opt_offset_ptr = nullptr, + uint32_t* out_opt_explicit_vertex_binding_index_ptr = nullptr, + uint32_t* out_opt_stride_ptr = nullptr, + VkVertexInputRate* out_opt_rate_ptr = nullptr, + uint32_t* out_opt_divisor_ptr = nullptr) const; /** Retrieves properties of a viewport at a given index. * @@ -833,6 +839,7 @@ namespace Anvil */ typedef struct InternalVertexAttribute { + uint32_t divisor; uint32_t explicit_binding_index; VkFormat format; uint32_t location; @@ -843,6 +850,7 @@ namespace Anvil /** Dummy constructor. Should only be used by STL. */ InternalVertexAttribute() { + divisor = 1; explicit_binding_index = UINT32_MAX; format = VK_FORMAT_UNDEFINED; location = UINT32_MAX; @@ -853,19 +861,22 @@ namespace Anvil /** Constructor. * + * @param in_divisor Divisor to use for the attribute. * @param in_format Attribute format. * @param in_location Attribute location. * @param in_offset_in_bytes Start offset in bytes. * @param in_rate Step rate. * @param in_stride_in_bytes Stride in bytes. **/ - InternalVertexAttribute(uint32_t in_explicit_binding_index, + InternalVertexAttribute(uint32_t in_divisor, + uint32_t in_explicit_binding_index, VkFormat in_format, uint32_t in_location, uint32_t in_offset_in_bytes, VkVertexInputRate in_rate, uint32_t in_stride_in_bytes) { + divisor = in_divisor; explicit_binding_index = in_explicit_binding_index; format = in_format; location = in_location; diff --git a/include/misc/image_create_info.h b/include/misc/image_create_info.h index e101bf0c..5a3bb318 100644 --- a/include/misc/image_create_info.h +++ b/include/misc/image_create_info.h @@ -256,7 +256,7 @@ namespace Anvil const Anvil::ExternalMemoryHandleTypeBits& get_external_memory_handle_types() const { - return m_external_memory_handle_types; + return m_exportable_external_memory_handle_types; } const VkFormat& get_format() const @@ -375,9 +375,9 @@ namespace Anvil m_depth = in_depth; } - void set_external_memory_handle_types(const ExternalMemoryHandleTypeBits& in_external_memory_handle_types) + void set_exportable_external_memory_handle_types(const ExternalMemoryHandleTypeBits& in_external_memory_handle_types) { - m_external_memory_handle_types = in_external_memory_handle_types; + m_exportable_external_memory_handle_types = in_external_memory_handle_types; } void set_format(const VkFormat& in_format) @@ -487,7 +487,7 @@ namespace Anvil const VkImageLayout& in_post_alloc_image_layout, const std::vector* in_opt_mipmaps_ptr, const Anvil::MTSafety& in_mt_safety, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types, + Anvil::ExternalMemoryHandleTypeBits in_exportable_external_memory_handle_types, const Anvil::MemoryFeatureFlags& in_memory_features, const Anvil::SparseResidencyScope& in_residency_scope); @@ -496,7 +496,7 @@ namespace Anvil Anvil::ImageCreateFlags m_create_flags; uint32_t m_depth; const Anvil::BaseDevice* m_device_ptr; - Anvil::ExternalMemoryHandleTypeBits m_external_memory_handle_types; + Anvil::ExternalMemoryHandleTypeBits m_exportable_external_memory_handle_types; VkFormat m_format; uint32_t m_height; Anvil::MemoryFeatureFlags m_memory_features; diff --git a/include/misc/memory_allocator.h b/include/misc/memory_allocator.h index 33eb9f8c..4ae1de0c 100644 --- a/include/misc/memory_allocator.h +++ b/include/misc/memory_allocator.h @@ -38,7 +38,9 @@ namespace Anvil { - typedef std::function MemoryAllocatorBakeCallbackFunction; + typedef std::function MemoryAllocatorBakeCallbackFunction; + typedef std::function MemoryAllocatorPostBakePerNonSparseBufferItemMemAssignmentCallback; + typedef std::function MemoryAllocatorPostBakePerNonSparseImageItemMemAssignmentCallback; class MemoryAllocator : public MTSafetySupportProvider { @@ -69,7 +71,12 @@ namespace Anvil ItemType type; - Anvil::ExternalMemoryHandleTypeBits alloc_external_memory_handle_types; + #if defined(_WIN32) + const Anvil::ExternalNTHandleInfo* alloc_external_nt_handle_info_ptr; + #endif + + Anvil::ExternalMemoryHandleTypeBits alloc_exportable_external_handle_types; + bool alloc_is_dedicated_memory; MemoryBlockUniquePtr alloc_memory_block_ptr; uint32_t alloc_memory_final_type; VkDeviceSize alloc_memory_required_alignment; @@ -86,56 +93,77 @@ namespace Anvil VkOffset3D offset; VkImageSubresource subresource; - Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - Anvil::ExternalMemoryHandleTypeBits in_alloc_external_memory_handle_types); - - Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_alloc_offset, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - Anvil::ExternalMemoryHandleTypeBits in_alloc_external_memory_handle_types); - - Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - uint32_t in_n_layer, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_miptail_offset, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - Anvil::ExternalMemoryHandleTypeBits in_alloc_external_memory_handle_types); - - Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - const VkExtent3D& in_extent, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - Anvil::ExternalMemoryHandleTypeBits in_alloc_external_memory_handle_types); - - Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - Anvil::ExternalMemoryHandleTypeBits in_alloc_external_memory_handle_types); + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, + +#if defined(_WIN32) + const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, +#endif + const bool& in_alloc_is_dedicated); + + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_alloc_offset, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +#if defined(_WIN32) + const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, +#endif + const bool& in_alloc_is_dedicated); + + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_layer, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_miptail_offset, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +#if defined(_WIN32) + const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, +#endif + const bool& in_alloc_is_dedicated); + + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + const VkExtent3D& in_extent, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +#if defined(_WIN32) + const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, +#endif + const bool& in_alloc_is_dedicated); + + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +#if defined(_WIN32) + const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, +#endif + const bool& in_alloc_is_dedicated); /** TODO */ ~Item(); @@ -169,79 +197,106 @@ namespace Anvil /** Adds a new Buffer object which should use storage coming from the buffer memory * maintained by the Memory Allocator. * - * @param in_buffer_ptr Buffer to configure storage for at bake() call time. Must not - * be nullptr. - * @param in_data_ptr The buffer will be filled with data extracted from the specified - * location. The number of bytes which will be stored is defined by - * buffer size. - * @param in_data_vector_ptr The buffer will be filled with data extracted from the specified - * vector. Total number of bytes defined in the vector must match - * buffer size. - * @param in_required_memory_features Memory features the assigned memory must support. - * See MemoryFeatureFlagBits for more details. - * @param in_external_memory_handle_types If the allocation is going to be exported to another process or Vulkan instance, use - * this field to specify which handle types the allocation needs to support. Please see - * documentation of Anvil::ExternalMemoryHandleTypeFlags for more details. - * If 0 is specified, handle types specified for @param in_buffer_ptr at creation time - * will be used instead. + * @param in_buffer_ptr Buffer to configure storage for at bake() call time. Must not + * be nullptr. + * @param in_data_ptr The buffer will be filled with data extracted from the specified + * location. The number of bytes which will be stored is defined by + * buffer size. + * @param in_data_vector_ptr The buffer will be filled with data extracted from the specified + * vector. Total number of bytes defined in the vector must match + * buffer size. + * @param in_required_memory_features Memory features the assigned memory must support. + * See MemoryFeatureFlagBits for more details. + * @param in_opt_external_nt_handle_info_ptr TODO. Pointer must remain valid till baking time. * * @return true if the buffer has been successfully scheduled for baking, false otherwise. **/ bool add_buffer (Anvil::Buffer* in_buffer_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0 + #if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr + #endif + ); bool add_buffer_with_float_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0 + #if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr + #endif + ); bool add_buffer_with_float_data_vector_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0 + #if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr + #endif + ); bool add_buffer_with_float_data_vector_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, const std::vector* in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0 + #if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr + #endif + ); bool add_buffer_with_uchar8_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0 + #if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr + #endif + ); bool add_buffer_with_uchar8_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0 + #if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr + #endif + ); bool add_buffer_with_uint32_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0 + #if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr + #endif + ); bool add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0 + #if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr + #endif + ); bool add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, const std::vector* in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0 + #if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr + #endif + ); /** TODO * - * @param in_buffer_ptr TODO - * @param in_offset TODO. Must be divisible by VkMemoryRequirements::alignment - * @param in_size TODO. - * @param in_required_memory_features TODO - * @param in_external_memory_handle_types If the allocation is going to be exported to another process or Vulkan instance, use - * this field to specify which handle types the allocation needs to support. Please see - * documentation of Anvil::ExternalMemoryHandleTypeFlags for more details. - * If 0 is specified, handle types specified for @param in_buffer_ptr at creation time - * will be used instead. + * @param in_buffer_ptr TODO + * @param in_offset TODO. Must be divisible by VkMemoryRequirements::alignment + * @param in_size TODO. + * @param in_required_memory_features TODO * * @return TODO */ - bool add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_offset, - VkDeviceSize in_size, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); + bool add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkDeviceSize in_size, + MemoryFeatureFlags in_required_memory_features); + /** Adds an Image object which should be assigned storage coming from memory objects * maintained by the Memory Allocator. At baking time, all subresources of the image, @@ -249,21 +304,22 @@ namespace Anvil * * This function can be used against both non-sparse and sparse images. * - * @param image_ptr Image to configure storage for at bake() call time. Must not - * be nullptr. - * @param in_required_memory_features Memory features the assigned memory must support. - * See MemoryFeatureFlagBits for more details. - * @param in_external_memory_handle_types If the allocation is going to be exported to another process or Vulkan instance, use - * this field to specify which handle types the allocation needs to support. Please see - * documentation of Anvil::ExternalMemoryHandleTypeFlags for more details. - * If 0 is specified, handle types specified for @param in_image_ptr at creation time - * will be used instead. + * @param image_ptr Image to configure storage for at bake() call time. Must not + * be nullptr. + * @param in_required_memory_features Memory features the assigned memory must support. + * See MemoryFeatureFlagBits for more details. + * @param in_opt_external_nt_handle_info_ptr TODO. Pointer must remain valid till baking time. * * @return true if the image has been successfully scheduled for baking, false otherwise. **/ - bool add_image_whole(Anvil::Image* in_image_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); + bool add_image_whole(Anvil::Image* in_image_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0 +#if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr + #endif + ); + /** Adds a new Image object whose layer @param in_n_layer 's miptail for @param in_aspect * aspect should be assigned a physical memory backing. The miptail will be bound a memory @@ -274,54 +330,44 @@ namespace Anvil * * This function can only be used for sparse resident images. * - * @param in_image_ptr Image to use for the request. Must not be null. - * @param in_aspect Aspect to be used for the request. - * @param in_n_layer Index of the layer to attach the miptail to. - * @param in_required_memory_features Memory features the assigned memory must support. - * See MemoryFeatureFlagBits for more details. - * @param in_external_memory_handle_types If the allocation is going to be exported to another process or Vulkan instance, use - * this field to specify which handle types the allocation needs to support. Please see - * documentation of Anvil::ExternalMemoryHandleTypeFlags for more details. - * If 0 is specified, handle types specified for @param in_image_ptr at creation time - * will be used instead. + * @param in_image_ptr Image to use for the request. Must not be null. + * @param in_aspect Aspect to be used for the request. + * @param in_n_layer Index of the layer to attach the miptail to. + * @param in_required_memory_features Memory features the assigned memory must support. + * See MemoryFeatureFlagBits for more details. * * @return true if the miptail has been successfully scheduled for baking, false otherwise. */ - bool add_sparse_image_miptail(Anvil::Image* in_image_ptr, - VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); + bool add_sparse_image_miptail(Anvil::Image* in_image_ptr, + VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + MemoryFeatureFlags in_required_memory_features); + /** Adds a single subresource which should be assigned memory backing. * * This function does NOT alloc memory for the miptail. It is user's responsibilty to call * add_sparse_image_miptail() for any layers which require a miptail. * - * @param in_image_ptr Image to use for the request. Must not be null. - * @param in_subresource Specifies details of the subresource to attach memory backing to. - * @param in_offset XYZ offset, from which the memory backing should be attached. Must - * be rounded up to tile size of the aspect @param in_subresource - * refers to. - * @param in_extent Size of the region to assign memory backing to. Must be rounded up - * to tile size of the aspect @param in_subresource refers to, UNLESS - * @param in_offset + @param in_extent touches the subresource border. - * @param in_required_memory_features Memory features the assigned memory must support. - * See MemoryFeatureFlagBits for more details. - * @param in_external_memory_handle_types If the allocation is going to be exported to another process or Vulkan instance, use - * this field to specify which handle types the allocation needs to support. Please see - * documentation of Anvil::ExternalMemoryHandleTypeFlags for more details. - * If 0 is specified, handle types specified for @param in_image_ptr at creation time - * will be used instead. + * @param in_image_ptr Image to use for the request. Must not be null. + * @param in_subresource Specifies details of the subresource to attach memory backing to. + * @param in_offset XYZ offset, from which the memory backing should be attached. Must + * be rounded up to tile size of the aspect @param in_subresource + * refers to. + * @param in_extent Size of the region to assign memory backing to. Must be rounded up + * to tile size of the aspect @param in_subresource refers to, UNLESS + * @param in_offset + @param in_extent touches the subresource border. + * @param in_required_memory_features Memory features the assigned memory must support. + * See MemoryFeatureFlagBits for more details. * * @return true if the subresource has been successfully scheduled for baking, false otherwise. **/ - bool add_sparse_image_subresource(Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - VkExtent3D in_extent, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); + bool add_sparse_image_subresource(Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + VkExtent3D in_extent, + MemoryFeatureFlags in_required_memory_features); + /** TODO */ bool bake(); @@ -345,6 +391,34 @@ namespace Anvil static Anvil::MemoryAllocatorUniquePtr create_vma(const Anvil::BaseDevice* in_device_ptr, MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + /** By default, once memory regions are baked, memory allocator will bind them to objects specified + * at add_*() call time. Use cases exist where apps may prefer to handle this action on their own. + * + * When a post-bake per-item mem assignment callback is specified, the allocator will NO LONGER: + * + * - (NON-SPARSE OBJECTS): call set_(nonsparse_)memory() functions and fill the regions with user-specified data, + * if such was provided at add_*() call time. + * - (SPARSE OBJECTS): bind allocated memory to user-specified sparse memory regions. + * + * The allocator WILL still allocate physical memory as determined to be required for the specified list of objects + * and use the callback specified in this call to let the application do whatever it needs to with the allocated memory. + * + * All callback functions must be specified for all types of objects supported by the allocator. + * + * Do not use this function unless you have a strong understanding of the implications. + * + * NOTE: Support for sparse buffers & images remains a TODO. + */ + void set_post_bake_per_item_mem_assignment_callbacks(MemoryAllocatorPostBakePerNonSparseBufferItemMemAssignmentCallback in_callback_function_for_buffers, + MemoryAllocatorPostBakePerNonSparseImageItemMemAssignmentCallback in_callback_function_for_images) + { + anvil_assert(in_callback_function_for_buffers != nullptr); + anvil_assert(in_callback_function_for_images != nullptr); + + m_post_bake_per_buffer_item_mem_assignment_callback_function = in_callback_function_for_buffers; + m_post_bake_per_image_item_mem_assignment_callback_function = in_callback_function_for_images; + } + /** Assigns a func pointer which will be called by the allocator after all added objects * have been assigned memory blocks. * @@ -364,9 +438,13 @@ namespace Anvil private: /* Private functions */ - bool add_buffer_internal(Anvil::Buffer* in_buffer_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types); + bool add_buffer_internal(Anvil::Buffer* in_buffer_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types +#if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr +#endif + ); bool do_external_memory_handle_type_sanity_checks(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) const; bool is_alloc_supported (uint32_t in_memory_types, @@ -393,7 +471,9 @@ namespace Anvil Items m_items; std::map m_per_object_pending_alloc_status; - MemoryAllocatorBakeCallbackFunction m_post_bake_callback_function; + MemoryAllocatorBakeCallbackFunction m_post_bake_callback_function; + MemoryAllocatorPostBakePerNonSparseBufferItemMemAssignmentCallback m_post_bake_per_buffer_item_mem_assignment_callback_function; + MemoryAllocatorPostBakePerNonSparseImageItemMemAssignmentCallback m_post_bake_per_image_item_mem_assignment_callback_function; }; }; diff --git a/include/misc/memory_block_create_info.h b/include/misc/memory_block_create_info.h index 2441e797..234d99de 100644 --- a/include/misc/memory_block_create_info.h +++ b/include/misc/memory_block_create_info.h @@ -59,6 +59,7 @@ namespace Anvil * * - Exportable external memory handle types: Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE * - Importable external memory handle type: Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE + * - Use a dedicated allocation?: No. * * These can be further adjusted by callingt corresponding set_..() functions prior to passing the CreateInfo instance * to MemoryBlock::create(). @@ -81,6 +82,7 @@ namespace Anvil * - Exportable external memory handle types: Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE * - Importable external memory handle type: Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE. + * - Use a dedicated allocation?: No. * * These can be further adjusted by callingt corresponding set_..() functions prior to passing the CreateInfo instance * to MemoryBlock::create(). @@ -100,6 +102,26 @@ namespace Anvil return m_allowed_memory_bits; } + void get_dedicated_allocation_properties(bool* out_opt_enabled_ptr, + Anvil::Buffer** out_opt_buffer_ptr_ptr, + Anvil::Image** out_opt_image_ptr_ptr) const + { + if (out_opt_enabled_ptr != nullptr) + { + *out_opt_enabled_ptr = m_use_dedicated_allocation; + } + + if (out_opt_buffer_ptr_ptr != nullptr) + { + *out_opt_buffer_ptr_ptr = m_dedicated_allocation_buffer_ptr; + } + + if (out_opt_image_ptr_ptr != nullptr) + { + *out_opt_image_ptr_ptr = m_dedicated_allocation_image_ptr; + } + } + const Anvil::BaseDevice* get_device() const { return m_device_ptr; @@ -129,18 +151,18 @@ namespace Anvil } #if defined(_WIN32) - /* Returns true if set_external_nt_handle_import_info() has been called prior to this call. + /* Returns true if set_exportable_nt_handle_info() has been called prior to this call. * Otherwise returns false. * * If the func returns true, *out_result_ptr is set to the queried data. */ - bool get_external_nt_handle_import_info(const ExternalNTHandleInfo** out_result_ptr_ptr) const + bool get_exportable_nt_handle_info(const ExternalNTHandleInfo** out_result_ptr_ptr) const { bool result = false; - if (m_external_nt_handle_import_info_specified) + if (m_exportable_nt_handle_info_specified) { - *out_result_ptr_ptr = &m_external_nt_handle_import_info; + *out_result_ptr_ptr = &m_exportable_nt_handle_info; result = true; } @@ -248,17 +270,17 @@ namespace Anvil * * Requires VK_KHR_external_memory_win32 */ - void set_external_nt_handle_import_info(const SECURITY_ATTRIBUTES* in_opt_attributes_ptr, - const DWORD& in_access, - const std::wstring& in_name) + void set_exportable_nt_handle_info(const SECURITY_ATTRIBUTES* in_opt_attributes_ptr, + const DWORD& in_access, + const std::wstring& in_name) { - anvil_assert(!m_external_nt_handle_import_info_specified); + anvil_assert(!m_exportable_nt_handle_info_specified); - m_external_nt_handle_import_info.access = in_access; - m_external_nt_handle_import_info.attributes_ptr = in_opt_attributes_ptr; - m_external_nt_handle_import_info.name = in_name; + m_exportable_nt_handle_info.access = in_access; + m_exportable_nt_handle_info.attributes_ptr = in_opt_attributes_ptr; + m_exportable_nt_handle_info.name = in_name; - m_external_nt_handle_import_info_specified = true; + m_exportable_nt_handle_info_specified = true; } #endif @@ -272,6 +294,31 @@ namespace Anvil m_mt_safety = in_mt_safety; } + /* Call to request a dedicated allocation for the memory block. Requirements are: + * + * 1) Device must support VK_KHR_dedicated_allocation. + * 2) Either in_opt_buffer_ptr or in_opt_image_ptr must not be null. Cases where both + * are nullptr or != nullptr are not allowed. + * + * May only be called once. + * The specified object must remain alive until the actual memory allocation takes place. + * + */ + void use_dedicated_allocation(Anvil::Buffer* in_opt_buffer_ptr, + Anvil::Image* in_opt_image_ptr) + { + anvil_assert(m_dedicated_allocation_buffer_ptr == nullptr); + anvil_assert(m_dedicated_allocation_image_ptr == nullptr); + anvil_assert(!m_use_dedicated_allocation); + + anvil_assert((in_opt_buffer_ptr == nullptr && in_opt_image_ptr != nullptr) || + (in_opt_buffer_ptr != nullptr && in_opt_image_ptr == nullptr) ); + + m_dedicated_allocation_buffer_ptr = in_opt_buffer_ptr; + m_dedicated_allocation_image_ptr = in_opt_image_ptr; + m_use_dedicated_allocation = true; + } + private: MemoryBlockCreateInfo(const Anvil::MemoryBlockType& in_type, const uint32_t& in_allowed_memory_bits, @@ -301,9 +348,13 @@ namespace Anvil VkDeviceSize m_start_offset; const Anvil::MemoryBlockType m_type; + Anvil::Buffer* m_dedicated_allocation_buffer_ptr; + Anvil::Image* m_dedicated_allocation_image_ptr; + bool m_use_dedicated_allocation; + #ifdef _WIN32 - ExternalNTHandleInfo m_external_nt_handle_import_info; - bool m_external_nt_handle_import_info_specified; + ExternalNTHandleInfo m_exportable_nt_handle_info; + bool m_exportable_nt_handle_info_specified; #endif ExternalMemoryHandleImportInfo m_external_handle_import_info; diff --git a/include/misc/page_tracker.h b/include/misc/page_tracker.h index ba02da12..13b3c2a4 100644 --- a/include/misc/page_tracker.h +++ b/include/misc/page_tracker.h @@ -133,8 +133,6 @@ namespace Anvil VkDeviceSize in_size, VkDeviceSize in_start_offset) { - anvil_assert(in_memory_block_ptr != nullptr); - memory_block_ptr = in_memory_block_ptr; memory_block_start_offset = in_memory_block_start_offset; size = in_size; diff --git a/include/misc/semaphore_create_info.h b/include/misc/semaphore_create_info.h index 5968fbf0..66fa1289 100644 --- a/include/misc/semaphore_create_info.h +++ b/include/misc/semaphore_create_info.h @@ -50,6 +50,26 @@ namespace Anvil return m_exportable_external_semaphore_handle_types; } + #if defined(_WIN32) + /* Returns true if set_exportable_nt_handle_info() has been called prior to this call. + * Otherwise returns false. + * + * If the func returns true, *out_result_ptr is set to the queried data. + */ + bool get_exportable_nt_handle_info(const ExternalNTHandleInfo** out_result_ptr_ptr) const + { + bool result = false; + + if (m_exportable_nt_handle_info_specified) + { + *out_result_ptr_ptr = &m_exportable_nt_handle_info; + result = true; + } + + return result; + } + #endif + const MTSafety& get_mt_safety() const { return m_mt_safety; @@ -69,6 +89,40 @@ namespace Anvil m_exportable_external_semaphore_handle_types = in_external_handle_types; } + #if defined(_WIN32) + /* Lets the app specify additional details for exportable NT handles. + * + * If @param in_name is zero-sized, member of the VkExportSemaphoreWin32HandleInfoKHR struct, as chained to the VkSemaphoreCreateInfo struct chain, + * will be set to nullptr. + * + * Requires VK_KHR_external_semaphore_win32 + */ + void set_exportable_nt_handle_info(const SECURITY_ATTRIBUTES* in_opt_attributes_ptr, + const DWORD& in_access, + const std::wstring& in_name) + { + anvil_assert(!m_exportable_nt_handle_info_specified); + + m_exportable_nt_handle_info.access = in_access; + m_exportable_nt_handle_info.name = in_name; + m_exportable_nt_handle_info_specified = true; + + if (in_opt_attributes_ptr != nullptr) + { + m_exportable_nt_handle_info_security_attributes = *in_opt_attributes_ptr; + m_exportable_nt_handle_info_security_attributes_specified = true; + + m_exportable_nt_handle_info.attributes_ptr = &m_exportable_nt_handle_info_security_attributes; + } + else + { + m_exportable_nt_handle_info.attributes_ptr = nullptr; + m_exportable_nt_handle_info_security_attributes_specified = false; + } + + } + #endif + void set_mt_safety(const MTSafety& in_mt_safety) { m_mt_safety = in_mt_safety; @@ -84,6 +138,13 @@ namespace Anvil Anvil::ExternalSemaphoreHandleTypeBits m_exportable_external_semaphore_handle_types; Anvil::MTSafety m_mt_safety; + #ifdef _WIN32 + ExternalNTHandleInfo m_exportable_nt_handle_info; + SECURITY_ATTRIBUTES m_exportable_nt_handle_info_security_attributes; + bool m_exportable_nt_handle_info_security_attributes_specified; + bool m_exportable_nt_handle_info_specified; + #endif + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(SemaphoreCreateInfo); ANVIL_DISABLE_COPY_CONSTRUCTOR(SemaphoreCreateInfo); }; diff --git a/include/misc/types_struct.h b/include/misc/types_struct.h index cd4ccc19..42900f2f 100644 --- a/include/misc/types_struct.h +++ b/include/misc/types_struct.h @@ -166,39 +166,36 @@ namespace Anvil BufferBarrier& operator=(const BufferBarrier&); } BufferBarrier; - typedef struct BufferFormatProperties + typedef struct BufferProperties { ExternalMemoryProperties external_handle_properties; - BufferFormatProperties(); - BufferFormatProperties(const ExternalMemoryProperties& in_external_handle_properties); + BufferProperties(); + BufferProperties(const ExternalMemoryProperties& in_external_handle_properties); - BufferFormatProperties (const BufferFormatProperties&) = default; - BufferFormatProperties& operator=(const BufferFormatProperties&) = default; - } BufferFormatProperties; + BufferProperties (const BufferProperties&) = default; + BufferProperties& operator=(const BufferProperties&) = default; + } BufferProperties; - typedef struct BufferFormatPropertiesQuery + typedef struct BufferPropertiesQuery { const Anvil::BufferCreateFlags create_flags; const Anvil::ExternalMemoryHandleTypeBit external_memory_handle_type; - const VkFormat format; const VkBufferUsageFlags usage_flags; - explicit BufferFormatPropertiesQuery(const Anvil::BufferCreateFlags in_create_flags, - const Anvil::ExternalMemoryHandleTypeBit& in_external_memory_handle_type, - const VkFormat& in_format, - const VkBufferUsageFlags& in_usage_flags) + explicit BufferPropertiesQuery(const Anvil::BufferCreateFlags in_create_flags, + const Anvil::ExternalMemoryHandleTypeBit& in_external_memory_handle_type, + const VkBufferUsageFlags& in_usage_flags) :create_flags (in_create_flags), external_memory_handle_type(in_external_memory_handle_type), - format (in_format), usage_flags (in_usage_flags) { /* Stub */ } - BufferFormatPropertiesQuery (const BufferFormatPropertiesQuery& in_query) = default; - BufferFormatPropertiesQuery& operator=(const BufferFormatPropertiesQuery& in_query) = delete; - } BufferFormatPropertiesQuery; + BufferPropertiesQuery (const BufferPropertiesQuery& in_query) = default; + BufferPropertiesQuery& operator=(const BufferPropertiesQuery& in_query) = delete; + } BufferPropertiesQuery; #if defined(_WIN32) typedef struct ExternalNTHandleInfo @@ -276,6 +273,14 @@ namespace Anvil bool operator==(const EXTDescriptorIndexingProperties& in_props) const; } EXTDescriptorIndexingProperties; + typedef struct EXTVertexAttributeDivisorProperties + { + uint32_t max_vertex_attribute_divisor; + + EXTVertexAttributeDivisorProperties(); + EXTVertexAttributeDivisorProperties(const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT& in_props); + } EXTVertexAttributeDivisorProperties; + typedef struct DescriptorSetAllocation { /* Descriptor set layout to use for the allocation request */ @@ -369,6 +374,14 @@ namespace Anvil ExtensionEXTDebugReportEntrypoints(); } ExtensionEXTDebugReportEntrypoints; + typedef struct ExtensionKHRDrawIndirectCountEntrypoints + { + PFN_vkCmdDrawIndexedIndirectCountKHR vkCmdDrawIndexedIndirectCountKHR; + PFN_vkCmdDrawIndirectCountKHR vkCmdDrawIndirectCountKHR; + + ExtensionKHRDrawIndirectCountEntrypoints(); + } ExtensionKHRDrawIndirectCountEntrypoints; + typedef struct ExtensionKHRBindMemory2Entrypoints { PFN_vkBindBufferMemory2KHR vkBindBufferMemory2KHR; @@ -457,6 +470,15 @@ namespace Anvil } ExtensionKHRExternalSemaphoreFdEntrypoints; #endif + typedef struct ExtensionKHRGetMemoryRequirements2Entrypoints + { + PFN_vkGetBufferMemoryRequirements2KHR vkGetBufferMemoryRequirements2KHR; + PFN_vkGetImageMemoryRequirements2KHR vkGetImageMemoryRequirements2KHR; + PFN_vkGetImageSparseMemoryRequirements2KHR vkGetImageSparseMemoryRequirements2KHR; + + ExtensionKHRGetMemoryRequirements2Entrypoints(); + } ExtensionKHRGetMemoryRequirements2Entrypoints; + typedef struct ExtensionKHRGetPhysicalDeviceProperties2 { PFN_vkGetPhysicalDeviceFeatures2KHR vkGetPhysicalDeviceFeatures2KHR; @@ -1490,6 +1512,7 @@ namespace Anvil const AMDShaderCoreProperties* amd_shader_core_properties_ptr; const PhysicalDevicePropertiesCoreVK10* core_vk1_0_properties_ptr; const EXTDescriptorIndexingProperties* ext_descriptor_indexing_properties_ptr; + const EXTVertexAttributeDivisorProperties* ext_vertex_attribute_divisor_properties_ptr; const KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties* khr_external_memory_capabilities_physical_device_id_properties_ptr; const KHRMaintenance3Properties* khr_maintenance3_properties_ptr; @@ -1497,6 +1520,7 @@ namespace Anvil PhysicalDeviceProperties(const AMDShaderCoreProperties* in_amd_shader_core_properties_ptr, const PhysicalDevicePropertiesCoreVK10* in_core_vk1_0_properties_ptr, const EXTDescriptorIndexingProperties* in_ext_descriptor_indexing_properties_ptr, + const EXTVertexAttributeDivisorProperties* in_ext_vertex_attribute_divisor_properties_ptr, const KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties* in_khr_external_memory_caps_physical_device_id_props_ptr, const KHRMaintenance3Properties* in_khr_maintenance3_properties_ptr); @@ -1852,6 +1876,11 @@ namespace Anvil return should_block; } + const uint64_t& get_timeout() const + { + return timeout; + } + const SubmissionType& get_type() const { return type; @@ -1896,6 +1925,16 @@ namespace Anvil } #endif + /* Sets a timeout which is used when waiting on a fence that the submission is associated with. + * + * If your submission times out, you're likely about to experience a TDR and lose the device. + */ + void set_timeout(const uint64_t& in_timeout) + { + anvil_assert(should_block); + + timeout = in_timeout; + } private: SubmitInfo(Anvil::CommandBufferBase* in_cmd_buffer_ptr, uint32_t in_n_semaphores_to_signal, @@ -1936,6 +1975,7 @@ namespace Anvil #endif bool should_block; + uint64_t timeout; const SubmissionType type; ANVIL_DISABLE_ASSIGNMENT_OPERATOR(SubmitInfo); diff --git a/include/misc/types_utils.h b/include/misc/types_utils.h index 5ca7f32e..a02a486b 100644 --- a/include/misc/types_utils.h +++ b/include/misc/types_utils.h @@ -277,7 +277,7 @@ namespace Anvil /** Tells whether @param in_value is a power-of-two. */ template - type is_pow2(const type in_value) + bool is_pow2(const type in_value) { return ((in_value & (in_value - 1)) == 0); } diff --git a/include/misc/window_factory.h b/include/misc/window_factory.h index e4a3215e..cd331057 100644 --- a/include/misc/window_factory.h +++ b/include/misc/window_factory.h @@ -56,6 +56,7 @@ namespace Anvil * @param in_closable Should the "close button" of the window be accesible to the user? Depending on the OS, * this may translate to the button being greyed out or not reacting to the user's requests. * @param in_present_callback_func Callback function to use for rendering frame contents. + * @param in_visible Should the created window be made visible at creation time? * * @return A new Window wrapper instance if successful, null otherwise. **/ @@ -64,7 +65,8 @@ namespace Anvil unsigned int in_width, unsigned int in_height, bool in_closable, - Anvil::PresentCallbackFunction in_present_callback_func); + Anvil::PresentCallbackFunction in_present_callback_func, + bool in_visible = true); /* Creates a Window wrapper instance using app-managed window handle. * diff --git a/include/misc/window_win3264.h b/include/misc/window_win3264.h index 042c6411..dd37505e 100644 --- a/include/misc/window_win3264.h +++ b/include/misc/window_win3264.h @@ -47,6 +47,7 @@ namespace Anvil * the user from being able to destroy the window on their own. * @param in_present_callback_func Func pointer to a function which is going to render frame contents to * the swapchain image. Must not be null. + * @param in_visible Should the window be made visible at creation time? * * @return New Anvil::Window instance if successful, or null otherwise. */ @@ -54,7 +55,8 @@ namespace Anvil unsigned int in_width, unsigned int in_height, bool in_closable, - Anvil::PresentCallbackFunction in_present_callback_func); + Anvil::PresentCallbackFunction in_present_callback_func, + bool in_visible); /* Creates a window wrapper instance from an existing window handle. * @@ -110,7 +112,7 @@ namespace Anvil PresentCallbackFunction in_present_callback_func); /** Creates a new system window and prepares it for usage. */ - bool init(); + bool init(const bool& in_visible); static LRESULT CALLBACK msg_callback_pfn_proc(HWND in_window_handle, UINT in_message_id, diff --git a/include/misc/window_xcb.h b/include/misc/window_xcb.h index f5154fc8..f8019720 100644 --- a/include/misc/window_xcb.h +++ b/include/misc/window_xcb.h @@ -39,7 +39,8 @@ namespace Anvil unsigned int in_width, unsigned int in_height, bool in_closable, - Anvil::PresentCallbackFunction in_present_callback_func); + Anvil::PresentCallbackFunction in_present_callback_func, + bool in_visible); static Anvil::WindowUniquePtr create(xcb_connection_t* in_connection_ptr, WindowHandle in_window_handle); @@ -77,7 +78,7 @@ namespace Anvil WindowHandle in_window_handle); /** Creates a new system window and prepares it for usage. */ - bool init(); + bool init (const bool& in_visible); bool init_connection(); /* Private variables */ diff --git a/include/vulkan/vulkan_core.h b/include/vulkan/vulkan_core.h index ed0d596f..d5110159 100644 --- a/include/vulkan/vulkan_core.h +++ b/include/vulkan/vulkan_core.h @@ -43,7 +43,7 @@ extern "C" { #define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) #define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff) // Version of this file -#define VK_HEADER_VERSION 72 +#define VK_HEADER_VERSION 82 #define VK_NULL_HANDLE 0 @@ -320,6 +320,9 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR = 1000079000, VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR = 1000079001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR = 1000080000, + VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT = 1000081000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT = 1000081001, + VK_STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT = 1000081002, VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000, VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000, VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001, @@ -341,6 +344,13 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT = 1000101000, VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT = 1000101001, VK_STRUCTURE_TYPE_HDR_METADATA_EXT = 1000105000, + VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2_KHR = 1000109000, + VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2_KHR = 1000109001, + VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2_KHR = 1000109002, + VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2_KHR = 1000109003, + VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2_KHR = 1000109004, + VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO_KHR = 1000109005, + VK_STRUCTURE_TYPE_SUBPASS_END_INFO_KHR = 1000109006, VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR = 1000111000, VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR = 1000114000, VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR = 1000114001, @@ -350,6 +360,11 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR = 1000119000, VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR = 1000119001, VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR = 1000119002, + VK_STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR = 1000121000, + VK_STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR = 1000121001, + VK_STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR = 1000121002, + VK_STRUCTURE_TYPE_DISPLAY_PLANE_INFO_2_KHR = 1000121003, + VK_STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR = 1000121004, VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK = 1000122000, VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000123000, VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT = 1000128000, @@ -384,12 +399,15 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT = 1000161003, VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT_EXT = 1000161004, VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT = 1000174000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR = 1000177000, VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT = 1000178000, VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT = 1000178001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT = 1000178002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD = 1000185000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT = 1000190000, VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT = 1000190001, + VK_STRUCTURE_TYPE_CHECKPOINT_DATA_NV = 1000206000, + VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV = 1000206001, VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES, @@ -1209,6 +1227,16 @@ typedef enum VkObjectType { VK_OBJECT_TYPE_MAX_ENUM = 0x7FFFFFFF } VkObjectType; +typedef enum VkVendorId { + VK_VENDOR_ID_VIV = 0x10001, + VK_VENDOR_ID_VSI = 0x10002, + VK_VENDOR_ID_KAZAN = 0x10003, + VK_VENDOR_ID_BEGIN_RANGE = VK_VENDOR_ID_VIV, + VK_VENDOR_ID_END_RANGE = VK_VENDOR_ID_KAZAN, + VK_VENDOR_ID_RANGE_SIZE = (VK_VENDOR_ID_KAZAN - VK_VENDOR_ID_VIV + 1), + VK_VENDOR_ID_MAX_ENUM = 0x7FFFFFFF +} VkVendorId; + typedef VkFlags VkInstanceCreateFlags; typedef enum VkFormatFeatureFlagBits { @@ -1352,6 +1380,7 @@ typedef enum VkPipelineStageFlagBits { VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, + VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT = 0x00040000, VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000, VK_PIPELINE_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkPipelineStageFlagBits; @@ -1440,6 +1469,7 @@ typedef enum VkBufferUsageFlagBits { VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, + VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT = 0x00000200, VK_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkBufferUsageFlagBits; typedef VkFlags VkBufferUsageFlags; @@ -1551,6 +1581,7 @@ typedef enum VkAccessFlagBits { VK_ACCESS_HOST_WRITE_BIT = 0x00004000, VK_ACCESS_MEMORY_READ_BIT = 0x00008000, VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000, + VK_ACCESS_CONDITIONAL_RENDERING_READ_BIT_EXT = 0x00100000, VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000, VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000, VK_ACCESS_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT = 0x00080000, @@ -2715,6 +2746,16 @@ typedef struct VkDrawIndirectCommand { uint32_t firstInstance; } VkDrawIndirectCommand; +typedef struct VkBaseOutStructure { + VkStructureType sType; + struct VkBaseOutStructure* pNext; +} VkBaseOutStructure; + +typedef struct VkBaseInStructure { + VkStructureType sType; + const struct VkBaseInStructure* pNext; +} VkBaseInStructure; + typedef VkResult (VKAPI_PTR *PFN_vkCreateInstance)(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance); typedef void (VKAPI_PTR *PFN_vkDestroyInstance)(VkInstance instance, const VkAllocationCallbacks* pAllocator); @@ -5410,6 +5451,114 @@ VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSetWithTemplateKHR( const void* pData); #endif +#define VK_KHR_create_renderpass2 1 +#define VK_KHR_CREATE_RENDERPASS_2_SPEC_VERSION 1 +#define VK_KHR_CREATE_RENDERPASS_2_EXTENSION_NAME "VK_KHR_create_renderpass2" + +typedef struct VkAttachmentDescription2KHR { + VkStructureType sType; + const void* pNext; + VkAttachmentDescriptionFlags flags; + VkFormat format; + VkSampleCountFlagBits samples; + VkAttachmentLoadOp loadOp; + VkAttachmentStoreOp storeOp; + VkAttachmentLoadOp stencilLoadOp; + VkAttachmentStoreOp stencilStoreOp; + VkImageLayout initialLayout; + VkImageLayout finalLayout; +} VkAttachmentDescription2KHR; + +typedef struct VkAttachmentReference2KHR { + VkStructureType sType; + const void* pNext; + uint32_t attachment; + VkImageLayout layout; + VkImageAspectFlags aspectMask; +} VkAttachmentReference2KHR; + +typedef struct VkSubpassDescription2KHR { + VkStructureType sType; + const void* pNext; + VkSubpassDescriptionFlags flags; + VkPipelineBindPoint pipelineBindPoint; + uint32_t viewMask; + uint32_t inputAttachmentCount; + const VkAttachmentReference2KHR* pInputAttachments; + uint32_t colorAttachmentCount; + const VkAttachmentReference2KHR* pColorAttachments; + const VkAttachmentReference2KHR* pResolveAttachments; + const VkAttachmentReference2KHR* pDepthStencilAttachment; + uint32_t preserveAttachmentCount; + const uint32_t* pPreserveAttachments; +} VkSubpassDescription2KHR; + +typedef struct VkSubpassDependency2KHR { + VkStructureType sType; + const void* pNext; + uint32_t srcSubpass; + uint32_t dstSubpass; + VkPipelineStageFlags srcStageMask; + VkPipelineStageFlags dstStageMask; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; + VkDependencyFlags dependencyFlags; + int32_t viewOffset; +} VkSubpassDependency2KHR; + +typedef struct VkRenderPassCreateInfo2KHR { + VkStructureType sType; + const void* pNext; + VkRenderPassCreateFlags flags; + uint32_t attachmentCount; + const VkAttachmentDescription2KHR* pAttachments; + uint32_t subpassCount; + const VkSubpassDescription2KHR* pSubpasses; + uint32_t dependencyCount; + const VkSubpassDependency2KHR* pDependencies; + uint32_t correlatedViewMaskCount; + const uint32_t* pCorrelatedViewMasks; +} VkRenderPassCreateInfo2KHR; + +typedef struct VkSubpassBeginInfoKHR { + VkStructureType sType; + const void* pNext; + VkSubpassContents contents; +} VkSubpassBeginInfoKHR; + +typedef struct VkSubpassEndInfoKHR { + VkStructureType sType; + const void* pNext; +} VkSubpassEndInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateRenderPass2KHR)(VkDevice device, const VkRenderPassCreateInfo2KHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass); +typedef void (VKAPI_PTR *PFN_vkCmdBeginRenderPass2KHR)(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, const VkSubpassBeginInfoKHR* pSubpassBeginInfo); +typedef void (VKAPI_PTR *PFN_vkCmdNextSubpass2KHR)(VkCommandBuffer commandBuffer, const VkSubpassBeginInfoKHR* pSubpassBeginInfo, const VkSubpassEndInfoKHR* pSubpassEndInfo); +typedef void (VKAPI_PTR *PFN_vkCmdEndRenderPass2KHR)(VkCommandBuffer commandBuffer, const VkSubpassEndInfoKHR* pSubpassEndInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass2KHR( + VkDevice device, + const VkRenderPassCreateInfo2KHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkRenderPass* pRenderPass); + +VKAPI_ATTR void VKAPI_CALL vkCmdBeginRenderPass2KHR( + VkCommandBuffer commandBuffer, + const VkRenderPassBeginInfo* pRenderPassBegin, + const VkSubpassBeginInfoKHR* pSubpassBeginInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdNextSubpass2KHR( + VkCommandBuffer commandBuffer, + const VkSubpassBeginInfoKHR* pSubpassBeginInfo, + const VkSubpassEndInfoKHR* pSubpassEndInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdEndRenderPass2KHR( + VkCommandBuffer commandBuffer, + const VkSubpassEndInfoKHR* pSubpassEndInfo); +#endif + #define VK_KHR_shared_presentable_image 1 #define VK_KHR_SHARED_PRESENTABLE_IMAGE_SPEC_VERSION 1 #define VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME "VK_KHR_shared_presentable_image" @@ -5572,6 +5721,70 @@ typedef VkPhysicalDeviceVariablePointerFeatures VkPhysicalDeviceVariablePointerF +#define VK_KHR_get_display_properties2 1 +#define VK_KHR_GET_DISPLAY_PROPERTIES_2_SPEC_VERSION 1 +#define VK_KHR_GET_DISPLAY_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_display_properties2" + +typedef struct VkDisplayProperties2KHR { + VkStructureType sType; + void* pNext; + VkDisplayPropertiesKHR displayProperties; +} VkDisplayProperties2KHR; + +typedef struct VkDisplayPlaneProperties2KHR { + VkStructureType sType; + void* pNext; + VkDisplayPlanePropertiesKHR displayPlaneProperties; +} VkDisplayPlaneProperties2KHR; + +typedef struct VkDisplayModeProperties2KHR { + VkStructureType sType; + void* pNext; + VkDisplayModePropertiesKHR displayModeProperties; +} VkDisplayModeProperties2KHR; + +typedef struct VkDisplayPlaneInfo2KHR { + VkStructureType sType; + const void* pNext; + VkDisplayModeKHR mode; + uint32_t planeIndex; +} VkDisplayPlaneInfo2KHR; + +typedef struct VkDisplayPlaneCapabilities2KHR { + VkStructureType sType; + void* pNext; + VkDisplayPlaneCapabilitiesKHR capabilities; +} VkDisplayPlaneCapabilities2KHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceDisplayProperties2KHR)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayProperties2KHR* pProperties); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceDisplayPlaneProperties2KHR)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPlaneProperties2KHR* pProperties); +typedef VkResult (VKAPI_PTR *PFN_vkGetDisplayModeProperties2KHR)(VkPhysicalDevice physicalDevice, VkDisplayKHR display, uint32_t* pPropertyCount, VkDisplayModeProperties2KHR* pProperties); +typedef VkResult (VKAPI_PTR *PFN_vkGetDisplayPlaneCapabilities2KHR)(VkPhysicalDevice physicalDevice, const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo, VkDisplayPlaneCapabilities2KHR* pCapabilities); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceDisplayProperties2KHR( + VkPhysicalDevice physicalDevice, + uint32_t* pPropertyCount, + VkDisplayProperties2KHR* pProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceDisplayPlaneProperties2KHR( + VkPhysicalDevice physicalDevice, + uint32_t* pPropertyCount, + VkDisplayPlaneProperties2KHR* pProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayModeProperties2KHR( + VkPhysicalDevice physicalDevice, + VkDisplayKHR display, + uint32_t* pPropertyCount, + VkDisplayModeProperties2KHR* pProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayPlaneCapabilities2KHR( + VkPhysicalDevice physicalDevice, + const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo, + VkDisplayPlaneCapabilities2KHR* pCapabilities); +#endif + #define VK_KHR_dedicated_allocation 1 #define VK_KHR_DEDICATED_ALLOCATION_SPEC_VERSION 3 #define VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_KHR_dedicated_allocation" @@ -5727,6 +5940,47 @@ VKAPI_ATTR void VKAPI_CALL vkGetDescriptorSetLayoutSupportKHR( VkDescriptorSetLayoutSupport* pSupport); #endif +#define VK_KHR_draw_indirect_count 1 +#define VK_KHR_DRAW_INDIRECT_COUNT_SPEC_VERSION 1 +#define VK_KHR_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_KHR_draw_indirect_count" + +typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirectCountKHR)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); +typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexedIndirectCountKHR)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirectCountKHR( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride); + +VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirectCountKHR( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride); +#endif + +#define VK_KHR_8bit_storage 1 +#define VK_KHR_8BIT_STORAGE_SPEC_VERSION 1 +#define VK_KHR_8BIT_STORAGE_EXTENSION_NAME "VK_KHR_8bit_storage" + +typedef struct VkPhysicalDevice8BitStorageFeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 storageBuffer8BitAccess; + VkBool32 uniformAndStorageBuffer8BitAccess; + VkBool32 storagePushConstant8; +} VkPhysicalDevice8BitStorageFeaturesKHR; + + + #define VK_EXT_debug_report 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) @@ -6159,10 +6413,10 @@ typedef enum VkValidationCheckEXT { } VkValidationCheckEXT; typedef struct VkValidationFlagsEXT { - VkStructureType sType; - const void* pNext; - uint32_t disabledValidationCheckCount; - VkValidationCheckEXT* pDisabledValidationChecks; + VkStructureType sType; + const void* pNext; + uint32_t disabledValidationCheckCount; + const VkValidationCheckEXT* pDisabledValidationChecks; } VkValidationFlagsEXT; @@ -6177,6 +6431,51 @@ typedef struct VkValidationFlagsEXT { #define VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME "VK_EXT_shader_subgroup_vote" +#define VK_EXT_conditional_rendering 1 +#define VK_EXT_CONDITIONAL_RENDERING_SPEC_VERSION 1 +#define VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME "VK_EXT_conditional_rendering" + + +typedef enum VkConditionalRenderingFlagBitsEXT { + VK_CONDITIONAL_RENDERING_INVERTED_BIT_EXT = 0x00000001, + VK_CONDITIONAL_RENDERING_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkConditionalRenderingFlagBitsEXT; +typedef VkFlags VkConditionalRenderingFlagsEXT; + +typedef struct VkConditionalRenderingBeginInfoEXT { + VkStructureType sType; + const void* pNext; + VkBuffer buffer; + VkDeviceSize offset; + VkConditionalRenderingFlagsEXT flags; +} VkConditionalRenderingBeginInfoEXT; + +typedef struct VkPhysicalDeviceConditionalRenderingFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 conditionalRendering; + VkBool32 inheritedConditionalRendering; +} VkPhysicalDeviceConditionalRenderingFeaturesEXT; + +typedef struct VkCommandBufferInheritanceConditionalRenderingInfoEXT { + VkStructureType sType; + const void* pNext; + VkBool32 conditionalRenderingEnable; +} VkCommandBufferInheritanceConditionalRenderingInfoEXT; + + +typedef void (VKAPI_PTR *PFN_vkCmdBeginConditionalRenderingEXT)(VkCommandBuffer commandBuffer, const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin); +typedef void (VKAPI_PTR *PFN_vkCmdEndConditionalRenderingEXT)(VkCommandBuffer commandBuffer); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdBeginConditionalRenderingEXT( + VkCommandBuffer commandBuffer, + const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin); + +VKAPI_ATTR void VKAPI_CALL vkCmdEndConditionalRenderingEXT( + VkCommandBuffer commandBuffer); +#endif + #define VK_NVX_device_generated_commands 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkObjectTableNVX) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkIndirectCommandsLayoutNVX) @@ -7435,7 +7734,7 @@ typedef struct VkPhysicalDeviceShaderCorePropertiesAMD { #define VK_EXT_vertex_attribute_divisor 1 -#define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION 1 +#define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION 2 #define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME "VK_EXT_vertex_attribute_divisor" typedef struct VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT { @@ -7463,6 +7762,38 @@ typedef struct VkPipelineVertexInputDivisorStateCreateInfoEXT { #define VK_NV_SHADER_SUBGROUP_PARTITIONED_EXTENSION_NAME "VK_NV_shader_subgroup_partitioned" +#define VK_NV_device_diagnostic_checkpoints 1 +#define VK_NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_SPEC_VERSION 2 +#define VK_NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_EXTENSION_NAME "VK_NV_device_diagnostic_checkpoints" + +typedef struct VkQueueFamilyCheckpointPropertiesNV { + VkStructureType sType; + void* pNext; + VkPipelineStageFlags checkpointExecutionStageMask; +} VkQueueFamilyCheckpointPropertiesNV; + +typedef struct VkCheckpointDataNV { + VkStructureType sType; + void* pNext; + VkPipelineStageFlagBits stage; + void* pCheckpointMarker; +} VkCheckpointDataNV; + + +typedef void (VKAPI_PTR *PFN_vkCmdSetCheckpointNV)(VkCommandBuffer commandBuffer, const void* pCheckpointMarker); +typedef void (VKAPI_PTR *PFN_vkGetQueueCheckpointDataNV)(VkQueue queue, uint32_t* pCheckpointDataCount, VkCheckpointDataNV* pCheckpointData); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetCheckpointNV( + VkCommandBuffer commandBuffer, + const void* pCheckpointMarker); + +VKAPI_ATTR void VKAPI_CALL vkGetQueueCheckpointDataNV( + VkQueue queue, + uint32_t* pCheckpointDataCount, + VkCheckpointDataNV* pCheckpointData); +#endif + #ifdef __cplusplus } #endif diff --git a/include/wrappers/buffer.h b/include/wrappers/buffer.h index f8a01329..795457de 100644 --- a/include/wrappers/buffer.h +++ b/include/wrappers/buffer.h @@ -92,8 +92,11 @@ namespace Anvil * any memory allocator, which has this buffer scheduled for deferred memory allocation, * gets a chance to allocate & bind a memory block to the instance. A non-sparse buffer instance * without any memory block bound msut not be used for any GPU-side operation. + * + * This behavior may optionally be disabled by setting @param in_bake_memory_if_necessary to false. + * Should only be done in special circumstances. */ - VkBuffer get_buffer(); + VkBuffer get_buffer(const bool& in_bake_memory_if_necessary = true); /** Returns a pointer to the encapsulated raw Vulkan buffer handle */ const VkBuffer* get_buffer_ptr() const @@ -130,6 +133,11 @@ namespace Anvil return m_page_tracker_ptr.get(); } + bool prefers_dedicated_allocation() const + { + return m_prefers_dedicated_allocation; + } + /** Reads @param in_size bytes, starting from @param in_start_offset, from the wrapped memory object. * * If the buffer object uses mappable storage memory, the affected region will be mapped into process space, @@ -158,6 +166,11 @@ namespace Anvil const Anvil::PhysicalDevice* in_physical_device_ptr, void* out_result_ptr); + bool requires_dedicated_allocation() const + { + return m_requires_dedicated_allocation; + } + /** Attaches a memory block to the buffer object. * * This function can only be called ONCE, after the object has been created with the constructor which @@ -246,6 +259,8 @@ namespace Anvil VkBufferCreateFlagsVariable(m_create_flags); std::vector m_owned_memory_blocks; + bool m_prefers_dedicated_allocation; + bool m_requires_dedicated_allocation; friend class Anvil::Queue; /* set_memory_sparse() */ diff --git a/include/wrappers/command_buffer.h b/include/wrappers/command_buffer.h index 85e0d4a7..9d540765 100644 --- a/include/wrappers/command_buffer.h +++ b/include/wrappers/command_buffer.h @@ -85,8 +85,10 @@ namespace Anvil COMMAND_TYPE_DRAW_INDEXED, COMMAND_TYPE_DRAW_INDEXED_INDIRECT, COMMAND_TYPE_DRAW_INDEXED_INDIRECT_COUNT_AMD, + COMMAND_TYPE_DRAW_INDEXED_INDIRECT_COUNT_KHR, COMMAND_TYPE_DRAW_INDIRECT, COMMAND_TYPE_DRAW_INDIRECT_COUNT_AMD, + COMMAND_TYPE_DRAW_INDIRECT_COUNT_KHR, COMMAND_TYPE_END_QUERY, COMMAND_TYPE_END_RENDER_PASS, COMMAND_TYPE_EXECUTE_COMMANDS, @@ -775,7 +777,7 @@ namespace Anvil uint32_t in_draw_count, uint32_t in_stride); - /** Issues a vkCmdDrawIndexedIndirectCount() call and appends it to the internal vector of commands + /** Issues a vkCmdDrawIndexedIndirectCountAMD() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS * #define enabled). * @@ -802,6 +804,33 @@ namespace Anvil uint32_t in_max_draw_count, uint32_t in_stride); + /** Issues a vkCmdDrawIndexedIndirectCountKHR() call and appends it to the internal vector of commands + * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS + * #define enabled). + * + * Calling this function for a command buffer which has not been put into a recording mode + * (by issuing a start_recording() call earlier) will result in an assertion failure. + * + * It is also illegal to call this function when not recording renderpass commands. Doing so + * will also result in an assertion failure. + * + * Any Vulkan object wrapper instances passed to this function are going to be retained, + * and will be released when the command buffer is released or resetted. + * + * This function is only available if VK_KHR_draw_indirect_count is supported by the Vulkan + * device AND if the extension has been requested at creation time. + * + * Argument meaning is as per VK_KHR_draw_indirect_count specification. + * + * @return true if successful, false otherwise. + **/ + bool record_draw_indexed_indirect_count_KHR(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + Anvil::Buffer* in_count_buffer_ptr, + VkDeviceSize in_count_offset, + uint32_t in_max_draw_count, + uint32_t in_stride); + /** Issues a vkCmdDrawIndirect() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS * #define enabled). @@ -851,6 +880,33 @@ namespace Anvil uint32_t in_max_draw_count, uint32_t in_stride); + /** Issues a vkCmdDrawIndirectCount() call and appends it to the internal vector of commands + * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS + * #define enabled). + * + * Calling this function for a command buffer which has not been put into a recording mode + * (by issuing a start_recording() call earlier) will result in an assertion failure. + * + * It is also illegal to call this function when not recording renderpass commands. Doing so + * will also result in an assertion failure. + * + * Any Vulkan object wrapper instances passed to this function are going to be retained, + * and will be released when the command buffer is released or resetted. + * + * This function is only available if VK_KHR_draw_indirect_count is supported by the Vulkan + * device AND if the extension has been requested at creation time. + * + * Argument meaning is as per VK_KHR_draw_indirect_count specification. + * + * @return true if successful, false otherwise. + **/ + bool record_draw_indirect_count_KHR(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + Anvil::Buffer* in_count_buffer_ptr, + VkDeviceSize in_count_offset, + uint32_t in_max_draw_count, + uint32_t in_stride); + /** Issues a vkCmdEndQuery() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS * #define enabled). @@ -1882,6 +1938,36 @@ namespace Anvil DrawIndirectCountAMDCommand& operator=(const DrawIndirectCountAMDCommand&); } DrawIndirectCountAMDCommand; + /** Holds all arguments passed to a vkCmdDrawIndirectCountKHR() command. */ + typedef struct DrawIndirectCountKHRCommand : public Command + { + VkBuffer buffer; + Anvil::Buffer* buffer_ptr; + VkBuffer count_buffer; + Anvil::Buffer* count_buffer_ptr; + VkDeviceSize count_offset; + uint32_t max_draw_count; + VkDeviceSize offset; + uint32_t stride; + + /** Constructor. **/ + explicit DrawIndirectCountKHRCommand(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + Anvil::Buffer* in_count_buffer_ptr, + VkDeviceSize in_count_offset, + uint32_t in_max_draw_count, + uint32_t in_stride); + + /** Destructor */ + virtual ~DrawIndirectCountKHRCommand() + { + /* Stub */ + } + + private: + DrawIndirectCountKHRCommand& operator=(const DrawIndirectCountKHRCommand&); + } DrawIndirectCountKHRCommand; + /** Holds all arguments passed to a vkCmdDrawIndexedIndirect() command. */ typedef struct DrawIndexedIndirectCommand : public Command { @@ -1937,6 +2023,36 @@ namespace Anvil DrawIndexedIndirectCountAMDCommand& operator=(const DrawIndexedIndirectCountAMDCommand&); } DrawIndexedIndirectCountAMDCommand; + /** Holds all arguments passed to a vkCmdDrawIndexedIndirectCountKHR() command. */ + typedef struct DrawIndexedIndirectCountKHRCommand : public Command + { + VkBuffer buffer; + Anvil::Buffer* buffer_ptr; + VkBuffer count_buffer; + Anvil::Buffer* count_buffer_ptr; + VkDeviceSize count_offset; + uint32_t max_draw_count; + VkDeviceSize offset; + uint32_t stride; + + /** Constructor. **/ + explicit DrawIndexedIndirectCountKHRCommand(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + Anvil::Buffer* in_count_buffer_ptr, + VkDeviceSize in_count_offset, + uint32_t in_max_draw_count, + uint32_t in_stride); + + /** Destructor */ + virtual ~DrawIndexedIndirectCountKHRCommand() + { + /* Stub */ + } + + private: + DrawIndexedIndirectCountKHRCommand& operator=(const DrawIndexedIndirectCountKHRCommand&); + } DrawIndexedIndirectCountKHRCommand; + /** Holds all arguments passed to a vkCmdEndQuery() command. */ typedef struct EndQueryCommand : public Command { diff --git a/include/wrappers/device.h b/include/wrappers/device.h index dac3f5ce..0ed51a03 100644 --- a/include/wrappers/device.h +++ b/include/wrappers/device.h @@ -165,6 +165,17 @@ namespace Anvil return m_khr_descriptor_update_template_extension_entrypoints; } + /** Returns a container with entry-points to functions introduced by VK_KHR_draw_indirect_count extension. + * + * Will fire an assertion failure if the extension was not requested at device creation time. + **/ + const ExtensionKHRDrawIndirectCountEntrypoints& get_extension_khr_draw_indirect_count_entrypoints() const + { + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_draw_indirect_count() ); + + return m_khr_draw_indirect_count_extension_entrypoints; + } + #if defined(_WIN32) const ExtensionKHRExternalFenceWin32Entrypoints& get_extension_khr_external_fence_win32_entrypoints() const { @@ -209,6 +220,14 @@ namespace Anvil } #endif + /** Returns a container with entry-points to functions introduced by VK_KHR_get_memory_requirements2 extension. **/ + const ExtensionKHRGetMemoryRequirements2Entrypoints& get_extension_khr_get_memory_requirements2_entrypoints() const + { + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_get_memory_requirements2() ); + + return m_khr_get_memory_requirements2_extension_entrypoints; + } + /** Returns a container with entry-points to functions introduced by VK_KHR_maintenance1 extension. **/ const ExtensionKHRMaintenance1Entrypoints& get_extension_khr_maintenance1_entrypoints() const { @@ -269,9 +288,9 @@ namespace Anvil switch (in_family_type) { - case Anvil::QueueFamilyType::COMPUTE: result = static_cast(m_compute_queues.size() ); break; - case Anvil::QueueFamilyType::TRANSFER: result = static_cast(m_transfer_queues.size() ); break; - case Anvil::QueueFamilyType::UNIVERSAL: result = static_cast(m_universal_queues.size() ); break; + case Anvil::QueueFamilyType::COMPUTE: result = static_cast(m_compute_queues.size() ); break; + case Anvil::QueueFamilyType::TRANSFER: result = static_cast(m_transfer_queues.size() ); break; + case Anvil::QueueFamilyType::UNIVERSAL: result = static_cast(m_universal_queues.size() ); break; default: { @@ -316,8 +335,8 @@ namespace Anvil return m_parent_instance_ptr; } - virtual bool get_physical_device_buffer_format_properties(const BufferFormatPropertiesQuery& in_query, - Anvil::BufferFormatProperties* out_opt_result_ptr = nullptr) const = 0; + virtual bool get_physical_device_buffer_properties(const BufferPropertiesQuery& in_query, + Anvil::BufferProperties* out_opt_result_ptr = nullptr) const = 0; /** Returns features supported by physical device(s) which have been used to instantiate * this logical device instance. @@ -347,6 +366,9 @@ namespace Anvil **/ virtual const QueueFamilyInfoItems& get_physical_device_queue_families() const = 0; + virtual bool get_physical_device_semaphore_properties(const SemaphorePropertiesQuery& in_query, + Anvil::SemaphoreProperties* out_opt_result_ptr = nullptr) const = 0; + /** Returns sparse image format properties, as reported by physical device(s) which have been * used to instantiate this logical device instance. * @@ -643,6 +665,8 @@ namespace Anvil ExtensionEXTDebugMarkerEntrypoints m_ext_debug_marker_extension_entrypoints; ExtensionKHRBindMemory2Entrypoints m_khr_bind_memory2_extension_entrypoints; ExtensionKHRDescriptorUpdateTemplateEntrypoints m_khr_descriptor_update_template_extension_entrypoints; + ExtensionKHRDrawIndirectCountEntrypoints m_khr_draw_indirect_count_extension_entrypoints; + ExtensionKHRGetMemoryRequirements2Entrypoints m_khr_get_memory_requirements2_extension_entrypoints; ExtensionKHRMaintenance1Entrypoints m_khr_maintenance1_extension_entrypoints; ExtensionKHRMaintenance3Entrypoints m_khr_maintenance3_extension_entrypoints; ExtensionKHRSurfaceEntrypoints m_khr_surface_extension_entrypoints; @@ -738,8 +762,8 @@ namespace Anvil return m_parent_physical_device_ptr; } - bool get_physical_device_buffer_format_properties(const BufferFormatPropertiesQuery& in_query, - Anvil::BufferFormatProperties* out_opt_result_ptr = nullptr) const override; + bool get_physical_device_buffer_properties(const BufferPropertiesQuery& in_query, + Anvil::BufferProperties* out_opt_result_ptr = nullptr) const override; /** See documentation in BaseDevice for more details */ const Anvil::PhysicalDeviceFeatures& get_physical_device_features() const override; @@ -747,6 +771,9 @@ namespace Anvil bool get_physical_device_fence_properties(const FencePropertiesQuery& in_query, Anvil::FenceProperties* out_opt_result_ptr = nullptr) const override; + bool get_physical_device_semaphore_properties(const SemaphorePropertiesQuery& in_query, + Anvil::SemaphoreProperties* out_opt_result_ptr = nullptr) const override; + Anvil::FormatProperties get_physical_device_format_properties(VkFormat in_format) const override; bool get_physical_device_image_format_properties(const ImageFormatPropertiesQuery& in_query, @@ -805,6 +832,7 @@ namespace Anvil /* Private variables */ const Anvil::PhysicalDevice* m_parent_physical_device_ptr; }; + }; /* namespace Anvil */ #endif /* WRAPPERS_DEVICE_H */ diff --git a/include/wrappers/fence.h b/include/wrappers/fence.h index e8f2a45a..245e2982 100644 --- a/include/wrappers/fence.h +++ b/include/wrappers/fence.h @@ -90,6 +90,7 @@ namespace Anvil * Requires VK_KHR_external_fence_fd under Linux. * Requires VK_KHR_external_fence_win32 under Windows. * + * NOTE: Under Linux, @param in_handle is no longer valid if function returns true. * * @return true if successful, false otherwise. * @@ -159,4 +160,4 @@ namespace Anvil }; }; /* namespace Anvil */ -#endif /* WRAPPERS_FENCE_H */ \ No newline at end of file +#endif /* WRAPPERS_FENCE_H */ diff --git a/include/wrappers/graphics_pipeline_manager.h b/include/wrappers/graphics_pipeline_manager.h index 0235ba50..ad2f0616 100644 --- a/include/wrappers/graphics_pipeline_manager.h +++ b/include/wrappers/graphics_pipeline_manager.h @@ -116,11 +116,41 @@ namespace Anvil /* Private type declarations */ typedef std::map AttributeLocationToBindingIndexMap; + typedef struct VertexInputBinding + { + uint32_t binding; + uint32_t divisor; + VkVertexInputRate input_rate; + uint32_t stride; + + VertexInputBinding() + { + binding = 0; + divisor = 0; + input_rate = VK_VERTEX_INPUT_RATE_MAX_ENUM; + stride = 0; + } + + VertexInputBinding(const VkVertexInputBindingDescription& in_binding_vk, + const uint32_t& in_divisor) + { + binding = in_binding_vk.binding; + divisor = in_divisor; + input_rate = in_binding_vk.inputRate; + stride = in_binding_vk.stride; + } + } VertexInputBinding; + typedef struct GraphicsPipelineData { AttributeLocationToBindingIndexMap attribute_location_to_binding_index_map; const Anvil::GraphicsPipelineCreateInfo* pipeline_create_info_ptr; std::vector vk_input_attributes; + + /* NOTE: VkVertexInputBindingDescription does not include divisor information so we need to maintain a custom + * set of structs as well. + */ + std::vector input_bindings; std::vector vk_input_bindings; explicit GraphicsPipelineData(const Anvil::GraphicsPipelineCreateInfo* in_pipeline_create_info_ptr) diff --git a/include/wrappers/image.h b/include/wrappers/image.h index 2f04dcae..286b9650 100644 --- a/include/wrappers/image.h +++ b/include/wrappers/image.h @@ -140,8 +140,12 @@ namespace Anvil * * In case of sparse images, the callback will only occur if at least one memory allocation * has been scheduled for this image instance. + * + * This behavior may optionally be disabled by setting @param in_bake_memory_if_necessary to false. + * Should only be done in special circumstances. + * */ - const VkImage& get_image(); + const VkImage& get_image(const bool& in_bake_memory_if_necessary = true); /** Returns information about the data alignment required by the underlying VkImage instance */ VkDeviceSize get_image_alignment() const @@ -259,7 +263,15 @@ namespace Anvil uint32_t in_y, uint32_t in_z) const; - + bool prefers_dedicated_allocation() const + { + return m_prefers_dedicated_allocation; + } + + bool requires_dedicated_allocation() const + { + return m_requires_dedicated_allocation; + } /** Binds the specified region of a Vulkan memory object to an Image and caches information * about the new binding. @@ -479,6 +491,9 @@ namespace Anvil bool m_swapchain_memory_assigned; bool m_uses_full_mipmap_chain; + bool m_prefers_dedicated_allocation; + bool m_requires_dedicated_allocation; + MemoryBlockUniquePtr m_metadata_memory_block_ptr; std::vector m_memory_blocks_owned; diff --git a/include/wrappers/physical_device.h b/include/wrappers/physical_device.h index 3a5183d4..12a183bb 100644 --- a/include/wrappers/physical_device.h +++ b/include/wrappers/physical_device.h @@ -63,8 +63,8 @@ namespace Anvil * * Requires VK_KHR_external_memory_capabilities. */ - bool get_buffer_format_properties(const Anvil::BufferFormatPropertiesQuery& in_query, - Anvil::BufferFormatProperties* out_opt_result_ptr = nullptr) const; + bool get_buffer_properties(const Anvil::BufferPropertiesQuery& in_query, + Anvil::BufferProperties* out_opt_result_ptr = nullptr) const; /** Retrieves features supported by the physical device */ const Anvil::PhysicalDeviceFeatures& get_device_features() const @@ -233,6 +233,7 @@ namespace Anvil std::unique_ptr m_core_properties_vk10_ptr; std::unique_ptr m_ext_descriptor_indexing_features_ptr; std::unique_ptr m_ext_descriptor_indexing_properties_ptr; + std::unique_ptr m_ext_vertex_attribute_divisor_properties_ptr; std::unique_ptr m_khr_16_bit_storage_features_ptr; std::unique_ptr m_khr_external_memory_capabilities_physical_device_id_properties_ptr; std::unique_ptr m_khr_maintenance3_properties_ptr; diff --git a/include/wrappers/queue.h b/include/wrappers/queue.h index 51c408e7..2671542e 100644 --- a/include/wrappers/queue.h +++ b/include/wrappers/queue.h @@ -132,7 +132,7 @@ namespace Anvil uint32_t in_n_wait_semaphores, Anvil::Semaphore* const* in_wait_semaphore_ptrs_ptr); - void submit(const SubmitInfo& in_submit_info); + bool submit(const SubmitInfo& in_submit_info); /** Tells whether the queue supports sparse bindings */ bool supports_sparse_bindings() const diff --git a/include/wrappers/semaphore.h b/include/wrappers/semaphore.h index 4a111576..7436506b 100644 --- a/include/wrappers/semaphore.h +++ b/include/wrappers/semaphore.h @@ -87,6 +87,7 @@ namespace Anvil * Requires VK_KHR_external_semaphore_fd under Linux. * Requires VK_KHR_external_semaphore_win32 under Windows. * + * NOTE: Under Linux, @param in_handle is no longer valid if function returns true. * * @return true if successful, false otherwise. * @@ -130,4 +131,4 @@ namespace Anvil }; }; /* namespace Anvil */ -#endif /* WRAPPERS_SEMAPHORE_H */ \ No newline at end of file +#endif /* WRAPPERS_SEMAPHORE_H */ diff --git a/src/misc/buffer_create_info.cpp b/src/misc/buffer_create_info.cpp index 8da43b69..54d0683d 100644 --- a/src/misc/buffer_create_info.cpp +++ b/src/misc/buffer_create_info.cpp @@ -124,20 +124,20 @@ Anvil::BufferCreateInfo::BufferCreateInfo(const Anvil::BaseDevice* in VkBufferUsageFlags in_usage_flags, Anvil::SparseResidencyScope in_residency_scope, MTSafety in_mt_safety, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) - :m_client_data_ptr (nullptr), - m_device_ptr (in_device_ptr), - m_external_memory_handle_types(in_external_memory_handle_types), - m_memory_features (0), - m_mt_safety (in_mt_safety), - m_parent_buffer_ptr (nullptr), - m_queue_families (in_queue_families), - m_residency_scope (in_residency_scope), - m_sharing_mode (in_sharing_mode), - m_size (in_size), - m_start_offset (0), - m_type (BufferType::SPARSE_NO_ALLOC), - m_usage_flags (in_usage_flags) + Anvil::ExternalMemoryHandleTypeBits in_exportable_external_memory_handle_types) + :m_client_data_ptr (nullptr), + m_device_ptr (in_device_ptr), + m_exportable_external_memory_handle_types(in_exportable_external_memory_handle_types), + m_memory_features (0), + m_mt_safety (in_mt_safety), + m_parent_buffer_ptr (nullptr), + m_queue_families (in_queue_families), + m_residency_scope (in_residency_scope), + m_sharing_mode (in_sharing_mode), + m_size (in_size), + m_start_offset (0), + m_type (BufferType::SPARSE_NO_ALLOC), + m_usage_flags (in_usage_flags) { /* Sanity checks */ const auto& physical_device_features(in_device_ptr->get_physical_device_features() ); @@ -172,21 +172,21 @@ Anvil::BufferCreateInfo::BufferCreateInfo(const Anvil::BufferType& in VkBufferUsageFlags in_usage_flags, MemoryFeatureFlags in_memory_features, MTSafety in_mt_safety, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types, + Anvil::ExternalMemoryHandleTypeBits in_exportable_external_memory_handle_types, const void* in_opt_client_data_ptr) - :m_client_data_ptr (in_opt_client_data_ptr), - m_device_ptr (in_device_ptr), - m_external_memory_handle_types(in_external_memory_handle_types), - m_memory_features (in_memory_features), - m_mt_safety (in_mt_safety), - m_parent_buffer_ptr (nullptr), - m_queue_families (in_queue_families), - m_residency_scope (Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED), - m_sharing_mode (in_sharing_mode), - m_size (in_size), - m_start_offset (0), - m_type (in_buffer_type), - m_usage_flags (in_usage_flags) + :m_client_data_ptr (in_opt_client_data_ptr), + m_device_ptr (in_device_ptr), + m_exportable_external_memory_handle_types(in_exportable_external_memory_handle_types), + m_memory_features (in_memory_features), + m_mt_safety (in_mt_safety), + m_parent_buffer_ptr (nullptr), + m_queue_families (in_queue_families), + m_residency_scope (Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED), + m_sharing_mode (in_sharing_mode), + m_size (in_size), + m_start_offset (0), + m_type (in_buffer_type), + m_usage_flags (in_usage_flags) { if ((in_memory_features & MEMORY_FEATURE_FLAG_MAPPABLE) == 0) { @@ -197,19 +197,19 @@ Anvil::BufferCreateInfo::BufferCreateInfo(const Anvil::BufferType& in Anvil::BufferCreateInfo::BufferCreateInfo(Anvil::Buffer* in_parent_buffer_ptr, VkDeviceSize in_start_offset, VkDeviceSize in_size) - :m_client_data_ptr (nullptr), - m_device_ptr (in_parent_buffer_ptr->get_create_info_ptr()->m_device_ptr), - m_external_memory_handle_types(in_parent_buffer_ptr->get_create_info_ptr()->m_external_memory_handle_types), - m_memory_features (in_parent_buffer_ptr->get_create_info_ptr()->m_memory_features), - m_mt_safety (in_parent_buffer_ptr->get_create_info_ptr()->m_mt_safety), - m_parent_buffer_ptr (in_parent_buffer_ptr), - m_queue_families (in_parent_buffer_ptr->get_create_info_ptr()->m_queue_families), - m_residency_scope (in_parent_buffer_ptr->get_create_info_ptr()->m_residency_scope), - m_sharing_mode (in_parent_buffer_ptr->get_create_info_ptr()->m_sharing_mode), - m_size (in_size), - m_start_offset (in_start_offset), - m_type (BufferType::NONSPARSE_NO_ALLOC_CHILD), - m_usage_flags (in_parent_buffer_ptr->get_create_info_ptr()->m_usage_flags) + :m_client_data_ptr (nullptr), + m_device_ptr (in_parent_buffer_ptr->get_create_info_ptr()->m_device_ptr), + m_exportable_external_memory_handle_types(in_parent_buffer_ptr->get_create_info_ptr()->m_exportable_external_memory_handle_types), + m_memory_features (in_parent_buffer_ptr->get_create_info_ptr()->m_memory_features), + m_mt_safety (in_parent_buffer_ptr->get_create_info_ptr()->m_mt_safety), + m_parent_buffer_ptr (in_parent_buffer_ptr), + m_queue_families (in_parent_buffer_ptr->get_create_info_ptr()->m_queue_families), + m_residency_scope (in_parent_buffer_ptr->get_create_info_ptr()->m_residency_scope), + m_sharing_mode (in_parent_buffer_ptr->get_create_info_ptr()->m_sharing_mode), + m_size (in_size), + m_start_offset (in_start_offset), + m_type (BufferType::NONSPARSE_NO_ALLOC_CHILD), + m_usage_flags (in_parent_buffer_ptr->get_create_info_ptr()->m_usage_flags) { /* Sanity checks */ anvil_assert(in_parent_buffer_ptr != nullptr); diff --git a/src/misc/fence_create_info.cpp b/src/misc/fence_create_info.cpp index 90ed5403..63742dbe 100644 --- a/src/misc/fence_create_info.cpp +++ b/src/misc/fence_create_info.cpp @@ -39,13 +39,14 @@ Anvil::FenceCreateInfoUniquePtr Anvil::FenceCreateInfo::create(const Anvil::Base Anvil::FenceCreateInfo::FenceCreateInfo(const Anvil::BaseDevice* in_device_ptr, bool in_create_signalled, MTSafety in_mt_safety) - :m_create_signalled (in_create_signalled), - m_device_ptr (in_device_ptr), + :m_create_signalled (in_create_signalled), + m_device_ptr (in_device_ptr), #if defined(_WIN32) - m_exportable_nt_handle_info_specified (false), + m_exportable_nt_handle_info_specified (false), + m_exportable_nt_handle_info_security_attributes_specified(false), #endif - m_exportable_external_fence_handle_types(Anvil::EXTERNAL_FENCE_HANDLE_TYPE_NONE), - m_mt_safety (in_mt_safety) + m_exportable_external_fence_handle_types (Anvil::EXTERNAL_FENCE_HANDLE_TYPE_NONE), + m_mt_safety (in_mt_safety) { /* Stub */ } \ No newline at end of file diff --git a/src/misc/formats.cpp b/src/misc/formats.cpp index fc458758..204f6866 100644 --- a/src/misc/formats.cpp +++ b/src/misc/formats.cpp @@ -23,203 +23,356 @@ #include "misc/debug.h" #include "misc/formats.h" -static struct FormatInfo +static const struct FormatInfo { VkFormat format; const char* name; Anvil::ComponentLayout component_layout; uint8_t component_bits[4]; /* if [0] == [1] == [2] == [3] == 0, the format is a block format. */ Anvil::FormatType format_type; -} formats[] = + bool is_packed; +} g_formats[] = { - /* format | name | component_layout | component_bits[0] | component_bits[1] | component_bits[2] | component_bits[3] | format_type */ - {VK_FORMAT_UNDEFINED, "VK_FORMAT_UNDEFINED", Anvil::COMPONENT_LAYOUT_UNKNOWN, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNKNOWN}, - {VK_FORMAT_R4G4_UNORM_PACK8, "VK_FORMAT_R4G4_UNORM_PACK8", Anvil::COMPONENT_LAYOUT_RG, 4, 4, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_R4G4B4A4_UNORM_PACK16, "VK_FORMAT_R4G4B4A4_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_RGBA, 4, 4, 4, 4, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_B4G4R4A4_UNORM_PACK16, "VK_FORMAT_B4G4R4A4_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_BGRA, 4, 4, 4, 4, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_R5G6B5_UNORM_PACK16, "VK_FORMAT_R5G6B5_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_RGB, 5, 6, 5, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_B5G6R5_UNORM_PACK16, "VK_FORMAT_B5G6R5_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_BGR, 5, 6, 5, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_R5G5B5A1_UNORM_PACK16, "VK_FORMAT_R5G5B5A1_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_RGBA, 5, 5, 5, 1, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_B5G5R5A1_UNORM_PACK16, "VK_FORMAT_B5G5R5A1_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_BGRA, 5, 5, 5, 1, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_A1R5G5B5_UNORM_PACK16, "VK_FORMAT_A1R5G5B5_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_ARGB, 1, 5, 5, 5, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_R8_UNORM, "VK_FORMAT_R8_UNORM", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_R8_SNORM, "VK_FORMAT_R8_SNORM", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM}, - {VK_FORMAT_R8_USCALED, "VK_FORMAT_R8_USCALED", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_USCALED}, - {VK_FORMAT_R8_SSCALED, "VK_FORMAT_R8_SSCALED", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_SSCALED}, - {VK_FORMAT_R8_UINT, "VK_FORMAT_R8_UINT", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_R8_SINT, "VK_FORMAT_R8_SINT", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_SINT}, - {VK_FORMAT_R8_SRGB, "VK_FORMAT_R8_SRGB", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_R8G8_UNORM, "VK_FORMAT_R8G8_UNORM", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_R8G8_SNORM, "VK_FORMAT_R8G8_SNORM", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_SNORM}, - {VK_FORMAT_R8G8_USCALED, "VK_FORMAT_R8G8_USCALED", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_USCALED}, - {VK_FORMAT_R8G8_SSCALED, "VK_FORMAT_R8G8_SSCALED", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_SSCALED}, - {VK_FORMAT_R8G8_UINT, "VK_FORMAT_R8G8_UINT", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_R8G8_SINT, "VK_FORMAT_R8G8_SINT", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_SINT}, - {VK_FORMAT_R8G8_SRGB, "VK_FORMAT_R8G8_SRGB", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_R8G8B8_UNORM, "VK_FORMAT_R8G8B8_UNORM", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_R8G8B8_SNORM, "VK_FORMAT_R8G8B8_SNORM", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SNORM}, - {VK_FORMAT_R8G8B8_USCALED, "VK_FORMAT_R8G8B8_USCALED", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_USCALED}, - {VK_FORMAT_R8G8B8_SSCALED, "VK_FORMAT_R8G8B8_SSCALED", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SSCALED}, - {VK_FORMAT_R8G8B8_UINT, "VK_FORMAT_R8G8B8_UINT", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_R8G8B8_SINT, "VK_FORMAT_R8G8B8_SINT", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SINT}, - {VK_FORMAT_R8G8B8_SRGB, "VK_FORMAT_R8G8B8_SRGB", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_B8G8R8_UNORM, "VK_FORMAT_B8G8R8_UNORM", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_B8G8R8_SNORM, "VK_FORMAT_B8G8R8_SNORM", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SNORM}, - {VK_FORMAT_B8G8R8_USCALED, "VK_FORMAT_B8G8R8_USCALED", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_USCALED}, - {VK_FORMAT_B8G8R8_SSCALED, "VK_FORMAT_B8G8R8_SSCALED", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SSCALED}, - {VK_FORMAT_B8G8R8_UINT, "VK_FORMAT_B8G8R8_UINT", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_B8G8R8_SINT, "VK_FORMAT_B8G8R8_SINT", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SINT}, - {VK_FORMAT_B8G8R8_SRGB, "VK_FORMAT_B8G8R8_SRGB", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_R8G8B8A8_UNORM, "VK_FORMAT_R8G8B8A8_UNORM", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_R8G8B8A8_SNORM, "VK_FORMAT_R8G8B8A8_SNORM", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SNORM}, - {VK_FORMAT_R8G8B8A8_USCALED, "VK_FORMAT_R8G8B8A8_USCALED", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_USCALED}, - {VK_FORMAT_R8G8B8A8_SSCALED, "VK_FORMAT_R8G8B8A8_SSCALED", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SSCALED}, - {VK_FORMAT_R8G8B8A8_UINT, "VK_FORMAT_R8G8B8A8_UINT", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_R8G8B8A8_SINT, "VK_FORMAT_R8G8B8A8_SINT", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SINT}, - {VK_FORMAT_R8G8B8A8_SRGB, "VK_FORMAT_R8G8B8A8_SRGB", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_B8G8R8A8_UNORM, "VK_FORMAT_B8G8R8A8_UNORM", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_B8G8R8A8_SNORM, "VK_FORMAT_B8G8R8A8_SNORM", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SNORM}, - {VK_FORMAT_B8G8R8A8_USCALED, "VK_FORMAT_B8G8R8A8_USCALED", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_USCALED}, - {VK_FORMAT_B8G8R8A8_SSCALED, "VK_FORMAT_B8G8R8A8_SSCALED", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SSCALED}, - {VK_FORMAT_B8G8R8A8_UINT, "VK_FORMAT_B8G8R8A8_UINT", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_B8G8R8A8_SINT, "VK_FORMAT_B8G8R8A8_SINT", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SINT}, - {VK_FORMAT_B8G8R8A8_SRGB, "VK_FORMAT_B8G8R8A8_SRGB", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_A8B8G8R8_UNORM_PACK32, "VK_FORMAT_A8B8G8R8_UNORM_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_A8B8G8R8_SNORM_PACK32, "VK_FORMAT_A8B8G8R8_SNORM_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SNORM}, - {VK_FORMAT_A8B8G8R8_USCALED_PACK32, "VK_FORMAT_A8B8G8R8_USCALED_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_USCALED}, - {VK_FORMAT_A8B8G8R8_SSCALED_PACK32, "VK_FORMAT_A8B8G8R8_SSCALED_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SSCALED}, - {VK_FORMAT_A8B8G8R8_UINT_PACK32, "VK_FORMAT_A8B8G8R8_UINT_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_A8B8G8R8_SINT_PACK32, "VK_FORMAT_A8B8G8R8_SINT_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SINT}, - {VK_FORMAT_A8B8G8R8_SRGB_PACK32, "VK_FORMAT_A8B8G8R8_SRGB_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_A2R10G10B10_UNORM_PACK32, "VK_FORMAT_A2R10G10B10_UNORM_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_A2R10G10B10_SNORM_PACK32, "VK_FORMAT_A2R10G10B10_SNORM_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SNORM}, - {VK_FORMAT_A2R10G10B10_USCALED_PACK32, "VK_FORMAT_A2R10G10B10_USCALED_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_USCALED}, - {VK_FORMAT_A2R10G10B10_SSCALED_PACK32, "VK_FORMAT_A2R10G10B10_SSCALED_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SSCALED}, - {VK_FORMAT_A2R10G10B10_UINT_PACK32, "VK_FORMAT_A2R10G10B10_UINT_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_A2R10G10B10_SINT_PACK32, "VK_FORMAT_A2R10G10B10_SINT_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SINT}, - {VK_FORMAT_A2B10G10R10_UNORM_PACK32, "VK_FORMAT_A2B10G10R10_UNORM_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_A2B10G10R10_SNORM_PACK32, "VK_FORMAT_A2B10G10R10_SNORM_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SNORM}, - {VK_FORMAT_A2B10G10R10_USCALED_PACK32, "VK_FORMAT_A2B10G10R10_USCALED_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_USCALED}, - {VK_FORMAT_A2B10G10R10_SSCALED_PACK32, "VK_FORMAT_A2B10G10R10_SSCALED_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SSCALED}, - {VK_FORMAT_A2B10G10R10_UINT_PACK32, "VK_FORMAT_A2B10G10R10_UINT_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_A2B10G10R10_SINT_PACK32, "VK_FORMAT_A2B10G10R10_SINT_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SINT}, - {VK_FORMAT_R16_UNORM, "VK_FORMAT_R16_UNORM", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_R16_SNORM, "VK_FORMAT_R16_SNORM", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM}, - {VK_FORMAT_R16_USCALED, "VK_FORMAT_R16_USCALED", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_USCALED}, - {VK_FORMAT_R16_SSCALED, "VK_FORMAT_R16_SSCALED", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_SSCALED}, - {VK_FORMAT_R16_UINT, "VK_FORMAT_R16_UINT", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_R16_SINT, "VK_FORMAT_R16_SINT", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_SINT}, - {VK_FORMAT_R16_SFLOAT, "VK_FORMAT_R16_SFLOAT", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT}, - {VK_FORMAT_R16G16_UNORM, "VK_FORMAT_R16G16_UNORM", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_R16G16_SNORM, "VK_FORMAT_R16G16_SNORM", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_SNORM}, - {VK_FORMAT_R16G16_USCALED, "VK_FORMAT_R16G16_USCALED", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_USCALED}, - {VK_FORMAT_R16G16_SSCALED, "VK_FORMAT_R16G16_SSCALED", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_SSCALED}, - {VK_FORMAT_R16G16_UINT, "VK_FORMAT_R16G16_UINT", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_R16G16_SINT, "VK_FORMAT_R16G16_SINT", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_SINT}, - {VK_FORMAT_R16G16_SFLOAT, "VK_FORMAT_R16G16_SFLOAT", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_SFLOAT}, - {VK_FORMAT_R16G16B16_UNORM, "VK_FORMAT_R16G16B16_UNORM", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_R16G16B16_SNORM, "VK_FORMAT_R16G16B16_SNORM", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_SNORM}, - {VK_FORMAT_R16G16B16_USCALED, "VK_FORMAT_R16G16B16_USCALED", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_USCALED}, - {VK_FORMAT_R16G16B16_SSCALED, "VK_FORMAT_R16G16B16_SSCALED", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_SSCALED}, - {VK_FORMAT_R16G16B16_UINT, "VK_FORMAT_R16G16B16_UINT", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_R16G16B16_SINT, "VK_FORMAT_R16G16B16_SINT", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_SINT}, - {VK_FORMAT_R16G16B16_SFLOAT, "VK_FORMAT_R16G16B16_SFLOAT", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_SFLOAT}, - {VK_FORMAT_R16G16B16A16_UNORM, "VK_FORMAT_R16G16B16A16_UNORM", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_R16G16B16A16_SNORM, "VK_FORMAT_R16G16B16A16_SNORM", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_SNORM}, - {VK_FORMAT_R16G16B16A16_USCALED, "VK_FORMAT_R16G16B16A16_USCALED", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_USCALED}, - {VK_FORMAT_R16G16B16A16_SSCALED, "VK_FORMAT_R16G16B16A16_SSCALED", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_SSCALED}, - {VK_FORMAT_R16G16B16A16_UINT, "VK_FORMAT_R16G16B16A16_UINT", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_R16G16B16A16_SINT, "VK_FORMAT_R16G16B16A16_SINT", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_SINT}, - {VK_FORMAT_R16G16B16A16_SFLOAT, "VK_FORMAT_R16G16B16A16_SFLOAT", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_SFLOAT}, - {VK_FORMAT_R32_UINT, "VK_FORMAT_R32_UINT", Anvil::COMPONENT_LAYOUT_R, 32, 0, 0, 0, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_R32_SINT, "VK_FORMAT_R32_SINT", Anvil::COMPONENT_LAYOUT_R, 32, 0, 0, 0, Anvil::FORMAT_TYPE_SINT}, - {VK_FORMAT_R32_SFLOAT, "VK_FORMAT_R32_SFLOAT", Anvil::COMPONENT_LAYOUT_R, 32, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT}, - {VK_FORMAT_R32G32_UINT, "VK_FORMAT_R32G32_UINT", Anvil::COMPONENT_LAYOUT_RG, 32, 32, 0, 0, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_R32G32_SINT, "VK_FORMAT_R32G32_SINT", Anvil::COMPONENT_LAYOUT_RG, 32, 32, 0, 0, Anvil::FORMAT_TYPE_SINT}, - {VK_FORMAT_R32G32_SFLOAT, "VK_FORMAT_R32G32_SFLOAT", Anvil::COMPONENT_LAYOUT_RG, 32, 32, 0, 0, Anvil::FORMAT_TYPE_SFLOAT}, - {VK_FORMAT_R32G32B32_UINT, "VK_FORMAT_R32G32B32_UINT", Anvil::COMPONENT_LAYOUT_RGB, 32, 32, 32, 0, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_R32G32B32_SINT, "VK_FORMAT_R32G32B32_SINT", Anvil::COMPONENT_LAYOUT_RGB, 32, 32, 32, 0, Anvil::FORMAT_TYPE_SINT}, - {VK_FORMAT_R32G32B32_SFLOAT, "VK_FORMAT_R32G32B32_SFLOAT", Anvil::COMPONENT_LAYOUT_RGB, 32, 32, 32, 0, Anvil::FORMAT_TYPE_SFLOAT}, - {VK_FORMAT_R32G32B32A32_UINT, "VK_FORMAT_R32G32B32A32_UINT", Anvil::COMPONENT_LAYOUT_RGBA, 32, 32, 32, 32, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_R32G32B32A32_SINT, "VK_FORMAT_R32G32B32A32_SINT", Anvil::COMPONENT_LAYOUT_RGBA, 32, 32, 32, 32, Anvil::FORMAT_TYPE_SINT}, - {VK_FORMAT_R32G32B32A32_SFLOAT, "VK_FORMAT_R32G32B32A32_SFLOAT", Anvil::COMPONENT_LAYOUT_RGBA, 32, 32, 32, 32, Anvil::FORMAT_TYPE_SFLOAT}, - {VK_FORMAT_R64_UINT, "VK_FORMAT_R64_UINT", Anvil::COMPONENT_LAYOUT_R, 64, 0, 0, 0, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_R64_SINT, "VK_FORMAT_R64_SINT", Anvil::COMPONENT_LAYOUT_R, 64, 0, 0, 0, Anvil::FORMAT_TYPE_SINT}, - {VK_FORMAT_R64_SFLOAT, "VK_FORMAT_R64_SFLOAT", Anvil::COMPONENT_LAYOUT_R, 64, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT}, - {VK_FORMAT_R64G64_UINT, "VK_FORMAT_R64G64_UINT", Anvil::COMPONENT_LAYOUT_RG, 64, 64, 0, 0, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_R64G64_SINT, "VK_FORMAT_R64G64_SINT", Anvil::COMPONENT_LAYOUT_RG, 64, 64, 0, 0, Anvil::FORMAT_TYPE_SINT}, - {VK_FORMAT_R64G64_SFLOAT, "VK_FORMAT_R64G64_SFLOAT", Anvil::COMPONENT_LAYOUT_RG, 64, 64, 0, 0, Anvil::FORMAT_TYPE_SFLOAT}, - {VK_FORMAT_R64G64B64_UINT, "VK_FORMAT_R64G64B64_UINT", Anvil::COMPONENT_LAYOUT_RGB, 64, 64, 64, 0, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_R64G64B64_SINT, "VK_FORMAT_R64G64B64_SINT", Anvil::COMPONENT_LAYOUT_RGB, 64, 64, 64, 0, Anvil::FORMAT_TYPE_SINT}, - {VK_FORMAT_R64G64B64_SFLOAT, "VK_FORMAT_R64G64B64_SFLOAT", Anvil::COMPONENT_LAYOUT_RGB, 64, 64, 64, 0, Anvil::FORMAT_TYPE_SFLOAT}, - {VK_FORMAT_R64G64B64A64_UINT, "VK_FORMAT_R64G64B64A64_UINT", Anvil::COMPONENT_LAYOUT_RGBA, 64, 64, 64, 64, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_R64G64B64A64_SINT, "VK_FORMAT_R64G64B64A64_SINT", Anvil::COMPONENT_LAYOUT_RGBA, 64, 64, 64, 64, Anvil::FORMAT_TYPE_SINT}, - {VK_FORMAT_R64G64B64A64_SFLOAT, "VK_FORMAT_R64G64B64A64_SFLOAT", Anvil::COMPONENT_LAYOUT_RGBA, 64, 64, 64, 64, Anvil::FORMAT_TYPE_SFLOAT}, - {VK_FORMAT_B10G11R11_UFLOAT_PACK32, "VK_FORMAT_B10G11R11_UFLOAT_PACK32", Anvil::COMPONENT_LAYOUT_BGR, 10, 11, 11, 0, Anvil::FORMAT_TYPE_UFLOAT}, - {VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, "VK_FORMAT_E5B9G9R9_UFLOAT_PACK32", Anvil::COMPONENT_LAYOUT_EBGR, 5, 9, 9, 9, Anvil::FORMAT_TYPE_UFLOAT}, - {VK_FORMAT_D16_UNORM, "VK_FORMAT_D16_UNORM", Anvil::COMPONENT_LAYOUT_D, 16, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_X8_D24_UNORM_PACK32, "VK_FORMAT_X8_D24_UNORM_PACK32", Anvil::COMPONENT_LAYOUT_XD, 8, 24, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_D32_SFLOAT, "VK_FORMAT_D32_SFLOAT", Anvil::COMPONENT_LAYOUT_D, 32, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT}, - {VK_FORMAT_S8_UINT, "VK_FORMAT_S8_UINT", Anvil::COMPONENT_LAYOUT_S, 8, 0, 0, 0, Anvil::FORMAT_TYPE_UINT}, - {VK_FORMAT_D16_UNORM_S8_UINT, "VK_FORMAT_D16_UNORM_S8_UINT", Anvil::COMPONENT_LAYOUT_DS, 16, 8, 0, 0, Anvil::FORMAT_TYPE_UNORM_UINT}, - {VK_FORMAT_D24_UNORM_S8_UINT, "VK_FORMAT_D24_UNORM_S8_UINT", Anvil::COMPONENT_LAYOUT_DS, 24, 8, 0, 0, Anvil::FORMAT_TYPE_UNORM_UINT}, - {VK_FORMAT_D32_SFLOAT_S8_UINT, "VK_FORMAT_D32_SFLOAT_S8_UINT", Anvil::COMPONENT_LAYOUT_DS, 32, 8, 0, 0, Anvil::FORMAT_TYPE_SFLOAT_UINT}, - {VK_FORMAT_BC1_RGB_UNORM_BLOCK, "VK_FORMAT_BC1_RGB_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_BC1_RGB_SRGB_BLOCK, "VK_FORMAT_BC1_RGB_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_BC1_RGBA_UNORM_BLOCK, "VK_FORMAT_BC1_RGBA_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_BC1_RGBA_SRGB_BLOCK, "VK_FORMAT_BC1_RGBA_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_BC2_UNORM_BLOCK, "VK_FORMAT_BC2_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_BC2_SRGB_BLOCK, "VK_FORMAT_BC2_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_BC3_UNORM_BLOCK, "VK_FORMAT_BC3_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_BC3_SRGB_BLOCK, "VK_FORMAT_BC3_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_BC4_UNORM_BLOCK, "VK_FORMAT_BC4_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_R, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_BC4_SNORM_BLOCK, "VK_FORMAT_BC4_SNORM_BLOCK", Anvil::COMPONENT_LAYOUT_R, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM}, - {VK_FORMAT_BC5_UNORM_BLOCK, "VK_FORMAT_BC5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RG, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_BC5_SNORM_BLOCK, "VK_FORMAT_BC5_SNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RG, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM}, - {VK_FORMAT_BC6H_UFLOAT_BLOCK, "VK_FORMAT_BC6H_UFLOAT_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UFLOAT}, - {VK_FORMAT_BC6H_SFLOAT_BLOCK, "VK_FORMAT_BC6H_SFLOAT_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT}, - {VK_FORMAT_BC7_UNORM_BLOCK, "VK_FORMAT_BC7_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_BC7_SRGB_BLOCK, "VK_FORMAT_BC7_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, "VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK, "VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK, "VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK, "VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK, "VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK, "VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_EAC_R11_UNORM_BLOCK, "VK_FORMAT_EAC_R11_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_R, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_EAC_R11_SNORM_BLOCK, "VK_FORMAT_EAC_R11_SNORM_BLOCK", Anvil::COMPONENT_LAYOUT_R, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM}, - {VK_FORMAT_EAC_R11G11_UNORM_BLOCK, "VK_FORMAT_EAC_R11G11_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RG, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_EAC_R11G11_SNORM_BLOCK, "VK_FORMAT_EAC_R11G11_SNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RG, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM}, - {VK_FORMAT_ASTC_4x4_UNORM_BLOCK, "VK_FORMAT_ASTC_4x4_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_ASTC_4x4_SRGB_BLOCK, "VK_FORMAT_ASTC_4x4_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_ASTC_5x4_UNORM_BLOCK, "VK_FORMAT_ASTC_5x4_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_ASTC_5x4_SRGB_BLOCK, "VK_FORMAT_ASTC_5x4_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_ASTC_5x5_UNORM_BLOCK, "VK_FORMAT_ASTC_5x5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_ASTC_5x5_SRGB_BLOCK, "VK_FORMAT_ASTC_5x5_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_ASTC_6x5_UNORM_BLOCK, "VK_FORMAT_ASTC_6x5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_ASTC_6x5_SRGB_BLOCK, "VK_FORMAT_ASTC_6x5_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_ASTC_6x6_UNORM_BLOCK, "VK_FORMAT_ASTC_6x6_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_ASTC_6x6_SRGB_BLOCK, "VK_FORMAT_ASTC_6x6_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_ASTC_8x5_UNORM_BLOCK, "VK_FORMAT_ASTC_8x5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_ASTC_8x5_SRGB_BLOCK, "VK_FORMAT_ASTC_8x5_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_ASTC_8x6_UNORM_BLOCK, "VK_FORMAT_ASTC_8x6_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_ASTC_8x6_SRGB_BLOCK, "VK_FORMAT_ASTC_8x6_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_ASTC_8x8_UNORM_BLOCK, "VK_FORMAT_ASTC_8x8_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_ASTC_8x8_SRGB_BLOCK, "VK_FORMAT_ASTC_8x8_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_ASTC_10x5_UNORM_BLOCK, "VK_FORMAT_ASTC_10x5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_ASTC_10x5_SRGB_BLOCK, "VK_FORMAT_ASTC_10x5_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_ASTC_10x6_UNORM_BLOCK, "VK_FORMAT_ASTC_10x6_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_ASTC_10x6_SRGB_BLOCK, "VK_FORMAT_ASTC_10x6_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_ASTC_10x8_UNORM_BLOCK, "VK_FORMAT_ASTC_10x8_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_ASTC_10x8_SRGB_BLOCK, "VK_FORMAT_ASTC_10x8_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_ASTC_10x10_UNORM_BLOCK, "VK_FORMAT_ASTC_10x10_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_ASTC_10x10_SRGB_BLOCK, "VK_FORMAT_ASTC_10x10_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_ASTC_12x10_UNORM_BLOCK, "VK_FORMAT_ASTC_12x10_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_ASTC_12x10_SRGB_BLOCK, "VK_FORMAT_ASTC_12x10_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, - {VK_FORMAT_ASTC_12x12_UNORM_BLOCK, "VK_FORMAT_ASTC_12x12_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM}, - {VK_FORMAT_ASTC_12x12_SRGB_BLOCK, "VK_FORMAT_ASTC_12x12_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB}, + /* format | name | component_layout | component_bits[0] | component_bits[1] | component_bits[2] | component_bits[3] | format_type | is_packed? */ + {VK_FORMAT_UNDEFINED, "VK_FORMAT_UNDEFINED", Anvil::COMPONENT_LAYOUT_UNKNOWN, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNKNOWN, false}, + {VK_FORMAT_R4G4_UNORM_PACK8, "VK_FORMAT_R4G4_UNORM_PACK8", Anvil::COMPONENT_LAYOUT_RG, 4, 4, 0, 0, Anvil::FORMAT_TYPE_UNORM, true}, + {VK_FORMAT_R4G4B4A4_UNORM_PACK16, "VK_FORMAT_R4G4B4A4_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_RGBA, 4, 4, 4, 4, Anvil::FORMAT_TYPE_UNORM, true}, + {VK_FORMAT_B4G4R4A4_UNORM_PACK16, "VK_FORMAT_B4G4R4A4_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_BGRA, 4, 4, 4, 4, Anvil::FORMAT_TYPE_UNORM, true}, + {VK_FORMAT_R5G6B5_UNORM_PACK16, "VK_FORMAT_R5G6B5_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_RGB, 5, 6, 5, 0, Anvil::FORMAT_TYPE_UNORM, true}, + {VK_FORMAT_B5G6R5_UNORM_PACK16, "VK_FORMAT_B5G6R5_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_BGR, 5, 6, 5, 0, Anvil::FORMAT_TYPE_UNORM, true}, + {VK_FORMAT_R5G5B5A1_UNORM_PACK16, "VK_FORMAT_R5G5B5A1_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_RGBA, 5, 5, 5, 1, Anvil::FORMAT_TYPE_UNORM, true}, + {VK_FORMAT_B5G5R5A1_UNORM_PACK16, "VK_FORMAT_B5G5R5A1_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_BGRA, 5, 5, 5, 1, Anvil::FORMAT_TYPE_UNORM, true}, + {VK_FORMAT_A1R5G5B5_UNORM_PACK16, "VK_FORMAT_A1R5G5B5_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_ARGB, 1, 5, 5, 5, Anvil::FORMAT_TYPE_UNORM, true}, + {VK_FORMAT_R8_UNORM, "VK_FORMAT_R8_UNORM", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_R8_SNORM, "VK_FORMAT_R8_SNORM", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {VK_FORMAT_R8_USCALED, "VK_FORMAT_R8_USCALED", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_USCALED, false}, + {VK_FORMAT_R8_SSCALED, "VK_FORMAT_R8_SSCALED", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_SSCALED, false}, + {VK_FORMAT_R8_UINT, "VK_FORMAT_R8_UINT", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, + {VK_FORMAT_R8_SINT, "VK_FORMAT_R8_SINT", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, + {VK_FORMAT_R8_SRGB, "VK_FORMAT_R8_SRGB", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_R8G8_UNORM, "VK_FORMAT_R8G8_UNORM", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_R8G8_SNORM, "VK_FORMAT_R8G8_SNORM", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {VK_FORMAT_R8G8_USCALED, "VK_FORMAT_R8G8_USCALED", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_USCALED, false}, + {VK_FORMAT_R8G8_SSCALED, "VK_FORMAT_R8G8_SSCALED", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_SSCALED, false}, + {VK_FORMAT_R8G8_UINT, "VK_FORMAT_R8G8_UINT", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, + {VK_FORMAT_R8G8_SINT, "VK_FORMAT_R8G8_SINT", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, + {VK_FORMAT_R8G8_SRGB, "VK_FORMAT_R8G8_SRGB", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_R8G8B8_UNORM, "VK_FORMAT_R8G8B8_UNORM", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_R8G8B8_SNORM, "VK_FORMAT_R8G8B8_SNORM", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {VK_FORMAT_R8G8B8_USCALED, "VK_FORMAT_R8G8B8_USCALED", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_USCALED, false}, + {VK_FORMAT_R8G8B8_SSCALED, "VK_FORMAT_R8G8B8_SSCALED", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SSCALED, false}, + {VK_FORMAT_R8G8B8_UINT, "VK_FORMAT_R8G8B8_UINT", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_UINT, false}, + {VK_FORMAT_R8G8B8_SINT, "VK_FORMAT_R8G8B8_SINT", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SINT, false}, + {VK_FORMAT_R8G8B8_SRGB, "VK_FORMAT_R8G8B8_SRGB", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_B8G8R8_UNORM, "VK_FORMAT_B8G8R8_UNORM", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_B8G8R8_SNORM, "VK_FORMAT_B8G8R8_SNORM", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {VK_FORMAT_B8G8R8_USCALED, "VK_FORMAT_B8G8R8_USCALED", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_USCALED, false}, + {VK_FORMAT_B8G8R8_SSCALED, "VK_FORMAT_B8G8R8_SSCALED", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SSCALED, false}, + {VK_FORMAT_B8G8R8_UINT, "VK_FORMAT_B8G8R8_UINT", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_UINT, false}, + {VK_FORMAT_B8G8R8_SINT, "VK_FORMAT_B8G8R8_SINT", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SINT, false}, + {VK_FORMAT_B8G8R8_SRGB, "VK_FORMAT_B8G8R8_SRGB", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_R8G8B8A8_UNORM, "VK_FORMAT_R8G8B8A8_UNORM", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_R8G8B8A8_SNORM, "VK_FORMAT_R8G8B8A8_SNORM", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SNORM, false}, + {VK_FORMAT_R8G8B8A8_USCALED, "VK_FORMAT_R8G8B8A8_USCALED", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_USCALED, false}, + {VK_FORMAT_R8G8B8A8_SSCALED, "VK_FORMAT_R8G8B8A8_SSCALED", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SSCALED, false}, + {VK_FORMAT_R8G8B8A8_UINT, "VK_FORMAT_R8G8B8A8_UINT", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UINT, false}, + {VK_FORMAT_R8G8B8A8_SINT, "VK_FORMAT_R8G8B8A8_SINT", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SINT, false}, + {VK_FORMAT_R8G8B8A8_SRGB, "VK_FORMAT_R8G8B8A8_SRGB", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_B8G8R8A8_UNORM, "VK_FORMAT_B8G8R8A8_UNORM", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_B8G8R8A8_SNORM, "VK_FORMAT_B8G8R8A8_SNORM", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SNORM, false}, + {VK_FORMAT_B8G8R8A8_USCALED, "VK_FORMAT_B8G8R8A8_USCALED", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_USCALED, false}, + {VK_FORMAT_B8G8R8A8_SSCALED, "VK_FORMAT_B8G8R8A8_SSCALED", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SSCALED, false}, + {VK_FORMAT_B8G8R8A8_UINT, "VK_FORMAT_B8G8R8A8_UINT", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UINT, false}, + {VK_FORMAT_B8G8R8A8_SINT, "VK_FORMAT_B8G8R8A8_SINT", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SINT, false}, + {VK_FORMAT_B8G8R8A8_SRGB, "VK_FORMAT_B8G8R8A8_SRGB", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_A8B8G8R8_UNORM_PACK32, "VK_FORMAT_A8B8G8R8_UNORM_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UNORM, true}, + {VK_FORMAT_A8B8G8R8_SNORM_PACK32, "VK_FORMAT_A8B8G8R8_SNORM_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SNORM, true}, + {VK_FORMAT_A8B8G8R8_USCALED_PACK32, "VK_FORMAT_A8B8G8R8_USCALED_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_USCALED, true}, + {VK_FORMAT_A8B8G8R8_SSCALED_PACK32, "VK_FORMAT_A8B8G8R8_SSCALED_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SSCALED, true}, + {VK_FORMAT_A8B8G8R8_UINT_PACK32, "VK_FORMAT_A8B8G8R8_UINT_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UINT, true}, + {VK_FORMAT_A8B8G8R8_SINT_PACK32, "VK_FORMAT_A8B8G8R8_SINT_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SINT, true}, + {VK_FORMAT_A8B8G8R8_SRGB_PACK32, "VK_FORMAT_A8B8G8R8_SRGB_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SRGB, true}, + {VK_FORMAT_A2R10G10B10_UNORM_PACK32, "VK_FORMAT_A2R10G10B10_UNORM_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_UNORM, true}, + {VK_FORMAT_A2R10G10B10_SNORM_PACK32, "VK_FORMAT_A2R10G10B10_SNORM_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SNORM, true}, + {VK_FORMAT_A2R10G10B10_USCALED_PACK32, "VK_FORMAT_A2R10G10B10_USCALED_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_USCALED, true}, + {VK_FORMAT_A2R10G10B10_SSCALED_PACK32, "VK_FORMAT_A2R10G10B10_SSCALED_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SSCALED, true}, + {VK_FORMAT_A2R10G10B10_UINT_PACK32, "VK_FORMAT_A2R10G10B10_UINT_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_UINT, true}, + {VK_FORMAT_A2R10G10B10_SINT_PACK32, "VK_FORMAT_A2R10G10B10_SINT_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SINT, true}, + {VK_FORMAT_A2B10G10R10_UNORM_PACK32, "VK_FORMAT_A2B10G10R10_UNORM_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_UNORM, true}, + {VK_FORMAT_A2B10G10R10_SNORM_PACK32, "VK_FORMAT_A2B10G10R10_SNORM_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SNORM, true}, + {VK_FORMAT_A2B10G10R10_USCALED_PACK32, "VK_FORMAT_A2B10G10R10_USCALED_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_USCALED, true}, + {VK_FORMAT_A2B10G10R10_SSCALED_PACK32, "VK_FORMAT_A2B10G10R10_SSCALED_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SSCALED, true}, + {VK_FORMAT_A2B10G10R10_UINT_PACK32, "VK_FORMAT_A2B10G10R10_UINT_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_UINT, true}, + {VK_FORMAT_A2B10G10R10_SINT_PACK32, "VK_FORMAT_A2B10G10R10_SINT_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SINT, true}, + {VK_FORMAT_R16_UNORM, "VK_FORMAT_R16_UNORM", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_R16_SNORM, "VK_FORMAT_R16_SNORM", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {VK_FORMAT_R16_USCALED, "VK_FORMAT_R16_USCALED", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_USCALED, false}, + {VK_FORMAT_R16_SSCALED, "VK_FORMAT_R16_SSCALED", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_SSCALED, false}, + {VK_FORMAT_R16_UINT, "VK_FORMAT_R16_UINT", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, + {VK_FORMAT_R16_SINT, "VK_FORMAT_R16_SINT", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, + {VK_FORMAT_R16_SFLOAT, "VK_FORMAT_R16_SFLOAT", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {VK_FORMAT_R16G16_UNORM, "VK_FORMAT_R16G16_UNORM", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_R16G16_SNORM, "VK_FORMAT_R16G16_SNORM", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {VK_FORMAT_R16G16_USCALED, "VK_FORMAT_R16G16_USCALED", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_USCALED, false}, + {VK_FORMAT_R16G16_SSCALED, "VK_FORMAT_R16G16_SSCALED", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_SSCALED, false}, + {VK_FORMAT_R16G16_UINT, "VK_FORMAT_R16G16_UINT", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, + {VK_FORMAT_R16G16_SINT, "VK_FORMAT_R16G16_SINT", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, + {VK_FORMAT_R16G16_SFLOAT, "VK_FORMAT_R16G16_SFLOAT", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {VK_FORMAT_R16G16B16_UNORM, "VK_FORMAT_R16G16B16_UNORM", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_R16G16B16_SNORM, "VK_FORMAT_R16G16B16_SNORM", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {VK_FORMAT_R16G16B16_USCALED, "VK_FORMAT_R16G16B16_USCALED", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_USCALED, false}, + {VK_FORMAT_R16G16B16_SSCALED, "VK_FORMAT_R16G16B16_SSCALED", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_SSCALED, false}, + {VK_FORMAT_R16G16B16_UINT, "VK_FORMAT_R16G16B16_UINT", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_UINT, false}, + {VK_FORMAT_R16G16B16_SINT, "VK_FORMAT_R16G16B16_SINT", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_SINT, false}, + {VK_FORMAT_R16G16B16_SFLOAT, "VK_FORMAT_R16G16B16_SFLOAT", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {VK_FORMAT_R16G16B16A16_UNORM, "VK_FORMAT_R16G16B16A16_UNORM", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_R16G16B16A16_SNORM, "VK_FORMAT_R16G16B16A16_SNORM", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_SNORM, false}, + {VK_FORMAT_R16G16B16A16_USCALED, "VK_FORMAT_R16G16B16A16_USCALED", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_USCALED, false}, + {VK_FORMAT_R16G16B16A16_SSCALED, "VK_FORMAT_R16G16B16A16_SSCALED", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_SSCALED, false}, + {VK_FORMAT_R16G16B16A16_UINT, "VK_FORMAT_R16G16B16A16_UINT", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_UINT, false}, + {VK_FORMAT_R16G16B16A16_SINT, "VK_FORMAT_R16G16B16A16_SINT", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_SINT, false}, + {VK_FORMAT_R16G16B16A16_SFLOAT, "VK_FORMAT_R16G16B16A16_SFLOAT", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_SFLOAT, false}, + {VK_FORMAT_R32_UINT, "VK_FORMAT_R32_UINT", Anvil::COMPONENT_LAYOUT_R, 32, 0, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, + {VK_FORMAT_R32_SINT, "VK_FORMAT_R32_SINT", Anvil::COMPONENT_LAYOUT_R, 32, 0, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, + {VK_FORMAT_R32_SFLOAT, "VK_FORMAT_R32_SFLOAT", Anvil::COMPONENT_LAYOUT_R, 32, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {VK_FORMAT_R32G32_UINT, "VK_FORMAT_R32G32_UINT", Anvil::COMPONENT_LAYOUT_RG, 32, 32, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, + {VK_FORMAT_R32G32_SINT, "VK_FORMAT_R32G32_SINT", Anvil::COMPONENT_LAYOUT_RG, 32, 32, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, + {VK_FORMAT_R32G32_SFLOAT, "VK_FORMAT_R32G32_SFLOAT", Anvil::COMPONENT_LAYOUT_RG, 32, 32, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {VK_FORMAT_R32G32B32_UINT, "VK_FORMAT_R32G32B32_UINT", Anvil::COMPONENT_LAYOUT_RGB, 32, 32, 32, 0, Anvil::FORMAT_TYPE_UINT, false}, + {VK_FORMAT_R32G32B32_SINT, "VK_FORMAT_R32G32B32_SINT", Anvil::COMPONENT_LAYOUT_RGB, 32, 32, 32, 0, Anvil::FORMAT_TYPE_SINT, false}, + {VK_FORMAT_R32G32B32_SFLOAT, "VK_FORMAT_R32G32B32_SFLOAT", Anvil::COMPONENT_LAYOUT_RGB, 32, 32, 32, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {VK_FORMAT_R32G32B32A32_UINT, "VK_FORMAT_R32G32B32A32_UINT", Anvil::COMPONENT_LAYOUT_RGBA, 32, 32, 32, 32, Anvil::FORMAT_TYPE_UINT, false}, + {VK_FORMAT_R32G32B32A32_SINT, "VK_FORMAT_R32G32B32A32_SINT", Anvil::COMPONENT_LAYOUT_RGBA, 32, 32, 32, 32, Anvil::FORMAT_TYPE_SINT, false}, + {VK_FORMAT_R32G32B32A32_SFLOAT, "VK_FORMAT_R32G32B32A32_SFLOAT", Anvil::COMPONENT_LAYOUT_RGBA, 32, 32, 32, 32, Anvil::FORMAT_TYPE_SFLOAT, false}, + {VK_FORMAT_R64_UINT, "VK_FORMAT_R64_UINT", Anvil::COMPONENT_LAYOUT_R, 64, 0, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, + {VK_FORMAT_R64_SINT, "VK_FORMAT_R64_SINT", Anvil::COMPONENT_LAYOUT_R, 64, 0, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, + {VK_FORMAT_R64_SFLOAT, "VK_FORMAT_R64_SFLOAT", Anvil::COMPONENT_LAYOUT_R, 64, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {VK_FORMAT_R64G64_UINT, "VK_FORMAT_R64G64_UINT", Anvil::COMPONENT_LAYOUT_RG, 64, 64, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, + {VK_FORMAT_R64G64_SINT, "VK_FORMAT_R64G64_SINT", Anvil::COMPONENT_LAYOUT_RG, 64, 64, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, + {VK_FORMAT_R64G64_SFLOAT, "VK_FORMAT_R64G64_SFLOAT", Anvil::COMPONENT_LAYOUT_RG, 64, 64, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {VK_FORMAT_R64G64B64_UINT, "VK_FORMAT_R64G64B64_UINT", Anvil::COMPONENT_LAYOUT_RGB, 64, 64, 64, 0, Anvil::FORMAT_TYPE_UINT, false}, + {VK_FORMAT_R64G64B64_SINT, "VK_FORMAT_R64G64B64_SINT", Anvil::COMPONENT_LAYOUT_RGB, 64, 64, 64, 0, Anvil::FORMAT_TYPE_SINT, false}, + {VK_FORMAT_R64G64B64_SFLOAT, "VK_FORMAT_R64G64B64_SFLOAT", Anvil::COMPONENT_LAYOUT_RGB, 64, 64, 64, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {VK_FORMAT_R64G64B64A64_UINT, "VK_FORMAT_R64G64B64A64_UINT", Anvil::COMPONENT_LAYOUT_RGBA, 64, 64, 64, 64, Anvil::FORMAT_TYPE_UINT, false}, + {VK_FORMAT_R64G64B64A64_SINT, "VK_FORMAT_R64G64B64A64_SINT", Anvil::COMPONENT_LAYOUT_RGBA, 64, 64, 64, 64, Anvil::FORMAT_TYPE_SINT, false}, + {VK_FORMAT_R64G64B64A64_SFLOAT, "VK_FORMAT_R64G64B64A64_SFLOAT", Anvil::COMPONENT_LAYOUT_RGBA, 64, 64, 64, 64, Anvil::FORMAT_TYPE_SFLOAT, false}, + {VK_FORMAT_B10G11R11_UFLOAT_PACK32, "VK_FORMAT_B10G11R11_UFLOAT_PACK32", Anvil::COMPONENT_LAYOUT_BGR, 10, 11, 11, 0, Anvil::FORMAT_TYPE_UFLOAT, true}, + {VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, "VK_FORMAT_E5B9G9R9_UFLOAT_PACK32", Anvil::COMPONENT_LAYOUT_EBGR, 5, 9, 9, 9, Anvil::FORMAT_TYPE_UFLOAT, true}, + {VK_FORMAT_D16_UNORM, "VK_FORMAT_D16_UNORM", Anvil::COMPONENT_LAYOUT_D, 16, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_X8_D24_UNORM_PACK32, "VK_FORMAT_X8_D24_UNORM_PACK32", Anvil::COMPONENT_LAYOUT_XD, 8, 24, 0, 0, Anvil::FORMAT_TYPE_UNORM, true}, + {VK_FORMAT_D32_SFLOAT, "VK_FORMAT_D32_SFLOAT", Anvil::COMPONENT_LAYOUT_D, 32, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {VK_FORMAT_S8_UINT, "VK_FORMAT_S8_UINT", Anvil::COMPONENT_LAYOUT_S, 8, 0, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, + {VK_FORMAT_D16_UNORM_S8_UINT, "VK_FORMAT_D16_UNORM_S8_UINT", Anvil::COMPONENT_LAYOUT_DS, 16, 8, 0, 0, Anvil::FORMAT_TYPE_UNORM_UINT, false}, + {VK_FORMAT_D24_UNORM_S8_UINT, "VK_FORMAT_D24_UNORM_S8_UINT", Anvil::COMPONENT_LAYOUT_DS, 24, 8, 0, 0, Anvil::FORMAT_TYPE_UNORM_UINT, false}, + {VK_FORMAT_D32_SFLOAT_S8_UINT, "VK_FORMAT_D32_SFLOAT_S8_UINT", Anvil::COMPONENT_LAYOUT_DS, 32, 8, 0, 0, Anvil::FORMAT_TYPE_SFLOAT_UINT, false}, + {VK_FORMAT_BC1_RGB_UNORM_BLOCK, "VK_FORMAT_BC1_RGB_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_BC1_RGB_SRGB_BLOCK, "VK_FORMAT_BC1_RGB_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_BC1_RGBA_UNORM_BLOCK, "VK_FORMAT_BC1_RGBA_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_BC1_RGBA_SRGB_BLOCK, "VK_FORMAT_BC1_RGBA_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_BC2_UNORM_BLOCK, "VK_FORMAT_BC2_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_BC2_SRGB_BLOCK, "VK_FORMAT_BC2_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_BC3_UNORM_BLOCK, "VK_FORMAT_BC3_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_BC3_SRGB_BLOCK, "VK_FORMAT_BC3_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_BC4_UNORM_BLOCK, "VK_FORMAT_BC4_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_R, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_BC4_SNORM_BLOCK, "VK_FORMAT_BC4_SNORM_BLOCK", Anvil::COMPONENT_LAYOUT_R, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {VK_FORMAT_BC5_UNORM_BLOCK, "VK_FORMAT_BC5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RG, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_BC5_SNORM_BLOCK, "VK_FORMAT_BC5_SNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RG, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {VK_FORMAT_BC6H_UFLOAT_BLOCK, "VK_FORMAT_BC6H_UFLOAT_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UFLOAT, false}, + {VK_FORMAT_BC6H_SFLOAT_BLOCK, "VK_FORMAT_BC6H_SFLOAT_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {VK_FORMAT_BC7_UNORM_BLOCK, "VK_FORMAT_BC7_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_BC7_SRGB_BLOCK, "VK_FORMAT_BC7_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, "VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK, "VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK, "VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK, "VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK, "VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK, "VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_EAC_R11_UNORM_BLOCK, "VK_FORMAT_EAC_R11_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_R, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_EAC_R11_SNORM_BLOCK, "VK_FORMAT_EAC_R11_SNORM_BLOCK", Anvil::COMPONENT_LAYOUT_R, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {VK_FORMAT_EAC_R11G11_UNORM_BLOCK, "VK_FORMAT_EAC_R11G11_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RG, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_EAC_R11G11_SNORM_BLOCK, "VK_FORMAT_EAC_R11G11_SNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RG, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {VK_FORMAT_ASTC_4x4_UNORM_BLOCK, "VK_FORMAT_ASTC_4x4_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_ASTC_4x4_SRGB_BLOCK, "VK_FORMAT_ASTC_4x4_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_ASTC_5x4_UNORM_BLOCK, "VK_FORMAT_ASTC_5x4_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_ASTC_5x4_SRGB_BLOCK, "VK_FORMAT_ASTC_5x4_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_ASTC_5x5_UNORM_BLOCK, "VK_FORMAT_ASTC_5x5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_ASTC_5x5_SRGB_BLOCK, "VK_FORMAT_ASTC_5x5_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_ASTC_6x5_UNORM_BLOCK, "VK_FORMAT_ASTC_6x5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_ASTC_6x5_SRGB_BLOCK, "VK_FORMAT_ASTC_6x5_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_ASTC_6x6_UNORM_BLOCK, "VK_FORMAT_ASTC_6x6_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_ASTC_6x6_SRGB_BLOCK, "VK_FORMAT_ASTC_6x6_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_ASTC_8x5_UNORM_BLOCK, "VK_FORMAT_ASTC_8x5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_ASTC_8x5_SRGB_BLOCK, "VK_FORMAT_ASTC_8x5_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_ASTC_8x6_UNORM_BLOCK, "VK_FORMAT_ASTC_8x6_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_ASTC_8x6_SRGB_BLOCK, "VK_FORMAT_ASTC_8x6_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_ASTC_8x8_UNORM_BLOCK, "VK_FORMAT_ASTC_8x8_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_ASTC_8x8_SRGB_BLOCK, "VK_FORMAT_ASTC_8x8_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_ASTC_10x5_UNORM_BLOCK, "VK_FORMAT_ASTC_10x5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_ASTC_10x5_SRGB_BLOCK, "VK_FORMAT_ASTC_10x5_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_ASTC_10x6_UNORM_BLOCK, "VK_FORMAT_ASTC_10x6_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_ASTC_10x6_SRGB_BLOCK, "VK_FORMAT_ASTC_10x6_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_ASTC_10x8_UNORM_BLOCK, "VK_FORMAT_ASTC_10x8_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_ASTC_10x8_SRGB_BLOCK, "VK_FORMAT_ASTC_10x8_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_ASTC_10x10_UNORM_BLOCK, "VK_FORMAT_ASTC_10x10_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_ASTC_10x10_SRGB_BLOCK, "VK_FORMAT_ASTC_10x10_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_ASTC_12x10_UNORM_BLOCK, "VK_FORMAT_ASTC_12x10_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_ASTC_12x10_SRGB_BLOCK, "VK_FORMAT_ASTC_12x10_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {VK_FORMAT_ASTC_12x12_UNORM_BLOCK, "VK_FORMAT_ASTC_12x12_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {VK_FORMAT_ASTC_12x12_SRGB_BLOCK, "VK_FORMAT_ASTC_12x12_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false} }; +static const struct +{ + VkFormat format; + uint32_t red_component_start_bit_index; + uint32_t red_component_last_bit_index; + uint32_t green_component_start_bit_index; + uint32_t green_component_last_bit_index; + uint32_t blue_component_start_bit_index; + uint32_t blue_component_last_bit_index; + uint32_t alpha_component_start_bit_index; + uint32_t alpha_component_last_bit_index; + uint32_t shared_component_start_bit_index; + uint32_t shared_component_last_bit_index; + uint32_t depth_component_start_bit_index; + uint32_t depth_component_last_bit_index; + uint32_t stencil_component_start_bit_index; + uint32_t stencil_component_last_bit_index; +} g_format_bit_layout_info[] = +{ + /* format | red start | red end | green start | green end | blue start | blue end | alpha start | alpha end | shared_start | shared_end | depth start | depth end | stencil start | stencil end */ + {VK_FORMAT_UNDEFINED, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R4G4_UNORM_PACK8, 4, 7, 0, 3, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R4G4B4A4_UNORM_PACK16, 12, 15, 8, 11, 4, 7, 0, 3, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_B4G4R4A4_UNORM_PACK16, 4, 7, 8, 11, 12, 15, 0, 3, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R5G6B5_UNORM_PACK16, 11, 15, 5, 10, 0, 4, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_B5G6R5_UNORM_PACK16, 0, 4, 5, 10, 11, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R5G5B5A1_UNORM_PACK16, 11, 15, 6, 10, 1, 5, 0, 0, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_B5G5R5A1_UNORM_PACK16, 1, 5, 6, 10, 11, 15, 0, 0, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_A1R5G5B5_UNORM_PACK16, 10, 14, 5, 9, 0, 4, 15, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8_UNORM, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8_SNORM, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8_USCALED, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8_SSCALED, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8_UINT, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8_SINT, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8_SRGB, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8G8_UNORM, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8G8_SNORM, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8G8_USCALED, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8G8_SSCALED, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8G8_UINT, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8G8_SINT, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8G8_SRGB, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8G8B8_UNORM, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8G8B8_SNORM, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8G8B8_USCALED, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8G8B8_SSCALED, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8G8B8_UINT, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8G8B8_SINT, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8G8B8_SRGB, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_B8G8R8_UNORM, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_B8G8R8_SNORM, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_B8G8R8_USCALED, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_B8G8R8_SSCALED, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_B8G8R8_UINT, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_B8G8R8_SINT, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_B8G8R8_SRGB, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8G8B8A8_UNORM, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8G8B8A8_SNORM, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8G8B8A8_USCALED, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8G8B8A8_SSCALED, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8G8B8A8_UINT, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8G8B8A8_SINT, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R8G8B8A8_SRGB, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_B8G8R8A8_UNORM, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_B8G8R8A8_SNORM, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_B8G8R8A8_USCALED, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_B8G8R8A8_SSCALED, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_B8G8R8A8_UINT, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_B8G8R8A8_SINT, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_B8G8R8A8_SRGB, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_A8B8G8R8_UNORM_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_A8B8G8R8_SNORM_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_A8B8G8R8_USCALED_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_A8B8G8R8_SSCALED_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_A8B8G8R8_UINT_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_A8B8G8R8_SINT_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_A8B8G8R8_SRGB_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_A2R10G10B10_UNORM_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_A2R10G10B10_SNORM_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_A2R10G10B10_USCALED_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_A2R10G10B10_SSCALED_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_A2R10G10B10_UINT_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_A2R10G10B10_SINT_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_A2B10G10R10_UNORM_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_A2B10G10R10_SNORM_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_A2B10G10R10_USCALED_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_A2B10G10R10_SSCALED_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_A2B10G10R10_UINT_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_A2B10G10R10_SINT_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16_UNORM, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16_SNORM, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16_USCALED, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16_SSCALED, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16_UINT, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16_SINT, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16_SFLOAT, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16G16_UNORM, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16G16_SNORM, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16G16_USCALED, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16G16_SSCALED, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16G16_UINT, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16G16_SINT, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16G16_SFLOAT, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16G16B16_UNORM, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16G16B16_SNORM, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16G16B16_USCALED, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16G16B16_SSCALED, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16G16B16_UINT, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16G16B16_SINT, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16G16B16_SFLOAT, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16G16B16A16_UNORM, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16G16B16A16_SNORM, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16G16B16A16_USCALED, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16G16B16A16_SSCALED, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16G16B16A16_UINT, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16G16B16A16_SINT, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R16G16B16A16_SFLOAT, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R32_UINT, 0, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R32_SINT, 0, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R32_SFLOAT, 0, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R32G32_UINT, 0, 31, 32, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R32G32_SINT, 0, 31, 32, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R32G32_SFLOAT, 0, 31, 32, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R32G32B32_UINT, 0, 31, 32, 63, 64, 95, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R32G32B32_SINT, 0, 31, 32, 63, 64, 95, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R32G32B32_SFLOAT, 0, 31, 32, 63, 64, 95, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R32G32B32A32_UINT, 0, 31, 32, 63, 64, 95, 96, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R32G32B32A32_SINT, 0, 31, 32, 63, 64, 95, 96, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R32G32B32A32_SFLOAT, 0, 31, 32, 63, 64, 95, 96, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R64_UINT, 0, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R64_SINT, 0, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R64_SFLOAT, 0, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R64G64_UINT, 0, 63, 64, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R64G64_SINT, 0, 63, 64, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R64G64_SFLOAT, 0, 63, 64, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R64G64B64_UINT, 0, 63, 64, 127, 128, 191, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R64G64B64_SINT, 0, 63, 64, 127, 128, 191, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R64G64B64_SFLOAT, 0, 63, 64, 127, 128, 191, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R64G64B64A64_UINT, 0, 63, 64, 127, 128, 191, 192, 255, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R64G64B64A64_SINT, 0, 63, 64, 127, 128, 191, 192, 255, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_R64G64B64A64_SFLOAT, 0, 63, 64, 127, 128, 191, 192, 255, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_B10G11R11_UFLOAT_PACK32, 0, 10, 11, 21, 22, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, 0, 8, 9, 17, 18, 26, UINT32_MAX, UINT32_MAX, 27, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_D16_UNORM, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 15, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_X8_D24_UNORM_PACK32, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 23, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_D32_SFLOAT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 31, UINT32_MAX, UINT32_MAX}, + {VK_FORMAT_S8_UINT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 7}, + {VK_FORMAT_D16_UNORM_S8_UINT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 15, 16, 23}, + {VK_FORMAT_D24_UNORM_S8_UINT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 23, 24, 31}, + {VK_FORMAT_D32_SFLOAT_S8_UINT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 31, 32, 39}, +}; static uint32_t layout_to_n_components[] = { /* COMPONENT_LAYOUT_ABGR */ @@ -462,14 +615,14 @@ VkFormat Anvil::Formats::get_format(ComponentLayout in_component_layout, uint32_t in_n_component2_bits, uint32_t in_n_component3_bits) { - static const uint32_t n_available_formats = sizeof(formats) / sizeof(formats[0]); + static const uint32_t n_available_formats = sizeof(g_formats) / sizeof(g_formats[0]); VkFormat result = VK_FORMAT_UNDEFINED; for (uint32_t n_format = 0; n_format < n_available_formats; ++n_format) { - const FormatInfo& current_format_info = formats[n_format]; + const FormatInfo& current_format_info = g_formats[n_format]; if (current_format_info.component_layout == in_component_layout && current_format_info.format_type == in_format_type && @@ -530,16 +683,107 @@ bool Anvil::Formats::get_format_aspects(VkFormat in_form return result; } +/** Please see header for specification */ +void Anvil::Formats::get_format_bit_layout(VkFormat in_format, + uint32_t* out_opt_red_component_start_bit_index_ptr, + uint32_t* out_opt_red_component_end_bit_index_ptr, + uint32_t* out_opt_green_component_start_bit_index_ptr, + uint32_t* out_opt_green_component_end_bit_index_ptr, + uint32_t* out_opt_blue_component_start_bit_index_ptr, + uint32_t* out_opt_blue_component_end_bit_index_ptr, + uint32_t* out_opt_alpha_component_start_bit_index_ptr, + uint32_t* out_opt_alpha_component_end_bit_index_ptr, + uint32_t* out_opt_shared_component_start_bit_index_ptr, + uint32_t* out_opt_shared_component_end_bit_index_ptr, + uint32_t* out_opt_depth_component_start_bit_index_ptr, + uint32_t* out_opt_depth_component_end_bit_index_ptr, + uint32_t* out_opt_stencil_component_start_bit_index_ptr, + uint32_t* out_opt_stencil_component_end_bit_index_ptr) +{ + anvil_assert(sizeof(g_format_bit_layout_info) / sizeof(g_format_bit_layout_info[0]) > in_format); + anvil_assert(g_format_bit_layout_info[in_format].format == in_format); + + const auto& format_info = g_format_bit_layout_info[in_format]; + + if (out_opt_red_component_start_bit_index_ptr != nullptr) + { + *out_opt_red_component_start_bit_index_ptr = format_info.red_component_start_bit_index; + } + + if (out_opt_red_component_end_bit_index_ptr != nullptr) + { + *out_opt_red_component_end_bit_index_ptr = format_info.red_component_last_bit_index; + } + + if (out_opt_green_component_start_bit_index_ptr != nullptr) + { + *out_opt_green_component_start_bit_index_ptr = format_info.green_component_start_bit_index; + } + + if (out_opt_green_component_end_bit_index_ptr != nullptr) + { + *out_opt_green_component_end_bit_index_ptr = format_info.green_component_last_bit_index; + } + + if (out_opt_blue_component_start_bit_index_ptr != nullptr) + { + *out_opt_blue_component_start_bit_index_ptr = format_info.blue_component_start_bit_index; + } + + if (out_opt_blue_component_end_bit_index_ptr != nullptr) + { + *out_opt_blue_component_end_bit_index_ptr = format_info.blue_component_last_bit_index; + } + + if (out_opt_alpha_component_start_bit_index_ptr != nullptr) + { + *out_opt_alpha_component_start_bit_index_ptr = format_info.alpha_component_start_bit_index; + } + + if (out_opt_alpha_component_end_bit_index_ptr != nullptr) + { + *out_opt_alpha_component_end_bit_index_ptr = format_info.alpha_component_last_bit_index; + } + + if (out_opt_shared_component_start_bit_index_ptr != nullptr) + { + *out_opt_shared_component_start_bit_index_ptr = format_info.shared_component_start_bit_index; + } + + if (out_opt_shared_component_end_bit_index_ptr != nullptr) + { + *out_opt_shared_component_end_bit_index_ptr = format_info.shared_component_last_bit_index; + } + if (out_opt_depth_component_start_bit_index_ptr != nullptr) + { + *out_opt_depth_component_start_bit_index_ptr = format_info.depth_component_start_bit_index; + } + + if (out_opt_depth_component_end_bit_index_ptr != nullptr) + { + *out_opt_depth_component_end_bit_index_ptr = format_info.depth_component_last_bit_index; + } + + if (out_opt_stencil_component_start_bit_index_ptr != nullptr) + { + *out_opt_stencil_component_start_bit_index_ptr = format_info.stencil_component_start_bit_index; + } + + if (out_opt_stencil_component_end_bit_index_ptr != nullptr) + { + *out_opt_stencil_component_end_bit_index_ptr = format_info.stencil_component_last_bit_index; + } +} /** Please see header for specification */ Anvil::ComponentLayout Anvil::Formats::get_format_component_layout(VkFormat in_format) { - static_assert(sizeof(formats) / sizeof(formats[0]) == VK_FORMAT_RANGE_SIZE, ""); + static_assert(sizeof(g_formats) / sizeof(g_formats[0]) == VK_FORMAT_RANGE_SIZE, ""); anvil_assert(in_format < VK_FORMAT_RANGE_SIZE); - return formats[in_format].component_layout; + return g_formats[in_format].component_layout; } /** Please see header for specification */ @@ -547,7 +791,7 @@ uint32_t Anvil::Formats::get_format_n_components(VkFormat in_format) { anvil_assert(in_format < VK_FORMAT_RANGE_SIZE); - return layout_to_n_components[formats[in_format].component_layout]; + return layout_to_n_components[g_formats[in_format].component_layout]; } /** Please see header for specification */ @@ -557,11 +801,11 @@ void Anvil::Formats::get_format_n_component_bits(VkFormat in_format, uint32_t* out_channel2_bits_ptr, uint32_t* out_channel3_bits_ptr) { - FormatInfo* format_props_ptr = nullptr; + const FormatInfo* format_props_ptr = nullptr; anvil_assert(in_format < VK_FORMAT_RANGE_SIZE); - format_props_ptr = formats + in_format; + format_props_ptr = g_formats + in_format; *out_channel0_bits_ptr = format_props_ptr->component_bits[0]; *out_channel1_bits_ptr = format_props_ptr->component_bits[1]; @@ -574,7 +818,7 @@ const char* Anvil::Formats::get_format_name(VkFormat in_format) { anvil_assert(in_format < VK_FORMAT_RANGE_SIZE); - return formats[in_format].name; + return g_formats[in_format].name; } /** Please see header for specification */ @@ -582,22 +826,22 @@ Anvil::FormatType Anvil::Formats::get_format_type(VkFormat in_format) { anvil_assert(in_format < VK_FORMAT_RANGE_SIZE); - return formats[in_format].format_type; + return g_formats[in_format].format_type; } /** Please see header for specification */ bool Anvil::Formats::has_depth_aspect(VkFormat in_format) { - return (formats[in_format].component_layout == Anvil::COMPONENT_LAYOUT_D) || - (formats[in_format].component_layout == Anvil::COMPONENT_LAYOUT_DS) || - (formats[in_format].component_layout == Anvil::COMPONENT_LAYOUT_XD); + return (g_formats[in_format].component_layout == Anvil::COMPONENT_LAYOUT_D) || + (g_formats[in_format].component_layout == Anvil::COMPONENT_LAYOUT_DS) || + (g_formats[in_format].component_layout == Anvil::COMPONENT_LAYOUT_XD); } /** Please see header for specification */ bool Anvil::Formats::has_stencil_aspect(VkFormat in_format) { - return (formats[in_format].component_layout == Anvil::COMPONENT_LAYOUT_S) || - (formats[in_format].component_layout == Anvil::COMPONENT_LAYOUT_DS); + return (g_formats[in_format].component_layout == Anvil::COMPONENT_LAYOUT_S) || + (g_formats[in_format].component_layout == Anvil::COMPONENT_LAYOUT_DS); } /** Please see header for specification */ @@ -605,8 +849,16 @@ bool Anvil::Formats::is_format_compressed(VkFormat in_format) { anvil_assert(in_format < VK_FORMAT_RANGE_SIZE); - return (formats[in_format].component_bits[0] == formats[in_format].component_bits[1]) && - (formats[in_format].component_bits[1] == formats[in_format].component_bits[2]) && - (formats[in_format].component_bits[2] == formats[in_format].component_bits[3]) && - (formats[in_format].component_bits[0] == 0); + return (g_formats[in_format].component_bits[0] == g_formats[in_format].component_bits[1]) && + (g_formats[in_format].component_bits[1] == g_formats[in_format].component_bits[2]) && + (g_formats[in_format].component_bits[2] == g_formats[in_format].component_bits[3]) && + (g_formats[in_format].component_bits[0] == 0); +} + +/** Please see header for specification */ +bool Anvil::Formats::is_format_packed(VkFormat in_format) +{ + anvil_assert(in_format < VK_FORMAT_RANGE_SIZE); + + return g_formats[in_format].is_packed; } diff --git a/src/misc/graphics_pipeline_create_info.cpp b/src/misc/graphics_pipeline_create_info.cpp index 221f5d46..e23819dc 100644 --- a/src/misc/graphics_pipeline_create_info.cpp +++ b/src/misc/graphics_pipeline_create_info.cpp @@ -87,7 +87,8 @@ bool Anvil::GraphicsPipelineCreateInfo::add_vertex_attribute(uint32_t uint32_t in_offset_in_bytes, uint32_t in_stride_in_bytes, VkVertexInputRate in_step_rate, - uint32_t in_explicit_binding_index) + uint32_t in_explicit_binding_index, + uint32_t in_divisor) { bool result = false; @@ -126,6 +127,7 @@ bool Anvil::GraphicsPipelineCreateInfo::add_vertex_attribute(uint32_t * time. */ m_attributes.push_back( InternalVertexAttribute( + in_divisor, in_explicit_binding_index, in_format, in_location, @@ -744,7 +746,8 @@ bool Anvil::GraphicsPipelineCreateInfo::get_vertex_attribute_properties(uint32_t uint32_t* out_opt_offset_ptr, uint32_t* out_opt_explicit_vertex_binding_index_ptr, uint32_t* out_opt_stride_ptr, - VkVertexInputRate* out_opt_rate_ptr) const + VkVertexInputRate* out_opt_rate_ptr, + uint32_t* out_opt_divisor_ptr) const { const InternalVertexAttribute* attribute_ptr = nullptr; bool result = false; @@ -788,6 +791,11 @@ bool Anvil::GraphicsPipelineCreateInfo::get_vertex_attribute_properties(uint32_t *out_opt_rate_ptr = attribute_ptr->rate; } + if (out_opt_divisor_ptr != nullptr) + { + *out_opt_divisor_ptr = attribute_ptr->divisor; + } + /* All done */ result = true; end: diff --git a/src/misc/image_create_info.cpp b/src/misc/image_create_info.cpp index de2fff54..2ce8f1e4 100644 --- a/src/misc/image_create_info.cpp +++ b/src/misc/image_create_info.cpp @@ -63,8 +63,8 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_no_allo in_post_alloc_image_layout, in_opt_mipmaps_ptr, Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, - 0, /* in_external_memory_handle_types */ - 0, /* in_memory_features */ + 0, /* in_exportable_external_memory_handle_types */ + 0, /* in_memory_features */ Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED) ); @@ -112,7 +112,7 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_alloc(c in_post_alloc_image_layout, in_opt_mipmaps_ptr, Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, - 0, /* in_external_memory_handle_types */ + 0, /* in_exportable_external_memory_handle_types */ in_memory_features, Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED) ); @@ -230,33 +230,33 @@ Anvil::ImageCreateInfo::ImageCreateInfo(Anvil::ImageType in_t const VkImageLayout& in_post_alloc_image_layout, const std::vector* in_opt_mipmaps_ptr, const Anvil::MTSafety& in_mt_safety, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types, + Anvil::ExternalMemoryHandleTypeBits in_exportable_external_memory_handle_types, const Anvil::MemoryFeatureFlags& in_memory_features, const Anvil::SparseResidencyScope& in_residency_scope) - :m_create_flags (in_create_flags), - m_depth (in_base_mipmap_depth), - m_device_ptr (in_device_ptr), - m_external_memory_handle_types(in_external_memory_handle_types), - m_format (in_format), - m_height (in_base_mipmap_height), - m_memory_features (in_memory_features), - m_mipmaps_to_upload ((in_opt_mipmaps_ptr != nullptr) ? *in_opt_mipmaps_ptr : std::vector() ), - m_mt_safety (in_mt_safety), - m_n_layers (in_n_layers), - m_n_swapchain_image (UINT32_MAX), - m_post_alloc_layout (in_post_alloc_image_layout), - m_post_create_layout (in_post_create_image_layout), - m_queue_families (in_queue_families), - m_residency_scope (in_residency_scope), - m_sample_count (in_sample_count), - m_sharing_mode (in_sharing_mode), - m_swapchain_ptr (nullptr), - m_tiling (in_tiling), - m_type (in_type), - m_type_vk (in_type_vk), - m_usage_flags (static_cast(in_usage)), - m_use_full_mipmap_chain (in_use_full_mipmap_chain), - m_width (in_base_mipmap_width) + :m_create_flags (in_create_flags), + m_depth (in_base_mipmap_depth), + m_device_ptr (in_device_ptr), + m_exportable_external_memory_handle_types(in_exportable_external_memory_handle_types), + m_format (in_format), + m_height (in_base_mipmap_height), + m_memory_features (in_memory_features), + m_mipmaps_to_upload ((in_opt_mipmaps_ptr != nullptr) ? *in_opt_mipmaps_ptr : std::vector() ), + m_mt_safety (in_mt_safety), + m_n_layers (in_n_layers), + m_n_swapchain_image (UINT32_MAX), + m_post_alloc_layout (in_post_alloc_image_layout), + m_post_create_layout (in_post_create_image_layout), + m_queue_families (in_queue_families), + m_residency_scope (in_residency_scope), + m_sample_count (in_sample_count), + m_sharing_mode (in_sharing_mode), + m_swapchain_ptr (nullptr), + m_tiling (in_tiling), + m_type (in_type), + m_type_vk (in_type_vk), + m_usage_flags (static_cast(in_usage)), + m_use_full_mipmap_chain (in_use_full_mipmap_chain), + m_width (in_base_mipmap_width) { /* Stub */ } diff --git a/src/misc/memalloc_backends/backend_oneshot.cpp b/src/misc/memalloc_backends/backend_oneshot.cpp index c43f23de..dae5cb98 100644 --- a/src/misc/memalloc_backends/backend_oneshot.cpp +++ b/src/misc/memalloc_backends/backend_oneshot.cpp @@ -60,16 +60,38 @@ Anvil::MemoryAllocatorBackends::OneShot::~OneShot() **/ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items& in_items) { - const auto& memory_props (m_device_ptr->get_physical_device_memory_properties() ); - const uint32_t n_memory_types (static_cast(memory_props.types.size() )); - std::vector > per_mem_type_items_vector (n_memory_types); - bool result (true); + typedef struct DedicatedAllocationInfo + { + Anvil::MemoryAllocator::Item* item_ptr; + uint32_t n_memory_type; + + DedicatedAllocationInfo(Anvil::MemoryAllocator::Item* in_item_ptr, + const uint32_t& in_n_memory_type) + :item_ptr (in_item_ptr), + n_memory_type(in_n_memory_type) + { + /* Stub */ + } + } DedicatedAllocationInfo; + + std::vector dedicated_allocs; + const auto& memory_props (m_device_ptr->get_physical_device_memory_properties() ); + const uint32_t n_memory_types (static_cast(memory_props.types.size() )); + std::vector > per_mem_type_items_vector(n_memory_types); + bool result (true); /* Iterate over all block items and determine what memory types we can use. * * In certain cases, we may need to suballocate from more than one memory block, * due to the fact not all memory heaps may support features requested at * creation time. + * + * Dedicated allocations need to get their own memory blocks, too. + * + * Allocations which can be exported via external handles are tricky. Drivers do NOT need to request such allocations to be + * dedicated. However, each exportable memory allocation comes with a set of parameters (NT handle details, as an example) + * which make merging memory blocks tricky. Hence, for exportable allocs, just put each such alloc in its own memory block. + * */ for (auto item_iterator = in_items.begin(); item_iterator != in_items.end(); @@ -93,11 +115,92 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items continue; } - per_mem_type_items_vector.at(n_memory_type).push_back((item_iterator->get() ) ); + if ((*item_iterator)->alloc_is_dedicated_memory || + (*item_iterator)->alloc_exportable_external_handle_types != 0) + { + dedicated_allocs.push_back( + DedicatedAllocationInfo(item_iterator->get(), + n_memory_type) + ); + } + else + { + per_mem_type_items_vector.at(n_memory_type).push_back((item_iterator->get() ) ); + } + break; } } + /* For each dedicated allocation, create one and associate it with the parent object. */ + for (const auto& current_dedicated_alloc : dedicated_allocs) + { + Anvil::MemoryBlockUniquePtr new_memory_block_ptr_derived(nullptr, + std::default_delete() ); + Anvil::MemoryBlockUniquePtr new_memory_block_ptr_regular(nullptr, + std::default_delete() ); + + /* Bake the block and stash it */ + { + auto create_info_ptr = Anvil::MemoryBlockCreateInfo::create_regular(m_device_ptr, + 1u << current_dedicated_alloc.n_memory_type, + current_dedicated_alloc.item_ptr->alloc_size, + (memory_props.types[current_dedicated_alloc.n_memory_type].features) ); + + create_info_ptr->set_mt_safety(Anvil::Utils::convert_boolean_to_mt_safety_enum(m_device_ptr->is_mt_safe()) ); + + if (current_dedicated_alloc.item_ptr->alloc_is_dedicated_memory) + { + create_info_ptr->use_dedicated_allocation(current_dedicated_alloc.item_ptr->buffer_ptr, + current_dedicated_alloc.item_ptr->image_ptr); + } + + if (current_dedicated_alloc.item_ptr->alloc_exportable_external_handle_types != 0) + { + create_info_ptr->set_exportable_external_memory_handle_types(current_dedicated_alloc.item_ptr->alloc_exportable_external_handle_types); + } + + #if defined(_WIN32) + { + if (current_dedicated_alloc.item_ptr->alloc_external_nt_handle_info_ptr != nullptr) + { + create_info_ptr->set_exportable_nt_handle_info(current_dedicated_alloc.item_ptr->alloc_external_nt_handle_info_ptr->attributes_ptr, + current_dedicated_alloc.item_ptr->alloc_external_nt_handle_info_ptr->access, + current_dedicated_alloc.item_ptr->alloc_external_nt_handle_info_ptr->name); + } + } + #endif + + new_memory_block_ptr_regular = Anvil::MemoryBlock::create(std::move(create_info_ptr) ); + } + + if (new_memory_block_ptr_regular == nullptr) + { + anvil_assert(new_memory_block_ptr_regular != nullptr); + + result = false; + continue; + } + + { + auto create_info_ptr = Anvil::MemoryBlockCreateInfo::create_derived(new_memory_block_ptr_regular.get(), + 0, /* in_start_offset */ + current_dedicated_alloc.item_ptr->alloc_size); + + new_memory_block_ptr_derived = Anvil::MemoryBlock::create(std::move(create_info_ptr) ); + + current_dedicated_alloc.item_ptr->alloc_memory_block_ptr = std::move(new_memory_block_ptr_regular); + current_dedicated_alloc.item_ptr->is_baked = (current_dedicated_alloc.item_ptr->alloc_memory_block_ptr != nullptr); + } + + dynamic_cast(current_dedicated_alloc.item_ptr->alloc_memory_block_ptr.get() )->set_parent_memory_allocator_backend_ptr(shared_from_this(), + reinterpret_cast(new_memory_block_ptr_derived->get_memory() )); + + m_memory_blocks.push_back( + std::move(new_memory_block_ptr_derived) + ); + } + /* For each memory type, for each there's at least one item, bake a memory block */ { std::map alloc_offset_map; @@ -119,6 +222,9 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items * to need to alloc off the heap */ for (auto& current_item_ptr : current_item_vector) { + anvil_assert(current_item_ptr->alloc_exportable_external_handle_types == 0); + anvil_assert(current_item_ptr->alloc_external_nt_handle_info_ptr == nullptr); + n_bytes_required = Anvil::Utils::round_up(n_bytes_required, current_item_ptr->alloc_memory_required_alignment); @@ -207,9 +313,9 @@ bool Anvil::MemoryAllocatorBackends::OneShot::supports_baking() const return !m_is_baked; } -bool Anvil::MemoryAllocatorBackends::OneShot::supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) const +bool Anvil::MemoryAllocatorBackends::OneShot::supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeBits&) const { - return (in_external_memory_handle_types == 0); + return true; } void Anvil::MemoryAllocatorBackends::OneShot::unmap(void* in_memory_object) diff --git a/src/misc/memalloc_backends/backend_vma.cpp b/src/misc/memalloc_backends/backend_vma.cpp index 53fccd42..f1427559 100644 --- a/src/misc/memalloc_backends/backend_vma.cpp +++ b/src/misc/memalloc_backends/backend_vma.cpp @@ -96,8 +96,9 @@ std::shared_ptr Anvil::Memory **/ bool Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::init() { - VmaAllocatorCreateInfo create_info = {}; - VkResult result (VK_ERROR_DEVICE_LOST); + VmaAllocatorCreateInfo create_info = {}; + const bool khr_dedicated_allocation_supported = m_device_ptr->get_extension_info()->khr_dedicated_allocation(); + VkResult result = VK_ERROR_DEVICE_LOST; switch (m_device_ptr->get_type() ) { @@ -115,6 +116,7 @@ bool Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::init() } } + create_info.flags = (khr_dedicated_allocation_supported) ? VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT : 0; create_info.device = m_device_ptr->get_device_vk(); create_info.pAllocationCallbacks = nullptr; create_info.preferredLargeHeapBlockSize = 0; @@ -167,6 +169,7 @@ bool Anvil::MemoryAllocatorBackends::VMA::bake(Anvil::MemoryAllocator::Items& in VmaAllocation allocation = VK_NULL_HANDLE; VmaAllocationCreateInfo allocation_create_info = {}; VmaAllocationInfo allocation_info = {}; + bool is_dedicated_alloc = false; VkMemoryRequirements memory_requirements_vk; Anvil::OnMemoryBlockReleaseCallbackFunction release_callback_function; VkMemoryHeapFlags required_mem_heap_flags = 0; @@ -183,6 +186,8 @@ bool Anvil::MemoryAllocatorBackends::VMA::bake(Anvil::MemoryAllocator::Items& in memory_requirements_vk.memoryTypeBits = current_item_ptr->alloc_memory_supported_memory_types; memory_requirements_vk.size = current_item_ptr->alloc_size; + allocation_create_info.flags = (current_item_ptr->alloc_is_dedicated_memory) ? VmaAllocationCreateFlagBits::VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT + : 0; allocation_create_info.requiredFlags = required_mem_property_flags; result_vk = vmaAllocateMemory(m_vma_allocator_ptr->get_handle(), @@ -197,6 +202,10 @@ bool Anvil::MemoryAllocatorBackends::VMA::bake(Anvil::MemoryAllocator::Items& in continue; } + else + { + is_dedicated_alloc = (allocation->GetType() == VmaAllocation_T::ALLOCATION_TYPE_DEDICATED); + } /* Bake the block and stash it */ release_callback_function = std::bind( @@ -216,6 +225,28 @@ bool Anvil::MemoryAllocatorBackends::VMA::bake(Anvil::MemoryAllocator::Items& in allocation_info.offset, release_callback_function); + if (is_dedicated_alloc) + { + if (current_item_ptr->type == Anvil::MemoryAllocator::ITEM_TYPE_BUFFER || + current_item_ptr->type == Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_BUFFER_REGION) + { + anvil_assert(current_item_ptr->buffer_ptr != nullptr); + + create_info_ptr->use_dedicated_allocation(current_item_ptr->buffer_ptr, + nullptr); /* in_opt_image_ptr */ + } + else + if (current_item_ptr->type == Anvil::MemoryAllocator::ITEM_TYPE_IMAGE_WHOLE || + current_item_ptr->type == Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_IMAGE_MIPTAIL || + current_item_ptr->type == Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_IMAGE_SUBRESOURCE) + { + anvil_assert(current_item_ptr->image_ptr != nullptr); + + create_info_ptr->use_dedicated_allocation(nullptr, /* in_opt_buffer_ptr */ + current_item_ptr->image_ptr); + } + } + new_memory_block_ptr = Anvil::MemoryBlock::create(std::move(create_info_ptr) ); } diff --git a/src/misc/memory_allocator.cpp b/src/misc/memory_allocator.cpp index f45cb5e2..0730a4d2 100644 --- a/src/misc/memory_allocator.cpp +++ b/src/misc/memory_allocator.cpp @@ -35,160 +35,205 @@ #include "wrappers/queue.h" /* Please see header for specification */ -Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - Anvil::ExternalMemoryHandleTypeBits in_alloc_external_memory_handle_types) +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +#if defined(_WIN32) + const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, +#endif + const bool& in_alloc_is_dedicated) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); - alloc_external_memory_handle_types = in_alloc_external_memory_handle_types; - alloc_memory_final_type = UINT32_MAX; - alloc_memory_required_alignment = in_alloc_alignment; - alloc_memory_required_features = in_alloc_required_memory_features; - alloc_memory_supported_memory_types = in_alloc_supported_memory_types; - alloc_memory_types = in_alloc_memory_types; - alloc_size = in_alloc_size; - buffer_ptr = in_buffer_ptr; - image_ptr = nullptr; - is_baked = false; - memory_allocator_ptr = in_memory_allocator_ptr; - type = ITEM_TYPE_BUFFER; +#if defined(_WIN32) + alloc_external_nt_handle_info_ptr = in_alloc_external_nt_handle_info_ptr; +#endif + + alloc_exportable_external_handle_types = in_opt_exportable_external_handle_types; + alloc_is_dedicated_memory = in_alloc_is_dedicated; + alloc_memory_final_type = UINT32_MAX; + alloc_memory_required_alignment = in_alloc_alignment; + alloc_memory_required_features = in_alloc_required_memory_features; + alloc_memory_supported_memory_types = in_alloc_supported_memory_types; + alloc_memory_types = in_alloc_memory_types; + alloc_size = in_alloc_size; + buffer_ptr = in_buffer_ptr; + image_ptr = nullptr; + is_baked = false; + memory_allocator_ptr = in_memory_allocator_ptr; + type = ITEM_TYPE_BUFFER; register_for_callbacks(); } -Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_alloc_offset, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - Anvil::ExternalMemoryHandleTypeBits in_alloc_external_memory_handle_types) +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_alloc_offset, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +#if defined(_WIN32) + const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, +#endif + const bool& in_alloc_is_dedicated) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); - alloc_external_memory_handle_types = in_alloc_external_memory_handle_types; - alloc_memory_final_type = UINT32_MAX; - alloc_memory_required_alignment = in_alloc_alignment; - alloc_memory_required_features = in_alloc_required_memory_features; - alloc_memory_supported_memory_types = in_alloc_supported_memory_types; - alloc_memory_types = in_alloc_memory_types; - alloc_offset = in_alloc_offset; - alloc_size = in_alloc_size; - buffer_ptr = in_buffer_ptr; - image_ptr = nullptr; - is_baked = false; - memory_allocator_ptr = in_memory_allocator_ptr; - type = ITEM_TYPE_SPARSE_BUFFER_REGION; +#if defined(_WIN32) + alloc_external_nt_handle_info_ptr = in_alloc_external_nt_handle_info_ptr; +#endif + + alloc_exportable_external_handle_types = in_opt_exportable_external_handle_types; + alloc_is_dedicated_memory = in_alloc_is_dedicated; + alloc_memory_final_type = UINT32_MAX; + alloc_memory_required_alignment = in_alloc_alignment; + alloc_memory_required_features = in_alloc_required_memory_features; + alloc_memory_supported_memory_types = in_alloc_supported_memory_types; + alloc_memory_types = in_alloc_memory_types; + alloc_offset = in_alloc_offset; + alloc_size = in_alloc_size; + buffer_ptr = in_buffer_ptr; + image_ptr = nullptr; + is_baked = false; + memory_allocator_ptr = in_memory_allocator_ptr; + type = ITEM_TYPE_SPARSE_BUFFER_REGION; register_for_callbacks(); } /* Please see header for specification */ -Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - uint32_t in_n_layer, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_miptail_offset, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - Anvil::ExternalMemoryHandleTypeBits in_alloc_external_memory_handle_types) +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_layer, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_miptail_offset, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +#if defined(_WIN32) + const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, +#endif + const bool& in_alloc_is_dedicated) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); - alloc_external_memory_handle_types = in_alloc_external_memory_handle_types; - alloc_memory_final_type = UINT32_MAX; - alloc_memory_required_alignment = in_alloc_alignment; - alloc_memory_required_features = in_alloc_required_memory_features; - alloc_memory_supported_memory_types = in_alloc_supported_memory_types; - alloc_memory_types = in_alloc_memory_types; - alloc_offset = UINT64_MAX; - alloc_size = in_alloc_size; - buffer_ptr = nullptr; - image_ptr = in_image_ptr; - is_baked = false; - memory_allocator_ptr = in_memory_allocator_ptr; - miptail_offset = in_miptail_offset; - n_layer = in_n_layer; - type = ITEM_TYPE_SPARSE_IMAGE_MIPTAIL; +#if defined(_WIN32) + alloc_external_nt_handle_info_ptr = in_alloc_external_nt_handle_info_ptr; +#endif + + alloc_exportable_external_handle_types = in_opt_exportable_external_handle_types; + alloc_is_dedicated_memory = in_alloc_is_dedicated; + alloc_memory_final_type = UINT32_MAX; + alloc_memory_required_alignment = in_alloc_alignment; + alloc_memory_required_features = in_alloc_required_memory_features; + alloc_memory_supported_memory_types = in_alloc_supported_memory_types; + alloc_memory_types = in_alloc_memory_types; + alloc_offset = UINT64_MAX; + alloc_size = in_alloc_size; + buffer_ptr = nullptr; + image_ptr = in_image_ptr; + is_baked = false; + memory_allocator_ptr = in_memory_allocator_ptr; + miptail_offset = in_miptail_offset; + n_layer = in_n_layer; + type = ITEM_TYPE_SPARSE_IMAGE_MIPTAIL; register_for_callbacks(); } /* Please see header for specification */ -Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - const VkExtent3D& in_extent, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - Anvil::ExternalMemoryHandleTypeBits in_alloc_external_memory_handle_types) +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + const VkExtent3D& in_extent, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +#if defined(_WIN32) + const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, +#endif + const bool& in_alloc_is_dedicated) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); - alloc_external_memory_handle_types = in_alloc_external_memory_handle_types; - alloc_memory_final_type = UINT32_MAX; - alloc_memory_types = in_alloc_memory_types; - alloc_memory_required_alignment = in_alloc_alignment; - alloc_memory_required_features = in_alloc_required_memory_features; - alloc_memory_supported_memory_types = in_alloc_supported_memory_types; - alloc_offset = UINT64_MAX; - alloc_size = in_alloc_size; - buffer_ptr = nullptr; - extent = in_extent; - image_ptr = in_image_ptr; - is_baked = false; - memory_allocator_ptr = in_memory_allocator_ptr; - offset = in_offset; - subresource = in_subresource; - type = ITEM_TYPE_SPARSE_IMAGE_SUBRESOURCE; +#if defined(_WIN32) + alloc_external_nt_handle_info_ptr = in_alloc_external_nt_handle_info_ptr; +#endif + + alloc_exportable_external_handle_types = in_opt_exportable_external_handle_types; + alloc_is_dedicated_memory = in_alloc_is_dedicated; + alloc_memory_final_type = UINT32_MAX; + alloc_memory_types = in_alloc_memory_types; + alloc_memory_required_alignment = in_alloc_alignment; + alloc_memory_required_features = in_alloc_required_memory_features; + alloc_memory_supported_memory_types = in_alloc_supported_memory_types; + alloc_offset = UINT64_MAX; + alloc_size = in_alloc_size; + buffer_ptr = nullptr; + extent = in_extent; + image_ptr = in_image_ptr; + is_baked = false; + memory_allocator_ptr = in_memory_allocator_ptr; + offset = in_offset; + subresource = in_subresource; + type = ITEM_TYPE_SPARSE_IMAGE_SUBRESOURCE; register_for_callbacks(); } /* Please see header for specification */ -Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - Anvil::ExternalMemoryHandleTypeBits in_alloc_external_memory_handle_types) +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +#if defined(_WIN32) + const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, +#endif + const bool& in_alloc_is_dedicated) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); - alloc_external_memory_handle_types = in_alloc_external_memory_handle_types; - alloc_memory_final_type = UINT32_MAX; - alloc_memory_required_alignment = in_alloc_alignment; - alloc_memory_required_features = in_alloc_required_memory_features; - alloc_memory_supported_memory_types = in_alloc_supported_memory_types; - alloc_memory_types = in_alloc_memory_types; - alloc_offset = UINT64_MAX; - alloc_size = in_alloc_size; - buffer_ptr = nullptr; - image_ptr = in_image_ptr; - is_baked = false; - memory_allocator_ptr = in_memory_allocator_ptr; - type = ITEM_TYPE_IMAGE_WHOLE; +#if defined(_WIN32) + alloc_external_nt_handle_info_ptr = in_alloc_external_nt_handle_info_ptr; +#endif + + alloc_exportable_external_handle_types = in_opt_exportable_external_handle_types; + alloc_is_dedicated_memory = in_alloc_is_dedicated; + alloc_memory_final_type = UINT32_MAX; + alloc_memory_required_alignment = in_alloc_alignment; + alloc_memory_required_features = in_alloc_required_memory_features; + alloc_memory_supported_memory_types = in_alloc_supported_memory_types; + alloc_memory_types = in_alloc_memory_types; + alloc_offset = UINT64_MAX; + alloc_size = in_alloc_size; + buffer_ptr = nullptr; + image_ptr = in_image_ptr; + is_baked = false; + memory_allocator_ptr = in_memory_allocator_ptr; + type = ITEM_TYPE_IMAGE_WHOLE; register_for_callbacks(); } @@ -354,9 +399,13 @@ Anvil::MemoryAllocator::~MemoryAllocator() /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* in_buffer_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* in_buffer_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types +#if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr +#endif + ) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -370,7 +419,11 @@ bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* in_b return add_buffer_internal(in_buffer_ptr, in_required_memory_features, - in_external_memory_handle_types); + in_opt_exportable_external_handle_types +#if defined(_WIN32) + ,in_opt_external_nt_handle_info_ptr +#endif + ); } /** Determines the amount of memory, supported memory type and required alignment for the specified @@ -378,18 +431,22 @@ bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* in_b * * @param buffer_ptr Buffer instance to assign a memory block at baking time. **/ -bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* in_buffer_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* in_buffer_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types +#if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr +#endif + ) { - IMemoryAllocatorBackend* backend_interface_ptr = dynamic_cast(m_backend_ptr.get() ); - VkDeviceSize buffer_alignment = 0; - uint32_t buffer_memory_types = 0; - VkDeviceSize buffer_storage_size = 0; - uint32_t filtered_memory_types = 0; - const VkMemoryRequirements memory_reqs = in_buffer_ptr->get_memory_requirements(); + IMemoryAllocatorBackend* backend_interface_ptr = dynamic_cast(m_backend_ptr.get() ); + VkDeviceSize buffer_alignment = 0; + uint32_t buffer_memory_types = 0; + VkDeviceSize buffer_storage_size = 0; + uint32_t filtered_memory_types = 0; + const VkMemoryRequirements memory_reqs = in_buffer_ptr->get_memory_requirements(); std::unique_ptr new_item_ptr; - bool result = true; + bool result = true; ANVIL_REDUNDANT_VARIABLE(backend_interface_ptr); @@ -398,12 +455,7 @@ bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* anvil_assert(in_buffer_ptr != nullptr); /* Extract external memory handle types from the specified buffer, if none were specified. */ - if (in_external_memory_handle_types == 0) - { - in_external_memory_handle_types = in_buffer_ptr->get_create_info_ptr()->get_external_memory_handle_types(); - } - - if (!do_external_memory_handle_type_sanity_checks(in_external_memory_handle_types) ) + if (!do_external_memory_handle_type_sanity_checks(in_buffer_ptr->get_create_info_ptr()->get_exportable_external_memory_handle_types() ) ) { result = false; @@ -434,7 +486,11 @@ bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* buffer_alignment, in_required_memory_features, filtered_memory_types, - in_external_memory_handle_types) + in_opt_exportable_external_handle_types, +#if defined(_WIN32) + in_opt_external_nt_handle_info_ptr, +#endif + in_buffer_ptr->requires_dedicated_allocation() ) ); m_items.push_back( @@ -450,10 +506,14 @@ bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - std::unique_ptr in_data_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr in_data_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types +#if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr +#endif + ) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -468,7 +528,11 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvi result = add_buffer_internal(in_buffer_ptr, in_required_memory_features, - in_external_memory_handle_types); + in_opt_exportable_external_handle_types +#if defined(_WIN32) + ,in_opt_external_nt_handle_info_ptr +#endif + ); if (result) { @@ -479,10 +543,14 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvi } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - std::unique_ptr > in_data_vector_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr > in_data_vector_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types +#if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr +#endif + ) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -499,7 +567,11 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi result = add_buffer_internal(in_buffer_ptr, in_required_memory_features, - in_external_memory_handle_types); + in_opt_exportable_external_handle_types +#if defined(_WIN32) + ,in_opt_external_nt_handle_info_ptr +#endif + ); if (result) { @@ -510,10 +582,14 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - const std::vector* in_data_vector_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + const std::vector* in_data_vector_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types +#if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr +#endif + ) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -535,7 +611,11 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi result = add_buffer_internal(in_buffer_ptr, in_required_memory_features, - in_external_memory_handle_types); + in_opt_exportable_external_handle_types +#if defined(_WIN32) + ,in_opt_external_nt_handle_info_ptr +#endif + ); if (result) { @@ -546,10 +626,14 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - std::unique_ptr in_data_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr in_data_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types +#if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr +#endif + ) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -564,7 +648,11 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anv result = add_buffer_internal(in_buffer_ptr, in_required_memory_features, - in_external_memory_handle_types); + in_opt_exportable_external_handle_types +#if defined(_WIN32) + ,in_opt_external_nt_handle_info_ptr +#endif + ); if (result) { @@ -578,7 +666,11 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anv bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types +#if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr +#endif + ) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -595,7 +687,11 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_vector_ptr_based_post_f result = add_buffer_internal(in_buffer_ptr, in_required_memory_features, - in_external_memory_handle_types); + in_opt_exportable_external_handle_types +#if defined(_WIN32) + ,in_opt_external_nt_handle_info_ptr +#endif + ); if (result) { @@ -606,10 +702,14 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_vector_ptr_based_post_f } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - std::unique_ptr in_data_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr in_data_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types +#if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr +#endif + ) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -624,7 +724,11 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anv result = add_buffer_internal(in_buffer_ptr, in_required_memory_features, - in_external_memory_handle_types); + in_opt_exportable_external_handle_types +#if defined(_WIN32) + ,in_opt_external_nt_handle_info_ptr +#endif + ); if (result) { @@ -635,10 +739,14 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anv } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - std::unique_ptr > in_data_vector_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr > in_data_vector_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types +#if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr +#endif + ) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -655,7 +763,11 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f result = add_buffer_internal(in_buffer_ptr, in_required_memory_features, - in_external_memory_handle_types); + in_opt_exportable_external_handle_types +#if defined(_WIN32) + ,in_opt_external_nt_handle_info_ptr +#endif + ); if (result) { @@ -666,10 +778,14 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f } /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - const std::vector* in_data_vector_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + const std::vector* in_data_vector_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types +#if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr +#endif + ) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -691,7 +807,11 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f result = add_buffer_internal(in_buffer_ptr, in_required_memory_features, - in_external_memory_handle_types); + in_opt_exportable_external_handle_types +#if defined(_WIN32) + ,in_opt_external_nt_handle_info_ptr +#endif + ); if (result) { @@ -702,9 +822,14 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f } /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* in_image_ptr, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* in_image_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types + +#if defined(_WIN32) + ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr +#endif + ) { uint32_t filtered_memory_types = 0; VkDeviceSize image_alignment = 0; @@ -726,13 +851,7 @@ bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* anvil_assert(m_backend_ptr->supports_baking() ); anvil_assert(in_image_ptr != nullptr); - /* Extract external memory handle types from the specified image, if none were specified. */ - if (in_external_memory_handle_types == 0) - { - in_external_memory_handle_types = in_image_ptr->get_create_info_ptr()->get_external_memory_handle_types(); - } - - if (!do_external_memory_handle_type_sanity_checks(in_external_memory_handle_types) ) + if (!do_external_memory_handle_type_sanity_checks(in_image_ptr->get_create_info_ptr()->get_external_memory_handle_types()) ) { result = false; @@ -763,7 +882,11 @@ bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* image_alignment, in_required_memory_features, filtered_memory_types, - in_external_memory_handle_types) + in_opt_exportable_external_handle_types, +#if defined(_WIN32) + in_opt_external_nt_handle_info_ptr, +#endif + in_image_ptr->requires_dedicated_allocation() ) ); m_items.push_back( @@ -776,11 +899,10 @@ bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* } /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_offset, - VkDeviceSize in_size, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkDeviceSize in_size, + MemoryFeatureFlags in_required_memory_features) { uint32_t filtered_memory_types = 0; const auto& memory_reqs = in_buffer_ptr->get_memory_requirements(); @@ -802,13 +924,7 @@ bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* ); } - /* Extract external memory handle types from the specified buffer, if none were specified. */ - if (in_external_memory_handle_types == 0) - { - in_external_memory_handle_types = in_buffer_ptr->get_create_info_ptr()->get_external_memory_handle_types(); - } - - if (!do_external_memory_handle_type_sanity_checks(in_external_memory_handle_types) ) + if (!do_external_memory_handle_type_sanity_checks(in_buffer_ptr->get_create_info_ptr()->get_exportable_external_memory_handle_types() ) ) { result = false; @@ -838,7 +954,11 @@ bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* memory_reqs.alignment, in_required_memory_features, filtered_memory_types, - in_external_memory_handle_types) + 0, /* in_opt_exportable_external_handle_types */ +#if defined(_WIN32) + nullptr, /* in_alloc_external_nt_handle_info_ptr */ +#endif + in_buffer_ptr->requires_dedicated_allocation() ) ); m_items.push_back( @@ -854,11 +974,10 @@ bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* } /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* in_image_ptr, - VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* in_image_ptr, + VkImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + MemoryFeatureFlags in_required_memory_features) { const Anvil::SparseImageAspectProperties* aspect_props_ptr = nullptr; uint32_t filtered_memory_types = 0; @@ -886,13 +1005,7 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* ); } - /* Extract external memory handle types from the specified image, if none were specified. */ - if (in_external_memory_handle_types == 0) - { - in_external_memory_handle_types = in_image_ptr->get_create_info_ptr()->get_external_memory_handle_types(); - } - - if (!do_external_memory_handle_type_sanity_checks(in_external_memory_handle_types) ) + if (!do_external_memory_handle_type_sanity_checks(in_image_ptr->get_create_info_ptr()->get_external_memory_handle_types()) ) { result = false; @@ -936,7 +1049,11 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* in_image_ptr->get_image_alignment(), in_required_memory_features, filtered_memory_types, - in_external_memory_handle_types) + 0, /* in_opt_exportable_external_handle_types */ +#if defined(_WIN32) + nullptr, /* in_alloc_external_nt_handle_info_ptr */ +#endif + false) /* in_alloc_is_dedicated - sparse images do not supported dedicated allocs */ ); m_items.push_back( @@ -950,12 +1067,11 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - VkExtent3D in_extent, - MemoryFeatureFlags in_required_memory_features, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) +bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + VkExtent3D in_extent, + MemoryFeatureFlags in_required_memory_features) { const Anvil::SparseImageAspectProperties* aspect_props_ptr = nullptr; uint32_t component_size_bits[4] = {0}; @@ -992,13 +1108,7 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* ); } - /* Extract external memory handle types from the specified image, if none were specified. */ - if (in_external_memory_handle_types == 0) - { - in_external_memory_handle_types = in_image_ptr->get_create_info_ptr()->get_external_memory_handle_types(); - } - - if (!do_external_memory_handle_type_sanity_checks(in_external_memory_handle_types) ) + if (!do_external_memory_handle_type_sanity_checks(in_image_ptr->get_create_info_ptr()->get_external_memory_handle_types() ) ) { result = false; @@ -1136,7 +1246,11 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* tile_size, in_required_memory_features, filtered_memory_types, - in_external_memory_handle_types) + 0, /* in_opt_exportable_external_handle_types */ +#if defined(_WIN32) + nullptr, /* in_alloc_external_nt_handle_info_ptr */ +#endif + false) /* in_alloc_is_dedicated - sparse images do not supported dedicated allocs */ ); m_items.push_back( @@ -1260,15 +1374,54 @@ bool Anvil::MemoryAllocator::bake() { if (item_ptr->buffer_ptr->get_create_info_ptr()->get_type() != Anvil::BufferType::SPARSE_NO_ALLOC) { - item_ptr->buffer_ptr->set_nonsparse_memory( - std::move(item_ptr->alloc_memory_block_ptr) - ); + if (m_post_bake_per_buffer_item_mem_assignment_callback_function != nullptr) + { + m_post_bake_per_buffer_item_mem_assignment_callback_function(item_ptr->buffer_ptr, + std::move(item_ptr->alloc_memory_block_ptr) ); + } + else + { + item_ptr->buffer_ptr->set_nonsparse_memory( + std::move(item_ptr->alloc_memory_block_ptr) + ); + } + } + else + { + if (m_post_bake_per_buffer_item_mem_assignment_callback_function != nullptr) + { + /* TODO: Sparse support */ + anvil_assert_fail(); + } + else + { + sparse_memory_binding.append_buffer_memory_update(sparse_memory_bind_info_id, + item_ptr->buffer_ptr, + 0, /* buffer_memory_start_offset */ + item_ptr->alloc_memory_block_ptr.release(), + 0, /* opt_memory_block_start_offset */ + true, /* in_opt_memory_block_owned_by_buffer */ + item_ptr->alloc_size); + } + } + + break; + } + + case Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_BUFFER_REGION: + { + anvil_assert(item_ptr->buffer_ptr->get_create_info_ptr()->get_type() == Anvil::BufferType::SPARSE_NO_ALLOC); + + if (m_post_bake_per_buffer_item_mem_assignment_callback_function != nullptr) + { + /* TODO: Sparse support */ + anvil_assert_fail(); } else { sparse_memory_binding.append_buffer_memory_update(sparse_memory_bind_info_id, item_ptr->buffer_ptr, - 0, /* buffer_memory_start_offset */ + item_ptr->alloc_offset, item_ptr->alloc_memory_block_ptr.release(), 0, /* opt_memory_block_start_offset */ true, /* in_opt_memory_block_owned_by_buffer */ @@ -1278,34 +1431,58 @@ bool Anvil::MemoryAllocator::bake() break; } - case Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_BUFFER_REGION: + case Anvil::MemoryAllocator::ITEM_TYPE_IMAGE_WHOLE: { - anvil_assert(item_ptr->buffer_ptr->get_create_info_ptr()->get_type() == Anvil::BufferType::SPARSE_NO_ALLOC); - - sparse_memory_binding.append_buffer_memory_update(sparse_memory_bind_info_id, - item_ptr->buffer_ptr, - item_ptr->alloc_offset, - item_ptr->alloc_memory_block_ptr.release(), - 0, /* opt_memory_block_start_offset */ - true, /* in_opt_memory_block_owned_by_buffer */ - item_ptr->alloc_size); + if (item_ptr->image_ptr->get_create_info_ptr()->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED) + { + if (m_post_bake_per_image_item_mem_assignment_callback_function != nullptr) + { + m_post_bake_per_image_item_mem_assignment_callback_function(item_ptr->image_ptr, + std::move(item_ptr->alloc_memory_block_ptr) + ); + } + else + { + item_ptr->image_ptr->set_memory( + std::move(item_ptr->alloc_memory_block_ptr) + ); + } + } + else + { + if (m_post_bake_per_image_item_mem_assignment_callback_function != nullptr) + { + /* TODO: Sparse support */ + anvil_assert_fail(); + } + else + { + sparse_memory_binding.append_opaque_image_memory_update(sparse_memory_bind_info_id, + item_ptr->image_ptr, + 0, /* resource_offset */ + item_ptr->alloc_size, + 0, /* flags */ + item_ptr->alloc_memory_block_ptr.release(), + 0, /* opt_memory_block_start_offset */ + true); /* in_opt_memory_block_owned_by_image */ + } + } break; } - case Anvil::MemoryAllocator::ITEM_TYPE_IMAGE_WHOLE: + case Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_IMAGE_MIPTAIL: { - if (item_ptr->image_ptr->get_create_info_ptr()->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED) + if (m_post_bake_per_image_item_mem_assignment_callback_function != nullptr) { - item_ptr->image_ptr->set_memory( - std::move(item_ptr->alloc_memory_block_ptr) - ); + /* TODO: Sparse support */ + anvil_assert_fail(); } else { sparse_memory_binding.append_opaque_image_memory_update(sparse_memory_bind_info_id, item_ptr->image_ptr, - 0, /* resource_offset */ + item_ptr->miptail_offset, item_ptr->alloc_size, 0, /* flags */ item_ptr->alloc_memory_block_ptr.release(), @@ -1316,31 +1493,25 @@ bool Anvil::MemoryAllocator::bake() break; } - case Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_IMAGE_MIPTAIL: - { - sparse_memory_binding.append_opaque_image_memory_update(sparse_memory_bind_info_id, - item_ptr->image_ptr, - item_ptr->miptail_offset, - item_ptr->alloc_size, - 0, /* flags */ - item_ptr->alloc_memory_block_ptr.release(), - 0, /* opt_memory_block_start_offset */ - true); /* in_opt_memory_block_owned_by_image */ - - break; - } - case Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_IMAGE_SUBRESOURCE: { - sparse_memory_binding.append_image_memory_update(sparse_memory_bind_info_id, - item_ptr->image_ptr, - item_ptr->subresource, - item_ptr->offset, - item_ptr->extent, - 0, /* flags */ - item_ptr->alloc_memory_block_ptr.release(), - 0, /* opt_memory_block_start_offset */ - true); /* in_opt_memory_block_owned_by_image */ + if (m_post_bake_per_image_item_mem_assignment_callback_function != nullptr) + { + /* TODO: Sparse support */ + anvil_assert_fail(); + } + else + { + sparse_memory_binding.append_image_memory_update(sparse_memory_bind_info_id, + item_ptr->image_ptr, + item_ptr->subresource, + item_ptr->offset, + item_ptr->extent, + 0, /* flags */ + item_ptr->alloc_memory_block_ptr.release(), + 0, /* opt_memory_block_start_offset */ + true); /* in_opt_memory_block_owned_by_image */ + } break; } @@ -1353,20 +1524,23 @@ bool Anvil::MemoryAllocator::bake() } } - /* If memory backing is needed for one or more sparse resources, bind these now */ - if (sparse_memory_bind_info_id != UINT32_MAX) + if (m_post_bake_per_buffer_item_mem_assignment_callback_function == nullptr) { - Anvil::Queue* sparse_queue_ptr(m_device_ptr->get_sparse_binding_queue(0) ); + /* If memory backing is needed for one or more sparse resources, bind these now */ + if (sparse_memory_bind_info_id != UINT32_MAX) + { + Anvil::Queue* sparse_queue_ptr(m_device_ptr->get_sparse_binding_queue(0) ); - result = sparse_queue_ptr->bind_sparse_memory(sparse_memory_binding); - anvil_assert(result); + result = sparse_queue_ptr->bind_sparse_memory(sparse_memory_binding); + anvil_assert(result); - /* Block until the sparse memory bindings are in place */ - vkWaitForFences(m_device_ptr->get_device_vk(), - 1, /* fenceCount */ - sparse_memory_binding.get_fence()->get_fence_ptr(), - VK_FALSE, /* waitAll */ - UINT64_MAX); + /* Block until the sparse memory bindings are in place */ + vkWaitForFences(m_device_ptr->get_device_vk(), + 1, /* fenceCount */ + sparse_memory_binding.get_fence()->get_fence_ptr(), + VK_FALSE, /* waitAll */ + UINT64_MAX); + } } /* If the user does not keep the memory allocator around and all items are assigned memory backing, @@ -1410,62 +1584,65 @@ bool Anvil::MemoryAllocator::bake() } /* Perform post-alloc fill actions */ - for (const auto& current_item_ptr : m_items) + if (m_post_bake_per_buffer_item_mem_assignment_callback_function == nullptr) { - VkDeviceSize buffer_size = 0; - - if (current_item_ptr->type != Anvil::MemoryAllocator::ITEM_TYPE_BUFFER) + for (const auto& current_item_ptr : m_items) { - continue; - } + VkDeviceSize buffer_size = 0; - if (!current_item_ptr->is_baked) - { - continue; - } + if (current_item_ptr->type != Anvil::MemoryAllocator::ITEM_TYPE_BUFFER) + { + continue; + } - buffer_size = current_item_ptr->buffer_ptr->get_create_info_ptr()->get_size(); + if (!current_item_ptr->is_baked) + { + continue; + } - if (current_item_ptr->buffer_ref_float_data_ptr != nullptr) - { - current_item_ptr->buffer_ptr->write(0, /* start_offset */ - buffer_size, - current_item_ptr->buffer_ref_float_data_ptr.get() ); - } - else - if (current_item_ptr->buffer_ref_float_vector_data_ptr != nullptr) - { - current_item_ptr->buffer_ptr->write(0, /* start_offset */ - buffer_size, - &(*current_item_ptr->buffer_ref_float_vector_data_ptr)[0]); - } - else - if (current_item_ptr->buffer_ref_uchar8_data_ptr != nullptr) - { - current_item_ptr->buffer_ptr->write(0, /* start_offset */ - buffer_size, - current_item_ptr->buffer_ref_uchar8_data_ptr.get() ); - } - else - if (current_item_ptr->buffer_ref_uchar8_vector_data_ptr != nullptr) - { - current_item_ptr->buffer_ptr->write(0, /* start_offset */ - buffer_size, - &(*current_item_ptr->buffer_ref_uchar8_vector_data_ptr)[0]); - } - else - if (current_item_ptr->buffer_ref_uint32_data_ptr != nullptr) - { - current_item_ptr->buffer_ptr->write(0, /* start_offset */ - buffer_size, - current_item_ptr->buffer_ref_uint32_data_ptr.get() ); - } - else - if (current_item_ptr->buffer_ref_uint32_vector_data_ptr != nullptr) - { - current_item_ptr->buffer_ptr->write(0, /* start_offset */ - buffer_size, - &(*current_item_ptr->buffer_ref_uint32_vector_data_ptr)[0]); + buffer_size = current_item_ptr->buffer_ptr->get_create_info_ptr()->get_size(); + + if (current_item_ptr->buffer_ref_float_data_ptr != nullptr) + { + current_item_ptr->buffer_ptr->write(0, /* start_offset */ + buffer_size, + current_item_ptr->buffer_ref_float_data_ptr.get() ); + } + else + if (current_item_ptr->buffer_ref_float_vector_data_ptr != nullptr) + { + current_item_ptr->buffer_ptr->write(0, /* start_offset */ + buffer_size, + &(*current_item_ptr->buffer_ref_float_vector_data_ptr)[0]); + } + else + if (current_item_ptr->buffer_ref_uchar8_data_ptr != nullptr) + { + current_item_ptr->buffer_ptr->write(0, /* start_offset */ + buffer_size, + current_item_ptr->buffer_ref_uchar8_data_ptr.get() ); + } + else + if (current_item_ptr->buffer_ref_uchar8_vector_data_ptr != nullptr) + { + current_item_ptr->buffer_ptr->write(0, /* start_offset */ + buffer_size, + &(*current_item_ptr->buffer_ref_uchar8_vector_data_ptr)[0]); + } + else + if (current_item_ptr->buffer_ref_uint32_data_ptr != nullptr) + { + current_item_ptr->buffer_ptr->write(0, /* start_offset */ + buffer_size, + current_item_ptr->buffer_ref_uint32_data_ptr.get() ); + } + else + if (current_item_ptr->buffer_ref_uint32_vector_data_ptr != nullptr) + { + current_item_ptr->buffer_ptr->write(0, /* start_offset */ + buffer_size, + &(*current_item_ptr->buffer_ref_uint32_vector_data_ptr)[0]); + } } } diff --git a/src/misc/memory_block_create_info.cpp b/src/misc/memory_block_create_info.cpp index 60f4be5a..d2d72d45 100644 --- a/src/misc/memory_block_create_info.cpp +++ b/src/misc/memory_block_create_info.cpp @@ -126,12 +126,14 @@ Anvil::MemoryBlockCreateInfo::MemoryBlockCreateInfo(const Anvil::MemoryBlockType const VkDeviceSize& in_size, const VkDeviceSize& in_start_offset) :m_allowed_memory_bits (in_allowed_memory_bits), + m_dedicated_allocation_buffer_ptr (nullptr), + m_dedicated_allocation_image_ptr (nullptr), m_device_ptr (in_device_ptr), m_exportable_external_memory_handle_types (Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE), - m_external_handle_import_info_specified (false), #ifdef _WIN32 - m_external_nt_handle_import_info_specified(false), + m_exportable_nt_handle_info_specified (false), #endif + m_external_handle_import_info_specified (false), m_imported_external_memory_handle_type (Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE), m_memory (in_memory), m_memory_features (in_memory_features), @@ -141,7 +143,8 @@ Anvil::MemoryBlockCreateInfo::MemoryBlockCreateInfo(const Anvil::MemoryBlockType m_parent_memory_block_ptr (in_parent_memory_block_ptr), m_size (in_size), m_start_offset (in_start_offset), - m_type (in_type) + m_type (in_type), + m_use_dedicated_allocation (false) { if (in_n_physical_devices != 0) { diff --git a/src/misc/page_tracker.cpp b/src/misc/page_tracker.cpp index 3687af65..0d23473e 100644 --- a/src/misc/page_tracker.cpp +++ b/src/misc/page_tracker.cpp @@ -75,12 +75,12 @@ bool Anvil::PageTracker::set_binding(MemoryBlock* in_memory_block_ptr, VkDeviceSize in_start_offset, VkDeviceSize in_size) { - const auto end_offset_page_aligned = Anvil::Utils::round_up(in_start_offset + in_size, - m_page_size); - uint32_t n_pages; - uint32_t occupancy_item_start_index; - uint32_t occupancy_vec_start_index; - bool result = false; + const auto end_offset_page_aligned = Anvil::Utils::round_up(in_start_offset + in_size, + m_page_size); + uint32_t n_pages; + uint32_t occupancy_item_start_index; + const uint32_t pages_per_vec_item = 32; + bool result = false; /* Sanity checks */ if (in_start_offset + in_size > m_region_size) @@ -107,10 +107,6 @@ bool Anvil::PageTracker::set_binding(MemoryBlock* in_memory_block_ptr, } /* Store the memory block binding */ - n_pages = static_cast(in_size / m_page_size); - occupancy_item_start_index = static_cast(in_start_offset % m_page_size); - occupancy_vec_start_index = static_cast(in_start_offset / m_page_size / 32 /* pages in a single vec item */); - for (auto mem_binding_iterator = m_memory_blocks.begin(); mem_binding_iterator != m_memory_blocks.end(); ++mem_binding_iterator) @@ -199,34 +195,37 @@ bool Anvil::PageTracker::set_binding(MemoryBlock* in_memory_block_ptr, in_start_offset) ); - /* Update page occupancy info - * - * TODO: Perf of the code below could definitely be improved - */ + /* Update page occupancy info */ + n_pages = static_cast(in_size / m_page_size); + occupancy_item_start_index = static_cast(in_start_offset / m_page_size); + + /* TODO: Perf of the code below could definitely be improved */ for (uint32_t n_page = 0; n_page < n_pages; ++n_page) { - uint32_t occupancy_item_index = occupancy_item_start_index + n_page; - uint32_t occupancy_vec_index = occupancy_vec_start_index; - - while (occupancy_item_index >= 32) - { - occupancy_item_index -= 32; - occupancy_vec_index ++; - } + const uint32_t occupancy_item_index = (occupancy_item_start_index + n_page) % pages_per_vec_item; + const uint32_t occupancy_vec_index = (occupancy_item_start_index + n_page) / pages_per_vec_item; + const uint32_t n_page_mask = m_sparse_page_occupancy[occupancy_vec_index].raw & (1 << occupancy_item_index); + /* Change the number of memory-backed pages only if a bit would be flipped */ if (in_memory_block_ptr != nullptr) { - m_sparse_page_occupancy[occupancy_vec_index].raw |= (1 << occupancy_item_index); + if (n_page_mask == 0) + { + m_sparse_page_occupancy[occupancy_vec_index].raw |= (1 << occupancy_item_index); - ++m_n_pages_with_memory_backing; + ++m_n_pages_with_memory_backing; + } } else { - m_sparse_page_occupancy[occupancy_vec_index].raw &= ~(1 << occupancy_item_index); + if (n_page_mask != 0) + { + m_sparse_page_occupancy[occupancy_vec_index].raw &= ~(1 << occupancy_item_index); - --m_n_pages_with_memory_backing; + --m_n_pages_with_memory_backing; + } } } diff --git a/src/misc/semaphore_create_info.cpp b/src/misc/semaphore_create_info.cpp index 745d0732..eb84dde2 100644 --- a/src/misc/semaphore_create_info.cpp +++ b/src/misc/semaphore_create_info.cpp @@ -36,9 +36,13 @@ Anvil::SemaphoreCreateInfoUniquePtr Anvil::SemaphoreCreateInfo::create(const Anv Anvil::SemaphoreCreateInfo::SemaphoreCreateInfo(const Anvil::BaseDevice* in_device_ptr, MTSafety in_mt_safety) - :m_device_ptr (in_device_ptr), - m_exportable_external_semaphore_handle_types(Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_NONE), - m_mt_safety (in_mt_safety) + :m_device_ptr (in_device_ptr), + m_exportable_external_semaphore_handle_types (Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_NONE), +#if defined(_WIN32) + m_exportable_nt_handle_info_specified (false), + m_exportable_nt_handle_info_security_attributes_specified(false), +#endif + m_mt_safety (in_mt_safety) { /* Stub */ } \ No newline at end of file diff --git a/src/misc/types_struct.cpp b/src/misc/types_struct.cpp index c0eb3861..6e6066b2 100644 --- a/src/misc/types_struct.cpp +++ b/src/misc/types_struct.cpp @@ -132,12 +132,12 @@ Anvil::BufferBarrier::~BufferBarrier() /* Stub */ } -Anvil::BufferFormatProperties::BufferFormatProperties() +Anvil::BufferProperties::BufferProperties() { /* Stub */ } -Anvil::BufferFormatProperties::BufferFormatProperties(const ExternalMemoryProperties& in_external_handle_properties) +Anvil::BufferProperties::BufferProperties(const ExternalMemoryProperties& in_external_handle_properties) :external_handle_properties (in_external_handle_properties) { /* Stub */ @@ -334,6 +334,12 @@ Anvil::ExtensionKHRDeviceGroupCreationEntrypoints::ExtensionKHRDeviceGroupCreati vkEnumeratePhysicalDeviceGroupsKHR = nullptr; } +Anvil::ExtensionKHRDrawIndirectCountEntrypoints::ExtensionKHRDrawIndirectCountEntrypoints() +{ + vkCmdDrawIndexedIndirectCountKHR = nullptr; + vkCmdDrawIndirectCountKHR = nullptr; +} + Anvil::ExtensionKHRExternalFenceCapabilitiesEntrypoints::ExtensionKHRExternalFenceCapabilitiesEntrypoints() { vkGetPhysicalDeviceExternalFencePropertiesKHR = nullptr; @@ -432,6 +438,13 @@ Anvil::ExtensionKHRSwapchainEntrypoints::ExtensionKHRSwapchainEntrypoints() #endif #endif +Anvil::ExtensionKHRGetMemoryRequirements2Entrypoints::ExtensionKHRGetMemoryRequirements2Entrypoints() +{ + vkGetBufferMemoryRequirements2KHR = nullptr; + vkGetImageMemoryRequirements2KHR = nullptr; + vkGetImageSparseMemoryRequirements2KHR = nullptr; +} + Anvil::ExtensionKHRGetPhysicalDeviceProperties2::ExtensionKHRGetPhysicalDeviceProperties2() { vkGetPhysicalDeviceFeatures2KHR = nullptr; @@ -624,6 +637,18 @@ bool Anvil::EXTDescriptorIndexingProperties::operator==(const EXTDescriptorIndex shader_uniform_buffer_array_non_uniform_indexing_native == in_props.shader_uniform_buffer_array_non_uniform_indexing_native); } +Anvil::EXTVertexAttributeDivisorProperties::EXTVertexAttributeDivisorProperties() + :max_vertex_attribute_divisor(0) +{ + /* Stub */ +} + +Anvil::EXTVertexAttributeDivisorProperties::EXTVertexAttributeDivisorProperties(const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT& in_props) + :max_vertex_attribute_divisor(in_props.maxVertexAttribDivisor) +{ + /* Stub */ +} + Anvil::ExternalFenceProperties::ExternalFenceProperties() { compatible_external_handle_types = 0; @@ -1524,20 +1549,22 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_array_from_uchar_vect Anvil::PhysicalDeviceProperties::PhysicalDeviceProperties() { - amd_shader_core_properties_ptr = nullptr; - core_vk1_0_properties_ptr = nullptr; - ext_descriptor_indexing_properties_ptr = nullptr; - khr_maintenance3_properties_ptr = nullptr; + amd_shader_core_properties_ptr = nullptr; + core_vk1_0_properties_ptr = nullptr; + ext_descriptor_indexing_properties_ptr = nullptr; + khr_maintenance3_properties_ptr = nullptr; } Anvil::PhysicalDeviceProperties::PhysicalDeviceProperties(const AMDShaderCoreProperties* in_amd_shader_core_properties_ptr, const PhysicalDevicePropertiesCoreVK10* in_core_vk1_0_properties_ptr, const EXTDescriptorIndexingProperties* in_ext_descriptor_indexing_properties_ptr, + const EXTVertexAttributeDivisorProperties* in_ext_vertex_attribute_divisor_properties_ptr, const Anvil::KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties* in_khr_external_memory_caps_physical_device_id_props_ptr, const KHRMaintenance3Properties* in_khr_maintenance3_properties_ptr) :amd_shader_core_properties_ptr (in_amd_shader_core_properties_ptr), core_vk1_0_properties_ptr (in_core_vk1_0_properties_ptr), ext_descriptor_indexing_properties_ptr (in_ext_descriptor_indexing_properties_ptr), + ext_vertex_attribute_divisor_properties_ptr (in_ext_vertex_attribute_divisor_properties_ptr), khr_external_memory_capabilities_physical_device_id_properties_ptr(in_khr_external_memory_caps_physical_device_id_props_ptr), khr_maintenance3_properties_ptr (in_khr_maintenance3_properties_ptr) { @@ -2486,10 +2513,10 @@ bool Anvil::PhysicalDeviceFeaturesCoreVK10::operator==(const Anvil::PhysicalDevi bool Anvil::PhysicalDeviceProperties::operator==(const PhysicalDeviceProperties& in_props) const { - bool amd_shader_core_properties_match = false; - const bool core_vk1_0_features_match = (*core_vk1_0_properties_ptr == *in_props.core_vk1_0_properties_ptr); - bool ext_descriptor_indexing_properties_match = false; - bool khr_maintenance3_properties_match = false; + bool amd_shader_core_properties_match = false; + const bool core_vk1_0_features_match = (*core_vk1_0_properties_ptr == *in_props.core_vk1_0_properties_ptr); + bool ext_descriptor_indexing_properties_match = false; + bool khr_maintenance3_properties_match = false; if (amd_shader_core_properties_ptr != nullptr && in_props.amd_shader_core_properties_ptr != nullptr) @@ -2524,9 +2551,9 @@ bool Anvil::PhysicalDeviceProperties::operator==(const PhysicalDeviceProperties& in_props.khr_maintenance3_properties_ptr == nullptr); } - return amd_shader_core_properties_match && - core_vk1_0_features_match && - ext_descriptor_indexing_properties_match && + return amd_shader_core_properties_match && + core_vk1_0_features_match && + ext_descriptor_indexing_properties_match && khr_maintenance3_properties_match; } @@ -2551,6 +2578,7 @@ Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_buff n_wait_semaphores (in_n_semaphores_to_wait_on), signal_semaphores_sgpu_ptr (in_opt_semaphore_to_signal_ptrs_ptr), should_block (in_should_block), + timeout (UINT64_MAX), type (SubmissionType::SGPU), wait_semaphores_sgpu_ptr (in_opt_semaphore_to_wait_on_ptrs_ptr) { @@ -2584,6 +2612,7 @@ Anvil::SubmitInfo::SubmitInfo(Anvil::CommandBufferBase* in_cmd_buffer_ptr, n_wait_semaphores (in_n_semaphores_to_wait_on), signal_semaphores_sgpu_ptr (in_opt_semaphore_to_signal_ptrs_ptr), should_block (in_should_block), + timeout (UINT64_MAX), type (SubmissionType::SGPU), wait_semaphores_sgpu_ptr (in_opt_semaphore_to_wait_on_ptrs_ptr) { diff --git a/src/misc/window_factory.cpp b/src/misc/window_factory.cpp index 6797eb0d..cb8c642a 100644 --- a/src/misc/window_factory.cpp +++ b/src/misc/window_factory.cpp @@ -27,7 +27,8 @@ Anvil::WindowUniquePtr Anvil::WindowFactory::create_window(WindowPlatform unsigned int in_width, unsigned int in_height, bool in_closable, - PresentCallbackFunction in_present_callback_func) + PresentCallbackFunction in_present_callback_func, + bool in_visible) { WindowUniquePtr result_ptr(nullptr, std::default_delete() ); @@ -63,7 +64,8 @@ Anvil::WindowUniquePtr Anvil::WindowFactory::create_window(WindowPlatform in_width, in_height, in_closable, - in_present_callback_func); + in_present_callback_func, + in_visible); break; } @@ -76,7 +78,8 @@ Anvil::WindowUniquePtr Anvil::WindowFactory::create_window(WindowPlatform in_width, in_height, in_closable, - in_present_callback_func); + in_present_callback_func, + in_visible); break; } diff --git a/src/misc/window_win3264.cpp b/src/misc/window_win3264.cpp index 678c10f4..77d2977c 100644 --- a/src/misc/window_win3264.cpp +++ b/src/misc/window_win3264.cpp @@ -62,7 +62,8 @@ Anvil::WindowUniquePtr Anvil::WindowWin3264::create(const std::string& unsigned int in_width, unsigned int in_height, bool in_closable, - Anvil::PresentCallbackFunction in_present_callback_func) + Anvil::PresentCallbackFunction in_present_callback_func, + bool in_visible) { WindowUniquePtr result_ptr( new Anvil::WindowWin3264(in_title, @@ -75,7 +76,7 @@ Anvil::WindowUniquePtr Anvil::WindowWin3264::create(const std::string& if (result_ptr) { - if (!dynamic_cast(result_ptr.get() )->init() ) + if (!dynamic_cast(result_ptr.get() )->init(in_visible) ) { result_ptr.reset(); } @@ -137,7 +138,7 @@ Anvil::WindowUniquePtr Anvil::WindowWin3264::create(HWND in_window_handle) if (result_ptr) { - if (!dynamic_cast(result_ptr.get() )->init() ) + if (!dynamic_cast(result_ptr.get() )->init(::IsWindowVisible(in_window_handle) == TRUE)) { result_ptr.reset(); } @@ -165,7 +166,7 @@ void Anvil::WindowWin3264::close() } /** Creates a new system window and prepares it for usage. */ -bool Anvil::WindowWin3264::init() +bool Anvil::WindowWin3264::init(const bool& in_visible) { static volatile uint32_t n_windows_spawned = 0; bool result = false; @@ -228,10 +229,12 @@ bool Anvil::WindowWin3264::init() } /* NOTE: Anvil currently does not support automatic swapchain resizing so make sure the window is not scalable. */ + const auto visibility_flag = (in_visible) ? WS_VISIBLE : 0; + m_window = ::CreateWindowEx(0, /* dwExStyle */ window_class_name, m_title.c_str(), - (WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_SYSMENU) ^ WS_THICKFRAME, + (WS_OVERLAPPEDWINDOW | visibility_flag | WS_SYSMENU) ^ WS_THICKFRAME, 0, /* X */ 0, /* Y */ window_rect.right - window_rect.left, diff --git a/src/misc/window_xcb.cpp b/src/misc/window_xcb.cpp index 5dc5361c..3ff62468 100644 --- a/src/misc/window_xcb.cpp +++ b/src/misc/window_xcb.cpp @@ -44,7 +44,8 @@ Anvil::WindowUniquePtr Anvil::WindowXcb::create(const std::string& i unsigned int in_width, unsigned int in_height, bool in_closable, - Anvil::PresentCallbackFunction in_present_callback_func) + Anvil::PresentCallbackFunction in_present_callback_func, + bool in_visible) { WindowUniquePtr result_ptr(nullptr, std::default_delete() ); @@ -59,7 +60,7 @@ Anvil::WindowUniquePtr Anvil::WindowXcb::create(const std::string& i if (result_ptr) { - if (!dynamic_cast(result_ptr.get() )->init() ) + if (!dynamic_cast(result_ptr.get() )->init(in_visible) ) { result_ptr.reset(); } @@ -81,7 +82,7 @@ Anvil::WindowUniquePtr Anvil::WindowXcb::create(xcb_connection_t* in_connection_ if (result_ptr) { - if (!dynamic_cast(result_ptr.get() )->init() ) + if (!dynamic_cast(result_ptr.get() )->init(true /* in_visible */) ) { result_ptr.reset(); } @@ -160,7 +161,7 @@ void Anvil::WindowXcb::close() } /** Creates a new system window and prepares it for usage. */ -bool Anvil::WindowXcb::init() +bool Anvil::WindowXcb::init(const bool& in_visible) { bool result = false; const XCBLoaderFuncs* xcb_procs_ptr = nullptr; @@ -282,9 +283,13 @@ bool Anvil::WindowXcb::init() free(atom_reply_ptr); - xcb_procs_ptr->pfn_xcbMapWindow(m_connection_ptr, - m_window); - xcb_procs_ptr->pfn_xcbFlush (m_connection_ptr); + if (in_visible) + { + xcb_procs_ptr->pfn_xcbMapWindow(m_connection_ptr, + m_window); + } + + xcb_procs_ptr->pfn_xcbFlush(m_connection_ptr); m_atom_wm_delete_window_ptr = atom_wm_delete_window_ptr; m_key_symbols = xcb_procs_ptr->pfn_xcbKeySymbolsAlloc(m_connection_ptr); diff --git a/src/wrappers/buffer.cpp b/src/wrappers/buffer.cpp index 24e271e0..e0700601 100644 --- a/src/wrappers/buffer.cpp +++ b/src/wrappers/buffer.cpp @@ -39,9 +39,11 @@ Anvil::Buffer::Buffer(Anvil::BufferCreateInfoUniquePtr in_create_info_ptr) VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT), MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), in_create_info_ptr->get_device () )), - m_buffer (VK_NULL_HANDLE), - m_create_flags (0), - m_memory_block_ptr(nullptr) + m_buffer (VK_NULL_HANDLE), + m_create_flags (0), + m_memory_block_ptr (nullptr), + m_prefers_dedicated_allocation (false), + m_requires_dedicated_allocation (false) { switch (in_create_info_ptr->get_type() ) { @@ -195,11 +197,12 @@ const Anvil::Buffer* Anvil::Buffer::get_base_buffer() } /* Please see header for specification */ -VkBuffer Anvil::Buffer::get_buffer() +VkBuffer Anvil::Buffer::get_buffer(const bool& in_bake_memory_if_necessary) { if (get_create_info_ptr()->get_type() != Anvil::BufferType::SPARSE_NO_ALLOC) { - if (m_memory_block_ptr == nullptr) + if (in_bake_memory_if_necessary && + m_memory_block_ptr == nullptr) { get_memory_block(0 /* in_n_memory_block */); } @@ -278,8 +281,9 @@ bool Anvil::Buffer::init() { uint32_t n_queue_family_indices; uint32_t queue_family_indices [8]; - VkResult result (VK_ERROR_INITIALIZATION_FAILED); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); Anvil::StructChainer struct_chainer; + bool use_dedicated_allocation(false); if ( m_create_info_ptr->get_client_data () != nullptr && (m_create_info_ptr->get_memory_features() & Anvil::MEMORY_FEATURE_FLAG_MAPPABLE) == 0) @@ -306,8 +310,8 @@ bool Anvil::Buffer::init() buffer_create_info.pNext = nullptr; buffer_create_info.pQueueFamilyIndices = queue_family_indices; buffer_create_info.queueFamilyIndexCount = n_queue_family_indices; - buffer_create_info.sharingMode = (n_queue_family_indices == 1) ? VK_SHARING_MODE_EXCLUSIVE : m_create_info_ptr->get_sharing_mode(); - buffer_create_info.size = m_create_info_ptr->get_size(); + buffer_create_info.sharingMode = m_create_info_ptr->get_sharing_mode(); + buffer_create_info.size = m_create_info_ptr->get_size (); buffer_create_info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO; buffer_create_info.usage = m_create_info_ptr->get_usage_flags(); @@ -315,7 +319,7 @@ bool Anvil::Buffer::init() } { - const auto& external_memory_handle_types = m_create_info_ptr->get_external_memory_handle_types(); + const auto& external_memory_handle_types = m_create_info_ptr->get_exportable_external_memory_handle_types(); if (external_memory_handle_types != 0) { @@ -344,10 +348,73 @@ bool Anvil::Buffer::init() { set_vk_handle(m_buffer); - /* Cache buffer data memory requirements */ - vkGetBufferMemoryRequirements(m_device_ptr->get_device_vk(), - m_buffer, - &m_buffer_memory_reqs); + /* Cache buffer data memory requirements. + * + * Prefer facility exposed by VK_KHR_get_memory_requirements2, unless the extension is unavailable. + */ + if (m_device_ptr->get_extension_info()->khr_get_memory_requirements2() ) + { + Anvil::StructID dedicated_reqs_struct_id = static_cast(UINT32_MAX); + const auto gmr2_entrypoints = m_device_ptr->get_extension_khr_get_memory_requirements2_entrypoints(); + VkBufferMemoryRequirementsInfo2KHR info; + const bool khr_dedicated_allocation_available = m_device_ptr->get_extension_info()->khr_dedicated_allocation(); + Anvil::StructChainUniquePtr result_reqs_chain_ptr; + VkMemoryRequirements2KHR* result_reqs_chain_raw_ptr = nullptr; + Anvil::StructChainer result_reqs_chainer; + + info.buffer = m_buffer; + info.pNext = nullptr; + info.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR; + + { + VkMemoryRequirements2KHR reqs; + + reqs.pNext = nullptr; + reqs.sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR; + + result_reqs_chainer.append_struct(reqs); + } + + if (khr_dedicated_allocation_available) + { + VkMemoryDedicatedRequirementsKHR dedicated_reqs; + + dedicated_reqs.pNext = nullptr; + dedicated_reqs.prefersDedicatedAllocation = VK_FALSE; + dedicated_reqs.requiresDedicatedAllocation = VK_FALSE; + dedicated_reqs.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR; + + dedicated_reqs_struct_id = result_reqs_chainer.append_struct(dedicated_reqs); + } + + result_reqs_chain_ptr = result_reqs_chainer.create_chain(); + anvil_assert(result_reqs_chain_ptr != nullptr); + + result_reqs_chain_raw_ptr = result_reqs_chain_ptr->get_root_struct(); + anvil_assert(result_reqs_chain_raw_ptr != nullptr); + + gmr2_entrypoints.vkGetBufferMemoryRequirements2KHR(m_device_ptr->get_device_vk(), + &info, + result_reqs_chain_raw_ptr); + + m_buffer_memory_reqs = result_reqs_chain_raw_ptr->memoryRequirements; + + if (khr_dedicated_allocation_available) + { + const auto dedicated_alloc_info_ptr = result_reqs_chain_ptr->get_struct_with_id(dedicated_reqs_struct_id); + + m_prefers_dedicated_allocation = (dedicated_alloc_info_ptr->prefersDedicatedAllocation == VK_TRUE); + m_requires_dedicated_allocation = (dedicated_alloc_info_ptr->requiresDedicatedAllocation == VK_TRUE); + + use_dedicated_allocation = m_requires_dedicated_allocation; + } + } + else + { + vkGetBufferMemoryRequirements(m_device_ptr->get_device_vk(), + m_buffer, + &m_buffer_memory_reqs); + } } } else @@ -377,6 +444,12 @@ bool Anvil::Buffer::init() create_info_ptr->set_mt_safety(m_create_info_ptr->get_mt_safety() ); + if (use_dedicated_allocation) + { + create_info_ptr->use_dedicated_allocation(this, + nullptr); /* in_opt_image_ptr */ + } + memory_block_ptr = Anvil::MemoryBlock::create(std::move(create_info_ptr) ); } @@ -416,6 +489,12 @@ bool Anvil::Buffer::init() m_create_info_ptr->get_size() ); mem_block_ptr = Anvil::MemoryBlock::create(std::move(create_info_ptr) ); + + if (use_dedicated_allocation) + { + create_info_ptr->use_dedicated_allocation(this, + nullptr); /* in_opt_image_ptr */ + } } m_owned_memory_blocks.push_back(std::move(mem_block_ptr) ); diff --git a/src/wrappers/command_buffer.cpp b/src/wrappers/command_buffer.cpp index 039de6d0..6ffcd0a8 100644 --- a/src/wrappers/command_buffer.cpp +++ b/src/wrappers/command_buffer.cpp @@ -497,6 +497,25 @@ Anvil::CommandBufferBase::DrawIndexedIndirectCountAMDCommand::DrawIndexedIndirec stride = in_stride; } +/** Please see header for specification */ +Anvil::CommandBufferBase::DrawIndexedIndirectCountKHRCommand::DrawIndexedIndirectCountKHRCommand(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + Anvil::Buffer* in_count_buffer_ptr, + VkDeviceSize in_count_offset, + uint32_t in_max_draw_count, + uint32_t in_stride) + :Command(COMMAND_TYPE_DRAW_INDEXED_INDIRECT_COUNT_KHR) +{ + buffer = in_buffer_ptr->get_buffer(); + buffer_ptr = in_buffer_ptr; + count_buffer = in_count_buffer_ptr->get_buffer(); + count_buffer_ptr = in_count_buffer_ptr; + count_offset = in_count_offset; + max_draw_count = in_max_draw_count; + offset = in_offset; + stride = in_stride; +} + /** Please see header for specification */ Anvil::CommandBufferBase::DrawIndirectCommand::DrawIndirectCommand(Anvil::Buffer* in_buffer_ptr, VkDeviceSize in_offset, @@ -530,6 +549,25 @@ Anvil::CommandBufferBase::DrawIndirectCountAMDCommand::DrawIndirectCountAMDComma stride = in_stride; } +/** Please see header for specification */ +Anvil::CommandBufferBase::DrawIndirectCountKHRCommand::DrawIndirectCountKHRCommand(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + Anvil::Buffer* in_count_buffer_ptr, + VkDeviceSize in_count_offset, + uint32_t in_max_draw_count, + uint32_t in_stride) + :Command(COMMAND_TYPE_DRAW_INDIRECT_COUNT_KHR) +{ + buffer = in_buffer_ptr->get_buffer(); + buffer_ptr = in_buffer_ptr; + count_buffer = in_count_buffer_ptr->get_buffer(); + count_buffer_ptr = in_count_buffer_ptr; + count_offset = in_count_offset; + max_draw_count = in_max_draw_count; + offset = in_offset; + stride = in_stride; +} + /** Please see header for specification */ Anvil::CommandBufferBase::EndQueryCommand::EndQueryCommand(Anvil::QueryPool* in_query_pool_ptr, Anvil::QueryIndex in_entry) @@ -2125,6 +2163,69 @@ bool Anvil::CommandBufferBase::record_draw_indexed_indirect_count_AMD(Anvil::Buf return result; } +/* Please see header for specification */ +bool Anvil::CommandBufferBase::record_draw_indexed_indirect_count_KHR(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + Anvil::Buffer* in_count_buffer_ptr, + VkDeviceSize in_count_offset, + uint32_t in_max_draw_count, + uint32_t in_stride) +{ + Anvil::ExtensionKHRDrawIndirectCountEntrypoints entrypoints; + bool result (false); + + if (!m_is_renderpass_active) + { + anvil_assert(m_is_renderpass_active); + + goto end; + } + + if (!m_recording_in_progress) + { + anvil_assert(m_recording_in_progress); + + goto end; + } + + anvil_assert(m_device_ptr->get_extension_info()->khr_draw_indirect_count() ); + + + #ifdef STORE_COMMAND_BUFFER_COMMANDS + { + if (!m_command_stashing_disabled) + { + m_commands.push_back(DrawIndexedIndirectCountKHRCommand(in_buffer_ptr, + in_offset, + in_count_buffer_ptr, + in_count_offset, + in_max_draw_count, + in_stride) ); + } + } + #endif + + entrypoints = m_device_ptr->get_extension_khr_draw_indirect_count_entrypoints(); + + m_parent_command_pool_ptr->lock(); + lock(); + { + entrypoints.vkCmdDrawIndexedIndirectCountKHR(m_command_buffer, + in_buffer_ptr->get_buffer(), + in_offset, + in_count_buffer_ptr->get_buffer(), + in_count_offset, + in_max_draw_count, + in_stride); + } + unlock(); + m_parent_command_pool_ptr->unlock(); + + result = true; +end: + return result; +} + /* Please see header for specification */ bool Anvil::CommandBufferBase::record_draw_indirect(Anvil::Buffer* in_buffer_ptr, VkDeviceSize in_offset, @@ -2239,6 +2340,69 @@ bool Anvil::CommandBufferBase::record_draw_indirect_count_AMD(Anvil::Buffer* in_ return result; } +/* Please see header for specification */ +bool Anvil::CommandBufferBase::record_draw_indirect_count_KHR(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + Anvil::Buffer* in_count_buffer_ptr, + VkDeviceSize in_count_offset, + uint32_t in_max_draw_count, + uint32_t in_stride) +{ + Anvil::ExtensionKHRDrawIndirectCountEntrypoints entrypoints; + bool result (false); + + if (!m_is_renderpass_active) + { + anvil_assert(m_is_renderpass_active); + + goto end; + } + + if (!m_recording_in_progress) + { + anvil_assert(m_recording_in_progress); + + goto end; + } + + anvil_assert(m_device_ptr->get_extension_info()->khr_draw_indirect_count() ); + + + #ifdef STORE_COMMAND_BUFFER_COMMANDS + { + if (!m_command_stashing_disabled) + { + m_commands.push_back(DrawIndirectCountKHRCommand(in_buffer_ptr, + in_offset, + in_count_buffer_ptr, + in_count_offset, + in_max_draw_count, + in_stride) ); + } + } + #endif + + entrypoints = m_device_ptr->get_extension_khr_draw_indirect_count_entrypoints(); + + m_parent_command_pool_ptr->lock(); + lock(); + { + entrypoints.vkCmdDrawIndirectCountKHR(m_command_buffer, + in_buffer_ptr->get_buffer(), + in_offset, + in_count_buffer_ptr->get_buffer(), + in_count_offset, + in_max_draw_count, + in_stride); + } + unlock(); + m_parent_command_pool_ptr->unlock(); + + result = true; +end: + return result; +} + /* Please see header for specification */ bool Anvil::CommandBufferBase::record_end_query(Anvil::QueryPool* in_query_pool_ptr, Anvil::QueryIndex in_entry) diff --git a/src/wrappers/device.cpp b/src/wrappers/device.cpp index 54137431..443a588a 100644 --- a/src/wrappers/device.cpp +++ b/src/wrappers/device.cpp @@ -733,6 +733,15 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, anvil_assert(m_khr_bind_memory2_extension_entrypoints.vkBindImageMemory2KHR != nullptr); } + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_draw_indirect_count() ) + { + m_khr_draw_indirect_count_extension_entrypoints.vkCmdDrawIndexedIndirectCountKHR = reinterpret_cast(get_proc_address("vkCmdDrawIndexedIndirectCountKHR") ); + m_khr_draw_indirect_count_extension_entrypoints.vkCmdDrawIndirectCountKHR = reinterpret_cast (get_proc_address("vkCmdDrawIndirectCountKHR") ); + + anvil_assert(m_khr_draw_indirect_count_extension_entrypoints.vkCmdDrawIndexedIndirectCountKHR != nullptr); + anvil_assert(m_khr_draw_indirect_count_extension_entrypoints.vkCmdDrawIndirectCountKHR != nullptr); + } + #if defined(_WIN32) { if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_fence_win32() ) @@ -762,8 +771,48 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, anvil_assert(m_khr_external_semaphore_win32_extension_entrypoints.vkImportSemaphoreWin32HandleKHR != nullptr); } } + #else + { + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_fence_fd() ) + { + m_khr_external_fence_fd_extension_entrypoints.vkGetFenceFdKHR = reinterpret_cast (get_proc_address("vkGetFenceFdKHR") ); + m_khr_external_fence_fd_extension_entrypoints.vkImportFenceFdKHR = reinterpret_cast(get_proc_address("vkImportFenceFdKHR") ); + + anvil_assert(m_khr_external_fence_fd_extension_entrypoints.vkGetFenceFdKHR != nullptr); + anvil_assert(m_khr_external_fence_fd_extension_entrypoints.vkImportFenceFdKHR != nullptr); + } + + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_memory_fd() ) + { + m_khr_external_memory_fd_extension_entrypoints.vkGetMemoryFdKHR = reinterpret_cast (get_proc_address("vkGetMemoryFdKHR")); + m_khr_external_memory_fd_extension_entrypoints.vkGetMemoryFdPropertiesKHR = reinterpret_cast(get_proc_address("vkGetMemoryFdPropertiesKHR")); + + anvil_assert(m_khr_external_memory_win32_extension_entrypoints.vkGetMemoryFdKHR != nullptr); + anvil_assert(m_khr_external_memory_win32_extension_entrypoints.vkGetMemoryFdPropertiesKHR != nullptr); + } + + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_semaphore_fd() ) + { + m_khr_external_semaphore_fd_extension_entrypoints.vkGetSemaphoreFdKHR = reinterpret_cast (get_proc_address("vkGetSemaphoreFdKHR")); + m_khr_external_semaphore_fd_extension_entrypoints.vkImportSemaphoreFdKHR = reinterpret_cast(get_proc_address("vkImportSemaphoreFdKHR")); + + anvil_assert(m_khr_external_semaphore_fd_extension_entrypoints.vkGetSemaphoreFdKHR != nullptr); + anvil_assert(m_khr_external_semaphore_fd_extension_entrypoints.vkImportSemaphoreFdKHR != nullptr); + } + } #endif + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_get_memory_requirements2() ) + { + m_khr_get_memory_requirements2_extension_entrypoints.vkGetBufferMemoryRequirements2KHR = reinterpret_cast (get_proc_address("vkGetBufferMemoryRequirements2KHR") ); + m_khr_get_memory_requirements2_extension_entrypoints.vkGetImageMemoryRequirements2KHR = reinterpret_cast (get_proc_address("vkGetImageMemoryRequirements2KHR") ); + m_khr_get_memory_requirements2_extension_entrypoints.vkGetImageSparseMemoryRequirements2KHR = reinterpret_cast(get_proc_address("vkGetImageSparseMemoryRequirements2KHR") ); + + anvil_assert(m_khr_get_memory_requirements2_extension_entrypoints.vkGetBufferMemoryRequirements2KHR != nullptr); + anvil_assert(m_khr_get_memory_requirements2_extension_entrypoints.vkGetImageMemoryRequirements2KHR != nullptr); + anvil_assert(m_khr_get_memory_requirements2_extension_entrypoints.vkGetImageSparseMemoryRequirements2KHR != nullptr); + } + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_maintenance1() ) { m_khr_maintenance1_extension_entrypoints.vkTrimCommandPoolKHR = reinterpret_cast(get_proc_address("vkTrimCommandPoolKHR") ); @@ -1148,11 +1197,11 @@ Anvil::SwapchainUniquePtr Anvil::SGPUDevice::create_swapchain(Anvil::RenderingSu return result_ptr; } -bool Anvil::SGPUDevice::get_physical_device_buffer_format_properties(const BufferFormatPropertiesQuery& in_query, - Anvil::BufferFormatProperties* out_opt_result_ptr) const +bool Anvil::SGPUDevice::get_physical_device_buffer_properties(const BufferPropertiesQuery& in_query, + Anvil::BufferProperties* out_opt_result_ptr) const { - return m_parent_physical_device_ptr->get_buffer_format_properties(in_query, - out_opt_result_ptr); + return m_parent_physical_device_ptr->get_buffer_properties(in_query, + out_opt_result_ptr); } /** Please see header for specification */ @@ -1201,6 +1250,14 @@ const Anvil::QueueFamilyInfoItems& Anvil::SGPUDevice::get_physical_device_queue_ return m_parent_physical_device_ptr->get_queue_families(); } +/** Please see header for specification */ +bool Anvil::SGPUDevice::get_physical_device_semaphore_properties(const SemaphorePropertiesQuery& in_query, + Anvil::SemaphoreProperties* out_opt_result_ptr) const +{ + return m_parent_physical_device_ptr->get_semaphore_properties(in_query, + out_opt_result_ptr); +} + /** Please see header for specification */ bool Anvil::SGPUDevice::get_physical_device_sparse_image_format_properties(VkFormat in_format, VkImageType in_type, diff --git a/src/wrappers/fence.cpp b/src/wrappers/fence.cpp index cd4ec807..2881975f 100644 --- a/src/wrappers/fence.cpp +++ b/src/wrappers/fence.cpp @@ -80,11 +80,11 @@ Anvil::ExternalHandleUniquePtr Anvil::Fence::export_to_external_handle(const Anv { #if defined(_WIN32) const auto invalid_handle = nullptr; - const bool is_autorelease_handle = Anvil::Utils::is_nt_handle(in_fence_handle_type); + const bool handle_needs_manual_release = Anvil::Utils::is_nt_handle(in_fence_handle_type); const bool only_one_handle_ever_permitted = Anvil::Utils::is_nt_handle(in_fence_handle_type); #else const int invalid_handle = -1; - const bool is_autorelease_handle = true; + const bool handle_needs_manual_release = true; const bool only_one_handle_ever_permitted = false; #endif @@ -181,7 +181,7 @@ Anvil::ExternalHandleUniquePtr Anvil::Fence::export_to_external_handle(const Anv } result_ptr = Anvil::ExternalHandle::create(result_handle, - is_autorelease_handle); /* in_close_at_destruction_time */ + handle_needs_manual_release); /* in_close_at_destruction_time */ end: return result_ptr; diff --git a/src/wrappers/graphics_pipeline_manager.cpp b/src/wrappers/graphics_pipeline_manager.cpp index 4eebf3c1..7371c8fe 100644 --- a/src/wrappers/graphics_pipeline_manager.cpp +++ b/src/wrappers/graphics_pipeline_manager.cpp @@ -119,13 +119,14 @@ bool Anvil::GraphicsPipelineManager::bake() bool result = false; std::vector result_graphics_pipelines; VkResult result_vk; - auto scissor_boxes_vk_cache = std::vector (); - auto shader_stage_create_info_items_vk_cache = std::vector (); - auto specialization_info_vk_cache = std::vector (); - auto specialization_map_entry_vk_cache = std::vector (); - auto tessellation_state_create_info_items_vk_cache = std::vector (); - auto vertex_input_state_create_info_items_vk_cache = std::vector (); - auto viewport_state_create_info_items_vk_cache = std::vector (); + auto scissor_boxes_vk_cache = std::vector (); + auto shader_stage_create_info_items_vk_cache = std::vector (); + auto specialization_info_vk_cache = std::vector (); + auto specialization_map_entry_vk_cache = std::vector (); + auto tessellation_state_create_info_items_vk_cache = std::vector (); + auto vertex_input_binding_divisor_description_vk_cache = std::vector (); + auto vertex_input_state_create_info_chain_cache = std::vector > >(); + auto viewport_state_create_info_items_vk_cache = std::vector (); std::vector viewports_vk_cache; @@ -143,22 +144,22 @@ bool Anvil::GraphicsPipelineManager::bake() }; - color_blend_attachment_states_vk_cache.reserve (N_CACHE_ITEMS); - color_blend_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - depth_stencil_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - dynamic_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - enabled_dynamic_states_vk_cache.reserve (N_CACHE_ITEMS); - input_assembly_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - multisample_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - raster_state_create_info_chains_vk_cache.reserve (N_CACHE_ITEMS); - scissor_boxes_vk_cache.reserve (N_CACHE_ITEMS); - shader_stage_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - specialization_info_vk_cache.reserve (N_CACHE_ITEMS); - specialization_map_entry_vk_cache.reserve (N_CACHE_ITEMS); - tessellation_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - vertex_input_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - viewport_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - viewports_vk_cache.reserve (N_CACHE_ITEMS); + color_blend_attachment_states_vk_cache.reserve (N_CACHE_ITEMS); + color_blend_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); + depth_stencil_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); + dynamic_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); + enabled_dynamic_states_vk_cache.reserve (N_CACHE_ITEMS); + input_assembly_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); + multisample_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); + raster_state_create_info_chains_vk_cache.reserve (N_CACHE_ITEMS); + scissor_boxes_vk_cache.reserve (N_CACHE_ITEMS); + shader_stage_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); + specialization_info_vk_cache.reserve (N_CACHE_ITEMS); + specialization_map_entry_vk_cache.reserve (N_CACHE_ITEMS); + tessellation_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); + vertex_input_binding_divisor_description_vk_cache.reserve(N_CACHE_ITEMS); + viewport_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); + viewports_vk_cache.reserve (N_CACHE_ITEMS); if (mutex_ptr != nullptr) { @@ -208,7 +209,6 @@ bool Anvil::GraphicsPipelineManager::bake() bool multisample_state_used = false; uint32_t subpass_n_color_attachments = 0; bool tessellation_state_used = false; - VkPipelineVertexInputStateCreateInfo vertex_input_state_create_info; bool viewport_state_used = false; if (current_pipeline_create_info_ptr == nullptr) @@ -683,7 +683,8 @@ bool Anvil::GraphicsPipelineManager::bake() /* Form the vertex input state create info descriptor */ { - std::unique_ptr current_pipeline_gfx_data_ptr; + std::unique_ptr current_pipeline_gfx_data_ptr; + Anvil::StructChainer vertex_input_state_create_info_chainer; anvil_assert(m_pipeline_id_to_gfx_pipeline_data.find(current_pipeline_id) == m_pipeline_id_to_gfx_pipeline_data.end() ); @@ -698,18 +699,56 @@ bool Anvil::GraphicsPipelineManager::bake() continue; } - vertex_input_state_create_info.vertexAttributeDescriptionCount = static_cast(current_pipeline_gfx_data_ptr->vk_input_attributes.size()); - vertex_input_state_create_info.vertexBindingDescriptionCount = static_cast(current_pipeline_gfx_data_ptr->vk_input_bindings.size ()); + { + VkPipelineVertexInputStateCreateInfo create_info; + + create_info.vertexAttributeDescriptionCount = static_cast(current_pipeline_gfx_data_ptr->vk_input_attributes.size()); + create_info.vertexBindingDescriptionCount = static_cast(current_pipeline_gfx_data_ptr->vk_input_bindings.size ()); + + create_info.flags = 0; + create_info.pNext = nullptr; + create_info.pVertexAttributeDescriptions = (create_info.vertexAttributeDescriptionCount > 0) ? ¤t_pipeline_gfx_data_ptr->vk_input_attributes.at(0) + : nullptr; + create_info.pVertexBindingDescriptions = (create_info.vertexBindingDescriptionCount > 0) ? ¤t_pipeline_gfx_data_ptr->vk_input_bindings.at(0) + : nullptr; + create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO; - vertex_input_state_create_info.flags = 0; - vertex_input_state_create_info.pNext = nullptr; - vertex_input_state_create_info.pVertexAttributeDescriptions = (vertex_input_state_create_info.vertexAttributeDescriptionCount > 0) ? ¤t_pipeline_gfx_data_ptr->vk_input_attributes.at(0) - : nullptr; - vertex_input_state_create_info.pVertexBindingDescriptions = (vertex_input_state_create_info.vertexBindingDescriptionCount > 0) ? ¤t_pipeline_gfx_data_ptr->vk_input_bindings.at(0) - : nullptr; - vertex_input_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO; + vertex_input_state_create_info_chainer.append_struct(create_info); + } - vertex_input_state_create_info_items_vk_cache.push_back(vertex_input_state_create_info); + { + uint32_t n_divisor_descriptors_pre_cached = static_cast(vertex_input_binding_divisor_description_vk_cache.size() ); + + for (const auto& current_binding_info : current_pipeline_gfx_data_ptr->input_bindings) + { + /* Make sure to chain VkVertexInputBindingDivisorDescriptionEXT for each binding which uses a non-default divisor value */ + if (current_binding_info.divisor != 1) + { + VkVertexInputBindingDivisorDescriptionEXT divisor_info; + + divisor_info.binding = current_binding_info.binding; + divisor_info.divisor = current_binding_info.divisor; + + vertex_input_binding_divisor_description_vk_cache.push_back(divisor_info); + } + } + + if (n_divisor_descriptors_pre_cached < static_cast(vertex_input_binding_divisor_description_vk_cache.size() )) + { + VkPipelineVertexInputDivisorStateCreateInfoEXT divisor_state_create_info; + + divisor_state_create_info.pNext = nullptr; + divisor_state_create_info.pVertexBindingDivisors = &vertex_input_binding_divisor_description_vk_cache.at(n_divisor_descriptors_pre_cached); + divisor_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT; + divisor_state_create_info.vertexBindingDivisorCount = static_cast(vertex_input_binding_divisor_description_vk_cache.size() ) - n_divisor_descriptors_pre_cached; + + vertex_input_state_create_info_chainer.append_struct(divisor_state_create_info); + } + } + + vertex_input_state_create_info_chain_cache.push_back( + vertex_input_state_create_info_chainer.create_chain() + ); m_pipeline_id_to_gfx_pipeline_data[current_pipeline_id] = std::move(current_pipeline_gfx_data_ptr); } @@ -918,7 +957,7 @@ bool Anvil::GraphicsPipelineManager::bake() : nullptr; graphics_pipeline_create_info.pTessellationState = (tessellation_state_used) ? &tessellation_state_create_info_items_vk_cache[tessellation_state_create_info_items_vk_cache.size() - 1] : VK_NULL_HANDLE; - graphics_pipeline_create_info.pVertexInputState = &vertex_input_state_create_info_items_vk_cache[vertex_input_state_create_info_items_vk_cache.size() - 1]; + graphics_pipeline_create_info.pVertexInputState = vertex_input_state_create_info_chain_cache.at(vertex_input_state_create_info_chain_cache.size() - 1)->get_root_struct(); graphics_pipeline_create_info.pViewportState = (viewport_state_used) ? &viewport_state_create_info_items_vk_cache[viewport_state_create_info_items_vk_cache.size() - 1] : VK_NULL_HANDLE; graphics_pipeline_create_info.renderPass = current_pipeline_create_info_ptr->get_renderpass()->get_render_pass(); @@ -965,7 +1004,6 @@ bool Anvil::GraphicsPipelineManager::bake() anvil_assert(specialization_info_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(specialization_map_entry_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(tessellation_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(vertex_input_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(viewport_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(viewports_vk_cache.size() <= N_CACHE_ITEMS); } @@ -1055,6 +1093,7 @@ void Anvil::GraphicsPipelineManager::GraphicsPipelineData::bake_vk_attributes_an uint32_t n_attributes = 0; anvil_assert(attribute_location_to_binding_index_map.size() == 0); + anvil_assert(input_bindings.size () == 0); anvil_assert(vk_input_attributes.size () == 0); anvil_assert(vk_input_bindings.size () == 0); @@ -1071,6 +1110,7 @@ void Anvil::GraphicsPipelineManager::GraphicsPipelineData::bake_vk_attributes_an /* Identify the binding index we should use for the attribute. * * If an explicit binding has been specified by the application, this step can be skipped */ + uint32_t current_attribute_divisor = 1; uint32_t current_attribute_explicit_vertex_binding_index = UINT32_MAX; uint32_t current_attribute_location = UINT32_MAX; VkFormat current_attribute_format = VK_FORMAT_MAX_ENUM; @@ -1087,7 +1127,8 @@ void Anvil::GraphicsPipelineManager::GraphicsPipelineData::bake_vk_attributes_an ¤t_attribute_offset, ¤t_attribute_explicit_vertex_binding_index, ¤t_attribute_stride, - ¤t_attribute_rate) ) + ¤t_attribute_rate, + ¤t_attribute_divisor) ) { anvil_assert_fail(); @@ -1096,15 +1137,16 @@ void Anvil::GraphicsPipelineManager::GraphicsPipelineData::bake_vk_attributes_an if (current_attribute_explicit_vertex_binding_index == UINT32_MAX) { - for (auto vk_input_binding_iterator = vk_input_bindings.begin(); - vk_input_binding_iterator != vk_input_bindings.end(); - ++vk_input_binding_iterator) + for (auto input_binding_iterator = input_bindings.begin(); + input_binding_iterator != input_bindings.end(); + ++input_binding_iterator) { - if (vk_input_binding_iterator->inputRate == current_attribute_rate && - vk_input_binding_iterator->stride == current_attribute_stride) + if (input_binding_iterator->divisor == current_attribute_divisor && + input_binding_iterator->input_rate == current_attribute_rate && + input_binding_iterator->stride == current_attribute_stride) { has_found = true; - n_attribute_binding = static_cast(vk_input_binding_iterator - vk_input_bindings.begin()); + n_attribute_binding = static_cast(input_binding_iterator - input_bindings.begin()); break; } @@ -1119,6 +1161,7 @@ void Anvil::GraphicsPipelineManager::GraphicsPipelineData::bake_vk_attributes_an if (!has_found) { /* Got to create a new binding descriptor .. */ + VertexInputBinding new_binding_anvil; VkVertexInputBindingDescription new_binding_vk; new_binding_vk.binding = (current_attribute_explicit_vertex_binding_index == UINT32_MAX) ? static_cast(vk_input_bindings.size() ) @@ -1126,6 +1169,10 @@ void Anvil::GraphicsPipelineManager::GraphicsPipelineData::bake_vk_attributes_an new_binding_vk.inputRate = current_attribute_rate; new_binding_vk.stride = current_attribute_stride; + new_binding_anvil = VertexInputBinding(new_binding_vk, + current_attribute_divisor); + + input_bindings.push_back (new_binding_anvil); vk_input_bindings.push_back(new_binding_vk); n_attribute_binding = new_binding_vk.binding; diff --git a/src/wrappers/image.cpp b/src/wrappers/image.cpp index 08917e13..744ec7b7 100644 --- a/src/wrappers/image.cpp +++ b/src/wrappers/image.cpp @@ -60,6 +60,8 @@ Anvil::Image::Image(Anvil::ImageCreateInfoUniquePtr in_create_info_ptr) m_image (VK_NULL_HANDLE), m_memory_types (0), m_n_mipmaps (0), + m_prefers_dedicated_allocation (false), + m_requires_dedicated_allocation (false), m_storage_size (0), m_swapchain_memory_assigned (false) { @@ -273,14 +275,15 @@ Anvil::MemoryBlock* Anvil::Image::get_memory_block() bool Anvil::Image::init() { std::vector aspects_used; - VkImageCreateFlags image_flags = 0; + VkImageCreateFlags image_flags = 0; Anvil::ImageFormatProperties image_format_props; - const auto memory_features = m_create_info_ptr->get_memory_features(); - uint32_t n_queue_family_indices = 0; + const auto memory_features = m_create_info_ptr->get_memory_features(); + uint32_t n_queue_family_indices = 0; uint32_t queue_family_indices[3]; - VkResult result = VK_ERROR_INITIALIZATION_FAILED; - bool result_bool = true; + VkResult result = VK_ERROR_INITIALIZATION_FAILED; + bool result_bool = true; Anvil::StructChainer struct_chainer; + bool use_dedicated_allocation = false; if ((memory_features & MEMORY_FEATURE_FLAG_MAPPABLE) == 0) { @@ -464,10 +467,50 @@ bool Anvil::Image::init() if (m_create_info_ptr->get_type() != Anvil::ImageType::SWAPCHAIN_WRAPPER) { - /* Extract various image properties we're going to need later */ - vkGetImageMemoryRequirements(m_device_ptr->get_device_vk(), - m_image, - &m_memory_reqs); + /* Extract various image properties we're going to need later. + * + * Prefer facilities exposed by VK_KHR_get_memory_requirements2 unless unsupported. + */ + if (m_device_ptr->get_extension_info()->khr_get_memory_requirements2() ) + { + const auto gmr2_entrypoints = m_device_ptr->get_extension_khr_get_memory_requirements2_entrypoints(); + VkImageMemoryRequirementsInfo2KHR info; + const bool khr_dedicated_allocation_available = m_device_ptr->get_extension_info()->khr_dedicated_allocation (); + VkMemoryDedicatedRequirementsKHR memory_dedicated_reqs; + VkMemoryRequirements2KHR result_reqs; + + memory_dedicated_reqs.pNext = nullptr; + memory_dedicated_reqs.prefersDedicatedAllocation = VK_FALSE; + memory_dedicated_reqs.requiresDedicatedAllocation = VK_FALSE; + memory_dedicated_reqs.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR; + + info.image = m_image; + info.pNext = nullptr; + info.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR; + + result_reqs.pNext = (khr_dedicated_allocation_available) ? &memory_dedicated_reqs : nullptr; + result_reqs.sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR; + + gmr2_entrypoints.vkGetImageMemoryRequirements2KHR(m_device_ptr->get_device_vk(), + &info, + &result_reqs); + + m_memory_reqs = result_reqs.memoryRequirements; + + if (khr_dedicated_allocation_available) + { + m_prefers_dedicated_allocation = (memory_dedicated_reqs.prefersDedicatedAllocation == VK_TRUE); + m_requires_dedicated_allocation = (memory_dedicated_reqs.requiresDedicatedAllocation == VK_TRUE); + + use_dedicated_allocation = m_requires_dedicated_allocation; + } + } + else + { + vkGetImageMemoryRequirements(m_device_ptr->get_device_vk(), + m_image, + &m_memory_reqs); + } m_alignment = m_memory_reqs.alignment; m_memory_types = m_memory_reqs.memoryTypeBits; @@ -526,20 +569,59 @@ bool Anvil::Image::init() /* Retrieve image aspect properties. Since Vulkan lets a single props structure to refer to more than * just a single aspect, we first cache the exposed info in a vec and then distribute the information to - * a map, whose key is allowed to consist of a single bit ( = individual aspect) only */ - vkGetImageSparseMemoryRequirements(m_device_ptr->get_device_vk(), - m_image, - &n_reqs, - nullptr); - - anvil_assert(n_reqs >= 1); - - sparse_image_memory_reqs.resize(n_reqs); + * a map, whose key is allowed to consist of a single bit ( = individual aspect) only + * + * Prefer facilities exposed by VK_KHR_get_memory_requirements2 unless unsupported. This will be leveraged + * in the future, but for now admittedly is a bit of a moot move. + */ + if (m_device_ptr->get_extension_info()->khr_get_memory_requirements2() ) + { + const auto gmr2_entrypoints = m_device_ptr->get_extension_khr_get_memory_requirements2_entrypoints(); + VkImageSparseMemoryRequirementsInfo2KHR info; + uint32_t n_current_item = 0; + std::vector temp_vec; + + info.image = m_image; + info.pNext = nullptr; + info.sType = VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2_KHR; + + gmr2_entrypoints.vkGetImageSparseMemoryRequirements2KHR(m_device_ptr->get_device_vk(), + &info, + &n_reqs, + nullptr); /* pSparseMemoryRequirements */ + + anvil_assert(n_reqs >= 1); + sparse_image_memory_reqs.resize(n_reqs); + temp_vec.resize (n_reqs); + + gmr2_entrypoints.vkGetImageSparseMemoryRequirements2KHR(m_device_ptr->get_device_vk(), + &info, + &n_reqs, + &temp_vec[0]); /* pSparseMemoryRequirements */ + + for (const auto& current_temp_vec_item : temp_vec) + { + sparse_image_memory_reqs[n_current_item] = current_temp_vec_item.memoryRequirements; - vkGetImageSparseMemoryRequirements(m_device_ptr->get_device_vk(), - m_image, - &n_reqs, - &sparse_image_memory_reqs[0]); + /* Move on */ + n_current_item++; + } + } + else + { + vkGetImageSparseMemoryRequirements(m_device_ptr->get_device_vk(), + m_image, + &n_reqs, + nullptr); + + anvil_assert(n_reqs >= 1); + sparse_image_memory_reqs.resize(n_reqs); + + vkGetImageSparseMemoryRequirements(m_device_ptr->get_device_vk(), + m_image, + &n_reqs, + &sparse_image_memory_reqs[0]); + } for (const auto& image_memory_req : sparse_image_memory_reqs) { @@ -585,6 +667,12 @@ bool Anvil::Image::init() create_info_ptr->set_mt_safety(Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); + if (use_dedicated_allocation) + { + create_info_ptr->use_dedicated_allocation(nullptr, /* in_opt_buffer_ptr */ + this); + } + memory_block_ptr = Anvil::MemoryBlock::create(std::move(create_info_ptr) ); } @@ -775,11 +863,12 @@ Anvil::Image::~Image() } /* Please see header for specification */ -const VkImage& Anvil::Image::get_image() +const VkImage& Anvil::Image::get_image(const bool& in_bake_memory_if_necessary) { if (m_create_info_ptr->get_type() != Anvil::ImageType::SPARSE_NO_ALLOC) { - if (m_memory_blocks_owned.size() == 0) + if (m_memory_blocks_owned.size() == 0 && + in_bake_memory_if_necessary) { get_memory_block(); } diff --git a/src/wrappers/instance.cpp b/src/wrappers/instance.cpp index 37bb0602..c0e497e6 100644 --- a/src/wrappers/instance.cpp +++ b/src/wrappers/instance.cpp @@ -134,8 +134,12 @@ void Anvil::Instance::destroy() /* Make sure no physical devices are still registered with Object Tracker at this point */ auto object_manager_ptr = Anvil::ObjectTracker::get(); - anvil_assert(object_manager_ptr->get_object_at_index(Anvil::OBJECT_TYPE_PHYSICAL_DEVICE, - 0) == nullptr); + if (object_manager_ptr->get_object_at_index(Anvil::OBJECT_TYPE_INSTANCE, + 0) == nullptr) + { + anvil_assert(object_manager_ptr->get_object_at_index(Anvil::OBJECT_TYPE_PHYSICAL_DEVICE, + 0) == nullptr); + } } #endif } diff --git a/src/wrappers/memory_block.cpp b/src/wrappers/memory_block.cpp index b477ed28..eb46c00d 100644 --- a/src/wrappers/memory_block.cpp +++ b/src/wrappers/memory_block.cpp @@ -178,7 +178,9 @@ Anvil::ExternalHandleUniquePtr Anvil::MemoryBlock::export_to_external_memory_han const bool only_one_handle_ever_permitted = false; #endif - ExternalHandleType result_handle = invalid_handle; + auto memory = get_memory(); + MemoryBlock* parent_memory_block_ptr = nullptr; + ExternalHandleType result_handle = invalid_handle; Anvil::ExternalHandleUniquePtr result_returned_ptr; /* Sanity checks */ @@ -204,18 +206,29 @@ Anvil::ExternalHandleUniquePtr Anvil::MemoryBlock::export_to_external_memory_han if (m_create_info_ptr->get_type() != Anvil::MemoryBlockType::REGULAR) { - anvil_assert(m_create_info_ptr->get_type() == Anvil::MemoryBlockType::REGULAR); + parent_memory_block_ptr = m_create_info_ptr->get_parent_memory_block(); - goto end; + while (parent_memory_block_ptr->get_create_info_ptr()->get_parent_memory_block() != nullptr) + { + parent_memory_block_ptr = parent_memory_block_ptr->get_create_info_ptr()->get_parent_memory_block(); + } + + anvil_assert(m_create_info_ptr->get_type () == Anvil::MemoryBlockType::DERIVED && + m_create_info_ptr->get_start_offset() == 0 && + m_create_info_ptr->get_size () == parent_memory_block_ptr->get_create_info_ptr()->get_size() ); } + else + { + anvil_assert(m_create_info_ptr->get_parent_memory_block() == nullptr); - anvil_assert(m_create_info_ptr->get_parent_memory_block() == nullptr); + parent_memory_block_ptr = this; + } /* Should we try to return a handle which has already been created for this memory block? */ if (only_one_handle_ever_permitted) { - auto map_iterator = m_external_handle_type_to_external_handle.find(in_memory_handle_type); - if (map_iterator != m_external_handle_type_to_external_handle.end() ) + auto map_iterator = parent_memory_block_ptr->m_external_handle_type_to_external_handle.find(in_memory_handle_type); + if (map_iterator != parent_memory_block_ptr->m_external_handle_type_to_external_handle.end() ) { result_returned_ptr = Anvil::ExternalHandleUniquePtr(map_iterator->second.get(), [](Anvil::ExternalHandle*){} ); @@ -234,10 +247,10 @@ Anvil::ExternalHandleUniquePtr Anvil::MemoryBlock::export_to_external_memory_han VkMemoryGetFdInfoKHR info; #endif - anvil_assert(m_memory != VK_NULL_HANDLE); + anvil_assert(memory != VK_NULL_HANDLE); info.handleType = static_cast(Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(in_memory_handle_type) ); - info.memory = m_memory; + info.memory = memory; info.pNext = nullptr; #if defined(_WIN32) @@ -274,7 +287,7 @@ Anvil::ExternalHandleUniquePtr Anvil::MemoryBlock::export_to_external_memory_han result_returned_ptr = Anvil::ExternalHandleUniquePtr(result_owned_ptr.get(), [](Anvil::ExternalHandle*){} ); - m_external_handle_type_to_external_handle[in_memory_handle_type] = std::move(result_owned_ptr); + parent_memory_block_ptr->m_external_handle_type_to_external_handle[in_memory_handle_type] = std::move(result_owned_ptr); } else { @@ -357,17 +370,40 @@ bool Anvil::MemoryBlock::init() Anvil::StructChainer struct_chainer; { - VkMemoryAllocateInfo buffer_data_alloc_info; + VkMemoryAllocateInfo mem_alloc_info; + + mem_alloc_info.allocationSize = m_create_info_ptr->get_size(); + mem_alloc_info.memoryTypeIndex = (m_create_info_ptr->get_imported_external_memory_handle_type() != 0) ? m_create_info_ptr->get_memory_type_index() + : get_device_memory_type_index (m_create_info_ptr->get_allowed_memory_bits(), + m_create_info_ptr->get_memory_features () ); + mem_alloc_info.pNext = nullptr; + mem_alloc_info.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO; - buffer_data_alloc_info.allocationSize = m_create_info_ptr->get_size(); - buffer_data_alloc_info.memoryTypeIndex = get_device_memory_type_index(m_create_info_ptr->get_allowed_memory_bits(), - m_create_info_ptr->get_memory_features () ); - buffer_data_alloc_info.pNext = nullptr; - buffer_data_alloc_info.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO; + m_memory_type_index = mem_alloc_info.memoryTypeIndex; + + struct_chainer.append_struct(mem_alloc_info); + } + + { + Anvil::Buffer* dedicated_allocation_buffer_ptr = nullptr; + Anvil::Image* dedicated_allocation_image_ptr = nullptr; + bool use_dedicated_allocation = false; + + m_create_info_ptr->get_dedicated_allocation_properties(&use_dedicated_allocation, + &dedicated_allocation_buffer_ptr, + &dedicated_allocation_image_ptr); + + if (use_dedicated_allocation) + { + VkMemoryDedicatedAllocateInfoKHR alloc_info; - m_memory_type_index = buffer_data_alloc_info.memoryTypeIndex; + alloc_info.buffer = (dedicated_allocation_buffer_ptr != nullptr) ? dedicated_allocation_buffer_ptr->get_buffer(false) : VK_NULL_HANDLE; + alloc_info.image = (dedicated_allocation_image_ptr != nullptr) ? dedicated_allocation_image_ptr->get_image (false) : VK_NULL_HANDLE; + alloc_info.pNext = nullptr; + alloc_info.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR; - struct_chainer.append_struct(buffer_data_alloc_info); + struct_chainer.append_struct(alloc_info); + } } if (m_create_info_ptr->get_exportable_external_memory_handle_types() != Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE) @@ -380,46 +416,18 @@ bool Anvil::MemoryBlock::init() struct_chainer.append_struct(export_memory_alloc_info); - { - const Anvil::ExternalMemoryHandleImportInfo* handle_import_info_ptr = nullptr; - - if (m_create_info_ptr->get_external_handle_import_info(&handle_import_info_ptr) ) - { - #if defined(_WIN32) - VkImportMemoryWin32HandleInfoKHR handle_info_khr; - #else - VkImportMemoryFdInfoKHR handle_info_khr; - #endif - - handle_info_khr.handleType = static_cast(Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(static_cast(m_create_info_ptr->get_imported_external_memory_handle_type() )) ); - handle_info_khr.pNext = nullptr; - - #if defined(_WIN32) - handle_info_khr.handle = handle_import_info_ptr->handle; - handle_info_khr.name = (handle_import_info_ptr->name.size() > 0) ? handle_import_info_ptr->name.c_str() - : nullptr; - handle_info_khr.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR; - #else - handle_info_khr.fd = handle_import_info_ptr->handle; - handle_info_khr.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR; - #endif - - struct_chainer.append_struct(handle_info_khr); - } - } - #if defined(_WIN32) { - const Anvil::ExternalNTHandleInfo* nt_handle_import_info_ptr = nullptr; + const Anvil::ExternalNTHandleInfo* nt_handle_info_ptr = nullptr; - if (m_create_info_ptr->get_external_nt_handle_import_info(&nt_handle_import_info_ptr) ) + if (m_create_info_ptr->get_exportable_nt_handle_info(&nt_handle_info_ptr) ) { VkExportMemoryWin32HandleInfoKHR handle_info_khr; - handle_info_khr.dwAccess = nt_handle_import_info_ptr->access; - handle_info_khr.name = (nt_handle_import_info_ptr->name.size() > 0) ? nt_handle_import_info_ptr->name.c_str() - : nullptr; - handle_info_khr.pAttributes = nt_handle_import_info_ptr->attributes_ptr; + handle_info_khr.dwAccess = nt_handle_info_ptr->access; + handle_info_khr.name = (nt_handle_info_ptr->name.size() > 0) ? nt_handle_info_ptr->name.c_str() + : nullptr; + handle_info_khr.pAttributes = nt_handle_info_ptr->attributes_ptr; handle_info_khr.pNext = nullptr; handle_info_khr.sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR; @@ -429,6 +437,34 @@ bool Anvil::MemoryBlock::init() #endif } + { + const Anvil::ExternalMemoryHandleImportInfo* handle_import_info_ptr = nullptr; + + if (m_create_info_ptr->get_external_handle_import_info(&handle_import_info_ptr) ) + { + #if defined(_WIN32) + VkImportMemoryWin32HandleInfoKHR handle_info_khr; + #else + VkImportMemoryFdInfoKHR handle_info_khr; + #endif + + handle_info_khr.handleType = static_cast(Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(static_cast(m_create_info_ptr->get_imported_external_memory_handle_type() )) ); + handle_info_khr.pNext = nullptr; + + #if defined(_WIN32) + handle_info_khr.handle = handle_import_info_ptr->handle; + handle_info_khr.name = (handle_import_info_ptr->name.size() > 0) ? handle_import_info_ptr->name.c_str() + : nullptr; + handle_info_khr.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR; + #else + handle_info_khr.fd = handle_import_info_ptr->handle; + handle_info_khr.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR; + #endif + + struct_chainer.append_struct(handle_info_khr); + } + } + { auto chain_ptr = struct_chainer.create_chain(); diff --git a/src/wrappers/physical_device.cpp b/src/wrappers/physical_device.cpp index d998efd8..10ee60d3 100644 --- a/src/wrappers/physical_device.cpp +++ b/src/wrappers/physical_device.cpp @@ -355,6 +355,50 @@ bool Anvil::PhysicalDevice::init() } } + if (m_extension_info_ptr->get_device_extension_info()->ext_vertex_attribute_divisor() ) + { + const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* result_vertex_attribute_divisor_props_struct_ptr = nullptr; + Anvil::StructChainUniquePtr struct_chain_ptr; + Anvil::StructChainer struct_chainer; + Anvil::StructID vertex_attribute_divisor_props_struct_id = UINT32_MAX; + + { + VkPhysicalDeviceProperties2KHR general_props; + + general_props.pNext = nullptr; + general_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; + + struct_chainer.append_struct(general_props); + } + + { + VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT vertex_attribute_divisor_properties; + + vertex_attribute_divisor_properties.pNext = nullptr; + vertex_attribute_divisor_properties.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT); + + vertex_attribute_divisor_props_struct_id = struct_chainer.append_struct(vertex_attribute_divisor_properties); + } + + struct_chain_ptr = struct_chainer.create_chain(); + result_vertex_attribute_divisor_props_struct_ptr = struct_chain_ptr->get_struct_with_id(vertex_attribute_divisor_props_struct_id); + + gpdp2_entrypoints.vkGetPhysicalDeviceProperties2KHR(m_physical_device, + struct_chain_ptr->get_root_struct() ); + + m_ext_vertex_attribute_divisor_properties_ptr.reset( + new EXTVertexAttributeDivisorProperties(*result_vertex_attribute_divisor_props_struct_ptr) + ); + + if (m_ext_vertex_attribute_divisor_properties_ptr == nullptr) + { + anvil_assert(m_ext_vertex_attribute_divisor_properties_ptr != nullptr); + + result = false; + goto end; + } + } + if (m_extension_info_ptr->get_device_extension_info()->khr_maintenance3() ) { Anvil::StructID maintenance3_struct_id = UINT32_MAX; @@ -422,6 +466,7 @@ bool Anvil::PhysicalDevice::init() m_properties = Anvil::PhysicalDeviceProperties(m_amd_shader_core_properties_ptr.get (), m_core_properties_vk10_ptr.get (), m_ext_descriptor_indexing_properties_ptr.get (), + m_ext_vertex_attribute_divisor_properties_ptr.get (), m_khr_external_memory_capabilities_physical_device_id_properties_ptr.get(), m_khr_maintenance3_properties_ptr.get () ); @@ -497,8 +542,8 @@ bool Anvil::PhysicalDevice::init() return result; } -bool Anvil::PhysicalDevice::get_buffer_format_properties(const Anvil::BufferFormatPropertiesQuery& in_query, - Anvil::BufferFormatProperties* out_opt_result_ptr) const +bool Anvil::PhysicalDevice::get_buffer_properties(const Anvil::BufferPropertiesQuery& in_query, + Anvil::BufferProperties* out_opt_result_ptr) const { const Anvil::ExtensionKHRExternalMemoryCapabilitiesEntrypoints* emc_entrypoints_ptr = nullptr; VkPhysicalDeviceExternalBufferInfoKHR input_struct; @@ -531,7 +576,7 @@ bool Anvil::PhysicalDevice::get_buffer_format_properties(const Anvil::BufferForm if (out_opt_result_ptr != nullptr) { - *out_opt_result_ptr = std::move(Anvil::BufferFormatProperties(ExternalMemoryProperties(result_struct.externalMemoryProperties) )); + *out_opt_result_ptr = std::move(Anvil::BufferProperties(ExternalMemoryProperties(result_struct.externalMemoryProperties) )); } /* All done */ @@ -611,16 +656,20 @@ bool Anvil::PhysicalDevice::get_image_format_properties(const ImageFormatPropert } /* Retrieve core VK1.0 information first. */ - vkGetPhysicalDeviceFormatProperties (m_physical_device, - in_query.format, - &core_vk10_format_props); - vkGetPhysicalDeviceImageFormatProperties(m_physical_device, - in_query.format, - in_query.image_type, - in_query.tiling, - in_query.usage_flags, - in_query.create_flags, - &core_vk10_image_format_properties); + vkGetPhysicalDeviceFormatProperties(m_physical_device, + in_query.format, + &core_vk10_format_props); + + if (vkGetPhysicalDeviceImageFormatProperties(m_physical_device, + in_query.format, + in_query.image_type, + in_query.tiling, + in_query.usage_flags, + in_query.create_flags, + &core_vk10_image_format_properties) != VK_SUCCESS) + { + goto end; + } if (gpdp2_entrypoints_ptr != nullptr) { diff --git a/src/wrappers/queue.cpp b/src/wrappers/queue.cpp index 732de37d..184d1cfd 100644 --- a/src/wrappers/queue.cpp +++ b/src/wrappers/queue.cpp @@ -634,7 +634,7 @@ void Anvil::Queue::present_lock_unlock(uint32_t in_n_swapc } /** Please see header for specification */ -void Anvil::Queue::submit(const Anvil::SubmitInfo& in_submit_info) +bool Anvil::Queue::submit(const Anvil::SubmitInfo& in_submit_info) { Anvil::Fence* fence_ptr (in_submit_info.get_fence() ); bool needs_fence_reset(false); @@ -772,9 +772,7 @@ void Anvil::Queue::submit(const Anvil::SubmitInfo& in_submit_info) 1, /* fenceCount */ fence_ptr->get_fence_ptr(), VK_TRUE, /* waitAll */ - UINT64_MAX); /* timeout */ - - anvil_assert_vk_call_succeeded(result); + in_submit_info.get_timeout() ); } } @@ -800,7 +798,7 @@ void Anvil::Queue::submit(const Anvil::SubmitInfo& in_submit_info) } } - anvil_assert_vk_call_succeeded(result); + return (result == VK_SUCCESS); } void Anvil::Queue::submit_command_buffers_lock_unlock(uint32_t in_n_command_buffers, diff --git a/src/wrappers/semaphore.cpp b/src/wrappers/semaphore.cpp index c667b1b5..9e259e98 100644 --- a/src/wrappers/semaphore.cpp +++ b/src/wrappers/semaphore.cpp @@ -326,6 +326,30 @@ bool Anvil::Semaphore::reset() struct_chainer.append_struct(create_info); } + #if defined(_WIN32) + { + const Anvil::ExternalNTHandleInfo* nt_handle_info_ptr = nullptr; + + if (m_create_info_ptr->get_exportable_nt_handle_info(&nt_handle_info_ptr) ) + { + VkExportSemaphoreWin32HandleInfoKHR handle_info; + + anvil_assert( nt_handle_info_ptr != nullptr); + anvil_assert((m_create_info_ptr->get_exportable_external_semaphore_handle_types() & Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT) || + (m_create_info_ptr->get_exportable_external_semaphore_handle_types() & Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) ); + + handle_info.dwAccess = nt_handle_info_ptr->access; + handle_info.name = (nt_handle_info_ptr->name.size() > 0) ? &nt_handle_info_ptr->name.at(0) + : nullptr; + handle_info.pAttributes = nt_handle_info_ptr->attributes_ptr; + handle_info.pNext = nullptr; + handle_info.sType = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR; + + struct_chainer.append_struct(handle_info); + } + } + #endif + struct_chain_ptr = struct_chainer.create_chain(); if (struct_chain_ptr == nullptr) { From db74a0a25cb1338ef356e354a30b719eb0cd34ac Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Mon, 20 Aug 2018 13:28:24 +0200 Subject: [PATCH 17/50] Fix an issue where gfx pipeline create info structs would be malformed if not all attachments had image views bound. Fix an issue where memory ranges would not be aligned to required boundaries at invalidation / flush time --- include/misc/buffer_create_info.h | 9 +++++ include/misc/render_pass_create_info.h | 10 +++++ include/misc/types_struct.h | 2 + include/wrappers/command_buffer.h | 2 +- src/misc/render_pass_create_info.cpp | 44 ++++++++++++++++++++-- src/misc/types_struct.cpp | 25 ++++++++++++ src/wrappers/graphics_pipeline_manager.cpp | 40 ++++++++++++-------- src/wrappers/memory_block.cpp | 30 ++++++++++++--- src/wrappers/pipeline_layout.cpp | 2 +- 9 files changed, 138 insertions(+), 26 deletions(-) diff --git a/include/misc/buffer_create_info.h b/include/misc/buffer_create_info.h index 0801f803..19cde495 100644 --- a/include/misc/buffer_create_info.h +++ b/include/misc/buffer_create_info.h @@ -212,6 +212,15 @@ namespace Anvil return m_usage_flags; } + /** Use to specify contents which should be uploaded to a buffer at memory block assignment time. + * + * Note that this setting will be ignored for partially-resident buffers. + * + * The specified pointer must remain valid until Buffer::set_nonsparse_memory() call time. + * + * @param in_client_data_ptr Pointer to data storage holding contents the created buffer should be filled with. + * Must remain valid until memory block assignment time. + */ void set_client_data(const void* const in_client_data_ptr) { m_client_data_ptr = in_client_data_ptr; diff --git a/include/misc/render_pass_create_info.h b/include/misc/render_pass_create_info.h index 76bc5331..ae91e27a 100644 --- a/include/misc/render_pass_create_info.h +++ b/include/misc/render_pass_create_info.h @@ -377,6 +377,16 @@ namespace Anvil return m_device_ptr; } + /* Returns the largest location assigned to color attachments for the specified subpass. + * + * If no color attachments have been defined for the queried subpass, UINT32_MAX is returned. + * + * @param in_subpass_id ID of the subpass to use for the query. + * + * @return As per description. + **/ + uint32_t get_max_color_location_used_by_subpass(const SubPassID& in_subpass_id) const; + /** Returns the number of added attachments */ uint32_t get_n_attachments() const { diff --git a/include/misc/types_struct.h b/include/misc/types_struct.h index 42900f2f..6da2fa14 100644 --- a/include/misc/types_struct.h +++ b/include/misc/types_struct.h @@ -731,6 +731,8 @@ namespace Anvil return &image_barrier_vk; } + bool operator==(const ImageBarrier& in_barrier) const; + private: ImageBarrier& operator=(const ImageBarrier&); } ImageBarrier; diff --git a/include/wrappers/command_buffer.h b/include/wrappers/command_buffer.h index 9d540765..5ea2cfaa 100644 --- a/include/wrappers/command_buffer.h +++ b/include/wrappers/command_buffer.h @@ -481,7 +481,7 @@ namespace Anvil * Calling this function for a command buffer which has not been put into a recording mode * (by issuing a start_recording() call earlier) will result in an assertion failure. * - * It is also illegal to call this function when not recording renderpass commands. Doing so + * It is also illegal to call this function when recording renderpass commands. Doing so * will also result in an assertion failure. * * Any Vulkan object wrapper instances passed to this function are going to be retained, diff --git a/src/misc/render_pass_create_info.cpp b/src/misc/render_pass_create_info.cpp index 975e63a8..ea0bb8e6 100644 --- a/src/misc/render_pass_create_info.cpp +++ b/src/misc/render_pass_create_info.cpp @@ -25,6 +25,9 @@ #include #include +#if defined(max) + #undef max +#endif Anvil::RenderPassCreateInfo::RenderPassCreateInfo(const Anvil::BaseDevice* in_device_ptr) :m_device_ptr (in_device_ptr), @@ -715,6 +718,31 @@ bool Anvil::RenderPassCreateInfo::get_depth_stencil_attachment_properties(Render return result; } +/* Please see header for specification */ +uint32_t Anvil::RenderPassCreateInfo::get_max_color_location_used_by_subpass(const SubPassID& in_subpass_id) const +{ + uint32_t result = UINT32_MAX; + auto subpass_iterator = (m_subpasses.size() > in_subpass_id) ? m_subpasses.begin() + in_subpass_id : m_subpasses.end(); + + if (subpass_iterator == m_subpasses.end() ) + { + anvil_assert(subpass_iterator != m_subpasses.end() ); + + goto end; + } + + result = 0; + + for (const auto& current_color_attachment_data : (*subpass_iterator)->color_attachments_map) + { + result = std::max(result, + current_color_attachment_data.first); + } + +end: + return result; +} + /* Please see header for specification */ bool Anvil::RenderPassCreateInfo::get_subpass_n_attachments(SubPassID in_subpass_id, AttachmentType in_attachment_type, @@ -809,12 +837,22 @@ bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID : (in_attachment_type == ATTACHMENT_TYPE_INPUT) ? &subpass_ptr->input_attachments_map : &subpass_ptr->resolved_attachments_map; - auto iterator = subpass_attachments_ptr->find(in_n_subpass_attachment); + auto iterator = subpass_attachments_ptr->begin(); - if (iterator == subpass_attachments_ptr->end() ) + for (uint32_t n_key = 0; + n_key < in_n_subpass_attachment; + ++n_key) { - anvil_assert_fail(); + if (iterator == subpass_attachments_ptr->end() ) + { + goto end; + } + + iterator ++; + } + if (iterator == subpass_attachments_ptr->end() ) + { goto end; } diff --git a/src/misc/types_struct.cpp b/src/misc/types_struct.cpp index 6e6066b2..f10806a0 100644 --- a/src/misc/types_struct.cpp +++ b/src/misc/types_struct.cpp @@ -745,6 +745,7 @@ Anvil::ImageFormatProperties::ImageFormatProperties(const VkImageFormatPropertie /** Please see header for specification */ Anvil::ImageBarrier::ImageBarrier(const ImageBarrier& in) { + by_region = in.by_region; dst_access_mask = in.dst_access_mask; dst_queue_family_index = in.dst_queue_family_index; image = in.image; @@ -805,6 +806,30 @@ Anvil::ImageBarrier::~ImageBarrier() /* Stub */ } +bool Anvil::ImageBarrier::operator==(const ImageBarrier& in_barrier) const +{ + bool result = true; + + result &= (dst_access_mask == in_barrier.dst_access_mask); + result &= (src_access_mask == in_barrier.src_access_mask); + + result &= (by_region == in_barrier.by_region); + result &= (dst_queue_family_index == in_barrier.dst_queue_family_index); + result &= (image == in_barrier.image); + result &= (image_ptr == in_barrier.image_ptr); + result &= (new_layout == in_barrier.new_layout); + result &= (old_layout == in_barrier.old_layout); + result &= (src_queue_family_index == in_barrier.src_queue_family_index); + + result &= (subresource_range.aspectMask == in_barrier.subresource_range.aspectMask); + result &= (subresource_range.baseArrayLayer == in_barrier.subresource_range.baseArrayLayer); + result &= (subresource_range.baseMipLevel == in_barrier.subresource_range.baseMipLevel); + result &= (subresource_range.layerCount == in_barrier.subresource_range.layerCount); + result &= (subresource_range.levelCount == in_barrier.subresource_range.levelCount); + + return result; +} + Anvil::KHR16BitStorageFeatures::KHR16BitStorageFeatures() { is_input_output_storage_supported = false; diff --git a/src/wrappers/graphics_pipeline_manager.cpp b/src/wrappers/graphics_pipeline_manager.cpp index 7371c8fe..9626a4f3 100644 --- a/src/wrappers/graphics_pipeline_manager.cpp +++ b/src/wrappers/graphics_pipeline_manager.cpp @@ -240,15 +240,18 @@ bool Anvil::GraphicsPipelineManager::bake() VkPipelineColorBlendStateCreateInfo color_blend_state_create_info; VkLogicOp logic_op; bool logic_op_enabled = false; + uint32_t max_location_index = UINT32_MAX; const uint32_t start_offset = static_cast(color_blend_attachment_states_vk_cache.size() ); + max_location_index = current_pipeline_renderpass_ptr->get_render_pass_create_info()->get_max_color_location_used_by_subpass(current_pipeline_subpass_id); + current_pipeline_create_info_ptr->get_blending_properties(&blend_constant_ptr, nullptr); /* out_opt_n_blend_attachments_ptr */ current_pipeline_create_info_ptr->get_logic_op_state(&logic_op_enabled, &logic_op); - color_blend_state_create_info.attachmentCount = subpass_n_color_attachments; + color_blend_state_create_info.attachmentCount = max_location_index + 1; color_blend_state_create_info.flags = 0; color_blend_state_create_info.logicOp = logic_op; color_blend_state_create_info.logicOpEnable = (logic_op_enabled) ? VK_TRUE : VK_FALSE; @@ -260,24 +263,33 @@ bool Anvil::GraphicsPipelineManager::bake() blend_constant_ptr, sizeof(color_blend_state_create_info.blendConstants) ); + anvil_assert(subpass_n_color_attachments <= current_pipeline_renderpass_ptr->get_render_pass_create_info()->get_n_attachments() ); + for (uint32_t n_subpass_color_attachment = 0; - n_subpass_color_attachment < subpass_n_color_attachments; + n_subpass_color_attachment <= max_location_index; ++n_subpass_color_attachment) { color_blend_attachment_states_vk_cache.push_back(VkPipelineColorBlendAttachmentState() ); VkPipelineColorBlendAttachmentState* blend_attachment_state_ptr = &color_blend_attachment_states_vk_cache.back(); + VkImageLayout dummy = VK_IMAGE_LAYOUT_MAX_ENUM; bool is_blending_enabled_for_attachment = false; - - if (!current_pipeline_create_info_ptr->get_color_blend_attachment_properties(n_subpass_color_attachment, - &is_blending_enabled_for_attachment, - &blend_attachment_state_ptr->colorBlendOp, - &blend_attachment_state_ptr->alphaBlendOp, - &blend_attachment_state_ptr->srcColorBlendFactor, - &blend_attachment_state_ptr->dstColorBlendFactor, - &blend_attachment_state_ptr->srcAlphaBlendFactor, - &blend_attachment_state_ptr->dstAlphaBlendFactor, - &blend_attachment_state_ptr->colorWriteMask) ) + Anvil::RenderPassAttachmentID rp_attachment_id = UINT32_MAX; + + if (!current_pipeline_renderpass_ptr->get_render_pass_create_info()->get_subpass_attachment_properties(current_pipeline_subpass_id, + Anvil::ATTACHMENT_TYPE_COLOR, + n_subpass_color_attachment, + &rp_attachment_id, + &dummy) || /* out_layout_ptr */ + !current_pipeline_create_info_ptr->get_color_blend_attachment_properties (rp_attachment_id, + &is_blending_enabled_for_attachment, + &blend_attachment_state_ptr->colorBlendOp, + &blend_attachment_state_ptr->alphaBlendOp, + &blend_attachment_state_ptr->srcColorBlendFactor, + &blend_attachment_state_ptr->dstColorBlendFactor, + &blend_attachment_state_ptr->srcAlphaBlendFactor, + &blend_attachment_state_ptr->dstAlphaBlendFactor, + &blend_attachment_state_ptr->colorWriteMask) ) { /* The user has not defined blending properties for current color attachment. Use default state values .. */ blend_attachment_state_ptr->blendEnable = VK_FALSE; @@ -294,9 +306,7 @@ bool Anvil::GraphicsPipelineManager::bake() } else { - anvil_assert(is_blending_enabled_for_attachment); - - blend_attachment_state_ptr->blendEnable = VK_TRUE; + blend_attachment_state_ptr->blendEnable = (is_blending_enabled_for_attachment) ? VK_TRUE : VK_FALSE; } } diff --git a/src/wrappers/memory_block.cpp b/src/wrappers/memory_block.cpp index eb46c00d..7050bd5f 100644 --- a/src/wrappers/memory_block.cpp +++ b/src/wrappers/memory_block.cpp @@ -656,17 +656,26 @@ bool Anvil::MemoryBlock::read(VkDeviceSize in_start_offset, if ((m_create_info_ptr->get_memory_features() & Anvil::MEMORY_FEATURE_FLAG_HOST_COHERENT) == 0) { VkMappedMemoryRange mapped_memory_range; - VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); + const auto mem_block_size = m_create_info_ptr->get_size(); + const auto non_coherent_atom_size = m_create_info_ptr->get_device()->get_physical_device_properties().core_vk1_0_properties_ptr->limits.non_coherent_atom_size; + VkResult result_vk = VK_ERROR_INITIALIZATION_FAILED; anvil_assert (m_start_offset == 0); ANVIL_REDUNDANT_VARIABLE(result_vk); mapped_memory_range.memory = m_memory; - mapped_memory_range.offset = in_start_offset; + mapped_memory_range.offset = Anvil::Utils::round_down(in_start_offset, + non_coherent_atom_size); mapped_memory_range.pNext = nullptr; - mapped_memory_range.size = in_size; + mapped_memory_range.size = Anvil::Utils::round_up(in_size, + non_coherent_atom_size); mapped_memory_range.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE; + if (mapped_memory_range.size + mapped_memory_range.offset > mem_block_size) + { + mapped_memory_range.size = mem_block_size - mapped_memory_range.offset; + } + result_vk = vkInvalidateMappedMemoryRanges(m_create_info_ptr->get_device()->get_device_vk(), 1, /* memRangeCount */ &mapped_memory_range); @@ -746,16 +755,25 @@ bool Anvil::MemoryBlock::write(VkDeviceSize in_start_offset, if ((m_create_info_ptr->get_memory_features() & Anvil::MEMORY_FEATURE_FLAG_HOST_COHERENT) == 0) { VkMappedMemoryRange mapped_memory_range; - VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); + const auto mem_block_size = m_create_info_ptr->get_size(); + const auto non_coherent_atom_size = m_create_info_ptr->get_device()->get_physical_device_properties().core_vk1_0_properties_ptr->limits.non_coherent_atom_size; + auto result_vk = VkResult(VK_ERROR_INITIALIZATION_FAILED); ANVIL_REDUNDANT_VARIABLE(result_vk); mapped_memory_range.memory = m_memory; - mapped_memory_range.offset = in_start_offset; + mapped_memory_range.offset = Anvil::Utils::round_down(in_start_offset, + non_coherent_atom_size); mapped_memory_range.pNext = nullptr; - mapped_memory_range.size = in_size; + mapped_memory_range.size = Anvil::Utils::round_up(in_size, + non_coherent_atom_size); mapped_memory_range.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE; + if (mapped_memory_range.size + mapped_memory_range.offset > mem_block_size) + { + mapped_memory_range.size = mem_block_size - mapped_memory_range.offset; + } + result_vk = vkFlushMappedMemoryRanges(m_create_info_ptr->get_device()->get_device_vk(), 1, /* memRangeCount */ &mapped_memory_range); diff --git a/src/wrappers/pipeline_layout.cpp b/src/wrappers/pipeline_layout.cpp index 10f47052..a73bb457 100644 --- a/src/wrappers/pipeline_layout.cpp +++ b/src/wrappers/pipeline_layout.cpp @@ -74,7 +74,7 @@ bool Anvil::PipelineLayout::bake(const std::vectorget_dummy_descriptor_set_layout()->get_layout(); - ds_layouts_vk.resize(in_ds_create_info_items_ptr->size() + 1, + ds_layouts_vk.resize(in_ds_create_info_items_ptr->size(), dummy_ds_layout); if (in_ds_create_info_items_ptr != nullptr && From 6d723dc8df708add4605dd981431ef719bbd60b8 Mon Sep 17 00:00:00 2001 From: Arkadiusz Sarwa Date: Tue, 4 Sep 2018 14:46:47 -0700 Subject: [PATCH 18/50] Fix warn: potentially uninitialized variable used --- src/wrappers/image.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wrappers/image.cpp b/src/wrappers/image.cpp index 744ec7b7..aefbdbbb 100644 --- a/src/wrappers/image.cpp +++ b/src/wrappers/image.cpp @@ -880,7 +880,7 @@ const VkImage& Anvil::Image::get_image(const bool& in_bake_memory_if_necessary) /* Please see header for specification */ VkExtent2D Anvil::Image::get_image_extent_2D(uint32_t in_n_mipmap) const { - VkExtent2D result; + VkExtent2D result = { 0u, 0u }; uint32_t size[2]; if (!get_image_mipmap_size(in_n_mipmap, @@ -903,7 +903,7 @@ VkExtent2D Anvil::Image::get_image_extent_2D(uint32_t in_n_mipmap) const /* Please see header for specification */ VkExtent3D Anvil::Image::get_image_extent_3D(uint32_t in_n_mipmap) const { - VkExtent3D result; + VkExtent3D result = { 0u, 0u, 0u }; uint32_t size[3]; if (!get_image_mipmap_size(in_n_mipmap, From eda1c68b4e4ab3f7e21dfb58ebb0613ac3a091a0 Mon Sep 17 00:00:00 2001 From: Arkadiusz Sarwa Date: Wed, 5 Sep 2018 01:24:38 -0700 Subject: [PATCH 19/50] Cmake ANVIL_LINK_EXAMPLES include examples Alvin --- CMakeLists.txt | 10 ++++++++++ examples/DynamicBuffers/CMakeLists.txt | 6 ++++-- examples/MultiViewport/CMakeLists.txt | 10 ++++++---- examples/OcclusionQuery/CMakeLists.txt | 12 +++++++----- examples/OutOfOrderRasterization/CMakeLists.txt | 4 +++- examples/PushConstants/CMakeLists.txt | 4 +++- 6 files changed, 33 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 410ddcbf..14d86e31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ project (Anvil) option(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT "Includes 32-/64-bit Windows window system support (Windows builds only)" ON) option(ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT "Includes XCB window system support (Linux builds only)" ON) option(ANVIL_LINK_WITH_GLSLANG "Links with glslang, instead of spawning a new process whenever GLSL->SPIR-V conversion is required" ON) +option(ANVIL_LINK_EXAMPLES "Build examples showing how to use Anvil" OFF) # Do not modify anything after this line, unless you know what you're doing. @@ -238,6 +239,15 @@ if (ANVIL_LINK_WITH_GLSLANG) endif() endif() + +if (ANVIL_LINK_EXAMPLES) + add_subdirectory("examples/DynamicBuffers") + add_subdirectory("examples/MultiViewport") + add_subdirectory("examples/OcclusionQuery") + add_subdirectory("examples/OutOfOrderRasterization") + add_subdirectory("examples/PushConstants") +endif() + # Enable level-4 warnings if (MSVC) ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS) diff --git a/examples/DynamicBuffers/CMakeLists.txt b/examples/DynamicBuffers/CMakeLists.txt index 1b6cfcec..3097ea3c 100644 --- a/examples/DynamicBuffers/CMakeLists.txt +++ b/examples/DynamicBuffers/CMakeLists.txt @@ -16,12 +16,14 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") endif() endif() -add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") +if (NOT ANVIL_LINK_EXAMPLES) + add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") +endif() target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") include_directories(${Anvil_SOURCE_DIR}/include - ${DynamicBuffers_SOURCE_DIR}/include) + ${DynamicBuffers_SOURCE_DIR}/include) # Include the Vulkan header. if (WIN32) diff --git a/examples/MultiViewport/CMakeLists.txt b/examples/MultiViewport/CMakeLists.txt index 00bca137..6ceeddc0 100644 --- a/examples/MultiViewport/CMakeLists.txt +++ b/examples/MultiViewport/CMakeLists.txt @@ -16,13 +16,12 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") endif() endif() -add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") +if (NOT ANVIL_LINK_EXAMPLES) + add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") +endif() target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") -include_directories(${Anvil_SOURCE_DIR}/include - ${MultiViewport_SOURCE_DIR}/include) - if (WIN32) include_directories($ENV{VK_SDK_PATH}/Include $ENV{VULKAN_SDK}/Include) @@ -47,6 +46,9 @@ else() $ENV{VULKAN_SDK}/x86_64/lib) endif() +include_directories(${Anvil_SOURCE_DIR}/include + ${MultiViewport_SOURCE_DIR}/include) + # Create the MultiViewport project. add_executable (MultiViewport include/app.h include/app.h diff --git a/examples/OcclusionQuery/CMakeLists.txt b/examples/OcclusionQuery/CMakeLists.txt index ce75cf22..6600ed10 100644 --- a/examples/OcclusionQuery/CMakeLists.txt +++ b/examples/OcclusionQuery/CMakeLists.txt @@ -16,13 +16,12 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") endif() endif() -add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") +if (NOT ANVIL_LINK_EXAMPLES) + add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") +endif() target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") -include_directories(${Anvil_SOURCE_DIR}/include - ${OcclusionQuery_SOURCE_DIR}/include) - # Include the Vulkan header. if (WIN32) include_directories($ENV{VK_SDK_PATH}/Include @@ -46,7 +45,10 @@ else() link_directories ($ENV{VK_SDK_PATH}/x86_64/lib $ENV{VULKAN_SDK}/lib $ENV{VULKAN_SDK}/x86_64/lib) -endif() +endif() + +include_directories(${Anvil_SOURCE_DIR}/include + ${OcclusionQuery_SOURCE_DIR}/include) # Create the OcclusionQuery project. add_executable (OcclusionQuery include/app.h diff --git a/examples/OutOfOrderRasterization/CMakeLists.txt b/examples/OutOfOrderRasterization/CMakeLists.txt index a180516d..4bc86d0c 100644 --- a/examples/OutOfOrderRasterization/CMakeLists.txt +++ b/examples/OutOfOrderRasterization/CMakeLists.txt @@ -16,7 +16,9 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") endif() endif() -add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") +if (NOT ANVIL_LINK_EXAMPLES) + add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") +endif() target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") diff --git a/examples/PushConstants/CMakeLists.txt b/examples/PushConstants/CMakeLists.txt index f178ad04..8c319c92 100644 --- a/examples/PushConstants/CMakeLists.txt +++ b/examples/PushConstants/CMakeLists.txt @@ -16,7 +16,9 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") endif() endif() -add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") +if (NOT ANVIL_LINK_EXAMPLES) + add_subdirectory (../.. "${CMAKE_CURRENT_BINARY_DIR}/anvil") +endif() target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") From 58d54b6f7599a439ccf3255ccc80170b611a5cb3 Mon Sep 17 00:00:00 2001 From: Arkadiusz Sarwa Date: Wed, 5 Sep 2018 03:59:20 -0700 Subject: [PATCH 20/50] Fix round_up arguments cast --- examples/DynamicBuffers/src/app.cpp | 2 +- examples/OcclusionQuery/src/app.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/DynamicBuffers/src/app.cpp b/examples/DynamicBuffers/src/app.cpp index e64174c8..935df367 100644 --- a/examples/DynamicBuffers/src/app.cpp +++ b/examples/DynamicBuffers/src/app.cpp @@ -478,7 +478,7 @@ void App::init_buffers() /* We also need some space for a uniform block which is going to hold time info. */ const auto dynamic_ub_alignment_requirement = m_device_ptr->get_physical_device_properties().core_vk1_0_properties_ptr->limits.min_uniform_buffer_offset_alignment; - const auto sine_props_data_buffer_size_per_swapchain_image = Anvil::Utils::round_up(sizeof(float), + const auto sine_props_data_buffer_size_per_swapchain_image = Anvil::Utils::round_up(static_cast(sizeof(float)), dynamic_ub_alignment_requirement); const auto sine_props_data_buffer_size_total = sine_props_data_buffer_size_per_swapchain_image * N_SWAPCHAIN_IMAGES; diff --git a/examples/OcclusionQuery/src/app.cpp b/examples/OcclusionQuery/src/app.cpp index 56fd9789..0e230a5e 100644 --- a/examples/OcclusionQuery/src/app.cpp +++ b/examples/OcclusionQuery/src/app.cpp @@ -346,9 +346,9 @@ void App::init_buffers() { const VkDeviceSize uniform_alignment_req(m_physical_device_ptr->get_device_properties().core_vk1_0_properties_ptr->limits.min_uniform_buffer_offset_alignment); - m_n_bytes_per_query = static_cast(Anvil::Utils::round_up(sizeof(uint32_t), + m_n_bytes_per_query = static_cast(Anvil::Utils::round_up(static_cast(sizeof(uint32_t)), uniform_alignment_req) ); - m_time_n_bytes_per_swapchain_image = static_cast(Anvil::Utils::round_up(sizeof(float), + m_time_n_bytes_per_swapchain_image = static_cast(Anvil::Utils::round_up(static_cast(sizeof(float)), uniform_alignment_req) ); { From 7b85c6c9b362dd84dacb46001a8485116e9ad641 Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Tue, 18 Sep 2018 17:30:36 +0200 Subject: [PATCH 21/50] Week38 update Add support for VK_KHR_device_group Add support for VK_KHR_device_group_creation Add support for VK_KHR_maintenance2 Add support for VK_KHR_shader_draw_parameters Various bug-fixes and improvements (also addresses #84) Move away from VK enums to Anvil-level enum classes and enums where appropriate. This is WIP, done in order to improve understanding of which flags are recognized by Anvil and which are not. --- examples/DynamicBuffers/include/app.h | 2 +- examples/DynamicBuffers/src/app.cpp | 87 +- examples/MultiViewport/CMakeLists.txt | 3 + examples/MultiViewport/include/app.h | 6 +- examples/MultiViewport/src/app.cpp | 55 +- examples/OcclusionQuery/CMakeLists.txt | 3 + examples/OcclusionQuery/include/app.h | 2 +- examples/OcclusionQuery/src/app.cpp | 73 +- .../OutOfOrderRasterization/include/app.h | 22 +- examples/OutOfOrderRasterization/src/app.cpp | 204 ++-- examples/PushConstants/include/app.h | 6 +- examples/PushConstants/src/app.cpp | 39 +- include/misc/buffer_create_info.h | 41 +- include/misc/buffer_view_create_info.h | 10 +- include/misc/extensions.h | 41 +- include/misc/formats.h | 82 +- include/misc/graphics_pipeline_create_info.h | 39 +- include/misc/image_create_info.h | 217 ++-- include/misc/image_view_create_info.h | 168 +-- .../misc/memalloc_backends/backend_oneshot.h | 1 + include/misc/memalloc_backends/backend_vma.h | 1 + include/misc/memory_allocator.h | 161 ++- include/misc/memory_block_create_info.h | 26 + include/misc/render_pass_create_info.h | 315 +++-- include/misc/struct_chainer.h | 14 + include/misc/swapchain_create_info.h | 63 +- include/misc/types.h | 108 +- include/misc/types_classes.h | 39 +- include/misc/types_enums.h | 414 ++++++- include/misc/types_macro.h | 281 ++--- include/misc/types_struct.h | 509 +++++--- include/misc/types_utils.h | 20 +- include/misc/window.h | 2 +- include/wrappers/buffer.h | 99 +- include/wrappers/command_buffer.h | 234 +++- include/wrappers/descriptor_set.h | 68 +- include/wrappers/device.h | 246 +++- include/wrappers/graphics_pipeline_manager.h | 3 + include/wrappers/image.h | 162 ++- include/wrappers/instance.h | 48 +- include/wrappers/memory_block.h | 42 +- include/wrappers/physical_device.h | 40 +- include/wrappers/queue.h | 130 +- include/wrappers/rendering_surface.h | 33 +- include/wrappers/swapchain.h | 10 +- src/misc/buffer_create_info.cpp | 20 +- src/misc/buffer_view_create_info.cpp | 4 +- src/misc/dummy_window.cpp | 39 +- src/misc/formats.cpp | 917 +++++++------- src/misc/glsl_to_spirv.cpp | 8 +- src/misc/graphics_pipeline_create_info.cpp | 106 +- src/misc/image_create_info.cpp | 147 ++- src/misc/image_view_create_info.cpp | 125 +- .../memalloc_backends/backend_oneshot.cpp | 187 ++- src/misc/memalloc_backends/backend_vma.cpp | 20 + src/misc/memory_allocator.cpp | 333 ++++-- src/misc/memory_block_create_info.cpp | 58 +- src/misc/render_pass_create_info.cpp | 137 ++- src/misc/swapchain_create_info.cpp | 45 +- src/misc/types_classes.cpp | 130 +- src/misc/types_struct.cpp | 384 ++++-- src/misc/types_utils.cpp | 128 +- src/wrappers/buffer.cpp | 593 ++++++--- src/wrappers/buffer_view.cpp | 2 +- src/wrappers/command_buffer.cpp | 394 +++++- src/wrappers/compute_pipeline_manager.cpp | 5 + src/wrappers/descriptor_set.cpp | 36 +- src/wrappers/device.cpp | 871 ++++++++++++-- src/wrappers/graphics_pipeline_manager.cpp | 64 +- src/wrappers/image.cpp | 1058 +++++++++++++++-- src/wrappers/image_view.cpp | 36 +- src/wrappers/instance.cpp | 101 +- src/wrappers/memory_block.cpp | 50 +- src/wrappers/physical_device.cpp | 191 ++- src/wrappers/queue.cpp | 547 ++++++++- src/wrappers/render_pass.cpp | 113 +- src/wrappers/rendering_surface.cpp | 103 +- src/wrappers/swapchain.cpp | 236 +++- 78 files changed, 8331 insertions(+), 3026 deletions(-) diff --git a/examples/DynamicBuffers/include/app.h b/examples/DynamicBuffers/include/app.h index e1c4ac1c..53ce2370 100644 --- a/examples/DynamicBuffers/include/app.h +++ b/examples/DynamicBuffers/include/app.h @@ -66,7 +66,7 @@ class App uint32_t* out_opt_offset_data_offset_ptr = nullptr); /* Private variables */ - Anvil::SGPUDeviceUniquePtr m_device_ptr; + Anvil::BaseDeviceUniquePtr m_device_ptr; Anvil::InstanceUniquePtr m_instance_ptr; const Anvil::PhysicalDevice* m_physical_device_ptr; Anvil::Queue* m_present_queue_ptr; diff --git a/examples/DynamicBuffers/src/app.cpp b/examples/DynamicBuffers/src/app.cpp index 935df367..5cfd1f79 100644 --- a/examples/DynamicBuffers/src/app.cpp +++ b/examples/DynamicBuffers/src/app.cpp @@ -423,8 +423,8 @@ void App::init_buffers() auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), m_sine_offset_data_buffer_size, Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_CONCURRENT, - VK_BUFFER_USAGE_STORAGE_BUFFER_BIT); + Anvil::SharingMode::CONCURRENT, + Anvil::BUFFER_USAGE_FLAG_STORAGE_BUFFER_BIT); m_sine_offset_data_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -465,8 +465,8 @@ void App::init_buffers() auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), m_sine_data_buffer_size, Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_CONCURRENT, - VK_BUFFER_USAGE_STORAGE_BUFFER_BIT); + Anvil::SharingMode::CONCURRENT, + Anvil::BUFFER_USAGE_FLAG_STORAGE_BUFFER_BIT); m_sine_data_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -488,8 +488,8 @@ void App::init_buffers() auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), sine_props_data_buffer_size_total, Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_CONCURRENT, - VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT); + Anvil::SharingMode::CONCURRENT, + Anvil::BUFFER_USAGE_FLAG_UNIFORM_BUFFER_BIT); m_sine_props_data_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -526,8 +526,8 @@ void App::init_buffers() auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), m_sine_color_buffer_size, Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_VERTEX_BUFFER_BIT); + Anvil::SharingMode::EXCLUSIVE, + Anvil::BUFFER_USAGE_FLAG_VERTEX_BUFFER_BIT); m_sine_color_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -582,8 +582,8 @@ void App::init_command_buffers() Anvil::ImageBarrier image_barrier(0, /* source_access_mask */ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, /* destination_access_mask */ false, - VK_IMAGE_LAYOUT_UNDEFINED, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::UNDEFINED, + Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, universal_queue_ptr->get_queue_family_index(), universal_queue_ptr->get_queue_family_index(), m_swapchain_ptr->get_image(n_current_swapchain_image), @@ -946,9 +946,9 @@ void App::init_gfx_pipelines() /* Create a renderpass instance */ #ifdef ENABLE_OFFSCREEN_RENDERING - const VkImageLayout final_layout = VK_IMAGE_LAYOUT_GENERAL; + const auto final_layout = Anvil::ImageLayout::GENERAL; #else - const VkImageLayout final_layout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR; + const auto final_layout = Anvil::ImageLayout::PRESENT_SRC_KHR; #endif Anvil::RenderPassAttachmentID render_pass_color_attachment_id = -1; @@ -956,34 +956,34 @@ void App::init_gfx_pipelines() Anvil::SubPassID render_pass_subpass_id = -1; renderpass_create_info_ptr->add_color_attachment(m_swapchain_ptr->get_create_info_ptr()->get_format(), - VK_SAMPLE_COUNT_1_BIT, + Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, VK_ATTACHMENT_LOAD_OP_CLEAR, VK_ATTACHMENT_STORE_OP_STORE, - VK_IMAGE_LAYOUT_UNDEFINED, + Anvil::ImageLayout::UNDEFINED, final_layout, false, /* may_alias */ &render_pass_color_attachment_id); renderpass_create_info_ptr->add_depth_stencil_attachment(m_depth_images[0]->get_create_info_ptr()->get_format(), m_depth_images[0]->get_create_info_ptr()->get_sample_count(), - VK_ATTACHMENT_LOAD_OP_CLEAR, /* depth_load_op */ - VK_ATTACHMENT_STORE_OP_DONT_CARE, /* depth_store_op */ - VK_ATTACHMENT_LOAD_OP_DONT_CARE, /* stencil_load_op */ - VK_ATTACHMENT_STORE_OP_DONT_CARE, /* stencil_store_op */ - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* initial_layout */ - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* final_layout */ - false, /* may_alias */ + VK_ATTACHMENT_LOAD_OP_CLEAR, /* depth_load_op */ + VK_ATTACHMENT_STORE_OP_DONT_CARE, /* depth_store_op */ + VK_ATTACHMENT_LOAD_OP_DONT_CARE, /* stencil_load_op */ + VK_ATTACHMENT_STORE_OP_DONT_CARE, /* stencil_store_op */ + Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* initial_layout */ + Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* final_layout */ + false, /* may_alias */ &render_pass_depth_attachment_id); renderpass_create_info_ptr->add_subpass(&render_pass_subpass_id); renderpass_create_info_ptr->add_subpass_color_attachment (render_pass_subpass_id, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, render_pass_color_attachment_id, 0, /* location */ nullptr); /* opt_attachment_resolve_id_ptr */ renderpass_create_info_ptr->add_subpass_depth_stencil_attachment(render_pass_subpass_id, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, render_pass_depth_attachment_id); m_consumer_render_pass_ptr = Anvil::RenderPass::create(std::move(renderpass_create_info_ptr), @@ -1004,7 +1004,7 @@ void App::init_gfx_pipelines() *m_consumer_vs_ptr); consumer_pipeline_info_ptr->add_vertex_attribute (0, /* location */ - VK_FORMAT_R8G8_UNORM, + Anvil::Format::R8G8_UNORM, 0, /* offset_in_bytes */ sizeof(char) * 2, /* stride_in_bytes */ VK_VERTEX_INPUT_RATE_INSTANCE); @@ -1032,21 +1032,21 @@ void App::init_images() { { auto create_info_ptr = Anvil::ImageCreateInfo::create_nonsparse_alloc(m_device_ptr.get(), - VK_IMAGE_TYPE_2D, - VK_FORMAT_D16_UNORM, - VK_IMAGE_TILING_OPTIMAL, - VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, + Anvil::ImageType::_2D, + Anvil::Format::D16_UNORM, + Anvil::ImageTiling::OPTIMAL, + Anvil::IMAGE_USAGE_FLAG_DEPTH_STENCIL_ATTACHMENT_BIT, WINDOW_WIDTH, WINDOW_HEIGHT, 1, /* in_base_mipmap_depth */ 1, /* in_n_layers */ - VK_SAMPLE_COUNT_1_BIT, + Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, + Anvil::SharingMode::EXCLUSIVE, false, /* in_use_full_mipmap_chain */ 0, /* in_memory_features */ 0, /* in_create_flags */ - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, nullptr); /* in_mipmaps_ptr */ m_depth_images[n_depth_image] = Anvil::Image::create(std::move(create_info_ptr) ); @@ -1058,12 +1058,12 @@ void App::init_images() 0, /* n_base_layer */ 0, /* n_base_mipmap_level */ 1, /* n_mipmaps */ - VK_IMAGE_ASPECT_DEPTH_BIT, + Anvil::IMAGE_ASPECT_FLAG_DEPTH_BIT, m_depth_images[n_depth_image]->get_create_info_ptr()->get_format(), - VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY); + Anvil::ComponentSwizzle::IDENTITY, + Anvil::ComponentSwizzle::IDENTITY, + Anvil::ComponentSwizzle::IDENTITY, + Anvil::ComponentSwizzle::IDENTITY); m_depth_image_views[n_depth_image] = Anvil::ImageView::create(std::move(create_info_ptr) ); } @@ -1177,19 +1177,20 @@ void App::init_swapchain() m_rendering_surface_ptr->set_name("Main rendering surface"); - m_swapchain_ptr = m_device_ptr->create_swapchain(m_rendering_surface_ptr.get(), - m_window_ptr.get (), - VK_FORMAT_B8G8R8A8_UNORM, - VK_PRESENT_MODE_FIFO_KHR, - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, - m_n_swapchain_images); + m_swapchain_ptr = reinterpret_cast(m_device_ptr.get())->create_swapchain(m_rendering_surface_ptr.get(), + m_window_ptr.get (), + Anvil::Format::B8G8R8A8_UNORM, + VK_PRESENT_MODE_FIFO_KHR, + Anvil::IMAGE_USAGE_FLAG_COLOR_ATTACHMENT_BIT, + m_n_swapchain_images); m_swapchain_ptr->set_name("Main swapchain"); /* Cache the queue we are going to use for presentation */ const std::vector* present_queue_fams_ptr = nullptr; - if (!m_rendering_surface_ptr->get_queue_families_with_present_support(&present_queue_fams_ptr) ) + if (!m_rendering_surface_ptr->get_queue_families_with_present_support(reinterpret_cast(m_device_ptr.get() )->get_physical_device(), + &present_queue_fams_ptr) ) { anvil_assert_fail(); } diff --git a/examples/MultiViewport/CMakeLists.txt b/examples/MultiViewport/CMakeLists.txt index 6ceeddc0..67769346 100644 --- a/examples/MultiViewport/CMakeLists.txt +++ b/examples/MultiViewport/CMakeLists.txt @@ -22,6 +22,9 @@ endif() target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") +include_directories(${Anvil_SOURCE_DIR}/include + ${MultiViewport_SOURCE_DIR}/include) + if (WIN32) include_directories($ENV{VK_SDK_PATH}/Include $ENV{VULKAN_SDK}/Include) diff --git a/examples/MultiViewport/include/app.h b/examples/MultiViewport/include/app.h index a65e3151..b57424b7 100644 --- a/examples/MultiViewport/include/app.h +++ b/examples/MultiViewport/include/app.h @@ -50,14 +50,14 @@ class App void init_window (); void init_vulkan (); - VkFormat get_mesh_color_data_format () const; + Anvil::Format get_mesh_color_data_format () const; uint32_t get_mesh_color_data_n_components() const; uint32_t get_mesh_color_data_start_offset (uint32_t n_stream, uint32_t n_vertex = 0) const; std::unique_ptr get_mesh_data () const; uint32_t get_mesh_data_size () const; uint32_t get_mesh_n_vertices () const; - VkFormat get_mesh_vertex_data_format () const; + Anvil::Format get_mesh_vertex_data_format () const; uint32_t get_mesh_vertex_data_n_components() const; uint32_t get_mesh_vertex_data_start_offset(uint32_t n_vertex = 0) const; @@ -71,7 +71,7 @@ class App const char* message); /* Private variables */ - Anvil::SGPUDeviceUniquePtr m_device_ptr; + Anvil::BaseDeviceUniquePtr m_device_ptr; Anvil::InstanceUniquePtr m_instance_ptr; const Anvil::PhysicalDevice* m_physical_device_ptr; Anvil::Queue* m_present_queue_ptr; diff --git a/examples/MultiViewport/src/app.cpp b/examples/MultiViewport/src/app.cpp index d7c24b17..74a6c82f 100644 --- a/examples/MultiViewport/src/app.cpp +++ b/examples/MultiViewport/src/app.cpp @@ -272,9 +272,9 @@ void App::draw_frame() #endif } -VkFormat App::get_mesh_color_data_format() const +Anvil::Format App::get_mesh_color_data_format() const { - return VK_FORMAT_R32G32B32_SFLOAT; + return Anvil::Format::R32G32B32_SFLOAT; } uint32_t App::get_mesh_color_data_n_components() const @@ -383,9 +383,9 @@ uint32_t App::get_mesh_n_vertices() const return (1 /* central vertex */ + N_SUBDIVISION_TRIANGLES); } -VkFormat App::get_mesh_vertex_data_format() const +Anvil::Format App::get_mesh_vertex_data_format() const { - return VK_FORMAT_R32G32_SFLOAT; + return Anvil::Format::R32G32_SFLOAT; } uint32_t App::get_mesh_vertex_data_n_components() const @@ -477,8 +477,8 @@ void App::init_buffers() auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr.get(), get_mesh_data_size(), Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, + Anvil::SharingMode::EXCLUSIVE, + Anvil::BUFFER_USAGE_FLAG_VERTEX_BUFFER_BIT, 0); /* in_memory_features */ create_info_ptr->set_client_data(mesh_data_ptr.get() ); @@ -523,8 +523,8 @@ void App::init_command_buffers() Anvil::ImageBarrier image_barrier(0, /* source_access_mask */ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, false, - VK_IMAGE_LAYOUT_UNDEFINED, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::UNDEFINED, + Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, universal_queue_ptr->get_queue_family_index(), universal_queue_ptr->get_queue_family_index(), m_swapchain_ptr->get_image(n_current_swapchain_image), @@ -604,11 +604,11 @@ void App::init_command_buffers() Anvil::ImageBarrier image_barrier(VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, /* source_access_mask */ VK_ACCESS_MEMORY_READ_BIT, /* destination_access_mask */ false, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, /* old_image_layout */ + Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL,/* old_image_layout */ #ifdef ENABLE_OFFSCREEN_RENDERING - VK_IMAGE_LAYOUT_GENERAL, /* new_image_layout */ + Anvil::ImageLayout::GENERAL, /* new_image_layout */ #else - VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, /* new_image_layout */ + Anvil::ImageLayout::PRESENT_SRC_KHR, /* new_image_layout */ #endif universal_queue_ptr->get_queue_family_index(), universal_queue_ptr->get_queue_family_index(), @@ -662,11 +662,11 @@ void App::init_framebuffers() void App::init_gfx_pipelines() { - auto gfx_pipeline_manager_ptr(m_device_ptr->get_graphics_pipeline_manager() ); - const VkFormat mesh_color_data_format (get_mesh_color_data_format ()); - const VkFormat mesh_vertex_data_format (get_mesh_vertex_data_format ()); - const uint32_t n_mesh_color_components (get_mesh_color_data_n_components ()); - const uint32_t n_mesh_vertex_components(get_mesh_vertex_data_n_components ()); + auto gfx_pipeline_manager_ptr(m_device_ptr->get_graphics_pipeline_manager() ); + const Anvil::Format mesh_color_data_format (get_mesh_color_data_format ()); + const Anvil::Format mesh_vertex_data_format (get_mesh_vertex_data_format ()); + const uint32_t n_mesh_color_components (get_mesh_color_data_n_components ()); + const uint32_t n_mesh_vertex_components(get_mesh_vertex_data_n_components ()); /* Create a render pass for the pipeline */ Anvil::GraphicsPipelineCreateInfoUniquePtr gfx_pipeline_create_info_ptr; @@ -681,16 +681,16 @@ void App::init_gfx_pipelines() Anvil::RenderPassCreateInfoUniquePtr render_pass_create_info_ptr(new Anvil::RenderPassCreateInfo(m_device_ptr.get() ) ); render_pass_create_info_ptr->add_color_attachment (m_swapchain_ptr->get_create_info_ptr()->get_format(), - VK_SAMPLE_COUNT_1_BIT, + Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, VK_ATTACHMENT_LOAD_OP_CLEAR, VK_ATTACHMENT_STORE_OP_STORE, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, false, /* may_alias */ &render_pass_color_attachment_id); render_pass_create_info_ptr->add_subpass (&render_pass_subpass_id); render_pass_create_info_ptr->add_subpass_color_attachment(render_pass_subpass_id, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, render_pass_color_attachment_id, 0, /* in_location */ nullptr); /* in_opt_attachment_resolve_id_ptr */ @@ -861,19 +861,20 @@ void App::init_swapchain() m_rendering_surface_ptr->set_name("Main rendering surface"); - m_swapchain_ptr = m_device_ptr->create_swapchain(m_rendering_surface_ptr.get(), - m_window_ptr.get (), - VK_FORMAT_B8G8R8A8_UNORM, - VK_PRESENT_MODE_FIFO_KHR, - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, - m_n_swapchain_images); + m_swapchain_ptr = dynamic_cast(m_device_ptr.get() )->create_swapchain(m_rendering_surface_ptr.get(), + m_window_ptr.get (), + Anvil::Format::B8G8R8A8_UNORM, + VK_PRESENT_MODE_FIFO_KHR, + Anvil::IMAGE_USAGE_FLAG_COLOR_ATTACHMENT_BIT, + m_n_swapchain_images); m_swapchain_ptr->set_name("Main swapchain"); /* Cache the queue we are going to use for presentation */ const std::vector* present_queue_fams_ptr = nullptr; - if (!m_rendering_surface_ptr->get_queue_families_with_present_support(&present_queue_fams_ptr) ) + if (!m_rendering_surface_ptr->get_queue_families_with_present_support(dynamic_cast(m_device_ptr.get() )->get_physical_device(), + &present_queue_fams_ptr) ) { anvil_assert_fail(); } diff --git a/examples/OcclusionQuery/CMakeLists.txt b/examples/OcclusionQuery/CMakeLists.txt index 6600ed10..18d8c605 100644 --- a/examples/OcclusionQuery/CMakeLists.txt +++ b/examples/OcclusionQuery/CMakeLists.txt @@ -22,6 +22,9 @@ endif() target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") +include_directories(${Anvil_SOURCE_DIR}/include + ${OcclusionQuery_SOURCE_DIR}/include) + # Include the Vulkan header. if (WIN32) include_directories($ENV{VK_SDK_PATH}/Include diff --git a/examples/OcclusionQuery/include/app.h b/examples/OcclusionQuery/include/app.h index aa0941e3..25b034d8 100644 --- a/examples/OcclusionQuery/include/app.h +++ b/examples/OcclusionQuery/include/app.h @@ -61,7 +61,7 @@ class App const char* message); /* Private variables */ - Anvil::SGPUDeviceUniquePtr m_device_ptr; + Anvil::BaseDeviceUniquePtr m_device_ptr; Anvil::InstanceUniquePtr m_instance_ptr; const Anvil::PhysicalDevice* m_physical_device_ptr; Anvil::Queue* m_present_queue_ptr; diff --git a/examples/OcclusionQuery/src/app.cpp b/examples/OcclusionQuery/src/app.cpp index 0e230a5e..47051ccd 100644 --- a/examples/OcclusionQuery/src/app.cpp +++ b/examples/OcclusionQuery/src/app.cpp @@ -355,8 +355,8 @@ void App::init_buffers() auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr.get(), m_n_bytes_per_query * N_SWAPCHAIN_IMAGES, Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT, + Anvil::SharingMode::EXCLUSIVE, + Anvil::BUFFER_USAGE_FLAG_UNIFORM_BUFFER_BIT | Anvil::BUFFER_USAGE_FLAG_TRANSFER_DST_BIT, 0); /* in_memory_features */ m_query_bo_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); @@ -366,8 +366,8 @@ void App::init_buffers() auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr.get(), m_time_n_bytes_per_swapchain_image * N_SWAPCHAIN_IMAGES, Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, + Anvil::SharingMode::EXCLUSIVE, + Anvil::BUFFER_USAGE_FLAG_UNIFORM_BUFFER_BIT, Anvil::MEMORY_FEATURE_FLAG_MAPPABLE); m_time_bo_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); @@ -673,21 +673,21 @@ void App::init_images() { { auto create_info_ptr = Anvil::ImageCreateInfo::create_nonsparse_alloc(m_device_ptr.get(), - VK_IMAGE_TYPE_2D, - VK_FORMAT_D16_UNORM, - VK_IMAGE_TILING_OPTIMAL, - VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, + Anvil::ImageType::_2D, + Anvil::Format::D16_UNORM, + Anvil::ImageTiling::OPTIMAL, + Anvil::IMAGE_USAGE_FLAG_DEPTH_STENCIL_ATTACHMENT_BIT, WINDOW_WIDTH, WINDOW_HEIGHT, 1, /* base_mipmap_depth */ 1, /* n_layers */ - VK_SAMPLE_COUNT_1_BIT, + Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, + Anvil::SharingMode::EXCLUSIVE, false, /* use_full_mipmap_chain */ 0, /* in_memory_features */ false, /* is_mutable */ - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, nullptr); m_depth_image_ptr = Anvil::Image::create(std::move(create_info_ptr) ); @@ -699,12 +699,12 @@ void App::init_images() 0, /* n_base_layer */ 0, /* n_base_mipmap_level */ 1, /* n_mipmaps */ - VK_IMAGE_ASPECT_DEPTH_BIT, + Anvil::IMAGE_ASPECT_FLAG_DEPTH_BIT, m_depth_image_ptr->get_create_info_ptr()->get_format(), - VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY); + Anvil::ComponentSwizzle::IDENTITY, + Anvil::ComponentSwizzle::IDENTITY, + Anvil::ComponentSwizzle::IDENTITY, + Anvil::ComponentSwizzle::IDENTITY); m_depth_image_view_ptr = Anvil::ImageView::create(std::move(create_info_ptr) ); } @@ -737,28 +737,28 @@ void App::init_renderpasses() ); renderpass_info_ptr->add_color_attachment(m_swapchain_ptr->get_create_info_ptr()->get_format(), - VK_SAMPLE_COUNT_1_BIT, + Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, (!is_2nd_renderpass) ? VK_ATTACHMENT_LOAD_OP_CLEAR : VK_ATTACHMENT_LOAD_OP_LOAD, VK_ATTACHMENT_STORE_OP_STORE, - VK_IMAGE_LAYOUT_UNDEFINED, + Anvil::ImageLayout::UNDEFINED, #ifdef ENABLE_OFFSCREEN_RENDERING - VK_IMAGE_LAYOUT_GENERAL, + Anvil::ImageLayout::GENERAL, #else - VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, + Anvil::ImageLayout::PRESENT_SRC_KHR, #endif false, /* may_alias */ &color_attachment_id); renderpass_info_ptr->add_depth_stencil_attachment(m_depth_image_ptr->get_create_info_ptr()->get_format(), - VK_SAMPLE_COUNT_1_BIT, + Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, (!is_2nd_renderpass) ? VK_ATTACHMENT_LOAD_OP_CLEAR : VK_ATTACHMENT_LOAD_OP_LOAD, VK_ATTACHMENT_STORE_OP_STORE, VK_ATTACHMENT_LOAD_OP_DONT_CARE, /* stencil_load_op */ VK_ATTACHMENT_STORE_OP_DONT_CARE, /* stencil_store_op */ - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, false, /* may_alias */ &ds_attachment_id); @@ -768,12 +768,12 @@ void App::init_renderpasses() renderpass_info_ptr->add_subpass(&m_renderpass_2ndpass_depth_test_off_quad_subpass_id); renderpass_info_ptr->add_subpass_color_attachment(m_renderpass_2ndpass_depth_test_off_tri_subpass_id, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, color_attachment_id, 0, /* location */ nullptr); /* opt_attachment_resolve_ptr */ renderpass_info_ptr->add_subpass_color_attachment(m_renderpass_2ndpass_depth_test_off_quad_subpass_id, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, color_attachment_id, 0, /* location */ nullptr); /* opt_attachment_resolve_ptr */ @@ -795,21 +795,21 @@ void App::init_renderpasses() renderpass_info_ptr->add_subpass(&m_renderpass_1stpass_depth_test_equal_ot_subpass_id); renderpass_info_ptr->add_subpass_color_attachment(m_renderpass_1stpass_depth_test_always_subpass_id, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, color_attachment_id, 0, /* location */ nullptr); /* opt_attachment_resolve_ptr */ renderpass_info_ptr->add_subpass_color_attachment(m_renderpass_1stpass_depth_test_equal_ot_subpass_id, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, color_attachment_id, 0, /* location */ nullptr); /* opt_attachment_resolve_ptr */ renderpass_info_ptr->add_subpass_depth_stencil_attachment(m_renderpass_1stpass_depth_test_always_subpass_id, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, ds_attachment_id); renderpass_info_ptr->add_subpass_depth_stencil_attachment(m_renderpass_1stpass_depth_test_equal_ot_subpass_id, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, ds_attachment_id); @@ -1017,19 +1017,20 @@ void App::init_swapchain() m_rendering_surface_ptr->set_name("Main rendering surface"); - m_swapchain_ptr = m_device_ptr->create_swapchain(m_rendering_surface_ptr.get(), - m_window_ptr.get (), - VK_FORMAT_B8G8R8A8_UNORM, - VK_PRESENT_MODE_FIFO_KHR, - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, - m_n_swapchain_images); + m_swapchain_ptr = reinterpret_cast(m_device_ptr.get() )->create_swapchain(m_rendering_surface_ptr.get(), + m_window_ptr.get (), + Anvil::Format::B8G8R8A8_UNORM, + VK_PRESENT_MODE_FIFO_KHR, + Anvil::IMAGE_USAGE_FLAG_COLOR_ATTACHMENT_BIT, + m_n_swapchain_images); m_swapchain_ptr->set_name("Main swapchain"); /* Cache the queue we are going to use for presentation */ const std::vector* present_queue_fams_ptr = nullptr; - if (!m_rendering_surface_ptr->get_queue_families_with_present_support(&present_queue_fams_ptr) ) + if (!m_rendering_surface_ptr->get_queue_families_with_present_support(reinterpret_cast(m_device_ptr.get() )->get_physical_device(), + &present_queue_fams_ptr) ) { anvil_assert_fail(); } diff --git a/examples/OutOfOrderRasterization/include/app.h b/examples/OutOfOrderRasterization/include/app.h index 0397d7ef..6da699a8 100644 --- a/examples/OutOfOrderRasterization/include/app.h +++ b/examples/OutOfOrderRasterization/include/app.h @@ -67,7 +67,7 @@ class App const char* message); /* Private variables */ - Anvil::SGPUDeviceUniquePtr m_device_ptr; + Anvil::BaseDeviceUniquePtr m_device_ptr; Anvil::InstanceUniquePtr m_instance_ptr; Anvil::Queue* m_present_queue_ptr; @@ -95,8 +95,24 @@ class App std::unique_ptr m_teapot_props_data_ptr; Anvil::Time m_time; - std::vector m_frame_signal_semaphores; - std::vector m_frame_wait_semaphores; + typedef struct SemaphoreBundle + { + SemaphoreBundle() + { + /* Stub */ + } + + /* Holds as many semaphores as there are physical devices bound to a logical device */ + std::vector semaphores; + + private: + SemaphoreBundle (const SemaphoreBundle&) = delete; + SemaphoreBundle& operator=(const SemaphoreBundle&) = delete; + } SemaphoreBundle; + + std::vector m_frame_acquisition_wait_semaphores; + std::vector > m_frame_signal_semaphore_bundles; + std::vector > m_frame_wait_semaphore_bundles; bool m_frame_drawn_status[N_SWAPCHAIN_IMAGES]; Anvil::PipelineID m_general_pipeline_id; diff --git a/examples/OutOfOrderRasterization/src/app.cpp b/examples/OutOfOrderRasterization/src/app.cpp index 2e2e63f2..d5fade47 100644 --- a/examples/OutOfOrderRasterization/src/app.cpp +++ b/examples/OutOfOrderRasterization/src/app.cpp @@ -65,6 +65,7 @@ #include "teapot_data.h" #include "app.h" +/* Sanity checks */ #if defined(_WIN32) #if !defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) && !defined(ENABLE_OFFSCREEN_RENDERING) #error Anvil has not been built with Win32/64 window system support. The application can only be built in offscreen rendering mode. @@ -236,8 +237,8 @@ void App::deinit() } m_dsg_ptrs.clear(); - m_frame_signal_semaphores.clear(); - m_frame_wait_semaphores.clear(); + m_frame_signal_semaphore_bundles.clear(); + m_frame_wait_semaphore_bundles.clear(); m_framebuffers.clear(); m_properties_buffer_ptrs.clear(); m_render_cmdbuffers_ooo_on.clear(); @@ -264,12 +265,15 @@ void App::deinit() void App::draw_frame() { - const Anvil::DeviceType device_type = m_device_ptr->get_type(); - static const VkPipelineStageFlags dst_stage_mask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; - Anvil::Semaphore* frame_ready_for_present_semaphore_ptr = nullptr; - Anvil::Semaphore* frame_ready_to_render_semaphore_ptr = nullptr; + const Anvil::DeviceType device_type = m_device_ptr->get_type(); + static const VkPipelineStageFlags dst_stage_mask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; + Anvil::Semaphore* frame_ready_for_present_semaphores [4]; + Anvil::SemaphoreMGPUSubmission frame_ready_for_present_submissions [4]; + Anvil::SemaphoreMGPUSubmission frame_ready_to_render_submissions [4]; + uint32_t n_physical_devices; uint32_t n_swapchain_image; const Anvil::PhysicalDevice* physical_device_ptr = nullptr; + const Anvil::PhysicalDevice* const* physical_devices_ptr = nullptr; Anvil::PrimaryCommandBuffer* render_cmdbuffer_ptr = nullptr; const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; @@ -279,7 +283,10 @@ void App::draw_frame() { const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr.get() ) ); + n_physical_devices = 1; physical_device_ptr = sgpu_device_ptr->get_physical_device(); + physical_devices_ptr = &physical_device_ptr; + break; } @@ -292,17 +299,33 @@ void App::draw_frame() /* Determine the signal + wait semaphores to use for drawing this frame */ m_n_last_semaphore_used = (m_n_last_semaphore_used + 1) % m_n_swapchain_images; - auto& curr_frame_signal_semaphore_ptr = m_frame_signal_semaphores.at(m_n_last_semaphore_used); - auto& curr_frame_wait_semaphore_ptr = m_frame_wait_semaphores.at (m_n_last_semaphore_used); - auto& curr_frame_acqusition_wait_semaphore_ptr = curr_frame_wait_semaphore_ptr; + auto& curr_frame_signal_semaphores_ptr = m_frame_signal_semaphore_bundles.at (m_n_last_semaphore_used); + auto& curr_frame_wait_semaphores_ptr = m_frame_wait_semaphore_bundles.at (m_n_last_semaphore_used); + auto& curr_frame_acqusition_wait_semaphore_ptr = curr_frame_wait_semaphores_ptr->semaphores.at(0); + + const auto& present_wait_semaphores_ptr = curr_frame_signal_semaphores_ptr; /* Determine the semaphore which the swapchain image */ - n_swapchain_image = m_swapchain_ptr->acquire_image(curr_frame_acqusition_wait_semaphore_ptr.get(), - true); /* in_should_block */ + { + n_swapchain_image = m_swapchain_ptr->acquire_image(curr_frame_acqusition_wait_semaphore_ptr.get(), + true); /* in_should_block */ + } /* Set up semaphores we're going to use to render this frame. */ - frame_ready_for_present_semaphore_ptr = curr_frame_signal_semaphore_ptr.get(); - frame_ready_to_render_semaphore_ptr = curr_frame_wait_semaphore_ptr.get(); + anvil_assert(n_physical_devices < sizeof(frame_ready_to_render_submissions) / sizeof(frame_ready_to_render_submissions[0]) ); + + for (uint32_t n_signal_sem = 0; + n_signal_sem < n_physical_devices; + ++n_signal_sem) + { + frame_ready_for_present_submissions[n_signal_sem].physical_device_ptr = physical_devices_ptr [n_signal_sem]; + frame_ready_for_present_submissions[n_signal_sem].semaphore_ptr = curr_frame_signal_semaphores_ptr->semaphores[n_signal_sem].get(); + + frame_ready_for_present_semaphores [n_signal_sem] = frame_ready_for_present_submissions [n_signal_sem].semaphore_ptr; + + frame_ready_to_render_submissions[n_signal_sem].physical_device_ptr = physical_devices_ptr [n_signal_sem]; + frame_ready_to_render_submissions[n_signal_sem].semaphore_ptr = curr_frame_wait_semaphores_ptr->semaphores[n_signal_sem].get(); + } /* if the frame has already been rendered to in the past, then given the fact we use FIFO presentation mode, * we should be safe to extract the timestamps which must have been written by now. @@ -347,9 +370,9 @@ void App::draw_frame() m_present_queue_ptr->submit( Anvil::SubmitInfo::create_wait_execute_signal(render_cmdbuffer_ptr, 1, /* n_semaphores_to_signal */ - &frame_ready_for_present_semaphore_ptr, + &frame_ready_for_present_submissions[0].semaphore_ptr, 1, /* n_semaphores_to_wait_on */ - &frame_ready_to_render_semaphore_ptr, + &frame_ready_to_render_submissions[0].semaphore_ptr, &wait_stage_mask, false /* should_block */) ); @@ -358,8 +381,8 @@ void App::draw_frame() { m_present_queue_ptr->present(m_swapchain_ptr.get(), n_swapchain_image, - 1, /* n_wait_semaphores */ - &frame_ready_for_present_semaphore_ptr); + n_physical_devices, /* n_wait_semaphores */ + frame_ready_for_present_semaphores); } ++m_n_frames_drawn; @@ -396,14 +419,14 @@ void App::init() void App::init_buffers() { - Anvil::MemoryAllocatorUniquePtr allocator_ptr; - TeapotData data (U_GRANULARITY, V_GRANULARITY); - const Anvil::DeviceType device_type (m_device_ptr->get_type() ); + Anvil::MemoryAllocatorUniquePtr allocator_ptr; + TeapotData data (U_GRANULARITY, V_GRANULARITY); + const Anvil::DeviceType device_type (m_device_ptr->get_type() ); - const VkDeviceSize index_data_size = data.get_index_data_size(); - const VkDeviceSize properties_data_size = N_TEAPOTS * sizeof(float) * 8; /* rot_xyzX + pos_xyzX */ - const Anvil::MemoryFeatureFlags required_feature_flags = 0; - const VkDeviceSize vertex_data_size = data.get_vertex_data_size(); + const VkDeviceSize index_data_size = data.get_index_data_size(); + const VkDeviceSize properties_data_size = N_TEAPOTS * sizeof(float) * 8; /* rot_xyzX + pos_xyzX */ + const Anvil::MemoryFeatureFlags required_feature_flags = 0; + const VkDeviceSize vertex_data_size = data.get_vertex_data_size(); allocator_ptr = Anvil::MemoryAllocator::create_oneshot(m_device_ptr.get() ); @@ -411,8 +434,8 @@ void App::init_buffers() auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), index_data_size, Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_INDEX_BUFFER_BIT); + Anvil::SharingMode::EXCLUSIVE, + Anvil::BUFFER_USAGE_FLAG_INDEX_BUFFER_BIT); m_index_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -421,8 +444,8 @@ void App::init_buffers() auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), sizeof(uint64_t) * m_n_swapchain_images * 2, /* top of pipe, bottom of pipe */ Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT); + Anvil::SharingMode::EXCLUSIVE, + Anvil::BUFFER_USAGE_FLAG_TRANSFER_SRC_BIT | Anvil::BUFFER_USAGE_FLAG_TRANSFER_DST_BIT); m_query_results_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -431,8 +454,8 @@ void App::init_buffers() auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), vertex_data_size, Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_VERTEX_BUFFER_BIT); + Anvil::SharingMode::EXCLUSIVE, + Anvil::BUFFER_USAGE_FLAG_VERTEX_BUFFER_BIT); m_vertex_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -442,7 +465,7 @@ void App::init_buffers() m_vertex_buffer_ptr->set_name ("Teapot vertex buffer"); allocator_ptr->add_buffer(m_query_results_buffer_ptr.get(), - /* Anvil::MEMORY_FEATURE_FLAG_MAPPABLE | */ required_feature_flags); + required_feature_flags); allocator_ptr->add_buffer(m_index_buffer_ptr.get(), required_feature_flags); @@ -459,8 +482,8 @@ void App::init_buffers() auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), properties_data_size, Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_STORAGE_BUFFER_BIT); + Anvil::SharingMode::EXCLUSIVE, + Anvil::BUFFER_USAGE_FLAG_STORAGE_BUFFER_BIT); new_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -504,7 +527,7 @@ void App::init_command_buffers() const uint32_t n_vertex_buffers = sizeof(vertex_buffers) / sizeof(vertex_buffers [0]); const uint32_t n_vertex_buffer_offsets = sizeof(vertex_buffer_offsets) / sizeof(vertex_buffer_offsets[0]); - static_assert(n_vertex_buffers == n_vertex_buffer_offsets, ""); + static_assert(n_vertex_buffers == n_vertex_buffer_offsets, ""); anvil_assert (m_framebuffers.size() == n_swapchain_images); anvil_assert (m_render_cmdbuffers_ooo_off.size() == 0); anvil_assert (m_render_cmdbuffers_ooo_on.size() == 0); @@ -535,7 +558,7 @@ void App::init_command_buffers() const bool is_ooo_enabled = (n_ooo_iteration == 1); const Anvil::PipelineID pipeline_id = (is_ooo_enabled) ? m_ooo_enabled_pipeline_id : m_ooo_disabled_pipeline_id; - Anvil::PipelineLayout* pipeline_layout_ptr = gfx_manager_ptr->get_pipeline_layout(pipeline_id); + Anvil::PipelineLayout* pipeline_layout_ptr = gfx_manager_ptr->get_pipeline_layout(pipeline_id); std::vector& render_cmdbuffers = (is_ooo_enabled) ? m_render_cmdbuffers_ooo_on : m_render_cmdbuffers_ooo_off; @@ -597,7 +620,6 @@ void App::init_command_buffers() renderpass_ptr, VK_SUBPASS_CONTENTS_INLINE); } - { const uint32_t n_physical_devices(1); @@ -727,7 +749,7 @@ void App::init_gfx_pipelines() *m_vs_entrypoint_ptr); pipeline_create_info_ptr->add_vertex_attribute(0, /* location */ - VK_FORMAT_R32G32B32_SFLOAT, + Anvil::Format::R32G32B32_SFLOAT, 0, /* offset_in_bytes */ sizeof(float) * 3, /* stride_in_bytes */ VK_VERTEX_INPUT_RATE_VERTEX); @@ -765,22 +787,22 @@ void App::init_images() { { auto create_info_ptr = Anvil::ImageCreateInfo::create_nonsparse_alloc(m_device_ptr.get(), - VK_IMAGE_TYPE_2D, - VK_FORMAT_D32_SFLOAT, - VK_IMAGE_TILING_OPTIMAL, + Anvil::ImageType::_2D, + Anvil::Format::D32_SFLOAT, + Anvil::ImageTiling::OPTIMAL, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, m_window_ptr->get_width_at_creation_time (), m_window_ptr->get_height_at_creation_time(), 1, /* base_mipmap_depth */ 1, /* n_layers */ - VK_SAMPLE_COUNT_1_BIT, + Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - false, /* in_use_full_mipmap_chain */ - 0, /* in_memory_features */ - false, /* in_is_mutable */ - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* in_final_image_layout */ - nullptr); /* in_mipmaps_ptr */ + Anvil::SharingMode::EXCLUSIVE, + false, + 0, /* in_memory_features */ + false, + Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + nullptr); m_depth_image_ptr = Anvil::Image::create(std::move(create_info_ptr) ); } @@ -791,12 +813,12 @@ void App::init_images() 0, /* n_base_layer */ 0, /* n_base_mipmap_level */ 1, /* n_mipmaps */ - VK_IMAGE_ASPECT_DEPTH_BIT, + Anvil::IMAGE_ASPECT_FLAG_DEPTH_BIT, m_depth_image_ptr->get_create_info_ptr()->get_format(), - VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY); + Anvil::ComponentSwizzle::IDENTITY, + Anvil::ComponentSwizzle::IDENTITY, + Anvil::ComponentSwizzle::IDENTITY, + Anvil::ComponentSwizzle::IDENTITY); m_depth_image_view_ptr = Anvil::ImageView::create(std::move(create_info_ptr) ); } @@ -825,40 +847,40 @@ void App::init_renderpasses() Anvil::RenderPassCreateInfoUniquePtr renderpass_create_info_ptr(new Anvil::RenderPassCreateInfo(m_device_ptr.get() ) ); renderpass_create_info_ptr->add_color_attachment(m_swapchain_ptr->get_create_info_ptr()->get_format(), - VK_SAMPLE_COUNT_1_BIT, + Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, VK_ATTACHMENT_LOAD_OP_CLEAR, VK_ATTACHMENT_STORE_OP_STORE, #ifndef ENABLE_OFFSCREEN_RENDERING - VK_IMAGE_LAYOUT_UNDEFINED, - VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, + Anvil::ImageLayout::UNDEFINED, + Anvil::ImageLayout::PRESENT_SRC_KHR, #else - VK_IMAGE_LAYOUT_GENERAL, - VK_IMAGE_LAYOUT_GENERAL, + Anvil::ImageLayout::GENERAL, + Anvil::ImageLayout::GENERAL, #endif false, /* may_alias */ &color_attachment_id); renderpass_create_info_ptr->add_depth_stencil_attachment(m_depth_image_ptr->get_create_info_ptr()->get_format(), - VK_SAMPLE_COUNT_1_BIT, + Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, VK_ATTACHMENT_LOAD_OP_CLEAR, VK_ATTACHMENT_STORE_OP_STORE, VK_ATTACHMENT_LOAD_OP_DONT_CARE, VK_ATTACHMENT_STORE_OP_DONT_CARE, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, false, /* may_alias */ &depth_attachment_id); /* Define the only subpass we're going to use there */ renderpass_create_info_ptr->add_subpass (&subpass_id); renderpass_create_info_ptr->add_subpass_color_attachment (subpass_id, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, color_attachment_id, 0, /* in_location */ nullptr); /* in_opt_attachment_resolve_id_ptr */ renderpass_create_info_ptr->add_subpass_depth_stencil_attachment(subpass_id, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, depth_attachment_id); renderpass_ptr = Anvil::RenderPass::create(std::move(renderpass_create_info_ptr), @@ -887,7 +909,7 @@ void App::init_renderpasses() *m_vs_entrypoint_ptr); gfx_pipeline_create_info_ptr->add_vertex_attribute (0, /* location */ - VK_FORMAT_R32G32B32_SFLOAT, + Anvil::Format::R32G32B32_SFLOAT, 0, /* offset_in_bytes */ sizeof(float) * 3, /* stride_in_bytes */ VK_VERTEX_INPUT_RATE_VERTEX); @@ -953,27 +975,48 @@ void App::init_semaphores() n_swapchain_image < m_n_swapchain_images; ++n_swapchain_image) { - Anvil::SemaphoreUniquePtr new_signal_semaphore_ptr; - Anvil::SemaphoreUniquePtr new_wait_semaphore_ptr; + Anvil::SemaphoreUniquePtr new_frame_acquisition_wait_semaphore_ptr; + auto new_signal_sem_bundle_ptr = std::unique_ptr(new SemaphoreBundle() ); + auto new_wait_sem_bundle_ptr = std::unique_ptr(new SemaphoreBundle() ); { auto create_info_ptr = Anvil::SemaphoreCreateInfo::create(m_device_ptr.get() ); - new_signal_semaphore_ptr = Anvil::Semaphore::create(std::move(create_info_ptr) ); + new_frame_acquisition_wait_semaphore_ptr = Anvil::Semaphore::create(std::move(create_info_ptr) ); } + + new_frame_acquisition_wait_semaphore_ptr->set_name_formatted("New frame acquisition wait semaphore [%d]", + n_swapchain_image); + + for (uint32_t n_physical_device = 0; + n_physical_device < n_physical_devices; + ++n_physical_device) { - auto create_info_ptr = Anvil::SemaphoreCreateInfo::create(m_device_ptr.get() ); + Anvil::SemaphoreUniquePtr new_signal_semaphore_ptr; + Anvil::SemaphoreUniquePtr new_wait_semaphore_ptr; - new_wait_semaphore_ptr = Anvil::Semaphore::create(std::move(create_info_ptr) ); - } + { + auto create_info_ptr = Anvil::SemaphoreCreateInfo::create(m_device_ptr.get() ); + + new_signal_semaphore_ptr = Anvil::Semaphore::create(std::move(create_info_ptr) ); + } + { + auto create_info_ptr = Anvil::SemaphoreCreateInfo::create(m_device_ptr.get() ); - new_signal_semaphore_ptr->set_name_formatted("Signal semaphore [%d]", - n_swapchain_image); - new_wait_semaphore_ptr->set_name_formatted ("Wait semaphore [%d]", - n_swapchain_image); + new_wait_semaphore_ptr = Anvil::Semaphore::create(std::move(create_info_ptr) ); + } + + new_signal_semaphore_ptr->set_name_formatted("Signal semaphore [%d]", + n_swapchain_image); + new_wait_semaphore_ptr->set_name_formatted ("Wait semaphore [%d]", + n_swapchain_image); + + new_signal_sem_bundle_ptr->semaphores.push_back(std::move(new_signal_semaphore_ptr )); + new_wait_sem_bundle_ptr->semaphores.push_back (std::move(new_wait_semaphore_ptr) ); + } - m_frame_signal_semaphores.push_back(std::move(new_signal_semaphore_ptr)); - m_frame_wait_semaphores.push_back (std::move(new_wait_semaphore_ptr)); + m_frame_signal_semaphore_bundles.push_back(std::move(new_signal_sem_bundle_ptr) ); + m_frame_wait_semaphore_bundles.push_back (std::move(new_wait_sem_bundle_ptr) ); } } @@ -1020,9 +1063,9 @@ void App::init_shaders() void App::init_swapchain() { - static const VkFormat swapchain_format (VK_FORMAT_B8G8R8A8_UNORM); - static const VkPresentModeKHR swapchain_present_mode(VK_PRESENT_MODE_FIFO_KHR); - static const VkImageUsageFlags swapchain_usage (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT); + static const Anvil::Format swapchain_format (Anvil::Format::B8G8R8A8_UNORM); + static const VkPresentModeKHR swapchain_present_mode(VK_PRESENT_MODE_FIFO_KHR); + static const Anvil::ImageUsageFlags swapchain_usage (Anvil::IMAGE_USAGE_FLAG_COLOR_ATTACHMENT_BIT | Anvil::IMAGE_USAGE_FLAG_TRANSFER_SRC_BIT | Anvil::IMAGE_USAGE_FLAG_TRANSFER_DST_BIT); m_rendering_surface_ptr = Anvil::RenderingSurface::create(m_instance_ptr.get(), m_device_ptr.get (), @@ -1047,7 +1090,8 @@ void App::init_swapchain() /* Cache the queue we are going to use for presentation */ const std::vector* present_queue_fams_ptr = nullptr; - if (!m_rendering_surface_ptr->get_queue_families_with_present_support(&present_queue_fams_ptr) ) + if (!m_rendering_surface_ptr->get_queue_families_with_present_support(sgpu_device_ptr->get_physical_device(), + &present_queue_fams_ptr) ) { anvil_assert_fail(); } @@ -1284,6 +1328,8 @@ int main() std::unique_ptr app_ptr(new App() ); app_ptr->init(); + + app_ptr->run(); #ifdef _DEBUG diff --git a/examples/PushConstants/include/app.h b/examples/PushConstants/include/app.h index 446b3a2f..d06d7932 100644 --- a/examples/PushConstants/include/app.h +++ b/examples/PushConstants/include/app.h @@ -65,9 +65,9 @@ class App const unsigned char* get_mesh_data () const; uint32_t get_mesh_data_color_start_offset () const; uint32_t get_mesh_data_color_stride () const; - VkFormat get_mesh_data_color_format () const; + Anvil::Format get_mesh_data_color_format () const; uint32_t get_mesh_data_size () const; - VkFormat get_mesh_data_position_format () const; + Anvil::Format get_mesh_data_position_format () const; uint32_t get_mesh_data_position_start_offset() const; uint32_t get_mesh_data_position_stride () const; uint32_t get_mesh_n_vertices () const; @@ -76,7 +76,7 @@ class App /* Private variables */ - Anvil::SGPUDeviceUniquePtr m_device_ptr; + Anvil::BaseDeviceUniquePtr m_device_ptr; Anvil::InstanceUniquePtr m_instance_ptr; const Anvil::PhysicalDevice* m_physical_device_ptr; Anvil::Queue* m_present_queue_ptr; diff --git a/examples/PushConstants/src/app.cpp b/examples/PushConstants/src/app.cpp index 2424d6b0..67526184 100644 --- a/examples/PushConstants/src/app.cpp +++ b/examples/PushConstants/src/app.cpp @@ -341,9 +341,9 @@ const unsigned char* App::get_mesh_data() const return reinterpret_cast(g_mesh_data); } -VkFormat App::get_mesh_data_color_format() const +Anvil::Format App::get_mesh_data_color_format() const { - return VK_FORMAT_R32G32B32_SFLOAT; + return Anvil::Format::R32G32B32_SFLOAT; } uint32_t App::get_mesh_data_color_start_offset() const @@ -356,9 +356,9 @@ uint32_t App::get_mesh_data_color_stride() const return g_mesh_data_color_stride; } -VkFormat App::get_mesh_data_position_format() const +Anvil::Format App::get_mesh_data_position_format() const { - return VK_FORMAT_R32G32B32A32_SFLOAT; + return Anvil::Format::R32G32B32A32_SFLOAT; } uint32_t App::get_mesh_data_position_start_offset() const @@ -419,8 +419,8 @@ void App::init_buffers() auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), ub_data_size_total, Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT); + Anvil::SharingMode::EXCLUSIVE, + Anvil::BUFFER_USAGE_FLAG_UNIFORM_BUFFER_BIT); m_data_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -435,8 +435,8 @@ void App::init_buffers() auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), get_mesh_data_size(), Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_VERTEX_BUFFER_BIT); + Anvil::SharingMode::EXCLUSIVE, + Anvil::BUFFER_USAGE_FLAG_VERTEX_BUFFER_BIT); m_mesh_data_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -486,8 +486,8 @@ void App::init_command_buffers() Anvil::ImageBarrier image_barrier(0, /* source_access_mask */ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, /* destination_access_mask */ false, - VK_IMAGE_LAYOUT_UNDEFINED, /* old_image_layout */ - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, /* new_image_layout */ + Anvil::ImageLayout::UNDEFINED, /* old_image_layout */ + Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, /* new_image_layout */ universal_queue_ptr->get_queue_family_index(), universal_queue_ptr->get_queue_family_index(), m_swapchain_ptr->get_image(n_command_buffer), @@ -661,14 +661,14 @@ void App::init_gfx_pipelines() Anvil::RenderPassCreateInfoUniquePtr render_pass_create_info_ptr(new Anvil::RenderPassCreateInfo(m_device_ptr.get() ) ); render_pass_create_info_ptr->add_color_attachment(m_swapchain_ptr->get_create_info_ptr()->get_format(), - VK_SAMPLE_COUNT_1_BIT, + Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, VK_ATTACHMENT_LOAD_OP_CLEAR, VK_ATTACHMENT_STORE_OP_STORE, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, #ifdef ENABLE_OFFSCREEN_RENDERING - VK_IMAGE_LAYOUT_GENERAL, + Anvil::ImageLayout::GENERAL, #else - VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, + Anvil::ImageLayout::PRESENT_SRC_KHR, #endif false, /* may_alias */ &render_pass_color_attachment_id); @@ -676,7 +676,7 @@ void App::init_gfx_pipelines() render_pass_create_info_ptr->add_subpass (&render_pass_subpass_id); render_pass_create_info_ptr->add_subpass_color_attachment(render_pass_subpass_id, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, render_pass_color_attachment_id, 0, /* location */ nullptr); /* opt_attachment_resolve_id_ptr */ @@ -814,7 +814,7 @@ void App::init_shaders() void App::init_swapchain() { - Anvil::SGPUDevice* device_ptr(m_device_ptr.get() ); + Anvil::SGPUDevice* device_ptr(reinterpret_cast(m_device_ptr.get() )); m_rendering_surface_ptr = Anvil::RenderingSurface::create(m_instance_ptr.get(), m_device_ptr.get (), @@ -825,9 +825,9 @@ void App::init_swapchain() m_swapchain_ptr = device_ptr->create_swapchain(m_rendering_surface_ptr.get(), m_window_ptr.get (), - VK_FORMAT_B8G8R8A8_UNORM, + Anvil::Format::B8G8R8A8_UNORM, VK_PRESENT_MODE_FIFO_KHR, - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, + Anvil::IMAGE_USAGE_FLAG_COLOR_ATTACHMENT_BIT, m_n_swapchain_images); m_swapchain_ptr->set_name("Main swapchain"); @@ -835,7 +835,8 @@ void App::init_swapchain() /* Cache the queue we are going to use for presentation */ const std::vector* present_queue_fams_ptr = nullptr; - if (!m_rendering_surface_ptr->get_queue_families_with_present_support(&present_queue_fams_ptr) ) + if (!m_rendering_surface_ptr->get_queue_families_with_present_support(device_ptr->get_physical_device(), + &present_queue_fams_ptr) ) { anvil_assert_fail(); } diff --git a/include/misc/buffer_create_info.h b/include/misc/buffer_create_info.h index 19cde495..975cbbdb 100644 --- a/include/misc/buffer_create_info.h +++ b/include/misc/buffer_create_info.h @@ -49,8 +49,7 @@ namespace Anvil * @param in_size Size of the buffer object to be initialized. * @param in_queue_families Queue families which the buffer object is going to be used with. * One or more user queue family bits can be enabled. - * @param in_sharing_mode VkSharingMode value, which is going to be passed to the vkCreateBuffer() - * call. + * @param in_sharing_mode Sharing mode to pass to the vkCreateBuffer() call. * @param in_usage_flags Usage flags to set in the VkBufferCreateInfo descriptor, passed to * to the vkCreateBuffer() call. * @param in_memory_freatures Required memory features. @@ -58,8 +57,8 @@ namespace Anvil static Anvil::BufferCreateInfoUniquePtr create_nonsparse_alloc(const Anvil::BaseDevice* in_device_ptr, VkDeviceSize in_size, QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - VkBufferUsageFlags in_usage_flags, + Anvil::SharingMode in_sharing_mode, + Anvil::BufferUsageFlags in_usage_flags, Anvil::MemoryFeatureFlags in_memory_features); /** Creates a create info for a NON-SPARSE buffer object. @@ -76,16 +75,15 @@ namespace Anvil * @param in_size Size of the buffer object to be initialized. * @param in_queue_families Queue families which the buffer object is going to be used with. * One or more user queue family bits can be enabled. - * @param in_sharing_mode VkSharingMode value, which is going to be passed to the vkCreateBuffer() - * call. + * @param in_sharing_mode Sharing mode to pass to the vkCreateBuffer() call. * @param in_usage_flags Usage flags to set in the VkBufferCreateInfo descriptor, passed to * to the vkCreateBuffer() call. **/ static Anvil::BufferCreateInfoUniquePtr create_nonsparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, VkDeviceSize in_size, QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - VkBufferUsageFlags in_usage_flags); + Anvil::SharingMode in_sharing_mode, + Anvil::BufferUsageFlags in_usage_flags); /** Creates a create info for a NON-SPARSE buffer object. * @@ -112,8 +110,7 @@ namespace Anvil * @param in_size Size of the buffer object to be initialized. * @param in_queue_families Queue families which the buffer object is going to be used with. * One or more user queue family bits can be enabled. - * @param in_sharing_mode VkSharingMode value, which is going to be passed to the vkCreateBuffer() - * call. + * @param in_sharing_mode Sharing mode to pass with the vkCreateBuffer() call. * @param in_usage_flags Usage flags to set in the VkBufferCreateInfo descriptor, passed to * to the vkCreateBuffer() call. * @param in_residency_scope Scope of residency to support for the buffer. @@ -124,8 +121,8 @@ namespace Anvil static Anvil::BufferCreateInfoUniquePtr create_sparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, VkDeviceSize in_size, QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - VkBufferUsageFlags in_usage_flags, + Anvil::SharingMode in_sharing_mode, + Anvil::BufferUsageFlags in_usage_flags, Anvil::SparseResidencyScope in_residency_scope, MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); @@ -179,7 +176,7 @@ namespace Anvil } /** Returns sharing mode of the buffer */ - VkSharingMode get_sharing_mode() const + Anvil::SharingMode get_sharing_mode() const { return m_sharing_mode; } @@ -207,7 +204,7 @@ namespace Anvil return m_type; } - const VkBufferUsageFlags get_usage_flags() const + const Anvil::BufferUsageFlags get_usage_flags() const { return m_usage_flags; } @@ -251,7 +248,7 @@ namespace Anvil m_queue_families = in_queue_families; } - void set_sharing_mode(const VkSharingMode& in_sharing_mode) + void set_sharing_mode(const Anvil::SharingMode& in_sharing_mode) { m_sharing_mode = in_sharing_mode; } @@ -266,7 +263,7 @@ namespace Anvil m_start_offset = in_start_offset; } - void set_usage_flags(const VkBufferUsageFlags& in_usage_flags) + void set_usage_flags(const Anvil::BufferUsageFlags& in_usage_flags) { m_usage_flags = in_usage_flags; } @@ -279,8 +276,8 @@ namespace Anvil BufferCreateInfo(const Anvil::BaseDevice* in_device_ptr, VkDeviceSize in_size, QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - VkBufferUsageFlags in_usage_flags, + Anvil::SharingMode in_sharing_mode, + Anvil::BufferUsageFlags in_usage_flags, Anvil::SparseResidencyScope in_residency_scope, MTSafety in_mt_safety, Anvil::ExternalMemoryHandleTypeBits in_exportable_external_memory_handle_types); @@ -288,8 +285,8 @@ namespace Anvil const Anvil::BaseDevice* in_device_ptr, VkDeviceSize in_size, QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - VkBufferUsageFlags in_usage_flags, + Anvil::SharingMode in_sharing_mode, + Anvil::BufferUsageFlags in_usage_flags, MemoryFeatureFlags in_memory_features, MTSafety in_mt_safety, Anvil::ExternalMemoryHandleTypeBits in_exportable_external_memory_handle_types, @@ -308,11 +305,11 @@ namespace Anvil Anvil::Buffer* const m_parent_buffer_ptr; Anvil::QueueFamilyBits m_queue_families; const Anvil::SparseResidencyScope m_residency_scope; - VkSharingMode m_sharing_mode; + Anvil::SharingMode m_sharing_mode; VkDeviceSize m_size; VkDeviceSize m_start_offset; const BufferType m_type; - VkBufferUsageFlags m_usage_flags; + Anvil::BufferUsageFlags m_usage_flags; ANVIL_DISABLE_ASSIGNMENT_OPERATOR(BufferCreateInfo); ANVIL_DISABLE_COPY_CONSTRUCTOR(BufferCreateInfo); diff --git a/include/misc/buffer_view_create_info.h b/include/misc/buffer_view_create_info.h index 05e308a6..717976ac 100644 --- a/include/misc/buffer_view_create_info.h +++ b/include/misc/buffer_view_create_info.h @@ -40,7 +40,7 @@ namespace Anvil */ static Anvil::BufferViewCreateInfoUniquePtr create(const Anvil::BaseDevice* in_device_ptr, Anvil::Buffer* in_buffer_ptr, - VkFormat in_format, + Anvil::Format in_format, VkDeviceSize in_start_offset, VkDeviceSize in_size); @@ -50,7 +50,7 @@ namespace Anvil } /** Returns format used by the buffer view */ - VkFormat get_format() const + Anvil::Format get_format() const { return m_format; } @@ -83,7 +83,7 @@ namespace Anvil m_device_ptr = in_device_ptr; } - void set_format(const VkFormat& in_format) + void set_format(const Anvil::Format& in_format) { m_format = in_format; } @@ -114,7 +114,7 @@ namespace Anvil BufferViewCreateInfo(const Anvil::BaseDevice* in_device_ptr, Anvil::Buffer* in_buffer_ptr, - VkFormat in_format, + Anvil::Format in_format, VkDeviceSize in_start_offset, VkDeviceSize in_size, MTSafety in_mt_safety); @@ -123,7 +123,7 @@ namespace Anvil /* Private variables */ Anvil::Buffer* m_buffer_ptr; const Anvil::BaseDevice* m_device_ptr; - VkFormat m_format; + Anvil::Format m_format; Anvil::MTSafety m_mt_safety; VkDeviceSize m_size; VkDeviceSize m_start_offset; diff --git a/include/misc/extensions.h b/include/misc/extensions.h index 7ba5c1f9..76e60ed0 100644 --- a/include/misc/extensions.h +++ b/include/misc/extensions.h @@ -56,13 +56,16 @@ namespace Anvil ValueType khr_bind_memory2; ValueType khr_dedicated_allocation; ValueType khr_descriptor_update_template; + ValueType khr_device_group; ValueType khr_draw_indirect_count; ValueType khr_external_fence; ValueType khr_external_memory; ValueType khr_external_semaphore; ValueType khr_get_memory_requirements2; ValueType khr_maintenance1; + ValueType khr_maintenance2; ValueType khr_maintenance3; + ValueType khr_shader_draw_parameters; ValueType khr_storage_buffer_storage_class; ValueType khr_swapchain; @@ -136,8 +139,11 @@ namespace Anvil #endif {ExtensionData(VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME, &khr_get_memory_requirements2)}, {ExtensionData(VK_KHR_MAINTENANCE1_EXTENSION_NAME, &khr_maintenance1)}, + {ExtensionData(VK_KHR_MAINTENANCE2_EXTENSION_NAME, &khr_maintenance2)}, {ExtensionData(VK_KHR_MAINTENANCE3_EXTENSION_NAME, &khr_maintenance3)}, + {ExtensionData(VK_KHR_DEVICE_GROUP_EXTENSION_NAME, &khr_device_group)}, {ExtensionData(VK_KHR_BIND_MEMORY_2_EXTENSION_NAME, &khr_bind_memory2)}, + {ExtensionData(VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME, &khr_shader_draw_parameters)}, {ExtensionData(VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_EXTENSION_NAME, &khr_storage_buffer_storage_class)}, {ExtensionData(VK_KHR_SWAPCHAIN_EXTENSION_NAME, &khr_swapchain)}, }; @@ -165,6 +171,7 @@ namespace Anvil template struct InstanceExtensions { + ValueType khr_device_group_creation; ValueType khr_external_fence_capabilities; ValueType khr_external_memory_capabilities; ValueType khr_external_semaphore_capabilities; @@ -203,6 +210,7 @@ namespace Anvil std::vector recognized_extensions = { + {ExtensionData(VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME, &khr_device_group_creation)}, {ExtensionData(VK_KHR_EXTERNAL_FENCE_CAPABILITIES_EXTENSION_NAME, &khr_external_fence_capabilities)}, {ExtensionData(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME, &khr_external_memory_capabilities)}, {ExtensionData(VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME, &khr_external_semaphore_capabilities)}, @@ -273,6 +281,7 @@ namespace Anvil virtual ValueType khr_bind_memory2 () const = 0; virtual ValueType khr_dedicated_allocation () const = 0; virtual ValueType khr_descriptor_update_template () const = 0; + virtual ValueType khr_device_group () const = 0; virtual ValueType khr_draw_indirect_count () const = 0; virtual ValueType khr_external_fence () const = 0; virtual ValueType khr_external_memory () const = 0; @@ -288,7 +297,9 @@ namespace Anvil #endif virtual ValueType khr_get_memory_requirements2 () const = 0; virtual ValueType khr_maintenance1 () const = 0; + virtual ValueType khr_maintenance2 () const = 0; virtual ValueType khr_maintenance3 () const = 0; + virtual ValueType khr_shader_draw_parameters () const = 0; virtual ValueType khr_storage_buffer_storage_class () const = 0; virtual ValueType khr_swapchain () const = 0; @@ -304,6 +315,7 @@ namespace Anvil /* Stub */ } + virtual bool khr_device_group_creation () const = 0; virtual bool khr_external_fence_capabilities () const = 0; virtual bool khr_external_memory_capabilities () const = 0; virtual bool khr_external_semaphore_capabilities() const = 0; @@ -409,7 +421,6 @@ namespace Anvil } /* IExtensionInfoDevice */ - ValueType amd_draw_indirect_count() const final { anvil_assert(m_expose_device_extensions); @@ -578,6 +589,13 @@ namespace Anvil return m_device_extensions_ptr->khr_descriptor_update_template; } + ValueType khr_device_group() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_device_group; + } + ValueType khr_draw_indirect_count() const final { anvil_assert(m_expose_device_extensions); @@ -668,6 +686,13 @@ namespace Anvil return m_device_extensions_ptr->khr_maintenance1; } + ValueType khr_maintenance2() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_maintenance2; + } + ValueType khr_maintenance3() const final { anvil_assert(m_expose_device_extensions); @@ -682,6 +707,13 @@ namespace Anvil return m_device_extensions_ptr->khr_storage_buffer_storage_class; } + ValueType khr_shader_draw_parameters() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_shader_draw_parameters; + } + ValueType khr_swapchain() const final { anvil_assert(m_expose_device_extensions); @@ -691,6 +723,13 @@ namespace Anvil /* IExtensionInfoInstance */ + ValueType khr_device_group_creation() const final + { + anvil_assert(!m_expose_device_extensions); + + return m_instance_extensions_ptr->khr_device_group_creation; + } + ValueType khr_external_fence_capabilities() const final { anvil_assert(!m_expose_device_extensions); diff --git a/include/misc/formats.h b/include/misc/formats.h index 255067b7..32aedb89 100644 --- a/include/misc/formats.h +++ b/include/misc/formats.h @@ -32,11 +32,11 @@ namespace Anvil class Formats { public: - static bool get_compressed_format_block_size(VkFormat in_format, - uint32_t* out_block_size_uvec2_ptr, - uint32_t* out_n_bytes_per_block_ptr); + static bool get_compressed_format_block_size(Anvil::Format in_format, + uint32_t* out_block_size_uvec2_ptr, + uint32_t* out_n_bytes_per_block_ptr); - /** Returns a VkFormat which meets the user-specified criteria. + /** Returns an Anvil::Format which meets the user-specified criteria. * * This function does not support block formats. * @@ -53,15 +53,15 @@ namespace Anvil * @param in_n_component3_bits Number of bits used by the third component. Pass 0 if the component * is irrelevant. * - * @return A corresponding VkFormat value OR VK_FORMAT_UNKNOWN if no recognized Vulkan format + * @return A corresponding Anvil::Format value OR Anvil::Format::UNKNOWN if no recognized Vulkan format * meets the specified requirements. */ - static VkFormat get_format(ComponentLayout in_component_layout, - FormatType in_format_type, - uint32_t in_n_component0_bits, - uint32_t in_n_component1_bits, - uint32_t in_n_component2_bits, - uint32_t in_n_component3_bits); + static Anvil::Format get_format(ComponentLayout in_component_layout, + FormatType in_format_type, + uint32_t in_n_component0_bits, + uint32_t in_n_component1_bits, + uint32_t in_n_component2_bits, + uint32_t in_n_component3_bits); /** Returns image aspects exposed by a given image format. * @@ -70,8 +70,8 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - static bool get_format_aspects(VkFormat in_format, - std::vector* out_aspects_ptr); + static bool get_format_aspects(Anvil::Format in_format, + std::vector* out_aspects_ptr); /** Returns bit layout for the specified format. * @@ -94,27 +94,27 @@ namespace Anvil * @param out_opt_stencil_component_start_bit_index_ptr If not null, deref will be set to the bit index, from which stencil component data starts. * @param out_opt_stencil_component_end_bit_index_ptr If not null, deref will be set to the bit index, at which stencil component data ends. (data under the bit includes the data!) */ - static void get_format_bit_layout(VkFormat in_format, - uint32_t* out_opt_red_component_start_bit_index_ptr = nullptr, - uint32_t* out_opt_red_component_end_bit_index_ptr = nullptr, - uint32_t* out_opt_green_component_start_bit_index_ptr = nullptr, - uint32_t* out_opt_green_component_end_bit_index_ptr = nullptr, - uint32_t* out_opt_blue_component_start_bit_index_ptr = nullptr, - uint32_t* out_opt_blue_component_end_bit_index_ptr = nullptr, - uint32_t* out_opt_alpha_component_start_bit_index_ptr = nullptr, - uint32_t* out_opt_alpha_component_end_bit_index_ptr = nullptr, - uint32_t* out_opt_shared_component_start_bit_index_ptr = nullptr, - uint32_t* out_opt_shared_component_end_bit_index_ptr = nullptr, - uint32_t* out_opt_depth_component_start_bit_index_ptr = nullptr, - uint32_t* out_opt_depth_component_end_bit_index_ptr = nullptr, - uint32_t* out_opt_stencil_component_start_bit_index_ptr = nullptr, - uint32_t* out_opt_stencil_component_end_bit_index_ptr = nullptr); + static void get_format_bit_layout(Anvil::Format in_format, + uint32_t* out_opt_red_component_start_bit_index_ptr = nullptr, + uint32_t* out_opt_red_component_end_bit_index_ptr = nullptr, + uint32_t* out_opt_green_component_start_bit_index_ptr = nullptr, + uint32_t* out_opt_green_component_end_bit_index_ptr = nullptr, + uint32_t* out_opt_blue_component_start_bit_index_ptr = nullptr, + uint32_t* out_opt_blue_component_end_bit_index_ptr = nullptr, + uint32_t* out_opt_alpha_component_start_bit_index_ptr = nullptr, + uint32_t* out_opt_alpha_component_end_bit_index_ptr = nullptr, + uint32_t* out_opt_shared_component_start_bit_index_ptr = nullptr, + uint32_t* out_opt_shared_component_end_bit_index_ptr = nullptr, + uint32_t* out_opt_depth_component_start_bit_index_ptr = nullptr, + uint32_t* out_opt_depth_component_end_bit_index_ptr = nullptr, + uint32_t* out_opt_stencil_component_start_bit_index_ptr = nullptr, + uint32_t* out_opt_stencil_component_end_bit_index_ptr = nullptr); /** Tells what component layout is used by @param in_format. */ - static ComponentLayout get_format_component_layout(VkFormat in_format); + static ComponentLayout get_format_component_layout(Anvil::Format in_format); /** Tells the number of components used by @param in_format */ - static uint32_t get_format_n_components(VkFormat in_format); + static uint32_t get_format_n_components(Anvil::Format in_format); /* Tells the number of bits used for each component in case of Vulkan format specified * under @param in_format. @@ -132,29 +132,29 @@ namespace Anvil * @param out_channel3_bits_ptr Deref will be set to the number of bits used for channel 3. Must * not be nullptr. */ - static void get_format_n_component_bits(VkFormat in_format, - uint32_t* out_channel0_bits_ptr, - uint32_t* out_channel1_bits_ptr, - uint32_t* out_channel2_bits_ptr, - uint32_t* out_channel3_bits_ptr); + static void get_format_n_component_bits(Anvil::Format in_format, + uint32_t* out_channel0_bits_ptr, + uint32_t* out_channel1_bits_ptr, + uint32_t* out_channel2_bits_ptr, + uint32_t* out_channel3_bits_ptr); /* Returns a raw C string for specified format, or NULL if the format is unknown. */ - static const char* get_format_name(VkFormat in_format); + static const char* get_format_name(Anvil::Format in_format); /** Tells the format type used by @param in_format. */ - static FormatType get_format_type(VkFormat in_format); + static FormatType get_format_type(Anvil::Format in_format); /** Tells whether @param in_format includes a depth aspect */ - static bool has_depth_aspect(VkFormat in_format); + static bool has_depth_aspect(Anvil::Format in_format); /** Tells whether @param in_format includes a stencil aspect */ - static bool has_stencil_aspect(VkFormat in_format); + static bool has_stencil_aspect(Anvil::Format in_format); /** Tells whether @param in_format format is a block format. */ - static bool is_format_compressed(VkFormat in_format); + static bool is_format_compressed(Anvil::Format in_format); /** Tells whether @param in_format is a packed format */ - static bool is_format_packed(VkFormat in_format); + static bool is_format_packed(Anvil::Format in_format); }; }; diff --git a/include/misc/graphics_pipeline_create_info.h b/include/misc/graphics_pipeline_create_info.h index 7f563ace..a0f0a768 100644 --- a/include/misc/graphics_pipeline_create_info.h +++ b/include/misc/graphics_pipeline_create_info.h @@ -117,7 +117,7 @@ namespace Anvil * @return true if successful, false otherwise. **/ bool add_vertex_attribute(uint32_t in_location, - VkFormat in_format, + Anvil::Format in_format, uint32_t in_offset_in_bytes, uint32_t in_stride_in_bytes, VkVertexInputRate in_step_rate, @@ -249,8 +249,8 @@ namespace Anvil * @param out_opt_sample_mask_ptr If not null, deref will be set to the sample mask assigned * to the pipeline. **/ - void get_multisampling_properties(VkSampleCountFlags* out_opt_sample_count_ptr, - VkSampleMask* out_opt_sample_mask_ptr) const; + void get_multisampling_properties(Anvil::SampleCountFlagBits* out_opt_sample_count_ptr, + VkSampleMask* out_opt_sample_mask_ptr) const; /** Tells the number of dynamic scissor boxes. **/ uint32_t get_n_dynamic_scissor_boxes() const; @@ -375,6 +375,15 @@ namespace Anvil return m_subpass_id; } + /* TODO + * + * Requires VK_KHR_maintenance2. + */ + Anvil::TessellationDomainOrigin get_tessellation_domain_origin() const + { + return m_tessellation_domain_origin; + } + /** Tells the number of patch control points associated with this instance. **/ uint32_t get_n_patch_control_points() const; @@ -396,7 +405,7 @@ namespace Anvil **/ bool get_vertex_attribute_properties(uint32_t in_n_vertex_input_attribute, uint32_t* out_opt_location_ptr = nullptr, - VkFormat* out_opt_format_ptr = nullptr, + Anvil::Format* out_opt_format_ptr = nullptr, uint32_t* out_opt_offset_ptr = nullptr, uint32_t* out_opt_explicit_vertex_binding_index_ptr = nullptr, uint32_t* out_opt_stride_ptr = nullptr, @@ -477,9 +486,9 @@ namespace Anvil * @param in_min_sample_shading Minimum number of unique samples to shade for each fragment. * @param in_sample_mask Sample mask to use. */ - void set_multisampling_properties(VkSampleCountFlagBits in_sample_count, - float in_min_sample_shading, - const VkSampleMask in_sample_mask); + void set_multisampling_properties(Anvil::SampleCountFlagBits in_sample_count, + float in_min_sample_shading, + const VkSampleMask in_sample_mask); /** Updates the number of scissor boxes to be used, when dynamic scissor state is enabled. * @@ -562,6 +571,12 @@ namespace Anvil uint32_t in_stencil_write_mask, uint32_t in_stencil_reference); + /* TODO + * + * Requires VK_KHR_maintenance2. + */ + void set_tessellation_domain_origin(const Anvil::TessellationDomainOrigin& in_new_origin); + /** Sets properties of a viewport at the specified index. * * If @param in_n_viewport is larger than 1, all previous viewports must also be defined @@ -841,7 +856,7 @@ namespace Anvil { uint32_t divisor; uint32_t explicit_binding_index; - VkFormat format; + Anvil::Format format; uint32_t location; uint32_t offset_in_bytes; VkVertexInputRate rate; @@ -852,7 +867,7 @@ namespace Anvil { divisor = 1; explicit_binding_index = UINT32_MAX; - format = VK_FORMAT_UNDEFINED; + format = Anvil::Format::UNKNOWN; location = UINT32_MAX; offset_in_bytes = UINT32_MAX; rate = VK_VERTEX_INPUT_RATE_MAX_ENUM; @@ -870,7 +885,7 @@ namespace Anvil **/ InternalVertexAttribute(uint32_t in_divisor, uint32_t in_explicit_binding_index, - VkFormat in_format, + Anvil::Format in_format, uint32_t in_location, uint32_t in_offset_in_bytes, VkVertexInputRate in_rate, @@ -927,6 +942,8 @@ namespace Anvil VkRasterizationOrderAMD m_rasterization_order; + TessellationDomainOrigin m_tessellation_domain_origin; + InternalVertexAttributes m_attributes; float m_blend_constant[4]; VkPolygonMode m_polygon_mode; @@ -938,13 +955,13 @@ namespace Anvil uint32_t m_n_dynamic_viewports; uint32_t m_n_patch_control_points; VkPrimitiveTopology m_primitive_topology; + Anvil::SampleCountFlagBits m_sample_count; VkSampleMask m_sample_mask; InternalScissorBoxes m_scissor_boxes; SubPassAttachmentToBlendingPropertiesMap m_subpass_attachment_blending_properties; InternalViewports m_viewports; VkCullModeFlagsVariable (m_cull_mode); - VkSampleCountFlagsVariable(m_sample_count); const RenderPass* m_renderpass_ptr; SubPassID m_subpass_id; diff --git a/include/misc/image_create_info.h b/include/misc/image_create_info.h index 5a3bb318..b3cb3117 100644 --- a/include/misc/image_create_info.h +++ b/include/misc/image_create_info.h @@ -72,26 +72,26 @@ namespace Anvil * @param in_opt_mipmaps_ptr If not nullptr, specified MipmapRawData items will be used to drive the mipmap contents * initialization process. Ignored if nullptr. * Specifying a non-NULL in_opt_mipmaps_ptr argument will make the function OR - * @param in_usage with VK_IMAGE_USAGE_TRANSFER_DST_BIT. + * @param in_usage with Anvil::IMAGE_USAGE_FLAG_TRANSFER_DST_BIT. * * @return New image instance, if successful, or nullptr otherwise. **/ static ImageCreateInfoUniquePtr create_nonsparse_alloc(const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, + Anvil::ImageType in_type, + Anvil::Format in_format, + Anvil::ImageTiling in_tiling, + Anvil::ImageUsageFlags in_usage, uint32_t in_base_mipmap_width, uint32_t in_base_mipmap_height, uint32_t in_base_mipmap_depth, uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, + Anvil::SampleCountFlagBits in_sample_count, Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, + Anvil::SharingMode in_sharing_mode, bool in_use_full_mipmap_chain, MemoryFeatureFlags in_memory_features, ImageCreateFlags in_create_flags, - VkImageLayout in_post_alloc_image_layout, + Anvil::ImageLayout in_post_alloc_image_layout, const std::vector* in_opt_mipmaps_ptr = nullptr); /** Returns an instance of the "create info" item which can be used to instantiate a new non-sparse Image @@ -104,7 +104,7 @@ namespace Anvil * * If this constructor is used, the image can be transformed automatically to the right layout * at set_memory() call time by setting @param in_final_image_layout argument to a value other - * than VK_IMAGE_LAYOUT_UNDEFINED and VK_IMAGE_LAYOUT_PREINITIALIZED. + * than Anvil::ImageLayout::UNDEFINED and Anvil::ImageLayout::PREINITIALIZED. * * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * @@ -132,27 +132,49 @@ namespace Anvil * @param in_opt_mipmaps_ptr If not NULL, specified data will be used to initialize created image's mipmaps * with content, as soon as the image is assigned a memory backing. * Specifying a non-NULL @param in_opt_mipmaps_ptr argument will make the function OR - * @param in_usage with VK_IMAGE_USAGE_TRANSFER_DST_BIT. + * @param in_usage with Anvil::IMAGE_USAGE_FLAG_TRANSFER_DST_BIT. * * @return New image instance, if successful, or nullptr otherwise. **/ static ImageCreateInfoUniquePtr create_nonsparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, + Anvil::ImageType in_type, + Anvil::Format in_format, + Anvil::ImageTiling in_tiling, + ImageUsageFlags in_usage, uint32_t in_base_mipmap_width, uint32_t in_base_mipmap_height, uint32_t in_base_mipmap_depth, uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, + Anvil::SampleCountFlagBits in_sample_count, Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, + Anvil::SharingMode in_sharing_mode, bool in_use_full_mipmap_chain, ImageCreateFlags in_create_flags, - VkImageLayout in_post_alloc_image_layout, + Anvil::ImageLayout in_post_alloc_image_layout, const std::vector* in_opt_mipmaps_ptr = nullptr); + /** Returns an instance of the "create info" item which can be used to instantiate a new non-sparse Image + * instance, later to be bound to the user-specified swapchain memory. + * + * This function prototype may only be called for sGPU or mGPU devices which support the VK_KHR_device_group + * extension. + * + * Requires VK_KHR_device_group support. + * + * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: + * + * - External memory handle types: none + * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - Physical devices: none + * - SFR rectangles: none + * + * For argument discussion, see specification of the other create() functions. + **/ + static ImageCreateInfoUniquePtr create_nonsparse_peer_no_alloc(const Anvil::BaseDevice* in_device_ptr, + const Anvil::Swapchain* in_swapchain_ptr, + uint32_t in_n_swapchain_image); + + /** Returns an instance of the "create info" item which can be used to instantiate a new sparse Image * instance *without* a physical memory backing. * @@ -170,7 +192,7 @@ namespace Anvil * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * * - External memory handle types: none - * - Initial layout: VK_IMAGE_LAYOUT_UNDEFINED + * - Initial layout: Anvil::ImageLayout::UNDEFINED * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE * * @param in_device_ptr Device to use. @@ -190,23 +212,23 @@ namespace Anvil * only use one mip. * @param in_create_flags Optional image features that the created image should support. * @param in_sparse_residency_scope Scope of sparse residency to request for the image. - * @param in_initial_layout Initial layout to use for the image. Must either be VK_IMAGE_LAYOUT_UNDEFINED or - * VK_IMAGE_LAYOUT_PREINITIALIZED. + * @param in_initial_layout Initial layout to use for the image. Must either be Anvil::ImageLayout::UNDEFINED or + * Anvil::ImageLayout::PREINITIALIZED. * * @return New image instance, if successful, or nullptr otherwise. **/ static ImageCreateInfoUniquePtr create_sparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, + Anvil::ImageType in_type, + Anvil::Format in_format, + Anvil::ImageTiling in_tiling, + ImageUsageFlags in_usage, uint32_t in_base_mipmap_width, uint32_t in_base_mipmap_height, uint32_t in_base_mipmap_depth, uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, + Anvil::SampleCountFlagBits in_sample_count, Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, + Anvil::SharingMode in_sharing_mode, bool in_use_full_mipmap_chain, ImageCreateFlags in_create_flags, Anvil::SparseResidencyScope in_residency_scope); @@ -259,11 +281,16 @@ namespace Anvil return m_exportable_external_memory_handle_types; } - const VkFormat& get_format() const + const Anvil::Format& get_format() const { return m_format; } + const Anvil::ImageInternalType& get_internal_type() const + { + return m_internal_type; + } + const Anvil::MemoryFeatureFlags& get_memory_features() const { return m_memory_features; @@ -285,12 +312,20 @@ namespace Anvil return m_n_layers; } - const VkImageLayout& get_post_alloc_image_layout() const + const std::vector get_physical_devices() const + { + anvil_assert(m_internal_type == Anvil::ImageInternalType::NONSPARSE_PEER_NO_ALLOC || + m_internal_type == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); + + return m_physical_devices; + } + + const Anvil::ImageLayout& get_post_alloc_image_layout() const { return m_post_alloc_layout; } - const VkImageLayout& get_post_create_image_layout() const + const Anvil::ImageLayout& get_post_create_image_layout() const { return m_post_create_layout; } @@ -301,9 +336,9 @@ namespace Anvil return m_queue_families; } - VkSampleCountFlagBits get_sample_count() const + Anvil::SampleCountFlagBits get_sample_count() const { - return static_cast(m_sample_count); + return m_sample_count; } const SparseResidencyScope& get_residency_scope() const @@ -311,49 +346,55 @@ namespace Anvil return m_residency_scope; } - const VkSharingMode& get_sharing_mode() const + const std::vector& get_sfr_rects() const + { + anvil_assert(m_internal_type == Anvil::ImageInternalType::NONSPARSE_PEER_NO_ALLOC || + m_internal_type == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); + + return m_sfr_rects; + } + + const Anvil::SharingMode& get_sharing_mode() const { return m_sharing_mode; } const Anvil::Swapchain* get_swapchain() const { - anvil_assert(m_type == Anvil::ImageType::SWAPCHAIN_WRAPPER); + anvil_assert(m_internal_type == Anvil::ImageInternalType::NONSPARSE_PEER_NO_ALLOC || + m_internal_type == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); return m_swapchain_ptr; } const VkImage& get_swapchain_image() const { - anvil_assert(m_type == Anvil::ImageType::SWAPCHAIN_WRAPPER); + anvil_assert(m_internal_type == Anvil::ImageInternalType::NONSPARSE_PEER_NO_ALLOC || + m_internal_type == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); return m_swapchain_image; } const uint32_t& get_swapchain_image_index() const { - anvil_assert(m_type == Anvil::ImageType::SWAPCHAIN_WRAPPER); + anvil_assert(m_internal_type == Anvil::ImageInternalType::NONSPARSE_PEER_NO_ALLOC || + m_internal_type == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); return m_n_swapchain_image; } /** Returns image tiling */ - const VkImageTiling& get_tiling() const + const Anvil::ImageTiling& get_tiling() const { return m_tiling; } const Anvil::ImageType& get_type() const - { - return m_type; - } - - const VkImageType& get_type_vk() const { return m_type_vk; } - const VkImageUsageFlags& get_usage_flags() const + const ImageUsageFlags& get_usage_flags() const { return m_usage_flags; } @@ -361,7 +402,7 @@ namespace Anvil /** Tells whether this Image wrapper instance holds a sparse image */ bool is_sparse() const { - return (m_type == Anvil::ImageType::SPARSE_NO_ALLOC); + return (m_internal_type == Anvil::ImageInternalType::SPARSE_NO_ALLOC); } //- @@ -380,7 +421,7 @@ namespace Anvil m_exportable_external_memory_handle_types = in_external_memory_handle_types; } - void set_format(const VkFormat& in_format) + void set_format(const Anvil::Format& in_format) { m_format = in_format; } @@ -410,12 +451,12 @@ namespace Anvil m_n_layers = in_n_layers; } - void set_post_alloc_layout(const VkImageLayout& in_post_alloc_layout) + void set_post_alloc_layout(const Anvil::ImageLayout& in_post_alloc_layout) { m_post_alloc_layout = in_post_alloc_layout; } - void set_post_create_layout(const VkImageLayout& in_post_create_layout) + void set_post_create_layout(const Anvil::ImageLayout& in_post_create_layout) { m_post_create_layout = in_post_create_layout; } @@ -430,22 +471,58 @@ namespace Anvil m_residency_scope = in_residency_scope; } - void set_sample_count(const VkSampleCountFlags& in_sample_count) + void set_sample_count(const Anvil::SampleCountFlagBits& in_sample_count) { m_sample_count = in_sample_count; } - void set_sharing_mode(const VkSharingMode& in_sharing_mode) + void set_physical_devices(const uint32_t& in_n_physical_devices, + const Anvil::PhysicalDevice* const* in_physical_devices_ptr) + { + m_physical_devices.clear(); + + for (uint32_t n_physical_device = 0; + n_physical_device < in_n_physical_devices; + ++n_physical_device) + { + m_physical_devices.push_back(in_physical_devices_ptr[n_physical_device]); + } + } + + void set_SFR_rectangles(const uint32_t& in_n_SFR_rects, + const VkRect2D* in_SFRs_ptr) + { + m_sfr_rects.clear(); + + for (uint32_t n_sfr_rect = 0; + n_sfr_rect < in_n_SFR_rects; + ++n_sfr_rect) + { + m_sfr_rects.push_back(in_SFRs_ptr[n_sfr_rect]); + } + } + + void set_sharing_mode(const Anvil::SharingMode& in_sharing_mode) { m_sharing_mode = in_sharing_mode; } - void set_tiling(const VkImageTiling& in_tiling) + void set_swapchain(const Anvil::Swapchain* in_swapchain_ptr) + { + m_swapchain_ptr = in_swapchain_ptr; + } + + void set_swapchain_image_index(const uint32_t& in_n_swapchain_image_index) + { + m_n_swapchain_image = in_n_swapchain_image_index; + } + + void set_tiling(const Anvil::ImageTiling& in_tiling) { m_tiling = in_tiling; } - void set_usage_flags(const VkImageUsageFlags& in_usage_flags) + void set_usage_flags(const ImageUsageFlags& in_usage_flags) { m_usage_flags = in_usage_flags; } @@ -468,23 +545,23 @@ namespace Anvil private: /* Private functions */ - ImageCreateInfo(Anvil::ImageType in_type, + ImageCreateInfo(Anvil::ImageInternalType in_type, const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type_vk, - VkFormat in_format, - VkImageTiling in_tiling, - VkSharingMode in_sharing_mode, - VkImageUsageFlags in_usage, + Anvil::ImageType in_type_vk, + Anvil::Format in_format, + Anvil::ImageTiling in_tiling, + Anvil::SharingMode in_sharing_mode, + ImageUsageFlags in_usage, uint32_t in_base_mipmap_width, uint32_t in_base_mipmap_height, uint32_t in_base_mipmap_depth, uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, + Anvil::SampleCountFlagBits in_sample_count, bool in_use_full_mipmap_chain, ImageCreateFlags in_create_flags, Anvil::QueueFamilyBits in_queue_families, - VkImageLayout in_post_create_image_layout, - const VkImageLayout& in_post_alloc_image_layout, + Anvil::ImageLayout in_post_create_image_layout, + const Anvil::ImageLayout& in_post_alloc_image_layout, const std::vector* in_opt_mipmaps_ptr, const Anvil::MTSafety& in_mt_safety, Anvil::ExternalMemoryHandleTypeBits in_exportable_external_memory_handle_types, @@ -497,25 +574,29 @@ namespace Anvil uint32_t m_depth; const Anvil::BaseDevice* m_device_ptr; Anvil::ExternalMemoryHandleTypeBits m_exportable_external_memory_handle_types; - VkFormat m_format; + Anvil::Format m_format; uint32_t m_height; + const Anvil::ImageInternalType m_internal_type; Anvil::MemoryFeatureFlags m_memory_features; std::vector m_mipmaps_to_upload; Anvil::MTSafety m_mt_safety; uint32_t m_n_layers; - VkImageLayout m_post_alloc_layout; - VkImageLayout m_post_create_layout; + Anvil::ImageLayout m_post_alloc_layout; + Anvil::ImageLayout m_post_create_layout; Anvil::QueueFamilyBits m_queue_families; Anvil::SparseResidencyScope m_residency_scope; - VkSampleCountFlags m_sample_count; - VkSharingMode m_sharing_mode; - VkImageTiling m_tiling; - const Anvil::ImageType m_type; - const VkImageType m_type_vk; - VkImageUsageFlags m_usage_flags; + Anvil::SampleCountFlagBits m_sample_count; + Anvil::SharingMode m_sharing_mode; + Anvil::ImageTiling m_tiling; + const Anvil::ImageType m_type_vk; + ImageUsageFlags m_usage_flags; bool m_use_full_mipmap_chain; uint32_t m_width; + /* Only used for peer images */ + std::vector m_physical_devices; + std::vector m_sfr_rects; + /* Only used for swapchain wrapper images */ uint32_t m_n_swapchain_image; VkImage m_swapchain_image; diff --git a/include/misc/image_view_create_info.h b/include/misc/image_view_create_info.h index f24c22f8..2d06177d 100644 --- a/include/misc/image_view_create_info.h +++ b/include/misc/image_view_create_info.h @@ -58,12 +58,12 @@ namespace Anvil uint32_t in_n_base_layer, uint32_t in_n_base_mipmap_level, uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha); + Anvil::ImageAspectFlags in_aspect_mask, + Anvil::Format in_format, + Anvil::ComponentSwizzle in_swizzle_red, + Anvil::ComponentSwizzle in_swizzle_green, + Anvil::ComponentSwizzle in_swizzle_blue, + Anvil::ComponentSwizzle in_swizzle_alpha); /** Use this function if you need to create a single-sample 1D array image view wrapper instance. * @@ -93,12 +93,12 @@ namespace Anvil uint32_t in_n_layers, uint32_t in_n_base_mipmap_level, uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha); + Anvil::ImageAspectFlags in_aspect_mask, + Anvil::Format in_format, + Anvil::ComponentSwizzle in_swizzle_red, + Anvil::ComponentSwizzle in_swizzle_green, + Anvil::ComponentSwizzle in_swizzle_blue, + Anvil::ComponentSwizzle in_swizzle_alpha); /** Use this function if you need to create a single-sample or a multi-sample 2D image view wrapper instance. The view will be @@ -128,12 +128,12 @@ namespace Anvil uint32_t in_n_base_layer, uint32_t in_n_base_mipmap_level, uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha); + Anvil::ImageAspectFlags in_aspect_mask, + Anvil::Format in_format, + Anvil::ComponentSwizzle in_swizzle_red, + Anvil::ComponentSwizzle in_swizzle_green, + Anvil::ComponentSwizzle in_swizzle_blue, + Anvil::ComponentSwizzle in_swizzle_alpha); /** Use this function if you need to create a single-sample or a multi-sample 2D array image view wrapper instance. The view will be * single-sample if @param in_image_ptr uses 1 sample per texel, and multi-sample otherwise. @@ -164,12 +164,12 @@ namespace Anvil uint32_t in_n_layers, uint32_t in_n_base_mipmap_level, uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha); + Anvil::ImageAspectFlags in_aspect_mask, + Anvil::Format in_format, + Anvil::ComponentSwizzle in_swizzle_red, + Anvil::ComponentSwizzle in_swizzle_green, + Anvil::ComponentSwizzle in_swizzle_blue, + Anvil::ComponentSwizzle in_swizzle_alpha); /** Use this function if you need to create a single-sample 3D image view wrapper instance. * @@ -199,12 +199,12 @@ namespace Anvil uint32_t in_n_slices, uint32_t in_n_base_mipmap_level, uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha); + Anvil::ImageAspectFlags in_aspect_mask, + Anvil::Format in_format, + Anvil::ComponentSwizzle in_swizzle_red, + Anvil::ComponentSwizzle in_swizzle_green, + Anvil::ComponentSwizzle in_swizzle_blue, + Anvil::ComponentSwizzle in_swizzle_alpha); /** Use this function if you need to create a cube-map image view wrapper instance. * @@ -232,12 +232,12 @@ namespace Anvil uint32_t in_n_base_layer, uint32_t in_n_base_mipmap_level, uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha); + Anvil::ImageAspectFlags in_aspect_mask, + Anvil::Format in_format, + Anvil::ComponentSwizzle in_swizzle_red, + Anvil::ComponentSwizzle in_swizzle_green, + Anvil::ComponentSwizzle in_swizzle_blue, + Anvil::ComponentSwizzle in_swizzle_alpha); /** Use this function if you need to create a cube-map array image view wrapper instance. * @@ -268,15 +268,15 @@ namespace Anvil uint32_t in_n_cube_maps, uint32_t in_n_base_mipmap_level, uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha); + Anvil::ImageAspectFlags in_aspect_mask, + Anvil::Format in_format, + Anvil::ComponentSwizzle in_swizzle_red, + Anvil::ComponentSwizzle in_swizzle_green, + Anvil::ComponentSwizzle in_swizzle_blue, + Anvil::ComponentSwizzle in_swizzle_alpha); /* Returns the aspect assigned to the image view */ - VkImageAspectFlags get_aspect() const + Anvil::ImageAspectFlags get_aspect() const { return m_aspect_mask; } @@ -299,7 +299,7 @@ namespace Anvil } /** Returns image view's format */ - const VkFormat get_format() const + const Anvil::Format get_format() const { return m_format; } @@ -334,7 +334,7 @@ namespace Anvil } /** Returns swizzle array assigned to the image view */ - const std::array& get_swizzle_array() const + const std::array& get_swizzle_array() const { return m_swizzle_array; } @@ -345,7 +345,18 @@ namespace Anvil return m_type; } - void set_aspect(const VkImageAspectFlags& in_aspect) + /** Returns usage flags associated with the image view. + * + * NOTE: If the function returns Anvil::IMAGE_USAGE_FLAG_UNKNOWN, the image view inherits usage bits + * from the parent image. + * + */ + const Anvil::ImageUsageFlags& get_usage() const + { + return m_usage; + } + + void set_aspect(const Anvil::ImageAspectFlags& in_aspect) { m_aspect_mask = in_aspect; } @@ -365,7 +376,7 @@ namespace Anvil m_device_ptr = in_device_ptr; } - void set_format(const VkFormat& in_format) + void set_format(const Anvil::Format& in_format) { m_format = in_format; } @@ -395,42 +406,53 @@ namespace Anvil m_parent_image_ptr = in_parent_image_ptr; } - void set_swizzle_array(const std::array& in_swizzle_array) + void set_swizzle_array(const std::array& in_swizzle_array) { m_swizzle_array = in_swizzle_array; } + /* By default, image views inherit usage flags from the parent image. You can use this setter function to override + * the default behavior with a subset of parent image's usage flags. + * + * Requires VK_KHR_maintenance2. + */ + void set_usage(const Anvil::ImageUsageFlags& in_usage) + { + m_usage = in_usage; + } + private: /* Private functions */ - ImageViewCreateInfo(const VkImageAspectFlags& in_aspect_mask, - const Anvil::BaseDevice* in_device_ptr, - const VkFormat in_format, - const uint32_t in_n_base_layer, - const uint32_t in_n_base_mipmap_level, - const uint32_t in_n_layers, - const uint32_t in_n_mipmaps, - const uint32_t in_n_slices, - Anvil::Image* in_parent_image_ptr, - const VkComponentSwizzle* in_swizzle_array_ptr, - const VkImageViewType in_type, - const Anvil::MTSafety& in_mt_safety); + ImageViewCreateInfo(const Anvil::ImageAspectFlags& in_aspect_mask, + const Anvil::BaseDevice* in_device_ptr, + const Anvil::Format in_format, + const uint32_t in_n_base_layer, + const uint32_t in_n_base_mipmap_level, + const uint32_t in_n_layers, + const uint32_t in_n_mipmaps, + const uint32_t in_n_slices, + Anvil::Image* in_parent_image_ptr, + const Anvil::ComponentSwizzle* in_swizzle_array_ptr, + const VkImageViewType in_type, + const Anvil::MTSafety& in_mt_safety); /* Private variables */ - VkImageAspectFlagsVariable(m_aspect_mask); - - const Anvil::BaseDevice* m_device_ptr; - VkFormat m_format; - Anvil::MTSafety m_mt_safety; - uint32_t m_n_base_layer; - uint32_t m_n_base_mipmap_level; - uint32_t m_n_layers; - uint32_t m_n_mipmaps; - uint32_t m_n_slices; - Anvil::Image* m_parent_image_ptr; - std::array m_swizzle_array; - const VkImageViewType m_type; + Anvil::ImageAspectFlags m_aspect_mask; + + const Anvil::BaseDevice* m_device_ptr; + Anvil::Format m_format; + Anvil::MTSafety m_mt_safety; + uint32_t m_n_base_layer; + uint32_t m_n_base_mipmap_level; + uint32_t m_n_layers; + uint32_t m_n_mipmaps; + uint32_t m_n_slices; + Anvil::Image* m_parent_image_ptr; + std::array m_swizzle_array; + const VkImageViewType m_type; + VkImageUsageFlags m_usage; ANVIL_DISABLE_ASSIGNMENT_OPERATOR(ImageViewCreateInfo); ANVIL_DISABLE_COPY_CONSTRUCTOR(ImageViewCreateInfo); diff --git a/include/misc/memalloc_backends/backend_oneshot.h b/include/misc/memalloc_backends/backend_oneshot.h index 5ac7fa7d..2f7e575b 100644 --- a/include/misc/memalloc_backends/backend_oneshot.h +++ b/include/misc/memalloc_backends/backend_oneshot.h @@ -68,6 +68,7 @@ namespace Anvil void** out_result_ptr) final; bool supports_baking () const final; bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) const final; + bool supports_device_masks () const final; void unmap (void* in_memory_object) final; /* Private functions */ diff --git a/include/misc/memalloc_backends/backend_vma.h b/include/misc/memalloc_backends/backend_vma.h index 8877a8e2..e9a7a15b 100644 --- a/include/misc/memalloc_backends/backend_vma.h +++ b/include/misc/memalloc_backends/backend_vma.h @@ -129,6 +129,7 @@ namespace Anvil VkDeviceSize in_size, void** out_result_ptr); bool supports_baking () const final; + bool supports_device_masks () const final; bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) const final; void unmap (void* in_memory_object); diff --git a/include/misc/memory_allocator.h b/include/misc/memory_allocator.h index 4ae1de0c..d22539e3 100644 --- a/include/misc/memory_allocator.h +++ b/include/misc/memory_allocator.h @@ -38,9 +38,11 @@ namespace Anvil { + typedef std::pair LocalRemoteDeviceIndexPair; typedef std::function MemoryAllocatorBakeCallbackFunction; typedef std::function MemoryAllocatorPostBakePerNonSparseBufferItemMemAssignmentCallback; typedef std::function MemoryAllocatorPostBakePerNonSparseImageItemMemAssignmentCallback; + typedef std::map MGPUPeerMemoryRequirements; class MemoryAllocator : public MTSafetySupportProvider { @@ -75,6 +77,7 @@ namespace Anvil const Anvil::ExternalNTHandleInfo* alloc_external_nt_handle_info_ptr; #endif + uint32_t alloc_device_mask; Anvil::ExternalMemoryHandleTypeBits alloc_exportable_external_handle_types; bool alloc_is_dedicated_memory; MemoryBlockUniquePtr alloc_memory_block_ptr; @@ -83,6 +86,7 @@ namespace Anvil MemoryFeatureFlags alloc_memory_required_features; uint32_t alloc_memory_supported_memory_types; uint32_t alloc_memory_types; + MGPUPeerMemoryRequirements alloc_mgpu_peer_memory_reqs; VkDeviceSize alloc_offset; VkDeviceSize alloc_size; @@ -105,7 +109,9 @@ namespace Anvil #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, #endif - const bool& in_alloc_is_dedicated); + const bool& in_alloc_is_dedicated, + const uint32_t& in_device_mask, + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs); Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, Anvil::Buffer* in_buffer_ptr, @@ -119,7 +125,9 @@ namespace Anvil #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, #endif - const bool& in_alloc_is_dedicated); + const bool& in_alloc_is_dedicated, + const uint32_t& in_device_mask, + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs); Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, Anvil::Image* in_image_ptr, @@ -134,7 +142,9 @@ namespace Anvil #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, #endif - const bool& in_alloc_is_dedicated); + const bool& in_alloc_is_dedicated, + const uint32_t& in_device_mask, + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs); Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, Anvil::Image* in_image_ptr, @@ -150,7 +160,9 @@ namespace Anvil #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, #endif - const bool& in_alloc_is_dedicated); + const bool& in_alloc_is_dedicated, + const uint32_t& in_device_mask, + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs); Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, Anvil::Image* in_image_ptr, @@ -163,7 +175,9 @@ namespace Anvil #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, #endif - const bool& in_alloc_is_dedicated); + const bool& in_alloc_is_dedicated, + const uint32_t& in_device_mask, + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs); /** TODO */ ~Item(); @@ -189,6 +203,7 @@ namespace Anvil } virtual bool bake (Items& in_items) = 0; + virtual bool supports_device_masks () const = 0; virtual bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) const = 0; }; @@ -208,80 +223,93 @@ namespace Anvil * @param in_required_memory_features Memory features the assigned memory must support. * See MemoryFeatureFlagBits for more details. * @param in_opt_external_nt_handle_info_ptr TODO. Pointer must remain valid till baking time. + * @param in_opt_device_mask_ptr If not null, deref should contain a valid device mask to be used for + * the allocation. Specifying a device mask annotates the allocation request + * with VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT flag. Value from deref is copied + * at call time, the pointer may be released when the func leaves. * * @return true if the buffer has been successfully scheduled for baking, false otherwise. **/ bool add_buffer (Anvil::Buffer* in_buffer_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0 + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif - ); + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); bool add_buffer_with_float_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0 + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif - ); + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); bool add_buffer_with_float_data_vector_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0 + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif - ); + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); bool add_buffer_with_float_data_vector_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, const std::vector* in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0 + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif - ); + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); bool add_buffer_with_uchar8_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0 + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif - ); + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); bool add_buffer_with_uchar8_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0 + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif - ); + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); bool add_buffer_with_uint32_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0 + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif - ); + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); bool add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0 + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif - ); + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); bool add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, const std::vector* in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0 + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif - ); + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); /** TODO * @@ -289,13 +317,22 @@ namespace Anvil * @param in_offset TODO. Must be divisible by VkMemoryRequirements::alignment * @param in_size TODO. * @param in_required_memory_features TODO + * @param in_opt_device_mask_ptr If not null, deref should contain a valid device mask to be used for + * the allocation. Specifying a device mask annotates the allocation request + * with VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT flag. Value from deref is copied + * at call time, the pointer may be released when the func leaves. + * @param in_opt_memory_reqs_ptr If not null, deref contains information of peer memory requirements which + * should be taken into account when determining which memory heap allocations + * should be made off. Specified device indices must be included in @param in_opt_device_mask_ptr. * * @return TODO */ - bool add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_offset, - VkDeviceSize in_size, - MemoryFeatureFlags in_required_memory_features); + bool add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkDeviceSize in_size, + MemoryFeatureFlags in_required_memory_features, + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); /** Adds an Image object which should be assigned storage coming from memory objects @@ -309,16 +346,21 @@ namespace Anvil * @param in_required_memory_features Memory features the assigned memory must support. * See MemoryFeatureFlagBits for more details. * @param in_opt_external_nt_handle_info_ptr TODO. Pointer must remain valid till baking time. + * @param in_opt_device_mask_ptr If not null, deref should contain a valid device mask to be used for + * the allocation. Specifying a device mask annotates the allocation request + * with VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT flag. Value from deref is copied + * at call time, the pointer may be released when the func leaves. * * @return true if the image has been successfully scheduled for baking, false otherwise. **/ bool add_image_whole(Anvil::Image* in_image_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0 + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif - ); + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); /** Adds a new Image object whose layer @param in_n_layer 's miptail for @param in_aspect @@ -335,13 +377,19 @@ namespace Anvil * @param in_n_layer Index of the layer to attach the miptail to. * @param in_required_memory_features Memory features the assigned memory must support. * See MemoryFeatureFlagBits for more details. + * @param in_opt_device_mask_ptr If not null, deref should contain a valid device mask to be used for + * the allocation. Specifying a device mask annotates the allocation request + * with VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT flag. Value from deref is copied + * at call time, the pointer may be released when the func leaves. * * @return true if the miptail has been successfully scheduled for baking, false otherwise. */ - bool add_sparse_image_miptail(Anvil::Image* in_image_ptr, - VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - MemoryFeatureFlags in_required_memory_features); + bool add_sparse_image_miptail(Anvil::Image* in_image_ptr, + Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + MemoryFeatureFlags in_required_memory_features, + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); /** Adds a single subresource which should be assigned memory backing. @@ -359,15 +407,20 @@ namespace Anvil * @param in_offset + @param in_extent touches the subresource border. * @param in_required_memory_features Memory features the assigned memory must support. * See MemoryFeatureFlagBits for more details. + * @param in_opt_device_mask_ptr If not null, deref should contain a valid device mask to be used for + * the allocation. Specifying a device mask annotates the allocation request + * with VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT flag. Value from deref is copied + * at call time, the pointer may be released when the func leaves. * * @return true if the subresource has been successfully scheduled for baking, false otherwise. **/ - bool add_sparse_image_subresource(Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - VkExtent3D in_extent, - MemoryFeatureFlags in_required_memory_features); - + bool add_sparse_image_subresource(Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + VkExtent3D in_extent, + MemoryFeatureFlags in_required_memory_features, + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); /** TODO */ bool bake(); @@ -385,6 +438,7 @@ namespace Anvil * * This type of allocator supports an arbitrary number of implicit or explicit bake invocations. * This type of allocator does NOT support external handles of any type. + * This type of allocator does NOT support device masks. * * @param in_device_ptr Device to use. **/ @@ -440,13 +494,16 @@ namespace Anvil /* Private functions */ bool add_buffer_internal(Anvil::Buffer* in_buffer_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - ); + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr); bool do_external_memory_handle_type_sanity_checks(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) const; + bool do_mgpu_sanity_checks (const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_peer_memory_reqs_ptr) const; bool is_alloc_supported (uint32_t in_memory_types, Anvil::MemoryFeatureFlags in_memory_features, uint32_t* out_opt_filtered_memory_types_ptr) const; diff --git a/include/misc/memory_block_create_info.h b/include/misc/memory_block_create_info.h index 234d99de..d27bb59b 100644 --- a/include/misc/memory_block_create_info.h +++ b/include/misc/memory_block_create_info.h @@ -76,6 +76,12 @@ namespace Anvil OnMemoryBlockReleaseCallbackFunction in_on_release_callback_function); /** Spawns a create info instance which can be used to instantiate a new memory block. + * + * This function can be used for both single- and multi-GPU device instances. For the latter case, + * the default behavior is to allocate a single instance of memory (deviceMask = 1) for memory heaps + * that do NOT have the VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR bit on, or allocate as many instances + * of memory as there are physical devices assigned to the logical device. This can be adjusted + * by calling corresponding set_..() functions. * * NOTE: The following parameters take the following defautl values: * @@ -127,6 +133,11 @@ namespace Anvil return m_device_ptr; } + const uint32_t& get_device_mask() const + { + return m_device_mask; + } + const Anvil::ExternalMemoryHandleTypeBits& get_exportable_external_memory_handle_types() const { return m_exportable_external_memory_handle_types; @@ -226,6 +237,12 @@ namespace Anvil return m_type; } + /* Requires VK_KHR_device_group */ + void set_device_mask(const uint32_t& in_device_mask) + { + m_device_mask = in_device_mask; + } + /* Requires VK_KHR_external_memory */ void set_exportable_external_memory_handle_types(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) { @@ -333,7 +350,14 @@ namespace Anvil const VkDeviceSize& in_size, const VkDeviceSize& in_start_offset); + /* NOTE: Only to be used by Anvil::MemoryBlock! */ + void set_memory_type_index(const uint32_t& in_new_index) + { + m_memory_type_index = in_new_index; + } + uint32_t m_allowed_memory_bits; + uint32_t m_device_mask; const Anvil::BaseDevice* m_device_ptr; Anvil::ExternalMemoryHandleTypeBits m_exportable_external_memory_handle_types; Anvil::ExternalMemoryHandleTypeBit m_imported_external_memory_handle_type; @@ -362,6 +386,8 @@ namespace Anvil ANVIL_DISABLE_ASSIGNMENT_OPERATOR(MemoryBlockCreateInfo); ANVIL_DISABLE_COPY_CONSTRUCTOR(MemoryBlockCreateInfo); + + friend class MemoryBlock; }; } /* namespace Anvil */ diff --git a/include/misc/render_pass_create_info.h b/include/misc/render_pass_create_info.h index ae91e27a..7eab70e8 100644 --- a/include/misc/render_pass_create_info.h +++ b/include/misc/render_pass_create_info.h @@ -33,10 +33,6 @@ namespace Anvil ~RenderPassCreateInfo(); /** Adds a new render-pass color attachment to the internal data model. - * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. * * @param in_format Image format to use for the color attachment. * @param in_sample_count Number of samples to use for the color attachment (expressed as enum value). @@ -52,20 +48,16 @@ namespace Anvil * * @return true if the function executed successfully, false otherwise. **/ - bool add_color_attachment(VkFormat in_format, - VkSampleCountFlags in_sample_count, - VkAttachmentLoadOp in_load_op, - VkAttachmentStoreOp in_store_op, - VkImageLayout in_initial_layout, - VkImageLayout in_final_layout, - bool in_may_alias, - RenderPassAttachmentID* out_attachment_id_ptr); + bool add_color_attachment(Anvil::Format in_format, + Anvil::SampleCountFlagBits in_sample_count, + VkAttachmentLoadOp in_load_op, + VkAttachmentStoreOp in_store_op, + Anvil::ImageLayout in_initial_layout, + Anvil::ImageLayout in_final_layout, + bool in_may_alias, + RenderPassAttachmentID* out_attachment_id_ptr); /** Adds a new render-pass depth/stencil attachment to the internal data model. - * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. * * @param in_format Image format to use for the color attachment. * @param in_sample_count Number of samples to use for the depth-stencil attachment (expressed as enum value). @@ -83,22 +75,18 @@ namespace Anvil * * @return true if the function executed successfully, false otherwise. **/ - bool add_depth_stencil_attachment(VkFormat in_format, - VkSampleCountFlags in_sample_count, - VkAttachmentLoadOp in_depth_load_op, - VkAttachmentStoreOp in_depth_store_op, - VkAttachmentLoadOp in_stencil_load_op, - VkAttachmentStoreOp in_stencil_store_op, - VkImageLayout in_initial_layout, - VkImageLayout in_final_layout, - bool in_may_alias, - RenderPassAttachmentID* out_attachment_id_ptr); + bool add_depth_stencil_attachment(Anvil::Format in_format, + Anvil::SampleCountFlagBits in_sample_count, + VkAttachmentLoadOp in_depth_load_op, + VkAttachmentStoreOp in_depth_store_op, + VkAttachmentLoadOp in_stencil_load_op, + VkAttachmentStoreOp in_stencil_store_op, + Anvil::ImageLayout in_initial_layout, + Anvil::ImageLayout in_final_layout, + bool in_may_alias, + RenderPassAttachmentID* out_attachment_id_ptr); /** Adds a new subpass to the internal data model. - * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. * * @param out_subpass_id_ptr Deref will be set to a unique ID of the created subpass. * Must not be nullptr. @@ -108,10 +96,6 @@ namespace Anvil bool add_subpass(SubPassID* out_subpass_id_ptr); /** Adds a new color attachment to the RenderPass instance's specified subpass. - * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. * * @param in_subpass_id ID of the render-pass subpass to update. * @param in_layout Layout to use for the attachment when executing the subpass. @@ -128,7 +112,7 @@ namespace Anvil * @return true if the function executed successfully, false otherwise. **/ bool add_subpass_color_attachment(SubPassID in_subpass_id, - VkImageLayout in_layout, + Anvil::ImageLayout in_layout, RenderPassAttachmentID in_attachment_id, uint32_t in_location, const RenderPassAttachmentID* in_opt_attachment_resolve_id_ptr); @@ -138,53 +122,44 @@ namespace Anvil * Note that only up to one depth/stencil attachment may be added for each subpass. * Any attempt to add more such attachments will results in an assertion failure. * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. - * - * @param in_subpass_id ID of the subpass to update the depth+stencil attachment for. - * The subpass must have been earlier created with an add_subpass() call. - * @param in_layout Layout to use for the attachment when executing the subpass. - * Driver takes care of transforming the attachment to the requested layout - * before subpass commands starts executing. - * @param in_attachment_id ID of the render-pass attachment the depth-stencil attachment should refer to. - + * @param in_subpass_id ID of the subpass to update the depth+stencil attachment for. + * The subpass must have been earlier created with an add_subpass() call. + * @param in_layout Layout to use for the attachment when executing the subpass. + * Driver takes care of transforming the attachment to the requested layout + * before subpass commands starts executing. + * @param in_attachment_id ID of the render-pass attachment the depth-stencil attachment should refer to. * * @return true if the function executed successfully, false otherwise. * */ - bool add_subpass_depth_stencil_attachment(SubPassID in_subpass_id, - VkImageLayout in_layout, - RenderPassAttachmentID in_attachment_id); + bool add_subpass_depth_stencil_attachment(SubPassID in_subpass_id, + Anvil::ImageLayout in_layout, + RenderPassAttachmentID in_attachment_id); /** Adds a new input attachment to the RenderPass instance's specified subpass. * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. - * - * @param in_subpass_id ID of the render-pass subpass to update. - * @param in_layout Layout to use for the attachment when executing the subpass. - * Driver takes care of transforming the attachment to the requested layout - * before subpass commands starts executing. - * @param in_attachment_id ID of the render-pass attachment the new sub-pass input attachment - * should refer to. - * @param in_attachment_index The "input attachment index", under which the specified attachment should - * be accessible to the fragment shader. Do not forget the image view also - * needs to be bound to the descriptor set for the input attachment to work! - * + * @param in_subpass_id ID of the render-pass subpass to update. + * @param in_layout Layout to use for the attachment when executing the subpass. + * Driver takes care of transforming the attachment to the requested layout + * before subpass commands starts executing. + * @param in_attachment_id ID of the render-pass attachment the new sub-pass input attachment + * should refer to. + * @param in_attachment_index The "input attachment index", under which the specified attachment should + * be accessible to the fragment shader. Do not forget the image view also + * needs to be bound to the descriptor set for the input attachment to work! + * @param in_opt_aspects_accessed If set to a value != ImageAspectFlagBits::UNKNOWN and KHR_maintenance2 is supported, + * the additional information will be passed down to the driver which may result + * in improved performance. + * @return true if the function executed successfully, false otherwise. **/ - bool add_subpass_input_attachment(SubPassID in_subpass_id, - VkImageLayout in_layout, - RenderPassAttachmentID in_attachment_id, - uint32_t in_attachment_index); + bool add_subpass_input_attachment(SubPassID in_subpass_id, + Anvil::ImageLayout in_layout, + RenderPassAttachmentID in_attachment_id, + uint32_t in_attachment_index, + const Anvil::ImageAspectFlags& in_opt_aspects_accessed = Anvil::ImageAspectFlagBits::IMAGE_ASPECT_UNKNOWN); /** Adds a new external->subpass dependency to the internal data model. - * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. * * @param in_destination_subpass_id ID of the destination subpass. The subpass must have been * created earlier with an add_subpass() call. @@ -205,10 +180,6 @@ namespace Anvil bool in_by_region); /** Adds a new self-subpass dependency to the internal data model. - * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. * * @param in_destination_subpass_id ID of the subpass to create the dep for. The subpass must have been * created earlier with an add_subpass() call. @@ -229,10 +200,6 @@ namespace Anvil bool in_by_region); /** Adds a new subpass->external dependency to the internal data model. - * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. * * @param in_source_subpass_id ID of the source subpass. The subpass must have been * created earlier with an add_subpass() call. @@ -252,10 +219,6 @@ namespace Anvil bool in_by_region); /** Adds a new subpass->subpass dependency to the internal data model. - * - * This function does NOT re-create the internal VkRenderPass instance. Instead, - * it marks the RenderPass as dirty, which will cause the object to be re-created - * at next bake() or get_render_pass() request. * * @param in_source_subpass_id ID of the source subpass. The subpass must have been * created earlier with an add_subpass() call. @@ -303,13 +266,13 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool get_color_attachment_properties(RenderPassAttachmentID in_attachment_id, - VkSampleCountFlagBits* out_opt_sample_count_ptr = nullptr, - VkAttachmentLoadOp* out_opt_load_op_ptr = nullptr, - VkAttachmentStoreOp* out_opt_store_op_ptr = nullptr, - VkImageLayout* out_opt_initial_layout_ptr = nullptr, - VkImageLayout* out_opt_final_layout_ptr = nullptr, - bool* out_opt_may_alias_ptr = nullptr) const; + bool get_color_attachment_properties(RenderPassAttachmentID in_attachment_id, + Anvil::SampleCountFlagBits* out_opt_sample_count_ptr = nullptr, + VkAttachmentLoadOp* out_opt_load_op_ptr = nullptr, + VkAttachmentStoreOp* out_opt_store_op_ptr = nullptr, + Anvil::ImageLayout* out_opt_initial_layout_ptr = nullptr, + Anvil::ImageLayout* out_opt_final_layout_ptr = nullptr, + bool* out_opt_may_alias_ptr = nullptr) const; /** Retrieves properties of a dependency at user-specified index. * @@ -328,8 +291,7 @@ namespace Anvil * Must not be null. * @param out_source_access_mask_ptr Deref will be set to the source access mask set for the dependency. * Must not be null. - * @param out_by_region_ptr Deref will be set to true, if the dependency is a by-region dependency. - * If it is not, deref will be set to false. Must not be null. + * @param out_flags_ptr Deref will be set to flags specified for the dependency. Must not be null. * * @return true if successful, false otherwise */ @@ -340,7 +302,7 @@ namespace Anvil VkPipelineStageFlags* out_source_stage_mask_ptr, VkAccessFlags* out_destination_access_mask_ptr, VkAccessFlags* out_source_access_mask_ptr, - bool* out_by_region_ptr) const; + DependencyFlags* out_flags_ptr) const; /** Retrieves properties of the render pass color attachment with the user-specified ID * @@ -368,8 +330,8 @@ namespace Anvil VkAttachmentStoreOp* out_opt_depth_store_op_ptr = nullptr, VkAttachmentLoadOp* out_opt_stencil_load_op_ptr = nullptr, VkAttachmentStoreOp* out_opt_stencil_store_op_ptr = nullptr, - VkImageLayout* out_opt_initial_layout_ptr = nullptr, - VkImageLayout* out_opt_final_layout_ptr = nullptr, + Anvil::ImageLayout* out_opt_initial_layout_ptr = nullptr, + Anvil::ImageLayout* out_opt_final_layout_ptr = nullptr, bool* out_opt_may_alias_ptr = nullptr) const; const Anvil::BaseDevice* get_device() const @@ -406,8 +368,6 @@ namespace Anvil } /** Retrieves subpass attachment properties, as specified at creation time. - * - * Triggers baking process if the renderpass is marked as dirty. * * @param in_subpass_id ID of the subpass to use for the query. * @param in_attachment_type Type of the attachment to use for the query. Must not be ATTACHMENT_TYPE_PRESERVE. @@ -415,19 +375,18 @@ namespace Anvil * attachment uses. * @param out_layout_ptr Deref will be set to the image layout assigned to the attachment for the specific * subpass. Must be NULL if @param in_attachment_type is ATTACHMENT_TYPE_PRESERVE. + * @param out_opt_aspects_accessed_ptr Only relevant for input attachments and KHR_maintenance2 is supported. * * @return true if successful, false otherwise. */ - bool get_subpass_attachment_properties(SubPassID in_subpass_id, - AttachmentType in_attachment_type, - uint32_t in_n_subpass_attachment, - RenderPassAttachmentID* out_renderpass_attachment_id_ptr, - VkImageLayout* out_layout_ptr) const; + bool get_subpass_attachment_properties(SubPassID in_subpass_id, + AttachmentType in_attachment_type, + uint32_t in_n_subpass_attachment, + RenderPassAttachmentID* out_renderpass_attachment_id_ptr, + Anvil::ImageLayout* out_layout_ptr, + Anvil::ImageAspectFlags* out_opt_aspects_accessed_ptr = nullptr) const; /** Returns the number of attachments of user-specified type, defined for the specified subpass. - * - * This function may trigger renderpass bake process, if the renderpass is marked as dirty - * at the query time, and @param in_attachment_type is set to ATTACHMENT_TYPE_PRESERVE. * * @param in_subpass_id As per description. * @param in_attachment_type Type of the attachment to use for the query. @@ -451,18 +410,17 @@ namespace Anvil /** Holds properties of a single render-pass attachment. **/ typedef struct RenderPassAttachment { - VkAttachmentLoadOp color_depth_load_op; - VkAttachmentStoreOp color_depth_store_op; - VkImageLayout final_layout; - VkFormat format; - uint32_t index; - VkImageLayout initial_layout; - bool may_alias; - VkAttachmentLoadOp stencil_load_op; - VkAttachmentStoreOp stencil_store_op; - AttachmentType type; - - VkSampleCountFlagsVariable(sample_count); + VkAttachmentLoadOp color_depth_load_op; + VkAttachmentStoreOp color_depth_store_op; + Anvil::ImageLayout final_layout; + Anvil::Format format; + uint32_t index; + Anvil::ImageLayout initial_layout; + bool may_alias; + Anvil::SampleCountFlagBits sample_count; + VkAttachmentLoadOp stencil_load_op; + VkAttachmentStoreOp stencil_store_op; + AttachmentType type; /** Constructor. Should only be used for color attachments. * @@ -477,14 +435,14 @@ namespace Anvil * memory region of another attachment; false otherwise. * @param in_index Index of the created render-pass attachment. ***/ - RenderPassAttachment(VkFormat in_format, - VkSampleCountFlags in_sample_count, - VkAttachmentLoadOp in_load_op, - VkAttachmentStoreOp in_store_op, - VkImageLayout in_initial_layout, - VkImageLayout in_final_layout, - bool in_may_alias, - uint32_t in_index) + RenderPassAttachment(Anvil::Format in_format, + Anvil::SampleCountFlagBits in_sample_count, + VkAttachmentLoadOp in_load_op, + VkAttachmentStoreOp in_store_op, + Anvil::ImageLayout in_initial_layout, + Anvil::ImageLayout in_final_layout, + bool in_may_alias, + uint32_t in_index) { color_depth_load_op = in_load_op; color_depth_store_op = in_store_op; @@ -514,16 +472,16 @@ namespace Anvil * memory region of another attachment; false otherwise. * @param in_index Index of the created render-pass attachment. **/ - RenderPassAttachment(VkFormat in_format, - VkSampleCountFlags in_sample_count, - VkAttachmentLoadOp in_depth_load_op, - VkAttachmentStoreOp in_depth_store_op, - VkAttachmentLoadOp in_stencil_load_op, - VkAttachmentStoreOp in_stencil_store_op, - VkImageLayout in_initial_layout, - VkImageLayout in_final_layout, - bool in_may_alias, - uint32_t in_index) + RenderPassAttachment(Anvil::Format in_format, + Anvil::SampleCountFlagBits in_sample_count, + VkAttachmentLoadOp in_depth_load_op, + VkAttachmentStoreOp in_depth_store_op, + VkAttachmentLoadOp in_stencil_load_op, + VkAttachmentStoreOp in_stencil_store_op, + Anvil::ImageLayout in_initial_layout, + Anvil::ImageLayout in_final_layout, + bool in_may_alias, + uint32_t in_index) { color_depth_load_op = in_depth_load_op; color_depth_store_op = in_depth_store_op; @@ -543,12 +501,12 @@ namespace Anvil { color_depth_load_op = VK_ATTACHMENT_LOAD_OP_MAX_ENUM; color_depth_store_op = VK_ATTACHMENT_STORE_OP_MAX_ENUM; - final_layout = VK_IMAGE_LAYOUT_MAX_ENUM; - format = VK_FORMAT_MAX_ENUM; + final_layout = Anvil::ImageLayout::UNKNOWN; + format = Anvil::Format::UNKNOWN; index = UINT32_MAX; - initial_layout = VK_IMAGE_LAYOUT_MAX_ENUM; + initial_layout = Anvil::ImageLayout::UNKNOWN; may_alias = false; - sample_count = static_cast(0); + sample_count = static_cast(0); stencil_load_op = VK_ATTACHMENT_LOAD_OP_MAX_ENUM; stencil_store_op = VK_ATTACHMENT_STORE_OP_MAX_ENUM; type = ATTACHMENT_TYPE_UNKNOWN; @@ -560,18 +518,21 @@ namespace Anvil /* Holds properties of a sub-pass attachment */ typedef struct SubPassAttachment { - uint32_t attachment_index; - uint32_t highest_subpass_index; - VkImageLayout layout; - uint32_t lowest_subpass_index; - uint32_t resolve_attachment_index; + Anvil::ImageAspectFlags aspects_accessed; /* Only used for input attachments! */ + + uint32_t attachment_index; + uint32_t highest_subpass_index; + Anvil::ImageLayout layout; + uint32_t lowest_subpass_index; + uint32_t resolve_attachment_index; /* Dummy constructor. Should only be used by STL containers */ SubPassAttachment() { + aspects_accessed = Anvil::ImageAspectFlagBits::IMAGE_ASPECT_UNKNOWN; attachment_index = UINT32_MAX; highest_subpass_index = UINT32_MAX; - layout = VK_IMAGE_LAYOUT_MAX_ENUM; + layout = Anvil::ImageLayout::UNKNOWN; lowest_subpass_index = UINT32_MAX; resolve_attachment_index = UINT32_MAX; } @@ -587,10 +548,12 @@ namespace Anvil * MS data of @param in_attachment_ptr should be resolved. If UINT32_MAX, it is * assumed the sub-pass should not resolve the MS data. **/ - SubPassAttachment(const uint32_t& in_attachment_index, - VkImageLayout in_layout, - const uint32_t& in_opt_resolve_attachment_index) + SubPassAttachment(const uint32_t& in_attachment_index, + Anvil::ImageLayout in_layout, + const uint32_t& in_opt_resolve_attachment_index, + const Anvil::ImageAspectFlags& in_opt_aspects_accessed) { + aspects_accessed = in_opt_aspects_accessed; attachment_index = in_attachment_index; highest_subpass_index = UINT32_MAX; layout = in_layout; @@ -690,9 +653,9 @@ namespace Anvil VkAccessFlagsVariable (source_access_mask); VkPipelineStageFlagsVariable(source_stage_mask); - bool by_region; - const SubPass* destination_subpass_ptr; - const SubPass* source_subpass_ptr; + DependencyFlags flags; + const SubPass* destination_subpass_ptr; + const SubPass* source_subpass_ptr; /** Constructor. * @@ -704,17 +667,17 @@ namespace Anvil * If nullptr, it is assumed an external source is requested. * @param in_source_access_mask Source access mask. * @param in_destination_access_mask Destination access mask. - * @param in_by_region true if a "by-region" dependency is requested; false otherwise. + * @param in_dependency_flags Flags to use for the dependency. **/ - SubPassDependency(VkPipelineStageFlags in_destination_stage_mask, - const SubPass* in_destination_subpass_ptr, - VkPipelineStageFlags in_source_stage_mask, - const SubPass* in_source_subpass_ptr, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) + SubPassDependency(VkPipelineStageFlags in_destination_stage_mask, + const SubPass* in_destination_subpass_ptr, + VkPipelineStageFlags in_source_stage_mask, + const SubPass* in_source_subpass_ptr, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + const DependencyFlags& in_flags) { - by_region = in_by_region; + flags = in_flags; destination_stage_mask = static_cast(in_destination_stage_mask); destination_subpass_ptr = in_destination_subpass_ptr; destination_access_mask = static_cast (in_destination_access_mask); @@ -729,6 +692,7 @@ namespace Anvil destination_access_mask = static_cast (0); destination_stage_mask = static_cast(0); destination_subpass_ptr = nullptr; + flags = 0; source_access_mask = static_cast (0); source_stage_mask = static_cast(0); source_subpass_ptr = nullptr; @@ -737,7 +701,7 @@ namespace Anvil /** Comparator operator */ bool operator==(const SubPassDependency& in) { - return in.by_region == by_region && + return in.flags == flags && in.destination_access_mask == destination_access_mask && in.destination_stage_mask == destination_stage_mask && in.destination_subpass_ptr == destination_subpass_ptr && @@ -752,20 +716,21 @@ namespace Anvil /* Private functions */ - bool add_dependency (SubPass* in_destination_subpass_ptr, - SubPass* in_source_subpass_ptr, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region); - bool add_subpass_attachment(SubPassID in_subpass_id, - bool in_is_color_attachment, - VkImageLayout in_input_layout, - RenderPassAttachmentID in_attachment_id, - uint32_t in_attachment_location, - bool in_should_resolve, - RenderPassAttachmentID in_resolve_attachment_id); + bool add_dependency (SubPass* in_destination_subpass_ptr, + SubPass* in_source_subpass_ptr, + VkPipelineStageFlags in_source_stage_mask, + VkPipelineStageFlags in_destination_stage_mask, + VkAccessFlags in_source_access_mask, + VkAccessFlags in_destination_access_mask, + bool in_by_region); + bool add_subpass_attachment(SubPassID in_subpass_id, + bool in_is_color_attachment, + Anvil::ImageLayout in_input_layout, + RenderPassAttachmentID in_attachment_id, + uint32_t in_attachment_location, + bool in_should_resolve, + RenderPassAttachmentID in_resolve_attachment_id, + const Anvil::ImageAspectFlags& in_opt_aspects_accessed = Anvil::ImageAspectFlagBits::IMAGE_ASPECT_UNKNOWN); VkAttachmentReference get_attachment_reference_from_renderpass_attachment(const RenderPassAttachment& in_renderpass_attachment) const; VkAttachmentReference get_attachment_reference_from_subpass_attachment (const SubPassAttachment& in_subpass_attachment) const; diff --git a/include/misc/struct_chainer.h b/include/misc/struct_chainer.h index cea29af4..c8d53fc4 100644 --- a/include/misc/struct_chainer.h +++ b/include/misc/struct_chainer.h @@ -195,6 +195,20 @@ namespace Anvil return result_ptr; } + StructType* get_last_struct() + { + anvil_assert(m_structs.size() > 0); + + return reinterpret_cast(&m_structs.at(m_structs.size() - 1).at(0) ); + } + + const StructType* get_last_struct() const + { + anvil_assert(m_structs.size() > 0); + + return reinterpret_cast(&m_structs.at(m_structs.size() - 1).at(0) ); + } + const StructType* get_root_struct() const { anvil_assert(m_structs.size() > 0); diff --git a/include/misc/swapchain_create_info.h b/include/misc/swapchain_create_info.h index f32cd555..fa384c33 100644 --- a/include/misc/swapchain_create_info.h +++ b/include/misc/swapchain_create_info.h @@ -35,6 +35,7 @@ namespace Anvil * * NOTE: By default, the following parameters take default values as below. * + * - MGPU present mode flags: VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE * - Swapchain create flags: 0 * @@ -43,9 +44,9 @@ namespace Anvil static SwapchainCreateInfoUniquePtr create(Anvil::BaseDevice* in_device_ptr, Anvil::RenderingSurface* in_parent_surface_ptr, Anvil::Window* in_window_ptr, - VkFormat in_format, + Anvil::Format in_format, VkPresentModeKHR in_present_mode, - VkImageUsageFlags in_usage_flags, + Anvil::ImageUsageFlags in_usage_flags, uint32_t in_n_images); /** Returns device instance which has been used to create the swapchain */ @@ -61,11 +62,16 @@ namespace Anvil } /** Returns format used by swapchain image and image views */ - VkFormat get_format() const + Anvil::Format get_format() const { return m_format; } + VkDeviceGroupPresentModeFlagsKHR get_mgpu_present_mode_flags() const + { + return m_mgpu_present_mode_flags; + } + const MTSafety& get_mt_safety() const { return m_mt_safety; @@ -88,7 +94,7 @@ namespace Anvil return m_parent_surface_ptr; } - const VkImageUsageFlags& get_usage_flags() const + const Anvil::ImageUsageFlags& get_usage_flags() const { return m_usage_flags; } @@ -110,11 +116,16 @@ namespace Anvil m_flags = in_flags; } - void set_format(const VkFormat& in_format) + void set_format(const Anvil::Format& in_format) { m_format = in_format; } + void set_mgpu_present_mode_flags(const VkDeviceGroupPresentModeFlagsKHR& in_mgpu_present_mode_flags) + { + m_mgpu_present_mode_flags = in_mgpu_present_mode_flags; + } + void set_mt_safety(const MTSafety& in_mt_safety) { m_mt_safety = in_mt_safety; @@ -135,7 +146,7 @@ namespace Anvil m_parent_surface_ptr = in_rendering_surface_ptr; } - void set_usage_flags(VkImageUsageFlags in_new_usage_flags) + void set_usage_flags(Anvil::ImageUsageFlags in_new_usage_flags) { m_usage_flags = in_new_usage_flags; } @@ -149,28 +160,30 @@ namespace Anvil private: /* Private functions */ - SwapchainCreateInfo(Anvil::BaseDevice* in_device_ptr, - Anvil::RenderingSurface* in_parent_surface_ptr, - Anvil::Window* in_window_ptr, - VkFormat in_format, - VkPresentModeKHR in_present_mode, - VkImageUsageFlags in_usage_flags, - uint32_t in_n_images, - MTSafety in_mt_safety, - VkSwapchainCreateFlagsKHR in_flags); + SwapchainCreateInfo(Anvil::BaseDevice* in_device_ptr, + Anvil::RenderingSurface* in_parent_surface_ptr, + Anvil::Window* in_window_ptr, + Anvil::Format in_format, + VkPresentModeKHR in_present_mode, + Anvil::ImageUsageFlags in_usage_flags, + uint32_t in_n_images, + MTSafety in_mt_safety, + VkSwapchainCreateFlagsKHR in_flags, + VkDeviceGroupPresentModeFlagsKHR in_mgpu_present_mode_flags); /* Private variables */ - const Anvil::BaseDevice* m_device_ptr; - VkSwapchainCreateFlagsKHR m_flags; - VkFormat m_format; - Anvil::MTSafety m_mt_safety; - uint32_t m_n_images; - Anvil::RenderingSurface* m_parent_surface_ptr; - VkPresentModeKHR m_present_mode; - Anvil::Window* m_window_ptr; - - VkImageUsageFlagsVariable(m_usage_flags); + const Anvil::BaseDevice* m_device_ptr; + VkSwapchainCreateFlagsKHR m_flags; + Anvil::Format m_format; + VkDeviceGroupPresentModeFlagsKHR m_mgpu_present_mode_flags; + Anvil::MTSafety m_mt_safety; + uint32_t m_n_images; + Anvil::RenderingSurface* m_parent_surface_ptr; + VkPresentModeKHR m_present_mode; + Anvil::Window* m_window_ptr; + + Anvil::ImageUsageFlags m_usage_flags; ANVIL_DISABLE_ASSIGNMENT_OPERATOR(SwapchainCreateInfo); ANVIL_DISABLE_COPY_CONSTRUCTOR(SwapchainCreateInfo); diff --git a/include/misc/types.h b/include/misc/types.h index 87069d3e..9442dbeb 100644 --- a/include/misc/types.h +++ b/include/misc/types.h @@ -147,6 +147,7 @@ namespace Anvil struct MemoryHeap; struct MemoryProperties; struct MemoryType; + class MGPUDevice; class PhysicalDevice; class PipelineCache; class PipelineLayout; @@ -169,59 +170,60 @@ namespace Anvil class SwapchainCreateInfo; class Window; - typedef std::unique_ptr > BaseDeviceUniquePtr; - typedef std::unique_ptr BasePipelineCreateInfoUniquePtr; - typedef std::unique_ptr BufferCreateInfoUniquePtr; - typedef std::unique_ptr > BufferUniquePtr; - typedef std::unique_ptr BufferViewCreateInfoUniquePtr; - typedef std::unique_ptr > BufferViewUniquePtr; - typedef std::unique_ptr > CommandBufferBaseUniquePtr; - typedef std::unique_ptr > CommandPoolUniquePtr; - typedef std::unique_ptr ComputePipelineCreateInfoUniquePtr; - typedef std::unique_ptr > DescriptorPoolUniquePtr; - typedef std::unique_ptr DescriptorSetCreateInfoUniquePtr; - typedef std::unique_ptr > DescriptorSetGroupUniquePtr; - typedef std::unique_ptr > DescriptorSetLayoutUniquePtr; - typedef std::unique_ptr > DescriptorSetLayoutManagerUniquePtr; - typedef std::unique_ptr > DescriptorSetUniquePtr; - typedef std::unique_ptr > DescriptorUpdateTemplateUniquePtr; - typedef std::unique_ptr > ExternalHandleUniquePtr; - typedef std::unique_ptr EventCreateInfoUniquePtr; - typedef std::unique_ptr > EventUniquePtr; - typedef std::unique_ptr FenceCreateInfoUniquePtr; - typedef std::unique_ptr > FenceUniquePtr; - typedef std::unique_ptr FramebufferCreateInfoUniquePtr; - typedef std::unique_ptr > FramebufferUniquePtr; - typedef std::unique_ptr > GLSLShaderToSPIRVGeneratorUniquePtr; - typedef std::unique_ptr GraphicsPipelineCreateInfoUniquePtr; - typedef std::unique_ptr GraphicsPipelineManagerUniquePtr; - typedef std::unique_ptr ImageCreateInfoUniquePtr; - typedef std::unique_ptr > ImageUniquePtr; - typedef std::unique_ptr ImageViewCreateInfoUniquePtr; - typedef std::unique_ptr > ImageViewUniquePtr; - typedef std::unique_ptr > InstanceUniquePtr; - typedef std::unique_ptr > MemoryAllocatorUniquePtr; - typedef std::unique_ptr MemoryBlockCreateInfoUniquePtr; - typedef std::unique_ptr > MemoryBlockUniquePtr; - typedef std::unique_ptr > PipelineCacheUniquePtr; - typedef std::unique_ptr > PipelineLayoutManagerUniquePtr; - typedef std::unique_ptr > PipelineLayoutUniquePtr; - typedef std::unique_ptr > PrimaryCommandBufferUniquePtr; - typedef std::unique_ptr > QueryPoolUniquePtr; - typedef std::unique_ptr > RenderingSurfaceUniquePtr; - typedef std::unique_ptr RenderPassCreateInfoUniquePtr; - typedef std::unique_ptr > RenderPassUniquePtr; - typedef std::unique_ptr SamplerCreateInfoUniquePtr; - typedef std::unique_ptr > SamplerUniquePtr; - typedef std::unique_ptr > SecondaryCommandBufferUniquePtr; - typedef std::unique_ptr SemaphoreCreateInfoUniquePtr; - typedef std::unique_ptr > SemaphoreUniquePtr; - typedef std::unique_ptr > SGPUDeviceUniquePtr; - typedef std::unique_ptr > ShaderModuleCacheUniquePtr; - typedef std::unique_ptr > ShaderModuleUniquePtr; - typedef std::unique_ptr SwapchainCreateInfoUniquePtr; - typedef std::unique_ptr > SwapchainUniquePtr; - typedef std::unique_ptr > WindowUniquePtr; + typedef std::unique_ptr > BaseDeviceUniquePtr; + typedef std::unique_ptr BasePipelineCreateInfoUniquePtr; + typedef std::unique_ptr BufferCreateInfoUniquePtr; + typedef std::unique_ptr > BufferUniquePtr; + typedef std::unique_ptr BufferViewCreateInfoUniquePtr; + typedef std::unique_ptr > BufferViewUniquePtr; + typedef std::unique_ptr > CommandBufferBaseUniquePtr; + typedef std::unique_ptr > CommandPoolUniquePtr; + typedef std::unique_ptr ComputePipelineCreateInfoUniquePtr; + typedef std::unique_ptr > DescriptorPoolUniquePtr; + typedef std::unique_ptr DescriptorSetCreateInfoUniquePtr; + typedef std::unique_ptr > DescriptorSetGroupUniquePtr; + typedef std::unique_ptr > DescriptorSetLayoutUniquePtr; + typedef std::unique_ptr > DescriptorSetLayoutManagerUniquePtr; + typedef std::unique_ptr > DescriptorSetUniquePtr; + typedef std::unique_ptr > DescriptorUpdateTemplateUniquePtr; + typedef std::unique_ptr > ExternalHandleUniquePtr; + typedef std::unique_ptr EventCreateInfoUniquePtr; + typedef std::unique_ptr > EventUniquePtr; + typedef std::unique_ptr FenceCreateInfoUniquePtr; + typedef std::unique_ptr > FenceUniquePtr; + typedef std::unique_ptr FramebufferCreateInfoUniquePtr; + typedef std::unique_ptr > FramebufferUniquePtr; + typedef std::unique_ptr > GLSLShaderToSPIRVGeneratorUniquePtr; + typedef std::unique_ptr GraphicsPipelineCreateInfoUniquePtr; + typedef std::unique_ptr GraphicsPipelineManagerUniquePtr; + typedef std::unique_ptr ImageCreateInfoUniquePtr; + typedef std::unique_ptr > ImageUniquePtr; + typedef std::unique_ptr ImageViewCreateInfoUniquePtr; + typedef std::unique_ptr > ImageViewUniquePtr; + typedef std::unique_ptr > InstanceUniquePtr; + typedef std::unique_ptr > MemoryAllocatorUniquePtr; + typedef std::unique_ptr MemoryBlockCreateInfoUniquePtr; + typedef std::unique_ptr > MemoryBlockUniquePtr; + typedef std::unique_ptr > MGPUDeviceUniquePtr; + typedef std::unique_ptr > PipelineCacheUniquePtr; + typedef std::unique_ptr > PipelineLayoutManagerUniquePtr; + typedef std::unique_ptr > PipelineLayoutUniquePtr; + typedef std::unique_ptr > PrimaryCommandBufferUniquePtr; + typedef std::unique_ptr > QueryPoolUniquePtr; + typedef std::unique_ptr > RenderingSurfaceUniquePtr; + typedef std::unique_ptr RenderPassCreateInfoUniquePtr; + typedef std::unique_ptr > RenderPassUniquePtr; + typedef std::unique_ptr SamplerCreateInfoUniquePtr; + typedef std::unique_ptr > SamplerUniquePtr; + typedef std::unique_ptr > SecondaryCommandBufferUniquePtr; + typedef std::unique_ptr SemaphoreCreateInfoUniquePtr; + typedef std::unique_ptr > SemaphoreUniquePtr; + typedef std::unique_ptr > SGPUDeviceUniquePtr; + typedef std::unique_ptr > ShaderModuleCacheUniquePtr; + typedef std::unique_ptr > ShaderModuleUniquePtr; + typedef std::unique_ptr SwapchainCreateInfoUniquePtr; + typedef std::unique_ptr > SwapchainUniquePtr; + typedef std::unique_ptr > WindowUniquePtr; }; /* Defines various types used by Vulkan API wrapper classes. */ diff --git a/include/misc/types_classes.h b/include/misc/types_classes.h index b5666aec..cfe5956e 100644 --- a/include/misc/types_classes.h +++ b/include/misc/types_classes.h @@ -55,6 +55,9 @@ namespace Anvil /** Adds a new bind info to the container. The application can then append buffer memory updates * to the bind info by calling append_buffer_memory_update(). * + * For mGPU devices, zeroth device index is used by default for both memory and resource device indices. + * You can adjust these default values by calling set_memory_device_index() and set_resource_device_index(). + * * @param in_n_signal_semaphores Number of semaphores to signal after the bind info is processed. Can be 0. * @param in_opt_signal_semaphores_ptrs_ptr Ptr to an array of semaphores (sized @param in_n_signal_semaphores) to signal. * Should be null if @param in_n_signal_semaphores is 0. @@ -208,6 +211,11 @@ namespace Anvil bool* out_opt_memory_block_owned_by_buffer_ptr, VkDeviceSize* out_opt_size_ptr) const; + /** Returns memory & resource device indices assigned to this batch */ + bool get_device_indices(SparseMemoryBindInfoID in_bind_info_id, + uint32_t* out_opt_resource_device_index_ptr, + uint32_t* out_opt_memory_device_index_ptr) const; + /** Retrieves the fence, if one was earlier assigned to the instance */ const Anvil::Fence* get_fence() const { @@ -285,6 +293,10 @@ namespace Anvil return static_cast(m_bindings.size() ); } + /* Tells whether this instance requires VK_KHR_device_group extension in order for the vkQueueBindSparse() + * invocation. */ + bool is_device_group_support_required() const; + /* Changes the fence (null by default), which should be set by the Vulkan implementation after it finishes * updating the bindings. **/ @@ -293,6 +305,26 @@ namespace Anvil m_fence_ptr = in_fence_ptr; } + /* Updates memory device index, associated with this batch. + * + * Do not modify unless VK_KHR_device_group is supported + * + * @param in_memory_device_index New memory device index to use. + * + **/ + void set_memory_device_index(SparseMemoryBindInfoID in_bind_info_id, + const uint32_t& in_memory_device_index); + + /* Updates resource device index, associated with this batch. + * + * Do not modify unless VK_KHR_device_group is supported + * + * @param in_resource_device_index New resource device index to use. + * + **/ + void set_resource_device_index(SparseMemoryBindInfoID in_bind_info_id, + const uint32_t& in_resource_device_index); + private: /* Private type definitions */ typedef struct GeneralBindInfo @@ -340,6 +372,9 @@ namespace Anvil ImageOpaqueBindUpdateMap image_opaque_updates; ImageBindUpdateMap image_updates; + uint32_t memory_device_index; + uint32_t resource_device_index; + std::vector signal_semaphores; std::vector signal_semaphores_vk; std::vector wait_semaphores; @@ -347,7 +382,8 @@ namespace Anvil BindingInfo() { - /* Stub */ + memory_device_index = 0; + resource_device_index = 0; } } BindingInfo; @@ -357,6 +393,7 @@ namespace Anvil std::vector m_bindings_vk; std::vector m_buffer_bindings_vk; + std::vector m_device_group_bindings_vk; std::vector m_image_bindings_vk; std::vector m_image_opaque_bindings_vk; diff --git a/include/misc/types_enums.h b/include/misc/types_enums.h index 467b67c3..72f14360 100644 --- a/include/misc/types_enums.h +++ b/include/misc/types_enums.h @@ -55,17 +55,55 @@ namespace Anvil SPARSE_NO_ALLOC, } BufferType; + /* NOTE: These map 1:1 to Vulkan equialents */ + enum BufferUsageFlagBits + { + /* Core VK 1.0 */ + BUFFER_USAGE_FLAG_INDEX_BUFFER_BIT = VK_BUFFER_USAGE_INDEX_BUFFER_BIT, + BUFFER_USAGE_FLAG_INDIRECT_BUFFER_BIT = VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, + BUFFER_USAGE_FLAG_STORAGE_BUFFER_BIT = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, + BUFFER_USAGE_FLAG_STORAGE_TEXEL_BUFFER_BIT = VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, + BUFFER_USAGE_FLAG_TRANSFER_DST_BIT = VK_BUFFER_USAGE_TRANSFER_DST_BIT, + BUFFER_USAGE_FLAG_TRANSFER_SRC_BIT = VK_BUFFER_USAGE_TRANSFER_SRC_BIT, + BUFFER_USAGE_FLAG_UNIFORM_BUFFER_BIT = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, + BUFFER_USAGE_FLAG_UNIFORM_TEXEL_BUFFER_BIT = VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT, + BUFFER_USAGE_FLAG_VERTEX_BUFFER_BIT = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, + + BUFFER_USAGE_UNKNOWN = 0 + }; + typedef uint32_t BufferUsageFlags; + + /* Note: These map 1:1 to VK equivalents. */ + typedef enum class ComponentSwizzle + { + A = VK_COMPONENT_SWIZZLE_A, + B = VK_COMPONENT_SWIZZLE_B, + G = VK_COMPONENT_SWIZZLE_G, + IDENTITY = VK_COMPONENT_SWIZZLE_IDENTITY, + ONE = VK_COMPONENT_SWIZZLE_ONE, + R = VK_COMPONENT_SWIZZLE_R, + ZERO = VK_COMPONENT_SWIZZLE_ZERO, + + } ComponentSwizzle; + + typedef enum + { + DEPENDENCY_BY_REGION_BIT = VK_DEPENDENCY_BY_REGION_BIT, + DEPENDENCY_DEVICE_GROUP_BIT = VK_DEPENDENCY_DEVICE_GROUP_BIT_KHR, + } DependencyBits; + typedef uint32_t DependencyFlags; + typedef enum { - DYNAMIC_STATE_BLEND_CONSTANTS_BIT = 1 << 0, - DYNAMIC_STATE_DEPTH_BIAS_BIT = 1 << 1, - DYNAMIC_STATE_DEPTH_BOUNDS_BIT = 1 << 2, - DYNAMIC_STATE_LINE_WIDTH_BIT = 1 << 3, - DYNAMIC_STATE_SCISSOR_BIT = 1 << 4, - DYNAMIC_STATE_STENCIL_COMPARE_MASK_BIT = 1 << 5, - DYNAMIC_STATE_STENCIL_REFERENCE_BIT = 1 << 6, - DYNAMIC_STATE_STENCIL_WRITE_MASK_BIT = 1 << 7, - DYNAMIC_STATE_VIEWPORT_BIT = 1 << 8, + DYNAMIC_STATE_BLEND_CONSTANTS_BIT = 1 << 0, + DYNAMIC_STATE_DEPTH_BIAS_BIT = 1 << 1, + DYNAMIC_STATE_DEPTH_BOUNDS_BIT = 1 << 2, + DYNAMIC_STATE_LINE_WIDTH_BIT = 1 << 3, + DYNAMIC_STATE_SCISSOR_BIT = 1 << 4, + DYNAMIC_STATE_STENCIL_COMPARE_MASK_BIT = 1 << 5, + DYNAMIC_STATE_STENCIL_REFERENCE_BIT = 1 << 6, + DYNAMIC_STATE_STENCIL_WRITE_MASK_BIT = 1 << 7, + DYNAMIC_STATE_VIEWPORT_BIT = 1 << 8, } DynamicStateBits; typedef uint32_t DynamicStateBitfield; @@ -124,6 +162,15 @@ namespace Anvil } ExternalSemaphoreHandleTypeBit; typedef uint32_t ExternalSemaphoreHandleTypeBits; + typedef enum + { + PEER_MEMORY_FEATURE_COPY_DST_BIT = 1 << 0, + PEER_MEMORY_FEATURE_COPY_SRC_BIT = 1 << 1, + PEER_MEMORY_FEATURE_GENERIC_DST_BIT = 1 << 2, + PEER_MEMORY_FEATURE_GENERIC_SRC_BIT = 1 << 3, + } PeerMemoryFeatureBit; + typedef uint32_t PeerMemoryFeatureFlags; + /** Describes component layout of a format */ typedef enum { @@ -224,8 +271,203 @@ namespace Anvil { /* BaseDevice is implemented by SGPUDevice class */ DEVICE_TYPE_SINGLE_GPU, + + /* BaseDevice is implemented by MGPUDevice class */ + DEVICE_TYPE_MULTI_GPU } DeviceType; + /* NOTE: These map 1:1 to VK equivalents */ + typedef enum class Format + { + R4G4_UNORM_PACK8 = VK_FORMAT_R4G4_UNORM_PACK8, + R4G4B4A4_UNORM_PACK16 = VK_FORMAT_R4G4B4A4_UNORM_PACK16, + B4G4R4A4_UNORM_PACK16 = VK_FORMAT_B4G4R4A4_UNORM_PACK16, + R5G6B5_UNORM_PACK16 = VK_FORMAT_R5G6B5_UNORM_PACK16, + B5G6R5_UNORM_PACK16 = VK_FORMAT_B5G6R5_UNORM_PACK16, + R5G5B5A1_UNORM_PACK16 = VK_FORMAT_R5G5B5A1_UNORM_PACK16, + B5G5R5A1_UNORM_PACK16 = VK_FORMAT_B5G5R5A1_UNORM_PACK16, + A1R5G5B5_UNORM_PACK16 = VK_FORMAT_A1R5G5B5_UNORM_PACK16, + R8_UNORM = VK_FORMAT_R8_UNORM, + R8_SNORM = VK_FORMAT_R8_SNORM, + R8_USCALED = VK_FORMAT_R8_USCALED, + R8_SSCALED = VK_FORMAT_R8_SSCALED, + R8_UINT = VK_FORMAT_R8_UINT, + R8_SINT = VK_FORMAT_R8_SINT, + R8_SRGB = VK_FORMAT_R8_SRGB, + R8G8_UNORM = VK_FORMAT_R8G8_UNORM, + R8G8_SNORM = VK_FORMAT_R8G8_SNORM, + R8G8_USCALED = VK_FORMAT_R8G8_USCALED, + R8G8_SSCALED = VK_FORMAT_R8G8_SSCALED, + R8G8_UINT = VK_FORMAT_R8G8_UINT, + R8G8_SINT = VK_FORMAT_R8G8_SINT, + R8G8_SRGB = VK_FORMAT_R8G8_SRGB, + R8G8B8_UNORM = VK_FORMAT_R8G8B8_UNORM, + R8G8B8_SNORM = VK_FORMAT_R8G8B8_SNORM, + R8G8B8_USCALED = VK_FORMAT_R8G8B8_USCALED, + R8G8B8_SSCALED = VK_FORMAT_R8G8B8_SSCALED, + R8G8B8_UINT = VK_FORMAT_R8G8B8_UINT, + R8G8B8_SINT = VK_FORMAT_R8G8B8_SINT, + R8G8B8_SRGB = VK_FORMAT_R8G8B8_SRGB, + B8G8R8_UNORM = VK_FORMAT_B8G8R8_UNORM, + B8G8R8_SNORM = VK_FORMAT_B8G8R8_SNORM, + B8G8R8_USCALED = VK_FORMAT_B8G8R8_USCALED, + B8G8R8_SSCALED = VK_FORMAT_B8G8R8_SSCALED, + B8G8R8_UINT = VK_FORMAT_B8G8R8_UINT, + B8G8R8_SINT = VK_FORMAT_B8G8R8_SINT, + B8G8R8_SRGB = VK_FORMAT_B8G8R8_SRGB, + R8G8B8A8_UNORM = VK_FORMAT_R8G8B8A8_UNORM, + R8G8B8A8_SNORM = VK_FORMAT_R8G8B8A8_SNORM, + R8G8B8A8_USCALED = VK_FORMAT_R8G8B8A8_USCALED, + R8G8B8A8_SSCALED = VK_FORMAT_R8G8B8A8_SSCALED, + R8G8B8A8_UINT = VK_FORMAT_R8G8B8A8_UINT, + R8G8B8A8_SINT = VK_FORMAT_R8G8B8A8_SINT, + R8G8B8A8_SRGB = VK_FORMAT_R8G8B8A8_SRGB, + B8G8R8A8_UNORM = VK_FORMAT_B8G8R8A8_UNORM, + B8G8R8A8_SNORM = VK_FORMAT_B8G8R8A8_SNORM, + B8G8R8A8_USCALED = VK_FORMAT_B8G8R8A8_USCALED, + B8G8R8A8_SSCALED = VK_FORMAT_B8G8R8A8_SSCALED, + B8G8R8A8_UINT = VK_FORMAT_B8G8R8A8_UINT, + B8G8R8A8_SINT = VK_FORMAT_B8G8R8A8_SINT, + B8G8R8A8_SRGB = VK_FORMAT_B8G8R8A8_SRGB, + A8B8G8R8_UNORM_PACK32 = VK_FORMAT_A8B8G8R8_UNORM_PACK32, + A8B8G8R8_SNORM_PACK32 = VK_FORMAT_A8B8G8R8_SNORM_PACK32, + A8B8G8R8_USCALED_PACK32 = VK_FORMAT_A8B8G8R8_USCALED_PACK32, + A8B8G8R8_SSCALED_PACK32 = VK_FORMAT_A8B8G8R8_SSCALED_PACK32, + A8B8G8R8_UINT_PACK32 = VK_FORMAT_A8B8G8R8_UINT_PACK32, + A8B8G8R8_SINT_PACK32 = VK_FORMAT_A8B8G8R8_SINT_PACK32, + A8B8G8R8_SRGB_PACK32 = VK_FORMAT_A8B8G8R8_SRGB_PACK32, + A2R10G10B10_UNORM_PACK32 = VK_FORMAT_A2R10G10B10_UNORM_PACK32, + A2R10G10B10_SNORM_PACK32 = VK_FORMAT_A2R10G10B10_SNORM_PACK32, + A2R10G10B10_USCALED_PACK32 = VK_FORMAT_A2R10G10B10_USCALED_PACK32, + A2R10G10B10_SSCALED_PACK32 = VK_FORMAT_A2R10G10B10_SSCALED_PACK32, + A2R10G10B10_UINT_PACK32 = VK_FORMAT_A2R10G10B10_UINT_PACK32, + A2R10G10B10_SINT_PACK32 = VK_FORMAT_A2R10G10B10_SINT_PACK32, + A2B10G10R10_UNORM_PACK32 = VK_FORMAT_A2B10G10R10_UNORM_PACK32, + A2B10G10R10_SNORM_PACK32 = VK_FORMAT_A2B10G10R10_SNORM_PACK32, + A2B10G10R10_USCALED_PACK32 = VK_FORMAT_A2B10G10R10_USCALED_PACK32, + A2B10G10R10_SSCALED_PACK32 = VK_FORMAT_A2B10G10R10_SSCALED_PACK32, + A2B10G10R10_UINT_PACK32 = VK_FORMAT_A2B10G10R10_UINT_PACK32, + A2B10G10R10_SINT_PACK32 = VK_FORMAT_A2B10G10R10_SINT_PACK32, + R16_UNORM = VK_FORMAT_R16_UNORM, + R16_SNORM = VK_FORMAT_R16_SNORM, + R16_USCALED = VK_FORMAT_R16_USCALED, + R16_SSCALED = VK_FORMAT_R16_SSCALED, + R16_UINT = VK_FORMAT_R16_UINT, + R16_SINT = VK_FORMAT_R16_SINT, + R16_SFLOAT = VK_FORMAT_R16_SFLOAT, + R16G16_UNORM = VK_FORMAT_R16G16_UNORM, + R16G16_SNORM = VK_FORMAT_R16G16_SNORM, + R16G16_USCALED = VK_FORMAT_R16G16_USCALED, + R16G16_SSCALED = VK_FORMAT_R16G16_SSCALED, + R16G16_UINT = VK_FORMAT_R16G16_UINT, + R16G16_SINT = VK_FORMAT_R16G16_SINT, + R16G16_SFLOAT = VK_FORMAT_R16G16_SFLOAT, + R16G16B16_UNORM = VK_FORMAT_R16G16B16_UNORM, + R16G16B16_SNORM = VK_FORMAT_R16G16B16_SNORM, + R16G16B16_USCALED = VK_FORMAT_R16G16B16_USCALED, + R16G16B16_SSCALED = VK_FORMAT_R16G16B16_SSCALED, + R16G16B16_UINT = VK_FORMAT_R16G16B16_UINT, + R16G16B16_SINT = VK_FORMAT_R16G16B16_SINT, + R16G16B16_SFLOAT = VK_FORMAT_R16G16B16_SFLOAT, + R16G16B16A16_UNORM = VK_FORMAT_R16G16B16A16_UNORM, + R16G16B16A16_SNORM = VK_FORMAT_R16G16B16A16_SNORM, + R16G16B16A16_USCALED = VK_FORMAT_R16G16B16A16_USCALED, + R16G16B16A16_SSCALED = VK_FORMAT_R16G16B16A16_SSCALED, + R16G16B16A16_UINT = VK_FORMAT_R16G16B16A16_UINT, + R16G16B16A16_SINT = VK_FORMAT_R16G16B16A16_SINT, + R16G16B16A16_SFLOAT = VK_FORMAT_R16G16B16A16_SFLOAT, + R32_UINT = VK_FORMAT_R32_UINT, + R32_SINT = VK_FORMAT_R32_SINT, + R32_SFLOAT = VK_FORMAT_R32_SFLOAT, + R32G32_UINT = VK_FORMAT_R32G32_UINT, + R32G32_SINT = VK_FORMAT_R32G32_SINT, + R32G32_SFLOAT = VK_FORMAT_R32G32_SFLOAT, + R32G32B32_UINT = VK_FORMAT_R32G32B32_UINT, + R32G32B32_SINT = VK_FORMAT_R32G32B32_SINT, + R32G32B32_SFLOAT = VK_FORMAT_R32G32B32_SFLOAT, + R32G32B32A32_UINT = VK_FORMAT_R32G32B32A32_UINT, + R32G32B32A32_SINT = VK_FORMAT_R32G32B32A32_SINT, + R32G32B32A32_SFLOAT = VK_FORMAT_R32G32B32A32_SFLOAT, + R64_UINT = VK_FORMAT_R64_UINT, + R64_SINT = VK_FORMAT_R64_SINT, + R64_SFLOAT = VK_FORMAT_R64_SFLOAT, + R64G64_UINT = VK_FORMAT_R64G64_UINT, + R64G64_SINT = VK_FORMAT_R64G64_SINT, + R64G64_SFLOAT = VK_FORMAT_R64G64_SFLOAT, + R64G64B64_UINT = VK_FORMAT_R64G64B64_UINT, + R64G64B64_SINT = VK_FORMAT_R64G64B64_SINT, + R64G64B64_SFLOAT = VK_FORMAT_R64G64B64_SFLOAT, + R64G64B64A64_UINT = VK_FORMAT_R64G64B64A64_UINT, + R64G64B64A64_SINT = VK_FORMAT_R64G64B64A64_SINT, + R64G64B64A64_SFLOAT = VK_FORMAT_R64G64B64A64_SFLOAT, + B10G11R11_UFLOAT_PACK32 = VK_FORMAT_B10G11R11_UFLOAT_PACK32, + E5B9G9R9_UFLOAT_PACK32 = VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, + D16_UNORM = VK_FORMAT_D16_UNORM, + X8_D24_UNORM_PACK32 = VK_FORMAT_X8_D24_UNORM_PACK32, + D32_SFLOAT = VK_FORMAT_D32_SFLOAT, + S8_UINT = VK_FORMAT_S8_UINT, + D16_UNORM_S8_UINT = VK_FORMAT_D16_UNORM_S8_UINT, + D24_UNORM_S8_UINT = VK_FORMAT_D24_UNORM_S8_UINT, + D32_SFLOAT_S8_UINT = VK_FORMAT_D32_SFLOAT_S8_UINT, + BC1_RGB_UNORM_BLOCK = VK_FORMAT_BC1_RGB_UNORM_BLOCK, + BC1_RGB_SRGB_BLOCK = VK_FORMAT_BC1_RGB_SRGB_BLOCK, + BC1_RGBA_UNORM_BLOCK = VK_FORMAT_BC1_RGBA_UNORM_BLOCK, + BC1_RGBA_SRGB_BLOCK = VK_FORMAT_BC1_RGBA_SRGB_BLOCK, + BC2_UNORM_BLOCK = VK_FORMAT_BC2_UNORM_BLOCK, + BC2_SRGB_BLOCK = VK_FORMAT_BC2_SRGB_BLOCK, + BC3_UNORM_BLOCK = VK_FORMAT_BC3_UNORM_BLOCK, + BC3_SRGB_BLOCK = VK_FORMAT_BC3_SRGB_BLOCK, + BC4_UNORM_BLOCK = VK_FORMAT_BC4_UNORM_BLOCK, + BC4_SNORM_BLOCK = VK_FORMAT_BC4_SNORM_BLOCK, + BC5_UNORM_BLOCK = VK_FORMAT_BC5_UNORM_BLOCK, + BC5_SNORM_BLOCK = VK_FORMAT_BC5_SNORM_BLOCK, + BC6H_UFLOAT_BLOCK = VK_FORMAT_BC6H_UFLOAT_BLOCK, + BC6H_SFLOAT_BLOCK = VK_FORMAT_BC6H_SFLOAT_BLOCK, + BC7_UNORM_BLOCK = VK_FORMAT_BC7_UNORM_BLOCK, + BC7_SRGB_BLOCK = VK_FORMAT_BC7_SRGB_BLOCK, + ETC2_R8G8B8_UNORM_BLOCK = VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, + ETC2_R8G8B8_SRGB_BLOCK = VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK, + ETC2_R8G8B8A1_UNORM_BLOCK = VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK, + ETC2_R8G8B8A1_SRGB_BLOCK = VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK, + ETC2_R8G8B8A8_UNORM_BLOCK = VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK, + ETC2_R8G8B8A8_SRGB_BLOCK = VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK, + EAC_R11_UNORM_BLOCK = VK_FORMAT_EAC_R11_UNORM_BLOCK, + EAC_R11_SNORM_BLOCK = VK_FORMAT_EAC_R11_SNORM_BLOCK, + EAC_R11G11_UNORM_BLOCK = VK_FORMAT_EAC_R11G11_UNORM_BLOCK, + EAC_R11G11_SNORM_BLOCK = VK_FORMAT_EAC_R11G11_SNORM_BLOCK, + ASTC_4x4_UNORM_BLOCK = VK_FORMAT_ASTC_4x4_UNORM_BLOCK, + ASTC_4x4_SRGB_BLOCK = VK_FORMAT_ASTC_4x4_SRGB_BLOCK, + ASTC_5x4_UNORM_BLOCK = VK_FORMAT_ASTC_5x4_UNORM_BLOCK, + ASTC_5x4_SRGB_BLOCK = VK_FORMAT_ASTC_5x4_SRGB_BLOCK, + ASTC_5x5_UNORM_BLOCK = VK_FORMAT_ASTC_5x5_UNORM_BLOCK, + ASTC_5x5_SRGB_BLOCK = VK_FORMAT_ASTC_5x5_SRGB_BLOCK, + ASTC_6x5_UNORM_BLOCK = VK_FORMAT_ASTC_6x5_UNORM_BLOCK, + ASTC_6x5_SRGB_BLOCK = VK_FORMAT_ASTC_6x5_SRGB_BLOCK, + ASTC_6x6_UNORM_BLOCK = VK_FORMAT_ASTC_6x6_UNORM_BLOCK, + ASTC_6x6_SRGB_BLOCK = VK_FORMAT_ASTC_6x6_SRGB_BLOCK, + ASTC_8x5_UNORM_BLOCK = VK_FORMAT_ASTC_8x5_UNORM_BLOCK, + ASTC_8x5_SRGB_BLOCK = VK_FORMAT_ASTC_8x5_SRGB_BLOCK, + ASTC_8x6_UNORM_BLOCK = VK_FORMAT_ASTC_8x6_UNORM_BLOCK, + ASTC_8x6_SRGB_BLOCK = VK_FORMAT_ASTC_8x6_SRGB_BLOCK, + ASTC_8x8_UNORM_BLOCK = VK_FORMAT_ASTC_8x8_UNORM_BLOCK, + ASTC_8x8_SRGB_BLOCK = VK_FORMAT_ASTC_8x8_SRGB_BLOCK, + ASTC_10x5_UNORM_BLOCK = VK_FORMAT_ASTC_10x5_UNORM_BLOCK, + ASTC_10x5_SRGB_BLOCK = VK_FORMAT_ASTC_10x5_SRGB_BLOCK, + ASTC_10x6_UNORM_BLOCK = VK_FORMAT_ASTC_10x6_UNORM_BLOCK, + ASTC_10x6_SRGB_BLOCK = VK_FORMAT_ASTC_10x6_SRGB_BLOCK, + ASTC_10x8_UNORM_BLOCK = VK_FORMAT_ASTC_10x8_UNORM_BLOCK, + ASTC_10x8_SRGB_BLOCK = VK_FORMAT_ASTC_10x8_SRGB_BLOCK, + ASTC_10x10_UNORM_BLOCK = VK_FORMAT_ASTC_10x10_UNORM_BLOCK, + ASTC_10x10_SRGB_BLOCK = VK_FORMAT_ASTC_10x10_SRGB_BLOCK, + ASTC_12x10_UNORM_BLOCK = VK_FORMAT_ASTC_12x10_UNORM_BLOCK, + ASTC_12x10_SRGB_BLOCK = VK_FORMAT_ASTC_12x10_SRGB_BLOCK, + ASTC_12x12_UNORM_BLOCK = VK_FORMAT_ASTC_12x12_UNORM_BLOCK, + ASTC_12x12_SRGB_BLOCK = VK_FORMAT_ASTC_12x12_SRGB_BLOCK, + + /* Other .. */ + UNKNOWN = VK_FORMAT_UNDEFINED, + } Format; + typedef enum { FORMAT_TYPE_SFLOAT, @@ -243,31 +485,122 @@ namespace Anvil FORMAT_TYPE_UNKNOWN, } FormatType; + /* NOTE: These map 1:1 to VK equivalents */ + enum ImageAspectFlagBits + { + /* Core VK 1.0 aspects */ + IMAGE_ASPECT_FLAG_COLOR_BIT = VK_IMAGE_ASPECT_COLOR_BIT, + IMAGE_ASPECT_FLAG_DEPTH_BIT = VK_IMAGE_ASPECT_DEPTH_BIT, + IMAGE_ASPECT_FLAG_METADATA_BIT = VK_IMAGE_ASPECT_METADATA_BIT, + IMAGE_ASPECT_FLAG_STENCIL_BIT = VK_IMAGE_ASPECT_STENCIL_BIT, + + IMAGE_ASPECT_UNKNOWN = 0 + }; + typedef uint32_t ImageAspectFlags; + + /* NOTE: These map 1:1 to VK equivalents */ enum ImageCreateFlagBits { - IMAGE_CREATE_FLAG_MUTABLE_FORMAT_BIT = 1 << 0, - IMAGE_CREATE_FLAG_CUBE_COMPATIBLE_BIT = 1 << 1, + IMAGE_CREATE_FLAG_MUTABLE_FORMAT_BIT = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, + IMAGE_CREATE_FLAG_CUBE_COMPATIBLE_BIT = VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, + + /* NOTE: Requires VK_KHR_bind_memory2 */ + IMAGE_CREATE_FLAG_SPLIT_INSTANCE_BIND_REGIONS_BIT = VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR, + IMAGE_CREATE_FLAG_ALIAS_BIT = VK_IMAGE_CREATE_ALIAS_BIT_KHR, /* NOTE: Requires VK_KHR_maintenance1 */ - IMAGE_CREATE_FLAG_2D_ARRAY_COMPATIBLE_BIT = 1 << 2, + IMAGE_CREATE_FLAG_2D_ARRAY_COMPATIBLE_BIT = VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR, + + /* NOTE: Requires VK_KHR_maintenance2 */ + IMAGE_CREATE_FLAG_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT = VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR, + IMAGE_CREATE_FLAG_EXTENDED_USAGE_BIT = VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR, }; + typedef uint32_t ImageCreateFlags; - typedef enum class ImageType + /* NOTE: These map 1:1 to VK equivalents */ + enum class ImageLayout + { + /* Core VK 1.0 */ + COLOR_ATTACHMENT_OPTIMAL = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + DEPTH_STENCIL_ATTACHMENT_OPTIMAL = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + DEPTH_STENCIL_READ_ONLY_OPTIMAL = VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, + GENERAL = VK_IMAGE_LAYOUT_GENERAL, + PREINITIALIZED = VK_IMAGE_LAYOUT_PREINITIALIZED, + SHADER_READ_ONLY_OPTIMAL = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, + TRANSFER_DST_OPTIMAL = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, + TRANSFER_SRC_OPTIMAL = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, + UNDEFINED = VK_IMAGE_LAYOUT_UNDEFINED, + + /* Requires VK_KHR_maintenance2 */ + DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL = VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR, + DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL = VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR, + + /* Requires VK_KHR_swapchain */ + PRESENT_SRC_KHR = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, + + UNKNOWN, + }; + + /* NOTE: These map 1:1 to VK equivalents */ + enum ImageUsageFlagBits + { + /* Core VK 1.0 usages */ + IMAGE_USAGE_FLAG_TRANSFER_DST_BIT = VK_IMAGE_USAGE_TRANSFER_DST_BIT, + IMAGE_USAGE_FLAG_TRANSFER_SRC_BIT = VK_IMAGE_USAGE_TRANSFER_SRC_BIT, + IMAGE_USAGE_FLAG_SAMPLED_BIT = VK_IMAGE_USAGE_SAMPLED_BIT, + IMAGE_USAGE_FLAG_STORAGE_BIT = VK_IMAGE_USAGE_STORAGE_BIT, + IMAGE_USAGE_FLAG_COLOR_ATTACHMENT_BIT = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, + IMAGE_USAGE_FLAG_DEPTH_STENCIL_ATTACHMENT_BIT = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, + IMAGE_USAGE_FLAG_TRANSIENT_ATTACHMENT_BIT = VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, + IMAGE_USAGE_FLAG_INPUT_ATTACHMENT_BIT = VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT, + + IMAGE_USAGE_UNKNOWN = 0 + }; + typedef uint32_t ImageUsageFlags; + + typedef enum class ImageInternalType { NONSPARSE_ALLOC, NONSPARSE_NO_ALLOC, + NONSPARSE_PEER_NO_ALLOC, SPARSE_NO_ALLOC, SWAPCHAIN_WRAPPER + } ImageInternalType; + + /* NOTE: These correspond 1:1 to VK equivalents */ + typedef enum class ImageTiling + { + LINEAR = VK_IMAGE_TILING_LINEAR, + OPTIMAL = VK_IMAGE_TILING_OPTIMAL, + + UNKNOWN + } ImageTiling; + + /* NOTE: These correspond 1:1 to VK equivalents */ + typedef enum class ImageType + { + _1D = VK_IMAGE_TYPE_1D, + _2D = VK_IMAGE_TYPE_2D, + _3D = VK_IMAGE_TYPE_3D, + + UNKNOWN } ImageType; - typedef enum class MemoryBlockType + enum class IndexType + { + UINT16, + UINT32, + + UNKNOWN + }; + + enum class MemoryBlockType { DERIVED, DERIVED_WITH_CUSTOM_DELETE_PROC, REGULAR - - } MemoryBlockType; + }; enum MemoryFeatureFlagBits { @@ -280,6 +613,7 @@ namespace Anvil MEMORY_FEATURE_FLAG_HOST_COHERENT = 1 << 2, MEMORY_FEATURE_FLAG_LAZILY_ALLOCATED = 1 << 3, MEMORY_FEATURE_FLAG_MAPPABLE = 1 << 4, + MEMORY_FEATURE_FLAG_MULTI_INSTANCE = 1 << 5, }; typedef uint32_t MemoryFeatureFlags; @@ -354,12 +688,21 @@ namespace Anvil OCCLUSION_QUERY_SUPPORT_SCOPE_REQUIRED_PRECISE, } OcclusionQuerySupportScope; + /* NOTE: These map 1:1 to VK equivalents */ + typedef enum class PointClippingBehavior + { + ALL_CLIP_PLANES = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES_KHR, + USER_CLIP_PLANES_ONLY = VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY_KHR, + + UNKNOWN = VK_POINT_CLIPPING_BEHAVIOR_MAX_ENUM + } PointClippingBehavior; + /** A bitmask defining one or more queue family usage.*/ typedef enum { - QUEUE_FAMILY_COMPUTE_BIT = 1 << 0, - QUEUE_FAMILY_DMA_BIT = 1 << 1, - QUEUE_FAMILY_GRAPHICS_BIT = 1 << 2, + QUEUE_FAMILY_COMPUTE_BIT = 1 << 0, + QUEUE_FAMILY_DMA_BIT = 1 << 1, + QUEUE_FAMILY_GRAPHICS_BIT = 1 << 2, QUEUE_FAMILY_FIRST_BIT = QUEUE_FAMILY_COMPUTE_BIT, QUEUE_FAMILY_LAST_BIT = QUEUE_FAMILY_GRAPHICS_BIT @@ -410,6 +753,21 @@ namespace Anvil } QueryResultBit; typedef uint32_t QueryResultBits; + /* NOTE: These map 1:1 to VK equivalents */ + enum SampleCountFlagBits + { + SAMPLE_COUNT_FLAG_1_BIT = VK_SAMPLE_COUNT_1_BIT, + SAMPLE_COUNT_FLAG_2_BIT = VK_SAMPLE_COUNT_2_BIT, + SAMPLE_COUNT_FLAG_4_BIT = VK_SAMPLE_COUNT_4_BIT, + SAMPLE_COUNT_FLAG_8_BIT = VK_SAMPLE_COUNT_8_BIT, + SAMPLE_COUNT_FLAG_16_BIT = VK_SAMPLE_COUNT_16_BIT, + SAMPLE_COUNT_FLAG_32_BIT = VK_SAMPLE_COUNT_32_BIT, + SAMPLE_COUNT_FLAG_64_BIT = VK_SAMPLE_COUNT_64_BIT, + + SAMPLE_COUNT_UNKNOWN = 0 + }; + typedef uint32_t SampleCountFlags; + /* Specifies one of the compute / rendering pipeline stages. */ typedef enum { @@ -437,6 +795,15 @@ namespace Anvil SHADER_INFO_UNKNOWN = SHADER_INFO_COUNT } ShaderInfoType; + /* NOTE: These map 1:1 to VK equivalents */ + typedef enum class SharingMode + { + CONCURRENT = VK_SHARING_MODE_CONCURRENT, + EXCLUSIVE = VK_SHARING_MODE_EXCLUSIVE, + + UNKNOWN + } SharingMode; + typedef enum { /* Support sparse binding only */ @@ -451,6 +818,15 @@ namespace Anvil SPARSE_RESIDENCY_SCOPE_UNDEFINED } SparseResidencyScope; + /* NOTE: Enums map 1:1 to their VK equivalents */ + typedef enum class TessellationDomainOrigin + { + LOWER_LEFT = VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT_KHR, + UPPER_LEFT = VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT_KHR, + + UNKNOWN = VK_TESSELLATION_DOMAIN_ORIGIN_MAX_ENUM + } TessellationDomainOrigin; + /** Defines supported timestamp capture modes. */ typedef enum { diff --git a/include/misc/types_macro.h b/include/misc/types_macro.h index 5aa0ff20..2c445a12 100644 --- a/include/misc/types_macro.h +++ b/include/misc/types_macro.h @@ -24,6 +24,7 @@ /* Wrappers for some of the Vulkan enums we use across Anvil */ #ifdef ANVIL_LITTLE_ENDIAN + #define VkAccessFlagsVariable(name) \ union \ { \ @@ -31,24 +32,23 @@ \ struct \ { \ - uint8_t VK_ACCESS_INDIRECT_COMMAND_READ_BIT : 1; \ - uint8_t VK_ACCESS_INDEX_READ_BIT : 1; \ - uint8_t VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT : 1; \ - uint8_t VK_ACCESS_UNIFORM_READ_BIT : 1; \ - uint8_t VK_ACCESS_INPUT_ATTACHMENT_READ_BIT : 1; \ - uint8_t VK_ACCESS_SHADER_READ_BIT : 1; \ - uint8_t VK_ACCESS_SHADER_WRITE_BIT : 1; \ - uint8_t VK_ACCESS_COLOR_ATTACHMENT_READ_BIT : 1; \ - uint8_t VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT : 1; \ - uint8_t VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT : 1; \ + uint8_t VK_ACCESS_INDIRECT_COMMAND_READ_BIT : 1; \ + uint8_t VK_ACCESS_INDEX_READ_BIT : 1; \ + uint8_t VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT : 1; \ + uint8_t VK_ACCESS_UNIFORM_READ_BIT : 1; \ + uint8_t VK_ACCESS_INPUT_ATTACHMENT_READ_BIT : 1; \ + uint8_t VK_ACCESS_SHADER_READ_BIT : 1; \ + uint8_t VK_ACCESS_SHADER_WRITE_BIT : 1; \ + uint8_t VK_ACCESS_COLOR_ATTACHMENT_READ_BIT : 1; \ + uint8_t VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT : 1; \ + uint8_t VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT : 1; \ uint8_t VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT : 1; \ - uint8_t VK_ACCESS_TRANSFER_READ_BIT : 1; \ - uint8_t VK_ACCESS_TRANSFER_WRITE_BIT : 1; \ - uint8_t VK_ACCESS_HOST_READ_BIT : 1; \ - uint8_t VK_ACCESS_HOST_WRITE_BIT : 1; \ - uint8_t VK_ACCESS_MEMORY_READ_BIT : 1; \ - uint8_t VK_ACCESS_MEMORY_WRITE_BIT : 1; \ - uint32_t OTHER: 15; \ + uint8_t VK_ACCESS_TRANSFER_READ_BIT : 1; \ + uint8_t VK_ACCESS_TRANSFER_WRITE_BIT : 1; \ + uint8_t VK_ACCESS_HOST_READ_BIT : 1; \ + uint8_t VK_ACCESS_HOST_WRITE_BIT : 1; \ + uint8_t VK_ACCESS_MEMORY_READ_BIT : 1; \ + uint8_t VK_ACCESS_MEMORY_WRITE_BIT : 1; \ } name##_flags; \ }; @@ -59,30 +59,9 @@ \ struct \ { \ - uint8_t VK_BUFFER_CREATE_SPARSE_BINDING_BIT : 1; \ + uint8_t VK_BUFFER_CREATE_SPARSE_BINDING_BIT : 1; \ uint8_t VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT : 1; \ - uint8_t VK_BUFFER_CREATE_SPARSE_ALIASED_BIT : 1; \ - uint32_t OTHER: 29; \ - } name##_flags; \ - }; - - #define VkBufferUsageFlagsVariable(name) \ - union \ - { \ - VkBufferUsageFlags name; \ - \ - struct \ - { \ - uint8_t VK_BUFFER_USAGE_TRANSFER_SRC_BIT : 1; \ - uint8_t VK_BUFFER_USAGE_TRANSFER_DST_BIT : 1; \ - uint8_t VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT : 1; \ - uint8_t VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT : 1; \ - uint8_t VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT : 1; \ - uint8_t VK_BUFFER_USAGE_STORAGE_BUFFER_BIT : 1; \ - uint8_t VK_BUFFER_USAGE_INDEX_BUFFER_BIT : 1; \ - uint8_t VK_BUFFER_USAGE_VERTEX_BUFFER_BIT : 1; \ - uint8_t VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT : 1; \ - uint32_t OTHER: 23; \ + uint8_t VK_BUFFER_CREATE_SPARSE_ALIASED_BIT : 1; \ } name##_flags; \ }; @@ -97,7 +76,6 @@ uint8_t VK_COLOR_COMPONENT_G_BIT : 1; \ uint8_t VK_COLOR_COMPONENT_B_BIT : 1; \ uint8_t VK_COLOR_COMPONENT_A_BIT : 1; \ - uint32_t OTHER: 28; \ } name##_flags; \ }; @@ -108,11 +86,10 @@ \ struct \ { \ - uint8_t VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR : 1; \ - uint8_t VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR : 1; \ + uint8_t VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR : 1; \ + uint8_t VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR : 1; \ uint8_t VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR : 1; \ - uint8_t VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR : 1; \ - uint32_t OTHER: 28; \ + uint8_t VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR : 1; \ } name##_flags; \ }; @@ -124,8 +101,7 @@ struct \ { \ uint8_t VK_CULL_MODE_FRONT_BIT : 1; \ - uint8_t VK_CULL_MODE_BACK_BIT : 1; \ - uint32_t OTHER: 30; \ + uint8_t VK_CULL_MODE_BACK_BIT : 1; \ } name##_flags; \ }; @@ -136,69 +112,49 @@ \ struct \ { \ - uint8_t VK_DEPENDENCY_BY_REGION_BIT : 1; \ - uint32_t OTHER: 31; \ + uint8_t VK_DEPENDENCY_BY_REGION_BIT : 1; \ + uint8_t VK_DEPENDENCY_VIEW_LOCAL_BIT_KHR : 1; \ + uint8_t VK_DEPENDENCY_DEVICE_GROUP_BIT_KHR : 1; \ } name##_flags; \ }; - #define VkFormatFeatureFlagsVariable(name) \ + #define VkDeviceGroupPresentModeFlagBitsKHRVariable(name) \ union \ { \ - VkFormatFeatureFlags name; \ + VkDeviceGroupPresentModeFlagBitsKHR name; \ \ struct \ { \ - uint8_t VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_BLIT_SRC_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_BLIT_DST_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG : 1; \ - uint8_t VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR : 1; \ - uint8_t VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR : 1; \ - uint32_t OTHER: 16; \ + uint8_t VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR : 1; \ + uint8_t VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR : 1; \ + uint8_t VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR : 1; \ + uint8_t VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR : 1; \ } name##_flags; \ }; - #define VkImageAspectFlagsVariable(name) \ - union \ - { \ - VkImageAspectFlags name; \ - \ - struct \ - { \ - uint8_t VK_IMAGE_ASPECT_COLOR_BIT : 1; \ - uint8_t VK_IMAGE_ASPECT_DEPTH_BIT : 1; \ - uint8_t VK_IMAGE_ASPECT_STENCIL_BIT : 1; \ - uint8_t VK_IMAGE_ASPECT_METADATA_BIT : 1; \ - uint32_t OTHER: 28; \ - } name##_flags; \ - }; - - #define VkImageUsageFlagsVariable(name) \ + #define VkFormatFeatureFlagsVariable(name) \ union \ { \ - VkImageUsageFlags name; \ + VkFormatFeatureFlags name; \ \ struct \ { \ - uint8_t VK_IMAGE_USAGE_TRANSFER_SRC_BIT : 1; \ - uint8_t VK_IMAGE_USAGE_TRANSFER_DST_BIT : 1; \ - uint8_t VK_IMAGE_USAGE_SAMPLED_BIT : 1; \ - uint8_t VK_IMAGE_USAGE_STORAGE_BIT : 1; \ - uint8_t VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT : 1; \ - uint8_t VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT : 1; \ - uint8_t VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT : 1; \ - uint8_t VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT : 1; \ - uint32_t OTHER: 24; \ + uint8_t VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_BLIT_SRC_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_BLIT_DST_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT : 1; \ + uint8_t VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG : 1; \ + uint8_t VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR : 1; \ + uint8_t VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR : 1; \ } name##_flags; \ }; @@ -209,8 +165,8 @@ \ struct \ { \ - uint8_t VK_MEMORY_HEAP_DEVICE_LOCAL_BIT : 1; \ - uint32_t OTHER: 31; \ + uint8_t VK_MEMORY_HEAP_DEVICE_LOCAL_BIT : 1; \ + uint8_t VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR : 1; \ } name##_flags; \ }; @@ -221,12 +177,11 @@ \ struct \ { \ - uint8_t VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT : 1; \ - uint8_t VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT : 1; \ - uint8_t VK_MEMORY_PROPERTY_HOST_COHERENT_BIT : 1; \ - uint8_t VK_MEMORY_PROPERTY_HOST_CACHED_BIT : 1; \ + uint8_t VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT : 1; \ + uint8_t VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT : 1; \ + uint8_t VK_MEMORY_PROPERTY_HOST_COHERENT_BIT : 1; \ + uint8_t VK_MEMORY_PROPERTY_HOST_CACHED_BIT : 1; \ uint8_t VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT : 1; \ - uint32_t OTHER: 27; \ } name##_flags; \ }; @@ -237,24 +192,23 @@ \ struct \ { \ - uint8_t VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_VERTEX_INPUT_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_VERTEX_SHADER_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_VERTEX_INPUT_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_VERTEX_SHADER_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT : 1; \ uint8_t VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_TRANSFER_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_HOST_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_ALL_COMMANDS_BIT : 1; \ - uint32_t OTHER: 15; \ + uint8_t VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_TRANSFER_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_HOST_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT : 1; \ + uint8_t VK_PIPELINE_STAGE_ALL_COMMANDS_BIT : 1; \ } name##_flags; \ }; @@ -266,7 +220,6 @@ struct \ { \ uint8_t VK_QUERY_CONTROL_PRECISE_BIT : 1; \ - uint32_t OTHER: 31; \ } name##_flags; \ }; @@ -277,18 +230,17 @@ \ struct \ { \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT : 1; \ + uint8_t VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT : 1; \ + uint8_t VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT : 1; \ + uint8_t VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT : 1; \ + uint8_t VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT : 1; \ + uint8_t VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT : 1; \ + uint8_t VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT : 1; \ + uint8_t VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT : 1; \ + uint8_t VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT : 1; \ + uint8_t VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT : 1; \ uint8_t VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT : 1; \ - uint32_t OTHER: 21; \ + uint8_t VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT : 1; \ } name##_flags; \ }; @@ -299,11 +251,10 @@ \ struct \ { \ - uint8_t VK_QUERY_RESULT_64_BIT : 1; \ - uint8_t VK_QUERY_RESULT_WAIT_BIT : 1; \ + uint8_t VK_QUERY_RESULT_64_BIT : 1; \ + uint8_t VK_QUERY_RESULT_WAIT_BIT : 1; \ uint8_t VK_QUERY_RESULT_WITH_AVAILABILITY_BIT : 1; \ - uint8_t VK_QUERY_RESULT_PARTIAL_BIT : 1; \ - uint32_t OTHER: 28; \ + uint8_t VK_QUERY_RESULT_PARTIAL_BIT : 1; \ } name##_flags; \ }; @@ -314,29 +265,10 @@ \ struct \ { \ - uint8_t VK_QUEUE_GRAPHICS_BIT : 1; \ - uint8_t VK_QUEUE_COMPUTE_BIT : 1; \ - uint8_t VK_QUEUE_TRANSFER_BIT : 1; \ + uint8_t VK_QUEUE_GRAPHICS_BIT : 1; \ + uint8_t VK_QUEUE_COMPUTE_BIT : 1; \ + uint8_t VK_QUEUE_TRANSFER_BIT : 1; \ uint8_t VK_QUEUE_SPARSE_BINDING_BIT : 1; \ - uint32_t OTHER: 28; \ - } name##_flags; \ - }; - - #define VkSampleCountFlagsVariable(name) \ - union \ - { \ - VkSampleCountFlags name; \ - \ - struct \ - { \ - uint8_t VK_SAMPLE_COUNT_1_BIT : 1; \ - uint8_t VK_SAMPLE_COUNT_2_BIT : 1; \ - uint8_t VK_SAMPLE_COUNT_4_BIT : 1; \ - uint8_t VK_SAMPLE_COUNT_8_BIT : 1; \ - uint8_t VK_SAMPLE_COUNT_16_BIT : 1; \ - uint8_t VK_SAMPLE_COUNT_32_BIT : 1; \ - uint8_t VK_SAMPLE_COUNT_64_BIT : 1; \ - uint32_t OTHER: 25; \ } name##_flags; \ }; @@ -347,13 +279,12 @@ \ struct \ { \ - uint8_t VK_SHADER_STAGE_VERTEX_BIT : 1; \ - uint8_t VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT : 1; \ + uint8_t VK_SHADER_STAGE_VERTEX_BIT : 1; \ + uint8_t VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT : 1; \ uint8_t VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT : 1; \ - uint8_t VK_SHADER_STAGE_GEOMETRY_BIT : 1; \ - uint8_t VK_SHADER_STAGE_FRAGMENT_BIT : 1; \ - uint8_t VK_SHADER_STAGE_COMPUTE_BIT : 1; \ - uint32_t OTHER: 26; \ + uint8_t VK_SHADER_STAGE_GEOMETRY_BIT : 1; \ + uint8_t VK_SHADER_STAGE_FRAGMENT_BIT : 1; \ + uint8_t VK_SHADER_STAGE_COMPUTE_BIT : 1; \ } name##_flags; \ }; @@ -364,10 +295,9 @@ \ struct \ { \ - uint8_t VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT : 1; \ - uint8_t VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT: 1; \ - uint8_t VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT: 1; \ - uint32_t OTHER: 29; \ + uint8_t VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT : 1; \ + uint8_t VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT : 1; \ + uint8_t VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT : 1; \ } name##_flags; \ }; @@ -379,7 +309,6 @@ struct \ { \ uint8_t VK_SPARSE_MEMORY_BIND_METADATA_BIT : 1; \ - uint32_t OTHER: 31; \ } name##_flags; \ }; @@ -391,8 +320,7 @@ struct \ { \ uint8_t VK_STENCIL_FACE_FRONT_BIT : 1; \ - uint8_t VK_STENCIL_FACE_BACK_BIT : 1; \ - uint32_t OTHER: 30; \ + uint8_t VK_STENCIL_FACE_BACK_BIT : 1; \ } name##_flags; \ }; @@ -403,16 +331,15 @@ \ struct \ { \ - uint8_t VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR : 1; \ + uint8_t VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR : 1; \ + uint8_t VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR : 1; \ + uint8_t VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR : 1; \ + uint8_t VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR : 1; \ + uint8_t VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR : 1; \ + uint8_t VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR : 1; \ uint8_t VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR : 1; \ uint8_t VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR : 1; \ - uint32_t OTHER: 23; \ + uint8_t VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR : 1; \ } name##_flags; \ }; #else diff --git a/include/misc/types_struct.h b/include/misc/types_struct.h index 6da2fa14..2a4e26ce 100644 --- a/include/misc/types_struct.h +++ b/include/misc/types_struct.h @@ -181,11 +181,11 @@ namespace Anvil { const Anvil::BufferCreateFlags create_flags; const Anvil::ExternalMemoryHandleTypeBit external_memory_handle_type; - const VkBufferUsageFlags usage_flags; + const Anvil::BufferUsageFlags usage_flags; explicit BufferPropertiesQuery(const Anvil::BufferCreateFlags in_create_flags, const Anvil::ExternalMemoryHandleTypeBit& in_external_memory_handle_type, - const VkBufferUsageFlags& in_usage_flags) + const Anvil::BufferUsageFlags& in_usage_flags) :create_flags (in_create_flags), external_memory_handle_type(in_external_memory_handle_type), usage_flags (in_usage_flags) @@ -197,6 +197,42 @@ namespace Anvil BufferPropertiesQuery& operator=(const BufferPropertiesQuery& in_query) = delete; } BufferPropertiesQuery; + /* Used by Buffer::set_nonsparse_memory_multi(). Requires VK_KHR_device_group support. */ + typedef struct BufferMemoryBindingUpdate + { + Anvil::Buffer* buffer_ptr; + bool memory_block_owned_by_buffer; + Anvil::MemoryBlock* memory_block_ptr; + + /* May either be empty (for sGPU and mGPU devices) or: + * + * 1) hold up as many physical devices as there are assigned to the device + * group (mGPU devices) + * 2) hold the physical device, from which the logical device has been created + * (sGPU device) + */ + std::vector physical_devices; + + BufferMemoryBindingUpdate(); + } BufferMemoryBindingUpdate; + + /** TODO */ + typedef struct CommandBufferMGPUSubmission + { + /* Command buffer to execute. May be nullptr. */ + Anvil::CommandBufferBase* cmd_buffer_ptr; + + /* Bit mask determining which devices in the device group will execute the command buffer. */ + uint32_t device_mask; + + /* Default dummy constructor */ + CommandBufferMGPUSubmission() + { + cmd_buffer_ptr = nullptr; + device_mask = 0; + } + } CommandBufferMGPUSubmission; + #if defined(_WIN32) typedef struct ExternalNTHandleInfo { @@ -281,6 +317,28 @@ namespace Anvil EXTVertexAttributeDivisorProperties(const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT& in_props); } EXTVertexAttributeDivisorProperties; + /* Used by Image::set_memory_multi(). Requires VK_KHR_device_group support. */ + typedef struct ImagePhysicalDeviceMemoryBindingUpdate + { + Anvil::Image* image_ptr; + bool memory_block_owned_by_image; + Anvil::MemoryBlock* memory_block_ptr; + std::vector physical_devices; + + ImagePhysicalDeviceMemoryBindingUpdate(); + } ImagePhysicalDeviceMemoryBindingUpdate; + + /* Used by Image::set_memory_multi(). Requires VK_KHR_device_group support. */ + typedef struct ImageSFRMemoryBindingUpdate + { + Anvil::Image* image_ptr; + bool memory_block_owned_by_image; + Anvil::MemoryBlock* memory_block_ptr; + std::vector SFRs; + + ImageSFRMemoryBindingUpdate(); + } ImageSFRMemoryBindingUpdate; + typedef struct DescriptorSetAllocation { /* Descriptor set layout to use for the allocation request */ @@ -374,6 +432,19 @@ namespace Anvil ExtensionEXTDebugReportEntrypoints(); } ExtensionEXTDebugReportEntrypoints; + typedef struct ExtensionKHRDeviceGroupEntrypoints + { + PFN_vkAcquireNextImage2KHR vkAcquireNextImage2KHR; + PFN_vkCmdDispatchBaseKHR vkCmdDispatchBaseKHR; + PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR vkGetDeviceGroupPeerMemoryFeaturesKHR; + PFN_vkGetDeviceGroupPresentCapabilitiesKHR vkGetDeviceGroupPresentCapabilitiesKHR; + PFN_vkGetDeviceGroupSurfacePresentModesKHR vkGetDeviceGroupSurfacePresentModesKHR; + PFN_vkGetPhysicalDevicePresentRectanglesKHR vkGetPhysicalDevicePresentRectanglesKHR; + PFN_vkCmdSetDeviceMaskKHR vkCmdSetDeviceMaskKHR; + + ExtensionKHRDeviceGroupEntrypoints(); + } ExtensionKHRDeviceGroupEntrypoints; + typedef struct ExtensionKHRDrawIndirectCountEntrypoints { PFN_vkCmdDrawIndexedIndirectCountKHR vkCmdDrawIndexedIndirectCountKHR; @@ -594,11 +665,11 @@ namespace Anvil { ExternalMemoryProperties external_handle_properties; - VkExtent3D max_extent; - VkDeviceSize max_resource_size; - uint32_t n_max_array_layers; - uint32_t n_max_mip_levels; - VkSampleCountFlags sample_counts; + VkExtent3D max_extent; + VkDeviceSize max_resource_size; + uint32_t n_max_array_layers; + uint32_t n_max_mip_levels; + Anvil::SampleCountFlags sample_counts; /* Tells whether the format can be used with functions introduced in VK_AMD_texture_gather_bias_lod */ bool supports_amd_texture_gather_bias_lod; @@ -624,11 +695,11 @@ namespace Anvil * configuration, make sure to call ImageFormatPropertiesQuery::set_external_memory_handle_type(), prior * to passing the struct instance as an arg to get_image_format_properties(). */ - explicit ImageFormatPropertiesQuery(const VkFormat& in_format, - const VkImageType& in_image_type, - const VkImageTiling& in_tiling, - const VkImageUsageFlags& in_usage_flags, - const VkImageCreateFlags& in_create_flags) + explicit ImageFormatPropertiesQuery(const Anvil::Format& in_format, + const Anvil::ImageType& in_image_type, + const Anvil::ImageTiling& in_tiling, + const Anvil::ImageUsageFlags& in_usage_flags, + const Anvil::ImageCreateFlags& in_create_flags) :create_flags (in_create_flags), external_memory_handle_type(EXTERNAL_MEMORY_HANDLE_TYPE_NONE), format (in_format), @@ -644,12 +715,12 @@ namespace Anvil external_memory_handle_type = in_external_memory_handle_type; } - const VkImageCreateFlags create_flags; + const ImageCreateFlags create_flags; Anvil::ExternalMemoryHandleTypeBit external_memory_handle_type; - const VkFormat format; - const VkImageType image_type; - const VkImageTiling tiling; - const VkImageUsageFlags usage_flags; + const Anvil::Format format; + const Anvil::ImageType image_type; + const Anvil::ImageTiling tiling; + const Anvil::ImageUsageFlags usage_flags; ImageFormatPropertiesQuery (const ImageFormatPropertiesQuery& in_query) = default; ImageFormatPropertiesQuery& operator=(const ImageFormatPropertiesQuery& in_query) = delete; @@ -666,8 +737,8 @@ namespace Anvil VkImage image; VkImageMemoryBarrier image_barrier_vk; Anvil::Image* image_ptr; - VkImageLayout new_layout; - VkImageLayout old_layout; + Anvil::ImageLayout new_layout; + Anvil::ImageLayout old_layout; uint32_t src_queue_family_index; VkImageSubresourceRange subresource_range; @@ -691,8 +762,8 @@ namespace Anvil ImageBarrier(VkAccessFlags in_source_access_mask, VkAccessFlags in_destination_access_mask, bool in_by_region_barrier, - VkImageLayout in_old_layout, - VkImageLayout in_new_layout, + Anvil::ImageLayout in_old_layout, + Anvil::ImageLayout in_new_layout, uint32_t in_src_queue_family_index, uint32_t in_dst_queue_family_index, Anvil::Image* in_image_ptr, @@ -785,6 +856,17 @@ namespace Anvil KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties(const VkPhysicalDeviceIDPropertiesKHR& in_properties); } KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties; + typedef struct KHRMaintenance2PhysicalDevicePointClippingProperties + { + PointClippingBehavior point_clipping_behavior; + + KHRMaintenance2PhysicalDevicePointClippingProperties(); + KHRMaintenance2PhysicalDevicePointClippingProperties(const VkPhysicalDevicePointClippingPropertiesKHR& in_props); + + bool operator==(const KHRMaintenance2PhysicalDevicePointClippingProperties&) const; + + } KHRMaintenance2PhysicalDevicePointClippingProperties; + typedef struct KHRMaintenance3Properties { VkDeviceSize max_memory_allocation_size; @@ -872,6 +954,7 @@ namespace Anvil { VkMemoryHeapFlagsVariable(flags); + uint32_t index; VkDeviceSize size; /** Stub constructor */ @@ -939,7 +1022,7 @@ namespace Anvil typedef struct MipmapRawData { /* Image aspect the mip-map data is specified for. */ - VkImageAspectFlagBits aspect; + Anvil::ImageAspectFlagBits aspect; /* Start layer index */ uint32_t n_layer; @@ -987,15 +1070,15 @@ namespace Anvil * * @return As per description. **/ - static MipmapRawData create_1D_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + static MipmapRawData create_1D_from_uchar_ptr (Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_mipmap, std::shared_ptr in_linear_tightly_packed_data_ptr, uint32_t in_row_size); - static MipmapRawData create_1D_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + static MipmapRawData create_1D_from_uchar_ptr (Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_mipmap, const unsigned char* in_linear_tightly_packed_data_vector_ptr, uint32_t in_row_size); - static MipmapRawData create_1D_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, + static MipmapRawData create_1D_from_uchar_vector_ptr(Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_mipmap, std::shared_ptr > in_linear_tightly_packed_data_ptr, uint32_t in_row_size); @@ -1013,21 +1096,21 @@ namespace Anvil * * @return As per description. **/ - static MipmapRawData create_1D_array_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + static MipmapRawData create_1D_array_from_uchar_ptr (Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_layers, uint32_t in_n_mipmap, std::shared_ptr in_linear_tightly_packed_data_ptr, uint32_t in_row_size, uint32_t in_data_size); - static MipmapRawData create_1D_array_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + static MipmapRawData create_1D_array_from_uchar_ptr (Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_layers, uint32_t in_n_mipmap, const unsigned char* in_linear_tightly_packed_data_ptr, uint32_t in_row_size, uint32_t in_data_size); - static MipmapRawData create_1D_array_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, + static MipmapRawData create_1D_array_from_uchar_vector_ptr(Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_layers, uint32_t in_n_mipmap, @@ -1046,17 +1129,17 @@ namespace Anvil * * @return As per description. **/ - static MipmapRawData create_2D_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + static MipmapRawData create_2D_from_uchar_ptr (Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_mipmap, std::shared_ptr in_linear_tightly_packed_data_ptr, uint32_t in_data_size, uint32_t in_row_size); - static MipmapRawData create_2D_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + static MipmapRawData create_2D_from_uchar_ptr (Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_mipmap, const unsigned char* in_linear_tightly_packed_data_ptr, uint32_t in_data_size, uint32_t in_row_size); - static MipmapRawData create_2D_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, + static MipmapRawData create_2D_from_uchar_vector_ptr(Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_mipmap, std::shared_ptr > in_linear_tightly_packed_data_ptr, uint32_t in_data_size, @@ -1075,21 +1158,21 @@ namespace Anvil * * @return As per description. **/ - static MipmapRawData create_2D_array_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + static MipmapRawData create_2D_array_from_uchar_ptr (Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_layers, uint32_t in_n_mipmap, std::shared_ptr in_linear_tightly_packed_data_ptr, uint32_t in_data_size, uint32_t in_row_size); - static MipmapRawData create_2D_array_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + static MipmapRawData create_2D_array_from_uchar_ptr (Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_layers, uint32_t in_n_mipmap, const unsigned char* in_linear_tightly_packed_data_ptr, uint32_t in_data_size, uint32_t in_row_size); - static MipmapRawData create_2D_array_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, + static MipmapRawData create_2D_array_from_uchar_vector_ptr(Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_layers, uint32_t in_n_mipmap, @@ -1110,21 +1193,21 @@ namespace Anvil * * @return As per description. **/ - static MipmapRawData create_3D_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + static MipmapRawData create_3D_from_uchar_ptr (Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_layer_slices, uint32_t in_n_mipmap, std::shared_ptr in_linear_tightly_packed_data_ptr, uint32_t in_slice_data_size, uint32_t in_row_size); - static MipmapRawData create_3D_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + static MipmapRawData create_3D_from_uchar_ptr (Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_layer_slices, uint32_t in_n_mipmap, const unsigned char* in_linear_tightly_packed_data_ptr, uint32_t in_slice_data_size, uint32_t in_row_size); - static MipmapRawData create_3D_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, + static MipmapRawData create_3D_from_uchar_vector_ptr(Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_layer_slices, uint32_t in_n_mipmap, @@ -1145,19 +1228,19 @@ namespace Anvil * * @return As per description. **/ - static MipmapRawData create_cube_map_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + static MipmapRawData create_cube_map_from_uchar_ptr (Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_mipmap, std::shared_ptr in_linear_tightly_packed_data_ptr, uint32_t in_data_size, uint32_t in_row_size); - static MipmapRawData create_cube_map_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + static MipmapRawData create_cube_map_from_uchar_ptr (Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_mipmap, const unsigned char* in_linear_tightly_packed_data_ptr, uint32_t in_data_size, uint32_t in_row_size); - static MipmapRawData create_cube_map_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, + static MipmapRawData create_cube_map_from_uchar_vector_ptr(Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_mipmap, std::shared_ptr > in_linear_tightly_packed_data_ptr, @@ -1179,21 +1262,21 @@ namespace Anvil * * @return As per description. **/ - static MipmapRawData create_cube_map_array_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + static MipmapRawData create_cube_map_array_from_uchar_ptr (Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_layers, uint32_t in_n_mipmap, std::shared_ptr in_linear_tightly_packed_data_ptr, uint32_t in_data_size, uint32_t in_row_size); - static MipmapRawData create_cube_map_array_from_uchar_ptr (VkImageAspectFlagBits in_aspect, + static MipmapRawData create_cube_map_array_from_uchar_ptr (Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_layers, uint32_t in_n_mipmap, const unsigned char* in_linear_tightly_packed_data_ptr, uint32_t in_data_size, uint32_t in_row_size); - static MipmapRawData create_cube_map_array_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, + static MipmapRawData create_cube_map_array_from_uchar_vector_ptr(Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_layers, uint32_t in_n_mipmap, @@ -1202,31 +1285,31 @@ namespace Anvil uint32_t in_row_size); private: - static MipmapRawData create_1D (VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - uint32_t in_row_size); - static MipmapRawData create_1D_array(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - uint32_t in_row_size, - uint32_t in_data_size); - static MipmapRawData create_2D (VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - uint32_t in_data_size, - uint32_t in_row_size); - static MipmapRawData create_2D_array(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - uint32_t in_data_size, - uint32_t in_row_size); - static MipmapRawData create_3D (VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_slices, - uint32_t in_n_mipmap, - uint32_t in_data_size, - uint32_t in_row_size); + static MipmapRawData create_1D (Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + uint32_t in_row_size); + static MipmapRawData create_1D_array(Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + uint32_t in_row_size, + uint32_t in_data_size); + static MipmapRawData create_2D (Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + uint32_t in_data_size, + uint32_t in_row_size); + static MipmapRawData create_2D_array(Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + uint32_t in_data_size, + uint32_t in_row_size); + static MipmapRawData create_3D (Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_slices, + uint32_t in_n_mipmap, + uint32_t in_data_size, + uint32_t in_row_size); } MipmapRawData; /* Dummy delete functor */ @@ -1363,112 +1446,112 @@ namespace Anvil typedef struct PhysicalDeviceLimits { - VkDeviceSize buffer_image_granularity; - uint32_t discrete_queue_priorities; - VkSampleCountFlags framebuffer_color_sample_counts; - VkSampleCountFlags framebuffer_depth_sample_counts; - VkSampleCountFlags framebuffer_no_attachments_sample_counts; - VkSampleCountFlags framebuffer_stencil_sample_counts; - float line_width_granularity; - float line_width_range[2]; - uint32_t max_bound_descriptor_sets; - uint32_t max_clip_distances; - uint32_t max_color_attachments; - uint32_t max_combined_clip_and_cull_distances; - uint32_t max_compute_shared_memory_size; - uint32_t max_compute_work_group_count[3]; - uint32_t max_compute_work_group_invocations; - uint32_t max_compute_work_group_size[3]; - uint32_t max_cull_distances; - uint32_t max_descriptor_set_input_attachments; - uint32_t max_descriptor_set_sampled_images; - uint32_t max_descriptor_set_samplers; - uint32_t max_descriptor_set_storage_buffers; - uint32_t max_descriptor_set_storage_buffers_dynamic; - uint32_t max_descriptor_set_storage_images; - uint32_t max_descriptor_set_uniform_buffers; - uint32_t max_descriptor_set_uniform_buffers_dynamic; - uint32_t max_draw_indexed_index_value; - uint32_t max_draw_indirect_count; - uint32_t max_fragment_combined_output_resources; - uint32_t max_fragment_dual_src_attachments; - uint32_t max_fragment_input_components; - uint32_t max_fragment_output_attachments; - uint32_t max_framebuffer_height; - uint32_t max_framebuffer_layers; - uint32_t max_framebuffer_width; - uint32_t max_geometry_input_components; - uint32_t max_geometry_output_components; - uint32_t max_geometry_output_vertices; - uint32_t max_geometry_shader_invocations; - uint32_t max_geometry_total_output_components; - uint32_t max_image_array_layers; - uint32_t max_image_dimension_1D; - uint32_t max_image_dimension_2D; - uint32_t max_image_dimension_3D; - uint32_t max_image_dimension_cube; - float max_interpolation_offset; - uint32_t max_memory_allocation_count; - uint32_t max_per_stage_descriptor_input_attachments; - uint32_t max_per_stage_descriptor_sampled_images; - uint32_t max_per_stage_descriptor_samplers; - uint32_t max_per_stage_descriptor_storage_buffers; - uint32_t max_per_stage_descriptor_storage_images; - uint32_t max_per_stage_descriptor_uniform_buffers; - uint32_t max_per_stage_resources; - uint32_t max_push_constants_size; - uint32_t max_sample_mask_words; - uint32_t max_sampler_allocation_count; - float max_sampler_anisotropy; - float max_sampler_lod_bias; - uint32_t max_storage_buffer_range; - uint32_t max_viewport_dimensions[2]; - uint32_t max_viewports; - uint32_t max_tessellation_control_per_patch_output_components; - uint32_t max_tessellation_control_per_vertex_input_components; - uint32_t max_tessellation_control_per_vertex_output_components; - uint32_t max_tessellation_control_total_output_components; - uint32_t max_tessellation_evaluation_input_components; - uint32_t max_tessellation_evaluation_output_components; - uint32_t max_tessellation_generation_level; - uint32_t max_tessellation_patch_size; - uint32_t max_texel_buffer_elements; - uint32_t max_texel_gather_offset; - uint32_t max_texel_offset; - uint32_t max_uniform_buffer_range; - uint32_t max_vertex_input_attributes; - uint32_t max_vertex_input_attribute_offset; - uint32_t max_vertex_input_bindings; - uint32_t max_vertex_input_binding_stride; - uint32_t max_vertex_output_components; - float min_interpolation_offset; - size_t min_memory_map_alignment; - VkDeviceSize min_storage_buffer_offset_alignment; - VkDeviceSize min_texel_buffer_offset_alignment; - int32_t min_texel_gather_offset; - int32_t min_texel_offset; - VkDeviceSize min_uniform_buffer_offset_alignment; - uint32_t mipmap_precision_bits; - VkDeviceSize non_coherent_atom_size; - VkDeviceSize optimal_buffer_copy_offset_alignment; - VkDeviceSize optimal_buffer_copy_row_pitch_alignment; - float point_size_granularity; - float point_size_range[2]; - VkSampleCountFlags sampled_image_color_sample_counts; - VkSampleCountFlags sampled_image_depth_sample_counts; - VkSampleCountFlags sampled_image_integer_sample_counts; - VkSampleCountFlags sampled_image_stencil_sample_counts; - VkDeviceSize sparse_address_space_size; - bool standard_sample_locations; - VkSampleCountFlags storage_image_sample_counts; - bool strict_lines; - uint32_t sub_pixel_interpolation_offset_bits; - uint32_t sub_pixel_precision_bits; - uint32_t sub_texel_precision_bits; - bool timestamp_compute_and_graphics; - float timestamp_period; - float viewport_bounds_range[2]; - uint32_t viewport_sub_pixel_bits; + VkDeviceSize buffer_image_granularity; + uint32_t discrete_queue_priorities; + Anvil::SampleCountFlags framebuffer_color_sample_counts; + Anvil::SampleCountFlags framebuffer_depth_sample_counts; + Anvil::SampleCountFlags framebuffer_no_attachments_sample_counts; + Anvil::SampleCountFlags framebuffer_stencil_sample_counts; + float line_width_granularity; + float line_width_range[2]; + uint32_t max_bound_descriptor_sets; + uint32_t max_clip_distances; + uint32_t max_color_attachments; + uint32_t max_combined_clip_and_cull_distances; + uint32_t max_compute_shared_memory_size; + uint32_t max_compute_work_group_count[3]; + uint32_t max_compute_work_group_invocations; + uint32_t max_compute_work_group_size[3]; + uint32_t max_cull_distances; + uint32_t max_descriptor_set_input_attachments; + uint32_t max_descriptor_set_sampled_images; + uint32_t max_descriptor_set_samplers; + uint32_t max_descriptor_set_storage_buffers; + uint32_t max_descriptor_set_storage_buffers_dynamic; + uint32_t max_descriptor_set_storage_images; + uint32_t max_descriptor_set_uniform_buffers; + uint32_t max_descriptor_set_uniform_buffers_dynamic; + uint32_t max_draw_indexed_index_value; + uint32_t max_draw_indirect_count; + uint32_t max_fragment_combined_output_resources; + uint32_t max_fragment_dual_src_attachments; + uint32_t max_fragment_input_components; + uint32_t max_fragment_output_attachments; + uint32_t max_framebuffer_height; + uint32_t max_framebuffer_layers; + uint32_t max_framebuffer_width; + uint32_t max_geometry_input_components; + uint32_t max_geometry_output_components; + uint32_t max_geometry_output_vertices; + uint32_t max_geometry_shader_invocations; + uint32_t max_geometry_total_output_components; + uint32_t max_image_array_layers; + uint32_t max_image_dimension_1D; + uint32_t max_image_dimension_2D; + uint32_t max_image_dimension_3D; + uint32_t max_image_dimension_cube; + float max_interpolation_offset; + uint32_t max_memory_allocation_count; + uint32_t max_per_stage_descriptor_input_attachments; + uint32_t max_per_stage_descriptor_sampled_images; + uint32_t max_per_stage_descriptor_samplers; + uint32_t max_per_stage_descriptor_storage_buffers; + uint32_t max_per_stage_descriptor_storage_images; + uint32_t max_per_stage_descriptor_uniform_buffers; + uint32_t max_per_stage_resources; + uint32_t max_push_constants_size; + uint32_t max_sample_mask_words; + uint32_t max_sampler_allocation_count; + float max_sampler_anisotropy; + float max_sampler_lod_bias; + uint32_t max_storage_buffer_range; + uint32_t max_viewport_dimensions[2]; + uint32_t max_viewports; + uint32_t max_tessellation_control_per_patch_output_components; + uint32_t max_tessellation_control_per_vertex_input_components; + uint32_t max_tessellation_control_per_vertex_output_components; + uint32_t max_tessellation_control_total_output_components; + uint32_t max_tessellation_evaluation_input_components; + uint32_t max_tessellation_evaluation_output_components; + uint32_t max_tessellation_generation_level; + uint32_t max_tessellation_patch_size; + uint32_t max_texel_buffer_elements; + uint32_t max_texel_gather_offset; + uint32_t max_texel_offset; + uint32_t max_uniform_buffer_range; + uint32_t max_vertex_input_attributes; + uint32_t max_vertex_input_attribute_offset; + uint32_t max_vertex_input_bindings; + uint32_t max_vertex_input_binding_stride; + uint32_t max_vertex_output_components; + float min_interpolation_offset; + size_t min_memory_map_alignment; + VkDeviceSize min_storage_buffer_offset_alignment; + VkDeviceSize min_texel_buffer_offset_alignment; + int32_t min_texel_gather_offset; + int32_t min_texel_offset; + VkDeviceSize min_uniform_buffer_offset_alignment; + uint32_t mipmap_precision_bits; + VkDeviceSize non_coherent_atom_size; + VkDeviceSize optimal_buffer_copy_offset_alignment; + VkDeviceSize optimal_buffer_copy_row_pitch_alignment; + float point_size_granularity; + float point_size_range[2]; + Anvil::SampleCountFlags sampled_image_color_sample_counts; + Anvil::SampleCountFlags sampled_image_depth_sample_counts; + Anvil::SampleCountFlags sampled_image_integer_sample_counts; + Anvil::SampleCountFlags sampled_image_stencil_sample_counts; + VkDeviceSize sparse_address_space_size; + bool standard_sample_locations; + Anvil::SampleCountFlags storage_image_sample_counts; + bool strict_lines; + uint32_t sub_pixel_interpolation_offset_bits; + uint32_t sub_pixel_precision_bits; + uint32_t sub_texel_precision_bits; + bool timestamp_compute_and_graphics; + float timestamp_period; + float viewport_bounds_range[2]; + uint32_t viewport_sub_pixel_bits; PhysicalDeviceLimits(); PhysicalDeviceLimits(const VkPhysicalDeviceLimits& in_device_limits); @@ -1516,6 +1599,7 @@ namespace Anvil const EXTDescriptorIndexingProperties* ext_descriptor_indexing_properties_ptr; const EXTVertexAttributeDivisorProperties* ext_vertex_attribute_divisor_properties_ptr; const KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties* khr_external_memory_capabilities_physical_device_id_properties_ptr; + const KHRMaintenance2PhysicalDevicePointClippingProperties* khr_maintenance2_point_clipping_properties_ptr; const KHRMaintenance3Properties* khr_maintenance3_properties_ptr; PhysicalDeviceProperties(); @@ -1524,7 +1608,8 @@ namespace Anvil const EXTDescriptorIndexingProperties* in_ext_descriptor_indexing_properties_ptr, const EXTVertexAttributeDivisorProperties* in_ext_vertex_attribute_divisor_properties_ptr, const KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties* in_khr_external_memory_caps_physical_device_id_props_ptr, - const KHRMaintenance3Properties* in_khr_maintenance3_properties_ptr); + const KHRMaintenance3Properties* in_khr_maintenance3_properties_ptr, + const KHRMaintenance2PhysicalDevicePointClippingProperties* in_khr_maintenance2_point_clipping_properties_ptr); bool operator==(const PhysicalDeviceProperties& in_props) const; } PhysicalDeviceProperties; @@ -1582,6 +1667,19 @@ namespace Anvil explicit PhysicalDeviceGroup(); } PhysicalDeviceGroup; + /** TODO */ + typedef struct SemaphoreMGPUSubmission + { + const Anvil::PhysicalDevice* physical_device_ptr; + Anvil::Semaphore* semaphore_ptr; + + SemaphoreMGPUSubmission() + { + physical_device_ptr = nullptr; + semaphore_ptr = nullptr; + } + } SemaphoreMGPUSubmission; + typedef struct SemaphoreProperties { ExternalSemaphoreProperties external_semaphore_properties; @@ -1642,7 +1740,8 @@ namespace Anvil /* Describes sparse properties for an image format */ typedef struct SparseImageAspectProperties { - VkImageAspectFlagsVariable (aspect_mask); + Anvil::ImageAspectFlags aspect_mask; + VkSparseImageFormatFlagsVariable(flags); VkExtent3D granularity; @@ -1679,6 +1778,7 @@ namespace Anvil typedef enum class SubmissionType { + MGPU, SGPU } SubmissionType; @@ -1695,6 +1795,9 @@ namespace Anvil * If @param in_should_block is true and @param in_opt_fence_ptr is nullptr, the function will create * a new fence, wait on it, and then release it prior to leaving. This may come at a performance cost. * + * The prototype which does not take *MGPUSubmission* may be used for both single- and multi-GPU device instances. + * The other one must only be called for multi-GPU device instances. + * * NOTE: By default, the following values are associated with a new SubmitInfo instance: * * - D3D12 fence submit info: none @@ -1755,6 +1858,10 @@ namespace Anvil bool in_should_block, Anvil::Fence* in_opt_fence_ptr = nullptr); + static SubmitInfo create_execute(const CommandBufferMGPUSubmission* in_cmd_buffer_submission_ptr, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr); + static SubmitInfo create_execute_signal(Anvil::CommandBufferBase* in_cmd_buffer_ptr, uint32_t in_n_semaphores_to_signal, Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, @@ -1767,6 +1874,12 @@ namespace Anvil bool in_should_block, Anvil::Fence* in_opt_fence_ptr = nullptr); + static SubmitInfo create_execute_signal(const CommandBufferMGPUSubmission* in_cmd_buffer_submission_ptr, + uint32_t in_n_signal_semaphore_submissions, + const SemaphoreMGPUSubmission* in_signal_semaphore_submissions_ptr, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr); + /** TODO * * NOTE: This function always blocks. @@ -1806,6 +1919,13 @@ namespace Anvil bool in_should_block, Anvil::Fence* in_opt_fence_ptr = nullptr); + static SubmitInfo create_wait_execute(const CommandBufferMGPUSubmission* in_cmd_buffer_submission_ptr, + uint32_t in_n_wait_semaphore_submissions, + const SemaphoreMGPUSubmission* in_wait_semaphore_submissions_ptr, + const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr); + static SubmitInfo create_wait_execute_signal(Anvil::CommandBufferBase* in_cmd_buffer_ptr, uint32_t in_n_semaphores_to_signal, Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, @@ -1824,6 +1944,20 @@ namespace Anvil bool in_should_block, Anvil::Fence* in_opt_fence_ptr = nullptr); + static SubmitInfo create_wait_execute_signal(const CommandBufferMGPUSubmission* in_cmd_buffer_submission_ptr, + uint32_t in_n_signal_semaphore_submissions, + const SemaphoreMGPUSubmission* in_signal_semaphore_submissions_ptr, + uint32_t in_n_wait_semaphore_submissions, + const SemaphoreMGPUSubmission* in_wait_semaphore_submissions_ptr, + const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr); + + const CommandBufferMGPUSubmission* get_command_buffers_mgpu() const + { + return command_buffers_mgpu_ptr; + } + Anvil::CommandBufferBase* const* get_command_buffers_sgpu() const { return command_buffers_sgpu_ptr; @@ -1868,6 +2002,11 @@ namespace Anvil return n_wait_semaphores; } + const Anvil::SemaphoreMGPUSubmission* get_signal_semaphores_mgpu() const + { + return signal_semaphores_mgpu_ptr; + } + Anvil::Semaphore* const* get_signal_semaphores_sgpu() const { return signal_semaphores_sgpu_ptr; @@ -1888,6 +2027,11 @@ namespace Anvil return type; } + const Anvil::SemaphoreMGPUSubmission* get_wait_semaphores_mgpu() const + { + return wait_semaphores_mgpu_ptr; + } + Anvil::Semaphore* const* get_wait_semaphores_sgpu() const { return wait_semaphores_sgpu_ptr; @@ -1957,15 +2101,28 @@ namespace Anvil bool in_should_block, Anvil::Fence* in_opt_fence_ptr); + SubmitInfo(uint32_t in_n_command_buffer_submissions, + const CommandBufferMGPUSubmission* in_opt_command_buffer_submissions_ptr, + uint32_t in_n_signal_semaphore_submissions, + const SemaphoreMGPUSubmission* in_opt_signal_semaphore_submissions_ptr, + uint32_t in_n_wait_semaphore_submissions, + const SemaphoreMGPUSubmission* in_opt_wait_semaphore_submissions_ptr, + const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptr, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr); + Anvil::CommandBufferBase* helper_cmd_buffer_raw_ptr; + const CommandBufferMGPUSubmission* command_buffers_mgpu_ptr; Anvil::CommandBufferBase* const* command_buffers_sgpu_ptr; uint32_t n_command_buffers; + const SemaphoreMGPUSubmission* signal_semaphores_mgpu_ptr; Anvil::Semaphore* const* signal_semaphores_sgpu_ptr; uint32_t n_signal_semaphores; const VkPipelineStageFlags* dst_stage_wait_masks_ptr; + const SemaphoreMGPUSubmission* wait_semaphores_mgpu_ptr; Anvil::Semaphore* const* wait_semaphores_sgpu_ptr; uint32_t n_wait_semaphores; diff --git a/include/misc/types_utils.h b/include/misc/types_utils.h index a02a486b..c879d3cf 100644 --- a/include/misc/types_utils.h +++ b/include/misc/types_utils.h @@ -43,6 +43,11 @@ namespace Anvil bool convert_mt_safety_enum_to_boolean(MTSafety in_mt_safety, const Anvil::BaseDevice* in_device_ptr); + VkIndexType convert_index_type_to_vk_index_type(const IndexType& in_index_type); + Anvil::IndexType convert_vk_index_type_to_index_type(const VkIndexType& in_index_type); + + Anvil::PeerMemoryFeatureFlags convert_vk_peer_memory_feature_flags_to_peer_memory_feature_flags(const VkPeerMemoryFeatureFlags& in_value); + Anvil::QueueFamilyBits get_queue_family_bits_from_queue_family_type(Anvil::QueueFamilyType in_queue_family_type); /** Converts a Anvil::QueueFamilyBits bitfield value to an array of queue family indices. @@ -59,14 +64,27 @@ namespace Anvil uint32_t* out_opt_queue_family_indices_ptr, uint32_t* out_opt_n_queue_family_indices_ptr); + /** Count the number of set bits in an unsigned value (popcount). + * Algorithm taken from Software Optimization Guide for AMD64 Processors, p. 179. + **/ + static inline uint32_t count_set_bits(uint32_t x) + { + x = x - ((x >> 1) & 0x55555555); + x = (x & 0x33333333) + ((x >> 2) & 0x33333333); + x = (((x + (x >> 4)) & 0x0F0F0F0F) * 0x01010101) >> ((sizeof(uint32_t) - 1) << 3); + + return x; + } + /** Returns an access mask which has all the access bits, relevant to the user-specified image layout, * enabled. * * The access mask can be further restricted to the specified queue family type. */ - VkAccessFlags get_access_mask_from_image_layout(VkImageLayout in_layout, + VkAccessFlags get_access_mask_from_image_layout(Anvil::ImageLayout in_layout, Anvil::QueueFamilyType in_queue_family_type = Anvil::QueueFamilyType::UNDEFINED); + /** Converts a pair of VkMemoryPropertyFlags and VkMemoryHeapFlags bitfields to a corresponding Anvil::MemoryFeatureFlags * enum. * diff --git a/include/misc/window.h b/include/misc/window.h index 6a53ed8b..9ce5f1e0 100644 --- a/include/misc/window.h +++ b/include/misc/window.h @@ -66,7 +66,7 @@ namespace Anvil /* Stub window implementation - useful for off-screen rendering. * * This dummy window saves each "presented" frame in a PNG file. For that process to be successful, - * the application MUST ensure the swapchain image is transitioned to VK_IMAGE_LAYOUT_GENERAL before + * the application MUST ensure the swapchain image is transitioned to Anvil::ImageLayout::GENERAL before * it is presented. **/ WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS, diff --git a/include/wrappers/buffer.h b/include/wrappers/buffer.h index 795457de..e49ea984 100644 --- a/include/wrappers/buffer.h +++ b/include/wrappers/buffer.h @@ -146,25 +146,31 @@ namespace Anvil * * If the buffer object uses non-mappable storage memory, a staging buffer using mappable memory will be created * instead. User-specified region of the source buffer will then be copied into it by submitting a copy operation, - * executed either on the transfer queue (if available), or on the universal queue. Afterward, the staging buffer + * executed either on the transfer queue (if available), or on the universal queue. Afterward, the staging buffer * will be released. * + * The function prototype without @param in_device_mask argument should be used for single-GPU devices only. + * The function prototype with @param in_device_mask argument should be used for multi-GPU devices only. + * The mask must contain only one bit set. + * + * This function must not be used to read data from buffers, whose memory backing comes from a multi-instance heap. + * * This function blocks until the transfer completes. * - * @param in_start_offset As per description. Must be smaller than the underlying memory object's size. - * @param in_size As per description. @param in_start_offset + @param in_size must be lower than or - * equal to the underlying memory object's size. - * @param in_out_result_ptr Retrieved data will be stored under this location. Must not be nullptr. + * @param in_start_offset As per description. Must be smaller than the underlying memory object's size. + * @param in_size As per description. @param in_start_offset + @param in_size must be lower than or + * equal to the underlying memory object's size. + * @param out_result_ptr Retrieved data will be stored under this location. Must not be nullptr. * * @return true if the operation was successful, false otherwise. **/ - bool read(VkDeviceSize in_start_offset, - VkDeviceSize in_size, - void* in_out_result_ptr); - bool read(VkDeviceSize in_start_offset, - VkDeviceSize in_size, - const Anvil::PhysicalDevice* in_physical_device_ptr, - void* out_result_ptr); + bool read(VkDeviceSize in_start_offset, + VkDeviceSize in_size, + void* out_result_ptr); + bool read(VkDeviceSize in_start_offset, + VkDeviceSize in_size, + uint32_t in_device_mask, + void* out_result_ptr); bool requires_dedicated_allocation() const { @@ -179,10 +185,18 @@ namespace Anvil * This function can only be used for NON-SPARSE buffers. Calling this function for sparse buffers will * result in an assertion failure. * + * Single-argument function prototype can only be used for single-GPU device instances, whereas the other one + * can be used for both single- multi-GPU device instances. In the latter case: + * + * 1) If the memory comes from a memory heap with VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR flag, all physical devices + * are bound its own instance of the memory and @param in_physical_devices_ptr is ignored. + * 2) If the memory comes from a memory heap without the flag, physical devices specified by the caller are assigned + * the same instance of the memory. + * * @param in_memory_block_ptr Memory block to attach to the buffer object. Must not be NULL. * @param in_memory_block_owned_by_buffer TODO - * @param in_n_physical_devices Describes the number of physical devices available under @param in_opt_physical_devices_ptr. - * @param in_physical_devices_ptr Physical devices to use to form the device mask. + * @param in_n_device_group_indices Describes the number of device indices available under @param in_device_group_indices_ptr. + * @param in_device_group_indices_ptr Device group indices to use to form the device mask. * * @return true if successful, false otherwise. **/ @@ -190,13 +204,25 @@ namespace Anvil bool set_nonsparse_memory(MemoryBlock* in_memory_block_ptr, bool in_memory_block_owned_by_buffer); - bool set_nonsparse_memory(MemoryBlockUniquePtr in_memory_block_ptr, - uint32_t in_n_physical_devices, - const Anvil::PhysicalDevice* in_physical_devices_ptr); - bool set_nonsparse_memory(MemoryBlock* in_memory_block_ptr, - bool in_memory_block_owned_by_buffer, - uint32_t in_n_physical_devices, - const Anvil::PhysicalDevice* in_physical_devices_ptr); + bool set_nonsparse_memory(MemoryBlockUniquePtr in_memory_block_ptr, + uint32_t in_n_device_group_indices, + const uint32_t* in_device_group_indices_ptr); + bool set_nonsparse_memory(MemoryBlock* in_memory_block_ptr, + bool in_memory_block_owned_by_buffer, + uint32_t in_n_device_group_indices, + const uint32_t* in_device_group_indices_ptr); + + /** See set_nonsparse_memory() for general documentation. + * + * This static function can be used to set buffer memory bindings in a batched manner. + * + * Can be used for both single- and multi-GPU devices. + * Requires VK_KHR_device_group to be supported by & enabled for the device. + * + * TODO + **/ + static bool set_nonsparse_memory_multi(uint32_t in_n_buffer_memory_binding_updates, + BufferMemoryBindingUpdate* in_updates_ptr); /** Writes @param in_size bytes, starting from @param in_start_offset, into the wrapped memory object. * @@ -209,6 +235,13 @@ namespace Anvil * transfer the new contents to the target buffer. The operation will be submitted via a transfer queue, if one * is available, or a universal queue otherwise. * + * This function must not be used to read data from buffers, whose memory backing comes from a multi-instance heap. + * + * The function prototype without @param in_device_mask argument should be used for single-GPU devices only. + * + * The function prototype with @param in_device_mask argument should be used for multi-GPU devices only. + * The mask must contain only one bit set. + * * If the buffer instance uses an exclusive sharing mode and supports more than just one queue family type AND memory * backing the buffer is not mappable, you MUST specify a queue instance that should be used to perform a buffer->buffer * copy op. The queue MUST support transfer ops. @@ -228,8 +261,8 @@ namespace Anvil Anvil::Queue* in_opt_queue_ptr = nullptr); bool write(VkDeviceSize in_start_offset, VkDeviceSize in_size, - const Anvil::PhysicalDevice* in_physical_device_ptr, const void* in_data, + uint32_t in_device_mask, Anvil::Queue* in_opt_queue_ptr = nullptr); private: @@ -237,16 +270,18 @@ namespace Anvil Buffer(Anvil::BufferCreateInfoUniquePtr in_create_info_ptr); - bool init (); - bool set_memory_sparse(MemoryBlock* in_memory_block_ptr, - bool in_memory_block_owned_by_buffer, - VkDeviceSize in_memory_start_offset, - VkDeviceSize in_start_offset, - VkDeviceSize in_size); + bool init (); + bool init_staging_buffer(const VkDeviceSize& in_size, + Anvil::Queue* in_opt_queue_ptr); + bool set_memory_sparse (MemoryBlock* in_memory_block_ptr, + bool in_memory_block_owned_by_buffer, + VkDeviceSize in_memory_start_offset, + VkDeviceSize in_start_offset, + VkDeviceSize in_size); - bool set_memory_nonsparse_internal(MemoryBlockUniquePtr in_memory_block_ptr, - uint32_t in_n_physical_devices, - const Anvil::PhysicalDevice* in_physical_devices_ptr); + bool set_memory_nonsparse_internal(MemoryBlockUniquePtr in_memory_block_ptr, + uint32_t in_n_device_group_indices, + const uint32_t* in_device_group_indices_ptr); /* Private members */ VkBuffer m_buffer; @@ -255,6 +290,8 @@ namespace Anvil Anvil::MemoryBlock* m_memory_block_ptr; // only used by non-sparse buffers std::unique_ptr m_page_tracker_ptr; // only used by sparse buffers + Anvil::BufferUniquePtr m_staging_buffer_ptr; + Anvil::Queue* m_staging_buffer_queue_ptr; VkBufferCreateFlagsVariable(m_create_flags); diff --git a/include/wrappers/command_buffer.h b/include/wrappers/command_buffer.h index 5ea2cfaa..8abdca6c 100644 --- a/include/wrappers/command_buffer.h +++ b/include/wrappers/command_buffer.h @@ -80,6 +80,7 @@ namespace Anvil COMMAND_TYPE_DEBUG_MARKER_END_EXT, COMMAND_TYPE_DEBUG_MARKER_INSERT_EXT, COMMAND_TYPE_DISPATCH, + COMMAND_TYPE_DISPATCH_BASE_KHR, COMMAND_TYPE_DISPATCH_INDIRECT, COMMAND_TYPE_DRAW, COMMAND_TYPE_DRAW_INDEXED, @@ -102,6 +103,7 @@ namespace Anvil COMMAND_TYPE_SET_BLEND_CONSTANTS, COMMAND_TYPE_SET_DEPTH_BIAS, COMMAND_TYPE_SET_DEPTH_BOUNDS, + COMMAND_TYPE_SET_DEVICE_MASK_KHR, COMMAND_TYPE_SET_EVENT, COMMAND_TYPE_SET_LINE_WIDTH, COMMAND_TYPE_SET_SCISSOR, @@ -112,7 +114,6 @@ namespace Anvil COMMAND_TYPE_UPDATE_BUFFER, COMMAND_TYPE_WAIT_EVENTS, COMMAND_TYPE_WRITE_TIMESTAMP, - } CommandType; /** Base structure for a Vulkan command. @@ -164,11 +165,12 @@ namespace Anvil */ typedef struct BeginRenderPassCommand : public Command { - std::vector clear_values; - VkSubpassContents contents; - Anvil::Framebuffer* fbo_ptr; - VkRect2D render_area; - Anvil::RenderPass* render_pass_ptr; + std::vector clear_values; + VkSubpassContents contents; + Anvil::Framebuffer* fbo_ptr; + std::vector physical_devices; + std::vector render_areas; + Anvil::RenderPass* render_pass_ptr; /** Constructor. * @@ -176,12 +178,14 @@ namespace Anvil * * Arguments as per Vulkan API. **/ - explicit BeginRenderPassCommand(uint32_t in_n_clear_values, - const VkClearValue* in_clear_value_ptrs, - Anvil::Framebuffer* in_fbo_ptr, - const VkRect2D& in_render_area, - Anvil::RenderPass* in_render_pass_ptr, - VkSubpassContents in_contents); + explicit BeginRenderPassCommand(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + uint32_t in_n_physical_devices, + const Anvil::PhysicalDevice* const* in_physical_devices, + const VkRect2D* in_render_areas, + Anvil::RenderPass* in_render_pass_ptr, + VkSubpassContents in_contents); /** Destructor. * @@ -197,7 +201,7 @@ namespace Anvil BeginRenderPassCommand (const BeginRenderPassCommand&); BeginRenderPassCommand& operator=(const BeginRenderPassCommand&); } BeginRenderPassCommand; - + /* Structure passed as a COMMAND_BUFFER_CALLBACK_ID_BEGIN_RENDER_PASS_COMMAND_RECORDED call-back argument */ typedef struct BeginRenderPassCommandRecordedCallbackData { @@ -212,7 +216,7 @@ namespace Anvil explicit BeginRenderPassCommandRecordedCallbackData(CommandBufferBase* in_command_buffer_ptr, const BeginRenderPassCommand* in_command_details_ptr) :command_buffer_ptr (in_command_buffer_ptr), - command_details_ptr(in_command_details_ptr) + command_details_ptr(in_command_details_ptr) { /* Stub */ } @@ -244,7 +248,7 @@ namespace Anvil explicit EndRenderPassCommandRecordedCallbackData(CommandBufferBase* in_command_buffer_ptr, const EndRenderPassCommand* in_command_details_ptr) :command_buffer_ptr (in_command_buffer_ptr), - command_details_ptr(in_command_details_ptr) + command_details_ptr(in_command_details_ptr) { /* Stub */ } @@ -445,9 +449,9 @@ namespace Anvil * @return true if successful, false otherwise. **/ bool record_blit_image(Anvil::Image* in_src_image_ptr, - VkImageLayout in_src_image_layout, + Anvil::ImageLayout in_src_image_layout, Anvil::Image* in_dst_image_ptr, - VkImageLayout in_dst_image_layout, + Anvil::ImageLayout in_dst_image_layout, uint32_t in_region_count, const VkImageBlit* in_region_ptrs, VkFilter in_filter); @@ -492,7 +496,7 @@ namespace Anvil * @return true if successful, false otherwise. **/ bool record_clear_color_image(Anvil::Image* in_image_ptr, - VkImageLayout in_image_layout, + Anvil::ImageLayout in_image_layout, const VkClearColorValue* in_color_ptr, uint32_t in_range_count, const VkImageSubresourceRange* in_range_ptrs); @@ -515,7 +519,7 @@ namespace Anvil * @return true if successful, false otherwise. **/ bool record_clear_depth_stencil_image(Anvil::Image* in_image_ptr, - VkImageLayout in_image_layout, + Anvil::ImageLayout in_image_layout, const VkClearDepthStencilValue* in_depth_stencil_ptr, uint32_t in_range_count, const VkImageSubresourceRange* in_range_ptrs); @@ -561,7 +565,7 @@ namespace Anvil **/ bool record_copy_buffer_to_image(Anvil::Buffer* in_src_buffer_ptr, Anvil::Image* in_dst_image_ptr, - VkImageLayout in_dst_image_layout, + Anvil::ImageLayout in_dst_image_layout, uint32_t in_region_count, const VkBufferImageCopy* in_region_ptrs); @@ -583,9 +587,9 @@ namespace Anvil * @return true if successful, false otherwise. **/ bool record_copy_image(Anvil::Image* in_src_image_ptr, - VkImageLayout in_src_image_layout, + Anvil::ImageLayout in_src_image_layout, Anvil::Image* in_dst_image_ptr, - VkImageLayout in_dst_image_layout, + Anvil::ImageLayout in_dst_image_layout, uint32_t in_region_count, const VkImageCopy* in_region_ptrs); @@ -607,7 +611,7 @@ namespace Anvil * @return true if successful, false otherwise. **/ bool record_copy_image_to_buffer(Anvil::Image* in_src_image_ptr, - VkImageLayout in_src_image_layout, + Anvil::ImageLayout in_src_image_layout, Anvil::Buffer* in_dst_buffer_ptr, uint32_t in_region_count, const VkBufferImageCopy* in_region_ptrs); @@ -696,6 +700,29 @@ namespace Anvil uint32_t in_y, uint32_t in_z); + /** Issues a vkCmdDispatchBaseKHR() call and appends it to the internal vector of commands + * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS + * #define enabled). + * + * Calling this function for a command buffer which has not been put into a recording mode + * (by issuing a start_recording() call earlier) will result in an assertion failure. + * + * It is also illegal to call this function when recording renderpass commands. Doing so + * will also result in an assertion failure. + * + * This function can only be called for command buffers created for a mGPU device. + * + * Argument meaning is as per Vulkan API specification. + * + * @return true if successful, false otherwise. + **/ + bool record_dispatch_base_KHR(uint32_t in_base_group_x, + uint32_t in_base_group_y, + uint32_t in_base_group_z, + uint32_t in_group_count_x, + uint32_t in_group_count_y, + uint32_t in_group_count_z); + /** Issues a vkCmdDispatchIndirect() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS * #define enabled). @@ -803,7 +830,7 @@ namespace Anvil VkDeviceSize in_count_offset, uint32_t in_max_draw_count, uint32_t in_stride); - + /** Issues a vkCmdDrawIndexedIndirectCountKHR() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS * #define enabled). @@ -1040,12 +1067,13 @@ namespace Anvil * @return true if successful, false otherwise. **/ bool record_resolve_image(Anvil::Image* in_src_image_ptr, - VkImageLayout in_src_image_layout, + Anvil::ImageLayout in_src_image_layout, Anvil::Image* in_dst_image_ptr, - VkImageLayout in_dst_image_layout, + Anvil::ImageLayout in_dst_image_layout, uint32_t in_region_count, const VkImageResolve* in_region_ptrs); + /** Issues a vkCmdSetBlendConstants() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS * #define enabled). @@ -1088,6 +1116,21 @@ namespace Anvil bool record_set_depth_bounds(float in_min_depth_bounds, float in_max_depth_bounds); + /** Issues a vkCmdSetDeviceMaskKHR() call and appends it to the internal vector of commands + * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS + * #define enabled). + * + * Calling this function for a command buffer which has not been put into a recording mode + * (by issuing a start_recording() call earlier) will result in an assertion failure. + * + * This function can only be called for command buffers created for a mGPU device. + * + * Argument meaning is as per Vulkan API specification. + * + * @return true if successful, false otherwise. + **/ + bool record_set_device_mask_KHR(uint32_t in_device_mask); + /** Issues a vkCmdSetEvent() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS * #define enabled). @@ -1473,21 +1516,21 @@ namespace Anvil /** Holds all arguments passed to a vkCmdBlitImage() command. */ typedef struct BlitImageCommand : public Command { - VkImage dst_image; - VkImageLayout dst_image_layout; - Anvil::Image* dst_image_ptr; - VkImage src_image; - VkImageLayout src_image_layout; - Anvil::Image* src_image_ptr; + VkImage dst_image; + Anvil::ImageLayout dst_image_layout; + Anvil::Image* dst_image_ptr; + VkImage src_image; + Anvil::ImageLayout src_image_layout; + Anvil::Image* src_image_ptr; VkFilter filter; std::vector regions; /** Constructor. */ explicit BlitImageCommand(Anvil::Image* in_src_image_ptr, - VkImageLayout in_src_image_layout, + Anvil::ImageLayout in_src_image_layout, Anvil::Image* in_dst_image_ptr, - VkImageLayout in_dst_image_layout, + Anvil::ImageLayout in_dst_image_layout, uint32_t in_region_count, const VkImageBlit* in_region_ptrs, VkFilter in_filter); @@ -1506,15 +1549,15 @@ namespace Anvil /* Holds a single attachment definition, as used by ClearAttachmentsCommand descriptor */ typedef struct ClearAttachmentsCommandAttachment { - VkImageAspectFlagsVariable(aspect_mask); + Anvil::ImageAspectFlags aspect_mask; VkClearValue clear_value; uint32_t color_attachment; /** Constructor. **/ - ClearAttachmentsCommandAttachment(VkImageAspectFlags in_aspect_mask, - VkClearValue in_clear_value, - uint32_t in_color_attachment) + ClearAttachmentsCommandAttachment(Anvil::ImageAspectFlags in_aspect_mask, + VkClearValue in_clear_value, + uint32_t in_color_attachment) { aspect_mask = in_aspect_mask; clear_value = in_clear_value; @@ -1553,13 +1596,13 @@ namespace Anvil { VkClearColorValue color; VkImage image; - VkImageLayout image_layout; + Anvil::ImageLayout image_layout; Anvil::Image* image_ptr; std::vector ranges; /** Constructor. **/ explicit ClearColorImageCommand(Anvil::Image* in_image_ptr, - VkImageLayout in_image_layout, + Anvil::ImageLayout in_image_layout, const VkClearColorValue* in_color_ptr, uint32_t in_range_count, const VkImageSubresourceRange* in_range_ptrs); @@ -1580,13 +1623,13 @@ namespace Anvil { VkClearDepthStencilValue depth_stencil; VkImage image; - VkImageLayout image_layout; + Anvil::ImageLayout image_layout; Anvil::Image* image_ptr; std::vector ranges; /** Constructor. **/ explicit ClearDepthStencilImageCommand(Anvil::Image* in_image_ptr, - VkImageLayout in_image_layout, + Anvil::ImageLayout in_image_layout, const VkClearDepthStencilValue* in_depth_stencil_ptr, uint32_t in_range_count, const VkImageSubresourceRange* in_range_ptrs); @@ -1631,7 +1674,7 @@ namespace Anvil typedef struct CopyBufferToImageCommand : public Command { VkImage dst_image; - VkImageLayout dst_image_layout; + Anvil::ImageLayout dst_image_layout; Anvil::Image* dst_image_ptr; std::vector regions; VkBuffer src_buffer; @@ -1640,7 +1683,7 @@ namespace Anvil /** Constructor. **/ explicit CopyBufferToImageCommand(Anvil::Buffer* in_src_buffer_ptr, Anvil::Image* in_dst_image_ptr, - VkImageLayout in_dst_image_layout, + Anvil::ImageLayout in_dst_image_layout, uint32_t in_region_count, const VkBufferImageCopy* in_region_ptrs); @@ -1661,17 +1704,17 @@ namespace Anvil { VkImage dst_image; Anvil::Image* dst_image_ptr; - VkImageLayout dst_image_layout; + Anvil::ImageLayout dst_image_layout; std::vector regions; VkImage src_image; Anvil::Image* src_image_ptr; - VkImageLayout src_image_layout; + Anvil::ImageLayout src_image_layout; /** Constructor. **/ explicit CopyImageCommand(Anvil::Image* in_src_image_ptr, - VkImageLayout in_src_image_layout, + Anvil::ImageLayout in_src_image_layout, Anvil::Image* in_dst_image_ptr, - VkImageLayout in_dst_image_layout, + Anvil::ImageLayout in_dst_image_layout, uint32_t in_region_count, const VkImageCopy* in_region_ptrs); @@ -1693,12 +1736,12 @@ namespace Anvil Anvil::Buffer* dst_buffer_ptr; std::vector regions; VkImage src_image; - VkImageLayout src_image_layout; + Anvil::ImageLayout src_image_layout; Anvil::Image* src_image_ptr; /** Constructor. **/ explicit CopyImageToBufferCommand(Anvil::Image* in_src_image_ptr, - VkImageLayout in_src_image_layout, + Anvil::ImageLayout in_src_image_layout, Anvil::Buffer* in_dst_buffer_ptr, uint32_t in_region_count, const VkBufferImageCopy* in_region_ptrs); @@ -1746,7 +1789,6 @@ namespace Anvil CopyQueryPoolResultsCommand& operator=(const CopyQueryPoolResultsCommand&); } CopyQueryPoolResultsCommand; - /** Holds all arguments passed to a vkCmdDebugMarkerBeginEXT() command. */ typedef struct DebugMarkerBeginEXTCommand : public Command { @@ -1812,6 +1854,33 @@ namespace Anvil } } DispatchCommand; + + /** Holds all arguments passed to a vkCmdDispatchBaseKHR() command. */ + typedef struct DispatchBaseKHRCommand : public Command + { + uint32_t base_group_x; + uint32_t base_group_y; + uint32_t base_group_z; + uint32_t group_count_x; + uint32_t group_count_y; + uint32_t group_count_z; + + /** Constructor. **/ + explicit DispatchBaseKHRCommand(uint32_t in_base_group_x, + uint32_t in_base_group_y, + uint32_t in_base_group_z, + uint32_t in_group_count_x, + uint32_t in_group_count_y, + uint32_t in_group_count_z); + + /** Destructor. */ + virtual ~DispatchBaseKHRCommand() + { + /* Stub */ + } + } DispatchBaseKHRCommand; + + /** Holds all arguments passed to a vkCmdDispatchIndirect() command. */ typedef struct DispatchIndirectCommand : public Command { @@ -2158,7 +2227,6 @@ namespace Anvil } } PushConstantsCommand; - /** Holds all arguments passed to a vkCmdResetEvent() command. **/ typedef struct ResetEventCommand : public Command { @@ -2207,17 +2275,17 @@ namespace Anvil { VkImage dst_image; Anvil::Image* dst_image_ptr; - VkImageLayout dst_image_layout; + Anvil::ImageLayout dst_image_layout; std::vector regions; VkImage src_image; Anvil::Image* src_image_ptr; - VkImageLayout src_image_layout; + Anvil::ImageLayout src_image_layout; /** Constructor. **/ explicit ResolveImageCommand(Anvil::Image* in_src_image_ptr, - VkImageLayout in_src_image_layout, + Anvil::ImageLayout in_src_image_layout, Anvil::Image* in_dst_image_ptr, - VkImageLayout in_dst_image_layout, + Anvil::ImageLayout in_dst_image_layout, uint32_t in_region_count, const VkImageResolve* in_region_ptrs); @@ -2284,6 +2352,21 @@ namespace Anvil } } SetDepthBoundsCommand; + /** Holds all arguments passed to a vkCmdSetDeviceMaskKHR() command. **/ + typedef struct SetDeviceMaskKHRCommand : public Command + { + uint32_t device_mask; + + /** Constructor. **/ + SetDeviceMaskKHRCommand(uint32_t in_device_mask); + + /** Destructor. */ + virtual ~SetDeviceMaskKHRCommand() + { + /* Stub */ + } + } SetDeviceMaskKHRCommand; + /** Holds all arguments passed to a vkCmdSetEvent() command. **/ typedef struct SetEventCommand : public Command { @@ -2442,7 +2525,6 @@ namespace Anvil UpdateBufferCommand& operator=(const UpdateBufferCommand&); } UpdateBufferCommand; - /** Holds all arguments passed to a vkCmdWaitEvents() command. **/ typedef struct WaitEventsCommand : public Command { @@ -2521,10 +2603,12 @@ namespace Anvil #endif VkCommandBuffer m_command_buffer; + uint32_t m_device_mask; const Anvil::BaseDevice* m_device_ptr; bool m_is_renderpass_active; Anvil::CommandPool* m_parent_command_pool_ptr; bool m_recording_in_progress; + uint32_t m_renderpass_device_mask; CommandBufferType m_type; static bool m_command_stashing_disabled; @@ -2563,6 +2647,10 @@ namespace Anvil * Any Vulkan object wrapper instances passed to this function are going to be retained, * and will be released when the command buffer is released or resetted. * + * This function prototype can be called for both single- and multi-GPU devices. In the latter case, + * it will be assumed that all physical devices within the device group should be used for + * the device mask and that they all should use the same render area. + * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -2574,6 +2662,22 @@ namespace Anvil Anvil::RenderPass* in_render_pass_ptr, VkSubpassContents in_contents); + /** See documentation for the other record_begin_render_pass() function prototype for general + * information about this function. + * + * This prototype can only be used for multi-GPU devices. + * + * TODO + */ + bool record_begin_render_pass(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + uint32_t in_n_physical_devices, + const Anvil::PhysicalDevice* const* in_physical_devices, + const VkRect2D* in_render_areas, + Anvil::RenderPass* in_render_pass_ptr, + VkSubpassContents in_contents); + /** Issues a vkCmdEndRenderPass() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS * #define enabled). @@ -2622,17 +2726,22 @@ namespace Anvil * * It is an error to invoke this function if recording is already in progress. * + * The prototype without the @param in_device_mask argument can be used for both sGPU and mGPU devices. + * In the latter case, all physical devices assigned to the logical device will be used for the device + * mask. + * * @param in_one_time_submit true if the VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT flag should * be used for the Vulkan API call. * @param in_simultaneous_use_allowed true if the VK_CMD_BUFFER_OPTIMIZE_NO_SIMULTANEOUS_USE_BIT flag should * be used for the Vulkan API call. - * @param in_n_physical_devices Number of physical devices specified under @param in_physical_devices_ptr - * @param in_physical_devices_ptr Physical devices to allow for usage for the command buffer. Must not be nullptr. + * @param in_opt_device_mask Indices of physical devices to allow for usage for the command buffer. Must not be 0. + * This is only used with mGPU devices. * * @return true if successful, false otherwise. **/ - bool start_recording(bool in_one_time_submit, - bool in_simultaneous_use_allowed); + bool start_recording(bool in_one_time_submit, + bool in_simultaneous_use_allowed, + uint32_t in_opt_device_mask = UINT32_MAX); protected: /** Constructor. Should be used to instantiate primary-level command buffers. @@ -2693,7 +2802,8 @@ namespace Anvil SubPassID in_subpass_id, OcclusionQuerySupportScope in_required_occlusion_query_support_scope, bool in_occlusion_query_used_by_primary_command_buffer, - VkQueryPipelineStatisticFlags in_required_pipeline_statistics_scope); + VkQueryPipelineStatisticFlags in_required_pipeline_statistics_scope, + uint32_t in_opt_device_mask = UINT32_MAX); /* Destructor */ virtual ~SecondaryCommandBuffer() diff --git a/include/wrappers/descriptor_set.h b/include/wrappers/descriptor_set.h index 98050792..93c9265e 100644 --- a/include/wrappers/descriptor_set.h +++ b/include/wrappers/descriptor_set.h @@ -200,9 +200,9 @@ namespace Anvil **/ typedef struct CombinedImageSamplerBindingElement { - VkImageLayout image_layout; - Anvil::ImageView* image_view_ptr; - Anvil::Sampler* sampler_ptr; + Anvil::ImageLayout image_layout; + Anvil::ImageView* image_view_ptr; + Anvil::Sampler* sampler_ptr; /** Constructor. * @@ -212,9 +212,9 @@ namespace Anvil * it will be assumed the element corresponds to an immutable * sampler. **/ - CombinedImageSamplerBindingElement(VkImageLayout in_image_layout, - Anvil::ImageView* in_image_view_ptr, - Anvil::Sampler* in_sampler_ptr); + CombinedImageSamplerBindingElement(Anvil::ImageLayout in_image_layout, + Anvil::ImageView* in_image_view_ptr, + Anvil::Sampler* in_sampler_ptr); /** Destructor. * @@ -241,15 +241,15 @@ namespace Anvil /** Holds a single image view, along with other metadata required bound it to a specific descriptor set slot */ typedef struct ImageBindingElement { - VkImageLayout image_layout; - Anvil::ImageView* image_view_ptr; + Anvil::ImageLayout image_layout; + Anvil::ImageView* image_view_ptr; /** Constructor. * * @param in_image_layout Image layout to use for the binding. * @param in_image_view_ptr Image view to use for the binding. Must not be nullptr. **/ - ImageBindingElement(VkImageLayout in_image_layout, + ImageBindingElement(Anvil::ImageLayout in_image_layout, Anvil::ImageView* in_image_view_ptr); /** Copy assignment operator. @@ -278,8 +278,8 @@ namespace Anvil { InputAttachmentBindingElement() = delete; - InputAttachmentBindingElement(VkImageLayout in_image_layout, - Anvil::ImageView* in_image_view_ptr) + InputAttachmentBindingElement(Anvil::ImageLayout in_image_layout, + Anvil::ImageView* in_image_view_ptr) :ImageBindingElement(in_image_layout, in_image_view_ptr) { @@ -299,8 +299,8 @@ namespace Anvil { SampledImageBindingElement() = delete; - SampledImageBindingElement(VkImageLayout in_image_layout, - Anvil::ImageView* in_image_view_ptr) + SampledImageBindingElement(Anvil::ImageLayout in_image_layout, + Anvil::ImageView* in_image_view_ptr) :ImageBindingElement(in_image_layout, in_image_view_ptr) { @@ -320,8 +320,8 @@ namespace Anvil { StorageImageBindingElement() = delete; - StorageImageBindingElement(VkImageLayout in_image_layout, - Anvil::ImageView* in_image_view_ptr) + StorageImageBindingElement(Anvil::ImageLayout in_image_layout, + Anvil::ImageView* in_image_view_ptr) :ImageBindingElement(in_image_layout, in_image_view_ptr) { @@ -460,11 +460,11 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool get_combined_image_sampler_binding_properties(uint32_t in_n_binding, - uint32_t in_n_binding_array_item, - VkImageLayout* out_opt_image_layout_ptr, - Anvil::ImageView** out_opt_image_view_ptr_ptr, - Anvil::Sampler** out_opt_sampler_ptr_ptr); + bool get_combined_image_sampler_binding_properties(uint32_t in_n_binding, + uint32_t in_n_binding_array_item, + Anvil::ImageLayout* out_opt_image_layout_ptr, + Anvil::ImageView** out_opt_image_view_ptr_ptr, + Anvil::Sampler** out_opt_sampler_ptr_ptr); /** Retrieves raw Vulkan handle of the encapsulated descriptor set. * @@ -503,10 +503,10 @@ namespace Anvil * @return true if successful, false otherwise. * */ - bool get_input_attachment_binding_properties(uint32_t in_n_binding, - uint32_t in_n_binding_array_item, - VkImageLayout* out_opt_image_layout_ptr_ptr, - Anvil::ImageView** out_opt_image_view_ptr_ptr) const; + bool get_input_attachment_binding_properties(uint32_t in_n_binding, + uint32_t in_n_binding_array_item, + Anvil::ImageLayout* out_opt_image_layout_ptr_ptr, + Anvil::ImageView** out_opt_image_view_ptr_ptr) const; /** Returns properties of a sampled image descriptor binding. * @@ -519,10 +519,10 @@ namespace Anvil * * @return true if successful, false otherwise. */ - bool get_sampled_image_binding_properties(uint32_t in_n_binding, - uint32_t in_n_binding_array_item, - VkImageLayout* out_opt_image_layout_ptr, - Anvil::ImageView** out_opt_image_view_ptr_prt) const + bool get_sampled_image_binding_properties(uint32_t in_n_binding, + uint32_t in_n_binding_array_item, + Anvil::ImageLayout* out_opt_image_layout_ptr, + Anvil::ImageView** out_opt_image_view_ptr_prt) const { /* Re-use existing code */ return get_input_attachment_binding_properties(in_n_binding, @@ -575,10 +575,10 @@ namespace Anvil * * @return true if successful, false otherwise. */ - bool get_storage_image_binding_properties(uint32_t in_n_binding, - uint32_t in_n_binding_array_item, - VkImageLayout* out_opt_image_layout_ptr, - Anvil::ImageView** out_opt_image_view_ptr_ptr) const + bool get_storage_image_binding_properties(uint32_t in_n_binding, + uint32_t in_n_binding_array_item, + Anvil::ImageLayout* out_opt_image_layout_ptr, + Anvil::ImageView** out_opt_image_view_ptr_ptr) const { /* Re-use existing code */ return get_input_attachment_binding_properties(in_n_binding, @@ -756,7 +756,7 @@ namespace Anvil { Anvil::Buffer* buffer_ptr; Anvil::BufferView* buffer_view_ptr; - VkImageLayout image_layout; + Anvil::ImageLayout image_layout; Anvil::ImageView* image_view_ptr; Anvil::Sampler* sampler_ptr; VkDeviceSize size; @@ -829,7 +829,7 @@ namespace Anvil BindingItem() { dirty = false; - image_layout = VK_IMAGE_LAYOUT_MAX_ENUM; + image_layout = Anvil::ImageLayout::UNKNOWN; size = 0; start_offset = 0; diff --git a/include/wrappers/device.h b/include/wrappers/device.h index 0ed51a03..4d115510 100644 --- a/include/wrappers/device.h +++ b/include/wrappers/device.h @@ -165,6 +165,14 @@ namespace Anvil return m_khr_descriptor_update_template_extension_entrypoints; } + /** Returns a container with entry-points to functions introduced by VK_KHR_device_group extension. **/ + const ExtensionKHRDeviceGroupEntrypoints& get_extension_khr_device_group_entrypoints() const + { + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_device_group() ); + + return m_khr_device_group_extension_entrypoints; + } + /** Returns a container with entry-points to functions introduced by VK_KHR_draw_indirect_count extension. * * Will fire an assertion failure if the extension was not requested at device creation time. @@ -346,7 +354,7 @@ namespace Anvil virtual bool get_physical_device_fence_properties(const FencePropertiesQuery& in_query, Anvil::FenceProperties* out_opt_result_ptr = nullptr) const = 0; - virtual Anvil::FormatProperties get_physical_device_format_properties(VkFormat in_format) const = 0; + virtual Anvil::FormatProperties get_physical_device_format_properties(Anvil::Format in_format) const = 0; virtual bool get_physical_device_image_format_properties(const ImageFormatPropertiesQuery& in_query, Anvil::ImageFormatProperties* out_opt_result_ptr = nullptr) const = 0; @@ -382,11 +390,11 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - virtual bool get_physical_device_sparse_image_format_properties(VkFormat in_format, - VkImageType in_type, - VkSampleCountFlagBits in_sample_count, - VkImageUsageFlags in_usage, - VkImageTiling in_tiling, + virtual bool get_physical_device_sparse_image_format_properties(Anvil::Format in_format, + Anvil::ImageType in_type, + Anvil::SampleCountFlagBits in_sample_count, + ImageUsageFlags in_usage, + Anvil::ImageTiling in_tiling, std::vector& out_result) const = 0; @@ -474,7 +482,7 @@ namespace Anvil * * @return true if successful, false otherwise. */ - bool get_sample_locations(VkSampleCountFlagBits in_sample_count, + bool get_sample_locations(Anvil::SampleCountFlagBits in_sample_count, std::vector* out_result_ptr) const; /** Returns shader module cache instance */ @@ -627,7 +635,7 @@ namespace Anvil BaseDevice& operator=(const BaseDevice&); BaseDevice (const BaseDevice&); - /** Retrieves family indices of compute, DMA, graphics, and transfer queue families for the specified physical device. + /** Retrieves family indices of compute, DMA, graphics, transfer queue families for the specified physical device. * * @param in_physical_device_ptr Physical device to use for the query. * @param out_device_queue_family_info_ptr Deref will be used to store the result info. Must not be null. @@ -653,7 +661,7 @@ namespace Anvil std::vector > m_owned_queues; - std::map m_queue_family_index_to_type; + std::map > m_queue_family_index_to_types; std::map > m_queue_family_type_to_queue_family_indices; std::map > m_queue_ptrs_per_vk_queue_fam; @@ -665,6 +673,7 @@ namespace Anvil ExtensionEXTDebugMarkerEntrypoints m_ext_debug_marker_extension_entrypoints; ExtensionKHRBindMemory2Entrypoints m_khr_bind_memory2_extension_entrypoints; ExtensionKHRDescriptorUpdateTemplateEntrypoints m_khr_descriptor_update_template_extension_entrypoints; + ExtensionKHRDeviceGroupEntrypoints m_khr_device_group_extension_entrypoints; ExtensionKHRDrawIndirectCountEntrypoints m_khr_draw_indirect_count_extension_entrypoints; ExtensionKHRGetMemoryRequirements2Entrypoints m_khr_get_memory_requirements2_extension_entrypoints; ExtensionKHRMaintenance1Entrypoints m_khr_maintenance1_extension_entrypoints; @@ -685,15 +694,15 @@ namespace Anvil /* Private variables */ - std::unique_ptr m_compute_pipeline_manager_ptr; - DescriptorSetLayoutManagerUniquePtr m_descriptor_set_layout_manager_ptr; - Anvil::DescriptorSetGroupUniquePtr m_dummy_dsg_ptr; - std::unique_ptr > m_extension_enabled_info_ptr; - GraphicsPipelineManagerUniquePtr m_graphics_pipeline_manager_ptr; - const Anvil::Instance* m_parent_instance_ptr; - PipelineCacheUniquePtr m_pipeline_cache_ptr; - PipelineLayoutManagerUniquePtr m_pipeline_layout_manager_ptr; - Anvil::ShaderModuleCacheUniquePtr m_shader_module_cache_ptr; + std::unique_ptr m_compute_pipeline_manager_ptr; + DescriptorSetLayoutManagerUniquePtr m_descriptor_set_layout_manager_ptr; + Anvil::DescriptorSetGroupUniquePtr m_dummy_dsg_ptr; + std::unique_ptr > m_extension_enabled_info_ptr; + GraphicsPipelineManagerUniquePtr m_graphics_pipeline_manager_ptr; + const Anvil::Instance* m_parent_instance_ptr; + PipelineCacheUniquePtr m_pipeline_cache_ptr; + PipelineLayoutManagerUniquePtr m_pipeline_layout_manager_ptr; + Anvil::ShaderModuleCacheUniquePtr m_shader_module_cache_ptr; std::vector m_command_pool_ptr_per_vk_queue_fam; @@ -727,7 +736,7 @@ namespace Anvil * * @return A new Device instance. **/ - static SGPUDeviceUniquePtr create(const Anvil::PhysicalDevice* in_physical_device_ptr, + static BaseDeviceUniquePtr create(const Anvil::PhysicalDevice* in_physical_device_ptr, bool in_enable_shader_module_cache, const DeviceExtensionConfiguration& in_extensions, const std::vector& in_layers, @@ -748,9 +757,9 @@ namespace Anvil **/ Anvil::SwapchainUniquePtr create_swapchain(Anvil::RenderingSurface* in_parent_surface_ptr, Anvil::Window* in_window_ptr, - VkFormat in_image_format, + Anvil::Format in_image_format, VkPresentModeKHR in_present_mode, - VkImageUsageFlags in_usage, + ImageUsageFlags in_usage, uint32_t in_n_swapchain_images); /** Retrieves a PhysicalDevice instance, from which this device instance was created. @@ -774,7 +783,7 @@ namespace Anvil bool get_physical_device_semaphore_properties(const SemaphorePropertiesQuery& in_query, Anvil::SemaphoreProperties* out_opt_result_ptr = nullptr) const override; - Anvil::FormatProperties get_physical_device_format_properties(VkFormat in_format) const override; + Anvil::FormatProperties get_physical_device_format_properties(Anvil::Format in_format) const override; bool get_physical_device_image_format_properties(const ImageFormatPropertiesQuery& in_query, Anvil::ImageFormatProperties* out_opt_result_ptr = nullptr) const override; @@ -789,11 +798,11 @@ namespace Anvil const QueueFamilyInfoItems& get_physical_device_queue_families() const override; /** See documentation in BaseDevice for more details */ - bool get_physical_device_sparse_image_format_properties(VkFormat in_format, - VkImageType in_type, - VkSampleCountFlagBits in_sample_count, - VkImageUsageFlags in_usage, - VkImageTiling in_tiling, + bool get_physical_device_sparse_image_format_properties(Anvil::Format in_format, + Anvil::ImageType in_type, + Anvil::SampleCountFlagBits in_sample_count, + ImageUsageFlags in_usage, + Anvil::ImageTiling in_tiling, std::vector& out_result) const override; /** See documentation in BaseDevice for more details */ @@ -833,6 +842,189 @@ namespace Anvil const Anvil::PhysicalDevice* m_parent_physical_device_ptr; }; + /* TODO */ + class MGPUDevice : public BaseDevice + { + public: + /* Public functions */ + + virtual ~MGPUDevice(); + + /** TODO */ + static Anvil::BaseDeviceUniquePtr create(std::vector in_physical_device_ptrs, + bool in_enable_shader_module_cache, + const DeviceExtensionConfiguration& in_extensions, + const std::vector& in_layers, + bool in_transient_command_buffer_allocs_only, + bool in_support_resettable_command_buffer_allocs, + bool in_mt_safe = false); + + /** TODO */ + Anvil::SwapchainUniquePtr create_swapchain(Anvil::RenderingSurface* in_parent_surface_ptr, + Anvil::Window* in_window_ptr, + Anvil::Format in_image_format, + VkPresentModeKHR in_present_mode, + ImageUsageFlags in_usage, + uint32_t in_n_swapchain_images, + bool in_support_SFR, + VkDeviceGroupPresentModeFlagsKHR in_presentation_modes_to_support = VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR); + + /** TODO + * + * This function does NOT call the driver to retrieve the requested information. Instead, it returns + * information cached at mGPU device creation time. + */ + bool get_peer_memory_features(const Anvil::PhysicalDevice* in_local_physical_device_ptr, + const Anvil::PhysicalDevice* in_remote_physical_device_ptr, + uint32_t in_memory_heap_index, + PeerMemoryFeatureFlags* out_result_ptr) const; + + /** TODO */ + uint32_t get_n_physical_devices() const + { + return static_cast(m_parent_physical_devices.size() ); + } + + /** TODO */ + const Anvil::PhysicalDevice* get_physical_device(uint32_t in_n_physical_device) const; + + bool get_physical_device_buffer_properties(const BufferPropertiesQuery& in_query, + Anvil::BufferProperties* out_opt_result_ptr = nullptr) const override; + + /** TODO */ + const Anvil::PhysicalDevice* const* get_physical_devices() const + { + return &m_parent_physical_devices_vec.at(0); + } + + /** TODO */ + const Anvil::PhysicalDeviceFeatures& get_physical_device_features() const override; + + bool get_physical_device_fence_properties(const FencePropertiesQuery& in_query, + Anvil::FenceProperties* out_opt_result_ptr = nullptr) const override; + + Anvil::FormatProperties get_physical_device_format_properties(Anvil::Format in_format) const override; + + bool get_physical_device_image_format_properties(const ImageFormatPropertiesQuery& in_query, + Anvil::ImageFormatProperties* out_opt_result_ptr = nullptr) const override; + + /** TODO */ + const Anvil::MemoryProperties& get_physical_device_memory_properties() const override; + + /** TODO */ + const Anvil::PhysicalDeviceProperties& get_physical_device_properties() const override; + + /** TODO */ + const QueueFamilyInfoItems& get_physical_device_queue_families() const override; + + bool get_physical_device_semaphore_properties(const SemaphorePropertiesQuery& in_query, + Anvil::SemaphoreProperties* out_opt_result_ptr = nullptr) const; + + /** TODO */ + bool get_physical_device_sparse_image_format_properties(Anvil::Format in_format, + Anvil::ImageType in_type, + Anvil::SampleCountFlagBits in_sample_count, + ImageUsageFlags in_usage, + Anvil::ImageTiling in_tiling, + std::vector& out_result) const override; + + /** TODO */ + bool get_physical_device_surface_capabilities(Anvil::RenderingSurface* in_surface_ptr, + VkSurfaceCapabilitiesKHR* out_result_ptr) const override; + + /** Tells which physical devices can be parent to swapchain images that a physical device at device index @param in_device_index + * can present. + * + * By VK_KHR_device_group, *out_result_ptr is guaranteed to at least refer to the device with index @param in_device_index, + * as long as the physical device has a presentation engine and can be used for presentation purposes. + * + * This function is not a part of Anvil::PhysicalDevice, because the spec does not guarantee this data to be invariant between + * device instances. In cases where the app creates a sGPU device and a mGPU device, where both share the same physical device, + * the former device could be incorrectly assumed to be compatible with physical devices from an external device group. + * + * @param in_device_index TODO + * @param out_result_ptr TODO. Must not be NULL. + * + * @return true if successful, false otherwise. + **/ + bool get_present_compatible_physical_devices(uint32_t in_device_index, + const std::vector** out_result_ptr) const; + + /** TODO + * + * Note: The value returned by this function is NOT guaranteed to be invariant. + **/ + bool get_present_rectangles(uint32_t in_device_index, + const Anvil::RenderingSurface* in_rendering_surface_ptr, + std::vector* out_result_ptr) const; + + /** TODO */ + const Anvil::QueueFamilyInfo* get_queue_family_info(uint32_t in_queue_family_index) const override; + + /** TODO */ + VkDeviceGroupPresentModeFlagsKHR get_supported_present_modes() const + { + return m_supported_present_modes; + } + + /** TODO + * + * Note: The value returned by this function is NOT guaranteed to be invariant. + * + */ + VkDeviceGroupPresentModeFlagsKHR get_supported_present_modes_for_surface(const Anvil::RenderingSurface* in_surface_ptr) const; + + /* Tells what type this device instance is */ + DeviceType get_type() const override + { + return DEVICE_TYPE_MULTI_GPU; + } + + /* Tells whether this logical device is a part of a device group which supports subset allocations. */ + bool supports_subset_allocations() const + { + return m_supports_subset_allocations; + } + + protected: + /* Protected functions */ + void create_device (const std::vector& in_extensions, + const std::vector& in_layers, + const VkPhysicalDeviceFeatures& in_features, + DeviceQueueFamilyInfo* out_queue_families_ptr) override; + void get_queue_family_indices (DeviceQueueFamilyInfo* out_device_queue_family_info_ptr) const; + void init_device () override; + bool is_layer_supported (const std::string& in_layer_name) const override; + bool is_physical_device_extension_supported(const std::string& in_extension_name) const override; + + private: + /* Private type definitions */ + + struct ParentPhysicalDeviceProperties + { + typedef uint32_t HeapIndex; + typedef std::map HeapIndexToPeerMemoryFeaturesMap; + typedef uint32_t RemotePhysicalDeviceGroupIndex; + + const Anvil::PhysicalDevice* physical_device_ptr; + std::vector presentation_compatible_physical_devices; /* may be empty if the physical device does not have a presentation engine! */ + std::map peer_memory_features; + }; + + /* Private functions */ + + /** Private constructor. Please use create() instead. */ + MGPUDevice(std::vector in_physical_device_ptrs, + bool in_mt_safe); + + /* Private variables */ + std::map m_device_index_to_physical_device_props; + std::vector m_parent_physical_devices; + std::vector m_parent_physical_devices_vec; + bool m_supports_subset_allocations; + + VkDeviceGroupPresentModeFlagBitsKHRVariable(m_supported_present_modes); + }; }; /* namespace Anvil */ #endif /* WRAPPERS_DEVICE_H */ diff --git a/include/wrappers/graphics_pipeline_manager.h b/include/wrappers/graphics_pipeline_manager.h index ad2f0616..3594ce49 100644 --- a/include/wrappers/graphics_pipeline_manager.h +++ b/include/wrappers/graphics_pipeline_manager.h @@ -66,6 +66,9 @@ * If VK_AMD_rasterization_order extension is supported, strict rasterization order is assumed * for the pipeline by default. * + * If VK_KHR_maintenance2 extension is supported, upper-left tessellation domain origin is assumed + * by default (as per spec). + * **/ #ifndef WRAPPERS_GRAPHICS_PIPELINE_MANAGER_H #define WRAPPERS_GRAPHICS_PIPELINE_MANAGER_H diff --git a/include/wrappers/image.h b/include/wrappers/image.h index 286b9650..329d628e 100644 --- a/include/wrappers/image.h +++ b/include/wrappers/image.h @@ -99,9 +99,9 @@ namespace Anvil */ void change_image_layout(Anvil::Queue* in_queue_ptr, VkAccessFlags in_src_access_mask, - VkImageLayout in_src_layout, + Anvil::ImageLayout in_src_layout, VkAccessFlags in_dst_access_mask, - VkImageLayout in_dst_layout, + Anvil::ImageLayout in_dst_layout, const VkImageSubresourceRange& in_subresource_range, const uint32_t in_opt_n_wait_semaphores = 0, const VkPipelineStageFlags* in_opt_wait_dst_stage_mask_ptrs = nullptr, @@ -120,10 +120,10 @@ namespace Anvil * NOTE: This information is cached at image creation time, so the driver's impl will not be * called. */ - bool get_aspect_subresource_layout(VkImageAspectFlags in_aspect, - uint32_t in_n_layer, - uint32_t in_n_mip, - VkSubresourceLayout* out_subresource_layout_ptr) const; + bool get_aspect_subresource_layout(Anvil::ImageAspectFlags in_aspect, + uint32_t in_n_layer, + uint32_t in_n_mip, + VkSubresourceLayout* out_subresource_layout_ptr) const; const Anvil::ImageCreateInfo* get_create_info_ptr() const { @@ -224,11 +224,23 @@ namespace Anvil return m_n_mipmaps; } + /** Returns SFR tile size for the image. + * + * Can only be called if the following requirements are met: + * + * 1. Parent device is a mGPU device instance. + * 2. Image has been initialized with the VK_IMAGE_CREATE_BIND_SFR_BIT_KHR flag. + * + * TODO. + * + */ + bool get_SFR_tile_size(VkExtent2D* out_result_ptr) const; + /** Returns a structure filled with details required to correctly bind tiles to a sparse image. * * This function can only be called against sparse images with ALIASED or NONALIASED residency. **/ - bool get_sparse_image_aspect_properties(const VkImageAspectFlagBits in_aspect, + bool get_sparse_image_aspect_properties(const Anvil::ImageAspectFlagBits in_aspect, const Anvil::SparseImageAspectProperties** out_result_ptr_ptr) const; /** Returns a filled subresource range descriptor, covering all layers & mipmaps of the image */ @@ -240,7 +252,7 @@ namespace Anvil * * @return true if data for all specified aspects is provided by the image, false otherwise. */ - bool has_aspects(VkImageAspectFlags in_aspects) const; + bool has_aspects(Anvil::ImageAspectFlags in_aspects) const; /** Tells whether a physical memory page is assigned to the specified texel location. * @@ -256,12 +268,12 @@ namespace Anvil * @return true if physical memory is bound to the specified location, false otherwise. * */ - bool is_memory_bound_for_texel(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_mip, - uint32_t in_x, - uint32_t in_y, - uint32_t in_z) const; + bool is_memory_bound_for_texel(Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_mip, + uint32_t in_x, + uint32_t in_y, + uint32_t in_z) const; bool prefers_dedicated_allocation() const { @@ -276,6 +288,14 @@ namespace Anvil /** Binds the specified region of a Vulkan memory object to an Image and caches information * about the new binding. * + * NOTE: This function can be used for both single- and multi-GPU devices. In case of the latter: + * 1. The image must NOT have been created for a particular swapchain instance. + * 2. The image must NOT be sparse. + * 3. If @param in_memory_block_ptr uses memory taken from a heap without VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR + * flag, each physical device attaches to its own instance of the memory. + * 4. If @param in_memory_block_ptr uses memory taken from a heap WITH the flag, each physical device attaches + * to memory instance 0. + * * NOTE: If used against sparse images, the assigned memory block's size must EXACTLY match * the amount of memory required by the image. Otherwise, the function will fail. * @@ -289,6 +309,67 @@ namespace Anvil bool set_memory(MemoryBlockUniquePtr in_memory_block_ptr); bool set_memory(Anvil::MemoryBlock* in_memory_block_ptr); + /** Binds the image to instances of memory for physical devices specified by the caller. + * + * NOTE: This function must NOT be used for sparse images. + * NOTE: This function must NOT be used for images created for a single-GPU device. + * NOTE: This function can only be used for images, whose memory comes off a heap with the + * VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR flag. + * NOTE: It is illegal to change the memory backing, after one has been associated with an Image instance. + * + * TODO + **/ + bool set_memory(MemoryBlockUniquePtr in_memory_block_ptr, + uint32_t in_n_device_group_indices, + const uint32_t* in_device_group_indices_ptr); + bool set_memory(Anvil::MemoryBlock* in_memory_block_ptr, + uint32_t in_n_device_group_indices, + const uint32_t* in_device_group_indices_ptr); + + /** Binds the image to instances of memory, according to SFR rectangles specified by the caller. + * For more information, please read VK_KHR_device_group extension specification. + * + * NOTE: This function must NOT be used for sparse images. + * NOTE: This function must NOT be used for images created for a single-GPU device. + * NOTE: It is illegal to change the memory backing, after one has been associated with an Image instance. + * + * TODO + **/ + bool set_memory(MemoryBlockUniquePtr in_memory_block_ptr, + uint32_t in_n_SFR_rects, + const VkRect2D* in_SFRs_ptr); + bool set_memory(Anvil::MemoryBlock* in_memory_block_ptr, + uint32_t in_n_SFR_rects, + const VkRect2D* in_SFRs_ptr); + + /** See set_memory() for general documentation. + * + * This static function can be used to set up image memory bindings using SFR rectangles + * in a batched manner. + * + * Can only be used for multi-GPU devices. + * + * Requires VK_KHR_device_group to be supported by & enabled for the device. + * + * TODO + **/ + static bool set_memory_multi(uint32_t in_n_image_sfr_memory_binding_updates, + ImageSFRMemoryBindingUpdate* in_updates_ptr); + + /** See set_memory() for general documentation. + * + * This static function can be used to set up image memory bindings by specifying physical devices + * in a batched manner. + * + * Can only be used for multi-GPU devices. + * + * Requires VK_KHR_device_group to be supported by & enabled for the device. + * + * TODO + **/ + static bool set_memory_multi(uint32_t in_n_image_physical_device_memory_binding_updates, + ImagePhysicalDeviceMemoryBindingUpdate* in_updates_ptr); + /** Updates image with specified mip-map data. Blocks until the operation finishes executing. * * Handles both linear and optimal images. @@ -301,8 +382,8 @@ namespace Anvil * **/ void upload_mipmaps(const std::vector* in_mipmaps_ptr, - VkImageLayout in_current_image_layout, - VkImageLayout* out_new_image_layout_ptr); + Anvil::ImageLayout in_current_image_layout, + Anvil::ImageLayout* out_new_image_layout_ptr); private: /** Defines dimensions of a single image mip-map */ @@ -350,7 +431,7 @@ namespace Anvil uint32_t in_y, uint32_t in_z) const { - const uint32_t tile_x = in_x / tile_width; + const uint32_t tile_x = in_x / tile_width; const uint32_t tile_y = in_y / tile_height; const uint32_t tile_z = in_z / tile_depth; @@ -445,12 +526,31 @@ namespace Anvil Image(Anvil::ImageCreateInfoUniquePtr in_create_info_ptr); + bool do_sanity_checks_for_physical_device_binding(const Anvil::MemoryBlock* in_memory_block_ptr, + uint32_t in_n_physical_devices) const; + bool do_sanity_checks_for_sfr_binding (uint32_t in_n_SFR_rects, + const VkRect2D* in_SFRs_ptr) const; + bool init (); void init_mipmap_props (); void init_page_occupancy(const std::vector& in_memory_reqs); - - bool set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, - bool in_owned_by_image); + void init_sfr_tile_size (); + + bool set_memory_internal(uint32_t in_swapchain_image_index, + uint32_t in_opt_n_SFR_rects, + const VkRect2D* in_opt_SFRs_ptr, + uint32_t in_opt_n_device_indices, + const uint32_t* in_opt_device_indices); + bool set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, + bool in_owned_by_image); + bool set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, + bool in_owned_by_image, + uint32_t in_n_device_group_indices, + const uint32_t* in_device_group_indices_ptr); + bool set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, + bool in_owned_by_image, + uint32_t in_n_SFR_rects, + const VkRect2D* in_SFRs_ptr); void on_memory_backing_update (const VkImageSubresource& in_subresource, VkOffset3D in_offset, @@ -464,8 +564,8 @@ namespace Anvil VkDeviceSize in_memory_block_start_offset, bool in_memory_block_owned_by_image); - void transition_to_post_alloc_image_layout(VkAccessFlags in_src_access_mask, - VkImageLayout in_src_layout); + void transition_to_post_alloc_image_layout(VkAccessFlags in_src_access_mask, + Anvil::ImageLayout in_src_layout); /** TODO. * @@ -474,9 +574,9 @@ namespace Anvil static VkImageCreateInfo get_create_info_for_swapchain(const Anvil::Swapchain* in_swapchain_ptr); /* Private members */ - typedef std::pair LayerMipKey; - typedef std::map LayerMipToSubresourceLayoutMap; - typedef std::map AspectToLayerMipToSubresourceLayoutMap; + typedef std::pair LayerMipKey; + typedef std::map LayerMipToSubresourceLayoutMap; + typedef std::map AspectToLayerMipToSubresourceLayoutMap; VkDeviceSize m_alignment; AspectToLayerMipToSubresourceLayoutMap m_aspects; /* only used for linear images */ @@ -494,13 +594,17 @@ namespace Anvil bool m_prefers_dedicated_allocation; bool m_requires_dedicated_allocation; + std::vector m_peer_device_indices; + std::vector m_peer_sfr_rects; + VkExtent2D m_sfr_tile_size; + MemoryBlockUniquePtr m_metadata_memory_block_ptr; std::vector m_memory_blocks_owned; - std::unique_ptr m_page_tracker_ptr; /* only used for sparse non-resident images */ - std::map m_sparse_aspect_page_occupancy; - std::vector > m_sparse_aspect_page_occupancy_data_items_owned; - std::map m_sparse_aspect_props; + std::unique_ptr m_page_tracker_ptr; /* only used for sparse non-resident images */ + std::map m_sparse_aspect_page_occupancy; + std::vector > m_sparse_aspect_page_occupancy_data_items_owned; + std::map m_sparse_aspect_props; friend class Anvil::Queue; diff --git a/include/wrappers/instance.h b/include/wrappers/instance.h index fd990fc5..fdf79d12 100644 --- a/include/wrappers/instance.h +++ b/include/wrappers/instance.h @@ -123,12 +123,34 @@ namespace Anvil #endif #endif + /** Returns a container with entry-points to functions introduced by VK_KHR_device_group_creation extension. + * + * Will fire an assertion failure if the extension is not supported. + **/ + const ExtensionKHRDeviceGroupCreationEntrypoints& get_extension_khr_device_group_creation_entrypoints() const; + /** Returns a raw wrapped VkInstance handle. */ VkInstance get_instance_vk() const { return m_instance; } + /** Returns information about @param in_n_physical_device_group -th physical device group, as reported + * for this instance. + * + * @param in_n_physical_device_group Index of the physical device group to retrieve properties of. + * This value must NOT be equal or larger than the value reported by + * get_n_physical_device_groups(). + * + ** @return As per description. + **/ + const Anvil::PhysicalDeviceGroup& get_physical_device_group(uint32_t in_n_physical_device_group) const + { + anvil_assert(m_physical_device_groups.size() > in_n_physical_device_group); + + return m_physical_device_groups.at(in_n_physical_device_group); + } + /** Returns a PhysicalDevice wrapper for a physical device at index @param in_n_device. * * @param in_n_device Index of the physical device to retrieve the wrapper instance for. @@ -142,6 +164,15 @@ namespace Anvil return m_physical_devices.at(in_n_device).get(); } + /** Returns the total number of physical device groups supported on the running platform. + * + * Will return 0 if VK_KHR_physical_device_group_creation is not supported. + */ + uint32_t get_n_physical_device_groups() const + { + return static_cast(m_physical_device_groups.size() ); + } + /** Returns the total number of physical devices supported on the running platform. */ uint32_t get_n_physical_devices() const { @@ -184,13 +215,14 @@ namespace Anvil Instance& operator=(const Instance&); Instance (const Instance&); - void destroy (); - void enumerate_instance_layers (); - void enumerate_layer_extensions(Anvil::Layer* layer_ptr); - void enumerate_physical_devices(); - void init (const std::vector& in_disallowed_instance_level_extensions); - void init_debug_callbacks (); - void init_func_pointers (); + void destroy (); + void enumerate_instance_layers (); + void enumerate_layer_extensions (Anvil::Layer* layer_ptr); + void enumerate_physical_device_groups(); + void enumerate_physical_devices (); + void init (const std::vector& in_disallowed_instance_level_extensions); + void init_debug_callbacks (); + void init_func_pointers (); static VkBool32 VKAPI_PTR debug_callback_pfn_proc(VkDebugReportFlagsEXT in_message_flags, VkDebugReportObjectTypeEXT in_object_type, @@ -208,6 +240,7 @@ namespace Anvil VkDebugReportCallbackEXT m_debug_callback_data; ExtensionEXTDebugReportEntrypoints m_ext_debug_report_entrypoints; + ExtensionKHRDeviceGroupCreationEntrypoints m_khr_device_group_creation_entrypoints; ExtensionKHRExternalFenceCapabilitiesEntrypoints m_khr_external_fence_capabilities_entrypoints; ExtensionKHRExternalMemoryCapabilitiesEntrypoints m_khr_external_memory_capabilities_entrypoints; ExtensionKHRExternalSemaphoreCapabilitiesEntrypoints m_khr_external_semaphore_capabilities_entrypoints; @@ -232,6 +265,7 @@ namespace Anvil std::unique_ptr > m_supported_extensions_info_ptr; Anvil::Layer m_global_layer; + std::vector m_physical_device_groups; std::vector > m_physical_devices; std::vector m_supported_layers; diff --git a/include/wrappers/memory_block.h b/include/wrappers/memory_block.h index ec9d928e..f48cdd05 100644 --- a/include/wrappers/memory_block.h +++ b/include/wrappers/memory_block.h @@ -70,24 +70,8 @@ namespace Anvil * * Cached external memory handles will be destroyed & released at MemoryBlock's destruction time. * - * @param in_device_ptr Device to use. - * @param in_allowed_memory_bits Memory type bits which meet the allocation requirements. - * @param in_size Required allocation size. - * @param in_memory_features Required memory features. - * @param in_external_memory_handle_types If the memory block is going to be exported to another process or Vulkan instance, use - * this field to specify which handle types the allocation needs to support. Please see - * documentation of Anvil::ExternalMemoryHandleTypeFlags for more details. - **/ - static MemoryBlockUniquePtr create(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_allowed_memory_bits, - VkDeviceSize in_size, - Anvil::MemoryFeatureFlags in_memory_features, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); - - /** Create a memory block whose storage space is maintained by another MemoryBlock instance. - * - * Only supports REGULAR memory blocks. Derived memory blocks are NOT supported. + * Supports DERIVED and REGULAR memory blocks. The latter case is only supported if memory region covered by + * the derived region completely encapsulates the underlying Vulkan allocation. * * Returns nullptr if unsuccessful. * @@ -119,11 +103,6 @@ namespace Anvil } } - const uint32_t& get_memory_type_index() const - { - return m_memory_type_index; - } - const VkDeviceSize& get_start_offset() const { return m_start_offset; @@ -165,6 +144,13 @@ namespace Anvil * However, making that call in advance will skip map()+unmap() invocations, wnich would * otherwise have to be done for each read() call. * + * Note that reading from multi_instance memory heaps is not permitted by VK_KHR_device_group. + * Any attempt to do so will result in an assertion failure and an error being reported by + * this function. + * + * Since this function is device-agnostic, it doesn't matter if the parent device is a single- + * or a multi-GPU instance. + * * @param in_start_offset Start offset of the region to be mapped. * @param in_size Size of the region to be mapped. * @param out_result_ptr The read data will be copied to the location specified by this @@ -191,6 +177,13 @@ namespace Anvil * However, making that call in advance will skip map()+unmap() invocations, wnich would * otherwise have to be done for each write() call. * + * Note that writing to multi_instance memory heaps is not permitted by VK_KHR_device_group. + * Any attempt to do so will result in an assertion failure and an error being reported by + * this function. + * + * Since this function is device-agnostic, it doesn't matter if the parent device is a single- + * or a multi-GPU instance. + * * @param in_start_offset Start offset of the region to modify * @param in_size Size of the region to be modified. * @param in_data Data to be copied to the specified GPU memory region. @@ -248,9 +241,10 @@ namespace Anvil void* m_backend_object; Anvil::MemoryBlockCreateInfoUniquePtr m_create_info_ptr; VkDeviceMemory m_memory; - uint32_t m_memory_type_index; + const Anvil::MemoryType* m_memory_type_props_ptr; /* keep for simplified debugging */ VkDeviceSize m_start_offset; + std::vector m_mgpu_physical_devices; std::shared_ptr m_owned_parent_memory_allocator_backend_ptr; Anvil::IMemoryAllocatorBackendBase* m_parent_memory_allocator_backend_ptr; diff --git a/include/wrappers/physical_device.h b/include/wrappers/physical_device.h index 12a183bb..8957cd70 100644 --- a/include/wrappers/physical_device.h +++ b/include/wrappers/physical_device.h @@ -72,6 +72,18 @@ namespace Anvil return m_features; } + /** Retrieves device group index of this physical device. */ + uint32_t get_device_group_index() const + { + return m_device_group_index; + } + + /** Retrieves index of the physical device within a device group. */ + uint32_t get_device_group_device_index() const + { + return m_device_group_device_index; + } + const Anvil::PhysicalDeviceProperties& get_device_properties() const { return m_properties; @@ -85,7 +97,7 @@ namespace Anvil bool get_fence_properties(const Anvil::FencePropertiesQuery& in_query, Anvil::FenceProperties* out_opt_result_ptr = nullptr) const; - Anvil::FormatProperties get_format_properties(VkFormat in_format) const; + Anvil::FormatProperties get_format_properties(Anvil::Format in_format) const; /** Retrieves image format properties, as reported by the wrapped physical device. * @@ -165,11 +177,11 @@ namespace Anvil * * @return true if successful, false otherwise **/ - bool get_sparse_image_format_properties(VkFormat in_format, - VkImageType in_type, - VkSampleCountFlagBits in_sample_count, - VkImageUsageFlags in_usage, - VkImageTiling in_tiling, + bool get_sparse_image_format_properties(Anvil::Format in_format, + Anvil::ImageType in_type, + Anvil::SampleCountFlagBits in_sample_count, + Anvil::ImageUsageFlags in_usage, + Anvil::ImageTiling in_tiling, std::vector& out_result) const; /** Tells whether user-specified extension is supported by the physical device. @@ -204,9 +216,11 @@ namespace Anvil explicit PhysicalDevice(Anvil::Instance* in_instance_ptr, uint32_t in_index, VkPhysicalDevice in_physical_device) - :m_index (in_index), - m_instance_ptr (in_instance_ptr), - m_physical_device(in_physical_device) + :m_device_group_device_index(0), + m_device_group_index (0), + m_index (in_index), + m_instance_ptr (in_instance_ptr), + m_physical_device (in_physical_device) { anvil_assert(in_physical_device != VK_NULL_HANDLE); } @@ -214,10 +228,13 @@ namespace Anvil PhysicalDevice (const PhysicalDevice&); PhysicalDevice& operator=(const PhysicalDevice&); - bool init(); + bool init (); + void set_device_group_device_index(uint32_t in_new_device_group_device_index); + void set_device_group_index (uint32_t in_new_device_group_index); /* Private variables */ - FormatProperties m_dummy; + uint32_t m_device_group_device_index; + uint32_t m_device_group_index; std::unique_ptr > m_extension_info_ptr; uint32_t m_index; Anvil::Instance* m_instance_ptr; @@ -236,6 +253,7 @@ namespace Anvil std::unique_ptr m_ext_vertex_attribute_divisor_properties_ptr; std::unique_ptr m_khr_16_bit_storage_features_ptr; std::unique_ptr m_khr_external_memory_capabilities_physical_device_id_properties_ptr; + std::unique_ptr m_khr_maintenance2_physical_device_point_clipping_properties_ptr; std::unique_ptr m_khr_maintenance3_properties_ptr; friend class Anvil::Instance; diff --git a/include/wrappers/queue.h b/include/wrappers/queue.h index 2671542e..f1910bc7 100644 --- a/include/wrappers/queue.h +++ b/include/wrappers/queue.h @@ -38,6 +38,45 @@ namespace Anvil { + /** TODO */ + typedef struct LocalModePresentationItem + { + /* Tells which physical device's swapchain image at index @param in_swapchain_image_index should be presented. */ + const Anvil::PhysicalDevice* physical_device_ptr; + + uint32_t swapchain_image_index; + Anvil::Swapchain* swapchain_ptr; + + LocalModePresentationItem() + { + swapchain_image_index = ~0u; + swapchain_ptr = nullptr; + } + } LocalModePresentationItem; + + /** TODO */ + typedef struct SumModePresentationItem + { + uint32_t n_physical_devices; + const Anvil::PhysicalDevice* const* physical_devices_ptr; + uint32_t swapchain_image_index; + Anvil::Swapchain* swapchain_ptr; + + SumModePresentationItem() + { + n_physical_devices = ~0u; + physical_devices_ptr = nullptr; + swapchain_image_index = ~0u; + swapchain_ptr = nullptr; + } + } SumModePresentationItem; + + /** TODO */ + typedef SumModePresentationItem LocalMultiDeviceModePresentationItem; + + /** TODO */ + typedef LocalModePresentationItem RemoteModePresentationItem; + typedef enum { /* Notification fired right after vkQueuePresentKHR() has been issued for a swapchain. @@ -114,7 +153,7 @@ namespace Anvil * This function will only succeed if used for a single-GPU device instance. * * NOTE: If you are presenting to an off-screen window, make sure to transition - * the image to VK_IMAGE_LAYOUT_GENERAL, instead of VK_IMAGE_LAYOUT_PRESENT_SRC_KHR. + * the image to Anvil::ImageLayout::GENERAL, instead of Anvil::ImageLayout::PRESENT_SRC_KHR. * In off-screen rendering mode, swapchain images are actually regular images, so * presentable layout is not supported. * @@ -132,6 +171,70 @@ namespace Anvil uint32_t in_n_wait_semaphores, Anvil::Semaphore* const* in_wait_semaphore_ptrs_ptr); + /** See present() documentation for general information about this function. + * + * This function can be called for both single-GPU and multi-GPU devices. + * + * @param in_n_local_mode_presentation_items TODO + * @param in_local_mode_presentation_items TODO + * @param in_n_wait_semaphores TODO + * @param in_wait_semaphore_ptrs_ptr TODO + * + * @return TODO + **/ + VkResult present_in_local_presentation_mode(uint32_t in_n_local_mode_presentation_items, + const LocalModePresentationItem* in_local_mode_presentation_items, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs_ptr); + + /** See present() documentation for general information about this function. + * + * This function can be called for both single-GPU and multi-GPU devices. + * + * @param in_n_local_multi_device_mode_presentation_items TODO + * @param in_local_multi_device_mode_presentation_items TODO + * @param in_n_wait_semaphores TODO + * @param in_wait_semaphore_ptrs_ptr TODO + * + * @return TODO + **/ + VkResult present_in_local_multi_device_presentation_mode(uint32_t in_n_local_multi_device_mode_presentation_items, + const LocalMultiDeviceModePresentationItem* in_local_multi_device_mode_presentation_items, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs_ptr); + + /** See present() documentation for general information about this function. + * + * This function can be called for multi-GPU devices. + * + * @param in_n_remote_mode_presentation_items TODO + * @param in_remote_mode_presentation_items TODO + * @param in_n_wait_semaphores TODO + * @param in_wait_semaphore_ptrs_ptr TODO + * + * @return TODO + **/ + VkResult present_in_remote_presentation_mode(uint32_t in_n_remote_mode_presentation_items, + const RemoteModePresentationItem* in_remote_mode_presentation_items, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs_ptr); + + /** See present() documentation for general information about this function. + * + * This function can be called for multi-GPU devices. + * + * @param in_n_sum_mode_presentation_items TODO + * @param in_sum_mode_presentation_items TODO + * @param in_n_wait_semaphores TODO + * @param in_wait_semaphore_ptrs_ptr TODO + * + * @return TODO + **/ + VkResult present_in_sum_presentation_mode(uint32_t in_n_sum_mode_presentation_items, + const SumModePresentationItem* in_sum_mode_presentation_items, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs_ptr); + bool submit(const SubmitInfo& in_submit_info); /** Tells whether the queue supports sparse bindings */ @@ -144,11 +247,18 @@ namespace Anvil private: /* Private functions */ - void present_lock_unlock(uint32_t in_n_swapchains, - const Anvil::Swapchain* const* in_swapchains, - uint32_t in_n_wait_semaphores, - Anvil::Semaphore* const* in_wait_semaphore_ptrs, - bool in_should_lock); + VkResult present_internal (VkDeviceGroupPresentModeFlagBitsKHR in_presentation_mode, + uint32_t in_n_swapchains, + Anvil::Swapchain* const* in_swapchains, + const uint32_t* in_swapchain_image_indices, + const uint32_t* in_device_masks, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs); + void present_lock_unlock(uint32_t in_n_swapchains, + const Anvil::Swapchain* const* in_swapchains, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs, + bool in_should_lock); void bind_sparse_memory_lock_unlock (Anvil::SparseMemoryBindingUpdateInfo& in_update, bool in_should_lock); @@ -160,6 +270,14 @@ namespace Anvil Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, Anvil::Fence* in_opt_fence_ptr, bool in_should_lock); + void submit_command_buffers_lock_unlock(uint32_t in_n_command_buffer_submissions, + const CommandBufferMGPUSubmission* in_opt_command_buffer_submissions_ptr, + uint32_t in_n_signal_semaphore_submissions, + const SemaphoreMGPUSubmission* in_opt_signal_semaphore_submissions_ptr, + uint32_t in_n_wait_semaphore_submissions, + const SemaphoreMGPUSubmission* in_opt_wait_semaphore_submissions_ptr, + Anvil::Fence* in_opt_fence_ptr, + bool in_should_lock); /* Constructor. Please see create() for specification */ Queue(const Anvil::BaseDevice* in_device_ptr, diff --git a/include/wrappers/rendering_surface.h b/include/wrappers/rendering_surface.h index cccddb01..c961e309 100644 --- a/include/wrappers/rendering_surface.h +++ b/include/wrappers/rendering_surface.h @@ -49,13 +49,13 @@ namespace Anvil typedef struct RenderingSurfaceFormat { VkColorSpaceKHR color_space; - VkFormat format; + Anvil::Format format; /* Constructor. */ RenderingSurfaceFormat(VkSurfaceFormatKHR& in_surface_format) { color_space = in_surface_format.colorSpace; - format = in_surface_format.format; + format = static_cast(in_surface_format.format); } /** Comparison operator for _vulkan_surface_format and in_format types. @@ -65,7 +65,7 @@ namespace Anvil * @return true if @param in_format matches _vulkan_surface_format::format value, false * otherwise. **/ - bool operator==(const VkFormat& in_format) const + bool operator==(const Anvil::Format& in_format) const { return (format == in_format); } @@ -88,7 +88,8 @@ namespace Anvil virtual ~RenderingSurface(); /** Returns rendering surface capabilities */ - bool get_capabilities(VkSurfaceCapabilitiesKHR* out_surface_caps_ptr) const; + bool get_capabilities(const Anvil::PhysicalDevice* in_physical_device_ptr, + VkSurfaceCapabilitiesKHR* out_surface_caps_ptr) const; /** Returns rendering surface's height */ uint32_t get_height() const @@ -105,16 +106,20 @@ namespace Anvil } /** Returns queue family indices which support presentation on a given physical device */ - bool get_queue_families_with_present_support(const std::vector** out_result_ptr) const; + bool get_queue_families_with_present_support(const Anvil::PhysicalDevice* in_physical_device_ptr, + const std::vector** out_result_ptr) const; /** Returns composite alpha modes supported by the rendering surface */ - bool get_supported_composite_alpha_flags(VkCompositeAlphaFlagsKHR* out_result_ptr) const; + bool get_supported_composite_alpha_flags(const Anvil::PhysicalDevice* in_physical_device_ptr, + VkCompositeAlphaFlagsKHR* out_result_ptr) const; /** Returns transformations supported by the rendering surface */ - bool get_supported_transformations(VkSurfaceTransformFlagsKHR* out_result_ptr) const; + bool get_supported_transformations(const Anvil::PhysicalDevice* in_physical_device_ptr, + VkSurfaceTransformFlagsKHR* out_result_ptr) const; /** Returns flags corresponding to image usage supported by the rendering surface */ - bool get_supported_usages(VkImageUsageFlags* out_result_ptr) const; + bool get_supported_usages(const Anvil::PhysicalDevice* in_physical_device_ptr, + ImageUsageFlags* out_result_ptr) const; /** Retrieves a raw handle to the underlying Vulkan Rendering Surface */ VkSurfaceKHR get_surface() const @@ -138,12 +143,14 @@ namespace Anvil /* Tells whether the specified image format can be used for swapchain image initialization, using * this rendering surface. */ - bool is_compatible_with_image_format(VkFormat in_image_format, - bool* out_result_ptr) const; + bool is_compatible_with_image_format(const Anvil::PhysicalDevice* in_physical_device_ptr, + Anvil::Format in_image_format, + bool* out_result_ptr) const; /* Tells whether the specified presentation mode is supported by the rendering surface */ - bool supports_presentation_mode(VkPresentModeKHR in_presentation_mode, - bool* out_result_ptr) const; + bool supports_presentation_mode(const Anvil::PhysicalDevice* in_physical_device_ptr, + VkPresentModeKHR in_presentation_mode, + bool* out_result_ptr) const; private: /* Private type definitions */ @@ -154,12 +161,12 @@ namespace Anvil VkSurfaceCapabilitiesKHR capabilities; std::vector supported_formats; std::vector supported_presentation_modes; + ImageUsageFlags supported_usages; std::vector present_capable_queue_fams; VkCompositeAlphaFlagsKHRVariable (supported_composite_alpha_flags); VkSurfaceTransformFlagsKHRVariable(supported_transformations); - VkImageUsageFlagsVariable (supported_usages); PhysicalDeviceCapabilities() { diff --git a/include/wrappers/swapchain.h b/include/wrappers/swapchain.h index 06f4e2b1..bf9167ba 100644 --- a/include/wrappers/swapchain.h +++ b/include/wrappers/swapchain.h @@ -59,6 +59,8 @@ namespace Anvil virtual ~Swapchain(); /** Acquires a new swapchain image. + * + * Can be used for both SGPUDevice and mGPU swapchains. * * @param in_semaphore_ptr Semaphore to set upon frame acquisition. May be nullptr (assuming the implications are understood!) * @param in_should_block Set to true, if you want to wait on a fence set by vkAcquireNextImage*KHR() functions @@ -69,8 +71,12 @@ namespace Anvil * * @return Index of the swapchain image that the commands should be submitted against. **/ - uint32_t acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, - bool in_should_block = false); + uint32_t acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, + bool in_should_block = false); + uint32_t acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, + uint32_t in_n_mgpu_physical_devices, + const Anvil::PhysicalDevice* const* in_mgpu_physical_device_ptrs, + bool in_should_block = false); const SwapchainCreateInfo* get_create_info_ptr() const { diff --git a/src/misc/buffer_create_info.cpp b/src/misc/buffer_create_info.cpp index 54d0683d..16763b2e 100644 --- a/src/misc/buffer_create_info.cpp +++ b/src/misc/buffer_create_info.cpp @@ -27,8 +27,8 @@ Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_nonsparse_alloc(const Anvil::BaseDevice* in_device_ptr, VkDeviceSize in_size, QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - VkBufferUsageFlags in_usage_flags, + Anvil::SharingMode in_sharing_mode, + Anvil::BufferUsageFlags in_usage_flags, Anvil::MemoryFeatureFlags in_memory_features) { Anvil::BufferCreateInfoUniquePtr result_ptr(nullptr, @@ -53,8 +53,8 @@ Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_nonsparse_alloc Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_nonsparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, VkDeviceSize in_size, QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - VkBufferUsageFlags in_usage_flags) + Anvil::SharingMode in_sharing_mode, + Anvil::BufferUsageFlags in_usage_flags) { Anvil::BufferCreateInfoUniquePtr result_ptr(nullptr, std::default_delete() ); @@ -94,8 +94,8 @@ Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_nonsparse_no_al Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_sparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, VkDeviceSize in_size, QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - VkBufferUsageFlags in_usage_flags, + Anvil::SharingMode in_sharing_mode, + Anvil::BufferUsageFlags in_usage_flags, Anvil::SparseResidencyScope in_residency_scope, MTSafety in_mt_safety, Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) @@ -120,8 +120,8 @@ Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_sparse_no_alloc Anvil::BufferCreateInfo::BufferCreateInfo(const Anvil::BaseDevice* in_device_ptr, VkDeviceSize in_size, QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - VkBufferUsageFlags in_usage_flags, + Anvil::SharingMode in_sharing_mode, + Anvil::BufferUsageFlags in_usage_flags, Anvil::SparseResidencyScope in_residency_scope, MTSafety in_mt_safety, Anvil::ExternalMemoryHandleTypeBits in_exportable_external_memory_handle_types) @@ -168,8 +168,8 @@ Anvil::BufferCreateInfo::BufferCreateInfo(const Anvil::BufferType& in const Anvil::BaseDevice* in_device_ptr, VkDeviceSize in_size, QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, - VkBufferUsageFlags in_usage_flags, + Anvil::SharingMode in_sharing_mode, + Anvil::BufferUsageFlags in_usage_flags, MemoryFeatureFlags in_memory_features, MTSafety in_mt_safety, Anvil::ExternalMemoryHandleTypeBits in_exportable_external_memory_handle_types, diff --git a/src/misc/buffer_view_create_info.cpp b/src/misc/buffer_view_create_info.cpp index ad29e855..c4d298fb 100644 --- a/src/misc/buffer_view_create_info.cpp +++ b/src/misc/buffer_view_create_info.cpp @@ -23,7 +23,7 @@ Anvil::BufferViewCreateInfoUniquePtr Anvil::BufferViewCreateInfo::create(const Anvil::BaseDevice* in_device_ptr, Anvil::Buffer* in_buffer_ptr, - VkFormat in_format, + Anvil::Format in_format, VkDeviceSize in_start_offset, VkDeviceSize in_size) { @@ -44,7 +44,7 @@ Anvil::BufferViewCreateInfoUniquePtr Anvil::BufferViewCreateInfo::create(const A Anvil::BufferViewCreateInfo::BufferViewCreateInfo(const Anvil::BaseDevice* in_device_ptr, Anvil::Buffer* in_buffer_ptr, - VkFormat in_format, + Anvil::Format in_format, VkDeviceSize in_start_offset, VkDeviceSize in_size, MTSafety in_mt_safety) diff --git a/src/misc/dummy_window.cpp b/src/misc/dummy_window.cpp index d3a101ac..daf44369 100644 --- a/src/misc/dummy_window.cpp +++ b/src/misc/dummy_window.cpp @@ -167,7 +167,7 @@ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_ima { const Anvil::BaseDevice* device_ptr (m_swapchain_ptr->get_create_info_ptr()->get_device() ); std::unique_ptr result_ptr; - VkFormat swapchain_image_format (in_swapchain_image_ptr->get_create_info_ptr()->get_format() ); + Anvil::Format swapchain_image_format (in_swapchain_image_ptr->get_create_info_ptr()->get_format() ); const VkImageSubresourceRange swapchain_image_subresource_range(in_swapchain_image_ptr->get_subresource_range () ); /* Sanity checks .. */ @@ -194,8 +194,8 @@ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_ima auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(device_ptr, raw_image_size, Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_TRANSFER_DST_BIT, + Anvil::SharingMode::EXCLUSIVE, + Anvil::BUFFER_USAGE_FLAG_TRANSFER_DST_BIT, Anvil::MEMORY_FEATURE_FLAG_MAPPABLE); create_info_ptr->set_mt_safety(MT_SAFETY_DISABLED); @@ -209,22 +209,21 @@ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_ima { auto create_info_ptr = Anvil::ImageCreateInfo::create_nonsparse_alloc(device_ptr, - VK_IMAGE_TYPE_2D, - VK_FORMAT_R8G8B8A8_UNORM, - VK_IMAGE_TILING_OPTIMAL, - VK_IMAGE_USAGE_TRANSFER_SRC_BIT | - VK_IMAGE_USAGE_TRANSFER_DST_BIT, + Anvil::ImageType::_2D, + Anvil::Format::R8G8B8A8_UNORM, + Anvil::ImageTiling::OPTIMAL, + Anvil::IMAGE_USAGE_FLAG_TRANSFER_SRC_BIT | Anvil::IMAGE_USAGE_FLAG_TRANSFER_DST_BIT, swapchain_image_width, swapchain_image_height, 1, /* in_base_mipmap_depth */ 1, /* in_n_layers */ - VK_SAMPLE_COUNT_1_BIT, + Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, + Anvil::SharingMode::EXCLUSIVE, false, /* in_use_full_mipmap_chain */ 0, /* in_memory_features */ 0, /* in_create_flags */ - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL); + Anvil::ImageLayout::TRANSFER_DST_OPTIMAL); create_info_ptr->set_mt_safety(MT_SAFETY_DISABLED); @@ -249,8 +248,8 @@ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_ima VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_TRANSFER_WRITE_BIT | VK_ACCESS_MEMORY_READ_BIT, /* source_access_mask */ VK_ACCESS_TRANSFER_READ_BIT, /* destination_access_mask */ false, - VK_IMAGE_LAYOUT_GENERAL, - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, + Anvil::ImageLayout::GENERAL, + Anvil::ImageLayout::TRANSFER_SRC_OPTIMAL, universal_queue_family_index, universal_queue_family_index, in_swapchain_image_ptr, @@ -261,8 +260,8 @@ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_ima VK_ACCESS_TRANSFER_WRITE_BIT, /* source_access_mask */ VK_ACCESS_TRANSFER_READ_BIT, /* desitnation_access_mask */ false, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, + Anvil::ImageLayout::TRANSFER_DST_OPTIMAL, + Anvil::ImageLayout::TRANSFER_SRC_OPTIMAL, universal_queue_family_index, universal_queue_family_index, intermediate_image_ptr.get(), @@ -272,8 +271,8 @@ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_ima VK_ACCESS_TRANSFER_READ_BIT, /* source_access_mask */ 0, /* destination_access_mask */ false, - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, - VK_IMAGE_LAYOUT_GENERAL, + Anvil::ImageLayout::TRANSFER_SRC_OPTIMAL, + Anvil::ImageLayout::GENERAL, universal_queue_family_index, universal_queue_family_index, in_swapchain_image_ptr, @@ -304,9 +303,9 @@ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_ima intermediate_image_blit.srcSubresource = intermediate_image_blit.dstSubresource; command_buffer_ptr->record_blit_image(in_swapchain_image_ptr, - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, + Anvil::ImageLayout::TRANSFER_SRC_OPTIMAL, intermediate_image_ptr.get(), - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, + Anvil::ImageLayout::TRANSFER_DST_OPTIMAL, 1, /* regionCount */ &intermediate_image_blit, VK_FILTER_NEAREST); @@ -336,7 +335,7 @@ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_ima buffer_image_copy_region.imageSubresource.mipLevel = 0; command_buffer_ptr->record_copy_image_to_buffer(intermediate_image_ptr.get(), - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, + Anvil::ImageLayout::TRANSFER_SRC_OPTIMAL, raw_image_buffer_ptr.get(), 1, /* regionCount */ &buffer_image_copy_region); diff --git a/src/misc/formats.cpp b/src/misc/formats.cpp index 204f6866..94bc5bc6 100644 --- a/src/misc/formats.cpp +++ b/src/misc/formats.cpp @@ -25,7 +25,7 @@ static const struct FormatInfo { - VkFormat format; + Anvil::Format format; const char* name; Anvil::ComponentLayout component_layout; uint8_t component_bits[4]; /* if [0] == [1] == [2] == [3] == 0, the format is a block format. */ @@ -33,347 +33,347 @@ static const struct FormatInfo bool is_packed; } g_formats[] = { - /* format | name | component_layout | component_bits[0] | component_bits[1] | component_bits[2] | component_bits[3] | format_type | is_packed? */ - {VK_FORMAT_UNDEFINED, "VK_FORMAT_UNDEFINED", Anvil::COMPONENT_LAYOUT_UNKNOWN, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNKNOWN, false}, - {VK_FORMAT_R4G4_UNORM_PACK8, "VK_FORMAT_R4G4_UNORM_PACK8", Anvil::COMPONENT_LAYOUT_RG, 4, 4, 0, 0, Anvil::FORMAT_TYPE_UNORM, true}, - {VK_FORMAT_R4G4B4A4_UNORM_PACK16, "VK_FORMAT_R4G4B4A4_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_RGBA, 4, 4, 4, 4, Anvil::FORMAT_TYPE_UNORM, true}, - {VK_FORMAT_B4G4R4A4_UNORM_PACK16, "VK_FORMAT_B4G4R4A4_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_BGRA, 4, 4, 4, 4, Anvil::FORMAT_TYPE_UNORM, true}, - {VK_FORMAT_R5G6B5_UNORM_PACK16, "VK_FORMAT_R5G6B5_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_RGB, 5, 6, 5, 0, Anvil::FORMAT_TYPE_UNORM, true}, - {VK_FORMAT_B5G6R5_UNORM_PACK16, "VK_FORMAT_B5G6R5_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_BGR, 5, 6, 5, 0, Anvil::FORMAT_TYPE_UNORM, true}, - {VK_FORMAT_R5G5B5A1_UNORM_PACK16, "VK_FORMAT_R5G5B5A1_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_RGBA, 5, 5, 5, 1, Anvil::FORMAT_TYPE_UNORM, true}, - {VK_FORMAT_B5G5R5A1_UNORM_PACK16, "VK_FORMAT_B5G5R5A1_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_BGRA, 5, 5, 5, 1, Anvil::FORMAT_TYPE_UNORM, true}, - {VK_FORMAT_A1R5G5B5_UNORM_PACK16, "VK_FORMAT_A1R5G5B5_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_ARGB, 1, 5, 5, 5, Anvil::FORMAT_TYPE_UNORM, true}, - {VK_FORMAT_R8_UNORM, "VK_FORMAT_R8_UNORM", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_R8_SNORM, "VK_FORMAT_R8_SNORM", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {VK_FORMAT_R8_USCALED, "VK_FORMAT_R8_USCALED", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_USCALED, false}, - {VK_FORMAT_R8_SSCALED, "VK_FORMAT_R8_SSCALED", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_SSCALED, false}, - {VK_FORMAT_R8_UINT, "VK_FORMAT_R8_UINT", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, - {VK_FORMAT_R8_SINT, "VK_FORMAT_R8_SINT", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, - {VK_FORMAT_R8_SRGB, "VK_FORMAT_R8_SRGB", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_R8G8_UNORM, "VK_FORMAT_R8G8_UNORM", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_R8G8_SNORM, "VK_FORMAT_R8G8_SNORM", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {VK_FORMAT_R8G8_USCALED, "VK_FORMAT_R8G8_USCALED", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_USCALED, false}, - {VK_FORMAT_R8G8_SSCALED, "VK_FORMAT_R8G8_SSCALED", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_SSCALED, false}, - {VK_FORMAT_R8G8_UINT, "VK_FORMAT_R8G8_UINT", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, - {VK_FORMAT_R8G8_SINT, "VK_FORMAT_R8G8_SINT", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, - {VK_FORMAT_R8G8_SRGB, "VK_FORMAT_R8G8_SRGB", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_R8G8B8_UNORM, "VK_FORMAT_R8G8B8_UNORM", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_R8G8B8_SNORM, "VK_FORMAT_R8G8B8_SNORM", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {VK_FORMAT_R8G8B8_USCALED, "VK_FORMAT_R8G8B8_USCALED", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_USCALED, false}, - {VK_FORMAT_R8G8B8_SSCALED, "VK_FORMAT_R8G8B8_SSCALED", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SSCALED, false}, - {VK_FORMAT_R8G8B8_UINT, "VK_FORMAT_R8G8B8_UINT", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_UINT, false}, - {VK_FORMAT_R8G8B8_SINT, "VK_FORMAT_R8G8B8_SINT", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SINT, false}, - {VK_FORMAT_R8G8B8_SRGB, "VK_FORMAT_R8G8B8_SRGB", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_B8G8R8_UNORM, "VK_FORMAT_B8G8R8_UNORM", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_B8G8R8_SNORM, "VK_FORMAT_B8G8R8_SNORM", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {VK_FORMAT_B8G8R8_USCALED, "VK_FORMAT_B8G8R8_USCALED", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_USCALED, false}, - {VK_FORMAT_B8G8R8_SSCALED, "VK_FORMAT_B8G8R8_SSCALED", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SSCALED, false}, - {VK_FORMAT_B8G8R8_UINT, "VK_FORMAT_B8G8R8_UINT", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_UINT, false}, - {VK_FORMAT_B8G8R8_SINT, "VK_FORMAT_B8G8R8_SINT", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SINT, false}, - {VK_FORMAT_B8G8R8_SRGB, "VK_FORMAT_B8G8R8_SRGB", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_R8G8B8A8_UNORM, "VK_FORMAT_R8G8B8A8_UNORM", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_R8G8B8A8_SNORM, "VK_FORMAT_R8G8B8A8_SNORM", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SNORM, false}, - {VK_FORMAT_R8G8B8A8_USCALED, "VK_FORMAT_R8G8B8A8_USCALED", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_USCALED, false}, - {VK_FORMAT_R8G8B8A8_SSCALED, "VK_FORMAT_R8G8B8A8_SSCALED", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SSCALED, false}, - {VK_FORMAT_R8G8B8A8_UINT, "VK_FORMAT_R8G8B8A8_UINT", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UINT, false}, - {VK_FORMAT_R8G8B8A8_SINT, "VK_FORMAT_R8G8B8A8_SINT", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SINT, false}, - {VK_FORMAT_R8G8B8A8_SRGB, "VK_FORMAT_R8G8B8A8_SRGB", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_B8G8R8A8_UNORM, "VK_FORMAT_B8G8R8A8_UNORM", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_B8G8R8A8_SNORM, "VK_FORMAT_B8G8R8A8_SNORM", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SNORM, false}, - {VK_FORMAT_B8G8R8A8_USCALED, "VK_FORMAT_B8G8R8A8_USCALED", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_USCALED, false}, - {VK_FORMAT_B8G8R8A8_SSCALED, "VK_FORMAT_B8G8R8A8_SSCALED", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SSCALED, false}, - {VK_FORMAT_B8G8R8A8_UINT, "VK_FORMAT_B8G8R8A8_UINT", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UINT, false}, - {VK_FORMAT_B8G8R8A8_SINT, "VK_FORMAT_B8G8R8A8_SINT", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SINT, false}, - {VK_FORMAT_B8G8R8A8_SRGB, "VK_FORMAT_B8G8R8A8_SRGB", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_A8B8G8R8_UNORM_PACK32, "VK_FORMAT_A8B8G8R8_UNORM_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UNORM, true}, - {VK_FORMAT_A8B8G8R8_SNORM_PACK32, "VK_FORMAT_A8B8G8R8_SNORM_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SNORM, true}, - {VK_FORMAT_A8B8G8R8_USCALED_PACK32, "VK_FORMAT_A8B8G8R8_USCALED_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_USCALED, true}, - {VK_FORMAT_A8B8G8R8_SSCALED_PACK32, "VK_FORMAT_A8B8G8R8_SSCALED_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SSCALED, true}, - {VK_FORMAT_A8B8G8R8_UINT_PACK32, "VK_FORMAT_A8B8G8R8_UINT_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UINT, true}, - {VK_FORMAT_A8B8G8R8_SINT_PACK32, "VK_FORMAT_A8B8G8R8_SINT_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SINT, true}, - {VK_FORMAT_A8B8G8R8_SRGB_PACK32, "VK_FORMAT_A8B8G8R8_SRGB_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SRGB, true}, - {VK_FORMAT_A2R10G10B10_UNORM_PACK32, "VK_FORMAT_A2R10G10B10_UNORM_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_UNORM, true}, - {VK_FORMAT_A2R10G10B10_SNORM_PACK32, "VK_FORMAT_A2R10G10B10_SNORM_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SNORM, true}, - {VK_FORMAT_A2R10G10B10_USCALED_PACK32, "VK_FORMAT_A2R10G10B10_USCALED_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_USCALED, true}, - {VK_FORMAT_A2R10G10B10_SSCALED_PACK32, "VK_FORMAT_A2R10G10B10_SSCALED_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SSCALED, true}, - {VK_FORMAT_A2R10G10B10_UINT_PACK32, "VK_FORMAT_A2R10G10B10_UINT_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_UINT, true}, - {VK_FORMAT_A2R10G10B10_SINT_PACK32, "VK_FORMAT_A2R10G10B10_SINT_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SINT, true}, - {VK_FORMAT_A2B10G10R10_UNORM_PACK32, "VK_FORMAT_A2B10G10R10_UNORM_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_UNORM, true}, - {VK_FORMAT_A2B10G10R10_SNORM_PACK32, "VK_FORMAT_A2B10G10R10_SNORM_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SNORM, true}, - {VK_FORMAT_A2B10G10R10_USCALED_PACK32, "VK_FORMAT_A2B10G10R10_USCALED_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_USCALED, true}, - {VK_FORMAT_A2B10G10R10_SSCALED_PACK32, "VK_FORMAT_A2B10G10R10_SSCALED_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SSCALED, true}, - {VK_FORMAT_A2B10G10R10_UINT_PACK32, "VK_FORMAT_A2B10G10R10_UINT_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_UINT, true}, - {VK_FORMAT_A2B10G10R10_SINT_PACK32, "VK_FORMAT_A2B10G10R10_SINT_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SINT, true}, - {VK_FORMAT_R16_UNORM, "VK_FORMAT_R16_UNORM", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_R16_SNORM, "VK_FORMAT_R16_SNORM", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {VK_FORMAT_R16_USCALED, "VK_FORMAT_R16_USCALED", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_USCALED, false}, - {VK_FORMAT_R16_SSCALED, "VK_FORMAT_R16_SSCALED", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_SSCALED, false}, - {VK_FORMAT_R16_UINT, "VK_FORMAT_R16_UINT", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, - {VK_FORMAT_R16_SINT, "VK_FORMAT_R16_SINT", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, - {VK_FORMAT_R16_SFLOAT, "VK_FORMAT_R16_SFLOAT", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {VK_FORMAT_R16G16_UNORM, "VK_FORMAT_R16G16_UNORM", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_R16G16_SNORM, "VK_FORMAT_R16G16_SNORM", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {VK_FORMAT_R16G16_USCALED, "VK_FORMAT_R16G16_USCALED", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_USCALED, false}, - {VK_FORMAT_R16G16_SSCALED, "VK_FORMAT_R16G16_SSCALED", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_SSCALED, false}, - {VK_FORMAT_R16G16_UINT, "VK_FORMAT_R16G16_UINT", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, - {VK_FORMAT_R16G16_SINT, "VK_FORMAT_R16G16_SINT", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, - {VK_FORMAT_R16G16_SFLOAT, "VK_FORMAT_R16G16_SFLOAT", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {VK_FORMAT_R16G16B16_UNORM, "VK_FORMAT_R16G16B16_UNORM", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_R16G16B16_SNORM, "VK_FORMAT_R16G16B16_SNORM", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {VK_FORMAT_R16G16B16_USCALED, "VK_FORMAT_R16G16B16_USCALED", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_USCALED, false}, - {VK_FORMAT_R16G16B16_SSCALED, "VK_FORMAT_R16G16B16_SSCALED", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_SSCALED, false}, - {VK_FORMAT_R16G16B16_UINT, "VK_FORMAT_R16G16B16_UINT", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_UINT, false}, - {VK_FORMAT_R16G16B16_SINT, "VK_FORMAT_R16G16B16_SINT", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_SINT, false}, - {VK_FORMAT_R16G16B16_SFLOAT, "VK_FORMAT_R16G16B16_SFLOAT", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {VK_FORMAT_R16G16B16A16_UNORM, "VK_FORMAT_R16G16B16A16_UNORM", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_R16G16B16A16_SNORM, "VK_FORMAT_R16G16B16A16_SNORM", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_SNORM, false}, - {VK_FORMAT_R16G16B16A16_USCALED, "VK_FORMAT_R16G16B16A16_USCALED", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_USCALED, false}, - {VK_FORMAT_R16G16B16A16_SSCALED, "VK_FORMAT_R16G16B16A16_SSCALED", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_SSCALED, false}, - {VK_FORMAT_R16G16B16A16_UINT, "VK_FORMAT_R16G16B16A16_UINT", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_UINT, false}, - {VK_FORMAT_R16G16B16A16_SINT, "VK_FORMAT_R16G16B16A16_SINT", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_SINT, false}, - {VK_FORMAT_R16G16B16A16_SFLOAT, "VK_FORMAT_R16G16B16A16_SFLOAT", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_SFLOAT, false}, - {VK_FORMAT_R32_UINT, "VK_FORMAT_R32_UINT", Anvil::COMPONENT_LAYOUT_R, 32, 0, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, - {VK_FORMAT_R32_SINT, "VK_FORMAT_R32_SINT", Anvil::COMPONENT_LAYOUT_R, 32, 0, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, - {VK_FORMAT_R32_SFLOAT, "VK_FORMAT_R32_SFLOAT", Anvil::COMPONENT_LAYOUT_R, 32, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {VK_FORMAT_R32G32_UINT, "VK_FORMAT_R32G32_UINT", Anvil::COMPONENT_LAYOUT_RG, 32, 32, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, - {VK_FORMAT_R32G32_SINT, "VK_FORMAT_R32G32_SINT", Anvil::COMPONENT_LAYOUT_RG, 32, 32, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, - {VK_FORMAT_R32G32_SFLOAT, "VK_FORMAT_R32G32_SFLOAT", Anvil::COMPONENT_LAYOUT_RG, 32, 32, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {VK_FORMAT_R32G32B32_UINT, "VK_FORMAT_R32G32B32_UINT", Anvil::COMPONENT_LAYOUT_RGB, 32, 32, 32, 0, Anvil::FORMAT_TYPE_UINT, false}, - {VK_FORMAT_R32G32B32_SINT, "VK_FORMAT_R32G32B32_SINT", Anvil::COMPONENT_LAYOUT_RGB, 32, 32, 32, 0, Anvil::FORMAT_TYPE_SINT, false}, - {VK_FORMAT_R32G32B32_SFLOAT, "VK_FORMAT_R32G32B32_SFLOAT", Anvil::COMPONENT_LAYOUT_RGB, 32, 32, 32, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {VK_FORMAT_R32G32B32A32_UINT, "VK_FORMAT_R32G32B32A32_UINT", Anvil::COMPONENT_LAYOUT_RGBA, 32, 32, 32, 32, Anvil::FORMAT_TYPE_UINT, false}, - {VK_FORMAT_R32G32B32A32_SINT, "VK_FORMAT_R32G32B32A32_SINT", Anvil::COMPONENT_LAYOUT_RGBA, 32, 32, 32, 32, Anvil::FORMAT_TYPE_SINT, false}, - {VK_FORMAT_R32G32B32A32_SFLOAT, "VK_FORMAT_R32G32B32A32_SFLOAT", Anvil::COMPONENT_LAYOUT_RGBA, 32, 32, 32, 32, Anvil::FORMAT_TYPE_SFLOAT, false}, - {VK_FORMAT_R64_UINT, "VK_FORMAT_R64_UINT", Anvil::COMPONENT_LAYOUT_R, 64, 0, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, - {VK_FORMAT_R64_SINT, "VK_FORMAT_R64_SINT", Anvil::COMPONENT_LAYOUT_R, 64, 0, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, - {VK_FORMAT_R64_SFLOAT, "VK_FORMAT_R64_SFLOAT", Anvil::COMPONENT_LAYOUT_R, 64, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {VK_FORMAT_R64G64_UINT, "VK_FORMAT_R64G64_UINT", Anvil::COMPONENT_LAYOUT_RG, 64, 64, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, - {VK_FORMAT_R64G64_SINT, "VK_FORMAT_R64G64_SINT", Anvil::COMPONENT_LAYOUT_RG, 64, 64, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, - {VK_FORMAT_R64G64_SFLOAT, "VK_FORMAT_R64G64_SFLOAT", Anvil::COMPONENT_LAYOUT_RG, 64, 64, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {VK_FORMAT_R64G64B64_UINT, "VK_FORMAT_R64G64B64_UINT", Anvil::COMPONENT_LAYOUT_RGB, 64, 64, 64, 0, Anvil::FORMAT_TYPE_UINT, false}, - {VK_FORMAT_R64G64B64_SINT, "VK_FORMAT_R64G64B64_SINT", Anvil::COMPONENT_LAYOUT_RGB, 64, 64, 64, 0, Anvil::FORMAT_TYPE_SINT, false}, - {VK_FORMAT_R64G64B64_SFLOAT, "VK_FORMAT_R64G64B64_SFLOAT", Anvil::COMPONENT_LAYOUT_RGB, 64, 64, 64, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {VK_FORMAT_R64G64B64A64_UINT, "VK_FORMAT_R64G64B64A64_UINT", Anvil::COMPONENT_LAYOUT_RGBA, 64, 64, 64, 64, Anvil::FORMAT_TYPE_UINT, false}, - {VK_FORMAT_R64G64B64A64_SINT, "VK_FORMAT_R64G64B64A64_SINT", Anvil::COMPONENT_LAYOUT_RGBA, 64, 64, 64, 64, Anvil::FORMAT_TYPE_SINT, false}, - {VK_FORMAT_R64G64B64A64_SFLOAT, "VK_FORMAT_R64G64B64A64_SFLOAT", Anvil::COMPONENT_LAYOUT_RGBA, 64, 64, 64, 64, Anvil::FORMAT_TYPE_SFLOAT, false}, - {VK_FORMAT_B10G11R11_UFLOAT_PACK32, "VK_FORMAT_B10G11R11_UFLOAT_PACK32", Anvil::COMPONENT_LAYOUT_BGR, 10, 11, 11, 0, Anvil::FORMAT_TYPE_UFLOAT, true}, - {VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, "VK_FORMAT_E5B9G9R9_UFLOAT_PACK32", Anvil::COMPONENT_LAYOUT_EBGR, 5, 9, 9, 9, Anvil::FORMAT_TYPE_UFLOAT, true}, - {VK_FORMAT_D16_UNORM, "VK_FORMAT_D16_UNORM", Anvil::COMPONENT_LAYOUT_D, 16, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_X8_D24_UNORM_PACK32, "VK_FORMAT_X8_D24_UNORM_PACK32", Anvil::COMPONENT_LAYOUT_XD, 8, 24, 0, 0, Anvil::FORMAT_TYPE_UNORM, true}, - {VK_FORMAT_D32_SFLOAT, "VK_FORMAT_D32_SFLOAT", Anvil::COMPONENT_LAYOUT_D, 32, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {VK_FORMAT_S8_UINT, "VK_FORMAT_S8_UINT", Anvil::COMPONENT_LAYOUT_S, 8, 0, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, - {VK_FORMAT_D16_UNORM_S8_UINT, "VK_FORMAT_D16_UNORM_S8_UINT", Anvil::COMPONENT_LAYOUT_DS, 16, 8, 0, 0, Anvil::FORMAT_TYPE_UNORM_UINT, false}, - {VK_FORMAT_D24_UNORM_S8_UINT, "VK_FORMAT_D24_UNORM_S8_UINT", Anvil::COMPONENT_LAYOUT_DS, 24, 8, 0, 0, Anvil::FORMAT_TYPE_UNORM_UINT, false}, - {VK_FORMAT_D32_SFLOAT_S8_UINT, "VK_FORMAT_D32_SFLOAT_S8_UINT", Anvil::COMPONENT_LAYOUT_DS, 32, 8, 0, 0, Anvil::FORMAT_TYPE_SFLOAT_UINT, false}, - {VK_FORMAT_BC1_RGB_UNORM_BLOCK, "VK_FORMAT_BC1_RGB_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_BC1_RGB_SRGB_BLOCK, "VK_FORMAT_BC1_RGB_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_BC1_RGBA_UNORM_BLOCK, "VK_FORMAT_BC1_RGBA_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_BC1_RGBA_SRGB_BLOCK, "VK_FORMAT_BC1_RGBA_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_BC2_UNORM_BLOCK, "VK_FORMAT_BC2_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_BC2_SRGB_BLOCK, "VK_FORMAT_BC2_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_BC3_UNORM_BLOCK, "VK_FORMAT_BC3_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_BC3_SRGB_BLOCK, "VK_FORMAT_BC3_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_BC4_UNORM_BLOCK, "VK_FORMAT_BC4_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_R, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_BC4_SNORM_BLOCK, "VK_FORMAT_BC4_SNORM_BLOCK", Anvil::COMPONENT_LAYOUT_R, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {VK_FORMAT_BC5_UNORM_BLOCK, "VK_FORMAT_BC5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RG, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_BC5_SNORM_BLOCK, "VK_FORMAT_BC5_SNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RG, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {VK_FORMAT_BC6H_UFLOAT_BLOCK, "VK_FORMAT_BC6H_UFLOAT_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UFLOAT, false}, - {VK_FORMAT_BC6H_SFLOAT_BLOCK, "VK_FORMAT_BC6H_SFLOAT_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {VK_FORMAT_BC7_UNORM_BLOCK, "VK_FORMAT_BC7_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_BC7_SRGB_BLOCK, "VK_FORMAT_BC7_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, "VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK, "VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK, "VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK, "VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK, "VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK, "VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_EAC_R11_UNORM_BLOCK, "VK_FORMAT_EAC_R11_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_R, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_EAC_R11_SNORM_BLOCK, "VK_FORMAT_EAC_R11_SNORM_BLOCK", Anvil::COMPONENT_LAYOUT_R, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {VK_FORMAT_EAC_R11G11_UNORM_BLOCK, "VK_FORMAT_EAC_R11G11_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RG, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_EAC_R11G11_SNORM_BLOCK, "VK_FORMAT_EAC_R11G11_SNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RG, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {VK_FORMAT_ASTC_4x4_UNORM_BLOCK, "VK_FORMAT_ASTC_4x4_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_ASTC_4x4_SRGB_BLOCK, "VK_FORMAT_ASTC_4x4_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_ASTC_5x4_UNORM_BLOCK, "VK_FORMAT_ASTC_5x4_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_ASTC_5x4_SRGB_BLOCK, "VK_FORMAT_ASTC_5x4_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_ASTC_5x5_UNORM_BLOCK, "VK_FORMAT_ASTC_5x5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_ASTC_5x5_SRGB_BLOCK, "VK_FORMAT_ASTC_5x5_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_ASTC_6x5_UNORM_BLOCK, "VK_FORMAT_ASTC_6x5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_ASTC_6x5_SRGB_BLOCK, "VK_FORMAT_ASTC_6x5_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_ASTC_6x6_UNORM_BLOCK, "VK_FORMAT_ASTC_6x6_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_ASTC_6x6_SRGB_BLOCK, "VK_FORMAT_ASTC_6x6_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_ASTC_8x5_UNORM_BLOCK, "VK_FORMAT_ASTC_8x5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_ASTC_8x5_SRGB_BLOCK, "VK_FORMAT_ASTC_8x5_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_ASTC_8x6_UNORM_BLOCK, "VK_FORMAT_ASTC_8x6_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_ASTC_8x6_SRGB_BLOCK, "VK_FORMAT_ASTC_8x6_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_ASTC_8x8_UNORM_BLOCK, "VK_FORMAT_ASTC_8x8_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_ASTC_8x8_SRGB_BLOCK, "VK_FORMAT_ASTC_8x8_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_ASTC_10x5_UNORM_BLOCK, "VK_FORMAT_ASTC_10x5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_ASTC_10x5_SRGB_BLOCK, "VK_FORMAT_ASTC_10x5_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_ASTC_10x6_UNORM_BLOCK, "VK_FORMAT_ASTC_10x6_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_ASTC_10x6_SRGB_BLOCK, "VK_FORMAT_ASTC_10x6_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_ASTC_10x8_UNORM_BLOCK, "VK_FORMAT_ASTC_10x8_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_ASTC_10x8_SRGB_BLOCK, "VK_FORMAT_ASTC_10x8_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_ASTC_10x10_UNORM_BLOCK, "VK_FORMAT_ASTC_10x10_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_ASTC_10x10_SRGB_BLOCK, "VK_FORMAT_ASTC_10x10_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_ASTC_12x10_UNORM_BLOCK, "VK_FORMAT_ASTC_12x10_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_ASTC_12x10_SRGB_BLOCK, "VK_FORMAT_ASTC_12x10_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {VK_FORMAT_ASTC_12x12_UNORM_BLOCK, "VK_FORMAT_ASTC_12x12_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {VK_FORMAT_ASTC_12x12_SRGB_BLOCK, "VK_FORMAT_ASTC_12x12_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false} + /* format | name | component_layout | component_bits[0] | component_bits[1] | component_bits[2] | component_bits[3] | format_type | is_packed? */ + {Anvil::Format::UNKNOWN, "VK_FORMAT_UNDEFINED", Anvil::COMPONENT_LAYOUT_UNKNOWN, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNKNOWN, false}, + {Anvil::Format::R4G4_UNORM_PACK8, "VK_FORMAT_R4G4_UNORM_PACK8", Anvil::COMPONENT_LAYOUT_RG, 4, 4, 0, 0, Anvil::FORMAT_TYPE_UNORM, true}, + {Anvil::Format::R4G4B4A4_UNORM_PACK16, "VK_FORMAT_R4G4B4A4_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_RGBA, 4, 4, 4, 4, Anvil::FORMAT_TYPE_UNORM, true}, + {Anvil::Format::B4G4R4A4_UNORM_PACK16, "VK_FORMAT_B4G4R4A4_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_BGRA, 4, 4, 4, 4, Anvil::FORMAT_TYPE_UNORM, true}, + {Anvil::Format::R5G6B5_UNORM_PACK16, "VK_FORMAT_R5G6B5_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_RGB, 5, 6, 5, 0, Anvil::FORMAT_TYPE_UNORM, true}, + {Anvil::Format::B5G6R5_UNORM_PACK16, "VK_FORMAT_B5G6R5_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_BGR, 5, 6, 5, 0, Anvil::FORMAT_TYPE_UNORM, true}, + {Anvil::Format::R5G5B5A1_UNORM_PACK16, "VK_FORMAT_R5G5B5A1_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_RGBA, 5, 5, 5, 1, Anvil::FORMAT_TYPE_UNORM, true}, + {Anvil::Format::B5G5R5A1_UNORM_PACK16, "VK_FORMAT_B5G5R5A1_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_BGRA, 5, 5, 5, 1, Anvil::FORMAT_TYPE_UNORM, true}, + {Anvil::Format::A1R5G5B5_UNORM_PACK16, "VK_FORMAT_A1R5G5B5_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_ARGB, 1, 5, 5, 5, Anvil::FORMAT_TYPE_UNORM, true}, + {Anvil::Format::R8_UNORM, "VK_FORMAT_R8_UNORM", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::R8_SNORM, "VK_FORMAT_R8_SNORM", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {Anvil::Format::R8_USCALED, "VK_FORMAT_R8_USCALED", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_USCALED, false}, + {Anvil::Format::R8_SSCALED, "VK_FORMAT_R8_SSCALED", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_SSCALED, false}, + {Anvil::Format::R8_UINT, "VK_FORMAT_R8_UINT", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, + {Anvil::Format::R8_SINT, "VK_FORMAT_R8_SINT", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, + {Anvil::Format::R8_SRGB, "VK_FORMAT_R8_SRGB", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::R8G8_UNORM, "VK_FORMAT_R8G8_UNORM", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::R8G8_SNORM, "VK_FORMAT_R8G8_SNORM", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {Anvil::Format::R8G8_USCALED, "VK_FORMAT_R8G8_USCALED", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_USCALED, false}, + {Anvil::Format::R8G8_SSCALED, "VK_FORMAT_R8G8_SSCALED", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_SSCALED, false}, + {Anvil::Format::R8G8_UINT, "VK_FORMAT_R8G8_UINT", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, + {Anvil::Format::R8G8_SINT, "VK_FORMAT_R8G8_SINT", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, + {Anvil::Format::R8G8_SRGB, "VK_FORMAT_R8G8_SRGB", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::R8G8B8_UNORM, "VK_FORMAT_R8G8B8_UNORM", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::R8G8B8_SNORM, "VK_FORMAT_R8G8B8_SNORM", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {Anvil::Format::R8G8B8_USCALED, "VK_FORMAT_R8G8B8_USCALED", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_USCALED, false}, + {Anvil::Format::R8G8B8_SSCALED, "VK_FORMAT_R8G8B8_SSCALED", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SSCALED, false}, + {Anvil::Format::R8G8B8_UINT, "VK_FORMAT_R8G8B8_UINT", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_UINT, false}, + {Anvil::Format::R8G8B8_SINT, "VK_FORMAT_R8G8B8_SINT", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SINT, false}, + {Anvil::Format::R8G8B8_SRGB, "VK_FORMAT_R8G8B8_SRGB", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::B8G8R8_UNORM, "VK_FORMAT_B8G8R8_UNORM", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::B8G8R8_SNORM, "VK_FORMAT_B8G8R8_SNORM", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {Anvil::Format::B8G8R8_USCALED, "VK_FORMAT_B8G8R8_USCALED", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_USCALED, false}, + {Anvil::Format::B8G8R8_SSCALED, "VK_FORMAT_B8G8R8_SSCALED", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SSCALED, false}, + {Anvil::Format::B8G8R8_UINT, "VK_FORMAT_B8G8R8_UINT", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_UINT, false}, + {Anvil::Format::B8G8R8_SINT, "VK_FORMAT_B8G8R8_SINT", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SINT, false}, + {Anvil::Format::B8G8R8_SRGB, "VK_FORMAT_B8G8R8_SRGB", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::R8G8B8A8_UNORM, "VK_FORMAT_R8G8B8A8_UNORM", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::R8G8B8A8_SNORM, "VK_FORMAT_R8G8B8A8_SNORM", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SNORM, false}, + {Anvil::Format::R8G8B8A8_USCALED, "VK_FORMAT_R8G8B8A8_USCALED", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_USCALED, false}, + {Anvil::Format::R8G8B8A8_SSCALED, "VK_FORMAT_R8G8B8A8_SSCALED", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SSCALED, false}, + {Anvil::Format::R8G8B8A8_UINT, "VK_FORMAT_R8G8B8A8_UINT", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UINT, false}, + {Anvil::Format::R8G8B8A8_SINT, "VK_FORMAT_R8G8B8A8_SINT", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SINT, false}, + {Anvil::Format::R8G8B8A8_SRGB, "VK_FORMAT_R8G8B8A8_SRGB", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::B8G8R8A8_UNORM, "VK_FORMAT_B8G8R8A8_UNORM", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::B8G8R8A8_SNORM, "VK_FORMAT_B8G8R8A8_SNORM", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SNORM, false}, + {Anvil::Format::B8G8R8A8_USCALED, "VK_FORMAT_B8G8R8A8_USCALED", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_USCALED, false}, + {Anvil::Format::B8G8R8A8_SSCALED, "VK_FORMAT_B8G8R8A8_SSCALED", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SSCALED, false}, + {Anvil::Format::B8G8R8A8_UINT, "VK_FORMAT_B8G8R8A8_UINT", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UINT, false}, + {Anvil::Format::B8G8R8A8_SINT, "VK_FORMAT_B8G8R8A8_SINT", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SINT, false}, + {Anvil::Format::B8G8R8A8_SRGB, "VK_FORMAT_B8G8R8A8_SRGB", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::A8B8G8R8_UNORM_PACK32, "VK_FORMAT_A8B8G8R8_UNORM_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UNORM, true}, + {Anvil::Format::A8B8G8R8_SNORM_PACK32, "VK_FORMAT_A8B8G8R8_SNORM_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SNORM, true}, + {Anvil::Format::A8B8G8R8_USCALED_PACK32, "VK_FORMAT_A8B8G8R8_USCALED_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_USCALED, true}, + {Anvil::Format::A8B8G8R8_SSCALED_PACK32, "VK_FORMAT_A8B8G8R8_SSCALED_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SSCALED, true}, + {Anvil::Format::A8B8G8R8_UINT_PACK32, "VK_FORMAT_A8B8G8R8_UINT_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UINT, true}, + {Anvil::Format::A8B8G8R8_SINT_PACK32, "VK_FORMAT_A8B8G8R8_SINT_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SINT, true}, + {Anvil::Format::A8B8G8R8_SRGB_PACK32, "VK_FORMAT_A8B8G8R8_SRGB_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SRGB, true}, + {Anvil::Format::A2R10G10B10_UNORM_PACK32, "VK_FORMAT_A2R10G10B10_UNORM_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_UNORM, true}, + {Anvil::Format::A2R10G10B10_SNORM_PACK32, "VK_FORMAT_A2R10G10B10_SNORM_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SNORM, true}, + {Anvil::Format::A2R10G10B10_USCALED_PACK32, "VK_FORMAT_A2R10G10B10_USCALED_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_USCALED, true}, + {Anvil::Format::A2R10G10B10_SSCALED_PACK32, "VK_FORMAT_A2R10G10B10_SSCALED_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SSCALED, true}, + {Anvil::Format::A2R10G10B10_UINT_PACK32, "VK_FORMAT_A2R10G10B10_UINT_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_UINT, true}, + {Anvil::Format::A2R10G10B10_SINT_PACK32, "VK_FORMAT_A2R10G10B10_SINT_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SINT, true}, + {Anvil::Format::A2B10G10R10_UNORM_PACK32, "VK_FORMAT_A2B10G10R10_UNORM_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_UNORM, true}, + {Anvil::Format::A2B10G10R10_SNORM_PACK32, "VK_FORMAT_A2B10G10R10_SNORM_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SNORM, true}, + {Anvil::Format::A2B10G10R10_USCALED_PACK32, "VK_FORMAT_A2B10G10R10_USCALED_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_USCALED, true}, + {Anvil::Format::A2B10G10R10_SSCALED_PACK32, "VK_FORMAT_A2B10G10R10_SSCALED_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SSCALED, true}, + {Anvil::Format::A2B10G10R10_UINT_PACK32, "VK_FORMAT_A2B10G10R10_UINT_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_UINT, true}, + {Anvil::Format::A2B10G10R10_SINT_PACK32, "VK_FORMAT_A2B10G10R10_SINT_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SINT, true}, + {Anvil::Format::R16_UNORM, "VK_FORMAT_R16_UNORM", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::R16_SNORM, "VK_FORMAT_R16_SNORM", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {Anvil::Format::R16_USCALED, "VK_FORMAT_R16_USCALED", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_USCALED, false}, + {Anvil::Format::R16_SSCALED, "VK_FORMAT_R16_SSCALED", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_SSCALED, false}, + {Anvil::Format::R16_UINT, "VK_FORMAT_R16_UINT", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, + {Anvil::Format::R16_SINT, "VK_FORMAT_R16_SINT", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, + {Anvil::Format::R16_SFLOAT, "VK_FORMAT_R16_SFLOAT", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {Anvil::Format::R16G16_UNORM, "VK_FORMAT_R16G16_UNORM", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::R16G16_SNORM, "VK_FORMAT_R16G16_SNORM", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {Anvil::Format::R16G16_USCALED, "VK_FORMAT_R16G16_USCALED", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_USCALED, false}, + {Anvil::Format::R16G16_SSCALED, "VK_FORMAT_R16G16_SSCALED", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_SSCALED, false}, + {Anvil::Format::R16G16_UINT, "VK_FORMAT_R16G16_UINT", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, + {Anvil::Format::R16G16_SINT, "VK_FORMAT_R16G16_SINT", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, + {Anvil::Format::R16G16_SFLOAT, "VK_FORMAT_R16G16_SFLOAT", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {Anvil::Format::R16G16B16_UNORM, "VK_FORMAT_R16G16B16_UNORM", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::R16G16B16_SNORM, "VK_FORMAT_R16G16B16_SNORM", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {Anvil::Format::R16G16B16_USCALED, "VK_FORMAT_R16G16B16_USCALED", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_USCALED, false}, + {Anvil::Format::R16G16B16_SSCALED, "VK_FORMAT_R16G16B16_SSCALED", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_SSCALED, false}, + {Anvil::Format::R16G16B16_UINT, "VK_FORMAT_R16G16B16_UINT", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_UINT, false}, + {Anvil::Format::R16G16B16_SINT, "VK_FORMAT_R16G16B16_SINT", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_SINT, false}, + {Anvil::Format::R16G16B16_SFLOAT, "VK_FORMAT_R16G16B16_SFLOAT", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {Anvil::Format::R16G16B16A16_UNORM, "VK_FORMAT_R16G16B16A16_UNORM", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::R16G16B16A16_SNORM, "VK_FORMAT_R16G16B16A16_SNORM", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_SNORM, false}, + {Anvil::Format::R16G16B16A16_USCALED, "VK_FORMAT_R16G16B16A16_USCALED", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_USCALED, false}, + {Anvil::Format::R16G16B16A16_SSCALED, "VK_FORMAT_R16G16B16A16_SSCALED", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_SSCALED, false}, + {Anvil::Format::R16G16B16A16_UINT, "VK_FORMAT_R16G16B16A16_UINT", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_UINT, false}, + {Anvil::Format::R16G16B16A16_SINT, "VK_FORMAT_R16G16B16A16_SINT", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_SINT, false}, + {Anvil::Format::R16G16B16A16_SFLOAT, "VK_FORMAT_R16G16B16A16_SFLOAT", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_SFLOAT, false}, + {Anvil::Format::R32_UINT, "VK_FORMAT_R32_UINT", Anvil::COMPONENT_LAYOUT_R, 32, 0, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, + {Anvil::Format::R32_SINT, "VK_FORMAT_R32_SINT", Anvil::COMPONENT_LAYOUT_R, 32, 0, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, + {Anvil::Format::R32_SFLOAT, "VK_FORMAT_R32_SFLOAT", Anvil::COMPONENT_LAYOUT_R, 32, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {Anvil::Format::R32G32_UINT, "VK_FORMAT_R32G32_UINT", Anvil::COMPONENT_LAYOUT_RG, 32, 32, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, + {Anvil::Format::R32G32_SINT, "VK_FORMAT_R32G32_SINT", Anvil::COMPONENT_LAYOUT_RG, 32, 32, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, + {Anvil::Format::R32G32_SFLOAT, "VK_FORMAT_R32G32_SFLOAT", Anvil::COMPONENT_LAYOUT_RG, 32, 32, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {Anvil::Format::R32G32B32_UINT, "VK_FORMAT_R32G32B32_UINT", Anvil::COMPONENT_LAYOUT_RGB, 32, 32, 32, 0, Anvil::FORMAT_TYPE_UINT, false}, + {Anvil::Format::R32G32B32_SINT, "VK_FORMAT_R32G32B32_SINT", Anvil::COMPONENT_LAYOUT_RGB, 32, 32, 32, 0, Anvil::FORMAT_TYPE_SINT, false}, + {Anvil::Format::R32G32B32_SFLOAT, "VK_FORMAT_R32G32B32_SFLOAT", Anvil::COMPONENT_LAYOUT_RGB, 32, 32, 32, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {Anvil::Format::R32G32B32A32_UINT, "VK_FORMAT_R32G32B32A32_UINT", Anvil::COMPONENT_LAYOUT_RGBA, 32, 32, 32, 32, Anvil::FORMAT_TYPE_UINT, false}, + {Anvil::Format::R32G32B32A32_SINT, "VK_FORMAT_R32G32B32A32_SINT", Anvil::COMPONENT_LAYOUT_RGBA, 32, 32, 32, 32, Anvil::FORMAT_TYPE_SINT, false}, + {Anvil::Format::R32G32B32A32_SFLOAT, "VK_FORMAT_R32G32B32A32_SFLOAT", Anvil::COMPONENT_LAYOUT_RGBA, 32, 32, 32, 32, Anvil::FORMAT_TYPE_SFLOAT, false}, + {Anvil::Format::R64_UINT, "VK_FORMAT_R64_UINT", Anvil::COMPONENT_LAYOUT_R, 64, 0, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, + {Anvil::Format::R64_SINT, "VK_FORMAT_R64_SINT", Anvil::COMPONENT_LAYOUT_R, 64, 0, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, + {Anvil::Format::R64_SFLOAT, "VK_FORMAT_R64_SFLOAT", Anvil::COMPONENT_LAYOUT_R, 64, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {Anvil::Format::R64G64_UINT, "VK_FORMAT_R64G64_UINT", Anvil::COMPONENT_LAYOUT_RG, 64, 64, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, + {Anvil::Format::R64G64_SINT, "VK_FORMAT_R64G64_SINT", Anvil::COMPONENT_LAYOUT_RG, 64, 64, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, + {Anvil::Format::R64G64_SFLOAT, "VK_FORMAT_R64G64_SFLOAT", Anvil::COMPONENT_LAYOUT_RG, 64, 64, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {Anvil::Format::R64G64B64_UINT, "VK_FORMAT_R64G64B64_UINT", Anvil::COMPONENT_LAYOUT_RGB, 64, 64, 64, 0, Anvil::FORMAT_TYPE_UINT, false}, + {Anvil::Format::R64G64B64_SINT, "VK_FORMAT_R64G64B64_SINT", Anvil::COMPONENT_LAYOUT_RGB, 64, 64, 64, 0, Anvil::FORMAT_TYPE_SINT, false}, + {Anvil::Format::R64G64B64_SFLOAT, "VK_FORMAT_R64G64B64_SFLOAT", Anvil::COMPONENT_LAYOUT_RGB, 64, 64, 64, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {Anvil::Format::R64G64B64A64_UINT, "VK_FORMAT_R64G64B64A64_UINT", Anvil::COMPONENT_LAYOUT_RGBA, 64, 64, 64, 64, Anvil::FORMAT_TYPE_UINT, false}, + {Anvil::Format::R64G64B64A64_SINT, "VK_FORMAT_R64G64B64A64_SINT", Anvil::COMPONENT_LAYOUT_RGBA, 64, 64, 64, 64, Anvil::FORMAT_TYPE_SINT, false}, + {Anvil::Format::R64G64B64A64_SFLOAT, "VK_FORMAT_R64G64B64A64_SFLOAT", Anvil::COMPONENT_LAYOUT_RGBA, 64, 64, 64, 64, Anvil::FORMAT_TYPE_SFLOAT, false}, + {Anvil::Format::B10G11R11_UFLOAT_PACK32, "VK_FORMAT_B10G11R11_UFLOAT_PACK32", Anvil::COMPONENT_LAYOUT_BGR, 10, 11, 11, 0, Anvil::FORMAT_TYPE_UFLOAT, true}, + {Anvil::Format::E5B9G9R9_UFLOAT_PACK32, "VK_FORMAT_E5B9G9R9_UFLOAT_PACK32", Anvil::COMPONENT_LAYOUT_EBGR, 5, 9, 9, 9, Anvil::FORMAT_TYPE_UFLOAT, true}, + {Anvil::Format::D16_UNORM, "VK_FORMAT_D16_UNORM", Anvil::COMPONENT_LAYOUT_D, 16, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::X8_D24_UNORM_PACK32, "VK_FORMAT_X8_D24_UNORM_PACK32", Anvil::COMPONENT_LAYOUT_XD, 8, 24, 0, 0, Anvil::FORMAT_TYPE_UNORM, true}, + {Anvil::Format::D32_SFLOAT, "VK_FORMAT_D32_SFLOAT", Anvil::COMPONENT_LAYOUT_D, 32, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {Anvil::Format::S8_UINT, "VK_FORMAT_S8_UINT", Anvil::COMPONENT_LAYOUT_S, 8, 0, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, + {Anvil::Format::D16_UNORM_S8_UINT, "VK_FORMAT_D16_UNORM_S8_UINT", Anvil::COMPONENT_LAYOUT_DS, 16, 8, 0, 0, Anvil::FORMAT_TYPE_UNORM_UINT, false}, + {Anvil::Format::D24_UNORM_S8_UINT, "VK_FORMAT_D24_UNORM_S8_UINT", Anvil::COMPONENT_LAYOUT_DS, 24, 8, 0, 0, Anvil::FORMAT_TYPE_UNORM_UINT, false}, + {Anvil::Format::D32_SFLOAT_S8_UINT, "VK_FORMAT_D32_SFLOAT_S8_UINT", Anvil::COMPONENT_LAYOUT_DS, 32, 8, 0, 0, Anvil::FORMAT_TYPE_SFLOAT_UINT, false}, + {Anvil::Format::BC1_RGB_UNORM_BLOCK, "VK_FORMAT_BC1_RGB_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::BC1_RGB_SRGB_BLOCK, "VK_FORMAT_BC1_RGB_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::BC1_RGBA_UNORM_BLOCK, "VK_FORMAT_BC1_RGBA_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::BC1_RGBA_SRGB_BLOCK, "VK_FORMAT_BC1_RGBA_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::BC2_UNORM_BLOCK, "VK_FORMAT_BC2_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::BC2_SRGB_BLOCK, "VK_FORMAT_BC2_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::BC3_UNORM_BLOCK, "VK_FORMAT_BC3_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::BC3_SRGB_BLOCK, "VK_FORMAT_BC3_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::BC4_UNORM_BLOCK, "VK_FORMAT_BC4_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_R, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::BC4_SNORM_BLOCK, "VK_FORMAT_BC4_SNORM_BLOCK", Anvil::COMPONENT_LAYOUT_R, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {Anvil::Format::BC5_UNORM_BLOCK, "VK_FORMAT_BC5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RG, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::BC5_SNORM_BLOCK, "VK_FORMAT_BC5_SNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RG, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {Anvil::Format::BC6H_UFLOAT_BLOCK, "VK_FORMAT_BC6H_UFLOAT_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UFLOAT, false}, + {Anvil::Format::BC6H_SFLOAT_BLOCK, "VK_FORMAT_BC6H_SFLOAT_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, + {Anvil::Format::BC7_UNORM_BLOCK, "VK_FORMAT_BC7_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::BC7_SRGB_BLOCK, "VK_FORMAT_BC7_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::ETC2_R8G8B8_UNORM_BLOCK, "VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::ETC2_R8G8B8_SRGB_BLOCK, "VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::ETC2_R8G8B8A1_UNORM_BLOCK, "VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::ETC2_R8G8B8A1_SRGB_BLOCK, "VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::ETC2_R8G8B8A8_UNORM_BLOCK, "VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::ETC2_R8G8B8A8_SRGB_BLOCK, "VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::EAC_R11_UNORM_BLOCK, "VK_FORMAT_EAC_R11_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_R, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::EAC_R11_SNORM_BLOCK, "VK_FORMAT_EAC_R11_SNORM_BLOCK", Anvil::COMPONENT_LAYOUT_R, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {Anvil::Format::EAC_R11G11_UNORM_BLOCK, "VK_FORMAT_EAC_R11G11_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RG, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::EAC_R11G11_SNORM_BLOCK, "VK_FORMAT_EAC_R11G11_SNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RG, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, + {Anvil::Format::ASTC_4x4_UNORM_BLOCK, "VK_FORMAT_ASTC_4x4_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::ASTC_4x4_SRGB_BLOCK, "VK_FORMAT_ASTC_4x4_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::ASTC_5x4_UNORM_BLOCK, "VK_FORMAT_ASTC_5x4_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::ASTC_5x4_SRGB_BLOCK, "VK_FORMAT_ASTC_5x4_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::ASTC_5x5_UNORM_BLOCK, "VK_FORMAT_ASTC_5x5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::ASTC_5x5_SRGB_BLOCK, "VK_FORMAT_ASTC_5x5_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::ASTC_6x5_UNORM_BLOCK, "VK_FORMAT_ASTC_6x5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::ASTC_6x5_SRGB_BLOCK, "VK_FORMAT_ASTC_6x5_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::ASTC_6x6_UNORM_BLOCK, "VK_FORMAT_ASTC_6x6_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::ASTC_6x6_SRGB_BLOCK, "VK_FORMAT_ASTC_6x6_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::ASTC_8x5_UNORM_BLOCK, "VK_FORMAT_ASTC_8x5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::ASTC_8x5_SRGB_BLOCK, "VK_FORMAT_ASTC_8x5_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::ASTC_8x6_UNORM_BLOCK, "VK_FORMAT_ASTC_8x6_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::ASTC_8x6_SRGB_BLOCK, "VK_FORMAT_ASTC_8x6_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::ASTC_8x8_UNORM_BLOCK, "VK_FORMAT_ASTC_8x8_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::ASTC_8x8_SRGB_BLOCK, "VK_FORMAT_ASTC_8x8_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::ASTC_10x5_UNORM_BLOCK, "VK_FORMAT_ASTC_10x5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::ASTC_10x5_SRGB_BLOCK, "VK_FORMAT_ASTC_10x5_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::ASTC_10x6_UNORM_BLOCK, "VK_FORMAT_ASTC_10x6_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::ASTC_10x6_SRGB_BLOCK, "VK_FORMAT_ASTC_10x6_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::ASTC_10x8_UNORM_BLOCK, "VK_FORMAT_ASTC_10x8_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::ASTC_10x8_SRGB_BLOCK, "VK_FORMAT_ASTC_10x8_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::ASTC_10x10_UNORM_BLOCK, "VK_FORMAT_ASTC_10x10_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::ASTC_10x10_SRGB_BLOCK, "VK_FORMAT_ASTC_10x10_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::ASTC_12x10_UNORM_BLOCK, "VK_FORMAT_ASTC_12x10_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::ASTC_12x10_SRGB_BLOCK, "VK_FORMAT_ASTC_12x10_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, + {Anvil::Format::ASTC_12x12_UNORM_BLOCK, "VK_FORMAT_ASTC_12x12_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, + {Anvil::Format::ASTC_12x12_SRGB_BLOCK, "VK_FORMAT_ASTC_12x12_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false} }; static const struct { - VkFormat format; - uint32_t red_component_start_bit_index; - uint32_t red_component_last_bit_index; - uint32_t green_component_start_bit_index; - uint32_t green_component_last_bit_index; - uint32_t blue_component_start_bit_index; - uint32_t blue_component_last_bit_index; - uint32_t alpha_component_start_bit_index; - uint32_t alpha_component_last_bit_index; - uint32_t shared_component_start_bit_index; - uint32_t shared_component_last_bit_index; - uint32_t depth_component_start_bit_index; - uint32_t depth_component_last_bit_index; - uint32_t stencil_component_start_bit_index; - uint32_t stencil_component_last_bit_index; + Anvil::Format format; + uint32_t red_component_start_bit_index; + uint32_t red_component_last_bit_index; + uint32_t green_component_start_bit_index; + uint32_t green_component_last_bit_index; + uint32_t blue_component_start_bit_index; + uint32_t blue_component_last_bit_index; + uint32_t alpha_component_start_bit_index; + uint32_t alpha_component_last_bit_index; + uint32_t shared_component_start_bit_index; + uint32_t shared_component_last_bit_index; + uint32_t depth_component_start_bit_index; + uint32_t depth_component_last_bit_index; + uint32_t stencil_component_start_bit_index; + uint32_t stencil_component_last_bit_index; } g_format_bit_layout_info[] = { - /* format | red start | red end | green start | green end | blue start | blue end | alpha start | alpha end | shared_start | shared_end | depth start | depth end | stencil start | stencil end */ - {VK_FORMAT_UNDEFINED, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R4G4_UNORM_PACK8, 4, 7, 0, 3, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R4G4B4A4_UNORM_PACK16, 12, 15, 8, 11, 4, 7, 0, 3, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_B4G4R4A4_UNORM_PACK16, 4, 7, 8, 11, 12, 15, 0, 3, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R5G6B5_UNORM_PACK16, 11, 15, 5, 10, 0, 4, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_B5G6R5_UNORM_PACK16, 0, 4, 5, 10, 11, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R5G5B5A1_UNORM_PACK16, 11, 15, 6, 10, 1, 5, 0, 0, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_B5G5R5A1_UNORM_PACK16, 1, 5, 6, 10, 11, 15, 0, 0, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_A1R5G5B5_UNORM_PACK16, 10, 14, 5, 9, 0, 4, 15, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8_UNORM, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8_SNORM, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8_USCALED, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8_SSCALED, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8_UINT, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8_SINT, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8_SRGB, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8G8_UNORM, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8G8_SNORM, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8G8_USCALED, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8G8_SSCALED, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8G8_UINT, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8G8_SINT, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8G8_SRGB, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8G8B8_UNORM, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8G8B8_SNORM, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8G8B8_USCALED, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8G8B8_SSCALED, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8G8B8_UINT, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8G8B8_SINT, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8G8B8_SRGB, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_B8G8R8_UNORM, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_B8G8R8_SNORM, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_B8G8R8_USCALED, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_B8G8R8_SSCALED, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_B8G8R8_UINT, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_B8G8R8_SINT, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_B8G8R8_SRGB, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8G8B8A8_UNORM, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8G8B8A8_SNORM, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8G8B8A8_USCALED, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8G8B8A8_SSCALED, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8G8B8A8_UINT, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8G8B8A8_SINT, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R8G8B8A8_SRGB, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_B8G8R8A8_UNORM, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_B8G8R8A8_SNORM, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_B8G8R8A8_USCALED, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_B8G8R8A8_SSCALED, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_B8G8R8A8_UINT, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_B8G8R8A8_SINT, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_B8G8R8A8_SRGB, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_A8B8G8R8_UNORM_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_A8B8G8R8_SNORM_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_A8B8G8R8_USCALED_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_A8B8G8R8_SSCALED_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_A8B8G8R8_UINT_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_A8B8G8R8_SINT_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_A8B8G8R8_SRGB_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_A2R10G10B10_UNORM_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_A2R10G10B10_SNORM_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_A2R10G10B10_USCALED_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_A2R10G10B10_SSCALED_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_A2R10G10B10_UINT_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_A2R10G10B10_SINT_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_A2B10G10R10_UNORM_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_A2B10G10R10_SNORM_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_A2B10G10R10_USCALED_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_A2B10G10R10_SSCALED_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_A2B10G10R10_UINT_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_A2B10G10R10_SINT_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16_UNORM, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16_SNORM, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16_USCALED, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16_SSCALED, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16_UINT, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16_SINT, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16_SFLOAT, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16G16_UNORM, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16G16_SNORM, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16G16_USCALED, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16G16_SSCALED, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16G16_UINT, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16G16_SINT, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16G16_SFLOAT, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16G16B16_UNORM, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16G16B16_SNORM, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16G16B16_USCALED, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16G16B16_SSCALED, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16G16B16_UINT, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16G16B16_SINT, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16G16B16_SFLOAT, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16G16B16A16_UNORM, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16G16B16A16_SNORM, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16G16B16A16_USCALED, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16G16B16A16_SSCALED, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16G16B16A16_UINT, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16G16B16A16_SINT, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R16G16B16A16_SFLOAT, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R32_UINT, 0, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R32_SINT, 0, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R32_SFLOAT, 0, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R32G32_UINT, 0, 31, 32, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R32G32_SINT, 0, 31, 32, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R32G32_SFLOAT, 0, 31, 32, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R32G32B32_UINT, 0, 31, 32, 63, 64, 95, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R32G32B32_SINT, 0, 31, 32, 63, 64, 95, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R32G32B32_SFLOAT, 0, 31, 32, 63, 64, 95, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R32G32B32A32_UINT, 0, 31, 32, 63, 64, 95, 96, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R32G32B32A32_SINT, 0, 31, 32, 63, 64, 95, 96, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R32G32B32A32_SFLOAT, 0, 31, 32, 63, 64, 95, 96, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R64_UINT, 0, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R64_SINT, 0, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R64_SFLOAT, 0, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R64G64_UINT, 0, 63, 64, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R64G64_SINT, 0, 63, 64, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R64G64_SFLOAT, 0, 63, 64, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R64G64B64_UINT, 0, 63, 64, 127, 128, 191, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R64G64B64_SINT, 0, 63, 64, 127, 128, 191, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R64G64B64_SFLOAT, 0, 63, 64, 127, 128, 191, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R64G64B64A64_UINT, 0, 63, 64, 127, 128, 191, 192, 255, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R64G64B64A64_SINT, 0, 63, 64, 127, 128, 191, 192, 255, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_R64G64B64A64_SFLOAT, 0, 63, 64, 127, 128, 191, 192, 255, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_B10G11R11_UFLOAT_PACK32, 0, 10, 11, 21, 22, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, 0, 8, 9, 17, 18, 26, UINT32_MAX, UINT32_MAX, 27, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_D16_UNORM, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 15, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_X8_D24_UNORM_PACK32, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 23, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_D32_SFLOAT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 31, UINT32_MAX, UINT32_MAX}, - {VK_FORMAT_S8_UINT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 7}, - {VK_FORMAT_D16_UNORM_S8_UINT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 15, 16, 23}, - {VK_FORMAT_D24_UNORM_S8_UINT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 23, 24, 31}, - {VK_FORMAT_D32_SFLOAT_S8_UINT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 31, 32, 39}, + /* format | red start | red end | green start | green end | blue start | blue end | alpha start | alpha end | shared_start | shared_end | depth start | depth end | stencil start | stencil end */ + {Anvil::Format::UNKNOWN, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R4G4_UNORM_PACK8, 4, 7, 0, 3, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R4G4B4A4_UNORM_PACK16, 12, 15, 8, 11, 4, 7, 0, 3, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::B4G4R4A4_UNORM_PACK16, 4, 7, 8, 11, 12, 15, 0, 3, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R5G6B5_UNORM_PACK16, 11, 15, 5, 10, 0, 4, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::B5G6R5_UNORM_PACK16, 0, 4, 5, 10, 11, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R5G5B5A1_UNORM_PACK16, 11, 15, 6, 10, 1, 5, 0, 0, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::B5G5R5A1_UNORM_PACK16, 1, 5, 6, 10, 11, 15, 0, 0, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::A1R5G5B5_UNORM_PACK16, 10, 14, 5, 9, 0, 4, 15, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8_UNORM, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8_SNORM, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8_USCALED, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8_SSCALED, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8_UINT, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8_SINT, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8_SRGB, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8G8_UNORM, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8G8_SNORM, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8G8_USCALED, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8G8_SSCALED, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8G8_UINT, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8G8_SINT, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8G8_SRGB, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8G8B8_UNORM, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8G8B8_SNORM, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8G8B8_USCALED, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8G8B8_SSCALED, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8G8B8_UINT, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8G8B8_SINT, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8G8B8_SRGB, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::B8G8R8_UNORM, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::B8G8R8_SNORM, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::B8G8R8_USCALED, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::B8G8R8_SSCALED, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::B8G8R8_UINT, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::B8G8R8_SINT, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::B8G8R8_SRGB, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8G8B8A8_UNORM, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8G8B8A8_SNORM, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8G8B8A8_USCALED, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8G8B8A8_SSCALED, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8G8B8A8_UINT, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8G8B8A8_SINT, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R8G8B8A8_SRGB, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::B8G8R8A8_UNORM, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::B8G8R8A8_SNORM, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::B8G8R8A8_USCALED, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::B8G8R8A8_SSCALED, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::B8G8R8A8_UINT, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::B8G8R8A8_SINT, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::B8G8R8A8_SRGB, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::A8B8G8R8_UNORM_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::A8B8G8R8_SNORM_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::A8B8G8R8_USCALED_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::A8B8G8R8_SSCALED_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::A8B8G8R8_UINT_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::A8B8G8R8_SINT_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::A8B8G8R8_SRGB_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::A2R10G10B10_UNORM_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::A2R10G10B10_SNORM_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::A2R10G10B10_USCALED_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::A2R10G10B10_SSCALED_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::A2R10G10B10_UINT_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::A2R10G10B10_SINT_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::A2B10G10R10_UNORM_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::A2B10G10R10_SNORM_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::A2B10G10R10_USCALED_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::A2B10G10R10_SSCALED_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::A2B10G10R10_UINT_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::A2B10G10R10_SINT_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16_UNORM, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16_SNORM, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16_USCALED, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16_SSCALED, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16_UINT, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16_SINT, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16_SFLOAT, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16G16_UNORM, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16G16_SNORM, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16G16_USCALED, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16G16_SSCALED, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16G16_UINT, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16G16_SINT, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16G16_SFLOAT, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16G16B16_UNORM, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16G16B16_SNORM, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16G16B16_USCALED, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16G16B16_SSCALED, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16G16B16_UINT, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16G16B16_SINT, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16G16B16_SFLOAT, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16G16B16A16_UNORM, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16G16B16A16_SNORM, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16G16B16A16_USCALED, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16G16B16A16_SSCALED, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16G16B16A16_UINT, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16G16B16A16_SINT, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R16G16B16A16_SFLOAT, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R32_UINT, 0, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R32_SINT, 0, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R32_SFLOAT, 0, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R32G32_UINT, 0, 31, 32, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R32G32_SINT, 0, 31, 32, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R32G32_SFLOAT, 0, 31, 32, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R32G32B32_UINT, 0, 31, 32, 63, 64, 95, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R32G32B32_SINT, 0, 31, 32, 63, 64, 95, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R32G32B32_SFLOAT, 0, 31, 32, 63, 64, 95, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R32G32B32A32_UINT, 0, 31, 32, 63, 64, 95, 96, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R32G32B32A32_SINT, 0, 31, 32, 63, 64, 95, 96, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R32G32B32A32_SFLOAT, 0, 31, 32, 63, 64, 95, 96, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R64_UINT, 0, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R64_SINT, 0, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R64_SFLOAT, 0, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R64G64_UINT, 0, 63, 64, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R64G64_SINT, 0, 63, 64, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R64G64_SFLOAT, 0, 63, 64, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R64G64B64_UINT, 0, 63, 64, 127, 128, 191, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R64G64B64_SINT, 0, 63, 64, 127, 128, 191, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R64G64B64_SFLOAT, 0, 63, 64, 127, 128, 191, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R64G64B64A64_UINT, 0, 63, 64, 127, 128, 191, 192, 255, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R64G64B64A64_SINT, 0, 63, 64, 127, 128, 191, 192, 255, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::R64G64B64A64_SFLOAT, 0, 63, 64, 127, 128, 191, 192, 255, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::B10G11R11_UFLOAT_PACK32, 0, 10, 11, 21, 22, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::E5B9G9R9_UFLOAT_PACK32, 0, 8, 9, 17, 18, 26, UINT32_MAX, UINT32_MAX, 27, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::D16_UNORM, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 15, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::X8_D24_UNORM_PACK32, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 23, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::D32_SFLOAT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 31, UINT32_MAX, UINT32_MAX}, + {Anvil::Format::S8_UINT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 7}, + {Anvil::Format::D16_UNORM_S8_UINT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 15, 16, 23}, + {Anvil::Format::D24_UNORM_S8_UINT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 23, 24, 31}, + {Anvil::Format::D32_SFLOAT_S8_UINT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 31, 32, 39}, }; -static uint32_t layout_to_n_components[] = +static uint32_t g_layout_to_n_components[] = { /* COMPONENT_LAYOUT_ABGR */ 4, @@ -416,30 +416,30 @@ static uint32_t layout_to_n_components[] = }; /** Please see header for specification */ -bool Anvil::Formats::get_compressed_format_block_size(VkFormat in_format, - uint32_t* out_block_size_uvec2_ptr, - uint32_t* out_n_bytes_per_block_ptr) +bool Anvil::Formats::get_compressed_format_block_size(Anvil::Format in_format, + uint32_t* out_block_size_uvec2_ptr, + uint32_t* out_n_bytes_per_block_ptr) { bool result = true; switch (in_format) { - case VK_FORMAT_ASTC_4x4_UNORM_BLOCK: - case VK_FORMAT_ASTC_4x4_SRGB_BLOCK: - case VK_FORMAT_BC2_UNORM_BLOCK: - case VK_FORMAT_BC2_SRGB_BLOCK: - case VK_FORMAT_BC3_UNORM_BLOCK: - case VK_FORMAT_BC3_SRGB_BLOCK: - case VK_FORMAT_BC5_UNORM_BLOCK: - case VK_FORMAT_BC5_SNORM_BLOCK: - case VK_FORMAT_BC6H_UFLOAT_BLOCK: - case VK_FORMAT_BC6H_SFLOAT_BLOCK: - case VK_FORMAT_BC7_UNORM_BLOCK: - case VK_FORMAT_BC7_SRGB_BLOCK: - case VK_FORMAT_EAC_R11G11_UNORM_BLOCK: - case VK_FORMAT_EAC_R11G11_SNORM_BLOCK: - case VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK: - case VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK: + case Anvil::Format::ASTC_4x4_UNORM_BLOCK: + case Anvil::Format::ASTC_4x4_SRGB_BLOCK: + case Anvil::Format::BC2_UNORM_BLOCK: + case Anvil::Format::BC2_SRGB_BLOCK: + case Anvil::Format::BC3_UNORM_BLOCK: + case Anvil::Format::BC3_SRGB_BLOCK: + case Anvil::Format::BC5_UNORM_BLOCK: + case Anvil::Format::BC5_SNORM_BLOCK: + case Anvil::Format::BC6H_UFLOAT_BLOCK: + case Anvil::Format::BC6H_SFLOAT_BLOCK: + case Anvil::Format::BC7_UNORM_BLOCK: + case Anvil::Format::BC7_SRGB_BLOCK: + case Anvil::Format::EAC_R11G11_UNORM_BLOCK: + case Anvil::Format::EAC_R11G11_SNORM_BLOCK: + case Anvil::Format::ETC2_R8G8B8A8_UNORM_BLOCK: + case Anvil::Format::ETC2_R8G8B8A8_SRGB_BLOCK: { out_block_size_uvec2_ptr[0] = 4; out_block_size_uvec2_ptr[1] = 4; @@ -448,18 +448,18 @@ bool Anvil::Formats::get_compressed_format_block_size(VkFormat in_format, break; } - case VK_FORMAT_BC1_RGB_UNORM_BLOCK: - case VK_FORMAT_BC1_RGB_SRGB_BLOCK: - case VK_FORMAT_BC1_RGBA_UNORM_BLOCK: - case VK_FORMAT_BC1_RGBA_SRGB_BLOCK: - case VK_FORMAT_BC4_UNORM_BLOCK: - case VK_FORMAT_BC4_SNORM_BLOCK: - case VK_FORMAT_EAC_R11_UNORM_BLOCK: - case VK_FORMAT_EAC_R11_SNORM_BLOCK: - case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK: - case VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK: - case VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK: - case VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK: + case Anvil::Format::BC1_RGB_UNORM_BLOCK: + case Anvil::Format::BC1_RGB_SRGB_BLOCK: + case Anvil::Format::BC1_RGBA_UNORM_BLOCK: + case Anvil::Format::BC1_RGBA_SRGB_BLOCK: + case Anvil::Format::BC4_UNORM_BLOCK: + case Anvil::Format::BC4_SNORM_BLOCK: + case Anvil::Format::EAC_R11_UNORM_BLOCK: + case Anvil::Format::EAC_R11_SNORM_BLOCK: + case Anvil::Format::ETC2_R8G8B8_UNORM_BLOCK: + case Anvil::Format::ETC2_R8G8B8_SRGB_BLOCK: + case Anvil::Format::ETC2_R8G8B8A1_UNORM_BLOCK: + case Anvil::Format::ETC2_R8G8B8A1_SRGB_BLOCK: { out_block_size_uvec2_ptr[0] = 4; out_block_size_uvec2_ptr[1] = 4; @@ -468,8 +468,8 @@ bool Anvil::Formats::get_compressed_format_block_size(VkFormat in_format, break; } - case VK_FORMAT_ASTC_5x4_UNORM_BLOCK: - case VK_FORMAT_ASTC_5x4_SRGB_BLOCK: + case Anvil::Format::ASTC_5x4_UNORM_BLOCK: + case Anvil::Format::ASTC_5x4_SRGB_BLOCK: { out_block_size_uvec2_ptr[0] = 5; out_block_size_uvec2_ptr[1] = 4; @@ -478,8 +478,8 @@ bool Anvil::Formats::get_compressed_format_block_size(VkFormat in_format, break; } - case VK_FORMAT_ASTC_5x5_UNORM_BLOCK: - case VK_FORMAT_ASTC_5x5_SRGB_BLOCK: + case Anvil::Format::ASTC_5x5_UNORM_BLOCK: + case Anvil::Format::ASTC_5x5_SRGB_BLOCK: { out_block_size_uvec2_ptr[0] = 5; out_block_size_uvec2_ptr[1] = 5; @@ -488,8 +488,8 @@ bool Anvil::Formats::get_compressed_format_block_size(VkFormat in_format, break; } - case VK_FORMAT_ASTC_6x5_UNORM_BLOCK: - case VK_FORMAT_ASTC_6x5_SRGB_BLOCK: + case Anvil::Format::ASTC_6x5_UNORM_BLOCK: + case Anvil::Format::ASTC_6x5_SRGB_BLOCK: { out_block_size_uvec2_ptr[0] = 6; out_block_size_uvec2_ptr[1] = 5; @@ -498,8 +498,8 @@ bool Anvil::Formats::get_compressed_format_block_size(VkFormat in_format, break; } - case VK_FORMAT_ASTC_6x6_UNORM_BLOCK: - case VK_FORMAT_ASTC_6x6_SRGB_BLOCK: + case Anvil::Format::ASTC_6x6_UNORM_BLOCK: + case Anvil::Format::ASTC_6x6_SRGB_BLOCK: { out_block_size_uvec2_ptr[0] = 6; out_block_size_uvec2_ptr[1] = 6; @@ -508,8 +508,8 @@ bool Anvil::Formats::get_compressed_format_block_size(VkFormat in_format, break; } - case VK_FORMAT_ASTC_8x5_UNORM_BLOCK: - case VK_FORMAT_ASTC_8x5_SRGB_BLOCK: + case Anvil::Format::ASTC_8x5_UNORM_BLOCK: + case Anvil::Format::ASTC_8x5_SRGB_BLOCK: { out_block_size_uvec2_ptr[0] = 8; out_block_size_uvec2_ptr[1] = 5; @@ -518,8 +518,8 @@ bool Anvil::Formats::get_compressed_format_block_size(VkFormat in_format, break; } - case VK_FORMAT_ASTC_8x6_UNORM_BLOCK: - case VK_FORMAT_ASTC_8x6_SRGB_BLOCK: + case Anvil::Format::ASTC_8x6_UNORM_BLOCK: + case Anvil::Format::ASTC_8x6_SRGB_BLOCK: { out_block_size_uvec2_ptr[0] = 8; out_block_size_uvec2_ptr[1] = 6; @@ -528,8 +528,8 @@ bool Anvil::Formats::get_compressed_format_block_size(VkFormat in_format, break; } - case VK_FORMAT_ASTC_8x8_UNORM_BLOCK: - case VK_FORMAT_ASTC_8x8_SRGB_BLOCK: + case Anvil::Format::ASTC_8x8_UNORM_BLOCK: + case Anvil::Format::ASTC_8x8_SRGB_BLOCK: { out_block_size_uvec2_ptr[0] = 8; out_block_size_uvec2_ptr[1] = 8; @@ -538,8 +538,8 @@ bool Anvil::Formats::get_compressed_format_block_size(VkFormat in_format, break; } - case VK_FORMAT_ASTC_10x5_UNORM_BLOCK: - case VK_FORMAT_ASTC_10x5_SRGB_BLOCK: + case Anvil::Format::ASTC_10x5_UNORM_BLOCK: + case Anvil::Format::ASTC_10x5_SRGB_BLOCK: { out_block_size_uvec2_ptr[0] = 10; out_block_size_uvec2_ptr[1] = 5; @@ -548,8 +548,8 @@ bool Anvil::Formats::get_compressed_format_block_size(VkFormat in_format, break; } - case VK_FORMAT_ASTC_10x6_UNORM_BLOCK: - case VK_FORMAT_ASTC_10x6_SRGB_BLOCK: + case Anvil::Format::ASTC_10x6_UNORM_BLOCK: + case Anvil::Format::ASTC_10x6_SRGB_BLOCK: { out_block_size_uvec2_ptr[0] = 10; out_block_size_uvec2_ptr[1] = 6; @@ -558,8 +558,8 @@ bool Anvil::Formats::get_compressed_format_block_size(VkFormat in_format, break; } - case VK_FORMAT_ASTC_10x8_UNORM_BLOCK: - case VK_FORMAT_ASTC_10x8_SRGB_BLOCK: + case Anvil::Format::ASTC_10x8_UNORM_BLOCK: + case Anvil::Format::ASTC_10x8_SRGB_BLOCK: { out_block_size_uvec2_ptr[0] = 10; out_block_size_uvec2_ptr[1] = 8; @@ -568,8 +568,8 @@ bool Anvil::Formats::get_compressed_format_block_size(VkFormat in_format, break; } - case VK_FORMAT_ASTC_10x10_UNORM_BLOCK: - case VK_FORMAT_ASTC_10x10_SRGB_BLOCK: + case Anvil::Format::ASTC_10x10_UNORM_BLOCK: + case Anvil::Format::ASTC_10x10_SRGB_BLOCK: { out_block_size_uvec2_ptr[0] = 10; out_block_size_uvec2_ptr[1] = 10; @@ -578,8 +578,8 @@ bool Anvil::Formats::get_compressed_format_block_size(VkFormat in_format, break; } - case VK_FORMAT_ASTC_12x10_UNORM_BLOCK: - case VK_FORMAT_ASTC_12x10_SRGB_BLOCK: + case Anvil::Format::ASTC_12x10_UNORM_BLOCK: + case Anvil::Format::ASTC_12x10_SRGB_BLOCK: { out_block_size_uvec2_ptr[0] = 12; out_block_size_uvec2_ptr[1] = 10; @@ -588,8 +588,8 @@ bool Anvil::Formats::get_compressed_format_block_size(VkFormat in_format, break; } - case VK_FORMAT_ASTC_12x12_UNORM_BLOCK: - case VK_FORMAT_ASTC_12x12_SRGB_BLOCK: + case Anvil::Format::ASTC_12x12_UNORM_BLOCK: + case Anvil::Format::ASTC_12x12_SRGB_BLOCK: { out_block_size_uvec2_ptr[0] = 12; out_block_size_uvec2_ptr[1] = 12; @@ -608,15 +608,15 @@ bool Anvil::Formats::get_compressed_format_block_size(VkFormat in_format, } /** Please see header for specification */ -VkFormat Anvil::Formats::get_format(ComponentLayout in_component_layout, - FormatType in_format_type, - uint32_t in_n_component0_bits, - uint32_t in_n_component1_bits, - uint32_t in_n_component2_bits, - uint32_t in_n_component3_bits) +Anvil::Format Anvil::Formats::get_format(ComponentLayout in_component_layout, + FormatType in_format_type, + uint32_t in_n_component0_bits, + uint32_t in_n_component1_bits, + uint32_t in_n_component2_bits, + uint32_t in_n_component3_bits) { static const uint32_t n_available_formats = sizeof(g_formats) / sizeof(g_formats[0]); - VkFormat result = VK_FORMAT_UNDEFINED; + Anvil::Format result = Anvil::Format::UNKNOWN; for (uint32_t n_format = 0; n_format < n_available_formats; @@ -641,8 +641,8 @@ VkFormat Anvil::Formats::get_format(ComponentLayout in_component_layout, } /** Please see header for specification */ -bool Anvil::Formats::get_format_aspects(VkFormat in_format, - std::vector* out_aspects_ptr) +bool Anvil::Formats::get_format_aspects(Anvil::Format in_format, + std::vector* out_aspects_ptr) { bool result = false; @@ -662,20 +662,20 @@ bool Anvil::Formats::get_format_aspects(VkFormat in_form format_layout == Anvil::COMPONENT_LAYOUT_RGB || format_layout == Anvil::COMPONENT_LAYOUT_RGBA) { - out_aspects_ptr->push_back(VK_IMAGE_ASPECT_COLOR_BIT); + out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_COLOR_BIT); } if (format_layout == Anvil::COMPONENT_LAYOUT_D || format_layout == Anvil::COMPONENT_LAYOUT_DS || format_layout == Anvil::COMPONENT_LAYOUT_XD) { - out_aspects_ptr->push_back(VK_IMAGE_ASPECT_DEPTH_BIT); + out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_DEPTH_BIT); } if (format_layout == Anvil::COMPONENT_LAYOUT_DS || format_layout == Anvil::COMPONENT_LAYOUT_S) { - out_aspects_ptr->push_back(VK_IMAGE_ASPECT_STENCIL_BIT); + out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_STENCIL_BIT); } } @@ -684,26 +684,26 @@ bool Anvil::Formats::get_format_aspects(VkFormat in_form } /** Please see header for specification */ -void Anvil::Formats::get_format_bit_layout(VkFormat in_format, - uint32_t* out_opt_red_component_start_bit_index_ptr, - uint32_t* out_opt_red_component_end_bit_index_ptr, - uint32_t* out_opt_green_component_start_bit_index_ptr, - uint32_t* out_opt_green_component_end_bit_index_ptr, - uint32_t* out_opt_blue_component_start_bit_index_ptr, - uint32_t* out_opt_blue_component_end_bit_index_ptr, - uint32_t* out_opt_alpha_component_start_bit_index_ptr, - uint32_t* out_opt_alpha_component_end_bit_index_ptr, - uint32_t* out_opt_shared_component_start_bit_index_ptr, - uint32_t* out_opt_shared_component_end_bit_index_ptr, - uint32_t* out_opt_depth_component_start_bit_index_ptr, - uint32_t* out_opt_depth_component_end_bit_index_ptr, - uint32_t* out_opt_stencil_component_start_bit_index_ptr, - uint32_t* out_opt_stencil_component_end_bit_index_ptr) +void Anvil::Formats::get_format_bit_layout(Anvil::Format in_format, + uint32_t* out_opt_red_component_start_bit_index_ptr, + uint32_t* out_opt_red_component_end_bit_index_ptr, + uint32_t* out_opt_green_component_start_bit_index_ptr, + uint32_t* out_opt_green_component_end_bit_index_ptr, + uint32_t* out_opt_blue_component_start_bit_index_ptr, + uint32_t* out_opt_blue_component_end_bit_index_ptr, + uint32_t* out_opt_alpha_component_start_bit_index_ptr, + uint32_t* out_opt_alpha_component_end_bit_index_ptr, + uint32_t* out_opt_shared_component_start_bit_index_ptr, + uint32_t* out_opt_shared_component_end_bit_index_ptr, + uint32_t* out_opt_depth_component_start_bit_index_ptr, + uint32_t* out_opt_depth_component_end_bit_index_ptr, + uint32_t* out_opt_stencil_component_start_bit_index_ptr, + uint32_t* out_opt_stencil_component_end_bit_index_ptr) { - anvil_assert(sizeof(g_format_bit_layout_info) / sizeof(g_format_bit_layout_info[0]) > in_format); - anvil_assert(g_format_bit_layout_info[in_format].format == in_format); + anvil_assert(sizeof(g_format_bit_layout_info) / sizeof(g_format_bit_layout_info[0]) > static_cast(in_format) ); + anvil_assert(g_format_bit_layout_info[static_cast(in_format)].format == in_format); - const auto& format_info = g_format_bit_layout_info[in_format]; + const auto& format_info = g_format_bit_layout_info[static_cast(in_format)]; if (out_opt_red_component_start_bit_index_ptr != nullptr) { @@ -777,35 +777,34 @@ void Anvil::Formats::get_format_bit_layout(VkFormat in_format, } /** Please see header for specification */ -Anvil::ComponentLayout Anvil::Formats::get_format_component_layout(VkFormat in_format) +Anvil::ComponentLayout Anvil::Formats::get_format_component_layout(Anvil::Format in_format) { static_assert(sizeof(g_formats) / sizeof(g_formats[0]) == VK_FORMAT_RANGE_SIZE, ""); + anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE); - anvil_assert(in_format < VK_FORMAT_RANGE_SIZE); - - return g_formats[in_format].component_layout; + return g_formats[static_cast(in_format)].component_layout; } /** Please see header for specification */ -uint32_t Anvil::Formats::get_format_n_components(VkFormat in_format) +uint32_t Anvil::Formats::get_format_n_components(Anvil::Format in_format) { - anvil_assert(in_format < VK_FORMAT_RANGE_SIZE); + anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE); - return layout_to_n_components[g_formats[in_format].component_layout]; + return g_layout_to_n_components[g_formats[static_cast(in_format)].component_layout]; } /** Please see header for specification */ -void Anvil::Formats::get_format_n_component_bits(VkFormat in_format, - uint32_t* out_channel0_bits_ptr, - uint32_t* out_channel1_bits_ptr, - uint32_t* out_channel2_bits_ptr, - uint32_t* out_channel3_bits_ptr) +void Anvil::Formats::get_format_n_component_bits(Anvil::Format in_format, + uint32_t* out_channel0_bits_ptr, + uint32_t* out_channel1_bits_ptr, + uint32_t* out_channel2_bits_ptr, + uint32_t* out_channel3_bits_ptr) { const FormatInfo* format_props_ptr = nullptr; - anvil_assert(in_format < VK_FORMAT_RANGE_SIZE); + anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE); - format_props_ptr = g_formats + in_format; + format_props_ptr = g_formats + static_cast(in_format); *out_channel0_bits_ptr = format_props_ptr->component_bits[0]; *out_channel1_bits_ptr = format_props_ptr->component_bits[1]; @@ -814,51 +813,51 @@ void Anvil::Formats::get_format_n_component_bits(VkFormat in_format, } /** Please see header for specification */ -const char* Anvil::Formats::get_format_name(VkFormat in_format) +const char* Anvil::Formats::get_format_name(Anvil::Format in_format) { - anvil_assert(in_format < VK_FORMAT_RANGE_SIZE); + anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE); - return g_formats[in_format].name; + return g_formats[static_cast(in_format)].name; } /** Please see header for specification */ -Anvil::FormatType Anvil::Formats::get_format_type(VkFormat in_format) +Anvil::FormatType Anvil::Formats::get_format_type(Anvil::Format in_format) { - anvil_assert(in_format < VK_FORMAT_RANGE_SIZE); + anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE); - return g_formats[in_format].format_type; + return g_formats[static_cast(in_format)].format_type; } /** Please see header for specification */ -bool Anvil::Formats::has_depth_aspect(VkFormat in_format) +bool Anvil::Formats::has_depth_aspect(Anvil::Format in_format) { - return (g_formats[in_format].component_layout == Anvil::COMPONENT_LAYOUT_D) || - (g_formats[in_format].component_layout == Anvil::COMPONENT_LAYOUT_DS) || - (g_formats[in_format].component_layout == Anvil::COMPONENT_LAYOUT_XD); + return (g_formats[static_cast(in_format)].component_layout == Anvil::COMPONENT_LAYOUT_D) || + (g_formats[static_cast(in_format)].component_layout == Anvil::COMPONENT_LAYOUT_DS) || + (g_formats[static_cast(in_format)].component_layout == Anvil::COMPONENT_LAYOUT_XD); } /** Please see header for specification */ -bool Anvil::Formats::has_stencil_aspect(VkFormat in_format) +bool Anvil::Formats::has_stencil_aspect(Anvil::Format in_format) { - return (g_formats[in_format].component_layout == Anvil::COMPONENT_LAYOUT_S) || - (g_formats[in_format].component_layout == Anvil::COMPONENT_LAYOUT_DS); + return (g_formats[static_cast(in_format)].component_layout == Anvil::COMPONENT_LAYOUT_S) || + (g_formats[static_cast(in_format)].component_layout == Anvil::COMPONENT_LAYOUT_DS); } /** Please see header for specification */ -bool Anvil::Formats::is_format_compressed(VkFormat in_format) +bool Anvil::Formats::is_format_compressed(Anvil::Format in_format) { - anvil_assert(in_format < VK_FORMAT_RANGE_SIZE); + anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE); - return (g_formats[in_format].component_bits[0] == g_formats[in_format].component_bits[1]) && - (g_formats[in_format].component_bits[1] == g_formats[in_format].component_bits[2]) && - (g_formats[in_format].component_bits[2] == g_formats[in_format].component_bits[3]) && - (g_formats[in_format].component_bits[0] == 0); + return (g_formats[static_cast(in_format)].component_bits[0] == g_formats[static_cast(in_format)].component_bits[1]) && + (g_formats[static_cast(in_format)].component_bits[1] == g_formats[static_cast(in_format)].component_bits[2]) && + (g_formats[static_cast(in_format)].component_bits[2] == g_formats[static_cast(in_format)].component_bits[3]) && + (g_formats[static_cast(in_format)].component_bits[0] == 0); } /** Please see header for specification */ -bool Anvil::Formats::is_format_packed(VkFormat in_format) +bool Anvil::Formats::is_format_packed(Anvil::Format in_format) { - anvil_assert(in_format < VK_FORMAT_RANGE_SIZE); + anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE); - return g_formats[in_format].is_packed; -} + return g_formats[static_cast(in_format)].is_packed; +} \ No newline at end of file diff --git a/src/misc/glsl_to_spirv.cpp b/src/misc/glsl_to_spirv.cpp index 1f4c2446..156b702e 100644 --- a/src/misc/glsl_to_spirv.cpp +++ b/src/misc/glsl_to_spirv.cpp @@ -102,22 +102,22 @@ const SampleCountToSamplesData& current_item = conversion_items[n_conversion_item]; int32_t result = 1; - if (current_item.sample_count & VK_SAMPLE_COUNT_16_BIT) + if (current_item.sample_count & Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_16_BIT) { result = 16; } else - if (current_item.sample_count & VK_SAMPLE_COUNT_8_BIT) + if (current_item.sample_count & Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_8_BIT) { result = 8; } else - if (current_item.sample_count & VK_SAMPLE_COUNT_4_BIT) + if (current_item.sample_count & Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_4_BIT) { result = 4; } else - if (current_item.sample_count & VK_SAMPLE_COUNT_2_BIT) + if (current_item.sample_count & Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_2_BIT) { result = 2; } diff --git a/src/misc/graphics_pipeline_create_info.cpp b/src/misc/graphics_pipeline_create_info.cpp index e23819dc..21a392cf 100644 --- a/src/misc/graphics_pipeline_create_info.cpp +++ b/src/misc/graphics_pipeline_create_info.cpp @@ -20,35 +20,38 @@ // THE SOFTWARE. // #include "misc/graphics_pipeline_create_info.h" +#include "misc/render_pass_create_info.h" +#include "wrappers/device.h" +#include "wrappers/render_pass.h" Anvil::GraphicsPipelineCreateInfo::GraphicsPipelineCreateInfo(const RenderPass* in_renderpass_ptr, SubPassID in_subpass_id) { - m_alpha_to_coverage_enabled = false; - m_alpha_to_one_enabled = false; - m_depth_bias_clamp = 0.0f; - m_depth_bias_constant_factor = 0.0f; - m_depth_bias_enabled = false; - m_depth_bias_slope_factor = 1.0f; - m_depth_bounds_test_enabled = false; - m_depth_clamp_enabled = false; - m_depth_test_compare_op = VK_COMPARE_OP_ALWAYS; - m_depth_test_enabled = false; - m_depth_writes_enabled = false; - m_enabled_dynamic_states = 0; - m_front_face = VK_FRONT_FACE_COUNTER_CLOCKWISE; - m_logic_op = VK_LOGIC_OP_NO_OP; - m_logic_op_enabled = false; - m_max_depth_bounds = 1.0f; - m_min_depth_bounds = 0.0f; - m_n_dynamic_scissor_boxes = 0; - m_n_dynamic_viewports = 0; - m_n_patch_control_points = 1; - m_primitive_restart_enabled = false; - m_rasterizer_discard_enabled = false; - m_sample_mask_enabled = false; - m_sample_shading_enabled = false; - m_stencil_test_enabled = false; + m_alpha_to_coverage_enabled = false; + m_alpha_to_one_enabled = false; + m_depth_bias_clamp = 0.0f; + m_depth_bias_constant_factor = 0.0f; + m_depth_bias_enabled = false; + m_depth_bias_slope_factor = 1.0f; + m_depth_bounds_test_enabled = false; + m_depth_clamp_enabled = false; + m_depth_test_compare_op = VK_COMPARE_OP_ALWAYS; + m_depth_test_enabled = false; + m_depth_writes_enabled = false; + m_enabled_dynamic_states = 0; + m_front_face = VK_FRONT_FACE_COUNTER_CLOCKWISE; + m_logic_op = VK_LOGIC_OP_NO_OP; + m_logic_op_enabled = false; + m_max_depth_bounds = 1.0f; + m_min_depth_bounds = 0.0f; + m_n_dynamic_scissor_boxes = 0; + m_n_dynamic_viewports = 0; + m_n_patch_control_points = 1; + m_primitive_restart_enabled = false; + m_rasterizer_discard_enabled = false; + m_sample_mask_enabled = false; + m_sample_shading_enabled = false; + m_stencil_test_enabled = false; m_renderpass_ptr = in_renderpass_ptr; m_subpass_id = in_subpass_id; @@ -71,10 +74,12 @@ Anvil::GraphicsPipelineCreateInfo::GraphicsPipelineCreateInfo(const RenderPass* m_cull_mode = VK_CULL_MODE_BACK_BIT; m_line_width = 1.0f; m_min_sample_shading = 1.0f; - m_sample_count = VK_SAMPLE_COUNT_1_BIT; + m_sample_count = Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT; m_polygon_mode = VK_POLYGON_MODE_FILL; m_primitive_topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; m_sample_mask = ~0u; + + m_tessellation_domain_origin = Anvil::TessellationDomainOrigin::UPPER_LEFT; } Anvil::GraphicsPipelineCreateInfo::~GraphicsPipelineCreateInfo() @@ -83,7 +88,7 @@ Anvil::GraphicsPipelineCreateInfo::~GraphicsPipelineCreateInfo() } bool Anvil::GraphicsPipelineCreateInfo::add_vertex_attribute(uint32_t in_location, - VkFormat in_format, + Anvil::Format in_format, uint32_t in_offset_in_bytes, uint32_t in_stride_in_bytes, VkVertexInputRate in_step_rate, @@ -159,27 +164,29 @@ bool Anvil::GraphicsPipelineCreateInfo::copy_gfx_state_from(const Anvil::Graphic } /* GFX pipeline info-level data */ - m_max_depth_bounds = in_src_pipeline_create_info_ptr->m_max_depth_bounds; - m_min_depth_bounds = in_src_pipeline_create_info_ptr->m_min_depth_bounds; + m_depth_bounds_test_enabled = in_src_pipeline_create_info_ptr->m_depth_bounds_test_enabled; + m_max_depth_bounds = in_src_pipeline_create_info_ptr->m_max_depth_bounds; + m_min_depth_bounds = in_src_pipeline_create_info_ptr->m_min_depth_bounds; m_depth_bias_enabled = in_src_pipeline_create_info_ptr->m_depth_bias_enabled; m_depth_bias_clamp = in_src_pipeline_create_info_ptr->m_depth_bias_clamp; m_depth_bias_constant_factor = in_src_pipeline_create_info_ptr->m_depth_bias_constant_factor; m_depth_bias_slope_factor = in_src_pipeline_create_info_ptr->m_depth_bias_slope_factor; + m_depth_test_enabled = in_src_pipeline_create_info_ptr->m_depth_test_enabled; m_depth_test_compare_op = in_src_pipeline_create_info_ptr->m_depth_test_compare_op; m_enabled_dynamic_states = in_src_pipeline_create_info_ptr->m_enabled_dynamic_states; - m_alpha_to_coverage_enabled = in_src_pipeline_create_info_ptr->m_alpha_to_coverage_enabled; - m_alpha_to_one_enabled = in_src_pipeline_create_info_ptr->m_alpha_to_one_enabled; - m_depth_clamp_enabled = in_src_pipeline_create_info_ptr->m_depth_clamp_enabled; - m_depth_writes_enabled = in_src_pipeline_create_info_ptr->m_depth_writes_enabled; - m_logic_op_enabled = in_src_pipeline_create_info_ptr->m_logic_op_enabled; - m_primitive_restart_enabled = in_src_pipeline_create_info_ptr->m_primitive_restart_enabled; - m_rasterizer_discard_enabled = in_src_pipeline_create_info_ptr->m_rasterizer_discard_enabled; - m_sample_mask_enabled = in_src_pipeline_create_info_ptr->m_sample_mask_enabled; - m_sample_shading_enabled = in_src_pipeline_create_info_ptr->m_sample_shading_enabled; + m_alpha_to_coverage_enabled = in_src_pipeline_create_info_ptr->m_alpha_to_coverage_enabled; + m_alpha_to_one_enabled = in_src_pipeline_create_info_ptr->m_alpha_to_one_enabled; + m_depth_clamp_enabled = in_src_pipeline_create_info_ptr->m_depth_clamp_enabled; + m_depth_writes_enabled = in_src_pipeline_create_info_ptr->m_depth_writes_enabled; + m_logic_op_enabled = in_src_pipeline_create_info_ptr->m_logic_op_enabled; + m_primitive_restart_enabled = in_src_pipeline_create_info_ptr->m_primitive_restart_enabled; + m_rasterizer_discard_enabled = in_src_pipeline_create_info_ptr->m_rasterizer_discard_enabled; + m_sample_mask_enabled = in_src_pipeline_create_info_ptr->m_sample_mask_enabled; + m_sample_shading_enabled = in_src_pipeline_create_info_ptr->m_sample_shading_enabled; m_stencil_test_enabled = in_src_pipeline_create_info_ptr->m_stencil_test_enabled; m_stencil_state_back_face = in_src_pipeline_create_info_ptr->m_stencil_state_back_face; @@ -187,6 +194,8 @@ bool Anvil::GraphicsPipelineCreateInfo::copy_gfx_state_from(const Anvil::Graphic m_rasterization_order = in_src_pipeline_create_info_ptr->m_rasterization_order; + m_tessellation_domain_origin = in_src_pipeline_create_info_ptr->m_tessellation_domain_origin; + m_attributes = in_src_pipeline_create_info_ptr->m_attributes; m_blend_constant[0] = in_src_pipeline_create_info_ptr->m_blend_constant[0]; m_blend_constant[1] = in_src_pipeline_create_info_ptr->m_blend_constant[1]; @@ -201,13 +210,13 @@ bool Anvil::GraphicsPipelineCreateInfo::copy_gfx_state_from(const Anvil::Graphic m_n_dynamic_viewports = in_src_pipeline_create_info_ptr->m_n_dynamic_viewports; m_n_patch_control_points = in_src_pipeline_create_info_ptr->m_n_patch_control_points; m_primitive_topology = in_src_pipeline_create_info_ptr->m_primitive_topology; + m_sample_count = in_src_pipeline_create_info_ptr->m_sample_count; m_sample_mask = in_src_pipeline_create_info_ptr->m_sample_mask; m_scissor_boxes = in_src_pipeline_create_info_ptr->m_scissor_boxes; m_subpass_attachment_blending_properties = in_src_pipeline_create_info_ptr->m_subpass_attachment_blending_properties; m_viewports = in_src_pipeline_create_info_ptr->m_viewports; - m_cull_mode = in_src_pipeline_create_info_ptr->m_cull_mode; - m_sample_count = in_src_pipeline_create_info_ptr->m_sample_count; + m_cull_mode = in_src_pipeline_create_info_ptr->m_cull_mode; BasePipelineCreateInfo::copy_state_from(in_src_pipeline_create_info_ptr); @@ -514,8 +523,8 @@ void Anvil::GraphicsPipelineCreateInfo::get_logic_op_state(bool* out_opt_is } } -void Anvil::GraphicsPipelineCreateInfo::get_multisampling_properties(VkSampleCountFlags* out_opt_sample_count_ptr, - VkSampleMask* out_opt_sample_mask_ptr) const +void Anvil::GraphicsPipelineCreateInfo::get_multisampling_properties(SampleCountFlagBits* out_opt_sample_count_ptr, + VkSampleMask* out_opt_sample_mask_ptr) const { if (out_opt_sample_count_ptr != nullptr) { @@ -742,7 +751,7 @@ uint32_t Anvil::GraphicsPipelineCreateInfo::get_n_patch_control_points() const bool Anvil::GraphicsPipelineCreateInfo::get_vertex_attribute_properties(uint32_t in_n_vertex_input_attribute, uint32_t* out_opt_location_ptr, - VkFormat* out_opt_format_ptr, + Anvil::Format* out_opt_format_ptr, uint32_t* out_opt_offset_ptr, uint32_t* out_opt_explicit_vertex_binding_index_ptr, uint32_t* out_opt_stride_ptr, @@ -918,9 +927,9 @@ void Anvil::GraphicsPipelineCreateInfo::set_color_blend_attachment_properties(Su attachment_blending_props_ptr->src_color_blend_factor = in_src_color_blend_factor; } -void Anvil::GraphicsPipelineCreateInfo::set_multisampling_properties(VkSampleCountFlagBits in_sample_count, - float in_min_sample_shading, - const VkSampleMask in_sample_mask) +void Anvil::GraphicsPipelineCreateInfo::set_multisampling_properties(Anvil::SampleCountFlagBits in_sample_count, + float in_min_sample_shading, + const VkSampleMask in_sample_mask) { m_min_sample_shading = in_min_sample_shading; m_sample_count = in_sample_count; @@ -1012,6 +1021,11 @@ void Anvil::GraphicsPipelineCreateInfo::set_viewport_properties(uint32_t in_n_vi in_max_depth); } +void Anvil::GraphicsPipelineCreateInfo::set_tessellation_domain_origin(const Anvil::TessellationDomainOrigin& in_new_origin) +{ + m_tessellation_domain_origin = in_new_origin; +} + void Anvil::GraphicsPipelineCreateInfo::toggle_alpha_to_coverage(bool in_should_enable) { m_alpha_to_coverage_enabled = in_should_enable; diff --git a/src/misc/image_create_info.cpp b/src/misc/image_create_info.cpp index 2ce8f1e4..7caab98e 100644 --- a/src/misc/image_create_info.cpp +++ b/src/misc/image_create_info.cpp @@ -24,27 +24,27 @@ #include "wrappers/swapchain.h" Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, + Anvil::ImageType in_type, + Anvil::Format in_format, + Anvil::ImageTiling in_tiling, + Anvil::ImageUsageFlags in_usage, uint32_t in_base_mipmap_width, uint32_t in_base_mipmap_height, uint32_t in_base_mipmap_depth, uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, + Anvil::SampleCountFlagBits in_sample_count, Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, + Anvil::SharingMode in_sharing_mode, bool in_use_full_mipmap_chain, ImageCreateFlags in_create_flags, - VkImageLayout in_post_alloc_image_layout, + Anvil::ImageLayout in_post_alloc_image_layout, const std::vector* in_opt_mipmaps_ptr) { Anvil::ImageCreateInfoUniquePtr result_ptr(nullptr, std::default_delete() ); result_ptr.reset( - new ImageCreateInfo(Anvil::ImageType::NONSPARSE_NO_ALLOC, + new ImageCreateInfo(Anvil::ImageInternalType::NONSPARSE_NO_ALLOC, in_device_ptr, in_type, in_format, @@ -59,7 +59,7 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_no_allo in_use_full_mipmap_chain, in_create_flags, in_queue_families, - ((in_opt_mipmaps_ptr != nullptr) && (in_opt_mipmaps_ptr->size() > 0)) ? VK_IMAGE_LAYOUT_PREINITIALIZED : VK_IMAGE_LAYOUT_UNDEFINED, + ((in_opt_mipmaps_ptr != nullptr) && (in_opt_mipmaps_ptr->size() > 0)) ? Anvil::ImageLayout::PREINITIALIZED : Anvil::ImageLayout::UNDEFINED, in_post_alloc_image_layout, in_opt_mipmaps_ptr, Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, @@ -72,28 +72,28 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_no_allo } Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_alloc(const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, + Anvil::ImageType in_type, + Anvil::Format in_format, + Anvil::ImageTiling in_tiling, + Anvil::ImageUsageFlags in_usage, uint32_t in_base_mipmap_width, uint32_t in_base_mipmap_height, uint32_t in_base_mipmap_depth, uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, + Anvil::SampleCountFlagBits in_sample_count, Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, + Anvil::SharingMode in_sharing_mode, bool in_use_full_mipmap_chain, MemoryFeatureFlags in_memory_features, ImageCreateFlags in_create_flags, - VkImageLayout in_post_alloc_image_layout, + Anvil::ImageLayout in_post_alloc_image_layout, const std::vector* in_opt_mipmaps_ptr) { Anvil::ImageCreateInfoUniquePtr result_ptr(nullptr, std::default_delete() ); result_ptr.reset( - new ImageCreateInfo(Anvil::ImageType::NONSPARSE_ALLOC, + new ImageCreateInfo(Anvil::ImageInternalType::NONSPARSE_ALLOC, in_device_ptr, in_type, in_format, @@ -108,7 +108,7 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_alloc(c in_use_full_mipmap_chain, in_create_flags, in_queue_families, - ((in_opt_mipmaps_ptr != nullptr) && (in_opt_mipmaps_ptr->size() > 0)) ? VK_IMAGE_LAYOUT_PREINITIALIZED : VK_IMAGE_LAYOUT_UNDEFINED, + ((in_opt_mipmaps_ptr != nullptr) && (in_opt_mipmaps_ptr->size() > 0)) ? Anvil::ImageLayout::PREINITIALIZED : Anvil::ImageLayout::UNDEFINED, in_post_alloc_image_layout, in_opt_mipmaps_ptr, Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, @@ -120,18 +120,64 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_alloc(c return result_ptr; } +Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_peer_no_alloc(const Anvil::BaseDevice* in_device_ptr, + const Anvil::Swapchain* in_swapchain_ptr, + uint32_t in_n_swapchain_image) +{ + const auto memory_features ((in_device_ptr->get_type() == Anvil::DEVICE_TYPE_MULTI_GPU) ? Anvil::MEMORY_FEATURE_FLAG_MULTI_INSTANCE : 0); + Anvil::ImageCreateInfoUniquePtr result_ptr (nullptr, + std::default_delete() ); + Anvil::Image* swapchain_image_ptr (in_swapchain_ptr->get_image(in_n_swapchain_image) ); + uint32_t swapchain_image_size[3]{0, 0, 0}; + + swapchain_image_ptr->get_image_mipmap_size(0, /* n_mipmap */ + swapchain_image_size + 0, + swapchain_image_size + 1, + swapchain_image_size + 2); + + result_ptr.reset( + new ImageCreateInfo(Anvil::ImageInternalType::NONSPARSE_PEER_NO_ALLOC, + in_device_ptr, + Anvil::ImageType::_2D, + in_swapchain_ptr->get_create_info_ptr()->get_format(), + Anvil::ImageTiling::OPTIMAL, + swapchain_image_ptr->get_create_info_ptr()->get_sharing_mode(), + swapchain_image_ptr->get_create_info_ptr()->get_usage_flags (), + swapchain_image_size[0], + swapchain_image_size[1], + 1, /* in_base_mipmap_depth */ + swapchain_image_ptr->get_create_info_ptr()->get_n_layers(), + Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, + false, /* in_use_full_mipmap_chain */ + 0, /* in_create_flags */ + swapchain_image_ptr->get_create_info_ptr()->get_queue_families(), + Anvil::ImageLayout::UNDEFINED, /* in_post_create_image_layout */ + Anvil::ImageLayout::UNDEFINED, /* in_post_alloc_image_layout */ + nullptr, /* in_opt_mipmaps_ptr */ + Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + 0, /* in_external_memory_handle_types */ + memory_features, + Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED) + ); + + result_ptr->set_swapchain (in_swapchain_ptr); + result_ptr->set_swapchain_image_index(in_n_swapchain_image); + + return result_ptr; +} + Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_sparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type, - VkFormat in_format, - VkImageTiling in_tiling, - VkImageUsageFlags in_usage, + Anvil::ImageType in_type, + Anvil::Format in_format, + Anvil::ImageTiling in_tiling, + Anvil::ImageUsageFlags in_usage, uint32_t in_base_mipmap_width, uint32_t in_base_mipmap_height, uint32_t in_base_mipmap_depth, uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, + Anvil::SampleCountFlagBits in_sample_count, Anvil::QueueFamilyBits in_queue_families, - VkSharingMode in_sharing_mode, + Anvil::SharingMode in_sharing_mode, bool in_use_full_mipmap_chain, ImageCreateFlags in_create_flags, Anvil::SparseResidencyScope in_residency_scope) @@ -140,7 +186,7 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_sparse_no_alloc(c std::default_delete() ); result_ptr.reset( - new ImageCreateInfo(Anvil::ImageType::SPARSE_NO_ALLOC, + new ImageCreateInfo(Anvil::ImageInternalType::SPARSE_NO_ALLOC, in_device_ptr, in_type, in_format, @@ -155,8 +201,8 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_sparse_no_alloc(c in_use_full_mipmap_chain, in_create_flags, in_queue_families, - VK_IMAGE_LAYOUT_UNDEFINED, - VK_IMAGE_LAYOUT_UNDEFINED, + Anvil::ImageLayout::UNDEFINED, + Anvil::ImageLayout::UNDEFINED, nullptr, /* in_opt_mipmaps_ptr */ Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, 0, /* in_external_memory_handle_types */ @@ -177,23 +223,23 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_swapchain_wrapper const auto& swapchain_create_info_ptr(in_swapchain_ptr->get_create_info_ptr() ); result_ptr.reset( - new Anvil::ImageCreateInfo(Anvil::ImageType::SWAPCHAIN_WRAPPER, + new Anvil::ImageCreateInfo(Anvil::ImageInternalType::SWAPCHAIN_WRAPPER, in_device_ptr, - VK_IMAGE_TYPE_2D, + Anvil::ImageType::_2D, swapchain_create_info_ptr->get_format(), - VK_IMAGE_TILING_OPTIMAL, - VK_SHARING_MODE_EXCLUSIVE, + Anvil::ImageTiling::OPTIMAL, + Anvil::SharingMode::EXCLUSIVE, swapchain_create_info_ptr->get_usage_flags(), swapchain_create_info_ptr->get_rendering_surface()->get_width (), swapchain_create_info_ptr->get_rendering_surface()->get_height(), 1, /* base_mipmap_depth */ 1, /* in_n_layers */ - VK_SAMPLE_COUNT_1_BIT, + Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, false, /* in_use_full_mipmap_chain */ 0, /* in_create_flags */ 0, /* in_queue_families */ - VK_IMAGE_LAYOUT_UNDEFINED, - VK_IMAGE_LAYOUT_UNDEFINED, + Anvil::ImageLayout::UNDEFINED, + Anvil::ImageLayout::UNDEFINED, nullptr, /* in_opt_mipmaps_ptr */ Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, 0, /* in_external_memory_handle_types */ @@ -211,23 +257,23 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_swapchain_wrapper return result_ptr; } -Anvil::ImageCreateInfo::ImageCreateInfo(Anvil::ImageType in_type, +Anvil::ImageCreateInfo::ImageCreateInfo(Anvil::ImageInternalType in_internal_type, const Anvil::BaseDevice* in_device_ptr, - VkImageType in_type_vk, - VkFormat in_format, - VkImageTiling in_tiling, - VkSharingMode in_sharing_mode, - VkImageUsageFlags in_usage, + Anvil::ImageType in_type_vk, + Anvil::Format in_format, + Anvil::ImageTiling in_tiling, + Anvil::SharingMode in_sharing_mode, + Anvil::ImageUsageFlags in_usage, uint32_t in_base_mipmap_width, uint32_t in_base_mipmap_height, uint32_t in_base_mipmap_depth, uint32_t in_n_layers, - VkSampleCountFlagBits in_sample_count, + Anvil::SampleCountFlagBits in_sample_count, bool in_use_full_mipmap_chain, ImageCreateFlags in_create_flags, Anvil::QueueFamilyBits in_queue_families, - VkImageLayout in_post_create_image_layout, - const VkImageLayout& in_post_alloc_image_layout, + Anvil::ImageLayout in_post_create_image_layout, + const Anvil::ImageLayout& in_post_alloc_image_layout, const std::vector* in_opt_mipmaps_ptr, const Anvil::MTSafety& in_mt_safety, Anvil::ExternalMemoryHandleTypeBits in_exportable_external_memory_handle_types, @@ -239,6 +285,7 @@ Anvil::ImageCreateInfo::ImageCreateInfo(Anvil::ImageType in_t m_exportable_external_memory_handle_types(in_exportable_external_memory_handle_types), m_format (in_format), m_height (in_base_mipmap_height), + m_internal_type (in_internal_type), m_memory_features (in_memory_features), m_mipmaps_to_upload ((in_opt_mipmaps_ptr != nullptr) ? *in_opt_mipmaps_ptr : std::vector() ), m_mt_safety (in_mt_safety), @@ -252,11 +299,19 @@ Anvil::ImageCreateInfo::ImageCreateInfo(Anvil::ImageType in_t m_sharing_mode (in_sharing_mode), m_swapchain_ptr (nullptr), m_tiling (in_tiling), - m_type (in_type), m_type_vk (in_type_vk), - m_usage_flags (static_cast(in_usage)), + m_usage_flags (in_usage), m_use_full_mipmap_chain (in_use_full_mipmap_chain), m_width (in_base_mipmap_width) { - /* Stub */ + #if defined(_DEBUG) + { + if (m_create_flags & Anvil::ImageCreateFlagBits::IMAGE_CREATE_FLAG_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT) + { + anvil_assert(m_create_flags & Anvil::ImageCreateFlagBits::IMAGE_CREATE_FLAG_MUTABLE_FORMAT_BIT); + anvil_assert(m_use_full_mipmap_chain == false); + anvil_assert(m_n_layers == 1); + } + } + #endif } diff --git a/src/misc/image_view_create_info.cpp b/src/misc/image_view_create_info.cpp index c546b4a0..8603c9cb 100644 --- a/src/misc/image_view_create_info.cpp +++ b/src/misc/image_view_create_info.cpp @@ -26,16 +26,16 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_1D(const uint32_t in_n_base_layer, uint32_t in_n_base_mipmap_level, uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha) + Anvil::ImageAspectFlags in_aspect_mask, + Anvil::Format in_format, + Anvil::ComponentSwizzle in_swizzle_red, + Anvil::ComponentSwizzle in_swizzle_green, + Anvil::ComponentSwizzle in_swizzle_blue, + Anvil::ComponentSwizzle in_swizzle_alpha) { Anvil::ImageViewCreateInfoUniquePtr result_ptr (nullptr, std::default_delete() ); - const VkComponentSwizzle swizzle_rgba[] = + const Anvil::ComponentSwizzle swizzle_rgba[] = { in_swizzle_red, in_swizzle_green, @@ -67,16 +67,16 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_1D_array( uint32_t in_n_layers, uint32_t in_n_base_mipmap_level, uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha) + Anvil::ImageAspectFlags in_aspect_mask, + Anvil::Format in_format, + Anvil::ComponentSwizzle in_swizzle_red, + Anvil::ComponentSwizzle in_swizzle_green, + Anvil::ComponentSwizzle in_swizzle_blue, + Anvil::ComponentSwizzle in_swizzle_alpha) { Anvil::ImageViewCreateInfoUniquePtr result_ptr (nullptr, std::default_delete() ); - const VkComponentSwizzle swizzle_rgba[] = + const Anvil::ComponentSwizzle swizzle_rgba[] = { in_swizzle_red, in_swizzle_green, @@ -107,16 +107,16 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_2D(const uint32_t in_n_base_layer, uint32_t in_n_base_mipmap_level, uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha) + Anvil::ImageAspectFlags in_aspect_mask, + Anvil::Format in_format, + Anvil::ComponentSwizzle in_swizzle_red, + Anvil::ComponentSwizzle in_swizzle_green, + Anvil::ComponentSwizzle in_swizzle_blue, + Anvil::ComponentSwizzle in_swizzle_alpha) { Anvil::ImageViewCreateInfoUniquePtr result_ptr (nullptr, std::default_delete() ); - const VkComponentSwizzle swizzle_rgba[] = + const Anvil::ComponentSwizzle swizzle_rgba[] = { in_swizzle_red, in_swizzle_green, @@ -148,16 +148,16 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_2D_array( uint32_t in_n_layers, uint32_t in_n_base_mipmap_level, uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha) + Anvil::ImageAspectFlags in_aspect_mask, + Anvil::Format in_format, + Anvil::ComponentSwizzle in_swizzle_red, + Anvil::ComponentSwizzle in_swizzle_green, + Anvil::ComponentSwizzle in_swizzle_blue, + Anvil::ComponentSwizzle in_swizzle_alpha) { Anvil::ImageViewCreateInfoUniquePtr result_ptr (nullptr, std::default_delete() ); - const VkComponentSwizzle swizzle_rgba[] = + const Anvil::ComponentSwizzle swizzle_rgba[] = { in_swizzle_red, in_swizzle_green, @@ -189,16 +189,16 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_3D(const uint32_t in_n_slices, uint32_t in_n_base_mipmap_level, uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha) + Anvil::ImageAspectFlags in_aspect_mask, + Anvil::Format in_format, + Anvil::ComponentSwizzle in_swizzle_red, + Anvil::ComponentSwizzle in_swizzle_green, + Anvil::ComponentSwizzle in_swizzle_blue, + Anvil::ComponentSwizzle in_swizzle_alpha) { Anvil::ImageViewCreateInfoUniquePtr result_ptr (nullptr, std::default_delete() ); - const VkComponentSwizzle swizzle_rgba[] = + const Anvil::ComponentSwizzle swizzle_rgba[] = { in_swizzle_red, in_swizzle_green, @@ -229,16 +229,16 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_cube_map( uint32_t in_n_base_layer, uint32_t in_n_base_mipmap_level, uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha) + Anvil::ImageAspectFlags in_aspect_mask, + Anvil::Format in_format, + Anvil::ComponentSwizzle in_swizzle_red, + Anvil::ComponentSwizzle in_swizzle_green, + Anvil::ComponentSwizzle in_swizzle_blue, + Anvil::ComponentSwizzle in_swizzle_alpha) { Anvil::ImageViewCreateInfoUniquePtr result_ptr (nullptr, std::default_delete() ); - const VkComponentSwizzle swizzle_rgba[] = + const Anvil::ComponentSwizzle swizzle_rgba[] = { in_swizzle_red, in_swizzle_green, @@ -270,16 +270,16 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_cube_map_ uint32_t in_n_cube_maps, uint32_t in_n_base_mipmap_level, uint32_t in_n_mipmaps, - VkImageAspectFlags in_aspect_mask, - VkFormat in_format, - VkComponentSwizzle in_swizzle_red, - VkComponentSwizzle in_swizzle_green, - VkComponentSwizzle in_swizzle_blue, - VkComponentSwizzle in_swizzle_alpha) + Anvil::ImageAspectFlags in_aspect_mask, + Anvil::Format in_format, + Anvil::ComponentSwizzle in_swizzle_red, + Anvil::ComponentSwizzle in_swizzle_green, + Anvil::ComponentSwizzle in_swizzle_blue, + Anvil::ComponentSwizzle in_swizzle_alpha) { Anvil::ImageViewCreateInfoUniquePtr result_ptr (nullptr, std::default_delete() ); - const VkComponentSwizzle swizzle_rgba[] = + const Anvil::ComponentSwizzle swizzle_rgba[] = { in_swizzle_red, in_swizzle_green, @@ -305,18 +305,18 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_cube_map_ return result_ptr; } -Anvil::ImageViewCreateInfo::ImageViewCreateInfo(const VkImageAspectFlags& in_aspect_mask, - const Anvil::BaseDevice* in_device_ptr, - const VkFormat in_format, - const uint32_t in_n_base_layer, - const uint32_t in_n_base_mipmap_level, - const uint32_t in_n_layers, - const uint32_t in_n_mipmaps, - const uint32_t in_n_slices, - Anvil::Image* in_parent_image_ptr, - const VkComponentSwizzle* in_swizzle_array_ptr, - const VkImageViewType in_type, - const Anvil::MTSafety& in_mt_safety) +Anvil::ImageViewCreateInfo::ImageViewCreateInfo(const Anvil::ImageAspectFlags& in_aspect_mask, + const Anvil::BaseDevice* in_device_ptr, + const Anvil::Format in_format, + const uint32_t in_n_base_layer, + const uint32_t in_n_base_mipmap_level, + const uint32_t in_n_layers, + const uint32_t in_n_mipmaps, + const uint32_t in_n_slices, + Anvil::Image* in_parent_image_ptr, + const Anvil::ComponentSwizzle* in_swizzle_array_ptr, + const VkImageViewType in_type, + const Anvil::MTSafety& in_mt_safety) :m_aspect_mask (in_aspect_mask), m_device_ptr (in_device_ptr), m_format (in_format), @@ -328,7 +328,8 @@ Anvil::ImageViewCreateInfo::ImageViewCreateInfo(const VkImageAspectFlags& in_asp m_n_slices (in_n_slices), m_parent_image_ptr (in_parent_image_ptr), m_swizzle_array ({in_swizzle_array_ptr[0], in_swizzle_array_ptr[1], in_swizzle_array_ptr[2], in_swizzle_array_ptr[3]}), - m_type (in_type) + m_type (in_type), + m_usage (Anvil::IMAGE_USAGE_UNKNOWN) { anvil_assert(in_parent_image_ptr != nullptr); } diff --git a/src/misc/memalloc_backends/backend_oneshot.cpp b/src/misc/memalloc_backends/backend_oneshot.cpp index dae5cb98..97fdeae0 100644 --- a/src/misc/memalloc_backends/backend_oneshot.cpp +++ b/src/misc/memalloc_backends/backend_oneshot.cpp @@ -30,6 +30,7 @@ #include "wrappers/image.h" #include "wrappers/memory_block.h" #include +#include /** Please see header for specification */ Anvil::MemoryAllocatorBackends::OneShot::OneShot(const Anvil::BaseDevice* in_device_ptr) @@ -74,11 +75,11 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items } } DedicatedAllocationInfo; - std::vector dedicated_allocs; - const auto& memory_props (m_device_ptr->get_physical_device_memory_properties() ); - const uint32_t n_memory_types (static_cast(memory_props.types.size() )); - std::vector > per_mem_type_items_vector(n_memory_types); - bool result (true); + std::vector dedicated_allocs; + std::unordered_map > > device_mask_to_mem_type_to_item_vec; + const auto& memory_props (m_device_ptr->get_physical_device_memory_properties() ); + const uint32_t n_memory_types (static_cast(memory_props.types.size() )); + bool result (true); /* Iterate over all block items and determine what memory types we can use. * @@ -92,6 +93,9 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items * dedicated. However, each exportable memory allocation comes with a set of parameters (NT handle details, as an example) * which make merging memory blocks tricky. Hence, for exportable allocs, just put each such alloc in its own memory block. * + * Since we can only specify one device mask per memory allocation, allocation need to be further subdivided by device masks + * they have been associated with. + * */ for (auto item_iterator = in_items.begin(); item_iterator != in_items.end(); @@ -115,6 +119,51 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items continue; } + if ((*item_iterator)->alloc_mgpu_peer_memory_reqs.size() > 0) + { + /* Make sure current memory type supports all required peer memory requirements specified by the user */ + bool can_continue = true; + auto mgpu_device_ptr = dynamic_cast(m_device_ptr); + + anvil_assert(m_device_ptr->get_type() == Anvil::DeviceType::DEVICE_TYPE_MULTI_GPU); + anvil_assert(mgpu_device_ptr != nullptr); + + for (const auto& current_req : (*item_iterator)->alloc_mgpu_peer_memory_reqs) + { + Anvil::PeerMemoryFeatureFlags current_memory_type_peer_memory_features = 0; + const auto& local_device_index = current_req.first.first; + const auto local_device_ptr = mgpu_device_ptr->get_physical_device(local_device_index); + const auto& remote_device_index = current_req.first.second; + const auto remote_device_ptr = mgpu_device_ptr->get_physical_device(remote_device_index); + const auto& required_peer_memory_features = current_req.second; + + if (!mgpu_device_ptr->get_peer_memory_features(local_device_ptr, + remote_device_ptr, + memory_props.types.at(n_memory_type).heap_ptr->index, + ¤t_memory_type_peer_memory_features) ) + { + anvil_assert_fail(); + + can_continue = false; + break; + } + + if ((current_memory_type_peer_memory_features & required_peer_memory_features) != required_peer_memory_features) + { + can_continue = false; + + break; + } + } + + if (!can_continue) + { + result = false; + + goto end; + } + } + if ((*item_iterator)->alloc_is_dedicated_memory || (*item_iterator)->alloc_exportable_external_handle_types != 0) { @@ -125,7 +174,14 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items } else { - per_mem_type_items_vector.at(n_memory_type).push_back((item_iterator->get() ) ); + const auto& device_mask = (*item_iterator)->alloc_device_mask; + + if (device_mask_to_mem_type_to_item_vec.find(device_mask) == device_mask_to_mem_type_to_item_vec.end() ) + { + device_mask_to_mem_type_to_item_vec[device_mask].resize(n_memory_types); + } + + device_mask_to_mem_type_to_item_vec.at(device_mask).at(n_memory_type).push_back((item_iterator->get() ) ); } break; @@ -147,7 +203,8 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items current_dedicated_alloc.item_ptr->alloc_size, (memory_props.types[current_dedicated_alloc.n_memory_type].features) ); - create_info_ptr->set_mt_safety(Anvil::Utils::convert_boolean_to_mt_safety_enum(m_device_ptr->is_mt_safe()) ); + create_info_ptr->set_device_mask(current_dedicated_alloc.item_ptr->alloc_device_mask); + create_info_ptr->set_mt_safety (Anvil::Utils::convert_boolean_to_mt_safety_enum(m_device_ptr->is_mt_safe()) ); if (current_dedicated_alloc.item_ptr->alloc_is_dedicated_memory) { @@ -203,78 +260,84 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items /* For each memory type, for each there's at least one item, bake a memory block */ { - std::map alloc_offset_map; - uint32_t current_memory_type_index(0); - - for (auto mem_type_to_item_vector_iterator = per_mem_type_items_vector.begin(); - mem_type_to_item_vector_iterator != per_mem_type_items_vector.end(); - ++mem_type_to_item_vector_iterator, ++current_memory_type_index) + for (auto device_mask_to_mem_type_to_item_vector_iterator = device_mask_to_mem_type_to_item_vec.begin(); + device_mask_to_mem_type_to_item_vector_iterator != device_mask_to_mem_type_to_item_vec.end(); + ++device_mask_to_mem_type_to_item_vector_iterator) { - auto& current_item_vector = *mem_type_to_item_vector_iterator; + std::map alloc_offset_map; + auto& current_device_mask_to_item_vector_data = *device_mask_to_mem_type_to_item_vector_iterator; + const auto& current_device_mask = current_device_mask_to_item_vector_data.first; + uint32_t current_memory_type_index = 0; - if (current_item_vector.size() > 0) + for (const auto& current_items: current_device_mask_to_item_vector_data.second) { - Anvil::MemoryBlockUniquePtr new_memory_block_ptr(nullptr, - std::default_delete() ); - VkDeviceSize n_bytes_required (0); - - /* Go through the items, calculate offsets and the total amount of memory we're going - * to need to alloc off the heap */ - for (auto& current_item_ptr : current_item_vector) + if (current_items.size() > 0) { - anvil_assert(current_item_ptr->alloc_exportable_external_handle_types == 0); - anvil_assert(current_item_ptr->alloc_external_nt_handle_info_ptr == nullptr); + Anvil::MemoryBlockUniquePtr new_memory_block_ptr(nullptr, + std::default_delete() ); + VkDeviceSize n_bytes_required (0); - n_bytes_required = Anvil::Utils::round_up(n_bytes_required, - current_item_ptr->alloc_memory_required_alignment); - - alloc_offset_map[current_item_ptr] = n_bytes_required; - n_bytes_required += current_item_ptr->alloc_size; - } + /* Go through the items, calculate offsets and the total amount of memory we're going + * to need to alloc off the heap */ + for (auto& current_item_ptr : current_items) + { + anvil_assert(current_item_ptr->alloc_exportable_external_handle_types == 0); + anvil_assert(current_item_ptr->alloc_external_nt_handle_info_ptr == nullptr); - /* Bake the block and stash it */ - { - auto create_info_ptr = Anvil::MemoryBlockCreateInfo::create_regular(m_device_ptr, - 1u << current_memory_type_index, - n_bytes_required, - (memory_props.types[current_memory_type_index].features) ); + n_bytes_required = Anvil::Utils::round_up(n_bytes_required, + current_item_ptr->alloc_memory_required_alignment); - create_info_ptr->set_mt_safety(Anvil::Utils::convert_boolean_to_mt_safety_enum(m_device_ptr->is_mt_safe()) ); + alloc_offset_map[current_item_ptr] = n_bytes_required; + n_bytes_required += current_item_ptr->alloc_size; + } - new_memory_block_ptr = Anvil::MemoryBlock::create(std::move(create_info_ptr) ); - } + /* Bake the block and stash it */ + { + auto create_info_ptr = Anvil::MemoryBlockCreateInfo::create_regular(m_device_ptr, + 1u << current_memory_type_index, + n_bytes_required, + (memory_props.types[current_memory_type_index].features) ); - if (new_memory_block_ptr == nullptr) - { - anvil_assert(new_memory_block_ptr != nullptr); + create_info_ptr->set_device_mask(current_device_mask); + create_info_ptr->set_mt_safety (Anvil::Utils::convert_boolean_to_mt_safety_enum(m_device_ptr->is_mt_safe()) ); - result = false; - continue; - } + new_memory_block_ptr = Anvil::MemoryBlock::create(std::move(create_info_ptr) ); + } - /* Go through the items again and assign the result memory block */ - for (auto& current_item_ptr : current_item_vector) - { + if (new_memory_block_ptr == nullptr) { - auto create_info_ptr = Anvil::MemoryBlockCreateInfo::create_derived(new_memory_block_ptr.get(), - alloc_offset_map.at(current_item_ptr), - current_item_ptr->alloc_size); + anvil_assert(new_memory_block_ptr != nullptr); - current_item_ptr->alloc_memory_block_ptr = Anvil::MemoryBlock::create(std::move(create_info_ptr) ); + result = false; + continue; } - if (current_item_ptr->alloc_memory_block_ptr != nullptr) + /* Go through the items again and assign the result memory block */ + for (auto& current_item_ptr : current_items) { - current_item_ptr->is_baked = true; + { + auto create_info_ptr = Anvil::MemoryBlockCreateInfo::create_derived(new_memory_block_ptr.get(), + alloc_offset_map.at(current_item_ptr), + current_item_ptr->alloc_size); + + current_item_ptr->alloc_memory_block_ptr = Anvil::MemoryBlock::create(std::move(create_info_ptr) ); + } + + if (current_item_ptr->alloc_memory_block_ptr != nullptr) + { + current_item_ptr->is_baked = true; + } + + dynamic_cast(current_item_ptr->alloc_memory_block_ptr.get() )->set_parent_memory_allocator_backend_ptr(shared_from_this(), + reinterpret_cast(new_memory_block_ptr->get_memory() )); } - dynamic_cast(current_item_ptr->alloc_memory_block_ptr.get() )->set_parent_memory_allocator_backend_ptr(shared_from_this(), - reinterpret_cast(new_memory_block_ptr->get_memory() )); + m_memory_blocks.push_back( + std::move(new_memory_block_ptr) + ); } - m_memory_blocks.push_back( - std::move(new_memory_block_ptr) - ); + ++current_memory_type_index; } } } @@ -286,6 +349,7 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items */ anvil_assert(result); +end: return result; } @@ -313,6 +377,11 @@ bool Anvil::MemoryAllocatorBackends::OneShot::supports_baking() const return !m_is_baked; } +bool Anvil::MemoryAllocatorBackends::OneShot::supports_device_masks() const +{ + return true; +} + bool Anvil::MemoryAllocatorBackends::OneShot::supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeBits&) const { return true; diff --git a/src/misc/memalloc_backends/backend_vma.cpp b/src/misc/memalloc_backends/backend_vma.cpp index f1427559..f34e494f 100644 --- a/src/misc/memalloc_backends/backend_vma.cpp +++ b/src/misc/memalloc_backends/backend_vma.cpp @@ -102,6 +102,20 @@ bool Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::init() switch (m_device_ptr->get_type() ) { + case Anvil::DEVICE_TYPE_MULTI_GPU: + { + /* VMA library takes a physical device handle to extract info regarding supported + * memory types and the like. As VK_KHR_device_group provide explicit mGPU support, + * it is guaranteed all physical devices within a logical device offer exactly the + * same capabilities. This means we're safe to pass zeroth physical device to the + * library, and everything will still be OK. + */ + const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr) ); + + create_info.physicalDevice = mgpu_device_ptr->get_physical_device(0)->get_physical_device(); + break; + } + case Anvil::DEVICE_TYPE_SINGLE_GPU: { const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr) ); @@ -358,6 +372,12 @@ bool Anvil::MemoryAllocatorBackends::VMA::supports_baking() const return true; } +bool Anvil::MemoryAllocatorBackends::VMA::supports_device_masks() const +{ + /* The version of VMA we currently use does not provide support for device groups. */ + return false; +} + bool Anvil::MemoryAllocatorBackends::VMA::supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) const { /* Vulkan Memory Allocator does NOT support external memory handles */ diff --git a/src/misc/memory_allocator.cpp b/src/misc/memory_allocator.cpp index 0730a4d2..424f5a05 100644 --- a/src/misc/memory_allocator.cpp +++ b/src/misc/memory_allocator.cpp @@ -46,7 +46,9 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, #endif - const bool& in_alloc_is_dedicated) + const bool& in_alloc_is_dedicated, + const uint32_t& in_device_mask, + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -55,6 +57,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in alloc_external_nt_handle_info_ptr = in_alloc_external_nt_handle_info_ptr; #endif + alloc_device_mask = in_device_mask; alloc_exportable_external_handle_types = in_opt_exportable_external_handle_types; alloc_is_dedicated_memory = in_alloc_is_dedicated; alloc_memory_final_type = UINT32_MAX; @@ -62,6 +65,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in alloc_memory_required_features = in_alloc_required_memory_features; alloc_memory_supported_memory_types = in_alloc_supported_memory_types; alloc_memory_types = in_alloc_memory_types; + alloc_mgpu_peer_memory_reqs = in_mgpu_peer_memory_reqs; alloc_size = in_alloc_size; buffer_ptr = in_buffer_ptr; image_ptr = nullptr; @@ -84,7 +88,9 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, #endif - const bool& in_alloc_is_dedicated) + const bool& in_alloc_is_dedicated, + const uint32_t& in_device_mask, + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -93,6 +99,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in alloc_external_nt_handle_info_ptr = in_alloc_external_nt_handle_info_ptr; #endif + alloc_device_mask = in_device_mask; alloc_exportable_external_handle_types = in_opt_exportable_external_handle_types; alloc_is_dedicated_memory = in_alloc_is_dedicated; alloc_memory_final_type = UINT32_MAX; @@ -100,6 +107,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in alloc_memory_required_features = in_alloc_required_memory_features; alloc_memory_supported_memory_types = in_alloc_supported_memory_types; alloc_memory_types = in_alloc_memory_types; + alloc_mgpu_peer_memory_reqs = in_mgpu_peer_memory_reqs; alloc_offset = in_alloc_offset; alloc_size = in_alloc_size; buffer_ptr = in_buffer_ptr; @@ -125,7 +133,9 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, #endif - const bool& in_alloc_is_dedicated) + const bool& in_alloc_is_dedicated, + const uint32_t& in_device_mask, + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -134,6 +144,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in alloc_external_nt_handle_info_ptr = in_alloc_external_nt_handle_info_ptr; #endif + alloc_device_mask = in_device_mask; alloc_exportable_external_handle_types = in_opt_exportable_external_handle_types; alloc_is_dedicated_memory = in_alloc_is_dedicated; alloc_memory_final_type = UINT32_MAX; @@ -141,6 +152,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in alloc_memory_required_features = in_alloc_required_memory_features; alloc_memory_supported_memory_types = in_alloc_supported_memory_types; alloc_memory_types = in_alloc_memory_types; + alloc_mgpu_peer_memory_reqs = in_mgpu_peer_memory_reqs; alloc_offset = UINT64_MAX; alloc_size = in_alloc_size; buffer_ptr = nullptr; @@ -169,7 +181,9 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, #endif - const bool& in_alloc_is_dedicated) + const bool& in_alloc_is_dedicated, + const uint32_t& in_device_mask, + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -178,6 +192,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in alloc_external_nt_handle_info_ptr = in_alloc_external_nt_handle_info_ptr; #endif + alloc_device_mask = in_device_mask; alloc_exportable_external_handle_types = in_opt_exportable_external_handle_types; alloc_is_dedicated_memory = in_alloc_is_dedicated; alloc_memory_final_type = UINT32_MAX; @@ -185,6 +200,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in alloc_memory_required_alignment = in_alloc_alignment; alloc_memory_required_features = in_alloc_required_memory_features; alloc_memory_supported_memory_types = in_alloc_supported_memory_types; + alloc_mgpu_peer_memory_reqs = in_mgpu_peer_memory_reqs; alloc_offset = UINT64_MAX; alloc_size = in_alloc_size; buffer_ptr = nullptr; @@ -211,7 +227,9 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, #endif - const bool& in_alloc_is_dedicated) + const bool& in_alloc_is_dedicated, + const uint32_t& in_device_mask, + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -220,6 +238,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in alloc_external_nt_handle_info_ptr = in_alloc_external_nt_handle_info_ptr; #endif + alloc_device_mask = in_device_mask; alloc_exportable_external_handle_types = in_opt_exportable_external_handle_types; alloc_is_dedicated_memory = in_alloc_is_dedicated; alloc_memory_final_type = UINT32_MAX; @@ -227,6 +246,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in alloc_memory_required_features = in_alloc_required_memory_features; alloc_memory_supported_memory_types = in_alloc_supported_memory_types; alloc_memory_types = in_alloc_memory_types; + alloc_mgpu_peer_memory_reqs = in_mgpu_peer_memory_reqs; alloc_offset = UINT64_MAX; alloc_size = in_alloc_size; buffer_ptr = nullptr; @@ -401,11 +421,12 @@ Anvil::MemoryAllocator::~MemoryAllocator() /** Please see header for specification */ bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* in_buffer_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - ) + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -419,11 +440,12 @@ bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* return add_buffer_internal(in_buffer_ptr, in_required_memory_features, - in_opt_exportable_external_handle_types + in_opt_exportable_external_handle_types, #if defined(_WIN32) - ,in_opt_external_nt_handle_info_ptr + in_opt_external_nt_handle_info_ptr, #endif - ); + in_opt_device_mask_ptr, + in_opt_mgpu_peer_memory_reqs_ptr); } /** Determines the amount of memory, supported memory type and required alignment for the specified @@ -433,11 +455,12 @@ bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* **/ bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* in_buffer_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - ) + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { IMemoryAllocatorBackend* backend_interface_ptr = dynamic_cast(m_backend_ptr.get() ); VkDeviceSize buffer_alignment = 0; @@ -453,6 +476,16 @@ bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* /* Sanity checks */ anvil_assert(backend_interface_ptr->supports_baking() ); anvil_assert(in_buffer_ptr != nullptr); + anvil_assert( in_opt_device_mask_ptr == nullptr || + (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); + + if (!do_mgpu_sanity_checks(in_opt_device_mask_ptr, + in_opt_mgpu_peer_memory_reqs_ptr) ) + { + result = false; + + goto end; + } /* Extract external memory handle types from the specified buffer, if none were specified. */ if (!do_external_memory_handle_type_sanity_checks(in_buffer_ptr->get_create_info_ptr()->get_exportable_external_memory_handle_types() ) ) @@ -490,7 +523,9 @@ bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* #if defined(_WIN32) in_opt_external_nt_handle_info_ptr, #endif - in_buffer_ptr->requires_dedicated_allocation() ) + in_buffer_ptr->requires_dedicated_allocation(), + (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr : 0, + (in_opt_mgpu_peer_memory_reqs_ptr != nullptr) ? *in_opt_mgpu_peer_memory_reqs_ptr : MGPUPeerMemoryRequirements() ) ); m_items.push_back( @@ -509,11 +544,12 @@ bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - ) + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -528,11 +564,12 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvi result = add_buffer_internal(in_buffer_ptr, in_required_memory_features, - in_opt_exportable_external_handle_types + in_opt_exportable_external_handle_types, #if defined(_WIN32) - ,in_opt_external_nt_handle_info_ptr + in_opt_external_nt_handle_info_ptr, #endif - ); + in_opt_device_mask_ptr, + in_opt_mgpu_peer_memory_reqs_ptr); if (result) { @@ -546,11 +583,12 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvi bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - ) + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -567,11 +605,12 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi result = add_buffer_internal(in_buffer_ptr, in_required_memory_features, - in_opt_exportable_external_handle_types + in_opt_exportable_external_handle_types, #if defined(_WIN32) - ,in_opt_external_nt_handle_info_ptr + in_opt_external_nt_handle_info_ptr, #endif - ); + in_opt_device_mask_ptr, + in_opt_mgpu_peer_memory_reqs_ptr); if (result) { @@ -585,11 +624,12 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, const std::vector* in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - ) + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -611,11 +651,12 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi result = add_buffer_internal(in_buffer_ptr, in_required_memory_features, - in_opt_exportable_external_handle_types + in_opt_exportable_external_handle_types, #if defined(_WIN32) - ,in_opt_external_nt_handle_info_ptr + in_opt_external_nt_handle_info_ptr, #endif - ); + in_opt_device_mask_ptr, + in_opt_mgpu_peer_memory_reqs_ptr); if (result) { @@ -629,11 +670,12 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - ) + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -648,11 +690,12 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anv result = add_buffer_internal(in_buffer_ptr, in_required_memory_features, - in_opt_exportable_external_handle_types + in_opt_exportable_external_handle_types, #if defined(_WIN32) - ,in_opt_external_nt_handle_info_ptr + in_opt_external_nt_handle_info_ptr, #endif - ); + in_opt_device_mask_ptr, + in_opt_mgpu_peer_memory_reqs_ptr); if (result) { @@ -666,11 +709,12 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anv bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - ) + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -687,11 +731,12 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_vector_ptr_based_post_f result = add_buffer_internal(in_buffer_ptr, in_required_memory_features, - in_opt_exportable_external_handle_types + in_opt_exportable_external_handle_types, #if defined(_WIN32) - ,in_opt_external_nt_handle_info_ptr + in_opt_external_nt_handle_info_ptr, #endif - ); + in_opt_device_mask_ptr, + in_opt_mgpu_peer_memory_reqs_ptr); if (result) { @@ -705,11 +750,12 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_vector_ptr_based_post_f bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - ) + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -724,11 +770,12 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anv result = add_buffer_internal(in_buffer_ptr, in_required_memory_features, - in_opt_exportable_external_handle_types + in_opt_exportable_external_handle_types, #if defined(_WIN32) - ,in_opt_external_nt_handle_info_ptr + in_opt_external_nt_handle_info_ptr, #endif - ); + in_opt_device_mask_ptr, + in_opt_mgpu_peer_memory_reqs_ptr); if (result) { @@ -742,11 +789,12 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anv bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - ) + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -763,11 +811,12 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f result = add_buffer_internal(in_buffer_ptr, in_required_memory_features, - in_opt_exportable_external_handle_types + in_opt_exportable_external_handle_types, #if defined(_WIN32) - ,in_opt_external_nt_handle_info_ptr + in_opt_external_nt_handle_info_ptr, #endif - ); + in_opt_device_mask_ptr, + in_opt_mgpu_peer_memory_reqs_ptr); if (result) { @@ -781,11 +830,12 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, const std::vector* in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - ) + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -807,11 +857,12 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f result = add_buffer_internal(in_buffer_ptr, in_required_memory_features, - in_opt_exportable_external_handle_types + in_opt_exportable_external_handle_types, #if defined(_WIN32) - ,in_opt_external_nt_handle_info_ptr + in_opt_external_nt_handle_info_ptr, #endif - ); + in_opt_device_mask_ptr, + in_opt_mgpu_peer_memory_reqs_ptr); if (result) { @@ -824,12 +875,13 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f /** Please see header for specification */ bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* in_image_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types + const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, #if defined(_WIN32) - ,const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - ) + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { uint32_t filtered_memory_types = 0; VkDeviceSize image_alignment = 0; @@ -850,6 +902,16 @@ bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* /* Sanity checks */ anvil_assert(m_backend_ptr->supports_baking() ); anvil_assert(in_image_ptr != nullptr); + anvil_assert(in_opt_device_mask_ptr == nullptr || + (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); + + if (!do_mgpu_sanity_checks(in_opt_device_mask_ptr, + in_opt_mgpu_peer_memory_reqs_ptr) ) + { + result = false; + + goto end; + } if (!do_external_memory_handle_type_sanity_checks(in_image_ptr->get_create_info_ptr()->get_external_memory_handle_types()) ) { @@ -886,7 +948,9 @@ bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* #if defined(_WIN32) in_opt_external_nt_handle_info_ptr, #endif - in_image_ptr->requires_dedicated_allocation() ) + in_image_ptr->requires_dedicated_allocation(), + (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr : 0, + (in_opt_mgpu_peer_memory_reqs_ptr != nullptr) ? *in_opt_mgpu_peer_memory_reqs_ptr : MGPUPeerMemoryRequirements() ) ); m_items.push_back( @@ -899,10 +963,12 @@ bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* } /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_offset, - VkDeviceSize in_size, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkDeviceSize in_size, + MemoryFeatureFlags in_required_memory_features, + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { uint32_t filtered_memory_types = 0; const auto& memory_reqs = in_buffer_ptr->get_memory_requirements(); @@ -916,6 +982,16 @@ bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* in_buff anvil_assert(m_backend_ptr->supports_baking () ); anvil_assert(in_buffer_ptr->get_create_info_ptr()->get_type() == Anvil::BufferType::SPARSE_NO_ALLOC); anvil_assert(in_buffer_ptr->get_memory_requirements().size >= in_offset + in_size); + anvil_assert( in_opt_device_mask_ptr == nullptr || + (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); + + if (!do_mgpu_sanity_checks(in_opt_device_mask_ptr, + in_opt_mgpu_peer_memory_reqs_ptr) ) + { + result = false; + + goto end; + } if (mutex_ptr != nullptr) { @@ -958,7 +1034,9 @@ bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* in_buff #if defined(_WIN32) nullptr, /* in_alloc_external_nt_handle_info_ptr */ #endif - in_buffer_ptr->requires_dedicated_allocation() ) + in_buffer_ptr->requires_dedicated_allocation(), + (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr : 0, + (in_opt_mgpu_peer_memory_reqs_ptr != nullptr) ? *in_opt_mgpu_peer_memory_reqs_ptr : MGPUPeerMemoryRequirements() ) ); m_items.push_back( @@ -974,10 +1052,12 @@ bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* in_buff } /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* in_image_ptr, - VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* in_image_ptr, + Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + MemoryFeatureFlags in_required_memory_features, + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { const Anvil::SparseImageAspectProperties* aspect_props_ptr = nullptr; uint32_t filtered_memory_types = 0; @@ -997,6 +1077,16 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* in_i anvil_assert(in_image_ptr->get_create_info_ptr()->get_residency_scope() != Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED); anvil_assert(in_image_ptr->get_create_info_ptr()->get_n_layers () > in_n_layer); anvil_assert(in_image_ptr->has_aspects (in_aspect) ); + anvil_assert( in_opt_device_mask_ptr == nullptr || + (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); + + if (!do_mgpu_sanity_checks(in_opt_device_mask_ptr, + in_opt_mgpu_peer_memory_reqs_ptr) ) + { + result = false; + + goto end; + } if (mutex_ptr != nullptr) { @@ -1022,7 +1112,7 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* in_i in_n_layer == 0 || (aspect_props_ptr->flags & VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT) == 0); - /* Determine allocation properties */ + /* Determine allocation properties */ miptail_memory_types = in_image_ptr->get_image_memory_types(); miptail_offset = aspect_props_ptr->mip_tail_offset + aspect_props_ptr->mip_tail_stride * in_n_layer; miptail_size = aspect_props_ptr->mip_tail_size; @@ -1053,7 +1143,9 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* in_i #if defined(_WIN32) nullptr, /* in_alloc_external_nt_handle_info_ptr */ #endif - false) /* in_alloc_is_dedicated - sparse images do not supported dedicated allocs */ + false, /* in_alloc_is_dedicated - sparse images do not supported dedicated allocs */ + (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr : 0, + (in_opt_mgpu_peer_memory_reqs_ptr != nullptr) ? *in_opt_mgpu_peer_memory_reqs_ptr : MGPUPeerMemoryRequirements() ) ); m_items.push_back( @@ -1067,11 +1159,13 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* in_i } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - VkExtent3D in_extent, - MemoryFeatureFlags in_required_memory_features) +bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* in_image_ptr, + const VkImageSubresource& in_subresource, + const VkOffset3D& in_offset, + VkExtent3D in_extent, + MemoryFeatureFlags in_required_memory_features, + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { const Anvil::SparseImageAspectProperties* aspect_props_ptr = nullptr; uint32_t component_size_bits[4] = {0}; @@ -1094,6 +1188,8 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* anvil_assert(in_image_ptr->has_aspects (in_subresource.aspectMask) ); anvil_assert(in_image_ptr->get_n_mipmaps () > in_subresource.mipLevel); anvil_assert(in_image_ptr->get_create_info_ptr()->get_n_layers () > in_subresource.arrayLayer); + anvil_assert( in_opt_device_mask_ptr == nullptr || + (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); anvil_assert(in_extent.depth >= 1); anvil_assert(in_extent.height >= 1); @@ -1101,6 +1197,14 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* anvil_assert((Anvil::Utils::is_pow2(static_cast(in_subresource.aspectMask)) != 0)); // only permit a single aspect + if (!do_mgpu_sanity_checks(in_opt_device_mask_ptr, + in_opt_mgpu_peer_memory_reqs_ptr) ) + { + result = false; + + goto end; + } + if (mutex_ptr != nullptr) { mutex_lock = std::move( @@ -1116,7 +1220,7 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* } /* Extract image properties needed for calculations below. */ - result = in_image_ptr->get_sparse_image_aspect_properties(static_cast(in_subresource.aspectMask), + result = in_image_ptr->get_sparse_image_aspect_properties(static_cast(in_subresource.aspectMask), &aspect_props_ptr); anvil_assert(result); @@ -1250,7 +1354,9 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* #if defined(_WIN32) nullptr, /* in_alloc_external_nt_handle_info_ptr */ #endif - false) /* in_alloc_is_dedicated - sparse images do not supported dedicated allocs */ + false, /* in_alloc_is_dedicated - sparse images do not supported dedicated allocs */ + (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr : 0, + (in_opt_mgpu_peer_memory_reqs_ptr != nullptr) ? *in_opt_mgpu_peer_memory_reqs_ptr : MGPUPeerMemoryRequirements() ) ); m_items.push_back( @@ -1263,6 +1369,7 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* return result; } + /* Please see header for specification */ bool Anvil::MemoryAllocator::bake() { @@ -1298,7 +1405,12 @@ bool Anvil::MemoryAllocator::bake() } result = m_backend_ptr->bake(m_items); - anvil_assert(result); + if (!result) + { + m_items.clear(); + + goto end; + } /* Prepare a sparse memory binding structure, if we're going to need one */ for (auto item_iterator = m_items.begin(); @@ -1381,6 +1493,7 @@ bool Anvil::MemoryAllocator::bake() } else { + /* Bind with default device indices in MGPU case. */ item_ptr->buffer_ptr->set_nonsparse_memory( std::move(item_ptr->alloc_memory_block_ptr) ); @@ -1443,6 +1556,7 @@ bool Anvil::MemoryAllocator::bake() } else { + /* Bind with default device indices in MGPU case. */ item_ptr->image_ptr->set_memory( std::move(item_ptr->alloc_memory_block_ptr) ); @@ -1729,6 +1843,49 @@ bool Anvil::MemoryAllocator::do_external_memory_handle_type_sanity_checks(const return result; } +bool Anvil::MemoryAllocator::do_mgpu_sanity_checks(const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_peer_memory_reqs_ptr) const +{ + bool result = true; + +#if 0 + if (in_opt_peer_memory_reqs_ptr != nullptr) + { + const auto device_mask = (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr + : UINT32_MAX; + + for (const auto& current_req : *in_opt_peer_memory_reqs_ptr) + { + const auto& local_device_index = current_req.first.first; + const auto& remote_device_index = current_req.first.second; + + if ((device_mask & (1 << local_device_index) ) == 0) + { + anvil_assert((device_mask & (1 << local_device_index) ) != 0); + + result = false; + goto end; + } + + if ((device_mask & (1 << remote_device_index) ) == 0) + { + anvil_assert((device_mask & (1 << remote_device_index) ) != 0); + + result = false; + goto end; + } + } + } + +end: +#else + ANVIL_REDUNDANT_ARGUMENT(in_opt_device_mask_ptr); + ANVIL_REDUNDANT_ARGUMENT(in_opt_peer_memory_reqs_ptr); +#endif + + return result; +} + /** Tells whether or not a given set of memory types supports the requested memory features. */ bool Anvil::MemoryAllocator::is_alloc_supported(uint32_t in_memory_types, Anvil::MemoryFeatureFlags in_memory_features, @@ -1739,6 +1896,7 @@ bool Anvil::MemoryAllocator::is_alloc_supported(uint32_t in_mem const bool is_host_cached_memory_required (((in_memory_features & MEMORY_FEATURE_FLAG_HOST_CACHED) != 0) ); const bool is_lazily_allocated_memory_required(((in_memory_features & MEMORY_FEATURE_FLAG_LAZILY_ALLOCATED) != 0) ); const bool is_mappable_memory_required (((in_memory_features & MEMORY_FEATURE_FLAG_MAPPABLE) != 0) ); + const bool is_multi_instance_memory_required (((in_memory_features & MEMORY_FEATURE_FLAG_MULTI_INSTANCE) != 0) ); const auto& memory_props (m_device_ptr->get_physical_device_memory_properties() ); bool result (true); @@ -1751,7 +1909,8 @@ bool Anvil::MemoryAllocator::is_alloc_supported(uint32_t in_mem (is_device_local_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) || (is_host_cached_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT)) || (is_lazily_allocated_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT)) || - (is_mappable_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)) ) + (is_mappable_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)) || + (is_multi_instance_memory_required && !(memory_props.types[n_memory_type].heap_ptr->flags & VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR)) ) { in_memory_types &= ~(1 << n_memory_type); } diff --git a/src/misc/memory_block_create_info.cpp b/src/misc/memory_block_create_info.cpp index d2d72d45..be59dd05 100644 --- a/src/misc/memory_block_create_info.cpp +++ b/src/misc/memory_block_create_info.cpp @@ -22,6 +22,7 @@ #include "misc/memory_block_create_info.h" #include "wrappers/device.h" #include "wrappers/memory_block.h" +#include "wrappers/physical_device.h" Anvil::MemoryBlockCreateInfoUniquePtr Anvil::MemoryBlockCreateInfo::create_derived(MemoryBlock* in_parent_memory_block_ptr, @@ -40,7 +41,7 @@ Anvil::MemoryBlockCreateInfoUniquePtr Anvil::MemoryBlockCreateInfo::create_deriv const_cast(in_parent_memory_block_ptr->get_create_info_ptr()->m_device_ptr), VK_NULL_HANDLE, /* in_memory */ in_parent_memory_block_ptr->get_create_info_ptr()->m_memory_features, - UINT32_MAX, /* in_memory_type_index */ + in_parent_memory_block_ptr->get_create_info_ptr()->m_memory_type_index, n_physical_devices, Anvil::OnMemoryBlockReleaseCallbackFunction(), (n_physical_devices != 0) ? &in_parent_memory_block_ptr->get_create_info_ptr()->m_physical_devices.at(0) @@ -90,10 +91,30 @@ Anvil::MemoryBlockCreateInfoUniquePtr Anvil::MemoryBlockCreateInfo::create_regul VkDeviceSize in_size, Anvil::MemoryFeatureFlags in_memory_features) { - auto result_ptr = Anvil::MemoryBlockCreateInfoUniquePtr(nullptr, - std::default_delete() ); + std::vector physical_devices; + auto result_ptr = Anvil::MemoryBlockCreateInfoUniquePtr(nullptr, + std::default_delete() ); - anvil_assert(in_device_ptr->get_type() == Anvil::DEVICE_TYPE_SINGLE_GPU); /* todo: pass physical device array below accordingly */ + if (in_device_ptr->get_type() == Anvil::DEVICE_TYPE_MULTI_GPU) + { + const auto device_mgpu_ptr = dynamic_cast(in_device_ptr); + const uint32_t n_physical_devices = device_mgpu_ptr->get_n_physical_devices(); + + anvil_assert(n_physical_devices > 0); + + physical_devices.resize(n_physical_devices); + + for (uint32_t n_physical_device = 0; + n_physical_device < n_physical_devices; + ++n_physical_device) + { + physical_devices.at(n_physical_device) = device_mgpu_ptr->get_physical_device(n_physical_device); + } + } + else + { + /* Moot */ + } result_ptr.reset( new Anvil::MemoryBlockCreateInfo(Anvil::MemoryBlockType::REGULAR, @@ -102,9 +123,10 @@ Anvil::MemoryBlockCreateInfoUniquePtr Anvil::MemoryBlockCreateInfo::create_regul VK_NULL_HANDLE, /* in_memory */ in_memory_features, 0, /* in_memory_type_index */ - 0, /* in_n_physical_devices */ + static_cast(physical_devices.size() ), OnMemoryBlockReleaseCallbackFunction(), - nullptr, /* in_physical_device_ptr_ptr */ + (physical_devices.size() > 0) ? &physical_devices.at(0) + : nullptr, nullptr, /* in_parent_memory_block_ptr */ in_size, 0) /* in_start_offset */ @@ -128,6 +150,7 @@ Anvil::MemoryBlockCreateInfo::MemoryBlockCreateInfo(const Anvil::MemoryBlockType :m_allowed_memory_bits (in_allowed_memory_bits), m_dedicated_allocation_buffer_ptr (nullptr), m_dedicated_allocation_image_ptr (nullptr), + m_device_mask (0), m_device_ptr (in_device_ptr), m_exportable_external_memory_handle_types (Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE), #ifdef _WIN32 @@ -146,6 +169,12 @@ Anvil::MemoryBlockCreateInfo::MemoryBlockCreateInfo(const Anvil::MemoryBlockType m_type (in_type), m_use_dedicated_allocation (false) { + if (in_parent_memory_block_ptr != nullptr) + { + m_device_mask = in_parent_memory_block_ptr->get_create_info_ptr()->m_device_mask; + m_physical_devices = in_parent_memory_block_ptr->get_create_info_ptr()->m_physical_devices; + } + else if (in_n_physical_devices != 0) { anvil_assert(in_opt_physical_device_ptr_ptr != nullptr); @@ -156,9 +185,26 @@ Anvil::MemoryBlockCreateInfo::MemoryBlockCreateInfo(const Anvil::MemoryBlockType n_physical_device < in_n_physical_devices; ++n_physical_device) { + m_device_mask |= 1 << (in_opt_physical_device_ptr_ptr[n_physical_device]->get_device_group_device_index() ); + m_physical_devices.at(n_physical_device) = in_opt_physical_device_ptr_ptr[n_physical_device]; } } + else + { + if (m_device_ptr->get_type() == Anvil::DeviceType::DEVICE_TYPE_MULTI_GPU) + { + const auto device_mgpu_ptr = dynamic_cast(m_device_ptr); + const uint32_t n_physical_devices = device_mgpu_ptr->get_n_physical_devices(); + + for (uint32_t n_physical_device = 0; + n_physical_device < n_physical_devices; + ++n_physical_device) + { + m_device_mask |= 1 << (device_mgpu_ptr->get_physical_device(n_physical_device)->get_device_group_device_index() ); + } + } + } } Anvil::MemoryFeatureFlags Anvil::MemoryBlockCreateInfo::get_memory_features() const diff --git a/src/misc/render_pass_create_info.cpp b/src/misc/render_pass_create_info.cpp index ea0bb8e6..399671e3 100644 --- a/src/misc/render_pass_create_info.cpp +++ b/src/misc/render_pass_create_info.cpp @@ -42,14 +42,14 @@ Anvil::RenderPassCreateInfo::~RenderPassCreateInfo() } /* Please see haeder for specification */ -bool Anvil::RenderPassCreateInfo::add_color_attachment(VkFormat in_format, - VkSampleCountFlags in_sample_count, - VkAttachmentLoadOp in_load_op, - VkAttachmentStoreOp in_store_op, - VkImageLayout in_initial_layout, - VkImageLayout in_final_layout, - bool in_may_alias, - RenderPassAttachmentID* out_attachment_id_ptr) +bool Anvil::RenderPassCreateInfo::add_color_attachment(Anvil::Format in_format, + Anvil::SampleCountFlagBits in_sample_count, + VkAttachmentLoadOp in_load_op, + VkAttachmentStoreOp in_store_op, + Anvil::ImageLayout in_initial_layout, + Anvil::ImageLayout in_final_layout, + bool in_may_alias, + RenderPassAttachmentID* out_attachment_id_ptr) { uint32_t new_attachment_index = UINT32_MAX; bool result = false; @@ -121,16 +121,16 @@ bool Anvil::RenderPassCreateInfo::add_dependency(SubPass* in_destina } /* Please see header for specification */ -bool Anvil::RenderPassCreateInfo::add_depth_stencil_attachment(VkFormat in_format, - VkSampleCountFlags in_sample_count, - VkAttachmentLoadOp in_depth_load_op, - VkAttachmentStoreOp in_depth_store_op, - VkAttachmentLoadOp in_stencil_load_op, - VkAttachmentStoreOp in_stencil_store_op, - VkImageLayout in_initial_layout, - VkImageLayout in_final_layout, - bool in_may_alias, - RenderPassAttachmentID* out_attachment_id_ptr) +bool Anvil::RenderPassCreateInfo::add_depth_stencil_attachment(Anvil::Format in_format, + Anvil::SampleCountFlagBits in_sample_count, + VkAttachmentLoadOp in_depth_load_op, + VkAttachmentStoreOp in_depth_store_op, + VkAttachmentLoadOp in_stencil_load_op, + VkAttachmentStoreOp in_stencil_store_op, + Anvil::ImageLayout in_initial_layout, + Anvil::ImageLayout in_final_layout, + bool in_may_alias, + RenderPassAttachmentID* out_attachment_id_ptr) { uint32_t new_attachment_index = UINT32_MAX; bool result = false; @@ -276,13 +276,14 @@ bool Anvil::RenderPassCreateInfo::add_subpass(SubPassID* out_subpass_id_ptr) * @return true if the function executed successfully, false otherwise. * **/ -bool Anvil::RenderPassCreateInfo::add_subpass_attachment(SubPassID in_subpass_id, - bool in_is_color_attachment, - VkImageLayout in_layout, - RenderPassAttachmentID in_attachment_id, - uint32_t in_attachment_location, - bool in_should_resolve, - RenderPassAttachmentID in_resolve_attachment_id) +bool Anvil::RenderPassCreateInfo::add_subpass_attachment(SubPassID in_subpass_id, + bool in_is_color_attachment, + Anvil::ImageLayout in_layout, + RenderPassAttachmentID in_attachment_id, + uint32_t in_attachment_location, + bool in_should_resolve, + RenderPassAttachmentID in_resolve_attachment_id, + const Anvil::ImageAspectFlags& in_opt_aspects_accessed) { bool result = false; LocationToSubPassAttachmentMap* subpass_attachments_ptr = nullptr; @@ -333,13 +334,15 @@ bool Anvil::RenderPassCreateInfo::add_subpass_attachment(SubPassID /* Add the attachment */ (*subpass_attachments_ptr)[in_attachment_location] = SubPassAttachment(in_attachment_id, in_layout, - in_resolve_attachment_id); + in_resolve_attachment_id, + in_opt_aspects_accessed); if (in_should_resolve) { subpass_ptr->resolved_attachments_map[in_attachment_location] = SubPassAttachment(in_resolve_attachment_id, in_layout, - UINT32_MAX); + UINT32_MAX, + in_opt_aspects_accessed); } m_update_preserved_attachments = true; @@ -351,7 +354,7 @@ bool Anvil::RenderPassCreateInfo::add_subpass_attachment(SubPassID /* Please see header for specification */ bool Anvil::RenderPassCreateInfo::add_subpass_color_attachment(SubPassID in_subpass_id, - VkImageLayout in_input_layout, + Anvil::ImageLayout in_input_layout, RenderPassAttachmentID in_attachment_id, uint32_t in_location, const RenderPassAttachmentID* in_attachment_resolve_id_ptr) @@ -367,9 +370,9 @@ bool Anvil::RenderPassCreateInfo::add_subpass_color_attachment(SubPassID } /* Please see header for specification */ -bool Anvil::RenderPassCreateInfo::add_subpass_depth_stencil_attachment(SubPassID in_subpass_id, - VkImageLayout in_layout, - RenderPassAttachmentID in_attachment_id) +bool Anvil::RenderPassCreateInfo::add_subpass_depth_stencil_attachment(SubPassID in_subpass_id, + Anvil::ImageLayout in_layout, + RenderPassAttachmentID in_attachment_id) { bool result = false; SubPass* subpass_ptr = nullptr; @@ -404,7 +407,8 @@ bool Anvil::RenderPassCreateInfo::add_subpass_depth_stencil_attachment(SubPassID subpass_ptr->depth_stencil_attachment = SubPassAttachment(in_attachment_id, in_layout, - UINT32_MAX); + UINT32_MAX, + Anvil::ImageAspectFlagBits::IMAGE_ASPECT_UNKNOWN); m_update_preserved_attachments = true; result = true; @@ -413,10 +417,11 @@ bool Anvil::RenderPassCreateInfo::add_subpass_depth_stencil_attachment(SubPassID } /* Please see header for specification */ -bool Anvil::RenderPassCreateInfo::add_subpass_input_attachment(SubPassID in_subpass_id, - VkImageLayout in_layout, - RenderPassAttachmentID in_attachment_id, - uint32_t in_attachment_index) +bool Anvil::RenderPassCreateInfo::add_subpass_input_attachment(SubPassID in_subpass_id, + Anvil::ImageLayout in_layout, + RenderPassAttachmentID in_attachment_id, + uint32_t in_attachment_index, + const Anvil::ImageAspectFlags& in_opt_aspects_accessed) { return add_subpass_attachment(in_subpass_id, false, /* is_color_attachment */ @@ -424,7 +429,8 @@ bool Anvil::RenderPassCreateInfo::add_subpass_input_attachment(SubPassID in_attachment_id, in_attachment_index, false, /* should_resolve */ - UINT32_MAX); /* resolve_attachment_id */ + UINT32_MAX, /* resolve_attachment_id */ + in_opt_aspects_accessed); } /* Please see header for specification */ @@ -510,7 +516,7 @@ VkAttachmentReference Anvil::RenderPassCreateInfo::get_attachment_reference_from VkAttachmentReference attachment_vk; attachment_vk.attachment = in_renderpass_attachment.index; - attachment_vk.layout = in_renderpass_attachment.initial_layout; + attachment_vk.layout = static_cast(in_renderpass_attachment.initial_layout); return attachment_vk; } @@ -526,7 +532,7 @@ VkAttachmentReference Anvil::RenderPassCreateInfo::get_attachment_reference_from VkAttachmentReference attachment_vk; attachment_vk.attachment = m_attachments.at(in_subpass_attachment.attachment_index).index; - attachment_vk.layout = in_subpass_attachment.layout; + attachment_vk.layout = static_cast(in_subpass_attachment.layout); return attachment_vk; } @@ -546,7 +552,7 @@ VkAttachmentReference Anvil::RenderPassCreateInfo::get_attachment_reference_for_ anvil_assert((*in_subpass_iterator)->resolved_attachments_map.find(in_location_to_subpass_att_map_iterator->first) != (*in_subpass_iterator)->resolved_attachments_map.end() ); result.attachment = m_attachments.at(in_location_to_subpass_att_map_iterator->second.resolve_attachment_index).index; - result.layout = (*in_subpass_iterator)->resolved_attachments_map.at(in_location_to_subpass_att_map_iterator->first).layout; + result.layout = static_cast((*in_subpass_iterator)->resolved_attachments_map.at(in_location_to_subpass_att_map_iterator->first).layout); return result; } @@ -573,13 +579,13 @@ bool Anvil::RenderPassCreateInfo::get_attachment_type(RenderPassAttachmentID in_ } /* Please see header for specification */ -bool Anvil::RenderPassCreateInfo::get_color_attachment_properties(RenderPassAttachmentID in_attachment_id, - VkSampleCountFlagBits* out_opt_sample_count_ptr, - VkAttachmentLoadOp* out_opt_load_op_ptr, - VkAttachmentStoreOp* out_opt_store_op_ptr, - VkImageLayout* out_opt_initial_layout_ptr, - VkImageLayout* out_opt_final_layout_ptr, - bool* out_opt_may_alias_ptr) const +bool Anvil::RenderPassCreateInfo::get_color_attachment_properties(RenderPassAttachmentID in_attachment_id, + Anvil::SampleCountFlagBits* out_opt_sample_count_ptr, + VkAttachmentLoadOp* out_opt_load_op_ptr, + VkAttachmentStoreOp* out_opt_store_op_ptr, + Anvil::ImageLayout* out_opt_initial_layout_ptr, + Anvil::ImageLayout* out_opt_final_layout_ptr, + bool* out_opt_may_alias_ptr) const { bool result = false; @@ -590,7 +596,7 @@ bool Anvil::RenderPassCreateInfo::get_color_attachment_properties(RenderPassAtta if (out_opt_sample_count_ptr != nullptr) { - *out_opt_sample_count_ptr = static_cast(m_attachments[in_attachment_id].sample_count); + *out_opt_sample_count_ptr = m_attachments[in_attachment_id].sample_count; } if (out_opt_load_op_ptr != nullptr) @@ -631,7 +637,7 @@ bool Anvil::RenderPassCreateInfo::get_dependency_properties(uint32_t VkPipelineStageFlags* out_source_stage_mask_ptr, VkAccessFlags* out_destination_access_mask_ptr, VkAccessFlags* out_source_access_mask_ptr, - bool* out_by_region_ptr) const + DependencyFlags* out_flags_ptr) const { const Anvil::RenderPassCreateInfo::SubPassDependency* dep_ptr = nullptr; bool result = false; @@ -647,13 +653,13 @@ bool Anvil::RenderPassCreateInfo::get_dependency_properties(uint32_t *out_destination_subpass_id_ptr = (dep_ptr->destination_subpass_ptr != nullptr) ? dep_ptr->destination_subpass_ptr->index : UINT32_MAX; + *out_flags_ptr = dep_ptr->flags; *out_source_subpass_id_ptr = (dep_ptr->source_subpass_ptr != nullptr) ? dep_ptr->source_subpass_ptr->index : UINT32_MAX; *out_destination_stage_mask_ptr = dep_ptr->destination_stage_mask; *out_source_stage_mask_ptr = dep_ptr->source_stage_mask; *out_destination_access_mask_ptr = dep_ptr->destination_access_mask; *out_source_access_mask_ptr = dep_ptr->source_access_mask; - *out_by_region_ptr = dep_ptr->by_region; /* All done */ result = true; @@ -667,8 +673,8 @@ bool Anvil::RenderPassCreateInfo::get_depth_stencil_attachment_properties(Render VkAttachmentStoreOp* out_opt_depth_store_op_ptr, VkAttachmentLoadOp* out_opt_stencil_load_op_ptr, VkAttachmentStoreOp* out_opt_stencil_store_op_ptr, - VkImageLayout* out_opt_initial_layout_ptr, - VkImageLayout* out_opt_final_layout_ptr, + Anvil::ImageLayout* out_opt_initial_layout_ptr, + Anvil::ImageLayout* out_opt_final_layout_ptr, bool* out_opt_may_alias_ptr) const { bool result = false; @@ -796,11 +802,12 @@ bool Anvil::RenderPassCreateInfo::get_subpass_n_attachments(SubPassID in_su } /* Please see header for specification */ -bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID in_subpass_id, - AttachmentType in_attachment_type, - uint32_t in_n_subpass_attachment, - RenderPassAttachmentID* out_renderpass_attachment_id_ptr, - VkImageLayout* out_layout_ptr) const +bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID in_subpass_id, + AttachmentType in_attachment_type, + uint32_t in_n_subpass_attachment, + RenderPassAttachmentID* out_renderpass_attachment_id_ptr, + Anvil::ImageLayout* out_layout_ptr, + Anvil::ImageAspectFlags* out_opt_aspects_accessed_ptr) const { SubPassAttachment attachment; bool result = false; @@ -856,6 +863,11 @@ bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID goto end; } + if (out_opt_aspects_accessed_ptr != nullptr) + { + *out_opt_aspects_accessed_ptr = iterator->second.aspects_accessed; + } + *out_layout_ptr = iterator->second.layout; *out_renderpass_attachment_id_ptr = m_attachments.at(iterator->second.attachment_index).index; @@ -871,6 +883,11 @@ bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID goto end; } + if (out_opt_aspects_accessed_ptr != nullptr) + { + *out_opt_aspects_accessed_ptr = Anvil::ImageAspectFlagBits::IMAGE_ASPECT_UNKNOWN; + } + *out_layout_ptr = subpass_ptr->depth_stencil_attachment.layout; *out_renderpass_attachment_id_ptr = m_attachments.at(subpass_ptr->depth_stencil_attachment.attachment_index).index; @@ -889,6 +906,12 @@ bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID const auto& attachment_props = subpass_ptr->preserved_attachments[in_n_subpass_attachment]; *out_renderpass_attachment_id_ptr = m_attachments.at(attachment_props.attachment_index).index; + + if (out_opt_aspects_accessed_ptr != nullptr) + { + *out_opt_aspects_accessed_ptr = Anvil::ImageAspectFlagBits::IMAGE_ASPECT_UNKNOWN; + } + break; } diff --git a/src/misc/swapchain_create_info.cpp b/src/misc/swapchain_create_info.cpp index 0b548528..6f446164 100644 --- a/src/misc/swapchain_create_info.cpp +++ b/src/misc/swapchain_create_info.cpp @@ -26,9 +26,9 @@ Anvil::SwapchainCreateInfoUniquePtr Anvil::SwapchainCreateInfo::create(Anvil::BaseDevice* in_device_ptr, Anvil::RenderingSurface* in_parent_surface_ptr, Anvil::Window* in_window_ptr, - VkFormat in_format, + Anvil::Format in_format, VkPresentModeKHR in_present_mode, - VkImageUsageFlags in_usage_flags, + Anvil::ImageUsageFlags in_usage_flags, uint32_t in_n_images) { SwapchainCreateInfoUniquePtr result_ptr = SwapchainCreateInfoUniquePtr(nullptr, @@ -43,30 +43,33 @@ Anvil::SwapchainCreateInfoUniquePtr Anvil::SwapchainCreateInfo::create(Anvil::Ba in_usage_flags, in_n_images, Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, - 0) /* in_flags */ + 0, /* in_flags */ + VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR) /* in_mgpu_present_mode_flags */ ); return result_ptr; } -Anvil::SwapchainCreateInfo::SwapchainCreateInfo(Anvil::BaseDevice* in_device_ptr, - Anvil::RenderingSurface* in_parent_surface_ptr, - Anvil::Window* in_window_ptr, - VkFormat in_format, - VkPresentModeKHR in_present_mode, - VkImageUsageFlags in_usage_flags, - uint32_t in_n_images, - MTSafety in_mt_safety, - VkSwapchainCreateFlagsKHR in_flags) - :m_device_ptr (in_device_ptr), - m_flags (in_flags), - m_format (in_format), - m_mt_safety (in_mt_safety), - m_n_images (in_n_images), - m_parent_surface_ptr(in_parent_surface_ptr), - m_present_mode (in_present_mode), - m_usage_flags (in_usage_flags), - m_window_ptr (in_window_ptr) +Anvil::SwapchainCreateInfo::SwapchainCreateInfo(Anvil::BaseDevice* in_device_ptr, + Anvil::RenderingSurface* in_parent_surface_ptr, + Anvil::Window* in_window_ptr, + Anvil::Format in_format, + VkPresentModeKHR in_present_mode, + Anvil::ImageUsageFlags in_usage_flags, + uint32_t in_n_images, + MTSafety in_mt_safety, + VkSwapchainCreateFlagsKHR in_flags, + VkDeviceGroupPresentModeFlagsKHR in_mgpu_present_mode_flags) + :m_device_ptr (in_device_ptr), + m_flags (in_flags), + m_format (in_format), + m_mgpu_present_mode_flags(in_mgpu_present_mode_flags), + m_mt_safety (in_mt_safety), + m_n_images (in_n_images), + m_parent_surface_ptr (in_parent_surface_ptr), + m_present_mode (in_present_mode), + m_usage_flags (in_usage_flags), + m_window_ptr (in_window_ptr) { anvil_assert(in_n_images > 0); anvil_assert(in_parent_surface_ptr != nullptr); diff --git a/src/misc/types_classes.cpp b/src/misc/types_classes.cpp index dd0358c3..7689991a 100644 --- a/src/misc/types_classes.cpp +++ b/src/misc/types_classes.cpp @@ -201,7 +201,8 @@ void Anvil::SparseMemoryBindingUpdateInfo::bake() if (n_bindings > 0) { - m_bindings_vk.resize(n_bindings); + m_bindings_vk.resize (n_bindings); + m_device_group_bindings_vk.resize(n_bindings); m_buffer_bindings_vk.clear(); @@ -241,6 +242,19 @@ void Anvil::SparseMemoryBindingUpdateInfo::bake() vk_binding.sType = VK_STRUCTURE_TYPE_BIND_SPARSE_INFO; vk_binding.waitSemaphoreCount = static_cast(bind_info.wait_semaphores_vk.size() ); + if (bind_info.memory_device_index != 0 || + bind_info.resource_device_index != 0) + { + auto& device_group_binding_info = m_device_group_bindings_vk.at(n_binding); + + device_group_binding_info.memoryDeviceIndex = bind_info.memory_device_index; + device_group_binding_info.pNext = nullptr; + device_group_binding_info.resourceDeviceIndex = bind_info.resource_device_index; + device_group_binding_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHR; + + vk_binding.pNext = &device_group_binding_info; + } + n_buffer_bindings_start_index = static_cast(m_buffer_bindings_vk.size() ); n_image_bindings_start_index = static_cast(m_image_bindings_vk.size() ); n_image_opaque_bindings_start_index = static_cast(m_image_opaque_bindings_vk.size() ); @@ -489,6 +503,39 @@ bool Anvil::SparseMemoryBindingUpdateInfo::get_buffer_memory_update_properties(S return result; } +/** Please see header for specification */ +bool Anvil::SparseMemoryBindingUpdateInfo::get_device_indices(SparseMemoryBindInfoID in_bind_info_id, + uint32_t* out_opt_resource_device_index_ptr, + uint32_t* out_opt_memory_device_index_ptr) const +{ + decltype(m_bindings)::const_iterator binding_iterator; + bool result (false); + + if (m_bindings.size() <= in_bind_info_id) + { + anvil_assert(!(m_bindings.size() <= in_bind_info_id) ); + + goto end; + } + + binding_iterator = m_bindings.cbegin() + static_cast(in_bind_info_id); + + if (out_opt_resource_device_index_ptr != nullptr) + { + *out_opt_resource_device_index_ptr = binding_iterator->resource_device_index; + } + + if (out_opt_memory_device_index_ptr != nullptr) + { + *out_opt_memory_device_index_ptr = binding_iterator->memory_device_index; + } + + /* All done */ + result = true; +end: + return result; +} + /** Please see header for specification */ bool Anvil::SparseMemoryBindingUpdateInfo::get_image_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, uint32_t in_n_update, @@ -678,3 +725,84 @@ bool Anvil::SparseMemoryBindingUpdateInfo::get_image_opaque_memory_update_proper end: return result; } + +/** Please see header for specification */ +bool Anvil::SparseMemoryBindingUpdateInfo::is_device_group_support_required() const +{ + bool result(false); + + for (const auto& binding_iterator : m_bindings) + { + if (binding_iterator.memory_device_index != 0 || + binding_iterator.resource_device_index != 0) + { + result = true; + + break; + } + } + + return result; +} + +/* Updates memory device index, associated with this batch. + * + * Do not modify unless VK_KHR_device_group is supported + * + * @param in_memory_device_index New memory device index to use. + * + **/ +void Anvil::SparseMemoryBindingUpdateInfo::set_memory_device_index(SparseMemoryBindInfoID in_bind_info_id, + const uint32_t& in_memory_device_index) +{ + decltype(m_bindings)::iterator binding_iterator; + + if (m_bindings.size() <= in_bind_info_id) + { + anvil_assert(!(m_bindings.size() <= in_bind_info_id) ); + + goto end; + } + + binding_iterator = m_bindings.begin() + static_cast(in_bind_info_id); + + if (binding_iterator->memory_device_index != in_memory_device_index) + { + m_dirty = true; + binding_iterator->memory_device_index = in_memory_device_index; + } + +end: + ; +} + +/* Updates resource device index, associated with this batch. + * + * Do not modify unless VK_KHR_device_group is supported + * + * @param in_resource_device_index New resource device index to use. + * + **/ +void Anvil::SparseMemoryBindingUpdateInfo::set_resource_device_index(SparseMemoryBindInfoID in_bind_info_id, + const uint32_t& in_resource_device_index) +{ + decltype(m_bindings)::iterator binding_iterator; + + if (m_bindings.size() <= in_bind_info_id) + { + anvil_assert(!(m_bindings.size() <= in_bind_info_id) ); + + goto end; + } + + binding_iterator = m_bindings.begin() + static_cast(in_bind_info_id); + + if (binding_iterator->resource_device_index != in_resource_device_index) + { + m_dirty = true; + binding_iterator->resource_device_index = in_resource_device_index; + } + +end: + ; +} diff --git a/src/misc/types_struct.cpp b/src/misc/types_struct.cpp index f10806a0..d01f7915 100644 --- a/src/misc/types_struct.cpp +++ b/src/misc/types_struct.cpp @@ -143,6 +143,14 @@ Anvil::BufferProperties::BufferProperties(const ExternalMemoryProperties& in_ext /* Stub */ } + +Anvil::BufferMemoryBindingUpdate::BufferMemoryBindingUpdate() +{ + buffer_ptr = nullptr; + memory_block_owned_by_buffer = false; + memory_block_ptr = nullptr; +} + Anvil::DescriptorSetAllocation::DescriptorSetAllocation(const Anvil::DescriptorSetLayout* in_ds_layout_ptr) { anvil_assert( in_ds_layout_ptr != nullptr); @@ -316,6 +324,17 @@ Anvil::ExtensionEXTDebugReportEntrypoints::ExtensionEXTDebugReportEntrypoints() vkDestroyDebugReportCallbackEXT = nullptr; } +Anvil::ExtensionKHRDeviceGroupEntrypoints::ExtensionKHRDeviceGroupEntrypoints() +{ + vkAcquireNextImage2KHR = nullptr; + vkCmdDispatchBaseKHR = nullptr; + vkGetDeviceGroupPeerMemoryFeaturesKHR = nullptr; + vkGetDeviceGroupPresentCapabilitiesKHR = nullptr; + vkGetDeviceGroupSurfacePresentModesKHR = nullptr; + vkGetPhysicalDevicePresentRectanglesKHR = nullptr; + vkCmdSetDeviceMaskKHR = nullptr; +} + Anvil::ExtensionKHRBindMemory2Entrypoints::ExtensionKHRBindMemory2Entrypoints() { vkBindBufferMemory2KHR = nullptr; @@ -762,8 +781,8 @@ Anvil::ImageBarrier::ImageBarrier(const ImageBarrier& in) Anvil::ImageBarrier::ImageBarrier(VkAccessFlags in_source_access_mask, VkAccessFlags in_destination_access_mask, bool in_by_region_barrier, - VkImageLayout in_old_layout, - VkImageLayout in_new_layout, + Anvil::ImageLayout in_old_layout, + Anvil::ImageLayout in_new_layout, uint32_t in_src_queue_family_index, uint32_t in_dst_queue_family_index, Anvil::Image* in_image_ptr, @@ -785,8 +804,8 @@ Anvil::ImageBarrier::ImageBarrier(VkAccessFlags in_source_access_mask, image_barrier_vk.dstQueueFamilyIndex = in_dst_queue_family_index; image_barrier_vk.image = (in_image_ptr != nullptr) ? in_image_ptr->get_image() : VK_NULL_HANDLE; - image_barrier_vk.newLayout = in_new_layout; - image_barrier_vk.oldLayout = in_old_layout; + image_barrier_vk.newLayout = static_cast(in_new_layout); + image_barrier_vk.oldLayout = static_cast(in_old_layout); image_barrier_vk.pNext = nullptr; image_barrier_vk.srcAccessMask = in_source_access_mask; image_barrier_vk.srcQueueFamilyIndex = in_src_queue_family_index; @@ -830,6 +849,20 @@ bool Anvil::ImageBarrier::operator==(const ImageBarrier& in_barrier) const return result; } +Anvil::ImagePhysicalDeviceMemoryBindingUpdate::ImagePhysicalDeviceMemoryBindingUpdate() +{ + image_ptr = nullptr; + memory_block_ptr = nullptr; + memory_block_owned_by_image = false; +} + +Anvil::ImageSFRMemoryBindingUpdate::ImageSFRMemoryBindingUpdate() +{ + image_ptr = nullptr; + memory_block_owned_by_image = false; + memory_block_ptr = nullptr; +} + Anvil::KHR16BitStorageFeatures::KHR16BitStorageFeatures() { is_input_output_storage_supported = false; @@ -869,6 +902,23 @@ VkPhysicalDevice16BitStorageFeaturesKHR Anvil::KHR16BitStorageFeatures::get_vk_p } +Anvil::KHRMaintenance2PhysicalDevicePointClippingProperties::KHRMaintenance2PhysicalDevicePointClippingProperties() + :point_clipping_behavior(PointClippingBehavior::UNKNOWN) +{ + /* Stub */ +} + +Anvil::KHRMaintenance2PhysicalDevicePointClippingProperties::KHRMaintenance2PhysicalDevicePointClippingProperties(const VkPhysicalDevicePointClippingPropertiesKHR& in_props) + :point_clipping_behavior(static_cast(in_props.pointClippingBehavior) ) +{ + /* Stub */ +} + +bool Anvil::KHRMaintenance2PhysicalDevicePointClippingProperties::operator==(const Anvil::KHRMaintenance2PhysicalDevicePointClippingProperties& in_props) const +{ + return (in_props.point_clipping_behavior == point_clipping_behavior); +} + Anvil::KHRMaintenance3Properties::KHRMaintenance3Properties() :max_memory_allocation_size(std::numeric_limits::max() ), max_per_set_descriptors (UINT32_MAX) @@ -924,6 +974,7 @@ Anvil::MemoryBarrier::MemoryBarrier(VkAccessFlags in_destination_access_mask, Anvil::MemoryHeap::MemoryHeap() { flags = 0; + index = UINT32_MAX; size = 0; } @@ -979,6 +1030,7 @@ void Anvil::MemoryProperties::init(const VkPhysicalDeviceMemoryProperties& in_me ++n_heap) { heaps[n_heap].flags = static_cast(in_mem_properties.memoryHeaps[n_heap].flags); + heaps[n_heap].index = n_heap; heaps[n_heap].size = in_mem_properties.memoryHeaps[n_heap].size; } @@ -1024,9 +1076,9 @@ bool Anvil::operator==(const Anvil::MemoryType& in1, * * NOTE: It is caller's responsibility to configure one of the data storage pointer members. */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_1D(VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - uint32_t in_row_size) +Anvil::MipmapRawData Anvil::MipmapRawData::create_1D(Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + uint32_t in_row_size) { MipmapRawData result; @@ -1048,12 +1100,12 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_1D(VkImageAspectFlagBits in_as * * NOTE: It is caller's responsibility to configure one of the data storage pointer members. */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_array(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - uint32_t in_row_size, - uint32_t in_data_size) +Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_array(Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + uint32_t in_row_size, + uint32_t in_data_size) { MipmapRawData result; @@ -1076,10 +1128,10 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_array(VkImageAspectFlagBits * * NOTE: It is caller's responsibility to configure one of the data storage pointer members. */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_2D(VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - uint32_t in_data_size, - uint32_t in_row_size) +Anvil::MipmapRawData Anvil::MipmapRawData::create_2D(Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + uint32_t in_data_size, + uint32_t in_row_size) { MipmapRawData result; @@ -1101,12 +1153,12 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_2D(VkImageAspectFlagBits in_as * * NOTE: It is caller's responsibility to configure one of the data storage pointer members. */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_array(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - uint32_t in_data_size, - uint32_t in_row_size) +Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_array(Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + uint32_t in_data_size, + uint32_t in_row_size) { MipmapRawData result; @@ -1129,12 +1181,12 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_array(VkImageAspectFlagBits * * NOTE: It is caller's responsibility to configure one of the data storage pointer members. */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_3D(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_slices, - uint32_t in_n_mipmap, - uint32_t in_data_size, - uint32_t in_row_size) +Anvil::MipmapRawData Anvil::MipmapRawData::create_3D(Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_slices, + uint32_t in_n_mipmap, + uint32_t in_data_size, + uint32_t in_row_size) { MipmapRawData result; @@ -1155,7 +1207,7 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_3D(VkImageAspectFlagBits in_as /* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_from_uchar_ptr(VkImageAspectFlagBits in_aspect, +Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_from_uchar_ptr(Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_mipmap, std::shared_ptr in_linear_tightly_packed_data_ptr, uint32_t in_row_size) @@ -1170,10 +1222,10 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_from_uchar_ptr(VkImageAspec } /* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_from_uchar_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - const unsigned char* in_linear_tightly_packed_data_ptr, - uint32_t in_row_size) +Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_from_uchar_ptr(Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + const unsigned char* in_linear_tightly_packed_data_ptr, + uint32_t in_row_size) { MipmapRawData result = create_1D(in_aspect, in_n_mipmap, @@ -1185,7 +1237,7 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_from_uchar_ptr(VkImageAspec } /* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, +Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_from_uchar_vector_ptr(Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_mipmap, std::shared_ptr > in_linear_tightly_packed_data_ptr, uint32_t in_row_size) @@ -1200,7 +1252,7 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_from_uchar_vector_ptr(VkIma } /* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_array_from_uchar_ptr(VkImageAspectFlagBits in_aspect, +Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_array_from_uchar_ptr(Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_layers, uint32_t in_n_mipmap, @@ -1221,13 +1273,13 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_array_from_uchar_ptr(VkImag } /* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_array_from_uchar_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - const unsigned char* in_linear_tightly_packed_data_ptr, - uint32_t in_row_size, - uint32_t in_data_size) +Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_array_from_uchar_ptr(Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + const unsigned char* in_linear_tightly_packed_data_ptr, + uint32_t in_row_size, + uint32_t in_data_size) { MipmapRawData result = create_1D_array(in_aspect, in_n_layer, @@ -1242,7 +1294,7 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_array_from_uchar_ptr(VkImag } /* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_array_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, +Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_array_from_uchar_vector_ptr(Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_layers, uint32_t in_n_mipmap, @@ -1263,7 +1315,7 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_array_from_uchar_vector_ptr } /* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_from_uchar_ptr(VkImageAspectFlagBits in_aspect, +Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_from_uchar_ptr(Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_mipmap, std::shared_ptr in_linear_tightly_packed_data_ptr, uint32_t in_data_size, @@ -1280,11 +1332,11 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_from_uchar_ptr(VkImageAspec } /* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_from_uchar_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_mipmap, - const unsigned char* in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size) +Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_from_uchar_ptr(Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_mipmap, + const unsigned char* in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size) { MipmapRawData result = create_2D(in_aspect, in_n_mipmap, @@ -1297,7 +1349,7 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_from_uchar_ptr(VkImageAspec } /* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, +Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_from_uchar_vector_ptr(Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_mipmap, std::shared_ptr > in_linear_tightly_packed_data_ptr, uint32_t in_data_size, @@ -1314,7 +1366,7 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_from_uchar_vector_ptr(VkIma } /* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_array_from_uchar_ptr(VkImageAspectFlagBits in_aspect, +Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_array_from_uchar_ptr(Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_layers, uint32_t in_n_mipmap, @@ -1335,13 +1387,13 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_array_from_uchar_ptr(VkImag } /* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_array_from_uchar_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - const unsigned char* in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size) +Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_array_from_uchar_ptr(Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + const unsigned char* in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size) { MipmapRawData result = create_2D_array(in_aspect, in_n_layer, @@ -1356,7 +1408,7 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_array_from_uchar_ptr(VkImag } /* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_array_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, +Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_array_from_uchar_vector_ptr(Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_layers, uint32_t in_n_mipmap, @@ -1379,7 +1431,7 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_array_from_uchar_vector_ptr /* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_3D_from_uchar_ptr(VkImageAspectFlagBits in_aspect, +Anvil::MipmapRawData Anvil::MipmapRawData::create_3D_from_uchar_ptr(Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_layer_slices, uint32_t in_n_mipmap, @@ -1400,13 +1452,13 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_3D_from_uchar_ptr(VkImageAspec } /* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_3D_from_uchar_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layer_slices, - uint32_t in_n_mipmap, - const unsigned char* in_linear_tightly_packed_data_ptr, - uint32_t in_slice_data_size, - uint32_t in_row_size) +Anvil::MipmapRawData Anvil::MipmapRawData::create_3D_from_uchar_ptr(Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layer_slices, + uint32_t in_n_mipmap, + const unsigned char* in_linear_tightly_packed_data_ptr, + uint32_t in_slice_data_size, + uint32_t in_row_size) { MipmapRawData result = create_3D(in_aspect, in_n_layer, @@ -1421,7 +1473,7 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_3D_from_uchar_ptr(VkImageAspec } /* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_3D_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, +Anvil::MipmapRawData Anvil::MipmapRawData::create_3D_from_uchar_vector_ptr(Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_layer_slices, uint32_t in_n_mipmap, @@ -1443,7 +1495,7 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_3D_from_uchar_vector_ptr(VkIma /* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_from_uchar_ptr(VkImageAspectFlagBits in_aspect, +Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_from_uchar_ptr(Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_mipmap, std::shared_ptr in_linear_tightly_packed_data_ptr, @@ -1465,12 +1517,12 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_from_uchar_ptr(VkImag } /* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_from_uchar_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_mipmap, - const unsigned char* in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size) +Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_from_uchar_ptr(Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_mipmap, + const unsigned char* in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size) { anvil_assert(in_n_layer < 6); @@ -1487,7 +1539,7 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_from_uchar_ptr(VkImag } /* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, +Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_from_uchar_vector_ptr(Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_mipmap, std::shared_ptr > in_linear_tightly_packed_data_ptr, @@ -1510,7 +1562,7 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_from_uchar_vector_ptr /* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_array_from_uchar_ptr(VkImageAspectFlagBits in_aspect, +Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_array_from_uchar_ptr(Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_layers, uint32_t in_n_mipmap, @@ -1531,13 +1583,13 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_array_from_uchar_ptr( } /* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_array_from_uchar_ptr(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_layers, - uint32_t in_n_mipmap, - const unsigned char* in_linear_tightly_packed_data_ptr, - uint32_t in_data_size, - uint32_t in_row_size) +Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_array_from_uchar_ptr(Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_layers, + uint32_t in_n_mipmap, + const unsigned char* in_linear_tightly_packed_data_ptr, + uint32_t in_data_size, + uint32_t in_row_size) { MipmapRawData result = create_2D_array(in_aspect, in_n_layer, @@ -1552,7 +1604,7 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_array_from_uchar_ptr( } /* Please see header for specification */ -Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_array_from_uchar_vector_ptr(VkImageAspectFlagBits in_aspect, +Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_array_from_uchar_vector_ptr(Anvil::ImageAspectFlagBits in_aspect, uint32_t in_n_layer, uint32_t in_n_layers, uint32_t in_n_mipmap, @@ -1577,6 +1629,7 @@ Anvil::PhysicalDeviceProperties::PhysicalDeviceProperties() amd_shader_core_properties_ptr = nullptr; core_vk1_0_properties_ptr = nullptr; ext_descriptor_indexing_properties_ptr = nullptr; + khr_maintenance2_point_clipping_properties_ptr = nullptr; khr_maintenance3_properties_ptr = nullptr; } @@ -1585,12 +1638,14 @@ Anvil::PhysicalDeviceProperties::PhysicalDeviceProperties(const AMDShaderCorePro const EXTDescriptorIndexingProperties* in_ext_descriptor_indexing_properties_ptr, const EXTVertexAttributeDivisorProperties* in_ext_vertex_attribute_divisor_properties_ptr, const Anvil::KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties* in_khr_external_memory_caps_physical_device_id_props_ptr, - const KHRMaintenance3Properties* in_khr_maintenance3_properties_ptr) + const KHRMaintenance3Properties* in_khr_maintenance3_properties_ptr, + const Anvil::KHRMaintenance2PhysicalDevicePointClippingProperties* in_khr_maintenance2_point_clipping_properties_ptr) :amd_shader_core_properties_ptr (in_amd_shader_core_properties_ptr), core_vk1_0_properties_ptr (in_core_vk1_0_properties_ptr), ext_descriptor_indexing_properties_ptr (in_ext_descriptor_indexing_properties_ptr), ext_vertex_attribute_divisor_properties_ptr (in_ext_vertex_attribute_divisor_properties_ptr), khr_external_memory_capabilities_physical_device_id_properties_ptr(in_khr_external_memory_caps_physical_device_id_props_ptr), + khr_maintenance2_point_clipping_properties_ptr (in_khr_maintenance2_point_clipping_properties_ptr), khr_maintenance3_properties_ptr (in_khr_maintenance3_properties_ptr) { /* Stub */ @@ -1635,10 +1690,10 @@ Anvil::PhysicalDeviceGroup::PhysicalDeviceGroup() Anvil::PhysicalDeviceLimits::PhysicalDeviceLimits() :buffer_image_granularity (std::numeric_limits::max() ), discrete_queue_priorities (UINT32_MAX), - framebuffer_color_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), - framebuffer_depth_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), - framebuffer_no_attachments_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), - framebuffer_stencil_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), + framebuffer_color_sample_counts (Anvil::SampleCountFlagBits::SAMPLE_COUNT_UNKNOWN), + framebuffer_depth_sample_counts (Anvil::SampleCountFlagBits::SAMPLE_COUNT_UNKNOWN), + framebuffer_no_attachments_sample_counts (Anvil::SampleCountFlagBits::SAMPLE_COUNT_UNKNOWN), + framebuffer_stencil_sample_counts (Anvil::SampleCountFlagBits::SAMPLE_COUNT_UNKNOWN), line_width_granularity (FLT_MAX), max_bound_descriptor_sets (UINT32_MAX), max_clip_distances (UINT32_MAX), @@ -1719,13 +1774,13 @@ Anvil::PhysicalDeviceLimits::PhysicalDeviceLimits() optimal_buffer_copy_offset_alignment (std::numeric_limits::max() ), optimal_buffer_copy_row_pitch_alignment (std::numeric_limits::max() ), point_size_granularity (FLT_MAX), - sampled_image_color_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), - sampled_image_depth_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), - sampled_image_integer_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), - sampled_image_stencil_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), + sampled_image_color_sample_counts (Anvil::SampleCountFlagBits::SAMPLE_COUNT_UNKNOWN), + sampled_image_depth_sample_counts (Anvil::SampleCountFlagBits::SAMPLE_COUNT_UNKNOWN), + sampled_image_integer_sample_counts (Anvil::SampleCountFlagBits::SAMPLE_COUNT_UNKNOWN), + sampled_image_stencil_sample_counts (Anvil::SampleCountFlagBits::SAMPLE_COUNT_UNKNOWN), sparse_address_space_size (std::numeric_limits::max() ), standard_sample_locations (false), - storage_image_sample_counts (VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM), + storage_image_sample_counts (Anvil::SampleCountFlagBits::SAMPLE_COUNT_UNKNOWN), strict_lines (false), sub_pixel_interpolation_offset_bits (UINT32_MAX), sub_pixel_precision_bits (UINT32_MAX), @@ -2134,10 +2189,10 @@ bool Anvil::PushConstantRange::operator==(const PushConstantRange& in) const Anvil::QueueFamilyInfo::QueueFamilyInfo(const VkQueueFamilyProperties& in_props) { - flags = in_props.queueFlags; - min_image_transfer_granularity = in_props.minImageTransferGranularity; - n_queues = in_props.queueCount; - n_timestamp_bits = in_props.timestampValidBits; + flags = in_props.queueFlags; + min_image_transfer_granularity = in_props.minImageTransferGranularity; + n_queues = in_props.queueCount; + n_timestamp_bits = in_props.timestampValidBits; } /** Please see header for specification */ @@ -2591,7 +2646,8 @@ Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_buff const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, bool in_should_block, Anvil::Fence* in_opt_fence_ptr) - :command_buffers_sgpu_ptr (in_opt_cmd_buffer_ptrs_ptr), + :command_buffers_mgpu_ptr (nullptr), + command_buffers_sgpu_ptr (in_opt_cmd_buffer_ptrs_ptr), #if defined(_WIN32) d3d12_fence_signal_semaphore_values_ptr(nullptr), d3d12_fence_wait_semaphore_values_ptr (nullptr), @@ -2601,10 +2657,12 @@ Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_buff n_command_buffers (in_n_command_buffers), n_signal_semaphores (in_n_semaphores_to_signal), n_wait_semaphores (in_n_semaphores_to_wait_on), + signal_semaphores_mgpu_ptr (nullptr), signal_semaphores_sgpu_ptr (in_opt_semaphore_to_signal_ptrs_ptr), should_block (in_should_block), timeout (UINT64_MAX), type (SubmissionType::SGPU), + wait_semaphores_mgpu_ptr (nullptr), wait_semaphores_sgpu_ptr (in_opt_semaphore_to_wait_on_ptrs_ptr) { anvil_assert((in_n_command_buffers == 0) || @@ -2625,7 +2683,8 @@ Anvil::SubmitInfo::SubmitInfo(Anvil::CommandBufferBase* in_cmd_buffer_ptr, const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, bool in_should_block, Anvil::Fence* in_opt_fence_ptr) - :command_buffers_sgpu_ptr (nullptr), + :command_buffers_mgpu_ptr (nullptr), + command_buffers_sgpu_ptr (nullptr), #if defined(_WIN32) d3d12_fence_signal_semaphore_values_ptr(nullptr), d3d12_fence_wait_semaphore_values_ptr (nullptr), @@ -2635,10 +2694,12 @@ Anvil::SubmitInfo::SubmitInfo(Anvil::CommandBufferBase* in_cmd_buffer_ptr, n_command_buffers ((in_cmd_buffer_ptr != nullptr) ? 1 : 0), n_signal_semaphores (in_n_semaphores_to_signal), n_wait_semaphores (in_n_semaphores_to_wait_on), + signal_semaphores_mgpu_ptr (nullptr), signal_semaphores_sgpu_ptr (in_opt_semaphore_to_signal_ptrs_ptr), should_block (in_should_block), timeout (UINT64_MAX), type (SubmissionType::SGPU), + wait_semaphores_mgpu_ptr (nullptr), wait_semaphores_sgpu_ptr (in_opt_semaphore_to_wait_on_ptrs_ptr) { anvil_assert((in_n_semaphores_to_signal == 0) || @@ -2651,6 +2712,44 @@ Anvil::SubmitInfo::SubmitInfo(Anvil::CommandBufferBase* in_cmd_buffer_ptr, command_buffers_sgpu_ptr = &helper_cmd_buffer_raw_ptr; } +Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_buffer_submissions, + const CommandBufferMGPUSubmission* in_opt_command_buffer_submissions_ptr, + uint32_t in_n_signal_semaphore_submissions, + const SemaphoreMGPUSubmission* in_opt_signal_semaphore_submissions_ptr, + uint32_t in_n_wait_semaphore_submissions, + const SemaphoreMGPUSubmission* in_opt_wait_semaphore_submissions_ptr, + const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptr, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) + :command_buffers_mgpu_ptr (in_opt_command_buffer_submissions_ptr), + command_buffers_sgpu_ptr (nullptr), +#if defined(_WIN32) + d3d12_fence_signal_semaphore_values_ptr(nullptr), + d3d12_fence_wait_semaphore_values_ptr (nullptr), +#endif + dst_stage_wait_masks_ptr (in_opt_dst_stage_masks_to_wait_on_ptr), + fence_ptr (in_opt_fence_ptr), + n_command_buffers (in_n_command_buffer_submissions), + n_signal_semaphores (in_n_signal_semaphore_submissions), + n_wait_semaphores (in_n_wait_semaphore_submissions), + signal_semaphores_mgpu_ptr (in_opt_signal_semaphore_submissions_ptr), + signal_semaphores_sgpu_ptr (nullptr), + should_block (in_should_block), + timeout (UINT64_MAX), + type (SubmissionType::MGPU), + wait_semaphores_mgpu_ptr (in_opt_wait_semaphore_submissions_ptr), + wait_semaphores_sgpu_ptr (nullptr) +{ + anvil_assert((in_n_command_buffer_submissions == 0) || + (in_n_command_buffer_submissions != 0 && in_opt_command_buffer_submissions_ptr != nullptr) ); + + anvil_assert((in_n_signal_semaphore_submissions == 0) || + (in_n_signal_semaphore_submissions != 0 && in_opt_signal_semaphore_submissions_ptr != nullptr) ); + + anvil_assert((in_n_wait_semaphore_submissions == 0) || + (in_n_wait_semaphore_submissions != 0 && in_opt_wait_semaphore_submissions_ptr != nullptr && in_opt_dst_stage_masks_to_wait_on_ptr != nullptr) ); +} + Anvil::SubmitInfo Anvil::SubmitInfo::create(Anvil::CommandBufferBase* in_opt_cmd_buffer_ptr, uint32_t in_n_semaphores_to_signal, Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, @@ -2726,6 +2825,21 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_execute(Anvil::CommandBufferBase* co in_opt_fence_ptr); } +Anvil::SubmitInfo Anvil::SubmitInfo::create_execute(const CommandBufferMGPUSubmission* in_cmd_buffer_submission_ptr, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) +{ + return Anvil::SubmitInfo(1, /* in_n_command_buffers */ + in_cmd_buffer_submission_ptr, + 0, /* in_n_semaphores_to_signal */ + nullptr, /* in_opt_semaphore_to_signal_ptrs_ptr */ + 0, /* in_n_semaphores_to_wait_on */ + nullptr, /* in_opt_semaphore_to_wait_on_ptrs_ptr */ + nullptr, /* in_opt_dst_stage_masks_to_wait_on_ptrs */ + in_should_block, + in_opt_fence_ptr); +} + Anvil::SubmitInfo Anvil::SubmitInfo::create_execute_signal(Anvil::CommandBufferBase* in_cmd_buffer_ptr, uint32_t in_n_semaphores_to_signal, Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, @@ -2767,6 +2881,26 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_execute_signal(Anvil::CommandBufferB in_opt_fence_ptr); } +Anvil::SubmitInfo Anvil::SubmitInfo::create_execute_signal(const Anvil::CommandBufferMGPUSubmission* in_cmd_buffer_submission_ptr, + uint32_t in_n_signal_semaphore_submissions, + const Anvil::SemaphoreMGPUSubmission* in_signal_semaphore_submissions_ptr, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) +{ + anvil_assert(in_cmd_buffer_submission_ptr != nullptr); + anvil_assert(in_signal_semaphore_submissions_ptr != nullptr); + + return Anvil::SubmitInfo(1, /* in_n_command_buffers */ + in_cmd_buffer_submission_ptr, + in_n_signal_semaphore_submissions, + in_signal_semaphore_submissions_ptr, + 0, /* in_n_semaphores_to_wait_on */ + nullptr, /* in_opt_semaphore_to_wait_on_ptrs_ptr */ + nullptr, /* in_opt_dst_stage_masks_to_wait_on_ptrs */ + in_should_block, + in_opt_fence_ptr); +} + Anvil::SubmitInfo Anvil::SubmitInfo::create_signal(uint32_t in_n_semaphores_to_signal, Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, Anvil::Fence* in_opt_fence_ptr) @@ -2874,6 +3008,27 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute(Anvil::CommandBufferBas in_opt_fence_ptr); } +Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute(const Anvil::CommandBufferMGPUSubmission* in_cmd_buffer_submission_ptr, + uint32_t in_n_wait_semaphore_submissions, + const Anvil::SemaphoreMGPUSubmission* in_wait_semaphore_submissions_ptr, + const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) +{ + anvil_assert(in_cmd_buffer_submission_ptr != nullptr); + anvil_assert(in_wait_semaphore_submissions_ptr != nullptr); + + return Anvil::SubmitInfo(1, /* in_n_command_buffers */ + in_cmd_buffer_submission_ptr, + 0, /* in_n_semaphores_to_signal */ + nullptr, /* in_opt_semaphore_to_signal_ptrs_ptr */ + in_n_wait_semaphore_submissions, + in_wait_semaphore_submissions_ptr, + in_dst_stage_masks_to_wait_on_ptrs, + in_should_block, + in_opt_fence_ptr); +} + Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute_signal(Anvil::CommandBufferBase* in_cmd_buffer_ptr, uint32_t in_n_semaphores_to_signal, Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, @@ -2923,3 +3078,28 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute_signal(Anvil::CommandBu in_opt_fence_ptr); } +Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute_signal(const Anvil::CommandBufferMGPUSubmission* in_cmd_buffer_submission_ptr, + uint32_t in_n_signal_semaphore_submissions, + const Anvil::SemaphoreMGPUSubmission* in_signal_semaphore_submissions_ptr, + uint32_t in_n_wait_semaphore_submissions, + const Anvil::SemaphoreMGPUSubmission* in_wait_semaphore_submissions_ptr, + const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) +{ + anvil_assert(in_cmd_buffer_submission_ptr != nullptr); + anvil_assert(in_dst_stage_masks_to_wait_on_ptrs != nullptr); + anvil_assert(in_signal_semaphore_submissions_ptr != nullptr); + anvil_assert(in_wait_semaphore_submissions_ptr != nullptr); + + return Anvil::SubmitInfo(1, /* in_n_command_buffers */ + in_cmd_buffer_submission_ptr, + in_n_signal_semaphore_submissions, + in_signal_semaphore_submissions_ptr, + in_n_wait_semaphore_submissions, + in_wait_semaphore_submissions_ptr, + in_dst_stage_masks_to_wait_on_ptrs, + in_should_block, + in_opt_fence_ptr); +} + diff --git a/src/misc/types_utils.cpp b/src/misc/types_utils.cpp index 412c85fe..d24e9759 100644 --- a/src/misc/types_utils.cpp +++ b/src/misc/types_utils.cpp @@ -20,6 +20,7 @@ // THE SOFTWARE. // #include "misc/types.h" +#include "wrappers/buffer.h" #include "wrappers/device.h" /** Please see header for specification */ @@ -28,8 +29,6 @@ Anvil::MemoryFeatureFlags Anvil::Utils::get_memory_feature_flags_from_vk_propert { Anvil::MemoryFeatureFlags result = 0; - ANVIL_REDUNDANT_ARGUMENT(in_mem_heap_flags); - if ((in_mem_type_flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0) { result |= MEMORY_FEATURE_FLAG_DEVICE_LOCAL; @@ -55,6 +54,11 @@ Anvil::MemoryFeatureFlags Anvil::Utils::get_memory_feature_flags_from_vk_propert result |= MEMORY_FEATURE_FLAG_LAZILY_ALLOCATED; } + if ((in_mem_heap_flags & VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR) != 0) + { + result |= MEMORY_FEATURE_FLAG_MULTI_INSTANCE; + } + return result; } @@ -205,6 +209,42 @@ VkExternalSemaphoreHandleTypeFlagsKHR Anvil::Utils::convert_external_semaphore_h return result; } +VkIndexType Anvil::Utils::convert_index_type_to_vk_index_type(const IndexType& in_index_type) +{ + VkIndexType result = VK_INDEX_TYPE_MAX_ENUM; + + switch (in_index_type) + { + case Anvil::IndexType::UINT16: result = VK_INDEX_TYPE_UINT16; break; + case Anvil::IndexType::UINT32: result = VK_INDEX_TYPE_UINT32; break; + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + +Anvil::IndexType Anvil::Utils::convert_vk_index_type_to_index_type(const VkIndexType& in_index_type) +{ + Anvil::IndexType result = Anvil::IndexType::UNKNOWN; + + switch (in_index_type) + { + case VK_INDEX_TYPE_UINT16: result = Anvil::IndexType::UINT16; break; + case VK_INDEX_TYPE_UINT32: result = Anvil::IndexType::UINT32; break; + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + Anvil::ExternalSemaphoreHandleTypeBits Anvil::Utils::convert_vk_external_semaphore_handle_type_flags_to_external_semaphore_handle_type_bits(const VkExternalSemaphoreHandleTypeFlagsKHR& in_types) { Anvil::ExternalSemaphoreHandleTypeBits result = 0; @@ -243,6 +283,33 @@ Anvil::ExternalSemaphoreHandleTypeBits Anvil::Utils::convert_vk_external_semapho return result; } +Anvil::PeerMemoryFeatureFlags Anvil::Utils::convert_vk_peer_memory_feature_flags_to_peer_memory_feature_flags(const VkPeerMemoryFeatureFlags& in_value) +{ + Anvil::PeerMemoryFeatureFlags result = 0; + + if (in_value & VK_PEER_MEMORY_FEATURE_COPY_DST_BIT) + { + result |= Anvil::PEER_MEMORY_FEATURE_COPY_DST_BIT; + } + + if (in_value & VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT) + { + result |= Anvil::PEER_MEMORY_FEATURE_COPY_SRC_BIT; + } + + if (in_value & VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT) + { + result |= Anvil::PEER_MEMORY_FEATURE_GENERIC_DST_BIT; + } + + if (in_value & VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT) + { + result |= Anvil::PEER_MEMORY_FEATURE_GENERIC_SRC_BIT; + } + + return result; +} + bool Anvil::Utils::convert_mt_safety_enum_to_boolean(Anvil::MTSafety in_mt_safety, const Anvil::BaseDevice* in_device_ptr) { @@ -284,9 +351,9 @@ void Anvil::Utils::convert_queue_family_bits_to_family_indices(const Anvil::Base Anvil::QueueFamilyType queue_family_type; } queue_family_data[] = { - {Anvil::QUEUE_FAMILY_COMPUTE_BIT, Anvil::QueueFamilyType::COMPUTE}, - {Anvil::QUEUE_FAMILY_DMA_BIT, Anvil::QueueFamilyType::TRANSFER}, - {Anvil::QUEUE_FAMILY_GRAPHICS_BIT, Anvil::QueueFamilyType::UNIVERSAL}, + {Anvil::QUEUE_FAMILY_COMPUTE_BIT, Anvil::QueueFamilyType::COMPUTE}, + {Anvil::QUEUE_FAMILY_DMA_BIT, Anvil::QueueFamilyType::TRANSFER}, + {Anvil::QUEUE_FAMILY_GRAPHICS_BIT, Anvil::QueueFamilyType::UNIVERSAL}, }; for (const auto& current_queue_fam_data : queue_family_data) @@ -323,21 +390,21 @@ void Anvil::Utils::convert_queue_family_bits_to_family_indices(const Anvil::Base } /** Please see header for specification */ -VkAccessFlags Anvil::Utils::get_access_mask_from_image_layout(VkImageLayout in_layout, +VkAccessFlags Anvil::Utils::get_access_mask_from_image_layout(Anvil::ImageLayout in_layout, Anvil::QueueFamilyType in_queue_family_type) { VkAccessFlags result = 0; switch (in_layout) { - case VK_IMAGE_LAYOUT_UNDEFINED: + case Anvil::ImageLayout::UNDEFINED: { result = 0; break; } - case VK_IMAGE_LAYOUT_GENERAL: + case Anvil::ImageLayout::GENERAL: { result = VK_ACCESS_INDIRECT_COMMAND_READ_BIT | VK_ACCESS_INDEX_READ_BIT | @@ -360,7 +427,7 @@ VkAccessFlags Anvil::Utils::get_access_mask_from_image_layout(VkImageLayout break; } - case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL: + case Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL: { result = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; @@ -368,7 +435,7 @@ VkAccessFlags Anvil::Utils::get_access_mask_from_image_layout(VkImageLayout break; } - case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL: + case Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL: { result = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; @@ -376,42 +443,42 @@ VkAccessFlags Anvil::Utils::get_access_mask_from_image_layout(VkImageLayout break; } - case VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL: + case Anvil::ImageLayout::DEPTH_STENCIL_READ_ONLY_OPTIMAL: { result = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT; break; } - case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL: + case Anvil::ImageLayout::SHADER_READ_ONLY_OPTIMAL: { result = VK_ACCESS_SHADER_READ_BIT; break; } - case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL: + case Anvil::ImageLayout::TRANSFER_SRC_OPTIMAL: { result = VK_ACCESS_TRANSFER_READ_BIT; break; } - case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL: + case Anvil::ImageLayout::TRANSFER_DST_OPTIMAL: { result = VK_ACCESS_TRANSFER_WRITE_BIT; break; } - case VK_IMAGE_LAYOUT_PREINITIALIZED: + case Anvil::ImageLayout::PREINITIALIZED: { result = VK_ACCESS_SHADER_READ_BIT; break; } - case VK_IMAGE_LAYOUT_PRESENT_SRC_KHR: + case Anvil::ImageLayout::PRESENT_SRC_KHR: { result = VK_ACCESS_MEMORY_READ_BIT; @@ -420,7 +487,7 @@ VkAccessFlags Anvil::Utils::get_access_mask_from_image_layout(VkImageLayout default: { - /* Invalid VkImageLayout argument value */ + /* Invalid Anvil::ImageLayout argument value */ anvil_assert_fail(); } } @@ -735,16 +802,18 @@ const char* Anvil::Utils::get_raw_string(VkImageLayout in_image_layout) /* Note: we can't use an array-based solution here because of PRESENT_SRC_KHR */ switch (in_image_layout) { - case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL: result = "VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL"; break; - case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL: result = "VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL"; break; - case VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL: result = "VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL"; break; - case VK_IMAGE_LAYOUT_GENERAL: result = "VK_IMAGE_LAYOUT_GENERAL"; break; - case VK_IMAGE_LAYOUT_PREINITIALIZED: result = "VK_IMAGE_LAYOUT_PREINITIALIZED"; break; - case VK_IMAGE_LAYOUT_PRESENT_SRC_KHR: result = "VK_IMAGE_LAYOUT_PRESENT_SRC_KHR"; break; - case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL: result = "VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL"; break; - case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL: result = "VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL"; break; - case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL: result = "VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL"; break; - case VK_IMAGE_LAYOUT_UNDEFINED: result = "VK_IMAGE_LAYOUT_UNDEFINED"; break; + case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL: result = "VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL"; break; + case VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR: result = "VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR"; break; + case VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR: result = "VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR"; break; + case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL: result = "VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL"; break; + case VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL: result = "VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL"; break; + case VK_IMAGE_LAYOUT_GENERAL: result = "VK_IMAGE_LAYOUT_GENERAL"; break; + case VK_IMAGE_LAYOUT_PREINITIALIZED: result = "VK_IMAGE_LAYOUT_PREINITIALIZED"; break; + case VK_IMAGE_LAYOUT_PRESENT_SRC_KHR: result = "VK_IMAGE_LAYOUT_PRESENT_SRC_KHR"; break; + case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL: result = "VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL"; break; + case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL: result = "VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL"; break; + case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL: result = "VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL"; break; + case VK_IMAGE_LAYOUT_UNDEFINED: result = "VK_IMAGE_LAYOUT_UNDEFINED"; break; default: { @@ -1163,6 +1232,11 @@ void Anvil::Utils::get_vk_property_flags_from_memory_feature_flags(Anvil::Memory result_mem_type_flags |= VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT; } + if ((in_mem_feature_flags & MEMORY_FEATURE_FLAG_MULTI_INSTANCE) != 0) + { + result_mem_heap_flags |= VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR; + } + *out_mem_heap_flags_ptr = result_mem_heap_flags; *out_mem_type_flags_ptr = result_mem_type_flags; } diff --git a/src/wrappers/buffer.cpp b/src/wrappers/buffer.cpp index e0700601..f4cd1fe3 100644 --- a/src/wrappers/buffer.cpp +++ b/src/wrappers/buffer.cpp @@ -43,7 +43,8 @@ Anvil::Buffer::Buffer(Anvil::BufferCreateInfoUniquePtr in_create_info_ptr) m_create_flags (0), m_memory_block_ptr (nullptr), m_prefers_dedicated_allocation (false), - m_requires_dedicated_allocation (false) + m_requires_dedicated_allocation (false), + m_staging_buffer_queue_ptr (nullptr) { switch (in_create_info_ptr->get_type() ) { @@ -62,8 +63,7 @@ Anvil::Buffer::Buffer(Anvil::BufferCreateInfoUniquePtr in_create_info_ptr) */ auto usage_flags = in_create_info_ptr->get_usage_flags(); - usage_flags |= static_cast(VK_BUFFER_USAGE_TRANSFER_DST_BIT | - VK_BUFFER_USAGE_TRANSFER_SRC_BIT); + usage_flags |= Anvil::BUFFER_USAGE_FLAG_TRANSFER_DST_BIT | Anvil::BUFFER_USAGE_FLAG_TRANSFER_SRC_BIT; in_create_info_ptr->set_usage_flags(usage_flags); } @@ -117,8 +117,7 @@ Anvil::Buffer::Buffer(Anvil::BufferCreateInfoUniquePtr in_create_info_ptr) { auto usage_flags = in_create_info_ptr->get_usage_flags(); - usage_flags |= static_cast(VK_BUFFER_USAGE_TRANSFER_DST_BIT | - VK_BUFFER_USAGE_TRANSFER_SRC_BIT); + usage_flags |= Anvil::BUFFER_USAGE_FLAG_TRANSFER_DST_BIT | Anvil::BUFFER_USAGE_FLAG_TRANSFER_SRC_BIT; in_create_info_ptr->set_usage_flags(usage_flags); } @@ -288,7 +287,7 @@ bool Anvil::Buffer::init() if ( m_create_info_ptr->get_client_data () != nullptr && (m_create_info_ptr->get_memory_features() & Anvil::MEMORY_FEATURE_FLAG_MAPPABLE) == 0) { - m_create_info_ptr->set_usage_flags(m_create_info_ptr->get_usage_flags() | VK_BUFFER_USAGE_TRANSFER_DST_BIT); + m_create_info_ptr->set_usage_flags(m_create_info_ptr->get_usage_flags() | Anvil::BUFFER_USAGE_FLAG_TRANSFER_DST_BIT); } if (m_create_info_ptr->get_type() != BufferType::NONSPARSE_NO_ALLOC_CHILD) @@ -310,8 +309,8 @@ bool Anvil::Buffer::init() buffer_create_info.pNext = nullptr; buffer_create_info.pQueueFamilyIndices = queue_family_indices; buffer_create_info.queueFamilyIndexCount = n_queue_family_indices; - buffer_create_info.sharingMode = m_create_info_ptr->get_sharing_mode(); - buffer_create_info.size = m_create_info_ptr->get_size (); + buffer_create_info.sharingMode = static_cast(m_create_info_ptr->get_sharing_mode() ); + buffer_create_info.size = m_create_info_ptr->get_size(); buffer_create_info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO; buffer_create_info.usage = m_create_info_ptr->get_usage_flags(); @@ -532,29 +531,131 @@ bool Anvil::Buffer::init() return is_vk_call_successful(result); } +/* TODO */ +bool Anvil::Buffer::init_staging_buffer(const VkDeviceSize& in_size, + Anvil::Queue* in_opt_queue_ptr) +{ + Anvil::PrimaryCommandBufferUniquePtr copy_cmdbuf_ptr; + std::vector helper_vec; + const auto queue_fams = m_create_info_ptr->get_queue_families(); + Anvil::QueueFamilyBits staging_buffer_queue_fam_bits = 0; + + m_staging_buffer_ptr.reset(); + m_staging_buffer_queue_ptr = nullptr; + + if (m_create_info_ptr->get_sharing_mode() == Anvil::SharingMode::EXCLUSIVE) + { + /* We need to use a user-specified queue, since we can't tell which queue fam the buffer is currently configured to be compatible with. + * + * This can be worked around if the buffer can only be used with a specific queue family type. + */ + if (Anvil::Utils::is_pow2(queue_fams) ) + { + switch (queue_fams) + { + case Anvil::QUEUE_FAMILY_COMPUTE_BIT: m_staging_buffer_queue_ptr = m_device_ptr->get_compute_queue (0); break; + case Anvil::QUEUE_FAMILY_DMA_BIT: m_staging_buffer_queue_ptr = m_device_ptr->get_transfer_queue (0); break; + case Anvil::QUEUE_FAMILY_GRAPHICS_BIT: m_staging_buffer_queue_ptr = m_device_ptr->get_universal_queue(0); break; + + default: + { + anvil_assert_fail(); + } + } + } + else + { + anvil_assert(in_opt_queue_ptr != nullptr); + + m_staging_buffer_queue_ptr = in_opt_queue_ptr; + } + + anvil_assert(m_staging_buffer_queue_ptr != nullptr); + + switch (m_device_ptr->get_queue_family_type(m_staging_buffer_queue_ptr->get_queue_family_index() ) ) + { + case Anvil::QueueFamilyType::COMPUTE: staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_COMPUTE_BIT; break; + case Anvil::QueueFamilyType::TRANSFER: staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_DMA_BIT; break; + case Anvil::QueueFamilyType::UNIVERSAL: staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_GRAPHICS_BIT; break; + + default: + { + anvil_assert_fail(); + } + } + } + else + { + /* We can use any queue from the list of queue fams this buffer is compatible with, in order to perform the copy op. */ + if ((queue_fams & Anvil::QUEUE_FAMILY_GRAPHICS_BIT) != 0) + { + m_staging_buffer_queue_ptr = m_device_ptr->get_universal_queue(0); + staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_GRAPHICS_BIT; + } + else + if ((queue_fams & Anvil::QUEUE_FAMILY_DMA_BIT) != 0) + { + m_staging_buffer_queue_ptr = m_device_ptr->get_transfer_queue(0); + staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_DMA_BIT; + } + else + { + anvil_assert((queue_fams & Anvil::QUEUE_FAMILY_COMPUTE_BIT) != 0) + + m_staging_buffer_queue_ptr = m_device_ptr->get_compute_queue(0); + staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_COMPUTE_BIT; + } + } + + if (m_staging_buffer_ptr == nullptr || + m_staging_buffer_ptr->get_create_info_ptr()->get_size() < in_size) + { + { + const auto sharing_mode = Anvil::Utils::is_pow2(staging_buffer_queue_fam_bits) ? Anvil::SharingMode::EXCLUSIVE + : Anvil::SharingMode::CONCURRENT; + + auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr, + in_size, + staging_buffer_queue_fam_bits, + sharing_mode, + Anvil::BUFFER_USAGE_FLAG_TRANSFER_SRC_BIT, + Anvil::MEMORY_FEATURE_FLAG_MAPPABLE); + + create_info_ptr->set_mt_safety (MT_SAFETY_DISABLED); + + m_staging_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); + } + + if (m_staging_buffer_ptr == nullptr) + { + anvil_assert(m_staging_buffer_ptr != nullptr); + } + } + + return (m_staging_buffer_ptr != nullptr); +} + /* Please see header for specification */ -bool Anvil::Buffer::read(VkDeviceSize start_offset, - VkDeviceSize size, +bool Anvil::Buffer::read(VkDeviceSize in_start_offset, + VkDeviceSize in_size, void* out_result_ptr) { - return read(start_offset, - size, - nullptr, /* in_physical_device_ptr */ + return read(in_start_offset, + in_size, + UINT32_MAX, /* in_device_mask */ out_result_ptr); } /* Please see header for specification */ -bool Anvil::Buffer::read(VkDeviceSize in_start_offset, - VkDeviceSize in_size, - const Anvil::PhysicalDevice* in_physical_device_ptr, - void* out_result_ptr) +bool Anvil::Buffer::read(VkDeviceSize in_start_offset, + VkDeviceSize in_size, + uint32_t in_device_mask, + void* out_result_ptr) { const Anvil::DeviceType device_type (m_device_ptr->get_type() ); auto memory_block_ptr (get_memory_block(0 /* in_n_memory_block */) ); bool result (false); - ANVIL_REDUNDANT_ARGUMENT(in_physical_device_ptr); - /* TODO: Support for sparse buffers */ anvil_assert(m_create_info_ptr->get_type() != Anvil::BufferType::SPARSE_NO_ALLOC); @@ -568,54 +669,58 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, { /* The buffer memory is not mappable. We need to create a staging buffer, * do a non-mappable->mappable memory copy, and then read back data from the mappable buffer. */ - const uint32_t n_transfer_queues = m_device_ptr->get_n_transfer_queues(); - Anvil::Queue* queue_ptr = (n_transfer_queues > 0) ? m_device_ptr->get_transfer_queue (0) - : m_device_ptr->get_universal_queue(0); - Anvil::BufferUniquePtr staging_buffer_ptr; - const Anvil::QueueFamilyBits staging_buffer_queue_fam_bits = (n_transfer_queues > 0) ? Anvil::QUEUE_FAMILY_DMA_BIT - : Anvil::QUEUE_FAMILY_GRAPHICS_BIT; - Anvil::PrimaryCommandBufferUniquePtr copy_cmdbuf_ptr = m_device_ptr->get_command_pool_for_queue_family_index(queue_ptr->get_queue_family_index() )->alloc_primary_level_command_buffer(); + Anvil::PrimaryCommandBufferUniquePtr copy_cmdbuf_ptr; - if (copy_cmdbuf_ptr == nullptr) + if (m_staging_buffer_ptr == nullptr || + m_staging_buffer_ptr->get_create_info_ptr()->get_size() < in_size) { - anvil_assert(copy_cmdbuf_ptr != nullptr); + if (!init_staging_buffer(in_size, + nullptr) ) /* in_opt_queue_ptr */ + { + result = false; - goto end; + goto end; + } } + if (m_staging_buffer_ptr == nullptr) { - auto buffer_create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr, - in_size, - staging_buffer_queue_fam_bits, - VK_SHARING_MODE_CONCURRENT, - VK_BUFFER_USAGE_TRANSFER_DST_BIT, - MEMORY_FEATURE_FLAG_MAPPABLE); - - buffer_create_info_ptr->set_mt_safety(MT_SAFETY_DISABLED); + anvil_assert(m_staging_buffer_ptr != nullptr); - staging_buffer_ptr = Anvil::Buffer::create(std::move(buffer_create_info_ptr) ); + goto end; } - if (staging_buffer_ptr == nullptr) + copy_cmdbuf_ptr = m_device_ptr->get_command_pool_for_queue_family_index(m_staging_buffer_queue_ptr->get_queue_family_index() )->alloc_primary_level_command_buffer(); + + if (copy_cmdbuf_ptr == nullptr) { - anvil_assert(staging_buffer_ptr != nullptr); + anvil_assert(copy_cmdbuf_ptr != nullptr); goto end; - } + } if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) { copy_cmdbuf_ptr->start_recording(true, /* one_time_submit */ false); /* simultaneous_use_allowed */ } + else + { + anvil_assert(device_type == Anvil::DEVICE_TYPE_MULTI_GPU); + anvil_assert(Utils::count_set_bits(in_device_mask) == 1); + + copy_cmdbuf_ptr->start_recording(true, /* one_time_submit */ + false, /* simultaneous_use_allowed */ + in_device_mask); /* in_opt_device_mask */ + } { Anvil::BufferBarrier buffer_barrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_IGNORED, - staging_buffer_ptr.get(), + m_staging_buffer_ptr.get(), 0, /* in_offset */ - staging_buffer_ptr->get_create_info_ptr()->get_size() ); + in_size); VkBufferCopy copy_region; copy_region.dstOffset = 0; @@ -623,7 +728,7 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, copy_region.srcOffset = in_start_offset; copy_cmdbuf_ptr->record_copy_buffer (this, - staging_buffer_ptr.get(), + m_staging_buffer_ptr.get(), 1, /* in_region_count */ ©_region); copy_cmdbuf_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_TRANSFER_BIT, @@ -640,32 +745,43 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) { - queue_ptr->submit( + m_staging_buffer_queue_ptr->submit( Anvil::SubmitInfo::create_execute(copy_cmdbuf_ptr.get(), true /* should_block */) ); } + else + { + Anvil::CommandBufferMGPUSubmission cmd_buffer_submission; + + anvil_assert((in_device_mask != 0) && (in_device_mask != UINT32_MAX)); + + cmd_buffer_submission.cmd_buffer_ptr = copy_cmdbuf_ptr.get(); + cmd_buffer_submission.device_mask = in_device_mask; + + m_staging_buffer_queue_ptr->submit( + Anvil::SubmitInfo::create_execute(&cmd_buffer_submission, + true /* should_block */) + ); + } - result = staging_buffer_ptr->read(0, - in_size, - out_result_ptr); + result = m_staging_buffer_ptr->read(0, + in_size, + out_result_ptr); } end: return result; } -bool Anvil::Buffer::set_memory_nonsparse_internal(MemoryBlockUniquePtr in_memory_block_ptr, - uint32_t in_n_physical_devices, - const Anvil::PhysicalDevice* in_physical_devices_ptr) +bool Anvil::Buffer::set_memory_nonsparse_internal(MemoryBlockUniquePtr in_memory_block_ptr, + uint32_t in_n_device_group_indices, + const uint32_t* in_device_group_indices_ptr) { const Anvil::DeviceType device_type (m_device_ptr->get_type() ); bool result (false); VkResult result_vk; - ANVIL_REDUNDANT_ARGUMENT(in_physical_devices_ptr); - - if (in_memory_block_ptr == nullptr) { anvil_assert(!(in_memory_block_ptr == nullptr) ); @@ -687,21 +803,53 @@ bool Anvil::Buffer::set_memory_nonsparse_internal(MemoryBlockUniquePtr i goto end; } - if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU && - in_n_physical_devices == 0) + /* Bind the memory object to the buffer object */ + if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) { - in_n_physical_devices = 1; + lock(); + { + result_vk = vkBindBufferMemory(m_device_ptr->get_device_vk(), + m_buffer, + in_memory_block_ptr->get_memory (), + in_memory_block_ptr->get_start_offset() ); + } + unlock(); } - - /* Bind the memory object to the buffer object */ - lock(); + else { - result_vk = vkBindBufferMemory(m_device_ptr->get_device_vk(), - m_buffer, - in_memory_block_ptr->get_memory (), - in_memory_block_ptr->get_start_offset() ); + StructChainUniquePtr bind_info_struct_chain_ptr; + Anvil::StructChainer bind_info_struct_chainer; + + const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr) ); + const auto& entrypoints (mgpu_device_ptr->get_extension_khr_bind_memory2_entrypoints() ); + + anvil_assert(device_type == Anvil::DEVICE_TYPE_MULTI_GPU); + + { + VkBindBufferMemoryInfoKHR bind_info; + VkBindBufferMemoryDeviceGroupInfoKHR bind_info_dg; + + bind_info_dg.deviceIndexCount = in_n_device_group_indices; + bind_info_dg.pDeviceIndices = in_device_group_indices_ptr; + bind_info_dg.pNext = nullptr; + bind_info_dg.sType = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO_KHR; + + bind_info.buffer = m_buffer; + bind_info.memory = in_memory_block_ptr->get_memory (); + bind_info.memoryOffset = in_memory_block_ptr->get_start_offset(); + bind_info.pNext = nullptr; + bind_info.sType = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR; + + bind_info_struct_chainer.append_struct(bind_info); + bind_info_struct_chainer.append_struct(bind_info_dg); + } + + bind_info_struct_chain_ptr = bind_info_struct_chainer.create_chain(); + + result_vk = entrypoints.vkBindBufferMemory2KHR(m_device_ptr->get_device_vk(), + 1, /* bindInfoCount */ + bind_info_struct_chain_ptr ->get_root_struct() ); } - unlock(); if (!is_vk_call_successful(result_vk) ) { @@ -788,23 +936,23 @@ bool Anvil::Buffer::set_nonsparse_memory(MemoryBlock* in_memory_block_ptr, } /* Please see header for specification */ -bool Anvil::Buffer::set_nonsparse_memory(MemoryBlockUniquePtr in_memory_block_ptr, - uint32_t in_n_physical_devices, - const Anvil::PhysicalDevice* in_physical_devices_ptr) +bool Anvil::Buffer::set_nonsparse_memory(MemoryBlockUniquePtr in_memory_block_ptr, + uint32_t in_n_device_group_indices, + const uint32_t* in_device_group_indices_ptr) { MemoryBlockUniquePtr memory_block_ptr = MemoryBlockUniquePtr(in_memory_block_ptr.release(), std::default_delete() ); return set_memory_nonsparse_internal(std::move(memory_block_ptr), - in_n_physical_devices, - in_physical_devices_ptr); + in_n_device_group_indices, + in_device_group_indices_ptr); } /* Please see header for specification */ -bool Anvil::Buffer::set_nonsparse_memory(MemoryBlock* in_memory_block_ptr, - bool in_memory_block_owned_by_buffer, - uint32_t in_n_physical_devices, - const Anvil::PhysicalDevice* in_physical_devices_ptr) +bool Anvil::Buffer::set_nonsparse_memory(MemoryBlock* in_memory_block_ptr, + bool in_memory_block_owned_by_buffer, + uint32_t in_n_device_group_indices, + const uint32_t* in_device_group_indices_ptr) { MemoryBlockUniquePtr memory_block_ptr; @@ -823,8 +971,148 @@ bool Anvil::Buffer::set_nonsparse_memory(MemoryBlock* in_memory_ } return set_memory_nonsparse_internal(std::move(memory_block_ptr), - in_n_physical_devices, - in_physical_devices_ptr); + in_n_device_group_indices, + in_device_group_indices_ptr); +} + +/* Please see header for specification */ +bool Anvil::Buffer::set_nonsparse_memory_multi(uint32_t in_n_buffer_memory_binding_updates, + BufferMemoryBindingUpdate* in_updates_ptr) +{ + StructChainVector bind_info_struct_chains; + const Anvil::BaseDevice* device_ptr (nullptr); + uint32_t n_total_physical_devices(0); + bool result (false); + + /* Sanity checks */ + if (in_n_buffer_memory_binding_updates == 0) + { + anvil_assert(in_n_buffer_memory_binding_updates != 0); + + goto end; + } + + /* Convert input structure into VkBindBufferMemoryInfoKHR structures */ + for (uint32_t n_update = 0; + n_update < in_n_buffer_memory_binding_updates; + ++n_update) + { + const auto& current_update (in_updates_ptr[n_update]); + const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(current_update.buffer_ptr->m_device_ptr) ); + + if (current_update.physical_devices.size() != mgpu_device_ptr->get_n_physical_devices() ) + { + anvil_assert(current_update.physical_devices.size() == mgpu_device_ptr->get_n_physical_devices() || + current_update.physical_devices.size() == 0); + + goto end; + } + + n_total_physical_devices += static_cast(current_update.physical_devices.size() ); + + if (n_update == 0) + { + device_ptr = current_update.buffer_ptr->m_device_ptr; + } + else + { + anvil_assert(device_ptr == current_update.buffer_ptr->m_device_ptr); + } + } + + { + std::vector device_indices (n_total_physical_devices); + uint32_t n_current_physical_device(0); + VkResult result_vk; + const auto& entrypoints (device_ptr->get_extension_khr_bind_memory2_entrypoints() ); + + for (uint32_t n_update = 0; + n_update < in_n_buffer_memory_binding_updates; + ++n_update) + { + const auto& current_update = in_updates_ptr[n_update]; + + for (uint32_t n_physical_device = 0; + n_physical_device < current_update.physical_devices.size(); + ++n_physical_device, ++n_current_physical_device) + { + device_indices.at(n_current_physical_device) = current_update.physical_devices.at(n_physical_device)->get_device_group_device_index(); + } + } + + n_current_physical_device = 0; + + for (uint32_t n_update = 0; + n_update < in_n_buffer_memory_binding_updates; + ++n_update) + { + VkBindBufferMemoryInfoKHR current_bind_info; + VkBindBufferMemoryDeviceGroupInfoKHR current_bind_info_device_group; + StructChainer current_bind_info_chain; + const auto& current_update = in_updates_ptr[n_update]; + + current_bind_info_device_group.sType = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR; + current_bind_info_device_group.deviceIndexCount = static_cast(current_update.physical_devices.size()); + current_bind_info_device_group.pDeviceIndices = &device_indices.at(n_current_physical_device); + + current_bind_info.buffer = current_update.buffer_ptr->get_buffer (); + current_bind_info.memory = current_update.memory_block_ptr->get_memory (); + current_bind_info.memoryOffset = current_update.memory_block_ptr->get_start_offset(); + current_bind_info.pNext = nullptr; + current_bind_info.sType = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR; + + current_bind_info_chain.append_struct(current_bind_info); + current_bind_info_chain.append_struct(current_bind_info_device_group); + + bind_info_struct_chains.append_struct_chain(current_bind_info_chain.create_chain() ); + + n_current_physical_device += static_cast(current_update.physical_devices.size()); + } + + result_vk = entrypoints.vkBindBufferMemory2KHR(device_ptr->get_device_vk(), + in_n_buffer_memory_binding_updates, + bind_info_struct_chains.get_root_structs() ); + + if (!is_vk_call_successful(result_vk) ) + { + anvil_assert(is_vk_call_successful(result_vk) ); + + goto end; + } + + for (uint32_t n_update = 0; + n_update < in_n_buffer_memory_binding_updates; + ++n_update) + { + auto& current_update = in_updates_ptr[n_update]; + + anvil_assert(current_update.buffer_ptr->m_memory_block_ptr == nullptr); + + anvil_assert(std::find_if(current_update.buffer_ptr->m_owned_memory_blocks.begin(), + current_update.buffer_ptr->m_owned_memory_blocks.end (), + [=](const MemoryBlockUniquePtr& in_memory_block_ptr) + { + return (in_memory_block_ptr.get() == current_update.memory_block_ptr); + }) == current_update.buffer_ptr->m_owned_memory_blocks.end() ); + + current_update.buffer_ptr->m_memory_block_ptr = current_update.memory_block_ptr; + + if (current_update.memory_block_owned_by_buffer) + { + MemoryBlockUniquePtr memory_block_ptr(current_update.memory_block_ptr, + std::default_delete() ); + + current_update.buffer_ptr->m_owned_memory_blocks.push_back( + std::move(memory_block_ptr) + ); + } + } + } + + /* All done */ + result = true; +end: + return result; } /* Please see header for specification */ @@ -835,24 +1123,21 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, { return write(in_start_offset, in_size, - nullptr, in_data, + UINT32_MAX, /* in_device_mask */ in_opt_queue_ptr); } /* Please see header for specification */ -bool Anvil::Buffer::write(VkDeviceSize in_start_offset, - VkDeviceSize in_size, - const Anvil::PhysicalDevice* in_physical_device_ptr, - const void* in_data, - Anvil::Queue* in_opt_queue_ptr) +bool Anvil::Buffer::write(VkDeviceSize in_start_offset, + VkDeviceSize in_size, + const void* in_data, + uint32_t in_device_mask, + Anvil::Queue* in_opt_queue_ptr) { const Anvil::DeviceType device_type(m_device_ptr->get_type() ); bool result (false); - ANVIL_REDUNDANT_ARGUMENT(in_physical_device_ptr); - - /** TODO: Support for sparse-resident buffers whose n_memory_blocks > 1 */ Anvil::MemoryBlock* memory_block_ptr(get_memory_block(0) ); @@ -866,6 +1151,8 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, if ((memory_block_ptr->get_create_info_ptr()->get_memory_features() & MEMORY_FEATURE_FLAG_MAPPABLE) != 0) { + anvil_assert((memory_block_ptr->get_create_info_ptr()->get_memory_features() & MEMORY_FEATURE_FLAG_MULTI_INSTANCE) == 0); + result = memory_block_ptr->write(in_start_offset, in_size, in_data); @@ -874,77 +1161,27 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, { /* The buffer memory is not mappable. We need to create a staging memory, * upload user's data there, and then issue a copy op. */ - Anvil::PrimaryCommandBufferUniquePtr copy_cmdbuf_ptr; - const auto queue_fams = m_create_info_ptr->get_queue_families(); - Anvil::Queue* queue_ptr = nullptr; - Anvil::BufferUniquePtr staging_buffer_ptr; - Anvil::QueueFamilyBits staging_buffer_queue_fam_bits = 0; + Anvil::PrimaryCommandBufferUniquePtr copy_cmdbuf_ptr; - if (m_create_info_ptr->get_sharing_mode() == VK_SHARING_MODE_EXCLUSIVE) + if (m_staging_buffer_ptr == nullptr || + m_staging_buffer_ptr->get_create_info_ptr()->get_size() < in_size) { - /* We need to use a user-specified queue, since we can't tell which queue fam the buffer is currently configured to be compatible with. - * - * This can be worked around if the buffer can only be used with a specific queue family type. - */ - if (Anvil::Utils::is_pow2(queue_fams) ) - { - switch (queue_fams) - { - case Anvil::QUEUE_FAMILY_COMPUTE_BIT: queue_ptr = m_device_ptr->get_compute_queue (0); break; - case Anvil::QUEUE_FAMILY_DMA_BIT: queue_ptr = m_device_ptr->get_transfer_queue (0); break; - case Anvil::QUEUE_FAMILY_GRAPHICS_BIT: queue_ptr = m_device_ptr->get_universal_queue(0); break; - - default: - { - anvil_assert_fail(); - } - } - } - else + if (!init_staging_buffer(in_size, + in_opt_queue_ptr) ) { - anvil_assert(in_opt_queue_ptr != nullptr); + result = false; - queue_ptr = in_opt_queue_ptr; + goto end; } - anvil_assert(queue_ptr != nullptr); - - switch (m_device_ptr->get_queue_family_type(queue_ptr->get_queue_family_index() ) ) - { - case Anvil::QueueFamilyType::COMPUTE: staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_COMPUTE_BIT; break; - case Anvil::QueueFamilyType::TRANSFER: staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_DMA_BIT; break; - case Anvil::QueueFamilyType::UNIVERSAL: staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_GRAPHICS_BIT; break; - - default: - { - anvil_assert_fail(); - } - } + anvil_assert(m_staging_buffer_ptr != nullptr); } - else - { - /* We can use any queue from the list of queue fams this buffer is compatible, in order to perform the copy op. */ - if ((queue_fams & Anvil::QUEUE_FAMILY_GRAPHICS_BIT) != 0) - { - queue_ptr = m_device_ptr->get_universal_queue(0); - staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_GRAPHICS_BIT; - } - else - if ((queue_fams & Anvil::QUEUE_FAMILY_DMA_BIT) != 0) - { - queue_ptr = m_device_ptr->get_transfer_queue(0); - staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_DMA_BIT; - } - else - { - anvil_assert((queue_fams & Anvil::QUEUE_FAMILY_COMPUTE_BIT) != 0) - queue_ptr = m_device_ptr->get_compute_queue(0); - staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_COMPUTE_BIT; - } - } + m_staging_buffer_ptr->write(0, /* in_start_offset */ + in_size, + in_data); - copy_cmdbuf_ptr = m_device_ptr->get_command_pool_for_queue_family_index(queue_ptr->get_queue_family_index() )->alloc_primary_level_command_buffer(); + copy_cmdbuf_ptr = m_device_ptr->get_command_pool_for_queue_family_index(m_staging_buffer_queue_ptr->get_queue_family_index() )->alloc_primary_level_command_buffer(); if (copy_cmdbuf_ptr == nullptr) { @@ -953,40 +1190,28 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, goto end; } + if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) { - auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr, - in_size, - staging_buffer_queue_fam_bits, - VK_SHARING_MODE_CONCURRENT, - VK_BUFFER_USAGE_TRANSFER_SRC_BIT, - Anvil::MEMORY_FEATURE_FLAG_MAPPABLE); - - create_info_ptr->set_client_data(in_data); - create_info_ptr->set_mt_safety (MT_SAFETY_DISABLED); - - staging_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); + copy_cmdbuf_ptr->start_recording(true, /* one_time_submit */ + false); /* simultaneous_use_allowed */ } - - if (staging_buffer_ptr == nullptr) + else { - anvil_assert(staging_buffer_ptr != nullptr); + anvil_assert(device_type == Anvil::DEVICE_TYPE_MULTI_GPU); + anvil_assert(Utils::count_set_bits(in_device_mask) == 1); - goto end; - } - - if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) - { copy_cmdbuf_ptr->start_recording(true, /* one_time_submit */ - false); /* simultaneous_use_allowed */ + false, /* simultaneous_use_allowed */ + in_device_mask); } { BufferBarrier buffer_barrier(VK_ACCESS_HOST_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT, VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_IGNORED, - staging_buffer_ptr.get(), + m_staging_buffer_ptr.get(), 0, /* in_offset */ - staging_buffer_ptr->get_create_info_ptr()->get_size() ); + in_size); VkBufferCopy copy_region; copy_region.dstOffset = in_start_offset; @@ -1002,7 +1227,7 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, &buffer_barrier, 0, /* in_image_memory_barrier_count */ nullptr); /* in_image_memory_barriers_ptr */ - copy_cmdbuf_ptr->record_copy_buffer (staging_buffer_ptr.get(), + copy_cmdbuf_ptr->record_copy_buffer (m_staging_buffer_ptr.get(), this, 1, /* in_region_count */ ©_region); @@ -1011,11 +1236,37 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) { - queue_ptr->submit( + m_staging_buffer_queue_ptr->submit( Anvil::SubmitInfo::create_execute(copy_cmdbuf_ptr.get(), true /* should_block */) ); } + else + { + Anvil::CommandBufferMGPUSubmission copy_cmdbuf_submission; + + copy_cmdbuf_submission.cmd_buffer_ptr = copy_cmdbuf_ptr.get(); + copy_cmdbuf_submission.device_mask = in_device_mask; + + /* Need to update all memory instances */ + if ((m_memory_block_ptr->get_create_info_ptr()->get_memory_features() & Anvil::MEMORY_FEATURE_FLAG_MULTI_INSTANCE) != 0) + { + auto device_mask = m_memory_block_ptr->get_create_info_ptr()->get_device_mask(); + const Anvil::MGPUDevice* mgpu_device_ptr = dynamic_cast(m_device_ptr); + + if (device_mask == 0) + { + device_mask = (1 << mgpu_device_ptr->get_n_physical_devices()) - 1; + } + + copy_cmdbuf_submission.device_mask = device_mask; + } + + m_staging_buffer_queue_ptr->submit( + Anvil::SubmitInfo::create_execute(©_cmdbuf_submission, + true /* should_block */) + ); + } result = true; } diff --git a/src/wrappers/buffer_view.cpp b/src/wrappers/buffer_view.cpp index ee7e54cc..c3743c49 100644 --- a/src/wrappers/buffer_view.cpp +++ b/src/wrappers/buffer_view.cpp @@ -92,7 +92,7 @@ bool Anvil::BufferView::init() /* Spawn a new Vulkan buffer view */ buffer_view_create_info.buffer = m_create_info_ptr->get_parent_buffer()->get_buffer(); buffer_view_create_info.flags = 0; - buffer_view_create_info.format = m_create_info_ptr->get_format (); + buffer_view_create_info.format = static_cast(m_create_info_ptr->get_format() ); buffer_view_create_info.offset = m_create_info_ptr->get_start_offset(); buffer_view_create_info.pNext = nullptr; buffer_view_create_info.range = m_create_info_ptr->get_size(); diff --git a/src/wrappers/command_buffer.cpp b/src/wrappers/command_buffer.cpp index 6ffcd0a8..f65d9654 100644 --- a/src/wrappers/command_buffer.cpp +++ b/src/wrappers/command_buffer.cpp @@ -23,6 +23,7 @@ #include "misc/callbacks.h" #include "misc/debug.h" #include "misc/descriptor_set_create_info.h" +#include "misc/memory_block_create_info.h" #include "misc/struct_chainer.h" #include "wrappers/buffer.h" #include "wrappers/buffer_view.h" @@ -38,6 +39,7 @@ #include "wrappers/image.h" #include "wrappers/image_view.h" #include "wrappers/instance.h" +#include "wrappers/memory_block.h" #include "wrappers/physical_device.h" #include "wrappers/pipeline_layout.h" #include "wrappers/query_pool.h" @@ -60,17 +62,18 @@ Anvil::CommandBufferBase::BeginQueryCommand::BeginQueryCommand(Anvil::QueryPool* } /** Please see header for specification */ -Anvil::BeginRenderPassCommand::BeginRenderPassCommand(uint32_t in_n_clear_values, - const VkClearValue* in_clear_value_ptrs, - Anvil::Framebuffer* in_fbo_ptr, - const VkRect2D& in_render_area, - Anvil::RenderPass* in_render_pass_ptr, - VkSubpassContents in_contents) +Anvil::BeginRenderPassCommand::BeginRenderPassCommand(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + uint32_t in_n_physical_devices, + const Anvil::PhysicalDevice* const* in_physical_devices, + const VkRect2D* in_render_areas, + Anvil::RenderPass* in_render_pass_ptr, + VkSubpassContents in_contents) :Command(COMMAND_TYPE_BEGIN_RENDER_PASS) { contents = in_contents; fbo_ptr = in_fbo_ptr; - render_area = in_render_area; render_pass_ptr = in_render_pass_ptr; for (uint32_t n_clear_value = 0; @@ -79,6 +82,14 @@ Anvil::BeginRenderPassCommand::BeginRenderPassCommand(uint32_t in_n_c { clear_values.push_back(in_clear_value_ptrs[n_clear_value]); } + + for (uint32_t n_physical_device = 0; + n_physical_device < in_n_physical_devices; + ++n_physical_device) + { + physical_devices.push_back(in_physical_devices[n_physical_device]); + render_areas.push_back (in_render_areas [n_physical_device]); + } } /** Please see header for specification */ @@ -139,7 +150,7 @@ Anvil::CommandBufferBase::BindVertexBuffersCommand::BindVertexBuffersCommand(uin :Command(COMMAND_TYPE_BIND_VERTEX_BUFFER) { start_binding = in_start_binding; - + for (uint32_t n_binding = 0; n_binding < in_binding_count; ++n_binding) @@ -168,9 +179,9 @@ Anvil::CommandBufferBase::BindVertexBuffersCommandBinding::BindVertexBuffersComm /** Please see header for specification */ Anvil::CommandBufferBase::BlitImageCommand::BlitImageCommand(Anvil::Image* in_src_image_ptr, - VkImageLayout in_src_image_layout, + Anvil::ImageLayout in_src_image_layout, Anvil::Image* in_dst_image_ptr, - VkImageLayout in_dst_image_layout, + Anvil::ImageLayout in_dst_image_layout, uint32_t in_region_count, const VkImageBlit* in_region_ptrs, VkFilter in_filter) @@ -218,7 +229,7 @@ Anvil::CommandBufferBase::ClearAttachmentsCommand::ClearAttachmentsCommand(uint3 /** Please see header for specification */ Anvil::CommandBufferBase::ClearColorImageCommand::ClearColorImageCommand(Anvil::Image* in_image_ptr, - VkImageLayout in_image_layout, + Anvil::ImageLayout in_image_layout, const VkClearColorValue* in_color_ptr, uint32_t in_range_count, const VkImageSubresourceRange* in_range_ptrs) @@ -239,7 +250,7 @@ Anvil::CommandBufferBase::ClearColorImageCommand::ClearColorImageCommand(Anvil:: /** Please see header for specification */ Anvil::CommandBufferBase::ClearDepthStencilImageCommand::ClearDepthStencilImageCommand(Anvil::Image* in_image_ptr, - VkImageLayout in_image_layout, + Anvil::ImageLayout in_image_layout, const VkClearDepthStencilValue* in_depth_stencil_ptr, uint32_t in_range_count, const VkImageSubresourceRange* in_range_ptrs) @@ -281,7 +292,7 @@ Anvil::CommandBufferBase::CopyBufferCommand::CopyBufferCommand(Anvil::Buffer* /** Please see header for specification */ Anvil::CommandBufferBase::CopyBufferToImageCommand::CopyBufferToImageCommand(Anvil::Buffer* in_src_buffer_ptr, Anvil::Image* in_dst_image_ptr, - VkImageLayout in_dst_image_layout, + Anvil::ImageLayout in_dst_image_layout, uint32_t in_region_count, const VkBufferImageCopy* in_region_ptrs) :Command(COMMAND_TYPE_COPY_BUFFER_TO_IMAGE) @@ -302,9 +313,9 @@ Anvil::CommandBufferBase::CopyBufferToImageCommand::CopyBufferToImageCommand(Anv /** Please see header for specification */ Anvil::CommandBufferBase::CopyImageCommand::CopyImageCommand(Anvil::Image* in_src_image_ptr, - VkImageLayout in_src_image_layout, + Anvil::ImageLayout in_src_image_layout, Anvil::Image* in_dst_image_ptr, - VkImageLayout in_dst_image_layout, + Anvil::ImageLayout in_dst_image_layout, uint32_t in_region_count, const VkImageCopy* in_region_ptrs) :Command(COMMAND_TYPE_COPY_IMAGE) @@ -326,7 +337,7 @@ Anvil::CommandBufferBase::CopyImageCommand::CopyImageCommand(Anvil::Image* /** Please see header for specification */ Anvil::CommandBufferBase::CopyImageToBufferCommand::CopyImageToBufferCommand(Anvil::Image* in_src_image_ptr, - VkImageLayout in_src_image_layout, + Anvil::ImageLayout in_src_image_layout, Anvil::Buffer* in_dst_buffer_ptr, uint32_t in_region_count, const VkBufferImageCopy* in_region_ptrs) @@ -426,6 +437,23 @@ Anvil::CommandBufferBase::DispatchCommand::DispatchCommand(uint32_t in_x, z = in_z; } +/** Please see header for specification */ +Anvil::CommandBufferBase::DispatchBaseKHRCommand::DispatchBaseKHRCommand(uint32_t in_base_group_x, + uint32_t in_base_group_y, + uint32_t in_base_group_z, + uint32_t in_group_count_x, + uint32_t in_group_count_y, + uint32_t in_group_count_z) + :Command(COMMAND_TYPE_DISPATCH_BASE_KHR) +{ + base_group_x = in_base_group_x; + base_group_y = in_base_group_y; + base_group_z = in_base_group_z; + group_count_x = in_group_count_x; + group_count_y = in_group_count_y; + group_count_z = in_group_count_z; +} + /** Please see header for specification */ Anvil::CommandBufferBase::DispatchIndirectCommand::DispatchIndirectCommand(Anvil::Buffer* in_buffer_ptr, VkDeviceSize in_offset) @@ -694,9 +722,9 @@ Anvil::CommandBufferBase::ResetQueryPoolCommand::ResetQueryPoolCommand(Anvil::Qu /** Please see header for specification */ Anvil::CommandBufferBase::ResolveImageCommand::ResolveImageCommand(Anvil::Image* in_src_image_ptr, - VkImageLayout in_src_image_layout, + Anvil::ImageLayout in_src_image_layout, Anvil::Image* in_dst_image_ptr, - VkImageLayout in_dst_image_layout, + Anvil::ImageLayout in_dst_image_layout, uint32_t in_region_count, const VkImageResolve* in_region_ptrs) :Command(COMMAND_TYPE_RESOLVE_IMAGE) @@ -745,6 +773,13 @@ Anvil::CommandBufferBase::SetDepthBoundsCommand::SetDepthBoundsCommand(float in_ min_depth_bounds = in_min_depth_bounds; } +/** Please see header for specification */ +Anvil::CommandBufferBase::SetDeviceMaskKHRCommand::SetDeviceMaskKHRCommand(uint32_t in_device_mask) + :Command(COMMAND_TYPE_SET_DEVICE_MASK_KHR), + device_mask(in_device_mask) +{ +} + /** Please see header for specification */ Anvil::CommandBufferBase::SetEventCommand::SetEventCommand(Anvil::Event* in_event_ptr, VkPipelineStageFlags in_stage_mask) @@ -908,10 +943,12 @@ Anvil::CommandBufferBase::CommandBufferBase(const Anvil::BaseDevice* in_device_p VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT), CallbacksSupportProvider (COMMAND_BUFFER_CALLBACK_ID_COUNT), m_command_buffer (VK_NULL_HANDLE), + m_device_mask (0), m_device_ptr (in_device_ptr), m_is_renderpass_active (false), m_parent_command_pool_ptr (in_parent_command_pool_ptr), m_recording_in_progress (false), + m_renderpass_device_mask (0), m_type (in_type) { anvil_assert(in_parent_command_pool_ptr != nullptr); @@ -1121,11 +1158,11 @@ bool Anvil::CommandBufferBase::record_bind_pipeline(VkPipelineBindPoint in_pipel goto end; } - anvil_assert(in_pipeline_bind_point == VK_PIPELINE_BIND_POINT_COMPUTE || + anvil_assert(in_pipeline_bind_point == VK_PIPELINE_BIND_POINT_COMPUTE || in_pipeline_bind_point == VK_PIPELINE_BIND_POINT_GRAPHICS); - pipeline_vk = (in_pipeline_bind_point == VK_PIPELINE_BIND_POINT_COMPUTE) ? m_device_ptr->get_compute_pipeline_manager()->get_pipeline (in_pipeline_id) - : m_device_ptr->get_graphics_pipeline_manager()->get_pipeline(in_pipeline_id); + pipeline_vk = (in_pipeline_bind_point == VK_PIPELINE_BIND_POINT_COMPUTE) ? m_device_ptr->get_compute_pipeline_manager ()->get_pipeline(in_pipeline_id) + : m_device_ptr->get_graphics_pipeline_manager()->get_pipeline(in_pipeline_id); #ifdef STORE_COMMAND_BUFFER_COMMANDS { @@ -1207,9 +1244,9 @@ bool Anvil::CommandBufferBase::record_bind_vertex_buffers(uint32_t in /* Please see header for specification */ bool Anvil::CommandBufferBase::record_blit_image(Anvil::Image* in_src_image_ptr, - VkImageLayout in_src_image_layout, + Anvil::ImageLayout in_src_image_layout, Anvil::Image* in_dst_image_ptr, - VkImageLayout in_dst_image_layout, + Anvil::ImageLayout in_dst_image_layout, uint32_t in_region_count, const VkImageBlit* in_region_ptrs, VkFilter in_filter) @@ -1250,9 +1287,9 @@ bool Anvil::CommandBufferBase::record_blit_image(Anvil::Image* in_src_image { vkCmdBlitImage(m_command_buffer, in_src_image_ptr->get_image(), - in_src_image_layout, + static_cast(in_src_image_layout), in_dst_image_ptr->get_image(), - in_dst_image_layout, + static_cast(in_dst_image_layout), in_region_count, in_region_ptrs, in_filter); @@ -1318,7 +1355,7 @@ bool Anvil::CommandBufferBase::record_clear_attachments(uint32_t /* Please see header for specification */ bool Anvil::CommandBufferBase::record_clear_color_image(Anvil::Image* in_image_ptr, - VkImageLayout in_image_layout, + Anvil::ImageLayout in_image_layout, const VkClearColorValue* in_color_ptr, uint32_t in_range_count, const VkImageSubresourceRange* in_range_ptrs) @@ -1357,7 +1394,7 @@ bool Anvil::CommandBufferBase::record_clear_color_image(Anvil::Image* { vkCmdClearColorImage(m_command_buffer, in_image_ptr->get_image(), - in_image_layout, + static_cast(in_image_layout), in_color_ptr, in_range_count, in_range_ptrs); @@ -1372,7 +1409,7 @@ bool Anvil::CommandBufferBase::record_clear_color_image(Anvil::Image* /* Please see header for specification */ bool Anvil::CommandBufferBase::record_clear_depth_stencil_image(Anvil::Image* in_image_ptr, - VkImageLayout in_image_layout, + Anvil::ImageLayout in_image_layout, const VkClearDepthStencilValue* in_depth_stencil_ptr, uint32_t in_range_count, const VkImageSubresourceRange* in_range_ptrs) @@ -1411,7 +1448,7 @@ bool Anvil::CommandBufferBase::record_clear_depth_stencil_image(Anvil::Image* { vkCmdClearDepthStencilImage(m_command_buffer, in_image_ptr->get_image(), - in_image_layout, + static_cast(in_image_layout), in_depth_stencil_ptr, in_range_count, in_range_ptrs); @@ -1478,7 +1515,7 @@ bool Anvil::CommandBufferBase::record_copy_buffer(Anvil::Buffer* in_src_buf /* Please see header for specification */ bool Anvil::CommandBufferBase::record_copy_buffer_to_image(Anvil::Buffer* in_src_buffer_ptr, Anvil::Image* in_dst_image_ptr, - VkImageLayout in_dst_image_layout, + Anvil::ImageLayout in_dst_image_layout, uint32_t in_region_count, const VkBufferImageCopy* in_region_ptrs) { @@ -1517,7 +1554,7 @@ bool Anvil::CommandBufferBase::record_copy_buffer_to_image(Anvil::Buffer* vkCmdCopyBufferToImage(m_command_buffer, in_src_buffer_ptr->get_buffer(), in_dst_image_ptr->get_image(), - in_dst_image_layout, + static_cast(in_dst_image_layout), in_region_count, in_region_ptrs); } @@ -1531,9 +1568,9 @@ bool Anvil::CommandBufferBase::record_copy_buffer_to_image(Anvil::Buffer* /* Please see header for specification */ bool Anvil::CommandBufferBase::record_copy_image(Anvil::Image* in_src_image_ptr, - VkImageLayout in_src_image_layout, + Anvil::ImageLayout in_src_image_layout, Anvil::Image* in_dst_image_ptr, - VkImageLayout in_dst_image_layout, + Anvil::ImageLayout in_dst_image_layout, uint32_t in_region_count, const VkImageCopy* in_region_ptrs) { @@ -1572,9 +1609,9 @@ bool Anvil::CommandBufferBase::record_copy_image(Anvil::Image* in_src_image { vkCmdCopyImage(m_command_buffer, in_src_image_ptr->get_image(), - in_src_image_layout, + static_cast(in_src_image_layout), in_dst_image_ptr->get_image(), - in_dst_image_layout, + static_cast(in_dst_image_layout), in_region_count, in_region_ptrs); } @@ -1588,7 +1625,7 @@ bool Anvil::CommandBufferBase::record_copy_image(Anvil::Image* in_src_image /* Please see header for specification */ bool Anvil::CommandBufferBase::record_copy_image_to_buffer(Anvil::Image* in_src_image_ptr, - VkImageLayout in_src_image_layout, + Anvil::ImageLayout in_src_image_layout, Anvil::Buffer* in_dst_buffer_ptr, uint32_t in_region_count, const VkBufferImageCopy* in_region_ptrs) @@ -1627,7 +1664,7 @@ bool Anvil::CommandBufferBase::record_copy_image_to_buffer(Anvil::Image* { vkCmdCopyImageToBuffer(m_command_buffer, in_src_image_ptr->get_image(), - in_src_image_layout, + static_cast(in_src_image_layout), in_dst_buffer_ptr->get_buffer(), in_region_count, in_region_ptrs); @@ -1899,6 +1936,67 @@ bool Anvil::CommandBufferBase::record_debug_marker_insert_EXT(const std::string& return result; } +/* Please see header for specification */ +bool Anvil::CommandBufferBase::record_dispatch_base_KHR(uint32_t in_base_group_x, + uint32_t in_base_group_y, + uint32_t in_base_group_z, + uint32_t in_group_count_x, + uint32_t in_group_count_y, + uint32_t in_group_count_z) +{ + const auto& entrypoints(m_device_ptr->get_extension_khr_device_group_entrypoints() ); + bool result (false); + + if (m_is_renderpass_active) + { + anvil_assert(!m_is_renderpass_active); + + goto end; + } + + if (!m_recording_in_progress) + { + anvil_assert(m_recording_in_progress); + + goto end; + } + + anvil_assert(m_device_ptr->get_extension_info()->khr_device_group() ); + + + #ifdef STORE_COMMAND_BUFFER_COMMANDS + { + if (!m_command_stashing_disabled) + { + m_commands.push_back(DispatchBaseKHRCommand(in_base_group_x, + in_base_group_y, + in_base_group_z, + in_group_count_x, + in_group_count_y, + in_group_count_z) ); + } + } + #endif + + m_parent_command_pool_ptr->lock(); + lock(); + { + entrypoints.vkCmdDispatchBaseKHR(m_command_buffer, + in_base_group_x, + in_base_group_y, + in_base_group_z, + in_group_count_x, + in_group_count_y, + in_group_count_z); + } + unlock(); + m_parent_command_pool_ptr->unlock(); + + result = true; +end: + return result; +} + /* Please see header for specification */ bool Anvil::CommandBufferBase::record_dispatch_indirect(Anvil::Buffer* in_buffer_ptr, VkDeviceSize in_offset) @@ -2143,7 +2241,7 @@ bool Anvil::CommandBufferBase::record_draw_indexed_indirect_count_AMD(Anvil::Buf #endif entrypoints = m_device_ptr->get_extension_amd_draw_indirect_count_entrypoints(); - + m_parent_command_pool_ptr->lock(); lock(); { @@ -2206,7 +2304,7 @@ bool Anvil::CommandBufferBase::record_draw_indexed_indirect_count_KHR(Anvil::Buf #endif entrypoints = m_device_ptr->get_extension_khr_draw_indirect_count_entrypoints(); - + m_parent_command_pool_ptr->lock(); lock(); { @@ -2738,9 +2836,9 @@ bool Anvil::CommandBufferBase::record_reset_query_pool(Anvil::QueryPool* in_quer /* Please see header for specification */ bool Anvil::CommandBufferBase::record_resolve_image(Anvil::Image* in_src_image_ptr, - VkImageLayout in_src_image_layout, + Anvil::ImageLayout in_src_image_layout, Anvil::Image* in_dst_image_ptr, - VkImageLayout in_dst_image_layout, + Anvil::ImageLayout in_dst_image_layout, uint32_t in_region_count, const VkImageResolve* in_region_ptrs) { @@ -2779,9 +2877,9 @@ bool Anvil::CommandBufferBase::record_resolve_image(Anvil::Image* in_src { vkCmdResolveImage(m_command_buffer, in_src_image_ptr->get_image(), - in_src_image_layout, + static_cast(in_src_image_layout), in_dst_image_ptr->get_image(), - in_dst_image_layout, + static_cast(in_dst_image_layout), in_region_count, in_region_ptrs); } @@ -2911,11 +3009,72 @@ bool Anvil::CommandBufferBase::record_set_depth_bounds(float in_min_depth_bounds return result; } +/* Please see header for specification */ +bool Anvil::CommandBufferBase::record_set_device_mask_KHR(uint32_t in_device_mask) +{ + /* Note: Command supported inside and outside the renderpass. */ + const auto& entrypoints (m_device_ptr->get_extension_khr_device_group_entrypoints() ); + bool result (false); + + if (!m_recording_in_progress) + { + anvil_assert(m_recording_in_progress); + + goto end; + } + + anvil_assert(m_device_ptr->get_extension_info()->khr_device_group() ); + + + #ifdef STORE_COMMAND_BUFFER_COMMANDS + { + if (!m_command_stashing_disabled) + { + m_commands.push_back(SetDeviceMaskKHRCommand(in_device_mask) ); + } + } + #endif + + if (m_is_renderpass_active) + { + for (uint32_t n_device = 0; + n_device < sizeof(uint32_t); + ++n_device) + { + if (!(m_renderpass_device_mask & (1 << n_device)) && + (m_device_mask & (1 << n_device)) ) + { + /* It is illegal to try to activate a device which has not been enabled + * for the renderpass. + */ + anvil_assert_fail(); + + goto end; + } + } + } + + m_parent_command_pool_ptr->lock(); + lock(); + { + entrypoints.vkCmdSetDeviceMaskKHR(m_command_buffer, + in_device_mask); + } + unlock(); + m_parent_command_pool_ptr->unlock(); + + m_device_mask = in_device_mask; + result = true; +end: + return result; +} + /* Please see header for specification */ bool Anvil::CommandBufferBase::record_set_event(Anvil::Event* in_event_ptr, VkPipelineStageFlags in_stage_mask) { - bool result = false; + const Anvil::DeviceType device_type = m_device_ptr->get_type(); + bool result = false; if (m_is_renderpass_active) { @@ -2931,6 +3090,15 @@ bool Anvil::CommandBufferBase::record_set_event(Anvil::Event* in_event_pt goto end; } + if (device_type == Anvil::DEVICE_TYPE_MULTI_GPU && + !Anvil::Utils::is_pow2(static_cast(m_device_mask) )) + { + /* Only one device may be active at the time of this call */ + anvil_assert(Anvil::Utils::is_pow2(static_cast(m_device_mask) ) ); + + goto end; + } + #ifdef STORE_COMMAND_BUFFER_COMMANDS { if (!m_command_stashing_disabled) @@ -3499,6 +3667,27 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t i Anvil::RenderPass* in_render_pass_ptr, VkSubpassContents in_contents) { + return record_begin_render_pass(in_n_clear_values, + in_clear_value_ptrs, + in_fbo_ptr, + 0, /* in_n_physical_devices */ + nullptr, /* in_physical_devices_ptr */ + &in_render_area, + in_render_pass_ptr, + in_contents); +} + +/* Please see header for specification */ +bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + uint32_t in_n_physical_devices, + const Anvil::PhysicalDevice* const* in_physical_devices, + const VkRect2D* in_render_areas, + Anvil::RenderPass* in_render_pass_ptr, + VkSubpassContents in_contents) +{ + const Anvil::DeviceType device_type = m_device_ptr->get_type(); Anvil::StructChainer render_pass_begin_info_chain; bool result = false; @@ -3516,6 +3705,19 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t i goto end; } + if (in_n_physical_devices == 0 && + device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) + { + const Anvil::PhysicalDevice* physical_device_ptr; + const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr) ); + + anvil_assert(sgpu_device_ptr != nullptr); /* User attempted to call this function prototype with in_n_physical_devices set to 0 */ + + physical_device_ptr = sgpu_device_ptr->get_physical_device(); + in_n_physical_devices = 1; + in_physical_devices = &physical_device_ptr; + } + #ifdef STORE_COMMAND_BUFFER_COMMANDS { if (!m_command_stashing_disabled) @@ -3523,13 +3725,17 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t i m_commands.push_back(BeginRenderPassCommand(in_n_clear_values, in_clear_value_ptrs, in_fbo_ptr, - in_render_area, + in_n_physical_devices, + in_physical_devices, + in_render_areas, in_render_pass_ptr, in_contents) ); } } #endif + anvil_assert(in_render_areas != nullptr); + { VkRenderPassBeginInfo render_pass_begin_info; @@ -3537,13 +3743,35 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t i render_pass_begin_info.framebuffer = in_fbo_ptr->get_framebuffer(in_render_pass_ptr); render_pass_begin_info.pClearValues = in_clear_value_ptrs; render_pass_begin_info.pNext = nullptr; - render_pass_begin_info.renderArea = in_render_area; + render_pass_begin_info.renderArea = in_render_areas[0]; render_pass_begin_info.renderPass = in_render_pass_ptr->get_render_pass(); render_pass_begin_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO; render_pass_begin_info_chain.append_struct(render_pass_begin_info); } + if (device_type == Anvil::DEVICE_TYPE_MULTI_GPU) + { + VkDeviceGroupRenderPassBeginInfoKHR render_pass_device_group_begin_info; + + render_pass_device_group_begin_info.deviceMask = 0; + render_pass_device_group_begin_info.deviceRenderAreaCount = in_n_physical_devices; + render_pass_device_group_begin_info.pDeviceRenderAreas = in_render_areas; + render_pass_device_group_begin_info.pNext = nullptr; + render_pass_device_group_begin_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO_KHR; + + for (uint32_t n_physical_device = 0; + n_physical_device < in_n_physical_devices; + ++n_physical_device) + { + render_pass_device_group_begin_info.deviceMask |= (1 << in_physical_devices[n_physical_device]->get_device_group_device_index() ); + } + + render_pass_begin_info_chain.append_struct(render_pass_device_group_begin_info); + + m_renderpass_device_mask = render_pass_device_group_begin_info.deviceMask; + } + m_parent_command_pool_ptr->lock(); lock(); { @@ -3694,9 +3922,11 @@ bool Anvil::PrimaryCommandBuffer::record_next_subpass(VkSubpassContents in_conte } /* Please see header for specification */ -bool Anvil::PrimaryCommandBuffer::start_recording(bool in_one_time_submit, - bool in_simultaneous_use_allowed) +bool Anvil::PrimaryCommandBuffer::start_recording(bool in_one_time_submit, + bool in_simultaneous_use_allowed, + uint32_t in_opt_device_mask) { + const Anvil::DeviceType device_type (m_device_ptr->get_type() ); bool result (false); VkResult result_vk; Anvil::StructChainer struct_chainer; @@ -3720,6 +3950,29 @@ bool Anvil::PrimaryCommandBuffer::start_recording(bool in_one_time_submit, struct_chainer.append_struct(command_buffer_begin_info); } + if (device_type == Anvil::DEVICE_TYPE_MULTI_GPU) + { + VkDeviceGroupCommandBufferBeginInfoKHR command_buffer_device_group_begin_info; + auto device_mgpu_ptr = dynamic_cast(m_device_ptr); + + if (in_opt_device_mask == UINT32_MAX) + { + in_opt_device_mask = (1 << device_mgpu_ptr->get_n_physical_devices()) - 1; + } + + anvil_assert(in_opt_device_mask != 0); + + command_buffer_device_group_begin_info.deviceMask = in_opt_device_mask; + command_buffer_device_group_begin_info.pNext = nullptr; + command_buffer_device_group_begin_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHR; + + struct_chainer.append_struct(command_buffer_device_group_begin_info); + } + else + { + anvil_assert(device_type == Anvil::DEVICE_TYPE_SINGLE_GPU); + } + m_parent_command_pool_ptr->lock(); lock(); { @@ -3745,6 +3998,7 @@ bool Anvil::PrimaryCommandBuffer::start_recording(bool in_one_time_submit, } #endif + m_device_mask = in_opt_device_mask; m_recording_in_progress = true; result = true; @@ -3785,17 +4039,19 @@ Anvil::SecondaryCommandBuffer::SecondaryCommandBuffer(const Anvil::BaseDevice* i } /* Please see header for specification */ -bool Anvil::SecondaryCommandBuffer::start_recording(bool in_one_time_submit, - bool in_simultaneous_use_allowed, - bool in_renderpass_usage_only, - Framebuffer* in_framebuffer_ptr, - RenderPass* in_render_pass_ptr, - SubPassID in_subpass_id, - OcclusionQuerySupportScope in_required_occlusion_query_support_scope, - bool in_occlusion_query_used_by_primary_command_buffer, - VkQueryPipelineStatisticFlags in_required_pipeline_statistics_scope) +bool Anvil::SecondaryCommandBuffer::start_recording(bool in_one_time_submit, + bool in_simultaneous_use_allowed, + bool in_renderpass_usage_only, + Framebuffer* in_framebuffer_ptr, + RenderPass* in_render_pass_ptr, + SubPassID in_subpass_id, + OcclusionQuerySupportScope in_required_occlusion_query_support_scope, + bool in_occlusion_query_used_by_primary_command_buffer, + VkQueryPipelineStatisticFlags in_required_pipeline_statistics_scope, + uint32_t in_opt_device_mask) { VkCommandBufferInheritanceInfo command_buffer_inheritance_info; + const Anvil::DeviceType device_type (m_device_ptr->get_type() ); bool result (false); VkResult result_vk; Anvil::StructChainer struct_chainer; @@ -3832,6 +4088,27 @@ bool Anvil::SecondaryCommandBuffer::start_recording(bool command_buffer_inheritance_info.subpass = in_subpass_id; } + if (device_type == Anvil::DEVICE_TYPE_MULTI_GPU) + { + anvil_assert((in_opt_device_mask != 0) && (in_opt_device_mask != UINT32_MAX)); + + VkDeviceGroupCommandBufferBeginInfoKHR command_buffer_device_group_begin_info; + + command_buffer_device_group_begin_info.deviceMask = in_opt_device_mask; + command_buffer_device_group_begin_info.pNext = nullptr; + command_buffer_device_group_begin_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHR; + + struct_chainer.append_struct(command_buffer_device_group_begin_info); + + m_device_mask = in_opt_device_mask; + } + else + { + anvil_assert(device_type == Anvil::DEVICE_TYPE_SINGLE_GPU); + + m_device_mask = 0; + } + m_parent_command_pool_ptr->lock(); lock(); { @@ -3857,8 +4134,7 @@ bool Anvil::SecondaryCommandBuffer::start_recording(bool } #endif - m_is_renderpass_active = in_renderpass_usage_only; - + m_is_renderpass_active = in_renderpass_usage_only; m_recording_in_progress = true; result = true; diff --git a/src/wrappers/compute_pipeline_manager.cpp b/src/wrappers/compute_pipeline_manager.cpp index 079e491f..1f653f46 100644 --- a/src/wrappers/compute_pipeline_manager.cpp +++ b/src/wrappers/compute_pipeline_manager.cpp @@ -215,6 +215,11 @@ bool Anvil::ComputePipelineManager::bake() pipeline_create_info.flags |= ((current_pipeline_create_info_ptr->allows_derivatives () ) ? VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT : 0) | ((current_pipeline_create_info_ptr->has_optimizations_disabled() ) ? VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT : 0); + if (m_device_ptr->get_type() == Anvil::DEVICE_TYPE_MULTI_GPU) + { + pipeline_create_info.flags |= VK_PIPELINE_CREATE_DISPATCH_BASE_KHR; + } + layout_to_bake_item_map[pipeline_create_info.layout].push_back(BakeItem(pipeline_create_info, current_pipeline_id, current_pipeline_ptr) ); diff --git a/src/wrappers/descriptor_set.cpp b/src/wrappers/descriptor_set.cpp index ccbbe2ad..e4573f4b 100644 --- a/src/wrappers/descriptor_set.cpp +++ b/src/wrappers/descriptor_set.cpp @@ -44,7 +44,7 @@ Anvil::DescriptorSet::BindingItem& Anvil::DescriptorSet::BindingItem::operator=( buffer_ptr = in_element.buffer_ptr; buffer_view_ptr = nullptr; dirty = true; - image_layout = VK_IMAGE_LAYOUT_UNDEFINED; + image_layout = Anvil::ImageLayout::UNDEFINED; image_view_ptr = nullptr; sampler_ptr = nullptr; size = in_element.size; @@ -92,7 +92,7 @@ Anvil::DescriptorSet::BindingItem& Anvil::DescriptorSet::BindingItem::operator=( buffer_ptr = nullptr; buffer_view_ptr = nullptr; dirty = true; - image_layout = VK_IMAGE_LAYOUT_UNDEFINED; + image_layout = Anvil::ImageLayout::UNDEFINED; image_view_ptr = nullptr; sampler_ptr = in_element.sampler_ptr; size = UINT64_MAX; @@ -108,7 +108,7 @@ Anvil::DescriptorSet::BindingItem& Anvil::DescriptorSet::BindingItem::operator=( buffer_ptr = nullptr; buffer_view_ptr = in_element.buffer_view_ptr; dirty = true; - image_layout = VK_IMAGE_LAYOUT_UNDEFINED; + image_layout = Anvil::ImageLayout::UNDEFINED; image_view_ptr = nullptr; sampler_ptr = nullptr; size = UINT64_MAX; @@ -166,9 +166,9 @@ Anvil::DescriptorSet::BufferBindingElement::BufferBindingElement(const BufferBin } /** Please see header for specification */ -Anvil::DescriptorSet::CombinedImageSamplerBindingElement::CombinedImageSamplerBindingElement(VkImageLayout in_image_layout, - Anvil::ImageView* in_image_view_ptr, - Anvil::Sampler* in_sampler_ptr) +Anvil::DescriptorSet::CombinedImageSamplerBindingElement::CombinedImageSamplerBindingElement(Anvil::ImageLayout in_image_layout, + Anvil::ImageView* in_image_view_ptr, + Anvil::Sampler* in_sampler_ptr) { anvil_assert(in_image_view_ptr != nullptr); @@ -193,8 +193,8 @@ Anvil::DescriptorSet::CombinedImageSamplerBindingElement::CombinedImageSamplerBi } /** Please see header for specification */ -Anvil::DescriptorSet::ImageBindingElement::ImageBindingElement(VkImageLayout in_image_layout, - Anvil::ImageView* in_image_view_ptr) +Anvil::DescriptorSet::ImageBindingElement::ImageBindingElement(Anvil::ImageLayout in_image_layout, + Anvil::ImageView* in_image_view_ptr) { anvil_assert(in_image_view_ptr != nullptr); @@ -384,7 +384,7 @@ void Anvil::DescriptorSet::fill_image_info_vk_descriptor(const Anvil::Descriptor const bool& in_immutable_samplers_enabled, VkDescriptorImageInfo* out_descriptor_ptr) const { - out_descriptor_ptr->imageLayout = in_binding_item.image_layout; + out_descriptor_ptr->imageLayout = static_cast(in_binding_item.image_layout); out_descriptor_ptr->imageView = (in_binding_item.image_view_ptr != nullptr) ? in_binding_item.image_view_ptr->get_image_view() : VK_NULL_HANDLE; if (false == in_immutable_samplers_enabled && @@ -399,11 +399,11 @@ void Anvil::DescriptorSet::fill_image_info_vk_descriptor(const Anvil::Descriptor } /* Please see header for specification */ -bool Anvil::DescriptorSet::get_combined_image_sampler_binding_properties(uint32_t in_n_binding, - uint32_t in_n_binding_array_item, - VkImageLayout* out_opt_image_layout_ptr, - Anvil::ImageView** out_opt_image_view_ptr_ptr, - Anvil::Sampler** out_opt_sampler_ptr_ptr) +bool Anvil::DescriptorSet::get_combined_image_sampler_binding_properties(uint32_t in_n_binding, + uint32_t in_n_binding_array_item, + Anvil::ImageLayout* out_opt_image_layout_ptr, + Anvil::ImageView** out_opt_image_view_ptr_ptr, + Anvil::Sampler** out_opt_sampler_ptr_ptr) { decltype(m_bindings)::const_iterator binding_iterator = m_bindings.find(in_n_binding); bool result = true; @@ -448,10 +448,10 @@ bool Anvil::DescriptorSet::get_combined_image_sampler_binding_properties(uint32_ } /* Please see header for specification */ -bool Anvil::DescriptorSet::get_input_attachment_binding_properties(uint32_t in_n_binding, - uint32_t in_n_binding_array_item, - VkImageLayout* out_opt_image_layout_ptr, - Anvil::ImageView** out_opt_image_view_ptr_ptr) const +bool Anvil::DescriptorSet::get_input_attachment_binding_properties(uint32_t in_n_binding, + uint32_t in_n_binding_array_item, + Anvil::ImageLayout* out_opt_image_layout_ptr, + Anvil::ImageView** out_opt_image_view_ptr_ptr) const { decltype(m_bindings)::const_iterator binding_iterator = m_bindings.find(in_n_binding); bool result = true; diff --git a/src/wrappers/device.cpp b/src/wrappers/device.cpp index 443a588a..38960820 100644 --- a/src/wrappers/device.cpp +++ b/src/wrappers/device.cpp @@ -41,6 +41,9 @@ #include "wrappers/rendering_surface.h" #include "wrappers/swapchain.h" +#ifdef max +#undef max +#endif /* Please see header for specification */ Anvil::BaseDevice::BaseDevice(const Anvil::Instance* in_parent_instance_ptr, @@ -103,7 +106,6 @@ Anvil::DescriptorSetLayout* Anvil::BaseDevice::get_dummy_descriptor_set_layout() return m_dummy_dsg_ptr->get_descriptor_set_layout(0); } -/** Please see header for specification */ bool Anvil::BaseDevice::get_memory_types_supported_for_external_handle(const Anvil::ExternalMemoryHandleTypeBit& in_external_handle_type, ExternalHandleType in_handle, uint32_t* out_supported_memory_type_bits) const @@ -241,9 +243,9 @@ Anvil::Queue* Anvil::BaseDevice::get_queue(const Anvil::QueueFamilyType& in_queu switch (in_queue_family_type) { - case Anvil::QueueFamilyType::COMPUTE: result_ptr = get_compute_queue (in_n_queue); break; - case Anvil::QueueFamilyType::TRANSFER: result_ptr = get_transfer_queue (in_n_queue); break; - case Anvil::QueueFamilyType::UNIVERSAL: result_ptr = get_universal_queue (in_n_queue); break; + case Anvil::QueueFamilyType::COMPUTE: result_ptr = get_compute_queue (in_n_queue); break; + case Anvil::QueueFamilyType::TRANSFER: result_ptr = get_transfer_queue (in_n_queue); break; + case Anvil::QueueFamilyType::UNIVERSAL: result_ptr = get_universal_queue (in_n_queue); break; default: { @@ -325,9 +327,9 @@ void Anvil::BaseDevice::get_queue_family_indices_for_physical_device(const Anvil /* NOTE: Vulkan API only guarantees universal queue family's availability */ anvil_assert(result_universal_queue_families.size() > 0); - out_device_queue_family_info_ptr->queue_families[Anvil::QueueFamilyType::COMPUTE] = result_compute_queue_families; - out_device_queue_family_info_ptr->queue_families[Anvil::QueueFamilyType::TRANSFER] = result_transfer_queue_families; - out_device_queue_family_info_ptr->queue_families[Anvil::QueueFamilyType::UNIVERSAL] = result_universal_queue_families; + out_device_queue_family_info_ptr->queue_families[Anvil::QueueFamilyType::COMPUTE] = result_compute_queue_families; + out_device_queue_family_info_ptr->queue_families[Anvil::QueueFamilyType::TRANSFER] = result_transfer_queue_families; + out_device_queue_family_info_ptr->queue_families[Anvil::QueueFamilyType::UNIVERSAL] = result_universal_queue_families; for (Anvil::QueueFamilyType current_queue_family_type = Anvil::QueueFamilyType::FIRST; current_queue_family_type != Anvil::QueueFamilyType::COUNT; @@ -383,7 +385,7 @@ bool Anvil::BaseDevice::get_queue_family_indices_for_queue_family_type(const Anv /** Please see header for specification */ Anvil::QueueFamilyType Anvil::BaseDevice::get_queue_family_type(uint32_t in_queue_family_index) const { - return m_queue_family_index_to_type.at(in_queue_family_index); + return m_queue_family_index_to_types.at(in_queue_family_index).at(0); } /** Please see header for specification */ @@ -405,7 +407,7 @@ Anvil::Queue* Anvil::BaseDevice::get_queue_for_queue_family_index(uint32_t in_n_ } /* Please see header for specification */ -bool Anvil::BaseDevice::get_sample_locations(VkSampleCountFlagBits in_sample_count, +bool Anvil::BaseDevice::get_sample_locations(Anvil::SampleCountFlagBits in_sample_count, std::vector* out_result_ptr) const { bool result = true; @@ -414,6 +416,18 @@ bool Anvil::BaseDevice::get_sample_locations(VkSampleCountFlagBits in_sam switch (get_type() ) { + case Anvil::DEVICE_TYPE_MULTI_GPU: + { + /* Sample locations must not differ for all devices within a given device group, so it technically + * doesn't matter which physical device we choose to check for standard sample locations support. + */ + const Anvil::MGPUDevice* mgpu_device_ptr = reinterpret_cast(this); + anvil_assert(mgpu_device_ptr != nullptr); + + standard_sample_locations_support = (mgpu_device_ptr->get_physical_device_properties().core_vk1_0_properties_ptr->limits.standard_sample_locations); + break; + } + case Anvil::DEVICE_TYPE_SINGLE_GPU: { const Anvil::SGPUDevice* sgpu_device_ptr = reinterpret_cast(this); @@ -438,7 +452,7 @@ bool Anvil::BaseDevice::get_sample_locations(VkSampleCountFlagBits in_sam switch (in_sample_count) { - case VK_SAMPLE_COUNT_1_BIT: + case Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT: { out_result_ptr->clear(); @@ -447,7 +461,7 @@ bool Anvil::BaseDevice::get_sample_locations(VkSampleCountFlagBits in_sam break; } - case VK_SAMPLE_COUNT_2_BIT: + case Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_2_BIT: { out_result_ptr->clear(); @@ -458,7 +472,7 @@ bool Anvil::BaseDevice::get_sample_locations(VkSampleCountFlagBits in_sam } - case VK_SAMPLE_COUNT_4_BIT: + case Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_4_BIT: { out_result_ptr->clear(); @@ -470,7 +484,7 @@ bool Anvil::BaseDevice::get_sample_locations(VkSampleCountFlagBits in_sam break; } - case VK_SAMPLE_COUNT_8_BIT: + case Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_8_BIT: { out_result_ptr->clear(); @@ -486,7 +500,7 @@ bool Anvil::BaseDevice::get_sample_locations(VkSampleCountFlagBits in_sam break; } - case VK_SAMPLE_COUNT_16_BIT: + case Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_16_BIT: { out_result_ptr->clear(); @@ -724,6 +738,31 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, anvil_assert(m_khr_descriptor_update_template_extension_entrypoints.vkUpdateDescriptorSetWithTemplateKHR != nullptr); } + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_device_group() ) + { + m_khr_device_group_extension_entrypoints.vkCmdDispatchBaseKHR = reinterpret_cast (get_proc_address("vkCmdDispatchBaseKHR") ); + m_khr_device_group_extension_entrypoints.vkCmdSetDeviceMaskKHR = reinterpret_cast (get_proc_address("vkCmdSetDeviceMaskKHR") ); + m_khr_device_group_extension_entrypoints.vkGetDeviceGroupPeerMemoryFeaturesKHR = reinterpret_cast (get_proc_address("vkGetDeviceGroupPeerMemoryFeaturesKHR") ); + + /* NOTE: Certain device group entrypoints are only available if KHR_swapchain is also enabled */ + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_swapchain() ) + { + m_khr_device_group_extension_entrypoints.vkAcquireNextImage2KHR = reinterpret_cast (get_proc_address("vkAcquireNextImage2KHR") ); + m_khr_device_group_extension_entrypoints.vkGetPhysicalDevicePresentRectanglesKHR = reinterpret_cast(get_proc_address("vkGetPhysicalDevicePresentRectanglesKHR") ); + m_khr_device_group_extension_entrypoints.vkGetDeviceGroupSurfacePresentModesKHR = reinterpret_cast (get_proc_address("vkGetDeviceGroupSurfacePresentModesKHR") ); + m_khr_device_group_extension_entrypoints.vkGetDeviceGroupPresentCapabilitiesKHR = reinterpret_cast (get_proc_address("vkGetDeviceGroupPresentCapabilitiesKHR") ); + + anvil_assert(m_khr_device_group_extension_entrypoints.vkAcquireNextImage2KHR != nullptr); + anvil_assert(m_khr_device_group_extension_entrypoints.vkGetDeviceGroupPresentCapabilitiesKHR != nullptr); + anvil_assert(m_khr_device_group_extension_entrypoints.vkGetDeviceGroupSurfacePresentModesKHR != nullptr); + anvil_assert(m_khr_device_group_extension_entrypoints.vkGetPhysicalDevicePresentRectanglesKHR != nullptr); + } + + anvil_assert(m_khr_device_group_extension_entrypoints.vkCmdDispatchBaseKHR != nullptr); + anvil_assert(m_khr_device_group_extension_entrypoints.vkCmdSetDeviceMaskKHR != nullptr); + anvil_assert(m_khr_device_group_extension_entrypoints.vkGetDeviceGroupPeerMemoryFeaturesKHR != nullptr); + } + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_bind_memory2() ) { m_khr_bind_memory2_extension_entrypoints.vkBindBufferMemory2KHR = reinterpret_cast(get_proc_address("vkBindBufferMemory2KHR")); @@ -857,9 +896,9 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, switch (queue_family_type) { - case Anvil::QueueFamilyType::COMPUTE: out_queues_ptr = &m_compute_queues; break; - case Anvil::QueueFamilyType::TRANSFER: out_queues_ptr = &m_transfer_queues; break; - case Anvil::QueueFamilyType::UNIVERSAL: out_queues_ptr = &m_universal_queues; break; + case Anvil::QueueFamilyType::COMPUTE: out_queues_ptr = &m_compute_queues; break; + case Anvil::QueueFamilyType::TRANSFER: out_queues_ptr = &m_transfer_queues; break; + case Anvil::QueueFamilyType::UNIVERSAL: out_queues_ptr = &m_universal_queues; break; default: { @@ -871,44 +910,50 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, { auto queue_ptr_storage_ptr = &m_queue_ptrs_per_vk_queue_fam[current_queue_fam.family_index]; - anvil_assert(m_queue_family_index_to_type.find(current_queue_fam.family_index) == m_queue_family_index_to_type.end() ); anvil_assert(std::find(m_queue_family_type_to_queue_family_indices[queue_family_type].begin(), m_queue_family_type_to_queue_family_indices[queue_family_type].end(), current_queue_fam.family_index) == m_queue_family_type_to_queue_family_indices[queue_family_type].end() ); - m_queue_family_index_to_type [current_queue_fam.family_index] = queue_family_type; - m_queue_family_type_to_queue_family_indices[queue_family_type].push_back(current_queue_fam.family_index); + m_queue_family_index_to_types [current_queue_fam.family_index].push_back(queue_family_type); + m_queue_family_type_to_queue_family_indices[queue_family_type].push_back (current_queue_fam.family_index); for (uint32_t n_queue = 0; n_queue < current_queue_fam.n_queues; ++n_queue) { - std::unique_ptr new_queue_ptr = Anvil::Queue::create(this, - current_queue_fam.family_index, - n_queue, - is_mt_safe() ); + bool queue_already_instantiated = false; - anvil_assert(out_queues_ptr != nullptr); + if (!queue_already_instantiated) + { + std::unique_ptr new_queue_ptr = Anvil::Queue::create(this, + current_queue_fam.family_index, + n_queue, + is_mt_safe() ); - out_queues_ptr->push_back(new_queue_ptr.get() ); + { + anvil_assert(out_queues_ptr != nullptr); - /* If this queue supports sparse binding ops, cache it in a separate vector as well */ - if (new_queue_ptr->supports_sparse_bindings() ) - { - m_sparse_binding_queues.push_back(new_queue_ptr.get() ); - } + out_queues_ptr->push_back(new_queue_ptr.get() ); + } - /* Cache the queue in general-purpose storage as well */ - if (std::find(queue_ptr_storage_ptr->cbegin(), - queue_ptr_storage_ptr->cend (), - new_queue_ptr.get() ) == queue_ptr_storage_ptr->cend() ) - { - queue_ptr_storage_ptr->push_back(new_queue_ptr.get() ); - } + /* If this queue supports sparse binding ops, cache it in a separate vector as well */ + if (new_queue_ptr->supports_sparse_bindings() ) + { + m_sparse_binding_queues.push_back(new_queue_ptr.get() ); + } + + /* Cache the queue in general-purpose storage as well */ + if (std::find(queue_ptr_storage_ptr->cbegin(), + queue_ptr_storage_ptr->cend (), + new_queue_ptr.get() ) == queue_ptr_storage_ptr->cend() ) + { + queue_ptr_storage_ptr->push_back(new_queue_ptr.get() ); + } - m_owned_queues.push_back( - std::move(new_queue_ptr) - ); + m_owned_queues.push_back( + std::move(new_queue_ptr) + ); + } } } } @@ -997,22 +1042,22 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, /** Please see header for specification */ bool Anvil::BaseDevice::is_compute_queue_family_index(const uint32_t& in_queue_family_index) const { - return (m_queue_family_index_to_type.find(in_queue_family_index) != m_queue_family_index_to_type.end()) && - (m_queue_family_index_to_type.at (in_queue_family_index) == Anvil::QueueFamilyType::COMPUTE); + return (m_queue_family_index_to_types.find(in_queue_family_index) != m_queue_family_index_to_types.end()) && + (m_queue_family_index_to_types.at (in_queue_family_index).at(0) == Anvil::QueueFamilyType::COMPUTE); } /** Please see header for specification */ bool Anvil::BaseDevice::is_transfer_queue_family_index(const uint32_t& in_queue_family_index) const { - return (m_queue_family_index_to_type.find(in_queue_family_index) != m_queue_family_index_to_type.end()) && - (m_queue_family_index_to_type.at (in_queue_family_index) == Anvil::QueueFamilyType::TRANSFER); + return (m_queue_family_index_to_types.find(in_queue_family_index) != m_queue_family_index_to_types.end()) && + (m_queue_family_index_to_types.at (in_queue_family_index).at(0) == Anvil::QueueFamilyType::TRANSFER); } /** Please see header for specification */ bool Anvil::BaseDevice::is_universal_queue_family_index(const uint32_t& in_queue_family_index) const { - return (m_queue_family_index_to_type.find(in_queue_family_index) != m_queue_family_index_to_type.end() ) && - (m_queue_family_index_to_type.at (in_queue_family_index) == Anvil::QueueFamilyType::UNIVERSAL); + return (m_queue_family_index_to_types.find(in_queue_family_index) != m_queue_family_index_to_types.end() ) && + (m_queue_family_index_to_types.at (in_queue_family_index).at(0) == Anvil::QueueFamilyType::UNIVERSAL); } /* Please see header for specification */ @@ -1049,6 +1094,688 @@ bool Anvil::BaseDevice::wait_idle() const return is_vk_call_successful(result_vk); } + +/* Please see header for specification */ +Anvil::MGPUDevice::MGPUDevice(std::vector in_physical_device_ptrs, + bool in_mt_safe) + :BaseDevice (in_physical_device_ptrs[0]->get_instance(), + in_mt_safe), + m_supported_present_modes(static_cast(0) ) +{ + const uint32_t n_physical_device_ptrs = static_cast(in_physical_device_ptrs.size() ); + + ANVIL_REDUNDANT_VARIABLE_CONST(n_physical_device_ptrs); + + /* MGPUDevice instance should not be used for cases where SGPUDevice would do */ + anvil_assert(n_physical_device_ptrs > 1); + + /* Sanity checks */ + #ifdef _DEBUG + { + for (uint32_t n_physical_device = 0; + n_physical_device < n_physical_device_ptrs - 1; + ++n_physical_device) + { + auto next_device_ptr(in_physical_device_ptrs[n_physical_device + 1]); + auto this_device_ptr(in_physical_device_ptrs[n_physical_device]); + + /* Physical devices must come from the same Vulkan instance */ + anvil_assert(this_device_ptr->get_instance() == next_device_ptr->get_instance() ); + + /* Physical devices must not repeat */ + anvil_assert(this_device_ptr != next_device_ptr); + + /* All physical devices must come from the same device group */ + anvil_assert(this_device_ptr->get_device_group_index() == next_device_ptr->get_device_group_index() ); + + /* ..but must be ed unique device indices */ + anvil_assert(this_device_ptr->get_device_group_device_index() != next_device_ptr->get_device_group_device_index() ); + + /* Extension spec is a bit vague about this restriction, but our implementation assumes that all physical devices + * in a device group offer exactly the same set of queues and queue families. Their ordering also must match. + */ + anvil_assert(this_device_ptr->get_queue_families() == next_device_ptr->get_queue_families() ); + } + } + #endif + + for (auto physical_device_ptr : in_physical_device_ptrs) + { + ParentPhysicalDeviceProperties device_props; + + device_props.physical_device_ptr = physical_device_ptr; + + m_parent_physical_devices.push_back (device_props); + m_parent_physical_devices_vec.push_back(physical_device_ptr); + } + + for (uint32_t n_physical_device = 0; + n_physical_device < static_cast(m_parent_physical_devices.size() ); + ++n_physical_device) + { + const auto& physical_device_info = m_parent_physical_devices.at(n_physical_device); + + anvil_assert(m_device_index_to_physical_device_props.find(n_physical_device) == m_device_index_to_physical_device_props.end() ); + m_device_index_to_physical_device_props[n_physical_device] = &physical_device_info; + } +} + +/* Please see header for specification */ +Anvil::MGPUDevice::~MGPUDevice() +{ + /* Stub */ +} + +/* Please see header for specification */ +Anvil::BaseDeviceUniquePtr Anvil::MGPUDevice::create(std::vector in_physical_device_ptrs, + bool in_enable_shader_module_cache, + const DeviceExtensionConfiguration& in_extensions, + const std::vector& in_layers, + bool in_transient_command_buffer_allocs_only, + bool in_support_resettable_command_buffer_allocs, + bool in_mt_safe) +{ + Anvil::BaseDeviceUniquePtr result_ptr; + + /* Make sure the caller has requested the VK_KHR_device_group and VK_KHR_bind_memory2 extensions */ + #ifdef _DEBUG + { + anvil_assert(in_extensions.extension_status.at(VK_KHR_DEVICE_GROUP_EXTENSION_NAME) == ExtensionAvailability::EXTENSION_AVAILABILITY_REQUIRE); + anvil_assert(in_extensions.extension_status.at(VK_KHR_BIND_MEMORY_2_EXTENSION_NAME) == ExtensionAvailability::EXTENSION_AVAILABILITY_REQUIRE); + } + #endif + + result_ptr = Anvil::BaseDeviceUniquePtr( + new Anvil::MGPUDevice(in_physical_device_ptrs, + in_mt_safe), + std::default_delete() + ); + + dynamic_cast(result_ptr.get() )->init(in_extensions, + in_layers, + in_transient_command_buffer_allocs_only, + in_support_resettable_command_buffer_allocs, + in_enable_shader_module_cache); + + return result_ptr; +} + +/** TODO */ +void Anvil::MGPUDevice::create_device(const std::vector& in_extensions, + const std::vector& in_layers, + const VkPhysicalDeviceFeatures& in_features, + DeviceQueueFamilyInfo* out_queue_families_ptr) +{ + std::vector device_queue_create_info_items; + std::vector device_queue_priorities; + auto features_chain_ptr (get_physical_device_features_chain (&in_features) ); + auto features_chain_root_struct_ptr (features_chain_ptr->get_root_struct() ); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + Anvil::StructChainer struct_chainer; + const Anvil::PhysicalDevice* zeroth_physical_device_ptr (m_parent_physical_devices.at(0).physical_device_ptr); + const auto& zeroth_physical_device_queue_fams(zeroth_physical_device_ptr->get_queue_families() ); + + ANVIL_REDUNDANT_VARIABLE(result); + + /* Set up queue create info structure instances. + * + * Use up all available queues. + */ + for (uint32_t n_queue_fam = 0; + n_queue_fam < static_cast(zeroth_physical_device_queue_fams.size() ); + ++n_queue_fam) + { + const auto& current_queue_fam(zeroth_physical_device_queue_fams.at(n_queue_fam) ); + + if (current_queue_fam.n_queues > 0) + { + device_queue_priorities.resize(std::max(static_cast(device_queue_priorities.size() ), + current_queue_fam.n_queues), + 1.0f); + } + } + + for (uint32_t n_queue_fam = 0; + n_queue_fam < static_cast(zeroth_physical_device_queue_fams.size() ); + ++n_queue_fam) + { + const auto& current_queue_fam(zeroth_physical_device_queue_fams.at(n_queue_fam) ); + + if (current_queue_fam.n_queues > 0) + { + VkDeviceQueueCreateInfo queue_create_info; + + queue_create_info.flags = 0; + queue_create_info.pNext = nullptr; + queue_create_info.pQueuePriorities = &device_queue_priorities[0]; + queue_create_info.queueCount = current_queue_fam.n_queues; + queue_create_info.queueFamilyIndex = n_queue_fam; + queue_create_info.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO; + + device_queue_create_info_items.push_back(queue_create_info); + } + } + + { + VkDeviceCreateInfo create_info; + + create_info.enabledExtensionCount = static_cast(in_extensions.size() ); + create_info.enabledLayerCount = static_cast(in_layers.size() ); + create_info.flags = 0; + create_info.pEnabledFeatures = nullptr; /* chained */ + create_info.pNext = nullptr; + create_info.ppEnabledExtensionNames = (in_extensions.size() > 0) ? &in_extensions[0] : nullptr; + create_info.ppEnabledLayerNames = (in_layers.size() > 0) ? &in_layers [0] : nullptr; + create_info.pQueueCreateInfos = &device_queue_create_info_items[0]; + create_info.queueCreateInfoCount = static_cast(device_queue_create_info_items.size() ); + create_info.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO; + + struct_chainer.append_struct(create_info); + } + + /* Set up the device create info descriptor. Enable all features available. */ + std::vector physical_devices(m_parent_physical_devices.size() ); + + for (uint32_t n_physical_device = 0; + n_physical_device < static_cast(physical_devices.size() ); + ++n_physical_device) + { + physical_devices.at(n_physical_device) = m_parent_physical_devices.at(n_physical_device).physical_device_ptr->get_physical_device(); + } + + { + VkDeviceGroupDeviceCreateInfoKHR device_group_device_create_info; + + device_group_device_create_info.physicalDeviceCount = static_cast(m_parent_physical_devices.size() ); + device_group_device_create_info.pPhysicalDevices = &physical_devices[0]; + device_group_device_create_info.pNext = nullptr; + device_group_device_create_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHR; + + struct_chainer.append_struct(device_group_device_create_info); + } + + /* Finally manually append the features chain to our chain + * + * NOTE: This is a dirty hack! Do NOT append any structs after this point, or else the struct we just chained here gets lost. + */ + struct_chainer.get_last_struct()->pNext = reinterpret_cast((zeroth_physical_device_ptr->get_instance()->get_enabled_extensions_info()->khr_get_physical_device_properties2() ) ? features_chain_root_struct_ptr + : features_chain_root_struct_ptr->pNext); + + { + auto struct_chain_ptr = struct_chainer.create_chain(); + + result = vkCreateDevice(m_parent_physical_devices.at(0).physical_device_ptr->get_physical_device(), + struct_chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_device); + anvil_assert_vk_call_succeeded(result); + } + + /* Now that all queues are available, assign them to queue families Anvil recognizes. */ + get_queue_family_indices(out_queue_families_ptr); +} + +/** Please see header for specification */ +Anvil::SwapchainUniquePtr Anvil::MGPUDevice::create_swapchain(Anvil::RenderingSurface* in_parent_surface_ptr, + Anvil::Window* in_window_ptr, + Anvil::Format in_image_format, + VkPresentModeKHR in_present_mode, + Anvil::ImageUsageFlags in_usage, + uint32_t in_n_swapchain_images, + bool in_support_SFR, + VkDeviceGroupPresentModeFlagsKHR in_presentation_modes_to_support) +{ + SwapchainUniquePtr result_ptr(nullptr, + std::default_delete() ); + + { + auto swapchain_create_info_ptr = Anvil::SwapchainCreateInfo::create(this, + in_parent_surface_ptr, + in_window_ptr, + in_image_format, + in_present_mode, + in_usage, + in_n_swapchain_images); + + swapchain_create_info_ptr->set_mt_safety (Anvil::MT_SAFETY_ENABLED); + swapchain_create_info_ptr->set_mgpu_present_mode_flags(in_presentation_modes_to_support); + + if (in_support_SFR) + { + swapchain_create_info_ptr->set_flags(VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR); + } + + result_ptr = Anvil::Swapchain::create(std::move(swapchain_create_info_ptr) ); + } + + anvil_assert(result_ptr != nullptr); + + return result_ptr; +} + +/** Please see header for specification */ +bool Anvil::MGPUDevice::get_peer_memory_features(const Anvil::PhysicalDevice* in_local_physical_device_ptr, + const Anvil::PhysicalDevice* in_remote_physical_device_ptr, + uint32_t in_memory_heap_index, + PeerMemoryFeatureFlags* out_result_ptr) const +{ + const uint32_t& local_physical_device_index = in_local_physical_device_ptr->get_device_group_device_index(); + decltype(m_device_index_to_physical_device_props)::const_iterator local_physical_device_props_iterator; + ParentPhysicalDeviceProperties::HeapIndexToPeerMemoryFeaturesMap::const_iterator memory_heap_iterator; + const uint32_t& remote_physical_device_index = in_remote_physical_device_ptr->get_device_group_device_index(); + decltype(ParentPhysicalDeviceProperties::peer_memory_features)::const_iterator remote_physical_device_iterator; + bool result = false; + + if (in_local_physical_device_ptr == in_remote_physical_device_ptr) + { + anvil_assert(in_local_physical_device_ptr != in_remote_physical_device_ptr); + + goto end; + } + + /* Retrieve cached peer memory features data for the local phys dev + remote phys dev + heap index tuple */ + local_physical_device_props_iterator = m_device_index_to_physical_device_props.find(local_physical_device_index); + + if (local_physical_device_props_iterator == m_device_index_to_physical_device_props.end() ) + { + /* The specified local physical device is not a part of this logical device? */ + anvil_assert(local_physical_device_props_iterator != m_device_index_to_physical_device_props.end()); + + goto end; + } + + + remote_physical_device_iterator = local_physical_device_props_iterator->second->peer_memory_features.find(remote_physical_device_index); + + if (remote_physical_device_iterator == local_physical_device_props_iterator->second->peer_memory_features.end() ) + { + /* The specified remote physical device is not a part of this logical device? */ + anvil_assert(remote_physical_device_iterator != local_physical_device_props_iterator->second->peer_memory_features.end() ); + + goto end; + } + + + memory_heap_iterator = remote_physical_device_iterator->second.find(in_memory_heap_index); + + if (memory_heap_iterator == remote_physical_device_iterator->second.end() ) + { + anvil_assert(memory_heap_iterator != remote_physical_device_iterator->second.end()); + + goto end; + } + + /* All done */ + *out_result_ptr = memory_heap_iterator->second; + result = true; +end: + return result; +} + +/** Please see header for specification */ +const Anvil::PhysicalDevice* Anvil::MGPUDevice::get_physical_device(uint32_t in_n_physical_device) const +{ + anvil_assert(m_parent_physical_devices.size() > in_n_physical_device); + + return m_parent_physical_devices.at(in_n_physical_device).physical_device_ptr; +} + +bool Anvil::MGPUDevice::get_physical_device_buffer_properties(const BufferPropertiesQuery& in_query, + Anvil::BufferProperties* out_opt_result_ptr) const +{ + /* NOTE: All physical devices within a device group are assumed to report the same format properties */ + return m_parent_physical_devices.at(0).physical_device_ptr->get_buffer_properties(in_query, + out_opt_result_ptr); +} + +/** Please see header for specification */ +const Anvil::PhysicalDeviceFeatures& Anvil::MGPUDevice::get_physical_device_features() const +{ + /* NOTE: We're assuming here all physical devices within a device group offer the same set of features. + * + * An assertion check to double-check this holds is implemented in the init function. + */ + return m_parent_physical_devices.at(0).physical_device_ptr->get_device_features(); +} + +bool Anvil::MGPUDevice::get_physical_device_fence_properties(const FencePropertiesQuery& in_query, + Anvil::FenceProperties* out_opt_result_ptr) const +{ + /* NOTE: All physical devices within a device group are assumed to report the same fence properties */ + return m_parent_physical_devices.at(0).physical_device_ptr->get_fence_properties(in_query, + out_opt_result_ptr); +} + +/** Please see header for specification */ +Anvil::FormatProperties Anvil::MGPUDevice::get_physical_device_format_properties(Anvil::Format in_format) const +{ + /* NOTE: All physical devices within a device group are assumed to report the same format properties */ + return m_parent_physical_devices.at(0).physical_device_ptr->get_format_properties(in_format); +} + + +/** Please see header for specification */ +bool Anvil::MGPUDevice::get_physical_device_image_format_properties(const ImageFormatPropertiesQuery& in_query, + Anvil::ImageFormatProperties* out_opt_result_ptr) const +{ + /* NOTE: All physical devices within a device group are assumed to report the same image format properties */ + return m_parent_physical_devices.at(0).physical_device_ptr->get_image_format_properties(in_query, + out_opt_result_ptr); +} + +/** Please see header for specification */ +const Anvil::MemoryProperties& Anvil::MGPUDevice::get_physical_device_memory_properties() const +{ + /* NOTE: We're assuming here all physical devices within a device group have the same memory caps. + * + * An assertion check to double-check this holds is implemented in the init function. + */ + return m_parent_physical_devices.at(0).physical_device_ptr->get_memory_properties(); +} + +/* Please see header for specification */ +const Anvil::PhysicalDeviceProperties& Anvil::MGPUDevice::get_physical_device_properties() const +{ + /* NOTE: We're assuming here all physical devices within a device group have the same properties. + * + * An assertion check to double-check this holds is implemented in the init function. + */ + return m_parent_physical_devices.at(0).physical_device_ptr->get_device_properties(); +} + +/* Please see header for specification */ +const Anvil::QueueFamilyInfoItems& Anvil::MGPUDevice::get_physical_device_queue_families() const +{ + /* NOTE: We're assuming here all physical devices within a device group offer the same set of queue families. + * + * An assertion check to double-check this holds is implemented in the init function. + */ + return m_parent_physical_devices.at(0).physical_device_ptr->get_queue_families(); +} + +bool Anvil::MGPUDevice::get_physical_device_semaphore_properties(const SemaphorePropertiesQuery& in_query, + Anvil::SemaphoreProperties* out_opt_result_ptr) const +{ + /* NOTE: All physical devices within a device group are assumed to report the same semaphore properties */ + return m_parent_physical_devices.at(0).physical_device_ptr->get_semaphore_properties(in_query, + out_opt_result_ptr); +} + +/** Please see header for specification */ +bool Anvil::MGPUDevice::get_physical_device_sparse_image_format_properties(Anvil::Format in_format, + Anvil::ImageType in_type, + Anvil::SampleCountFlagBits in_sample_count, + Anvil::ImageUsageFlags in_usage, + Anvil::ImageTiling in_tiling, + std::vector& out_result) const +{ + /* NOTE: All physical devices within a device group are assumed to report the same sparse image format properties */ + uint32_t n_props = 0; + + vkGetPhysicalDeviceSparseImageFormatProperties(m_parent_physical_devices.at(0).physical_device_ptr->get_physical_device(), + static_cast (in_format), + static_cast (in_type), + static_cast(in_sample_count), + in_usage, + static_cast(in_tiling), + &n_props, + nullptr); /* pProperties */ + + if (n_props > 0) + { + out_result.resize(n_props); + + vkGetPhysicalDeviceSparseImageFormatProperties(m_parent_physical_devices.at(0).physical_device_ptr->get_physical_device(), + static_cast (in_format), + static_cast (in_type), + static_cast(in_sample_count), + in_usage, + static_cast(in_tiling), + &n_props, + &out_result[0]); + } + + return true; +} + +/* Please see header for specification */ +bool Anvil::MGPUDevice::get_physical_device_surface_capabilities(Anvil::RenderingSurface* in_surface_ptr, + VkSurfaceCapabilitiesKHR* out_result_ptr) const +{ + /* NOTE: All physical devices within a device group are assumed to report the same sparse image format properties */ + return (vkGetPhysicalDeviceSurfaceCapabilitiesKHR(m_parent_physical_devices.at(0).physical_device_ptr->get_physical_device(), + in_surface_ptr->get_surface(), + out_result_ptr) == VK_SUCCESS); +} + +/* Please see header for specification */ +bool Anvil::MGPUDevice::get_present_compatible_physical_devices(uint32_t in_device_index, + const std::vector** out_result_ptr) const +{ + bool result = false; + + if (m_parent_physical_devices.size() > in_device_index) + { + result = true; + + *out_result_ptr = &m_parent_physical_devices.at(in_device_index).presentation_compatible_physical_devices; + } + else + { + anvil_assert(m_parent_physical_devices.size() > in_device_index); + } + + return result; +} + +/* Please see header for specification */ +bool Anvil::MGPUDevice::get_present_rectangles(uint32_t in_device_index, + const Anvil::RenderingSurface* in_rendering_surface_ptr, + std::vector* out_result_ptr) const +{ + uint32_t n_rectangles = 0; + const Anvil::PhysicalDevice* physical_device_ptr = nullptr; + bool result = false; + VkResult result_vk; + + if (m_parent_physical_devices.size() <= in_device_index) + { + anvil_assert(!(m_parent_physical_devices.size() <= in_device_index) ); + + goto end; + } + else + { + physical_device_ptr = m_parent_physical_devices.at(in_device_index).physical_device_ptr; + } + + in_rendering_surface_ptr->lock(); + { + result_vk = m_khr_device_group_extension_entrypoints.vkGetPhysicalDevicePresentRectanglesKHR(physical_device_ptr->get_physical_device(), + in_rendering_surface_ptr->get_surface(), + &n_rectangles, + nullptr); /* pRects */ + + if (is_vk_call_successful(result_vk) ) + { + out_result_ptr->resize(n_rectangles); + + result_vk = m_khr_device_group_extension_entrypoints.vkGetPhysicalDevicePresentRectanglesKHR(physical_device_ptr->get_physical_device(), + in_rendering_surface_ptr->get_surface(), + &n_rectangles, + &((*out_result_ptr)[0])); /* pRects */ + } + } + in_rendering_surface_ptr->unlock(); + + if (!is_vk_call_successful(result_vk) ) + { + anvil_assert(is_vk_call_successful(result_vk)); + + goto end; + } + + /* All done */ + result = true; +end: + return result; +} + +/* Please see header for specification */ +void Anvil::MGPUDevice::get_queue_family_indices(DeviceQueueFamilyInfo* out_device_queue_family_info_ptr) const +{ + /* Assuming all physical devices within a device group offer the same set of queue families and queues, + * and that the ordering of queue families matches across all those physical devices, we're good to + * specify any physical device we're going to use to set up a multi-GPU VkDevice instance. + */ + get_queue_family_indices_for_physical_device(m_parent_physical_devices.at(0).physical_device_ptr, + out_device_queue_family_info_ptr); +} + +/** Please see header for specification */ +const Anvil::QueueFamilyInfo* Anvil::MGPUDevice::get_queue_family_info(uint32_t in_queue_family_index) const +{ + /* NOTE: It is assumed here that all physical devices within a device group have a matching set of queue families */ + const auto physical_device_ptr(m_parent_physical_devices.at(0).physical_device_ptr); + const auto& queue_fams (physical_device_ptr->get_queue_families() ); + const Anvil::QueueFamilyInfo* result_ptr (nullptr); + + if (queue_fams.size() > in_queue_family_index) + { + result_ptr = &queue_fams.at(in_queue_family_index); + } + + return result_ptr; +} + +/** Please see header for specification */ +VkDeviceGroupPresentModeFlagsKHR Anvil::MGPUDevice::get_supported_present_modes_for_surface(const Anvil::RenderingSurface* in_surface_ptr) const +{ + VkDeviceGroupPresentModeFlagsKHR result = 0; + VkResult result_vk = VK_ERROR_INITIALIZATION_FAILED; + + ANVIL_REDUNDANT_VARIABLE(result_vk); + + result_vk = m_khr_device_group_extension_entrypoints.vkGetDeviceGroupSurfacePresentModesKHR(m_device, + in_surface_ptr->get_surface(), + &result); + anvil_assert_vk_call_succeeded(result_vk); + + return result; +} + +/** Please see header for specification */ +void Anvil::MGPUDevice::init_device() +{ + VkResult result(VK_ERROR_INITIALIZATION_FAILED); + + ANVIL_REDUNDANT_VARIABLE(result); + + /* Extract present capabilities of each physical device in the device group */ + VkDeviceGroupPresentCapabilitiesKHR present_caps; + + present_caps.pNext = nullptr; + present_caps.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR; + + result = m_khr_device_group_extension_entrypoints.vkGetDeviceGroupPresentCapabilitiesKHR(m_device, + &present_caps); + + anvil_assert_vk_call_succeeded(result); + anvil_assert ((present_caps.modes & VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR) == VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR); + + m_supported_present_modes = static_cast(present_caps.modes); + + for (uint32_t n_physical_device = 0; + n_physical_device < static_cast(m_parent_physical_devices.size() ); + ++n_physical_device) + { + auto& physical_device_props = m_parent_physical_devices.at(n_physical_device); + + anvil_assert( present_caps.presentMask[n_physical_device] == 0 || + present_caps.presentMask[n_physical_device] != 0 && (present_caps.presentMask[n_physical_device] & (1 << n_physical_device) ) != 0); + + for (uint32_t n_sub_physical_device = 0; + n_sub_physical_device < static_cast(m_parent_physical_devices.size() ); + ++n_sub_physical_device) + { + if ((present_caps.presentMask[n_physical_device] & (1 << n_sub_physical_device) ) != 0) + { + const Anvil::PhysicalDevice* sub_physical_device_ptr(m_parent_physical_devices.at(n_sub_physical_device).physical_device_ptr); + + physical_device_props.presentation_compatible_physical_devices.push_back(sub_physical_device_ptr); + } + } + } + + /* Extract & cache peer memory features information */ + for (uint32_t n_src_physical_device = 0; + n_src_physical_device < static_cast(m_parent_physical_devices.size() ); + ++n_src_physical_device) + { + auto& src_physical_device_info = m_parent_physical_devices.at(n_src_physical_device); + const auto& src_physical_device_ptr = src_physical_device_info.physical_device_ptr; + const uint32_t n_src_memory_heaps = src_physical_device_ptr->get_memory_properties().n_heaps; + + for (uint32_t n_dst_physical_device = 0; + n_dst_physical_device < static_cast(m_parent_physical_devices.size() ); + ++n_dst_physical_device) + { + const auto& dst_physical_device_ptr = m_parent_physical_devices.at(n_dst_physical_device).physical_device_ptr; + const uint32_t n_dst_memory_heaps = dst_physical_device_ptr->get_memory_properties().n_heaps; + + ANVIL_REDUNDANT_VARIABLE_CONST(n_dst_memory_heaps); + + if (n_src_physical_device == n_dst_physical_device) + { + continue; + } + + anvil_assert(n_src_memory_heaps == n_dst_memory_heaps); + + for (uint32_t n_heap = 0; + n_heap < n_src_memory_heaps; + ++n_heap) + { + const uint32_t dst_physical_device_index = dst_physical_device_ptr->get_device_group_device_index(); + VkPeerMemoryFeatureFlagsKHR memory_features = 0; + const uint32_t src_physical_device_index = src_physical_device_ptr->get_device_group_device_index(); + + m_khr_device_group_extension_entrypoints.vkGetDeviceGroupPeerMemoryFeaturesKHR(m_device, + n_heap, + src_physical_device_index, + dst_physical_device_index, + &memory_features); + + anvil_assert( (memory_features & VK_PEER_MEMORY_FEATURE_COPY_DST_BIT_KHR) != 0); /* As per spec */ + + src_physical_device_info.peer_memory_features[dst_physical_device_index][n_heap] = Utils::convert_vk_peer_memory_feature_flags_to_peer_memory_feature_flags(memory_features); + } + } + } + + /* Cache info whether this logical device supports subset allocations or not */ + const Anvil::PhysicalDevice* ref_physical_device_ptr = m_parent_physical_devices.at(0).physical_device_ptr; + const Anvil::Instance* instance_ptr = ref_physical_device_ptr->get_instance(); + const uint32_t device_group_index = ref_physical_device_ptr->get_device_group_index(); + + m_supports_subset_allocations = instance_ptr->get_physical_device_group(device_group_index).supports_subset_allocations; +} + +/** Please see header for specification */ +bool Anvil::MGPUDevice::is_layer_supported(const std::string& in_layer_name) const +{ + /* Note: All physical devices within a device group must support exactly the same layers. */ + return m_parent_physical_devices.at(0).physical_device_ptr->is_layer_supported(in_layer_name); +} + +/** Please see header for specification */ +bool Anvil::MGPUDevice::is_physical_device_extension_supported(const std::string& in_extension_name) const +{ + /* Note: All physical devices within a device group must support exactly the same device extensions. */ + return m_parent_physical_devices.at(0).physical_device_ptr->is_device_extension_supported(in_extension_name); +} + + /* Please see header for specification */ Anvil::SGPUDevice::SGPUDevice(const Anvil::PhysicalDevice* in_physical_device_ptr, bool in_mt_safe) @@ -1067,7 +1794,7 @@ Anvil::SGPUDevice::~SGPUDevice() /* Please see header for specification */ -Anvil::SGPUDeviceUniquePtr Anvil::SGPUDevice::create(const Anvil::PhysicalDevice* in_physical_device_ptr, +Anvil::BaseDeviceUniquePtr Anvil::SGPUDevice::create(const Anvil::PhysicalDevice* in_physical_device_ptr, bool in_enable_shader_module_cache, const DeviceExtensionConfiguration& in_extensions, const std::vector& in_layers, @@ -1075,19 +1802,19 @@ Anvil::SGPUDeviceUniquePtr Anvil::SGPUDevice::create(const Anvil::PhysicalDevice bool in_support_resettable_command_buffer_allocs, bool in_mt_safe) { - SGPUDeviceUniquePtr result_ptr(nullptr, - std::default_delete() ); + BaseDeviceUniquePtr result_ptr(nullptr, + std::default_delete() ); - result_ptr = std::unique_ptr( + result_ptr = std::unique_ptr( new Anvil::SGPUDevice(in_physical_device_ptr, in_mt_safe) ); - result_ptr->init(in_extensions, - in_layers, - in_transient_command_buffer_allocs_only, - in_support_resettable_command_buffer_allocs, - in_enable_shader_module_cache); + dynamic_cast(result_ptr.get() )->init(in_extensions, + in_layers, + in_transient_command_buffer_allocs_only, + in_support_resettable_command_buffer_allocs, + in_enable_shader_module_cache); return result_ptr; } @@ -1172,9 +1899,9 @@ void Anvil::SGPUDevice::create_device(const std::vector& in_extensi /** Please see header for specification */ Anvil::SwapchainUniquePtr Anvil::SGPUDevice::create_swapchain(Anvil::RenderingSurface* in_parent_surface_ptr, Anvil::Window* in_window_ptr, - VkFormat in_image_format, + Anvil::Format in_image_format, VkPresentModeKHR in_present_mode, - VkImageUsageFlags in_usage, + Anvil::ImageUsageFlags in_usage, uint32_t in_n_swapchain_images) { SwapchainUniquePtr result_ptr(nullptr, @@ -1219,7 +1946,7 @@ bool Anvil::SGPUDevice::get_physical_device_fence_properties(const FenceProperti } /** Please see header for specification */ -Anvil::FormatProperties Anvil::SGPUDevice::get_physical_device_format_properties(VkFormat in_format) const +Anvil::FormatProperties Anvil::SGPUDevice::get_physical_device_format_properties(Anvil::Format in_format) const { return m_parent_physical_device_ptr->get_format_properties(in_format); } @@ -1259,21 +1986,21 @@ bool Anvil::SGPUDevice::get_physical_device_semaphore_properties(const Semaphore } /** Please see header for specification */ -bool Anvil::SGPUDevice::get_physical_device_sparse_image_format_properties(VkFormat in_format, - VkImageType in_type, - VkSampleCountFlagBits in_sample_count, - VkImageUsageFlags in_usage, - VkImageTiling in_tiling, +bool Anvil::SGPUDevice::get_physical_device_sparse_image_format_properties(Anvil::Format in_format, + Anvil::ImageType in_type, + Anvil::SampleCountFlagBits in_sample_count, + Anvil::ImageUsageFlags in_usage, + Anvil::ImageTiling in_tiling, std::vector& out_result) const { uint32_t n_props = 0; vkGetPhysicalDeviceSparseImageFormatProperties(m_parent_physical_device_ptr->get_physical_device(), - in_format, - in_type, - in_sample_count, + static_cast (in_format), + static_cast (in_type), + static_cast(in_sample_count), in_usage, - in_tiling, + static_cast(in_tiling), &n_props, nullptr); /* pProperties */ @@ -1282,11 +2009,11 @@ bool Anvil::SGPUDevice::get_physical_device_sparse_image_format_properties(VkFor out_result.resize(n_props); vkGetPhysicalDeviceSparseImageFormatProperties(m_parent_physical_device_ptr->get_physical_device(), - in_format, - in_type, - in_sample_count, + static_cast (in_format), + static_cast (in_type), + static_cast(in_sample_count), in_usage, - in_tiling, + static_cast(in_tiling), &n_props, &out_result[0]); } diff --git a/src/wrappers/graphics_pipeline_manager.cpp b/src/wrappers/graphics_pipeline_manager.cpp index 9626a4f3..4ced7a98 100644 --- a/src/wrappers/graphics_pipeline_manager.cpp +++ b/src/wrappers/graphics_pipeline_manager.cpp @@ -119,14 +119,14 @@ bool Anvil::GraphicsPipelineManager::bake() bool result = false; std::vector result_graphics_pipelines; VkResult result_vk; - auto scissor_boxes_vk_cache = std::vector (); - auto shader_stage_create_info_items_vk_cache = std::vector (); - auto specialization_info_vk_cache = std::vector (); - auto specialization_map_entry_vk_cache = std::vector (); - auto tessellation_state_create_info_items_vk_cache = std::vector (); - auto vertex_input_binding_divisor_description_vk_cache = std::vector (); - auto vertex_input_state_create_info_chain_cache = std::vector > >(); - auto viewport_state_create_info_items_vk_cache = std::vector (); + auto scissor_boxes_vk_cache = std::vector (); + auto shader_stage_create_info_items_vk_cache = std::vector (); + auto specialization_info_vk_cache = std::vector (); + auto specialization_map_entry_vk_cache = std::vector (); + auto tessellation_state_create_info_chain_cache = std::vector > >(); + auto vertex_input_binding_divisor_description_vk_cache = std::vector (); + auto vertex_input_state_create_info_chain_cache = std::vector > > (); + auto viewport_state_create_info_items_vk_cache = std::vector (); std::vector viewports_vk_cache; @@ -156,7 +156,7 @@ bool Anvil::GraphicsPipelineManager::bake() shader_stage_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); specialization_info_vk_cache.reserve (N_CACHE_ITEMS); specialization_map_entry_vk_cache.reserve (N_CACHE_ITEMS); - tessellation_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); + tessellation_state_create_info_chain_cache.reserve (N_CACHE_ITEMS); vertex_input_binding_divisor_description_vk_cache.reserve(N_CACHE_ITEMS); viewport_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); viewports_vk_cache.reserve (N_CACHE_ITEMS); @@ -272,7 +272,7 @@ bool Anvil::GraphicsPipelineManager::bake() color_blend_attachment_states_vk_cache.push_back(VkPipelineColorBlendAttachmentState() ); VkPipelineColorBlendAttachmentState* blend_attachment_state_ptr = &color_blend_attachment_states_vk_cache.back(); - VkImageLayout dummy = VK_IMAGE_LAYOUT_MAX_ENUM; + Anvil::ImageLayout dummy = Anvil::ImageLayout::UNKNOWN; bool is_blending_enabled_for_attachment = false; Anvil::RenderPassAttachmentID rp_attachment_id = UINT32_MAX; @@ -491,7 +491,7 @@ bool Anvil::GraphicsPipelineManager::bake() { const bool is_sample_mask_enabled = current_pipeline_create_info_ptr->is_sample_mask_enabled(); VkPipelineMultisampleStateCreateInfo multisample_state_create_info; - VkSampleCountFlags sample_count = VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM; + Anvil::SampleCountFlagBits sample_count = static_cast(0); VkSampleMask sample_mask; current_pipeline_create_info_ptr->get_multisampling_properties(&sample_count, @@ -674,16 +674,38 @@ bool Anvil::GraphicsPipelineManager::bake() if (tc_shader_stage_entry_point_ptr != nullptr && te_shader_stage_entry_point_ptr != nullptr) { - VkPipelineTessellationStateCreateInfo tessellation_state_create_info; + Anvil::StructChainer tessellation_state_create_info_chainer; - tessellation_state_create_info.flags = 0; - tessellation_state_create_info.patchControlPoints = current_pipeline_create_info_ptr->get_n_patch_control_points(); - tessellation_state_create_info.pNext = nullptr; - tessellation_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO; + { + VkPipelineTessellationStateCreateInfo tessellation_state_create_info; + + tessellation_state_create_info.flags = 0; + tessellation_state_create_info.patchControlPoints = current_pipeline_create_info_ptr->get_n_patch_control_points(); + tessellation_state_create_info.pNext = nullptr; + tessellation_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO; + + tessellation_state_create_info_chainer.append_struct(tessellation_state_create_info); + } + + if (m_device_ptr->is_extension_enabled(VK_KHR_MAINTENANCE2_EXTENSION_NAME) ) + { + VkPipelineTessellationDomainOriginStateCreateInfoKHR domain_origin_state_create_info; + + domain_origin_state_create_info.domainOrigin = static_cast(current_pipeline_create_info_ptr->get_tessellation_domain_origin() ); + domain_origin_state_create_info.pNext = nullptr; + domain_origin_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO_KHR; + + tessellation_state_create_info_chainer.append_struct(domain_origin_state_create_info); + } + else + { + /* App wants to adjust the default tessellation domain origin value, even though KHR_maintenance2 is unsupported! */ + anvil_assert(current_pipeline_create_info_ptr->get_tessellation_domain_origin() == Anvil::TessellationDomainOrigin::UPPER_LEFT); + } tessellation_state_used = true; - tessellation_state_create_info_items_vk_cache.push_back(tessellation_state_create_info); + tessellation_state_create_info_chain_cache.push_back(tessellation_state_create_info_chainer.create_chain() ); } else { @@ -965,7 +987,7 @@ bool Anvil::GraphicsPipelineManager::bake() graphics_pipeline_create_info.pRasterizationState = raster_state_create_info_chains_vk_cache.at(raster_state_create_info_chains_vk_cache.size() - 1)->root_struct_ptr; graphics_pipeline_create_info.pStages = (shader_stage_start_offset < shader_stage_create_info_items_vk_cache.size() ) ? &shader_stage_create_info_items_vk_cache[shader_stage_start_offset] : nullptr; - graphics_pipeline_create_info.pTessellationState = (tessellation_state_used) ? &tessellation_state_create_info_items_vk_cache[tessellation_state_create_info_items_vk_cache.size() - 1] + graphics_pipeline_create_info.pTessellationState = (tessellation_state_used) ? tessellation_state_create_info_chain_cache.at(tessellation_state_create_info_chain_cache.size() - 1)->root_struct_ptr : VK_NULL_HANDLE; graphics_pipeline_create_info.pVertexInputState = vertex_input_state_create_info_chain_cache.at(vertex_input_state_create_info_chain_cache.size() - 1)->get_root_struct(); graphics_pipeline_create_info.pViewportState = (viewport_state_used) ? &viewport_state_create_info_items_vk_cache[viewport_state_create_info_items_vk_cache.size() - 1] @@ -1013,7 +1035,7 @@ bool Anvil::GraphicsPipelineManager::bake() anvil_assert(shader_stage_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(specialization_info_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(specialization_map_entry_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(tessellation_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); + anvil_assert(tessellation_state_create_info_chain_cache.size() <= N_CACHE_ITEMS); anvil_assert(viewport_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(viewports_vk_cache.size() <= N_CACHE_ITEMS); } @@ -1123,7 +1145,7 @@ void Anvil::GraphicsPipelineManager::GraphicsPipelineData::bake_vk_attributes_an uint32_t current_attribute_divisor = 1; uint32_t current_attribute_explicit_vertex_binding_index = UINT32_MAX; uint32_t current_attribute_location = UINT32_MAX; - VkFormat current_attribute_format = VK_FORMAT_MAX_ENUM; + Anvil::Format current_attribute_format = Anvil::Format::UNKNOWN; uint32_t current_attribute_offset = UINT32_MAX; VkVertexInputRate current_attribute_rate = VK_VERTEX_INPUT_RATE_MAX_ENUM; uint32_t current_attribute_stride = UINT32_MAX; @@ -1190,7 +1212,7 @@ void Anvil::GraphicsPipelineManager::GraphicsPipelineData::bake_vk_attributes_an /* Good to convert the internal attribute descriptor to the Vulkan's input attribute descriptor */ current_attribute_vk.binding = n_attribute_binding; - current_attribute_vk.format = current_attribute_format; + current_attribute_vk.format = static_cast(current_attribute_format); current_attribute_vk.location = current_attribute_location; current_attribute_vk.offset = current_attribute_offset; diff --git a/src/wrappers/image.cpp b/src/wrappers/image.cpp index aefbdbbb..49a30394 100644 --- a/src/wrappers/image.cpp +++ b/src/wrappers/image.cpp @@ -76,9 +76,9 @@ Anvil::Image::Image(Anvil::ImageCreateInfoUniquePtr in_create_info_ptr) /** Please see header for specification */ void Anvil::Image::change_image_layout(Anvil::Queue* in_queue_ptr, VkAccessFlags in_src_access_mask, - VkImageLayout in_src_layout, + Anvil::ImageLayout in_src_layout, VkAccessFlags in_dst_access_mask, - VkImageLayout in_dst_layout, + Anvil::ImageLayout in_dst_layout, const VkImageSubresourceRange& in_subresource_range, const uint32_t in_opt_n_wait_semaphores, const VkPipelineStageFlags* in_opt_wait_dst_stage_mask_ptrs, @@ -102,7 +102,7 @@ void Anvil::Image::change_image_layout(Anvil::Queue* in_queue_p false); /* simultaneous_use_allowed */ { const auto sharing_mode (m_create_info_ptr->get_sharing_mode() ); - const auto queue_fam_index((sharing_mode == VK_SHARING_MODE_CONCURRENT) ? VK_QUEUE_FAMILY_IGNORED : in_queue_family_index); + const auto queue_fam_index((sharing_mode == Anvil::SharingMode::CONCURRENT) ? VK_QUEUE_FAMILY_IGNORED : in_queue_family_index); Anvil::ImageBarrier image_barrier (in_src_access_mask, in_dst_access_mask, @@ -141,6 +141,23 @@ void Anvil::Image::change_image_layout(Anvil::Queue* in_queue_p true /* should_block */) ); } + else + { + Anvil::CommandBufferMGPUSubmission cmd_buffer_submission; + const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr) ); + + cmd_buffer_submission.cmd_buffer_ptr = transition_command_buffer_ptr.get (); + cmd_buffer_submission.device_mask = (1 << mgpu_device_ptr->get_n_physical_devices()) - 1; + + /* TODO */ + anvil_assert(in_opt_n_set_semaphores == 0); + anvil_assert(in_opt_n_wait_semaphores == 0); + + in_queue_ptr->submit( + Anvil::SubmitInfo::create_execute(&cmd_buffer_submission, + true /* should_block */) + ); + } } /** Please see header for specification */ @@ -151,13 +168,14 @@ Anvil::ImageUniquePtr Anvil::Image::create(Anvil::ImageCreateInfoUniquePtr in_cr if (result_ptr != nullptr) { - const auto image_type = result_ptr->m_create_info_ptr->get_type(); + const auto image_type = result_ptr->m_create_info_ptr->get_internal_type(); switch (image_type) { - case Anvil::ImageType::NONSPARSE_ALLOC: - case Anvil::ImageType::NONSPARSE_NO_ALLOC: - case Anvil::ImageType::SPARSE_NO_ALLOC: + case Anvil::ImageInternalType::NONSPARSE_ALLOC: + case Anvil::ImageInternalType::NONSPARSE_NO_ALLOC: + case Anvil::ImageInternalType::NONSPARSE_PEER_NO_ALLOC: + case Anvil::ImageInternalType::SPARSE_NO_ALLOC: { if (!result_ptr->init() ) { @@ -167,7 +185,7 @@ Anvil::ImageUniquePtr Anvil::Image::create(Anvil::ImageCreateInfoUniquePtr in_cr break; } - case Anvil::ImageType::SWAPCHAIN_WRAPPER: + case Anvil::ImageInternalType::SWAPCHAIN_WRAPPER: { result_ptr->m_image = result_ptr->m_create_info_ptr->get_swapchain_image(); result_ptr->m_memory_types = 0; @@ -178,6 +196,11 @@ Anvil::ImageUniquePtr Anvil::Image::create(Anvil::ImageCreateInfoUniquePtr in_cr result_ptr->init_mipmap_props(); + if (result_ptr->m_create_info_ptr->get_swapchain()->get_create_info_ptr()->get_flags() & VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR) + { + result_ptr->init_sfr_tile_size(); + } + break; } @@ -188,21 +211,174 @@ Anvil::ImageUniquePtr Anvil::Image::create(Anvil::ImageCreateInfoUniquePtr in_cr result_ptr.reset(); } } + + if (image_type == Anvil::ImageInternalType::NONSPARSE_PEER_NO_ALLOC) + { + const auto& physical_devices = result_ptr->m_create_info_ptr->get_physical_devices(); + const auto n_physical_devices = static_cast(physical_devices.size() ); + std::vector physical_device_indices; + const auto& sfr_rects = result_ptr->m_create_info_ptr->get_sfr_rects(); + const auto n_sfr_rects = static_cast(sfr_rects.size() ); + + for (uint32_t n_physical_device = 0; + n_physical_device < n_physical_devices; + ++n_physical_device) + { + physical_device_indices.push_back(physical_devices[n_physical_device]->get_device_group_device_index() ); + } + + result_ptr->set_memory_internal(result_ptr->m_create_info_ptr->get_swapchain_image_index(), + n_sfr_rects, + (n_sfr_rects > 0) ? &sfr_rects.at(0) : nullptr, + static_cast(physical_devices.size() ), + (physical_devices.size() > 0) ? &physical_device_indices.at(0) : nullptr); + } } return result_ptr; } +/** TODO */ +bool Anvil::Image::do_sanity_checks_for_physical_device_binding(const Anvil::MemoryBlock* in_memory_block_ptr, + uint32_t in_n_physical_devices) const +{ + const Anvil::DeviceType device_type (m_device_ptr->get_type() ); + const uint32_t memory_block_type_index(in_memory_block_ptr->get_create_info_ptr()->get_memory_type_index() ); + const Anvil::MGPUDevice* mgpu_device_ptr (dynamic_cast(m_device_ptr) ); + bool result (false); + + if (!m_device_ptr->is_extension_enabled(VK_KHR_DEVICE_GROUP_EXTENSION_NAME) ) + { + anvil_assert(m_device_ptr->is_extension_enabled(VK_KHR_DEVICE_GROUP_EXTENSION_NAME) ); + + goto end; + } + + if (device_type != Anvil::DEVICE_TYPE_MULTI_GPU) + { + anvil_assert(device_type == Anvil::DEVICE_TYPE_MULTI_GPU); + + goto end; + } + + if (in_n_physical_devices != mgpu_device_ptr->get_n_physical_devices() ) + { + anvil_assert(in_n_physical_devices == mgpu_device_ptr->get_n_physical_devices()); + + goto end; + } + + if (!(m_device_ptr->get_physical_device_memory_properties().types[memory_block_type_index].flags & VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR)) + { + anvil_assert(m_device_ptr->get_physical_device_memory_properties().types[memory_block_type_index].flags & VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR); + + goto end; + } + + result = true; + +end: + return result; +} + +/** TODO */ +bool Anvil::Image::do_sanity_checks_for_sfr_binding(uint32_t in_n_SFR_rects, + const VkRect2D* in_SFRs_ptr) const +{ + const Anvil::DeviceType device_type (m_device_ptr->get_type() ); + bool result (false); + const VkSparseImageFormatProperties* sparse_image_format_props_ptr(nullptr); + std::vector sparse_image_format_props_vec; + + anvil_assert(m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SPARSE_NO_ALLOC); + anvil_assert(m_mipmaps.size () > 0); + anvil_assert(m_memory_blocks_owned.size () == 0); + + if (!m_device_ptr->is_extension_enabled(VK_KHR_DEVICE_GROUP_EXTENSION_NAME) ) + { + anvil_assert(m_device_ptr->is_extension_enabled(VK_KHR_DEVICE_GROUP_EXTENSION_NAME) ); + + goto end; + } + + if (device_type != Anvil::DEVICE_TYPE_MULTI_GPU) + { + anvil_assert(device_type == Anvil::DEVICE_TYPE_MULTI_GPU); + + goto end; + } + + if (!m_device_ptr->get_physical_device_sparse_image_format_properties(m_create_info_ptr->get_format (), + m_create_info_ptr->get_type (), + m_create_info_ptr->get_sample_count(), + m_create_info_ptr->get_usage_flags (), + m_create_info_ptr->get_tiling (), + sparse_image_format_props_vec) ) + { + anvil_assert_fail(); + + goto end; + } + + if (sparse_image_format_props_vec.size() != 1) + { + anvil_assert(sparse_image_format_props_vec.size() == 1); + + goto end; + } + + if (!m_device_ptr->get_physical_device_sparse_image_format_properties(m_create_info_ptr->get_format (), + m_create_info_ptr->get_type (), + m_create_info_ptr->get_sample_count(), + m_create_info_ptr->get_usage_flags (), + m_create_info_ptr->get_tiling (), + sparse_image_format_props_vec) ) + { + anvil_assert_fail(); + + goto end; + } + + sparse_image_format_props_ptr = &sparse_image_format_props_vec.at(0); + + for (uint32_t n_rect = 0; + n_rect < in_n_SFR_rects; + ++n_rect) + { + const auto& current_rect = in_SFRs_ptr[n_rect]; + + if ((current_rect.offset.x % sparse_image_format_props_ptr->imageGranularity.width) != 0 || + (current_rect.offset.y % sparse_image_format_props_ptr->imageGranularity.height) != 0) + { + anvil_assert_fail(); + + goto end; + } + + if (((current_rect.offset.x + current_rect.extent.width) % sparse_image_format_props_ptr->imageGranularity.width) != 0 && + ((current_rect.offset.x + current_rect.extent.height) % sparse_image_format_props_ptr->imageGranularity.height) != 0) + { + anvil_assert_fail(); + + goto end; + } + } + + result = true; +end: + return result; +} + /** Please see header for specification */ -bool Anvil::Image::get_aspect_subresource_layout(VkImageAspectFlags in_aspect, - uint32_t in_n_layer, - uint32_t in_n_mip, - VkSubresourceLayout* out_subresource_layout_ptr) const +bool Anvil::Image::get_aspect_subresource_layout(Anvil::ImageAspectFlags in_aspect, + uint32_t in_n_layer, + uint32_t in_n_mip, + VkSubresourceLayout* out_subresource_layout_ptr) const { - auto aspect_iterator = m_aspects.find(static_cast(in_aspect) ); + auto aspect_iterator = m_aspects.find(static_cast(in_aspect) ); bool result = false; - anvil_assert(m_create_info_ptr->get_tiling() == VK_IMAGE_TILING_LINEAR); + anvil_assert(m_create_info_ptr->get_tiling() == Anvil::ImageTiling::LINEAR); if (aspect_iterator != m_aspects.end() ) { @@ -222,7 +398,7 @@ bool Anvil::Image::get_aspect_subresource_layout(VkImageAspectFlags in_aspect, Anvil::MemoryBlock* Anvil::Image::get_memory_block() { bool is_callback_needed = false; - const auto is_sparse = (m_create_info_ptr->get_type() == Anvil::ImageType::SPARSE_NO_ALLOC); + const auto is_sparse = (m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::SPARSE_NO_ALLOC); if (is_sparse) { @@ -274,8 +450,8 @@ Anvil::MemoryBlock* Anvil::Image::get_memory_block() **/ bool Anvil::Image::init() { - std::vector aspects_used; - VkImageCreateFlags image_flags = 0; + std::vector aspects_used; + VkImageCreateFlags image_flags = m_create_info_ptr->get_create_flags(); Anvil::ImageFormatProperties image_format_props; const auto memory_features = m_create_info_ptr->get_memory_features(); uint32_t n_queue_family_indices = 0; @@ -292,16 +468,16 @@ bool Anvil::Image::init() if (m_create_info_ptr->get_mipmaps_to_upload().size() > 0) { - m_create_info_ptr->set_usage_flags(m_create_info_ptr->get_usage_flags() | VK_IMAGE_USAGE_TRANSFER_DST_BIT); + m_create_info_ptr->set_usage_flags(m_create_info_ptr->get_usage_flags() | Anvil::IMAGE_USAGE_FLAG_TRANSFER_DST_BIT); } - if (m_create_info_ptr->get_type() == Anvil::ImageType::SWAPCHAIN_WRAPPER && + if (m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER && m_create_info_ptr->get_swapchain()->get_create_info_ptr()->get_flags() & VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR) { anvil_assert(!m_create_info_ptr->uses_full_mipmap_chain() ); anvil_assert(m_create_info_ptr->get_n_layers () == 1); - anvil_assert(m_create_info_ptr->get_type_vk () == VK_IMAGE_TYPE_2D); - anvil_assert(m_create_info_ptr->get_tiling () == VK_IMAGE_TILING_OPTIMAL); + anvil_assert(m_create_info_ptr->get_type () == Anvil::ImageType::_2D); + anvil_assert(m_create_info_ptr->get_tiling () == Anvil::ImageTiling::OPTIMAL); } /* Form the queue family array */ @@ -312,7 +488,7 @@ bool Anvil::Image::init() /* Is the requested texture size valid? */ if (!m_device_ptr->get_physical_device_image_format_properties(Anvil::ImageFormatPropertiesQuery(m_create_info_ptr->get_format (), - m_create_info_ptr->get_type_vk (), + m_create_info_ptr->get_type (), m_create_info_ptr->get_tiling (), m_create_info_ptr->get_usage_flags (), m_create_info_ptr->get_create_flags() ), @@ -353,26 +529,27 @@ bool Anvil::Image::init() /* Create the image object */ if ( (m_create_info_ptr->get_create_flags() & Anvil::IMAGE_CREATE_FLAG_CUBE_COMPATIBLE_BIT) != 0) { - anvil_assert(m_create_info_ptr->get_type_vk() == VK_IMAGE_TYPE_2D); + anvil_assert(m_create_info_ptr->get_type() == Anvil::ImageType::_2D); anvil_assert((m_create_info_ptr->get_n_layers() % 6) == 0); - - image_flags |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT; } - if ( (m_create_info_ptr->get_create_flags() & Anvil::IMAGE_CREATE_FLAG_MUTABLE_FORMAT_BIT) != 0) + if ( (m_create_info_ptr->get_create_flags() & Anvil::IMAGE_CREATE_FLAG_2D_ARRAY_COMPATIBLE_BIT) != 0) { - image_flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT; + anvil_assert(m_device_ptr->get_extension_info()->khr_maintenance1() ); + anvil_assert(m_create_info_ptr->get_type() == Anvil::ImageType::_3D); } - if ( (m_create_info_ptr->get_create_flags() & Anvil::IMAGE_CREATE_FLAG_2D_ARRAY_COMPATIBLE_BIT) != 0) + if ( (m_create_info_ptr->get_create_flags() & Anvil::IMAGE_CREATE_FLAG_SPLIT_INSTANCE_BIND_REGIONS_BIT) != 0) { - anvil_assert(m_device_ptr->get_extension_info()->khr_maintenance1() ); - anvil_assert(m_create_info_ptr->get_type_vk() == VK_IMAGE_TYPE_3D); + anvil_assert(m_device_ptr->get_extension_info()->khr_bind_memory2() ); + } - image_flags |= VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR; + if ( (m_create_info_ptr->get_create_flags() & Anvil::IMAGE_CREATE_FLAG_ALIAS_BIT) != 0) + { + anvil_assert(m_device_ptr->get_extension_info()->khr_bind_memory2() ); } - if (m_create_info_ptr->get_type() == Anvil::ImageType::SWAPCHAIN_WRAPPER) + if (m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER) { if (m_create_info_ptr->get_swapchain()->get_create_info_ptr()->get_flags() & VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR) { @@ -380,7 +557,7 @@ bool Anvil::Image::init() } } - if (m_create_info_ptr->get_type() == Anvil::ImageType::SPARSE_NO_ALLOC) + if (m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::SPARSE_NO_ALLOC) { /* Convert residency scope to Vulkan image create flags */ switch (m_create_info_ptr->get_residency_scope() ) @@ -413,22 +590,22 @@ bool Anvil::Image::init() image_create_info.extent.height = m_create_info_ptr->get_base_mip_height(); image_create_info.extent.width = m_create_info_ptr->get_base_mip_width (); image_create_info.flags = image_flags; - image_create_info.format = m_create_info_ptr->get_format (); - image_create_info.imageType = m_create_info_ptr->get_type_vk (); - image_create_info.initialLayout = m_create_info_ptr->get_post_create_image_layout(); + image_create_info.format = static_cast (m_create_info_ptr->get_format () ); + image_create_info.imageType = static_cast (m_create_info_ptr->get_type () ); + image_create_info.initialLayout = static_cast(m_create_info_ptr->get_post_create_image_layout() ); image_create_info.mipLevels = m_n_mipmaps; image_create_info.pNext = nullptr; image_create_info.pQueueFamilyIndices = queue_family_indices; image_create_info.queueFamilyIndexCount = n_queue_family_indices; image_create_info.samples = static_cast(m_create_info_ptr->get_sample_count() ); - image_create_info.sharingMode = m_create_info_ptr->get_sharing_mode(); + image_create_info.sharingMode = static_cast (m_create_info_ptr->get_sharing_mode() ); image_create_info.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; - image_create_info.tiling = m_create_info_ptr->get_tiling (); + image_create_info.tiling = static_cast(m_create_info_ptr->get_tiling() ); image_create_info.usage = m_create_info_ptr->get_usage_flags(); if (m_create_info_ptr->get_external_memory_handle_types() != 0) { - anvil_assert(image_create_info.initialLayout == VK_IMAGE_LAYOUT_UNDEFINED); + anvil_assert(static_cast(image_create_info.initialLayout) == Anvil::ImageLayout::UNDEFINED); } struct_chainer.append_struct(image_create_info); @@ -465,7 +642,7 @@ bool Anvil::Image::init() set_vk_handle(m_image); - if (m_create_info_ptr->get_type() != Anvil::ImageType::SWAPCHAIN_WRAPPER) + if (m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SWAPCHAIN_WRAPPER) { /* Extract various image properties we're going to need later. * @@ -518,7 +695,7 @@ bool Anvil::Image::init() } /* Cache aspect subresource properties if we're dealing with a linear image */ - if (m_create_info_ptr->get_tiling() == VK_IMAGE_TILING_LINEAR) + if (m_create_info_ptr->get_tiling() == Anvil::ImageTiling::LINEAR) { const auto n_layers = m_create_info_ptr->get_n_layers(); @@ -550,7 +727,7 @@ bool Anvil::Image::init() &subresource, &subresource_layout); - m_aspects[static_cast(current_aspect)][LayerMipKey(n_layer, n_mip)] = subresource_layout; + m_aspects[static_cast(current_aspect)][LayerMipKey(n_layer, n_mip)] = subresource_layout; } } } @@ -565,7 +742,7 @@ bool Anvil::Image::init() uint32_t n_reqs = 0; std::vector sparse_image_memory_reqs; - anvil_assert(m_create_info_ptr->get_type() != Anvil::ImageType::SWAPCHAIN_WRAPPER); /* TODO: can images, to which swapchains can be bound, be sparse? */ + anvil_assert(m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); /* TODO: can images, to which swapchains can be bound, be sparse? */ /* Retrieve image aspect properties. Since Vulkan lets a single props structure to refer to more than * just a single aspect, we first cache the exposed info in a vec and then distribute the information to @@ -636,9 +813,9 @@ bool Anvil::Image::init() continue; } - anvil_assert(m_sparse_aspect_props.find(aspect) == m_sparse_aspect_props.end() ); + anvil_assert(m_sparse_aspect_props.find(static_cast(aspect) ) == m_sparse_aspect_props.end() ); - m_sparse_aspect_props[aspect] = Anvil::SparseImageAspectProperties(image_memory_req); + m_sparse_aspect_props[static_cast(aspect)] = Anvil::SparseImageAspectProperties(image_memory_req); } } @@ -654,7 +831,7 @@ bool Anvil::Image::init() ); } - if (m_create_info_ptr->get_type() == Anvil::ImageType::NONSPARSE_ALLOC) + if (m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::NONSPARSE_ALLOC) { /* Allocate memory for the image */ Anvil::MemoryBlockUniquePtr memory_block_ptr; @@ -693,6 +870,12 @@ bool Anvil::Image::init() } } + /* If the image has been initialized for SFR bindings, calculate & cache SFR tile size */ + if (image_flags & VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT) + { + init_sfr_tile_size(); + } + end: return result_bool; } @@ -726,9 +909,9 @@ void Anvil::Image::init_page_occupancy(const std::vector(current_aspect) ) != m_sparse_aspect_page_occupancy.end() ) { - occupancy_data_ptr = m_sparse_aspect_page_occupancy.at(current_aspect); + occupancy_data_ptr = m_sparse_aspect_page_occupancy.at(static_cast(current_aspect) ); break; } @@ -752,7 +935,7 @@ void Anvil::Image::init_page_occupancy(const std::vector(current_aspect)] = m_sparse_aspect_page_occupancy_data_items_owned.back().get(); } } @@ -763,7 +946,7 @@ void Anvil::Image::init_page_occupancy(const std::vectorfirst; + const Anvil::ImageAspectFlagBits& current_aspect = occupancy_iterator->first; decltype(m_sparse_aspect_props)::const_iterator current_aspect_props_iterator; AspectPageOccupancyData* page_occupancy_ptr = occupancy_iterator->second; @@ -773,7 +956,7 @@ void Anvil::Image::init_page_occupancy(const std::vectorsecond.granularity.width >= 1); + anvil_assert(current_aspect_props_iterator->second.granularity.width >= 1); anvil_assert(current_aspect_props_iterator->second.granularity.height >= 1); anvil_assert(current_aspect_props_iterator->second.granularity.depth >= 1); @@ -840,11 +1023,99 @@ void Anvil::Image::init_page_occupancy(const std::vector aspects; + uint32_t n_channel_bits[4]; + uint32_t n_bytes_per_texel; + + anvil_assert(m_create_info_ptr->get_type() == Anvil::ImageType::_2D); + + Anvil::Formats::get_format_aspects(m_create_info_ptr->get_format(), + &aspects); + + if (aspects.size() != 1) + { + /* TODO: It is currently undefined how SFR tile size should be calculated for images + * with more than 1 aspect. */ + anvil_assert(aspects.size() == 1); + + goto end; + } + + if (Anvil::Formats::is_format_compressed(m_create_info_ptr->get_format() ) ) + { + /* TODO */ + anvil_assert(!Anvil::Formats::is_format_compressed(m_create_info_ptr->get_format() )); + + goto end; + } + + Anvil::Formats::get_format_n_component_bits(m_create_info_ptr->get_format(), + n_channel_bits + 0, + n_channel_bits + 1, + n_channel_bits + 2, + n_channel_bits + 3); + + n_bytes_per_texel = (n_channel_bits[0] + n_channel_bits[1] + n_channel_bits[2] + n_channel_bits[3]) / 8; + + switch (n_bytes_per_texel) + { + case 1: + { + m_sfr_tile_size.width = 256; + m_sfr_tile_size.height = 256; + + break; + } + + case 2: + { + m_sfr_tile_size.width = 256; + m_sfr_tile_size.height = 128; + + break; + } + + case 4: + { + m_sfr_tile_size.width = 128; + m_sfr_tile_size.height = 128; + + break; + } + + case 8: + { + m_sfr_tile_size.width = 128; + m_sfr_tile_size.height = 64; + + break; + } + + case 16: + { + m_sfr_tile_size.width = 64; + m_sfr_tile_size.height = 64; + + break; + } + + default: + { + anvil_assert_fail(); + } + } +end: + ; +} + /** Releases the Vulkan image object, as well as the memory object associated with the Image instance. */ Anvil::Image::~Image() { - if (m_image != VK_NULL_HANDLE && - m_create_info_ptr->get_type() != Anvil::ImageType::SWAPCHAIN_WRAPPER) + if (m_image != VK_NULL_HANDLE && + m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SWAPCHAIN_WRAPPER) { lock(); { @@ -865,7 +1136,7 @@ Anvil::Image::~Image() /* Please see header for specification */ const VkImage& Anvil::Image::get_image(const bool& in_bake_memory_if_necessary) { - if (m_create_info_ptr->get_type() != Anvil::ImageType::SPARSE_NO_ALLOC) + if (m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SPARSE_NO_ALLOC) { if (m_memory_blocks_owned.size() == 0 && in_bake_memory_if_necessary) @@ -880,7 +1151,7 @@ const VkImage& Anvil::Image::get_image(const bool& in_bake_memory_if_necessary) /* Please see header for specification */ VkExtent2D Anvil::Image::get_image_extent_2D(uint32_t in_n_mipmap) const { - VkExtent2D result = { 0u, 0u }; + VkExtent2D result = {0u, 0u}; uint32_t size[2]; if (!get_image_mipmap_size(in_n_mipmap, @@ -903,7 +1174,7 @@ VkExtent2D Anvil::Image::get_image_extent_2D(uint32_t in_n_mipmap) const /* Please see header for specification */ VkExtent3D Anvil::Image::get_image_extent_3D(uint32_t in_n_mipmap) const { - VkExtent3D result = { 0u, 0u, 0u }; + VkExtent3D result = {0u, 0u, 0u}; uint32_t size[3]; if (!get_image_mipmap_size(in_n_mipmap, @@ -962,15 +1233,35 @@ bool Anvil::Image::get_image_mipmap_size(uint32_t in_n_mipmap, } /** Please see header for specification */ -bool Anvil::Image::get_sparse_image_aspect_properties(const VkImageAspectFlagBits in_aspect, +bool Anvil::Image::get_SFR_tile_size(VkExtent2D* out_result_ptr) const +{ + const Anvil::MGPUDevice* device_ptr(dynamic_cast(m_device_ptr)); + bool result (false); + + if (device_ptr == nullptr) + { + anvil_assert_fail(); + + goto end; + } + + /* All done */ + *out_result_ptr = m_sfr_tile_size; + result = true; +end: + return result; +} + +/** Please see header for specification */ +bool Anvil::Image::get_sparse_image_aspect_properties(const Anvil::ImageAspectFlagBits in_aspect, const Anvil::SparseImageAspectProperties** out_result_ptr_ptr) const { decltype(m_sparse_aspect_props)::const_iterator prop_iterator; bool result = false; - if (m_create_info_ptr->get_type() != Anvil::ImageType::SPARSE_NO_ALLOC) + if (m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SPARSE_NO_ALLOC) { - anvil_assert(m_create_info_ptr->get_type() == Anvil::ImageType::SPARSE_NO_ALLOC); + anvil_assert(m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::SPARSE_NO_ALLOC); goto end; } @@ -1009,16 +1300,16 @@ VkImageCreateInfo Anvil::Image::get_create_info_for_swapchain(const Anvil::Swapc &result.arrayLayers); result.extent.depth = 1; - result.flags = in_swapchain_ptr->get_create_info_ptr()->get_flags (); - result.format = in_swapchain_ptr->get_create_info_ptr()->get_format(); + result.flags = in_swapchain_ptr->get_create_info_ptr()->get_flags(); + result.format = static_cast(in_swapchain_ptr->get_create_info_ptr()->get_format() ); result.imageType = VK_IMAGE_TYPE_2D; - result.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; + result.initialLayout = static_cast(Anvil::ImageLayout::UNDEFINED); result.mipLevels = 1; result.pNext = nullptr; result.pQueueFamilyIndices = nullptr; result.queueFamilyIndexCount = UINT32_MAX; result.samples = VK_SAMPLE_COUNT_1_BIT; - result.sharingMode = in_swapchain_ptr->get_image(0)->get_create_info_ptr()->get_sharing_mode(); + result.sharingMode = static_cast(in_swapchain_ptr->get_image(0)->get_create_info_ptr()->get_sharing_mode() ); result.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; result.tiling = VK_IMAGE_TILING_OPTIMAL; result.usage = in_swapchain_ptr->get_image(0)->get_create_info_ptr()->get_usage_flags(); @@ -1033,24 +1324,24 @@ VkImageSubresourceRange Anvil::Image::get_subresource_range() const switch (m_create_info_ptr->get_format() ) { - case VK_FORMAT_D16_UNORM: - case VK_FORMAT_D32_SFLOAT: + case Anvil::Format::D16_UNORM: + case Anvil::Format::D32_SFLOAT: { result.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT; break; } - case VK_FORMAT_D16_UNORM_S8_UINT: - case VK_FORMAT_D24_UNORM_S8_UINT: - case VK_FORMAT_D32_SFLOAT_S8_UINT: + case Anvil::Format::D16_UNORM_S8_UINT: + case Anvil::Format::D24_UNORM_S8_UINT: + case Anvil::Format::D32_SFLOAT_S8_UINT: { result.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT; break; } - case VK_FORMAT_S8_UINT: + case Anvil::Format::S8_UINT: { result.aspectMask = VK_IMAGE_ASPECT_STENCIL_BIT; @@ -1074,10 +1365,10 @@ VkImageSubresourceRange Anvil::Image::get_subresource_range() const } /** Please see header for specification */ -bool Anvil::Image::has_aspects(VkImageAspectFlags in_aspects) const +bool Anvil::Image::has_aspects(Anvil::ImageAspectFlags in_aspects) const { - VkImageAspectFlags checked_aspects = 0; - bool result = true; + Anvil::ImageAspectFlags checked_aspects = 0; + bool result = true; if (m_create_info_ptr->get_residency_scope() == SPARSE_RESIDENCY_SCOPE_ALIASED || m_create_info_ptr->get_residency_scope() == SPARSE_RESIDENCY_SCOPE_NONALIASED) @@ -1086,7 +1377,7 @@ bool Anvil::Image::has_aspects(VkImageAspectFlags in_aspects) const n_bit < sizeof(uint32_t) * 8 /* bits in byte */ && result; ++n_bit) { - VkImageAspectFlagBits current_aspect = static_cast(1 << n_bit); + Anvil::ImageAspectFlagBits current_aspect = static_cast(1 << n_bit); if ((in_aspects & current_aspect) != 0 && m_sparse_aspect_props.find(current_aspect) == m_sparse_aspect_props.end() ) @@ -1148,25 +1439,25 @@ bool Anvil::Image::has_aspects(VkImageAspectFlags in_aspects) const } } - if (in_aspects & VK_IMAGE_ASPECT_COLOR_BIT) + if (in_aspects & Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_COLOR_BIT) { result &= has_color_components; - checked_aspects |= VK_IMAGE_ASPECT_COLOR_BIT; + checked_aspects |= Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_COLOR_BIT; } - if (result && (in_aspects & VK_IMAGE_ASPECT_DEPTH_BIT) != 0) + if (result && (in_aspects & Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_DEPTH_BIT) != 0) { result &= has_depth_components; - checked_aspects |= VK_IMAGE_ASPECT_DEPTH_BIT; + checked_aspects |= Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_DEPTH_BIT; } - if (result && (in_aspects & VK_IMAGE_ASPECT_STENCIL_BIT) != 0) + if (result && (in_aspects & Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_STENCIL_BIT) != 0) { result &= has_stencil_components; - checked_aspects |= VK_IMAGE_ASPECT_STENCIL_BIT; + checked_aspects |= Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_STENCIL_BIT; } anvil_assert(!result || @@ -1200,7 +1491,7 @@ void Anvil::Image::init_mipmap_props() current_mipmap_size[0] /= 2; current_mipmap_size[1] /= 2; - if (m_create_info_ptr->get_type_vk() == VK_IMAGE_TYPE_3D) + if (m_create_info_ptr->get_type() == Anvil::ImageType::_3D) { current_mipmap_size[2] /= 2; } @@ -1223,12 +1514,12 @@ void Anvil::Image::init_mipmap_props() } /* Please see header for specification */ -bool Anvil::Image::is_memory_bound_for_texel(VkImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - uint32_t in_n_mip, - uint32_t in_x, - uint32_t in_y, - uint32_t in_z) const +bool Anvil::Image::is_memory_bound_for_texel(Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_mip, + uint32_t in_x, + uint32_t in_y, + uint32_t in_z) const { bool result = false; @@ -1313,7 +1604,7 @@ void Anvil::Image::on_memory_backing_opaque_update(VkDeviceSize in_resour * by the Image wrapper, so there's nothing we need to do here. */ bool is_miptail_tile_binding_operation = false; - auto metadata_aspect_iterator = m_sparse_aspect_props.find(VK_IMAGE_ASPECT_METADATA_BIT); + auto metadata_aspect_iterator = m_sparse_aspect_props.find(Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_METADATA_BIT); if (metadata_aspect_iterator != m_sparse_aspect_props.end() ) { @@ -1343,7 +1634,7 @@ void Anvil::Image::on_memory_backing_opaque_update(VkDeviceSize in_resour aspect_iterator != m_sparse_aspect_page_occupancy.end() && !is_miptail_tile_binding_operation; ++aspect_iterator) { - VkImageAspectFlagBits current_aspect = aspect_iterator->first; + Anvil::ImageAspectFlagBits current_aspect = aspect_iterator->first; const SparseImageAspectProperties& current_aspect_props = m_sparse_aspect_props.at(current_aspect); auto occupancy_data_ptr = aspect_iterator->second; @@ -1456,7 +1747,7 @@ void Anvil::Image::on_memory_backing_update(const VkImageSubresource& in_subreso ANVIL_REDUNDANT_ARGUMENT(in_memory_block_start_offset); - if (in_subresource.aspectMask == VK_IMAGE_ASPECT_METADATA_BIT) + if (in_subresource.aspectMask == Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_METADATA_BIT) { /* Metadata is not tracked since it needs to be completely bound in order for the sparse image to be usable. */ anvil_assert_fail(); @@ -1464,8 +1755,8 @@ void Anvil::Image::on_memory_backing_update(const VkImageSubresource& in_subreso return; } - aspect_page_occupancy_iterator = m_sparse_aspect_page_occupancy.find(static_cast(in_subresource.aspectMask) ); - aspect_props_iterator = m_sparse_aspect_props.find (static_cast(in_subresource.aspectMask) ); + aspect_page_occupancy_iterator = m_sparse_aspect_page_occupancy.find(static_cast(in_subresource.aspectMask) ); + aspect_props_iterator = m_sparse_aspect_props.find (static_cast(in_subresource.aspectMask) ); anvil_assert(aspect_page_occupancy_iterator != m_sparse_aspect_page_occupancy.end() ); anvil_assert(aspect_props_iterator != m_sparse_aspect_props.end() ); @@ -1543,6 +1834,245 @@ bool Anvil::Image::set_memory(Anvil::MemoryBlock* in_memory_block_ptr) false); /* in_owned_by_image */ } +/** Please see header for specification */ +bool Anvil::Image::set_memory(MemoryBlockUniquePtr in_memory_block_ptr, + uint32_t in_n_device_group_indices, + const uint32_t* in_device_group_indices_ptr) +{ + return set_memory_internal(in_memory_block_ptr.release(), + true, /* in_owned_by_image */ + in_n_device_group_indices, + in_device_group_indices_ptr); +} + +bool Anvil::Image::set_memory(Anvil::MemoryBlock* in_memory_block_ptr, + uint32_t in_n_device_group_indices, + const uint32_t* in_device_group_indices_ptr) +{ + return set_memory_internal(in_memory_block_ptr, + false, /* in_owned_by_image */ + in_n_device_group_indices, + in_device_group_indices_ptr); +} + +/** Please see header for specification */ +bool Anvil::Image::set_memory(MemoryBlockUniquePtr in_memory_block_ptr, + uint32_t in_n_SFR_rects, + const VkRect2D* in_SFRs_ptr) +{ + return set_memory_internal(in_memory_block_ptr.release(), + true, /* in_owned_by_image */ + in_n_SFR_rects, + in_SFRs_ptr); +} + +bool Anvil::Image::set_memory(Anvil::MemoryBlock* in_memory_block_ptr, + uint32_t in_n_SFR_rects, + const VkRect2D* in_SFRs_ptr) +{ + return set_memory_internal(in_memory_block_ptr, + false, /* in_owned_by_image */ + in_n_SFR_rects, + in_SFRs_ptr); +} + +bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, + bool in_owned_by_image, + uint32_t in_n_SFR_rects, + const VkRect2D* in_SFRs_ptr) +{ + const auto& entrypoints (m_device_ptr->get_extension_khr_bind_memory2_entrypoints() ); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + Anvil::StructChainer struct_chainer; + + /* Sanity checks */ + if (in_memory_block_ptr == nullptr) + { + anvil_assert(in_memory_block_ptr != nullptr); + + goto end; + } + + if (!do_sanity_checks_for_sfr_binding(in_n_SFR_rects, + in_SFRs_ptr) ) + { + goto end; + } + + /* Bind the memory object to the image object */ + + { + VkBindImageMemoryInfoKHR bind_info; + + bind_info.image = m_image; + bind_info.memory = in_memory_block_ptr->get_memory (); + bind_info.memoryOffset = in_memory_block_ptr->get_start_offset(); + bind_info.pNext = nullptr; + bind_info.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR; + + struct_chainer.append_struct(bind_info); + } + + { + VkBindImageMemoryDeviceGroupInfoKHR bind_info_dg; + + bind_info_dg.deviceIndexCount = 0; + bind_info_dg.pDeviceIndices = nullptr; + bind_info_dg.pSplitInstanceBindRegions = in_SFRs_ptr; + bind_info_dg.splitInstanceBindRegionCount = in_n_SFR_rects; + bind_info_dg.pNext = nullptr; + bind_info_dg.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR; + + struct_chainer.append_struct(bind_info_dg); + } + + { + auto chain_ptr = struct_chainer.create_chain(); + + result = entrypoints.vkBindImageMemory2KHR(m_device_ptr->get_device_vk(), + 1, /* bindInfoCount */ + chain_ptr->get_root_struct() ); + } + + anvil_assert_vk_call_succeeded(result); + if (is_vk_call_successful(result) ) + { + if (in_owned_by_image) + { + m_memory_blocks_owned.push_back( + MemoryBlockUniquePtr(in_memory_block_ptr, + std::default_delete() + ) + ); + } + } +end: + return is_vk_call_successful(result); +} + +/** Please see header for specification */ +bool Anvil::Image::set_memory_internal(uint32_t in_swapchain_image_index, + uint32_t in_opt_n_SFR_rects, + const VkRect2D* in_opt_SFRs_ptr, + uint32_t in_opt_n_device_indices, + const uint32_t* in_opt_device_indices) +{ + const auto& entrypoints (m_device_ptr->get_extension_khr_bind_memory2_entrypoints() ); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + Anvil::StructChainer struct_chainer; + + /* Sanity checks */ + anvil_assert(m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED); + anvil_assert(m_mipmaps.size() == 1); + anvil_assert(m_peer_device_indices.size() == 0); + anvil_assert(m_peer_sfr_rects.size() == 0); + anvil_assert(m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::NONSPARSE_PEER_NO_ALLOC || + m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); + anvil_assert(m_create_info_ptr->get_swapchain()->get_create_info_ptr()->get_n_images() > in_swapchain_image_index); + + if (!m_device_ptr->is_extension_enabled(VK_KHR_DEVICE_GROUP_EXTENSION_NAME) ) + { + anvil_assert(m_device_ptr->is_extension_enabled(VK_KHR_DEVICE_GROUP_EXTENSION_NAME) ); + + goto end; + } + + if (m_swapchain_memory_assigned) + { + anvil_assert(!m_swapchain_memory_assigned); + + goto end; + } + + if (in_opt_n_SFR_rects != 0 && in_opt_n_device_indices != 0) + { + anvil_assert(!(in_opt_n_SFR_rects != 0 && in_opt_n_device_indices != 0) ); + + goto end; + } + + if (in_opt_n_SFR_rects > 0) + { + if (!do_sanity_checks_for_sfr_binding(in_opt_n_SFR_rects, + in_opt_SFRs_ptr) ) + { + anvil_assert_fail(); + + goto end; + } + } + + /* Bind the memory object to the image object */ + { + VkBindImageMemoryInfoKHR bind_info; + + bind_info.image = m_image; + bind_info.memory = VK_NULL_HANDLE; + bind_info.memoryOffset = 0; + bind_info.pNext = nullptr; + bind_info.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR; + + struct_chainer.append_struct(bind_info); + } + + { + VkBindImageMemoryDeviceGroupInfoKHR bind_info_dg; + + bind_info_dg.deviceIndexCount = in_opt_n_device_indices; + bind_info_dg.pDeviceIndices = in_opt_device_indices; + bind_info_dg.pSplitInstanceBindRegions = in_opt_SFRs_ptr; + bind_info_dg.splitInstanceBindRegionCount = in_opt_n_SFR_rects; + bind_info_dg.pNext = nullptr; + bind_info_dg.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR; + + struct_chainer.append_struct(bind_info_dg); + } + + { + VkBindImageMemorySwapchainInfoKHR bind_swapchain_info; + + bind_swapchain_info.imageIndex = in_swapchain_image_index; + bind_swapchain_info.pNext = nullptr; + bind_swapchain_info.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR; + bind_swapchain_info.swapchain = m_create_info_ptr->get_swapchain()->get_swapchain_vk(); + + struct_chainer.append_struct(bind_swapchain_info); + } + + m_create_info_ptr->get_swapchain()->lock(); + { + auto chain_ptr = struct_chainer.create_chain(); + + result = entrypoints.vkBindImageMemory2KHR(m_device_ptr->get_device_vk(), + 1, /* bindInfoCount */ + chain_ptr->get_root_struct() ); + } + m_create_info_ptr->get_swapchain()->unlock(); + + anvil_assert_vk_call_succeeded(result); + + if (is_vk_call_successful(result) ) + { + m_swapchain_memory_assigned = true; + + for (uint32_t n_SFR_rect = 0; + n_SFR_rect < in_opt_n_SFR_rects; + ++n_SFR_rect) + { + m_peer_sfr_rects.push_back(in_opt_SFRs_ptr[n_SFR_rect]); + } + + for (uint32_t n_device_index = 0; + n_device_index < in_opt_n_device_indices; + ++n_device_index) + { + m_peer_device_indices.push_back(in_opt_device_indices[n_device_index]); + } + } +end: + return is_vk_call_successful(result); +} + bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, bool in_owned_by_image) { @@ -1554,7 +2084,7 @@ bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, anvil_assert(m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED); anvil_assert(m_mipmaps.size() > 0); anvil_assert(m_memory_blocks_owned.size() == 0); - anvil_assert(m_create_info_ptr->get_type() != Anvil::ImageType::SWAPCHAIN_WRAPPER); + anvil_assert(m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); /* Bind the memory object to the image object */ if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) @@ -1568,6 +2098,55 @@ bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, } unlock(); } + else + { + const auto& entrypoints (m_device_ptr->get_extension_khr_bind_memory2_entrypoints() ); + Anvil::StructChainer struct_chainer; + + anvil_assert(device_type == Anvil::DEVICE_TYPE_MULTI_GPU); + anvil_assert(m_create_info_ptr->get_mipmaps_to_upload().size() == 0); + + if (!m_device_ptr->is_extension_enabled(VK_KHR_DEVICE_GROUP_EXTENSION_NAME) ) + { + anvil_assert(m_device_ptr->is_extension_enabled(VK_KHR_DEVICE_GROUP_EXTENSION_NAME) ); + + goto end; + } + + + { + VkBindImageMemoryInfoKHR bind_info; + + bind_info.image = m_image; + bind_info.memory = in_memory_block_ptr->get_memory(); + bind_info.memoryOffset = in_memory_block_ptr->get_start_offset(); + bind_info.pNext = nullptr; + bind_info.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR; + + struct_chainer.append_struct(bind_info); + } + + { + VkBindImageMemoryDeviceGroupInfoKHR bind_info_dv; + + bind_info_dv.deviceIndexCount = 0; + bind_info_dv.pDeviceIndices = nullptr; + bind_info_dv.pSplitInstanceBindRegions = nullptr; + bind_info_dv.splitInstanceBindRegionCount = 0; + bind_info_dv.pNext = nullptr; + bind_info_dv.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR; + + struct_chainer.append_struct(bind_info_dv); + } + + { + auto chain_ptr = struct_chainer.create_chain(); + + result = entrypoints.vkBindImageMemory2KHR(m_device_ptr->get_device_vk(), + 1, /* bindInfoCount */ + chain_ptr->get_root_struct() ); + } + } anvil_assert_vk_call_succeeded(result); if (is_vk_call_successful(result) ) @@ -1575,8 +2154,8 @@ bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, const auto& mips_to_upload = m_create_info_ptr->get_mipmaps_to_upload(); const auto tiling = m_create_info_ptr->get_tiling (); - VkImageLayout src_image_layout = (tiling == VK_IMAGE_TILING_LINEAR && mips_to_upload.size() > 0) ? VK_IMAGE_LAYOUT_PREINITIALIZED - : VK_IMAGE_LAYOUT_UNDEFINED; + Anvil::ImageLayout src_image_layout = (tiling == Anvil::ImageTiling::LINEAR && mips_to_upload.size() > 0) ? Anvil::ImageLayout::PREINITIALIZED + : Anvil::ImageLayout::UNDEFINED; if (in_owned_by_image) { @@ -1601,7 +2180,7 @@ bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, if (n_mipmaps_to_upload > 0) { - if (tiling == VK_IMAGE_TILING_LINEAR) + if (tiling == Anvil::ImageTiling::LINEAR) { src_access_mask = VK_ACCESS_HOST_WRITE_BIT; } @@ -1618,11 +2197,256 @@ bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, m_create_info_ptr->clear_mipmaps_to_upload(); } +end: + return is_vk_call_successful(result); +} + +bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, + bool in_owned_by_image, + uint32_t in_n_device_group_indices, + const uint32_t* in_device_group_indices_ptr) +{ + const auto& entrypoints (m_device_ptr->get_extension_khr_bind_memory2_entrypoints() ); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + Anvil::StructChainer struct_chainer; + + /* Sanity checks */ + anvil_assert(in_memory_block_ptr != nullptr); + anvil_assert(m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED); + anvil_assert(m_mipmaps.size() > 0); + anvil_assert(m_memory_blocks_owned.size() == 0); + anvil_assert(m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); + + if (!do_sanity_checks_for_physical_device_binding(in_memory_block_ptr, + in_n_device_group_indices) ) + { + anvil_assert_fail(); + + goto end; + } + + { + VkBindImageMemoryInfoKHR bind_info; + + bind_info.image = m_image; + bind_info.memory = in_memory_block_ptr->get_memory (); + bind_info.memoryOffset = in_memory_block_ptr->get_start_offset(); + bind_info.pNext = nullptr; + bind_info.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR; + + struct_chainer.append_struct(bind_info); + } + + { + VkBindImageMemoryDeviceGroupInfoKHR bind_info_dg; + + bind_info_dg.deviceIndexCount = in_n_device_group_indices; + bind_info_dg.pDeviceIndices = in_device_group_indices_ptr; + bind_info_dg.pSplitInstanceBindRegions = nullptr; + bind_info_dg.splitInstanceBindRegionCount = 0; + bind_info_dg.pNext = nullptr; + bind_info_dg.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR; + + struct_chainer.append_struct(bind_info_dg); + } + + { + auto chain_ptr = struct_chainer.create_chain(); + + result = entrypoints.vkBindImageMemory2KHR(m_device_ptr->get_device_vk(), + 1, /* bindInfoCount */ + chain_ptr->get_root_struct() ); + } + + anvil_assert_vk_call_succeeded(result); + if (is_vk_call_successful(result) ) + { + if (in_owned_by_image) + { + m_memory_blocks_owned.push_back( + MemoryBlockUniquePtr(in_memory_block_ptr, + std::default_delete() ) + ); + } + } + +end: + return is_vk_call_successful(result); +} + +/* Please see header for specification */ +bool Anvil::Image::set_memory_multi(uint32_t in_n_image_physical_device_memory_binding_updates, + ImagePhysicalDeviceMemoryBindingUpdate* in_updates_ptr) +{ + const auto device_ptr (in_updates_ptr[0].image_ptr->m_device_ptr); + const auto& entrypoints (device_ptr->get_extension_khr_bind_memory2_entrypoints() ); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + Anvil::StructChainVector struct_chains; + + /* Sanity checks */ + for (uint32_t n_update = 0; + n_update < in_n_image_physical_device_memory_binding_updates; + ++n_update) + { + const auto& current_update = in_updates_ptr[n_update]; + + if (!current_update.image_ptr->do_sanity_checks_for_physical_device_binding(current_update.memory_block_ptr, + static_cast(current_update.physical_devices.size() ))) + { + goto end; + } + } + + /* Bind the memory objects to relevant physical devices */ + for (uint32_t n_update = 0; + n_update < in_n_image_physical_device_memory_binding_updates; + ++n_update) + { + const auto& current_update = in_updates_ptr[n_update]; + Anvil::StructChainer struct_chainer; + { + VkBindImageMemoryInfoKHR bind_info; + + bind_info.image = current_update.image_ptr->m_image; + bind_info.memory = current_update.memory_block_ptr->get_memory (); + bind_info.memoryOffset = current_update.memory_block_ptr->get_start_offset(); + bind_info.pNext = nullptr; + bind_info.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR; + + struct_chainer.append_struct(bind_info); + } + + { + VkBindImageMemoryDeviceGroupInfoKHR bind_info_dg; + + bind_info_dg.deviceIndexCount = static_cast(current_update.physical_devices.size()); + bind_info_dg.pDeviceIndices = nullptr; + bind_info_dg.pSplitInstanceBindRegions = nullptr; + bind_info_dg.splitInstanceBindRegionCount = 0; + bind_info_dg.pNext = nullptr; + bind_info_dg.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR; + + struct_chainer.append_struct(bind_info_dg); + } + + struct_chains.append_struct_chain( + std::move(struct_chainer.create_chain() ) + ); + } + + /* All done */ + result = entrypoints.vkBindImageMemory2KHR(device_ptr->get_device_vk(), + struct_chains.get_n_structs (), + struct_chains.get_root_structs () ); + + anvil_assert_vk_call_succeeded(result); + if (is_vk_call_successful(result) ) + { + for (uint32_t n_update = 0; + n_update < in_n_image_physical_device_memory_binding_updates; + ++n_update) + { + auto& current_update = in_updates_ptr[n_update]; + + if (current_update.memory_block_owned_by_image) + { + current_update.image_ptr->m_memory_blocks_owned.push_back( + MemoryBlockUniquePtr(current_update.memory_block_ptr, + std::default_delete() + ) + ); + } + } + } +end: + return is_vk_call_successful(result); +} + +/* Please see header for specification */ +bool Anvil::Image::set_memory_multi(uint32_t in_n_image_sfr_memory_binding_updates, + Anvil::ImageSFRMemoryBindingUpdate* in_updates_ptr) +{ + std::vector bind_info_items; + std::vector bind_info_dg_items; + auto device_ptr (in_updates_ptr[0].image_ptr->m_device_ptr); + const auto& entrypoints (device_ptr->get_extension_khr_bind_memory2_entrypoints() ); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + + /* Sanity checks */ + for (uint32_t n_update = 0; + n_update < in_n_image_sfr_memory_binding_updates; + ++n_update) + { + const auto& current_update = in_updates_ptr[n_update]; + + if (current_update.memory_block_ptr == nullptr) + { + anvil_assert(current_update.memory_block_ptr != nullptr); + + goto end; + } + + if (!current_update.image_ptr->do_sanity_checks_for_sfr_binding(static_cast(current_update.SFRs.size() ), + ¤t_update.SFRs[0]) ) + { + goto end; + } + } + + /* Bind the memory objects to relevant images */ + bind_info_items.resize(in_n_image_sfr_memory_binding_updates); + + + for (uint32_t n_update = 0; + n_update < in_n_image_sfr_memory_binding_updates; + ++n_update) + { + auto& bind_info = bind_info_items.at(n_update); + auto& bind_info_dg = bind_info_dg_items.at(n_update); + const auto& current_update = in_updates_ptr[n_update]; + + bind_info_dg.deviceIndexCount = 0; + bind_info_dg.pDeviceIndices = nullptr; + bind_info_dg.pSplitInstanceBindRegions = ¤t_update.SFRs.at(0); + bind_info_dg.splitInstanceBindRegionCount = static_cast(current_update.SFRs.size()); + bind_info_dg.pNext = nullptr; + bind_info_dg.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR; + + bind_info.image = current_update.image_ptr->m_image; + bind_info.memory = current_update.memory_block_ptr->get_memory (); + bind_info.memoryOffset = current_update.memory_block_ptr->get_start_offset(); + bind_info.pNext = nullptr; + bind_info.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR; + } + + result = entrypoints.vkBindImageMemory2KHR(device_ptr->get_device_vk(), + static_cast(bind_info_items.size() ), + &bind_info_items[0]); + + anvil_assert_vk_call_succeeded(result); + if (is_vk_call_successful(result) ) + { + for (uint32_t n_update = 0; + n_update < in_n_image_sfr_memory_binding_updates; + ++n_update) + { + auto& current_update = in_updates_ptr[n_update]; + + if (current_update.memory_block_owned_by_image) + { + current_update.image_ptr->m_memory_blocks_owned.push_back( + MemoryBlockUniquePtr(current_update.memory_block_ptr, + std::default_delete() ) + ); + } + } + } +end: return is_vk_call_successful(result); } -void Anvil::Image::transition_to_post_alloc_image_layout(VkAccessFlags in_source_access_mask, - VkImageLayout in_src_layout) +void Anvil::Image::transition_to_post_alloc_image_layout(VkAccessFlags in_source_access_mask, + Anvil::ImageLayout in_src_layout) { const auto post_alloc_layout = m_create_info_ptr->get_post_alloc_image_layout(); @@ -1640,14 +2464,14 @@ void Anvil::Image::transition_to_post_alloc_image_layout(VkAccessFlags in_source /** Please see header for specification */ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_ptr, - VkImageLayout in_current_image_layout, - VkImageLayout* out_new_image_layout_ptr) + Anvil::ImageLayout in_current_image_layout, + Anvil::ImageLayout* out_new_image_layout_ptr) { - std::map > image_aspect_to_mipmap_raw_data_map; - VkImageAspectFlags image_aspects_touched (0); - VkImageSubresourceRange image_subresource_range; - const VkDeviceSize sparse_page_size ( (m_page_tracker_ptr != nullptr) ? m_page_tracker_ptr->get_page_size() : 0); - Anvil::Queue* universal_queue_ptr (m_device_ptr->get_universal_queue(0) ); + std::map > image_aspect_to_mipmap_raw_data_map; + Anvil::ImageAspectFlags image_aspects_touched (0); + VkImageSubresourceRange image_subresource_range; + const VkDeviceSize sparse_page_size ( (m_page_tracker_ptr != nullptr) ? m_page_tracker_ptr->get_page_size() : 0); + Anvil::Queue* universal_queue_ptr (m_device_ptr->get_universal_queue(0) ); /* Make sure image has been assigned at least one memory block before we go ahead with the upload process */ get_memory_block(); @@ -1680,17 +2504,17 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p image_subresource_range.layerCount = m_create_info_ptr->get_n_layers(); image_subresource_range.levelCount = m_n_mipmaps; - if (m_create_info_ptr->get_tiling() == VK_IMAGE_TILING_LINEAR) + if (m_create_info_ptr->get_tiling() == Anvil::ImageTiling::LINEAR) { /* TODO: Transition the subresource ranges, if necessary. */ - anvil_assert(in_current_image_layout != VK_IMAGE_LAYOUT_UNDEFINED); + anvil_assert(in_current_image_layout != Anvil::ImageLayout::UNDEFINED); for (auto aspect_to_mipmap_data_iterator = image_aspect_to_mipmap_raw_data_map.begin(); aspect_to_mipmap_data_iterator != image_aspect_to_mipmap_raw_data_map.end(); ++aspect_to_mipmap_data_iterator) { - VkImageAspectFlagBits current_aspect = aspect_to_mipmap_data_iterator->first; - const auto& mipmap_raw_data_items = aspect_to_mipmap_data_iterator->second; + Anvil::ImageAspectFlagBits current_aspect = aspect_to_mipmap_data_iterator->first; + const auto& mipmap_raw_data_items = aspect_to_mipmap_data_iterator->second; for (auto mipmap_raw_data_item_iterator = mipmap_raw_data_items.begin(); mipmap_raw_data_item_iterator != mipmap_raw_data_items.end(); @@ -1814,7 +2638,7 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p } else { - anvil_assert(m_create_info_ptr->get_tiling() == VK_IMAGE_TILING_OPTIMAL); + anvil_assert(m_create_info_ptr->get_tiling() == Anvil::ImageTiling::OPTIMAL); Anvil::BufferUniquePtr temp_buffer_ptr; Anvil::PrimaryCommandBufferUniquePtr temp_cmdbuf_ptr; @@ -1888,8 +2712,8 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr, total_raw_mips_size, Anvil::QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, - VK_BUFFER_USAGE_TRANSFER_SRC_BIT, + Anvil::SharingMode::EXCLUSIVE, + Anvil::BUFFER_USAGE_FLAG_TRANSFER_SRC_BIT, 0); /* in_memory_features */ create_info_ptr->set_client_data(merged_mip_storage.get() ); @@ -1910,17 +2734,17 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p std::vector copy_regions; /* Transfer the image to the transfer_destination layout if not already in this or general layout */ - if (in_current_image_layout != VK_IMAGE_LAYOUT_GENERAL && - in_current_image_layout != VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL) + if (in_current_image_layout != Anvil::ImageLayout::GENERAL && + in_current_image_layout != Anvil::ImageLayout::TRANSFER_DST_OPTIMAL) { const auto sharing_mode (m_create_info_ptr->get_sharing_mode() ); - const auto queue_fam_index((sharing_mode == VK_SHARING_MODE_EXCLUSIVE) ? universal_queue_ptr->get_queue_family_index() : VK_QUEUE_FAMILY_IGNORED); + const auto queue_fam_index((sharing_mode == Anvil::SharingMode::EXCLUSIVE) ? universal_queue_ptr->get_queue_family_index() : VK_QUEUE_FAMILY_IGNORED); Anvil::ImageBarrier image_barrier (0, /* source_access_mask */ VK_ACCESS_TRANSFER_WRITE_BIT, false, in_current_image_layout, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, + Anvil::ImageLayout::TRANSFER_DST_OPTIMAL, queue_fam_index, queue_fam_index, this, @@ -1936,7 +2760,7 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p 1, /* in_image_memory_barrier_count */ &image_barrier); - *out_new_image_layout_ptr = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL; + *out_new_image_layout_ptr = Anvil::ImageLayout::TRANSFER_DST_OPTIMAL; } else { diff --git a/src/wrappers/image_view.cpp b/src/wrappers/image_view.cpp index bbd34ff6..41b93960 100644 --- a/src/wrappers/image_view.cpp +++ b/src/wrappers/image_view.cpp @@ -152,7 +152,6 @@ bool Anvil::ImageView::init() const auto n_base_mip = m_create_info_ptr->get_base_mipmap_level(); const auto n_layers = m_create_info_ptr->get_n_layers (); const auto n_mips = m_create_info_ptr->get_n_mipmaps (); - VkFormat parent_image_format = VK_FORMAT_UNDEFINED; uint32_t parent_image_n_layers = 0; uint32_t parent_image_n_mipmaps = 0; auto parent_image_ptr = m_create_info_ptr->get_parent_image(); @@ -160,11 +159,11 @@ bool Anvil::ImageView::init() VkResult result_vk; Anvil::StructChainer struct_chainer; const auto& swizzle_array = m_create_info_ptr->get_swizzle_array(); + auto usage = m_create_info_ptr->get_usage (); - parent_image_format = parent_image_ptr->get_create_info_ptr()->get_format(); - parent_image_n_mipmaps = parent_image_ptr->get_n_mipmaps (); + parent_image_n_mipmaps = parent_image_ptr->get_n_mipmaps(); - if (parent_image_ptr->get_create_info_ptr()->get_type_vk() != VK_IMAGE_TYPE_3D) + if (parent_image_ptr->get_create_info_ptr()->get_type() != Anvil::ImageType::_3D) { parent_image_n_layers = parent_image_ptr->get_create_info_ptr()->get_n_layers(); } @@ -190,15 +189,15 @@ bool Anvil::ImageView::init() goto end; } - if (((parent_image_ptr->get_create_info_ptr()->get_create_flags() & Anvil::IMAGE_CREATE_FLAG_MUTABLE_FORMAT_BIT) == 0) && - (parent_image_format != format)) + if (usage != Anvil::ImageUsageFlagBits::IMAGE_USAGE_UNKNOWN && + !m_device_ptr->is_extension_enabled(VK_KHR_MAINTENANCE2_EXTENSION_NAME) ) { - anvil_assert(parent_image_format == format); + anvil_assert(m_device_ptr->is_extension_enabled(VK_KHR_MAINTENANCE2_EXTENSION_NAME) ); goto end; } - if (parent_image_ptr->get_create_info_ptr()->get_type_vk() == VK_IMAGE_TYPE_3D) + if (parent_image_ptr->get_create_info_ptr()->get_type() == Anvil::ImageType::_3D) { if (image_view_type == VK_IMAGE_VIEW_TYPE_2D || image_view_type == VK_IMAGE_VIEW_TYPE_2D_ARRAY) @@ -223,12 +222,12 @@ bool Anvil::ImageView::init() { VkImageViewCreateInfo image_view_create_info; - image_view_create_info.components.a = swizzle_array[3]; - image_view_create_info.components.b = swizzle_array[2]; - image_view_create_info.components.g = swizzle_array[1]; - image_view_create_info.components.r = swizzle_array[0]; + image_view_create_info.components.a = static_cast(swizzle_array[3]); + image_view_create_info.components.b = static_cast(swizzle_array[2]); + image_view_create_info.components.g = static_cast(swizzle_array[1]); + image_view_create_info.components.r = static_cast(swizzle_array[0]); image_view_create_info.flags = 0; - image_view_create_info.format = format; + image_view_create_info.format = static_cast(format); image_view_create_info.image = parent_image_ptr->get_image(); image_view_create_info.pNext = nullptr; image_view_create_info.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; @@ -242,6 +241,17 @@ bool Anvil::ImageView::init() struct_chainer.append_struct(image_view_create_info); } + if (usage != Anvil::ImageUsageFlagBits::IMAGE_USAGE_UNKNOWN) + { + VkImageViewUsageCreateInfo usage_create_info; + + usage_create_info.pNext = nullptr; + usage_create_info.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO_KHR; + usage_create_info.usage = static_cast(usage); + + struct_chainer.append_struct(usage_create_info); + } + { auto chain_ptr = struct_chainer.create_chain(); diff --git a/src/wrappers/instance.cpp b/src/wrappers/instance.cpp index c0e497e6..c04da0ee 100644 --- a/src/wrappers/instance.cpp +++ b/src/wrappers/instance.cpp @@ -128,6 +128,7 @@ void Anvil::Instance::destroy() } m_physical_devices.clear(); + m_physical_device_groups.clear(); #ifdef _DEBUG { @@ -233,6 +234,72 @@ void Anvil::Instance::enumerate_layer_extensions(Anvil::Layer* in_layer_ptr) } } +/** Enumerates and caches all available physical device groups. */ +void Anvil::Instance::enumerate_physical_device_groups() +{ + uint32_t n_physical_device_groups = 0; + VkResult result = VK_ERROR_INITIALIZATION_FAILED; + + ANVIL_REDUNDANT_VARIABLE(result); + + /* Enumerate available physical device groups and cache them for further use. */ + result = m_khr_device_group_creation_entrypoints.vkEnumeratePhysicalDeviceGroupsKHR(m_instance, + &n_physical_device_groups, + nullptr); /* pPhysicalDeviceGroupProperties */ + + if (n_physical_device_groups > 0) + { + std::vector device_group_props(n_physical_device_groups); + + for (uint32_t n_physical_device_group = 0; + n_physical_device_group < n_physical_device_groups; + ++n_physical_device_group) + { + auto& current_props = device_group_props.at(n_physical_device_group); + + current_props.pNext = nullptr; + current_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHR; + } + + result = m_khr_device_group_creation_entrypoints.vkEnumeratePhysicalDeviceGroupsKHR(m_instance, + &n_physical_device_groups, + &device_group_props[0]); + anvil_assert_vk_call_succeeded(result); + + for (uint32_t n_group = 0; + n_group < n_physical_device_groups; + ++n_group) + { + Anvil::PhysicalDeviceGroup new_group; + const auto& this_group_props = device_group_props.at(n_group); + + anvil_assert(this_group_props.physicalDeviceCount > 0); + + for (uint32_t n_physical_device = 0; + n_physical_device < this_group_props.physicalDeviceCount; + ++n_physical_device) + { + auto physical_device_iterator = std::find(m_physical_devices.begin(), + m_physical_devices.end(), + this_group_props.physicalDevices[n_physical_device]); + + anvil_assert(physical_device_iterator != m_physical_devices.end() ); + if (physical_device_iterator != m_physical_devices.end() ) + { + new_group.physical_device_ptrs.push_back(physical_device_iterator->get() ); + + (*physical_device_iterator)->set_device_group_index (n_group); + (*physical_device_iterator)->set_device_group_device_index(n_physical_device); + } + } + + new_group.supports_subset_allocations = (this_group_props.subsetAllocation == VK_TRUE); + + m_physical_device_groups.push_back(new_group); + } + } +} + /** Enumerates and caches all available physical devices. */ void Anvil::Instance::enumerate_physical_devices() { @@ -342,6 +409,14 @@ const Anvil::ExtensionKHRSurfaceEntrypoints& Anvil::Instance::get_extension_khr_ #endif #endif +/** Please see header for specification */ +const Anvil::ExtensionKHRDeviceGroupCreationEntrypoints& Anvil::Instance::get_extension_khr_device_group_creation_entrypoints() const +{ + anvil_assert(m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_device_group_creation() ); + + return m_khr_device_group_creation_entrypoints; +} + /** Initializes the wrapper. */ void Anvil::Instance::init(const std::vector& in_disallowed_instance_level_extensions) { @@ -349,8 +424,9 @@ void Anvil::Instance::init(const std::vector& in_disallowed_instanc VkInstanceCreateInfo create_info; std::vector enabled_layers; std::map extension_enabled_status; - size_t n_instance_layers = 0; - VkResult result = VK_ERROR_INITIALIZATION_FAILED; + bool is_device_group_creation_supported = true; + size_t n_instance_layers = 0; + VkResult result = VK_ERROR_INITIALIZATION_FAILED; ANVIL_REDUNDANT_VARIABLE(result); @@ -446,13 +522,14 @@ void Anvil::Instance::init(const std::vector& in_disallowed_instanc } } } - /* Enable known instance-level extensions by default */ if (is_instance_extension_supported(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME) ) { extension_enabled_status[VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME] = true; } + extension_enabled_status[VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME] = true; + if (is_instance_extension_supported(VK_KHR_EXTERNAL_FENCE_CAPABILITIES_EXTENSION_NAME) ) { extension_enabled_status[VK_KHR_EXTERNAL_FENCE_CAPABILITIES_EXTENSION_NAME] = true; @@ -475,6 +552,11 @@ void Anvil::Instance::init(const std::vector& in_disallowed_instanc if (ext_iterator != extension_enabled_status.end() ) { + if (current_extension_name == VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME) + { + is_device_group_creation_supported = false; + } + extension_enabled_status.erase(ext_iterator); } } @@ -515,6 +597,11 @@ void Anvil::Instance::init(const std::vector& in_disallowed_instanc } enumerate_physical_devices(); + + if (is_device_group_creation_supported) + { + enumerate_physical_device_groups(); + } } /** Initializes debug callback support. */ @@ -618,6 +705,14 @@ void Anvil::Instance::init_func_pointers() anvil_assert(m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceSparseImageFormatProperties2KHR != nullptr); } + if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_device_group_creation() ) + { + m_khr_device_group_creation_entrypoints.vkEnumeratePhysicalDeviceGroupsKHR = reinterpret_cast(vkGetInstanceProcAddr(m_instance, + "vkEnumeratePhysicalDeviceGroupsKHR") ); + + anvil_assert(m_khr_device_group_creation_entrypoints.vkEnumeratePhysicalDeviceGroupsKHR != nullptr); + } + if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_external_fence_capabilities() ) { m_khr_external_fence_capabilities_entrypoints.vkGetPhysicalDeviceExternalFencePropertiesKHR = reinterpret_cast(vkGetInstanceProcAddr(m_instance, diff --git a/src/wrappers/memory_block.cpp b/src/wrappers/memory_block.cpp index 7050bd5f..2f030837 100644 --- a/src/wrappers/memory_block.cpp +++ b/src/wrappers/memory_block.cpp @@ -38,7 +38,6 @@ Anvil::MemoryBlock::MemoryBlock(Anvil::MemoryBlockCreateInfoUniquePtr in_create_ m_gpu_data_map_count (0), m_gpu_data_ptr (nullptr), m_memory (VK_NULL_HANDLE), - m_memory_type_index (in_create_info_ptr->get_memory_type_index() ), m_parent_memory_allocator_backend_ptr(nullptr) { m_create_info_ptr = std::move(in_create_info_ptr); @@ -157,9 +156,13 @@ Anvil::MemoryBlockUniquePtr Anvil::MemoryBlock::create(Anvil::MemoryBlockCreateI } } else - if (type == Anvil::MemoryBlockType::DERIVED_WITH_CUSTOM_DELETE_PROC) { - result_ptr->m_memory = result_ptr->m_create_info_ptr->get_memory(); + result_ptr->m_memory_type_props_ptr = &result_ptr->m_create_info_ptr->get_device()->get_physical_device_memory_properties().types.at(result_ptr->m_create_info_ptr->get_memory_type_index() ); + + if (type == Anvil::MemoryBlockType::DERIVED_WITH_CUSTOM_DELETE_PROC) + { + result_ptr->m_memory = result_ptr->m_create_info_ptr->get_memory(); + } } } @@ -322,6 +325,7 @@ uint32_t Anvil::MemoryBlock::get_device_memory_type_index(uint32_t const bool is_host_cached_memory_required ((in_memory_features & MEMORY_FEATURE_FLAG_HOST_CACHED) != 0); const bool is_lazily_allocated_memory_required((in_memory_features & MEMORY_FEATURE_FLAG_LAZILY_ALLOCATED) != 0); const bool is_mappable_memory_required ((in_memory_features & MEMORY_FEATURE_FLAG_MAPPABLE) != 0); + const bool is_multi_instance_memory_required ((in_memory_features & MEMORY_FEATURE_FLAG_MULTI_INSTANCE) != 0); const Anvil::MemoryTypes& memory_types (get_create_info_ptr()->get_device()->get_physical_device_memory_properties().types); if (!is_mappable_memory_required) @@ -347,7 +351,9 @@ uint32_t Anvil::MemoryBlock::get_device_memory_type_index(uint32_t ((is_lazily_allocated_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT)) || !is_lazily_allocated_memory_required) && ((is_mappable_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)) || - !is_mappable_memory_required) ) + !is_mappable_memory_required) && + (!is_multi_instance_memory_required || + (is_multi_instance_memory_required && (current_memory_type.heap_ptr->flags & VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR)))) { if ( (in_memory_type_bits & (1 << n_memory_type)) != 0) { @@ -373,15 +379,19 @@ bool Anvil::MemoryBlock::init() VkMemoryAllocateInfo mem_alloc_info; mem_alloc_info.allocationSize = m_create_info_ptr->get_size(); - mem_alloc_info.memoryTypeIndex = (m_create_info_ptr->get_imported_external_memory_handle_type() != 0) ? m_create_info_ptr->get_memory_type_index() - : get_device_memory_type_index (m_create_info_ptr->get_allowed_memory_bits(), - m_create_info_ptr->get_memory_features () ); + mem_alloc_info.memoryTypeIndex = (m_create_info_ptr->get_imported_external_memory_handle_type() != 0) ? m_create_info_ptr->get_memory_type_index() + : (m_create_info_ptr->get_type () != Anvil::MemoryBlockType::REGULAR) ? m_create_info_ptr->get_memory_type_index() + : get_device_memory_type_index (m_create_info_ptr->get_allowed_memory_bits(), + m_create_info_ptr->get_memory_features () ); mem_alloc_info.pNext = nullptr; mem_alloc_info.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO; - m_memory_type_index = mem_alloc_info.memoryTypeIndex; + m_memory_type_props_ptr = &m_create_info_ptr->get_device()->get_physical_device_memory_properties().types.at(mem_alloc_info.memoryTypeIndex); struct_chainer.append_struct(mem_alloc_info); + + /* Cache the memory type index in the create info struct. */ + m_create_info_ptr->set_memory_type_index(mem_alloc_info.memoryTypeIndex); } { @@ -465,6 +475,30 @@ bool Anvil::MemoryBlock::init() } } + if (m_create_info_ptr->get_device_mask() != 0 && + m_create_info_ptr->get_device()->get_type() == Anvil::DeviceType::DEVICE_TYPE_MULTI_GPU) + { + VkMemoryAllocateFlagsInfoKHR alloc_info_khr; + + alloc_info_khr.deviceMask = m_create_info_ptr->get_device_mask(); + + /* NOTE: Host-mappable memory must not be multi-instance heap and must exist on only one device. */ + if (((m_create_info_ptr->get_memory_features() & Anvil::MEMORY_FEATURE_FLAG_MAPPABLE) != 0) && + (Utils::count_set_bits(alloc_info_khr.deviceMask) > 1) ) + { + alloc_info_khr.flags = 0; + } + else + { + alloc_info_khr.flags = VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT; + } + + alloc_info_khr.pNext = nullptr; + alloc_info_khr.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHR; + + struct_chainer.append_struct(alloc_info_khr); + } + { auto chain_ptr = struct_chainer.create_chain(); diff --git a/src/wrappers/physical_device.cpp b/src/wrappers/physical_device.cpp index 10ee60d3..d84f0fa7 100644 --- a/src/wrappers/physical_device.cpp +++ b/src/wrappers/physical_device.cpp @@ -227,6 +227,45 @@ bool Anvil::PhysicalDevice::init() m_khr_16_bit_storage_features_ptr.get () ); } + /* Retrieve device layers */ + result_vk = vkEnumerateDeviceLayerProperties(m_physical_device, + &n_physical_device_layers, + nullptr); /* pProperties */ + + if (!is_vk_call_successful(result_vk) ) + { + anvil_assert_vk_call_succeeded(result_vk); + + result = false; + goto end; + } + + if (n_physical_device_layers > 0) + { + std::vector layer_props; + + layer_props.resize(n_physical_device_layers); + + result_vk = vkEnumerateDeviceLayerProperties(m_physical_device, + &n_physical_device_layers, + &layer_props[0]); + + if (!is_vk_call_successful(result_vk) ) + { + anvil_assert(is_vk_call_successful(result_vk) ); + + result = false; + goto end; + } + + for (uint32_t n_layer = 0; + n_layer < n_physical_device_layers; + ++n_layer) + { + m_layers.push_back(Anvil::Layer(layer_props[n_layer]) ); + } + } + /* Retrieve additional device info */ if (m_instance_ptr->get_enabled_extensions_info()->khr_get_physical_device_properties2() ) { @@ -399,6 +438,49 @@ bool Anvil::PhysicalDevice::init() } } + if (m_extension_info_ptr->get_device_extension_info()->khr_maintenance2() ) + { + Anvil::StructID point_clipping_props_struct_id = UINT32_MAX; + const VkPhysicalDevicePointClippingPropertiesKHR* result_point_clipping_props_struct_ptr = nullptr; + Anvil::StructChainUniquePtr struct_chain_ptr; + Anvil::StructChainer struct_chainer; + + { + VkPhysicalDeviceProperties2KHR general_props; + + general_props.pNext = nullptr; + general_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; + + struct_chainer.append_struct(general_props); + } + { + VkPhysicalDevicePointClippingPropertiesKHR point_clipping_props; + + point_clipping_props.pNext = nullptr; + point_clipping_props.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES_KHR); + + point_clipping_props_struct_id = struct_chainer.append_struct(point_clipping_props); + } + + struct_chain_ptr = struct_chainer.create_chain(); + result_point_clipping_props_struct_ptr = struct_chain_ptr->get_struct_with_id(point_clipping_props_struct_id); + + gpdp2_entrypoints.vkGetPhysicalDeviceProperties2KHR(m_physical_device, + struct_chain_ptr->get_root_struct() ); + + m_khr_maintenance2_physical_device_point_clipping_properties_ptr.reset( + new KHRMaintenance2PhysicalDevicePointClippingProperties(*result_point_clipping_props_struct_ptr) + ); + + if (m_khr_maintenance2_physical_device_point_clipping_properties_ptr == nullptr) + { + anvil_assert(m_khr_maintenance2_physical_device_point_clipping_properties_ptr != nullptr); + + result = false; + goto end; + } + } + if (m_extension_info_ptr->get_device_extension_info()->khr_maintenance3() ) { Anvil::StructID maintenance3_struct_id = UINT32_MAX; @@ -468,7 +550,8 @@ bool Anvil::PhysicalDevice::init() m_ext_descriptor_indexing_properties_ptr.get (), m_ext_vertex_attribute_divisor_properties_ptr.get (), m_khr_external_memory_capabilities_physical_device_id_properties_ptr.get(), - m_khr_maintenance3_properties_ptr.get () ); + m_khr_maintenance3_properties_ptr.get (), + m_khr_maintenance2_physical_device_point_clipping_properties_ptr.get () ); /* Retrieve device queue data */ vkGetPhysicalDeviceQueueFamilyProperties(m_physical_device, @@ -477,7 +560,7 @@ bool Anvil::PhysicalDevice::init() if (n_physical_device_queues > 0) { - std::vector queue_props; + std::vector queue_props; queue_props.resize(n_physical_device_queues); @@ -499,45 +582,6 @@ bool Anvil::PhysicalDevice::init() m_memory_properties.init(memory_properties); - /* Retrieve device layers */ - result_vk = vkEnumerateDeviceLayerProperties(m_physical_device, - &n_physical_device_layers, - nullptr); /* pProperties */ - - if (!is_vk_call_successful(result_vk) ) - { - anvil_assert_vk_call_succeeded(result_vk); - - result = false; - goto end; - } - - if (n_physical_device_layers > 0) - { - std::vector layer_props; - - layer_props.resize(n_physical_device_layers); - - result_vk = vkEnumerateDeviceLayerProperties(m_physical_device, - &n_physical_device_layers, - &layer_props[0]); - - if (!is_vk_call_successful(result_vk) ) - { - anvil_assert(is_vk_call_successful(result_vk) ); - - result = false; - goto end; - } - - for (uint32_t n_layer = 0; - n_layer < n_physical_device_layers; - ++n_layer) - { - m_layers.push_back(Anvil::Layer(layer_props[n_layer]) ); - } - } - end: return result; } @@ -628,12 +672,12 @@ bool Anvil::PhysicalDevice::get_fence_properties(const Anvil::FencePropertiesQue return result; } -Anvil::FormatProperties Anvil::PhysicalDevice::get_format_properties(VkFormat in_format) const +Anvil::FormatProperties Anvil::PhysicalDevice::get_format_properties(Anvil::Format in_format) const { VkFormatProperties core_vk10_format_props; vkGetPhysicalDeviceFormatProperties(m_physical_device, - in_format, + static_cast(in_format), &core_vk10_format_props); return Anvil::FormatProperties(core_vk10_format_props); @@ -657,13 +701,13 @@ bool Anvil::PhysicalDevice::get_image_format_properties(const ImageFormatPropert /* Retrieve core VK1.0 information first. */ vkGetPhysicalDeviceFormatProperties(m_physical_device, - in_query.format, + static_cast(in_query.format), &core_vk10_format_props); if (vkGetPhysicalDeviceImageFormatProperties(m_physical_device, - in_query.format, - in_query.image_type, - in_query.tiling, + static_cast (in_query.format), + static_cast (in_query.image_type), + static_cast(in_query.tiling), in_query.usage_flags, in_query.create_flags, &core_vk10_image_format_properties) != VK_SUCCESS) @@ -685,11 +729,11 @@ bool Anvil::PhysicalDevice::get_image_format_properties(const ImageFormatPropert VkPhysicalDeviceImageFormatInfo2KHR format_info; format_info.flags = in_query.create_flags; - format_info.format = in_query.format; + format_info.format = static_cast(in_query.format); format_info.pNext = nullptr; format_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR; - format_info.tiling = in_query.tiling; - format_info.type = in_query.image_type; + format_info.tiling = static_cast(in_query.tiling); + format_info.type = static_cast (in_query.image_type); format_info.usage = in_query.usage_flags; input_struct_chainer.append_struct(format_info); @@ -817,11 +861,11 @@ bool Anvil::PhysicalDevice::get_semaphore_properties(const Anvil::SemaphorePrope } /* Please see header for specification */ -bool Anvil::PhysicalDevice::get_sparse_image_format_properties(VkFormat in_format, - VkImageType in_type, - VkSampleCountFlagBits in_sample_count, - VkImageUsageFlags in_usage, - VkImageTiling in_tiling, +bool Anvil::PhysicalDevice::get_sparse_image_format_properties(Anvil::Format in_format, + Anvil::ImageType in_type, + Anvil::SampleCountFlagBits in_sample_count, + Anvil::ImageUsageFlags in_usage, + Anvil::ImageTiling in_tiling, std::vector& out_result) const { /* TODO: It might be a good idea to cache the retrieved properties */ @@ -830,11 +874,11 @@ bool Anvil::PhysicalDevice::get_sparse_image_format_properties(VkFormat out_result.clear(); vkGetPhysicalDeviceSparseImageFormatProperties(m_physical_device, - in_format, - in_type, - in_sample_count, + static_cast (in_format), + static_cast(in_type), + static_cast(in_sample_count), in_usage, - in_tiling, + static_cast(in_tiling), &n_properties, nullptr); /* pProperties */ @@ -843,13 +887,13 @@ bool Anvil::PhysicalDevice::get_sparse_image_format_properties(VkFormat out_result.resize(n_properties); vkGetPhysicalDeviceSparseImageFormatProperties(m_physical_device, - in_format, - in_type, - in_sample_count, - in_usage, - in_tiling, - &n_properties, - &out_result[0]); + static_cast (in_format), + static_cast (in_type), + static_cast(in_sample_count), + in_usage, + static_cast(in_tiling), + &n_properties, + &out_result[0]); } return true; @@ -870,3 +914,18 @@ bool Anvil::PhysicalDevice::is_layer_supported(const std::string& in_layer_name) m_layers.end(), in_layer_name) != m_layers.end(); } + +/* Adjusts the device group index for this physical device. + * + * @param new_device_group_index New device group index to assign. Must not be 0. + */ +void Anvil::PhysicalDevice::set_device_group_index(uint32_t in_new_device_group_index) +{ + m_device_group_index = in_new_device_group_index; +} + +/** TODO */ +void Anvil::PhysicalDevice::set_device_group_device_index(uint32_t in_new_device_group_device_index) +{ + m_device_group_device_index = in_new_device_group_device_index; +} diff --git a/src/wrappers/queue.cpp b/src/wrappers/queue.cpp index 184d1cfd..a698bbf8 100644 --- a/src/wrappers/queue.cpp +++ b/src/wrappers/queue.cpp @@ -100,6 +100,27 @@ bool Anvil::Queue::bind_sparse_memory(Anvil::SparseMemoryBindingUpdateInfo& in_u &bind_info_items, &fence_ptr); + /* If any of the bindings we are about to request requires non-zero memory or resource device indices, + * make sure we're using a mGPU device */ + if (in_update.is_device_group_support_required() ) + { + const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr)); + + if (mgpu_device_ptr == nullptr) + { + anvil_assert(mgpu_device_ptr != nullptr); + + goto end; + } + + if (!mgpu_device_ptr->is_extension_enabled(VK_KHR_DEVICE_GROUP_EXTENSION_NAME) ) + { + anvil_assert(mgpu_device_ptr->is_extension_enabled(VK_KHR_DEVICE_GROUP_EXTENSION_NAME)); + + goto end; + } + } + if (mt_safe) { bind_sparse_memory_lock_unlock(in_update, @@ -225,6 +246,7 @@ bool Anvil::Queue::bind_sparse_memory(Anvil::SparseMemoryBindingUpdateInfo& in_u } } +end: return (result == VK_SUCCESS); } @@ -413,6 +435,289 @@ VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, uint32_t in_n_wait_semaphores, Anvil::Semaphore* const* in_wait_semaphore_ptrs) { + static const uint32_t device_mask = 0x1; + + return present_internal(VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR, + 1, /* n_swapchain_image_indices */ + &in_swapchain_ptr, + &in_swapchain_image_index, + &device_mask, + in_n_wait_semaphores, + in_wait_semaphore_ptrs); +} + +/** Please see header for specification */ +VkResult Anvil::Queue::present_in_local_presentation_mode(uint32_t in_n_local_mode_presentation_items, + const LocalModePresentationItem* in_local_mode_presentation_items, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs) +{ + const Anvil::DeviceType device_type (m_device_ptr->get_type() ); + uint32_t n_swapchains; + VkResult result; + + uint32_t device_masks [MAX_SWAPCHAINS]; + uint32_t swapchain_image_indices[MAX_SWAPCHAINS]; + Anvil::Swapchain* swapchains [MAX_SWAPCHAINS]; + + if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) + { + const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr) ); + + ANVIL_REDUNDANT_VARIABLE(sgpu_device_ptr); + + anvil_assert(in_n_local_mode_presentation_items == 1); + anvil_assert(in_local_mode_presentation_items[0].physical_device_ptr->get_physical_device() == sgpu_device_ptr->get_physical_device()->get_physical_device() ); + + device_masks[0] = 0x1; + n_swapchains = 1; + swapchain_image_indices[0] = in_local_mode_presentation_items[0].swapchain_image_index; + swapchains[0] = in_local_mode_presentation_items[0].swapchain_ptr; + } + else + { + anvil_assert(device_type == Anvil::DEVICE_TYPE_MULTI_GPU); + anvil_assert(in_n_local_mode_presentation_items < MAX_SWAPCHAINS); + + n_swapchains = in_n_local_mode_presentation_items; + + for (uint32_t n_item = 0; + n_item < in_n_local_mode_presentation_items; + ++n_item) + { + const auto current_item_ptr = in_local_mode_presentation_items + n_item; + + device_masks [n_item] = (1u << current_item_ptr->physical_device_ptr->get_device_group_device_index()); + swapchains [n_item] = current_item_ptr->swapchain_ptr; + swapchain_image_indices[n_item] = current_item_ptr->swapchain_image_index; + } + } + + result = present_internal(VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR, + n_swapchains, + swapchains, + swapchain_image_indices, + device_masks, + in_n_wait_semaphores, + in_wait_semaphore_ptrs); + + return result; +} + +/** Please see header for specification */ +VkResult Anvil::Queue::present_in_local_multi_device_presentation_mode(uint32_t in_n_local_multi_device_mode_presentation_items, + const Anvil::LocalMultiDeviceModePresentationItem* in_local_multi_device_mode_presentation_items, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs) +{ + uint32_t n_swapchains; + VkResult result; + + uint32_t device_masks [MAX_SWAPCHAINS]; + uint32_t swapchain_image_indices[MAX_SWAPCHAINS]; + Anvil::Swapchain* swapchains [MAX_SWAPCHAINS]; + + anvil_assert(in_n_local_multi_device_mode_presentation_items < MAX_SWAPCHAINS); + + n_swapchains = in_n_local_multi_device_mode_presentation_items; + + for (uint32_t n_item = 0; + n_item < in_n_local_multi_device_mode_presentation_items; + ++n_item) + { + const auto current_item_ptr(in_local_multi_device_mode_presentation_items + n_item); + uint32_t device_mask (0); + + for (uint32_t n_physical_device = 0; + n_physical_device < current_item_ptr->n_physical_devices; + ++n_physical_device) + { + const uint32_t device_index = current_item_ptr->physical_devices_ptr[n_physical_device]->get_device_group_device_index(); + + device_mask |= 1 << device_index; + } + + device_masks [n_item] = device_mask; + swapchains [n_item] = current_item_ptr->swapchain_ptr; + swapchain_image_indices[n_item] = current_item_ptr->swapchain_image_index; + } + + result = present_internal(VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR, + n_swapchains, + swapchains, + swapchain_image_indices, + device_masks, + in_n_wait_semaphores, + in_wait_semaphore_ptrs); + + return result; +} + +/** Please see header for specification */ +VkResult Anvil::Queue::present_in_remote_presentation_mode(uint32_t in_n_remote_mode_presentation_items, + const Anvil::RemoteModePresentationItem* in_remote_mode_presentation_items, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs) +{ + const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr)); + uint32_t n_swapchains; + VkResult result; + + uint32_t device_masks [MAX_SWAPCHAINS]; + uint32_t swapchain_image_indices[MAX_SWAPCHAINS]; + Anvil::Swapchain* swapchains [MAX_SWAPCHAINS]; + + ANVIL_REDUNDANT_VARIABLE_CONST(mgpu_device_ptr); + anvil_assert (mgpu_device_ptr != nullptr); + anvil_assert (in_n_remote_mode_presentation_items < MAX_SWAPCHAINS); + + n_swapchains = in_n_remote_mode_presentation_items; + + for (uint32_t n_item = 0; + n_item < in_n_remote_mode_presentation_items; + ++n_item) + { + const auto current_item_ptr = in_remote_mode_presentation_items + n_item; + const uint32_t device_index = current_item_ptr->physical_device_ptr->get_device_group_device_index(); + + #if defined(_DEBUG) + { + const std::vector* present_compatible_physical_devices_ptr; + + mgpu_device_ptr->get_present_compatible_physical_devices(device_index, + &present_compatible_physical_devices_ptr); + + anvil_assert(present_compatible_physical_devices_ptr->size() > 0); + } + #endif + + device_masks [n_item] = (1u << device_index); + swapchains [n_item] = current_item_ptr->swapchain_ptr; + swapchain_image_indices[n_item] = current_item_ptr->swapchain_image_index; + } + + result = present_internal(VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR, + n_swapchains, + swapchains, + swapchain_image_indices, + device_masks, + in_n_wait_semaphores, + in_wait_semaphore_ptrs); + + return result; +} + +/** Please see header for specification */ +VkResult Anvil::Queue::present_in_sum_presentation_mode(uint32_t in_n_sum_mode_presentation_items, + const Anvil::SumModePresentationItem* in_sum_mode_presentation_items, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs) +{ + const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr)); + uint32_t n_swapchains; + VkResult result; + + uint32_t device_masks [MAX_SWAPCHAINS]; + uint32_t swapchain_image_indices[MAX_SWAPCHAINS]; + Anvil::Swapchain* swapchains [MAX_SWAPCHAINS]; + + ANVIL_REDUNDANT_VARIABLE_CONST(mgpu_device_ptr); + anvil_assert (mgpu_device_ptr != nullptr); + anvil_assert (in_n_sum_mode_presentation_items < MAX_SWAPCHAINS); + + n_swapchains = in_n_sum_mode_presentation_items; + + for (uint32_t n_item = 0; + n_item < in_n_sum_mode_presentation_items; + ++n_item) + { + const auto current_item_ptr (in_sum_mode_presentation_items + n_item); + uint32_t device_mask (0); + + #ifdef _DEBUG + const uint32_t n_physical_devices = mgpu_device_ptr->get_n_physical_devices(); + bool request_supported = false; + + anvil_assert(mgpu_device_ptr->get_supported_present_modes_for_surface(current_item_ptr->swapchain_ptr->get_create_info_ptr()->get_rendering_surface() )); + + /* Make sure at least one physical device supports SUM presentation mode for all the specified physical devices */ + for (uint32_t n_physical_device = 0; + n_physical_device < n_physical_devices && !request_supported; + ++n_physical_device) + { + const std::vector* compatible_physical_devices_ptr; + + if (!mgpu_device_ptr->get_present_compatible_physical_devices(n_physical_device, + &compatible_physical_devices_ptr) ) + { + anvil_assert_fail(); + + continue; + } + + request_supported = true; + + for (uint32_t n_checked_physical_device = 0; + n_checked_physical_device < current_item_ptr->n_physical_devices && request_supported; + ++n_checked_physical_device) + { + const auto& physical_device_ptr = current_item_ptr->physical_devices_ptr[n_checked_physical_device]; + bool match_found = false; + + for (uint32_t n_compatible_physical_device = 0; + n_compatible_physical_device < compatible_physical_devices_ptr->size() && !match_found; + ++n_compatible_physical_device) + { + auto compatible_physical_device_ptr = compatible_physical_devices_ptr->at(n_compatible_physical_device); + + if (compatible_physical_device_ptr == physical_device_ptr) + { + match_found = true; + } + } + + request_supported = match_found; + } + } + + anvil_assert(request_supported); + #endif + + for (uint32_t n_physical_device = 0; + n_physical_device < current_item_ptr->n_physical_devices; + ++n_physical_device) + { + const uint32_t device_index = current_item_ptr->physical_devices_ptr[n_physical_device]->get_device_group_device_index(); + + device_mask |= 1 << device_index; + } + + device_masks [n_item] = device_mask; + swapchains [n_item] = current_item_ptr->swapchain_ptr; + swapchain_image_indices[n_item] = current_item_ptr->swapchain_image_index; + } + + result = present_internal(VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR, + n_swapchains, + swapchains, + swapchain_image_indices, + device_masks, + in_n_wait_semaphores, + in_wait_semaphore_ptrs); + + return result; +} + +/** Please see header for specification */ +VkResult Anvil::Queue::present_internal(VkDeviceGroupPresentModeFlagBitsKHR in_presentation_mode, + uint32_t in_n_swapchains, + Anvil::Swapchain* const* in_swapchains, + const uint32_t* in_swapchain_image_indices, + const uint32_t* in_device_masks, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs) +{ + const Anvil::DeviceType device_type (m_device_ptr->get_type() ); VkResult presentation_results [MAX_SWAPCHAINS]; VkResult result; Anvil::StructChainer struct_chainer; @@ -420,14 +725,25 @@ VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, VkSwapchainKHR swapchains_vk [MAX_SWAPCHAINS]; std::vector wait_semaphores_vk (in_n_wait_semaphores); + /* Sanity checks */ + anvil_assert(in_n_swapchains < MAX_SWAPCHAINS); + anvil_assert(in_swapchains != nullptr); + + if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) + { + anvil_assert(*in_device_masks == 1); + anvil_assert(in_n_swapchains == 1); + anvil_assert(in_presentation_mode == VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR); + } + /* If the application is only interested in off-screen rendering, do *not* post the present request, * since the fake swapchain image is not presentable. We still have to wait on the user-specified * semaphores though. */ - if (in_swapchain_ptr != nullptr) + if (in_swapchains[0] != nullptr) { Anvil::Window* window_ptr = nullptr; - window_ptr = in_swapchain_ptr->get_create_info_ptr()->get_window(); + window_ptr = in_swapchains[0]->get_create_info_ptr()->get_window(); if (window_ptr != nullptr) { @@ -449,10 +765,10 @@ VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, ); for (uint32_t n_presentation = 0; - n_presentation < 1; + n_presentation < in_n_swapchains; ++n_presentation) { - OnPresentRequestIssuedCallbackArgument callback_argument(in_swapchain_ptr); + OnPresentRequestIssuedCallbackArgument callback_argument(in_swapchains[n_presentation]); CallbacksSupportProvider::callback(QUEUE_CALLBACK_ID_PRESENT_REQUEST_ISSUED, &callback_argument); @@ -466,10 +782,12 @@ VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, /* Convert arrays of Anvil objects to raw Vulkan handle arrays */ for (uint32_t n_swapchain = 0; - n_swapchain < 1; + n_swapchain < in_n_swapchains; ++n_swapchain) { - swapchains_vk[n_swapchain] = in_swapchain_ptr->get_swapchain_vk(); + anvil_assert(in_swapchains[n_swapchain] != nullptr); + + swapchains_vk[n_swapchain] = in_swapchains[n_swapchain]->get_swapchain_vk(); } for (uint32_t n_wait_semaphore = 0; @@ -482,22 +800,36 @@ VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, { VkPresentInfoKHR image_presentation_info; - image_presentation_info.pImageIndices = &in_swapchain_image_index; + image_presentation_info.pImageIndices = in_swapchain_image_indices; image_presentation_info.pNext = nullptr; image_presentation_info.pResults = presentation_results; image_presentation_info.pSwapchains = swapchains_vk; image_presentation_info.pWaitSemaphores = (in_n_wait_semaphores != 0) ? &wait_semaphores_vk.at(0) : nullptr; image_presentation_info.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR; - image_presentation_info.swapchainCount = 1; + image_presentation_info.swapchainCount = in_n_swapchains; image_presentation_info.waitSemaphoreCount = in_n_wait_semaphores; struct_chainer.append_struct(image_presentation_info); } + /* For multi-GPU support, we're likely going to need to attach the VkDeviceGroupPresentInfoKHR struct */ + if (device_type == Anvil::DEVICE_TYPE_MULTI_GPU) + { + VkDeviceGroupPresentInfoKHR device_group_present_info; + + device_group_present_info.mode = in_presentation_mode; + device_group_present_info.pDeviceMasks = in_device_masks; + device_group_present_info.pNext = nullptr; + device_group_present_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR; + device_group_present_info.swapchainCount = in_n_swapchains; + + struct_chainer.append_struct(device_group_present_info); + } + swapchain_entrypoints_ptr = &m_device_ptr->get_extension_khr_swapchain_entrypoints(); - present_lock_unlock(1, - &in_swapchain_ptr, + present_lock_unlock(in_n_swapchains, + in_swapchains, in_n_wait_semaphores, in_wait_semaphore_ptrs, true); @@ -507,8 +839,8 @@ VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, result = swapchain_entrypoints_ptr->vkQueuePresentKHR(m_queue, chain_ptr->get_root_struct() ); } - present_lock_unlock(1, - &in_swapchain_ptr, + present_lock_unlock(in_n_swapchains, + in_swapchains, in_n_wait_semaphores, in_wait_semaphore_ptrs, false); @@ -518,7 +850,7 @@ VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, if (is_vk_call_successful(result) ) { for (uint32_t n_presentation = 0; - n_presentation < 1; + n_presentation < in_n_swapchains; ++n_presentation) { anvil_assert(is_vk_call_successful(presentation_results[n_presentation])); @@ -576,7 +908,7 @@ VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, } { - OnPresentRequestIssuedCallbackArgument callback_argument(in_swapchain_ptr); + OnPresentRequestIssuedCallbackArgument callback_argument(in_swapchains[n_presentation]); CallbacksSupportProvider::callback(QUEUE_CALLBACK_ID_PRESENT_REQUEST_ISSUED, &callback_argument); @@ -645,11 +977,88 @@ bool Anvil::Queue::submit(const Anvil::SubmitInfo& in_submit_info) std::vector signal_semaphores_vk(in_submit_info.get_n_signal_semaphores() ); std::vector wait_semaphores_vk (in_submit_info.get_n_wait_semaphores () ); + std::vector cmd_buffer_device_masks = std::vector(in_submit_info.get_n_command_buffers() ); + std::vector signal_semaphore_device_indices = std::vector(in_submit_info.get_n_signal_semaphores() ); + std::vector wait_semaphore_device_indices = std::vector(in_submit_info.get_n_wait_semaphores () ); + ANVIL_REDUNDANT_VARIABLE(result); /* Prepare for the submission */ switch (in_submit_info.get_type() ) { + case SubmissionType::MGPU: + { + uint32_t n_cmd_buffers = 0; + + for (uint32_t n_command_buffer_submission = 0; + n_command_buffer_submission < in_submit_info.get_n_command_buffers(); + ++n_command_buffer_submission) + { + const auto& current_submission = in_submit_info.get_command_buffers_mgpu()[n_command_buffer_submission]; + + if (current_submission.cmd_buffer_ptr != nullptr) + { + cmd_buffers_vk.at (n_cmd_buffers) = current_submission.cmd_buffer_ptr->get_command_buffer(); + cmd_buffer_device_masks.at(n_cmd_buffers) = current_submission.device_mask; + + ++n_cmd_buffers; + } + } + + for (uint32_t n_signal_semaphore_submission = 0; + n_signal_semaphore_submission < in_submit_info.get_n_signal_semaphores(); + ++n_signal_semaphore_submission) + { + const auto& current_submission = in_submit_info.get_signal_semaphores_mgpu()[n_signal_semaphore_submission]; + + signal_semaphore_device_indices.at(n_signal_semaphore_submission) = current_submission.physical_device_ptr->get_device_group_device_index(); + signal_semaphores_vk.at (n_signal_semaphore_submission) = current_submission.semaphore_ptr->get_semaphore(); + } + + for (uint32_t n_wait_semaphore_submission = 0; + n_wait_semaphore_submission < in_submit_info.get_n_wait_semaphores(); + ++n_wait_semaphore_submission) + { + const auto& current_submission = in_submit_info.get_wait_semaphores_mgpu()[n_wait_semaphore_submission]; + + wait_semaphore_device_indices.at(n_wait_semaphore_submission) = current_submission.physical_device_ptr->get_device_group_device_index(); + wait_semaphores_vk.at (n_wait_semaphore_submission) = current_submission.semaphore_ptr->get_semaphore(); + } + + { + VkSubmitInfo submit_info; + + submit_info.commandBufferCount = in_submit_info.get_n_command_buffers(); + submit_info.pCommandBuffers = (submit_info.commandBufferCount != 0) ? &cmd_buffers_vk.at(0) : nullptr; + submit_info.pNext = nullptr; + submit_info.pSignalSemaphores = (in_submit_info.get_n_signal_semaphores() != 0) ? &signal_semaphores_vk.at(0) : nullptr; + submit_info.pWaitDstStageMask = in_submit_info.get_destination_stage_wait_masks(); + submit_info.pWaitSemaphores = (in_submit_info.get_n_wait_semaphores() != 0) ? &wait_semaphores_vk.at(0) : nullptr; + submit_info.signalSemaphoreCount = in_submit_info.get_n_signal_semaphores(); + submit_info.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO; + submit_info.waitSemaphoreCount = in_submit_info.get_n_wait_semaphores(); + + struct_chainer.append_struct(submit_info); + } + + { + VkDeviceGroupSubmitInfoKHR submit_info_device_group; + + submit_info_device_group.commandBufferCount = n_cmd_buffers; + submit_info_device_group.pCommandBufferDeviceMasks = (n_cmd_buffers != 0) ? &cmd_buffer_device_masks.at(0) : nullptr; + submit_info_device_group.pNext = nullptr; + submit_info_device_group.pSignalSemaphoreDeviceIndices = (in_submit_info.get_n_signal_semaphores() != 0) ? &signal_semaphore_device_indices.at(0) : nullptr; + submit_info_device_group.pWaitSemaphoreDeviceIndices = (in_submit_info.get_n_wait_semaphores () != 0) ? &wait_semaphore_device_indices.at (0) : nullptr; + submit_info_device_group.signalSemaphoreCount = in_submit_info.get_n_signal_semaphores(); + submit_info_device_group.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHR; + submit_info_device_group.waitSemaphoreCount = in_submit_info.get_n_wait_semaphores(); + + struct_chainer.append_struct(submit_info_device_group); + } + + break; + } + case SubmissionType::SGPU: { VkSubmitInfo submit_info; @@ -731,6 +1140,20 @@ bool Anvil::Queue::submit(const Anvil::SubmitInfo& in_submit_info) switch (in_submit_info.get_type() ) { + case SubmissionType::MGPU: + { + submit_command_buffers_lock_unlock(in_submit_info.get_n_command_buffers (), + in_submit_info.get_command_buffers_mgpu (), + in_submit_info.get_n_signal_semaphores (), + in_submit_info.get_signal_semaphores_mgpu(), + in_submit_info.get_n_wait_semaphores (), + in_submit_info.get_wait_semaphores_mgpu (), + fence_ptr, + true); + + break; + } + case SubmissionType::SGPU: { submit_command_buffers_lock_unlock(in_submit_info.get_n_command_buffers (), @@ -762,7 +1185,7 @@ bool Anvil::Queue::submit(const Anvil::SubmitInfo& in_submit_info) result = vkQueueSubmit(m_queue, 1, /* submitCount */ chain_ptr->get_root_struct(), - (fence_ptr != nullptr) ? fence_ptr->get_fence() + (fence_ptr != nullptr) ? fence_ptr->get_fence() : VK_NULL_HANDLE); if (in_submit_info.get_should_block() ) @@ -778,6 +1201,20 @@ bool Anvil::Queue::submit(const Anvil::SubmitInfo& in_submit_info) switch (in_submit_info.get_type() ) { + case SubmissionType::MGPU: + { + submit_command_buffers_lock_unlock(in_submit_info.get_n_command_buffers (), + in_submit_info.get_command_buffers_mgpu (), + in_submit_info.get_n_signal_semaphores (), + in_submit_info.get_signal_semaphores_mgpu(), + in_submit_info.get_n_wait_semaphores (), + in_submit_info.get_wait_semaphores_mgpu (), + fence_ptr, + false); /* in_should_lock */ + + break; + } + case SubmissionType::SGPU: { submit_command_buffers_lock_unlock(in_submit_info.get_n_command_buffers (), @@ -874,6 +1311,84 @@ void Anvil::Queue::submit_command_buffers_lock_unlock(uint32_t } } +void Anvil::Queue::submit_command_buffers_lock_unlock(uint32_t in_n_command_buffer_submissions, + const CommandBufferMGPUSubmission* in_opt_command_buffer_submissions_ptr, + uint32_t in_n_signal_semaphore_submissions, + const SemaphoreMGPUSubmission* in_opt_signal_semaphore_submissions_ptr, + uint32_t in_n_wait_semaphore_submissions, + const SemaphoreMGPUSubmission* in_opt_wait_semaphore_submissions_ptr, + Anvil::Fence* in_opt_fence_ptr, + bool in_should_lock) +{ + if (in_should_lock) + { + lock(); + } + else + { + unlock(); + } + + for (uint32_t n_command_buffer_submission = 0; + n_command_buffer_submission < in_n_command_buffer_submissions; + ++n_command_buffer_submission) + { + const auto& current_submission = in_opt_command_buffer_submissions_ptr[n_command_buffer_submission]; + + if (current_submission.cmd_buffer_ptr != nullptr) + { + if (in_should_lock) + { + current_submission.cmd_buffer_ptr->lock(); + } + else + { + current_submission.cmd_buffer_ptr->unlock(); + } + } + } + + for (uint32_t n_signal_semaphore_submission = 0; + n_signal_semaphore_submission < in_n_signal_semaphore_submissions; + ++n_signal_semaphore_submission) + { + if (in_should_lock) + { + in_opt_signal_semaphore_submissions_ptr[n_signal_semaphore_submission].semaphore_ptr->lock(); + } + else + { + in_opt_signal_semaphore_submissions_ptr[n_signal_semaphore_submission].semaphore_ptr->unlock(); + } + } + + for (uint32_t n_wait_semaphore_submission = 0; + n_wait_semaphore_submission < in_n_wait_semaphore_submissions; + ++n_wait_semaphore_submission) + { + if (in_should_lock) + { + in_opt_wait_semaphore_submissions_ptr[n_wait_semaphore_submission].semaphore_ptr->lock(); + } + else + { + in_opt_wait_semaphore_submissions_ptr[n_wait_semaphore_submission].semaphore_ptr->unlock(); + } + } + + if (in_opt_fence_ptr != nullptr) + { + if (in_should_lock) + { + in_opt_fence_ptr->lock(); + } + else + { + in_opt_fence_ptr->unlock(); + } + } +} + void Anvil::Queue::wait_idle() { lock(); @@ -881,4 +1396,4 @@ void Anvil::Queue::wait_idle() vkQueueWaitIdle(m_queue); } unlock(); -} +} \ No newline at end of file diff --git a/src/wrappers/render_pass.cpp b/src/wrappers/render_pass.cpp index a9caae19..929d858d 100644 --- a/src/wrappers/render_pass.cpp +++ b/src/wrappers/render_pass.cpp @@ -23,6 +23,7 @@ #include "misc/debug.h" #include "misc/object_tracker.h" #include "misc/render_pass_create_info.h" +#include "misc/struct_chainer.h" #include "wrappers/device.h" #include "wrappers/graphics_pipeline_manager.h" #include "wrappers/pipeline_layout.h" @@ -66,12 +67,13 @@ Anvil::RenderPass::~RenderPass() /* Please see header for specification */ bool Anvil::RenderPass::init() { - std::vector renderpass_attachments_vk; - VkRenderPassCreateInfo render_pass_create_info; - bool result (false); - VkResult result_vk; - std::vector subpass_dependencies_vk; - std::vector subpass_descriptions_vk; + std::vector > input_attachment_aspect_reference_ptrs; + std::vector renderpass_attachments_vk; + Anvil::StructChainer render_pass_create_info_chainer; + bool result (false); + VkResult result_vk; + std::vector subpass_dependencies_vk; + std::vector subpass_descriptions_vk; /* NOTE: We need to reserve storage in advance for each of the vectors below, * so that it is guaranteed the push_back() calls do not cause a realloc() @@ -144,11 +146,11 @@ bool Anvil::RenderPass::init() { VkAttachmentDescription attachment_vk; - attachment_vk.finalLayout = renderpass_attachment_iterator->final_layout; + attachment_vk.finalLayout = static_cast(renderpass_attachment_iterator->final_layout); attachment_vk.flags = (renderpass_attachment_iterator->may_alias) ? VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT : 0u; - attachment_vk.format = renderpass_attachment_iterator->format; - attachment_vk.initialLayout = renderpass_attachment_iterator->initial_layout; + attachment_vk.format = static_cast(renderpass_attachment_iterator->format); + attachment_vk.initialLayout = static_cast(renderpass_attachment_iterator->initial_layout); attachment_vk.loadOp = renderpass_attachment_iterator->color_depth_load_op; attachment_vk.samples = static_cast(renderpass_attachment_iterator->sample_count); attachment_vk.stencilLoadOp = renderpass_attachment_iterator->stencil_load_op; @@ -164,7 +166,7 @@ bool Anvil::RenderPass::init() { VkSubpassDependency dependency_vk; - dependency_vk.dependencyFlags = ((subpass_dependency_iterator->by_region) ? VK_DEPENDENCY_BY_REGION_BIT : 0u); + dependency_vk.dependencyFlags = subpass_dependency_iterator->flags; dependency_vk.dstAccessMask = subpass_dependency_iterator->destination_access_mask; dependency_vk.dstStageMask = subpass_dependency_iterator->destination_stage_mask; dependency_vk.dstSubpass = (subpass_dependency_iterator->destination_subpass_ptr != nullptr) ? subpass_dependency_iterator->destination_subpass_ptr->index @@ -186,11 +188,12 @@ bool Anvil::RenderPass::init() uint32_t highest_subpass_color_attachment_location = UINT32_MAX; uint32_t highest_subpass_input_attachment_index = UINT32_MAX; bool need_color_resolve_attachments = false; + const uint32_t subpass_index = static_cast(subpass_iterator - m_render_pass_create_info_ptr->m_subpasses.begin() ); VkSubpassDescription subpass_vk; VkAttachmentReference unused_reference; unused_reference.attachment = VK_ATTACHMENT_UNUSED; - unused_reference.layout = VK_IMAGE_LAYOUT_UNDEFINED; + unused_reference.layout = static_cast(Anvil::ImageLayout::UNDEFINED); /* Determine whether any of the color attachments are going to be resolved. */ for (auto subpass_color_attachment_iterator = (*subpass_iterator)->color_attachments_map.cbegin(); @@ -331,23 +334,77 @@ bool Anvil::RenderPass::init() } /* Set up a create info descriptor and spawn a new Vulkan RenderPass object. */ - render_pass_create_info.attachmentCount = static_cast(m_render_pass_create_info_ptr->m_attachments.size () ); - render_pass_create_info.dependencyCount = static_cast(m_render_pass_create_info_ptr->m_subpass_dependencies.size() ); - render_pass_create_info.subpassCount = static_cast(m_render_pass_create_info_ptr->m_subpasses.size () ); - render_pass_create_info.flags = 0; - render_pass_create_info.pAttachments = (render_pass_create_info.attachmentCount > 0) ? &renderpass_attachments_vk.at(0) - : nullptr; - render_pass_create_info.pDependencies = (render_pass_create_info.dependencyCount > 0) ? &subpass_dependencies_vk.at(0) - : nullptr; - render_pass_create_info.pNext = nullptr; - render_pass_create_info.pSubpasses = (render_pass_create_info.subpassCount > 0) ? &subpass_descriptions_vk.at(0) - : nullptr; - render_pass_create_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO; - - result_vk = vkCreateRenderPass(m_device_ptr->get_device_vk(), - &render_pass_create_info, - nullptr, /* pAllocator */ - &m_render_pass); + { + VkRenderPassCreateInfo render_pass_create_info; + + render_pass_create_info.attachmentCount = static_cast(m_render_pass_create_info_ptr->m_attachments.size () ); + render_pass_create_info.dependencyCount = static_cast(m_render_pass_create_info_ptr->m_subpass_dependencies.size() ); + render_pass_create_info.subpassCount = static_cast(m_render_pass_create_info_ptr->m_subpasses.size () ); + render_pass_create_info.flags = 0; + render_pass_create_info.pAttachments = (render_pass_create_info.attachmentCount > 0) ? &renderpass_attachments_vk.at(0) + : nullptr; + render_pass_create_info.pDependencies = (render_pass_create_info.dependencyCount > 0) ? &subpass_dependencies_vk.at(0) + : nullptr; + render_pass_create_info.pNext = nullptr; + render_pass_create_info.pSubpasses = (render_pass_create_info.subpassCount > 0) ? &subpass_descriptions_vk.at(0) + : nullptr; + render_pass_create_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO; + + render_pass_create_info_chainer.append_struct(render_pass_create_info); + } + + /* Also chain info regarding aspects accessed by input attachments, if KHR_maintenance2 is supported and relevant info + * has been provided at attachment addition time. + */ + if (m_device_ptr->is_extension_enabled(VK_KHR_MAINTENANCE2_EXTENSION_NAME) ) + { + for (auto subpass_iterator = m_render_pass_create_info_ptr->m_subpasses.cbegin(); + subpass_iterator != m_render_pass_create_info_ptr->m_subpasses.cend(); + ++subpass_iterator) + { + const auto current_subpass_index = (*subpass_iterator)->index; + + for (auto subpass_input_attachment_iterator = (*subpass_iterator)->input_attachments_map.cbegin(); + subpass_input_attachment_iterator != (*subpass_iterator)->input_attachments_map.cend(); + ++subpass_input_attachment_iterator) + { + const auto& current_attachment_accessed_aspects = subpass_input_attachment_iterator->second.aspects_accessed; + const auto& current_attachment_index = subpass_input_attachment_iterator->first; + + if (current_attachment_accessed_aspects != Anvil::ImageAspectFlagBits::IMAGE_ASPECT_UNKNOWN) + { + std::unique_ptr attachment_aspect_reference_info_ptr(new VkInputAttachmentAspectReferenceKHR() ); + + attachment_aspect_reference_info_ptr->aspectMask = static_cast(current_attachment_accessed_aspects); + attachment_aspect_reference_info_ptr->inputAttachmentIndex = current_attachment_index; + attachment_aspect_reference_info_ptr->subpass = current_subpass_index; + + input_attachment_aspect_reference_ptrs.push_back( std::move(attachment_aspect_reference_info_ptr) ); + } + } + } + + if (input_attachment_aspect_reference_ptrs.size() > 0) + { + VkRenderPassInputAttachmentAspectCreateInfoKHR input_attachment_aspect_create_info; + + input_attachment_aspect_create_info.aspectReferenceCount = static_cast(input_attachment_aspect_reference_ptrs.size() ); + input_attachment_aspect_create_info.pAspectReferences = reinterpret_cast(&input_attachment_aspect_reference_ptrs.at(0) ); + input_attachment_aspect_create_info.pNext = nullptr; + input_attachment_aspect_create_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO_KHR; + + render_pass_create_info_chainer.append_struct(input_attachment_aspect_create_info); + } + } + + { + auto create_info_chain_ptr = render_pass_create_info_chainer.create_chain(); + + result_vk = vkCreateRenderPass(m_device_ptr->get_device_vk(), + create_info_chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_render_pass); + } if (!is_vk_call_successful(result_vk) ) { diff --git a/src/wrappers/rendering_surface.cpp b/src/wrappers/rendering_surface.cpp index c60a97c5..ab14a118 100644 --- a/src/wrappers/rendering_surface.cpp +++ b/src/wrappers/rendering_surface.cpp @@ -79,6 +79,7 @@ void Anvil::RenderingSurface::cache_surface_properties() const Anvil::DeviceType& device_type (m_device_ptr->get_type() ); bool is_offscreen_rendering_enabled(true); auto khr_surface_entrypoints (m_instance_ptr->get_extension_khr_surface_entrypoints() ); + const Anvil::MGPUDevice* mgpu_device_ptr (dynamic_cast(m_device_ptr)); uint32_t n_physical_devices (0); const Anvil::SGPUDevice* sgpu_device_ptr (dynamic_cast(m_device_ptr)); std::vector supported_formats; @@ -107,7 +108,8 @@ void Anvil::RenderingSurface::cache_surface_properties() switch (device_type) { - case Anvil::DEVICE_TYPE_SINGLE_GPU: n_physical_devices = 1; break; + case Anvil::DEVICE_TYPE_MULTI_GPU: n_physical_devices = mgpu_device_ptr->get_n_physical_devices(); break; + case Anvil::DEVICE_TYPE_SINGLE_GPU: n_physical_devices = 1; break; default: { @@ -130,7 +132,8 @@ void Anvil::RenderingSurface::cache_surface_properties() switch (device_type) { - case Anvil::DEVICE_TYPE_SINGLE_GPU: physical_device_ptr = sgpu_device_ptr->get_physical_device(); break; + case Anvil::DEVICE_TYPE_MULTI_GPU: physical_device_ptr = mgpu_device_ptr->get_physical_device(n_physical_device); break; + case Anvil::DEVICE_TYPE_SINGLE_GPU: physical_device_ptr = sgpu_device_ptr->get_physical_device(); break; default: { @@ -138,16 +141,16 @@ void Anvil::RenderingSurface::cache_surface_properties() } } - auto& result_caps = m_physical_device_capabilities[0]; + auto& result_caps = m_physical_device_capabilities[physical_device_ptr->get_device_group_device_index()]; if (m_surface == VK_NULL_HANDLE) { result_caps.supported_composite_alpha_flags = VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR; result_caps.supported_transformations = VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR; - result_caps.supported_usages = static_cast (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | - VK_IMAGE_USAGE_TRANSFER_SRC_BIT | - VK_IMAGE_USAGE_TRANSFER_DST_BIT | - VK_IMAGE_USAGE_STORAGE_BIT); + result_caps.supported_usages = static_cast (Anvil::IMAGE_USAGE_FLAG_COLOR_ATTACHMENT_BIT | + Anvil::IMAGE_USAGE_FLAG_TRANSFER_SRC_BIT | + Anvil::IMAGE_USAGE_FLAG_TRANSFER_DST_BIT | + Anvil::IMAGE_USAGE_FLAG_STORAGE_BIT); result_caps.supported_presentation_modes.push_back(VK_PRESENT_MODE_IMMEDIATE_KHR); @@ -175,7 +178,7 @@ void Anvil::RenderingSurface::cache_surface_properties() result_caps.supported_composite_alpha_flags = static_cast (result_caps.capabilities.supportedCompositeAlpha); result_caps.supported_transformations = static_cast(result_caps.capabilities.supportedTransforms); - result_caps.supported_usages = static_cast (result_caps.capabilities.supportedUsageFlags); + result_caps.supported_usages = static_cast (result_caps.capabilities.supportedUsageFlags); /* Retrieve a list of formats supported by the surface */ result = khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceFormatsKHR(physical_device_vk, @@ -201,7 +204,10 @@ void Anvil::RenderingSurface::cache_surface_properties() result_caps.supported_formats.push_back(RenderingSurfaceFormat(supported_formats[n_format]) ); } - /* Retrieve a list of supported presentation modes */ + /* Retrieve a list of supported presentation modes + * + * NOTE: In case of mGPU devices, n_supported_presentation_modes may actually be 0 here for slave devices. + */ result = khr_surface_entrypoints.vkGetPhysicalDeviceSurfacePresentModesKHR(physical_device_vk, m_surface, &n_supported_presentation_modes, @@ -250,9 +256,10 @@ Anvil::RenderingSurfaceUniquePtr Anvil::RenderingSurface::create(Anvil::Instance } /* Please see header for specification */ -bool Anvil::RenderingSurface::get_capabilities(VkSurfaceCapabilitiesKHR* out_surface_caps_ptr) const +bool Anvil::RenderingSurface::get_capabilities(const Anvil::PhysicalDevice* in_physical_device_ptr, + VkSurfaceCapabilitiesKHR* out_surface_caps_ptr) const { - auto caps_iterator = m_physical_device_capabilities.find(0); + auto caps_iterator = m_physical_device_capabilities.find(in_physical_device_ptr->get_device_group_device_index()); bool result = false; if (caps_iterator != m_physical_device_capabilities.end() ) @@ -266,9 +273,10 @@ bool Anvil::RenderingSurface::get_capabilities(VkSurfaceCapabilitiesKHR* out_sur } /* Please see header for specification */ -bool Anvil::RenderingSurface::get_queue_families_with_present_support(const std::vector** out_result_ptr) const +bool Anvil::RenderingSurface::get_queue_families_with_present_support(const Anvil::PhysicalDevice* in_physical_device_ptr, + const std::vector** out_result_ptr) const { - auto caps_iterator = m_physical_device_capabilities.find(0); + auto caps_iterator = m_physical_device_capabilities.find(in_physical_device_ptr->get_device_group_device_index()); bool result = false; if (caps_iterator != m_physical_device_capabilities.end() ) @@ -282,9 +290,10 @@ bool Anvil::RenderingSurface::get_queue_families_with_present_support(const std: } /* Please see header for specification */ -bool Anvil::RenderingSurface::get_supported_composite_alpha_flags(VkCompositeAlphaFlagsKHR* out_result_ptr) const +bool Anvil::RenderingSurface::get_supported_composite_alpha_flags(const Anvil::PhysicalDevice* in_physical_device_ptr, + VkCompositeAlphaFlagsKHR* out_result_ptr) const { - auto caps_iterator = m_physical_device_capabilities.find(0); + auto caps_iterator = m_physical_device_capabilities.find(in_physical_device_ptr->get_device_group_device_index()); bool result = false; if (caps_iterator != m_physical_device_capabilities.end() ) @@ -298,9 +307,10 @@ bool Anvil::RenderingSurface::get_supported_composite_alpha_flags(VkCompositeAlp } /* Please see header for specification */ -bool Anvil::RenderingSurface::get_supported_transformations(VkSurfaceTransformFlagsKHR* out_result_ptr) const +bool Anvil::RenderingSurface::get_supported_transformations(const Anvil::PhysicalDevice* in_physical_device_ptr, + VkSurfaceTransformFlagsKHR* out_result_ptr) const { - auto caps_iterator = m_physical_device_capabilities.find(0); + auto caps_iterator = m_physical_device_capabilities.find(in_physical_device_ptr->get_device_group_device_index()); bool result = false; if (caps_iterator != m_physical_device_capabilities.end() ) @@ -314,9 +324,10 @@ bool Anvil::RenderingSurface::get_supported_transformations(VkSurfaceTransformFl } /* Please see header for specification */ -bool Anvil::RenderingSurface::get_supported_usages(VkImageUsageFlags* out_result_ptr) const +bool Anvil::RenderingSurface::get_supported_usages(const Anvil::PhysicalDevice* in_physical_device_ptr, + Anvil::ImageUsageFlags* out_result_ptr) const { - auto caps_iterator = m_physical_device_capabilities.find(0); + auto caps_iterator = m_physical_device_capabilities.find(in_physical_device_ptr->get_device_group_device_index()); bool result = false; if (caps_iterator != m_physical_device_capabilities.end() ) @@ -344,6 +355,15 @@ bool Anvil::RenderingSurface::init() switch (device_type) { + case Anvil::DEVICE_TYPE_MULTI_GPU: + { + const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr) ); + + n_physical_devices = mgpu_device_ptr->get_n_physical_devices(); + + break; + } + case Anvil::DEVICE_TYPE_SINGLE_GPU: { n_physical_devices = 1; @@ -394,7 +414,6 @@ bool Anvil::RenderingSurface::init() &m_surface); } #endif - anvil_assert_vk_call_succeeded(result); if (is_vk_call_successful(result) ) { @@ -421,12 +440,22 @@ bool Anvil::RenderingSurface::init() switch (device_type) { + case Anvil::DEVICE_TYPE_MULTI_GPU: + { + const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr) ); + + physical_device_ptr = mgpu_device_ptr->get_physical_device(n_physical_device); + physical_device_caps_ptr = &m_physical_device_capabilities[physical_device_ptr->get_device_group_device_index()]; + + break; + } + case Anvil::DEVICE_TYPE_SINGLE_GPU: { const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr) ); physical_device_ptr = sgpu_device_ptr->get_physical_device(); - physical_device_caps_ptr = &m_physical_device_capabilities[0]; + physical_device_caps_ptr = &m_physical_device_capabilities[physical_device_ptr->get_device_group_device_index()]; break; } @@ -469,13 +498,29 @@ bool Anvil::RenderingSurface::init() { switch (device_type) { + case Anvil::DEVICE_TYPE_MULTI_GPU: + { + const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr) ); + + if (mgpu_device_ptr->get_n_universal_queues() > 0) + { + const Anvil::PhysicalDevice* physical_device_ptr = mgpu_device_ptr->get_physical_device(n_physical_device); + auto& result_caps = m_physical_device_capabilities[physical_device_ptr->get_device_group_device_index()]; + + result_caps.present_capable_queue_fams.push_back(mgpu_device_ptr->get_universal_queue(0)->get_queue_family_index() ); + } + + break; + } + case Anvil::DEVICE_TYPE_SINGLE_GPU: { const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr) ); if (sgpu_device_ptr->get_n_universal_queues() > 0) { - auto& result_caps = m_physical_device_capabilities[0]; + const Anvil::PhysicalDevice* physical_device_ptr = sgpu_device_ptr->get_physical_device(); + auto& result_caps = m_physical_device_capabilities[physical_device_ptr->get_device_group_device_index()]; result_caps.present_capable_queue_fams.push_back(sgpu_device_ptr->get_universal_queue(0)->get_queue_family_index() ); } @@ -514,10 +559,11 @@ bool Anvil::RenderingSurface::init() } /* Please see header for specification */ -bool Anvil::RenderingSurface::is_compatible_with_image_format(VkFormat in_image_format, - bool* out_result_ptr) const +bool Anvil::RenderingSurface::is_compatible_with_image_format(const Anvil::PhysicalDevice* in_physical_device_ptr, + Anvil::Format in_image_format, + bool* out_result_ptr) const { - auto caps_iterator = m_physical_device_capabilities.find(0); + auto caps_iterator = m_physical_device_capabilities.find(in_physical_device_ptr->get_device_group_device_index()); bool result = false; if (caps_iterator != m_physical_device_capabilities.end() ) @@ -532,10 +578,11 @@ bool Anvil::RenderingSurface::is_compatible_with_image_format(VkFormat in_image_ } /* Please see header for specification */ -bool Anvil::RenderingSurface::supports_presentation_mode(VkPresentModeKHR in_presentation_mode, - bool* out_result_ptr) const +bool Anvil::RenderingSurface::supports_presentation_mode(const Anvil::PhysicalDevice* in_physical_device_ptr, + VkPresentModeKHR in_presentation_mode, + bool* out_result_ptr) const { - auto caps_iterator = m_physical_device_capabilities.find(0); + auto caps_iterator = m_physical_device_capabilities.find(in_physical_device_ptr->get_device_group_device_index()); bool result = false; if (caps_iterator != m_physical_device_capabilities.end() ) diff --git a/src/wrappers/swapchain.cpp b/src/wrappers/swapchain.cpp index b6cb4dc3..e17324ea 100644 --- a/src/wrappers/swapchain.cpp +++ b/src/wrappers/swapchain.cpp @@ -103,11 +103,70 @@ Anvil::Swapchain::~Swapchain() uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, bool in_should_block) { - uint32_t result (UINT32_MAX); - VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); - const WindowPlatform window_platform (m_create_info_ptr->get_window()->get_platform() ); - const bool is_offscreen_rendering_enabled( (window_platform == WINDOW_PLATFORM_DUMMY || - window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS) ); + uint32_t result(UINT32_MAX); + + switch (m_device_ptr->get_type() ) + { + case Anvil::DEVICE_TYPE_MULTI_GPU: + { + const Anvil::MGPUDevice* mgpu_device_ptr (dynamic_cast(m_device_ptr) ); + const uint32_t n_physical_devices(mgpu_device_ptr->get_n_physical_devices() ); + const Anvil::PhysicalDevice* physical_devices[32]; + + anvil_assert(n_physical_devices < sizeof(physical_devices) / sizeof(physical_devices[0]) ); + + for (uint32_t n_physical_device = 0; + n_physical_device < n_physical_devices; + ++n_physical_device) + { + physical_devices[n_physical_device] = mgpu_device_ptr->get_physical_device(n_physical_device); + } + + result = acquire_image(in_opt_semaphore_ptr, + n_physical_devices, + physical_devices, + in_should_block); + + break; + } + + case Anvil::DEVICE_TYPE_SINGLE_GPU: + { + const Anvil::PhysicalDevice* physical_device_ptr(nullptr); + const Anvil::SGPUDevice* sgpu_device_ptr (dynamic_cast(m_device_ptr) ); + + physical_device_ptr = sgpu_device_ptr->get_physical_device(); + + result = acquire_image(in_opt_semaphore_ptr, + 1, /* n_mgpu_physical_devices */ + &physical_device_ptr, + in_should_block); + + break; + } + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + +/** Please see header for specification */ +uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, + uint32_t in_n_mgpu_physical_devices, + const Anvil::PhysicalDevice* const* in_mgpu_physical_device_ptrs, + bool in_should_block) +{ + const Anvil::DeviceType device_type = m_device_ptr->get_type(); + + uint32_t result = UINT32_MAX; + VkResult result_vk = VK_ERROR_INITIALIZATION_FAILED; + const WindowPlatform window_platform = m_create_info_ptr->get_window()->get_platform(); + const bool is_offscreen_rendering_enabled = (window_platform == WINDOW_PLATFORM_DUMMY || + window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS); ANVIL_REDUNDANT_VARIABLE(result_vk); @@ -123,8 +182,6 @@ uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, m_image_available_fence_ptr->lock(); lock(); { - const auto& khr_swapchain_entrypoints = m_device_ptr->get_extension_khr_swapchain_entrypoints(); - if (in_should_block) { m_image_available_fence_ptr->reset(); @@ -132,12 +189,49 @@ uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, fence_handle = m_image_available_fence_ptr->get_fence(); } - result_vk = khr_swapchain_entrypoints.vkAcquireNextImageKHR(m_device_ptr->get_device_vk(), - m_swapchain, - UINT64_MAX, - (in_opt_semaphore_ptr != nullptr) ? in_opt_semaphore_ptr->get_semaphore() : VK_NULL_HANDLE, - fence_handle, - &result); + if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) + { + const auto& khr_swapchain_entrypoints = m_device_ptr->get_extension_khr_swapchain_entrypoints(); + + result_vk = khr_swapchain_entrypoints.vkAcquireNextImageKHR(m_device_ptr->get_device_vk(), + m_swapchain, + UINT64_MAX, + (in_opt_semaphore_ptr != nullptr) ? in_opt_semaphore_ptr->get_semaphore() : VK_NULL_HANDLE, + fence_handle, + &result); + } + else + { + VkAcquireNextImageInfoKHR info; + const auto& khr_device_group_entrypoints(m_device_ptr->get_extension_khr_device_group_entrypoints() ); + const Anvil::MGPUDevice* mgpu_device_ptr (dynamic_cast(m_device_ptr) ); + + anvil_assert(device_type == Anvil::DEVICE_TYPE_MULTI_GPU); + + info.deviceMask = 0; + info.fence = fence_handle; + info.pNext = nullptr; + info.semaphore = (in_opt_semaphore_ptr != nullptr) ? in_opt_semaphore_ptr->get_semaphore() : VK_NULL_HANDLE; + info.sType = VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR; + info.swapchain = m_swapchain; + info.timeout = UINT64_MAX; + + for (uint32_t n_physical_device = 0; + n_physical_device < in_n_mgpu_physical_devices; + ++n_physical_device) + { + const Anvil::PhysicalDevice* physical_device_ptr (in_mgpu_physical_device_ptrs[n_physical_device]); + const uint32_t physical_device_index(physical_device_ptr->get_index() ); + + anvil_assert((info.deviceMask & (1 << physical_device_index)) == 0); + + info.deviceMask |= (1 << physical_device_index); + } + + result_vk = khr_device_group_entrypoints.vkAcquireNextImage2KHR(mgpu_device_ptr->get_device_vk(), + &info, + &result); + } if (fence_handle != VK_NULL_HANDLE) { @@ -284,6 +378,7 @@ bool Anvil::Swapchain::init() #ifdef _DEBUG { + const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr) ); const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr) ); const Anvil::DeviceType device_type = m_device_ptr->get_type(); @@ -309,7 +404,8 @@ bool Anvil::Swapchain::init() switch (device_type) { - case Anvil::DEVICE_TYPE_SINGLE_GPU: n_physical_devices = 1; break; + case Anvil::DEVICE_TYPE_MULTI_GPU: n_physical_devices = mgpu_device_ptr->get_n_physical_devices(); break; + case Anvil::DEVICE_TYPE_SINGLE_GPU: n_physical_devices = 1; break; default: { @@ -325,7 +421,8 @@ bool Anvil::Swapchain::init() switch (device_type) { - case Anvil::DEVICE_TYPE_SINGLE_GPU: current_physical_device_ptr = sgpu_device_ptr->get_physical_device(); break; + case Anvil::DEVICE_TYPE_MULTI_GPU: current_physical_device_ptr = mgpu_device_ptr->get_physical_device(n_physical_device); break; + case Anvil::DEVICE_TYPE_SINGLE_GPU: current_physical_device_ptr = sgpu_device_ptr->get_physical_device(); break; default: { @@ -334,22 +431,26 @@ bool Anvil::Swapchain::init() } /* Ensure opaque composite alpha mode is supported */ - anvil_assert(parent_surface_ptr->get_supported_composite_alpha_flags(&supported_composite_alpha_flags) ); + anvil_assert(parent_surface_ptr->get_supported_composite_alpha_flags(current_physical_device_ptr, + &supported_composite_alpha_flags) ); anvil_assert(supported_composite_alpha_flags & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR); /* Ensure we can use the swapchain image format */ - anvil_assert(parent_surface_ptr->is_compatible_with_image_format(m_create_info_ptr->get_format(), + anvil_assert(parent_surface_ptr->is_compatible_with_image_format(current_physical_device_ptr, + m_create_info_ptr->get_format(), &result_bool) ); anvil_assert(result_bool); /* Ensure the transformation we're about to request is supported by the rendering surface */ - anvil_assert(parent_surface_ptr->get_supported_transformations(&supported_surface_transform_flags) ); + anvil_assert(parent_surface_ptr->get_supported_transformations(current_physical_device_ptr, + &supported_surface_transform_flags) ); anvil_assert(supported_surface_transform_flags & swapchain_transformation); /* Ensure the requested number of swapchain images is reasonable*/ - anvil_assert(parent_surface_ptr->get_capabilities(&surface_caps) ); + anvil_assert(parent_surface_ptr->get_capabilities(current_physical_device_ptr, + &surface_caps) ); anvil_assert(surface_caps.maxImageCount == 0 || surface_caps.maxImageCount >= m_create_info_ptr->get_n_images() ); @@ -367,10 +468,10 @@ bool Anvil::Swapchain::init() create_info.imageColorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR; create_info.imageExtent.height = parent_surface_ptr->get_height(); create_info.imageExtent.width = parent_surface_ptr->get_width (); - create_info.imageFormat = m_create_info_ptr->get_format (); + create_info.imageFormat = static_cast(m_create_info_ptr->get_format() ); create_info.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE; - create_info.imageUsage = m_create_info_ptr->get_usage_flags(); - create_info.minImageCount = m_create_info_ptr->get_n_images (); + create_info.imageUsage = static_cast (m_create_info_ptr->get_usage_flags() ); + create_info.minImageCount = m_create_info_ptr->get_n_images(); create_info.oldSwapchain = VK_NULL_HANDLE; create_info.pNext = nullptr; create_info.pQueueFamilyIndices = nullptr; @@ -383,6 +484,21 @@ bool Anvil::Swapchain::init() struct_chainer.append_struct(create_info); } + /* If present mode flags specific to mGPU support (exposed via VK_KHR_device_group) have been requested, + * make sure to chain this information */ + const auto mgpu_present_mode_flags = m_create_info_ptr->get_mgpu_present_mode_flags(); + + if (mgpu_present_mode_flags != VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR) + { + VkDeviceGroupSwapchainCreateInfoKHR mgpu_create_info; + + mgpu_create_info.modes = mgpu_present_mode_flags; + mgpu_create_info.pNext = nullptr; + mgpu_create_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR; + + struct_chainer.append_struct(mgpu_create_info); + } + struct_chain_ptr = struct_chainer.create_chain(); parent_surface_ptr->lock(); @@ -420,7 +536,7 @@ bool Anvil::Swapchain::init() } else /* offscreen rendering */ { - m_create_info_ptr->set_usage_flags(m_create_info_ptr->get_usage_flags() | VK_IMAGE_USAGE_TRANSFER_SRC_BIT); + m_create_info_ptr->set_usage_flags(m_create_info_ptr->get_usage_flags() | Anvil::IMAGE_USAGE_FLAG_TRANSFER_SRC_BIT); n_swapchain_images = m_create_info_ptr->get_n_images(); } @@ -444,21 +560,21 @@ bool Anvil::Swapchain::init() else { auto create_info_ptr = Anvil::ImageCreateInfo::create_nonsparse_alloc(m_device_ptr, - VK_IMAGE_TYPE_2D, + Anvil::ImageType::_2D, m_create_info_ptr->get_format(), - VK_IMAGE_TILING_OPTIMAL, + Anvil::ImageTiling::OPTIMAL, m_create_info_ptr->get_usage_flags(), m_size.width, m_size.height, 1, /* base_mipmap_depth */ 1, - VK_SAMPLE_COUNT_1_BIT, + Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, QUEUE_FAMILY_GRAPHICS_BIT, - VK_SHARING_MODE_EXCLUSIVE, + Anvil::SharingMode::EXCLUSIVE, false, /* in_use_full_mipmap_chain */ 0, /* in_memory_features */ 0, /* in_create_flags */ - VK_IMAGE_LAYOUT_GENERAL, + Anvil::ImageLayout::GENERAL, nullptr); create_info_ptr->set_mt_safety(Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() ) ); @@ -473,12 +589,12 @@ bool Anvil::Swapchain::init() 0, /* n_base_layer */ 0, /* n_base_mipmap_level */ 1, /* n_mipmaps */ - VK_IMAGE_ASPECT_COLOR_BIT, + Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_COLOR_BIT, m_create_info_ptr->get_format(), - VK_COMPONENT_SWIZZLE_R, - VK_COMPONENT_SWIZZLE_G, - VK_COMPONENT_SWIZZLE_B, - VK_COMPONENT_SWIZZLE_A); + Anvil::ComponentSwizzle::R, + Anvil::ComponentSwizzle::G, + Anvil::ComponentSwizzle::B, + Anvil::ComponentSwizzle::A); create_info_ptr->set_mt_safety(Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() ) ); @@ -496,13 +612,65 @@ bool Anvil::Swapchain::init() switch (m_device_ptr->get_type() ) { + case Anvil::DEVICE_TYPE_MULTI_GPU: + { + const Anvil::MGPUDevice* mgpu_device_ptr (dynamic_cast(m_device_ptr) ); + const uint32_t n_physical_devices(mgpu_device_ptr->get_n_physical_devices() ); + + for (uint32_t n_physical_device = 0; + n_physical_device < n_physical_devices; + ++n_physical_device) + { + auto physical_device_ptr (mgpu_device_ptr->get_physical_device(n_physical_device) ); + const std::vector* queue_fams_with_present_support_ptr(nullptr); + auto rendering_surface_ptr (m_create_info_ptr->get_rendering_surface() ); + + if (!rendering_surface_ptr->get_queue_families_with_present_support(physical_device_ptr, + &queue_fams_with_present_support_ptr) ) + { + break; + } + + if (queue_fams_with_present_support_ptr == nullptr) + { + anvil_assert(queue_fams_with_present_support_ptr != nullptr); + } + else + { + for (const auto queue_fam : *queue_fams_with_present_support_ptr) + { + const uint32_t n_queues = mgpu_device_ptr->get_n_queues(queue_fam); + + for (uint32_t n_queue = 0; + n_queue < n_queues; + ++n_queue) + { + auto queue_ptr = mgpu_device_ptr->get_queue_for_queue_family_index(queue_fam, + n_queue); + + if (std::find(queues.begin(), + queues.end(), + queue_ptr) == queues.end() ) + { + queues.push_back(queue_ptr); + } + } + } + } + } + + break; + } + case Anvil::DEVICE_TYPE_SINGLE_GPU: { const std::vector* queue_fams_with_present_support_ptr(nullptr); const auto rendering_surface_ptr (m_create_info_ptr->get_rendering_surface() ); const Anvil::SGPUDevice* sgpu_device_ptr (dynamic_cast(m_device_ptr) ); + auto physical_device_ptr (sgpu_device_ptr->get_physical_device() ); - if (!rendering_surface_ptr->get_queue_families_with_present_support(&queue_fams_with_present_support_ptr) ) + if (!rendering_surface_ptr->get_queue_families_with_present_support(physical_device_ptr, + &queue_fams_with_present_support_ptr) ) { break; } From 46630b7c6bac152f8c65068d8d6f21c92f14dd58 Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Tue, 18 Sep 2018 17:43:16 +0200 Subject: [PATCH 22/50] Address compilation warnings --- src/wrappers/render_pass.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/wrappers/render_pass.cpp b/src/wrappers/render_pass.cpp index 929d858d..b49c9ff4 100644 --- a/src/wrappers/render_pass.cpp +++ b/src/wrappers/render_pass.cpp @@ -188,7 +188,6 @@ bool Anvil::RenderPass::init() uint32_t highest_subpass_color_attachment_location = UINT32_MAX; uint32_t highest_subpass_input_attachment_index = UINT32_MAX; bool need_color_resolve_attachments = false; - const uint32_t subpass_index = static_cast(subpass_iterator - m_render_pass_create_info_ptr->m_subpasses.begin() ); VkSubpassDescription subpass_vk; VkAttachmentReference unused_reference; From 43e2fd9e4d17296cbf72f26467118936bf8729bc Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Mon, 1 Oct 2018 14:09:12 +0200 Subject: [PATCH 23/50] Introduce enum classes for VK enums; various bug-fixes --- examples/DynamicBuffers/src/app.cpp | 179 ++- examples/MultiViewport/src/app.cpp | 104 +- examples/OcclusionQuery/src/app.cpp | 154 +- examples/OutOfOrderRasterization/src/app.cpp | 147 +- examples/PushConstants/src/app.cpp | 135 +- include/misc/base_pipeline_create_info.h | 6 +- include/misc/buffer_create_info.h | 100 +- include/misc/buffer_view_create_info.h | 2 +- include/misc/compute_pipeline_create_info.h | 2 +- include/misc/descriptor_set_create_info.h | 28 +- include/misc/event_create_info.h | 2 +- include/misc/extensions.h | 8 +- include/misc/fence_create_info.h | 14 +- include/misc/framebuffer_create_info.h | 2 +- include/misc/graphics_pipeline_create_info.h | 277 ++-- include/misc/image_create_info.h | 118 +- include/misc/image_view_create_info.h | 22 +- .../misc/memalloc_backends/backend_oneshot.h | 16 +- include/misc/memalloc_backends/backend_vma.h | 16 +- include/misc/memory_allocator.h | 228 +-- include/misc/memory_block_create_info.h | 18 +- include/misc/render_pass_create_info.h | 195 ++- include/misc/sampler_create_info.h | 128 +- include/misc/semaphore_create_info.h | 12 +- include/misc/swapchain_create_info.h | 56 +- include/misc/types.h | 5 +- include/misc/types_classes.h | 100 +- include/misc/types_enums.h | 1368 +++++++++++++---- include/misc/types_macro.h | 324 ---- include/misc/types_struct.h | 487 ++++-- include/misc/types_utils.h | 51 +- include/wrappers/buffer.h | 2 +- include/wrappers/command_buffer.h | 488 +++--- include/wrappers/command_pool.h | 2 +- include/wrappers/descriptor_pool.h | 28 +- include/wrappers/descriptor_set.h | 70 +- include/wrappers/descriptor_set_group.h | 26 +- include/wrappers/descriptor_set_layout.h | 2 +- include/wrappers/descriptor_update_template.h | 4 +- include/wrappers/device.h | 92 +- include/wrappers/fence.h | 22 +- include/wrappers/graphics_pipeline_manager.h | 16 +- include/wrappers/image.h | 64 +- include/wrappers/image_view.h | 5 +- include/wrappers/memory_block.h | 4 +- include/wrappers/physical_device.h | 12 +- include/wrappers/query_pool.h | 60 +- include/wrappers/queue.h | 24 +- include/wrappers/rendering_surface.h | 20 +- include/wrappers/semaphore.h | 22 +- include/wrappers/shader_module.h | 8 +- src/misc/base_pipeline_create_info.cpp | 8 +- src/misc/base_pipeline_manager.cpp | 14 +- src/misc/buffer_create_info.cpp | 89 +- src/misc/buffer_view_create_info.cpp | 2 +- src/misc/descriptor_set_create_info.cpp | 30 +- src/misc/dummy_window.cpp | 155 +- src/misc/event_create_info.cpp | 2 +- src/misc/fence_create_info.cpp | 4 +- src/misc/formats.cpp | 416 ++--- src/misc/framebuffer_create_info.cpp | 2 +- src/misc/glsl_to_spirv.cpp | 52 +- src/misc/graphics_pipeline_create_info.cpp | 245 +-- src/misc/image_create_info.cpp | 105 +- src/misc/image_view_create_info.cpp | 33 +- .../memalloc_backends/backend_oneshot.cpp | 8 +- src/misc/memalloc_backends/backend_vma.cpp | 14 +- src/misc/memory_allocator.cpp | 341 ++-- src/misc/memory_block_create_info.cpp | 12 +- src/misc/render_pass_create_info.cpp | 160 +- src/misc/sampler_create_info.cpp | 64 +- src/misc/semaphore_create_info.cpp | 4 +- src/misc/swapchain_create_info.cpp | 28 +- src/misc/types.cpp | 36 +- src/misc/types_classes.cpp | 84 +- src/misc/types_struct.cpp | 316 ++-- src/misc/types_utils.cpp | 603 ++------ src/wrappers/buffer.cpp | 149 +- src/wrappers/command_buffer.cpp | 474 +++--- src/wrappers/compute_pipeline_manager.cpp | 6 +- src/wrappers/descriptor_pool.cpp | 29 +- src/wrappers/descriptor_set.cpp | 16 +- src/wrappers/descriptor_set_group.cpp | 26 +- src/wrappers/device.cpp | 160 +- src/wrappers/fence.cpp | 36 +- src/wrappers/graphics_pipeline_manager.cpp | 243 +-- src/wrappers/image.cpp | 438 +++--- src/wrappers/image_view.cpp | 64 +- src/wrappers/memory_block.cpp | 70 +- src/wrappers/physical_device.cpp | 42 +- src/wrappers/pipeline_layout.cpp | 2 +- src/wrappers/query_pool.cpp | 51 +- src/wrappers/queue.cpp | 72 +- src/wrappers/render_pass.cpp | 26 +- src/wrappers/rendering_surface.cpp | 71 +- src/wrappers/sampler.cpp | 16 +- src/wrappers/semaphore.cpp | 34 +- src/wrappers/shader_module.cpp | 24 +- src/wrappers/swapchain.cpp | 68 +- 99 files changed, 5338 insertions(+), 4881 deletions(-) diff --git a/examples/DynamicBuffers/src/app.cpp b/examples/DynamicBuffers/src/app.cpp index 5cfd1f79..7187cef5 100644 --- a/examples/DynamicBuffers/src/app.cpp +++ b/examples/DynamicBuffers/src/app.cpp @@ -275,12 +275,12 @@ void App::deinit() void App::draw_frame() { - Anvil::Semaphore* curr_frame_signal_semaphore_ptr = nullptr; - Anvil::Semaphore* curr_frame_wait_semaphore_ptr = nullptr; - static uint32_t n_frames_rendered = 0; - uint32_t n_swapchain_image; - Anvil::Semaphore* present_wait_semaphore_ptr = nullptr; - const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; + Anvil::Semaphore* curr_frame_signal_semaphore_ptr = nullptr; + Anvil::Semaphore* curr_frame_wait_semaphore_ptr = nullptr; + static uint32_t n_frames_rendered = 0; + uint32_t n_swapchain_image; + Anvil::Semaphore* present_wait_semaphore_ptr = nullptr; + const Anvil::PipelineStageFlags wait_stage_mask = Anvil::PipelineStageFlagBits::ALL_COMMANDS_BIT; /* Determine the signal + wait semaphores to use for drawing this frame */ m_n_last_semaphore_used = (m_n_last_semaphore_used + 1) % m_n_swapchain_images; @@ -422,9 +422,9 @@ void App::init_buffers() { auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), m_sine_offset_data_buffer_size, - Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + Anvil::QueueFamilyFlagBits::COMPUTE_BIT | Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::SharingMode::CONCURRENT, - Anvil::BUFFER_USAGE_FLAG_STORAGE_BUFFER_BIT); + Anvil::BufferUsageFlagBits::STORAGE_BUFFER_BIT); m_sine_offset_data_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -432,7 +432,7 @@ void App::init_buffers() m_sine_offset_data_buffer_ptr->set_name("Sine offset data buffer"); memory_allocator_ptr->add_buffer(m_sine_offset_data_buffer_ptr.get(), - 0); /* in_required_memory_features */ + Anvil::MemoryFeatureFlagBits::NONE); /* in_required_memory_features */ /* Now prepare a memory block which is going to hold vertex data generated by * the producer CS */ @@ -464,9 +464,9 @@ void App::init_buffers() { auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), m_sine_data_buffer_size, - Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + Anvil::QueueFamilyFlagBits::COMPUTE_BIT | Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::SharingMode::CONCURRENT, - Anvil::BUFFER_USAGE_FLAG_STORAGE_BUFFER_BIT); + Anvil::BufferUsageFlagBits::STORAGE_BUFFER_BIT); m_sine_data_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -474,7 +474,7 @@ void App::init_buffers() m_sine_data_buffer_ptr->set_name("Sine data buffer"); memory_allocator_ptr->add_buffer(m_sine_data_buffer_ptr.get(), - 0); /* in_required_memory_features */ + Anvil::MemoryFeatureFlagBits::NONE); /* We also need some space for a uniform block which is going to hold time info. */ const auto dynamic_ub_alignment_requirement = m_device_ptr->get_physical_device_properties().core_vk1_0_properties_ptr->limits.min_uniform_buffer_offset_alignment; @@ -487,9 +487,9 @@ void App::init_buffers() { auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), sine_props_data_buffer_size_total, - Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + Anvil::QueueFamilyFlagBits::COMPUTE_BIT | Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::SharingMode::CONCURRENT, - Anvil::BUFFER_USAGE_FLAG_UNIFORM_BUFFER_BIT); + Anvil::BufferUsageFlagBits::UNIFORM_BUFFER_BIT); m_sine_props_data_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -497,7 +497,7 @@ void App::init_buffers() m_sine_props_data_buffer_ptr->set_name("Sine properties data buffer"); memory_allocator_ptr->add_buffer(m_sine_props_data_buffer_ptr.get(), - Anvil::MEMORY_FEATURE_FLAG_MAPPABLE); + Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT); /* Each sine needs to be assigned a different color. Compute the data and upload it to another buffer object. */ std::unique_ptr color_buffer_data_ptr; @@ -525,9 +525,9 @@ void App::init_buffers() { auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), m_sine_color_buffer_size, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::SharingMode::EXCLUSIVE, - Anvil::BUFFER_USAGE_FLAG_VERTEX_BUFFER_BIT); + Anvil::BufferUsageFlagBits::VERTEX_BUFFER_BIT); m_sine_color_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -535,7 +535,7 @@ void App::init_buffers() m_sine_color_buffer_ptr->set_name("Sine color data buffer"); memory_allocator_ptr->add_buffer(m_sine_color_buffer_ptr.get(), - 0); /* in_required_memory_features */ + Anvil::MemoryFeatureFlagBits::NONE); /* Assign memory blocks to buffers and fill them with data */ m_sine_offset_data_buffer_ptr->write(0, /* start_offset */ @@ -550,19 +550,19 @@ void App::init_buffers() void App::init_command_buffers() { - auto gfx_pipeline_manager_ptr (m_device_ptr->get_graphics_pipeline_manager() ); - const bool is_debug_marker_ext_present (m_device_ptr->get_extension_info()->ext_debug_marker() ); - Anvil::PipelineLayout* producer_pipeline_layout_ptr(nullptr); - VkImageSubresourceRange subresource_range; - Anvil::Queue* universal_queue_ptr (m_device_ptr->get_universal_queue(0) ); + auto gfx_pipeline_manager_ptr (m_device_ptr->get_graphics_pipeline_manager() ); + const bool is_debug_marker_ext_present (m_device_ptr->get_extension_info()->ext_debug_marker() ); + Anvil::PipelineLayout* producer_pipeline_layout_ptr(nullptr); + Anvil::ImageSubresourceRange subresource_range; + Anvil::Queue* universal_queue_ptr (m_device_ptr->get_universal_queue(0) ); producer_pipeline_layout_ptr = m_device_ptr->get_compute_pipeline_manager()->get_pipeline_layout(m_producer_pipeline_id); - subresource_range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; - subresource_range.baseArrayLayer = 0; - subresource_range.baseMipLevel = 0; - subresource_range.layerCount = 1; - subresource_range.levelCount = 1; + subresource_range.aspect_mask = Anvil::ImageAspectFlagBits::COLOR_BIT; + subresource_range.base_array_layer = 0; + subresource_range.base_mip_level = 0; + subresource_range.layer_count = 1; + subresource_range.level_count = 1; /* Set up rendering command buffers. We need one per swap-chain image. */ for (unsigned int n_current_swapchain_image = 0; @@ -579,9 +579,8 @@ void App::init_command_buffers() /* Switch the swap-chain image layout to renderable */ { - Anvil::ImageBarrier image_barrier(0, /* source_access_mask */ - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, /* destination_access_mask */ - false, + Anvil::ImageBarrier image_barrier(Anvil::AccessFlags(), /* source_access_mask */ + Anvil::AccessFlagBits::COLOR_ATTACHMENT_WRITE_BIT, /* destination_access_mask */ Anvil::ImageLayout::UNDEFINED, Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, universal_queue_ptr->get_queue_family_index(), @@ -589,9 +588,9 @@ void App::init_command_buffers() m_swapchain_ptr->get_image(n_current_swapchain_image), subresource_range); - draw_cmd_buffer_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - VK_FALSE, /* in_by_region */ + draw_cmd_buffer_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::TOP_OF_PIPE_BIT, + Anvil::PipelineStageFlagBits::COLOR_ATTACHMENT_OUTPUT_BIT, + Anvil::DependencyFlagBits::NONE, 0, /* in_memory_barrier_count */ nullptr, /* in_memory_barrier_ptrs */ 0, /* in_buffer_memory_barrier_count */ @@ -605,17 +604,17 @@ void App::init_command_buffers() * We do not need to worry about offset buffer contents getting overwritten by subsequent frames * because we do not render frames ahead of time in this example. */ - Anvil::BufferBarrier t_value_buffer_barrier = Anvil::BufferBarrier(VK_ACCESS_HOST_WRITE_BIT, /* in_source_access_mask */ - VK_ACCESS_UNIFORM_READ_BIT, /* in_destination_access_mask */ + Anvil::BufferBarrier t_value_buffer_barrier = Anvil::BufferBarrier(Anvil::AccessFlagBits::HOST_WRITE_BIT, /* in_source_access_mask */ + Anvil::AccessFlagBits::UNIFORM_READ_BIT, /* in_destination_access_mask */ VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_IGNORED, m_sine_props_data_buffer_ptr.get(), n_current_swapchain_image * m_sine_props_data_buffer_size_per_swapchain_image, /* in_start_offset */ sizeof(float) ); /* in_size */ - draw_cmd_buffer_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_HOST_BIT, - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - VK_FALSE, + draw_cmd_buffer_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::HOST_BIT, + Anvil::PipelineStageFlagBits::COMPUTE_SHADER_BIT, + Anvil::DependencyFlagBits::NONE, 0, /* in_memory_barrier_count */ nullptr, /* in_memory_barriers_ptr */ 1, /* in_buffer_memory_barrier_count */ @@ -624,7 +623,7 @@ void App::init_command_buffers() nullptr); /* in_image_memory_barriers_ptr */ /* Let's generate some sine offset data using our compute shader */ - draw_cmd_buffer_ptr->record_bind_pipeline(VK_PIPELINE_BIND_POINT_COMPUTE, + draw_cmd_buffer_ptr->record_bind_pipeline(Anvil::PipelineBindPoint::COMPUTE, m_producer_pipeline_id); if (is_debug_marker_ext_present) @@ -661,7 +660,7 @@ void App::init_command_buffers() dynamic_offsets[2] = static_cast(m_sine_props_data_buffer_size_per_swapchain_image * n_current_swapchain_image); - draw_cmd_buffer_ptr->record_bind_descriptor_sets(VK_PIPELINE_BIND_POINT_COMPUTE, + draw_cmd_buffer_ptr->record_bind_descriptor_sets(Anvil::PipelineBindPoint::COMPUTE, producer_pipeline_layout_ptr, 0, /* firstSet */ n_producer_dses, @@ -670,7 +669,7 @@ void App::init_command_buffers() dynamic_offsets); draw_cmd_buffer_ptr->record_push_constants(producer_pipeline_layout_ptr, - VK_SHADER_STAGE_COMPUTE_BIT, + Anvil::ShaderStageFlagBits::COMPUTE_BIT, 0, /* in_offset */ 4, /* in_size */ &n_sine_pair); @@ -687,17 +686,17 @@ void App::init_command_buffers() /* Before we proceed with drawing, we need to flush the buffer data. This step is needed in order to ensure * that the data we have generated in CS is actually visible to the draw call. */ - Anvil::BufferBarrier vertex_buffer_barrier(VK_ACCESS_SHADER_WRITE_BIT, /* in_source_access_mask */ - VK_ACCESS_SHADER_READ_BIT, /* in_destination_access_mask */ + Anvil::BufferBarrier vertex_buffer_barrier(Anvil::AccessFlagBits::SHADER_WRITE_BIT, /* in_source_access_mask */ + Anvil::AccessFlagBits::SHADER_READ_BIT, /* in_destination_access_mask */ VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_IGNORED, m_sine_data_buffer_ptr.get(), 0, /* in_offset */ m_sine_data_buffer_size); - draw_cmd_buffer_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - VK_PIPELINE_STAGE_VERTEX_SHADER_BIT, - VK_FALSE, /* in_by_region */ + draw_cmd_buffer_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::COMPUTE_SHADER_BIT, + Anvil::PipelineStageFlagBits::VERTEX_SHADER_BIT, + Anvil::DependencyFlagBits::NONE, 0, /* in_memory_barrier_count */ nullptr, /* in_memory_barriers_ptr */ 1, /* in_buffer_memory_barrier_count */ @@ -728,7 +727,7 @@ void App::init_command_buffers() m_fbos[n_current_swapchain_image].get(), render_area, m_consumer_render_pass_ptr.get(), - VK_SUBPASS_CONTENTS_INLINE); + Anvil::SubpassContents::INLINE); { const float max_line_width = m_device_ptr->get_physical_device_properties().core_vk1_0_properties_ptr->limits.line_width_range[1]; Anvil::DescriptorSet* renderer_dses[] = @@ -744,7 +743,7 @@ void App::init_command_buffers() renderer_pipeline_layout_ptr = gfx_pipeline_manager_ptr->get_pipeline_layout(m_consumer_pipeline_id); - draw_cmd_buffer_ptr->record_bind_pipeline (VK_PIPELINE_BIND_POINT_GRAPHICS, + draw_cmd_buffer_ptr->record_bind_pipeline (Anvil::PipelineBindPoint::GRAPHICS, m_consumer_pipeline_id); draw_cmd_buffer_ptr->record_bind_vertex_buffers (0, /* startBinding */ 1, /* bindingCount */ @@ -783,7 +782,7 @@ void App::init_command_buffers() draw_cmd_buffer_ptr->record_set_line_width(new_line_width); - draw_cmd_buffer_ptr->record_bind_descriptor_sets(VK_PIPELINE_BIND_POINT_GRAPHICS, + draw_cmd_buffer_ptr->record_bind_descriptor_sets(Anvil::PipelineBindPoint::GRAPHICS, renderer_pipeline_layout_ptr, 0, /* firstSet */ n_renderer_dses, @@ -818,7 +817,7 @@ void App::init_compute_pipelines() producer_pipeline_info_ptr->attach_push_constant_range (0, /* offset */ 4, /* size */ - VK_SHADER_STAGE_COMPUTE_BIT); + Anvil::ShaderStageFlagBits::COMPUTE_BIT); producer_pipeline_info_ptr->set_descriptor_set_create_info(m_producer_dsg_ptr->get_descriptor_set_create_info() ); result = compute_manager_ptr->add_pipeline(std::move(producer_pipeline_info_ptr), @@ -840,26 +839,26 @@ void App::init_dsgs() producer_dsg_create_info_ptrs[1] = Anvil::DescriptorSetCreateInfo::create(); consumer_dsg_create_info_ptrs[0]->add_binding(0, /* binding */ - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, + Anvil::DescriptorType::STORAGE_BUFFER_DYNAMIC, 1, /* n_elements */ - VK_SHADER_STAGE_VERTEX_BIT); + Anvil::ShaderStageFlagBits::VERTEX_BIT); consumer_dsg_create_info_ptrs[1]->add_binding(0, /* binding */ - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, + Anvil::DescriptorType::STORAGE_BUFFER_DYNAMIC, 1, /* n_elements */ - VK_SHADER_STAGE_VERTEX_BIT); + Anvil::ShaderStageFlagBits::VERTEX_BIT); producer_dsg_create_info_ptrs[0]->add_binding(0, /* binding */ - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, + Anvil::DescriptorType::STORAGE_BUFFER_DYNAMIC, 1, /* n_elements */ - VK_SHADER_STAGE_COMPUTE_BIT); + Anvil::ShaderStageFlagBits::COMPUTE_BIT); producer_dsg_create_info_ptrs[0]->add_binding(1, /* binding */ - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, + Anvil::DescriptorType::STORAGE_BUFFER_DYNAMIC, 1, /* n_elements */ - VK_SHADER_STAGE_COMPUTE_BIT); + Anvil::ShaderStageFlagBits::COMPUTE_BIT); producer_dsg_create_info_ptrs[1]->add_binding(0, /* binding */ - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, + Anvil::DescriptorType::UNIFORM_BUFFER_DYNAMIC, 1, /* n_elements */ - VK_SHADER_STAGE_COMPUTE_BIT); + Anvil::ShaderStageFlagBits::COMPUTE_BIT); /* Create the descriptor set layouts for the generator program. */ m_producer_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), @@ -956,9 +955,9 @@ void App::init_gfx_pipelines() Anvil::SubPassID render_pass_subpass_id = -1; renderpass_create_info_ptr->add_color_attachment(m_swapchain_ptr->get_create_info_ptr()->get_format(), - Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, - VK_ATTACHMENT_LOAD_OP_CLEAR, - VK_ATTACHMENT_STORE_OP_STORE, + Anvil::SampleCountFlagBits::_1_BIT, + Anvil::AttachmentLoadOp::CLEAR, + Anvil::AttachmentStoreOp::STORE, Anvil::ImageLayout::UNDEFINED, final_layout, false, /* may_alias */ @@ -966,10 +965,10 @@ void App::init_gfx_pipelines() renderpass_create_info_ptr->add_depth_stencil_attachment(m_depth_images[0]->get_create_info_ptr()->get_format(), m_depth_images[0]->get_create_info_ptr()->get_sample_count(), - VK_ATTACHMENT_LOAD_OP_CLEAR, /* depth_load_op */ - VK_ATTACHMENT_STORE_OP_DONT_CARE, /* depth_store_op */ - VK_ATTACHMENT_LOAD_OP_DONT_CARE, /* stencil_load_op */ - VK_ATTACHMENT_STORE_OP_DONT_CARE, /* stencil_store_op */ + Anvil::AttachmentLoadOp::CLEAR, /* depth_load_op */ + Anvil::AttachmentStoreOp::DONT_CARE, /* depth_store_op */ + Anvil::AttachmentLoadOp::DONT_CARE, /* stencil_load_op */ + Anvil::AttachmentStoreOp::DONT_CARE, /* stencil_store_op */ Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* initial_layout */ Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* final_layout */ false, /* may_alias */ @@ -1007,18 +1006,18 @@ void App::init_gfx_pipelines() Anvil::Format::R8G8_UNORM, 0, /* offset_in_bytes */ sizeof(char) * 2, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_INSTANCE); + Anvil::VertexInputRate::INSTANCE); consumer_pipeline_info_ptr->set_descriptor_set_create_info(m_consumer_dsg_ptr->get_descriptor_set_create_info() ); - consumer_pipeline_info_ptr->set_primitive_topology (VK_PRIMITIVE_TOPOLOGY_LINE_STRIP); - consumer_pipeline_info_ptr->set_rasterization_properties (VK_POLYGON_MODE_FILL, - VK_CULL_MODE_NONE, - VK_FRONT_FACE_COUNTER_CLOCKWISE, + consumer_pipeline_info_ptr->set_primitive_topology (Anvil::PrimitiveTopology::LINE_STRIP); + consumer_pipeline_info_ptr->set_rasterization_properties (Anvil::PolygonMode::FILL, + Anvil::CullModeFlagBits::CULL_MODE_NONE, + Anvil::FrontFace::COUNTER_CLOCKWISE, 1.0f /* line_width */); consumer_pipeline_info_ptr->toggle_depth_test (true, /* should_enable */ - VK_COMPARE_OP_LESS_OR_EQUAL); + Anvil::CompareOp::LESS_OR_EQUAL); consumer_pipeline_info_ptr->toggle_depth_writes (true); /* should_enable */ - consumer_pipeline_info_ptr->toggle_dynamic_states (true, /* should_enable */ - Anvil::DYNAMIC_STATE_LINE_WIDTH_BIT); + consumer_pipeline_info_ptr->toggle_dynamic_state (true, /* should_enable */ + Anvil::DynamicState::LINE_WIDTH); gfx_manager_ptr->add_pipeline(std::move(consumer_pipeline_info_ptr), &m_consumer_pipeline_id); @@ -1035,17 +1034,17 @@ void App::init_images() Anvil::ImageType::_2D, Anvil::Format::D16_UNORM, Anvil::ImageTiling::OPTIMAL, - Anvil::IMAGE_USAGE_FLAG_DEPTH_STENCIL_ATTACHMENT_BIT, + Anvil::ImageUsageFlagBits::DEPTH_STENCIL_ATTACHMENT_BIT, WINDOW_WIDTH, WINDOW_HEIGHT, 1, /* in_base_mipmap_depth */ 1, /* in_n_layers */ - Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + Anvil::SampleCountFlagBits::_1_BIT, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::SharingMode::EXCLUSIVE, false, /* in_use_full_mipmap_chain */ - 0, /* in_memory_features */ - 0, /* in_create_flags */ + Anvil::MemoryFeatureFlagBits::NONE, + Anvil::ImageCreateFlagBits::NONE, Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, nullptr); /* in_mipmaps_ptr */ @@ -1058,7 +1057,7 @@ void App::init_images() 0, /* n_base_layer */ 0, /* n_base_mipmap_level */ 1, /* n_mipmaps */ - Anvil::IMAGE_ASPECT_FLAG_DEPTH_BIT, + Anvil::ImageAspectFlagBits::DEPTH_BIT, m_depth_images[n_depth_image]->get_create_info_ptr()->get_format(), Anvil::ComponentSwizzle::IDENTITY, Anvil::ComponentSwizzle::IDENTITY, @@ -1119,15 +1118,15 @@ void App::init_shaders() cs_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_producer_comp, - Anvil::SHADER_STAGE_COMPUTE); + Anvil::ShaderStage::COMPUTE); fs_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_consumer_frag, - Anvil::SHADER_STAGE_FRAGMENT); + Anvil::ShaderStage::FRAGMENT); vs_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_consumer_vert, - Anvil::SHADER_STAGE_VERTEX); + Anvil::ShaderStage::VERTEX); /* Set up GLSLShader instances */ cs_ptr->add_definition_value_pair("N_SINE_PAIRS", @@ -1154,17 +1153,17 @@ void App::init_shaders() m_producer_cs_ptr.reset( new Anvil::ShaderModuleStageEntryPoint("main", std::move(cs_module_ptr), - Anvil::SHADER_STAGE_COMPUTE) + Anvil::ShaderStage::COMPUTE) ); m_consumer_fs_ptr.reset( new Anvil::ShaderModuleStageEntryPoint("main", std::move(fs_module_ptr), - Anvil::SHADER_STAGE_FRAGMENT) + Anvil::ShaderStage::FRAGMENT) ); m_consumer_vs_ptr.reset( new Anvil::ShaderModuleStageEntryPoint("main", std::move(vs_module_ptr), - Anvil::SHADER_STAGE_VERTEX) + Anvil::ShaderStage::VERTEX) ); } @@ -1180,8 +1179,8 @@ void App::init_swapchain() m_swapchain_ptr = reinterpret_cast(m_device_ptr.get())->create_swapchain(m_rendering_surface_ptr.get(), m_window_ptr.get (), Anvil::Format::B8G8R8A8_UNORM, - VK_PRESENT_MODE_FIFO_KHR, - Anvil::IMAGE_USAGE_FLAG_COLOR_ATTACHMENT_BIT, + Anvil::PresentModeKHR::FIFO_KHR, + Anvil::ImageUsageFlagBits::COLOR_ATTACHMENT_BIT, m_n_swapchain_images); m_swapchain_ptr->set_name("Main swapchain"); diff --git a/examples/MultiViewport/src/app.cpp b/examples/MultiViewport/src/app.cpp index 74a6c82f..833518aa 100644 --- a/examples/MultiViewport/src/app.cpp +++ b/examples/MultiViewport/src/app.cpp @@ -226,12 +226,12 @@ void App::deinit() void App::draw_frame() { - Anvil::Semaphore* curr_frame_signal_semaphore_ptr = nullptr; - Anvil::Semaphore* curr_frame_wait_semaphore_ptr = nullptr; - static uint32_t n_frames_rendered = 0; - uint32_t n_swapchain_image; - auto present_queue_ptr = m_device_ptr->get_universal_queue(0); - const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; + Anvil::Semaphore* curr_frame_signal_semaphore_ptr = nullptr; + Anvil::Semaphore* curr_frame_wait_semaphore_ptr = nullptr; + static uint32_t n_frames_rendered = 0; + uint32_t n_swapchain_image; + auto present_queue_ptr = m_device_ptr->get_universal_queue(0); + const Anvil::PipelineStageFlags wait_stage_mask = Anvil::PipelineStageFlagBits::ALL_COMMANDS_BIT; /* Determine the signal + wait semaphores to use for drawing this frame */ m_n_last_semaphore_used = (m_n_last_semaphore_used + 1) % m_n_swapchain_images; @@ -476,10 +476,10 @@ void App::init_buffers() /* Initialize the buffer object */ auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr.get(), get_mesh_data_size(), - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::SharingMode::EXCLUSIVE, - Anvil::BUFFER_USAGE_FLAG_VERTEX_BUFFER_BIT, - 0); /* in_memory_features */ + Anvil::BufferUsageFlagBits::VERTEX_BUFFER_BIT, + Anvil::MemoryFeatureFlagBits::NONE); /* in_memory_features */ create_info_ptr->set_client_data(mesh_data_ptr.get() ); @@ -488,15 +488,15 @@ void App::init_buffers() void App::init_command_buffers() { - auto gfx_pipeline_manager_ptr(m_device_ptr->get_graphics_pipeline_manager() ); - VkImageSubresourceRange subresource_range; - auto universal_queue_ptr (m_device_ptr->get_universal_queue(0) ); + auto gfx_pipeline_manager_ptr(m_device_ptr->get_graphics_pipeline_manager() ); + Anvil::ImageSubresourceRange subresource_range; + auto universal_queue_ptr (m_device_ptr->get_universal_queue(0) ); - subresource_range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; - subresource_range.baseArrayLayer = 0; - subresource_range.baseMipLevel = 0; - subresource_range.layerCount = 1; - subresource_range.levelCount = 1; + subresource_range.aspect_mask = Anvil::ImageAspectFlagBits::COLOR_BIT; + subresource_range.base_array_layer = 0; + subresource_range.base_mip_level = 0; + subresource_range.layer_count = 1; + subresource_range.level_count = 1; /* Set up rendering command buffers. We need one per swap-chain image. */ uint32_t n_universal_queue_family_indices = 0; @@ -520,9 +520,8 @@ void App::init_command_buffers() { /* Switch the swap-chain image layout to renderable */ { - Anvil::ImageBarrier image_barrier(0, /* source_access_mask */ - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, - false, + Anvil::ImageBarrier image_barrier(Anvil::AccessFlagBits::NONE, /* source_access_mask */ + Anvil::AccessFlagBits::COLOR_ATTACHMENT_WRITE_BIT, Anvil::ImageLayout::UNDEFINED, Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, universal_queue_ptr->get_queue_family_index(), @@ -530,9 +529,9 @@ void App::init_command_buffers() m_swapchain_ptr->get_image(n_current_swapchain_image), subresource_range); - cmd_buffer_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - VK_FALSE, /* in_by_region */ + cmd_buffer_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::TOP_OF_PIPE_BIT, + Anvil::PipelineStageFlagBits::COLOR_ATTACHMENT_OUTPUT_BIT, + Anvil::DependencyFlagBits::NONE, 0, /* in_memory_barrier_count */ nullptr, /* in_memory_barrier_ptrs */ 0, /* in_buffer_memory_barrier_count */ @@ -564,7 +563,7 @@ void App::init_command_buffers() m_fbos[n_current_swapchain_image].get(), render_area, m_renderpass_ptr.get(), - VK_SUBPASS_CONTENTS_INLINE); + Anvil::SubpassContents::INLINE); { Anvil::Buffer* mesh_data_buffer_per_binding[g_n_attribute_bindings] = { @@ -582,7 +581,7 @@ void App::init_command_buffers() mesh_data_buffer_data_offset_per_binding[g_color4_attribute_binding] = get_mesh_color_data_start_offset (3 /* n_stream */); mesh_data_buffer_data_offset_per_binding[g_vertex_attribute_binding] = get_mesh_vertex_data_start_offset(); - cmd_buffer_ptr->record_bind_pipeline (VK_PIPELINE_BIND_POINT_GRAPHICS, + cmd_buffer_ptr->record_bind_pipeline (Anvil::PipelineBindPoint::GRAPHICS, m_pipeline_id); cmd_buffer_ptr->record_bind_vertex_buffers(0, /* startBinding */ g_n_attribute_bindings, @@ -601,9 +600,8 @@ void App::init_command_buffers() /* Change the swap-chain image's layout to presentable */ { - Anvil::ImageBarrier image_barrier(VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, /* source_access_mask */ - VK_ACCESS_MEMORY_READ_BIT, /* destination_access_mask */ - false, + Anvil::ImageBarrier image_barrier(Anvil::AccessFlagBits::COLOR_ATTACHMENT_WRITE_BIT, /* source_access_mask */ + Anvil::AccessFlagBits::MEMORY_READ_BIT, /* destination_access_mask */ Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL,/* old_image_layout */ #ifdef ENABLE_OFFSCREEN_RENDERING Anvil::ImageLayout::GENERAL, /* new_image_layout */ @@ -615,9 +613,9 @@ void App::init_command_buffers() m_swapchain_ptr->get_image(n_current_swapchain_image), subresource_range); - cmd_buffer_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, - VK_FALSE, /* in_by_region */ + cmd_buffer_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::COLOR_ATTACHMENT_OUTPUT_BIT, + Anvil::PipelineStageFlagBits::ALL_COMMANDS_BIT, + Anvil::DependencyFlagBits::NONE, 0, /* in_memory_barrier_count */ nullptr, /* in_memory_barrier_ptrs */ 0, /* in_buffer_memory_barrier_count */ @@ -681,9 +679,9 @@ void App::init_gfx_pipelines() Anvil::RenderPassCreateInfoUniquePtr render_pass_create_info_ptr(new Anvil::RenderPassCreateInfo(m_device_ptr.get() ) ); render_pass_create_info_ptr->add_color_attachment (m_swapchain_ptr->get_create_info_ptr()->get_format(), - Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, - VK_ATTACHMENT_LOAD_OP_CLEAR, - VK_ATTACHMENT_STORE_OP_STORE, + Anvil::SampleCountFlagBits::_1_BIT, + Anvil::AttachmentLoadOp::CLEAR, + Anvil::AttachmentStoreOp::STORE, Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, false, /* may_alias */ @@ -713,44 +711,44 @@ void App::init_gfx_pipelines() *m_vs_ptr); gfx_pipeline_create_info_ptr->set_n_dynamic_viewports (sizeof(scissors) / sizeof(scissors[0]) ); - gfx_pipeline_create_info_ptr->set_primitive_topology (VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN); - gfx_pipeline_create_info_ptr->set_rasterization_properties(VK_POLYGON_MODE_FILL, - VK_CULL_MODE_NONE, - VK_FRONT_FACE_COUNTER_CLOCKWISE, + gfx_pipeline_create_info_ptr->set_primitive_topology (Anvil::PrimitiveTopology::TRIANGLE_FAN); + gfx_pipeline_create_info_ptr->set_rasterization_properties(Anvil::PolygonMode::FILL, + Anvil::CullModeFlagBits::NONE, + Anvil::FrontFace::COUNTER_CLOCKWISE, 1.0f /* line_width */); - gfx_pipeline_create_info_ptr->toggle_dynamic_states (true, /* should_enable */ - Anvil::DYNAMIC_STATE_VIEWPORT_BIT); + gfx_pipeline_create_info_ptr->toggle_dynamic_state (true, /* should_enable */ + Anvil::DynamicState::VIEWPORT); gfx_pipeline_create_info_ptr->toggle_primitive_restart (true /* should_enable */); gfx_pipeline_create_info_ptr->add_vertex_attribute(g_vertex_attribute_location, mesh_vertex_data_format, 0, /* offset_in_bytes */ sizeof(float) * n_mesh_vertex_components, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX, + Anvil::VertexInputRate::VERTEX, g_vertex_attribute_binding); gfx_pipeline_create_info_ptr->add_vertex_attribute(g_color1_attribute_location, mesh_color_data_format, 0, /* offset_in_bytes */ sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX, + Anvil::VertexInputRate::VERTEX, g_color1_attribute_binding); gfx_pipeline_create_info_ptr->add_vertex_attribute(g_color2_attribute_location, mesh_color_data_format, 0, /* offset_in_bytes */ sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX, + Anvil::VertexInputRate::VERTEX, g_color2_attribute_binding); gfx_pipeline_create_info_ptr->add_vertex_attribute(g_color3_attribute_location, mesh_color_data_format, 0, /* offset_in_bytes */ sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX, + Anvil::VertexInputRate::VERTEX, g_color3_attribute_binding); gfx_pipeline_create_info_ptr->add_vertex_attribute(g_color4_attribute_location, mesh_color_data_format, 0, /* offset_in_bytes */ sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX, + Anvil::VertexInputRate::VERTEX, g_color4_attribute_binding); for (uint32_t n_scissor_box = 0; @@ -811,15 +809,15 @@ void App::init_shaders() fragment_shader_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_render_frag, - Anvil::SHADER_STAGE_FRAGMENT); + Anvil::ShaderStage::FRAGMENT); vertex_shader_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_render_vert, - Anvil::SHADER_STAGE_VERTEX); + Anvil::ShaderStage::VERTEX); geometry_shader_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_render_geom, - Anvil::SHADER_STAGE_GEOMETRY); + Anvil::ShaderStage::GEOMETRY); fs_module_ptr = Anvil::ShaderModule::create_from_spirv_generator(m_device_ptr.get (), fragment_shader_ptr.get() ); @@ -836,19 +834,19 @@ void App::init_shaders() new Anvil::ShaderModuleStageEntryPoint( "main", std::move(fs_module_ptr), - Anvil::SHADER_STAGE_FRAGMENT) + Anvil::ShaderStage::FRAGMENT) ); m_gs_ptr.reset( new Anvil::ShaderModuleStageEntryPoint( "main", std::move(gs_module_ptr), - Anvil::SHADER_STAGE_GEOMETRY) + Anvil::ShaderStage::GEOMETRY) ); m_vs_ptr.reset( new Anvil::ShaderModuleStageEntryPoint( "main", std::move(vs_module_ptr), - Anvil::SHADER_STAGE_VERTEX) + Anvil::ShaderStage::VERTEX) ); } @@ -864,8 +862,8 @@ void App::init_swapchain() m_swapchain_ptr = dynamic_cast(m_device_ptr.get() )->create_swapchain(m_rendering_surface_ptr.get(), m_window_ptr.get (), Anvil::Format::B8G8R8A8_UNORM, - VK_PRESENT_MODE_FIFO_KHR, - Anvil::IMAGE_USAGE_FLAG_COLOR_ATTACHMENT_BIT, + Anvil::PresentModeKHR::FIFO_KHR, + Anvil::ImageUsageFlagBits::COLOR_ATTACHMENT_BIT, m_n_swapchain_images); m_swapchain_ptr->set_name("Main swapchain"); diff --git a/examples/OcclusionQuery/src/app.cpp b/examples/OcclusionQuery/src/app.cpp index 47051ccd..4509f931 100644 --- a/examples/OcclusionQuery/src/app.cpp +++ b/examples/OcclusionQuery/src/app.cpp @@ -260,13 +260,13 @@ void App::deinit() void App::draw_frame() { - Anvil::Semaphore* curr_frame_signal_semaphore_ptr = nullptr; - Anvil::Semaphore* curr_frame_wait_semaphore_ptr = nullptr; - static uint32_t n_frames_rendered = 0; - uint32_t n_swapchain_image; - Anvil::Queue* present_queue_ptr = m_device_ptr->get_universal_queue(0); - Anvil::Semaphore* present_wait_semaphore_ptr = nullptr; - const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; + Anvil::Semaphore* curr_frame_signal_semaphore_ptr = nullptr; + Anvil::Semaphore* curr_frame_wait_semaphore_ptr = nullptr; + static uint32_t n_frames_rendered = 0; + uint32_t n_swapchain_image; + Anvil::Queue* present_queue_ptr = m_device_ptr->get_universal_queue(0); + Anvil::Semaphore* present_wait_semaphore_ptr = nullptr; + const Anvil::PipelineStageFlags wait_stage_mask = Anvil::PipelineStageFlagBits::ALL_COMMANDS_BIT; /* Determine the signal + wait semaphores to use for drawing this frame */ m_n_last_semaphore_used = (m_n_last_semaphore_used + 1) % m_n_swapchain_images; @@ -354,10 +354,10 @@ void App::init_buffers() { auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr.get(), m_n_bytes_per_query * N_SWAPCHAIN_IMAGES, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::SharingMode::EXCLUSIVE, - Anvil::BUFFER_USAGE_FLAG_UNIFORM_BUFFER_BIT | Anvil::BUFFER_USAGE_FLAG_TRANSFER_DST_BIT, - 0); /* in_memory_features */ + Anvil::BufferUsageFlagBits::UNIFORM_BUFFER_BIT | Anvil::BufferUsageFlagBits::TRANSFER_DST_BIT, + Anvil::MemoryFeatureFlagBits::NONE); /* in_memory_features */ m_query_bo_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -365,10 +365,10 @@ void App::init_buffers() { auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr.get(), m_time_n_bytes_per_swapchain_image * N_SWAPCHAIN_IMAGES, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::SharingMode::EXCLUSIVE, - Anvil::BUFFER_USAGE_FLAG_UNIFORM_BUFFER_BIT, - Anvil::MEMORY_FEATURE_FLAG_MAPPABLE); + Anvil::BufferUsageFlagBits::UNIFORM_BUFFER_BIT, + Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT); m_time_bo_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -421,14 +421,14 @@ void App::init_command_buffers() true); /* simultaneous_use_allowed */ { render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_reset_event(m_query_data_copied_event.get(), - VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT); + Anvil::PipelineStageFlagBits::TOP_OF_PIPE_BIT); render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_begin_render_pass(sizeof(clear_values) / sizeof(clear_values[0]), clear_values, m_fbos[n_command_buffer].get(), render_area, m_renderpass_tris_ptr.get(), - VK_SUBPASS_CONTENTS_INLINE); + Anvil::SubpassContents::INLINE); { if (is_ext_debug_marker_supported) { @@ -437,9 +437,9 @@ void App::init_command_buffers() } /* Draw the left triangle. */ - render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_bind_pipeline (VK_PIPELINE_BIND_POINT_GRAPHICS, + render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_bind_pipeline (Anvil::PipelineBindPoint::GRAPHICS, m_1stpass_depth_test_always_pipeline_id); - render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_bind_descriptor_sets(VK_PIPELINE_BIND_POINT_GRAPHICS, + render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_bind_descriptor_sets(Anvil::PipelineBindPoint::GRAPHICS, gfx_pipeline_manager_ptr->get_pipeline_layout(m_1stpass_depth_test_always_pipeline_id), 0, /* in_first_set */ 1, /* in_set_count */ @@ -460,7 +460,7 @@ void App::init_command_buffers() /* Proceed to the next subpass, where we render the right triangle with depth test configured to EQUAL. * At the same time, we count how many fragments passed the test. We're going to use that data to * determine the shade of the quad underneath two triangles. */ - render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_next_subpass(VK_SUBPASS_CONTENTS_INLINE); + render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_next_subpass(Anvil::SubpassContents::INLINE); if (is_ext_debug_marker_supported) { @@ -468,12 +468,12 @@ void App::init_command_buffers() nullptr); /* in_opt_color */ } - render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_bind_pipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, + render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_bind_pipeline(Anvil::PipelineBindPoint::GRAPHICS, m_1stpass_depth_test_equal_pipeline_id); render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_begin_query(m_query_pool_ptr.get(), n_command_buffer, - 0); /* in_flags */ + Anvil::QueryControlFlagBits::NONE); /* in_flags */ { render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_draw(3, /* in_vertex_count */ 1, /* in_instance_count */ @@ -498,7 +498,7 @@ void App::init_command_buffers() 0, /* in_dst_stride */ VK_QUERY_RESULT_WAIT_BIT); render_tri1_and_generate_ot_data_cmd_buffer_ptr->record_set_event (m_query_data_copied_event.get(), - VK_PIPELINE_STAGE_TRANSFER_BIT); + Anvil::PipelineStageFlagBits::TRANSFER_BIT); } render_tri1_and_generate_ot_data_cmd_buffer_ptr->stop_recording(); @@ -506,8 +506,8 @@ void App::init_command_buffers() true); /* simultaneous_use_allowed */ { /* Wait until query data arrives */ - Anvil::BufferBarrier query_data_barrier (VK_ACCESS_TRANSFER_WRITE_BIT, - VK_ACCESS_UNIFORM_READ_BIT, + Anvil::BufferBarrier query_data_barrier (Anvil::AccessFlagBits::TRANSFER_WRITE_BIT, + Anvil::AccessFlagBits::UNIFORM_READ_BIT, universal_queue_family_indices[0], universal_queue_family_indices[0], m_query_bo_ptr.get(), @@ -517,8 +517,8 @@ void App::init_command_buffers() render_tri2_and_quad_cmd_buffer_ptr->record_wait_events(1, /* in_event_count */ &query_data_copied_event_raw_ptr, - VK_PIPELINE_STAGE_TRANSFER_BIT, - VK_PIPELINE_STAGE_VERTEX_SHADER_BIT, + Anvil::PipelineStageFlagBits::TRANSFER_BIT, + Anvil::PipelineStageFlagBits::VERTEX_SHADER_BIT, 0, /* in_memory_barrier_count */ nullptr, /* in_memory_barriers_ptr */ 1, /* in_buffer_memory_barrier_count */ @@ -538,11 +538,11 @@ void App::init_command_buffers() m_fbos[n_command_buffer].get(), render_area, m_renderpass_quad_ptr.get(), - VK_SUBPASS_CONTENTS_INLINE); + Anvil::SubpassContents::INLINE); { - render_tri2_and_quad_cmd_buffer_ptr->record_bind_pipeline (VK_PIPELINE_BIND_POINT_GRAPHICS, + render_tri2_and_quad_cmd_buffer_ptr->record_bind_pipeline (Anvil::PipelineBindPoint::GRAPHICS, m_2ndpass_depth_test_off_tri_pipeline_id); - render_tri2_and_quad_cmd_buffer_ptr->record_bind_descriptor_sets(VK_PIPELINE_BIND_POINT_GRAPHICS, + render_tri2_and_quad_cmd_buffer_ptr->record_bind_descriptor_sets(Anvil::PipelineBindPoint::GRAPHICS, gfx_pipeline_manager_ptr->get_pipeline_layout(m_2ndpass_depth_test_off_tri_pipeline_id), 0, /* in_first_set */ 1, /* in_set_count */ @@ -556,11 +556,11 @@ void App::init_command_buffers() 1); /* in_first_instance */ /* Draw the quad */ - render_tri2_and_quad_cmd_buffer_ptr->record_next_subpass(VK_SUBPASS_CONTENTS_INLINE); + render_tri2_and_quad_cmd_buffer_ptr->record_next_subpass(Anvil::SubpassContents::INLINE); - render_tri2_and_quad_cmd_buffer_ptr->record_bind_pipeline (VK_PIPELINE_BIND_POINT_GRAPHICS, + render_tri2_and_quad_cmd_buffer_ptr->record_bind_pipeline (Anvil::PipelineBindPoint::GRAPHICS, m_2ndpass_depth_test_off_quad_pipeline_id); - render_tri2_and_quad_cmd_buffer_ptr->record_bind_descriptor_sets(VK_PIPELINE_BIND_POINT_GRAPHICS, + render_tri2_and_quad_cmd_buffer_ptr->record_bind_descriptor_sets(Anvil::PipelineBindPoint::GRAPHICS, gfx_pipeline_manager_ptr->get_pipeline_layout(m_2ndpass_depth_test_off_quad_pipeline_id), 0, /* in_first_set */ 1, /* in_set_count */ @@ -596,17 +596,17 @@ void App::init_dsgs() dsg_1stpass_create_info_ptrs[0]->add_binding (0, /* binding */ - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, + Anvil::DescriptorType::UNIFORM_BUFFER_DYNAMIC, 1, /* n_elements */ - VK_SHADER_STAGE_VERTEX_BIT); + Anvil::ShaderStageFlagBits::VERTEX_BIT); tri_dsg_2ndpass_create_info_ptrs[0]->add_binding (0, /* binding */ - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, + Anvil::DescriptorType::UNIFORM_BUFFER_DYNAMIC, 1, /* n_elements */ - VK_SHADER_STAGE_VERTEX_BIT); + Anvil::ShaderStageFlagBits::VERTEX_BIT); quad_dsg_2ndpass_create_info_ptrs[0]->add_binding(0, /* binding */ - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, + Anvil::DescriptorType::UNIFORM_BUFFER_DYNAMIC, 1, /* n_elements */ - VK_SHADER_STAGE_VERTEX_BIT); + Anvil::ShaderStageFlagBits::VERTEX_BIT); m_1stpass_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), dsg_1stpass_create_info_ptrs, @@ -676,17 +676,17 @@ void App::init_images() Anvil::ImageType::_2D, Anvil::Format::D16_UNORM, Anvil::ImageTiling::OPTIMAL, - Anvil::IMAGE_USAGE_FLAG_DEPTH_STENCIL_ATTACHMENT_BIT, + Anvil::ImageUsageFlagBits::DEPTH_STENCIL_ATTACHMENT_BIT, WINDOW_WIDTH, WINDOW_HEIGHT, 1, /* base_mipmap_depth */ 1, /* n_layers */ - Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + Anvil::SampleCountFlagBits::_1_BIT, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::SharingMode::EXCLUSIVE, - false, /* use_full_mipmap_chain */ - 0, /* in_memory_features */ - false, /* is_mutable */ + false, /* use_full_mipmap_chain */ + Anvil::MemoryFeatureFlagBits::NONE, /* in_memory_features */ + Anvil::ImageCreateFlagBits::NONE, Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, nullptr); @@ -699,7 +699,7 @@ void App::init_images() 0, /* n_base_layer */ 0, /* n_base_mipmap_level */ 1, /* n_mipmaps */ - Anvil::IMAGE_ASPECT_FLAG_DEPTH_BIT, + Anvil::ImageAspectFlagBits::DEPTH_BIT, m_depth_image_ptr->get_create_info_ptr()->get_format(), Anvil::ComponentSwizzle::IDENTITY, Anvil::ComponentSwizzle::IDENTITY, @@ -737,10 +737,10 @@ void App::init_renderpasses() ); renderpass_info_ptr->add_color_attachment(m_swapchain_ptr->get_create_info_ptr()->get_format(), - Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, - (!is_2nd_renderpass) ? VK_ATTACHMENT_LOAD_OP_CLEAR - : VK_ATTACHMENT_LOAD_OP_LOAD, - VK_ATTACHMENT_STORE_OP_STORE, + Anvil::SampleCountFlagBits::_1_BIT, + (!is_2nd_renderpass) ? Anvil::AttachmentLoadOp::CLEAR + : Anvil::AttachmentLoadOp::LOAD, + Anvil::AttachmentStoreOp::STORE, Anvil::ImageLayout::UNDEFINED, #ifdef ENABLE_OFFSCREEN_RENDERING Anvil::ImageLayout::GENERAL, @@ -751,12 +751,12 @@ void App::init_renderpasses() &color_attachment_id); renderpass_info_ptr->add_depth_stencil_attachment(m_depth_image_ptr->get_create_info_ptr()->get_format(), - Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, - (!is_2nd_renderpass) ? VK_ATTACHMENT_LOAD_OP_CLEAR - : VK_ATTACHMENT_LOAD_OP_LOAD, - VK_ATTACHMENT_STORE_OP_STORE, - VK_ATTACHMENT_LOAD_OP_DONT_CARE, /* stencil_load_op */ - VK_ATTACHMENT_STORE_OP_DONT_CARE, /* stencil_store_op */ + Anvil::SampleCountFlagBits::_1_BIT, + (!is_2nd_renderpass) ? Anvil::AttachmentLoadOp::CLEAR + : Anvil::AttachmentLoadOp::LOAD, + Anvil::AttachmentStoreOp::STORE, + Anvil::AttachmentLoadOp::DONT_CARE, /* stencil_load_op */ + Anvil::AttachmentStoreOp::DONT_CARE, /* stencil_store_op */ Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, false, /* may_alias */ @@ -783,11 +783,11 @@ void App::init_renderpasses() * as the rasterized geometry never overlaps, we have to define a dependency .. */ renderpass_info_ptr->add_subpass_to_subpass_dependency(m_renderpass_2ndpass_depth_test_off_tri_subpass_id, m_renderpass_2ndpass_depth_test_off_quad_subpass_id, - VK_PIPELINE_STAGE_VERTEX_SHADER_BIT, /* in_source_stage_mask */ - VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, /* in_destination_stage_mask */ - 0, /* in_source_access_mask */ - 0, /* in_destination_access_mask */ - VK_TRUE); /* in_by_region */ + Anvil::PipelineStageFlagBits::VERTEX_SHADER_BIT, /* in_source_stage_mask */ + Anvil::PipelineStageFlagBits::TOP_OF_PIPE_BIT, /* in_destination_stage_mask */ + Anvil::AccessFlagBits::NONE, /* in_source_access_mask */ + Anvil::AccessFlagBits::NONE, /* in_destination_access_mask */ + Anvil::DependencyFlagBits::BY_REGION_BIT); /* in_by_region */ } else { @@ -816,11 +816,11 @@ void App::init_renderpasses() /* depth_test_equal_ot subpass must not start before depth_test_always subpass finishes rasterizing */ renderpass_info_ptr->add_subpass_to_subpass_dependency(m_renderpass_1stpass_depth_test_always_subpass_id, m_renderpass_1stpass_depth_test_equal_ot_subpass_id, - VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, /* in_source_stage_mask */ - VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT, /* in_destination_stage_mask */ - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT, - VK_TRUE); /* in_by_region */ + Anvil::PipelineStageFlagBits::LATE_FRAGMENT_TESTS_BIT, /* in_source_stage_mask */ + Anvil::PipelineStageFlagBits::EARLY_FRAGMENT_TESTS_BIT, /* in_destination_stage_mask */ + Anvil::AccessFlagBits::DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, + Anvil::AccessFlagBits::DEPTH_STENCIL_ATTACHMENT_READ_BIT, + Anvil::DependencyFlagBits::BY_REGION_BIT); } renderpass_ptr = Anvil::RenderPass::create(std::move(renderpass_info_ptr), @@ -856,7 +856,7 @@ void App::init_renderpasses() depth_test_off_tri_subpass_gfx_pipeline_create_info_ptr->set_descriptor_set_create_info (m_2ndpass_tri_dsg_ptr->get_descriptor_set_create_info () ); depth_test_off_quad_subpass_gfx_pipeline_create_info_ptr->set_descriptor_set_create_info(m_2ndpass_quad_dsg_ptr->get_descriptor_set_create_info() ); - depth_test_off_quad_subpass_gfx_pipeline_create_info_ptr->set_primitive_topology(VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP); + depth_test_off_quad_subpass_gfx_pipeline_create_info_ptr->set_primitive_topology(Anvil::PrimitiveTopology::TRIANGLE_STRIP); gfx_pipeline_manager_ptr->add_pipeline(std::move(depth_test_off_quad_subpass_gfx_pipeline_create_info_ptr), @@ -889,12 +889,12 @@ void App::init_renderpasses() depth_test_always_subpass_gfx_pipeline_create_info_ptr->set_descriptor_set_create_info(m_1stpass_dsg_ptr->get_descriptor_set_create_info() ); depth_test_always_subpass_gfx_pipeline_create_info_ptr->toggle_depth_test (true, /* in_should_enable */ - VK_COMPARE_OP_ALWAYS); + Anvil::CompareOp::ALWAYS); depth_test_always_subpass_gfx_pipeline_create_info_ptr->toggle_depth_writes (true); /* in_should_enable */ depth_test_equal_ot_subpass_gfx_pipeline_create_info_ptr->set_descriptor_set_create_info(m_1stpass_dsg_ptr->get_descriptor_set_create_info() ); depth_test_equal_ot_subpass_gfx_pipeline_create_info_ptr->toggle_depth_test (true, /* in_should_enable */ - VK_COMPARE_OP_EQUAL); + Anvil::CompareOp::EQUAL); depth_test_equal_ot_subpass_gfx_pipeline_create_info_ptr->toggle_depth_writes (true); /* in_should_enable */ @@ -953,19 +953,19 @@ void App::init_shaders() fs_quad_glsl_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_render_quad_frag, - Anvil::SHADER_STAGE_FRAGMENT); + Anvil::ShaderStage::FRAGMENT); fs_tri_glsl_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_render_tri_frag, - Anvil::SHADER_STAGE_FRAGMENT); + Anvil::ShaderStage::FRAGMENT); vs_quad_glsl_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_render_quad_vert, - Anvil::SHADER_STAGE_VERTEX); + Anvil::ShaderStage::VERTEX); vs_tri_glsl_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_render_tri_vert, - Anvil::SHADER_STAGE_VERTEX); + Anvil::ShaderStage::VERTEX); vs_quad_glsl_ptr->add_definition_value_pair("N_SWAPCHAIN_IMAGES", N_SWAPCHAIN_IMAGES); @@ -989,22 +989,22 @@ void App::init_shaders() m_quad_fs_ptr.reset( new Anvil::ShaderModuleStageEntryPoint("main", std::move(fs_quad_module_ptr), - Anvil::SHADER_STAGE_FRAGMENT) + Anvil::ShaderStage::FRAGMENT) ); m_quad_vs_ptr.reset( new Anvil::ShaderModuleStageEntryPoint("main", std::move(vs_quad_module_ptr), - Anvil::SHADER_STAGE_VERTEX) + Anvil::ShaderStage::VERTEX) ); m_tri_fs_ptr.reset( new Anvil::ShaderModuleStageEntryPoint("main", std::move(fs_tri_module_ptr), - Anvil::SHADER_STAGE_FRAGMENT) + Anvil::ShaderStage::FRAGMENT) ); m_tri_vs_ptr.reset( new Anvil::ShaderModuleStageEntryPoint("main", std::move(vs_tri_module_ptr), - Anvil::SHADER_STAGE_VERTEX) + Anvil::ShaderStage::VERTEX) ); } @@ -1020,8 +1020,8 @@ void App::init_swapchain() m_swapchain_ptr = reinterpret_cast(m_device_ptr.get() )->create_swapchain(m_rendering_surface_ptr.get(), m_window_ptr.get (), Anvil::Format::B8G8R8A8_UNORM, - VK_PRESENT_MODE_FIFO_KHR, - Anvil::IMAGE_USAGE_FLAG_COLOR_ATTACHMENT_BIT, + Anvil::PresentModeKHR::FIFO_KHR, + Anvil::ImageUsageFlagBits::COLOR_ATTACHMENT_BIT, m_n_swapchain_images); m_swapchain_ptr->set_name("Main swapchain"); diff --git a/examples/OutOfOrderRasterization/src/app.cpp b/examples/OutOfOrderRasterization/src/app.cpp index d5fade47..18f4e9e9 100644 --- a/examples/OutOfOrderRasterization/src/app.cpp +++ b/examples/OutOfOrderRasterization/src/app.cpp @@ -265,21 +265,21 @@ void App::deinit() void App::draw_frame() { - const Anvil::DeviceType device_type = m_device_ptr->get_type(); - static const VkPipelineStageFlags dst_stage_mask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; - Anvil::Semaphore* frame_ready_for_present_semaphores [4]; - Anvil::SemaphoreMGPUSubmission frame_ready_for_present_submissions [4]; - Anvil::SemaphoreMGPUSubmission frame_ready_to_render_submissions [4]; - uint32_t n_physical_devices; - uint32_t n_swapchain_image; - const Anvil::PhysicalDevice* physical_device_ptr = nullptr; - const Anvil::PhysicalDevice* const* physical_devices_ptr = nullptr; - Anvil::PrimaryCommandBuffer* render_cmdbuffer_ptr = nullptr; - const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; + const Anvil::DeviceType device_type = m_device_ptr->get_type(); + static const Anvil::PipelineStageFlags dst_stage_mask = Anvil::PipelineStageFlagBits::TOP_OF_PIPE_BIT; + Anvil::Semaphore* frame_ready_for_present_semaphores [4]; + Anvil::SemaphoreMGPUSubmission frame_ready_for_present_submissions [4]; + Anvil::SemaphoreMGPUSubmission frame_ready_to_render_submissions [4]; + uint32_t n_physical_devices; + uint32_t n_swapchain_image; + const Anvil::PhysicalDevice* physical_device_ptr = nullptr; + const Anvil::PhysicalDevice* const* physical_devices_ptr = nullptr; + Anvil::PrimaryCommandBuffer* render_cmdbuffer_ptr = nullptr; + const Anvil::PipelineStageFlags wait_stage_mask = Anvil::PipelineStageFlagBits::ALL_COMMANDS_BIT; switch (device_type) { - case Anvil::DEVICE_TYPE_SINGLE_GPU: + case Anvil::DeviceType::SINGLE_GPU: { const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr.get() ) ); @@ -425,7 +425,8 @@ void App::init_buffers() const VkDeviceSize index_data_size = data.get_index_data_size(); const VkDeviceSize properties_data_size = N_TEAPOTS * sizeof(float) * 8; /* rot_xyzX + pos_xyzX */ - const Anvil::MemoryFeatureFlags required_feature_flags = 0; + const Anvil::MemoryFeatureFlags required_feature_flags = Anvil::MemoryFeatureFlagBits::NONE; + Anvil::MGPUPeerMemoryRequirements required_peer_memory_feature_flags; const VkDeviceSize vertex_data_size = data.get_vertex_data_size(); allocator_ptr = Anvil::MemoryAllocator::create_oneshot(m_device_ptr.get() ); @@ -433,9 +434,9 @@ void App::init_buffers() { auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), index_data_size, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::SharingMode::EXCLUSIVE, - Anvil::BUFFER_USAGE_FLAG_INDEX_BUFFER_BIT); + Anvil::BufferUsageFlagBits::INDEX_BUFFER_BIT); m_index_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -443,9 +444,9 @@ void App::init_buffers() { auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), sizeof(uint64_t) * m_n_swapchain_images * 2, /* top of pipe, bottom of pipe */ - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::SharingMode::EXCLUSIVE, - Anvil::BUFFER_USAGE_FLAG_TRANSFER_SRC_BIT | Anvil::BUFFER_USAGE_FLAG_TRANSFER_DST_BIT); + Anvil::BufferUsageFlagBits::TRANSFER_SRC_BIT | Anvil::BufferUsageFlagBits::TRANSFER_DST_BIT); m_query_results_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -453,9 +454,9 @@ void App::init_buffers() { auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), vertex_data_size, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::SharingMode::EXCLUSIVE, - Anvil::BUFFER_USAGE_FLAG_VERTEX_BUFFER_BIT); + Anvil::BufferUsageFlagBits::VERTEX_BUFFER_BIT); m_vertex_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -481,9 +482,9 @@ void App::init_buffers() { auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), properties_data_size, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::SharingMode::EXCLUSIVE, - Anvil::BUFFER_USAGE_FLAG_STORAGE_BUFFER_BIT); + Anvil::BufferUsageFlagBits::STORAGE_BUFFER_BIT); new_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -572,15 +573,15 @@ void App::init_command_buffers() Anvil::Framebuffer* framebuffer_ptr(m_framebuffers[n_render_cmdbuffer].get() ); Anvil::RenderPass* renderpass_ptr (m_renderpasses[n_render_cmdbuffer].get() ); - const Anvil::BufferBarrier query_result_barrier(VK_ACCESS_TRANSFER_WRITE_BIT, - VK_ACCESS_HOST_READ_BIT | VK_ACCESS_TRANSFER_READ_BIT, + const Anvil::BufferBarrier query_result_barrier(Anvil::AccessFlagBits::TRANSFER_WRITE_BIT, + Anvil::AccessFlagBits::HOST_READ_BIT | Anvil::AccessFlagBits::TRANSFER_READ_BIT, universal_queue_family_index, universal_queue_family_index, m_query_results_buffer_ptr.get(), sizeof(uint64_t) * n_render_cmdbuffer * 2, sizeof(uint64_t) * 2); - const Anvil::BufferBarrier props_buffer_barrier(VK_ACCESS_HOST_WRITE_BIT, - VK_ACCESS_SHADER_READ_BIT, + const Anvil::BufferBarrier props_buffer_barrier(Anvil::AccessFlagBits::HOST_WRITE_BIT, + Anvil::AccessFlagBits::SHADER_READ_BIT, universal_queue_family_index, universal_queue_family_index, m_properties_buffer_ptrs[n_render_cmdbuffer].get(), @@ -598,9 +599,9 @@ void App::init_command_buffers() { clear_values[0].color.float32[0] = (is_ooo_enabled) ? 1.0f : 0.0f; - cmdbuffer_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_HOST_BIT, - VK_PIPELINE_STAGE_VERTEX_SHADER_BIT, - VK_FALSE, /* in_by_region */ + cmdbuffer_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::HOST_BIT, + Anvil::PipelineStageFlagBits::VERTEX_SHADER_BIT, + Anvil::DependencyFlagBits::NONE, 0, /* in_memory_barrier_count */ nullptr, /* in_memory_barriers_ptr */ 1, /* in_buffer_memory_barrier_count */ @@ -608,7 +609,7 @@ void App::init_command_buffers() 0, /* in_image_memory_barrier_count */ nullptr); /* in_image_memory_barrier_ptrs */ - cmdbuffer_ptr->record_write_timestamp(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, + cmdbuffer_ptr->record_write_timestamp(Anvil::PipelineStageFlagBits::TOP_OF_PIPE_BIT, m_query_pool_ptr.get(), n_render_cmdbuffer * 2 /* top of pipe, bottom of pipe*/ + 0); @@ -618,15 +619,15 @@ void App::init_command_buffers() framebuffer_ptr, render_area, renderpass_ptr, - VK_SUBPASS_CONTENTS_INLINE); + Anvil::SubpassContents::INLINE); } { const uint32_t n_physical_devices(1); - cmdbuffer_ptr->record_bind_pipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, + cmdbuffer_ptr->record_bind_pipeline(Anvil::PipelineBindPoint::GRAPHICS, pipeline_id); - cmdbuffer_ptr->record_bind_descriptor_sets(VK_PIPELINE_BIND_POINT_GRAPHICS, + cmdbuffer_ptr->record_bind_descriptor_sets(Anvil::PipelineBindPoint::GRAPHICS, pipeline_layout_ptr, 0, /* in_first_set */ 1, /* in_set_count */ @@ -636,7 +637,7 @@ void App::init_command_buffers() cmdbuffer_ptr->record_bind_index_buffer (m_index_buffer_ptr.get(), 0, /* in_offset */ - VK_INDEX_TYPE_UINT32); + Anvil::IndexType::UINT32); cmdbuffer_ptr->record_bind_vertex_buffers(0, /* in_start_binding */ n_vertex_buffers, vertex_buffers, @@ -656,7 +657,7 @@ void App::init_command_buffers() } cmdbuffer_ptr->record_end_render_pass(); - cmdbuffer_ptr->record_write_timestamp (VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, + cmdbuffer_ptr->record_write_timestamp (Anvil::PipelineStageFlagBits::ALL_GRAPHICS_BIT, m_query_pool_ptr.get(), n_render_cmdbuffer * 2 /* top of pipe, bottom of pipe */ + 1); cmdbuffer_ptr->record_copy_query_pool_results(m_query_pool_ptr.get(), @@ -667,9 +668,9 @@ void App::init_command_buffers() sizeof(uint64_t), VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WAIT_BIT); - cmdbuffer_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_TRANSFER_BIT, - VK_PIPELINE_STAGE_HOST_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT, - VK_FALSE, /* in_by_region */ + cmdbuffer_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::TRANSFER_BIT, + Anvil::PipelineStageFlagBits::HOST_BIT | Anvil::PipelineStageFlagBits::TRANSFER_BIT, + Anvil::DependencyFlagBits::NONE, 0, /* in_memory_barrier_count */ nullptr, /* in_memory_barriers_ptr */ 1, /* in_buffer_memory_barrier_count */ @@ -701,9 +702,9 @@ void App::init_dsgs() new_dsg_create_info_ptr[0] = Anvil::DescriptorSetCreateInfo::create(); new_dsg_create_info_ptr[0]->add_binding(0, /* in_binding */ - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, + Anvil::DescriptorType::STORAGE_BUFFER, 1, /* in_n_elements */ - VK_SHADER_STAGE_VERTEX_BIT); + Anvil::ShaderStageFlagBits::VERTEX_BIT); new_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), new_dsg_create_info_ptr, @@ -752,29 +753,29 @@ void App::init_gfx_pipelines() Anvil::Format::R32G32B32_SFLOAT, 0, /* offset_in_bytes */ sizeof(float) * 3, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX); + Anvil::VertexInputRate::VERTEX); pipeline_create_info_ptr->set_descriptor_set_create_info(m_dsg_ptrs[0]->get_descriptor_set_create_info() ); - pipeline_create_info_ptr->set_primitive_topology (VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST); - pipeline_create_info_ptr->set_rasterization_properties(VK_POLYGON_MODE_FILL, - VK_CULL_MODE_BACK_BIT, - VK_FRONT_FACE_CLOCKWISE, + pipeline_create_info_ptr->set_primitive_topology (Anvil::PrimitiveTopology::TRIANGLE_LIST); + pipeline_create_info_ptr->set_rasterization_properties(Anvil::PolygonMode::FILL, + Anvil::CullModeFlagBits::CULL_MODE_BACK_BIT, + Anvil::FrontFace::CLOCKWISE, 4.0f); /* line_width */ pipeline_create_info_ptr->toggle_depth_test (true, /* should_enable */ - VK_COMPARE_OP_LESS); + Anvil::CompareOp::LESS); pipeline_create_info_ptr->toggle_depth_writes (true); if (!is_ooo_disabled) { if (m_device_ptr->is_extension_enabled("VK_AMD_rasterization_order") ) { - pipeline_create_info_ptr->set_rasterization_order(VK_RASTERIZATION_ORDER_RELAXED_AMD); + pipeline_create_info_ptr->set_rasterization_order(Anvil::RasterizationOrderAMD::RELAXED); } } else { - pipeline_create_info_ptr->set_rasterization_order(VK_RASTERIZATION_ORDER_STRICT_AMD); + pipeline_create_info_ptr->set_rasterization_order(Anvil::RasterizationOrderAMD::STRICT); } gfx_manager_ptr->add_pipeline(std::move(pipeline_create_info_ptr), @@ -790,19 +791,19 @@ void App::init_images() Anvil::ImageType::_2D, Anvil::Format::D32_SFLOAT, Anvil::ImageTiling::OPTIMAL, - VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, + Anvil::ImageUsageFlagBits::DEPTH_STENCIL_ATTACHMENT_BIT, m_window_ptr->get_width_at_creation_time (), m_window_ptr->get_height_at_creation_time(), 1, /* base_mipmap_depth */ 1, /* n_layers */ - Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + Anvil::SampleCountFlagBits::_1_BIT, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::SharingMode::EXCLUSIVE, - false, - 0, /* in_memory_features */ - false, - Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, - nullptr); + false, /* in_use_full_mipmap_chain */ + Anvil::MemoryFeatureFlagBits::NONE, + Anvil::ImageCreateFlagBits::NONE, + Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* in_final_image_layout */ + nullptr); /* in_mipmaps_ptr */ m_depth_image_ptr = Anvil::Image::create(std::move(create_info_ptr) ); } @@ -813,7 +814,7 @@ void App::init_images() 0, /* n_base_layer */ 0, /* n_base_mipmap_level */ 1, /* n_mipmaps */ - Anvil::IMAGE_ASPECT_FLAG_DEPTH_BIT, + Anvil::ImageAspectFlagBits::DEPTH_BIT, m_depth_image_ptr->get_create_info_ptr()->get_format(), Anvil::ComponentSwizzle::IDENTITY, Anvil::ComponentSwizzle::IDENTITY, @@ -847,9 +848,9 @@ void App::init_renderpasses() Anvil::RenderPassCreateInfoUniquePtr renderpass_create_info_ptr(new Anvil::RenderPassCreateInfo(m_device_ptr.get() ) ); renderpass_create_info_ptr->add_color_attachment(m_swapchain_ptr->get_create_info_ptr()->get_format(), - Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, - VK_ATTACHMENT_LOAD_OP_CLEAR, - VK_ATTACHMENT_STORE_OP_STORE, + Anvil::SampleCountFlagBits::_1_BIT, + Anvil::AttachmentLoadOp::CLEAR, + Anvil::AttachmentStoreOp::STORE, #ifndef ENABLE_OFFSCREEN_RENDERING Anvil::ImageLayout::UNDEFINED, @@ -862,11 +863,11 @@ void App::init_renderpasses() &color_attachment_id); renderpass_create_info_ptr->add_depth_stencil_attachment(m_depth_image_ptr->get_create_info_ptr()->get_format(), - Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, - VK_ATTACHMENT_LOAD_OP_CLEAR, - VK_ATTACHMENT_STORE_OP_STORE, - VK_ATTACHMENT_LOAD_OP_DONT_CARE, - VK_ATTACHMENT_STORE_OP_DONT_CARE, + Anvil::SampleCountFlagBits::_1_BIT, + Anvil::AttachmentLoadOp::CLEAR, + Anvil::AttachmentStoreOp::STORE, + Anvil::AttachmentLoadOp::DONT_CARE, + Anvil::AttachmentStoreOp::DONT_CARE, Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, false, /* may_alias */ @@ -912,7 +913,7 @@ void App::init_renderpasses() Anvil::Format::R32G32B32_SFLOAT, 0, /* offset_in_bytes */ sizeof(float) * 3, /* stride_in_bytes */ - VK_VERTEX_INPUT_RATE_VERTEX); + Anvil::VertexInputRate::VERTEX); gfx_pipeline_create_info_ptr->set_descriptor_set_create_info(m_dsg_ptrs[0]->get_descriptor_set_create_info() ); gfx_manager_ptr->add_pipeline(std::move(gfx_pipeline_create_info_ptr), @@ -958,7 +959,7 @@ void App::init_semaphores() switch (m_device_ptr->get_type() ) { - case Anvil::DEVICE_TYPE_SINGLE_GPU: + case Anvil::DeviceType::SINGLE_GPU: { n_physical_devices = 1; @@ -1030,11 +1031,11 @@ void App::init_shaders() fs_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, fs_body, - Anvil::SHADER_STAGE_FRAGMENT); + Anvil::ShaderStage::FRAGMENT); vs_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, vs_body, - Anvil::SHADER_STAGE_VERTEX); + Anvil::ShaderStage::VERTEX); vs_ptr->add_definition_value_pair("MAX_DEPTH", MAX_DEPTH); @@ -1055,17 +1056,17 @@ void App::init_shaders() m_fs_entrypoint_ptr.reset(new Anvil::ShaderModuleStageEntryPoint("main", std::move(fs_sm_ptr), - Anvil::SHADER_STAGE_FRAGMENT) ); + Anvil::ShaderStage::FRAGMENT) ); m_vs_entrypoint_ptr.reset(new Anvil::ShaderModuleStageEntryPoint("main", std::move(vs_sm_ptr), - Anvil::SHADER_STAGE_VERTEX) ); + Anvil::ShaderStage::VERTEX) ); } void App::init_swapchain() { static const Anvil::Format swapchain_format (Anvil::Format::B8G8R8A8_UNORM); - static const VkPresentModeKHR swapchain_present_mode(VK_PRESENT_MODE_FIFO_KHR); - static const Anvil::ImageUsageFlags swapchain_usage (Anvil::IMAGE_USAGE_FLAG_COLOR_ATTACHMENT_BIT | Anvil::IMAGE_USAGE_FLAG_TRANSFER_SRC_BIT | Anvil::IMAGE_USAGE_FLAG_TRANSFER_DST_BIT); + static const Anvil::PresentModeKHR swapchain_present_mode(Anvil::PresentModeKHR::FIFO_KHR); + static const Anvil::ImageUsageFlags swapchain_usage (Anvil::ImageUsageFlagBits::COLOR_ATTACHMENT_BIT | Anvil::ImageUsageFlagBits::TRANSFER_SRC_BIT | Anvil::ImageUsageFlagBits::TRANSFER_DST_BIT); m_rendering_surface_ptr = Anvil::RenderingSurface::create(m_instance_ptr.get(), m_device_ptr.get (), @@ -1076,7 +1077,7 @@ void App::init_swapchain() switch (m_device_ptr->get_type() ) { - case Anvil::DEVICE_TYPE_SINGLE_GPU: + case Anvil::DeviceType::SINGLE_GPU: { Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr.get() ) ); diff --git a/examples/PushConstants/src/app.cpp b/examples/PushConstants/src/app.cpp index 67526184..a3db7f8d 100644 --- a/examples/PushConstants/src/app.cpp +++ b/examples/PushConstants/src/app.cpp @@ -259,13 +259,13 @@ void App::deinit() void App::draw_frame() { - Anvil::Semaphore* curr_frame_signal_semaphore_ptr = nullptr; - Anvil::Semaphore* curr_frame_wait_semaphore_ptr = nullptr; - static uint32_t n_frames_rendered = 0; - uint32_t n_swapchain_image; - Anvil::Queue* present_queue_ptr = m_device_ptr->get_universal_queue(0); - Anvil::Semaphore* present_wait_semaphore_ptr = nullptr; - const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; + Anvil::Semaphore* curr_frame_signal_semaphore_ptr = nullptr; + Anvil::Semaphore* curr_frame_wait_semaphore_ptr = nullptr; + static uint32_t n_frames_rendered = 0; + uint32_t n_swapchain_image; + Anvil::Queue* present_queue_ptr = m_device_ptr->get_universal_queue(0); + Anvil::Semaphore* present_wait_semaphore_ptr = nullptr; + const Anvil::PipelineStageFlags wait_stage_mask = Anvil::PipelineStageFlagBits::ALL_COMMANDS_BIT; /* Determine the signal + wait semaphores to use for drawing this frame */ m_n_last_semaphore_used = (m_n_last_semaphore_used + 1) % m_n_swapchain_images; @@ -418,9 +418,9 @@ void App::init_buffers() { auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), ub_data_size_total, - Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + Anvil::QueueFamilyFlagBits::COMPUTE_BIT | Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::SharingMode::EXCLUSIVE, - Anvil::BUFFER_USAGE_FLAG_UNIFORM_BUFFER_BIT); + Anvil::BufferUsageFlagBits::UNIFORM_BUFFER_BIT); m_data_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -428,23 +428,23 @@ void App::init_buffers() m_data_buffer_ptr->set_name("Data buffer"); allocator_ptr->add_buffer(m_data_buffer_ptr.get(), - 0); /* in_required_memory_features */ + Anvil::MemoryFeatureFlagBits::NONE); /* in_required_memory_features */ /* Set up a buffer to hold mesh data */ { auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), get_mesh_data_size(), - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::SharingMode::EXCLUSIVE, - Anvil::BUFFER_USAGE_FLAG_VERTEX_BUFFER_BIT); + Anvil::BufferUsageFlagBits::VERTEX_BUFFER_BIT); m_mesh_data_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } - m_mesh_data_buffer_ptr->set_name("Mesh vertexdata buffer"); + m_mesh_data_buffer_ptr->set_name("Mesh vertex data buffer"); allocator_ptr->add_buffer(m_mesh_data_buffer_ptr.get(), - 0); /* in_required_memory_features */ + Anvil::MemoryFeatureFlagBits::NONE); /* in_required_memory_features */ /* Allocate memory blocks and copy data where applicable */ m_mesh_data_buffer_ptr->write(0, /* start_offset */ @@ -454,17 +454,17 @@ void App::init_buffers() void App::init_command_buffers() { - auto gfx_pipeline_manager_ptr(m_device_ptr->get_graphics_pipeline_manager() ); - VkImageSubresourceRange image_subresource_range; - std::unique_ptr luminance_data_ptr; - uint32_t luminance_data_size; - Anvil::Queue* universal_queue_ptr (m_device_ptr->get_universal_queue(0) ); + auto gfx_pipeline_manager_ptr(m_device_ptr->get_graphics_pipeline_manager() ); + Anvil::ImageSubresourceRange image_subresource_range; + std::unique_ptr luminance_data_ptr; + uint32_t luminance_data_size; + Anvil::Queue* universal_queue_ptr (m_device_ptr->get_universal_queue(0) ); - image_subresource_range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; - image_subresource_range.baseArrayLayer = 0; - image_subresource_range.baseMipLevel = 0; - image_subresource_range.layerCount = 1; - image_subresource_range.levelCount = 1; + image_subresource_range.aspect_mask = Anvil::ImageAspectFlagBits::COLOR_BIT; + image_subresource_range.base_array_layer = 0; + image_subresource_range.base_mip_level = 0; + image_subresource_range.layer_count = 1; + image_subresource_range.level_count = 1; get_luminance_data(&luminance_data_ptr, &luminance_data_size); @@ -483,9 +483,8 @@ void App::init_command_buffers() /* Switch the swap-chain image to the color_attachment_optimal image layout */ { - Anvil::ImageBarrier image_barrier(0, /* source_access_mask */ - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, /* destination_access_mask */ - false, + Anvil::ImageBarrier image_barrier(Anvil::AccessFlagBits::NONE, /* source_access_mask */ + Anvil::AccessFlagBits::COLOR_ATTACHMENT_WRITE_BIT, /* destination_access_mask */ Anvil::ImageLayout::UNDEFINED, /* old_image_layout */ Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, /* new_image_layout */ universal_queue_ptr->get_queue_family_index(), @@ -493,29 +492,29 @@ void App::init_command_buffers() m_swapchain_ptr->get_image(n_command_buffer), image_subresource_range); - cmd_buffer_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, /* src_stage_mask */ - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,/* dst_stage_mask */ - VK_FALSE, /* in_by_region */ - 0, /* in_memory_barrier_count */ - nullptr, /* in_memory_barrier_ptrs */ - 0, /* in_buffer_memory_barrier_count */ - nullptr, /* in_buffer_memory_barrier_ptrs */ - 1, /* in_image_memory_barrier_count */ + cmd_buffer_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::TOP_OF_PIPE_BIT, /* src_stage_mask */ + Anvil::PipelineStageFlagBits::COLOR_ATTACHMENT_OUTPUT_BIT,/* dst_stage_mask */ + Anvil::DependencyFlagBits::NONE, + 0, /* in_memory_barrier_count */ + nullptr, /* in_memory_barrier_ptrs */ + 0, /* in_buffer_memory_barrier_count */ + nullptr, /* in_buffer_memory_barrier_ptrs */ + 1, /* in_image_memory_barrier_count */ &image_barrier); } /* Make sure CPU-written data is flushed before we start rendering */ - Anvil::BufferBarrier buffer_barrier(VK_ACCESS_HOST_WRITE_BIT, /* in_source_access_mask */ - VK_ACCESS_UNIFORM_READ_BIT, /* in_destination_access_mask */ + Anvil::BufferBarrier buffer_barrier(Anvil::AccessFlagBits::HOST_WRITE_BIT, /* in_source_access_mask */ + Anvil::AccessFlagBits::UNIFORM_READ_BIT, /* in_destination_access_mask */ universal_queue_ptr->get_queue_family_index(), /* in_src_queue_family_index */ universal_queue_ptr->get_queue_family_index(), /* in_dst_queue_family_index */ m_data_buffer_ptr.get(), m_ub_data_size_per_swapchain_image * n_command_buffer, /* in_offset */ m_ub_data_size_per_swapchain_image); - cmd_buffer_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_HOST_BIT, - VK_PIPELINE_STAGE_VERTEX_SHADER_BIT, - VK_FALSE, /* in_by_region */ + cmd_buffer_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::HOST_BIT, + Anvil::PipelineStageFlagBits::VERTEX_SHADER_BIT, + Anvil::DependencyFlagBits::NONE, 0, /* in_memory_barrier_count */ nullptr, /* in_memory_barriers_ptr */ 1, /* in_buffer_memory_barrier_count */ @@ -543,7 +542,7 @@ void App::init_command_buffers() m_fbos[n_command_buffer].get(), render_area, m_renderpass_ptr.get(), - VK_SUBPASS_CONTENTS_INLINE); + Anvil::SubpassContents::INLINE); { const uint32_t data_ub_offset = static_cast(m_ub_data_size_per_swapchain_image * n_command_buffer); auto ds_ptr = m_dsg_ptr->get_descriptor_set (0 /* n_set */); @@ -551,16 +550,16 @@ void App::init_command_buffers() auto mesh_data_buffer_raw_ptr = m_mesh_data_buffer_ptr.get(); auto pipeline_layout_ptr = gfx_pipeline_manager_ptr->get_pipeline_layout(m_pipeline_id); - cmd_buffer_ptr->record_bind_pipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, + cmd_buffer_ptr->record_bind_pipeline(Anvil::PipelineBindPoint::GRAPHICS, m_pipeline_id); cmd_buffer_ptr->record_push_constants(pipeline_layout_ptr, - VK_SHADER_STAGE_FRAGMENT_BIT | VK_SHADER_STAGE_VERTEX_BIT, + Anvil::ShaderStageFlagBits::FRAGMENT_BIT | Anvil::ShaderStageFlagBits::VERTEX_BIT, 0, /* in_offset */ luminance_data_size, luminance_data_ptr.get() ); - cmd_buffer_ptr->record_bind_descriptor_sets(VK_PIPELINE_BIND_POINT_GRAPHICS, + cmd_buffer_ptr->record_bind_descriptor_sets(Anvil::PipelineBindPoint::GRAPHICS, pipeline_layout_ptr, 0, /* firstSet */ 1, /* setCount */ @@ -595,9 +594,9 @@ void App::init_dsgs() dsg_create_info_ptrs[0] = Anvil::DescriptorSetCreateInfo::create(); dsg_create_info_ptrs[0]->add_binding(0, /* n_binding */ - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, + Anvil::DescriptorType::UNIFORM_BUFFER_DYNAMIC, 1, /* n_elements */ - VK_SHADER_STAGE_VERTEX_BIT); + Anvil::ShaderStageFlagBits::VERTEX_BIT); m_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), dsg_create_info_ptrs, @@ -661,9 +660,9 @@ void App::init_gfx_pipelines() Anvil::RenderPassCreateInfoUniquePtr render_pass_create_info_ptr(new Anvil::RenderPassCreateInfo(m_device_ptr.get() ) ); render_pass_create_info_ptr->add_color_attachment(m_swapchain_ptr->get_create_info_ptr()->get_format(), - Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, - VK_ATTACHMENT_LOAD_OP_CLEAR, - VK_ATTACHMENT_STORE_OP_STORE, + Anvil::SampleCountFlagBits::_1_BIT, + Anvil::AttachmentLoadOp::CLEAR, + Anvil::AttachmentStoreOp::STORE, Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, #ifdef ENABLE_OFFSCREEN_RENDERING Anvil::ImageLayout::GENERAL, @@ -703,31 +702,31 @@ void App::init_gfx_pipelines() gfx_pipeline_create_info_ptr->set_descriptor_set_create_info (m_dsg_ptr->get_descriptor_set_create_info() ); gfx_pipeline_create_info_ptr->attach_push_constant_range (0, /* in_offset */ sizeof(float) * 4 /* vec4 */ * 4 /* vec4 values */, - VK_SHADER_STAGE_FRAGMENT_BIT | VK_SHADER_STAGE_VERTEX_BIT); - gfx_pipeline_create_info_ptr->set_rasterization_properties (VK_POLYGON_MODE_FILL, - VK_CULL_MODE_NONE, - VK_FRONT_FACE_COUNTER_CLOCKWISE, + Anvil::ShaderStageFlagBits::FRAGMENT_BIT | Anvil::ShaderStageFlagBits::VERTEX_BIT); + gfx_pipeline_create_info_ptr->set_rasterization_properties (Anvil::PolygonMode::FILL, + Anvil::CullModeFlagBits::NONE, + Anvil::FrontFace::COUNTER_CLOCKWISE, 1.0f); /* in_line_width */ gfx_pipeline_create_info_ptr->set_color_blend_attachment_properties(0, /* in_attachment_id */ true, /* in_blending_enabled */ - VK_BLEND_OP_ADD, - VK_BLEND_OP_ADD, - VK_BLEND_FACTOR_SRC_ALPHA, - VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, - VK_BLEND_FACTOR_SRC_ALPHA, - VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, - VK_COLOR_COMPONENT_A_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_R_BIT); + Anvil::BlendOp::ADD, + Anvil::BlendOp::ADD, + Anvil::BlendFactor::SRC_ALPHA, + Anvil::BlendFactor::ONE_MINUS_SRC_ALPHA, + Anvil::BlendFactor::SRC_ALPHA, + Anvil::BlendFactor::ONE_MINUS_SRC_ALPHA, + Anvil::ColorComponentFlagBits::A_BIT | Anvil::ColorComponentFlagBits::B_BIT | Anvil::ColorComponentFlagBits::G_BIT | Anvil::ColorComponentFlagBits::R_BIT); gfx_pipeline_create_info_ptr->add_vertex_attribute(0, /* in_location */ get_mesh_data_position_format(), get_mesh_data_position_start_offset(), get_mesh_data_position_stride(), - VK_VERTEX_INPUT_RATE_VERTEX); + Anvil::VertexInputRate::VERTEX); gfx_pipeline_create_info_ptr->add_vertex_attribute(1, /* location */ get_mesh_data_color_format (), get_mesh_data_color_start_offset(), get_mesh_data_color_stride (), - VK_VERTEX_INPUT_RATE_VERTEX); + Anvil::VertexInputRate::VERTEX); gfx_pipeline_manager_ptr->add_pipeline(std::move(gfx_pipeline_create_info_ptr), @@ -780,11 +779,11 @@ void App::init_shaders() fragment_shader_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_frag, - Anvil::SHADER_STAGE_FRAGMENT); + Anvil::ShaderStage::FRAGMENT); vertex_shader_ptr = Anvil::GLSLShaderToSPIRVGenerator::create(m_device_ptr.get(), Anvil::GLSLShaderToSPIRVGenerator::MODE_USE_SPECIFIED_SOURCE, g_glsl_vert, - Anvil::SHADER_STAGE_VERTEX); + Anvil::ShaderStage::VERTEX); fragment_shader_ptr->add_definition_value_pair("N_TRIANGLES", N_TRIANGLES); @@ -803,12 +802,12 @@ void App::init_shaders() m_fs_ptr.reset( new Anvil::ShaderModuleStageEntryPoint("main", std::move(fragment_shader_module_ptr), - Anvil::SHADER_STAGE_FRAGMENT) + Anvil::ShaderStage::FRAGMENT) ); m_vs_ptr.reset( new Anvil::ShaderModuleStageEntryPoint("main", std::move(vertex_shader_module_ptr), - Anvil::SHADER_STAGE_VERTEX) + Anvil::ShaderStage::VERTEX) ); } @@ -826,8 +825,8 @@ void App::init_swapchain() m_swapchain_ptr = device_ptr->create_swapchain(m_rendering_surface_ptr.get(), m_window_ptr.get (), Anvil::Format::B8G8R8A8_UNORM, - VK_PRESENT_MODE_FIFO_KHR, - Anvil::IMAGE_USAGE_FLAG_COLOR_ATTACHMENT_BIT, + Anvil::PresentModeKHR::FIFO_KHR, + Anvil::ImageUsageFlagBits::COLOR_ATTACHMENT_BIT, m_n_swapchain_images); m_swapchain_ptr->set_name("Main swapchain"); diff --git a/include/misc/base_pipeline_create_info.h b/include/misc/base_pipeline_create_info.h index 551fac6f..39b6b3d1 100644 --- a/include/misc/base_pipeline_create_info.h +++ b/include/misc/base_pipeline_create_info.h @@ -39,9 +39,9 @@ namespace Anvil return m_allow_derivatives; } - bool attach_push_constant_range(uint32_t in_offset, - uint32_t in_size, - VkShaderStageFlags in_stages); + bool attach_push_constant_range(uint32_t in_offset, + uint32_t in_size, + Anvil::ShaderStageFlags in_stages); /* Returns != UINT32_MAX if this pipeline is a derivative pipeline, or UINT32_MAX otherwise. */ Anvil::PipelineID get_base_pipeline_id() const diff --git a/include/misc/buffer_create_info.h b/include/misc/buffer_create_info.h index 975cbbdb..0a43cfb4 100644 --- a/include/misc/buffer_create_info.h +++ b/include/misc/buffer_create_info.h @@ -43,7 +43,7 @@ namespace Anvil * * - Client data to fill the result bullfer with after mem alloc is bound to the buffer: none * - External memory handle types: none - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - MT safety: MTSafety::INHERIT_FROM_PARENT_DEVICE * * @param in_device_ptr Device to use. * @param in_size Size of the buffer object to be initialized. @@ -56,7 +56,7 @@ namespace Anvil **/ static Anvil::BufferCreateInfoUniquePtr create_nonsparse_alloc(const Anvil::BaseDevice* in_device_ptr, VkDeviceSize in_size, - QueueFamilyBits in_queue_families, + Anvil::QueueFamilyFlags in_queue_families, Anvil::SharingMode in_sharing_mode, Anvil::BufferUsageFlags in_usage_flags, Anvil::MemoryFeatureFlags in_memory_features); @@ -69,7 +69,7 @@ namespace Anvil * The following default values are assumed, unless specified with separate set_..() invocations issued against the result instance: * * - External memory handle types: none - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - MT safety: MTSafety::INHERIT_FROM_PARENT_DEVICE * * @param in_device_ptr Device to use. * @param in_size Size of the buffer object to be initialized. @@ -81,7 +81,7 @@ namespace Anvil **/ static Anvil::BufferCreateInfoUniquePtr create_nonsparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, VkDeviceSize in_size, - QueueFamilyBits in_queue_families, + Anvil::QueueFamilyFlags in_queue_families, Anvil::SharingMode in_sharing_mode, Anvil::BufferUsageFlags in_usage_flags); @@ -118,14 +118,14 @@ namespace Anvil * this field to specify which handle types the allocation needs to support. Please see * documentation of Anvil::ExternalMemoryHandleTypeBits for more details. **/ - static Anvil::BufferCreateInfoUniquePtr create_sparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - Anvil::SharingMode in_sharing_mode, - Anvil::BufferUsageFlags in_usage_flags, - Anvil::SparseResidencyScope in_residency_scope, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types = 0); + static Anvil::BufferCreateInfoUniquePtr create_sparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + Anvil::QueueFamilyFlags in_queue_families, + Anvil::SharingMode in_sharing_mode, + Anvil::BufferUsageFlags in_usage_flags, + Anvil::SparseResidencyScope in_residency_scope, + MTSafety in_mt_safety = MTSafety::INHERIT_FROM_PARENT_DEVICE, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE); const void* const get_client_data() const { @@ -137,7 +137,7 @@ namespace Anvil return m_device_ptr; } - const Anvil::ExternalMemoryHandleTypeBits& get_exportable_external_memory_handle_types() const + const Anvil::ExternalMemoryHandleTypeFlags& get_exportable_external_memory_handle_types() const { return m_exportable_external_memory_handle_types; } @@ -159,7 +159,7 @@ namespace Anvil } /** Returns info about queue families this buffer has been created for */ - QueueFamilyBits get_queue_families() const + Anvil::QueueFamilyFlags get_queue_families() const { return m_queue_families; } @@ -228,7 +228,7 @@ namespace Anvil m_device_ptr = in_device_ptr; } - void set_exportable_external_memory_handle_types(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) + void set_exportable_external_memory_handle_types(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) { m_exportable_external_memory_handle_types = in_external_memory_handle_types; } @@ -243,7 +243,7 @@ namespace Anvil m_mt_safety = in_mt_safety; } - void get_queue_families(const QueueFamilyBits& in_queue_families) + void set_queue_families(const Anvil::QueueFamilyFlags& in_queue_families) { m_queue_families = in_queue_families; } @@ -273,43 +273,43 @@ namespace Anvil /* Private functions */ - BufferCreateInfo(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - Anvil::SharingMode in_sharing_mode, - Anvil::BufferUsageFlags in_usage_flags, - Anvil::SparseResidencyScope in_residency_scope, - MTSafety in_mt_safety, - Anvil::ExternalMemoryHandleTypeBits in_exportable_external_memory_handle_types); - BufferCreateInfo(const Anvil::BufferType& in_buffer_type, - const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - Anvil::SharingMode in_sharing_mode, - Anvil::BufferUsageFlags in_usage_flags, - MemoryFeatureFlags in_memory_features, - MTSafety in_mt_safety, - Anvil::ExternalMemoryHandleTypeBits in_exportable_external_memory_handle_types, - const void* in_opt_client_data_ptr); - BufferCreateInfo(Anvil::Buffer* in_parent_buffer_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size); + BufferCreateInfo(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + Anvil::QueueFamilyFlags in_queue_families, + Anvil::SharingMode in_sharing_mode, + Anvil::BufferUsageFlags in_usage_flags, + Anvil::SparseResidencyScope in_residency_scope, + MTSafety in_mt_safety, + Anvil::ExternalMemoryHandleTypeFlags in_exportable_external_memory_handle_types); + BufferCreateInfo(const Anvil::BufferType& in_buffer_type, + const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + Anvil::QueueFamilyFlags in_queue_families, + Anvil::SharingMode in_sharing_mode, + Anvil::BufferUsageFlags in_usage_flags, + MemoryFeatureFlags in_memory_features, + MTSafety in_mt_safety, + Anvil::ExternalMemoryHandleTypeFlags in_exportable_external_memory_handle_types, + const void* in_opt_client_data_ptr); + BufferCreateInfo(Anvil::Buffer* in_parent_buffer_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size); /* Private variables */ - const void* m_client_data_ptr; - const Anvil::BaseDevice* m_device_ptr; - Anvil::ExternalMemoryHandleTypeBits m_exportable_external_memory_handle_types; - Anvil::MemoryFeatureFlags m_memory_features; - MTSafety m_mt_safety; - Anvil::Buffer* const m_parent_buffer_ptr; - Anvil::QueueFamilyBits m_queue_families; - const Anvil::SparseResidencyScope m_residency_scope; - Anvil::SharingMode m_sharing_mode; - VkDeviceSize m_size; - VkDeviceSize m_start_offset; - const BufferType m_type; - Anvil::BufferUsageFlags m_usage_flags; + const void* m_client_data_ptr; + const Anvil::BaseDevice* m_device_ptr; + Anvil::ExternalMemoryHandleTypeFlags m_exportable_external_memory_handle_types; + Anvil::MemoryFeatureFlags m_memory_features; + MTSafety m_mt_safety; + Anvil::Buffer* const m_parent_buffer_ptr; + Anvil::QueueFamilyFlags m_queue_families; + const Anvil::SparseResidencyScope m_residency_scope; + Anvil::SharingMode m_sharing_mode; + VkDeviceSize m_size; + VkDeviceSize m_start_offset; + const BufferType m_type; + Anvil::BufferUsageFlags m_usage_flags; ANVIL_DISABLE_ASSIGNMENT_OPERATOR(BufferCreateInfo); ANVIL_DISABLE_COPY_CONSTRUCTOR(BufferCreateInfo); diff --git a/include/misc/buffer_view_create_info.h b/include/misc/buffer_view_create_info.h index 717976ac..982373bf 100644 --- a/include/misc/buffer_view_create_info.h +++ b/include/misc/buffer_view_create_info.h @@ -36,7 +36,7 @@ namespace Anvil * * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - MT safety: MTSafety::INHERIT_FROM_PARENT_DEVICE */ static Anvil::BufferViewCreateInfoUniquePtr create(const Anvil::BaseDevice* in_device_ptr, Anvil::Buffer* in_buffer_ptr, diff --git a/include/misc/compute_pipeline_create_info.h b/include/misc/compute_pipeline_create_info.h index aa719054..09033907 100644 --- a/include/misc/compute_pipeline_create_info.h +++ b/include/misc/compute_pipeline_create_info.h @@ -54,7 +54,7 @@ namespace Anvil uint32_t in_n_data_bytes, const void* in_data_ptr) { - return BasePipelineCreateInfo::add_specialization_constant(Anvil::SHADER_STAGE_COMPUTE, + return BasePipelineCreateInfo::add_specialization_constant(Anvil::ShaderStage::COMPUTE, in_constant_id, in_n_data_bytes, in_data_ptr); diff --git a/include/misc/descriptor_set_create_info.h b/include/misc/descriptor_set_create_info.h index c981cd49..4b2076f3 100644 --- a/include/misc/descriptor_set_create_info.h +++ b/include/misc/descriptor_set_create_info.h @@ -68,10 +68,10 @@ namespace Anvil * @return true if successful, false otherwise. **/ bool add_binding(uint32_t in_binding_index, - VkDescriptorType in_descriptor_type, + Anvil::DescriptorType in_descriptor_type, uint32_t in_descriptor_array_size, - VkShaderStageFlags in_stage_flags, - const Anvil::DescriptorBindingFlags& in_flags = 0, + Anvil::ShaderStageFlags in_stage_flags, + const Anvil::DescriptorBindingFlags& in_flags = Anvil::DescriptorBindingFlagBits::NONE, const Anvil::Sampler* const* in_opt_immutable_sampler_ptr_ptr = nullptr); /** Tells if the DS info structure contains a variable descriptor count binding. @@ -126,9 +126,9 @@ namespace Anvil * @return true if successful, false otherwise. **/ bool get_binding_properties_by_binding_index(uint32_t in_binding_index, - VkDescriptorType* out_opt_descriptor_type_ptr = nullptr, + Anvil::DescriptorType* out_opt_descriptor_type_ptr = nullptr, uint32_t* out_opt_descriptor_array_size_ptr = nullptr, - VkShaderStageFlags* out_opt_stage_flags_ptr = nullptr, + Anvil::ShaderStageFlags* out_opt_stage_flags_ptr = nullptr, bool* out_opt_immutable_samplers_enabled_ptr = nullptr, Anvil::DescriptorBindingFlags* out_opt_flags_ptr = nullptr) const; @@ -153,9 +153,9 @@ namespace Anvil **/ bool get_binding_properties_by_index_number(uint32_t in_n_binding, uint32_t* out_opt_binding_index_ptr = nullptr, - VkDescriptorType* out_opt_descriptor_type_ptr = nullptr, + Anvil::DescriptorType* out_opt_descriptor_type_ptr = nullptr, uint32_t* out_opt_descriptor_array_size_ptr = nullptr, - VkShaderStageFlags* out_opt_stage_flags_ptr = nullptr, + Anvil::ShaderStageFlags* out_opt_stage_flags_ptr = nullptr, bool* out_opt_immutable_samplers_enabled_ptr = nullptr, Anvil::DescriptorBindingFlags* out_opt_flags_ptr = nullptr) const; @@ -181,19 +181,17 @@ namespace Anvil typedef struct Binding { uint32_t descriptor_array_size; - VkDescriptorType descriptor_type; + Anvil::DescriptorType descriptor_type; Anvil::DescriptorBindingFlags flags; std::vector immutable_samplers; - VkShaderStageFlagsVariable(stage_flags); + Anvil::ShaderStageFlags stage_flags; /** Dummy constructor. Do not use. */ Binding() { descriptor_array_size = 0; - descriptor_type = VK_DESCRIPTOR_TYPE_MAX_ENUM; - flags = 0; - stage_flags = static_cast(0); + descriptor_type = Anvil::DescriptorType::UNKNOWN; } /** Constructor. @@ -201,15 +199,15 @@ namespace Anvil * For argument discussion, please see Anvil::DescriptorSetLayout::add_binding() documentation. **/ Binding(uint32_t in_descriptor_array_size, - VkDescriptorType in_descriptor_type, - VkShaderStageFlags in_stage_flags, + Anvil::DescriptorType in_descriptor_type, + Anvil::ShaderStageFlags in_stage_flags, const Anvil::Sampler* const* in_immutable_sampler_ptrs, Anvil::DescriptorBindingFlags in_flags) { descriptor_array_size = in_descriptor_array_size; descriptor_type = in_descriptor_type; flags = in_flags; - stage_flags = static_cast(in_stage_flags); + stage_flags = in_stage_flags; if (in_immutable_sampler_ptrs != nullptr) { diff --git a/include/misc/event_create_info.h b/include/misc/event_create_info.h index 68e4b35d..9a132271 100644 --- a/include/misc/event_create_info.h +++ b/include/misc/event_create_info.h @@ -35,7 +35,7 @@ namespace Anvil * * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE */ static Anvil::EventCreateInfoUniquePtr create(const Anvil::BaseDevice* in_device_ptr); diff --git a/include/misc/extensions.h b/include/misc/extensions.h index 76e60ed0..7d074eb0 100644 --- a/include/misc/extensions.h +++ b/include/misc/extensions.h @@ -809,7 +809,7 @@ namespace Anvil for (const auto& current_extension_data : reference.values_by_extension_names) { - extension_status[current_extension_data.first] = EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE; + extension_status[current_extension_data.first] = Anvil::ExtensionAvailability::ENABLE_IF_AVAILABLE; } } @@ -817,17 +817,17 @@ namespace Anvil * A few exceptions exist. * * 1. VK_AMD_negative_viewport_height interacts with KHR_maintenance1, apps will have to enable it manually. */ - extension_status[VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME] = EXTENSION_AVAILABILITY_IGNORE; + extension_status[VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME] = Anvil::ExtensionAvailability::IGNORE; /* 2. VK_EXT_debug_marker is only useful for debugging. */ #if !defined(_DEBUG) { - extension_status[VK_EXT_DEBUG_MARKER_EXTENSION_NAME] = EXTENSION_AVAILABILITY_IGNORE; + extension_status[VK_EXT_DEBUG_MARKER_EXTENSION_NAME] = Anvil::ExtensionAvailability::IGNORE; } #endif /* 3. Disable VK_AMD_shader_info by default. */ - extension_status[VK_AMD_SHADER_INFO_EXTENSION_NAME] = EXTENSION_AVAILABILITY_IGNORE; + extension_status[VK_AMD_SHADER_INFO_EXTENSION_NAME] = Anvil::ExtensionAvailability::IGNORE; } std::map extension_status; diff --git a/include/misc/fence_create_info.h b/include/misc/fence_create_info.h index 16517b04..59973d49 100644 --- a/include/misc/fence_create_info.h +++ b/include/misc/fence_create_info.h @@ -36,7 +36,7 @@ namespace Anvil * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * * - Exportable external fence handle type: none - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE */ static Anvil::FenceCreateInfoUniquePtr create(const Anvil::BaseDevice* in_device_ptr, bool in_create_signalled); @@ -46,7 +46,7 @@ namespace Anvil return m_device_ptr; } - const Anvil::ExternalFenceHandleTypeBits& get_exportable_external_fence_handle_types() const + const Anvil::ExternalFenceHandleTypeFlags& get_exportable_external_fence_handle_types() const { return m_exportable_external_fence_handle_types; } @@ -119,7 +119,7 @@ namespace Anvil * * Requires VK_KHR_external_fence. */ - void set_exportable_external_fence_handle_types(const Anvil::ExternalFenceHandleTypeBits& in_external_fence_handle_types) + void set_exportable_external_fence_handle_types(const Anvil::ExternalFenceHandleTypeFlags& in_external_fence_handle_types) { m_exportable_external_fence_handle_types = in_external_fence_handle_types; } @@ -146,10 +146,10 @@ namespace Anvil MTSafety in_mt_safety); /* Private variables */ - bool m_create_signalled; - const Anvil::BaseDevice* m_device_ptr; - Anvil::ExternalFenceHandleTypeBits m_exportable_external_fence_handle_types; - Anvil::MTSafety m_mt_safety; + bool m_create_signalled; + const Anvil::BaseDevice * m_device_ptr; + Anvil::ExternalFenceHandleTypeFlags m_exportable_external_fence_handle_types; + Anvil::MTSafety m_mt_safety; #ifdef _WIN32 ExternalNTHandleInfo m_exportable_nt_handle_info; diff --git a/include/misc/framebuffer_create_info.h b/include/misc/framebuffer_create_info.h index f7263d63..494e45cf 100644 --- a/include/misc/framebuffer_create_info.h +++ b/include/misc/framebuffer_create_info.h @@ -36,7 +36,7 @@ namespace Anvil * * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE */ static Anvil::FramebufferCreateInfoUniquePtr create(const Anvil::BaseDevice* in_device_ptr, const uint32_t& in_width, diff --git a/include/misc/graphics_pipeline_create_info.h b/include/misc/graphics_pipeline_create_info.h index a0f0a768..383f8597 100644 --- a/include/misc/graphics_pipeline_create_info.h +++ b/include/misc/graphics_pipeline_create_info.h @@ -71,17 +71,17 @@ namespace Anvil uint32_t in_n_data_bytes, const void* in_data_ptr) final { - if (in_shader_stage != Anvil::SHADER_STAGE_FRAGMENT && - in_shader_stage != Anvil::SHADER_STAGE_GEOMETRY && - in_shader_stage != Anvil::SHADER_STAGE_TESSELLATION_CONTROL && - in_shader_stage != Anvil::SHADER_STAGE_TESSELLATION_EVALUATION && - in_shader_stage != Anvil::SHADER_STAGE_VERTEX) + if (in_shader_stage != Anvil::ShaderStage::FRAGMENT && + in_shader_stage != Anvil::ShaderStage::GEOMETRY && + in_shader_stage != Anvil::ShaderStage::TESSELLATION_CONTROL && + in_shader_stage != Anvil::ShaderStage::TESSELLATION_EVALUATION && + in_shader_stage != Anvil::ShaderStage::VERTEX) { - anvil_assert(in_shader_stage == Anvil::SHADER_STAGE_FRAGMENT || - in_shader_stage == Anvil::SHADER_STAGE_GEOMETRY || - in_shader_stage == Anvil::SHADER_STAGE_TESSELLATION_CONTROL || - in_shader_stage == Anvil::SHADER_STAGE_TESSELLATION_EVALUATION || - in_shader_stage == Anvil::SHADER_STAGE_VERTEX); + anvil_assert(in_shader_stage == Anvil::ShaderStage::FRAGMENT || + in_shader_stage == Anvil::ShaderStage::GEOMETRY || + in_shader_stage == Anvil::ShaderStage::TESSELLATION_CONTROL || + in_shader_stage == Anvil::ShaderStage::TESSELLATION_EVALUATION || + in_shader_stage == Anvil::ShaderStage::VERTEX); return false; } @@ -116,13 +116,13 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool add_vertex_attribute(uint32_t in_location, - Anvil::Format in_format, - uint32_t in_offset_in_bytes, - uint32_t in_stride_in_bytes, - VkVertexInputRate in_step_rate, - uint32_t in_explicit_binding_index = UINT32_MAX, - uint32_t in_divisor = 1); + bool add_vertex_attribute(uint32_t in_location, + Anvil::Format in_format, + uint32_t in_offset_in_bytes, + uint32_t in_stride_in_bytes, + Anvil::VertexInputRate in_step_rate, + uint32_t in_explicit_binding_index = UINT32_MAX, + uint32_t in_divisor = 1); /** Tells whether depth writes have been enabled. **/ bool are_depth_writes_enabled() const; @@ -159,15 +159,15 @@ namespace Anvil * * @return true if successful, false otherwise. */ - bool get_color_blend_attachment_properties(SubPassAttachmentID in_attachment_id, - bool* out_opt_blending_enabled_ptr, - VkBlendOp* out_opt_blend_op_color_ptr, - VkBlendOp* out_opt_blend_op_alpha_ptr, - VkBlendFactor* out_opt_src_color_blend_factor_ptr, - VkBlendFactor* out_opt_dst_color_blend_factor_ptr, - VkBlendFactor* out_opt_src_alpha_blend_factor_ptr, - VkBlendFactor* out_opt_dst_alpha_blend_factor_ptr, - VkColorComponentFlags* out_opt_channel_write_mask_ptr) const; + bool get_color_blend_attachment_properties(SubPassAttachmentID in_attachment_id, + bool* out_opt_blending_enabled_ptr, + Anvil::BlendOp* out_opt_blend_op_color_ptr, + Anvil::BlendOp* out_opt_blend_op_alpha_ptr, + Anvil::BlendFactor* out_opt_src_color_blend_factor_ptr, + Anvil::BlendFactor* out_opt_dst_color_blend_factor_ptr, + Anvil::BlendFactor* out_opt_src_alpha_blend_factor_ptr, + Anvil::BlendFactor* out_opt_dst_alpha_blend_factor_ptr, + Anvil::ColorComponentFlags* out_opt_channel_write_mask_ptr) const; /** Retrieves depth bias-related state configuration. * @@ -205,11 +205,12 @@ namespace Anvil * @param out_opt_compare_op_ptr If not null, deref will be set to the depth compare op assigned * to the pipeline. **/ - void get_depth_test_state(bool* out_opt_is_enabled_ptr, - VkCompareOp* out_opt_compare_op_ptr) const; + void get_depth_test_state(bool* out_opt_is_enabled_ptr, + Anvil::CompareOp* out_opt_compare_op_ptr) const; /** Tells what dynamic states have been enabled. **/ - DynamicStateBitfield get_enabled_dynamic_states() const; + void get_enabled_dynamic_states(const Anvil::DynamicState** out_dynamic_states_ptr_ptr, + uint32_t* out_n_dynamic_states_ptr) const; /** Retrieves general properties. * @@ -239,8 +240,8 @@ namespace Anvil * @param out_opt_logic_op_ptr If not null, deref will be set to the logic op enum, specified * at creation time. **/ - void get_logic_op_state(bool* out_opt_is_enabled_ptr, - VkLogicOp* out_opt_logic_op_ptr) const; + void get_logic_op_state(bool* out_opt_is_enabled_ptr, + Anvil::LogicOp* out_opt_logic_op_ptr) const; /** Retrieves multisampling-related state configuration. * @@ -263,10 +264,10 @@ namespace Anvil uint32_t get_n_viewports() const; /** Tells what primitive topology has been specified for this instance. **/ - VkPrimitiveTopology get_primitive_topology() const; + Anvil::PrimitiveTopology get_primitive_topology() const; /** Tells what rasterization order has been specified for this instance. **/ - VkRasterizationOrderAMD get_rasterization_order() const; + Anvil::RasterizationOrderAMD get_rasterization_order() const; /** Retrieves various rasterization properties of the graphics pipeline. * @@ -281,10 +282,10 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - void get_rasterization_properties(VkPolygonMode* out_opt_polygon_mode_ptr, - VkCullModeFlags* out_opt_cull_mode_ptr, - VkFrontFace* out_opt_front_face_ptr, - float* out_opt_line_width_ptr) const; + void get_rasterization_properties(Anvil::PolygonMode* out_opt_polygon_mode_ptr, + Anvil::CullModeFlags* out_opt_cull_mode_ptr, + Anvil::FrontFace* out_opt_front_face_ptr, + float* out_opt_line_width_ptr) const; const RenderPass* get_renderpass() const { @@ -354,21 +355,21 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - void get_stencil_test_properties(bool* out_opt_is_enabled_ptr, - VkStencilOp* out_opt_front_stencil_fail_op_ptr, - VkStencilOp* out_opt_front_stencil_pass_op_ptr, - VkStencilOp* out_opt_front_stencil_depth_fail_op_ptr, - VkCompareOp* out_opt_front_stencil_compare_op_ptr, - uint32_t* out_opt_front_stencil_compare_mask_ptr, - uint32_t* out_opt_front_stencil_write_mask_ptr, - uint32_t* out_opt_front_stencil_reference_ptr, - VkStencilOp* out_opt_back_stencil_fail_op_ptr, - VkStencilOp* out_opt_back_stencil_pass_op_ptr, - VkStencilOp* out_opt_back_stencil_depth_fail_op_ptr, - VkCompareOp* out_opt_back_stencil_compare_op_ptr, - uint32_t* out_opt_back_stencil_compare_mask_ptr, - uint32_t* out_opt_back_stencil_write_mask_ptr, - uint32_t* out_opt_back_stencil_reference_ptr) const; + void get_stencil_test_properties(bool* out_opt_is_enabled_ptr, + Anvil::StencilOp* out_opt_front_stencil_fail_op_ptr, + Anvil::StencilOp* out_opt_front_stencil_pass_op_ptr, + Anvil::StencilOp* out_opt_front_stencil_depth_fail_op_ptr, + Anvil::CompareOp* out_opt_front_stencil_compare_op_ptr, + uint32_t* out_opt_front_stencil_compare_mask_ptr, + uint32_t* out_opt_front_stencil_write_mask_ptr, + uint32_t* out_opt_front_stencil_reference_ptr, + Anvil::StencilOp* out_opt_back_stencil_fail_op_ptr, + Anvil::StencilOp* out_opt_back_stencil_pass_op_ptr, + Anvil::StencilOp* out_opt_back_stencil_depth_fail_op_ptr, + Anvil::CompareOp* out_opt_back_stencil_compare_op_ptr, + uint32_t* out_opt_back_stencil_compare_mask_ptr, + uint32_t* out_opt_back_stencil_write_mask_ptr, + uint32_t* out_opt_back_stencil_reference_ptr) const; const SubPassID& get_subpass_id() const { @@ -403,14 +404,14 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool get_vertex_attribute_properties(uint32_t in_n_vertex_input_attribute, - uint32_t* out_opt_location_ptr = nullptr, - Anvil::Format* out_opt_format_ptr = nullptr, - uint32_t* out_opt_offset_ptr = nullptr, - uint32_t* out_opt_explicit_vertex_binding_index_ptr = nullptr, - uint32_t* out_opt_stride_ptr = nullptr, - VkVertexInputRate* out_opt_rate_ptr = nullptr, - uint32_t* out_opt_divisor_ptr = nullptr) const; + bool get_vertex_attribute_properties(uint32_t in_n_vertex_input_attribute, + uint32_t* out_opt_location_ptr = nullptr, + Anvil::Format* out_opt_format_ptr = nullptr, + uint32_t* out_opt_offset_ptr = nullptr, + uint32_t* out_opt_explicit_vertex_binding_index_ptr = nullptr, + uint32_t* out_opt_stride_ptr = nullptr, + Anvil::VertexInputRate* out_opt_rate_ptr = nullptr, + uint32_t* out_opt_divisor_ptr = nullptr) const; /** Retrieves properties of a viewport at a given index. * @@ -470,15 +471,15 @@ namespace Anvil * @param in_channel_write_mask Component write mask to use for the attachment. * **/ - void set_color_blend_attachment_properties(SubPassAttachmentID in_attachment_id, - bool in_blending_enabled, - VkBlendOp in_blend_op_color, - VkBlendOp in_blend_op_alpha, - VkBlendFactor in_src_color_blend_factor, - VkBlendFactor in_dst_color_blend_factor, - VkBlendFactor in_src_alpha_blend_factor, - VkBlendFactor in_dst_alpha_blend_factor, - VkColorComponentFlags in_channel_write_mask); + void set_color_blend_attachment_properties(SubPassAttachmentID in_attachment_id, + bool in_blending_enabled, + Anvil::BlendOp in_blend_op_color, + Anvil::BlendOp in_blend_op_alpha, + Anvil::BlendFactor in_src_color_blend_factor, + Anvil::BlendFactor in_dst_color_blend_factor, + Anvil::BlendFactor in_src_alpha_blend_factor, + Anvil::BlendFactor in_dst_alpha_blend_factor, + Anvil::ColorComponentFlags in_channel_write_mask); /** Updates multisampling properties. * @@ -509,7 +510,7 @@ namespace Anvil void set_n_patch_control_points(uint32_t in_n_patch_control_points); /** Sets primitive topology. */ - void set_primitive_topology(VkPrimitiveTopology in_primitive_topology); + void set_primitive_topology(Anvil::PrimitiveTopology in_primitive_topology); /** Configures the rasterization order for the pipeline if the VK_AMD_rasterization_order extension * is supported by the device, for which the pipeline has been created. @@ -518,7 +519,7 @@ namespace Anvil * * @param in_rasterization_order Rasterization order to use. **/ - void set_rasterization_order(VkRasterizationOrderAMD in_rasterization_order); + void set_rasterization_order(Anvil::RasterizationOrderAMD in_rasterization_order); /** Sets a number of rasterization properties to be used for the pipeline. * @@ -527,10 +528,10 @@ namespace Anvil * @param in_front_face Front face to use. * @param in_line_width Line width to use. **/ - void set_rasterization_properties(VkPolygonMode in_polygon_mode, - VkCullModeFlags in_cull_mode, - VkFrontFace in_front_face, - float in_line_width); + void set_rasterization_properties(Anvil::PolygonMode in_polygon_mode, + Anvil::CullModeFlags in_cull_mode, + Anvil::FrontFace in_front_face, + float in_line_width); /** Sets properties of a scissor box at the specified index. * @@ -562,14 +563,14 @@ namespace Anvil * @param in_stencil_write_mask Stencil write mask to use. * @param in_stencil_reference Stencil reference value to use. **/ - void set_stencil_test_properties(bool in_update_front_face_state, - VkStencilOp in_stencil_fail_op, - VkStencilOp in_stencil_pass_op, - VkStencilOp in_stencil_depth_fail_op, - VkCompareOp in_stencil_compare_op, - uint32_t in_stencil_compare_mask, - uint32_t in_stencil_write_mask, - uint32_t in_stencil_reference); + void set_stencil_test_properties(bool in_update_front_face_state, + Anvil::StencilOp in_stencil_fail_op, + Anvil::StencilOp in_stencil_pass_op, + Anvil::StencilOp in_stencil_depth_fail_op, + Anvil::CompareOp in_stencil_compare_op, + uint32_t in_stencil_compare_mask, + uint32_t in_stencil_write_mask, + uint32_t in_stencil_reference); /* TODO * @@ -644,8 +645,8 @@ namespace Anvil * @param in_should_enable true to enable the mode; false to disable it. * @param in_compare_op Compare operation to use for the test. */ - void toggle_depth_test(bool in_should_enable, - VkCompareOp in_compare_op); + void toggle_depth_test(bool in_should_enable, + Anvil::CompareOp in_compare_op); /** Enables or disables depth writes. * @@ -655,21 +656,26 @@ namespace Anvil /** Enables or disables the specified dynamic states. * - * @param in_should_enable true to enable the dynamic state(s) specified by @param in_dynamic_state_bits, false - * disable them if already enabled. - * @param in_dynamic_state_bits An integer whose individual bits correspond to dynamic states which should either - * be enabled or disabled. + * @param in_should_enable true to enable the dynamic state(s) specified by @param in_dynamic_state_bits, false + * disable them if already enabled. + * @param in_dynamic_states_ptr Pointer to an array of dynamic states to disable or enable. Must not be nullptr. + * @param in_n_dynamic_states Number of array items available for reading under @param in_dynamic_states_ptr **/ - void toggle_dynamic_states(bool in_should_enable, - DynamicStateBitfield in_dynamic_state_bits); + void toggle_dynamic_state (bool in_should_enable, + const Anvil::DynamicState& in_dynamic_state); + void toggle_dynamic_states(bool in_should_enable, + const Anvil::DynamicState* in_dynamic_states_ptr, + const uint32_t& in_n_dynamic_states); + void toggle_dynamic_states(bool in_should_enable, + const std::vector& in_dynamic_states); /** Enables or disables logic ops and specifies which logic op should be used. * * @param in_should_enable true to enable the mode; false to disable it. * @param in_logic_op Logic operation type to use. */ - void toggle_logic_op(bool in_should_enable, - VkLogicOp in_logic_op); + void toggle_logic_op(bool in_should_enable, + Anvil::LogicOp in_logic_op); /** Enables or disables the "primitive restart" mode. * @@ -712,30 +718,30 @@ namespace Anvil /* Defines blending properties for a single subpass attachment. */ typedef struct BlendingProperties { - VkColorComponentFlagsVariable(channel_write_mask); + Anvil::ColorComponentFlags channel_write_mask; - bool blend_enabled; - VkBlendOp blend_op_alpha; - VkBlendOp blend_op_color; - VkBlendFactor dst_alpha_blend_factor; - VkBlendFactor dst_color_blend_factor; - VkBlendFactor src_alpha_blend_factor; - VkBlendFactor src_color_blend_factor; + bool blend_enabled; + Anvil::BlendOp blend_op_alpha; + Anvil::BlendOp blend_op_color; + Anvil::BlendFactor dst_alpha_blend_factor; + Anvil::BlendFactor dst_color_blend_factor; + Anvil::BlendFactor src_alpha_blend_factor; + Anvil::BlendFactor src_color_blend_factor; /** Constructor. */ BlendingProperties() { blend_enabled = false; - blend_op_alpha = VK_BLEND_OP_ADD; - blend_op_color = VK_BLEND_OP_ADD; - channel_write_mask = VK_COLOR_COMPONENT_A_BIT | - VK_COLOR_COMPONENT_B_BIT | - VK_COLOR_COMPONENT_G_BIT | - VK_COLOR_COMPONENT_R_BIT; - dst_alpha_blend_factor = VK_BLEND_FACTOR_ONE; - dst_color_blend_factor = VK_BLEND_FACTOR_ONE; - src_alpha_blend_factor = VK_BLEND_FACTOR_ONE; - src_color_blend_factor = VK_BLEND_FACTOR_ONE; + blend_op_alpha = Anvil::BlendOp::ADD; + blend_op_color = Anvil::BlendOp::ADD; + channel_write_mask = Anvil::ColorComponentFlagBits::A_BIT | + Anvil::ColorComponentFlagBits::B_BIT | + Anvil::ColorComponentFlagBits::G_BIT | + Anvil::ColorComponentFlagBits::R_BIT; + dst_alpha_blend_factor = Anvil::BlendFactor::ONE; + dst_color_blend_factor = Anvil::BlendFactor::ONE; + src_alpha_blend_factor = Anvil::BlendFactor::ONE; + src_color_blend_factor = Anvil::BlendFactor::ONE; } /** Comparison operator @@ -854,13 +860,13 @@ namespace Anvil */ typedef struct InternalVertexAttribute { - uint32_t divisor; - uint32_t explicit_binding_index; - Anvil::Format format; - uint32_t location; - uint32_t offset_in_bytes; - VkVertexInputRate rate; - uint32_t stride_in_bytes; + uint32_t divisor; + uint32_t explicit_binding_index; + Anvil::Format format; + uint32_t location; + uint32_t offset_in_bytes; + Anvil::VertexInputRate rate; + uint32_t stride_in_bytes; /** Dummy constructor. Should only be used by STL. */ InternalVertexAttribute() @@ -870,7 +876,7 @@ namespace Anvil format = Anvil::Format::UNKNOWN; location = UINT32_MAX; offset_in_bytes = UINT32_MAX; - rate = VK_VERTEX_INPUT_RATE_MAX_ENUM; + rate = Anvil::VertexInputRate::UNKNOWN; stride_in_bytes = UINT32_MAX; } @@ -883,13 +889,13 @@ namespace Anvil * @param in_rate Step rate. * @param in_stride_in_bytes Stride in bytes. **/ - InternalVertexAttribute(uint32_t in_divisor, - uint32_t in_explicit_binding_index, - Anvil::Format in_format, - uint32_t in_location, - uint32_t in_offset_in_bytes, - VkVertexInputRate in_rate, - uint32_t in_stride_in_bytes) + InternalVertexAttribute(uint32_t in_divisor, + uint32_t in_explicit_binding_index, + Anvil::Format in_format, + uint32_t in_location, + uint32_t in_offset_in_bytes, + Anvil::VertexInputRate in_rate, + uint32_t in_stride_in_bytes) { divisor = in_divisor; explicit_binding_index = in_explicit_binding_index; @@ -921,10 +927,10 @@ namespace Anvil float m_depth_bias_constant_factor; float m_depth_bias_slope_factor; - bool m_depth_test_enabled; - VkCompareOp m_depth_test_compare_op; + bool m_depth_test_enabled; + Anvil::CompareOp m_depth_test_compare_op; - DynamicStateBitfield m_enabled_dynamic_states; + std::vector m_enabled_dynamic_states; bool m_alpha_to_coverage_enabled; bool m_alpha_to_one_enabled; @@ -940,29 +946,28 @@ namespace Anvil VkStencilOpState m_stencil_state_back_face; VkStencilOpState m_stencil_state_front_face; - VkRasterizationOrderAMD m_rasterization_order; + Anvil::RasterizationOrderAMD m_rasterization_order; TessellationDomainOrigin m_tessellation_domain_origin; InternalVertexAttributes m_attributes; float m_blend_constant[4]; - VkPolygonMode m_polygon_mode; - VkFrontFace m_front_face; + Anvil::CullModeFlags m_cull_mode; + Anvil::PolygonMode m_polygon_mode; + Anvil::FrontFace m_front_face; float m_line_width; - VkLogicOp m_logic_op; + Anvil::LogicOp m_logic_op; float m_min_sample_shading; uint32_t m_n_dynamic_scissor_boxes; uint32_t m_n_dynamic_viewports; uint32_t m_n_patch_control_points; - VkPrimitiveTopology m_primitive_topology; + Anvil::PrimitiveTopology m_primitive_topology; Anvil::SampleCountFlagBits m_sample_count; VkSampleMask m_sample_mask; InternalScissorBoxes m_scissor_boxes; SubPassAttachmentToBlendingPropertiesMap m_subpass_attachment_blending_properties; InternalViewports m_viewports; - VkCullModeFlagsVariable (m_cull_mode); - const RenderPass* m_renderpass_ptr; SubPassID m_subpass_id; }; diff --git a/include/misc/image_create_info.h b/include/misc/image_create_info.h index b3cb3117..ec2ec026 100644 --- a/include/misc/image_create_info.h +++ b/include/misc/image_create_info.h @@ -48,7 +48,7 @@ namespace Anvil * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * * - External memory handle types: none - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE * * @param in_device_ptr Device to use. * @param in_type Vulkan image type to use. @@ -60,7 +60,7 @@ namespace Anvil * @param in_base_mipmap_depth Depth of the base mip-map. Must be at least 1 for all image types. * @param in_n_layers Number of layers to use. Must be at least 1 for all image types. * @param in_sample_count Sample count to use. - * @param in_queue_families A combination of Anvil::QUEUE_FAMILY_* bits, indicating which device queues + * @param in_queue_families A combination of Anvil::QueueFamilyFlagBits::* bits, indicating which device queues * the image is going to be accessed by. * @param in_sharing_mode Vulkan sharing mode to use. * @param in_use_full_mipmap_chain true if all mipmaps should be created for the image. False to only allocate @@ -86,7 +86,7 @@ namespace Anvil uint32_t in_base_mipmap_depth, uint32_t in_n_layers, Anvil::SampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, + Anvil::QueueFamilyFlags in_queue_families, Anvil::SharingMode in_sharing_mode, bool in_use_full_mipmap_chain, MemoryFeatureFlags in_memory_features, @@ -109,7 +109,7 @@ namespace Anvil * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * * - External memory handle types: none - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE * * @param in_device_ptr Device to use. * @param in_type Vulkan image type to use. @@ -121,7 +121,7 @@ namespace Anvil * @param in_base_mipmap_depth Depth of the base mip-map. Must be at least 1 for all image types. * @param in_n_layers Number of layers to use. Must be at least 1 for all image types. * @param in_sample_count Sample count to use. - * @param in_queue_families A combination of Anvil::QUEUE_FAMILY_* bits, indicating which device queues + * @param in_queue_families A combination of Anvil::QueueFamilyFlagBits::* bits, indicating which device queues * the image is going to be accessed by. * @param in_sharing_mode Vulkan sharing mode to use. * @param in_use_full_mipmap_chain true, if all mipmaps should be created for the image. False to only allocate @@ -146,7 +146,7 @@ namespace Anvil uint32_t in_base_mipmap_depth, uint32_t in_n_layers, Anvil::SampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, + Anvil::QueueFamilyFlags in_queue_families, Anvil::SharingMode in_sharing_mode, bool in_use_full_mipmap_chain, ImageCreateFlags in_create_flags, @@ -164,7 +164,7 @@ namespace Anvil * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * * - External memory handle types: none - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE * - Physical devices: none * - SFR rectangles: none * @@ -193,7 +193,7 @@ namespace Anvil * * - External memory handle types: none * - Initial layout: Anvil::ImageLayout::UNDEFINED - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE * * @param in_device_ptr Device to use. * @param in_type Vulkan image type to use. @@ -205,7 +205,7 @@ namespace Anvil * @param in_base_mipmap_depth Depth of the base mip-map. Must be at least 1 for all image types. * @param in_n_layers Number of layers to use. Must be at least 1 for all image types. * @param in_sample_count Sample count to use. - * @param in_queue_families A combination of Anvil::QUEUE_FAMILY_* bits, indicating which device queues + * @param in_queue_families A combination of Anvil::QueueFamilyFlagBits::* bits, indicating which device queues * the image is going to be accessed by. * @param in_sharing_mode Vulkan sharing mode to use. * @param in_use_full_mipmap_chain true, if all mipmaps should be created for the image. False to make the image @@ -227,7 +227,7 @@ namespace Anvil uint32_t in_base_mipmap_depth, uint32_t in_n_layers, Anvil::SampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, + Anvil::QueueFamilyFlags in_queue_families, Anvil::SharingMode in_sharing_mode, bool in_use_full_mipmap_chain, ImageCreateFlags in_create_flags, @@ -244,7 +244,7 @@ namespace Anvil * * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE **/ static ImageCreateInfoUniquePtr create_swapchain_wrapper(const Anvil::BaseDevice* in_device_ptr, const Anvil::Swapchain* in_swapchain_ptr, @@ -276,7 +276,7 @@ namespace Anvil return m_device_ptr; } - const Anvil::ExternalMemoryHandleTypeBits& get_external_memory_handle_types() const + const Anvil::ExternalMemoryHandleTypeFlags& get_external_memory_handle_types() const { return m_exportable_external_memory_handle_types; } @@ -331,7 +331,7 @@ namespace Anvil } /** Returns queue families compatible with the image */ - const Anvil::QueueFamilyBits& get_queue_families() const + const Anvil::QueueFamilyFlags& get_queue_families() const { return m_queue_families; } @@ -416,7 +416,7 @@ namespace Anvil m_depth = in_depth; } - void set_exportable_external_memory_handle_types(const ExternalMemoryHandleTypeBits& in_external_memory_handle_types) + void set_exportable_external_memory_handle_types(const ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) { m_exportable_external_memory_handle_types = in_external_memory_handle_types; } @@ -461,7 +461,7 @@ namespace Anvil m_post_create_layout = in_post_create_layout; } - void set_queue_families(const Anvil::QueueFamilyBits& in_queue_families) + void set_queue_families(const Anvil::QueueFamilyFlags& in_queue_families) { m_queue_families = in_queue_families; } @@ -545,53 +545,53 @@ namespace Anvil private: /* Private functions */ - ImageCreateInfo(Anvil::ImageInternalType in_type, - const Anvil::BaseDevice* in_device_ptr, - Anvil::ImageType in_type_vk, - Anvil::Format in_format, - Anvil::ImageTiling in_tiling, - Anvil::SharingMode in_sharing_mode, - ImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - Anvil::SampleCountFlagBits in_sample_count, - bool in_use_full_mipmap_chain, - ImageCreateFlags in_create_flags, - Anvil::QueueFamilyBits in_queue_families, - Anvil::ImageLayout in_post_create_image_layout, - const Anvil::ImageLayout& in_post_alloc_image_layout, - const std::vector* in_opt_mipmaps_ptr, - const Anvil::MTSafety& in_mt_safety, - Anvil::ExternalMemoryHandleTypeBits in_exportable_external_memory_handle_types, - const Anvil::MemoryFeatureFlags& in_memory_features, - const Anvil::SparseResidencyScope& in_residency_scope); + ImageCreateInfo(Anvil::ImageInternalType in_type, + const Anvil::BaseDevice* in_device_ptr, + Anvil::ImageType in_type_vk, + Anvil::Format in_format, + Anvil::ImageTiling in_tiling, + Anvil::SharingMode in_sharing_mode, + ImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + Anvil::SampleCountFlagBits in_sample_count, + bool in_use_full_mipmap_chain, + ImageCreateFlags in_create_flags, + Anvil::QueueFamilyFlags in_queue_families, + Anvil::ImageLayout in_post_create_image_layout, + const Anvil::ImageLayout& in_post_alloc_image_layout, + const std::vector* in_opt_mipmaps_ptr, + const Anvil::MTSafety& in_mt_safety, + Anvil::ExternalMemoryHandleTypeFlags in_exportable_external_memory_handle_types, + const Anvil::MemoryFeatureFlags& in_memory_features, + const Anvil::SparseResidencyScope& in_residency_scope); /* Private variables */ - Anvil::ImageCreateFlags m_create_flags; - uint32_t m_depth; - const Anvil::BaseDevice* m_device_ptr; - Anvil::ExternalMemoryHandleTypeBits m_exportable_external_memory_handle_types; - Anvil::Format m_format; - uint32_t m_height; - const Anvil::ImageInternalType m_internal_type; - Anvil::MemoryFeatureFlags m_memory_features; - std::vector m_mipmaps_to_upload; - Anvil::MTSafety m_mt_safety; - uint32_t m_n_layers; - Anvil::ImageLayout m_post_alloc_layout; - Anvil::ImageLayout m_post_create_layout; - Anvil::QueueFamilyBits m_queue_families; - Anvil::SparseResidencyScope m_residency_scope; - Anvil::SampleCountFlagBits m_sample_count; - Anvil::SharingMode m_sharing_mode; - Anvil::ImageTiling m_tiling; - const Anvil::ImageType m_type_vk; - ImageUsageFlags m_usage_flags; - bool m_use_full_mipmap_chain; - uint32_t m_width; + Anvil::ImageCreateFlags m_create_flags; + uint32_t m_depth; + const Anvil::BaseDevice* m_device_ptr; + Anvil::ExternalMemoryHandleTypeFlags m_exportable_external_memory_handle_types; + Anvil::Format m_format; + uint32_t m_height; + const Anvil::ImageInternalType m_internal_type; + Anvil::MemoryFeatureFlags m_memory_features; + std::vector m_mipmaps_to_upload; + Anvil::MTSafety m_mt_safety; + uint32_t m_n_layers; + Anvil::ImageLayout m_post_alloc_layout; + Anvil::ImageLayout m_post_create_layout; + Anvil::QueueFamilyFlags m_queue_families; + Anvil::SparseResidencyScope m_residency_scope; + Anvil::SampleCountFlagBits m_sample_count; + Anvil::SharingMode m_sharing_mode; + Anvil::ImageTiling m_tiling; + const Anvil::ImageType m_type_vk; + ImageUsageFlags m_usage_flags; + bool m_use_full_mipmap_chain; + uint32_t m_width; /* Only used for peer images */ std::vector m_physical_devices; diff --git a/include/misc/image_view_create_info.h b/include/misc/image_view_create_info.h index 2d06177d..fd46ed54 100644 --- a/include/misc/image_view_create_info.h +++ b/include/misc/image_view_create_info.h @@ -49,7 +49,7 @@ namespace Anvil * * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE * * @return New ImageView instance, if function executes successfully; nullptr otherwise. **/ @@ -83,7 +83,7 @@ namespace Anvil * * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE * * @return New ImageView instance, if function executes successfully; nullptr otherwise. **/ @@ -119,7 +119,7 @@ namespace Anvil * * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE * * @return New ImageView instance, if function executes successfully; nullptr otherwise. **/ @@ -154,7 +154,7 @@ namespace Anvil * * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE * * @return New ImageView instance, if function executes successfully; nullptr otherwise. **/ @@ -189,7 +189,7 @@ namespace Anvil * * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE * * @return New ImageView instance, if function executes successfully; nullptr otherwise. **/ @@ -223,7 +223,7 @@ namespace Anvil * * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE * * @return New ImageView instance, if function executes successfully; nullptr otherwise. **/ @@ -258,7 +258,7 @@ namespace Anvil * * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE * * @return New ImageView instance, if function executes successfully; nullptr otherwise. **/ @@ -340,7 +340,7 @@ namespace Anvil } /** Returns image view type of the image view instance */ - const VkImageViewType get_type() const + const Anvil::ImageViewType get_type() const { return m_type; } @@ -434,7 +434,7 @@ namespace Anvil const uint32_t in_n_slices, Anvil::Image* in_parent_image_ptr, const Anvil::ComponentSwizzle* in_swizzle_array_ptr, - const VkImageViewType in_type, + const Anvil::ImageViewType in_type, const Anvil::MTSafety& in_mt_safety); /* Private variables */ @@ -451,8 +451,8 @@ namespace Anvil uint32_t m_n_slices; Anvil::Image* m_parent_image_ptr; std::array m_swizzle_array; - const VkImageViewType m_type; - VkImageUsageFlags m_usage; + Anvil::ImageViewType m_type; + Anvil::ImageUsageFlags m_usage; ANVIL_DISABLE_ASSIGNMENT_OPERATOR(ImageViewCreateInfo); ANVIL_DISABLE_COPY_CONSTRUCTOR(ImageViewCreateInfo); diff --git a/include/misc/memalloc_backends/backend_oneshot.h b/include/misc/memalloc_backends/backend_oneshot.h index 2f7e575b..e22f06c3 100644 --- a/include/misc/memalloc_backends/backend_oneshot.h +++ b/include/misc/memalloc_backends/backend_oneshot.h @@ -61,15 +61,15 @@ namespace Anvil private: /* IMemoryAllocatorBackend functions */ - bool bake (Anvil::MemoryAllocator::Items& in_items) final; - VkResult map (void* in_memory_object, - VkDeviceSize in_start_offset, - VkDeviceSize in_size, - void** out_result_ptr) final; + bool bake (Anvil::MemoryAllocator::Items& in_items) final; + VkResult map (void* in_memory_object, + VkDeviceSize in_start_offset, + VkDeviceSize in_size, + void** out_result_ptr) final; bool supports_baking () const final; - bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) const final; - bool supports_device_masks () const final; - void unmap (void* in_memory_object) final; + bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const final; + bool supports_device_masks () const final; + void unmap (void* in_memory_object) final; /* Private functions */ diff --git a/include/misc/memalloc_backends/backend_vma.h b/include/misc/memalloc_backends/backend_vma.h index e9a7a15b..ad31d58b 100644 --- a/include/misc/memalloc_backends/backend_vma.h +++ b/include/misc/memalloc_backends/backend_vma.h @@ -123,15 +123,15 @@ namespace Anvil /* IMemoryAllocatorBackend functions */ - bool bake (Anvil::MemoryAllocator::Items& in_items) final; - VkResult map (void* in_memory_object, - VkDeviceSize in_start_offset, - VkDeviceSize in_size, - void** out_result_ptr); + bool bake (Anvil::MemoryAllocator::Items& in_items) final; + VkResult map (void* in_memory_object, + VkDeviceSize in_start_offset, + VkDeviceSize in_size, + void** out_result_ptr); bool supports_baking () const final; - bool supports_device_masks () const final; - bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) const final; - void unmap (void* in_memory_object); + bool supports_device_masks () const final; + bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const final; + void unmap (void* in_memory_object); /* Private variables */ const Anvil::BaseDevice* m_device_ptr; diff --git a/include/misc/memory_allocator.h b/include/misc/memory_allocator.h index d22539e3..fcd48639 100644 --- a/include/misc/memory_allocator.h +++ b/include/misc/memory_allocator.h @@ -77,34 +77,34 @@ namespace Anvil const Anvil::ExternalNTHandleInfo* alloc_external_nt_handle_info_ptr; #endif - uint32_t alloc_device_mask; - Anvil::ExternalMemoryHandleTypeBits alloc_exportable_external_handle_types; - bool alloc_is_dedicated_memory; - MemoryBlockUniquePtr alloc_memory_block_ptr; - uint32_t alloc_memory_final_type; - VkDeviceSize alloc_memory_required_alignment; - MemoryFeatureFlags alloc_memory_required_features; - uint32_t alloc_memory_supported_memory_types; - uint32_t alloc_memory_types; - MGPUPeerMemoryRequirements alloc_mgpu_peer_memory_reqs; - VkDeviceSize alloc_offset; - VkDeviceSize alloc_size; - - VkExtent3D extent; - bool is_baked; - VkDeviceSize miptail_offset; - uint32_t n_layer; - VkOffset3D offset; - VkImageSubresource subresource; - - Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, + uint32_t alloc_device_mask; + Anvil::ExternalMemoryHandleTypeFlags alloc_exportable_external_handle_types; + bool alloc_is_dedicated_memory; + MemoryBlockUniquePtr alloc_memory_block_ptr; + uint32_t alloc_memory_final_type; + VkDeviceSize alloc_memory_required_alignment; + MemoryFeatureFlags alloc_memory_required_features; + uint32_t alloc_memory_supported_memory_types; + uint32_t alloc_memory_types; + MGPUPeerMemoryRequirements alloc_mgpu_peer_memory_reqs; + VkDeviceSize alloc_offset; + VkDeviceSize alloc_size; + + VkExtent3D extent; + bool is_baked; + VkDeviceSize miptail_offset; + uint32_t n_layer; + VkOffset3D offset; + Anvil::ImageSubresource subresource; + + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, @@ -113,15 +113,15 @@ namespace Anvil const uint32_t& in_device_mask, const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs); - Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_alloc_offset, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_alloc_offset, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, #endif @@ -129,55 +129,55 @@ namespace Anvil const uint32_t& in_device_mask, const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs); - Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - uint32_t in_n_layer, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_miptail_offset, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_layer, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_miptail_offset, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, + const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, #endif - const bool& in_alloc_is_dedicated, - const uint32_t& in_device_mask, - const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs); - - Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - const VkExtent3D& in_extent, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, + const bool& in_alloc_is_dedicated, + const uint32_t& in_device_mask, + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs); + + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + const Anvil::ImageSubresource& in_subresource, + const VkOffset3D& in_offset, + const VkExtent3D& in_extent, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, + const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, #endif - const bool& in_alloc_is_dedicated, - const uint32_t& in_device_mask, - const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs); - - Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, + const bool& in_alloc_is_dedicated, + const uint32_t& in_device_mask, + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs); + + Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, + const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, #endif - const bool& in_alloc_is_dedicated, - const uint32_t& in_device_mask, - const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs); + const bool& in_alloc_is_dedicated, + const uint32_t& in_device_mask, + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs); /** TODO */ ~Item(); @@ -202,9 +202,9 @@ namespace Anvil /* Stub */ } - virtual bool bake (Items& in_items) = 0; - virtual bool supports_device_masks () const = 0; - virtual bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) const = 0; + virtual bool bake (Items& in_items) = 0; + virtual bool supports_device_masks () const = 0; + virtual bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const = 0; }; /* Public functions */ @@ -232,7 +232,7 @@ namespace Anvil **/ bool add_buffer (Anvil::Buffer* in_buffer_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif @@ -241,7 +241,7 @@ namespace Anvil bool add_buffer_with_float_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif @@ -250,7 +250,7 @@ namespace Anvil bool add_buffer_with_float_data_vector_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif @@ -259,7 +259,7 @@ namespace Anvil bool add_buffer_with_float_data_vector_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, const std::vector* in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif @@ -268,7 +268,7 @@ namespace Anvil bool add_buffer_with_uchar8_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif @@ -277,7 +277,7 @@ namespace Anvil bool add_buffer_with_uchar8_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif @@ -286,7 +286,7 @@ namespace Anvil bool add_buffer_with_uint32_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif @@ -295,7 +295,7 @@ namespace Anvil bool add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif @@ -304,7 +304,7 @@ namespace Anvil bool add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, const std::vector* in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif @@ -353,14 +353,14 @@ namespace Anvil * * @return true if the image has been successfully scheduled for baking, false otherwise. **/ - bool add_image_whole(Anvil::Image* in_image_ptr, - MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types = 0, + bool add_image_whole(Anvil::Image* in_image_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif - const uint32_t* in_opt_device_mask_ptr = nullptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); /** Adds a new Image object whose layer @param in_n_layer 's miptail for @param in_aspect @@ -415,7 +415,7 @@ namespace Anvil * @return true if the subresource has been successfully scheduled for baking, false otherwise. **/ bool add_sparse_image_subresource(Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, + const Anvil::ImageSubresource& in_subresource, const VkOffset3D& in_offset, VkExtent3D in_extent, MemoryFeatureFlags in_required_memory_features, @@ -432,7 +432,7 @@ namespace Anvil * @param in_device_ptr Device to use. **/ static Anvil::MemoryAllocatorUniquePtr create_oneshot(const Anvil::BaseDevice* in_device_ptr, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE); /** Creates a new VMA memory allocator instance. * @@ -443,7 +443,7 @@ namespace Anvil * @param in_device_ptr Device to use. **/ static Anvil::MemoryAllocatorUniquePtr create_vma(const Anvil::BaseDevice* in_device_ptr, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE); /** By default, once memory regions are baked, memory allocator will bind them to objects specified * at add_*() call time. Use cases exist where apps may prefer to handle this action on their own. @@ -492,21 +492,21 @@ namespace Anvil private: /* Private functions */ - bool add_buffer_internal(Anvil::Buffer* in_buffer_ptr, - MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, + bool add_buffer_internal(Anvil::Buffer* in_buffer_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr); - - bool do_external_memory_handle_type_sanity_checks(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) const; - bool do_mgpu_sanity_checks (const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_peer_memory_reqs_ptr) const; - bool is_alloc_supported (uint32_t in_memory_types, - Anvil::MemoryFeatureFlags in_memory_features, - uint32_t* out_opt_filtered_memory_types_ptr) const; + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr); + + bool do_external_memory_handle_type_sanity_checks(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const; + bool do_mgpu_sanity_checks (const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_peer_memory_reqs_ptr) const; + bool is_alloc_supported (uint32_t in_memory_types, + Anvil::MemoryFeatureFlags in_memory_features, + uint32_t* out_opt_filtered_memory_types_ptr) const; void on_is_alloc_pending_for_buffer_query(CallbackArgument* in_callback_arg_ptr); void on_is_alloc_pending_for_image_query (CallbackArgument* in_callback_arg_ptr); diff --git a/include/misc/memory_block_create_info.h b/include/misc/memory_block_create_info.h index d27bb59b..445603d9 100644 --- a/include/misc/memory_block_create_info.h +++ b/include/misc/memory_block_create_info.h @@ -57,8 +57,8 @@ namespace Anvil * * NOTE: The following parameters take the following default values: * - * - Exportable external memory handle types: Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE - * - Importable external memory handle type: Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE + * - Exportable external memory handle types: Anvil::ExternalMemoryHandleTypeFlagBits::NONE + * - Importable external memory handle type: Anvil::ExternalMemoryHandleTypeFlagBits::NONE * - Use a dedicated allocation?: No. * * These can be further adjusted by callingt corresponding set_..() functions prior to passing the CreateInfo instance @@ -87,7 +87,7 @@ namespace Anvil * * - Exportable external memory handle types: Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE * - Importable external memory handle type: Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE. + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE. * - Use a dedicated allocation?: No. * * These can be further adjusted by callingt corresponding set_..() functions prior to passing the CreateInfo instance @@ -138,7 +138,7 @@ namespace Anvil return m_device_mask; } - const Anvil::ExternalMemoryHandleTypeBits& get_exportable_external_memory_handle_types() const + const Anvil::ExternalMemoryHandleTypeFlags& get_exportable_external_memory_handle_types() const { return m_exportable_external_memory_handle_types; } @@ -181,7 +181,7 @@ namespace Anvil } #endif - const Anvil::ExternalMemoryHandleTypeBit& get_imported_external_memory_handle_type() const + const Anvil::ExternalMemoryHandleTypeFlagBits& get_imported_external_memory_handle_type() const { return m_imported_external_memory_handle_type; } @@ -244,7 +244,7 @@ namespace Anvil } /* Requires VK_KHR_external_memory */ - void set_exportable_external_memory_handle_types(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) + void set_exportable_external_memory_handle_types(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) { m_exportable_external_memory_handle_types = in_external_memory_handle_types; } @@ -301,7 +301,7 @@ namespace Anvil } #endif - void set_imported_external_memory_handle_type(const Anvil::ExternalMemoryHandleTypeBit& in_memory_handle_type) + void set_imported_external_memory_handle_type(const Anvil::ExternalMemoryHandleTypeFlagBits& in_memory_handle_type) { m_imported_external_memory_handle_type = in_memory_handle_type; } @@ -359,8 +359,8 @@ namespace Anvil uint32_t m_allowed_memory_bits; uint32_t m_device_mask; const Anvil::BaseDevice* m_device_ptr; - Anvil::ExternalMemoryHandleTypeBits m_exportable_external_memory_handle_types; - Anvil::ExternalMemoryHandleTypeBit m_imported_external_memory_handle_type; + Anvil::ExternalMemoryHandleTypeFlags m_exportable_external_memory_handle_types; + Anvil::ExternalMemoryHandleTypeFlagBits m_imported_external_memory_handle_type; VkDeviceMemory m_memory; Anvil::MemoryFeatureFlags m_memory_features; uint32_t m_memory_type_index; diff --git a/include/misc/render_pass_create_info.h b/include/misc/render_pass_create_info.h index 7eab70e8..47614181 100644 --- a/include/misc/render_pass_create_info.h +++ b/include/misc/render_pass_create_info.h @@ -50,8 +50,8 @@ namespace Anvil **/ bool add_color_attachment(Anvil::Format in_format, Anvil::SampleCountFlagBits in_sample_count, - VkAttachmentLoadOp in_load_op, - VkAttachmentStoreOp in_store_op, + Anvil::AttachmentLoadOp in_load_op, + Anvil::AttachmentStoreOp in_store_op, Anvil::ImageLayout in_initial_layout, Anvil::ImageLayout in_final_layout, bool in_may_alias, @@ -77,10 +77,10 @@ namespace Anvil **/ bool add_depth_stencil_attachment(Anvil::Format in_format, Anvil::SampleCountFlagBits in_sample_count, - VkAttachmentLoadOp in_depth_load_op, - VkAttachmentStoreOp in_depth_store_op, - VkAttachmentLoadOp in_stencil_load_op, - VkAttachmentStoreOp in_stencil_store_op, + Anvil::AttachmentLoadOp in_depth_load_op, + Anvil::AttachmentStoreOp in_depth_store_op, + Anvil::AttachmentLoadOp in_stencil_load_op, + Anvil::AttachmentStoreOp in_stencil_store_op, Anvil::ImageLayout in_initial_layout, Anvil::ImageLayout in_final_layout, bool in_may_alias, @@ -157,7 +157,7 @@ namespace Anvil Anvil::ImageLayout in_layout, RenderPassAttachmentID in_attachment_id, uint32_t in_attachment_index, - const Anvil::ImageAspectFlags& in_opt_aspects_accessed = Anvil::ImageAspectFlagBits::IMAGE_ASPECT_UNKNOWN); + const Anvil::ImageAspectFlags& in_opt_aspects_accessed = Anvil::ImageAspectFlagBits::NONE); /** Adds a new external->subpass dependency to the internal data model. * @@ -167,17 +167,17 @@ namespace Anvil * @param in_destination_stage_mask Destination pipeline stage mask. * @param in_source_access_mask Source access mask. * @param in_destination_access_mask Destination access mask. - * @param in_by_region true if a "by-region" dependency is requested; false otherwise. + * @param in_dependency_flags Flags to use for the dependency. * * @return true if the dependency was added successfully; false otherwise. * **/ - bool add_external_to_subpass_dependency(SubPassID in_destination_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region); + bool add_external_to_subpass_dependency(SubPassID in_destination_subpass_id, + Anvil::PipelineStageFlags in_source_stage_mask, + Anvil::PipelineStageFlags in_destination_stage_mask, + Anvil::AccessFlags in_source_access_mask, + Anvil::AccessFlags in_destination_access_mask, + Anvil::DependencyFlags in_dependency_flags); /** Adds a new self-subpass dependency to the internal data model. * @@ -187,17 +187,17 @@ namespace Anvil * @param in_destination_stage_mask Destination pipeline stage mask. * @param in_source_access_mask Source access mask. * @param in_destination_access_mask Destination access mask. - * @param in_by_region true if a "by-region" dependency is requested; false otherwise. + * @param in_dependency_flags Flags to use for the dependency. * * @return true if the dependency was added successfully; false otherwise. * **/ - bool add_self_subpass_dependency(SubPassID in_destination_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region); + bool add_self_subpass_dependency(SubPassID in_destination_subpass_id, + Anvil::PipelineStageFlags in_source_stage_mask, + Anvil::PipelineStageFlags in_destination_stage_mask, + Anvil::AccessFlags in_source_access_mask, + Anvil::AccessFlags in_destination_access_mask, + Anvil::DependencyFlags in_dependency_flags); /** Adds a new subpass->external dependency to the internal data model. * @@ -207,16 +207,16 @@ namespace Anvil * @param in_destination_stage_mask Destination pipeline stage mask. * @param in_source_access_mask Source access mask. * @param in_destination_access_mask Destination access mask. - * @param in_by_region true if a "by-region" dependency is requested; false otherwise. + * @param in_dependency_flags Flags to use for the dependency. * * @return true if the dependency was added successfully; false otherwise. **/ - bool add_subpass_to_external_dependency(SubPassID in_source_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region); + bool add_subpass_to_external_dependency(SubPassID in_source_subpass_id, + Anvil::PipelineStageFlags in_source_stage_mask, + Anvil::PipelineStageFlags in_destination_stage_mask, + Anvil::AccessFlags in_source_access_mask, + Anvil::AccessFlags in_destination_access_mask, + Anvil::DependencyFlags in_dependency_flags); /** Adds a new subpass->subpass dependency to the internal data model. * @@ -228,17 +228,17 @@ namespace Anvil * @param in_destination_stage_mask Destination pipeline stage mask. * @param in_source_access_mask Source access mask. * @param in_destination_access_mask Destination access mask. - * @param in_by_region true if a "by-region" dependency is requested; false otherwise. + * @param in_dependency_flags Flags to use for the dependency. * * @return true if the dependency was added successfully; false otherwise. **/ - bool add_subpass_to_subpass_dependency(SubPassID in_source_subpass_id, - SubPassID in_destination_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region); + bool add_subpass_to_subpass_dependency(SubPassID in_source_subpass_id, + SubPassID in_destination_subpass_id, + Anvil::PipelineStageFlags in_source_stage_mask, + Anvil::PipelineStageFlags in_destination_stage_mask, + Anvil::AccessFlags in_source_access_mask, + Anvil::AccessFlags in_destination_access_mask, + Anvil::DependencyFlags in_dependency_flags); /** Tells what type an attachment with user-specified ID has. * @@ -268,8 +268,8 @@ namespace Anvil **/ bool get_color_attachment_properties(RenderPassAttachmentID in_attachment_id, Anvil::SampleCountFlagBits* out_opt_sample_count_ptr = nullptr, - VkAttachmentLoadOp* out_opt_load_op_ptr = nullptr, - VkAttachmentStoreOp* out_opt_store_op_ptr = nullptr, + Anvil::AttachmentLoadOp* out_opt_load_op_ptr = nullptr, + Anvil::AttachmentStoreOp* out_opt_store_op_ptr = nullptr, Anvil::ImageLayout* out_opt_initial_layout_ptr = nullptr, Anvil::ImageLayout* out_opt_final_layout_ptr = nullptr, bool* out_opt_may_alias_ptr = nullptr) const; @@ -295,14 +295,14 @@ namespace Anvil * * @return true if successful, false otherwise */ - bool get_dependency_properties(uint32_t in_n_dependency, - SubPassID* out_destination_subpass_id_ptr, - SubPassID* out_source_subpass_id_ptr, - VkPipelineStageFlags* out_destination_stage_mask_ptr, - VkPipelineStageFlags* out_source_stage_mask_ptr, - VkAccessFlags* out_destination_access_mask_ptr, - VkAccessFlags* out_source_access_mask_ptr, - DependencyFlags* out_flags_ptr) const; + bool get_dependency_properties(uint32_t in_n_dependency, + SubPassID* out_destination_subpass_id_ptr, + SubPassID* out_source_subpass_id_ptr, + Anvil::PipelineStageFlags* out_destination_stage_mask_ptr, + Anvil::PipelineStageFlags* out_source_stage_mask_ptr, + Anvil::AccessFlags* out_destination_access_mask_ptr, + Anvil::AccessFlags* out_source_access_mask_ptr, + DependencyFlags* out_flags_ptr) const; /** Retrieves properties of the render pass color attachment with the user-specified ID * @@ -325,14 +325,14 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool get_depth_stencil_attachment_properties(RenderPassAttachmentID in_attachment_id, - VkAttachmentLoadOp* out_opt_depth_load_op_ptr = nullptr, - VkAttachmentStoreOp* out_opt_depth_store_op_ptr = nullptr, - VkAttachmentLoadOp* out_opt_stencil_load_op_ptr = nullptr, - VkAttachmentStoreOp* out_opt_stencil_store_op_ptr = nullptr, - Anvil::ImageLayout* out_opt_initial_layout_ptr = nullptr, - Anvil::ImageLayout* out_opt_final_layout_ptr = nullptr, - bool* out_opt_may_alias_ptr = nullptr) const; + bool get_depth_stencil_attachment_properties(RenderPassAttachmentID in_attachment_id, + Anvil::AttachmentLoadOp* out_opt_depth_load_op_ptr = nullptr, + Anvil::AttachmentStoreOp* out_opt_depth_store_op_ptr = nullptr, + Anvil::AttachmentLoadOp* out_opt_stencil_load_op_ptr = nullptr, + Anvil::AttachmentStoreOp* out_opt_stencil_store_op_ptr = nullptr, + Anvil::ImageLayout* out_opt_initial_layout_ptr = nullptr, + Anvil::ImageLayout* out_opt_final_layout_ptr = nullptr, + bool* out_opt_may_alias_ptr = nullptr) const; const Anvil::BaseDevice* get_device() const { @@ -410,16 +410,16 @@ namespace Anvil /** Holds properties of a single render-pass attachment. **/ typedef struct RenderPassAttachment { - VkAttachmentLoadOp color_depth_load_op; - VkAttachmentStoreOp color_depth_store_op; + Anvil::AttachmentLoadOp color_depth_load_op; + Anvil::AttachmentStoreOp color_depth_store_op; Anvil::ImageLayout final_layout; Anvil::Format format; uint32_t index; Anvil::ImageLayout initial_layout; bool may_alias; Anvil::SampleCountFlagBits sample_count; - VkAttachmentLoadOp stencil_load_op; - VkAttachmentStoreOp stencil_store_op; + Anvil::AttachmentLoadOp stencil_load_op; + Anvil::AttachmentStoreOp stencil_store_op; AttachmentType type; /** Constructor. Should only be used for color attachments. @@ -437,8 +437,8 @@ namespace Anvil ***/ RenderPassAttachment(Anvil::Format in_format, Anvil::SampleCountFlagBits in_sample_count, - VkAttachmentLoadOp in_load_op, - VkAttachmentStoreOp in_store_op, + Anvil::AttachmentLoadOp in_load_op, + Anvil::AttachmentStoreOp in_store_op, Anvil::ImageLayout in_initial_layout, Anvil::ImageLayout in_final_layout, bool in_may_alias, @@ -452,9 +452,9 @@ namespace Anvil initial_layout = in_initial_layout; may_alias = in_may_alias; sample_count = in_sample_count; - stencil_load_op = VK_ATTACHMENT_LOAD_OP_DONT_CARE; - stencil_store_op = VK_ATTACHMENT_STORE_OP_DONT_CARE; - type = ATTACHMENT_TYPE_COLOR; + stencil_load_op = Anvil::AttachmentLoadOp::DONT_CARE; + stencil_store_op = Anvil::AttachmentStoreOp::DONT_CARE; + type = Anvil::AttachmentType::COLOR; } /** Constructor. Should only be used for depth/stencil attachments @@ -474,10 +474,10 @@ namespace Anvil **/ RenderPassAttachment(Anvil::Format in_format, Anvil::SampleCountFlagBits in_sample_count, - VkAttachmentLoadOp in_depth_load_op, - VkAttachmentStoreOp in_depth_store_op, - VkAttachmentLoadOp in_stencil_load_op, - VkAttachmentStoreOp in_stencil_store_op, + Anvil::AttachmentLoadOp in_depth_load_op, + Anvil::AttachmentStoreOp in_depth_store_op, + Anvil::AttachmentLoadOp in_stencil_load_op, + Anvil::AttachmentStoreOp in_stencil_store_op, Anvil::ImageLayout in_initial_layout, Anvil::ImageLayout in_final_layout, bool in_may_alias, @@ -493,23 +493,23 @@ namespace Anvil sample_count = in_sample_count; stencil_load_op = in_stencil_load_op; stencil_store_op = in_stencil_store_op; - type = ATTACHMENT_TYPE_DEPTH_STENCIL; + type = Anvil::AttachmentType::DEPTH_STENCIL; } /** Dummy constructor. This should only be used by STL containers. */ RenderPassAttachment() { - color_depth_load_op = VK_ATTACHMENT_LOAD_OP_MAX_ENUM; - color_depth_store_op = VK_ATTACHMENT_STORE_OP_MAX_ENUM; + color_depth_load_op = Anvil::AttachmentLoadOp::UNKNOWN; + color_depth_store_op = Anvil::AttachmentStoreOp::UNKNOWN; final_layout = Anvil::ImageLayout::UNKNOWN; format = Anvil::Format::UNKNOWN; index = UINT32_MAX; initial_layout = Anvil::ImageLayout::UNKNOWN; may_alias = false; sample_count = static_cast(0); - stencil_load_op = VK_ATTACHMENT_LOAD_OP_MAX_ENUM; - stencil_store_op = VK_ATTACHMENT_STORE_OP_MAX_ENUM; - type = ATTACHMENT_TYPE_UNKNOWN; + stencil_load_op = Anvil::AttachmentLoadOp::UNKNOWN; + stencil_store_op = Anvil::AttachmentStoreOp::UNKNOWN; + type = Anvil::AttachmentType::UNKNOWN; } } RenderPassAttachment; @@ -529,7 +529,7 @@ namespace Anvil /* Dummy constructor. Should only be used by STL containers */ SubPassAttachment() { - aspects_accessed = Anvil::ImageAspectFlagBits::IMAGE_ASPECT_UNKNOWN; + aspects_accessed = Anvil::ImageAspectFlagBits::NONE; attachment_index = UINT32_MAX; highest_subpass_index = UINT32_MAX; layout = Anvil::ImageLayout::UNKNOWN; @@ -648,10 +648,10 @@ namespace Anvil /** Holds properties of a single subpass<->subpass dependency. */ typedef struct SubPassDependency { - VkAccessFlagsVariable (destination_access_mask); - VkPipelineStageFlagsVariable(destination_stage_mask); - VkAccessFlagsVariable (source_access_mask); - VkPipelineStageFlagsVariable(source_stage_mask); + Anvil::AccessFlags destination_access_mask; + Anvil::PipelineStageFlags destination_stage_mask; + Anvil::AccessFlags source_access_mask; + Anvil::PipelineStageFlags source_stage_mask; DependencyFlags flags; const SubPass* destination_subpass_ptr; @@ -669,32 +669,27 @@ namespace Anvil * @param in_destination_access_mask Destination access mask. * @param in_dependency_flags Flags to use for the dependency. **/ - SubPassDependency(VkPipelineStageFlags in_destination_stage_mask, - const SubPass* in_destination_subpass_ptr, - VkPipelineStageFlags in_source_stage_mask, - const SubPass* in_source_subpass_ptr, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - const DependencyFlags& in_flags) + SubPassDependency(Anvil::PipelineStageFlags in_destination_stage_mask, + const SubPass* in_destination_subpass_ptr, + Anvil::PipelineStageFlags in_source_stage_mask, + const SubPass* in_source_subpass_ptr, + Anvil::AccessFlags in_source_access_mask, + Anvil::AccessFlags in_destination_access_mask, + const DependencyFlags& in_flags) { flags = in_flags; - destination_stage_mask = static_cast(in_destination_stage_mask); + destination_stage_mask = in_destination_stage_mask; destination_subpass_ptr = in_destination_subpass_ptr; - destination_access_mask = static_cast (in_destination_access_mask); - source_access_mask = static_cast (in_source_access_mask); - source_stage_mask = static_cast(in_source_stage_mask); + destination_access_mask = in_destination_access_mask; + source_access_mask = in_source_access_mask; + source_stage_mask = in_source_stage_mask; source_subpass_ptr = in_source_subpass_ptr; } /** Dummy constructor. Should only be used by STL containers */ SubPassDependency() { - destination_access_mask = static_cast (0); - destination_stage_mask = static_cast(0); destination_subpass_ptr = nullptr; - flags = 0; - source_access_mask = static_cast (0); - source_stage_mask = static_cast(0); source_subpass_ptr = nullptr; } @@ -718,11 +713,11 @@ namespace Anvil bool add_dependency (SubPass* in_destination_subpass_ptr, SubPass* in_source_subpass_ptr, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region); + Anvil::PipelineStageFlags in_source_stage_mask, + Anvil::PipelineStageFlags in_destination_stage_mask, + Anvil::AccessFlags in_source_access_mask, + Anvil::AccessFlags in_destination_access_mask, + Anvil::DependencyFlags in_dependency_flags); bool add_subpass_attachment(SubPassID in_subpass_id, bool in_is_color_attachment, Anvil::ImageLayout in_input_layout, @@ -730,7 +725,7 @@ namespace Anvil uint32_t in_attachment_location, bool in_should_resolve, RenderPassAttachmentID in_resolve_attachment_id, - const Anvil::ImageAspectFlags& in_opt_aspects_accessed = Anvil::ImageAspectFlagBits::IMAGE_ASPECT_UNKNOWN); + const Anvil::ImageAspectFlags& in_opt_aspects_accessed = Anvil::ImageAspectFlagBits::NONE); VkAttachmentReference get_attachment_reference_from_renderpass_attachment(const RenderPassAttachment& in_renderpass_attachment) const; VkAttachmentReference get_attachment_reference_from_subpass_attachment (const SubPassAttachment& in_subpass_attachment) const; diff --git a/include/misc/sampler_create_info.h b/include/misc/sampler_create_info.h index b1662df0..08e3af58 100644 --- a/include/misc/sampler_create_info.h +++ b/include/misc/sampler_create_info.h @@ -35,44 +35,44 @@ namespace Anvil * * For argument discussion, please consult Vulkan API specification. */ - static SamplerCreateInfoUniquePtr create(const Anvil::BaseDevice* in_device_ptr, - VkFilter in_mag_filter, - VkFilter in_min_filter, - VkSamplerMipmapMode in_mipmap_mode, - VkSamplerAddressMode in_address_mode_u, - VkSamplerAddressMode in_address_mode_v, - VkSamplerAddressMode in_address_mode_w, - float in_lod_bias, - float in_max_anisotropy, - bool in_compare_enable, - VkCompareOp in_compare_op, - float in_min_lod, - float in_max_lod, - VkBorderColor in_border_color, - bool in_use_unnormalized_coordinates, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); - - const VkSamplerAddressMode& get_address_mode_u() const + static SamplerCreateInfoUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + Anvil::Filter in_mag_filter, + Anvil::Filter in_min_filter, + Anvil::SamplerMipmapMode in_mipmap_mode, + Anvil::SamplerAddressMode in_address_mode_u, + Anvil::SamplerAddressMode in_address_mode_v, + Anvil::SamplerAddressMode in_address_mode_w, + float in_lod_bias, + float in_max_anisotropy, + bool in_compare_enable, + Anvil::CompareOp in_compare_op, + float in_min_lod, + float in_max_lod, + Anvil::BorderColor in_border_color, + bool in_use_unnormalized_coordinates, + MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE); + + const Anvil::SamplerAddressMode& get_address_mode_u() const { return m_address_mode_u; } - const VkSamplerAddressMode& get_address_mode_v() const + const Anvil::SamplerAddressMode& get_address_mode_v() const { return m_address_mode_v; } - const VkSamplerAddressMode& get_address_mode_w() const + const Anvil::SamplerAddressMode& get_address_mode_w() const { return m_address_mode_w; } - const VkBorderColor& get_border_color() const + const Anvil::BorderColor& get_border_color() const { return m_border_color; } - const VkCompareOp& get_compare_op() const + const Anvil::CompareOp& get_compare_op() const { return m_compare_op; } @@ -87,7 +87,7 @@ namespace Anvil return m_lod_bias; } - const VkFilter& get_mag_filter() const + const Anvil::Filter& get_mag_filter() const { return m_mag_filter; } @@ -102,7 +102,7 @@ namespace Anvil return m_max_lod; } - const VkFilter& get_min_filter() const + const Anvil::Filter& get_min_filter() const { return m_min_filter; } @@ -112,7 +112,7 @@ namespace Anvil return m_min_lod; } - const VkSamplerMipmapMode& get_mipmap_mode() const + const Anvil::SamplerMipmapMode& get_mipmap_mode() const { return m_mipmap_mode; } @@ -127,27 +127,27 @@ namespace Anvil return m_compare_enable; } - void set_address_mode_u(const VkSamplerAddressMode& in_address_mode_u) + void set_address_mode_u(const Anvil::SamplerAddressMode& in_address_mode_u) { m_address_mode_u = in_address_mode_u; } - void set_address_mode_v(const VkSamplerAddressMode& in_address_mode_v) + void set_address_mode_v(const Anvil::SamplerAddressMode& in_address_mode_v) { m_address_mode_v = in_address_mode_v; } - void set_address_mode_w(const VkSamplerAddressMode& in_address_mode_w) + void set_address_mode_w(const Anvil::SamplerAddressMode& in_address_mode_w) { m_address_mode_w = in_address_mode_w; } - void set_border_color(const VkBorderColor& in_border_color) + void set_border_color(const Anvil::BorderColor& in_border_color) { m_border_color = in_border_color; } - void set_compare_op(const VkCompareOp& in_compare_op) + void set_compare_op(const Anvil::CompareOp& in_compare_op) { m_compare_op = in_compare_op; } @@ -162,7 +162,7 @@ namespace Anvil m_lod_bias = in_lod_bias; } - void set_mag_filter(const VkFilter& in_mag_filter) + void set_mag_filter(const Anvil::Filter& in_mag_filter) { m_mag_filter = in_mag_filter; } @@ -177,7 +177,7 @@ namespace Anvil m_max_lod = in_max_lod; } - void set_min_filter(const VkFilter& in_min_filter) + void set_min_filter(const Anvil::Filter& in_min_filter) { m_min_filter = in_min_filter; } @@ -187,7 +187,7 @@ namespace Anvil m_min_lod = in_min_lod; } - void set_mipmap_mode(const VkSamplerMipmapMode& in_mipmap_mode) + void set_mipmap_mode(const Anvil::SamplerMipmapMode& in_mipmap_mode) { m_mipmap_mode = in_mipmap_mode; } @@ -215,40 +215,40 @@ namespace Anvil private: /* Private functions */ - SamplerCreateInfo(const Anvil::BaseDevice* in_device_ptr, - VkFilter in_mag_filter, - VkFilter in_min_filter, - VkSamplerMipmapMode in_mipmap_mode, - VkSamplerAddressMode in_address_mode_u, - VkSamplerAddressMode in_address_mode_v, - VkSamplerAddressMode in_address_mode_w, - float in_lod_bias, - float in_max_anisotropy, - bool in_compare_enable, - VkCompareOp in_compare_op, - float in_min_lod, - float in_max_lod, - VkBorderColor in_border_color, - bool in_use_unnormalized_coordinates, - MTSafety in_mt_safety); + SamplerCreateInfo(const Anvil::BaseDevice* in_device_ptr, + Anvil::Filter in_mag_filter, + Anvil::Filter in_min_filter, + Anvil::SamplerMipmapMode in_mipmap_mode, + Anvil::SamplerAddressMode in_address_mode_u, + Anvil::SamplerAddressMode in_address_mode_v, + Anvil::SamplerAddressMode in_address_mode_w, + float in_lod_bias, + float in_max_anisotropy, + bool in_compare_enable, + Anvil::CompareOp in_compare_op, + float in_min_lod, + float in_max_lod, + Anvil::BorderColor in_border_color, + bool in_use_unnormalized_coordinates, + MTSafety in_mt_safety); /* Private variables */ - VkSamplerAddressMode m_address_mode_u; - VkSamplerAddressMode m_address_mode_v; - VkSamplerAddressMode m_address_mode_w; - VkBorderColor m_border_color; - bool m_compare_enable; - VkCompareOp m_compare_op; - float m_lod_bias; - VkFilter m_mag_filter; - float m_max_anisotropy; - float m_max_lod; - VkFilter m_min_filter; - float m_min_lod; - VkSamplerMipmapMode m_mipmap_mode; - Anvil::MTSafety m_mt_safety; - bool m_use_unnormalized_coordinates; + Anvil::SamplerAddressMode m_address_mode_u; + Anvil::SamplerAddressMode m_address_mode_v; + Anvil::SamplerAddressMode m_address_mode_w; + Anvil::BorderColor m_border_color; + bool m_compare_enable; + Anvil::CompareOp m_compare_op; + float m_lod_bias; + Anvil::Filter m_mag_filter; + float m_max_anisotropy; + float m_max_lod; + Anvil::Filter m_min_filter; + float m_min_lod; + Anvil::SamplerMipmapMode m_mipmap_mode; + Anvil::MTSafety m_mt_safety; + bool m_use_unnormalized_coordinates; const Anvil::BaseDevice* m_device_ptr; diff --git a/include/misc/semaphore_create_info.h b/include/misc/semaphore_create_info.h index 66fa1289..2a42845d 100644 --- a/include/misc/semaphore_create_info.h +++ b/include/misc/semaphore_create_info.h @@ -36,7 +36,7 @@ namespace Anvil * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * * - Exportable external semaphore handle type: none - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE */ static Anvil::SemaphoreCreateInfoUniquePtr create(const Anvil::BaseDevice* in_device_ptr); @@ -45,7 +45,7 @@ namespace Anvil return m_device_ptr; } - const Anvil::ExternalSemaphoreHandleTypeBits& get_exportable_external_semaphore_handle_types() const + const Anvil::ExternalSemaphoreHandleTypeFlags& get_exportable_external_semaphore_handle_types() const { return m_exportable_external_semaphore_handle_types; } @@ -84,7 +84,7 @@ namespace Anvil * * Requires VK_KHR_external_semaphore. */ - void set_exportable_external_semaphore_handle_types(const Anvil::ExternalFenceHandleTypeBits& in_external_handle_types) + void set_exportable_external_semaphore_handle_types(const Anvil::ExternalSemaphoreHandleTypeFlags& in_external_handle_types) { m_exportable_external_semaphore_handle_types = in_external_handle_types; } @@ -134,9 +134,9 @@ namespace Anvil MTSafety in_mt_safety); /* Private variables */ - const Anvil::BaseDevice* m_device_ptr; - Anvil::ExternalSemaphoreHandleTypeBits m_exportable_external_semaphore_handle_types; - Anvil::MTSafety m_mt_safety; + const Anvil::BaseDevice* m_device_ptr; + Anvil::ExternalSemaphoreHandleTypeFlags m_exportable_external_semaphore_handle_types; + Anvil::MTSafety m_mt_safety; #ifdef _WIN32 ExternalNTHandleInfo m_exportable_nt_handle_info; diff --git a/include/misc/swapchain_create_info.h b/include/misc/swapchain_create_info.h index fa384c33..41d07d9a 100644 --- a/include/misc/swapchain_create_info.h +++ b/include/misc/swapchain_create_info.h @@ -35,8 +35,8 @@ namespace Anvil * * NOTE: By default, the following parameters take default values as below. * - * - MGPU present mode flags: VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR - * - MT safety: MT_SAFETY_INHERIT_FROM_PARENT_DEVICE + * - MGPU present mode flags: Anvil::DeviceGroupPresentModeFlagBits::LOCAL_BIT_KHR + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE * - Swapchain create flags: 0 * * To modify these, use corresponding set_..() functions. @@ -45,7 +45,7 @@ namespace Anvil Anvil::RenderingSurface* in_parent_surface_ptr, Anvil::Window* in_window_ptr, Anvil::Format in_format, - VkPresentModeKHR in_present_mode, + Anvil::PresentModeKHR in_present_mode, Anvil::ImageUsageFlags in_usage_flags, uint32_t in_n_images); @@ -56,7 +56,7 @@ namespace Anvil } /** Returns flags used to create the swapchain. */ - const VkSwapchainCreateFlagsKHR& get_flags() const + const Anvil::SwapchainCreateFlags& get_flags() const { return m_flags; } @@ -67,7 +67,7 @@ namespace Anvil return m_format; } - VkDeviceGroupPresentModeFlagsKHR get_mgpu_present_mode_flags() const + Anvil::DeviceGroupPresentModeFlags get_mgpu_present_mode_flags() const { return m_mgpu_present_mode_flags; } @@ -83,7 +83,7 @@ namespace Anvil return m_n_images; } - VkPresentModeKHR get_present_mode() const + Anvil::PresentModeKHR get_present_mode() const { return m_present_mode; } @@ -111,7 +111,7 @@ namespace Anvil m_device_ptr = in_device_ptr; } - void set_flags(const VkSwapchainCreateFlagsKHR& in_flags) + void set_flags(const Anvil::SwapchainCreateFlags& in_flags) { m_flags = in_flags; } @@ -121,7 +121,7 @@ namespace Anvil m_format = in_format; } - void set_mgpu_present_mode_flags(const VkDeviceGroupPresentModeFlagsKHR& in_mgpu_present_mode_flags) + void set_mgpu_present_mode_flags(const Anvil::DeviceGroupPresentModeFlags& in_mgpu_present_mode_flags) { m_mgpu_present_mode_flags = in_mgpu_present_mode_flags; } @@ -136,7 +136,7 @@ namespace Anvil m_n_images = in_n_images; } - void set_present_mode(const VkPresentModeKHR& in_present_mode) + void set_present_mode(const Anvil::PresentModeKHR& in_present_mode) { m_present_mode = in_present_mode; } @@ -160,28 +160,28 @@ namespace Anvil private: /* Private functions */ - SwapchainCreateInfo(Anvil::BaseDevice* in_device_ptr, - Anvil::RenderingSurface* in_parent_surface_ptr, - Anvil::Window* in_window_ptr, - Anvil::Format in_format, - VkPresentModeKHR in_present_mode, - Anvil::ImageUsageFlags in_usage_flags, - uint32_t in_n_images, - MTSafety in_mt_safety, - VkSwapchainCreateFlagsKHR in_flags, - VkDeviceGroupPresentModeFlagsKHR in_mgpu_present_mode_flags); + SwapchainCreateInfo(Anvil::BaseDevice* in_device_ptr, + Anvil::RenderingSurface* in_parent_surface_ptr, + Anvil::Window* in_window_ptr, + Anvil::Format in_format, + Anvil::PresentModeKHR in_present_mode, + Anvil::ImageUsageFlags in_usage_flags, + uint32_t in_n_images, + MTSafety in_mt_safety, + Anvil::SwapchainCreateFlags in_flags, + Anvil::DeviceGroupPresentModeFlags in_mgpu_present_mode_flags); /* Private variables */ - const Anvil::BaseDevice* m_device_ptr; - VkSwapchainCreateFlagsKHR m_flags; - Anvil::Format m_format; - VkDeviceGroupPresentModeFlagsKHR m_mgpu_present_mode_flags; - Anvil::MTSafety m_mt_safety; - uint32_t m_n_images; - Anvil::RenderingSurface* m_parent_surface_ptr; - VkPresentModeKHR m_present_mode; - Anvil::Window* m_window_ptr; + const Anvil::BaseDevice* m_device_ptr; + Anvil::SwapchainCreateFlags m_flags; + Anvil::Format m_format; + Anvil::DeviceGroupPresentModeFlags m_mgpu_present_mode_flags; + Anvil::MTSafety m_mt_safety; + uint32_t m_n_images; + Anvil::RenderingSurface* m_parent_surface_ptr; + Anvil::PresentModeKHR m_present_mode; + Anvil::Window* m_window_ptr; Anvil::ImageUsageFlags m_usage_flags; diff --git a/include/misc/types.h b/include/misc/types.h index 9442dbeb..995cb029 100644 --- a/include/misc/types.h +++ b/include/misc/types.h @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -92,10 +93,6 @@ #endif #include - - #ifndef nullptr - #define nullptr NULL - #endif #endif #include "vulkan/vulkan.h" diff --git a/include/misc/types_classes.h b/include/misc/types_classes.h index cfe5956e..0977c5fc 100644 --- a/include/misc/types_classes.h +++ b/include/misc/types_classes.h @@ -22,6 +22,8 @@ #ifndef TYPES_CLASSES_H #define TYPES_CLASSES_H +#include "misc/types_struct.h" + namespace Anvil { class IMemoryAllocatorBackendBase @@ -100,21 +102,21 @@ namespace Anvil * @param in_subresource Subresource which should be used for the update operation. * @param in_offset Image region offset for the update operation. * @param in_extent Extent of the update operation. - * @param in_flags VkSparseMemoryBindFlags value to use for the update. + * @param in_flags Flags to use for the update. * @param in_opt_memory_block_ptr Memory block to use for the update operation. May be NULL. * @param in_opt_memory_block_start_offset Start offset of the source memory region. ignored if * @param in_opt_memory_block_ptr is NULL. * @param in_opt_memory_block_owned_by_image TODO **/ - void append_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, - Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - const VkExtent3D& in_extent, - VkSparseMemoryBindFlags in_flags, - Anvil::MemoryBlock* in_opt_memory_block_ptr, - VkDeviceSize in_opt_memory_block_start_offset, - bool in_opt_memory_block_owned_by_image); + void append_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, + Anvil::Image* in_image_ptr, + const Anvil::ImageSubresource& in_subresource, + const VkOffset3D& in_offset, + const VkExtent3D& in_extent, + Anvil::SparseMemoryBindFlags in_flags, + Anvil::MemoryBlock* in_opt_memory_block_ptr, + VkDeviceSize in_opt_memory_block_start_offset, + bool in_opt_memory_block_owned_by_image); /** Appends a new opaque image memory update to the bind info. * @@ -122,20 +124,20 @@ namespace Anvil * @param in_image_ptr Image instance to update. Must not be NULL. * @param in_resource_offset Raw memory image start offset to use for the update. * @param in_size Number of bytes to update. - * @param in_flags VkSparseMemoryBindFlags value to use for the update. + * @param in_flags Flags to use for the update. * @param in_opt_memory_block_ptr Memory block to use for the update operation. May be NULL. * @param in_opt_memory_block_start_offset Start offset of the source memory region. Ignored if * @param in_opt_memory_block_ptr is NULL. * @param in_opt_memory_block_owned_by_image TODO **/ - void append_opaque_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, - Anvil::Image* in_image_ptr, - VkDeviceSize in_resource_offset, - VkDeviceSize in_size, - VkSparseMemoryBindFlags in_flags, - Anvil::MemoryBlock* in_opt_memory_block_ptr, - VkDeviceSize in_opt_memory_block_start_offset, - bool in_opt_memory_block_owned_by_image); + void append_opaque_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, + Anvil::Image* in_image_ptr, + VkDeviceSize in_resource_offset, + VkDeviceSize in_size, + Anvil::SparseMemoryBindFlags in_flags, + Anvil::MemoryBlock* in_opt_memory_block_ptr, + VkDeviceSize in_opt_memory_block_start_offset, + bool in_opt_memory_block_owned_by_image); /** Retrieves bind info properties. * @@ -235,7 +237,7 @@ namespace Anvil * the memory block should be bound. Otherwise ignored. * @param out_opt_extent_ptr If not NULL, deref will be set to the extent of the update. Otherwise * ignored. - * @param out_opt_flags_ptr If not NULL, deref will be set to VkSparseMemoryBindFlags value which + * @param out_opt_flags_ptr If not NULL, deref will be set to Anvil::SparseMemoryBindFlags value which * is going to be used for the update. Otherwise ignored. * @param out_opt_memory_block_ptr_ptr If not NULL, deref will be set to pointer to the memory block, which * is going to be used for the bind operation. Otherwise ignored. @@ -245,16 +247,16 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool get_image_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, - uint32_t in_n_update, - Anvil::Image** out_opt_image_ptr_ptr, - VkImageSubresource* out_opt_subresource_ptr, - VkOffset3D* out_opt_offset_ptr, - VkExtent3D* out_opt_extent_ptr, - VkSparseMemoryBindFlags* out_opt_flags_ptr, - Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, - VkDeviceSize* out_opt_memory_block_start_offset_ptr, - bool* out_opt_memory_block_owned_by_image_ptr) const; + bool get_image_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, + uint32_t in_n_update, + Anvil::Image** out_opt_image_ptr_ptr, + Anvil::ImageSubresource* out_opt_subresource_ptr, + VkOffset3D* out_opt_offset_ptr, + VkExtent3D* out_opt_extent_ptr, + Anvil::SparseMemoryBindFlags* out_opt_flags_ptr, + Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, + VkDeviceSize* out_opt_memory_block_start_offset_ptr, + bool* out_opt_memory_block_owned_by_image_ptr) const; /** Retrieves properties of an opaque image memory updated with a given ID. * @@ -267,7 +269,7 @@ namespace Anvil * be used for the update. Otherwise ignored. * @param out_opt_size_ptr If not NULL, deref will be set to the size of the image memory which should * be used for the update. Otherwise ignored. - * @param out_opt_flags_ptr If not NULL, deref will be set to the VkSParseMemoryBindFlags value which is + * @param out_opt_flags_ptr If not NULL, deref will be set to the Anvil::SparseMemoryBindFlags value which is * going to be used for the update. Otherwise igfnored. * @param out_opt_memory_block_ptr_ptr If not NULL, deref will be set to pointer to the memory block, which is going * to be used for the bind operation. Otherwise ignored. @@ -277,15 +279,15 @@ namespace Anvil * * @return true if successful, false otherwise. */ - bool get_image_opaque_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, - uint32_t in_n_update, - Anvil::Image** out_opt_image_ptr_ptr, - VkDeviceSize* out_opt_resource_offset_ptr, - VkDeviceSize* out_opt_size_ptr, - VkSparseMemoryBindFlags* out_opt_flags_ptr, - Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, - VkDeviceSize* out_opt_memory_block_start_offset_ptr, - bool* out_opt_memory_block_owned_by_image_ptr) const; + bool get_image_opaque_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, + uint32_t in_n_update, + Anvil::Image** out_opt_image_ptr_ptr, + VkDeviceSize* out_opt_resource_offset_ptr, + VkDeviceSize* out_opt_size_ptr, + Anvil::SparseMemoryBindFlags* out_opt_flags_ptr, + Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, + VkDeviceSize* out_opt_memory_block_start_offset_ptr, + bool* out_opt_memory_block_owned_by_image_ptr) const; /** Tells how many bind info items have been assigned to the descriptor */ uint32_t get_n_bind_info_items() const @@ -335,7 +337,7 @@ namespace Anvil VkDeviceSize memory_block_start_offset; VkDeviceSize size; - VkSparseMemoryBindFlagsVariable(flags); + SparseMemoryBindFlags flags; GeneralBindInfo() { @@ -346,14 +348,14 @@ namespace Anvil typedef struct ImageBindInfo { - VkExtent3D extent; - VkOffset3D offset; - bool memory_block_owned_by_image; - Anvil::MemoryBlock* memory_block_ptr; - VkDeviceSize memory_block_start_offset; - VkImageSubresource subresource; - - VkSparseMemoryBindFlagsVariable(flags); + VkExtent3D extent; + VkOffset3D offset; + bool memory_block_owned_by_image; + Anvil::MemoryBlock* memory_block_ptr; + VkDeviceSize memory_block_start_offset; + Anvil::ImageSubresource subresource; + + SparseMemoryBindFlags flags; ImageBindInfo() { diff --git a/include/misc/types_enums.h b/include/misc/types_enums.h index 72f14360..73a47def 100644 --- a/include/misc/types_enums.h +++ b/include/misc/types_enums.h @@ -22,59 +22,394 @@ #ifndef TYPES_ENUMS_H #define TYPES_ENUMS_H +#ifdef IGNORE + #undef IGNORE +#endif + +#ifdef STRICT + #undef STRICT +#endif + namespace Anvil { + template + class Bitfield + { + public: + Bitfield() + :m_value(static_cast(0) ) + { + /* Stub */ + } + + Bitfield(const IndividualBitEnumType& in_bit) + :m_value(static_cast(in_bit) ) + { + /* Stub */ + } + + Bitfield(const Bitfield& in_bits) + :m_value(in_bits.m_value) + { + /* Stub */ + } + + inline Bitfield operator&(const IndividualBitEnumType& in_bit) const + { + auto result = Bitfield(static_cast(m_value & static_cast(in_bit) )); + + return result; + } + + inline Bitfield operator&(const IndividualBitEnumType& in_bit) + { + auto result = Bitfield(static_cast(m_value & static_cast(in_bit))); + + return result; + } + +#if 0 + inline Bitfield operator&(const Bitfield& in_bits) const + { + auto result = Bitfield(static_cast(static_cast(m_value) & static_cast(in_bits.m_value) )); + + return result; + } + + + inline Bitfield operator&(const Bitfield& in_bits) + { + auto result = Bitfield(static_cast(static_cast(m_value) & static_cast(in_bits.m_value) )); + + return result; + } +#endif + + inline Bitfield& operator|=(const IndividualBitEnumType& in_bit) + { + m_value |= static_cast(in_bit); + + return *this; + } + + inline Bitfield& operator|=(const Bitfield& in_bits) + { + m_value |= static_cast(in_bits.m_value); + + return *this; + } + + inline Bitfield& operator&=(const IndividualBitEnumType& in_bit) + { + m_value &= static_cast(in_bit); + + return *this; + } + + inline Bitfield& operator&=(const Bitfield& in_bits) + { + m_value &= static_cast(in_bits.m_value); + + return *this; + } + + inline Bitfield& operator=(const IndividualBitEnumType& in_bit) + { + m_value = static_cast(in_bit); + + return *this; + } + + inline Bitfield& operator=(const Bitfield& in_bits) + { + m_value = static_cast(in_bits.m_value); + + return *this; + } + + inline bool operator!=(const int& in_value) const + { + return m_value != static_cast(in_value); + } + + inline bool operator!=(const Bitfield& in_bitfield) const + { + return (m_value != in_bitfield.m_value); + } + + inline bool operator!=(const IndividualBitEnumType& in_bit) const + { + return (m_value != static_cast(in_bit) ); + } + + inline bool operator==(const int& in_value) const + { + return m_value == static_cast(in_value); + } + + inline bool operator==(const Bitfield& in_bitfield) const + { + return (m_value == in_bitfield.m_value); + } + + inline bool operator==(const IndividualBitEnumType& in_bit) const + { + return (m_value == static_cast(in_bit) ); + } + + inline bool operator<(const Bitfield& in_bitfield) const + { + return (m_value < in_bitfield.m_value); + } + + inline bool operator<(const IndividualBitEnumType& in_bit) const + { + return (m_value < static_cast(in_bit) ); + } + + inline bool operator<=(const Bitfield& in_bitfield) const + { + return (m_value <= in_bitfield.m_value); + } + + inline bool operator<=(const IndividualBitEnumType& in_bit) const + { + return (m_value <= static_cast(in_bit) ); + } + + inline bool operator>=(const Bitfield& in_bitfield) const + { + return (m_value >= in_bitfield.m_value); + } + + inline bool operator>=(const IndividualBitEnumType& in_bit) const + { + return (m_value >= static_cast(in_bit) ); + } + + inline const VKFlagsType& get_vk() const + { + return m_value; + } + + inline const VKFlagsType* get_vk_ptr() const + { + return &m_value; + } + + private: + VKFlagsType m_value; + }; + + #define INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(BitfieldType, VKFlagsType, IndividualBitEnumType) \ + IndividualBitEnumType operator&(const IndividualBitEnumType& in_val1, const IndividualBitEnumType& in_val2); \ + BitfieldType operator&(const BitfieldType& in_val1, const BitfieldType& in_val2); \ + IndividualBitEnumType operator|(const IndividualBitEnumType& in_val1, const IndividualBitEnumType& in_val2); \ + BitfieldType operator|(const BitfieldType& in_val1, const BitfieldType& in_val2); \ + IndividualBitEnumType operator~(const IndividualBitEnumType& in_val1); \ + BitfieldType operator~(const BitfieldType& in_val1); + + #define INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(BitfieldType, VKFlagsType, IndividualBitEnumType) \ + IndividualBitEnumType Anvil::operator&(const IndividualBitEnumType& in_val1, const IndividualBitEnumType& in_val2) \ + { \ + IndividualBitEnumType result = static_cast(static_cast(in_val1) & static_cast(in_val2) ); \ + \ + return result; \ + } \ + BitfieldType Anvil::operator&(const BitfieldType& in_val1, const BitfieldType& in_val2) \ + { \ + BitfieldType result = BitfieldType(static_cast(static_cast(in_val1.get_vk() ) & static_cast(in_val2.get_vk() )) ); \ + \ + return result; \ + } \ + IndividualBitEnumType Anvil::operator|(const IndividualBitEnumType& in_val1, const IndividualBitEnumType& in_val2) \ + { \ + IndividualBitEnumType result = static_cast(static_cast(in_val1) | static_cast(in_val2) ); \ + \ + return result; \ + } \ + BitfieldType Anvil::operator|(const BitfieldType& in_val1, const BitfieldType& in_val2) \ + { \ + BitfieldType result = BitfieldType(static_cast(static_cast(in_val1.get_vk() ) | static_cast(in_val2.get_vk() )) ); \ + \ + return result; \ + } \ + IndividualBitEnumType Anvil::operator~(const IndividualBitEnumType& in_val1) \ + { \ + IndividualBitEnumType result = static_cast(~static_cast(in_val1) ); \ + \ + return result; \ + } + + /* NOTE: These map 1:1 to VK equivalents */ + enum class AccessFlagBits + { + COLOR_ATTACHMENT_READ_BIT = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT, + COLOR_ATTACHMENT_WRITE_BIT = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, + DEPTH_STENCIL_ATTACHMENT_READ_BIT = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT, + DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, + HOST_READ_BIT = VK_ACCESS_HOST_READ_BIT, + HOST_WRITE_BIT = VK_ACCESS_HOST_WRITE_BIT, + INDEX_READ_BIT = VK_ACCESS_INDEX_READ_BIT, + INDIRECT_COMMAND_READ_BIT = VK_ACCESS_INDIRECT_COMMAND_READ_BIT, + INPUT_ATTACHMENT_READ_BIT = VK_ACCESS_INPUT_ATTACHMENT_READ_BIT, + MEMORY_READ_BIT = VK_ACCESS_MEMORY_READ_BIT, + MEMORY_WRITE_BIT = VK_ACCESS_MEMORY_WRITE_BIT, + SHADER_READ_BIT = VK_ACCESS_SHADER_READ_BIT, + SHADER_WRITE_BIT = VK_ACCESS_SHADER_WRITE_BIT, + TRANSFER_READ_BIT = VK_ACCESS_TRANSFER_READ_BIT, + TRANSFER_WRITE_BIT = VK_ACCESS_TRANSFER_WRITE_BIT, + UNIFORM_READ_BIT = VK_ACCESS_UNIFORM_READ_BIT, + VERTEX_ATTRIBUTE_READ_BIT = VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT, + + NONE = 0 + }; + typedef Anvil::Bitfield AccessFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(AccessFlags, VkAccessFlags, AccessFlagBits) + + /* NOTE: These map 1:1 to VK equivalents */ + enum class AttachmentLoadOp + { + CLEAR = VK_ATTACHMENT_LOAD_OP_CLEAR, + DONT_CARE = VK_ATTACHMENT_LOAD_OP_DONT_CARE, + LOAD = VK_ATTACHMENT_LOAD_OP_LOAD, + + UNKNOWN = VK_ATTACHMENT_LOAD_OP_MAX_ENUM + }; + + /* NOTE: These map 1:1 to VK equivalents */ + enum class AttachmentStoreOp + { + DONT_CARE = VK_ATTACHMENT_STORE_OP_DONT_CARE, + STORE = VK_ATTACHMENT_STORE_OP_STORE, + + UNKNOWN = VK_ATTACHMENT_STORE_OP_MAX_ENUM + }; + /* Describes recognized subpass attachment types */ - enum AttachmentType + enum class AttachmentType { ATTACHMENT_TYPE_FIRST, - ATTACHMENT_TYPE_COLOR = ATTACHMENT_TYPE_FIRST, - ATTACHMENT_TYPE_DEPTH_STENCIL, - ATTACHMENT_TYPE_INPUT, - ATTACHMENT_TYPE_PRESERVE, - ATTACHMENT_TYPE_RESOLVE, + COLOR = ATTACHMENT_TYPE_FIRST, + DEPTH_STENCIL, + INPUT, + PRESERVE, + RESOLVE, + + COUNT, + UNKNOWN = COUNT + }; + + /* NOTE: These map 1:1 to VK equivalents */ + enum class BlendFactor + { + CONSTANT_ALPHA = VK_BLEND_FACTOR_CONSTANT_ALPHA, + CONSTANT_COLOR = VK_BLEND_FACTOR_CONSTANT_COLOR, + DST_ALPHA = VK_BLEND_FACTOR_DST_ALPHA, + DST_COLOR = VK_BLEND_FACTOR_DST_COLOR, + ONE = VK_BLEND_FACTOR_ONE, + ONE_MINUS_CONSTANT_ALPHA = VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA, + ONE_MINUS_CONSTANT_COLOR = VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR, + ONE_MINUS_DST_ALPHA = VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA, + ONE_MINUS_DST_COLOR = VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR, + ONE_MINUS_SRC_ALPHA = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, + ONE_MINUS_SRC_COLOR = VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR, + ONE_MINUS_SRC1_COLOR = VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR, + ONE_MINUS_SRC1_ALPHA = VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA, + SRC_ALPHA = VK_BLEND_FACTOR_SRC_ALPHA, + SRC_ALPHA_SATURATE = VK_BLEND_FACTOR_SRC_ALPHA_SATURATE, + SRC1_ALPHA = VK_BLEND_FACTOR_SRC1_ALPHA, + SRC1_COLOR = VK_BLEND_FACTOR_SRC1_COLOR, + SRC_COLOR = VK_BLEND_FACTOR_SRC_COLOR, + ZERO = VK_BLEND_FACTOR_ZERO, + + UNKNOWN = VK_BLEND_FACTOR_MAX_ENUM + }; + + /* NOTE: These map 1:1 to VK equivalents */ + enum class BlendOp + { + ADD = VK_BLEND_OP_ADD, + MAX = VK_BLEND_OP_MAX, + MIN = VK_BLEND_OP_MIN, + REVERSE_SUBTRACT = VK_BLEND_OP_REVERSE_SUBTRACT, + SUBTRACT = VK_BLEND_OP_SUBTRACT, + + UNKNOWN = VK_BLEND_OP_MAX_ENUM + }; - ATTACHMENT_TYPE_COUNT, - ATTACHMENT_TYPE_UNKNOWN = ATTACHMENT_TYPE_COUNT + /* NOTE: These map 1:1 to VK equivalents */ + enum class BorderColor + { + FLOAT_OPAQUE_BLACK = VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK, + FLOAT_OPAQUE_WHITE = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE, + FLOAT_TRANSPARENT_BLACK = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK, + INT_OPAQUE_BLACK = VK_BORDER_COLOR_INT_OPAQUE_BLACK, + INT_OPAQUE_WHITE = VK_BORDER_COLOR_INT_OPAQUE_WHITE, + INT_TRANSPARENT_BLACK = VK_BORDER_COLOR_INT_TRANSPARENT_BLACK, + + UNKNOWN = VK_BORDER_COLOR_MAX_ENUM }; - enum BufferCreateFlagBits + /* NOTE: These map 1:1 to VK equivalents */ + enum class BufferCreateFlagBits { - BUFFER_CREATE_FLAG_SPARSE_BINDING_BIT = 1 << 0, - BUFFER_CREATE_FLAG_SPARSE_RESIDENCY_BIT = 1 << 1, - BUFFER_CREATE_FLAG_SPARSE_ALIASED_BIT = 1 << 2, + SPARSE_BINDING_BIT = VK_BUFFER_CREATE_SPARSE_BINDING_BIT, + SPARSE_RESIDENCY_BIT = VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT, + SPARSE_ALIASED_BIT = VK_BUFFER_CREATE_SPARSE_ALIASED_BIT, + + NONE = 0 }; - typedef uint32_t BufferCreateFlags; + typedef Anvil::Bitfield BufferCreateFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(BufferCreateFlags, VkBufferCreateFlags, BufferCreateFlagBits) - typedef enum class BufferType + enum class BufferType { NONSPARSE_ALLOC, NONSPARSE_NO_ALLOC, NONSPARSE_NO_ALLOC_CHILD, SPARSE_NO_ALLOC, - } BufferType; + }; /* NOTE: These map 1:1 to Vulkan equialents */ - enum BufferUsageFlagBits + enum class BufferUsageFlagBits { /* Core VK 1.0 */ - BUFFER_USAGE_FLAG_INDEX_BUFFER_BIT = VK_BUFFER_USAGE_INDEX_BUFFER_BIT, - BUFFER_USAGE_FLAG_INDIRECT_BUFFER_BIT = VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, - BUFFER_USAGE_FLAG_STORAGE_BUFFER_BIT = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, - BUFFER_USAGE_FLAG_STORAGE_TEXEL_BUFFER_BIT = VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, - BUFFER_USAGE_FLAG_TRANSFER_DST_BIT = VK_BUFFER_USAGE_TRANSFER_DST_BIT, - BUFFER_USAGE_FLAG_TRANSFER_SRC_BIT = VK_BUFFER_USAGE_TRANSFER_SRC_BIT, - BUFFER_USAGE_FLAG_UNIFORM_BUFFER_BIT = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, - BUFFER_USAGE_FLAG_UNIFORM_TEXEL_BUFFER_BIT = VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT, - BUFFER_USAGE_FLAG_VERTEX_BUFFER_BIT = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, + INDEX_BUFFER_BIT = VK_BUFFER_USAGE_INDEX_BUFFER_BIT, + INDIRECT_BUFFER_BIT = VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, + STORAGE_BUFFER_BIT = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, + STORAGE_TEXEL_BUFFER_BIT = VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, + TRANSFER_DST_BIT = VK_BUFFER_USAGE_TRANSFER_DST_BIT, + TRANSFER_SRC_BIT = VK_BUFFER_USAGE_TRANSFER_SRC_BIT, + UNIFORM_BUFFER_BIT = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, + UNIFORM_TEXEL_BUFFER_BIT = VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT, + VERTEX_BUFFER_BIT = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, + + NONE = 0 + }; + typedef Anvil::Bitfield BufferUsageFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(BufferUsageFlags, VkBufferUsageFlags, BufferUsageFlagBits) - BUFFER_USAGE_UNKNOWN = 0 + /* NOTE: These map 1:1 to VK equivalents */ + enum class ColorComponentFlagBits + { + A_BIT = VK_COLOR_COMPONENT_A_BIT, + B_BIT = VK_COLOR_COMPONENT_B_BIT, + G_BIT = VK_COLOR_COMPONENT_G_BIT, + R_BIT = VK_COLOR_COMPONENT_R_BIT, + + NONE = 0 }; - typedef uint32_t BufferUsageFlags; + typedef Anvil::Bitfield ColorComponentFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(ColorComponentFlags, VkColorComponentFlags, ColorComponentFlagBits) /* Note: These map 1:1 to VK equivalents. */ - typedef enum class ComponentSwizzle + enum class ComponentSwizzle { A = VK_COMPONENT_SWIZZLE_A, B = VK_COMPONENT_SWIZZLE_B, @@ -83,116 +418,209 @@ namespace Anvil ONE = VK_COMPONENT_SWIZZLE_ONE, R = VK_COMPONENT_SWIZZLE_R, ZERO = VK_COMPONENT_SWIZZLE_ZERO, + }; - } ComponentSwizzle; + /* Note: These map 1:1 to VK equivalents. */ + enum class CompositeAlphaFlagBits + { + OPAQUE_BIT_KHR = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR, + PRE_MULTIPLIED_BIT_KHR = VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR, + POST_MULTIPLIED_BIT_KHR = VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR, + INHERIT_BIT_KHR = VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR, - typedef enum + NONE = 0, + }; + typedef Anvil::Bitfield CompositeAlphaFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(CompositeAlphaFlags, VkCompositeAlphaFlagsKHR, CompositeAlphaFlagBits) + + /* Note: These map 1:1 to VK equivalents. */ + enum class DependencyFlagBits { - DEPENDENCY_BY_REGION_BIT = VK_DEPENDENCY_BY_REGION_BIT, - DEPENDENCY_DEVICE_GROUP_BIT = VK_DEPENDENCY_DEVICE_GROUP_BIT_KHR, - } DependencyBits; - typedef uint32_t DependencyFlags; + /* Core VK 1.0 */ + BY_REGION_BIT = VK_DEPENDENCY_BY_REGION_BIT, - typedef enum + /* KHR_device_group */ + DEVICE_GROUP_BIT = VK_DEPENDENCY_DEVICE_GROUP_BIT_KHR, + + NONE = 0 + }; + typedef Anvil::Bitfield DependencyFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(DependencyFlags, VkDependencyFlags, DependencyFlagBits) + + enum class DeviceGroupPresentModeFlagBits { - DYNAMIC_STATE_BLEND_CONSTANTS_BIT = 1 << 0, - DYNAMIC_STATE_DEPTH_BIAS_BIT = 1 << 1, - DYNAMIC_STATE_DEPTH_BOUNDS_BIT = 1 << 2, - DYNAMIC_STATE_LINE_WIDTH_BIT = 1 << 3, - DYNAMIC_STATE_SCISSOR_BIT = 1 << 4, - DYNAMIC_STATE_STENCIL_COMPARE_MASK_BIT = 1 << 5, - DYNAMIC_STATE_STENCIL_REFERENCE_BIT = 1 << 6, - DYNAMIC_STATE_STENCIL_WRITE_MASK_BIT = 1 << 7, - DYNAMIC_STATE_VIEWPORT_BIT = 1 << 8, - } DynamicStateBits; - typedef uint32_t DynamicStateBitfield; + LOCAL_BIT_KHR = VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR, + LOCAL_MULTI_DEVICE_BIT_KHR = VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR, + REMOTE_BIT_KHR = VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR, + SUM_BIT_KHR = VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR, - typedef enum + NONE = 0 + }; + typedef Anvil::Bitfield DeviceGroupPresentModeFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(DeviceGroupPresentModeFlags, VkDeviceGroupPresentModeFlagsKHR, DeviceGroupPresentModeFlagBits) + + enum class DynamicState { - EXTERNAL_FENCE_HANDLE_TYPE_NONE = 0, + /* Core VK 1.0 */ + BLEND_CONSTANTS = VK_DYNAMIC_STATE_BLEND_CONSTANTS, + DEPTH_BIAS = VK_DYNAMIC_STATE_DEPTH_BIAS, + DEPTH_BOUNDS = VK_DYNAMIC_STATE_DEPTH_BOUNDS, + LINE_WIDTH = VK_DYNAMIC_STATE_LINE_WIDTH, + SCISSOR = VK_DYNAMIC_STATE_SCISSOR, + STENCIL_COMPARE_MASK = VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK, + STENCIL_REFERENCE = VK_DYNAMIC_STATE_STENCIL_REFERENCE, + STENCIL_WRITE_MASK = VK_DYNAMIC_STATE_STENCIL_WRITE_MASK, + VIEWPORT = VK_DYNAMIC_STATE_VIEWPORT, + }; + enum class ExternalFenceHandleTypeFlagBits + { #if defined(_WIN32) - EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT = 1 << 0, - EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 1 << 1, + OPAQUE_WIN32_BIT = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR, + OPAQUE_WIN32_KMT_BIT = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR, #else - EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT = 1 << 0, - EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT = 1 << 1, + OPAQUE_FD_BIT = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR, + SYNC_FD_BIT = VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT_KHR, #endif - /* Always last */ - EXTERNAL_FENCE_HANDLE_TYPE_COUNT - } ExternalFenceHandleTypeBit; - typedef uint32_t ExternalFenceHandleTypeBits; + NONE = 0, + }; + typedef Anvil::Bitfield ExternalFenceHandleTypeFlags; - typedef enum - { - EXTERNAL_MEMORY_HANDLE_TYPE_NONE = 0, + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(ExternalFenceHandleTypeFlags, VkExternalFenceHandleTypeFlagsKHR, ExternalFenceHandleTypeFlagBits) + enum class ExternalMemoryHandleTypeFlagBits + { #if defined(_WIN32) - EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT = 1 << 0, - EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 1 << 1, - EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT = 1 << 2, - EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT = 1 << 3, - EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT = 1 << 4, - EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT = 1 << 5, + OPAQUE_WIN32_BIT = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR, + OPAQUE_WIN32_KMT_BIT = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR, + D3D11_TEXTURE_BIT = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR, + D3D11_TEXTURE_KMT_BIT = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR, + D3D12_HEAP_BIT = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR, + D3D12_RESOURCE_BIT = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR, #else - EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT = 1 << 0, + OPAQUE_FD_BIT = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR, #endif - /* Always last */ - EXTERNAL_MEMORY_HANDLE_TYPE_COUNT - } ExternalMemoryHandleTypeBit; - typedef uint32_t ExternalMemoryHandleTypeBits; + NONE = 0, + }; + typedef Anvil::Bitfield ExternalMemoryHandleTypeFlags; - typedef enum - { - EXTERNAL_SEMAPHORE_HANDLE_TYPE_NONE = 0, + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(ExternalMemoryHandleTypeFlags, VkExternalMemoryHandleTypeFlagsKHR, ExternalMemoryHandleTypeFlagBits) + enum class ExternalSemaphoreHandleTypeFlagBits + { #if defined(_WIN32) - EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT = 1 << 0, - EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 1 << 1, - EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT = 1 << 2, + OPAQUE_WIN32_BIT = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR, + OPAQUE_WIN32_KMT_BIT = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR, + D3D12_FENCE_BIT = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT_KHR, #else - EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT = 1 << 0, - EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT = 1 << 1, + OPAQUE_FD_BIT = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR, + SYNC_FD_BIT = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR, #endif - /* Always last */ - EXTERNAL_SEMAPHORE_HANDLE_TYPE_COUNT - } ExternalSemaphoreHandleTypeBit; - typedef uint32_t ExternalSemaphoreHandleTypeBits; + NONE = 0, + }; + typedef Anvil::Bitfield ExternalSemaphoreHandleTypeFlags; - typedef enum + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(ExternalSemaphoreHandleTypeFlags, VkExternalSemaphoreHandleTypeFlagsKHR, ExternalSemaphoreHandleTypeFlagBits) + + enum class FormatFeatureFlagBits + { + /* Core VK 1.0 */ + BLIT_DST_BIT = VK_FORMAT_FEATURE_BLIT_DST_BIT, + BLIT_SRC_BIT = VK_FORMAT_FEATURE_BLIT_SRC_BIT, + COLOR_ATTACHMENT_BIT = VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT, + COLOR_ATTACHMENT_BLEND_BIT = VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT, + DEPTH_STENCIL_ATTACHMENT_BIT = VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, + SAMPLED_IMAGE_BIT = VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT, + SAMPLED_IMAGE_FILTER_LINEAR_BIT = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT, + STORAGE_IMAGE_ATOMIC_BIT = VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT, + STORAGE_IMAGE_BIT = VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT, + STORAGE_TEXEL_BUFFER_ATOMIC_BIT = VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT, + STORAGE_TEXEL_BUFFER_BIT = VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT, + UNIFORM_TEXEL_BUFFER_BIT = VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT, + VERTEX_BUFFER_BIT = VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT, + + /* KHR_maintenance1 */ + TRANSFER_DST_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR, + TRANSFER_SRC_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR, + + NONE = 0 + }; + typedef Anvil::Bitfield FormatFeatureFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(FormatFeatureFlags, VkFormatFeatureFlags, FormatFeatureFlagBits) + + enum class PeerMemoryFeatureFlagBits + { + COPY_DST_BIT = VK_PEER_MEMORY_FEATURE_COPY_DST_BIT_KHR, + COPY_SRC_BIT = VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT_KHR, + GENERIC_DST_BIT = VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT_KHR, + GENERIC_SRC_BIT = VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT_KHR, + + NONE = 0 + }; + typedef Anvil::Bitfield PeerMemoryFeatureFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(PeerMemoryFeatureFlags, VkPeerMemoryFeatureFlags, PeerMemoryFeatureFlagBits) + + /* NOTE: Maps 1:1 to VK equivalents */ + enum class CompareOp { - PEER_MEMORY_FEATURE_COPY_DST_BIT = 1 << 0, - PEER_MEMORY_FEATURE_COPY_SRC_BIT = 1 << 1, - PEER_MEMORY_FEATURE_GENERIC_DST_BIT = 1 << 2, - PEER_MEMORY_FEATURE_GENERIC_SRC_BIT = 1 << 3, - } PeerMemoryFeatureBit; - typedef uint32_t PeerMemoryFeatureFlags; + NEVER = VK_COMPARE_OP_NEVER, + LESS = VK_COMPARE_OP_LESS, + EQUAL = VK_COMPARE_OP_EQUAL, + LESS_OR_EQUAL = VK_COMPARE_OP_LESS_OR_EQUAL, + GREATER = VK_COMPARE_OP_GREATER, + NOT_EQUAL = VK_COMPARE_OP_NOT_EQUAL, + GREATER_OR_EQUAL = VK_COMPARE_OP_GREATER_OR_EQUAL, + ALWAYS = VK_COMPARE_OP_ALWAYS, + + UNKNOWN = VK_COMPARE_OP_MAX_ENUM + }; /** Describes component layout of a format */ - typedef enum + enum class ComponentLayout { /* NOTE: If the ordering used below needs to be changed, make sure to also update formats.cpp::layout_to_n_components */ - COMPONENT_LAYOUT_ABGR, - COMPONENT_LAYOUT_ARGB, - COMPONENT_LAYOUT_BGR, - COMPONENT_LAYOUT_BGRA, - COMPONENT_LAYOUT_D, - COMPONENT_LAYOUT_DS, - COMPONENT_LAYOUT_EBGR, - COMPONENT_LAYOUT_R, - COMPONENT_LAYOUT_RG, - COMPONENT_LAYOUT_RGB, - COMPONENT_LAYOUT_RGBA, - COMPONENT_LAYOUT_S, - COMPONENT_LAYOUT_XD, - - COMPONENT_LAYOUT_UNKNOWN - } ComponentLayout; + ABGR, + ARGB, + BGR, + BGRA, + D, + DS, + EBGR, + R, + RG, + RGB, + RGBA, + S, + XD, - typedef enum + UNKNOWN + }; + + /* NOTE: These map 1:1 to VK equivalents */ + enum class CullModeFlagBits + { + CULL_MODE_BACK_BIT = VK_CULL_MODE_BACK_BIT, + CULL_MODE_FRONT_BIT = VK_CULL_MODE_FRONT_BIT, + CULL_MODE_NONE = VK_CULL_MODE_NONE, + + CULL_MODE_FRONT_AND_BACK = VK_CULL_MODE_FRONT_AND_BACK, + + NONE = 0 + }; + typedef Anvil::Bitfield CullModeFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(CullModeFlags, VkCullModeFlags, CullModeFlagBits) + + /* Note: These map 1:1 to VK equivalents */ + enum class DescriptorBindingFlagBits { /* When specified for a binding, the binding can be modified after having been bound to a pipeline * in a command buffer, without invalidating that command buffer. @@ -200,7 +628,7 @@ namespace Anvil * * Requires VK_EXT_descriptor_indexing. */ - DESCRIPTOR_BINDING_FLAG_UPDATE_AFTER_BIND_BIT = 1 << 0, + UPDATE_AFTER_BIND_BIT = VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT, /* When specified for a binding, the binding can be modified after having been bound to a pipeline * in a command buffer, as long as it is NOT used by the command buffer. Doing so no longer invalidyates @@ -208,14 +636,14 @@ namespace Anvil * * Requires VK_EXT_descriptor_indexing. */ - DESCRIPTOR_BINDING_FLAG_UPDATE_UNUSED_WHILE_PENDING_BIT = 1 << 1, + UPDATE_UNUSED_WHILE_PENDING_BIT = VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT, /* When specified for a binding, the binding needs not be assigned valid descriptor(s), as long as none of * the shader invocations execute an instruction that performs any memory access using the descriptor. * * Requires VK_EXT_descriptor_indexing. */ - DESCRIPTOR_BINDING_FLAG_PARTIALLY_BOUND_BIT = 1 << 2, + PARTIALLY_BOUND_BIT = VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT, /* When specified for a binding, the binding gets a variable size which is specified each time a descriptor * set is allocated using this layout. The in_descriptor_array_size field specified at DescriptorSetCreateInfo::add_binding() @@ -225,29 +653,36 @@ namespace Anvil * * Requires VK_EXT_descriptor_indexing. */ - DESCRIPTOR_BINDING_FLAG_VARIABLE_DESCRIPTOR_COUNT_BIT = 1 << 3, + VARIABLE_DESCRIPTOR_COUNT_BIT = VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT, - } DescriptorBindingFlagBits; - typedef uint32_t DescriptorBindingFlags; + NONE = 0 + }; + typedef Anvil::Bitfield DescriptorBindingFlags; - typedef enum + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(DescriptorBindingFlags, VkDescriptorBindingFlagsEXT, DescriptorBindingFlagBits) + + /* NOTE: Maps 1:1 to VK equivalents */ + enum class DescriptorPoolCreateFlagBits { /* When set, descriptor set allocations will return back to the pool at release time.*/ - DESCRIPTOR_POOL_FLAG_CREATE_FREE_DESCRIPTOR_SET_BIT = 1 << 0, + FREE_DESCRIPTOR_SET_BIT = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, /* When set, descriptor sets allocated from this pool can be created with the DESCRIPTOR_BINDING_FLAG_UPDATE_AFTER_BIND_BIT flag. * * Requires VK_EXT_descriptor_indexing. **/ - DESCRIPTOR_POOL_FLAG_CREATE_UPDATE_AFTER_BIND_BIT = 1 << 1, + UPDATE_AFTER_BIND_BIT = VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT, + + NONE = 0 + }; + typedef Anvil::Bitfield DescriptorPoolCreateFlags; - } DescriptorPoolFlagBits; - typedef uint32_t DescriptorPoolFlags; + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(DescriptorPoolCreateFlags, VkDescriptorPoolCreateFlags, DescriptorPoolCreateFlagBits) - typedef enum + enum class DescriptorSetUpdateMethod { /* Updates dirty DS bindings using vkUpdateDescriptorSet() which is available on all Vulkan implementations. */ - DESCRIPTOR_SET_UPDATE_METHOD_CORE, + CORE, /* Updates dirty DS bindings using vkUpdateDescriptorSetWithTemplateKHR(). Templates are cached across update operations, * and are release at DescriptorSet release time. @@ -256,28 +691,58 @@ namespace Anvil * * Only available on devices supporting VK_KHR_descriptor_update_template extension. */ - DESCRIPTOR_SET_UPDATE_METHOD_TEMPLATE, - } DescriptorSetUpdateMethod; + TEMPLATE, + }; - typedef enum + enum class ExtensionAvailability + { + ENABLE_IF_AVAILABLE, + IGNORE, + REQUIRE, + }; + + /* NOTE: These map 1:1 to VK equivalents */ + enum class DescriptorType { - EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE, - EXTENSION_AVAILABILITY_IGNORE, - EXTENSION_AVAILABILITY_REQUIRE, - } ExtensionAvailability; + COMBINED_IMAGE_SAMPLER = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, + INPUT_ATTACHMENT = VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, + SAMPLED_IMAGE = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, + SAMPLER = VK_DESCRIPTOR_TYPE_SAMPLER, + STORAGE_BUFFER = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, + STORAGE_BUFFER_DYNAMIC = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, + STORAGE_IMAGE = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, + STORAGE_TEXEL_BUFFER = VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, + UNIFORM_BUFFER = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, + UNIFORM_BUFFER_DYNAMIC = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, + UNIFORM_TEXEL_BUFFER = VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, + + UNKNOWN = VK_DESCRIPTOR_TYPE_MAX_ENUM + }; /** Tells the type of an Anvil::BaseDevice instance */ - typedef enum + enum class DeviceType { /* BaseDevice is implemented by SGPUDevice class */ - DEVICE_TYPE_SINGLE_GPU, + SINGLE_GPU, /* BaseDevice is implemented by MGPUDevice class */ - DEVICE_TYPE_MULTI_GPU - } DeviceType; + MULTI_GPU, + + UNKNOWN + }; /* NOTE: These map 1:1 to VK equivalents */ - typedef enum class Format + enum class Filter + { + /* Core VK 1.0 functionality */ + LINEAR = VK_FILTER_LINEAR, + NEAREST = VK_FILTER_NEAREST, + + UNKNOWN = VK_FILTER_MAX_ENUM + }; + + /* NOTE: These map 1:1 to VK equivalents */ + enum class Format { R4G4_UNORM_PACK8 = VK_FORMAT_R4G4_UNORM_PACK8, R4G4B4A4_UNORM_PACK16 = VK_FORMAT_R4G4B4A4_UNORM_PACK16, @@ -466,57 +931,71 @@ namespace Anvil /* Other .. */ UNKNOWN = VK_FORMAT_UNDEFINED, - } Format; + }; - typedef enum + + enum class FormatType { - FORMAT_TYPE_SFLOAT, - FORMAT_TYPE_SFLOAT_UINT, - FORMAT_TYPE_SINT, - FORMAT_TYPE_SNORM, - FORMAT_TYPE_SRGB, - FORMAT_TYPE_SSCALED, - FORMAT_TYPE_UFLOAT, - FORMAT_TYPE_UINT, - FORMAT_TYPE_UNORM, - FORMAT_TYPE_UNORM_UINT, - FORMAT_TYPE_USCALED, + SFLOAT, + SFLOAT_UINT, + SINT, + SNORM, + SRGB, + SSCALED, + UFLOAT, + UINT, + UNORM, + UNORM_UINT, + USCALED, - FORMAT_TYPE_UNKNOWN, - } FormatType; + UNKNOWN, + } ; + + enum class FrontFace + { + CLOCKWISE = VK_FRONT_FACE_CLOCKWISE, + COUNTER_CLOCKWISE = VK_FRONT_FACE_COUNTER_CLOCKWISE, + + UNKNOWN = VK_FRONT_FACE_MAX_ENUM + }; /* NOTE: These map 1:1 to VK equivalents */ - enum ImageAspectFlagBits + enum class ImageAspectFlagBits { /* Core VK 1.0 aspects */ - IMAGE_ASPECT_FLAG_COLOR_BIT = VK_IMAGE_ASPECT_COLOR_BIT, - IMAGE_ASPECT_FLAG_DEPTH_BIT = VK_IMAGE_ASPECT_DEPTH_BIT, - IMAGE_ASPECT_FLAG_METADATA_BIT = VK_IMAGE_ASPECT_METADATA_BIT, - IMAGE_ASPECT_FLAG_STENCIL_BIT = VK_IMAGE_ASPECT_STENCIL_BIT, + COLOR_BIT = VK_IMAGE_ASPECT_COLOR_BIT, + DEPTH_BIT = VK_IMAGE_ASPECT_DEPTH_BIT, + METADATA_BIT = VK_IMAGE_ASPECT_METADATA_BIT, + STENCIL_BIT = VK_IMAGE_ASPECT_STENCIL_BIT, - IMAGE_ASPECT_UNKNOWN = 0 + NONE = 0 }; - typedef uint32_t ImageAspectFlags; + typedef Anvil::Bitfield ImageAspectFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(ImageAspectFlags, VkImageAspectFlags, ImageAspectFlagBits) /* NOTE: These map 1:1 to VK equivalents */ - enum ImageCreateFlagBits + enum class ImageCreateFlagBits { - IMAGE_CREATE_FLAG_MUTABLE_FORMAT_BIT = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, - IMAGE_CREATE_FLAG_CUBE_COMPATIBLE_BIT = VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, + MUTABLE_FORMAT_BIT = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, + CUBE_COMPATIBLE_BIT = VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, /* NOTE: Requires VK_KHR_bind_memory2 */ - IMAGE_CREATE_FLAG_SPLIT_INSTANCE_BIND_REGIONS_BIT = VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR, - IMAGE_CREATE_FLAG_ALIAS_BIT = VK_IMAGE_CREATE_ALIAS_BIT_KHR, + SPLIT_INSTANCE_BIND_REGIONS_BIT = VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR, + ALIAS_BIT = VK_IMAGE_CREATE_ALIAS_BIT_KHR, /* NOTE: Requires VK_KHR_maintenance1 */ - IMAGE_CREATE_FLAG_2D_ARRAY_COMPATIBLE_BIT = VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR, + _2D_ARRAY_COMPATIBLE_BIT = VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR, /* NOTE: Requires VK_KHR_maintenance2 */ - IMAGE_CREATE_FLAG_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT = VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR, - IMAGE_CREATE_FLAG_EXTENDED_USAGE_BIT = VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR, + BLOCK_TEXEL_VIEW_COMPATIBLE_BIT = VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR, + EXTENDED_USAGE_BIT = VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR, + + NONE = 0 }; + typedef Anvil::Bitfield ImageCreateFlags; - typedef uint32_t ImageCreateFlags; + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(ImageCreateFlags, VkImageCreateFlags, ImageCreateFlagBits) /* NOTE: These map 1:1 to VK equivalents */ enum class ImageLayout @@ -539,60 +1018,99 @@ namespace Anvil /* Requires VK_KHR_swapchain */ PRESENT_SRC_KHR = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, - UNKNOWN, + UNKNOWN = VK_IMAGE_LAYOUT_MAX_ENUM, }; /* NOTE: These map 1:1 to VK equivalents */ - enum ImageUsageFlagBits + enum class ImageUsageFlagBits { /* Core VK 1.0 usages */ - IMAGE_USAGE_FLAG_TRANSFER_DST_BIT = VK_IMAGE_USAGE_TRANSFER_DST_BIT, - IMAGE_USAGE_FLAG_TRANSFER_SRC_BIT = VK_IMAGE_USAGE_TRANSFER_SRC_BIT, - IMAGE_USAGE_FLAG_SAMPLED_BIT = VK_IMAGE_USAGE_SAMPLED_BIT, - IMAGE_USAGE_FLAG_STORAGE_BIT = VK_IMAGE_USAGE_STORAGE_BIT, - IMAGE_USAGE_FLAG_COLOR_ATTACHMENT_BIT = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, - IMAGE_USAGE_FLAG_DEPTH_STENCIL_ATTACHMENT_BIT = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, - IMAGE_USAGE_FLAG_TRANSIENT_ATTACHMENT_BIT = VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, - IMAGE_USAGE_FLAG_INPUT_ATTACHMENT_BIT = VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT, + TRANSFER_DST_BIT = VK_IMAGE_USAGE_TRANSFER_DST_BIT, + TRANSFER_SRC_BIT = VK_IMAGE_USAGE_TRANSFER_SRC_BIT, + SAMPLED_BIT = VK_IMAGE_USAGE_SAMPLED_BIT, + STORAGE_BIT = VK_IMAGE_USAGE_STORAGE_BIT, + COLOR_ATTACHMENT_BIT = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, + DEPTH_STENCIL_ATTACHMENT_BIT = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, + TRANSIENT_ATTACHMENT_BIT = VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, + INPUT_ATTACHMENT_BIT = VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT, + + NONE = 0 + }; + typedef Anvil::Bitfield ImageUsageFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(ImageUsageFlags, VkImageUsageFlags, ImageUsageFlagBits) - IMAGE_USAGE_UNKNOWN = 0 + /* NOTE: These map 1:1 to VK equivalents */ + enum class ImageViewType + { + _1D = VK_IMAGE_VIEW_TYPE_1D, + _1D_ARRAY = VK_IMAGE_VIEW_TYPE_1D_ARRAY, + _2D = VK_IMAGE_VIEW_TYPE_2D, + _2D_ARRAY = VK_IMAGE_VIEW_TYPE_2D_ARRAY, + _3D = VK_IMAGE_VIEW_TYPE_3D, + _CUBE = VK_IMAGE_VIEW_TYPE_CUBE, + _CUBE_ARRAY = VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, + + UNKNOWN = VK_IMAGE_VIEW_TYPE_MAX_ENUM }; - typedef uint32_t ImageUsageFlags; - typedef enum class ImageInternalType + enum class ImageInternalType { NONSPARSE_ALLOC, NONSPARSE_NO_ALLOC, NONSPARSE_PEER_NO_ALLOC, SPARSE_NO_ALLOC, SWAPCHAIN_WRAPPER - } ImageInternalType; + }; /* NOTE: These correspond 1:1 to VK equivalents */ - typedef enum class ImageTiling + enum class ImageTiling { LINEAR = VK_IMAGE_TILING_LINEAR, OPTIMAL = VK_IMAGE_TILING_OPTIMAL, - UNKNOWN - } ImageTiling; + UNKNOWN = VK_IMAGE_TILING_MAX_ENUM + }; /* NOTE: These correspond 1:1 to VK equivalents */ - typedef enum class ImageType + enum class ImageType { _1D = VK_IMAGE_TYPE_1D, _2D = VK_IMAGE_TYPE_2D, _3D = VK_IMAGE_TYPE_3D, - UNKNOWN - } ImageType; + UNKNOWN = VK_IMAGE_TYPE_MAX_ENUM + }; + /* NOTE: These map 1:1 to VK equivalents */ enum class IndexType { - UINT16, - UINT32, + UINT16 = VK_INDEX_TYPE_UINT16, + UINT32 = VK_INDEX_TYPE_UINT32, - UNKNOWN + UNKNOWN = VK_INDEX_TYPE_MAX_ENUM + }; + + enum class LogicOp + { + AND = VK_LOGIC_OP_AND, + AND_INVERTED = VK_LOGIC_OP_AND_INVERTED, + AND_REVERSE = VK_LOGIC_OP_AND_REVERSE, + CLEAR = VK_LOGIC_OP_CLEAR, + COPY = VK_LOGIC_OP_COPY, + COPY_INVERTED = VK_LOGIC_OP_COPY_INVERTED, + EQUIVALENT = VK_LOGIC_OP_EQUIVALENT, + INVERT = VK_LOGIC_OP_INVERT, + NAND = VK_LOGIC_OP_NAND, + NO_OP = VK_LOGIC_OP_NO_OP, + NOR = VK_LOGIC_OP_NOR, + OR = VK_LOGIC_OP_OR, + OR_INVERTED = VK_LOGIC_OP_OR_INVERTED, + OR_REVERSE = VK_LOGIC_OP_OR_REVERSE, + SET = VK_LOGIC_OP_SET, + XOR = VK_LOGIC_OP_XOR, + + UNKNOWN = VK_LOGIC_OP_MAX_ENUM }; enum class MemoryBlockType @@ -602,27 +1120,63 @@ namespace Anvil REGULAR }; - enum MemoryFeatureFlagBits + enum class MemoryFeatureFlagBits { /* NOTE: If more memory feature flags are added here, make sure to also update Anvil::Utils::get_vk_property_flags_from_memory_feature_flags() * and Anvil::Utils::get_memory_feature_flags_from_vk_property_flags() */ - MEMORY_FEATURE_FLAG_DEVICE_LOCAL = 1 << 0, - MEMORY_FEATURE_FLAG_HOST_CACHED = 1 << 1, - MEMORY_FEATURE_FLAG_HOST_COHERENT = 1 << 2, - MEMORY_FEATURE_FLAG_LAZILY_ALLOCATED = 1 << 3, - MEMORY_FEATURE_FLAG_MAPPABLE = 1 << 4, - MEMORY_FEATURE_FLAG_MULTI_INSTANCE = 1 << 5, + DEVICE_LOCAL_BIT = 1 << 0, + HOST_CACHED_BIT = 1 << 1, + HOST_COHERENT_BIT = 1 << 2, + LAZILY_ALLOCATED_BIT = 1 << 3, + MAPPABLE_BIT = 1 << 4, + MULTI_INSTANCE_BIT = 1 << 5, + + NONE = 0 }; - typedef uint32_t MemoryFeatureFlags; + typedef Anvil::Bitfield MemoryFeatureFlags; - typedef enum + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(MemoryFeatureFlags, uint32_t, MemoryFeatureFlagBits) + + /* NOTE: These map 1:1 to VK equivalents */ + enum class MemoryHeapFlagBits + { + /* Core VK 1.0 */ + DEVICE_LOCAL_BIT = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT, + + /* VK_KHR_device_group */ + MULTI_INSTANCE_BIT_KHR = VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR, + + + NONE = 0 + }; + typedef Anvil::Bitfield MemoryHeapFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(MemoryHeapFlags, VkMemoryHeapFlags, MemoryHeapFlagBits) + + /* NOTE: These map 1:1 to VK equivalents */ + enum class MemoryPropertyFlagBits + { + /* Core VK 1.0 */ + DEVICE_LOCAL_BIT = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, + HOST_CACHED_BIT = VK_MEMORY_PROPERTY_HOST_CACHED_BIT, + HOST_COHERENT_BIT = VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, + HOST_VISIBLE_BIT = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, + LAZILY_ALLOCATED_BIT = VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT, + + NONE = 0 + }; + typedef Anvil::Bitfield MemoryPropertyFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(MemoryPropertyFlags, VkMemoryPropertyFlags, MemoryPropertyFlagBits) + + enum class MTSafety { - MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, - MT_SAFETY_ENABLED, - MT_SAFETY_DISABLED - } MTSafety; + INHERIT_FROM_PARENT_DEVICE, + ENABLED, + DISABLED + }; typedef enum { @@ -676,38 +1230,120 @@ namespace Anvil * * Only used for second-level command buffer recording policy declaration. **/ - typedef enum + enum class OcclusionQuerySupportScope { /** Occlusion queries are not going to be used */ - OCCLUSION_QUERY_SUPPORT_SCOPE_NOT_REQUIRED, + NOT_REQUIRED, /** Non-precise occlusion queries may be used */ - OCCLUSION_QUERY_SUPPORT_SCOPE_REQUIRED_NONPRECISE, + REQUIRED_NONPRECISE, /** Pprecise occlusion queries may be used */ - OCCLUSION_QUERY_SUPPORT_SCOPE_REQUIRED_PRECISE, - } OcclusionQuerySupportScope; + REQUIRED_PRECISE, + }; /* NOTE: These map 1:1 to VK equivalents */ - typedef enum class PointClippingBehavior + enum class PipelineBindPoint + { + /* Core VK 1.0 */ + COMPUTE = VK_PIPELINE_BIND_POINT_COMPUTE, + GRAPHICS = VK_PIPELINE_BIND_POINT_GRAPHICS, + + UNKNOWN = VK_PIPELINE_BIND_POINT_MAX_ENUM + }; + + /* NOTE: These map 1:1 to VK equivalents */ + enum class PipelineStageFlagBits + { + /* Core VK 1.0 */ + ALL_COMMANDS_BIT = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, + ALL_GRAPHICS_BIT = VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, + BOTTOM_OF_PIPE_BIT = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, + COLOR_ATTACHMENT_OUTPUT_BIT = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, + COMPUTE_SHADER_BIT = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, + DRAW_INDIRECT_BIT = VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT, + EARLY_FRAGMENT_TESTS_BIT = VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT, + FRAGMENT_SHADER_BIT = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, + GEOMETRY_SHADER_BIT = VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT, + HOST_BIT = VK_PIPELINE_STAGE_HOST_BIT, + LATE_FRAGMENT_TESTS_BIT = VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, + TESSELLATION_CONTROL_SHADER_BIT = VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT, + TESSELLATION_EVALUATION_SHADER_BIT = VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT, + TOP_OF_PIPE_BIT = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, + TRANSFER_BIT = VK_PIPELINE_STAGE_TRANSFER_BIT, + VERTEX_INPUT_BIT = VK_PIPELINE_STAGE_VERTEX_INPUT_BIT, + VERTEX_SHADER_BIT = VK_PIPELINE_STAGE_VERTEX_SHADER_BIT, + + NONE = 0 + }; + typedef Anvil::Bitfield PipelineStageFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(PipelineStageFlags, VkPipelineStageFlags, PipelineStageFlagBits) + + /* NOTE: These map 1:1 to VK equivalents */ + enum class PointClippingBehavior { ALL_CLIP_PLANES = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES_KHR, USER_CLIP_PLANES_ONLY = VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY_KHR, UNKNOWN = VK_POINT_CLIPPING_BEHAVIOR_MAX_ENUM - } PointClippingBehavior; + }; + + /* NOTE: These map 1:1 to VK equivalents */ + enum class PolygonMode + { + FILL = VK_POLYGON_MODE_FILL, + LINE = VK_POLYGON_MODE_LINE, + POINT = VK_POLYGON_MODE_POINT, + + UNKNOWN = VK_POLYGON_MODE_MAX_ENUM + }; + + /* NOTE: These map 1:1 to VK equivalents */ + enum class PresentModeKHR + { + /* VK_KHR_surface */ + IMMEDIATE_KHR = VK_PRESENT_MODE_IMMEDIATE_KHR, + MAILBOX_KHR = VK_PRESENT_MODE_MAILBOX_KHR, + FIFO_KHR = VK_PRESENT_MODE_FIFO_KHR, + FIFO_RELAXED_KHR = VK_PRESENT_MODE_FIFO_RELAXED_KHR, + + UNKNOWN = VK_PRESENT_MODE_MAX_ENUM_KHR + }; + + /* NOTE: These map 1:1 to VK equivalents */ + enum class PrimitiveTopology + { + LINE_LIST = VK_PRIMITIVE_TOPOLOGY_LINE_LIST, + LINE_LIST_WITH_ADJACENCY = VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY, + LINE_STRIP = VK_PRIMITIVE_TOPOLOGY_LINE_STRIP, + LINE_STRIP_WITH_ADJACENCY = VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY, + PATCH_LIST = VK_PRIMITIVE_TOPOLOGY_PATCH_LIST, + POINT_LIST = VK_PRIMITIVE_TOPOLOGY_POINT_LIST, + TRIANGLE_FAN = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN, + TRIANGLE_LIST = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, + TRIANGLE_LIST_WITH_ADJACENCY = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY, + TRIANGLE_STRIP = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP, + TRIANGLE_STRIP_WITH_ADJACENCY = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY, + + UNKNOWN = VK_PRIMITIVE_TOPOLOGY_MAX_ENUM + }; /** A bitmask defining one or more queue family usage.*/ - typedef enum + enum class QueueFamilyFlagBits { - QUEUE_FAMILY_COMPUTE_BIT = 1 << 0, - QUEUE_FAMILY_DMA_BIT = 1 << 1, - QUEUE_FAMILY_GRAPHICS_BIT = 1 << 2, + COMPUTE_BIT = 1 << 0, + DMA_BIT = 1 << 1, + GRAPHICS_BIT = 1 << 2, - QUEUE_FAMILY_FIRST_BIT = QUEUE_FAMILY_COMPUTE_BIT, - QUEUE_FAMILY_LAST_BIT = QUEUE_FAMILY_GRAPHICS_BIT - } QueueFamily; - typedef int QueueFamilyBits; + FIRST_BIT = COMPUTE_BIT, + LAST_BIT = GRAPHICS_BIT, + + NONE = 0 + }; + typedef Anvil::Bitfield QueueFamilyFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(QueueFamilyFlags, uint32_t, QueueFamilyFlagBits) /** Enumerates all available queue family types */ enum class QueueFamilyType @@ -729,124 +1365,304 @@ namespace Anvil UNDEFINED = COUNT }; - typedef enum + /* NOTE: These map 1:1 to VK equivalents */ + enum class QueueFlagBits + { + /* Core VK 1.0 */ + COMPUTE_BIT = VK_QUEUE_COMPUTE_BIT, + GRAPHICS_BIT = VK_QUEUE_GRAPHICS_BIT, + SPARSE_BINDING_BIT = VK_QUEUE_SPARSE_BINDING_BIT, + TRANSFER_BIT = VK_QUEUE_TRANSFER_BIT, + + NONE = 0 + }; + typedef Anvil::Bitfield QueueFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(QueueFlags, VkQueueFlags, QueueFlagBits) + + /* NOTE: These map 1:1 to VK equivalents */ + enum class QueryControlFlagBits { + PRECISE_BIT = VK_QUERY_CONTROL_PRECISE_BIT, + + NONE = 0 + }; + typedef Anvil::Bitfield QueryControlFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(QueryControlFlags, VkQueryControlFlags, QueryControlFlagBits) + + /* NOTE: These map 1:1 to VK equivalents */ + enum class QueryPipelineStatisticFlagBits + { + CLIPPING_INVOCATIONS_BIT = VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT, + CLIPPING_PRIMITIVES_BIT = VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT, + COMPUTE_SHADER_INVOCATIONS_BIT = VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT, + FRAGMENT_SHADER_INVOCATIONS_BIT = VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT, + GEOMETRY_SHADER_INVOCATIONS_BIT = VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT, + GEOMETRY_SHADER_PRIMITIVES_BIT = VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT, + INPUT_ASSEMBLY_VERTICES_BIT = VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT, + INPUT_ASSEMBLY_PRIMITIVES_BIT = VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT, + TESSELLATION_CONTROL_SHADER_PATCHES_BIT = VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT, + TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT, + VERTEX_SHADER_INVOCATIONS_BIT = VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT, + + NONE = 0, + }; + typedef Anvil::Bitfield QueryPipelineStatisticFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(QueryPipelineStatisticFlags, VkQueryPipelineStatisticFlags, QueryPipelineStatisticFlagBits) + + enum class QueryResultFlagBits + { + _64_BIT = VK_QUERY_RESULT_64_BIT, + /* Implementation should wait for each query's status to become available before retrieving its results * * Core VK 1.0 functionality */ - QUERY_RESULT_WAIT_BIT = 1 << 0, + WAIT_BIT = VK_QUERY_RESULT_WAIT_BIT, /* Each query result value is going to be followed by a status value. Non-zero values indicate result is * available. * * Core VK 1.0 functionality */ - QUERY_RESULT_WITH_AVAILABILITY_BIT = 1 << 1, + WITH_AVAILABILITY_BIT = VK_QUERY_RESULT_WITH_AVAILABILITY_BIT, /* Indicates it is OK for the function to return result values for a sub-range of the requested query range. * * Core VK 1.0 frunctionality */ - QUERY_RESULT_PARTIAL_BIT = 1 << 2, + PARTIAL_BIT = VK_QUERY_RESULT_PARTIAL_BIT, - } QueryResultBit; - typedef uint32_t QueryResultBits; + NONE = 0 + }; + typedef Anvil::Bitfield QueryResultFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(QueryResultFlags, VkQueryResultFlags, QueryResultFlagBits) + + enum class RasterizationOrderAMD + { + RELAXED = VK_RASTERIZATION_ORDER_RELAXED_AMD, + STRICT = VK_RASTERIZATION_ORDER_STRICT_AMD, + + UNKNOWN = VK_RASTERIZATION_ORDER_MAX_ENUM_AMD + }; /* NOTE: These map 1:1 to VK equivalents */ - enum SampleCountFlagBits + enum class SampleCountFlagBits { - SAMPLE_COUNT_FLAG_1_BIT = VK_SAMPLE_COUNT_1_BIT, - SAMPLE_COUNT_FLAG_2_BIT = VK_SAMPLE_COUNT_2_BIT, - SAMPLE_COUNT_FLAG_4_BIT = VK_SAMPLE_COUNT_4_BIT, - SAMPLE_COUNT_FLAG_8_BIT = VK_SAMPLE_COUNT_8_BIT, - SAMPLE_COUNT_FLAG_16_BIT = VK_SAMPLE_COUNT_16_BIT, - SAMPLE_COUNT_FLAG_32_BIT = VK_SAMPLE_COUNT_32_BIT, - SAMPLE_COUNT_FLAG_64_BIT = VK_SAMPLE_COUNT_64_BIT, + _1_BIT = VK_SAMPLE_COUNT_1_BIT, + _2_BIT = VK_SAMPLE_COUNT_2_BIT, + _4_BIT = VK_SAMPLE_COUNT_4_BIT, + _8_BIT = VK_SAMPLE_COUNT_8_BIT, + _16_BIT = VK_SAMPLE_COUNT_16_BIT, + _32_BIT = VK_SAMPLE_COUNT_32_BIT, + _64_BIT = VK_SAMPLE_COUNT_64_BIT, + + NONE = 0 + }; + typedef Anvil::Bitfield SampleCountFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(SampleCountFlags, VkSampleCountFlags, SampleCountFlagBits) - SAMPLE_COUNT_UNKNOWN = 0 + /* NOTE: These map 1:1 to VK equivalents */ + enum class SamplerAddressMode + { + CLAMP_TO_BORDER = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, + CLAMP_TO_EDGE = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE, + MIRROR_CLAMP_TO_EDGE = VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE, + MIRRORED_REPEAT = VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT, + REPEAT = VK_SAMPLER_ADDRESS_MODE_REPEAT, + + UNKNOWN = VK_SAMPLER_ADDRESS_MODE_MAX_ENUM + }; + + /* NOTE: These map 1:1 to VK equivalents */ + enum class SamplerMipmapMode + { + LINEAR = VK_SAMPLER_MIPMAP_MODE_LINEAR, + NEAREST = VK_SAMPLER_MIPMAP_MODE_NEAREST, + + UNKNOWN = VK_SAMPLER_MIPMAP_MODE_MAX_ENUM }; - typedef uint32_t SampleCountFlags; /* Specifies one of the compute / rendering pipeline stages. */ - typedef enum + enum class ShaderStage + { + FIRST, + + COMPUTE = FIRST, + FRAGMENT, + GEOMETRY, + TESSELLATION_CONTROL, + TESSELLATION_EVALUATION, + VERTEX, + + COUNT, + UNKNOWN = COUNT + }; + + /* NOTE: Maps 1:1 to VK equivalents */ + enum class ShaderStageFlagBits { - SHADER_STAGE_FIRST, + COMPUTE_BIT = VK_SHADER_STAGE_COMPUTE_BIT, + FRAGMENT_BIT = VK_SHADER_STAGE_FRAGMENT_BIT, + GEOMETRY_BIT = VK_SHADER_STAGE_GEOMETRY_BIT, + TESSELLATION_CONTROL_BIT = VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT, + TESSELLATION_EVALUATION_BIT = VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, + VERTEX_BIT = VK_SHADER_STAGE_VERTEX_BIT, + + ALL = VK_SHADER_STAGE_ALL, + ALL_GRAPHICS = VK_SHADER_STAGE_ALL_GRAPHICS, - SHADER_STAGE_COMPUTE = SHADER_STAGE_FIRST, - SHADER_STAGE_FRAGMENT, - SHADER_STAGE_GEOMETRY, - SHADER_STAGE_TESSELLATION_CONTROL, - SHADER_STAGE_TESSELLATION_EVALUATION, - SHADER_STAGE_VERTEX, + NONE = 0 + }; + typedef Anvil::Bitfield ShaderStageFlags; - SHADER_STAGE_COUNT, - SHADER_STAGE_UNKNOWN = SHADER_STAGE_COUNT - } ShaderStage; + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(ShaderStageFlags, VkShaderStageFlags, ShaderStageFlagBits) /* Specifies the type of query for post-compile information about pipeline shaders */ - typedef enum + enum class ShaderInfoType { - SHADER_INFO_FIRST, + FIRST, + + BINARY = FIRST, + DISASSEMBLY, - SHADER_INFO_TYPE_BINARY = SHADER_INFO_FIRST, - SHADER_INFO_TYPE_DISASSEMBLY, - SHADER_INFO_COUNT, - SHADER_INFO_UNKNOWN = SHADER_INFO_COUNT - } ShaderInfoType; + COUNT, + UNKNOWN = COUNT + }; /* NOTE: These map 1:1 to VK equivalents */ - typedef enum class SharingMode + enum class SharingMode { CONCURRENT = VK_SHARING_MODE_CONCURRENT, EXCLUSIVE = VK_SHARING_MODE_EXCLUSIVE, UNKNOWN - } SharingMode; + }; - typedef enum + /* NOTE: These map 1:1 to VK equivalents */ + enum class SparseImageFormatFlagBits + { + /* Core VK 1.0 */ + ALIGNED_MIP_SIZE_BIT = VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT, + NONNSTANDARD_BLOCK_SIZE_BIT = VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT, + SINGLE_MIPTAIL_BIT = VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT, + + NONE = 0 + }; + typedef Anvil::Bitfield SparseImageFormatFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(SparseImageFormatFlags, VkSparseImageFormatFlags, SparseImageFormatFlagBits) + + enum class SparseMemoryBindFlagBits + { + /* Core VK 1.0 */ + BIND_METADATA_BIT = VK_SPARSE_MEMORY_BIND_METADATA_BIT, + + NONE = 0 + }; + typedef Anvil::Bitfield SparseMemoryBindFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(SparseMemoryBindFlags, VkSparseMemoryBindFlags, SparseMemoryBindFlagBits) + + enum class SparseResidencyScope { /* Support sparse binding only */ - SPARSE_RESIDENCY_SCOPE_NONE, + NONE, /* Support sparse residency, do not support sparse aliased residency */ - SPARSE_RESIDENCY_SCOPE_NONALIASED, + NONALIASED, /* Support sparse aliased residency */ - SPARSE_RESIDENCY_SCOPE_ALIASED, + ALIASED, - SPARSE_RESIDENCY_SCOPE_UNDEFINED - } SparseResidencyScope; + UNKNOWN + }; + + /* NOTE: These map 1:1 to VK equivalents */ + enum class StencilFaceFlagBits + { + BACK_BIT = VK_STENCIL_FACE_BACK_BIT, + FRONT_BIT = VK_STENCIL_FACE_FRONT_BIT, + + NONE = 0 + }; + typedef Anvil::Bitfield StencilFaceFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(StencilFaceFlags, VkStencilFaceFlags, StencilFaceFlagBits) + + enum class StencilOp + { + DECREMENT_AND_CLAMP = VK_STENCIL_OP_DECREMENT_AND_CLAMP, + DECREMENT_AND_WRAP = VK_STENCIL_OP_DECREMENT_AND_WRAP, + INCREMENT_AND_CLAMP = VK_STENCIL_OP_INCREMENT_AND_CLAMP, + INCREMENT_AND_WRAP = VK_STENCIL_OP_INCREMENT_AND_WRAP, + INVERT = VK_STENCIL_OP_INVERT, + KEEP = VK_STENCIL_OP_KEEP, + REPLACE = VK_STENCIL_OP_REPLACE, + ZERO = VK_STENCIL_OP_ZERO, + + UNKNOWN = VK_STENCIL_OP_MAX_ENUM + }; + + /* NOTE: These map 1:1 to VK equivalents */ + enum class SubpassContents + { + INLINE = VK_SUBPASS_CONTENTS_INLINE, + SECONDARY_COMMAND_BUFFERS = VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS, + + UNKNOWN = VK_SUBPASS_CONTENTS_MAX_ENUM + }; + + enum class SurfaceTransformFlagBits + { + HORIZONTAL_MIRROR_BIT_KHR = VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR, + HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR, + HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR, + HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR, + IDENTITY_BIT_KHR = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR, + INHERIT_BIT_KHR = VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR, + ROTATE_180_BIT_KHR = VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR, + ROTATE_270_BIT_KHR = VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR, + ROTATE_90_BIT_KHR = VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR, + + NONE = 0 + }; + typedef Anvil::Bitfield SurfaceTransformFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(SurfaceTransformFlags, VkSurfaceTransformFlagsKHR, SurfaceTransformFlagBits) + + /* NOTE: Enums map 1:1 to their VK equivalents */ + enum class SwapchainCreateFlagBits + { + /* Requires VK_KHR_device_group */ + SPLIT_INSTANCE_BIND_REGIONS_BIT = VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR, + + NONE = 0 + }; + typedef Anvil::Bitfield SwapchainCreateFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(SwapchainCreateFlags, VkSwapchainCreateFlagsKHR, SwapchainCreateFlagBits) /* NOTE: Enums map 1:1 to their VK equivalents */ - typedef enum class TessellationDomainOrigin + enum class TessellationDomainOrigin { LOWER_LEFT = VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT_KHR, UPPER_LEFT = VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT_KHR, UNKNOWN = VK_TESSELLATION_DOMAIN_ORIGIN_MAX_ENUM - } TessellationDomainOrigin; + }; - /** Defines supported timestamp capture modes. */ - typedef enum + enum class VertexInputRate { - /* No timestamps should be captured */ - TIMESTAMP_CAPTURE_MODE_DISABLED, + INSTANCE = VK_VERTEX_INPUT_RATE_INSTANCE, + VERTEX = VK_VERTEX_INPUT_RATE_VERTEX, - /* Two timestamps should be captured: - * - * 1. top-of-pipe timestamp, preceding actual commands. - * 2. tof-of-pipe timestamp, after all commands are recorded. - */ - TIMESTAMP_CAPTURE_MODE_ENABLED_COMMAND_SUBMISSION_TIME, - - /* Two timestamps should be captured: - * - * 1. top-of-pipe timestamp, preceding actual commands. - * 2. bottom-of-pipe timestamp, after all commands are recorded. - */ - TIMESTAMP_CAPTURE_MODE_ENABLED_COMMAND_EXECUTION_TIME - } TimestampCaptureMode; + UNKNOWN = VK_VERTEX_INPUT_RATE_MAX_ENUM + }; }; /* namespace Anvil */ #endif /* TYPES_ENUMS_H */ \ No newline at end of file diff --git a/include/misc/types_macro.h b/include/misc/types_macro.h index 2c445a12..c195d1b3 100644 --- a/include/misc/types_macro.h +++ b/include/misc/types_macro.h @@ -22,330 +22,6 @@ #ifndef TYPES_MACRO_H #define TYPES_MACRO_H -/* Wrappers for some of the Vulkan enums we use across Anvil */ -#ifdef ANVIL_LITTLE_ENDIAN - - #define VkAccessFlagsVariable(name) \ - union \ - { \ - VkAccessFlags name; \ - \ - struct \ - { \ - uint8_t VK_ACCESS_INDIRECT_COMMAND_READ_BIT : 1; \ - uint8_t VK_ACCESS_INDEX_READ_BIT : 1; \ - uint8_t VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT : 1; \ - uint8_t VK_ACCESS_UNIFORM_READ_BIT : 1; \ - uint8_t VK_ACCESS_INPUT_ATTACHMENT_READ_BIT : 1; \ - uint8_t VK_ACCESS_SHADER_READ_BIT : 1; \ - uint8_t VK_ACCESS_SHADER_WRITE_BIT : 1; \ - uint8_t VK_ACCESS_COLOR_ATTACHMENT_READ_BIT : 1; \ - uint8_t VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT : 1; \ - uint8_t VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT : 1; \ - uint8_t VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT : 1; \ - uint8_t VK_ACCESS_TRANSFER_READ_BIT : 1; \ - uint8_t VK_ACCESS_TRANSFER_WRITE_BIT : 1; \ - uint8_t VK_ACCESS_HOST_READ_BIT : 1; \ - uint8_t VK_ACCESS_HOST_WRITE_BIT : 1; \ - uint8_t VK_ACCESS_MEMORY_READ_BIT : 1; \ - uint8_t VK_ACCESS_MEMORY_WRITE_BIT : 1; \ - } name##_flags; \ - }; - - #define VkBufferCreateFlagsVariable(name) \ - union \ - { \ - VkBufferCreateFlags name; \ - \ - struct \ - { \ - uint8_t VK_BUFFER_CREATE_SPARSE_BINDING_BIT : 1; \ - uint8_t VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT : 1; \ - uint8_t VK_BUFFER_CREATE_SPARSE_ALIASED_BIT : 1; \ - } name##_flags; \ - }; - - #define VkColorComponentFlagsVariable(name) \ - union \ - { \ - VkColorComponentFlags name; \ - \ - struct \ - { \ - uint8_t VK_COLOR_COMPONENT_R_BIT : 1; \ - uint8_t VK_COLOR_COMPONENT_G_BIT : 1; \ - uint8_t VK_COLOR_COMPONENT_B_BIT : 1; \ - uint8_t VK_COLOR_COMPONENT_A_BIT : 1; \ - } name##_flags; \ - }; - - #define VkCompositeAlphaFlagsKHRVariable(name) \ - union \ - { \ - VkCompositeAlphaFlagsKHR name; \ - \ - struct \ - { \ - uint8_t VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR : 1; \ - uint8_t VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR : 1; \ - uint8_t VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR : 1; \ - uint8_t VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR : 1; \ - } name##_flags; \ - }; - - #define VkCullModeFlagsVariable(name) \ - union \ - { \ - VkCullModeFlags name; \ - \ - struct \ - { \ - uint8_t VK_CULL_MODE_FRONT_BIT : 1; \ - uint8_t VK_CULL_MODE_BACK_BIT : 1; \ - } name##_flags; \ - }; - - #define VkDependencyFlagsVariable(name) \ - union \ - { \ - VkDependencyFlags name; \ - \ - struct \ - { \ - uint8_t VK_DEPENDENCY_BY_REGION_BIT : 1; \ - uint8_t VK_DEPENDENCY_VIEW_LOCAL_BIT_KHR : 1; \ - uint8_t VK_DEPENDENCY_DEVICE_GROUP_BIT_KHR : 1; \ - } name##_flags; \ - }; - - #define VkDeviceGroupPresentModeFlagBitsKHRVariable(name) \ - union \ - { \ - VkDeviceGroupPresentModeFlagBitsKHR name; \ - \ - struct \ - { \ - uint8_t VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR : 1; \ - uint8_t VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR : 1; \ - uint8_t VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR : 1; \ - uint8_t VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR : 1; \ - } name##_flags; \ - }; - - #define VkFormatFeatureFlagsVariable(name) \ - union \ - { \ - VkFormatFeatureFlags name; \ - \ - struct \ - { \ - uint8_t VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_BLIT_SRC_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_BLIT_DST_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT : 1; \ - uint8_t VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG : 1; \ - uint8_t VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR : 1; \ - uint8_t VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR : 1; \ - } name##_flags; \ - }; - - #define VkMemoryHeapFlagsVariable(name) \ - union \ - { \ - VkMemoryHeapFlags name; \ - \ - struct \ - { \ - uint8_t VK_MEMORY_HEAP_DEVICE_LOCAL_BIT : 1; \ - uint8_t VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR : 1; \ - } name##_flags; \ - }; - - #define VkMemoryPropertyFlagsVariable(name) \ - union \ - { \ - VkMemoryPropertyFlags name; \ - \ - struct \ - { \ - uint8_t VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT : 1; \ - uint8_t VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT : 1; \ - uint8_t VK_MEMORY_PROPERTY_HOST_COHERENT_BIT : 1; \ - uint8_t VK_MEMORY_PROPERTY_HOST_CACHED_BIT : 1; \ - uint8_t VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT : 1; \ - } name##_flags; \ - }; - - #define VkPipelineStageFlagsVariable(name) \ - union \ - { \ - VkPipelineStageFlags name; \ - \ - struct \ - { \ - uint8_t VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_VERTEX_INPUT_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_VERTEX_SHADER_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_TRANSFER_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_HOST_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT : 1; \ - uint8_t VK_PIPELINE_STAGE_ALL_COMMANDS_BIT : 1; \ - } name##_flags; \ - }; - - #define VkQueryControlFlagsVariable(name) \ - union \ - { \ - VkQueryControlFlags name; \ - \ - struct \ - { \ - uint8_t VK_QUERY_CONTROL_PRECISE_BIT : 1; \ - } name##_flags; \ - }; - - #define VkQueryPipelineStatisticFlagsVariable(name) \ - union \ - { \ - VkQueryPipelineStatisticFlags name; \ - \ - struct \ - { \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT : 1; \ - uint8_t VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT : 1; \ - } name##_flags; \ - }; - - #define VkQueryResultFlagsVariable(name) \ - union \ - { \ - VkQueryResultFlags name; \ - \ - struct \ - { \ - uint8_t VK_QUERY_RESULT_64_BIT : 1; \ - uint8_t VK_QUERY_RESULT_WAIT_BIT : 1; \ - uint8_t VK_QUERY_RESULT_WITH_AVAILABILITY_BIT : 1; \ - uint8_t VK_QUERY_RESULT_PARTIAL_BIT : 1; \ - } name##_flags; \ - }; - - #define VkQueueFlagsVariable(name) \ - union \ - { \ - VkQueueFlags name; \ - \ - struct \ - { \ - uint8_t VK_QUEUE_GRAPHICS_BIT : 1; \ - uint8_t VK_QUEUE_COMPUTE_BIT : 1; \ - uint8_t VK_QUEUE_TRANSFER_BIT : 1; \ - uint8_t VK_QUEUE_SPARSE_BINDING_BIT : 1; \ - } name##_flags; \ - }; - - #define VkShaderStageFlagsVariable(name) \ - union \ - { \ - VkShaderStageFlags name; \ - \ - struct \ - { \ - uint8_t VK_SHADER_STAGE_VERTEX_BIT : 1; \ - uint8_t VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT : 1; \ - uint8_t VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT : 1; \ - uint8_t VK_SHADER_STAGE_GEOMETRY_BIT : 1; \ - uint8_t VK_SHADER_STAGE_FRAGMENT_BIT : 1; \ - uint8_t VK_SHADER_STAGE_COMPUTE_BIT : 1; \ - } name##_flags; \ - }; - - #define VkSparseImageFormatFlagsVariable(name) \ - union \ - { \ - VkSparseImageFormatFlags name; \ - \ - struct \ - { \ - uint8_t VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT : 1; \ - uint8_t VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT : 1; \ - uint8_t VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT : 1; \ - } name##_flags; \ - }; - - #define VkSparseMemoryBindFlagsVariable(name) \ - union \ - { \ - VkSparseMemoryBindFlags name; \ - \ - struct \ - { \ - uint8_t VK_SPARSE_MEMORY_BIND_METADATA_BIT : 1; \ - } name##_flags; \ - }; - - #define VkStencilFaceFlagsVariable(name) \ - union \ - { \ - VkStencilFaceFlags name; \ - \ - struct \ - { \ - uint8_t VK_STENCIL_FACE_FRONT_BIT : 1; \ - uint8_t VK_STENCIL_FACE_BACK_BIT : 1; \ - } name##_flags; \ - }; - - #define VkSurfaceTransformFlagsKHRVariable(name) \ - union \ - { \ - VkSurfaceTransformFlagsKHR name; \ - \ - struct \ - { \ - uint8_t VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR : 1; \ - uint8_t VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR : 1; \ - } name##_flags; \ - }; -#else - #error "Big-endian arch's are not supported" -#endif - /* Helper macros */ #define ANVIL_DISABLE_ASSIGNMENT_OPERATOR(x) private: x& operator=(const x&); #define ANVIL_DISABLE_COPY_CONSTRUCTOR(x) private: x(const x&); diff --git a/include/misc/types_struct.h b/include/misc/types_struct.h index 2a4e26ce..dfd85b89 100644 --- a/include/misc/types_struct.h +++ b/include/misc/types_struct.h @@ -24,10 +24,192 @@ namespace Anvil { + /* NOTE: Maps 1:1 to VkImageSubresource */ + typedef struct + { + uint32_t min_image_count; + uint32_t max_image_count; + VkExtent2D current_extent; + VkExtent2D min_image_extent; + VkExtent2D max_image_extent; + uint32_t max_image_array_layers; + Anvil::SurfaceTransformFlags supported_transforms; + Anvil::SurfaceTransformFlagBits current_transform; + Anvil::CompositeAlphaFlags supported_composite_alpha; + Anvil::ImageUsageFlags supported_usage_flags; + } SurfaceCapabilities; + + static_assert(sizeof(SurfaceCapabilities) == sizeof(VkSurfaceCapabilitiesKHR), "Struct sizes much match"); + static_assert(offsetof(SurfaceCapabilities, min_image_count) == offsetof(VkSurfaceCapabilitiesKHR, minImageCount), "Member offsets must match"); + static_assert(offsetof(SurfaceCapabilities, max_image_count) == offsetof(VkSurfaceCapabilitiesKHR, maxImageCount), "Member offsets must match"); + static_assert(offsetof(SurfaceCapabilities, current_extent) == offsetof(VkSurfaceCapabilitiesKHR, currentExtent), "Member offsets must match"); + static_assert(offsetof(SurfaceCapabilities, min_image_extent) == offsetof(VkSurfaceCapabilitiesKHR, minImageExtent), "Member offsets must match"); + static_assert(offsetof(SurfaceCapabilities, max_image_extent) == offsetof(VkSurfaceCapabilitiesKHR, maxImageExtent), "Member offsets must match"); + static_assert(offsetof(SurfaceCapabilities, max_image_array_layers) == offsetof(VkSurfaceCapabilitiesKHR, maxImageArrayLayers), "Member offsets must match"); + static_assert(offsetof(SurfaceCapabilities, supported_transforms) == offsetof(VkSurfaceCapabilitiesKHR, supportedTransforms), "Member offsets must match"); + static_assert(offsetof(SurfaceCapabilities, current_transform) == offsetof(VkSurfaceCapabilitiesKHR, currentTransform), "Member offsets must match"); + static_assert(offsetof(SurfaceCapabilities, supported_composite_alpha) == offsetof(VkSurfaceCapabilitiesKHR, supportedCompositeAlpha), "Member offsets must match"); + static_assert(offsetof(SurfaceCapabilities, supported_usage_flags) == offsetof(VkSurfaceCapabilitiesKHR, supportedUsageFlags), "Member offsets must match"); + + /* NOTE: Maps 1:1 to VkImageSubresource */ + typedef struct + { + Anvil::ImageAspectFlags aspect_mask; + uint32_t mip_level; + uint32_t array_layer; + + VkImageSubresource get_vk() const + { + VkImageSubresource result; + + result.arrayLayer = array_layer; + result.aspectMask = aspect_mask.get_vk(); + result.mipLevel = mip_level; + + return result; + } + } ImageSubresource; + + static_assert(sizeof(ImageSubresource) == sizeof(VkImageSubresource), "Struct sizes much match"); + static_assert(offsetof(ImageSubresource, aspect_mask) == offsetof(VkImageSubresource, aspectMask), "Member offsets must match"); + static_assert(offsetof(ImageSubresource, mip_level) == offsetof(VkImageSubresource, mipLevel), "Member offsets must match"); + static_assert(offsetof(ImageSubresource, array_layer) == offsetof(VkImageSubresource, arrayLayer), "Member offsets must match"); + + /* NOTE: Maps 1:1 to VkImageSubresourceRange */ + typedef struct + { + Anvil::ImageAspectFlags aspect_mask; + uint32_t base_mip_level; + uint32_t level_count; + uint32_t base_array_layer; + uint32_t layer_count; + + VkImageSubresourceRange get_vk() const + { + VkImageSubresourceRange result; + + result.aspectMask = aspect_mask.get_vk(); + result.baseMipLevel = base_mip_level; + result.levelCount = level_count; + result.baseArrayLayer = base_array_layer; + result.layerCount = layer_count; + + return result; + } + } ImageSubresourceRange; + + static_assert(sizeof(ImageSubresourceRange) == sizeof(VkImageSubresourceRange), "Struct sizes much match"); + static_assert(offsetof(ImageSubresourceRange, aspect_mask) == offsetof(VkImageSubresourceRange, aspectMask), "Member offsets must match"); + static_assert(offsetof(ImageSubresourceRange, base_mip_level) == offsetof(VkImageSubresourceRange, baseMipLevel), "Member offsets must match"); + static_assert(offsetof(ImageSubresourceRange, level_count) == offsetof(VkImageSubresourceRange, levelCount), "Member offsets must match"); + static_assert(offsetof(ImageSubresourceRange, base_array_layer) == offsetof(VkImageSubresourceRange, baseArrayLayer), "Member offsets must match"); + static_assert(offsetof(ImageSubresourceRange, layer_count) == offsetof(VkImageSubresourceRange, layerCount), "Member offsets must match"); + + /* NOTE: Maps 1:1 to VkImageSubresourceLayers */ + typedef struct + { + Anvil::ImageAspectFlags aspect_mask; + uint32_t mip_level; + uint32_t base_array_layer; + uint32_t layer_count; + } ImageSubresourceLayers; + + static_assert(sizeof(ImageSubresourceLayers) == sizeof(VkImageSubresourceLayers), "Struct sizes much match"); + static_assert(offsetof(ImageSubresourceLayers, aspect_mask) == offsetof(VkImageSubresourceLayers, aspectMask), "Member offsets must match"); + static_assert(offsetof(ImageSubresourceLayers, mip_level) == offsetof(VkImageSubresourceLayers, mipLevel), "Member offsets must match"); + static_assert(offsetof(ImageSubresourceLayers, base_array_layer) == offsetof(VkImageSubresourceLayers, baseArrayLayer), "Member offsets must match"); + static_assert(offsetof(ImageSubresourceLayers, layer_count) == offsetof(VkImageSubresourceLayers, layerCount), "Member offsets must match"); + + /* NOTE: Maps 1:1 to VkSubresourceLayout */ + typedef struct + { + VkDeviceSize offset; + VkDeviceSize size; + VkDeviceSize row_pitch; + VkDeviceSize array_pitch; + VkDeviceSize depth_pitch; + } SubresourceLayout; + + static_assert(sizeof(SubresourceLayout) == sizeof(VkSubresourceLayout), "Struct sizes much match"); + static_assert(offsetof(SubresourceLayout, offset) == offsetof(VkSubresourceLayout, offset), "Member offsets must match"); + static_assert(offsetof(SubresourceLayout, size) == offsetof(VkSubresourceLayout, size), "Member offsets must match"); + static_assert(offsetof(SubresourceLayout, row_pitch) == offsetof(VkSubresourceLayout, rowPitch), "Member offsets must match"); + static_assert(offsetof(SubresourceLayout, array_pitch) == offsetof(VkSubresourceLayout, arrayPitch), "Member offsets must match"); + static_assert(offsetof(SubresourceLayout, depth_pitch) == offsetof(VkSubresourceLayout, depthPitch), "Member offsets must match"); + + typedef struct + { + Anvil::ImageSubresourceLayers src_subresource; + VkOffset3D src_offsets[2]; + Anvil::ImageSubresourceLayers dst_subresource; + VkOffset3D dst_offsets[2]; + } ImageBlit; + + static_assert(sizeof(ImageBlit) == sizeof(VkImageBlit), "Struct sizes much match"); + static_assert(offsetof(ImageBlit, src_subresource) == offsetof(VkImageBlit, srcSubresource), "Member offsets must match"); + static_assert(offsetof(ImageBlit, src_offsets) == offsetof(VkImageBlit, srcOffsets), "Member offsets must match"); + static_assert(offsetof(ImageBlit, dst_subresource) == offsetof(VkImageBlit, dstSubresource), "Member offsets must match"); + static_assert(offsetof(ImageBlit, dst_offsets) == offsetof(VkImageBlit, dstOffsets), "Member offsets must match"); + + /* NOTE: Maps 1:1 to VkBufferCopy */ + typedef struct + { + VkDeviceSize src_offset; + VkDeviceSize dst_offset; + VkDeviceSize size; + } BufferCopy; + + static_assert(sizeof(BufferCopy) == sizeof(VkBufferCopy), "Struct sizes much match"); + static_assert(offsetof(BufferCopy, src_offset) == offsetof(VkBufferCopy, srcOffset), "Member offsets must match"); + static_assert(offsetof(BufferCopy, dst_offset) == offsetof(VkBufferCopy, dstOffset), "Member offsets must match"); + static_assert(offsetof(BufferCopy, size) == offsetof(VkBufferCopy, size), "Member offsets must match"); + + /* NOTE: Maps 1:1 to VkBufferImageCopy */ + typedef struct + { + VkDeviceSize buffer_offset; + uint32_t buffer_row_length; + uint32_t buffer_image_height; + Anvil::ImageSubresourceLayers image_subresource; + VkOffset3D image_offset; + VkExtent3D image_extent; + } BufferImageCopy; + + static_assert(sizeof(BufferImageCopy) == sizeof(VkBufferImageCopy), "Struct sizes much match"); + static_assert(offsetof(BufferImageCopy, buffer_offset) == offsetof(VkBufferImageCopy, bufferOffset), "Member offsets must match"); + static_assert(offsetof(BufferImageCopy, buffer_row_length) == offsetof(VkBufferImageCopy, bufferRowLength), "Member offsets must match"); + static_assert(offsetof(BufferImageCopy, buffer_image_height) == offsetof(VkBufferImageCopy, bufferImageHeight), "Member offsets must match"); + static_assert(offsetof(BufferImageCopy, image_subresource) == offsetof(VkBufferImageCopy, imageSubresource), "Member offsets must match"); + static_assert(offsetof(BufferImageCopy, image_offset) == offsetof(VkBufferImageCopy, imageOffset), "Member offsets must match"); + static_assert(offsetof(BufferImageCopy, image_extent) == offsetof(VkBufferImageCopy, imageExtent), "Member offsets must match"); + + /* NOTE: Maps 1:1 to VkClearAttachment */ + typedef struct + { + Anvil::ImageAspectFlags aspect_mask; + uint32_t color_attachment; + VkClearValue clear_value; + } ClearAttachment; + + static_assert(sizeof(ClearAttachment) == sizeof(VkClearAttachment), "Struct sizes much match"); + static_assert(offsetof(ClearAttachment, aspect_mask) == offsetof(VkClearAttachment, aspectMask), "Member offsets must match"); + static_assert(offsetof(ClearAttachment, color_attachment) == offsetof(VkClearAttachment, colorAttachment), "Member offsets must match"); + static_assert(offsetof(ClearAttachment, clear_value) == offsetof(VkClearAttachment, clearValue), "Member offsets must match"); + + /* NOTE: Maps 1:1 to VkImageCopy */ + typedef struct + { + Anvil::ImageSubresourceLayers src_subresource; + VkOffset3D src_offset; + Anvil::ImageSubresourceLayers dst_subresource; + VkOffset3D dst_offset; + VkExtent3D extent; + } ImageCopy; + typedef struct ExternalFenceProperties { - Anvil::ExternalFenceHandleTypeBits compatible_external_handle_types; - Anvil::ExternalFenceHandleTypeBits export_from_imported_external_handle_types; + Anvil::ExternalFenceHandleTypeFlags compatible_external_handle_types; + Anvil::ExternalFenceHandleTypeFlags export_from_imported_external_handle_types; bool is_exportable; bool is_importable; @@ -40,8 +222,8 @@ namespace Anvil typedef struct ExternalMemoryProperties { - Anvil::ExternalMemoryHandleTypeBits compatible_external_handle_types; - Anvil::ExternalMemoryHandleTypeBits export_from_imported_external_handle_types; + Anvil::ExternalMemoryHandleTypeFlags compatible_external_handle_types; + Anvil::ExternalMemoryHandleTypeFlags export_from_imported_external_handle_types; bool is_exportable; bool is_importable; @@ -54,8 +236,8 @@ namespace Anvil typedef struct ExternalSemaphoreProperties { - Anvil::ExternalSemaphoreHandleTypeBits compatible_external_handle_types; - Anvil::ExternalSemaphoreHandleTypeBits export_from_imported_external_handle_types; + Anvil::ExternalSemaphoreHandleTypeFlags compatible_external_handle_types; + Anvil::ExternalSemaphoreHandleTypeFlags export_from_imported_external_handle_types; bool is_exportable; bool is_importable; @@ -97,8 +279,8 @@ namespace Anvil /** Describes a buffer memory barrier. */ typedef struct BufferBarrier { - VkAccessFlagsVariable(dst_access_mask); - VkAccessFlagsVariable(src_access_mask); + Anvil::AccessFlags dst_access_mask; + Anvil::AccessFlags src_access_mask; VkBuffer buffer; VkBufferMemoryBarrier buffer_barrier_vk; @@ -121,13 +303,13 @@ namespace Anvil * @param in_offset Start offset of the region described by the barrier. * @param in_size Size of the region described by the barrier. **/ - explicit BufferBarrier(VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - uint32_t in_src_queue_family_index, - uint32_t in_dst_queue_family_index, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_offset, - VkDeviceSize in_size); + explicit BufferBarrier(Anvil::AccessFlags in_source_access_mask, + Anvil::AccessFlags in_destination_access_mask, + uint32_t in_src_queue_family_index, + uint32_t in_dst_queue_family_index, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkDeviceSize in_size); /** Destructor. * @@ -179,13 +361,13 @@ namespace Anvil typedef struct BufferPropertiesQuery { - const Anvil::BufferCreateFlags create_flags; - const Anvil::ExternalMemoryHandleTypeBit external_memory_handle_type; - const Anvil::BufferUsageFlags usage_flags; + const Anvil::BufferCreateFlags create_flags; + const Anvil::ExternalMemoryHandleTypeFlags external_memory_handle_type; + const Anvil::BufferUsageFlags usage_flags; - explicit BufferPropertiesQuery(const Anvil::BufferCreateFlags in_create_flags, - const Anvil::ExternalMemoryHandleTypeBit& in_external_memory_handle_type, - const Anvil::BufferUsageFlags& in_usage_flags) + explicit BufferPropertiesQuery(const Anvil::BufferCreateFlags in_create_flags, + const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_type, + const Anvil::BufferUsageFlags& in_usage_flags) :create_flags (in_create_flags), external_memory_handle_type(in_external_memory_handle_type), usage_flags (in_usage_flags) @@ -377,20 +559,20 @@ namespace Anvil typedef struct DescriptorUpdateTemplateEntry { - VkDescriptorType descriptor_type; - uint32_t n_descriptors; - uint32_t n_destination_array_element; - uint32_t n_destination_binding; - size_t offset; - size_t stride; + Anvil::DescriptorType descriptor_type; + uint32_t n_descriptors; + uint32_t n_destination_array_element; + uint32_t n_destination_binding; + size_t offset; + size_t stride; DescriptorUpdateTemplateEntry(); - DescriptorUpdateTemplateEntry(const VkDescriptorType& in_descriptor_type, - const uint32_t& in_n_destination_array_element, - const uint32_t& in_n_destination_binding, - const uint32_t& in_n_descriptors, - const size_t& in_offset, - const size_t& in_stride); + DescriptorUpdateTemplateEntry(const Anvil::DescriptorType& in_descriptor_type, + const uint32_t& in_n_destination_array_element, + const uint32_t& in_n_destination_binding, + const uint32_t& in_n_descriptors, + const size_t& in_offset, + const size_t& in_stride); VkDescriptorUpdateTemplateEntryKHR get_vk_descriptor_update_template_entry_khr() const; @@ -639,9 +821,9 @@ namespace Anvil typedef struct FencePropertiesQuery { - const Anvil::ExternalFenceHandleTypeBit external_fence_handle_type; + const Anvil::ExternalFenceHandleTypeFlagBits external_fence_handle_type; - explicit FencePropertiesQuery(const Anvil::ExternalFenceHandleTypeBit& in_external_fence_handle_type) + explicit FencePropertiesQuery(const Anvil::ExternalFenceHandleTypeFlagBits& in_external_fence_handle_type) :external_fence_handle_type(in_external_fence_handle_type) { /* Stub */ @@ -653,9 +835,9 @@ namespace Anvil typedef struct FormatProperties { - VkFormatFeatureFlagsVariable(buffer_capabilities); - VkFormatFeatureFlagsVariable(linear_tiling_capabilities); - VkFormatFeatureFlagsVariable(optimal_tiling_capabilities); + FormatFeatureFlags buffer_capabilities; + FormatFeatureFlags linear_tiling_capabilities; + FormatFeatureFlags optimal_tiling_capabilities; FormatProperties(); FormatProperties(const VkFormatProperties& in_format_props); @@ -701,7 +883,7 @@ namespace Anvil const Anvil::ImageUsageFlags& in_usage_flags, const Anvil::ImageCreateFlags& in_create_flags) :create_flags (in_create_flags), - external_memory_handle_type(EXTERNAL_MEMORY_HANDLE_TYPE_NONE), + external_memory_handle_type(Anvil::ExternalMemoryHandleTypeFlagBits::NONE), format (in_format), image_type (in_image_type), tiling (in_tiling), @@ -710,37 +892,53 @@ namespace Anvil /* Stub */ } - void set_external_memory_handle_type(const Anvil::ExternalMemoryHandleTypeBit& in_external_memory_handle_type) + void set_external_memory_handle_type(const Anvil::ExternalMemoryHandleTypeFlagBits& in_external_memory_handle_type) { external_memory_handle_type = in_external_memory_handle_type; } - const ImageCreateFlags create_flags; - Anvil::ExternalMemoryHandleTypeBit external_memory_handle_type; - const Anvil::Format format; - const Anvil::ImageType image_type; - const Anvil::ImageTiling tiling; - const Anvil::ImageUsageFlags usage_flags; + const Anvil::ImageCreateFlags create_flags; + Anvil::ExternalMemoryHandleTypeFlagBits external_memory_handle_type; + const Anvil::Format format; + const Anvil::ImageType image_type; + const Anvil::ImageTiling tiling; + const Anvil::ImageUsageFlags usage_flags; ImageFormatPropertiesQuery (const ImageFormatPropertiesQuery& in_query) = default; ImageFormatPropertiesQuery& operator=(const ImageFormatPropertiesQuery& in_query) = delete; } ImageFormatPropertiesQuery; + /* NOTE: Maps 1:1 to VkImageResolve */ + typedef struct + { + Anvil::ImageSubresourceLayers src_subresource; + VkOffset3D src_offset; + Anvil::ImageSubresourceLayers dst_subresource; + VkOffset3D dst_offset; + VkExtent3D extent; + } ImageResolve; + + static_assert(sizeof(ImageResolve) == sizeof(VkImageResolve), "Struct sizes must match"); + static_assert(offsetof(ImageResolve, src_subresource) == offsetof(VkImageResolve, srcSubresource), "Member offsets must match"); + static_assert(offsetof(ImageResolve, src_offset) == offsetof(VkImageResolve, srcOffset), "Member offsets must match"); + static_assert(offsetof(ImageResolve, dst_subresource) == offsetof(VkImageResolve, dstSubresource), "Member offsets must match"); + static_assert(offsetof(ImageResolve, dst_offset) == offsetof(VkImageResolve, dstOffset), "Member offsets must match"); + static_assert(offsetof(ImageResolve, extent) == offsetof(VkImageResolve, extent), "Member offsets must match"); + /** Describes an image memory barrier. */ typedef struct ImageBarrier { - VkAccessFlagsVariable(dst_access_mask); - VkAccessFlagsVariable(src_access_mask); + Anvil::AccessFlags dst_access_mask; + Anvil::AccessFlags src_access_mask; - bool by_region; - uint32_t dst_queue_family_index; - VkImage image; - VkImageMemoryBarrier image_barrier_vk; - Anvil::Image* image_ptr; - Anvil::ImageLayout new_layout; - Anvil::ImageLayout old_layout; - uint32_t src_queue_family_index; - VkImageSubresourceRange subresource_range; + uint32_t dst_queue_family_index; + VkImage image; + VkImageMemoryBarrier image_barrier_vk; + Anvil::Image* image_ptr; + Anvil::ImageLayout new_layout; + Anvil::ImageLayout old_layout; + uint32_t src_queue_family_index; + Anvil::ImageSubresourceRange subresource_range; /** Constructor. * @@ -748,7 +946,6 @@ namespace Anvil * * @param in_source_access_mask Source access mask to use for the barrier. * @param in_destination_access_mask Destination access mask to use for the barrier. - * @param in_by_region_barrier true if this is a by-region barrier. * @param in_old_layout Old layout of @param in_image_ptr to use for the barrier. * @param in_new_layout New layout of @param in_image_ptr to use for the barrier. * @param in_src_queue_family_index Source queue family index to use for the barrier. @@ -759,15 +956,14 @@ namespace Anvil * @param in_image_subresource_range Subresource range to use for the barrier. * **/ - ImageBarrier(VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region_barrier, - Anvil::ImageLayout in_old_layout, - Anvil::ImageLayout in_new_layout, - uint32_t in_src_queue_family_index, - uint32_t in_dst_queue_family_index, - Anvil::Image* in_image_ptr, - VkImageSubresourceRange in_image_subresource_range); + ImageBarrier(Anvil::AccessFlags in_source_access_mask, + Anvil::AccessFlags in_destination_access_mask, + Anvil::ImageLayout in_old_layout, + Anvil::ImageLayout in_new_layout, + uint32_t in_src_queue_family_index, + uint32_t in_dst_queue_family_index, + Anvil::Image* in_image_ptr, + Anvil::ImageSubresourceRange in_image_subresource_range); /** Destructor. * @@ -909,8 +1105,8 @@ namespace Anvil /** Describes a Vulkan memory barrier. */ typedef struct MemoryBarrier { - VkAccessFlagsVariable(destination_access_mask); - VkAccessFlagsVariable(source_access_mask); + Anvil::AccessFlags destination_access_mask; + Anvil::AccessFlags source_access_mask; VkMemoryBarrier memory_barrier_vk; @@ -920,8 +1116,8 @@ namespace Anvil * @param in_destination_access_mask Destination access mask of the Vulkan memory barrier. * **/ - explicit MemoryBarrier(VkAccessFlags in_destination_access_mask, - VkAccessFlags in_source_access_mask); + explicit MemoryBarrier(Anvil::AccessFlags in_destination_access_mask, + Anvil::AccessFlags in_source_access_mask); /** Destructor. */ virtual ~MemoryBarrier() @@ -952,7 +1148,7 @@ namespace Anvil /** Holds properties of a single Vulkan Memory Heap. */ typedef struct MemoryHeap { - VkMemoryHeapFlagsVariable(flags); + Anvil::MemoryHeapFlags flags; uint32_t index; VkDeviceSize size; @@ -972,7 +1168,7 @@ namespace Anvil MemoryFeatureFlags features; MemoryHeap* heap_ptr; - VkMemoryPropertyFlagsVariable(flags); + Anvil::MemoryPropertyFlags flags; /** Constructor. Initializes the instance using data provided by the driver. * @@ -1617,9 +1813,9 @@ namespace Anvil /* A single push constant range descriptor */ typedef struct PushConstantRange { - uint32_t offset; - uint32_t size; - VkShaderStageFlagBits stages; + uint32_t offset; + uint32_t size; + Anvil::ShaderStageFlags stages; /** Constructor * @@ -1627,9 +1823,9 @@ namespace Anvil * @param in_size Size of the range. * @param in_stages Valid pipeline stages for the range. */ - PushConstantRange(uint32_t in_offset, - uint32_t in_size, - VkShaderStageFlags in_stages); + PushConstantRange(uint32_t in_offset, + uint32_t in_size, + Anvil::ShaderStageFlags in_stages); /** Comparison operator. Used internally. */ bool operator==(const PushConstantRange& in) const; @@ -1640,7 +1836,7 @@ namespace Anvil /** Holds information about a single Vulkan Queue Family. */ typedef struct QueueFamilyInfo { - VkQueueFlagsVariable(flags); + Anvil::QueueFlags flags; VkExtent3D min_image_transfer_granularity; uint32_t n_queues; @@ -1692,9 +1888,9 @@ namespace Anvil typedef struct SemaphorePropertiesQuery { - const Anvil::ExternalSemaphoreHandleTypeBit external_semaphore_handle_type; + const Anvil::ExternalSemaphoreHandleTypeFlagBits external_semaphore_handle_type; - explicit SemaphorePropertiesQuery(const Anvil::ExternalSemaphoreHandleTypeBit& in_external_semaphore_handle_type) + explicit SemaphorePropertiesQuery(const Anvil::ExternalSemaphoreHandleTypeFlagBits& in_external_semaphore_handle_type) :external_semaphore_handle_type(in_external_semaphore_handle_type) { /* Stub */ @@ -1737,12 +1933,73 @@ namespace Anvil ShaderModuleStageEntryPoint& operator=(const ShaderModuleStageEntryPoint&); } ShaderModuleStageEntryPoint; + typedef struct SparseImageFormatProperties + { + Anvil::ImageAspectFlags aspect_mask; + VkExtent3D image_granularity; + Anvil::SparseImageFormatFlags flags; + + SparseImageFormatProperties() + { + aspect_mask = Anvil::ImageAspectFlagBits::NONE; + image_granularity.depth = 0; + image_granularity.height = 0; + image_granularity.width = 0; + flags = Anvil::SparseImageFormatFlagBits::NONE; + } + + SparseImageFormatProperties(const VkSparseImageFormatProperties& in_props) + { + aspect_mask = static_cast(in_props.aspectMask); + image_granularity = in_props.imageGranularity; + flags = static_cast(in_props.flags); + } + } SparseImageFormatProperties; + + static_assert(sizeof(SparseImageFormatProperties) == sizeof(VkSparseImageFormatProperties), "Struct sizes must match"); + static_assert(offsetof(SparseImageFormatProperties, aspect_mask) == offsetof(VkSparseImageFormatProperties, aspectMask), "Member offsets must match"); + static_assert(offsetof(SparseImageFormatProperties, image_granularity) == offsetof(VkSparseImageFormatProperties, imageGranularity), "Member offsets must match"); + static_assert(offsetof(SparseImageFormatProperties, flags) == offsetof(VkSparseImageFormatProperties, flags), "Member offsets must match"); + + typedef struct SparseImageMemoryRequirements + { + Anvil::SparseImageFormatProperties format_properties; + uint32_t image_mip_tail_first_lod; + VkDeviceSize image_mip_tail_size; + VkDeviceSize image_mip_tail_offset; + VkDeviceSize image_mip_tail_stride; + + SparseImageMemoryRequirements() + { + image_mip_tail_first_lod = 0; + image_mip_tail_size = 0; + image_mip_tail_offset = 0; + image_mip_tail_stride = 0; + } + + SparseImageMemoryRequirements(const VkSparseImageMemoryRequirements& in_reqs) + { + format_properties = in_reqs.formatProperties; + image_mip_tail_first_lod = in_reqs.imageMipTailFirstLod; + image_mip_tail_size = in_reqs.imageMipTailSize; + image_mip_tail_offset = in_reqs.imageMipTailOffset; + image_mip_tail_stride = in_reqs.imageMipTailStride; + } + } SparseImageMemoryRequirements; + + static_assert(sizeof(SparseImageMemoryRequirements) == sizeof(VkSparseImageMemoryRequirements), "Struct sizes must match"); + static_assert(offsetof(SparseImageMemoryRequirements, format_properties) == offsetof(VkSparseImageMemoryRequirements, formatProperties), "Member offsets must match"); + static_assert(offsetof(SparseImageMemoryRequirements, image_mip_tail_first_lod) == offsetof(VkSparseImageMemoryRequirements, imageMipTailFirstLod), "Member offsets must match"); + static_assert(offsetof(SparseImageMemoryRequirements, image_mip_tail_size) == offsetof(VkSparseImageMemoryRequirements, imageMipTailSize), "Member offsets must match"); + static_assert(offsetof(SparseImageMemoryRequirements, image_mip_tail_offset) == offsetof(VkSparseImageMemoryRequirements, imageMipTailOffset), "Member offsets must match"); + static_assert(offsetof(SparseImageMemoryRequirements, image_mip_tail_stride) == offsetof(VkSparseImageMemoryRequirements, imageMipTailStride), "Member offsets must match"); + /* Describes sparse properties for an image format */ typedef struct SparseImageAspectProperties { Anvil::ImageAspectFlags aspect_mask; - VkSparseImageFormatFlagsVariable(flags); + SparseImageFormatFlags flags; VkExtent3D granularity; uint32_t mip_tail_first_lod; @@ -1751,7 +2008,7 @@ namespace Anvil VkDeviceSize mip_tail_stride; SparseImageAspectProperties(); - SparseImageAspectProperties(const VkSparseImageMemoryRequirements& in_req); + SparseImageAspectProperties(const Anvil::SparseImageMemoryRequirements& in_req); } SparseImageAspectProperties; typedef struct SpecializationConstant @@ -1837,7 +2094,7 @@ namespace Anvil Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, uint32_t in_n_semaphores_to_wait_on, Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, + const Anvil::PipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, bool in_should_block, Anvil::Fence* in_opt_fence_ptr = nullptr); static SubmitInfo create(uint32_t in_n_cmd_buffers, @@ -1846,7 +2103,7 @@ namespace Anvil Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, uint32_t in_n_semaphores_to_wait_on, Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, + const Anvil::PipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, bool in_should_block, Anvil::Fence* in_opt_fence_ptr = nullptr); @@ -1888,13 +2145,13 @@ namespace Anvil Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, Anvil::Fence* in_opt_fence_ptr = nullptr); - static SubmitInfo create_signal_wait(uint32_t in_n_semaphores_to_signal, - Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, - uint32_t in_n_semaphores_to_wait_on, - Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, - bool in_should_block, - Anvil::Fence* in_opt_fence_ptr = nullptr); + static SubmitInfo create_signal_wait(uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, + const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr); /** TODO * @@ -1902,27 +2159,27 @@ namespace Anvil */ static SubmitInfo create_wait(uint32_t in_n_semaphores_to_wait_on, Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, Anvil::Fence* in_opt_fence_ptr = nullptr); static SubmitInfo create_wait_execute(Anvil::CommandBufferBase* in_cmd_buffer_ptr, uint32_t in_n_semaphores_to_wait_on, Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, bool in_should_block, Anvil::Fence* in_opt_fence_ptr = nullptr); static SubmitInfo create_wait_execute(Anvil::CommandBufferBase* const* in_cmd_buffer_ptrs_ptr, uint32_t in_n_cmd_buffers, uint32_t in_n_semaphores_to_wait_on, Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, bool in_should_block, Anvil::Fence* in_opt_fence_ptr = nullptr); static SubmitInfo create_wait_execute(const CommandBufferMGPUSubmission* in_cmd_buffer_submission_ptr, uint32_t in_n_wait_semaphore_submissions, const SemaphoreMGPUSubmission* in_wait_semaphore_submissions_ptr, - const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, bool in_should_block, Anvil::Fence* in_opt_fence_ptr = nullptr); @@ -1931,7 +2188,7 @@ namespace Anvil Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, uint32_t in_n_semaphores_to_wait_on, Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, bool in_should_block, Anvil::Fence* in_opt_fence_ptr = nullptr); static SubmitInfo create_wait_execute_signal(Anvil::CommandBufferBase* const* in_cmd_buffer_ptrs_ptr, @@ -1940,7 +2197,7 @@ namespace Anvil Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, uint32_t in_n_semaphores_to_wait_on, Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, bool in_should_block, Anvil::Fence* in_opt_fence_ptr = nullptr); @@ -1949,7 +2206,7 @@ namespace Anvil const SemaphoreMGPUSubmission* in_signal_semaphore_submissions_ptr, uint32_t in_n_wait_semaphore_submissions, const SemaphoreMGPUSubmission* in_wait_semaphore_submissions_ptr, - const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, bool in_should_block, Anvil::Fence* in_opt_fence_ptr = nullptr); @@ -1979,7 +2236,7 @@ namespace Anvil const VkPipelineStageFlags* get_destination_stage_wait_masks() const { - return dst_stage_wait_masks_ptr; + return (dst_stage_wait_masks.size() > 0) ? &dst_stage_wait_masks.at(0) : nullptr; } Anvil::Fence* get_fence() const @@ -2082,14 +2339,14 @@ namespace Anvil timeout = in_timeout; } private: - SubmitInfo(Anvil::CommandBufferBase* in_cmd_buffer_ptr, - uint32_t in_n_semaphores_to_signal, - Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, - uint32_t in_n_semaphores_to_wait_on, - Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, - bool in_should_block, - Anvil::Fence* in_opt_fence_ptr); + SubmitInfo(Anvil::CommandBufferBase* in_cmd_buffer_ptr, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, + const Anvil::PipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr); SubmitInfo(uint32_t in_n_command_buffers, Anvil::CommandBufferBase* const* in_opt_cmd_buffer_ptrs_ptr, @@ -2097,7 +2354,7 @@ namespace Anvil Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, uint32_t in_n_semaphores_to_wait_on, Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, + const Anvil::PipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, bool in_should_block, Anvil::Fence* in_opt_fence_ptr); @@ -2107,7 +2364,7 @@ namespace Anvil const SemaphoreMGPUSubmission* in_opt_signal_semaphore_submissions_ptr, uint32_t in_n_wait_semaphore_submissions, const SemaphoreMGPUSubmission* in_opt_wait_semaphore_submissions_ptr, - const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptr, + const Anvil::PipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptr, bool in_should_block, Anvil::Fence* in_opt_fence_ptr); @@ -2121,10 +2378,10 @@ namespace Anvil Anvil::Semaphore* const* signal_semaphores_sgpu_ptr; uint32_t n_signal_semaphores; - const VkPipelineStageFlags* dst_stage_wait_masks_ptr; - const SemaphoreMGPUSubmission* wait_semaphores_mgpu_ptr; - Anvil::Semaphore* const* wait_semaphores_sgpu_ptr; - uint32_t n_wait_semaphores; + std::vector dst_stage_wait_masks; + const SemaphoreMGPUSubmission* wait_semaphores_mgpu_ptr; + Anvil::Semaphore* const* wait_semaphores_sgpu_ptr; + uint32_t n_wait_semaphores; Anvil::Fence* fence_ptr; diff --git a/include/misc/types_utils.h b/include/misc/types_utils.h index c879d3cf..6d34f9a4 100644 --- a/include/misc/types_utils.h +++ b/include/misc/types_utils.h @@ -28,29 +28,12 @@ namespace Anvil { MTSafety convert_boolean_to_mt_safety_enum(bool in_mt_safe); - VkBufferCreateFlags convert_buffer_create_flags_to_vk_buffer_create_flags(const Anvil::BufferCreateFlags& in_create_flags); - Anvil::BufferCreateFlags convert_vk_buffer_create_flags_to_buffer_create_flags(const VkBufferCreateFlags& in_create_flags); - - VkExternalFenceHandleTypeFlagsKHR convert_external_fence_handle_type_bits_to_vk_external_fence_handle_type_flags(const Anvil::ExternalFenceHandleTypeBits& in_types); - Anvil::ExternalFenceHandleTypeBits convert_vk_external_fence_handle_type_flags_to_external_fence_handle_type_bits(const VkExternalFenceHandleTypeFlagsKHR& in_types); - - VkExternalMemoryHandleTypeFlagsKHR convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(const Anvil::ExternalMemoryHandleTypeBits& in_types); - Anvil::ExternalMemoryHandleTypeBits convert_vk_external_memory_handle_type_flags_to_external_memory_handle_type_bits(const VkExternalMemoryHandleTypeFlagsKHR& in_types); - - VkExternalSemaphoreHandleTypeFlagsKHR convert_external_semaphore_handle_type_bits_to_vk_external_semaphore_handle_type_flags(const Anvil::ExternalSemaphoreHandleTypeBits& in_types); - Anvil::ExternalSemaphoreHandleTypeBits convert_vk_external_semaphore_handle_type_flags_to_external_semaphore_handle_type_bits(const VkExternalSemaphoreHandleTypeFlagsKHR& in_types); - bool convert_mt_safety_enum_to_boolean(MTSafety in_mt_safety, const Anvil::BaseDevice* in_device_ptr); - VkIndexType convert_index_type_to_vk_index_type(const IndexType& in_index_type); - Anvil::IndexType convert_vk_index_type_to_index_type(const VkIndexType& in_index_type); - - Anvil::PeerMemoryFeatureFlags convert_vk_peer_memory_feature_flags_to_peer_memory_feature_flags(const VkPeerMemoryFeatureFlags& in_value); - - Anvil::QueueFamilyBits get_queue_family_bits_from_queue_family_type(Anvil::QueueFamilyType in_queue_family_type); + Anvil::QueueFamilyFlags get_queue_family_flags_from_queue_family_type(Anvil::QueueFamilyType in_queue_family_type); - /** Converts a Anvil::QueueFamilyBits bitfield value to an array of queue family indices. + /** Converts a queue family bitfield value to an array of queue family indices. * * @param in_queue_families Input value to convert from. * @param out_opt_queue_family_indices_ptr If not NULL, deref will be updated with *@param out_opt_n_queue_family_indices_ptr @@ -60,7 +43,7 @@ namespace Anvil * **/ void convert_queue_family_bits_to_family_indices(const Anvil::BaseDevice* in_device_ptr, - Anvil::QueueFamilyBits in_queue_families, + Anvil::QueueFamilyFlags in_queue_families, uint32_t* out_opt_queue_family_indices_ptr, uint32_t* out_opt_n_queue_family_indices_ptr); @@ -81,11 +64,11 @@ namespace Anvil * * The access mask can be further restricted to the specified queue family type. */ - VkAccessFlags get_access_mask_from_image_layout(Anvil::ImageLayout in_layout, - Anvil::QueueFamilyType in_queue_family_type = Anvil::QueueFamilyType::UNDEFINED); + Anvil::AccessFlags get_access_mask_from_image_layout(Anvil::ImageLayout in_layout, + Anvil::QueueFamilyType in_queue_family_type = Anvil::QueueFamilyType::UNDEFINED); - /** Converts a pair of VkMemoryPropertyFlags and VkMemoryHeapFlags bitfields to a corresponding Anvil::MemoryFeatureFlags + /** Converts a pair of Anvil::MemoryPropertyFlags and Anvil::MemoryHeapFlags bitfields to a corresponding Anvil::MemoryFeatureFlags * enum. * * @param in_opt_mem_type_flags Vulkan memory property flags. May be 0. @@ -93,8 +76,8 @@ namespace Anvil * * @return Result bitfield. */ - Anvil::MemoryFeatureFlags get_memory_feature_flags_from_vk_property_flags(VkMemoryPropertyFlags in_opt_mem_type_flags, - VkMemoryHeapFlags in_opt_mem_heap_flags); + Anvil::MemoryFeatureFlags get_memory_feature_flags_from_vk_property_flags(Anvil::MemoryPropertyFlags in_opt_mem_type_flags, + Anvil::MemoryHeapFlags in_opt_mem_heap_flags); /** Converts the specified queue family type to a raw string * @@ -273,24 +256,24 @@ namespace Anvil const char* get_raw_string(VkStencilOp in_stencil_op); /* Returns Vulkan equivalent of @param in_shader_stage */ - VkShaderStageFlagBits get_shader_stage_flag_bits_from_shader_stage(Anvil::ShaderStage in_shader_stage); + Anvil::ShaderStageFlagBits get_shader_stage_flag_bits_from_shader_stage(Anvil::ShaderStage in_shader_stage); /** Converts an Anvil::MemoryFeatureFlags value to a pair of corresponding Vulkan enum values. * * @param in_mem_feature_flags Anvil memory feature flags to use for conversion. - * @param out_mem_type_flags_ptr Deref will be set to a corresponding VkMemoryPropertyFlags value. Must not + * @param out_mem_type_flags_ptr Deref will be set to a corresponding Anvil::MemoryPropertyFlags value. Must not * be nullptr. - * @param out_mem_heap_flags_ptr Deref will be set to a corresponding VkMemoryHeapFlags value. Must not + * @param out_mem_heap_flags_ptr Deref will be set to a corresponding Anvil::MemoryHeapFlags value. Must not * be nullptr. **/ - void get_vk_property_flags_from_memory_feature_flags(Anvil::MemoryFeatureFlags in_mem_feature_flags, - VkMemoryPropertyFlags* out_mem_type_flags_ptr, - VkMemoryHeapFlags* out_mem_heap_flags_ptr); + void get_vk_property_flags_from_memory_feature_flags(Anvil::MemoryFeatureFlags in_mem_feature_flags, + Anvil::MemoryPropertyFlags* out_mem_type_flags_ptr, + Anvil::MemoryHeapFlags* out_mem_heap_flags_ptr); #ifdef _WIN32 - bool is_nt_handle(const Anvil::ExternalFenceHandleTypeBit& in_type); - bool is_nt_handle(const Anvil::ExternalMemoryHandleTypeBit& in_type); - bool is_nt_handle(const Anvil::ExternalSemaphoreHandleTypeBit& in_type); + bool is_nt_handle(const Anvil::ExternalFenceHandleTypeFlagBits& in_type); + bool is_nt_handle(const Anvil::ExternalMemoryHandleTypeFlagBits& in_type); + bool is_nt_handle(const Anvil::ExternalSemaphoreHandleTypeFlagBits& in_type); #endif /** Tells whether @param in_value is a power-of-two. */ diff --git a/include/wrappers/buffer.h b/include/wrappers/buffer.h index e49ea984..253b0255 100644 --- a/include/wrappers/buffer.h +++ b/include/wrappers/buffer.h @@ -293,7 +293,7 @@ namespace Anvil Anvil::BufferUniquePtr m_staging_buffer_ptr; Anvil::Queue* m_staging_buffer_queue_ptr; - VkBufferCreateFlagsVariable(m_create_flags); + Anvil::BufferCreateFlags m_create_flags; std::vector m_owned_memory_blocks; bool m_prefers_dedicated_allocation; diff --git a/include/wrappers/command_buffer.h b/include/wrappers/command_buffer.h index 8abdca6c..0e8b1dd9 100644 --- a/include/wrappers/command_buffer.h +++ b/include/wrappers/command_buffer.h @@ -166,7 +166,7 @@ namespace Anvil typedef struct BeginRenderPassCommand : public Command { std::vector clear_values; - VkSubpassContents contents; + Anvil::SubpassContents contents; Anvil::Framebuffer* fbo_ptr; std::vector physical_devices; std::vector render_areas; @@ -185,7 +185,7 @@ namespace Anvil const Anvil::PhysicalDevice* const* in_physical_devices, const VkRect2D* in_render_areas, Anvil::RenderPass* in_render_pass_ptr, - VkSubpassContents in_contents); + Anvil::SubpassContents in_contents); /** Destructor. * @@ -266,10 +266,10 @@ namespace Anvil std::vector image_barriers; std::vector memory_barriers; - VkDependencyFlagsVariable(flags); + Anvil::DependencyFlags flags; - VkPipelineStageFlagsVariable(dst_stage_mask); - VkPipelineStageFlagsVariable(src_stage_mask); + Anvil::PipelineStageFlags dst_stage_mask; + Anvil::PipelineStageFlags src_stage_mask; /** Constructor. * @@ -277,9 +277,9 @@ namespace Anvil * * Arguments as per Vulkan API. **/ - explicit PipelineBarrierCommand(VkPipelineStageFlags in_src_stage_mask, - VkPipelineStageFlags in_dst_stage_mask, - VkDependencyFlags in_flags, + explicit PipelineBarrierCommand(Anvil::PipelineStageFlags in_src_stage_mask, + Anvil::PipelineStageFlags in_dst_stage_mask, + Anvil::DependencyFlags in_flags, uint32_t in_memory_barrier_count, const MemoryBarrier* const in_memory_barriers_ptr_ptr, uint32_t in_buffer_memory_barrier_count, @@ -357,9 +357,9 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_begin_query(Anvil::QueryPool* in_query_pool_ptr, - Anvil::QueryIndex in_entry, - VkQueryControlFlags in_flags); + bool record_begin_query(Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_entry, + Anvil::QueryControlFlags in_flags); /** Issues a vkCmdBindDescriptorSets() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -372,7 +372,7 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_bind_descriptor_sets(VkPipelineBindPoint in_pipeline_bind_point, + bool record_bind_descriptor_sets(Anvil::PipelineBindPoint in_pipeline_bind_point, Anvil::PipelineLayout* in_layout_ptr, uint32_t in_first_set, uint32_t in_set_count, @@ -394,9 +394,9 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_bind_index_buffer(Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_offset, - VkIndexType in_index_type); + bool record_bind_index_buffer(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + Anvil::IndexType in_index_type); /** Issues a vkCmdBindPipeline() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -409,8 +409,8 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_bind_pipeline(VkPipelineBindPoint in_pipeline_bind_point, - Anvil::PipelineID in_pipeline_id); + bool record_bind_pipeline(Anvil::PipelineBindPoint in_pipeline_bind_point, + Anvil::PipelineID in_pipeline_id); /** Issues a vkCmdBindVertexBuffers() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -448,13 +448,13 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_blit_image(Anvil::Image* in_src_image_ptr, - Anvil::ImageLayout in_src_image_layout, - Anvil::Image* in_dst_image_ptr, - Anvil::ImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageBlit* in_region_ptrs, - VkFilter in_filter); + bool record_blit_image(Anvil::Image* in_src_image_ptr, + Anvil::ImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + Anvil::ImageLayout in_dst_image_layout, + uint32_t in_region_count, + const Anvil::ImageBlit* in_region_ptrs, + Anvil::Filter in_filter); /** Issues a vkCmdClearAttachments() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -473,10 +473,10 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_clear_attachments(uint32_t in_n_attachments, - const VkClearAttachment* in_attachment_ptrs, - uint32_t in_n_rects, - const VkClearRect* in_rect_ptrs); + bool record_clear_attachments(uint32_t in_n_attachments, + const Anvil::ClearAttachment* in_attachment_ptrs, + uint32_t in_n_rects, + const VkClearRect* in_rect_ptrs); /** Issues a vkCmdClearColorImage() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -495,11 +495,11 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_clear_color_image(Anvil::Image* in_image_ptr, - Anvil::ImageLayout in_image_layout, - const VkClearColorValue* in_color_ptr, - uint32_t in_range_count, - const VkImageSubresourceRange* in_range_ptrs); + bool record_clear_color_image(Anvil::Image* in_image_ptr, + Anvil::ImageLayout in_image_layout, + const VkClearColorValue* in_color_ptr, + uint32_t in_range_count, + const Anvil::ImageSubresourceRange* in_range_ptrs); /** Issues a vkCmdClearDepthStencilImage() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -518,11 +518,11 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_clear_depth_stencil_image(Anvil::Image* in_image_ptr, - Anvil::ImageLayout in_image_layout, - const VkClearDepthStencilValue* in_depth_stencil_ptr, - uint32_t in_range_count, - const VkImageSubresourceRange* in_range_ptrs); + bool record_clear_depth_stencil_image(Anvil::Image* in_image_ptr, + Anvil::ImageLayout in_image_layout, + const VkClearDepthStencilValue* in_depth_stencil_ptr, + uint32_t in_range_count, + const Anvil::ImageSubresourceRange* in_range_ptrs); /** Issues a vkCmdCopyBuffer() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -541,10 +541,10 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_copy_buffer(Anvil::Buffer* in_src_buffer_ptr, - Anvil::Buffer* in_dst_buffer_ptr, - uint32_t in_region_count, - const VkBufferCopy* in_region_ptrs); + bool record_copy_buffer(Anvil::Buffer* in_src_buffer_ptr, + Anvil::Buffer* in_dst_buffer_ptr, + uint32_t in_region_count, + const Anvil::BufferCopy* in_region_ptrs); /** Issues a vkCmdCopyBufferToImage() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -563,11 +563,11 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_copy_buffer_to_image(Anvil::Buffer* in_src_buffer_ptr, - Anvil::Image* in_dst_image_ptr, - Anvil::ImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkBufferImageCopy* in_region_ptrs); + bool record_copy_buffer_to_image(Anvil::Buffer* in_src_buffer_ptr, + Anvil::Image* in_dst_image_ptr, + Anvil::ImageLayout in_dst_image_layout, + uint32_t in_region_count, + const Anvil::BufferImageCopy* in_region_ptrs); /** Issues a vkCmdCopyImage() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -586,12 +586,12 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_copy_image(Anvil::Image* in_src_image_ptr, - Anvil::ImageLayout in_src_image_layout, - Anvil::Image* in_dst_image_ptr, - Anvil::ImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageCopy* in_region_ptrs); + bool record_copy_image(Anvil::Image* in_src_image_ptr, + Anvil::ImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + Anvil::ImageLayout in_dst_image_layout, + uint32_t in_region_count, + const Anvil::ImageCopy* in_region_ptrs); /** Issues a vkCmdCopyImageToBuffer() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -610,11 +610,11 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_copy_image_to_buffer(Anvil::Image* in_src_image_ptr, - Anvil::ImageLayout in_src_image_layout, - Anvil::Buffer* in_dst_buffer_ptr, - uint32_t in_region_count, - const VkBufferImageCopy* in_region_ptrs); + bool record_copy_image_to_buffer(Anvil::Image* in_src_image_ptr, + Anvil::ImageLayout in_src_image_layout, + Anvil::Buffer* in_dst_buffer_ptr, + uint32_t in_region_count, + const Anvil::BufferImageCopy* in_region_ptrs); /** Issues a vkCmdCopyQueryPoolResults() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -984,9 +984,9 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_pipeline_barrier(VkPipelineStageFlags in_src_stage_mask, - VkPipelineStageFlags in_dst_stage_mask, - VkBool32 in_by_region, + bool record_pipeline_barrier(Anvil::PipelineStageFlags in_src_stage_mask, + Anvil::PipelineStageFlags in_dst_stage_mask, + Anvil::DependencyFlags in_dependency_flags, uint32_t in_memory_barrier_count, const MemoryBarrier* const in_memory_barriers_ptr, uint32_t in_buffer_memory_barrier_count, @@ -1005,11 +1005,11 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_push_constants(Anvil::PipelineLayout* in_layout_ptr, - VkShaderStageFlags in_stage_flags, - uint32_t in_offset, - uint32_t in_size, - const void* in_values); + bool record_push_constants(Anvil::PipelineLayout* in_layout_ptr, + Anvil::ShaderStageFlags in_stage_flags, + uint32_t in_offset, + uint32_t in_size, + const void* in_values); /** Issues a vkCmdResetEvent() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -1028,8 +1028,8 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_reset_event(Anvil::Event* in_event_ptr, - VkPipelineStageFlags in_stage_mask); + bool record_reset_event(Anvil::Event* in_event_ptr, + Anvil::PipelineStageFlags in_stage_mask); /** Issues a vkCmdResetQueryPool() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -1066,12 +1066,12 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_resolve_image(Anvil::Image* in_src_image_ptr, - Anvil::ImageLayout in_src_image_layout, - Anvil::Image* in_dst_image_ptr, - Anvil::ImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageResolve* in_region_ptrs); + bool record_resolve_image(Anvil::Image* in_src_image_ptr, + Anvil::ImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + Anvil::ImageLayout in_dst_image_layout, + uint32_t in_region_count, + const Anvil::ImageResolve* in_region_ptrs); /** Issues a vkCmdSetBlendConstants() call and appends it to the internal vector of commands @@ -1148,8 +1148,8 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_set_event(Anvil::Event* in_event_ptr, - VkPipelineStageFlags in_stage_mask); + bool record_set_event(Anvil::Event* in_event_ptr, + Anvil::PipelineStageFlags in_stage_mask); /** Issues a vkCmdSetLineWidth() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -1190,8 +1190,8 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_set_stencil_compare_mask(VkStencilFaceFlags in_face_mask, - uint32_t in_stencil_compare_mask); + bool record_set_stencil_compare_mask(Anvil::StencilFaceFlags in_face_mask, + uint32_t in_stencil_compare_mask); /** Issues a vkCmdSetStencilReference() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -1204,8 +1204,8 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_set_stencil_reference(VkStencilFaceFlags in_face_mask, - uint32_t in_stencil_reference); + bool record_set_stencil_reference(Anvil::StencilFaceFlags in_face_mask, + uint32_t in_stencil_reference); /** Issues a vkCmdSetStencilWriteMask() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -1218,8 +1218,8 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_set_stencil_write_mask(VkStencilFaceFlags in_face_mask, - uint32_t in_stencil_write_mask); + bool record_set_stencil_write_mask(Anvil::StencilFaceFlags in_face_mask, + uint32_t in_stencil_write_mask); /** Issues a vkCmdSetViewport() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -1274,8 +1274,8 @@ namespace Anvil **/ bool record_wait_events(uint32_t in_event_count, Anvil::Event* const* in_event_ptrs, - VkPipelineStageFlags in_src_stage_mask, - VkPipelineStageFlags in_dst_stage_mask, + Anvil::PipelineStageFlags in_src_stage_mask, + Anvil::PipelineStageFlags in_dst_stage_mask, uint32_t in_memory_barrier_count, const MemoryBarrier* const in_memory_barriers_ptr, uint32_t in_buffer_memory_barrier_count, @@ -1297,9 +1297,9 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_write_timestamp(VkPipelineStageFlagBits in_pipeline_stage, - Anvil::QueryPool* in_query_pool_ptr, - Anvil::QueryIndex in_entry); + bool record_write_timestamp(Anvil::PipelineStageFlagBits in_pipeline_stage, + Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_entry); /** Resets the underlying Vulkan command buffer and clears the internally managed vector of * recorded commands, if STORE_COMMAND_BUFFER_COMMANDS has been defined for the build. @@ -1371,15 +1371,15 @@ namespace Anvil /** Holds all arguments passed to a vkCmdBeginQuery() command */ typedef struct BeginQueryCommand : public Command { - VkQueryControlFlagsVariable(flags); + Anvil::QueryControlFlags flags; Anvil::QueryIndex entry; Anvil::QueryPool* query_pool_ptr; /** Constructor. */ - explicit BeginQueryCommand(Anvil::QueryPool* in_query_pool_ptr, - Anvil::QueryIndex in_entry, - VkQueryControlFlags in_flags); + explicit BeginQueryCommand(Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_entry, + Anvil::QueryControlFlags in_flags); /** Destructor. */ virtual ~BeginQueryCommand() @@ -1395,10 +1395,10 @@ namespace Anvil std::vector dynamic_offsets; uint32_t first_set; Anvil::PipelineLayout* layout_ptr; - VkPipelineBindPoint pipeline_bind_point; + Anvil::PipelineBindPoint pipeline_bind_point; /** Constructor. **/ - explicit BindDescriptorSetsCommand(VkPipelineBindPoint in_pipeline_bind_point, + explicit BindDescriptorSetsCommand(Anvil::PipelineBindPoint in_pipeline_bind_point, Anvil::PipelineLayout* in_layout_ptr, uint32_t in_first_set, uint32_t in_set_count, @@ -1423,15 +1423,15 @@ namespace Anvil */ typedef struct BindIndexBufferCommand : public Command { - VkBuffer buffer; - Anvil::Buffer* buffer_ptr; - VkIndexType index_type; - VkDeviceSize offset; + VkBuffer buffer; + Anvil::Buffer* buffer_ptr; + Anvil::IndexType index_type; + VkDeviceSize offset; /** Constructor. **/ - explicit BindIndexBufferCommand(Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_offset, - VkIndexType in_index_type); + explicit BindIndexBufferCommand(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + Anvil::IndexType in_index_type); /** Destructor. */ virtual ~BindIndexBufferCommand() @@ -1447,8 +1447,8 @@ namespace Anvil /** Holds all arguments passed to a vkCmdBindPipeline() command. */ typedef struct BindPipelineCommand : public Command { - VkPipelineBindPoint pipeline_bind_point; - Anvil::PipelineID pipeline_id; + Anvil::PipelineBindPoint pipeline_bind_point; + Anvil::PipelineID pipeline_id; /** Constructor. * @@ -1458,8 +1458,8 @@ namespace Anvil * or a graphics pipeline ID, coming from the device-specific graphics pipeline * manager. The type of the pipeline is deduced from @param in_pipeline_bind_point. **/ - explicit BindPipelineCommand(VkPipelineBindPoint in_pipeline_bind_point, - Anvil::PipelineID in_pipeline_id); + explicit BindPipelineCommand(Anvil::PipelineBindPoint in_pipeline_bind_point, + Anvil::PipelineID in_pipeline_id); /* Destructor. */ virtual ~BindPipelineCommand() @@ -1523,17 +1523,17 @@ namespace Anvil Anvil::ImageLayout src_image_layout; Anvil::Image* src_image_ptr; - VkFilter filter; - std::vector regions; + Anvil::Filter filter; + std::vector regions; /** Constructor. */ - explicit BlitImageCommand(Anvil::Image* in_src_image_ptr, - Anvil::ImageLayout in_src_image_layout, - Anvil::Image* in_dst_image_ptr, - Anvil::ImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageBlit* in_region_ptrs, - VkFilter in_filter); + explicit BlitImageCommand(Anvil::Image* in_src_image_ptr, + Anvil::ImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + Anvil::ImageLayout in_dst_image_layout, + uint32_t in_region_count, + const Anvil::ImageBlit* in_region_ptrs, + Anvil::Filter in_filter); /** Destructor. */ virtual ~BlitImageCommand() @@ -1578,10 +1578,10 @@ namespace Anvil std::vector rects; /* Constructor. **/ - explicit ClearAttachmentsCommand(uint32_t in_n_attachments, - const VkClearAttachment* in_attachments, - uint32_t in_n_rects, - const VkClearRect* in_rect_ptrs); + explicit ClearAttachmentsCommand(uint32_t in_n_attachments, + const Anvil::ClearAttachment* in_attachments, + uint32_t in_n_rects, + const VkClearRect* in_rect_ptrs); /** Destructor. */ virtual ~ClearAttachmentsCommand() @@ -1594,18 +1594,18 @@ namespace Anvil /** Holds all arguments passed to a vkCmdClearColorImage() command. */ typedef struct ClearColorImageCommand : public Command { - VkClearColorValue color; - VkImage image; - Anvil::ImageLayout image_layout; - Anvil::Image* image_ptr; - std::vector ranges; + VkClearColorValue color; + VkImage image; + Anvil::ImageLayout image_layout; + Anvil::Image* image_ptr; + std::vector ranges; /** Constructor. **/ - explicit ClearColorImageCommand(Anvil::Image* in_image_ptr, - Anvil::ImageLayout in_image_layout, - const VkClearColorValue* in_color_ptr, - uint32_t in_range_count, - const VkImageSubresourceRange* in_range_ptrs); + explicit ClearColorImageCommand(Anvil::Image* in_image_ptr, + Anvil::ImageLayout in_image_layout, + const VkClearColorValue* in_color_ptr, + uint32_t in_range_count, + const Anvil::ImageSubresourceRange* in_range_ptrs); /** Destructor. */ virtual ~ClearColorImageCommand() @@ -1621,18 +1621,18 @@ namespace Anvil /** Holds all arguments passed to a vkCmdClearDepthStencilImage() command. */ typedef struct ClearDepthStencilImageCommand : public Command { - VkClearDepthStencilValue depth_stencil; - VkImage image; - Anvil::ImageLayout image_layout; - Anvil::Image* image_ptr; - std::vector ranges; + VkClearDepthStencilValue depth_stencil; + VkImage image; + Anvil::ImageLayout image_layout; + Anvil::Image* image_ptr; + std::vector ranges; /** Constructor. **/ - explicit ClearDepthStencilImageCommand(Anvil::Image* in_image_ptr, - Anvil::ImageLayout in_image_layout, - const VkClearDepthStencilValue* in_depth_stencil_ptr, - uint32_t in_range_count, - const VkImageSubresourceRange* in_range_ptrs); + explicit ClearDepthStencilImageCommand(Anvil::Image* in_image_ptr, + Anvil::ImageLayout in_image_layout, + const VkClearDepthStencilValue* in_depth_stencil_ptr, + uint32_t in_range_count, + const Anvil::ImageSubresourceRange* in_range_ptrs); /** Destructor. */ virtual ~ClearDepthStencilImageCommand() @@ -1647,17 +1647,17 @@ namespace Anvil /** Holds all arguments passed to a vkCmdCopyBuffer() command. */ typedef struct CopyBufferCommand : public Command { - VkBuffer dst_buffer; - Anvil::Buffer* dst_buffer_ptr; - std::vector regions; - VkBuffer src_buffer; - Anvil::Buffer* src_buffer_ptr; + VkBuffer dst_buffer; + Anvil::Buffer* dst_buffer_ptr; + std::vector regions; + VkBuffer src_buffer; + Anvil::Buffer* src_buffer_ptr; /** Constructor. **/ - explicit CopyBufferCommand(Anvil::Buffer* in_src_buffer_ptr, - Anvil::Buffer* in_dst_buffer_ptr, - uint32_t in_region_count, - const VkBufferCopy* in_region_ptrs); + explicit CopyBufferCommand(Anvil::Buffer* in_src_buffer_ptr, + Anvil::Buffer* in_dst_buffer_ptr, + uint32_t in_region_count, + const Anvil::BufferCopy* in_region_ptrs); /** Destructor. */ virtual ~CopyBufferCommand() @@ -1673,19 +1673,19 @@ namespace Anvil /** Holds all arguments passed to a vkCmdCopyBufferToImage() command. */ typedef struct CopyBufferToImageCommand : public Command { - VkImage dst_image; - Anvil::ImageLayout dst_image_layout; - Anvil::Image* dst_image_ptr; - std::vector regions; - VkBuffer src_buffer; - Anvil::Buffer* src_buffer_ptr; + VkImage dst_image; + Anvil::ImageLayout dst_image_layout; + Anvil::Image* dst_image_ptr; + std::vector regions; + VkBuffer src_buffer; + Anvil::Buffer* src_buffer_ptr; /** Constructor. **/ - explicit CopyBufferToImageCommand(Anvil::Buffer* in_src_buffer_ptr, - Anvil::Image* in_dst_image_ptr, - Anvil::ImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkBufferImageCopy* in_region_ptrs); + explicit CopyBufferToImageCommand(Anvil::Buffer* in_src_buffer_ptr, + Anvil::Image* in_dst_image_ptr, + Anvil::ImageLayout in_dst_image_layout, + uint32_t in_region_count, + const Anvil::BufferImageCopy* in_region_ptrs); /** Destructor. */ virtual ~CopyBufferToImageCommand() @@ -1702,21 +1702,21 @@ namespace Anvil /** Holds all arguments passed to a vkCmdCopyImage() command. */ typedef struct CopyImageCommand : public Command { - VkImage dst_image; - Anvil::Image* dst_image_ptr; - Anvil::ImageLayout dst_image_layout; - std::vector regions; - VkImage src_image; - Anvil::Image* src_image_ptr; - Anvil::ImageLayout src_image_layout; + VkImage dst_image; + Anvil::Image* dst_image_ptr; + Anvil::ImageLayout dst_image_layout; + std::vector regions; + VkImage src_image; + Anvil::Image* src_image_ptr; + Anvil::ImageLayout src_image_layout; /** Constructor. **/ - explicit CopyImageCommand(Anvil::Image* in_src_image_ptr, - Anvil::ImageLayout in_src_image_layout, - Anvil::Image* in_dst_image_ptr, - Anvil::ImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageCopy* in_region_ptrs); + explicit CopyImageCommand(Anvil::Image* in_src_image_ptr, + Anvil::ImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + Anvil::ImageLayout in_dst_image_layout, + uint32_t in_region_count, + const Anvil::ImageCopy* in_region_ptrs); /** Destructor. */ virtual ~CopyImageCommand() @@ -1732,19 +1732,19 @@ namespace Anvil /** Holds all arguments passed to a vkCmdCopyImageToBuffer() command. */ typedef struct CopyImageToBufferCommand : public Command { - VkBuffer dst_buffer; - Anvil::Buffer* dst_buffer_ptr; - std::vector regions; - VkImage src_image; - Anvil::ImageLayout src_image_layout; - Anvil::Image* src_image_ptr; + VkBuffer dst_buffer; + Anvil::Buffer* dst_buffer_ptr; + std::vector regions; + VkImage src_image; + Anvil::ImageLayout src_image_layout; + Anvil::Image* src_image_ptr; /** Constructor. **/ - explicit CopyImageToBufferCommand(Anvil::Image* in_src_image_ptr, - Anvil::ImageLayout in_src_image_layout, - Anvil::Buffer* in_dst_buffer_ptr, - uint32_t in_region_count, - const VkBufferImageCopy* in_region_ptrs); + explicit CopyImageToBufferCommand(Anvil::Image* in_src_image_ptr, + Anvil::ImageLayout in_src_image_layout, + Anvil::Buffer* in_dst_buffer_ptr, + uint32_t in_region_count, + const Anvil::BufferImageCopy* in_region_ptrs); /** Destructor. */ virtual ~CopyImageToBufferCommand() @@ -1760,7 +1760,7 @@ namespace Anvil /** Holds all arguments passed to a vkCmdCopyQueryPoolResults() command. */ typedef struct CopyQueryPoolResultsCommand : public Command { - VkQueryResultFlagsVariable(flags); + VkQueryResultFlags flags; VkBuffer dst_buffer; Anvil::Buffer* dst_buffer_ptr; @@ -2190,10 +2190,10 @@ namespace Anvil /** Holds all arguments passed to a vkCmdNextSubpass() command. */ typedef struct NextSubpassCommand : public Command { - VkSubpassContents contents; + Anvil::SubpassContents contents; /** Constructor. **/ - explicit NextSubpassCommand(VkSubpassContents in_contents); + explicit NextSubpassCommand(Anvil::SubpassContents in_contents); /** Destructor. */ virtual ~NextSubpassCommand() @@ -2206,7 +2206,7 @@ namespace Anvil /** Holds all arguments passed to a vkCmdPushConstants() command. */ typedef struct PushConstantsCommand : public Command { - VkShaderStageFlagsVariable(stage_flags); + Anvil::ShaderStageFlags stage_flags; Anvil::PipelineLayout* layout_ptr; uint32_t offset; @@ -2214,11 +2214,11 @@ namespace Anvil const void* values; /** Constructor. **/ - explicit PushConstantsCommand(Anvil::PipelineLayout* in_layout_ptr, - VkShaderStageFlags in_stage_flags, - uint32_t in_offset, - uint32_t in_size, - const void* in_values); + explicit PushConstantsCommand(Anvil::PipelineLayout* in_layout_ptr, + Anvil::ShaderStageFlags in_stage_flags, + uint32_t in_offset, + uint32_t in_size, + const void* in_values); /** Destructor. */ virtual ~PushConstantsCommand() @@ -2230,14 +2230,14 @@ namespace Anvil /** Holds all arguments passed to a vkCmdResetEvent() command. **/ typedef struct ResetEventCommand : public Command { - VkPipelineStageFlagsVariable(stage_mask); + Anvil::PipelineStageFlags stage_mask; VkEvent event; Anvil::Event* event_ptr; /** Constructor. **/ - explicit ResetEventCommand(Anvil::Event* in_event_ptr, - VkPipelineStageFlags in_stage_mask); + explicit ResetEventCommand(Anvil::Event* in_event_ptr, + Anvil::PipelineStageFlags in_stage_mask); /** Destructor. */ virtual ~ResetEventCommand() @@ -2273,21 +2273,21 @@ namespace Anvil /** Holds all arguments passed to a vkCmdResolveImage() command. **/ typedef struct ResolveImageCommand : public Command { - VkImage dst_image; - Anvil::Image* dst_image_ptr; - Anvil::ImageLayout dst_image_layout; - std::vector regions; - VkImage src_image; - Anvil::Image* src_image_ptr; - Anvil::ImageLayout src_image_layout; + VkImage dst_image; + Anvil::Image* dst_image_ptr; + Anvil::ImageLayout dst_image_layout; + std::vector regions; + VkImage src_image; + Anvil::Image* src_image_ptr; + Anvil::ImageLayout src_image_layout; /** Constructor. **/ - explicit ResolveImageCommand(Anvil::Image* in_src_image_ptr, - Anvil::ImageLayout in_src_image_layout, - Anvil::Image* in_dst_image_ptr, - Anvil::ImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageResolve* in_region_ptrs); + explicit ResolveImageCommand(Anvil::Image* in_src_image_ptr, + Anvil::ImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + Anvil::ImageLayout in_dst_image_layout, + uint32_t in_region_count, + const Anvil::ImageResolve* in_region_ptrs); /** Destructor. */ virtual ~ResolveImageCommand() @@ -2373,11 +2373,11 @@ namespace Anvil VkEvent event; Anvil::Event* event_ptr; - VkPipelineStageFlagsVariable(stage_mask); + Anvil::PipelineStageFlags stage_mask; /** Constructor. **/ - explicit SetEventCommand(Anvil::Event* in_event_ptr, - VkPipelineStageFlags in_stage_mask); + explicit SetEventCommand(Anvil::Event* in_event_ptr, + Anvil::PipelineStageFlags in_stage_mask); /** Destructor. */ virtual ~SetEventCommand() @@ -2428,13 +2428,13 @@ namespace Anvil /** Holds all arguments passed to a vkCmdSetStencilCompareMask() command. **/ typedef struct SetStencilCompareMaskCommand : public Command { - VkStencilFaceFlagsVariable(face_mask); + Anvil::StencilFaceFlags face_mask; uint32_t stencil_compare_mask; /** Constructor. **/ - explicit SetStencilCompareMaskCommand(VkStencilFaceFlags in_face_mask, - uint32_t in_stencil_compare_mask); + explicit SetStencilCompareMaskCommand(Anvil::StencilFaceFlags in_face_mask, + uint32_t in_stencil_compare_mask); /** Destructor. */ virtual ~SetStencilCompareMaskCommand() @@ -2447,13 +2447,13 @@ namespace Anvil /** Holds all arguments passed to a vkCmdSetStencilReference() command. **/ typedef struct SetStencilReferenceCommand : public Command { - VkStencilFaceFlagsVariable(face_mask); + Anvil::StencilFaceFlags face_mask; uint32_t stencil_reference; /** Constructor. **/ - explicit SetStencilReferenceCommand(VkStencilFaceFlags in_face_mask, - uint32_t in_stencil_reference); + explicit SetStencilReferenceCommand(Anvil::StencilFaceFlags in_face_mask, + uint32_t in_stencil_reference); /** Destructor. */ virtual ~SetStencilReferenceCommand() @@ -2466,13 +2466,13 @@ namespace Anvil /** Holds all arguments passed to a vkCmdSetStencilWriteMask() command. **/ typedef struct SetStencilWriteMaskCommand : public Command { - VkStencilFaceFlagsVariable(face_mask); + Anvil::StencilFaceFlags face_mask; uint32_t stencil_write_mask; /** Constructor. **/ - explicit SetStencilWriteMaskCommand(VkStencilFaceFlags in_face_mask, - uint32_t in_stencil_write_mask); + explicit SetStencilWriteMaskCommand(Anvil::StencilFaceFlags in_face_mask, + uint32_t in_stencil_write_mask); /** Destructor. */ virtual ~SetStencilWriteMaskCommand() @@ -2528,8 +2528,8 @@ namespace Anvil /** Holds all arguments passed to a vkCmdWaitEvents() command. **/ typedef struct WaitEventsCommand : public Command { - VkPipelineStageFlagsVariable(dst_stage_mask); - VkPipelineStageFlagsVariable(src_stage_mask); + Anvil::PipelineStageFlags dst_stage_mask; + Anvil::PipelineStageFlags src_stage_mask; std::vector buffer_barriers; std::vector image_barriers; @@ -2541,8 +2541,8 @@ namespace Anvil /** Constructor **/ explicit WaitEventsCommand(uint32_t in_event_count, Anvil::Event* const* in_event_ptrs, - VkPipelineStageFlags in_src_stage_mask, - VkPipelineStageFlags in_dst_stage_mask, + Anvil::PipelineStageFlags in_src_stage_mask, + Anvil::PipelineStageFlags in_dst_stage_mask, uint32_t in_memory_barrier_count, const MemoryBarrier* const in_memory_barrier_ptr_ptr, uint32_t in_buffer_memory_barrier_count, @@ -2564,15 +2564,15 @@ namespace Anvil /** Holds all arguments passed to a vkCmdWriteTimestamp() command. **/ typedef struct WriteTimestampCommand : public Command { - VkPipelineStageFlagsVariable(pipeline_stage); + Anvil::PipelineStageFlagBits pipeline_stage; Anvil::QueryIndex entry; Anvil::QueryPool* query_pool_ptr; /** Constructor. **/ - explicit WriteTimestampCommand(VkPipelineStageFlagBits in_pipeline_stage, - Anvil::QueryPool* in_query_pool_ptr, - Anvil::QueryIndex in_entry); + explicit WriteTimestampCommand(Anvil::PipelineStageFlagBits in_pipeline_stage, + Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_entry); /** Destructor. */ virtual ~WriteTimestampCommand() @@ -2655,12 +2655,12 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_begin_render_pass(uint32_t in_n_clear_values, - const VkClearValue* in_clear_value_ptrs, - Anvil::Framebuffer* in_fbo_ptr, - VkRect2D in_render_area, - Anvil::RenderPass* in_render_pass_ptr, - VkSubpassContents in_contents); + bool record_begin_render_pass(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + VkRect2D in_render_area, + Anvil::RenderPass* in_render_pass_ptr, + Anvil::SubpassContents in_contents); /** See documentation for the other record_begin_render_pass() function prototype for general * information about this function. @@ -2676,7 +2676,7 @@ namespace Anvil const Anvil::PhysicalDevice* const* in_physical_devices, const VkRect2D* in_render_areas, Anvil::RenderPass* in_render_pass_ptr, - VkSubpassContents in_contents); + Anvil::SubpassContents in_contents); /** Issues a vkCmdEndRenderPass() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -2719,7 +2719,7 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool record_next_subpass(VkSubpassContents in_contents); + bool record_next_subpass(Anvil::SubpassContents in_contents); /** Issues a vkBeginCommandBufer() call and clears the internally managed vector of recorded * commands, if STORE_COMMAND_BUFFER_COMMANDS has been defined for the build. @@ -2794,16 +2794,16 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool start_recording(bool in_one_time_submit, - bool in_simultaneous_use_allowed, - bool in_renderpass_usage_only, - Framebuffer* in_framebuffer_ptr, - RenderPass* in_render_pass_ptr, - SubPassID in_subpass_id, - OcclusionQuerySupportScope in_required_occlusion_query_support_scope, - bool in_occlusion_query_used_by_primary_command_buffer, - VkQueryPipelineStatisticFlags in_required_pipeline_statistics_scope, - uint32_t in_opt_device_mask = UINT32_MAX); + bool start_recording(bool in_one_time_submit, + bool in_simultaneous_use_allowed, + bool in_renderpass_usage_only, + Framebuffer* in_framebuffer_ptr, + RenderPass* in_render_pass_ptr, + SubPassID in_subpass_id, + OcclusionQuerySupportScope in_required_occlusion_query_support_scope, + bool in_occlusion_query_used_by_primary_command_buffer, + Anvil::QueryPipelineStatisticFlags in_required_pipeline_statistics_scope, + uint32_t in_opt_device_mask = UINT32_MAX); /* Destructor */ virtual ~SecondaryCommandBuffer() diff --git a/include/wrappers/command_pool.h b/include/wrappers/command_pool.h index 1fe6375e..ab0cadac 100644 --- a/include/wrappers/command_pool.h +++ b/include/wrappers/command_pool.h @@ -77,7 +77,7 @@ namespace Anvil bool in_transient_allocations_friendly, bool in_support_per_cmdbuf_reset_ops, uint32_t in_queue_family_index, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + MTSafety in_mt_safety = MTSafety::INHERIT_FROM_PARENT_DEVICE); /** Retrieves the raw Vulkan handle for the encapsulated command pool */ VkCommandPool get_command_pool() const diff --git a/include/wrappers/descriptor_pool.h b/include/wrappers/descriptor_pool.h index 0c169e75..a6cb7000 100644 --- a/include/wrappers/descriptor_pool.h +++ b/include/wrappers/descriptor_pool.h @@ -66,11 +66,11 @@ namespace Anvil * slots for in the pool. Exactly VK_DESCRIPTOR_TYPE_RANGE_SIZE uint32s will be read * from the array. Must not be null. **/ - static DescriptorPoolUniquePtr create(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_n_max_sets, - const DescriptorPoolFlags& in_flags, - const uint32_t* in_descriptor_count_per_type_ptr, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static DescriptorPoolUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_n_max_sets, + const Anvil::DescriptorPoolCreateFlags& in_flags, + const uint32_t* in_descriptor_count_per_type_ptr, + MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE); /** Destructor. Releases the Vulkan pool object if instantiated. */ virtual ~DescriptorPool(); @@ -102,7 +102,7 @@ namespace Anvil VkDescriptorSet* out_descriptor_sets_vk_ptr, VkResult* out_opt_result_ptr = nullptr); - const Anvil::DescriptorPoolFlags& get_flags() const + const Anvil::DescriptorPoolCreateFlags& get_flags() const { return m_flags; } @@ -135,11 +135,11 @@ namespace Anvil bool init(); /** Constructor */ - DescriptorPool(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_n_max_sets, - const DescriptorPoolFlags& in_flags, - const uint32_t* in_descriptor_count_per_type_ptr, - bool in_mt_safe); + DescriptorPool(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_n_max_sets, + const Anvil::DescriptorPoolCreateFlags& in_flags, + const uint32_t* in_descriptor_count_per_type_ptr, + bool in_mt_safe); DescriptorPool (const DescriptorPool&); DescriptorPool& operator=(const DescriptorPool&); @@ -151,9 +151,9 @@ namespace Anvil uint32_t m_descriptor_count[VK_DESCRIPTOR_TYPE_RANGE_SIZE]; uint32_t m_n_max_sets; - std::vector m_ds_cache; - std::vector m_ds_layout_cache; - const DescriptorPoolFlags m_flags; + std::vector m_ds_cache; + std::vector m_ds_layout_cache; + const Anvil::DescriptorPoolCreateFlags m_flags; }; }; /* namespace Anvil */ diff --git a/include/wrappers/descriptor_set.h b/include/wrappers/descriptor_set.h index 93c9265e..14e106cb 100644 --- a/include/wrappers/descriptor_set.h +++ b/include/wrappers/descriptor_set.h @@ -73,7 +73,7 @@ namespace Anvil BufferBindingElement(const BufferBindingElement& in); /* Returns Vulkan descriptor type for this structure */ - virtual VkDescriptorType get_type() const = 0; + virtual Anvil::DescriptorType get_type() const = 0; private: BufferBindingElement& operator=(const BufferBindingElement& in); @@ -102,9 +102,9 @@ namespace Anvil /* Stub */ } - VkDescriptorType get_type() const + Anvil::DescriptorType get_type() const { - return VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC; + return Anvil::DescriptorType::STORAGE_BUFFER_DYNAMIC; } }; @@ -131,9 +131,9 @@ namespace Anvil /* Stub */ } - VkDescriptorType get_type() const + Anvil::DescriptorType get_type() const { - return VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC; + return Anvil::DescriptorType::UNIFORM_BUFFER_DYNAMIC; } }; @@ -160,9 +160,9 @@ namespace Anvil /* Stub */ } - VkDescriptorType get_type() const + Anvil::DescriptorType get_type() const { - return VK_DESCRIPTOR_TYPE_STORAGE_BUFFER; + return Anvil::DescriptorType::STORAGE_BUFFER; } }; @@ -189,9 +189,9 @@ namespace Anvil /* Stub */ } - VkDescriptorType get_type() const + Anvil::DescriptorType get_type() const { - return VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER; + return Anvil::DescriptorType::UNIFORM_BUFFER; } }; @@ -229,9 +229,9 @@ namespace Anvil CombinedImageSamplerBindingElement(const CombinedImageSamplerBindingElement& in); /* Returns Vulkan descriptor type for this structure */ - VkDescriptorType get_type() const + Anvil::DescriptorType get_type() const { - return VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; + return Anvil::DescriptorType::COMBINED_IMAGE_SAMPLER; } private: @@ -265,7 +265,7 @@ namespace Anvil ~ImageBindingElement(); /* Returns Vulkan descriptor type for this structure */ - virtual VkDescriptorType get_type() const = 0; + virtual Anvil::DescriptorType get_type() const = 0; private: ImageBindingElement& operator=(const ImageBindingElement&); @@ -286,9 +286,9 @@ namespace Anvil /* Stub */ } - VkDescriptorType get_type() const + Anvil::DescriptorType get_type() const { - return VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT; + return Anvil::DescriptorType::INPUT_ATTACHMENT; } }; @@ -307,9 +307,9 @@ namespace Anvil /* Stub */ } - VkDescriptorType get_type() const + Anvil::DescriptorType get_type() const { - return VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE; + return Anvil::DescriptorType::SAMPLED_IMAGE; } }; @@ -328,9 +328,9 @@ namespace Anvil /* Stub */ } - VkDescriptorType get_type() const + Anvil::DescriptorType get_type() const { - return VK_DESCRIPTOR_TYPE_STORAGE_IMAGE; + return Anvil::DescriptorType::STORAGE_IMAGE; } }; @@ -360,9 +360,9 @@ namespace Anvil SamplerBindingElement(const SamplerBindingElement& in); /* Returns Vulkan descriptor type for this structure */ - VkDescriptorType get_type() const + Anvil::DescriptorType get_type() const { - return VK_DESCRIPTOR_TYPE_SAMPLER; + return Anvil::DescriptorType::SAMPLER; } private: @@ -394,7 +394,7 @@ namespace Anvil TexelBufferBindingElement(const TexelBufferBindingElement& in); /* Returns Vulkan descriptor type for this structure */ - virtual VkDescriptorType get_type() const = 0; + virtual Anvil::DescriptorType get_type() const = 0; private: TexelBufferBindingElement& operator=(const TexelBufferBindingElement&); @@ -413,9 +413,9 @@ namespace Anvil /* Stub */ } - VkDescriptorType get_type() const + Anvil::DescriptorType get_type() const { - return VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER; + return Anvil::DescriptorType::STORAGE_TEXEL_BUFFER; } }; @@ -432,9 +432,9 @@ namespace Anvil /* Stub */ } - VkDescriptorType get_type() const + Anvil::DescriptorType get_type() const { - return VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER; + return Anvil::DescriptorType::UNIFORM_TEXEL_BUFFER; } }; @@ -742,7 +742,7 @@ namespace Anvil * * @return true if the function executed successfully, false otherwise. **/ - bool update(const DescriptorSetUpdateMethod& in_update_method = DESCRIPTOR_SET_UPDATE_METHOD_CORE) const; + bool update(const DescriptorSetUpdateMethod& in_update_method = Anvil::DescriptorSetUpdateMethod::CORE) const; private: /* Private type declarations */ @@ -754,14 +754,14 @@ namespace Anvil **/ typedef struct BindingItem { - Anvil::Buffer* buffer_ptr; - Anvil::BufferView* buffer_view_ptr; - Anvil::ImageLayout image_layout; - Anvil::ImageView* image_view_ptr; - Anvil::Sampler* sampler_ptr; - VkDeviceSize size; - VkDeviceSize start_offset; - VkDescriptorType type_vk; + Anvil::Buffer* buffer_ptr; + Anvil::BufferView* buffer_view_ptr; + Anvil::ImageLayout image_layout; + Anvil::ImageView* image_view_ptr; + Anvil::Sampler* sampler_ptr; + VkDeviceSize size; + VkDeviceSize start_offset; + Anvil::DescriptorType type_vk; bool dirty; @@ -869,7 +869,7 @@ namespace Anvil Anvil::DescriptorPool* in_parent_pool_ptr, const Anvil::DescriptorSetLayout* in_layout_ptr, VkDescriptorSet in_descriptor_set, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE); DescriptorSet (const DescriptorSet&); DescriptorSet& operator=(const DescriptorSet&); diff --git a/include/wrappers/descriptor_set_group.h b/include/wrappers/descriptor_set_group.h index 627d874b..a569d079 100644 --- a/include/wrappers/descriptor_set_group.h +++ b/include/wrappers/descriptor_set_group.h @@ -61,17 +61,17 @@ namespace Anvil { typedef struct OverheadAllocation { - VkDescriptorType descriptor_type; - uint32_t n_overhead_allocations; + Anvil::DescriptorType descriptor_type; + uint32_t n_overhead_allocations; OverheadAllocation() { - descriptor_type = VK_DESCRIPTOR_TYPE_MAX_ENUM; + descriptor_type = Anvil::DescriptorType::UNKNOWN; n_overhead_allocations = UINT32_MAX; } - OverheadAllocation(VkDescriptorType in_descriptor_type, - uint32_t in_n_overhead_allocations) + OverheadAllocation(Anvil::DescriptorType in_descriptor_type, + uint32_t in_n_overhead_allocations) { descriptor_type = in_descriptor_type; n_overhead_allocations = in_n_overhead_allocations; @@ -105,9 +105,9 @@ namespace Anvil static Anvil::DescriptorSetGroupUniquePtr create(const Anvil::BaseDevice* in_device_ptr, std::vector& in_ds_create_info_ptrs, bool in_releaseable_sets, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE, const std::vector& in_opt_overhead_allocations = std::vector(), - const Anvil::DescriptorPoolFlags& in_opt_pool_extra_flags = 0); + const Anvil::DescriptorPoolCreateFlags& in_opt_pool_extra_flags = Anvil::DescriptorPoolCreateFlagBits::NONE); /** Creates a new DescriptorSetGroup instance. * @@ -275,9 +275,9 @@ namespace Anvil DescriptorSetGroup(const Anvil::BaseDevice* in_device_ptr, std::vector in_ds_create_info_ptrs, bool in_releaseable_sets, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, + MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE, const std::vector& in_opt_overhead_allocations = std::vector(), - const Anvil::DescriptorPoolFlags& in_opt_pool_extra_flags = 0 ); + const Anvil::DescriptorPoolCreateFlags& in_opt_pool_extra_flags = Anvil::DescriptorPoolCreateFlagBits::NONE); /** Please see create() documentation for more details. */ DescriptorSetGroup(const DescriptorSetGroup* in_parent_dsg_ptr, @@ -294,10 +294,10 @@ namespace Anvil uint32_t m_overhead_allocations [VK_DESCRIPTOR_TYPE_RANGE_SIZE]; uint32_t m_pool_size_per_descriptor_type[VK_DESCRIPTOR_TYPE_RANGE_SIZE]; - uint32_t m_n_unique_dses; - const Anvil::DescriptorSetGroup* m_parent_dsg_ptr; - bool m_releaseable_sets; - const Anvil::DescriptorPoolFlags m_user_specified_pool_flags; + uint32_t m_n_unique_dses; + const Anvil::DescriptorSetGroup* m_parent_dsg_ptr; + bool m_releaseable_sets; + const Anvil::DescriptorPoolCreateFlags m_user_specified_pool_flags; ANVIL_DISABLE_ASSIGNMENT_OPERATOR(DescriptorSetGroup); ANVIL_DISABLE_COPY_CONSTRUCTOR(DescriptorSetGroup); diff --git a/include/wrappers/descriptor_set_layout.h b/include/wrappers/descriptor_set_layout.h index dca94d63..d4d87fdb 100644 --- a/include/wrappers/descriptor_set_layout.h +++ b/include/wrappers/descriptor_set_layout.h @@ -63,7 +63,7 @@ namespace Anvil **/ static DescriptorSetLayoutUniquePtr create(DescriptorSetCreateInfoUniquePtr in_ds_create_info_ptr, const Anvil::BaseDevice* in_device_ptr, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE); const Anvil::DescriptorSetCreateInfo* get_create_info() const { diff --git a/include/wrappers/descriptor_update_template.h b/include/wrappers/descriptor_update_template.h index d50b1ca6..c2b052e1 100644 --- a/include/wrappers/descriptor_update_template.h +++ b/include/wrappers/descriptor_update_template.h @@ -54,7 +54,7 @@ namespace Anvil static Anvil::DescriptorUpdateTemplateUniquePtr create_for_descriptor_set_updates(const Anvil::BaseDevice* in_device_ptr, const Anvil::DescriptorSetLayout* in_descriptor_set_layout_ptr, const std::vector& in_update_entries, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE) { return create_for_descriptor_set_updates(in_device_ptr, in_descriptor_set_layout_ptr, @@ -67,7 +67,7 @@ namespace Anvil const Anvil::DescriptorSetLayout* in_descriptor_set_layout_ptr, const Anvil::DescriptorUpdateTemplateEntry* in_update_entries_ptr, const uint32_t& in_n_update_entries, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE); /* Issues a MT-safe (if needed) vkUpdateDescriptorSetWithTeeplateKHR() call against the specified descriptor set. */ void update_descriptor_set(const Anvil::DescriptorSet* inout_ds_ptr, diff --git a/include/wrappers/device.h b/include/wrappers/device.h index 4d115510..ce744e43 100644 --- a/include/wrappers/device.h +++ b/include/wrappers/device.h @@ -390,19 +390,19 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - virtual bool get_physical_device_sparse_image_format_properties(Anvil::Format in_format, - Anvil::ImageType in_type, - Anvil::SampleCountFlagBits in_sample_count, - ImageUsageFlags in_usage, - Anvil::ImageTiling in_tiling, - std::vector& out_result) const = 0; + virtual bool get_physical_device_sparse_image_format_properties(Anvil::Format in_format, + Anvil::ImageType in_type, + Anvil::SampleCountFlagBits in_sample_count, + ImageUsageFlags in_usage, + Anvil::ImageTiling in_tiling, + std::vector& out_result) const = 0; /** Returns surface capabilities, as reported for physical device(s) which have been used to instantiate * this logical device instance. **/ - virtual bool get_physical_device_surface_capabilities(Anvil::RenderingSurface* in_surface_ptr, - VkSurfaceCapabilitiesKHR* out_result_ptr) const = 0; + virtual bool get_physical_device_surface_capabilities(Anvil::RenderingSurface* in_surface_ptr, + Anvil::SurfaceCapabilities* out_result_ptr) const = 0; /** Returns a pipeline cache, created specifically for this device. * @@ -500,8 +500,8 @@ namespace Anvil * * @return As per description **/ - Anvil::Queue* get_sparse_binding_queue(uint32_t in_n_queue, - VkQueueFlags in_opt_required_queue_flags = 0) const; + Anvil::Queue* get_sparse_binding_queue(uint32_t in_n_queue, + Anvil::QueueFlags in_opt_required_queue_flags = Anvil::QueueFlags() ) const; /* Tells which memory types can be specified when creating an external memory handle for a Win32 handle @param in_handle * @@ -511,15 +511,15 @@ namespace Anvil * @return true if successful, false otherwise. * * - * @param in_external_handle_type (Windows) must be either EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT or - * EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT. - * (Linux) must be EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT. + * @param in_external_handle_type (Windows) must be either Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_WIN32_BIT or + * Anvil::ExternalMemoryHandleTypeFlagBits::WIN32_KMT_BIT. + * (Linux) must be Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_FD_BIT. * @param out_supported_memory_type_bits_ptr Deref will be set to a set of bits where each index corresponds to support status * of a memory type with corresponding index. Must not be null. */ - bool get_memory_types_supported_for_external_handle(const Anvil::ExternalMemoryHandleTypeBit& in_external_handle_type, - ExternalHandleType in_handle, - uint32_t* out_supported_memory_type_bits) const; + bool get_memory_types_supported_for_external_handle(const Anvil::ExternalMemoryHandleTypeFlagBits& in_external_handle_type, + ExternalHandleType in_handle, + uint32_t* out_supported_memory_type_bits) const; /** Returns a Queue instance, corresponding to a transfer queue at index @param in_n_queue * @@ -758,7 +758,7 @@ namespace Anvil Anvil::SwapchainUniquePtr create_swapchain(Anvil::RenderingSurface* in_parent_surface_ptr, Anvil::Window* in_window_ptr, Anvil::Format in_image_format, - VkPresentModeKHR in_present_mode, + Anvil::PresentModeKHR in_present_mode, ImageUsageFlags in_usage, uint32_t in_n_swapchain_images); @@ -798,16 +798,16 @@ namespace Anvil const QueueFamilyInfoItems& get_physical_device_queue_families() const override; /** See documentation in BaseDevice for more details */ - bool get_physical_device_sparse_image_format_properties(Anvil::Format in_format, - Anvil::ImageType in_type, - Anvil::SampleCountFlagBits in_sample_count, - ImageUsageFlags in_usage, - Anvil::ImageTiling in_tiling, - std::vector& out_result) const override; + bool get_physical_device_sparse_image_format_properties(Anvil::Format in_format, + Anvil::ImageType in_type, + Anvil::SampleCountFlagBits in_sample_count, + ImageUsageFlags in_usage, + Anvil::ImageTiling in_tiling, + std::vector& out_result) const override; /** See documentation in BaseDevice for more details */ - bool get_physical_device_surface_capabilities(Anvil::RenderingSurface* in_surface_ptr, - VkSurfaceCapabilitiesKHR* out_result_ptr) const override; + bool get_physical_device_surface_capabilities(Anvil::RenderingSurface* in_surface_ptr, + Anvil::SurfaceCapabilities* out_result_ptr) const override; /** See documentation in BaseDevice for more details */ const Anvil::QueueFamilyInfo* get_queue_family_info(uint32_t in_queue_family_index) const override; @@ -815,7 +815,7 @@ namespace Anvil /* Tells what type this device instance is */ DeviceType get_type() const override { - return DEVICE_TYPE_SINGLE_GPU; + return Anvil::DeviceType::SINGLE_GPU; } protected: @@ -860,14 +860,14 @@ namespace Anvil bool in_mt_safe = false); /** TODO */ - Anvil::SwapchainUniquePtr create_swapchain(Anvil::RenderingSurface* in_parent_surface_ptr, - Anvil::Window* in_window_ptr, - Anvil::Format in_image_format, - VkPresentModeKHR in_present_mode, - ImageUsageFlags in_usage, - uint32_t in_n_swapchain_images, - bool in_support_SFR, - VkDeviceGroupPresentModeFlagsKHR in_presentation_modes_to_support = VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR); + Anvil::SwapchainUniquePtr create_swapchain(Anvil::RenderingSurface* in_parent_surface_ptr, + Anvil::Window* in_window_ptr, + Anvil::Format in_image_format, + Anvil::PresentModeKHR in_present_mode, + ImageUsageFlags in_usage, + uint32_t in_n_swapchain_images, + bool in_support_SFR, + Anvil::DeviceGroupPresentModeFlags in_presentation_modes_to_support = Anvil::DeviceGroupPresentModeFlagBits::LOCAL_BIT_KHR); /** TODO * @@ -921,16 +921,16 @@ namespace Anvil Anvil::SemaphoreProperties* out_opt_result_ptr = nullptr) const; /** TODO */ - bool get_physical_device_sparse_image_format_properties(Anvil::Format in_format, - Anvil::ImageType in_type, - Anvil::SampleCountFlagBits in_sample_count, - ImageUsageFlags in_usage, - Anvil::ImageTiling in_tiling, - std::vector& out_result) const override; + bool get_physical_device_sparse_image_format_properties(Anvil::Format in_format, + Anvil::ImageType in_type, + Anvil::SampleCountFlagBits in_sample_count, + ImageUsageFlags in_usage, + Anvil::ImageTiling in_tiling, + std::vector& out_result) const override; /** TODO */ - bool get_physical_device_surface_capabilities(Anvil::RenderingSurface* in_surface_ptr, - VkSurfaceCapabilitiesKHR* out_result_ptr) const override; + bool get_physical_device_surface_capabilities(Anvil::RenderingSurface* in_surface_ptr, + Anvil::SurfaceCapabilities* out_result_ptr) const override; /** Tells which physical devices can be parent to swapchain images that a physical device at device index @param in_device_index * can present. @@ -962,7 +962,7 @@ namespace Anvil const Anvil::QueueFamilyInfo* get_queue_family_info(uint32_t in_queue_family_index) const override; /** TODO */ - VkDeviceGroupPresentModeFlagsKHR get_supported_present_modes() const + Anvil::DeviceGroupPresentModeFlags get_supported_present_modes() const { return m_supported_present_modes; } @@ -972,12 +972,12 @@ namespace Anvil * Note: The value returned by this function is NOT guaranteed to be invariant. * */ - VkDeviceGroupPresentModeFlagsKHR get_supported_present_modes_for_surface(const Anvil::RenderingSurface* in_surface_ptr) const; + Anvil::DeviceGroupPresentModeFlags get_supported_present_modes_for_surface(const Anvil::RenderingSurface* in_surface_ptr) const; /* Tells what type this device instance is */ DeviceType get_type() const override { - return DEVICE_TYPE_MULTI_GPU; + return DeviceType::MULTI_GPU; } /* Tells whether this logical device is a part of a device group which supports subset allocations. */ @@ -1023,7 +1023,7 @@ namespace Anvil std::vector m_parent_physical_devices_vec; bool m_supports_subset_allocations; - VkDeviceGroupPresentModeFlagBitsKHRVariable(m_supported_present_modes); + Anvil::DeviceGroupPresentModeFlags m_supported_present_modes; }; }; /* namespace Anvil */ diff --git a/include/wrappers/fence.h b/include/wrappers/fence.h index 245e2982..00d2a972 100644 --- a/include/wrappers/fence.h +++ b/include/wrappers/fence.h @@ -66,7 +66,7 @@ namespace Anvil * Requires VK_KHR_external_fence_fd under Linux. * Requires VK_KHR_external_fence_win32 under Windows. */ - ExternalHandleUniquePtr export_to_external_handle(const Anvil::ExternalFenceHandleTypeBit& in_fence_handle_type); + ExternalHandleUniquePtr export_to_external_handle(const Anvil::ExternalFenceHandleTypeFlagBits& in_fence_handle_type); const Anvil::FenceCreateInfo* get_create_info_ptr() const { @@ -102,14 +102,14 @@ namespace Anvil * @param in_opt_name (Windows): Name of the handle to use. Must not be null if @param in_opt_handle is null and vice versa. */ #if defined(_WIN32) - bool import_from_external_handle(const bool& in_temporary_import, - const Anvil::ExternalFenceHandleTypeBit& in_handle_type, - const ExternalHandleType& in_opt_handle, - const std::wstring& in_opt_name); + bool import_from_external_handle(const bool& in_temporary_import, + const Anvil::ExternalFenceHandleTypeFlagBits& in_handle_type, + const ExternalHandleType& in_opt_handle, + const std::wstring& in_opt_name); #else - bool import_from_external_handle(const bool& in_temporary_import, - const Anvil::ExternalFenceHandleTypeBit& in_handle_type, - const ExternalHandleType& in_handle); + bool import_from_external_handle(const bool& in_temporary_import, + const Anvil::ExternalFenceHandleTypeFlagBits& in_handle_type, + const ExternalHandleType& in_handle); #endif /** Tells whether the fence is signalled at the time of the call. @@ -154,9 +154,9 @@ namespace Anvil void release_fence(); /* Private variables */ - Anvil::FenceCreateInfoUniquePtr m_create_info_ptr; - std::map m_external_fence_created_for_handle_type; - VkFence m_fence; + Anvil::FenceCreateInfoUniquePtr m_create_info_ptr; + std::map m_external_fence_created_for_handle_type; + VkFence m_fence; }; }; /* namespace Anvil */ diff --git a/include/wrappers/graphics_pipeline_manager.h b/include/wrappers/graphics_pipeline_manager.h index 3594ce49..69c024e1 100644 --- a/include/wrappers/graphics_pipeline_manager.h +++ b/include/wrappers/graphics_pipeline_manager.h @@ -37,7 +37,7 @@ * Depth bias: 0.0 * Depth bias clamp: 0.0 * Depth bias slope factor: 1.0 - * Depth test compare op: VK_COMPARE_OP_ALWAYS + * Depth test compare op: Anvil::CompareOp::ALWAYS * Depth writes: disabled * Dynamic states: all disabled * Fill mode: VK_FILL_MODE_SOLID @@ -53,7 +53,7 @@ * Sample mask: 0xFFFFFFFF * Slope scaled depth bias: 0.0 * Stencil comparison mask (back/front): 0xFFFFFFFF - * Stencil comparison op (back/front): VK_COMPARE_OP_ALWAYS + * Stencil comparison op (back/front): Anvil::CompareOp::ALWAYS * Stencil depth fail op (back/front): VK_STENCIL_OP_KEEP * Stencil fail op (back/front): VK_STENCIL_OP_KEEP * Stencil pass op (back/front): VK_STENCIL_OP_KEEP @@ -121,16 +121,16 @@ namespace Anvil typedef struct VertexInputBinding { - uint32_t binding; - uint32_t divisor; - VkVertexInputRate input_rate; - uint32_t stride; + uint32_t binding; + uint32_t divisor; + Anvil::VertexInputRate input_rate; + uint32_t stride; VertexInputBinding() { binding = 0; divisor = 0; - input_rate = VK_VERTEX_INPUT_RATE_MAX_ENUM; + input_rate = Anvil::VertexInputRate::UNKNOWN; stride = 0; } @@ -139,7 +139,7 @@ namespace Anvil { binding = in_binding_vk.binding; divisor = in_divisor; - input_rate = in_binding_vk.inputRate; + input_rate = static_cast(in_binding_vk.inputRate); stride = in_binding_vk.stride; } } VertexInputBinding; diff --git a/include/wrappers/image.h b/include/wrappers/image.h index 329d628e..379c3783 100644 --- a/include/wrappers/image.h +++ b/include/wrappers/image.h @@ -97,17 +97,17 @@ namespace Anvil * @param in_opt_set_semaphore_ptrs A raw array of semaphores to set upon finished execution of the image layout transfer command buffer. * May be null if @param in_opt_n_set_semaphores is 0. */ - void change_image_layout(Anvil::Queue* in_queue_ptr, - VkAccessFlags in_src_access_mask, - Anvil::ImageLayout in_src_layout, - VkAccessFlags in_dst_access_mask, - Anvil::ImageLayout in_dst_layout, - const VkImageSubresourceRange& in_subresource_range, - const uint32_t in_opt_n_wait_semaphores = 0, - const VkPipelineStageFlags* in_opt_wait_dst_stage_mask_ptrs = nullptr, - Anvil::Semaphore* const* in_opt_wait_semaphore_ptrs = nullptr, - const uint32_t in_opt_n_set_semaphores = 0, - Anvil::Semaphore* const* in_opt_set_semaphore_ptrs = nullptr); + void change_image_layout(Anvil::Queue* in_queue_ptr, + Anvil::AccessFlags in_src_access_mask, + Anvil::ImageLayout in_src_layout, + Anvil::AccessFlags in_dst_access_mask, + Anvil::ImageLayout in_dst_layout, + const Anvil::ImageSubresourceRange& in_subresource_range, + const uint32_t in_opt_n_wait_semaphores = 0, + const Anvil::PipelineStageFlags* in_opt_wait_dst_stage_mask_ptrs = nullptr, + Anvil::Semaphore* const* in_opt_wait_semaphore_ptrs = nullptr, + const uint32_t in_opt_n_set_semaphores = 0, + Anvil::Semaphore* const* in_opt_set_semaphore_ptrs = nullptr); /** Destructor */ @@ -120,10 +120,10 @@ namespace Anvil * NOTE: This information is cached at image creation time, so the driver's impl will not be * called. */ - bool get_aspect_subresource_layout(Anvil::ImageAspectFlags in_aspect, - uint32_t in_n_layer, - uint32_t in_n_mip, - VkSubresourceLayout* out_subresource_layout_ptr) const; + bool get_aspect_subresource_layout(Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_mip, + Anvil::SubresourceLayout* out_subresource_layout_ptr) const; const Anvil::ImageCreateInfo* get_create_info_ptr() const { @@ -244,7 +244,7 @@ namespace Anvil const Anvil::SparseImageAspectProperties** out_result_ptr_ptr) const; /** Returns a filled subresource range descriptor, covering all layers & mipmaps of the image */ - VkImageSubresourceRange get_subresource_range() const; + Anvil::ImageSubresourceRange get_subresource_range() const; /** Tells whether this image provides data for the specified image aspects. * @@ -252,7 +252,7 @@ namespace Anvil * * @return true if data for all specified aspects is provided by the image, false otherwise. */ - bool has_aspects(Anvil::ImageAspectFlags in_aspects) const; + bool has_aspects(const Anvil::ImageAspectFlags& in_aspects) const; /** Tells whether a physical memory page is assigned to the specified texel location. * @@ -533,7 +533,7 @@ namespace Anvil bool init (); void init_mipmap_props (); - void init_page_occupancy(const std::vector& in_memory_reqs); + void init_page_occupancy(const std::vector& in_memory_reqs); void init_sfr_tile_size (); bool set_memory_internal(uint32_t in_swapchain_image_index, @@ -552,19 +552,19 @@ namespace Anvil uint32_t in_n_SFR_rects, const VkRect2D* in_SFRs_ptr); - void on_memory_backing_update (const VkImageSubresource& in_subresource, - VkOffset3D in_offset, - VkExtent3D in_extent, - Anvil::MemoryBlock* in_memory_block_ptr, - VkDeviceSize in_memory_block_start_offset, - bool in_memory_block_owned_by_image); - void on_memory_backing_opaque_update(VkDeviceSize in_resource_offset, - VkDeviceSize in_size, - Anvil::MemoryBlock* in_memory_block_ptr, - VkDeviceSize in_memory_block_start_offset, - bool in_memory_block_owned_by_image); - - void transition_to_post_alloc_image_layout(VkAccessFlags in_src_access_mask, + void on_memory_backing_update (const Anvil::ImageSubresource& in_subresource, + VkOffset3D in_offset, + VkExtent3D in_extent, + Anvil::MemoryBlock* in_memory_block_ptr, + VkDeviceSize in_memory_block_start_offset, + bool in_memory_block_owned_by_image); + void on_memory_backing_opaque_update(VkDeviceSize in_resource_offset, + VkDeviceSize in_size, + Anvil::MemoryBlock* in_memory_block_ptr, + VkDeviceSize in_memory_block_start_offset, + bool in_memory_block_owned_by_image); + + void transition_to_post_alloc_image_layout(Anvil::AccessFlags in_src_access_mask, Anvil::ImageLayout in_src_layout); /** TODO. @@ -575,7 +575,7 @@ namespace Anvil /* Private members */ typedef std::pair LayerMipKey; - typedef std::map LayerMipToSubresourceLayoutMap; + typedef std::map LayerMipToSubresourceLayoutMap; typedef std::map AspectToLayerMipToSubresourceLayoutMap; VkDeviceSize m_alignment; diff --git a/include/wrappers/image_view.h b/include/wrappers/image_view.h index 242504c8..a4df4312 100644 --- a/include/wrappers/image_view.h +++ b/include/wrappers/image_view.h @@ -70,10 +70,9 @@ namespace Anvil return m_image_view; } - /** Returns a VkImageSubresourceRange struct that describes the range of subresources covered - * by this image view. + /** Returns a struct that describes the range of subresources covered by this image view. */ - VkImageSubresourceRange get_subresource_range() const; + Anvil::ImageSubresourceRange get_subresource_range() const; /** Tells whether the subresource range described by this image view intersects * with another image view's subres range. diff --git a/include/wrappers/memory_block.h b/include/wrappers/memory_block.h index f48cdd05..199d99fd 100644 --- a/include/wrappers/memory_block.h +++ b/include/wrappers/memory_block.h @@ -78,7 +78,7 @@ namespace Anvil * Requires VK_KHR_external_memory_fd under Linux. * Requires VK_KHR_external_memory_win32 under Windows. */ - ExternalHandleUniquePtr export_to_external_memory_handle(const Anvil::ExternalMemoryHandleTypeBit& in_memory_handle_type); + ExternalHandleUniquePtr export_to_external_memory_handle(const Anvil::ExternalMemoryHandleTypeFlagBits& in_memory_handle_type); /** Releases the Vulkan counterpart and unregisters the wrapper instance from the object tracker */ virtual ~MemoryBlock(); @@ -248,7 +248,7 @@ namespace Anvil std::shared_ptr m_owned_parent_memory_allocator_backend_ptr; Anvil::IMemoryAllocatorBackendBase* m_parent_memory_allocator_backend_ptr; - std::map m_external_handle_type_to_external_handle; + std::map m_external_handle_type_to_external_handle; }; }; /* Vulkan namespace */ diff --git a/include/wrappers/physical_device.h b/include/wrappers/physical_device.h index 8957cd70..472f3f02 100644 --- a/include/wrappers/physical_device.h +++ b/include/wrappers/physical_device.h @@ -177,12 +177,12 @@ namespace Anvil * * @return true if successful, false otherwise **/ - bool get_sparse_image_format_properties(Anvil::Format in_format, - Anvil::ImageType in_type, - Anvil::SampleCountFlagBits in_sample_count, - Anvil::ImageUsageFlags in_usage, - Anvil::ImageTiling in_tiling, - std::vector& out_result) const; + bool get_sparse_image_format_properties(Anvil::Format in_format, + Anvil::ImageType in_type, + Anvil::SampleCountFlagBits in_sample_count, + Anvil::ImageUsageFlags in_usage, + Anvil::ImageTiling in_tiling, + std::vector& out_result) const; /** Tells whether user-specified extension is supported by the physical device. * diff --git a/include/wrappers/query_pool.h b/include/wrappers/query_pool.h index 177c11c9..2c4ec7d1 100644 --- a/include/wrappers/query_pool.h +++ b/include/wrappers/query_pool.h @@ -55,7 +55,7 @@ namespace Anvil static Anvil::QueryPoolUniquePtr create_non_ps_query_pool(const Anvil::BaseDevice* in_device_ptr, VkQueryType in_query_type, uint32_t in_n_max_concurrent_queries, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE); /** Creates a new pipeline statistics query pool. * @@ -67,10 +67,10 @@ namespace Anvil * @param in_n_max_concurrent_queries Number of queries to preallocate in the pool. * **/ - static Anvil::QueryPoolUniquePtr create_ps_query_pool(const Anvil::BaseDevice* in_device_ptr, - VkQueryPipelineStatisticFlags in_pipeline_statistics, - uint32_t in_n_max_concurrent_queries, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + static Anvil::QueryPoolUniquePtr create_ps_query_pool(const Anvil::BaseDevice* in_device_ptr, + Anvil::QueryPipelineStatisticFlags in_pipeline_statistics, + uint32_t in_n_max_concurrent_queries, + MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE); /** Destructor */ virtual ~QueryPool(); @@ -97,11 +97,11 @@ namespace Anvil * the results returned by this entrypoint are correct. * **/ - bool get_query_pool_results(const uint32_t& in_first_query_index, - const uint32_t& in_n_queries, - const QueryResultBits& in_query_props, - uint32_t* out_results_ptr, - bool* out_all_query_results_retrieved_ptr) + bool get_query_pool_results(const uint32_t& in_first_query_index, + const uint32_t& in_n_queries, + const Anvil::QueryResultFlags& in_query_props, + uint32_t* out_results_ptr, + bool* out_all_query_results_retrieved_ptr) { return get_query_pool_results_internal(in_first_query_index, in_n_queries, @@ -111,11 +111,11 @@ namespace Anvil out_all_query_results_retrieved_ptr); } - bool get_query_pool_results(const uint32_t& in_first_query_index, - const uint32_t& in_n_queries, - const QueryResultBits& in_query_props, - uint64_t* out_results_ptr, - bool* out_all_query_results_retrieved_ptr) + bool get_query_pool_results(const uint32_t& in_first_query_index, + const uint32_t& in_n_queries, + const Anvil::QueryResultFlags& in_query_props, + uint64_t* out_results_ptr, + bool* out_all_query_results_retrieved_ptr) { return get_query_pool_results_internal(in_first_query_index, in_n_queries, @@ -133,18 +133,18 @@ namespace Anvil bool in_mt_safe); /* Constructor. Please see corresponding create() for specification */ - explicit QueryPool(const Anvil::BaseDevice* in_device_ptr, - VkQueryType in_query_type, - VkFlags in_query_flags, - uint32_t in_n_max_concurrent_queries, - bool in_mt_safe); - - bool get_query_pool_results_internal(const uint32_t& in_first_query_index, - const uint32_t& in_n_queries, - const QueryResultBits& in_query_props, - const bool& in_should_return_uint64, - void* out_results_ptr, - bool* out_all_query_results_retrieved_ptr); + explicit QueryPool(const Anvil::BaseDevice* in_device_ptr, + VkQueryType in_query_type, + Anvil::QueryPipelineStatisticFlags in_pipeline_statistics, + uint32_t in_n_max_concurrent_queries, + bool in_mt_safe); + + bool get_query_pool_results_internal(const uint32_t& in_first_query_index, + const uint32_t& in_n_queries, + const Anvil::QueryResultFlags& in_query_props, + const bool& in_should_return_uint64, + void* out_results_ptr, + bool* out_all_query_results_retrieved_ptr); /** Initializes the Vulkan counterpart. * @@ -153,9 +153,9 @@ namespace Anvil * @param in_n_max_concurrent_queries Maximum number of queries which can be used concurrently with * the query pool. **/ - void init(VkQueryType in_query_type, - VkFlags in_flags, - uint32_t in_n_max_concurrent_queries); + void init(VkQueryType in_query_type, + Anvil::QueryPipelineStatisticFlags in_pipeline_statistics, + uint32_t in_n_max_concurrent_queries); /* Private variables */ const Anvil::BaseDevice* m_device_ptr; diff --git a/include/wrappers/queue.h b/include/wrappers/queue.h index f1910bc7..6d809d4b 100644 --- a/include/wrappers/queue.h +++ b/include/wrappers/queue.h @@ -247,18 +247,18 @@ namespace Anvil private: /* Private functions */ - VkResult present_internal (VkDeviceGroupPresentModeFlagBitsKHR in_presentation_mode, - uint32_t in_n_swapchains, - Anvil::Swapchain* const* in_swapchains, - const uint32_t* in_swapchain_image_indices, - const uint32_t* in_device_masks, - uint32_t in_n_wait_semaphores, - Anvil::Semaphore* const* in_wait_semaphore_ptrs); - void present_lock_unlock(uint32_t in_n_swapchains, - const Anvil::Swapchain* const* in_swapchains, - uint32_t in_n_wait_semaphores, - Anvil::Semaphore* const* in_wait_semaphore_ptrs, - bool in_should_lock); + VkResult present_internal (Anvil::DeviceGroupPresentModeFlagBits in_presentation_mode, + uint32_t in_n_swapchains, + Anvil::Swapchain* const* in_swapchains, + const uint32_t* in_swapchain_image_indices, + const uint32_t* in_device_masks, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs); + void present_lock_unlock(uint32_t in_n_swapchains, + const Anvil::Swapchain* const* in_swapchains, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs, + bool in_should_lock); void bind_sparse_memory_lock_unlock (Anvil::SparseMemoryBindingUpdateInfo& in_update, bool in_should_lock); diff --git a/include/wrappers/rendering_surface.h b/include/wrappers/rendering_surface.h index c961e309..086613f8 100644 --- a/include/wrappers/rendering_surface.h +++ b/include/wrappers/rendering_surface.h @@ -78,7 +78,7 @@ namespace Anvil static Anvil::RenderingSurfaceUniquePtr create(Anvil::Instance* in_instance_ptr, const Anvil::BaseDevice* in_device_ptr, const Anvil::Window* in_window_ptr, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE); /** Destructor * @@ -89,7 +89,7 @@ namespace Anvil /** Returns rendering surface capabilities */ bool get_capabilities(const Anvil::PhysicalDevice* in_physical_device_ptr, - VkSurfaceCapabilitiesKHR* out_surface_caps_ptr) const; + Anvil::SurfaceCapabilities* out_surface_caps_ptr) const; /** Returns rendering surface's height */ uint32_t get_height() const @@ -111,11 +111,11 @@ namespace Anvil /** Returns composite alpha modes supported by the rendering surface */ bool get_supported_composite_alpha_flags(const Anvil::PhysicalDevice* in_physical_device_ptr, - VkCompositeAlphaFlagsKHR* out_result_ptr) const; + Anvil::CompositeAlphaFlags* out_result_ptr) const; /** Returns transformations supported by the rendering surface */ - bool get_supported_transformations(const Anvil::PhysicalDevice* in_physical_device_ptr, - VkSurfaceTransformFlagsKHR* out_result_ptr) const; + bool get_supported_transformations(const Anvil::PhysicalDevice* in_physical_device_ptr, + Anvil::SurfaceTransformFlags* out_result_ptr) const; /** Returns flags corresponding to image usage supported by the rendering surface */ bool get_supported_usages(const Anvil::PhysicalDevice* in_physical_device_ptr, @@ -149,7 +149,7 @@ namespace Anvil /* Tells whether the specified presentation mode is supported by the rendering surface */ bool supports_presentation_mode(const Anvil::PhysicalDevice* in_physical_device_ptr, - VkPresentModeKHR in_presentation_mode, + Anvil::PresentModeKHR in_presentation_mode, bool* out_result_ptr) const; private: @@ -158,15 +158,15 @@ namespace Anvil typedef struct PhysicalDeviceCapabilities { - VkSurfaceCapabilitiesKHR capabilities; + Anvil::SurfaceCapabilities capabilities; std::vector supported_formats; - std::vector supported_presentation_modes; + std::vector supported_presentation_modes; + Anvil::SurfaceTransformFlags supported_transformations; ImageUsageFlags supported_usages; std::vector present_capable_queue_fams; - VkCompositeAlphaFlagsKHRVariable (supported_composite_alpha_flags); - VkSurfaceTransformFlagsKHRVariable(supported_transformations); + Anvil::CompositeAlphaFlags supported_composite_alpha_flags; PhysicalDeviceCapabilities() { diff --git a/include/wrappers/semaphore.h b/include/wrappers/semaphore.h index 7436506b..59bd3fc2 100644 --- a/include/wrappers/semaphore.h +++ b/include/wrappers/semaphore.h @@ -57,7 +57,7 @@ namespace Anvil * Requires VK_KHR_external_semaphore_fd under Linux. * Requires VK_KHR_external_semaphore_win32 under Windows. */ - ExternalHandleUniquePtr export_to_external_handle(const Anvil::ExternalSemaphoreHandleTypeBit& in_semaphore_handle_type); + ExternalHandleUniquePtr export_to_external_handle(const Anvil::ExternalSemaphoreHandleTypeFlagBits& in_semaphore_handle_type); /** Destructor. * @@ -99,14 +99,14 @@ namespace Anvil * @param in_opt_name (Windows): Name of the handle to use. Must not be null if @param in_opt_handle is null and vice versa. */ #if defined(_WIN32) - bool import_from_external_handle(const bool& in_temporary_import, - const Anvil::ExternalSemaphoreHandleTypeBit& in_handle_type, - const ExternalHandleType& in_opt_handle, - const std::wstring& in_opt_name); + bool import_from_external_handle(const bool& in_temporary_import, + const Anvil::ExternalSemaphoreHandleTypeFlagBits& in_handle_type, + const ExternalHandleType& in_opt_handle, + const std::wstring& in_opt_name); #else - bool import_from_external_handle(const bool& in_temporary_import, - const Anvil::ExternalSemaphoreHandleTypeBit& in_handle_type, - const ExternalHandleType& in_handle); + bool import_from_external_handle(const bool& in_temporary_import, + const Anvil::ExternalSemaphoreHandleTypeFlagBits& in_handle_type, + const ExternalHandleType& in_handle); #endif /** Releases the underlying Vulkan Semaphore instance and creates a new Vulkan object. */ @@ -122,9 +122,9 @@ namespace Anvil void release_semaphore(); /* Private variables */ - Anvil::SemaphoreCreateInfoUniquePtr m_create_info_ptr; - std::map m_external_semaphore_created_for_handle_type; - VkSemaphore m_semaphore; + Anvil::SemaphoreCreateInfoUniquePtr m_create_info_ptr; + std::map m_external_semaphore_created_for_handle_type; + VkSemaphore m_semaphore; ANVIL_DISABLE_ASSIGNMENT_OPERATOR(Semaphore); ANVIL_DISABLE_COPY_CONSTRUCTOR(Semaphore); diff --git a/include/wrappers/shader_module.h b/include/wrappers/shader_module.h index 8b976978..4d54ccf5 100644 --- a/include/wrappers/shader_module.h +++ b/include/wrappers/shader_module.h @@ -56,7 +56,7 @@ namespace Anvil **/ static ShaderModuleUniquePtr create_from_spirv_generator(const Anvil::BaseDevice* in_device_ptr, GLSLShaderToSPIRVGenerator* in_spirv_generator_ptr, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE); /** Creates a new shader module instance from a raw SPIR-V blob. * @@ -88,7 +88,7 @@ namespace Anvil const char* in_opt_tc_entrypoint_name, const char* in_opt_te_entrypoint_name, const char* in_opt_vs_entrypoint_name, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE); + MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE); static ShaderModuleUniquePtr create_from_spirv_blob(const Anvil::BaseDevice* in_device_ptr, const char* in_spirv_blob, uint32_t in_n_spirv_blob_bytes, @@ -98,7 +98,7 @@ namespace Anvil const std::string& in_opt_tc_entrypoint_name, const std::string& in_opt_te_entrypoint_name, const std::string& in_opt_vs_entrypoint_name, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE) { return create_from_spirv_blob(in_device_ptr, in_spirv_blob, @@ -120,7 +120,7 @@ namespace Anvil const std::string& in_opt_tc_entrypoint_name, const std::string& in_opt_te_entrypoint_name, const std::string& in_opt_vs_entrypoint_name, - MTSafety in_mt_safety = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE) { return create_from_spirv_blob(in_device_ptr, reinterpret_cast(in_spirv_blob), diff --git a/src/misc/base_pipeline_create_info.cpp b/src/misc/base_pipeline_create_info.cpp index f7990540..c42f837b 100644 --- a/src/misc/base_pipeline_create_info.cpp +++ b/src/misc/base_pipeline_create_info.cpp @@ -84,9 +84,9 @@ bool Anvil::BasePipelineCreateInfo::add_specialization_constant(Anvil::ShaderSta } /* Please see header for specification */ -bool Anvil::BasePipelineCreateInfo::attach_push_constant_range(uint32_t in_offset, - uint32_t in_size, - VkShaderStageFlags in_stages) +bool Anvil::BasePipelineCreateInfo::attach_push_constant_range(uint32_t in_offset, + uint32_t in_size, + Anvil::ShaderStageFlags in_stages) { bool result = false; @@ -239,7 +239,7 @@ void Anvil::BasePipelineCreateInfo::init_shader_modules(uint32_t { const auto& shader_module_stage_entrypoint = in_shader_module_stage_entrypoint_ptrs[n_shader_module_stage_entrypoint]; - if (shader_module_stage_entrypoint.stage == Anvil::SHADER_STAGE_UNKNOWN) + if (shader_module_stage_entrypoint.stage == Anvil::ShaderStage::UNKNOWN) { continue; } diff --git a/src/misc/base_pipeline_manager.cpp b/src/misc/base_pipeline_manager.cpp index 3b4c7f62..ab8291cd 100644 --- a/src/misc/base_pipeline_manager.cpp +++ b/src/misc/base_pipeline_manager.cpp @@ -422,7 +422,7 @@ bool Anvil::BasePipelineManager::get_shader_info(PipelineID in_ Pipeline* pipeline_ptr = nullptr; size_t out_data_size = out_data_ptr->size(); bool result = false; - const VkShaderStageFlagBits shader_stage_vk = Anvil::Utils::get_shader_stage_flag_bits_from_shader_stage(in_shader_stage); + const auto shader_stage_vk = Anvil::Utils::get_shader_stage_flag_bits_from_shader_stage(in_shader_stage); VkShaderInfoTypeAMD vk_info_type; VkResult vk_result; @@ -464,14 +464,14 @@ bool Anvil::BasePipelineManager::get_shader_info(PipelineID in_ switch (in_info_type) { - case SHADER_INFO_TYPE_BINARY: + case ShaderInfoType::BINARY: { vk_info_type = VK_SHADER_INFO_TYPE_BINARY_AMD; break; } - case SHADER_INFO_TYPE_DISASSEMBLY: + case ShaderInfoType::DISASSEMBLY: { vk_info_type = VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD; @@ -490,7 +490,7 @@ bool Anvil::BasePipelineManager::get_shader_info(PipelineID in_ { vk_result = entrypoints.vkGetShaderInfoAMD(m_device_ptr->get_device_vk(), pipeline_ptr->baked_pipeline, - shader_stage_vk, + static_cast(shader_stage_vk), vk_info_type, &out_data_size, nullptr); @@ -511,7 +511,7 @@ bool Anvil::BasePipelineManager::get_shader_info(PipelineID in_ vk_result = entrypoints.vkGetShaderInfoAMD(m_device_ptr->get_device_vk(), pipeline_ptr->baked_pipeline, - shader_stage_vk, + static_cast(shader_stage_vk), vk_info_type, &out_data_size, &(*out_data_ptr).at(0)); @@ -543,7 +543,7 @@ bool Anvil::BasePipelineManager::get_shader_statistics(PipelineID Pipelines::const_iterator pipeline_iterator; Pipeline* pipeline_ptr = nullptr; bool result = false; - const VkShaderStageFlagBits shader_stage_vk = Anvil::Utils::get_shader_stage_flag_bits_from_shader_stage(in_shader_stage); + const auto shader_stage_vk = Anvil::Utils::get_shader_stage_flag_bits_from_shader_stage(in_shader_stage); size_t shader_statistics_size = sizeof(VkShaderStatisticsInfoAMD); VkResult vk_result; @@ -585,7 +585,7 @@ bool Anvil::BasePipelineManager::get_shader_statistics(PipelineID vk_result = entrypoints.vkGetShaderInfoAMD(m_device_ptr->get_device_vk(), pipeline_ptr->baked_pipeline, - shader_stage_vk, + static_cast(shader_stage_vk), VK_SHADER_INFO_TYPE_STATISTICS_AMD, &shader_statistics_size, out_shader_statistics_ptr); diff --git a/src/misc/buffer_create_info.cpp b/src/misc/buffer_create_info.cpp index 16763b2e..0fdc742f 100644 --- a/src/misc/buffer_create_info.cpp +++ b/src/misc/buffer_create_info.cpp @@ -26,7 +26,7 @@ Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_nonsparse_alloc(const Anvil::BaseDevice* in_device_ptr, VkDeviceSize in_size, - QueueFamilyBits in_queue_families, + Anvil::QueueFamilyFlags in_queue_families, Anvil::SharingMode in_sharing_mode, Anvil::BufferUsageFlags in_usage_flags, Anvil::MemoryFeatureFlags in_memory_features) @@ -42,9 +42,9 @@ Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_nonsparse_alloc in_sharing_mode, in_usage_flags, in_memory_features, - Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, - 0, /* in_external_memory_handle_types */ - nullptr) /* in_opt_client_data_ptr */ + Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE, + Anvil::ExternalMemoryHandleTypeFlagBits::NONE, /* in_external_memory_handle_types */ + nullptr) /* in_opt_client_data_ptr */ ); return result_ptr; @@ -52,7 +52,7 @@ Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_nonsparse_alloc Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_nonsparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, VkDeviceSize in_size, - QueueFamilyBits in_queue_families, + Anvil::QueueFamilyFlags in_queue_families, Anvil::SharingMode in_sharing_mode, Anvil::BufferUsageFlags in_usage_flags) { @@ -66,10 +66,10 @@ Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_nonsparse_no_al in_queue_families, in_sharing_mode, in_usage_flags, - 0, /* in_memory_features */ - Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, - 0, /* in_external_memory_handle_types */ - nullptr) /* in_opt_client_data_ptr */ + Anvil::MemoryFeatureFlagBits::NONE, + Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE, + Anvil::ExternalMemoryHandleTypeFlagBits::NONE, /* in_external_memory_handle_types */ + nullptr) /* in_opt_client_data_ptr */ ); return result_ptr; @@ -91,14 +91,14 @@ Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_nonsparse_no_al return result_ptr; } -Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_sparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - Anvil::SharingMode in_sharing_mode, - Anvil::BufferUsageFlags in_usage_flags, - Anvil::SparseResidencyScope in_residency_scope, - MTSafety in_mt_safety, - Anvil::ExternalMemoryHandleTypeBits in_external_memory_handle_types) +Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_sparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + Anvil::QueueFamilyFlags in_queue_families, + Anvil::SharingMode in_sharing_mode, + Anvil::BufferUsageFlags in_usage_flags, + Anvil::SparseResidencyScope in_residency_scope, + MTSafety in_mt_safety, + Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) { Anvil::BufferCreateInfoUniquePtr result_ptr(nullptr, std::default_delete() ); @@ -117,18 +117,17 @@ Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_sparse_no_alloc return result_ptr; } -Anvil::BufferCreateInfo::BufferCreateInfo(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - Anvil::SharingMode in_sharing_mode, - Anvil::BufferUsageFlags in_usage_flags, - Anvil::SparseResidencyScope in_residency_scope, - MTSafety in_mt_safety, - Anvil::ExternalMemoryHandleTypeBits in_exportable_external_memory_handle_types) +Anvil::BufferCreateInfo::BufferCreateInfo(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + Anvil::QueueFamilyFlags in_queue_families, + Anvil::SharingMode in_sharing_mode, + Anvil::BufferUsageFlags in_usage_flags, + Anvil::SparseResidencyScope in_residency_scope, + MTSafety in_mt_safety, + Anvil::ExternalMemoryHandleTypeFlags in_exportable_external_memory_handle_types) :m_client_data_ptr (nullptr), m_device_ptr (in_device_ptr), m_exportable_external_memory_handle_types(in_exportable_external_memory_handle_types), - m_memory_features (0), m_mt_safety (in_mt_safety), m_parent_buffer_ptr (nullptr), m_queue_families (in_queue_families), @@ -147,33 +146,33 @@ Anvil::BufferCreateInfo::BufferCreateInfo(const Anvil::BaseDevice* in anvil_assert(physical_device_features.core_vk1_0_features_ptr->sparse_binding); } - if ((in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED || - in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_NONALIASED) && + if ((in_residency_scope == Anvil::SparseResidencyScope::ALIASED || + in_residency_scope == Anvil::SparseResidencyScope::NONALIASED) && !physical_device_features.core_vk1_0_features_ptr->sparse_residency_buffer) { - anvil_assert((in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED || - in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_NONALIASED) && + anvil_assert((in_residency_scope == Anvil::SparseResidencyScope::ALIASED || + in_residency_scope == Anvil::SparseResidencyScope::NONALIASED) && physical_device_features.core_vk1_0_features_ptr->sparse_residency_buffer); } - if ( in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED && + if ( in_residency_scope == Anvil::SparseResidencyScope::ALIASED && !physical_device_features.core_vk1_0_features_ptr->sparse_residency_aliased) { - anvil_assert(in_residency_scope == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED && + anvil_assert(in_residency_scope == Anvil::SparseResidencyScope::ALIASED && physical_device_features.core_vk1_0_features_ptr->sparse_residency_aliased); } } -Anvil::BufferCreateInfo::BufferCreateInfo(const Anvil::BufferType& in_buffer_type, - const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - QueueFamilyBits in_queue_families, - Anvil::SharingMode in_sharing_mode, - Anvil::BufferUsageFlags in_usage_flags, - MemoryFeatureFlags in_memory_features, - MTSafety in_mt_safety, - Anvil::ExternalMemoryHandleTypeBits in_exportable_external_memory_handle_types, - const void* in_opt_client_data_ptr) +Anvil::BufferCreateInfo::BufferCreateInfo(const Anvil::BufferType& in_buffer_type, + const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + Anvil::QueueFamilyFlags in_queue_families, + Anvil::SharingMode in_sharing_mode, + Anvil::BufferUsageFlags in_usage_flags, + MemoryFeatureFlags in_memory_features, + MTSafety in_mt_safety, + Anvil::ExternalMemoryHandleTypeFlags in_exportable_external_memory_handle_types, + const void* in_opt_client_data_ptr) :m_client_data_ptr (in_opt_client_data_ptr), m_device_ptr (in_device_ptr), m_exportable_external_memory_handle_types(in_exportable_external_memory_handle_types), @@ -181,16 +180,16 @@ Anvil::BufferCreateInfo::BufferCreateInfo(const Anvil::BufferType& in m_mt_safety (in_mt_safety), m_parent_buffer_ptr (nullptr), m_queue_families (in_queue_families), - m_residency_scope (Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED), + m_residency_scope (Anvil::SparseResidencyScope::UNKNOWN), m_sharing_mode (in_sharing_mode), m_size (in_size), m_start_offset (0), m_type (in_buffer_type), m_usage_flags (in_usage_flags) { - if ((in_memory_features & MEMORY_FEATURE_FLAG_MAPPABLE) == 0) + if ((in_memory_features & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) == 0) { - anvil_assert((in_memory_features & MEMORY_FEATURE_FLAG_HOST_COHERENT) == 0) + anvil_assert((in_memory_features & Anvil::MemoryFeatureFlagBits::HOST_COHERENT_BIT) == 0) } } diff --git a/src/misc/buffer_view_create_info.cpp b/src/misc/buffer_view_create_info.cpp index c4d298fb..8ea9f5c5 100644 --- a/src/misc/buffer_view_create_info.cpp +++ b/src/misc/buffer_view_create_info.cpp @@ -36,7 +36,7 @@ Anvil::BufferViewCreateInfoUniquePtr Anvil::BufferViewCreateInfo::create(const A in_format, in_start_offset, in_size, - Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE) ); return result_ptr; diff --git a/src/misc/descriptor_set_create_info.cpp b/src/misc/descriptor_set_create_info.cpp index f961d210..b539ab48 100644 --- a/src/misc/descriptor_set_create_info.cpp +++ b/src/misc/descriptor_set_create_info.cpp @@ -41,9 +41,9 @@ Anvil::DescriptorSetCreateInfo::~DescriptorSetCreateInfo() /** Please see header for specification */ bool Anvil::DescriptorSetCreateInfo::add_binding(uint32_t in_binding_index, - VkDescriptorType in_descriptor_type, + Anvil::DescriptorType in_descriptor_type, uint32_t in_descriptor_array_size, - VkShaderStageFlags in_stage_flags, + Anvil::ShaderStageFlags in_stage_flags, const Anvil::DescriptorBindingFlags& in_flags, const Anvil::Sampler* const* in_immutable_sampler_ptrs) { @@ -60,8 +60,8 @@ bool Anvil::DescriptorSetCreateInfo::add_binding(uint32_t /* Make sure the sampler array can actually be specified for this descriptor type. */ if (in_immutable_sampler_ptrs != nullptr) { - if (in_descriptor_type != VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER && - in_descriptor_type != VK_DESCRIPTOR_TYPE_SAMPLER) + if (in_descriptor_type != Anvil::DescriptorType::COMBINED_IMAGE_SAMPLER && + in_descriptor_type != Anvil::DescriptorType::SAMPLER) { anvil_assert_fail(); @@ -69,7 +69,7 @@ bool Anvil::DescriptorSetCreateInfo::add_binding(uint32_t } } - if (in_flags & Anvil::DESCRIPTOR_BINDING_FLAG_VARIABLE_DESCRIPTOR_COUNT_BIT) + if ((in_flags & Anvil::DescriptorBindingFlagBits::VARIABLE_DESCRIPTOR_COUNT_BIT) != 0) { if (m_n_variable_descriptor_count_binding != UINT32_MAX) { @@ -189,8 +189,8 @@ std::unique_ptr Anvil::Descriptor binding_vk.binding = binding_index; binding_vk.descriptorCount = binding_data.descriptor_array_size; - binding_vk.descriptorType = binding_data.descriptor_type; - binding_vk.stageFlags = binding_data.stage_flags; + binding_vk.descriptorType = static_cast(binding_data.descriptor_type); + binding_vk.stageFlags = binding_data.stage_flags.get_vk(); if (binding_data.immutable_samplers.size() > 0) { @@ -212,26 +212,26 @@ std::unique_ptr Anvil::Descriptor binding_vk.pImmutableSamplers = nullptr; } - if (binding_iterator->second.flags & Anvil::DESCRIPTOR_BINDING_FLAG_UPDATE_AFTER_BIND_BIT) + if ((binding_iterator->second.flags & Anvil::DescriptorBindingFlagBits::UPDATE_AFTER_BIND_BIT) != 0) { binding_flags |= VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT; create_info.flags |= VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT; should_chain_binding_flags_struct = true; } - if (binding_iterator->second.flags & Anvil::DESCRIPTOR_BINDING_FLAG_UPDATE_UNUSED_WHILE_PENDING_BIT) + if ((binding_iterator->second.flags & Anvil::DescriptorBindingFlagBits::UPDATE_UNUSED_WHILE_PENDING_BIT) != 0) { binding_flags |= VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT; should_chain_binding_flags_struct = true; } - if (binding_iterator->second.flags & Anvil::DESCRIPTOR_BINDING_FLAG_PARTIALLY_BOUND_BIT) + if ((binding_iterator->second.flags & Anvil::DescriptorBindingFlagBits::PARTIALLY_BOUND_BIT) != 0) { binding_flags |= VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT; should_chain_binding_flags_struct = true; } - if (binding_iterator->second.flags & Anvil::DESCRIPTOR_BINDING_FLAG_VARIABLE_DESCRIPTOR_COUNT_BIT) + if ((binding_iterator->second.flags & Anvil::DescriptorBindingFlagBits::VARIABLE_DESCRIPTOR_COUNT_BIT) != 0) { binding_flags |= VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT; should_chain_binding_flags_struct = true; @@ -287,9 +287,9 @@ std::unique_ptr Anvil::Descriptor /** Please see header for specification */ bool Anvil::DescriptorSetCreateInfo::get_binding_properties_by_binding_index(uint32_t in_binding_index, - VkDescriptorType* out_opt_descriptor_type_ptr, + Anvil::DescriptorType* out_opt_descriptor_type_ptr, uint32_t* out_opt_descriptor_array_size_ptr, - VkShaderStageFlags* out_opt_stage_flags_ptr, + Anvil::ShaderStageFlags* out_opt_stage_flags_ptr, bool* out_opt_immutable_samplers_enabled_ptr, Anvil::DescriptorBindingFlags* out_opt_flags_ptr) const { @@ -335,9 +335,9 @@ bool Anvil::DescriptorSetCreateInfo::get_binding_properties_by_binding_index(uin /** Please see header for specification */ bool Anvil::DescriptorSetCreateInfo::get_binding_properties_by_index_number(uint32_t in_n_binding, uint32_t* out_opt_binding_index_ptr, - VkDescriptorType* out_opt_descriptor_type_ptr, + Anvil::DescriptorType* out_opt_descriptor_type_ptr, uint32_t* out_opt_descriptor_array_size_ptr, - VkShaderStageFlags* out_opt_stage_flags_ptr, + Anvil::ShaderStageFlags* out_opt_stage_flags_ptr, bool* out_opt_immutable_samplers_enabled_ptr, Anvil::DescriptorBindingFlags* out_opt_flags_ptr) const { diff --git a/src/misc/dummy_window.cpp b/src/misc/dummy_window.cpp index daf44369..508902be 100644 --- a/src/misc/dummy_window.cpp +++ b/src/misc/dummy_window.cpp @@ -165,15 +165,15 @@ Anvil::DummyWindowWithPNGSnapshots::DummyWindowWithPNGSnapshots(const std::strin /** Please see header for specification */ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_image_raw_r8g8b8a8_unorm_data(Anvil::Image* in_swapchain_image_ptr) { - const Anvil::BaseDevice* device_ptr (m_swapchain_ptr->get_create_info_ptr()->get_device() ); - std::unique_ptr result_ptr; - Anvil::Format swapchain_image_format (in_swapchain_image_ptr->get_create_info_ptr()->get_format() ); - const VkImageSubresourceRange swapchain_image_subresource_range(in_swapchain_image_ptr->get_subresource_range () ); + const Anvil::BaseDevice* device_ptr (m_swapchain_ptr->get_create_info_ptr()->get_device() ); + std::unique_ptr result_ptr; + Anvil::Format swapchain_image_format (in_swapchain_image_ptr->get_create_info_ptr()->get_format() ); + const Anvil::ImageSubresourceRange swapchain_image_subresource_range(in_swapchain_image_ptr->get_subresource_range () ); /* Sanity checks .. */ ANVIL_REDUNDANT_VARIABLE(swapchain_image_format); - anvil_assert(swapchain_image_subresource_range.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT); + anvil_assert(swapchain_image_subresource_range.aspect_mask == Anvil::ImageAspectFlagBits::COLOR_BIT); /* Initialize storage for the raw R8G8B8A8 image data */ Anvil::BufferUniquePtr raw_image_buffer_ptr; @@ -193,39 +193,39 @@ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_ima { auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(device_ptr, raw_image_size, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::SharingMode::EXCLUSIVE, - Anvil::BUFFER_USAGE_FLAG_TRANSFER_DST_BIT, - Anvil::MEMORY_FEATURE_FLAG_MAPPABLE); + Anvil::BufferUsageFlagBits::TRANSFER_DST_BIT, + Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT); - create_info_ptr->set_mt_safety(MT_SAFETY_DISABLED); + create_info_ptr->set_mt_safety(Anvil::MTSafety::DISABLED); raw_image_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } /* 2. Create the intermediate image */ - VkImageBlit intermediate_image_blit; - ImageUniquePtr intermediate_image_ptr; + Anvil::ImageBlit intermediate_image_blit; + ImageUniquePtr intermediate_image_ptr; { auto create_info_ptr = Anvil::ImageCreateInfo::create_nonsparse_alloc(device_ptr, Anvil::ImageType::_2D, Anvil::Format::R8G8B8A8_UNORM, Anvil::ImageTiling::OPTIMAL, - Anvil::IMAGE_USAGE_FLAG_TRANSFER_SRC_BIT | Anvil::IMAGE_USAGE_FLAG_TRANSFER_DST_BIT, + Anvil::ImageUsageFlagBits::TRANSFER_SRC_BIT | Anvil::ImageUsageFlagBits::TRANSFER_DST_BIT, swapchain_image_width, swapchain_image_height, 1, /* in_base_mipmap_depth */ 1, /* in_n_layers */ - Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + Anvil::SampleCountFlagBits::_1_BIT, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::SharingMode::EXCLUSIVE, false, /* in_use_full_mipmap_chain */ - 0, /* in_memory_features */ - 0, /* in_create_flags */ + Anvil::MemoryFeatureFlagBits::NONE, + Anvil::ImageCreateFlagBits::NONE, Anvil::ImageLayout::TRANSFER_DST_OPTIMAL); - create_info_ptr->set_mt_safety(MT_SAFETY_DISABLED); + create_info_ptr->set_mt_safety(Anvil::MTSafety::DISABLED); intermediate_image_ptr = Anvil::Image::create(std::move(create_info_ptr) ); } @@ -242,12 +242,11 @@ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_ima command_buffer_ptr->start_recording(true, /* one_time_submit */ false); /* simultaneous_use_allowed */ { - VkBufferImageCopy buffer_image_copy_region; + Anvil::BufferImageCopy buffer_image_copy_region; Anvil::ImageBarrier general_to_transfer_src_image_barrier( - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_TRANSFER_WRITE_BIT | VK_ACCESS_MEMORY_READ_BIT, /* source_access_mask */ - VK_ACCESS_TRANSFER_READ_BIT, /* destination_access_mask */ - false, + Anvil::AccessFlagBits::COLOR_ATTACHMENT_WRITE_BIT | Anvil::AccessFlagBits::TRANSFER_WRITE_BIT | Anvil::AccessFlagBits::MEMORY_READ_BIT, /* source_access_mask */ + Anvil::AccessFlagBits::TRANSFER_READ_BIT, /* destination_access_mask */ Anvil::ImageLayout::GENERAL, Anvil::ImageLayout::TRANSFER_SRC_OPTIMAL, universal_queue_family_index, @@ -257,9 +256,8 @@ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_ima ); Anvil::ImageBarrier transfer_dst_to_transfer_src_image_barrier( - VK_ACCESS_TRANSFER_WRITE_BIT, /* source_access_mask */ - VK_ACCESS_TRANSFER_READ_BIT, /* desitnation_access_mask */ - false, + Anvil::AccessFlagBits::TRANSFER_WRITE_BIT, /* source_access_mask */ + Anvil::AccessFlagBits::TRANSFER_READ_BIT, /* desitnation_access_mask */ Anvil::ImageLayout::TRANSFER_DST_OPTIMAL, Anvil::ImageLayout::TRANSFER_SRC_OPTIMAL, universal_queue_family_index, @@ -268,9 +266,8 @@ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_ima swapchain_image_subresource_range); Anvil::ImageBarrier transfer_src_to_general_image_barrier( - VK_ACCESS_TRANSFER_READ_BIT, /* source_access_mask */ - 0, /* destination_access_mask */ - false, + Anvil::AccessFlagBits::TRANSFER_READ_BIT, /* source_access_mask */ + Anvil::AccessFlags(), /* destination_access_mask */ Anvil::ImageLayout::TRANSFER_SRC_OPTIMAL, Anvil::ImageLayout::GENERAL, universal_queue_family_index, @@ -278,29 +275,29 @@ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_ima in_swapchain_image_ptr, swapchain_image_subresource_range); - command_buffer_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT, /* src_stage_mask */ - VK_PIPELINE_STAGE_TRANSFER_BIT, /* dst_stage_mask */ - false, /* in_by_region */ - 0, /* in_memory_barrier_count */ - nullptr, /* in_memory_barrier_ptrs */ - 0, /* in_buffer_memory_barrier_count */ - nullptr, /* in_buffer_memory_barrier_ptrs */ - 1, /* in_image_memory_barrier_count */ + command_buffer_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::COLOR_ATTACHMENT_OUTPUT_BIT | Anvil::PipelineStageFlagBits::TRANSFER_BIT, /* src_stage_mask */ + Anvil::PipelineStageFlagBits::TRANSFER_BIT, /* dst_stage_mask */ + Anvil::DependencyFlagBits::NONE, + 0, /* in_memory_barrier_count */ + nullptr, /* in_memory_barrier_ptrs */ + 0, /* in_buffer_memory_barrier_count */ + nullptr, /* in_buffer_memory_barrier_ptrs */ + 1, /* in_image_memory_barrier_count */ &general_to_transfer_src_image_barrier); - intermediate_image_blit.dstOffsets[0].x = 0; - intermediate_image_blit.dstOffsets[0].y = 0; - intermediate_image_blit.dstOffsets[0].z = 0; - intermediate_image_blit.dstOffsets[1].x = static_cast(swapchain_image_width); - intermediate_image_blit.dstOffsets[1].y = static_cast(swapchain_image_height); - intermediate_image_blit.dstOffsets[1].z = 1; - intermediate_image_blit.dstSubresource.baseArrayLayer = 0; - intermediate_image_blit.dstSubresource.layerCount = 1; - intermediate_image_blit.dstSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; - intermediate_image_blit.dstSubresource.mipLevel = 0; - intermediate_image_blit.srcOffsets[0] = intermediate_image_blit.dstOffsets[0]; - intermediate_image_blit.srcOffsets[1] = intermediate_image_blit.dstOffsets[1]; - intermediate_image_blit.srcSubresource = intermediate_image_blit.dstSubresource; + intermediate_image_blit.dst_offsets[0].x = 0; + intermediate_image_blit.dst_offsets[0].y = 0; + intermediate_image_blit.dst_offsets[0].z = 0; + intermediate_image_blit.dst_offsets[1].x = static_cast(swapchain_image_width); + intermediate_image_blit.dst_offsets[1].y = static_cast(swapchain_image_height); + intermediate_image_blit.dst_offsets[1].z = 1; + intermediate_image_blit.dst_subresource.base_array_layer = 0; + intermediate_image_blit.dst_subresource.layer_count = 1; + intermediate_image_blit.dst_subresource.aspect_mask = Anvil::ImageAspectFlagBits::COLOR_BIT; + intermediate_image_blit.dst_subresource.mip_level = 0; + intermediate_image_blit.src_offsets[0] = intermediate_image_blit.dst_offsets[0]; + intermediate_image_blit.src_offsets[1] = intermediate_image_blit.dst_offsets[1]; + intermediate_image_blit.src_subresource = intermediate_image_blit.dst_subresource; command_buffer_ptr->record_blit_image(in_swapchain_image_ptr, Anvil::ImageLayout::TRANSFER_SRC_OPTIMAL, @@ -308,31 +305,31 @@ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_ima Anvil::ImageLayout::TRANSFER_DST_OPTIMAL, 1, /* regionCount */ &intermediate_image_blit, - VK_FILTER_NEAREST); - - command_buffer_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_TRANSFER_BIT, /* src_stage_mask */ - VK_PIPELINE_STAGE_TRANSFER_BIT, /* dst_stage_mask */ - VK_FALSE, /* in_by_region */ - 0, /* in_memory_barrier_count */ - nullptr, /* in_memory_barrier_ptrs */ - 0, /* in_buffer_memory_barrier_count */ - nullptr, /* in_buffer_memory_barrier_ptrs */ - 1, /* in_image_memory_barrier_count */ + Anvil::Filter::NEAREST); + + command_buffer_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::TRANSFER_BIT, /* src_stage_mask */ + Anvil::PipelineStageFlagBits::TRANSFER_BIT, /* dst_stage_mask */ + Anvil::DependencyFlagBits::NONE, + 0, /* in_memory_barrier_count */ + nullptr, /* in_memory_barrier_ptrs */ + 0, /* in_buffer_memory_barrier_count */ + nullptr, /* in_buffer_memory_barrier_ptrs */ + 1, /* in_image_memory_barrier_count */ &transfer_dst_to_transfer_src_image_barrier); - buffer_image_copy_region.bufferImageHeight = 0; /* assume tight packing */ - buffer_image_copy_region.bufferOffset = 0; - buffer_image_copy_region.bufferRowLength = 0; /* assume tight packing */ - buffer_image_copy_region.imageExtent.depth = 1; - buffer_image_copy_region.imageExtent.height = swapchain_image_height; - buffer_image_copy_region.imageExtent.width = swapchain_image_width; - buffer_image_copy_region.imageOffset.x = 0; - buffer_image_copy_region.imageOffset.y = 0; - buffer_image_copy_region.imageOffset.z = 0; - buffer_image_copy_region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; - buffer_image_copy_region.imageSubresource.baseArrayLayer = 0; - buffer_image_copy_region.imageSubresource.layerCount = 1; - buffer_image_copy_region.imageSubresource.mipLevel = 0; + buffer_image_copy_region.buffer_image_height = 0; /* assume tight packing */ + buffer_image_copy_region.buffer_offset = 0; + buffer_image_copy_region.buffer_row_length = 0; /* assume tight packing */ + buffer_image_copy_region.image_extent.depth = 1; + buffer_image_copy_region.image_extent.height = swapchain_image_height; + buffer_image_copy_region.image_extent.width = swapchain_image_width; + buffer_image_copy_region.image_offset.x = 0; + buffer_image_copy_region.image_offset.y = 0; + buffer_image_copy_region.image_offset.z = 0; + buffer_image_copy_region.image_subresource.aspect_mask = Anvil::ImageAspectFlagBits::COLOR_BIT; + buffer_image_copy_region.image_subresource.base_array_layer = 0; + buffer_image_copy_region.image_subresource.layer_count = 1; + buffer_image_copy_region.image_subresource.mip_level = 0; command_buffer_ptr->record_copy_image_to_buffer(intermediate_image_ptr.get(), Anvil::ImageLayout::TRANSFER_SRC_OPTIMAL, @@ -340,14 +337,14 @@ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_ima 1, /* regionCount */ &buffer_image_copy_region); - command_buffer_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_TRANSFER_BIT, /* src_stage_mask */ - VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, /* dst_stage_mask */ - VK_FALSE, /* in_by_region */ - 0, /* in_memory_barrier_count */ - nullptr, /* in_memory_barrier_ptrs */ - 0, /* in_buffer_memory_barrier_count */ - nullptr, /* in_buffer_memory_barrier_ptrs */ - 1, /* in_image_memory_barrier_count */ + command_buffer_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::TRANSFER_BIT, /* src_stage_mask */ + Anvil::PipelineStageFlagBits::TOP_OF_PIPE_BIT, /* dst_stage_mask */ + Anvil::DependencyFlagBits::NONE, + 0, /* in_memory_barrier_count */ + nullptr, /* in_memory_barrier_ptrs */ + 0, /* in_buffer_memory_barrier_count */ + nullptr, /* in_buffer_memory_barrier_ptrs */ + 1, /* in_image_memory_barrier_count */ &transfer_src_to_general_image_barrier); } command_buffer_ptr->stop_recording(); diff --git a/src/misc/event_create_info.cpp b/src/misc/event_create_info.cpp index b4069474..1c29c6f2 100644 --- a/src/misc/event_create_info.cpp +++ b/src/misc/event_create_info.cpp @@ -28,7 +28,7 @@ Anvil::EventCreateInfoUniquePtr Anvil::EventCreateInfo::create(const Anvil::Base result_ptr.reset( new Anvil::EventCreateInfo(in_device_ptr, - Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE) ); return result_ptr; diff --git a/src/misc/fence_create_info.cpp b/src/misc/fence_create_info.cpp index 63742dbe..75195e41 100644 --- a/src/misc/fence_create_info.cpp +++ b/src/misc/fence_create_info.cpp @@ -30,7 +30,7 @@ Anvil::FenceCreateInfoUniquePtr Anvil::FenceCreateInfo::create(const Anvil::Base result_ptr.reset( new Anvil::FenceCreateInfo(in_device_ptr, in_create_signalled, - Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE) ); return result_ptr; @@ -45,7 +45,7 @@ Anvil::FenceCreateInfo::FenceCreateInfo(const Anvil::BaseDevice* in_device_ptr, m_exportable_nt_handle_info_specified (false), m_exportable_nt_handle_info_security_attributes_specified(false), #endif - m_exportable_external_fence_handle_types (Anvil::EXTERNAL_FENCE_HANDLE_TYPE_NONE), + m_exportable_external_fence_handle_types (Anvil::ExternalFenceHandleTypeFlagBits::NONE), m_mt_safety (in_mt_safety) { /* Stub */ diff --git a/src/misc/formats.cpp b/src/misc/formats.cpp index 94bc5bc6..3c175ec7 100644 --- a/src/misc/formats.cpp +++ b/src/misc/formats.cpp @@ -34,191 +34,191 @@ static const struct FormatInfo } g_formats[] = { /* format | name | component_layout | component_bits[0] | component_bits[1] | component_bits[2] | component_bits[3] | format_type | is_packed? */ - {Anvil::Format::UNKNOWN, "VK_FORMAT_UNDEFINED", Anvil::COMPONENT_LAYOUT_UNKNOWN, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNKNOWN, false}, - {Anvil::Format::R4G4_UNORM_PACK8, "VK_FORMAT_R4G4_UNORM_PACK8", Anvil::COMPONENT_LAYOUT_RG, 4, 4, 0, 0, Anvil::FORMAT_TYPE_UNORM, true}, - {Anvil::Format::R4G4B4A4_UNORM_PACK16, "VK_FORMAT_R4G4B4A4_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_RGBA, 4, 4, 4, 4, Anvil::FORMAT_TYPE_UNORM, true}, - {Anvil::Format::B4G4R4A4_UNORM_PACK16, "VK_FORMAT_B4G4R4A4_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_BGRA, 4, 4, 4, 4, Anvil::FORMAT_TYPE_UNORM, true}, - {Anvil::Format::R5G6B5_UNORM_PACK16, "VK_FORMAT_R5G6B5_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_RGB, 5, 6, 5, 0, Anvil::FORMAT_TYPE_UNORM, true}, - {Anvil::Format::B5G6R5_UNORM_PACK16, "VK_FORMAT_B5G6R5_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_BGR, 5, 6, 5, 0, Anvil::FORMAT_TYPE_UNORM, true}, - {Anvil::Format::R5G5B5A1_UNORM_PACK16, "VK_FORMAT_R5G5B5A1_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_RGBA, 5, 5, 5, 1, Anvil::FORMAT_TYPE_UNORM, true}, - {Anvil::Format::B5G5R5A1_UNORM_PACK16, "VK_FORMAT_B5G5R5A1_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_BGRA, 5, 5, 5, 1, Anvil::FORMAT_TYPE_UNORM, true}, - {Anvil::Format::A1R5G5B5_UNORM_PACK16, "VK_FORMAT_A1R5G5B5_UNORM_PACK16", Anvil::COMPONENT_LAYOUT_ARGB, 1, 5, 5, 5, Anvil::FORMAT_TYPE_UNORM, true}, - {Anvil::Format::R8_UNORM, "VK_FORMAT_R8_UNORM", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::R8_SNORM, "VK_FORMAT_R8_SNORM", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {Anvil::Format::R8_USCALED, "VK_FORMAT_R8_USCALED", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_USCALED, false}, - {Anvil::Format::R8_SSCALED, "VK_FORMAT_R8_SSCALED", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_SSCALED, false}, - {Anvil::Format::R8_UINT, "VK_FORMAT_R8_UINT", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, - {Anvil::Format::R8_SINT, "VK_FORMAT_R8_SINT", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, - {Anvil::Format::R8_SRGB, "VK_FORMAT_R8_SRGB", Anvil::COMPONENT_LAYOUT_R, 8, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::R8G8_UNORM, "VK_FORMAT_R8G8_UNORM", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::R8G8_SNORM, "VK_FORMAT_R8G8_SNORM", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {Anvil::Format::R8G8_USCALED, "VK_FORMAT_R8G8_USCALED", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_USCALED, false}, - {Anvil::Format::R8G8_SSCALED, "VK_FORMAT_R8G8_SSCALED", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_SSCALED, false}, - {Anvil::Format::R8G8_UINT, "VK_FORMAT_R8G8_UINT", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, - {Anvil::Format::R8G8_SINT, "VK_FORMAT_R8G8_SINT", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, - {Anvil::Format::R8G8_SRGB, "VK_FORMAT_R8G8_SRGB", Anvil::COMPONENT_LAYOUT_RG, 8, 8, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::R8G8B8_UNORM, "VK_FORMAT_R8G8B8_UNORM", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::R8G8B8_SNORM, "VK_FORMAT_R8G8B8_SNORM", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {Anvil::Format::R8G8B8_USCALED, "VK_FORMAT_R8G8B8_USCALED", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_USCALED, false}, - {Anvil::Format::R8G8B8_SSCALED, "VK_FORMAT_R8G8B8_SSCALED", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SSCALED, false}, - {Anvil::Format::R8G8B8_UINT, "VK_FORMAT_R8G8B8_UINT", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_UINT, false}, - {Anvil::Format::R8G8B8_SINT, "VK_FORMAT_R8G8B8_SINT", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SINT, false}, - {Anvil::Format::R8G8B8_SRGB, "VK_FORMAT_R8G8B8_SRGB", Anvil::COMPONENT_LAYOUT_RGB, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::B8G8R8_UNORM, "VK_FORMAT_B8G8R8_UNORM", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::B8G8R8_SNORM, "VK_FORMAT_B8G8R8_SNORM", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {Anvil::Format::B8G8R8_USCALED, "VK_FORMAT_B8G8R8_USCALED", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_USCALED, false}, - {Anvil::Format::B8G8R8_SSCALED, "VK_FORMAT_B8G8R8_SSCALED", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SSCALED, false}, - {Anvil::Format::B8G8R8_UINT, "VK_FORMAT_B8G8R8_UINT", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_UINT, false}, - {Anvil::Format::B8G8R8_SINT, "VK_FORMAT_B8G8R8_SINT", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SINT, false}, - {Anvil::Format::B8G8R8_SRGB, "VK_FORMAT_B8G8R8_SRGB", Anvil::COMPONENT_LAYOUT_BGR, 8, 8, 8, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::R8G8B8A8_UNORM, "VK_FORMAT_R8G8B8A8_UNORM", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::R8G8B8A8_SNORM, "VK_FORMAT_R8G8B8A8_SNORM", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SNORM, false}, - {Anvil::Format::R8G8B8A8_USCALED, "VK_FORMAT_R8G8B8A8_USCALED", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_USCALED, false}, - {Anvil::Format::R8G8B8A8_SSCALED, "VK_FORMAT_R8G8B8A8_SSCALED", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SSCALED, false}, - {Anvil::Format::R8G8B8A8_UINT, "VK_FORMAT_R8G8B8A8_UINT", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UINT, false}, - {Anvil::Format::R8G8B8A8_SINT, "VK_FORMAT_R8G8B8A8_SINT", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SINT, false}, - {Anvil::Format::R8G8B8A8_SRGB, "VK_FORMAT_R8G8B8A8_SRGB", Anvil::COMPONENT_LAYOUT_RGBA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::B8G8R8A8_UNORM, "VK_FORMAT_B8G8R8A8_UNORM", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::B8G8R8A8_SNORM, "VK_FORMAT_B8G8R8A8_SNORM", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SNORM, false}, - {Anvil::Format::B8G8R8A8_USCALED, "VK_FORMAT_B8G8R8A8_USCALED", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_USCALED, false}, - {Anvil::Format::B8G8R8A8_SSCALED, "VK_FORMAT_B8G8R8A8_SSCALED", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SSCALED, false}, - {Anvil::Format::B8G8R8A8_UINT, "VK_FORMAT_B8G8R8A8_UINT", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UINT, false}, - {Anvil::Format::B8G8R8A8_SINT, "VK_FORMAT_B8G8R8A8_SINT", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SINT, false}, - {Anvil::Format::B8G8R8A8_SRGB, "VK_FORMAT_B8G8R8A8_SRGB", Anvil::COMPONENT_LAYOUT_BGRA, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::A8B8G8R8_UNORM_PACK32, "VK_FORMAT_A8B8G8R8_UNORM_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UNORM, true}, - {Anvil::Format::A8B8G8R8_SNORM_PACK32, "VK_FORMAT_A8B8G8R8_SNORM_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SNORM, true}, - {Anvil::Format::A8B8G8R8_USCALED_PACK32, "VK_FORMAT_A8B8G8R8_USCALED_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_USCALED, true}, - {Anvil::Format::A8B8G8R8_SSCALED_PACK32, "VK_FORMAT_A8B8G8R8_SSCALED_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SSCALED, true}, - {Anvil::Format::A8B8G8R8_UINT_PACK32, "VK_FORMAT_A8B8G8R8_UINT_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_UINT, true}, - {Anvil::Format::A8B8G8R8_SINT_PACK32, "VK_FORMAT_A8B8G8R8_SINT_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SINT, true}, - {Anvil::Format::A8B8G8R8_SRGB_PACK32, "VK_FORMAT_A8B8G8R8_SRGB_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 8, 8, 8, 8, Anvil::FORMAT_TYPE_SRGB, true}, - {Anvil::Format::A2R10G10B10_UNORM_PACK32, "VK_FORMAT_A2R10G10B10_UNORM_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_UNORM, true}, - {Anvil::Format::A2R10G10B10_SNORM_PACK32, "VK_FORMAT_A2R10G10B10_SNORM_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SNORM, true}, - {Anvil::Format::A2R10G10B10_USCALED_PACK32, "VK_FORMAT_A2R10G10B10_USCALED_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_USCALED, true}, - {Anvil::Format::A2R10G10B10_SSCALED_PACK32, "VK_FORMAT_A2R10G10B10_SSCALED_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SSCALED, true}, - {Anvil::Format::A2R10G10B10_UINT_PACK32, "VK_FORMAT_A2R10G10B10_UINT_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_UINT, true}, - {Anvil::Format::A2R10G10B10_SINT_PACK32, "VK_FORMAT_A2R10G10B10_SINT_PACK32", Anvil::COMPONENT_LAYOUT_ARGB, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SINT, true}, - {Anvil::Format::A2B10G10R10_UNORM_PACK32, "VK_FORMAT_A2B10G10R10_UNORM_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_UNORM, true}, - {Anvil::Format::A2B10G10R10_SNORM_PACK32, "VK_FORMAT_A2B10G10R10_SNORM_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SNORM, true}, - {Anvil::Format::A2B10G10R10_USCALED_PACK32, "VK_FORMAT_A2B10G10R10_USCALED_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_USCALED, true}, - {Anvil::Format::A2B10G10R10_SSCALED_PACK32, "VK_FORMAT_A2B10G10R10_SSCALED_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SSCALED, true}, - {Anvil::Format::A2B10G10R10_UINT_PACK32, "VK_FORMAT_A2B10G10R10_UINT_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_UINT, true}, - {Anvil::Format::A2B10G10R10_SINT_PACK32, "VK_FORMAT_A2B10G10R10_SINT_PACK32", Anvil::COMPONENT_LAYOUT_ABGR, 2, 10, 10, 10, Anvil::FORMAT_TYPE_SINT, true}, - {Anvil::Format::R16_UNORM, "VK_FORMAT_R16_UNORM", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::R16_SNORM, "VK_FORMAT_R16_SNORM", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {Anvil::Format::R16_USCALED, "VK_FORMAT_R16_USCALED", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_USCALED, false}, - {Anvil::Format::R16_SSCALED, "VK_FORMAT_R16_SSCALED", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_SSCALED, false}, - {Anvil::Format::R16_UINT, "VK_FORMAT_R16_UINT", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, - {Anvil::Format::R16_SINT, "VK_FORMAT_R16_SINT", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, - {Anvil::Format::R16_SFLOAT, "VK_FORMAT_R16_SFLOAT", Anvil::COMPONENT_LAYOUT_R, 16, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {Anvil::Format::R16G16_UNORM, "VK_FORMAT_R16G16_UNORM", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::R16G16_SNORM, "VK_FORMAT_R16G16_SNORM", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {Anvil::Format::R16G16_USCALED, "VK_FORMAT_R16G16_USCALED", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_USCALED, false}, - {Anvil::Format::R16G16_SSCALED, "VK_FORMAT_R16G16_SSCALED", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_SSCALED, false}, - {Anvil::Format::R16G16_UINT, "VK_FORMAT_R16G16_UINT", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, - {Anvil::Format::R16G16_SINT, "VK_FORMAT_R16G16_SINT", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, - {Anvil::Format::R16G16_SFLOAT, "VK_FORMAT_R16G16_SFLOAT", Anvil::COMPONENT_LAYOUT_RG, 16, 16, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {Anvil::Format::R16G16B16_UNORM, "VK_FORMAT_R16G16B16_UNORM", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::R16G16B16_SNORM, "VK_FORMAT_R16G16B16_SNORM", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {Anvil::Format::R16G16B16_USCALED, "VK_FORMAT_R16G16B16_USCALED", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_USCALED, false}, - {Anvil::Format::R16G16B16_SSCALED, "VK_FORMAT_R16G16B16_SSCALED", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_SSCALED, false}, - {Anvil::Format::R16G16B16_UINT, "VK_FORMAT_R16G16B16_UINT", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_UINT, false}, - {Anvil::Format::R16G16B16_SINT, "VK_FORMAT_R16G16B16_SINT", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_SINT, false}, - {Anvil::Format::R16G16B16_SFLOAT, "VK_FORMAT_R16G16B16_SFLOAT", Anvil::COMPONENT_LAYOUT_RGB, 16, 16, 16, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {Anvil::Format::R16G16B16A16_UNORM, "VK_FORMAT_R16G16B16A16_UNORM", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::R16G16B16A16_SNORM, "VK_FORMAT_R16G16B16A16_SNORM", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_SNORM, false}, - {Anvil::Format::R16G16B16A16_USCALED, "VK_FORMAT_R16G16B16A16_USCALED", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_USCALED, false}, - {Anvil::Format::R16G16B16A16_SSCALED, "VK_FORMAT_R16G16B16A16_SSCALED", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_SSCALED, false}, - {Anvil::Format::R16G16B16A16_UINT, "VK_FORMAT_R16G16B16A16_UINT", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_UINT, false}, - {Anvil::Format::R16G16B16A16_SINT, "VK_FORMAT_R16G16B16A16_SINT", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_SINT, false}, - {Anvil::Format::R16G16B16A16_SFLOAT, "VK_FORMAT_R16G16B16A16_SFLOAT", Anvil::COMPONENT_LAYOUT_RGBA, 16, 16, 16, 16, Anvil::FORMAT_TYPE_SFLOAT, false}, - {Anvil::Format::R32_UINT, "VK_FORMAT_R32_UINT", Anvil::COMPONENT_LAYOUT_R, 32, 0, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, - {Anvil::Format::R32_SINT, "VK_FORMAT_R32_SINT", Anvil::COMPONENT_LAYOUT_R, 32, 0, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, - {Anvil::Format::R32_SFLOAT, "VK_FORMAT_R32_SFLOAT", Anvil::COMPONENT_LAYOUT_R, 32, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {Anvil::Format::R32G32_UINT, "VK_FORMAT_R32G32_UINT", Anvil::COMPONENT_LAYOUT_RG, 32, 32, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, - {Anvil::Format::R32G32_SINT, "VK_FORMAT_R32G32_SINT", Anvil::COMPONENT_LAYOUT_RG, 32, 32, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, - {Anvil::Format::R32G32_SFLOAT, "VK_FORMAT_R32G32_SFLOAT", Anvil::COMPONENT_LAYOUT_RG, 32, 32, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {Anvil::Format::R32G32B32_UINT, "VK_FORMAT_R32G32B32_UINT", Anvil::COMPONENT_LAYOUT_RGB, 32, 32, 32, 0, Anvil::FORMAT_TYPE_UINT, false}, - {Anvil::Format::R32G32B32_SINT, "VK_FORMAT_R32G32B32_SINT", Anvil::COMPONENT_LAYOUT_RGB, 32, 32, 32, 0, Anvil::FORMAT_TYPE_SINT, false}, - {Anvil::Format::R32G32B32_SFLOAT, "VK_FORMAT_R32G32B32_SFLOAT", Anvil::COMPONENT_LAYOUT_RGB, 32, 32, 32, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {Anvil::Format::R32G32B32A32_UINT, "VK_FORMAT_R32G32B32A32_UINT", Anvil::COMPONENT_LAYOUT_RGBA, 32, 32, 32, 32, Anvil::FORMAT_TYPE_UINT, false}, - {Anvil::Format::R32G32B32A32_SINT, "VK_FORMAT_R32G32B32A32_SINT", Anvil::COMPONENT_LAYOUT_RGBA, 32, 32, 32, 32, Anvil::FORMAT_TYPE_SINT, false}, - {Anvil::Format::R32G32B32A32_SFLOAT, "VK_FORMAT_R32G32B32A32_SFLOAT", Anvil::COMPONENT_LAYOUT_RGBA, 32, 32, 32, 32, Anvil::FORMAT_TYPE_SFLOAT, false}, - {Anvil::Format::R64_UINT, "VK_FORMAT_R64_UINT", Anvil::COMPONENT_LAYOUT_R, 64, 0, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, - {Anvil::Format::R64_SINT, "VK_FORMAT_R64_SINT", Anvil::COMPONENT_LAYOUT_R, 64, 0, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, - {Anvil::Format::R64_SFLOAT, "VK_FORMAT_R64_SFLOAT", Anvil::COMPONENT_LAYOUT_R, 64, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {Anvil::Format::R64G64_UINT, "VK_FORMAT_R64G64_UINT", Anvil::COMPONENT_LAYOUT_RG, 64, 64, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, - {Anvil::Format::R64G64_SINT, "VK_FORMAT_R64G64_SINT", Anvil::COMPONENT_LAYOUT_RG, 64, 64, 0, 0, Anvil::FORMAT_TYPE_SINT, false}, - {Anvil::Format::R64G64_SFLOAT, "VK_FORMAT_R64G64_SFLOAT", Anvil::COMPONENT_LAYOUT_RG, 64, 64, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {Anvil::Format::R64G64B64_UINT, "VK_FORMAT_R64G64B64_UINT", Anvil::COMPONENT_LAYOUT_RGB, 64, 64, 64, 0, Anvil::FORMAT_TYPE_UINT, false}, - {Anvil::Format::R64G64B64_SINT, "VK_FORMAT_R64G64B64_SINT", Anvil::COMPONENT_LAYOUT_RGB, 64, 64, 64, 0, Anvil::FORMAT_TYPE_SINT, false}, - {Anvil::Format::R64G64B64_SFLOAT, "VK_FORMAT_R64G64B64_SFLOAT", Anvil::COMPONENT_LAYOUT_RGB, 64, 64, 64, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {Anvil::Format::R64G64B64A64_UINT, "VK_FORMAT_R64G64B64A64_UINT", Anvil::COMPONENT_LAYOUT_RGBA, 64, 64, 64, 64, Anvil::FORMAT_TYPE_UINT, false}, - {Anvil::Format::R64G64B64A64_SINT, "VK_FORMAT_R64G64B64A64_SINT", Anvil::COMPONENT_LAYOUT_RGBA, 64, 64, 64, 64, Anvil::FORMAT_TYPE_SINT, false}, - {Anvil::Format::R64G64B64A64_SFLOAT, "VK_FORMAT_R64G64B64A64_SFLOAT", Anvil::COMPONENT_LAYOUT_RGBA, 64, 64, 64, 64, Anvil::FORMAT_TYPE_SFLOAT, false}, - {Anvil::Format::B10G11R11_UFLOAT_PACK32, "VK_FORMAT_B10G11R11_UFLOAT_PACK32", Anvil::COMPONENT_LAYOUT_BGR, 10, 11, 11, 0, Anvil::FORMAT_TYPE_UFLOAT, true}, - {Anvil::Format::E5B9G9R9_UFLOAT_PACK32, "VK_FORMAT_E5B9G9R9_UFLOAT_PACK32", Anvil::COMPONENT_LAYOUT_EBGR, 5, 9, 9, 9, Anvil::FORMAT_TYPE_UFLOAT, true}, - {Anvil::Format::D16_UNORM, "VK_FORMAT_D16_UNORM", Anvil::COMPONENT_LAYOUT_D, 16, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::X8_D24_UNORM_PACK32, "VK_FORMAT_X8_D24_UNORM_PACK32", Anvil::COMPONENT_LAYOUT_XD, 8, 24, 0, 0, Anvil::FORMAT_TYPE_UNORM, true}, - {Anvil::Format::D32_SFLOAT, "VK_FORMAT_D32_SFLOAT", Anvil::COMPONENT_LAYOUT_D, 32, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {Anvil::Format::S8_UINT, "VK_FORMAT_S8_UINT", Anvil::COMPONENT_LAYOUT_S, 8, 0, 0, 0, Anvil::FORMAT_TYPE_UINT, false}, - {Anvil::Format::D16_UNORM_S8_UINT, "VK_FORMAT_D16_UNORM_S8_UINT", Anvil::COMPONENT_LAYOUT_DS, 16, 8, 0, 0, Anvil::FORMAT_TYPE_UNORM_UINT, false}, - {Anvil::Format::D24_UNORM_S8_UINT, "VK_FORMAT_D24_UNORM_S8_UINT", Anvil::COMPONENT_LAYOUT_DS, 24, 8, 0, 0, Anvil::FORMAT_TYPE_UNORM_UINT, false}, - {Anvil::Format::D32_SFLOAT_S8_UINT, "VK_FORMAT_D32_SFLOAT_S8_UINT", Anvil::COMPONENT_LAYOUT_DS, 32, 8, 0, 0, Anvil::FORMAT_TYPE_SFLOAT_UINT, false}, - {Anvil::Format::BC1_RGB_UNORM_BLOCK, "VK_FORMAT_BC1_RGB_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::BC1_RGB_SRGB_BLOCK, "VK_FORMAT_BC1_RGB_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::BC1_RGBA_UNORM_BLOCK, "VK_FORMAT_BC1_RGBA_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::BC1_RGBA_SRGB_BLOCK, "VK_FORMAT_BC1_RGBA_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::BC2_UNORM_BLOCK, "VK_FORMAT_BC2_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::BC2_SRGB_BLOCK, "VK_FORMAT_BC2_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::BC3_UNORM_BLOCK, "VK_FORMAT_BC3_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::BC3_SRGB_BLOCK, "VK_FORMAT_BC3_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::BC4_UNORM_BLOCK, "VK_FORMAT_BC4_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_R, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::BC4_SNORM_BLOCK, "VK_FORMAT_BC4_SNORM_BLOCK", Anvil::COMPONENT_LAYOUT_R, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {Anvil::Format::BC5_UNORM_BLOCK, "VK_FORMAT_BC5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RG, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::BC5_SNORM_BLOCK, "VK_FORMAT_BC5_SNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RG, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {Anvil::Format::BC6H_UFLOAT_BLOCK, "VK_FORMAT_BC6H_UFLOAT_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UFLOAT, false}, - {Anvil::Format::BC6H_SFLOAT_BLOCK, "VK_FORMAT_BC6H_SFLOAT_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SFLOAT, false}, - {Anvil::Format::BC7_UNORM_BLOCK, "VK_FORMAT_BC7_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::BC7_SRGB_BLOCK, "VK_FORMAT_BC7_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::ETC2_R8G8B8_UNORM_BLOCK, "VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::ETC2_R8G8B8_SRGB_BLOCK, "VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGB, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::ETC2_R8G8B8A1_UNORM_BLOCK, "VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::ETC2_R8G8B8A1_SRGB_BLOCK, "VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::ETC2_R8G8B8A8_UNORM_BLOCK, "VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::ETC2_R8G8B8A8_SRGB_BLOCK, "VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::EAC_R11_UNORM_BLOCK, "VK_FORMAT_EAC_R11_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_R, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::EAC_R11_SNORM_BLOCK, "VK_FORMAT_EAC_R11_SNORM_BLOCK", Anvil::COMPONENT_LAYOUT_R, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {Anvil::Format::EAC_R11G11_UNORM_BLOCK, "VK_FORMAT_EAC_R11G11_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RG, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::EAC_R11G11_SNORM_BLOCK, "VK_FORMAT_EAC_R11G11_SNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RG, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SNORM, false}, - {Anvil::Format::ASTC_4x4_UNORM_BLOCK, "VK_FORMAT_ASTC_4x4_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::ASTC_4x4_SRGB_BLOCK, "VK_FORMAT_ASTC_4x4_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::ASTC_5x4_UNORM_BLOCK, "VK_FORMAT_ASTC_5x4_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::ASTC_5x4_SRGB_BLOCK, "VK_FORMAT_ASTC_5x4_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::ASTC_5x5_UNORM_BLOCK, "VK_FORMAT_ASTC_5x5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::ASTC_5x5_SRGB_BLOCK, "VK_FORMAT_ASTC_5x5_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::ASTC_6x5_UNORM_BLOCK, "VK_FORMAT_ASTC_6x5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::ASTC_6x5_SRGB_BLOCK, "VK_FORMAT_ASTC_6x5_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::ASTC_6x6_UNORM_BLOCK, "VK_FORMAT_ASTC_6x6_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::ASTC_6x6_SRGB_BLOCK, "VK_FORMAT_ASTC_6x6_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::ASTC_8x5_UNORM_BLOCK, "VK_FORMAT_ASTC_8x5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::ASTC_8x5_SRGB_BLOCK, "VK_FORMAT_ASTC_8x5_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::ASTC_8x6_UNORM_BLOCK, "VK_FORMAT_ASTC_8x6_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::ASTC_8x6_SRGB_BLOCK, "VK_FORMAT_ASTC_8x6_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::ASTC_8x8_UNORM_BLOCK, "VK_FORMAT_ASTC_8x8_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::ASTC_8x8_SRGB_BLOCK, "VK_FORMAT_ASTC_8x8_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::ASTC_10x5_UNORM_BLOCK, "VK_FORMAT_ASTC_10x5_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::ASTC_10x5_SRGB_BLOCK, "VK_FORMAT_ASTC_10x5_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::ASTC_10x6_UNORM_BLOCK, "VK_FORMAT_ASTC_10x6_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::ASTC_10x6_SRGB_BLOCK, "VK_FORMAT_ASTC_10x6_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::ASTC_10x8_UNORM_BLOCK, "VK_FORMAT_ASTC_10x8_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::ASTC_10x8_SRGB_BLOCK, "VK_FORMAT_ASTC_10x8_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::ASTC_10x10_UNORM_BLOCK, "VK_FORMAT_ASTC_10x10_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::ASTC_10x10_SRGB_BLOCK, "VK_FORMAT_ASTC_10x10_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::ASTC_12x10_UNORM_BLOCK, "VK_FORMAT_ASTC_12x10_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::ASTC_12x10_SRGB_BLOCK, "VK_FORMAT_ASTC_12x10_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false}, - {Anvil::Format::ASTC_12x12_UNORM_BLOCK, "VK_FORMAT_ASTC_12x12_UNORM_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_UNORM, false}, - {Anvil::Format::ASTC_12x12_SRGB_BLOCK, "VK_FORMAT_ASTC_12x12_SRGB_BLOCK", Anvil::COMPONENT_LAYOUT_RGBA, 0, 0, 0, 0, Anvil::FORMAT_TYPE_SRGB, false} + {Anvil::Format::UNKNOWN, "VK_FORMAT_UNDEFINED", Anvil::ComponentLayout::UNKNOWN, 0, 0, 0, 0, Anvil::FormatType::UNKNOWN, false}, + {Anvil::Format::R4G4_UNORM_PACK8, "VK_FORMAT_R4G4_UNORM_PACK8", Anvil::ComponentLayout::RG, 4, 4, 0, 0, Anvil::FormatType::UNORM, true}, + {Anvil::Format::R4G4B4A4_UNORM_PACK16, "VK_FORMAT_R4G4B4A4_UNORM_PACK16", Anvil::ComponentLayout::RGBA, 4, 4, 4, 4, Anvil::FormatType::UNORM, true}, + {Anvil::Format::B4G4R4A4_UNORM_PACK16, "VK_FORMAT_B4G4R4A4_UNORM_PACK16", Anvil::ComponentLayout::BGRA, 4, 4, 4, 4, Anvil::FormatType::UNORM, true}, + {Anvil::Format::R5G6B5_UNORM_PACK16, "VK_FORMAT_R5G6B5_UNORM_PACK16", Anvil::ComponentLayout::RGB, 5, 6, 5, 0, Anvil::FormatType::UNORM, true}, + {Anvil::Format::B5G6R5_UNORM_PACK16, "VK_FORMAT_B5G6R5_UNORM_PACK16", Anvil::ComponentLayout::BGR, 5, 6, 5, 0, Anvil::FormatType::UNORM, true}, + {Anvil::Format::R5G5B5A1_UNORM_PACK16, "VK_FORMAT_R5G5B5A1_UNORM_PACK16", Anvil::ComponentLayout::RGBA, 5, 5, 5, 1, Anvil::FormatType::UNORM, true}, + {Anvil::Format::B5G5R5A1_UNORM_PACK16, "VK_FORMAT_B5G5R5A1_UNORM_PACK16", Anvil::ComponentLayout::BGRA, 5, 5, 5, 1, Anvil::FormatType::UNORM, true}, + {Anvil::Format::A1R5G5B5_UNORM_PACK16, "VK_FORMAT_A1R5G5B5_UNORM_PACK16", Anvil::ComponentLayout::ARGB, 1, 5, 5, 5, Anvil::FormatType::UNORM, true}, + {Anvil::Format::R8_UNORM, "VK_FORMAT_R8_UNORM", Anvil::ComponentLayout::R, 8, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::R8_SNORM, "VK_FORMAT_R8_SNORM", Anvil::ComponentLayout::R, 8, 0, 0, 0, Anvil::FormatType::SNORM, false}, + {Anvil::Format::R8_USCALED, "VK_FORMAT_R8_USCALED", Anvil::ComponentLayout::R, 8, 0, 0, 0, Anvil::FormatType::USCALED, false}, + {Anvil::Format::R8_SSCALED, "VK_FORMAT_R8_SSCALED", Anvil::ComponentLayout::R, 8, 0, 0, 0, Anvil::FormatType::SSCALED, false}, + {Anvil::Format::R8_UINT, "VK_FORMAT_R8_UINT", Anvil::ComponentLayout::R, 8, 0, 0, 0, Anvil::FormatType::UINT, false}, + {Anvil::Format::R8_SINT, "VK_FORMAT_R8_SINT", Anvil::ComponentLayout::R, 8, 0, 0, 0, Anvil::FormatType::SINT, false}, + {Anvil::Format::R8_SRGB, "VK_FORMAT_R8_SRGB", Anvil::ComponentLayout::R, 8, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::R8G8_UNORM, "VK_FORMAT_R8G8_UNORM", Anvil::ComponentLayout::RG, 8, 8, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::R8G8_SNORM, "VK_FORMAT_R8G8_SNORM", Anvil::ComponentLayout::RG, 8, 8, 0, 0, Anvil::FormatType::SNORM, false}, + {Anvil::Format::R8G8_USCALED, "VK_FORMAT_R8G8_USCALED", Anvil::ComponentLayout::RG, 8, 8, 0, 0, Anvil::FormatType::USCALED, false}, + {Anvil::Format::R8G8_SSCALED, "VK_FORMAT_R8G8_SSCALED", Anvil::ComponentLayout::RG, 8, 8, 0, 0, Anvil::FormatType::SSCALED, false}, + {Anvil::Format::R8G8_UINT, "VK_FORMAT_R8G8_UINT", Anvil::ComponentLayout::RG, 8, 8, 0, 0, Anvil::FormatType::UINT, false}, + {Anvil::Format::R8G8_SINT, "VK_FORMAT_R8G8_SINT", Anvil::ComponentLayout::RG, 8, 8, 0, 0, Anvil::FormatType::SINT, false}, + {Anvil::Format::R8G8_SRGB, "VK_FORMAT_R8G8_SRGB", Anvil::ComponentLayout::RG, 8, 8, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::R8G8B8_UNORM, "VK_FORMAT_R8G8B8_UNORM", Anvil::ComponentLayout::RGB, 8, 8, 8, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::R8G8B8_SNORM, "VK_FORMAT_R8G8B8_SNORM", Anvil::ComponentLayout::RGB, 8, 8, 8, 0, Anvil::FormatType::SNORM, false}, + {Anvil::Format::R8G8B8_USCALED, "VK_FORMAT_R8G8B8_USCALED", Anvil::ComponentLayout::RGB, 8, 8, 8, 0, Anvil::FormatType::USCALED, false}, + {Anvil::Format::R8G8B8_SSCALED, "VK_FORMAT_R8G8B8_SSCALED", Anvil::ComponentLayout::RGB, 8, 8, 8, 0, Anvil::FormatType::SSCALED, false}, + {Anvil::Format::R8G8B8_UINT, "VK_FORMAT_R8G8B8_UINT", Anvil::ComponentLayout::RGB, 8, 8, 8, 0, Anvil::FormatType::UINT, false}, + {Anvil::Format::R8G8B8_SINT, "VK_FORMAT_R8G8B8_SINT", Anvil::ComponentLayout::RGB, 8, 8, 8, 0, Anvil::FormatType::SINT, false}, + {Anvil::Format::R8G8B8_SRGB, "VK_FORMAT_R8G8B8_SRGB", Anvil::ComponentLayout::RGB, 8, 8, 8, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::B8G8R8_UNORM, "VK_FORMAT_B8G8R8_UNORM", Anvil::ComponentLayout::BGR, 8, 8, 8, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::B8G8R8_SNORM, "VK_FORMAT_B8G8R8_SNORM", Anvil::ComponentLayout::BGR, 8, 8, 8, 0, Anvil::FormatType::SNORM, false}, + {Anvil::Format::B8G8R8_USCALED, "VK_FORMAT_B8G8R8_USCALED", Anvil::ComponentLayout::BGR, 8, 8, 8, 0, Anvil::FormatType::USCALED, false}, + {Anvil::Format::B8G8R8_SSCALED, "VK_FORMAT_B8G8R8_SSCALED", Anvil::ComponentLayout::BGR, 8, 8, 8, 0, Anvil::FormatType::SSCALED, false}, + {Anvil::Format::B8G8R8_UINT, "VK_FORMAT_B8G8R8_UINT", Anvil::ComponentLayout::BGR, 8, 8, 8, 0, Anvil::FormatType::UINT, false}, + {Anvil::Format::B8G8R8_SINT, "VK_FORMAT_B8G8R8_SINT", Anvil::ComponentLayout::BGR, 8, 8, 8, 0, Anvil::FormatType::SINT, false}, + {Anvil::Format::B8G8R8_SRGB, "VK_FORMAT_B8G8R8_SRGB", Anvil::ComponentLayout::BGR, 8, 8, 8, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::R8G8B8A8_UNORM, "VK_FORMAT_R8G8B8A8_UNORM", Anvil::ComponentLayout::RGBA, 8, 8, 8, 8, Anvil::FormatType::UNORM, false}, + {Anvil::Format::R8G8B8A8_SNORM, "VK_FORMAT_R8G8B8A8_SNORM", Anvil::ComponentLayout::RGBA, 8, 8, 8, 8, Anvil::FormatType::SNORM, false}, + {Anvil::Format::R8G8B8A8_USCALED, "VK_FORMAT_R8G8B8A8_USCALED", Anvil::ComponentLayout::RGBA, 8, 8, 8, 8, Anvil::FormatType::USCALED, false}, + {Anvil::Format::R8G8B8A8_SSCALED, "VK_FORMAT_R8G8B8A8_SSCALED", Anvil::ComponentLayout::RGBA, 8, 8, 8, 8, Anvil::FormatType::SSCALED, false}, + {Anvil::Format::R8G8B8A8_UINT, "VK_FORMAT_R8G8B8A8_UINT", Anvil::ComponentLayout::RGBA, 8, 8, 8, 8, Anvil::FormatType::UINT, false}, + {Anvil::Format::R8G8B8A8_SINT, "VK_FORMAT_R8G8B8A8_SINT", Anvil::ComponentLayout::RGBA, 8, 8, 8, 8, Anvil::FormatType::SINT, false}, + {Anvil::Format::R8G8B8A8_SRGB, "VK_FORMAT_R8G8B8A8_SRGB", Anvil::ComponentLayout::RGBA, 8, 8, 8, 8, Anvil::FormatType::SRGB, false}, + {Anvil::Format::B8G8R8A8_UNORM, "VK_FORMAT_B8G8R8A8_UNORM", Anvil::ComponentLayout::BGRA, 8, 8, 8, 8, Anvil::FormatType::UNORM, false}, + {Anvil::Format::B8G8R8A8_SNORM, "VK_FORMAT_B8G8R8A8_SNORM", Anvil::ComponentLayout::BGRA, 8, 8, 8, 8, Anvil::FormatType::SNORM, false}, + {Anvil::Format::B8G8R8A8_USCALED, "VK_FORMAT_B8G8R8A8_USCALED", Anvil::ComponentLayout::BGRA, 8, 8, 8, 8, Anvil::FormatType::USCALED, false}, + {Anvil::Format::B8G8R8A8_SSCALED, "VK_FORMAT_B8G8R8A8_SSCALED", Anvil::ComponentLayout::BGRA, 8, 8, 8, 8, Anvil::FormatType::SSCALED, false}, + {Anvil::Format::B8G8R8A8_UINT, "VK_FORMAT_B8G8R8A8_UINT", Anvil::ComponentLayout::BGRA, 8, 8, 8, 8, Anvil::FormatType::UINT, false}, + {Anvil::Format::B8G8R8A8_SINT, "VK_FORMAT_B8G8R8A8_SINT", Anvil::ComponentLayout::BGRA, 8, 8, 8, 8, Anvil::FormatType::SINT, false}, + {Anvil::Format::B8G8R8A8_SRGB, "VK_FORMAT_B8G8R8A8_SRGB", Anvil::ComponentLayout::BGRA, 8, 8, 8, 8, Anvil::FormatType::SRGB, false}, + {Anvil::Format::A8B8G8R8_UNORM_PACK32, "VK_FORMAT_A8B8G8R8_UNORM_PACK32", Anvil::ComponentLayout::ABGR, 8, 8, 8, 8, Anvil::FormatType::UNORM, true}, + {Anvil::Format::A8B8G8R8_SNORM_PACK32, "VK_FORMAT_A8B8G8R8_SNORM_PACK32", Anvil::ComponentLayout::ABGR, 8, 8, 8, 8, Anvil::FormatType::SNORM, true}, + {Anvil::Format::A8B8G8R8_USCALED_PACK32, "VK_FORMAT_A8B8G8R8_USCALED_PACK32", Anvil::ComponentLayout::ABGR, 8, 8, 8, 8, Anvil::FormatType::USCALED, true}, + {Anvil::Format::A8B8G8R8_SSCALED_PACK32, "VK_FORMAT_A8B8G8R8_SSCALED_PACK32", Anvil::ComponentLayout::ABGR, 8, 8, 8, 8, Anvil::FormatType::SSCALED, true}, + {Anvil::Format::A8B8G8R8_UINT_PACK32, "VK_FORMAT_A8B8G8R8_UINT_PACK32", Anvil::ComponentLayout::ABGR, 8, 8, 8, 8, Anvil::FormatType::UINT, true}, + {Anvil::Format::A8B8G8R8_SINT_PACK32, "VK_FORMAT_A8B8G8R8_SINT_PACK32", Anvil::ComponentLayout::ABGR, 8, 8, 8, 8, Anvil::FormatType::SINT, true}, + {Anvil::Format::A8B8G8R8_SRGB_PACK32, "VK_FORMAT_A8B8G8R8_SRGB_PACK32", Anvil::ComponentLayout::ABGR, 8, 8, 8, 8, Anvil::FormatType::SRGB, true}, + {Anvil::Format::A2R10G10B10_UNORM_PACK32, "VK_FORMAT_A2R10G10B10_UNORM_PACK32", Anvil::ComponentLayout::ARGB, 2, 10, 10, 10, Anvil::FormatType::UNORM, true}, + {Anvil::Format::A2R10G10B10_SNORM_PACK32, "VK_FORMAT_A2R10G10B10_SNORM_PACK32", Anvil::ComponentLayout::ARGB, 2, 10, 10, 10, Anvil::FormatType::SNORM, true}, + {Anvil::Format::A2R10G10B10_USCALED_PACK32, "VK_FORMAT_A2R10G10B10_USCALED_PACK32", Anvil::ComponentLayout::ARGB, 2, 10, 10, 10, Anvil::FormatType::USCALED, true}, + {Anvil::Format::A2R10G10B10_SSCALED_PACK32, "VK_FORMAT_A2R10G10B10_SSCALED_PACK32", Anvil::ComponentLayout::ARGB, 2, 10, 10, 10, Anvil::FormatType::SSCALED, true}, + {Anvil::Format::A2R10G10B10_UINT_PACK32, "VK_FORMAT_A2R10G10B10_UINT_PACK32", Anvil::ComponentLayout::ARGB, 2, 10, 10, 10, Anvil::FormatType::UINT, true}, + {Anvil::Format::A2R10G10B10_SINT_PACK32, "VK_FORMAT_A2R10G10B10_SINT_PACK32", Anvil::ComponentLayout::ARGB, 2, 10, 10, 10, Anvil::FormatType::SINT, true}, + {Anvil::Format::A2B10G10R10_UNORM_PACK32, "VK_FORMAT_A2B10G10R10_UNORM_PACK32", Anvil::ComponentLayout::ABGR, 2, 10, 10, 10, Anvil::FormatType::UNORM, true}, + {Anvil::Format::A2B10G10R10_SNORM_PACK32, "VK_FORMAT_A2B10G10R10_SNORM_PACK32", Anvil::ComponentLayout::ABGR, 2, 10, 10, 10, Anvil::FormatType::SNORM, true}, + {Anvil::Format::A2B10G10R10_USCALED_PACK32, "VK_FORMAT_A2B10G10R10_USCALED_PACK32", Anvil::ComponentLayout::ABGR, 2, 10, 10, 10, Anvil::FormatType::USCALED, true}, + {Anvil::Format::A2B10G10R10_SSCALED_PACK32, "VK_FORMAT_A2B10G10R10_SSCALED_PACK32", Anvil::ComponentLayout::ABGR, 2, 10, 10, 10, Anvil::FormatType::SSCALED, true}, + {Anvil::Format::A2B10G10R10_UINT_PACK32, "VK_FORMAT_A2B10G10R10_UINT_PACK32", Anvil::ComponentLayout::ABGR, 2, 10, 10, 10, Anvil::FormatType::UINT, true}, + {Anvil::Format::A2B10G10R10_SINT_PACK32, "VK_FORMAT_A2B10G10R10_SINT_PACK32", Anvil::ComponentLayout::ABGR, 2, 10, 10, 10, Anvil::FormatType::SINT, true}, + {Anvil::Format::R16_UNORM, "VK_FORMAT_R16_UNORM", Anvil::ComponentLayout::R, 16, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::R16_SNORM, "VK_FORMAT_R16_SNORM", Anvil::ComponentLayout::R, 16, 0, 0, 0, Anvil::FormatType::SNORM, false}, + {Anvil::Format::R16_USCALED, "VK_FORMAT_R16_USCALED", Anvil::ComponentLayout::R, 16, 0, 0, 0, Anvil::FormatType::USCALED, false}, + {Anvil::Format::R16_SSCALED, "VK_FORMAT_R16_SSCALED", Anvil::ComponentLayout::R, 16, 0, 0, 0, Anvil::FormatType::SSCALED, false}, + {Anvil::Format::R16_UINT, "VK_FORMAT_R16_UINT", Anvil::ComponentLayout::R, 16, 0, 0, 0, Anvil::FormatType::UINT, false}, + {Anvil::Format::R16_SINT, "VK_FORMAT_R16_SINT", Anvil::ComponentLayout::R, 16, 0, 0, 0, Anvil::FormatType::SINT, false}, + {Anvil::Format::R16_SFLOAT, "VK_FORMAT_R16_SFLOAT", Anvil::ComponentLayout::R, 16, 0, 0, 0, Anvil::FormatType::SFLOAT, false}, + {Anvil::Format::R16G16_UNORM, "VK_FORMAT_R16G16_UNORM", Anvil::ComponentLayout::RG, 16, 16, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::R16G16_SNORM, "VK_FORMAT_R16G16_SNORM", Anvil::ComponentLayout::RG, 16, 16, 0, 0, Anvil::FormatType::SNORM, false}, + {Anvil::Format::R16G16_USCALED, "VK_FORMAT_R16G16_USCALED", Anvil::ComponentLayout::RG, 16, 16, 0, 0, Anvil::FormatType::USCALED, false}, + {Anvil::Format::R16G16_SSCALED, "VK_FORMAT_R16G16_SSCALED", Anvil::ComponentLayout::RG, 16, 16, 0, 0, Anvil::FormatType::SSCALED, false}, + {Anvil::Format::R16G16_UINT, "VK_FORMAT_R16G16_UINT", Anvil::ComponentLayout::RG, 16, 16, 0, 0, Anvil::FormatType::UINT, false}, + {Anvil::Format::R16G16_SINT, "VK_FORMAT_R16G16_SINT", Anvil::ComponentLayout::RG, 16, 16, 0, 0, Anvil::FormatType::SINT, false}, + {Anvil::Format::R16G16_SFLOAT, "VK_FORMAT_R16G16_SFLOAT", Anvil::ComponentLayout::RG, 16, 16, 0, 0, Anvil::FormatType::SFLOAT, false}, + {Anvil::Format::R16G16B16_UNORM, "VK_FORMAT_R16G16B16_UNORM", Anvil::ComponentLayout::RGB, 16, 16, 16, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::R16G16B16_SNORM, "VK_FORMAT_R16G16B16_SNORM", Anvil::ComponentLayout::RGB, 16, 16, 16, 0, Anvil::FormatType::SNORM, false}, + {Anvil::Format::R16G16B16_USCALED, "VK_FORMAT_R16G16B16_USCALED", Anvil::ComponentLayout::RGB, 16, 16, 16, 0, Anvil::FormatType::USCALED, false}, + {Anvil::Format::R16G16B16_SSCALED, "VK_FORMAT_R16G16B16_SSCALED", Anvil::ComponentLayout::RGB, 16, 16, 16, 0, Anvil::FormatType::SSCALED, false}, + {Anvil::Format::R16G16B16_UINT, "VK_FORMAT_R16G16B16_UINT", Anvil::ComponentLayout::RGB, 16, 16, 16, 0, Anvil::FormatType::UINT, false}, + {Anvil::Format::R16G16B16_SINT, "VK_FORMAT_R16G16B16_SINT", Anvil::ComponentLayout::RGB, 16, 16, 16, 0, Anvil::FormatType::SINT, false}, + {Anvil::Format::R16G16B16_SFLOAT, "VK_FORMAT_R16G16B16_SFLOAT", Anvil::ComponentLayout::RGB, 16, 16, 16, 0, Anvil::FormatType::SFLOAT, false}, + {Anvil::Format::R16G16B16A16_UNORM, "VK_FORMAT_R16G16B16A16_UNORM", Anvil::ComponentLayout::RGBA, 16, 16, 16, 16, Anvil::FormatType::UNORM, false}, + {Anvil::Format::R16G16B16A16_SNORM, "VK_FORMAT_R16G16B16A16_SNORM", Anvil::ComponentLayout::RGBA, 16, 16, 16, 16, Anvil::FormatType::SNORM, false}, + {Anvil::Format::R16G16B16A16_USCALED, "VK_FORMAT_R16G16B16A16_USCALED", Anvil::ComponentLayout::RGBA, 16, 16, 16, 16, Anvil::FormatType::USCALED, false}, + {Anvil::Format::R16G16B16A16_SSCALED, "VK_FORMAT_R16G16B16A16_SSCALED", Anvil::ComponentLayout::RGBA, 16, 16, 16, 16, Anvil::FormatType::SSCALED, false}, + {Anvil::Format::R16G16B16A16_UINT, "VK_FORMAT_R16G16B16A16_UINT", Anvil::ComponentLayout::RGBA, 16, 16, 16, 16, Anvil::FormatType::UINT, false}, + {Anvil::Format::R16G16B16A16_SINT, "VK_FORMAT_R16G16B16A16_SINT", Anvil::ComponentLayout::RGBA, 16, 16, 16, 16, Anvil::FormatType::SINT, false}, + {Anvil::Format::R16G16B16A16_SFLOAT, "VK_FORMAT_R16G16B16A16_SFLOAT", Anvil::ComponentLayout::RGBA, 16, 16, 16, 16, Anvil::FormatType::SFLOAT, false}, + {Anvil::Format::R32_UINT, "VK_FORMAT_R32_UINT", Anvil::ComponentLayout::R, 32, 0, 0, 0, Anvil::FormatType::UINT, false}, + {Anvil::Format::R32_SINT, "VK_FORMAT_R32_SINT", Anvil::ComponentLayout::R, 32, 0, 0, 0, Anvil::FormatType::SINT, false}, + {Anvil::Format::R32_SFLOAT, "VK_FORMAT_R32_SFLOAT", Anvil::ComponentLayout::R, 32, 0, 0, 0, Anvil::FormatType::SFLOAT, false}, + {Anvil::Format::R32G32_UINT, "VK_FORMAT_R32G32_UINT", Anvil::ComponentLayout::RG, 32, 32, 0, 0, Anvil::FormatType::UINT, false}, + {Anvil::Format::R32G32_SINT, "VK_FORMAT_R32G32_SINT", Anvil::ComponentLayout::RG, 32, 32, 0, 0, Anvil::FormatType::SINT, false}, + {Anvil::Format::R32G32_SFLOAT, "VK_FORMAT_R32G32_SFLOAT", Anvil::ComponentLayout::RG, 32, 32, 0, 0, Anvil::FormatType::SFLOAT, false}, + {Anvil::Format::R32G32B32_UINT, "VK_FORMAT_R32G32B32_UINT", Anvil::ComponentLayout::RGB, 32, 32, 32, 0, Anvil::FormatType::UINT, false}, + {Anvil::Format::R32G32B32_SINT, "VK_FORMAT_R32G32B32_SINT", Anvil::ComponentLayout::RGB, 32, 32, 32, 0, Anvil::FormatType::SINT, false}, + {Anvil::Format::R32G32B32_SFLOAT, "VK_FORMAT_R32G32B32_SFLOAT", Anvil::ComponentLayout::RGB, 32, 32, 32, 0, Anvil::FormatType::SFLOAT, false}, + {Anvil::Format::R32G32B32A32_UINT, "VK_FORMAT_R32G32B32A32_UINT", Anvil::ComponentLayout::RGBA, 32, 32, 32, 32, Anvil::FormatType::UINT, false}, + {Anvil::Format::R32G32B32A32_SINT, "VK_FORMAT_R32G32B32A32_SINT", Anvil::ComponentLayout::RGBA, 32, 32, 32, 32, Anvil::FormatType::SINT, false}, + {Anvil::Format::R32G32B32A32_SFLOAT, "VK_FORMAT_R32G32B32A32_SFLOAT", Anvil::ComponentLayout::RGBA, 32, 32, 32, 32, Anvil::FormatType::SFLOAT, false}, + {Anvil::Format::R64_UINT, "VK_FORMAT_R64_UINT", Anvil::ComponentLayout::R, 64, 0, 0, 0, Anvil::FormatType::UINT, false}, + {Anvil::Format::R64_SINT, "VK_FORMAT_R64_SINT", Anvil::ComponentLayout::R, 64, 0, 0, 0, Anvil::FormatType::SINT, false}, + {Anvil::Format::R64_SFLOAT, "VK_FORMAT_R64_SFLOAT", Anvil::ComponentLayout::R, 64, 0, 0, 0, Anvil::FormatType::SFLOAT, false}, + {Anvil::Format::R64G64_UINT, "VK_FORMAT_R64G64_UINT", Anvil::ComponentLayout::RG, 64, 64, 0, 0, Anvil::FormatType::UINT, false}, + {Anvil::Format::R64G64_SINT, "VK_FORMAT_R64G64_SINT", Anvil::ComponentLayout::RG, 64, 64, 0, 0, Anvil::FormatType::SINT, false}, + {Anvil::Format::R64G64_SFLOAT, "VK_FORMAT_R64G64_SFLOAT", Anvil::ComponentLayout::RG, 64, 64, 0, 0, Anvil::FormatType::SFLOAT, false}, + {Anvil::Format::R64G64B64_UINT, "VK_FORMAT_R64G64B64_UINT", Anvil::ComponentLayout::RGB, 64, 64, 64, 0, Anvil::FormatType::UINT, false}, + {Anvil::Format::R64G64B64_SINT, "VK_FORMAT_R64G64B64_SINT", Anvil::ComponentLayout::RGB, 64, 64, 64, 0, Anvil::FormatType::SINT, false}, + {Anvil::Format::R64G64B64_SFLOAT, "VK_FORMAT_R64G64B64_SFLOAT", Anvil::ComponentLayout::RGB, 64, 64, 64, 0, Anvil::FormatType::SFLOAT, false}, + {Anvil::Format::R64G64B64A64_UINT, "VK_FORMAT_R64G64B64A64_UINT", Anvil::ComponentLayout::RGBA, 64, 64, 64, 64, Anvil::FormatType::UINT, false}, + {Anvil::Format::R64G64B64A64_SINT, "VK_FORMAT_R64G64B64A64_SINT", Anvil::ComponentLayout::RGBA, 64, 64, 64, 64, Anvil::FormatType::SINT, false}, + {Anvil::Format::R64G64B64A64_SFLOAT, "VK_FORMAT_R64G64B64A64_SFLOAT", Anvil::ComponentLayout::RGBA, 64, 64, 64, 64, Anvil::FormatType::SFLOAT, false}, + {Anvil::Format::B10G11R11_UFLOAT_PACK32, "VK_FORMAT_B10G11R11_UFLOAT_PACK32", Anvil::ComponentLayout::BGR, 10, 11, 11, 0, Anvil::FormatType::UFLOAT, true}, + {Anvil::Format::E5B9G9R9_UFLOAT_PACK32, "VK_FORMAT_E5B9G9R9_UFLOAT_PACK32", Anvil::ComponentLayout::EBGR, 5, 9, 9, 9, Anvil::FormatType::UFLOAT, true}, + {Anvil::Format::D16_UNORM, "VK_FORMAT_D16_UNORM", Anvil::ComponentLayout::D, 16, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::X8_D24_UNORM_PACK32, "VK_FORMAT_X8_D24_UNORM_PACK32", Anvil::ComponentLayout::XD, 8, 24, 0, 0, Anvil::FormatType::UNORM, true}, + {Anvil::Format::D32_SFLOAT, "VK_FORMAT_D32_SFLOAT", Anvil::ComponentLayout::D, 32, 0, 0, 0, Anvil::FormatType::SFLOAT, false}, + {Anvil::Format::S8_UINT, "VK_FORMAT_S8_UINT", Anvil::ComponentLayout::S, 8, 0, 0, 0, Anvil::FormatType::UINT, false}, + {Anvil::Format::D16_UNORM_S8_UINT, "VK_FORMAT_D16_UNORM_S8_UINT", Anvil::ComponentLayout::DS, 16, 8, 0, 0, Anvil::FormatType::UNORM_UINT, false}, + {Anvil::Format::D24_UNORM_S8_UINT, "VK_FORMAT_D24_UNORM_S8_UINT", Anvil::ComponentLayout::DS, 24, 8, 0, 0, Anvil::FormatType::UNORM_UINT, false}, + {Anvil::Format::D32_SFLOAT_S8_UINT, "VK_FORMAT_D32_SFLOAT_S8_UINT", Anvil::ComponentLayout::DS, 32, 8, 0, 0, Anvil::FormatType::SFLOAT_UINT, false}, + {Anvil::Format::BC1_RGB_UNORM_BLOCK, "VK_FORMAT_BC1_RGB_UNORM_BLOCK", Anvil::ComponentLayout::RGB, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::BC1_RGB_SRGB_BLOCK, "VK_FORMAT_BC1_RGB_SRGB_BLOCK", Anvil::ComponentLayout::RGB, 0, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::BC1_RGBA_UNORM_BLOCK, "VK_FORMAT_BC1_RGBA_UNORM_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::BC1_RGBA_SRGB_BLOCK, "VK_FORMAT_BC1_RGBA_SRGB_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::BC2_UNORM_BLOCK, "VK_FORMAT_BC2_UNORM_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::BC2_SRGB_BLOCK, "VK_FORMAT_BC2_SRGB_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::BC3_UNORM_BLOCK, "VK_FORMAT_BC3_UNORM_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::BC3_SRGB_BLOCK, "VK_FORMAT_BC3_SRGB_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::BC4_UNORM_BLOCK, "VK_FORMAT_BC4_UNORM_BLOCK", Anvil::ComponentLayout::R, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::BC4_SNORM_BLOCK, "VK_FORMAT_BC4_SNORM_BLOCK", Anvil::ComponentLayout::R, 0, 0, 0, 0, Anvil::FormatType::SNORM, false}, + {Anvil::Format::BC5_UNORM_BLOCK, "VK_FORMAT_BC5_UNORM_BLOCK", Anvil::ComponentLayout::RG, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::BC5_SNORM_BLOCK, "VK_FORMAT_BC5_SNORM_BLOCK", Anvil::ComponentLayout::RG, 0, 0, 0, 0, Anvil::FormatType::SNORM, false}, + {Anvil::Format::BC6H_UFLOAT_BLOCK, "VK_FORMAT_BC6H_UFLOAT_BLOCK", Anvil::ComponentLayout::RGB, 0, 0, 0, 0, Anvil::FormatType::UFLOAT, false}, + {Anvil::Format::BC6H_SFLOAT_BLOCK, "VK_FORMAT_BC6H_SFLOAT_BLOCK", Anvil::ComponentLayout::RGB, 0, 0, 0, 0, Anvil::FormatType::SFLOAT, false}, + {Anvil::Format::BC7_UNORM_BLOCK, "VK_FORMAT_BC7_UNORM_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::BC7_SRGB_BLOCK, "VK_FORMAT_BC7_SRGB_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::ETC2_R8G8B8_UNORM_BLOCK, "VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK", Anvil::ComponentLayout::RGB, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::ETC2_R8G8B8_SRGB_BLOCK, "VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK", Anvil::ComponentLayout::RGB, 0, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::ETC2_R8G8B8A1_UNORM_BLOCK, "VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::ETC2_R8G8B8A1_SRGB_BLOCK, "VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::ETC2_R8G8B8A8_UNORM_BLOCK, "VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::ETC2_R8G8B8A8_SRGB_BLOCK, "VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::EAC_R11_UNORM_BLOCK, "VK_FORMAT_EAC_R11_UNORM_BLOCK", Anvil::ComponentLayout::R, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::EAC_R11_SNORM_BLOCK, "VK_FORMAT_EAC_R11_SNORM_BLOCK", Anvil::ComponentLayout::R, 0, 0, 0, 0, Anvil::FormatType::SNORM, false}, + {Anvil::Format::EAC_R11G11_UNORM_BLOCK, "VK_FORMAT_EAC_R11G11_UNORM_BLOCK", Anvil::ComponentLayout::RG, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::EAC_R11G11_SNORM_BLOCK, "VK_FORMAT_EAC_R11G11_SNORM_BLOCK", Anvil::ComponentLayout::RG, 0, 0, 0, 0, Anvil::FormatType::SNORM, false}, + {Anvil::Format::ASTC_4x4_UNORM_BLOCK, "VK_FORMAT_ASTC_4x4_UNORM_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::ASTC_4x4_SRGB_BLOCK, "VK_FORMAT_ASTC_4x4_SRGB_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::ASTC_5x4_UNORM_BLOCK, "VK_FORMAT_ASTC_5x4_UNORM_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::ASTC_5x4_SRGB_BLOCK, "VK_FORMAT_ASTC_5x4_SRGB_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::ASTC_5x5_UNORM_BLOCK, "VK_FORMAT_ASTC_5x5_UNORM_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::ASTC_5x5_SRGB_BLOCK, "VK_FORMAT_ASTC_5x5_SRGB_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::ASTC_6x5_UNORM_BLOCK, "VK_FORMAT_ASTC_6x5_UNORM_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::ASTC_6x5_SRGB_BLOCK, "VK_FORMAT_ASTC_6x5_SRGB_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::ASTC_6x6_UNORM_BLOCK, "VK_FORMAT_ASTC_6x6_UNORM_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::ASTC_6x6_SRGB_BLOCK, "VK_FORMAT_ASTC_6x6_SRGB_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::ASTC_8x5_UNORM_BLOCK, "VK_FORMAT_ASTC_8x5_UNORM_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::ASTC_8x5_SRGB_BLOCK, "VK_FORMAT_ASTC_8x5_SRGB_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::ASTC_8x6_UNORM_BLOCK, "VK_FORMAT_ASTC_8x6_UNORM_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::ASTC_8x6_SRGB_BLOCK, "VK_FORMAT_ASTC_8x6_SRGB_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::ASTC_8x8_UNORM_BLOCK, "VK_FORMAT_ASTC_8x8_UNORM_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::ASTC_8x8_SRGB_BLOCK, "VK_FORMAT_ASTC_8x8_SRGB_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::ASTC_10x5_UNORM_BLOCK, "VK_FORMAT_ASTC_10x5_UNORM_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::ASTC_10x5_SRGB_BLOCK, "VK_FORMAT_ASTC_10x5_SRGB_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::ASTC_10x6_UNORM_BLOCK, "VK_FORMAT_ASTC_10x6_UNORM_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::ASTC_10x6_SRGB_BLOCK, "VK_FORMAT_ASTC_10x6_SRGB_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::ASTC_10x8_UNORM_BLOCK, "VK_FORMAT_ASTC_10x8_UNORM_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::ASTC_10x8_SRGB_BLOCK, "VK_FORMAT_ASTC_10x8_SRGB_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::ASTC_10x10_UNORM_BLOCK, "VK_FORMAT_ASTC_10x10_UNORM_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::ASTC_10x10_SRGB_BLOCK, "VK_FORMAT_ASTC_10x10_SRGB_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::ASTC_12x10_UNORM_BLOCK, "VK_FORMAT_ASTC_12x10_UNORM_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::ASTC_12x10_SRGB_BLOCK, "VK_FORMAT_ASTC_12x10_SRGB_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::SRGB, false}, + {Anvil::Format::ASTC_12x12_UNORM_BLOCK, "VK_FORMAT_ASTC_12x12_UNORM_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::UNORM, false}, + {Anvil::Format::ASTC_12x12_SRGB_BLOCK, "VK_FORMAT_ASTC_12x12_SRGB_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::SRGB, false} }; static const struct @@ -652,30 +652,30 @@ bool Anvil::Formats::get_format_aspects(Anvil::Format in /* This image can hold color and/or depth and/or stencil aspects only */ const Anvil::ComponentLayout format_layout = Anvil::Formats::get_format_component_layout(in_format); - if (format_layout == Anvil::COMPONENT_LAYOUT_ABGR || - format_layout == Anvil::COMPONENT_LAYOUT_ARGB || - format_layout == Anvil::COMPONENT_LAYOUT_BGR || - format_layout == Anvil::COMPONENT_LAYOUT_BGRA || - format_layout == Anvil::COMPONENT_LAYOUT_EBGR || - format_layout == Anvil::COMPONENT_LAYOUT_R || - format_layout == Anvil::COMPONENT_LAYOUT_RG || - format_layout == Anvil::COMPONENT_LAYOUT_RGB || - format_layout == Anvil::COMPONENT_LAYOUT_RGBA) + if (format_layout == Anvil::ComponentLayout::ABGR || + format_layout == Anvil::ComponentLayout::ARGB || + format_layout == Anvil::ComponentLayout::BGR || + format_layout == Anvil::ComponentLayout::BGRA || + format_layout == Anvil::ComponentLayout::EBGR || + format_layout == Anvil::ComponentLayout::R || + format_layout == Anvil::ComponentLayout::RG || + format_layout == Anvil::ComponentLayout::RGB || + format_layout == Anvil::ComponentLayout::RGBA) { - out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_COLOR_BIT); + out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::COLOR_BIT); } - if (format_layout == Anvil::COMPONENT_LAYOUT_D || - format_layout == Anvil::COMPONENT_LAYOUT_DS || - format_layout == Anvil::COMPONENT_LAYOUT_XD) + if (format_layout == Anvil::ComponentLayout::D || + format_layout == Anvil::ComponentLayout::DS || + format_layout == Anvil::ComponentLayout::XD) { - out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_DEPTH_BIT); + out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::DEPTH_BIT); } - if (format_layout == Anvil::COMPONENT_LAYOUT_DS || - format_layout == Anvil::COMPONENT_LAYOUT_S) + if (format_layout == Anvil::ComponentLayout::DS || + format_layout == Anvil::ComponentLayout::S) { - out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_STENCIL_BIT); + out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::STENCIL_BIT); } } @@ -790,7 +790,7 @@ uint32_t Anvil::Formats::get_format_n_components(Anvil::Format in_format) { anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE); - return g_layout_to_n_components[g_formats[static_cast(in_format)].component_layout]; + return g_layout_to_n_components[static_cast(g_formats[static_cast(in_format)].component_layout)]; } /** Please see header for specification */ @@ -831,16 +831,16 @@ Anvil::FormatType Anvil::Formats::get_format_type(Anvil::Format in_format) /** Please see header for specification */ bool Anvil::Formats::has_depth_aspect(Anvil::Format in_format) { - return (g_formats[static_cast(in_format)].component_layout == Anvil::COMPONENT_LAYOUT_D) || - (g_formats[static_cast(in_format)].component_layout == Anvil::COMPONENT_LAYOUT_DS) || - (g_formats[static_cast(in_format)].component_layout == Anvil::COMPONENT_LAYOUT_XD); + return (g_formats[static_cast(in_format)].component_layout == Anvil::ComponentLayout::D) || + (g_formats[static_cast(in_format)].component_layout == Anvil::ComponentLayout::DS) || + (g_formats[static_cast(in_format)].component_layout == Anvil::ComponentLayout::XD); } /** Please see header for specification */ bool Anvil::Formats::has_stencil_aspect(Anvil::Format in_format) { - return (g_formats[static_cast(in_format)].component_layout == Anvil::COMPONENT_LAYOUT_S) || - (g_formats[static_cast(in_format)].component_layout == Anvil::COMPONENT_LAYOUT_DS); + return (g_formats[static_cast(in_format)].component_layout == Anvil::ComponentLayout::S) || + (g_formats[static_cast(in_format)].component_layout == Anvil::ComponentLayout::DS); } /** Please see header for specification */ diff --git a/src/misc/framebuffer_create_info.cpp b/src/misc/framebuffer_create_info.cpp index 62dc04cd..0194ee88 100644 --- a/src/misc/framebuffer_create_info.cpp +++ b/src/misc/framebuffer_create_info.cpp @@ -127,7 +127,7 @@ Anvil::FramebufferCreateInfoUniquePtr Anvil::FramebufferCreateInfo::create(const in_width, in_height, in_n_layers, - MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE) ); return result_ptr; diff --git a/src/misc/glsl_to_spirv.cpp b/src/misc/glsl_to_spirv.cpp index 156b702e..6f478300 100644 --- a/src/misc/glsl_to_spirv.cpp +++ b/src/misc/glsl_to_spirv.cpp @@ -74,20 +74,20 @@ /* Constructor. */ Anvil::GLSLangLimits::GLSLangLimits(const Anvil::BaseDevice* in_device_ptr) { - const auto& limits = in_device_ptr->get_physical_device_properties().core_vk1_0_properties_ptr->limits; - VkSampleCountFlags max_sampled_image_sample_count; - int32_t max_sampled_image_samples = 0; - VkSampleCountFlags max_storage_image_sample_count = limits.storage_image_sample_counts; - int32_t max_storage_image_samples = 0; + const auto& limits = in_device_ptr->get_physical_device_properties().core_vk1_0_properties_ptr->limits; + Anvil::SampleCountFlags max_sampled_image_sample_count; + int32_t max_sampled_image_samples = 0; + auto max_storage_image_sample_count = limits.storage_image_sample_counts; + int32_t max_storage_image_samples = 0; - max_sampled_image_sample_count = std::max(limits.sampled_image_color_sample_counts, limits.sampled_image_depth_sample_counts); - max_sampled_image_sample_count = std::max(max_sampled_image_sample_count, limits.sampled_image_integer_sample_counts); - max_sampled_image_sample_count = std::max(max_sampled_image_sample_count, limits.sampled_image_stencil_sample_counts); + max_sampled_image_sample_count = std::max(limits.sampled_image_color_sample_counts, limits.sampled_image_depth_sample_counts); + max_sampled_image_sample_count = std::max(max_sampled_image_sample_count, limits.sampled_image_integer_sample_counts); + max_sampled_image_sample_count = std::max(max_sampled_image_sample_count, limits.sampled_image_stencil_sample_counts); const struct SampleCountToSamplesData { - VkSampleCountFlags sample_count; - int32_t* out_result_ptr; + Anvil::SampleCountFlags sample_count; + int32_t* out_result_ptr; } conversion_items[] = { {max_sampled_image_sample_count, &max_sampled_image_samples}, @@ -102,22 +102,22 @@ const SampleCountToSamplesData& current_item = conversion_items[n_conversion_item]; int32_t result = 1; - if (current_item.sample_count & Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_16_BIT) + if ((current_item.sample_count & Anvil::SampleCountFlagBits::_16_BIT) != 0) { result = 16; } else - if (current_item.sample_count & Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_8_BIT) + if ((current_item.sample_count & Anvil::SampleCountFlagBits::_8_BIT) != 0) { result = 8; } else - if (current_item.sample_count & Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_4_BIT) + if ((current_item.sample_count & Anvil::SampleCountFlagBits::_4_BIT) != 0) { result = 4; } else - if (current_item.sample_count & Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_2_BIT) + if ((current_item.sample_count & Anvil::SampleCountFlagBits::_2_BIT) != 0) { result = 2; } @@ -478,12 +478,12 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() const { switch (m_shader_stage) { - case SHADER_STAGE_COMPUTE: glsl_filename_with_path = "temp.comp"; break; - case SHADER_STAGE_FRAGMENT: glsl_filename_with_path = "temp.frag"; break; - case SHADER_STAGE_GEOMETRY: glsl_filename_with_path = "temp.geom"; break; - case SHADER_STAGE_TESSELLATION_CONTROL: glsl_filename_with_path = "temp.tesc"; break; - case SHADER_STAGE_TESSELLATION_EVALUATION: glsl_filename_with_path = "temp.tese"; break; - case SHADER_STAGE_VERTEX: glsl_filename_with_path = "temp.vert"; break; + case ShaderStage::COMPUTE: glsl_filename_with_path = "temp.comp"; break; + case ShaderStage::FRAGMENT: glsl_filename_with_path = "temp.frag"; break; + case ShaderStage::GEOMETRY: glsl_filename_with_path = "temp.geom"; break; + case ShaderStage::TESSELLATION_CONTROL: glsl_filename_with_path = "temp.tesc"; break; + case ShaderStage::TESSELLATION_EVALUATION: glsl_filename_with_path = "temp.tese"; break; + case ShaderStage::VERTEX: glsl_filename_with_path = "temp.vert"; break; default: { @@ -701,12 +701,12 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() const switch (m_shader_stage) { - case Anvil::SHADER_STAGE_COMPUTE: result = EShLangCompute; break; - case Anvil::SHADER_STAGE_FRAGMENT: result = EShLangFragment; break; - case Anvil::SHADER_STAGE_GEOMETRY: result = EShLangGeometry; break; - case Anvil::SHADER_STAGE_TESSELLATION_CONTROL: result = EShLangTessControl; break; - case Anvil::SHADER_STAGE_TESSELLATION_EVALUATION: result = EShLangTessEvaluation; break; - case Anvil::SHADER_STAGE_VERTEX: result = EShLangVertex; break; + case Anvil::ShaderStage::COMPUTE: result = EShLangCompute; break; + case Anvil::ShaderStage::FRAGMENT: result = EShLangFragment; break; + case Anvil::ShaderStage::GEOMETRY: result = EShLangGeometry; break; + case Anvil::ShaderStage::TESSELLATION_CONTROL: result = EShLangTessControl; break; + case Anvil::ShaderStage::TESSELLATION_EVALUATION: result = EShLangTessEvaluation; break; + case Anvil::ShaderStage::VERTEX: result = EShLangVertex; break; default: { diff --git a/src/misc/graphics_pipeline_create_info.cpp b/src/misc/graphics_pipeline_create_info.cpp index 21a392cf..75009b1c 100644 --- a/src/misc/graphics_pipeline_create_info.cpp +++ b/src/misc/graphics_pipeline_create_info.cpp @@ -35,12 +35,11 @@ Anvil::GraphicsPipelineCreateInfo::GraphicsPipelineCreateInfo(const RenderPass* m_depth_bias_slope_factor = 1.0f; m_depth_bounds_test_enabled = false; m_depth_clamp_enabled = false; - m_depth_test_compare_op = VK_COMPARE_OP_ALWAYS; + m_depth_test_compare_op = Anvil::CompareOp::ALWAYS; m_depth_test_enabled = false; m_depth_writes_enabled = false; - m_enabled_dynamic_states = 0; - m_front_face = VK_FRONT_FACE_COUNTER_CLOCKWISE; - m_logic_op = VK_LOGIC_OP_NO_OP; + m_front_face = Anvil::FrontFace::COUNTER_CLOCKWISE; + m_logic_op = Anvil::LogicOp::NO_OP; m_logic_op_enabled = false; m_max_depth_bounds = 1.0f; m_min_depth_bounds = 0.0f; @@ -65,18 +64,18 @@ Anvil::GraphicsPipelineCreateInfo::GraphicsPipelineCreateInfo(const RenderPass* m_stencil_state_back_face.writeMask = ~0u; m_stencil_state_front_face = m_stencil_state_back_face; - m_rasterization_order = VK_RASTERIZATION_ORDER_STRICT_AMD; + m_rasterization_order = Anvil::RasterizationOrderAMD::STRICT; memset(m_blend_constant, 0, sizeof(m_blend_constant) ); - m_cull_mode = VK_CULL_MODE_BACK_BIT; + m_cull_mode = Anvil::CullModeFlagBits::CULL_MODE_BACK_BIT; m_line_width = 1.0f; m_min_sample_shading = 1.0f; - m_sample_count = Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT; - m_polygon_mode = VK_POLYGON_MODE_FILL; - m_primitive_topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; + m_sample_count = Anvil::SampleCountFlagBits::_1_BIT; + m_polygon_mode = Anvil::PolygonMode::FILL; + m_primitive_topology = Anvil::PrimitiveTopology::TRIANGLE_LIST; m_sample_mask = ~0u; m_tessellation_domain_origin = Anvil::TessellationDomainOrigin::UPPER_LEFT; @@ -87,13 +86,13 @@ Anvil::GraphicsPipelineCreateInfo::~GraphicsPipelineCreateInfo() /* Stub */ } -bool Anvil::GraphicsPipelineCreateInfo::add_vertex_attribute(uint32_t in_location, - Anvil::Format in_format, - uint32_t in_offset_in_bytes, - uint32_t in_stride_in_bytes, - VkVertexInputRate in_step_rate, - uint32_t in_explicit_binding_index, - uint32_t in_divisor) +bool Anvil::GraphicsPipelineCreateInfo::add_vertex_attribute(uint32_t in_location, + Anvil::Format in_format, + uint32_t in_offset_in_bytes, + uint32_t in_stride_in_bytes, + Anvil::VertexInputRate in_step_rate, + uint32_t in_explicit_binding_index, + uint32_t in_divisor) { bool result = false; @@ -346,15 +345,15 @@ void Anvil::GraphicsPipelineCreateInfo::get_blending_properties(const float** ou } } -bool Anvil::GraphicsPipelineCreateInfo::get_color_blend_attachment_properties(SubPassAttachmentID in_attachment_id, - bool* out_opt_blending_enabled_ptr, - VkBlendOp* out_opt_blend_op_color_ptr, - VkBlendOp* out_opt_blend_op_alpha_ptr, - VkBlendFactor* out_opt_src_color_blend_factor_ptr, - VkBlendFactor* out_opt_dst_color_blend_factor_ptr, - VkBlendFactor* out_opt_src_alpha_blend_factor_ptr, - VkBlendFactor* out_opt_dst_alpha_blend_factor_ptr, - VkColorComponentFlags* out_opt_channel_write_mask_ptr) const +bool Anvil::GraphicsPipelineCreateInfo::get_color_blend_attachment_properties(SubPassAttachmentID in_attachment_id, + bool* out_opt_blending_enabled_ptr, + Anvil::BlendOp* out_opt_blend_op_color_ptr, + Anvil::BlendOp* out_opt_blend_op_alpha_ptr, + Anvil::BlendFactor* out_opt_src_color_blend_factor_ptr, + Anvil::BlendFactor* out_opt_dst_color_blend_factor_ptr, + Anvil::BlendFactor* out_opt_src_alpha_blend_factor_ptr, + Anvil::BlendFactor* out_opt_dst_alpha_blend_factor_ptr, + Anvil::ColorComponentFlags* out_opt_channel_write_mask_ptr) const { SubPassAttachmentToBlendingPropertiesMap::const_iterator props_iterator; bool result = false; @@ -458,8 +457,8 @@ void Anvil::GraphicsPipelineCreateInfo::get_depth_bounds_state(bool* out_opt_is } } -void Anvil::GraphicsPipelineCreateInfo::get_depth_test_state(bool* out_opt_is_enabled_ptr, - VkCompareOp* out_opt_compare_op_ptr) const +void Anvil::GraphicsPipelineCreateInfo::get_depth_test_state(bool* out_opt_is_enabled_ptr, + Anvil::CompareOp* out_opt_compare_op_ptr) const { if (out_opt_is_enabled_ptr != nullptr) { @@ -472,9 +471,12 @@ void Anvil::GraphicsPipelineCreateInfo::get_depth_test_state(bool* out_op } } -Anvil::DynamicStateBitfield Anvil::GraphicsPipelineCreateInfo::get_enabled_dynamic_states() const +void Anvil::GraphicsPipelineCreateInfo::get_enabled_dynamic_states(const Anvil::DynamicState** out_dynamic_states_ptr_ptr, + uint32_t* out_n_dynamic_states_ptr) const { - return m_enabled_dynamic_states; + *out_n_dynamic_states_ptr = static_cast(m_enabled_dynamic_states.size() ); + *out_dynamic_states_ptr_ptr = ((m_enabled_dynamic_states.size() > 0) ? &m_enabled_dynamic_states.at(0) + : nullptr); } void Anvil::GraphicsPipelineCreateInfo::get_graphics_pipeline_properties(uint32_t* out_opt_n_scissors_ptr, @@ -509,8 +511,8 @@ void Anvil::GraphicsPipelineCreateInfo::get_graphics_pipeline_properties(uint32_ } } -void Anvil::GraphicsPipelineCreateInfo::get_logic_op_state(bool* out_opt_is_enabled_ptr, - VkLogicOp* out_opt_logic_op_ptr) const +void Anvil::GraphicsPipelineCreateInfo::get_logic_op_state(bool* out_opt_is_enabled_ptr, + Anvil::LogicOp* out_opt_logic_op_ptr) const { if (out_opt_is_enabled_ptr != nullptr) { @@ -557,20 +559,20 @@ uint32_t Anvil::GraphicsPipelineCreateInfo::get_n_viewports() const return static_cast(m_viewports.size() ); } -VkPrimitiveTopology Anvil::GraphicsPipelineCreateInfo::get_primitive_topology() const +Anvil::PrimitiveTopology Anvil::GraphicsPipelineCreateInfo::get_primitive_topology() const { return m_primitive_topology; } -VkRasterizationOrderAMD Anvil::GraphicsPipelineCreateInfo::get_rasterization_order() const +Anvil::RasterizationOrderAMD Anvil::GraphicsPipelineCreateInfo::get_rasterization_order() const { return m_rasterization_order; } -void Anvil::GraphicsPipelineCreateInfo::get_rasterization_properties(VkPolygonMode* out_opt_polygon_mode_ptr, - VkCullModeFlags* out_opt_cull_mode_ptr, - VkFrontFace* out_opt_front_face_ptr, - float* out_opt_line_width_ptr) const +void Anvil::GraphicsPipelineCreateInfo::get_rasterization_properties(Anvil::PolygonMode* out_opt_polygon_mode_ptr, + Anvil::CullModeFlags* out_opt_cull_mode_ptr, + Anvil::FrontFace* out_opt_front_face_ptr, + float* out_opt_line_width_ptr) const { if (out_opt_polygon_mode_ptr != nullptr) { @@ -652,21 +654,21 @@ bool Anvil::GraphicsPipelineCreateInfo::get_scissor_box_properties(uint32_t in_ return result; } -void Anvil::GraphicsPipelineCreateInfo::get_stencil_test_properties(bool* out_opt_is_enabled_ptr, - VkStencilOp* out_opt_front_stencil_fail_op_ptr, - VkStencilOp* out_opt_front_stencil_pass_op_ptr, - VkStencilOp* out_opt_front_stencil_depth_fail_op_ptr, - VkCompareOp* out_opt_front_stencil_compare_op_ptr, - uint32_t* out_opt_front_stencil_compare_mask_ptr, - uint32_t* out_opt_front_stencil_write_mask_ptr, - uint32_t* out_opt_front_stencil_reference_ptr, - VkStencilOp* out_opt_back_stencil_fail_op_ptr, - VkStencilOp* out_opt_back_stencil_pass_op_ptr, - VkStencilOp* out_opt_back_stencil_depth_fail_op_ptr, - VkCompareOp* out_opt_back_stencil_compare_op_ptr, - uint32_t* out_opt_back_stencil_compare_mask_ptr, - uint32_t* out_opt_back_stencil_write_mask_ptr, - uint32_t* out_opt_back_stencil_reference_ptr) const +void Anvil::GraphicsPipelineCreateInfo::get_stencil_test_properties(bool* out_opt_is_enabled_ptr, + Anvil::StencilOp* out_opt_front_stencil_fail_op_ptr, + Anvil::StencilOp* out_opt_front_stencil_pass_op_ptr, + Anvil::StencilOp* out_opt_front_stencil_depth_fail_op_ptr, + Anvil::CompareOp* out_opt_front_stencil_compare_op_ptr, + uint32_t* out_opt_front_stencil_compare_mask_ptr, + uint32_t* out_opt_front_stencil_write_mask_ptr, + uint32_t* out_opt_front_stencil_reference_ptr, + Anvil::StencilOp* out_opt_back_stencil_fail_op_ptr, + Anvil::StencilOp* out_opt_back_stencil_pass_op_ptr, + Anvil::StencilOp* out_opt_back_stencil_depth_fail_op_ptr, + Anvil::CompareOp* out_opt_back_stencil_compare_op_ptr, + uint32_t* out_opt_back_stencil_compare_mask_ptr, + uint32_t* out_opt_back_stencil_write_mask_ptr, + uint32_t* out_opt_back_stencil_reference_ptr) const { if (out_opt_is_enabled_ptr != nullptr) { @@ -675,22 +677,22 @@ void Anvil::GraphicsPipelineCreateInfo::get_stencil_test_properties(bool* if (out_opt_front_stencil_fail_op_ptr != nullptr) { - *out_opt_front_stencil_fail_op_ptr = m_stencil_state_front_face.failOp; + *out_opt_front_stencil_fail_op_ptr = static_cast(m_stencil_state_front_face.failOp); } if (out_opt_front_stencil_pass_op_ptr != nullptr) { - *out_opt_front_stencil_pass_op_ptr = m_stencil_state_front_face.passOp; + *out_opt_front_stencil_pass_op_ptr = static_cast(m_stencil_state_front_face.passOp); } if (out_opt_front_stencil_depth_fail_op_ptr != nullptr) { - *out_opt_front_stencil_depth_fail_op_ptr = m_stencil_state_front_face.depthFailOp; + *out_opt_front_stencil_depth_fail_op_ptr = static_cast(m_stencil_state_front_face.depthFailOp); } if (out_opt_front_stencil_compare_op_ptr != nullptr) { - *out_opt_front_stencil_compare_op_ptr = m_stencil_state_front_face.compareOp; + *out_opt_front_stencil_compare_op_ptr = static_cast(m_stencil_state_front_face.compareOp); } if (out_opt_front_stencil_compare_mask_ptr != nullptr) @@ -710,22 +712,22 @@ void Anvil::GraphicsPipelineCreateInfo::get_stencil_test_properties(bool* if (out_opt_back_stencil_fail_op_ptr != nullptr) { - *out_opt_back_stencil_fail_op_ptr = m_stencil_state_back_face.failOp; + *out_opt_back_stencil_fail_op_ptr = static_cast(m_stencil_state_back_face.failOp); } if (out_opt_back_stencil_pass_op_ptr != nullptr) { - *out_opt_back_stencil_pass_op_ptr = m_stencil_state_back_face.passOp; + *out_opt_back_stencil_pass_op_ptr = static_cast(m_stencil_state_back_face.passOp); } if (out_opt_back_stencil_depth_fail_op_ptr != nullptr) { - *out_opt_back_stencil_depth_fail_op_ptr = m_stencil_state_back_face.depthFailOp; + *out_opt_back_stencil_depth_fail_op_ptr = static_cast(m_stencil_state_back_face.depthFailOp); } if (out_opt_back_stencil_compare_op_ptr != nullptr) { - *out_opt_back_stencil_compare_op_ptr = m_stencil_state_back_face.compareOp; + *out_opt_back_stencil_compare_op_ptr = static_cast(m_stencil_state_back_face.compareOp); } if (out_opt_back_stencil_compare_mask_ptr != nullptr) @@ -749,14 +751,14 @@ uint32_t Anvil::GraphicsPipelineCreateInfo::get_n_patch_control_points() const return m_n_patch_control_points; } -bool Anvil::GraphicsPipelineCreateInfo::get_vertex_attribute_properties(uint32_t in_n_vertex_input_attribute, - uint32_t* out_opt_location_ptr, - Anvil::Format* out_opt_format_ptr, - uint32_t* out_opt_offset_ptr, - uint32_t* out_opt_explicit_vertex_binding_index_ptr, - uint32_t* out_opt_stride_ptr, - VkVertexInputRate* out_opt_rate_ptr, - uint32_t* out_opt_divisor_ptr) const +bool Anvil::GraphicsPipelineCreateInfo::get_vertex_attribute_properties(uint32_t in_n_vertex_input_attribute, + uint32_t* out_opt_location_ptr, + Anvil::Format* out_opt_format_ptr, + uint32_t* out_opt_offset_ptr, + uint32_t* out_opt_explicit_vertex_binding_index_ptr, + uint32_t* out_opt_stride_ptr, + Anvil::VertexInputRate* out_opt_rate_ptr, + uint32_t* out_opt_divisor_ptr) const { const InternalVertexAttribute* attribute_ptr = nullptr; bool result = false; @@ -905,15 +907,15 @@ void Anvil::GraphicsPipelineCreateInfo::set_blending_properties(const float* in_ sizeof(m_blend_constant) ); } -void Anvil::GraphicsPipelineCreateInfo::set_color_blend_attachment_properties(SubPassAttachmentID in_attachment_id, - bool in_blending_enabled, - VkBlendOp in_blend_op_color, - VkBlendOp in_blend_op_alpha, - VkBlendFactor in_src_color_blend_factor, - VkBlendFactor in_dst_color_blend_factor, - VkBlendFactor in_src_alpha_blend_factor, - VkBlendFactor in_dst_alpha_blend_factor, - VkColorComponentFlags in_channel_write_mask) +void Anvil::GraphicsPipelineCreateInfo::set_color_blend_attachment_properties(SubPassAttachmentID in_attachment_id, + bool in_blending_enabled, + Anvil::BlendOp in_blend_op_color, + Anvil::BlendOp in_blend_op_alpha, + Anvil::BlendFactor in_src_color_blend_factor, + Anvil::BlendFactor in_dst_color_blend_factor, + Anvil::BlendFactor in_src_alpha_blend_factor, + Anvil::BlendFactor in_dst_alpha_blend_factor, + Anvil::ColorComponentFlags in_channel_write_mask) { BlendingProperties* attachment_blending_props_ptr = &m_subpass_attachment_blending_properties[in_attachment_id]; @@ -951,20 +953,20 @@ void Anvil::GraphicsPipelineCreateInfo::set_n_patch_control_points(uint32_t in_n m_n_patch_control_points = in_n_patch_control_points; } -void Anvil::GraphicsPipelineCreateInfo::set_primitive_topology(VkPrimitiveTopology in_primitive_topology) +void Anvil::GraphicsPipelineCreateInfo::set_primitive_topology(Anvil::PrimitiveTopology in_primitive_topology) { m_primitive_topology = in_primitive_topology; } -void Anvil::GraphicsPipelineCreateInfo::set_rasterization_order(VkRasterizationOrderAMD in_rasterization_order) +void Anvil::GraphicsPipelineCreateInfo::set_rasterization_order(Anvil::RasterizationOrderAMD in_rasterization_order) { m_rasterization_order = in_rasterization_order; } -void Anvil::GraphicsPipelineCreateInfo::set_rasterization_properties(VkPolygonMode in_polygon_mode, - VkCullModeFlags in_cull_mode, - VkFrontFace in_front_face, - float in_line_width) +void Anvil::GraphicsPipelineCreateInfo::set_rasterization_properties(Anvil::PolygonMode in_polygon_mode, + Anvil::CullModeFlags in_cull_mode, + Anvil::FrontFace in_front_face, + float in_line_width) { m_cull_mode = in_cull_mode; m_front_face = in_front_face; @@ -984,23 +986,23 @@ void Anvil::GraphicsPipelineCreateInfo::set_scissor_box_properties(uint32_t in_n in_height); } -void Anvil::GraphicsPipelineCreateInfo::set_stencil_test_properties(bool in_update_front_face_state, - VkStencilOp in_stencil_fail_op, - VkStencilOp in_stencil_pass_op, - VkStencilOp in_stencil_depth_fail_op, - VkCompareOp in_stencil_compare_op, - uint32_t in_stencil_compare_mask, - uint32_t in_stencil_write_mask, - uint32_t in_stencil_reference) +void Anvil::GraphicsPipelineCreateInfo::set_stencil_test_properties(bool in_update_front_face_state, + Anvil::StencilOp in_stencil_fail_op, + Anvil::StencilOp in_stencil_pass_op, + Anvil::StencilOp in_stencil_depth_fail_op, + Anvil::CompareOp in_stencil_compare_op, + uint32_t in_stencil_compare_mask, + uint32_t in_stencil_write_mask, + uint32_t in_stencil_reference) { VkStencilOpState* const stencil_op_state_ptr = (in_update_front_face_state) ? &m_stencil_state_front_face : &m_stencil_state_back_face; stencil_op_state_ptr->compareMask = in_stencil_compare_mask; - stencil_op_state_ptr->compareOp = in_stencil_compare_op; - stencil_op_state_ptr->depthFailOp = in_stencil_depth_fail_op; - stencil_op_state_ptr->failOp = in_stencil_fail_op; - stencil_op_state_ptr->passOp = in_stencil_pass_op; + stencil_op_state_ptr->compareOp = static_cast(in_stencil_compare_op); + stencil_op_state_ptr->depthFailOp = static_cast(in_stencil_depth_fail_op); + stencil_op_state_ptr->failOp = static_cast(in_stencil_fail_op); + stencil_op_state_ptr->passOp = static_cast(in_stencil_pass_op); stencil_op_state_ptr->reference = in_stencil_reference; stencil_op_state_ptr->writeMask = in_stencil_write_mask; } @@ -1061,8 +1063,8 @@ void Anvil::GraphicsPipelineCreateInfo::toggle_depth_clamp(bool in_should_enable m_depth_clamp_enabled = in_should_enable; } -void Anvil::GraphicsPipelineCreateInfo::toggle_depth_test(bool in_should_enable, - VkCompareOp in_compare_op) +void Anvil::GraphicsPipelineCreateInfo::toggle_depth_test(bool in_should_enable, + Anvil::CompareOp in_compare_op) { m_depth_test_enabled = in_should_enable; m_depth_test_compare_op = in_compare_op; @@ -1073,21 +1075,58 @@ void Anvil::GraphicsPipelineCreateInfo::toggle_depth_writes(bool in_should_enabl m_depth_writes_enabled = in_should_enable; } -void Anvil::GraphicsPipelineCreateInfo::toggle_dynamic_states(bool in_should_enable, - DynamicStateBitfield in_dynamic_state_bits) +void Anvil::GraphicsPipelineCreateInfo::toggle_dynamic_state(bool in_should_enable, + const Anvil::DynamicState& in_dynamic_state) { if (in_should_enable) { - m_enabled_dynamic_states |= in_dynamic_state_bits; + if (std::find(m_enabled_dynamic_states.begin(), + m_enabled_dynamic_states.end (), + in_dynamic_state) == m_enabled_dynamic_states.end() ) + { + m_enabled_dynamic_states.push_back(in_dynamic_state); + } } else { - m_enabled_dynamic_states &= ~in_dynamic_state_bits; + auto iterator = std::find(m_enabled_dynamic_states.begin(), + m_enabled_dynamic_states.end (), + in_dynamic_state); + + if (iterator != m_enabled_dynamic_states.end() ) + { + m_enabled_dynamic_states.erase(iterator); + } + } +} + +void Anvil::GraphicsPipelineCreateInfo::toggle_dynamic_states(bool in_should_enable, + const Anvil::DynamicState* in_dynamic_states_ptr, + const uint32_t& in_n_dynamic_states) +{ + for (uint32_t n_dynamic_state = 0; + n_dynamic_state < in_n_dynamic_states; + ++n_dynamic_state) + { + const auto current_state = in_dynamic_states_ptr[n_dynamic_state]; + + toggle_dynamic_state(in_should_enable, + current_state); + } +} + +void Anvil::GraphicsPipelineCreateInfo::toggle_dynamic_states(bool in_should_enable, + const std::vector& in_dynamic_states) +{ + for (const auto& current_state : in_dynamic_states) + { + toggle_dynamic_state(in_should_enable, + current_state); } } -void Anvil::GraphicsPipelineCreateInfo::toggle_logic_op(bool in_should_enable, - VkLogicOp in_logic_op) +void Anvil::GraphicsPipelineCreateInfo::toggle_logic_op(bool in_should_enable, + Anvil::LogicOp in_logic_op) { m_logic_op = in_logic_op; m_logic_op_enabled = in_should_enable; diff --git a/src/misc/image_create_info.cpp b/src/misc/image_create_info.cpp index 7caab98e..97e51a20 100644 --- a/src/misc/image_create_info.cpp +++ b/src/misc/image_create_info.cpp @@ -33,7 +33,7 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_no_allo uint32_t in_base_mipmap_depth, uint32_t in_n_layers, Anvil::SampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, + Anvil::QueueFamilyFlags in_queue_families, Anvil::SharingMode in_sharing_mode, bool in_use_full_mipmap_chain, ImageCreateFlags in_create_flags, @@ -62,10 +62,10 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_no_allo ((in_opt_mipmaps_ptr != nullptr) && (in_opt_mipmaps_ptr->size() > 0)) ? Anvil::ImageLayout::PREINITIALIZED : Anvil::ImageLayout::UNDEFINED, in_post_alloc_image_layout, in_opt_mipmaps_ptr, - Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, - 0, /* in_exportable_external_memory_handle_types */ - 0, /* in_memory_features */ - Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED) + Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE, + Anvil::ExternalMemoryHandleTypeFlagBits::NONE, + Anvil::MemoryFeatureFlagBits::NONE, + Anvil::SparseResidencyScope::UNKNOWN) ); return result_ptr; @@ -81,7 +81,7 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_alloc(c uint32_t in_base_mipmap_depth, uint32_t in_n_layers, Anvil::SampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, + Anvil::QueueFamilyFlags in_queue_families, Anvil::SharingMode in_sharing_mode, bool in_use_full_mipmap_chain, MemoryFeatureFlags in_memory_features, @@ -111,10 +111,10 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_alloc(c ((in_opt_mipmaps_ptr != nullptr) && (in_opt_mipmaps_ptr->size() > 0)) ? Anvil::ImageLayout::PREINITIALIZED : Anvil::ImageLayout::UNDEFINED, in_post_alloc_image_layout, in_opt_mipmaps_ptr, - Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, - 0, /* in_exportable_external_memory_handle_types */ + Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE, + Anvil::ExternalMemoryHandleTypeFlagBits::NONE, in_memory_features, - Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED) + Anvil::SparseResidencyScope::UNKNOWN) ); return result_ptr; @@ -124,7 +124,8 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_peer_no const Anvil::Swapchain* in_swapchain_ptr, uint32_t in_n_swapchain_image) { - const auto memory_features ((in_device_ptr->get_type() == Anvil::DEVICE_TYPE_MULTI_GPU) ? Anvil::MEMORY_FEATURE_FLAG_MULTI_INSTANCE : 0); + const auto memory_features ((in_device_ptr->get_type() == Anvil::DeviceType::MULTI_GPU) ? Anvil::MemoryFeatureFlagBits::MULTI_INSTANCE_BIT + : Anvil::MemoryFeatureFlagBits::NONE); Anvil::ImageCreateInfoUniquePtr result_ptr (nullptr, std::default_delete() ); Anvil::Image* swapchain_image_ptr (in_swapchain_ptr->get_image(in_n_swapchain_image) ); @@ -147,17 +148,17 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_peer_no swapchain_image_size[1], 1, /* in_base_mipmap_depth */ swapchain_image_ptr->get_create_info_ptr()->get_n_layers(), - Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, + Anvil::SampleCountFlagBits::_1_BIT, false, /* in_use_full_mipmap_chain */ - 0, /* in_create_flags */ + Anvil::ImageCreateFlagBits::NONE, swapchain_image_ptr->get_create_info_ptr()->get_queue_families(), Anvil::ImageLayout::UNDEFINED, /* in_post_create_image_layout */ Anvil::ImageLayout::UNDEFINED, /* in_post_alloc_image_layout */ nullptr, /* in_opt_mipmaps_ptr */ - Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, - 0, /* in_external_memory_handle_types */ + Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE, + Anvil::ExternalMemoryHandleTypeFlagBits::NONE, memory_features, - Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED) + Anvil::SparseResidencyScope::UNKNOWN) ); result_ptr->set_swapchain (in_swapchain_ptr); @@ -176,7 +177,7 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_sparse_no_alloc(c uint32_t in_base_mipmap_depth, uint32_t in_n_layers, Anvil::SampleCountFlagBits in_sample_count, - Anvil::QueueFamilyBits in_queue_families, + Anvil::QueueFamilyFlags in_queue_families, Anvil::SharingMode in_sharing_mode, bool in_use_full_mipmap_chain, ImageCreateFlags in_create_flags, @@ -204,9 +205,9 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_sparse_no_alloc(c Anvil::ImageLayout::UNDEFINED, Anvil::ImageLayout::UNDEFINED, nullptr, /* in_opt_mipmaps_ptr */ - Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, - 0, /* in_external_memory_handle_types */ - 0, /* in_memory_features */ + Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE, + Anvil::ExternalMemoryHandleTypeFlagBits::NONE, + Anvil::MemoryFeatureFlagBits::NONE, in_residency_scope) ); @@ -234,17 +235,17 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_swapchain_wrapper swapchain_create_info_ptr->get_rendering_surface()->get_height(), 1, /* base_mipmap_depth */ 1, /* in_n_layers */ - Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, + Anvil::SampleCountFlagBits::_1_BIT, false, /* in_use_full_mipmap_chain */ - 0, /* in_create_flags */ - 0, /* in_queue_families */ + Anvil::ImageCreateFlagBits::NONE, + Anvil::QueueFamilyFlagBits::NONE, Anvil::ImageLayout::UNDEFINED, Anvil::ImageLayout::UNDEFINED, nullptr, /* in_opt_mipmaps_ptr */ - Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, - 0, /* in_external_memory_handle_types */ - 0, /* in_memory_features */ - Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED) + Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE, + Anvil::ExternalMemoryHandleTypeFlagBits::NONE, + Anvil::MemoryFeatureFlagBits::NONE, + Anvil::SparseResidencyScope::UNKNOWN) ); if (result_ptr != nullptr) @@ -257,28 +258,28 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_swapchain_wrapper return result_ptr; } -Anvil::ImageCreateInfo::ImageCreateInfo(Anvil::ImageInternalType in_internal_type, - const Anvil::BaseDevice* in_device_ptr, - Anvil::ImageType in_type_vk, - Anvil::Format in_format, - Anvil::ImageTiling in_tiling, - Anvil::SharingMode in_sharing_mode, - Anvil::ImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - Anvil::SampleCountFlagBits in_sample_count, - bool in_use_full_mipmap_chain, - ImageCreateFlags in_create_flags, - Anvil::QueueFamilyBits in_queue_families, - Anvil::ImageLayout in_post_create_image_layout, - const Anvil::ImageLayout& in_post_alloc_image_layout, - const std::vector* in_opt_mipmaps_ptr, - const Anvil::MTSafety& in_mt_safety, - Anvil::ExternalMemoryHandleTypeBits in_exportable_external_memory_handle_types, - const Anvil::MemoryFeatureFlags& in_memory_features, - const Anvil::SparseResidencyScope& in_residency_scope) +Anvil::ImageCreateInfo::ImageCreateInfo(Anvil::ImageInternalType in_internal_type, + const Anvil::BaseDevice* in_device_ptr, + Anvil::ImageType in_type_vk, + Anvil::Format in_format, + Anvil::ImageTiling in_tiling, + Anvil::SharingMode in_sharing_mode, + Anvil::ImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + Anvil::SampleCountFlagBits in_sample_count, + bool in_use_full_mipmap_chain, + ImageCreateFlags in_create_flags, + Anvil::QueueFamilyFlags in_queue_families, + Anvil::ImageLayout in_post_create_image_layout, + const Anvil::ImageLayout& in_post_alloc_image_layout, + const std::vector* in_opt_mipmaps_ptr, + const Anvil::MTSafety& in_mt_safety, + Anvil::ExternalMemoryHandleTypeFlags in_exportable_external_memory_handle_types, + const Anvil::MemoryFeatureFlags& in_memory_features, + const Anvil::SparseResidencyScope& in_residency_scope) :m_create_flags (in_create_flags), m_depth (in_base_mipmap_depth), m_device_ptr (in_device_ptr), @@ -306,11 +307,11 @@ Anvil::ImageCreateInfo::ImageCreateInfo(Anvil::ImageInternalType in_i { #if defined(_DEBUG) { - if (m_create_flags & Anvil::ImageCreateFlagBits::IMAGE_CREATE_FLAG_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT) + if ((m_create_flags & Anvil::ImageCreateFlagBits::BLOCK_TEXEL_VIEW_COMPATIBLE_BIT) != 0) { - anvil_assert(m_create_flags & Anvil::ImageCreateFlagBits::IMAGE_CREATE_FLAG_MUTABLE_FORMAT_BIT); - anvil_assert(m_use_full_mipmap_chain == false); - anvil_assert(m_n_layers == 1); + anvil_assert((m_create_flags & Anvil::ImageCreateFlagBits::MUTABLE_FORMAT_BIT) != 0); + anvil_assert(m_use_full_mipmap_chain == false); + anvil_assert(m_n_layers == 1); } } #endif diff --git a/src/misc/image_view_create_info.cpp b/src/misc/image_view_create_info.cpp index 8603c9cb..da779863 100644 --- a/src/misc/image_view_create_info.cpp +++ b/src/misc/image_view_create_info.cpp @@ -54,8 +54,8 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_1D(const 1, /* in_n_slices */ in_image_ptr, swizzle_rgba, - VK_IMAGE_VIEW_TYPE_1D, - Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + Anvil::ImageViewType::_1D, + Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE) ); return result_ptr; @@ -95,8 +95,8 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_1D_array( 1, /* in_n_slices */ in_image_ptr, swizzle_rgba, - VK_IMAGE_VIEW_TYPE_1D_ARRAY, - Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + Anvil::ImageViewType::_1D_ARRAY, + Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE) ); return result_ptr; @@ -135,8 +135,8 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_2D(const 1, /* in_n_slices */ in_image_ptr, swizzle_rgba, - VK_IMAGE_VIEW_TYPE_2D, - Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + Anvil::ImageViewType::_2D, + Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE) ); return result_ptr; @@ -176,8 +176,8 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_2D_array( 1, /* in_n_slices */ in_image_ptr, swizzle_rgba, - VK_IMAGE_VIEW_TYPE_2D_ARRAY, - Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + Anvil::ImageViewType::_2D_ARRAY, + Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE) ); return result_ptr; @@ -217,8 +217,8 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_3D(const in_n_slices, in_image_ptr, swizzle_rgba, - VK_IMAGE_VIEW_TYPE_3D, - Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + Anvil::ImageViewType::_3D, + Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE) ); return result_ptr; @@ -257,8 +257,8 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_cube_map( 1, /* in_n_slices */ in_image_ptr, swizzle_rgba, - VK_IMAGE_VIEW_TYPE_CUBE, - Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + Anvil::ImageViewType::_CUBE, + Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE) ); return result_ptr; @@ -298,8 +298,8 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_cube_map_ 1, /* in_n_slices */ in_image_ptr, swizzle_rgba, - VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, - Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + Anvil::ImageViewType::_CUBE_ARRAY, + Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE) ); return result_ptr; @@ -315,7 +315,7 @@ Anvil::ImageViewCreateInfo::ImageViewCreateInfo(const Anvil::ImageAspectFlags& i const uint32_t in_n_slices, Anvil::Image* in_parent_image_ptr, const Anvil::ComponentSwizzle* in_swizzle_array_ptr, - const VkImageViewType in_type, + const Anvil::ImageViewType in_type, const Anvil::MTSafety& in_mt_safety) :m_aspect_mask (in_aspect_mask), m_device_ptr (in_device_ptr), @@ -328,8 +328,7 @@ Anvil::ImageViewCreateInfo::ImageViewCreateInfo(const Anvil::ImageAspectFlags& i m_n_slices (in_n_slices), m_parent_image_ptr (in_parent_image_ptr), m_swizzle_array ({in_swizzle_array_ptr[0], in_swizzle_array_ptr[1], in_swizzle_array_ptr[2], in_swizzle_array_ptr[3]}), - m_type (in_type), - m_usage (Anvil::IMAGE_USAGE_UNKNOWN) + m_type (in_type) { anvil_assert(in_parent_image_ptr != nullptr); } diff --git a/src/misc/memalloc_backends/backend_oneshot.cpp b/src/misc/memalloc_backends/backend_oneshot.cpp index 97fdeae0..e2d45ae5 100644 --- a/src/misc/memalloc_backends/backend_oneshot.cpp +++ b/src/misc/memalloc_backends/backend_oneshot.cpp @@ -114,7 +114,7 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items continue; } - if ((memory_props.types.at(n_memory_type).features & required_memory_features) != required_memory_features) + if ((memory_props.types.at(n_memory_type).features & static_cast(required_memory_features.get_vk() )) != required_memory_features) { continue; } @@ -125,12 +125,12 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items bool can_continue = true; auto mgpu_device_ptr = dynamic_cast(m_device_ptr); - anvil_assert(m_device_ptr->get_type() == Anvil::DeviceType::DEVICE_TYPE_MULTI_GPU); + anvil_assert(m_device_ptr->get_type() == Anvil::DeviceType::MULTI_GPU); anvil_assert(mgpu_device_ptr != nullptr); for (const auto& current_req : (*item_iterator)->alloc_mgpu_peer_memory_reqs) { - Anvil::PeerMemoryFeatureFlags current_memory_type_peer_memory_features = 0; + Anvil::PeerMemoryFeatureFlags current_memory_type_peer_memory_features; const auto& local_device_index = current_req.first.first; const auto local_device_ptr = mgpu_device_ptr->get_physical_device(local_device_index); const auto& remote_device_index = current_req.first.second; @@ -382,7 +382,7 @@ bool Anvil::MemoryAllocatorBackends::OneShot::supports_device_masks() const return true; } -bool Anvil::MemoryAllocatorBackends::OneShot::supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeBits&) const +bool Anvil::MemoryAllocatorBackends::OneShot::supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags&) const { return true; } diff --git a/src/misc/memalloc_backends/backend_vma.cpp b/src/misc/memalloc_backends/backend_vma.cpp index f34e494f..b29e4817 100644 --- a/src/misc/memalloc_backends/backend_vma.cpp +++ b/src/misc/memalloc_backends/backend_vma.cpp @@ -102,7 +102,7 @@ bool Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::init() switch (m_device_ptr->get_type() ) { - case Anvil::DEVICE_TYPE_MULTI_GPU: + case Anvil::DeviceType::MULTI_GPU: { /* VMA library takes a physical device handle to extract info regarding supported * memory types and the like. As VK_KHR_device_group provide explicit mGPU support, @@ -116,7 +116,7 @@ bool Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::init() break; } - case Anvil::DEVICE_TYPE_SINGLE_GPU: + case Anvil::DeviceType::SINGLE_GPU: { const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr) ); @@ -186,15 +186,15 @@ bool Anvil::MemoryAllocatorBackends::VMA::bake(Anvil::MemoryAllocator::Items& in bool is_dedicated_alloc = false; VkMemoryRequirements memory_requirements_vk; Anvil::OnMemoryBlockReleaseCallbackFunction release_callback_function; - VkMemoryHeapFlags required_mem_heap_flags = 0; - VkMemoryPropertyFlags required_mem_property_flags = 0; + Anvil::MemoryHeapFlags required_mem_heap_flags; + Anvil::MemoryPropertyFlags required_mem_property_flags; Anvil::Utils::get_vk_property_flags_from_memory_feature_flags(current_item_ptr->alloc_memory_required_features, &required_mem_property_flags, &required_mem_heap_flags); /* NOTE: VMA does not take required memory heap flags at the moment. Adding this is on their radar. */ - anvil_assert(required_mem_heap_flags == 0); + anvil_assert(required_mem_heap_flags == Anvil::MemoryHeapFlagBits::NONE); memory_requirements_vk.alignment = current_item_ptr->alloc_memory_required_alignment; memory_requirements_vk.memoryTypeBits = current_item_ptr->alloc_memory_supported_memory_types; @@ -202,7 +202,7 @@ bool Anvil::MemoryAllocatorBackends::VMA::bake(Anvil::MemoryAllocator::Items& in allocation_create_info.flags = (current_item_ptr->alloc_is_dedicated_memory) ? VmaAllocationCreateFlagBits::VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT : 0; - allocation_create_info.requiredFlags = required_mem_property_flags; + allocation_create_info.requiredFlags = required_mem_property_flags.get_vk(); result_vk = vmaAllocateMemory(m_vma_allocator_ptr->get_handle(), &memory_requirements_vk, @@ -378,7 +378,7 @@ bool Anvil::MemoryAllocatorBackends::VMA::supports_device_masks() const return false; } -bool Anvil::MemoryAllocatorBackends::VMA::supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) const +bool Anvil::MemoryAllocatorBackends::VMA::supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const { /* Vulkan Memory Allocator does NOT support external memory handles */ ANVIL_REDUNDANT_VARIABLE_CONST(in_external_memory_handle_types); diff --git a/src/misc/memory_allocator.cpp b/src/misc/memory_allocator.cpp index 424f5a05..2fa114ad 100644 --- a/src/misc/memory_allocator.cpp +++ b/src/misc/memory_allocator.cpp @@ -35,20 +35,20 @@ #include "wrappers/queue.h" /* Please see header for specification */ -Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, + const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, #endif - const bool& in_alloc_is_dedicated, - const uint32_t& in_device_mask, - const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs) + const bool& in_alloc_is_dedicated, + const uint32_t& in_device_mask, + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -76,21 +76,21 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in register_for_callbacks(); } -Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_alloc_offset, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_alloc_offset, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, + const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, #endif - const bool& in_alloc_is_dedicated, - const uint32_t& in_device_mask, - const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs) + const bool& in_alloc_is_dedicated, + const uint32_t& in_device_mask, + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -120,22 +120,22 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in } /* Please see header for specification */ -Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - uint32_t in_n_layer, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_miptail_offset, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + uint32_t in_n_layer, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_miptail_offset, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, + const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, #endif - const bool& in_alloc_is_dedicated, - const uint32_t& in_device_mask, - const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs) + const bool& in_alloc_is_dedicated, + const uint32_t& in_device_mask, + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -167,23 +167,23 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in } /* Please see header for specification */ -Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - const VkExtent3D& in_extent, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + const Anvil::ImageSubresource& in_subresource, + const VkOffset3D& in_offset, + const VkExtent3D& in_extent, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, + const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, #endif - const bool& in_alloc_is_dedicated, - const uint32_t& in_device_mask, - const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs) + const bool& in_alloc_is_dedicated, + const uint32_t& in_device_mask, + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -216,20 +216,20 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in } /* Please see header for specification */ -Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, - Anvil::Image* in_image_ptr, - VkDeviceSize in_alloc_size, - uint32_t in_alloc_memory_types, - VkDeviceSize in_alloc_alignment, - MemoryFeatureFlags in_alloc_required_memory_features, - uint32_t in_alloc_supported_memory_types, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, + Anvil::Image* in_image_ptr, + VkDeviceSize in_alloc_size, + uint32_t in_alloc_memory_types, + VkDeviceSize in_alloc_alignment, + MemoryFeatureFlags in_alloc_required_memory_features, + uint32_t in_alloc_supported_memory_types, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, + const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, #endif - const bool& in_alloc_is_dedicated, - const uint32_t& in_device_mask, - const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs) + const bool& in_alloc_is_dedicated, + const uint32_t& in_device_mask, + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -419,14 +419,14 @@ Anvil::MemoryAllocator::~MemoryAllocator() /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* in_buffer_ptr, - MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* in_buffer_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -453,14 +453,14 @@ bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* * * @param buffer_ptr Buffer instance to assign a memory block at baking time. **/ -bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* in_buffer_ptr, - MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* in_buffer_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { IMemoryAllocatorBackend* backend_interface_ptr = dynamic_cast(m_backend_ptr.get() ); VkDeviceSize buffer_alignment = 0; @@ -541,15 +541,15 @@ bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - std::unique_ptr in_data_ptr, - MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr in_data_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -580,15 +580,15 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvi } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - std::unique_ptr > in_data_vector_ptr, - MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr > in_data_vector_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -621,15 +621,15 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - const std::vector* in_data_vector_ptr, - MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + const std::vector* in_data_vector_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -667,15 +667,15 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - std::unique_ptr in_data_ptr, - MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr in_data_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -709,7 +709,7 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anv bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif @@ -747,15 +747,15 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_vector_ptr_based_post_f } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - std::unique_ptr in_data_ptr, - MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr in_data_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -786,15 +786,15 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anv } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - std::unique_ptr > in_data_vector_ptr, - MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + std::unique_ptr > in_data_vector_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -827,15 +827,15 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f } /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, - const std::vector* in_data_vector_ptr, - MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, + const std::vector* in_data_vector_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -873,15 +873,15 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f } /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* in_image_ptr, - MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeBits& in_opt_exportable_external_handle_types, +bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* in_image_ptr, + MemoryFeatureFlags in_required_memory_features, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif - const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) { uint32_t filtered_memory_types = 0; VkDeviceSize image_alignment = 0; @@ -1030,7 +1030,7 @@ bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* memory_reqs.alignment, in_required_memory_features, filtered_memory_types, - 0, /* in_opt_exportable_external_handle_types */ + Anvil::ExternalMemoryHandleTypeFlagBits::NONE, #if defined(_WIN32) nullptr, /* in_alloc_external_nt_handle_info_ptr */ #endif @@ -1074,7 +1074,7 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* /* Sanity checks */ anvil_assert(in_image_ptr != nullptr); anvil_assert(m_backend_ptr->supports_baking () ); - anvil_assert(in_image_ptr->get_create_info_ptr()->get_residency_scope() != Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED); + anvil_assert(in_image_ptr->get_create_info_ptr()->get_residency_scope() != Anvil::SparseResidencyScope::UNKNOWN); anvil_assert(in_image_ptr->get_create_info_ptr()->get_n_layers () > in_n_layer); anvil_assert(in_image_ptr->has_aspects (in_aspect) ); anvil_assert( in_opt_device_mask_ptr == nullptr || @@ -1108,9 +1108,9 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* anvil_assert(result); /* Even more sanity checks */ - anvil_assert((aspect_props_ptr->flags & VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT) != 0 && - in_n_layer == 0 || - (aspect_props_ptr->flags & VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT) == 0); + anvil_assert((aspect_props_ptr->flags & Anvil::SparseImageFormatFlagBits::SINGLE_MIPTAIL_BIT) != 0 && + in_n_layer == 0 || + (aspect_props_ptr->flags & Anvil::SparseImageFormatFlagBits::SINGLE_MIPTAIL_BIT) == 0); /* Determine allocation properties */ miptail_memory_types = in_image_ptr->get_image_memory_types(); @@ -1139,7 +1139,7 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* in_image_ptr->get_image_alignment(), in_required_memory_features, filtered_memory_types, - 0, /* in_opt_exportable_external_handle_types */ + Anvil::ExternalMemoryHandleTypeFlagBits::NONE, /* in_opt_exportable_external_handle_types */ #if defined(_WIN32) nullptr, /* in_alloc_external_nt_handle_info_ptr */ #endif @@ -1160,7 +1160,7 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* /* Please see header for specification */ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, + const Anvil::ImageSubresource& in_subresource, const VkOffset3D& in_offset, VkExtent3D in_extent, MemoryFeatureFlags in_required_memory_features, @@ -1184,19 +1184,17 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* /* Sanity checks */ anvil_assert(in_image_ptr != nullptr); anvil_assert(m_backend_ptr->supports_baking () ); - anvil_assert(in_image_ptr->get_create_info_ptr()->get_residency_scope() != Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED); - anvil_assert(in_image_ptr->has_aspects (in_subresource.aspectMask) ); - anvil_assert(in_image_ptr->get_n_mipmaps () > in_subresource.mipLevel); - anvil_assert(in_image_ptr->get_create_info_ptr()->get_n_layers () > in_subresource.arrayLayer); - anvil_assert( in_opt_device_mask_ptr == nullptr || - (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); + anvil_assert(in_image_ptr->get_create_info_ptr()->get_residency_scope() != Anvil::SparseResidencyScope::UNKNOWN); + anvil_assert(in_image_ptr->has_aspects (in_subresource.aspect_mask) ); + anvil_assert(in_image_ptr->get_n_mipmaps () > in_subresource.mip_level); + anvil_assert(in_image_ptr->get_create_info_ptr()->get_n_layers () > in_subresource.array_layer); + anvil_assert( in_opt_device_mask_ptr == nullptr || + (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); anvil_assert(in_extent.depth >= 1); anvil_assert(in_extent.height >= 1); anvil_assert(in_extent.width >= 1); - anvil_assert((Anvil::Utils::is_pow2(static_cast(in_subresource.aspectMask)) != 0)); // only permit a single aspect - if (!do_mgpu_sanity_checks(in_opt_device_mask_ptr, in_opt_mgpu_peer_memory_reqs_ptr) ) { @@ -1220,11 +1218,11 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* } /* Extract image properties needed for calculations below. */ - result = in_image_ptr->get_sparse_image_aspect_properties(static_cast(in_subresource.aspectMask), + result = in_image_ptr->get_sparse_image_aspect_properties(static_cast(in_subresource.aspect_mask.get_vk() ), &aspect_props_ptr); anvil_assert(result); - result = in_image_ptr->get_image_mipmap_size(in_subresource.mipLevel, + result = in_image_ptr->get_image_mipmap_size(in_subresource.mip_level, mip_size + 0, mip_size + 1, mip_size + 2); @@ -1350,7 +1348,7 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* tile_size, in_required_memory_features, filtered_memory_types, - 0, /* in_opt_exportable_external_handle_types */ + Anvil::ExternalMemoryHandleTypeFlagBits::NONE, /* in_opt_exportable_external_handle_types */ #if defined(_WIN32) nullptr, /* in_alloc_external_nt_handle_info_ptr */ #endif @@ -1369,7 +1367,6 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* return result; } - /* Please see header for specification */ bool Anvil::MemoryAllocator::bake() { @@ -1431,7 +1428,7 @@ bool Anvil::MemoryAllocator::bake() case Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_IMAGE_MIPTAIL: case Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_IMAGE_SUBRESOURCE: { - needs_sparse_memory_binding |= ((*item_iterator)->image_ptr->get_create_info_ptr()->get_residency_scope() != Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED); + needs_sparse_memory_binding |= ((*item_iterator)->image_ptr->get_create_info_ptr()->get_residency_scope() != Anvil::SparseResidencyScope::UNKNOWN); break; } @@ -1451,7 +1448,7 @@ bool Anvil::MemoryAllocator::bake() auto create_info_ptr = Anvil::FenceCreateInfo::create(m_device_ptr, false); /* create_signalled */ - create_info_ptr->set_mt_safety(MT_SAFETY_DISABLED); + create_info_ptr->set_mt_safety(Anvil::MTSafety::DISABLED); wait_fence_ptr = Anvil::Fence::create(std::move(create_info_ptr) ); } @@ -1546,7 +1543,7 @@ bool Anvil::MemoryAllocator::bake() case Anvil::MemoryAllocator::ITEM_TYPE_IMAGE_WHOLE: { - if (item_ptr->image_ptr->get_create_info_ptr()->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED) + if (item_ptr->image_ptr->get_create_info_ptr()->get_residency_scope() == Anvil::SparseResidencyScope::UNKNOWN) { if (m_post_bake_per_image_item_mem_assignment_callback_function != nullptr) { @@ -1575,7 +1572,7 @@ bool Anvil::MemoryAllocator::bake() item_ptr->image_ptr, 0, /* resource_offset */ item_ptr->alloc_size, - 0, /* flags */ + Anvil::SparseMemoryBindFlagBits::NONE, item_ptr->alloc_memory_block_ptr.release(), 0, /* opt_memory_block_start_offset */ true); /* in_opt_memory_block_owned_by_image */ @@ -1598,7 +1595,7 @@ bool Anvil::MemoryAllocator::bake() item_ptr->image_ptr, item_ptr->miptail_offset, item_ptr->alloc_size, - 0, /* flags */ + Anvil::SparseMemoryBindFlagBits::NONE, item_ptr->alloc_memory_block_ptr.release(), 0, /* opt_memory_block_start_offset */ true); /* in_opt_memory_block_owned_by_image */ @@ -1621,7 +1618,7 @@ bool Anvil::MemoryAllocator::bake() item_ptr->subresource, item_ptr->offset, item_ptr->extent, - 0, /* flags */ + Anvil::SparseMemoryBindFlagBits::NONE, item_ptr->alloc_memory_block_ptr.release(), 0, /* opt_memory_block_start_offset */ true); /* in_opt_memory_block_owned_by_image */ @@ -1826,7 +1823,7 @@ Anvil::MemoryAllocatorUniquePtr Anvil::MemoryAllocator::create_vma(const Anvil:: return std::move(result_ptr); } -bool Anvil::MemoryAllocator::do_external_memory_handle_type_sanity_checks(const Anvil::ExternalMemoryHandleTypeBits& in_external_memory_handle_types) const +bool Anvil::MemoryAllocator::do_external_memory_handle_type_sanity_checks(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const { bool result = true; @@ -1891,12 +1888,12 @@ bool Anvil::MemoryAllocator::is_alloc_supported(uint32_t in_mem Anvil::MemoryFeatureFlags in_memory_features, uint32_t* out_opt_filtered_memory_types_ptr) const { - const bool is_coherent_memory_required (((in_memory_features & MEMORY_FEATURE_FLAG_HOST_COHERENT) != 0) ); - const bool is_device_local_memory_required (((in_memory_features & MEMORY_FEATURE_FLAG_DEVICE_LOCAL) != 0) ); - const bool is_host_cached_memory_required (((in_memory_features & MEMORY_FEATURE_FLAG_HOST_CACHED) != 0) ); - const bool is_lazily_allocated_memory_required(((in_memory_features & MEMORY_FEATURE_FLAG_LAZILY_ALLOCATED) != 0) ); - const bool is_mappable_memory_required (((in_memory_features & MEMORY_FEATURE_FLAG_MAPPABLE) != 0) ); - const bool is_multi_instance_memory_required (((in_memory_features & MEMORY_FEATURE_FLAG_MULTI_INSTANCE) != 0) ); + const bool is_coherent_memory_required (((in_memory_features & Anvil::MemoryFeatureFlagBits::HOST_COHERENT_BIT) != 0) ); + const bool is_device_local_memory_required (((in_memory_features & Anvil::MemoryFeatureFlagBits::DEVICE_LOCAL_BIT) != 0) ); + const bool is_host_cached_memory_required (((in_memory_features & Anvil::MemoryFeatureFlagBits::HOST_CACHED_BIT) != 0) ); + const bool is_lazily_allocated_memory_required(((in_memory_features & Anvil::MemoryFeatureFlagBits::LAZILY_ALLOCATED_BIT) != 0) ); + const bool is_mappable_memory_required (((in_memory_features & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) != 0) ); + const bool is_multi_instance_memory_required (((in_memory_features & Anvil::MemoryFeatureFlagBits::MULTI_INSTANCE_BIT) != 0) ); const auto& memory_props (m_device_ptr->get_physical_device_memory_properties() ); bool result (true); @@ -1905,12 +1902,12 @@ bool Anvil::MemoryAllocator::is_alloc_supported(uint32_t in_mem (1u << n_memory_type) <= in_memory_types; ++n_memory_type) { - if ((is_coherent_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)) || - (is_device_local_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) || - (is_host_cached_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT)) || - (is_lazily_allocated_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT)) || - (is_mappable_memory_required && !(memory_props.types[n_memory_type].flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)) || - (is_multi_instance_memory_required && !(memory_props.types[n_memory_type].heap_ptr->flags & VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR)) ) + if ((is_coherent_memory_required && ((memory_props.types[n_memory_type].flags & Anvil::MemoryPropertyFlagBits::HOST_COHERENT_BIT)) == 0) || + (is_device_local_memory_required && ((memory_props.types[n_memory_type].flags & Anvil::MemoryPropertyFlagBits::DEVICE_LOCAL_BIT)) == 0) || + (is_host_cached_memory_required && ((memory_props.types[n_memory_type].flags & Anvil::MemoryPropertyFlagBits::HOST_CACHED_BIT)) == 0) || + (is_lazily_allocated_memory_required && ((memory_props.types[n_memory_type].flags & Anvil::MemoryPropertyFlagBits::LAZILY_ALLOCATED_BIT)) == 0) || + (is_mappable_memory_required && ((memory_props.types[n_memory_type].flags & Anvil::MemoryPropertyFlagBits::HOST_VISIBLE_BIT)) == 0) || + (is_multi_instance_memory_required && ((memory_props.types[n_memory_type].heap_ptr->flags & Anvil::MemoryHeapFlagBits::MULTI_INSTANCE_BIT_KHR)) == 0) ) { in_memory_types &= ~(1 << n_memory_type); } diff --git a/src/misc/memory_block_create_info.cpp b/src/misc/memory_block_create_info.cpp index be59dd05..1bb64576 100644 --- a/src/misc/memory_block_create_info.cpp +++ b/src/misc/memory_block_create_info.cpp @@ -66,7 +66,7 @@ Anvil::MemoryBlockCreateInfoUniquePtr Anvil::MemoryBlockCreateInfo::create_deriv auto result_ptr = Anvil::MemoryBlockCreateInfoUniquePtr(nullptr, std::default_delete() ); - anvil_assert(in_device_ptr->get_type() == Anvil::DEVICE_TYPE_SINGLE_GPU); /* todo: pass physical device array below accordingly */ + anvil_assert(in_device_ptr->get_type() == Anvil::DeviceType::SINGLE_GPU); /* todo: pass physical device array below accordingly */ result_ptr.reset( new Anvil::MemoryBlockCreateInfo(Anvil::MemoryBlockType::DERIVED_WITH_CUSTOM_DELETE_PROC, @@ -95,7 +95,7 @@ Anvil::MemoryBlockCreateInfoUniquePtr Anvil::MemoryBlockCreateInfo::create_regul auto result_ptr = Anvil::MemoryBlockCreateInfoUniquePtr(nullptr, std::default_delete() ); - if (in_device_ptr->get_type() == Anvil::DEVICE_TYPE_MULTI_GPU) + if (in_device_ptr->get_type() == Anvil::DeviceType::MULTI_GPU) { const auto device_mgpu_ptr = dynamic_cast(in_device_ptr); const uint32_t n_physical_devices = device_mgpu_ptr->get_n_physical_devices(); @@ -152,16 +152,16 @@ Anvil::MemoryBlockCreateInfo::MemoryBlockCreateInfo(const Anvil::MemoryBlockType m_dedicated_allocation_image_ptr (nullptr), m_device_mask (0), m_device_ptr (in_device_ptr), - m_exportable_external_memory_handle_types (Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE), + m_exportable_external_memory_handle_types (Anvil::ExternalMemoryHandleTypeFlagBits::NONE), #ifdef _WIN32 m_exportable_nt_handle_info_specified (false), #endif m_external_handle_import_info_specified (false), - m_imported_external_memory_handle_type (Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE), + m_imported_external_memory_handle_type (Anvil::ExternalMemoryHandleTypeFlagBits::NONE), m_memory (in_memory), m_memory_features (in_memory_features), m_memory_type_index (in_memory_type_index), - m_mt_safety (Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE), + m_mt_safety (Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE), m_on_release_callback_function (in_on_release_callback_function), m_parent_memory_block_ptr (in_parent_memory_block_ptr), m_size (in_size), @@ -192,7 +192,7 @@ Anvil::MemoryBlockCreateInfo::MemoryBlockCreateInfo(const Anvil::MemoryBlockType } else { - if (m_device_ptr->get_type() == Anvil::DeviceType::DEVICE_TYPE_MULTI_GPU) + if (m_device_ptr->get_type() == Anvil::DeviceType::MULTI_GPU) { const auto device_mgpu_ptr = dynamic_cast(m_device_ptr); const uint32_t n_physical_devices = device_mgpu_ptr->get_n_physical_devices(); diff --git a/src/misc/render_pass_create_info.cpp b/src/misc/render_pass_create_info.cpp index 399671e3..201b2a82 100644 --- a/src/misc/render_pass_create_info.cpp +++ b/src/misc/render_pass_create_info.cpp @@ -44,8 +44,8 @@ Anvil::RenderPassCreateInfo::~RenderPassCreateInfo() /* Please see haeder for specification */ bool Anvil::RenderPassCreateInfo::add_color_attachment(Anvil::Format in_format, Anvil::SampleCountFlagBits in_sample_count, - VkAttachmentLoadOp in_load_op, - VkAttachmentStoreOp in_store_op, + Anvil::AttachmentLoadOp in_load_op, + Anvil::AttachmentStoreOp in_store_op, Anvil::ImageLayout in_initial_layout, Anvil::ImageLayout in_final_layout, bool in_may_alias, @@ -94,13 +94,13 @@ bool Anvil::RenderPassCreateInfo::add_color_attachment(Anvil::Format * @return true if the dependency was added successfully; false otherwise. * **/ -bool Anvil::RenderPassCreateInfo::add_dependency(SubPass* in_destination_subpass_ptr, - SubPass* in_source_subpass_ptr, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) +bool Anvil::RenderPassCreateInfo::add_dependency(SubPass* in_destination_subpass_ptr, + SubPass* in_source_subpass_ptr, + Anvil::PipelineStageFlags in_source_stage_mask, + Anvil::PipelineStageFlags in_destination_stage_mask, + Anvil::AccessFlags in_source_access_mask, + Anvil::AccessFlags in_destination_access_mask, + Anvil::DependencyFlags in_dependency_flags) { auto new_dep = SubPassDependency(in_destination_stage_mask, in_destination_subpass_ptr, @@ -108,7 +108,7 @@ bool Anvil::RenderPassCreateInfo::add_dependency(SubPass* in_destina in_source_subpass_ptr, in_source_access_mask, in_destination_access_mask, - in_by_region); + in_dependency_flags); if (std::find(m_subpass_dependencies.begin(), m_subpass_dependencies.end(), @@ -123,10 +123,10 @@ bool Anvil::RenderPassCreateInfo::add_dependency(SubPass* in_destina /* Please see header for specification */ bool Anvil::RenderPassCreateInfo::add_depth_stencil_attachment(Anvil::Format in_format, Anvil::SampleCountFlagBits in_sample_count, - VkAttachmentLoadOp in_depth_load_op, - VkAttachmentStoreOp in_depth_store_op, - VkAttachmentLoadOp in_stencil_load_op, - VkAttachmentStoreOp in_stencil_store_op, + Anvil::AttachmentLoadOp in_depth_load_op, + Anvil::AttachmentStoreOp in_depth_store_op, + Anvil::AttachmentLoadOp in_stencil_load_op, + Anvil::AttachmentStoreOp in_stencil_store_op, Anvil::ImageLayout in_initial_layout, Anvil::ImageLayout in_final_layout, bool in_may_alias, @@ -162,12 +162,12 @@ bool Anvil::RenderPassCreateInfo::add_depth_stencil_attachment(Anvil::Format } /* Please see header for specification */ -bool Anvil::RenderPassCreateInfo::add_external_to_subpass_dependency(SubPassID in_destination_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) +bool Anvil::RenderPassCreateInfo::add_external_to_subpass_dependency(SubPassID in_destination_subpass_id, + Anvil::PipelineStageFlags in_source_stage_mask, + Anvil::PipelineStageFlags in_destination_stage_mask, + Anvil::AccessFlags in_source_access_mask, + Anvil::AccessFlags in_destination_access_mask, + Anvil::DependencyFlags in_dependency_flags) { SubPass* destination_subpass_ptr = nullptr; bool result = false; @@ -187,18 +187,18 @@ bool Anvil::RenderPassCreateInfo::add_external_to_subpass_dependency(SubPassID in_destination_stage_mask, in_source_access_mask, in_destination_access_mask, - in_by_region); + in_dependency_flags); end: return result; } /* Please see header for specification */ -bool Anvil::RenderPassCreateInfo::add_self_subpass_dependency(SubPassID in_destination_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) +bool Anvil::RenderPassCreateInfo::add_self_subpass_dependency(SubPassID in_destination_subpass_id, + Anvil::PipelineStageFlags in_source_stage_mask, + Anvil::PipelineStageFlags in_destination_stage_mask, + Anvil::AccessFlags in_source_access_mask, + Anvil::AccessFlags in_destination_access_mask, + Anvil::DependencyFlags in_dependency_flags) { SubPass* destination_subpass_ptr = nullptr; bool result = false; @@ -217,7 +217,7 @@ bool Anvil::RenderPassCreateInfo::add_self_subpass_dependency(SubPassID in_destination_stage_mask, in_source_access_mask, in_destination_access_mask, - in_by_region); + in_dependency_flags); end: return result; } @@ -408,7 +408,7 @@ bool Anvil::RenderPassCreateInfo::add_subpass_depth_stencil_attachment(SubPassID subpass_ptr->depth_stencil_attachment = SubPassAttachment(in_attachment_id, in_layout, UINT32_MAX, - Anvil::ImageAspectFlagBits::IMAGE_ASPECT_UNKNOWN); + Anvil::ImageAspectFlagBits::NONE); m_update_preserved_attachments = true; result = true; @@ -434,12 +434,12 @@ bool Anvil::RenderPassCreateInfo::add_subpass_input_attachment(SubPassID } /* Please see header for specification */ -bool Anvil::RenderPassCreateInfo::add_subpass_to_external_dependency(SubPassID in_source_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) +bool Anvil::RenderPassCreateInfo::add_subpass_to_external_dependency(SubPassID in_source_subpass_id, + Anvil::PipelineStageFlags in_source_stage_mask, + Anvil::PipelineStageFlags in_destination_stage_mask, + Anvil::AccessFlags in_source_access_mask, + Anvil::AccessFlags in_destination_access_mask, + Anvil::DependencyFlags in_dependency_flags) { bool result = false; SubPass* source_subpass_ptr = nullptr; @@ -459,19 +459,19 @@ bool Anvil::RenderPassCreateInfo::add_subpass_to_external_dependency(SubPassID in_destination_stage_mask, in_source_access_mask, in_destination_access_mask, - in_by_region); + in_dependency_flags); end: return result; } /* Please see header for specification */ -bool Anvil::RenderPassCreateInfo::add_subpass_to_subpass_dependency(SubPassID in_source_subpass_id, - SubPassID in_destination_subpass_id, - VkPipelineStageFlags in_source_stage_mask, - VkPipelineStageFlags in_destination_stage_mask, - VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region) +bool Anvil::RenderPassCreateInfo::add_subpass_to_subpass_dependency(SubPassID in_source_subpass_id, + SubPassID in_destination_subpass_id, + Anvil::PipelineStageFlags in_source_stage_mask, + Anvil::PipelineStageFlags in_destination_stage_mask, + Anvil::AccessFlags in_source_access_mask, + Anvil::AccessFlags in_destination_access_mask, + Anvil::DependencyFlags in_dependency_flags) { SubPass* destination_subpass_ptr = nullptr; bool result = false; @@ -500,7 +500,7 @@ bool Anvil::RenderPassCreateInfo::add_subpass_to_subpass_dependency(SubPassID in_destination_stage_mask, in_source_access_mask, in_destination_access_mask, - in_by_region); + in_dependency_flags); end: return result; } @@ -581,8 +581,8 @@ bool Anvil::RenderPassCreateInfo::get_attachment_type(RenderPassAttachmentID in_ /* Please see header for specification */ bool Anvil::RenderPassCreateInfo::get_color_attachment_properties(RenderPassAttachmentID in_attachment_id, Anvil::SampleCountFlagBits* out_opt_sample_count_ptr, - VkAttachmentLoadOp* out_opt_load_op_ptr, - VkAttachmentStoreOp* out_opt_store_op_ptr, + Anvil::AttachmentLoadOp* out_opt_load_op_ptr, + Anvil::AttachmentStoreOp* out_opt_store_op_ptr, Anvil::ImageLayout* out_opt_initial_layout_ptr, Anvil::ImageLayout* out_opt_final_layout_ptr, bool* out_opt_may_alias_ptr) const @@ -630,14 +630,14 @@ bool Anvil::RenderPassCreateInfo::get_color_attachment_properties(RenderPassAtta } /** Please see header for specification */ -bool Anvil::RenderPassCreateInfo::get_dependency_properties(uint32_t in_n_dependency, - SubPassID* out_destination_subpass_id_ptr, - SubPassID* out_source_subpass_id_ptr, - VkPipelineStageFlags* out_destination_stage_mask_ptr, - VkPipelineStageFlags* out_source_stage_mask_ptr, - VkAccessFlags* out_destination_access_mask_ptr, - VkAccessFlags* out_source_access_mask_ptr, - DependencyFlags* out_flags_ptr) const +bool Anvil::RenderPassCreateInfo::get_dependency_properties(uint32_t in_n_dependency, + SubPassID* out_destination_subpass_id_ptr, + SubPassID* out_source_subpass_id_ptr, + Anvil::PipelineStageFlags* out_destination_stage_mask_ptr, + Anvil::PipelineStageFlags* out_source_stage_mask_ptr, + Anvil::AccessFlags* out_destination_access_mask_ptr, + Anvil::AccessFlags* out_source_access_mask_ptr, + DependencyFlags* out_flags_ptr) const { const Anvil::RenderPassCreateInfo::SubPassDependency* dep_ptr = nullptr; bool result = false; @@ -668,14 +668,14 @@ bool Anvil::RenderPassCreateInfo::get_dependency_properties(uint32_t } /** Please see header for specification */ -bool Anvil::RenderPassCreateInfo::get_depth_stencil_attachment_properties(RenderPassAttachmentID in_attachment_id, - VkAttachmentLoadOp* out_opt_depth_load_op_ptr, - VkAttachmentStoreOp* out_opt_depth_store_op_ptr, - VkAttachmentLoadOp* out_opt_stencil_load_op_ptr, - VkAttachmentStoreOp* out_opt_stencil_store_op_ptr, - Anvil::ImageLayout* out_opt_initial_layout_ptr, - Anvil::ImageLayout* out_opt_final_layout_ptr, - bool* out_opt_may_alias_ptr) const +bool Anvil::RenderPassCreateInfo::get_depth_stencil_attachment_properties(RenderPassAttachmentID in_attachment_id, + Anvil::AttachmentLoadOp* out_opt_depth_load_op_ptr, + Anvil::AttachmentStoreOp* out_opt_depth_store_op_ptr, + Anvil::AttachmentLoadOp* out_opt_stencil_load_op_ptr, + Anvil::AttachmentStoreOp* out_opt_stencil_store_op_ptr, + Anvil::ImageLayout* out_opt_initial_layout_ptr, + Anvil::ImageLayout* out_opt_final_layout_ptr, + bool* out_opt_may_alias_ptr) const { bool result = false; @@ -766,7 +766,7 @@ bool Anvil::RenderPassCreateInfo::get_subpass_n_attachments(SubPassID in_su { result = true; - if (in_attachment_type == ATTACHMENT_TYPE_PRESERVE && + if (in_attachment_type == Anvil::AttachmentType::PRESERVE && m_update_preserved_attachments) { update_preserved_attachments(); @@ -776,12 +776,12 @@ bool Anvil::RenderPassCreateInfo::get_subpass_n_attachments(SubPassID in_su switch (in_attachment_type) { - case ATTACHMENT_TYPE_COLOR: *out_n_attachments_ptr = static_cast(m_subpasses[in_subpass_id]->color_attachments_map.size() ); break; - case ATTACHMENT_TYPE_INPUT: *out_n_attachments_ptr = static_cast(m_subpasses[in_subpass_id]->input_attachments_map.size() ); break; - case ATTACHMENT_TYPE_PRESERVE: *out_n_attachments_ptr = static_cast(m_subpasses[in_subpass_id]->preserved_attachments.size() ); break; - case ATTACHMENT_TYPE_RESOLVE: *out_n_attachments_ptr = static_cast(m_subpasses[in_subpass_id]->resolved_attachments_map.size() ); break; + case Anvil::AttachmentType::COLOR: *out_n_attachments_ptr = static_cast(m_subpasses[in_subpass_id]->color_attachments_map.size() ); break; + case Anvil::AttachmentType::INPUT: *out_n_attachments_ptr = static_cast(m_subpasses[in_subpass_id]->input_attachments_map.size() ); break; + case Anvil::AttachmentType::PRESERVE: *out_n_attachments_ptr = static_cast(m_subpasses[in_subpass_id]->preserved_attachments.size() ); break; + case Anvil::AttachmentType::RESOLVE: *out_n_attachments_ptr = static_cast(m_subpasses[in_subpass_id]->resolved_attachments_map.size() ); break; - case ATTACHMENT_TYPE_DEPTH_STENCIL: + case Anvil::AttachmentType::DEPTH_STENCIL: { *out_n_attachments_ptr = (m_subpasses[in_subpass_id]->depth_stencil_attachment.attachment_index != UINT32_MAX) ? 1u : 0u; @@ -815,10 +815,10 @@ bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID SubPass* subpass_ptr = nullptr; /* Sanity checks */ - if (in_attachment_type == ATTACHMENT_TYPE_PRESERVE && + if (in_attachment_type == Anvil::AttachmentType::PRESERVE && out_layout_ptr != nullptr) { - anvil_assert(!(in_attachment_type == ATTACHMENT_TYPE_PRESERVE && + anvil_assert(!(in_attachment_type == Anvil::AttachmentType::PRESERVE && out_layout_ptr != nullptr) ); goto end; @@ -836,13 +836,13 @@ bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID /* Even more sanity checks.. */ switch (in_attachment_type) { - case ATTACHMENT_TYPE_COLOR: /* Fall-through */ - case ATTACHMENT_TYPE_INPUT: /* Fall-through */ - case ATTACHMENT_TYPE_RESOLVE: + case Anvil::AttachmentType::COLOR: /* Fall-through */ + case Anvil::AttachmentType::INPUT: /* Fall-through */ + case Anvil::AttachmentType::RESOLVE: { - subpass_attachments_ptr = (in_attachment_type == ATTACHMENT_TYPE_COLOR) ? &subpass_ptr->color_attachments_map - : (in_attachment_type == ATTACHMENT_TYPE_INPUT) ? &subpass_ptr->input_attachments_map - : &subpass_ptr->resolved_attachments_map; + subpass_attachments_ptr = (in_attachment_type == Anvil::AttachmentType::COLOR) ? &subpass_ptr->color_attachments_map + : (in_attachment_type == Anvil::AttachmentType::INPUT) ? &subpass_ptr->input_attachments_map + : &subpass_ptr->resolved_attachments_map; auto iterator = subpass_attachments_ptr->begin(); @@ -874,7 +874,7 @@ bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID break; } - case ATTACHMENT_TYPE_DEPTH_STENCIL: + case Anvil::AttachmentType::DEPTH_STENCIL: { if (in_n_subpass_attachment > 0) { @@ -885,7 +885,7 @@ bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID if (out_opt_aspects_accessed_ptr != nullptr) { - *out_opt_aspects_accessed_ptr = Anvil::ImageAspectFlagBits::IMAGE_ASPECT_UNKNOWN; + *out_opt_aspects_accessed_ptr = Anvil::ImageAspectFlagBits::NONE; } *out_layout_ptr = subpass_ptr->depth_stencil_attachment.layout; @@ -894,7 +894,7 @@ bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID break; } - case ATTACHMENT_TYPE_PRESERVE: + case Anvil::AttachmentType::PRESERVE: { if (subpass_ptr->preserved_attachments.size() <= in_n_subpass_attachment) { @@ -909,7 +909,7 @@ bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID if (out_opt_aspects_accessed_ptr != nullptr) { - *out_opt_aspects_accessed_ptr = Anvil::ImageAspectFlagBits::IMAGE_ASPECT_UNKNOWN; + *out_opt_aspects_accessed_ptr = Anvil::ImageAspectFlagBits::NONE; } break; diff --git a/src/misc/sampler_create_info.cpp b/src/misc/sampler_create_info.cpp index e7006fa7..fbfad7e6 100644 --- a/src/misc/sampler_create_info.cpp +++ b/src/misc/sampler_create_info.cpp @@ -22,22 +22,22 @@ #include "misc/sampler_create_info.h" -Anvil::SamplerCreateInfoUniquePtr Anvil::SamplerCreateInfo::create(const Anvil::BaseDevice* in_device_ptr, - VkFilter in_mag_filter, - VkFilter in_min_filter, - VkSamplerMipmapMode in_mipmap_mode, - VkSamplerAddressMode in_address_mode_u, - VkSamplerAddressMode in_address_mode_v, - VkSamplerAddressMode in_address_mode_w, - float in_lod_bias, - float in_max_anisotropy, - bool in_compare_enable, - VkCompareOp in_compare_op, - float in_min_lod, - float in_max_lod, - VkBorderColor in_border_color, - bool in_use_unnormalized_coordinates, - MTSafety in_mt_safety) +Anvil::SamplerCreateInfoUniquePtr Anvil::SamplerCreateInfo::create(const Anvil::BaseDevice* in_device_ptr, + Anvil::Filter in_mag_filter, + Anvil::Filter in_min_filter, + Anvil::SamplerMipmapMode in_mipmap_mode, + Anvil::SamplerAddressMode in_address_mode_u, + Anvil::SamplerAddressMode in_address_mode_v, + Anvil::SamplerAddressMode in_address_mode_w, + float in_lod_bias, + float in_max_anisotropy, + bool in_compare_enable, + Anvil::CompareOp in_compare_op, + float in_min_lod, + float in_max_lod, + Anvil::BorderColor in_border_color, + bool in_use_unnormalized_coordinates, + MTSafety in_mt_safety) { Anvil::SamplerCreateInfoUniquePtr result_ptr; @@ -63,22 +63,22 @@ Anvil::SamplerCreateInfoUniquePtr Anvil::SamplerCreateInfo::create(const Anvil:: return result_ptr; } -Anvil::SamplerCreateInfo::SamplerCreateInfo(const Anvil::BaseDevice* in_device_ptr, - VkFilter in_mag_filter, - VkFilter in_min_filter, - VkSamplerMipmapMode in_mipmap_mode, - VkSamplerAddressMode in_address_mode_u, - VkSamplerAddressMode in_address_mode_v, - VkSamplerAddressMode in_address_mode_w, - float in_lod_bias, - float in_max_anisotropy, - bool in_compare_enable, - VkCompareOp in_compare_op, - float in_min_lod, - float in_max_lod, - VkBorderColor in_border_color, - bool in_use_unnormalized_coordinates, - MTSafety in_mt_safety) +Anvil::SamplerCreateInfo::SamplerCreateInfo(const Anvil::BaseDevice* in_device_ptr, + Anvil::Filter in_mag_filter, + Anvil::Filter in_min_filter, + Anvil::SamplerMipmapMode in_mipmap_mode, + Anvil::SamplerAddressMode in_address_mode_u, + Anvil::SamplerAddressMode in_address_mode_v, + Anvil::SamplerAddressMode in_address_mode_w, + float in_lod_bias, + float in_max_anisotropy, + bool in_compare_enable, + Anvil::CompareOp in_compare_op, + float in_min_lod, + float in_max_lod, + Anvil::BorderColor in_border_color, + bool in_use_unnormalized_coordinates, + MTSafety in_mt_safety) :m_address_mode_u (in_address_mode_u), m_address_mode_v (in_address_mode_v), m_address_mode_w (in_address_mode_w), diff --git a/src/misc/semaphore_create_info.cpp b/src/misc/semaphore_create_info.cpp index eb84dde2..e2bb0f7e 100644 --- a/src/misc/semaphore_create_info.cpp +++ b/src/misc/semaphore_create_info.cpp @@ -28,7 +28,7 @@ Anvil::SemaphoreCreateInfoUniquePtr Anvil::SemaphoreCreateInfo::create(const Anv result_ptr.reset( new Anvil::SemaphoreCreateInfo(in_device_ptr, - Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE) + Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE) ); return result_ptr; @@ -37,7 +37,7 @@ Anvil::SemaphoreCreateInfoUniquePtr Anvil::SemaphoreCreateInfo::create(const Anv Anvil::SemaphoreCreateInfo::SemaphoreCreateInfo(const Anvil::BaseDevice* in_device_ptr, MTSafety in_mt_safety) :m_device_ptr (in_device_ptr), - m_exportable_external_semaphore_handle_types (Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_NONE), + m_exportable_external_semaphore_handle_types (Anvil::ExternalSemaphoreHandleTypeFlagBits::NONE), #if defined(_WIN32) m_exportable_nt_handle_info_specified (false), m_exportable_nt_handle_info_security_attributes_specified(false), diff --git a/src/misc/swapchain_create_info.cpp b/src/misc/swapchain_create_info.cpp index 6f446164..edd7a7cf 100644 --- a/src/misc/swapchain_create_info.cpp +++ b/src/misc/swapchain_create_info.cpp @@ -27,7 +27,7 @@ Anvil::SwapchainCreateInfoUniquePtr Anvil::SwapchainCreateInfo::create(Anvil::Ba Anvil::RenderingSurface* in_parent_surface_ptr, Anvil::Window* in_window_ptr, Anvil::Format in_format, - VkPresentModeKHR in_present_mode, + Anvil::PresentModeKHR in_present_mode, Anvil::ImageUsageFlags in_usage_flags, uint32_t in_n_images) { @@ -42,24 +42,24 @@ Anvil::SwapchainCreateInfoUniquePtr Anvil::SwapchainCreateInfo::create(Anvil::Ba in_present_mode, in_usage_flags, in_n_images, - Anvil::MT_SAFETY_INHERIT_FROM_PARENT_DEVICE, - 0, /* in_flags */ - VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR) /* in_mgpu_present_mode_flags */ + Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE, + Anvil::SwapchainCreateFlagBits::NONE, + Anvil::DeviceGroupPresentModeFlagBits::LOCAL_BIT_KHR) /* in_mgpu_present_mode_flags */ ); return result_ptr; } -Anvil::SwapchainCreateInfo::SwapchainCreateInfo(Anvil::BaseDevice* in_device_ptr, - Anvil::RenderingSurface* in_parent_surface_ptr, - Anvil::Window* in_window_ptr, - Anvil::Format in_format, - VkPresentModeKHR in_present_mode, - Anvil::ImageUsageFlags in_usage_flags, - uint32_t in_n_images, - MTSafety in_mt_safety, - VkSwapchainCreateFlagsKHR in_flags, - VkDeviceGroupPresentModeFlagsKHR in_mgpu_present_mode_flags) +Anvil::SwapchainCreateInfo::SwapchainCreateInfo(Anvil::BaseDevice* in_device_ptr, + Anvil::RenderingSurface* in_parent_surface_ptr, + Anvil::Window* in_window_ptr, + Anvil::Format in_format, + Anvil::PresentModeKHR in_present_mode, + Anvil::ImageUsageFlags in_usage_flags, + uint32_t in_n_images, + MTSafety in_mt_safety, + Anvil::SwapchainCreateFlags in_flags, + Anvil::DeviceGroupPresentModeFlags in_mgpu_present_mode_flags) :m_device_ptr (in_device_ptr), m_flags (in_flags), m_format (in_format), diff --git a/src/misc/types.cpp b/src/misc/types.cpp index a1776a31..62dfe84d 100644 --- a/src/misc/types.cpp +++ b/src/misc/types.cpp @@ -19,5 +19,39 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // +#include "misc/types.h" - +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::AccessFlags, VkAccessFlags, Anvil::AccessFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::BufferCreateFlags, VkBufferCreateFlags, Anvil::BufferCreateFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::BufferUsageFlags, VkBufferUsageFlags, Anvil::BufferUsageFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::ColorComponentFlags, VkColorComponentFlags, Anvil::ColorComponentFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::CompositeAlphaFlags, VkCompositeAlphaFlagsKHR, Anvil::CompositeAlphaFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::CullModeFlags, VkCullModeFlags, Anvil::CullModeFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::DependencyFlags, VkDependencyFlags, Anvil::DependencyFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::DescriptorBindingFlags, VkDescriptorBindingFlagsEXT, Anvil::DescriptorBindingFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::DescriptorPoolCreateFlags, VkDescriptorPoolCreateFlags, Anvil::DescriptorPoolCreateFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::DeviceGroupPresentModeFlags, VkDeviceGroupPresentModeFlagsKHR, Anvil::DeviceGroupPresentModeFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::ExternalFenceHandleTypeFlags, VkExternalFenceHandleTypeFlagsKHR, Anvil::ExternalFenceHandleTypeFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::ExternalMemoryHandleTypeFlags, VkExternalMemoryHandleTypeFlagsKHR, Anvil::ExternalMemoryHandleTypeFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::ExternalSemaphoreHandleTypeFlags, VkExternalSemaphoreHandleTypeFlagsKHR, Anvil::ExternalSemaphoreHandleTypeFlagBits) +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::FormatFeatureFlags, VkFormatFeatureFlags, Anvil::FormatFeatureFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::ImageAspectFlags, VkImageAspectFlags, Anvil::ImageAspectFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::ImageCreateFlags, VkImageCreateFlags, Anvil::ImageCreateFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::ImageUsageFlags, VkImageUsageFlags, Anvil::ImageUsageFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::MemoryFeatureFlags, uint32_t, Anvil::MemoryFeatureFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::MemoryHeapFlags, VkMemoryHeapFlags, Anvil::MemoryHeapFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::MemoryPropertyFlags, VkMemoryPropertyFlags, Anvil::MemoryPropertyFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::PeerMemoryFeatureFlags, VkPeerMemoryFeatureFlagsKHR, Anvil::PeerMemoryFeatureFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::PipelineStageFlags, VkPipelineStageFlags, Anvil::PipelineStageFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::QueueFamilyFlags, uint32_t, Anvil::QueueFamilyFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::QueueFlags, VkQueueFlags, Anvil::QueueFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::QueryControlFlags, VkQueryControlFlags, Anvil::QueryControlFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::QueryPipelineStatisticFlags, VkQueryPipelineStatisticFlags, Anvil::QueryPipelineStatisticFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::QueryResultFlags, VkQueryResultFlags, Anvil::QueryResultFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::SampleCountFlags, VkSampleCountFlags, Anvil::SampleCountFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::ShaderStageFlags, VkShaderStageFlags, Anvil::ShaderStageFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::SparseImageFormatFlags, VkSparseImageFormatFlags, Anvil::SparseImageFormatFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::SparseMemoryBindFlags, VkSparseMemoryBindFlags, Anvil::SparseMemoryBindFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::StencilFaceFlags, VkStencilFaceFlags, Anvil::StencilFaceFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::SurfaceTransformFlags, VkSurfaceTransformFlagsKHR, Anvil::SurfaceTransformFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::SwapchainCreateFlags, VkSwapchainCreateFlagsKHR, Anvil::SwapchainCreateFlagBits); \ No newline at end of file diff --git a/src/misc/types_classes.cpp b/src/misc/types_classes.cpp index 7689991a..307fc3ef 100644 --- a/src/misc/types_classes.cpp +++ b/src/misc/types_classes.cpp @@ -98,24 +98,24 @@ void Anvil::SparseMemoryBindingUpdateInfo::append_buffer_memory_update(SparseMem } /** Please see header for specification */ -void Anvil::SparseMemoryBindingUpdateInfo::append_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, - Anvil::Image* in_image_ptr, - const VkImageSubresource& in_subresource, - const VkOffset3D& in_offset, - const VkExtent3D& in_extent, - VkSparseMemoryBindFlags in_flags, - Anvil::MemoryBlock* in_opt_memory_block_ptr, - VkDeviceSize in_opt_memory_block_start_offset, - bool in_opt_memory_block_owned_by_image) +void Anvil::SparseMemoryBindingUpdateInfo::append_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, + Anvil::Image* in_image_ptr, + const Anvil::ImageSubresource& in_subresource, + const VkOffset3D& in_offset, + const VkExtent3D& in_extent, + Anvil::SparseMemoryBindFlags in_flags, + Anvil::MemoryBlock* in_opt_memory_block_ptr, + VkDeviceSize in_opt_memory_block_start_offset, + bool in_opt_memory_block_owned_by_image) { /* Sanity checks .. */ anvil_assert(in_image_ptr != nullptr); anvil_assert(in_flags == 0); anvil_assert(m_bindings.size() > in_bind_info_id); - anvil_assert(in_image_ptr->get_create_info_ptr()->get_n_layers() > in_subresource.arrayLayer); - anvil_assert(in_image_ptr->get_n_mipmaps () > in_subresource.mipLevel); - anvil_assert(in_image_ptr->has_aspects (in_subresource.aspectMask) ); + anvil_assert(in_image_ptr->get_create_info_ptr()->get_n_layers() > in_subresource.array_layer); + anvil_assert(in_image_ptr->get_n_mipmaps () > in_subresource.mip_level); + anvil_assert(in_image_ptr->has_aspects (in_subresource.aspect_mask) ); if (in_opt_memory_block_ptr != nullptr) { @@ -136,27 +136,27 @@ void Anvil::SparseMemoryBindingUpdateInfo::append_image_memory_update(SparseMemo update.subresource = in_subresource; update_vk.extent = in_extent; - update_vk.flags = in_flags; + update_vk.flags = in_flags.get_vk(); update_vk.memory = (in_opt_memory_block_ptr != nullptr) ? in_opt_memory_block_ptr->get_memory() : VK_NULL_HANDLE; update_vk.memoryOffset = (in_opt_memory_block_ptr != nullptr) ? in_opt_memory_block_ptr->get_start_offset() + in_opt_memory_block_start_offset : UINT32_MAX; update_vk.offset = in_offset; - update_vk.subresource = in_subresource; + update_vk.subresource = in_subresource.get_vk(); binding.image_updates[in_image_ptr].first.push_back (update); binding.image_updates[in_image_ptr].second.push_back(update_vk); } /** Please see header for specification */ -void Anvil::SparseMemoryBindingUpdateInfo::append_opaque_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, - Anvil::Image* in_image_ptr, - VkDeviceSize in_resource_offset, - VkDeviceSize in_size, - VkSparseMemoryBindFlags in_flags, - Anvil::MemoryBlock* in_opt_memory_block_ptr, - VkDeviceSize in_opt_memory_block_start_offset, - bool in_opt_memory_block_owned_by_image) +void Anvil::SparseMemoryBindingUpdateInfo::append_opaque_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, + Anvil::Image* in_image_ptr, + VkDeviceSize in_resource_offset, + VkDeviceSize in_size, + Anvil::SparseMemoryBindFlags in_flags, + Anvil::MemoryBlock* in_opt_memory_block_ptr, + VkDeviceSize in_opt_memory_block_start_offset, + bool in_opt_memory_block_owned_by_image) { /* Sanity checks */ anvil_assert(in_image_ptr != nullptr); @@ -180,7 +180,7 @@ void Anvil::SparseMemoryBindingUpdateInfo::append_opaque_image_memory_update(Spa update.size = in_size; update.start_offset = in_resource_offset; - update_vk.flags = in_flags; + update_vk.flags = in_flags.get_vk(); update_vk.memory = (in_opt_memory_block_ptr != nullptr) ? in_opt_memory_block_ptr->get_memory() : VK_NULL_HANDLE; update_vk.memoryOffset = (in_opt_memory_block_ptr != nullptr) ? (in_opt_memory_block_ptr->get_start_offset() + in_opt_memory_block_start_offset) @@ -537,16 +537,16 @@ bool Anvil::SparseMemoryBindingUpdateInfo::get_device_indices(SparseMemoryBindIn } /** Please see header for specification */ -bool Anvil::SparseMemoryBindingUpdateInfo::get_image_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, - uint32_t in_n_update, - Anvil::Image** out_opt_image_ptr_ptr, - VkImageSubresource* out_opt_subresource_ptr, - VkOffset3D* out_opt_offset_ptr, - VkExtent3D* out_opt_extent_ptr, - VkSparseMemoryBindFlags* out_opt_flags_ptr, - Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, - VkDeviceSize* out_opt_memory_block_start_offset_ptr, - bool* out_opt_memory_block_owned_by_image_ptr) const +bool Anvil::SparseMemoryBindingUpdateInfo::get_image_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, + uint32_t in_n_update, + Anvil::Image** out_opt_image_ptr_ptr, + Anvil::ImageSubresource* out_opt_subresource_ptr, + VkOffset3D* out_opt_offset_ptr, + VkExtent3D* out_opt_extent_ptr, + Anvil::SparseMemoryBindFlags* out_opt_flags_ptr, + Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, + VkDeviceSize* out_opt_memory_block_start_offset_ptr, + bool* out_opt_memory_block_owned_by_image_ptr) const { decltype(m_bindings)::const_iterator binding_iterator; ImageBindInfo image_bind; @@ -635,15 +635,15 @@ bool Anvil::SparseMemoryBindingUpdateInfo::get_image_memory_update_properties(Sp } /** Please see header for specification */ -bool Anvil::SparseMemoryBindingUpdateInfo::get_image_opaque_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, - uint32_t in_n_update, - Anvil::Image** out_opt_image_ptr_ptr, - VkDeviceSize* out_opt_resource_offset_ptr, - VkDeviceSize* out_opt_size_ptr, - VkSparseMemoryBindFlags* out_opt_flags_ptr, - Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, - VkDeviceSize* out_opt_memory_block_start_offset_ptr, - bool* out_opt_memory_block_owned_by_image_ptr) const +bool Anvil::SparseMemoryBindingUpdateInfo::get_image_opaque_memory_update_properties(SparseMemoryBindInfoID in_bind_info_id, + uint32_t in_n_update, + Anvil::Image** out_opt_image_ptr_ptr, + VkDeviceSize* out_opt_resource_offset_ptr, + VkDeviceSize* out_opt_size_ptr, + Anvil::SparseMemoryBindFlags* out_opt_flags_ptr, + Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, + VkDeviceSize* out_opt_memory_block_start_offset_ptr, + bool* out_opt_memory_block_owned_by_image_ptr) const { decltype(m_bindings)::const_iterator binding_iterator; GeneralBindInfo image_opaque_bind; diff --git a/src/misc/types_struct.cpp b/src/misc/types_struct.cpp index d01f7915..95d63d3e 100644 --- a/src/misc/types_struct.cpp +++ b/src/misc/types_struct.cpp @@ -92,30 +92,30 @@ Anvil::BufferBarrier::BufferBarrier(const BufferBarrier& in) } /** Please see header for specification */ -Anvil::BufferBarrier::BufferBarrier(VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - uint32_t in_src_queue_family_index, - uint32_t in_dst_queue_family_index, - Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_offset, - VkDeviceSize in_size) +Anvil::BufferBarrier::BufferBarrier(Anvil::AccessFlags in_source_access_mask, + Anvil::AccessFlags in_destination_access_mask, + uint32_t in_src_queue_family_index, + uint32_t in_dst_queue_family_index, + Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkDeviceSize in_size) { buffer = in_buffer_ptr->get_buffer(); buffer_ptr = in_buffer_ptr; - dst_access_mask = static_cast(in_destination_access_mask); + dst_access_mask = in_destination_access_mask; dst_queue_family_index = in_dst_queue_family_index; offset = in_offset; size = in_size; - src_access_mask = static_cast(in_source_access_mask); + src_access_mask = in_source_access_mask; src_queue_family_index = in_src_queue_family_index; buffer_barrier_vk.buffer = in_buffer_ptr->get_buffer(); - buffer_barrier_vk.dstAccessMask = in_destination_access_mask; + buffer_barrier_vk.dstAccessMask = in_destination_access_mask.get_vk(); buffer_barrier_vk.dstQueueFamilyIndex = in_dst_queue_family_index; buffer_barrier_vk.offset = in_offset; buffer_barrier_vk.pNext = nullptr; buffer_barrier_vk.size = in_size; - buffer_barrier_vk.srcAccessMask = in_source_access_mask, + buffer_barrier_vk.srcAccessMask = in_source_access_mask.get_vk(), buffer_barrier_vk.srcQueueFamilyIndex = in_src_queue_family_index; buffer_barrier_vk.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER; @@ -187,7 +187,7 @@ Anvil::DescriptorSetAllocation::DescriptorSetAllocation(const Anvil::DescriptorS } Anvil::DescriptorUpdateTemplateEntry::DescriptorUpdateTemplateEntry() - :descriptor_type (VK_DESCRIPTOR_TYPE_MAX_ENUM), + :descriptor_type (Anvil::DescriptorType::UNKNOWN), n_descriptors (UINT32_MAX), n_destination_array_element(UINT32_MAX), n_destination_binding (UINT32_MAX), @@ -197,12 +197,12 @@ Anvil::DescriptorUpdateTemplateEntry::DescriptorUpdateTemplateEntry() /* Stub */ } -Anvil::DescriptorUpdateTemplateEntry::DescriptorUpdateTemplateEntry(const VkDescriptorType& in_descriptor_type, - const uint32_t& in_n_destination_array_element, - const uint32_t& in_n_destination_binding, - const uint32_t& in_n_descriptors, - const size_t& in_offset, - const size_t& in_stride) +Anvil::DescriptorUpdateTemplateEntry::DescriptorUpdateTemplateEntry(const Anvil::DescriptorType& in_descriptor_type, + const uint32_t& in_n_destination_array_element, + const uint32_t& in_n_destination_binding, + const uint32_t& in_n_descriptors, + const size_t& in_offset, + const size_t& in_stride) :descriptor_type (in_descriptor_type), n_descriptors (in_n_descriptors), n_destination_array_element(in_n_destination_array_element), @@ -289,7 +289,7 @@ VkDescriptorUpdateTemplateEntryKHR Anvil::DescriptorUpdateTemplateEntry::get_vk_ VkDescriptorUpdateTemplateEntryKHR result; result.descriptorCount = n_descriptors; - result.descriptorType = descriptor_type; + result.descriptorType = static_cast(descriptor_type); result.dstArrayElement = n_destination_array_element; result.dstBinding = n_destination_binding; result.offset = offset; @@ -670,48 +670,42 @@ Anvil::EXTVertexAttributeDivisorProperties::EXTVertexAttributeDivisorProperties( Anvil::ExternalFenceProperties::ExternalFenceProperties() { - compatible_external_handle_types = 0; - export_from_imported_external_handle_types = 0; - is_exportable = false; - is_importable = false; + is_exportable = false; + is_importable = false; } Anvil::ExternalFenceProperties::ExternalFenceProperties(const VkExternalFencePropertiesKHR& in_external_fence_props) { - compatible_external_handle_types = Anvil::Utils::convert_vk_external_fence_handle_type_flags_to_external_fence_handle_type_bits(in_external_fence_props.compatibleHandleTypes); - export_from_imported_external_handle_types = Anvil::Utils::convert_vk_external_fence_handle_type_flags_to_external_fence_handle_type_bits(in_external_fence_props.exportFromImportedHandleTypes); + compatible_external_handle_types = static_cast(in_external_fence_props.compatibleHandleTypes); + export_from_imported_external_handle_types = static_cast(in_external_fence_props.exportFromImportedHandleTypes); is_exportable = (in_external_fence_props.externalFenceFeatures & VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT_KHR) != 0; is_importable = (in_external_fence_props.externalFenceFeatures & VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT_KHR) != 0; } Anvil::ExternalMemoryProperties::ExternalMemoryProperties() { - compatible_external_handle_types = 0; - export_from_imported_external_handle_types = 0; - is_exportable = false; - is_importable = false; + is_exportable = false; + is_importable = false; } Anvil::ExternalMemoryProperties::ExternalMemoryProperties(const VkExternalMemoryPropertiesKHR& in_external_memory_props) { - compatible_external_handle_types = Anvil::Utils::convert_vk_external_memory_handle_type_flags_to_external_memory_handle_type_bits(in_external_memory_props.compatibleHandleTypes); - export_from_imported_external_handle_types = Anvil::Utils::convert_vk_external_memory_handle_type_flags_to_external_memory_handle_type_bits(in_external_memory_props.exportFromImportedHandleTypes); + compatible_external_handle_types = static_cast(in_external_memory_props.compatibleHandleTypes); + export_from_imported_external_handle_types = static_cast(in_external_memory_props.exportFromImportedHandleTypes); is_exportable = (in_external_memory_props.externalMemoryFeatures & VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHR) != 0; is_importable = (in_external_memory_props.externalMemoryFeatures & VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHR) != 0; } Anvil::ExternalSemaphoreProperties::ExternalSemaphoreProperties() { - compatible_external_handle_types = 0; - export_from_imported_external_handle_types = 0; - is_exportable = false; - is_importable = false; + is_exportable = false; + is_importable = false; } Anvil::ExternalSemaphoreProperties::ExternalSemaphoreProperties(const VkExternalSemaphorePropertiesKHR& in_external_semaphore_props) { - compatible_external_handle_types = Anvil::Utils::convert_vk_external_semaphore_handle_type_flags_to_external_semaphore_handle_type_bits(in_external_semaphore_props.compatibleHandleTypes); - export_from_imported_external_handle_types = Anvil::Utils::convert_vk_external_semaphore_handle_type_flags_to_external_semaphore_handle_type_bits(in_external_semaphore_props.exportFromImportedHandleTypes); + compatible_external_handle_types = static_cast(in_external_semaphore_props.compatibleHandleTypes); + export_from_imported_external_handle_types = static_cast(in_external_semaphore_props.exportFromImportedHandleTypes); is_exportable = (in_external_semaphore_props.externalSemaphoreFeatures & VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT_KHR) != 0; is_importable = (in_external_semaphore_props.externalSemaphoreFeatures & VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT_KHR) != 0; } @@ -736,9 +730,9 @@ Anvil::FormatProperties::FormatProperties() Anvil::FormatProperties::FormatProperties(const VkFormatProperties& in_format_props) { - buffer_capabilities = in_format_props.bufferFeatures; - linear_tiling_capabilities = in_format_props.linearTilingFeatures; - optimal_tiling_capabilities = in_format_props.optimalTilingFeatures; + buffer_capabilities = static_cast(in_format_props.bufferFeatures); + linear_tiling_capabilities = static_cast(in_format_props.linearTilingFeatures); + optimal_tiling_capabilities = static_cast(in_format_props.optimalTilingFeatures); } Anvil::ImageFormatProperties::ImageFormatProperties() @@ -757,14 +751,13 @@ Anvil::ImageFormatProperties::ImageFormatProperties(const VkImageFormatPropertie max_resource_size = in_image_format_props.maxResourceSize; n_max_array_layers = in_image_format_props.maxArrayLayers; n_max_mip_levels = in_image_format_props.maxMipLevels; - sample_counts = in_image_format_props.sampleCounts; + sample_counts = static_cast(in_image_format_props.sampleCounts); supports_amd_texture_gather_bias_lod = in_supports_amd_texture_gather_bias_lod; } /** Please see header for specification */ Anvil::ImageBarrier::ImageBarrier(const ImageBarrier& in) { - by_region = in.by_region; dst_access_mask = in.dst_access_mask; dst_queue_family_index = in.dst_queue_family_index; image = in.image; @@ -778,39 +771,37 @@ Anvil::ImageBarrier::ImageBarrier(const ImageBarrier& in) } /** Please see header for specification */ -Anvil::ImageBarrier::ImageBarrier(VkAccessFlags in_source_access_mask, - VkAccessFlags in_destination_access_mask, - bool in_by_region_barrier, - Anvil::ImageLayout in_old_layout, - Anvil::ImageLayout in_new_layout, - uint32_t in_src_queue_family_index, - uint32_t in_dst_queue_family_index, - Anvil::Image* in_image_ptr, - VkImageSubresourceRange in_image_subresource_range) -{ - by_region = in_by_region_barrier; - dst_access_mask = static_cast(in_destination_access_mask); +Anvil::ImageBarrier::ImageBarrier(Anvil::AccessFlags in_source_access_mask, + Anvil::AccessFlags in_destination_access_mask, + Anvil::ImageLayout in_old_layout, + Anvil::ImageLayout in_new_layout, + uint32_t in_src_queue_family_index, + uint32_t in_dst_queue_family_index, + Anvil::Image* in_image_ptr, + Anvil::ImageSubresourceRange in_image_subresource_range) +{ + dst_access_mask = in_destination_access_mask; dst_queue_family_index = in_dst_queue_family_index; image = (in_image_ptr != VK_NULL_HANDLE) ? in_image_ptr->get_image() : VK_NULL_HANDLE; image_ptr = in_image_ptr; new_layout = in_new_layout; old_layout = in_old_layout; - src_access_mask = static_cast(in_source_access_mask); + src_access_mask = in_source_access_mask; src_queue_family_index = in_src_queue_family_index; subresource_range = in_image_subresource_range; - image_barrier_vk.dstAccessMask = in_destination_access_mask; + image_barrier_vk.dstAccessMask = in_destination_access_mask.get_vk(); image_barrier_vk.dstQueueFamilyIndex = in_dst_queue_family_index; image_barrier_vk.image = (in_image_ptr != nullptr) ? in_image_ptr->get_image() : VK_NULL_HANDLE; image_barrier_vk.newLayout = static_cast(in_new_layout); image_barrier_vk.oldLayout = static_cast(in_old_layout); image_barrier_vk.pNext = nullptr; - image_barrier_vk.srcAccessMask = in_source_access_mask; + image_barrier_vk.srcAccessMask = in_source_access_mask.get_vk(); image_barrier_vk.srcQueueFamilyIndex = in_src_queue_family_index; image_barrier_vk.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; - image_barrier_vk.subresourceRange = in_image_subresource_range; + image_barrier_vk.subresourceRange = in_image_subresource_range.get_vk(); /* NOTE: For an image barrier to work correctly, the underlying subresource range must be assigned memory. * Query for a memory block in order to force any listening memory allocators to bake */ @@ -832,7 +823,6 @@ bool Anvil::ImageBarrier::operator==(const ImageBarrier& in_barrier) const result &= (dst_access_mask == in_barrier.dst_access_mask); result &= (src_access_mask == in_barrier.src_access_mask); - result &= (by_region == in_barrier.by_region); result &= (dst_queue_family_index == in_barrier.dst_queue_family_index); result &= (image == in_barrier.image); result &= (image_ptr == in_barrier.image_ptr); @@ -840,11 +830,11 @@ bool Anvil::ImageBarrier::operator==(const ImageBarrier& in_barrier) const result &= (old_layout == in_barrier.old_layout); result &= (src_queue_family_index == in_barrier.src_queue_family_index); - result &= (subresource_range.aspectMask == in_barrier.subresource_range.aspectMask); - result &= (subresource_range.baseArrayLayer == in_barrier.subresource_range.baseArrayLayer); - result &= (subresource_range.baseMipLevel == in_barrier.subresource_range.baseMipLevel); - result &= (subresource_range.layerCount == in_barrier.subresource_range.layerCount); - result &= (subresource_range.levelCount == in_barrier.subresource_range.levelCount); + result &= (subresource_range.aspect_mask == in_barrier.subresource_range.aspect_mask); + result &= (subresource_range.base_array_layer == in_barrier.subresource_range.base_array_layer); + result &= (subresource_range.base_mip_level == in_barrier.subresource_range.base_mip_level); + result &= (subresource_range.layer_count == in_barrier.subresource_range.layer_count); + result &= (subresource_range.level_count == in_barrier.subresource_range.level_count); return result; } @@ -959,21 +949,20 @@ bool Anvil::Layer::operator==(const std::string& in_layer_name) const return name == in_layer_name; } -Anvil::MemoryBarrier::MemoryBarrier(VkAccessFlags in_destination_access_mask, - VkAccessFlags in_source_access_mask) +Anvil::MemoryBarrier::MemoryBarrier(Anvil::AccessFlags in_destination_access_mask, + Anvil::AccessFlags in_source_access_mask) { - destination_access_mask = static_cast(in_destination_access_mask); - source_access_mask = static_cast(in_source_access_mask); + destination_access_mask = in_destination_access_mask; + source_access_mask = in_source_access_mask; - memory_barrier_vk.dstAccessMask = destination_access_mask; + memory_barrier_vk.dstAccessMask = destination_access_mask.get_vk(); memory_barrier_vk.pNext = nullptr; - memory_barrier_vk.srcAccessMask = source_access_mask; + memory_barrier_vk.srcAccessMask = source_access_mask.get_vk(); memory_barrier_vk.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER; } Anvil::MemoryHeap::MemoryHeap() { - flags = 0; index = UINT32_MAX; size = 0; } @@ -1029,7 +1018,7 @@ void Anvil::MemoryProperties::init(const VkPhysicalDeviceMemoryProperties& in_me n_heap < in_mem_properties.memoryHeapCount; ++n_heap) { - heaps[n_heap].flags = static_cast(in_mem_properties.memoryHeaps[n_heap].flags); + heaps[n_heap].flags = static_cast(in_mem_properties.memoryHeaps[n_heap].flags); heaps[n_heap].index = n_heap; heaps[n_heap].size = in_mem_properties.memoryHeaps[n_heap].size; } @@ -1057,7 +1046,7 @@ bool Anvil::operator==(const MemoryHeap& in1, Anvil::MemoryType::MemoryType(const VkMemoryType& in_type, struct MemoryProperties* in_memory_props_ptr) { - flags = static_cast(in_type.propertyFlags); + flags = static_cast(in_type.propertyFlags); heap_ptr = &in_memory_props_ptr->heaps[in_type.heapIndex]; features = Anvil::Utils::get_memory_feature_flags_from_vk_property_flags(flags, @@ -1690,10 +1679,10 @@ Anvil::PhysicalDeviceGroup::PhysicalDeviceGroup() Anvil::PhysicalDeviceLimits::PhysicalDeviceLimits() :buffer_image_granularity (std::numeric_limits::max() ), discrete_queue_priorities (UINT32_MAX), - framebuffer_color_sample_counts (Anvil::SampleCountFlagBits::SAMPLE_COUNT_UNKNOWN), - framebuffer_depth_sample_counts (Anvil::SampleCountFlagBits::SAMPLE_COUNT_UNKNOWN), - framebuffer_no_attachments_sample_counts (Anvil::SampleCountFlagBits::SAMPLE_COUNT_UNKNOWN), - framebuffer_stencil_sample_counts (Anvil::SampleCountFlagBits::SAMPLE_COUNT_UNKNOWN), + framebuffer_color_sample_counts (Anvil::SampleCountFlagBits::NONE), + framebuffer_depth_sample_counts (Anvil::SampleCountFlagBits::NONE), + framebuffer_no_attachments_sample_counts (Anvil::SampleCountFlagBits::NONE), + framebuffer_stencil_sample_counts (Anvil::SampleCountFlagBits::NONE), line_width_granularity (FLT_MAX), max_bound_descriptor_sets (UINT32_MAX), max_clip_distances (UINT32_MAX), @@ -1774,13 +1763,13 @@ Anvil::PhysicalDeviceLimits::PhysicalDeviceLimits() optimal_buffer_copy_offset_alignment (std::numeric_limits::max() ), optimal_buffer_copy_row_pitch_alignment (std::numeric_limits::max() ), point_size_granularity (FLT_MAX), - sampled_image_color_sample_counts (Anvil::SampleCountFlagBits::SAMPLE_COUNT_UNKNOWN), - sampled_image_depth_sample_counts (Anvil::SampleCountFlagBits::SAMPLE_COUNT_UNKNOWN), - sampled_image_integer_sample_counts (Anvil::SampleCountFlagBits::SAMPLE_COUNT_UNKNOWN), - sampled_image_stencil_sample_counts (Anvil::SampleCountFlagBits::SAMPLE_COUNT_UNKNOWN), + sampled_image_color_sample_counts (Anvil::SampleCountFlagBits::NONE), + sampled_image_depth_sample_counts (Anvil::SampleCountFlagBits::NONE), + sampled_image_integer_sample_counts (Anvil::SampleCountFlagBits::NONE), + sampled_image_stencil_sample_counts (Anvil::SampleCountFlagBits::NONE), sparse_address_space_size (std::numeric_limits::max() ), standard_sample_locations (false), - storage_image_sample_counts (Anvil::SampleCountFlagBits::SAMPLE_COUNT_UNKNOWN), + storage_image_sample_counts (Anvil::SampleCountFlagBits::NONE), strict_lines (false), sub_pixel_interpolation_offset_bits (UINT32_MAX), sub_pixel_precision_bits (UINT32_MAX), @@ -1813,10 +1802,10 @@ Anvil::PhysicalDeviceLimits::PhysicalDeviceLimits() Anvil::PhysicalDeviceLimits::PhysicalDeviceLimits(const VkPhysicalDeviceLimits& in_device_limits) :buffer_image_granularity (in_device_limits.bufferImageGranularity), discrete_queue_priorities (in_device_limits.discreteQueuePriorities), - framebuffer_color_sample_counts (in_device_limits.framebufferColorSampleCounts), - framebuffer_depth_sample_counts (in_device_limits.framebufferDepthSampleCounts), - framebuffer_no_attachments_sample_counts (in_device_limits.framebufferNoAttachmentsSampleCounts), - framebuffer_stencil_sample_counts (in_device_limits.framebufferStencilSampleCounts), + framebuffer_color_sample_counts (static_cast(in_device_limits.framebufferColorSampleCounts) ), + framebuffer_depth_sample_counts (static_cast(in_device_limits.framebufferDepthSampleCounts) ), + framebuffer_no_attachments_sample_counts (static_cast(in_device_limits.framebufferNoAttachmentsSampleCounts) ), + framebuffer_stencil_sample_counts (static_cast(in_device_limits.framebufferStencilSampleCounts) ), line_width_granularity (in_device_limits.lineWidthGranularity), max_bound_descriptor_sets (in_device_limits.maxBoundDescriptorSets), max_clip_distances (in_device_limits.maxClipDistances), @@ -1897,13 +1886,13 @@ Anvil::PhysicalDeviceLimits::PhysicalDeviceLimits(const VkPhysicalDeviceLimits& optimal_buffer_copy_offset_alignment (in_device_limits.optimalBufferCopyOffsetAlignment), optimal_buffer_copy_row_pitch_alignment (in_device_limits.optimalBufferCopyRowPitchAlignment), point_size_granularity (in_device_limits.pointSizeGranularity), - sampled_image_color_sample_counts (in_device_limits.sampledImageColorSampleCounts), - sampled_image_depth_sample_counts (in_device_limits.sampledImageDepthSampleCounts), - sampled_image_integer_sample_counts (in_device_limits.sampledImageIntegerSampleCounts), - sampled_image_stencil_sample_counts (in_device_limits.sampledImageStencilSampleCounts), + sampled_image_color_sample_counts (static_cast(in_device_limits.sampledImageColorSampleCounts) ), + sampled_image_depth_sample_counts (static_cast(in_device_limits.sampledImageDepthSampleCounts) ), + sampled_image_integer_sample_counts (static_cast(in_device_limits.sampledImageIntegerSampleCounts) ), + sampled_image_stencil_sample_counts (static_cast(in_device_limits.sampledImageStencilSampleCounts) ), sparse_address_space_size (in_device_limits.sparseAddressSpaceSize), standard_sample_locations (VK_BOOL32_TO_BOOL(in_device_limits.standardSampleLocations) ), - storage_image_sample_counts (in_device_limits.storageImageSampleCounts), + storage_image_sample_counts (static_cast(in_device_limits.storageImageSampleCounts) ), strict_lines (VK_BOOL32_TO_BOOL(in_device_limits.strictLines) ), sub_pixel_interpolation_offset_bits (in_device_limits.subPixelInterpolationOffsetBits), sub_pixel_precision_bits (in_device_limits.subPixelPrecisionBits), @@ -2171,13 +2160,13 @@ bool Anvil::PhysicalDeviceSparseProperties::operator==(const Anvil::PhysicalDevi residency_non_resident_strict == in_props.residency_non_resident_strict); } -Anvil::PushConstantRange::PushConstantRange(uint32_t in_offset, - uint32_t in_size, - VkShaderStageFlags in_stages) +Anvil::PushConstantRange::PushConstantRange(uint32_t in_offset, + uint32_t in_size, + Anvil::ShaderStageFlags in_stages) { offset = in_offset; size = in_size; - stages = static_cast(in_stages); + stages = in_stages; } bool Anvil::PushConstantRange::operator==(const PushConstantRange& in) const @@ -2189,7 +2178,7 @@ bool Anvil::PushConstantRange::operator==(const PushConstantRange& in) const Anvil::QueueFamilyInfo::QueueFamilyInfo(const VkQueueFamilyProperties& in_props) { - flags = in_props.queueFlags; + flags = static_cast(in_props.queueFlags); min_image_transfer_granularity = in_props.minImageTransferGranularity; n_queues = in_props.queueCount; n_timestamp_bits = in_props.timestampValidBits; @@ -2224,7 +2213,7 @@ Anvil::SemaphoreProperties::SemaphoreProperties(const ExternalSemaphorePropertie Anvil::ShaderModuleStageEntryPoint::ShaderModuleStageEntryPoint() { shader_module_ptr = nullptr; - stage = SHADER_STAGE_UNKNOWN; + stage = ShaderStage::UNKNOWN; } /** Please see header for specification */ @@ -2283,15 +2272,15 @@ Anvil::SparseImageAspectProperties::SparseImageAspectProperties() sizeof(*this) ); } -Anvil::SparseImageAspectProperties::SparseImageAspectProperties(const VkSparseImageMemoryRequirements& in_req) +Anvil::SparseImageAspectProperties::SparseImageAspectProperties(const Anvil::SparseImageMemoryRequirements& in_req) { - aspect_mask = in_req.formatProperties.aspectMask; - flags = in_req.formatProperties.flags; - granularity = in_req.formatProperties.imageGranularity; - mip_tail_first_lod = in_req.imageMipTailFirstLod; - mip_tail_offset = in_req.imageMipTailOffset; - mip_tail_size = in_req.imageMipTailSize; - mip_tail_stride = in_req.imageMipTailStride; + aspect_mask = in_req.format_properties.aspect_mask; + flags = in_req.format_properties.flags; + granularity = in_req.format_properties.image_granularity; + mip_tail_first_lod = in_req.image_mip_tail_first_lod; + mip_tail_offset = in_req.image_mip_tail_offset; + mip_tail_size = in_req.image_mip_tail_size; + mip_tail_stride = in_req.image_mip_tail_stride; } Anvil::SparseMemoryBindingUpdateInfo::SparseMemoryBindingUpdateInfo() @@ -2643,7 +2632,7 @@ Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_buff Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, uint32_t in_n_semaphores_to_wait_on, Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, + const Anvil::PipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, bool in_should_block, Anvil::Fence* in_opt_fence_ptr) :command_buffers_mgpu_ptr (nullptr), @@ -2652,7 +2641,7 @@ Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_buff d3d12_fence_signal_semaphore_values_ptr(nullptr), d3d12_fence_wait_semaphore_values_ptr (nullptr), #endif - dst_stage_wait_masks_ptr (in_opt_dst_stage_masks_to_wait_on_ptrs), + dst_stage_wait_masks (in_n_semaphores_to_wait_on), fence_ptr (in_opt_fence_ptr), n_command_buffers (in_n_command_buffers), n_signal_semaphores (in_n_semaphores_to_signal), @@ -2665,6 +2654,13 @@ Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_buff wait_semaphores_mgpu_ptr (nullptr), wait_semaphores_sgpu_ptr (in_opt_semaphore_to_wait_on_ptrs_ptr) { + for (uint32_t n_wait_mask = 0; + n_wait_mask < in_n_semaphores_to_wait_on; + ++n_wait_mask) + { + dst_stage_wait_masks.at(n_wait_mask) = in_opt_dst_stage_masks_to_wait_on_ptrs[n_wait_mask].get_vk(); + } + anvil_assert((in_n_command_buffers == 0) || (in_n_command_buffers != 0 && in_opt_cmd_buffer_ptrs_ptr != nullptr) ); @@ -2675,21 +2671,21 @@ Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_buff (in_n_semaphores_to_wait_on != 0 && in_opt_semaphore_to_wait_on_ptrs_ptr != nullptr && in_opt_dst_stage_masks_to_wait_on_ptrs != nullptr) ); } -Anvil::SubmitInfo::SubmitInfo(Anvil::CommandBufferBase* in_cmd_buffer_ptr, - uint32_t in_n_semaphores_to_signal, - Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, - uint32_t in_n_semaphores_to_wait_on, - Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, - bool in_should_block, - Anvil::Fence* in_opt_fence_ptr) +Anvil::SubmitInfo::SubmitInfo(Anvil::CommandBufferBase* in_cmd_buffer_ptr, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, + const Anvil::PipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) :command_buffers_mgpu_ptr (nullptr), command_buffers_sgpu_ptr (nullptr), #if defined(_WIN32) d3d12_fence_signal_semaphore_values_ptr(nullptr), d3d12_fence_wait_semaphore_values_ptr (nullptr), #endif - dst_stage_wait_masks_ptr (in_opt_dst_stage_masks_to_wait_on_ptrs), + dst_stage_wait_masks (in_n_semaphores_to_wait_on), fence_ptr (in_opt_fence_ptr), n_command_buffers ((in_cmd_buffer_ptr != nullptr) ? 1 : 0), n_signal_semaphores (in_n_semaphores_to_signal), @@ -2702,6 +2698,13 @@ Anvil::SubmitInfo::SubmitInfo(Anvil::CommandBufferBase* in_cmd_buffer_ptr, wait_semaphores_mgpu_ptr (nullptr), wait_semaphores_sgpu_ptr (in_opt_semaphore_to_wait_on_ptrs_ptr) { + for (uint32_t n_wait_mask = 0; + n_wait_mask < in_n_semaphores_to_wait_on; + ++n_wait_mask) + { + dst_stage_wait_masks.at(n_wait_mask) = in_opt_dst_stage_masks_to_wait_on_ptrs[n_wait_mask].get_vk(); + } + anvil_assert((in_n_semaphores_to_signal == 0) || (in_n_semaphores_to_signal != 0 && in_opt_semaphore_to_signal_ptrs_ptr != nullptr) ); @@ -2718,7 +2721,7 @@ Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_bu const SemaphoreMGPUSubmission* in_opt_signal_semaphore_submissions_ptr, uint32_t in_n_wait_semaphore_submissions, const SemaphoreMGPUSubmission* in_opt_wait_semaphore_submissions_ptr, - const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptr, + const Anvil::PipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptr, bool in_should_block, Anvil::Fence* in_opt_fence_ptr) :command_buffers_mgpu_ptr (in_opt_command_buffer_submissions_ptr), @@ -2727,7 +2730,7 @@ Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_bu d3d12_fence_signal_semaphore_values_ptr(nullptr), d3d12_fence_wait_semaphore_values_ptr (nullptr), #endif - dst_stage_wait_masks_ptr (in_opt_dst_stage_masks_to_wait_on_ptr), + dst_stage_wait_masks (in_n_wait_semaphore_submissions), fence_ptr (in_opt_fence_ptr), n_command_buffers (in_n_command_buffer_submissions), n_signal_semaphores (in_n_signal_semaphore_submissions), @@ -2740,6 +2743,13 @@ Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_bu wait_semaphores_mgpu_ptr (in_opt_wait_semaphore_submissions_ptr), wait_semaphores_sgpu_ptr (nullptr) { + for (uint32_t n_wait_mask = 0; + n_wait_mask < in_n_wait_semaphore_submissions; + ++n_wait_mask) + { + dst_stage_wait_masks.at(n_wait_mask) = in_opt_dst_stage_masks_to_wait_on_ptr[n_wait_mask].get_vk(); + } + anvil_assert((in_n_command_buffer_submissions == 0) || (in_n_command_buffer_submissions != 0 && in_opt_command_buffer_submissions_ptr != nullptr) ); @@ -2750,14 +2760,14 @@ Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_bu (in_n_wait_semaphore_submissions != 0 && in_opt_wait_semaphore_submissions_ptr != nullptr && in_opt_dst_stage_masks_to_wait_on_ptr != nullptr) ); } -Anvil::SubmitInfo Anvil::SubmitInfo::create(Anvil::CommandBufferBase* in_opt_cmd_buffer_ptr, - uint32_t in_n_semaphores_to_signal, - Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, - uint32_t in_n_semaphores_to_wait_on, - Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, - bool in_should_block, - Anvil::Fence* in_opt_fence_ptr) +Anvil::SubmitInfo Anvil::SubmitInfo::create(Anvil::CommandBufferBase* in_opt_cmd_buffer_ptr, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, + const Anvil::PipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) { return Anvil::SubmitInfo(in_opt_cmd_buffer_ptr, in_n_semaphores_to_signal, @@ -2775,7 +2785,7 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create(uint32_t in_ Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, uint32_t in_n_semaphores_to_wait_on, Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, + const Anvil::PipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, bool in_should_block, Anvil::Fence* in_opt_fence_ptr) { @@ -2919,13 +2929,13 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_signal(uint32_t in_n in_opt_fence_ptr); } -Anvil::SubmitInfo Anvil::SubmitInfo::create_signal_wait(uint32_t in_n_semaphores_to_signal, - Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, - uint32_t in_n_semaphores_to_wait_on, - Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, - bool in_should_block, - Anvil::Fence* in_opt_fence_ptr) +Anvil::SubmitInfo Anvil::SubmitInfo::create_signal_wait(uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, + const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) { anvil_assert(in_n_semaphores_to_signal > 0); anvil_assert(in_semaphore_to_signal_ptrs_ptr != nullptr); @@ -2945,7 +2955,7 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_signal_wait(uint32_t Anvil::SubmitInfo Anvil::SubmitInfo::create_wait(uint32_t in_n_semaphores_to_wait_on, Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, Anvil::Fence* in_opt_fence_ptr) { anvil_assert(in_dst_stage_masks_to_wait_on_ptrs != nullptr); @@ -2963,12 +2973,12 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_wait(uint32_t in_opt_fence_ptr); } -Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute(Anvil::CommandBufferBase* in_cmd_buffer_ptr, - uint32_t in_n_semaphores_to_wait_on, - Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, - bool in_should_block, - Anvil::Fence* in_opt_fence_ptr) +Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute(Anvil::CommandBufferBase* in_cmd_buffer_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, + const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) { anvil_assert(in_cmd_buffer_ptr != nullptr); anvil_assert(in_dst_stage_masks_to_wait_on_ptrs != nullptr); @@ -2988,7 +2998,7 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute(Anvil::CommandBufferBas uint32_t in_n_cmd_buffers, uint32_t in_n_semaphores_to_wait_on, Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, bool in_should_block, Anvil::Fence* in_opt_fence_ptr) { @@ -3011,7 +3021,7 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute(Anvil::CommandBufferBas Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute(const Anvil::CommandBufferMGPUSubmission* in_cmd_buffer_submission_ptr, uint32_t in_n_wait_semaphore_submissions, const Anvil::SemaphoreMGPUSubmission* in_wait_semaphore_submissions_ptr, - const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, bool in_should_block, Anvil::Fence* in_opt_fence_ptr) { @@ -3029,14 +3039,14 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute(const Anvil::CommandBuf in_opt_fence_ptr); } -Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute_signal(Anvil::CommandBufferBase* in_cmd_buffer_ptr, - uint32_t in_n_semaphores_to_signal, - Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, - uint32_t in_n_semaphores_to_wait_on, - Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, - bool in_should_block, - Anvil::Fence* in_opt_fence_ptr) +Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute_signal(Anvil::CommandBufferBase* in_cmd_buffer_ptr, + uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, + const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) { anvil_assert(in_cmd_buffer_ptr != nullptr); anvil_assert(in_semaphore_to_signal_ptrs_ptr != nullptr); @@ -3058,7 +3068,7 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute_signal(Anvil::CommandBu Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, uint32_t in_n_semaphores_to_wait_on, Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, - const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, bool in_should_block, Anvil::Fence* in_opt_fence_ptr) { @@ -3083,7 +3093,7 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute_signal(const Anvil::Com const Anvil::SemaphoreMGPUSubmission* in_signal_semaphore_submissions_ptr, uint32_t in_n_wait_semaphore_submissions, const Anvil::SemaphoreMGPUSubmission* in_wait_semaphore_submissions_ptr, - const VkPipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, bool in_should_block, Anvil::Fence* in_opt_fence_ptr) { diff --git a/src/misc/types_utils.cpp b/src/misc/types_utils.cpp index d24e9759..2220de08 100644 --- a/src/misc/types_utils.cpp +++ b/src/misc/types_utils.cpp @@ -24,39 +24,39 @@ #include "wrappers/device.h" /** Please see header for specification */ -Anvil::MemoryFeatureFlags Anvil::Utils::get_memory_feature_flags_from_vk_property_flags(VkMemoryPropertyFlags in_mem_type_flags, - VkMemoryHeapFlags in_mem_heap_flags) +Anvil::MemoryFeatureFlags Anvil::Utils::get_memory_feature_flags_from_vk_property_flags(Anvil::MemoryPropertyFlags in_mem_type_flags, + Anvil::MemoryHeapFlags in_mem_heap_flags) { - Anvil::MemoryFeatureFlags result = 0; + Anvil::MemoryFeatureFlags result; - if ((in_mem_type_flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0) + if ((in_mem_type_flags & Anvil::MemoryPropertyFlagBits::DEVICE_LOCAL_BIT) != 0) { - result |= MEMORY_FEATURE_FLAG_DEVICE_LOCAL; + result |= Anvil::MemoryFeatureFlagBits::DEVICE_LOCAL_BIT; } - if ((in_mem_type_flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0) + if ((in_mem_type_flags & Anvil::MemoryPropertyFlagBits::HOST_VISIBLE_BIT) != 0) { - result |= MEMORY_FEATURE_FLAG_MAPPABLE; + result |= Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT; } - if ((in_mem_type_flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) != 0) + if ((in_mem_type_flags & Anvil::MemoryPropertyFlagBits::HOST_COHERENT_BIT) != 0) { - result |= MEMORY_FEATURE_FLAG_HOST_COHERENT; + result |= Anvil::MemoryFeatureFlagBits::HOST_COHERENT_BIT; } - if ((in_mem_type_flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) != 0) + if ((in_mem_type_flags & Anvil::MemoryPropertyFlagBits::HOST_CACHED_BIT) != 0) { - result |= MEMORY_FEATURE_FLAG_HOST_CACHED; + result |= Anvil::MemoryFeatureFlagBits::HOST_CACHED_BIT; } - if ((in_mem_type_flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) != 0) + if ((in_mem_type_flags & Anvil::MemoryPropertyFlagBits::LAZILY_ALLOCATED_BIT) != 0) { - result |= MEMORY_FEATURE_FLAG_LAZILY_ALLOCATED; + result |= Anvil::MemoryFeatureFlagBits::LAZILY_ALLOCATED_BIT; } - if ((in_mem_heap_flags & VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR) != 0) + if ((in_mem_heap_flags & Anvil::MemoryHeapFlagBits::MULTI_INSTANCE_BIT_KHR) != 0) { - result |= MEMORY_FEATURE_FLAG_MULTI_INSTANCE; + result |= Anvil::MemoryFeatureFlagBits::MULTI_INSTANCE_BIT; } return result; @@ -64,250 +64,8 @@ Anvil::MemoryFeatureFlags Anvil::Utils::get_memory_feature_flags_from_vk_propert Anvil::MTSafety Anvil::Utils::convert_boolean_to_mt_safety_enum(bool in_mt_safe) { - return (in_mt_safe) ? MT_SAFETY_ENABLED - : MT_SAFETY_DISABLED; -} - -VkBufferCreateFlags Anvil::Utils::convert_buffer_create_flags_to_vk_buffer_create_flags(const Anvil::BufferCreateFlags& in_create_flags) -{ - VkBufferCreateFlags result = 0; - - if (in_create_flags & Anvil::BUFFER_CREATE_FLAG_SPARSE_ALIASED_BIT) - { - result |= VK_BUFFER_CREATE_SPARSE_ALIASED_BIT; - } - - if (in_create_flags & Anvil::BUFFER_CREATE_FLAG_SPARSE_BINDING_BIT) - { - result |= VK_BUFFER_CREATE_SPARSE_BINDING_BIT; - } - - if (in_create_flags & Anvil::BUFFER_CREATE_FLAG_SPARSE_RESIDENCY_BIT) - { - result |= VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT; - } - - return result; -} - -VkExternalFenceHandleTypeFlagsKHR Anvil::Utils::convert_external_fence_handle_type_bits_to_vk_external_fence_handle_type_flags(const Anvil::ExternalFenceHandleTypeBits& in_types) -{ - VkExternalFenceHandleTypeFlagsKHR result = 0; - - #if defined(_WIN32) - { - if (in_types & Anvil::EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT) - { - result |= VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR; - } - - if (in_types & Anvil::EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT) - { - result |= VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR; - } - } - #else - { - if (in_types & Anvil::EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT) - { - result |= VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR; - } - - if (in_types & Anvil::EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT) - { - result |= VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT_KHR; - } - } - #endif - - return result; -} - -VkExternalMemoryHandleTypeFlagsKHR Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(const Anvil::ExternalMemoryHandleTypeBits& in_types) -{ - VkExternalMemoryHandleTypeFlagsKHR result = 0; - - #if defined(_WIN32) - { - if (in_types & Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT) - { - result |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR; - } - - if (in_types & Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT) - { - result |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR; - } - - if (in_types & Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT) - { - result |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR; - } - - if (in_types & Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT) - { - result |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR; - } - - if (in_types & Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT) - { - result |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR; - } - - if (in_types & Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT) - { - result |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR; - } - } - #else - { - if (in_types & Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) - { - result |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR; - } - } - #endif - - return result; -} - -VkExternalSemaphoreHandleTypeFlagsKHR Anvil::Utils::convert_external_semaphore_handle_type_bits_to_vk_external_semaphore_handle_type_flags(const Anvil::ExternalSemaphoreHandleTypeBits& in_types) -{ - VkExternalSemaphoreHandleTypeFlagsKHR result = 0; - - #if defined(_WIN32) - { - if (in_types & Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) - { - result |= VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT_KHR; - } - - if (in_types & Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT) - { - result |= VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR; - } - - if (in_types & Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT) - { - result |= VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR; - } - } - #else - { - if (in_types & Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT) - { - result |= VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR; - } - - if (in_types & Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT) - { - result |= VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR; - } - } - #endif - - return result; -} - -VkIndexType Anvil::Utils::convert_index_type_to_vk_index_type(const IndexType& in_index_type) -{ - VkIndexType result = VK_INDEX_TYPE_MAX_ENUM; - - switch (in_index_type) - { - case Anvil::IndexType::UINT16: result = VK_INDEX_TYPE_UINT16; break; - case Anvil::IndexType::UINT32: result = VK_INDEX_TYPE_UINT32; break; - - default: - { - anvil_assert_fail(); - } - } - - return result; -} - -Anvil::IndexType Anvil::Utils::convert_vk_index_type_to_index_type(const VkIndexType& in_index_type) -{ - Anvil::IndexType result = Anvil::IndexType::UNKNOWN; - - switch (in_index_type) - { - case VK_INDEX_TYPE_UINT16: result = Anvil::IndexType::UINT16; break; - case VK_INDEX_TYPE_UINT32: result = Anvil::IndexType::UINT32; break; - - default: - { - anvil_assert_fail(); - } - } - - return result; -} - -Anvil::ExternalSemaphoreHandleTypeBits Anvil::Utils::convert_vk_external_semaphore_handle_type_flags_to_external_semaphore_handle_type_bits(const VkExternalSemaphoreHandleTypeFlagsKHR& in_types) -{ - Anvil::ExternalSemaphoreHandleTypeBits result = 0; - - #if defined(_WIN32) - { - if (in_types & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT_KHR) - { - result |= Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT; - } - - if (in_types & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR) - { - result |= Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT; - } - - if (in_types & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR) - { - result |= Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT; - } - } - #else - { - if (in_types & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR) - { - result |= Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; - } - - if (in_types & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR) - { - result |= Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT; - } - } - #endif - - return result; -} - -Anvil::PeerMemoryFeatureFlags Anvil::Utils::convert_vk_peer_memory_feature_flags_to_peer_memory_feature_flags(const VkPeerMemoryFeatureFlags& in_value) -{ - Anvil::PeerMemoryFeatureFlags result = 0; - - if (in_value & VK_PEER_MEMORY_FEATURE_COPY_DST_BIT) - { - result |= Anvil::PEER_MEMORY_FEATURE_COPY_DST_BIT; - } - - if (in_value & VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT) - { - result |= Anvil::PEER_MEMORY_FEATURE_COPY_SRC_BIT; - } - - if (in_value & VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT) - { - result |= Anvil::PEER_MEMORY_FEATURE_GENERIC_DST_BIT; - } - - if (in_value & VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT) - { - result |= Anvil::PEER_MEMORY_FEATURE_GENERIC_SRC_BIT; - } - - return result; + return (in_mt_safe) ? Anvil::MTSafety::ENABLED + : Anvil::MTSafety::DISABLED; } bool Anvil::Utils::convert_mt_safety_enum_to_boolean(Anvil::MTSafety in_mt_safety, @@ -317,10 +75,10 @@ bool Anvil::Utils::convert_mt_safety_enum_to_boolean(Anvil::MTSafety in switch (in_mt_safety) { - case MT_SAFETY_DISABLED: result = false; break; - case MT_SAFETY_ENABLED: result = true; break; + case Anvil::MTSafety::DISABLED: result = false; break; + case Anvil::MTSafety::ENABLED: result = true; break; - case MT_SAFETY_INHERIT_FROM_PARENT_DEVICE: + case Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE: { anvil_assert(in_device_ptr != nullptr); @@ -339,7 +97,7 @@ bool Anvil::Utils::convert_mt_safety_enum_to_boolean(Anvil::MTSafety in /** Please see header for specification */ void Anvil::Utils::convert_queue_family_bits_to_family_indices(const Anvil::BaseDevice* in_device_ptr, - Anvil::QueueFamilyBits in_queue_families, + Anvil::QueueFamilyFlags in_queue_families, uint32_t* out_opt_queue_family_indices_ptr, uint32_t* out_opt_n_queue_family_indices_ptr) { @@ -347,13 +105,13 @@ void Anvil::Utils::convert_queue_family_bits_to_family_indices(const Anvil::Base static const struct { - Anvil::QueueFamily queue_family; - Anvil::QueueFamilyType queue_family_type; + Anvil::QueueFamilyFlagBits queue_family; + Anvil::QueueFamilyType queue_family_type; } queue_family_data[] = { - {Anvil::QUEUE_FAMILY_COMPUTE_BIT, Anvil::QueueFamilyType::COMPUTE}, - {Anvil::QUEUE_FAMILY_DMA_BIT, Anvil::QueueFamilyType::TRANSFER}, - {Anvil::QUEUE_FAMILY_GRAPHICS_BIT, Anvil::QueueFamilyType::UNIVERSAL}, + {Anvil::QueueFamilyFlagBits::COMPUTE_BIT, Anvil::QueueFamilyType::COMPUTE}, + {Anvil::QueueFamilyFlagBits::DMA_BIT, Anvil::QueueFamilyType::TRANSFER}, + {Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::QueueFamilyType::UNIVERSAL}, }; for (const auto& current_queue_fam_data : queue_family_data) @@ -390,97 +148,95 @@ void Anvil::Utils::convert_queue_family_bits_to_family_indices(const Anvil::Base } /** Please see header for specification */ -VkAccessFlags Anvil::Utils::get_access_mask_from_image_layout(Anvil::ImageLayout in_layout, - Anvil::QueueFamilyType in_queue_family_type) +Anvil::AccessFlags Anvil::Utils::get_access_mask_from_image_layout(Anvil::ImageLayout in_layout, + Anvil::QueueFamilyType in_queue_family_type) { - VkAccessFlags result = 0; + Anvil::AccessFlags result; switch (in_layout) { case Anvil::ImageLayout::UNDEFINED: { - result = 0; - break; } case Anvil::ImageLayout::GENERAL: { - result = VK_ACCESS_INDIRECT_COMMAND_READ_BIT | - VK_ACCESS_INDEX_READ_BIT | - VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT | - VK_ACCESS_UNIFORM_READ_BIT | - VK_ACCESS_INPUT_ATTACHMENT_READ_BIT | - VK_ACCESS_SHADER_READ_BIT | - VK_ACCESS_SHADER_WRITE_BIT | - VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_TRANSFER_READ_BIT | - VK_ACCESS_TRANSFER_WRITE_BIT | - VK_ACCESS_HOST_READ_BIT | - VK_ACCESS_HOST_WRITE_BIT | - VK_ACCESS_MEMORY_READ_BIT | - VK_ACCESS_MEMORY_WRITE_BIT; + result = Anvil::AccessFlagBits::INDIRECT_COMMAND_READ_BIT | + Anvil::AccessFlagBits::INDEX_READ_BIT | + Anvil::AccessFlagBits::VERTEX_ATTRIBUTE_READ_BIT | + Anvil::AccessFlagBits::UNIFORM_READ_BIT | + Anvil::AccessFlagBits::INPUT_ATTACHMENT_READ_BIT | + Anvil::AccessFlagBits::SHADER_READ_BIT | + Anvil::AccessFlagBits::SHADER_WRITE_BIT | + Anvil::AccessFlagBits::COLOR_ATTACHMENT_READ_BIT | + Anvil::AccessFlagBits::COLOR_ATTACHMENT_WRITE_BIT | + Anvil::AccessFlagBits::DEPTH_STENCIL_ATTACHMENT_READ_BIT | + Anvil::AccessFlagBits::DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | + Anvil::AccessFlagBits::TRANSFER_READ_BIT | + Anvil::AccessFlagBits::TRANSFER_WRITE_BIT | + Anvil::AccessFlagBits::HOST_READ_BIT | + Anvil::AccessFlagBits::HOST_WRITE_BIT | + Anvil::AccessFlagBits::MEMORY_READ_BIT | + Anvil::AccessFlagBits::MEMORY_WRITE_BIT; break; } case Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL: { - result = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; + result = Anvil::AccessFlagBits::COLOR_ATTACHMENT_READ_BIT | + Anvil::AccessFlagBits::COLOR_ATTACHMENT_WRITE_BIT; break; } case Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL: { - result = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; + result = Anvil::AccessFlagBits::DEPTH_STENCIL_ATTACHMENT_READ_BIT | + Anvil::AccessFlagBits::DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; break; } case Anvil::ImageLayout::DEPTH_STENCIL_READ_ONLY_OPTIMAL: { - result = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT; + result = Anvil::AccessFlagBits::DEPTH_STENCIL_ATTACHMENT_READ_BIT; break; } case Anvil::ImageLayout::SHADER_READ_ONLY_OPTIMAL: { - result = VK_ACCESS_SHADER_READ_BIT; + result = Anvil::AccessFlagBits::SHADER_READ_BIT; break; } case Anvil::ImageLayout::TRANSFER_SRC_OPTIMAL: { - result = VK_ACCESS_TRANSFER_READ_BIT; + result = Anvil::AccessFlagBits::TRANSFER_READ_BIT; break; } case Anvil::ImageLayout::TRANSFER_DST_OPTIMAL: { - result = VK_ACCESS_TRANSFER_WRITE_BIT; + result = Anvil::AccessFlagBits::TRANSFER_WRITE_BIT; break; } case Anvil::ImageLayout::PREINITIALIZED: { - result = VK_ACCESS_SHADER_READ_BIT; + result = Anvil::AccessFlagBits::SHADER_READ_BIT; break; } case Anvil::ImageLayout::PRESENT_SRC_KHR: { - result = VK_ACCESS_MEMORY_READ_BIT; + result = Anvil::AccessFlagBits::MEMORY_READ_BIT; break; } @@ -496,44 +252,44 @@ VkAccessFlags Anvil::Utils::get_access_mask_from_image_layout(Anvil::ImageLayout { case Anvil::QueueFamilyType::COMPUTE: { - result &= (VK_ACCESS_INDIRECT_COMMAND_READ_BIT | - VK_ACCESS_MEMORY_READ_BIT | - VK_ACCESS_MEMORY_WRITE_BIT | - VK_ACCESS_SHADER_READ_BIT | - VK_ACCESS_SHADER_WRITE_BIT | - VK_ACCESS_TRANSFER_READ_BIT | - VK_ACCESS_TRANSFER_WRITE_BIT | - VK_ACCESS_UNIFORM_READ_BIT); + result &= (Anvil::AccessFlagBits::INDIRECT_COMMAND_READ_BIT | + Anvil::AccessFlagBits::MEMORY_READ_BIT | + Anvil::AccessFlagBits::MEMORY_WRITE_BIT | + Anvil::AccessFlagBits::SHADER_READ_BIT | + Anvil::AccessFlagBits::SHADER_WRITE_BIT | + Anvil::AccessFlagBits::TRANSFER_READ_BIT | + Anvil::AccessFlagBits::TRANSFER_WRITE_BIT | + Anvil::AccessFlagBits::UNIFORM_READ_BIT); break; } case Anvil::QueueFamilyType::TRANSFER: { - result &= (VK_ACCESS_MEMORY_READ_BIT | - VK_ACCESS_MEMORY_WRITE_BIT | - VK_ACCESS_TRANSFER_READ_BIT | - VK_ACCESS_TRANSFER_WRITE_BIT); + result &= (Anvil::AccessFlagBits::MEMORY_READ_BIT | + Anvil::AccessFlagBits::MEMORY_WRITE_BIT | + Anvil::AccessFlagBits::TRANSFER_READ_BIT | + Anvil::AccessFlagBits::TRANSFER_WRITE_BIT); break; } case Anvil::QueueFamilyType::UNIVERSAL: { - result &= (VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | - VK_ACCESS_INDIRECT_COMMAND_READ_BIT | - VK_ACCESS_INDEX_READ_BIT | - VK_ACCESS_MEMORY_READ_BIT | - VK_ACCESS_MEMORY_WRITE_BIT | - VK_ACCESS_SHADER_READ_BIT | - VK_ACCESS_SHADER_WRITE_BIT | - VK_ACCESS_TRANSFER_READ_BIT | - VK_ACCESS_TRANSFER_WRITE_BIT | - VK_ACCESS_UNIFORM_READ_BIT | - VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT); + result &= (Anvil::AccessFlagBits::COLOR_ATTACHMENT_READ_BIT | + Anvil::AccessFlagBits::COLOR_ATTACHMENT_WRITE_BIT | + Anvil::AccessFlagBits::DEPTH_STENCIL_ATTACHMENT_READ_BIT | + Anvil::AccessFlagBits::DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | + Anvil::AccessFlagBits::INDIRECT_COMMAND_READ_BIT | + Anvil::AccessFlagBits::INDEX_READ_BIT | + Anvil::AccessFlagBits::MEMORY_READ_BIT | + Anvil::AccessFlagBits::MEMORY_WRITE_BIT | + Anvil::AccessFlagBits::SHADER_READ_BIT | + Anvil::AccessFlagBits::SHADER_WRITE_BIT | + Anvil::AccessFlagBits::TRANSFER_READ_BIT | + Anvil::AccessFlagBits::TRANSFER_WRITE_BIT | + Anvil::AccessFlagBits::UNIFORM_READ_BIT | + Anvil::AccessFlagBits::VERTEX_ATTRIBUTE_READ_BIT); break; } @@ -553,15 +309,15 @@ VkAccessFlags Anvil::Utils::get_access_mask_from_image_layout(Anvil::ImageLayout } /* Please see header for specification */ -Anvil::QueueFamilyBits Anvil::Utils::get_queue_family_bits_from_queue_family_type(Anvil::QueueFamilyType in_queue_family_type) +Anvil::QueueFamilyFlags Anvil::Utils::get_queue_family_flags_from_queue_family_type(Anvil::QueueFamilyType in_queue_family_type) { - Anvil::QueueFamilyBits result = 0; + Anvil::QueueFamilyFlags result; switch (in_queue_family_type) { - case Anvil::QueueFamilyType::COMPUTE: result = Anvil::QUEUE_FAMILY_COMPUTE_BIT; break; - case Anvil::QueueFamilyType::TRANSFER: result = Anvil::QUEUE_FAMILY_DMA_BIT; break; - case Anvil::QueueFamilyType::UNIVERSAL: result = Anvil::QUEUE_FAMILY_COMPUTE_BIT | Anvil::QUEUE_FAMILY_GRAPHICS_BIT; break; + case Anvil::QueueFamilyType::COMPUTE: result = Anvil::QueueFamilyFlagBits::COMPUTE_BIT; break; + case Anvil::QueueFamilyType::TRANSFER: result = Anvil::QueueFamilyFlagBits::DMA_BIT; break; + case Anvil::QueueFamilyType::UNIVERSAL: result = Anvil::QueueFamilyFlagBits::COMPUTE_BIT | Anvil::QueueFamilyFlagBits::GRAPHICS_BIT; break; default: { @@ -992,12 +748,12 @@ const char* Anvil::Utils::get_raw_string(Anvil::ShaderStage in_shader_stage) switch (in_shader_stage) { - case SHADER_STAGE_COMPUTE: result = "SHADER_STAGE_COMPUTE"; break; - case SHADER_STAGE_FRAGMENT: result = "SHADER_STAGE_FRAGMENT"; break; - case SHADER_STAGE_GEOMETRY: result = "SHADER_STAGE_GEOMETRY"; break; - case SHADER_STAGE_TESSELLATION_CONTROL: result = "SHADER_STAGE_TESSELLATION_CONTROL"; break; - case SHADER_STAGE_TESSELLATION_EVALUATION: result = "SHADER_STAGE_TESSELLATION_EVALUATION"; break; - case SHADER_STAGE_VERTEX: result = "SHADER_STAGE_VERTEX"; break; + case ShaderStage::COMPUTE: result = "SHADER_STAGE_COMPUTE"; break; + case ShaderStage::FRAGMENT: result = "SHADER_STAGE_FRAGMENT"; break; + case ShaderStage::GEOMETRY: result = "SHADER_STAGE_GEOMETRY"; break; + case ShaderStage::TESSELLATION_CONTROL: result = "SHADER_STAGE_TESSELLATION_CONTROL"; break; + case ShaderStage::TESSELLATION_EVALUATION: result = "SHADER_STAGE_TESSELLATION_EVALUATION"; break; + case ShaderStage::VERTEX: result = "SHADER_STAGE_VERTEX"; break; default: { @@ -1074,18 +830,18 @@ const char* Anvil::Utils::get_raw_string(VkStencilOp in_stencil_op) } /* Please see header for specification */ -VkShaderStageFlagBits Anvil::Utils::get_shader_stage_flag_bits_from_shader_stage(Anvil::ShaderStage in_shader_stage) +Anvil::ShaderStageFlagBits Anvil::Utils::get_shader_stage_flag_bits_from_shader_stage(Anvil::ShaderStage in_shader_stage) { - VkShaderStageFlagBits result = VK_SHADER_STAGE_FLAG_BITS_MAX_ENUM; + Anvil::ShaderStageFlagBits result = static_cast(0); switch (in_shader_stage) { - case Anvil::ShaderStage::SHADER_STAGE_COMPUTE: result = VK_SHADER_STAGE_COMPUTE_BIT; break; - case Anvil::ShaderStage::SHADER_STAGE_FRAGMENT: result = VK_SHADER_STAGE_FRAGMENT_BIT; break; - case Anvil::ShaderStage::SHADER_STAGE_GEOMETRY: result = VK_SHADER_STAGE_GEOMETRY_BIT; break; - case Anvil::ShaderStage::SHADER_STAGE_TESSELLATION_CONTROL: result = VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT; break; - case Anvil::ShaderStage::SHADER_STAGE_TESSELLATION_EVALUATION: result = VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT; break; - case Anvil::ShaderStage::SHADER_STAGE_VERTEX: result = VK_SHADER_STAGE_VERTEX_BIT; break; + case Anvil::ShaderStage::COMPUTE: result = Anvil::ShaderStageFlagBits::COMPUTE_BIT; break; + case Anvil::ShaderStage::FRAGMENT: result = Anvil::ShaderStageFlagBits::FRAGMENT_BIT; break; + case Anvil::ShaderStage::GEOMETRY: result = Anvil::ShaderStageFlagBits::GEOMETRY_BIT; break; + case Anvil::ShaderStage::TESSELLATION_CONTROL: result = Anvil::ShaderStageFlagBits::TESSELLATION_CONTROL_BIT; break; + case Anvil::ShaderStage::TESSELLATION_EVALUATION: result = Anvil::ShaderStageFlagBits::TESSELLATION_EVALUATION_BIT; break; + case Anvil::ShaderStage::VERTEX: result = Anvil::ShaderStageFlagBits::VERTEX_BIT; break; default: { @@ -1096,145 +852,42 @@ VkShaderStageFlagBits Anvil::Utils::get_shader_stage_flag_bits_from_shader_stage return result; } -Anvil::BufferCreateFlags Anvil::Utils::convert_vk_buffer_create_flags_to_buffer_create_flags(const VkBufferCreateFlags& in_create_flags) -{ - Anvil::BufferCreateFlags result = 0; - - if (in_create_flags & VK_BUFFER_CREATE_SPARSE_ALIASED_BIT) - { - result |= Anvil::BUFFER_CREATE_FLAG_SPARSE_ALIASED_BIT; - } - - if (in_create_flags & VK_BUFFER_CREATE_SPARSE_BINDING_BIT) - { - result |= Anvil::BUFFER_CREATE_FLAG_SPARSE_BINDING_BIT; - } - - if (in_create_flags & VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT) - { - result |= Anvil::BUFFER_CREATE_FLAG_SPARSE_RESIDENCY_BIT; - } - - return result; -} - -Anvil::ExternalFenceHandleTypeBits Anvil::Utils::convert_vk_external_fence_handle_type_flags_to_external_fence_handle_type_bits(const VkExternalFenceHandleTypeFlagsKHR& in_types) -{ - Anvil::ExternalFenceHandleTypeBits result = 0; - - #if defined(_WIN32) - { - if (in_types & VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR) - { - result |= Anvil::EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT; - } - - if (in_types & VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR) - { - result |= Anvil::EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT; - } - } - #else - { - if (in_types & VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR) - { - result |= Anvil::EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT; - } - - if (in_types & VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT_KHR) - { - result |= Anvil::EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT; - } - } - #endif - - return result; -} - -Anvil::ExternalMemoryHandleTypeBits Anvil::Utils::convert_vk_external_memory_handle_type_flags_to_external_memory_handle_type_bits(const VkExternalMemoryHandleTypeFlagsKHR& in_types) -{ - Anvil::ExternalMemoryHandleTypeBits result = 0; - - #if defined(_WIN32) - { - if (in_types & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR) - { - result |= Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT; - } - - if (in_types & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR) - { - result |= Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT; - } - - if (in_types & VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR) - { - result |= Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT; - } - - if (in_types & VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR) - { - result |= Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT; - } - - if (in_types & VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR) - { - result |= Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT; - } - - if (in_types & VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR) - { - result |= Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT; - } - } - #else - { - if (in_types & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR) - { - result |= Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; - } - } - #endif - - return result; -} - /* Please see header for specification */ -void Anvil::Utils::get_vk_property_flags_from_memory_feature_flags(Anvil::MemoryFeatureFlags in_mem_feature_flags, - VkMemoryPropertyFlags* out_mem_type_flags_ptr, - VkMemoryHeapFlags* out_mem_heap_flags_ptr) +void Anvil::Utils::get_vk_property_flags_from_memory_feature_flags(Anvil::MemoryFeatureFlags in_mem_feature_flags, + Anvil::MemoryPropertyFlags* out_mem_type_flags_ptr, + Anvil::MemoryHeapFlags* out_mem_heap_flags_ptr) { - VkMemoryHeapFlags result_mem_heap_flags = 0; - VkMemoryPropertyFlags result_mem_type_flags = 0; + Anvil::MemoryHeapFlags result_mem_heap_flags; + Anvil::MemoryPropertyFlags result_mem_type_flags; - if ((in_mem_feature_flags & MEMORY_FEATURE_FLAG_DEVICE_LOCAL) != 0) + if ((in_mem_feature_flags & Anvil::MemoryFeatureFlagBits::DEVICE_LOCAL_BIT) != 0) { - result_mem_type_flags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; + result_mem_type_flags |= Anvil::MemoryPropertyFlagBits::DEVICE_LOCAL_BIT; } - if ((in_mem_feature_flags & MEMORY_FEATURE_FLAG_MAPPABLE) != 0) + if ((in_mem_feature_flags & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) != 0) { - result_mem_type_flags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT; + result_mem_type_flags |= Anvil::MemoryPropertyFlagBits::HOST_VISIBLE_BIT; } - if ((in_mem_feature_flags & MEMORY_FEATURE_FLAG_HOST_COHERENT) != 0) + if ((in_mem_feature_flags & Anvil::MemoryFeatureFlagBits::HOST_COHERENT_BIT) != 0) { - result_mem_type_flags |= VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; + result_mem_type_flags |= Anvil::MemoryPropertyFlagBits::HOST_COHERENT_BIT; } - if ((in_mem_feature_flags & MEMORY_FEATURE_FLAG_HOST_CACHED) != 0) + if ((in_mem_feature_flags & Anvil::MemoryFeatureFlagBits::HOST_CACHED_BIT) != 0) { - result_mem_type_flags |= VK_MEMORY_PROPERTY_HOST_CACHED_BIT; + result_mem_type_flags |= Anvil::MemoryPropertyFlagBits::HOST_CACHED_BIT; } - if ((in_mem_feature_flags & MEMORY_FEATURE_FLAG_LAZILY_ALLOCATED) != 0) + if ((in_mem_feature_flags & Anvil::MemoryFeatureFlagBits::LAZILY_ALLOCATED_BIT) != 0) { - result_mem_type_flags |= VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT; + result_mem_type_flags |= Anvil::MemoryPropertyFlagBits::LAZILY_ALLOCATED_BIT; } - if ((in_mem_feature_flags & MEMORY_FEATURE_FLAG_MULTI_INSTANCE) != 0) + if ((in_mem_feature_flags & Anvil::MemoryFeatureFlagBits::MULTI_INSTANCE_BIT) != 0) { - result_mem_heap_flags |= VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR; + result_mem_heap_flags |= Anvil::MemoryHeapFlagBits::MULTI_INSTANCE_BIT_KHR; } *out_mem_heap_flags_ptr = result_mem_heap_flags; @@ -1242,22 +895,22 @@ void Anvil::Utils::get_vk_property_flags_from_memory_feature_flags(Anvil::Memory } #ifdef _WIN32 - bool Anvil::Utils::is_nt_handle(const Anvil::ExternalFenceHandleTypeBit& in_type) + bool Anvil::Utils::is_nt_handle(const Anvil::ExternalFenceHandleTypeFlagBits& in_type) { - return (in_type == Anvil::EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT); + return (in_type == Anvil::ExternalFenceHandleTypeFlagBits::OPAQUE_WIN32_BIT); } - bool Anvil::Utils::is_nt_handle(const Anvil::ExternalMemoryHandleTypeBit& in_type) + bool Anvil::Utils::is_nt_handle(const Anvil::ExternalMemoryHandleTypeFlagBits& in_type) { - return (in_type == Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT || - in_type == Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT || - in_type == Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT || - in_type == Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT); + return (in_type == Anvil::ExternalMemoryHandleTypeFlagBits::D3D11_TEXTURE_BIT || + in_type == Anvil::ExternalMemoryHandleTypeFlagBits::D3D12_HEAP_BIT || + in_type == Anvil::ExternalMemoryHandleTypeFlagBits::D3D12_RESOURCE_BIT || + in_type == Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_WIN32_BIT); } - bool Anvil::Utils::is_nt_handle(const Anvil::ExternalSemaphoreHandleTypeBit& in_type) + bool Anvil::Utils::is_nt_handle(const Anvil::ExternalSemaphoreHandleTypeFlagBits& in_type) { - return (in_type == Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT || - in_type == Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT); + return (in_type == Anvil::ExternalSemaphoreHandleTypeFlagBits::D3D12_FENCE_BIT || + in_type == Anvil::ExternalSemaphoreHandleTypeFlagBits::OPAQUE_WIN32_BIT); } #endif \ No newline at end of file diff --git a/src/wrappers/buffer.cpp b/src/wrappers/buffer.cpp index f4cd1fe3..796e7b34 100644 --- a/src/wrappers/buffer.cpp +++ b/src/wrappers/buffer.cpp @@ -40,7 +40,7 @@ Anvil::Buffer::Buffer(Anvil::BufferCreateInfoUniquePtr in_create_info_ptr) MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), in_create_info_ptr->get_device () )), m_buffer (VK_NULL_HANDLE), - m_create_flags (0), + m_create_flags (Anvil::BufferCreateFlagBits::NONE), m_memory_block_ptr (nullptr), m_prefers_dedicated_allocation (false), m_requires_dedicated_allocation (false), @@ -56,14 +56,14 @@ Anvil::Buffer::Buffer(Anvil::BufferCreateInfoUniquePtr in_create_info_ptr) case BufferType::NONSPARSE_NO_ALLOC: { - if ((in_create_info_ptr->get_memory_features() & MEMORY_FEATURE_FLAG_MAPPABLE) == 0) + if ((in_create_info_ptr->get_memory_features() & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) == 0) { /* For host->gpu writes to work in this case, we will need the buffer to work as a target * for buffer->buffer copy operations. Same goes for the other way around. */ auto usage_flags = in_create_info_ptr->get_usage_flags(); - usage_flags |= Anvil::BUFFER_USAGE_FLAG_TRANSFER_DST_BIT | Anvil::BUFFER_USAGE_FLAG_TRANSFER_SRC_BIT; + usage_flags |= Anvil::BufferUsageFlagBits::TRANSFER_DST_BIT | Anvil::BufferUsageFlagBits::TRANSFER_SRC_BIT; in_create_info_ptr->set_usage_flags(usage_flags); } @@ -84,23 +84,23 @@ Anvil::Buffer::Buffer(Anvil::BufferCreateInfoUniquePtr in_create_info_ptr) { switch (in_create_info_ptr->get_residency_scope() ) { - case Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED: + case Anvil::SparseResidencyScope::ALIASED: { - m_create_flags = VK_BUFFER_CREATE_SPARSE_ALIASED_BIT | VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT | VK_BUFFER_CREATE_SPARSE_BINDING_BIT; + m_create_flags = Anvil::BufferCreateFlagBits::SPARSE_ALIASED_BIT | Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT | Anvil::BufferCreateFlagBits::SPARSE_BINDING_BIT; break; } - case Anvil::SPARSE_RESIDENCY_SCOPE_NONALIASED: + case Anvil::SparseResidencyScope::NONALIASED: { - m_create_flags = VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT | VK_BUFFER_CREATE_SPARSE_BINDING_BIT; + m_create_flags = Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT | Anvil::BufferCreateFlagBits::SPARSE_BINDING_BIT; break; } - case Anvil::SPARSE_RESIDENCY_SCOPE_NONE: + case Anvil::SparseResidencyScope::NONE: { - m_create_flags = VK_BUFFER_CREATE_SPARSE_BINDING_BIT; + m_create_flags = Anvil::BufferCreateFlagBits::SPARSE_BINDING_BIT; break; } @@ -117,7 +117,7 @@ Anvil::Buffer::Buffer(Anvil::BufferCreateInfoUniquePtr in_create_info_ptr) { auto usage_flags = in_create_info_ptr->get_usage_flags(); - usage_flags |= Anvil::BUFFER_USAGE_FLAG_TRANSFER_DST_BIT | Anvil::BUFFER_USAGE_FLAG_TRANSFER_SRC_BIT; + usage_flags |= Anvil::BufferUsageFlagBits::TRANSFER_DST_BIT | Anvil::BufferUsageFlagBits::TRANSFER_SRC_BIT; in_create_info_ptr->set_usage_flags(usage_flags); } @@ -284,10 +284,10 @@ bool Anvil::Buffer::init() Anvil::StructChainer struct_chainer; bool use_dedicated_allocation(false); - if ( m_create_info_ptr->get_client_data () != nullptr && - (m_create_info_ptr->get_memory_features() & Anvil::MEMORY_FEATURE_FLAG_MAPPABLE) == 0) + if ( m_create_info_ptr->get_client_data () != nullptr && + (m_create_info_ptr->get_memory_features() & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) == 0) { - m_create_info_ptr->set_usage_flags(m_create_info_ptr->get_usage_flags() | Anvil::BUFFER_USAGE_FLAG_TRANSFER_DST_BIT); + m_create_info_ptr->set_usage_flags(m_create_info_ptr->get_usage_flags() | Anvil::BufferUsageFlagBits::TRANSFER_DST_BIT); } if (m_create_info_ptr->get_type() != BufferType::NONSPARSE_NO_ALLOC_CHILD) @@ -305,14 +305,14 @@ bool Anvil::Buffer::init() { VkBufferCreateInfo buffer_create_info; - buffer_create_info.flags = m_create_flags; + buffer_create_info.flags = m_create_flags.get_vk(); buffer_create_info.pNext = nullptr; buffer_create_info.pQueueFamilyIndices = queue_family_indices; buffer_create_info.queueFamilyIndexCount = n_queue_family_indices; buffer_create_info.sharingMode = static_cast(m_create_info_ptr->get_sharing_mode() ); buffer_create_info.size = m_create_info_ptr->get_size(); buffer_create_info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO; - buffer_create_info.usage = m_create_info_ptr->get_usage_flags(); + buffer_create_info.usage = m_create_info_ptr->get_usage_flags().get_vk(); struct_chainer.append_struct(buffer_create_info); } @@ -324,7 +324,7 @@ bool Anvil::Buffer::init() { VkExternalMemoryBufferCreateInfoKHR external_memory_buffer_create_info; - external_memory_buffer_create_info.handleTypes = Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(external_memory_handle_types); + external_memory_buffer_create_info.handleTypes = external_memory_handle_types.get_vk(); external_memory_buffer_create_info.pNext = nullptr; external_memory_buffer_create_info.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR; @@ -538,7 +538,7 @@ bool Anvil::Buffer::init_staging_buffer(const VkDeviceSize& in_size, Anvil::PrimaryCommandBufferUniquePtr copy_cmdbuf_ptr; std::vector helper_vec; const auto queue_fams = m_create_info_ptr->get_queue_families(); - Anvil::QueueFamilyBits staging_buffer_queue_fam_bits = 0; + Anvil::QueueFamilyFlagBits staging_buffer_queue_fam_bits = Anvil::QueueFamilyFlagBits::NONE; m_staging_buffer_ptr.reset(); m_staging_buffer_queue_ptr = nullptr; @@ -549,13 +549,13 @@ bool Anvil::Buffer::init_staging_buffer(const VkDeviceSize& in_size, * * This can be worked around if the buffer can only be used with a specific queue family type. */ - if (Anvil::Utils::is_pow2(queue_fams) ) + if (Anvil::Utils::is_pow2(queue_fams.get_vk() ) ) { - switch (queue_fams) + switch (queue_fams.get_vk() ) { - case Anvil::QUEUE_FAMILY_COMPUTE_BIT: m_staging_buffer_queue_ptr = m_device_ptr->get_compute_queue (0); break; - case Anvil::QUEUE_FAMILY_DMA_BIT: m_staging_buffer_queue_ptr = m_device_ptr->get_transfer_queue (0); break; - case Anvil::QUEUE_FAMILY_GRAPHICS_BIT: m_staging_buffer_queue_ptr = m_device_ptr->get_universal_queue(0); break; + case static_cast(Anvil::QueueFamilyFlagBits::COMPUTE_BIT): m_staging_buffer_queue_ptr = m_device_ptr->get_compute_queue (0); break; + case static_cast(Anvil::QueueFamilyFlagBits::DMA_BIT): m_staging_buffer_queue_ptr = m_device_ptr->get_transfer_queue (0); break; + case static_cast(Anvil::QueueFamilyFlagBits::GRAPHICS_BIT): m_staging_buffer_queue_ptr = m_device_ptr->get_universal_queue(0); break; default: { @@ -574,9 +574,9 @@ bool Anvil::Buffer::init_staging_buffer(const VkDeviceSize& in_size, switch (m_device_ptr->get_queue_family_type(m_staging_buffer_queue_ptr->get_queue_family_index() ) ) { - case Anvil::QueueFamilyType::COMPUTE: staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_COMPUTE_BIT; break; - case Anvil::QueueFamilyType::TRANSFER: staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_DMA_BIT; break; - case Anvil::QueueFamilyType::UNIVERSAL: staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_GRAPHICS_BIT; break; + case Anvil::QueueFamilyType::COMPUTE: staging_buffer_queue_fam_bits = Anvil::QueueFamilyFlagBits::COMPUTE_BIT; break; + case Anvil::QueueFamilyType::TRANSFER: staging_buffer_queue_fam_bits = Anvil::QueueFamilyFlagBits::DMA_BIT; break; + case Anvil::QueueFamilyType::UNIVERSAL: staging_buffer_queue_fam_bits = Anvil::QueueFamilyFlagBits::GRAPHICS_BIT; break; default: { @@ -587,23 +587,23 @@ bool Anvil::Buffer::init_staging_buffer(const VkDeviceSize& in_size, else { /* We can use any queue from the list of queue fams this buffer is compatible with, in order to perform the copy op. */ - if ((queue_fams & Anvil::QUEUE_FAMILY_GRAPHICS_BIT) != 0) + if ((queue_fams & Anvil::QueueFamilyFlagBits::GRAPHICS_BIT) != 0) { m_staging_buffer_queue_ptr = m_device_ptr->get_universal_queue(0); - staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_GRAPHICS_BIT; + staging_buffer_queue_fam_bits = Anvil::QueueFamilyFlagBits::GRAPHICS_BIT; } else - if ((queue_fams & Anvil::QUEUE_FAMILY_DMA_BIT) != 0) + if ((queue_fams & Anvil::QueueFamilyFlagBits::DMA_BIT) != 0) { m_staging_buffer_queue_ptr = m_device_ptr->get_transfer_queue(0); - staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_DMA_BIT; + staging_buffer_queue_fam_bits = Anvil::QueueFamilyFlagBits::DMA_BIT; } else { - anvil_assert((queue_fams & Anvil::QUEUE_FAMILY_COMPUTE_BIT) != 0) + anvil_assert((queue_fams & Anvil::QueueFamilyFlagBits::COMPUTE_BIT) != 0) m_staging_buffer_queue_ptr = m_device_ptr->get_compute_queue(0); - staging_buffer_queue_fam_bits = Anvil::QUEUE_FAMILY_COMPUTE_BIT; + staging_buffer_queue_fam_bits = Anvil::QueueFamilyFlagBits::COMPUTE_BIT; } } @@ -611,17 +611,17 @@ bool Anvil::Buffer::init_staging_buffer(const VkDeviceSize& in_size, m_staging_buffer_ptr->get_create_info_ptr()->get_size() < in_size) { { - const auto sharing_mode = Anvil::Utils::is_pow2(staging_buffer_queue_fam_bits) ? Anvil::SharingMode::EXCLUSIVE - : Anvil::SharingMode::CONCURRENT; + const auto sharing_mode = Anvil::Utils::is_pow2(static_cast(staging_buffer_queue_fam_bits) ) ? Anvil::SharingMode::EXCLUSIVE + : Anvil::SharingMode::CONCURRENT; auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr, in_size, staging_buffer_queue_fam_bits, sharing_mode, - Anvil::BUFFER_USAGE_FLAG_TRANSFER_SRC_BIT, - Anvil::MEMORY_FEATURE_FLAG_MAPPABLE); + Anvil::BufferUsageFlagBits::TRANSFER_SRC_BIT, + Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT); - create_info_ptr->set_mt_safety (MT_SAFETY_DISABLED); + create_info_ptr->set_mt_safety (Anvil::MTSafety::DISABLED); m_staging_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -659,7 +659,7 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, /* TODO: Support for sparse buffers */ anvil_assert(m_create_info_ptr->get_type() != Anvil::BufferType::SPARSE_NO_ALLOC); - if ((memory_block_ptr->get_create_info_ptr()->get_memory_features() & MEMORY_FEATURE_FLAG_MAPPABLE) != 0) + if ((memory_block_ptr->get_create_info_ptr()->get_memory_features() & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) != 0) { result = memory_block_ptr->read(in_start_offset, in_size, @@ -699,14 +699,14 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, goto end; } - if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) + if (device_type == Anvil::DeviceType::SINGLE_GPU) { copy_cmdbuf_ptr->start_recording(true, /* one_time_submit */ false); /* simultaneous_use_allowed */ } else { - anvil_assert(device_type == Anvil::DEVICE_TYPE_MULTI_GPU); + anvil_assert(device_type == Anvil::DeviceType::MULTI_GPU); anvil_assert(Utils::count_set_bits(in_device_mask) == 1); copy_cmdbuf_ptr->start_recording(true, /* one_time_submit */ @@ -714,26 +714,26 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, in_device_mask); /* in_opt_device_mask */ } { - Anvil::BufferBarrier buffer_barrier(VK_ACCESS_TRANSFER_WRITE_BIT, - VK_ACCESS_HOST_READ_BIT, + Anvil::BufferBarrier buffer_barrier(Anvil::AccessFlagBits::TRANSFER_WRITE_BIT, + Anvil::AccessFlagBits::HOST_READ_BIT, VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_IGNORED, m_staging_buffer_ptr.get(), 0, /* in_offset */ in_size); - VkBufferCopy copy_region; + Anvil::BufferCopy copy_region; - copy_region.dstOffset = 0; - copy_region.size = in_size; - copy_region.srcOffset = in_start_offset; + copy_region.dst_offset = 0; + copy_region.size = in_size; + copy_region.src_offset = in_start_offset; copy_cmdbuf_ptr->record_copy_buffer (this, m_staging_buffer_ptr.get(), 1, /* in_region_count */ ©_region); - copy_cmdbuf_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_TRANSFER_BIT, - VK_PIPELINE_STAGE_HOST_BIT, - VK_FALSE, /* in_by_region */ + copy_cmdbuf_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::TRANSFER_BIT, + Anvil::PipelineStageFlagBits::HOST_BIT, + Anvil::DependencyFlagBits::NONE, 0, /* in_memory_barrier_count */ nullptr, /* in_memory_barriers_ptr */ 1, /* in_buffer_memory_barrier_count */ @@ -743,7 +743,7 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, } copy_cmdbuf_ptr->stop_recording(); - if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) + if (device_type == Anvil::DeviceType::SINGLE_GPU) { m_staging_buffer_queue_ptr->submit( Anvil::SubmitInfo::create_execute(copy_cmdbuf_ptr.get(), @@ -804,7 +804,7 @@ bool Anvil::Buffer::set_memory_nonsparse_internal(MemoryBlockUniquePtr in_memor } /* Bind the memory object to the buffer object */ - if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) + if (device_type == Anvil::DeviceType::SINGLE_GPU) { lock(); { @@ -823,7 +823,7 @@ bool Anvil::Buffer::set_memory_nonsparse_internal(MemoryBlockUniquePtr in_memor const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr) ); const auto& entrypoints (mgpu_device_ptr->get_extension_khr_bind_memory2_entrypoints() ); - anvil_assert(device_type == Anvil::DEVICE_TYPE_MULTI_GPU); + anvil_assert(device_type == Anvil::DeviceType::MULTI_GPU); { VkBindBufferMemoryInfoKHR bind_info; @@ -1149,9 +1149,9 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, anvil_assert(memory_block_ptr != nullptr); anvil_assert(memory_block_ptr->get_create_info_ptr()->get_size() >= in_size); - if ((memory_block_ptr->get_create_info_ptr()->get_memory_features() & MEMORY_FEATURE_FLAG_MAPPABLE) != 0) + if ((memory_block_ptr->get_create_info_ptr()->get_memory_features() & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) != 0) { - anvil_assert((memory_block_ptr->get_create_info_ptr()->get_memory_features() & MEMORY_FEATURE_FLAG_MULTI_INSTANCE) == 0); + anvil_assert((memory_block_ptr->get_create_info_ptr()->get_memory_features() & Anvil::MemoryFeatureFlagBits::MULTI_INSTANCE_BIT) == 0); result = memory_block_ptr->write(in_start_offset, in_size, @@ -1190,37 +1190,36 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, goto end; } - if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) + if (device_type == Anvil::DeviceType::SINGLE_GPU) { copy_cmdbuf_ptr->start_recording(true, /* one_time_submit */ false); /* simultaneous_use_allowed */ } else { - anvil_assert(device_type == Anvil::DEVICE_TYPE_MULTI_GPU); - anvil_assert(Utils::count_set_bits(in_device_mask) == 1); + anvil_assert(device_type == Anvil::DeviceType::MULTI_GPU); copy_cmdbuf_ptr->start_recording(true, /* one_time_submit */ false, /* simultaneous_use_allowed */ in_device_mask); } { - BufferBarrier buffer_barrier(VK_ACCESS_HOST_WRITE_BIT, - VK_ACCESS_TRANSFER_READ_BIT, - VK_QUEUE_FAMILY_IGNORED, - VK_QUEUE_FAMILY_IGNORED, - m_staging_buffer_ptr.get(), - 0, /* in_offset */ - in_size); - VkBufferCopy copy_region; - - copy_region.dstOffset = in_start_offset; - copy_region.size = in_size; - copy_region.srcOffset = 0; - - copy_cmdbuf_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_HOST_BIT, - VK_PIPELINE_STAGE_TRANSFER_BIT, - VK_FALSE, /* in_by_region */ + BufferBarrier buffer_barrier(Anvil::AccessFlagBits::HOST_WRITE_BIT, + Anvil::AccessFlagBits::TRANSFER_READ_BIT, + VK_QUEUE_FAMILY_IGNORED, + VK_QUEUE_FAMILY_IGNORED, + m_staging_buffer_ptr.get(), + 0, /* in_offset */ + in_size); + Anvil::BufferCopy copy_region; + + copy_region.dst_offset = in_start_offset; + copy_region.size = in_size; + copy_region.src_offset = 0; + + copy_cmdbuf_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::HOST_BIT, + Anvil::PipelineStageFlagBits::TRANSFER_BIT, + Anvil::DependencyFlagBits::NONE, 0, /* in_memory_barrier_count */ nullptr, /* in_memory_barriers_ptr */ 1, /* in_buffer_memory_barrier_count */ @@ -1234,7 +1233,7 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, } copy_cmdbuf_ptr->stop_recording(); - if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) + if (device_type == Anvil::DeviceType::SINGLE_GPU) { m_staging_buffer_queue_ptr->submit( Anvil::SubmitInfo::create_execute(copy_cmdbuf_ptr.get(), @@ -1249,7 +1248,7 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, copy_cmdbuf_submission.device_mask = in_device_mask; /* Need to update all memory instances */ - if ((m_memory_block_ptr->get_create_info_ptr()->get_memory_features() & Anvil::MEMORY_FEATURE_FLAG_MULTI_INSTANCE) != 0) + if ((m_memory_block_ptr->get_create_info_ptr()->get_memory_features() & Anvil::MemoryFeatureFlagBits::MULTI_INSTANCE_BIT) != 0) { auto device_mask = m_memory_block_ptr->get_create_info_ptr()->get_device_mask(); const Anvil::MGPUDevice* mgpu_device_ptr = dynamic_cast(m_device_ptr); @@ -1273,4 +1272,4 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, end: return result; -} \ No newline at end of file +} diff --git a/src/wrappers/command_buffer.cpp b/src/wrappers/command_buffer.cpp index f65d9654..8be64766 100644 --- a/src/wrappers/command_buffer.cpp +++ b/src/wrappers/command_buffer.cpp @@ -51,9 +51,9 @@ bool Anvil::CommandBufferBase::m_command_stashing_disabled = false; /** Please see header for specification */ -Anvil::CommandBufferBase::BeginQueryCommand::BeginQueryCommand(Anvil::QueryPool* in_query_pool_ptr, - Anvil::QueryIndex in_entry, - VkQueryControlFlags in_flags) +Anvil::CommandBufferBase::BeginQueryCommand::BeginQueryCommand(Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_entry, + Anvil::QueryControlFlags in_flags) :Command(COMMAND_TYPE_BEGIN_QUERY) { entry = in_entry; @@ -69,7 +69,7 @@ Anvil::BeginRenderPassCommand::BeginRenderPassCommand(uint32_t const Anvil::PhysicalDevice* const* in_physical_devices, const VkRect2D* in_render_areas, Anvil::RenderPass* in_render_pass_ptr, - VkSubpassContents in_contents) + Anvil::SubpassContents in_contents) :Command(COMMAND_TYPE_BEGIN_RENDER_PASS) { contents = in_contents; @@ -93,7 +93,7 @@ Anvil::BeginRenderPassCommand::BeginRenderPassCommand(uint32_t } /** Please see header for specification */ -Anvil::CommandBufferBase::BindDescriptorSetsCommand::BindDescriptorSetsCommand(VkPipelineBindPoint in_pipeline_bind_point, +Anvil::CommandBufferBase::BindDescriptorSetsCommand::BindDescriptorSetsCommand(Anvil::PipelineBindPoint in_pipeline_bind_point, Anvil::PipelineLayout* in_layout_ptr, uint32_t in_first_set, uint32_t in_set_count, @@ -122,9 +122,9 @@ Anvil::CommandBufferBase::BindDescriptorSetsCommand::BindDescriptorSetsCommand(V } /** Please see header for specification */ -Anvil::CommandBufferBase::BindIndexBufferCommand::BindIndexBufferCommand(Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_offset, - VkIndexType in_index_type) +Anvil::CommandBufferBase::BindIndexBufferCommand::BindIndexBufferCommand(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + Anvil::IndexType in_index_type) :Command(COMMAND_TYPE_BIND_INDEX_BUFFER) { buffer = in_buffer_ptr->get_buffer(); @@ -134,8 +134,8 @@ Anvil::CommandBufferBase::BindIndexBufferCommand::BindIndexBufferCommand(Anvil:: } /** Please see header for specification */ -Anvil::CommandBufferBase::BindPipelineCommand::BindPipelineCommand(VkPipelineBindPoint in_pipeline_bind_point, - Anvil::PipelineID in_pipeline_id) +Anvil::CommandBufferBase::BindPipelineCommand::BindPipelineCommand(Anvil::PipelineBindPoint in_pipeline_bind_point, + Anvil::PipelineID in_pipeline_id) :Command(COMMAND_TYPE_BIND_PIPELINE) { pipeline_bind_point = in_pipeline_bind_point; @@ -178,13 +178,13 @@ Anvil::CommandBufferBase::BindVertexBuffersCommandBinding::BindVertexBuffersComm } /** Please see header for specification */ -Anvil::CommandBufferBase::BlitImageCommand::BlitImageCommand(Anvil::Image* in_src_image_ptr, - Anvil::ImageLayout in_src_image_layout, - Anvil::Image* in_dst_image_ptr, - Anvil::ImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageBlit* in_region_ptrs, - VkFilter in_filter) +Anvil::CommandBufferBase::BlitImageCommand::BlitImageCommand(Anvil::Image* in_src_image_ptr, + Anvil::ImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + Anvil::ImageLayout in_dst_image_layout, + uint32_t in_region_count, + const Anvil::ImageBlit* in_region_ptrs, + Anvil::Filter in_filter) :Command(COMMAND_TYPE_BLIT_IMAGE) { dst_image = in_dst_image_ptr->get_image(); @@ -204,19 +204,19 @@ Anvil::CommandBufferBase::BlitImageCommand::BlitImageCommand(Anvil::Image* } /** Please see header for specification */ -Anvil::CommandBufferBase::ClearAttachmentsCommand::ClearAttachmentsCommand(uint32_t in_n_attachments, - const VkClearAttachment* in_attachments, - uint32_t in_n_rects, - const VkClearRect* in_rect_ptrs) +Anvil::CommandBufferBase::ClearAttachmentsCommand::ClearAttachmentsCommand(uint32_t in_n_attachments, + const Anvil::ClearAttachment* in_attachments, + uint32_t in_n_rects, + const VkClearRect* in_rect_ptrs) :Command(COMMAND_TYPE_CLEAR_ATTACHMENTS) { for (uint32_t n_attachment = 0; n_attachment < in_n_attachments; ++n_attachment) { - attachments.push_back(ClearAttachmentsCommandAttachment(in_attachments[n_attachment].aspectMask, - in_attachments[n_attachment].clearValue, - in_attachments[n_attachment].colorAttachment) ); + attachments.push_back(ClearAttachmentsCommandAttachment(in_attachments[n_attachment].aspect_mask, + in_attachments[n_attachment].clear_value, + in_attachments[n_attachment].color_attachment) ); } for (uint32_t n_rect = 0; @@ -228,11 +228,11 @@ Anvil::CommandBufferBase::ClearAttachmentsCommand::ClearAttachmentsCommand(uint3 } /** Please see header for specification */ -Anvil::CommandBufferBase::ClearColorImageCommand::ClearColorImageCommand(Anvil::Image* in_image_ptr, - Anvil::ImageLayout in_image_layout, - const VkClearColorValue* in_color_ptr, - uint32_t in_range_count, - const VkImageSubresourceRange* in_range_ptrs) +Anvil::CommandBufferBase::ClearColorImageCommand::ClearColorImageCommand(Anvil::Image* in_image_ptr, + Anvil::ImageLayout in_image_layout, + const VkClearColorValue* in_color_ptr, + uint32_t in_range_count, + const Anvil::ImageSubresourceRange* in_range_ptrs) :Command(COMMAND_TYPE_CLEAR_COLOR_IMAGE) { color = *in_color_ptr; @@ -249,11 +249,11 @@ Anvil::CommandBufferBase::ClearColorImageCommand::ClearColorImageCommand(Anvil:: } /** Please see header for specification */ -Anvil::CommandBufferBase::ClearDepthStencilImageCommand::ClearDepthStencilImageCommand(Anvil::Image* in_image_ptr, - Anvil::ImageLayout in_image_layout, - const VkClearDepthStencilValue* in_depth_stencil_ptr, - uint32_t in_range_count, - const VkImageSubresourceRange* in_range_ptrs) +Anvil::CommandBufferBase::ClearDepthStencilImageCommand::ClearDepthStencilImageCommand(Anvil::Image* in_image_ptr, + Anvil::ImageLayout in_image_layout, + const VkClearDepthStencilValue* in_depth_stencil_ptr, + uint32_t in_range_count, + const Anvil::ImageSubresourceRange* in_range_ptrs) :Command(COMMAND_TYPE_CLEAR_DEPTH_STENCIL_IMAGE) { depth_stencil = *in_depth_stencil_ptr; @@ -270,10 +270,10 @@ Anvil::CommandBufferBase::ClearDepthStencilImageCommand::ClearDepthStencilImageC } /** Please see header for specification */ -Anvil::CommandBufferBase::CopyBufferCommand::CopyBufferCommand(Anvil::Buffer* in_src_buffer_ptr, - Anvil::Buffer* in_dst_buffer_ptr, - uint32_t in_region_count, - const VkBufferCopy* in_region_ptrs) +Anvil::CommandBufferBase::CopyBufferCommand::CopyBufferCommand(Anvil::Buffer* in_src_buffer_ptr, + Anvil::Buffer* in_dst_buffer_ptr, + uint32_t in_region_count, + const Anvil::BufferCopy* in_region_ptrs) :Command(COMMAND_TYPE_COPY_BUFFER) { dst_buffer = in_dst_buffer_ptr->get_buffer(); @@ -290,11 +290,11 @@ Anvil::CommandBufferBase::CopyBufferCommand::CopyBufferCommand(Anvil::Buffer* } /** Please see header for specification */ -Anvil::CommandBufferBase::CopyBufferToImageCommand::CopyBufferToImageCommand(Anvil::Buffer* in_src_buffer_ptr, - Anvil::Image* in_dst_image_ptr, - Anvil::ImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkBufferImageCopy* in_region_ptrs) +Anvil::CommandBufferBase::CopyBufferToImageCommand::CopyBufferToImageCommand(Anvil::Buffer* in_src_buffer_ptr, + Anvil::Image* in_dst_image_ptr, + Anvil::ImageLayout in_dst_image_layout, + uint32_t in_region_count, + const Anvil::BufferImageCopy* in_region_ptrs) :Command(COMMAND_TYPE_COPY_BUFFER_TO_IMAGE) { dst_image = in_dst_image_ptr->get_image(); @@ -312,12 +312,12 @@ Anvil::CommandBufferBase::CopyBufferToImageCommand::CopyBufferToImageCommand(Anv } /** Please see header for specification */ -Anvil::CommandBufferBase::CopyImageCommand::CopyImageCommand(Anvil::Image* in_src_image_ptr, - Anvil::ImageLayout in_src_image_layout, - Anvil::Image* in_dst_image_ptr, - Anvil::ImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageCopy* in_region_ptrs) +Anvil::CommandBufferBase::CopyImageCommand::CopyImageCommand(Anvil::Image* in_src_image_ptr, + Anvil::ImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + Anvil::ImageLayout in_dst_image_layout, + uint32_t in_region_count, + const Anvil::ImageCopy* in_region_ptrs) :Command(COMMAND_TYPE_COPY_IMAGE) { dst_image = in_dst_image_ptr->get_image(); @@ -336,11 +336,11 @@ Anvil::CommandBufferBase::CopyImageCommand::CopyImageCommand(Anvil::Image* } /** Please see header for specification */ -Anvil::CommandBufferBase::CopyImageToBufferCommand::CopyImageToBufferCommand(Anvil::Image* in_src_image_ptr, - Anvil::ImageLayout in_src_image_layout, - Anvil::Buffer* in_dst_buffer_ptr, - uint32_t in_region_count, - const VkBufferImageCopy* in_region_ptrs) +Anvil::CommandBufferBase::CopyImageToBufferCommand::CopyImageToBufferCommand(Anvil::Image* in_src_image_ptr, + Anvil::ImageLayout in_src_image_layout, + Anvil::Buffer* in_dst_buffer_ptr, + uint32_t in_region_count, + const Anvil::BufferImageCopy* in_region_ptrs) :Command(COMMAND_TYPE_COPY_IMAGE_TO_BUFFER) { dst_buffer = in_dst_buffer_ptr->get_buffer(); @@ -640,16 +640,16 @@ Anvil::CommandBufferBase::FillBufferCommand::FillBufferCommand(Anvil::Buffer* in } /** Please see header for specification */ -Anvil::CommandBufferBase::NextSubpassCommand::NextSubpassCommand(VkSubpassContents in_contents) +Anvil::CommandBufferBase::NextSubpassCommand::NextSubpassCommand(Anvil::SubpassContents in_contents) :Command(COMMAND_TYPE_NEXT_SUBPASS) { contents = in_contents; } /** Please see header for specification */ -Anvil::PipelineBarrierCommand::PipelineBarrierCommand(VkPipelineStageFlags in_src_stage_mask, - VkPipelineStageFlags in_dst_stage_mask, - VkDependencyFlags in_flags, +Anvil::PipelineBarrierCommand::PipelineBarrierCommand(Anvil::PipelineStageFlags in_src_stage_mask, + Anvil::PipelineStageFlags in_dst_stage_mask, + Anvil::DependencyFlags in_flags, uint32_t in_memory_barrier_count, const MemoryBarrier* const in_memory_barrier_ptr_ptr, uint32_t in_buffer_memory_barrier_count, @@ -658,9 +658,9 @@ Anvil::PipelineBarrierCommand::PipelineBarrierCommand(VkPipelineStageFlags const ImageBarrier* const in_image_memory_barrier_ptr_ptr) :Command(COMMAND_TYPE_PIPELINE_BARRIER) { - dst_stage_mask = static_cast(in_dst_stage_mask); + dst_stage_mask = in_dst_stage_mask; flags = in_flags; - src_stage_mask = static_cast(in_src_stage_mask); + src_stage_mask = in_src_stage_mask; for (uint32_t n_buffer_memory_barrier = 0; n_buffer_memory_barrier < in_buffer_memory_barrier_count; @@ -685,11 +685,11 @@ Anvil::PipelineBarrierCommand::PipelineBarrierCommand(VkPipelineStageFlags } /** Please see header for specification */ -Anvil::CommandBufferBase::PushConstantsCommand::PushConstantsCommand(Anvil::PipelineLayout* in_layout_ptr, - VkShaderStageFlags in_stage_flags, - uint32_t in_offset, - uint32_t in_size, - const void* in_values) +Anvil::CommandBufferBase::PushConstantsCommand::PushConstantsCommand(Anvil::PipelineLayout* in_layout_ptr, + Anvil::ShaderStageFlags in_stage_flags, + uint32_t in_offset, + uint32_t in_size, + const void* in_values) :Command(COMMAND_TYPE_PUSH_CONSTANTS) { layout_ptr = in_layout_ptr; @@ -700,8 +700,8 @@ Anvil::CommandBufferBase::PushConstantsCommand::PushConstantsCommand(Anvil::Pipe } /** Please see header for specification */ -Anvil::CommandBufferBase::ResetEventCommand::ResetEventCommand(Anvil::Event* in_event_ptr, - VkPipelineStageFlags in_stage_mask) +Anvil::CommandBufferBase::ResetEventCommand::ResetEventCommand(Anvil::Event* in_event_ptr, + Anvil::PipelineStageFlags in_stage_mask) :Command(COMMAND_TYPE_RESET_EVENT) { event = in_event_ptr->get_event(); @@ -721,12 +721,12 @@ Anvil::CommandBufferBase::ResetQueryPoolCommand::ResetQueryPoolCommand(Anvil::Qu } /** Please see header for specification */ -Anvil::CommandBufferBase::ResolveImageCommand::ResolveImageCommand(Anvil::Image* in_src_image_ptr, - Anvil::ImageLayout in_src_image_layout, - Anvil::Image* in_dst_image_ptr, - Anvil::ImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageResolve* in_region_ptrs) +Anvil::CommandBufferBase::ResolveImageCommand::ResolveImageCommand(Anvil::Image* in_src_image_ptr, + Anvil::ImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + Anvil::ImageLayout in_dst_image_layout, + uint32_t in_region_count, + const Anvil::ImageResolve* in_region_ptrs) :Command(COMMAND_TYPE_RESOLVE_IMAGE) { dst_image = in_dst_image_ptr->get_image(); @@ -781,8 +781,8 @@ Anvil::CommandBufferBase::SetDeviceMaskKHRCommand::SetDeviceMaskKHRCommand(uint3 } /** Please see header for specification */ -Anvil::CommandBufferBase::SetEventCommand::SetEventCommand(Anvil::Event* in_event_ptr, - VkPipelineStageFlags in_stage_mask) +Anvil::CommandBufferBase::SetEventCommand::SetEventCommand(Anvil::Event* in_event_ptr, + Anvil::PipelineStageFlags in_stage_mask) :Command(COMMAND_TYPE_SET_EVENT) { event = in_event_ptr->get_event(); @@ -814,8 +814,8 @@ Anvil::CommandBufferBase::SetScissorCommand::SetScissorCommand(uint32_t i } /** Please see header for specification */ -Anvil::CommandBufferBase::SetStencilCompareMaskCommand::SetStencilCompareMaskCommand(VkStencilFaceFlags in_face_mask, - uint32_t in_stencil_compare_mask) +Anvil::CommandBufferBase::SetStencilCompareMaskCommand::SetStencilCompareMaskCommand(Anvil::StencilFaceFlags in_face_mask, + uint32_t in_stencil_compare_mask) :Command(COMMAND_TYPE_SET_STENCIL_COMPARE_MASK) { face_mask = in_face_mask; @@ -823,8 +823,8 @@ Anvil::CommandBufferBase::SetStencilCompareMaskCommand::SetStencilCompareMaskCom } /** Please see header for specification */ -Anvil::CommandBufferBase::SetStencilReferenceCommand::SetStencilReferenceCommand(VkStencilFaceFlags in_face_mask, - uint32_t in_stencil_reference) +Anvil::CommandBufferBase::SetStencilReferenceCommand::SetStencilReferenceCommand(Anvil::StencilFaceFlags in_face_mask, + uint32_t in_stencil_reference) :Command(COMMAND_TYPE_SET_STENCIL_REFERENCE) { face_mask = in_face_mask; @@ -832,8 +832,8 @@ Anvil::CommandBufferBase::SetStencilReferenceCommand::SetStencilReferenceCommand } /** Please see header for specification */ -Anvil::CommandBufferBase::SetStencilWriteMaskCommand::SetStencilWriteMaskCommand(VkStencilFaceFlags in_face_mask, - uint32_t in_stencil_write_mask) +Anvil::CommandBufferBase::SetStencilWriteMaskCommand::SetStencilWriteMaskCommand(Anvil::StencilFaceFlags in_face_mask, + uint32_t in_stencil_write_mask) :Command(COMMAND_TYPE_SET_STENCIL_WRITE_MASK) { face_mask = in_face_mask; @@ -873,8 +873,8 @@ Anvil::CommandBufferBase::UpdateBufferCommand::UpdateBufferCommand(Anvil::Buffer /** Please see header for specification */ Anvil::CommandBufferBase::WaitEventsCommand::WaitEventsCommand(uint32_t in_event_count, Anvil::Event* const* in_event_ptrs, - VkPipelineStageFlags in_src_stage_mask, - VkPipelineStageFlags in_dst_stage_mask, + Anvil::PipelineStageFlags in_src_stage_mask, + Anvil::PipelineStageFlags in_dst_stage_mask, uint32_t in_memory_barrier_count, const MemoryBarrier* const in_memory_barriers_ptr, uint32_t in_buffer_memory_barrier_count, @@ -883,8 +883,8 @@ Anvil::CommandBufferBase::WaitEventsCommand::WaitEventsCommand(uint32_t const ImageBarrier* const in_image_memory_barriers_ptr) :Command(COMMAND_TYPE_WAIT_EVENTS) { - dst_stage_mask = static_cast(in_dst_stage_mask); - src_stage_mask = static_cast(in_src_stage_mask); + dst_stage_mask = in_dst_stage_mask; + src_stage_mask = in_src_stage_mask; for (uint32_t n_event = 0; n_event < in_event_count; @@ -917,9 +917,9 @@ Anvil::CommandBufferBase::WaitEventsCommand::WaitEventsCommand(uint32_t } /** Please see header for specification */ -Anvil::CommandBufferBase::WriteTimestampCommand::WriteTimestampCommand(VkPipelineStageFlagBits in_pipeline_stage, - Anvil::QueryPool* in_query_pool_ptr, - Anvil::QueryIndex in_entry) +Anvil::CommandBufferBase::WriteTimestampCommand::WriteTimestampCommand(Anvil::PipelineStageFlagBits in_pipeline_stage, + Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_entry) :Command(COMMAND_TYPE_WRITE_TIMESTAMP) { entry = in_entry; @@ -998,9 +998,9 @@ Anvil::CommandBufferBase::~CommandBufferBase() #endif /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_begin_query(Anvil::QueryPool* in_query_pool_ptr, - Anvil::QueryIndex in_entry, - VkQueryControlFlags in_flags) +bool Anvil::CommandBufferBase::record_begin_query(Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_entry, + Anvil::QueryControlFlags in_flags) { /* NOTE: The command can be executed both inside and outside a renderpass */ bool result = false; @@ -1029,7 +1029,7 @@ bool Anvil::CommandBufferBase::record_begin_query(Anvil::QueryPool* in_query_p vkCmdBeginQuery(m_command_buffer, in_query_pool_ptr->get_query_pool(), in_entry, - in_flags); + in_flags.get_vk() ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1040,7 +1040,7 @@ bool Anvil::CommandBufferBase::record_begin_query(Anvil::QueryPool* in_query_p } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_bind_descriptor_sets(VkPipelineBindPoint in_pipeline_bind_point, +bool Anvil::CommandBufferBase::record_bind_descriptor_sets(Anvil::PipelineBindPoint in_pipeline_bind_point, Anvil::PipelineLayout* in_layout_ptr, uint32_t in_first_set, uint32_t in_set_count, @@ -1085,7 +1085,7 @@ bool Anvil::CommandBufferBase::record_bind_descriptor_sets(VkPipelineBindPoint lock(); { vkCmdBindDescriptorSets(m_command_buffer, - in_pipeline_bind_point, + static_cast(in_pipeline_bind_point), in_layout_ptr->get_pipeline_layout(), in_first_set, in_set_count, @@ -1102,9 +1102,9 @@ bool Anvil::CommandBufferBase::record_bind_descriptor_sets(VkPipelineBindPoint } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_bind_index_buffer(Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_offset, - VkIndexType in_index_type) +bool Anvil::CommandBufferBase::record_bind_index_buffer(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + Anvil::IndexType in_index_type) { /* Note: Command supported inside and outside the renderpass. */ bool result = false; @@ -1133,7 +1133,7 @@ bool Anvil::CommandBufferBase::record_bind_index_buffer(Anvil::Buffer* in_buffer vkCmdBindIndexBuffer(m_command_buffer, in_buffer_ptr->get_buffer(), in_offset, - in_index_type); + static_cast(in_index_type) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1144,8 +1144,8 @@ bool Anvil::CommandBufferBase::record_bind_index_buffer(Anvil::Buffer* in_buffer } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_bind_pipeline(VkPipelineBindPoint in_pipeline_bind_point, - Anvil::PipelineID in_pipeline_id) +bool Anvil::CommandBufferBase::record_bind_pipeline(Anvil::PipelineBindPoint in_pipeline_bind_point, + Anvil::PipelineID in_pipeline_id) { /* Command supported inside and outside the renderpass. */ VkPipeline pipeline_vk (VK_NULL_HANDLE); @@ -1158,11 +1158,11 @@ bool Anvil::CommandBufferBase::record_bind_pipeline(VkPipelineBindPoint in_pipel goto end; } - anvil_assert(in_pipeline_bind_point == VK_PIPELINE_BIND_POINT_COMPUTE || - in_pipeline_bind_point == VK_PIPELINE_BIND_POINT_GRAPHICS); + anvil_assert(in_pipeline_bind_point == Anvil::PipelineBindPoint::COMPUTE || + in_pipeline_bind_point == Anvil::PipelineBindPoint::GRAPHICS); - pipeline_vk = (in_pipeline_bind_point == VK_PIPELINE_BIND_POINT_COMPUTE) ? m_device_ptr->get_compute_pipeline_manager ()->get_pipeline(in_pipeline_id) - : m_device_ptr->get_graphics_pipeline_manager()->get_pipeline(in_pipeline_id); + pipeline_vk = (in_pipeline_bind_point == Anvil::PipelineBindPoint::COMPUTE) ? m_device_ptr->get_compute_pipeline_manager ()->get_pipeline(in_pipeline_id) + : m_device_ptr->get_graphics_pipeline_manager()->get_pipeline(in_pipeline_id); #ifdef STORE_COMMAND_BUFFER_COMMANDS { @@ -1178,7 +1178,7 @@ bool Anvil::CommandBufferBase::record_bind_pipeline(VkPipelineBindPoint in_pipel lock(); { vkCmdBindPipeline(m_command_buffer, - in_pipeline_bind_point, + static_cast(in_pipeline_bind_point), pipeline_vk); } unlock(); @@ -1243,13 +1243,13 @@ bool Anvil::CommandBufferBase::record_bind_vertex_buffers(uint32_t in } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_blit_image(Anvil::Image* in_src_image_ptr, - Anvil::ImageLayout in_src_image_layout, - Anvil::Image* in_dst_image_ptr, - Anvil::ImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageBlit* in_region_ptrs, - VkFilter in_filter) +bool Anvil::CommandBufferBase::record_blit_image(Anvil::Image* in_src_image_ptr, + Anvil::ImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + Anvil::ImageLayout in_dst_image_layout, + uint32_t in_region_count, + const Anvil::ImageBlit* in_region_ptrs, + Anvil::Filter in_filter) { bool result = false; @@ -1291,8 +1291,8 @@ bool Anvil::CommandBufferBase::record_blit_image(Anvil::Image* in_src_image in_dst_image_ptr->get_image(), static_cast(in_dst_image_layout), in_region_count, - in_region_ptrs, - in_filter); + reinterpret_cast(in_region_ptrs), + static_cast(in_filter) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1303,10 +1303,10 @@ bool Anvil::CommandBufferBase::record_blit_image(Anvil::Image* in_src_image } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_clear_attachments(uint32_t in_n_attachments, - const VkClearAttachment* in_attachment_ptrs, - uint32_t in_n_rects, - const VkClearRect* in_rect_ptrs) +bool Anvil::CommandBufferBase::record_clear_attachments(uint32_t in_n_attachments, + const Anvil::ClearAttachment* in_attachment_ptrs, + uint32_t in_n_rects, + const VkClearRect* in_rect_ptrs) { bool result = false; @@ -1341,7 +1341,7 @@ bool Anvil::CommandBufferBase::record_clear_attachments(uint32_t { vkCmdClearAttachments(m_command_buffer, in_n_attachments, - in_attachment_ptrs, + reinterpret_cast(in_attachment_ptrs), in_n_rects, in_rect_ptrs); } @@ -1354,11 +1354,11 @@ bool Anvil::CommandBufferBase::record_clear_attachments(uint32_t } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_clear_color_image(Anvil::Image* in_image_ptr, - Anvil::ImageLayout in_image_layout, - const VkClearColorValue* in_color_ptr, - uint32_t in_range_count, - const VkImageSubresourceRange* in_range_ptrs) +bool Anvil::CommandBufferBase::record_clear_color_image(Anvil::Image* in_image_ptr, + Anvil::ImageLayout in_image_layout, + const VkClearColorValue* in_color_ptr, + uint32_t in_range_count, + const Anvil::ImageSubresourceRange* in_range_ptrs) { bool result = false; @@ -1397,7 +1397,7 @@ bool Anvil::CommandBufferBase::record_clear_color_image(Anvil::Image* static_cast(in_image_layout), in_color_ptr, in_range_count, - in_range_ptrs); + reinterpret_cast(in_range_ptrs) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1408,11 +1408,11 @@ bool Anvil::CommandBufferBase::record_clear_color_image(Anvil::Image* } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_clear_depth_stencil_image(Anvil::Image* in_image_ptr, - Anvil::ImageLayout in_image_layout, - const VkClearDepthStencilValue* in_depth_stencil_ptr, - uint32_t in_range_count, - const VkImageSubresourceRange* in_range_ptrs) +bool Anvil::CommandBufferBase::record_clear_depth_stencil_image(Anvil::Image* in_image_ptr, + Anvil::ImageLayout in_image_layout, + const VkClearDepthStencilValue* in_depth_stencil_ptr, + uint32_t in_range_count, + const Anvil::ImageSubresourceRange* in_range_ptrs) { bool result = false; @@ -1451,7 +1451,7 @@ bool Anvil::CommandBufferBase::record_clear_depth_stencil_image(Anvil::Image* static_cast(in_image_layout), in_depth_stencil_ptr, in_range_count, - in_range_ptrs); + reinterpret_cast(in_range_ptrs) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1462,10 +1462,10 @@ bool Anvil::CommandBufferBase::record_clear_depth_stencil_image(Anvil::Image* } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_copy_buffer(Anvil::Buffer* in_src_buffer_ptr, - Anvil::Buffer* in_dst_buffer_ptr, - uint32_t in_region_count, - const VkBufferCopy* in_region_ptrs) +bool Anvil::CommandBufferBase::record_copy_buffer(Anvil::Buffer* in_src_buffer_ptr, + Anvil::Buffer* in_dst_buffer_ptr, + uint32_t in_region_count, + const Anvil::BufferCopy* in_region_ptrs) { bool result = false; @@ -1502,7 +1502,7 @@ bool Anvil::CommandBufferBase::record_copy_buffer(Anvil::Buffer* in_src_buf in_src_buffer_ptr->get_buffer(), in_dst_buffer_ptr->get_buffer(), in_region_count, - in_region_ptrs); + reinterpret_cast(in_region_ptrs) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1513,11 +1513,11 @@ bool Anvil::CommandBufferBase::record_copy_buffer(Anvil::Buffer* in_src_buf } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_copy_buffer_to_image(Anvil::Buffer* in_src_buffer_ptr, - Anvil::Image* in_dst_image_ptr, - Anvil::ImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkBufferImageCopy* in_region_ptrs) +bool Anvil::CommandBufferBase::record_copy_buffer_to_image(Anvil::Buffer* in_src_buffer_ptr, + Anvil::Image* in_dst_image_ptr, + Anvil::ImageLayout in_dst_image_layout, + uint32_t in_region_count, + const Anvil::BufferImageCopy* in_region_ptrs) { bool result = false; @@ -1556,7 +1556,7 @@ bool Anvil::CommandBufferBase::record_copy_buffer_to_image(Anvil::Buffer* in_dst_image_ptr->get_image(), static_cast(in_dst_image_layout), in_region_count, - in_region_ptrs); + reinterpret_cast(in_region_ptrs) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1567,12 +1567,12 @@ bool Anvil::CommandBufferBase::record_copy_buffer_to_image(Anvil::Buffer* } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_copy_image(Anvil::Image* in_src_image_ptr, - Anvil::ImageLayout in_src_image_layout, - Anvil::Image* in_dst_image_ptr, - Anvil::ImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageCopy* in_region_ptrs) +bool Anvil::CommandBufferBase::record_copy_image(Anvil::Image* in_src_image_ptr, + Anvil::ImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + Anvil::ImageLayout in_dst_image_layout, + uint32_t in_region_count, + const Anvil::ImageCopy* in_region_ptrs) { bool result = false; @@ -1613,7 +1613,7 @@ bool Anvil::CommandBufferBase::record_copy_image(Anvil::Image* in_src_image in_dst_image_ptr->get_image(), static_cast(in_dst_image_layout), in_region_count, - in_region_ptrs); + reinterpret_cast(in_region_ptrs) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1624,11 +1624,11 @@ bool Anvil::CommandBufferBase::record_copy_image(Anvil::Image* in_src_image } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_copy_image_to_buffer(Anvil::Image* in_src_image_ptr, - Anvil::ImageLayout in_src_image_layout, - Anvil::Buffer* in_dst_buffer_ptr, - uint32_t in_region_count, - const VkBufferImageCopy* in_region_ptrs) +bool Anvil::CommandBufferBase::record_copy_image_to_buffer(Anvil::Image* in_src_image_ptr, + Anvil::ImageLayout in_src_image_layout, + Anvil::Buffer* in_dst_buffer_ptr, + uint32_t in_region_count, + const Anvil::BufferImageCopy* in_region_ptrs) { bool result = false; @@ -1667,7 +1667,7 @@ bool Anvil::CommandBufferBase::record_copy_image_to_buffer(Anvil::Image* static_cast(in_src_image_layout), in_dst_buffer_ptr->get_buffer(), in_region_count, - in_region_ptrs); + reinterpret_cast(in_region_ptrs) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1678,13 +1678,13 @@ bool Anvil::CommandBufferBase::record_copy_image_to_buffer(Anvil::Image* } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_copy_query_pool_results(Anvil::QueryPool* in_query_pool_ptr, - Anvil::QueryIndex in_start_query, - uint32_t in_query_count, - Anvil::Buffer* in_dst_buffer_ptr, - VkDeviceSize in_dst_offset, - VkDeviceSize in_dst_stride, - VkQueryResultFlags in_flags) +bool Anvil::CommandBufferBase::record_copy_query_pool_results(Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_start_query, + uint32_t in_query_count, + Anvil::Buffer* in_dst_buffer_ptr, + VkDeviceSize in_dst_offset, + VkDeviceSize in_dst_stride, + VkQueryResultFlags in_flags) { bool result = false; @@ -2592,9 +2592,9 @@ bool Anvil::CommandBufferBase::record_fill_buffer(Anvil::Buffer* in_dst_buffer_p } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_pipeline_barrier(VkPipelineStageFlags in_src_stage_mask, - VkPipelineStageFlags in_dst_stage_mask, - VkBool32 in_by_region, +bool Anvil::CommandBufferBase::record_pipeline_barrier(Anvil::PipelineStageFlags in_src_stage_mask, + Anvil::PipelineStageFlags in_dst_stage_mask, + Anvil::DependencyFlags in_dependency_flags, uint32_t in_memory_barrier_count, const MemoryBarrier* const in_memory_barriers_ptr, uint32_t in_buffer_memory_barrier_count, @@ -2621,7 +2621,7 @@ bool Anvil::CommandBufferBase::record_pipeline_barrier(VkPipelineStageFlags { m_commands.push_back(PipelineBarrierCommand(in_src_stage_mask, in_dst_stage_mask, - in_by_region, + in_dependency_flags, in_memory_barrier_count, in_memory_barriers_ptr, in_buffer_memory_barrier_count, @@ -2636,7 +2636,7 @@ bool Anvil::CommandBufferBase::record_pipeline_barrier(VkPipelineStageFlags { PipelineBarrierCommand command_data(in_src_stage_mask, in_dst_stage_mask, - in_by_region, + in_dependency_flags, in_memory_barrier_count, in_memory_barriers_ptr, in_buffer_memory_barrier_count, @@ -2675,9 +2675,9 @@ bool Anvil::CommandBufferBase::record_pipeline_barrier(VkPipelineStageFlags lock(); { vkCmdPipelineBarrier(m_command_buffer, - in_src_stage_mask, - in_dst_stage_mask, - in_by_region, + in_src_stage_mask.get_vk (), + in_dst_stage_mask.get_vk (), + in_dependency_flags.get_vk(), in_memory_barrier_count, (in_memory_barrier_count > 0) ? &memory_barriers_vk.at(0) : nullptr, in_buffer_memory_barrier_count, @@ -2694,11 +2694,11 @@ bool Anvil::CommandBufferBase::record_pipeline_barrier(VkPipelineStageFlags } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_push_constants(Anvil::PipelineLayout* in_layout_ptr, - VkShaderStageFlags in_stage_flags, - uint32_t in_offset, - uint32_t in_size, - const void* in_values) +bool Anvil::CommandBufferBase::record_push_constants(Anvil::PipelineLayout* in_layout_ptr, + Anvil::ShaderStageFlags in_stage_flags, + uint32_t in_offset, + uint32_t in_size, + const void* in_values) { /* NOTE: The command can be executed both inside and outside a renderpass */ bool result = false; @@ -2728,7 +2728,7 @@ bool Anvil::CommandBufferBase::record_push_constants(Anvil::PipelineLayout* in_l { vkCmdPushConstants(m_command_buffer, in_layout_ptr->get_pipeline_layout(), - in_stage_flags, + in_stage_flags.get_vk(), in_offset, in_size, in_values); @@ -2742,8 +2742,8 @@ bool Anvil::CommandBufferBase::record_push_constants(Anvil::PipelineLayout* in_l } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_reset_event(Anvil::Event* in_event_ptr, - VkPipelineStageFlags in_stage_mask) +bool Anvil::CommandBufferBase::record_reset_event(Anvil::Event* in_event_ptr, + Anvil::PipelineStageFlags in_stage_mask) { bool result = false; @@ -2776,7 +2776,7 @@ bool Anvil::CommandBufferBase::record_reset_event(Anvil::Event* in_event_ { vkCmdResetEvent(m_command_buffer, in_event_ptr->get_event(), - in_stage_mask); + in_stage_mask.get_vk() ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -2835,12 +2835,12 @@ bool Anvil::CommandBufferBase::record_reset_query_pool(Anvil::QueryPool* in_quer } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_resolve_image(Anvil::Image* in_src_image_ptr, - Anvil::ImageLayout in_src_image_layout, - Anvil::Image* in_dst_image_ptr, - Anvil::ImageLayout in_dst_image_layout, - uint32_t in_region_count, - const VkImageResolve* in_region_ptrs) +bool Anvil::CommandBufferBase::record_resolve_image(Anvil::Image* in_src_image_ptr, + Anvil::ImageLayout in_src_image_layout, + Anvil::Image* in_dst_image_ptr, + Anvil::ImageLayout in_dst_image_layout, + uint32_t in_region_count, + const Anvil::ImageResolve* in_region_ptrs) { bool result = false; @@ -2881,7 +2881,7 @@ bool Anvil::CommandBufferBase::record_resolve_image(Anvil::Image* in_src in_dst_image_ptr->get_image(), static_cast(in_dst_image_layout), in_region_count, - in_region_ptrs); + reinterpret_cast(in_region_ptrs) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -3070,8 +3070,8 @@ bool Anvil::CommandBufferBase::record_set_device_mask_KHR(uint32_t in_device_mas } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_set_event(Anvil::Event* in_event_ptr, - VkPipelineStageFlags in_stage_mask) +bool Anvil::CommandBufferBase::record_set_event(Anvil::Event* in_event_ptr, + Anvil::PipelineStageFlags in_stage_mask) { const Anvil::DeviceType device_type = m_device_ptr->get_type(); bool result = false; @@ -3090,7 +3090,7 @@ bool Anvil::CommandBufferBase::record_set_event(Anvil::Event* in_event_pt goto end; } - if (device_type == Anvil::DEVICE_TYPE_MULTI_GPU && + if (device_type == Anvil::DeviceType::MULTI_GPU && !Anvil::Utils::is_pow2(static_cast(m_device_mask) )) { /* Only one device may be active at the time of this call */ @@ -3114,7 +3114,7 @@ bool Anvil::CommandBufferBase::record_set_event(Anvil::Event* in_event_pt { vkCmdSetEvent(m_command_buffer, in_event_ptr->get_event(), - in_stage_mask); + in_stage_mask.get_vk() ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -3203,8 +3203,8 @@ bool Anvil::CommandBufferBase::record_set_scissor(uint32_t in_first_sciss } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_set_stencil_compare_mask(VkStencilFaceFlags in_face_mask, - uint32_t in_stencil_compare_mask) +bool Anvil::CommandBufferBase::record_set_stencil_compare_mask(Anvil::StencilFaceFlags in_face_mask, + uint32_t in_stencil_compare_mask) { /* Note: Command supported inside and outside the renderpass. */ bool result = false; @@ -3230,7 +3230,7 @@ bool Anvil::CommandBufferBase::record_set_stencil_compare_mask(VkStencilFaceFlag lock(); { vkCmdSetStencilCompareMask(m_command_buffer, - in_face_mask, + in_face_mask.get_vk(), in_stencil_compare_mask); } unlock(); @@ -3242,8 +3242,8 @@ bool Anvil::CommandBufferBase::record_set_stencil_compare_mask(VkStencilFaceFlag } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_set_stencil_reference(VkStencilFaceFlags in_face_mask, - uint32_t in_stencil_reference) +bool Anvil::CommandBufferBase::record_set_stencil_reference(Anvil::StencilFaceFlags in_face_mask, + uint32_t in_stencil_reference) { /* Note: Command supported inside and outside the renderpass. */ bool result = false; @@ -3269,7 +3269,7 @@ bool Anvil::CommandBufferBase::record_set_stencil_reference(VkStencilFaceFlags i lock(); { vkCmdSetStencilReference(m_command_buffer, - in_face_mask, + in_face_mask.get_vk(), in_stencil_reference); } unlock(); @@ -3281,8 +3281,8 @@ bool Anvil::CommandBufferBase::record_set_stencil_reference(VkStencilFaceFlags i } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_set_stencil_write_mask(VkStencilFaceFlags in_face_mask, - uint32_t in_stencil_write_mask) +bool Anvil::CommandBufferBase::record_set_stencil_write_mask(Anvil::StencilFaceFlags in_face_mask, + uint32_t in_stencil_write_mask) { /* Note: Command supported inside and outside the renderpass. */ bool result = false; @@ -3308,7 +3308,7 @@ bool Anvil::CommandBufferBase::record_set_stencil_write_mask(VkStencilFaceFlags lock(); { vkCmdSetStencilWriteMask(m_command_buffer, - in_face_mask, + in_face_mask.get_vk(), in_stencil_write_mask); } unlock(); @@ -3416,8 +3416,8 @@ bool Anvil::CommandBufferBase::record_update_buffer(Anvil::Buffer* in_dst_buffer /* Please see header for specification */ bool Anvil::CommandBufferBase::record_wait_events(uint32_t in_event_count, Anvil::Event* const* in_events, - VkPipelineStageFlags in_src_stage_mask, - VkPipelineStageFlags in_dst_stage_mask, + Anvil::PipelineStageFlags in_src_stage_mask, + Anvil::PipelineStageFlags in_dst_stage_mask, uint32_t in_memory_barrier_count, const MemoryBarrier* const in_memory_barriers_ptr, uint32_t in_buffer_memory_barrier_count, @@ -3495,8 +3495,8 @@ bool Anvil::CommandBufferBase::record_wait_events(uint32_t in_ vkCmdWaitEvents(m_command_buffer, in_event_count, (in_event_count > 0) ? &events.at(0) : nullptr, - in_src_stage_mask, - in_dst_stage_mask, + in_src_stage_mask.get_vk(), + in_dst_stage_mask.get_vk(), in_memory_barrier_count, (in_memory_barrier_count > 0) ? &memory_barriers_vk.at(0) : nullptr, in_buffer_memory_barrier_count, @@ -3513,9 +3513,9 @@ bool Anvil::CommandBufferBase::record_wait_events(uint32_t in_ } /* Please see header for specification */ -bool Anvil::CommandBufferBase::record_write_timestamp(VkPipelineStageFlagBits in_pipeline_stage, - Anvil::QueryPool* in_query_pool_ptr, - Anvil::QueryIndex in_query_index) +bool Anvil::CommandBufferBase::record_write_timestamp(Anvil::PipelineStageFlagBits in_pipeline_stage, + Anvil::QueryPool* in_query_pool_ptr, + Anvil::QueryIndex in_query_index) { /* NOTE: The command can be executed both inside and outside a renderpass */ bool result = false; @@ -3542,7 +3542,7 @@ bool Anvil::CommandBufferBase::record_write_timestamp(VkPipelineStageFlagBits in lock(); { vkCmdWriteTimestamp(m_command_buffer, - in_pipeline_stage, + static_cast(in_pipeline_stage), in_query_pool_ptr->get_query_pool(), in_query_index); } @@ -3660,12 +3660,12 @@ Anvil::PrimaryCommandBuffer::PrimaryCommandBuffer(const Anvil::BaseDevice* in_de } /* Please see header for specification */ -bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t in_n_clear_values, - const VkClearValue* in_clear_value_ptrs, - Anvil::Framebuffer* in_fbo_ptr, - VkRect2D in_render_area, - Anvil::RenderPass* in_render_pass_ptr, - VkSubpassContents in_contents) +bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + VkRect2D in_render_area, + Anvil::RenderPass* in_render_pass_ptr, + Anvil::SubpassContents in_contents) { return record_begin_render_pass(in_n_clear_values, in_clear_value_ptrs, @@ -3685,7 +3685,7 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t const Anvil::PhysicalDevice* const* in_physical_devices, const VkRect2D* in_render_areas, Anvil::RenderPass* in_render_pass_ptr, - VkSubpassContents in_contents) + Anvil::SubpassContents in_contents) { const Anvil::DeviceType device_type = m_device_ptr->get_type(); Anvil::StructChainer render_pass_begin_info_chain; @@ -3706,7 +3706,7 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t } if (in_n_physical_devices == 0 && - device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) + device_type == Anvil::DeviceType::SINGLE_GPU) { const Anvil::PhysicalDevice* physical_device_ptr; const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr) ); @@ -3750,7 +3750,7 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t render_pass_begin_info_chain.append_struct(render_pass_begin_info); } - if (device_type == Anvil::DEVICE_TYPE_MULTI_GPU) + if (device_type == Anvil::DeviceType::MULTI_GPU) { VkDeviceGroupRenderPassBeginInfoKHR render_pass_device_group_begin_info; @@ -3779,7 +3779,7 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t vkCmdBeginRenderPass(m_command_buffer, chain_ptr->get_root_struct(), - in_contents); + static_cast(in_contents) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -3880,7 +3880,7 @@ bool Anvil::PrimaryCommandBuffer::record_execute_commands(uint32_t } /* Please see header for specification */ -bool Anvil::PrimaryCommandBuffer::record_next_subpass(VkSubpassContents in_contents) +bool Anvil::PrimaryCommandBuffer::record_next_subpass(Anvil::SubpassContents in_contents) { bool result = false; @@ -3911,7 +3911,7 @@ bool Anvil::PrimaryCommandBuffer::record_next_subpass(VkSubpassContents in_conte lock(); { vkCmdNextSubpass(m_command_buffer, - in_contents); + static_cast(in_contents) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -3950,7 +3950,7 @@ bool Anvil::PrimaryCommandBuffer::start_recording(bool struct_chainer.append_struct(command_buffer_begin_info); } - if (device_type == Anvil::DEVICE_TYPE_MULTI_GPU) + if (device_type == Anvil::DeviceType::MULTI_GPU) { VkDeviceGroupCommandBufferBeginInfoKHR command_buffer_device_group_begin_info; auto device_mgpu_ptr = dynamic_cast(m_device_ptr); @@ -3970,7 +3970,7 @@ bool Anvil::PrimaryCommandBuffer::start_recording(bool } else { - anvil_assert(device_type == Anvil::DEVICE_TYPE_SINGLE_GPU); + anvil_assert(device_type == Anvil::DeviceType::SINGLE_GPU); } m_parent_command_pool_ptr->lock(); @@ -4039,16 +4039,16 @@ Anvil::SecondaryCommandBuffer::SecondaryCommandBuffer(const Anvil::BaseDevice* i } /* Please see header for specification */ -bool Anvil::SecondaryCommandBuffer::start_recording(bool in_one_time_submit, - bool in_simultaneous_use_allowed, - bool in_renderpass_usage_only, - Framebuffer* in_framebuffer_ptr, - RenderPass* in_render_pass_ptr, - SubPassID in_subpass_id, - OcclusionQuerySupportScope in_required_occlusion_query_support_scope, - bool in_occlusion_query_used_by_primary_command_buffer, - VkQueryPipelineStatisticFlags in_required_pipeline_statistics_scope, - uint32_t in_opt_device_mask) +bool Anvil::SecondaryCommandBuffer::start_recording(bool in_one_time_submit, + bool in_simultaneous_use_allowed, + bool in_renderpass_usage_only, + Framebuffer* in_framebuffer_ptr, + RenderPass* in_render_pass_ptr, + SubPassID in_subpass_id, + OcclusionQuerySupportScope in_required_occlusion_query_support_scope, + bool in_occlusion_query_used_by_primary_command_buffer, + Anvil::QueryPipelineStatisticFlags in_required_pipeline_statistics_scope, + uint32_t in_opt_device_mask) { VkCommandBufferInheritanceInfo command_buffer_inheritance_info; const Anvil::DeviceType device_type (m_device_ptr->get_type() ); @@ -4079,16 +4079,16 @@ bool Anvil::SecondaryCommandBuffer::start_recording(bool { command_buffer_inheritance_info.framebuffer = (in_framebuffer_ptr != nullptr) ? in_framebuffer_ptr->get_framebuffer(in_render_pass_ptr) : VK_NULL_HANDLE; command_buffer_inheritance_info.occlusionQueryEnable = (in_occlusion_query_used_by_primary_command_buffer) ? VK_TRUE : VK_FALSE; - command_buffer_inheritance_info.pipelineStatistics = in_required_pipeline_statistics_scope; + command_buffer_inheritance_info.pipelineStatistics = in_required_pipeline_statistics_scope.get_vk(); command_buffer_inheritance_info.pNext = nullptr; - command_buffer_inheritance_info.queryFlags = (in_occlusion_query_used_by_primary_command_buffer && - in_required_occlusion_query_support_scope == OCCLUSION_QUERY_SUPPORT_SCOPE_REQUIRED_PRECISE) ? VK_QUERY_CONTROL_PRECISE_BIT : 0u; - command_buffer_inheritance_info.renderPass = (in_render_pass_ptr != nullptr) ? in_render_pass_ptr->get_render_pass() : VK_NULL_HANDLE; + command_buffer_inheritance_info.queryFlags = (in_occlusion_query_used_by_primary_command_buffer && + in_required_occlusion_query_support_scope == OcclusionQuerySupportScope::REQUIRED_PRECISE) ? VK_QUERY_CONTROL_PRECISE_BIT : 0u; + command_buffer_inheritance_info.renderPass = (in_render_pass_ptr != nullptr) ? in_render_pass_ptr->get_render_pass() : VK_NULL_HANDLE; command_buffer_inheritance_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO; command_buffer_inheritance_info.subpass = in_subpass_id; } - if (device_type == Anvil::DEVICE_TYPE_MULTI_GPU) + if (device_type == Anvil::DeviceType::MULTI_GPU) { anvil_assert((in_opt_device_mask != 0) && (in_opt_device_mask != UINT32_MAX)); @@ -4104,7 +4104,7 @@ bool Anvil::SecondaryCommandBuffer::start_recording(bool } else { - anvil_assert(device_type == Anvil::DEVICE_TYPE_SINGLE_GPU); + anvil_assert(device_type == Anvil::DeviceType::SINGLE_GPU); m_device_mask = 0; } diff --git a/src/wrappers/compute_pipeline_manager.cpp b/src/wrappers/compute_pipeline_manager.cpp index 1f653f46..5e800bdf 100644 --- a/src/wrappers/compute_pipeline_manager.cpp +++ b/src/wrappers/compute_pipeline_manager.cpp @@ -126,7 +126,7 @@ bool Anvil::ComputePipelineManager::bake() anvil_assert(current_pipeline_ptr->layout_ptr != nullptr); } - current_pipeline_create_info_ptr->get_specialization_constants(Anvil::SHADER_STAGE_COMPUTE, + current_pipeline_create_info_ptr->get_specialization_constants(Anvil::ShaderStage::COMPUTE, &specialization_constants_ptr, &specialization_constants_data_buffer_ptr); @@ -187,7 +187,7 @@ bool Anvil::ComputePipelineManager::bake() anvil_assert(current_pipeline_ptr->layout_ptr != nullptr); - current_pipeline_create_info_ptr->get_shader_stage_properties(Anvil::SHADER_STAGE_COMPUTE, + current_pipeline_create_info_ptr->get_shader_stage_properties(Anvil::ShaderStage::COMPUTE, &shader_stage_entry_point_ptr); pipeline_create_info.flags = 0; @@ -215,7 +215,7 @@ bool Anvil::ComputePipelineManager::bake() pipeline_create_info.flags |= ((current_pipeline_create_info_ptr->allows_derivatives () ) ? VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT : 0) | ((current_pipeline_create_info_ptr->has_optimizations_disabled() ) ? VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT : 0); - if (m_device_ptr->get_type() == Anvil::DEVICE_TYPE_MULTI_GPU) + if (m_device_ptr->get_type() == Anvil::DeviceType::MULTI_GPU) { pipeline_create_info.flags |= VK_PIPELINE_CREATE_DISPATCH_BASE_KHR; } diff --git a/src/wrappers/descriptor_pool.cpp b/src/wrappers/descriptor_pool.cpp index 2aef815a..b2927d30 100644 --- a/src/wrappers/descriptor_pool.cpp +++ b/src/wrappers/descriptor_pool.cpp @@ -31,11 +31,11 @@ /* Please see header for specification */ -Anvil::DescriptorPool::DescriptorPool(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_n_max_sets, - const Anvil::DescriptorPoolFlags& in_flags, - const uint32_t* in_descriptor_count_per_type_ptr, - bool in_mt_safe) +Anvil::DescriptorPool::DescriptorPool(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_n_max_sets, + const Anvil::DescriptorPoolCreateFlags& in_flags, + const uint32_t* in_descriptor_count_per_type_ptr, + bool in_mt_safe) :CallbacksSupportProvider (DESCRIPTOR_POOL_CALLBACK_ID_COUNT), DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT), @@ -152,7 +152,7 @@ bool Anvil::DescriptorPool::alloc_descriptor_sets(uint32_t if (ds_create_info_ptr->contains_variable_descriptor_count_binding() ) { - if ((m_flags & Anvil::DESCRIPTOR_POOL_FLAG_CREATE_UPDATE_AFTER_BIND_BIT) != 0) + if ((m_flags & Anvil::DescriptorPoolCreateFlagBits::UPDATE_AFTER_BIND_BIT) != 0) { anvil_assert_fail(); @@ -225,11 +225,11 @@ bool Anvil::DescriptorPool::alloc_descriptor_sets(uint32_t } /* Please see header for specification */ -Anvil::DescriptorPoolUniquePtr Anvil::DescriptorPool::create(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_n_max_sets, - const Anvil::DescriptorPoolFlags& in_flags, - const uint32_t* in_descriptor_count_per_type_ptr, - MTSafety in_mt_safety) +Anvil::DescriptorPoolUniquePtr Anvil::DescriptorPool::create(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_n_max_sets, + const Anvil::DescriptorPoolCreateFlags& in_flags, + const uint32_t* in_descriptor_count_per_type_ptr, + MTSafety in_mt_safety) { const bool is_mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, in_device_ptr); @@ -264,7 +264,7 @@ bool Anvil::DescriptorPool::init() bool result (false); VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); - if ((m_flags & Anvil::DESCRIPTOR_POOL_FLAG_CREATE_UPDATE_AFTER_BIND_BIT) != 0) + if ((m_flags & Anvil::DescriptorPoolCreateFlagBits::UPDATE_AFTER_BIND_BIT) != 0) { if (!m_device_ptr->get_extension_info()->ext_descriptor_indexing() ) { @@ -284,15 +284,14 @@ bool Anvil::DescriptorPool::init() uint32_t current_index = n_descriptor_types_used; descriptor_pool_sizes[current_index].descriptorCount = m_descriptor_count[n_descriptor_type]; - descriptor_pool_sizes[current_index].type = (VkDescriptorType) n_descriptor_type; + descriptor_pool_sizes[current_index].type = static_cast(n_descriptor_type); n_descriptor_types_used++; } } /* Set up the descriptor pool instance */ - descriptor_pool_create_info.flags = ((m_flags & Anvil::DESCRIPTOR_POOL_FLAG_CREATE_FREE_DESCRIPTOR_SET_BIT) ? VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT : 0u) | - ((m_flags & Anvil::DESCRIPTOR_POOL_FLAG_CREATE_UPDATE_AFTER_BIND_BIT) ? VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT : 0u); + descriptor_pool_create_info.flags = m_flags.get_vk(); descriptor_pool_create_info.maxSets = m_n_max_sets; descriptor_pool_create_info.pNext = nullptr; descriptor_pool_create_info.poolSizeCount = n_descriptor_types_used; diff --git a/src/wrappers/descriptor_set.cpp b/src/wrappers/descriptor_set.cpp index e4573f4b..77fd41f1 100644 --- a/src/wrappers/descriptor_set.cpp +++ b/src/wrappers/descriptor_set.cpp @@ -633,14 +633,14 @@ bool Anvil::DescriptorSet::update(const DescriptorSetUpdateMethod& in_update_met { switch (in_update_method) { - case Anvil::DESCRIPTOR_SET_UPDATE_METHOD_CORE: + case Anvil::DescriptorSetUpdateMethod::CORE: { result = update_using_core_method(); break; } - case Anvil::DESCRIPTOR_SET_UPDATE_METHOD_TEMPLATE: + case Anvil::DescriptorSetUpdateMethod::TEMPLATE: { result = update_using_template_method(); @@ -699,9 +699,9 @@ bool Anvil::DescriptorSet::update_using_core_method() const n_binding < n_bindings; ++n_binding) { - Anvil::DescriptorBindingFlags current_binding_flags = 0; + Anvil::DescriptorBindingFlags current_binding_flags; uint32_t current_binding_index; - VkDescriptorType descriptor_type; + Anvil::DescriptorType descriptor_type; bool immutable_samplers_enabled = false; uint32_t start_ds_buffer_info_items_array_offset = cached_ds_buffer_info_items_array_offset; uint32_t start_ds_image_info_items_array_offset = cached_ds_image_info_items_array_offset; @@ -774,7 +774,7 @@ bool Anvil::DescriptorSet::update_using_core_method() const else { /* Arrayed bindings are only permitted if the binding has been created with the PARTIALLY_BOUND flag */ - if ((current_binding_flags & Anvil::DESCRIPTOR_BINDING_FLAG_PARTIALLY_BOUND_BIT) == 0) + if ((current_binding_flags & Anvil::DescriptorBindingFlagBits::PARTIALLY_BOUND_BIT) == 0) { anvil_assert_fail(); @@ -794,7 +794,7 @@ bool Anvil::DescriptorSet::update_using_core_method() const if (n_descriptors > 0) { write_ds_vk.descriptorCount = n_descriptors; - write_ds_vk.descriptorType = descriptor_type; + write_ds_vk.descriptorType = static_cast(descriptor_type); write_ds_vk.dstArrayElement = n_last_binding_item + 1; write_ds_vk.dstBinding = current_binding_index; write_ds_vk.dstSet = m_descriptor_set; @@ -874,7 +874,7 @@ bool Anvil::DescriptorSet::update_using_template_method() const { const std::vector* binding_element_vec_ptr = nullptr; uint32_t current_binding_index = UINT32_MAX; - VkDescriptorType descriptor_type; + Anvil::DescriptorType descriptor_type = Anvil::DescriptorType::UNKNOWN; bool immutable_samplers_enabled = false; uint32_t n_binding_elements = 0; @@ -972,7 +972,7 @@ bool Anvil::DescriptorSet::update_using_template_method() const Anvil::DescriptorUpdateTemplate::create_for_descriptor_set_updates(m_device_ptr, m_layout_ptr, m_template_entries, - Anvil::MT_SAFETY_DISABLED) ); + Anvil::MTSafety::DISABLED) ); /* Update the iterator */ template_object_iterator = m_template_object_map.find(m_template_entries); diff --git a/src/wrappers/descriptor_set_group.cpp b/src/wrappers/descriptor_set_group.cpp index bb4b54e6..1afcfc36 100644 --- a/src/wrappers/descriptor_set_group.cpp +++ b/src/wrappers/descriptor_set_group.cpp @@ -37,7 +37,7 @@ Anvil::DescriptorSetGroup::DescriptorSetGroup(const Anvil::BaseDevice* bool in_releaseable_sets, MTSafety in_mt_safety, const std::vector& in_opt_overhead_allocations, - const Anvil::DescriptorPoolFlags& in_opt_pool_extra_flags) + const Anvil::DescriptorPoolCreateFlags& in_opt_pool_extra_flags) :MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, in_device_ptr) ), m_device_ptr (in_device_ptr), @@ -57,7 +57,7 @@ Anvil::DescriptorSetGroup::DescriptorSetGroup(const Anvil::BaseDevice* for (const auto& overhead_alloc : in_opt_overhead_allocations) { - m_overhead_allocations[overhead_alloc.descriptor_type] = overhead_alloc.n_overhead_allocations; + m_overhead_allocations[static_cast(overhead_alloc.descriptor_type)] = overhead_alloc.n_overhead_allocations; } /* Initialize descriptor pool */ @@ -114,8 +114,8 @@ Anvil::DescriptorSetGroup::DescriptorSetGroup(const DescriptorSetGroup* in_paren { auto descriptor_set_layout_manager_ptr = m_device_ptr->get_descriptor_set_layout_manager(); - anvil_assert( in_parent_dsg_ptr->m_parent_dsg_ptr == nullptr); - anvil_assert(((in_parent_dsg_ptr->m_descriptor_pool_ptr->get_flags() & Anvil::DESCRIPTOR_POOL_FLAG_CREATE_FREE_DESCRIPTOR_SET_BIT) > 0) == in_releaseable_sets); + anvil_assert( in_parent_dsg_ptr->m_parent_dsg_ptr == nullptr); + anvil_assert(((in_parent_dsg_ptr->m_descriptor_pool_ptr->get_flags() & Anvil::DescriptorPoolCreateFlagBits::FREE_DESCRIPTOR_SET_BIT) != 0) == in_releaseable_sets); memcpy(m_pool_size_per_descriptor_type, in_parent_dsg_ptr->m_pool_size_per_descriptor_type, @@ -170,7 +170,7 @@ Anvil::DescriptorSetGroup::~DescriptorSetGroup() /** Re-creates internally-maintained descriptor pool. **/ bool Anvil::DescriptorSetGroup::bake_descriptor_pool() { - Anvil::DescriptorPoolFlags flags = ((m_releaseable_sets) ? Anvil::DESCRIPTOR_POOL_FLAG_CREATE_FREE_DESCRIPTOR_SET_BIT : 0); + Anvil::DescriptorPoolCreateFlags flags = ((m_releaseable_sets) ? Anvil::DescriptorPoolCreateFlagBits::FREE_DESCRIPTOR_SET_BIT : Anvil::DescriptorPoolCreateFlagBits::NONE); std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); bool result = false; @@ -220,9 +220,9 @@ bool Anvil::DescriptorSetGroup::bake_descriptor_pool() ++n_ds_binding) { uint32_t ds_binding_array_size; - Anvil::DescriptorBindingFlags ds_binding_flags = 0; + Anvil::DescriptorBindingFlags ds_binding_flags; uint32_t ds_binding_index = UINT32_MAX; - VkDescriptorType ds_binding_type; + Anvil::DescriptorType ds_binding_type = Anvil::DescriptorType::UNKNOWN; current_ds_create_info_ptr->get_binding_properties_by_index_number(n_ds_binding, &ds_binding_index, @@ -232,7 +232,7 @@ bool Anvil::DescriptorSetGroup::bake_descriptor_pool() nullptr, /* out_opt_immutable_samplers_enabled_ptr */ &ds_binding_flags); - if (ds_binding_type > VK_DESCRIPTOR_TYPE_END_RANGE) + if (ds_binding_type > static_cast(VK_DESCRIPTOR_TYPE_END_RANGE) ) { continue; } @@ -242,12 +242,12 @@ bool Anvil::DescriptorSetGroup::bake_descriptor_pool() ds_binding_array_size = variable_descriptor_binding_size; } - if (ds_binding_flags & Anvil::DESCRIPTOR_BINDING_FLAG_UPDATE_AFTER_BIND_BIT) + if ((ds_binding_flags & Anvil::DescriptorBindingFlagBits::UPDATE_AFTER_BIND_BIT) != 0) { - flags |= Anvil::DESCRIPTOR_POOL_FLAG_CREATE_UPDATE_AFTER_BIND_BIT; + flags |= Anvil::DescriptorPoolCreateFlagBits::UPDATE_AFTER_BIND_BIT; } - n_descriptors_needed_array[ds_binding_type] += ds_binding_array_size; + n_descriptors_needed_array[static_cast(ds_binding_type)] += ds_binding_array_size; } } @@ -260,7 +260,7 @@ bool Anvil::DescriptorSetGroup::bake_descriptor_pool() } /* Verify we can actually create the pool.. */ - if (flags & Anvil::DESCRIPTOR_POOL_FLAG_CREATE_UPDATE_AFTER_BIND_BIT) + if ((flags & Anvil::DescriptorPoolCreateFlagBits::UPDATE_AFTER_BIND_BIT) != 0) { if (!m_device_ptr->get_extension_info()->ext_descriptor_indexing() ) { @@ -386,7 +386,7 @@ Anvil::DescriptorSetGroupUniquePtr Anvil::DescriptorSetGroup::create(const Anvil bool in_releaseable_sets, MTSafety in_mt_safety, const std::vector& in_opt_overhead_allocations, - const Anvil::DescriptorPoolFlags& in_opt_pool_extra_flags) + const Anvil::DescriptorPoolCreateFlags& in_opt_pool_extra_flags) { Anvil::DescriptorSetGroupUniquePtr result_ptr(nullptr, std::default_delete() ); diff --git a/src/wrappers/device.cpp b/src/wrappers/device.cpp index 38960820..c1d8c0c4 100644 --- a/src/wrappers/device.cpp +++ b/src/wrappers/device.cpp @@ -106,9 +106,9 @@ Anvil::DescriptorSetLayout* Anvil::BaseDevice::get_dummy_descriptor_set_layout() return m_dummy_dsg_ptr->get_descriptor_set_layout(0); } -bool Anvil::BaseDevice::get_memory_types_supported_for_external_handle(const Anvil::ExternalMemoryHandleTypeBit& in_external_handle_type, - ExternalHandleType in_handle, - uint32_t* out_supported_memory_type_bits) const +bool Anvil::BaseDevice::get_memory_types_supported_for_external_handle(const Anvil::ExternalMemoryHandleTypeFlagBits& in_external_handle_type, + ExternalHandleType in_handle, + uint32_t* out_supported_memory_type_bits) const { bool result = false; @@ -122,11 +122,11 @@ bool Anvil::BaseDevice::get_memory_types_supported_for_external_handle(const Anv goto end; } - if (in_external_handle_type != Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT && - in_external_handle_type != Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT) + if (in_external_handle_type != Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_WIN32_BIT && + in_external_handle_type != Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_WIN32_KMT_BIT) { - anvil_assert(in_external_handle_type == Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT || - in_external_handle_type == Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT); + anvil_assert(in_external_handle_type == Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_WIN32_BIT || + in_external_handle_type == Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_WIN32_KMT_BIT); goto end; } @@ -140,9 +140,9 @@ bool Anvil::BaseDevice::get_memory_types_supported_for_external_handle(const Anv goto end; } - if (in_external_handle_type != Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) + if (in_external_handle_type != Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_FD_BIT) { - anvil_assert(in_external_handle_type == Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT); + anvil_assert(in_external_handle_type == Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_FD_BIT); goto end; } @@ -164,12 +164,12 @@ bool Anvil::BaseDevice::get_memory_types_supported_for_external_handle(const Anv #if defined(_WIN32) if (m_khr_external_memory_win32_extension_entrypoints.vkGetMemoryWin32HandlePropertiesKHR(m_device, - static_cast(Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(in_external_handle_type) ), + static_cast(in_external_handle_type), in_handle, &result_props) != VK_SUCCESS) #else if (m_khr_external_memory_fd_extension_entrypoints.vkGetMemoryFdPropertiesKHR(m_device, - static_cast(Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(in_external_handle_type) ), + static_cast(in_external_handle_type), in_handle, &result_props) != VK_SUCCESS) #endif @@ -277,8 +277,8 @@ void Anvil::BaseDevice::get_queue_family_indices_for_physical_device(const Anvil if (n_iteration == 0) { - if ( (current_queue_family.flags & VK_QUEUE_COMPUTE_BIT) && - !(current_queue_family.flags & VK_QUEUE_GRAPHICS_BIT) ) + if ( ((current_queue_family.flags & Anvil::QueueFlagBits::COMPUTE_BIT) != 0) && + ((current_queue_family.flags & Anvil::QueueFlagBits::GRAPHICS_BIT) == 0) ) { result_compute_queue_families.push_back( DeviceQueueFamilyMemberInfo(n_queue_family_index, @@ -289,7 +289,7 @@ void Anvil::BaseDevice::get_queue_family_indices_for_physical_device(const Anvil else if (n_iteration == 1) { - if (current_queue_family.flags & VK_QUEUE_GRAPHICS_BIT) + if ((current_queue_family.flags & Anvil::QueueFlagBits::GRAPHICS_BIT) != 0) { if (std::find(result_compute_queue_families.begin(), result_compute_queue_families.end (), @@ -305,7 +305,7 @@ void Anvil::BaseDevice::get_queue_family_indices_for_physical_device(const Anvil else if (n_iteration == 2) { - if (current_queue_family.flags & VK_QUEUE_TRANSFER_BIT) + if ((current_queue_family.flags & Anvil::QueueFlagBits::TRANSFER_BIT) != 0) { if (std::find(result_compute_queue_families.begin(), result_compute_queue_families.end (), @@ -416,7 +416,7 @@ bool Anvil::BaseDevice::get_sample_locations(Anvil::SampleCountFlagBits in_sam switch (get_type() ) { - case Anvil::DEVICE_TYPE_MULTI_GPU: + case Anvil::DeviceType::MULTI_GPU: { /* Sample locations must not differ for all devices within a given device group, so it technically * doesn't matter which physical device we choose to check for standard sample locations support. @@ -428,7 +428,7 @@ bool Anvil::BaseDevice::get_sample_locations(Anvil::SampleCountFlagBits in_sam break; } - case Anvil::DEVICE_TYPE_SINGLE_GPU: + case Anvil::DeviceType::SINGLE_GPU: { const Anvil::SGPUDevice* sgpu_device_ptr = reinterpret_cast(this); anvil_assert(sgpu_device_ptr != nullptr); @@ -452,7 +452,7 @@ bool Anvil::BaseDevice::get_sample_locations(Anvil::SampleCountFlagBits in_sam switch (in_sample_count) { - case Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT: + case Anvil::SampleCountFlagBits::_1_BIT: { out_result_ptr->clear(); @@ -461,7 +461,7 @@ bool Anvil::BaseDevice::get_sample_locations(Anvil::SampleCountFlagBits in_sam break; } - case Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_2_BIT: + case Anvil::SampleCountFlagBits::_2_BIT: { out_result_ptr->clear(); @@ -472,7 +472,7 @@ bool Anvil::BaseDevice::get_sample_locations(Anvil::SampleCountFlagBits in_sam } - case Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_4_BIT: + case Anvil::SampleCountFlagBits::_4_BIT: { out_result_ptr->clear(); @@ -484,7 +484,7 @@ bool Anvil::BaseDevice::get_sample_locations(Anvil::SampleCountFlagBits in_sam break; } - case Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_8_BIT: + case Anvil::SampleCountFlagBits::_8_BIT: { out_result_ptr->clear(); @@ -500,7 +500,7 @@ bool Anvil::BaseDevice::get_sample_locations(Anvil::SampleCountFlagBits in_sam break; } - case Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_16_BIT: + case Anvil::SampleCountFlagBits::_16_BIT: { out_result_ptr->clear(); @@ -537,8 +537,8 @@ bool Anvil::BaseDevice::get_sample_locations(Anvil::SampleCountFlagBits in_sam } /* Please see header for specification */ -Anvil::Queue* Anvil::BaseDevice::get_sparse_binding_queue(uint32_t in_n_queue, - VkQueueFlags in_opt_required_queue_flags) const +Anvil::Queue* Anvil::BaseDevice::get_sparse_binding_queue(uint32_t in_n_queue, + Anvil::QueueFlags in_opt_required_queue_flags) const { uint32_t n_queues_found = 0; Anvil::Queue* result_ptr = nullptr; @@ -610,27 +610,27 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, const bool is_ext_supported = is_physical_device_extension_supported(current_extension.first); is_amd_negative_viewport_height_defined |= (current_extension.first == VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME && - current_extension.second != EXTENSION_AVAILABILITY_IGNORE); + current_extension.second != Anvil::ExtensionAvailability::IGNORE); is_khr_maintenance1_defined |= (current_extension.first == VK_KHR_MAINTENANCE1_EXTENSION_NAME && - current_extension.second != EXTENSION_AVAILABILITY_IGNORE); + current_extension.second != Anvil::ExtensionAvailability::IGNORE); switch (current_extension.second) { - case EXTENSION_AVAILABILITY_ENABLE_IF_AVAILABLE: + case Anvil::ExtensionAvailability::ENABLE_IF_AVAILABLE: { extensions_final_enabled_status[current_extension.first] = is_ext_supported; break; } - case EXTENSION_AVAILABILITY_IGNORE: + case Anvil::ExtensionAvailability::IGNORE: { extensions_final_enabled_status[current_extension.first] = false; break; } - case EXTENSION_AVAILABILITY_REQUIRE: + case Anvil::ExtensionAvailability::REQUIRE: { if (!is_ext_supported) { @@ -988,20 +988,20 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, std::vector dummy_overhead_allocs; dummy_overhead_allocs.push_back( - Anvil::OverheadAllocation(VK_DESCRIPTOR_TYPE_SAMPLER, + Anvil::OverheadAllocation(Anvil::DescriptorType::SAMPLER, 1) /* in_n_overhead_allocs */ ); dummy_ds_create_info_ptrs[0] = Anvil::DescriptorSetCreateInfo::create(); dummy_ds_create_info_ptrs[0]->add_binding(0, /* n_binding */ - VK_DESCRIPTOR_TYPE_MAX_ENUM, + Anvil::DescriptorType::UNKNOWN, 0, /* n_elements */ - 0); /* stage_flags */ + Anvil::ShaderStageFlagBits::NONE); /* stage_flags */ m_dummy_dsg_ptr = Anvil::DescriptorSetGroup::create(this, dummy_ds_create_info_ptrs, false, /* releaseable_sets */ - MT_SAFETY_DISABLED, + Anvil::MTSafety::DISABLED, dummy_overhead_allocs); m_dummy_dsg_ptr->get_descriptor_set(0)->update(); @@ -1100,7 +1100,7 @@ Anvil::MGPUDevice::MGPUDevice(std::vector in_physi bool in_mt_safe) :BaseDevice (in_physical_device_ptrs[0]->get_instance(), in_mt_safe), - m_supported_present_modes(static_cast(0) ) + m_supported_present_modes(static_cast(0) ) { const uint32_t n_physical_device_ptrs = static_cast(in_physical_device_ptrs.size() ); @@ -1180,8 +1180,8 @@ Anvil::BaseDeviceUniquePtr Anvil::MGPUDevice::create(std::vector& in_extensi } /** Please see header for specification */ -Anvil::SwapchainUniquePtr Anvil::MGPUDevice::create_swapchain(Anvil::RenderingSurface* in_parent_surface_ptr, - Anvil::Window* in_window_ptr, - Anvil::Format in_image_format, - VkPresentModeKHR in_present_mode, - Anvil::ImageUsageFlags in_usage, - uint32_t in_n_swapchain_images, - bool in_support_SFR, - VkDeviceGroupPresentModeFlagsKHR in_presentation_modes_to_support) +Anvil::SwapchainUniquePtr Anvil::MGPUDevice::create_swapchain(Anvil::RenderingSurface* in_parent_surface_ptr, + Anvil::Window* in_window_ptr, + Anvil::Format in_image_format, + Anvil::PresentModeKHR in_present_mode, + Anvil::ImageUsageFlags in_usage, + uint32_t in_n_swapchain_images, + bool in_support_SFR, + Anvil::DeviceGroupPresentModeFlags in_presentation_modes_to_support) { SwapchainUniquePtr result_ptr(nullptr, std::default_delete() ); @@ -1337,12 +1337,12 @@ Anvil::SwapchainUniquePtr Anvil::MGPUDevice::create_swapchain(Anvil::RenderingSu in_usage, in_n_swapchain_images); - swapchain_create_info_ptr->set_mt_safety (Anvil::MT_SAFETY_ENABLED); + swapchain_create_info_ptr->set_mt_safety (Anvil::MTSafety::ENABLED); swapchain_create_info_ptr->set_mgpu_present_mode_flags(in_presentation_modes_to_support); if (in_support_SFR) { - swapchain_create_info_ptr->set_flags(VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR); + swapchain_create_info_ptr->set_flags(Anvil::SwapchainCreateFlagBits::SPLIT_INSTANCE_BIND_REGIONS_BIT); } result_ptr = Anvil::Swapchain::create(std::move(swapchain_create_info_ptr) ); @@ -1502,12 +1502,12 @@ bool Anvil::MGPUDevice::get_physical_device_semaphore_properties(const Semaphore } /** Please see header for specification */ -bool Anvil::MGPUDevice::get_physical_device_sparse_image_format_properties(Anvil::Format in_format, - Anvil::ImageType in_type, - Anvil::SampleCountFlagBits in_sample_count, - Anvil::ImageUsageFlags in_usage, - Anvil::ImageTiling in_tiling, - std::vector& out_result) const +bool Anvil::MGPUDevice::get_physical_device_sparse_image_format_properties(Anvil::Format in_format, + Anvil::ImageType in_type, + Anvil::SampleCountFlagBits in_sample_count, + Anvil::ImageUsageFlags in_usage, + Anvil::ImageTiling in_tiling, + std::vector& out_result) const { /* NOTE: All physical devices within a device group are assumed to report the same sparse image format properties */ uint32_t n_props = 0; @@ -1516,7 +1516,7 @@ bool Anvil::MGPUDevice::get_physical_device_sparse_image_format_properties(Anvil static_cast (in_format), static_cast (in_type), static_cast(in_sample_count), - in_usage, + in_usage.get_vk(), static_cast(in_tiling), &n_props, nullptr); /* pProperties */ @@ -1529,23 +1529,23 @@ bool Anvil::MGPUDevice::get_physical_device_sparse_image_format_properties(Anvil static_cast (in_format), static_cast (in_type), static_cast(in_sample_count), - in_usage, + in_usage.get_vk(), static_cast(in_tiling), &n_props, - &out_result[0]); + reinterpret_cast(&out_result[0] )); } return true; } /* Please see header for specification */ -bool Anvil::MGPUDevice::get_physical_device_surface_capabilities(Anvil::RenderingSurface* in_surface_ptr, - VkSurfaceCapabilitiesKHR* out_result_ptr) const +bool Anvil::MGPUDevice::get_physical_device_surface_capabilities(Anvil::RenderingSurface* in_surface_ptr, + Anvil::SurfaceCapabilities* out_result_ptr) const { /* NOTE: All physical devices within a device group are assumed to report the same sparse image format properties */ return (vkGetPhysicalDeviceSurfaceCapabilitiesKHR(m_parent_physical_devices.at(0).physical_device_ptr->get_physical_device(), in_surface_ptr->get_surface(), - out_result_ptr) == VK_SUCCESS); + reinterpret_cast(out_result_ptr) ) == VK_SUCCESS); } /* Please see header for specification */ @@ -1649,19 +1649,19 @@ const Anvil::QueueFamilyInfo* Anvil::MGPUDevice::get_queue_family_info(uint32_t } /** Please see header for specification */ -VkDeviceGroupPresentModeFlagsKHR Anvil::MGPUDevice::get_supported_present_modes_for_surface(const Anvil::RenderingSurface* in_surface_ptr) const +Anvil::DeviceGroupPresentModeFlags Anvil::MGPUDevice::get_supported_present_modes_for_surface(const Anvil::RenderingSurface* in_surface_ptr) const { - VkDeviceGroupPresentModeFlagsKHR result = 0; - VkResult result_vk = VK_ERROR_INITIALIZATION_FAILED; + VkDeviceGroupPresentModeFlagsKHR result_flags = 0; + VkResult result_vk = VK_ERROR_INITIALIZATION_FAILED; ANVIL_REDUNDANT_VARIABLE(result_vk); result_vk = m_khr_device_group_extension_entrypoints.vkGetDeviceGroupSurfacePresentModesKHR(m_device, in_surface_ptr->get_surface(), - &result); + &result_flags); anvil_assert_vk_call_succeeded(result_vk); - return result; + return Anvil::DeviceGroupPresentModeFlags(static_cast(result_flags) ); } /** Please see header for specification */ @@ -1681,9 +1681,9 @@ void Anvil::MGPUDevice::init_device() &present_caps); anvil_assert_vk_call_succeeded(result); - anvil_assert ((present_caps.modes & VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR) == VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR); + anvil_assert ((present_caps.modes & static_cast(Anvil::DeviceGroupPresentModeFlagBits::LOCAL_BIT_KHR) )); - m_supported_present_modes = static_cast(present_caps.modes); + m_supported_present_modes = Anvil::DeviceGroupPresentModeFlags(static_cast(present_caps.modes) ); for (uint32_t n_physical_device = 0; n_physical_device < static_cast(m_parent_physical_devices.size() ); @@ -1748,7 +1748,7 @@ void Anvil::MGPUDevice::init_device() anvil_assert( (memory_features & VK_PEER_MEMORY_FEATURE_COPY_DST_BIT_KHR) != 0); /* As per spec */ - src_physical_device_info.peer_memory_features[dst_physical_device_index][n_heap] = Utils::convert_vk_peer_memory_feature_flags_to_peer_memory_feature_flags(memory_features); + src_physical_device_info.peer_memory_features[dst_physical_device_index][n_heap] = static_cast(memory_features); } } } @@ -1900,7 +1900,7 @@ void Anvil::SGPUDevice::create_device(const std::vector& in_extensi Anvil::SwapchainUniquePtr Anvil::SGPUDevice::create_swapchain(Anvil::RenderingSurface* in_parent_surface_ptr, Anvil::Window* in_window_ptr, Anvil::Format in_image_format, - VkPresentModeKHR in_present_mode, + Anvil::PresentModeKHR in_present_mode, Anvil::ImageUsageFlags in_usage, uint32_t in_n_swapchain_images) { @@ -1916,7 +1916,7 @@ Anvil::SwapchainUniquePtr Anvil::SGPUDevice::create_swapchain(Anvil::RenderingSu in_usage, in_n_swapchain_images); - create_info_ptr->set_mt_safety(Anvil::MT_SAFETY_ENABLED); + create_info_ptr->set_mt_safety(Anvil::MTSafety::ENABLED); result_ptr = Anvil::Swapchain::create(std::move(create_info_ptr) ); } @@ -1986,12 +1986,12 @@ bool Anvil::SGPUDevice::get_physical_device_semaphore_properties(const Semaphore } /** Please see header for specification */ -bool Anvil::SGPUDevice::get_physical_device_sparse_image_format_properties(Anvil::Format in_format, - Anvil::ImageType in_type, - Anvil::SampleCountFlagBits in_sample_count, - Anvil::ImageUsageFlags in_usage, - Anvil::ImageTiling in_tiling, - std::vector& out_result) const +bool Anvil::SGPUDevice::get_physical_device_sparse_image_format_properties(Anvil::Format in_format, + Anvil::ImageType in_type, + Anvil::SampleCountFlagBits in_sample_count, + Anvil::ImageUsageFlags in_usage, + Anvil::ImageTiling in_tiling, + std::vector& out_result) const { uint32_t n_props = 0; @@ -1999,7 +1999,7 @@ bool Anvil::SGPUDevice::get_physical_device_sparse_image_format_properties(Anvil static_cast (in_format), static_cast (in_type), static_cast(in_sample_count), - in_usage, + in_usage.get_vk(), static_cast(in_tiling), &n_props, nullptr); /* pProperties */ @@ -2012,22 +2012,22 @@ bool Anvil::SGPUDevice::get_physical_device_sparse_image_format_properties(Anvil static_cast (in_format), static_cast (in_type), static_cast(in_sample_count), - in_usage, + in_usage.get_vk(), static_cast(in_tiling), &n_props, - &out_result[0]); + reinterpret_cast(&out_result[0]) ); } return true; } /* Please see header for specification */ -bool Anvil::SGPUDevice::get_physical_device_surface_capabilities(Anvil::RenderingSurface* in_surface_ptr, - VkSurfaceCapabilitiesKHR* out_result_ptr) const +bool Anvil::SGPUDevice::get_physical_device_surface_capabilities(Anvil::RenderingSurface* in_surface_ptr, + Anvil::SurfaceCapabilities* out_result_ptr) const { return (vkGetPhysicalDeviceSurfaceCapabilitiesKHR(m_parent_physical_device_ptr->get_physical_device(), in_surface_ptr->get_surface(), - out_result_ptr) == VK_SUCCESS); + reinterpret_cast(out_result_ptr) ) == VK_SUCCESS); } /* Please see header for specification */ diff --git a/src/wrappers/fence.cpp b/src/wrappers/fence.cpp index 2881975f..738cda17 100644 --- a/src/wrappers/fence.cpp +++ b/src/wrappers/fence.cpp @@ -76,7 +76,7 @@ Anvil::FenceUniquePtr Anvil::Fence::create(Anvil::FenceCreateInfoUniquePtr in_cr } /* Please see header for specification */ -Anvil::ExternalHandleUniquePtr Anvil::Fence::export_to_external_handle(const Anvil::ExternalFenceHandleTypeBit& in_fence_handle_type) +Anvil::ExternalHandleUniquePtr Anvil::Fence::export_to_external_handle(const Anvil::ExternalFenceHandleTypeFlagBits& in_fence_handle_type) { #if defined(_WIN32) const auto invalid_handle = nullptr; @@ -129,7 +129,7 @@ Anvil::ExternalHandleUniquePtr Anvil::Fence::export_to_external_handle(const Anv anvil_assert(m_fence != VK_NULL_HANDLE); info.fence = m_fence; - info.handleType = static_cast(Anvil::Utils::convert_external_fence_handle_type_bits_to_vk_external_fence_handle_type_flags(in_fence_handle_type) ); + info.handleType = static_cast(in_fence_handle_type); info.pNext = nullptr; info.sType = VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR; @@ -150,7 +150,7 @@ Anvil::ExternalHandleUniquePtr Anvil::Fence::export_to_external_handle(const Anv anvil_assert(m_fence != VK_NULL_HANDLE); info.fence = m_fence; - info.handleType = static_cast(Anvil::Utils::convert_external_fence_handle_type_bits_to_vk_external_fence_handle_type_flags(in_fence_handle_type) ); + info.handleType = static_cast(in_fence_handle_type); info.pNext = nullptr; info.sType = VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR; @@ -188,14 +188,14 @@ Anvil::ExternalHandleUniquePtr Anvil::Fence::export_to_external_handle(const Anv } #if defined(_WIN32) - bool Anvil::Fence::import_from_external_handle(const bool& in_temporary_import, - const Anvil::ExternalFenceHandleTypeBit& in_handle_type, - const ExternalHandleType& in_opt_handle, - const std::wstring& in_opt_name) + bool Anvil::Fence::import_from_external_handle(const bool& in_temporary_import, + const Anvil::ExternalFenceHandleTypeFlagBits& in_handle_type, + const ExternalHandleType& in_opt_handle, + const std::wstring& in_opt_name) #else - bool Anvil::Fence::import_from_external_handle(const bool& in_temporary_import, - const Anvil::ExternalFenceHandleTypeBit& in_handle_type, - const ExternalHandleType& in_handle) + bool Anvil::Fence::import_from_external_handle(const bool& in_temporary_import, + const Anvil::ExternalFenceHandleTypeFlagBits& in_handle_type, + const ExternalHandleType& in_handle) #endif { #if defined(_WIN32) @@ -236,7 +236,7 @@ Anvil::ExternalHandleUniquePtr Anvil::Fence::export_to_external_handle(const Anv info_vk.flags = (in_temporary_import) ? VK_FENCE_IMPORT_TEMPORARY_BIT_KHR : 0; info_vk.handle = in_opt_handle; - info_vk.handleType = static_cast(Anvil::Utils::convert_external_fence_handle_type_bits_to_vk_external_fence_handle_type_flags(in_handle_type) ); + info_vk.handleType = static_cast(in_handle_type); info_vk.name = (in_opt_name.size() > 0) ? &in_opt_name.at(0) : nullptr; info_vk.pNext = nullptr; @@ -253,7 +253,7 @@ Anvil::ExternalHandleUniquePtr Anvil::Fence::export_to_external_handle(const Anv info_vk.fence = m_fence; info_vk.flags = (in_temporary_import) ? VK_FENCE_IMPORT_TEMPORARY_BIT_KHR : 0; - info_vk.handleType = static_cast(Anvil::Utils::convert_external_fence_handle_type_bits_to_vk_external_fence_handle_type_flags(in_handle_type) ); + info_vk.handleType = static_cast(in_handle_type); info_vk.pNext = nullptr; info_vk.sType = VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR; @@ -273,7 +273,7 @@ bool Anvil::Fence::init() Anvil::StructChainUniquePtr struct_chain_ptr; /* Sanity checks */ - if (m_create_info_ptr->get_exportable_external_fence_handle_types() != Anvil::EXTERNAL_FENCE_HANDLE_TYPE_NONE) + if (m_create_info_ptr->get_exportable_external_fence_handle_types() != Anvil::ExternalFenceHandleTypeFlagBits::NONE) { if (!m_device_ptr->get_extension_info()->khr_external_fence() ) { @@ -293,11 +293,11 @@ bool Anvil::Fence::init() struct_chainer.append_struct(fence_create_info); } - if (m_create_info_ptr->get_exportable_external_fence_handle_types() != Anvil::EXTERNAL_FENCE_HANDLE_TYPE_NONE) + if (m_create_info_ptr->get_exportable_external_fence_handle_types() != Anvil::ExternalFenceHandleTypeFlagBits::NONE) { VkExportFenceCreateInfo create_info; - create_info.handleTypes = Anvil::Utils::convert_external_fence_handle_type_bits_to_vk_external_fence_handle_type_flags(m_create_info_ptr->get_exportable_external_fence_handle_types() ); + create_info.handleTypes = m_create_info_ptr->get_exportable_external_fence_handle_types().get_vk(); create_info.pNext = nullptr; create_info.sType = VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO_KHR; @@ -312,8 +312,8 @@ bool Anvil::Fence::init() { VkExportFenceWin32HandleInfoKHR handle_info; - anvil_assert(nt_handle_info_ptr != nullptr); - anvil_assert(m_create_info_ptr->get_exportable_external_fence_handle_types() & Anvil::EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT); + anvil_assert(nt_handle_info_ptr != nullptr); + anvil_assert((m_create_info_ptr->get_exportable_external_fence_handle_types() & Anvil::ExternalFenceHandleTypeFlagBits::OPAQUE_WIN32_BIT) != 0); handle_info.dwAccess = nt_handle_info_ptr->access; handle_info.name = (nt_handle_info_ptr->name.size() > 0) ? &nt_handle_info_ptr->name.at(0) @@ -456,4 +456,4 @@ bool Anvil::Fence::reset_fences(const uint32_t in_n_fences, end: return result; -} \ No newline at end of file +} diff --git a/src/wrappers/graphics_pipeline_manager.cpp b/src/wrappers/graphics_pipeline_manager.cpp index 4ced7a98..d3e05052 100644 --- a/src/wrappers/graphics_pipeline_manager.cpp +++ b/src/wrappers/graphics_pipeline_manager.cpp @@ -108,7 +108,6 @@ bool Anvil::GraphicsPipelineManager::bake() auto color_blend_state_create_info_items_vk_cache = std::vector (); auto depth_stencil_state_create_info_items_vk_cache = std::vector (); auto dynamic_state_create_info_items_vk_cache = std::vector (); - auto enabled_dynamic_states_vk_cache = std::vector (); auto graphics_pipeline_create_info_chains = Anvil::StructChainVector(); auto input_assembly_state_create_info_items_vk_cache = std::vector (); auto multisample_state_create_info_items_vk_cache = std::vector (); @@ -148,7 +147,6 @@ bool Anvil::GraphicsPipelineManager::bake() color_blend_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); depth_stencil_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); dynamic_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - enabled_dynamic_states_vk_cache.reserve (N_CACHE_ITEMS); input_assembly_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); multisample_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); raster_state_create_info_chains_vk_cache.reserve (N_CACHE_ITEMS); @@ -206,6 +204,8 @@ bool Anvil::GraphicsPipelineManager::bake() bool dynamic_state_used = false; Anvil::StructChainer graphics_pipeline_create_info_chainer; VkPipelineInputAssemblyStateCreateInfo input_assembly_state_create_info; + bool is_dynamic_scissor_state_enabled = false; + bool is_dynamic_viewport_state_enabled = false; bool multisample_state_used = false; uint32_t subpass_n_color_attachments = 0; bool tessellation_state_used = false; @@ -228,7 +228,7 @@ bool Anvil::GraphicsPipelineManager::bake() /* Extract subpass information */ current_pipeline_renderpass_ptr->get_render_pass_create_info()->get_subpass_n_attachments(current_pipeline_subpass_id, - ATTACHMENT_TYPE_COLOR, + Anvil::AttachmentType::COLOR, &subpass_n_color_attachments); /* Form the color blend state create info descriptor, if needed */ @@ -238,7 +238,7 @@ bool Anvil::GraphicsPipelineManager::bake() { const float* blend_constant_ptr = nullptr; VkPipelineColorBlendStateCreateInfo color_blend_state_create_info; - VkLogicOp logic_op; + Anvil::LogicOp logic_op = Anvil::LogicOp::UNKNOWN; bool logic_op_enabled = false; uint32_t max_location_index = UINT32_MAX; const uint32_t start_offset = static_cast(color_blend_attachment_states_vk_cache.size() ); @@ -253,7 +253,7 @@ bool Anvil::GraphicsPipelineManager::bake() color_blend_state_create_info.attachmentCount = max_location_index + 1; color_blend_state_create_info.flags = 0; - color_blend_state_create_info.logicOp = logic_op; + color_blend_state_create_info.logicOp = static_cast(logic_op); color_blend_state_create_info.logicOpEnable = (logic_op_enabled) ? VK_TRUE : VK_FALSE; color_blend_state_create_info.pAttachments = nullptr; color_blend_state_create_info.pNext = nullptr; @@ -276,20 +276,28 @@ bool Anvil::GraphicsPipelineManager::bake() bool is_blending_enabled_for_attachment = false; Anvil::RenderPassAttachmentID rp_attachment_id = UINT32_MAX; + Anvil::BlendOp alpha_blend_op = Anvil::BlendOp::UNKNOWN; + Anvil::BlendOp color_blend_op = Anvil::BlendOp::UNKNOWN; + Anvil::ColorComponentFlags color_component_flags = Anvil::ColorComponentFlagBits::NONE; + Anvil::BlendFactor dst_alpha_blend_factor = Anvil::BlendFactor::UNKNOWN; + Anvil::BlendFactor dst_color_blend_factor = Anvil::BlendFactor::UNKNOWN; + Anvil::BlendFactor src_alpha_blend_factor = Anvil::BlendFactor::UNKNOWN; + Anvil::BlendFactor src_color_blend_factor = Anvil::BlendFactor::UNKNOWN; + if (!current_pipeline_renderpass_ptr->get_render_pass_create_info()->get_subpass_attachment_properties(current_pipeline_subpass_id, - Anvil::ATTACHMENT_TYPE_COLOR, + Anvil::AttachmentType::COLOR, n_subpass_color_attachment, &rp_attachment_id, &dummy) || /* out_layout_ptr */ !current_pipeline_create_info_ptr->get_color_blend_attachment_properties (rp_attachment_id, &is_blending_enabled_for_attachment, - &blend_attachment_state_ptr->colorBlendOp, - &blend_attachment_state_ptr->alphaBlendOp, - &blend_attachment_state_ptr->srcColorBlendFactor, - &blend_attachment_state_ptr->dstColorBlendFactor, - &blend_attachment_state_ptr->srcAlphaBlendFactor, - &blend_attachment_state_ptr->dstAlphaBlendFactor, - &blend_attachment_state_ptr->colorWriteMask) ) + &color_blend_op, + &alpha_blend_op, + &src_color_blend_factor, + &dst_color_blend_factor, + &src_alpha_blend_factor, + &dst_alpha_blend_factor, + &color_component_flags) ) { /* The user has not defined blending properties for current color attachment. Use default state values .. */ blend_attachment_state_ptr->blendEnable = VK_FALSE; @@ -306,7 +314,14 @@ bool Anvil::GraphicsPipelineManager::bake() } else { - blend_attachment_state_ptr->blendEnable = (is_blending_enabled_for_attachment) ? VK_TRUE : VK_FALSE; + blend_attachment_state_ptr->alphaBlendOp = static_cast(alpha_blend_op); + blend_attachment_state_ptr->blendEnable = (is_blending_enabled_for_attachment) ? VK_TRUE : VK_FALSE; + blend_attachment_state_ptr->colorBlendOp = static_cast (color_blend_op); + blend_attachment_state_ptr->colorWriteMask = color_component_flags.get_vk(); + blend_attachment_state_ptr->dstAlphaBlendFactor = static_cast(dst_alpha_blend_factor); + blend_attachment_state_ptr->dstColorBlendFactor = static_cast(dst_color_blend_factor); + blend_attachment_state_ptr->srcAlphaBlendFactor = static_cast(src_alpha_blend_factor); + blend_attachment_state_ptr->srcColorBlendFactor = static_cast(src_color_blend_factor); } } @@ -333,7 +348,7 @@ bool Anvil::GraphicsPipelineManager::bake() /* Form the depth stencil state create info descriptor, if needed */ { VkPipelineDepthStencilStateCreateInfo depth_stencil_state_create_info; - VkCompareOp depth_test_compare_op = VK_COMPARE_OP_MAX_ENUM; + auto depth_test_compare_op = Anvil::CompareOp::UNKNOWN; bool is_depth_bounds_test_enabled = false; bool is_depth_test_enabled = false; bool is_stencil_test_enabled = false; @@ -348,30 +363,49 @@ bool Anvil::GraphicsPipelineManager::bake() current_pipeline_create_info_ptr->get_depth_test_state(&is_depth_test_enabled, &depth_test_compare_op); - current_pipeline_create_info_ptr->get_stencil_test_properties(&is_stencil_test_enabled, - &depth_stencil_state_create_info.front.failOp, - &depth_stencil_state_create_info.front.passOp, - &depth_stencil_state_create_info.front.depthFailOp, - &depth_stencil_state_create_info.front.compareOp, - &depth_stencil_state_create_info.front.compareMask, - &depth_stencil_state_create_info.front.writeMask, - &depth_stencil_state_create_info.front.reference, - &depth_stencil_state_create_info.back.failOp, - &depth_stencil_state_create_info.back.passOp, - &depth_stencil_state_create_info.back.depthFailOp, - &depth_stencil_state_create_info.back.compareOp, - &depth_stencil_state_create_info.back.compareMask, - &depth_stencil_state_create_info.back.writeMask, - &depth_stencil_state_create_info.back.reference); + { + Anvil::CompareOp back_compare_op = Anvil::CompareOp::UNKNOWN; + Anvil::StencilOp back_depth_fail_op = Anvil::StencilOp::UNKNOWN; + Anvil::StencilOp back_fail_op = Anvil::StencilOp::UNKNOWN; + Anvil::StencilOp back_pass_op = Anvil::StencilOp::UNKNOWN; + Anvil::CompareOp front_compare_op = Anvil::CompareOp::UNKNOWN; + Anvil::StencilOp front_depth_fail_op = Anvil::StencilOp::UNKNOWN; + Anvil::StencilOp front_fail_op = Anvil::StencilOp::UNKNOWN; + Anvil::StencilOp front_pass_op = Anvil::StencilOp::UNKNOWN; + + current_pipeline_create_info_ptr->get_stencil_test_properties(&is_stencil_test_enabled, + &front_fail_op, + &front_pass_op, + &front_depth_fail_op, + &front_compare_op, + &depth_stencil_state_create_info.front.compareMask, + &depth_stencil_state_create_info.front.writeMask, + &depth_stencil_state_create_info.front.reference, + &back_fail_op, + &back_pass_op, + &back_depth_fail_op, + &back_compare_op, + &depth_stencil_state_create_info.back.compareMask, + &depth_stencil_state_create_info.back.writeMask, + &depth_stencil_state_create_info.back.reference);\ + depth_stencil_state_create_info.back.compareOp = static_cast(back_compare_op); + depth_stencil_state_create_info.back.depthFailOp = static_cast(back_depth_fail_op); + depth_stencil_state_create_info.back.failOp = static_cast(back_fail_op); + depth_stencil_state_create_info.back.passOp = static_cast(back_pass_op); + depth_stencil_state_create_info.front.compareOp = static_cast(front_compare_op); + depth_stencil_state_create_info.front.depthFailOp = static_cast(front_depth_fail_op); + depth_stencil_state_create_info.front.failOp = static_cast(front_fail_op); + depth_stencil_state_create_info.front.passOp = static_cast(front_pass_op); + } current_pipeline_renderpass_ptr->get_render_pass_create_info()->get_subpass_n_attachments(current_pipeline_create_info_ptr->get_subpass_id(), - ATTACHMENT_TYPE_DEPTH_STENCIL, + Anvil::AttachmentType::DEPTH_STENCIL, &n_depth_stencil_attachments); if (n_depth_stencil_attachments) { depth_stencil_state_create_info.depthBoundsTestEnable = is_depth_bounds_test_enabled ? VK_TRUE : VK_FALSE; - depth_stencil_state_create_info.depthCompareOp = depth_test_compare_op; + depth_stencil_state_create_info.depthCompareOp = static_cast(depth_test_compare_op); depth_stencil_state_create_info.depthTestEnable = is_depth_test_enabled ? VK_TRUE : VK_FALSE; depth_stencil_state_create_info.depthWriteEnable = current_pipeline_create_info_ptr->are_depth_writes_enabled() ? VK_TRUE : VK_FALSE; depth_stencil_state_create_info.flags = 0; @@ -399,61 +433,19 @@ bool Anvil::GraphicsPipelineManager::bake() /* Form the dynamic state create info descriptor, if needed */ { - const auto& enabled_dynamic_states = current_pipeline_create_info_ptr->get_enabled_dynamic_states(); + const Anvil::DynamicState* enabled_dynamic_states_ptr = nullptr; + uint32_t n_enabled_dynamic_states = 0; - if (enabled_dynamic_states != 0) + current_pipeline_create_info_ptr->get_enabled_dynamic_states(&enabled_dynamic_states_ptr, + &n_enabled_dynamic_states); + + if (n_enabled_dynamic_states != 0) { VkPipelineDynamicStateCreateInfo dynamic_state_create_info; - const uint32_t start_offset = static_cast(enabled_dynamic_states_vk_cache.size() ); - - if ((enabled_dynamic_states & DYNAMIC_STATE_BLEND_CONSTANTS_BIT) != 0) - { - enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_BLEND_CONSTANTS); - } - - if ((enabled_dynamic_states & DYNAMIC_STATE_DEPTH_BIAS_BIT) != 0) - { - enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_DEPTH_BIAS); - } - if ((enabled_dynamic_states & DYNAMIC_STATE_DEPTH_BOUNDS_BIT) != 0) - { - enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_DEPTH_BOUNDS); - } - - if ((enabled_dynamic_states & DYNAMIC_STATE_LINE_WIDTH_BIT) != 0) - { - enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_LINE_WIDTH); - } - - if ((enabled_dynamic_states & DYNAMIC_STATE_SCISSOR_BIT) != 0) - { - enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_SCISSOR); - } - - if ((enabled_dynamic_states & DYNAMIC_STATE_STENCIL_COMPARE_MASK_BIT) != 0) - { - enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK); - } - - if ((enabled_dynamic_states & DYNAMIC_STATE_STENCIL_REFERENCE_BIT) != 0) - { - enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_STENCIL_REFERENCE); - } - - if ((enabled_dynamic_states & DYNAMIC_STATE_STENCIL_WRITE_MASK_BIT) != 0) - { - enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_STENCIL_WRITE_MASK); - } - - if ((enabled_dynamic_states & DYNAMIC_STATE_VIEWPORT_BIT) != 0) - { - enabled_dynamic_states_vk_cache.push_back(VK_DYNAMIC_STATE_VIEWPORT); - } - - dynamic_state_create_info.dynamicStateCount = static_cast(enabled_dynamic_states_vk_cache.size() - start_offset); + dynamic_state_create_info.dynamicStateCount = n_enabled_dynamic_states; dynamic_state_create_info.flags = 0; - dynamic_state_create_info.pDynamicStates = (dynamic_state_create_info.dynamicStateCount > 0) ? &enabled_dynamic_states_vk_cache[start_offset] + dynamic_state_create_info.pDynamicStates = (dynamic_state_create_info.dynamicStateCount > 0) ? reinterpret_cast(enabled_dynamic_states_ptr) : VK_NULL_HANDLE; dynamic_state_create_info.pNext = nullptr; dynamic_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO; @@ -461,6 +453,21 @@ bool Anvil::GraphicsPipelineManager::bake() dynamic_state_used = true; dynamic_state_create_info_items_vk_cache.push_back(dynamic_state_create_info); + + for (uint32_t n_dynamic_state = 0; + n_dynamic_state < n_enabled_dynamic_states; + ++n_dynamic_state) + { + if (enabled_dynamic_states_ptr[n_dynamic_state] == Anvil::DynamicState::SCISSOR) + { + is_dynamic_scissor_state_enabled = true; + } + + if (enabled_dynamic_states_ptr[n_dynamic_state] == Anvil::DynamicState::VIEWPORT) + { + is_dynamic_viewport_state_enabled = true; + } + } } else { @@ -474,7 +481,7 @@ bool Anvil::GraphicsPipelineManager::bake() input_assembly_state_create_info.pNext = nullptr; input_assembly_state_create_info.primitiveRestartEnable = current_pipeline_create_info_ptr->is_primitive_restart_enabled() ? VK_TRUE : VK_FALSE; input_assembly_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO; - input_assembly_state_create_info.topology = current_pipeline_create_info_ptr->get_primitive_topology(); + input_assembly_state_create_info.topology = static_cast(current_pipeline_create_info_ptr->get_primitive_topology() ); input_assembly_state_create_info_items_vk_cache.push_back(input_assembly_state_create_info); } @@ -532,14 +539,14 @@ bool Anvil::GraphicsPipelineManager::bake() /* Form the raster state create info chain */ { - VkCullModeFlags cull_mode = VK_CULL_MODE_FLAG_BITS_MAX_ENUM; + Anvil::CullModeFlags cull_mode = Anvil::CullModeFlagBits::NONE; float depth_bias_clamp = std::numeric_limits::max(); float depth_bias_constant_factor = std::numeric_limits::max(); float depth_bias_slope_factor = std::numeric_limits::max(); - VkFrontFace front_face = VK_FRONT_FACE_MAX_ENUM; + Anvil::FrontFace front_face = Anvil::FrontFace::UNKNOWN; bool is_depth_bias_enabled = false; float line_width = std::numeric_limits::max(); - VkPolygonMode polygon_mode = VK_POLYGON_MODE_MAX_ENUM; + Anvil::PolygonMode polygon_mode = Anvil::PolygonMode::UNKNOWN; Anvil::StructChainer raster_state_create_info_chainer; current_pipeline_create_info_ptr->get_depth_bias_state (&is_depth_bias_enabled, @@ -554,17 +561,17 @@ bool Anvil::GraphicsPipelineManager::bake() { VkPipelineRasterizationStateCreateInfo raster_state_create_info; - raster_state_create_info.cullMode = cull_mode; + raster_state_create_info.cullMode = cull_mode.get_vk(); raster_state_create_info.depthBiasClamp = depth_bias_clamp; raster_state_create_info.depthBiasConstantFactor = depth_bias_constant_factor; raster_state_create_info.depthBiasEnable = is_depth_bias_enabled ? VK_TRUE : VK_FALSE; raster_state_create_info.depthBiasSlopeFactor = depth_bias_slope_factor; raster_state_create_info.depthClampEnable = current_pipeline_create_info_ptr->is_depth_clamp_enabled() ? VK_TRUE : VK_FALSE; raster_state_create_info.flags = 0; - raster_state_create_info.frontFace = front_face; + raster_state_create_info.frontFace = static_cast(front_face); raster_state_create_info.lineWidth = line_width; raster_state_create_info.pNext = nullptr; - raster_state_create_info.polygonMode = polygon_mode; + raster_state_create_info.polygonMode = static_cast(polygon_mode); raster_state_create_info.rasterizerDiscardEnable = current_pipeline_create_info_ptr->is_rasterizer_discard_enabled() ? VK_TRUE : VK_FALSE; raster_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO; @@ -576,9 +583,9 @@ bool Anvil::GraphicsPipelineManager::bake() /* Chain a predefined struct which will toggle the relaxed rasterization, as long as the device supports the * VK_AMD_rasterization_order extension. */ - if (current_pipeline_create_info_ptr->get_rasterization_order() != VK_RASTERIZATION_ORDER_STRICT_AMD) + if (current_pipeline_create_info_ptr->get_rasterization_order() != Anvil::RasterizationOrderAMD::STRICT) { - anvil_assert(current_pipeline_create_info_ptr->get_rasterization_order() == relaxed_rasterization_order_item.rasterizationOrder); + anvil_assert(current_pipeline_create_info_ptr->get_rasterization_order() == static_cast(relaxed_rasterization_order_item.rasterizationOrder) ); raster_state_create_info_chainer.append_struct(relaxed_rasterization_order_item); } @@ -588,7 +595,7 @@ bool Anvil::GraphicsPipelineManager::bake() } } else - if (current_pipeline_create_info_ptr->get_rasterization_order() != VK_RASTERIZATION_ORDER_STRICT_AMD) + if (current_pipeline_create_info_ptr->get_rasterization_order() != Anvil::RasterizationOrderAMD::STRICT) { fprintf(stderr, "[!] Cannot enable out-of-order rasterization - VK_AMD_rasterization_order extension not enabled at device creation time\n"); @@ -604,11 +611,11 @@ bool Anvil::GraphicsPipelineManager::bake() { static const Anvil::ShaderStage graphics_shader_stages[] = { - Anvil::SHADER_STAGE_FRAGMENT, - Anvil::SHADER_STAGE_GEOMETRY, - Anvil::SHADER_STAGE_TESSELLATION_CONTROL, - Anvil::SHADER_STAGE_TESSELLATION_EVALUATION, - Anvil::SHADER_STAGE_VERTEX + Anvil::ShaderStage::FRAGMENT, + Anvil::ShaderStage::GEOMETRY, + Anvil::ShaderStage::TESSELLATION_CONTROL, + Anvil::ShaderStage::TESSELLATION_EVALUATION, + Anvil::ShaderStage::VERTEX }; for (const auto& current_graphics_shader_stage : graphics_shader_stages) @@ -642,18 +649,18 @@ bool Anvil::GraphicsPipelineManager::bake() shader_module_ptr = shader_stage_entry_point_ptr->shader_module_ptr; current_shader_stage_create_info.module = shader_module_ptr->get_module(); - current_shader_stage_create_info.pName = (shader_stage_entry_point_ptr->stage == Anvil::SHADER_STAGE_FRAGMENT) ? shader_module_ptr->get_fs_entrypoint_name().c_str() - : (shader_stage_entry_point_ptr->stage == Anvil::SHADER_STAGE_GEOMETRY) ? shader_module_ptr->get_gs_entrypoint_name().c_str() - : (shader_stage_entry_point_ptr->stage == Anvil::SHADER_STAGE_TESSELLATION_CONTROL) ? shader_module_ptr->get_tc_entrypoint_name().c_str() - : (shader_stage_entry_point_ptr->stage == Anvil::SHADER_STAGE_TESSELLATION_EVALUATION) ? shader_module_ptr->get_te_entrypoint_name().c_str() - : (shader_stage_entry_point_ptr->stage == Anvil::SHADER_STAGE_VERTEX) ? shader_module_ptr->get_vs_entrypoint_name().c_str() + current_shader_stage_create_info.pName = (shader_stage_entry_point_ptr->stage == Anvil::ShaderStage::FRAGMENT) ? shader_module_ptr->get_fs_entrypoint_name().c_str() + : (shader_stage_entry_point_ptr->stage == Anvil::ShaderStage::GEOMETRY) ? shader_module_ptr->get_gs_entrypoint_name().c_str() + : (shader_stage_entry_point_ptr->stage == Anvil::ShaderStage::TESSELLATION_CONTROL) ? shader_module_ptr->get_tc_entrypoint_name().c_str() + : (shader_stage_entry_point_ptr->stage == Anvil::ShaderStage::TESSELLATION_EVALUATION) ? shader_module_ptr->get_te_entrypoint_name().c_str() + : (shader_stage_entry_point_ptr->stage == Anvil::ShaderStage::VERTEX) ? shader_module_ptr->get_vs_entrypoint_name().c_str() : nullptr; current_shader_stage_create_info.flags = 0; current_shader_stage_create_info.pNext = nullptr; current_shader_stage_create_info.pSpecializationInfo = (current_shader_stage_specialization_constants_ptr->size() > 0) ? &specialization_info_vk_cache.back() : VK_NULL_HANDLE; - current_shader_stage_create_info.stage = Anvil::Utils::get_shader_stage_flag_bits_from_shader_stage(shader_stage_entry_point_ptr->stage); + current_shader_stage_create_info.stage = static_cast(Anvil::Utils::get_shader_stage_flag_bits_from_shader_stage(shader_stage_entry_point_ptr->stage) ); current_shader_stage_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; shader_stage_create_info_items_vk_cache.push_back(current_shader_stage_create_info); @@ -666,9 +673,9 @@ bool Anvil::GraphicsPipelineManager::bake() const Anvil::ShaderModuleStageEntryPoint* tc_shader_stage_entry_point_ptr = nullptr; const Anvil::ShaderModuleStageEntryPoint* te_shader_stage_entry_point_ptr = nullptr; - current_pipeline_create_info_ptr->get_shader_stage_properties(Anvil::SHADER_STAGE_TESSELLATION_CONTROL, + current_pipeline_create_info_ptr->get_shader_stage_properties(Anvil::ShaderStage::TESSELLATION_CONTROL, &tc_shader_stage_entry_point_ptr); - current_pipeline_create_info_ptr->get_shader_stage_properties(Anvil::SHADER_STAGE_TESSELLATION_EVALUATION, + current_pipeline_create_info_ptr->get_shader_stage_properties(Anvil::ShaderStage::TESSELLATION_EVALUATION, &te_shader_stage_entry_point_ptr); if (tc_shader_stage_entry_point_ptr != nullptr && @@ -788,11 +795,10 @@ bool Anvil::GraphicsPipelineManager::bake() /* Form the viewport state create info descriptor, if needed */ if (!current_pipeline_create_info_ptr->is_rasterizer_discard_enabled() ) { - const auto enabled_dynamic_states = current_pipeline_create_info_ptr->get_enabled_dynamic_states(); - uint32_t n_scissor_boxes = (enabled_dynamic_states & DYNAMIC_STATE_SCISSOR_BIT) ? current_pipeline_create_info_ptr->get_n_dynamic_scissor_boxes() - : current_pipeline_create_info_ptr->get_n_scissor_boxes (); - uint32_t n_viewports = (enabled_dynamic_states & DYNAMIC_STATE_VIEWPORT_BIT) ? current_pipeline_create_info_ptr->get_n_dynamic_viewports () - : current_pipeline_create_info_ptr->get_n_viewports (); + uint32_t n_scissor_boxes = (is_dynamic_scissor_state_enabled) ? current_pipeline_create_info_ptr->get_n_dynamic_scissor_boxes() + : current_pipeline_create_info_ptr->get_n_scissor_boxes (); + uint32_t n_viewports = (is_dynamic_viewport_state_enabled) ? current_pipeline_create_info_ptr->get_n_dynamic_viewports () + : current_pipeline_create_info_ptr->get_n_viewports (); const uint32_t scissor_boxes_start_offset = static_cast(scissor_boxes_vk_cache.size() ); const uint32_t viewports_start_offset = static_cast(viewports_vk_cache.size() ); VkPipelineViewportStateCreateInfo viewport_state_create_info; @@ -837,7 +843,7 @@ bool Anvil::GraphicsPipelineManager::bake() } /* Convert internal scissor box & viewport representations to Vulkan descriptors */ - if ((enabled_dynamic_states & DYNAMIC_STATE_SCISSOR_BIT) == 0) + if (!is_dynamic_scissor_state_enabled) { for (uint32_t n_scissor_box = 0; n_scissor_box < n_scissor_boxes; @@ -863,7 +869,7 @@ bool Anvil::GraphicsPipelineManager::bake() } } - if ((enabled_dynamic_states & DYNAMIC_STATE_VIEWPORT_BIT) == 0) + if (!is_dynamic_viewport_state_enabled) { for (uint32_t n_viewport = 0; n_viewport < n_viewports; @@ -899,10 +905,10 @@ bool Anvil::GraphicsPipelineManager::bake() /* Bake the descriptor */ viewport_state_create_info.flags = 0; viewport_state_create_info.pNext = nullptr; - viewport_state_create_info.pScissors = ((enabled_dynamic_states & DYNAMIC_STATE_SCISSOR_BIT) != 0) ? VK_NULL_HANDLE - : &scissor_boxes_vk_cache.at(scissor_boxes_start_offset); - viewport_state_create_info.pViewports = ((enabled_dynamic_states & DYNAMIC_STATE_VIEWPORT_BIT) != 0) ? VK_NULL_HANDLE - : &viewports_vk_cache.at(viewports_start_offset); + viewport_state_create_info.pScissors = (is_dynamic_scissor_state_enabled) ? VK_NULL_HANDLE + : &scissor_boxes_vk_cache.at(scissor_boxes_start_offset); + viewport_state_create_info.pViewports = (is_dynamic_viewport_state_enabled) ? VK_NULL_HANDLE + : &viewports_vk_cache.at(viewports_start_offset); viewport_state_create_info.scissorCount = n_scissor_boxes; viewport_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO; viewport_state_create_info.viewportCount = n_viewports; @@ -1027,7 +1033,6 @@ bool Anvil::GraphicsPipelineManager::bake() anvil_assert(color_blend_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(depth_stencil_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(dynamic_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(enabled_dynamic_states_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(input_assembly_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(multisample_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(raster_state_create_info_chains_vk_cache.size() <= N_CACHE_ITEMS); @@ -1147,7 +1152,7 @@ void Anvil::GraphicsPipelineManager::GraphicsPipelineData::bake_vk_attributes_an uint32_t current_attribute_location = UINT32_MAX; Anvil::Format current_attribute_format = Anvil::Format::UNKNOWN; uint32_t current_attribute_offset = UINT32_MAX; - VkVertexInputRate current_attribute_rate = VK_VERTEX_INPUT_RATE_MAX_ENUM; + Anvil::VertexInputRate current_attribute_rate = Anvil::VertexInputRate::UNKNOWN; uint32_t current_attribute_stride = UINT32_MAX; VkVertexInputAttributeDescription current_attribute_vk; uint32_t n_attribute_binding = UINT32_MAX; @@ -1198,7 +1203,7 @@ void Anvil::GraphicsPipelineManager::GraphicsPipelineData::bake_vk_attributes_an new_binding_vk.binding = (current_attribute_explicit_vertex_binding_index == UINT32_MAX) ? static_cast(vk_input_bindings.size() ) : current_attribute_explicit_vertex_binding_index; - new_binding_vk.inputRate = current_attribute_rate; + new_binding_vk.inputRate = static_cast(current_attribute_rate); new_binding_vk.stride = current_attribute_stride; new_binding_anvil = VertexInputBinding(new_binding_vk, diff --git a/src/wrappers/image.cpp b/src/wrappers/image.cpp index 49a30394..869a9b82 100644 --- a/src/wrappers/image.cpp +++ b/src/wrappers/image.cpp @@ -74,17 +74,17 @@ Anvil::Image::Image(Anvil::ImageCreateInfoUniquePtr in_create_info_ptr) } /** Please see header for specification */ -void Anvil::Image::change_image_layout(Anvil::Queue* in_queue_ptr, - VkAccessFlags in_src_access_mask, - Anvil::ImageLayout in_src_layout, - VkAccessFlags in_dst_access_mask, - Anvil::ImageLayout in_dst_layout, - const VkImageSubresourceRange& in_subresource_range, - const uint32_t in_opt_n_wait_semaphores, - const VkPipelineStageFlags* in_opt_wait_dst_stage_mask_ptrs, - Anvil::Semaphore* const* in_opt_wait_semaphore_ptrs, - const uint32_t in_opt_n_set_semaphores, - Anvil::Semaphore* const* in_opt_set_semaphore_ptrs) +void Anvil::Image::change_image_layout(Anvil::Queue* in_queue_ptr, + Anvil::AccessFlags in_src_access_mask, + Anvil::ImageLayout in_src_layout, + Anvil::AccessFlags in_dst_access_mask, + Anvil::ImageLayout in_dst_layout, + const Anvil::ImageSubresourceRange& in_subresource_range, + const uint32_t in_opt_n_wait_semaphores, + const Anvil::PipelineStageFlags* in_opt_wait_dst_stage_mask_ptrs, + Anvil::Semaphore* const* in_opt_wait_semaphore_ptrs, + const uint32_t in_opt_n_set_semaphores, + Anvil::Semaphore* const* in_opt_set_semaphore_ptrs) { const Anvil::DeviceType device_type (m_device_ptr->get_type() ); const uint32_t in_queue_family_index (in_queue_ptr->get_queue_family_index() ); @@ -106,7 +106,6 @@ void Anvil::Image::change_image_layout(Anvil::Queue* in_queue_p Anvil::ImageBarrier image_barrier (in_src_access_mask, in_dst_access_mask, - true, /* in_by_region_barrier */ in_src_layout, in_dst_layout, queue_fam_index, @@ -114,9 +113,9 @@ void Anvil::Image::change_image_layout(Anvil::Queue* in_queue_p this, in_subresource_range); - transition_command_buffer_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, - VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, - VK_FALSE, /* in_by_region */ + transition_command_buffer_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::ALL_COMMANDS_BIT, + Anvil::PipelineStageFlagBits::ALL_COMMANDS_BIT, + Anvil::DependencyFlagBits::NONE, 0, /* in_memory_barrier_count */ nullptr, /* in_memory_barrier_ptrs */ 0, /* in_buffer_memory_barrier_count */ @@ -126,7 +125,7 @@ void Anvil::Image::change_image_layout(Anvil::Queue* in_queue_p } transition_command_buffer_ptr->stop_recording(); - if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) + if (device_type == Anvil::DeviceType::SINGLE_GPU) { Anvil::CommandBufferBase* cmd_buffer_ptr = transition_command_buffer_ptr.get(); @@ -196,7 +195,7 @@ Anvil::ImageUniquePtr Anvil::Image::create(Anvil::ImageCreateInfoUniquePtr in_cr result_ptr->init_mipmap_props(); - if (result_ptr->m_create_info_ptr->get_swapchain()->get_create_info_ptr()->get_flags() & VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR) + if ((result_ptr->m_create_info_ptr->get_swapchain()->get_create_info_ptr()->get_flags() & Anvil::SwapchainCreateFlagBits::SPLIT_INSTANCE_BIND_REGIONS_BIT) != 0) { result_ptr->init_sfr_tile_size(); } @@ -254,9 +253,9 @@ bool Anvil::Image::do_sanity_checks_for_physical_device_binding(const Anvil::Mem goto end; } - if (device_type != Anvil::DEVICE_TYPE_MULTI_GPU) + if (device_type != Anvil::DeviceType::MULTI_GPU) { - anvil_assert(device_type == Anvil::DEVICE_TYPE_MULTI_GPU); + anvil_assert(device_type == Anvil::DeviceType::MULTI_GPU); goto end; } @@ -268,9 +267,9 @@ bool Anvil::Image::do_sanity_checks_for_physical_device_binding(const Anvil::Mem goto end; } - if (!(m_device_ptr->get_physical_device_memory_properties().types[memory_block_type_index].flags & VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR)) + if ((m_device_ptr->get_physical_device_memory_properties().types[memory_block_type_index].heap_ptr->flags & Anvil::MemoryHeapFlagBits::MULTI_INSTANCE_BIT_KHR) == 0) { - anvil_assert(m_device_ptr->get_physical_device_memory_properties().types[memory_block_type_index].flags & VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR); + anvil_assert((m_device_ptr->get_physical_device_memory_properties().types[memory_block_type_index].heap_ptr->flags & Anvil::MemoryHeapFlagBits::MULTI_INSTANCE_BIT_KHR) != 0); goto end; } @@ -285,10 +284,10 @@ bool Anvil::Image::do_sanity_checks_for_physical_device_binding(const Anvil::Mem bool Anvil::Image::do_sanity_checks_for_sfr_binding(uint32_t in_n_SFR_rects, const VkRect2D* in_SFRs_ptr) const { - const Anvil::DeviceType device_type (m_device_ptr->get_type() ); - bool result (false); - const VkSparseImageFormatProperties* sparse_image_format_props_ptr(nullptr); - std::vector sparse_image_format_props_vec; + const Anvil::DeviceType device_type (m_device_ptr->get_type() ); + bool result (false); + const Anvil::SparseImageFormatProperties* sparse_image_format_props_ptr(nullptr); + std::vector sparse_image_format_props_vec; anvil_assert(m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SPARSE_NO_ALLOC); anvil_assert(m_mipmaps.size () > 0); @@ -301,9 +300,9 @@ bool Anvil::Image::do_sanity_checks_for_sfr_binding(uint32_t in_n_SFR_rec goto end; } - if (device_type != Anvil::DEVICE_TYPE_MULTI_GPU) + if (device_type != Anvil::DeviceType::MULTI_GPU) { - anvil_assert(device_type == Anvil::DEVICE_TYPE_MULTI_GPU); + anvil_assert(device_type == Anvil::DeviceType::MULTI_GPU); goto end; } @@ -347,16 +346,16 @@ bool Anvil::Image::do_sanity_checks_for_sfr_binding(uint32_t in_n_SFR_rec { const auto& current_rect = in_SFRs_ptr[n_rect]; - if ((current_rect.offset.x % sparse_image_format_props_ptr->imageGranularity.width) != 0 || - (current_rect.offset.y % sparse_image_format_props_ptr->imageGranularity.height) != 0) + if ((current_rect.offset.x % sparse_image_format_props_ptr->image_granularity.width) != 0 || + (current_rect.offset.y % sparse_image_format_props_ptr->image_granularity.height) != 0) { anvil_assert_fail(); goto end; } - if (((current_rect.offset.x + current_rect.extent.width) % sparse_image_format_props_ptr->imageGranularity.width) != 0 && - ((current_rect.offset.x + current_rect.extent.height) % sparse_image_format_props_ptr->imageGranularity.height) != 0) + if (((current_rect.offset.x + current_rect.extent.width) % sparse_image_format_props_ptr->image_granularity.width) != 0 && + ((current_rect.offset.x + current_rect.extent.height) % sparse_image_format_props_ptr->image_granularity.height) != 0) { anvil_assert_fail(); @@ -370,12 +369,12 @@ bool Anvil::Image::do_sanity_checks_for_sfr_binding(uint32_t in_n_SFR_rec } /** Please see header for specification */ -bool Anvil::Image::get_aspect_subresource_layout(Anvil::ImageAspectFlags in_aspect, - uint32_t in_n_layer, - uint32_t in_n_mip, - VkSubresourceLayout* out_subresource_layout_ptr) const +bool Anvil::Image::get_aspect_subresource_layout(Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + uint32_t in_n_mip, + Anvil::SubresourceLayout* out_subresource_layout_ptr) const { - auto aspect_iterator = m_aspects.find(static_cast(in_aspect) ); + auto aspect_iterator = m_aspects.find(in_aspect); bool result = false; anvil_assert(m_create_info_ptr->get_tiling() == Anvil::ImageTiling::LINEAR); @@ -425,7 +424,7 @@ Anvil::MemoryBlock* Anvil::Image::get_memory_block() if (is_sparse) { - if (m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_NONE) + if (m_create_info_ptr->get_residency_scope() == Anvil::SparseResidencyScope::NONE) { anvil_assert(m_page_tracker_ptr != nullptr); @@ -451,7 +450,7 @@ Anvil::MemoryBlock* Anvil::Image::get_memory_block() bool Anvil::Image::init() { std::vector aspects_used; - VkImageCreateFlags image_flags = m_create_info_ptr->get_create_flags(); + Anvil::ImageCreateFlags image_flags = m_create_info_ptr->get_create_flags(); Anvil::ImageFormatProperties image_format_props; const auto memory_features = m_create_info_ptr->get_memory_features(); uint32_t n_queue_family_indices = 0; @@ -461,18 +460,18 @@ bool Anvil::Image::init() Anvil::StructChainer struct_chainer; bool use_dedicated_allocation = false; - if ((memory_features & MEMORY_FEATURE_FLAG_MAPPABLE) == 0) + if ((memory_features & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) == 0) { - anvil_assert((memory_features & MEMORY_FEATURE_FLAG_HOST_COHERENT) == 0); + anvil_assert((memory_features & Anvil::MemoryFeatureFlagBits::HOST_COHERENT_BIT) == 0); } if (m_create_info_ptr->get_mipmaps_to_upload().size() > 0) { - m_create_info_ptr->set_usage_flags(m_create_info_ptr->get_usage_flags() | Anvil::IMAGE_USAGE_FLAG_TRANSFER_DST_BIT); + m_create_info_ptr->set_usage_flags(m_create_info_ptr->get_usage_flags() | Anvil::ImageUsageFlagBits::TRANSFER_DST_BIT); } - if (m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER && - m_create_info_ptr->get_swapchain()->get_create_info_ptr()->get_flags() & VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR) + if ( m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER && + (m_create_info_ptr->get_swapchain()->get_create_info_ptr()->get_flags() & Anvil::SwapchainCreateFlagBits::SPLIT_INSTANCE_BIND_REGIONS_BIT) != 0) { anvil_assert(!m_create_info_ptr->uses_full_mipmap_chain() ); anvil_assert(m_create_info_ptr->get_n_layers () == 1); @@ -519,52 +518,44 @@ bool Anvil::Image::init() } /* If multisample image is requested, make sure the number of samples is supported. */ - anvil_assert(m_create_info_ptr->get_sample_count() >= 1); + anvil_assert(m_create_info_ptr->get_sample_count() >= Anvil::SampleCountFlagBits::_1_BIT); - if (m_create_info_ptr->get_sample_count() > 1) + if (m_create_info_ptr->get_sample_count() > Anvil::SampleCountFlagBits::_1_BIT) { anvil_assert((image_format_props.sample_counts & m_create_info_ptr->get_sample_count() ) != 0); } /* Create the image object */ - if ( (m_create_info_ptr->get_create_flags() & Anvil::IMAGE_CREATE_FLAG_CUBE_COMPATIBLE_BIT) != 0) + if ( (m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::CUBE_COMPATIBLE_BIT) != 0) { anvil_assert(m_create_info_ptr->get_type() == Anvil::ImageType::_2D); anvil_assert((m_create_info_ptr->get_n_layers() % 6) == 0); } - if ( (m_create_info_ptr->get_create_flags() & Anvil::IMAGE_CREATE_FLAG_2D_ARRAY_COMPATIBLE_BIT) != 0) + if ( (m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::_2D_ARRAY_COMPATIBLE_BIT) != 0) { anvil_assert(m_device_ptr->get_extension_info()->khr_maintenance1() ); anvil_assert(m_create_info_ptr->get_type() == Anvil::ImageType::_3D); } - if ( (m_create_info_ptr->get_create_flags() & Anvil::IMAGE_CREATE_FLAG_SPLIT_INSTANCE_BIND_REGIONS_BIT) != 0) + if ( (m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPLIT_INSTANCE_BIND_REGIONS_BIT) != 0) { anvil_assert(m_device_ptr->get_extension_info()->khr_bind_memory2() ); } - if ( (m_create_info_ptr->get_create_flags() & Anvil::IMAGE_CREATE_FLAG_ALIAS_BIT) != 0) + if ( (m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::ALIAS_BIT) != 0) { anvil_assert(m_device_ptr->get_extension_info()->khr_bind_memory2() ); } - if (m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER) - { - if (m_create_info_ptr->get_swapchain()->get_create_info_ptr()->get_flags() & VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR) - { - image_flags |= VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR; - } - } - if (m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::SPARSE_NO_ALLOC) { /* Convert residency scope to Vulkan image create flags */ switch (m_create_info_ptr->get_residency_scope() ) { - case Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED: image_flags |= VK_IMAGE_CREATE_SPARSE_ALIASED_BIT | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | VK_IMAGE_CREATE_SPARSE_BINDING_BIT; break; - case Anvil::SPARSE_RESIDENCY_SCOPE_NONALIASED: image_flags |= VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | VK_IMAGE_CREATE_SPARSE_BINDING_BIT; break; - case Anvil::SPARSE_RESIDENCY_SCOPE_NONE: image_flags |= VK_IMAGE_CREATE_SPARSE_BINDING_BIT; break; + case Anvil::SparseResidencyScope::ALIASED: image_flags |= static_cast(VK_IMAGE_CREATE_SPARSE_ALIASED_BIT | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | VK_IMAGE_CREATE_SPARSE_BINDING_BIT); break; + case Anvil::SparseResidencyScope::NONALIASED: image_flags |= static_cast( VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | VK_IMAGE_CREATE_SPARSE_BINDING_BIT); break; + case Anvil::SparseResidencyScope::NONE: image_flags |= static_cast( VK_IMAGE_CREATE_SPARSE_BINDING_BIT); break; default: { @@ -589,7 +580,7 @@ bool Anvil::Image::init() image_create_info.extent.depth = m_create_info_ptr->get_base_mip_depth (); image_create_info.extent.height = m_create_info_ptr->get_base_mip_height(); image_create_info.extent.width = m_create_info_ptr->get_base_mip_width (); - image_create_info.flags = image_flags; + image_create_info.flags = image_flags.get_vk(); image_create_info.format = static_cast (m_create_info_ptr->get_format () ); image_create_info.imageType = static_cast (m_create_info_ptr->get_type () ); image_create_info.initialLayout = static_cast(m_create_info_ptr->get_post_create_image_layout() ); @@ -601,7 +592,7 @@ bool Anvil::Image::init() image_create_info.sharingMode = static_cast (m_create_info_ptr->get_sharing_mode() ); image_create_info.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; image_create_info.tiling = static_cast(m_create_info_ptr->get_tiling() ); - image_create_info.usage = m_create_info_ptr->get_usage_flags(); + image_create_info.usage = m_create_info_ptr->get_usage_flags().get_vk(); if (m_create_info_ptr->get_external_memory_handle_types() != 0) { @@ -616,7 +607,7 @@ bool Anvil::Image::init() VkExternalMemoryImageCreateInfoKHR external_memory_image_create_info; const auto handle_types = m_create_info_ptr->get_external_memory_handle_types(); - external_memory_image_create_info.handleTypes = Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(handle_types); + external_memory_image_create_info.handleTypes = handle_types.get_vk(); external_memory_image_create_info.pNext = nullptr; external_memory_image_create_info.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR; @@ -704,30 +695,30 @@ bool Anvil::Image::init() for (const auto& current_aspect : aspects_used) { - VkImageSubresource subresource; + Anvil::ImageSubresource subresource; - subresource.aspectMask = current_aspect; + subresource.aspect_mask = current_aspect; for (uint32_t n_layer = 0; n_layer < n_layers; ++n_layer) { - subresource.arrayLayer = n_layer; + subresource.array_layer = n_layer; for (uint32_t n_mip = 0; n_mip < m_n_mipmaps; ++n_mip) { - VkSubresourceLayout subresource_layout; + Anvil::SubresourceLayout subresource_layout; - subresource.mipLevel = n_mip; + subresource.mip_level = n_mip; vkGetImageSubresourceLayout(m_device_ptr->get_device_vk(), m_image, - &subresource, - &subresource_layout); + reinterpret_cast(&subresource), + reinterpret_cast (&subresource_layout) ); - m_aspects[static_cast(current_aspect)][LayerMipKey(n_layer, n_mip)] = subresource_layout; + m_aspects[static_cast(current_aspect.get_vk() )][LayerMipKey(n_layer, n_mip)] = subresource_layout; } } } @@ -736,11 +727,11 @@ bool Anvil::Image::init() /* Initialize mipmap props storage */ init_mipmap_props(); - if (m_create_info_ptr->get_residency_scope() == SPARSE_RESIDENCY_SCOPE_ALIASED || - m_create_info_ptr->get_residency_scope() == SPARSE_RESIDENCY_SCOPE_NONALIASED) + if (m_create_info_ptr->get_residency_scope() == SparseResidencyScope::ALIASED || + m_create_info_ptr->get_residency_scope() == SparseResidencyScope::NONALIASED) { - uint32_t n_reqs = 0; - std::vector sparse_image_memory_reqs; + uint32_t n_reqs = 0; + std::vector sparse_image_memory_reqs; anvil_assert(m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); /* TODO: can images, to which swapchains can be bound, be sparse? */ @@ -797,18 +788,18 @@ bool Anvil::Image::init() vkGetImageSparseMemoryRequirements(m_device_ptr->get_device_vk(), m_image, &n_reqs, - &sparse_image_memory_reqs[0]); + reinterpret_cast(&sparse_image_memory_reqs[0]) ); } for (const auto& image_memory_req : sparse_image_memory_reqs) { for (uint32_t n_bit = 0; - (1u << n_bit) <= image_memory_req.formatProperties.aspectMask; + (1u << n_bit) <= image_memory_req.format_properties.aspect_mask.get_vk(); ++n_bit) { VkImageAspectFlagBits aspect = static_cast(1 << n_bit); - if ((image_memory_req.formatProperties.aspectMask & aspect) == 0) + if ((image_memory_req.format_properties.aspect_mask.get_vk() & aspect) == 0) { continue; } @@ -823,7 +814,7 @@ bool Anvil::Image::init() init_page_occupancy(sparse_image_memory_reqs); } else - if (m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_NONE) + if (m_create_info_ptr->get_residency_scope() == Anvil::SparseResidencyScope::NONE) { m_page_tracker_ptr.reset( new Anvil::PageTracker(m_storage_size, @@ -871,7 +862,7 @@ bool Anvil::Image::init() } /* If the image has been initialized for SFR bindings, calculate & cache SFR tile size */ - if (image_flags & VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT) + if ((image_flags & Anvil::ImageCreateFlagBits::SPLIT_INSTANCE_BIND_REGIONS_BIT) != 0) { init_sfr_tile_size(); } @@ -884,10 +875,10 @@ bool Anvil::Image::init() * * @param memory_reqs Image memory requirements. **/ -void Anvil::Image::init_page_occupancy(const std::vector& in_memory_reqs) +void Anvil::Image::init_page_occupancy(const std::vector& in_memory_reqs) { - anvil_assert(m_create_info_ptr->get_residency_scope() != Anvil::SPARSE_RESIDENCY_SCOPE_NONE && - m_create_info_ptr->get_residency_scope() != Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED); + anvil_assert(m_create_info_ptr->get_residency_scope() != Anvil::SparseResidencyScope::NONE && + m_create_info_ptr->get_residency_scope() != Anvil::SparseResidencyScope::UNKNOWN); /* First, allocate space for an AspectPageOccupancyData instance for all aspects used by the image. * @@ -899,12 +890,12 @@ void Anvil::Image::init_page_occupancy(const std::vector(1 << n_aspect_bit); - if ((memory_req.formatProperties.aspectMask & current_aspect) == 0) + if ((memory_req.format_properties.aspect_mask.get_vk() & current_aspect) == 0) { continue; } @@ -925,12 +916,12 @@ void Anvil::Image::init_page_occupancy(const std::vector(1 << n_aspect_bit); + Anvil::ImageAspectFlagBits current_aspect = static_cast(1 << n_aspect_bit); - if ((memory_req.formatProperties.aspectMask & current_aspect) == 0) + if ((memory_req.format_properties.aspect_mask & current_aspect) == 0) { continue; } @@ -956,7 +947,7 @@ void Anvil::Image::init_page_occupancy(const std::vectorsecond.mip_tail_size > 0) { - const bool is_single_miptail = (current_aspect_props_iterator->second.flags & VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT) != 0; + const bool is_single_miptail = (current_aspect_props_iterator->second.flags & Anvil::SparseImageFormatFlagBits::SINGLE_MIPTAIL_BIT) != 0; if ((is_single_miptail && n_layer == 0) || !is_single_miptail) @@ -1026,9 +1017,9 @@ void Anvil::Image::init_page_occupancy(const std::vector aspects; - uint32_t n_channel_bits[4]; - uint32_t n_bytes_per_texel; + std::vector aspects; + uint32_t n_channel_bits[4]; + uint32_t n_bytes_per_texel; anvil_assert(m_create_info_ptr->get_type() == Anvil::ImageType::_2D); @@ -1266,9 +1257,9 @@ bool Anvil::Image::get_sparse_image_aspect_properties(const Anvil::ImageAspectFl goto end; } - if (m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_NONE) + if (m_create_info_ptr->get_residency_scope() == Anvil::SparseResidencyScope::NONE) { - anvil_assert(m_create_info_ptr->get_residency_scope() != Anvil::SPARSE_RESIDENCY_SCOPE_NONE); + anvil_assert(m_create_info_ptr->get_residency_scope() != Anvil::SparseResidencyScope::NONE); goto end; } @@ -1300,7 +1291,7 @@ VkImageCreateInfo Anvil::Image::get_create_info_for_swapchain(const Anvil::Swapc &result.arrayLayers); result.extent.depth = 1; - result.flags = in_swapchain_ptr->get_create_info_ptr()->get_flags(); + result.flags = in_swapchain_ptr->get_create_info_ptr()->get_flags().get_vk(); result.format = static_cast(in_swapchain_ptr->get_create_info_ptr()->get_format() ); result.imageType = VK_IMAGE_TYPE_2D; result.initialLayout = static_cast(Anvil::ImageLayout::UNDEFINED); @@ -1312,22 +1303,22 @@ VkImageCreateInfo Anvil::Image::get_create_info_for_swapchain(const Anvil::Swapc result.sharingMode = static_cast(in_swapchain_ptr->get_image(0)->get_create_info_ptr()->get_sharing_mode() ); result.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; result.tiling = VK_IMAGE_TILING_OPTIMAL; - result.usage = in_swapchain_ptr->get_image(0)->get_create_info_ptr()->get_usage_flags(); + result.usage = in_swapchain_ptr->get_image(0)->get_create_info_ptr()->get_usage_flags().get_vk(); return result; } /** Please see header for specification */ -VkImageSubresourceRange Anvil::Image::get_subresource_range() const +Anvil::ImageSubresourceRange Anvil::Image::get_subresource_range() const { - VkImageSubresourceRange result; + Anvil::ImageSubresourceRange result; switch (m_create_info_ptr->get_format() ) { case Anvil::Format::D16_UNORM: case Anvil::Format::D32_SFLOAT: { - result.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT; + result.aspect_mask = Anvil::ImageAspectFlagBits::DEPTH_BIT; break; } @@ -1336,42 +1327,42 @@ VkImageSubresourceRange Anvil::Image::get_subresource_range() const case Anvil::Format::D24_UNORM_S8_UINT: case Anvil::Format::D32_SFLOAT_S8_UINT: { - result.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT; + result.aspect_mask = Anvil::ImageAspectFlagBits::DEPTH_BIT | Anvil::ImageAspectFlagBits::STENCIL_BIT; break; } case Anvil::Format::S8_UINT: { - result.aspectMask = VK_IMAGE_ASPECT_STENCIL_BIT; + result.aspect_mask = Anvil::ImageAspectFlagBits::STENCIL_BIT; break; } default: { - result.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + result.aspect_mask = Anvil::ImageAspectFlagBits::COLOR_BIT; break; } } - result.baseArrayLayer = 0; - result.baseMipLevel = 0; - result.layerCount = VK_REMAINING_ARRAY_LAYERS; - result.levelCount = VK_REMAINING_MIP_LEVELS; + result.base_array_layer = 0; + result.base_mip_level = 0; + result.layer_count = VK_REMAINING_ARRAY_LAYERS; + result.level_count = VK_REMAINING_MIP_LEVELS; return result; } /** Please see header for specification */ -bool Anvil::Image::has_aspects(Anvil::ImageAspectFlags in_aspects) const +bool Anvil::Image::has_aspects(const Anvil::ImageAspectFlags& in_aspects) const { - Anvil::ImageAspectFlags checked_aspects = 0; + Anvil::ImageAspectFlags checked_aspects; bool result = true; - if (m_create_info_ptr->get_residency_scope() == SPARSE_RESIDENCY_SCOPE_ALIASED || - m_create_info_ptr->get_residency_scope() == SPARSE_RESIDENCY_SCOPE_NONALIASED) + if (m_create_info_ptr->get_residency_scope() == SparseResidencyScope::ALIASED || + m_create_info_ptr->get_residency_scope() == SparseResidencyScope::NONALIASED) { for (uint32_t n_bit = 0; n_bit < sizeof(uint32_t) * 8 /* bits in byte */ && result; @@ -1395,30 +1386,30 @@ bool Anvil::Image::has_aspects(Anvil::ImageAspectFlags in_aspects) const switch (component_layout) { - case COMPONENT_LAYOUT_ABGR: - case COMPONENT_LAYOUT_ARGB: - case COMPONENT_LAYOUT_BGR: - case COMPONENT_LAYOUT_BGRA: - case COMPONENT_LAYOUT_EBGR: - case COMPONENT_LAYOUT_R: - case COMPONENT_LAYOUT_RG: - case COMPONENT_LAYOUT_RGB: - case COMPONENT_LAYOUT_RGBA: + case ComponentLayout::ABGR: + case ComponentLayout::ARGB: + case ComponentLayout::BGR: + case ComponentLayout::BGRA: + case ComponentLayout::EBGR: + case ComponentLayout::R: + case ComponentLayout::RG: + case ComponentLayout::RGB: + case ComponentLayout::RGBA: { has_color_components = true; break; } - case COMPONENT_LAYOUT_D: - case COMPONENT_LAYOUT_XD: + case ComponentLayout::D: + case ComponentLayout::XD: { has_depth_components = true; break; } - case COMPONENT_LAYOUT_DS: + case ComponentLayout::DS: { has_depth_components = true; has_stencil_components = true; @@ -1426,7 +1417,7 @@ bool Anvil::Image::has_aspects(Anvil::ImageAspectFlags in_aspects) const break; } - case COMPONENT_LAYOUT_S: + case ComponentLayout::S: { has_stencil_components = true; @@ -1439,25 +1430,25 @@ bool Anvil::Image::has_aspects(Anvil::ImageAspectFlags in_aspects) const } } - if (in_aspects & Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_COLOR_BIT) + if ((in_aspects & Anvil::ImageAspectFlagBits::COLOR_BIT) != 0) { result &= has_color_components; - checked_aspects |= Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_COLOR_BIT; + checked_aspects |= Anvil::ImageAspectFlagBits::COLOR_BIT; } - if (result && (in_aspects & Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_DEPTH_BIT) != 0) + if (result && (in_aspects & Anvil::ImageAspectFlagBits::DEPTH_BIT) != 0) { result &= has_depth_components; - checked_aspects |= Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_DEPTH_BIT; + checked_aspects |= Anvil::ImageAspectFlagBits::DEPTH_BIT; } - if (result && (in_aspects & Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_STENCIL_BIT) != 0) + if (result && (in_aspects & Anvil::ImageAspectFlagBits::STENCIL_BIT) != 0) { result &= has_stencil_components; - checked_aspects |= Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_STENCIL_BIT; + checked_aspects |= Anvil::ImageAspectFlagBits::STENCIL_BIT; } anvil_assert(!result || @@ -1524,8 +1515,8 @@ bool Anvil::Image::is_memory_bound_for_texel(Anvil::ImageAspectFlagBits in_aspec bool result = false; /* Sanity checks */ - anvil_assert(m_create_info_ptr->get_residency_scope() == SPARSE_RESIDENCY_SCOPE_ALIASED || - m_create_info_ptr->get_residency_scope() == SPARSE_RESIDENCY_SCOPE_NONALIASED); + anvil_assert(m_create_info_ptr->get_residency_scope() == SparseResidencyScope::ALIASED || + m_create_info_ptr->get_residency_scope() == SparseResidencyScope::NONALIASED); anvil_assert(m_create_info_ptr->get_n_layers () > in_n_layer); anvil_assert(m_n_mipmaps > in_n_mip); @@ -1575,14 +1566,14 @@ void Anvil::Image::on_memory_backing_opaque_update(VkDeviceSize in_resour const bool is_unbinding = (in_memory_block_ptr == nullptr); /* Sanity checks */ - anvil_assert(m_create_info_ptr->get_residency_scope() != Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED); + anvil_assert(m_create_info_ptr->get_residency_scope() != Anvil::SparseResidencyScope::UNKNOWN); if (in_memory_block_ptr != nullptr) { anvil_assert(in_memory_block_ptr->get_create_info_ptr()->get_size() <= in_memory_block_start_offset + in_size); } - if (m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_NONE) + if (m_create_info_ptr->get_residency_scope() == Anvil::SparseResidencyScope::NONE) { /* Non-resident image: underlying memory is viewed as an opaque linear region. */ m_page_tracker_ptr->set_binding(in_memory_block_ptr, @@ -1604,7 +1595,7 @@ void Anvil::Image::on_memory_backing_opaque_update(VkDeviceSize in_resour * by the Image wrapper, so there's nothing we need to do here. */ bool is_miptail_tile_binding_operation = false; - auto metadata_aspect_iterator = m_sparse_aspect_props.find(Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_METADATA_BIT); + auto metadata_aspect_iterator = m_sparse_aspect_props.find(Anvil::ImageAspectFlagBits::METADATA_BIT); if (metadata_aspect_iterator != m_sparse_aspect_props.end() ) { @@ -1729,25 +1720,25 @@ void Anvil::Image::on_memory_backing_opaque_update(VkDeviceSize in_resour * @param in_memory_block_ptr Memory block, bound to the specified region. * @param in_memory_block_start_offset Start offset relative to @param memory_block_ptr used for the update. **/ -void Anvil::Image::on_memory_backing_update(const VkImageSubresource& in_subresource, - VkOffset3D in_offset, - VkExtent3D in_extent, - Anvil::MemoryBlock* in_memory_block_ptr, - VkDeviceSize in_memory_block_start_offset, - bool in_memory_block_owned_by_image) +void Anvil::Image::on_memory_backing_update(const Anvil::ImageSubresource& in_subresource, + VkOffset3D in_offset, + VkExtent3D in_extent, + Anvil::MemoryBlock* in_memory_block_ptr, + VkDeviceSize in_memory_block_start_offset, + bool in_memory_block_owned_by_image) { AspectPageOccupancyLayerData* aspect_layer_ptr; AspectPageOccupancyLayerMipData* aspect_layer_mip_ptr; decltype(m_sparse_aspect_page_occupancy)::iterator aspect_page_occupancy_iterator; decltype(m_sparse_aspect_props)::iterator aspect_props_iterator; - anvil_assert(m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_ALIASED || - m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_NONALIASED); + anvil_assert(m_create_info_ptr->get_residency_scope() == Anvil::SparseResidencyScope::ALIASED || + m_create_info_ptr->get_residency_scope() == Anvil::SparseResidencyScope::NONALIASED); ANVIL_REDUNDANT_ARGUMENT(in_memory_block_start_offset); - if (in_subresource.aspectMask == Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_METADATA_BIT) + if (in_subresource.aspect_mask == Anvil::ImageAspectFlagBits::METADATA_BIT) { /* Metadata is not tracked since it needs to be completely bound in order for the sparse image to be usable. */ anvil_assert_fail(); @@ -1755,8 +1746,8 @@ void Anvil::Image::on_memory_backing_update(const VkImageSubresource& in_subreso return; } - aspect_page_occupancy_iterator = m_sparse_aspect_page_occupancy.find(static_cast(in_subresource.aspectMask) ); - aspect_props_iterator = m_sparse_aspect_props.find (static_cast(in_subresource.aspectMask) ); + aspect_page_occupancy_iterator = m_sparse_aspect_page_occupancy.find(static_cast(in_subresource.aspect_mask.get_vk() ) ); + aspect_props_iterator = m_sparse_aspect_props.find (static_cast(in_subresource.aspect_mask.get_vk() ) ); anvil_assert(aspect_page_occupancy_iterator != m_sparse_aspect_page_occupancy.end() ); anvil_assert(aspect_props_iterator != m_sparse_aspect_props.end() ); @@ -1768,11 +1759,11 @@ void Anvil::Image::on_memory_backing_update(const VkImageSubresource& in_subreso (in_extent.height % aspect_props_iterator->second.granularity.height) == 0 && (in_extent.depth % aspect_props_iterator->second.granularity.depth) == 0); - anvil_assert(aspect_page_occupancy_iterator->second->layers.size() >= in_subresource.arrayLayer); - aspect_layer_ptr = &aspect_page_occupancy_iterator->second->layers.at(in_subresource.arrayLayer); + anvil_assert(aspect_page_occupancy_iterator->second->layers.size() >= in_subresource.array_layer); + aspect_layer_ptr = &aspect_page_occupancy_iterator->second->layers.at(in_subresource.array_layer); - anvil_assert(aspect_layer_ptr->mips.size() > in_subresource.mipLevel); - aspect_layer_mip_ptr = &aspect_layer_ptr->mips.at(in_subresource.mipLevel); + anvil_assert(aspect_layer_ptr->mips.size() > in_subresource.mip_level); + aspect_layer_mip_ptr = &aspect_layer_ptr->mips.at(in_subresource.mip_level); const uint32_t extent_tile[] = { @@ -1962,7 +1953,7 @@ bool Anvil::Image::set_memory_internal(uint32_t in_swapchain_image_index, Anvil::StructChainer struct_chainer; /* Sanity checks */ - anvil_assert(m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED); + anvil_assert(m_create_info_ptr->get_residency_scope() == Anvil::SparseResidencyScope::UNKNOWN); anvil_assert(m_mipmaps.size() == 1); anvil_assert(m_peer_device_indices.size() == 0); anvil_assert(m_peer_sfr_rects.size() == 0); @@ -2081,13 +2072,13 @@ bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, /* Sanity checks */ anvil_assert(in_memory_block_ptr != nullptr); - anvil_assert(m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED); + anvil_assert(m_create_info_ptr->get_residency_scope() == Anvil::SparseResidencyScope::UNKNOWN); anvil_assert(m_mipmaps.size() > 0); anvil_assert(m_memory_blocks_owned.size() == 0); anvil_assert(m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); /* Bind the memory object to the image object */ - if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) + if (device_type == Anvil::DeviceType::SINGLE_GPU) { lock(); { @@ -2103,7 +2094,7 @@ bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, const auto& entrypoints (m_device_ptr->get_extension_khr_bind_memory2_entrypoints() ); Anvil::StructChainer struct_chainer; - anvil_assert(device_type == Anvil::DEVICE_TYPE_MULTI_GPU); + anvil_assert(device_type == Anvil::DeviceType::MULTI_GPU); anvil_assert(m_create_info_ptr->get_mipmaps_to_upload().size() == 0); if (!m_device_ptr->is_extension_enabled(VK_KHR_DEVICE_GROUP_EXTENSION_NAME) ) @@ -2175,18 +2166,18 @@ bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, if (m_create_info_ptr->get_post_alloc_image_layout() != m_create_info_ptr->get_post_create_image_layout() ) { - const uint32_t n_mipmaps_to_upload = static_cast(mips_to_upload.size()); - VkAccessFlags src_access_mask = 0; + const uint32_t n_mipmaps_to_upload = static_cast(mips_to_upload.size()); + Anvil::AccessFlags src_access_mask; if (n_mipmaps_to_upload > 0) { if (tiling == Anvil::ImageTiling::LINEAR) { - src_access_mask = VK_ACCESS_HOST_WRITE_BIT; + src_access_mask = Anvil::AccessFlagBits::HOST_WRITE_BIT; } else { - src_access_mask = VK_ACCESS_TRANSFER_WRITE_BIT; + src_access_mask = Anvil::AccessFlagBits::TRANSFER_WRITE_BIT; } } @@ -2212,7 +2203,7 @@ bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, /* Sanity checks */ anvil_assert(in_memory_block_ptr != nullptr); - anvil_assert(m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED); + anvil_assert(m_create_info_ptr->get_residency_scope() == Anvil::SparseResidencyScope::UNKNOWN); anvil_assert(m_mipmaps.size() > 0); anvil_assert(m_memory_blocks_owned.size() == 0); anvil_assert(m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); @@ -2445,7 +2436,7 @@ bool Anvil::Image::set_memory_multi(uint32_t in_n_ima return is_vk_call_successful(result); } -void Anvil::Image::transition_to_post_alloc_image_layout(VkAccessFlags in_source_access_mask, +void Anvil::Image::transition_to_post_alloc_image_layout(Anvil::AccessFlags in_source_access_mask, Anvil::ImageLayout in_src_layout) { const auto post_alloc_layout = m_create_info_ptr->get_post_alloc_image_layout(); @@ -2468,8 +2459,8 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p Anvil::ImageLayout* out_new_image_layout_ptr) { std::map > image_aspect_to_mipmap_raw_data_map; - Anvil::ImageAspectFlags image_aspects_touched (0); - VkImageSubresourceRange image_subresource_range; + Anvil::ImageAspectFlags image_aspects_touched; + Anvil::ImageSubresourceRange image_subresource_range; const VkDeviceSize sparse_page_size ( (m_page_tracker_ptr != nullptr) ? m_page_tracker_ptr->get_page_size() : 0); Anvil::Queue* universal_queue_ptr (m_device_ptr->get_universal_queue(0) ); @@ -2498,11 +2489,11 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p * For optimal tiling, we need to copy the raw data to temporary buffer * and use vkCmdCopyBufferToImage() to let the driver rearrange the data as needed. */ - image_subresource_range.aspectMask = image_aspects_touched; - image_subresource_range.baseArrayLayer = 0; - image_subresource_range.baseMipLevel = 0; - image_subresource_range.layerCount = m_create_info_ptr->get_n_layers(); - image_subresource_range.levelCount = m_n_mipmaps; + image_subresource_range.aspect_mask = image_aspects_touched; + image_subresource_range.base_array_layer = 0; + image_subresource_range.base_mip_level = 0; + image_subresource_range.layer_count = m_create_info_ptr->get_n_layers(); + image_subresource_range.level_count = m_n_mipmaps; if (m_create_info_ptr->get_tiling() == Anvil::ImageTiling::LINEAR) { @@ -2520,29 +2511,29 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p mipmap_raw_data_item_iterator != mipmap_raw_data_items.end(); ++mipmap_raw_data_item_iterator) { - const unsigned char* current_mipmap_data_ptr = nullptr; - uint32_t current_mipmap_height = 0; - const auto& current_mipmap_raw_data_item_ptr = *mipmap_raw_data_item_iterator; - uint32_t current_mipmap_slices = 0; - uint32_t current_row_size = 0; - uint32_t current_slice_size = 0; - VkDeviceSize dst_slice_offset = 0; - const unsigned char* src_slice_ptr = nullptr; - VkImageSubresource image_subresource; - VkSubresourceLayout image_subresource_layout; + const unsigned char* current_mipmap_data_ptr = nullptr; + uint32_t current_mipmap_height = 0; + const auto& current_mipmap_raw_data_item_ptr = *mipmap_raw_data_item_iterator; + uint32_t current_mipmap_slices = 0; + uint32_t current_row_size = 0; + uint32_t current_slice_size = 0; + VkDeviceSize dst_slice_offset = 0; + const unsigned char* src_slice_ptr = nullptr; + Anvil::ImageSubresource image_subresource; + Anvil::SubresourceLayout image_subresource_layout; current_mipmap_data_ptr = (current_mipmap_raw_data_item_ptr->linear_tightly_packed_data_uchar_ptr != nullptr) ? current_mipmap_raw_data_item_ptr->linear_tightly_packed_data_uchar_ptr.get() : (current_mipmap_raw_data_item_ptr->linear_tightly_packed_data_uchar_raw_ptr != nullptr) ? current_mipmap_raw_data_item_ptr->linear_tightly_packed_data_uchar_raw_ptr : &(*current_mipmap_raw_data_item_ptr->linear_tightly_packed_data_uchar_vec_ptr)[0]; - image_subresource.arrayLayer = current_mipmap_raw_data_item_ptr->n_layer; - image_subresource.aspectMask = current_aspect; - image_subresource.mipLevel = current_mipmap_raw_data_item_ptr->n_mipmap; + image_subresource.array_layer = current_mipmap_raw_data_item_ptr->n_layer; + image_subresource.aspect_mask = current_aspect; + image_subresource.mip_level = current_mipmap_raw_data_item_ptr->n_mipmap; vkGetImageSubresourceLayout(m_device_ptr->get_device_vk(), m_image, - &image_subresource, - &image_subresource_layout); + reinterpret_cast(&image_subresource), + reinterpret_cast (&image_subresource_layout) ); /* Determine row size for the mipmap. * @@ -2572,26 +2563,26 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p n_slice < current_mipmap_slices; ++n_slice) { - dst_slice_offset = image_subresource_layout.offset + - image_subresource_layout.depthPitch * n_slice; - src_slice_ptr = current_mipmap_data_ptr + - current_slice_size * n_slice; + dst_slice_offset = image_subresource_layout.offset + + image_subresource_layout.depth_pitch * n_slice; + src_slice_ptr = current_mipmap_data_ptr + + current_slice_size * n_slice; for (unsigned int n_row = 0; n_row < current_mipmap_height; - ++n_row, dst_slice_offset += image_subresource_layout.rowPitch) + ++n_row, dst_slice_offset += image_subresource_layout.row_pitch) { Anvil::MemoryBlock* mem_block_ptr = nullptr; VkDeviceSize write_dst_slice_offset = dst_slice_offset; - if (m_create_info_ptr->get_residency_scope() == Anvil::SPARSE_RESIDENCY_SCOPE_UNDEFINED) + if (m_create_info_ptr->get_residency_scope() == Anvil::SparseResidencyScope::UNKNOWN) { anvil_assert(m_memory_blocks_owned.size() == 1); mem_block_ptr = m_memory_blocks_owned.at(0).get(); } else - if (m_create_info_ptr->get_residency_scope() == SPARSE_RESIDENCY_SCOPE_NONE) + if (m_create_info_ptr->get_residency_scope() == SparseResidencyScope::NONE) { const VkDeviceSize dst_slice_offset_page_aligned = Anvil::Utils::round_down(dst_slice_offset, sparse_page_size); @@ -2605,7 +2596,7 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p &memory_region_start_offset); anvil_assert(mem_block_ptr != nullptr); - if (dst_slice_offset + image_subresource_layout.rowPitch > dst_slice_offset_page_aligned + sparse_page_size) + if (dst_slice_offset + image_subresource_layout.row_pitch > dst_slice_offset_page_aligned + sparse_page_size) { VkDeviceSize dummy; auto mem_block2_ptr = m_page_tracker_ptr->get_memory_block(dst_slice_offset_page_aligned + sparse_page_size, @@ -2711,10 +2702,10 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p { auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr, total_raw_mips_size, - Anvil::QUEUE_FAMILY_GRAPHICS_BIT, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::SharingMode::EXCLUSIVE, - Anvil::BUFFER_USAGE_FLAG_TRANSFER_SRC_BIT, - 0); /* in_memory_features */ + Anvil::BufferUsageFlagBits::TRANSFER_SRC_BIT, + Anvil::MemoryFeatureFlagBits::NONE); create_info_ptr->set_client_data(merged_mip_storage.get() ); create_info_ptr->set_mt_safety (Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() )); @@ -2731,7 +2722,7 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p temp_cmdbuf_ptr->start_recording(true, /* one_time_submit */ false /* simultaneous_use_allowed */); { - std::vector copy_regions; + std::vector copy_regions; /* Transfer the image to the transfer_destination layout if not already in this or general layout */ if (in_current_image_layout != Anvil::ImageLayout::GENERAL && @@ -2740,9 +2731,8 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p const auto sharing_mode (m_create_info_ptr->get_sharing_mode() ); const auto queue_fam_index((sharing_mode == Anvil::SharingMode::EXCLUSIVE) ? universal_queue_ptr->get_queue_family_index() : VK_QUEUE_FAMILY_IGNORED); - Anvil::ImageBarrier image_barrier (0, /* source_access_mask */ - VK_ACCESS_TRANSFER_WRITE_BIT, - false, + Anvil::ImageBarrier image_barrier (Anvil::AccessFlagBits::NONE, /* source_access_mask */ + Anvil::AccessFlagBits::TRANSFER_WRITE_BIT, in_current_image_layout, Anvil::ImageLayout::TRANSFER_DST_OPTIMAL, queue_fam_index, @@ -2750,9 +2740,9 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p this, image_subresource_range); - temp_cmdbuf_ptr->record_pipeline_barrier(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, - VK_PIPELINE_STAGE_TRANSFER_BIT, - VK_FALSE, /* in_by_region */ + temp_cmdbuf_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::TOP_OF_PIPE_BIT, + Anvil::PipelineStageFlagBits::TRANSFER_BIT, + Anvil::DependencyFlagBits::NONE, 0, /* in_memory_barrier_count */ nullptr, /* in_memory_barrier_ptrs */ 0, /* in_buffer_memory_barrier_count */ @@ -2774,37 +2764,37 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p mipmap_iterator != in_mipmaps_ptr->cend(); ++mipmap_iterator) { - const auto base_mip_width = m_create_info_ptr->get_base_mip_width (); - VkBufferImageCopy current_copy_region; - const auto& current_mipmap = *mipmap_iterator; - - current_copy_region.bufferImageHeight = std::max(base_mip_height / (1 << current_mipmap.n_mipmap), 1u); - current_copy_region.bufferOffset = mip_data_offsets[static_cast(mipmap_iterator - in_mipmaps_ptr->cbegin()) ]; - current_copy_region.bufferRowLength = 0; - current_copy_region.imageOffset.x = 0; - current_copy_region.imageOffset.y = 0; - current_copy_region.imageOffset.z = 0; - current_copy_region.imageSubresource.baseArrayLayer = current_mipmap.n_layer; - current_copy_region.imageSubresource.layerCount = current_mipmap.n_layers; - current_copy_region.imageSubresource.aspectMask = current_mipmap.aspect; - current_copy_region.imageSubresource.mipLevel = current_mipmap.n_mipmap; - current_copy_region.imageExtent.depth = current_mipmap.n_slices; - current_copy_region.imageExtent.height = std::max(base_mip_height / (1 << current_mipmap.n_mipmap), 1u); - current_copy_region.imageExtent.width = std::max(base_mip_width / (1 << current_mipmap.n_mipmap), 1u); - - if (current_copy_region.imageExtent.depth < 1) + const auto base_mip_width = m_create_info_ptr->get_base_mip_width (); + Anvil::BufferImageCopy current_copy_region; + const auto& current_mipmap = *mipmap_iterator; + + current_copy_region.buffer_image_height = std::max(base_mip_height / (1 << current_mipmap.n_mipmap), 1u); + current_copy_region.buffer_offset = mip_data_offsets[static_cast(mipmap_iterator - in_mipmaps_ptr->cbegin()) ]; + current_copy_region.buffer_row_length = 0; + current_copy_region.image_offset.x = 0; + current_copy_region.image_offset.y = 0; + current_copy_region.image_offset.z = 0; + current_copy_region.image_subresource.base_array_layer = current_mipmap.n_layer; + current_copy_region.image_subresource.layer_count = current_mipmap.n_layers; + current_copy_region.image_subresource.aspect_mask = current_mipmap.aspect; + current_copy_region.image_subresource.mip_level = current_mipmap.n_mipmap; + current_copy_region.image_extent.depth = current_mipmap.n_slices; + current_copy_region.image_extent.height = std::max(base_mip_height / (1 << current_mipmap.n_mipmap), 1u); + current_copy_region.image_extent.width = std::max(base_mip_width / (1 << current_mipmap.n_mipmap), 1u); + + if (current_copy_region.image_extent.depth < 1) { - current_copy_region.imageExtent.depth = 1; + current_copy_region.image_extent.depth = 1; } - if (current_copy_region.imageExtent.height < 1) + if (current_copy_region.image_extent.height < 1) { - current_copy_region.imageExtent.height = 1; + current_copy_region.image_extent.height = 1; } - if (current_copy_region.imageExtent.width < 1) + if (current_copy_region.image_extent.width < 1) { - current_copy_region.imageExtent.width = 1; + current_copy_region.image_extent.width = 1; } copy_regions.push_back(current_copy_region); diff --git a/src/wrappers/image_view.cpp b/src/wrappers/image_view.cpp index 41b93960..c3e2e5f8 100644 --- a/src/wrappers/image_view.cpp +++ b/src/wrappers/image_view.cpp @@ -103,13 +103,13 @@ void Anvil::ImageView::get_base_mipmap_size(uint32_t* out_opt_base_mipmap_width_ switch (m_create_info_ptr->get_type() ) { - case VK_IMAGE_VIEW_TYPE_1D: result_depth = 1; break; - case VK_IMAGE_VIEW_TYPE_1D_ARRAY: result_depth = m_create_info_ptr->get_n_layers(); break; - case VK_IMAGE_VIEW_TYPE_2D: result_depth = 1; break; - case VK_IMAGE_VIEW_TYPE_2D_ARRAY: result_depth = m_create_info_ptr->get_n_layers(); break; - case VK_IMAGE_VIEW_TYPE_3D: result_depth = m_create_info_ptr->get_n_slices(); break; - case VK_IMAGE_VIEW_TYPE_CUBE: result_depth = m_create_info_ptr->get_n_layers(); break; - case VK_IMAGE_VIEW_TYPE_CUBE_ARRAY: result_depth = m_create_info_ptr->get_n_layers(); break; + case Anvil::ImageViewType::_1D: result_depth = 1; break; + case Anvil::ImageViewType::_1D_ARRAY: result_depth = m_create_info_ptr->get_n_layers(); break; + case Anvil::ImageViewType::_2D: result_depth = 1; break; + case Anvil::ImageViewType::_2D_ARRAY: result_depth = m_create_info_ptr->get_n_layers(); break; + case Anvil::ImageViewType::_3D: result_depth = m_create_info_ptr->get_n_slices(); break; + case Anvil::ImageViewType::_CUBE: result_depth = m_create_info_ptr->get_n_layers(); break; + case Anvil::ImageViewType::_CUBE_ARRAY: result_depth = m_create_info_ptr->get_n_layers(); break; default: { @@ -123,15 +123,15 @@ void Anvil::ImageView::get_base_mipmap_size(uint32_t* out_opt_base_mipmap_width_ } } -VkImageSubresourceRange Anvil::ImageView::get_subresource_range() const +Anvil::ImageSubresourceRange Anvil::ImageView::get_subresource_range() const { - VkImageSubresourceRange result; + Anvil::ImageSubresourceRange result; - result.aspectMask = m_create_info_ptr->get_aspect (); - result.baseArrayLayer = m_create_info_ptr->get_base_layer (); - result.baseMipLevel = m_create_info_ptr->get_base_mipmap_level(); - result.layerCount = m_create_info_ptr->get_n_layers (); - result.levelCount = m_create_info_ptr->get_n_mipmaps (); + result.aspect_mask = m_create_info_ptr->get_aspect (); + result.base_array_layer = m_create_info_ptr->get_base_layer (); + result.base_mip_level = m_create_info_ptr->get_base_mipmap_level(); + result.layer_count = m_create_info_ptr->get_n_layers (); + result.level_count = m_create_info_ptr->get_n_mipmaps (); return result; } @@ -189,7 +189,7 @@ bool Anvil::ImageView::init() goto end; } - if (usage != Anvil::ImageUsageFlagBits::IMAGE_USAGE_UNKNOWN && + if (usage != Anvil::ImageUsageFlagBits::NONE && !m_device_ptr->is_extension_enabled(VK_KHR_MAINTENANCE2_EXTENSION_NAME) ) { anvil_assert(m_device_ptr->is_extension_enabled(VK_KHR_MAINTENANCE2_EXTENSION_NAME) ); @@ -199,8 +199,8 @@ bool Anvil::ImageView::init() if (parent_image_ptr->get_create_info_ptr()->get_type() == Anvil::ImageType::_3D) { - if (image_view_type == VK_IMAGE_VIEW_TYPE_2D || - image_view_type == VK_IMAGE_VIEW_TYPE_2D_ARRAY) + if (image_view_type == Anvil::ImageViewType::_2D || + image_view_type == Anvil::ImageViewType::_2D_ARRAY) { if (!m_device_ptr->get_extension_info()->khr_maintenance1() ) { @@ -209,9 +209,9 @@ bool Anvil::ImageView::init() goto end; } - if ((parent_image_ptr->get_create_info_ptr()->get_create_flags() & Anvil::IMAGE_CREATE_FLAG_2D_ARRAY_COMPATIBLE_BIT) == 0) + if ((parent_image_ptr->get_create_info_ptr()->get_create_flags() & Anvil::ImageCreateFlagBits::_2D_ARRAY_COMPATIBLE_BIT) == 0) { - anvil_assert((parent_image_ptr->get_create_info_ptr()->get_create_flags() & Anvil::IMAGE_CREATE_FLAG_2D_ARRAY_COMPATIBLE_BIT) != 0); + anvil_assert((parent_image_ptr->get_create_info_ptr()->get_create_flags() & Anvil::ImageCreateFlagBits::_2D_ARRAY_COMPATIBLE_BIT) != 0); goto end; } @@ -231,23 +231,23 @@ bool Anvil::ImageView::init() image_view_create_info.image = parent_image_ptr->get_image(); image_view_create_info.pNext = nullptr; image_view_create_info.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; - image_view_create_info.subresourceRange.aspectMask = aspect_mask; + image_view_create_info.subresourceRange.aspectMask = aspect_mask.get_vk(); image_view_create_info.subresourceRange.baseArrayLayer = n_base_layer; image_view_create_info.subresourceRange.baseMipLevel = n_base_mip; image_view_create_info.subresourceRange.layerCount = n_layers; image_view_create_info.subresourceRange.levelCount = n_mips; - image_view_create_info.viewType = image_view_type; + image_view_create_info.viewType = static_cast(image_view_type); struct_chainer.append_struct(image_view_create_info); } - if (usage != Anvil::ImageUsageFlagBits::IMAGE_USAGE_UNKNOWN) + if (usage != Anvil::ImageUsageFlagBits::NONE) { VkImageViewUsageCreateInfo usage_create_info; usage_create_info.pNext = nullptr; usage_create_info.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO_KHR; - usage_create_info.usage = static_cast(usage); + usage_create_info.usage = usage.get_vk(); struct_chainer.append_struct(usage_create_info); } @@ -290,18 +290,18 @@ bool Anvil::ImageView::intersects(const Anvil::ImageView* in_image_view_ptr) con auto this_subresource_range = get_subresource_range(); /* Aspect mask */ - if ((this_subresource_range.aspectMask & in_subresource_range.aspectMask) != 0) + if ((this_subresource_range.aspect_mask & in_subresource_range.aspect_mask) != 0) { /* Layers + mips */ - if (!((this_subresource_range.baseArrayLayer < in_subresource_range.baseArrayLayer && - this_subresource_range.baseArrayLayer + this_subresource_range.layerCount < in_subresource_range.baseArrayLayer) || - (in_subresource_range.baseArrayLayer < this_subresource_range.baseArrayLayer && - in_subresource_range.baseArrayLayer + in_subresource_range.layerCount < this_subresource_range.baseArrayLayer) )) + if (!((this_subresource_range.base_array_layer < in_subresource_range.base_array_layer && + this_subresource_range.base_array_layer + this_subresource_range.layer_count < in_subresource_range.base_array_layer) || + (in_subresource_range.base_array_layer < this_subresource_range.base_array_layer && + in_subresource_range.base_array_layer + in_subresource_range.layer_count < this_subresource_range.base_array_layer) )) { - if (!((this_subresource_range.baseMipLevel < in_subresource_range.baseMipLevel && - this_subresource_range.baseMipLevel + this_subresource_range.levelCount < in_subresource_range.baseMipLevel) || - (in_subresource_range.baseMipLevel < this_subresource_range.baseMipLevel && - in_subresource_range.baseMipLevel + in_subresource_range.levelCount < this_subresource_range.baseMipLevel) )) + if (!((this_subresource_range.base_mip_level < in_subresource_range.base_mip_level && + this_subresource_range.base_mip_level + this_subresource_range.level_count < in_subresource_range.base_mip_level) || + (in_subresource_range.base_mip_level < this_subresource_range.base_mip_level && + in_subresource_range.base_mip_level + in_subresource_range.level_count < this_subresource_range.base_mip_level) )) { result = true; } diff --git a/src/wrappers/memory_block.cpp b/src/wrappers/memory_block.cpp index 2f030837..6c56faa4 100644 --- a/src/wrappers/memory_block.cpp +++ b/src/wrappers/memory_block.cpp @@ -169,7 +169,7 @@ Anvil::MemoryBlockUniquePtr Anvil::MemoryBlock::create(Anvil::MemoryBlockCreateI return result_ptr; } -Anvil::ExternalHandleUniquePtr Anvil::MemoryBlock::export_to_external_memory_handle(const Anvil::ExternalMemoryHandleTypeBit& in_memory_handle_type) +Anvil::ExternalHandleUniquePtr Anvil::MemoryBlock::export_to_external_memory_handle(const Anvil::ExternalMemoryHandleTypeFlagBits& in_memory_handle_type) { #if defined(_WIN32) const auto invalid_handle = nullptr; @@ -252,7 +252,7 @@ Anvil::ExternalHandleUniquePtr Anvil::MemoryBlock::export_to_external_memory_han anvil_assert(memory != VK_NULL_HANDLE); - info.handleType = static_cast(Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(in_memory_handle_type) ); + info.handleType = static_cast(in_memory_handle_type); info.memory = memory; info.pNext = nullptr; @@ -320,12 +320,12 @@ Anvil::ExternalHandleUniquePtr Anvil::MemoryBlock::export_to_external_memory_han uint32_t Anvil::MemoryBlock::get_device_memory_type_index(uint32_t in_memory_type_bits, Anvil::MemoryFeatureFlags in_memory_features) { - const bool is_coherent_memory_required ((in_memory_features & MEMORY_FEATURE_FLAG_HOST_COHERENT) != 0); - const bool is_device_local_memory_required ((in_memory_features & MEMORY_FEATURE_FLAG_DEVICE_LOCAL) != 0); - const bool is_host_cached_memory_required ((in_memory_features & MEMORY_FEATURE_FLAG_HOST_CACHED) != 0); - const bool is_lazily_allocated_memory_required((in_memory_features & MEMORY_FEATURE_FLAG_LAZILY_ALLOCATED) != 0); - const bool is_mappable_memory_required ((in_memory_features & MEMORY_FEATURE_FLAG_MAPPABLE) != 0); - const bool is_multi_instance_memory_required ((in_memory_features & MEMORY_FEATURE_FLAG_MULTI_INSTANCE) != 0); + const bool is_coherent_memory_required ((in_memory_features & Anvil::MemoryFeatureFlagBits::HOST_COHERENT_BIT) != 0); + const bool is_device_local_memory_required ((in_memory_features & Anvil::MemoryFeatureFlagBits::DEVICE_LOCAL_BIT) != 0); + const bool is_host_cached_memory_required ((in_memory_features & Anvil::MemoryFeatureFlagBits::HOST_CACHED_BIT) != 0); + const bool is_lazily_allocated_memory_required((in_memory_features & Anvil::MemoryFeatureFlagBits::LAZILY_ALLOCATED_BIT) != 0); + const bool is_mappable_memory_required ((in_memory_features & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) != 0); + const bool is_multi_instance_memory_required ((in_memory_features & Anvil::MemoryFeatureFlagBits::MULTI_INSTANCE_BIT) != 0); const Anvil::MemoryTypes& memory_types (get_create_info_ptr()->get_device()->get_physical_device_memory_properties().types); if (!is_mappable_memory_required) @@ -342,18 +342,18 @@ uint32_t Anvil::MemoryBlock::get_device_memory_type_index(uint32_t { const Anvil::MemoryType& current_memory_type = memory_types[n_memory_type]; - if (((is_coherent_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)) || - !is_coherent_memory_required) && - ((is_device_local_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) || - !is_device_local_memory_required) && - ((is_host_cached_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT)) || - !is_host_cached_memory_required) && - ((is_lazily_allocated_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT)) || - !is_lazily_allocated_memory_required) && - ((is_mappable_memory_required && (current_memory_type.flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)) || - !is_mappable_memory_required) && - (!is_multi_instance_memory_required || - (is_multi_instance_memory_required && (current_memory_type.heap_ptr->flags & VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR)))) + if (((is_coherent_memory_required && ((current_memory_type.flags & Anvil::MemoryPropertyFlagBits::HOST_COHERENT_BIT)) != 0) || + !is_coherent_memory_required) && + ((is_device_local_memory_required && ((current_memory_type.flags & Anvil::MemoryPropertyFlagBits::DEVICE_LOCAL_BIT)) != 0) || + !is_device_local_memory_required) && + ((is_host_cached_memory_required && ((current_memory_type.flags & Anvil::MemoryPropertyFlagBits::HOST_CACHED_BIT)) != 0) || + !is_host_cached_memory_required) && + ((is_lazily_allocated_memory_required && ((current_memory_type.flags & Anvil::MemoryPropertyFlagBits::LAZILY_ALLOCATED_BIT)) != 0) || + !is_lazily_allocated_memory_required) && + ((is_mappable_memory_required && ((current_memory_type.flags & Anvil::MemoryPropertyFlagBits::HOST_VISIBLE_BIT)) != 0) || + !is_mappable_memory_required) && + (!is_multi_instance_memory_required || + (is_multi_instance_memory_required && ((current_memory_type.heap_ptr->flags & Anvil::MemoryHeapFlagBits::MULTI_INSTANCE_BIT_KHR) != 0))) ) { if ( (in_memory_type_bits & (1 << n_memory_type)) != 0) { @@ -379,10 +379,10 @@ bool Anvil::MemoryBlock::init() VkMemoryAllocateInfo mem_alloc_info; mem_alloc_info.allocationSize = m_create_info_ptr->get_size(); - mem_alloc_info.memoryTypeIndex = (m_create_info_ptr->get_imported_external_memory_handle_type() != 0) ? m_create_info_ptr->get_memory_type_index() - : (m_create_info_ptr->get_type () != Anvil::MemoryBlockType::REGULAR) ? m_create_info_ptr->get_memory_type_index() - : get_device_memory_type_index (m_create_info_ptr->get_allowed_memory_bits(), - m_create_info_ptr->get_memory_features () ); + mem_alloc_info.memoryTypeIndex = (m_create_info_ptr->get_imported_external_memory_handle_type() != Anvil::ExternalMemoryHandleTypeFlagBits::NONE) ? m_create_info_ptr->get_memory_type_index() + : (m_create_info_ptr->get_type () != Anvil::MemoryBlockType::REGULAR) ? m_create_info_ptr->get_memory_type_index() + : get_device_memory_type_index (m_create_info_ptr->get_allowed_memory_bits(), + m_create_info_ptr->get_memory_features () ); mem_alloc_info.pNext = nullptr; mem_alloc_info.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO; @@ -416,11 +416,11 @@ bool Anvil::MemoryBlock::init() } } - if (m_create_info_ptr->get_exportable_external_memory_handle_types() != Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE) + if (m_create_info_ptr->get_exportable_external_memory_handle_types() != Anvil::ExternalMemoryHandleTypeFlagBits::NONE) { VkExportMemoryAllocateInfoKHR export_memory_alloc_info; - export_memory_alloc_info.handleTypes = Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(m_create_info_ptr->get_exportable_external_memory_handle_types() ); + export_memory_alloc_info.handleTypes = m_create_info_ptr->get_exportable_external_memory_handle_types().get_vk(); export_memory_alloc_info.pNext = nullptr; export_memory_alloc_info.sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR; @@ -458,7 +458,7 @@ bool Anvil::MemoryBlock::init() VkImportMemoryFdInfoKHR handle_info_khr; #endif - handle_info_khr.handleType = static_cast(Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(static_cast(m_create_info_ptr->get_imported_external_memory_handle_type() )) ); + handle_info_khr.handleType = static_cast(m_create_info_ptr->get_imported_external_memory_handle_type() ); handle_info_khr.pNext = nullptr; #if defined(_WIN32) @@ -475,15 +475,15 @@ bool Anvil::MemoryBlock::init() } } - if (m_create_info_ptr->get_device_mask() != 0 && - m_create_info_ptr->get_device()->get_type() == Anvil::DeviceType::DEVICE_TYPE_MULTI_GPU) + if (m_create_info_ptr->get_device_mask() != 0 && + m_create_info_ptr->get_device()->get_type() == Anvil::DeviceType::MULTI_GPU) { VkMemoryAllocateFlagsInfoKHR alloc_info_khr; alloc_info_khr.deviceMask = m_create_info_ptr->get_device_mask(); /* NOTE: Host-mappable memory must not be multi-instance heap and must exist on only one device. */ - if (((m_create_info_ptr->get_memory_features() & Anvil::MEMORY_FEATURE_FLAG_MAPPABLE) != 0) && + if (((m_create_info_ptr->get_memory_features() & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) != 0) && (Utils::count_set_bits(alloc_info_khr.deviceMask) > 1) ) { alloc_info_khr.flags = 0; @@ -569,7 +569,7 @@ bool Anvil::MemoryBlock::map(VkDeviceSize in_start_offset, goto end; } - if ((memory_features & Anvil::MEMORY_FEATURE_FLAG_HOST_COHERENT) == 0) + if ((memory_features & Anvil::MemoryFeatureFlagBits::HOST_COHERENT_BIT) == 0) { /* Make sure the mapped region is invalidated before letting the user read from it */ VkMappedMemoryRange mapped_memory_range; @@ -617,9 +617,9 @@ bool Anvil::MemoryBlock::open_gpu_memory_access() /* Sanity checks */ anvil_assert(m_create_info_ptr->get_parent_memory_block() == nullptr); - if ((memory_features & Anvil::MEMORY_FEATURE_FLAG_MAPPABLE) == 0) + if ((memory_features & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) == 0) { - anvil_assert((memory_features & Anvil::MEMORY_FEATURE_FLAG_MAPPABLE) != 0); + anvil_assert((memory_features & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) != 0); goto end; } @@ -687,7 +687,7 @@ bool Anvil::MemoryBlock::read(VkDeviceSize in_start_offset, goto end; } - if ((m_create_info_ptr->get_memory_features() & Anvil::MEMORY_FEATURE_FLAG_HOST_COHERENT) == 0) + if ((m_create_info_ptr->get_memory_features() & Anvil::MemoryFeatureFlagBits::HOST_COHERENT_BIT) == 0) { VkMappedMemoryRange mapped_memory_range; const auto mem_block_size = m_create_info_ptr->get_size(); @@ -786,7 +786,7 @@ bool Anvil::MemoryBlock::write(VkDeviceSize in_start_offset, in_data, static_cast(in_size)); - if ((m_create_info_ptr->get_memory_features() & Anvil::MEMORY_FEATURE_FLAG_HOST_COHERENT) == 0) + if ((m_create_info_ptr->get_memory_features() & Anvil::MemoryFeatureFlagBits::HOST_COHERENT_BIT) == 0) { VkMappedMemoryRange mapped_memory_range; const auto mem_block_size = m_create_info_ptr->get_size(); diff --git a/src/wrappers/physical_device.cpp b/src/wrappers/physical_device.cpp index d84f0fa7..56d9ceca 100644 --- a/src/wrappers/physical_device.cpp +++ b/src/wrappers/physical_device.cpp @@ -605,11 +605,11 @@ bool Anvil::PhysicalDevice::get_buffer_properties(const Anvil::BufferPropertiesQ emc_entrypoints_ptr = &m_instance_ptr->get_extension_khr_external_memory_capabilities_entrypoints(); } - input_struct.flags = Anvil::Utils::convert_buffer_create_flags_to_vk_buffer_create_flags(in_query.create_flags); - input_struct.handleType = static_cast(Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(in_query.external_memory_handle_type) ); + input_struct.flags = in_query.create_flags.get_vk(); + input_struct.handleType = static_cast(in_query.external_memory_handle_type.get_vk() ); input_struct.pNext = nullptr; input_struct.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHR; - input_struct.usage = in_query.usage_flags; + input_struct.usage = in_query.usage_flags.get_vk(); result_struct.pNext = nullptr; result_struct.sType = VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHR; @@ -649,7 +649,7 @@ bool Anvil::PhysicalDevice::get_fence_properties(const Anvil::FencePropertiesQue entrypoints_ptr = &m_instance_ptr->get_extension_khr_external_fence_capabilities_entrypoints(); } - input_struct.handleType = static_cast(Anvil::Utils::convert_external_fence_handle_type_bits_to_vk_external_fence_handle_type_flags(in_query.external_fence_handle_type) ); + input_struct.handleType = static_cast(in_query.external_fence_handle_type); input_struct.pNext = nullptr; input_struct.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO_KHR; @@ -708,8 +708,8 @@ bool Anvil::PhysicalDevice::get_image_format_properties(const ImageFormatPropert static_cast (in_query.format), static_cast (in_query.image_type), static_cast(in_query.tiling), - in_query.usage_flags, - in_query.create_flags, + in_query.usage_flags.get_vk (), + in_query.create_flags.get_vk(), &core_vk10_image_format_properties) != VK_SUCCESS) { goto end; @@ -728,13 +728,13 @@ bool Anvil::PhysicalDevice::get_image_format_properties(const ImageFormatPropert { VkPhysicalDeviceImageFormatInfo2KHR format_info; - format_info.flags = in_query.create_flags; + format_info.flags = in_query.create_flags.get_vk(); format_info.format = static_cast(in_query.format); format_info.pNext = nullptr; format_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR; format_info.tiling = static_cast(in_query.tiling); format_info.type = static_cast (in_query.image_type); - format_info.usage = in_query.usage_flags; + format_info.usage = in_query.usage_flags.get_vk(); input_struct_chainer.append_struct(format_info); } @@ -758,14 +758,14 @@ bool Anvil::PhysicalDevice::get_image_format_properties(const ImageFormatPropert texture_lod_gather_support_struct_id = output_struct_chainer.append_struct(texture_lod_gather_support); } - if (in_query.external_memory_handle_type != EXTERNAL_MEMORY_HANDLE_TYPE_NONE) + if (in_query.external_memory_handle_type != Anvil::ExternalMemoryHandleTypeFlagBits::NONE) { anvil_assert(instance_extensions_ptr->khr_external_memory_capabilities() ); VkPhysicalDeviceExternalImageFormatInfoKHR external_image_format_info; VkExternalImageFormatPropertiesKHR external_image_format_props; - external_image_format_info.handleType = static_cast(Anvil::Utils::convert_external_memory_handle_type_bits_to_vk_external_memory_handle_type_flags(in_query.external_memory_handle_type) ); + external_image_format_info.handleType = static_cast(in_query.external_memory_handle_type); external_image_format_info.pNext = nullptr; external_image_format_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHR; @@ -792,7 +792,7 @@ bool Anvil::PhysicalDevice::get_image_format_properties(const ImageFormatPropert supports_amd_texture_gather_bias_lod = (texture_lod_gather_support_ptr->supportsTextureGatherLODBiasAMD == VK_TRUE); } - if (in_query.external_memory_handle_type != EXTERNAL_MEMORY_HANDLE_TYPE_NONE) + if (in_query.external_memory_handle_type != Anvil::ExternalMemoryHandleTypeFlagBits::NONE) { auto image_format_props_ptr = output_struct_chain_ptr->get_struct_with_id(external_image_format_props_struct_id); @@ -837,7 +837,7 @@ bool Anvil::PhysicalDevice::get_semaphore_properties(const Anvil::SemaphorePrope entrypoints_ptr = &m_instance_ptr->get_extension_khr_external_semaphore_capabilities_entrypoints(); } - input_struct.handleType = static_cast(Anvil::Utils::convert_external_semaphore_handle_type_bits_to_vk_external_semaphore_handle_type_flags(in_query.external_semaphore_handle_type) ); + input_struct.handleType = static_cast(in_query.external_semaphore_handle_type); input_struct.pNext = nullptr; input_struct.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHR; @@ -861,12 +861,12 @@ bool Anvil::PhysicalDevice::get_semaphore_properties(const Anvil::SemaphorePrope } /* Please see header for specification */ -bool Anvil::PhysicalDevice::get_sparse_image_format_properties(Anvil::Format in_format, - Anvil::ImageType in_type, - Anvil::SampleCountFlagBits in_sample_count, - Anvil::ImageUsageFlags in_usage, - Anvil::ImageTiling in_tiling, - std::vector& out_result) const +bool Anvil::PhysicalDevice::get_sparse_image_format_properties(Anvil::Format in_format, + Anvil::ImageType in_type, + Anvil::SampleCountFlagBits in_sample_count, + Anvil::ImageUsageFlags in_usage, + Anvil::ImageTiling in_tiling, + std::vector& out_result) const { /* TODO: It might be a good idea to cache the retrieved properties */ uint32_t n_properties = 0; @@ -877,7 +877,7 @@ bool Anvil::PhysicalDevice::get_sparse_image_format_properties(Anvil::Format static_cast (in_format), static_cast(in_type), static_cast(in_sample_count), - in_usage, + in_usage.get_vk(), static_cast(in_tiling), &n_properties, nullptr); /* pProperties */ @@ -890,10 +890,10 @@ bool Anvil::PhysicalDevice::get_sparse_image_format_properties(Anvil::Format static_cast (in_format), static_cast (in_type), static_cast(in_sample_count), - in_usage, + in_usage.get_vk(), static_cast(in_tiling), &n_properties, - &out_result[0]); + reinterpret_cast(&out_result[0]) ); } return true; diff --git a/src/wrappers/pipeline_layout.cpp b/src/wrappers/pipeline_layout.cpp index a73bb457..55b7998a 100644 --- a/src/wrappers/pipeline_layout.cpp +++ b/src/wrappers/pipeline_layout.cpp @@ -135,7 +135,7 @@ bool Anvil::PipelineLayout::bake(const std::vectoroffset; new_push_constant_range.size = push_constant_range_iterator->size; - new_push_constant_range.stageFlags = push_constant_range_iterator->stages; + new_push_constant_range.stageFlags = push_constant_range_iterator->stages.get_vk(); push_constant_ranges_vk.push_back(new_push_constant_range); } diff --git a/src/wrappers/query_pool.cpp b/src/wrappers/query_pool.cpp index baf8a8c3..7fa830c8 100644 --- a/src/wrappers/query_pool.cpp +++ b/src/wrappers/query_pool.cpp @@ -43,7 +43,7 @@ Anvil::QueryPool::QueryPool(const Anvil::BaseDevice* in_device_ptr, in_query_type == VK_QUERY_TYPE_TIMESTAMP); init(in_query_type, - 0, /* in_flags - irrelevant */ + Anvil::QueryPipelineStatisticFlagBits::NONE, in_n_max_concurrent_queries); /* Register the pool wrapper instance */ @@ -52,11 +52,11 @@ Anvil::QueryPool::QueryPool(const Anvil::BaseDevice* in_device_ptr, } /* Please see header for specification */ -Anvil::QueryPool::QueryPool(const Anvil::BaseDevice* in_device_ptr, - VkQueryType in_query_type, - VkFlags in_query_flags, - uint32_t in_n_max_concurrent_queries, - bool in_mt_safe) +Anvil::QueryPool::QueryPool(const Anvil::BaseDevice* in_device_ptr, + VkQueryType in_query_type, + Anvil::QueryPipelineStatisticFlags in_pipeline_statistics, + uint32_t in_n_max_concurrent_queries, + bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT), MTSafetySupportProvider (in_mt_safe), @@ -65,7 +65,7 @@ Anvil::QueryPool::QueryPool(const Anvil::BaseDevice* in_device_ptr, m_query_type (in_query_type) { init(in_query_type, - in_query_flags, + in_pipeline_statistics, in_n_max_concurrent_queries); /* Register the pool wrapper instance */ @@ -117,10 +117,10 @@ Anvil::QueryPoolUniquePtr Anvil::QueryPool::create_non_ps_query_pool(const Anvil } /* Please see header for specification */ -Anvil::QueryPoolUniquePtr Anvil::QueryPool::create_ps_query_pool(const Anvil::BaseDevice* in_device_ptr, - VkQueryPipelineStatisticFlags in_pipeline_statistics, - uint32_t in_n_max_concurrent_queries, - MTSafety in_mt_safety) +Anvil::QueryPoolUniquePtr Anvil::QueryPool::create_ps_query_pool(const Anvil::BaseDevice* in_device_ptr, + Anvil::QueryPipelineStatisticFlags in_pipeline_statistics, + uint32_t in_n_max_concurrent_queries, + MTSafety in_mt_safety) { const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, in_device_ptr); @@ -138,12 +138,12 @@ Anvil::QueryPoolUniquePtr Anvil::QueryPool::create_ps_query_pool(const Anvil::Ba return result_ptr; } -bool Anvil::QueryPool::get_query_pool_results_internal(const uint32_t& in_first_query_index, - const uint32_t& in_n_queries, - const QueryResultBits& in_query_props, - const bool& in_should_return_uint64, - void* out_results_ptr, - bool* out_all_query_results_retrieved_ptr) +bool Anvil::QueryPool::get_query_pool_results_internal(const uint32_t& in_first_query_index, + const uint32_t& in_n_queries, + const Anvil::QueryResultFlags& in_query_props, + const bool& in_should_return_uint64, + void* out_results_ptr, + bool* out_all_query_results_retrieved_ptr) { VkQueryResultFlags flags = 0; uint32_t result_query_size = 0; @@ -167,7 +167,7 @@ bool Anvil::QueryPool::get_query_pool_results_internal(const uint32_t& in result_query_size = sizeof(uint32_t); } - if (in_query_props & Anvil::QUERY_RESULT_PARTIAL_BIT) + if ((in_query_props & Anvil::QueryResultFlagBits::PARTIAL_BIT) != 0) { flags |= VK_QUERY_RESULT_PARTIAL_BIT; @@ -179,12 +179,12 @@ bool Anvil::QueryPool::get_query_pool_results_internal(const uint32_t& in } } - if (in_query_props & Anvil::QUERY_RESULT_WAIT_BIT) + if ((in_query_props & Anvil::QueryResultFlagBits::WAIT_BIT) != 0) { flags |= VK_QUERY_RESULT_WAIT_BIT; } - if (in_query_props & Anvil::QUERY_RESULT_WITH_AVAILABILITY_BIT) + if ((in_query_props & Anvil::QueryResultFlagBits::WITH_AVAILABILITY_BIT) != 0) { flags |= VK_QUERY_RESULT_WITH_AVAILABILITY_BIT; result_query_size *= 2; @@ -200,7 +200,7 @@ bool Anvil::QueryPool::get_query_pool_results_internal(const uint32_t& in (in_should_return_uint64) ? sizeof(uint64_t) : sizeof(uint32_t), flags); - if (in_query_props & Anvil::QUERY_RESULT_PARTIAL_BIT) + if ((in_query_props & Anvil::QueryResultFlagBits::PARTIAL_BIT) != 0) { result = is_vk_call_successful(result_vk); *out_all_query_results_retrieved_ptr = (result_vk == VK_SUCCESS); @@ -217,9 +217,9 @@ bool Anvil::QueryPool::get_query_pool_results_internal(const uint32_t& in } /* Please see header for specification */ -void Anvil::QueryPool::init(VkQueryType in_query_type, - VkFlags in_query_flags, - uint32_t in_n_max_concurrent_queries) +void Anvil::QueryPool::init(VkQueryType in_query_type, + Anvil::QueryPipelineStatisticFlags in_pipeline_statistics, + uint32_t in_n_max_concurrent_queries) { VkQueryPoolCreateInfo create_info; VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); @@ -227,7 +227,8 @@ void Anvil::QueryPool::init(VkQueryType in_query_type, ANVIL_REDUNDANT_VARIABLE(result_vk); create_info.flags = 0; - create_info.pipelineStatistics = (in_query_type == VK_QUERY_TYPE_PIPELINE_STATISTICS) ? in_query_flags : 0; + create_info.pipelineStatistics = (in_query_type == VK_QUERY_TYPE_PIPELINE_STATISTICS) ? in_pipeline_statistics.get_vk() + : 0; create_info.pNext = nullptr; create_info.queryCount = in_n_max_concurrent_queries; create_info.queryType = in_query_type; diff --git a/src/wrappers/queue.cpp b/src/wrappers/queue.cpp index a698bbf8..6470d880 100644 --- a/src/wrappers/queue.cpp +++ b/src/wrappers/queue.cpp @@ -63,7 +63,7 @@ Anvil::Queue::Queue(const Anvil::BaseDevice* in_device_ptr, anvil_assert(m_queue != VK_NULL_HANDLE); /* Determine whether the queue supports sparse bindings */ - m_supports_sparse_bindings = !!(m_device_ptr->get_queue_family_info(in_queue_family_index)->flags & VK_QUEUE_SPARSE_BINDING_BIT); + m_supports_sparse_bindings = (m_device_ptr->get_queue_family_info(in_queue_family_index)->flags & Anvil::QueueFlagBits::SPARSE_BINDING_BIT) != 0; /* Cache a fence that may be optionally used for submissions */ { @@ -188,14 +188,14 @@ bool Anvil::Queue::bind_sparse_memory(Anvil::SparseMemoryBindingUpdateInfo& in_u n_image_memory_update < n_image_memory_updates; ++n_image_memory_update) { - Anvil::Image* image_ptr = nullptr; - VkExtent3D extent; - VkSparseMemoryBindFlags flags; - bool memory_block_owned_by_image = false; - Anvil::MemoryBlock* memory_block_ptr = nullptr; - VkDeviceSize memory_block_start_offset; - VkOffset3D offset; - VkImageSubresource subresource; + Anvil::Image* image_ptr = nullptr; + VkExtent3D extent; + Anvil::SparseMemoryBindFlags flags; + bool memory_block_owned_by_image = false; + Anvil::MemoryBlock* memory_block_ptr = nullptr; + VkDeviceSize memory_block_start_offset; + VkOffset3D offset; + Anvil::ImageSubresource subresource; in_update.get_image_memory_update_properties(n_bind_info, n_image_memory_update, @@ -220,13 +220,13 @@ bool Anvil::Queue::bind_sparse_memory(Anvil::SparseMemoryBindingUpdateInfo& in_u n_image_opaque_memory_update < n_image_opaque_memory_updates; ++n_image_opaque_memory_update) { - VkSparseMemoryBindFlags flags; - Anvil::Image* image_ptr = nullptr; - bool memory_block_owned_by_image = false; - Anvil::MemoryBlock* memory_block_ptr = nullptr; - VkDeviceSize memory_block_start_offset; - VkDeviceSize resource_offset; - VkDeviceSize size; + Anvil::SparseMemoryBindFlags flags; + Anvil::Image* image_ptr = nullptr; + bool memory_block_owned_by_image = false; + Anvil::MemoryBlock* memory_block_ptr = nullptr; + VkDeviceSize memory_block_start_offset; + VkDeviceSize resource_offset; + VkDeviceSize size; in_update.get_image_opaque_memory_update_properties(n_bind_info, n_image_opaque_memory_update, @@ -437,7 +437,7 @@ VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, { static const uint32_t device_mask = 0x1; - return present_internal(VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR, + return present_internal(Anvil::DeviceGroupPresentModeFlagBits::LOCAL_BIT_KHR, 1, /* n_swapchain_image_indices */ &in_swapchain_ptr, &in_swapchain_image_index, @@ -460,7 +460,7 @@ VkResult Anvil::Queue::present_in_local_presentation_mode(uint32_t uint32_t swapchain_image_indices[MAX_SWAPCHAINS]; Anvil::Swapchain* swapchains [MAX_SWAPCHAINS]; - if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) + if (device_type == Anvil::DeviceType::SINGLE_GPU) { const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr) ); @@ -476,7 +476,7 @@ VkResult Anvil::Queue::present_in_local_presentation_mode(uint32_t } else { - anvil_assert(device_type == Anvil::DEVICE_TYPE_MULTI_GPU); + anvil_assert(device_type == Anvil::DeviceType::MULTI_GPU); anvil_assert(in_n_local_mode_presentation_items < MAX_SWAPCHAINS); n_swapchains = in_n_local_mode_presentation_items; @@ -493,7 +493,7 @@ VkResult Anvil::Queue::present_in_local_presentation_mode(uint32_t } } - result = present_internal(VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR, + result = present_internal(Anvil::DeviceGroupPresentModeFlagBits::LOCAL_BIT_KHR, n_swapchains, swapchains, swapchain_image_indices, @@ -542,7 +542,7 @@ VkResult Anvil::Queue::present_in_local_multi_device_presentation_mode(uint32_t swapchain_image_indices[n_item] = current_item_ptr->swapchain_image_index; } - result = present_internal(VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR, + result = present_internal(Anvil::DeviceGroupPresentModeFlagBits::LOCAL_MULTI_DEVICE_BIT_KHR, n_swapchains, swapchains, swapchain_image_indices, @@ -596,7 +596,7 @@ VkResult Anvil::Queue::present_in_remote_presentation_mode(uint32_t swapchain_image_indices[n_item] = current_item_ptr->swapchain_image_index; } - result = present_internal(VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR, + result = present_internal(Anvil::DeviceGroupPresentModeFlagBits::REMOTE_BIT_KHR, n_swapchains, swapchains, swapchain_image_indices, @@ -638,7 +638,7 @@ VkResult Anvil::Queue::present_in_sum_presentation_mode(uint32_t const uint32_t n_physical_devices = mgpu_device_ptr->get_n_physical_devices(); bool request_supported = false; - anvil_assert(mgpu_device_ptr->get_supported_present_modes_for_surface(current_item_ptr->swapchain_ptr->get_create_info_ptr()->get_rendering_surface() )); + anvil_assert(mgpu_device_ptr->get_supported_present_modes_for_surface(current_item_ptr->swapchain_ptr->get_create_info_ptr()->get_rendering_surface() ) != Anvil::DeviceGroupPresentModeFlagBits::NONE); /* Make sure at least one physical device supports SUM presentation mode for all the specified physical devices */ for (uint32_t n_physical_device = 0; @@ -697,7 +697,7 @@ VkResult Anvil::Queue::present_in_sum_presentation_mode(uint32_t swapchain_image_indices[n_item] = current_item_ptr->swapchain_image_index; } - result = present_internal(VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR, + result = present_internal(Anvil::DeviceGroupPresentModeFlagBits::SUM_BIT_KHR, n_swapchains, swapchains, swapchain_image_indices, @@ -709,13 +709,13 @@ VkResult Anvil::Queue::present_in_sum_presentation_mode(uint32_t } /** Please see header for specification */ -VkResult Anvil::Queue::present_internal(VkDeviceGroupPresentModeFlagBitsKHR in_presentation_mode, - uint32_t in_n_swapchains, - Anvil::Swapchain* const* in_swapchains, - const uint32_t* in_swapchain_image_indices, - const uint32_t* in_device_masks, - uint32_t in_n_wait_semaphores, - Anvil::Semaphore* const* in_wait_semaphore_ptrs) +VkResult Anvil::Queue::present_internal(DeviceGroupPresentModeFlagBits in_presentation_mode, + uint32_t in_n_swapchains, + Anvil::Swapchain* const* in_swapchains, + const uint32_t* in_swapchain_image_indices, + const uint32_t* in_device_masks, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs) { const Anvil::DeviceType device_type (m_device_ptr->get_type() ); VkResult presentation_results [MAX_SWAPCHAINS]; @@ -729,11 +729,11 @@ VkResult Anvil::Queue::present_internal(VkDeviceGroupPresentModeFlagBitsKHR in_p anvil_assert(in_n_swapchains < MAX_SWAPCHAINS); anvil_assert(in_swapchains != nullptr); - if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) + if (device_type == Anvil::DeviceType::SINGLE_GPU) { anvil_assert(*in_device_masks == 1); anvil_assert(in_n_swapchains == 1); - anvil_assert(in_presentation_mode == VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR); + anvil_assert(in_presentation_mode == Anvil::DeviceGroupPresentModeFlagBits::LOCAL_BIT_KHR); } /* If the application is only interested in off-screen rendering, do *not* post the present request, @@ -752,7 +752,7 @@ VkResult Anvil::Queue::present_internal(VkDeviceGroupPresentModeFlagBitsKHR in_p if (window_platform == WINDOW_PLATFORM_DUMMY || window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS) { - static const VkPipelineStageFlags dst_stage_mask(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT); + static const Anvil::PipelineStageFlags dst_stage_mask(Anvil::PipelineStageFlagBits::TOP_OF_PIPE_BIT); m_device_ptr->get_universal_queue(0)->submit( SubmitInfo::create(nullptr, @@ -813,11 +813,11 @@ VkResult Anvil::Queue::present_internal(VkDeviceGroupPresentModeFlagBitsKHR in_p } /* For multi-GPU support, we're likely going to need to attach the VkDeviceGroupPresentInfoKHR struct */ - if (device_type == Anvil::DEVICE_TYPE_MULTI_GPU) + if (device_type == Anvil::DeviceType::MULTI_GPU) { VkDeviceGroupPresentInfoKHR device_group_present_info; - device_group_present_info.mode = in_presentation_mode; + device_group_present_info.mode = static_cast(in_presentation_mode); device_group_present_info.pDeviceMasks = in_device_masks; device_group_present_info.pNext = nullptr; device_group_present_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR; diff --git a/src/wrappers/render_pass.cpp b/src/wrappers/render_pass.cpp index b49c9ff4..35275357 100644 --- a/src/wrappers/render_pass.cpp +++ b/src/wrappers/render_pass.cpp @@ -149,13 +149,13 @@ bool Anvil::RenderPass::init() attachment_vk.finalLayout = static_cast(renderpass_attachment_iterator->final_layout); attachment_vk.flags = (renderpass_attachment_iterator->may_alias) ? VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT : 0u; - attachment_vk.format = static_cast(renderpass_attachment_iterator->format); - attachment_vk.initialLayout = static_cast(renderpass_attachment_iterator->initial_layout); - attachment_vk.loadOp = renderpass_attachment_iterator->color_depth_load_op; + attachment_vk.format = static_cast (renderpass_attachment_iterator->format); + attachment_vk.initialLayout = static_cast (renderpass_attachment_iterator->initial_layout); + attachment_vk.loadOp = static_cast (renderpass_attachment_iterator->color_depth_load_op); attachment_vk.samples = static_cast(renderpass_attachment_iterator->sample_count); - attachment_vk.stencilLoadOp = renderpass_attachment_iterator->stencil_load_op; - attachment_vk.stencilStoreOp = renderpass_attachment_iterator->stencil_store_op; - attachment_vk.storeOp = renderpass_attachment_iterator->color_depth_store_op; + attachment_vk.stencilLoadOp = static_cast (renderpass_attachment_iterator->stencil_load_op); + attachment_vk.stencilStoreOp = static_cast (renderpass_attachment_iterator->stencil_store_op); + attachment_vk.storeOp = static_cast (renderpass_attachment_iterator->color_depth_store_op); renderpass_attachments_vk.push_back(attachment_vk); } @@ -166,13 +166,13 @@ bool Anvil::RenderPass::init() { VkSubpassDependency dependency_vk; - dependency_vk.dependencyFlags = subpass_dependency_iterator->flags; - dependency_vk.dstAccessMask = subpass_dependency_iterator->destination_access_mask; - dependency_vk.dstStageMask = subpass_dependency_iterator->destination_stage_mask; + dependency_vk.dependencyFlags = subpass_dependency_iterator->flags.get_vk(); + dependency_vk.dstAccessMask = subpass_dependency_iterator->destination_access_mask.get_vk(); + dependency_vk.dstStageMask = subpass_dependency_iterator->destination_stage_mask.get_vk (); dependency_vk.dstSubpass = (subpass_dependency_iterator->destination_subpass_ptr != nullptr) ? subpass_dependency_iterator->destination_subpass_ptr->index : VK_SUBPASS_EXTERNAL; - dependency_vk.srcAccessMask = subpass_dependency_iterator->source_access_mask; - dependency_vk.srcStageMask = subpass_dependency_iterator->source_stage_mask; + dependency_vk.srcAccessMask = subpass_dependency_iterator->source_access_mask.get_vk(); + dependency_vk.srcStageMask = subpass_dependency_iterator->source_stage_mask.get_vk (); dependency_vk.srcSubpass = (subpass_dependency_iterator->source_subpass_ptr != nullptr) ? subpass_dependency_iterator->source_subpass_ptr->index : VK_SUBPASS_EXTERNAL; @@ -370,11 +370,11 @@ bool Anvil::RenderPass::init() const auto& current_attachment_accessed_aspects = subpass_input_attachment_iterator->second.aspects_accessed; const auto& current_attachment_index = subpass_input_attachment_iterator->first; - if (current_attachment_accessed_aspects != Anvil::ImageAspectFlagBits::IMAGE_ASPECT_UNKNOWN) + if (current_attachment_accessed_aspects != Anvil::ImageAspectFlagBits::NONE) { std::unique_ptr attachment_aspect_reference_info_ptr(new VkInputAttachmentAspectReferenceKHR() ); - attachment_aspect_reference_info_ptr->aspectMask = static_cast(current_attachment_accessed_aspects); + attachment_aspect_reference_info_ptr->aspectMask = current_attachment_accessed_aspects.get_vk(); attachment_aspect_reference_info_ptr->inputAttachmentIndex = current_attachment_index; attachment_aspect_reference_info_ptr->subpass = current_subpass_index; diff --git a/src/wrappers/rendering_surface.cpp b/src/wrappers/rendering_surface.cpp index ab14a118..adfd05fd 100644 --- a/src/wrappers/rendering_surface.cpp +++ b/src/wrappers/rendering_surface.cpp @@ -108,8 +108,8 @@ void Anvil::RenderingSurface::cache_surface_properties() switch (device_type) { - case Anvil::DEVICE_TYPE_MULTI_GPU: n_physical_devices = mgpu_device_ptr->get_n_physical_devices(); break; - case Anvil::DEVICE_TYPE_SINGLE_GPU: n_physical_devices = 1; break; + case Anvil::DeviceType::MULTI_GPU: n_physical_devices = mgpu_device_ptr->get_n_physical_devices(); break; + case Anvil::DeviceType::SINGLE_GPU: n_physical_devices = 1; break; default: { @@ -132,8 +132,8 @@ void Anvil::RenderingSurface::cache_surface_properties() switch (device_type) { - case Anvil::DEVICE_TYPE_MULTI_GPU: physical_device_ptr = mgpu_device_ptr->get_physical_device(n_physical_device); break; - case Anvil::DEVICE_TYPE_SINGLE_GPU: physical_device_ptr = sgpu_device_ptr->get_physical_device(); break; + case Anvil::DeviceType::MULTI_GPU: physical_device_ptr = mgpu_device_ptr->get_physical_device(n_physical_device); break; + case Anvil::DeviceType::SINGLE_GPU: physical_device_ptr = sgpu_device_ptr->get_physical_device(); break; default: { @@ -145,14 +145,14 @@ void Anvil::RenderingSurface::cache_surface_properties() if (m_surface == VK_NULL_HANDLE) { - result_caps.supported_composite_alpha_flags = VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR; - result_caps.supported_transformations = VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR; - result_caps.supported_usages = static_cast (Anvil::IMAGE_USAGE_FLAG_COLOR_ATTACHMENT_BIT | - Anvil::IMAGE_USAGE_FLAG_TRANSFER_SRC_BIT | - Anvil::IMAGE_USAGE_FLAG_TRANSFER_DST_BIT | - Anvil::IMAGE_USAGE_FLAG_STORAGE_BIT); + result_caps.supported_composite_alpha_flags = Anvil::CompositeAlphaFlagBits::INHERIT_BIT_KHR; + result_caps.supported_transformations = Anvil::SurfaceTransformFlagBits::INHERIT_BIT_KHR; + result_caps.supported_usages = static_cast (Anvil::ImageUsageFlagBits::COLOR_ATTACHMENT_BIT | + Anvil::ImageUsageFlagBits::TRANSFER_SRC_BIT | + Anvil::ImageUsageFlagBits::TRANSFER_DST_BIT | + Anvil::ImageUsageFlagBits::STORAGE_BIT); - result_caps.supported_presentation_modes.push_back(VK_PRESENT_MODE_IMMEDIATE_KHR); + result_caps.supported_presentation_modes.push_back(Anvil::PresentModeKHR::IMMEDIATE_KHR); continue; } @@ -161,24 +161,24 @@ void Anvil::RenderingSurface::cache_surface_properties() result = khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physical_device_vk, m_surface, - &result_caps.capabilities); + reinterpret_cast(&result_caps.capabilities) ); anvil_assert_vk_call_succeeded(result); if (n_physical_device == 0) { - m_height = result_caps.capabilities.currentExtent.height; - m_width = result_caps.capabilities.currentExtent.width; + m_height = result_caps.capabilities.current_extent.height; + m_width = result_caps.capabilities.current_extent.width; } else { - anvil_assert(m_height == result_caps.capabilities.currentExtent.height); - anvil_assert(m_width == result_caps.capabilities.currentExtent.width); + anvil_assert(m_height == result_caps.capabilities.current_extent.height); + anvil_assert(m_width == result_caps.capabilities.current_extent.width); } - result_caps.supported_composite_alpha_flags = static_cast (result_caps.capabilities.supportedCompositeAlpha); - result_caps.supported_transformations = static_cast(result_caps.capabilities.supportedTransforms); - result_caps.supported_usages = static_cast (result_caps.capabilities.supportedUsageFlags); + result_caps.supported_composite_alpha_flags = result_caps.capabilities.supported_composite_alpha; + result_caps.supported_transformations = result_caps.capabilities.supported_transforms; + result_caps.supported_usages = result_caps.capabilities.supported_usage_flags; /* Retrieve a list of formats supported by the surface */ result = khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceFormatsKHR(physical_device_vk, @@ -217,13 +217,22 @@ void Anvil::RenderingSurface::cache_surface_properties() if (n_supported_presentation_modes > 0) { + std::vector temp_storage(n_supported_presentation_modes); + result_caps.supported_presentation_modes.resize(n_supported_presentation_modes); result = khr_surface_entrypoints.vkGetPhysicalDeviceSurfacePresentModesKHR(physical_device_vk, m_surface, &n_supported_presentation_modes, - &result_caps.supported_presentation_modes.at(0)); + &temp_storage.at(0) ); anvil_assert_vk_call_succeeded(result); + + for (uint32_t n_presentation_mode = 0; + n_presentation_mode < static_cast(temp_storage.size() ); + ++n_presentation_mode) + { + result_caps.supported_presentation_modes.at(n_presentation_mode) = static_cast(temp_storage.at(n_presentation_mode) ); + } } } } @@ -257,7 +266,7 @@ Anvil::RenderingSurfaceUniquePtr Anvil::RenderingSurface::create(Anvil::Instance /* Please see header for specification */ bool Anvil::RenderingSurface::get_capabilities(const Anvil::PhysicalDevice* in_physical_device_ptr, - VkSurfaceCapabilitiesKHR* out_surface_caps_ptr) const + Anvil::SurfaceCapabilities* out_surface_caps_ptr) const { auto caps_iterator = m_physical_device_capabilities.find(in_physical_device_ptr->get_device_group_device_index()); bool result = false; @@ -291,7 +300,7 @@ bool Anvil::RenderingSurface::get_queue_families_with_present_support(const Anvi /* Please see header for specification */ bool Anvil::RenderingSurface::get_supported_composite_alpha_flags(const Anvil::PhysicalDevice* in_physical_device_ptr, - VkCompositeAlphaFlagsKHR* out_result_ptr) const + Anvil::CompositeAlphaFlags* out_result_ptr) const { auto caps_iterator = m_physical_device_capabilities.find(in_physical_device_ptr->get_device_group_device_index()); bool result = false; @@ -307,8 +316,8 @@ bool Anvil::RenderingSurface::get_supported_composite_alpha_flags(const Anvil::P } /* Please see header for specification */ -bool Anvil::RenderingSurface::get_supported_transformations(const Anvil::PhysicalDevice* in_physical_device_ptr, - VkSurfaceTransformFlagsKHR* out_result_ptr) const +bool Anvil::RenderingSurface::get_supported_transformations(const Anvil::PhysicalDevice* in_physical_device_ptr, + Anvil::SurfaceTransformFlags* out_result_ptr) const { auto caps_iterator = m_physical_device_capabilities.find(in_physical_device_ptr->get_device_group_device_index()); bool result = false; @@ -355,7 +364,7 @@ bool Anvil::RenderingSurface::init() switch (device_type) { - case Anvil::DEVICE_TYPE_MULTI_GPU: + case Anvil::DeviceType::MULTI_GPU: { const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr) ); @@ -364,7 +373,7 @@ bool Anvil::RenderingSurface::init() break; } - case Anvil::DEVICE_TYPE_SINGLE_GPU: + case Anvil::DeviceType::SINGLE_GPU: { n_physical_devices = 1; @@ -440,7 +449,7 @@ bool Anvil::RenderingSurface::init() switch (device_type) { - case Anvil::DEVICE_TYPE_MULTI_GPU: + case Anvil::DeviceType::MULTI_GPU: { const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr) ); @@ -450,7 +459,7 @@ bool Anvil::RenderingSurface::init() break; } - case Anvil::DEVICE_TYPE_SINGLE_GPU: + case Anvil::DeviceType::SINGLE_GPU: { const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr) ); @@ -498,7 +507,7 @@ bool Anvil::RenderingSurface::init() { switch (device_type) { - case Anvil::DEVICE_TYPE_MULTI_GPU: + case Anvil::DeviceType::MULTI_GPU: { const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr) ); @@ -513,7 +522,7 @@ bool Anvil::RenderingSurface::init() break; } - case Anvil::DEVICE_TYPE_SINGLE_GPU: + case Anvil::DeviceType::SINGLE_GPU: { const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr) ); @@ -579,7 +588,7 @@ bool Anvil::RenderingSurface::is_compatible_with_image_format(const Anvil::Physi /* Please see header for specification */ bool Anvil::RenderingSurface::supports_presentation_mode(const Anvil::PhysicalDevice* in_physical_device_ptr, - VkPresentModeKHR in_presentation_mode, + Anvil::PresentModeKHR in_presentation_mode, bool* out_result_ptr) const { auto caps_iterator = m_physical_device_capabilities.find(in_physical_device_ptr->get_device_group_device_index()); diff --git a/src/wrappers/sampler.cpp b/src/wrappers/sampler.cpp index 9ab2e2a3..eeb767e9 100644 --- a/src/wrappers/sampler.cpp +++ b/src/wrappers/sampler.cpp @@ -95,21 +95,21 @@ bool Anvil::Sampler::init() const auto max_anisotropy = m_create_info_ptr->get_max_anisotropy(); VkSamplerCreateInfo sampler_create_info; - sampler_create_info.addressModeU = m_create_info_ptr->get_address_mode_u(); - sampler_create_info.addressModeV = m_create_info_ptr->get_address_mode_v(); - sampler_create_info.addressModeW = m_create_info_ptr->get_address_mode_w(); + sampler_create_info.addressModeU = static_cast(m_create_info_ptr->get_address_mode_u() ); + sampler_create_info.addressModeV = static_cast(m_create_info_ptr->get_address_mode_v() ); + sampler_create_info.addressModeW = static_cast(m_create_info_ptr->get_address_mode_w() ); sampler_create_info.anisotropyEnable = (max_anisotropy > 1.0f) ? VK_TRUE : VK_FALSE; - sampler_create_info.borderColor = m_create_info_ptr->get_border_color(); + sampler_create_info.borderColor = static_cast(m_create_info_ptr->get_border_color() ); sampler_create_info.compareEnable = m_create_info_ptr->is_compare_enabled() ? VK_TRUE : VK_FALSE; - sampler_create_info.compareOp = m_create_info_ptr->get_compare_op(); + sampler_create_info.compareOp = static_cast(m_create_info_ptr->get_compare_op() ); sampler_create_info.flags = 0; - sampler_create_info.magFilter = m_create_info_ptr->get_mag_filter(); + sampler_create_info.magFilter = static_cast(m_create_info_ptr->get_mag_filter() ); sampler_create_info.maxAnisotropy = max_anisotropy; sampler_create_info.maxLod = m_create_info_ptr->get_max_lod(); - sampler_create_info.minFilter = m_create_info_ptr->get_min_filter(); + sampler_create_info.minFilter = static_cast(m_create_info_ptr->get_min_filter() ); sampler_create_info.minLod = m_create_info_ptr->get_min_lod(); sampler_create_info.mipLodBias = m_create_info_ptr->get_lod_bias(); - sampler_create_info.mipmapMode = m_create_info_ptr->get_mipmap_mode(); + sampler_create_info.mipmapMode = static_cast(m_create_info_ptr->get_mipmap_mode() ); sampler_create_info.pNext = nullptr; sampler_create_info.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO; sampler_create_info.unnormalizedCoordinates = m_create_info_ptr->uses_unnormalized_coordinates() ? VK_TRUE : VK_FALSE; diff --git a/src/wrappers/semaphore.cpp b/src/wrappers/semaphore.cpp index 9e259e98..d6558632 100644 --- a/src/wrappers/semaphore.cpp +++ b/src/wrappers/semaphore.cpp @@ -74,7 +74,7 @@ Anvil::SemaphoreUniquePtr Anvil::Semaphore::create(Anvil::SemaphoreCreateInfoUni } /* Please see header for specification */ -Anvil::ExternalHandleUniquePtr Anvil::Semaphore::export_to_external_handle(const Anvil::ExternalSemaphoreHandleTypeBit& in_semaphore_handle_type) +Anvil::ExternalHandleUniquePtr Anvil::Semaphore::export_to_external_handle(const Anvil::ExternalSemaphoreHandleTypeFlagBits& in_semaphore_handle_type) { #if defined(_WIN32) const auto invalid_handle = nullptr; @@ -131,7 +131,7 @@ Anvil::ExternalHandleUniquePtr Anvil::Semaphore::export_to_external_handle(const anvil_assert(m_semaphore != VK_NULL_HANDLE); - info.handleType = static_cast(Anvil::Utils::convert_external_semaphore_handle_type_bits_to_vk_external_semaphore_handle_type_flags(in_semaphore_handle_type) ); + info.handleType = static_cast(in_semaphore_handle_type); info.pNext = nullptr; info.semaphore = m_semaphore; @@ -182,14 +182,14 @@ Anvil::ExternalHandleUniquePtr Anvil::Semaphore::export_to_external_handle(const } #if defined(_WIN32) - bool Anvil::Semaphore::import_from_external_handle(const bool& in_temporary_import, - const Anvil::ExternalSemaphoreHandleTypeBit& in_handle_type, - const ExternalHandleType& in_opt_handle, - const std::wstring& in_opt_name) + bool Anvil::Semaphore::import_from_external_handle(const bool& in_temporary_import, + const Anvil::ExternalSemaphoreHandleTypeFlagBits& in_handle_type, + const ExternalHandleType& in_opt_handle, + const std::wstring& in_opt_name) #else - bool Anvil::Semaphore::import_from_external_handle(const bool& in_temporary_import, - const Anvil::ExternalSemaphoreHandleTypeBit& in_handle_type, - const ExternalHandleType& in_handle) + bool Anvil::Semaphore::import_from_external_handle(const bool& in_temporary_import, + const Anvil::ExternalSemaphoreHandleTypeFlagBits& in_handle_type, + const ExternalHandleType& in_handle) #endif { #if defined(_WIN32) @@ -231,7 +231,7 @@ Anvil::ExternalHandleUniquePtr Anvil::Semaphore::export_to_external_handle(const info_vk.flags = (in_temporary_import) ? VK_SEMAPHORE_IMPORT_TEMPORARY_BIT_KHR : 0; - info_vk.handleType = static_cast(Anvil::Utils::convert_external_semaphore_handle_type_bits_to_vk_external_semaphore_handle_type_flags(in_handle_type) ); + info_vk.handleType = static_cast(in_handle_type); info_vk.pNext = nullptr; info_vk.semaphore = m_semaphore; @@ -287,14 +287,14 @@ void Anvil::Semaphore::release_semaphore() /* Please see header for specification */ bool Anvil::Semaphore::reset() { - VkResult result (VK_ERROR_INITIALIZATION_FAILED); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); Anvil::StructChainer struct_chainer; Anvil::StructChainUniquePtr struct_chain_ptr; release_semaphore(); /* Sanity checks */ - if (m_create_info_ptr->get_exportable_external_semaphore_handle_types() != Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_NONE) + if (m_create_info_ptr->get_exportable_external_semaphore_handle_types() != Anvil::ExternalSemaphoreHandleTypeFlagBits::NONE) { if (!m_device_ptr->get_extension_info()->khr_external_semaphore() ) { @@ -315,11 +315,11 @@ bool Anvil::Semaphore::reset() struct_chainer.append_struct(semaphore_create_info); } - if (m_create_info_ptr->get_exportable_external_semaphore_handle_types() != Anvil::EXTERNAL_FENCE_HANDLE_TYPE_NONE) + if (m_create_info_ptr->get_exportable_external_semaphore_handle_types() != Anvil::ExternalSemaphoreHandleTypeFlagBits::NONE) { VkExportSemaphoreCreateInfo create_info; - create_info.handleTypes = Anvil::Utils::convert_external_semaphore_handle_type_bits_to_vk_external_semaphore_handle_type_flags(m_create_info_ptr->get_exportable_external_semaphore_handle_types() ); + create_info.handleTypes = m_create_info_ptr->get_exportable_external_semaphore_handle_types().get_vk(); create_info.pNext = nullptr; create_info.sType = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHR; @@ -334,9 +334,9 @@ bool Anvil::Semaphore::reset() { VkExportSemaphoreWin32HandleInfoKHR handle_info; - anvil_assert( nt_handle_info_ptr != nullptr); - anvil_assert((m_create_info_ptr->get_exportable_external_semaphore_handle_types() & Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT) || - (m_create_info_ptr->get_exportable_external_semaphore_handle_types() & Anvil::EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT) ); + anvil_assert( nt_handle_info_ptr != nullptr); + anvil_assert(((m_create_info_ptr->get_exportable_external_semaphore_handle_types() & Anvil::ExternalSemaphoreHandleTypeFlagBits::OPAQUE_WIN32_BIT) != 0) || + ((m_create_info_ptr->get_exportable_external_semaphore_handle_types() & Anvil::ExternalSemaphoreHandleTypeFlagBits::D3D12_FENCE_BIT) != 0)); handle_info.dwAccess = nt_handle_info_ptr->access; handle_info.name = (nt_handle_info_ptr->name.size() > 0) ? &nt_handle_info_ptr->name.at(0) diff --git a/src/wrappers/shader_module.cpp b/src/wrappers/shader_module.cpp index c34f58e5..9475373b 100644 --- a/src/wrappers/shader_module.cpp +++ b/src/wrappers/shader_module.cpp @@ -52,13 +52,13 @@ Anvil::ShaderModule::ShaderModule(const Anvil::BaseDevice* in_device_ptr, anvil_assert(shader_spirv_blob != nullptr); anvil_assert(shader_spirv_blob_size > 0); - m_cs_entrypoint_name = (shader_stage == SHADER_STAGE_COMPUTE) ? "main" : ""; - m_fs_entrypoint_name = (shader_stage == SHADER_STAGE_FRAGMENT) ? "main" : ""; + m_cs_entrypoint_name = (shader_stage == ShaderStage::COMPUTE) ? "main" : ""; + m_fs_entrypoint_name = (shader_stage == ShaderStage::FRAGMENT) ? "main" : ""; m_glsl_source_code = in_spirv_generator_ptr->get_glsl_source_code(); - m_gs_entrypoint_name = (shader_stage == SHADER_STAGE_GEOMETRY) ? "main" : ""; - m_tc_entrypoint_name = (shader_stage == SHADER_STAGE_TESSELLATION_CONTROL) ? "main" : ""; - m_te_entrypoint_name = (shader_stage == SHADER_STAGE_TESSELLATION_EVALUATION) ? "main" : ""; - m_vs_entrypoint_name = (shader_stage == SHADER_STAGE_VERTEX) ? "main" : ""; + m_gs_entrypoint_name = (shader_stage == ShaderStage::GEOMETRY) ? "main" : ""; + m_tc_entrypoint_name = (shader_stage == ShaderStage::TESSELLATION_CONTROL) ? "main" : ""; + m_te_entrypoint_name = (shader_stage == ShaderStage::TESSELLATION_EVALUATION) ? "main" : ""; + m_vs_entrypoint_name = (shader_stage == ShaderStage::VERTEX) ? "main" : ""; result = init_from_spirv_blob(shader_spirv_blob, shader_spirv_blob_size); @@ -137,12 +137,12 @@ Anvil::ShaderModuleUniquePtr Anvil::ShaderModule::create_from_spirv_generator(co result_ptr = shader_module_cache_ptr->get_cached_shader_module(in_device_ptr, in_spirv_generator_ptr->get_spirv_blob(), in_spirv_generator_ptr->get_spirv_blob_size(), - (shader_stage == SHADER_STAGE_COMPUTE) ? "main" : "", - (shader_stage == SHADER_STAGE_FRAGMENT) ? "main" : "", - (shader_stage == SHADER_STAGE_GEOMETRY) ? "main" : "", - (shader_stage == SHADER_STAGE_TESSELLATION_CONTROL) ? "main" : "", - (shader_stage == SHADER_STAGE_TESSELLATION_EVALUATION) ? "main" : "", - (shader_stage == SHADER_STAGE_VERTEX) ? "main" : ""); + (shader_stage == ShaderStage::COMPUTE) ? "main" : "", + (shader_stage == ShaderStage::FRAGMENT) ? "main" : "", + (shader_stage == ShaderStage::GEOMETRY) ? "main" : "", + (shader_stage == ShaderStage::TESSELLATION_CONTROL) ? "main" : "", + (shader_stage == ShaderStage::TESSELLATION_EVALUATION) ? "main" : "", + (shader_stage == ShaderStage::VERTEX) ? "main" : ""); if (result_ptr == nullptr) { diff --git a/src/wrappers/swapchain.cpp b/src/wrappers/swapchain.cpp index e17324ea..ecad0436 100644 --- a/src/wrappers/swapchain.cpp +++ b/src/wrappers/swapchain.cpp @@ -107,7 +107,7 @@ uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, switch (m_device_ptr->get_type() ) { - case Anvil::DEVICE_TYPE_MULTI_GPU: + case Anvil::DeviceType::MULTI_GPU: { const Anvil::MGPUDevice* mgpu_device_ptr (dynamic_cast(m_device_ptr) ); const uint32_t n_physical_devices(mgpu_device_ptr->get_n_physical_devices() ); @@ -130,7 +130,7 @@ uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, break; } - case Anvil::DEVICE_TYPE_SINGLE_GPU: + case Anvil::DeviceType::SINGLE_GPU: { const Anvil::PhysicalDevice* physical_device_ptr(nullptr); const Anvil::SGPUDevice* sgpu_device_ptr (dynamic_cast(m_device_ptr) ); @@ -189,7 +189,7 @@ uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_ fence_handle = m_image_available_fence_ptr->get_fence(); } - if (device_type == Anvil::DEVICE_TYPE_SINGLE_GPU) + if (device_type == Anvil::DeviceType::SINGLE_GPU) { const auto& khr_swapchain_entrypoints = m_device_ptr->get_extension_khr_swapchain_entrypoints(); @@ -206,7 +206,7 @@ uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_ const auto& khr_device_group_entrypoints(m_device_ptr->get_extension_khr_device_group_entrypoints() ); const Anvil::MGPUDevice* mgpu_device_ptr (dynamic_cast(m_device_ptr) ); - anvil_assert(device_type == Anvil::DEVICE_TYPE_MULTI_GPU); + anvil_assert(device_type == Anvil::DeviceType::MULTI_GPU); info.deviceMask = 0; info.fence = fence_handle; @@ -362,7 +362,7 @@ bool Anvil::Swapchain::init() VkResult result = VK_ERROR_INITIALIZATION_FAILED; Anvil::StructChainUniquePtr struct_chain_ptr; std::vector swapchain_images; - const VkSurfaceTransformFlagBitsKHR swapchain_transformation = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR; + const Anvil::SurfaceTransformFlagBits swapchain_transformation = Anvil::SurfaceTransformFlagBits::IDENTITY_BIT_KHR; const WindowPlatform window_platform = m_create_info_ptr->get_window()->get_platform(); const bool is_offscreen_rendering_enabled = (window_platform == WINDOW_PLATFORM_DUMMY || window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS); @@ -381,13 +381,13 @@ bool Anvil::Swapchain::init() const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr) ); const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr) ); - const Anvil::DeviceType device_type = m_device_ptr->get_type(); - uint32_t n_physical_devices = 0; - bool result_bool = false; - const char* required_surface_extension_name = nullptr; - VkSurfaceCapabilitiesKHR surface_caps; - VkCompositeAlphaFlagsKHR supported_composite_alpha_flags = static_cast(0); - VkSurfaceTransformFlagsKHR supported_surface_transform_flags; + const Anvil::DeviceType device_type = m_device_ptr->get_type(); + uint32_t n_physical_devices = 0; + bool result_bool = false; + const char* required_surface_extension_name = nullptr; + Anvil::SurfaceCapabilities surface_caps; + Anvil::CompositeAlphaFlags supported_composite_alpha_flags; + Anvil::SurfaceTransformFlags supported_surface_transform_flags; #ifdef _WIN32 #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) @@ -404,8 +404,8 @@ bool Anvil::Swapchain::init() switch (device_type) { - case Anvil::DEVICE_TYPE_MULTI_GPU: n_physical_devices = mgpu_device_ptr->get_n_physical_devices(); break; - case Anvil::DEVICE_TYPE_SINGLE_GPU: n_physical_devices = 1; break; + case Anvil::DeviceType::MULTI_GPU: n_physical_devices = mgpu_device_ptr->get_n_physical_devices(); break; + case Anvil::DeviceType::SINGLE_GPU: n_physical_devices = 1; break; default: { @@ -421,8 +421,8 @@ bool Anvil::Swapchain::init() switch (device_type) { - case Anvil::DEVICE_TYPE_MULTI_GPU: current_physical_device_ptr = mgpu_device_ptr->get_physical_device(n_physical_device); break; - case Anvil::DEVICE_TYPE_SINGLE_GPU: current_physical_device_ptr = sgpu_device_ptr->get_physical_device(); break; + case Anvil::DeviceType::MULTI_GPU: current_physical_device_ptr = mgpu_device_ptr->get_physical_device(n_physical_device); break; + case Anvil::DeviceType::SINGLE_GPU: current_physical_device_ptr = sgpu_device_ptr->get_physical_device(); break; default: { @@ -434,7 +434,7 @@ bool Anvil::Swapchain::init() anvil_assert(parent_surface_ptr->get_supported_composite_alpha_flags(current_physical_device_ptr, &supported_composite_alpha_flags) ); - anvil_assert(supported_composite_alpha_flags & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR); + anvil_assert((supported_composite_alpha_flags & Anvil::CompositeAlphaFlagBits::OPAQUE_BIT_KHR) != 0); /* Ensure we can use the swapchain image format */ anvil_assert(parent_surface_ptr->is_compatible_with_image_format(current_physical_device_ptr, @@ -446,14 +446,14 @@ bool Anvil::Swapchain::init() anvil_assert(parent_surface_ptr->get_supported_transformations(current_physical_device_ptr, &supported_surface_transform_flags) ); - anvil_assert(supported_surface_transform_flags & swapchain_transformation); + anvil_assert((supported_surface_transform_flags & swapchain_transformation) != 0); /* Ensure the requested number of swapchain images is reasonable*/ anvil_assert(parent_surface_ptr->get_capabilities(current_physical_device_ptr, &surface_caps) ); - anvil_assert(surface_caps.maxImageCount == 0 || - surface_caps.maxImageCount >= m_create_info_ptr->get_n_images() ); + anvil_assert(surface_caps.max_image_count == 0 || + surface_caps.max_image_count >= m_create_info_ptr->get_n_images() ); } } #endif @@ -463,20 +463,20 @@ bool Anvil::Swapchain::init() create_info.clipped = true; /* we won't be reading from the presentable images */ create_info.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; - create_info.flags = m_create_info_ptr->get_flags(); + create_info.flags = m_create_info_ptr->get_flags().get_vk(); create_info.imageArrayLayers = 1; create_info.imageColorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR; create_info.imageExtent.height = parent_surface_ptr->get_height(); create_info.imageExtent.width = parent_surface_ptr->get_width (); create_info.imageFormat = static_cast(m_create_info_ptr->get_format() ); create_info.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE; - create_info.imageUsage = static_cast (m_create_info_ptr->get_usage_flags() ); + create_info.imageUsage = m_create_info_ptr->get_usage_flags().get_vk(); create_info.minImageCount = m_create_info_ptr->get_n_images(); create_info.oldSwapchain = VK_NULL_HANDLE; create_info.pNext = nullptr; create_info.pQueueFamilyIndices = nullptr; - create_info.presentMode = m_create_info_ptr->get_present_mode(); - create_info.preTransform = swapchain_transformation; + create_info.presentMode = static_cast (m_create_info_ptr->get_present_mode() ); + create_info.preTransform = static_cast(swapchain_transformation); create_info.queueFamilyIndexCount = 0; create_info.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR; create_info.surface = parent_surface_ptr->get_surface(); @@ -488,11 +488,11 @@ bool Anvil::Swapchain::init() * make sure to chain this information */ const auto mgpu_present_mode_flags = m_create_info_ptr->get_mgpu_present_mode_flags(); - if (mgpu_present_mode_flags != VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR) + if (mgpu_present_mode_flags != Anvil::DeviceGroupPresentModeFlagBits::LOCAL_BIT_KHR) { VkDeviceGroupSwapchainCreateInfoKHR mgpu_create_info; - mgpu_create_info.modes = mgpu_present_mode_flags; + mgpu_create_info.modes = mgpu_present_mode_flags.get_vk(); mgpu_create_info.pNext = nullptr; mgpu_create_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR; @@ -536,7 +536,7 @@ bool Anvil::Swapchain::init() } else /* offscreen rendering */ { - m_create_info_ptr->set_usage_flags(m_create_info_ptr->get_usage_flags() | Anvil::IMAGE_USAGE_FLAG_TRANSFER_SRC_BIT); + m_create_info_ptr->set_usage_flags(m_create_info_ptr->get_usage_flags() | Anvil::ImageUsageFlagBits::TRANSFER_SRC_BIT); n_swapchain_images = m_create_info_ptr->get_n_images(); } @@ -568,12 +568,12 @@ bool Anvil::Swapchain::init() m_size.height, 1, /* base_mipmap_depth */ 1, - Anvil::SampleCountFlagBits::SAMPLE_COUNT_FLAG_1_BIT, - QUEUE_FAMILY_GRAPHICS_BIT, + Anvil::SampleCountFlagBits::_1_BIT, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::SharingMode::EXCLUSIVE, false, /* in_use_full_mipmap_chain */ - 0, /* in_memory_features */ - 0, /* in_create_flags */ + Anvil::MemoryFeatureFlagBits::NONE, + Anvil::ImageCreateFlagBits::NONE, Anvil::ImageLayout::GENERAL, nullptr); @@ -589,7 +589,7 @@ bool Anvil::Swapchain::init() 0, /* n_base_layer */ 0, /* n_base_mipmap_level */ 1, /* n_mipmaps */ - Anvil::ImageAspectFlagBits::IMAGE_ASPECT_FLAG_COLOR_BIT, + Anvil::ImageAspectFlagBits::COLOR_BIT, m_create_info_ptr->get_format(), Anvil::ComponentSwizzle::R, Anvil::ComponentSwizzle::G, @@ -612,7 +612,7 @@ bool Anvil::Swapchain::init() switch (m_device_ptr->get_type() ) { - case Anvil::DEVICE_TYPE_MULTI_GPU: + case Anvil::DeviceType::MULTI_GPU: { const Anvil::MGPUDevice* mgpu_device_ptr (dynamic_cast(m_device_ptr) ); const uint32_t n_physical_devices(mgpu_device_ptr->get_n_physical_devices() ); @@ -662,7 +662,7 @@ bool Anvil::Swapchain::init() break; } - case Anvil::DEVICE_TYPE_SINGLE_GPU: + case Anvil::DeviceType::SINGLE_GPU: { const std::vector* queue_fams_with_present_support_ptr(nullptr); const auto rendering_surface_ptr (m_create_info_ptr->get_rendering_surface() ); From 93689b67c15f2c9d99bf8ddca3cd3ff97faf377b Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Fri, 5 Oct 2018 14:53:35 +0200 Subject: [PATCH 24/50] Update wk40 #2 --- CMakeLists.txt | 66 +- examples/DynamicBuffers/CMakeLists.txt | 25 - examples/DynamicBuffers/src/app.cpp | 25 +- examples/MultiViewport/CMakeLists.txt | 29 +- examples/MultiViewport/src/app.cpp | 20 +- examples/OcclusionQuery/CMakeLists.txt | 28 - examples/OcclusionQuery/src/app.cpp | 71 +- .../OutOfOrderRasterization/CMakeLists.txt | 25 - examples/OutOfOrderRasterization/src/app.cpp | 52 +- examples/PushConstants/src/app.cpp | 20 +- include/config.h.in | 12 + include/misc/base_pipeline_create_info.h | 36 +- include/misc/callbacks.h | 7 +- include/misc/compute_pipeline_create_info.h | 12 +- include/misc/extensions.h | 173 ++++- include/misc/glsl_to_spirv.h | 8 +- include/misc/graphics_pipeline_create_info.h | 83 ++- include/misc/image_create_info.h | 31 + include/misc/library.h | 68 ++ include/misc/memalloc_backends/backend_vma.h | 9 +- include/misc/memory_allocator.h | 2 - include/misc/memory_block_create_info.h | 16 + include/misc/pools.h | 8 +- include/misc/render_pass_create_info.h | 121 +++- include/misc/sampler_create_info.h | 42 +- include/misc/swapchain_create_info.h | 13 + include/misc/types.h | 5 +- include/misc/types_enums.h | 79 +- include/misc/types_struct.h | 375 +++++++++- include/misc/vulkan.h | 175 +++++ include/wrappers/command_buffer.h | 245 +++---- include/wrappers/device.h | 81 ++- include/wrappers/instance.h | 5 + include/wrappers/physical_device.h | 7 + include/wrappers/pipeline_cache.h | 10 +- include/wrappers/rendering_surface.h | 8 +- include/wrappers/swapchain.h | 22 + src/misc/base_pipeline_create_info.cpp | 52 +- src/misc/base_pipeline_manager.cpp | 6 +- src/misc/compute_pipeline_create_info.cpp | 38 +- src/misc/glsl_to_spirv.cpp | 23 +- src/misc/graphics_pipeline_create_info.cpp | 162 +++-- src/misc/image_create_info.cpp | 23 + src/misc/io.cpp | 10 +- src/misc/library.cpp | 121 ++++ .../memalloc_backends/backend_oneshot.cpp | 61 +- src/misc/memalloc_backends/backend_vma.cpp | 41 ++ src/misc/memory_allocator.cpp | 93 +-- src/misc/object_tracker.cpp | 7 +- src/misc/render_pass_create_info.cpp | 135 ++++ src/misc/sampler_create_info.cpp | 33 +- src/misc/swapchain_create_info.cpp | 6 +- src/misc/types.cpp | 1 + src/misc/types_struct.cpp | 610 +++++++++++++--- src/misc/vulkan.cpp | 307 ++++++++ src/wrappers/buffer.cpp | 32 +- src/wrappers/buffer_view.cpp | 14 +- src/wrappers/command_buffer.cpp | 677 +++++++++++------- src/wrappers/command_pool.cpp | 20 +- src/wrappers/compute_pipeline_manager.cpp | 39 +- src/wrappers/descriptor_pool.cpp | 26 +- src/wrappers/descriptor_set.cpp | 10 +- src/wrappers/descriptor_set_layout.cpp | 14 +- src/wrappers/device.cpp | 299 +++++--- src/wrappers/event.cpp | 26 +- src/wrappers/fence.cpp | 30 +- src/wrappers/framebuffer.cpp | 20 +- src/wrappers/graphics_pipeline_manager.cpp | 123 ++-- src/wrappers/image.cpp | 84 ++- src/wrappers/image_view.cpp | 14 +- src/wrappers/instance.cpp | 376 ++++++++-- src/wrappers/memory_block.cpp | 123 ++-- src/wrappers/physical_device.cpp | 590 ++++++++------- src/wrappers/pipeline_cache.cpp | 36 +- src/wrappers/pipeline_layout.cpp | 14 +- src/wrappers/query_pool.cpp | 30 +- src/wrappers/queue.cpp | 52 +- src/wrappers/render_pass.cpp | 114 ++- src/wrappers/rendering_surface.cpp | 26 +- src/wrappers/sampler.cpp | 28 +- src/wrappers/semaphore.cpp | 14 +- src/wrappers/shader_module.cpp | 14 +- src/wrappers/swapchain.cpp | 44 +- 83 files changed, 4754 insertions(+), 1878 deletions(-) create mode 100644 include/misc/library.h create mode 100644 include/misc/vulkan.h create mode 100644 src/misc/library.cpp create mode 100644 src/misc/vulkan.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 14d86e31..a4db22c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,10 +3,23 @@ project (Anvil) option(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT "Includes 32-/64-bit Windows window system support (Windows builds only)" ON) option(ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT "Includes XCB window system support (Linux builds only)" ON) -option(ANVIL_LINK_WITH_GLSLANG "Links with glslang, instead of spawning a new process whenever GLSL->SPIR-V conversion is required" ON) option(ANVIL_LINK_EXAMPLES "Build examples showing how to use Anvil" OFF) +option(ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB "Link statically with Vulkan loader. If disabled, Anvil will load the func ptrs from ANVIL_VULKAN_DYNAMIC_DLL_DEPENDENCY at VK instance creation time" ON) +option(ANVIL_LINK_WITH_GLSLANG "Links with glslang, instead of spawning a new process whenever GLSL->SPIR-V conversion is required" ON) +option(ANVIL_USE_BUILT_IN_VULKAN_HEADERS "Use built-in Vulkan headers. If disabled, VK_SDK_PATH and VULKAN_SDK env vars will be assumed to hold the location where the headers can be found." ON) +if (MSVC) + set (DEFAULT_DYNAMIC_VK_DLL "vulkan-1.dll") +else() + set (DEFAULT_DYNAMIC_VK_DLL "libvulkan.so") +endif() + +if (NOT ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB) + set(ANVIL_VULKAN_DYNAMIC_DLL "${DEFAULT_DYNAMIC_VK_DLL}" + CACHE STRING "DLL to load Vulkan entrypoints from at Vulkan instance creation time. Only used if ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB is disabled. Only occurs at first Vulkan instance creation time") +endif() + # Do not modify anything after this line, unless you know what you're doing. configure_file("include/config.h.in" "include/config.h") @@ -14,23 +27,31 @@ include_directories("${Anvil_BINARY_DIR}/include" "${Anvil_SOURCE_DIR}" "${Anvil_SOURCE_DIR}/deps" "${Anvil_SOURCE_DIR}/include") - -if (WIN32) + +# Include the Vulkan header. +if (ANVIL_USE_BUILT_IN_VULKAN_HEADERS) + include_directories("${Anvil_SOURCE_DIR}/include") +else() + if (WIN32) + include_directories($ENV{VK_SDK_PATH}/Include + $ENV{VULKAN_SDK}/Include) + else() + include_directories($ENV{VK_SDK_PATH}/x86_64/include + $ENV{VULKAN_SDK}/include + $ENV{VULKAN_SDK}/x86_64/include) + endif() +endif() + +if (ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB) if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") - link_directories ($ENV{VK_SDK_PATH}/Bin - $ENV{VK_SDK_PATH}/Lib - $ENV{VULKAN_SDK}/Bin - $ENV{VULKAN_SDK}/Lib) + find_library(VULKAN_LIBRARY + NAMES vulkan-1 vulkan + PATHS "$ENV{VK_SDK_PATH}/Lib" "$ENV{VK_SDK_PATH}/Bin" "$ENV{VULKAN_SDK}/Lib" "$ENV{VULKAN_SDK}/Bin" "$ENV{VULKAN_SDK}/lib") else() - link_directories ($ENV{VK_SDK_PATH}/Bin32 - $ENV{VK_SDK_PATH}/Lib32 - $ENV{VULKAN_SDK}/Bin32 - $ENV{VULKAN_SDK}/Lib32) + find_library(VULKAN_LIBRARY + NAMES vulkan-1 vulkan + PATHS "$ENV{VK_SDK_PATH}/Lib32" "$ENV{VK_SDK_PATH}/Bin32" "$ENV{VULKAN_SDK}/Lib32" "$ENV{VULKAN_SDK}/Bin32" "$ENV{VULKAN_SDK}/lib") endif() -else() - link_directories ($ENV{VK_SDK_PATH}/x86_64/lib - $ENV{VULKAN_SDK}/lib - $ENV{VULKAN_SDK}/x86_64/lib) endif() SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_oneshot.h" @@ -56,6 +77,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/include/misc/image_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/image_view_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/io.h" + "${Anvil_SOURCE_DIR}/include/misc/library.h" "${Anvil_SOURCE_DIR}/include/misc/memory_allocator.h" "${Anvil_SOURCE_DIR}/include/misc/memory_block_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/mt_safety.h" @@ -76,6 +98,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/include/misc/types_macro.h" "${Anvil_SOURCE_DIR}/include/misc/types_struct.h" "${Anvil_SOURCE_DIR}/include/misc/types_utils.h" + "${Anvil_SOURCE_DIR}/include/misc/vulkan.h" "${Anvil_SOURCE_DIR}/include/misc/window.h" "${Anvil_SOURCE_DIR}/include/misc/window_factory.h" "${Anvil_SOURCE_DIR}/include/wrappers/buffer.h" @@ -132,6 +155,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/src/misc/image_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/image_view_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/io.cpp" + "${Anvil_SOURCE_DIR}/src/misc/library.cpp" "${Anvil_SOURCE_DIR}/src/misc/memory_allocator.cpp" "${Anvil_SOURCE_DIR}/src/misc/memory_block_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/object_tracker.cpp" @@ -147,6 +171,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/src/misc/types_classes.cpp" "${Anvil_SOURCE_DIR}/src/misc/types_struct.cpp" "${Anvil_SOURCE_DIR}/src/misc/types_utils.cpp" + "${Anvil_SOURCE_DIR}/src/misc/vulkan.cpp" "${Anvil_SOURCE_DIR}/src/misc/window.cpp" "${Anvil_SOURCE_DIR}/src/misc/window_factory.cpp" "${Anvil_SOURCE_DIR}/src/wrappers/buffer.cpp" @@ -212,15 +237,15 @@ add_library(Anvil STATIC ${SRC_LIST}) if (WIN32) if (ANVIL_LINK_WITH_GLSLANG) - target_link_libraries(Anvil glslang HLSL OGLCompiler OSDependent SPIRV vulkan-1.lib) + target_link_libraries(Anvil glslang HLSL OGLCompiler OSDependent SPIRV ${VULKAN_LIBRARY}) else() - target_link_libraries(Anvil vulkan-1.lib) + target_link_libraries(Anvil ${VULKAN_LIBRARY}) endif() else() if (ANVIL_LINK_WITH_GLSLANG) - target_link_libraries(Anvil glslang HLSL OGLCompiler OSDependent SPIRV vulkan pthread) + target_link_libraries(Anvil glslang HLSL OGLCompiler OSDependent SPIRV ${VULKAN_LIBRARY} pthread) else() - target_link_libraries(Anvil vulkan pthread) + target_link_libraries(Anvil ${VULKAN_LIBRARY} pthread) endif() endif() @@ -259,6 +284,3 @@ endif (CMAKE_COMPILER_IS_GNUCC) if (MSVC) target_compile_options(Anvil PRIVATE "/W4" "/WX" "/wd4191" "/wd4350" "/wd4668" "/wd4820" "/wd4514" "/wd4061" "/wd4710" "/wd4711" "/wd4548" "/wd4555") endif (MSVC) - -# Add all demo sub-projects -MESSAGE(STATUS "Using Vulkan SDK at either " $ENV{VK_SDK_PATH} " or " $ENV{VULKAN_SDK}) diff --git a/examples/DynamicBuffers/CMakeLists.txt b/examples/DynamicBuffers/CMakeLists.txt index 3097ea3c..9df6640e 100644 --- a/examples/DynamicBuffers/CMakeLists.txt +++ b/examples/DynamicBuffers/CMakeLists.txt @@ -25,31 +25,6 @@ target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/inclu include_directories(${Anvil_SOURCE_DIR}/include ${DynamicBuffers_SOURCE_DIR}/include) -# Include the Vulkan header. -if (WIN32) - include_directories($ENV{VK_SDK_PATH}/Include - $ENV{VULKAN_SDK}/Include) - - if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") - link_directories ($ENV{VK_SDK_PATH}/Bin - $ENV{VK_SDK_PATH}/Lib - $ENV{VULKAN_SDK}/Bin - $ENV{VULKAN_SDK}/Lib) - else() - link_directories ($ENV{VK_SDK_PATH}/Bin32 - $ENV{VK_SDK_PATH}/Lib32 - $ENV{VULKAN_SDK}/Bin32 - $ENV{VULKAN_SDK}/Lib32) - endif() -else() - include_directories($ENV{VK_SDK_PATH}/x86_64/include - $ENV{VULKAN_SDK}/include - $ENV{VULKAN_SDK}/x86_64/include) - link_directories ($ENV{VK_SDK_PATH}/x86_64/lib - $ENV{VULKAN_SDK}/lib - $ENV{VULKAN_SDK}/x86_64/lib) -endif() - # Create the DynamicBuffers project. add_executable (DynamicBuffers include/app.h include/app.h diff --git a/examples/DynamicBuffers/src/app.cpp b/examples/DynamicBuffers/src/app.cpp index 7187cef5..54ffafd8 100644 --- a/examples/DynamicBuffers/src/app.cpp +++ b/examples/DynamicBuffers/src/app.cpp @@ -206,7 +206,7 @@ void App::deinit() auto compute_pipeline_manager_ptr = m_device_ptr->get_compute_pipeline_manager (); auto gfx_pipeline_manager_ptr = m_device_ptr->get_graphics_pipeline_manager(); - vkDeviceWaitIdle(m_device_ptr->get_device_vk() ); + Anvil::Vulkan::vkDeviceWaitIdle(m_device_ptr->get_device_vk() ); if (m_consumer_pipeline_id != UINT32_MAX) { @@ -811,9 +811,8 @@ void App::init_compute_pipelines() bool result; /* Create & configure the compute pipeline */ - auto producer_pipeline_info_ptr = Anvil::ComputePipelineCreateInfo::create_regular(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - *m_producer_cs_ptr); + auto producer_pipeline_info_ptr = Anvil::ComputePipelineCreateInfo::create(Anvil::PipelineCreateFlagBits::NONE, + *m_producer_cs_ptr); producer_pipeline_info_ptr->attach_push_constant_range (0, /* offset */ 4, /* size */ @@ -992,15 +991,14 @@ void App::init_gfx_pipelines() /* Set up the graphics pipeline for the main subpass */ - auto consumer_pipeline_info_ptr = Anvil::GraphicsPipelineCreateInfo::create_regular(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - m_consumer_render_pass_ptr.get(), - render_pass_subpass_id, - *m_consumer_fs_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader */ - *m_consumer_vs_ptr); + auto consumer_pipeline_info_ptr = Anvil::GraphicsPipelineCreateInfo::create(Anvil::PipelineCreateFlagBits::NONE, + m_consumer_render_pass_ptr.get(), + render_pass_subpass_id, + *m_consumer_fs_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader */ + *m_consumer_vs_ptr); consumer_pipeline_info_ptr->add_vertex_attribute (0, /* location */ Anvil::Format::R8G8_UNORM, @@ -1179,6 +1177,7 @@ void App::init_swapchain() m_swapchain_ptr = reinterpret_cast(m_device_ptr.get())->create_swapchain(m_rendering_surface_ptr.get(), m_window_ptr.get (), Anvil::Format::B8G8R8A8_UNORM, + Anvil::ColorSpaceKHR::SRGB_NONLINEAR_KHR, Anvil::PresentModeKHR::FIFO_KHR, Anvil::ImageUsageFlagBits::COLOR_ATTACHMENT_BIT, m_n_swapchain_images); diff --git a/examples/MultiViewport/CMakeLists.txt b/examples/MultiViewport/CMakeLists.txt index 67769346..2244c72e 100644 --- a/examples/MultiViewport/CMakeLists.txt +++ b/examples/MultiViewport/CMakeLists.txt @@ -22,33 +22,6 @@ endif() target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/include") -include_directories(${Anvil_SOURCE_DIR}/include - ${MultiViewport_SOURCE_DIR}/include) - -if (WIN32) - include_directories($ENV{VK_SDK_PATH}/Include - $ENV{VULKAN_SDK}/Include) - - if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") - link_directories ($ENV{VK_SDK_PATH}/Bin - $ENV{VK_SDK_PATH}/Lib - $ENV{VULKAN_SDK}/Bin - $ENV{VULKAN_SDK}/Lib) - else() - link_directories ($ENV{VK_SDK_PATH}/Bin32 - $ENV{VK_SDK_PATH}/Lib32 - $ENV{VULKAN_SDK}/Bin32 - $ENV{VULKAN_SDK}/Lib32) - endif() -else() - include_directories($ENV{VK_SDK_PATH}/x86_64/include - $ENV{VULKAN_SDK}/include - $ENV{VULKAN_SDK}/x86_64/include) - link_directories ($ENV{VK_SDK_PATH}/x86_64/lib - $ENV{VULKAN_SDK}/lib - $ENV{VULKAN_SDK}/x86_64/lib) -endif() - include_directories(${Anvil_SOURCE_DIR}/include ${MultiViewport_SOURCE_DIR}/include) @@ -58,7 +31,7 @@ add_executable (MultiViewport include/app.h src/app.cpp) # Add linking dependencies for the example projects -add_dependencies (MultiViewport Anvil) +add_dependencies(MultiViewport Anvil) if (WIN32) target_link_libraries(MultiViewport Anvil) diff --git a/examples/MultiViewport/src/app.cpp b/examples/MultiViewport/src/app.cpp index 833518aa..b755ef78 100644 --- a/examples/MultiViewport/src/app.cpp +++ b/examples/MultiViewport/src/app.cpp @@ -190,7 +190,7 @@ App::~App() void App::deinit() { - vkDeviceWaitIdle(m_device_ptr->get_device_vk() ); + Anvil::Vulkan::vkDeviceWaitIdle(m_device_ptr->get_device_vk() ); m_frame_signal_semaphores.clear(); m_frame_wait_semaphores.clear(); @@ -700,15 +700,14 @@ void App::init_gfx_pipelines() m_renderpass_ptr->set_name("Main renderpass"); /* Configure the graphics pipeline */ - gfx_pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create_regular(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - m_renderpass_ptr.get(), - render_pass_subpass_id, - *m_fs_ptr, - *m_gs_ptr, - Anvil::ShaderModuleStageEntryPoint(), - Anvil::ShaderModuleStageEntryPoint(), - *m_vs_ptr); + gfx_pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create(Anvil::PipelineCreateFlagBits::NONE, + m_renderpass_ptr.get(), + render_pass_subpass_id, + *m_fs_ptr, + *m_gs_ptr, + Anvil::ShaderModuleStageEntryPoint(), + Anvil::ShaderModuleStageEntryPoint(), + *m_vs_ptr); gfx_pipeline_create_info_ptr->set_n_dynamic_viewports (sizeof(scissors) / sizeof(scissors[0]) ); gfx_pipeline_create_info_ptr->set_primitive_topology (Anvil::PrimitiveTopology::TRIANGLE_FAN); @@ -862,6 +861,7 @@ void App::init_swapchain() m_swapchain_ptr = dynamic_cast(m_device_ptr.get() )->create_swapchain(m_rendering_surface_ptr.get(), m_window_ptr.get (), Anvil::Format::B8G8R8A8_UNORM, + Anvil::ColorSpaceKHR::SRGB_NONLINEAR_KHR, Anvil::PresentModeKHR::FIFO_KHR, Anvil::ImageUsageFlagBits::COLOR_ATTACHMENT_BIT, m_n_swapchain_images); diff --git a/examples/OcclusionQuery/CMakeLists.txt b/examples/OcclusionQuery/CMakeLists.txt index 18d8c605..78c828de 100644 --- a/examples/OcclusionQuery/CMakeLists.txt +++ b/examples/OcclusionQuery/CMakeLists.txt @@ -25,34 +25,6 @@ target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/inclu include_directories(${Anvil_SOURCE_DIR}/include ${OcclusionQuery_SOURCE_DIR}/include) -# Include the Vulkan header. -if (WIN32) - include_directories($ENV{VK_SDK_PATH}/Include - $ENV{VULKAN_SDK}/Include) - - if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") - link_directories ($ENV{VK_SDK_PATH}/Bin - $ENV{VK_SDK_PATH}/Lib - $ENV{VULKAN_SDK}/Bin - $ENV{VULKAN_SDK}/Lib) - else() - link_directories ($ENV{VK_SDK_PATH}/Bin32 - $ENV{VK_SDK_PATH}/Lib32 - $ENV{VULKAN_SDK}/Bin32 - $ENV{VULKAN_SDK}/Lib32) - endif() -else() - include_directories($ENV{VK_SDK_PATH}/x86_64/include - $ENV{VULKAN_SDK}/include - $ENV{VULKAN_SDK}/x86_64/include) - link_directories ($ENV{VK_SDK_PATH}/x86_64/lib - $ENV{VULKAN_SDK}/lib - $ENV{VULKAN_SDK}/x86_64/lib) -endif() - -include_directories(${Anvil_SOURCE_DIR}/include - ${OcclusionQuery_SOURCE_DIR}/include) - # Create the OcclusionQuery project. add_executable (OcclusionQuery include/app.h include/app.h diff --git a/examples/OcclusionQuery/src/app.cpp b/examples/OcclusionQuery/src/app.cpp index 4509f931..d1f67791 100644 --- a/examples/OcclusionQuery/src/app.cpp +++ b/examples/OcclusionQuery/src/app.cpp @@ -190,7 +190,7 @@ void App::deinit() { auto gfx_pipeline_manager_ptr = m_device_ptr->get_graphics_pipeline_manager(); - vkDeviceWaitIdle(m_device_ptr->get_device_vk() ); + Anvil::Vulkan::vkDeviceWaitIdle(m_device_ptr->get_device_vk() ); if (m_1stpass_depth_test_always_pipeline_id != UINT32_MAX) { @@ -832,24 +832,22 @@ void App::init_renderpasses() if (is_2nd_renderpass) { - auto depth_test_off_tri_subpass_gfx_pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create_regular(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - renderpass_ptr.get(), - m_renderpass_2ndpass_depth_test_off_tri_subpass_id, - *m_tri_fs_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* in_geometry_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* in_tess_control_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* in_tess_evaluation_shader_entrypoint */ - *m_tri_vs_ptr); - auto depth_test_off_quad_subpass_gfx_pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create_regular(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - renderpass_ptr.get(), - m_renderpass_2ndpass_depth_test_off_quad_subpass_id, - *m_quad_fs_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader_entrypoint */ - *m_quad_vs_ptr); + auto depth_test_off_tri_subpass_gfx_pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create(Anvil::PipelineCreateFlagBits::NONE, + renderpass_ptr.get(), + m_renderpass_2ndpass_depth_test_off_tri_subpass_id, + *m_tri_fs_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* in_geometry_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* in_tess_control_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* in_tess_evaluation_shader_entrypoint */ + *m_tri_vs_ptr); + auto depth_test_off_quad_subpass_gfx_pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create(Anvil::PipelineCreateFlagBits::NONE, + renderpass_ptr.get(), + m_renderpass_2ndpass_depth_test_off_quad_subpass_id, + *m_quad_fs_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader_entrypoint */ + *m_quad_vs_ptr); @@ -868,24 +866,22 @@ void App::init_renderpasses() } else { - auto depth_test_always_subpass_gfx_pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create_regular(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - renderpass_ptr.get(), - m_renderpass_1stpass_depth_test_always_subpass_id, - *m_tri_fs_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader_entrypoint */ - *m_tri_vs_ptr); - auto depth_test_equal_ot_subpass_gfx_pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create_regular(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - renderpass_ptr.get(), - m_renderpass_1stpass_depth_test_equal_ot_subpass_id, - *m_tri_fs_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader_entrypoint */ - *m_tri_vs_ptr); + auto depth_test_always_subpass_gfx_pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create(Anvil::PipelineCreateFlagBits::NONE, + renderpass_ptr.get(), + m_renderpass_1stpass_depth_test_always_subpass_id, + *m_tri_fs_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader_entrypoint */ + *m_tri_vs_ptr); + auto depth_test_equal_ot_subpass_gfx_pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create(Anvil::PipelineCreateFlagBits::NONE, + renderpass_ptr.get(), + m_renderpass_1stpass_depth_test_equal_ot_subpass_id, + *m_tri_fs_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* geometry_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_control_shader_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader_entrypoint */ + *m_tri_vs_ptr); depth_test_always_subpass_gfx_pipeline_create_info_ptr->set_descriptor_set_create_info(m_1stpass_dsg_ptr->get_descriptor_set_create_info() ); depth_test_always_subpass_gfx_pipeline_create_info_ptr->toggle_depth_test (true, /* in_should_enable */ @@ -1020,6 +1016,7 @@ void App::init_swapchain() m_swapchain_ptr = reinterpret_cast(m_device_ptr.get() )->create_swapchain(m_rendering_surface_ptr.get(), m_window_ptr.get (), Anvil::Format::B8G8R8A8_UNORM, + Anvil::ColorSpaceKHR::SRGB_NONLINEAR_KHR, Anvil::PresentModeKHR::FIFO_KHR, Anvil::ImageUsageFlagBits::COLOR_ATTACHMENT_BIT, m_n_swapchain_images); diff --git a/examples/OutOfOrderRasterization/CMakeLists.txt b/examples/OutOfOrderRasterization/CMakeLists.txt index 4bc86d0c..79358087 100644 --- a/examples/OutOfOrderRasterization/CMakeLists.txt +++ b/examples/OutOfOrderRasterization/CMakeLists.txt @@ -25,31 +25,6 @@ target_include_directories(Anvil PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/anvil/inclu include_directories(${Anvil_SOURCE_DIR}/include ${OutOfOrderRasterization_SOURCE_DIR}/include) -# Include the Vulkan header. -if (WIN32) - include_directories($ENV{VK_SDK_PATH}/Include - $ENV{VULKAN_SDK}/Include) - - if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") - link_directories ($ENV{VK_SDK_PATH}/Bin - $ENV{VK_SDK_PATH}/Lib - $ENV{VULKAN_SDK}/Bin - $ENV{VULKAN_SDK}/Lib) - else() - link_directories ($ENV{VK_SDK_PATH}/Bin32 - $ENV{VK_SDK_PATH}/Lib32 - $ENV{VULKAN_SDK}/Bin32 - $ENV{VULKAN_SDK}/Lib32) - endif() -else() - include_directories($ENV{VK_SDK_PATH}/x86_64/include - $ENV{VULKAN_SDK}/include - $ENV{VULKAN_SDK}/x86_64/include) - link_directories ($ENV{VK_SDK_PATH}/x86_64/lib - $ENV{VULKAN_SDK}/lib - $ENV{VULKAN_SDK}/x86_64/lib) -endif() - # Create the OutOfOrderRasterization project. add_executable (OutOfOrderRasterization include/app.h include/teapot_data.h diff --git a/examples/OutOfOrderRasterization/src/app.cpp b/examples/OutOfOrderRasterization/src/app.cpp index 18f4e9e9..087c8260 100644 --- a/examples/OutOfOrderRasterization/src/app.cpp +++ b/examples/OutOfOrderRasterization/src/app.cpp @@ -212,8 +212,7 @@ void App::clear_console_line() void App::deinit() { - - vkDeviceWaitIdle(m_device_ptr->get_device_vk() ); + Anvil::Vulkan::vkDeviceWaitIdle(m_device_ptr->get_device_vk() ); const Anvil::PipelineID gfx_pipeline_ids[] = { @@ -318,13 +317,13 @@ void App::draw_frame() n_signal_sem < n_physical_devices; ++n_signal_sem) { - frame_ready_for_present_submissions[n_signal_sem].physical_device_ptr = physical_devices_ptr [n_signal_sem]; - frame_ready_for_present_submissions[n_signal_sem].semaphore_ptr = curr_frame_signal_semaphores_ptr->semaphores[n_signal_sem].get(); + frame_ready_for_present_submissions[n_signal_sem].device_index = n_signal_sem; + frame_ready_for_present_submissions[n_signal_sem].semaphore_ptr = curr_frame_signal_semaphores_ptr->semaphores[n_signal_sem].get(); - frame_ready_for_present_semaphores [n_signal_sem] = frame_ready_for_present_submissions [n_signal_sem].semaphore_ptr; + frame_ready_for_present_semaphores[n_signal_sem] = frame_ready_for_present_submissions[n_signal_sem].semaphore_ptr; - frame_ready_to_render_submissions[n_signal_sem].physical_device_ptr = physical_devices_ptr [n_signal_sem]; - frame_ready_to_render_submissions[n_signal_sem].semaphore_ptr = curr_frame_wait_semaphores_ptr->semaphores[n_signal_sem].get(); + frame_ready_to_render_submissions[n_signal_sem].device_index = n_signal_sem; + frame_ready_to_render_submissions[n_signal_sem].semaphore_ptr = curr_frame_wait_semaphores_ptr->semaphores[n_signal_sem].get(); } /* if the frame has already been rendered to in the past, then given the fact we use FIFO presentation mode, @@ -335,7 +334,7 @@ void App::draw_frame() uint64_t timestamps[2]; /* top of pipe, bottom of pipe */ /* TODO: Do better than this. */ - vkDeviceWaitIdle(m_device_ptr->get_device_vk() ); + Anvil::Vulkan::vkDeviceWaitIdle(m_device_ptr->get_device_vk() ); { m_query_results_buffer_ptr->read(n_swapchain_image * sizeof(uint64_t) * 2, /* top of pipe, bottom of pipe */ @@ -739,15 +738,14 @@ void App::init_gfx_pipelines() : &m_ooo_enabled_pipeline_id; { - auto pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create_regular(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - m_renderpasses[0].get(), - 0, /* in_subpass_id */ - *m_fs_entrypoint_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* in_gs_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* in_tc_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* in_te_entrypoint */ - *m_vs_entrypoint_ptr); + auto pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create(Anvil::PipelineCreateFlagBits::NONE, + m_renderpasses[0].get(), + 0, /* in_subpass_id */ + *m_fs_entrypoint_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* in_gs_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* in_tc_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* in_te_entrypoint */ + *m_vs_entrypoint_ptr); pipeline_create_info_ptr->add_vertex_attribute(0, /* location */ Anvil::Format::R32G32B32_SFLOAT, @@ -898,16 +896,15 @@ void App::init_renderpasses() **/ if (m_general_pipeline_id == -1) { - auto gfx_manager_ptr = m_device_ptr->get_graphics_pipeline_manager (); - auto gfx_pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create_regular(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - renderpass_ptr.get(), - subpass_id, - *m_fs_entrypoint_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* in_gs_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* in_tc_entrypoint */ - Anvil::ShaderModuleStageEntryPoint(), /* in_te_entrypoint */ - *m_vs_entrypoint_ptr); + auto gfx_manager_ptr = m_device_ptr->get_graphics_pipeline_manager(); + auto gfx_pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create (Anvil::PipelineCreateFlagBits::NONE, + renderpass_ptr.get(), + subpass_id, + *m_fs_entrypoint_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* in_gs_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* in_tc_entrypoint */ + Anvil::ShaderModuleStageEntryPoint(), /* in_te_entrypoint */ + *m_vs_entrypoint_ptr); gfx_pipeline_create_info_ptr->add_vertex_attribute (0, /* location */ Anvil::Format::R32G32B32_SFLOAT, @@ -1084,6 +1081,7 @@ void App::init_swapchain() m_swapchain_ptr = sgpu_device_ptr->create_swapchain(m_rendering_surface_ptr.get(), m_window_ptr.get (), swapchain_format, + Anvil::ColorSpaceKHR::SRGB_NONLINEAR_KHR, swapchain_present_mode, swapchain_usage, m_n_swapchain_images); diff --git a/examples/PushConstants/src/app.cpp b/examples/PushConstants/src/app.cpp index a3db7f8d..bba0def8 100644 --- a/examples/PushConstants/src/app.cpp +++ b/examples/PushConstants/src/app.cpp @@ -221,7 +221,7 @@ void App::deinit() { auto gfx_pipeline_manager_ptr = m_device_ptr->get_graphics_pipeline_manager(); - vkDeviceWaitIdle(m_device_ptr->get_device_vk() ); + Anvil::Vulkan::vkDeviceWaitIdle(m_device_ptr->get_device_vk() ); if (m_pipeline_id != UINT32_MAX) { @@ -687,15 +687,14 @@ void App::init_gfx_pipelines() m_renderpass_ptr->set_name("Main renderpass"); - gfx_pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create_regular(false, /* in_disable_optimizations */ - false, /* in_allow_derivatives */ - m_renderpass_ptr.get(), - render_pass_subpass_id, - *m_fs_ptr, - Anvil::ShaderModuleStageEntryPoint(), /* in_geometry_shader */ - Anvil::ShaderModuleStageEntryPoint(), /* in_tess_control_shader */ - Anvil::ShaderModuleStageEntryPoint(), /* in_tess_evaluation_shader */ - *m_vs_ptr); + gfx_pipeline_create_info_ptr = Anvil::GraphicsPipelineCreateInfo::create(Anvil::PipelineCreateFlagBits::NONE, + m_renderpass_ptr.get(), + render_pass_subpass_id, + *m_fs_ptr, + Anvil::ShaderModuleStageEntryPoint(), /* in_geometry_shader */ + Anvil::ShaderModuleStageEntryPoint(), /* in_tess_control_shader */ + Anvil::ShaderModuleStageEntryPoint(), /* in_tess_evaluation_shader */ + *m_vs_ptr); @@ -825,6 +824,7 @@ void App::init_swapchain() m_swapchain_ptr = device_ptr->create_swapchain(m_rendering_surface_ptr.get(), m_window_ptr.get (), Anvil::Format::B8G8R8A8_UNORM, + Anvil::ColorSpaceKHR::SRGB_NONLINEAR_KHR, Anvil::PresentModeKHR::FIFO_KHR, Anvil::ImageUsageFlagBits::COLOR_ATTACHMENT_BIT, m_n_swapchain_images); diff --git a/include/config.h.in b/include/config.h.in index 5c5aa1bd..43758b4d 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -1,3 +1,15 @@ +/* Under no circumstances include Vulkan func prototypes. For a variety of reasons, + * these are NOT exposed by Anvil. + */ +#if !defined(ANVIL_VULKAN_CPP) + #define VK_NO_PROTOTYPES +#endif + +#cmakedefine ANVIL_VULKAN_DYNAMIC_DLL "@ANVIL_VULKAN_DYNAMIC_DLL@" + +/* Defined if Anvil links statically with a Vulkan library */ +#cmakedefine ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB + /* Defined if glslangvalidator is to be statically linked with Anvil */ #cmakedefine ANVIL_LINK_WITH_GLSLANG diff --git a/include/misc/base_pipeline_create_info.h b/include/misc/base_pipeline_create_info.h index 39b6b3d1..424a7fe0 100644 --- a/include/misc/base_pipeline_create_info.h +++ b/include/misc/base_pipeline_create_info.h @@ -36,7 +36,7 @@ namespace Anvil bool allows_derivatives() const { - return m_allow_derivatives; + return (m_create_flags & Anvil::PipelineCreateFlagBits::ALLOW_DERIVATIVES_BIT) != 0; } bool attach_push_constant_range(uint32_t in_offset, @@ -54,6 +54,11 @@ namespace Anvil return &m_ds_create_info_items; } + const char* get_name() const + { + return m_name.c_str(); + } + const PushConstantRanges& get_push_constant_ranges() const { return m_push_constant_ranges; @@ -69,7 +74,7 @@ namespace Anvil bool has_optimizations_disabled() const { - return m_disable_optimizations; + return (m_create_flags & Anvil::PipelineCreateFlagBits::DISABLE_OPTIMIZATION_BIT) != 0; } bool is_proxy() const @@ -79,6 +84,11 @@ namespace Anvil void set_descriptor_set_create_info(const std::vector* in_ds_create_info_vec_ptr); + void set_name(const std::string& in_name) + { + m_name = in_name; + } + protected: /* Protected functions */ @@ -100,18 +110,12 @@ namespace Anvil uint32_t in_n_data_bytes, const void* in_data_ptr); - void init_derivative(bool in_disable_optimizations, - bool in_allow_derivatives, - uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, - Anvil::PipelineID in_base_pipeline_id, - const std::vector* in_opt_ds_create_info_vec_ptr = nullptr); - void init_proxy (); - void init_regular (bool in_disable_optimizations, - bool in_allow_derivatives, - uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, - const std::vector* in_opt_ds_create_info_vec_ptr = nullptr); + void init (const Anvil::PipelineCreateFlags& in_create_flags, + uint32_t in_n_shader_module_stage_entrypoints, + const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, + const Anvil::PipelineID* in_opt_base_pipeline_id_ptr = nullptr, + const std::vector* in_opt_ds_create_info_vec_ptr = nullptr); + void init_proxy(); void copy_state_from(const BasePipelineCreateInfo* in_src_pipeline_create_info_ptr); @@ -123,12 +127,12 @@ namespace Anvil Anvil::PipelineID m_base_pipeline_id; std::vector m_ds_create_info_items; + std::string m_name; PushConstantRanges m_push_constant_ranges; std::vector m_specialization_constants_data_buffer; ShaderStageToSpecializationConstantsMap m_specialization_constants_map; - bool m_allow_derivatives; - bool m_disable_optimizations; + Anvil::PipelineCreateFlags m_create_flags; bool m_is_proxy; std::map m_shader_stages; diff --git a/include/misc/callbacks.h b/include/misc/callbacks.h index 4f04819f..51fb1c1c 100644 --- a/include/misc/callbacks.h +++ b/include/misc/callbacks.h @@ -301,12 +301,9 @@ namespace Anvil **/ virtual ~CallbacksSupportProvider() { - if (m_callbacks != nullptr) - { - delete [] m_callbacks; + delete [] m_callbacks; - m_callbacks = nullptr; - } + m_callbacks = nullptr; } /* ICallbacksSupportClient interface implementation */ diff --git a/include/misc/compute_pipeline_create_info.h b/include/misc/compute_pipeline_create_info.h index 09033907..e9f7c7ab 100644 --- a/include/misc/compute_pipeline_create_info.h +++ b/include/misc/compute_pipeline_create_info.h @@ -32,14 +32,10 @@ namespace Anvil { public: /* Public functions */ - static ComputePipelineCreateInfoUniquePtr create_derivative(bool in_disable_optimizations, - bool in_allow_derivatives, - const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info, - Anvil::PipelineID in_base_pipeline_id); - static ComputePipelineCreateInfoUniquePtr create_proxy (); - static ComputePipelineCreateInfoUniquePtr create_regular (bool in_disable_optimizations, - bool in_allow_derivatives, - const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info); + static ComputePipelineCreateInfoUniquePtr create (const Anvil::PipelineCreateFlags& in_create_flags, + const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info, + const Anvil::PipelineID* in_opt_base_pipeline_id_ptr = nullptr); + static ComputePipelineCreateInfoUniquePtr create_proxy(); /** Adds a new specialization constant. * diff --git a/include/misc/extensions.h b/include/misc/extensions.h index 7d074eb0..d3a5bf57 100644 --- a/include/misc/extensions.h +++ b/include/misc/extensions.h @@ -32,10 +32,12 @@ namespace Anvil template struct DeviceExtensions { + ValueType amd_buffer_marker; ValueType amd_draw_indirect_count; ValueType amd_gcn_shader; ValueType amd_gpu_shader_half_float; ValueType amd_gpu_shader_int16; + ValueType amd_mixed_attachment_samples; ValueType amd_negative_viewport_height; ValueType amd_rasterization_order; ValueType amd_shader_ballot; @@ -47,12 +49,20 @@ namespace Anvil ValueType amd_shader_trinary_minmax; ValueType amd_texture_gather_bias_lod; ValueType ext_debug_marker; + ValueType ext_depth_range_unrestricted; ValueType ext_descriptor_indexing; + ValueType ext_external_memory_host; + ValueType ext_hdr_metadata; + ValueType ext_sample_locations; + ValueType ext_sampler_filter_minmax; ValueType ext_shader_stencil_export; ValueType ext_shader_subgroup_ballot; ValueType ext_shader_subgroup_vote; + ValueType ext_shader_viewport_index_layer; + ValueType ext_swapchain_colorspace; ValueType ext_vertex_attribute_divisor; ValueType khr_16bit_storage; + ValueType khr_8bit_storage; ValueType khr_bind_memory2; ValueType khr_dedicated_allocation; ValueType khr_descriptor_update_template; @@ -61,13 +71,6 @@ namespace Anvil ValueType khr_external_fence; ValueType khr_external_memory; ValueType khr_external_semaphore; - ValueType khr_get_memory_requirements2; - ValueType khr_maintenance1; - ValueType khr_maintenance2; - ValueType khr_maintenance3; - ValueType khr_shader_draw_parameters; - ValueType khr_storage_buffer_storage_class; - ValueType khr_swapchain; #if defined(_WIN32) ValueType khr_external_fence_win32; @@ -79,6 +82,19 @@ namespace Anvil ValueType khr_external_semaphore_fd; #endif + ValueType khr_get_memory_requirements2; + ValueType khr_image_format_list; + ValueType khr_maintenance1; + ValueType khr_maintenance2; + ValueType khr_maintenance3; + ValueType khr_multiview; + ValueType khr_relaxed_block_layout; + ValueType khr_sampler_mirror_clamp_to_edge; + ValueType khr_shader_draw_parameters; + ValueType khr_storage_buffer_storage_class; + ValueType khr_swapchain; + ValueType khr_variable_pointers; + std::map values_by_extension_names; @@ -101,14 +117,16 @@ namespace Anvil std::vector recognized_extensions = { + {ExtensionData(VK_AMD_BUFFER_MARKER_EXTENSION_NAME, &amd_buffer_marker)}, {ExtensionData(VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME, &amd_draw_indirect_count)}, {ExtensionData(VK_AMD_GCN_SHADER_EXTENSION_NAME, &amd_gcn_shader)}, {ExtensionData(VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME, &amd_gpu_shader_half_float)}, {ExtensionData(VK_AMD_GPU_SHADER_INT16_EXTENSION_NAME, &amd_gpu_shader_int16)}, + {ExtensionData(VK_AMD_MIXED_ATTACHMENT_SAMPLES_EXTENSION_NAME, &amd_mixed_attachment_samples)}, {ExtensionData(VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME, &amd_negative_viewport_height)}, {ExtensionData(VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME, &amd_rasterization_order)}, {ExtensionData(VK_AMD_SHADER_BALLOT_EXTENSION_NAME, &amd_shader_ballot)}, - {ExtensionData("VK_AMD_shader_core_properties", &amd_shader_core_properties)}, + {ExtensionData(VK_AMD_SHADER_CORE_PROPERTIES_EXTENSION_NAME, &amd_shader_core_properties)}, {ExtensionData(VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME, &amd_shader_explicit_vertex_parameter)}, {ExtensionData(VK_AMD_SHADER_FRAGMENT_MASK_EXTENSION_NAME, &amd_shader_fragment_mask)}, {ExtensionData(VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_EXTENSION_NAME, &amd_shader_image_load_store_lod)}, @@ -116,14 +134,24 @@ namespace Anvil {ExtensionData(VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME, &amd_shader_trinary_minmax)}, {ExtensionData(VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME, &amd_texture_gather_bias_lod)}, {ExtensionData(VK_EXT_DEBUG_MARKER_EXTENSION_NAME, &ext_debug_marker)}, + {ExtensionData(VK_EXT_DEPTH_RANGE_UNRESTRICTED_EXTENSION_NAME, &ext_depth_range_unrestricted)}, {ExtensionData(VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, &ext_descriptor_indexing)}, + {ExtensionData(VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME, &ext_external_memory_host)}, + {ExtensionData(VK_EXT_HDR_METADATA_EXTENSION_NAME, &ext_hdr_metadata)}, + {ExtensionData(VK_EXT_SAMPLE_LOCATIONS_EXTENSION_NAME, &ext_sample_locations)}, + {ExtensionData(VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME, &ext_sampler_filter_minmax)}, {ExtensionData(VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME, &ext_shader_stencil_export)}, {ExtensionData(VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME, &ext_shader_subgroup_ballot)}, {ExtensionData(VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME, &ext_shader_subgroup_vote)}, + {ExtensionData(VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME, &ext_shader_viewport_index_layer)}, + {ExtensionData(VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME, &ext_swapchain_colorspace)}, {ExtensionData(VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, &ext_vertex_attribute_divisor)}, {ExtensionData(VK_KHR_16BIT_STORAGE_EXTENSION_NAME, &khr_16bit_storage)}, + {ExtensionData(VK_KHR_8BIT_STORAGE_EXTENSION_NAME, &khr_8bit_storage)}, + {ExtensionData(VK_KHR_BIND_MEMORY_2_EXTENSION_NAME, &khr_bind_memory2)}, {ExtensionData(VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME, &khr_dedicated_allocation)}, {ExtensionData(VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME, &khr_descriptor_update_template)}, + {ExtensionData(VK_KHR_DEVICE_GROUP_EXTENSION_NAME, &khr_device_group)}, {ExtensionData(VK_KHR_DRAW_INDIRECT_COUNT_EXTENSION_NAME, &khr_draw_indirect_count)}, {ExtensionData(VK_KHR_EXTERNAL_FENCE_EXTENSION_NAME, &khr_external_fence)}, {ExtensionData(VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME, &khr_external_memory)}, @@ -138,14 +166,17 @@ namespace Anvil {ExtensionData(VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME, &khr_external_semaphore_fd)}, #endif {ExtensionData(VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME, &khr_get_memory_requirements2)}, + {ExtensionData(VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME, &khr_image_format_list)}, {ExtensionData(VK_KHR_MAINTENANCE1_EXTENSION_NAME, &khr_maintenance1)}, {ExtensionData(VK_KHR_MAINTENANCE2_EXTENSION_NAME, &khr_maintenance2)}, {ExtensionData(VK_KHR_MAINTENANCE3_EXTENSION_NAME, &khr_maintenance3)}, - {ExtensionData(VK_KHR_DEVICE_GROUP_EXTENSION_NAME, &khr_device_group)}, - {ExtensionData(VK_KHR_BIND_MEMORY_2_EXTENSION_NAME, &khr_bind_memory2)}, + {ExtensionData(VK_KHR_MULTIVIEW_EXTENSION_NAME, &khr_multiview)}, + {ExtensionData(VK_KHR_RELAXED_BLOCK_LAYOUT_EXTENSION_NAME, &khr_relaxed_block_layout)}, + {ExtensionData(VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME, &khr_sampler_mirror_clamp_to_edge)}, {ExtensionData(VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME, &khr_shader_draw_parameters)}, {ExtensionData(VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_EXTENSION_NAME, &khr_storage_buffer_storage_class)}, {ExtensionData(VK_KHR_SWAPCHAIN_EXTENSION_NAME, &khr_swapchain)}, + {ExtensionData(VK_KHR_VARIABLE_POINTERS_EXTENSION_NAME, &khr_variable_pointers)}, }; values_by_extension_names = in_values_by_extension_names; @@ -257,10 +288,12 @@ namespace Anvil /* Stub */ } + virtual ValueType amd_buffer_marker () const = 0; virtual ValueType amd_draw_indirect_count () const = 0; virtual ValueType amd_gcn_shader () const = 0; virtual ValueType amd_gpu_shader_half_float () const = 0; virtual ValueType amd_gpu_shader_int16 () const = 0; + virtual ValueType amd_mixed_attachment_samples () const = 0; virtual ValueType amd_negative_viewport_height () const = 0; virtual ValueType amd_rasterization_order () const = 0; virtual ValueType amd_shader_ballot () const = 0; @@ -272,12 +305,20 @@ namespace Anvil virtual ValueType amd_shader_trinary_minmax () const = 0; virtual ValueType amd_texture_gather_bias_lod () const = 0; virtual ValueType ext_debug_marker () const = 0; + virtual ValueType ext_depth_range_unrestricted () const = 0; virtual ValueType ext_descriptor_indexing () const = 0; + virtual ValueType ext_external_memory_host () const = 0; + virtual ValueType ext_hdr_metadata () const = 0; + virtual ValueType ext_sample_locations () const = 0; + virtual ValueType ext_sampler_filter_minmax () const = 0; virtual ValueType ext_shader_stencil_export () const = 0; virtual ValueType ext_shader_subgroup_ballot () const = 0; virtual ValueType ext_shader_subgroup_vote () const = 0; + virtual ValueType ext_shader_viewport_index_layer () const = 0; + virtual ValueType ext_swapchain_colorspace () const = 0; virtual ValueType ext_vertex_attribute_divisor () const = 0; virtual ValueType khr_16bit_storage () const = 0; + virtual ValueType khr_8bit_storage () const = 0; virtual ValueType khr_bind_memory2 () const = 0; virtual ValueType khr_dedicated_allocation () const = 0; virtual ValueType khr_descriptor_update_template () const = 0; @@ -296,12 +337,18 @@ namespace Anvil virtual ValueType khr_external_semaphore_fd() const = 0; #endif virtual ValueType khr_get_memory_requirements2 () const = 0; + virtual ValueType khr_image_format_list () const = 0; virtual ValueType khr_maintenance1 () const = 0; virtual ValueType khr_maintenance2 () const = 0; virtual ValueType khr_maintenance3 () const = 0; + virtual ValueType khr_multiview () const = 0; + virtual ValueType khr_relaxed_block_layout () const = 0; + virtual ValueType khr_sampler_mirror_clamp_to_edge () const = 0; virtual ValueType khr_shader_draw_parameters () const = 0; virtual ValueType khr_storage_buffer_storage_class () const = 0; virtual ValueType khr_swapchain () const = 0; + virtual ValueType khr_variable_pointers () const = 0; + virtual ValueType by_name(const std::string& in_name) const = 0; }; @@ -421,6 +468,13 @@ namespace Anvil } /* IExtensionInfoDevice */ + ValueType amd_buffer_marker() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->amd_buffer_marker; + } + ValueType amd_draw_indirect_count() const final { anvil_assert(m_expose_device_extensions); @@ -449,6 +503,13 @@ namespace Anvil return m_device_extensions_ptr->amd_gpu_shader_int16; } + ValueType amd_mixed_attachment_samples() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->amd_mixed_attachment_samples; + } + ValueType amd_negative_viewport_height() const final { anvil_assert(m_expose_device_extensions); @@ -526,6 +587,13 @@ namespace Anvil return m_device_extensions_ptr->ext_debug_marker; } + ValueType ext_depth_range_unrestricted() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_depth_range_unrestricted; + } + ValueType ext_descriptor_indexing() const final { anvil_assert(m_expose_device_extensions); @@ -533,6 +601,27 @@ namespace Anvil return m_device_extensions_ptr->ext_descriptor_indexing; } + ValueType ext_external_memory_host() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_external_memory_host; + } + + ValueType ext_hdr_metadata() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_hdr_metadata; + } + + ValueType ext_sampler_filter_minmax() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_sampler_filter_minmax; + } + ValueType ext_vertex_attribute_divisor() const final { anvil_assert(m_expose_device_extensions); @@ -540,6 +629,14 @@ namespace Anvil return m_device_extensions_ptr->ext_vertex_attribute_divisor; } + ValueType ext_sample_locations() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_sample_locations; + + } + ValueType ext_shader_stencil_export() const final { anvil_assert(m_expose_device_extensions); @@ -561,6 +658,20 @@ namespace Anvil return m_device_extensions_ptr->ext_shader_subgroup_vote; } + ValueType ext_shader_viewport_index_layer() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_shader_viewport_index_layer; + } + + ValueType ext_swapchain_colorspace() const + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_swapchain_colorspace; + } + ValueType khr_16bit_storage() const final { anvil_assert(m_expose_device_extensions); @@ -568,6 +679,13 @@ namespace Anvil return m_device_extensions_ptr->khr_16bit_storage; } + ValueType khr_8bit_storage() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_8bit_storage; + } + ValueType khr_bind_memory2() const final { anvil_assert(m_expose_device_extensions); @@ -679,6 +797,13 @@ namespace Anvil return m_device_extensions_ptr->khr_get_memory_requirements2; } + ValueType khr_image_format_list() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_image_format_list; + } + ValueType khr_maintenance1() const final { anvil_assert(m_expose_device_extensions); @@ -700,6 +825,27 @@ namespace Anvil return m_device_extensions_ptr->khr_maintenance3; } + ValueType khr_multiview() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_multiview; + } + + ValueType khr_relaxed_block_layout() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_relaxed_block_layout; + } + + ValueType khr_sampler_mirror_clamp_to_edge() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_sampler_mirror_clamp_to_edge; + } + ValueType khr_storage_buffer_storage_class() const final { anvil_assert(m_expose_device_extensions); @@ -721,6 +867,13 @@ namespace Anvil return m_device_extensions_ptr->khr_swapchain; } + ValueType khr_variable_pointers() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_variable_pointers; + } + /* IExtensionInfoInstance */ ValueType khr_device_group_creation() const final diff --git a/include/misc/glsl_to_spirv.h b/include/misc/glsl_to_spirv.h index 370ba379..41b70f15 100644 --- a/include/misc/glsl_to_spirv.h +++ b/include/misc/glsl_to_spirv.h @@ -232,6 +232,11 @@ namespace Anvil return m_debug_info_log; } + const std::string& get_program_debug_info_log() const + { + return m_program_debug_info_log; + } + /** Returns info log which contains detailed information regarding the program linking process. * * Call if get_spirv_blob() returns nullptr to find out more about shader issues which @@ -339,6 +344,7 @@ namespace Anvil #ifdef ANVIL_LINK_WITH_GLSLANG mutable std::string m_debug_info_log; std::unique_ptr m_limits_ptr; + mutable std::string m_program_debug_info_log; mutable std::string m_program_info_log; mutable std::string m_shader_info_log; #endif @@ -358,4 +364,4 @@ namespace Anvil }; }; /* namespace Anvil */ -#endif /* MISC_GLSL_TO_SPIRV_H */ \ No newline at end of file +#endif /* MISC_GLSL_TO_SPIRV_H */ diff --git a/include/misc/graphics_pipeline_create_info.h b/include/misc/graphics_pipeline_create_info.h index 383f8597..b3d9b73c 100644 --- a/include/misc/graphics_pipeline_create_info.h +++ b/include/misc/graphics_pipeline_create_info.h @@ -31,27 +31,17 @@ namespace Anvil { public: /* Public functions */ - static Anvil::GraphicsPipelineCreateInfoUniquePtr create_derivative(bool in_disable_optimizations, - bool in_allow_derivatives, - const RenderPass* in_renderpass_ptr, - SubPassID in_subpass_id, - const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, - Anvil::PipelineID in_base_pipeline_id); + static Anvil::GraphicsPipelineCreateInfoUniquePtr create (const Anvil::PipelineCreateFlagBits& in_create_flags, + const RenderPass* in_renderpass_ptr, + SubPassID in_subpass_id, + const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, + const Anvil::GraphicsPipelineCreateInfo* in_opt_reference_pipeline_info_ptr = nullptr, + const Anvil::PipelineID* in_opt_base_pipeline_id_ptr = nullptr); static Anvil::GraphicsPipelineCreateInfoUniquePtr create_proxy(); - static Anvil::GraphicsPipelineCreateInfoUniquePtr create_regular(bool in_disable_optimizations, - bool in_allow_derivatives, - const RenderPass* in_renderpass_ptr, - SubPassID in_subpass_id, - const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, - const Anvil::GraphicsPipelineCreateInfo* in_opt_reference_pipeline_create_info_ptr = nullptr); ~GraphicsPipelineCreateInfo(); @@ -292,6 +282,25 @@ namespace Anvil return m_renderpass_ptr; } + /** Retrieves state configuration related to custom sample locations. + * + * @param out_opt_is_enabled_ptr If not null, deref will be set to true if custom sample locations have been + * enabled for the pipeline. + * @param out_opt_sample_locations_per_pixel_ptr If not null, deref will be set to the number of sample locations to be used + * per pixel. + * @param out_opt_sample_location_grid_size_ptr If not null, deref will be set to sample location grid size. + * @param out_opt_n_sample_locations_ptr If not null, deref will be set to the number of sample locations available + * for reading under *out_opt_sample_locations_ptr + * @param out_opt_sample_locations_ptr_ptr If not null, deref will be set to a ptr to an array holding custom sample + * locations. + * + **/ + void get_sample_location_state(bool* out_opt_is_enabled_ptr, + Anvil::SampleCountFlagBits* out_opt_sample_locations_per_pixel_ptr, + VkExtent2D* out_opt_sample_location_grid_size_ptr, + uint32_t* out_opt_n_sample_locations_ptr, + const Anvil::SampleLocation** out_opt_sample_locations_ptr_ptr); + /** Retrieves state configuration related to per-sample shading. * * @param out_opt_is_enabled_ptr If not null, deref will be set to true if per-sample shading @@ -299,7 +308,6 @@ namespace Anvil * @param out_opt_min_sample_shading_ptr If not null, deref will be set to the minimum sample shading value, * as specified at creation time. * - * @return true if successful, false otherwise. **/ void get_sample_shading_state(bool* out_opt_is_enabled_ptr, float* out_opt_min_sample_shading_ptr) const; @@ -533,6 +541,23 @@ namespace Anvil Anvil::FrontFace in_front_face, float in_line_width); + /** Sets all state related to custom sample locations support. + * + * This information is only used if custom sample locations is enabled (which can be done by calling + * toggle_sample_locations(). + * + * @param in_sample_locations_per_pixel Number of sample locations to use per pixel. + * @param in_sample_location_grid_size Size of the sample location grid to select custom sample locations for. + * @param in_n_sample_locations Number of sample locations defined under @param in_sample_locations_ptr. + * Must not be 0. + * @param in_sample_locations_ptr Array of sample locations to use. Must not be nullptr. Must hold at least + * @param in_n_sample_locations items. + */ + void set_sample_location_properties(const Anvil::SampleCountFlagBits& in_sample_locations_per_pixel, + const VkExtent2D& in_sample_location_grid_size, + const uint32_t& in_n_sample_locations, + const Anvil::SampleLocation* in_sample_locations_ptr); + /** Sets properties of a scissor box at the specified index. * * If @param n_scissor_box is larger than 1, all previous scissor boxes must also be defined @@ -689,6 +714,17 @@ namespace Anvil */ void toggle_rasterizer_discard(bool in_should_enable); + /** Enables or disables custom sample locations. + * + * NOTE: If you enable the functionality, also make sure to call set_sample_locations_properties() + * to configure additional state required at pipeline creation time. + * + * Requires VK_EXT_sample_locations. + * + * @param in_should_enable True to enable custom sample locations, false to disable the functionality. + */ + void toggle_sample_locations(bool in_should_enable); + /** Enables or disables the sample mask. * * Note: make sure to configure the sample mask using set_multisampling_properties() if you intend to use it. @@ -939,6 +975,7 @@ namespace Anvil bool m_logic_op_enabled; bool m_primitive_restart_enabled; bool m_rasterizer_discard_enabled; + bool m_sample_locations_enabled; bool m_sample_mask_enabled; bool m_sample_shading_enabled; @@ -946,6 +983,10 @@ namespace Anvil VkStencilOpState m_stencil_state_back_face; VkStencilOpState m_stencil_state_front_face; + VkExtent2D m_sample_location_grid_size; + std::vector m_sample_locations; + Anvil::SampleCountFlagBits m_sample_locations_per_pixel; + Anvil::RasterizationOrderAMD m_rasterization_order; TessellationDomainOrigin m_tessellation_domain_origin; diff --git a/include/misc/image_create_info.h b/include/misc/image_create_info.h index ec2ec026..bb1645d3 100644 --- a/include/misc/image_create_info.h +++ b/include/misc/image_create_info.h @@ -48,6 +48,7 @@ namespace Anvil * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * * - External memory handle types: none + * - Image format list: empty (ie. image views created from the image can use any compatible format) * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE * * @param in_device_ptr Device to use. @@ -109,6 +110,7 @@ namespace Anvil * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * * - External memory handle types: none + * - Image format list: empty (ie. image views created from the image can use any compatible format) * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE * * @param in_device_ptr Device to use. @@ -164,6 +166,7 @@ namespace Anvil * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * * - External memory handle types: none + * - Image format list: empty (ie. image views created from the image can use any compatible format) * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE * - Physical devices: none * - SFR rectangles: none @@ -192,6 +195,7 @@ namespace Anvil * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * * - External memory handle types: none + * - Image format list: empty (ie. image views created from the image can use any compatible format) * - Initial layout: Anvil::ImageLayout::UNDEFINED * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE * @@ -286,6 +290,18 @@ namespace Anvil return m_format; } + /* Tells which compatible image view formats have been specified for the image. + * + * Requires VK_KHR_image_format_list. + * + * @param out_n_image_view_formats_ptr Deref will be set to the number of formats the array under *out_image_view_formats_ptr_ptr + * holds. Must not be nullptr. + * @param out_image_view_formats_ptr_ptr Deref will be set to a ptr to an array of compatible formats. + * + **/ + void get_image_view_formats(uint32_t* out_n_image_view_formats_ptr, + const Anvil::Format** out_image_view_formats_ptr_ptr) const; + const Anvil::ImageInternalType& get_internal_type() const { return m_internal_type; @@ -431,6 +447,20 @@ namespace Anvil m_height = in_height; } + /* Lets the application specify what formats image views created off this image will use. + * + * This information will be chained to the image create info struct. + * + * Requires VK_KHR_image_format_list + * + * @param in_n_image_view_formats Number of formats available for reading under @param in_image_view_formats_ptr. + * Must not be 0. + * @param in_image_view_formats_ptr Image view formats to specify for the image. Must not be nullptr. + * + */ + void set_image_view_formats(const uint32_t& in_n_image_view_formats, + const Anvil::Format* in_image_view_formats_ptr); + void set_memory_features(const Anvil::MemoryFeatureFlags& in_memory_features) { m_memory_features = in_memory_features; @@ -576,6 +606,7 @@ namespace Anvil Anvil::ExternalMemoryHandleTypeFlags m_exportable_external_memory_handle_types; Anvil::Format m_format; uint32_t m_height; + std::vector m_image_view_formats; const Anvil::ImageInternalType m_internal_type; Anvil::MemoryFeatureFlags m_memory_features; std::vector m_mipmaps_to_upload; diff --git a/include/misc/library.h b/include/misc/library.h new file mode 100644 index 00000000..42299197 --- /dev/null +++ b/include/misc/library.h @@ -0,0 +1,68 @@ +// +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +/** Implements a wrapper for a single Vulkan instance. Implemented in order to: + * + * - manage life-time of Vulkan instances. + * - encapsulate all logic required to manipulate instances and children objects. + * - let ObjectTracker detect leaking Vulkan instance wrapper instances. + * + * The wrapper is NOT thread-safe. + **/ +#ifndef MISC_LIBRARY_H +#define MISC_LIBRARY_H + +#include "misc/types.h" + +namespace Anvil +{ + /* Forward declarations */ + class Library; + + typedef std::unique_ptr LibraryUniquePtr; + + class Library + { + public: + /* Public functions */ + static LibraryUniquePtr create(const char* in_dll_name); + + ~Library(); + + void* get_proc_address(const char* in_func_name) const; + + private: + /* Private functions */ + Library(const char* in_dll_name); + + bool init(); + + /* Private variables */ + const std::string m_dll_name; + void* m_handle; + + Library (const Library&) = delete; + Library& operator=(const Library&) = delete; + }; +} + +#endif /* MISC_LIBRARY_H */ \ No newline at end of file diff --git a/include/misc/memalloc_backends/backend_vma.h b/include/misc/memalloc_backends/backend_vma.h index ad31d58b..59cf5a20 100644 --- a/include/misc/memalloc_backends/backend_vma.h +++ b/include/misc/memalloc_backends/backend_vma.h @@ -109,8 +109,9 @@ namespace Anvil bool init(); /* Private variables */ - VmaAllocator m_allocator; - const Anvil::BaseDevice* m_device_ptr; + VmaAllocator m_allocator; + const Anvil::BaseDevice* m_device_ptr; + std::unique_ptr m_vma_func_ptrs; std::vector > m_refcount_helper; }; @@ -134,8 +135,8 @@ namespace Anvil void unmap (void* in_memory_object); /* Private variables */ - const Anvil::BaseDevice* m_device_ptr; - std::shared_ptr m_vma_allocator_ptr; + const Anvil::BaseDevice* m_device_ptr; + std::shared_ptr m_vma_allocator_ptr; }; }; }; diff --git a/include/misc/memory_allocator.h b/include/misc/memory_allocator.h index fcd48639..8ece61fd 100644 --- a/include/misc/memory_allocator.h +++ b/include/misc/memory_allocator.h @@ -502,8 +502,6 @@ namespace Anvil const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr); bool do_external_memory_handle_type_sanity_checks(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const; - bool do_mgpu_sanity_checks (const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_peer_memory_reqs_ptr) const; bool is_alloc_supported (uint32_t in_memory_types, Anvil::MemoryFeatureFlags in_memory_features, uint32_t* out_opt_filtered_memory_types_ptr) const; diff --git a/include/misc/memory_block_create_info.h b/include/misc/memory_block_create_info.h index 445603d9..b99216ab 100644 --- a/include/misc/memory_block_create_info.h +++ b/include/misc/memory_block_create_info.h @@ -254,6 +254,7 @@ namespace Anvil * Under Windows, if @param in_name is zero-sized, member of the VkImportMemoryWin32HandleInfoKHR struct, as chained to the VkMemoryAllocateInfo struct chain, * will be set to nullptr. * + * NOTE: This function MUST NOT be used for importing host pointers. Please use the other set_external_handle_import_info() function instead. * NOTE: For NT handles, you also need to call set_external_nt_handle_import_info(). * * Requires VK_KHR_external_memory_fd under Windows. @@ -279,6 +280,21 @@ namespace Anvil m_external_handle_import_info_specified = true; } + /* Lets the app specify imported handle details. + * + * NOTE: This function MUST NOT be used for importing handles other than host pointers. Please use the other set_external_handle_import_info() function instead. + * + * Requires VK_EXT_external_memory_host. + */ + void set_external_handle_import_info(void* in_host_pointer) + { + anvil_assert(!m_external_handle_import_info_specified); + anvil_assert( in_host_pointer != nullptr); + + m_external_handle_import_info.host_ptr = in_host_pointer; + m_external_handle_import_info_specified = true; + } + #if defined(_WIN32) /* Lets the app specify additional details for exportable NT handles. * diff --git a/include/misc/pools.h b/include/misc/pools.h index b4e54dff..b986e0c0 100644 --- a/include/misc/pools.h +++ b/include/misc/pools.h @@ -187,12 +187,8 @@ namespace Anvil m_available_pool_item_containers.pop_back(); } - if (m_worker_ptr != nullptr) - { - delete m_worker_ptr; - - m_worker_ptr = nullptr; - } + delete m_worker_ptr; + m_worker_ptr = nullptr; } /** Returns pool capacity */ diff --git a/include/misc/render_pass_create_info.h b/include/misc/render_pass_create_info.h index 47614181..5abd476e 100644 --- a/include/misc/render_pass_create_info.h +++ b/include/misc/render_pass_create_info.h @@ -160,6 +160,8 @@ namespace Anvil const Anvil::ImageAspectFlags& in_opt_aspects_accessed = Anvil::ImageAspectFlagBits::NONE); /** Adds a new external->subpass dependency to the internal data model. + * + * NOTE: @param in_dependency_flags must NOT include Anvil::DependencyFlagBits::VIEW_LOCAL_BIT. * * @param in_destination_subpass_id ID of the destination subpass. The subpass must have been * created earlier with an add_subpass() call. @@ -180,6 +182,10 @@ namespace Anvil Anvil::DependencyFlags in_dependency_flags); /** Adds a new self-subpass dependency to the internal data model. + * + * NOTE: If @param in_dependency_flags includes Anvil::DependencyFlagBits::VIEW_LOCAL_BIT, you must + * also call set_dependency_view_local_properties() to define the src<->dst view index relationship + * for the subpass. * * @param in_destination_subpass_id ID of the subpass to create the dep for. The subpass must have been * created earlier with an add_subpass() call. @@ -200,6 +206,8 @@ namespace Anvil Anvil::DependencyFlags in_dependency_flags); /** Adds a new subpass->external dependency to the internal data model. + * + * NOTE: @param in_dependency_flags must NOT include Anvil::DependencyFlagBits::VIEW_LOCAL_BIT. * * @param in_source_subpass_id ID of the source subpass. The subpass must have been * created earlier with an add_subpass() call. @@ -219,6 +227,10 @@ namespace Anvil Anvil::DependencyFlags in_dependency_flags); /** Adds a new subpass->subpass dependency to the internal data model. + * + * NOTE: If @param in_dependency_flags includes Anvil::DependencyFlagBits::VIEW_LOCAL_BIT, you must + * also call set_dependency_view_local_properties() to define the src<->dst view index relationship + * for the subpass. * * @param in_source_subpass_id ID of the source subpass. The subpass must have been * created earlier with an add_subpass() call. @@ -304,6 +316,19 @@ namespace Anvil Anvil::AccessFlags* out_source_access_mask_ptr, DependencyFlags* out_flags_ptr) const; + /* Returns the view offset associated with a given dependency. For view-global dependencies, zero will be returned. + * + * This function should only be called if is_multiview_enabled() returns true. + * + * @param in_n_dependency Index of the dependency to use for the query. + * @param out_view_offset_ptr If the function returns true, deref will be set to the view offset associated with the dependency. + * Must not be nullptr. + * + * @return true if successful, false otherwise. + **/ + bool get_dependency_multiview_properties(uint32_t in_n_dependency, + int32_t* out_view_offset_ptr) const; + /** Retrieves properties of the render pass color attachment with the user-specified ID * * @param in_attachment_id ID of the attachment to retrieve properties of. @@ -349,6 +374,18 @@ namespace Anvil **/ uint32_t get_max_color_location_used_by_subpass(const SubPassID& in_subpass_id) const; + /* Returns the correlation masks specified for the renderpass. + * + * This function should only be called if is_multiview_enabled() returns true. + * + * @param out_n_correlation_masks_ptr Deref will be set to the number of uint32s available for reading under *out_correlation_masks_ptr_ptr + * after the function leaves. Must not be nullptr. + * @param out_correlation_masks_ptr_ptr Deref will be set to a pointer to an array of uint32s holding correlation masks. Must nto be nullptr. + * + **/ + void get_multiview_correlation_masks(uint32_t* out_n_correlation_masks_ptr, + const uint32_t** out_correlation_masks_ptr_ptr) const; + /** Returns the number of added attachments */ uint32_t get_n_attachments() const { @@ -399,11 +436,75 @@ namespace Anvil AttachmentType in_attachment_type, uint32_t* out_n_attachments_ptr) const; + /* Returns the view mask associated with a given subpass. + * + * This function should only be called if is_multiview_enabled() returns true. + * + * @param in_subpass_id ID of the subpass to use for the query. + * @param out_view_mask_ptr If the function returns true, deref will be set to the view mask associated with the subpass. + * Must not be nullptr. + * + * @return true if successful, false otherwise. + **/ + bool get_subpass_view_mask(SubPassID in_subpass_id, + uint32_t* out_view_mask_ptr) const; + + /* Tells whether the renderpass uses multiview functionality. */ + bool is_multiview_enabled() const + { + return m_multiview_enabled; + } + + /* Specifies correlation mask(s) for the renderpass. + * + * If multiview is not already enabled for the renderpass, calling this function enables the functionality. + * + * Requires VK_KHR_multiview. + * + * @param in_n_correlation_masks Number of masks available for reading under @param in_correlation_masks_ptr. + * Must not be 0. + * @param in_correlation_masks_ptr Correlation masks to use for the renderpass. Please read VK_KHR_multiview spec + * for more details. + */ + void set_correlation_masks(const uint32_t& in_n_correlation_masks, + const uint32_t* in_correlation_masks_ptr); + + /** Specifies a view offset to use for a view-local dependency. + * + * If multiview is not already enabled for the renderpass, calling this function enables the functionality. + * + * Requires VK_KHR_multiview. + * + * @param in_subpass_id ID of the subpass to use. + * @param in_view_offset View offset to use for a view-local dependency defined at index @param in_n_dependency. Must not be zero + * for self-dependencies. + * + * @return true if successful, false otherwise. + */ + bool set_dependency_view_local_properties(const uint32_t& in_n_dependency, + const int32_t& in_view_offset); + void set_device_ptr(const Anvil::BaseDevice* in_device_ptr) { m_device_ptr = in_device_ptr; } + /** Specifies the view mask for a subpass associated with ID @param in_subpass_id. + * + * If multiview is not already enabled for the renderpass, calling this function enables the functionality. + * The implication is the application needs to set the view mask for all subpasses defined for the renderpass, + * before the create info structure can be passed over to Anvil::RenderPass. + * + * Requires VK_KHR_multiview. + * + * @param in_subpass_id ID of the subpass to use. + * @param in_view_mask View mask to use for the subpass. Please consult VK_KHR_multiview spec for more details. + * + * @return true if successful, false otherwise. + */ + bool set_subpass_view_mask(SubPassID in_subpass_id, + const uint32_t& in_view_mask); + private: /* Private type definitions */ @@ -572,6 +673,7 @@ namespace Anvil LocationToSubPassAttachmentMap color_attachments_map; SubPassAttachment depth_stencil_attachment; uint32_t index; + uint32_t multiview_view_mask; LocationToSubPassAttachmentMap input_attachments_map; SubPassAttachmentVector preserved_attachments; LocationToSubPassAttachmentMap resolved_attachments_map; @@ -597,7 +699,8 @@ namespace Anvil /** Dummy constructor. This should only be used by STL containers */ SubPass() { - index = UINT32_MAX; + index = UINT32_MAX; + multiview_view_mask = 0; } /** Constructor. @@ -607,7 +710,8 @@ namespace Anvil **/ SubPass(uint32_t in_index) { - index = in_index; + index = in_index; + multiview_view_mask = 0; } /* Destructor */ @@ -657,6 +761,8 @@ namespace Anvil const SubPass* destination_subpass_ptr; const SubPass* source_subpass_ptr; + int32_t multiview_view_offset; + /** Constructor. * * @param in_destination_stage_mask Destination pipeline stage mask. @@ -677,10 +783,11 @@ namespace Anvil Anvil::AccessFlags in_destination_access_mask, const DependencyFlags& in_flags) { - flags = in_flags; destination_stage_mask = in_destination_stage_mask; destination_subpass_ptr = in_destination_subpass_ptr; destination_access_mask = in_destination_access_mask; + flags = in_flags; + multiview_view_offset = INT32_MAX; source_access_mask = in_source_access_mask; source_stage_mask = in_source_stage_mask; source_subpass_ptr = in_source_subpass_ptr; @@ -690,16 +797,18 @@ namespace Anvil SubPassDependency() { destination_subpass_ptr = nullptr; + multiview_view_offset = INT32_MAX; source_subpass_ptr = nullptr; } /** Comparator operator */ bool operator==(const SubPassDependency& in) { - return in.flags == flags && - in.destination_access_mask == destination_access_mask && + return in.destination_access_mask == destination_access_mask && in.destination_stage_mask == destination_stage_mask && in.destination_subpass_ptr == destination_subpass_ptr && + in.flags == flags && + in.multiview_view_offset == multiview_view_offset && in.source_access_mask == source_access_mask && in.source_stage_mask == source_stage_mask && in.source_subpass_ptr == source_subpass_ptr; @@ -736,7 +845,9 @@ namespace Anvil /* Private variables */ RenderPassAttachments m_attachments; + std::vector m_correlation_masks; const Anvil::BaseDevice* m_device_ptr; + bool m_multiview_enabled; SubPasses m_subpasses; SubPassDependencies m_subpass_dependencies; mutable bool m_update_preserved_attachments; diff --git a/include/misc/sampler_create_info.h b/include/misc/sampler_create_info.h index 08e3af58..d10f1889 100644 --- a/include/misc/sampler_create_info.h +++ b/include/misc/sampler_create_info.h @@ -122,6 +122,11 @@ namespace Anvil return m_mt_safety; } + const Anvil::SamplerReductionMode& get_sampler_reduction_mode() const + { + return m_sampler_reduction_mode; + } + const bool& is_compare_enabled() const { return m_compare_enable; @@ -202,6 +207,12 @@ namespace Anvil m_compare_enable = in_compare_enable; } + /* NOTE: Requires VK_EXT_sampler_filter_minmax */ + void set_sampler_reduction_mode(const Anvil::SamplerReductionMode& in_reduction_mode) + { + m_sampler_reduction_mode = in_reduction_mode; + } + void set_uses_unnormalized_coordinates(const bool& in_use_unnormalized_coordinates) { m_use_unnormalized_coordinates = in_use_unnormalized_coordinates; @@ -234,21 +245,22 @@ namespace Anvil /* Private variables */ - Anvil::SamplerAddressMode m_address_mode_u; - Anvil::SamplerAddressMode m_address_mode_v; - Anvil::SamplerAddressMode m_address_mode_w; - Anvil::BorderColor m_border_color; - bool m_compare_enable; - Anvil::CompareOp m_compare_op; - float m_lod_bias; - Anvil::Filter m_mag_filter; - float m_max_anisotropy; - float m_max_lod; - Anvil::Filter m_min_filter; - float m_min_lod; - Anvil::SamplerMipmapMode m_mipmap_mode; - Anvil::MTSafety m_mt_safety; - bool m_use_unnormalized_coordinates; + Anvil::SamplerAddressMode m_address_mode_u; + Anvil::SamplerAddressMode m_address_mode_v; + Anvil::SamplerAddressMode m_address_mode_w; + Anvil::BorderColor m_border_color; + bool m_compare_enable; + Anvil::CompareOp m_compare_op; + float m_lod_bias; + Anvil::Filter m_mag_filter; + float m_max_anisotropy; + float m_max_lod; + Anvil::Filter m_min_filter; + float m_min_lod; + Anvil::SamplerMipmapMode m_mipmap_mode; + Anvil::MTSafety m_mt_safety; + Anvil::SamplerReductionMode m_sampler_reduction_mode; + bool m_use_unnormalized_coordinates; const Anvil::BaseDevice* m_device_ptr; diff --git a/include/misc/swapchain_create_info.h b/include/misc/swapchain_create_info.h index 41d07d9a..551f1591 100644 --- a/include/misc/swapchain_create_info.h +++ b/include/misc/swapchain_create_info.h @@ -45,10 +45,16 @@ namespace Anvil Anvil::RenderingSurface* in_parent_surface_ptr, Anvil::Window* in_window_ptr, Anvil::Format in_format, + Anvil::ColorSpaceKHR in_color_space, Anvil::PresentModeKHR in_present_mode, Anvil::ImageUsageFlags in_usage_flags, uint32_t in_n_images); + Anvil::ColorSpaceKHR get_color_space() const + { + return m_color_space; + } + /** Returns device instance which has been used to create the swapchain */ const Anvil::BaseDevice* get_device() const { @@ -106,6 +112,11 @@ namespace Anvil return m_window_ptr; } + void set_color_space(const Anvil::ColorSpaceKHR& in_color_space) + { + m_color_space = in_color_space; + } + void set_device(const Anvil::BaseDevice* in_device_ptr) { m_device_ptr = in_device_ptr; @@ -164,6 +175,7 @@ namespace Anvil Anvil::RenderingSurface* in_parent_surface_ptr, Anvil::Window* in_window_ptr, Anvil::Format in_format, + Anvil::ColorSpaceKHR in_color_space, Anvil::PresentModeKHR in_present_mode, Anvil::ImageUsageFlags in_usage_flags, uint32_t in_n_images, @@ -173,6 +185,7 @@ namespace Anvil /* Private variables */ + Anvil::ColorSpaceKHR m_color_space; const Anvil::BaseDevice* m_device_ptr; Anvil::SwapchainCreateFlags m_flags; Anvil::Format m_format; diff --git a/include/misc/types.h b/include/misc/types.h index 995cb029..c0d36daa 100644 --- a/include/misc/types.h +++ b/include/misc/types.h @@ -95,7 +95,7 @@ #include #endif -#include "vulkan/vulkan.h" +#include "misc/vulkan.h" #include "vulkan/vk_platform.h" #include @@ -254,9 +254,6 @@ namespace Anvil /* Unique ID of a render-pass attachment within scope of a RenderPass instance. */ typedef uint32_t RenderPassAttachmentID; - /* A pair of 32-bit FP values which describes a sample location */ - typedef std::pair SampleLocation; - /* Unique ID of a sparse memory bind update */ typedef uint32_t SparseMemoryBindInfoID; diff --git a/include/misc/types_enums.h b/include/misc/types_enums.h index 73a47def..c94542a1 100644 --- a/include/misc/types_enums.h +++ b/include/misc/types_enums.h @@ -408,6 +408,31 @@ namespace Anvil INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(ColorComponentFlags, VkColorComponentFlags, ColorComponentFlagBits) + /* NOTE: These map 1:1 to VK equivalents */ + enum class ColorSpaceKHR + { + /* VK_KHR_surface */ + SRGB_NONLINEAR_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, + + /* VK_EXT_swapchain_colorspace */ + DISPLAY_P3_NONLINEAR_EXT = VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT, + EXTENDED_SRGB_LINEAR_EXT = VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT, + DCI_P3_LINEAR_EXT = VK_COLOR_SPACE_DCI_P3_LINEAR_EXT, + DCI_P3_NONLINEAR_EXT = VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT, + BT709_LINEAR_EXT = VK_COLOR_SPACE_BT709_LINEAR_EXT, + BT709_NONLINEAR_EXT = VK_COLOR_SPACE_BT709_NONLINEAR_EXT, + BT2020_LINEAR_EXT = VK_COLOR_SPACE_BT2020_LINEAR_EXT, + HDR10_ST2084_EXT = VK_COLOR_SPACE_HDR10_ST2084_EXT, + DOLBYVISION_EXT = VK_COLOR_SPACE_DOLBYVISION_EXT, + HDR10_HLG_EXT = VK_COLOR_SPACE_HDR10_HLG_EXT, + ADOBERGB_LINEAR_EXT = VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT, + ADOBERGB_NONLINEAR_EXT = VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT, + PASS_THROUGH_EXT = VK_COLOR_SPACE_PASS_THROUGH_EXT, + EXTENDED_SRGB_NONLINEAR_EXT = VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT, + + UNKNOWN = VK_COLOR_SPACE_MAX_ENUM_KHR + }; + /* Note: These map 1:1 to VK equivalents. */ enum class ComponentSwizzle { @@ -443,6 +468,9 @@ namespace Anvil /* KHR_device_group */ DEVICE_GROUP_BIT = VK_DEPENDENCY_DEVICE_GROUP_BIT_KHR, + /* KHR_multiview */ + VIEW_LOCAL_BIT = VK_DEPENDENCY_VIEW_LOCAL_BIT_KHR, + NONE = 0 }; typedef Anvil::Bitfield DependencyFlags; @@ -474,6 +502,9 @@ namespace Anvil STENCIL_REFERENCE = VK_DYNAMIC_STATE_STENCIL_REFERENCE, STENCIL_WRITE_MASK = VK_DYNAMIC_STATE_STENCIL_WRITE_MASK, VIEWPORT = VK_DYNAMIC_STATE_VIEWPORT, + + /* VK_EXT_sample_locations */ + SAMPLE_LOCATIONS_EXT = VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT, }; enum class ExternalFenceHandleTypeFlagBits @@ -495,6 +526,7 @@ namespace Anvil enum class ExternalMemoryHandleTypeFlagBits { #if defined(_WIN32) + /* VK_KHR_external_memory_win32 */ OPAQUE_WIN32_BIT = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR, OPAQUE_WIN32_KMT_BIT = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR, D3D11_TEXTURE_BIT = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR, @@ -502,9 +534,14 @@ namespace Anvil D3D12_HEAP_BIT = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR, D3D12_RESOURCE_BIT = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR, #else + /* VK_KHR_external_memory_fd */ OPAQUE_FD_BIT = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR, #endif + /* VK_EXT_external_memory_host */ + HOST_ALLOCATION_BIT_EXT = VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT, + HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT = VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT, + NONE = 0, }; typedef Anvil::Bitfield ExternalMemoryHandleTypeFlags; @@ -545,6 +582,9 @@ namespace Anvil UNIFORM_TEXEL_BUFFER_BIT = VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT, VERTEX_BUFFER_BIT = VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT, + /* EXT_sampler_filter_minmax */ + SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT, + /* KHR_maintenance1 */ TRANSFER_DST_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR, TRANSFER_SRC_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR, @@ -980,6 +1020,9 @@ namespace Anvil MUTABLE_FORMAT_BIT = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, CUBE_COMPATIBLE_BIT = VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, + /* NOTE: Requires VK_EXT_sample_locations */ + SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT = VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT, + /* NOTE: Requires VK_KHR_bind_memory2 */ SPLIT_INSTANCE_BIND_REGIONS_BIT = VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR, ALIAS_BIT = VK_IMAGE_CREATE_ALIAS_BIT_KHR, @@ -1289,6 +1332,26 @@ namespace Anvil UNKNOWN = VK_POINT_CLIPPING_BEHAVIOR_MAX_ENUM }; + /* NOTE: These map 1:1 to VK equivalents */ + enum class PipelineCreateFlagBits + { + /* Core VK 1.0 */ + ALLOW_DERIVATIVES_BIT = VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT, + DISABLE_OPTIMIZATION_BIT = VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT, + DERIVATIVE_BIT = VK_PIPELINE_CREATE_DERIVATIVE_BIT, + + /* VK_KHR_multiview */ + VIEW_INDEX_FROM_DEVICE_INDEX_BIT = VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHR, + + /* VK_KHR_device_group */ + DISPATCH_BASE_BIT = VK_PIPELINE_CREATE_DISPATCH_BASE_KHR, + + NONE = 0 + }; + typedef Anvil::Bitfield PipelineCreateFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(PipelineCreateFlags, VkPipelineCreateFlags, PipelineCreateFlagBits) + /* NOTE: These map 1:1 to VK equivalents */ enum class PolygonMode { @@ -1469,12 +1532,15 @@ namespace Anvil /* NOTE: These map 1:1 to VK equivalents */ enum class SamplerAddressMode { + /* Core VK 1.0 */ CLAMP_TO_BORDER = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, CLAMP_TO_EDGE = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE, - MIRROR_CLAMP_TO_EDGE = VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE, MIRRORED_REPEAT = VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT, REPEAT = VK_SAMPLER_ADDRESS_MODE_REPEAT, + /* VK_KHR_sampler_mirror_clamp_to_edge */ + MIRROR_CLAMP_TO_EDGE = VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE, + UNKNOWN = VK_SAMPLER_ADDRESS_MODE_MAX_ENUM }; @@ -1487,6 +1553,17 @@ namespace Anvil UNKNOWN = VK_SAMPLER_MIPMAP_MODE_MAX_ENUM }; + /* NOTE: These map 1:1 to VK equivalents */ + enum class SamplerReductionMode + { + /* VK_EXT_sampler_filter_minmax */ + WEIGHTED_AVERAGE_EXT = VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT, + MAX_EXT = VK_SAMPLER_REDUCTION_MODE_MAX_EXT, + MIN_EXT = VK_SAMPLER_REDUCTION_MODE_MIN_EXT, + + UNKNOWN = VK_SAMPLER_REDUCTION_MODE_MAX_ENUM_EXT + }; + /* Specifies one of the compute / rendering pipeline stages. */ enum class ShaderStage { diff --git a/include/misc/types_struct.h b/include/misc/types_struct.h index dfd85b89..af9e3b2c 100644 --- a/include/misc/types_struct.h +++ b/include/misc/types_struct.h @@ -24,6 +24,105 @@ namespace Anvil { + /* Note: Matches VkSampleLocationEXT in terms of the layout and size. + */ + typedef struct SampleLocation + { + float x; + float y; + + SampleLocation() + :x(0.0f), + y(0.0f) + { + /* Stub */ + } + + SampleLocation(const float& in_x, + const float& in_y) + :x(in_x), + y(in_y) + { + /* Stub */ + } + } SampleLocation; + + static_assert(sizeof(SampleLocation) == sizeof(VkSampleLocationEXT), "Struct sizes must match"); + static_assert(offsetof(SampleLocation, x) == offsetof(VkSampleLocationEXT, x), "Member offsets much match"); + static_assert(offsetof(SampleLocation, y) == offsetof(VkSampleLocationEXT, y), "Member offsets much match"); + + typedef struct SampleLocationsInfo + { + Anvil::SampleCountFlagBits sample_locations_per_pixel; + VkExtent2D sample_location_grid_size; + std::vector sample_locations; + + SampleLocationsInfo() + { + sample_locations_per_pixel = Anvil::SampleCountFlagBits::NONE; + sample_location_grid_size.height = 0; + sample_location_grid_size.width = 0; + } + + VkSampleLocationsInfoEXT get_vk() const + { + VkSampleLocationsInfoEXT result; + + result.pNext = nullptr; + result.pSampleLocations = (sample_locations.size() != 0) ? reinterpret_cast(&sample_locations.at(0) ) + : nullptr; + result.sampleLocationGridSize = sample_location_grid_size; + result.sampleLocationsCount = static_cast (sample_locations.size() ); + result.sampleLocationsPerPixel = static_cast(sample_locations_per_pixel); + result.sType = VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT; + + return result; + } + + } SampleLocationsInfo; + + typedef struct AttachmentSampleLocations + { + uint32_t n_attachment; + Anvil::SampleLocationsInfo sample_locations_info; + + AttachmentSampleLocations() + { + n_attachment = UINT32_MAX; + } + + VkAttachmentSampleLocationsEXT get_vk() const + { + VkAttachmentSampleLocationsEXT result; + + result.attachmentIndex = n_attachment; + result.sampleLocationsInfo = sample_locations_info.get_vk(); + + return result; + } + } AttachmentSampleLocations; + + typedef struct SubpassSampleLocations + { + uint32_t n_subpass; + Anvil::SampleLocationsInfo sample_locations_info; + + SubpassSampleLocations() + { + n_subpass = UINT32_MAX; + } + + VkSubpassSampleLocationsEXT get_vk() const + { + VkSubpassSampleLocationsEXT result; + + result.subpassIndex = n_subpass; + result.sampleLocationsInfo = sample_locations_info.get_vk(); + + return result; + } + } SubpassSampleLocations; + /* NOTE: Maps 1:1 to VkImageSubresource */ typedef struct { @@ -76,7 +175,7 @@ namespace Anvil static_assert(offsetof(ImageSubresource, array_layer) == offsetof(VkImageSubresource, arrayLayer), "Member offsets must match"); /* NOTE: Maps 1:1 to VkImageSubresourceRange */ - typedef struct + typedef struct ImageSubresourceRange { Anvil::ImageAspectFlags aspect_mask; uint32_t base_mip_level; @@ -96,6 +195,8 @@ namespace Anvil return result; } + + bool operator==(const ImageSubresourceRange&) const; } ImageSubresourceRange; static_assert(sizeof(ImageSubresourceRange) == sizeof(VkImageSubresourceRange), "Struct sizes much match"); @@ -344,6 +445,7 @@ namespace Anvil return &buffer_barrier_vk; } + bool operator==(const BufferBarrier&) const; private: BufferBarrier& operator=(const BufferBarrier&); } BufferBarrier; @@ -491,12 +593,38 @@ namespace Anvil bool operator==(const EXTDescriptorIndexingProperties& in_props) const; } EXTDescriptorIndexingProperties; + typedef struct EXTExternalMemoryHostProperties + { + VkDeviceSize min_imported_host_pointer_alignment; + + EXTExternalMemoryHostProperties(); + EXTExternalMemoryHostProperties(const VkPhysicalDeviceExternalMemoryHostPropertiesEXT& in_props); + + bool operator==(const EXTExternalMemoryHostProperties& in_props) const; + } EXTExternalMemoryHostProperties; + + typedef struct EXTSampleLocationsProperties + { + VkExtent2D max_sample_location_grid_size; + float sample_location_coordinate_range[2]; + Anvil::SampleCountFlags sample_location_sample_counts; + uint32_t sample_location_sub_pixel_bits; + bool variable_sample_locations; + + EXTSampleLocationsProperties(); + EXTSampleLocationsProperties(const VkPhysicalDeviceSampleLocationsPropertiesEXT& in_props); + + bool operator==(const EXTSampleLocationsProperties& in_props) const; + } EXTSampleLocationsProperties; + typedef struct EXTVertexAttributeDivisorProperties { uint32_t max_vertex_attribute_divisor; EXTVertexAttributeDivisorProperties(); EXTVertexAttributeDivisorProperties(const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT& in_props); + + bool operator==(const EXTVertexAttributeDivisorProperties& in_props) const; } EXTVertexAttributeDivisorProperties; /* Used by Image::set_memory_multi(). Requires VK_KHR_device_group support. */ @@ -580,6 +708,13 @@ namespace Anvil bool operator< (const DescriptorUpdateTemplateEntry& in_entry) const; } DescriptorUpdateTemplateEntry; + typedef struct ExtensionAMDBufferMarkerEntrypoints + { + PFN_vkCmdWriteBufferMarkerAMD vkCmdWriteBufferMarkerAMD; + + ExtensionAMDBufferMarkerEntrypoints(); + } ExtensionAMDBufferMarkerEntrypoints; + typedef struct ExtensionAMDDrawIndirectCountEntrypoints { PFN_vkCmdDrawIndexedIndirectCountAMD vkCmdDrawIndexedIndirectCountAMD; @@ -614,6 +749,28 @@ namespace Anvil ExtensionEXTDebugReportEntrypoints(); } ExtensionEXTDebugReportEntrypoints; + typedef struct ExtensionEXTExternalMemoryHostEntrypoints + { + PFN_vkGetMemoryHostPointerPropertiesEXT vkGetMemoryHostPointerPropertiesEXT; + + ExtensionEXTExternalMemoryHostEntrypoints(); + } ExtensionEXTExternalMemoryHostEntrypoints; + + typedef struct ExtensionEXTHdrMetadataEntrypoints + { + PFN_vkSetHdrMetadataEXT vkSetHdrMetadataEXT; + + ExtensionEXTHdrMetadataEntrypoints(); + } ExtensionEXTHdrMetadataEntrypoints; + + typedef struct ExtensionEXTSampleLocationsEntrypoints + { + PFN_vkCmdSetSampleLocationsEXT vkCmdSetSampleLocationsEXT; + PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT vkGetPhysicalDeviceMultisamplePropertiesEXT; + + ExtensionEXTSampleLocationsEntrypoints(); + } ExtensionEXTSampleLocationsEntrypoints; + typedef struct ExtensionKHRDeviceGroupEntrypoints { PFN_vkAcquireNextImage2KHR vkAcquireNextImage2KHR; @@ -809,6 +966,18 @@ namespace Anvil ExtensionKHRDeviceGroupCreationEntrypoints(); } ExtensionKHRDeviceGroupCreationEntrypoints; + typedef struct EXTSamplerFilterMinmaxProperties + { + bool filter_minmax_single_component_formats; + bool filter_minmax_image_component_mapping; + + EXTSamplerFilterMinmaxProperties(); + EXTSamplerFilterMinmaxProperties(const VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT& in_props); + + bool operator==(const EXTSamplerFilterMinmaxProperties&) const; + + } EXTSamplerFilterMinmaxProperties; + typedef struct FenceProperties { ExternalFenceProperties external_fence_properties; @@ -843,6 +1012,67 @@ namespace Anvil FormatProperties(const VkFormatProperties& in_format_props); } FormatProperties; + typedef struct XYColorEXT + { + float x; + float y; + + XYColorEXT() + :x(0.0f), + y(0.0f) + { + /* Stub */ + } + + VkXYColorEXT get_vk() const + { + VkXYColorEXT result; + + result.x = x; + result.y = y; + + return result; + } + } XYColorEXT; + + typedef struct HdrMetadataEXT + { + Anvil::XYColorEXT display_primary_red; + Anvil::XYColorEXT display_primary_green; + Anvil::XYColorEXT display_primary_blue; + float max_content_light_level; + float max_frame_average_light_level; + float max_luminance; + float min_luminance; + Anvil::XYColorEXT white_point; + + HdrMetadataEXT() + { + max_content_light_level = 0.0f; + max_frame_average_light_level = 0.0f; + max_luminance = 0.0f; + min_luminance = 0.0f; + } + + VkHdrMetadataEXT get_vk() const + { + VkHdrMetadataEXT result; + + result.displayPrimaryBlue = display_primary_blue.get_vk (); + result.displayPrimaryGreen = display_primary_green.get_vk(); + result.displayPrimaryRed = display_primary_red.get_vk (); + result.maxContentLightLevel = max_content_light_level; + result.maxFrameAverageLightLevel = max_frame_average_light_level; + result.maxLuminance = max_luminance; + result.minLuminance = min_luminance; + result.pNext = nullptr; + result.sType = VK_STRUCTURE_TYPE_HDR_METADATA_EXT; + result.whitePoint = white_point.get_vk(); + + return result; + } + } HdrMetadataEXT; + typedef struct ImageFormatProperties { ExternalMemoryProperties external_handle_properties; @@ -1006,7 +1236,8 @@ namespace Anvil typedef struct ExternalMemoryHandleImportInfo { - ExternalHandleType handle; + ExternalHandleType handle; /* Used for non-host pointer import ops */ + void* host_ptr; /* Used for host pointer import ops */ #if defined(_WIN32) std::wstring name; @@ -1019,10 +1250,11 @@ namespace Anvil #else handle = -1; #endif + + host_ptr = nullptr; } } ExternalMemoryHandleImportInfo; - /* Holds 16-bit storage features */ typedef struct KHR16BitStorageFeatures { bool is_input_output_storage_supported; @@ -1038,6 +1270,20 @@ namespace Anvil bool operator==(const KHR16BitStorageFeatures& in_features) const; } KHR16BitStorageFeatures; + typedef struct KHR8BitStorageFeatures + { + bool storage_buffer_8_bit_access; + bool storage_push_constant_8; + bool uniform_and_storage_buffer_8_bit_access; + + KHR8BitStorageFeatures(); + KHR8BitStorageFeatures(const VkPhysicalDevice8BitStorageFeaturesKHR& in_features); + + VkPhysicalDevice8BitStorageFeaturesKHR get_vk_physical_device_8_bit_storage_features() const; + + bool operator==(const KHR8BitStorageFeatures& in_features) const; + } KHR8BitStorageFeatures; + typedef struct KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties { uint8_t device_luid[VK_LUID_SIZE]; @@ -1050,6 +1296,9 @@ namespace Anvil KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties(); KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties(const VkPhysicalDeviceIDPropertiesKHR& in_properties); + + bool operator==(const KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties& in_props) const; + } KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties; typedef struct KHRMaintenance2PhysicalDevicePointClippingProperties @@ -1075,6 +1324,45 @@ namespace Anvil } KHRMaintenance3Properties; + typedef struct KHRMultiviewFeatures + { + bool multiview; + bool multiview_geometry_shader; + bool multiview_tessellation_shader; + + KHRMultiviewFeatures(); + KHRMultiviewFeatures(const VkPhysicalDeviceMultiviewFeatures& in_features); + + VkPhysicalDeviceMultiviewFeatures get_vk_physical_device_multiview_features() const; + + bool operator==(const KHRMultiviewFeatures& in_features) const; + } KHRMultiviewFeatures; + + typedef struct KHRMultiviewProperties + { + uint32_t max_multiview_view_count; + uint32_t max_multiview_instance_index; + + KHRMultiviewProperties(); + KHRMultiviewProperties(const VkPhysicalDeviceMultiviewPropertiesKHR& in_props); + + bool operator==(const KHRMultiviewProperties&) const; + + } KHRMultiviewProperties; + + typedef struct KHRVariablePointerFeatures + { + bool variable_pointers; + bool variable_pointers_storage_buffer; + + KHRVariablePointerFeatures(); + KHRVariablePointerFeatures(const VkPhysicalDeviceVariablePointerFeatures& in_features); + + VkPhysicalDeviceVariablePointerFeaturesKHR get_vk_physical_device_variable_pointer_features() const; + + bool operator==(const KHRVariablePointerFeatures& in_features) const; + } KHRVariablePointerFeatures; + /** Holds properties of a single Vulkan Layer. */ typedef struct Layer { @@ -1210,6 +1498,22 @@ namespace Anvil extern bool operator==(const MemoryProperties& in1, const MemoryProperties& in2); + typedef struct MultisamplePropertiesEXT + { + VkExtent2D max_sample_location_grid_size; + + MultisamplePropertiesEXT() + { + max_sample_location_grid_size.height = 0; + max_sample_location_grid_size.width = 0; + } + + MultisamplePropertiesEXT(const VkMultisamplePropertiesEXT& in_multisample_props_vk) + { + max_sample_location_grid_size = in_multisample_props_vk.maxSampleLocationGridSize; + } + } MultisamplePropertiesEXT; + /** Defines data for a single image mip-map. * * Use one of the static create_() functions to set up structure fields according to the target @@ -1631,11 +1935,17 @@ namespace Anvil const PhysicalDeviceFeaturesCoreVK10* core_vk1_0_features_ptr; const EXTDescriptorIndexingFeatures* ext_descriptor_indexing_features_ptr; const KHR16BitStorageFeatures* khr_16bit_storage_features_ptr; + const KHR8BitStorageFeatures* khr_8bit_storage_features_ptr; + const KHRMultiviewFeatures* khr_multiview_features_ptr; + const KHRVariablePointerFeatures* khr_variable_pointer_features_ptr; PhysicalDeviceFeatures(); PhysicalDeviceFeatures(const PhysicalDeviceFeaturesCoreVK10* in_core_vk1_0_features_ptr, const EXTDescriptorIndexingFeatures* in_ext_descriptor_indexing_features_ptr, - const KHR16BitStorageFeatures* in_khr_16_bit_storage_features_ptr); + const KHR16BitStorageFeatures* in_khr_16_bit_storage_features_ptr, + const KHR8BitStorageFeatures* in_khr_8_bit_storage_features_ptr, + const KHRMultiviewFeatures* in_khr_multiview_features_ptr, + const KHRVariablePointerFeatures* in_khr_variable_pointer_features_ptr); bool operator==(const PhysicalDeviceFeatures& in_physical_device_features) const; } PhysicalDeviceFeatures; @@ -1793,19 +2103,27 @@ namespace Anvil const AMDShaderCoreProperties* amd_shader_core_properties_ptr; const PhysicalDevicePropertiesCoreVK10* core_vk1_0_properties_ptr; const EXTDescriptorIndexingProperties* ext_descriptor_indexing_properties_ptr; + const EXTExternalMemoryHostProperties* ext_external_memory_host_properties_ptr; + const EXTSampleLocationsProperties* ext_sample_locations_properties_ptr; + const EXTSamplerFilterMinmaxProperties* ext_sampler_filter_minmax_properties_ptr; const EXTVertexAttributeDivisorProperties* ext_vertex_attribute_divisor_properties_ptr; const KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties* khr_external_memory_capabilities_physical_device_id_properties_ptr; const KHRMaintenance2PhysicalDevicePointClippingProperties* khr_maintenance2_point_clipping_properties_ptr; const KHRMaintenance3Properties* khr_maintenance3_properties_ptr; + const KHRMultiviewProperties* khr_multiview_properties_ptr; PhysicalDeviceProperties(); PhysicalDeviceProperties(const AMDShaderCoreProperties* in_amd_shader_core_properties_ptr, const PhysicalDevicePropertiesCoreVK10* in_core_vk1_0_properties_ptr, const EXTDescriptorIndexingProperties* in_ext_descriptor_indexing_properties_ptr, + const EXTExternalMemoryHostProperties* in_ext_external_memory_host_properties_ptr, + const EXTSampleLocationsProperties* in_ext_sample_locations_properties_ptr, + const EXTSamplerFilterMinmaxProperties* in_ext_sampler_filter_minmax_properties_ptr, const EXTVertexAttributeDivisorProperties* in_ext_vertex_attribute_divisor_properties_ptr, const KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties* in_khr_external_memory_caps_physical_device_id_props_ptr, const KHRMaintenance3Properties* in_khr_maintenance3_properties_ptr, - const KHRMaintenance2PhysicalDevicePointClippingProperties* in_khr_maintenance2_point_clipping_properties_ptr); + const KHRMaintenance2PhysicalDevicePointClippingProperties* in_khr_maintenance2_point_clipping_properties_ptr, + const KHRMultiviewProperties* in_khr_multiview_properties_ptr); bool operator==(const PhysicalDeviceProperties& in_props) const; } PhysicalDeviceProperties; @@ -1866,13 +2184,13 @@ namespace Anvil /** TODO */ typedef struct SemaphoreMGPUSubmission { - const Anvil::PhysicalDevice* physical_device_ptr; - Anvil::Semaphore* semaphore_ptr; + uint32_t device_index; //< device index in the device group + Anvil::Semaphore* semaphore_ptr; SemaphoreMGPUSubmission() { - physical_device_ptr = nullptr; - semaphore_ptr = nullptr; + device_index = UINT32_MAX; + semaphore_ptr = nullptr; } } SemaphoreMGPUSubmission; @@ -2115,7 +2433,8 @@ namespace Anvil bool in_should_block, Anvil::Fence* in_opt_fence_ptr = nullptr); - static SubmitInfo create_execute(const CommandBufferMGPUSubmission* in_cmd_buffer_submission_ptr, + static SubmitInfo create_execute(const CommandBufferMGPUSubmission* in_cmd_buffer_submissions_ptr, + uint32_t in_n_command_buffer_submissions, bool in_should_block, Anvil::Fence* in_opt_fence_ptr = nullptr); @@ -2131,7 +2450,8 @@ namespace Anvil bool in_should_block, Anvil::Fence* in_opt_fence_ptr = nullptr); - static SubmitInfo create_execute_signal(const CommandBufferMGPUSubmission* in_cmd_buffer_submission_ptr, + static SubmitInfo create_execute_signal(const CommandBufferMGPUSubmission* in_cmd_buffer_submissions_ptr, + uint32_t in_n_command_buffer_submissions, uint32_t in_n_signal_semaphore_submissions, const SemaphoreMGPUSubmission* in_signal_semaphore_submissions_ptr, bool in_should_block, @@ -2176,7 +2496,8 @@ namespace Anvil bool in_should_block, Anvil::Fence* in_opt_fence_ptr = nullptr); - static SubmitInfo create_wait_execute(const CommandBufferMGPUSubmission* in_cmd_buffer_submission_ptr, + static SubmitInfo create_wait_execute(const CommandBufferMGPUSubmission* in_cmd_buffer_submissions_ptr, + uint32_t in_n_command_buffer_submissions, uint32_t in_n_wait_semaphore_submissions, const SemaphoreMGPUSubmission* in_wait_semaphore_submissions_ptr, const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, @@ -2201,7 +2522,8 @@ namespace Anvil bool in_should_block, Anvil::Fence* in_opt_fence_ptr = nullptr); - static SubmitInfo create_wait_execute_signal(const CommandBufferMGPUSubmission* in_cmd_buffer_submission_ptr, + static SubmitInfo create_wait_execute_signal(const CommandBufferMGPUSubmission* in_cmd_buffer_submissions_ptr, + uint32_t in_n_command_buffer_submissions, uint32_t in_n_signal_semaphore_submissions, const SemaphoreMGPUSubmission* in_signal_semaphore_submissions_ptr, uint32_t in_n_wait_semaphore_submissions, @@ -2339,16 +2661,8 @@ namespace Anvil timeout = in_timeout; } private: - SubmitInfo(Anvil::CommandBufferBase* in_cmd_buffer_ptr, - uint32_t in_n_semaphores_to_signal, - Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, - uint32_t in_n_semaphores_to_wait_on, - Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, - const Anvil::PipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, - bool in_should_block, - Anvil::Fence* in_opt_fence_ptr); - SubmitInfo(uint32_t in_n_command_buffers, + Anvil::CommandBufferBase* in_opt_single_cmd_buffer_ptr, /* to support n=1 helper functions */ Anvil::CommandBufferBase* const* in_opt_cmd_buffer_ptrs_ptr, uint32_t in_n_semaphores_to_signal, Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, @@ -2397,6 +2711,23 @@ namespace Anvil ANVIL_DISABLE_ASSIGNMENT_OPERATOR(SubmitInfo); } SubmitInfo; + /* NOTE: Maps 1:1 to VkSurfaceFormatKHR */ + typedef struct SurfaceFormatKHR + { + Anvil::Format format; + Anvil::ColorSpaceKHR color_space; + + SurfaceFormatKHR() + { + color_space = Anvil::ColorSpaceKHR::UNKNOWN; + format = Anvil::Format::UNKNOWN; + } + } SurfaceFormatKHR; + + static_assert(sizeof (SurfaceFormatKHR) == sizeof (VkSurfaceFormatKHR), "Struct sizes must match"); + static_assert(offsetof(SurfaceFormatKHR, format) == offsetof(VkSurfaceFormatKHR, format), "Member offsets must match"); + static_assert(offsetof(SurfaceFormatKHR, color_space) == offsetof(VkSurfaceFormatKHR, colorSpace), "Member offsets must match"); + /* Represents a Vulkan structure header */ typedef struct { diff --git a/include/misc/vulkan.h b/include/misc/vulkan.h new file mode 100644 index 00000000..4c5d8304 --- /dev/null +++ b/include/misc/vulkan.h @@ -0,0 +1,175 @@ +// +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#include +#include "vulkan/vulkan.h" + +namespace Anvil +{ + /* Anvil::Vulkan exposes raw pointers to Vulkan entrypoints. + * + * These func ptrs are initialized, first time a Vulkan instance is created. Applications MUST NOT + * assume the entrypoints are available prior to the time. + */ + namespace Vulkan + { + /* VK 1.0 core */ + extern PFN_vkCreateInstance vkCreateInstance; + extern PFN_vkDestroyInstance vkDestroyInstance; + extern PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices; + extern PFN_vkGetPhysicalDeviceFeatures vkGetPhysicalDeviceFeatures; + extern PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties; + extern PFN_vkGetPhysicalDeviceImageFormatProperties vkGetPhysicalDeviceImageFormatProperties; + extern PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties; + extern PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties; + extern PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties; + extern PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr; + extern PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr; + extern PFN_vkCreateDevice vkCreateDevice; + extern PFN_vkDestroyDevice vkDestroyDevice; + extern PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties; + extern PFN_vkEnumerateDeviceExtensionProperties vkEnumerateDeviceExtensionProperties; + extern PFN_vkEnumerateInstanceLayerProperties vkEnumerateInstanceLayerProperties; + extern PFN_vkEnumerateDeviceLayerProperties vkEnumerateDeviceLayerProperties; + extern PFN_vkGetDeviceQueue vkGetDeviceQueue; + extern PFN_vkQueueSubmit vkQueueSubmit; + extern PFN_vkQueueWaitIdle vkQueueWaitIdle; + extern PFN_vkDeviceWaitIdle vkDeviceWaitIdle; + extern PFN_vkAllocateMemory vkAllocateMemory; + extern PFN_vkFreeMemory vkFreeMemory; + extern PFN_vkMapMemory vkMapMemory; + extern PFN_vkUnmapMemory vkUnmapMemory; + extern PFN_vkFlushMappedMemoryRanges vkFlushMappedMemoryRanges; + extern PFN_vkInvalidateMappedMemoryRanges vkInvalidateMappedMemoryRanges; + extern PFN_vkGetDeviceMemoryCommitment vkGetDeviceMemoryCommitment; + extern PFN_vkBindBufferMemory vkBindBufferMemory; + extern PFN_vkBindImageMemory vkBindImageMemory; + extern PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements; + extern PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements; + extern PFN_vkGetImageSparseMemoryRequirements vkGetImageSparseMemoryRequirements; + extern PFN_vkGetPhysicalDeviceSparseImageFormatProperties vkGetPhysicalDeviceSparseImageFormatProperties; + extern PFN_vkQueueBindSparse vkQueueBindSparse; + extern PFN_vkCreateFence vkCreateFence; + extern PFN_vkDestroyFence vkDestroyFence; + extern PFN_vkResetFences vkResetFences; + extern PFN_vkGetFenceStatus vkGetFenceStatus; + extern PFN_vkWaitForFences vkWaitForFences; + extern PFN_vkCreateSemaphore vkCreateSemaphore; + extern PFN_vkDestroySemaphore vkDestroySemaphore; + extern PFN_vkCreateEvent vkCreateEvent; + extern PFN_vkDestroyEvent vkDestroyEvent; + extern PFN_vkGetEventStatus vkGetEventStatus; + extern PFN_vkSetEvent vkSetEvent; + extern PFN_vkResetEvent vkResetEvent; + extern PFN_vkCreateQueryPool vkCreateQueryPool; + extern PFN_vkDestroyQueryPool vkDestroyQueryPool; + extern PFN_vkGetQueryPoolResults vkGetQueryPoolResults; + extern PFN_vkCreateBuffer vkCreateBuffer; + extern PFN_vkDestroyBuffer vkDestroyBuffer; + extern PFN_vkCreateBufferView vkCreateBufferView; + extern PFN_vkDestroyBufferView vkDestroyBufferView; + extern PFN_vkCreateImage vkCreateImage; + extern PFN_vkDestroyImage vkDestroyImage; + extern PFN_vkGetImageSubresourceLayout vkGetImageSubresourceLayout; + extern PFN_vkCreateImageView vkCreateImageView; + extern PFN_vkDestroyImageView vkDestroyImageView; + extern PFN_vkCreateShaderModule vkCreateShaderModule; + extern PFN_vkDestroyShaderModule vkDestroyShaderModule; + extern PFN_vkCreatePipelineCache vkCreatePipelineCache; + extern PFN_vkDestroyPipelineCache vkDestroyPipelineCache; + extern PFN_vkGetPipelineCacheData vkGetPipelineCacheData; + extern PFN_vkMergePipelineCaches vkMergePipelineCaches; + extern PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines; + extern PFN_vkCreateComputePipelines vkCreateComputePipelines; + extern PFN_vkDestroyPipeline vkDestroyPipeline; + extern PFN_vkCreatePipelineLayout vkCreatePipelineLayout; + extern PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout; + extern PFN_vkCreateSampler vkCreateSampler; + extern PFN_vkDestroySampler vkDestroySampler; + extern PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout; + extern PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout; + extern PFN_vkCreateDescriptorPool vkCreateDescriptorPool; + extern PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool; + extern PFN_vkResetDescriptorPool vkResetDescriptorPool; + extern PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets; + extern PFN_vkFreeDescriptorSets vkFreeDescriptorSets; + extern PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets; + extern PFN_vkCreateFramebuffer vkCreateFramebuffer; + extern PFN_vkDestroyFramebuffer vkDestroyFramebuffer; + extern PFN_vkCreateRenderPass vkCreateRenderPass; + extern PFN_vkDestroyRenderPass vkDestroyRenderPass; + extern PFN_vkGetRenderAreaGranularity vkGetRenderAreaGranularity; + extern PFN_vkCreateCommandPool vkCreateCommandPool; + extern PFN_vkDestroyCommandPool vkDestroyCommandPool; + extern PFN_vkResetCommandPool vkResetCommandPool; + extern PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers; + extern PFN_vkFreeCommandBuffers vkFreeCommandBuffers; + extern PFN_vkBeginCommandBuffer vkBeginCommandBuffer; + extern PFN_vkEndCommandBuffer vkEndCommandBuffer; + extern PFN_vkResetCommandBuffer vkResetCommandBuffer; + extern PFN_vkCmdBindPipeline vkCmdBindPipeline; + extern PFN_vkCmdSetViewport vkCmdSetViewport; + extern PFN_vkCmdSetScissor vkCmdSetScissor; + extern PFN_vkCmdSetLineWidth vkCmdSetLineWidth; + extern PFN_vkCmdSetDepthBias vkCmdSetDepthBias; + extern PFN_vkCmdSetBlendConstants vkCmdSetBlendConstants; + extern PFN_vkCmdSetDepthBounds vkCmdSetDepthBounds; + extern PFN_vkCmdSetStencilCompareMask vkCmdSetStencilCompareMask; + extern PFN_vkCmdSetStencilWriteMask vkCmdSetStencilWriteMask; + extern PFN_vkCmdSetStencilReference vkCmdSetStencilReference; + extern PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets; + extern PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer; + extern PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers; + extern PFN_vkCmdDraw vkCmdDraw; + extern PFN_vkCmdDrawIndexed vkCmdDrawIndexed; + extern PFN_vkCmdDrawIndirect vkCmdDrawIndirect; + extern PFN_vkCmdDrawIndexedIndirect vkCmdDrawIndexedIndirect; + extern PFN_vkCmdDispatch vkCmdDispatch; + extern PFN_vkCmdDispatchIndirect vkCmdDispatchIndirect; + extern PFN_vkCmdCopyBuffer vkCmdCopyBuffer; + extern PFN_vkCmdCopyImage vkCmdCopyImage; + extern PFN_vkCmdBlitImage vkCmdBlitImage; + extern PFN_vkCmdCopyBufferToImage vkCmdCopyBufferToImage; + extern PFN_vkCmdCopyImageToBuffer vkCmdCopyImageToBuffer; + extern PFN_vkCmdUpdateBuffer vkCmdUpdateBuffer; + extern PFN_vkCmdFillBuffer vkCmdFillBuffer; + extern PFN_vkCmdClearColorImage vkCmdClearColorImage; + extern PFN_vkCmdClearDepthStencilImage vkCmdClearDepthStencilImage; + extern PFN_vkCmdClearAttachments vkCmdClearAttachments; + extern PFN_vkCmdResolveImage vkCmdResolveImage; + extern PFN_vkCmdSetEvent vkCmdSetEvent; + extern PFN_vkCmdResetEvent vkCmdResetEvent; + extern PFN_vkCmdWaitEvents vkCmdWaitEvents; + extern PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier; + extern PFN_vkCmdBeginQuery vkCmdBeginQuery; + extern PFN_vkCmdEndQuery vkCmdEndQuery; + extern PFN_vkCmdResetQueryPool vkCmdResetQueryPool; + extern PFN_vkCmdWriteTimestamp vkCmdWriteTimestamp; + extern PFN_vkCmdCopyQueryPoolResults vkCmdCopyQueryPoolResults; + extern PFN_vkCmdPushConstants vkCmdPushConstants; + extern PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass; + extern PFN_vkCmdNextSubpass vkCmdNextSubpass; + extern PFN_vkCmdEndRenderPass vkCmdEndRenderPass; + extern PFN_vkCmdExecuteCommands vkCmdExecuteCommands; + + /* Func pointers to extensions are exposed to apps via relevant functions implemented by Anvil::*Device and Anvil::Instance. */ + } +} diff --git a/include/wrappers/command_buffer.h b/include/wrappers/command_buffer.h index 0e8b1dd9..c06ad5ed 100644 --- a/include/wrappers/command_buffer.h +++ b/include/wrappers/command_buffer.h @@ -106,6 +106,7 @@ namespace Anvil COMMAND_TYPE_SET_DEVICE_MASK_KHR, COMMAND_TYPE_SET_EVENT, COMMAND_TYPE_SET_LINE_WIDTH, + COMMAND_TYPE_SET_SAMPLE_LOCATIONS_EXT, COMMAND_TYPE_SET_SCISSOR, COMMAND_TYPE_SET_STENCIL_COMPARE_MASK, COMMAND_TYPE_SET_STENCIL_REFERENCE, @@ -113,6 +114,7 @@ namespace Anvil COMMAND_TYPE_SET_VIEWPORT, COMMAND_TYPE_UPDATE_BUFFER, COMMAND_TYPE_WAIT_EVENTS, + COMMAND_TYPE_WRITE_BUFFER_MARKER_AMD, COMMAND_TYPE_WRITE_TIMESTAMP, } CommandType; @@ -157,12 +159,7 @@ namespace Anvil COMMAND_BUFFER_CALLBACK_ID_COUNT }; - /** Holds all arguments passed to a vkCmdBeginRenderPass() command. - * - * Raw Vulkan object handles have been replaced with pointers to wrapper objects. - * These objects are retained at construction time, and released at descriptor - * destruction time. - */ + /** Holds all arguments passed to a vkCmdBeginRenderPass() command. */ typedef struct BeginRenderPassCommand : public Command { std::vector clear_values; @@ -172,20 +169,26 @@ namespace Anvil std::vector render_areas; Anvil::RenderPass* render_pass_ptr; + /* VK_EXT_sample_locations: */ + std::vector attachment_initial_sample_locations; + std::vector post_subpass_sample_locations; + /** Constructor. - * - * Retains @param in_fbo_ptr and @param in_render_pass_ptr objects. * * Arguments as per Vulkan API. **/ - explicit BeginRenderPassCommand(uint32_t in_n_clear_values, - const VkClearValue* in_clear_value_ptrs, - Anvil::Framebuffer* in_fbo_ptr, - uint32_t in_n_physical_devices, - const Anvil::PhysicalDevice* const* in_physical_devices, - const VkRect2D* in_render_areas, - Anvil::RenderPass* in_render_pass_ptr, - Anvil::SubpassContents in_contents); + explicit BeginRenderPassCommand(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + uint32_t in_n_physical_devices, + const Anvil::PhysicalDevice* const* in_physical_devices, + const VkRect2D* in_render_areas, + Anvil::RenderPass* in_render_pass_ptr, + Anvil::SubpassContents in_contents, + const uint32_t& in_n_attachment_initial_sample_locations, + const Anvil::AttachmentSampleLocations* in_attachment_initial_sample_locations_ptr, + const uint32_t& in_n_post_subpass_sample_locations, + const Anvil::SubpassSampleLocations* in_post_subpass_sample_locations_ptr); /** Destructor. * @@ -254,12 +257,7 @@ namespace Anvil } } EndRenderPassCommandRecordedCallbackData; - /** Holds all arguments passed to a vkCmdPipelineBarrier() command. - * - * Takes an array of Barrier descriptors instead of void* pointers, as is the case - * with the original Vulkan API. Each buffer in a buffer barrier, and each image in - * an image barrier, is retained. - **/ + /** Holds all arguments passed to a vkCmdPipelineBarrier() command. */ typedef struct PipelineBarrierCommand : public Command { std::vector buffer_barriers; @@ -387,9 +385,6 @@ namespace Anvil * Calling this function for a command buffer which has not been put into a recording mode * (by issuing a start_recording() call earlier) will result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -419,9 +414,6 @@ namespace Anvil * Calling this function for a command buffer which has not been put into a recording mode * (by issuing a start_recording() call earlier) will result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -441,9 +433,6 @@ namespace Anvil * It is also illegal to call this function when recording renderpass commands. Doing so * will also result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -466,9 +455,6 @@ namespace Anvil * It is also illegal to call this function when not recording renderpass commands. Doing so * will also result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -488,9 +474,6 @@ namespace Anvil * It is also illegal to call this function when recording renderpass commands. Doing so * will also result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -511,9 +494,6 @@ namespace Anvil * It is also illegal to call this function when recording renderpass commands. Doing so * will also result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -534,9 +514,6 @@ namespace Anvil * It is also illegal to call this function when recording renderpass commands. Doing so * will also result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -556,9 +533,6 @@ namespace Anvil * It is also illegal to call this function when recording renderpass commands. Doing so * will also result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -579,9 +553,6 @@ namespace Anvil * It is also illegal to call this function when recording renderpass commands. Doing so * will also result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -603,9 +574,6 @@ namespace Anvil * It is also illegal to call this function when recording renderpass commands. Doing so * will also result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -626,9 +594,6 @@ namespace Anvil * It is also illegal to call this function when recording renderpass commands. Doing so * will also result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -733,9 +698,6 @@ namespace Anvil * It is also illegal to call this function when recording renderpass commands. Doing so * will also result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -792,9 +754,6 @@ namespace Anvil * It is also illegal to call this function when not recording renderpass commands. Doing so * will also result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -814,9 +773,6 @@ namespace Anvil * It is also illegal to call this function when not recording renderpass commands. Doing so * will also result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * This function is only available if VK_AMD_draw_indirect_count is supported by the Vulkan * device AND if the extension has been requested at creation time. * @@ -841,9 +797,6 @@ namespace Anvil * It is also illegal to call this function when not recording renderpass commands. Doing so * will also result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * This function is only available if VK_KHR_draw_indirect_count is supported by the Vulkan * device AND if the extension has been requested at creation time. * @@ -868,9 +821,6 @@ namespace Anvil * It is also illegal to call this function when not recording renderpass commands. Doing so * will also result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -890,9 +840,6 @@ namespace Anvil * It is also illegal to call this function when not recording renderpass commands. Doing so * will also result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * This function is only available if VK_AMD_draw_indirect_count is supported by the Vulkan * device AND if the extension has been requested at creation time. * @@ -917,9 +864,6 @@ namespace Anvil * It is also illegal to call this function when not recording renderpass commands. Doing so * will also result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * This function is only available if VK_KHR_draw_indirect_count is supported by the Vulkan * device AND if the extension has been requested at creation time. * @@ -958,9 +902,6 @@ namespace Anvil * It is also illegal to call this function when recording renderpass commands. Doing so * will also result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -977,9 +918,6 @@ namespace Anvil * Calling this function for a command buffer which has not been put into a recording mode * (by issuing a start_recording() call earlier) will result in an assertion failure. * - * Any Vulkan object wrapper instances, passed implicitly to this function, are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -1021,9 +959,6 @@ namespace Anvil * It is also illegal to call this function when recording renderpass commands. Doing so * will also result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -1059,9 +994,6 @@ namespace Anvil * It is also illegal to call this function when recording renderpass commands. Doing so * will also result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -1141,9 +1073,6 @@ namespace Anvil * It is also illegal to call this function when recording renderpass commands. Doing so * will also result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -1164,6 +1093,21 @@ namespace Anvil **/ bool record_set_line_width(float in_line_width); + /** Issues a vkCmdSetSampleLocationsEXT() call and appends it to the internal vector of commands + * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS + * #define enabled). + * + * Calling this function for a command buffer which has not been put into a recording mode + * (by issuing a start_recording() call earlier) will result in an assertion failure. + * + * Argument meaning is as per VK_EXT_sample_locations specification. + * + * Must not be called if VK_EXT_sample_locations is not enabled and supported. + * + * @return true if successful, false otherwise. + **/ + bool record_set_sample_locations_EXT(const Anvil::SampleLocationsInfo& in_sample_locations_info); + /** Issues a vkCmdSetScissor() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS * #define enabled). @@ -1246,9 +1190,6 @@ namespace Anvil * It is also illegal to call this function when recording renderpass commands. Doing so * will also result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -1265,9 +1206,6 @@ namespace Anvil * Calling this function for a command buffer which has not been put into a recording mode * (by issuing a start_recording() call earlier) will result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. @@ -1283,15 +1221,30 @@ namespace Anvil uint32_t in_image_memory_barrier_count, const ImageBarrier* const in_image_memory_barriers_ptr); - /** Issues a vkCmdWriteTimestamp() call and appends it to the internal vector of commands + /** Issues a vkCmdWriteBufferMarkerAMD() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS * #define enabled). * * Calling this function for a command buffer which has not been put into a recording mode * (by issuing a start_recording() call earlier) will result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. + * Argument meaning is as per VK_AMD_buffer_marker specification. + * + * Requires VK_AMD_buffer_marker extension. + * + * @return true if successful, false otherwise. + **/ + bool record_write_buffer_marker_AMD(const Anvil::PipelineStageFlagBits& in_pipeline_stage, + Anvil::Buffer* in_dst_buffer_ptr, + const VkDeviceSize& in_dst_offset, + const uint32_t& in_marker); + + /** Issues a vkCmdWriteTimestamp() call and appends it to the internal vector of commands + * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS + * #define enabled). + * + * Calling this function for a command buffer which has not been put into a recording mode + * (by issuing a start_recording() call earlier) will result in an assertion failure. * * Argument meaning is as per Vulkan API specification. * @@ -1357,6 +1310,7 @@ namespace Anvil struct SetDepthBoundsCommand; struct SetEventCommand; struct SetLineWidthCommand; + struct SetSampleLocationsEXTCommand; struct SetScissorCommand; struct SetStencilCompareMaskCommand; struct SetStencilReferenceCommand; @@ -1415,12 +1369,7 @@ namespace Anvil } BindDescriptorSetsCommand; - /** Holds all arguments passed to a vkCmdBindIndexBuffer() command. - * - * Raw Vulkan object handles have been replaced with pointers to wrapper objects. - * These objects are retained at construction time, and released at descriptor - * destruction time. - */ + /** Holds all arguments passed to a vkCmdBindIndexBuffer() command. */ typedef struct BindIndexBufferCommand : public Command { VkBuffer buffer; @@ -2406,6 +2355,22 @@ namespace Anvil } SetLineWidthCommand; + /** Holds all arguments passed to vkCmdSetSampleLocationsEXT() command. **/ + typedef struct SetSampleLocationsEXTCommand : public Command + { + Anvil::SampleLocationsInfo sample_locations_info; + + /** Constructor. **/ + explicit SetSampleLocationsEXTCommand(const Anvil::SampleLocationsInfo& in_sample_locations_info); + + /** Destructor. */ + virtual ~SetSampleLocationsEXTCommand() + { + /* Stub */ + } + } SetSampleLocationsEXTCommand; + + /** Holds all arguments passed to a vkCmdSetScissor() command. **/ typedef struct SetScissorCommand : public Command { @@ -2560,6 +2525,29 @@ namespace Anvil WaitEventsCommand& operator=(const WaitEventsCommand&); } WaitEventsCommand; + /** Holds all arguments passed to vkCmdWriteBufferMarkerAMD() command. **/ + typedef struct WriteBufferMarkerAMDCommand : public Command + { + Anvil::PipelineStageFlagBits pipeline_stage; + Anvil::Buffer* dst_buffer_ptr; + VkDeviceSize dst_offset; + uint32_t marker; + + /** Constructor **/ + explicit WriteBufferMarkerAMDCommand(const Anvil::PipelineStageFlagBits& in_pipeline_stage, + Anvil::Buffer* in_dst_buffer_ptr, + VkDeviceSize in_dst_offset, + const uint32_t& in_marker); + + /** Destructor. */ + virtual ~WriteBufferMarkerAMDCommand() + { + /* Stub */ + } + + private: + WriteBufferMarkerAMDCommand& operator=(const WriteBufferMarkerAMDCommand&); + } WriteBufferMarkerAMDCommand; /** Holds all arguments passed to a vkCmdWriteTimestamp() command. **/ typedef struct WriteTimestampCommand : public Command @@ -2644,23 +2632,27 @@ namespace Anvil * Calling this function for a command buffer which has not been put into a recording mode * (by issuing a start_recording() call earlier) will result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * This function prototype can be called for both single- and multi-GPU devices. In the latter case, * it will be assumed that all physical devices within the device group should be used for * the device mask and that they all should use the same render area. * * Argument meaning is as per Vulkan API specification. * + * NOTE: If either @param in_opt_n_attachment_initial_sample_locations or @param in_opt_n_post_subpass_sample_locations + * (or both) are not zero, VK_EXT_sample_locations is required. + * * @return true if successful, false otherwise. **/ - bool record_begin_render_pass(uint32_t in_n_clear_values, - const VkClearValue* in_clear_value_ptrs, - Anvil::Framebuffer* in_fbo_ptr, - VkRect2D in_render_area, - Anvil::RenderPass* in_render_pass_ptr, - Anvil::SubpassContents in_contents); + bool record_begin_render_pass(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + VkRect2D in_render_area, + Anvil::RenderPass* in_render_pass_ptr, + Anvil::SubpassContents in_contents, + const uint32_t& in_opt_n_attachment_initial_sample_locations = 0, + const Anvil::AttachmentSampleLocations* in_opt_attachment_initial_sample_locations_ptr = nullptr, + const uint32_t& in_opt_n_post_subpass_sample_locations = 0, + const Anvil::SubpassSampleLocations* in_opt_post_subpass_sample_locations_ptr = nullptr); /** See documentation for the other record_begin_render_pass() function prototype for general * information about this function. @@ -2669,14 +2661,18 @@ namespace Anvil * * TODO */ - bool record_begin_render_pass(uint32_t in_n_clear_values, - const VkClearValue* in_clear_value_ptrs, - Anvil::Framebuffer* in_fbo_ptr, - uint32_t in_n_physical_devices, - const Anvil::PhysicalDevice* const* in_physical_devices, - const VkRect2D* in_render_areas, - Anvil::RenderPass* in_render_pass_ptr, - Anvil::SubpassContents in_contents); + bool record_begin_render_pass(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + uint32_t in_n_physical_devices, + const Anvil::PhysicalDevice* const* in_physical_devices, + const VkRect2D* in_render_areas, + Anvil::RenderPass* in_render_pass_ptr, + Anvil::SubpassContents in_contents, + const uint32_t& in_opt_n_attachment_initial_sample_locations = 0, + const Anvil::AttachmentSampleLocations* in_opt_attachment_initial_sample_locations_ptr = nullptr, + const uint32_t& in_opt_n_post_subpass_sample_locations = 0, + const Anvil::SubpassSampleLocations* in_opt_post_subpass_sample_locations_ptr = nullptr); /** Issues a vkCmdEndRenderPass() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS @@ -2698,9 +2694,6 @@ namespace Anvil * Calling this function for a command buffer which has not been put into a recording mode * (by issuing a start_recording() call earlier) will result in an assertion failure. * - * Any Vulkan object wrapper instances passed to this function are going to be retained, - * and will be released when the command buffer is released or resetted. - * * Argument meaning is as per Vulkan API specification. * * @return true if successful, false otherwise. diff --git a/include/wrappers/device.h b/include/wrappers/device.h index ce744e43..28f399cc 100644 --- a/include/wrappers/device.h +++ b/include/wrappers/device.h @@ -116,6 +116,17 @@ namespace Anvil **/ Anvil::DescriptorSetLayout* get_dummy_descriptor_set_layout() const; + /** Returns a container with entry-points to functions introduced by VK_AMD_buffer_marker extension. + * + * Will fire an assertion failure if the extension was not requested at device creation time. + **/ + const ExtensionAMDBufferMarkerEntrypoints& get_extension_amd_buffer_marker_entrypoints() const + { + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->amd_buffer_marker() ); + + return m_amd_buffer_marker_extension_entrypoints; + } + /** Returns a container with entry-points to functions introduced by VK_AMD_draw_indirect_count extension. * * Will fire an assertion failure if the extension was not requested at device creation time. @@ -149,6 +160,34 @@ namespace Anvil return m_ext_debug_marker_extension_entrypoints; } + /** Returns a container with entry-points to functions introduced by VK_EXT_external_memory_host extension. + * + * Will fire an assertion failure if the extension is not supported. + **/ + const ExtensionEXTExternalMemoryHostEntrypoints& get_extension_ext_external_memory_host_entrypoints() const + { + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->ext_external_memory_host() ); + + return m_ext_external_memory_host_extension_entrypoints; + } + + /** Returns a container with entry-points to functions introduced by VK_EXT_hdr_metadata extension. + * + * Will fire an assertion failure if the extension is not supported. + **/ + const ExtensionEXTHdrMetadataEntrypoints& get_extension_ext_hdr_metadata_entrypoints() const + { + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->ext_hdr_metadata() ); + + return m_ext_hdr_metadata_extension_entrypoints; + } + + /** Returns a container with entry-points to functions introduced by VK_EXT_sample_locations extension. + * + * Will fire an assertion failure if the extension is not supported. + **/ + const ExtensionEXTSampleLocationsEntrypoints& get_extension_ext_sample_locations_entrypoints() const; + /** Returns a container with entry-points to functions introduced by VK_KHR_bind_memory2 extension. **/ const ExtensionKHRBindMemory2Entrypoints& get_extension_khr_bind_memory2_entrypoints() const { @@ -364,6 +403,13 @@ namespace Anvil **/ virtual const Anvil::MemoryProperties& get_physical_device_memory_properties() const = 0; + /** Returns multisample properties as reported for physical device(s) which have been used + * to instantiate this logical device instance. + * + * Requires VK_EXT_sample_locations + */ + virtual Anvil::MultisamplePropertiesEXT get_physical_device_multisample_properties(const Anvil::SampleCountFlagBits& in_samples) const = 0; + /** Returns general physical device properties, as reported by physical device(s) which have been used * to instantiate this logical device instance. **/ @@ -431,8 +477,8 @@ namespace Anvil **/ PFN_vkVoidFunction get_proc_address(const char* in_name) const { - return vkGetDeviceProcAddr(m_device, - in_name); + return Anvil::Vulkan::vkGetDeviceProcAddr(m_device, + in_name); } PFN_vkVoidFunction get_proc_address(const std::string& in_name) const @@ -505,15 +551,23 @@ namespace Anvil /* Tells which memory types can be specified when creating an external memory handle for a Win32 handle @param in_handle * - * Requires VK_KHR_external_memory_Fd under Windows. - * Requires VK_KHR_external_memory_win32 under Windows. + * For all external memory handle types EXCEPT host pointers: + * + Requires VK_KHR_external_memory_Fd under Linux. + * + Requires VK_KHR_external_memory_win32 under Windows + * + * For host pointers: + * + Requires VK_EXT_external_memory_host. * * @return true if successful, false otherwise. * * - * @param in_external_handle_type (Windows) must be either Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_WIN32_BIT or - * Anvil::ExternalMemoryHandleTypeFlagBits::WIN32_KMT_BIT. - * (Linux) must be Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_FD_BIT. + * @param in_external_handle_type (Host pointers) Must be Anvil::ExternalMemoryHandleTypeFlagBits::HOST_ALLOCATION_BIT_EXT or + * Anvil::ExternalMemoryHandleTypeFlagBits::HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT. + * + * (Other) (Windows) must be either Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_WIN32_BIT or + * Anvil::ExternalMemoryHandleTypeFlagBits::WIN32_KMT_BIT. + * (Linux) must be Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_FD_BIT. + * * @param out_supported_memory_type_bits_ptr Deref will be set to a set of bits where each index corresponds to support status * of a memory type with corresponding index. Must not be null. */ @@ -668,9 +722,13 @@ namespace Anvil /* Protected variables */ VkDevice m_device; + ExtensionAMDBufferMarkerEntrypoints m_amd_buffer_marker_extension_entrypoints; ExtensionAMDDrawIndirectCountEntrypoints m_amd_draw_indirect_count_extension_entrypoints; ExtensionAMDShaderInfoEntrypoints m_amd_shader_info_extension_entrypoints; ExtensionEXTDebugMarkerEntrypoints m_ext_debug_marker_extension_entrypoints; + ExtensionEXTExternalMemoryHostEntrypoints m_ext_external_memory_host_extension_entrypoints; + ExtensionEXTHdrMetadataEntrypoints m_ext_hdr_metadata_extension_entrypoints; + ExtensionEXTSampleLocationsEntrypoints m_ext_sample_locations_extension_entrypoints; ExtensionKHRBindMemory2Entrypoints m_khr_bind_memory2_extension_entrypoints; ExtensionKHRDescriptorUpdateTemplateEntrypoints m_khr_descriptor_update_template_extension_entrypoints; ExtensionKHRDeviceGroupEntrypoints m_khr_device_group_extension_entrypoints; @@ -749,6 +807,7 @@ namespace Anvil * @param in_parent_surface_ptr Rendering surface to create the swapchain for. Must not be nullptr. * @param in_window_ptr current window to create the swapchain for. Must not be nullptr. * @param in_image_format Format which the swap-chain should use. + * @param in_color_space TODO * @param in_present_mode Presentation mode which the swap-chain should use. * @param in_usage Image usage flags describing how the swap-chain is going to be used. * @param in_n_swapchain_images Number of images the swap-chain should use. @@ -758,6 +817,7 @@ namespace Anvil Anvil::SwapchainUniquePtr create_swapchain(Anvil::RenderingSurface* in_parent_surface_ptr, Anvil::Window* in_window_ptr, Anvil::Format in_image_format, + Anvil::ColorSpaceKHR in_color_space, Anvil::PresentModeKHR in_present_mode, ImageUsageFlags in_usage, uint32_t in_n_swapchain_images); @@ -788,6 +848,9 @@ namespace Anvil bool get_physical_device_image_format_properties(const ImageFormatPropertiesQuery& in_query, Anvil::ImageFormatProperties* out_opt_result_ptr = nullptr) const override; + /** See documentation in BaseDevice for more details */ + Anvil::MultisamplePropertiesEXT get_physical_device_multisample_properties(const Anvil::SampleCountFlagBits& in_samples) const override; + /** See documentation in BaseDevice for more details */ const Anvil::MemoryProperties& get_physical_device_memory_properties() const override; @@ -863,6 +926,7 @@ namespace Anvil Anvil::SwapchainUniquePtr create_swapchain(Anvil::RenderingSurface* in_parent_surface_ptr, Anvil::Window* in_window_ptr, Anvil::Format in_image_format, + Anvil::ColorSpaceKHR in_color_space, Anvil::PresentModeKHR in_present_mode, ImageUsageFlags in_usage, uint32_t in_n_swapchain_images, @@ -911,6 +975,9 @@ namespace Anvil /** TODO */ const Anvil::MemoryProperties& get_physical_device_memory_properties() const override; + /** See documentation in BaseDevice for more details */ + Anvil::MultisamplePropertiesEXT get_physical_device_multisample_properties(const Anvil::SampleCountFlagBits& in_samples) const override; + /** TODO */ const Anvil::PhysicalDeviceProperties& get_physical_device_properties() const override; diff --git a/include/wrappers/instance.h b/include/wrappers/instance.h index fdf79d12..ca5427b4 100644 --- a/include/wrappers/instance.h +++ b/include/wrappers/instance.h @@ -32,6 +32,7 @@ #define WRAPPERS_INSTANCE_H #include "misc/extensions.h" +#include "misc/library.h" #include "misc/mt_safety.h" #include "misc/types.h" @@ -224,6 +225,10 @@ namespace Anvil void init_debug_callbacks (); void init_func_pointers (); + #if !defined(ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB) + bool init_vk10_func_ptrs(); + #endif + static VkBool32 VKAPI_PTR debug_callback_pfn_proc(VkDebugReportFlagsEXT in_message_flags, VkDebugReportObjectTypeEXT in_object_type, uint64_t in_src_object, diff --git a/include/wrappers/physical_device.h b/include/wrappers/physical_device.h index 472f3f02..56d88ba1 100644 --- a/include/wrappers/physical_device.h +++ b/include/wrappers/physical_device.h @@ -250,11 +250,18 @@ namespace Anvil std::unique_ptr m_core_properties_vk10_ptr; std::unique_ptr m_ext_descriptor_indexing_features_ptr; std::unique_ptr m_ext_descriptor_indexing_properties_ptr; + std::unique_ptr m_ext_external_memory_host_properties_ptr; + std::unique_ptr m_ext_sample_locations_properties_ptr; + std::unique_ptr m_ext_sampler_filter_minmax_properties_ptr; std::unique_ptr m_ext_vertex_attribute_divisor_properties_ptr; std::unique_ptr m_khr_16_bit_storage_features_ptr; + std::unique_ptr m_khr_8_bit_storage_features_ptr; std::unique_ptr m_khr_external_memory_capabilities_physical_device_id_properties_ptr; std::unique_ptr m_khr_maintenance2_physical_device_point_clipping_properties_ptr; std::unique_ptr m_khr_maintenance3_properties_ptr; + std::unique_ptr m_khr_multiview_features_ptr; + std::unique_ptr m_khr_multiview_properties_ptr; + std::unique_ptr m_khr_variable_pointer_features_ptr; friend class Anvil::Instance; }; diff --git a/include/wrappers/pipeline_cache.h b/include/wrappers/pipeline_cache.h index 031f2caa..e08ec0a6 100644 --- a/include/wrappers/pipeline_cache.h +++ b/include/wrappers/pipeline_cache.h @@ -54,9 +54,9 @@ namespace Anvil * May be nullptr if @param in_initial_data_size is 0. **/ static Anvil::PipelineCacheUniquePtr create(const Anvil::BaseDevice* in_device_ptr, - bool in_mt_safe, - size_t in_initial_data_size = 0, - const void* in_initial_data = nullptr); + bool in_mt_safe, + size_t in_initial_data_size = 0, + const void* in_initial_data = nullptr); /** Destroys the Vulkan counterpart and unregisters the wrapper instance from the object tracker. */ virtual ~PipelineCache(); @@ -69,8 +69,8 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool get_data(size_t* out_n_data_bytes_ptr, - const void** out_data_ptr); + bool get_data(size_t* out_n_data_bytes_ptr, + void* out_data_ptr); /** Retrieves raw Vulkan pipeline cache handle. * diff --git a/include/wrappers/rendering_surface.h b/include/wrappers/rendering_surface.h index 086613f8..bfe71cce 100644 --- a/include/wrappers/rendering_surface.h +++ b/include/wrappers/rendering_surface.h @@ -48,13 +48,13 @@ namespace Anvil /* Public type definitions */ typedef struct RenderingSurfaceFormat { - VkColorSpaceKHR color_space; - Anvil::Format format; + Anvil::ColorSpaceKHR color_space; + Anvil::Format format; /* Constructor. */ - RenderingSurfaceFormat(VkSurfaceFormatKHR& in_surface_format) + RenderingSurfaceFormat(Anvil::SurfaceFormatKHR& in_surface_format) { - color_space = in_surface_format.colorSpace; + color_space = in_surface_format.color_space; format = static_cast(in_surface_format.format); } diff --git a/include/wrappers/swapchain.h b/include/wrappers/swapchain.h index bf9167ba..00d22bb9 100644 --- a/include/wrappers/swapchain.h +++ b/include/wrappers/swapchain.h @@ -141,6 +141,28 @@ namespace Anvil return m_size.width; } + /* Associates HDR metadata with one or more swapchains. + * + * Requires VK_EXT_hdr_metadata. + * + * @param in_n_swapchains Number of swapchains to update. + * @param in_swapchains_ptr At least @param in_n_swapchains swapchains to set HDR metadata for. All defined swapchains must have + * been created for the same Anvil::BaseDevice instance. + * @param in_hdr_metadata_ptr An array of @param in_n_swapchains HDR metadata descriptors to use. Must not be nullptr. + */ + static void set_hdr_metadata(const uint32_t& in_n_swapchains, + Anvil::Swapchain** in_swapchains_ptr_ptr, + const Anvil::HdrMetadataEXT* in_metadata_items_ptr); + + void set_hdr_metadata(const Anvil::HdrMetadataEXT* in_metadata_ptr) + { + Anvil::Swapchain* this_ptr = this; + + return Anvil::Swapchain::set_hdr_metadata(1, /* in_n_swapchains */ + &this_ptr, + in_metadata_ptr); + } + /* By default, swapchain instance will transparently destroy the underlying Vulkan swapchain handle, right before * the window is closed. * diff --git a/src/misc/base_pipeline_create_info.cpp b/src/misc/base_pipeline_create_info.cpp index c42f837b..8be76dc8 100644 --- a/src/misc/base_pipeline_create_info.cpp +++ b/src/misc/base_pipeline_create_info.cpp @@ -125,12 +125,11 @@ void Anvil::BasePipelineCreateInfo::copy_state_from(const BasePipelineCreateInfo ) ); } - + m_push_constant_ranges = in_src_pipeline_create_info_ptr->m_push_constant_ranges; - m_allow_derivatives = in_src_pipeline_create_info_ptr->m_allow_derivatives; - m_disable_optimizations = in_src_pipeline_create_info_ptr->m_disable_optimizations; - m_shader_stages = in_src_pipeline_create_info_ptr->m_shader_stages; + m_create_flags = in_src_pipeline_create_info_ptr->m_create_flags; + m_shader_stages = in_src_pipeline_create_info_ptr->m_shader_stages; m_specialization_constants_data_buffer = in_src_pipeline_create_info_ptr->m_specialization_constants_data_buffer; m_specialization_constants_map = in_src_pipeline_create_info_ptr->m_specialization_constants_map; @@ -181,17 +180,15 @@ bool Anvil::BasePipelineCreateInfo::get_specialization_constants(Anvil::ShaderSt return result; } -void Anvil::BasePipelineCreateInfo::init_derivative(bool in_disable_optimizations, - bool in_allow_derivatives, - uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, - Anvil::PipelineID in_base_pipeline_id, - const std::vector* in_opt_ds_create_info_vec_ptr) +void Anvil::BasePipelineCreateInfo::init(const Anvil::PipelineCreateFlags& in_create_flags, + uint32_t in_n_shader_module_stage_entrypoints, + const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, + const Anvil::PipelineID* in_opt_base_pipeline_id_ptr, + const std::vector* in_opt_ds_create_info_vec_ptr) { - m_allow_derivatives = in_allow_derivatives; - m_base_pipeline_id = in_base_pipeline_id; - m_disable_optimizations = in_disable_optimizations; - m_is_proxy = false; + m_base_pipeline_id = (in_opt_base_pipeline_id_ptr != nullptr) ? *in_opt_base_pipeline_id_ptr : UINT32_MAX; + m_create_flags = in_create_flags; + m_is_proxy = false; if (in_opt_ds_create_info_vec_ptr != nullptr) { @@ -204,30 +201,9 @@ void Anvil::BasePipelineCreateInfo::init_derivative(bool void Anvil::BasePipelineCreateInfo::init_proxy() { - m_allow_derivatives = false; - m_base_pipeline_id = UINT32_MAX; - m_disable_optimizations = false; - m_is_proxy = true; -} - -void Anvil::BasePipelineCreateInfo::init_regular(bool in_disable_optimizations, - bool in_allow_derivatives, - uint32_t in_n_shader_module_stage_entrypoints, - const ShaderModuleStageEntryPoint* in_shader_module_stage_entrypoint_ptrs, - const std::vector* in_opt_ds_create_info_vec_ptr) -{ - m_allow_derivatives = in_allow_derivatives; - m_base_pipeline_id = UINT32_MAX; - m_disable_optimizations = in_disable_optimizations; - m_is_proxy = false; - - if (in_opt_ds_create_info_vec_ptr != nullptr) - { - set_descriptor_set_create_info(in_opt_ds_create_info_vec_ptr); - } - - init_shader_modules(in_n_shader_module_stage_entrypoints, - in_shader_module_stage_entrypoint_ptrs); + m_base_pipeline_id = UINT32_MAX; + m_create_flags = Anvil::PipelineCreateFlagBits::NONE; + m_is_proxy = true; } void Anvil::BasePipelineCreateInfo::init_shader_modules(uint32_t in_n_shader_module_stage_entrypoints, diff --git a/src/misc/base_pipeline_manager.cpp b/src/misc/base_pipeline_manager.cpp index ab8291cd..4f2cc0d2 100644 --- a/src/misc/base_pipeline_manager.cpp +++ b/src/misc/base_pipeline_manager.cpp @@ -86,9 +86,9 @@ void Anvil::BasePipelineManager::Pipeline::release_pipeline() device_ptr->get_pipeline_cache()->lock(); lock(); { - vkDestroyPipeline(device_ptr->get_device_vk(), - baked_pipeline, - nullptr /* pAllocator */); + Anvil::Vulkan::vkDestroyPipeline(device_ptr->get_device_vk(), + baked_pipeline, + nullptr /* pAllocator */); } unlock(); device_ptr->get_pipeline_cache()->unlock(); diff --git a/src/misc/compute_pipeline_create_info.cpp b/src/misc/compute_pipeline_create_info.cpp index ef99c6ff..66d574f9 100644 --- a/src/misc/compute_pipeline_create_info.cpp +++ b/src/misc/compute_pipeline_create_info.cpp @@ -31,10 +31,9 @@ Anvil::ComputePipelineCreateInfo::~ComputePipelineCreateInfo() /* Stub */ } -Anvil::ComputePipelineCreateInfoUniquePtr Anvil::ComputePipelineCreateInfo::create_derivative(bool in_disable_optimizations, - bool in_allow_derivatives, - const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info, - Anvil::PipelineID in_base_pipeline_id) +Anvil::ComputePipelineCreateInfoUniquePtr Anvil::ComputePipelineCreateInfo::create(const Anvil::PipelineCreateFlags& in_create_flags, + const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info, + const Anvil::PipelineID* in_opt_base_pipeline_id_ptr) { Anvil::ComputePipelineCreateInfoUniquePtr result_ptr(nullptr, std::default_delete() ); @@ -45,11 +44,10 @@ Anvil::ComputePipelineCreateInfoUniquePtr Anvil::ComputePipelineCreateInfo::crea if (result_ptr != nullptr) { - result_ptr->init_derivative(in_disable_optimizations, - in_allow_derivatives, - 1, /* in_n_shader_module_stage_entrypoints */ - &in_compute_shader_stage_entrypoint_info, - in_base_pipeline_id); + result_ptr->init(in_create_flags, + 1, /* in_n_shader_module_stage_entrypoints */ + &in_compute_shader_stage_entrypoint_info, + in_opt_base_pipeline_id_ptr); } return result_ptr; @@ -71,25 +69,3 @@ Anvil::ComputePipelineCreateInfoUniquePtr Anvil::ComputePipelineCreateInfo::crea return result_ptr; } - -Anvil::ComputePipelineCreateInfoUniquePtr Anvil::ComputePipelineCreateInfo::create_regular(bool in_disable_optimizations, - bool in_allow_derivatives, - const ShaderModuleStageEntryPoint& in_compute_shader_stage_entrypoint_info) -{ - Anvil::ComputePipelineCreateInfoUniquePtr result_ptr(nullptr, - std::default_delete() ); - - result_ptr.reset( - new ComputePipelineCreateInfo() - ); - - if (result_ptr != nullptr) - { - result_ptr->init_regular(in_disable_optimizations, - in_allow_derivatives, - 1, /* in_n_shader_module_stage_entrypoints */ - &in_compute_shader_stage_entrypoint_info); - } - - return result_ptr; -} \ No newline at end of file diff --git a/src/misc/glsl_to_spirv.cpp b/src/misc/glsl_to_spirv.cpp index 6f478300..0981c98a 100644 --- a/src/misc/glsl_to_spirv.cpp +++ b/src/misc/glsl_to_spirv.cpp @@ -630,8 +630,9 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() const /* Link the program */ new_program_ptr->addShader(new_shader_ptr); - link_result = new_program_ptr->link (EShMsgDefault); - m_program_info_log = new_program_ptr->getInfoLog(); + link_result = new_program_ptr->link (EShMsgDefault); + m_program_debug_info_log = new_program_ptr->getInfoDebugLog(); + m_program_info_log = new_program_ptr->getInfoLog (); if (!link_result) { @@ -677,19 +678,11 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() const /* All done */ result = true; end: - if (new_program_ptr != nullptr) - { - delete new_program_ptr; - - new_program_ptr = nullptr; - } + delete new_program_ptr; + new_program_ptr = nullptr; - if (new_shader_ptr != nullptr) - { - delete new_shader_ptr; - - new_shader_ptr = nullptr; - } + delete new_shader_ptr; + new_shader_ptr = nullptr; return result; } @@ -905,4 +898,4 @@ std::string Anvil::GLSLShaderToSPIRVGenerator::get_extension_behavior_glsl_code( } return result; -} \ No newline at end of file +} diff --git a/src/misc/graphics_pipeline_create_info.cpp b/src/misc/graphics_pipeline_create_info.cpp index 75009b1c..7e691fb0 100644 --- a/src/misc/graphics_pipeline_create_info.cpp +++ b/src/misc/graphics_pipeline_create_info.cpp @@ -48,6 +48,7 @@ Anvil::GraphicsPipelineCreateInfo::GraphicsPipelineCreateInfo(const RenderPass* m_n_patch_control_points = 1; m_primitive_restart_enabled = false; m_rasterizer_discard_enabled = false; + m_sample_locations_enabled = false; m_sample_mask_enabled = false; m_sample_shading_enabled = false; m_stencil_test_enabled = false; @@ -64,6 +65,10 @@ Anvil::GraphicsPipelineCreateInfo::GraphicsPipelineCreateInfo(const RenderPass* m_stencil_state_back_face.writeMask = ~0u; m_stencil_state_front_face = m_stencil_state_back_face; + m_sample_locations_per_pixel = Anvil::SampleCountFlagBits::NONE; + m_sample_location_grid_size.height = 0; + m_sample_location_grid_size.width = 0; + m_rasterization_order = Anvil::RasterizationOrderAMD::STRICT; memset(m_blend_constant, @@ -184,6 +189,7 @@ bool Anvil::GraphicsPipelineCreateInfo::copy_gfx_state_from(const Anvil::Graphic m_logic_op_enabled = in_src_pipeline_create_info_ptr->m_logic_op_enabled; m_primitive_restart_enabled = in_src_pipeline_create_info_ptr->m_primitive_restart_enabled; m_rasterizer_discard_enabled = in_src_pipeline_create_info_ptr->m_rasterizer_discard_enabled; + m_sample_locations_enabled = in_src_pipeline_create_info_ptr->m_sample_locations_enabled; m_sample_mask_enabled = in_src_pipeline_create_info_ptr->m_sample_mask_enabled; m_sample_shading_enabled = in_src_pipeline_create_info_ptr->m_sample_shading_enabled; @@ -191,6 +197,10 @@ bool Anvil::GraphicsPipelineCreateInfo::copy_gfx_state_from(const Anvil::Graphic m_stencil_state_back_face = in_src_pipeline_create_info_ptr->m_stencil_state_back_face; m_stencil_state_front_face = in_src_pipeline_create_info_ptr->m_stencil_state_front_face; + m_sample_location_grid_size = in_src_pipeline_create_info_ptr->m_sample_location_grid_size; + m_sample_locations = in_src_pipeline_create_info_ptr->m_sample_locations; + m_sample_locations_per_pixel = in_src_pipeline_create_info_ptr->m_sample_locations_per_pixel; + m_rasterization_order = in_src_pipeline_create_info_ptr->m_rasterization_order; m_tessellation_domain_origin = in_src_pipeline_create_info_ptr->m_tessellation_domain_origin; @@ -200,6 +210,7 @@ bool Anvil::GraphicsPipelineCreateInfo::copy_gfx_state_from(const Anvil::Graphic m_blend_constant[1] = in_src_pipeline_create_info_ptr->m_blend_constant[1]; m_blend_constant[2] = in_src_pipeline_create_info_ptr->m_blend_constant[2]; m_blend_constant[3] = in_src_pipeline_create_info_ptr->m_blend_constant[3]; + m_cull_mode = in_src_pipeline_create_info_ptr->m_cull_mode; m_polygon_mode = in_src_pipeline_create_info_ptr->m_polygon_mode; m_front_face = in_src_pipeline_create_info_ptr->m_front_face; m_line_width = in_src_pipeline_create_info_ptr->m_line_width; @@ -209,13 +220,12 @@ bool Anvil::GraphicsPipelineCreateInfo::copy_gfx_state_from(const Anvil::Graphic m_n_dynamic_viewports = in_src_pipeline_create_info_ptr->m_n_dynamic_viewports; m_n_patch_control_points = in_src_pipeline_create_info_ptr->m_n_patch_control_points; m_primitive_topology = in_src_pipeline_create_info_ptr->m_primitive_topology; - m_sample_count = in_src_pipeline_create_info_ptr->m_sample_count; + m_sample_count = in_src_pipeline_create_info_ptr->m_sample_count; m_sample_mask = in_src_pipeline_create_info_ptr->m_sample_mask; m_scissor_boxes = in_src_pipeline_create_info_ptr->m_scissor_boxes; m_subpass_attachment_blending_properties = in_src_pipeline_create_info_ptr->m_subpass_attachment_blending_properties; m_viewports = in_src_pipeline_create_info_ptr->m_viewports; - m_cull_mode = in_src_pipeline_create_info_ptr->m_cull_mode; BasePipelineCreateInfo::copy_state_from(in_src_pipeline_create_info_ptr); @@ -224,16 +234,16 @@ bool Anvil::GraphicsPipelineCreateInfo::copy_gfx_state_from(const Anvil::Graphic return result; } -Anvil::GraphicsPipelineCreateInfoUniquePtr Anvil::GraphicsPipelineCreateInfo::create_derivative(bool in_disable_optimizations, - bool in_allow_derivatives, - const RenderPass* in_renderpass_ptr, - SubPassID in_subpass_id, - const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, - Anvil::PipelineID in_base_pipeline_id) +Anvil::GraphicsPipelineCreateInfoUniquePtr Anvil::GraphicsPipelineCreateInfo::create(const Anvil::PipelineCreateFlagBits& in_create_flags, + const RenderPass* in_renderpass_ptr, + SubPassID in_subpass_id, + const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, + const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, + const Anvil::GraphicsPipelineCreateInfo* in_opt_reference_pipeline_info_ptr, + const Anvil::PipelineID* in_opt_base_pipeline_id_ptr) { Anvil::GraphicsPipelineCreateInfoUniquePtr result_ptr(nullptr, std::default_delete() ); @@ -254,11 +264,20 @@ Anvil::GraphicsPipelineCreateInfoUniquePtr Anvil::GraphicsPipelineCreateInfo::cr in_vertex_shader_shader_stage_entrypoint_info }; - result_ptr->init_derivative(in_disable_optimizations, - in_allow_derivatives, - sizeof(stages) / sizeof(stages[0]), - stages, - in_base_pipeline_id); + if (in_opt_reference_pipeline_info_ptr != nullptr) + { + if (!result_ptr->copy_gfx_state_from(in_opt_reference_pipeline_info_ptr) ) + { + anvil_assert_fail(); + + result_ptr.reset(); + } + } + + result_ptr->init(in_create_flags, + sizeof(stages) / sizeof(stages[0]), + stages, + in_opt_base_pipeline_id_ptr); } return result_ptr; @@ -282,55 +301,6 @@ Anvil::GraphicsPipelineCreateInfoUniquePtr Anvil::GraphicsPipelineCreateInfo::cr return result_ptr; } -Anvil::GraphicsPipelineCreateInfoUniquePtr Anvil::GraphicsPipelineCreateInfo::create_regular(bool in_disable_optimizations, - bool in_allow_derivatives, - const RenderPass* in_renderpass_ptr, - SubPassID in_subpass_id, - const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_geometry_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_control_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_tess_evaluation_shader_stage_entrypoint_info, - const ShaderModuleStageEntryPoint& in_vertex_shader_shader_stage_entrypoint_info, - const Anvil::GraphicsPipelineCreateInfo* in_opt_reference_pipeline_info_ptr) -{ - Anvil::GraphicsPipelineCreateInfoUniquePtr result_ptr(nullptr, - std::default_delete() ); - - result_ptr.reset( - new GraphicsPipelineCreateInfo(in_renderpass_ptr, - in_subpass_id) - ); - - if (result_ptr != nullptr) - { - const ShaderModuleStageEntryPoint stages[] = - { - in_fragment_shader_stage_entrypoint_info, - in_geometry_shader_stage_entrypoint_info, - in_tess_control_shader_stage_entrypoint_info, - in_tess_evaluation_shader_stage_entrypoint_info, - in_vertex_shader_shader_stage_entrypoint_info - }; - - if (in_opt_reference_pipeline_info_ptr != nullptr) - { - if (!result_ptr->copy_gfx_state_from(in_opt_reference_pipeline_info_ptr) ) - { - anvil_assert_fail(); - - result_ptr.reset(); - } - } - - result_ptr->init_regular(in_disable_optimizations, - in_allow_derivatives, - sizeof(stages) / sizeof(stages[0]), - stages); - } - - return result_ptr; -} - void Anvil::GraphicsPipelineCreateInfo::get_blending_properties(const float** out_opt_blend_constant_vec4_ptr_ptr, uint32_t* out_opt_n_blend_attachments_ptr) const { @@ -595,6 +565,39 @@ void Anvil::GraphicsPipelineCreateInfo::get_rasterization_properties(Anvil::Poly } } +void Anvil::GraphicsPipelineCreateInfo::get_sample_location_state(bool* out_opt_is_enabled_ptr, + Anvil::SampleCountFlagBits* out_opt_sample_locations_per_pixel_ptr, + VkExtent2D* out_opt_sample_location_grid_size_ptr, + uint32_t* out_opt_n_sample_locations_ptr, + const Anvil::SampleLocation** out_opt_sample_locations_ptr_ptr) +{ + if (out_opt_is_enabled_ptr != nullptr) + { + *out_opt_is_enabled_ptr = m_sample_locations_enabled; + } + + if (out_opt_sample_locations_per_pixel_ptr != nullptr) + { + *out_opt_sample_locations_per_pixel_ptr = m_sample_locations_per_pixel; + } + + if (out_opt_sample_location_grid_size_ptr != nullptr) + { + *out_opt_sample_location_grid_size_ptr = m_sample_location_grid_size; + } + + if (out_opt_n_sample_locations_ptr != nullptr) + { + *out_opt_n_sample_locations_ptr = static_cast(m_sample_locations.size() ); + } + + if (out_opt_sample_locations_per_pixel_ptr != nullptr) + { + *out_opt_sample_locations_ptr_ptr = (m_sample_locations.size() > 0) ? &m_sample_locations.at(0) + : nullptr; + } +} + void Anvil::GraphicsPipelineCreateInfo::get_sample_shading_state(bool* out_opt_is_enabled_ptr, float* out_opt_min_sample_shading_ptr) const { @@ -974,6 +977,28 @@ void Anvil::GraphicsPipelineCreateInfo::set_rasterization_properties(Anvil::Poly m_polygon_mode = in_polygon_mode; } +void Anvil::GraphicsPipelineCreateInfo::set_sample_location_properties(const Anvil::SampleCountFlagBits& in_sample_locations_per_pixel, + const VkExtent2D& in_sample_location_grid_size, + const uint32_t& in_n_sample_locations, + const Anvil::SampleLocation* in_sample_locations_ptr) +{ + anvil_assert(in_n_sample_locations != 0); + + m_sample_locations.resize(in_n_sample_locations); + + m_sample_location_grid_size = in_sample_location_grid_size; + m_sample_locations_per_pixel = in_sample_locations_per_pixel; + + for (uint32_t n_sample_location = 0; + n_sample_location < in_n_sample_locations; + ++n_sample_location) + { + const auto& current_location_ptr = in_sample_locations_ptr + n_sample_location; + + m_sample_locations.at(n_sample_location) = *current_location_ptr; + } +} + void Anvil::GraphicsPipelineCreateInfo::set_scissor_box_properties(uint32_t in_n_scissor_box, int32_t in_x, int32_t in_y, @@ -1142,6 +1167,11 @@ void Anvil::GraphicsPipelineCreateInfo::toggle_rasterizer_discard(bool in_should m_rasterizer_discard_enabled = in_should_enable; } +void Anvil::GraphicsPipelineCreateInfo::toggle_sample_locations(bool in_should_enable) +{ + m_sample_locations_enabled = in_should_enable; +} + void Anvil::GraphicsPipelineCreateInfo::toggle_sample_mask(bool in_should_enable) { m_sample_mask_enabled = in_should_enable; diff --git a/src/misc/image_create_info.cpp b/src/misc/image_create_info.cpp index 97e51a20..7cbca49d 100644 --- a/src/misc/image_create_info.cpp +++ b/src/misc/image_create_info.cpp @@ -316,3 +316,26 @@ Anvil::ImageCreateInfo::ImageCreateInfo(Anvil::ImageInternalType in_ } #endif } + +/* Please see header for specification */ +void Anvil::ImageCreateInfo::get_image_view_formats(uint32_t* out_n_image_view_formats_ptr, + const Anvil::Format** out_image_view_formats_ptr_ptr) const +{ + const uint32_t n_image_view_formats = static_cast(m_image_view_formats.size() ); + + *out_n_image_view_formats_ptr = n_image_view_formats; + *out_image_view_formats_ptr_ptr = (n_image_view_formats != 0) ? &m_image_view_formats.at(0) : nullptr; +} + +/* Please see header for specification */ +void Anvil::ImageCreateInfo::set_image_view_formats(const uint32_t& in_n_image_view_formats, + const Anvil::Format* in_image_view_formats_ptr) +{ + anvil_assert(in_n_image_view_formats != 0); + + m_image_view_formats.resize(in_n_image_view_formats); + + memcpy(&m_image_view_formats.at(0), + in_image_view_formats_ptr, + sizeof(Anvil::Format) * in_n_image_view_formats); +} diff --git a/src/misc/io.cpp b/src/misc/io.cpp index dca14a6c..1237abbb 100644 --- a/src/misc/io.cpp +++ b/src/misc/io.cpp @@ -415,10 +415,7 @@ bool Anvil::IO::read_file(std::string in_filename, if (!result_bool) { - if (result != nullptr) - { - delete [] result; - } + delete [] result; } return result_bool; @@ -543,10 +540,7 @@ bool Anvil::IO::read_file(std::string in_filename, if (!result_bool) { - if (result != nullptr) - { - delete [] result; - } + delete [] result; } return result_bool; diff --git a/src/misc/library.cpp b/src/misc/library.cpp new file mode 100644 index 00000000..5bc50d39 --- /dev/null +++ b/src/misc/library.cpp @@ -0,0 +1,121 @@ +// +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#include "misc/debug.h" +#include "misc/library.h" + +#if !defined(_WIN32) + #include +#endif + +Anvil::Library::Library(const char* in_dll_name) + :m_dll_name(in_dll_name) +{ + anvil_assert(in_dll_name != nullptr); +} + +Anvil::Library::~Library() +{ + if (m_handle != nullptr) + { + #if defined(_WIN32) + { + ::FreeLibrary(reinterpret_cast(m_handle) ); + } + #else + { + dlclose(m_handle); + } + #endif + } +} + +Anvil::LibraryUniquePtr Anvil::Library::create(const char* in_dll_name) +{ + Anvil::LibraryUniquePtr result_ptr; + + result_ptr.reset( + new Anvil::Library(in_dll_name) + ); + + if (result_ptr != nullptr) + { + if (!result_ptr->init() ) + { + result_ptr.reset(); + } + } + + return result_ptr; +} + +void* Anvil::Library::get_proc_address(const char* in_func_name) const +{ + void* result_ptr = nullptr; + + #if defined(_WIN32) + { + result_ptr = ::GetProcAddress(reinterpret_cast(m_handle), + in_func_name); + } + #else + { + result_ptr = dlsym(m_handle, + in_func_name); + } + #endif + + return result_ptr; +} + +bool Anvil::Library::init() +{ + bool result = false; + + #if defined(_WIN32) + { + m_handle = reinterpret_cast(::LoadLibrary(m_dll_name.c_str() )); + + if (m_handle == INVALID_HANDLE_VALUE) + { + anvil_assert(m_handle != INVALID_HANDLE_VALUE); + + goto end; + } + } + #else + { + m_handle = reinterpret_cast(dlopen(m_dll_name.c_str(), + RTLD_LAZY) ); + + if (m_handle == nullptr) + { + anvil_assert(m_handle != nullptr); + + goto end; + } + } + #endif + + result = true; +end: + return result; +} \ No newline at end of file diff --git a/src/misc/memalloc_backends/backend_oneshot.cpp b/src/misc/memalloc_backends/backend_oneshot.cpp index e2d45ae5..234c359c 100644 --- a/src/misc/memalloc_backends/backend_oneshot.cpp +++ b/src/misc/memalloc_backends/backend_oneshot.cpp @@ -23,6 +23,7 @@ #include "misc/memalloc_backends/backend_oneshot.h" #include "misc/debug.h" #include "misc/formats.h" +#include "misc/image_create_info.h" #include "misc/memory_allocator.h" #include "misc/memory_block_create_info.h" #include "wrappers/buffer.h" @@ -269,7 +270,7 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items const auto& current_device_mask = current_device_mask_to_item_vector_data.first; uint32_t current_memory_type_index = 0; - for (const auto& current_items: current_device_mask_to_item_vector_data.second) + for (const auto& current_items : current_device_mask_to_item_vector_data.second) { if (current_items.size() > 0) { @@ -279,16 +280,42 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items /* Go through the items, calculate offsets and the total amount of memory we're going * to need to alloc off the heap */ - for (auto& current_item_ptr : current_items) { - anvil_assert(current_item_ptr->alloc_exportable_external_handle_types == 0); - anvil_assert(current_item_ptr->alloc_external_nt_handle_info_ptr == nullptr); - - n_bytes_required = Anvil::Utils::round_up(n_bytes_required, - current_item_ptr->alloc_memory_required_alignment); + bool is_prev_item_linear = false; + Anvil::MemoryAllocator::Item* prev_item_ptr = nullptr; - alloc_offset_map[current_item_ptr] = n_bytes_required; - n_bytes_required += current_item_ptr->alloc_size; + for (auto& current_item_ptr : current_items) + { + const bool is_current_item_buffer = (current_item_ptr->type == Anvil::MemoryAllocator::ITEM_TYPE_BUFFER || + current_item_ptr->type == Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_BUFFER_REGION); + const bool is_current_item_image = (current_item_ptr->type == Anvil::MemoryAllocator::ITEM_TYPE_IMAGE_WHOLE || + current_item_ptr->type == Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_IMAGE_MIPTAIL || + current_item_ptr->type == Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_IMAGE_SUBRESOURCE); + const bool is_current_item_linear = (is_current_item_buffer) || + (is_current_item_image && current_item_ptr->image_ptr->get_create_info_ptr()->get_tiling() == Anvil::ImageTiling::LINEAR); + + anvil_assert(current_item_ptr->alloc_exportable_external_handle_types == 0); + anvil_assert(current_item_ptr->alloc_external_nt_handle_info_ptr == nullptr); + + n_bytes_required = Anvil::Utils::round_up(n_bytes_required, + current_item_ptr->alloc_memory_required_alignment); + + if (prev_item_ptr != nullptr) + { + /* Make sure to adhere to the buffer-image granularity requirement */ + if (is_prev_item_linear != is_current_item_linear) + { + n_bytes_required = Anvil::Utils::round_up(n_bytes_required, + m_device_ptr->get_physical_device_properties().core_vk1_0_properties_ptr->limits.buffer_image_granularity); + } + } + + alloc_offset_map[current_item_ptr] = n_bytes_required; + n_bytes_required += current_item_ptr->alloc_size; + + is_prev_item_linear = is_current_item_linear; + prev_item_ptr = current_item_ptr; + } } /* Bake the block and stash it */ @@ -358,12 +385,12 @@ VkResult Anvil::MemoryAllocatorBackends::OneShot::map(void* in_memory_obj VkDeviceSize in_size, void** out_result_ptr) { - return vkMapMemory(m_device_ptr->get_device_vk(), - reinterpret_cast(in_memory_object), - in_start_offset, - in_size, - 0, /* flags */ - out_result_ptr); + return Anvil::Vulkan::vkMapMemory(m_device_ptr->get_device_vk(), + reinterpret_cast(in_memory_object), + in_start_offset, + in_size, + 0, /* flags */ + out_result_ptr); } /** Tells whether or not the backend is ready to handle allocation request. @@ -389,6 +416,6 @@ bool Anvil::MemoryAllocatorBackends::OneShot::supports_external_memory_handles(c void Anvil::MemoryAllocatorBackends::OneShot::unmap(void* in_memory_object) { - vkUnmapMemory(m_device_ptr->get_device_vk(), - reinterpret_cast(in_memory_object) ); + Anvil::Vulkan::vkUnmapMemory(m_device_ptr->get_device_vk(), + reinterpret_cast(in_memory_object) ); } diff --git a/src/misc/memalloc_backends/backend_vma.cpp b/src/misc/memalloc_backends/backend_vma.cpp index b29e4817..ae5cea91 100644 --- a/src/misc/memalloc_backends/backend_vma.cpp +++ b/src/misc/memalloc_backends/backend_vma.cpp @@ -100,6 +100,45 @@ bool Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::init() const bool khr_dedicated_allocation_supported = m_device_ptr->get_extension_info()->khr_dedicated_allocation(); VkResult result = VK_ERROR_DEVICE_LOST; + /* Prepare VK func ptr array */ + m_vma_func_ptrs.reset( + new VmaVulkanFunctions() + ); + + if (m_vma_func_ptrs == nullptr) + { + anvil_assert(m_vma_func_ptrs != nullptr); + + goto end; + } + + m_vma_func_ptrs->vkAllocateMemory = Vulkan::vkAllocateMemory; + m_vma_func_ptrs->vkBindBufferMemory = Vulkan::vkBindBufferMemory; + m_vma_func_ptrs->vkBindImageMemory = Vulkan::vkBindImageMemory; + m_vma_func_ptrs->vkCreateBuffer = Vulkan::vkCreateBuffer; + m_vma_func_ptrs->vkCreateImage = Vulkan::vkCreateImage; + m_vma_func_ptrs->vkDestroyBuffer = Vulkan::vkDestroyBuffer; + m_vma_func_ptrs->vkDestroyImage = Vulkan::vkDestroyImage; + m_vma_func_ptrs->vkFreeMemory = Vulkan::vkFreeMemory; + m_vma_func_ptrs->vkGetBufferMemoryRequirements = Vulkan::vkGetBufferMemoryRequirements; + m_vma_func_ptrs->vkGetImageMemoryRequirements = Vulkan::vkGetImageMemoryRequirements; + m_vma_func_ptrs->vkGetPhysicalDeviceMemoryProperties = Vulkan::vkGetPhysicalDeviceMemoryProperties; + m_vma_func_ptrs->vkGetPhysicalDeviceProperties = Vulkan::vkGetPhysicalDeviceProperties; + m_vma_func_ptrs->vkMapMemory = Vulkan::vkMapMemory; + m_vma_func_ptrs->vkUnmapMemory = Vulkan::vkUnmapMemory; + + if (m_device_ptr->get_extension_info()->khr_get_memory_requirements2() ) + { + m_vma_func_ptrs->vkGetBufferMemoryRequirements2KHR = m_device_ptr->get_extension_khr_get_memory_requirements2_entrypoints().vkGetBufferMemoryRequirements2KHR; + m_vma_func_ptrs->vkGetImageMemoryRequirements2KHR = m_device_ptr->get_extension_khr_get_memory_requirements2_entrypoints().vkGetImageMemoryRequirements2KHR; + } + else + { + m_vma_func_ptrs->vkGetBufferMemoryRequirements2KHR = nullptr; + m_vma_func_ptrs->vkGetImageMemoryRequirements2KHR = nullptr; + } + + /* Prepare VMA create info struct */ switch (m_device_ptr->get_type() ) { case Anvil::DeviceType::MULTI_GPU: @@ -134,11 +173,13 @@ bool Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::init() create_info.device = m_device_ptr->get_device_vk(); create_info.pAllocationCallbacks = nullptr; create_info.preferredLargeHeapBlockSize = 0; + create_info.pVulkanFunctions = m_vma_func_ptrs.get(); result = vmaCreateAllocator(&create_info, &m_allocator); anvil_assert_vk_call_succeeded(result); +end: return is_vk_call_successful(result); } diff --git a/src/misc/memory_allocator.cpp b/src/misc/memory_allocator.cpp index 2fa114ad..39137b81 100644 --- a/src/misc/memory_allocator.cpp +++ b/src/misc/memory_allocator.cpp @@ -479,14 +479,6 @@ bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* anvil_assert( in_opt_device_mask_ptr == nullptr || (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); - if (!do_mgpu_sanity_checks(in_opt_device_mask_ptr, - in_opt_mgpu_peer_memory_reqs_ptr) ) - { - result = false; - - goto end; - } - /* Extract external memory handle types from the specified buffer, if none were specified. */ if (!do_external_memory_handle_type_sanity_checks(in_buffer_ptr->get_create_info_ptr()->get_exportable_external_memory_handle_types() ) ) { @@ -905,14 +897,6 @@ bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* anvil_assert(in_opt_device_mask_ptr == nullptr || (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); - if (!do_mgpu_sanity_checks(in_opt_device_mask_ptr, - in_opt_mgpu_peer_memory_reqs_ptr) ) - { - result = false; - - goto end; - } - if (!do_external_memory_handle_type_sanity_checks(in_image_ptr->get_create_info_ptr()->get_external_memory_handle_types()) ) { result = false; @@ -985,14 +969,6 @@ bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* anvil_assert( in_opt_device_mask_ptr == nullptr || (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); - if (!do_mgpu_sanity_checks(in_opt_device_mask_ptr, - in_opt_mgpu_peer_memory_reqs_ptr) ) - { - result = false; - - goto end; - } - if (mutex_ptr != nullptr) { mutex_lock = std::move( @@ -1080,14 +1056,6 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* anvil_assert( in_opt_device_mask_ptr == nullptr || (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); - if (!do_mgpu_sanity_checks(in_opt_device_mask_ptr, - in_opt_mgpu_peer_memory_reqs_ptr) ) - { - result = false; - - goto end; - } - if (mutex_ptr != nullptr) { mutex_lock = std::move( @@ -1195,14 +1163,6 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* anvil_assert(in_extent.height >= 1); anvil_assert(in_extent.width >= 1); - if (!do_mgpu_sanity_checks(in_opt_device_mask_ptr, - in_opt_mgpu_peer_memory_reqs_ptr) ) - { - result = false; - - goto end; - } - if (mutex_ptr != nullptr) { mutex_lock = std::move( @@ -1646,11 +1606,11 @@ bool Anvil::MemoryAllocator::bake() anvil_assert(result); /* Block until the sparse memory bindings are in place */ - vkWaitForFences(m_device_ptr->get_device_vk(), - 1, /* fenceCount */ - sparse_memory_binding.get_fence()->get_fence_ptr(), - VK_FALSE, /* waitAll */ - UINT64_MAX); + Anvil::Vulkan::vkWaitForFences(m_device_ptr->get_device_vk(), + 1, /* fenceCount */ + sparse_memory_binding.get_fence()->get_fence_ptr(), + VK_FALSE, /* waitAll */ + UINT64_MAX); } } @@ -1840,49 +1800,6 @@ bool Anvil::MemoryAllocator::do_external_memory_handle_type_sanity_checks(const return result; } -bool Anvil::MemoryAllocator::do_mgpu_sanity_checks(const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_peer_memory_reqs_ptr) const -{ - bool result = true; - -#if 0 - if (in_opt_peer_memory_reqs_ptr != nullptr) - { - const auto device_mask = (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr - : UINT32_MAX; - - for (const auto& current_req : *in_opt_peer_memory_reqs_ptr) - { - const auto& local_device_index = current_req.first.first; - const auto& remote_device_index = current_req.first.second; - - if ((device_mask & (1 << local_device_index) ) == 0) - { - anvil_assert((device_mask & (1 << local_device_index) ) != 0); - - result = false; - goto end; - } - - if ((device_mask & (1 << remote_device_index) ) == 0) - { - anvil_assert((device_mask & (1 << remote_device_index) ) != 0); - - result = false; - goto end; - } - } - } - -end: -#else - ANVIL_REDUNDANT_ARGUMENT(in_opt_device_mask_ptr); - ANVIL_REDUNDANT_ARGUMENT(in_opt_peer_memory_reqs_ptr); -#endif - - return result; -} - /** Tells whether or not a given set of memory types supports the requested memory features. */ bool Anvil::MemoryAllocator::is_alloc_supported(uint32_t in_memory_types, Anvil::MemoryFeatureFlags in_memory_features, diff --git a/src/misc/object_tracker.cpp b/src/misc/object_tracker.cpp index e92fda61..87fa3c0f 100644 --- a/src/misc/object_tracker.cpp +++ b/src/misc/object_tracker.cpp @@ -40,12 +40,9 @@ Anvil::ObjectTracker::ObjectTracker() /* Please see header for specification */ void Anvil::ObjectTracker::destroy() { - if (object_tracker_ptr != nullptr) - { - delete object_tracker_ptr; + delete object_tracker_ptr; - object_tracker_ptr = nullptr; - } + object_tracker_ptr = nullptr; } /* Please see header for specification */ diff --git a/src/misc/render_pass_create_info.cpp b/src/misc/render_pass_create_info.cpp index 201b2a82..f08e6ddb 100644 --- a/src/misc/render_pass_create_info.cpp +++ b/src/misc/render_pass_create_info.cpp @@ -31,6 +31,7 @@ Anvil::RenderPassCreateInfo::RenderPassCreateInfo(const Anvil::BaseDevice* in_device_ptr) :m_device_ptr (in_device_ptr), + m_multiview_enabled (false), m_update_preserved_attachments(false) { anvil_assert(in_device_ptr != nullptr); @@ -667,6 +668,32 @@ bool Anvil::RenderPassCreateInfo::get_dependency_properties(uint32_t return result; } +/** Please see header for specification */ +bool Anvil::RenderPassCreateInfo::get_dependency_multiview_properties(uint32_t in_n_dependency, + int32_t* out_view_offset_ptr) const +{ + bool result = false; + + if (!m_multiview_enabled) + { + anvil_assert(m_multiview_enabled); + + goto end; + } + + if (m_subpass_dependencies.size() <= in_n_dependency) + { + anvil_assert(m_subpass_dependencies.size() > in_n_dependency); + + goto end; + } + + *out_view_offset_ptr = m_subpass_dependencies.at(in_n_dependency).multiview_view_offset; + result = true; +end: + return result; +} + /** Please see header for specification */ bool Anvil::RenderPassCreateInfo::get_depth_stencil_attachment_properties(RenderPassAttachmentID in_attachment_id, Anvil::AttachmentLoadOp* out_opt_depth_load_op_ptr, @@ -749,6 +776,16 @@ uint32_t Anvil::RenderPassCreateInfo::get_max_color_location_used_by_subpass(con return result; } +/* Please see header for specification */ +void Anvil::RenderPassCreateInfo::get_multiview_correlation_masks(uint32_t* out_n_correlation_masks_ptr, + const uint32_t** out_correlation_masks_ptr_ptr) const +{ + anvil_assert(m_multiview_enabled); + + *out_correlation_masks_ptr_ptr = (m_correlation_masks.size() > 0) ? &m_correlation_masks.at(0) : nullptr; + *out_n_correlation_masks_ptr = static_cast(m_correlation_masks.size() ); +} + /* Please see header for specification */ bool Anvil::RenderPassCreateInfo::get_subpass_n_attachments(SubPassID in_subpass_id, AttachmentType in_attachment_type, @@ -930,6 +967,104 @@ bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID return result; } +/* Please see header for specification */ +bool Anvil::RenderPassCreateInfo::get_subpass_view_mask(SubPassID in_subpass_id, + uint32_t* out_view_mask_ptr) const +{ + bool result = false; + + if (!m_multiview_enabled) + { + anvil_assert(m_multiview_enabled); + + goto end; + } + + if (m_subpasses.size() <= in_subpass_id) + { + anvil_assert(m_subpasses.size() > in_subpass_id); + + goto end; + } + + *out_view_mask_ptr = m_subpasses.at(in_subpass_id)->multiview_view_mask; + result = true; +end: + return result; +} + +/* Please see header for specification */ +void Anvil::RenderPassCreateInfo::set_correlation_masks(const uint32_t& in_n_correlation_masks, + const uint32_t* in_correlation_masks_ptr) +{ + anvil_assert(in_n_correlation_masks != 0); + + m_correlation_masks.resize(in_n_correlation_masks); + + memcpy(&m_correlation_masks.at(0), + in_correlation_masks_ptr, + in_n_correlation_masks * sizeof(uint32_t) ); + + if (!m_multiview_enabled) + { + m_multiview_enabled = true; + } +} + +/* Please see header for specification */ +bool Anvil::RenderPassCreateInfo::set_dependency_view_local_properties(const uint32_t& in_n_dependency, + const int32_t& in_view_offset) +{ + decltype(m_subpass_dependencies)::iterator dep_iterator; + bool result = false; + + if (m_subpass_dependencies.size() <= in_n_dependency) + { + anvil_assert(m_subpass_dependencies.size() > in_n_dependency); + + goto end; + } + + dep_iterator = m_subpass_dependencies.begin() + in_n_dependency; + dep_iterator->multiview_view_offset = in_view_offset; + + if (!m_multiview_enabled) + { + m_multiview_enabled = true; + } + + result = true; +end: + return result; +} + +/* Please see header for specification */ +bool Anvil::RenderPassCreateInfo::set_subpass_view_mask(SubPassID in_subpass_id, + const uint32_t& in_view_mask) +{ + bool result = false; + decltype(m_subpasses)::iterator subpass_iterator; + + if (m_subpasses.size() <= in_subpass_id) + { + anvil_assert(m_subpasses.size() > in_subpass_id); + + goto end; + } + + subpass_iterator = m_subpasses.begin() + in_subpass_id; + (*subpass_iterator)->multiview_view_mask = in_view_mask; + + if (!m_multiview_enabled) + { + m_multiview_enabled = true; + } + + result = true; +end: + return result; +} + /** Initializes the vector of preserved attachments for all defined attachments. The algorithm * used is as follows: * diff --git a/src/misc/sampler_create_info.cpp b/src/misc/sampler_create_info.cpp index fbfad7e6..71a12311 100644 --- a/src/misc/sampler_create_info.cpp +++ b/src/misc/sampler_create_info.cpp @@ -22,22 +22,22 @@ #include "misc/sampler_create_info.h" -Anvil::SamplerCreateInfoUniquePtr Anvil::SamplerCreateInfo::create(const Anvil::BaseDevice* in_device_ptr, - Anvil::Filter in_mag_filter, - Anvil::Filter in_min_filter, - Anvil::SamplerMipmapMode in_mipmap_mode, - Anvil::SamplerAddressMode in_address_mode_u, - Anvil::SamplerAddressMode in_address_mode_v, - Anvil::SamplerAddressMode in_address_mode_w, - float in_lod_bias, - float in_max_anisotropy, - bool in_compare_enable, - Anvil::CompareOp in_compare_op, - float in_min_lod, - float in_max_lod, - Anvil::BorderColor in_border_color, - bool in_use_unnormalized_coordinates, - MTSafety in_mt_safety) +Anvil::SamplerCreateInfoUniquePtr Anvil::SamplerCreateInfo::create(const Anvil::BaseDevice* in_device_ptr, + Anvil::Filter in_mag_filter, + Anvil::Filter in_min_filter, + Anvil::SamplerMipmapMode in_mipmap_mode, + Anvil::SamplerAddressMode in_address_mode_u, + Anvil::SamplerAddressMode in_address_mode_v, + Anvil::SamplerAddressMode in_address_mode_w, + float in_lod_bias, + float in_max_anisotropy, + bool in_compare_enable, + Anvil::CompareOp in_compare_op, + float in_min_lod, + float in_max_lod, + Anvil::BorderColor in_border_color, + bool in_use_unnormalized_coordinates, + MTSafety in_mt_safety) { Anvil::SamplerCreateInfoUniquePtr result_ptr; @@ -94,6 +94,7 @@ Anvil::SamplerCreateInfo::SamplerCreateInfo(const Anvil::BaseDevice* in_devic m_min_lod (in_min_lod), m_mipmap_mode (in_mipmap_mode), m_mt_safety (in_mt_safety), + m_sampler_reduction_mode (Anvil::SamplerReductionMode::UNKNOWN), m_use_unnormalized_coordinates(in_use_unnormalized_coordinates) { /* Stub */ diff --git a/src/misc/swapchain_create_info.cpp b/src/misc/swapchain_create_info.cpp index edd7a7cf..57189166 100644 --- a/src/misc/swapchain_create_info.cpp +++ b/src/misc/swapchain_create_info.cpp @@ -27,6 +27,7 @@ Anvil::SwapchainCreateInfoUniquePtr Anvil::SwapchainCreateInfo::create(Anvil::Ba Anvil::RenderingSurface* in_parent_surface_ptr, Anvil::Window* in_window_ptr, Anvil::Format in_format, + Anvil::ColorSpaceKHR in_color_space, Anvil::PresentModeKHR in_present_mode, Anvil::ImageUsageFlags in_usage_flags, uint32_t in_n_images) @@ -39,6 +40,7 @@ Anvil::SwapchainCreateInfoUniquePtr Anvil::SwapchainCreateInfo::create(Anvil::Ba in_parent_surface_ptr, in_window_ptr, in_format, + in_color_space, in_present_mode, in_usage_flags, in_n_images, @@ -54,13 +56,15 @@ Anvil::SwapchainCreateInfo::SwapchainCreateInfo(Anvil::BaseDevice* Anvil::RenderingSurface* in_parent_surface_ptr, Anvil::Window* in_window_ptr, Anvil::Format in_format, + Anvil::ColorSpaceKHR in_color_space, Anvil::PresentModeKHR in_present_mode, Anvil::ImageUsageFlags in_usage_flags, uint32_t in_n_images, MTSafety in_mt_safety, Anvil::SwapchainCreateFlags in_flags, Anvil::DeviceGroupPresentModeFlags in_mgpu_present_mode_flags) - :m_device_ptr (in_device_ptr), + :m_color_space (in_color_space), + m_device_ptr (in_device_ptr), m_flags (in_flags), m_format (in_format), m_mgpu_present_mode_flags(in_mgpu_present_mode_flags), diff --git a/src/misc/types.cpp b/src/misc/types.cpp index 62dfe84d..e34c8924 100644 --- a/src/misc/types.cpp +++ b/src/misc/types.cpp @@ -42,6 +42,7 @@ INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::MemoryFeatureFlags, INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::MemoryHeapFlags, VkMemoryHeapFlags, Anvil::MemoryHeapFlagBits); INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::MemoryPropertyFlags, VkMemoryPropertyFlags, Anvil::MemoryPropertyFlagBits); INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::PeerMemoryFeatureFlags, VkPeerMemoryFeatureFlagsKHR, Anvil::PeerMemoryFeatureFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::PipelineCreateFlags, VkPipelineCreateFlags, Anvil::PipelineCreateFlagBits); INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::PipelineStageFlags, VkPipelineStageFlags, Anvil::PipelineStageFlagBits); INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::QueueFamilyFlags, uint32_t, Anvil::QueueFamilyFlagBits); INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::QueueFlags, VkQueueFlags, Anvil::QueueFlagBits); diff --git a/src/misc/types_struct.cpp b/src/misc/types_struct.cpp index 95d63d3e..786739cc 100644 --- a/src/misc/types_struct.cpp +++ b/src/misc/types_struct.cpp @@ -132,6 +132,17 @@ Anvil::BufferBarrier::~BufferBarrier() /* Stub */ } +bool Anvil::BufferBarrier::operator==(const Anvil::BufferBarrier& in_barrier) const +{ + return (dst_access_mask == in_barrier.dst_access_mask && + src_access_mask == in_barrier.src_access_mask && + buffer_ptr == in_barrier.buffer_ptr && + dst_queue_family_index == in_barrier.dst_queue_family_index && + offset == in_barrier.offset && + size == in_barrier.size && + src_queue_family_index == in_barrier.src_queue_family_index); +} + Anvil::BufferProperties::BufferProperties() { /* Stub */ @@ -298,6 +309,11 @@ VkDescriptorUpdateTemplateEntryKHR Anvil::DescriptorUpdateTemplateEntry::get_vk_ return result; } +Anvil::ExtensionAMDBufferMarkerEntrypoints::ExtensionAMDBufferMarkerEntrypoints() +{ + vkCmdWriteBufferMarkerAMD = nullptr; +} + Anvil::ExtensionAMDDrawIndirectCountEntrypoints::ExtensionAMDDrawIndirectCountEntrypoints() { vkCmdDrawIndexedIndirectCountAMD = nullptr; @@ -324,6 +340,22 @@ Anvil::ExtensionEXTDebugReportEntrypoints::ExtensionEXTDebugReportEntrypoints() vkDestroyDebugReportCallbackEXT = nullptr; } +Anvil::ExtensionEXTExternalMemoryHostEntrypoints::ExtensionEXTExternalMemoryHostEntrypoints() +{ + vkGetMemoryHostPointerPropertiesEXT = nullptr; +} + +Anvil::ExtensionEXTHdrMetadataEntrypoints::ExtensionEXTHdrMetadataEntrypoints() +{ + vkSetHdrMetadataEXT = nullptr; +} + +Anvil::ExtensionEXTSampleLocationsEntrypoints::ExtensionEXTSampleLocationsEntrypoints() +{ + vkCmdSetSampleLocationsEXT = nullptr; + vkGetPhysicalDeviceMultisamplePropertiesEXT = nullptr; +} + Anvil::ExtensionKHRDeviceGroupEntrypoints::ExtensionKHRDeviceGroupEntrypoints() { vkAcquireNextImage2KHR = nullptr; @@ -656,6 +688,72 @@ bool Anvil::EXTDescriptorIndexingProperties::operator==(const EXTDescriptorIndex shader_uniform_buffer_array_non_uniform_indexing_native == in_props.shader_uniform_buffer_array_non_uniform_indexing_native); } +Anvil::EXTExternalMemoryHostProperties::EXTExternalMemoryHostProperties() +{ + min_imported_host_pointer_alignment = 0; +} + +Anvil::EXTExternalMemoryHostProperties::EXTExternalMemoryHostProperties(const VkPhysicalDeviceExternalMemoryHostPropertiesEXT& in_props) +{ + min_imported_host_pointer_alignment = in_props.minImportedHostPointerAlignment; +} + +bool Anvil::EXTExternalMemoryHostProperties::operator==(const Anvil::EXTExternalMemoryHostProperties& in_props) const +{ + return (min_imported_host_pointer_alignment == in_props.min_imported_host_pointer_alignment); +} + +Anvil::EXTSampleLocationsProperties::EXTSampleLocationsProperties() +{ + max_sample_location_grid_size.height = 0; + max_sample_location_grid_size.width = 0; + sample_location_coordinate_range[0] = 0.0f; + sample_location_coordinate_range[1] = 0.0f; + sample_location_sample_counts = Anvil::SampleCountFlagBits::NONE; + sample_location_sub_pixel_bits = 0; + variable_sample_locations = false; +} + +Anvil::EXTSampleLocationsProperties::EXTSampleLocationsProperties(const VkPhysicalDeviceSampleLocationsPropertiesEXT& in_props) +{ + max_sample_location_grid_size.height = in_props.maxSampleLocationGridSize.height; + max_sample_location_grid_size.width = in_props.maxSampleLocationGridSize.width; + sample_location_coordinate_range[0] = in_props.sampleLocationCoordinateRange[0]; + sample_location_coordinate_range[1] = in_props.sampleLocationCoordinateRange[1]; + sample_location_sample_counts = static_cast(in_props.sampleLocationSampleCounts); + sample_location_sub_pixel_bits = in_props.sampleLocationSubPixelBits; + variable_sample_locations = (in_props.variableSampleLocations == VK_TRUE); +} + +bool Anvil::EXTSampleLocationsProperties::operator==(const Anvil::EXTSampleLocationsProperties& in_props) const +{ + return (max_sample_location_grid_size.height == in_props.max_sample_location_grid_size.height && + max_sample_location_grid_size.width == in_props.max_sample_location_grid_size.width && + sample_location_coordinate_range[0] == in_props.sample_location_coordinate_range[0] && + sample_location_coordinate_range[1] == in_props.sample_location_coordinate_range[1] && + sample_location_sample_counts == in_props.sample_location_sample_counts && + sample_location_sub_pixel_bits == in_props.sample_location_sub_pixel_bits && + variable_sample_locations == in_props.variable_sample_locations); +} + +Anvil::EXTSamplerFilterMinmaxProperties::EXTSamplerFilterMinmaxProperties() +{ + filter_minmax_image_component_mapping = false; + filter_minmax_single_component_formats = false; +} + +Anvil::EXTSamplerFilterMinmaxProperties::EXTSamplerFilterMinmaxProperties(const VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT& in_props) +{ + filter_minmax_image_component_mapping = (in_props.filterMinmaxImageComponentMapping == VK_TRUE); + filter_minmax_single_component_formats = (in_props.filterMinmaxSingleComponentFormats == VK_TRUE); +} + +bool Anvil::EXTSamplerFilterMinmaxProperties::operator==(const Anvil::EXTSamplerFilterMinmaxProperties& in_props) const +{ + return (filter_minmax_image_component_mapping == in_props.filter_minmax_image_component_mapping && + filter_minmax_single_component_formats == in_props.filter_minmax_single_component_formats); +} + Anvil::EXTVertexAttributeDivisorProperties::EXTVertexAttributeDivisorProperties() :max_vertex_attribute_divisor(0) { @@ -668,6 +766,11 @@ Anvil::EXTVertexAttributeDivisorProperties::EXTVertexAttributeDivisorProperties( /* Stub */ } +bool Anvil::EXTVertexAttributeDivisorProperties::operator==(const Anvil::EXTVertexAttributeDivisorProperties& in_props) const +{ + return (max_vertex_attribute_divisor == in_props.max_vertex_attribute_divisor); +} + Anvil::ExternalFenceProperties::ExternalFenceProperties() { is_exportable = false; @@ -830,11 +933,7 @@ bool Anvil::ImageBarrier::operator==(const ImageBarrier& in_barrier) const result &= (old_layout == in_barrier.old_layout); result &= (src_queue_family_index == in_barrier.src_queue_family_index); - result &= (subresource_range.aspect_mask == in_barrier.subresource_range.aspect_mask); - result &= (subresource_range.base_array_layer == in_barrier.subresource_range.base_array_layer); - result &= (subresource_range.base_mip_level == in_barrier.subresource_range.base_mip_level); - result &= (subresource_range.layer_count == in_barrier.subresource_range.layer_count); - result &= (subresource_range.level_count == in_barrier.subresource_range.level_count); + result &= (subresource_range == in_barrier.subresource_range); return result; } @@ -853,6 +952,15 @@ Anvil::ImageSFRMemoryBindingUpdate::ImageSFRMemoryBindingUpdate() memory_block_ptr = nullptr; } +bool Anvil::ImageSubresourceRange::operator==(const Anvil::ImageSubresourceRange& in_subresource_range) const +{ + return (aspect_mask == in_subresource_range.aspect_mask && + base_mip_level == in_subresource_range.base_mip_level && + level_count == in_subresource_range.level_count && + base_array_layer == in_subresource_range.base_array_layer && + layer_count == in_subresource_range.layer_count); +} + Anvil::KHR16BitStorageFeatures::KHR16BitStorageFeatures() { is_input_output_storage_supported = false; @@ -892,6 +1000,40 @@ VkPhysicalDevice16BitStorageFeaturesKHR Anvil::KHR16BitStorageFeatures::get_vk_p } +Anvil::KHR8BitStorageFeatures::KHR8BitStorageFeatures() +{ + storage_buffer_8_bit_access = false; + storage_push_constant_8 = false; + uniform_and_storage_buffer_8_bit_access = false; +} + +Anvil::KHR8BitStorageFeatures::KHR8BitStorageFeatures(const VkPhysicalDevice8BitStorageFeaturesKHR& in_features) +{ + storage_buffer_8_bit_access = (in_features.storageBuffer8BitAccess == VK_TRUE); + storage_push_constant_8 = (in_features.storagePushConstant8 == VK_TRUE); + uniform_and_storage_buffer_8_bit_access = (in_features.uniformAndStorageBuffer8BitAccess == VK_TRUE); +} + +VkPhysicalDevice8BitStorageFeaturesKHR Anvil::KHR8BitStorageFeatures::get_vk_physical_device_8_bit_storage_features() const +{ + VkPhysicalDevice8BitStorageFeaturesKHR result; + + result.pNext = nullptr; + result.storageBuffer8BitAccess = (storage_buffer_8_bit_access) ? VK_TRUE : VK_FALSE; + result.storagePushConstant8 = (storage_push_constant_8) ? VK_TRUE : VK_FALSE; + result.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR; + result.uniformAndStorageBuffer8BitAccess = (uniform_and_storage_buffer_8_bit_access) ? VK_TRUE : VK_FALSE; + + return result; +} + +bool Anvil::KHR8BitStorageFeatures::operator==(const Anvil::KHR8BitStorageFeatures& in_features) const +{ + return (storage_buffer_8_bit_access == in_features.storage_buffer_8_bit_access && + storage_push_constant_8 == in_features.storage_push_constant_8 && + uniform_and_storage_buffer_8_bit_access == in_features.uniform_and_storage_buffer_8_bit_access); +} + Anvil::KHRMaintenance2PhysicalDevicePointClippingProperties::KHRMaintenance2PhysicalDevicePointClippingProperties() :point_clipping_behavior(PointClippingBehavior::UNKNOWN) { @@ -929,6 +1071,88 @@ bool Anvil::KHRMaintenance3Properties::operator==(const Anvil::KHRMaintenance3Pr max_per_set_descriptors == in_props.max_per_set_descriptors); } +Anvil::KHRMultiviewFeatures::KHRMultiviewFeatures() +{ + multiview = false; + multiview_geometry_shader = false; + multiview_tessellation_shader = false; +} + +Anvil::KHRMultiviewFeatures::KHRMultiviewFeatures(const VkPhysicalDeviceMultiviewFeatures& in_features) +{ + multiview = (in_features.multiview == VK_TRUE); + multiview_geometry_shader = (in_features.multiviewGeometryShader == VK_TRUE); + multiview_tessellation_shader = (in_features.multiviewTessellationShader == VK_TRUE); +} + +VkPhysicalDeviceMultiviewFeatures Anvil::KHRMultiviewFeatures::get_vk_physical_device_multiview_features() const +{ + VkPhysicalDeviceMultiviewFeatures result; + + result.multiview = (multiview) ? VK_TRUE : VK_FALSE; + result.multiviewGeometryShader = (multiview_geometry_shader) ? VK_TRUE : VK_FALSE; + result.multiviewTessellationShader = (multiview_tessellation_shader) ? VK_TRUE : VK_FALSE; + result.pNext = nullptr; + result.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHR; + + return result; +} + +bool Anvil::KHRMultiviewFeatures::operator==(const Anvil::KHRMultiviewFeatures& in_features) const +{ + return (in_features.multiview == multiview && + in_features.multiview_geometry_shader == multiview_geometry_shader && + in_features.multiview_tessellation_shader == multiview_tessellation_shader); +} + +Anvil::KHRMultiviewProperties::KHRMultiviewProperties() +{ + max_multiview_instance_index = 0; + max_multiview_view_count = 0; +} + +Anvil::KHRMultiviewProperties::KHRMultiviewProperties(const VkPhysicalDeviceMultiviewPropertiesKHR& in_props) +{ + max_multiview_instance_index = in_props.maxMultiviewInstanceIndex; + max_multiview_view_count = in_props.maxMultiviewViewCount; +} + +bool Anvil::KHRMultiviewProperties::operator==(const KHRMultiviewProperties& in_props) const +{ + return (max_multiview_instance_index == in_props.max_multiview_instance_index && + max_multiview_view_count == in_props.max_multiview_view_count); +} + +Anvil::KHRVariablePointerFeatures::KHRVariablePointerFeatures() +{ + variable_pointers = false; + variable_pointers_storage_buffer = false; +} + +Anvil::KHRVariablePointerFeatures::KHRVariablePointerFeatures(const VkPhysicalDeviceVariablePointerFeatures& in_features) +{ + variable_pointers = (in_features.variablePointers == VK_TRUE); + variable_pointers_storage_buffer = (in_features.variablePointersStorageBuffer == VK_TRUE); +} + +VkPhysicalDeviceVariablePointerFeaturesKHR Anvil::KHRVariablePointerFeatures::get_vk_physical_device_variable_pointer_features() const +{ + VkPhysicalDeviceVariablePointerFeaturesKHR result; + + result.pNext = nullptr; + result.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR; + result.variablePointers = (variable_pointers) ? VK_TRUE : VK_FALSE; + result.variablePointersStorageBuffer = (variable_pointers_storage_buffer) ? VK_TRUE : VK_FALSE; + + return result; +} + +bool Anvil::KHRVariablePointerFeatures::operator==(const Anvil::KHRVariablePointerFeatures& in_props) const +{ + return (variable_pointers == in_props.variable_pointers && + variable_pointers_storage_buffer == in_props.variable_pointers_storage_buffer); +} + Anvil::Layer::Layer(const std::string& in_layer_name) { implementation_version = 0; @@ -998,12 +1222,9 @@ Anvil::MemoryProperties::MemoryProperties() /** Destructor */ Anvil::MemoryProperties::~MemoryProperties() { - if (heaps != nullptr) - { - delete [] heaps; + delete [] heaps; - heaps = nullptr; - } + heaps = nullptr; } /* Please see header for specification */ @@ -1615,27 +1836,41 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_cube_map_array_from_uchar_vect Anvil::PhysicalDeviceProperties::PhysicalDeviceProperties() { - amd_shader_core_properties_ptr = nullptr; - core_vk1_0_properties_ptr = nullptr; - ext_descriptor_indexing_properties_ptr = nullptr; - khr_maintenance2_point_clipping_properties_ptr = nullptr; - khr_maintenance3_properties_ptr = nullptr; + amd_shader_core_properties_ptr = nullptr; + core_vk1_0_properties_ptr = nullptr; + ext_descriptor_indexing_properties_ptr = nullptr; + ext_external_memory_host_properties_ptr = nullptr; + ext_sample_locations_properties_ptr = nullptr; + ext_sampler_filter_minmax_properties_ptr = nullptr; + ext_vertex_attribute_divisor_properties_ptr = nullptr; + khr_external_memory_capabilities_physical_device_id_properties_ptr = nullptr; + khr_maintenance2_point_clipping_properties_ptr = nullptr; + khr_maintenance3_properties_ptr = nullptr; + khr_multiview_properties_ptr = nullptr; } Anvil::PhysicalDeviceProperties::PhysicalDeviceProperties(const AMDShaderCoreProperties* in_amd_shader_core_properties_ptr, const PhysicalDevicePropertiesCoreVK10* in_core_vk1_0_properties_ptr, const EXTDescriptorIndexingProperties* in_ext_descriptor_indexing_properties_ptr, + const EXTExternalMemoryHostProperties* in_ext_external_memory_host_properties_ptr, + const EXTSampleLocationsProperties* in_ext_sample_locations_properties_ptr, + const EXTSamplerFilterMinmaxProperties* in_ext_sampler_filter_minmax_properties_ptr, const EXTVertexAttributeDivisorProperties* in_ext_vertex_attribute_divisor_properties_ptr, const Anvil::KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties* in_khr_external_memory_caps_physical_device_id_props_ptr, const KHRMaintenance3Properties* in_khr_maintenance3_properties_ptr, - const Anvil::KHRMaintenance2PhysicalDevicePointClippingProperties* in_khr_maintenance2_point_clipping_properties_ptr) + const Anvil::KHRMaintenance2PhysicalDevicePointClippingProperties* in_khr_maintenance2_point_clipping_properties_ptr, + const Anvil::KHRMultiviewProperties* in_khr_multiview_properties_ptr) :amd_shader_core_properties_ptr (in_amd_shader_core_properties_ptr), core_vk1_0_properties_ptr (in_core_vk1_0_properties_ptr), ext_descriptor_indexing_properties_ptr (in_ext_descriptor_indexing_properties_ptr), + ext_external_memory_host_properties_ptr (in_ext_external_memory_host_properties_ptr), + ext_sample_locations_properties_ptr (in_ext_sample_locations_properties_ptr), + ext_sampler_filter_minmax_properties_ptr (in_ext_sampler_filter_minmax_properties_ptr), ext_vertex_attribute_divisor_properties_ptr (in_ext_vertex_attribute_divisor_properties_ptr), khr_external_memory_capabilities_physical_device_id_properties_ptr(in_khr_external_memory_caps_physical_device_id_props_ptr), khr_maintenance2_point_clipping_properties_ptr (in_khr_maintenance2_point_clipping_properties_ptr), - khr_maintenance3_properties_ptr (in_khr_maintenance3_properties_ptr) + khr_maintenance3_properties_ptr (in_khr_maintenance3_properties_ptr), + khr_multiview_properties_ptr (in_khr_multiview_properties_ptr) { /* Stub */ } @@ -1660,15 +1895,24 @@ Anvil::PhysicalDeviceFeatures::PhysicalDeviceFeatures() core_vk1_0_features_ptr = nullptr; ext_descriptor_indexing_features_ptr = nullptr; khr_16bit_storage_features_ptr = nullptr; + khr_8bit_storage_features_ptr = nullptr; + khr_multiview_features_ptr = nullptr; + khr_variable_pointer_features_ptr = nullptr; } Anvil::PhysicalDeviceFeatures::PhysicalDeviceFeatures(const PhysicalDeviceFeaturesCoreVK10* in_core_vk1_0_features_ptr, const EXTDescriptorIndexingFeatures* in_ext_descriptor_indexing_features_ptr, - const KHR16BitStorageFeatures* in_khr_16_bit_storage_features_ptr) + const KHR16BitStorageFeatures* in_khr_16_bit_storage_features_ptr, + const KHR8BitStorageFeatures* in_khr_8_bit_storage_features_ptr, + const KHRMultiviewFeatures* in_khr_multiview_features_ptr, + const KHRVariablePointerFeatures* in_khr_variable_pointer_features_ptr) { core_vk1_0_features_ptr = in_core_vk1_0_features_ptr; ext_descriptor_indexing_features_ptr = in_ext_descriptor_indexing_features_ptr; khr_16bit_storage_features_ptr = in_khr_16_bit_storage_features_ptr; + khr_8bit_storage_features_ptr = in_khr_8_bit_storage_features_ptr; + khr_multiview_features_ptr = in_khr_multiview_features_ptr; + khr_variable_pointer_features_ptr = in_khr_variable_pointer_features_ptr; } Anvil::PhysicalDeviceGroup::PhysicalDeviceGroup() @@ -1763,7 +2007,7 @@ Anvil::PhysicalDeviceLimits::PhysicalDeviceLimits() optimal_buffer_copy_offset_alignment (std::numeric_limits::max() ), optimal_buffer_copy_row_pitch_alignment (std::numeric_limits::max() ), point_size_granularity (FLT_MAX), - sampled_image_color_sample_counts (Anvil::SampleCountFlagBits::NONE), + sampled_image_color_sample_counts (Anvil::SampleCountFlagBits::NONE), sampled_image_depth_sample_counts (Anvil::SampleCountFlagBits::NONE), sampled_image_integer_sample_counts (Anvil::SampleCountFlagBits::NONE), sampled_image_stencil_sample_counts (Anvil::SampleCountFlagBits::NONE), @@ -2072,8 +2316,6 @@ Anvil::KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties::KHRExternalMemor Anvil::KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties::KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties(const VkPhysicalDeviceIDPropertiesKHR& in_properties) { - anvil_assert(in_properties.pNext == nullptr); - device_luid_valid = VK_BOOL32_TO_BOOL(in_properties.deviceLUIDValid); device_node_mask = in_properties.deviceNodeMask; @@ -2088,6 +2330,45 @@ Anvil::KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties::KHRExternalMemor VK_UUID_SIZE); } +bool Anvil::KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties::operator==(const Anvil::KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties& in_props) const +{ + bool result = false; + + if (device_luid_valid != in_props.device_luid_valid || + device_node_mask != in_props.device_node_mask) + { + goto end; + } + + if (device_luid_valid) + { + if (memcmp(device_luid, + in_props.device_luid, + sizeof(device_luid)) != 0) + { + goto end; + } + } + + if (memcmp(device_uuid, + in_props.device_uuid, + sizeof(device_uuid)) != 0) + { + goto end; + } + + if (memcmp(driver_uuid, + in_props.driver_uuid, + sizeof(driver_uuid)) != 0) + { + goto end; + } + + result = true; +end: + return result; +} + Anvil::PhysicalDevicePropertiesCoreVK10::PhysicalDevicePropertiesCoreVK10(const VkPhysicalDeviceProperties& in_physical_device_properties) :api_version (in_physical_device_properties.apiVersion), device_id (in_physical_device_properties.deviceID), @@ -2310,6 +2591,9 @@ bool Anvil::PhysicalDeviceFeatures::operator==(const PhysicalDeviceFeatures& in_ const bool core_vk1_0_features_match = (*core_vk1_0_features_ptr == *in_physical_device_features.core_vk1_0_features_ptr); bool ext_descriptor_indexing_features_match = false; bool khr_16bit_storage_features_match = false; + bool khr_8bit_storage_features_match = false; + bool khr_multiview_features_match = false; + bool khr_variable_pointer_features_match = false; if (khr_16bit_storage_features_ptr != nullptr && in_physical_device_features.khr_16bit_storage_features_ptr != nullptr) @@ -2322,6 +2606,17 @@ bool Anvil::PhysicalDeviceFeatures::operator==(const PhysicalDeviceFeatures& in_ in_physical_device_features.khr_16bit_storage_features_ptr == nullptr); } + if (khr_8bit_storage_features_ptr != nullptr && + in_physical_device_features.khr_8bit_storage_features_ptr != nullptr) + { + khr_8bit_storage_features_match = (*khr_8bit_storage_features_ptr == *in_physical_device_features.khr_8bit_storage_features_ptr); + } + else + { + khr_8bit_storage_features_match = (khr_8bit_storage_features_ptr == nullptr && + in_physical_device_features.khr_8bit_storage_features_ptr == nullptr); + } + if (ext_descriptor_indexing_features_ptr != nullptr && in_physical_device_features.ext_descriptor_indexing_features_ptr != nullptr) { @@ -2333,9 +2628,34 @@ bool Anvil::PhysicalDeviceFeatures::operator==(const PhysicalDeviceFeatures& in_ in_physical_device_features.ext_descriptor_indexing_features_ptr == nullptr); } + if (khr_multiview_features_ptr != nullptr && + in_physical_device_features.khr_multiview_features_ptr != nullptr) + { + khr_multiview_features_match = (*ext_descriptor_indexing_features_ptr == *in_physical_device_features.ext_descriptor_indexing_features_ptr); + } + else + { + khr_multiview_features_match = (khr_multiview_features_ptr == nullptr && + in_physical_device_features.khr_multiview_features_ptr == nullptr); + } + + if (khr_variable_pointer_features_ptr != nullptr && + in_physical_device_features.khr_variable_pointer_features_ptr != nullptr) + { + khr_variable_pointer_features_match = (*khr_variable_pointer_features_ptr == *in_physical_device_features.khr_variable_pointer_features_ptr); + } + else + { + khr_variable_pointer_features_match = (khr_variable_pointer_features_ptr == nullptr && + in_physical_device_features.khr_variable_pointer_features_ptr == nullptr); + } + return core_vk1_0_features_match && ext_descriptor_indexing_features_match && - khr_16bit_storage_features_match; + khr_16bit_storage_features_match && + khr_8bit_storage_features_match && + khr_multiview_features_match && + khr_variable_pointer_features_match; } Anvil::PhysicalDeviceFeaturesCoreVK10::PhysicalDeviceFeaturesCoreVK10() @@ -2585,7 +2905,14 @@ bool Anvil::PhysicalDeviceProperties::operator==(const PhysicalDeviceProperties& bool amd_shader_core_properties_match = false; const bool core_vk1_0_features_match = (*core_vk1_0_properties_ptr == *in_props.core_vk1_0_properties_ptr); bool ext_descriptor_indexing_properties_match = false; + bool ext_external_memory_host_properties_match = false; + bool ext_sample_locations_properties_match = false; + bool ext_sampler_filter_minmax_properties_match = false; + bool ext_vertex_attribute_divisor_properties_match = false; + bool khr_external_memory_capabilities_properties_match = false; + bool khr_maintenance2_properties_match = false; bool khr_maintenance3_properties_match = false; + bool khr_multiview_properties_match = false; if (amd_shader_core_properties_ptr != nullptr && in_props.amd_shader_core_properties_ptr != nullptr) @@ -2609,6 +2936,72 @@ bool Anvil::PhysicalDeviceProperties::operator==(const PhysicalDeviceProperties& in_props.ext_descriptor_indexing_properties_ptr == nullptr); } + if (ext_external_memory_host_properties_ptr != nullptr && + in_props.ext_external_memory_host_properties_ptr != nullptr) + { + ext_external_memory_host_properties_match = (*ext_external_memory_host_properties_ptr == *in_props.ext_external_memory_host_properties_ptr); + } + else + { + ext_external_memory_host_properties_match = (ext_external_memory_host_properties_ptr == nullptr && + in_props.ext_external_memory_host_properties_ptr == nullptr); + } + + if (ext_sample_locations_properties_ptr != nullptr && + in_props.ext_sample_locations_properties_ptr != nullptr) + { + ext_sample_locations_properties_match = (*ext_sample_locations_properties_ptr == *in_props.ext_sample_locations_properties_ptr); + } + else + { + ext_sample_locations_properties_match = (ext_sample_locations_properties_ptr == nullptr && + in_props.ext_sample_locations_properties_ptr == nullptr); + } + + if (ext_sampler_filter_minmax_properties_ptr != nullptr && + in_props.ext_sampler_filter_minmax_properties_ptr != nullptr) + { + ext_sampler_filter_minmax_properties_match = (*ext_sampler_filter_minmax_properties_ptr == *in_props.ext_sampler_filter_minmax_properties_ptr); + } + else + { + ext_sampler_filter_minmax_properties_match = (ext_sampler_filter_minmax_properties_ptr == nullptr && + in_props.ext_sampler_filter_minmax_properties_ptr == nullptr); + } + + if (ext_vertex_attribute_divisor_properties_ptr != nullptr && + in_props.ext_vertex_attribute_divisor_properties_ptr != nullptr) + { + ext_vertex_attribute_divisor_properties_match = (*ext_vertex_attribute_divisor_properties_ptr == *in_props.ext_vertex_attribute_divisor_properties_ptr); + } + else + { + ext_vertex_attribute_divisor_properties_match = (ext_vertex_attribute_divisor_properties_ptr == nullptr && + in_props.ext_vertex_attribute_divisor_properties_ptr == nullptr); + } + + if (khr_external_memory_capabilities_physical_device_id_properties_ptr != nullptr && + in_props.khr_external_memory_capabilities_physical_device_id_properties_ptr!= nullptr) + { + khr_external_memory_capabilities_properties_match = (*khr_external_memory_capabilities_physical_device_id_properties_ptr == *in_props.khr_external_memory_capabilities_physical_device_id_properties_ptr); + } + else + { + khr_external_memory_capabilities_properties_match = (khr_external_memory_capabilities_physical_device_id_properties_ptr == nullptr && + in_props.khr_external_memory_capabilities_physical_device_id_properties_ptr == nullptr); + } + + if (khr_maintenance2_point_clipping_properties_ptr != nullptr && + in_props.khr_maintenance2_point_clipping_properties_ptr != nullptr) + { + khr_maintenance2_properties_match = (*khr_maintenance2_point_clipping_properties_ptr == *in_props.khr_maintenance2_point_clipping_properties_ptr); + } + else + { + khr_maintenance2_properties_match = (khr_maintenance2_point_clipping_properties_ptr == nullptr && + in_props.khr_maintenance2_point_clipping_properties_ptr == nullptr); + } + if (khr_maintenance3_properties_ptr != nullptr && in_props.khr_maintenance3_properties_ptr != nullptr) { @@ -2620,13 +3013,32 @@ bool Anvil::PhysicalDeviceProperties::operator==(const PhysicalDeviceProperties& in_props.khr_maintenance3_properties_ptr == nullptr); } + if (khr_multiview_properties_ptr != nullptr && + in_props.khr_multiview_properties_ptr != nullptr) + { + khr_multiview_properties_match = (*khr_multiview_properties_ptr == *in_props.khr_multiview_properties_ptr); + } + else + { + khr_multiview_properties_match = (khr_multiview_properties_ptr == nullptr && + in_props.khr_multiview_properties_ptr == nullptr); + } + return amd_shader_core_properties_match && core_vk1_0_features_match && ext_descriptor_indexing_properties_match && - khr_maintenance3_properties_match; + ext_external_memory_host_properties_match && + ext_sample_locations_properties_match && + ext_sampler_filter_minmax_properties_match && + ext_vertex_attribute_divisor_properties_match && + khr_external_memory_capabilities_properties_match && + khr_maintenance2_properties_match && + khr_maintenance3_properties_match && + khr_multiview_properties_match; } Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_buffers, + Anvil::CommandBufferBase* in_opt_single_cmd_buffer_ptr, Anvil::CommandBufferBase* const* in_opt_cmd_buffer_ptrs_ptr, uint32_t in_n_semaphores_to_signal, Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, @@ -2661,48 +3073,17 @@ Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_buff dst_stage_wait_masks.at(n_wait_mask) = in_opt_dst_stage_masks_to_wait_on_ptrs[n_wait_mask].get_vk(); } - anvil_assert((in_n_command_buffers == 0) || - (in_n_command_buffers != 0 && in_opt_cmd_buffer_ptrs_ptr != nullptr) ); - - anvil_assert((in_n_semaphores_to_signal == 0) || - (in_n_semaphores_to_signal != 0 && in_opt_semaphore_to_signal_ptrs_ptr != nullptr) ); - - anvil_assert((in_n_semaphores_to_wait_on == 0) || - (in_n_semaphores_to_wait_on != 0 && in_opt_semaphore_to_wait_on_ptrs_ptr != nullptr && in_opt_dst_stage_masks_to_wait_on_ptrs != nullptr) ); -} + if (in_opt_single_cmd_buffer_ptr) + { + anvil_assert(in_n_command_buffers == 1); -Anvil::SubmitInfo::SubmitInfo(Anvil::CommandBufferBase* in_cmd_buffer_ptr, - uint32_t in_n_semaphores_to_signal, - Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, - uint32_t in_n_semaphores_to_wait_on, - Anvil::Semaphore* const* in_opt_semaphore_to_wait_on_ptrs_ptr, - const Anvil::PipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, - bool in_should_block, - Anvil::Fence* in_opt_fence_ptr) - :command_buffers_mgpu_ptr (nullptr), - command_buffers_sgpu_ptr (nullptr), -#if defined(_WIN32) - d3d12_fence_signal_semaphore_values_ptr(nullptr), - d3d12_fence_wait_semaphore_values_ptr (nullptr), -#endif - dst_stage_wait_masks (in_n_semaphores_to_wait_on), - fence_ptr (in_opt_fence_ptr), - n_command_buffers ((in_cmd_buffer_ptr != nullptr) ? 1 : 0), - n_signal_semaphores (in_n_semaphores_to_signal), - n_wait_semaphores (in_n_semaphores_to_wait_on), - signal_semaphores_mgpu_ptr (nullptr), - signal_semaphores_sgpu_ptr (in_opt_semaphore_to_signal_ptrs_ptr), - should_block (in_should_block), - timeout (UINT64_MAX), - type (SubmissionType::SGPU), - wait_semaphores_mgpu_ptr (nullptr), - wait_semaphores_sgpu_ptr (in_opt_semaphore_to_wait_on_ptrs_ptr) -{ - for (uint32_t n_wait_mask = 0; - n_wait_mask < in_n_semaphores_to_wait_on; - ++n_wait_mask) + helper_cmd_buffer_raw_ptr = in_opt_single_cmd_buffer_ptr; + command_buffers_sgpu_ptr = &helper_cmd_buffer_raw_ptr; + } + else { - dst_stage_wait_masks.at(n_wait_mask) = in_opt_dst_stage_masks_to_wait_on_ptrs[n_wait_mask].get_vk(); + anvil_assert((in_n_command_buffers == 0) || + (in_n_command_buffers != 0 && in_opt_cmd_buffer_ptrs_ptr != nullptr) ); } anvil_assert((in_n_semaphores_to_signal == 0) || @@ -2710,9 +3091,6 @@ Anvil::SubmitInfo::SubmitInfo(Anvil::CommandBufferBase* in_cmd_buffer_ptr anvil_assert((in_n_semaphores_to_wait_on == 0) || (in_n_semaphores_to_wait_on != 0 && in_opt_semaphore_to_wait_on_ptrs_ptr != nullptr && in_opt_dst_stage_masks_to_wait_on_ptrs != nullptr) ); - - helper_cmd_buffer_raw_ptr = in_cmd_buffer_ptr; - command_buffers_sgpu_ptr = &helper_cmd_buffer_raw_ptr; } Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_buffer_submissions, @@ -2769,7 +3147,9 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create(Anvil::CommandBufferBase* in_ bool in_should_block, Anvil::Fence* in_opt_fence_ptr) { - return Anvil::SubmitInfo(in_opt_cmd_buffer_ptr, + return Anvil::SubmitInfo((in_opt_cmd_buffer_ptr != nullptr ? 1 : 0), + in_opt_cmd_buffer_ptr, + nullptr, /* in_opt_command_buffer_submissions_ptr */ in_n_semaphores_to_signal, in_opt_semaphore_to_signal_ptrs_ptr, in_n_semaphores_to_wait_on, @@ -2790,6 +3170,7 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create(uint32_t in_ Anvil::Fence* in_opt_fence_ptr) { return Anvil::SubmitInfo(in_n_cmd_buffers, + nullptr, /* in_opt_command_buffer_single_submission_ptr */ in_opt_cmd_buffer_ptrs_ptr, in_n_semaphores_to_signal, in_opt_semaphore_to_signal_ptrs_ptr, @@ -2806,7 +3187,9 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_execute(Anvil::CommandBufferBase* in { anvil_assert(in_cmd_buffer_ptr != nullptr); - return Anvil::SubmitInfo(in_cmd_buffer_ptr, + return Anvil::SubmitInfo(1, /* in_n_cmd_buffers */ + in_cmd_buffer_ptr, + nullptr, /* in_opt_command_buffer_submissions_ptr */ 0, /* in_n_semaphores_to_signal */ nullptr, /* in_opt_semaphore_to_signal_ptrs_ptr */ 0, /* in_n_semaphores_to_wait_on */ @@ -2825,6 +3208,7 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_execute(Anvil::CommandBufferBase* co anvil_assert(in_n_cmd_buffers > 0); return Anvil::SubmitInfo(in_n_cmd_buffers, + nullptr, /* in_opt_command_buffer_single_submission_ptr */ in_cmd_buffer_ptrs_ptr, 0, /* in_n_semaphores_to_signal */ nullptr, /* in_opt_semaphore_to_signal_ptrs_ptr */ @@ -2835,17 +3219,21 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_execute(Anvil::CommandBufferBase* co in_opt_fence_ptr); } -Anvil::SubmitInfo Anvil::SubmitInfo::create_execute(const CommandBufferMGPUSubmission* in_cmd_buffer_submission_ptr, +Anvil::SubmitInfo Anvil::SubmitInfo::create_execute(const CommandBufferMGPUSubmission* in_cmd_buffer_submissions_ptr, + uint32_t in_n_command_buffer_submissions, bool in_should_block, Anvil::Fence* in_opt_fence_ptr) { - return Anvil::SubmitInfo(1, /* in_n_command_buffers */ - in_cmd_buffer_submission_ptr, - 0, /* in_n_semaphores_to_signal */ - nullptr, /* in_opt_semaphore_to_signal_ptrs_ptr */ - 0, /* in_n_semaphores_to_wait_on */ - nullptr, /* in_opt_semaphore_to_wait_on_ptrs_ptr */ - nullptr, /* in_opt_dst_stage_masks_to_wait_on_ptrs */ + anvil_assert(in_cmd_buffer_submissions_ptr != nullptr); + anvil_assert(in_n_command_buffer_submissions > 0); + + return Anvil::SubmitInfo(in_n_command_buffer_submissions, + in_cmd_buffer_submissions_ptr, + 0, /* in_n_semaphores_to_signal */ + nullptr, /* in_opt_semaphore_to_signal_ptrs_ptr */ + 0, /* in_n_semaphores_to_wait_on */ + nullptr, /* in_opt_semaphore_to_wait_on_ptrs_ptr */ + nullptr, /* in_opt_dst_stage_masks_to_wait_on_ptrs */ in_should_block, in_opt_fence_ptr); } @@ -2859,7 +3247,9 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_execute_signal(Anvil::CommandBufferB anvil_assert(in_cmd_buffer_ptr != nullptr); anvil_assert(in_semaphore_to_signal_ptrs_ptr != nullptr); - return Anvil::SubmitInfo(in_cmd_buffer_ptr, + return Anvil::SubmitInfo(1, /* in_n_cmd_buffers */ + in_cmd_buffer_ptr, + nullptr, /* in_opt_command_buffer_submissions_ptr */ in_n_semaphores_to_signal, in_semaphore_to_signal_ptrs_ptr, 0, /* in_n_semaphores_to_wait_on */ @@ -2881,6 +3271,7 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_execute_signal(Anvil::CommandBufferB anvil_assert(in_semaphore_to_signal_ptrs_ptr != nullptr); return Anvil::SubmitInfo(in_n_cmd_buffers, + nullptr, /* in_opt_command_buffer_single_submission_ptr */ in_cmd_buffer_ptrs_ptr, in_n_semaphores_to_signal, in_semaphore_to_signal_ptrs_ptr, @@ -2891,17 +3282,19 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_execute_signal(Anvil::CommandBufferB in_opt_fence_ptr); } -Anvil::SubmitInfo Anvil::SubmitInfo::create_execute_signal(const Anvil::CommandBufferMGPUSubmission* in_cmd_buffer_submission_ptr, +Anvil::SubmitInfo Anvil::SubmitInfo::create_execute_signal(const Anvil::CommandBufferMGPUSubmission* in_cmd_buffer_submissions_ptr, + uint32_t in_n_command_buffer_submissions, uint32_t in_n_signal_semaphore_submissions, const Anvil::SemaphoreMGPUSubmission* in_signal_semaphore_submissions_ptr, bool in_should_block, Anvil::Fence* in_opt_fence_ptr) { - anvil_assert(in_cmd_buffer_submission_ptr != nullptr); + anvil_assert(in_cmd_buffer_submissions_ptr != nullptr); + anvil_assert(in_n_command_buffer_submissions > 0); anvil_assert(in_signal_semaphore_submissions_ptr != nullptr); - return Anvil::SubmitInfo(1, /* in_n_command_buffers */ - in_cmd_buffer_submission_ptr, + return Anvil::SubmitInfo(in_n_command_buffer_submissions, + in_cmd_buffer_submissions_ptr, in_n_signal_semaphore_submissions, in_signal_semaphore_submissions_ptr, 0, /* in_n_semaphores_to_wait_on */ @@ -2919,7 +3312,8 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_signal(uint32_t in_n anvil_assert(in_semaphore_to_signal_ptrs_ptr != nullptr); return Anvil::SubmitInfo(0, /* in_n_command_buffers */ - nullptr, /* in_cmd_buffer_ptr */ + nullptr, /* in_opt_command_buffer_single_submission_ptr */ + nullptr, /* in_opt_command_buffer_submissions_ptr */ in_n_semaphores_to_signal, in_semaphore_to_signal_ptrs_ptr, 0, /* in_n_semaphores_to_wait_on */ @@ -2942,8 +3336,9 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_signal_wait(uint32_t anvil_assert(in_n_semaphores_to_wait_on > 0); anvil_assert(in_semaphore_to_wait_on_ptrs_ptr != nullptr); - return Anvil::SubmitInfo(0, /* in_n_command_buffers */ - nullptr, /* in_cmd_buffer_ptr */ + return Anvil::SubmitInfo(0, /* in_n_command_buffers */ + nullptr, /* in_opt_command_buffer_single_submission_ptr */ + nullptr, /* in_opt_command_buffer_submissions_ptr */ in_n_semaphores_to_signal, in_semaphore_to_signal_ptrs_ptr, in_n_semaphores_to_wait_on, @@ -2962,10 +3357,11 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_wait(uint32_t anvil_assert(in_n_semaphores_to_wait_on > 0); anvil_assert(in_semaphore_to_wait_on_ptrs_ptr != nullptr); - return Anvil::SubmitInfo(0, /* in_n_command_buffers */ - nullptr, /* in_cmd_buffer_ptr */ - 0, /* in_n_semaphores_to_signal */ - nullptr, /* in_semaphore_to_signal_ptrs_ptr */ + return Anvil::SubmitInfo(0, /* in_n_command_buffers */ + nullptr, /* in_opt_command_buffer_single_submission_ptr */ + nullptr, /* in_opt_command_buffer_submissions_ptr */ + 0, /* in_n_semaphores_to_signal */ + nullptr, /* in_semaphore_to_signal_ptrs_ptr */ in_n_semaphores_to_wait_on, in_semaphore_to_wait_on_ptrs_ptr, in_dst_stage_masks_to_wait_on_ptrs, @@ -2984,9 +3380,11 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute(Anvil::CommandBufferBas anvil_assert(in_dst_stage_masks_to_wait_on_ptrs != nullptr); anvil_assert(in_semaphore_to_wait_on_ptrs_ptr != nullptr); - return Anvil::SubmitInfo(in_cmd_buffer_ptr, - 0, /* in_n_semaphores_to_signal */ - nullptr, /* in_opt_semaphore_to_signal_ptrs_ptr */ + return Anvil::SubmitInfo(1, /* in_n_command_buffers */ + in_cmd_buffer_ptr, + nullptr, /* in_opt_command_buffer_submissions_ptr */ + 0, /* in_n_semaphores_to_signal */ + nullptr, /* in_opt_semaphore_to_signal_ptrs_ptr */ in_n_semaphores_to_wait_on, in_semaphore_to_wait_on_ptrs_ptr, in_dst_stage_masks_to_wait_on_ptrs, @@ -3008,9 +3406,10 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute(Anvil::CommandBufferBas anvil_assert(in_semaphore_to_wait_on_ptrs_ptr != nullptr); return Anvil::SubmitInfo(in_n_cmd_buffers, + nullptr, /* in_opt_command_buffer_single_submission_ptr */ in_cmd_buffer_ptrs_ptr, - 0, /* in_n_semaphores_to_signal */ - nullptr, /* in_opt_semaphore_to_signal_ptrs_ptr */ + 0, /* in_n_semaphores_to_signal */ + nullptr, /* in_opt_semaphore_to_signal_ptrs_ptr */ in_n_semaphores_to_wait_on, in_semaphore_to_wait_on_ptrs_ptr, in_dst_stage_masks_to_wait_on_ptrs, @@ -3018,18 +3417,20 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute(Anvil::CommandBufferBas in_opt_fence_ptr); } -Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute(const Anvil::CommandBufferMGPUSubmission* in_cmd_buffer_submission_ptr, +Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute(const Anvil::CommandBufferMGPUSubmission* in_cmd_buffer_submissions_ptr, + uint32_t in_n_command_buffer_submissions, uint32_t in_n_wait_semaphore_submissions, const Anvil::SemaphoreMGPUSubmission* in_wait_semaphore_submissions_ptr, const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, bool in_should_block, Anvil::Fence* in_opt_fence_ptr) { - anvil_assert(in_cmd_buffer_submission_ptr != nullptr); + anvil_assert(in_cmd_buffer_submissions_ptr != nullptr); + anvil_assert(in_n_command_buffer_submissions > 0); anvil_assert(in_wait_semaphore_submissions_ptr != nullptr); - return Anvil::SubmitInfo(1, /* in_n_command_buffers */ - in_cmd_buffer_submission_ptr, + return Anvil::SubmitInfo(in_n_command_buffer_submissions, + in_cmd_buffer_submissions_ptr, 0, /* in_n_semaphores_to_signal */ nullptr, /* in_opt_semaphore_to_signal_ptrs_ptr */ in_n_wait_semaphore_submissions, @@ -3052,7 +3453,9 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute_signal(Anvil::CommandBu anvil_assert(in_semaphore_to_signal_ptrs_ptr != nullptr); anvil_assert(in_semaphore_to_wait_on_ptrs_ptr != nullptr); - return Anvil::SubmitInfo(in_cmd_buffer_ptr, + return Anvil::SubmitInfo(1, /* in_n_command_buffers */ + in_cmd_buffer_ptr, + nullptr, /* in_opt_command_buffer_submissions_ptr */ in_n_semaphores_to_signal, in_semaphore_to_signal_ptrs_ptr, in_n_semaphores_to_wait_on, @@ -3078,6 +3481,7 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute_signal(Anvil::CommandBu anvil_assert(in_semaphore_to_wait_on_ptrs_ptr != nullptr); return Anvil::SubmitInfo(in_n_cmd_buffers, + nullptr, /* in_opt_command_buffer_single_submission_ptr */ in_cmd_buffer_ptrs_ptr, in_n_semaphores_to_signal, in_semaphore_to_signal_ptrs_ptr, @@ -3088,7 +3492,8 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute_signal(Anvil::CommandBu in_opt_fence_ptr); } -Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute_signal(const Anvil::CommandBufferMGPUSubmission* in_cmd_buffer_submission_ptr, +Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute_signal(const Anvil::CommandBufferMGPUSubmission* in_cmd_buffer_submissions_ptr, + uint32_t in_n_command_buffer_submissions, uint32_t in_n_signal_semaphore_submissions, const Anvil::SemaphoreMGPUSubmission* in_signal_semaphore_submissions_ptr, uint32_t in_n_wait_semaphore_submissions, @@ -3097,13 +3502,14 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute_signal(const Anvil::Com bool in_should_block, Anvil::Fence* in_opt_fence_ptr) { - anvil_assert(in_cmd_buffer_submission_ptr != nullptr); + anvil_assert(in_cmd_buffer_submissions_ptr != nullptr); + anvil_assert(in_n_command_buffer_submissions > 0); anvil_assert(in_dst_stage_masks_to_wait_on_ptrs != nullptr); anvil_assert(in_signal_semaphore_submissions_ptr != nullptr); anvil_assert(in_wait_semaphore_submissions_ptr != nullptr); - return Anvil::SubmitInfo(1, /* in_n_command_buffers */ - in_cmd_buffer_submission_ptr, + return Anvil::SubmitInfo(in_n_command_buffer_submissions, + in_cmd_buffer_submissions_ptr, in_n_signal_semaphore_submissions, in_signal_semaphore_submissions_ptr, in_n_wait_semaphore_submissions, diff --git a/src/misc/vulkan.cpp b/src/misc/vulkan.cpp new file mode 100644 index 00000000..213e3c15 --- /dev/null +++ b/src/misc/vulkan.cpp @@ -0,0 +1,307 @@ +// +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#define ANVIL_VULKAN_CPP + +#include "misc/vulkan.h" +#include + +/* For Anvil builds which statically link with Vulkan DLL, the pointers are set to the system-provided func ptrs. + * For Anvil builds which link dynamically with Vulkan DLL, the pointers are initialized at Anvil::Instance creation time. + */ + +#if !defined(ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB) + PFN_vkCreateInstance Anvil::Vulkan::vkCreateInstance = nullptr; + PFN_vkDestroyInstance Anvil::Vulkan::vkDestroyInstance = nullptr; + PFN_vkEnumeratePhysicalDevices Anvil::Vulkan::vkEnumeratePhysicalDevices = nullptr; + PFN_vkGetPhysicalDeviceFeatures Anvil::Vulkan::vkGetPhysicalDeviceFeatures = nullptr; + PFN_vkGetPhysicalDeviceFormatProperties Anvil::Vulkan::vkGetPhysicalDeviceFormatProperties = nullptr; + PFN_vkGetPhysicalDeviceImageFormatProperties Anvil::Vulkan::vkGetPhysicalDeviceImageFormatProperties = nullptr; + PFN_vkGetPhysicalDeviceProperties Anvil::Vulkan::vkGetPhysicalDeviceProperties = nullptr; + PFN_vkGetPhysicalDeviceQueueFamilyProperties Anvil::Vulkan::vkGetPhysicalDeviceQueueFamilyProperties = nullptr; + PFN_vkGetPhysicalDeviceMemoryProperties Anvil::Vulkan::vkGetPhysicalDeviceMemoryProperties = nullptr; + PFN_vkGetInstanceProcAddr Anvil::Vulkan::vkGetInstanceProcAddr = nullptr; + PFN_vkGetDeviceProcAddr Anvil::Vulkan::vkGetDeviceProcAddr = nullptr; + PFN_vkCreateDevice Anvil::Vulkan::vkCreateDevice = nullptr; + PFN_vkDestroyDevice Anvil::Vulkan::vkDestroyDevice = nullptr; + PFN_vkEnumerateInstanceExtensionProperties Anvil::Vulkan::vkEnumerateInstanceExtensionProperties = nullptr; + PFN_vkEnumerateDeviceExtensionProperties Anvil::Vulkan::vkEnumerateDeviceExtensionProperties = nullptr; + PFN_vkEnumerateInstanceLayerProperties Anvil::Vulkan::vkEnumerateInstanceLayerProperties = nullptr; + PFN_vkEnumerateDeviceLayerProperties Anvil::Vulkan::vkEnumerateDeviceLayerProperties = nullptr; + PFN_vkGetDeviceQueue Anvil::Vulkan::vkGetDeviceQueue = nullptr; + PFN_vkQueueSubmit Anvil::Vulkan::vkQueueSubmit = nullptr; + PFN_vkQueueWaitIdle Anvil::Vulkan::vkQueueWaitIdle = nullptr; + PFN_vkDeviceWaitIdle Anvil::Vulkan::vkDeviceWaitIdle = nullptr; + PFN_vkAllocateMemory Anvil::Vulkan::vkAllocateMemory = nullptr; + PFN_vkFreeMemory Anvil::Vulkan::vkFreeMemory = nullptr; + PFN_vkMapMemory Anvil::Vulkan::vkMapMemory = nullptr; + PFN_vkUnmapMemory Anvil::Vulkan::vkUnmapMemory = nullptr; + PFN_vkFlushMappedMemoryRanges Anvil::Vulkan::vkFlushMappedMemoryRanges = nullptr; + PFN_vkInvalidateMappedMemoryRanges Anvil::Vulkan::vkInvalidateMappedMemoryRanges = nullptr; + PFN_vkGetDeviceMemoryCommitment Anvil::Vulkan::vkGetDeviceMemoryCommitment = nullptr; + PFN_vkBindBufferMemory Anvil::Vulkan::vkBindBufferMemory = nullptr; + PFN_vkBindImageMemory Anvil::Vulkan::vkBindImageMemory = nullptr; + PFN_vkGetBufferMemoryRequirements Anvil::Vulkan::vkGetBufferMemoryRequirements = nullptr; + PFN_vkGetImageMemoryRequirements Anvil::Vulkan::vkGetImageMemoryRequirements = nullptr; + PFN_vkGetImageSparseMemoryRequirements Anvil::Vulkan::vkGetImageSparseMemoryRequirements = nullptr; + PFN_vkGetPhysicalDeviceSparseImageFormatProperties Anvil::Vulkan::vkGetPhysicalDeviceSparseImageFormatProperties = nullptr; + PFN_vkQueueBindSparse Anvil::Vulkan::vkQueueBindSparse = nullptr; + PFN_vkCreateFence Anvil::Vulkan::vkCreateFence = nullptr; + PFN_vkDestroyFence Anvil::Vulkan::vkDestroyFence = nullptr; + PFN_vkResetFences Anvil::Vulkan::vkResetFences = nullptr; + PFN_vkGetFenceStatus Anvil::Vulkan::vkGetFenceStatus = nullptr; + PFN_vkWaitForFences Anvil::Vulkan::vkWaitForFences = nullptr; + PFN_vkCreateSemaphore Anvil::Vulkan::vkCreateSemaphore = nullptr; + PFN_vkDestroySemaphore Anvil::Vulkan::vkDestroySemaphore = nullptr; + PFN_vkCreateEvent Anvil::Vulkan::vkCreateEvent = nullptr; + PFN_vkDestroyEvent Anvil::Vulkan::vkDestroyEvent = nullptr; + PFN_vkGetEventStatus Anvil::Vulkan::vkGetEventStatus = nullptr; + PFN_vkSetEvent Anvil::Vulkan::vkSetEvent = nullptr; + PFN_vkResetEvent Anvil::Vulkan::vkResetEvent = nullptr; + PFN_vkCreateQueryPool Anvil::Vulkan::vkCreateQueryPool = nullptr; + PFN_vkDestroyQueryPool Anvil::Vulkan::vkDestroyQueryPool = nullptr; + PFN_vkGetQueryPoolResults Anvil::Vulkan::vkGetQueryPoolResults = nullptr; + PFN_vkCreateBuffer Anvil::Vulkan::vkCreateBuffer = nullptr; + PFN_vkDestroyBuffer Anvil::Vulkan::vkDestroyBuffer = nullptr; + PFN_vkCreateBufferView Anvil::Vulkan::vkCreateBufferView = nullptr; + PFN_vkDestroyBufferView Anvil::Vulkan::vkDestroyBufferView = nullptr; + PFN_vkCreateImage Anvil::Vulkan::vkCreateImage = nullptr; + PFN_vkDestroyImage Anvil::Vulkan::vkDestroyImage = nullptr; + PFN_vkGetImageSubresourceLayout Anvil::Vulkan::vkGetImageSubresourceLayout = nullptr; + PFN_vkCreateImageView Anvil::Vulkan::vkCreateImageView = nullptr; + PFN_vkDestroyImageView Anvil::Vulkan::vkDestroyImageView = nullptr; + PFN_vkCreateShaderModule Anvil::Vulkan::vkCreateShaderModule = nullptr; + PFN_vkDestroyShaderModule Anvil::Vulkan::vkDestroyShaderModule = nullptr; + PFN_vkCreatePipelineCache Anvil::Vulkan::vkCreatePipelineCache = nullptr; + PFN_vkDestroyPipelineCache Anvil::Vulkan::vkDestroyPipelineCache = nullptr; + PFN_vkGetPipelineCacheData Anvil::Vulkan::vkGetPipelineCacheData = nullptr; + PFN_vkMergePipelineCaches Anvil::Vulkan::vkMergePipelineCaches = nullptr; + PFN_vkCreateGraphicsPipelines Anvil::Vulkan::vkCreateGraphicsPipelines = nullptr; + PFN_vkCreateComputePipelines Anvil::Vulkan::vkCreateComputePipelines = nullptr; + PFN_vkDestroyPipeline Anvil::Vulkan::vkDestroyPipeline = nullptr; + PFN_vkCreatePipelineLayout Anvil::Vulkan::vkCreatePipelineLayout = nullptr; + PFN_vkDestroyPipelineLayout Anvil::Vulkan::vkDestroyPipelineLayout = nullptr; + PFN_vkCreateSampler Anvil::Vulkan::vkCreateSampler = nullptr; + PFN_vkDestroySampler Anvil::Vulkan::vkDestroySampler = nullptr; + PFN_vkCreateDescriptorSetLayout Anvil::Vulkan::vkCreateDescriptorSetLayout = nullptr; + PFN_vkDestroyDescriptorSetLayout Anvil::Vulkan::vkDestroyDescriptorSetLayout = nullptr; + PFN_vkCreateDescriptorPool Anvil::Vulkan::vkCreateDescriptorPool = nullptr; + PFN_vkDestroyDescriptorPool Anvil::Vulkan::vkDestroyDescriptorPool = nullptr; + PFN_vkResetDescriptorPool Anvil::Vulkan::vkResetDescriptorPool = nullptr; + PFN_vkAllocateDescriptorSets Anvil::Vulkan::vkAllocateDescriptorSets = nullptr; + PFN_vkFreeDescriptorSets Anvil::Vulkan::vkFreeDescriptorSets = nullptr; + PFN_vkUpdateDescriptorSets Anvil::Vulkan::vkUpdateDescriptorSets = nullptr; + PFN_vkCreateFramebuffer Anvil::Vulkan::vkCreateFramebuffer = nullptr; + PFN_vkDestroyFramebuffer Anvil::Vulkan::vkDestroyFramebuffer = nullptr; + PFN_vkCreateRenderPass Anvil::Vulkan::vkCreateRenderPass = nullptr; + PFN_vkDestroyRenderPass Anvil::Vulkan::vkDestroyRenderPass = nullptr; + PFN_vkGetRenderAreaGranularity Anvil::Vulkan::vkGetRenderAreaGranularity = nullptr; + PFN_vkCreateCommandPool Anvil::Vulkan::vkCreateCommandPool = nullptr; + PFN_vkDestroyCommandPool Anvil::Vulkan::vkDestroyCommandPool = nullptr; + PFN_vkResetCommandPool Anvil::Vulkan::vkResetCommandPool = nullptr; + PFN_vkAllocateCommandBuffers Anvil::Vulkan::vkAllocateCommandBuffers = nullptr; + PFN_vkFreeCommandBuffers Anvil::Vulkan::vkFreeCommandBuffers = nullptr; + PFN_vkBeginCommandBuffer Anvil::Vulkan::vkBeginCommandBuffer = nullptr; + PFN_vkEndCommandBuffer Anvil::Vulkan::vkEndCommandBuffer = nullptr; + PFN_vkResetCommandBuffer Anvil::Vulkan::vkResetCommandBuffer = nullptr; + PFN_vkCmdBindPipeline Anvil::Vulkan::vkCmdBindPipeline = nullptr; + PFN_vkCmdSetViewport Anvil::Vulkan::vkCmdSetViewport = nullptr; + PFN_vkCmdSetScissor Anvil::Vulkan::vkCmdSetScissor = nullptr; + PFN_vkCmdSetLineWidth Anvil::Vulkan::vkCmdSetLineWidth = nullptr; + PFN_vkCmdSetDepthBias Anvil::Vulkan::vkCmdSetDepthBias = nullptr; + PFN_vkCmdSetBlendConstants Anvil::Vulkan::vkCmdSetBlendConstants = nullptr; + PFN_vkCmdSetDepthBounds Anvil::Vulkan::vkCmdSetDepthBounds = nullptr; + PFN_vkCmdSetStencilCompareMask Anvil::Vulkan::vkCmdSetStencilCompareMask = nullptr; + PFN_vkCmdSetStencilWriteMask Anvil::Vulkan::vkCmdSetStencilWriteMask = nullptr; + PFN_vkCmdSetStencilReference Anvil::Vulkan::vkCmdSetStencilReference = nullptr; + PFN_vkCmdBindDescriptorSets Anvil::Vulkan::vkCmdBindDescriptorSets = nullptr; + PFN_vkCmdBindIndexBuffer Anvil::Vulkan::vkCmdBindIndexBuffer = nullptr; + PFN_vkCmdBindVertexBuffers Anvil::Vulkan::vkCmdBindVertexBuffers = nullptr; + PFN_vkCmdDraw Anvil::Vulkan::vkCmdDraw = nullptr; + PFN_vkCmdDrawIndexed Anvil::Vulkan::vkCmdDrawIndexed = nullptr; + PFN_vkCmdDrawIndirect Anvil::Vulkan::vkCmdDrawIndirect = nullptr; + PFN_vkCmdDrawIndexedIndirect Anvil::Vulkan::vkCmdDrawIndexedIndirect = nullptr; + PFN_vkCmdDispatch Anvil::Vulkan::vkCmdDispatch = nullptr; + PFN_vkCmdDispatchIndirect Anvil::Vulkan::vkCmdDispatchIndirect = nullptr; + PFN_vkCmdCopyBuffer Anvil::Vulkan::vkCmdCopyBuffer = nullptr; + PFN_vkCmdCopyImage Anvil::Vulkan::vkCmdCopyImage = nullptr; + PFN_vkCmdBlitImage Anvil::Vulkan::vkCmdBlitImage = nullptr; + PFN_vkCmdCopyBufferToImage Anvil::Vulkan::vkCmdCopyBufferToImage = nullptr; + PFN_vkCmdCopyImageToBuffer Anvil::Vulkan::vkCmdCopyImageToBuffer = nullptr; + PFN_vkCmdUpdateBuffer Anvil::Vulkan::vkCmdUpdateBuffer = nullptr; + PFN_vkCmdFillBuffer Anvil::Vulkan::vkCmdFillBuffer = nullptr; + PFN_vkCmdClearColorImage Anvil::Vulkan::vkCmdClearColorImage = nullptr; + PFN_vkCmdClearDepthStencilImage Anvil::Vulkan::vkCmdClearDepthStencilImage = nullptr; + PFN_vkCmdClearAttachments Anvil::Vulkan::vkCmdClearAttachments = nullptr; + PFN_vkCmdResolveImage Anvil::Vulkan::vkCmdResolveImage = nullptr; + PFN_vkCmdSetEvent Anvil::Vulkan::vkCmdSetEvent = nullptr; + PFN_vkCmdResetEvent Anvil::Vulkan::vkCmdResetEvent = nullptr; + PFN_vkCmdWaitEvents Anvil::Vulkan::vkCmdWaitEvents = nullptr; + PFN_vkCmdPipelineBarrier Anvil::Vulkan::vkCmdPipelineBarrier = nullptr; + PFN_vkCmdBeginQuery Anvil::Vulkan::vkCmdBeginQuery = nullptr; + PFN_vkCmdEndQuery Anvil::Vulkan::vkCmdEndQuery = nullptr; + PFN_vkCmdResetQueryPool Anvil::Vulkan::vkCmdResetQueryPool = nullptr; + PFN_vkCmdWriteTimestamp Anvil::Vulkan::vkCmdWriteTimestamp = nullptr; + PFN_vkCmdCopyQueryPoolResults Anvil::Vulkan::vkCmdCopyQueryPoolResults = nullptr; + PFN_vkCmdPushConstants Anvil::Vulkan::vkCmdPushConstants = nullptr; + PFN_vkCmdBeginRenderPass Anvil::Vulkan::vkCmdBeginRenderPass = nullptr; + PFN_vkCmdNextSubpass Anvil::Vulkan::vkCmdNextSubpass = nullptr; + PFN_vkCmdEndRenderPass Anvil::Vulkan::vkCmdEndRenderPass = nullptr; + PFN_vkCmdExecuteCommands Anvil::Vulkan::vkCmdExecuteCommands = nullptr; +#else + PFN_vkCreateInstance Anvil::Vulkan::vkCreateInstance = ::vkCreateInstance; + PFN_vkDestroyInstance Anvil::Vulkan::vkDestroyInstance = ::vkDestroyInstance; + PFN_vkEnumeratePhysicalDevices Anvil::Vulkan::vkEnumeratePhysicalDevices = ::vkEnumeratePhysicalDevices; + PFN_vkGetPhysicalDeviceFeatures Anvil::Vulkan::vkGetPhysicalDeviceFeatures = ::vkGetPhysicalDeviceFeatures; + PFN_vkGetPhysicalDeviceFormatProperties Anvil::Vulkan::vkGetPhysicalDeviceFormatProperties = ::vkGetPhysicalDeviceFormatProperties; + PFN_vkGetPhysicalDeviceImageFormatProperties Anvil::Vulkan::vkGetPhysicalDeviceImageFormatProperties = ::vkGetPhysicalDeviceImageFormatProperties; + PFN_vkGetPhysicalDeviceProperties Anvil::Vulkan::vkGetPhysicalDeviceProperties = ::vkGetPhysicalDeviceProperties; + PFN_vkGetPhysicalDeviceQueueFamilyProperties Anvil::Vulkan::vkGetPhysicalDeviceQueueFamilyProperties = ::vkGetPhysicalDeviceQueueFamilyProperties; + PFN_vkGetPhysicalDeviceMemoryProperties Anvil::Vulkan::vkGetPhysicalDeviceMemoryProperties = ::vkGetPhysicalDeviceMemoryProperties; + PFN_vkGetInstanceProcAddr Anvil::Vulkan::vkGetInstanceProcAddr = ::vkGetInstanceProcAddr; + PFN_vkGetDeviceProcAddr Anvil::Vulkan::vkGetDeviceProcAddr = ::vkGetDeviceProcAddr; + PFN_vkCreateDevice Anvil::Vulkan::vkCreateDevice = ::vkCreateDevice; + PFN_vkDestroyDevice Anvil::Vulkan::vkDestroyDevice = ::vkDestroyDevice; + PFN_vkEnumerateInstanceExtensionProperties Anvil::Vulkan::vkEnumerateInstanceExtensionProperties = ::vkEnumerateInstanceExtensionProperties; + PFN_vkEnumerateDeviceExtensionProperties Anvil::Vulkan::vkEnumerateDeviceExtensionProperties = ::vkEnumerateDeviceExtensionProperties; + PFN_vkEnumerateInstanceLayerProperties Anvil::Vulkan::vkEnumerateInstanceLayerProperties = ::vkEnumerateInstanceLayerProperties; + PFN_vkEnumerateDeviceLayerProperties Anvil::Vulkan::vkEnumerateDeviceLayerProperties = ::vkEnumerateDeviceLayerProperties; + PFN_vkGetDeviceQueue Anvil::Vulkan::vkGetDeviceQueue = ::vkGetDeviceQueue; + PFN_vkQueueSubmit Anvil::Vulkan::vkQueueSubmit = ::vkQueueSubmit; + PFN_vkQueueWaitIdle Anvil::Vulkan::vkQueueWaitIdle = ::vkQueueWaitIdle; + PFN_vkDeviceWaitIdle Anvil::Vulkan::vkDeviceWaitIdle = ::vkDeviceWaitIdle; + PFN_vkAllocateMemory Anvil::Vulkan::vkAllocateMemory = ::vkAllocateMemory; + PFN_vkFreeMemory Anvil::Vulkan::vkFreeMemory = ::vkFreeMemory; + PFN_vkMapMemory Anvil::Vulkan::vkMapMemory = ::vkMapMemory; + PFN_vkUnmapMemory Anvil::Vulkan::vkUnmapMemory = ::vkUnmapMemory; + PFN_vkFlushMappedMemoryRanges Anvil::Vulkan::vkFlushMappedMemoryRanges = ::vkFlushMappedMemoryRanges; + PFN_vkInvalidateMappedMemoryRanges Anvil::Vulkan::vkInvalidateMappedMemoryRanges = ::vkInvalidateMappedMemoryRanges; + PFN_vkGetDeviceMemoryCommitment Anvil::Vulkan::vkGetDeviceMemoryCommitment = ::vkGetDeviceMemoryCommitment; + PFN_vkBindBufferMemory Anvil::Vulkan::vkBindBufferMemory = ::vkBindBufferMemory; + PFN_vkBindImageMemory Anvil::Vulkan::vkBindImageMemory = ::vkBindImageMemory; + PFN_vkGetBufferMemoryRequirements Anvil::Vulkan::vkGetBufferMemoryRequirements = ::vkGetBufferMemoryRequirements; + PFN_vkGetImageMemoryRequirements Anvil::Vulkan::vkGetImageMemoryRequirements = ::vkGetImageMemoryRequirements; + PFN_vkGetImageSparseMemoryRequirements Anvil::Vulkan::vkGetImageSparseMemoryRequirements = ::vkGetImageSparseMemoryRequirements; + PFN_vkGetPhysicalDeviceSparseImageFormatProperties Anvil::Vulkan::vkGetPhysicalDeviceSparseImageFormatProperties = ::vkGetPhysicalDeviceSparseImageFormatProperties; + PFN_vkQueueBindSparse Anvil::Vulkan::vkQueueBindSparse = ::vkQueueBindSparse; + PFN_vkCreateFence Anvil::Vulkan::vkCreateFence = ::vkCreateFence; + PFN_vkDestroyFence Anvil::Vulkan::vkDestroyFence = ::vkDestroyFence; + PFN_vkResetFences Anvil::Vulkan::vkResetFences = ::vkResetFences; + PFN_vkGetFenceStatus Anvil::Vulkan::vkGetFenceStatus = ::vkGetFenceStatus; + PFN_vkWaitForFences Anvil::Vulkan::vkWaitForFences = ::vkWaitForFences; + PFN_vkCreateSemaphore Anvil::Vulkan::vkCreateSemaphore = ::vkCreateSemaphore; + PFN_vkDestroySemaphore Anvil::Vulkan::vkDestroySemaphore = ::vkDestroySemaphore; + PFN_vkCreateEvent Anvil::Vulkan::vkCreateEvent = ::vkCreateEvent; + PFN_vkDestroyEvent Anvil::Vulkan::vkDestroyEvent = ::vkDestroyEvent; + PFN_vkGetEventStatus Anvil::Vulkan::vkGetEventStatus = ::vkGetEventStatus; + PFN_vkSetEvent Anvil::Vulkan::vkSetEvent = ::vkSetEvent; + PFN_vkResetEvent Anvil::Vulkan::vkResetEvent = ::vkResetEvent; + PFN_vkCreateQueryPool Anvil::Vulkan::vkCreateQueryPool = ::vkCreateQueryPool; + PFN_vkDestroyQueryPool Anvil::Vulkan::vkDestroyQueryPool = ::vkDestroyQueryPool; + PFN_vkGetQueryPoolResults Anvil::Vulkan::vkGetQueryPoolResults = ::vkGetQueryPoolResults; + PFN_vkCreateBuffer Anvil::Vulkan::vkCreateBuffer = ::vkCreateBuffer; + PFN_vkDestroyBuffer Anvil::Vulkan::vkDestroyBuffer = ::vkDestroyBuffer; + PFN_vkCreateBufferView Anvil::Vulkan::vkCreateBufferView = ::vkCreateBufferView; + PFN_vkDestroyBufferView Anvil::Vulkan::vkDestroyBufferView = ::vkDestroyBufferView; + PFN_vkCreateImage Anvil::Vulkan::vkCreateImage = ::vkCreateImage; + PFN_vkDestroyImage Anvil::Vulkan::vkDestroyImage = ::vkDestroyImage; + PFN_vkGetImageSubresourceLayout Anvil::Vulkan::vkGetImageSubresourceLayout = ::vkGetImageSubresourceLayout; + PFN_vkCreateImageView Anvil::Vulkan::vkCreateImageView = ::vkCreateImageView; + PFN_vkDestroyImageView Anvil::Vulkan::vkDestroyImageView = ::vkDestroyImageView; + PFN_vkCreateShaderModule Anvil::Vulkan::vkCreateShaderModule = ::vkCreateShaderModule; + PFN_vkDestroyShaderModule Anvil::Vulkan::vkDestroyShaderModule = ::vkDestroyShaderModule; + PFN_vkCreatePipelineCache Anvil::Vulkan::vkCreatePipelineCache = ::vkCreatePipelineCache; + PFN_vkDestroyPipelineCache Anvil::Vulkan::vkDestroyPipelineCache = ::vkDestroyPipelineCache; + PFN_vkGetPipelineCacheData Anvil::Vulkan::vkGetPipelineCacheData = ::vkGetPipelineCacheData; + PFN_vkMergePipelineCaches Anvil::Vulkan::vkMergePipelineCaches = ::vkMergePipelineCaches; + PFN_vkCreateGraphicsPipelines Anvil::Vulkan::vkCreateGraphicsPipelines = ::vkCreateGraphicsPipelines; + PFN_vkCreateComputePipelines Anvil::Vulkan::vkCreateComputePipelines = ::vkCreateComputePipelines; + PFN_vkDestroyPipeline Anvil::Vulkan::vkDestroyPipeline = ::vkDestroyPipeline; + PFN_vkCreatePipelineLayout Anvil::Vulkan::vkCreatePipelineLayout = ::vkCreatePipelineLayout; + PFN_vkDestroyPipelineLayout Anvil::Vulkan::vkDestroyPipelineLayout = ::vkDestroyPipelineLayout; + PFN_vkCreateSampler Anvil::Vulkan::vkCreateSampler = ::vkCreateSampler; + PFN_vkDestroySampler Anvil::Vulkan::vkDestroySampler = ::vkDestroySampler; + PFN_vkCreateDescriptorSetLayout Anvil::Vulkan::vkCreateDescriptorSetLayout = ::vkCreateDescriptorSetLayout; + PFN_vkDestroyDescriptorSetLayout Anvil::Vulkan::vkDestroyDescriptorSetLayout = ::vkDestroyDescriptorSetLayout; + PFN_vkCreateDescriptorPool Anvil::Vulkan::vkCreateDescriptorPool = ::vkCreateDescriptorPool; + PFN_vkDestroyDescriptorPool Anvil::Vulkan::vkDestroyDescriptorPool = ::vkDestroyDescriptorPool; + PFN_vkResetDescriptorPool Anvil::Vulkan::vkResetDescriptorPool = ::vkResetDescriptorPool; + PFN_vkAllocateDescriptorSets Anvil::Vulkan::vkAllocateDescriptorSets = ::vkAllocateDescriptorSets; + PFN_vkFreeDescriptorSets Anvil::Vulkan::vkFreeDescriptorSets = ::vkFreeDescriptorSets; + PFN_vkUpdateDescriptorSets Anvil::Vulkan::vkUpdateDescriptorSets = ::vkUpdateDescriptorSets; + PFN_vkCreateFramebuffer Anvil::Vulkan::vkCreateFramebuffer = ::vkCreateFramebuffer; + PFN_vkDestroyFramebuffer Anvil::Vulkan::vkDestroyFramebuffer = ::vkDestroyFramebuffer; + PFN_vkCreateRenderPass Anvil::Vulkan::vkCreateRenderPass = ::vkCreateRenderPass; + PFN_vkDestroyRenderPass Anvil::Vulkan::vkDestroyRenderPass = ::vkDestroyRenderPass; + PFN_vkGetRenderAreaGranularity Anvil::Vulkan::vkGetRenderAreaGranularity = ::vkGetRenderAreaGranularity; + PFN_vkCreateCommandPool Anvil::Vulkan::vkCreateCommandPool = ::vkCreateCommandPool; + PFN_vkDestroyCommandPool Anvil::Vulkan::vkDestroyCommandPool = ::vkDestroyCommandPool; + PFN_vkResetCommandPool Anvil::Vulkan::vkResetCommandPool = ::vkResetCommandPool; + PFN_vkAllocateCommandBuffers Anvil::Vulkan::vkAllocateCommandBuffers = ::vkAllocateCommandBuffers; + PFN_vkFreeCommandBuffers Anvil::Vulkan::vkFreeCommandBuffers = ::vkFreeCommandBuffers; + PFN_vkBeginCommandBuffer Anvil::Vulkan::vkBeginCommandBuffer = ::vkBeginCommandBuffer; + PFN_vkEndCommandBuffer Anvil::Vulkan::vkEndCommandBuffer = ::vkEndCommandBuffer; + PFN_vkResetCommandBuffer Anvil::Vulkan::vkResetCommandBuffer = ::vkResetCommandBuffer; + PFN_vkCmdBindPipeline Anvil::Vulkan::vkCmdBindPipeline = ::vkCmdBindPipeline; + PFN_vkCmdSetViewport Anvil::Vulkan::vkCmdSetViewport = ::vkCmdSetViewport; + PFN_vkCmdSetScissor Anvil::Vulkan::vkCmdSetScissor = ::vkCmdSetScissor; + PFN_vkCmdSetLineWidth Anvil::Vulkan::vkCmdSetLineWidth = ::vkCmdSetLineWidth; + PFN_vkCmdSetDepthBias Anvil::Vulkan::vkCmdSetDepthBias = ::vkCmdSetDepthBias; + PFN_vkCmdSetBlendConstants Anvil::Vulkan::vkCmdSetBlendConstants = ::vkCmdSetBlendConstants; + PFN_vkCmdSetDepthBounds Anvil::Vulkan::vkCmdSetDepthBounds = ::vkCmdSetDepthBounds; + PFN_vkCmdSetStencilCompareMask Anvil::Vulkan::vkCmdSetStencilCompareMask = ::vkCmdSetStencilCompareMask; + PFN_vkCmdSetStencilWriteMask Anvil::Vulkan::vkCmdSetStencilWriteMask = ::vkCmdSetStencilWriteMask; + PFN_vkCmdSetStencilReference Anvil::Vulkan::vkCmdSetStencilReference = ::vkCmdSetStencilReference; + PFN_vkCmdBindDescriptorSets Anvil::Vulkan::vkCmdBindDescriptorSets = ::vkCmdBindDescriptorSets; + PFN_vkCmdBindIndexBuffer Anvil::Vulkan::vkCmdBindIndexBuffer = ::vkCmdBindIndexBuffer; + PFN_vkCmdBindVertexBuffers Anvil::Vulkan::vkCmdBindVertexBuffers = ::vkCmdBindVertexBuffers; + PFN_vkCmdDraw Anvil::Vulkan::vkCmdDraw = ::vkCmdDraw; + PFN_vkCmdDrawIndexed Anvil::Vulkan::vkCmdDrawIndexed = ::vkCmdDrawIndexed; + PFN_vkCmdDrawIndirect Anvil::Vulkan::vkCmdDrawIndirect = ::vkCmdDrawIndirect; + PFN_vkCmdDrawIndexedIndirect Anvil::Vulkan::vkCmdDrawIndexedIndirect = ::vkCmdDrawIndexedIndirect; + PFN_vkCmdDispatch Anvil::Vulkan::vkCmdDispatch = ::vkCmdDispatch; + PFN_vkCmdDispatchIndirect Anvil::Vulkan::vkCmdDispatchIndirect = ::vkCmdDispatchIndirect; + PFN_vkCmdCopyBuffer Anvil::Vulkan::vkCmdCopyBuffer = ::vkCmdCopyBuffer; + PFN_vkCmdCopyImage Anvil::Vulkan::vkCmdCopyImage = ::vkCmdCopyImage; + PFN_vkCmdBlitImage Anvil::Vulkan::vkCmdBlitImage = ::vkCmdBlitImage; + PFN_vkCmdCopyBufferToImage Anvil::Vulkan::vkCmdCopyBufferToImage = ::vkCmdCopyBufferToImage; + PFN_vkCmdCopyImageToBuffer Anvil::Vulkan::vkCmdCopyImageToBuffer = ::vkCmdCopyImageToBuffer; + PFN_vkCmdUpdateBuffer Anvil::Vulkan::vkCmdUpdateBuffer = ::vkCmdUpdateBuffer; + PFN_vkCmdFillBuffer Anvil::Vulkan::vkCmdFillBuffer = ::vkCmdFillBuffer; + PFN_vkCmdClearColorImage Anvil::Vulkan::vkCmdClearColorImage = ::vkCmdClearColorImage; + PFN_vkCmdClearDepthStencilImage Anvil::Vulkan::vkCmdClearDepthStencilImage = ::vkCmdClearDepthStencilImage; + PFN_vkCmdClearAttachments Anvil::Vulkan::vkCmdClearAttachments = ::vkCmdClearAttachments; + PFN_vkCmdResolveImage Anvil::Vulkan::vkCmdResolveImage = ::vkCmdResolveImage; + PFN_vkCmdSetEvent Anvil::Vulkan::vkCmdSetEvent = ::vkCmdSetEvent; + PFN_vkCmdResetEvent Anvil::Vulkan::vkCmdResetEvent = ::vkCmdResetEvent; + PFN_vkCmdWaitEvents Anvil::Vulkan::vkCmdWaitEvents = ::vkCmdWaitEvents; + PFN_vkCmdPipelineBarrier Anvil::Vulkan::vkCmdPipelineBarrier = ::vkCmdPipelineBarrier; + PFN_vkCmdBeginQuery Anvil::Vulkan::vkCmdBeginQuery = ::vkCmdBeginQuery; + PFN_vkCmdEndQuery Anvil::Vulkan::vkCmdEndQuery = ::vkCmdEndQuery; + PFN_vkCmdResetQueryPool Anvil::Vulkan::vkCmdResetQueryPool = ::vkCmdResetQueryPool; + PFN_vkCmdWriteTimestamp Anvil::Vulkan::vkCmdWriteTimestamp = ::vkCmdWriteTimestamp; + PFN_vkCmdCopyQueryPoolResults Anvil::Vulkan::vkCmdCopyQueryPoolResults = ::vkCmdCopyQueryPoolResults; + PFN_vkCmdPushConstants Anvil::Vulkan::vkCmdPushConstants = ::vkCmdPushConstants; + PFN_vkCmdBeginRenderPass Anvil::Vulkan::vkCmdBeginRenderPass = ::vkCmdBeginRenderPass; + PFN_vkCmdNextSubpass Anvil::Vulkan::vkCmdNextSubpass = ::vkCmdNextSubpass; + PFN_vkCmdEndRenderPass Anvil::Vulkan::vkCmdEndRenderPass = ::vkCmdEndRenderPass; + PFN_vkCmdExecuteCommands Anvil::Vulkan::vkCmdExecuteCommands = ::vkCmdExecuteCommands; +#endif diff --git a/src/wrappers/buffer.cpp b/src/wrappers/buffer.cpp index 796e7b34..654d4982 100644 --- a/src/wrappers/buffer.cpp +++ b/src/wrappers/buffer.cpp @@ -147,9 +147,9 @@ Anvil::Buffer::~Buffer() { lock(); { - vkDestroyBuffer(m_device_ptr->get_device_vk(), - m_buffer, - nullptr /* pAllocator */); + Anvil::Vulkan::vkDestroyBuffer(m_device_ptr->get_device_vk(), + m_buffer, + nullptr /* pAllocator */); } unlock(); @@ -336,10 +336,10 @@ bool Anvil::Buffer::init() { auto struct_chain_ptr = struct_chainer.create_chain(); - result = vkCreateBuffer(m_device_ptr->get_device_vk(), - struct_chain_ptr->get_root_struct(), - nullptr, /* pAllocator */ - &m_buffer); + result = Anvil::Vulkan::vkCreateBuffer(m_device_ptr->get_device_vk(), + struct_chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_buffer); } anvil_assert_vk_call_succeeded(result); @@ -410,9 +410,9 @@ bool Anvil::Buffer::init() } else { - vkGetBufferMemoryRequirements(m_device_ptr->get_device_vk(), - m_buffer, - &m_buffer_memory_reqs); + Anvil::Vulkan::vkGetBufferMemoryRequirements(m_device_ptr->get_device_vk(), + m_buffer, + &m_buffer_memory_reqs); } } } @@ -618,7 +618,7 @@ bool Anvil::Buffer::init_staging_buffer(const VkDeviceSize& in_size, in_size, staging_buffer_queue_fam_bits, sharing_mode, - Anvil::BufferUsageFlagBits::TRANSFER_SRC_BIT, + Anvil::BufferUsageFlagBits::TRANSFER_DST_BIT | Anvil::BufferUsageFlagBits::TRANSFER_SRC_BIT, Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT); create_info_ptr->set_mt_safety (Anvil::MTSafety::DISABLED); @@ -761,6 +761,7 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, m_staging_buffer_queue_ptr->submit( Anvil::SubmitInfo::create_execute(&cmd_buffer_submission, + 1, /* in_n_command_buffer_submissions */ true /* should_block */) ); } @@ -808,10 +809,10 @@ bool Anvil::Buffer::set_memory_nonsparse_internal(MemoryBlockUniquePtr in_memor { lock(); { - result_vk = vkBindBufferMemory(m_device_ptr->get_device_vk(), - m_buffer, - in_memory_block_ptr->get_memory (), - in_memory_block_ptr->get_start_offset() ); + result_vk = Anvil::Vulkan::vkBindBufferMemory(m_device_ptr->get_device_vk(), + m_buffer, + in_memory_block_ptr->get_memory (), + in_memory_block_ptr->get_start_offset() ); } unlock(); } @@ -1263,6 +1264,7 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, m_staging_buffer_queue_ptr->submit( Anvil::SubmitInfo::create_execute(©_cmdbuf_submission, + 1, /* in_n_command_buffer_submissions */ true /* should_block */) ); } diff --git a/src/wrappers/buffer_view.cpp b/src/wrappers/buffer_view.cpp index c3743c49..94a2f699 100644 --- a/src/wrappers/buffer_view.cpp +++ b/src/wrappers/buffer_view.cpp @@ -53,9 +53,9 @@ Anvil::BufferView::~BufferView() lock(); { - vkDestroyBufferView(m_device_ptr->get_device_vk(), - m_buffer_view, - nullptr /* pAllocator */); + Anvil::Vulkan::vkDestroyBufferView(m_device_ptr->get_device_vk(), + m_buffer_view, + nullptr /* pAllocator */); } unlock(); @@ -98,10 +98,10 @@ bool Anvil::BufferView::init() buffer_view_create_info.range = m_create_info_ptr->get_size(); buffer_view_create_info.sType = VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO; - result = vkCreateBufferView(m_create_info_ptr->get_device()->get_device_vk(), - &buffer_view_create_info, - nullptr, /* pAllocator */ - &m_buffer_view); + result = Anvil::Vulkan::vkCreateBufferView(m_create_info_ptr->get_device()->get_device_vk(), + &buffer_view_create_info, + nullptr, /* pAllocator */ + &m_buffer_view); if (is_vk_call_successful(result) ) { diff --git a/src/wrappers/command_buffer.cpp b/src/wrappers/command_buffer.cpp index 8be64766..56b0ff58 100644 --- a/src/wrappers/command_buffer.cpp +++ b/src/wrappers/command_buffer.cpp @@ -62,14 +62,18 @@ Anvil::CommandBufferBase::BeginQueryCommand::BeginQueryCommand(Anvil::QueryPool* } /** Please see header for specification */ -Anvil::BeginRenderPassCommand::BeginRenderPassCommand(uint32_t in_n_clear_values, - const VkClearValue* in_clear_value_ptrs, - Anvil::Framebuffer* in_fbo_ptr, - uint32_t in_n_physical_devices, - const Anvil::PhysicalDevice* const* in_physical_devices, - const VkRect2D* in_render_areas, - Anvil::RenderPass* in_render_pass_ptr, - Anvil::SubpassContents in_contents) +Anvil::BeginRenderPassCommand::BeginRenderPassCommand(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + uint32_t in_n_physical_devices, + const Anvil::PhysicalDevice* const* in_physical_devices, + const VkRect2D* in_render_areas, + Anvil::RenderPass* in_render_pass_ptr, + Anvil::SubpassContents in_contents, + const uint32_t& in_n_attachment_initial_sample_locations, + const Anvil::AttachmentSampleLocations* in_attachment_initial_sample_locations_ptr, + const uint32_t& in_n_post_subpass_sample_locations, + const Anvil::SubpassSampleLocations* in_post_subpass_sample_locations_ptr) :Command(COMMAND_TYPE_BEGIN_RENDER_PASS) { contents = in_contents; @@ -90,6 +94,23 @@ Anvil::BeginRenderPassCommand::BeginRenderPassCommand(uint32_t physical_devices.push_back(in_physical_devices[n_physical_device]); render_areas.push_back (in_render_areas [n_physical_device]); } + + attachment_initial_sample_locations.resize(in_n_attachment_initial_sample_locations); + post_subpass_sample_locations.resize (in_n_post_subpass_sample_locations); + + for (uint32_t n_attachment = 0; + n_attachment < in_n_attachment_initial_sample_locations; + ++n_attachment) + { + attachment_initial_sample_locations.at(n_attachment) = in_attachment_initial_sample_locations_ptr[n_attachment]; + } + + for (uint32_t n_subpass = 0; + n_subpass < in_n_post_subpass_sample_locations; + ++n_subpass) + { + post_subpass_sample_locations.at(n_subpass) = in_post_subpass_sample_locations_ptr[n_subpass]; + } } /** Please see header for specification */ @@ -797,6 +818,13 @@ Anvil::CommandBufferBase::SetLineWidthCommand::SetLineWidthCommand(float in_line line_width = in_line_width; } +/** Please see header for specification */ +Anvil::CommandBufferBase::SetSampleLocationsEXTCommand::SetSampleLocationsEXTCommand(const Anvil::SampleLocationsInfo& in_sample_locations_info) + :Command(COMMAND_TYPE_SET_SAMPLE_LOCATIONS_EXT) +{ + sample_locations_info = in_sample_locations_info; +} + /** Please see header for specification */ Anvil::CommandBufferBase::SetScissorCommand::SetScissorCommand(uint32_t in_first_scissor, uint32_t in_scissor_count, @@ -916,6 +944,19 @@ Anvil::CommandBufferBase::WaitEventsCommand::WaitEventsCommand(uint32_t } } +/** Please see header for specification */ +Anvil::CommandBufferBase::WriteBufferMarkerAMDCommand::WriteBufferMarkerAMDCommand(const Anvil::PipelineStageFlagBits& in_pipeline_stage, + Anvil::Buffer* in_dst_buffer_ptr, + VkDeviceSize in_dst_offset, + const uint32_t& in_marker) + :Command(COMMAND_TYPE_WRITE_BUFFER_MARKER_AMD) +{ + dst_buffer_ptr = in_dst_buffer_ptr; + dst_offset = in_dst_offset; + marker = in_marker; + pipeline_stage = in_pipeline_stage; +} + /** Please see header for specification */ Anvil::CommandBufferBase::WriteTimestampCommand::WriteTimestampCommand(Anvil::PipelineStageFlagBits in_pipeline_stage, Anvil::QueryPool* in_query_pool_ptr, @@ -971,10 +1012,10 @@ Anvil::CommandBufferBase::~CommandBufferBase() m_parent_command_pool_ptr->lock(); lock(); { - vkFreeCommandBuffers(m_device_ptr->get_device_vk(), - m_parent_command_pool_ptr->get_command_pool(), - 1, /* commandBufferCount */ - &m_command_buffer); + Anvil::Vulkan::vkFreeCommandBuffers(m_device_ptr->get_device_vk(), + m_parent_command_pool_ptr->get_command_pool(), + 1, /* commandBufferCount */ + &m_command_buffer); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1026,10 +1067,10 @@ bool Anvil::CommandBufferBase::record_begin_query(Anvil::QueryPool* in_qu m_parent_command_pool_ptr->lock(); lock(); { - vkCmdBeginQuery(m_command_buffer, - in_query_pool_ptr->get_query_pool(), - in_entry, - in_flags.get_vk() ); + Anvil::Vulkan::vkCmdBeginQuery(m_command_buffer, + in_query_pool_ptr->get_query_pool(), + in_entry, + in_flags.get_vk() ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1084,14 +1125,14 @@ bool Anvil::CommandBufferBase::record_bind_descriptor_sets(Anvil::PipelineBindPo m_parent_command_pool_ptr->lock(); lock(); { - vkCmdBindDescriptorSets(m_command_buffer, - static_cast(in_pipeline_bind_point), - in_layout_ptr->get_pipeline_layout(), - in_first_set, - in_set_count, - (in_set_count > 0) ? &dss_vk.at(0) : nullptr, - in_dynamic_offset_count, - in_dynamic_offset_ptrs); + Anvil::Vulkan::vkCmdBindDescriptorSets(m_command_buffer, + static_cast(in_pipeline_bind_point), + in_layout_ptr->get_pipeline_layout(), + in_first_set, + in_set_count, + (in_set_count > 0) ? &dss_vk.at(0) : nullptr, + in_dynamic_offset_count, + in_dynamic_offset_ptrs); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1130,10 +1171,10 @@ bool Anvil::CommandBufferBase::record_bind_index_buffer(Anvil::Buffer* in_buff m_parent_command_pool_ptr->lock(); lock(); { - vkCmdBindIndexBuffer(m_command_buffer, - in_buffer_ptr->get_buffer(), - in_offset, - static_cast(in_index_type) ); + Anvil::Vulkan::vkCmdBindIndexBuffer(m_command_buffer, + in_buffer_ptr->get_buffer(), + in_offset, + static_cast(in_index_type) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1177,9 +1218,9 @@ bool Anvil::CommandBufferBase::record_bind_pipeline(Anvil::PipelineBindPoint in_ m_parent_command_pool_ptr->lock(); lock(); { - vkCmdBindPipeline(m_command_buffer, - static_cast(in_pipeline_bind_point), - pipeline_vk); + Anvil::Vulkan::vkCmdBindPipeline(m_command_buffer, + static_cast(in_pipeline_bind_point), + pipeline_vk); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1228,11 +1269,11 @@ bool Anvil::CommandBufferBase::record_bind_vertex_buffers(uint32_t in m_parent_command_pool_ptr->lock(); lock(); { - vkCmdBindVertexBuffers(m_command_buffer, - in_start_binding, - in_binding_count, - (in_binding_count > 0) ? &buffers.at(0) : nullptr, - in_offset_ptrs); + Anvil::Vulkan::vkCmdBindVertexBuffers(m_command_buffer, + in_start_binding, + in_binding_count, + (in_binding_count > 0) ? &buffers.at(0) : nullptr, + in_offset_ptrs); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1285,14 +1326,14 @@ bool Anvil::CommandBufferBase::record_blit_image(Anvil::Image* in_src_ m_parent_command_pool_ptr->lock(); lock(); { - vkCmdBlitImage(m_command_buffer, - in_src_image_ptr->get_image(), - static_cast(in_src_image_layout), - in_dst_image_ptr->get_image(), - static_cast(in_dst_image_layout), - in_region_count, - reinterpret_cast(in_region_ptrs), - static_cast(in_filter) ); + Anvil::Vulkan::vkCmdBlitImage(m_command_buffer, + in_src_image_ptr->get_image(), + static_cast(in_src_image_layout), + in_dst_image_ptr->get_image(), + static_cast(in_dst_image_layout), + in_region_count, + reinterpret_cast(in_region_ptrs), + static_cast(in_filter) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1339,11 +1380,11 @@ bool Anvil::CommandBufferBase::record_clear_attachments(uint32_t m_parent_command_pool_ptr->lock(); lock(); { - vkCmdClearAttachments(m_command_buffer, - in_n_attachments, - reinterpret_cast(in_attachment_ptrs), - in_n_rects, - in_rect_ptrs); + Anvil::Vulkan::vkCmdClearAttachments(m_command_buffer, + in_n_attachments, + reinterpret_cast(in_attachment_ptrs), + in_n_rects, + in_rect_ptrs); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1392,12 +1433,12 @@ bool Anvil::CommandBufferBase::record_clear_color_image(Anvil::Image* m_parent_command_pool_ptr->lock(); lock(); { - vkCmdClearColorImage(m_command_buffer, - in_image_ptr->get_image(), - static_cast(in_image_layout), - in_color_ptr, - in_range_count, - reinterpret_cast(in_range_ptrs) ); + Anvil::Vulkan::vkCmdClearColorImage(m_command_buffer, + in_image_ptr->get_image(), + static_cast(in_image_layout), + in_color_ptr, + in_range_count, + reinterpret_cast(in_range_ptrs) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1446,12 +1487,12 @@ bool Anvil::CommandBufferBase::record_clear_depth_stencil_image(Anvil::Image* m_parent_command_pool_ptr->lock(); lock(); { - vkCmdClearDepthStencilImage(m_command_buffer, - in_image_ptr->get_image(), - static_cast(in_image_layout), - in_depth_stencil_ptr, - in_range_count, - reinterpret_cast(in_range_ptrs) ); + Anvil::Vulkan::vkCmdClearDepthStencilImage(m_command_buffer, + in_image_ptr->get_image(), + static_cast(in_image_layout), + in_depth_stencil_ptr, + in_range_count, + reinterpret_cast(in_range_ptrs) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1498,11 +1539,11 @@ bool Anvil::CommandBufferBase::record_copy_buffer(Anvil::Buffer* in_sr m_parent_command_pool_ptr->lock(); lock(); { - vkCmdCopyBuffer(m_command_buffer, - in_src_buffer_ptr->get_buffer(), - in_dst_buffer_ptr->get_buffer(), - in_region_count, - reinterpret_cast(in_region_ptrs) ); + Anvil::Vulkan::vkCmdCopyBuffer(m_command_buffer, + in_src_buffer_ptr->get_buffer(), + in_dst_buffer_ptr->get_buffer(), + in_region_count, + reinterpret_cast(in_region_ptrs) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1551,12 +1592,12 @@ bool Anvil::CommandBufferBase::record_copy_buffer_to_image(Anvil::Buffer* m_parent_command_pool_ptr->lock(); lock(); { - vkCmdCopyBufferToImage(m_command_buffer, - in_src_buffer_ptr->get_buffer(), - in_dst_image_ptr->get_image(), - static_cast(in_dst_image_layout), - in_region_count, - reinterpret_cast(in_region_ptrs) ); + Anvil::Vulkan::vkCmdCopyBufferToImage(m_command_buffer, + in_src_buffer_ptr->get_buffer(), + in_dst_image_ptr->get_image(), + static_cast(in_dst_image_layout), + in_region_count, + reinterpret_cast(in_region_ptrs) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1607,13 +1648,13 @@ bool Anvil::CommandBufferBase::record_copy_image(Anvil::Image* in_src_ m_parent_command_pool_ptr->lock(); lock(); { - vkCmdCopyImage(m_command_buffer, - in_src_image_ptr->get_image(), - static_cast(in_src_image_layout), - in_dst_image_ptr->get_image(), - static_cast(in_dst_image_layout), - in_region_count, - reinterpret_cast(in_region_ptrs) ); + Anvil::Vulkan::vkCmdCopyImage(m_command_buffer, + in_src_image_ptr->get_image(), + static_cast(in_src_image_layout), + in_dst_image_ptr->get_image(), + static_cast(in_dst_image_layout), + in_region_count, + reinterpret_cast(in_region_ptrs) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1662,12 +1703,12 @@ bool Anvil::CommandBufferBase::record_copy_image_to_buffer(Anvil::Image* m_parent_command_pool_ptr->lock(); lock(); { - vkCmdCopyImageToBuffer(m_command_buffer, - in_src_image_ptr->get_image(), - static_cast(in_src_image_layout), - in_dst_buffer_ptr->get_buffer(), - in_region_count, - reinterpret_cast(in_region_ptrs) ); + Anvil::Vulkan::vkCmdCopyImageToBuffer(m_command_buffer, + in_src_image_ptr->get_image(), + static_cast(in_src_image_layout), + in_dst_buffer_ptr->get_buffer(), + in_region_count, + reinterpret_cast(in_region_ptrs) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1720,14 +1761,14 @@ bool Anvil::CommandBufferBase::record_copy_query_pool_results(Anvil::QueryPool* m_parent_command_pool_ptr->lock(); lock(); { - vkCmdCopyQueryPoolResults(m_command_buffer, - in_query_pool_ptr->get_query_pool(), - in_start_query, - in_query_count, - in_dst_buffer_ptr->get_buffer(), - in_dst_offset, - in_dst_stride, - in_flags); + Anvil::Vulkan::vkCmdCopyQueryPoolResults(m_command_buffer, + in_query_pool_ptr->get_query_pool(), + in_start_query, + in_query_count, + in_dst_buffer_ptr->get_buffer(), + in_dst_offset, + in_dst_stride, + in_flags); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -1772,10 +1813,10 @@ bool Anvil::CommandBufferBase::record_dispatch(uint32_t in_x, m_parent_command_pool_ptr->lock(); lock(); { - vkCmdDispatch(m_command_buffer, - in_x, - in_y, - in_z); + Anvil::Vulkan::vkCmdDispatch(m_command_buffer, + in_x, + in_y, + in_z); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -2030,9 +2071,9 @@ bool Anvil::CommandBufferBase::record_dispatch_indirect(Anvil::Buffer* in_buffer m_parent_command_pool_ptr->lock(); lock(); { - vkCmdDispatchIndirect(m_command_buffer, - in_buffer_ptr->get_buffer(), - in_offset); + Anvil::Vulkan::vkCmdDispatchIndirect(m_command_buffer, + in_buffer_ptr->get_buffer(), + in_offset); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -2079,11 +2120,11 @@ bool Anvil::CommandBufferBase::record_draw(uint32_t in_vertex_count, m_parent_command_pool_ptr->lock(); lock(); { - vkCmdDraw(m_command_buffer, - in_vertex_count, - in_instance_count, - in_first_vertex, - in_first_instance); + Anvil::Vulkan::vkCmdDraw(m_command_buffer, + in_vertex_count, + in_instance_count, + in_first_vertex, + in_first_instance); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -2132,12 +2173,12 @@ bool Anvil::CommandBufferBase::record_draw_indexed(uint32_t in_index_count, m_parent_command_pool_ptr->lock(); lock(); { - vkCmdDrawIndexed(m_command_buffer, - in_index_count, - in_instance_count, - in_first_index, - in_vertex_offset, - in_first_instance); + Anvil::Vulkan::vkCmdDrawIndexed(m_command_buffer, + in_index_count, + in_instance_count, + in_first_index, + in_vertex_offset, + in_first_instance); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -2184,11 +2225,11 @@ bool Anvil::CommandBufferBase::record_draw_indexed_indirect(Anvil::Buffer* in_bu m_parent_command_pool_ptr->lock(); lock(); { - vkCmdDrawIndexedIndirect(m_command_buffer, - in_buffer_ptr->get_buffer(), - in_offset, - in_count, - in_stride); + Anvil::Vulkan::vkCmdDrawIndexedIndirect(m_command_buffer, + in_buffer_ptr->get_buffer(), + in_offset, + in_count, + in_stride); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -2361,11 +2402,11 @@ bool Anvil::CommandBufferBase::record_draw_indirect(Anvil::Buffer* in_buffer_ptr m_parent_command_pool_ptr->lock(); lock(); { - vkCmdDrawIndirect(m_command_buffer, - in_buffer_ptr->get_buffer(), - in_offset, - in_count, - in_stride); + Anvil::Vulkan::vkCmdDrawIndirect(m_command_buffer, + in_buffer_ptr->get_buffer(), + in_offset, + in_count, + in_stride); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -2528,9 +2569,9 @@ bool Anvil::CommandBufferBase::record_end_query(Anvil::QueryPool* in_query_pool_ m_parent_command_pool_ptr->lock(); lock(); { - vkCmdEndQuery(m_command_buffer, - in_query_pool_ptr->get_query_pool(), - in_entry); + Anvil::Vulkan::vkCmdEndQuery(m_command_buffer, + in_query_pool_ptr->get_query_pool(), + in_entry); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -2577,11 +2618,11 @@ bool Anvil::CommandBufferBase::record_fill_buffer(Anvil::Buffer* in_dst_buffer_p m_parent_command_pool_ptr->lock(); lock(); { - vkCmdFillBuffer(m_command_buffer, - in_dst_buffer_ptr->get_buffer(), - in_dst_offset, - in_size, - in_data); + Anvil::Vulkan::vkCmdFillBuffer(m_command_buffer, + in_dst_buffer_ptr->get_buffer(), + in_dst_offset, + in_size, + in_data); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -2615,6 +2656,9 @@ bool Anvil::CommandBufferBase::record_pipeline_barrier(Anvil::PipelineStageFlags goto end; } + anvil_assert((!m_is_renderpass_active) || + ( m_is_renderpass_active) && (in_dependency_flags & Anvil::DependencyFlagBits::VIEW_LOCAL_BIT) == 0); + #ifdef STORE_COMMAND_BUFFER_COMMANDS { if (!m_command_stashing_disabled) @@ -2674,16 +2718,16 @@ bool Anvil::CommandBufferBase::record_pipeline_barrier(Anvil::PipelineStageFlags m_parent_command_pool_ptr->lock(); lock(); { - vkCmdPipelineBarrier(m_command_buffer, - in_src_stage_mask.get_vk (), - in_dst_stage_mask.get_vk (), - in_dependency_flags.get_vk(), - in_memory_barrier_count, - (in_memory_barrier_count > 0) ? &memory_barriers_vk.at(0) : nullptr, - in_buffer_memory_barrier_count, - (in_buffer_memory_barrier_count > 0) ? &buffer_barriers_vk.at(0) : nullptr, - in_image_memory_barrier_count, - (in_image_memory_barrier_count > 0) ? &image_barriers_vk.at(0) : nullptr); + Anvil::Vulkan::vkCmdPipelineBarrier(m_command_buffer, + in_src_stage_mask.get_vk (), + in_dst_stage_mask.get_vk (), + in_dependency_flags.get_vk(), + in_memory_barrier_count, + (in_memory_barrier_count > 0) ? &memory_barriers_vk.at(0) : nullptr, + in_buffer_memory_barrier_count, + (in_buffer_memory_barrier_count > 0) ? &buffer_barriers_vk.at(0) : nullptr, + in_image_memory_barrier_count, + (in_image_memory_barrier_count > 0) ? &image_barriers_vk.at(0) : nullptr); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -2726,12 +2770,12 @@ bool Anvil::CommandBufferBase::record_push_constants(Anvil::PipelineLayout* in_ m_parent_command_pool_ptr->lock(); lock(); { - vkCmdPushConstants(m_command_buffer, - in_layout_ptr->get_pipeline_layout(), - in_stage_flags.get_vk(), - in_offset, - in_size, - in_values); + Anvil::Vulkan::vkCmdPushConstants(m_command_buffer, + in_layout_ptr->get_pipeline_layout(), + in_stage_flags.get_vk(), + in_offset, + in_size, + in_values); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -2774,9 +2818,9 @@ bool Anvil::CommandBufferBase::record_reset_event(Anvil::Event* in_e m_parent_command_pool_ptr->lock(); lock(); { - vkCmdResetEvent(m_command_buffer, - in_event_ptr->get_event(), - in_stage_mask.get_vk() ); + Anvil::Vulkan::vkCmdResetEvent(m_command_buffer, + in_event_ptr->get_event(), + in_stage_mask.get_vk() ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -2821,10 +2865,10 @@ bool Anvil::CommandBufferBase::record_reset_query_pool(Anvil::QueryPool* in_quer m_parent_command_pool_ptr->lock(); lock(); { - vkCmdResetQueryPool(m_command_buffer, - in_query_pool_ptr->get_query_pool(), - in_start_query, - in_query_count); + Anvil::Vulkan::vkCmdResetQueryPool(m_command_buffer, + in_query_pool_ptr->get_query_pool(), + in_start_query, + in_query_count); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -2875,13 +2919,13 @@ bool Anvil::CommandBufferBase::record_resolve_image(Anvil::Image* i m_parent_command_pool_ptr->lock(); lock(); { - vkCmdResolveImage(m_command_buffer, - in_src_image_ptr->get_image(), - static_cast(in_src_image_layout), - in_dst_image_ptr->get_image(), - static_cast(in_dst_image_layout), - in_region_count, - reinterpret_cast(in_region_ptrs) ); + Anvil::Vulkan::vkCmdResolveImage(m_command_buffer, + in_src_image_ptr->get_image(), + static_cast(in_src_image_layout), + in_dst_image_ptr->get_image(), + static_cast(in_dst_image_layout), + in_region_count, + reinterpret_cast(in_region_ptrs) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -2917,8 +2961,8 @@ bool Anvil::CommandBufferBase::record_set_blend_constants(const float in_blend_c m_parent_command_pool_ptr->lock(); lock(); { - vkCmdSetBlendConstants(m_command_buffer, - in_blend_constants); + Anvil::Vulkan::vkCmdSetBlendConstants(m_command_buffer, + in_blend_constants); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -2957,10 +3001,10 @@ bool Anvil::CommandBufferBase::record_set_depth_bias(float in_depth_bias_constan m_parent_command_pool_ptr->lock(); lock(); { - vkCmdSetDepthBias(m_command_buffer, - in_depth_bias_constant_factor, - in_depth_bias_clamp, - in_slope_scaled_depth_bias); + Anvil::Vulkan::vkCmdSetDepthBias(m_command_buffer, + in_depth_bias_constant_factor, + in_depth_bias_clamp, + in_slope_scaled_depth_bias); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -2997,9 +3041,9 @@ bool Anvil::CommandBufferBase::record_set_depth_bounds(float in_min_depth_bounds m_parent_command_pool_ptr->lock(); lock(); { - vkCmdSetDepthBounds(m_command_buffer, - in_min_depth_bounds, - in_max_depth_bounds); + Anvil::Vulkan::vkCmdSetDepthBounds(m_command_buffer, + in_min_depth_bounds, + in_max_depth_bounds); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -3112,9 +3156,9 @@ bool Anvil::CommandBufferBase::record_set_event(Anvil::Event* in_eve m_parent_command_pool_ptr->lock(); lock(); { - vkCmdSetEvent(m_command_buffer, - in_event_ptr->get_event(), - in_stage_mask.get_vk() ); + Anvil::Vulkan::vkCmdSetEvent(m_command_buffer, + in_event_ptr->get_event(), + in_stage_mask.get_vk() ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -3149,8 +3193,48 @@ bool Anvil::CommandBufferBase::record_set_line_width(float in_line_width) m_parent_command_pool_ptr->lock(); lock(); { - vkCmdSetLineWidth(m_command_buffer, - in_line_width); + Anvil::Vulkan::vkCmdSetLineWidth(m_command_buffer, + in_line_width); + } + unlock(); + m_parent_command_pool_ptr->unlock(); + + result = true; +end: + return result; +} + +/* Please see header for specification */ +bool Anvil::CommandBufferBase::record_set_sample_locations_EXT(const Anvil::SampleLocationsInfo& in_sample_locations_info) +{ + /* Note: Command supported inside and outside the renderpass. */ + bool result = false; + VkSampleLocationsInfoEXT sample_locations_info_vk; + const auto& sl_entrypoints = m_device_ptr->get_extension_ext_sample_locations_entrypoints(); + + if (!m_recording_in_progress) + { + anvil_assert(m_recording_in_progress); + + goto end; + } + + #ifdef STORE_COMMAND_BUFFER_COMMANDS + { + if (!m_command_stashing_disabled) + { + m_commands.push_back(SetSampleLocationsEXTCommand(in_sample_locations_info) ); + } + } + #endif + + sample_locations_info_vk = in_sample_locations_info.get_vk(); + + m_parent_command_pool_ptr->lock(); + lock(); + { + sl_entrypoints.vkCmdSetSampleLocationsEXT(m_command_buffer, + &sample_locations_info_vk); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -3189,10 +3273,10 @@ bool Anvil::CommandBufferBase::record_set_scissor(uint32_t in_first_sciss m_parent_command_pool_ptr->lock(); lock(); { - vkCmdSetScissor(m_command_buffer, - in_first_scissor, - in_scissor_count, - in_scissor_ptrs); + Anvil::Vulkan::vkCmdSetScissor(m_command_buffer, + in_first_scissor, + in_scissor_count, + in_scissor_ptrs); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -3229,9 +3313,9 @@ bool Anvil::CommandBufferBase::record_set_stencil_compare_mask(Anvil::StencilFac m_parent_command_pool_ptr->lock(); lock(); { - vkCmdSetStencilCompareMask(m_command_buffer, - in_face_mask.get_vk(), - in_stencil_compare_mask); + Anvil::Vulkan::vkCmdSetStencilCompareMask(m_command_buffer, + in_face_mask.get_vk(), + in_stencil_compare_mask); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -3268,9 +3352,9 @@ bool Anvil::CommandBufferBase::record_set_stencil_reference(Anvil::StencilFaceFl m_parent_command_pool_ptr->lock(); lock(); { - vkCmdSetStencilReference(m_command_buffer, - in_face_mask.get_vk(), - in_stencil_reference); + Anvil::Vulkan::vkCmdSetStencilReference(m_command_buffer, + in_face_mask.get_vk(), + in_stencil_reference); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -3307,9 +3391,9 @@ bool Anvil::CommandBufferBase::record_set_stencil_write_mask(Anvil::StencilFaceF m_parent_command_pool_ptr->lock(); lock(); { - vkCmdSetStencilWriteMask(m_command_buffer, - in_face_mask.get_vk(), - in_stencil_write_mask); + Anvil::Vulkan::vkCmdSetStencilWriteMask(m_command_buffer, + in_face_mask.get_vk(), + in_stencil_write_mask); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -3348,10 +3432,10 @@ bool Anvil::CommandBufferBase::record_set_viewport(uint32_t in_first_vi m_parent_command_pool_ptr->lock(); lock(); { - vkCmdSetViewport(m_command_buffer, - in_first_viewport, - in_viewport_count, - in_viewport_ptrs); + Anvil::Vulkan::vkCmdSetViewport(m_command_buffer, + in_first_viewport, + in_viewport_count, + in_viewport_ptrs); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -3399,11 +3483,11 @@ bool Anvil::CommandBufferBase::record_update_buffer(Anvil::Buffer* in_dst_buffer m_parent_command_pool_ptr->lock(); lock(); { - vkCmdUpdateBuffer(m_command_buffer, - in_dst_buffer_ptr->get_buffer(), - in_dst_offset, - in_data_size, - in_data_ptr); + Anvil::Vulkan::vkCmdUpdateBuffer(m_command_buffer, + in_dst_buffer_ptr->get_buffer(), + in_dst_offset, + in_data_size, + in_data_ptr); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -3492,17 +3576,63 @@ bool Anvil::CommandBufferBase::record_wait_events(uint32_t in_ m_parent_command_pool_ptr->lock(); lock(); { - vkCmdWaitEvents(m_command_buffer, - in_event_count, - (in_event_count > 0) ? &events.at(0) : nullptr, - in_src_stage_mask.get_vk(), - in_dst_stage_mask.get_vk(), - in_memory_barrier_count, - (in_memory_barrier_count > 0) ? &memory_barriers_vk.at(0) : nullptr, - in_buffer_memory_barrier_count, - (in_buffer_memory_barrier_count > 0) ? &buffer_barriers_vk.at(0) : nullptr, - in_image_memory_barrier_count, - (in_image_memory_barrier_count > 0) ? &image_barriers_vk.at(0) : nullptr); + Anvil::Vulkan::vkCmdWaitEvents(m_command_buffer, + in_event_count, + (in_event_count > 0) ? &events.at(0) : nullptr, + in_src_stage_mask.get_vk(), + in_dst_stage_mask.get_vk(), + in_memory_barrier_count, + (in_memory_barrier_count > 0) ? &memory_barriers_vk.at(0) : nullptr, + in_buffer_memory_barrier_count, + (in_buffer_memory_barrier_count > 0) ? &buffer_barriers_vk.at(0) : nullptr, + in_image_memory_barrier_count, + (in_image_memory_barrier_count > 0) ? &image_barriers_vk.at(0) : nullptr); + } + unlock(); + m_parent_command_pool_ptr->unlock(); + + result = true; +end: + return result; +} + +/* Please see header for specification */ +bool Anvil::CommandBufferBase::record_write_buffer_marker_AMD(const Anvil::PipelineStageFlagBits& in_pipeline_stage, + Anvil::Buffer* in_dst_buffer_ptr, + const VkDeviceSize& in_dst_offset, + const uint32_t& in_marker) +{ + /* NOTE: The command can be executed both inside and outside a renderpass */ + const auto& entrypoints = m_device_ptr->get_extension_amd_buffer_marker_entrypoints(); + bool result = false; + + if (!m_recording_in_progress) + { + anvil_assert(m_recording_in_progress); + + goto end; + } + + #ifdef STORE_COMMAND_BUFFER_COMMANDS + { + if (!m_command_stashing_disabled) + { + m_commands.push_back(WriteBufferMarkerAMDCommand(in_pipeline_stage, + in_dst_buffer_ptr, + in_dst_offset, + in_marker) ); + } + } + #endif + + m_parent_command_pool_ptr->lock(); + lock(); + { + entrypoints.vkCmdWriteBufferMarkerAMD(m_command_buffer, + static_cast(in_pipeline_stage), + in_dst_buffer_ptr->get_buffer(), + in_dst_offset, + in_marker); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -3541,10 +3671,10 @@ bool Anvil::CommandBufferBase::record_write_timestamp(Anvil::PipelineStageFlagBi m_parent_command_pool_ptr->lock(); lock(); { - vkCmdWriteTimestamp(m_command_buffer, - static_cast(in_pipeline_stage), - in_query_pool_ptr->get_query_pool(), - in_query_index); + Anvil::Vulkan::vkCmdWriteTimestamp(m_command_buffer, + static_cast(in_pipeline_stage), + in_query_pool_ptr->get_query_pool(), + in_query_index); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -3570,8 +3700,8 @@ bool Anvil::CommandBufferBase::reset(bool in_should_release_resources) m_parent_command_pool_ptr->lock(); lock(); { - result_vk = vkResetCommandBuffer(m_command_buffer, - (in_should_release_resources) ? VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT : 0u); + result_vk = Anvil::Vulkan::vkResetCommandBuffer(m_command_buffer, + (in_should_release_resources) ? VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT : 0u); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -3610,7 +3740,7 @@ bool Anvil::CommandBufferBase::stop_recording() m_parent_command_pool_ptr->lock(); lock(); { - result_vk = vkEndCommandBuffer(m_command_buffer); + result_vk = Anvil::Vulkan::vkEndCommandBuffer(m_command_buffer); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -3650,9 +3780,9 @@ Anvil::PrimaryCommandBuffer::PrimaryCommandBuffer(const Anvil::BaseDevice* in_de in_parent_command_pool_ptr->lock(); { - result_vk = vkAllocateCommandBuffers(m_device_ptr->get_device_vk(), - &alloc_info, - &m_command_buffer); + result_vk = Anvil::Vulkan::vkAllocateCommandBuffers(m_device_ptr->get_device_vk(), + &alloc_info, + &m_command_buffer); } in_parent_command_pool_ptr->unlock(); @@ -3660,12 +3790,16 @@ Anvil::PrimaryCommandBuffer::PrimaryCommandBuffer(const Anvil::BaseDevice* in_de } /* Please see header for specification */ -bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t in_n_clear_values, - const VkClearValue* in_clear_value_ptrs, - Anvil::Framebuffer* in_fbo_ptr, - VkRect2D in_render_area, - Anvil::RenderPass* in_render_pass_ptr, - Anvil::SubpassContents in_contents) +bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + VkRect2D in_render_area, + Anvil::RenderPass* in_render_pass_ptr, + Anvil::SubpassContents in_contents, + const uint32_t& in_opt_n_attachment_initial_sample_locations, + const Anvil::AttachmentSampleLocations* in_opt_attachment_initial_sample_locations_ptr, + const uint32_t& in_opt_n_post_subpass_sample_locations, + const Anvil::SubpassSampleLocations* in_opt_post_subpass_sample_locations_ptr) { return record_begin_render_pass(in_n_clear_values, in_clear_value_ptrs, @@ -3674,18 +3808,26 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t nullptr, /* in_physical_devices_ptr */ &in_render_area, in_render_pass_ptr, - in_contents); + in_contents, + in_opt_n_attachment_initial_sample_locations, + in_opt_attachment_initial_sample_locations_ptr, + in_opt_n_post_subpass_sample_locations, + in_opt_post_subpass_sample_locations_ptr); } /* Please see header for specification */ -bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t in_n_clear_values, - const VkClearValue* in_clear_value_ptrs, - Anvil::Framebuffer* in_fbo_ptr, - uint32_t in_n_physical_devices, - const Anvil::PhysicalDevice* const* in_physical_devices, - const VkRect2D* in_render_areas, - Anvil::RenderPass* in_render_pass_ptr, - Anvil::SubpassContents in_contents) +bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + uint32_t in_n_physical_devices, + const Anvil::PhysicalDevice* const* in_physical_devices, + const VkRect2D* in_render_areas, + Anvil::RenderPass* in_render_pass_ptr, + Anvil::SubpassContents in_contents, + const uint32_t& in_opt_n_attachment_initial_sample_locations, + const Anvil::AttachmentSampleLocations* in_opt_attachment_initial_sample_locations_ptr, + const uint32_t& in_opt_n_post_subpass_sample_locations, + const Anvil::SubpassSampleLocations* in_opt_post_subpass_sample_locations_ptr) { const Anvil::DeviceType device_type = m_device_ptr->get_type(); Anvil::StructChainer render_pass_begin_info_chain; @@ -3729,7 +3871,11 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t in_physical_devices, in_render_areas, in_render_pass_ptr, - in_contents) ); + in_contents, + in_opt_n_attachment_initial_sample_locations, + in_opt_attachment_initial_sample_locations_ptr, + in_opt_n_post_subpass_sample_locations, + in_opt_post_subpass_sample_locations_ptr) ); } } #endif @@ -3772,14 +3918,49 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t m_renderpass_device_mask = render_pass_device_group_begin_info.deviceMask; } + if (in_opt_n_attachment_initial_sample_locations != 0 || + in_opt_n_post_subpass_sample_locations != 0) + { + std::vector attachment_initial_sample_locations_vk(in_opt_n_attachment_initial_sample_locations); + VkRenderPassSampleLocationsBeginInfoEXT sl_begin_info; + std::vector post_subpass_sample_locations_vk (in_opt_n_post_subpass_sample_locations); + + anvil_assert(m_device_ptr->get_extension_info()->ext_sample_locations() ); + + for (uint32_t n_attachment = 0; + n_attachment < in_opt_n_attachment_initial_sample_locations; + ++n_attachment) + { + attachment_initial_sample_locations_vk.at(n_attachment) = in_opt_attachment_initial_sample_locations_ptr[n_attachment].get_vk(); + } + + for (uint32_t n_subpass = 0; + n_subpass < in_opt_n_post_subpass_sample_locations; + ++n_subpass) + { + post_subpass_sample_locations_vk.at(n_subpass) = in_opt_post_subpass_sample_locations_ptr[n_subpass].get_vk(); + } + + sl_begin_info.attachmentInitialSampleLocationsCount = in_opt_n_attachment_initial_sample_locations; + sl_begin_info.pAttachmentInitialSampleLocations = (in_opt_n_attachment_initial_sample_locations != 0) ? &attachment_initial_sample_locations_vk.at(0) + : nullptr; + sl_begin_info.pNext = nullptr; + sl_begin_info.postSubpassSampleLocationsCount = in_opt_n_post_subpass_sample_locations; + sl_begin_info.pPostSubpassSampleLocations = (in_opt_n_post_subpass_sample_locations != 0) ? &post_subpass_sample_locations_vk.at(0) + : nullptr; + sl_begin_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT; + + render_pass_begin_info_chain.append_struct(sl_begin_info); + } + m_parent_command_pool_ptr->lock(); lock(); { auto chain_ptr = render_pass_begin_info_chain.create_chain(); - vkCmdBeginRenderPass(m_command_buffer, - chain_ptr->get_root_struct(), - static_cast(in_contents) ); + Anvil::Vulkan::vkCmdBeginRenderPass(m_command_buffer, + chain_ptr->get_root_struct(), + static_cast(in_contents) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -3821,7 +4002,7 @@ bool Anvil::PrimaryCommandBuffer::record_end_render_pass() m_parent_command_pool_ptr->lock(); lock(); { - vkCmdEndRenderPass(m_command_buffer); + Anvil::Vulkan::vkCmdEndRenderPass(m_command_buffer); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -3867,9 +4048,9 @@ bool Anvil::PrimaryCommandBuffer::record_execute_commands(uint32_t m_parent_command_pool_ptr->lock(); lock(); { - vkCmdExecuteCommands(m_command_buffer, - in_cmd_buffers_count, - (in_cmd_buffers_count > 0) ? &cmd_buffers.at(0) : nullptr); + Anvil::Vulkan::vkCmdExecuteCommands(m_command_buffer, + in_cmd_buffers_count, + (in_cmd_buffers_count > 0) ? &cmd_buffers.at(0) : nullptr); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -3910,8 +4091,8 @@ bool Anvil::PrimaryCommandBuffer::record_next_subpass(Anvil::SubpassContents in_ m_parent_command_pool_ptr->lock(); lock(); { - vkCmdNextSubpass(m_command_buffer, - static_cast(in_contents) ); + Anvil::Vulkan::vkCmdNextSubpass(m_command_buffer, + static_cast(in_contents) ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -3978,8 +4159,8 @@ bool Anvil::PrimaryCommandBuffer::start_recording(bool { auto chain_ptr = struct_chainer.create_chain(); - result_vk = vkBeginCommandBuffer(m_command_buffer, - chain_ptr->get_root_struct() ); + result_vk = Anvil::Vulkan::vkBeginCommandBuffer(m_command_buffer, + chain_ptr->get_root_struct() ); } unlock(); m_parent_command_pool_ptr->unlock(); @@ -4029,9 +4210,9 @@ Anvil::SecondaryCommandBuffer::SecondaryCommandBuffer(const Anvil::BaseDevice* i in_parent_command_pool_ptr->lock(); { - result_vk = vkAllocateCommandBuffers(m_device_ptr->get_device_vk(), - &command_buffer_alloc_info, - &m_command_buffer); + result_vk = Anvil::Vulkan::vkAllocateCommandBuffers(m_device_ptr->get_device_vk(), + &command_buffer_alloc_info, + &m_command_buffer); } in_parent_command_pool_ptr->unlock(); @@ -4114,8 +4295,8 @@ bool Anvil::SecondaryCommandBuffer::start_recording(bool { auto chain_ptr = struct_chainer.create_chain(); - result_vk = vkBeginCommandBuffer(m_command_buffer, - chain_ptr->get_root_struct() ); + result_vk = Anvil::Vulkan::vkBeginCommandBuffer(m_command_buffer, + chain_ptr->get_root_struct() ); } unlock(); m_parent_command_pool_ptr->unlock(); diff --git a/src/wrappers/command_pool.cpp b/src/wrappers/command_pool.cpp index 4bbf8f28..ba5b7baa 100644 --- a/src/wrappers/command_pool.cpp +++ b/src/wrappers/command_pool.cpp @@ -57,10 +57,10 @@ Anvil::CommandPool::CommandPool(Anvil::BaseDevice* in_device_ptr, command_pool_create_info.queueFamilyIndex = in_queue_family_index; command_pool_create_info.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO; - result_vk = vkCreateCommandPool(in_device_ptr->get_device_vk(), - &command_pool_create_info, - nullptr, /* pAllocator */ - &m_command_pool); + result_vk = Anvil::Vulkan::vkCreateCommandPool(in_device_ptr->get_device_vk(), + &command_pool_create_info, + nullptr, /* pAllocator */ + &m_command_pool); anvil_assert_vk_call_succeeded(result_vk); if (is_vk_call_successful(result_vk) ) @@ -85,9 +85,9 @@ Anvil::CommandPool::~CommandPool() { lock(); { - vkDestroyCommandPool(m_device_ptr->get_device_vk(), - m_command_pool, - nullptr /* pAllocator */); + Anvil::Vulkan::vkDestroyCommandPool(m_device_ptr->get_device_vk(), + m_command_pool, + nullptr /* pAllocator */); } unlock(); @@ -156,9 +156,9 @@ bool Anvil::CommandPool::reset(bool in_release_resources) lock(); { - result_vk = vkResetCommandPool(m_device_ptr->get_device_vk(), - m_command_pool, - ((in_release_resources) ? VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT : 0u) ); + result_vk = Anvil::Vulkan::vkResetCommandPool(m_device_ptr->get_device_vk(), + m_command_pool, + ((in_release_resources) ? VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT : 0u) ); } unlock(); diff --git a/src/wrappers/compute_pipeline_manager.cpp b/src/wrappers/compute_pipeline_manager.cpp index 5e800bdf..c5c012e7 100644 --- a/src/wrappers/compute_pipeline_manager.cpp +++ b/src/wrappers/compute_pipeline_manager.cpp @@ -154,9 +154,10 @@ bool Anvil::ComputePipelineManager::bake() * * NOTE: A slightly adjusted version of this code is re-used in GraphicsPipelineManager::bake() */ auto& pipeline_vector = layout_to_bake_item_map[pipeline_create_info.layout]; + auto base_pipeline_id = current_pipeline_ptr->pipeline_create_info_ptr->get_base_pipeline_id(); auto base_pipeline_iterator = std::find(pipeline_vector.begin(), pipeline_vector.end(), - current_pipeline_ptr->pipeline_create_info_ptr->get_base_pipeline_id() ); + base_pipeline_id); if (base_pipeline_iterator != pipeline_vector.end() ) { @@ -165,17 +166,21 @@ bool Anvil::ComputePipelineManager::bake() pipeline_create_info.basePipelineIndex = static_cast(base_pipeline_iterator - pipeline_vector.begin() ); } else - if (base_pipeline_iterator->pipeline_ptr != nullptr && - base_pipeline_iterator->pipeline_ptr->baked_pipeline != VK_NULL_HANDLE) { - /* Case 2 */ - pipeline_create_info.basePipelineHandle = base_pipeline_iterator->pipeline_ptr->baked_pipeline; - pipeline_create_info.basePipelineIndex = UINT32_MAX; - } - else - { - /* Case 3 */ - anvil_assert_fail(); + auto baked_pipeline_iterator = m_baked_pipelines.find(base_pipeline_id); + + if (baked_pipeline_iterator != m_baked_pipelines.end() && + baked_pipeline_iterator->second->baked_pipeline != VK_NULL_HANDLE) + { + /* Case 2 */ + pipeline_create_info.basePipelineHandle = baked_pipeline_iterator->second->baked_pipeline; + pipeline_create_info.basePipelineIndex = UINT32_MAX; + } + else + { + /* Case 3 */ + anvil_assert_fail(); + } } } else @@ -247,12 +252,12 @@ bool Anvil::ComputePipelineManager::bake() m_pipeline_cache_ptr->lock(); { - result_vk = vkCreateComputePipelines(m_device_ptr->get_device_vk(), - m_pipeline_cache_ptr->get_pipeline_cache(), - static_cast(pipeline_create_info_items_vk.size() ), - &pipeline_create_info_items_vk[0], - nullptr, /* pAllocator */ - &result_pipeline_items_vk[0]); + result_vk = Anvil::Vulkan::vkCreateComputePipelines(m_device_ptr->get_device_vk(), + m_pipeline_cache_ptr->get_pipeline_cache(), + static_cast(pipeline_create_info_items_vk.size() ), + &pipeline_create_info_items_vk[0], + nullptr, /* pAllocator */ + &result_pipeline_items_vk[0]); } m_pipeline_cache_ptr->unlock(); diff --git a/src/wrappers/descriptor_pool.cpp b/src/wrappers/descriptor_pool.cpp index b2927d30..0b9956ba 100644 --- a/src/wrappers/descriptor_pool.cpp +++ b/src/wrappers/descriptor_pool.cpp @@ -65,9 +65,9 @@ Anvil::DescriptorPool::~DescriptorPool() { lock(); { - vkDestroyDescriptorPool(m_device_ptr->get_device_vk(), - m_pool, - nullptr /* pAllocator */); + Anvil::Vulkan::vkDestroyDescriptorPool(m_device_ptr->get_device_vk(), + m_pool, + nullptr /* pAllocator */); } unlock(); @@ -207,9 +207,9 @@ bool Anvil::DescriptorPool::alloc_descriptor_sets(uint32_t { auto chain_ptr = struct_chainer.create_chain(); - result_vk = vkAllocateDescriptorSets(m_device_ptr->get_device_vk(), - chain_ptr->get_root_struct(), - out_descriptor_sets_vk_ptr); + result_vk = Anvil::Vulkan::vkAllocateDescriptorSets(m_device_ptr->get_device_vk(), + chain_ptr->get_root_struct(), + out_descriptor_sets_vk_ptr); } } unlock(); @@ -298,10 +298,10 @@ bool Anvil::DescriptorPool::init() descriptor_pool_create_info.pPoolSizes = descriptor_pool_sizes; descriptor_pool_create_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO; - result_vk = vkCreateDescriptorPool(m_device_ptr->get_device_vk(), - &descriptor_pool_create_info, - nullptr, /* pAllocator */ - &m_pool); + result_vk = Anvil::Vulkan::vkCreateDescriptorPool(m_device_ptr->get_device_vk(), + &descriptor_pool_create_info, + nullptr, /* pAllocator */ + &m_pool); anvil_assert_vk_call_succeeded(result_vk); if (is_vk_call_successful(result_vk) ) @@ -330,9 +330,9 @@ bool Anvil::DescriptorPool::reset() /* TODO: Host synchronization to VkDescriptorSetObjects alloc'ed from the pool. */ lock(); { - result_vk = vkResetDescriptorPool(m_device_ptr->get_device_vk(), - m_pool, - 0 /* flags */); + result_vk = Anvil::Vulkan::vkResetDescriptorPool(m_device_ptr->get_device_vk(), + m_pool, + 0 /* flags */); } unlock(); diff --git a/src/wrappers/descriptor_set.cpp b/src/wrappers/descriptor_set.cpp index 77fd41f1..6802f219 100644 --- a/src/wrappers/descriptor_set.cpp +++ b/src/wrappers/descriptor_set.cpp @@ -825,11 +825,11 @@ bool Anvil::DescriptorSet::update_using_core_method() const /* Issue the Vulkan call */ if (m_cached_ds_write_items_vk.size() > 0) { - vkUpdateDescriptorSets(m_device_ptr->get_device_vk(), - static_cast(m_cached_ds_write_items_vk.size() ), - &m_cached_ds_write_items_vk[0], - 0, /* copyCount */ - nullptr); /* pDescriptorCopies */ + Anvil::Vulkan::vkUpdateDescriptorSets(m_device_ptr->get_device_vk(), + static_cast(m_cached_ds_write_items_vk.size() ), + &m_cached_ds_write_items_vk[0], + 0, /* copyCount */ + nullptr); /* pDescriptorCopies */ } m_dirty = false; diff --git a/src/wrappers/descriptor_set_layout.cpp b/src/wrappers/descriptor_set_layout.cpp index ce41c5a3..07270501 100644 --- a/src/wrappers/descriptor_set_layout.cpp +++ b/src/wrappers/descriptor_set_layout.cpp @@ -53,9 +53,9 @@ Anvil::DescriptorSetLayout::~DescriptorSetLayout() { lock(); { - vkDestroyDescriptorSetLayout(m_device_ptr->get_device_vk(), - m_layout, - nullptr /* pAllocator */); + Anvil::Vulkan::vkDestroyDescriptorSetLayout(m_device_ptr->get_device_vk(), + m_layout, + nullptr /* pAllocator */); } unlock(); @@ -207,10 +207,10 @@ bool Anvil::DescriptorSetLayout::init() goto end; } - result_vk = vkCreateDescriptorSetLayout(m_device_ptr->get_device_vk(), - create_info_ptr->struct_chain_ptr->get_root_struct(), - nullptr, /* pAllocator */ - &m_layout); + result_vk = Anvil::Vulkan::vkCreateDescriptorSetLayout(m_device_ptr->get_device_vk(), + create_info_ptr->struct_chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_layout); anvil_assert_vk_call_succeeded(result_vk); if (is_vk_call_successful(result_vk) ) diff --git a/src/wrappers/device.cpp b/src/wrappers/device.cpp index c1d8c0c4..901fc402 100644 --- a/src/wrappers/device.cpp +++ b/src/wrappers/device.cpp @@ -85,8 +85,8 @@ Anvil::BaseDevice::~BaseDevice() { lock(); { - vkDestroyDevice(m_device, - nullptr); /* pAllocator */ + Anvil::Vulkan::vkDestroyDevice(m_device, + nullptr); /* pAllocator */ } unlock(); @@ -106,81 +106,120 @@ Anvil::DescriptorSetLayout* Anvil::BaseDevice::get_dummy_descriptor_set_layout() return m_dummy_dsg_ptr->get_descriptor_set_layout(0); } +const Anvil::ExtensionEXTSampleLocationsEntrypoints& Anvil::BaseDevice::get_extension_ext_sample_locations_entrypoints() const +{ + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->ext_sample_locations() ); + + return m_ext_sample_locations_extension_entrypoints; +} + bool Anvil::BaseDevice::get_memory_types_supported_for_external_handle(const Anvil::ExternalMemoryHandleTypeFlagBits& in_external_handle_type, ExternalHandleType in_handle, uint32_t* out_supported_memory_type_bits) const { bool result = false; - /* Sanity checks */ - #if defined(_WIN32) + if (in_external_handle_type != Anvil::ExternalMemoryHandleTypeFlagBits::HOST_ALLOCATION_BIT_EXT && + in_external_handle_type != Anvil::ExternalMemoryHandleTypeFlagBits::HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT) { - if (!m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_memory_win32() ) + /* Sanity checks */ + #if defined(_WIN32) { - anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_memory_win32() ); + if (!m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_memory_win32() ) + { + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_memory_win32() ); - goto end; - } + goto end; + } - if (in_external_handle_type != Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_WIN32_BIT && - in_external_handle_type != Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_WIN32_KMT_BIT) + if (in_external_handle_type != Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_WIN32_BIT && + in_external_handle_type != Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_WIN32_KMT_BIT) + { + anvil_assert(in_external_handle_type == Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_WIN32_BIT || + in_external_handle_type == Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_WIN32_KMT_BIT); + + goto end; + } + } + #else { - anvil_assert(in_external_handle_type == Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_WIN32_BIT || - in_external_handle_type == Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_WIN32_KMT_BIT); + if (!m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_memory_fd() ) + { + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_memory_fd() ); - goto end; + goto end; + } + + if (in_external_handle_type != Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_FD_BIT) + { + anvil_assert(in_external_handle_type == Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_FD_BIT); + + goto end; + } } - } - #else - { - if (!m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_memory_fd() ) + #endif + + /* Go ahead with the query */ + #if defined(_WIN32) + VkMemoryWin32HandlePropertiesKHR result_props; + + result_props.pNext = nullptr; + result_props.sType = VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR; + #else + VkMemoryFdPropertiesKHR result_props; + + result_props.pNext = nullptr; + result_props.sType = VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR; + #endif + + #if defined(_WIN32) + if (m_khr_external_memory_win32_extension_entrypoints.vkGetMemoryWin32HandlePropertiesKHR(m_device, + static_cast(in_external_handle_type), + in_handle, + &result_props) != VK_SUCCESS) + #else + if (m_khr_external_memory_fd_extension_entrypoints.vkGetMemoryFdPropertiesKHR(m_device, + static_cast(in_external_handle_type), + in_handle, + &result_props) != VK_SUCCESS) + #endif { - anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_memory_fd() ); + anvil_assert_fail(); goto end; } - if (in_external_handle_type != Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_FD_BIT) + *out_supported_memory_type_bits = result_props.memoryTypeBits; + } + else + { + /* Sanity checks */ + if (!m_extension_enabled_info_ptr->get_device_extension_info()->ext_external_memory_host() ) { - anvil_assert(in_external_handle_type == Anvil::ExternalMemoryHandleTypeFlagBits::OPAQUE_FD_BIT); + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->ext_external_memory_host() ); goto end; } - } - #endif - /* Go ahead with the query */ - #if defined(_WIN32) - VkMemoryWin32HandlePropertiesKHR result_props; + /* Go ahead with the query */ + VkMemoryHostPointerPropertiesEXT result_props; result_props.pNext = nullptr; - result_props.sType = VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR; - #else - VkMemoryFdPropertiesKHR result_props; + result_props.sType = VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT; - result_props.pNext = nullptr; - result_props.sType = VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR; - #endif + if (m_ext_external_memory_host_extension_entrypoints.vkGetMemoryHostPointerPropertiesEXT(m_device, + static_cast(in_external_handle_type), + reinterpret_cast(in_handle), + &result_props) != VK_SUCCESS) + { + anvil_assert_fail(); - #if defined(_WIN32) - if (m_khr_external_memory_win32_extension_entrypoints.vkGetMemoryWin32HandlePropertiesKHR(m_device, - static_cast(in_external_handle_type), - in_handle, - &result_props) != VK_SUCCESS) - #else - if (m_khr_external_memory_fd_extension_entrypoints.vkGetMemoryFdPropertiesKHR(m_device, - static_cast(in_external_handle_type), - in_handle, - &result_props) != VK_SUCCESS) - #endif - { - anvil_assert_fail(); + goto end; + } - goto end; + *out_supported_memory_type_bits = result_props.memoryTypeBits; } - *out_supported_memory_type_bits = result_props.memoryTypeBits; - /* All done */ result = true; end: @@ -696,6 +735,13 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, } anvil_assert(m_device != VK_NULL_HANDLE); + if (m_extension_enabled_info_ptr->get_device_extension_info()->amd_buffer_marker() ) + { + m_amd_buffer_marker_extension_entrypoints.vkCmdWriteBufferMarkerAMD = reinterpret_cast(get_proc_address("vkCmdWriteBufferMarkerAMD") ); + + anvil_assert(m_amd_buffer_marker_extension_entrypoints.vkCmdWriteBufferMarkerAMD != nullptr); + } + if (m_extension_enabled_info_ptr->get_device_extension_info()->amd_draw_indirect_count() ) { m_amd_draw_indirect_count_extension_entrypoints.vkCmdDrawIndexedIndirectCountAMD = reinterpret_cast(get_proc_address("vkCmdDrawIndexedIndirectCountAMD") ); @@ -727,6 +773,29 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, anvil_assert(m_ext_debug_marker_extension_entrypoints.vkDebugMarkerSetObjectTagEXT != nullptr); } + if (m_extension_enabled_info_ptr->get_device_extension_info()->ext_external_memory_host() ) + { + m_ext_external_memory_host_extension_entrypoints.vkGetMemoryHostPointerPropertiesEXT = reinterpret_cast(get_proc_address("vkGetMemoryHostPointerPropertiesEXT") ); + + anvil_assert(m_ext_external_memory_host_extension_entrypoints.vkGetMemoryHostPointerPropertiesEXT != nullptr); + } + + if (m_extension_enabled_info_ptr->get_device_extension_info()->ext_hdr_metadata() ) + { + m_ext_hdr_metadata_extension_entrypoints.vkSetHdrMetadataEXT = reinterpret_cast(get_proc_address("vkSetHdrMetadataEXT") ); + + anvil_assert(m_ext_hdr_metadata_extension_entrypoints.vkSetHdrMetadataEXT != nullptr); + } + + if (m_extension_enabled_info_ptr->get_device_extension_info()->ext_sample_locations() ) + { + m_ext_sample_locations_extension_entrypoints.vkCmdSetSampleLocationsEXT = reinterpret_cast (get_proc_address("vkCmdSetSampleLocationsEXT") ); + m_ext_sample_locations_extension_entrypoints.vkGetPhysicalDeviceMultisamplePropertiesEXT = reinterpret_cast(get_proc_address("vkGetPhysicalDeviceMultisamplePropertiesEXT") ); + + anvil_assert(m_ext_sample_locations_extension_entrypoints.vkCmdSetSampleLocationsEXT != nullptr); + anvil_assert(m_ext_sample_locations_extension_entrypoints.vkGetPhysicalDeviceMultisamplePropertiesEXT != nullptr); + } + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_descriptor_update_template() ) { m_khr_descriptor_update_template_extension_entrypoints.vkCreateDescriptorUpdateTemplateKHR = reinterpret_cast (get_proc_address("vkCreateDescriptorUpdateTemplateKHR") ); @@ -1078,7 +1147,7 @@ bool Anvil::BaseDevice::wait_idle() const } } - result_vk = vkDeviceWaitIdle(m_device); + result_vk = Anvil::Vulkan::vkDeviceWaitIdle(m_device); if (mt_safe) { @@ -1304,10 +1373,10 @@ void Anvil::MGPUDevice::create_device(const std::vector& in_extensi { auto struct_chain_ptr = struct_chainer.create_chain(); - result = vkCreateDevice(m_parent_physical_devices.at(0).physical_device_ptr->get_physical_device(), - struct_chain_ptr->get_root_struct(), - nullptr, /* pAllocator */ - &m_device); + result = Anvil::Vulkan::vkCreateDevice(m_parent_physical_devices.at(0).physical_device_ptr->get_physical_device(), + struct_chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_device); anvil_assert_vk_call_succeeded(result); } @@ -1319,6 +1388,7 @@ void Anvil::MGPUDevice::create_device(const std::vector& in_extensi Anvil::SwapchainUniquePtr Anvil::MGPUDevice::create_swapchain(Anvil::RenderingSurface* in_parent_surface_ptr, Anvil::Window* in_window_ptr, Anvil::Format in_image_format, + Anvil::ColorSpaceKHR in_color_space, Anvil::PresentModeKHR in_present_mode, Anvil::ImageUsageFlags in_usage, uint32_t in_n_swapchain_images, @@ -1333,6 +1403,7 @@ Anvil::SwapchainUniquePtr Anvil::MGPUDevice::create_swapchain(Anvil::RenderingSu in_parent_surface_ptr, in_window_ptr, in_image_format, + in_color_space, in_present_mode, in_usage, in_n_swapchain_images); @@ -1473,6 +1544,25 @@ const Anvil::MemoryProperties& Anvil::MGPUDevice::get_physical_device_memory_pro return m_parent_physical_devices.at(0).physical_device_ptr->get_memory_properties(); } +Anvil::MultisamplePropertiesEXT Anvil::MGPUDevice::get_physical_device_multisample_properties(const Anvil::SampleCountFlagBits& in_samples) const +{ + /* NOTE: We're assuming here all physical devices within a device group have the same memory caps. */ + VkMultisamplePropertiesEXT result_vk; + + anvil_assert(is_extension_enabled(VK_EXT_SAMPLE_LOCATIONS_EXTENSION_NAME) ); + + result_vk.maxSampleLocationGridSize.height = 0; + result_vk.maxSampleLocationGridSize.width = 0; + result_vk.pNext = nullptr; + result_vk.sType = VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT; + + m_ext_sample_locations_extension_entrypoints.vkGetPhysicalDeviceMultisamplePropertiesEXT(m_parent_physical_devices.at(0).physical_device_ptr->get_physical_device(), + static_cast(in_samples), + &result_vk); + + return Anvil::MultisamplePropertiesEXT(result_vk); +} + /* Please see header for specification */ const Anvil::PhysicalDeviceProperties& Anvil::MGPUDevice::get_physical_device_properties() const { @@ -1512,27 +1602,27 @@ bool Anvil::MGPUDevice::get_physical_device_sparse_image_format_properties(Anvil /* NOTE: All physical devices within a device group are assumed to report the same sparse image format properties */ uint32_t n_props = 0; - vkGetPhysicalDeviceSparseImageFormatProperties(m_parent_physical_devices.at(0).physical_device_ptr->get_physical_device(), - static_cast (in_format), - static_cast (in_type), - static_cast(in_sample_count), - in_usage.get_vk(), - static_cast(in_tiling), - &n_props, - nullptr); /* pProperties */ + Anvil::Vulkan::vkGetPhysicalDeviceSparseImageFormatProperties(m_parent_physical_devices.at(0).physical_device_ptr->get_physical_device(), + static_cast (in_format), + static_cast (in_type), + static_cast(in_sample_count), + in_usage.get_vk(), + static_cast(in_tiling), + &n_props, + nullptr); /* pProperties */ if (n_props > 0) { out_result.resize(n_props); - vkGetPhysicalDeviceSparseImageFormatProperties(m_parent_physical_devices.at(0).physical_device_ptr->get_physical_device(), - static_cast (in_format), - static_cast (in_type), - static_cast(in_sample_count), - in_usage.get_vk(), - static_cast(in_tiling), - &n_props, - reinterpret_cast(&out_result[0] )); + Anvil::Vulkan::vkGetPhysicalDeviceSparseImageFormatProperties(m_parent_physical_devices.at(0).physical_device_ptr->get_physical_device(), + static_cast (in_format), + static_cast (in_type), + static_cast(in_sample_count), + in_usage.get_vk(), + static_cast(in_tiling), + &n_props, + reinterpret_cast(&out_result[0] )); } return true; @@ -1543,9 +1633,9 @@ bool Anvil::MGPUDevice::get_physical_device_surface_capabilities(Anvil::Renderin Anvil::SurfaceCapabilities* out_result_ptr) const { /* NOTE: All physical devices within a device group are assumed to report the same sparse image format properties */ - return (vkGetPhysicalDeviceSurfaceCapabilitiesKHR(m_parent_physical_devices.at(0).physical_device_ptr->get_physical_device(), - in_surface_ptr->get_surface(), - reinterpret_cast(out_result_ptr) ) == VK_SUCCESS); + return (m_khr_surface_extension_entrypoints.vkGetPhysicalDeviceSurfaceCapabilitiesKHR(m_parent_physical_devices.at(0).physical_device_ptr->get_physical_device(), + in_surface_ptr->get_surface(), + reinterpret_cast(out_result_ptr) ) == VK_SUCCESS); } /* Please see header for specification */ @@ -1886,10 +1976,10 @@ void Anvil::SGPUDevice::create_device(const std::vector& in_extensi create_info.queueCreateInfoCount = static_cast(device_queue_create_info_items.size() ); create_info.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO; - result = vkCreateDevice(m_parent_physical_device_ptr->get_physical_device(), - &create_info, - nullptr, /* pAllocator */ - &m_device); + result = Anvil::Vulkan::vkCreateDevice(m_parent_physical_device_ptr->get_physical_device(), + &create_info, + nullptr, /* pAllocator */ + &m_device); anvil_assert_vk_call_succeeded(result); /* Now that all queues are available, assign them to queue families Anvil recognizes. */ @@ -1900,6 +1990,7 @@ void Anvil::SGPUDevice::create_device(const std::vector& in_extensi Anvil::SwapchainUniquePtr Anvil::SGPUDevice::create_swapchain(Anvil::RenderingSurface* in_parent_surface_ptr, Anvil::Window* in_window_ptr, Anvil::Format in_image_format, + Anvil::ColorSpaceKHR in_color_space, Anvil::PresentModeKHR in_present_mode, Anvil::ImageUsageFlags in_usage, uint32_t in_n_swapchain_images) @@ -1912,6 +2003,7 @@ Anvil::SwapchainUniquePtr Anvil::SGPUDevice::create_swapchain(Anvil::RenderingSu in_parent_surface_ptr, in_window_ptr, in_image_format, + in_color_space, in_present_mode, in_usage, in_n_swapchain_images); @@ -1959,6 +2051,25 @@ bool Anvil::SGPUDevice::get_physical_device_image_format_properties(const ImageF out_opt_result_ptr); } +/** Please see header for specification */ +Anvil::MultisamplePropertiesEXT Anvil::SGPUDevice::get_physical_device_multisample_properties(const Anvil::SampleCountFlagBits& in_samples) const +{ + VkMultisamplePropertiesEXT result_vk; + + anvil_assert(is_extension_enabled(VK_EXT_SAMPLE_LOCATIONS_EXTENSION_NAME) ); + + result_vk.maxSampleLocationGridSize.height = 0; + result_vk.maxSampleLocationGridSize.width = 0; + result_vk.pNext = nullptr; + result_vk.sType = VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT; + + m_ext_sample_locations_extension_entrypoints.vkGetPhysicalDeviceMultisamplePropertiesEXT(m_parent_physical_device_ptr->get_physical_device(), + static_cast(in_samples), + &result_vk); + + return Anvil::MultisamplePropertiesEXT(result_vk); +} + /** Please see header for specification */ const Anvil::MemoryProperties& Anvil::SGPUDevice::get_physical_device_memory_properties() const { @@ -1995,27 +2106,27 @@ bool Anvil::SGPUDevice::get_physical_device_sparse_image_format_properties(Anvil { uint32_t n_props = 0; - vkGetPhysicalDeviceSparseImageFormatProperties(m_parent_physical_device_ptr->get_physical_device(), - static_cast (in_format), - static_cast (in_type), - static_cast(in_sample_count), - in_usage.get_vk(), - static_cast(in_tiling), - &n_props, - nullptr); /* pProperties */ + Anvil::Vulkan::vkGetPhysicalDeviceSparseImageFormatProperties(m_parent_physical_device_ptr->get_physical_device(), + static_cast (in_format), + static_cast (in_type), + static_cast(in_sample_count), + in_usage.get_vk(), + static_cast(in_tiling), + &n_props, + nullptr); /* pProperties */ if (n_props > 0) { out_result.resize(n_props); - vkGetPhysicalDeviceSparseImageFormatProperties(m_parent_physical_device_ptr->get_physical_device(), - static_cast (in_format), - static_cast (in_type), - static_cast(in_sample_count), - in_usage.get_vk(), - static_cast(in_tiling), - &n_props, - reinterpret_cast(&out_result[0]) ); + Anvil::Vulkan::vkGetPhysicalDeviceSparseImageFormatProperties(m_parent_physical_device_ptr->get_physical_device(), + static_cast (in_format), + static_cast (in_type), + static_cast(in_sample_count), + in_usage.get_vk(), + static_cast(in_tiling), + &n_props, + reinterpret_cast(&out_result[0]) ); } return true; @@ -2025,9 +2136,9 @@ bool Anvil::SGPUDevice::get_physical_device_sparse_image_format_properties(Anvil bool Anvil::SGPUDevice::get_physical_device_surface_capabilities(Anvil::RenderingSurface* in_surface_ptr, Anvil::SurfaceCapabilities* out_result_ptr) const { - return (vkGetPhysicalDeviceSurfaceCapabilitiesKHR(m_parent_physical_device_ptr->get_physical_device(), - in_surface_ptr->get_surface(), - reinterpret_cast(out_result_ptr) ) == VK_SUCCESS); + return (m_khr_surface_extension_entrypoints.vkGetPhysicalDeviceSurfaceCapabilitiesKHR(m_parent_physical_device_ptr->get_physical_device(), + in_surface_ptr->get_surface(), + reinterpret_cast(out_result_ptr) ) == VK_SUCCESS); } /* Please see header for specification */ diff --git a/src/wrappers/event.cpp b/src/wrappers/event.cpp index 07c9649d..14023b30 100644 --- a/src/wrappers/event.cpp +++ b/src/wrappers/event.cpp @@ -85,10 +85,10 @@ bool Anvil::Event::init() event_create_info.pNext = nullptr; event_create_info.sType = VK_STRUCTURE_TYPE_EVENT_CREATE_INFO; - result = vkCreateEvent(m_device_ptr->get_device_vk(), - &event_create_info, - nullptr, /* pAllocator */ - &m_event); + result = Anvil::Vulkan::vkCreateEvent(m_device_ptr->get_device_vk(), + &event_create_info, + nullptr, /* pAllocator */ + &m_event); anvil_assert_vk_call_succeeded(result); if (is_vk_call_successful(result) ) @@ -104,8 +104,8 @@ bool Anvil::Event::is_set() const { VkResult result; - result = vkGetEventStatus(m_device_ptr->get_device_vk(), - m_event); + result = Anvil::Vulkan::vkGetEventStatus(m_device_ptr->get_device_vk(), + m_event); anvil_assert(result == VK_EVENT_RESET || result == VK_EVENT_SET); @@ -120,9 +120,9 @@ void Anvil::Event::release_event() { lock(); { - vkDestroyEvent(m_device_ptr->get_device_vk(), - m_event, - nullptr /* pAllocator */); + Anvil::Vulkan::vkDestroyEvent(m_device_ptr->get_device_vk(), + m_event, + nullptr /* pAllocator */); } unlock(); @@ -137,8 +137,8 @@ bool Anvil::Event::reset() lock(); { - result = vkResetEvent(m_device_ptr->get_device_vk(), - m_event); + result = Anvil::Vulkan::vkResetEvent(m_device_ptr->get_device_vk(), + m_event); } unlock(); @@ -154,8 +154,8 @@ bool Anvil::Event::set() lock(); { - result = vkSetEvent(m_device_ptr->get_device_vk(), - m_event); + result = Anvil::Vulkan::vkSetEvent(m_device_ptr->get_device_vk(), + m_event); } unlock(); diff --git a/src/wrappers/fence.cpp b/src/wrappers/fence.cpp index 738cda17..ecad170a 100644 --- a/src/wrappers/fence.cpp +++ b/src/wrappers/fence.cpp @@ -335,10 +335,10 @@ bool Anvil::Fence::init() goto end; } - result = vkCreateFence(m_device_ptr->get_device_vk(), - struct_chain_ptr->get_root_struct(), - nullptr, /* pAllocator */ - &m_fence); + result = Anvil::Vulkan::vkCreateFence(m_device_ptr->get_device_vk(), + struct_chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_fence); anvil_assert_vk_call_succeeded(result); if (is_vk_call_successful(result) ) @@ -355,8 +355,8 @@ bool Anvil::Fence::is_set() const { VkResult result; - result = vkGetFenceStatus(m_device_ptr->get_device_vk(), - m_fence); + result = Anvil::Vulkan::vkGetFenceStatus(m_device_ptr->get_device_vk(), + m_fence); anvil_assert(result == VK_SUCCESS || result == VK_NOT_READY); @@ -371,9 +371,9 @@ void Anvil::Fence::release_fence() { lock(); { - vkDestroyFence(m_device_ptr->get_device_vk(), - m_fence, - nullptr /* pAllocator */); + Anvil::Vulkan::vkDestroyFence(m_device_ptr->get_device_vk(), + m_fence, + nullptr /* pAllocator */); } unlock(); @@ -388,9 +388,9 @@ bool Anvil::Fence::reset() lock(); { - result = vkResetFences(m_device_ptr->get_device_vk(), - 1, /* fenceCount */ - &m_fence); + result = Anvil::Vulkan::vkResetFences(m_device_ptr->get_device_vk(), + 1, /* fenceCount */ + &m_fence); } unlock(); @@ -433,9 +433,9 @@ bool Anvil::Fence::reset_fences(const uint32_t in_n_fences, current_fence.lock(); } { - result_vk = vkResetFences(device_ptr->get_device_vk(), - n_fences_remaining, - (n_fences_remaining > 0) ? &fence_cache.at(0) : nullptr); + result_vk = Anvil::Vulkan::vkResetFences(device_ptr->get_device_vk(), + n_fences_remaining, + (n_fences_remaining > 0) ? &fence_cache.at(0) : nullptr); } for (uint32_t n_fence = 0; n_fence < n_fences_remaining; diff --git a/src/wrappers/framebuffer.cpp b/src/wrappers/framebuffer.cpp index 9dbb6c8c..41db7847 100644 --- a/src/wrappers/framebuffer.cpp +++ b/src/wrappers/framebuffer.cpp @@ -74,9 +74,9 @@ Anvil::Framebuffer::~Framebuffer() /* Destroy the Vulkan framebuffer object */ lock(); { - vkDestroyFramebuffer(m_device_ptr->get_device_vk(), - fb_iterator->second.framebuffer, - nullptr /* pAllocator */); + Anvil::Vulkan::vkDestroyFramebuffer(m_device_ptr->get_device_vk(), + fb_iterator->second.framebuffer, + nullptr /* pAllocator */); } unlock(); } @@ -115,9 +115,9 @@ bool Anvil::Framebuffer::bake(Anvil::RenderPass* in_render_pass_ptr) { lock(); { - vkDestroyFramebuffer(m_device_ptr->get_device_vk(), - baked_fb_iterator->second.framebuffer, - nullptr /* pAllocator */); + Anvil::Vulkan::vkDestroyFramebuffer(m_device_ptr->get_device_vk(), + baked_fb_iterator->second.framebuffer, + nullptr /* pAllocator */); } unlock(); @@ -163,10 +163,10 @@ bool Anvil::Framebuffer::bake(Anvil::RenderPass* in_render_pass_ptr) fb_create_info.width = m_create_info_ptr->get_width(); /* Create the framebuffer instance and store it */ - result_vk = vkCreateFramebuffer(m_device_ptr->get_device_vk(), - &fb_create_info, - nullptr, /* pAllocator */ - &result_fb); + result_vk = Anvil::Vulkan::vkCreateFramebuffer(m_device_ptr->get_device_vk(), + &fb_create_info, + nullptr, /* pAllocator */ + &result_fb); anvil_assert_vk_call_succeeded(result_vk); if (is_vk_call_successful(result_vk) ) diff --git a/src/wrappers/graphics_pipeline_manager.cpp b/src/wrappers/graphics_pipeline_manager.cpp index d3e05052..85e9ce11 100644 --- a/src/wrappers/graphics_pipeline_manager.cpp +++ b/src/wrappers/graphics_pipeline_manager.cpp @@ -104,13 +104,13 @@ bool Anvil::GraphicsPipelineManager::bake() } BakeItem; std::vector bake_items; - auto color_blend_attachment_states_vk_cache = std::vector (); - auto color_blend_state_create_info_items_vk_cache = std::vector (); - auto depth_stencil_state_create_info_items_vk_cache = std::vector (); - auto dynamic_state_create_info_items_vk_cache = std::vector (); - auto graphics_pipeline_create_info_chains = Anvil::StructChainVector(); - auto input_assembly_state_create_info_items_vk_cache = std::vector (); - auto multisample_state_create_info_items_vk_cache = std::vector (); + auto color_blend_attachment_states_vk_cache = std::vector (); + auto color_blend_state_create_info_items_vk_cache = std::vector (); + auto depth_stencil_state_create_info_items_vk_cache = std::vector (); + auto dynamic_state_create_info_items_vk_cache = std::vector (); + auto graphics_pipeline_create_info_chains = Anvil::StructChainVector (); + auto input_assembly_state_create_info_items_vk_cache = std::vector (); + auto multisample_state_create_info_chain_cache = std::vector > >(); std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); uint32_t n_consumed_graphics_pipelines = 0; @@ -148,7 +148,6 @@ bool Anvil::GraphicsPipelineManager::bake() depth_stencil_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); dynamic_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); input_assembly_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - multisample_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); raster_state_create_info_chains_vk_cache.reserve (N_CACHE_ITEMS); scissor_boxes_vk_cache.reserve (N_CACHE_ITEMS); shader_stage_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); @@ -496,35 +495,76 @@ bool Anvil::GraphicsPipelineManager::bake() if (!current_pipeline_create_info_ptr->is_rasterizer_discard_enabled() ) { - const bool is_sample_mask_enabled = current_pipeline_create_info_ptr->is_sample_mask_enabled(); - VkPipelineMultisampleStateCreateInfo multisample_state_create_info; + bool are_custom_sample_locations_enabled = false; + VkExtent2D custom_sample_location_grid_size = {0, 0}; + Anvil::SampleCountFlagBits custom_sample_locations_per_pixel = Anvil::SampleCountFlagBits::NONE; + const Anvil::SampleLocation* custom_sample_locations_ptr = nullptr; + Anvil::StructChainer chainer; + const bool is_sample_mask_enabled = current_pipeline_create_info_ptr->is_sample_mask_enabled(); + uint32_t n_custom_sample_locations = 0; + Anvil::SampleCountFlagBits sample_count = static_cast(0); VkSampleMask sample_mask; current_pipeline_create_info_ptr->get_multisampling_properties(&sample_count, &sample_mask); + current_pipeline_create_info_ptr->get_sample_location_state (&are_custom_sample_locations_enabled, + &custom_sample_locations_per_pixel, + &custom_sample_location_grid_size, + &n_custom_sample_locations, + &custom_sample_locations_ptr); /* If sample mask is not enabled, Vulkan spec will assume all samples need to pass. This is what the default sample mask value mimics. - * + * * Hence, if the application specified a non-~0u sample mask and has NOT enabled the sample mask using toggle_sample_mask(), it's (in * all likelihood) a trivial app-side issue. */ anvil_assert((!is_sample_mask_enabled && sample_mask == ~0u) || is_sample_mask_enabled); - multisample_state_create_info.alphaToCoverageEnable = current_pipeline_create_info_ptr->is_alpha_to_coverage_enabled() ? VK_TRUE : VK_FALSE; - multisample_state_create_info.alphaToOneEnable = current_pipeline_create_info_ptr->is_alpha_to_one_enabled() ? VK_TRUE : VK_FALSE; - multisample_state_create_info.flags = 0; - multisample_state_create_info.minSampleShading = min_sample_shading; - multisample_state_create_info.pNext = nullptr; - multisample_state_create_info.pSampleMask = (is_sample_mask_enabled) ? &sample_mask : nullptr; - multisample_state_create_info.rasterizationSamples = static_cast(sample_count); - multisample_state_create_info.sampleShadingEnable = is_sample_shading_enabled ? VK_TRUE : VK_FALSE; - multisample_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO; + { + VkPipelineMultisampleStateCreateInfo multisample_state_create_info; + + multisample_state_create_info.alphaToCoverageEnable = current_pipeline_create_info_ptr->is_alpha_to_coverage_enabled() ? VK_TRUE : VK_FALSE; + multisample_state_create_info.alphaToOneEnable = current_pipeline_create_info_ptr->is_alpha_to_one_enabled() ? VK_TRUE : VK_FALSE; + multisample_state_create_info.flags = 0; + multisample_state_create_info.minSampleShading = min_sample_shading; + multisample_state_create_info.pNext = nullptr; + multisample_state_create_info.pSampleMask = (is_sample_mask_enabled) ? &sample_mask : nullptr; + multisample_state_create_info.rasterizationSamples = static_cast(sample_count); + multisample_state_create_info.sampleShadingEnable = is_sample_shading_enabled ? VK_TRUE : VK_FALSE; + multisample_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO; + + chainer.append_struct(multisample_state_create_info); + } + + if (are_custom_sample_locations_enabled) + { + VkPipelineSampleLocationsStateCreateInfoEXT psl_state_create_info; + VkSampleLocationsInfoEXT sample_locations_info; + + sample_locations_info.pNext = nullptr; + sample_locations_info.pSampleLocations = reinterpret_cast(custom_sample_locations_ptr); + sample_locations_info.sampleLocationGridSize = custom_sample_location_grid_size; + sample_locations_info.sampleLocationsCount = n_custom_sample_locations; + sample_locations_info.sampleLocationsPerPixel = static_cast(custom_sample_locations_per_pixel); + sample_locations_info.sType = VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT; + + psl_state_create_info.pNext = nullptr; + psl_state_create_info.sampleLocationsEnable = VK_TRUE; + psl_state_create_info.sampleLocationsInfo = sample_locations_info; + psl_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT; + + anvil_assert(m_device_ptr->get_extension_info()->ext_sample_locations() ); + + chainer.append_struct(psl_state_create_info); + } multisample_state_used = true; - multisample_state_create_info_items_vk_cache.push_back(multisample_state_create_info); + multisample_state_create_info_chain_cache.push_back( + std::move(chainer.create_chain() ) + ); } else { @@ -955,17 +995,21 @@ bool Anvil::GraphicsPipelineManager::bake() graphics_pipeline_create_info.basePipelineIndex = static_cast(base_bake_item_iterator - bake_items.begin() ); } else - if (base_bake_item_iterator->pipeline_ptr != nullptr && - base_bake_item_iterator->pipeline_ptr->baked_pipeline != VK_NULL_HANDLE) { - /* Case 2 */ - graphics_pipeline_create_info.basePipelineHandle = base_bake_item_iterator->pipeline_ptr->baked_pipeline; - graphics_pipeline_create_info.basePipelineIndex = UINT32_MAX; - } - else - { - /* Case 3 */ - anvil_assert_fail(); + auto baked_pipeline_iterator = m_baked_pipelines.find(current_pipeline_base_pipeline_id); + + if (baked_pipeline_iterator != m_baked_pipelines.end() && + baked_pipeline_iterator->second->baked_pipeline != VK_NULL_HANDLE) + { + /* Case 2 */ + graphics_pipeline_create_info.basePipelineHandle = baked_pipeline_iterator->second->baked_pipeline; + graphics_pipeline_create_info.basePipelineIndex = UINT32_MAX; + } + else + { + /* Case 3 */ + anvil_assert_fail(); + } } } else @@ -987,7 +1031,7 @@ bool Anvil::GraphicsPipelineManager::bake() graphics_pipeline_create_info.pDynamicState = (dynamic_state_used) ? &dynamic_state_create_info_items_vk_cache[dynamic_state_create_info_items_vk_cache.size() - 1] : VK_NULL_HANDLE; graphics_pipeline_create_info.pInputAssemblyState = &input_assembly_state_create_info_items_vk_cache[input_assembly_state_create_info_items_vk_cache.size() - 1]; - graphics_pipeline_create_info.pMultisampleState = (multisample_state_used) ? &multisample_state_create_info_items_vk_cache[multisample_state_create_info_items_vk_cache.size() - 1] + graphics_pipeline_create_info.pMultisampleState = (multisample_state_used) ? multisample_state_create_info_chain_cache.at(multisample_state_create_info_chain_cache.size() - 1)->root_struct_ptr : VK_NULL_HANDLE; graphics_pipeline_create_info.pNext = nullptr; graphics_pipeline_create_info.pRasterizationState = raster_state_create_info_chains_vk_cache.at(raster_state_create_info_chains_vk_cache.size() - 1)->root_struct_ptr; @@ -1034,13 +1078,10 @@ bool Anvil::GraphicsPipelineManager::bake() anvil_assert(depth_stencil_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(dynamic_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(input_assembly_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(multisample_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(raster_state_create_info_chains_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(scissor_boxes_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(shader_stage_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(specialization_info_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(specialization_map_entry_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(tessellation_state_create_info_chain_cache.size() <= N_CACHE_ITEMS); anvil_assert(viewport_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); anvil_assert(viewports_vk_cache.size() <= N_CACHE_ITEMS); } @@ -1051,12 +1092,12 @@ bool Anvil::GraphicsPipelineManager::bake() m_pipeline_cache_ptr->lock(); { - result_vk = vkCreateGraphicsPipelines(m_device_ptr->get_device_vk(), - m_pipeline_cache_ptr->get_pipeline_cache(), - graphics_pipeline_create_info_chains.get_n_structs (), - graphics_pipeline_create_info_chains.get_root_structs(), - nullptr, /* pAllocator */ - &result_graphics_pipelines[0]); + result_vk = Anvil::Vulkan::vkCreateGraphicsPipelines(m_device_ptr->get_device_vk(), + m_pipeline_cache_ptr->get_pipeline_cache(), + graphics_pipeline_create_info_chains.get_n_structs (), + graphics_pipeline_create_info_chains.get_root_structs(), + nullptr, /* pAllocator */ + &result_graphics_pipelines[0]); } m_pipeline_cache_ptr->unlock(); diff --git a/src/wrappers/image.cpp b/src/wrappers/image.cpp index 869a9b82..7eafb8b1 100644 --- a/src/wrappers/image.cpp +++ b/src/wrappers/image.cpp @@ -154,6 +154,7 @@ void Anvil::Image::change_image_layout(Anvil::Queue* in_qu in_queue_ptr->submit( Anvil::SubmitInfo::create_execute(&cmd_buffer_submission, + 1, /* in_n_command_buffer_submissions */ true /* should_block */) ); } @@ -614,13 +615,36 @@ bool Anvil::Image::init() struct_chainer.append_struct(external_memory_image_create_info); } + { + const Anvil::Format* compatible_image_view_formats = nullptr; + uint32_t n_compatible_image_view_formats = 0; + + m_create_info_ptr->get_image_view_formats(&n_compatible_image_view_formats, + &compatible_image_view_formats); + + if (n_compatible_image_view_formats > 0) + { + VkImageFormatListCreateInfoKHR image_format_list_create_info; + + anvil_assert((image_flags & Anvil::ImageCreateFlagBits::MUTABLE_FORMAT_BIT) != 0); + anvil_assert(m_device_ptr->get_extension_info()->khr_image_format_list() ); + + image_format_list_create_info.pNext = nullptr; + image_format_list_create_info.pViewFormats = reinterpret_cast(compatible_image_view_formats); + image_format_list_create_info.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR; + image_format_list_create_info.viewFormatCount = n_compatible_image_view_formats; + + struct_chainer.append_struct(image_format_list_create_info); + } + } + { auto struct_chain_ptr = struct_chainer.create_chain(); - result = vkCreateImage(m_device_ptr->get_device_vk(), - struct_chain_ptr->get_root_struct(), - nullptr, /* pAllocator */ - &m_image); + result = Anvil::Vulkan::vkCreateImage(m_device_ptr->get_device_vk(), + struct_chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_image); } if (!is_vk_call_successful(result) ) @@ -675,9 +699,9 @@ bool Anvil::Image::init() } else { - vkGetImageMemoryRequirements(m_device_ptr->get_device_vk(), - m_image, - &m_memory_reqs); + Anvil::Vulkan::vkGetImageMemoryRequirements(m_device_ptr->get_device_vk(), + m_image, + &m_memory_reqs); } m_alignment = m_memory_reqs.alignment; @@ -713,10 +737,10 @@ bool Anvil::Image::init() subresource.mip_level = n_mip; - vkGetImageSubresourceLayout(m_device_ptr->get_device_vk(), - m_image, - reinterpret_cast(&subresource), - reinterpret_cast (&subresource_layout) ); + Anvil::Vulkan::vkGetImageSubresourceLayout(m_device_ptr->get_device_vk(), + m_image, + reinterpret_cast(&subresource), + reinterpret_cast (&subresource_layout) ); m_aspects[static_cast(current_aspect.get_vk() )][LayerMipKey(n_layer, n_mip)] = subresource_layout; } @@ -777,18 +801,18 @@ bool Anvil::Image::init() } else { - vkGetImageSparseMemoryRequirements(m_device_ptr->get_device_vk(), - m_image, - &n_reqs, - nullptr); + Anvil::Vulkan::vkGetImageSparseMemoryRequirements(m_device_ptr->get_device_vk(), + m_image, + &n_reqs, + nullptr); anvil_assert(n_reqs >= 1); sparse_image_memory_reqs.resize(n_reqs); - vkGetImageSparseMemoryRequirements(m_device_ptr->get_device_vk(), - m_image, - &n_reqs, - reinterpret_cast(&sparse_image_memory_reqs[0]) ); + Anvil::Vulkan::vkGetImageSparseMemoryRequirements(m_device_ptr->get_device_vk(), + m_image, + &n_reqs, + reinterpret_cast(&sparse_image_memory_reqs[0]) ); } for (const auto& image_memory_req : sparse_image_memory_reqs) @@ -1110,9 +1134,9 @@ Anvil::Image::~Image() { lock(); { - vkDestroyImage(m_device_ptr->get_device_vk(), - m_image, - nullptr /* pAllocator */); + Anvil::Vulkan::vkDestroyImage(m_device_ptr->get_device_vk(), + m_image, + nullptr /* pAllocator */); } unlock(); @@ -2082,10 +2106,10 @@ bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, { lock(); { - result = vkBindImageMemory(m_device_ptr->get_device_vk(), - m_image, - in_memory_block_ptr->get_memory(), - in_memory_block_ptr->get_start_offset() ); + result = Anvil::Vulkan::vkBindImageMemory(m_device_ptr->get_device_vk(), + m_image, + in_memory_block_ptr->get_memory(), + in_memory_block_ptr->get_start_offset() ); } unlock(); } @@ -2530,10 +2554,10 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p image_subresource.aspect_mask = current_aspect; image_subresource.mip_level = current_mipmap_raw_data_item_ptr->n_mipmap; - vkGetImageSubresourceLayout(m_device_ptr->get_device_vk(), - m_image, - reinterpret_cast(&image_subresource), - reinterpret_cast (&image_subresource_layout) ); + Anvil::Vulkan::vkGetImageSubresourceLayout(m_device_ptr->get_device_vk(), + m_image, + reinterpret_cast(&image_subresource), + reinterpret_cast (&image_subresource_layout) ); /* Determine row size for the mipmap. * diff --git a/src/wrappers/image_view.cpp b/src/wrappers/image_view.cpp index c3e2e5f8..ff76a511 100644 --- a/src/wrappers/image_view.cpp +++ b/src/wrappers/image_view.cpp @@ -73,9 +73,9 @@ Anvil::ImageView::~ImageView() { lock(); { - vkDestroyImageView(m_device_ptr->get_device_vk(), - m_image_view, - nullptr /* pAllocator */); + Anvil::Vulkan::vkDestroyImageView(m_device_ptr->get_device_vk(), + m_image_view, + nullptr /* pAllocator */); } unlock(); @@ -255,10 +255,10 @@ bool Anvil::ImageView::init() { auto chain_ptr = struct_chainer.create_chain(); - result_vk = vkCreateImageView(m_device_ptr->get_device_vk(), - chain_ptr->get_root_struct(), - nullptr, /* pAllocator */ - &m_image_view); + result_vk = Anvil::Vulkan::vkCreateImageView(m_device_ptr->get_device_vk(), + chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_image_view); } if (!is_vk_call_successful(result_vk) ) diff --git a/src/wrappers/instance.cpp b/src/wrappers/instance.cpp index c04da0ee..2c23750d 100644 --- a/src/wrappers/instance.cpp +++ b/src/wrappers/instance.cpp @@ -25,6 +25,15 @@ #include "wrappers/instance.h" #include "wrappers/physical_device.h" +#if !defined(ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB) + static bool g_core_func_ptrs_inited = false; + static bool g_instance_func_ptrs_inited = false; +#endif + +static std::mutex g_vk10_func_ptr_init_mutex; +static Anvil::LibraryUniquePtr g_vk10_library_ptr; + + /** Please see header for specification */ Anvil::Instance::Instance(const std::string& in_app_name, const std::string& in_engine_name, @@ -35,6 +44,7 @@ Anvil::Instance::Instance(const std::string& in_app_name, m_debug_callback_data (0), m_engine_name (in_engine_name), m_global_layer (""), + m_instance (VK_NULL_HANDLE), m_validation_callback_function(in_opt_validation_callback_function) { Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_INSTANCE, @@ -53,8 +63,8 @@ Anvil::Instance::~Instance() { lock(); { - vkDestroyInstance(m_instance, - nullptr /* pAllocator */); + Anvil::Vulkan::vkDestroyInstance(m_instance, + nullptr /* pAllocator */); } unlock(); @@ -155,14 +165,14 @@ void Anvil::Instance::enumerate_instance_layers() ANVIL_REDUNDANT_VARIABLE(result); /* Retrieve layer data */ - result = vkEnumerateInstanceLayerProperties(&n_layers, - nullptr); /* pProperties */ + result = Anvil::Vulkan::vkEnumerateInstanceLayerProperties(&n_layers, + nullptr); /* pProperties */ anvil_assert_vk_call_succeeded(result); layer_props.resize(n_layers + 1 /* global layer */); - result = vkEnumerateInstanceLayerProperties(&n_layers, - &layer_props[0]); + result = Anvil::Vulkan::vkEnumerateInstanceLayerProperties(&n_layers, + &layer_props[0]); anvil_assert_vk_call_succeeded(result); @@ -206,9 +216,9 @@ void Anvil::Instance::enumerate_layer_extensions(Anvil::Layer* in_layer_ptr) } layer_name = in_layer_ptr->name.c_str(); - result = vkEnumerateInstanceExtensionProperties(layer_name, - &n_extensions, - nullptr); /* pProperties */ + result = Anvil::Vulkan::vkEnumerateInstanceExtensionProperties(layer_name, + &n_extensions, + nullptr); /* pProperties */ anvil_assert_vk_call_succeeded(result); @@ -218,9 +228,9 @@ void Anvil::Instance::enumerate_layer_extensions(Anvil::Layer* in_layer_ptr) extension_props.resize(n_extensions); - result = vkEnumerateInstanceExtensionProperties(layer_name, - &n_extensions, - &extension_props[0]); + result = Anvil::Vulkan::vkEnumerateInstanceExtensionProperties(layer_name, + &n_extensions, + &extension_props[0]); anvil_assert_vk_call_succeeded(result); @@ -310,9 +320,9 @@ void Anvil::Instance::enumerate_physical_devices() ANVIL_REDUNDANT_VARIABLE(result); /* Retrieve physical device handles */ - result = vkEnumeratePhysicalDevices(m_instance, - &n_physical_devices, - nullptr); /* pPhysicalDevices */ + result = Anvil::Vulkan::vkEnumeratePhysicalDevices(m_instance, + &n_physical_devices, + nullptr); /* pPhysicalDevices */ anvil_assert_vk_call_succeeded(result); if (n_physical_devices == 0) @@ -325,9 +335,9 @@ void Anvil::Instance::enumerate_physical_devices() devices.resize(n_physical_devices); - result = vkEnumeratePhysicalDevices(m_instance, - &n_physical_devices, - &devices[0]); + result = Anvil::Vulkan::vkEnumeratePhysicalDevices(m_instance, + &n_physical_devices, + &devices[0]); anvil_assert_vk_call_succeeded(result); /* Fill out internal physical device descriptors */ @@ -430,6 +440,16 @@ void Anvil::Instance::init(const std::vector& in_disallowed_instanc ANVIL_REDUNDANT_VARIABLE(result); + #if !defined(ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB) + { + if (!init_vk10_func_ptrs() ) + { + /* TODO: Return null instance in case of a failure */ + anvil_assert_fail(); + } + } + #endif + /* Enumerate available layers */ enumerate_instance_layers(); @@ -582,13 +602,24 @@ void Anvil::Instance::init(const std::vector& in_disallowed_instanc create_info.ppEnabledLayerNames = (enabled_layers.size() > 0) ? &enabled_layers [0] : nullptr; create_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; - result = vkCreateInstance(&create_info, - nullptr, /* pAllocator */ - &m_instance); + result = Anvil::Vulkan::vkCreateInstance(&create_info, + nullptr, /* pAllocator */ + &m_instance); anvil_assert_vk_call_succeeded(result); /* Continue initializing */ + #if !defined(ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB) + { + /* Retrieve the remaining part of instance-dependent function pointers */ + if (!init_vk10_func_ptrs() ) + { + /* TODO: Return null instance in case of a failure */ + anvil_assert_fail(); + } + } + #endif + init_func_pointers(); if (m_validation_callback_function != nullptr) @@ -630,21 +661,21 @@ void Anvil::Instance::init_debug_callbacks() /** Initializes all required instance-level function pointers. */ void Anvil::Instance::init_func_pointers() { - m_khr_surface_entrypoints.vkDestroySurfaceKHR = reinterpret_cast (vkGetInstanceProcAddr(m_instance, - "vkDestroySurfaceKHR") ); - m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceCapabilitiesKHR = reinterpret_cast(vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceSurfaceCapabilitiesKHR") ); - m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceFormatsKHR = reinterpret_cast (vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceSurfaceFormatsKHR") ); - m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfacePresentModesKHR = reinterpret_cast(vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceSurfacePresentModesKHR") ); - m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceSupportKHR = reinterpret_cast (vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceSurfaceSupportKHR") ); - - m_ext_debug_report_entrypoints.vkCreateDebugReportCallbackEXT = reinterpret_cast (vkGetInstanceProcAddr(m_instance, - "vkCreateDebugReportCallbackEXT") ); - m_ext_debug_report_entrypoints.vkDestroyDebugReportCallbackEXT = reinterpret_cast(vkGetInstanceProcAddr(m_instance, - "vkDestroyDebugReportCallbackEXT") ); + m_khr_surface_entrypoints.vkDestroySurfaceKHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkDestroySurfaceKHR") ); + m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceCapabilitiesKHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceSurfaceCapabilitiesKHR") ); + m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceFormatsKHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceSurfaceFormatsKHR") ); + m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfacePresentModesKHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceSurfacePresentModesKHR") ); + m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceSupportKHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceSurfaceSupportKHR") ); + + m_ext_debug_report_entrypoints.vkCreateDebugReportCallbackEXT = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkCreateDebugReportCallbackEXT") ); + m_ext_debug_report_entrypoints.vkDestroyDebugReportCallbackEXT = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkDestroyDebugReportCallbackEXT") ); anvil_assert(m_khr_surface_entrypoints.vkDestroySurfaceKHR != nullptr); anvil_assert(m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceCapabilitiesKHR != nullptr); @@ -656,10 +687,10 @@ void Anvil::Instance::init_func_pointers() { #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) { - m_khr_win32_surface_entrypoints.vkCreateWin32SurfaceKHR = reinterpret_cast (vkGetInstanceProcAddr(m_instance, - "vkCreateWin32SurfaceKHR") ); - m_khr_win32_surface_entrypoints.vkGetPhysicalDeviceWin32PresentationSupportKHR = reinterpret_cast(vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceWin32PresentationSupportKHR") ); + m_khr_win32_surface_entrypoints.vkCreateWin32SurfaceKHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkCreateWin32SurfaceKHR") ); + m_khr_win32_surface_entrypoints.vkGetPhysicalDeviceWin32PresentationSupportKHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceWin32PresentationSupportKHR") ); anvil_assert(m_khr_win32_surface_entrypoints.vkCreateWin32SurfaceKHR != nullptr); anvil_assert(m_khr_win32_surface_entrypoints.vkGetPhysicalDeviceWin32PresentationSupportKHR != nullptr); @@ -670,8 +701,8 @@ void Anvil::Instance::init_func_pointers() { #if defined(ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT) { - m_khr_xcb_surface_entrypoints.vkCreateXcbSurfaceKHR = reinterpret_cast(vkGetInstanceProcAddr(m_instance, - "vkCreateXcbSurfaceKHR") ); + m_khr_xcb_surface_entrypoints.vkCreateXcbSurfaceKHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkCreateXcbSurfaceKHR") ); anvil_assert(m_khr_xcb_surface_entrypoints.vkCreateXcbSurfaceKHR != nullptr); } @@ -681,20 +712,20 @@ void Anvil::Instance::init_func_pointers() if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_get_physical_device_properties2() ) { - m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceFeatures2KHR = reinterpret_cast (vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceFeatures2KHR") ); - m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceFormatProperties2KHR = reinterpret_cast (vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceFormatProperties2KHR") ); - m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceImageFormatProperties2KHR = reinterpret_cast (vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceImageFormatProperties2KHR") ); - m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceMemoryProperties2KHR = reinterpret_cast (vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceMemoryProperties2KHR") ); - m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceProperties2KHR = reinterpret_cast (vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceProperties2KHR") ); - m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceQueueFamilyProperties2KHR = reinterpret_cast (vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceQueueFamilyProperties2KHR") ); - m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceSparseImageFormatProperties2KHR = reinterpret_cast(vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceSparseImageFormatProperties2KHR") ); + m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceFeatures2KHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceFeatures2KHR") ); + m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceFormatProperties2KHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceFormatProperties2KHR") ); + m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceImageFormatProperties2KHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceImageFormatProperties2KHR") ); + m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceMemoryProperties2KHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceMemoryProperties2KHR") ); + m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceProperties2KHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceProperties2KHR") ); + m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceQueueFamilyProperties2KHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceQueueFamilyProperties2KHR") ); + m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceSparseImageFormatProperties2KHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceSparseImageFormatProperties2KHR") ); anvil_assert(m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceFeatures2KHR != nullptr); anvil_assert(m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceFormatProperties2KHR != nullptr); @@ -707,37 +738,254 @@ void Anvil::Instance::init_func_pointers() if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_device_group_creation() ) { - m_khr_device_group_creation_entrypoints.vkEnumeratePhysicalDeviceGroupsKHR = reinterpret_cast(vkGetInstanceProcAddr(m_instance, - "vkEnumeratePhysicalDeviceGroupsKHR") ); + m_khr_device_group_creation_entrypoints.vkEnumeratePhysicalDeviceGroupsKHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkEnumeratePhysicalDeviceGroupsKHR") ); anvil_assert(m_khr_device_group_creation_entrypoints.vkEnumeratePhysicalDeviceGroupsKHR != nullptr); } if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_external_fence_capabilities() ) { - m_khr_external_fence_capabilities_entrypoints.vkGetPhysicalDeviceExternalFencePropertiesKHR = reinterpret_cast(vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceExternalFencePropertiesKHR") ); + m_khr_external_fence_capabilities_entrypoints.vkGetPhysicalDeviceExternalFencePropertiesKHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceExternalFencePropertiesKHR") ); anvil_assert(m_khr_external_fence_capabilities_entrypoints.vkGetPhysicalDeviceExternalFencePropertiesKHR!= nullptr); } if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_external_memory_capabilities() ) { - m_khr_external_memory_capabilities_entrypoints.vkGetPhysicalDeviceExternalBufferPropertiesKHR = reinterpret_cast(vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceExternalBufferPropertiesKHR") ); + m_khr_external_memory_capabilities_entrypoints.vkGetPhysicalDeviceExternalBufferPropertiesKHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceExternalBufferPropertiesKHR") ); anvil_assert(m_khr_external_memory_capabilities_entrypoints.vkGetPhysicalDeviceExternalBufferPropertiesKHR != nullptr); } if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_external_semaphore_capabilities() ) { - m_khr_external_semaphore_capabilities_entrypoints.vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = reinterpret_cast(vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR") ); + m_khr_external_semaphore_capabilities_entrypoints.vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR") ); anvil_assert(m_khr_external_semaphore_capabilities_entrypoints.vkGetPhysicalDeviceExternalSemaphorePropertiesKHR!= nullptr); } } +#if !defined(ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB) + bool Anvil::Instance::init_vk10_func_ptrs() + { + std::lock_guard lock (g_vk10_func_ptr_init_mutex); + bool result(true); + + struct + { + std::string func_name; + bool requires_getter_call; + void** result_func_ptr; + } functions[] = + { + /* NOTE: All functions with @param requires_getter_cal equal to false should come first! */ + {"vkCreateInstance", false, reinterpret_cast(&Anvil::Vulkan::vkCreateInstance)}, + {"vkDestroyInstance", false, reinterpret_cast(&Anvil::Vulkan::vkDestroyInstance)}, + {"vkEnumeratePhysicalDevices", false, reinterpret_cast(&Anvil::Vulkan::vkEnumeratePhysicalDevices)}, + {"vkEnumerateInstanceExtensionProperties", false, reinterpret_cast(&Anvil::Vulkan::vkEnumerateInstanceExtensionProperties)}, + {"vkEnumerateInstanceLayerProperties", false, reinterpret_cast(&Anvil::Vulkan::vkEnumerateInstanceLayerProperties)}, + {"vkGetDeviceProcAddr", false, reinterpret_cast(&Anvil::Vulkan::vkGetDeviceProcAddr)}, + {"vkGetInstanceProcAddr", false, reinterpret_cast(&Anvil::Vulkan::vkGetInstanceProcAddr)}, + + /* instance-dependent functions */ + {"vkGetPhysicalDeviceFeatures", true, reinterpret_cast(&Anvil::Vulkan::vkGetPhysicalDeviceFeatures)}, + {"vkGetPhysicalDeviceFormatProperties", true, reinterpret_cast(&Anvil::Vulkan::vkGetPhysicalDeviceFormatProperties)}, + {"vkGetPhysicalDeviceImageFormatProperties", true, reinterpret_cast(&Anvil::Vulkan::vkGetPhysicalDeviceImageFormatProperties)}, + {"vkGetPhysicalDeviceProperties", true, reinterpret_cast(&Anvil::Vulkan::vkGetPhysicalDeviceProperties)}, + {"vkGetPhysicalDeviceQueueFamilyProperties", true, reinterpret_cast(&Anvil::Vulkan::vkGetPhysicalDeviceQueueFamilyProperties)}, + {"vkGetPhysicalDeviceMemoryProperties", true, reinterpret_cast(&Anvil::Vulkan::vkGetPhysicalDeviceMemoryProperties)}, + {"vkCreateDevice", true, reinterpret_cast(&Anvil::Vulkan::vkCreateDevice)}, + {"vkDestroyDevice", true, reinterpret_cast(&Anvil::Vulkan::vkDestroyDevice)}, + {"vkEnumerateDeviceExtensionProperties", true, reinterpret_cast(&Anvil::Vulkan::vkEnumerateDeviceExtensionProperties)}, + {"vkEnumerateDeviceLayerProperties", true, reinterpret_cast(&Anvil::Vulkan::vkEnumerateDeviceLayerProperties)}, + {"vkGetDeviceQueue", true, reinterpret_cast(&Anvil::Vulkan::vkGetDeviceQueue)}, + {"vkQueueSubmit", true, reinterpret_cast(&Anvil::Vulkan::vkQueueSubmit)}, + {"vkQueueWaitIdle", true, reinterpret_cast(&Anvil::Vulkan::vkQueueWaitIdle)}, + {"vkDeviceWaitIdle", true, reinterpret_cast(&Anvil::Vulkan::vkDeviceWaitIdle)}, + {"vkAllocateMemory", true, reinterpret_cast(&Anvil::Vulkan::vkAllocateMemory)}, + {"vkFreeMemory", true, reinterpret_cast(&Anvil::Vulkan::vkFreeMemory)}, + {"vkMapMemory", true, reinterpret_cast(&Anvil::Vulkan::vkMapMemory)}, + {"vkUnmapMemory", true, reinterpret_cast(&Anvil::Vulkan::vkUnmapMemory)}, + {"vkFlushMappedMemoryRanges", true, reinterpret_cast(&Anvil::Vulkan::vkFlushMappedMemoryRanges)}, + {"vkInvalidateMappedMemoryRanges", true, reinterpret_cast(&Anvil::Vulkan::vkInvalidateMappedMemoryRanges)}, + {"vkGetDeviceMemoryCommitment", true, reinterpret_cast(&Anvil::Vulkan::vkGetDeviceMemoryCommitment)}, + {"vkBindBufferMemory", true, reinterpret_cast(&Anvil::Vulkan::vkBindBufferMemory)}, + {"vkBindImageMemory", true, reinterpret_cast(&Anvil::Vulkan::vkBindImageMemory)}, + {"vkGetBufferMemoryRequirements", true, reinterpret_cast(&Anvil::Vulkan::vkGetBufferMemoryRequirements)}, + {"vkGetImageMemoryRequirements", true, reinterpret_cast(&Anvil::Vulkan::vkGetImageMemoryRequirements)}, + {"vkGetImageSparseMemoryRequirements", true, reinterpret_cast(&Anvil::Vulkan::vkGetImageSparseMemoryRequirements)}, + {"vkGetPhysicalDeviceSparseImageFormatProperties", true, reinterpret_cast(&Anvil::Vulkan::vkGetPhysicalDeviceSparseImageFormatProperties)}, + {"vkQueueBindSparse", true, reinterpret_cast(&Anvil::Vulkan::vkQueueBindSparse)}, + {"vkCreateFence", true, reinterpret_cast(&Anvil::Vulkan::vkCreateFence)}, + {"vkDestroyFence", true, reinterpret_cast(&Anvil::Vulkan::vkDestroyFence)}, + {"vkResetFences", true, reinterpret_cast(&Anvil::Vulkan::vkResetFences)}, + {"vkGetFenceStatus", true, reinterpret_cast(&Anvil::Vulkan::vkGetFenceStatus)}, + {"vkWaitForFences", true, reinterpret_cast(&Anvil::Vulkan::vkWaitForFences)}, + {"vkCreateSemaphore", true, reinterpret_cast(&Anvil::Vulkan::vkCreateSemaphore)}, + {"vkDestroySemaphore", true, reinterpret_cast(&Anvil::Vulkan::vkDestroySemaphore)}, + {"vkCreateEvent", true, reinterpret_cast(&Anvil::Vulkan::vkCreateEvent)}, + {"vkDestroyEvent", true, reinterpret_cast(&Anvil::Vulkan::vkDestroyEvent)}, + {"vkGetEventStatus", true, reinterpret_cast(&Anvil::Vulkan::vkGetEventStatus)}, + {"vkSetEvent", true, reinterpret_cast(&Anvil::Vulkan::vkSetEvent)}, + {"vkResetEvent", true, reinterpret_cast(&Anvil::Vulkan::vkResetEvent)}, + {"vkCreateQueryPool", true, reinterpret_cast(&Anvil::Vulkan::vkCreateQueryPool)}, + {"vkDestroyQueryPool", true, reinterpret_cast(&Anvil::Vulkan::vkDestroyQueryPool)}, + {"vkGetQueryPoolResults", true, reinterpret_cast(&Anvil::Vulkan::vkGetQueryPoolResults)}, + {"vkCreateBuffer", true, reinterpret_cast(&Anvil::Vulkan::vkCreateBuffer)}, + {"vkDestroyBuffer", true, reinterpret_cast(&Anvil::Vulkan::vkDestroyBuffer)}, + {"vkCreateBufferView", true, reinterpret_cast(&Anvil::Vulkan::vkCreateBufferView)}, + {"vkDestroyBufferView", true, reinterpret_cast(&Anvil::Vulkan::vkDestroyBufferView)}, + {"vkCreateImage", true, reinterpret_cast(&Anvil::Vulkan::vkCreateImage)}, + {"vkDestroyImage", true, reinterpret_cast(&Anvil::Vulkan::vkDestroyImage)}, + {"vkGetImageSubresourceLayout", true, reinterpret_cast(&Anvil::Vulkan::vkGetImageSubresourceLayout)}, + {"vkCreateImageView", true, reinterpret_cast(&Anvil::Vulkan::vkCreateImageView)}, + {"vkDestroyImageView", true, reinterpret_cast(&Anvil::Vulkan::vkDestroyImageView)}, + {"vkCreateShaderModule", true, reinterpret_cast(&Anvil::Vulkan::vkCreateShaderModule)}, + {"vkDestroyShaderModule", true, reinterpret_cast(&Anvil::Vulkan::vkDestroyShaderModule)}, + {"vkCreatePipelineCache", true, reinterpret_cast(&Anvil::Vulkan::vkCreatePipelineCache)}, + {"vkDestroyPipelineCache", true, reinterpret_cast(&Anvil::Vulkan::vkDestroyPipelineCache)}, + {"vkGetPipelineCacheData", true, reinterpret_cast(&Anvil::Vulkan::vkGetPipelineCacheData)}, + {"vkMergePipelineCaches", true, reinterpret_cast(&Anvil::Vulkan::vkMergePipelineCaches)}, + {"vkCreateGraphicsPipelines", true, reinterpret_cast(&Anvil::Vulkan::vkCreateGraphicsPipelines)}, + {"vkCreateComputePipelines", true, reinterpret_cast(&Anvil::Vulkan::vkCreateComputePipelines)}, + {"vkDestroyPipeline", true, reinterpret_cast(&Anvil::Vulkan::vkDestroyPipeline)}, + {"vkCreatePipelineLayout", true, reinterpret_cast(&Anvil::Vulkan::vkCreatePipelineLayout)}, + {"vkDestroyPipelineLayout", true, reinterpret_cast(&Anvil::Vulkan::vkDestroyPipelineLayout)}, + {"vkCreateSampler", true, reinterpret_cast(&Anvil::Vulkan::vkCreateSampler)}, + {"vkDestroySampler", true, reinterpret_cast(&Anvil::Vulkan::vkDestroySampler)}, + {"vkCreateDescriptorSetLayout", true, reinterpret_cast(&Anvil::Vulkan::vkCreateDescriptorSetLayout)}, + {"vkDestroyDescriptorSetLayout", true, reinterpret_cast(&Anvil::Vulkan::vkDestroyDescriptorSetLayout)}, + {"vkCreateDescriptorPool", true, reinterpret_cast(&Anvil::Vulkan::vkCreateDescriptorPool)}, + {"vkDestroyDescriptorPool", true, reinterpret_cast(&Anvil::Vulkan::vkDestroyDescriptorPool)}, + {"vkResetDescriptorPool", true, reinterpret_cast(&Anvil::Vulkan::vkResetDescriptorPool)}, + {"vkAllocateDescriptorSets", true, reinterpret_cast(&Anvil::Vulkan::vkAllocateDescriptorSets)}, + {"vkFreeDescriptorSets", true, reinterpret_cast(&Anvil::Vulkan::vkFreeDescriptorSets)}, + {"vkUpdateDescriptorSets", true, reinterpret_cast(&Anvil::Vulkan::vkUpdateDescriptorSets)}, + {"vkCreateFramebuffer", true, reinterpret_cast(&Anvil::Vulkan::vkCreateFramebuffer)}, + {"vkDestroyFramebuffer", true, reinterpret_cast(&Anvil::Vulkan::vkDestroyFramebuffer)}, + {"vkCreateRenderPass", true, reinterpret_cast(&Anvil::Vulkan::vkCreateRenderPass)}, + {"vkDestroyRenderPass", true, reinterpret_cast(&Anvil::Vulkan::vkDestroyRenderPass)}, + {"vkGetRenderAreaGranularity", true, reinterpret_cast(&Anvil::Vulkan::vkGetRenderAreaGranularity)}, + {"vkCreateCommandPool", true, reinterpret_cast(&Anvil::Vulkan::vkCreateCommandPool)}, + {"vkDestroyCommandPool", true, reinterpret_cast(&Anvil::Vulkan::vkDestroyCommandPool)}, + {"vkResetCommandPool", true, reinterpret_cast(&Anvil::Vulkan::vkResetCommandPool)}, + {"vkAllocateCommandBuffers", true, reinterpret_cast(&Anvil::Vulkan::vkAllocateCommandBuffers)}, + {"vkFreeCommandBuffers", true, reinterpret_cast(&Anvil::Vulkan::vkFreeCommandBuffers)}, + {"vkBeginCommandBuffer", true, reinterpret_cast(&Anvil::Vulkan::vkBeginCommandBuffer)}, + {"vkEndCommandBuffer", true, reinterpret_cast(&Anvil::Vulkan::vkEndCommandBuffer)}, + {"vkResetCommandBuffer", true, reinterpret_cast(&Anvil::Vulkan::vkResetCommandBuffer)}, + {"vkCmdBindPipeline", true, reinterpret_cast(&Anvil::Vulkan::vkCmdBindPipeline)}, + {"vkCmdSetViewport", true, reinterpret_cast(&Anvil::Vulkan::vkCmdSetViewport)}, + {"vkCmdSetScissor", true, reinterpret_cast(&Anvil::Vulkan::vkCmdSetScissor)}, + {"vkCmdSetLineWidth", true, reinterpret_cast(&Anvil::Vulkan::vkCmdSetLineWidth)}, + {"vkCmdSetDepthBias", true, reinterpret_cast(&Anvil::Vulkan::vkCmdSetDepthBias)}, + {"vkCmdSetBlendConstants", true, reinterpret_cast(&Anvil::Vulkan::vkCmdSetBlendConstants)}, + {"vkCmdSetDepthBounds", true, reinterpret_cast(&Anvil::Vulkan::vkCmdSetDepthBounds)}, + {"vkCmdSetStencilCompareMask", true, reinterpret_cast(&Anvil::Vulkan::vkCmdSetStencilCompareMask)}, + {"vkCmdSetStencilWriteMask", true, reinterpret_cast(&Anvil::Vulkan::vkCmdSetStencilWriteMask)}, + {"vkCmdSetStencilReference", true, reinterpret_cast(&Anvil::Vulkan::vkCmdSetStencilReference)}, + {"vkCmdBindDescriptorSets", true, reinterpret_cast(&Anvil::Vulkan::vkCmdBindDescriptorSets)}, + {"vkCmdBindIndexBuffer", true, reinterpret_cast(&Anvil::Vulkan::vkCmdBindIndexBuffer)}, + {"vkCmdBindVertexBuffers", true, reinterpret_cast(&Anvil::Vulkan::vkCmdBindVertexBuffers)}, + {"vkCmdDraw", true, reinterpret_cast(&Anvil::Vulkan::vkCmdDraw)}, + {"vkCmdDrawIndexed", true, reinterpret_cast(&Anvil::Vulkan::vkCmdDrawIndexed)}, + {"vkCmdDrawIndirect", true, reinterpret_cast(&Anvil::Vulkan::vkCmdDrawIndirect)}, + {"vkCmdDrawIndexedIndirect", true, reinterpret_cast(&Anvil::Vulkan::vkCmdDrawIndexedIndirect)}, + {"vkCmdDispatch", true, reinterpret_cast(&Anvil::Vulkan::vkCmdDispatch)}, + {"vkCmdDispatchIndirect", true, reinterpret_cast(&Anvil::Vulkan::vkCmdDispatchIndirect)}, + {"vkCmdCopyBuffer", true, reinterpret_cast(&Anvil::Vulkan::vkCmdCopyBuffer)}, + {"vkCmdCopyImage", true, reinterpret_cast(&Anvil::Vulkan::vkCmdCopyImage)}, + {"vkCmdBlitImage", true, reinterpret_cast(&Anvil::Vulkan::vkCmdBlitImage)}, + {"vkCmdCopyBufferToImage", true, reinterpret_cast(&Anvil::Vulkan::vkCmdCopyBufferToImage)}, + {"vkCmdCopyImageToBuffer", true, reinterpret_cast(&Anvil::Vulkan::vkCmdCopyImageToBuffer)}, + {"vkCmdUpdateBuffer", true, reinterpret_cast(&Anvil::Vulkan::vkCmdUpdateBuffer)}, + {"vkCmdFillBuffer", true, reinterpret_cast(&Anvil::Vulkan::vkCmdFillBuffer)}, + {"vkCmdClearColorImage", true, reinterpret_cast(&Anvil::Vulkan::vkCmdClearColorImage)}, + {"vkCmdClearDepthStencilImage", true, reinterpret_cast(&Anvil::Vulkan::vkCmdClearDepthStencilImage)}, + {"vkCmdClearAttachments", true, reinterpret_cast(&Anvil::Vulkan::vkCmdClearAttachments)}, + {"vkCmdResolveImage", true, reinterpret_cast(&Anvil::Vulkan::vkCmdResolveImage)}, + {"vkCmdSetEvent", true, reinterpret_cast(&Anvil::Vulkan::vkCmdSetEvent)}, + {"vkCmdResetEvent", true, reinterpret_cast(&Anvil::Vulkan::vkCmdResetEvent)}, + {"vkCmdWaitEvents", true, reinterpret_cast(&Anvil::Vulkan::vkCmdWaitEvents)}, + {"vkCmdPipelineBarrier", true, reinterpret_cast(&Anvil::Vulkan::vkCmdPipelineBarrier)}, + {"vkCmdBeginQuery", true, reinterpret_cast(&Anvil::Vulkan::vkCmdBeginQuery)}, + {"vkCmdEndQuery", true, reinterpret_cast(&Anvil::Vulkan::vkCmdEndQuery)}, + {"vkCmdResetQueryPool", true, reinterpret_cast(&Anvil::Vulkan::vkCmdResetQueryPool)}, + {"vkCmdWriteTimestamp", true, reinterpret_cast(&Anvil::Vulkan::vkCmdWriteTimestamp)}, + {"vkCmdCopyQueryPoolResults", true, reinterpret_cast(&Anvil::Vulkan::vkCmdCopyQueryPoolResults)}, + {"vkCmdPushConstants", true, reinterpret_cast(&Anvil::Vulkan::vkCmdPushConstants)}, + {"vkCmdBeginRenderPass", true, reinterpret_cast(&Anvil::Vulkan::vkCmdBeginRenderPass)}, + {"vkCmdNextSubpass", true, reinterpret_cast(&Anvil::Vulkan::vkCmdNextSubpass)}, + {"vkCmdEndRenderPass", true, reinterpret_cast(&Anvil::Vulkan::vkCmdEndRenderPass)}, + {"vkCmdExecuteCommands", true, reinterpret_cast(&Anvil::Vulkan::vkCmdExecuteCommands)} + }; + + if (g_core_func_ptrs_inited && + g_instance_func_ptrs_inited) + { + result = true; + + goto end; + } + + if (g_vk10_library_ptr == nullptr) + { + g_vk10_library_ptr = Anvil::Library::create(ANVIL_VULKAN_DYNAMIC_DLL); + + if (g_vk10_library_ptr == nullptr) + { + anvil_assert(g_vk10_library_ptr != nullptr); + + goto end; + } + } + + for (const auto& current_func_data : functions) + { + if (!current_func_data.requires_getter_call && + !g_core_func_ptrs_inited) + { + *current_func_data.result_func_ptr = g_vk10_library_ptr->get_proc_address(current_func_data.func_name.c_str() ); + + if (*current_func_data.result_func_ptr == nullptr) + { + anvil_assert(*current_func_data.result_func_ptr != nullptr); + + goto end; + } + } + + if ((current_func_data.requires_getter_call) && + (g_core_func_ptrs_inited) && + (m_instance != VK_NULL_HANDLE) ) + { + *current_func_data.result_func_ptr = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + current_func_data.func_name.c_str() )); + + if (*current_func_data.result_func_ptr == nullptr) + { + anvil_assert(*current_func_data.result_func_ptr != nullptr); + + goto end; + } + } + } + + g_core_func_ptrs_inited = true; + + if (m_instance != VK_NULL_HANDLE) + { + g_instance_func_ptrs_inited = true; + } + end: + return result; + } +#endif + /** Please see header for specification */ bool Anvil::Instance::is_instance_extension_enabled(const char* in_extension_name) const { diff --git a/src/wrappers/memory_block.cpp b/src/wrappers/memory_block.cpp index 6c56faa4..c425222d 100644 --- a/src/wrappers/memory_block.cpp +++ b/src/wrappers/memory_block.cpp @@ -87,9 +87,9 @@ Anvil::MemoryBlock::~MemoryBlock() { lock(); { - vkFreeMemory(m_create_info_ptr->get_device()->get_device_vk(), - m_memory, - nullptr /* pAllocator */); + Anvil::Vulkan::vkFreeMemory(m_create_info_ptr->get_device()->get_device_vk(), + m_memory, + nullptr /* pAllocator */); } unlock(); } @@ -122,8 +122,8 @@ void Anvil::MemoryBlock::close_gpu_memory_access() else { /* This block will be entered for memory blocks instantiated without a memory allocator */ - vkUnmapMemory(m_create_info_ptr->get_device()->get_device_vk(), - m_memory); + Anvil::Vulkan::vkUnmapMemory(m_create_info_ptr->get_device()->get_device_vk(), + m_memory); } } unlock(); @@ -452,26 +452,49 @@ bool Anvil::MemoryBlock::init() if (m_create_info_ptr->get_external_handle_import_info(&handle_import_info_ptr) ) { - #if defined(_WIN32) - VkImportMemoryWin32HandleInfoKHR handle_info_khr; - #else - VkImportMemoryFdInfoKHR handle_info_khr; - #endif - - handle_info_khr.handleType = static_cast(m_create_info_ptr->get_imported_external_memory_handle_type() ); - handle_info_khr.pNext = nullptr; - - #if defined(_WIN32) - handle_info_khr.handle = handle_import_info_ptr->handle; - handle_info_khr.name = (handle_import_info_ptr->name.size() > 0) ? handle_import_info_ptr->name.c_str() - : nullptr; - handle_info_khr.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR; - #else - handle_info_khr.fd = handle_import_info_ptr->handle; - handle_info_khr.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR; - #endif - - struct_chainer.append_struct(handle_info_khr); + const auto imported_external_memory_handle_type = m_create_info_ptr->get_imported_external_memory_handle_type(); + + if (imported_external_memory_handle_type == Anvil::ExternalMemoryHandleTypeFlagBits::HOST_ALLOCATION_BIT_EXT || + imported_external_memory_handle_type == Anvil::ExternalMemoryHandleTypeFlagBits::HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT) + { + VkImportMemoryHostPointerInfoEXT handle_info_khr; + + anvil_assert(handle_import_info_ptr->host_ptr != nullptr); + anvil_assert(handle_import_info_ptr->handle == static_cast(nullptr) ); + + handle_info_khr.handleType = static_cast(imported_external_memory_handle_type); + handle_info_khr.pHostPointer = handle_import_info_ptr->host_ptr; + handle_info_khr.pNext = nullptr; + handle_info_khr.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT; + + struct_chainer.append_struct(handle_info_khr); + } + else + { + #if defined(_WIN32) + VkImportMemoryWin32HandleInfoKHR handle_info_khr; + #else + VkImportMemoryFdInfoKHR handle_info_khr; + #endif + + anvil_assert(handle_import_info_ptr->host_ptr == nullptr); + anvil_assert(handle_import_info_ptr->handle != static_cast(nullptr) ); + + handle_info_khr.handleType = static_cast(imported_external_memory_handle_type); + handle_info_khr.pNext = nullptr; + + #if defined(_WIN32) + handle_info_khr.handle = handle_import_info_ptr->handle; + handle_info_khr.name = (handle_import_info_ptr->name.size() > 0) ? handle_import_info_ptr->name.c_str() + : nullptr; + handle_info_khr.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR; + #else + handle_info_khr.fd = handle_import_info_ptr->handle; + handle_info_khr.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR; + #endif + + struct_chainer.append_struct(handle_info_khr); + } } } @@ -502,10 +525,10 @@ bool Anvil::MemoryBlock::init() { auto chain_ptr = struct_chainer.create_chain(); - result = vkAllocateMemory(m_create_info_ptr->get_device()->get_device_vk(), - chain_ptr->get_root_struct(), - nullptr, /* pAllocator */ - &m_memory); + result = Anvil::Vulkan::vkAllocateMemory(m_create_info_ptr->get_device()->get_device_vk(), + chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_memory); } anvil_assert_vk_call_succeeded(result); @@ -583,9 +606,9 @@ bool Anvil::MemoryBlock::map(VkDeviceSize in_start_offset, mapped_memory_range.size = in_size; mapped_memory_range.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE; - result_vk = vkInvalidateMappedMemoryRanges(m_create_info_ptr->get_device()->get_device_vk(), - 1, /* memRangeCount */ - &mapped_memory_range); + result_vk = Anvil::Vulkan::vkInvalidateMappedMemoryRanges(m_create_info_ptr->get_device()->get_device_vk(), + 1, /* memRangeCount */ + &mapped_memory_range); anvil_assert_vk_call_succeeded(result_vk); } @@ -638,13 +661,23 @@ bool Anvil::MemoryBlock::open_gpu_memory_access() } else { - /* This block will be entered for memory blocks instantiated without a memory allocator */ - result_vk = vkMapMemory(m_create_info_ptr->get_device()->get_device_vk(), - m_memory, - 0, /* offset */ - m_create_info_ptr->get_size(), - 0, /* flags */ - static_cast(&m_gpu_data_ptr) ); + /* This block will be entered for memory blocks instantiated without a memory allocator + * + * TODO: A memory block may hold both buffer and image data. This means that the invocation below may trigger validation warnings telling + * that image memory which is not in GENERAL and PREINITIALIZED layout must not be modified by the host. As long as the map request + * is done specifically for a buffer, this warning is harmless. + * Avoiding this warning is tricky, given the VK restriction where a memory allocation X must not be mapped more than once at a time. + * Effectively, we would need to make the memory alloc backends create separate memory allocs for buffer and image objects, in order + * to support cases where apps need to map >1 memory regions, coming from the same memory block, at once. It would also make the implementation + * less readable. Might want to consider doing this nevertheless one day. + * + */ + result_vk = Anvil::Vulkan::vkMapMemory(m_create_info_ptr->get_device()->get_device_vk(), + m_memory, + 0, /* offset */ + m_create_info_ptr->get_size(), + 0, /* flags */ + static_cast(&m_gpu_data_ptr) ); } } unlock(); @@ -710,9 +743,9 @@ bool Anvil::MemoryBlock::read(VkDeviceSize in_start_offset, mapped_memory_range.size = mem_block_size - mapped_memory_range.offset; } - result_vk = vkInvalidateMappedMemoryRanges(m_create_info_ptr->get_device()->get_device_vk(), - 1, /* memRangeCount */ - &mapped_memory_range); + result_vk = Anvil::Vulkan::vkInvalidateMappedMemoryRanges(m_create_info_ptr->get_device()->get_device_vk(), + 1, /* memRangeCount */ + &mapped_memory_range); anvil_assert_vk_call_succeeded(result_vk); } @@ -808,9 +841,9 @@ bool Anvil::MemoryBlock::write(VkDeviceSize in_start_offset, mapped_memory_range.size = mem_block_size - mapped_memory_range.offset; } - result_vk = vkFlushMappedMemoryRanges(m_create_info_ptr->get_device()->get_device_vk(), - 1, /* memRangeCount */ - &mapped_memory_range); + result_vk = Anvil::Vulkan::vkFlushMappedMemoryRanges(m_create_info_ptr->get_device()->get_device_vk(), + 1, /* memRangeCount */ + &mapped_memory_range); anvil_assert_vk_call_succeeded(result_vk); } diff --git a/src/wrappers/physical_device.cpp b/src/wrappers/physical_device.cpp index 56d9ceca..ebdfe561 100644 --- a/src/wrappers/physical_device.cpp +++ b/src/wrappers/physical_device.cpp @@ -80,10 +80,10 @@ bool Anvil::PhysicalDevice::init() anvil_assert(m_physical_device != VK_NULL_HANDLE); /* Retrieve device extensions */ - result_vk = vkEnumerateDeviceExtensionProperties(m_physical_device, - nullptr, /* pLayerName */ - &n_extensions, - nullptr); /* pProperties */ + result_vk = Anvil::Vulkan::vkEnumerateDeviceExtensionProperties(m_physical_device, + nullptr, /* pLayerName */ + &n_extensions, + nullptr); /* pProperties */ if (!is_vk_call_successful(result_vk) ) { @@ -100,10 +100,10 @@ bool Anvil::PhysicalDevice::init() extension_props.resize(n_extensions); - result_vk = vkEnumerateDeviceExtensionProperties(m_physical_device, - nullptr, /* pLayerName */ - &n_extensions, - &extension_props[0]); + result_vk = Anvil::Vulkan::vkEnumerateDeviceExtensionProperties(m_physical_device, + nullptr, /* pLayerName */ + &n_extensions, + &extension_props[0]); anvil_assert_vk_call_succeeded(result_vk); for (uint32_t n_extension = 0; @@ -119,18 +119,23 @@ bool Anvil::PhysicalDevice::init() /* Retrieve and cache device features */ { - Anvil::StructID descriptor_indexing_features_struct_id = UINT32_MAX; VkPhysicalDeviceFeatures features_vk; - vkGetPhysicalDeviceFeatures(m_physical_device, - &features_vk); + Anvil::Vulkan::vkGetPhysicalDeviceFeatures(m_physical_device, + &features_vk); - if (m_extension_info_ptr->get_device_extension_info()->ext_descriptor_indexing() ) + if (m_instance_ptr->get_enabled_extensions_info()->khr_get_physical_device_properties2() ) { - const auto& gpdp2_entrypoints = m_instance_ptr->get_extension_khr_get_physical_device_properties2_entrypoints(); + Anvil::StructID descriptor_indexing_features_struct_id = UINT32_MAX; + const auto& gpdp2_entrypoints = m_instance_ptr->get_extension_khr_get_physical_device_properties2_entrypoints(); + Anvil::StructID multiview_features_struct_id = UINT32_MAX; + Anvil::StructID storage_features16_struct_id = UINT32_MAX; + Anvil::StructID storage_features8_struct_id = UINT32_MAX; Anvil::StructChainUniquePtr struct_chain_ptr; Anvil::StructChainer struct_chainer; + Anvil::StructID variable_pointer_features_struct_id = UINT32_MAX; + /* Chain query structs .. */ { VkPhysicalDeviceFeatures2KHR features; @@ -140,6 +145,7 @@ bool Anvil::PhysicalDevice::init() struct_chainer.append_struct(features); } + if (m_extension_info_ptr->get_device_extension_info()->ext_descriptor_indexing() ) { VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptor_indexing_features; @@ -149,64 +155,127 @@ bool Anvil::PhysicalDevice::init() descriptor_indexing_features_struct_id = struct_chainer.append_struct(descriptor_indexing_features); } - struct_chain_ptr = struct_chainer.create_chain(); + if (m_extension_info_ptr->get_device_extension_info()->khr_16bit_storage() ) + { + VkPhysicalDevice16BitStorageFeaturesKHR storage_features; - gpdp2_entrypoints.vkGetPhysicalDeviceFeatures2KHR(m_physical_device, - struct_chain_ptr->get_root_struct() ); + storage_features.pNext = nullptr; + storage_features.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR); - m_ext_descriptor_indexing_features_ptr.reset( - new EXTDescriptorIndexingFeatures(*struct_chain_ptr->get_struct_with_id(descriptor_indexing_features_struct_id) ) - ); + storage_features16_struct_id = struct_chainer.append_struct(storage_features); + } - if (m_ext_descriptor_indexing_features_ptr == nullptr) + if (m_extension_info_ptr->get_device_extension_info()->khr_8bit_storage() ) { - anvil_assert(m_ext_descriptor_indexing_features_ptr != nullptr); + VkPhysicalDevice8BitStorageFeaturesKHR storage_features; - result = false; - goto end; - } - } + storage_features.pNext = nullptr; + storage_features.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR); - if (m_extension_info_ptr->get_device_extension_info()->khr_16bit_storage() ) - { - const auto& gpdp2_entrypoints = m_instance_ptr->get_extension_khr_get_physical_device_properties2_entrypoints(); - Anvil::StructID storage_features_struct_id = UINT32_MAX; - Anvil::StructChainUniquePtr struct_chain_ptr; - Anvil::StructChainer struct_chainer; + storage_features8_struct_id = struct_chainer.append_struct(storage_features); + } + if (m_extension_info_ptr->get_device_extension_info()->khr_multiview() ) { - VkPhysicalDeviceFeatures2KHR features; + VkPhysicalDeviceMultiviewFeaturesKHR multiview_features; - features.pNext = nullptr; - features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR; + multiview_features.pNext = nullptr; + multiview_features.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHR); - struct_chainer.append_struct(features); + multiview_features_struct_id = struct_chainer.append_struct(multiview_features); } + if (m_extension_info_ptr->get_device_extension_info()->khr_variable_pointers() ) { - VkPhysicalDevice16BitStorageFeaturesKHR storage_features; + VkPhysicalDeviceVariablePointerFeaturesKHR vp_features; - storage_features.pNext = nullptr; - storage_features.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR); + vp_features.pNext = nullptr; + vp_features.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR); - storage_features_struct_id = struct_chainer.append_struct(storage_features); + variable_pointer_features_struct_id = struct_chainer.append_struct(vp_features); } + /* Retrieve the features.. */ struct_chain_ptr = struct_chainer.create_chain(); gpdp2_entrypoints.vkGetPhysicalDeviceFeatures2KHR(m_physical_device, struct_chain_ptr->get_root_struct() ); - m_khr_16_bit_storage_features_ptr.reset( - new KHR16BitStorageFeatures(*struct_chain_ptr->get_struct_with_id(storage_features_struct_id) ) - ); + /* Cache the results */ - if (m_khr_16_bit_storage_features_ptr == nullptr) + if (descriptor_indexing_features_struct_id != UINT32_MAX) { - anvil_assert(m_khr_16_bit_storage_features_ptr != nullptr); + m_ext_descriptor_indexing_features_ptr.reset( + new EXTDescriptorIndexingFeatures(*struct_chain_ptr->get_struct_with_id(descriptor_indexing_features_struct_id) ) + ); - result = false; - goto end; + if (m_ext_descriptor_indexing_features_ptr == nullptr) + { + anvil_assert(m_ext_descriptor_indexing_features_ptr != nullptr); + + result = false; + goto end; + } + } + + if (multiview_features_struct_id != UINT32_MAX) + { + m_khr_multiview_features_ptr.reset( + new KHRMultiviewFeatures(*struct_chain_ptr->get_struct_with_id(multiview_features_struct_id) ) + ); + + if (m_khr_multiview_features_ptr == nullptr) + { + anvil_assert(m_khr_multiview_features_ptr != nullptr); + + result = false; + goto end; + } + } + + if (storage_features16_struct_id != UINT32_MAX) + { + m_khr_16_bit_storage_features_ptr.reset( + new KHR16BitStorageFeatures(*struct_chain_ptr->get_struct_with_id(storage_features16_struct_id) ) + ); + + if (m_khr_16_bit_storage_features_ptr == nullptr) + { + anvil_assert(m_khr_16_bit_storage_features_ptr != nullptr); + + result = false; + goto end; + } + } + + if (storage_features8_struct_id != UINT32_MAX) + { + m_khr_8_bit_storage_features_ptr.reset( + new KHR8BitStorageFeatures(*struct_chain_ptr->get_struct_with_id(storage_features8_struct_id) ) + ); + + if (m_khr_8_bit_storage_features_ptr == nullptr) + { + anvil_assert(m_khr_8_bit_storage_features_ptr != nullptr); + + result = false; + goto end; + } + } + + if (variable_pointer_features_struct_id != UINT32_MAX) + { + m_khr_variable_pointer_features_ptr.reset( + new KHRVariablePointerFeatures(*struct_chain_ptr->get_struct_with_id(variable_pointer_features_struct_id) ) + ); + + if (m_khr_variable_pointer_features_ptr == nullptr) + { + anvil_assert(m_khr_variable_pointer_features_ptr != nullptr); + + result = false; + goto end; + } } } @@ -224,13 +293,16 @@ bool Anvil::PhysicalDevice::init() m_features = Anvil::PhysicalDeviceFeatures(m_core_features_vk10_ptr.get (), m_ext_descriptor_indexing_features_ptr.get(), - m_khr_16_bit_storage_features_ptr.get () ); + m_khr_16_bit_storage_features_ptr.get (), + m_khr_8_bit_storage_features_ptr.get (), + m_khr_multiview_features_ptr.get (), + m_khr_variable_pointer_features_ptr.get () ); } /* Retrieve device layers */ - result_vk = vkEnumerateDeviceLayerProperties(m_physical_device, - &n_physical_device_layers, - nullptr); /* pProperties */ + result_vk = Anvil::Vulkan::vkEnumerateDeviceLayerProperties(m_physical_device, + &n_physical_device_layers, + nullptr); /* pProperties */ if (!is_vk_call_successful(result_vk) ) { @@ -246,9 +318,9 @@ bool Anvil::PhysicalDevice::init() layer_props.resize(n_physical_device_layers); - result_vk = vkEnumerateDeviceLayerProperties(m_physical_device, - &n_physical_device_layers, - &layer_props[0]); + result_vk = Anvil::Vulkan::vkEnumerateDeviceLayerProperties(m_physical_device, + &n_physical_device_layers, + &layer_props[0]); if (!is_vk_call_successful(result_vk) ) { @@ -269,120 +341,141 @@ bool Anvil::PhysicalDevice::init() /* Retrieve additional device info */ if (m_instance_ptr->get_enabled_extensions_info()->khr_get_physical_device_properties2() ) { - const auto& gpdp2_entrypoints = m_instance_ptr->get_extension_khr_get_physical_device_properties2_entrypoints(); + Anvil::StructID descriptor_indexing_props_struct_id = UINT32_MAX; + Anvil::StructID device_id_props_struct_id = UINT32_MAX; + Anvil::StructID external_memory_host_props_struct_id = UINT32_MAX; + const auto& gpdp2_entrypoints = m_instance_ptr->get_extension_khr_get_physical_device_properties2_entrypoints(); + Anvil::StructID maintenance3_struct_id = UINT32_MAX; + Anvil::StructID multiview_struct_id = UINT32_MAX; + Anvil::StructID point_clipping_props_struct_id = UINT32_MAX; + Anvil::StructID sample_locations_props_struct_id = UINT32_MAX; + Anvil::StructID sampler_filter_minmax_props_struct_id = UINT32_MAX; + Anvil::StructID shader_core_struct_id = UINT32_MAX; + Anvil::StructChainUniquePtr struct_chain_ptr; + Anvil::StructChainer struct_chainer; + Anvil::StructID vertex_attribute_divisor_props_struct_id = UINT32_MAX; + + /* Chain query structs */ + { + VkPhysicalDeviceProperties2KHR general_props; - if (m_instance_ptr->get_enabled_extensions_info()->khr_external_memory_capabilities() ) + general_props.pNext = nullptr; + general_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; + + struct_chainer.append_struct(general_props); + } + + if (m_extension_info_ptr->get_device_extension_info()->amd_shader_core_properties() ) { - Anvil::StructID device_id_props_struct_id = UINT32_MAX; - const VkPhysicalDeviceIDPropertiesKHR* result_device_id_props_ptr = nullptr; - Anvil::StructChainUniquePtr struct_chain_ptr; - Anvil::StructChainer struct_chainer; - { - VkPhysicalDeviceProperties2KHR general_props; + VkPhysicalDeviceShaderCorePropertiesAMD shader_core_properties; - general_props.pNext = nullptr; - general_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; + shader_core_properties.pNext = nullptr; + shader_core_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD; - struct_chainer.append_struct(general_props); - } + shader_core_struct_id = struct_chainer.append_struct(shader_core_properties); + } - { - VkPhysicalDeviceIDPropertiesKHR device_id_props; + if (m_extension_info_ptr->get_device_extension_info()->ext_descriptor_indexing() ) + { + VkPhysicalDeviceDescriptorIndexingPropertiesEXT descriptor_indexing_properties; - device_id_props.pNext = nullptr; - device_id_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR; + descriptor_indexing_properties.pNext = nullptr; + descriptor_indexing_properties.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT); - device_id_props_struct_id = struct_chainer.append_struct(device_id_props); - } + descriptor_indexing_props_struct_id = struct_chainer.append_struct(descriptor_indexing_properties); + } - struct_chain_ptr = struct_chainer.create_chain(); - result_device_id_props_ptr = struct_chain_ptr->get_struct_with_id(device_id_props_struct_id); + if (m_extension_info_ptr->get_device_extension_info()->ext_external_memory_host() ) + { + VkPhysicalDeviceExternalMemoryHostPropertiesEXT external_memory_host_props; - gpdp2_entrypoints.vkGetPhysicalDeviceProperties2KHR(m_physical_device, - struct_chain_ptr->get_root_struct() ); + external_memory_host_props.pNext = nullptr; + external_memory_host_props.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT); - m_khr_external_memory_capabilities_physical_device_id_properties_ptr.reset( - new KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties(*result_device_id_props_ptr) - ); + external_memory_host_props_struct_id = struct_chainer.append_struct(external_memory_host_props); } - if (m_extension_info_ptr->get_device_extension_info()->amd_shader_core_properties() ) + if (m_extension_info_ptr->get_device_extension_info()->ext_sample_locations() ) { - const VkPhysicalDeviceShaderCorePropertiesAMD* result_shader_core_props_ptr = nullptr; - Anvil::StructID shader_core_struct_id = UINT32_MAX; - Anvil::StructChainUniquePtr struct_chain_ptr; - Anvil::StructChainer struct_chainer; + VkPhysicalDeviceSampleLocationsPropertiesEXT sample_locations_properties; - { - VkPhysicalDeviceProperties2KHR general_props; + sample_locations_properties.pNext = nullptr; + sample_locations_properties.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT); - general_props.pNext = nullptr; - general_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; + sample_locations_props_struct_id = struct_chainer.append_struct(sample_locations_properties); + } - struct_chainer.append_struct(general_props); - } + if (m_extension_info_ptr->get_device_extension_info()->ext_sampler_filter_minmax() ) + { + VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT sampler_filter_minmax_properties; - { - VkPhysicalDeviceShaderCorePropertiesAMD shader_core_properties; + sampler_filter_minmax_properties.pNext = nullptr; + sampler_filter_minmax_properties.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT); - shader_core_properties.pNext = nullptr; - shader_core_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD; + sampler_filter_minmax_props_struct_id = struct_chainer.append_struct(sampler_filter_minmax_properties); + } - shader_core_struct_id = struct_chainer.append_struct(shader_core_properties); - } + if (m_extension_info_ptr->get_device_extension_info()->ext_vertex_attribute_divisor() ) + { + VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT vertex_attribute_divisor_properties; - struct_chain_ptr = struct_chainer.create_chain(); - result_shader_core_props_ptr = struct_chain_ptr->get_struct_with_id(shader_core_struct_id); + vertex_attribute_divisor_properties.pNext = nullptr; + vertex_attribute_divisor_properties.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT); - gpdp2_entrypoints.vkGetPhysicalDeviceProperties2KHR(m_physical_device, - struct_chain_ptr->get_root_struct() ); + vertex_attribute_divisor_props_struct_id = struct_chainer.append_struct(vertex_attribute_divisor_properties); + } - m_amd_shader_core_properties_ptr.reset( - new AMDShaderCoreProperties(*result_shader_core_props_ptr) - ); + if (m_instance_ptr->get_enabled_extensions_info()->khr_external_memory_capabilities() ) + { + VkPhysicalDeviceIDPropertiesKHR device_id_props; - if (m_amd_shader_core_properties_ptr == nullptr) - { - anvil_assert(m_amd_shader_core_properties_ptr != nullptr); + device_id_props.pNext = nullptr; + device_id_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR; - result = false; - goto end; - } + device_id_props_struct_id = struct_chainer.append_struct(device_id_props); } - if (m_extension_info_ptr->get_device_extension_info()->ext_descriptor_indexing() ) + if (m_extension_info_ptr->get_device_extension_info()->khr_maintenance2() ) { - Anvil::StructID descriptor_indexing_props_struct_id = UINT32_MAX; - const VkPhysicalDeviceDescriptorIndexingPropertiesEXT* result_descriptor_indexing_props_struct_ptr = nullptr; - Anvil::StructChainUniquePtr struct_chain_ptr; - Anvil::StructChainer struct_chainer; + VkPhysicalDevicePointClippingPropertiesKHR point_clipping_props; - { - VkPhysicalDeviceProperties2KHR general_props; + point_clipping_props.pNext = nullptr; + point_clipping_props.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES_KHR); - general_props.pNext = nullptr; - general_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; + point_clipping_props_struct_id = struct_chainer.append_struct(point_clipping_props); + } - struct_chainer.append_struct(general_props); - } + if (m_extension_info_ptr->get_device_extension_info()->khr_maintenance3() ) + { + VkPhysicalDeviceMaintenance3PropertiesKHR maintenance3_props; - { - VkPhysicalDeviceDescriptorIndexingPropertiesEXT descriptor_indexing_properties; + maintenance3_props.pNext = nullptr; + maintenance3_props.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES_KHR); + + maintenance3_struct_id = struct_chainer.append_struct(maintenance3_props); + } - descriptor_indexing_properties.pNext = nullptr; - descriptor_indexing_properties.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT); + if (m_extension_info_ptr->get_device_extension_info()->khr_multiview() ) + { + VkPhysicalDeviceMultiviewPropertiesKHR multiview_props; - descriptor_indexing_props_struct_id = struct_chainer.append_struct(descriptor_indexing_properties); - } + multiview_props.pNext = nullptr; + multiview_props.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHR); - struct_chain_ptr = struct_chainer.create_chain(); - result_descriptor_indexing_props_struct_ptr = struct_chain_ptr->get_struct_with_id(descriptor_indexing_props_struct_id); + multiview_struct_id = struct_chainer.append_struct(multiview_props); + } + + /* Retrieve the results */ + struct_chain_ptr = struct_chainer.create_chain(); - gpdp2_entrypoints.vkGetPhysicalDeviceProperties2KHR(m_physical_device, - struct_chain_ptr->get_root_struct() ); + gpdp2_entrypoints.vkGetPhysicalDeviceProperties2KHR(m_physical_device, + struct_chain_ptr->get_root_struct() ); + /* Cache the retrieved properties */ + if (descriptor_indexing_props_struct_id != UINT32_MAX) + { m_ext_descriptor_indexing_properties_ptr.reset( - new EXTDescriptorIndexingProperties(*result_descriptor_indexing_props_struct_ptr) + new EXTDescriptorIndexingProperties(*struct_chain_ptr->get_struct_with_id(descriptor_indexing_props_struct_id) ) ); if (m_ext_descriptor_indexing_properties_ptr == nullptr) @@ -394,82 +487,70 @@ bool Anvil::PhysicalDevice::init() } } - if (m_extension_info_ptr->get_device_extension_info()->ext_vertex_attribute_divisor() ) + if (device_id_props_struct_id != UINT32_MAX) { - const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* result_vertex_attribute_divisor_props_struct_ptr = nullptr; - Anvil::StructChainUniquePtr struct_chain_ptr; - Anvil::StructChainer struct_chainer; - Anvil::StructID vertex_attribute_divisor_props_struct_id = UINT32_MAX; + m_khr_external_memory_capabilities_physical_device_id_properties_ptr.reset( + new KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties(*struct_chain_ptr->get_struct_with_id(device_id_props_struct_id) ) + ); + if (m_khr_external_memory_capabilities_physical_device_id_properties_ptr == nullptr) { - VkPhysicalDeviceProperties2KHR general_props; + anvil_assert(m_khr_external_memory_capabilities_physical_device_id_properties_ptr != nullptr); - general_props.pNext = nullptr; - general_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; - - struct_chainer.append_struct(general_props); + result = false; + goto end; } + } - { - VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT vertex_attribute_divisor_properties; + if (external_memory_host_props_struct_id != UINT32_MAX) + { + m_ext_external_memory_host_properties_ptr.reset( + new EXTExternalMemoryHostProperties(*struct_chain_ptr->get_struct_with_id(external_memory_host_props_struct_id) ) + ); - vertex_attribute_divisor_properties.pNext = nullptr; - vertex_attribute_divisor_properties.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT); + if (m_ext_external_memory_host_properties_ptr == nullptr) + { + anvil_assert(m_ext_external_memory_host_properties_ptr != nullptr); - vertex_attribute_divisor_props_struct_id = struct_chainer.append_struct(vertex_attribute_divisor_properties); + result = false; + goto end; } + } - struct_chain_ptr = struct_chainer.create_chain(); - result_vertex_attribute_divisor_props_struct_ptr = struct_chain_ptr->get_struct_with_id(vertex_attribute_divisor_props_struct_id); - - gpdp2_entrypoints.vkGetPhysicalDeviceProperties2KHR(m_physical_device, - struct_chain_ptr->get_root_struct() ); - - m_ext_vertex_attribute_divisor_properties_ptr.reset( - new EXTVertexAttributeDivisorProperties(*result_vertex_attribute_divisor_props_struct_ptr) + if (maintenance3_struct_id != UINT32_MAX) + { + m_khr_maintenance3_properties_ptr.reset( + new KHRMaintenance3Properties(*struct_chain_ptr->get_struct_with_id(maintenance3_struct_id) ) ); - if (m_ext_vertex_attribute_divisor_properties_ptr == nullptr) + if (m_khr_maintenance3_properties_ptr == nullptr) { - anvil_assert(m_ext_vertex_attribute_divisor_properties_ptr != nullptr); + anvil_assert(m_khr_maintenance3_properties_ptr != nullptr); result = false; goto end; } } - if (m_extension_info_ptr->get_device_extension_info()->khr_maintenance2() ) + if (multiview_struct_id != UINT32_MAX) { - Anvil::StructID point_clipping_props_struct_id = UINT32_MAX; - const VkPhysicalDevicePointClippingPropertiesKHR* result_point_clipping_props_struct_ptr = nullptr; - Anvil::StructChainUniquePtr struct_chain_ptr; - Anvil::StructChainer struct_chainer; - - { - VkPhysicalDeviceProperties2KHR general_props; - - general_props.pNext = nullptr; - general_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; + m_khr_multiview_properties_ptr.reset( + new KHRMultiviewProperties(*struct_chain_ptr->get_struct_with_id(multiview_struct_id) ) + ); - struct_chainer.append_struct(general_props); - } + if (m_khr_multiview_properties_ptr == nullptr) { - VkPhysicalDevicePointClippingPropertiesKHR point_clipping_props; + anvil_assert(m_khr_multiview_properties_ptr != nullptr); - point_clipping_props.pNext = nullptr; - point_clipping_props.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES_KHR); - - point_clipping_props_struct_id = struct_chainer.append_struct(point_clipping_props); + result = false; + goto end; } + } - struct_chain_ptr = struct_chainer.create_chain(); - result_point_clipping_props_struct_ptr = struct_chain_ptr->get_struct_with_id(point_clipping_props_struct_id); - - gpdp2_entrypoints.vkGetPhysicalDeviceProperties2KHR(m_physical_device, - struct_chain_ptr->get_root_struct() ); - + if (point_clipping_props_struct_id != UINT32_MAX) + { m_khr_maintenance2_physical_device_point_clipping_properties_ptr.reset( - new KHRMaintenance2PhysicalDevicePointClippingProperties(*result_point_clipping_props_struct_ptr) + new KHRMaintenance2PhysicalDevicePointClippingProperties(*struct_chain_ptr->get_struct_with_id(point_clipping_props_struct_id)) ); if (m_khr_maintenance2_physical_device_point_clipping_properties_ptr == nullptr) @@ -481,43 +562,60 @@ bool Anvil::PhysicalDevice::init() } } - if (m_extension_info_ptr->get_device_extension_info()->khr_maintenance3() ) + if (sample_locations_props_struct_id != UINT32_MAX) { - Anvil::StructID maintenance3_struct_id = UINT32_MAX; - const VkPhysicalDeviceMaintenance3PropertiesKHR* result_maintenanc3_struct_ptr = nullptr; - Anvil::StructChainUniquePtr struct_chain_ptr; - Anvil::StructChainer struct_chainer; + m_ext_sample_locations_properties_ptr.reset( + new EXTSampleLocationsProperties(*struct_chain_ptr->get_struct_with_id(sample_locations_props_struct_id) ) + ); + if (m_ext_sample_locations_properties_ptr == nullptr) { - VkPhysicalDeviceProperties2KHR general_props; - - general_props.pNext = nullptr; - general_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; + anvil_assert(m_ext_sample_locations_properties_ptr != nullptr); - struct_chainer.append_struct(general_props); + result = false; + goto end; } - { - VkPhysicalDeviceMaintenance3PropertiesKHR maintenance3_props; + } - maintenance3_props.pNext = nullptr; - maintenance3_props.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES_KHR); + if (sampler_filter_minmax_props_struct_id != UINT32_MAX) + { + m_ext_sampler_filter_minmax_properties_ptr.reset( + new EXTSamplerFilterMinmaxProperties(*struct_chain_ptr->get_struct_with_id(sampler_filter_minmax_props_struct_id) ) + ); + + if (m_ext_sampler_filter_minmax_properties_ptr == nullptr) + { + anvil_assert(m_ext_sampler_filter_minmax_properties_ptr != nullptr); - maintenance3_struct_id = struct_chainer.append_struct(maintenance3_props); + result = false; + goto end; } + } - struct_chain_ptr = struct_chainer.create_chain(); - result_maintenanc3_struct_ptr = struct_chain_ptr->get_struct_with_id(maintenance3_struct_id); + if (shader_core_struct_id != UINT32_MAX) + { + m_amd_shader_core_properties_ptr.reset( + new AMDShaderCoreProperties(*struct_chain_ptr->get_struct_with_id(shader_core_struct_id) ) + ); - gpdp2_entrypoints.vkGetPhysicalDeviceProperties2KHR(m_physical_device, - struct_chain_ptr->get_root_struct() ); + if (m_amd_shader_core_properties_ptr == nullptr) + { + anvil_assert(m_amd_shader_core_properties_ptr != nullptr); - m_khr_maintenance3_properties_ptr.reset( - new KHRMaintenance3Properties(*result_maintenanc3_struct_ptr) + result = false; + goto end; + } + } + + if (vertex_attribute_divisor_props_struct_id != UINT32_MAX) + { + m_ext_vertex_attribute_divisor_properties_ptr.reset( + new EXTVertexAttributeDivisorProperties(*struct_chain_ptr->get_struct_with_id(vertex_attribute_divisor_props_struct_id) ) ); - if (m_khr_maintenance3_properties_ptr == nullptr) + if (m_ext_vertex_attribute_divisor_properties_ptr == nullptr) { - anvil_assert(m_khr_maintenance3_properties_ptr != nullptr); + anvil_assert(m_ext_vertex_attribute_divisor_properties_ptr != nullptr); result = false; goto end; @@ -529,8 +627,8 @@ bool Anvil::PhysicalDevice::init() { VkPhysicalDeviceProperties props; - vkGetPhysicalDeviceProperties(m_physical_device, - &props); + Anvil::Vulkan::vkGetPhysicalDeviceProperties(m_physical_device, + &props); m_core_properties_vk10_ptr.reset( new Anvil::PhysicalDevicePropertiesCoreVK10(props) @@ -548,15 +646,19 @@ bool Anvil::PhysicalDevice::init() m_properties = Anvil::PhysicalDeviceProperties(m_amd_shader_core_properties_ptr.get (), m_core_properties_vk10_ptr.get (), m_ext_descriptor_indexing_properties_ptr.get (), + m_ext_external_memory_host_properties_ptr.get (), + m_ext_sample_locations_properties_ptr.get (), + m_ext_sampler_filter_minmax_properties_ptr.get (), m_ext_vertex_attribute_divisor_properties_ptr.get (), m_khr_external_memory_capabilities_physical_device_id_properties_ptr.get(), m_khr_maintenance3_properties_ptr.get (), - m_khr_maintenance2_physical_device_point_clipping_properties_ptr.get () ); + m_khr_maintenance2_physical_device_point_clipping_properties_ptr.get (), + m_khr_multiview_properties_ptr.get () ); /* Retrieve device queue data */ - vkGetPhysicalDeviceQueueFamilyProperties(m_physical_device, - &n_physical_device_queues, /* pCount */ - nullptr); /* pQueueFamilyProperties */ + Anvil::Vulkan::vkGetPhysicalDeviceQueueFamilyProperties(m_physical_device, + &n_physical_device_queues, /* pCount */ + nullptr); /* pQueueFamilyProperties */ if (n_physical_device_queues > 0) { @@ -564,9 +666,9 @@ bool Anvil::PhysicalDevice::init() queue_props.resize(n_physical_device_queues); - vkGetPhysicalDeviceQueueFamilyProperties(m_physical_device, - &n_physical_device_queues, - &queue_props[0]); + Anvil::Vulkan::vkGetPhysicalDeviceQueueFamilyProperties(m_physical_device, + &n_physical_device_queues, + &queue_props[0]); for (uint32_t n_physical_device_queue = 0; n_physical_device_queue < n_physical_device_queues; @@ -577,8 +679,8 @@ bool Anvil::PhysicalDevice::init() } /* Retrieve memory properties */ - vkGetPhysicalDeviceMemoryProperties(m_physical_device, - &memory_properties); + Anvil::Vulkan::vkGetPhysicalDeviceMemoryProperties(m_physical_device, + &memory_properties); m_memory_properties.init(memory_properties); @@ -676,9 +778,9 @@ Anvil::FormatProperties Anvil::PhysicalDevice::get_format_properties(Anvil::Form { VkFormatProperties core_vk10_format_props; - vkGetPhysicalDeviceFormatProperties(m_physical_device, - static_cast(in_format), - &core_vk10_format_props); + Anvil::Vulkan::vkGetPhysicalDeviceFormatProperties(m_physical_device, + static_cast(in_format), + &core_vk10_format_props); return Anvil::FormatProperties(core_vk10_format_props); } @@ -700,17 +802,17 @@ bool Anvil::PhysicalDevice::get_image_format_properties(const ImageFormatPropert } /* Retrieve core VK1.0 information first. */ - vkGetPhysicalDeviceFormatProperties(m_physical_device, - static_cast(in_query.format), - &core_vk10_format_props); - - if (vkGetPhysicalDeviceImageFormatProperties(m_physical_device, - static_cast (in_query.format), - static_cast (in_query.image_type), - static_cast(in_query.tiling), - in_query.usage_flags.get_vk (), - in_query.create_flags.get_vk(), - &core_vk10_image_format_properties) != VK_SUCCESS) + Anvil::Vulkan::vkGetPhysicalDeviceFormatProperties(m_physical_device, + static_cast(in_query.format), + &core_vk10_format_props); + + if (Anvil::Vulkan::vkGetPhysicalDeviceImageFormatProperties(m_physical_device, + static_cast (in_query.format), + static_cast (in_query.image_type), + static_cast(in_query.tiling), + in_query.usage_flags.get_vk (), + in_query.create_flags.get_vk(), + &core_vk10_image_format_properties) != VK_SUCCESS) { goto end; } @@ -873,27 +975,27 @@ bool Anvil::PhysicalDevice::get_sparse_image_format_properties(Anvil::Format out_result.clear(); - vkGetPhysicalDeviceSparseImageFormatProperties(m_physical_device, - static_cast (in_format), - static_cast(in_type), - static_cast(in_sample_count), - in_usage.get_vk(), - static_cast(in_tiling), - &n_properties, - nullptr); /* pProperties */ + Anvil::Vulkan::vkGetPhysicalDeviceSparseImageFormatProperties(m_physical_device, + static_cast (in_format), + static_cast(in_type), + static_cast(in_sample_count), + in_usage.get_vk(), + static_cast(in_tiling), + &n_properties, + nullptr); /* pProperties */ if (n_properties > 0) { out_result.resize(n_properties); - vkGetPhysicalDeviceSparseImageFormatProperties(m_physical_device, - static_cast (in_format), - static_cast (in_type), - static_cast(in_sample_count), - in_usage.get_vk(), - static_cast(in_tiling), - &n_properties, - reinterpret_cast(&out_result[0]) ); + Anvil::Vulkan::vkGetPhysicalDeviceSparseImageFormatProperties(m_physical_device, + static_cast (in_format), + static_cast (in_type), + static_cast(in_sample_count), + in_usage.get_vk(), + static_cast(in_tiling), + &n_properties, + reinterpret_cast(&out_result[0]) ); } return true; diff --git a/src/wrappers/pipeline_cache.cpp b/src/wrappers/pipeline_cache.cpp index 7ad85faa..cac89cb9 100644 --- a/src/wrappers/pipeline_cache.cpp +++ b/src/wrappers/pipeline_cache.cpp @@ -48,10 +48,10 @@ Anvil::PipelineCache::PipelineCache(const Anvil::BaseDevice* in_device_ptr, cache_create_info.pNext = nullptr; cache_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO; - result_vk = vkCreatePipelineCache(m_device_ptr->get_device_vk(), - &cache_create_info, - nullptr, /* pAllocator */ - &m_pipeline_cache); + result_vk = Anvil::Vulkan::vkCreatePipelineCache(m_device_ptr->get_device_vk(), + &cache_create_info, + nullptr, /* pAllocator */ + &m_pipeline_cache); anvil_assert_vk_call_succeeded(result_vk); if (is_vk_call_successful(result_vk) ) @@ -77,9 +77,9 @@ Anvil::PipelineCache::~PipelineCache() { lock(); { - vkDestroyPipelineCache(m_device_ptr->get_device_vk(), - m_pipeline_cache, - nullptr /* pAllocator */); + Anvil::Vulkan::vkDestroyPipelineCache(m_device_ptr->get_device_vk(), + m_pipeline_cache, + nullptr /* pAllocator */); } unlock(); @@ -107,17 +107,15 @@ Anvil::PipelineCacheUniquePtr Anvil::PipelineCache::create(const Anvil::BaseDevi } /** Please see header for specification */ -bool Anvil::PipelineCache::get_data(size_t* out_n_data_bytes_ptr, - const void** out_data_ptr) +bool Anvil::PipelineCache::get_data(size_t* out_n_data_bytes_ptr, + void* out_data_ptr) { VkResult result_vk; - result_vk = vkGetPipelineCacheData(m_device_ptr->get_device_vk(), - m_pipeline_cache, - out_n_data_bytes_ptr, - out_data_ptr); - - anvil_assert(result_vk); + result_vk = Anvil::Vulkan::vkGetPipelineCacheData(m_device_ptr->get_device_vk(), + m_pipeline_cache, + out_n_data_bytes_ptr, + out_data_ptr); return is_vk_call_successful(result_vk); } @@ -141,10 +139,10 @@ bool Anvil::PipelineCache::merge(uint32_t in_n_pipelin lock(); { - result_vk = vkMergePipelineCaches(m_device_ptr->get_device_vk(), - m_pipeline_cache, - in_n_pipeline_caches, - &src_pipeline_caches.at(0) ); + result_vk = Anvil::Vulkan::vkMergePipelineCaches(m_device_ptr->get_device_vk(), + m_pipeline_cache, + in_n_pipeline_caches, + &src_pipeline_caches.at(0) ); } unlock(); diff --git a/src/wrappers/pipeline_layout.cpp b/src/wrappers/pipeline_layout.cpp index 55b7998a..79a300df 100644 --- a/src/wrappers/pipeline_layout.cpp +++ b/src/wrappers/pipeline_layout.cpp @@ -52,9 +52,9 @@ Anvil::PipelineLayout::~PipelineLayout() { lock(); { - vkDestroyPipelineLayout(m_device_ptr->get_device_vk(), - m_layout_vk, - nullptr /* pAllocator */); + Anvil::Vulkan::vkDestroyPipelineLayout(m_device_ptr->get_device_vk(), + m_layout_vk, + nullptr /* pAllocator */); } unlock(); @@ -151,10 +151,10 @@ bool Anvil::PipelineLayout::bake(const std::vector(m_push_constant_ranges.size() ); pipeline_layout_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO; - result_vk = vkCreatePipelineLayout(m_device_ptr->get_device_vk(), - &pipeline_layout_create_info, - nullptr, /* pAllocator */ - &m_layout_vk); + result_vk = Anvil::Vulkan::vkCreatePipelineLayout(m_device_ptr->get_device_vk(), + &pipeline_layout_create_info, + nullptr, /* pAllocator */ + &m_layout_vk); anvil_assert_vk_call_succeeded(result_vk); if (is_vk_call_successful(result_vk)) diff --git a/src/wrappers/query_pool.cpp b/src/wrappers/query_pool.cpp index 7fa830c8..2376c0a4 100644 --- a/src/wrappers/query_pool.cpp +++ b/src/wrappers/query_pool.cpp @@ -85,9 +85,9 @@ Anvil::QueryPool::~QueryPool() { lock(); { - vkDestroyQueryPool(m_device_ptr->get_device_vk(), - m_query_pool_vk, - nullptr /* pAllocator */); + Anvil::Vulkan::vkDestroyQueryPool(m_device_ptr->get_device_vk(), + m_query_pool_vk, + nullptr /* pAllocator */); } unlock(); @@ -191,14 +191,14 @@ bool Anvil::QueryPool::get_query_pool_results_internal(const uint32_t& } /* Execute the request */ - result_vk = vkGetQueryPoolResults(m_device_ptr->get_device_vk(), - m_query_pool_vk, - in_first_query_index, - in_n_queries, - result_query_size * in_n_queries, - out_results_ptr, - (in_should_return_uint64) ? sizeof(uint64_t) : sizeof(uint32_t), - flags); + result_vk = Anvil::Vulkan::vkGetQueryPoolResults(m_device_ptr->get_device_vk(), + m_query_pool_vk, + in_first_query_index, + in_n_queries, + result_query_size * in_n_queries, + out_results_ptr, + (in_should_return_uint64) ? sizeof(uint64_t) : sizeof(uint32_t), + flags); if ((in_query_props & Anvil::QueryResultFlagBits::PARTIAL_BIT) != 0) { @@ -234,10 +234,10 @@ void Anvil::QueryPool::init(VkQueryType in_query_type, create_info.queryType = in_query_type; create_info.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO; - result_vk = vkCreateQueryPool(m_device_ptr->get_device_vk(), - &create_info, - nullptr, /* pAllocator */ - &m_query_pool_vk); + result_vk = Anvil::Vulkan::vkCreateQueryPool(m_device_ptr->get_device_vk(), + &create_info, + nullptr, /* pAllocator */ + &m_query_pool_vk); anvil_assert_vk_call_succeeded(result_vk); if (is_vk_call_successful(result_vk) ) diff --git a/src/wrappers/queue.cpp b/src/wrappers/queue.cpp index 6470d880..c01e2f02 100644 --- a/src/wrappers/queue.cpp +++ b/src/wrappers/queue.cpp @@ -55,10 +55,10 @@ Anvil::Queue::Queue(const Anvil::BaseDevice* in_device_ptr, m_queue_index (in_queue_index) { /* Retrieve the Vulkan handle */ - vkGetDeviceQueue(m_device_ptr->get_device_vk(), - in_queue_family_index, - in_queue_index, - &m_queue); + Anvil::Vulkan::vkGetDeviceQueue(m_device_ptr->get_device_vk(), + in_queue_family_index, + in_queue_index, + &m_queue); anvil_assert(m_queue != VK_NULL_HANDLE); @@ -127,10 +127,10 @@ bool Anvil::Queue::bind_sparse_memory(Anvil::SparseMemoryBindingUpdateInfo& in_u true); /* in_should_lock */ } { - result = vkQueueBindSparse(m_queue, - n_bind_info_items, - bind_info_items, - (fence_ptr != nullptr) ? fence_ptr->get_fence() : VK_NULL_HANDLE); + result = Anvil::Vulkan::vkQueueBindSparse(m_queue, + n_bind_info_items, + bind_info_items, + (fence_ptr != nullptr) ? fence_ptr->get_fence() : VK_NULL_HANDLE); } if (mt_safe) { @@ -755,13 +755,9 @@ VkResult Anvil::Queue::present_internal(DeviceGroupPresentModeFlagBits in_presen static const Anvil::PipelineStageFlags dst_stage_mask(Anvil::PipelineStageFlagBits::TOP_OF_PIPE_BIT); m_device_ptr->get_universal_queue(0)->submit( - SubmitInfo::create(nullptr, - 0, /* in_n_semaphores_to_signal */ - nullptr, /* in_opt_semaphore_to_signal_ptrs_ptr */ - in_n_wait_semaphores, - in_wait_semaphore_ptrs, - &dst_stage_mask, - true) /* in_should_block */ + SubmitInfo::create_wait(in_n_wait_semaphores, + in_wait_semaphore_ptrs, + &dst_stage_mask) ); for (uint32_t n_presentation = 0; @@ -1011,7 +1007,7 @@ bool Anvil::Queue::submit(const Anvil::SubmitInfo& in_submit_info) { const auto& current_submission = in_submit_info.get_signal_semaphores_mgpu()[n_signal_semaphore_submission]; - signal_semaphore_device_indices.at(n_signal_semaphore_submission) = current_submission.physical_device_ptr->get_device_group_device_index(); + signal_semaphore_device_indices.at(n_signal_semaphore_submission) = current_submission.device_index; signal_semaphores_vk.at (n_signal_semaphore_submission) = current_submission.semaphore_ptr->get_semaphore(); } @@ -1021,7 +1017,7 @@ bool Anvil::Queue::submit(const Anvil::SubmitInfo& in_submit_info) { const auto& current_submission = in_submit_info.get_wait_semaphores_mgpu()[n_wait_semaphore_submission]; - wait_semaphore_device_indices.at(n_wait_semaphore_submission) = current_submission.physical_device_ptr->get_device_group_device_index(); + wait_semaphore_device_indices.at(n_wait_semaphore_submission) = current_submission.device_index; wait_semaphores_vk.at (n_wait_semaphore_submission) = current_submission.semaphore_ptr->get_semaphore(); } @@ -1182,20 +1178,20 @@ bool Anvil::Queue::submit(const Anvil::SubmitInfo& in_submit_info) m_submit_fence_ptr->reset(); } - result = vkQueueSubmit(m_queue, - 1, /* submitCount */ - chain_ptr->get_root_struct(), - (fence_ptr != nullptr) ? fence_ptr->get_fence() - : VK_NULL_HANDLE); + result = Anvil::Vulkan::vkQueueSubmit(m_queue, + 1, /* submitCount */ + chain_ptr->get_root_struct(), + (fence_ptr != nullptr) ? fence_ptr->get_fence() + : VK_NULL_HANDLE); if (in_submit_info.get_should_block() ) { /* Wait till initialization finishes GPU-side */ - result = vkWaitForFences(m_device_ptr->get_device_vk(), - 1, /* fenceCount */ - fence_ptr->get_fence_ptr(), - VK_TRUE, /* waitAll */ - in_submit_info.get_timeout() ); + result = Anvil::Vulkan::vkWaitForFences(m_device_ptr->get_device_vk(), + 1, /* fenceCount */ + fence_ptr->get_fence_ptr(), + VK_TRUE, /* waitAll */ + in_submit_info.get_timeout() ); } } @@ -1393,7 +1389,7 @@ void Anvil::Queue::wait_idle() { lock(); { - vkQueueWaitIdle(m_queue); + Anvil::Vulkan::vkQueueWaitIdle(m_queue); } unlock(); } \ No newline at end of file diff --git a/src/wrappers/render_pass.cpp b/src/wrappers/render_pass.cpp index 35275357..ac4e3cac 100644 --- a/src/wrappers/render_pass.cpp +++ b/src/wrappers/render_pass.cpp @@ -54,9 +54,9 @@ Anvil::RenderPass::~RenderPass() if (m_render_pass != VK_NULL_HANDLE) { - vkDestroyRenderPass(m_render_pass_create_info_ptr->get_device()->get_device_vk(), - m_render_pass, - nullptr /* pAllocator */); + Anvil::Vulkan::vkDestroyRenderPass(m_render_pass_create_info_ptr->get_device()->get_device_vk(), + m_render_pass, + nullptr /* pAllocator */); m_render_pass = VK_NULL_HANDLE; } @@ -68,6 +68,8 @@ Anvil::RenderPass::~RenderPass() bool Anvil::RenderPass::init() { std::vector > input_attachment_aspect_reference_ptrs; + std::unique_ptr > multiview_view_mask_vec_ptr; + std::unique_ptr > multiview_view_offset_vec_ptr; std::vector renderpass_attachments_vk; Anvil::StructChainer render_pass_create_info_chainer; bool result (false); @@ -136,6 +138,16 @@ bool Anvil::RenderPass::init() anvil_assert(m_render_pass == VK_NULL_HANDLE); + if (m_render_pass_create_info_ptr->is_multiview_enabled() ) + { + if (!m_device_ptr->get_extension_info()->khr_multiview() ) + { + anvil_assert(m_device_ptr->get_extension_info()->khr_multiview() ); + + goto end; + } + } + /* Set up helper descriptor storage space */ subpass_dependencies_vk.reserve(m_render_pass_create_info_ptr->m_subpass_dependencies.size() ); subpass_descriptions_vk.reserve(m_render_pass_create_info_ptr->m_subpasses.size() ); @@ -176,6 +188,25 @@ bool Anvil::RenderPass::init() dependency_vk.srcSubpass = (subpass_dependency_iterator->source_subpass_ptr != nullptr) ? subpass_dependency_iterator->source_subpass_ptr->index : VK_SUBPASS_EXTERNAL; + #if defined(_DEBUG) + { + if (dependency_vk.dstSubpass == dependency_vk.srcSubpass && + dependency_vk.dstSubpass != VK_SUBPASS_EXTERNAL) + { + uint32_t n_views_active = 0; + uint32_t view_mask = 0; + + m_render_pass_create_info_ptr->get_subpass_view_mask(dependency_vk.dstSubpass, + &view_mask); + + n_views_active = Anvil::Utils::count_set_bits(view_mask); + + anvil_assert( (n_views_active <= 1) || + ((n_views_active > 1 && (dependency_vk.dependencyFlags & VK_DEPENDENCY_VIEW_LOCAL_BIT) != 0)) ); + } + } + #endif + subpass_dependencies_vk.push_back(dependency_vk); } @@ -396,13 +427,82 @@ bool Anvil::RenderPass::init() } } + /* Don't forget about multiview structure, if multiview has been enabled for the renderpass. */ + if (m_render_pass_create_info_ptr->is_multiview_enabled() ) + { + const uint32_t n_subpasses = m_render_pass_create_info_ptr->get_n_subpasses(); + + if (n_subpasses > 0) + { + VkRenderPassMultiviewCreateInfoKHR multiview_create_info; + const uint32_t* correlation_masks_ptr = nullptr; + uint32_t n_correlation_masks = 0; + const uint32_t n_dependencies = m_render_pass_create_info_ptr->get_n_dependencies(); + + m_render_pass_create_info_ptr->get_multiview_correlation_masks(&n_correlation_masks, + &correlation_masks_ptr); + + multiview_view_mask_vec_ptr.reset(new std::vector(n_subpasses) ); + anvil_assert(multiview_view_mask_vec_ptr!= nullptr); + + multiview_view_offset_vec_ptr.reset(new std::vector(n_dependencies, UINT32_MAX) ); + anvil_assert(multiview_view_offset_vec_ptr != nullptr); + + for (uint32_t n_subpass = 0; + n_subpass < n_subpasses; + ++n_subpass) + { + uint32_t multiview_mask = 0; + + if (!m_render_pass_create_info_ptr->get_subpass_view_mask(n_subpass, + &multiview_mask) ) + { + anvil_assert_fail(); + + goto end; + } + + multiview_view_mask_vec_ptr->at(n_subpass) = multiview_mask; + } + + for (uint32_t n_dependency = 0; + n_dependency < n_dependencies; + ++n_dependency) + { + int32_t view_offset = INT32_MAX; + + if (!m_render_pass_create_info_ptr->get_dependency_multiview_properties(n_dependency, + &view_offset) ) + { + anvil_assert_fail(); + + goto end; + } + + multiview_view_offset_vec_ptr->at(n_dependency) = view_offset; + } + + multiview_create_info.correlationMaskCount = n_correlation_masks; + multiview_create_info.dependencyCount = n_dependencies; + multiview_create_info.pCorrelationMasks = correlation_masks_ptr; + multiview_create_info.pNext = nullptr; + multiview_create_info.pViewMasks = &multiview_view_mask_vec_ptr->at(0); + multiview_create_info.pViewOffsets = (n_dependencies != 0) ? &multiview_view_offset_vec_ptr->at(0) : nullptr; + multiview_create_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHR; + multiview_create_info.subpassCount = n_subpasses; + + render_pass_create_info_chainer.append_struct(multiview_create_info); + } + } + + /* All done! Spawn the final chain and try to create the renderpass. */ { auto create_info_chain_ptr = render_pass_create_info_chainer.create_chain(); - result_vk = vkCreateRenderPass(m_device_ptr->get_device_vk(), - create_info_chain_ptr->get_root_struct(), - nullptr, /* pAllocator */ - &m_render_pass); + result_vk = Anvil::Vulkan::vkCreateRenderPass(m_device_ptr->get_device_vk(), + create_info_chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_render_pass); } if (!is_vk_call_successful(result_vk) ) diff --git a/src/wrappers/rendering_surface.cpp b/src/wrappers/rendering_surface.cpp index adfd05fd..c4fc6ec4 100644 --- a/src/wrappers/rendering_surface.cpp +++ b/src/wrappers/rendering_surface.cpp @@ -76,13 +76,13 @@ Anvil::RenderingSurface::~RenderingSurface() /* Please see header for specification */ void Anvil::RenderingSurface::cache_surface_properties() { - const Anvil::DeviceType& device_type (m_device_ptr->get_type() ); - bool is_offscreen_rendering_enabled(true); - auto khr_surface_entrypoints (m_instance_ptr->get_extension_khr_surface_entrypoints() ); - const Anvil::MGPUDevice* mgpu_device_ptr (dynamic_cast(m_device_ptr)); - uint32_t n_physical_devices (0); - const Anvil::SGPUDevice* sgpu_device_ptr (dynamic_cast(m_device_ptr)); - std::vector supported_formats; + const Anvil::DeviceType& device_type (m_device_ptr->get_type() ); + bool is_offscreen_rendering_enabled(true); + auto khr_surface_entrypoints (m_instance_ptr->get_extension_khr_surface_entrypoints() ); + const Anvil::MGPUDevice* mgpu_device_ptr (dynamic_cast(m_device_ptr)); + uint32_t n_physical_devices (0); + const Anvil::SGPUDevice* sgpu_device_ptr (dynamic_cast(m_device_ptr)); + std::vector supported_formats; if (m_window_ptr != nullptr) { @@ -194,7 +194,7 @@ void Anvil::RenderingSurface::cache_surface_properties() result = khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceFormatsKHR(physical_device_vk, m_surface, &n_supported_formats, - &supported_formats.at(0) ); + reinterpret_cast(&supported_formats.at(0) )); anvil_assert_vk_call_succeeded(result); for (unsigned int n_format = 0; @@ -484,10 +484,12 @@ bool Anvil::RenderingSurface::init() VkBool32 is_presentation_supported = VK_FALSE; { - result = vkGetPhysicalDeviceSurfaceSupportKHR(physical_device_ptr->get_physical_device(), - n_queue_family, - m_surface, - &is_presentation_supported); + const auto& khr_surface_entrypoints = m_instance_ptr->get_extension_khr_surface_entrypoints(); + + result = khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceSupportKHR(physical_device_ptr->get_physical_device(), + n_queue_family, + m_surface, + &is_presentation_supported); } if (is_vk_call_successful(result) && diff --git a/src/wrappers/sampler.cpp b/src/wrappers/sampler.cpp index eeb767e9..34d76a3d 100644 --- a/src/wrappers/sampler.cpp +++ b/src/wrappers/sampler.cpp @@ -52,9 +52,9 @@ Anvil::Sampler::~Sampler() { lock(); { - vkDestroySampler(m_device_ptr->get_device_vk(), - m_sampler, - nullptr /* pAllocator */); + Anvil::Vulkan::vkDestroySampler(m_device_ptr->get_device_vk(), + m_sampler, + nullptr /* pAllocator */); } unlock(); @@ -85,7 +85,8 @@ Anvil::SamplerUniquePtr Anvil::Sampler::create(Anvil::SamplerCreateInfoUniquePtr bool Anvil::Sampler::init() { - VkResult result (VK_ERROR_INITIALIZATION_FAILED); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + const auto sampler_reduction_mode(m_create_info_ptr->get_sampler_reduction_mode() ); Anvil::StructChainer struct_chainer; ANVIL_REDUNDANT_VARIABLE(result); @@ -117,13 +118,24 @@ bool Anvil::Sampler::init() struct_chainer.append_struct(sampler_create_info); } + if (sampler_reduction_mode != Anvil::SamplerReductionMode::UNKNOWN) + { + VkSamplerReductionModeCreateInfoEXT srm_create_info; + + srm_create_info.pNext = nullptr; + srm_create_info.reductionMode = static_cast(sampler_reduction_mode); + srm_create_info.sType = VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT; + + struct_chainer.append_struct(srm_create_info); + } + { auto chain_ptr = struct_chainer.create_chain(); - result = vkCreateSampler(m_device_ptr->get_device_vk(), - chain_ptr->get_root_struct(), - nullptr, /* pAllocator */ - &m_sampler); + result = Anvil::Vulkan::vkCreateSampler(m_device_ptr->get_device_vk(), + chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_sampler); } anvil_assert_vk_call_succeeded(result); diff --git a/src/wrappers/semaphore.cpp b/src/wrappers/semaphore.cpp index d6558632..d25057f7 100644 --- a/src/wrappers/semaphore.cpp +++ b/src/wrappers/semaphore.cpp @@ -273,9 +273,9 @@ void Anvil::Semaphore::release_semaphore() { lock(); { - vkDestroySemaphore(m_device_ptr->get_device_vk(), - m_semaphore, - nullptr /* pAllocator */); + Anvil::Vulkan::vkDestroySemaphore(m_device_ptr->get_device_vk(), + m_semaphore, + nullptr /* pAllocator */); } unlock(); @@ -358,10 +358,10 @@ bool Anvil::Semaphore::reset() goto end; } - result = vkCreateSemaphore(m_device_ptr->get_device_vk(), - struct_chain_ptr->get_root_struct(), - nullptr, /* pAllocator */ - &m_semaphore); + result = Anvil::Vulkan::vkCreateSemaphore(m_device_ptr->get_device_vk(), + struct_chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_semaphore); anvil_assert_vk_call_succeeded(result); if (is_vk_call_successful(result) ) diff --git a/src/wrappers/shader_module.cpp b/src/wrappers/shader_module.cpp index 9475373b..2f9120b0 100644 --- a/src/wrappers/shader_module.cpp +++ b/src/wrappers/shader_module.cpp @@ -277,9 +277,9 @@ void Anvil::ShaderModule::destroy() { lock(); { - vkDestroyShaderModule(m_device_ptr->get_device_vk(), - m_module, - nullptr /* pAllocator */); + Anvil::Vulkan::vkDestroyShaderModule(m_device_ptr->get_device_vk(), + m_module, + nullptr /* pAllocator */); } unlock(); @@ -324,10 +324,10 @@ bool Anvil::ShaderModule::init_from_spirv_blob(const char* in_spirv_blob, shader_module_create_info.pNext = nullptr; shader_module_create_info.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; - result_vk = vkCreateShaderModule(m_device_ptr->get_device_vk(), - &shader_module_create_info, - nullptr, /* pAllocator */ - &m_module); + result_vk = Anvil::Vulkan::vkCreateShaderModule(m_device_ptr->get_device_vk(), + &shader_module_create_info, + nullptr, /* pAllocator */ + &m_module); anvil_assert_vk_call_succeeded(result_vk); if (is_vk_call_successful(result_vk) ) diff --git a/src/wrappers/swapchain.cpp b/src/wrappers/swapchain.cpp index ecad0436..aee78a93 100644 --- a/src/wrappers/swapchain.cpp +++ b/src/wrappers/swapchain.cpp @@ -235,11 +235,11 @@ uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_ if (fence_handle != VK_NULL_HANDLE) { - result_vk = vkWaitForFences(m_device_ptr->get_device_vk(), - 1, /* fenceCount */ - &fence_handle, - VK_TRUE, /* waitAll */ - UINT64_MAX); + result_vk = Anvil::Vulkan::vkWaitForFences(m_device_ptr->get_device_vk(), + 1, /* fenceCount */ + &fence_handle, + VK_TRUE, /* waitAll */ + UINT64_MAX); anvil_assert_vk_call_succeeded(result_vk); } @@ -465,7 +465,7 @@ bool Anvil::Swapchain::init() create_info.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; create_info.flags = m_create_info_ptr->get_flags().get_vk(); create_info.imageArrayLayers = 1; - create_info.imageColorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR; + create_info.imageColorSpace = static_cast(m_create_info_ptr->get_color_space() ); create_info.imageExtent.height = parent_surface_ptr->get_height(); create_info.imageExtent.width = parent_surface_ptr->get_width (); create_info.imageFormat = static_cast(m_create_info_ptr->get_format() ); @@ -757,4 +757,36 @@ void Anvil::Swapchain::on_present_request_issued(Anvil::CallbackArgument* in_cal m_n_present_counter++; } } +} + +/** Please see header for specification */ +void Anvil::Swapchain::set_hdr_metadata(const uint32_t& in_n_swapchains, + Anvil::Swapchain** in_swapchains_ptr_ptr, + const Anvil::HdrMetadataEXT* in_metadata_items_ptr) +{ + anvil_assert(in_n_swapchains > 0); + + auto device_ptr = in_swapchains_ptr_ptr[0]->get_create_info_ptr()->get_device(); + const auto& entrypoints = device_ptr->get_extension_ext_hdr_metadata_entrypoints (); + auto metadata_vk_vec = std::vector(in_n_swapchains); + auto swapchain_vk_vec = std::vector (in_n_swapchains); + + for (uint32_t n_swapchain = 0; + n_swapchain < in_n_swapchains; + ++n_swapchain) + { + metadata_vk_vec.at (n_swapchain) = in_metadata_items_ptr[n_swapchain].get_vk (); + swapchain_vk_vec.at(n_swapchain) = in_swapchains_ptr_ptr[n_swapchain]->get_swapchain_vk(); + + #if defined(_DEBUG) + { + anvil_assert(in_swapchains_ptr_ptr[n_swapchain]->get_create_info_ptr()->get_device() == device_ptr); + } + #endif + } + + entrypoints.vkSetHdrMetadataEXT(device_ptr->get_device_vk(), + in_n_swapchains, + &swapchain_vk_vec.at(0), + &metadata_vk_vec.at (0) ); } \ No newline at end of file From 650fd70a64357c2af5d381b08b2750df311b7f61 Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Fri, 5 Oct 2018 15:08:36 +0200 Subject: [PATCH 25/50] Fix Travis CI errors.. --- .travis.yml | 2 +- CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 88c679b6..e978e943 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,4 +29,4 @@ install: script: - mkdir build - cd build - - ${DEPS_DIR}/cmake/bin/cmake -G "Unix Makefiles" .. && make \ No newline at end of file + - ${DEPS_DIR}/cmake/bin/cmake -DCONTINUOUS_INTEGRATION_RUN=ON -G "Unix Makefiles" .. && make \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index a4db22c3..aef8ee13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,7 +42,7 @@ else() endif() endif() -if (ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB) +if (ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB AND NOT CONTINUOUS_INTEGRATION_RUN) if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") find_library(VULKAN_LIBRARY NAMES vulkan-1 vulkan From 9bfaea84d9cc7c2cc79f2132e81000292d4e4b00 Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Fri, 12 Oct 2018 15:59:40 +0200 Subject: [PATCH 26/50] Week 41 update --- examples/DynamicBuffers/src/app.cpp | 78 +- examples/MultiViewport/src/app.cpp | 13 +- examples/OcclusionQuery/src/app.cpp | 60 +- examples/OutOfOrderRasterization/src/app.cpp | 78 +- examples/PushConstants/src/app.cpp | 22 +- include/misc/base_pipeline_create_info.h | 5 + include/misc/base_pipeline_manager.h | 2 +- include/misc/buffer_create_info.h | 90 +- include/misc/graphics_pipeline_create_info.h | 2 +- include/misc/image_create_info.h | 214 +-- include/misc/memory_allocator.h | 2 + include/misc/struct_chainer.h | 92 +- include/misc/types_enums.h | 40 +- include/wrappers/buffer.h | 2 - include/wrappers/graphics_pipeline_manager.h | 34 +- include/wrappers/pipeline_layout.h | 2 +- src/misc/base_pipeline_manager.cpp | 2 +- src/misc/buffer_create_info.cpp | 118 +- src/misc/dummy_window.cpp | 45 +- src/misc/graphics_pipeline_create_info.cpp | 2 +- src/misc/image_create_info.cpp | 151 +- src/misc/memory_allocator.cpp | 51 +- src/misc/types_classes.cpp | 46 +- src/wrappers/buffer.cpp | 168 +- src/wrappers/graphics_pipeline_manager.cpp | 1725 ++++++++++-------- src/wrappers/image.cpp | 124 +- src/wrappers/memory_block.cpp | 14 +- src/wrappers/render_pass.cpp | 21 +- src/wrappers/swapchain.cpp | 34 +- 29 files changed, 1696 insertions(+), 1541 deletions(-) diff --git a/examples/DynamicBuffers/src/app.cpp b/examples/DynamicBuffers/src/app.cpp index 54ffafd8..d16aa1c5 100644 --- a/examples/DynamicBuffers/src/app.cpp +++ b/examples/DynamicBuffers/src/app.cpp @@ -420,11 +420,12 @@ void App::init_buffers() * after memory allocator actually assigns it a memory block. */ { - auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), - m_sine_offset_data_buffer_size, - Anvil::QueueFamilyFlagBits::COMPUTE_BIT | Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, - Anvil::SharingMode::CONCURRENT, - Anvil::BufferUsageFlagBits::STORAGE_BUFFER_BIT); + auto create_info_ptr = Anvil::BufferCreateInfo::create_no_alloc(m_device_ptr.get(), + m_sine_offset_data_buffer_size, + Anvil::QueueFamilyFlagBits::COMPUTE_BIT | Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, + Anvil::SharingMode::CONCURRENT, + Anvil::BufferCreateFlagBits::NONE, + Anvil::BufferUsageFlagBits::STORAGE_BUFFER_BIT); m_sine_offset_data_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -462,11 +463,12 @@ void App::init_buffers() m_sine_data_buffer_size *= 2; { - auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), - m_sine_data_buffer_size, - Anvil::QueueFamilyFlagBits::COMPUTE_BIT | Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, - Anvil::SharingMode::CONCURRENT, - Anvil::BufferUsageFlagBits::STORAGE_BUFFER_BIT); + auto create_info_ptr = Anvil::BufferCreateInfo::create_no_alloc(m_device_ptr.get(), + m_sine_data_buffer_size, + Anvil::QueueFamilyFlagBits::COMPUTE_BIT | Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, + Anvil::SharingMode::CONCURRENT, + Anvil::BufferCreateFlagBits::NONE, + Anvil::BufferUsageFlagBits::STORAGE_BUFFER_BIT); m_sine_data_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -485,11 +487,12 @@ void App::init_buffers() m_sine_props_data_buffer_size_per_swapchain_image = sine_props_data_buffer_size_per_swapchain_image; { - auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), - sine_props_data_buffer_size_total, - Anvil::QueueFamilyFlagBits::COMPUTE_BIT | Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, - Anvil::SharingMode::CONCURRENT, - Anvil::BufferUsageFlagBits::UNIFORM_BUFFER_BIT); + auto create_info_ptr = Anvil::BufferCreateInfo::create_no_alloc(m_device_ptr.get(), + sine_props_data_buffer_size_total, + Anvil::QueueFamilyFlagBits::COMPUTE_BIT | Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, + Anvil::SharingMode::CONCURRENT, + Anvil::BufferCreateFlagBits::NONE, + Anvil::BufferUsageFlagBits::UNIFORM_BUFFER_BIT); m_sine_props_data_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -523,11 +526,12 @@ void App::init_buffers() } { - auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), - m_sine_color_buffer_size, - Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, - Anvil::SharingMode::EXCLUSIVE, - Anvil::BufferUsageFlagBits::VERTEX_BUFFER_BIT); + auto create_info_ptr = Anvil::BufferCreateInfo::create_no_alloc(m_device_ptr.get(), + m_sine_color_buffer_size, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, + Anvil::SharingMode::EXCLUSIVE, + Anvil::BufferCreateFlagBits::NONE, + Anvil::BufferUsageFlagBits::VERTEX_BUFFER_BIT); m_sine_color_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -1028,23 +1032,23 @@ void App::init_images() ++n_depth_image) { { - auto create_info_ptr = Anvil::ImageCreateInfo::create_nonsparse_alloc(m_device_ptr.get(), - Anvil::ImageType::_2D, - Anvil::Format::D16_UNORM, - Anvil::ImageTiling::OPTIMAL, - Anvil::ImageUsageFlagBits::DEPTH_STENCIL_ATTACHMENT_BIT, - WINDOW_WIDTH, - WINDOW_HEIGHT, - 1, /* in_base_mipmap_depth */ - 1, /* in_n_layers */ - Anvil::SampleCountFlagBits::_1_BIT, - Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, - Anvil::SharingMode::EXCLUSIVE, - false, /* in_use_full_mipmap_chain */ - Anvil::MemoryFeatureFlagBits::NONE, - Anvil::ImageCreateFlagBits::NONE, - Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, - nullptr); /* in_mipmaps_ptr */ + auto create_info_ptr = Anvil::ImageCreateInfo::create_alloc(m_device_ptr.get(), + Anvil::ImageType::_2D, + Anvil::Format::D16_UNORM, + Anvil::ImageTiling::OPTIMAL, + Anvil::ImageUsageFlagBits::DEPTH_STENCIL_ATTACHMENT_BIT, + WINDOW_WIDTH, + WINDOW_HEIGHT, + 1, /* in_base_mipmap_depth */ + 1, /* in_n_layers */ + Anvil::SampleCountFlagBits::_1_BIT, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, + Anvil::SharingMode::EXCLUSIVE, + false, /* in_use_full_mipmap_chain */ + Anvil::MemoryFeatureFlagBits::NONE, + Anvil::ImageCreateFlagBits::NONE, + Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + nullptr); /* in_mipmaps_ptr */ m_depth_images[n_depth_image] = Anvil::Image::create(std::move(create_info_ptr) ); } diff --git a/examples/MultiViewport/src/app.cpp b/examples/MultiViewport/src/app.cpp index b755ef78..0968fba2 100644 --- a/examples/MultiViewport/src/app.cpp +++ b/examples/MultiViewport/src/app.cpp @@ -474,12 +474,13 @@ void App::init_buffers() auto mesh_data_ptr = get_mesh_data(); /* Initialize the buffer object */ - auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr.get(), - get_mesh_data_size(), - Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, - Anvil::SharingMode::EXCLUSIVE, - Anvil::BufferUsageFlagBits::VERTEX_BUFFER_BIT, - Anvil::MemoryFeatureFlagBits::NONE); /* in_memory_features */ + auto create_info_ptr = Anvil::BufferCreateInfo::create_alloc(m_device_ptr.get(), + get_mesh_data_size(), + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, + Anvil::SharingMode::EXCLUSIVE, + Anvil::BufferCreateFlagBits::NONE, + Anvil::BufferUsageFlagBits::VERTEX_BUFFER_BIT, + Anvil::MemoryFeatureFlagBits::NONE); /* in_memory_features */ create_info_ptr->set_client_data(mesh_data_ptr.get() ); diff --git a/examples/OcclusionQuery/src/app.cpp b/examples/OcclusionQuery/src/app.cpp index d1f67791..0b20e9b6 100644 --- a/examples/OcclusionQuery/src/app.cpp +++ b/examples/OcclusionQuery/src/app.cpp @@ -352,23 +352,25 @@ void App::init_buffers() uniform_alignment_req) ); { - auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr.get(), - m_n_bytes_per_query * N_SWAPCHAIN_IMAGES, - Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, - Anvil::SharingMode::EXCLUSIVE, - Anvil::BufferUsageFlagBits::UNIFORM_BUFFER_BIT | Anvil::BufferUsageFlagBits::TRANSFER_DST_BIT, - Anvil::MemoryFeatureFlagBits::NONE); /* in_memory_features */ + auto create_info_ptr = Anvil::BufferCreateInfo::create_alloc(m_device_ptr.get(), + m_n_bytes_per_query * N_SWAPCHAIN_IMAGES, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, + Anvil::SharingMode::EXCLUSIVE, + Anvil::BufferCreateFlagBits::NONE, + Anvil::BufferUsageFlagBits::UNIFORM_BUFFER_BIT | Anvil::BufferUsageFlagBits::TRANSFER_DST_BIT, + Anvil::MemoryFeatureFlagBits::NONE); /* in_memory_features */ m_query_bo_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } { - auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr.get(), - m_time_n_bytes_per_swapchain_image * N_SWAPCHAIN_IMAGES, - Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, - Anvil::SharingMode::EXCLUSIVE, - Anvil::BufferUsageFlagBits::UNIFORM_BUFFER_BIT, - Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT); + auto create_info_ptr = Anvil::BufferCreateInfo::create_alloc(m_device_ptr.get(), + m_time_n_bytes_per_swapchain_image * N_SWAPCHAIN_IMAGES, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, + Anvil::SharingMode::EXCLUSIVE, + Anvil::BufferCreateFlagBits::NONE, + Anvil::BufferUsageFlagBits::UNIFORM_BUFFER_BIT, + Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT); m_time_bo_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -672,23 +674,23 @@ void App::init_framebuffers() void App::init_images() { { - auto create_info_ptr = Anvil::ImageCreateInfo::create_nonsparse_alloc(m_device_ptr.get(), - Anvil::ImageType::_2D, - Anvil::Format::D16_UNORM, - Anvil::ImageTiling::OPTIMAL, - Anvil::ImageUsageFlagBits::DEPTH_STENCIL_ATTACHMENT_BIT, - WINDOW_WIDTH, - WINDOW_HEIGHT, - 1, /* base_mipmap_depth */ - 1, /* n_layers */ - Anvil::SampleCountFlagBits::_1_BIT, - Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, - Anvil::SharingMode::EXCLUSIVE, - false, /* use_full_mipmap_chain */ - Anvil::MemoryFeatureFlagBits::NONE, /* in_memory_features */ - Anvil::ImageCreateFlagBits::NONE, - Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, - nullptr); + auto create_info_ptr = Anvil::ImageCreateInfo::create_alloc(m_device_ptr.get(), + Anvil::ImageType::_2D, + Anvil::Format::D16_UNORM, + Anvil::ImageTiling::OPTIMAL, + Anvil::ImageUsageFlagBits::DEPTH_STENCIL_ATTACHMENT_BIT, + WINDOW_WIDTH, + WINDOW_HEIGHT, + 1, /* base_mipmap_depth */ + 1, /* n_layers */ + Anvil::SampleCountFlagBits::_1_BIT, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, + Anvil::SharingMode::EXCLUSIVE, + false, /* use_full_mipmap_chain */ + Anvil::MemoryFeatureFlagBits::NONE, /* in_memory_features */ + Anvil::ImageCreateFlagBits::NONE, + Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + nullptr); m_depth_image_ptr = Anvil::Image::create(std::move(create_info_ptr) ); } diff --git a/examples/OutOfOrderRasterization/src/app.cpp b/examples/OutOfOrderRasterization/src/app.cpp index 087c8260..d3bf4322 100644 --- a/examples/OutOfOrderRasterization/src/app.cpp +++ b/examples/OutOfOrderRasterization/src/app.cpp @@ -431,31 +431,34 @@ void App::init_buffers() allocator_ptr = Anvil::MemoryAllocator::create_oneshot(m_device_ptr.get() ); { - auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), - index_data_size, - Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, - Anvil::SharingMode::EXCLUSIVE, - Anvil::BufferUsageFlagBits::INDEX_BUFFER_BIT); + auto create_info_ptr = Anvil::BufferCreateInfo::create_no_alloc(m_device_ptr.get(), + index_data_size, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, + Anvil::SharingMode::EXCLUSIVE, + Anvil::BufferCreateFlagBits::NONE, + Anvil::BufferUsageFlagBits::INDEX_BUFFER_BIT); m_index_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } { - auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), - sizeof(uint64_t) * m_n_swapchain_images * 2, /* top of pipe, bottom of pipe */ - Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, - Anvil::SharingMode::EXCLUSIVE, - Anvil::BufferUsageFlagBits::TRANSFER_SRC_BIT | Anvil::BufferUsageFlagBits::TRANSFER_DST_BIT); + auto create_info_ptr = Anvil::BufferCreateInfo::create_no_alloc(m_device_ptr.get(), + sizeof(uint64_t) * m_n_swapchain_images * 2, /* top of pipe, bottom of pipe */ + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, + Anvil::SharingMode::EXCLUSIVE, + Anvil::BufferCreateFlagBits::NONE, + Anvil::BufferUsageFlagBits::TRANSFER_SRC_BIT | Anvil::BufferUsageFlagBits::TRANSFER_DST_BIT); m_query_results_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } { - auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), - vertex_data_size, - Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, - Anvil::SharingMode::EXCLUSIVE, - Anvil::BufferUsageFlagBits::VERTEX_BUFFER_BIT); + auto create_info_ptr = Anvil::BufferCreateInfo::create_no_alloc(m_device_ptr.get(), + vertex_data_size, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, + Anvil::SharingMode::EXCLUSIVE, + Anvil::BufferCreateFlagBits::NONE, + Anvil::BufferUsageFlagBits::VERTEX_BUFFER_BIT); m_vertex_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -479,11 +482,12 @@ void App::init_buffers() Anvil::BufferUniquePtr new_buffer_ptr; { - auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), - properties_data_size, - Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, - Anvil::SharingMode::EXCLUSIVE, - Anvil::BufferUsageFlagBits::STORAGE_BUFFER_BIT); + auto create_info_ptr = Anvil::BufferCreateInfo::create_no_alloc(m_device_ptr.get(), + properties_data_size, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, + Anvil::SharingMode::EXCLUSIVE, + Anvil::BufferCreateFlagBits::NONE, + Anvil::BufferUsageFlagBits::STORAGE_BUFFER_BIT); new_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -785,23 +789,23 @@ void App::init_gfx_pipelines() void App::init_images() { { - auto create_info_ptr = Anvil::ImageCreateInfo::create_nonsparse_alloc(m_device_ptr.get(), - Anvil::ImageType::_2D, - Anvil::Format::D32_SFLOAT, - Anvil::ImageTiling::OPTIMAL, - Anvil::ImageUsageFlagBits::DEPTH_STENCIL_ATTACHMENT_BIT, - m_window_ptr->get_width_at_creation_time (), - m_window_ptr->get_height_at_creation_time(), - 1, /* base_mipmap_depth */ - 1, /* n_layers */ - Anvil::SampleCountFlagBits::_1_BIT, - Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, - Anvil::SharingMode::EXCLUSIVE, - false, /* in_use_full_mipmap_chain */ - Anvil::MemoryFeatureFlagBits::NONE, - Anvil::ImageCreateFlagBits::NONE, - Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* in_final_image_layout */ - nullptr); /* in_mipmaps_ptr */ + auto create_info_ptr = Anvil::ImageCreateInfo::create_alloc(m_device_ptr.get(), + Anvil::ImageType::_2D, + Anvil::Format::D32_SFLOAT, + Anvil::ImageTiling::OPTIMAL, + Anvil::ImageUsageFlagBits::DEPTH_STENCIL_ATTACHMENT_BIT, + m_window_ptr->get_width_at_creation_time (), + m_window_ptr->get_height_at_creation_time(), + 1, /* base_mipmap_depth */ + 1, /* n_layers */ + Anvil::SampleCountFlagBits::_1_BIT, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, + Anvil::SharingMode::EXCLUSIVE, + false, /* in_use_full_mipmap_chain */ + Anvil::MemoryFeatureFlagBits::NONE, + Anvil::ImageCreateFlagBits::NONE, + Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* in_final_image_layout */ + nullptr); /* in_mipmaps_ptr */ m_depth_image_ptr = Anvil::Image::create(std::move(create_info_ptr) ); } diff --git a/examples/PushConstants/src/app.cpp b/examples/PushConstants/src/app.cpp index bba0def8..8b7ca278 100644 --- a/examples/PushConstants/src/app.cpp +++ b/examples/PushConstants/src/app.cpp @@ -416,11 +416,12 @@ void App::init_buffers() /* Set up a buffer to hold uniform data */ { - auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), - ub_data_size_total, - Anvil::QueueFamilyFlagBits::COMPUTE_BIT | Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, - Anvil::SharingMode::EXCLUSIVE, - Anvil::BufferUsageFlagBits::UNIFORM_BUFFER_BIT); + auto create_info_ptr = Anvil::BufferCreateInfo::create_no_alloc(m_device_ptr.get(), + ub_data_size_total, + Anvil::QueueFamilyFlagBits::COMPUTE_BIT | Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, + Anvil::SharingMode::EXCLUSIVE, + Anvil::BufferCreateFlagBits::NONE, + Anvil::BufferUsageFlagBits::UNIFORM_BUFFER_BIT); m_data_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } @@ -432,11 +433,12 @@ void App::init_buffers() /* Set up a buffer to hold mesh data */ { - auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_no_alloc(m_device_ptr.get(), - get_mesh_data_size(), - Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, - Anvil::SharingMode::EXCLUSIVE, - Anvil::BufferUsageFlagBits::VERTEX_BUFFER_BIT); + auto create_info_ptr = Anvil::BufferCreateInfo::create_no_alloc(m_device_ptr.get(), + get_mesh_data_size(), + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, + Anvil::SharingMode::EXCLUSIVE, + Anvil::BufferCreateFlagBits::NONE, + Anvil::BufferUsageFlagBits::VERTEX_BUFFER_BIT); m_mesh_data_buffer_ptr = Anvil::Buffer::create(std::move(create_info_ptr) ); } diff --git a/include/misc/base_pipeline_create_info.h b/include/misc/base_pipeline_create_info.h index 424a7fe0..70c3d3ae 100644 --- a/include/misc/base_pipeline_create_info.h +++ b/include/misc/base_pipeline_create_info.h @@ -49,6 +49,11 @@ namespace Anvil return m_base_pipeline_id; } + const Anvil::PipelineCreateFlags& get_create_flags() const + { + return m_create_flags; + } + const std::vector* get_ds_create_info_items() const { return &m_ds_create_info_items; diff --git a/include/misc/base_pipeline_manager.h b/include/misc/base_pipeline_manager.h index f63eb033..156b0b3a 100644 --- a/include/misc/base_pipeline_manager.h +++ b/include/misc/base_pipeline_manager.h @@ -213,7 +213,7 @@ namespace Anvil void bake_specialization_info_vk(const SpecializationConstants& in_specialization_constants, const unsigned char* in_specialization_constant_data_ptr, std::vector* out_specialization_map_entry_vk_vector, - VkSpecializationInfo* out_specialization_info_ptr); + VkSpecializationInfo* out_specialization_info_ptr) const; /* Protected members */ const Anvil::BaseDevice* m_device_ptr; diff --git a/include/misc/buffer_create_info.h b/include/misc/buffer_create_info.h index 0a43cfb4..4bcdc1ab 100644 --- a/include/misc/buffer_create_info.h +++ b/include/misc/buffer_create_info.h @@ -32,7 +32,7 @@ namespace Anvil public: /* Public functions */ - /** Creates a create info for a NON-SPARSE buffer object. + /** Creates a create info for a buffer object. * * A buffer instance created using the returned info instance WILL ALLOCATE and have a unique memory block BOUND to the object. * Do NOT call Buffer::set_memory() to configure the binding. @@ -50,18 +50,20 @@ namespace Anvil * @param in_queue_families Queue families which the buffer object is going to be used with. * One or more user queue family bits can be enabled. * @param in_sharing_mode Sharing mode to pass to the vkCreateBuffer() call. + * @param in_create_flags Create flags to use. Must not include SPARSE_ALIASED, SPARSE_BINDING and SPARSE_RESIDENCY bits. * @param in_usage_flags Usage flags to set in the VkBufferCreateInfo descriptor, passed to * to the vkCreateBuffer() call. * @param in_memory_freatures Required memory features. **/ - static Anvil::BufferCreateInfoUniquePtr create_nonsparse_alloc(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - Anvil::QueueFamilyFlags in_queue_families, - Anvil::SharingMode in_sharing_mode, - Anvil::BufferUsageFlags in_usage_flags, - Anvil::MemoryFeatureFlags in_memory_features); - - /** Creates a create info for a NON-SPARSE buffer object. + static Anvil::BufferCreateInfoUniquePtr create_alloc(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + Anvil::QueueFamilyFlags in_queue_families, + Anvil::SharingMode in_sharing_mode, + Anvil::BufferCreateFlags in_create_flags, + Anvil::BufferUsageFlags in_usage_flags, + Anvil::MemoryFeatureFlags in_memory_features); + + /** Creates a create info for a buffer object. * * A buffer instance created using the returned info instance will NOT allocate or have any memory blocks bound * to itself. It is user's responsibility to call Buffer::set_memory() to configure the binding. @@ -79,15 +81,16 @@ namespace Anvil * @param in_usage_flags Usage flags to set in the VkBufferCreateInfo descriptor, passed to * to the vkCreateBuffer() call. **/ - static Anvil::BufferCreateInfoUniquePtr create_nonsparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - Anvil::QueueFamilyFlags in_queue_families, - Anvil::SharingMode in_sharing_mode, - Anvil::BufferUsageFlags in_usage_flags); - - /** Creates a create info for a NON-SPARSE buffer object. + static Anvil::BufferCreateInfoUniquePtr create_no_alloc(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + Anvil::QueueFamilyFlags in_queue_families, + Anvil::SharingMode in_sharing_mode, + Anvil::BufferCreateFlags in_create_flags, + Anvil::BufferUsageFlags in_usage_flags); + + /** Creates a create info for a buffer object. * - * The new NON-SPARSE buffer will reuse a region of the specified buffer's storage, instead of creating one's own. + * The new buffer will reuse a region of the specified buffer's storage, instead of creating one's own. * * It is user's responsibility to ensure memory aliasing or synchronization is used, according * to the spec rules. @@ -97,41 +100,20 @@ namespace Anvil * @param in_start_offset Memory region's start offset. * @param in_size Size of the memory region to "claim". **/ - static Anvil::BufferCreateInfoUniquePtr create_nonsparse_no_alloc_child(Anvil::Buffer* in_parent_nonsparse_buffer_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size); - - /** Creates a create info for a SPARSE buffer object. - * - * A buffer instance created using the returned info instance will NOT allocate or have any memory blocks bound - * to itself. It is user's responsibility to call Queue::bind_sparse_memory() afterward to update page configuration. - * - * @param in_device_ptr Device to use. - * @param in_size Size of the buffer object to be initialized. - * @param in_queue_families Queue families which the buffer object is going to be used with. - * One or more user queue family bits can be enabled. - * @param in_sharing_mode Sharing mode to pass with the vkCreateBuffer() call. - * @param in_usage_flags Usage flags to set in the VkBufferCreateInfo descriptor, passed to - * to the vkCreateBuffer() call. - * @param in_residency_scope Scope of residency to support for the buffer. - * @param in_external_memory_handle_types If the buffer is going to be exported to another process or Vulkan instance, use - * this field to specify which handle types the allocation needs to support. Please see - * documentation of Anvil::ExternalMemoryHandleTypeBits for more details. - **/ - static Anvil::BufferCreateInfoUniquePtr create_sparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - Anvil::QueueFamilyFlags in_queue_families, - Anvil::SharingMode in_sharing_mode, - Anvil::BufferUsageFlags in_usage_flags, - Anvil::SparseResidencyScope in_residency_scope, - MTSafety in_mt_safety = MTSafety::INHERIT_FROM_PARENT_DEVICE, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE); + static Anvil::BufferCreateInfoUniquePtr create_no_alloc_child(Anvil::Buffer* in_parent_nonsparse_buffer_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size); const void* const get_client_data() const { return m_client_data_ptr; } + const Anvil::BufferCreateFlags& get_create_flags() const + { + return m_create_flags; + } + const Anvil::BaseDevice* get_device() const { return m_device_ptr; @@ -164,17 +146,6 @@ namespace Anvil return m_queue_families; } - /** Returns the residency scope. - * - * Triggers an assertion failure if called for non-sparse images - */ - Anvil::SparseResidencyScope get_residency_scope() const - { - anvil_assert(m_type == Anvil::BufferType::SPARSE_NO_ALLOC); - - return m_residency_scope; - } - /** Returns sharing mode of the buffer */ Anvil::SharingMode get_sharing_mode() const { @@ -277,8 +248,8 @@ namespace Anvil VkDeviceSize in_size, Anvil::QueueFamilyFlags in_queue_families, Anvil::SharingMode in_sharing_mode, + Anvil::BufferCreateFlags in_create_flags, Anvil::BufferUsageFlags in_usage_flags, - Anvil::SparseResidencyScope in_residency_scope, MTSafety in_mt_safety, Anvil::ExternalMemoryHandleTypeFlags in_exportable_external_memory_handle_types); BufferCreateInfo(const Anvil::BufferType& in_buffer_type, @@ -286,6 +257,7 @@ namespace Anvil VkDeviceSize in_size, Anvil::QueueFamilyFlags in_queue_families, Anvil::SharingMode in_sharing_mode, + Anvil::BufferCreateFlags in_create_flags, Anvil::BufferUsageFlags in_usage_flags, MemoryFeatureFlags in_memory_features, MTSafety in_mt_safety, @@ -298,13 +270,13 @@ namespace Anvil /* Private variables */ const void* m_client_data_ptr; + Anvil::BufferCreateFlags m_create_flags; const Anvil::BaseDevice* m_device_ptr; Anvil::ExternalMemoryHandleTypeFlags m_exportable_external_memory_handle_types; Anvil::MemoryFeatureFlags m_memory_features; MTSafety m_mt_safety; Anvil::Buffer* const m_parent_buffer_ptr; Anvil::QueueFamilyFlags m_queue_families; - const Anvil::SparseResidencyScope m_residency_scope; Anvil::SharingMode m_sharing_mode; VkDeviceSize m_size; VkDeviceSize m_start_offset; diff --git a/include/misc/graphics_pipeline_create_info.h b/include/misc/graphics_pipeline_create_info.h index b3d9b73c..823218bf 100644 --- a/include/misc/graphics_pipeline_create_info.h +++ b/include/misc/graphics_pipeline_create_info.h @@ -299,7 +299,7 @@ namespace Anvil Anvil::SampleCountFlagBits* out_opt_sample_locations_per_pixel_ptr, VkExtent2D* out_opt_sample_location_grid_size_ptr, uint32_t* out_opt_n_sample_locations_ptr, - const Anvil::SampleLocation** out_opt_sample_locations_ptr_ptr); + const Anvil::SampleLocation** out_opt_sample_locations_ptr_ptr) const; /** Retrieves state configuration related to per-sample shading. * diff --git a/include/misc/image_create_info.h b/include/misc/image_create_info.h index bb1645d3..c399b40e 100644 --- a/include/misc/image_create_info.h +++ b/include/misc/image_create_info.h @@ -37,7 +37,7 @@ namespace Anvil m_mipmaps_to_upload.clear(); } - /** Returns an instance of the "create info" item which can be used to instantiate a new non-sparse Image + /** Returns an instance of the "create info" item which can be used to instantiate a new Image * instance *WITH* a memory backing. * * This constructor assumes the image should be initialized in UNDEFINED layout, if no mipmap data @@ -67,7 +67,8 @@ namespace Anvil * @param in_use_full_mipmap_chain true if all mipmaps should be created for the image. False to only allocate * storage for the base mip-map. * @param in_memory_features Memory features for the memory backing. - * @param in_create_flags Optional image features that the created image should support. + * @param in_create_flags Optional image features that the created image should support. Must not include SPARSE_ALIASED, + * SPARSE_BINDING and SPARSE_RESIDENCY bits. * @param in_post_alloc_image_layout Image layout to transfer the image to after it is created, assigned memory, * and optionally uploaded mip data (if @param in_opt_mipmaps_ptr is not null). * @param in_opt_mipmaps_ptr If not nullptr, specified MipmapRawData items will be used to drive the mipmap contents @@ -77,25 +78,25 @@ namespace Anvil * * @return New image instance, if successful, or nullptr otherwise. **/ - static ImageCreateInfoUniquePtr create_nonsparse_alloc(const Anvil::BaseDevice* in_device_ptr, - Anvil::ImageType in_type, - Anvil::Format in_format, - Anvil::ImageTiling in_tiling, - Anvil::ImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - Anvil::SampleCountFlagBits in_sample_count, - Anvil::QueueFamilyFlags in_queue_families, - Anvil::SharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - MemoryFeatureFlags in_memory_features, - ImageCreateFlags in_create_flags, - Anvil::ImageLayout in_post_alloc_image_layout, - const std::vector* in_opt_mipmaps_ptr = nullptr); - - /** Returns an instance of the "create info" item which can be used to instantiate a new non-sparse Image + static ImageCreateInfoUniquePtr create_alloc(const Anvil::BaseDevice* in_device_ptr, + Anvil::ImageType in_type, + Anvil::Format in_format, + Anvil::ImageTiling in_tiling, + Anvil::ImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + Anvil::SampleCountFlagBits in_sample_count, + Anvil::QueueFamilyFlags in_queue_families, + Anvil::SharingMode in_sharing_mode, + bool in_use_full_mipmap_chain, + Anvil::MemoryFeatureFlags in_memory_features, + Anvil::ImageCreateFlags in_create_flags, + Anvil::ImageLayout in_post_alloc_image_layout, + const std::vector* in_opt_mipmaps_ptr = nullptr); + + /** Returns an instance of the "create info" item which can be used to instantiate a new Image * instance *without* a memory backing. A memory region should be bound to the object by calling * Image::set_memory() before using the object for any operations. * @@ -113,47 +114,48 @@ namespace Anvil * - Image format list: empty (ie. image views created from the image can use any compatible format) * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE * - * @param in_device_ptr Device to use. - * @param in_type Vulkan image type to use. - * @param in_format Vulkan format to use. - * @param in_tiling Vulkan image tiling to use. - * @param in_usage Vulkan image usage pattern to use. - * @param in_base_mipmap_width Width of the base mip-map. - * @param in_base_mipmap_height Height of the base mip-map. Must be at least 1 for all image types. - * @param in_base_mipmap_depth Depth of the base mip-map. Must be at least 1 for all image types. - * @param in_n_layers Number of layers to use. Must be at least 1 for all image types. - * @param in_sample_count Sample count to use. - * @param in_queue_families A combination of Anvil::QueueFamilyFlagBits::* bits, indicating which device queues - * the image is going to be accessed by. - * @param in_sharing_mode Vulkan sharing mode to use. - * @param in_use_full_mipmap_chain true, if all mipmaps should be created for the image. False to only allocate - * storage for the base mip-map. - * @param in_create_flags Optional image features that the created image should support. - * @param in_post_alloc_image_layout Image layout to transfer the image to after it is created, assigned memory, - * and optionally uploaded mip data (if @param in_opt_mipmaps_ptr is not null). - * @param in_opt_mipmaps_ptr If not NULL, specified data will be used to initialize created image's mipmaps - * with content, as soon as the image is assigned a memory backing. - * Specifying a non-NULL @param in_opt_mipmaps_ptr argument will make the function OR - * @param in_usage with Anvil::IMAGE_USAGE_FLAG_TRANSFER_DST_BIT. + * @param in_device_ptr Device to use. + * @param in_type Vulkan image type to use. + * @param in_format Vulkan format to use. + * @param in_tiling Vulkan image tiling to use. + * @param in_usage Vulkan image usage pattern to use. + * @param in_base_mipmap_width Width of the base mip-map. + * @param in_base_mipmap_height Height of the base mip-map. Must be at least 1 for all image types. + * @param in_base_mipmap_depth Depth of the base mip-map. Must be at least 1 for all image types. + * @param in_n_layers Number of layers to use. Must be at least 1 for all image types. + * @param in_sample_count Sample count to use. + * @param in_queue_families A combination of Anvil::QueueFamilyFlagBits::* bits, indicating which device queues + * the image is going to be accessed by. + * @param in_sharing_mode Vulkan sharing mode to use. + * @param in_use_full_mipmap_chain true, if all mipmaps should be created for the image. False to only allocate + * storage for the base mip-map. + * @param in_create_flags Optional image features that the created image should support. + * @param in_opt_post_alloc_image_layout Image layout to transfer the image to after it is created, assigned memory, + * and optionally uploaded mip data (if @param in_opt_mipmaps_ptr is not null). Ignored for + * images with SPARSE_ALIASED, SPARSE_BINDING or SPARSE_RESIDENCY bits set. + * @param in_opt_mipmaps_ptr If not NULL, specified data will be used to initialize created image's mipmaps + * with content, as soon as the image is assigned a memory backing. + * Specifying a non-NULL @param in_opt_mipmaps_ptr argument will make the function OR + * @param in_usage with Anvil::IMAGE_USAGE_FLAG_TRANSFER_DST_BIT. * * @return New image instance, if successful, or nullptr otherwise. **/ - static ImageCreateInfoUniquePtr create_nonsparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, - Anvil::ImageType in_type, - Anvil::Format in_format, - Anvil::ImageTiling in_tiling, - ImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - Anvil::SampleCountFlagBits in_sample_count, - Anvil::QueueFamilyFlags in_queue_families, - Anvil::SharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - ImageCreateFlags in_create_flags, - Anvil::ImageLayout in_post_alloc_image_layout, - const std::vector* in_opt_mipmaps_ptr = nullptr); + static ImageCreateInfoUniquePtr create_no_alloc(const Anvil::BaseDevice* in_device_ptr, + Anvil::ImageType in_type, + Anvil::Format in_format, + Anvil::ImageTiling in_tiling, + ImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + Anvil::SampleCountFlagBits in_sample_count, + Anvil::QueueFamilyFlags in_queue_families, + Anvil::SharingMode in_sharing_mode, + bool in_use_full_mipmap_chain, + Anvil::ImageCreateFlags in_create_flags, + Anvil::ImageLayout in_post_alloc_image_layout = Anvil::ImageLayout::UNDEFINED, + const std::vector* in_opt_mipmaps_ptr = nullptr); /** Returns an instance of the "create info" item which can be used to instantiate a new non-sparse Image * instance, later to be bound to the user-specified swapchain memory. @@ -173,69 +175,9 @@ namespace Anvil * * For argument discussion, see specification of the other create() functions. **/ - static ImageCreateInfoUniquePtr create_nonsparse_peer_no_alloc(const Anvil::BaseDevice* in_device_ptr, - const Anvil::Swapchain* in_swapchain_ptr, - uint32_t in_n_swapchain_image); - - - /** Returns an instance of the "create info" item which can be used to instantiate a new sparse Image - * instance *without* a physical memory backing. - * - * Memory region(s) should be bound to the object by calling Image::set_memory_block() before using the object - * for any operations. Whether or not all tiles need to be assigned memory blocks prior to accessing - * image contents depends on whether sparse binding or sparse residency has been requested at - * creation time. - * - * If NONALIASED or ALIASED residency is requested and the device does not support requested image - * configuration, a NULL image will be returned. - * - * User must manually configure sparse bindings for the image by using Queue::bind_sparse_memory(), - * before uploading any mip data. The mips can be uploaded using upload_mipmaps(). - * - * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: - * - * - External memory handle types: none - * - Image format list: empty (ie. image views created from the image can use any compatible format) - * - Initial layout: Anvil::ImageLayout::UNDEFINED - * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE - * - * @param in_device_ptr Device to use. - * @param in_type Vulkan image type to use. - * @param in_format Vulkan format to use. - * @param in_tiling Vulkan image tiling to use. - * @param in_usage Vulkan image usage pattern to use. - * @param in_base_mipmap_width Width of the base mip-map. Must be at least 1 for all image types. - * @param in_base_mipmap_height Height of the base mip-map. Must be at least 1 for all image types. - * @param in_base_mipmap_depth Depth of the base mip-map. Must be at least 1 for all image types. - * @param in_n_layers Number of layers to use. Must be at least 1 for all image types. - * @param in_sample_count Sample count to use. - * @param in_queue_families A combination of Anvil::QueueFamilyFlagBits::* bits, indicating which device queues - * the image is going to be accessed by. - * @param in_sharing_mode Vulkan sharing mode to use. - * @param in_use_full_mipmap_chain true, if all mipmaps should be created for the image. False to make the image - * only use one mip. - * @param in_create_flags Optional image features that the created image should support. - * @param in_sparse_residency_scope Scope of sparse residency to request for the image. - * @param in_initial_layout Initial layout to use for the image. Must either be Anvil::ImageLayout::UNDEFINED or - * Anvil::ImageLayout::PREINITIALIZED. - * - * @return New image instance, if successful, or nullptr otherwise. - **/ - static ImageCreateInfoUniquePtr create_sparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, - Anvil::ImageType in_type, - Anvil::Format in_format, - Anvil::ImageTiling in_tiling, - ImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - Anvil::SampleCountFlagBits in_sample_count, - Anvil::QueueFamilyFlags in_queue_families, - Anvil::SharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - ImageCreateFlags in_create_flags, - Anvil::SparseResidencyScope in_residency_scope); + static ImageCreateInfoUniquePtr create_peer_no_alloc(const Anvil::BaseDevice* in_device_ptr, + const Anvil::Swapchain* in_swapchain_ptr, + uint32_t in_n_swapchain_image); /** Returns an instance of the "create info" item which can be used to instantiate a special type of an Image, * useful for embedding a swapchain image instance. Object instantiated with this create item will NOT @@ -270,7 +212,7 @@ namespace Anvil return m_width; } - const Anvil::ImageCreateFlags& get_create_flags() const + Anvil::ImageCreateFlags get_create_flags() const { return m_create_flags; } @@ -330,7 +272,7 @@ namespace Anvil const std::vector get_physical_devices() const { - anvil_assert(m_internal_type == Anvil::ImageInternalType::NONSPARSE_PEER_NO_ALLOC || + anvil_assert(m_internal_type == Anvil::ImageInternalType::PEER_NO_ALLOC || m_internal_type == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); return m_physical_devices; @@ -357,14 +299,9 @@ namespace Anvil return m_sample_count; } - const SparseResidencyScope& get_residency_scope() const - { - return m_residency_scope; - } - const std::vector& get_sfr_rects() const { - anvil_assert(m_internal_type == Anvil::ImageInternalType::NONSPARSE_PEER_NO_ALLOC || + anvil_assert(m_internal_type == Anvil::ImageInternalType::PEER_NO_ALLOC || m_internal_type == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); return m_sfr_rects; @@ -377,7 +314,7 @@ namespace Anvil const Anvil::Swapchain* get_swapchain() const { - anvil_assert(m_internal_type == Anvil::ImageInternalType::NONSPARSE_PEER_NO_ALLOC || + anvil_assert(m_internal_type == Anvil::ImageInternalType::PEER_NO_ALLOC || m_internal_type == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); return m_swapchain_ptr; @@ -385,7 +322,7 @@ namespace Anvil const VkImage& get_swapchain_image() const { - anvil_assert(m_internal_type == Anvil::ImageInternalType::NONSPARSE_PEER_NO_ALLOC || + anvil_assert(m_internal_type == Anvil::ImageInternalType::PEER_NO_ALLOC || m_internal_type == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); return m_swapchain_image; @@ -393,7 +330,7 @@ namespace Anvil const uint32_t& get_swapchain_image_index() const { - anvil_assert(m_internal_type == Anvil::ImageInternalType::NONSPARSE_PEER_NO_ALLOC || + anvil_assert(m_internal_type == Anvil::ImageInternalType::PEER_NO_ALLOC || m_internal_type == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); return m_n_swapchain_image; @@ -418,7 +355,7 @@ namespace Anvil /** Tells whether this Image wrapper instance holds a sparse image */ bool is_sparse() const { - return (m_internal_type == Anvil::ImageInternalType::SPARSE_NO_ALLOC); + return (m_create_flags & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) != 0; } //- @@ -496,11 +433,6 @@ namespace Anvil m_queue_families = in_queue_families; } - void set_residency_scope(const Anvil::SparseResidencyScope& in_residency_scope) - { - m_residency_scope = in_residency_scope; - } - void set_sample_count(const Anvil::SampleCountFlagBits& in_sample_count) { m_sample_count = in_sample_count; @@ -595,8 +527,7 @@ namespace Anvil const std::vector* in_opt_mipmaps_ptr, const Anvil::MTSafety& in_mt_safety, Anvil::ExternalMemoryHandleTypeFlags in_exportable_external_memory_handle_types, - const Anvil::MemoryFeatureFlags& in_memory_features, - const Anvil::SparseResidencyScope& in_residency_scope); + const Anvil::MemoryFeatureFlags& in_memory_features); /* Private variables */ @@ -615,7 +546,6 @@ namespace Anvil Anvil::ImageLayout m_post_alloc_layout; Anvil::ImageLayout m_post_create_layout; Anvil::QueueFamilyFlags m_queue_families; - Anvil::SparseResidencyScope m_residency_scope; Anvil::SampleCountFlagBits m_sample_count; Anvil::SharingMode m_sharing_mode; Anvil::ImageTiling m_tiling; diff --git a/include/misc/memory_allocator.h b/include/misc/memory_allocator.h index 8ece61fd..2800f602 100644 --- a/include/misc/memory_allocator.h +++ b/include/misc/memory_allocator.h @@ -79,6 +79,7 @@ namespace Anvil uint32_t alloc_device_mask; Anvil::ExternalMemoryHandleTypeFlags alloc_exportable_external_handle_types; + Anvil::ImageAspectFlagBits alloc_image_aspect; bool alloc_is_dedicated_memory; MemoryBlockUniquePtr alloc_memory_block_ptr; uint32_t alloc_memory_final_type; @@ -135,6 +136,7 @@ namespace Anvil VkDeviceSize in_alloc_size, uint32_t in_alloc_memory_types, VkDeviceSize in_miptail_offset, + const Anvil::ImageAspectFlagBits& in_alloc_aspect, VkDeviceSize in_alloc_alignment, MemoryFeatureFlags in_alloc_required_memory_features, uint32_t in_alloc_supported_memory_types, diff --git a/include/misc/struct_chainer.h b/include/misc/struct_chainer.h index c8d53fc4..ffa27583 100644 --- a/include/misc/struct_chainer.h +++ b/include/misc/struct_chainer.h @@ -100,7 +100,8 @@ namespace Anvil public: /* Public functions */ StructChainer() - :m_structs_size(0) + :m_helper_structs_size(0), + m_structs_size (0) { /* Stub */ } @@ -138,10 +139,47 @@ namespace Anvil return pre_call_structs_size; } + template + void store_helper_structure(const HelperStructType& in_helper_struct, + const StructID& in_referring_struct, + const uint32_t& in_referring_struct_pnext_ptr_offset) + { + anvil_assert(m_structs.size() > in_referring_struct); + anvil_assert(m_structs.size() >= in_referring_struct + in_referring_struct_pnext_ptr_offset + sizeof(void*) ); + + m_helper_structs.push_back( + HelperStruct(&in_helper_struct, + sizeof(in_helper_struct), + in_referring_struct, + in_referring_struct_pnext_ptr_offset) + ); + + m_helper_structs_size += static_cast(sizeof(in_helper_struct) ); + } + + template + void store_helper_structure_vector(const std::vector& in_helper_struct_vec, + const StructID& in_referring_struct, + const uint32_t& in_referring_struct_pnext_ptr_offset) + { + /* Convert the input vector to a single entry */ + anvil_assert(in_helper_struct_vec.size() > 0); + + m_helper_structs.push_back( + HelperStruct(&in_helper_struct_vec.at(0), + static_cast(in_helper_struct_vec.size() ) * sizeof(HelperStructType), + in_referring_struct, + in_referring_struct_pnext_ptr_offset) + ); + + m_helper_structs_size += static_cast(in_helper_struct_vec.size() ) * sizeof(HelperStructType); + } + std::unique_ptr > create_chain() const { - size_t n_bytes_used = 0; - const uint32_t n_structs = static_cast(m_structs.size() ); + size_t n_bytes_used = 0; + const uint32_t n_helper_structs = static_cast(m_helper_structs.size() ); + const uint32_t n_structs = static_cast(m_structs.size () ); std::unique_ptr > result_ptr; /* Sanity checks */ @@ -154,7 +192,7 @@ namespace Anvil /* Allocate the result instance */ result_ptr.reset( - new StructChain(m_structs_size) + new StructChain(m_structs_size + m_helper_structs_size) ); if (result_ptr == nullptr) @@ -188,6 +226,25 @@ namespace Anvil n_bytes_used += current_struct_data_size; } + for (uint32_t n_helper_struct = 0; + n_helper_struct < n_helper_structs; + ++n_helper_struct) + { + const auto& current_helper_struct_props = m_helper_structs.at(n_helper_struct); + const auto& current_helper_struct_data = current_helper_struct_props.data; + const auto current_helper_struct_data_size = current_helper_struct_data.size(); + + /* Cache helper structure data */ + memcpy(&result_ptr->raw_data.at(n_bytes_used), + ¤t_helper_struct_data.at(0), + current_helper_struct_data_size); + + /* Patch the field of the referring struct so that it points to the helper structure we cache locally */ + *reinterpret_cast(&result_ptr->raw_data.at(current_helper_struct_props.referring_struct_id + current_helper_struct_props.referring_struct_ptr_offset) ) = &result_ptr->raw_data.at(n_bytes_used); + + n_bytes_used += current_helper_struct_data_size; + } + result_ptr->root_struct_ptr = reinterpret_cast(&result_ptr->raw_data.at(0) ); /* Done. */ @@ -217,7 +274,34 @@ namespace Anvil } private: + /* Private type definitions */ + typedef struct HelperStruct + { + std::vector data; + StructID referring_struct_id; + uint32_t referring_struct_ptr_offset; + + HelperStruct(const void* in_data_ptr, + const uint32_t& in_data_size, + const StructID& in_referring_struct_id, + const uint32_t& in_referring_struct_ptr_offset) + :referring_struct_id (in_referring_struct_id), + referring_struct_ptr_offset(in_referring_struct_ptr_offset) + { + anvil_assert(in_data_ptr != nullptr); + anvil_assert(in_data_size != 0); + + data.resize(in_data_size); + + memcpy(&data.at(0), + in_data_ptr, + in_data_size); + } + } HelperStruct; + /* Private functions */ + std::vector m_helper_structs; + uint32_t m_helper_structs_size; std::vector > m_structs; uint32_t m_structs_size; }; diff --git a/include/misc/types_enums.h b/include/misc/types_enums.h index c94542a1..20221768 100644 --- a/include/misc/types_enums.h +++ b/include/misc/types_enums.h @@ -356,9 +356,9 @@ namespace Anvil /* NOTE: These map 1:1 to VK equivalents */ enum class BufferCreateFlagBits { + SPARSE_ALIASED_BIT = VK_BUFFER_CREATE_SPARSE_ALIASED_BIT, SPARSE_BINDING_BIT = VK_BUFFER_CREATE_SPARSE_BINDING_BIT, SPARSE_RESIDENCY_BIT = VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT, - SPARSE_ALIASED_BIT = VK_BUFFER_CREATE_SPARSE_ALIASED_BIT, NONE = 0 }; @@ -368,10 +368,9 @@ namespace Anvil enum class BufferType { - NONSPARSE_ALLOC, - NONSPARSE_NO_ALLOC, - NONSPARSE_NO_ALLOC_CHILD, - SPARSE_NO_ALLOC, + ALLOC, + NO_ALLOC, + NO_ALLOC_CHILD, }; /* NOTE: These map 1:1 to Vulkan equialents */ @@ -1017,15 +1016,19 @@ namespace Anvil /* NOTE: These map 1:1 to VK equivalents */ enum class ImageCreateFlagBits { - MUTABLE_FORMAT_BIT = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, - CUBE_COMPATIBLE_BIT = VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, + /* Core VK 1.0 stuff */ + CUBE_COMPATIBLE_BIT = VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, + MUTABLE_FORMAT_BIT = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, + SPARSE_ALIASED_BIT = VK_IMAGE_CREATE_SPARSE_ALIASED_BIT, + SPARSE_BINDING_BIT = VK_IMAGE_CREATE_SPARSE_BINDING_BIT, + SPARSE_RESIDENCY_BIT = VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT, /* NOTE: Requires VK_EXT_sample_locations */ SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT = VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT, /* NOTE: Requires VK_KHR_bind_memory2 */ - SPLIT_INSTANCE_BIND_REGIONS_BIT = VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR, ALIAS_BIT = VK_IMAGE_CREATE_ALIAS_BIT_KHR, + SPLIT_INSTANCE_BIND_REGIONS_BIT = VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR, /* NOTE: Requires VK_KHR_maintenance1 */ _2D_ARRAY_COMPATIBLE_BIT = VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR, @@ -1099,10 +1102,9 @@ namespace Anvil enum class ImageInternalType { - NONSPARSE_ALLOC, - NONSPARSE_NO_ALLOC, - NONSPARSE_PEER_NO_ALLOC, - SPARSE_NO_ALLOC, + ALLOC, + NO_ALLOC, + PEER_NO_ALLOC, SWAPCHAIN_WRAPPER }; @@ -1645,20 +1647,6 @@ namespace Anvil INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(SparseMemoryBindFlags, VkSparseMemoryBindFlags, SparseMemoryBindFlagBits) - enum class SparseResidencyScope - { - /* Support sparse binding only */ - NONE, - - /* Support sparse residency, do not support sparse aliased residency */ - NONALIASED, - - /* Support sparse aliased residency */ - ALIASED, - - UNKNOWN - }; - /* NOTE: These map 1:1 to VK equivalents */ enum class StencilFaceFlagBits { diff --git a/include/wrappers/buffer.h b/include/wrappers/buffer.h index 253b0255..942b9b6d 100644 --- a/include/wrappers/buffer.h +++ b/include/wrappers/buffer.h @@ -293,8 +293,6 @@ namespace Anvil Anvil::BufferUniquePtr m_staging_buffer_ptr; Anvil::Queue* m_staging_buffer_queue_ptr; - Anvil::BufferCreateFlags m_create_flags; - std::vector m_owned_memory_blocks; bool m_prefers_dedicated_allocation; bool m_requires_dedicated_allocation; diff --git a/include/wrappers/graphics_pipeline_manager.h b/include/wrappers/graphics_pipeline_manager.h index 69c024e1..fd8396e9 100644 --- a/include/wrappers/graphics_pipeline_manager.h +++ b/include/wrappers/graphics_pipeline_manager.h @@ -74,6 +74,8 @@ #define WRAPPERS_GRAPHICS_PIPELINE_MANAGER_H #include "misc/base_pipeline_manager.h" +#include "misc/graphics_pipeline_create_info.h" +#include "misc/struct_chainer.h" #include "misc/types.h" #include "wrappers/render_pass.h" #include @@ -175,11 +177,41 @@ namespace Anvil bool in_use_pipeline_cache, Anvil::PipelineCache* in_pipeline_cache_to_reuse_ptr); + Anvil::StructChainUniquePtr bake_graphics_pipeline_create_info (const Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr, + const Anvil::PipelineLayout* in_pipeline_layout_ptr, + const VkPipeline& in_opt_base_pipeline_handle, + const int32_t& in_opt_base_pipeline_index, + const VkPipelineColorBlendStateCreateInfo* in_opt_color_blend_state_create_info_ptr, + const VkPipelineDepthStencilStateCreateInfo* in_opt_depth_stencil_state_create_info_ptr, + const VkPipelineDynamicStateCreateInfo* in_opt_dynamic_state_create_info_ptr, + const VkPipelineInputAssemblyStateCreateInfo* in_input_assembly_state_create_info_ptr, + const VkPipelineMultisampleStateCreateInfo* in_opt_multisample_state_create_info_ptr, + const VkPipelineRasterizationStateCreateInfo* in_rasterization_state_create_info_ptr, + const uint32_t& in_n_shader_stage_create_info_items, + const VkPipelineShaderStageCreateInfo* in_shader_stage_create_info_items_ptr, + const VkPipelineTessellationStateCreateInfo* in_opt_tessellation_state_create_info_ptr, + const VkPipelineVertexInputStateCreateInfo* in_vertex_input_state_create_info_ptr, + const VkPipelineViewportStateCreateInfo* in_opt_viewport_state_create_info_ptr) const; + Anvil::StructChainUniquePtr bake_pipeline_color_blend_state_create_info (const Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr, + const Anvil::RenderPass* in_current_renderpass_ptr, + const Anvil::SubPassID& in_subpass_id) const; + Anvil::StructChainUniquePtr bake_pipeline_depth_stencil_state_create_info (const Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr, + const Anvil::RenderPass* in_current_renderpass_ptr) const; + Anvil::StructChainUniquePtr bake_pipeline_dynamic_state_create_info (const Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr) const; + Anvil::StructChainUniquePtr bake_pipeline_input_assembly_state_create_info (const Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr) const; + Anvil::StructChainUniquePtr bake_pipeline_multisample_state_create_info (const Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr) const; + Anvil::StructChainUniquePtr bake_pipeline_rasterization_state_create_info (const Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr) const; + std::unique_ptr > bake_pipeline_shader_stage_create_info_chain_vector(const Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr) const; + Anvil::StructChainUniquePtr bake_pipeline_tessellation_state_create_info (const Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr) const; + Anvil::StructChainUniquePtr bake_pipeline_vertex_input_state_create_info (const Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr) const; + Anvil::StructChainUniquePtr bake_pipeline_viewport_state_create_info (Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr, + const bool& in_is_dynamic_scissor_state_enabled, + const bool& in_is_dynamic_viewport_state_enabled) const; + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(GraphicsPipelineManager); ANVIL_DISABLE_COPY_CONSTRUCTOR (GraphicsPipelineManager); /* Private variables */ - GraphicsPipelineDataMap m_pipeline_id_to_gfx_pipeline_data; }; }; /* Vulkan namespace */ diff --git a/include/wrappers/pipeline_layout.h b/include/wrappers/pipeline_layout.h index 959e2f61..1825a72a 100644 --- a/include/wrappers/pipeline_layout.h +++ b/include/wrappers/pipeline_layout.h @@ -68,7 +68,7 @@ namespace Anvil * * @return Requested handle. **/ - VkPipelineLayout get_pipeline_layout() + VkPipelineLayout get_pipeline_layout() const { return m_layout_vk; } diff --git a/src/misc/base_pipeline_manager.cpp b/src/misc/base_pipeline_manager.cpp index 4f2cc0d2..c2bdf9aa 100644 --- a/src/misc/base_pipeline_manager.cpp +++ b/src/misc/base_pipeline_manager.cpp @@ -187,7 +187,7 @@ bool Anvil::BasePipelineManager::add_pipeline(Anvil::BasePipelineCreateInfoUniqu void Anvil::BasePipelineManager::bake_specialization_info_vk(const SpecializationConstants& in_specialization_constants, const unsigned char* in_specialization_constant_data_ptr, std::vector* out_specialization_map_entry_vk_vector_ptr, - VkSpecializationInfo* out_specialization_info_ptr) + VkSpecializationInfo* out_specialization_info_ptr) const { uint32_t n_specialization_constant_bytes = 0; uint32_t n_specialization_constants = 0; diff --git a/src/misc/buffer_create_info.cpp b/src/misc/buffer_create_info.cpp index 0fdc742f..d2012323 100644 --- a/src/misc/buffer_create_info.cpp +++ b/src/misc/buffer_create_info.cpp @@ -24,22 +24,46 @@ #include "wrappers/device.h" -Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_nonsparse_alloc(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - Anvil::QueueFamilyFlags in_queue_families, - Anvil::SharingMode in_sharing_mode, - Anvil::BufferUsageFlags in_usage_flags, - Anvil::MemoryFeatureFlags in_memory_features) +Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_alloc(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + Anvil::QueueFamilyFlags in_queue_families, + Anvil::SharingMode in_sharing_mode, + Anvil::BufferCreateFlags in_create_flags, + Anvil::BufferUsageFlags in_usage_flags, + Anvil::MemoryFeatureFlags in_memory_features) { + Anvil::BufferCreateInfoUniquePtr result_ptr(nullptr, std::default_delete() ); + if ((in_create_flags & Anvil::BufferCreateFlagBits::SPARSE_ALIASED_BIT) != 0) + { + anvil_assert((in_create_flags & Anvil::BufferCreateFlagBits::SPARSE_ALIASED_BIT) == 0); + + goto end; + } + + if ((in_create_flags & Anvil::BufferCreateFlagBits::SPARSE_BINDING_BIT) != 0) + { + anvil_assert((in_create_flags & Anvil::BufferCreateFlagBits::SPARSE_BINDING_BIT) == 0); + + goto end; + } + + if ((in_create_flags & Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0) + { + anvil_assert((in_create_flags & Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT) == 0); + + goto end; + } + result_ptr.reset( - new Anvil::BufferCreateInfo(BufferType::NONSPARSE_ALLOC, + new Anvil::BufferCreateInfo(BufferType::ALLOC, in_device_ptr, in_size, in_queue_families, in_sharing_mode, + in_create_flags, in_usage_flags, in_memory_features, Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE, @@ -47,24 +71,27 @@ Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_nonsparse_alloc nullptr) /* in_opt_client_data_ptr */ ); +end: return result_ptr; } -Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_nonsparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - Anvil::QueueFamilyFlags in_queue_families, - Anvil::SharingMode in_sharing_mode, - Anvil::BufferUsageFlags in_usage_flags) +Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_no_alloc(const Anvil::BaseDevice* in_device_ptr, + VkDeviceSize in_size, + Anvil::QueueFamilyFlags in_queue_families, + Anvil::SharingMode in_sharing_mode, + Anvil::BufferCreateFlags in_create_flags, + Anvil::BufferUsageFlags in_usage_flags) { Anvil::BufferCreateInfoUniquePtr result_ptr(nullptr, std::default_delete() ); result_ptr.reset( - new Anvil::BufferCreateInfo(BufferType::NONSPARSE_NO_ALLOC, + new Anvil::BufferCreateInfo(BufferType::NO_ALLOC, in_device_ptr, in_size, in_queue_families, in_sharing_mode, + in_create_flags, in_usage_flags, Anvil::MemoryFeatureFlagBits::NONE, Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE, @@ -75,9 +102,9 @@ Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_nonsparse_no_al return result_ptr; } -Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_nonsparse_no_alloc_child(Anvil::Buffer* in_parent_nonsparse_buffer_ptr, - VkDeviceSize in_start_offset, - VkDeviceSize in_size) +Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_no_alloc_child(Anvil::Buffer* in_parent_nonsparse_buffer_ptr, + VkDeviceSize in_start_offset, + VkDeviceSize in_size) { Anvil::BufferCreateInfoUniquePtr result_ptr(nullptr, std::default_delete() ); @@ -91,51 +118,25 @@ Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_nonsparse_no_al return result_ptr; } -Anvil::BufferCreateInfoUniquePtr Anvil::BufferCreateInfo::create_sparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, - VkDeviceSize in_size, - Anvil::QueueFamilyFlags in_queue_families, - Anvil::SharingMode in_sharing_mode, - Anvil::BufferUsageFlags in_usage_flags, - Anvil::SparseResidencyScope in_residency_scope, - MTSafety in_mt_safety, - Anvil::ExternalMemoryHandleTypeFlags in_external_memory_handle_types) -{ - Anvil::BufferCreateInfoUniquePtr result_ptr(nullptr, - std::default_delete() ); - - result_ptr.reset( - new Anvil::BufferCreateInfo(in_device_ptr, - in_size, - in_queue_families, - in_sharing_mode, - in_usage_flags, - in_residency_scope, - in_mt_safety, - in_external_memory_handle_types) - ); - - return result_ptr; -} - Anvil::BufferCreateInfo::BufferCreateInfo(const Anvil::BaseDevice* in_device_ptr, VkDeviceSize in_size, Anvil::QueueFamilyFlags in_queue_families, Anvil::SharingMode in_sharing_mode, + Anvil::BufferCreateFlags in_create_flags, Anvil::BufferUsageFlags in_usage_flags, - Anvil::SparseResidencyScope in_residency_scope, MTSafety in_mt_safety, Anvil::ExternalMemoryHandleTypeFlags in_exportable_external_memory_handle_types) :m_client_data_ptr (nullptr), + m_create_flags (in_create_flags), m_device_ptr (in_device_ptr), m_exportable_external_memory_handle_types(in_exportable_external_memory_handle_types), m_mt_safety (in_mt_safety), m_parent_buffer_ptr (nullptr), m_queue_families (in_queue_families), - m_residency_scope (in_residency_scope), m_sharing_mode (in_sharing_mode), m_size (in_size), m_start_offset (0), - m_type (BufferType::SPARSE_NO_ALLOC), + m_type (BufferType::NO_ALLOC), m_usage_flags (in_usage_flags) { /* Sanity checks */ @@ -146,19 +147,19 @@ Anvil::BufferCreateInfo::BufferCreateInfo(const Anvil::BaseDevice* i anvil_assert(physical_device_features.core_vk1_0_features_ptr->sparse_binding); } - if ((in_residency_scope == Anvil::SparseResidencyScope::ALIASED || - in_residency_scope == Anvil::SparseResidencyScope::NONALIASED) && + if ((((m_create_flags & Anvil::BufferCreateFlagBits::SPARSE_ALIASED_BIT) != 0) || + ((m_create_flags & Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0)) && !physical_device_features.core_vk1_0_features_ptr->sparse_residency_buffer) { - anvil_assert((in_residency_scope == Anvil::SparseResidencyScope::ALIASED || - in_residency_scope == Anvil::SparseResidencyScope::NONALIASED) && - physical_device_features.core_vk1_0_features_ptr->sparse_residency_buffer); + anvil_assert((((m_create_flags & Anvil::BufferCreateFlagBits::SPARSE_ALIASED_BIT) != 0) || + ((m_create_flags & Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0)) && + physical_device_features.core_vk1_0_features_ptr->sparse_residency_buffer) } - if ( in_residency_scope == Anvil::SparseResidencyScope::ALIASED && + if ( ((m_create_flags & Anvil::BufferCreateFlagBits::SPARSE_ALIASED_BIT) != 0) && !physical_device_features.core_vk1_0_features_ptr->sparse_residency_aliased) { - anvil_assert(in_residency_scope == Anvil::SparseResidencyScope::ALIASED && + anvil_assert(((m_create_flags & Anvil::BufferCreateFlagBits::SPARSE_ALIASED_BIT) != 0) && physical_device_features.core_vk1_0_features_ptr->sparse_residency_aliased); } } @@ -168,19 +169,20 @@ Anvil::BufferCreateInfo::BufferCreateInfo(const Anvil::BufferType& i VkDeviceSize in_size, Anvil::QueueFamilyFlags in_queue_families, Anvil::SharingMode in_sharing_mode, + Anvil::BufferCreateFlags in_create_flags, Anvil::BufferUsageFlags in_usage_flags, MemoryFeatureFlags in_memory_features, MTSafety in_mt_safety, Anvil::ExternalMemoryHandleTypeFlags in_exportable_external_memory_handle_types, const void* in_opt_client_data_ptr) :m_client_data_ptr (in_opt_client_data_ptr), + m_create_flags (in_create_flags), m_device_ptr (in_device_ptr), m_exportable_external_memory_handle_types(in_exportable_external_memory_handle_types), m_memory_features (in_memory_features), m_mt_safety (in_mt_safety), m_parent_buffer_ptr (nullptr), m_queue_families (in_queue_families), - m_residency_scope (Anvil::SparseResidencyScope::UNKNOWN), m_sharing_mode (in_sharing_mode), m_size (in_size), m_start_offset (0), @@ -197,23 +199,25 @@ Anvil::BufferCreateInfo::BufferCreateInfo(Anvil::Buffer* in_parent_buffer_ptr, VkDeviceSize in_start_offset, VkDeviceSize in_size) :m_client_data_ptr (nullptr), + m_create_flags (in_parent_buffer_ptr->get_create_info_ptr()->m_create_flags), m_device_ptr (in_parent_buffer_ptr->get_create_info_ptr()->m_device_ptr), m_exportable_external_memory_handle_types(in_parent_buffer_ptr->get_create_info_ptr()->m_exportable_external_memory_handle_types), m_memory_features (in_parent_buffer_ptr->get_create_info_ptr()->m_memory_features), m_mt_safety (in_parent_buffer_ptr->get_create_info_ptr()->m_mt_safety), m_parent_buffer_ptr (in_parent_buffer_ptr), m_queue_families (in_parent_buffer_ptr->get_create_info_ptr()->m_queue_families), - m_residency_scope (in_parent_buffer_ptr->get_create_info_ptr()->m_residency_scope), m_sharing_mode (in_parent_buffer_ptr->get_create_info_ptr()->m_sharing_mode), m_size (in_size), m_start_offset (in_start_offset), - m_type (BufferType::NONSPARSE_NO_ALLOC_CHILD), + m_type (BufferType::NO_ALLOC_CHILD), m_usage_flags (in_parent_buffer_ptr->get_create_info_ptr()->m_usage_flags) { /* Sanity checks */ anvil_assert(in_parent_buffer_ptr != nullptr); anvil_assert(in_size > 0); - anvil_assert(in_parent_buffer_ptr->get_create_info_ptr()->m_type != Anvil::BufferType::SPARSE_NO_ALLOC); - anvil_assert(in_parent_buffer_ptr->get_memory_block (0 /* in_n_memory_block */) != nullptr); + anvil_assert((in_parent_buffer_ptr->get_create_info_ptr()->m_create_flags & Anvil::BufferCreateFlagBits::SPARSE_ALIASED_BIT) == 0); + anvil_assert((in_parent_buffer_ptr->get_create_info_ptr()->m_create_flags & Anvil::BufferCreateFlagBits::SPARSE_BINDING_BIT) == 0); + anvil_assert((in_parent_buffer_ptr->get_create_info_ptr()->m_create_flags & Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT) == 0); + anvil_assert( in_parent_buffer_ptr->get_memory_block (0 /* in_n_memory_block */) != nullptr); } diff --git a/src/misc/dummy_window.cpp b/src/misc/dummy_window.cpp index 508902be..cd46b9e5 100644 --- a/src/misc/dummy_window.cpp +++ b/src/misc/dummy_window.cpp @@ -191,12 +191,13 @@ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_ima result_ptr.reset(new unsigned char[raw_image_size]); { - auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(device_ptr, - raw_image_size, - Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, - Anvil::SharingMode::EXCLUSIVE, - Anvil::BufferUsageFlagBits::TRANSFER_DST_BIT, - Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT); + auto create_info_ptr = Anvil::BufferCreateInfo::create_alloc(device_ptr, + raw_image_size, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, + Anvil::SharingMode::EXCLUSIVE, + Anvil::BufferCreateFlagBits::NONE, + Anvil::BufferUsageFlagBits::TRANSFER_DST_BIT, + Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT); create_info_ptr->set_mt_safety(Anvil::MTSafety::DISABLED); @@ -208,22 +209,22 @@ std::unique_ptr Anvil::DummyWindowWithPNGSnapshots::get_swapchain_ima ImageUniquePtr intermediate_image_ptr; { - auto create_info_ptr = Anvil::ImageCreateInfo::create_nonsparse_alloc(device_ptr, - Anvil::ImageType::_2D, - Anvil::Format::R8G8B8A8_UNORM, - Anvil::ImageTiling::OPTIMAL, - Anvil::ImageUsageFlagBits::TRANSFER_SRC_BIT | Anvil::ImageUsageFlagBits::TRANSFER_DST_BIT, - swapchain_image_width, - swapchain_image_height, - 1, /* in_base_mipmap_depth */ - 1, /* in_n_layers */ - Anvil::SampleCountFlagBits::_1_BIT, - Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, - Anvil::SharingMode::EXCLUSIVE, - false, /* in_use_full_mipmap_chain */ - Anvil::MemoryFeatureFlagBits::NONE, - Anvil::ImageCreateFlagBits::NONE, - Anvil::ImageLayout::TRANSFER_DST_OPTIMAL); + auto create_info_ptr = Anvil::ImageCreateInfo::create_alloc(device_ptr, + Anvil::ImageType::_2D, + Anvil::Format::R8G8B8A8_UNORM, + Anvil::ImageTiling::OPTIMAL, + Anvil::ImageUsageFlagBits::TRANSFER_SRC_BIT | Anvil::ImageUsageFlagBits::TRANSFER_DST_BIT, + swapchain_image_width, + swapchain_image_height, + 1, /* in_base_mipmap_depth */ + 1, /* in_n_layers */ + Anvil::SampleCountFlagBits::_1_BIT, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, + Anvil::SharingMode::EXCLUSIVE, + false, /* in_use_full_mipmap_chain */ + Anvil::MemoryFeatureFlagBits::NONE, + Anvil::ImageCreateFlagBits::NONE, + Anvil::ImageLayout::TRANSFER_DST_OPTIMAL); create_info_ptr->set_mt_safety(Anvil::MTSafety::DISABLED); diff --git a/src/misc/graphics_pipeline_create_info.cpp b/src/misc/graphics_pipeline_create_info.cpp index 7e691fb0..854b2ef9 100644 --- a/src/misc/graphics_pipeline_create_info.cpp +++ b/src/misc/graphics_pipeline_create_info.cpp @@ -569,7 +569,7 @@ void Anvil::GraphicsPipelineCreateInfo::get_sample_location_state(bool* Anvil::SampleCountFlagBits* out_opt_sample_locations_per_pixel_ptr, VkExtent2D* out_opt_sample_location_grid_size_ptr, uint32_t* out_opt_n_sample_locations_ptr, - const Anvil::SampleLocation** out_opt_sample_locations_ptr_ptr) + const Anvil::SampleLocation** out_opt_sample_locations_ptr_ptr) const { if (out_opt_is_enabled_ptr != nullptr) { diff --git a/src/misc/image_create_info.cpp b/src/misc/image_create_info.cpp index 7cbca49d..a43428ab 100644 --- a/src/misc/image_create_info.cpp +++ b/src/misc/image_create_info.cpp @@ -23,28 +23,34 @@ #include "misc/swapchain_create_info.h" #include "wrappers/swapchain.h" -Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, - Anvil::ImageType in_type, - Anvil::Format in_format, - Anvil::ImageTiling in_tiling, - Anvil::ImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - Anvil::SampleCountFlagBits in_sample_count, - Anvil::QueueFamilyFlags in_queue_families, - Anvil::SharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - ImageCreateFlags in_create_flags, - Anvil::ImageLayout in_post_alloc_image_layout, - const std::vector* in_opt_mipmaps_ptr) +Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_no_alloc(const Anvil::BaseDevice* in_device_ptr, + Anvil::ImageType in_type, + Anvil::Format in_format, + Anvil::ImageTiling in_tiling, + Anvil::ImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + Anvil::SampleCountFlagBits in_sample_count, + Anvil::QueueFamilyFlags in_queue_families, + Anvil::SharingMode in_sharing_mode, + bool in_use_full_mipmap_chain, + ImageCreateFlags in_create_flags, + Anvil::ImageLayout in_post_alloc_image_layout, + const std::vector* in_opt_mipmaps_ptr) { Anvil::ImageCreateInfoUniquePtr result_ptr(nullptr, std::default_delete() ); + if ((in_create_flags & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) != 0 || + (in_create_flags & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0) + { + in_post_alloc_image_layout = Anvil::ImageLayout::UNDEFINED; + } + result_ptr.reset( - new ImageCreateInfo(Anvil::ImageInternalType::NONSPARSE_NO_ALLOC, + new ImageCreateInfo(Anvil::ImageInternalType::NO_ALLOC, in_device_ptr, in_type, in_format, @@ -64,36 +70,39 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_no_allo in_opt_mipmaps_ptr, Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE, Anvil::ExternalMemoryHandleTypeFlagBits::NONE, - Anvil::MemoryFeatureFlagBits::NONE, - Anvil::SparseResidencyScope::UNKNOWN) + Anvil::MemoryFeatureFlagBits::NONE) ); return result_ptr; } -Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_alloc(const Anvil::BaseDevice* in_device_ptr, - Anvil::ImageType in_type, - Anvil::Format in_format, - Anvil::ImageTiling in_tiling, - Anvil::ImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - Anvil::SampleCountFlagBits in_sample_count, - Anvil::QueueFamilyFlags in_queue_families, - Anvil::SharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - MemoryFeatureFlags in_memory_features, - ImageCreateFlags in_create_flags, - Anvil::ImageLayout in_post_alloc_image_layout, - const std::vector* in_opt_mipmaps_ptr) +Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_alloc(const Anvil::BaseDevice* in_device_ptr, + Anvil::ImageType in_type, + Anvil::Format in_format, + Anvil::ImageTiling in_tiling, + Anvil::ImageUsageFlags in_usage, + uint32_t in_base_mipmap_width, + uint32_t in_base_mipmap_height, + uint32_t in_base_mipmap_depth, + uint32_t in_n_layers, + Anvil::SampleCountFlagBits in_sample_count, + Anvil::QueueFamilyFlags in_queue_families, + Anvil::SharingMode in_sharing_mode, + bool in_use_full_mipmap_chain, + MemoryFeatureFlags in_memory_features, + ImageCreateFlags in_create_flags, + Anvil::ImageLayout in_post_alloc_image_layout, + const std::vector* in_opt_mipmaps_ptr) { Anvil::ImageCreateInfoUniquePtr result_ptr(nullptr, std::default_delete() ); + anvil_assert((in_create_flags & Anvil::ImageCreateFlagBits::SPARSE_ALIASED_BIT) == 0); + anvil_assert((in_create_flags & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) == 0); + anvil_assert((in_create_flags & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) == 0); + result_ptr.reset( - new ImageCreateInfo(Anvil::ImageInternalType::NONSPARSE_ALLOC, + new ImageCreateInfo(Anvil::ImageInternalType::ALLOC, in_device_ptr, in_type, in_format, @@ -113,16 +122,15 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_alloc(c in_opt_mipmaps_ptr, Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE, Anvil::ExternalMemoryHandleTypeFlagBits::NONE, - in_memory_features, - Anvil::SparseResidencyScope::UNKNOWN) + in_memory_features) ); return result_ptr; } -Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_peer_no_alloc(const Anvil::BaseDevice* in_device_ptr, - const Anvil::Swapchain* in_swapchain_ptr, - uint32_t in_n_swapchain_image) +Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_peer_no_alloc(const Anvil::BaseDevice* in_device_ptr, + const Anvil::Swapchain* in_swapchain_ptr, + uint32_t in_n_swapchain_image) { const auto memory_features ((in_device_ptr->get_type() == Anvil::DeviceType::MULTI_GPU) ? Anvil::MemoryFeatureFlagBits::MULTI_INSTANCE_BIT : Anvil::MemoryFeatureFlagBits::NONE); @@ -137,7 +145,7 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_peer_no swapchain_image_size + 2); result_ptr.reset( - new ImageCreateInfo(Anvil::ImageInternalType::NONSPARSE_PEER_NO_ALLOC, + new ImageCreateInfo(Anvil::ImageInternalType::PEER_NO_ALLOC, in_device_ptr, Anvil::ImageType::_2D, in_swapchain_ptr->get_create_info_ptr()->get_format(), @@ -157,8 +165,7 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_peer_no nullptr, /* in_opt_mipmaps_ptr */ Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE, Anvil::ExternalMemoryHandleTypeFlagBits::NONE, - memory_features, - Anvil::SparseResidencyScope::UNKNOWN) + memory_features) ); result_ptr->set_swapchain (in_swapchain_ptr); @@ -167,53 +174,6 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_nonsparse_peer_no return result_ptr; } -Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_sparse_no_alloc(const Anvil::BaseDevice* in_device_ptr, - Anvil::ImageType in_type, - Anvil::Format in_format, - Anvil::ImageTiling in_tiling, - Anvil::ImageUsageFlags in_usage, - uint32_t in_base_mipmap_width, - uint32_t in_base_mipmap_height, - uint32_t in_base_mipmap_depth, - uint32_t in_n_layers, - Anvil::SampleCountFlagBits in_sample_count, - Anvil::QueueFamilyFlags in_queue_families, - Anvil::SharingMode in_sharing_mode, - bool in_use_full_mipmap_chain, - ImageCreateFlags in_create_flags, - Anvil::SparseResidencyScope in_residency_scope) -{ - Anvil::ImageCreateInfoUniquePtr result_ptr(nullptr, - std::default_delete() ); - - result_ptr.reset( - new ImageCreateInfo(Anvil::ImageInternalType::SPARSE_NO_ALLOC, - in_device_ptr, - in_type, - in_format, - in_tiling, - in_sharing_mode, - in_usage, - in_base_mipmap_width, - in_base_mipmap_height, - in_base_mipmap_depth, - in_n_layers, - in_sample_count, - in_use_full_mipmap_chain, - in_create_flags, - in_queue_families, - Anvil::ImageLayout::UNDEFINED, - Anvil::ImageLayout::UNDEFINED, - nullptr, /* in_opt_mipmaps_ptr */ - Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE, - Anvil::ExternalMemoryHandleTypeFlagBits::NONE, - Anvil::MemoryFeatureFlagBits::NONE, - in_residency_scope) - ); - - return result_ptr; -} - Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_swapchain_wrapper(const Anvil::BaseDevice* in_device_ptr, const Anvil::Swapchain* in_swapchain_ptr, const VkImage& in_image, @@ -244,8 +204,7 @@ Anvil::ImageCreateInfoUniquePtr Anvil::ImageCreateInfo::create_swapchain_wrapper nullptr, /* in_opt_mipmaps_ptr */ Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE, Anvil::ExternalMemoryHandleTypeFlagBits::NONE, - Anvil::MemoryFeatureFlagBits::NONE, - Anvil::SparseResidencyScope::UNKNOWN) + Anvil::MemoryFeatureFlagBits::NONE) ); if (result_ptr != nullptr) @@ -278,8 +237,7 @@ Anvil::ImageCreateInfo::ImageCreateInfo(Anvil::ImageInternalType in_ const std::vector* in_opt_mipmaps_ptr, const Anvil::MTSafety& in_mt_safety, Anvil::ExternalMemoryHandleTypeFlags in_exportable_external_memory_handle_types, - const Anvil::MemoryFeatureFlags& in_memory_features, - const Anvil::SparseResidencyScope& in_residency_scope) + const Anvil::MemoryFeatureFlags& in_memory_features) :m_create_flags (in_create_flags), m_depth (in_base_mipmap_depth), m_device_ptr (in_device_ptr), @@ -295,7 +253,6 @@ Anvil::ImageCreateInfo::ImageCreateInfo(Anvil::ImageInternalType in_ m_post_alloc_layout (in_post_alloc_image_layout), m_post_create_layout (in_post_create_image_layout), m_queue_families (in_queue_families), - m_residency_scope (in_residency_scope), m_sample_count (in_sample_count), m_sharing_mode (in_sharing_mode), m_swapchain_ptr (nullptr), diff --git a/src/misc/memory_allocator.cpp b/src/misc/memory_allocator.cpp index 39137b81..3a1277a1 100644 --- a/src/misc/memory_allocator.cpp +++ b/src/misc/memory_allocator.cpp @@ -59,6 +59,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i alloc_device_mask = in_device_mask; alloc_exportable_external_handle_types = in_opt_exportable_external_handle_types; + alloc_image_aspect = Anvil::ImageAspectFlagBits::NONE; alloc_is_dedicated_memory = in_alloc_is_dedicated; alloc_memory_final_type = UINT32_MAX; alloc_memory_required_alignment = in_alloc_alignment; @@ -101,6 +102,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i alloc_device_mask = in_device_mask; alloc_exportable_external_handle_types = in_opt_exportable_external_handle_types; + alloc_image_aspect = Anvil::ImageAspectFlagBits::NONE; alloc_is_dedicated_memory = in_alloc_is_dedicated; alloc_memory_final_type = UINT32_MAX; alloc_memory_required_alignment = in_alloc_alignment; @@ -126,6 +128,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i VkDeviceSize in_alloc_size, uint32_t in_alloc_memory_types, VkDeviceSize in_miptail_offset, + const Anvil::ImageAspectFlagBits& in_alloc_aspect, VkDeviceSize in_alloc_alignment, MemoryFeatureFlags in_alloc_required_memory_features, uint32_t in_alloc_supported_memory_types, @@ -146,6 +149,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i alloc_device_mask = in_device_mask; alloc_exportable_external_handle_types = in_opt_exportable_external_handle_types; + alloc_image_aspect = in_alloc_aspect; alloc_is_dedicated_memory = in_alloc_is_dedicated; alloc_memory_final_type = UINT32_MAX; alloc_memory_required_alignment = in_alloc_alignment; @@ -194,6 +198,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i alloc_device_mask = in_device_mask; alloc_exportable_external_handle_types = in_opt_exportable_external_handle_types; + alloc_image_aspect = Anvil::ImageAspectFlagBits::NONE; alloc_is_dedicated_memory = in_alloc_is_dedicated; alloc_memory_final_type = UINT32_MAX; alloc_memory_types = in_alloc_memory_types; @@ -240,6 +245,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i alloc_device_mask = in_device_mask; alloc_exportable_external_handle_types = in_opt_exportable_external_handle_types; + alloc_image_aspect = Anvil::ImageAspectFlagBits::NONE; alloc_is_dedicated_memory = in_alloc_is_dedicated; alloc_memory_final_type = UINT32_MAX; alloc_memory_required_alignment = in_alloc_alignment; @@ -964,11 +970,12 @@ bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* /* Sanity checks */ anvil_assert(in_buffer_ptr != nullptr); anvil_assert(m_backend_ptr->supports_baking () ); - anvil_assert(in_buffer_ptr->get_create_info_ptr()->get_type() == Anvil::BufferType::SPARSE_NO_ALLOC); anvil_assert(in_buffer_ptr->get_memory_requirements().size >= in_offset + in_size); anvil_assert( in_opt_device_mask_ptr == nullptr || (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); + anvil_assert((in_buffer_ptr->get_create_info_ptr()->get_create_flags() & Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0); + if (mutex_ptr != nullptr) { mutex_lock = std::move( @@ -1048,13 +1055,14 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* ANVIL_REDUNDANT_VARIABLE(result); /* Sanity checks */ - anvil_assert(in_image_ptr != nullptr); - anvil_assert(m_backend_ptr->supports_baking () ); - anvil_assert(in_image_ptr->get_create_info_ptr()->get_residency_scope() != Anvil::SparseResidencyScope::UNKNOWN); - anvil_assert(in_image_ptr->get_create_info_ptr()->get_n_layers () > in_n_layer); - anvil_assert(in_image_ptr->has_aspects (in_aspect) ); - anvil_assert( in_opt_device_mask_ptr == nullptr || - (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); + anvil_assert(in_image_ptr != nullptr); + anvil_assert(m_backend_ptr->supports_baking () ); + anvil_assert(in_image_ptr->get_create_info_ptr()->get_n_layers () > in_n_layer); + anvil_assert(in_image_ptr->has_aspects (in_aspect) ); + anvil_assert( in_opt_device_mask_ptr == nullptr || + (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); + + anvil_assert((in_image_ptr->get_create_info_ptr()->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0); if (mutex_ptr != nullptr) { @@ -1104,6 +1112,7 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* miptail_size, miptail_memory_types, miptail_offset, + in_aspect, in_image_ptr->get_image_alignment(), in_required_memory_features, filtered_memory_types, @@ -1152,7 +1161,6 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* /* Sanity checks */ anvil_assert(in_image_ptr != nullptr); anvil_assert(m_backend_ptr->supports_baking () ); - anvil_assert(in_image_ptr->get_create_info_ptr()->get_residency_scope() != Anvil::SparseResidencyScope::UNKNOWN); anvil_assert(in_image_ptr->has_aspects (in_subresource.aspect_mask) ); anvil_assert(in_image_ptr->get_n_mipmaps () > in_subresource.mip_level); anvil_assert(in_image_ptr->get_create_info_ptr()->get_n_layers () > in_subresource.array_layer); @@ -1163,6 +1171,8 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* anvil_assert(in_extent.height >= 1); anvil_assert(in_extent.width >= 1); + anvil_assert((in_image_ptr->get_create_info_ptr()->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0); + if (mutex_ptr != nullptr) { mutex_lock = std::move( @@ -1379,7 +1389,8 @@ bool Anvil::MemoryAllocator::bake() case Anvil::MemoryAllocator::ITEM_TYPE_BUFFER: case Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_BUFFER_REGION: { - needs_sparse_memory_binding |= ((*item_iterator)->buffer_ptr->get_create_info_ptr()->get_type() == Anvil::BufferType::SPARSE_NO_ALLOC); + needs_sparse_memory_binding |= ((*item_iterator)->buffer_ptr->get_create_info_ptr()->get_type() == Anvil::BufferType::NO_ALLOC) && + (((*item_iterator)->buffer_ptr->get_create_info_ptr()->get_create_flags() & Anvil::BufferCreateFlagBits::SPARSE_BINDING_BIT) != 0); break; } @@ -1388,7 +1399,12 @@ bool Anvil::MemoryAllocator::bake() case Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_IMAGE_MIPTAIL: case Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_IMAGE_SUBRESOURCE: { - needs_sparse_memory_binding |= ((*item_iterator)->image_ptr->get_create_info_ptr()->get_residency_scope() != Anvil::SparseResidencyScope::UNKNOWN); + const auto& create_flags = (*item_iterator)->image_ptr->get_create_info_ptr()->get_create_flags(); + const bool uses_sparse_bindings = ((create_flags & Anvil::ImageCreateFlagBits::SPARSE_ALIASED_BIT) != 0) || + ((create_flags & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) != 0) || + ((create_flags & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0); + + needs_sparse_memory_binding |= uses_sparse_bindings; break; } @@ -1441,7 +1457,7 @@ bool Anvil::MemoryAllocator::bake() { case Anvil::MemoryAllocator::ITEM_TYPE_BUFFER: { - if (item_ptr->buffer_ptr->get_create_info_ptr()->get_type() != Anvil::BufferType::SPARSE_NO_ALLOC) + if ((item_ptr->buffer_ptr->get_create_info_ptr()->get_create_flags() & Anvil::BufferCreateFlagBits::SPARSE_BINDING_BIT) == 0) { if (m_post_bake_per_buffer_item_mem_assignment_callback_function != nullptr) { @@ -1480,7 +1496,9 @@ bool Anvil::MemoryAllocator::bake() case Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_BUFFER_REGION: { - anvil_assert(item_ptr->buffer_ptr->get_create_info_ptr()->get_type() == Anvil::BufferType::SPARSE_NO_ALLOC); + anvil_assert((item_ptr->buffer_ptr->get_create_info_ptr()->get_create_flags() & Anvil::BufferCreateFlagBits::SPARSE_ALIASED_BIT) != 0 || + (item_ptr->buffer_ptr->get_create_info_ptr()->get_create_flags() & Anvil::BufferCreateFlagBits::SPARSE_BINDING_BIT) != 0 || + (item_ptr->buffer_ptr->get_create_info_ptr()->get_create_flags() & Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0); if (m_post_bake_per_buffer_item_mem_assignment_callback_function != nullptr) { @@ -1503,7 +1521,7 @@ bool Anvil::MemoryAllocator::bake() case Anvil::MemoryAllocator::ITEM_TYPE_IMAGE_WHOLE: { - if (item_ptr->image_ptr->get_create_info_ptr()->get_residency_scope() == Anvil::SparseResidencyScope::UNKNOWN) + if ((item_ptr->image_ptr->get_create_info_ptr()->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) == 0) { if (m_post_bake_per_image_item_mem_assignment_callback_function != nullptr) { @@ -1551,11 +1569,14 @@ bool Anvil::MemoryAllocator::bake() } else { + const Anvil::SparseMemoryBindFlagBits bind_flags = (item_ptr->alloc_image_aspect == Anvil::ImageAspectFlagBits::METADATA_BIT) ? Anvil::SparseMemoryBindFlagBits::BIND_METADATA_BIT + : Anvil::SparseMemoryBindFlagBits::NONE; + sparse_memory_binding.append_opaque_image_memory_update(sparse_memory_bind_info_id, item_ptr->image_ptr, item_ptr->miptail_offset, item_ptr->alloc_size, - Anvil::SparseMemoryBindFlagBits::NONE, + bind_flags, item_ptr->alloc_memory_block_ptr.release(), 0, /* opt_memory_block_start_offset */ true); /* in_opt_memory_block_owned_by_image */ diff --git a/src/misc/types_classes.cpp b/src/misc/types_classes.cpp index 307fc3ef..213d0320 100644 --- a/src/misc/types_classes.cpp +++ b/src/misc/types_classes.cpp @@ -201,10 +201,33 @@ void Anvil::SparseMemoryBindingUpdateInfo::bake() if (n_bindings > 0) { + uint32_t n_buffer_updates_used = 0; + uint32_t n_image_updates_used = 0; + uint32_t n_opaque_image_updates_used = 0; + m_bindings_vk.resize (n_bindings); m_device_group_bindings_vk.resize(n_bindings); - m_buffer_bindings_vk.clear(); + { + uint32_t n_total_buffer_updates = 0; + uint32_t n_total_image_updates = 0; + uint32_t n_total_opaque_image_updates = 0; + + for (uint32_t n_binding = 0; + n_binding < n_bindings; + ++n_binding) + { + const auto& bind_info = m_bindings.at(n_binding); + + n_total_buffer_updates += static_cast(bind_info.buffer_updates.size () ); + n_total_image_updates += static_cast(bind_info.image_updates.size () ); + n_total_opaque_image_updates += static_cast(bind_info.image_opaque_updates.size() ); + } + + m_buffer_bindings_vk.resize (n_total_buffer_updates); + m_image_bindings_vk.resize (n_total_image_updates); + m_image_opaque_bindings_vk.resize(n_total_opaque_image_updates); + } for (uint32_t n_binding = 0; n_binding < n_bindings; @@ -255,9 +278,9 @@ void Anvil::SparseMemoryBindingUpdateInfo::bake() vk_binding.pNext = &device_group_binding_info; } - n_buffer_bindings_start_index = static_cast(m_buffer_bindings_vk.size() ); - n_image_bindings_start_index = static_cast(m_image_bindings_vk.size() ); - n_image_opaque_bindings_start_index = static_cast(m_image_opaque_bindings_vk.size() ); + n_buffer_bindings_start_index = n_buffer_updates_used; + n_image_bindings_start_index = n_image_updates_used; + n_image_opaque_bindings_start_index = n_opaque_image_updates_used; for (auto& buffer_update : bind_info.buffer_updates) { @@ -270,7 +293,8 @@ void Anvil::SparseMemoryBindingUpdateInfo::bake() buffer_bind_info.buffer = current_buffer_vk; buffer_bind_info.pBinds = &buffer_update.second.second[0]; - m_buffer_bindings_vk.push_back(buffer_bind_info); + m_buffer_bindings_vk.at(n_buffer_updates_used) = buffer_bind_info; + ++n_buffer_updates_used; } for (auto& image_update : bind_info.image_updates) @@ -284,7 +308,8 @@ void Anvil::SparseMemoryBindingUpdateInfo::bake() image_bind_info.image = current_image_vk; image_bind_info.pBinds = &image_update.second.second[0]; - m_image_bindings_vk.push_back(image_bind_info); + m_image_bindings_vk.at(n_image_updates_used) = image_bind_info; + ++n_image_updates_used; } for (auto& image_opaque_update : bind_info.image_opaque_updates) @@ -298,12 +323,13 @@ void Anvil::SparseMemoryBindingUpdateInfo::bake() image_opaque_bind_info.image = current_image_vk; image_opaque_bind_info.pBinds = &image_opaque_update.second.second[0]; - m_image_opaque_bindings_vk.push_back(image_opaque_bind_info); + m_image_opaque_bindings_vk.at(n_opaque_image_updates_used) = image_opaque_bind_info; + ++n_opaque_image_updates_used; } - vk_binding.pBufferBinds = (bind_info.buffer_updates.size() > 0) ? &m_buffer_bindings_vk [n_buffer_bindings_start_index] : nullptr; - vk_binding.pImageBinds = (bind_info.image_updates.size() > 0) ? &m_image_bindings_vk [n_image_bindings_start_index] : nullptr; - vk_binding.pImageOpaqueBinds = (bind_info.image_opaque_updates.size() > 0) ? &m_image_opaque_bindings_vk[n_image_opaque_bindings_start_index] : nullptr; + vk_binding.pBufferBinds = (bind_info.buffer_updates.size() > 0) ? &m_buffer_bindings_vk.at (n_buffer_bindings_start_index) : nullptr; + vk_binding.pImageBinds = (bind_info.image_updates.size() > 0) ? &m_image_bindings_vk.at (n_image_bindings_start_index) : nullptr; + vk_binding.pImageOpaqueBinds = (bind_info.image_opaque_updates.size() > 0) ? &m_image_opaque_bindings_vk.at(n_image_opaque_bindings_start_index) : nullptr; } } else diff --git a/src/wrappers/buffer.cpp b/src/wrappers/buffer.cpp index 654d4982..0518cb8e 100644 --- a/src/wrappers/buffer.cpp +++ b/src/wrappers/buffer.cpp @@ -40,94 +40,25 @@ Anvil::Buffer::Buffer(Anvil::BufferCreateInfoUniquePtr in_create_info_ptr) MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), in_create_info_ptr->get_device () )), m_buffer (VK_NULL_HANDLE), - m_create_flags (Anvil::BufferCreateFlagBits::NONE), m_memory_block_ptr (nullptr), m_prefers_dedicated_allocation (false), m_requires_dedicated_allocation (false), m_staging_buffer_queue_ptr (nullptr) { - switch (in_create_info_ptr->get_type() ) + if (in_create_info_ptr->get_type() == BufferType::NO_ALLOC) { - case BufferType::NONSPARSE_ALLOC: + if (((in_create_info_ptr->get_memory_features() & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) == 0) || + ((in_create_info_ptr->get_create_flags () & Anvil::BufferCreateFlagBits::SPARSE_ALIASED_BIT) == 0) || + ((in_create_info_ptr->get_create_flags () & Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT) == 0)) { - /* Nothing to do */ - break; - } - - case BufferType::NONSPARSE_NO_ALLOC: - { - if ((in_create_info_ptr->get_memory_features() & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) == 0) - { - /* For host->gpu writes to work in this case, we will need the buffer to work as a target - * for buffer->buffer copy operations. Same goes for the other way around. - */ - auto usage_flags = in_create_info_ptr->get_usage_flags(); - - usage_flags |= Anvil::BufferUsageFlagBits::TRANSFER_DST_BIT | Anvil::BufferUsageFlagBits::TRANSFER_SRC_BIT; - - in_create_info_ptr->set_usage_flags(usage_flags); - } - - break; - } - - case BufferType::NONSPARSE_NO_ALLOC_CHILD: - { - m_create_flags = in_create_info_ptr->get_parent_buffer_ptr()->m_create_flags; - - in_create_info_ptr->set_usage_flags(in_create_info_ptr->get_usage_flags() ); - - break; - } - - case BufferType::SPARSE_NO_ALLOC: - { - switch (in_create_info_ptr->get_residency_scope() ) - { - case Anvil::SparseResidencyScope::ALIASED: - { - m_create_flags = Anvil::BufferCreateFlagBits::SPARSE_ALIASED_BIT | Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT | Anvil::BufferCreateFlagBits::SPARSE_BINDING_BIT; - - break; - } - - case Anvil::SparseResidencyScope::NONALIASED: - { - m_create_flags = Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT | Anvil::BufferCreateFlagBits::SPARSE_BINDING_BIT; - - break; - } - - case Anvil::SparseResidencyScope::NONE: - { - m_create_flags = Anvil::BufferCreateFlagBits::SPARSE_BINDING_BIT; - - break; - } - - default: - { - anvil_assert_fail(); - } - } - - /* Assume the user may try to bind memory from non-mappable memory heap, in which case - * we're going to need to copy data from a staging buffer to this buffer if the user - * ever uses write(), and vice versa. */ - { - auto usage_flags = in_create_info_ptr->get_usage_flags(); - - usage_flags |= Anvil::BufferUsageFlagBits::TRANSFER_DST_BIT | Anvil::BufferUsageFlagBits::TRANSFER_SRC_BIT; - - in_create_info_ptr->set_usage_flags(usage_flags); - } + /* For host->gpu writes to work in this case, we will need the buffer to work as a target + * for buffer->buffer copy operations. Same goes for the other way around. + */ + auto usage_flags = in_create_info_ptr->get_usage_flags(); - break; - } + usage_flags |= Anvil::BufferUsageFlagBits::TRANSFER_DST_BIT | Anvil::BufferUsageFlagBits::TRANSFER_SRC_BIT; - default: - { - anvil_assert_fail(); + in_create_info_ptr->set_usage_flags(usage_flags); } } @@ -198,7 +129,12 @@ const Anvil::Buffer* Anvil::Buffer::get_base_buffer() /* Please see header for specification */ VkBuffer Anvil::Buffer::get_buffer(const bool& in_bake_memory_if_necessary) { - if (get_create_info_ptr()->get_type() != Anvil::BufferType::SPARSE_NO_ALLOC) + const auto& create_flags = get_create_info_ptr()->get_create_flags(); + const bool is_sparse = ((create_flags & Anvil::BufferCreateFlagBits::SPARSE_ALIASED_BIT) != 0) || + ((create_flags & Anvil::BufferCreateFlagBits::SPARSE_BINDING_BIT) != 0) || + ((create_flags & Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0); + + if (!is_sparse) { if (in_bake_memory_if_necessary && m_memory_block_ptr == nullptr) @@ -213,8 +149,11 @@ VkBuffer Anvil::Buffer::get_buffer(const bool& in_bake_memory_if_necessary) /* Please see header for specification */ Anvil::MemoryBlock* Anvil::Buffer::get_memory_block(uint32_t in_n_memory_block) { - bool is_callback_needed = false; - const auto is_sparse = (get_create_info_ptr()->get_type() == Anvil::BufferType::SPARSE_NO_ALLOC); + const auto& create_flags = get_create_info_ptr()->get_create_flags(); + bool is_callback_needed = false; + const bool is_sparse = ((create_flags & Anvil::BufferCreateFlagBits::SPARSE_ALIASED_BIT) != 0) || + ((create_flags & Anvil::BufferCreateFlagBits::SPARSE_BINDING_BIT) != 0) || + ((create_flags & Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0); if (is_sparse) { @@ -266,7 +205,11 @@ VkMemoryRequirements Anvil::Buffer::get_memory_requirements() const uint32_t Anvil::Buffer::get_n_memory_blocks() const { - if (m_create_info_ptr->get_type() == Anvil::BufferType::SPARSE_NO_ALLOC) + const auto& create_flags = get_create_info_ptr()->get_create_flags(); + const bool is_sparse = ((create_flags & Anvil::BufferCreateFlagBits::SPARSE_ALIASED_BIT) != 0) || + ((create_flags & Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0); + + if (is_sparse) { return m_page_tracker_ptr->get_n_memory_blocks(); } @@ -290,7 +233,7 @@ bool Anvil::Buffer::init() m_create_info_ptr->set_usage_flags(m_create_info_ptr->get_usage_flags() | Anvil::BufferUsageFlagBits::TRANSFER_DST_BIT); } - if (m_create_info_ptr->get_type() != BufferType::NONSPARSE_NO_ALLOC_CHILD) + if (m_create_info_ptr->get_type() != BufferType::NO_ALLOC_CHILD) { /* Determine which queues the buffer should be available to. */ Anvil::Utils::convert_queue_family_bits_to_family_indices(m_device_ptr, @@ -305,7 +248,7 @@ bool Anvil::Buffer::init() { VkBufferCreateInfo buffer_create_info; - buffer_create_info.flags = m_create_flags.get_vk(); + buffer_create_info.flags = m_create_info_ptr->get_create_flags().get_vk(); buffer_create_info.pNext = nullptr; buffer_create_info.pQueueFamilyIndices = queue_family_indices; buffer_create_info.queueFamilyIndexCount = n_queue_family_indices; @@ -429,7 +372,7 @@ bool Anvil::Buffer::init() switch (m_create_info_ptr->get_type() ) { - case Anvil::BufferType::NONSPARSE_ALLOC: + case Anvil::BufferType::ALLOC: { /* Create a memory object and preallocate as much space as we need */ auto client_data_ptr = m_create_info_ptr->get_client_data(); @@ -478,7 +421,7 @@ bool Anvil::Buffer::init() break; } - case Anvil::BufferType::NONSPARSE_NO_ALLOC_CHILD: + case Anvil::BufferType::NO_ALLOC_CHILD: { Anvil::MemoryBlockUniquePtr mem_block_ptr; @@ -504,20 +447,23 @@ bool Anvil::Buffer::init() break; } - case BufferType::NONSPARSE_NO_ALLOC: + case BufferType::NO_ALLOC: { - /* No special action needed */ - break; - } + const auto& create_flags = get_create_info_ptr()->get_create_flags(); + const bool is_sparse = ((create_flags & Anvil::BufferCreateFlagBits::SPARSE_ALIASED_BIT) != 0) || + ((create_flags & Anvil::BufferCreateFlagBits::SPARSE_BINDING_BIT) != 0) || + ((create_flags & Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0); - case BufferType::SPARSE_NO_ALLOC: - { - m_page_tracker_ptr.reset( - new Anvil::PageTracker(Anvil::Utils::round_up(m_create_info_ptr->get_size(), - m_buffer_memory_reqs.alignment), - m_buffer_memory_reqs.alignment) - ); + if (is_sparse) + { + m_page_tracker_ptr.reset( + new Anvil::PageTracker(Anvil::Utils::round_up(m_create_info_ptr->get_size(), + m_buffer_memory_reqs.alignment), + m_buffer_memory_reqs.alignment) + ); + } + /* No special action needed */ break; } @@ -614,12 +560,13 @@ bool Anvil::Buffer::init_staging_buffer(const VkDeviceSize& in_size, const auto sharing_mode = Anvil::Utils::is_pow2(static_cast(staging_buffer_queue_fam_bits) ) ? Anvil::SharingMode::EXCLUSIVE : Anvil::SharingMode::CONCURRENT; - auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr, - in_size, - staging_buffer_queue_fam_bits, - sharing_mode, - Anvil::BufferUsageFlagBits::TRANSFER_DST_BIT | Anvil::BufferUsageFlagBits::TRANSFER_SRC_BIT, - Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT); + auto create_info_ptr = Anvil::BufferCreateInfo::create_alloc(m_device_ptr, + in_size, + staging_buffer_queue_fam_bits, + sharing_mode, + Anvil::BufferCreateFlagBits::NONE, + Anvil::BufferUsageFlagBits::TRANSFER_DST_BIT | Anvil::BufferUsageFlagBits::TRANSFER_SRC_BIT, + Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT); create_info_ptr->set_mt_safety (Anvil::MTSafety::DISABLED); @@ -657,7 +604,7 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, bool result (false); /* TODO: Support for sparse buffers */ - anvil_assert(m_create_info_ptr->get_type() != Anvil::BufferType::SPARSE_NO_ALLOC); + anvil_assert(m_create_info_ptr->get_create_flags() == Anvil::BufferCreateFlagBits::NONE); if ((memory_block_ptr->get_create_info_ptr()->get_memory_features() & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) != 0) { @@ -797,9 +744,11 @@ bool Anvil::Buffer::set_memory_nonsparse_internal(MemoryBlockUniquePtr in_memor goto end; } - if (m_create_info_ptr->get_type() == Anvil::BufferType::SPARSE_NO_ALLOC) + if (((m_create_info_ptr->get_create_flags() & Anvil::BufferCreateFlagBits::SPARSE_ALIASED_BIT) != 0) || + ((m_create_info_ptr->get_create_flags() & Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0) ) { - anvil_assert(m_create_info_ptr->get_type() != Anvil::BufferType::SPARSE_NO_ALLOC); + anvil_assert(((m_create_info_ptr->get_create_flags() & Anvil::BufferCreateFlagBits::SPARSE_ALIASED_BIT) == 0) && + ((m_create_info_ptr->get_create_flags() & Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT) == 0) ); goto end; } @@ -878,7 +827,7 @@ bool Anvil::Buffer::set_memory_sparse(MemoryBlock* in_memory_block_ptr, VkDeviceSize in_start_offset, VkDeviceSize in_size) { - anvil_assert(m_create_info_ptr->get_type() == Anvil::BufferType::SPARSE_NO_ALLOC); + anvil_assert((m_create_info_ptr->get_create_flags() & Anvil::BufferCreateFlagBits::SPARSE_BINDING_BIT) != 0); if (m_page_tracker_ptr->set_binding(in_memory_block_ptr, in_memory_block_start_offset, @@ -1142,7 +1091,8 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, /** TODO: Support for sparse-resident buffers whose n_memory_blocks > 1 */ Anvil::MemoryBlock* memory_block_ptr(get_memory_block(0) ); - if (m_create_info_ptr->get_type() == Anvil::BufferType::SPARSE_NO_ALLOC) + if ( m_create_info_ptr->get_type() == Anvil::BufferType::NO_ALLOC && + (m_create_info_ptr->get_create_flags() & Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0) { anvil_assert(m_page_tracker_ptr->get_n_memory_blocks() == 1); } diff --git a/src/wrappers/graphics_pipeline_manager.cpp b/src/wrappers/graphics_pipeline_manager.cpp index 85e9ce11..85b19ea4 100644 --- a/src/wrappers/graphics_pipeline_manager.cpp +++ b/src/wrappers/graphics_pipeline_manager.cpp @@ -24,10 +24,8 @@ #include "misc/base_pipeline_create_info.h" #include "misc/base_pipeline_manager.h" #include "misc/debug.h" -#include "misc/graphics_pipeline_create_info.h" #include "misc/object_tracker.h" #include "misc/render_pass_create_info.h" -#include "misc/struct_chainer.h" #include "wrappers/device.h" #include "wrappers/graphics_pipeline_manager.h" #include "wrappers/pipeline_cache.h" @@ -40,21 +38,6 @@ #undef max #endif -/** When baking a graphics pipeline descriptor, we currently use STL vectors to maintain storage - * for various Vulkan descriptors. These need to be stored on heap because: - * - * 1. The number of required descriptors depends on the pipeline configuration. - * 2. Some parent descriptors use pointers to point at other child descriptors. - * - * In order for vectors not to reallocate memory, we need to reserve memory up-front before - * we start pushing stuff. The number defined by N_CACHE_ITEMS tells how many items each - * vector will hold at max. - * - * This #define could be removed by handling memory allocations manually, but for simplicity - * reasons we'll go with STL vectors for now. - * */ -#define N_CACHE_ITEMS 256 - /* Please see header for specification */ Anvil::GraphicsPipelineManager::GraphicsPipelineManager(const Anvil::BaseDevice* in_device_ptr, @@ -104,60 +87,25 @@ bool Anvil::GraphicsPipelineManager::bake() } BakeItem; std::vector bake_items; - auto color_blend_attachment_states_vk_cache = std::vector (); - auto color_blend_state_create_info_items_vk_cache = std::vector (); - auto depth_stencil_state_create_info_items_vk_cache = std::vector (); - auto dynamic_state_create_info_items_vk_cache = std::vector (); - auto graphics_pipeline_create_info_chains = Anvil::StructChainVector (); - auto input_assembly_state_create_info_items_vk_cache = std::vector (); - auto multisample_state_create_info_chain_cache = std::vector > >(); + auto color_blend_state_create_info_chain_cache = std::vector > > (); + auto depth_stencil_state_create_info_chain_cache = std::vector > > (); + auto dynamic_state_create_info_chain_cache = std::vector > > (); + auto graphics_pipeline_create_info_chains = Anvil::StructChainVector (); + auto input_assembly_state_create_info_chain_cache = std::vector > >(); + auto multisample_state_create_info_chain_cache = std::vector > > (); std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); uint32_t n_consumed_graphics_pipelines = 0; - auto raster_state_create_info_chains_vk_cache = std::vector > >(); + auto raster_state_create_info_chain_cache = std::vector > >(); bool result = false; std::vector result_graphics_pipelines; VkResult result_vk; - auto scissor_boxes_vk_cache = std::vector (); - auto shader_stage_create_info_items_vk_cache = std::vector (); - auto specialization_info_vk_cache = std::vector (); - auto specialization_map_entry_vk_cache = std::vector (); + auto shader_stage_create_info_chain_ptrs = std::vector > >(); auto tessellation_state_create_info_chain_cache = std::vector > >(); - auto vertex_input_binding_divisor_description_vk_cache = std::vector (); auto vertex_input_state_create_info_chain_cache = std::vector > > (); - auto viewport_state_create_info_items_vk_cache = std::vector (); - std::vector viewports_vk_cache; - - - static const VkPipelineRasterizationStateRasterizationOrderAMD relaxed_rasterization_order_item = - { - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD, - nullptr, - VK_RASTERIZATION_ORDER_RELAXED_AMD - }; - static const VkPipelineRasterizationStateRasterizationOrderAMD strict_rasterization_order_item = - { - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD, - nullptr, - VK_RASTERIZATION_ORDER_STRICT_AMD - }; + auto viewport_state_create_info_chain_cache = std::vector > > (); - color_blend_attachment_states_vk_cache.reserve (N_CACHE_ITEMS); - color_blend_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - depth_stencil_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - dynamic_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - input_assembly_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - raster_state_create_info_chains_vk_cache.reserve (N_CACHE_ITEMS); - scissor_boxes_vk_cache.reserve (N_CACHE_ITEMS); - shader_stage_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - specialization_info_vk_cache.reserve (N_CACHE_ITEMS); - specialization_map_entry_vk_cache.reserve (N_CACHE_ITEMS); - tessellation_state_create_info_chain_cache.reserve (N_CACHE_ITEMS); - vertex_input_binding_divisor_description_vk_cache.reserve(N_CACHE_ITEMS); - viewport_state_create_info_items_vk_cache.reserve (N_CACHE_ITEMS); - viewports_vk_cache.reserve (N_CACHE_ITEMS); - if (mutex_ptr != nullptr) { mutex_lock = std::move( @@ -194,7 +142,6 @@ bool Anvil::GraphicsPipelineManager::bake() ++bake_item_iterator) { bool color_blend_state_used = false; - const PipelineID current_pipeline_id = bake_item_iterator->pipeline_id; auto current_pipeline_create_info_ptr = dynamic_cast(bake_item_iterator->pipeline_ptr->pipeline_create_info_ptr.get() ); Pipeline* current_pipeline_ptr = bake_item_iterator->pipeline_ptr; const Anvil::RenderPass* current_pipeline_renderpass_ptr = nullptr; @@ -202,11 +149,10 @@ bool Anvil::GraphicsPipelineManager::bake() bool depth_stencil_state_used = false; bool dynamic_state_used = false; Anvil::StructChainer graphics_pipeline_create_info_chainer; - VkPipelineInputAssemblyStateCreateInfo input_assembly_state_create_info; bool is_dynamic_scissor_state_enabled = false; bool is_dynamic_viewport_state_enabled = false; bool multisample_state_used = false; - uint32_t subpass_n_color_attachments = 0; + uint32_t n_shader_stages_used = 0; bool tessellation_state_used = false; bool viewport_state_used = false; @@ -225,110 +171,17 @@ bool Anvil::GraphicsPipelineManager::bake() continue; } - /* Extract subpass information */ - current_pipeline_renderpass_ptr->get_render_pass_create_info()->get_subpass_n_attachments(current_pipeline_subpass_id, - Anvil::AttachmentType::COLOR, - &subpass_n_color_attachments); - /* Form the color blend state create info descriptor, if needed */ { - if (!current_pipeline_create_info_ptr->is_rasterizer_discard_enabled() && - subpass_n_color_attachments > 0) - { - const float* blend_constant_ptr = nullptr; - VkPipelineColorBlendStateCreateInfo color_blend_state_create_info; - Anvil::LogicOp logic_op = Anvil::LogicOp::UNKNOWN; - bool logic_op_enabled = false; - uint32_t max_location_index = UINT32_MAX; - const uint32_t start_offset = static_cast(color_blend_attachment_states_vk_cache.size() ); - - max_location_index = current_pipeline_renderpass_ptr->get_render_pass_create_info()->get_max_color_location_used_by_subpass(current_pipeline_subpass_id); - - current_pipeline_create_info_ptr->get_blending_properties(&blend_constant_ptr, - nullptr); /* out_opt_n_blend_attachments_ptr */ - - current_pipeline_create_info_ptr->get_logic_op_state(&logic_op_enabled, - &logic_op); - - color_blend_state_create_info.attachmentCount = max_location_index + 1; - color_blend_state_create_info.flags = 0; - color_blend_state_create_info.logicOp = static_cast(logic_op); - color_blend_state_create_info.logicOpEnable = (logic_op_enabled) ? VK_TRUE : VK_FALSE; - color_blend_state_create_info.pAttachments = nullptr; - color_blend_state_create_info.pNext = nullptr; - color_blend_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO; - - memcpy(color_blend_state_create_info.blendConstants, - blend_constant_ptr, - sizeof(color_blend_state_create_info.blendConstants) ); - - anvil_assert(subpass_n_color_attachments <= current_pipeline_renderpass_ptr->get_render_pass_create_info()->get_n_attachments() ); + auto color_blend_state_create_info_chain_ptr = bake_pipeline_color_blend_state_create_info(current_pipeline_create_info_ptr, + current_pipeline_renderpass_ptr, + current_pipeline_subpass_id); - for (uint32_t n_subpass_color_attachment = 0; - n_subpass_color_attachment <= max_location_index; - ++n_subpass_color_attachment) - { - color_blend_attachment_states_vk_cache.push_back(VkPipelineColorBlendAttachmentState() ); - - VkPipelineColorBlendAttachmentState* blend_attachment_state_ptr = &color_blend_attachment_states_vk_cache.back(); - Anvil::ImageLayout dummy = Anvil::ImageLayout::UNKNOWN; - bool is_blending_enabled_for_attachment = false; - Anvil::RenderPassAttachmentID rp_attachment_id = UINT32_MAX; - - Anvil::BlendOp alpha_blend_op = Anvil::BlendOp::UNKNOWN; - Anvil::BlendOp color_blend_op = Anvil::BlendOp::UNKNOWN; - Anvil::ColorComponentFlags color_component_flags = Anvil::ColorComponentFlagBits::NONE; - Anvil::BlendFactor dst_alpha_blend_factor = Anvil::BlendFactor::UNKNOWN; - Anvil::BlendFactor dst_color_blend_factor = Anvil::BlendFactor::UNKNOWN; - Anvil::BlendFactor src_alpha_blend_factor = Anvil::BlendFactor::UNKNOWN; - Anvil::BlendFactor src_color_blend_factor = Anvil::BlendFactor::UNKNOWN; - - if (!current_pipeline_renderpass_ptr->get_render_pass_create_info()->get_subpass_attachment_properties(current_pipeline_subpass_id, - Anvil::AttachmentType::COLOR, - n_subpass_color_attachment, - &rp_attachment_id, - &dummy) || /* out_layout_ptr */ - !current_pipeline_create_info_ptr->get_color_blend_attachment_properties (rp_attachment_id, - &is_blending_enabled_for_attachment, - &color_blend_op, - &alpha_blend_op, - &src_color_blend_factor, - &dst_color_blend_factor, - &src_alpha_blend_factor, - &dst_alpha_blend_factor, - &color_component_flags) ) - { - /* The user has not defined blending properties for current color attachment. Use default state values .. */ - blend_attachment_state_ptr->blendEnable = VK_FALSE; - blend_attachment_state_ptr->alphaBlendOp = VK_BLEND_OP_ADD; - blend_attachment_state_ptr->colorBlendOp = VK_BLEND_OP_ADD; - blend_attachment_state_ptr->colorWriteMask = VK_COLOR_COMPONENT_A_BIT | - VK_COLOR_COMPONENT_B_BIT | - VK_COLOR_COMPONENT_G_BIT | - VK_COLOR_COMPONENT_R_BIT; - blend_attachment_state_ptr->dstAlphaBlendFactor = VK_BLEND_FACTOR_ONE; - blend_attachment_state_ptr->dstColorBlendFactor = VK_BLEND_FACTOR_ONE; - blend_attachment_state_ptr->srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE; - blend_attachment_state_ptr->srcColorBlendFactor = VK_BLEND_FACTOR_ONE; - } - else - { - blend_attachment_state_ptr->alphaBlendOp = static_cast(alpha_blend_op); - blend_attachment_state_ptr->blendEnable = (is_blending_enabled_for_attachment) ? VK_TRUE : VK_FALSE; - blend_attachment_state_ptr->colorBlendOp = static_cast (color_blend_op); - blend_attachment_state_ptr->colorWriteMask = color_component_flags.get_vk(); - blend_attachment_state_ptr->dstAlphaBlendFactor = static_cast(dst_alpha_blend_factor); - blend_attachment_state_ptr->dstColorBlendFactor = static_cast(dst_color_blend_factor); - blend_attachment_state_ptr->srcAlphaBlendFactor = static_cast(src_alpha_blend_factor); - blend_attachment_state_ptr->srcColorBlendFactor = static_cast(src_color_blend_factor); - } - } - - color_blend_state_create_info.pAttachments = (subpass_n_color_attachments > 0) ? &color_blend_attachment_states_vk_cache[start_offset] - : nullptr; - color_blend_state_used = true; + if (color_blend_state_create_info_chain_ptr != nullptr) + { + color_blend_state_create_info_chain_cache.push_back(std::move(color_blend_state_create_info_chain_ptr) ); - color_blend_state_create_info_items_vk_cache.push_back(color_blend_state_create_info); + color_blend_state_used = true; } else { @@ -346,112 +199,36 @@ bool Anvil::GraphicsPipelineManager::bake() /* Form the depth stencil state create info descriptor, if needed */ { - VkPipelineDepthStencilStateCreateInfo depth_stencil_state_create_info; - auto depth_test_compare_op = Anvil::CompareOp::UNKNOWN; - bool is_depth_bounds_test_enabled = false; - bool is_depth_test_enabled = false; - bool is_stencil_test_enabled = false; - float max_depth_bounds = std::numeric_limits::max(); - float min_depth_bounds = std::numeric_limits::max(); - uint32_t n_depth_stencil_attachments = 0; - - current_pipeline_create_info_ptr->get_depth_bounds_state(&is_depth_bounds_test_enabled, - &min_depth_bounds, - &max_depth_bounds); - - current_pipeline_create_info_ptr->get_depth_test_state(&is_depth_test_enabled, - &depth_test_compare_op); + auto depth_stencil_state_create_info_chain_ptr = bake_pipeline_depth_stencil_state_create_info(current_pipeline_create_info_ptr, + current_pipeline_renderpass_ptr); + if (depth_stencil_state_create_info_chain_ptr != nullptr) { - Anvil::CompareOp back_compare_op = Anvil::CompareOp::UNKNOWN; - Anvil::StencilOp back_depth_fail_op = Anvil::StencilOp::UNKNOWN; - Anvil::StencilOp back_fail_op = Anvil::StencilOp::UNKNOWN; - Anvil::StencilOp back_pass_op = Anvil::StencilOp::UNKNOWN; - Anvil::CompareOp front_compare_op = Anvil::CompareOp::UNKNOWN; - Anvil::StencilOp front_depth_fail_op = Anvil::StencilOp::UNKNOWN; - Anvil::StencilOp front_fail_op = Anvil::StencilOp::UNKNOWN; - Anvil::StencilOp front_pass_op = Anvil::StencilOp::UNKNOWN; - - current_pipeline_create_info_ptr->get_stencil_test_properties(&is_stencil_test_enabled, - &front_fail_op, - &front_pass_op, - &front_depth_fail_op, - &front_compare_op, - &depth_stencil_state_create_info.front.compareMask, - &depth_stencil_state_create_info.front.writeMask, - &depth_stencil_state_create_info.front.reference, - &back_fail_op, - &back_pass_op, - &back_depth_fail_op, - &back_compare_op, - &depth_stencil_state_create_info.back.compareMask, - &depth_stencil_state_create_info.back.writeMask, - &depth_stencil_state_create_info.back.reference);\ - depth_stencil_state_create_info.back.compareOp = static_cast(back_compare_op); - depth_stencil_state_create_info.back.depthFailOp = static_cast(back_depth_fail_op); - depth_stencil_state_create_info.back.failOp = static_cast(back_fail_op); - depth_stencil_state_create_info.back.passOp = static_cast(back_pass_op); - depth_stencil_state_create_info.front.compareOp = static_cast(front_compare_op); - depth_stencil_state_create_info.front.depthFailOp = static_cast(front_depth_fail_op); - depth_stencil_state_create_info.front.failOp = static_cast(front_fail_op); - depth_stencil_state_create_info.front.passOp = static_cast(front_pass_op); - } - - current_pipeline_renderpass_ptr->get_render_pass_create_info()->get_subpass_n_attachments(current_pipeline_create_info_ptr->get_subpass_id(), - Anvil::AttachmentType::DEPTH_STENCIL, - &n_depth_stencil_attachments); - - if (n_depth_stencil_attachments) - { - depth_stencil_state_create_info.depthBoundsTestEnable = is_depth_bounds_test_enabled ? VK_TRUE : VK_FALSE; - depth_stencil_state_create_info.depthCompareOp = static_cast(depth_test_compare_op); - depth_stencil_state_create_info.depthTestEnable = is_depth_test_enabled ? VK_TRUE : VK_FALSE; - depth_stencil_state_create_info.depthWriteEnable = current_pipeline_create_info_ptr->are_depth_writes_enabled() ? VK_TRUE : VK_FALSE; - depth_stencil_state_create_info.flags = 0; - depth_stencil_state_create_info.maxDepthBounds = max_depth_bounds; - depth_stencil_state_create_info.minDepthBounds = min_depth_bounds; - depth_stencil_state_create_info.pNext = nullptr; - depth_stencil_state_create_info.stencilTestEnable = is_stencil_test_enabled ? VK_TRUE : VK_FALSE; - depth_stencil_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO; + depth_stencil_state_create_info_chain_cache.push_back(std::move(depth_stencil_state_create_info_chain_ptr) ); depth_stencil_state_used = true; - - depth_stencil_state_create_info_items_vk_cache.push_back(depth_stencil_state_create_info); } else { - /* No depth/stencil attachment available. Make sure none of the dependent modes are enabled. */ - anvil_assert(!is_depth_bounds_test_enabled); - anvil_assert(!is_depth_test_enabled); - anvil_assert(!current_pipeline_create_info_ptr->are_depth_writes_enabled()); - anvil_assert(!is_stencil_test_enabled); - depth_stencil_state_used = false; } } /* Form the dynamic state create info descriptor, if needed */ { - const Anvil::DynamicState* enabled_dynamic_states_ptr = nullptr; - uint32_t n_enabled_dynamic_states = 0; + auto dynamic_state_create_info_ptr = bake_pipeline_dynamic_state_create_info(current_pipeline_create_info_ptr); - current_pipeline_create_info_ptr->get_enabled_dynamic_states(&enabled_dynamic_states_ptr, - &n_enabled_dynamic_states); + dynamic_state_used = false; + is_dynamic_scissor_state_enabled = false; + is_dynamic_viewport_state_enabled = false; - if (n_enabled_dynamic_states != 0) + if (dynamic_state_create_info_ptr != nullptr) { - VkPipelineDynamicStateCreateInfo dynamic_state_create_info; - - dynamic_state_create_info.dynamicStateCount = n_enabled_dynamic_states; - dynamic_state_create_info.flags = 0; - dynamic_state_create_info.pDynamicStates = (dynamic_state_create_info.dynamicStateCount > 0) ? reinterpret_cast(enabled_dynamic_states_ptr) - : VK_NULL_HANDLE; - dynamic_state_create_info.pNext = nullptr; - dynamic_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO; - - dynamic_state_used = true; + const Anvil::DynamicState* enabled_dynamic_states_ptr = nullptr; + uint32_t n_enabled_dynamic_states = 0; - dynamic_state_create_info_items_vk_cache.push_back(dynamic_state_create_info); + current_pipeline_create_info_ptr->get_enabled_dynamic_states(&enabled_dynamic_states_ptr, + &n_enabled_dynamic_states); for (uint32_t n_dynamic_state = 0; n_dynamic_state < n_enabled_dynamic_states; @@ -461,298 +238,72 @@ bool Anvil::GraphicsPipelineManager::bake() { is_dynamic_scissor_state_enabled = true; } - + else if (enabled_dynamic_states_ptr[n_dynamic_state] == Anvil::DynamicState::VIEWPORT) { is_dynamic_viewport_state_enabled = true; } } - } - else - { - dynamic_state_used = false; + + dynamic_state_used = true; + + dynamic_state_create_info_chain_cache.push_back(std::move(dynamic_state_create_info_ptr) ); } } /* Form the input assembly create info descriptor */ { - input_assembly_state_create_info.flags = 0; - input_assembly_state_create_info.pNext = nullptr; - input_assembly_state_create_info.primitiveRestartEnable = current_pipeline_create_info_ptr->is_primitive_restart_enabled() ? VK_TRUE : VK_FALSE; - input_assembly_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO; - input_assembly_state_create_info.topology = static_cast(current_pipeline_create_info_ptr->get_primitive_topology() ); + auto input_assembly_create_info_ptr = bake_pipeline_input_assembly_state_create_info(current_pipeline_create_info_ptr); + + anvil_assert(input_assembly_create_info_ptr != nullptr); - input_assembly_state_create_info_items_vk_cache.push_back(input_assembly_state_create_info); + input_assembly_state_create_info_chain_cache.push_back(std::move(input_assembly_create_info_ptr) ); } /* Form the multisample state create info descriptor, if needed */ { - bool is_sample_shading_enabled = false; - float min_sample_shading = std::numeric_limits::max(); - - current_pipeline_create_info_ptr->get_sample_shading_state(&is_sample_shading_enabled, - &min_sample_shading); + auto multisample_state_create_info_ptr = bake_pipeline_multisample_state_create_info(current_pipeline_create_info_ptr); - if (!current_pipeline_create_info_ptr->is_rasterizer_discard_enabled() ) + if (multisample_state_create_info_ptr != nullptr) { - bool are_custom_sample_locations_enabled = false; - VkExtent2D custom_sample_location_grid_size = {0, 0}; - Anvil::SampleCountFlagBits custom_sample_locations_per_pixel = Anvil::SampleCountFlagBits::NONE; - const Anvil::SampleLocation* custom_sample_locations_ptr = nullptr; - Anvil::StructChainer chainer; - const bool is_sample_mask_enabled = current_pipeline_create_info_ptr->is_sample_mask_enabled(); - uint32_t n_custom_sample_locations = 0; - - Anvil::SampleCountFlagBits sample_count = static_cast(0); - VkSampleMask sample_mask; - - current_pipeline_create_info_ptr->get_multisampling_properties(&sample_count, - &sample_mask); - current_pipeline_create_info_ptr->get_sample_location_state (&are_custom_sample_locations_enabled, - &custom_sample_locations_per_pixel, - &custom_sample_location_grid_size, - &n_custom_sample_locations, - &custom_sample_locations_ptr); - - /* If sample mask is not enabled, Vulkan spec will assume all samples need to pass. This is what the default sample mask value mimics. - * - * Hence, if the application specified a non-~0u sample mask and has NOT enabled the sample mask using toggle_sample_mask(), it's (in - * all likelihood) a trivial app-side issue. - */ - anvil_assert((!is_sample_mask_enabled && sample_mask == ~0u) || - is_sample_mask_enabled); - - { - VkPipelineMultisampleStateCreateInfo multisample_state_create_info; - - multisample_state_create_info.alphaToCoverageEnable = current_pipeline_create_info_ptr->is_alpha_to_coverage_enabled() ? VK_TRUE : VK_FALSE; - multisample_state_create_info.alphaToOneEnable = current_pipeline_create_info_ptr->is_alpha_to_one_enabled() ? VK_TRUE : VK_FALSE; - multisample_state_create_info.flags = 0; - multisample_state_create_info.minSampleShading = min_sample_shading; - multisample_state_create_info.pNext = nullptr; - multisample_state_create_info.pSampleMask = (is_sample_mask_enabled) ? &sample_mask : nullptr; - multisample_state_create_info.rasterizationSamples = static_cast(sample_count); - multisample_state_create_info.sampleShadingEnable = is_sample_shading_enabled ? VK_TRUE : VK_FALSE; - multisample_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO; - - chainer.append_struct(multisample_state_create_info); - } - - if (are_custom_sample_locations_enabled) - { - VkPipelineSampleLocationsStateCreateInfoEXT psl_state_create_info; - VkSampleLocationsInfoEXT sample_locations_info; - - sample_locations_info.pNext = nullptr; - sample_locations_info.pSampleLocations = reinterpret_cast(custom_sample_locations_ptr); - sample_locations_info.sampleLocationGridSize = custom_sample_location_grid_size; - sample_locations_info.sampleLocationsCount = n_custom_sample_locations; - sample_locations_info.sampleLocationsPerPixel = static_cast(custom_sample_locations_per_pixel); - sample_locations_info.sType = VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT; - - psl_state_create_info.pNext = nullptr; - psl_state_create_info.sampleLocationsEnable = VK_TRUE; - psl_state_create_info.sampleLocationsInfo = sample_locations_info; - psl_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT; - - anvil_assert(m_device_ptr->get_extension_info()->ext_sample_locations() ); - - chainer.append_struct(psl_state_create_info); - } - multisample_state_used = true; - - multisample_state_create_info_chain_cache.push_back( - std::move(chainer.create_chain() ) - ); } else { - /* Make sure any dependent modes are disabled */ - anvil_assert(!current_pipeline_create_info_ptr->is_alpha_to_coverage_enabled() ); - anvil_assert(!current_pipeline_create_info_ptr->is_alpha_to_one_enabled () ); - anvil_assert(!is_sample_shading_enabled); - multisample_state_used = false; } + + multisample_state_create_info_chain_cache.push_back(std::move(multisample_state_create_info_ptr) ); } /* Form the raster state create info chain */ { - Anvil::CullModeFlags cull_mode = Anvil::CullModeFlagBits::NONE; - float depth_bias_clamp = std::numeric_limits::max(); - float depth_bias_constant_factor = std::numeric_limits::max(); - float depth_bias_slope_factor = std::numeric_limits::max(); - Anvil::FrontFace front_face = Anvil::FrontFace::UNKNOWN; - bool is_depth_bias_enabled = false; - float line_width = std::numeric_limits::max(); - Anvil::PolygonMode polygon_mode = Anvil::PolygonMode::UNKNOWN; - Anvil::StructChainer raster_state_create_info_chainer; - - current_pipeline_create_info_ptr->get_depth_bias_state (&is_depth_bias_enabled, - &depth_bias_constant_factor, - &depth_bias_clamp, - &depth_bias_slope_factor); - current_pipeline_create_info_ptr->get_rasterization_properties(&polygon_mode, - &cull_mode, - &front_face, - &line_width); - - { - VkPipelineRasterizationStateCreateInfo raster_state_create_info; - - raster_state_create_info.cullMode = cull_mode.get_vk(); - raster_state_create_info.depthBiasClamp = depth_bias_clamp; - raster_state_create_info.depthBiasConstantFactor = depth_bias_constant_factor; - raster_state_create_info.depthBiasEnable = is_depth_bias_enabled ? VK_TRUE : VK_FALSE; - raster_state_create_info.depthBiasSlopeFactor = depth_bias_slope_factor; - raster_state_create_info.depthClampEnable = current_pipeline_create_info_ptr->is_depth_clamp_enabled() ? VK_TRUE : VK_FALSE; - raster_state_create_info.flags = 0; - raster_state_create_info.frontFace = static_cast(front_face); - raster_state_create_info.lineWidth = line_width; - raster_state_create_info.pNext = nullptr; - raster_state_create_info.polygonMode = static_cast(polygon_mode); - raster_state_create_info.rasterizerDiscardEnable = current_pipeline_create_info_ptr->is_rasterizer_discard_enabled() ? VK_TRUE : VK_FALSE; - raster_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO; - - raster_state_create_info_chainer.append_struct(raster_state_create_info); - } - - if (m_device_ptr->is_extension_enabled(VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME) ) - { - /* Chain a predefined struct which will toggle the relaxed rasterization, as long as the device supports the - * VK_AMD_rasterization_order extension. - */ - if (current_pipeline_create_info_ptr->get_rasterization_order() != Anvil::RasterizationOrderAMD::STRICT) - { - anvil_assert(current_pipeline_create_info_ptr->get_rasterization_order() == static_cast(relaxed_rasterization_order_item.rasterizationOrder) ); + auto raster_state_create_info_ptr = bake_pipeline_rasterization_state_create_info(current_pipeline_create_info_ptr); - raster_state_create_info_chainer.append_struct(relaxed_rasterization_order_item); - } - else - { - raster_state_create_info_chainer.append_struct(strict_rasterization_order_item); - } - } - else - if (current_pipeline_create_info_ptr->get_rasterization_order() != Anvil::RasterizationOrderAMD::STRICT) - { - fprintf(stderr, - "[!] Cannot enable out-of-order rasterization - VK_AMD_rasterization_order extension not enabled at device creation time\n"); - } + anvil_assert(raster_state_create_info_ptr != nullptr); - raster_state_create_info_chains_vk_cache.push_back( - raster_state_create_info_chainer.create_chain() - ); + raster_state_create_info_chain_cache.push_back(std::move(raster_state_create_info_ptr) ); } /* Form stage descriptors */ - uint32_t shader_stage_start_offset = static_cast(shader_stage_create_info_items_vk_cache.size() ); { - static const Anvil::ShaderStage graphics_shader_stages[] = - { - Anvil::ShaderStage::FRAGMENT, - Anvil::ShaderStage::GEOMETRY, - Anvil::ShaderStage::TESSELLATION_CONTROL, - Anvil::ShaderStage::TESSELLATION_EVALUATION, - Anvil::ShaderStage::VERTEX - }; - - for (const auto& current_graphics_shader_stage : graphics_shader_stages) - { - const Anvil::ShaderModuleStageEntryPoint* shader_stage_entry_point_ptr = nullptr; - - current_pipeline_create_info_ptr->get_shader_stage_properties(current_graphics_shader_stage, - &shader_stage_entry_point_ptr); - - if (shader_stage_entry_point_ptr != nullptr) - { - VkPipelineShaderStageCreateInfo current_shader_stage_create_info; - const unsigned char* current_shader_stage_specialization_constants_data_buffer_ptr = nullptr; - const SpecializationConstants* current_shader_stage_specialization_constants_ptr = nullptr; - Anvil::ShaderModule* shader_module_ptr = nullptr; - - specialization_info_vk_cache.push_back(VkSpecializationInfo() ); - - current_pipeline_create_info_ptr->get_specialization_constants(current_graphics_shader_stage, - ¤t_shader_stage_specialization_constants_ptr, - ¤t_shader_stage_specialization_constants_data_buffer_ptr); - - if (current_shader_stage_specialization_constants_ptr->size() > 0) - { - bake_specialization_info_vk(*current_shader_stage_specialization_constants_ptr, - current_shader_stage_specialization_constants_data_buffer_ptr, - &specialization_map_entry_vk_cache, - &specialization_info_vk_cache.back() ); - } - - shader_module_ptr = shader_stage_entry_point_ptr->shader_module_ptr; - - current_shader_stage_create_info.module = shader_module_ptr->get_module(); - current_shader_stage_create_info.pName = (shader_stage_entry_point_ptr->stage == Anvil::ShaderStage::FRAGMENT) ? shader_module_ptr->get_fs_entrypoint_name().c_str() - : (shader_stage_entry_point_ptr->stage == Anvil::ShaderStage::GEOMETRY) ? shader_module_ptr->get_gs_entrypoint_name().c_str() - : (shader_stage_entry_point_ptr->stage == Anvil::ShaderStage::TESSELLATION_CONTROL) ? shader_module_ptr->get_tc_entrypoint_name().c_str() - : (shader_stage_entry_point_ptr->stage == Anvil::ShaderStage::TESSELLATION_EVALUATION) ? shader_module_ptr->get_te_entrypoint_name().c_str() - : (shader_stage_entry_point_ptr->stage == Anvil::ShaderStage::VERTEX) ? shader_module_ptr->get_vs_entrypoint_name().c_str() - : nullptr; + auto shader_stage_create_info_chain_vec_ptr = bake_pipeline_shader_stage_create_info_chain_vector(current_pipeline_create_info_ptr); + anvil_assert(shader_stage_create_info_chain_vec_ptr != nullptr); - current_shader_stage_create_info.flags = 0; - current_shader_stage_create_info.pNext = nullptr; - current_shader_stage_create_info.pSpecializationInfo = (current_shader_stage_specialization_constants_ptr->size() > 0) ? &specialization_info_vk_cache.back() - : VK_NULL_HANDLE; - current_shader_stage_create_info.stage = static_cast(Anvil::Utils::get_shader_stage_flag_bits_from_shader_stage(shader_stage_entry_point_ptr->stage) ); - current_shader_stage_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; + n_shader_stages_used = shader_stage_create_info_chain_vec_ptr->get_n_structs(); - shader_stage_create_info_items_vk_cache.push_back(current_shader_stage_create_info); - } - } + shader_stage_create_info_chain_ptrs.push_back(std::move(shader_stage_create_info_chain_vec_ptr) ); } /* Form the tessellation state create info descriptor if needed */ { - const Anvil::ShaderModuleStageEntryPoint* tc_shader_stage_entry_point_ptr = nullptr; - const Anvil::ShaderModuleStageEntryPoint* te_shader_stage_entry_point_ptr = nullptr; - - current_pipeline_create_info_ptr->get_shader_stage_properties(Anvil::ShaderStage::TESSELLATION_CONTROL, - &tc_shader_stage_entry_point_ptr); - current_pipeline_create_info_ptr->get_shader_stage_properties(Anvil::ShaderStage::TESSELLATION_EVALUATION, - &te_shader_stage_entry_point_ptr); + auto tessellation_state_create_info_ptr = bake_pipeline_tessellation_state_create_info(current_pipeline_create_info_ptr); - if (tc_shader_stage_entry_point_ptr != nullptr && - te_shader_stage_entry_point_ptr != nullptr) + if (tessellation_state_create_info_ptr != nullptr) { - Anvil::StructChainer tessellation_state_create_info_chainer; - - { - VkPipelineTessellationStateCreateInfo tessellation_state_create_info; - - tessellation_state_create_info.flags = 0; - tessellation_state_create_info.patchControlPoints = current_pipeline_create_info_ptr->get_n_patch_control_points(); - tessellation_state_create_info.pNext = nullptr; - tessellation_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO; - - tessellation_state_create_info_chainer.append_struct(tessellation_state_create_info); - } - - if (m_device_ptr->is_extension_enabled(VK_KHR_MAINTENANCE2_EXTENSION_NAME) ) - { - VkPipelineTessellationDomainOriginStateCreateInfoKHR domain_origin_state_create_info; - - domain_origin_state_create_info.domainOrigin = static_cast(current_pipeline_create_info_ptr->get_tessellation_domain_origin() ); - domain_origin_state_create_info.pNext = nullptr; - domain_origin_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO_KHR; - - tessellation_state_create_info_chainer.append_struct(domain_origin_state_create_info); - } - else - { - /* App wants to adjust the default tessellation domain origin value, even though KHR_maintenance2 is unsupported! */ - anvil_assert(current_pipeline_create_info_ptr->get_tessellation_domain_origin() == Anvil::TessellationDomainOrigin::UPPER_LEFT); - } + tessellation_state_create_info_chain_cache.push_back(std::move(tessellation_state_create_info_ptr) ); tessellation_state_used = true; - - tessellation_state_create_info_chain_cache.push_back(tessellation_state_create_info_chainer.create_chain() ); } else { @@ -762,214 +313,35 @@ bool Anvil::GraphicsPipelineManager::bake() /* Form the vertex input state create info descriptor */ { - std::unique_ptr current_pipeline_gfx_data_ptr; - Anvil::StructChainer vertex_input_state_create_info_chainer; - - anvil_assert(m_pipeline_id_to_gfx_pipeline_data.find(current_pipeline_id) == m_pipeline_id_to_gfx_pipeline_data.end() ); - - current_pipeline_gfx_data_ptr.reset( - new GraphicsPipelineData(current_pipeline_create_info_ptr) - ); - - if (current_pipeline_gfx_data_ptr == nullptr) - { - anvil_assert(current_pipeline_gfx_data_ptr != nullptr); - - continue; - } - - { - VkPipelineVertexInputStateCreateInfo create_info; - - create_info.vertexAttributeDescriptionCount = static_cast(current_pipeline_gfx_data_ptr->vk_input_attributes.size()); - create_info.vertexBindingDescriptionCount = static_cast(current_pipeline_gfx_data_ptr->vk_input_bindings.size ()); - - create_info.flags = 0; - create_info.pNext = nullptr; - create_info.pVertexAttributeDescriptions = (create_info.vertexAttributeDescriptionCount > 0) ? ¤t_pipeline_gfx_data_ptr->vk_input_attributes.at(0) - : nullptr; - create_info.pVertexBindingDescriptions = (create_info.vertexBindingDescriptionCount > 0) ? ¤t_pipeline_gfx_data_ptr->vk_input_bindings.at(0) - : nullptr; - create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO; - - vertex_input_state_create_info_chainer.append_struct(create_info); - } - - { - uint32_t n_divisor_descriptors_pre_cached = static_cast(vertex_input_binding_divisor_description_vk_cache.size() ); - - for (const auto& current_binding_info : current_pipeline_gfx_data_ptr->input_bindings) - { - /* Make sure to chain VkVertexInputBindingDivisorDescriptionEXT for each binding which uses a non-default divisor value */ - if (current_binding_info.divisor != 1) - { - VkVertexInputBindingDivisorDescriptionEXT divisor_info; - - divisor_info.binding = current_binding_info.binding; - divisor_info.divisor = current_binding_info.divisor; - - vertex_input_binding_divisor_description_vk_cache.push_back(divisor_info); - } - } + auto vertex_input_state_create_info_ptr = bake_pipeline_vertex_input_state_create_info(current_pipeline_create_info_ptr); - if (n_divisor_descriptors_pre_cached < static_cast(vertex_input_binding_divisor_description_vk_cache.size() )) - { - VkPipelineVertexInputDivisorStateCreateInfoEXT divisor_state_create_info; - - divisor_state_create_info.pNext = nullptr; - divisor_state_create_info.pVertexBindingDivisors = &vertex_input_binding_divisor_description_vk_cache.at(n_divisor_descriptors_pre_cached); - divisor_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT; - divisor_state_create_info.vertexBindingDivisorCount = static_cast(vertex_input_binding_divisor_description_vk_cache.size() ) - n_divisor_descriptors_pre_cached; + anvil_assert(vertex_input_state_create_info_ptr != nullptr); - vertex_input_state_create_info_chainer.append_struct(divisor_state_create_info); - } - } - - vertex_input_state_create_info_chain_cache.push_back( - vertex_input_state_create_info_chainer.create_chain() - ); - - m_pipeline_id_to_gfx_pipeline_data[current_pipeline_id] = std::move(current_pipeline_gfx_data_ptr); + vertex_input_state_create_info_chain_cache.push_back(std::move(vertex_input_state_create_info_ptr) ); } /* Form the viewport state create info descriptor, if needed */ - if (!current_pipeline_create_info_ptr->is_rasterizer_discard_enabled() ) { - uint32_t n_scissor_boxes = (is_dynamic_scissor_state_enabled) ? current_pipeline_create_info_ptr->get_n_dynamic_scissor_boxes() - : current_pipeline_create_info_ptr->get_n_scissor_boxes (); - uint32_t n_viewports = (is_dynamic_viewport_state_enabled) ? current_pipeline_create_info_ptr->get_n_dynamic_viewports () - : current_pipeline_create_info_ptr->get_n_viewports (); - const uint32_t scissor_boxes_start_offset = static_cast(scissor_boxes_vk_cache.size() ); - const uint32_t viewports_start_offset = static_cast(viewports_vk_cache.size() ); - VkPipelineViewportStateCreateInfo viewport_state_create_info; - - anvil_assert(n_scissor_boxes == n_viewports); + auto viewport_state_create_info_ptr = bake_pipeline_viewport_state_create_info(current_pipeline_create_info_ptr, + is_dynamic_scissor_state_enabled, + is_dynamic_viewport_state_enabled); - if (n_scissor_boxes == 0) + if (viewport_state_create_info_ptr != nullptr) { - /* No scissor boxes / viewport defined. Use default settings.. */ - auto swapchain_ptr = current_pipeline_create_info_ptr->get_renderpass()->get_swapchain(); - uint32_t window_size[2] = {0}; + viewport_state_create_info_chain_cache.push_back(std::move(viewport_state_create_info_ptr) ); - /* NOTE: If you hit this assertion, you either need to pass a Swapchain instance when this renderpass is being created, - * *or* specify scissor & viewport information for the GFX pipeline. - */ - anvil_assert(swapchain_ptr != nullptr); - anvil_assert(n_viewports == 0); - - swapchain_ptr->get_image(0)->get_image_mipmap_size(0, /* n_mipmap */ - window_size + 0, - window_size + 1, - nullptr); /* out_opt_depth_ptr */ - - anvil_assert(window_size[0] != 0 && - window_size[1] != 0); - - current_pipeline_create_info_ptr->set_scissor_box_properties(0, /* in_n_scissor_box */ - 0, /* in_x */ - 0, /* in_y */ - window_size[0], - window_size[1]); - current_pipeline_create_info_ptr->set_viewport_properties (0, /* in_n_viewport */ - 0.0f, /* in_origin_x */ - 0.0f, /* in_origin_y */ - static_cast(window_size[0]), - static_cast(window_size[1]), - 0.0f, /* in_min_depth */ - 1.0f); /* in_max_depth */ - - n_scissor_boxes = 1; - n_viewports = 1; + viewport_state_used = true; } - - /* Convert internal scissor box & viewport representations to Vulkan descriptors */ - if (!is_dynamic_scissor_state_enabled) - { - for (uint32_t n_scissor_box = 0; - n_scissor_box < n_scissor_boxes; - ++n_scissor_box) - { - uint32_t current_scissor_box_height = UINT32_MAX; - uint32_t current_scissor_box_width = UINT32_MAX; - int32_t current_scissor_box_x = INT32_MAX; - int32_t current_scissor_box_y = INT32_MAX; - VkRect2D current_scissor_box_vk; - - current_pipeline_create_info_ptr->get_scissor_box_properties(n_scissor_box, - ¤t_scissor_box_x, - ¤t_scissor_box_y, - ¤t_scissor_box_width, - ¤t_scissor_box_height); - current_scissor_box_vk.extent.height = current_scissor_box_height; - current_scissor_box_vk.extent.width = current_scissor_box_width; - current_scissor_box_vk.offset.x = current_scissor_box_x; - current_scissor_box_vk.offset.y = current_scissor_box_y; - - scissor_boxes_vk_cache.push_back(current_scissor_box_vk); - } - } - - if (!is_dynamic_viewport_state_enabled) + else { - for (uint32_t n_viewport = 0; - n_viewport < n_viewports; - ++n_viewport) - { - float current_viewport_height = std::numeric_limits::max(); - float current_viewport_max_depth = std::numeric_limits::max(); - float current_viewport_min_depth = std::numeric_limits::max(); - float current_viewport_origin_x = std::numeric_limits::max(); - float current_viewport_origin_y = std::numeric_limits::max(); - float current_viewport_width = std::numeric_limits::max(); - VkViewport current_viewport_vk; - - current_pipeline_create_info_ptr->get_viewport_properties(n_viewport, - ¤t_viewport_origin_x, - ¤t_viewport_origin_y, - ¤t_viewport_width, - ¤t_viewport_height, - ¤t_viewport_min_depth, - ¤t_viewport_max_depth); - - current_viewport_vk.height = current_viewport_height; - current_viewport_vk.maxDepth = current_viewport_max_depth; - current_viewport_vk.minDepth = current_viewport_min_depth; - current_viewport_vk.x = current_viewport_origin_x; - current_viewport_vk.y = current_viewport_origin_y; - current_viewport_vk.width = current_viewport_width; - - viewports_vk_cache.push_back(current_viewport_vk); - } + viewport_state_used = false; } - - /* Bake the descriptor */ - viewport_state_create_info.flags = 0; - viewport_state_create_info.pNext = nullptr; - viewport_state_create_info.pScissors = (is_dynamic_scissor_state_enabled) ? VK_NULL_HANDLE - : &scissor_boxes_vk_cache.at(scissor_boxes_start_offset); - viewport_state_create_info.pViewports = (is_dynamic_viewport_state_enabled) ? VK_NULL_HANDLE - : &viewports_vk_cache.at(viewports_start_offset); - viewport_state_create_info.scissorCount = n_scissor_boxes; - viewport_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO; - viewport_state_create_info.viewportCount = n_viewports; - - anvil_assert(viewport_state_create_info.scissorCount == viewport_state_create_info.viewportCount); - anvil_assert(viewport_state_create_info.scissorCount != 0); - - viewport_state_used = true; - - viewport_state_create_info_items_vk_cache.push_back(viewport_state_create_info); - } - else - { - viewport_state_used = false; } /* Bake the GFX pipeline info struct chain */ { - VkGraphicsPipelineCreateInfo graphics_pipeline_create_info = {}; - - /* Configure base pipeline handle/indices fields of the create info descriptor */ + VkPipeline base_pipeline_handle = VK_NULL_HANDLE; + int32_t base_pipeline_index = UINT32_MAX; const auto current_pipeline_base_pipeline_id = current_pipeline_create_info_ptr->get_base_pipeline_id(); if (current_pipeline_base_pipeline_id != UINT32_MAX) @@ -991,8 +363,7 @@ bool Anvil::GraphicsPipelineManager::bake() if (base_bake_item_iterator != bake_items.end() ) { /* Case 1 */ - graphics_pipeline_create_info.basePipelineHandle = VK_NULL_HANDLE; - graphics_pipeline_create_info.basePipelineIndex = static_cast(base_bake_item_iterator - bake_items.begin() ); + base_pipeline_index = static_cast(base_bake_item_iterator - bake_items.begin() ); } else { @@ -1002,8 +373,7 @@ bool Anvil::GraphicsPipelineManager::bake() baked_pipeline_iterator->second->baked_pipeline != VK_NULL_HANDLE) { /* Case 2 */ - graphics_pipeline_create_info.basePipelineHandle = baked_pipeline_iterator->second->baked_pipeline; - graphics_pipeline_create_info.basePipelineIndex = UINT32_MAX; + base_pipeline_handle = baked_pipeline_iterator->second->baked_pipeline; } else { @@ -1015,77 +385,36 @@ bool Anvil::GraphicsPipelineManager::bake() else { /* No base pipeline requested */ - graphics_pipeline_create_info.basePipelineHandle = VK_NULL_HANDLE; - graphics_pipeline_create_info.basePipelineIndex = UINT32_MAX; - } - - /* Form the rest of the create info descriptor */ - anvil_assert(current_pipeline_ptr->layout_ptr != nullptr); - - graphics_pipeline_create_info.flags = 0; - graphics_pipeline_create_info.layout = current_pipeline_ptr->layout_ptr->get_pipeline_layout(); - graphics_pipeline_create_info.pColorBlendState = (color_blend_state_used) ? &color_blend_state_create_info_items_vk_cache[color_blend_state_create_info_items_vk_cache.size() - 1] - : VK_NULL_HANDLE; - graphics_pipeline_create_info.pDepthStencilState = (depth_stencil_state_used) ? &depth_stencil_state_create_info_items_vk_cache[depth_stencil_state_create_info_items_vk_cache.size() - 1] - : VK_NULL_HANDLE; - graphics_pipeline_create_info.pDynamicState = (dynamic_state_used) ? &dynamic_state_create_info_items_vk_cache[dynamic_state_create_info_items_vk_cache.size() - 1] - : VK_NULL_HANDLE; - graphics_pipeline_create_info.pInputAssemblyState = &input_assembly_state_create_info_items_vk_cache[input_assembly_state_create_info_items_vk_cache.size() - 1]; - graphics_pipeline_create_info.pMultisampleState = (multisample_state_used) ? multisample_state_create_info_chain_cache.at(multisample_state_create_info_chain_cache.size() - 1)->root_struct_ptr - : VK_NULL_HANDLE; - graphics_pipeline_create_info.pNext = nullptr; - graphics_pipeline_create_info.pRasterizationState = raster_state_create_info_chains_vk_cache.at(raster_state_create_info_chains_vk_cache.size() - 1)->root_struct_ptr; - graphics_pipeline_create_info.pStages = (shader_stage_start_offset < shader_stage_create_info_items_vk_cache.size() ) ? &shader_stage_create_info_items_vk_cache[shader_stage_start_offset] - : nullptr; - graphics_pipeline_create_info.pTessellationState = (tessellation_state_used) ? tessellation_state_create_info_chain_cache.at(tessellation_state_create_info_chain_cache.size() - 1)->root_struct_ptr - : VK_NULL_HANDLE; - graphics_pipeline_create_info.pVertexInputState = vertex_input_state_create_info_chain_cache.at(vertex_input_state_create_info_chain_cache.size() - 1)->get_root_struct(); - graphics_pipeline_create_info.pViewportState = (viewport_state_used) ? &viewport_state_create_info_items_vk_cache[viewport_state_create_info_items_vk_cache.size() - 1] - : VK_NULL_HANDLE; - graphics_pipeline_create_info.renderPass = current_pipeline_create_info_ptr->get_renderpass()->get_render_pass(); - graphics_pipeline_create_info.stageCount = static_cast(shader_stage_create_info_items_vk_cache.size() - shader_stage_start_offset); - graphics_pipeline_create_info.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO; - graphics_pipeline_create_info.subpass = current_pipeline_create_info_ptr->get_subpass_id(); - - if (graphics_pipeline_create_info.basePipelineIndex != static_cast(UINT32_MAX) ) - { - graphics_pipeline_create_info.flags |= VK_PIPELINE_CREATE_DERIVATIVE_BIT; } - graphics_pipeline_create_info.flags |= ((current_pipeline_create_info_ptr->allows_derivatives () ) ? VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT : 0) | - ((current_pipeline_create_info_ptr->has_optimizations_disabled() ) ? VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT : 0); - - graphics_pipeline_create_info_chainer.append_struct(graphics_pipeline_create_info); + auto result_ptr = bake_graphics_pipeline_create_info(current_pipeline_create_info_ptr, + current_pipeline_ptr->layout_ptr.get(), + base_pipeline_handle, + base_pipeline_index, + (color_blend_state_used) ? color_blend_state_create_info_chain_cache.back()->get_root_struct() + : nullptr, + (depth_stencil_state_used) ? depth_stencil_state_create_info_chain_cache.back()->get_root_struct() + : nullptr, + (dynamic_state_used) ? dynamic_state_create_info_chain_cache.back()->get_root_struct() + : nullptr, + input_assembly_state_create_info_chain_cache.back()->get_root_struct(), + (multisample_state_used) ? multisample_state_create_info_chain_cache.back()->get_root_struct() + : nullptr, + raster_state_create_info_chain_cache.back()->root_struct_ptr, + n_shader_stages_used, + (n_shader_stages_used > 0) ? shader_stage_create_info_chain_ptrs.back()->get_root_structs() + : nullptr, + (tessellation_state_used) ? tessellation_state_create_info_chain_cache.back()->get_root_struct() + : nullptr, + vertex_input_state_create_info_chain_cache.back()->get_root_struct(), + (viewport_state_used) ? viewport_state_create_info_chain_cache.back()->get_root_struct() + : nullptr); + + /* Stash the descriptor for now. We will issue one expensive vkCreateGraphicsPipelines() call after all pipeline objects + * are iterated over. */ + graphics_pipeline_create_info_chains.append_struct_chain(std::move(result_ptr) ); } - - /* Stash the descriptor for now. We will issue one expensive vkCreateGraphicsPipelines() call after all pipeline objects - * are iterated over. */ - graphics_pipeline_create_info_chains.append_struct_chain( - std::move(graphics_pipeline_create_info_chainer.create_chain() ) - ); - } - - #ifdef _DEBUG - { - /* If you hit any of the below assertion failures, please bump up the value under the #define. - * - * We use the vectors to hold structure instances. If more than N_CACHE_ITEMS items is ever requested from any of these vectors, - * the underlying storage will likely be reallocated. Many of the descriptors use pointers to refer to children descriptors, - * and when the data is moved around, the pointers are no longer valid. - */ - anvil_assert(color_blend_attachment_states_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(color_blend_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(depth_stencil_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(dynamic_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(input_assembly_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(scissor_boxes_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(shader_stage_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(specialization_info_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(specialization_map_entry_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(viewport_state_create_info_items_vk_cache.size() <= N_CACHE_ITEMS); - anvil_assert(viewports_vk_cache.size() <= N_CACHE_ITEMS); } - #endif /* All right. Try to bake all pipeline objects at once */ result_graphics_pipelines.resize(bake_items.size() ); @@ -1131,6 +460,864 @@ bool Anvil::GraphicsPipelineManager::bake() return result; } +/* Please see header for specification */ +Anvil::StructChainUniquePtr Anvil::GraphicsPipelineManager::bake_graphics_pipeline_create_info(const Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr, + const Anvil::PipelineLayout* in_pipeline_layout_ptr, + const VkPipeline& in_opt_base_pipeline_handle, + const int32_t& in_opt_base_pipeline_index, + const VkPipelineColorBlendStateCreateInfo* in_opt_color_blend_state_create_info_ptr, + const VkPipelineDepthStencilStateCreateInfo* in_opt_depth_stencil_state_create_info_ptr, + const VkPipelineDynamicStateCreateInfo* in_opt_dynamic_state_create_info_ptr, + const VkPipelineInputAssemblyStateCreateInfo* in_input_assembly_state_create_info_ptr, + const VkPipelineMultisampleStateCreateInfo* in_opt_multisample_state_create_info_ptr, + const VkPipelineRasterizationStateCreateInfo* in_rasterization_state_create_info_ptr, + const uint32_t& in_n_shader_stage_create_info_items, + const VkPipelineShaderStageCreateInfo* in_shader_stage_create_info_items_ptr, + const VkPipelineTessellationStateCreateInfo* in_opt_tessellation_state_create_info_ptr, + const VkPipelineVertexInputStateCreateInfo* in_vertex_input_state_create_info_ptr, + const VkPipelineViewportStateCreateInfo* in_opt_viewport_state_create_info_ptr) const +{ + Anvil::StructChainer chainer; + + { + VkGraphicsPipelineCreateInfo create_info; + + create_info.basePipelineHandle = in_opt_base_pipeline_handle; + create_info.basePipelineIndex = in_opt_base_pipeline_index; + create_info.flags = 0; + create_info.layout = in_pipeline_layout_ptr->get_pipeline_layout(); + create_info.pColorBlendState = in_opt_color_blend_state_create_info_ptr; + create_info.pDepthStencilState = in_opt_depth_stencil_state_create_info_ptr; + create_info.pDynamicState = in_opt_dynamic_state_create_info_ptr; + create_info.pInputAssemblyState = in_input_assembly_state_create_info_ptr; + create_info.pMultisampleState = in_opt_multisample_state_create_info_ptr; + create_info.pNext = nullptr; + create_info.pRasterizationState = in_rasterization_state_create_info_ptr; + create_info.pStages = in_shader_stage_create_info_items_ptr; + create_info.pTessellationState = in_opt_tessellation_state_create_info_ptr; + create_info.pVertexInputState = in_vertex_input_state_create_info_ptr; + create_info.pViewportState = in_opt_viewport_state_create_info_ptr; + create_info.renderPass = in_gfx_pipeline_create_info_ptr->get_renderpass()->get_render_pass(); + create_info.stageCount = in_n_shader_stage_create_info_items; + create_info.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO; + create_info.subpass = in_gfx_pipeline_create_info_ptr->get_subpass_id(); + + if (create_info.basePipelineIndex != static_cast(UINT32_MAX) ) + { + create_info.flags |= VK_PIPELINE_CREATE_DERIVATIVE_BIT; + } + + create_info.flags |= ((in_gfx_pipeline_create_info_ptr->allows_derivatives () ) ? VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT : 0) | + ((in_gfx_pipeline_create_info_ptr->has_optimizations_disabled() ) ? VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT : 0); + + chainer.append_struct(create_info); + } + + return chainer.create_chain(); +} + +/* Please see header for specification */ +Anvil::StructChainUniquePtr Anvil::GraphicsPipelineManager::bake_pipeline_color_blend_state_create_info(const Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr, + const Anvil::RenderPass* in_current_renderpass_ptr, + const Anvil::SubPassID& in_subpass_id) const +{ + Anvil::StructChainUniquePtr result_chain_ptr; + uint32_t subpass_n_color_attachments = 0; + + in_current_renderpass_ptr->get_render_pass_create_info()->get_subpass_n_attachments(in_subpass_id, + Anvil::AttachmentType::COLOR, + &subpass_n_color_attachments); + + if (!in_gfx_pipeline_create_info_ptr->is_rasterizer_discard_enabled() && + subpass_n_color_attachments > 0) + { + const float* blend_constant_ptr = nullptr; + Anvil::StructChainer color_blend_state_create_info_chainer; + Anvil::StructID color_blend_state_create_info_struct_id; + Anvil::LogicOp logic_op = Anvil::LogicOp::UNKNOWN; + bool logic_op_enabled = false; + uint32_t max_location_index = UINT32_MAX; + + max_location_index = in_current_renderpass_ptr->get_render_pass_create_info()->get_max_color_location_used_by_subpass(in_subpass_id); + + in_gfx_pipeline_create_info_ptr->get_blending_properties(&blend_constant_ptr, + nullptr); /* out_opt_n_blend_attachments_ptr */ + + in_gfx_pipeline_create_info_ptr->get_logic_op_state(&logic_op_enabled, + &logic_op); + + { + VkPipelineColorBlendStateCreateInfo color_blend_state_create_info; + + color_blend_state_create_info.attachmentCount = max_location_index + 1; + color_blend_state_create_info.flags = 0; + color_blend_state_create_info.logicOp = static_cast(logic_op); + color_blend_state_create_info.logicOpEnable = (logic_op_enabled) ? VK_TRUE : VK_FALSE; + color_blend_state_create_info.pAttachments = nullptr; /* will be patched by the chainer */ + color_blend_state_create_info.pNext = nullptr; + color_blend_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO; + + memcpy(color_blend_state_create_info.blendConstants, + blend_constant_ptr, + sizeof(color_blend_state_create_info.blendConstants) ); + + color_blend_state_create_info_struct_id = color_blend_state_create_info_chainer.append_struct(color_blend_state_create_info); + } + + anvil_assert(subpass_n_color_attachments <= in_current_renderpass_ptr->get_render_pass_create_info()->get_n_attachments() ); + + { + std::vector color_blend_attachment_state_vec(max_location_index + 1); + + for (uint32_t n_subpass_color_attachment = 0; + n_subpass_color_attachment <= max_location_index; + ++n_subpass_color_attachment) + { + VkPipelineColorBlendAttachmentState* blend_state_ptr = &color_blend_attachment_state_vec.at(n_subpass_color_attachment); + Anvil::ImageLayout dummy = Anvil::ImageLayout::UNKNOWN; + bool is_blending_enabled_for_attachment = false; + Anvil::RenderPassAttachmentID rp_attachment_id = UINT32_MAX; + + Anvil::BlendOp alpha_blend_op = Anvil::BlendOp::UNKNOWN; + Anvil::BlendOp color_blend_op = Anvil::BlendOp::UNKNOWN; + Anvil::ColorComponentFlags color_component_flags = Anvil::ColorComponentFlagBits::NONE; + Anvil::BlendFactor dst_alpha_blend_factor = Anvil::BlendFactor::UNKNOWN; + Anvil::BlendFactor dst_color_blend_factor = Anvil::BlendFactor::UNKNOWN; + Anvil::BlendFactor src_alpha_blend_factor = Anvil::BlendFactor::UNKNOWN; + Anvil::BlendFactor src_color_blend_factor = Anvil::BlendFactor::UNKNOWN; + + if (!in_current_renderpass_ptr->get_render_pass_create_info()->get_subpass_attachment_properties(in_subpass_id, + Anvil::AttachmentType::COLOR, + n_subpass_color_attachment, + &rp_attachment_id, + &dummy) || /* out_layout_ptr */ + !in_gfx_pipeline_create_info_ptr->get_color_blend_attachment_properties (rp_attachment_id, + &is_blending_enabled_for_attachment, + &color_blend_op, + &alpha_blend_op, + &src_color_blend_factor, + &dst_color_blend_factor, + &src_alpha_blend_factor, + &dst_alpha_blend_factor, + &color_component_flags) ) + { + /* The user has not defined blending properties for current color attachment. Use default state values .. */ + blend_state_ptr->blendEnable = VK_FALSE; + blend_state_ptr->alphaBlendOp = VK_BLEND_OP_ADD; + blend_state_ptr->colorBlendOp = VK_BLEND_OP_ADD; + blend_state_ptr->colorWriteMask = VK_COLOR_COMPONENT_A_BIT | + VK_COLOR_COMPONENT_B_BIT | + VK_COLOR_COMPONENT_G_BIT | + VK_COLOR_COMPONENT_R_BIT; + blend_state_ptr->dstAlphaBlendFactor = VK_BLEND_FACTOR_ONE; + blend_state_ptr->dstColorBlendFactor = VK_BLEND_FACTOR_ONE; + blend_state_ptr->srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE; + blend_state_ptr->srcColorBlendFactor = VK_BLEND_FACTOR_ONE; + } + else + { + blend_state_ptr->alphaBlendOp = static_cast(alpha_blend_op); + blend_state_ptr->blendEnable = (is_blending_enabled_for_attachment) ? VK_TRUE : VK_FALSE; + blend_state_ptr->colorBlendOp = static_cast (color_blend_op); + blend_state_ptr->colorWriteMask = color_component_flags.get_vk(); + blend_state_ptr->dstAlphaBlendFactor = static_cast(dst_alpha_blend_factor); + blend_state_ptr->dstColorBlendFactor = static_cast(dst_color_blend_factor); + blend_state_ptr->srcAlphaBlendFactor = static_cast(src_alpha_blend_factor); + blend_state_ptr->srcColorBlendFactor = static_cast(src_color_blend_factor); + } + } + + color_blend_state_create_info_chainer.store_helper_structure_vector(color_blend_attachment_state_vec, + color_blend_state_create_info_struct_id, + offsetof(VkPipelineColorBlendStateCreateInfo, pAttachments) ); + } + + result_chain_ptr = color_blend_state_create_info_chainer.create_chain(); + } + + return result_chain_ptr; +} + +/* Please see header for specification */ +Anvil::StructChainUniquePtr Anvil::GraphicsPipelineManager::bake_pipeline_depth_stencil_state_create_info(const Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr, + const Anvil::RenderPass* in_current_renderpass_ptr) const +{ + VkPipelineDepthStencilStateCreateInfo depth_stencil_state_create_info; + auto depth_test_compare_op = Anvil::CompareOp::UNKNOWN; + bool is_depth_bounds_test_enabled = false; + bool is_depth_test_enabled = false; + bool is_stencil_test_enabled = false; + float max_depth_bounds = std::numeric_limits::max(); + float min_depth_bounds = std::numeric_limits::max(); + uint32_t n_depth_stencil_attachments = 0; + Anvil::StructChainUniquePtr result_ptr; + + in_gfx_pipeline_create_info_ptr->get_depth_bounds_state(&is_depth_bounds_test_enabled, + &min_depth_bounds, + &max_depth_bounds); + + in_gfx_pipeline_create_info_ptr->get_depth_test_state(&is_depth_test_enabled, + &depth_test_compare_op); + + { + Anvil::CompareOp back_compare_op = Anvil::CompareOp::UNKNOWN; + Anvil::StencilOp back_depth_fail_op = Anvil::StencilOp::UNKNOWN; + Anvil::StencilOp back_fail_op = Anvil::StencilOp::UNKNOWN; + Anvil::StencilOp back_pass_op = Anvil::StencilOp::UNKNOWN; + Anvil::CompareOp front_compare_op = Anvil::CompareOp::UNKNOWN; + Anvil::StencilOp front_depth_fail_op = Anvil::StencilOp::UNKNOWN; + Anvil::StencilOp front_fail_op = Anvil::StencilOp::UNKNOWN; + Anvil::StencilOp front_pass_op = Anvil::StencilOp::UNKNOWN; + + in_gfx_pipeline_create_info_ptr->get_stencil_test_properties(&is_stencil_test_enabled, + &front_fail_op, + &front_pass_op, + &front_depth_fail_op, + &front_compare_op, + &depth_stencil_state_create_info.front.compareMask, + &depth_stencil_state_create_info.front.writeMask, + &depth_stencil_state_create_info.front.reference, + &back_fail_op, + &back_pass_op, + &back_depth_fail_op, + &back_compare_op, + &depth_stencil_state_create_info.back.compareMask, + &depth_stencil_state_create_info.back.writeMask, + &depth_stencil_state_create_info.back.reference); + + depth_stencil_state_create_info.back.compareOp = static_cast(back_compare_op); + depth_stencil_state_create_info.back.depthFailOp = static_cast(back_depth_fail_op); + depth_stencil_state_create_info.back.failOp = static_cast(back_fail_op); + depth_stencil_state_create_info.back.passOp = static_cast(back_pass_op); + depth_stencil_state_create_info.front.compareOp = static_cast(front_compare_op); + depth_stencil_state_create_info.front.depthFailOp = static_cast(front_depth_fail_op); + depth_stencil_state_create_info.front.failOp = static_cast(front_fail_op); + depth_stencil_state_create_info.front.passOp = static_cast(front_pass_op); + } + + in_current_renderpass_ptr->get_render_pass_create_info()->get_subpass_n_attachments(in_gfx_pipeline_create_info_ptr->get_subpass_id(), + Anvil::AttachmentType::DEPTH_STENCIL, + &n_depth_stencil_attachments); + + if (n_depth_stencil_attachments) + { + Anvil::StructChainer depth_stencil_state_create_info_chainer; + + depth_stencil_state_create_info.depthBoundsTestEnable = is_depth_bounds_test_enabled ? VK_TRUE : VK_FALSE; + depth_stencil_state_create_info.depthCompareOp = static_cast(depth_test_compare_op); + depth_stencil_state_create_info.depthTestEnable = is_depth_test_enabled ? VK_TRUE : VK_FALSE; + depth_stencil_state_create_info.depthWriteEnable = in_gfx_pipeline_create_info_ptr->are_depth_writes_enabled() ? VK_TRUE : VK_FALSE; + depth_stencil_state_create_info.flags = 0; + depth_stencil_state_create_info.maxDepthBounds = max_depth_bounds; + depth_stencil_state_create_info.minDepthBounds = min_depth_bounds; + depth_stencil_state_create_info.pNext = nullptr; + depth_stencil_state_create_info.stencilTestEnable = is_stencil_test_enabled ? VK_TRUE : VK_FALSE; + depth_stencil_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO; + + depth_stencil_state_create_info_chainer.append_struct(depth_stencil_state_create_info); + + result_ptr = depth_stencil_state_create_info_chainer.create_chain(); + } + else + { + /* No depth/stencil attachment available. Make sure none of the dependent modes are enabled. */ + anvil_assert(!is_depth_bounds_test_enabled); + anvil_assert(!is_depth_test_enabled); + anvil_assert(!in_gfx_pipeline_create_info_ptr->are_depth_writes_enabled()); + anvil_assert(!is_stencil_test_enabled); + } + + return result_ptr; +} + +/* Please see header for specification */ +Anvil::StructChainUniquePtr Anvil::GraphicsPipelineManager::bake_pipeline_dynamic_state_create_info(const Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr) const +{ + const Anvil::DynamicState* enabled_dynamic_states_ptr = nullptr; + uint32_t n_enabled_dynamic_states = 0; + Anvil::StructChainUniquePtr result_ptr; + + in_gfx_pipeline_create_info_ptr->get_enabled_dynamic_states(&enabled_dynamic_states_ptr, + &n_enabled_dynamic_states); + + if (n_enabled_dynamic_states != 0) + { + Anvil::StructChainer dynamic_state_create_info_chainer; + VkPipelineDynamicStateCreateInfo dynamic_state_create_info; + + dynamic_state_create_info.dynamicStateCount = n_enabled_dynamic_states; + dynamic_state_create_info.flags = 0; + dynamic_state_create_info.pDynamicStates = (dynamic_state_create_info.dynamicStateCount > 0) ? reinterpret_cast(enabled_dynamic_states_ptr) + : VK_NULL_HANDLE; + dynamic_state_create_info.pNext = nullptr; + dynamic_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO; + + dynamic_state_create_info_chainer.append_struct(dynamic_state_create_info); + + result_ptr = dynamic_state_create_info_chainer.create_chain(); + } + + return result_ptr; +} + +/* Please see header for specification */ +Anvil::StructChainUniquePtr Anvil::GraphicsPipelineManager::bake_pipeline_input_assembly_state_create_info(const Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr) const +{ + Anvil::StructChainer input_assembly_state_create_info_chainer; + VkPipelineInputAssemblyStateCreateInfo input_assembly_state_create_info; + + input_assembly_state_create_info.flags = 0; + input_assembly_state_create_info.pNext = nullptr; + input_assembly_state_create_info.primitiveRestartEnable = in_gfx_pipeline_create_info_ptr->is_primitive_restart_enabled() ? VK_TRUE : VK_FALSE; + input_assembly_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO; + input_assembly_state_create_info.topology = static_cast(in_gfx_pipeline_create_info_ptr->get_primitive_topology() ); + + input_assembly_state_create_info_chainer.append_struct(input_assembly_state_create_info); + + return input_assembly_state_create_info_chainer.create_chain(); +} + +/* Please see header for specification */ +Anvil::StructChainUniquePtr Anvil::GraphicsPipelineManager::bake_pipeline_multisample_state_create_info(const Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr) const +{ + bool is_sample_shading_enabled = false; + float min_sample_shading = std::numeric_limits::max(); + Anvil::StructChainUniquePtr result_ptr; + + in_gfx_pipeline_create_info_ptr->get_sample_shading_state(&is_sample_shading_enabled, + &min_sample_shading); + + if (!in_gfx_pipeline_create_info_ptr->is_rasterizer_discard_enabled() ) + { + bool are_custom_sample_locations_enabled = false; + VkExtent2D custom_sample_location_grid_size = {0, 0}; + Anvil::SampleCountFlagBits custom_sample_locations_per_pixel = Anvil::SampleCountFlagBits::NONE; + const Anvil::SampleLocation* custom_sample_locations_ptr = nullptr; + Anvil::StructChainer chainer; + const bool is_sample_mask_enabled = in_gfx_pipeline_create_info_ptr->is_sample_mask_enabled(); + uint32_t n_custom_sample_locations = 0; + + Anvil::SampleCountFlagBits sample_count = static_cast(0); + VkSampleMask sample_mask; + + in_gfx_pipeline_create_info_ptr->get_multisampling_properties(&sample_count, + &sample_mask); + in_gfx_pipeline_create_info_ptr->get_sample_location_state (&are_custom_sample_locations_enabled, + &custom_sample_locations_per_pixel, + &custom_sample_location_grid_size, + &n_custom_sample_locations, + &custom_sample_locations_ptr); + + /* If sample mask is not enabled, Vulkan spec will assume all samples need to pass. This is what the default sample mask value mimics. + * + * Hence, if the application specified a non-~0u sample mask and has NOT enabled the sample mask using toggle_sample_mask(), it's (in + * all likelihood) a trivial app-side issue. + */ + anvil_assert((!is_sample_mask_enabled && sample_mask == ~0u) || + is_sample_mask_enabled); + + { + VkPipelineMultisampleStateCreateInfo multisample_state_create_info; + + multisample_state_create_info.alphaToCoverageEnable = in_gfx_pipeline_create_info_ptr->is_alpha_to_coverage_enabled() ? VK_TRUE : VK_FALSE; + multisample_state_create_info.alphaToOneEnable = in_gfx_pipeline_create_info_ptr->is_alpha_to_one_enabled() ? VK_TRUE : VK_FALSE; + multisample_state_create_info.flags = 0; + multisample_state_create_info.minSampleShading = min_sample_shading; + multisample_state_create_info.pNext = nullptr; + multisample_state_create_info.pSampleMask = (is_sample_mask_enabled) ? &sample_mask : nullptr; + multisample_state_create_info.rasterizationSamples = static_cast(sample_count); + multisample_state_create_info.sampleShadingEnable = is_sample_shading_enabled ? VK_TRUE : VK_FALSE; + multisample_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO; + + chainer.append_struct(multisample_state_create_info); + } + + if (are_custom_sample_locations_enabled) + { + VkPipelineSampleLocationsStateCreateInfoEXT psl_state_create_info; + VkSampleLocationsInfoEXT sample_locations_info; + + sample_locations_info.pNext = nullptr; + sample_locations_info.pSampleLocations = reinterpret_cast(custom_sample_locations_ptr); + sample_locations_info.sampleLocationGridSize = custom_sample_location_grid_size; + sample_locations_info.sampleLocationsCount = n_custom_sample_locations; + sample_locations_info.sampleLocationsPerPixel = static_cast(custom_sample_locations_per_pixel); + sample_locations_info.sType = VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT; + + psl_state_create_info.pNext = nullptr; + psl_state_create_info.sampleLocationsEnable = VK_TRUE; + psl_state_create_info.sampleLocationsInfo = sample_locations_info; + psl_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT; + + anvil_assert(m_device_ptr->get_extension_info()->ext_sample_locations() ); + + chainer.append_struct(psl_state_create_info); + } + + result_ptr = chainer.create_chain(); + } + else + { + /* Make sure any dependent modes are disabled */ + anvil_assert(!in_gfx_pipeline_create_info_ptr->is_alpha_to_coverage_enabled() ); + anvil_assert(!in_gfx_pipeline_create_info_ptr->is_alpha_to_one_enabled () ); + anvil_assert(!is_sample_shading_enabled); + } + + return result_ptr; +} + +Anvil::StructChainUniquePtr Anvil::GraphicsPipelineManager::bake_pipeline_rasterization_state_create_info(const Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr) const +{ + Anvil::CullModeFlags cull_mode = Anvil::CullModeFlagBits::NONE; + float depth_bias_clamp = std::numeric_limits::max(); + float depth_bias_constant_factor = std::numeric_limits::max(); + float depth_bias_slope_factor = std::numeric_limits::max(); + Anvil::FrontFace front_face = Anvil::FrontFace::UNKNOWN; + bool is_depth_bias_enabled = false; + float line_width = std::numeric_limits::max(); + Anvil::PolygonMode polygon_mode = Anvil::PolygonMode::UNKNOWN; + Anvil::StructChainer raster_state_create_info_chainer; + + static const VkPipelineRasterizationStateRasterizationOrderAMD relaxed_rasterization_order_item = + { + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD, + nullptr, + VK_RASTERIZATION_ORDER_RELAXED_AMD + }; + static const VkPipelineRasterizationStateRasterizationOrderAMD strict_rasterization_order_item = + { + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD, + nullptr, + VK_RASTERIZATION_ORDER_STRICT_AMD + }; + + + in_gfx_pipeline_create_info_ptr->get_depth_bias_state (&is_depth_bias_enabled, + &depth_bias_constant_factor, + &depth_bias_clamp, + &depth_bias_slope_factor); + in_gfx_pipeline_create_info_ptr->get_rasterization_properties(&polygon_mode, + &cull_mode, + &front_face, + &line_width); + + { + VkPipelineRasterizationStateCreateInfo raster_state_create_info; + + raster_state_create_info.cullMode = cull_mode.get_vk(); + raster_state_create_info.depthBiasClamp = depth_bias_clamp; + raster_state_create_info.depthBiasConstantFactor = depth_bias_constant_factor; + raster_state_create_info.depthBiasEnable = is_depth_bias_enabled ? VK_TRUE : VK_FALSE; + raster_state_create_info.depthBiasSlopeFactor = depth_bias_slope_factor; + raster_state_create_info.depthClampEnable = in_gfx_pipeline_create_info_ptr->is_depth_clamp_enabled() ? VK_TRUE : VK_FALSE; + raster_state_create_info.flags = 0; + raster_state_create_info.frontFace = static_cast(front_face); + raster_state_create_info.lineWidth = line_width; + raster_state_create_info.pNext = nullptr; + raster_state_create_info.polygonMode = static_cast(polygon_mode); + raster_state_create_info.rasterizerDiscardEnable = in_gfx_pipeline_create_info_ptr->is_rasterizer_discard_enabled() ? VK_TRUE : VK_FALSE; + raster_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO; + + raster_state_create_info_chainer.append_struct(raster_state_create_info); + } + + if (m_device_ptr->is_extension_enabled(VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME) ) + { + /* Chain a predefined struct which will toggle the relaxed rasterization, as long as the device supports the + * VK_AMD_rasterization_order extension. + */ + if (in_gfx_pipeline_create_info_ptr->get_rasterization_order() != Anvil::RasterizationOrderAMD::STRICT) + { + anvil_assert(in_gfx_pipeline_create_info_ptr->get_rasterization_order() == static_cast(relaxed_rasterization_order_item.rasterizationOrder) ); + + raster_state_create_info_chainer.append_struct(relaxed_rasterization_order_item); + } + else + { + raster_state_create_info_chainer.append_struct(strict_rasterization_order_item); + } + } + else + if (in_gfx_pipeline_create_info_ptr->get_rasterization_order() != Anvil::RasterizationOrderAMD::STRICT) + { + anvil_assert(in_gfx_pipeline_create_info_ptr->get_rasterization_order() == Anvil::RasterizationOrderAMD::STRICT); + } + + return raster_state_create_info_chainer.create_chain(); +} + +/* Please see header for specification */ +std::unique_ptr > Anvil::GraphicsPipelineManager::bake_pipeline_shader_stage_create_info_chain_vector(const Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr) const +{ + static const Anvil::ShaderStage graphics_shader_stages[] = + { + Anvil::ShaderStage::FRAGMENT, + Anvil::ShaderStage::GEOMETRY, + Anvil::ShaderStage::TESSELLATION_CONTROL, + Anvil::ShaderStage::TESSELLATION_EVALUATION, + Anvil::ShaderStage::VERTEX + }; + + std::unique_ptr > shader_stage_create_info_chainer_ptr(new Anvil::StructChainVector() ); + + + for (const auto& current_graphics_shader_stage : graphics_shader_stages) + { + const Anvil::ShaderModuleStageEntryPoint* shader_stage_entry_point_ptr = nullptr; + + in_gfx_pipeline_create_info_ptr->get_shader_stage_properties(current_graphics_shader_stage, + &shader_stage_entry_point_ptr); + + if (shader_stage_entry_point_ptr != nullptr) + { + const unsigned char* current_shader_stage_specialization_constants_data_buffer_ptr = nullptr; + const SpecializationConstants* current_shader_stage_specialization_constants_ptr = nullptr; + Anvil::ShaderModule* shader_module_ptr = shader_stage_entry_point_ptr->shader_module_ptr; + + in_gfx_pipeline_create_info_ptr->get_specialization_constants(current_graphics_shader_stage, + ¤t_shader_stage_specialization_constants_ptr, + ¤t_shader_stage_specialization_constants_data_buffer_ptr); + + { + Anvil::StructID root_struct_id; + Anvil::StructChainer shader_stage_create_info_chainer; + + { + VkPipelineShaderStageCreateInfo shader_stage_create_info; + + shader_stage_create_info.module = shader_module_ptr->get_module(); + shader_stage_create_info.pName = (shader_stage_entry_point_ptr->stage == Anvil::ShaderStage::FRAGMENT) ? shader_module_ptr->get_fs_entrypoint_name().c_str() + : (shader_stage_entry_point_ptr->stage == Anvil::ShaderStage::GEOMETRY) ? shader_module_ptr->get_gs_entrypoint_name().c_str() + : (shader_stage_entry_point_ptr->stage == Anvil::ShaderStage::TESSELLATION_CONTROL) ? shader_module_ptr->get_tc_entrypoint_name().c_str() + : (shader_stage_entry_point_ptr->stage == Anvil::ShaderStage::TESSELLATION_EVALUATION) ? shader_module_ptr->get_te_entrypoint_name().c_str() + : (shader_stage_entry_point_ptr->stage == Anvil::ShaderStage::VERTEX) ? shader_module_ptr->get_vs_entrypoint_name().c_str() + : nullptr; + + shader_stage_create_info.flags = 0; + shader_stage_create_info.pNext = nullptr; + shader_stage_create_info.pSpecializationInfo = nullptr; /* patched by the chainer below */ + shader_stage_create_info.stage = static_cast(Anvil::Utils::get_shader_stage_flag_bits_from_shader_stage(shader_stage_entry_point_ptr->stage) ); + shader_stage_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; + + root_struct_id = shader_stage_create_info_chainer.append_struct(shader_stage_create_info); + } + + if (current_shader_stage_specialization_constants_ptr->size() > 0) + { + VkSpecializationInfo specialization_info; + std::vector specialization_map_entries; + + if (current_shader_stage_specialization_constants_ptr->size() > 0) + { + bake_specialization_info_vk(*current_shader_stage_specialization_constants_ptr, + current_shader_stage_specialization_constants_data_buffer_ptr, + &specialization_map_entries, + &specialization_info); + } + + shader_stage_create_info_chainer.store_helper_structure (specialization_info, + root_struct_id, + offsetof(VkPipelineShaderStageCreateInfo, pSpecializationInfo) ); + shader_stage_create_info_chainer.store_helper_structure_vector(specialization_map_entries, + root_struct_id, + offsetof(VkSpecializationInfo, pMapEntries) ); + } + + shader_stage_create_info_chainer_ptr->append_struct_chain(shader_stage_create_info_chainer.create_chain() ); + } + } + } + + return shader_stage_create_info_chainer_ptr; +} + +/* Please see header for specification */ +Anvil::StructChainUniquePtr Anvil::GraphicsPipelineManager::bake_pipeline_tessellation_state_create_info(const Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr) const +{ + Anvil::StructChainUniquePtr result_ptr; + const Anvil::ShaderModuleStageEntryPoint* tc_shader_stage_entry_point_ptr = nullptr; + const Anvil::ShaderModuleStageEntryPoint* te_shader_stage_entry_point_ptr = nullptr; + + in_gfx_pipeline_create_info_ptr->get_shader_stage_properties(Anvil::ShaderStage::TESSELLATION_CONTROL, + &tc_shader_stage_entry_point_ptr); + in_gfx_pipeline_create_info_ptr->get_shader_stage_properties(Anvil::ShaderStage::TESSELLATION_EVALUATION, + &te_shader_stage_entry_point_ptr); + + if (tc_shader_stage_entry_point_ptr != nullptr && + te_shader_stage_entry_point_ptr != nullptr) + { + Anvil::StructChainer tessellation_state_create_info_chainer; + + { + VkPipelineTessellationStateCreateInfo tessellation_state_create_info; + + tessellation_state_create_info.flags = 0; + tessellation_state_create_info.patchControlPoints = in_gfx_pipeline_create_info_ptr->get_n_patch_control_points(); + tessellation_state_create_info.pNext = nullptr; + tessellation_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO; + + tessellation_state_create_info_chainer.append_struct(tessellation_state_create_info); + } + + if (m_device_ptr->is_extension_enabled(VK_KHR_MAINTENANCE2_EXTENSION_NAME) ) + { + VkPipelineTessellationDomainOriginStateCreateInfoKHR domain_origin_state_create_info; + + domain_origin_state_create_info.domainOrigin = static_cast(in_gfx_pipeline_create_info_ptr->get_tessellation_domain_origin() ); + domain_origin_state_create_info.pNext = nullptr; + domain_origin_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO_KHR; + + tessellation_state_create_info_chainer.append_struct(domain_origin_state_create_info); + } + else + { + /* App wants to adjust the default tessellation domain origin value, even though KHR_maintenance2 is unsupported! */ + anvil_assert(in_gfx_pipeline_create_info_ptr->get_tessellation_domain_origin() == Anvil::TessellationDomainOrigin::UPPER_LEFT); + } + + result_ptr = tessellation_state_create_info_chainer.create_chain(); + } + + return result_ptr; +} + +/* Please see header for specification */ +Anvil::StructChainUniquePtr Anvil::GraphicsPipelineManager::bake_pipeline_vertex_input_state_create_info(const Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr) const +{ + GraphicsPipelineData current_pipeline_gfx_data (in_gfx_pipeline_create_info_ptr); + Anvil::StructChainer vertex_input_state_create_info_chainer; + + { + VkPipelineVertexInputStateCreateInfo create_info; + Anvil::StructID root_struct_id; + + create_info.vertexAttributeDescriptionCount = static_cast(current_pipeline_gfx_data.vk_input_attributes.size()); + create_info.vertexBindingDescriptionCount = static_cast(current_pipeline_gfx_data.vk_input_bindings.size ()); + + create_info.flags = 0; + create_info.pNext = nullptr; + create_info.pVertexAttributeDescriptions = nullptr; /* will be patched by the chainer */ + create_info.pVertexBindingDescriptions = nullptr; /* will be patched by the chainer */ + create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO; + + root_struct_id = vertex_input_state_create_info_chainer.append_struct(create_info); + + if (create_info.vertexAttributeDescriptionCount > 0) + { + vertex_input_state_create_info_chainer.store_helper_structure_vector(current_pipeline_gfx_data.vk_input_attributes, + root_struct_id, + offsetof(VkPipelineVertexInputStateCreateInfo, pVertexAttributeDescriptions) ); + } + + if (create_info.vertexBindingDescriptionCount > 0) + { + vertex_input_state_create_info_chainer.store_helper_structure_vector(current_pipeline_gfx_data.vk_input_bindings, + root_struct_id, + offsetof(VkPipelineVertexInputStateCreateInfo, pVertexBindingDescriptions) ); + } + } + + if (current_pipeline_gfx_data.input_bindings.size() > 0) + { + std::vector divisor_descriptors; + + divisor_descriptors.reserve(current_pipeline_gfx_data.input_bindings.size() ); + + for (const auto& current_binding_info : current_pipeline_gfx_data.input_bindings) + { + /* Make sure to chain VkVertexInputBindingDivisorDescriptionEXT for each binding which uses a non-default divisor value */ + if (current_binding_info.divisor != 1) + { + VkVertexInputBindingDivisorDescriptionEXT divisor_info; + + divisor_info.binding = current_binding_info.binding; + divisor_info.divisor = current_binding_info.divisor; + + divisor_descriptors.push_back(divisor_info); + } + } + + if (divisor_descriptors.size() != 0) + { + VkPipelineVertexInputDivisorStateCreateInfoEXT divisor_state_create_info; + Anvil::StructID divisor_state_struct_id; + + divisor_state_create_info.pNext = nullptr; + divisor_state_create_info.pVertexBindingDivisors = nullptr; /* NOTE: This field is going to be patched by vertex_input_state_create_info_chainer ! */ + divisor_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT; + divisor_state_create_info.vertexBindingDivisorCount = static_cast(divisor_descriptors.size() ); + + divisor_state_struct_id = vertex_input_state_create_info_chainer.append_struct(divisor_state_create_info); + + vertex_input_state_create_info_chainer.store_helper_structure_vector(divisor_descriptors, + divisor_state_struct_id, + offsetof(VkPipelineVertexInputDivisorStateCreateInfoEXT, pVertexBindingDivisors) ); + } + } + + return vertex_input_state_create_info_chainer.create_chain(); +} + +/* Please see header for specification */ +Anvil::StructChainUniquePtr Anvil::GraphicsPipelineManager::bake_pipeline_viewport_state_create_info(Anvil::GraphicsPipelineCreateInfo* in_gfx_pipeline_create_info_ptr, + const bool& in_is_dynamic_scissor_state_enabled, + const bool& in_is_dynamic_viewport_state_enabled) const +{ + Anvil::StructChainUniquePtr result_ptr; + + if (!in_gfx_pipeline_create_info_ptr->is_rasterizer_discard_enabled() ) + { + uint32_t n_scissor_boxes = (in_is_dynamic_scissor_state_enabled) ? in_gfx_pipeline_create_info_ptr->get_n_dynamic_scissor_boxes() + : in_gfx_pipeline_create_info_ptr->get_n_scissor_boxes (); + uint32_t n_viewports = (in_is_dynamic_viewport_state_enabled) ? in_gfx_pipeline_create_info_ptr->get_n_dynamic_viewports () + : in_gfx_pipeline_create_info_ptr->get_n_viewports (); + std::vector scissor_boxes; + std::vector viewports; + + anvil_assert(n_scissor_boxes == n_viewports); + + if (n_scissor_boxes == 0) + { + /* No scissor boxes / viewport defined. Use default settings.. */ + auto swapchain_ptr = in_gfx_pipeline_create_info_ptr->get_renderpass()->get_swapchain(); + uint32_t window_size[2] = {0}; + + /* NOTE: If you hit this assertion, you either need to pass a Swapchain instance when this renderpass is being created, + * *or* specify scissor & viewport information for the GFX pipeline. + */ + anvil_assert(swapchain_ptr != nullptr); + anvil_assert(n_viewports == 0); + + swapchain_ptr->get_image(0)->get_image_mipmap_size(0, /* n_mipmap */ + window_size + 0, + window_size + 1, + nullptr); /* out_opt_depth_ptr */ + + anvil_assert(window_size[0] != 0 && + window_size[1] != 0); + + in_gfx_pipeline_create_info_ptr->set_scissor_box_properties(0, /* in_n_scissor_box */ + 0, /* in_x */ + 0, /* in_y */ + window_size[0], + window_size[1]); + in_gfx_pipeline_create_info_ptr->set_viewport_properties (0, /* in_n_viewport */ + 0.0f, /* in_origin_x */ + 0.0f, /* in_origin_y */ + static_cast(window_size[0]), + static_cast(window_size[1]), + 0.0f, /* in_min_depth */ + 1.0f); /* in_max_depth */ + + n_scissor_boxes = 1; + n_viewports = 1; + } + + /* Convert internal scissor box & viewport representations to Vulkan descriptors */ + if (!in_is_dynamic_scissor_state_enabled) + { + for (uint32_t n_scissor_box = 0; + n_scissor_box < n_scissor_boxes; + ++n_scissor_box) + { + uint32_t current_scissor_box_height = UINT32_MAX; + uint32_t current_scissor_box_width = UINT32_MAX; + int32_t current_scissor_box_x = INT32_MAX; + int32_t current_scissor_box_y = INT32_MAX; + VkRect2D current_scissor_box_vk; + + in_gfx_pipeline_create_info_ptr->get_scissor_box_properties(n_scissor_box, + ¤t_scissor_box_x, + ¤t_scissor_box_y, + ¤t_scissor_box_width, + ¤t_scissor_box_height); + current_scissor_box_vk.extent.height = current_scissor_box_height; + current_scissor_box_vk.extent.width = current_scissor_box_width; + current_scissor_box_vk.offset.x = current_scissor_box_x; + current_scissor_box_vk.offset.y = current_scissor_box_y; + + scissor_boxes.push_back(current_scissor_box_vk); + } + } + + if (!in_is_dynamic_viewport_state_enabled) + { + for (uint32_t n_viewport = 0; + n_viewport < n_viewports; + ++n_viewport) + { + float current_viewport_height = std::numeric_limits::max(); + float current_viewport_max_depth = std::numeric_limits::max(); + float current_viewport_min_depth = std::numeric_limits::max(); + float current_viewport_origin_x = std::numeric_limits::max(); + float current_viewport_origin_y = std::numeric_limits::max(); + float current_viewport_width = std::numeric_limits::max(); + VkViewport current_viewport_vk; + + in_gfx_pipeline_create_info_ptr->get_viewport_properties(n_viewport, + ¤t_viewport_origin_x, + ¤t_viewport_origin_y, + ¤t_viewport_width, + ¤t_viewport_height, + ¤t_viewport_min_depth, + ¤t_viewport_max_depth); + + current_viewport_vk.height = current_viewport_height; + current_viewport_vk.maxDepth = current_viewport_max_depth; + current_viewport_vk.minDepth = current_viewport_min_depth; + current_viewport_vk.x = current_viewport_origin_x; + current_viewport_vk.y = current_viewport_origin_y; + current_viewport_vk.width = current_viewport_width; + + viewports.push_back(current_viewport_vk); + } + } + + /* Bake the descriptor */ + { + Anvil::StructID root_struct_id; + Anvil::StructChainer viewport_state_create_info_chainer; + + { + VkPipelineViewportStateCreateInfo viewport_state_create_info; + + viewport_state_create_info.flags = 0; + viewport_state_create_info.pNext = nullptr; /* will be patched by the chainer below */ + viewport_state_create_info.pScissors = nullptr; /* will be patched by the chainer below */ + viewport_state_create_info.pViewports = nullptr; /* will be patched by the chainer below */ + viewport_state_create_info.scissorCount = n_scissor_boxes; + viewport_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO; + viewport_state_create_info.viewportCount = n_viewports; + + anvil_assert(viewport_state_create_info.scissorCount == viewport_state_create_info.viewportCount); + anvil_assert(viewport_state_create_info.scissorCount != 0); + + root_struct_id = viewport_state_create_info_chainer.append_struct(viewport_state_create_info); + } + + if (!in_is_dynamic_scissor_state_enabled) + { + viewport_state_create_info_chainer.store_helper_structure_vector(scissor_boxes, + root_struct_id, + offsetof(VkPipelineViewportStateCreateInfo, pScissors) ); + } + + if (!in_is_dynamic_viewport_state_enabled) + { + viewport_state_create_info_chainer.store_helper_structure_vector(viewports, + root_struct_id, + offsetof(VkPipelineViewportStateCreateInfo, pViewports) ); + } + + result_ptr = viewport_state_create_info_chainer.create_chain(); + anvil_assert(result_ptr != nullptr); + } + } + + return result_ptr; +} + /* Please see header for specification */ bool Anvil::GraphicsPipelineManager::delete_pipeline(PipelineID in_pipeline_id) { @@ -1142,18 +1329,12 @@ bool Anvil::GraphicsPipelineManager::delete_pipeline(PipelineID in_pipeline_id) if (result) { - auto baked_pipelines_iterator = m_baked_pipelines.find (in_pipeline_id); - auto pipeline_id_to_gfx_pipeline_data_iterator = m_pipeline_id_to_gfx_pipeline_data.find(in_pipeline_id); + auto baked_pipelines_iterator = m_baked_pipelines.find(in_pipeline_id); if (baked_pipelines_iterator != m_baked_pipelines.end() ) { m_baked_pipelines.erase(baked_pipelines_iterator); } - - if (pipeline_id_to_gfx_pipeline_data_iterator != m_pipeline_id_to_gfx_pipeline_data.end() ) - { - m_pipeline_id_to_gfx_pipeline_data.erase(pipeline_id_to_gfx_pipeline_data_iterator); - } } } unlock(); diff --git a/src/wrappers/image.cpp b/src/wrappers/image.cpp index 7eafb8b1..c492bff2 100644 --- a/src/wrappers/image.cpp +++ b/src/wrappers/image.cpp @@ -172,10 +172,9 @@ Anvil::ImageUniquePtr Anvil::Image::create(Anvil::ImageCreateInfoUniquePtr in_cr switch (image_type) { - case Anvil::ImageInternalType::NONSPARSE_ALLOC: - case Anvil::ImageInternalType::NONSPARSE_NO_ALLOC: - case Anvil::ImageInternalType::NONSPARSE_PEER_NO_ALLOC: - case Anvil::ImageInternalType::SPARSE_NO_ALLOC: + case Anvil::ImageInternalType::ALLOC: + case Anvil::ImageInternalType::NO_ALLOC: + case Anvil::ImageInternalType::PEER_NO_ALLOC: { if (!result_ptr->init() ) { @@ -212,7 +211,7 @@ Anvil::ImageUniquePtr Anvil::Image::create(Anvil::ImageCreateInfoUniquePtr in_cr } } - if (image_type == Anvil::ImageInternalType::NONSPARSE_PEER_NO_ALLOC) + if (image_type == Anvil::ImageInternalType::PEER_NO_ALLOC) { const auto& physical_devices = result_ptr->m_create_info_ptr->get_physical_devices(); const auto n_physical_devices = static_cast(physical_devices.size() ); @@ -290,7 +289,8 @@ bool Anvil::Image::do_sanity_checks_for_sfr_binding(uint32_t in_n_SFR_rec const Anvil::SparseImageFormatProperties* sparse_image_format_props_ptr(nullptr); std::vector sparse_image_format_props_vec; - anvil_assert(m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SPARSE_NO_ALLOC); + anvil_assert( m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::NO_ALLOC && + (m_create_info_ptr->get_create_flags () & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) == 0); anvil_assert(m_mipmaps.size () > 0); anvil_assert(m_memory_blocks_owned.size () == 0); @@ -398,7 +398,7 @@ bool Anvil::Image::get_aspect_subresource_layout(Anvil::ImageAspectFlagBits in_a Anvil::MemoryBlock* Anvil::Image::get_memory_block() { bool is_callback_needed = false; - const auto is_sparse = (m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::SPARSE_NO_ALLOC); + const auto is_sparse = (m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) != 0; if (is_sparse) { @@ -425,7 +425,7 @@ Anvil::MemoryBlock* Anvil::Image::get_memory_block() if (is_sparse) { - if (m_create_info_ptr->get_residency_scope() == Anvil::SparseResidencyScope::NONE) + if ((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) == 0) { anvil_assert(m_page_tracker_ptr != nullptr); @@ -451,7 +451,6 @@ Anvil::MemoryBlock* Anvil::Image::get_memory_block() bool Anvil::Image::init() { std::vector aspects_used; - Anvil::ImageCreateFlags image_flags = m_create_info_ptr->get_create_flags(); Anvil::ImageFormatProperties image_format_props; const auto memory_features = m_create_info_ptr->get_memory_features(); uint32_t n_queue_family_indices = 0; @@ -549,22 +548,6 @@ bool Anvil::Image::init() anvil_assert(m_device_ptr->get_extension_info()->khr_bind_memory2() ); } - if (m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::SPARSE_NO_ALLOC) - { - /* Convert residency scope to Vulkan image create flags */ - switch (m_create_info_ptr->get_residency_scope() ) - { - case Anvil::SparseResidencyScope::ALIASED: image_flags |= static_cast(VK_IMAGE_CREATE_SPARSE_ALIASED_BIT | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | VK_IMAGE_CREATE_SPARSE_BINDING_BIT); break; - case Anvil::SparseResidencyScope::NONALIASED: image_flags |= static_cast( VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | VK_IMAGE_CREATE_SPARSE_BINDING_BIT); break; - case Anvil::SparseResidencyScope::NONE: image_flags |= static_cast( VK_IMAGE_CREATE_SPARSE_BINDING_BIT); break; - - default: - { - anvil_assert_fail(); - } - } - } - { const auto max_dimension = std::max(std::max(m_create_info_ptr->get_base_mip_depth(), m_create_info_ptr->get_base_mip_height() ), @@ -581,7 +564,7 @@ bool Anvil::Image::init() image_create_info.extent.depth = m_create_info_ptr->get_base_mip_depth (); image_create_info.extent.height = m_create_info_ptr->get_base_mip_height(); image_create_info.extent.width = m_create_info_ptr->get_base_mip_width (); - image_create_info.flags = image_flags.get_vk(); + image_create_info.flags = m_create_info_ptr->get_create_flags ().get_vk(); image_create_info.format = static_cast (m_create_info_ptr->get_format () ); image_create_info.imageType = static_cast (m_create_info_ptr->get_type () ); image_create_info.initialLayout = static_cast(m_create_info_ptr->get_post_create_image_layout() ); @@ -626,7 +609,7 @@ bool Anvil::Image::init() { VkImageFormatListCreateInfoKHR image_format_list_create_info; - anvil_assert((image_flags & Anvil::ImageCreateFlagBits::MUTABLE_FORMAT_BIT) != 0); + anvil_assert((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::MUTABLE_FORMAT_BIT) != 0); anvil_assert(m_device_ptr->get_extension_info()->khr_image_format_list() ); image_format_list_create_info.pNext = nullptr; @@ -751,8 +734,7 @@ bool Anvil::Image::init() /* Initialize mipmap props storage */ init_mipmap_props(); - if (m_create_info_ptr->get_residency_scope() == SparseResidencyScope::ALIASED || - m_create_info_ptr->get_residency_scope() == SparseResidencyScope::NONALIASED) + if ((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0) { uint32_t n_reqs = 0; std::vector sparse_image_memory_reqs; @@ -838,7 +820,7 @@ bool Anvil::Image::init() init_page_occupancy(sparse_image_memory_reqs); } else - if (m_create_info_ptr->get_residency_scope() == Anvil::SparseResidencyScope::NONE) + if ((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) != 0) { m_page_tracker_ptr.reset( new Anvil::PageTracker(m_storage_size, @@ -846,7 +828,7 @@ bool Anvil::Image::init() ); } - if (m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::NONSPARSE_ALLOC) + if (m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::ALLOC) { /* Allocate memory for the image */ Anvil::MemoryBlockUniquePtr memory_block_ptr; @@ -886,7 +868,7 @@ bool Anvil::Image::init() } /* If the image has been initialized for SFR bindings, calculate & cache SFR tile size */ - if ((image_flags & Anvil::ImageCreateFlagBits::SPLIT_INSTANCE_BIND_REGIONS_BIT) != 0) + if ((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPLIT_INSTANCE_BIND_REGIONS_BIT) != 0) { init_sfr_tile_size(); } @@ -901,8 +883,7 @@ bool Anvil::Image::init() **/ void Anvil::Image::init_page_occupancy(const std::vector& in_memory_reqs) { - anvil_assert(m_create_info_ptr->get_residency_scope() != Anvil::SparseResidencyScope::NONE && - m_create_info_ptr->get_residency_scope() != Anvil::SparseResidencyScope::UNKNOWN); + anvil_assert((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0); /* First, allocate space for an AspectPageOccupancyData instance for all aspects used by the image. * @@ -1151,7 +1132,7 @@ Anvil::Image::~Image() /* Please see header for specification */ const VkImage& Anvil::Image::get_image(const bool& in_bake_memory_if_necessary) { - if (m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SPARSE_NO_ALLOC) + if ((m_create_info_ptr->get_create_flags () & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) == 0) { if (m_memory_blocks_owned.size() == 0 && in_bake_memory_if_necessary) @@ -1274,16 +1255,16 @@ bool Anvil::Image::get_sparse_image_aspect_properties(const Anvil::ImageAspectFl decltype(m_sparse_aspect_props)::const_iterator prop_iterator; bool result = false; - if (m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SPARSE_NO_ALLOC) + if (m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::NO_ALLOC) { - anvil_assert(m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::SPARSE_NO_ALLOC); + anvil_assert(m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::NO_ALLOC); goto end; } - if (m_create_info_ptr->get_residency_scope() == Anvil::SparseResidencyScope::NONE) + if ((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) == 0) { - anvil_assert(m_create_info_ptr->get_residency_scope() != Anvil::SparseResidencyScope::NONE); + anvil_assert((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0); goto end; } @@ -1385,8 +1366,7 @@ bool Anvil::Image::has_aspects(const Anvil::ImageAspectFlags& in_aspects) const Anvil::ImageAspectFlags checked_aspects; bool result = true; - if (m_create_info_ptr->get_residency_scope() == SparseResidencyScope::ALIASED || - m_create_info_ptr->get_residency_scope() == SparseResidencyScope::NONALIASED) + if ((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0) { for (uint32_t n_bit = 0; n_bit < sizeof(uint32_t) * 8 /* bits in byte */ && result; @@ -1539,8 +1519,7 @@ bool Anvil::Image::is_memory_bound_for_texel(Anvil::ImageAspectFlagBits in_aspec bool result = false; /* Sanity checks */ - anvil_assert(m_create_info_ptr->get_residency_scope() == SparseResidencyScope::ALIASED || - m_create_info_ptr->get_residency_scope() == SparseResidencyScope::NONALIASED); + anvil_assert((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0); anvil_assert(m_create_info_ptr->get_n_layers () > in_n_layer); anvil_assert(m_n_mipmaps > in_n_mip); @@ -1590,14 +1569,14 @@ void Anvil::Image::on_memory_backing_opaque_update(VkDeviceSize in_resour const bool is_unbinding = (in_memory_block_ptr == nullptr); /* Sanity checks */ - anvil_assert(m_create_info_ptr->get_residency_scope() != Anvil::SparseResidencyScope::UNKNOWN); + anvil_assert((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) != 0); if (in_memory_block_ptr != nullptr) { anvil_assert(in_memory_block_ptr->get_create_info_ptr()->get_size() <= in_memory_block_start_offset + in_size); } - if (m_create_info_ptr->get_residency_scope() == Anvil::SparseResidencyScope::NONE) + if ((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) == 0) { /* Non-resident image: underlying memory is viewed as an opaque linear region. */ m_page_tracker_ptr->set_binding(in_memory_block_ptr, @@ -1756,8 +1735,7 @@ void Anvil::Image::on_memory_backing_update(const Anvil::ImageSubresource& in_su decltype(m_sparse_aspect_page_occupancy)::iterator aspect_page_occupancy_iterator; decltype(m_sparse_aspect_props)::iterator aspect_props_iterator; - anvil_assert(m_create_info_ptr->get_residency_scope() == Anvil::SparseResidencyScope::ALIASED || - m_create_info_ptr->get_residency_scope() == Anvil::SparseResidencyScope::NONALIASED); + anvil_assert((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0); ANVIL_REDUNDANT_ARGUMENT(in_memory_block_start_offset); @@ -1977,13 +1955,13 @@ bool Anvil::Image::set_memory_internal(uint32_t in_swapchain_image_index, Anvil::StructChainer struct_chainer; /* Sanity checks */ - anvil_assert(m_create_info_ptr->get_residency_scope() == Anvil::SparseResidencyScope::UNKNOWN); - anvil_assert(m_mipmaps.size() == 1); - anvil_assert(m_peer_device_indices.size() == 0); - anvil_assert(m_peer_sfr_rects.size() == 0); - anvil_assert(m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::NONSPARSE_PEER_NO_ALLOC || - m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); - anvil_assert(m_create_info_ptr->get_swapchain()->get_create_info_ptr()->get_n_images() > in_swapchain_image_index); + anvil_assert((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) == 0); + anvil_assert(m_mipmaps.size() == 1); + anvil_assert(m_peer_device_indices.size() == 0); + anvil_assert(m_peer_sfr_rects.size() == 0); + anvil_assert(m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::PEER_NO_ALLOC || + m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); + anvil_assert(m_create_info_ptr->get_swapchain()->get_create_info_ptr()->get_n_images() > in_swapchain_image_index); if (!m_device_ptr->is_extension_enabled(VK_KHR_DEVICE_GROUP_EXTENSION_NAME) ) { @@ -2095,11 +2073,11 @@ bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, VkResult result (VK_ERROR_INITIALIZATION_FAILED); /* Sanity checks */ - anvil_assert(in_memory_block_ptr != nullptr); - anvil_assert(m_create_info_ptr->get_residency_scope() == Anvil::SparseResidencyScope::UNKNOWN); - anvil_assert(m_mipmaps.size() > 0); - anvil_assert(m_memory_blocks_owned.size() == 0); - anvil_assert(m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); + anvil_assert(in_memory_block_ptr != nullptr); + anvil_assert((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) == 0); + anvil_assert(m_mipmaps.size() > 0); + anvil_assert(m_memory_blocks_owned.size() == 0); + anvil_assert(m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); /* Bind the memory object to the image object */ if (device_type == Anvil::DeviceType::SINGLE_GPU) @@ -2226,11 +2204,11 @@ bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, Anvil::StructChainer struct_chainer; /* Sanity checks */ - anvil_assert(in_memory_block_ptr != nullptr); - anvil_assert(m_create_info_ptr->get_residency_scope() == Anvil::SparseResidencyScope::UNKNOWN); - anvil_assert(m_mipmaps.size() > 0); - anvil_assert(m_memory_blocks_owned.size() == 0); - anvil_assert(m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); + anvil_assert(in_memory_block_ptr != nullptr); + anvil_assert((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) == 0); + anvil_assert(m_mipmaps.size() > 0); + anvil_assert(m_memory_blocks_owned.size() == 0); + anvil_assert(m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); if (!do_sanity_checks_for_physical_device_binding(in_memory_block_ptr, in_n_device_group_indices) ) @@ -2599,14 +2577,15 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p Anvil::MemoryBlock* mem_block_ptr = nullptr; VkDeviceSize write_dst_slice_offset = dst_slice_offset; - if (m_create_info_ptr->get_residency_scope() == Anvil::SparseResidencyScope::UNKNOWN) + if ((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) == 0) { anvil_assert(m_memory_blocks_owned.size() == 1); mem_block_ptr = m_memory_blocks_owned.at(0).get(); } else - if (m_create_info_ptr->get_residency_scope() == SparseResidencyScope::NONE) + if ((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) != 0 && + (m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) == 0) { const VkDeviceSize dst_slice_offset_page_aligned = Anvil::Utils::round_down(dst_slice_offset, sparse_page_size); @@ -2724,12 +2703,13 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p } { - auto create_info_ptr = Anvil::BufferCreateInfo::create_nonsparse_alloc(m_device_ptr, - total_raw_mips_size, - Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, - Anvil::SharingMode::EXCLUSIVE, - Anvil::BufferUsageFlagBits::TRANSFER_SRC_BIT, - Anvil::MemoryFeatureFlagBits::NONE); + auto create_info_ptr = Anvil::BufferCreateInfo::create_alloc(m_device_ptr, + total_raw_mips_size, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, + Anvil::SharingMode::EXCLUSIVE, + Anvil::BufferCreateFlagBits::NONE, + Anvil::BufferUsageFlagBits::TRANSFER_SRC_BIT, + Anvil::MemoryFeatureFlagBits::NONE); create_info_ptr->set_client_data(merged_mip_storage.get() ); create_info_ptr->set_mt_safety (Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() )); diff --git a/src/wrappers/memory_block.cpp b/src/wrappers/memory_block.cpp index c425222d..073f3cba 100644 --- a/src/wrappers/memory_block.cpp +++ b/src/wrappers/memory_block.cpp @@ -596,16 +596,24 @@ bool Anvil::MemoryBlock::map(VkDeviceSize in_start_offset, { /* Make sure the mapped region is invalidated before letting the user read from it */ VkMappedMemoryRange mapped_memory_range; - VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); + const auto non_coherent_atom_size(m_create_info_ptr->get_device()->get_physical_device_properties().core_vk1_0_properties_ptr->limits.non_coherent_atom_size); + VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); ANVIL_REDUNDANT_VARIABLE(result_vk); mapped_memory_range.memory = get_memory(); - mapped_memory_range.offset = m_start_offset + in_start_offset; + mapped_memory_range.offset = Anvil::Utils::round_down(in_start_offset, + non_coherent_atom_size); mapped_memory_range.pNext = nullptr; - mapped_memory_range.size = in_size; + mapped_memory_range.size = Anvil::Utils::round_up(in_size, + non_coherent_atom_size); mapped_memory_range.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE; + if (mapped_memory_range.size + mapped_memory_range.offset > m_create_info_ptr->get_size() ) + { + mapped_memory_range.size = VK_WHOLE_SIZE; + } + result_vk = Anvil::Vulkan::vkInvalidateMappedMemoryRanges(m_create_info_ptr->get_device()->get_device_vk(), 1, /* memRangeCount */ &mapped_memory_range); diff --git a/src/wrappers/render_pass.cpp b/src/wrappers/render_pass.cpp index ac4e3cac..a518d616 100644 --- a/src/wrappers/render_pass.cpp +++ b/src/wrappers/render_pass.cpp @@ -190,19 +190,22 @@ bool Anvil::RenderPass::init() #if defined(_DEBUG) { - if (dependency_vk.dstSubpass == dependency_vk.srcSubpass && - dependency_vk.dstSubpass != VK_SUBPASS_EXTERNAL) + if (m_render_pass_create_info_ptr->is_multiview_enabled() ) { - uint32_t n_views_active = 0; - uint32_t view_mask = 0; + if (dependency_vk.dstSubpass == dependency_vk.srcSubpass && + dependency_vk.dstSubpass != VK_SUBPASS_EXTERNAL) + { + uint32_t n_views_active = 0; + uint32_t view_mask = 0; - m_render_pass_create_info_ptr->get_subpass_view_mask(dependency_vk.dstSubpass, - &view_mask); + m_render_pass_create_info_ptr->get_subpass_view_mask(dependency_vk.dstSubpass, + &view_mask); - n_views_active = Anvil::Utils::count_set_bits(view_mask); + n_views_active = Anvil::Utils::count_set_bits(view_mask); - anvil_assert( (n_views_active <= 1) || - ((n_views_active > 1 && (dependency_vk.dependencyFlags & VK_DEPENDENCY_VIEW_LOCAL_BIT) != 0)) ); + anvil_assert( (n_views_active <= 1) || + ((n_views_active > 1 && (dependency_vk.dependencyFlags & VK_DEPENDENCY_VIEW_LOCAL_BIT) != 0)) ); + } } } #endif diff --git a/src/wrappers/swapchain.cpp b/src/wrappers/swapchain.cpp index aee78a93..f745d97c 100644 --- a/src/wrappers/swapchain.cpp +++ b/src/wrappers/swapchain.cpp @@ -559,23 +559,23 @@ bool Anvil::Swapchain::init() } else { - auto create_info_ptr = Anvil::ImageCreateInfo::create_nonsparse_alloc(m_device_ptr, - Anvil::ImageType::_2D, - m_create_info_ptr->get_format(), - Anvil::ImageTiling::OPTIMAL, - m_create_info_ptr->get_usage_flags(), - m_size.width, - m_size.height, - 1, /* base_mipmap_depth */ - 1, - Anvil::SampleCountFlagBits::_1_BIT, - Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, - Anvil::SharingMode::EXCLUSIVE, - false, /* in_use_full_mipmap_chain */ - Anvil::MemoryFeatureFlagBits::NONE, - Anvil::ImageCreateFlagBits::NONE, - Anvil::ImageLayout::GENERAL, - nullptr); + auto create_info_ptr = Anvil::ImageCreateInfo::create_alloc(m_device_ptr, + Anvil::ImageType::_2D, + m_create_info_ptr->get_format(), + Anvil::ImageTiling::OPTIMAL, + m_create_info_ptr->get_usage_flags(), + m_size.width, + m_size.height, + 1, /* base_mipmap_depth */ + 1, + Anvil::SampleCountFlagBits::_1_BIT, + Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, + Anvil::SharingMode::EXCLUSIVE, + false, /* in_use_full_mipmap_chain */ + Anvil::MemoryFeatureFlagBits::NONE, + Anvil::ImageCreateFlagBits::NONE, + Anvil::ImageLayout::GENERAL, + nullptr); create_info_ptr->set_mt_safety(Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() ) ); From 97e4098dcaf2ae8ce3d9cd25c48d438887ed5e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Fri, 12 Oct 2018 21:59:28 +0200 Subject: [PATCH 27/50] Add missing include guard to misc/vulkan.h --- include/misc/image_create_info.h | 2 +- include/misc/vulkan.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/misc/image_create_info.h b/include/misc/image_create_info.h index c399b40e..dfb9c634 100644 --- a/include/misc/image_create_info.h +++ b/include/misc/image_create_info.h @@ -569,4 +569,4 @@ namespace Anvil }; /* namespace Anvil */ -#endif /* MISC_IMAGE_CREATE_INFO_H */ \ No newline at end of file +#endif /* MISC_IMAGE_CREATE_INFO_H */ diff --git a/include/misc/vulkan.h b/include/misc/vulkan.h index 4c5d8304..91fd062a 100644 --- a/include/misc/vulkan.h +++ b/include/misc/vulkan.h @@ -19,6 +19,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // +#ifndef MISC_VULKAN_H +#define MISC_VULKAN_H + #include #include "vulkan/vulkan.h" @@ -173,3 +176,5 @@ namespace Anvil /* Func pointers to extensions are exposed to apps via relevant functions implemented by Anvil::*Device and Anvil::Instance. */ } } + +#endif /* MISC_VULKAN_H */ From 5c1a365801d45655ed4c08bfa187ae360333ed09 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 15 Oct 2018 17:29:33 +0200 Subject: [PATCH 28/50] fix cmake build on msvc --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aef8ee13..5143d3e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -252,7 +252,7 @@ endif() if (NOT MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -std=c++11") else() - set(CMAKE_CXX_FLAGS "$(CMAKE_CXX_FLAGS) /EHsc /MP") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP") endif() if (ANVIL_LINK_WITH_GLSLANG) From ac627240aac192411a2a8eb95656cb55044b476b Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Mon, 22 Oct 2018 09:56:54 +0200 Subject: [PATCH 29/50] Bug-fixes and improvements --- include/misc/image_view_create_info.h | 17 - include/misc/memory_allocator.h | 301 +++++++++------- include/misc/struct_chainer.h | 2 +- include/wrappers/buffer.h | 2 + include/wrappers/device.h | 6 +- src/misc/fp16.cpp | 4 +- src/misc/image_view_create_info.cpp | 13 +- src/misc/memory_allocator.cpp | 499 ++++++++++++++++++++------ src/wrappers/buffer.cpp | 27 +- src/wrappers/device.cpp | 90 ++--- src/wrappers/image_view.cpp | 16 +- 11 files changed, 641 insertions(+), 336 deletions(-) diff --git a/include/misc/image_view_create_info.h b/include/misc/image_view_create_info.h index fd46ed54..b4185566 100644 --- a/include/misc/image_view_create_info.h +++ b/include/misc/image_view_create_info.h @@ -176,8 +176,6 @@ namespace Anvil * @param in_device_ptr Device to use. * @param in_image_ptr Image instance to create a view for. Must not be nullptr. The specified * object will be retained and release at ImageView release time. - * @param in_n_base_slice Base slice index. - * @param in_n_slices Number of slices to include in the view. * @param in_n_base_mipmap_level Base mipmap level. * @param in_n_mipmaps Number of mipmaps to include in the view. * @param in_aspect_mask Image aspect mask to use when creating the Vulkan image view instance. @@ -195,8 +193,6 @@ namespace Anvil **/ static Anvil::ImageViewCreateInfoUniquePtr create_3D(const Anvil::BaseDevice* in_device_ptr, Image* in_image_ptr, - uint32_t in_n_base_slice, - uint32_t in_n_slices, uint32_t in_n_base_mipmap_level, uint32_t in_n_mipmaps, Anvil::ImageAspectFlags in_aspect_mask, @@ -321,12 +317,6 @@ namespace Anvil return m_n_mipmaps; } - /** Returns number of slices encapsulated by the image view */ - uint32_t get_n_slices() const - { - return m_n_slices; - } - /** Returns a pointer to the parent image, from which the image view has been created. */ Anvil::Image* get_parent_image() const { @@ -396,11 +386,6 @@ namespace Anvil m_n_mipmaps = in_n_mipmaps; } - void set_n_slices(const uint32_t& in_n_slices) - { - m_n_slices = in_n_slices; - } - void set_parent_image(Anvil::Image* in_parent_image_ptr) { m_parent_image_ptr = in_parent_image_ptr; @@ -431,7 +416,6 @@ namespace Anvil const uint32_t in_n_base_mipmap_level, const uint32_t in_n_layers, const uint32_t in_n_mipmaps, - const uint32_t in_n_slices, Anvil::Image* in_parent_image_ptr, const Anvil::ComponentSwizzle* in_swizzle_array_ptr, const Anvil::ImageViewType in_type, @@ -448,7 +432,6 @@ namespace Anvil uint32_t m_n_base_mipmap_level; uint32_t m_n_layers; uint32_t m_n_mipmaps; - uint32_t m_n_slices; Anvil::Image* m_parent_image_ptr; std::array m_swizzle_array; Anvil::ImageViewType m_type; diff --git a/include/misc/memory_allocator.h b/include/misc/memory_allocator.h index 2800f602..a37aeefe 100644 --- a/include/misc/memory_allocator.h +++ b/include/misc/memory_allocator.h @@ -39,10 +39,12 @@ namespace Anvil { typedef std::pair LocalRemoteDeviceIndexPair; + typedef std::pair ResourceMemoryDeviceIndexPair; typedef std::function MemoryAllocatorBakeCallbackFunction; typedef std::function MemoryAllocatorPostBakePerNonSparseBufferItemMemAssignmentCallback; typedef std::function MemoryAllocatorPostBakePerNonSparseImageItemMemAssignmentCallback; typedef std::map MGPUPeerMemoryRequirements; + typedef std::vector MGPUBindSparseDeviceIndices; class MemoryAllocator : public MTSafetySupportProvider { @@ -87,6 +89,7 @@ namespace Anvil MemoryFeatureFlags alloc_memory_required_features; uint32_t alloc_memory_supported_memory_types; uint32_t alloc_memory_types; + MGPUBindSparseDeviceIndices alloc_mgpu_bind_sparse_device_indices; MGPUPeerMemoryRequirements alloc_mgpu_peer_memory_reqs; VkDeviceSize alloc_offset; VkDeviceSize alloc_size; @@ -108,11 +111,12 @@ namespace Anvil const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, + const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, #endif - const bool& in_alloc_is_dedicated, - const uint32_t& in_device_mask, - const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs); + const bool& in_alloc_is_dedicated, + const uint32_t& in_device_mask, + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs, + const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices); Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, Anvil::Buffer* in_buffer_ptr, @@ -124,11 +128,12 @@ namespace Anvil uint32_t in_alloc_supported_memory_types, const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, + const Anvil::ExternalNTHandleInfo* in_alloc_external_nt_handle_info_ptr, #endif - const bool& in_alloc_is_dedicated, - const uint32_t& in_device_mask, - const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs); + const bool& in_alloc_is_dedicated, + const uint32_t& in_device_mask, + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs, + const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices); Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, Anvil::Image* in_image_ptr, @@ -146,7 +151,8 @@ namespace Anvil #endif const bool& in_alloc_is_dedicated, const uint32_t& in_device_mask, - const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs); + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs, + const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices); Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, Anvil::Image* in_image_ptr, @@ -164,7 +170,8 @@ namespace Anvil #endif const bool& in_alloc_is_dedicated, const uint32_t& in_device_mask, - const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs); + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs, + const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices); Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, Anvil::Image* in_image_ptr, @@ -179,7 +186,8 @@ namespace Anvil #endif const bool& in_alloc_is_dedicated, const uint32_t& in_device_mask, - const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs); + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs, + const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices); /** TODO */ ~Item(); @@ -214,127 +222,145 @@ namespace Anvil /** Adds a new Buffer object which should use storage coming from the buffer memory * maintained by the Memory Allocator. * - * @param in_buffer_ptr Buffer to configure storage for at bake() call time. Must not - * be nullptr. - * @param in_data_ptr The buffer will be filled with data extracted from the specified - * location. The number of bytes which will be stored is defined by - * buffer size. - * @param in_data_vector_ptr The buffer will be filled with data extracted from the specified - * vector. Total number of bytes defined in the vector must match - * buffer size. - * @param in_required_memory_features Memory features the assigned memory must support. - * See MemoryFeatureFlagBits for more details. - * @param in_opt_external_nt_handle_info_ptr TODO. Pointer must remain valid till baking time. - * @param in_opt_device_mask_ptr If not null, deref should contain a valid device mask to be used for - * the allocation. Specifying a device mask annotates the allocation request - * with VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT flag. Value from deref is copied - * at call time, the pointer may be released when the func leaves. + * @param in_buffer_ptr Buffer to configure storage for at bake() call time. Must not + * be nullptr. + * @param in_data_ptr The buffer will be filled with data extracted from the specified + * location. The number of bytes which will be stored is defined by + * buffer size. + * @param in_data_vector_ptr The buffer will be filled with data extracted from the specified + * vector. Total number of bytes defined in the vector must match + * buffer size. + * @param in_required_memory_features Memory features the assigned memory must support. + * See MemoryFeatureFlagBits for more details. + * @param in_opt_external_nt_handle_info_ptr TODO. Pointer must remain valid till baking time. + * @param in_opt_device_mask_ptr If not null, deref should contain a valid device mask to be used for + * the allocation. Specifying a device mask annotates the allocation request + * with VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT flag. Value from deref is copied + * at call time, the pointer may be released when the func leaves. + * @param in_opt_mgpu_bind_sparse_device_indices_ptr If not null, deref may contain up to N pairs of resource and memory device indices, where N is the number of devices + * in the device group. The indices will be used during sparse bind operation, binding the buffer on the device with + * resource index to a memory allocation instance on the device with memory index. If null or empty, the binding will work + * as if both indices were zero. * * @return true if the buffer has been successfully scheduled for baking, false otherwise. **/ bool add_buffer (Anvil::Buffer* in_buffer_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif - const uint32_t* in_opt_device_mask_ptr = nullptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); bool add_buffer_with_float_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif - const uint32_t* in_opt_device_mask_ptr = nullptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); bool add_buffer_with_float_data_vector_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif - const uint32_t* in_opt_device_mask_ptr = nullptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); bool add_buffer_with_float_data_vector_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, const std::vector* in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif - const uint32_t* in_opt_device_mask_ptr = nullptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); bool add_buffer_with_uchar8_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif - const uint32_t* in_opt_device_mask_ptr = nullptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); bool add_buffer_with_uchar8_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif - const uint32_t* in_opt_device_mask_ptr = nullptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); bool add_buffer_with_uint32_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif - const uint32_t* in_opt_device_mask_ptr = nullptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); bool add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif - const uint32_t* in_opt_device_mask_ptr = nullptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); bool add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, const std::vector* in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif - const uint32_t* in_opt_device_mask_ptr = nullptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); /** TODO * - * @param in_buffer_ptr TODO - * @param in_offset TODO. Must be divisible by VkMemoryRequirements::alignment - * @param in_size TODO. - * @param in_required_memory_features TODO - * @param in_opt_device_mask_ptr If not null, deref should contain a valid device mask to be used for - * the allocation. Specifying a device mask annotates the allocation request - * with VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT flag. Value from deref is copied - * at call time, the pointer may be released when the func leaves. - * @param in_opt_memory_reqs_ptr If not null, deref contains information of peer memory requirements which - * should be taken into account when determining which memory heap allocations - * should be made off. Specified device indices must be included in @param in_opt_device_mask_ptr. + * @param in_buffer_ptr TODO + * @param in_offset TODO. Must be divisible by VkMemoryRequirements::alignment + * @param in_size TODO. + * @param in_required_memory_features TODO + * @param in_opt_device_mask_ptr If not null, deref should contain a valid device mask to be used for + * the allocation. Specifying a device mask annotates the allocation request + * with VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT flag. Value from deref is copied + * at call time, the pointer may be released when the func leaves. + * @param in_opt_memory_reqs_ptr If not null, deref contains information of peer memory requirements which + * should be taken into account when determining which memory heap allocations + * should be made off. Specified device indices must be included in @param in_opt_device_mask_ptr. + * @param in_opt_mgpu_bind_sparse_device_indices_ptr If not null, deref may contain up to N pairs of resource and memory device indices, where N is the number of devices + * in the device group. The indices will be used during sparse bind operation, binding the buffer on the device with + * resource index to a memory allocation instance on the device with memory index. If null or empty, the binding will work + * as if both indices were zero. * * @return TODO */ - bool add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_offset, - VkDeviceSize in_size, - MemoryFeatureFlags in_required_memory_features, - const uint32_t* in_opt_device_mask_ptr = nullptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); + bool add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkDeviceSize in_size, + MemoryFeatureFlags in_required_memory_features, + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); /** Adds an Image object which should be assigned storage coming from memory objects @@ -343,26 +369,31 @@ namespace Anvil * * This function can be used against both non-sparse and sparse images. * - * @param image_ptr Image to configure storage for at bake() call time. Must not - * be nullptr. - * @param in_required_memory_features Memory features the assigned memory must support. - * See MemoryFeatureFlagBits for more details. - * @param in_opt_external_nt_handle_info_ptr TODO. Pointer must remain valid till baking time. - * @param in_opt_device_mask_ptr If not null, deref should contain a valid device mask to be used for - * the allocation. Specifying a device mask annotates the allocation request - * with VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT flag. Value from deref is copied - * at call time, the pointer may be released when the func leaves. + * @param image_ptr Image to configure storage for at bake() call time. Must not + * be nullptr. + * @param in_required_memory_features Memory features the assigned memory must support. + * See MemoryFeatureFlagBits for more details. + * @param in_opt_external_nt_handle_info_ptr TODO. Pointer must remain valid till baking time. + * @param in_opt_device_mask_ptr If not null, deref should contain a valid device mask to be used for + * the allocation. Specifying a device mask annotates the allocation request + * with VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT flag. Value from deref is copied + * at call time, the pointer may be released when the func leaves. + * @param in_opt_mgpu_bind_sparse_device_indices_ptr If not null, deref may contain up to N pairs of resource and memory device indices, where N is the number of devices + * in the device group. The indices will be used during sparse bind operation, binding the image on the device with + * resource index to a memory allocation instance on the device with memory index. If null or empty, the binding will work + * as if both indices were zero. * * @return true if the image has been successfully scheduled for baking, false otherwise. **/ bool add_image_whole(Anvil::Image* in_image_ptr, MemoryFeatureFlags in_required_memory_features, - const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, + const Anvil::ExternalMemoryHandleTypeFlags& in_opt_exportable_external_handle_types = Anvil::ExternalMemoryHandleTypeFlagBits::NONE, #if defined(_WIN32) - const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, + const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr = nullptr, #endif - const uint32_t* in_opt_device_mask_ptr = nullptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); /** Adds a new Image object whose layer @param in_n_layer 's miptail for @param in_aspect @@ -374,24 +405,29 @@ namespace Anvil * * This function can only be used for sparse resident images. * - * @param in_image_ptr Image to use for the request. Must not be null. - * @param in_aspect Aspect to be used for the request. - * @param in_n_layer Index of the layer to attach the miptail to. - * @param in_required_memory_features Memory features the assigned memory must support. - * See MemoryFeatureFlagBits for more details. - * @param in_opt_device_mask_ptr If not null, deref should contain a valid device mask to be used for - * the allocation. Specifying a device mask annotates the allocation request - * with VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT flag. Value from deref is copied - * at call time, the pointer may be released when the func leaves. + * @param in_image_ptr Image to use for the request. Must not be null. + * @param in_aspect Aspect to be used for the request. + * @param in_n_layer Index of the layer to attach the miptail to. + * @param in_required_memory_features Memory features the assigned memory must support. + * See MemoryFeatureFlagBits for more details. + * @param in_opt_device_mask_ptr If not null, deref should contain a valid device mask to be used for + * the allocation. Specifying a device mask annotates the allocation request + * with VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT flag. Value from deref is copied + * at call time, the pointer may be released when the func leaves. + * @param in_opt_mgpu_bind_sparse_device_indices_ptr If not null, deref may contain up to N pairs of resource and memory device indices, where N is the number of devices + * in the device group. The indices will be used during sparse bind operation, binding the image on the device with + * resource index to a memory allocation instance on the device with memory index. If null or empty, the binding will work + * as if both indices were zero. * * @return true if the miptail has been successfully scheduled for baking, false otherwise. */ - bool add_sparse_image_miptail(Anvil::Image* in_image_ptr, - Anvil::ImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - MemoryFeatureFlags in_required_memory_features, - const uint32_t* in_opt_device_mask_ptr = nullptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); + bool add_sparse_image_miptail(Anvil::Image* in_image_ptr, + Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + MemoryFeatureFlags in_required_memory_features, + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); /** Adds a single subresource which should be assigned memory backing. @@ -399,30 +435,35 @@ namespace Anvil * This function does NOT alloc memory for the miptail. It is user's responsibilty to call * add_sparse_image_miptail() for any layers which require a miptail. * - * @param in_image_ptr Image to use for the request. Must not be null. - * @param in_subresource Specifies details of the subresource to attach memory backing to. - * @param in_offset XYZ offset, from which the memory backing should be attached. Must - * be rounded up to tile size of the aspect @param in_subresource - * refers to. - * @param in_extent Size of the region to assign memory backing to. Must be rounded up - * to tile size of the aspect @param in_subresource refers to, UNLESS - * @param in_offset + @param in_extent touches the subresource border. - * @param in_required_memory_features Memory features the assigned memory must support. - * See MemoryFeatureFlagBits for more details. - * @param in_opt_device_mask_ptr If not null, deref should contain a valid device mask to be used for - * the allocation. Specifying a device mask annotates the allocation request - * with VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT flag. Value from deref is copied - * at call time, the pointer may be released when the func leaves. + * @param in_image_ptr Image to use for the request. Must not be null. + * @param in_subresource Specifies details of the subresource to attach memory backing to. + * @param in_offset XYZ offset, from which the memory backing should be attached. Must + * be rounded up to tile size of the aspect @param in_subresource + * refers to. + * @param in_extent Size of the region to assign memory backing to. Must be rounded up + * to tile size of the aspect @param in_subresource refers to, UNLESS + * @param in_offset + @param in_extent touches the subresource border. + * @param in_required_memory_features Memory features the assigned memory must support. + * See MemoryFeatureFlagBits for more details. + * @param in_opt_device_mask_ptr If not null, deref should contain a valid device mask to be used for + * the allocation. Specifying a device mask annotates the allocation request + * with VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT flag. Value from deref is copied + * at call time, the pointer may be released when the func leaves. + * @param in_opt_mgpu_bind_sparse_device_indices_ptr If not null, deref may contain up to N pairs of resource and memory device indices, where N is the number of devices + * in the device group. The indices will be used during sparse bind operation, binding the image on the device with + * resource index to a memory allocation instance on the device with memory index. If null or empty, the binding will work + * as if both indices were zero. * * @return true if the subresource has been successfully scheduled for baking, false otherwise. **/ - bool add_sparse_image_subresource(Anvil::Image* in_image_ptr, - const Anvil::ImageSubresource& in_subresource, - const VkOffset3D& in_offset, - VkExtent3D in_extent, - MemoryFeatureFlags in_required_memory_features, - const uint32_t* in_opt_device_mask_ptr = nullptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr); + bool add_sparse_image_subresource(Anvil::Image* in_image_ptr, + const Anvil::ImageSubresource& in_subresource, + const VkOffset3D& in_offset, + VkExtent3D in_extent, + MemoryFeatureFlags in_required_memory_features, + const uint32_t* in_opt_device_mask_ptr = nullptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); /** TODO */ bool bake(); @@ -501,8 +542,10 @@ namespace Anvil const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr); + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr); + bool do_bind_sparse_device_indices_sanity_check (const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) const; bool do_external_memory_handle_type_sanity_checks(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const; bool is_alloc_supported (uint32_t in_memory_types, Anvil::MemoryFeatureFlags in_memory_features, diff --git a/include/misc/struct_chainer.h b/include/misc/struct_chainer.h index ffa27583..cb465759 100644 --- a/include/misc/struct_chainer.h +++ b/include/misc/struct_chainer.h @@ -126,7 +126,7 @@ namespace Anvil anvil_assert_fail(); } - memcpy(&struct_raw_data.at(0), + memcpy(struct_raw_data.data(), &in_struct, sizeof(in_struct) ); diff --git a/include/wrappers/buffer.h b/include/wrappers/buffer.h index 942b9b6d..b2ff1dd1 100644 --- a/include/wrappers/buffer.h +++ b/include/wrappers/buffer.h @@ -283,6 +283,8 @@ namespace Anvil uint32_t in_n_device_group_indices, const uint32_t* in_device_group_indices_ptr); + bool is_memory_block_owned(const MemoryBlock* in_memory_block_ptr) const; + /* Private members */ VkBuffer m_buffer; VkMemoryRequirements m_buffer_memory_reqs; diff --git a/include/wrappers/device.h b/include/wrappers/device.h index 28f399cc..3fc3088d 100644 --- a/include/wrappers/device.h +++ b/include/wrappers/device.h @@ -677,7 +677,9 @@ namespace Anvil /* Protected functions */ - std::unique_ptr > get_physical_device_features_chain(const VkPhysicalDeviceFeatures* in_opt_features_ptr) const; + void add_physical_device_features_to_chainer(const VkPhysicalDeviceFeatures* in_opt_features_ptr, + Anvil::StructChainer* in_struct_chainer, + bool in_add_features_struct) const; std::vector get_queue_priorities(const QueueFamilyInfo* in_queue_family_info_ptr) const; void init (const DeviceExtensionConfiguration& in_extensions, @@ -985,7 +987,7 @@ namespace Anvil const QueueFamilyInfoItems& get_physical_device_queue_families() const override; bool get_physical_device_semaphore_properties(const SemaphorePropertiesQuery& in_query, - Anvil::SemaphoreProperties* out_opt_result_ptr = nullptr) const; + Anvil::SemaphoreProperties* out_opt_result_ptr = nullptr) const override; /** TODO */ bool get_physical_device_sparse_image_format_properties(Anvil::Format in_format, diff --git a/src/misc/fp16.cpp b/src/misc/fp16.cpp index 2db33e99..4a36b7c4 100644 --- a/src/misc/fp16.cpp +++ b/src/misc/fp16.cpp @@ -596,7 +596,7 @@ Anvil::float16_t Anvil::Utils::fp32_to_fp16_fast3_rtne(Anvil::float32_t in_f) uint32_t mant_odd = (in_f.u >> 13) & 1; // resulting mantissa is odd // update exponent, rounding bias part 1 - in_f.u += static_cast(((15 - 127) << 23) + 0xfff); + in_f.u += 0xc8000fff; // 0xc8000fff == static_cast(((15 - 127) << 23) + 0xfff); // rounding bias part 2 in_f.u += mant_odd; // take the bits! @@ -653,4 +653,4 @@ Anvil::float16_t Anvil::Utils::fp32_to_fp16_approx(Anvil::float32_t in_f) o.u |= sign >> 16; return o; -} \ No newline at end of file +} diff --git a/src/misc/image_view_create_info.cpp b/src/misc/image_view_create_info.cpp index da779863..ff846c82 100644 --- a/src/misc/image_view_create_info.cpp +++ b/src/misc/image_view_create_info.cpp @@ -51,7 +51,6 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_1D(const in_n_base_mipmap_level, 1, /* in_n_layers */ in_n_mipmaps, - 1, /* in_n_slices */ in_image_ptr, swizzle_rgba, Anvil::ImageViewType::_1D, @@ -92,7 +91,6 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_1D_array( in_n_base_mipmap_level, in_n_layers, in_n_mipmaps, - 1, /* in_n_slices */ in_image_ptr, swizzle_rgba, Anvil::ImageViewType::_1D_ARRAY, @@ -132,7 +130,6 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_2D(const in_n_base_mipmap_level, 1, /* in_n_layers */ in_n_mipmaps, - 1, /* in_n_slices */ in_image_ptr, swizzle_rgba, Anvil::ImageViewType::_2D, @@ -173,7 +170,6 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_2D_array( in_n_base_mipmap_level, in_n_layers, in_n_mipmaps, - 1, /* in_n_slices */ in_image_ptr, swizzle_rgba, Anvil::ImageViewType::_2D_ARRAY, @@ -185,8 +181,6 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_2D_array( Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_3D(const Anvil::BaseDevice* in_device_ptr, Image* in_image_ptr, - uint32_t in_n_base_slice, - uint32_t in_n_slices, uint32_t in_n_base_mipmap_level, uint32_t in_n_mipmaps, Anvil::ImageAspectFlags in_aspect_mask, @@ -210,11 +204,10 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_3D(const new Anvil::ImageViewCreateInfo(in_aspect_mask, in_device_ptr, in_format, - in_n_base_slice, + 0, /* in_base_array_layer */ in_n_base_mipmap_level, 1, /* in_n_layers */ in_n_mipmaps, - in_n_slices, in_image_ptr, swizzle_rgba, Anvil::ImageViewType::_3D, @@ -254,7 +247,6 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_cube_map( in_n_base_mipmap_level, 6, /* in_n_layers */ in_n_mipmaps, - 1, /* in_n_slices */ in_image_ptr, swizzle_rgba, Anvil::ImageViewType::_CUBE, @@ -295,7 +287,6 @@ Anvil::ImageViewCreateInfoUniquePtr Anvil::ImageViewCreateInfo::create_cube_map_ in_n_base_mipmap_level, in_n_cube_maps * 6, in_n_mipmaps, - 1, /* in_n_slices */ in_image_ptr, swizzle_rgba, Anvil::ImageViewType::_CUBE_ARRAY, @@ -312,7 +303,6 @@ Anvil::ImageViewCreateInfo::ImageViewCreateInfo(const Anvil::ImageAspectFlags& i const uint32_t in_n_base_mipmap_level, const uint32_t in_n_layers, const uint32_t in_n_mipmaps, - const uint32_t in_n_slices, Anvil::Image* in_parent_image_ptr, const Anvil::ComponentSwizzle* in_swizzle_array_ptr, const Anvil::ImageViewType in_type, @@ -325,7 +315,6 @@ Anvil::ImageViewCreateInfo::ImageViewCreateInfo(const Anvil::ImageAspectFlags& i m_n_base_mipmap_level(in_n_base_mipmap_level), m_n_layers (in_n_layers), m_n_mipmaps (in_n_mipmaps), - m_n_slices (in_n_slices), m_parent_image_ptr (in_parent_image_ptr), m_swizzle_array ({in_swizzle_array_ptr[0], in_swizzle_array_ptr[1], in_swizzle_array_ptr[2], in_swizzle_array_ptr[3]}), m_type (in_type) diff --git a/src/misc/memory_allocator.cpp b/src/misc/memory_allocator.cpp index 3a1277a1..49011105 100644 --- a/src/misc/memory_allocator.cpp +++ b/src/misc/memory_allocator.cpp @@ -33,6 +33,7 @@ #include "wrappers/image.h" #include "wrappers/memory_block.h" #include "wrappers/queue.h" +#include /* Please see header for specification */ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, @@ -48,7 +49,8 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i #endif const bool& in_alloc_is_dedicated, const uint32_t& in_device_mask, - const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs) + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs, + const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -66,6 +68,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i alloc_memory_required_features = in_alloc_required_memory_features; alloc_memory_supported_memory_types = in_alloc_supported_memory_types; alloc_memory_types = in_alloc_memory_types; + alloc_mgpu_bind_sparse_device_indices = in_mgpu_bind_sparse_device_indices; alloc_mgpu_peer_memory_reqs = in_mgpu_peer_memory_reqs; alloc_size = in_alloc_size; buffer_ptr = in_buffer_ptr; @@ -91,7 +94,8 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i #endif const bool& in_alloc_is_dedicated, const uint32_t& in_device_mask, - const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs) + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs, + const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -109,6 +113,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i alloc_memory_required_features = in_alloc_required_memory_features; alloc_memory_supported_memory_types = in_alloc_supported_memory_types; alloc_memory_types = in_alloc_memory_types; + alloc_mgpu_bind_sparse_device_indices = in_mgpu_bind_sparse_device_indices; alloc_mgpu_peer_memory_reqs = in_mgpu_peer_memory_reqs; alloc_offset = in_alloc_offset; alloc_size = in_alloc_size; @@ -138,7 +143,8 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i #endif const bool& in_alloc_is_dedicated, const uint32_t& in_device_mask, - const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs) + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs, + const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -156,6 +162,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i alloc_memory_required_features = in_alloc_required_memory_features; alloc_memory_supported_memory_types = in_alloc_supported_memory_types; alloc_memory_types = in_alloc_memory_types; + alloc_mgpu_bind_sparse_device_indices = in_mgpu_bind_sparse_device_indices; alloc_mgpu_peer_memory_reqs = in_mgpu_peer_memory_reqs; alloc_offset = UINT64_MAX; alloc_size = in_alloc_size; @@ -187,7 +194,8 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i #endif const bool& in_alloc_is_dedicated, const uint32_t& in_device_mask, - const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs) + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs, + const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -205,6 +213,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i alloc_memory_required_alignment = in_alloc_alignment; alloc_memory_required_features = in_alloc_required_memory_features; alloc_memory_supported_memory_types = in_alloc_supported_memory_types; + alloc_mgpu_bind_sparse_device_indices = in_mgpu_bind_sparse_device_indices; alloc_mgpu_peer_memory_reqs = in_mgpu_peer_memory_reqs; alloc_offset = UINT64_MAX; alloc_size = in_alloc_size; @@ -234,7 +243,8 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i #endif const bool& in_alloc_is_dedicated, const uint32_t& in_device_mask, - const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs) + const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs, + const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -252,6 +262,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i alloc_memory_required_features = in_alloc_required_memory_features; alloc_memory_supported_memory_types = in_alloc_supported_memory_types; alloc_memory_types = in_alloc_memory_types; + alloc_mgpu_bind_sparse_device_indices = in_mgpu_bind_sparse_device_indices; alloc_mgpu_peer_memory_reqs = in_mgpu_peer_memory_reqs; alloc_offset = UINT64_MAX; alloc_size = in_alloc_size; @@ -423,7 +434,6 @@ Anvil::MemoryAllocator::~MemoryAllocator() } } - /** Please see header for specification */ bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* in_buffer_ptr, MemoryFeatureFlags in_required_memory_features, @@ -432,7 +442,8 @@ bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -451,7 +462,8 @@ bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* in_opt_external_nt_handle_info_ptr, #endif in_opt_device_mask_ptr, - in_opt_mgpu_peer_memory_reqs_ptr); + in_opt_mgpu_peer_memory_reqs_ptr, + in_opt_mgpu_bind_sparse_device_indices_ptr); } /** Determines the amount of memory, supported memory type and required alignment for the specified @@ -466,7 +478,8 @@ bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) { IMemoryAllocatorBackend* backend_interface_ptr = dynamic_cast(m_backend_ptr.get() ); VkDeviceSize buffer_alignment = 0; @@ -481,9 +494,13 @@ bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* /* Sanity checks */ anvil_assert(backend_interface_ptr->supports_baking() ); - anvil_assert(in_buffer_ptr != nullptr); - anvil_assert( in_opt_device_mask_ptr == nullptr || - (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); + anvil_assert(in_buffer_ptr != nullptr); + anvil_assert( in_opt_device_mask_ptr == nullptr || + (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); + anvil_assert( in_opt_mgpu_bind_sparse_device_indices_ptr == nullptr || + ((in_buffer_ptr->get_create_info_ptr()->get_create_flags() & BufferCreateFlagBits::SPARSE_BINDING_BIT) != 0)); + + anvil_assert(do_bind_sparse_device_indices_sanity_check(in_opt_mgpu_bind_sparse_device_indices_ptr)); /* Extract external memory handle types from the specified buffer, if none were specified. */ if (!do_external_memory_handle_type_sanity_checks(in_buffer_ptr->get_create_info_ptr()->get_exportable_external_memory_handle_types() ) ) @@ -522,8 +539,9 @@ bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* in_opt_external_nt_handle_info_ptr, #endif in_buffer_ptr->requires_dedicated_allocation(), - (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr : 0, - (in_opt_mgpu_peer_memory_reqs_ptr != nullptr) ? *in_opt_mgpu_peer_memory_reqs_ptr : MGPUPeerMemoryRequirements() ) + (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr : 0, + (in_opt_mgpu_peer_memory_reqs_ptr != nullptr) ? *in_opt_mgpu_peer_memory_reqs_ptr : MGPUPeerMemoryRequirements(), + (in_opt_mgpu_bind_sparse_device_indices_ptr != nullptr) ? *in_opt_mgpu_bind_sparse_device_indices_ptr : MGPUBindSparseDeviceIndices() ) ); m_items.push_back( @@ -547,7 +565,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvi const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -567,7 +586,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvi in_opt_external_nt_handle_info_ptr, #endif in_opt_device_mask_ptr, - in_opt_mgpu_peer_memory_reqs_ptr); + in_opt_mgpu_peer_memory_reqs_ptr, + in_opt_mgpu_bind_sparse_device_indices_ptr); if (result) { @@ -586,7 +606,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -608,7 +629,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi in_opt_external_nt_handle_info_ptr, #endif in_opt_device_mask_ptr, - in_opt_mgpu_peer_memory_reqs_ptr); + in_opt_mgpu_peer_memory_reqs_ptr, + in_opt_mgpu_bind_sparse_device_indices_ptr); if (result) { @@ -627,7 +649,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -654,7 +677,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi in_opt_external_nt_handle_info_ptr, #endif in_opt_device_mask_ptr, - in_opt_mgpu_peer_memory_reqs_ptr); + in_opt_mgpu_peer_memory_reqs_ptr, + in_opt_mgpu_bind_sparse_device_indices_ptr); if (result) { @@ -673,7 +697,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anv const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -693,7 +718,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anv in_opt_external_nt_handle_info_ptr, #endif in_opt_device_mask_ptr, - in_opt_mgpu_peer_memory_reqs_ptr); + in_opt_mgpu_peer_memory_reqs_ptr, + in_opt_mgpu_bind_sparse_device_indices_ptr); if (result) { @@ -712,7 +738,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_vector_ptr_based_post_f const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -734,7 +761,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_vector_ptr_based_post_f in_opt_external_nt_handle_info_ptr, #endif in_opt_device_mask_ptr, - in_opt_mgpu_peer_memory_reqs_ptr); + in_opt_mgpu_peer_memory_reqs_ptr, + in_opt_mgpu_bind_sparse_device_indices_ptr); if (result) { @@ -753,7 +781,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anv const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -773,7 +802,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anv in_opt_external_nt_handle_info_ptr, #endif in_opt_device_mask_ptr, - in_opt_mgpu_peer_memory_reqs_ptr); + in_opt_mgpu_peer_memory_reqs_ptr, + in_opt_mgpu_bind_sparse_device_indices_ptr); if (result) { @@ -792,7 +822,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -814,7 +845,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f in_opt_external_nt_handle_info_ptr, #endif in_opt_device_mask_ptr, - in_opt_mgpu_peer_memory_reqs_ptr); + in_opt_mgpu_peer_memory_reqs_ptr, + in_opt_mgpu_bind_sparse_device_indices_ptr); if (result) { @@ -833,7 +865,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -860,7 +893,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f in_opt_external_nt_handle_info_ptr, #endif in_opt_device_mask_ptr, - in_opt_mgpu_peer_memory_reqs_ptr); + in_opt_mgpu_peer_memory_reqs_ptr, + in_opt_mgpu_bind_sparse_device_indices_ptr); if (result) { @@ -879,7 +913,8 @@ bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* const Anvil::ExternalNTHandleInfo* in_opt_external_nt_handle_info_ptr, #endif const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) { uint32_t filtered_memory_types = 0; VkDeviceSize image_alignment = 0; @@ -899,9 +934,13 @@ bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* /* Sanity checks */ anvil_assert(m_backend_ptr->supports_baking() ); - anvil_assert(in_image_ptr != nullptr); - anvil_assert(in_opt_device_mask_ptr == nullptr || - (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); + anvil_assert(in_image_ptr != nullptr); + anvil_assert( in_opt_device_mask_ptr == nullptr || + (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); + anvil_assert( in_opt_mgpu_bind_sparse_device_indices_ptr == nullptr || + ((in_image_ptr->get_create_info_ptr()->get_create_flags() & ImageCreateFlagBits::SPARSE_BINDING_BIT) != 0)); + + anvil_assert(do_bind_sparse_device_indices_sanity_check(in_opt_mgpu_bind_sparse_device_indices_ptr)); if (!do_external_memory_handle_type_sanity_checks(in_image_ptr->get_create_info_ptr()->get_external_memory_handle_types()) ) { @@ -939,8 +978,9 @@ bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* in_opt_external_nt_handle_info_ptr, #endif in_image_ptr->requires_dedicated_allocation(), - (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr : 0, - (in_opt_mgpu_peer_memory_reqs_ptr != nullptr) ? *in_opt_mgpu_peer_memory_reqs_ptr : MGPUPeerMemoryRequirements() ) + (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr : 0, + (in_opt_mgpu_peer_memory_reqs_ptr != nullptr) ? *in_opt_mgpu_peer_memory_reqs_ptr : MGPUPeerMemoryRequirements(), + (in_opt_mgpu_bind_sparse_device_indices_ptr != nullptr) ? *in_opt_mgpu_bind_sparse_device_indices_ptr : MGPUBindSparseDeviceIndices() ) ); m_items.push_back( @@ -953,12 +993,13 @@ bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* } /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, - VkDeviceSize in_offset, - VkDeviceSize in_size, - MemoryFeatureFlags in_required_memory_features, - const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) +bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr, + VkDeviceSize in_offset, + VkDeviceSize in_size, + MemoryFeatureFlags in_required_memory_features, + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) { uint32_t filtered_memory_types = 0; const auto& memory_reqs = in_buffer_ptr->get_memory_requirements(); @@ -975,6 +1016,7 @@ bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); anvil_assert((in_buffer_ptr->get_create_info_ptr()->get_create_flags() & Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0); + anvil_assert(do_bind_sparse_device_indices_sanity_check(in_opt_mgpu_bind_sparse_device_indices_ptr)); if (mutex_ptr != nullptr) { @@ -1018,8 +1060,9 @@ bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* nullptr, /* in_alloc_external_nt_handle_info_ptr */ #endif in_buffer_ptr->requires_dedicated_allocation(), - (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr : 0, - (in_opt_mgpu_peer_memory_reqs_ptr != nullptr) ? *in_opt_mgpu_peer_memory_reqs_ptr : MGPUPeerMemoryRequirements() ) + (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr : 0, + (in_opt_mgpu_peer_memory_reqs_ptr != nullptr) ? *in_opt_mgpu_peer_memory_reqs_ptr : MGPUPeerMemoryRequirements(), + (in_opt_mgpu_bind_sparse_device_indices_ptr != nullptr) ? *in_opt_mgpu_bind_sparse_device_indices_ptr : MGPUBindSparseDeviceIndices() ) ); m_items.push_back( @@ -1035,12 +1078,13 @@ bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* } /** Please see header for specification */ -bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* in_image_ptr, - Anvil::ImageAspectFlagBits in_aspect, - uint32_t in_n_layer, - MemoryFeatureFlags in_required_memory_features, - const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) +bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* in_image_ptr, + Anvil::ImageAspectFlagBits in_aspect, + uint32_t in_n_layer, + MemoryFeatureFlags in_required_memory_features, + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) { const Anvil::SparseImageAspectProperties* aspect_props_ptr = nullptr; uint32_t filtered_memory_types = 0; @@ -1063,6 +1107,7 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); anvil_assert((in_image_ptr->get_create_info_ptr()->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0); + anvil_assert(do_bind_sparse_device_indices_sanity_check(in_opt_mgpu_bind_sparse_device_indices_ptr)); if (mutex_ptr != nullptr) { @@ -1121,8 +1166,9 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* nullptr, /* in_alloc_external_nt_handle_info_ptr */ #endif false, /* in_alloc_is_dedicated - sparse images do not supported dedicated allocs */ - (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr : 0, - (in_opt_mgpu_peer_memory_reqs_ptr != nullptr) ? *in_opt_mgpu_peer_memory_reqs_ptr : MGPUPeerMemoryRequirements() ) + (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr : 0, + (in_opt_mgpu_peer_memory_reqs_ptr != nullptr) ? *in_opt_mgpu_peer_memory_reqs_ptr : MGPUPeerMemoryRequirements(), + (in_opt_mgpu_bind_sparse_device_indices_ptr != nullptr) ? *in_opt_mgpu_bind_sparse_device_indices_ptr : MGPUBindSparseDeviceIndices() ) ); m_items.push_back( @@ -1136,13 +1182,14 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* } /* Please see header for specification */ -bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* in_image_ptr, - const Anvil::ImageSubresource& in_subresource, - const VkOffset3D& in_offset, - VkExtent3D in_extent, - MemoryFeatureFlags in_required_memory_features, - const uint32_t* in_opt_device_mask_ptr, - const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr) +bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* in_image_ptr, + const Anvil::ImageSubresource& in_subresource, + const VkOffset3D& in_offset, + VkExtent3D in_extent, + MemoryFeatureFlags in_required_memory_features, + const uint32_t* in_opt_device_mask_ptr, + const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) { const Anvil::SparseImageAspectProperties* aspect_props_ptr = nullptr; uint32_t component_size_bits[4] = {0}; @@ -1172,6 +1219,7 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* anvil_assert(in_extent.width >= 1); anvil_assert((in_image_ptr->get_create_info_ptr()->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0); + anvil_assert(do_bind_sparse_device_indices_sanity_check(in_opt_mgpu_bind_sparse_device_indices_ptr)); if (mutex_ptr != nullptr) { @@ -1323,8 +1371,9 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* nullptr, /* in_alloc_external_nt_handle_info_ptr */ #endif false, /* in_alloc_is_dedicated - sparse images do not supported dedicated allocs */ - (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr : 0, - (in_opt_mgpu_peer_memory_reqs_ptr != nullptr) ? *in_opt_mgpu_peer_memory_reqs_ptr : MGPUPeerMemoryRequirements() ) + (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr : 0, + (in_opt_mgpu_peer_memory_reqs_ptr != nullptr) ? *in_opt_mgpu_peer_memory_reqs_ptr : MGPUPeerMemoryRequirements(), + (in_opt_mgpu_bind_sparse_device_indices_ptr != nullptr) ? *in_opt_mgpu_bind_sparse_device_indices_ptr : MGPUBindSparseDeviceIndices() ) ); m_items.push_back( @@ -1340,14 +1389,14 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* /* Please see header for specification */ bool Anvil::MemoryAllocator::bake() { - std::vector fences; - std::unique_lock mutex_lock; - auto mutex_ptr = get_mutex(); - bool needs_sparse_memory_binding = false; - bool result = false; - Anvil::SparseMemoryBindInfoID sparse_memory_bind_info_id = UINT32_MAX; - Anvil::SparseMemoryBindingUpdateInfo sparse_memory_binding; - std::shared_ptr this_ptr; + Anvil::SparseMemoryBindInfoID default_sparse_bind_info_id = UINT32_MAX; + std::map device_index_pair_to_sparse_bind_info_map; + std::vector fences; + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + bool needs_sparse_memory_binding = false; + bool result = false; + Anvil::SparseMemoryBindingUpdateInfo sparse_memory_binding; if (mutex_ptr != nullptr) { @@ -1381,16 +1430,28 @@ bool Anvil::MemoryAllocator::bake() /* Prepare a sparse memory binding structure, if we're going to need one */ for (auto item_iterator = m_items.begin(); - item_iterator != m_items.end() && !needs_sparse_memory_binding; + item_iterator != m_items.end(); ++item_iterator) { - switch ((*item_iterator)->type) + const auto& item_ptr = item_iterator->get(); + + switch (item_ptr->type) { case Anvil::MemoryAllocator::ITEM_TYPE_BUFFER: case Anvil::MemoryAllocator::ITEM_TYPE_SPARSE_BUFFER_REGION: { - needs_sparse_memory_binding |= ((*item_iterator)->buffer_ptr->get_create_info_ptr()->get_type() == Anvil::BufferType::NO_ALLOC) && - (((*item_iterator)->buffer_ptr->get_create_info_ptr()->get_create_flags() & Anvil::BufferCreateFlagBits::SPARSE_BINDING_BIT) != 0); + if ((item_ptr->buffer_ptr->get_create_info_ptr()->get_type() == Anvil::BufferType::NO_ALLOC) && + ((item_ptr->buffer_ptr->get_create_info_ptr()->get_create_flags() & Anvil::BufferCreateFlagBits::SPARSE_BINDING_BIT) != 0)) + { + needs_sparse_memory_binding = true; + + for (auto index_pair_iterator = item_ptr->alloc_mgpu_bind_sparse_device_indices.begin(); + index_pair_iterator != item_ptr->alloc_mgpu_bind_sparse_device_indices.end(); + ++index_pair_iterator) + { + device_index_pair_to_sparse_bind_info_map[*index_pair_iterator] = UINT32_MAX; + } + } break; } @@ -1404,7 +1465,17 @@ bool Anvil::MemoryAllocator::bake() ((create_flags & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) != 0) || ((create_flags & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0); - needs_sparse_memory_binding |= uses_sparse_bindings; + if (uses_sparse_bindings) + { + needs_sparse_memory_binding = true; + + for (auto index_pair_iterator = item_ptr->alloc_mgpu_bind_sparse_device_indices.begin(); + index_pair_iterator != item_ptr->alloc_mgpu_bind_sparse_device_indices.end(); + ++index_pair_iterator) + { + device_index_pair_to_sparse_bind_info_map[*index_pair_iterator] = UINT32_MAX; + } + } break; } @@ -1432,12 +1503,34 @@ bool Anvil::MemoryAllocator::bake() sparse_memory_binding.set_fence(wait_fence_ptr.get() ); fences.push_back (std::move(wait_fence_ptr) ); - sparse_memory_bind_info_id = sparse_memory_binding.add_bind_info(0, /* n_signal_semaphores */ - nullptr, /* opt_signal_semaphores_ptr */ - 0, /* n_wait_semaphores */ - nullptr); /* opt_wait_semaphores_ptr */ + /* Always create the default bind info, which uses the implicit resource index = 0 and memory index = 0. */ + default_sparse_bind_info_id = sparse_memory_binding.add_bind_info(0, /* n_signal_semaphores */ + nullptr, /* opt_signal_semaphores_ptr */ + 0, /* n_wait_semaphores */ + nullptr); /* opt_wait_semaphores_ptr */ + + anvil_assert(default_sparse_bind_info_id != UINT32_MAX); + + /* Bind infos for user-supplied device indices. */ + for (auto device_index_pair_iter = device_index_pair_to_sparse_bind_info_map.begin(); + device_index_pair_iter != device_index_pair_to_sparse_bind_info_map.end(); + ++device_index_pair_iter) + { + auto& sparse_bind_device_index_pair = device_index_pair_iter->first; + auto sparse_memory_bind_info_id = sparse_memory_binding.add_bind_info(0, /* n_signal_semaphores */ + nullptr, /* opt_signal_semaphores_ptr */ + 0, /* n_wait_semaphores */ + nullptr); /* opt_wait_semaphores_ptr */ + + anvil_assert(sparse_memory_bind_info_id != UINT32_MAX); + + device_index_pair_iter->second = sparse_memory_bind_info_id; - anvil_assert(sparse_memory_bind_info_id != UINT32_MAX); + sparse_memory_binding.set_resource_device_index(sparse_memory_bind_info_id, + sparse_bind_device_index_pair.first); + sparse_memory_binding.set_memory_device_index (sparse_memory_bind_info_id, + sparse_bind_device_index_pair.second); + } } result = true; @@ -1481,13 +1574,38 @@ bool Anvil::MemoryAllocator::bake() } else { - sparse_memory_binding.append_buffer_memory_update(sparse_memory_bind_info_id, - item_ptr->buffer_ptr, - 0, /* buffer_memory_start_offset */ - item_ptr->alloc_memory_block_ptr.release(), - 0, /* opt_memory_block_start_offset */ - true, /* in_opt_memory_block_owned_by_buffer */ - item_ptr->alloc_size); + if (item_ptr->alloc_mgpu_bind_sparse_device_indices.empty()) + { + sparse_memory_binding.append_buffer_memory_update(default_sparse_bind_info_id, + item_ptr->buffer_ptr, + 0, /* buffer_memory_start_offset */ + item_ptr->alloc_memory_block_ptr.get(), + 0, /* opt_memory_block_start_offset */ + true, /* in_opt_memory_block_owned_by_buffer */ + item_ptr->alloc_size); + } + else + { + for (auto index_pair_iterator = item_ptr->alloc_mgpu_bind_sparse_device_indices.begin(); + index_pair_iterator != item_ptr->alloc_mgpu_bind_sparse_device_indices.end(); + ++index_pair_iterator) + { + const auto matching_pair = device_index_pair_to_sparse_bind_info_map.find(*index_pair_iterator); + const auto sparse_memory_bind_info_id = (matching_pair == device_index_pair_to_sparse_bind_info_map.end()) ? default_sparse_bind_info_id + : matching_pair->second; + + sparse_memory_binding.append_buffer_memory_update(sparse_memory_bind_info_id, + item_ptr->buffer_ptr, + 0, /* buffer_memory_start_offset */ + item_ptr->alloc_memory_block_ptr.get(), + 0, /* opt_memory_block_start_offset */ + true, /* in_opt_memory_block_owned_by_buffer */ + item_ptr->alloc_size); + } + } + + /* The memory block is now owned by the buffer. */ + item_ptr->alloc_memory_block_ptr.release(); } } @@ -1507,13 +1625,37 @@ bool Anvil::MemoryAllocator::bake() } else { - sparse_memory_binding.append_buffer_memory_update(sparse_memory_bind_info_id, - item_ptr->buffer_ptr, - item_ptr->alloc_offset, - item_ptr->alloc_memory_block_ptr.release(), - 0, /* opt_memory_block_start_offset */ - true, /* in_opt_memory_block_owned_by_buffer */ - item_ptr->alloc_size); + if (item_ptr->alloc_mgpu_bind_sparse_device_indices.empty()) + { + sparse_memory_binding.append_buffer_memory_update(default_sparse_bind_info_id, + item_ptr->buffer_ptr, + item_ptr->alloc_offset, + item_ptr->alloc_memory_block_ptr.get(), + 0, /* opt_memory_block_start_offset */ + true, /* in_opt_memory_block_owned_by_buffer */ + item_ptr->alloc_size); + } + else + { + for (auto index_pair_iterator = item_ptr->alloc_mgpu_bind_sparse_device_indices.begin(); + index_pair_iterator != item_ptr->alloc_mgpu_bind_sparse_device_indices.end(); + ++index_pair_iterator) + { + const auto matching_pair = device_index_pair_to_sparse_bind_info_map.find(*index_pair_iterator); + const auto sparse_memory_bind_info_id = (matching_pair == device_index_pair_to_sparse_bind_info_map.end()) ? default_sparse_bind_info_id + : matching_pair->second; + + sparse_memory_binding.append_buffer_memory_update(sparse_memory_bind_info_id, + item_ptr->buffer_ptr, + item_ptr->alloc_offset, + item_ptr->alloc_memory_block_ptr.get(), + 0, /* opt_memory_block_start_offset */ + true, /* in_opt_memory_block_owned_by_buffer */ + item_ptr->alloc_size); + } + } + + item_ptr->alloc_memory_block_ptr.release(); } break; @@ -1546,14 +1688,39 @@ bool Anvil::MemoryAllocator::bake() } else { - sparse_memory_binding.append_opaque_image_memory_update(sparse_memory_bind_info_id, - item_ptr->image_ptr, - 0, /* resource_offset */ - item_ptr->alloc_size, - Anvil::SparseMemoryBindFlagBits::NONE, - item_ptr->alloc_memory_block_ptr.release(), - 0, /* opt_memory_block_start_offset */ - true); /* in_opt_memory_block_owned_by_image */ + if (item_ptr->alloc_mgpu_bind_sparse_device_indices.empty()) + { + sparse_memory_binding.append_opaque_image_memory_update(default_sparse_bind_info_id, + item_ptr->image_ptr, + 0, /* resource_offset */ + item_ptr->alloc_size, + Anvil::SparseMemoryBindFlagBits::NONE, + item_ptr->alloc_memory_block_ptr.get(), + 0, /* opt_memory_block_start_offset */ + true); /* in_opt_memory_block_owned_by_image */ + } + else + { + for (auto index_pair_iterator = item_ptr->alloc_mgpu_bind_sparse_device_indices.begin(); + index_pair_iterator != item_ptr->alloc_mgpu_bind_sparse_device_indices.end(); + ++index_pair_iterator) + { + const auto matching_pair = device_index_pair_to_sparse_bind_info_map.find(*index_pair_iterator); + const auto sparse_memory_bind_info_id = (matching_pair == device_index_pair_to_sparse_bind_info_map.end()) ? default_sparse_bind_info_id + : matching_pair->second; + + sparse_memory_binding.append_opaque_image_memory_update(sparse_memory_bind_info_id, + item_ptr->image_ptr, + 0, /* resource_offset */ + item_ptr->alloc_size, + Anvil::SparseMemoryBindFlagBits::NONE, + item_ptr->alloc_memory_block_ptr.get(), + 0, /* opt_memory_block_start_offset */ + true); /* in_opt_memory_block_owned_by_image */ + } + } + + item_ptr->alloc_memory_block_ptr.release(); } } @@ -1572,14 +1739,40 @@ bool Anvil::MemoryAllocator::bake() const Anvil::SparseMemoryBindFlagBits bind_flags = (item_ptr->alloc_image_aspect == Anvil::ImageAspectFlagBits::METADATA_BIT) ? Anvil::SparseMemoryBindFlagBits::BIND_METADATA_BIT : Anvil::SparseMemoryBindFlagBits::NONE; - sparse_memory_binding.append_opaque_image_memory_update(sparse_memory_bind_info_id, - item_ptr->image_ptr, - item_ptr->miptail_offset, - item_ptr->alloc_size, - bind_flags, - item_ptr->alloc_memory_block_ptr.release(), - 0, /* opt_memory_block_start_offset */ - true); /* in_opt_memory_block_owned_by_image */ + if (item_ptr->alloc_mgpu_bind_sparse_device_indices.empty()) + { + sparse_memory_binding.append_opaque_image_memory_update(default_sparse_bind_info_id, + item_ptr->image_ptr, + item_ptr->miptail_offset, + item_ptr->alloc_size, + bind_flags, + item_ptr->alloc_memory_block_ptr.get(), + 0, /* opt_memory_block_start_offset */ + true); /* in_opt_memory_block_owned_by_image */ + } + else + { + for (auto index_pair_iterator = item_ptr->alloc_mgpu_bind_sparse_device_indices.begin(); + index_pair_iterator != item_ptr->alloc_mgpu_bind_sparse_device_indices.end(); + ++index_pair_iterator) + { + const auto matching_pair = device_index_pair_to_sparse_bind_info_map.find(*index_pair_iterator); + const auto sparse_memory_bind_info_id = (matching_pair == device_index_pair_to_sparse_bind_info_map.end()) ? default_sparse_bind_info_id + : matching_pair->second; + + sparse_memory_binding.append_opaque_image_memory_update(sparse_memory_bind_info_id, + item_ptr->image_ptr, + item_ptr->miptail_offset, + item_ptr->alloc_size, + bind_flags, + item_ptr->alloc_memory_block_ptr.get(), + 0, /* opt_memory_block_start_offset */ + true); /* in_opt_memory_block_owned_by_image */ + } + } + + + item_ptr->alloc_memory_block_ptr.release(); } break; @@ -1594,15 +1787,41 @@ bool Anvil::MemoryAllocator::bake() } else { - sparse_memory_binding.append_image_memory_update(sparse_memory_bind_info_id, - item_ptr->image_ptr, - item_ptr->subresource, - item_ptr->offset, - item_ptr->extent, - Anvil::SparseMemoryBindFlagBits::NONE, - item_ptr->alloc_memory_block_ptr.release(), - 0, /* opt_memory_block_start_offset */ - true); /* in_opt_memory_block_owned_by_image */ + if (item_ptr->alloc_mgpu_bind_sparse_device_indices.empty()) + { + sparse_memory_binding.append_image_memory_update(default_sparse_bind_info_id, + item_ptr->image_ptr, + item_ptr->subresource, + item_ptr->offset, + item_ptr->extent, + Anvil::SparseMemoryBindFlagBits::NONE, + item_ptr->alloc_memory_block_ptr.get(), + 0, /* opt_memory_block_start_offset */ + true); /* in_opt_memory_block_owned_by_image */ + } + else + { + for (auto index_pair_iterator = item_ptr->alloc_mgpu_bind_sparse_device_indices.begin(); + index_pair_iterator != item_ptr->alloc_mgpu_bind_sparse_device_indices.end(); + ++index_pair_iterator) + { + const auto matching_pair = device_index_pair_to_sparse_bind_info_map.find(*index_pair_iterator); + const auto sparse_memory_bind_info_id = (matching_pair == device_index_pair_to_sparse_bind_info_map.end()) ? default_sparse_bind_info_id + : matching_pair->second; + + sparse_memory_binding.append_image_memory_update(sparse_memory_bind_info_id, + item_ptr->image_ptr, + item_ptr->subresource, + item_ptr->offset, + item_ptr->extent, + Anvil::SparseMemoryBindFlagBits::NONE, + item_ptr->alloc_memory_block_ptr.get(), + 0, /* opt_memory_block_start_offset */ + true); /* in_opt_memory_block_owned_by_image */ + } + } + + item_ptr->alloc_memory_block_ptr.release(); } break; @@ -1619,7 +1838,7 @@ bool Anvil::MemoryAllocator::bake() if (m_post_bake_per_buffer_item_mem_assignment_callback_function == nullptr) { /* If memory backing is needed for one or more sparse resources, bind these now */ - if (sparse_memory_bind_info_id != UINT32_MAX) + if (needs_sparse_memory_binding) { Anvil::Queue* sparse_queue_ptr(m_device_ptr->get_sparse_binding_queue(0) ); @@ -1939,3 +2158,45 @@ void Anvil::MemoryAllocator::set_post_bake_callback(MemoryAllocatorBakeCallbackF m_post_bake_callback_function = in_post_bake_callback_function; } } + +bool Anvil::MemoryAllocator::do_bind_sparse_device_indices_sanity_check(const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) const +{ + if (in_opt_mgpu_bind_sparse_device_indices_ptr == nullptr) + { + return true; + } + else + { + std::set resource_indices; + std::set index_pairs; + + for (auto pair_iterator = in_opt_mgpu_bind_sparse_device_indices_ptr->cbegin(); + pair_iterator != in_opt_mgpu_bind_sparse_device_indices_ptr->cend(); + ++pair_iterator) + { + const auto& pair = *pair_iterator; + auto found_resource_index = resource_indices.find(pair.first); + auto found_pair = index_pairs.find(pair); + + if (found_resource_index != resource_indices.end()) + { + return false; + } + else + { + resource_indices.insert(pair.first); + } + + if (found_pair != index_pairs.end()) + { + return false; + } + else + { + index_pairs.insert(pair); + } + } + } + + return true; +} diff --git a/src/wrappers/buffer.cpp b/src/wrappers/buffer.cpp index 0518cb8e..cf629cd3 100644 --- a/src/wrappers/buffer.cpp +++ b/src/wrappers/buffer.cpp @@ -439,6 +439,8 @@ bool Anvil::Buffer::init() } } + anvil_assert(!is_memory_block_owned(mem_block_ptr.get())); + m_owned_memory_blocks.push_back(std::move(mem_block_ptr) ); m_memory_block_ptr = m_owned_memory_blocks.back().get(); @@ -812,6 +814,8 @@ bool Anvil::Buffer::set_memory_nonsparse_internal(MemoryBlockUniquePtr in_memor m_memory_block_ptr = in_memory_block_ptr.get(); result = true; + anvil_assert(!is_memory_block_owned(in_memory_block_ptr.get())); + m_owned_memory_blocks.push_back( std::move(in_memory_block_ptr) ); @@ -834,7 +838,7 @@ bool Anvil::Buffer::set_memory_sparse(MemoryBlock* in_memory_block_ptr, in_start_offset, in_size) ) { - if (in_memory_block_owned_by_buffer) + if (in_memory_block_owned_by_buffer && !is_memory_block_owned(in_memory_block_ptr)) { MemoryBlockUniquePtr mem_block_ptr(in_memory_block_ptr, std::default_delete() ); @@ -1052,6 +1056,8 @@ bool Anvil::Buffer::set_nonsparse_memory_multi(uint32_t in_n_b MemoryBlockUniquePtr memory_block_ptr(current_update.memory_block_ptr, std::default_delete() ); + anvil_assert(!current_update.buffer_ptr->is_memory_block_owned(current_update.memory_block_ptr)); + current_update.buffer_ptr->m_owned_memory_blocks.push_back( std::move(memory_block_ptr) ); @@ -1199,9 +1205,9 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, copy_cmdbuf_submission.device_mask = in_device_mask; /* Need to update all memory instances */ - if ((m_memory_block_ptr->get_create_info_ptr()->get_memory_features() & Anvil::MemoryFeatureFlagBits::MULTI_INSTANCE_BIT) != 0) + if ((memory_block_ptr->get_create_info_ptr()->get_memory_features() & Anvil::MemoryFeatureFlagBits::MULTI_INSTANCE_BIT) != 0) { - auto device_mask = m_memory_block_ptr->get_create_info_ptr()->get_device_mask(); + auto device_mask = memory_block_ptr->get_create_info_ptr()->get_device_mask(); const Anvil::MGPUDevice* mgpu_device_ptr = dynamic_cast(m_device_ptr); if (device_mask == 0) @@ -1225,3 +1231,18 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, end: return result; } + +bool Anvil::Buffer::is_memory_block_owned(const MemoryBlock* in_memory_block_ptr) const +{ + for (auto memory_block_ptr_iter = m_owned_memory_blocks.begin(); + memory_block_ptr_iter != m_owned_memory_blocks.end(); + ++memory_block_ptr_iter) + { + if (in_memory_block_ptr == memory_block_ptr_iter->get()) + { + return true; + } + } + + return false; +} diff --git a/src/wrappers/device.cpp b/src/wrappers/device.cpp index 901fc402..a3c452e3 100644 --- a/src/wrappers/device.cpp +++ b/src/wrappers/device.cpp @@ -241,15 +241,15 @@ uint32_t Anvil::BaseDevice::get_n_queues(uint32_t in_n_queue_family) const } /* Please see header for specification */ -std::unique_ptr > Anvil::BaseDevice::get_physical_device_features_chain(const VkPhysicalDeviceFeatures* in_opt_features_ptr) const +void Anvil::BaseDevice::add_physical_device_features_to_chainer(const VkPhysicalDeviceFeatures* in_opt_features_ptr, + Anvil::StructChainer* in_struct_chainer_ptr, + bool in_add_features_struct) const { - const auto& features = get_physical_device_features(); - std::unique_ptr > struct_chainer_ptr; + const auto& features = get_physical_device_features(); - struct_chainer_ptr.reset( - new Anvil::StructChainer() - ); + anvil_assert(in_struct_chainer_ptr != nullptr); + if (in_add_features_struct) { VkPhysicalDeviceFeatures2KHR features_khr; @@ -258,20 +258,18 @@ std::unique_ptr > Anvil::BaseD features_khr.pNext = nullptr; features_khr.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR; - struct_chainer_ptr->append_struct(features_khr); + in_struct_chainer_ptr->append_struct(features_khr); } if (m_extension_enabled_info_ptr->get_device_extension_info()->ext_descriptor_indexing() ) { - struct_chainer_ptr->append_struct(features.ext_descriptor_indexing_features_ptr->get_vk_physical_device_descriptor_indexing_features() ); + in_struct_chainer_ptr->append_struct(features.ext_descriptor_indexing_features_ptr->get_vk_physical_device_descriptor_indexing_features() ); } if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_16bit_storage() ) { - struct_chainer_ptr->append_struct(features.khr_16bit_storage_features_ptr->get_vk_physical_device_16_bit_storage_features() ); + in_struct_chainer_ptr->append_struct(features.khr_16bit_storage_features_ptr->get_vk_physical_device_16_bit_storage_features() ); } - - return struct_chainer_ptr->create_chain(); } /* Please see header for specification */ @@ -303,7 +301,7 @@ void Anvil::BaseDevice::get_queue_family_indices_for_physical_device(const Anvil std::vector result_compute_queue_families; std::vector result_transfer_queue_families; std::vector result_universal_queue_families; - + for (uint32_t n_iteration = 0; n_iteration < 3; ++n_iteration) @@ -1277,8 +1275,6 @@ void Anvil::MGPUDevice::create_device(const std::vector& in_extensi { std::vector device_queue_create_info_items; std::vector device_queue_priorities; - auto features_chain_ptr (get_physical_device_features_chain (&in_features) ); - auto features_chain_root_struct_ptr (features_chain_ptr->get_root_struct() ); VkResult result (VK_ERROR_INITIALIZATION_FAILED); Anvil::StructChainer struct_chainer; const Anvil::PhysicalDevice* zeroth_physical_device_ptr (m_parent_physical_devices.at(0).physical_device_ptr); @@ -1325,6 +1321,7 @@ void Anvil::MGPUDevice::create_device(const std::vector& in_extensi } } + /* Set up the device create info descriptor. */ { VkDeviceCreateInfo create_info; @@ -1342,7 +1339,6 @@ void Anvil::MGPUDevice::create_device(const std::vector& in_extensi struct_chainer.append_struct(create_info); } - /* Set up the device create info descriptor. Enable all features available. */ std::vector physical_devices(m_parent_physical_devices.size() ); for (uint32_t n_physical_device = 0; @@ -1363,12 +1359,12 @@ void Anvil::MGPUDevice::create_device(const std::vector& in_extensi struct_chainer.append_struct(device_group_device_create_info); } - /* Finally manually append the features chain to our chain - * - * NOTE: This is a dirty hack! Do NOT append any structs after this point, or else the struct we just chained here gets lost. - */ - struct_chainer.get_last_struct()->pNext = reinterpret_cast((zeroth_physical_device_ptr->get_instance()->get_enabled_extensions_info()->khr_get_physical_device_properties2() ) ? features_chain_root_struct_ptr - : features_chain_root_struct_ptr->pNext); + /* Enable all features available. */ + { + add_physical_device_features_to_chainer(&in_features, + &struct_chainer, + zeroth_physical_device_ptr->get_instance()->get_enabled_extensions_info()->khr_get_physical_device_properties2()); + } { auto struct_chain_ptr = struct_chainer.create_chain(); @@ -1915,13 +1911,11 @@ void Anvil::SGPUDevice::create_device(const std::vector& in_extensi const VkPhysicalDeviceFeatures& in_features, DeviceQueueFamilyInfo* out_queue_families_ptr) { - VkDeviceCreateInfo create_info; - std::vector device_queue_create_info_items; - std::vector device_queue_priorities; - auto features_chain_ptr (get_physical_device_features_chain (&in_features) ); - auto features_chain_root_struct_ptr(features_chain_ptr->get_root_struct () ); - const auto& physical_device_queue_fams (m_parent_physical_device_ptr->get_queue_families() ); - VkResult result (VK_ERROR_INITIALIZATION_FAILED); + Anvil::StructChainer struct_chainer; + std::vector device_queue_create_info_items; + std::vector device_queue_priorities; + const auto& physical_device_queue_fams (m_parent_physical_device_ptr->get_queue_families() ); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); ANVIL_REDUNDANT_VARIABLE(result); @@ -1963,21 +1957,35 @@ void Anvil::SGPUDevice::create_device(const std::vector& in_extensi } } - /* Set up the device create info descriptor. Enable all features available. */ - create_info.enabledExtensionCount = static_cast(in_extensions.size() ); - create_info.enabledLayerCount = static_cast(in_layers.size() ); - create_info.flags = 0; - create_info.pEnabledFeatures = nullptr; - create_info.pNext = (m_parent_physical_device_ptr->get_instance()->get_enabled_extensions_info()->khr_get_physical_device_properties2() ) ? features_chain_root_struct_ptr - : features_chain_root_struct_ptr->pNext; - create_info.ppEnabledExtensionNames = (in_extensions.size() > 0) ? &in_extensions[0] : nullptr; - create_info.ppEnabledLayerNames = (in_layers.size() > 0) ? &in_layers [0] : nullptr; - create_info.pQueueCreateInfos = &device_queue_create_info_items[0]; - create_info.queueCreateInfoCount = static_cast(device_queue_create_info_items.size() ); - create_info.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO; + /* Set up the device create info descriptor.*/ + { + VkDeviceCreateInfo create_info; + + create_info.enabledExtensionCount = static_cast(in_extensions.size()); + create_info.enabledLayerCount = static_cast(in_layers.size()); + create_info.flags = 0; + create_info.pEnabledFeatures = nullptr; + create_info.pNext = nullptr; + create_info.ppEnabledExtensionNames = (in_extensions.size() > 0) ? &in_extensions[0] : nullptr; + create_info.ppEnabledLayerNames = (in_layers.size() > 0) ? &in_layers[0] : nullptr; + create_info.pQueueCreateInfos = &device_queue_create_info_items[0]; + create_info.queueCreateInfoCount = static_cast(device_queue_create_info_items.size()); + create_info.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO; + + struct_chainer.append_struct(create_info); + } + + /* Enable all features available. */ + { + add_physical_device_features_to_chainer(&in_features, + &struct_chainer, + m_parent_physical_device_ptr->get_instance()->get_enabled_extensions_info()->khr_get_physical_device_properties2()); + } + + auto struct_chain = struct_chainer.create_chain(); result = Anvil::Vulkan::vkCreateDevice(m_parent_physical_device_ptr->get_physical_device(), - &create_info, + struct_chain->get_root_struct(), nullptr, /* pAllocator */ &m_device); anvil_assert_vk_call_succeeded(result); diff --git a/src/wrappers/image_view.cpp b/src/wrappers/image_view.cpp index ff76a511..8ee374ff 100644 --- a/src/wrappers/image_view.cpp +++ b/src/wrappers/image_view.cpp @@ -98,7 +98,7 @@ void Anvil::ImageView::get_base_mipmap_size(uint32_t* out_opt_base_mipmap_width_ result = parent_image_ptr->get_image_mipmap_size(n_base_mip_level, out_opt_base_mipmap_width_ptr, out_opt_base_mipmap_height_ptr, - nullptr); + out_opt_base_mipmap_depth_ptr); anvil_assert(result); switch (m_create_info_ptr->get_type() ) @@ -107,7 +107,7 @@ void Anvil::ImageView::get_base_mipmap_size(uint32_t* out_opt_base_mipmap_width_ case Anvil::ImageViewType::_1D_ARRAY: result_depth = m_create_info_ptr->get_n_layers(); break; case Anvil::ImageViewType::_2D: result_depth = 1; break; case Anvil::ImageViewType::_2D_ARRAY: result_depth = m_create_info_ptr->get_n_layers(); break; - case Anvil::ImageViewType::_3D: result_depth = m_create_info_ptr->get_n_slices(); break; + case Anvil::ImageViewType::_3D: break; case Anvil::ImageViewType::_CUBE: result_depth = m_create_info_ptr->get_n_layers(); break; case Anvil::ImageViewType::_CUBE_ARRAY: result_depth = m_create_info_ptr->get_n_layers(); break; @@ -293,15 +293,11 @@ bool Anvil::ImageView::intersects(const Anvil::ImageView* in_image_view_ptr) con if ((this_subresource_range.aspect_mask & in_subresource_range.aspect_mask) != 0) { /* Layers + mips */ - if (!((this_subresource_range.base_array_layer < in_subresource_range.base_array_layer && - this_subresource_range.base_array_layer + this_subresource_range.layer_count < in_subresource_range.base_array_layer) || - (in_subresource_range.base_array_layer < this_subresource_range.base_array_layer && - in_subresource_range.base_array_layer + in_subresource_range.layer_count < this_subresource_range.base_array_layer) )) + if (!((this_subresource_range.base_array_layer + this_subresource_range.layer_count <= in_subresource_range.base_array_layer) || + (in_subresource_range.base_array_layer + in_subresource_range.layer_count <= this_subresource_range.base_array_layer) )) { - if (!((this_subresource_range.base_mip_level < in_subresource_range.base_mip_level && - this_subresource_range.base_mip_level + this_subresource_range.level_count < in_subresource_range.base_mip_level) || - (in_subresource_range.base_mip_level < this_subresource_range.base_mip_level && - in_subresource_range.base_mip_level + in_subresource_range.level_count < this_subresource_range.base_mip_level) )) + if (!((this_subresource_range.base_mip_level + this_subresource_range.level_count <= in_subresource_range.base_mip_level) || + (in_subresource_range.base_mip_level + in_subresource_range.level_count <= this_subresource_range.base_mip_level) )) { result = true; } From ed958ada1345f7e8dac2b56b447e7bfece537927 Mon Sep 17 00:00:00 2001 From: Silverlan Date: Wed, 24 Oct 2018 06:30:42 +0200 Subject: [PATCH 30/50] Update graphics_pipeline_create_info.h Changed the type of the first parameter of GraphicsPipelineCreateInfo::create from PipelineCreateFlagBits to PipelineCreateFlags. --- include/misc/graphics_pipeline_create_info.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/misc/graphics_pipeline_create_info.h b/include/misc/graphics_pipeline_create_info.h index 823218bf..337f1077 100644 --- a/include/misc/graphics_pipeline_create_info.h +++ b/include/misc/graphics_pipeline_create_info.h @@ -31,7 +31,7 @@ namespace Anvil { public: /* Public functions */ - static Anvil::GraphicsPipelineCreateInfoUniquePtr create (const Anvil::PipelineCreateFlagBits& in_create_flags, + static Anvil::GraphicsPipelineCreateInfoUniquePtr create (const Anvil::PipelineCreateFlags& in_create_flags, const RenderPass* in_renderpass_ptr, SubPassID in_subpass_id, const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, From 802a979379692f0635de56a98aa0c769ef54ffc2 Mon Sep 17 00:00:00 2001 From: Silverlan Date: Wed, 24 Oct 2018 06:31:19 +0200 Subject: [PATCH 31/50] Update graphics_pipeline_create_info.cpp --- src/misc/graphics_pipeline_create_info.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc/graphics_pipeline_create_info.cpp b/src/misc/graphics_pipeline_create_info.cpp index 854b2ef9..f1cf47ca 100644 --- a/src/misc/graphics_pipeline_create_info.cpp +++ b/src/misc/graphics_pipeline_create_info.cpp @@ -234,7 +234,7 @@ bool Anvil::GraphicsPipelineCreateInfo::copy_gfx_state_from(const Anvil::Graphic return result; } -Anvil::GraphicsPipelineCreateInfoUniquePtr Anvil::GraphicsPipelineCreateInfo::create(const Anvil::PipelineCreateFlagBits& in_create_flags, +Anvil::GraphicsPipelineCreateInfoUniquePtr Anvil::GraphicsPipelineCreateInfo::create(const Anvil::PipelineCreateFlags& in_create_flags, const RenderPass* in_renderpass_ptr, SubPassID in_subpass_id, const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, From 44772e4af179a8696dc346f01a44a50fa7efe507 Mon Sep 17 00:00:00 2001 From: Silverlan Date: Wed, 24 Oct 2018 11:08:39 +0200 Subject: [PATCH 32/50] Update types_enums.h --- include/misc/types_enums.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/include/misc/types_enums.h b/include/misc/types_enums.h index 20221768..298dbae3 100644 --- a/include/misc/types_enums.h +++ b/include/misc/types_enums.h @@ -646,13 +646,11 @@ namespace Anvil /* NOTE: These map 1:1 to VK equivalents */ enum class CullModeFlagBits { - CULL_MODE_BACK_BIT = VK_CULL_MODE_BACK_BIT, - CULL_MODE_FRONT_BIT = VK_CULL_MODE_FRONT_BIT, - CULL_MODE_NONE = VK_CULL_MODE_NONE, + BACK_BIT = VK_CULL_MODE_BACK_BIT, + FRONT_BIT = VK_CULL_MODE_FRONT_BIT, + NONE = VK_CULL_MODE_NONE, - CULL_MODE_FRONT_AND_BACK = VK_CULL_MODE_FRONT_AND_BACK, - - NONE = 0 + FRONT_AND_BACK = VK_CULL_MODE_FRONT_AND_BACK }; typedef Anvil::Bitfield CullModeFlags; @@ -1730,4 +1728,4 @@ namespace Anvil }; }; /* namespace Anvil */ -#endif /* TYPES_ENUMS_H */ \ No newline at end of file +#endif /* TYPES_ENUMS_H */ From dccf18e7ba7da0c82f6581879d2f071299151cfa Mon Sep 17 00:00:00 2001 From: Silverlan Date: Wed, 24 Oct 2018 11:09:10 +0200 Subject: [PATCH 33/50] Update graphics_pipeline_create_info.cpp --- src/misc/graphics_pipeline_create_info.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc/graphics_pipeline_create_info.cpp b/src/misc/graphics_pipeline_create_info.cpp index 854b2ef9..fa1ad9be 100644 --- a/src/misc/graphics_pipeline_create_info.cpp +++ b/src/misc/graphics_pipeline_create_info.cpp @@ -75,7 +75,7 @@ Anvil::GraphicsPipelineCreateInfo::GraphicsPipelineCreateInfo(const RenderPass* 0, sizeof(m_blend_constant) ); - m_cull_mode = Anvil::CullModeFlagBits::CULL_MODE_BACK_BIT; + m_cull_mode = Anvil::CullModeFlagBits::BACK_BIT; m_line_width = 1.0f; m_min_sample_shading = 1.0f; m_sample_count = Anvil::SampleCountFlagBits::_1_BIT; From b4e017367b0b68a0a7caabe4ee845bc3feb21cea Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Fri, 26 Oct 2018 13:22:26 +0200 Subject: [PATCH 34/50] Bug-fixes and improvements --- examples/DynamicBuffers/src/app.cpp | 2 +- examples/OutOfOrderRasterization/src/app.cpp | 2 +- include/misc/extensions.h | 2 +- include/misc/formats.h | 15 + include/misc/graphics_pipeline_create_info.h | 2 +- include/misc/types_enums.h | 5 +- src/misc/formats.cpp | 391 +++++++++++++++++++ src/misc/graphics_pipeline_create_info.cpp | 2 +- src/wrappers/image.cpp | 62 +-- src/wrappers/image_view.cpp | 3 +- 10 files changed, 449 insertions(+), 37 deletions(-) diff --git a/examples/DynamicBuffers/src/app.cpp b/examples/DynamicBuffers/src/app.cpp index d16aa1c5..564ef79b 100644 --- a/examples/DynamicBuffers/src/app.cpp +++ b/examples/DynamicBuffers/src/app.cpp @@ -1012,7 +1012,7 @@ void App::init_gfx_pipelines() consumer_pipeline_info_ptr->set_descriptor_set_create_info(m_consumer_dsg_ptr->get_descriptor_set_create_info() ); consumer_pipeline_info_ptr->set_primitive_topology (Anvil::PrimitiveTopology::LINE_STRIP); consumer_pipeline_info_ptr->set_rasterization_properties (Anvil::PolygonMode::FILL, - Anvil::CullModeFlagBits::CULL_MODE_NONE, + Anvil::CullModeFlagBits::NONE, Anvil::FrontFace::COUNTER_CLOCKWISE, 1.0f /* line_width */); consumer_pipeline_info_ptr->toggle_depth_test (true, /* should_enable */ diff --git a/examples/OutOfOrderRasterization/src/app.cpp b/examples/OutOfOrderRasterization/src/app.cpp index d3bf4322..a14b4cd7 100644 --- a/examples/OutOfOrderRasterization/src/app.cpp +++ b/examples/OutOfOrderRasterization/src/app.cpp @@ -761,7 +761,7 @@ void App::init_gfx_pipelines() pipeline_create_info_ptr->set_primitive_topology (Anvil::PrimitiveTopology::TRIANGLE_LIST); pipeline_create_info_ptr->set_rasterization_properties(Anvil::PolygonMode::FILL, - Anvil::CullModeFlagBits::CULL_MODE_BACK_BIT, + Anvil::CullModeFlagBits::BACK_BIT, Anvil::FrontFace::CLOCKWISE, 4.0f); /* line_width */ pipeline_create_info_ptr->toggle_depth_test (true, /* should_enable */ diff --git a/include/misc/extensions.h b/include/misc/extensions.h index d3a5bf57..19ae7c7f 100644 --- a/include/misc/extensions.h +++ b/include/misc/extensions.h @@ -982,7 +982,7 @@ namespace Anvil /* 3. Disable VK_AMD_shader_info by default. */ extension_status[VK_AMD_SHADER_INFO_EXTENSION_NAME] = Anvil::ExtensionAvailability::IGNORE; } - + std::map extension_status; bool operator==(const DeviceExtensionConfiguration& in_config) const diff --git a/include/misc/formats.h b/include/misc/formats.h index 32aedb89..4d08ad71 100644 --- a/include/misc/formats.h +++ b/include/misc/formats.h @@ -32,6 +32,21 @@ namespace Anvil class Formats { public: + /* Returns a list of formats compatible with @param in_format. + * + * The returned array includes @param in_format. + * + * @param in_format Format to use to determine compatibility class to use for the query. + * @param out_n_compatible_formats_ptr Deref will be set to the number of formats accessible under *out_compatible_formats_ptr_ptr. + * Must not be nullptr. + * @param out_compatible_formats_ptr_ptr Deref will be set to a ptr to a linear list of formats compatible with @param in_format. + * + * @return true if successful, false otherwise. + */ + static bool get_compatible_formats(Anvil::Format in_format, + uint32_t* out_n_compatible_formats_ptr, + const Anvil::Format** out_compatible_formats_ptr_ptr); + static bool get_compressed_format_block_size(Anvil::Format in_format, uint32_t* out_block_size_uvec2_ptr, uint32_t* out_n_bytes_per_block_ptr); diff --git a/include/misc/graphics_pipeline_create_info.h b/include/misc/graphics_pipeline_create_info.h index 337f1077..7ef08ecb 100644 --- a/include/misc/graphics_pipeline_create_info.h +++ b/include/misc/graphics_pipeline_create_info.h @@ -31,7 +31,7 @@ namespace Anvil { public: /* Public functions */ - static Anvil::GraphicsPipelineCreateInfoUniquePtr create (const Anvil::PipelineCreateFlags& in_create_flags, + static Anvil::GraphicsPipelineCreateInfoUniquePtr create (const Anvil::PipelineCreateFlags& in_create_flags, const RenderPass* in_renderpass_ptr, SubPassID in_subpass_id, const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, diff --git a/include/misc/types_enums.h b/include/misc/types_enums.h index 298dbae3..ca9a71fc 100644 --- a/include/misc/types_enums.h +++ b/include/misc/types_enums.h @@ -650,7 +650,7 @@ namespace Anvil FRONT_BIT = VK_CULL_MODE_FRONT_BIT, NONE = VK_CULL_MODE_NONE, - FRONT_AND_BACK = VK_CULL_MODE_FRONT_AND_BACK + FRONT_AND_BACK = VK_CULL_MODE_FRONT_AND_BACK, }; typedef Anvil::Bitfield CullModeFlags; @@ -986,6 +986,7 @@ namespace Anvil USCALED, UNKNOWN, + COUNT = UNKNOWN } ; enum class FrontFace @@ -1728,4 +1729,4 @@ namespace Anvil }; }; /* namespace Anvil */ -#endif /* TYPES_ENUMS_H */ +#endif /* TYPES_ENUMS_H */ \ No newline at end of file diff --git a/src/misc/formats.cpp b/src/misc/formats.cpp index 3c175ec7..bfc9815f 100644 --- a/src/misc/formats.cpp +++ b/src/misc/formats.cpp @@ -22,6 +22,8 @@ #include "misc/debug.h" #include "misc/formats.h" +#include +#include static const struct FormatInfo { @@ -415,6 +417,395 @@ static uint32_t g_layout_to_n_components[] = 2, }; +static const std::vector g_compatibility_classes[] = +{ + /* 8-bit */ + { + Anvil::Format::R4G4_UNORM_PACK8, + Anvil::Format::R8_UNORM, + Anvil::Format::R8_SNORM, + Anvil::Format::R8_USCALED, + Anvil::Format::R8_SSCALED, + Anvil::Format::R8_UINT, + Anvil::Format::R8_SINT, + Anvil::Format::R8_SRGB + }, + + /* 16-bit */ + { + Anvil::Format::R4G4B4A4_UNORM_PACK16, + Anvil::Format::B4G4R4A4_UNORM_PACK16, + Anvil::Format::R5G6B5_UNORM_PACK16, + Anvil::Format::B5G6R5_UNORM_PACK16, + Anvil::Format::R5G5B5A1_UNORM_PACK16, + Anvil::Format::B5G5R5A1_UNORM_PACK16, + Anvil::Format::A1R5G5B5_UNORM_PACK16, + Anvil::Format::R8G8_UNORM, + Anvil::Format::R8G8_SNORM, + Anvil::Format::R8G8_USCALED, + Anvil::Format::R8G8_SSCALED, + Anvil::Format::R8G8_UINT, + Anvil::Format::R8G8_SINT, + Anvil::Format::R8G8_SRGB, + Anvil::Format::R16_UNORM, + Anvil::Format::R16_SNORM, + Anvil::Format::R16_USCALED, + Anvil::Format::R16_SSCALED, + Anvil::Format::R16_UINT, + Anvil::Format::R16_SINT, + Anvil::Format::R16_SFLOAT + }, + + /* 24-bit */ + { + Anvil::Format::R8G8B8_UNORM, + Anvil::Format::R8G8B8_SNORM, + Anvil::Format::R8G8B8_USCALED, + Anvil::Format::R8G8B8_SSCALED, + Anvil::Format::R8G8B8_UINT, + Anvil::Format::R8G8B8_SINT, + Anvil::Format::R8G8B8_SRGB, + Anvil::Format::B8G8R8_UNORM, + Anvil::Format::B8G8R8_SNORM, + Anvil::Format::B8G8R8_USCALED, + Anvil::Format::B8G8R8_SSCALED, + Anvil::Format::B8G8R8_UINT, + Anvil::Format::B8G8R8_SINT, + Anvil::Format::B8G8R8_SRGB + }, + + /* 32-bit */ + { + Anvil::Format::R8G8B8A8_UNORM, + Anvil::Format::R8G8B8A8_SNORM, + Anvil::Format::R8G8B8A8_USCALED, + Anvil::Format::R8G8B8A8_SSCALED, + Anvil::Format::R8G8B8A8_UINT, + Anvil::Format::R8G8B8A8_SINT, + Anvil::Format::R8G8B8A8_SRGB, + Anvil::Format::B8G8R8A8_UNORM, + Anvil::Format::B8G8R8A8_SNORM, + Anvil::Format::B8G8R8A8_USCALED, + Anvil::Format::B8G8R8A8_SSCALED, + Anvil::Format::B8G8R8A8_UINT, + Anvil::Format::B8G8R8A8_SINT, + Anvil::Format::B8G8R8A8_SRGB, + Anvil::Format::A8B8G8R8_UNORM_PACK32, + Anvil::Format::A8B8G8R8_SNORM_PACK32, + Anvil::Format::A8B8G8R8_USCALED_PACK32, + Anvil::Format::A8B8G8R8_SSCALED_PACK32, + Anvil::Format::A8B8G8R8_UINT_PACK32, + Anvil::Format::A8B8G8R8_SINT_PACK32, + Anvil::Format::A8B8G8R8_SRGB_PACK32, + Anvil::Format::A2R10G10B10_UNORM_PACK32, + Anvil::Format::A2R10G10B10_SNORM_PACK32, + Anvil::Format::A2R10G10B10_USCALED_PACK32, + Anvil::Format::A2R10G10B10_SSCALED_PACK32, + Anvil::Format::A2R10G10B10_UINT_PACK32, + Anvil::Format::A2R10G10B10_SINT_PACK32, + Anvil::Format::A2B10G10R10_UNORM_PACK32, + Anvil::Format::A2B10G10R10_SNORM_PACK32, + Anvil::Format::A2B10G10R10_USCALED_PACK32, + Anvil::Format::A2B10G10R10_SSCALED_PACK32, + Anvil::Format::A2B10G10R10_UINT_PACK32, + Anvil::Format::A2B10G10R10_SINT_PACK32, + Anvil::Format::R16G16_UNORM, + Anvil::Format::R16G16_SNORM, + Anvil::Format::R16G16_USCALED, + Anvil::Format::R16G16_SSCALED, + Anvil::Format::R16G16_UINT, + Anvil::Format::R16G16_SINT, + Anvil::Format::R16G16_SFLOAT, + Anvil::Format::R32_UINT, + Anvil::Format::R32_SINT, + Anvil::Format::R32_SFLOAT, + Anvil::Format::B10G11R11_UFLOAT_PACK32, + Anvil::Format::E5B9G9R9_UFLOAT_PACK32, + }, + + /* 48-bit */ + { + Anvil::Format::R16G16B16_UNORM, + Anvil::Format::R16G16B16_SNORM, + Anvil::Format::R16G16B16_USCALED, + Anvil::Format::R16G16B16_SSCALED, + Anvil::Format::R16G16B16_UINT, + Anvil::Format::R16G16B16_SINT, + Anvil::Format::R16G16B16_SFLOAT + }, + + /* 64-bit */ + { + Anvil::Format::R16G16B16A16_UNORM, + Anvil::Format::R16G16B16A16_SNORM, + Anvil::Format::R16G16B16A16_USCALED, + Anvil::Format::R16G16B16A16_SSCALED, + Anvil::Format::R16G16B16A16_UINT, + Anvil::Format::R16G16B16A16_SINT, + Anvil::Format::R16G16B16A16_SFLOAT, + Anvil::Format::R32G32_UINT, + Anvil::Format::R32G32_SINT, + Anvil::Format::R32G32_SFLOAT, + Anvil::Format::R64_UINT, + Anvil::Format::R64_SINT, + Anvil::Format::R64_SFLOAT + }, + + /* 96-bit */ + { + Anvil::Format::R32G32B32_UINT, + Anvil::Format::R32G32B32_SINT, + Anvil::Format::R32G32B32_SFLOAT + }, + + /* 128-bit */ + { + Anvil::Format::R32G32B32A32_UINT, + Anvil::Format::R32G32B32A32_SINT, + Anvil::Format::R32G32B32A32_SFLOAT, + Anvil::Format::R64G64_UINT, + Anvil::Format::R64G64_SINT, + Anvil::Format::R64G64_SFLOAT + }, + + /* 192-bit */ + { + Anvil::Format::R64G64B64_UINT, + Anvil::Format::R64G64B64_SINT, + Anvil::Format::R64G64B64_SFLOAT + }, + + /* 256-bit */ + { + Anvil::Format::R64G64B64A64_UINT, + Anvil::Format::R64G64B64A64_SINT, + Anvil::Format::R64G64B64A64_SFLOAT + }, + + /* BC1 RGB */ + { + Anvil::Format::BC1_RGB_UNORM_BLOCK, + Anvil::Format::BC1_RGB_SRGB_BLOCK + }, + + /* BC1 RGBA */ + { + Anvil::Format::BC1_RGBA_UNORM_BLOCK, + Anvil::Format::BC1_RGBA_SRGB_BLOCK + }, + + /* BC2 */ + { + Anvil::Format::BC2_UNORM_BLOCK, + Anvil::Format::BC2_SRGB_BLOCK + }, + + /* BC3 */ + { + Anvil::Format::BC3_UNORM_BLOCK, + Anvil::Format::BC3_SRGB_BLOCK + }, + + /* BC4 */ + { + Anvil::Format::BC4_UNORM_BLOCK, + Anvil::Format::BC4_SNORM_BLOCK + }, + + /* BC5 */ + { + Anvil::Format::BC5_UNORM_BLOCK, + Anvil::Format::BC5_SNORM_BLOCK + }, + + /* BC6H */ + { + Anvil::Format::BC6H_UFLOAT_BLOCK, + Anvil::Format::BC6H_SFLOAT_BLOCK + }, + + /* BC7 */ + { + Anvil::Format::BC7_UNORM_BLOCK, + Anvil::Format::BC7_SRGB_BLOCK + }, + + /* ETC2 RGB */ + { + Anvil::Format::ETC2_R8G8B8_UNORM_BLOCK, + Anvil::Format::ETC2_R8G8B8_SRGB_BLOCK + }, + + /* ETC2 RGBA */ + { + Anvil::Format::ETC2_R8G8B8A1_UNORM_BLOCK, + Anvil::Format::ETC2_R8G8B8A1_SRGB_BLOCK + }, + + /* ETC2/EAC RGBA */ + { + Anvil::Format::ETC2_R8G8B8A8_UNORM_BLOCK, + Anvil::Format::ETC2_R8G8B8A8_SRGB_BLOCK + }, + + /* EAC R */ + { + Anvil::Format::EAC_R11_UNORM_BLOCK, + Anvil::Format::EAC_R11_SNORM_BLOCK + }, + + /* EAC RG */ + { + Anvil::Format::EAC_R11G11_UNORM_BLOCK, + Anvil::Format::EAC_R11G11_SNORM_BLOCK + }, + + /* ASTC (4x4) */ + { + Anvil::Format::ASTC_4x4_UNORM_BLOCK, + Anvil::Format::ASTC_4x4_SRGB_BLOCK + }, + + /* ASTC (5x4) */ + { + Anvil::Format::ASTC_5x4_UNORM_BLOCK, + Anvil::Format::ASTC_5x4_SRGB_BLOCK + }, + + /* ASTC (5x5) */ + { + Anvil::Format::ASTC_5x5_UNORM_BLOCK, + Anvil::Format::ASTC_5x5_SRGB_BLOCK + }, + + /* ASTC (6x5) */ + { + Anvil::Format::ASTC_6x5_UNORM_BLOCK, + Anvil::Format::ASTC_6x5_SRGB_BLOCK + }, + + /* ASTC (6x6) */ + { + Anvil::Format::ASTC_6x6_UNORM_BLOCK, + Anvil::Format::ASTC_6x6_SRGB_BLOCK + }, + + /* ASTC (8x5) */ + { + Anvil::Format::ASTC_8x5_UNORM_BLOCK, + Anvil::Format::ASTC_8x5_SRGB_BLOCK + }, + + /* ASTC (8x6) */ + { + Anvil::Format::ASTC_8x6_UNORM_BLOCK, + Anvil::Format::ASTC_8x6_SRGB_BLOCK + }, + + /* ASTC (8x8) */ + { + Anvil::Format::ASTC_8x8_UNORM_BLOCK, + Anvil::Format::ASTC_8x8_SRGB_BLOCK + }, + + /* ASTC (10x5) */ + { + Anvil::Format::ASTC_10x5_UNORM_BLOCK, + Anvil::Format::ASTC_10x5_SRGB_BLOCK + }, + + /* ASTC (10x6) */ + { + Anvil::Format::ASTC_10x6_UNORM_BLOCK, + Anvil::Format::ASTC_10x6_SRGB_BLOCK + }, + + /* ASTC (10x8) */ + { + Anvil::Format::ASTC_10x8_UNORM_BLOCK, + Anvil::Format::ASTC_10x8_SRGB_BLOCK + }, + + /* ASTC (10x10) */ + { + Anvil::Format::ASTC_10x10_UNORM_BLOCK, + Anvil::Format::ASTC_10x10_SRGB_BLOCK + }, + + /* ASTC (12x10) */ + { + Anvil::Format::ASTC_12x10_UNORM_BLOCK, + Anvil::Format::ASTC_12x10_SRGB_BLOCK + }, + + /* ASTC (12x12) */ + { + Anvil::Format::ASTC_12x12_UNORM_BLOCK, + Anvil::Format::ASTC_12x12_SRGB_BLOCK + }, + + /* D16 */ + { + Anvil::Format::D16_UNORM + }, + + /* D24 */ + { + Anvil::Format::X8_D24_UNORM_PACK32 + }, + + /* D32 */ + { + Anvil::Format::D32_SFLOAT + }, + + /* S8 */ + { + Anvil::Format::S8_UINT + }, + + /* D16S8 */ + { + Anvil::Format::D16_UNORM_S8_UINT + }, + + /* D24S8 */ + { + Anvil::Format::D24_UNORM_S8_UINT + }, + + /* D32S8 */ + { + Anvil::Format::D32_SFLOAT_S8_UINT + } +}; + +/** Please see header for specification */ +bool Anvil::Formats::get_compatible_formats(Anvil::Format in_format, + uint32_t* out_n_compatible_formats_ptr, + const Anvil::Format** out_compatible_formats_ptr_ptr) +{ + bool result = false; + + for (const auto& current_class : g_compatibility_classes) + { + auto format_iterator = std::find(current_class.begin(), + current_class.end (), + in_format); + + if (format_iterator != current_class.end() ) + { + *out_n_compatible_formats_ptr = static_cast(current_class.size() ); + *out_compatible_formats_ptr_ptr = ¤t_class.at(0); + + result = true; + break; + } + } + + return result; +} + /** Please see header for specification */ bool Anvil::Formats::get_compressed_format_block_size(Anvil::Format in_format, uint32_t* out_block_size_uvec2_ptr, diff --git a/src/misc/graphics_pipeline_create_info.cpp b/src/misc/graphics_pipeline_create_info.cpp index f93c6568..0498e32c 100644 --- a/src/misc/graphics_pipeline_create_info.cpp +++ b/src/misc/graphics_pipeline_create_info.cpp @@ -234,7 +234,7 @@ bool Anvil::GraphicsPipelineCreateInfo::copy_gfx_state_from(const Anvil::Graphic return result; } -Anvil::GraphicsPipelineCreateInfoUniquePtr Anvil::GraphicsPipelineCreateInfo::create(const Anvil::PipelineCreateFlags& in_create_flags, +Anvil::GraphicsPipelineCreateInfoUniquePtr Anvil::GraphicsPipelineCreateInfo::create(const Anvil::PipelineCreateFlags& in_create_flags, const RenderPass* in_renderpass_ptr, SubPassID in_subpass_id, const ShaderModuleStageEntryPoint& in_fragment_shader_stage_entrypoint_info, diff --git a/src/wrappers/image.cpp b/src/wrappers/image.cpp index c492bff2..f9586dae 100644 --- a/src/wrappers/image.cpp +++ b/src/wrappers/image.cpp @@ -485,44 +485,48 @@ bool Anvil::Image::init() queue_family_indices, &n_queue_family_indices); - /* Is the requested texture size valid? */ - if (!m_device_ptr->get_physical_device_image_format_properties(Anvil::ImageFormatPropertiesQuery(m_create_info_ptr->get_format (), - m_create_info_ptr->get_type (), - m_create_info_ptr->get_tiling (), - m_create_info_ptr->get_usage_flags (), - m_create_info_ptr->get_create_flags() ), - &image_format_props) ) + /* Images can be created with unsupported usages with EXTENDED_USAGE_BIT */ + if ((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::EXTENDED_USAGE_BIT) == 0) { - anvil_assert_fail(); + /* Is the requested texture size valid? */ + if (!m_device_ptr->get_physical_device_image_format_properties(Anvil::ImageFormatPropertiesQuery(m_create_info_ptr->get_format (), + m_create_info_ptr->get_type (), + m_create_info_ptr->get_tiling (), + m_create_info_ptr->get_usage_flags (), + m_create_info_ptr->get_create_flags() ), + &image_format_props)) + { + anvil_assert_fail(); - goto end; - } + goto end; + } - anvil_assert(m_create_info_ptr->get_base_mip_width() <= image_format_props.max_extent.width); + anvil_assert(m_create_info_ptr->get_base_mip_width() <= image_format_props.max_extent.width); - if (m_create_info_ptr->get_base_mip_height() > 1) - { - anvil_assert(m_create_info_ptr->get_base_mip_height() <= image_format_props.max_extent.height); - } + if (m_create_info_ptr->get_base_mip_height() > 1) + { + anvil_assert(m_create_info_ptr->get_base_mip_height() <= image_format_props.max_extent.height); + } - if (m_create_info_ptr->get_base_mip_depth() > 1) - { - anvil_assert(m_create_info_ptr->get_base_mip_depth() <= image_format_props.max_extent.depth); - } + if (m_create_info_ptr->get_base_mip_depth() > 1) + { + anvil_assert(m_create_info_ptr->get_base_mip_depth() <= image_format_props.max_extent.depth); + } - anvil_assert(m_create_info_ptr->get_n_layers() >= 1); + anvil_assert(m_create_info_ptr->get_n_layers() >= 1); - if (m_create_info_ptr->get_n_layers() > 1) - { - anvil_assert(m_create_info_ptr->get_n_layers() <= image_format_props.n_max_array_layers); - } + if (m_create_info_ptr->get_n_layers() > 1) + { + anvil_assert(m_create_info_ptr->get_n_layers() <= image_format_props.n_max_array_layers); + } - /* If multisample image is requested, make sure the number of samples is supported. */ - anvil_assert(m_create_info_ptr->get_sample_count() >= Anvil::SampleCountFlagBits::_1_BIT); + /* If multisample image is requested, make sure the number of samples is supported. */ + anvil_assert(m_create_info_ptr->get_sample_count() >= Anvil::SampleCountFlagBits::_1_BIT); - if (m_create_info_ptr->get_sample_count() > Anvil::SampleCountFlagBits::_1_BIT) - { - anvil_assert((image_format_props.sample_counts & m_create_info_ptr->get_sample_count() ) != 0); + if (m_create_info_ptr->get_sample_count() > Anvil::SampleCountFlagBits::_1_BIT) + { + anvil_assert((image_format_props.sample_counts & m_create_info_ptr->get_sample_count()) != 0); + } } /* Create the image object */ diff --git a/src/wrappers/image_view.cpp b/src/wrappers/image_view.cpp index 8ee374ff..ed603af0 100644 --- a/src/wrappers/image_view.cpp +++ b/src/wrappers/image_view.cpp @@ -54,7 +54,8 @@ Anvil::ImageView::ImageView(Anvil::ImageViewCreateInfoUniquePtr in_create_info_p :DebugMarkerSupportProvider(in_create_info_ptr->get_device(), VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT), MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), - in_create_info_ptr->get_device () )) + in_create_info_ptr->get_device () )), + m_image_view (VK_NULL_HANDLE) { m_create_info_ptr = std::move(in_create_info_ptr); From 806504af5effd97c7301ee49fc0aa326bcca4875 Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Sat, 27 Oct 2018 14:14:29 +0200 Subject: [PATCH 35/50] Fix a lock-up which could occur if: 1) Window thread T1 became temporarily unresponsive, waiting for T2 to finish 2) Thread T2 tried to create an Anvil window instance for window owned by T1. The lock-up occurred because GetWindowTextLength() actually maps to a window message which cannot be handled because T1 is waiting on T2. There's no real solution other than just getting rid of the circular dependency, meaning we need Anvil to stop trying to retrieve window name at Anvil::Window creation time. --- src/misc/window_win3264.cpp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/src/misc/window_win3264.cpp b/src/misc/window_win3264.cpp index 77d2977c..24ae41e4 100644 --- a/src/misc/window_win3264.cpp +++ b/src/misc/window_win3264.cpp @@ -88,12 +88,10 @@ Anvil::WindowUniquePtr Anvil::WindowWin3264::create(const std::string& /** Please see header for specification */ Anvil::WindowUniquePtr Anvil::WindowWin3264::create(HWND in_window_handle) { - WindowUniquePtr result_ptr(nullptr, - std::default_delete() ); - RECT window_rect; - uint32_t window_size[2] = {0}; - std::vector window_title; - uint32_t window_title_length = 0; + WindowUniquePtr result_ptr(nullptr, + std::default_delete() ); + RECT window_rect; + uint32_t window_size[2] = {0}; /* The window has already been spawned by the user. Gather all the info we need in order to instantiate * the wrapper instance. @@ -116,21 +114,10 @@ Anvil::WindowUniquePtr Anvil::WindowWin3264::create(HWND in_window_handle) window_size[0] = static_cast(window_rect.right - window_rect.left); window_size[1] = static_cast(window_rect.bottom - window_rect.top); - window_title_length = static_cast(::GetWindowTextLength(in_window_handle) ); - - if (window_title_length != 0) - { - window_title.resize(window_title_length); - - ::GetWindowText(in_window_handle, - static_cast(&window_title.at(0) ), - static_cast (window_title_length) ); - } - /* Go ahead and create the window wrapper instance */ result_ptr.reset( new Anvil::WindowWin3264(in_window_handle, - std::string(&window_title.at(0) ), + "HWND wrapper window instance", window_size[0], window_size[1], nullptr) /* present_callback_func_ptr */ From 02698847c2fd29b2ea67f608cbd7d8a8234b965a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sat, 27 Oct 2018 23:31:45 +0200 Subject: [PATCH 36/50] Make destructors virtual where needed A class with virtual methods should have virtual destructor --- include/wrappers/descriptor_set.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/wrappers/descriptor_set.h b/include/wrappers/descriptor_set.h index 14e106cb..964cae15 100644 --- a/include/wrappers/descriptor_set.h +++ b/include/wrappers/descriptor_set.h @@ -262,7 +262,7 @@ namespace Anvil * * Releases the embedded image view instance. **/ - ~ImageBindingElement(); + virtual ~ImageBindingElement(); /* Returns Vulkan descriptor type for this structure */ virtual Anvil::DescriptorType get_type() const = 0; @@ -385,7 +385,7 @@ namespace Anvil * * Releases the embedded buffer view instance. **/ - ~TexelBufferBindingElement(); + virtual ~TexelBufferBindingElement(); /** Copy assignment operator. * @@ -906,4 +906,4 @@ namespace Anvil }; }; -#endif /* WRAPPERS_DESCRIPTOR_SET_H */ \ No newline at end of file +#endif /* WRAPPERS_DESCRIPTOR_SET_H */ From 4d6b6a4b48ac602dc387e22648654b975b78bd2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 29 Oct 2018 23:04:42 +0100 Subject: [PATCH 37/50] Remove superfluous const from simple return types cf. https://isocpp.org/blog/2013/06/quick-q-should-i-return-a-const-value-stackoverflow --- include/misc/buffer_create_info.h | 4 ++-- include/misc/glsl_to_spirv.h | 2 +- include/misc/image_view_create_info.h | 6 +++--- include/misc/struct_chainer.h | 4 ++-- include/wrappers/command_buffer.h | 2 +- include/wrappers/framebuffer.h | 4 ++-- include/wrappers/image_view.h | 4 ++-- src/wrappers/framebuffer.cpp | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/misc/buffer_create_info.h b/include/misc/buffer_create_info.h index 4bcdc1ab..c2ca4bc1 100644 --- a/include/misc/buffer_create_info.h +++ b/include/misc/buffer_create_info.h @@ -104,7 +104,7 @@ namespace Anvil VkDeviceSize in_start_offset, VkDeviceSize in_size); - const void* const get_client_data() const + const void* get_client_data() const { return m_client_data_ptr; } @@ -287,4 +287,4 @@ namespace Anvil ANVIL_DISABLE_COPY_CONSTRUCTOR(BufferCreateInfo); }; }; /* namespace Anvil */ -#endif /* MISC_BUFFER_CREATE_INFO_H */ \ No newline at end of file +#endif /* MISC_BUFFER_CREATE_INFO_H */ diff --git a/include/misc/glsl_to_spirv.h b/include/misc/glsl_to_spirv.h index 41b70f15..fa9bfd28 100644 --- a/include/misc/glsl_to_spirv.h +++ b/include/misc/glsl_to_spirv.h @@ -305,7 +305,7 @@ namespace Anvil } /** Returns the number of bytes the SPIR-V blob, accessible via get_spirv_blob(), takes. */ - const uint32_t get_spirv_blob_size() const + uint32_t get_spirv_blob_size() const { if (m_spirv_blob.size() == 0) { diff --git a/include/misc/image_view_create_info.h b/include/misc/image_view_create_info.h index b4185566..435bc177 100644 --- a/include/misc/image_view_create_info.h +++ b/include/misc/image_view_create_info.h @@ -295,7 +295,7 @@ namespace Anvil } /** Returns image view's format */ - const Anvil::Format get_format() const + Anvil::Format get_format() const { return m_format; } @@ -330,7 +330,7 @@ namespace Anvil } /** Returns image view type of the image view instance */ - const Anvil::ImageViewType get_type() const + Anvil::ImageViewType get_type() const { return m_type; } @@ -443,4 +443,4 @@ namespace Anvil }; /* namespace Anvil */ -#endif/* MISC_IMAGE_VIEW_CREATE_INFO_H */ \ No newline at end of file +#endif/* MISC_IMAGE_VIEW_CREATE_INFO_H */ diff --git a/include/misc/struct_chainer.h b/include/misc/struct_chainer.h index cb465759..37030284 100644 --- a/include/misc/struct_chainer.h +++ b/include/misc/struct_chainer.h @@ -79,7 +79,7 @@ namespace Anvil struct_chain_ptrs.push_back(std::move(inout_struct_chain_ptr) ); } - const uint32_t get_n_structs() const + uint32_t get_n_structs() const { return static_cast(root_structs.size() ); } @@ -307,4 +307,4 @@ namespace Anvil }; }; -#endif /* MISC_STRUCT_CHAINER_H */ \ No newline at end of file +#endif /* MISC_STRUCT_CHAINER_H */ diff --git a/include/wrappers/command_buffer.h b/include/wrappers/command_buffer.h index c06ad5ed..e5f719a0 100644 --- a/include/wrappers/command_buffer.h +++ b/include/wrappers/command_buffer.h @@ -319,7 +319,7 @@ namespace Anvil } /** Returns a handle to the raw Vulkan command buffer instance, encapsulated by the object */ - const VkCommandBuffer get_command_buffer() const + VkCommandBuffer get_command_buffer() const { return m_command_buffer; } diff --git a/include/wrappers/framebuffer.h b/include/wrappers/framebuffer.h index 62ee8715..a9ecb6e6 100644 --- a/include/wrappers/framebuffer.h +++ b/include/wrappers/framebuffer.h @@ -60,7 +60,7 @@ namespace Anvil * * @return Raw Vulkan framebuffer handle or VK_NULL_HANDLE, if the function failed. **/ - const VkFramebuffer get_framebuffer(Anvil::RenderPass* in_render_pass_ptr); + VkFramebuffer get_framebuffer(Anvil::RenderPass* in_render_pass_ptr); private: /* Private type declarations */ @@ -111,4 +111,4 @@ namespace Anvil }; }; -#endif /* WRAPPERS_FRAMEBUFFER_H */ \ No newline at end of file +#endif /* WRAPPERS_FRAMEBUFFER_H */ diff --git a/include/wrappers/image_view.h b/include/wrappers/image_view.h index a4df4312..3a1e0ac2 100644 --- a/include/wrappers/image_view.h +++ b/include/wrappers/image_view.h @@ -65,7 +65,7 @@ namespace Anvil } /** Returns the encapsulated raw Vulkan image view handle. */ - const VkImageView get_image_view() const + VkImageView get_image_view() const { return m_image_view; } @@ -100,4 +100,4 @@ namespace Anvil }; }; -#endif /* WRAPPERS_IMAGE_VIEW_H */ \ No newline at end of file +#endif /* WRAPPERS_IMAGE_VIEW_H */ diff --git a/src/wrappers/framebuffer.cpp b/src/wrappers/framebuffer.cpp index 41db7847..3a99be00 100644 --- a/src/wrappers/framebuffer.cpp +++ b/src/wrappers/framebuffer.cpp @@ -202,7 +202,7 @@ Anvil::FramebufferUniquePtr Anvil::Framebuffer::create(Anvil::FramebufferCreateI } /* Please see header for specification */ -const VkFramebuffer Anvil::Framebuffer::get_framebuffer(Anvil::RenderPass* in_render_pass_ptr) +VkFramebuffer Anvil::Framebuffer::get_framebuffer(Anvil::RenderPass* in_render_pass_ptr) { auto fb_iterator = m_baked_framebuffers.find(in_render_pass_ptr); VkFramebuffer result_fb = VK_NULL_HANDLE; From 387f5487c0b3440ced65f6c18a595254c3c2113d Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Tue, 6 Nov 2018 12:01:45 +0100 Subject: [PATCH 38/50] Add support for VK_EXT_pci_bus_info Add support for YUV formats introduced by VK_KHR_sampler_ycbcr_conversion (no extension support has been added yet) Bug-fixes and improvements Update Vulkan headers to v1.1.91 --- include/misc/extensions.h | 11 +- include/misc/formats.h | 97 ++- include/misc/semaphore_create_info.h | 4 +- include/misc/types_enums.h | 46 ++ include/misc/types_struct.h | 15 + include/vulkan/vulkan.h | 10 +- include/vulkan/vulkan_core.h | 1048 +++++++++++++++++++++++++- include/vulkan/vulkan_fuchsia.h | 58 ++ include/vulkan/vulkan_mir.h | 65 -- include/wrappers/physical_device.h | 1 + include/wrappers/semaphore.h | 1 - src/misc/formats.cpp | 557 +++++++++++++- src/misc/semaphore_create_info.cpp | 5 +- src/misc/types_classes.cpp | 4 +- src/misc/types_struct.cpp | 44 +- src/misc/window_win3264.cpp | 4 +- src/wrappers/memory_block.cpp | 12 +- src/wrappers/physical_device.cpp | 43 +- src/wrappers/semaphore.cpp | 3 +- 19 files changed, 1912 insertions(+), 116 deletions(-) create mode 100644 include/vulkan/vulkan_fuchsia.h delete mode 100644 include/vulkan/vulkan_mir.h diff --git a/include/misc/extensions.h b/include/misc/extensions.h index 19ae7c7f..a2c12c20 100644 --- a/include/misc/extensions.h +++ b/include/misc/extensions.h @@ -51,6 +51,7 @@ namespace Anvil ValueType ext_debug_marker; ValueType ext_depth_range_unrestricted; ValueType ext_descriptor_indexing; + ValueType ext_pci_bus_info; ValueType ext_external_memory_host; ValueType ext_hdr_metadata; ValueType ext_sample_locations; @@ -138,6 +139,7 @@ namespace Anvil {ExtensionData(VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, &ext_descriptor_indexing)}, {ExtensionData(VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME, &ext_external_memory_host)}, {ExtensionData(VK_EXT_HDR_METADATA_EXTENSION_NAME, &ext_hdr_metadata)}, + {ExtensionData(VK_EXT_PCI_BUS_INFO_EXTENSION_NAME, &ext_pci_bus_info)}, {ExtensionData(VK_EXT_SAMPLE_LOCATIONS_EXTENSION_NAME, &ext_sample_locations)}, {ExtensionData(VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME, &ext_sampler_filter_minmax)}, {ExtensionData(VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME, &ext_shader_stencil_export)}, @@ -309,6 +311,7 @@ namespace Anvil virtual ValueType ext_descriptor_indexing () const = 0; virtual ValueType ext_external_memory_host () const = 0; virtual ValueType ext_hdr_metadata () const = 0; + virtual ValueType ext_pci_bus_info () const = 0; virtual ValueType ext_sample_locations () const = 0; virtual ValueType ext_sampler_filter_minmax () const = 0; virtual ValueType ext_shader_stencil_export () const = 0; @@ -615,6 +618,13 @@ namespace Anvil return m_device_extensions_ptr->ext_hdr_metadata; } + ValueType ext_pci_bus_info() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_pci_bus_info; + } + ValueType ext_sampler_filter_minmax() const final { anvil_assert(m_expose_device_extensions); @@ -918,7 +928,6 @@ namespace Anvil return m_instance_extensions_ptr->khr_surface; } - #ifdef _WIN32 #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) ValueType khr_win32_surface() const final diff --git a/include/misc/formats.h b/include/misc/formats.h index 4d08ad71..6d0e7b9d 100644 --- a/include/misc/formats.h +++ b/include/misc/formats.h @@ -91,6 +91,7 @@ namespace Anvil /** Returns bit layout for the specified format. * * NOTE: Only non-compressed formats are supported. + * NOTE: YUV KHR formats are NOT supported for this function. * NOTE: Components not used by the specified format have start and end bit indices set to UINT32_MAX. * * @param in_format Non-compressed format to use for the query. @@ -125,15 +126,39 @@ namespace Anvil uint32_t* out_opt_stencil_component_start_bit_index_ptr = nullptr, uint32_t* out_opt_stencil_component_end_bit_index_ptr = nullptr); - /** Tells what component layout is used by @param in_format. */ + /** Tells what component layout is used by @param in_format. + * + * NOTE: This function does NOT support YUV KHR format. Please check the overloaded function if + * you would like to use for YUV KHR format. + */ static ComponentLayout get_format_component_layout(Anvil::Format in_format); - /** Tells the number of components used by @param in_format */ + /** Tells what component layout is used by @param in_format at specified subresource @param in_aspect. + * + * NOTE: Only YUV KHR formats are supported. + */ + static ComponentLayout get_format_component_layout(Anvil::Format in_format, + Anvil::ImageAspectFlagBits in_aspect); + + /** Tells the number of components used by @param in_format + * + * NOTE: This function does NOT support YUV KHR format. Please check the overloaded function if + * you would like to use for YUV KHR format. + */ static uint32_t get_format_n_components(Anvil::Format in_format); + /** Tells the number of components used by @param in_format under specified subresource @param in_aspect. + * + * NOTE: Only YUV KHR formats are supported. + */ + static uint32_t get_format_n_components(Anvil::Format in_format, + Anvil::ImageAspectFlagBits in_aspect); + /* Tells the number of bits used for each component in case of Vulkan format specified * under @param in_format. * + * NOTE: This function does NOT support YUV KHR format. Please check the overloaded function if + * you would like to use for YUV KHR format. * NOTE: Number of bits reported for each component uses ordering as reported for the format * via get_format_component_layout(). This is especially important in the context of packed formats. * @@ -153,23 +178,87 @@ namespace Anvil uint32_t* out_channel2_bits_ptr, uint32_t* out_channel3_bits_ptr); + /* Tells the number of bits used for each component in case of Vulkan format specified + * under @param in_format at subresource @param in_aspect. + * + * NOTE: Only YUV KHR fromats are supported. + * NOTE: Number of bits reported for each component uses ordering as reported for the format + * via get_format_component_layout(). This is especially important in the context of packed formats. + * + * @param in_format Vulkan format to use for the query. + * @param out_channel0_bits_ptr Deref will be set to the number of bits used for channel 0. Must + * not be nullptr. + * @param out_channel1_bits_ptr Deref will be set to the number of bits used for channel 1. Must + * not be nullptr. + * @param out_channel2_bits_ptr Deref will be set to the number of bits used for channel 2. Must + * not be nullptr. + * @param out_channel3_bits_ptr Deref will be set to the number of bits used for channel 3. Must + * not be nullptr. + */ + static void get_format_n_component_bits(Anvil::Format in_format, + Anvil::ImageAspectFlagBits in_aspect, + uint32_t* out_channel0_bits_ptr, + uint32_t* out_channel1_bits_ptr, + uint32_t* out_channel2_bits_ptr, + uint32_t* out_channel3_bits_ptr); + /* Returns a raw C string for specified format, or NULL if the format is unknown. */ static const char* get_format_name(Anvil::Format in_format); /** Tells the format type used by @param in_format. */ static FormatType get_format_type(Anvil::Format in_format); - /** Tells whether @param in_format includes a depth aspect */ + /** Returns the extent of subresource @param in_aspect with specified format @param in_format. + * + * NOTE: Only YUV KHR formats are supported. + * + * @param in_format VUlkan format. + * @param in_aspect Image aspect for specific subresource of the format. + * @param in_image_extent Image extent specified when creating image. + * @param out_plane_extent_ptr Deref will be set to the extent of the specified subresource. + * Must not be nullptr. + */ + static void get_yuv_format_plane_extent(Anvil::Format in_format, + Anvil::ImageAspectFlagBits in_aspect, + VkExtent3D in_image_extent, + VkExtent3D* out_plane_extent_ptr); + /** Tells whether @param in_format includes a depth aspect. + * + * NOTE: YUV KHR formats are NOT supported. + */ static bool has_depth_aspect(Anvil::Format in_format); - /** Tells whether @param in_format includes a stencil aspect */ + /** Tells whether @param in_format includes a stencil aspect. + * + * NOTE: YUV KHR formats are NOT supported. + */ static bool has_stencil_aspect(Anvil::Format in_format); /** Tells whether @param in_format format is a block format. */ static bool is_format_compressed(Anvil::Format in_format); + /** Tells whether @param in_format format is a multiplanar format. */ + static bool is_format_multiplanar(Anvil::Format in_format); + + /** Tells whether @param in_format is a KHR YUV format */ + static bool is_format_yuv_khr(Anvil::Format in_format); + /** Tells whether @param in_format is a packed format */ static bool is_format_packed(Anvil::Format in_format); + + private: + /** Returns the index of subresource info by given @param in_format and @param in_aspect. + * + * NOTE: Only YUV KHR formats are supported. + */ + static uint32_t get_yuv_format_plane_index(Anvil::Format in_format, + Anvil::ImageAspectFlagBits in_aspect); + + /** Returns the number of subresources by given @param in_format. + * + * NOTE: Only YUV KHR formats are supported. + */ + static uint32_t get_yuv_format_n_planes(Anvil::Format in_format); }; }; diff --git a/include/misc/semaphore_create_info.h b/include/misc/semaphore_create_info.h index 2a42845d..ad8c3bb6 100644 --- a/include/misc/semaphore_create_info.h +++ b/include/misc/semaphore_create_info.h @@ -130,8 +130,8 @@ namespace Anvil private: /* Private functions */ - SemaphoreCreateInfo(const Anvil::BaseDevice* in_device_ptr, - MTSafety in_mt_safety); + SemaphoreCreateInfo(const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety); /* Private variables */ const Anvil::BaseDevice* m_device_ptr; diff --git a/include/misc/types_enums.h b/include/misc/types_enums.h index ca9a71fc..50b5d970 100644 --- a/include/misc/types_enums.h +++ b/include/misc/types_enums.h @@ -628,11 +628,16 @@ namespace Anvil /* NOTE: If the ordering used below needs to be changed, make sure to also update formats.cpp::layout_to_n_components */ ABGR, ARGB, + B, BGR, BGRA, + BGRG, + BR, D, DS, EBGR, + G, + GBGR, R, RG, RGB, @@ -966,6 +971,42 @@ namespace Anvil ASTC_12x12_UNORM_BLOCK = VK_FORMAT_ASTC_12x12_UNORM_BLOCK, ASTC_12x12_SRGB_BLOCK = VK_FORMAT_ASTC_12x12_SRGB_BLOCK, + /* VK_KHR_sampler_ycbcr_conversion */ + G8B8G8R8_422_UNORM = VK_FORMAT_G8B8G8R8_422_UNORM_KHR, + B8G8R8G8_422_UNORM = VK_FORMAT_B8G8R8G8_422_UNORM_KHR, + G8_B8_R8_3PLANE_420_UNORM = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR, + G8_B8R8_2PLANE_420_UNORM = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR, + G8_B8_R8_3PLANE_422_UNORM = VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR, + G8_B8R8_2PLANE_422_UNORM = VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR, + G8_B8_R8_3PLANE_444_UNORM = VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR, + R10X6_UNORM_PACK16 = VK_FORMAT_R10X6_UNORM_PACK16_KHR, + R10X6G10X6_UNORM_2PACK16 = VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR, + R10X6G10X6B10X6A10X6_UNORM_4PACK16 = VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR, + G10X6B10X6G10X6R10X6_422_UNORM_4PACK16 = VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR, + B10X6G10X6R10X6G10X6_422_UNORM_4PACK16 = VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR, + G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16 = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR, + G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR, + G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16 = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR, + G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16 = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR, + G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16 = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR, + R12X4_UNORM_PACK16 = VK_FORMAT_R12X4_UNORM_PACK16_KHR, + R12X4G12X4_UNORM_2PACK16 = VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR, + R12X4G12X4B12X4A12X4_UNORM_4PACK16 = VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR, + G12X4B12X4G12X4R12X4_422_UNORM_4PACK16 = VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR, + B12X4G12X4R12X4G12X4_422_UNORM_4PACK16 = VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR, + G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16 = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR, + G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16 = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR, + G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16 = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR, + G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16 = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR, + G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16 = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR, + G16B16G16R16_422_UNORM = VK_FORMAT_G16B16G16R16_422_UNORM_KHR, + B16G16R16G16_422_UNORM = VK_FORMAT_B16G16R16G16_422_UNORM_KHR, + G16_B16_R16_3PLANE_420_UNORM = VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR, + G16_B16R16_2PLANE_420_UNORM = VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR, + G16_B16_R16_3PLANE_422_UNORM = VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR, + G16_B16R16_2PLANE_422_UNORM = VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR, + G16_B16_R16_3PLANE_444_UNORM = VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR, + /* Other .. */ UNKNOWN = VK_FORMAT_UNDEFINED, }; @@ -1006,6 +1047,11 @@ namespace Anvil METADATA_BIT = VK_IMAGE_ASPECT_METADATA_BIT, STENCIL_BIT = VK_IMAGE_ASPECT_STENCIL_BIT, + /* VK_KHR_sampler_ycbcr_conversion aspects */ + PLANE_0_BIT = VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, + PLANE_1_BIT = VK_IMAGE_ASPECT_PLANE_1_BIT_KHR, + PLANE_2_BIT = VK_IMAGE_ASPECT_PLANE_2_BIT_KHR, + NONE = 0 }; typedef Anvil::Bitfield ImageAspectFlags; diff --git a/include/misc/types_struct.h b/include/misc/types_struct.h index af9e3b2c..48bbe87f 100644 --- a/include/misc/types_struct.h +++ b/include/misc/types_struct.h @@ -603,6 +603,19 @@ namespace Anvil bool operator==(const EXTExternalMemoryHostProperties& in_props) const; } EXTExternalMemoryHostProperties; + typedef struct EXTPCIBusInfoProperties + { + uint8_t pci_bus; + uint8_t pci_device; + uint16_t pci_domain; + uint8_t pci_function; + + EXTPCIBusInfoProperties(); + EXTPCIBusInfoProperties(const VkPhysicalDevicePCIBusInfoPropertiesEXT& in_props); + + bool operator==(const EXTPCIBusInfoProperties& in_props) const; + } EXTPCIBusInfoProperties; + typedef struct EXTSampleLocationsProperties { VkExtent2D max_sample_location_grid_size; @@ -2104,6 +2117,7 @@ namespace Anvil const PhysicalDevicePropertiesCoreVK10* core_vk1_0_properties_ptr; const EXTDescriptorIndexingProperties* ext_descriptor_indexing_properties_ptr; const EXTExternalMemoryHostProperties* ext_external_memory_host_properties_ptr; + const EXTPCIBusInfoProperties* ext_pci_bus_info_properties_ptr; const EXTSampleLocationsProperties* ext_sample_locations_properties_ptr; const EXTSamplerFilterMinmaxProperties* ext_sampler_filter_minmax_properties_ptr; const EXTVertexAttributeDivisorProperties* ext_vertex_attribute_divisor_properties_ptr; @@ -2117,6 +2131,7 @@ namespace Anvil const PhysicalDevicePropertiesCoreVK10* in_core_vk1_0_properties_ptr, const EXTDescriptorIndexingProperties* in_ext_descriptor_indexing_properties_ptr, const EXTExternalMemoryHostProperties* in_ext_external_memory_host_properties_ptr, + const EXTPCIBusInfoProperties* in_ext_pci_bus_info_properties_ptr, const EXTSampleLocationsProperties* in_ext_sample_locations_properties_ptr, const EXTSamplerFilterMinmaxProperties* in_ext_sampler_filter_minmax_properties_ptr, const EXTVertexAttributeDivisorProperties* in_ext_vertex_attribute_divisor_properties_ptr, diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h index d05c8490..77da6378 100644 --- a/include/vulkan/vulkan.h +++ b/include/vulkan/vulkan.h @@ -24,6 +24,10 @@ #include "vulkan_android.h" #endif +#ifdef VK_USE_PLATFORM_FUCHSIA +#include +#include "vulkan_fuchsia.h" +#endif #ifdef VK_USE_PLATFORM_IOS_MVK #include "vulkan_ios.h" @@ -35,12 +39,6 @@ #endif -#ifdef VK_USE_PLATFORM_MIR_KHR -#include -#include "vulkan_mir.h" -#endif - - #ifdef VK_USE_PLATFORM_VI_NN #include "vulkan_vi.h" #endif diff --git a/include/vulkan/vulkan_core.h b/include/vulkan/vulkan_core.h index d5110159..4cd8ed51 100644 --- a/include/vulkan/vulkan_core.h +++ b/include/vulkan/vulkan_core.h @@ -43,11 +43,10 @@ extern "C" { #define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) #define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff) // Version of this file -#define VK_HEADER_VERSION 82 +#define VK_HEADER_VERSION 91 #define VK_NULL_HANDLE 0 - #define VK_DEFINE_HANDLE(object) typedef struct object##_T* object; @@ -60,7 +59,6 @@ extern "C" { #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object; #endif #endif - typedef uint32_t VkFlags; @@ -147,6 +145,7 @@ typedef enum VkResult { VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001, VK_ERROR_VALIDATION_FAILED_EXT = -1000011001, VK_ERROR_INVALID_SHADER_NV = -1000012000, + VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT = -1000158000, VK_ERROR_FRAGMENTATION_EXT = -1000161000, VK_ERROR_NOT_PERMITTED_EXT = -1000174001, VK_ERROR_OUT_OF_POOL_MEMORY_KHR = VK_ERROR_OUT_OF_POOL_MEMORY, @@ -286,7 +285,6 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000, VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000, VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000, - VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000, VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000, VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000, VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000, @@ -297,7 +295,11 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000, VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001, VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT = 1000028000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT = 1000028001, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT = 1000028002, VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD = 1000041000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV = 1000050000, VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000, VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001, VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000, @@ -305,6 +307,8 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000, VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000, VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN = 1000062000, + VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT = 1000067000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT = 1000067001, VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR = 1000073000, VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR = 1000073001, VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR = 1000073002, @@ -380,6 +384,10 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID = 1000129005, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT = 1000130000, VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT = 1000130001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT = 1000138000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT = 1000138001, + VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT = 1000138002, + VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT = 1000138003, VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT = 1000143000, VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT = 1000143001, VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT = 1000143002, @@ -391,6 +399,12 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT = 1000148002, VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV = 1000149000, VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV = 1000152000, + VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT = 1000158000, + VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT = 1000158001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT = 1000158002, + VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT = 1000158003, + VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT = 1000158004, + VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT = 1000158005, VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160000, VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160001, VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT = 1000161000, @@ -398,16 +412,49 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT = 1000161002, VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT = 1000161003, VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT_EXT = 1000161004, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV = 1000164000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV = 1000164001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV = 1000164002, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV = 1000164005, + VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV = 1000165000, + VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV = 1000165001, + VK_STRUCTURE_TYPE_GEOMETRY_NV = 1000165003, + VK_STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV = 1000165004, + VK_STRUCTURE_TYPE_GEOMETRY_AABB_NV = 1000165005, + VK_STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV = 1000165006, + VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV = 1000165007, + VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV = 1000165008, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV = 1000165009, + VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV = 1000165011, + VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV = 1000165012, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV = 1000166000, + VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV = 1000166001, VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT = 1000174000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR = 1000177000, VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT = 1000178000, VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT = 1000178001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT = 1000178002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR = 1000180000, + VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT = 1000184000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD = 1000185000, + VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD = 1000189000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT = 1000190000, VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT = 1000190001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT = 1000190002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR = 1000196000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV = 1000201000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV = 1000202000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV = 1000202001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV = 1000203000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV = 1000204000, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV = 1000205000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV = 1000205002, VK_STRUCTURE_TYPE_CHECKPOINT_DATA_NV = 1000206000, VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV = 1000206001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR = 1000211000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT = 1000212000, + VK_STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA = 1000214000, + VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT, VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES, @@ -442,6 +489,7 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES, VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO, + VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT = VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO, VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES_KHR = VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES, VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO, @@ -774,6 +822,7 @@ typedef enum VkImageType { typedef enum VkImageTiling { VK_IMAGE_TILING_OPTIMAL = 0, VK_IMAGE_TILING_LINEAR = 1, + VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT = 1000158000, VK_IMAGE_TILING_BEGIN_RANGE = VK_IMAGE_TILING_OPTIMAL, VK_IMAGE_TILING_END_RANGE = VK_IMAGE_TILING_LINEAR, VK_IMAGE_TILING_RANGE_SIZE = (VK_IMAGE_TILING_LINEAR - VK_IMAGE_TILING_OPTIMAL + 1), @@ -796,6 +845,8 @@ typedef enum VkQueryType { VK_QUERY_TYPE_OCCLUSION = 0, VK_QUERY_TYPE_PIPELINE_STATISTICS = 1, VK_QUERY_TYPE_TIMESTAMP = 2, + VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT = 1000028004, + VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV = 1000165000, VK_QUERY_TYPE_BEGIN_RANGE = VK_QUERY_TYPE_OCCLUSION, VK_QUERY_TYPE_END_RANGE = VK_QUERY_TYPE_TIMESTAMP, VK_QUERY_TYPE_RANGE_SIZE = (VK_QUERY_TYPE_TIMESTAMP - VK_QUERY_TYPE_OCCLUSION + 1), @@ -825,6 +876,7 @@ typedef enum VkImageLayout { VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL = 1000117001, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002, VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR = 1000111000, + VK_IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV = 1000164003, VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_BEGIN_RANGE = VK_IMAGE_LAYOUT_UNDEFINED, @@ -1058,6 +1110,9 @@ typedef enum VkDynamicState { VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV = 1000087000, VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT = 1000099000, VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT = 1000143000, + VK_DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV = 1000164004, + VK_DYNAMIC_STATE_VIEWPORT_COARSE_SAMPLE_ORDER_NV = 1000164006, + VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_NV = 1000205001, VK_DYNAMIC_STATE_BEGIN_RANGE = VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_END_RANGE = VK_DYNAMIC_STATE_STENCIL_REFERENCE, VK_DYNAMIC_STATE_RANGE_SIZE = (VK_DYNAMIC_STATE_STENCIL_REFERENCE - VK_DYNAMIC_STATE_VIEWPORT + 1), @@ -1120,6 +1175,8 @@ typedef enum VkDescriptorType { VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 8, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 9, VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 10, + VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT = 1000138000, + VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV = 1000165000, VK_DESCRIPTOR_TYPE_BEGIN_RANGE = VK_DESCRIPTOR_TYPE_SAMPLER, VK_DESCRIPTOR_TYPE_END_RANGE = VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, VK_DESCRIPTOR_TYPE_RANGE_SIZE = (VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT - VK_DESCRIPTOR_TYPE_SAMPLER + 1), @@ -1148,6 +1205,7 @@ typedef enum VkAttachmentStoreOp { typedef enum VkPipelineBindPoint { VK_PIPELINE_BIND_POINT_GRAPHICS = 0, VK_PIPELINE_BIND_POINT_COMPUTE = 1, + VK_PIPELINE_BIND_POINT_RAY_TRACING_NV = 1000165000, VK_PIPELINE_BIND_POINT_BEGIN_RANGE = VK_PIPELINE_BIND_POINT_GRAPHICS, VK_PIPELINE_BIND_POINT_END_RANGE = VK_PIPELINE_BIND_POINT_COMPUTE, VK_PIPELINE_BIND_POINT_RANGE_SIZE = (VK_PIPELINE_BIND_POINT_COMPUTE - VK_PIPELINE_BIND_POINT_GRAPHICS + 1), @@ -1166,6 +1224,7 @@ typedef enum VkCommandBufferLevel { typedef enum VkIndexType { VK_INDEX_TYPE_UINT16 = 0, VK_INDEX_TYPE_UINT32 = 1, + VK_INDEX_TYPE_NONE_NV = 1000165000, VK_INDEX_TYPE_BEGIN_RANGE = VK_INDEX_TYPE_UINT16, VK_INDEX_TYPE_END_RANGE = VK_INDEX_TYPE_UINT32, VK_INDEX_TYPE_RANGE_SIZE = (VK_INDEX_TYPE_UINT32 - VK_INDEX_TYPE_UINT16 + 1), @@ -1219,6 +1278,7 @@ typedef enum VkObjectType { VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX = 1000086001, VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT = 1000128000, VK_OBJECT_TYPE_VALIDATION_CACHE_EXT = 1000160000, + VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV = 1000165000, VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR = VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE, VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR = VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION, VK_OBJECT_TYPE_BEGIN_RANGE = VK_OBJECT_TYPE_UNKNOWN, @@ -1286,6 +1346,7 @@ typedef enum VkImageUsageFlagBits { VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, + VK_IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV = 0x00000100, VK_IMAGE_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkImageUsageFlagBits; typedef VkFlags VkImageUsageFlags; @@ -1303,6 +1364,7 @@ typedef enum VkImageCreateFlagBits { VK_IMAGE_CREATE_EXTENDED_USAGE_BIT = 0x00000100, VK_IMAGE_CREATE_PROTECTED_BIT = 0x00000800, VK_IMAGE_CREATE_DISJOINT_BIT = 0x00000200, + VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV = 0x00002000, VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT = 0x00001000, VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT, VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT, @@ -1380,8 +1442,14 @@ typedef enum VkPipelineStageFlagBits { VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, + VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT = 0x01000000, VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT = 0x00040000, VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000, + VK_PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV = 0x00400000, + VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_NV = 0x00200000, + VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_NV = 0x02000000, + VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV = 0x00080000, + VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV = 0x00100000, VK_PIPELINE_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkPipelineStageFlagBits; typedef VkFlags VkPipelineStageFlags; @@ -1395,6 +1463,10 @@ typedef enum VkImageAspectFlagBits { VK_IMAGE_ASPECT_PLANE_0_BIT = 0x00000010, VK_IMAGE_ASPECT_PLANE_1_BIT = 0x00000020, VK_IMAGE_ASPECT_PLANE_2_BIT = 0x00000040, + VK_IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT = 0x00000080, + VK_IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT = 0x00000100, + VK_IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT = 0x00000200, + VK_IMAGE_ASPECT_MEMORY_PLANE_3_BIT_EXT = 0x00000400, VK_IMAGE_ASPECT_PLANE_0_BIT_KHR = VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR = VK_IMAGE_ASPECT_PLANE_1_BIT, VK_IMAGE_ASPECT_PLANE_2_BIT_KHR = VK_IMAGE_ASPECT_PLANE_2_BIT, @@ -1469,7 +1541,10 @@ typedef enum VkBufferUsageFlagBits { VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, + VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT = 0x00000800, + VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT = 0x00001000, VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT = 0x00000200, + VK_BUFFER_USAGE_RAY_TRACING_BIT_NV = 0x00000400, VK_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkBufferUsageFlagBits; typedef VkFlags VkBufferUsageFlags; @@ -1484,6 +1559,7 @@ typedef enum VkPipelineCreateFlagBits { VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004, VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT = 0x00000008, VK_PIPELINE_CREATE_DISPATCH_BASE = 0x00000010, + VK_PIPELINE_CREATE_DEFER_COMPILE_BIT_NV = 0x00000020, VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHR = VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT, VK_PIPELINE_CREATE_DISPATCH_BASE_KHR = VK_PIPELINE_CREATE_DISPATCH_BASE, VK_PIPELINE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF @@ -1500,6 +1576,14 @@ typedef enum VkShaderStageFlagBits { VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020, VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F, VK_SHADER_STAGE_ALL = 0x7FFFFFFF, + VK_SHADER_STAGE_RAYGEN_BIT_NV = 0x00000100, + VK_SHADER_STAGE_ANY_HIT_BIT_NV = 0x00000200, + VK_SHADER_STAGE_CLOSEST_HIT_BIT_NV = 0x00000400, + VK_SHADER_STAGE_MISS_BIT_NV = 0x00000800, + VK_SHADER_STAGE_INTERSECTION_BIT_NV = 0x00001000, + VK_SHADER_STAGE_CALLABLE_BIT_NV = 0x00002000, + VK_SHADER_STAGE_TASK_BIT_NV = 0x00000040, + VK_SHADER_STAGE_MESH_BIT_NV = 0x00000080, VK_SHADER_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkShaderStageFlagBits; typedef VkFlags VkPipelineVertexInputStateCreateFlags; @@ -1581,10 +1665,16 @@ typedef enum VkAccessFlagBits { VK_ACCESS_HOST_WRITE_BIT = 0x00004000, VK_ACCESS_MEMORY_READ_BIT = 0x00008000, VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000, + VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT = 0x02000000, + VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT = 0x04000000, + VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT = 0x08000000, VK_ACCESS_CONDITIONAL_RENDERING_READ_BIT_EXT = 0x00100000, VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000, VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000, VK_ACCESS_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT = 0x00080000, + VK_ACCESS_SHADING_RATE_IMAGE_READ_BIT_NV = 0x00800000, + VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_NV = 0x00200000, + VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_NV = 0x00400000, VK_ACCESS_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkAccessFlagBits; typedef VkFlags VkAccessFlags; @@ -4051,6 +4141,8 @@ typedef struct VkMemoryRequirements2 { VkMemoryRequirements memoryRequirements; } VkMemoryRequirements2; +typedef VkMemoryRequirements2 VkMemoryRequirements2KHR; + typedef struct VkSparseImageMemoryRequirements2 { VkStructureType sType; void* pNext; @@ -4575,7 +4667,6 @@ VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) #define VK_KHR_SURFACE_SPEC_VERSION 25 #define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface" -#define VK_COLORSPACE_SRGB_NONLINEAR_KHR VK_COLOR_SPACE_SRGB_NONLINEAR_KHR typedef enum VkColorSpaceKHR { @@ -4594,6 +4685,7 @@ typedef enum VkColorSpaceKHR { VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT = 1000104012, VK_COLOR_SPACE_PASS_THROUGH_EXT = 1000104013, VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT = 1000104014, + VK_COLORSPACE_SRGB_NONLINEAR_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, VK_COLOR_SPACE_BEGIN_RANGE_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, VK_COLOR_SPACE_END_RANGE_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, VK_COLOR_SPACE_RANGE_SIZE_KHR = (VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - VK_COLOR_SPACE_SRGB_NONLINEAR_KHR + 1), @@ -5815,8 +5907,6 @@ typedef VkImageMemoryRequirementsInfo2 VkImageMemoryRequirementsInfo2KHR; typedef VkImageSparseMemoryRequirementsInfo2 VkImageSparseMemoryRequirementsInfo2KHR; -typedef VkMemoryRequirements2 VkMemoryRequirements2KHR; - typedef VkSparseImageMemoryRequirements2 VkSparseImageMemoryRequirements2KHR; @@ -5981,13 +6071,78 @@ typedef struct VkPhysicalDevice8BitStorageFeaturesKHR { +#define VK_KHR_shader_atomic_int64 1 +#define VK_KHR_SHADER_ATOMIC_INT64_SPEC_VERSION 1 +#define VK_KHR_SHADER_ATOMIC_INT64_EXTENSION_NAME "VK_KHR_shader_atomic_int64" + +typedef struct VkPhysicalDeviceShaderAtomicInt64FeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 shaderBufferInt64Atomics; + VkBool32 shaderSharedInt64Atomics; +} VkPhysicalDeviceShaderAtomicInt64FeaturesKHR; + + + +#define VK_KHR_driver_properties 1 +#define VK_MAX_DRIVER_NAME_SIZE_KHR 256 +#define VK_MAX_DRIVER_INFO_SIZE_KHR 256 +#define VK_KHR_DRIVER_PROPERTIES_SPEC_VERSION 1 +#define VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME "VK_KHR_driver_properties" + + +typedef enum VkDriverIdKHR { + VK_DRIVER_ID_AMD_PROPRIETARY_KHR = 1, + VK_DRIVER_ID_AMD_OPEN_SOURCE_KHR = 2, + VK_DRIVER_ID_MESA_RADV_KHR = 3, + VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR = 4, + VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS_KHR = 5, + VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA_KHR = 6, + VK_DRIVER_ID_IMAGINATION_PROPRIETARY_KHR = 7, + VK_DRIVER_ID_QUALCOMM_PROPRIETARY_KHR = 8, + VK_DRIVER_ID_ARM_PROPRIETARY_KHR = 9, + VK_DRIVER_ID_BEGIN_RANGE_KHR = VK_DRIVER_ID_AMD_PROPRIETARY_KHR, + VK_DRIVER_ID_END_RANGE_KHR = VK_DRIVER_ID_ARM_PROPRIETARY_KHR, + VK_DRIVER_ID_RANGE_SIZE_KHR = (VK_DRIVER_ID_ARM_PROPRIETARY_KHR - VK_DRIVER_ID_AMD_PROPRIETARY_KHR + 1), + VK_DRIVER_ID_MAX_ENUM_KHR = 0x7FFFFFFF +} VkDriverIdKHR; + +typedef struct VkConformanceVersionKHR { + uint8_t major; + uint8_t minor; + uint8_t subminor; + uint8_t patch; +} VkConformanceVersionKHR; + +typedef struct VkPhysicalDeviceDriverPropertiesKHR { + VkStructureType sType; + void* pNext; + VkDriverIdKHR driverID; + char driverName[VK_MAX_DRIVER_NAME_SIZE_KHR]; + char driverInfo[VK_MAX_DRIVER_INFO_SIZE_KHR]; + VkConformanceVersionKHR conformanceVersion; +} VkPhysicalDeviceDriverPropertiesKHR; + + + +#define VK_KHR_vulkan_memory_model 1 +#define VK_KHR_VULKAN_MEMORY_MODEL_SPEC_VERSION 2 +#define VK_KHR_VULKAN_MEMORY_MODEL_EXTENSION_NAME "VK_KHR_vulkan_memory_model" + +typedef struct VkPhysicalDeviceVulkanMemoryModelFeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 vulkanMemoryModel; + VkBool32 vulkanMemoryModelDeviceScope; +} VkPhysicalDeviceVulkanMemoryModelFeaturesKHR; + + + #define VK_EXT_debug_report 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) #define VK_EXT_DEBUG_REPORT_SPEC_VERSION 9 #define VK_EXT_DEBUG_REPORT_EXTENSION_NAME "VK_EXT_debug_report" -#define VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT -#define VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT typedef enum VkDebugReportObjectTypeEXT { @@ -6027,6 +6182,9 @@ typedef enum VkDebugReportObjectTypeEXT { VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT = 33, VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT = 1000156000, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT = 1000085000, + VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT = 1000165000, + VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_BEGIN_RANGE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, @@ -6226,6 +6384,95 @@ typedef struct VkDedicatedAllocationMemoryAllocateInfoNV { +#define VK_EXT_transform_feedback 1 +#define VK_EXT_TRANSFORM_FEEDBACK_SPEC_VERSION 1 +#define VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME "VK_EXT_transform_feedback" + +typedef VkFlags VkPipelineRasterizationStateStreamCreateFlagsEXT; + +typedef struct VkPhysicalDeviceTransformFeedbackFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 transformFeedback; + VkBool32 geometryStreams; +} VkPhysicalDeviceTransformFeedbackFeaturesEXT; + +typedef struct VkPhysicalDeviceTransformFeedbackPropertiesEXT { + VkStructureType sType; + void* pNext; + uint32_t maxTransformFeedbackStreams; + uint32_t maxTransformFeedbackBuffers; + VkDeviceSize maxTransformFeedbackBufferSize; + uint32_t maxTransformFeedbackStreamDataSize; + uint32_t maxTransformFeedbackBufferDataSize; + uint32_t maxTransformFeedbackBufferDataStride; + VkBool32 transformFeedbackQueries; + VkBool32 transformFeedbackStreamsLinesTriangles; + VkBool32 transformFeedbackRasterizationStreamSelect; + VkBool32 transformFeedbackDraw; +} VkPhysicalDeviceTransformFeedbackPropertiesEXT; + +typedef struct VkPipelineRasterizationStateStreamCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkPipelineRasterizationStateStreamCreateFlagsEXT flags; + uint32_t rasterizationStream; +} VkPipelineRasterizationStateStreamCreateInfoEXT; + + +typedef void (VKAPI_PTR *PFN_vkCmdBindTransformFeedbackBuffersEXT)(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes); +typedef void (VKAPI_PTR *PFN_vkCmdBeginTransformFeedbackEXT)(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets); +typedef void (VKAPI_PTR *PFN_vkCmdEndTransformFeedbackEXT)(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets); +typedef void (VKAPI_PTR *PFN_vkCmdBeginQueryIndexedEXT)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags, uint32_t index); +typedef void (VKAPI_PTR *PFN_vkCmdEndQueryIndexedEXT)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, uint32_t index); +typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirectByteCountEXT)(VkCommandBuffer commandBuffer, uint32_t instanceCount, uint32_t firstInstance, VkBuffer counterBuffer, VkDeviceSize counterBufferOffset, uint32_t counterOffset, uint32_t vertexStride); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdBindTransformFeedbackBuffersEXT( + VkCommandBuffer commandBuffer, + uint32_t firstBinding, + uint32_t bindingCount, + const VkBuffer* pBuffers, + const VkDeviceSize* pOffsets, + const VkDeviceSize* pSizes); + +VKAPI_ATTR void VKAPI_CALL vkCmdBeginTransformFeedbackEXT( + VkCommandBuffer commandBuffer, + uint32_t firstCounterBuffer, + uint32_t counterBufferCount, + const VkBuffer* pCounterBuffers, + const VkDeviceSize* pCounterBufferOffsets); + +VKAPI_ATTR void VKAPI_CALL vkCmdEndTransformFeedbackEXT( + VkCommandBuffer commandBuffer, + uint32_t firstCounterBuffer, + uint32_t counterBufferCount, + const VkBuffer* pCounterBuffers, + const VkDeviceSize* pCounterBufferOffsets); + +VKAPI_ATTR void VKAPI_CALL vkCmdBeginQueryIndexedEXT( + VkCommandBuffer commandBuffer, + VkQueryPool queryPool, + uint32_t query, + VkQueryControlFlags flags, + uint32_t index); + +VKAPI_ATTR void VKAPI_CALL vkCmdEndQueryIndexedEXT( + VkCommandBuffer commandBuffer, + VkQueryPool queryPool, + uint32_t query, + uint32_t index); + +VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirectByteCountEXT( + VkCommandBuffer commandBuffer, + uint32_t instanceCount, + uint32_t firstInstance, + VkBuffer counterBuffer, + VkDeviceSize counterBufferOffset, + uint32_t counterOffset, + uint32_t vertexStride); +#endif + #define VK_AMD_draw_indirect_count 1 #define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 1 #define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count" @@ -6331,6 +6578,18 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetShaderInfoAMD( #define VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_EXTENSION_NAME "VK_AMD_shader_image_load_store_lod" +#define VK_NV_corner_sampled_image 1 +#define VK_NV_CORNER_SAMPLED_IMAGE_SPEC_VERSION 2 +#define VK_NV_CORNER_SAMPLED_IMAGE_EXTENSION_NAME "VK_NV_corner_sampled_image" + +typedef struct VkPhysicalDeviceCornerSampledImageFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 cornerSampledImage; +} VkPhysicalDeviceCornerSampledImageFeaturesNV; + + + #define VK_IMG_format_pvrtc 1 #define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1 #define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc" @@ -6431,6 +6690,24 @@ typedef struct VkValidationFlagsEXT { #define VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME "VK_EXT_shader_subgroup_vote" +#define VK_EXT_astc_decode_mode 1 +#define VK_EXT_ASTC_DECODE_MODE_SPEC_VERSION 1 +#define VK_EXT_ASTC_DECODE_MODE_EXTENSION_NAME "VK_EXT_astc_decode_mode" + +typedef struct VkImageViewASTCDecodeModeEXT { + VkStructureType sType; + const void* pNext; + VkFormat decodeMode; +} VkImageViewASTCDecodeModeEXT; + +typedef struct VkPhysicalDeviceASTCDecodeFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 decodeModeSharedExponent; +} VkPhysicalDeviceASTCDecodeFeaturesEXT; + + + #define VK_EXT_conditional_rendering 1 #define VK_EXT_CONDITIONAL_RENDERING_SPEC_VERSION 1 #define VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME "VK_EXT_conditional_rendering" @@ -6746,7 +7023,6 @@ VKAPI_ATTR VkResult VKAPI_CALL vkReleaseDisplayEXT( #define VK_EXT_display_surface_counter 1 #define VK_EXT_DISPLAY_SURFACE_COUNTER_SPEC_VERSION 1 #define VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME "VK_EXT_display_surface_counter" -#define VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT typedef enum VkSurfaceCounterFlagBitsEXT { @@ -7179,7 +7455,7 @@ typedef struct VkDebugUtilsMessengerCallbackDataEXT { typedef VkBool32 (VKAPI_PTR *PFN_vkDebugUtilsMessengerCallbackEXT)( VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, - VkDebugUtilsMessageTypeFlagsEXT messageType, + VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, void* pUserData); @@ -7300,6 +7576,42 @@ typedef struct VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT { #define VK_AMD_SHADER_FRAGMENT_MASK_EXTENSION_NAME "VK_AMD_shader_fragment_mask" +#define VK_EXT_inline_uniform_block 1 +#define VK_EXT_INLINE_UNIFORM_BLOCK_SPEC_VERSION 1 +#define VK_EXT_INLINE_UNIFORM_BLOCK_EXTENSION_NAME "VK_EXT_inline_uniform_block" + +typedef struct VkPhysicalDeviceInlineUniformBlockFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 inlineUniformBlock; + VkBool32 descriptorBindingInlineUniformBlockUpdateAfterBind; +} VkPhysicalDeviceInlineUniformBlockFeaturesEXT; + +typedef struct VkPhysicalDeviceInlineUniformBlockPropertiesEXT { + VkStructureType sType; + void* pNext; + uint32_t maxInlineUniformBlockSize; + uint32_t maxPerStageDescriptorInlineUniformBlocks; + uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks; + uint32_t maxDescriptorSetInlineUniformBlocks; + uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks; +} VkPhysicalDeviceInlineUniformBlockPropertiesEXT; + +typedef struct VkWriteDescriptorSetInlineUniformBlockEXT { + VkStructureType sType; + const void* pNext; + uint32_t dataSize; + const void* pData; +} VkWriteDescriptorSetInlineUniformBlockEXT; + +typedef struct VkDescriptorPoolInlineUniformBlockCreateInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t maxInlineUniformBlockBindings; +} VkDescriptorPoolInlineUniformBlockCreateInfoEXT; + + + #define VK_EXT_shader_stencil_export 1 #define VK_EXT_SHADER_STENCIL_EXPORT_SPEC_VERSION 1 #define VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME "VK_EXT_shader_stencil_export" @@ -7478,12 +7790,70 @@ typedef struct VkPipelineCoverageModulationStateCreateInfoNV { #define VK_EXT_POST_DEPTH_COVERAGE_EXTENSION_NAME "VK_EXT_post_depth_coverage" +#define VK_EXT_image_drm_format_modifier 1 +#define VK_EXT_EXTENSION_159_SPEC_VERSION 0 +#define VK_EXT_EXTENSION_159_EXTENSION_NAME "VK_EXT_extension_159" +#define VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_SPEC_VERSION 1 +#define VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME "VK_EXT_image_drm_format_modifier" + +typedef struct VkDrmFormatModifierPropertiesEXT { + uint64_t drmFormatModifier; + uint32_t drmFormatModifierPlaneCount; + VkFormatFeatureFlags drmFormatModifierTilingFeatures; +} VkDrmFormatModifierPropertiesEXT; + +typedef struct VkDrmFormatModifierPropertiesListEXT { + VkStructureType sType; + void* pNext; + uint32_t drmFormatModifierCount; + VkDrmFormatModifierPropertiesEXT* pDrmFormatModifierProperties; +} VkDrmFormatModifierPropertiesListEXT; + +typedef struct VkPhysicalDeviceImageDrmFormatModifierInfoEXT { + VkStructureType sType; + const void* pNext; + uint64_t drmFormatModifier; + VkSharingMode sharingMode; + uint32_t queueFamilyIndexCount; + const uint32_t* pQueueFamilyIndices; +} VkPhysicalDeviceImageDrmFormatModifierInfoEXT; + +typedef struct VkImageDrmFormatModifierListCreateInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t drmFormatModifierCount; + const uint64_t* pDrmFormatModifiers; +} VkImageDrmFormatModifierListCreateInfoEXT; + +typedef struct VkImageDrmFormatModifierExplicitCreateInfoEXT { + VkStructureType sType; + const void* pNext; + uint64_t drmFormatModifier; + uint32_t drmFormatModifierPlaneCount; + const VkSubresourceLayout* pPlaneLayouts; +} VkImageDrmFormatModifierExplicitCreateInfoEXT; + +typedef struct VkImageDrmFormatModifierPropertiesEXT { + VkStructureType sType; + void* pNext; + uint64_t drmFormatModifier; +} VkImageDrmFormatModifierPropertiesEXT; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetImageDrmFormatModifierPropertiesEXT)(VkDevice device, VkImage image, VkImageDrmFormatModifierPropertiesEXT* pProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetImageDrmFormatModifierPropertiesEXT( + VkDevice device, + VkImage image, + VkImageDrmFormatModifierPropertiesEXT* pProperties); +#endif + #define VK_EXT_validation_cache 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkValidationCacheEXT) #define VK_EXT_VALIDATION_CACHE_SPEC_VERSION 1 #define VK_EXT_VALIDATION_CACHE_EXTENSION_NAME "VK_EXT_validation_cache" -#define VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT typedef enum VkValidationCacheHeaderVersionEXT { @@ -7635,6 +8005,436 @@ typedef struct VkDescriptorSetVariableDescriptorCountLayoutSupportEXT { #define VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME "VK_EXT_shader_viewport_index_layer" +#define VK_NV_shading_rate_image 1 +#define VK_NV_SHADING_RATE_IMAGE_SPEC_VERSION 3 +#define VK_NV_SHADING_RATE_IMAGE_EXTENSION_NAME "VK_NV_shading_rate_image" + + +typedef enum VkShadingRatePaletteEntryNV { + VK_SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV = 0, + VK_SHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV = 1, + VK_SHADING_RATE_PALETTE_ENTRY_8_INVOCATIONS_PER_PIXEL_NV = 2, + VK_SHADING_RATE_PALETTE_ENTRY_4_INVOCATIONS_PER_PIXEL_NV = 3, + VK_SHADING_RATE_PALETTE_ENTRY_2_INVOCATIONS_PER_PIXEL_NV = 4, + VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_PIXEL_NV = 5, + VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X1_PIXELS_NV = 6, + VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_1X2_PIXELS_NV = 7, + VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X2_PIXELS_NV = 8, + VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X2_PIXELS_NV = 9, + VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X4_PIXELS_NV = 10, + VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV = 11, + VK_SHADING_RATE_PALETTE_ENTRY_BEGIN_RANGE_NV = VK_SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV, + VK_SHADING_RATE_PALETTE_ENTRY_END_RANGE_NV = VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV, + VK_SHADING_RATE_PALETTE_ENTRY_RANGE_SIZE_NV = (VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV - VK_SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV + 1), + VK_SHADING_RATE_PALETTE_ENTRY_MAX_ENUM_NV = 0x7FFFFFFF +} VkShadingRatePaletteEntryNV; + +typedef enum VkCoarseSampleOrderTypeNV { + VK_COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV = 0, + VK_COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV = 1, + VK_COARSE_SAMPLE_ORDER_TYPE_PIXEL_MAJOR_NV = 2, + VK_COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV = 3, + VK_COARSE_SAMPLE_ORDER_TYPE_BEGIN_RANGE_NV = VK_COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV, + VK_COARSE_SAMPLE_ORDER_TYPE_END_RANGE_NV = VK_COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV, + VK_COARSE_SAMPLE_ORDER_TYPE_RANGE_SIZE_NV = (VK_COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV - VK_COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV + 1), + VK_COARSE_SAMPLE_ORDER_TYPE_MAX_ENUM_NV = 0x7FFFFFFF +} VkCoarseSampleOrderTypeNV; + +typedef struct VkShadingRatePaletteNV { + uint32_t shadingRatePaletteEntryCount; + const VkShadingRatePaletteEntryNV* pShadingRatePaletteEntries; +} VkShadingRatePaletteNV; + +typedef struct VkPipelineViewportShadingRateImageStateCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkBool32 shadingRateImageEnable; + uint32_t viewportCount; + const VkShadingRatePaletteNV* pShadingRatePalettes; +} VkPipelineViewportShadingRateImageStateCreateInfoNV; + +typedef struct VkPhysicalDeviceShadingRateImageFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 shadingRateImage; + VkBool32 shadingRateCoarseSampleOrder; +} VkPhysicalDeviceShadingRateImageFeaturesNV; + +typedef struct VkPhysicalDeviceShadingRateImagePropertiesNV { + VkStructureType sType; + void* pNext; + VkExtent2D shadingRateTexelSize; + uint32_t shadingRatePaletteSize; + uint32_t shadingRateMaxCoarseSamples; +} VkPhysicalDeviceShadingRateImagePropertiesNV; + +typedef struct VkCoarseSampleLocationNV { + uint32_t pixelX; + uint32_t pixelY; + uint32_t sample; +} VkCoarseSampleLocationNV; + +typedef struct VkCoarseSampleOrderCustomNV { + VkShadingRatePaletteEntryNV shadingRate; + uint32_t sampleCount; + uint32_t sampleLocationCount; + const VkCoarseSampleLocationNV* pSampleLocations; +} VkCoarseSampleOrderCustomNV; + +typedef struct VkPipelineViewportCoarseSampleOrderStateCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkCoarseSampleOrderTypeNV sampleOrderType; + uint32_t customSampleOrderCount; + const VkCoarseSampleOrderCustomNV* pCustomSampleOrders; +} VkPipelineViewportCoarseSampleOrderStateCreateInfoNV; + + +typedef void (VKAPI_PTR *PFN_vkCmdBindShadingRateImageNV)(VkCommandBuffer commandBuffer, VkImageView imageView, VkImageLayout imageLayout); +typedef void (VKAPI_PTR *PFN_vkCmdSetViewportShadingRatePaletteNV)(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkShadingRatePaletteNV* pShadingRatePalettes); +typedef void (VKAPI_PTR *PFN_vkCmdSetCoarseSampleOrderNV)(VkCommandBuffer commandBuffer, VkCoarseSampleOrderTypeNV sampleOrderType, uint32_t customSampleOrderCount, const VkCoarseSampleOrderCustomNV* pCustomSampleOrders); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdBindShadingRateImageNV( + VkCommandBuffer commandBuffer, + VkImageView imageView, + VkImageLayout imageLayout); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetViewportShadingRatePaletteNV( + VkCommandBuffer commandBuffer, + uint32_t firstViewport, + uint32_t viewportCount, + const VkShadingRatePaletteNV* pShadingRatePalettes); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetCoarseSampleOrderNV( + VkCommandBuffer commandBuffer, + VkCoarseSampleOrderTypeNV sampleOrderType, + uint32_t customSampleOrderCount, + const VkCoarseSampleOrderCustomNV* pCustomSampleOrders); +#endif + +#define VK_NV_ray_tracing 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkAccelerationStructureNV) + +#define VK_NV_RAY_TRACING_SPEC_VERSION 2 +#define VK_NV_RAY_TRACING_EXTENSION_NAME "VK_NV_ray_tracing" +#define VK_SHADER_UNUSED_NV (~0U) + + +typedef enum VkRayTracingShaderGroupTypeNV { + VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV = 0, + VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_NV = 1, + VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV = 2, + VK_RAY_TRACING_SHADER_GROUP_TYPE_BEGIN_RANGE_NV = VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV, + VK_RAY_TRACING_SHADER_GROUP_TYPE_END_RANGE_NV = VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV, + VK_RAY_TRACING_SHADER_GROUP_TYPE_RANGE_SIZE_NV = (VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV - VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV + 1), + VK_RAY_TRACING_SHADER_GROUP_TYPE_MAX_ENUM_NV = 0x7FFFFFFF +} VkRayTracingShaderGroupTypeNV; + +typedef enum VkGeometryTypeNV { + VK_GEOMETRY_TYPE_TRIANGLES_NV = 0, + VK_GEOMETRY_TYPE_AABBS_NV = 1, + VK_GEOMETRY_TYPE_BEGIN_RANGE_NV = VK_GEOMETRY_TYPE_TRIANGLES_NV, + VK_GEOMETRY_TYPE_END_RANGE_NV = VK_GEOMETRY_TYPE_AABBS_NV, + VK_GEOMETRY_TYPE_RANGE_SIZE_NV = (VK_GEOMETRY_TYPE_AABBS_NV - VK_GEOMETRY_TYPE_TRIANGLES_NV + 1), + VK_GEOMETRY_TYPE_MAX_ENUM_NV = 0x7FFFFFFF +} VkGeometryTypeNV; + +typedef enum VkAccelerationStructureTypeNV { + VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_NV = 0, + VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NV = 1, + VK_ACCELERATION_STRUCTURE_TYPE_BEGIN_RANGE_NV = VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_NV, + VK_ACCELERATION_STRUCTURE_TYPE_END_RANGE_NV = VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NV, + VK_ACCELERATION_STRUCTURE_TYPE_RANGE_SIZE_NV = (VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NV - VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_NV + 1), + VK_ACCELERATION_STRUCTURE_TYPE_MAX_ENUM_NV = 0x7FFFFFFF +} VkAccelerationStructureTypeNV; + +typedef enum VkCopyAccelerationStructureModeNV { + VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_NV = 0, + VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_NV = 1, + VK_COPY_ACCELERATION_STRUCTURE_MODE_BEGIN_RANGE_NV = VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_NV, + VK_COPY_ACCELERATION_STRUCTURE_MODE_END_RANGE_NV = VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_NV, + VK_COPY_ACCELERATION_STRUCTURE_MODE_RANGE_SIZE_NV = (VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_NV - VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_NV + 1), + VK_COPY_ACCELERATION_STRUCTURE_MODE_MAX_ENUM_NV = 0x7FFFFFFF +} VkCopyAccelerationStructureModeNV; + +typedef enum VkAccelerationStructureMemoryRequirementsTypeNV { + VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV = 0, + VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV = 1, + VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV = 2, + VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BEGIN_RANGE_NV = VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV, + VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_END_RANGE_NV = VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV, + VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_RANGE_SIZE_NV = (VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV - VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV + 1), + VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_MAX_ENUM_NV = 0x7FFFFFFF +} VkAccelerationStructureMemoryRequirementsTypeNV; + + +typedef enum VkGeometryFlagBitsNV { + VK_GEOMETRY_OPAQUE_BIT_NV = 0x00000001, + VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_NV = 0x00000002, + VK_GEOMETRY_FLAG_BITS_MAX_ENUM_NV = 0x7FFFFFFF +} VkGeometryFlagBitsNV; +typedef VkFlags VkGeometryFlagsNV; + +typedef enum VkGeometryInstanceFlagBitsNV { + VK_GEOMETRY_INSTANCE_TRIANGLE_CULL_DISABLE_BIT_NV = 0x00000001, + VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_NV = 0x00000002, + VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_NV = 0x00000004, + VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_NV = 0x00000008, + VK_GEOMETRY_INSTANCE_FLAG_BITS_MAX_ENUM_NV = 0x7FFFFFFF +} VkGeometryInstanceFlagBitsNV; +typedef VkFlags VkGeometryInstanceFlagsNV; + +typedef enum VkBuildAccelerationStructureFlagBitsNV { + VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_NV = 0x00000001, + VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_NV = 0x00000002, + VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_NV = 0x00000004, + VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_NV = 0x00000008, + VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_NV = 0x00000010, + VK_BUILD_ACCELERATION_STRUCTURE_FLAG_BITS_MAX_ENUM_NV = 0x7FFFFFFF +} VkBuildAccelerationStructureFlagBitsNV; +typedef VkFlags VkBuildAccelerationStructureFlagsNV; + +typedef struct VkRayTracingShaderGroupCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkRayTracingShaderGroupTypeNV type; + uint32_t generalShader; + uint32_t closestHitShader; + uint32_t anyHitShader; + uint32_t intersectionShader; +} VkRayTracingShaderGroupCreateInfoNV; + +typedef struct VkRayTracingPipelineCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkPipelineCreateFlags flags; + uint32_t stageCount; + const VkPipelineShaderStageCreateInfo* pStages; + uint32_t groupCount; + const VkRayTracingShaderGroupCreateInfoNV* pGroups; + uint32_t maxRecursionDepth; + VkPipelineLayout layout; + VkPipeline basePipelineHandle; + int32_t basePipelineIndex; +} VkRayTracingPipelineCreateInfoNV; + +typedef struct VkGeometryTrianglesNV { + VkStructureType sType; + const void* pNext; + VkBuffer vertexData; + VkDeviceSize vertexOffset; + uint32_t vertexCount; + VkDeviceSize vertexStride; + VkFormat vertexFormat; + VkBuffer indexData; + VkDeviceSize indexOffset; + uint32_t indexCount; + VkIndexType indexType; + VkBuffer transformData; + VkDeviceSize transformOffset; +} VkGeometryTrianglesNV; + +typedef struct VkGeometryAABBNV { + VkStructureType sType; + const void* pNext; + VkBuffer aabbData; + uint32_t numAABBs; + uint32_t stride; + VkDeviceSize offset; +} VkGeometryAABBNV; + +typedef struct VkGeometryDataNV { + VkGeometryTrianglesNV triangles; + VkGeometryAABBNV aabbs; +} VkGeometryDataNV; + +typedef struct VkGeometryNV { + VkStructureType sType; + const void* pNext; + VkGeometryTypeNV geometryType; + VkGeometryDataNV geometry; + VkGeometryFlagsNV flags; +} VkGeometryNV; + +typedef struct VkAccelerationStructureInfoNV { + VkStructureType sType; + const void* pNext; + VkAccelerationStructureTypeNV type; + VkBuildAccelerationStructureFlagsNV flags; + uint32_t instanceCount; + uint32_t geometryCount; + const VkGeometryNV* pGeometries; +} VkAccelerationStructureInfoNV; + +typedef struct VkAccelerationStructureCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkDeviceSize compactedSize; + VkAccelerationStructureInfoNV info; +} VkAccelerationStructureCreateInfoNV; + +typedef struct VkBindAccelerationStructureMemoryInfoNV { + VkStructureType sType; + const void* pNext; + VkAccelerationStructureNV accelerationStructure; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; + uint32_t deviceIndexCount; + const uint32_t* pDeviceIndices; +} VkBindAccelerationStructureMemoryInfoNV; + +typedef struct VkWriteDescriptorSetAccelerationStructureNV { + VkStructureType sType; + const void* pNext; + uint32_t accelerationStructureCount; + const VkAccelerationStructureNV* pAccelerationStructures; +} VkWriteDescriptorSetAccelerationStructureNV; + +typedef struct VkAccelerationStructureMemoryRequirementsInfoNV { + VkStructureType sType; + const void* pNext; + VkAccelerationStructureMemoryRequirementsTypeNV type; + VkAccelerationStructureNV accelerationStructure; +} VkAccelerationStructureMemoryRequirementsInfoNV; + +typedef struct VkPhysicalDeviceRayTracingPropertiesNV { + VkStructureType sType; + void* pNext; + uint32_t shaderGroupHandleSize; + uint32_t maxRecursionDepth; + uint32_t maxShaderGroupStride; + uint32_t shaderGroupBaseAlignment; + uint64_t maxGeometryCount; + uint64_t maxInstanceCount; + uint64_t maxTriangleCount; + uint32_t maxDescriptorSetAccelerationStructures; +} VkPhysicalDeviceRayTracingPropertiesNV; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateAccelerationStructureNV)(VkDevice device, const VkAccelerationStructureCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkAccelerationStructureNV* pAccelerationStructure); +typedef void (VKAPI_PTR *PFN_vkDestroyAccelerationStructureNV)(VkDevice device, VkAccelerationStructureNV accelerationStructure, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkGetAccelerationStructureMemoryRequirementsNV)(VkDevice device, const VkAccelerationStructureMemoryRequirementsInfoNV* pInfo, VkMemoryRequirements2KHR* pMemoryRequirements); +typedef VkResult (VKAPI_PTR *PFN_vkBindAccelerationStructureMemoryNV)(VkDevice device, uint32_t bindInfoCount, const VkBindAccelerationStructureMemoryInfoNV* pBindInfos); +typedef void (VKAPI_PTR *PFN_vkCmdBuildAccelerationStructureNV)(VkCommandBuffer commandBuffer, const VkAccelerationStructureInfoNV* pInfo, VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkBuffer scratch, VkDeviceSize scratchOffset); +typedef void (VKAPI_PTR *PFN_vkCmdCopyAccelerationStructureNV)(VkCommandBuffer commandBuffer, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkCopyAccelerationStructureModeNV mode); +typedef void (VKAPI_PTR *PFN_vkCmdTraceRaysNV)(VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer, VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride, uint32_t width, uint32_t height, uint32_t depth); +typedef VkResult (VKAPI_PTR *PFN_vkCreateRayTracingPipelinesNV)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoNV* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines); +typedef VkResult (VKAPI_PTR *PFN_vkGetRayTracingShaderGroupHandlesNV)(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void* pData); +typedef VkResult (VKAPI_PTR *PFN_vkGetAccelerationStructureHandleNV)(VkDevice device, VkAccelerationStructureNV accelerationStructure, size_t dataSize, void* pData); +typedef void (VKAPI_PTR *PFN_vkCmdWriteAccelerationStructuresPropertiesNV)(VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureNV* pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery); +typedef VkResult (VKAPI_PTR *PFN_vkCompileDeferredNV)(VkDevice device, VkPipeline pipeline, uint32_t shader); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateAccelerationStructureNV( + VkDevice device, + const VkAccelerationStructureCreateInfoNV* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkAccelerationStructureNV* pAccelerationStructure); + +VKAPI_ATTR void VKAPI_CALL vkDestroyAccelerationStructureNV( + VkDevice device, + VkAccelerationStructureNV accelerationStructure, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR void VKAPI_CALL vkGetAccelerationStructureMemoryRequirementsNV( + VkDevice device, + const VkAccelerationStructureMemoryRequirementsInfoNV* pInfo, + VkMemoryRequirements2KHR* pMemoryRequirements); + +VKAPI_ATTR VkResult VKAPI_CALL vkBindAccelerationStructureMemoryNV( + VkDevice device, + uint32_t bindInfoCount, + const VkBindAccelerationStructureMemoryInfoNV* pBindInfos); + +VKAPI_ATTR void VKAPI_CALL vkCmdBuildAccelerationStructureNV( + VkCommandBuffer commandBuffer, + const VkAccelerationStructureInfoNV* pInfo, + VkBuffer instanceData, + VkDeviceSize instanceOffset, + VkBool32 update, + VkAccelerationStructureNV dst, + VkAccelerationStructureNV src, + VkBuffer scratch, + VkDeviceSize scratchOffset); + +VKAPI_ATTR void VKAPI_CALL vkCmdCopyAccelerationStructureNV( + VkCommandBuffer commandBuffer, + VkAccelerationStructureNV dst, + VkAccelerationStructureNV src, + VkCopyAccelerationStructureModeNV mode); + +VKAPI_ATTR void VKAPI_CALL vkCmdTraceRaysNV( + VkCommandBuffer commandBuffer, + VkBuffer raygenShaderBindingTableBuffer, + VkDeviceSize raygenShaderBindingOffset, + VkBuffer missShaderBindingTableBuffer, + VkDeviceSize missShaderBindingOffset, + VkDeviceSize missShaderBindingStride, + VkBuffer hitShaderBindingTableBuffer, + VkDeviceSize hitShaderBindingOffset, + VkDeviceSize hitShaderBindingStride, + VkBuffer callableShaderBindingTableBuffer, + VkDeviceSize callableShaderBindingOffset, + VkDeviceSize callableShaderBindingStride, + uint32_t width, + uint32_t height, + uint32_t depth); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateRayTracingPipelinesNV( + VkDevice device, + VkPipelineCache pipelineCache, + uint32_t createInfoCount, + const VkRayTracingPipelineCreateInfoNV* pCreateInfos, + const VkAllocationCallbacks* pAllocator, + VkPipeline* pPipelines); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetRayTracingShaderGroupHandlesNV( + VkDevice device, + VkPipeline pipeline, + uint32_t firstGroup, + uint32_t groupCount, + size_t dataSize, + void* pData); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetAccelerationStructureHandleNV( + VkDevice device, + VkAccelerationStructureNV accelerationStructure, + size_t dataSize, + void* pData); + +VKAPI_ATTR void VKAPI_CALL vkCmdWriteAccelerationStructuresPropertiesNV( + VkCommandBuffer commandBuffer, + uint32_t accelerationStructureCount, + const VkAccelerationStructureNV* pAccelerationStructures, + VkQueryType queryType, + VkQueryPool queryPool, + uint32_t firstQuery); + +VKAPI_ATTR VkResult VKAPI_CALL vkCompileDeferredNV( + VkDevice device, + VkPipeline pipeline, + uint32_t shader); +#endif + +#define VK_NV_representative_fragment_test 1 +#define VK_NV_REPRESENTATIVE_FRAGMENT_TEST_SPEC_VERSION 1 +#define VK_NV_REPRESENTATIVE_FRAGMENT_TEST_EXTENSION_NAME "VK_NV_representative_fragment_test" + +typedef struct VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 representativeFragmentTest; +} VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV; + +typedef struct VkPipelineRepresentativeFragmentTestStateCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkBool32 representativeFragmentTestEnable; +} VkPipelineRepresentativeFragmentTestStateCreateInfoNV; + + + #define VK_EXT_global_priority 1 #define VK_EXT_GLOBAL_PRIORITY_SPEC_VERSION 2 #define VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME "VK_EXT_global_priority" @@ -7708,6 +8508,46 @@ VKAPI_ATTR void VKAPI_CALL vkCmdWriteBufferMarkerAMD( uint32_t marker); #endif +#define VK_EXT_calibrated_timestamps 1 +#define VK_EXT_CALIBRATED_TIMESTAMPS_SPEC_VERSION 1 +#define VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME "VK_EXT_calibrated_timestamps" + + +typedef enum VkTimeDomainEXT { + VK_TIME_DOMAIN_DEVICE_EXT = 0, + VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT = 1, + VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT = 2, + VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT = 3, + VK_TIME_DOMAIN_BEGIN_RANGE_EXT = VK_TIME_DOMAIN_DEVICE_EXT, + VK_TIME_DOMAIN_END_RANGE_EXT = VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT, + VK_TIME_DOMAIN_RANGE_SIZE_EXT = (VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT - VK_TIME_DOMAIN_DEVICE_EXT + 1), + VK_TIME_DOMAIN_MAX_ENUM_EXT = 0x7FFFFFFF +} VkTimeDomainEXT; + +typedef struct VkCalibratedTimestampInfoEXT { + VkStructureType sType; + const void* pNext; + VkTimeDomainEXT timeDomain; +} VkCalibratedTimestampInfoEXT; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT)(VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainEXT* pTimeDomains); +typedef VkResult (VKAPI_PTR *PFN_vkGetCalibratedTimestampsEXT)(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceCalibrateableTimeDomainsEXT( + VkPhysicalDevice physicalDevice, + uint32_t* pTimeDomainCount, + VkTimeDomainEXT* pTimeDomains); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetCalibratedTimestampsEXT( + VkDevice device, + uint32_t timestampCount, + const VkCalibratedTimestampInfoEXT* pTimestampInfos, + uint64_t* pTimestamps, + uint64_t* pMaxDeviation); +#endif + #define VK_AMD_shader_core_properties 1 #define VK_AMD_SHADER_CORE_PROPERTIES_SPEC_VERSION 1 #define VK_AMD_SHADER_CORE_PROPERTIES_EXTENSION_NAME "VK_AMD_shader_core_properties" @@ -7733,8 +8573,31 @@ typedef struct VkPhysicalDeviceShaderCorePropertiesAMD { +#define VK_AMD_memory_overallocation_behavior 1 +#define VK_AMD_MEMORY_OVERALLOCATION_BEHAVIOR_SPEC_VERSION 1 +#define VK_AMD_MEMORY_OVERALLOCATION_BEHAVIOR_EXTENSION_NAME "VK_AMD_memory_overallocation_behavior" + + +typedef enum VkMemoryOverallocationBehaviorAMD { + VK_MEMORY_OVERALLOCATION_BEHAVIOR_DEFAULT_AMD = 0, + VK_MEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD = 1, + VK_MEMORY_OVERALLOCATION_BEHAVIOR_DISALLOWED_AMD = 2, + VK_MEMORY_OVERALLOCATION_BEHAVIOR_BEGIN_RANGE_AMD = VK_MEMORY_OVERALLOCATION_BEHAVIOR_DEFAULT_AMD, + VK_MEMORY_OVERALLOCATION_BEHAVIOR_END_RANGE_AMD = VK_MEMORY_OVERALLOCATION_BEHAVIOR_DISALLOWED_AMD, + VK_MEMORY_OVERALLOCATION_BEHAVIOR_RANGE_SIZE_AMD = (VK_MEMORY_OVERALLOCATION_BEHAVIOR_DISALLOWED_AMD - VK_MEMORY_OVERALLOCATION_BEHAVIOR_DEFAULT_AMD + 1), + VK_MEMORY_OVERALLOCATION_BEHAVIOR_MAX_ENUM_AMD = 0x7FFFFFFF +} VkMemoryOverallocationBehaviorAMD; + +typedef struct VkDeviceMemoryOverallocationCreateInfoAMD { + VkStructureType sType; + const void* pNext; + VkMemoryOverallocationBehaviorAMD overallocationBehavior; +} VkDeviceMemoryOverallocationCreateInfoAMD; + + + #define VK_EXT_vertex_attribute_divisor 1 -#define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION 2 +#define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION 3 #define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME "VK_EXT_vertex_attribute_divisor" typedef struct VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT { @@ -7755,6 +8618,13 @@ typedef struct VkPipelineVertexInputDivisorStateCreateInfoEXT { const VkVertexInputBindingDivisorDescriptionEXT* pVertexBindingDivisors; } VkPipelineVertexInputDivisorStateCreateInfoEXT; +typedef struct VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 vertexAttributeInstanceRateDivisor; + VkBool32 vertexAttributeInstanceRateZeroDivisor; +} VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT; + #define VK_NV_shader_subgroup_partitioned 1 @@ -7762,6 +8632,133 @@ typedef struct VkPipelineVertexInputDivisorStateCreateInfoEXT { #define VK_NV_SHADER_SUBGROUP_PARTITIONED_EXTENSION_NAME "VK_NV_shader_subgroup_partitioned" +#define VK_NV_compute_shader_derivatives 1 +#define VK_NV_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION 1 +#define VK_NV_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME "VK_NV_compute_shader_derivatives" + +typedef struct VkPhysicalDeviceComputeShaderDerivativesFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 computeDerivativeGroupQuads; + VkBool32 computeDerivativeGroupLinear; +} VkPhysicalDeviceComputeShaderDerivativesFeaturesNV; + + + +#define VK_NV_mesh_shader 1 +#define VK_NV_MESH_SHADER_SPEC_VERSION 1 +#define VK_NV_MESH_SHADER_EXTENSION_NAME "VK_NV_mesh_shader" + +typedef struct VkPhysicalDeviceMeshShaderFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 taskShader; + VkBool32 meshShader; +} VkPhysicalDeviceMeshShaderFeaturesNV; + +typedef struct VkPhysicalDeviceMeshShaderPropertiesNV { + VkStructureType sType; + void* pNext; + uint32_t maxDrawMeshTasksCount; + uint32_t maxTaskWorkGroupInvocations; + uint32_t maxTaskWorkGroupSize[3]; + uint32_t maxTaskTotalMemorySize; + uint32_t maxTaskOutputCount; + uint32_t maxMeshWorkGroupInvocations; + uint32_t maxMeshWorkGroupSize[3]; + uint32_t maxMeshTotalMemorySize; + uint32_t maxMeshOutputVertices; + uint32_t maxMeshOutputPrimitives; + uint32_t maxMeshMultiviewViewCount; + uint32_t meshOutputPerVertexGranularity; + uint32_t meshOutputPerPrimitiveGranularity; +} VkPhysicalDeviceMeshShaderPropertiesNV; + +typedef struct VkDrawMeshTasksIndirectCommandNV { + uint32_t taskCount; + uint32_t firstTask; +} VkDrawMeshTasksIndirectCommandNV; + + +typedef void (VKAPI_PTR *PFN_vkCmdDrawMeshTasksNV)(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask); +typedef void (VKAPI_PTR *PFN_vkCmdDrawMeshTasksIndirectNV)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); +typedef void (VKAPI_PTR *PFN_vkCmdDrawMeshTasksIndirectCountNV)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdDrawMeshTasksNV( + VkCommandBuffer commandBuffer, + uint32_t taskCount, + uint32_t firstTask); + +VKAPI_ATTR void VKAPI_CALL vkCmdDrawMeshTasksIndirectNV( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + uint32_t drawCount, + uint32_t stride); + +VKAPI_ATTR void VKAPI_CALL vkCmdDrawMeshTasksIndirectCountNV( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride); +#endif + +#define VK_NV_fragment_shader_barycentric 1 +#define VK_NV_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION 1 +#define VK_NV_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME "VK_NV_fragment_shader_barycentric" + +typedef struct VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 fragmentShaderBarycentric; +} VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV; + + + +#define VK_NV_shader_image_footprint 1 +#define VK_NV_SHADER_IMAGE_FOOTPRINT_SPEC_VERSION 1 +#define VK_NV_SHADER_IMAGE_FOOTPRINT_EXTENSION_NAME "VK_NV_shader_image_footprint" + +typedef struct VkPhysicalDeviceShaderImageFootprintFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 imageFootprint; +} VkPhysicalDeviceShaderImageFootprintFeaturesNV; + + + +#define VK_NV_scissor_exclusive 1 +#define VK_NV_SCISSOR_EXCLUSIVE_SPEC_VERSION 1 +#define VK_NV_SCISSOR_EXCLUSIVE_EXTENSION_NAME "VK_NV_scissor_exclusive" + +typedef struct VkPipelineViewportExclusiveScissorStateCreateInfoNV { + VkStructureType sType; + const void* pNext; + uint32_t exclusiveScissorCount; + const VkRect2D* pExclusiveScissors; +} VkPipelineViewportExclusiveScissorStateCreateInfoNV; + +typedef struct VkPhysicalDeviceExclusiveScissorFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 exclusiveScissor; +} VkPhysicalDeviceExclusiveScissorFeaturesNV; + + +typedef void (VKAPI_PTR *PFN_vkCmdSetExclusiveScissorNV)(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkRect2D* pExclusiveScissors); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetExclusiveScissorNV( + VkCommandBuffer commandBuffer, + uint32_t firstExclusiveScissor, + uint32_t exclusiveScissorCount, + const VkRect2D* pExclusiveScissors); +#endif + #define VK_NV_device_diagnostic_checkpoints 1 #define VK_NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_SPEC_VERSION 2 #define VK_NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_EXTENSION_NAME "VK_NV_device_diagnostic_checkpoints" @@ -7794,6 +8791,31 @@ VKAPI_ATTR void VKAPI_CALL vkGetQueueCheckpointDataNV( VkCheckpointDataNV* pCheckpointData); #endif +#define VK_EXT_pci_bus_info 1 +#define VK_EXT_PCI_BUS_INFO_SPEC_VERSION 1 +#define VK_EXT_PCI_BUS_INFO_EXTENSION_NAME "VK_EXT_pci_bus_info" + +typedef struct VkPhysicalDevicePCIBusInfoPropertiesEXT { + VkStructureType sType; + void* pNext; + uint16_t pciDomain; + uint8_t pciBus; + uint8_t pciDevice; + uint8_t pciFunction; +} VkPhysicalDevicePCIBusInfoPropertiesEXT; + + + +#define VK_GOOGLE_hlsl_functionality1 1 +#define VK_GOOGLE_HLSL_FUNCTIONALITY1_SPEC_VERSION 0 +#define VK_GOOGLE_HLSL_FUNCTIONALITY1_EXTENSION_NAME "VK_GOOGLE_hlsl_functionality1" + + +#define VK_GOOGLE_decorate_string 1 +#define VK_GOOGLE_DECORATE_STRING_SPEC_VERSION 0 +#define VK_GOOGLE_DECORATE_STRING_EXTENSION_NAME "VK_GOOGLE_decorate_string" + + #ifdef __cplusplus } #endif diff --git a/include/vulkan/vulkan_fuchsia.h b/include/vulkan/vulkan_fuchsia.h new file mode 100644 index 00000000..e0ed5455 --- /dev/null +++ b/include/vulkan/vulkan_fuchsia.h @@ -0,0 +1,58 @@ +#ifndef VULKAN_FUCHSIA_H_ +#define VULKAN_FUCHSIA_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_FUCHSIA_imagepipe_surface 1 +#define VK_FUCHSIA_IMAGEPIPE_SURFACE_SPEC_VERSION 1 +#define VK_FUCHSIA_IMAGEPIPE_SURFACE_EXTENSION_NAME "VK_FUCHSIA_imagepipe_surface" + +typedef VkFlags VkImagePipeSurfaceCreateFlagsFUCHSIA; + +typedef struct VkImagePipeSurfaceCreateInfoFUCHSIA { + VkStructureType sType; + const void* pNext; + VkImagePipeSurfaceCreateFlagsFUCHSIA flags; + zx_handle_t imagePipeHandle; +} VkImagePipeSurfaceCreateInfoFUCHSIA; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateImagePipeSurfaceFUCHSIA)(VkInstance instance, const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateImagePipeSurfaceFUCHSIA( + VkInstance instance, + const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/vulkan/vulkan_mir.h b/include/vulkan/vulkan_mir.h deleted file mode 100644 index 7d24ed27..00000000 --- a/include/vulkan/vulkan_mir.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef VULKAN_MIR_H_ -#define VULKAN_MIR_H_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** Copyright (c) 2015-2018 The Khronos Group Inc. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - -/* -** This header is generated from the Khronos Vulkan XML API Registry. -** -*/ - - -#define VK_KHR_mir_surface 1 -#define VK_KHR_MIR_SURFACE_SPEC_VERSION 4 -#define VK_KHR_MIR_SURFACE_EXTENSION_NAME "VK_KHR_mir_surface" - -typedef VkFlags VkMirSurfaceCreateFlagsKHR; - -typedef struct VkMirSurfaceCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkMirSurfaceCreateFlagsKHR flags; - MirConnection* connection; - MirSurface* mirSurface; -} VkMirSurfaceCreateInfoKHR; - - -typedef VkResult (VKAPI_PTR *PFN_vkCreateMirSurfaceKHR)(VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); -typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, MirConnection* connection); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkCreateMirSurfaceKHR( - VkInstance instance, - const VkMirSurfaceCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkSurfaceKHR* pSurface); - -VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceMirPresentationSupportKHR( - VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - MirConnection* connection); -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/wrappers/physical_device.h b/include/wrappers/physical_device.h index 56d88ba1..beb996bd 100644 --- a/include/wrappers/physical_device.h +++ b/include/wrappers/physical_device.h @@ -251,6 +251,7 @@ namespace Anvil std::unique_ptr m_ext_descriptor_indexing_features_ptr; std::unique_ptr m_ext_descriptor_indexing_properties_ptr; std::unique_ptr m_ext_external_memory_host_properties_ptr; + std::unique_ptr m_ext_pci_bus_info_ptr; std::unique_ptr m_ext_sample_locations_properties_ptr; std::unique_ptr m_ext_sampler_filter_minmax_properties_ptr; std::unique_ptr m_ext_vertex_attribute_divisor_properties_ptr; diff --git a/include/wrappers/semaphore.h b/include/wrappers/semaphore.h index 59bd3fc2..29c0529a 100644 --- a/include/wrappers/semaphore.h +++ b/include/wrappers/semaphore.h @@ -112,7 +112,6 @@ namespace Anvil /** Releases the underlying Vulkan Semaphore instance and creates a new Vulkan object. */ bool reset(); - private: /* Private functions */ diff --git a/src/misc/formats.cpp b/src/misc/formats.cpp index bfc9815f..54981eb5 100644 --- a/src/misc/formats.cpp +++ b/src/misc/formats.cpp @@ -23,7 +23,6 @@ #include "misc/debug.h" #include "misc/formats.h" #include -#include static const struct FormatInfo { @@ -223,6 +222,112 @@ static const struct FormatInfo {Anvil::Format::ASTC_12x12_SRGB_BLOCK, "VK_FORMAT_ASTC_12x12_SRGB_BLOCK", Anvil::ComponentLayout::RGBA, 0, 0, 0, 0, Anvil::FormatType::SRGB, false} }; +struct SubresourceLayoutInfo +{ + Anvil::ComponentLayout component_layout; + uint8_t component_bits[4]; + + /* Default Constructor */ + SubresourceLayoutInfo() + { + component_layout = Anvil::ComponentLayout::UNKNOWN; + component_bits[0] = component_bits[1] = component_bits[2] = component_bits[3] = 0; + } + + SubresourceLayoutInfo(Anvil::ComponentLayout in_component_layout, + uint8_t in_component0_bits, + uint8_t in_component1_bits, + uint8_t in_component2_bits, + uint8_t in_component3_bits) + { + component_layout = in_component_layout; + component_bits[0] = in_component0_bits; + component_bits[1] = in_component1_bits; + component_bits[2] = in_component2_bits; + component_bits[3] = in_component3_bits; + + } +}; + +struct YUVFormatInfo +{ + const char* name; + uint8_t num_planes; + std::vector subresources; + Anvil::FormatType format_type; + bool is_multiplanar; + bool is_packed; + + YUVFormatInfo() + :name (nullptr), + num_planes (0), + format_type (Anvil::FormatType::UNKNOWN), + is_multiplanar(false), + is_packed (false) + { + /* Stub */ + } + + YUVFormatInfo(const char* in_name, + uint8_t in_num_planes, + SubresourceLayoutInfo in_subresource0, + SubresourceLayoutInfo in_subresource1, + SubresourceLayoutInfo in_subresource2, + Anvil::FormatType in_format_type, + bool in_multiplanar, + bool in_packed) + : name (in_name), + num_planes (in_num_planes), + format_type (in_format_type), + is_multiplanar(in_multiplanar), + is_packed (in_packed) + { + subresources.push_back(in_subresource0); + subresources.push_back(in_subresource1); + subresources.push_back(in_subresource2); + } +}; + +static const std::map g_yuv_formats = +{ + /* (key) | YUVFormatInfo (value) */ + /* format | name | num_planes | subresources[0] | subresources[1] | subresources[2] | format_type | is_multiplanar? | is_packed? */ + {Anvil::Format::G8B8G8R8_422_UNORM, {"VK_FORMAT_G8B8G8R8_422_UNORM", 1, {Anvil::ComponentLayout::GBGR, 8, 8, 8, 8}, {}, {}, Anvil::FormatType::UNORM, false, false} }, + {Anvil::Format::B8G8R8G8_422_UNORM, {"VK_FORMAT_B8G8R8G8_422_UNORM", 1, {Anvil::ComponentLayout::BGRG, 8, 8, 8, 8}, {}, {}, Anvil::FormatType::UNORM, false, false} }, + {Anvil::Format::G8_B8_R8_3PLANE_420_UNORM, {"VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM", 3, {Anvil::ComponentLayout::R, 8, 0, 0, 0}, {Anvil::ComponentLayout::R, 8, 0, 0, 0}, {Anvil::ComponentLayout::R, 8, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G8_B8R8_2PLANE_420_UNORM, {"VK_FORMAT_G8_B8R8_2PLANE_420_UNORM", 2, {Anvil::ComponentLayout::R, 8, 0, 0, 0}, {Anvil::ComponentLayout::BR, 8, 8, 0, 0}, {}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G8_B8_R8_3PLANE_422_UNORM, {"VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM", 3, {Anvil::ComponentLayout::G, 8, 0, 0, 0}, {Anvil::ComponentLayout::B, 8, 0, 8, 0}, {Anvil::ComponentLayout::R, 8, 0, 8, 0}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G8_B8R8_2PLANE_422_UNORM, {"VK_FORMAT_G8_B8R8_2PLANE_422_UNORM", 2, {Anvil::ComponentLayout::G, 8, 0, 0, 0}, {Anvil::ComponentLayout::BR, 8, 8, 0, 0}, {}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G8_B8_R8_3PLANE_444_UNORM, {"VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM", 3, {Anvil::ComponentLayout::G, 8, 0, 0, 0}, {Anvil::ComponentLayout::B, 8, 0, 0, 0}, {Anvil::ComponentLayout::R, 8, 0, 8, 0}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::R10X6_UNORM_PACK16, {"VK_FORMAT_R10X6_UNORM_PACK16", 1, {Anvil::ComponentLayout::R, 10, 0, 0, 0}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::R10X6G10X6_UNORM_2PACK16, {"VK_FORMAT_R10X6G10X6_UNORM_2PACK16", 1, {Anvil::ComponentLayout::RG, 10, 10, 0, 0}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::R10X6G10X6B10X6A10X6_UNORM_4PACK16, {"VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16", 1, {Anvil::ComponentLayout::RGBA, 10, 10, 10, 10}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::G10X6B10X6G10X6R10X6_422_UNORM_4PACK16, {"VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16", 1, {Anvil::ComponentLayout::GBGR, 10, 10, 10, 10}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::B10X6G10X6R10X6G10X6_422_UNORM_4PACK16, {"VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16", 1, {Anvil::ComponentLayout::BGRG, 10, 10, 10, 10}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16", 3, {Anvil::ComponentLayout::G, 10, 0, 0, 0}, {Anvil::ComponentLayout::B, 10, 0, 0, 0}, {Anvil::ComponentLayout::R, 10, 0, 0, 0}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16", 2, {Anvil::ComponentLayout::G, 10, 0, 0, 0}, {Anvil::ComponentLayout::BR, 10, 10, 0, 0}, {}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16", 3, {Anvil::ComponentLayout::G, 10, 0, 0, 0}, {Anvil::ComponentLayout::B, 10, 0, 0, 0}, {Anvil::ComponentLayout::R, 10, 0, 0, 0}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16", 2, {Anvil::ComponentLayout::G, 10, 0, 0, 0}, {Anvil::ComponentLayout::BR, 10, 10, 0, 0}, {}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16", 3, {Anvil::ComponentLayout::G, 10, 0, 0, 0}, {Anvil::ComponentLayout::B, 10, 0, 0, 0}, {Anvil::ComponentLayout::R, 10, 0, 0, 0}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::R12X4_UNORM_PACK16, {"VK_FORMAT_R12X4_UNORM_PACK16", 1, {Anvil::ComponentLayout::R, 12, 0, 0, 0}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::R12X4G12X4_UNORM_2PACK16, {"VK_FORMAT_R12X4G12X4_UNORM_2PACK16", 1, {Anvil::ComponentLayout::RG, 12, 12, 0, 0}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::R12X4G12X4B12X4A12X4_UNORM_4PACK16, {"VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16", 1, {Anvil::ComponentLayout::RGBA, 12, 12, 12, 12}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::G12X4B12X4G12X4R12X4_422_UNORM_4PACK16, {"VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16", 1, {Anvil::ComponentLayout::GBGR, 12, 12, 12, 12}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::B12X4G12X4R12X4G12X4_422_UNORM_4PACK16, {"VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16", 1, {Anvil::ComponentLayout::BGRG, 12, 12, 12, 12}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16", 3, {Anvil::ComponentLayout::G, 12, 0, 0, 0}, {Anvil::ComponentLayout::B, 12, 0, 0, 0}, {Anvil::ComponentLayout::R, 12, 0, 0, 0}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16", 2, {Anvil::ComponentLayout::G, 12, 0, 0, 0}, {Anvil::ComponentLayout::BR, 12, 12, 0, 0}, {}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16", 3, {Anvil::ComponentLayout::G, 12, 0, 0, 0}, {Anvil::ComponentLayout::B, 12, 0, 0, 0}, {Anvil::ComponentLayout::R, 12, 0, 0, 0}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16", 2, {Anvil::ComponentLayout::G, 12, 0, 0, 0}, {Anvil::ComponentLayout::BR, 12, 12, 0, 0}, {}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16", 3, {Anvil::ComponentLayout::G, 12, 0, 0, 0}, {Anvil::ComponentLayout::B, 12, 0, 0, 0}, {Anvil::ComponentLayout::R, 12, 0, 0, 0}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G16B16G16R16_422_UNORM, {"VK_FORMAT_G16B16G16R16_422_UNORM", 1, {Anvil::ComponentLayout::GBGR, 16, 16, 16, 16}, {}, {}, Anvil::FormatType::UNORM, false, false} }, + {Anvil::Format::B16G16R16G16_422_UNORM, {"VK_FORMAT_B16G16R16G16_422_UNORM", 1, {Anvil::ComponentLayout::BGRG, 16, 16, 16, 16}, {}, {}, Anvil::FormatType::UNORM, false, false} }, + {Anvil::Format::G16_B16_R16_3PLANE_420_UNORM, {"VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM", 3, {Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::ComponentLayout::B, 16, 0, 0, 0}, {Anvil::ComponentLayout::R, 16, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G16_B16R16_2PLANE_420_UNORM, {"VK_FORMAT_G16_B16R16_2PLANE_420_UNORM", 2, {Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::ComponentLayout::BR, 16, 16, 0, 0}, {}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G16_B16_R16_3PLANE_422_UNORM, {"VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM", 3, {Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::ComponentLayout::B, 16, 0, 0, 0}, {Anvil::ComponentLayout::R, 16, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G16_B16R16_2PLANE_422_UNORM, {"VK_FORMAT_G16_B16R16_2PLANE_422_UNORM", 2, {Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::ComponentLayout::BR, 16, 16, 0, 0}, {}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G16_B16_R16_3PLANE_444_UNORM, {"VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM", 3, {Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::ComponentLayout::B, 16, 0, 0, 0}, {Anvil::ComponentLayout::R, 16, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, +}; + static const struct { Anvil::Format format; @@ -383,12 +488,21 @@ static uint32_t g_layout_to_n_components[] = /* COMPONENT_LAYOUT_ARGB */ 4, + /* COMPONENT_LAYOUT_B */ + 1, + /* COMPONENT_LAYOUT_BGR */ 3, /* COMPONENT_LAYOUT_BGRA */ 4, + /* COMPONENT_LAYOUT_BGRG */ + 4, + + /* COMPONENT_LAYOUT_BR */ + 2, + /* COMPONENT_LAYOUT_D */ 1, @@ -398,6 +512,12 @@ static uint32_t g_layout_to_n_components[] = /* COMPONENT_LAYOUT_EBGR */ 4, + /* COMPONENT_LAYOUT_G */ + 1, + + /* COMPONENT_LAYOUT_GBGR */ + 4, + /* COMPONENT_LAYOUT_R */ 1, @@ -989,6 +1109,31 @@ bool Anvil::Formats::get_compressed_format_block_size(Anvil::Format in_format, break; } + // YUV KHR compressed formats + case Anvil::Format::G8B8G8R8_422_UNORM: + case Anvil::Format::B8G8R8G8_422_UNORM: + { + out_block_size_uvec2_ptr[0] = 2; + out_block_size_uvec2_ptr[1] = 1; + *out_n_bytes_per_block_ptr = 32 / 8; + + break; + } + + case Anvil::Format::G10X6B10X6G10X6R10X6_422_UNORM_4PACK16: + case Anvil::Format::B10X6G10X6R10X6G10X6_422_UNORM_4PACK16: + case Anvil::Format::G12X4B12X4G12X4R12X4_422_UNORM_4PACK16: + case Anvil::Format::B12X4G12X4R12X4G12X4_422_UNORM_4PACK16: + case Anvil::Format::G16B16G16R16_422_UNORM: + case Anvil::Format::B16G16R16G16_422_UNORM: + { + out_block_size_uvec2_ptr[0] = 2; + out_block_size_uvec2_ptr[1] = 1; + *out_n_bytes_per_block_ptr = 64 / 8; + + break; + } + default: { anvil_assert_fail(); @@ -1039,6 +1184,97 @@ bool Anvil::Formats::get_format_aspects(Anvil::Format in out_aspects_ptr->clear(); + if (Anvil::Formats::is_format_yuv_khr(in_format) ) + { + struct + { + bool uses_plane_0_aspect; + bool uses_plane_1_aspect; + bool uses_plane_2_aspect; + } aspects_used; + + aspects_used.uses_plane_0_aspect = false; + aspects_used.uses_plane_1_aspect = false; + aspects_used.uses_plane_2_aspect = false; + + switch (in_format) + { + case Anvil::Format::G8B8G8R8_422_UNORM: + case Anvil::Format::B8G8R8G8_422_UNORM: + case Anvil::Format::R10X6_UNORM_PACK16: + case Anvil::Format::R10X6G10X6_UNORM_2PACK16: + case Anvil::Format::R10X6G10X6B10X6A10X6_UNORM_4PACK16: + case Anvil::Format::G10X6B10X6G10X6R10X6_422_UNORM_4PACK16: + case Anvil::Format::B10X6G10X6R10X6G10X6_422_UNORM_4PACK16: + case Anvil::Format::R12X4_UNORM_PACK16: + case Anvil::Format::R12X4G12X4_UNORM_2PACK16: + case Anvil::Format::R12X4G12X4B12X4A12X4_UNORM_4PACK16: + case Anvil::Format::G12X4B12X4G12X4R12X4_422_UNORM_4PACK16: + case Anvil::Format::B12X4G12X4R12X4G12X4_422_UNORM_4PACK16: + case Anvil::Format::G16B16G16R16_422_UNORM: + case Anvil::Format::B16G16R16G16_422_UNORM: + { + aspects_used = { true, false, false }; + + break; + } + + case Anvil::Format::G8_B8R8_2PLANE_420_UNORM: + case Anvil::Format::G8_B8R8_2PLANE_422_UNORM: + case Anvil::Format::G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16: + case Anvil::Format::G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16: + case Anvil::Format::G16_B16R16_2PLANE_420_UNORM: + case Anvil::Format::G16_B16R16_2PLANE_422_UNORM: + { + aspects_used = { true, true, false }; + + break; + } + + case Anvil::Format::G8_B8_R8_3PLANE_420_UNORM: + case Anvil::Format::G8_B8_R8_3PLANE_422_UNORM: + case Anvil::Format::G8_B8_R8_3PLANE_444_UNORM: + case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16: + case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16: + case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16: + case Anvil::Format::G16_B16_R16_3PLANE_420_UNORM: + case Anvil::Format::G16_B16_R16_3PLANE_422_UNORM: + case Anvil::Format::G16_B16_R16_3PLANE_444_UNORM: + { + aspects_used = { true, true, true }; + + break; + } + + default: + { + anvil_assert_fail(); + + goto end; + } + } + + if (aspects_used.uses_plane_0_aspect) + { + out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::PLANE_0_BIT); + } + + if (aspects_used.uses_plane_1_aspect) + { + out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::PLANE_1_BIT); + } + + if (aspects_used.uses_plane_2_aspect) + { + out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::PLANE_2_BIT); + } + } + else { /* This image can hold color and/or depth and/or stencil aspects only */ const Anvil::ComponentLayout format_layout = Anvil::Formats::get_format_component_layout(in_format); @@ -1071,6 +1307,7 @@ bool Anvil::Formats::get_format_aspects(Anvil::Format in } result = true; +end: return result; } @@ -1091,6 +1328,8 @@ void Anvil::Formats::get_format_bit_layout(Anvil::Format in_format, uint32_t* out_opt_stencil_component_start_bit_index_ptr, uint32_t* out_opt_stencil_component_end_bit_index_ptr) { + anvil_assert(!Anvil::Formats::is_format_yuv_khr(in_format) ); + anvil_assert(sizeof(g_format_bit_layout_info) / sizeof(g_format_bit_layout_info[0]) > static_cast(in_format) ); anvil_assert(g_format_bit_layout_info[static_cast(in_format)].format == in_format); @@ -1172,18 +1411,48 @@ Anvil::ComponentLayout Anvil::Formats::get_format_component_layout(Anvil::Format { static_assert(sizeof(g_formats) / sizeof(g_formats[0]) == VK_FORMAT_RANGE_SIZE, ""); anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE); + anvil_assert(!Anvil::Formats::is_format_yuv_khr(in_format) ); return g_formats[static_cast(in_format)].component_layout; } +/** Please see header for specification */ +Anvil::ComponentLayout Anvil::Formats::get_format_component_layout(Anvil::Format in_format, + Anvil::ImageAspectFlagBits in_aspect) +{ + const auto plane_idx = Anvil::Formats::get_yuv_format_plane_index(in_format, + in_aspect); + const auto YUV_FORMAT_KHR_SIZE = static_cast(Anvil::Format::G16_B16_R16_3PLANE_444_UNORM) - static_cast(Anvil::Format::G8B8G8R8_422_UNORM) + 1; + + ANVIL_REDUNDANT_VARIABLE_CONST(YUV_FORMAT_KHR_SIZE); + + anvil_assert(g_yuv_formats.size() == YUV_FORMAT_KHR_SIZE); + anvil_assert(Anvil::Formats::is_format_yuv_khr(in_format) ); + + return g_yuv_formats.at(in_format).subresources[plane_idx].component_layout; +} + /** Please see header for specification */ uint32_t Anvil::Formats::get_format_n_components(Anvil::Format in_format) { anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE); + anvil_assert(!Anvil::Formats::is_format_yuv_khr(in_format) ); return g_layout_to_n_components[static_cast(g_formats[static_cast(in_format)].component_layout)]; } +/** Please see header for specification */ +uint32_t Anvil::Formats::get_format_n_components(Anvil::Format in_format, + Anvil::ImageAspectFlagBits in_aspect) +{ + const auto plane_idx = Anvil::Formats::get_yuv_format_plane_index(in_format, + in_aspect); + + anvil_assert(Anvil::Formats::is_format_yuv_khr(in_format) ); + + return g_layout_to_n_components[static_cast(g_yuv_formats.at(in_format).subresources[plane_idx].component_layout)]; +} + /** Please see header for specification */ void Anvil::Formats::get_format_n_component_bits(Anvil::Format in_format, uint32_t* out_channel0_bits_ptr, @@ -1194,6 +1463,7 @@ void Anvil::Formats::get_format_n_component_bits(Anvil::Format in_format, const FormatInfo* format_props_ptr = nullptr; anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE); + anvil_assert(!Anvil::Formats::is_format_yuv_khr(in_format) ); format_props_ptr = g_formats + static_cast(in_format); @@ -1203,25 +1473,223 @@ void Anvil::Formats::get_format_n_component_bits(Anvil::Format in_format, *out_channel3_bits_ptr = format_props_ptr->component_bits[3]; } +/** Please see header for specification */ +void Anvil::Formats::get_format_n_component_bits(Anvil::Format in_format, + Anvil::ImageAspectFlagBits in_aspect, + uint32_t* out_channel0_bits_ptr, + uint32_t* out_channel1_bits_ptr, + uint32_t* out_channel2_bits_ptr, + uint32_t* out_channel3_bits_ptr) +{ + const SubresourceLayoutInfo* format_props_ptr = nullptr; + const auto plane_idx = Anvil::Formats::get_yuv_format_plane_index(in_format, + in_aspect); + + anvil_assert(Anvil::Formats::is_format_yuv_khr(in_format) ); + + format_props_ptr = &g_yuv_formats.at(in_format).subresources.at(plane_idx); + + *out_channel0_bits_ptr = format_props_ptr->component_bits[0]; + *out_channel1_bits_ptr = format_props_ptr->component_bits[1]; + *out_channel2_bits_ptr = format_props_ptr->component_bits[2]; + *out_channel3_bits_ptr = format_props_ptr->component_bits[3]; +} + /** Please see header for specification */ const char* Anvil::Formats::get_format_name(Anvil::Format in_format) { - anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE); + anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE || Anvil::Formats::is_format_yuv_khr(in_format) ); - return g_formats[static_cast(in_format)].name; + if (Anvil::Formats::is_format_yuv_khr(in_format) ) + { + return g_yuv_formats.at(in_format).name; + } + else + { + return g_formats[static_cast(in_format)].name; + } } /** Please see header for specification */ Anvil::FormatType Anvil::Formats::get_format_type(Anvil::Format in_format) { - anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE); + anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE || Anvil::Formats::is_format_yuv_khr(in_format) ); + + if (Anvil::Formats::is_format_yuv_khr(in_format) ) + { + return g_yuv_formats.at(in_format).format_type; + } + else + { + return g_formats[static_cast(in_format)].format_type; + } +} + +/** Please see header for specification */ +uint32_t Anvil::Formats::get_yuv_format_n_planes(Anvil::Format in_format) +{ + anvil_assert(Anvil::Formats::is_format_yuv_khr(in_format) ); + + return g_yuv_formats.at(in_format).num_planes; +} + +/** Please see header for specification */ +void Anvil::Formats::get_yuv_format_plane_extent(Anvil::Format in_format, + Anvil::ImageAspectFlagBits in_aspect, + VkExtent3D in_image_extent, + VkExtent3D* out_plane_extent_ptr) +{ + anvil_assert(Anvil::Formats::is_format_yuv_khr(in_format) ); + anvil_assert(in_aspect == Anvil::ImageAspectFlagBits::PLANE_0_BIT || + in_aspect == Anvil::ImageAspectFlagBits::PLANE_1_BIT || + in_aspect == Anvil::ImageAspectFlagBits::PLANE_2_BIT); + + switch (in_format) + { + case Anvil::Format::G8B8G8R8_422_UNORM: + case Anvil::Format::B8G8R8G8_422_UNORM: + case Anvil::Format::G16B16G16R16_422_UNORM: + case Anvil::Format::B16G16R16G16_422_UNORM: + { + anvil_assert((in_image_extent.width % 2) == 0); + + *out_plane_extent_ptr = in_image_extent; + break; + } + + case Anvil::Format::G8_B8_R8_3PLANE_420_UNORM: + case Anvil::Format::G8_B8R8_2PLANE_420_UNORM: + case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16: + case Anvil::Format::G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16: + case Anvil::Format::G16_B16_R16_3PLANE_420_UNORM: + case Anvil::Format::G16_B16R16_2PLANE_420_UNORM: + { + anvil_assert((in_image_extent.width % 2) == 0); + anvil_assert((in_image_extent.height % 2) == 0); + + if (in_aspect == Anvil::ImageAspectFlagBits::PLANE_0_BIT) + { + *out_plane_extent_ptr = in_image_extent; + } + else + { + *out_plane_extent_ptr = {in_image_extent.width / 2, + in_image_extent.height / 2, + in_image_extent.depth}; + } + + break; + } + + case Anvil::Format::G8_B8_R8_3PLANE_422_UNORM: + case Anvil::Format::G8_B8R8_2PLANE_422_UNORM: + case Anvil::Format::G10X6B10X6G10X6R10X6_422_UNORM_4PACK16: + case Anvil::Format::B10X6G10X6R10X6G10X6_422_UNORM_4PACK16: + case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16: + case Anvil::Format::G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16: + case Anvil::Format::G12X4B12X4G12X4R12X4_422_UNORM_4PACK16: + case Anvil::Format::B12X4G12X4R12X4G12X4_422_UNORM_4PACK16: + case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16: + case Anvil::Format::G16_B16_R16_3PLANE_422_UNORM: + case Anvil::Format::G16_B16R16_2PLANE_422_UNORM: + { + anvil_assert((in_image_extent.width % 2) == 0); + + if (in_aspect == Anvil::ImageAspectFlagBits::PLANE_0_BIT) + { + *out_plane_extent_ptr = in_image_extent; + } + else + { + *out_plane_extent_ptr = {in_image_extent.width / 2, + in_image_extent.height, + in_image_extent.depth}; + } + + break; + } - return g_formats[static_cast(in_format)].format_type; + case Anvil::Format::G8_B8_R8_3PLANE_444_UNORM: + case Anvil::Format::R10X6_UNORM_PACK16: + case Anvil::Format::R10X6G10X6_UNORM_2PACK16: + case Anvil::Format::R10X6G10X6B10X6A10X6_UNORM_4PACK16: + case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16: + case Anvil::Format::R12X4_UNORM_PACK16: + case Anvil::Format::R12X4G12X4_UNORM_2PACK16: + case Anvil::Format::R12X4G12X4B12X4A12X4_UNORM_4PACK16: + case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16: + case Anvil::Format::G16_B16_R16_3PLANE_444_UNORM: + { + *out_plane_extent_ptr = in_image_extent; + + break; + } + + default: + { + anvil_assert_fail(); + } + } +} + +/** Please see header for specification */ +uint32_t Anvil::Formats::get_yuv_format_plane_index(Anvil::Format in_format, + Anvil::ImageAspectFlagBits in_aspect) +{ + const auto n_planes = Anvil::Formats::get_yuv_format_n_planes(in_format); + uint32_t plane_idx = 0; + + ANVIL_REDUNDANT_VARIABLE_CONST(n_planes); + + anvil_assert(0 < n_planes && + n_planes <= 3); + anvil_assert(in_aspect == Anvil::ImageAspectFlagBits::PLANE_0_BIT || + in_aspect == Anvil::ImageAspectFlagBits::PLANE_1_BIT || + in_aspect == Anvil::ImageAspectFlagBits::PLANE_2_BIT); + + switch (in_aspect) + { + case Anvil::ImageAspectFlagBits::PLANE_0_BIT: + { + anvil_assert(n_planes >= 1); + + plane_idx = 0; + break; + } + + case Anvil::ImageAspectFlagBits::PLANE_1_BIT: + { + anvil_assert(n_planes >= 2); + + plane_idx = 1; + break; + } + + case Anvil::ImageAspectFlagBits::PLANE_2_BIT: + { + anvil_assert(n_planes == 3); + + plane_idx = 2; + break; + } + + default: + { + anvil_assert_fail(); + } + } + + return plane_idx; } /** Please see header for specification */ bool Anvil::Formats::has_depth_aspect(Anvil::Format in_format) { + anvil_assert(!Anvil::Formats::is_format_yuv_khr(in_format) ); + return (g_formats[static_cast(in_format)].component_layout == Anvil::ComponentLayout::D) || (g_formats[static_cast(in_format)].component_layout == Anvil::ComponentLayout::DS) || (g_formats[static_cast(in_format)].component_layout == Anvil::ComponentLayout::XD); @@ -1230,6 +1698,8 @@ bool Anvil::Formats::has_depth_aspect(Anvil::Format in_format) /** Please see header for specification */ bool Anvil::Formats::has_stencil_aspect(Anvil::Format in_format) { + anvil_assert(!Anvil::Formats::is_format_yuv_khr(in_format) ); + return (g_formats[static_cast(in_format)].component_layout == Anvil::ComponentLayout::S) || (g_formats[static_cast(in_format)].component_layout == Anvil::ComponentLayout::DS); } @@ -1237,18 +1707,83 @@ bool Anvil::Formats::has_stencil_aspect(Anvil::Format in_format) /** Please see header for specification */ bool Anvil::Formats::is_format_compressed(Anvil::Format in_format) { - anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE); + anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE || Anvil::Formats::is_format_yuv_khr(in_format)); + + if (Anvil::Formats::is_format_yuv_khr(in_format) ) + { + return (g_yuv_formats.at(in_format).subresources[0].component_layout == Anvil::ComponentLayout::GBGR) || + (g_yuv_formats.at(in_format).subresources[0].component_layout == Anvil::ComponentLayout::GBGR); + } + else + { + return (g_formats[static_cast(in_format)].component_bits[0] == g_formats[static_cast(in_format)].component_bits[1]) && + (g_formats[static_cast(in_format)].component_bits[1] == g_formats[static_cast(in_format)].component_bits[2]) && + (g_formats[static_cast(in_format)].component_bits[2] == g_formats[static_cast(in_format)].component_bits[3]) && + (g_formats[static_cast(in_format)].component_bits[0] == 0); + } +} + +/** Please see header for specification */ +bool Anvil::Formats::is_format_multiplanar(Anvil::Format in_format) +{ + anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE || Anvil::Formats::is_format_yuv_khr(in_format) ); - return (g_formats[static_cast(in_format)].component_bits[0] == g_formats[static_cast(in_format)].component_bits[1]) && - (g_formats[static_cast(in_format)].component_bits[1] == g_formats[static_cast(in_format)].component_bits[2]) && - (g_formats[static_cast(in_format)].component_bits[2] == g_formats[static_cast(in_format)].component_bits[3]) && - (g_formats[static_cast(in_format)].component_bits[0] == 0); + if (Anvil::Formats::is_format_yuv_khr(in_format) ) + { + return g_yuv_formats.at(in_format).is_multiplanar; + } + + return false; +} + +/** Please see header for specification */ +bool Anvil::Formats::is_format_yuv_khr(Anvil::Format in_format) +{ + return (in_format == Anvil::Format::G8B8G8R8_422_UNORM || + in_format == Anvil::Format::B8G8R8G8_422_UNORM || + in_format == Anvil::Format::G8_B8_R8_3PLANE_420_UNORM || + in_format == Anvil::Format::G8_B8R8_2PLANE_420_UNORM || + in_format == Anvil::Format::G8_B8_R8_3PLANE_422_UNORM || + in_format == Anvil::Format::G8_B8R8_2PLANE_422_UNORM || + in_format == Anvil::Format::G8_B8_R8_3PLANE_444_UNORM || + in_format == Anvil::Format::R10X6_UNORM_PACK16 || + in_format == Anvil::Format::R10X6G10X6_UNORM_2PACK16 || + in_format == Anvil::Format::R10X6G10X6B10X6A10X6_UNORM_4PACK16 || + in_format == Anvil::Format::G10X6B10X6G10X6R10X6_422_UNORM_4PACK16 || + in_format == Anvil::Format::B10X6G10X6R10X6G10X6_422_UNORM_4PACK16 || + in_format == Anvil::Format::G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16 || + in_format == Anvil::Format::G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 || + in_format == Anvil::Format::G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16 || + in_format == Anvil::Format::G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16 || + in_format == Anvil::Format::G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16 || + in_format == Anvil::Format::R12X4_UNORM_PACK16 || + in_format == Anvil::Format::R12X4G12X4_UNORM_2PACK16 || + in_format == Anvil::Format::R12X4G12X4B12X4A12X4_UNORM_4PACK16 || + in_format == Anvil::Format::G12X4B12X4G12X4R12X4_422_UNORM_4PACK16 || + in_format == Anvil::Format::B12X4G12X4R12X4G12X4_422_UNORM_4PACK16 || + in_format == Anvil::Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16 || + in_format == Anvil::Format::G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16 || + in_format == Anvil::Format::G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16 || + in_format == Anvil::Format::G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16 || + in_format == Anvil::Format::G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16 || + in_format == Anvil::Format::G16B16G16R16_422_UNORM || + in_format == Anvil::Format::B16G16R16G16_422_UNORM || + in_format == Anvil::Format::G16_B16_R16_3PLANE_420_UNORM || + in_format == Anvil::Format::G16_B16R16_2PLANE_420_UNORM || + in_format == Anvil::Format::G16_B16_R16_3PLANE_422_UNORM || + in_format == Anvil::Format::G16_B16R16_2PLANE_422_UNORM || + in_format == Anvil::Format::G16_B16_R16_3PLANE_444_UNORM); } /** Please see header for specification */ bool Anvil::Formats::is_format_packed(Anvil::Format in_format) { - anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE); + anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE || Anvil::Formats::is_format_yuv_khr(in_format) ); + + if (Anvil::Formats::is_format_yuv_khr(in_format) ) + { + return g_yuv_formats.at(in_format).is_packed; + } return g_formats[static_cast(in_format)].is_packed; } \ No newline at end of file diff --git a/src/misc/semaphore_create_info.cpp b/src/misc/semaphore_create_info.cpp index e2bb0f7e..e13637c4 100644 --- a/src/misc/semaphore_create_info.cpp +++ b/src/misc/semaphore_create_info.cpp @@ -20,6 +20,7 @@ // THE SOFTWARE. // #include "misc/semaphore_create_info.h" +#include "wrappers/device.h" Anvil::SemaphoreCreateInfoUniquePtr Anvil::SemaphoreCreateInfo::create(const Anvil::BaseDevice* in_device_ptr) { @@ -34,8 +35,8 @@ Anvil::SemaphoreCreateInfoUniquePtr Anvil::SemaphoreCreateInfo::create(const Anv return result_ptr; } -Anvil::SemaphoreCreateInfo::SemaphoreCreateInfo(const Anvil::BaseDevice* in_device_ptr, - MTSafety in_mt_safety) +Anvil::SemaphoreCreateInfo::SemaphoreCreateInfo(const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety) :m_device_ptr (in_device_ptr), m_exportable_external_semaphore_handle_types (Anvil::ExternalSemaphoreHandleTypeFlagBits::NONE), #if defined(_WIN32) diff --git a/src/misc/types_classes.cpp b/src/misc/types_classes.cpp index 213d0320..de83ecb8 100644 --- a/src/misc/types_classes.cpp +++ b/src/misc/types_classes.cpp @@ -238,6 +238,7 @@ void Anvil::SparseMemoryBindingUpdateInfo::bake() uint32_t n_image_bindings_start_index = ~0u; uint32_t n_image_opaque_bindings_start_index = ~0u; auto& vk_binding = m_bindings_vk[n_binding]; + void** next_ptr_ptr = const_cast(&vk_binding.pNext); bind_info.signal_semaphores_vk.clear(); bind_info.wait_semaphores_vk.clear (); @@ -275,7 +276,8 @@ void Anvil::SparseMemoryBindingUpdateInfo::bake() device_group_binding_info.resourceDeviceIndex = bind_info.resource_device_index; device_group_binding_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHR; - vk_binding.pNext = &device_group_binding_info; + *next_ptr_ptr = &device_group_binding_info; + next_ptr_ptr = const_cast(&device_group_binding_info.pNext); } n_buffer_bindings_start_index = n_buffer_updates_used; diff --git a/src/misc/types_struct.cpp b/src/misc/types_struct.cpp index 786739cc..a053c05c 100644 --- a/src/misc/types_struct.cpp +++ b/src/misc/types_struct.cpp @@ -703,6 +703,32 @@ bool Anvil::EXTExternalMemoryHostProperties::operator==(const Anvil::EXTExternal return (min_imported_host_pointer_alignment == in_props.min_imported_host_pointer_alignment); } +Anvil::EXTPCIBusInfoProperties::EXTPCIBusInfoProperties() + :pci_bus (0), + pci_device (0), + pci_domain (0), + pci_function(0) +{ + /* Stub */ +} + +Anvil::EXTPCIBusInfoProperties::EXTPCIBusInfoProperties(const VkPhysicalDevicePCIBusInfoPropertiesEXT& in_props) + :pci_bus (in_props.pciBus), + pci_device (in_props.pciDevice), + pci_domain (in_props.pciDomain), + pci_function(in_props.pciFunction) +{ + /* Stub */ +} + +bool Anvil::EXTPCIBusInfoProperties::operator==(const Anvil::EXTPCIBusInfoProperties& in_props) const +{ + return (in_props.pci_bus == pci_bus && + in_props.pci_device == pci_device && + in_props.pci_domain == pci_domain && + in_props.pci_function == pci_function); +} + Anvil::EXTSampleLocationsProperties::EXTSampleLocationsProperties() { max_sample_location_grid_size.height = 0; @@ -1840,6 +1866,7 @@ Anvil::PhysicalDeviceProperties::PhysicalDeviceProperties() core_vk1_0_properties_ptr = nullptr; ext_descriptor_indexing_properties_ptr = nullptr; ext_external_memory_host_properties_ptr = nullptr; + ext_pci_bus_info_properties_ptr = nullptr; ext_sample_locations_properties_ptr = nullptr; ext_sampler_filter_minmax_properties_ptr = nullptr; ext_vertex_attribute_divisor_properties_ptr = nullptr; @@ -1853,6 +1880,7 @@ Anvil::PhysicalDeviceProperties::PhysicalDeviceProperties(const AMDShaderCorePro const PhysicalDevicePropertiesCoreVK10* in_core_vk1_0_properties_ptr, const EXTDescriptorIndexingProperties* in_ext_descriptor_indexing_properties_ptr, const EXTExternalMemoryHostProperties* in_ext_external_memory_host_properties_ptr, + const EXTPCIBusInfoProperties* in_ext_pci_bus_info_properties_ptr, const EXTSampleLocationsProperties* in_ext_sample_locations_properties_ptr, const EXTSamplerFilterMinmaxProperties* in_ext_sampler_filter_minmax_properties_ptr, const EXTVertexAttributeDivisorProperties* in_ext_vertex_attribute_divisor_properties_ptr, @@ -1864,6 +1892,7 @@ Anvil::PhysicalDeviceProperties::PhysicalDeviceProperties(const AMDShaderCorePro core_vk1_0_properties_ptr (in_core_vk1_0_properties_ptr), ext_descriptor_indexing_properties_ptr (in_ext_descriptor_indexing_properties_ptr), ext_external_memory_host_properties_ptr (in_ext_external_memory_host_properties_ptr), + ext_pci_bus_info_properties_ptr (in_ext_pci_bus_info_properties_ptr), ext_sample_locations_properties_ptr (in_ext_sample_locations_properties_ptr), ext_sampler_filter_minmax_properties_ptr (in_ext_sampler_filter_minmax_properties_ptr), ext_vertex_attribute_divisor_properties_ptr (in_ext_vertex_attribute_divisor_properties_ptr), @@ -2631,7 +2660,7 @@ bool Anvil::PhysicalDeviceFeatures::operator==(const PhysicalDeviceFeatures& in_ if (khr_multiview_features_ptr != nullptr && in_physical_device_features.khr_multiview_features_ptr != nullptr) { - khr_multiview_features_match = (*ext_descriptor_indexing_features_ptr == *in_physical_device_features.ext_descriptor_indexing_features_ptr); + khr_multiview_features_match = (*khr_multiview_features_ptr == *in_physical_device_features.khr_multiview_features_ptr); } else { @@ -2906,6 +2935,7 @@ bool Anvil::PhysicalDeviceProperties::operator==(const PhysicalDeviceProperties& const bool core_vk1_0_features_match = (*core_vk1_0_properties_ptr == *in_props.core_vk1_0_properties_ptr); bool ext_descriptor_indexing_properties_match = false; bool ext_external_memory_host_properties_match = false; + bool ext_pci_bus_info_properties_match = false; bool ext_sample_locations_properties_match = false; bool ext_sampler_filter_minmax_properties_match = false; bool ext_vertex_attribute_divisor_properties_match = false; @@ -2947,6 +2977,17 @@ bool Anvil::PhysicalDeviceProperties::operator==(const PhysicalDeviceProperties& in_props.ext_external_memory_host_properties_ptr == nullptr); } + if (ext_pci_bus_info_properties_ptr != nullptr && + in_props.ext_pci_bus_info_properties_ptr != nullptr) + { + ext_pci_bus_info_properties_match = (*ext_pci_bus_info_properties_ptr == *in_props.ext_pci_bus_info_properties_ptr); + } + else + { + ext_pci_bus_info_properties_match = (ext_pci_bus_info_properties_ptr == nullptr && + in_props.ext_pci_bus_info_properties_ptr == nullptr); + } + if (ext_sample_locations_properties_ptr != nullptr && in_props.ext_sample_locations_properties_ptr != nullptr) { @@ -3028,6 +3069,7 @@ bool Anvil::PhysicalDeviceProperties::operator==(const PhysicalDeviceProperties& core_vk1_0_features_match && ext_descriptor_indexing_properties_match && ext_external_memory_host_properties_match && + ext_pci_bus_info_properties_match && ext_sample_locations_properties_match && ext_sampler_filter_minmax_properties_match && ext_vertex_attribute_divisor_properties_match && diff --git a/src/misc/window_win3264.cpp b/src/misc/window_win3264.cpp index 24ae41e4..8ac9a3d9 100644 --- a/src/misc/window_win3264.cpp +++ b/src/misc/window_win3264.cpp @@ -88,8 +88,8 @@ Anvil::WindowUniquePtr Anvil::WindowWin3264::create(const std::string& /** Please see header for specification */ Anvil::WindowUniquePtr Anvil::WindowWin3264::create(HWND in_window_handle) { - WindowUniquePtr result_ptr(nullptr, - std::default_delete() ); + WindowUniquePtr result_ptr (nullptr, + std::default_delete() ); RECT window_rect; uint32_t window_size[2] = {0}; diff --git a/src/wrappers/memory_block.cpp b/src/wrappers/memory_block.cpp index 073f3cba..98e52e40 100644 --- a/src/wrappers/memory_block.cpp +++ b/src/wrappers/memory_block.cpp @@ -478,7 +478,17 @@ bool Anvil::MemoryBlock::init() #endif anvil_assert(handle_import_info_ptr->host_ptr == nullptr); - anvil_assert(handle_import_info_ptr->handle != static_cast(nullptr) ); + + #if defined(_WIN32) + { + anvil_assert(handle_import_info_ptr->handle != static_cast(nullptr) || + handle_import_info_ptr->name.size() > 0); + } + #else + { + anvil_assert(handle_import_info_ptr->handle != static_cast(nullptr) ); + } + #endif handle_info_khr.handleType = static_cast(imported_external_memory_handle_type); handle_info_khr.pNext = nullptr; diff --git a/src/wrappers/physical_device.cpp b/src/wrappers/physical_device.cpp index ebdfe561..c024c49b 100644 --- a/src/wrappers/physical_device.cpp +++ b/src/wrappers/physical_device.cpp @@ -347,6 +347,7 @@ bool Anvil::PhysicalDevice::init() const auto& gpdp2_entrypoints = m_instance_ptr->get_extension_khr_get_physical_device_properties2_entrypoints(); Anvil::StructID maintenance3_struct_id = UINT32_MAX; Anvil::StructID multiview_struct_id = UINT32_MAX; + Anvil::StructID pci_bus_info_props_struct_id = UINT32_MAX; Anvil::StructID point_clipping_props_struct_id = UINT32_MAX; Anvil::StructID sample_locations_props_struct_id = UINT32_MAX; Anvil::StructID sampler_filter_minmax_props_struct_id = UINT32_MAX; @@ -395,6 +396,16 @@ bool Anvil::PhysicalDevice::init() external_memory_host_props_struct_id = struct_chainer.append_struct(external_memory_host_props); } + if (m_extension_info_ptr->get_device_extension_info()->ext_pci_bus_info() ) + { + VkPhysicalDevicePCIBusInfoPropertiesEXT pci_bus_info_props; + + pci_bus_info_props.pNext = nullptr; + pci_bus_info_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT; + + pci_bus_info_props_struct_id = struct_chainer.append_struct(pci_bus_info_props); + } + if (m_extension_info_ptr->get_device_extension_info()->ext_sample_locations() ) { VkPhysicalDeviceSampleLocationsPropertiesEXT sample_locations_properties; @@ -547,6 +558,21 @@ bool Anvil::PhysicalDevice::init() } } + if (pci_bus_info_props_struct_id != UINT32_MAX) + { + m_ext_pci_bus_info_ptr.reset( + new EXTPCIBusInfoProperties(*struct_chain_ptr->get_struct_with_id(pci_bus_info_props_struct_id) ) + ); + + if (m_ext_pci_bus_info_ptr == nullptr) + { + anvil_assert(m_ext_pci_bus_info_ptr != nullptr); + + result = false; + goto end; + } + } + if (point_clipping_props_struct_id != UINT32_MAX) { m_khr_maintenance2_physical_device_point_clipping_properties_ptr.reset( @@ -647,6 +673,7 @@ bool Anvil::PhysicalDevice::init() m_core_properties_vk10_ptr.get (), m_ext_descriptor_indexing_properties_ptr.get (), m_ext_external_memory_host_properties_ptr.get (), + m_ext_pci_bus_info_ptr.get (), m_ext_sample_locations_properties_ptr.get (), m_ext_sampler_filter_minmax_properties_ptr.get (), m_ext_vertex_attribute_divisor_properties_ptr.get (), @@ -924,7 +951,7 @@ bool Anvil::PhysicalDevice::get_semaphore_properties(const Anvil::SemaphorePrope Anvil::SemaphoreProperties* out_opt_result_ptr) const { const Anvil::ExtensionKHRExternalSemaphoreCapabilitiesEntrypoints* entrypoints_ptr = nullptr; - VkPhysicalDeviceExternalSemaphoreInfoKHR input_struct; + Anvil::StructChainer struct_chainer; VkExternalSemaphorePropertiesKHR result_struct; bool result = false; @@ -939,15 +966,21 @@ bool Anvil::PhysicalDevice::get_semaphore_properties(const Anvil::SemaphorePrope entrypoints_ptr = &m_instance_ptr->get_extension_khr_external_semaphore_capabilities_entrypoints(); } - input_struct.handleType = static_cast(in_query.external_semaphore_handle_type); - input_struct.pNext = nullptr; - input_struct.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHR; + { + VkPhysicalDeviceExternalSemaphoreInfoKHR root_struct; + + root_struct.handleType = static_cast(in_query.external_semaphore_handle_type); + root_struct.pNext = nullptr; + root_struct.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHR; + + struct_chainer.append_struct(root_struct); + } result_struct.pNext = nullptr; result_struct.sType = VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHR; entrypoints_ptr->vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(m_physical_device, - &input_struct, + struct_chainer.create_chain()->get_root_struct(), &result_struct); if (out_opt_result_ptr != nullptr) diff --git a/src/wrappers/semaphore.cpp b/src/wrappers/semaphore.cpp index d25057f7..005bef07 100644 --- a/src/wrappers/semaphore.cpp +++ b/src/wrappers/semaphore.cpp @@ -371,4 +371,5 @@ bool Anvil::Semaphore::reset() end: return is_vk_call_successful(result); -} \ No newline at end of file +} + From 506a233812fea63ea3bcb762d23be68a43ae392c Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Fri, 16 Nov 2018 23:09:29 +0100 Subject: [PATCH 39/50] Renderpasses: Two getters should return more info than they currently do --- include/misc/render_pass_create_info.h | 25 +++++++++++++------ src/misc/render_pass_create_info.cpp | 34 ++++++++++++++++++++------ 2 files changed, 43 insertions(+), 16 deletions(-) diff --git a/include/misc/render_pass_create_info.h b/include/misc/render_pass_create_info.h index 5abd476e..a1776ad9 100644 --- a/include/misc/render_pass_create_info.h +++ b/include/misc/render_pass_create_info.h @@ -262,6 +262,8 @@ namespace Anvil /** Retrieves properties of the render pass color attachment with the user-specified ID * * @param in_attachment_id ID of the attachment to retrieve properties of. + * @param out_opt_format_ptr If not nullptr, deref will be set to the format, specified + * at attachment creation time. May be nullptr. * @param out_opt_sample_count_ptr If not nullptr, deref will be set to the sample count, specified * at attachment creation time. May be nullptr. * @param out_opt_load_op_ptr If not nullptr, deref will be set to the load op, specified at @@ -279,6 +281,7 @@ namespace Anvil * @return true if successful, false otherwise. **/ bool get_color_attachment_properties(RenderPassAttachmentID in_attachment_id, + Anvil::Format* out_opt_format_ptr = nullptr, Anvil::SampleCountFlagBits* out_opt_sample_count_ptr = nullptr, Anvil::AttachmentLoadOp* out_opt_load_op_ptr = nullptr, Anvil::AttachmentStoreOp* out_opt_store_op_ptr = nullptr, @@ -332,6 +335,10 @@ namespace Anvil /** Retrieves properties of the render pass color attachment with the user-specified ID * * @param in_attachment_id ID of the attachment to retrieve properties of. + * @param out_opt_format_ptr If not nullptr, deref will be set to the format, specified + * at attachment creation time. May be nullptr. + * @param out_opt_sample_count_ptr If not nullptr, deref will be set to the sample count, specified + * at attachment creation time. May be nullptr. * @param out_opt_depth_load_op_ptr If not nullptr, deref will be set to the depth-specific load op, specified at * attachment creation time. May be nullptr. * @param out_opt_depth_store_op_ptr If not nullptr, deref will be set to the depth-specific store op, specified at @@ -350,14 +357,16 @@ namespace Anvil * * @return true if successful, false otherwise. **/ - bool get_depth_stencil_attachment_properties(RenderPassAttachmentID in_attachment_id, - Anvil::AttachmentLoadOp* out_opt_depth_load_op_ptr = nullptr, - Anvil::AttachmentStoreOp* out_opt_depth_store_op_ptr = nullptr, - Anvil::AttachmentLoadOp* out_opt_stencil_load_op_ptr = nullptr, - Anvil::AttachmentStoreOp* out_opt_stencil_store_op_ptr = nullptr, - Anvil::ImageLayout* out_opt_initial_layout_ptr = nullptr, - Anvil::ImageLayout* out_opt_final_layout_ptr = nullptr, - bool* out_opt_may_alias_ptr = nullptr) const; + bool get_depth_stencil_attachment_properties(RenderPassAttachmentID in_attachment_id, + Anvil::Format* out_opt_format_ptr = nullptr, + Anvil::SampleCountFlagBits* out_opt_sample_count_ptr = nullptr, + Anvil::AttachmentLoadOp* out_opt_depth_load_op_ptr = nullptr, + Anvil::AttachmentStoreOp* out_opt_depth_store_op_ptr = nullptr, + Anvil::AttachmentLoadOp* out_opt_stencil_load_op_ptr = nullptr, + Anvil::AttachmentStoreOp* out_opt_stencil_store_op_ptr = nullptr, + Anvil::ImageLayout* out_opt_initial_layout_ptr = nullptr, + Anvil::ImageLayout* out_opt_final_layout_ptr = nullptr, + bool* out_opt_may_alias_ptr = nullptr) const; const Anvil::BaseDevice* get_device() const { diff --git a/src/misc/render_pass_create_info.cpp b/src/misc/render_pass_create_info.cpp index f08e6ddb..af9b6986 100644 --- a/src/misc/render_pass_create_info.cpp +++ b/src/misc/render_pass_create_info.cpp @@ -581,6 +581,7 @@ bool Anvil::RenderPassCreateInfo::get_attachment_type(RenderPassAttachmentID in_ /* Please see header for specification */ bool Anvil::RenderPassCreateInfo::get_color_attachment_properties(RenderPassAttachmentID in_attachment_id, + Anvil::Format* out_opt_format_ptr, Anvil::SampleCountFlagBits* out_opt_sample_count_ptr, Anvil::AttachmentLoadOp* out_opt_load_op_ptr, Anvil::AttachmentStoreOp* out_opt_store_op_ptr, @@ -595,6 +596,11 @@ bool Anvil::RenderPassCreateInfo::get_color_attachment_properties(RenderPassAtta goto end; } + if (out_opt_format_ptr != nullptr) + { + *out_opt_format_ptr = m_attachments[in_attachment_id].format; + } + if (out_opt_sample_count_ptr != nullptr) { *out_opt_sample_count_ptr = m_attachments[in_attachment_id].sample_count; @@ -695,14 +701,16 @@ bool Anvil::RenderPassCreateInfo::get_dependency_multiview_properties(uint32_t i } /** Please see header for specification */ -bool Anvil::RenderPassCreateInfo::get_depth_stencil_attachment_properties(RenderPassAttachmentID in_attachment_id, - Anvil::AttachmentLoadOp* out_opt_depth_load_op_ptr, - Anvil::AttachmentStoreOp* out_opt_depth_store_op_ptr, - Anvil::AttachmentLoadOp* out_opt_stencil_load_op_ptr, - Anvil::AttachmentStoreOp* out_opt_stencil_store_op_ptr, - Anvil::ImageLayout* out_opt_initial_layout_ptr, - Anvil::ImageLayout* out_opt_final_layout_ptr, - bool* out_opt_may_alias_ptr) const +bool Anvil::RenderPassCreateInfo::get_depth_stencil_attachment_properties(RenderPassAttachmentID in_attachment_id, + Anvil::Format* out_opt_format_ptr, + Anvil::SampleCountFlagBits* out_opt_sample_count_ptr, + Anvil::AttachmentLoadOp* out_opt_depth_load_op_ptr, + Anvil::AttachmentStoreOp* out_opt_depth_store_op_ptr, + Anvil::AttachmentLoadOp* out_opt_stencil_load_op_ptr, + Anvil::AttachmentStoreOp* out_opt_stencil_store_op_ptr, + Anvil::ImageLayout* out_opt_initial_layout_ptr, + Anvil::ImageLayout* out_opt_final_layout_ptr, + bool* out_opt_may_alias_ptr) const { bool result = false; @@ -711,6 +719,16 @@ bool Anvil::RenderPassCreateInfo::get_depth_stencil_attachment_properties(Render goto end; } + if (out_opt_format_ptr != nullptr) + { + *out_opt_format_ptr = m_attachments[in_attachment_id].format; + } + + if (out_opt_sample_count_ptr != nullptr) + { + *out_opt_sample_count_ptr = m_attachments[in_attachment_id].sample_count; + } + if (out_opt_depth_load_op_ptr != nullptr) { *out_opt_depth_load_op_ptr = m_attachments[in_attachment_id].color_depth_load_op; From ec22184373993fc0a51893227976c94cb079fed3 Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Mon, 19 Nov 2018 14:52:31 +0100 Subject: [PATCH 40/50] Bug-fixes and improvements; addresses #125 --- .../OutOfOrderRasterization/include/app.h | 2 +- examples/OutOfOrderRasterization/src/app.cpp | 2 +- include/misc/formats.h | 26 + include/misc/types_enums.h | 8 + include/wrappers/swapchain.h | 7 + src/misc/debug_marker.cpp | 2 +- src/misc/formats.cpp | 550 +++++++++++------- src/wrappers/buffer.cpp | 32 +- src/wrappers/image.cpp | 2 +- src/wrappers/swapchain.cpp | 27 +- 10 files changed, 414 insertions(+), 244 deletions(-) diff --git a/examples/OutOfOrderRasterization/include/app.h b/examples/OutOfOrderRasterization/include/app.h index 6da699a8..90507ad8 100644 --- a/examples/OutOfOrderRasterization/include/app.h +++ b/examples/OutOfOrderRasterization/include/app.h @@ -89,7 +89,7 @@ class App uint32_t m_n_indices; uint32_t m_n_last_semaphore_used; - const uint32_t m_n_swapchain_images; + uint32_t m_n_swapchain_images; bool m_ooo_enabled; bool m_should_rotate; std::unique_ptr m_teapot_props_data_ptr; diff --git a/examples/OutOfOrderRasterization/src/app.cpp b/examples/OutOfOrderRasterization/src/app.cpp index a14b4cd7..6b7075fa 100644 --- a/examples/OutOfOrderRasterization/src/app.cpp +++ b/examples/OutOfOrderRasterization/src/app.cpp @@ -517,7 +517,7 @@ void App::init_command_buffers() VkClearValue clear_values[2]; const Anvil::DeviceType device_type = m_device_ptr->get_type(); auto gfx_manager_ptr = m_device_ptr->get_graphics_pipeline_manager(); - const uint32_t n_swapchain_images = m_swapchain_ptr->get_create_info_ptr()->get_n_images(); + const uint32_t n_swapchain_images = m_swapchain_ptr->get_n_images(); const uint32_t universal_queue_family_index = m_device_ptr->get_universal_queue(0)->get_queue_family_index(); Anvil::Buffer* vertex_buffers[] = { diff --git a/include/misc/formats.h b/include/misc/formats.h index 6d0e7b9d..aa3488a8 100644 --- a/include/misc/formats.h +++ b/include/misc/formats.h @@ -186,6 +186,7 @@ namespace Anvil * via get_format_component_layout(). This is especially important in the context of packed formats. * * @param in_format Vulkan format to use for the query. + * @param in_aspect Image aspect to use for the query. * @param out_channel0_bits_ptr Deref will be set to the number of bits used for channel 0. Must * not be nullptr. * @param out_channel1_bits_ptr Deref will be set to the number of bits used for channel 1. Must @@ -202,6 +203,31 @@ namespace Anvil uint32_t* out_channel2_bits_ptr, uint32_t* out_channel3_bits_ptr); + /** Tells the number of bits unused for each component in case of Vulkan format specified + * under @param in_format at subresource @param in_aspect. + * + * NOTE: Only YUV KHR fromats are supported. + * NOTE: Number of bits reported for each component uses ordering as reported for the format + * via get_format_component_layout(). This is especially important in the context of packed formats. + * + * @param in_format Vulkan format to use for the query. + * @param in_aspect Image aspect to use for the query. + * @param out_channel0_unused_bits_ptr Deref will be set to the number of bits unused for channel 0. Must + * not be nullptr. + * @param out_channel1_unused_bits_ptr Deref will be set to the number of bits unused for channel 1. Must + * not be nullptr. + * @param out_channel2_unused_bits_ptr Deref will be set to the number of bits unused for channel 2. Must + * not be nullptr. + * @param out_channel3_unused_bits_ptr Deref will be set to the number of bits unused for channel 3. Must + * not be nullptr. + */ + static void get_format_n_unused_component_bits(Anvil::Format in_format, + Anvil::ImageAspectFlagBits in_aspect, + uint32_t* out_channel0_unused_bits_ptr, + uint32_t* out_channel1_unused_bits_ptr, + uint32_t* out_channel2_unused_bits_ptr, + uint32_t* out_channel3_unused_bits_ptr); + /* Returns a raw C string for specified format, or NULL if the format is unknown. */ static const char* get_format_name(Anvil::Format in_format); diff --git a/include/misc/types_enums.h b/include/misc/types_enums.h index 50b5d970..04630f71 100644 --- a/include/misc/types_enums.h +++ b/include/misc/types_enums.h @@ -633,15 +633,23 @@ namespace Anvil BGRA, BGRG, BR, + BX, + BXGXRXGX, + BXRX, D, DS, EBGR, G, GBGR, + GX, + GXBXGXRX, R, RG, RGB, RGBA, + RX, + RXGX, + RXGXBXAX, S, XD, diff --git a/include/wrappers/swapchain.h b/include/wrappers/swapchain.h index 00d22bb9..49733839 100644 --- a/include/wrappers/swapchain.h +++ b/include/wrappers/swapchain.h @@ -89,6 +89,12 @@ namespace Anvil return m_size.height; } + /** Return the actual number of swapchain images created. */ + uint32_t get_n_images() const + { + return m_n_images; + } + /** Retrieves an Image instance associated with a swapchain image at index * @param in_n_swapchain_image. * @@ -197,6 +203,7 @@ namespace Anvil /* Private variables */ Anvil::SwapchainCreateInfoUniquePtr m_create_info_ptr; Anvil::FenceUniquePtr m_image_available_fence_ptr; + uint32_t m_n_images; /* number of images created in the swapchain. */ std::vector m_image_ptrs; std::vector m_image_view_ptrs; uint32_t m_last_acquired_image_index; diff --git a/src/misc/debug_marker.cpp b/src/misc/debug_marker.cpp index 6a1e98eb..90663361 100644 --- a/src/misc/debug_marker.cpp +++ b/src/misc/debug_marker.cpp @@ -102,7 +102,7 @@ void Anvil::DebugMarkerSupportProviderWorker::set_tag_internal(const uint64_t in m_object_tag_name = in_tag_name; m_object_tag_data.resize(in_tag_size); - memcpy(&m_object_tag_data, + memcpy(&m_object_tag_data.at(0), in_tag_ptr, in_tag_size); diff --git a/src/misc/formats.cpp b/src/misc/formats.cpp index 54981eb5..83ea44ae 100644 --- a/src/misc/formats.cpp +++ b/src/misc/formats.cpp @@ -225,13 +225,15 @@ static const struct FormatInfo struct SubresourceLayoutInfo { Anvil::ComponentLayout component_layout; - uint8_t component_bits[4]; + uint8_t component_bits_used [4]; + uint8_t component_bits_unused[4]; /* Default Constructor */ SubresourceLayoutInfo() { - component_layout = Anvil::ComponentLayout::UNKNOWN; - component_bits[0] = component_bits[1] = component_bits[2] = component_bits[3] = 0; + component_layout = Anvil::ComponentLayout::UNKNOWN; + component_bits_used [0] = component_bits_used [1] = component_bits_used [2] = component_bits_used [3] = 0; + component_bits_unused[0] = component_bits_unused[1] = component_bits_unused[2] = component_bits_unused[3] = 0; } SubresourceLayoutInfo(Anvil::ComponentLayout in_component_layout, @@ -240,13 +242,60 @@ struct SubresourceLayoutInfo uint8_t in_component2_bits, uint8_t in_component3_bits) { - component_layout = in_component_layout; - component_bits[0] = in_component0_bits; - component_bits[1] = in_component1_bits; - component_bits[2] = in_component2_bits; - component_bits[3] = in_component3_bits; + component_layout = in_component_layout; + component_bits_used[0] = in_component0_bits; + component_bits_used[1] = in_component1_bits; + component_bits_used[2] = in_component2_bits; + component_bits_used[3] = in_component3_bits; + component_bits_unused[0] = component_bits_unused[1] = component_bits_unused[2] = component_bits_unused[3] = 0; } + + /* Constructor for packed format */ + SubresourceLayoutInfo(Anvil::ComponentLayout in_component_layout, + uint8_t in_component0_bits_used, + uint8_t in_component1_bits_used, + uint8_t in_component2_bits_used, + uint8_t in_component3_bits_used, + uint8_t in_n_bits_per_component) + { + component_layout = in_component_layout; + component_bits_used[0] = in_component0_bits_used; + component_bits_used[1] = in_component1_bits_used; + component_bits_used[2] = in_component2_bits_used; + component_bits_used[3] = in_component3_bits_used; + + component_bits_unused[0] = component_bits_unused[1] = component_bits_unused[2] = component_bits_unused[3] = 0; + + if (in_component0_bits_used != 0) + { + anvil_assert(in_component0_bits_used <= in_n_bits_per_component); + + component_bits_unused[0] = in_n_bits_per_component - in_component0_bits_used; + } + + if (in_component1_bits_used != 0) + { + anvil_assert(in_component1_bits_used <= in_n_bits_per_component); + + component_bits_unused[1] = in_n_bits_per_component - in_component1_bits_used; + } + + if (in_component2_bits_used != 0) + { + anvil_assert(in_component2_bits_used <= in_n_bits_per_component); + + component_bits_unused[2] = in_n_bits_per_component - in_component2_bits_used; + } + + if (in_component3_bits_used != 0) + { + anvil_assert(in_component3_bits_used <= in_n_bits_per_component); + + component_bits_unused[3] = in_n_bits_per_component - in_component3_bits_used; + } + } + }; struct YUVFormatInfo @@ -290,42 +339,42 @@ struct YUVFormatInfo static const std::map g_yuv_formats = { - /* (key) | YUVFormatInfo (value) */ - /* format | name | num_planes | subresources[0] | subresources[1] | subresources[2] | format_type | is_multiplanar? | is_packed? */ - {Anvil::Format::G8B8G8R8_422_UNORM, {"VK_FORMAT_G8B8G8R8_422_UNORM", 1, {Anvil::ComponentLayout::GBGR, 8, 8, 8, 8}, {}, {}, Anvil::FormatType::UNORM, false, false} }, - {Anvil::Format::B8G8R8G8_422_UNORM, {"VK_FORMAT_B8G8R8G8_422_UNORM", 1, {Anvil::ComponentLayout::BGRG, 8, 8, 8, 8}, {}, {}, Anvil::FormatType::UNORM, false, false} }, - {Anvil::Format::G8_B8_R8_3PLANE_420_UNORM, {"VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM", 3, {Anvil::ComponentLayout::R, 8, 0, 0, 0}, {Anvil::ComponentLayout::R, 8, 0, 0, 0}, {Anvil::ComponentLayout::R, 8, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, - {Anvil::Format::G8_B8R8_2PLANE_420_UNORM, {"VK_FORMAT_G8_B8R8_2PLANE_420_UNORM", 2, {Anvil::ComponentLayout::R, 8, 0, 0, 0}, {Anvil::ComponentLayout::BR, 8, 8, 0, 0}, {}, Anvil::FormatType::UNORM, true, false} }, - {Anvil::Format::G8_B8_R8_3PLANE_422_UNORM, {"VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM", 3, {Anvil::ComponentLayout::G, 8, 0, 0, 0}, {Anvil::ComponentLayout::B, 8, 0, 8, 0}, {Anvil::ComponentLayout::R, 8, 0, 8, 0}, Anvil::FormatType::UNORM, true, false} }, - {Anvil::Format::G8_B8R8_2PLANE_422_UNORM, {"VK_FORMAT_G8_B8R8_2PLANE_422_UNORM", 2, {Anvil::ComponentLayout::G, 8, 0, 0, 0}, {Anvil::ComponentLayout::BR, 8, 8, 0, 0}, {}, Anvil::FormatType::UNORM, true, false} }, - {Anvil::Format::G8_B8_R8_3PLANE_444_UNORM, {"VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM", 3, {Anvil::ComponentLayout::G, 8, 0, 0, 0}, {Anvil::ComponentLayout::B, 8, 0, 0, 0}, {Anvil::ComponentLayout::R, 8, 0, 8, 0}, Anvil::FormatType::UNORM, true, false} }, - {Anvil::Format::R10X6_UNORM_PACK16, {"VK_FORMAT_R10X6_UNORM_PACK16", 1, {Anvil::ComponentLayout::R, 10, 0, 0, 0}, {}, {}, Anvil::FormatType::UNORM, false, true } }, - {Anvil::Format::R10X6G10X6_UNORM_2PACK16, {"VK_FORMAT_R10X6G10X6_UNORM_2PACK16", 1, {Anvil::ComponentLayout::RG, 10, 10, 0, 0}, {}, {}, Anvil::FormatType::UNORM, false, true } }, - {Anvil::Format::R10X6G10X6B10X6A10X6_UNORM_4PACK16, {"VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16", 1, {Anvil::ComponentLayout::RGBA, 10, 10, 10, 10}, {}, {}, Anvil::FormatType::UNORM, false, true } }, - {Anvil::Format::G10X6B10X6G10X6R10X6_422_UNORM_4PACK16, {"VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16", 1, {Anvil::ComponentLayout::GBGR, 10, 10, 10, 10}, {}, {}, Anvil::FormatType::UNORM, false, true } }, - {Anvil::Format::B10X6G10X6R10X6G10X6_422_UNORM_4PACK16, {"VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16", 1, {Anvil::ComponentLayout::BGRG, 10, 10, 10, 10}, {}, {}, Anvil::FormatType::UNORM, false, true } }, - {Anvil::Format::G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16", 3, {Anvil::ComponentLayout::G, 10, 0, 0, 0}, {Anvil::ComponentLayout::B, 10, 0, 0, 0}, {Anvil::ComponentLayout::R, 10, 0, 0, 0}, Anvil::FormatType::UNORM, true, true } }, - {Anvil::Format::G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16", 2, {Anvil::ComponentLayout::G, 10, 0, 0, 0}, {Anvil::ComponentLayout::BR, 10, 10, 0, 0}, {}, Anvil::FormatType::UNORM, true, true } }, - {Anvil::Format::G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16", 3, {Anvil::ComponentLayout::G, 10, 0, 0, 0}, {Anvil::ComponentLayout::B, 10, 0, 0, 0}, {Anvil::ComponentLayout::R, 10, 0, 0, 0}, Anvil::FormatType::UNORM, true, true } }, - {Anvil::Format::G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16", 2, {Anvil::ComponentLayout::G, 10, 0, 0, 0}, {Anvil::ComponentLayout::BR, 10, 10, 0, 0}, {}, Anvil::FormatType::UNORM, true, true } }, - {Anvil::Format::G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16", 3, {Anvil::ComponentLayout::G, 10, 0, 0, 0}, {Anvil::ComponentLayout::B, 10, 0, 0, 0}, {Anvil::ComponentLayout::R, 10, 0, 0, 0}, Anvil::FormatType::UNORM, true, true } }, - {Anvil::Format::R12X4_UNORM_PACK16, {"VK_FORMAT_R12X4_UNORM_PACK16", 1, {Anvil::ComponentLayout::R, 12, 0, 0, 0}, {}, {}, Anvil::FormatType::UNORM, false, true } }, - {Anvil::Format::R12X4G12X4_UNORM_2PACK16, {"VK_FORMAT_R12X4G12X4_UNORM_2PACK16", 1, {Anvil::ComponentLayout::RG, 12, 12, 0, 0}, {}, {}, Anvil::FormatType::UNORM, false, true } }, - {Anvil::Format::R12X4G12X4B12X4A12X4_UNORM_4PACK16, {"VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16", 1, {Anvil::ComponentLayout::RGBA, 12, 12, 12, 12}, {}, {}, Anvil::FormatType::UNORM, false, true } }, - {Anvil::Format::G12X4B12X4G12X4R12X4_422_UNORM_4PACK16, {"VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16", 1, {Anvil::ComponentLayout::GBGR, 12, 12, 12, 12}, {}, {}, Anvil::FormatType::UNORM, false, true } }, - {Anvil::Format::B12X4G12X4R12X4G12X4_422_UNORM_4PACK16, {"VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16", 1, {Anvil::ComponentLayout::BGRG, 12, 12, 12, 12}, {}, {}, Anvil::FormatType::UNORM, false, true } }, - {Anvil::Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16", 3, {Anvil::ComponentLayout::G, 12, 0, 0, 0}, {Anvil::ComponentLayout::B, 12, 0, 0, 0}, {Anvil::ComponentLayout::R, 12, 0, 0, 0}, Anvil::FormatType::UNORM, true, true } }, - {Anvil::Format::G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16", 2, {Anvil::ComponentLayout::G, 12, 0, 0, 0}, {Anvil::ComponentLayout::BR, 12, 12, 0, 0}, {}, Anvil::FormatType::UNORM, true, true } }, - {Anvil::Format::G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16", 3, {Anvil::ComponentLayout::G, 12, 0, 0, 0}, {Anvil::ComponentLayout::B, 12, 0, 0, 0}, {Anvil::ComponentLayout::R, 12, 0, 0, 0}, Anvil::FormatType::UNORM, true, true } }, - {Anvil::Format::G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16", 2, {Anvil::ComponentLayout::G, 12, 0, 0, 0}, {Anvil::ComponentLayout::BR, 12, 12, 0, 0}, {}, Anvil::FormatType::UNORM, true, true } }, - {Anvil::Format::G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16", 3, {Anvil::ComponentLayout::G, 12, 0, 0, 0}, {Anvil::ComponentLayout::B, 12, 0, 0, 0}, {Anvil::ComponentLayout::R, 12, 0, 0, 0}, Anvil::FormatType::UNORM, true, true } }, - {Anvil::Format::G16B16G16R16_422_UNORM, {"VK_FORMAT_G16B16G16R16_422_UNORM", 1, {Anvil::ComponentLayout::GBGR, 16, 16, 16, 16}, {}, {}, Anvil::FormatType::UNORM, false, false} }, - {Anvil::Format::B16G16R16G16_422_UNORM, {"VK_FORMAT_B16G16R16G16_422_UNORM", 1, {Anvil::ComponentLayout::BGRG, 16, 16, 16, 16}, {}, {}, Anvil::FormatType::UNORM, false, false} }, - {Anvil::Format::G16_B16_R16_3PLANE_420_UNORM, {"VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM", 3, {Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::ComponentLayout::B, 16, 0, 0, 0}, {Anvil::ComponentLayout::R, 16, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, - {Anvil::Format::G16_B16R16_2PLANE_420_UNORM, {"VK_FORMAT_G16_B16R16_2PLANE_420_UNORM", 2, {Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::ComponentLayout::BR, 16, 16, 0, 0}, {}, Anvil::FormatType::UNORM, true, false} }, - {Anvil::Format::G16_B16_R16_3PLANE_422_UNORM, {"VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM", 3, {Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::ComponentLayout::B, 16, 0, 0, 0}, {Anvil::ComponentLayout::R, 16, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, - {Anvil::Format::G16_B16R16_2PLANE_422_UNORM, {"VK_FORMAT_G16_B16R16_2PLANE_422_UNORM", 2, {Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::ComponentLayout::BR, 16, 16, 0, 0}, {}, Anvil::FormatType::UNORM, true, false} }, - {Anvil::Format::G16_B16_R16_3PLANE_444_UNORM, {"VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM", 3, {Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::ComponentLayout::B, 16, 0, 0, 0}, {Anvil::ComponentLayout::R, 16, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, + /* (key) | YUVFormatInfo (value) */ + /* format | name | num_planes | subresources[0] | subresources[1] | subresources[2] | format_type | is_multiplanar? | is_packed? */ + {Anvil::Format::G8B8G8R8_422_UNORM, {"VK_FORMAT_G8B8G8R8_422_UNORM", 1, {Anvil::ComponentLayout::GBGR, 8, 8, 8, 8}, {}, {}, Anvil::FormatType::UNORM, false, false} }, + {Anvil::Format::B8G8R8G8_422_UNORM, {"VK_FORMAT_B8G8R8G8_422_UNORM", 1, {Anvil::ComponentLayout::BGRG, 8, 8, 8, 8}, {}, {}, Anvil::FormatType::UNORM, false, false} }, + {Anvil::Format::G8_B8_R8_3PLANE_420_UNORM, {"VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM", 3, {Anvil::ComponentLayout::R, 8, 0, 0, 0}, {Anvil::ComponentLayout::R, 8, 0, 0, 0}, {Anvil::ComponentLayout::R, 8, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G8_B8R8_2PLANE_420_UNORM, {"VK_FORMAT_G8_B8R8_2PLANE_420_UNORM", 2, {Anvil::ComponentLayout::R, 8, 0, 0, 0}, {Anvil::ComponentLayout::BR, 8, 8, 0, 0}, {}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G8_B8_R8_3PLANE_422_UNORM, {"VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM", 3, {Anvil::ComponentLayout::G, 8, 0, 0, 0}, {Anvil::ComponentLayout::B, 8, 0, 0, 0}, {Anvil::ComponentLayout::R, 8, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G8_B8R8_2PLANE_422_UNORM, {"VK_FORMAT_G8_B8R8_2PLANE_422_UNORM", 2, {Anvil::ComponentLayout::G, 8, 0, 0, 0}, {Anvil::ComponentLayout::BR, 8, 8, 0, 0}, {}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G8_B8_R8_3PLANE_444_UNORM, {"VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM", 3, {Anvil::ComponentLayout::G, 8, 0, 0, 0}, {Anvil::ComponentLayout::B, 8, 0, 0, 0}, {Anvil::ComponentLayout::R, 8, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::R10X6_UNORM_PACK16, {"VK_FORMAT_R10X6_UNORM_PACK16", 1, {Anvil::ComponentLayout::RX, 10, 0, 0, 0, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::R10X6G10X6_UNORM_2PACK16, {"VK_FORMAT_R10X6G10X6_UNORM_2PACK16", 1, {Anvil::ComponentLayout::RXGX, 10, 10, 0, 0, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::R10X6G10X6B10X6A10X6_UNORM_4PACK16, {"VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16", 1, {Anvil::ComponentLayout::RXGXBXAX, 10, 10, 10, 10, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::G10X6B10X6G10X6R10X6_422_UNORM_4PACK16, {"VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16", 1, {Anvil::ComponentLayout::GXBXGXRX, 10, 10, 10, 10, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::B10X6G10X6R10X6G10X6_422_UNORM_4PACK16, {"VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16", 1, {Anvil::ComponentLayout::BXGXRXGX, 10, 10, 10, 10, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16", 3, {Anvil::ComponentLayout::GX, 10, 0, 0, 0, 16}, {Anvil::ComponentLayout::BX, 10, 0, 0, 0, 16}, {Anvil::ComponentLayout::RX, 10, 0, 0, 0, 16}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16", 2, {Anvil::ComponentLayout::GX, 10, 0, 0, 0, 16}, {Anvil::ComponentLayout::BXRX, 10, 10, 0, 0, 16}, {}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16", 3, {Anvil::ComponentLayout::GX, 10, 0, 0, 0, 16}, {Anvil::ComponentLayout::BX, 10, 0, 0, 0, 16}, {Anvil::ComponentLayout::RX, 10, 0, 0, 0, 16}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16", 2, {Anvil::ComponentLayout::GX, 10, 0, 0, 0, 16}, {Anvil::ComponentLayout::BXRX, 10, 10, 0, 0, 16}, {}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16", 3, {Anvil::ComponentLayout::GX, 10, 0, 0, 0, 16}, {Anvil::ComponentLayout::BX, 10, 0, 0, 0, 16}, {Anvil::ComponentLayout::RX, 10, 0, 0, 0, 16}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::R12X4_UNORM_PACK16, {"VK_FORMAT_R12X4_UNORM_PACK16", 1, {Anvil::ComponentLayout::RX, 12, 0, 0, 0, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::R12X4G12X4_UNORM_2PACK16, {"VK_FORMAT_R12X4G12X4_UNORM_2PACK16", 1, {Anvil::ComponentLayout::RXGX, 12, 12, 0, 0, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::R12X4G12X4B12X4A12X4_UNORM_4PACK16, {"VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16", 1, {Anvil::ComponentLayout::RXGXBXAX, 12, 12, 12, 12, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::G12X4B12X4G12X4R12X4_422_UNORM_4PACK16, {"VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16", 1, {Anvil::ComponentLayout::GXBXGXRX, 12, 12, 12, 12, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::B12X4G12X4R12X4G12X4_422_UNORM_4PACK16, {"VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16", 1, {Anvil::ComponentLayout::BXGXRXGX, 12, 12, 12, 12, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16", 3, {Anvil::ComponentLayout::GX, 12, 0, 0, 0, 16}, {Anvil::ComponentLayout::BX, 12, 0, 0, 0, 16}, {Anvil::ComponentLayout::RX, 12, 0, 0, 0, 16}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16", 2, {Anvil::ComponentLayout::GX, 12, 0, 0, 0, 16}, {Anvil::ComponentLayout::BXRX, 12, 12, 0, 0, 16}, {}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16", 3, {Anvil::ComponentLayout::GX, 12, 0, 0, 0, 16}, {Anvil::ComponentLayout::BX, 12, 0, 0, 0, 16}, {Anvil::ComponentLayout::RX, 12, 0, 0, 0, 16}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16", 2, {Anvil::ComponentLayout::GX, 12, 0, 0, 0, 16}, {Anvil::ComponentLayout::BXRX, 12, 12, 0, 0, 16}, {}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16", 3, {Anvil::ComponentLayout::GX, 12, 0, 0, 0, 16}, {Anvil::ComponentLayout::BX, 12, 0, 0, 0, 16}, {Anvil::ComponentLayout::RX, 12, 0, 0, 0, 16}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G16B16G16R16_422_UNORM, {"VK_FORMAT_G16B16G16R16_422_UNORM", 1, {Anvil::ComponentLayout::GBGR, 16, 16, 16, 16}, {}, {}, Anvil::FormatType::UNORM, false, false} }, + {Anvil::Format::B16G16R16G16_422_UNORM, {"VK_FORMAT_B16G16R16G16_422_UNORM", 1, {Anvil::ComponentLayout::BGRG, 16, 16, 16, 16}, {}, {}, Anvil::FormatType::UNORM, false, false} }, + {Anvil::Format::G16_B16_R16_3PLANE_420_UNORM, {"VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM", 3, {Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::ComponentLayout::B, 16, 0, 0, 0}, {Anvil::ComponentLayout::R, 16, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G16_B16R16_2PLANE_420_UNORM, {"VK_FORMAT_G16_B16R16_2PLANE_420_UNORM", 2, {Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::ComponentLayout::BR, 16, 16, 0, 0}, {}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G16_B16_R16_3PLANE_422_UNORM, {"VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM", 3, {Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::ComponentLayout::B, 16, 0, 0, 0}, {Anvil::ComponentLayout::R, 16, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G16_B16R16_2PLANE_422_UNORM, {"VK_FORMAT_G16_B16R16_2PLANE_422_UNORM", 2, {Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::ComponentLayout::BR, 16, 16, 0, 0}, {}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G16_B16_R16_3PLANE_444_UNORM, {"VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM", 3, {Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::ComponentLayout::B, 16, 0, 0, 0}, {Anvil::ComponentLayout::R, 16, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, }; static const struct @@ -503,6 +552,15 @@ static uint32_t g_layout_to_n_components[] = /* COMPONENT_LAYOUT_BR */ 2, + /* COMPONENT_LAYOUT_BX */ + 1, + + /* COMPONENT_LAYOUT_BXGXRXGX */ + 4, + + /* COMPONENT_LAYOUT_BXRX */ + 2, + /* COMPONENT_LAYOUT_D */ 1, @@ -518,6 +576,12 @@ static uint32_t g_layout_to_n_components[] = /* COMPONENT_LAYOUT_GBGR */ 4, + /* COMPONENT_LAYOUT_GX */ + 1, + + /* COMPONENT_LAYOUT_GXBXGXRX */ + 4, + /* COMPONENT_LAYOUT_R */ 1, @@ -530,6 +594,15 @@ static uint32_t g_layout_to_n_components[] = /* COMPONENT_LAYOUT_RGBA */ 4, + /* COMPONENT_LAYOUT_RX */ + 1, + + /* COMPONENT_LAYOUT_RXGX */ + 2, + + /* COMPONENT_LAYOUT_RXGXBXAX */ + 4, + /* COMPONENT_LAYOUT_S */ 1, @@ -1186,92 +1259,79 @@ bool Anvil::Formats::get_format_aspects(Anvil::Format in if (Anvil::Formats::is_format_yuv_khr(in_format) ) { - struct + if (!Anvil::Formats::is_format_multiplanar(in_format) ) { - bool uses_plane_0_aspect; - bool uses_plane_1_aspect; - bool uses_plane_2_aspect; - } aspects_used; - - aspects_used.uses_plane_0_aspect = false; - aspects_used.uses_plane_1_aspect = false; - aspects_used.uses_plane_2_aspect = false; - - switch (in_format) + out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::COLOR_BIT); + } + else { - case Anvil::Format::G8B8G8R8_422_UNORM: - case Anvil::Format::B8G8R8G8_422_UNORM: - case Anvil::Format::R10X6_UNORM_PACK16: - case Anvil::Format::R10X6G10X6_UNORM_2PACK16: - case Anvil::Format::R10X6G10X6B10X6A10X6_UNORM_4PACK16: - case Anvil::Format::G10X6B10X6G10X6R10X6_422_UNORM_4PACK16: - case Anvil::Format::B10X6G10X6R10X6G10X6_422_UNORM_4PACK16: - case Anvil::Format::R12X4_UNORM_PACK16: - case Anvil::Format::R12X4G12X4_UNORM_2PACK16: - case Anvil::Format::R12X4G12X4B12X4A12X4_UNORM_4PACK16: - case Anvil::Format::G12X4B12X4G12X4R12X4_422_UNORM_4PACK16: - case Anvil::Format::B12X4G12X4R12X4G12X4_422_UNORM_4PACK16: - case Anvil::Format::G16B16G16R16_422_UNORM: - case Anvil::Format::B16G16R16G16_422_UNORM: + struct { - aspects_used = { true, false, false }; + bool uses_plane_0_aspect; + bool uses_plane_1_aspect; + bool uses_plane_2_aspect; + } aspects_used; - break; - } + aspects_used.uses_plane_0_aspect = false; + aspects_used.uses_plane_1_aspect = false; + aspects_used.uses_plane_2_aspect = false; - case Anvil::Format::G8_B8R8_2PLANE_420_UNORM: - case Anvil::Format::G8_B8R8_2PLANE_422_UNORM: - case Anvil::Format::G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16: - case Anvil::Format::G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16: - case Anvil::Format::G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16: - case Anvil::Format::G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16: - case Anvil::Format::G16_B16R16_2PLANE_420_UNORM: - case Anvil::Format::G16_B16R16_2PLANE_422_UNORM: + switch (in_format) { - aspects_used = { true, true, false }; - - break; + case Anvil::Format::G8_B8R8_2PLANE_420_UNORM: + case Anvil::Format::G8_B8R8_2PLANE_422_UNORM: + case Anvil::Format::G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16: + case Anvil::Format::G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16: + case Anvil::Format::G16_B16R16_2PLANE_420_UNORM: + case Anvil::Format::G16_B16R16_2PLANE_422_UNORM: + { + aspects_used = { true, true, false }; + + break; + } + + case Anvil::Format::G8_B8_R8_3PLANE_420_UNORM: + case Anvil::Format::G8_B8_R8_3PLANE_422_UNORM: + case Anvil::Format::G8_B8_R8_3PLANE_444_UNORM: + case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16: + case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16: + case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16: + case Anvil::Format::G16_B16_R16_3PLANE_420_UNORM: + case Anvil::Format::G16_B16_R16_3PLANE_422_UNORM: + case Anvil::Format::G16_B16_R16_3PLANE_444_UNORM: + { + aspects_used = { true, true, true }; + + break; + } + + default: + { + anvil_assert_fail(); + + goto end; + } } - case Anvil::Format::G8_B8_R8_3PLANE_420_UNORM: - case Anvil::Format::G8_B8_R8_3PLANE_422_UNORM: - case Anvil::Format::G8_B8_R8_3PLANE_444_UNORM: - case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16: - case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16: - case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16: - case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16: - case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16: - case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16: - case Anvil::Format::G16_B16_R16_3PLANE_420_UNORM: - case Anvil::Format::G16_B16_R16_3PLANE_422_UNORM: - case Anvil::Format::G16_B16_R16_3PLANE_444_UNORM: + if (aspects_used.uses_plane_0_aspect) { - aspects_used = { true, true, true }; - - break; + out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::PLANE_0_BIT); } - default: + if (aspects_used.uses_plane_1_aspect) { - anvil_assert_fail(); - - goto end; + out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::PLANE_1_BIT); } - } - - if (aspects_used.uses_plane_0_aspect) - { - out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::PLANE_0_BIT); - } - - if (aspects_used.uses_plane_1_aspect) - { - out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::PLANE_1_BIT); - } - if (aspects_used.uses_plane_2_aspect) - { - out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::PLANE_2_BIT); + if (aspects_used.uses_plane_2_aspect) + { + out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::PLANE_2_BIT); + } } } else @@ -1489,10 +1549,32 @@ void Anvil::Formats::get_format_n_component_bits(Anvil::Format in_f format_props_ptr = &g_yuv_formats.at(in_format).subresources.at(plane_idx); - *out_channel0_bits_ptr = format_props_ptr->component_bits[0]; - *out_channel1_bits_ptr = format_props_ptr->component_bits[1]; - *out_channel2_bits_ptr = format_props_ptr->component_bits[2]; - *out_channel3_bits_ptr = format_props_ptr->component_bits[3]; + *out_channel0_bits_ptr = format_props_ptr->component_bits_used[0]; + *out_channel1_bits_ptr = format_props_ptr->component_bits_used[1]; + *out_channel2_bits_ptr = format_props_ptr->component_bits_used[2]; + *out_channel3_bits_ptr = format_props_ptr->component_bits_used[3]; +} + +/** Please see header for specification */ +void Anvil::Formats::get_format_n_unused_component_bits(Anvil::Format in_format, + Anvil::ImageAspectFlagBits in_aspect, + uint32_t* out_channel0_unused_bits_ptr, + uint32_t* out_channel1_unused_bits_ptr, + uint32_t* out_channel2_unused_bits_ptr, + uint32_t* out_channel3_unused_bits_ptr) +{ + const SubresourceLayoutInfo* format_props_ptr = nullptr; + const auto plane_idx = Anvil::Formats::get_yuv_format_plane_index(in_format, + in_aspect); + + anvil_assert(Anvil::Formats::is_format_yuv_khr(in_format) ); + + format_props_ptr = &g_yuv_formats.at(in_format).subresources.at(plane_idx); + + *out_channel0_unused_bits_ptr = format_props_ptr->component_bits_unused[0]; + *out_channel1_unused_bits_ptr = format_props_ptr->component_bits_unused[1]; + *out_channel2_unused_bits_ptr = format_props_ptr->component_bits_unused[2]; + *out_channel3_unused_bits_ptr = format_props_ptr->component_bits_unused[3]; } /** Please see header for specification */ @@ -1540,97 +1622,118 @@ void Anvil::Formats::get_yuv_format_plane_extent(Anvil::Format in_f VkExtent3D* out_plane_extent_ptr) { anvil_assert(Anvil::Formats::is_format_yuv_khr(in_format) ); - anvil_assert(in_aspect == Anvil::ImageAspectFlagBits::PLANE_0_BIT || - in_aspect == Anvil::ImageAspectFlagBits::PLANE_1_BIT || - in_aspect == Anvil::ImageAspectFlagBits::PLANE_2_BIT); - switch (in_format) + if (!Anvil::Formats::is_format_multiplanar(in_format) ) { - case Anvil::Format::G8B8G8R8_422_UNORM: - case Anvil::Format::B8G8R8G8_422_UNORM: - case Anvil::Format::G16B16G16R16_422_UNORM: - case Anvil::Format::B16G16R16G16_422_UNORM: - { - anvil_assert((in_image_extent.width % 2) == 0); + anvil_assert(in_aspect == Anvil::ImageAspectFlagBits::COLOR_BIT); - *out_plane_extent_ptr = in_image_extent; - break; - } - - case Anvil::Format::G8_B8_R8_3PLANE_420_UNORM: - case Anvil::Format::G8_B8R8_2PLANE_420_UNORM: - case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16: - case Anvil::Format::G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16: - case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16: - case Anvil::Format::G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16: - case Anvil::Format::G16_B16_R16_3PLANE_420_UNORM: - case Anvil::Format::G16_B16R16_2PLANE_420_UNORM: + switch (in_format) { - anvil_assert((in_image_extent.width % 2) == 0); - anvil_assert((in_image_extent.height % 2) == 0); - - if (in_aspect == Anvil::ImageAspectFlagBits::PLANE_0_BIT) + case Anvil::Format::G8B8G8R8_422_UNORM: + case Anvil::Format::B8G8R8G8_422_UNORM: + case Anvil::Format::G16B16G16R16_422_UNORM: + case Anvil::Format::B16G16R16G16_422_UNORM: + case Anvil::Format::G10X6B10X6G10X6R10X6_422_UNORM_4PACK16: + case Anvil::Format::B10X6G10X6R10X6G10X6_422_UNORM_4PACK16: + case Anvil::Format::G12X4B12X4G12X4R12X4_422_UNORM_4PACK16: + case Anvil::Format::B12X4G12X4R12X4G12X4_422_UNORM_4PACK16: { + anvil_assert((in_image_extent.width % 2) == 0); + *out_plane_extent_ptr = in_image_extent; + break; } - else + + case Anvil::Format::R10X6_UNORM_PACK16: + case Anvil::Format::R12X4_UNORM_PACK16: + case Anvil::Format::R10X6G10X6_UNORM_2PACK16: + case Anvil::Format::R12X4G12X4_UNORM_2PACK16: + case Anvil::Format::R10X6G10X6B10X6A10X6_UNORM_4PACK16: + case Anvil::Format::R12X4G12X4B12X4A12X4_UNORM_4PACK16: { - *out_plane_extent_ptr = {in_image_extent.width / 2, - in_image_extent.height / 2, - in_image_extent.depth}; + *out_plane_extent_ptr = in_image_extent; + break; } - break; + default: + { + anvil_assert_fail(); + } } + } + else + { + anvil_assert(in_aspect == Anvil::ImageAspectFlagBits::PLANE_0_BIT || + in_aspect == Anvil::ImageAspectFlagBits::PLANE_1_BIT || + in_aspect == Anvil::ImageAspectFlagBits::PLANE_2_BIT); - case Anvil::Format::G8_B8_R8_3PLANE_422_UNORM: - case Anvil::Format::G8_B8R8_2PLANE_422_UNORM: - case Anvil::Format::G10X6B10X6G10X6R10X6_422_UNORM_4PACK16: - case Anvil::Format::B10X6G10X6R10X6G10X6_422_UNORM_4PACK16: - case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16: - case Anvil::Format::G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16: - case Anvil::Format::G12X4B12X4G12X4R12X4_422_UNORM_4PACK16: - case Anvil::Format::B12X4G12X4R12X4G12X4_422_UNORM_4PACK16: - case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16: - case Anvil::Format::G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16: - case Anvil::Format::G16_B16_R16_3PLANE_422_UNORM: - case Anvil::Format::G16_B16R16_2PLANE_422_UNORM: + switch (in_format) { - anvil_assert((in_image_extent.width % 2) == 0); - - if (in_aspect == Anvil::ImageAspectFlagBits::PLANE_0_BIT) + case Anvil::Format::G8_B8_R8_3PLANE_420_UNORM: + case Anvil::Format::G8_B8R8_2PLANE_420_UNORM: + case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16: + case Anvil::Format::G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16: + case Anvil::Format::G16_B16_R16_3PLANE_420_UNORM: + case Anvil::Format::G16_B16R16_2PLANE_420_UNORM: { - *out_plane_extent_ptr = in_image_extent; + anvil_assert((in_image_extent.width % 2) == 0); + anvil_assert((in_image_extent.height % 2) == 0); + + if (in_aspect == Anvil::ImageAspectFlagBits::PLANE_0_BIT) + { + *out_plane_extent_ptr = in_image_extent; + } + else + { + *out_plane_extent_ptr = {in_image_extent.width / 2, + in_image_extent.height / 2, + in_image_extent.depth}; + } + + break; } - else + + case Anvil::Format::G8_B8_R8_3PLANE_422_UNORM: + case Anvil::Format::G8_B8R8_2PLANE_422_UNORM: + case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16: + case Anvil::Format::G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16: + case Anvil::Format::G16_B16_R16_3PLANE_422_UNORM: + case Anvil::Format::G16_B16R16_2PLANE_422_UNORM: { - *out_plane_extent_ptr = {in_image_extent.width / 2, - in_image_extent.height, - in_image_extent.depth}; - } + anvil_assert((in_image_extent.width % 2) == 0); + + if (in_aspect == Anvil::ImageAspectFlagBits::PLANE_0_BIT) + { + *out_plane_extent_ptr = in_image_extent; + } + else + { + *out_plane_extent_ptr = {in_image_extent.width / 2, + in_image_extent.height, + in_image_extent.depth}; + } - break; - } + break; + } - case Anvil::Format::G8_B8_R8_3PLANE_444_UNORM: - case Anvil::Format::R10X6_UNORM_PACK16: - case Anvil::Format::R10X6G10X6_UNORM_2PACK16: - case Anvil::Format::R10X6G10X6B10X6A10X6_UNORM_4PACK16: - case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16: - case Anvil::Format::R12X4_UNORM_PACK16: - case Anvil::Format::R12X4G12X4_UNORM_2PACK16: - case Anvil::Format::R12X4G12X4B12X4A12X4_UNORM_4PACK16: - case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16: - case Anvil::Format::G16_B16_R16_3PLANE_444_UNORM: - { - *out_plane_extent_ptr = in_image_extent; + case Anvil::Format::G8_B8_R8_3PLANE_444_UNORM: + case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16: + case Anvil::Format::G16_B16_R16_3PLANE_444_UNORM: + { + *out_plane_extent_ptr = in_image_extent; - break; - } + break; + } - default: - { - anvil_assert_fail(); + default: + { + anvil_assert_fail(); + } } } } @@ -1646,39 +1749,50 @@ uint32_t Anvil::Formats::get_yuv_format_plane_index(Anvil::Format i anvil_assert(0 < n_planes && n_planes <= 3); - anvil_assert(in_aspect == Anvil::ImageAspectFlagBits::PLANE_0_BIT || - in_aspect == Anvil::ImageAspectFlagBits::PLANE_1_BIT || - in_aspect == Anvil::ImageAspectFlagBits::PLANE_2_BIT); - switch (in_aspect) + if (!Anvil::Formats::is_format_multiplanar(in_format) ) { - case Anvil::ImageAspectFlagBits::PLANE_0_BIT: - { - anvil_assert(n_planes >= 1); + anvil_assert(n_planes == 1); + anvil_assert(in_aspect == Anvil::ImageAspectFlagBits::COLOR_BIT); - plane_idx = 0; - break; - } + plane_idx = 0; + } + else + { + anvil_assert(in_aspect == Anvil::ImageAspectFlagBits::PLANE_0_BIT || + in_aspect == Anvil::ImageAspectFlagBits::PLANE_1_BIT || + in_aspect == Anvil::ImageAspectFlagBits::PLANE_2_BIT); - case Anvil::ImageAspectFlagBits::PLANE_1_BIT: + switch (in_aspect) { - anvil_assert(n_planes >= 2); + case Anvil::ImageAspectFlagBits::PLANE_0_BIT: + { + anvil_assert(n_planes >= 1); - plane_idx = 1; - break; - } + plane_idx = 0; + break; + } - case Anvil::ImageAspectFlagBits::PLANE_2_BIT: - { - anvil_assert(n_planes == 3); + case Anvil::ImageAspectFlagBits::PLANE_1_BIT: + { + anvil_assert(n_planes >= 2); - plane_idx = 2; - break; - } + plane_idx = 1; + break; + } - default: - { - anvil_assert_fail(); + case Anvil::ImageAspectFlagBits::PLANE_2_BIT: + { + anvil_assert(n_planes == 3); + + plane_idx = 2; + break; + } + + default: + { + anvil_assert_fail(); + } } } @@ -1711,8 +1825,10 @@ bool Anvil::Formats::is_format_compressed(Anvil::Format in_format) if (Anvil::Formats::is_format_yuv_khr(in_format) ) { - return (g_yuv_formats.at(in_format).subresources[0].component_layout == Anvil::ComponentLayout::GBGR) || - (g_yuv_formats.at(in_format).subresources[0].component_layout == Anvil::ComponentLayout::GBGR); + return (g_yuv_formats.at(in_format).subresources[0].component_layout == Anvil::ComponentLayout::GBGR) || + (g_yuv_formats.at(in_format).subresources[0].component_layout == Anvil::ComponentLayout::BGRG) || + (g_yuv_formats.at(in_format).subresources[0].component_layout == Anvil::ComponentLayout::GXBXGXRX) || + (g_yuv_formats.at(in_format).subresources[0].component_layout == Anvil::ComponentLayout::BXGXRXGX); } else { diff --git a/src/wrappers/buffer.cpp b/src/wrappers/buffer.cpp index cf629cd3..00490fe4 100644 --- a/src/wrappers/buffer.cpp +++ b/src/wrappers/buffer.cpp @@ -671,11 +671,23 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, 0, /* in_offset */ in_size); Anvil::BufferCopy copy_region; + Anvil::MemoryBarrier pre_copy_barrier(Anvil::AccessFlagBits::TRANSFER_READ_BIT, /* in_destination_access_mask */ + Anvil::AccessFlagBits::HOST_WRITE_BIT | Anvil::AccessFlagBits::MEMORY_WRITE_BIT | Anvil::AccessFlagBits::SHADER_WRITE_BIT | Anvil::AccessFlagBits::TRANSFER_WRITE_BIT); copy_region.dst_offset = 0; copy_region.size = in_size; copy_region.src_offset = in_start_offset; + copy_cmdbuf_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::ALL_COMMANDS_BIT, /* in_src_stage_mask */ + Anvil::PipelineStageFlagBits::TRANSFER_BIT, /* in_dst_stage_mask */ + Anvil::DependencyFlagBits::NONE, + 1, /* in_memory_barrier_count */ + &pre_copy_barrier, + 0, /* in_buffer_memory_barrier_count */ + nullptr, /* in_buffer_memory_barriers_ptr */ + 0, /* in_image_memory_barrier_count */ + nullptr); /* in_iamge_memory_barriers_ptr */ + copy_cmdbuf_ptr->record_copy_buffer (this, m_staging_buffer_ptr.get(), 1, /* in_region_count */ @@ -1161,21 +1173,23 @@ bool Anvil::Buffer::write(VkDeviceSize in_start_offset, in_device_mask); } { - BufferBarrier buffer_barrier(Anvil::AccessFlagBits::HOST_WRITE_BIT, - Anvil::AccessFlagBits::TRANSFER_READ_BIT, - VK_QUEUE_FAMILY_IGNORED, - VK_QUEUE_FAMILY_IGNORED, - m_staging_buffer_ptr.get(), - 0, /* in_offset */ - in_size); - Anvil::BufferCopy copy_region; + BufferBarrier buffer_barrier(Anvil::AccessFlagBits::HOST_WRITE_BIT, /* in_source_access_mask */ + (Anvil::AccessFlagBits::HOST_READ_BIT | Anvil::AccessFlagBits::MEMORY_READ_BIT | Anvil::AccessFlagBits::SHADER_READ_BIT | Anvil::AccessFlagBits::TRANSFER_READ_BIT | + Anvil::AccessFlagBits::HOST_WRITE_BIT | Anvil::AccessFlagBits::MEMORY_WRITE_BIT | Anvil::AccessFlagBits::SHADER_WRITE_BIT | Anvil::AccessFlagBits::TRANSFER_WRITE_BIT), + VK_QUEUE_FAMILY_IGNORED, + VK_QUEUE_FAMILY_IGNORED, + m_staging_buffer_ptr.get(), + 0, /* in_offset */ + in_size); + Anvil::BufferCopy copy_region; copy_region.dst_offset = in_start_offset; copy_region.size = in_size; copy_region.src_offset = 0; + copy_cmdbuf_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::HOST_BIT, - Anvil::PipelineStageFlagBits::TRANSFER_BIT, + Anvil::PipelineStageFlagBits::ALL_COMMANDS_BIT, Anvil::DependencyFlagBits::NONE, 0, /* in_memory_barrier_count */ nullptr, /* in_memory_barriers_ptr */ diff --git a/src/wrappers/image.cpp b/src/wrappers/image.cpp index f9586dae..a0383ff7 100644 --- a/src/wrappers/image.cpp +++ b/src/wrappers/image.cpp @@ -1965,7 +1965,7 @@ bool Anvil::Image::set_memory_internal(uint32_t in_swapchain_image_index, anvil_assert(m_peer_sfr_rects.size() == 0); anvil_assert(m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::PEER_NO_ALLOC || m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); - anvil_assert(m_create_info_ptr->get_swapchain()->get_create_info_ptr()->get_n_images() > in_swapchain_image_index); + anvil_assert(m_create_info_ptr->get_swapchain()->get_n_images() > in_swapchain_image_index); if (!m_device_ptr->is_extension_enabled(VK_KHR_DEVICE_GROUP_EXTENSION_NAME) ) { diff --git a/src/wrappers/swapchain.cpp b/src/wrappers/swapchain.cpp index f745d97c..17db96c6 100644 --- a/src/wrappers/swapchain.cpp +++ b/src/wrappers/swapchain.cpp @@ -48,11 +48,6 @@ Anvil::Swapchain::Swapchain(Anvil::SwapchainCreateInfoUniquePtr in_create_info_p m_n_present_counter (0), m_swapchain (VK_NULL_HANDLE) { - const auto n_images = in_create_info_ptr->get_n_images(); - - m_image_ptrs.resize (n_images); - m_image_view_ptrs.resize(n_images); - { auto create_info_ptr = Anvil::FenceCreateInfo::create(m_device_ptr, false); /* create_signalled */ @@ -341,7 +336,7 @@ void Anvil::Swapchain::destroy_swapchain() /** Please see header for specification */ Anvil::Image* Anvil::Swapchain::get_image(uint32_t in_n_swapchain_image) const { - anvil_assert(in_n_swapchain_image < m_create_info_ptr->get_n_images() ); + anvil_assert(in_n_swapchain_image < m_n_images ); return m_image_ptrs.at(in_n_swapchain_image).get(); } @@ -349,7 +344,7 @@ Anvil::Image* Anvil::Swapchain::get_image(uint32_t in_n_swapchain_image) const /** Please see header for specification */ Anvil::ImageView* Anvil::Swapchain::get_image_view(uint32_t in_n_swapchain_image) const { - anvil_assert(in_n_swapchain_image < m_create_info_ptr->get_n_images()); + anvil_assert(in_n_swapchain_image < m_n_images ); return m_image_view_ptrs.at(in_n_swapchain_image).get(); } @@ -357,7 +352,6 @@ Anvil::ImageView* Anvil::Swapchain::get_image_view(uint32_t in_n_swapchain_image /** Initializes the swapchain object. */ bool Anvil::Swapchain::init() { - uint32_t n_swapchain_images = 0; auto parent_surface_ptr = m_create_info_ptr->get_rendering_surface(); VkResult result = VK_ERROR_INITIALIZATION_FAILED; Anvil::StructChainUniquePtr struct_chain_ptr; @@ -367,6 +361,7 @@ bool Anvil::Swapchain::init() const bool is_offscreen_rendering_enabled = (window_platform == WINDOW_PLATFORM_DUMMY || window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS); + m_n_images = 0; m_size.width = parent_surface_ptr->get_width (); m_size.height = parent_surface_ptr->get_height(); @@ -519,17 +514,17 @@ bool Anvil::Swapchain::init() /* Retrieve swap-chain images */ result = khr_swapchain_entrypoints.vkGetSwapchainImagesKHR(m_device_ptr->get_device_vk(), m_swapchain, - &n_swapchain_images, + &m_n_images, nullptr); /* pSwapchainImages */ anvil_assert_vk_call_succeeded(result); - anvil_assert (n_swapchain_images > 0); + anvil_assert (m_n_images > 0); - swapchain_images.resize(n_swapchain_images); + swapchain_images.resize(m_n_images); result = khr_swapchain_entrypoints.vkGetSwapchainImagesKHR(m_device_ptr->get_device_vk(), m_swapchain, - &n_swapchain_images, + &m_n_images, &swapchain_images[0]); anvil_assert_vk_call_succeeded(result); @@ -538,11 +533,15 @@ bool Anvil::Swapchain::init() { m_create_info_ptr->set_usage_flags(m_create_info_ptr->get_usage_flags() | Anvil::ImageUsageFlagBits::TRANSFER_SRC_BIT); - n_swapchain_images = m_create_info_ptr->get_n_images(); + m_n_images = m_create_info_ptr->get_n_images(); } + /* Adjust capacity of m_image_ptrs and m_image_view_ptrs to the number of swapchain images actually created. */ + m_image_ptrs.resize (m_n_images); + m_image_view_ptrs.resize(m_n_images); + for (uint32_t n_result_image = 0; - n_result_image < n_swapchain_images; + n_result_image < m_n_images; ++n_result_image) { /* Spawn an Image wrapper class for the swap-chain image. */ From 42bdd015fe7e95a41d890b4f5d625b2d62342075 Mon Sep 17 00:00:00 2001 From: thepra Date: Tue, 20 Nov 2018 22:31:42 +0100 Subject: [PATCH 41/50] Fix misspelling --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3a648050..7d5fe61b 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Anvil was designed with the following goals in mind: - Provide a reasonable level of deferred approach to baking objects, in order to emulate mutability of certain Vulkan objects to a certain degree. Note that this is an optional feature - you are free to request baking of any - object at any time, in ordre to ensure it will never happen at draw time. + object at any time, in order to ensure it will never happen at draw time. - Provide a simple cross-platform implementation for areas unrelated to Vulkan (eg. window management) From 01a923392b520c5951aa55281bb38ad9638a1690 Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Wed, 28 Nov 2018 12:54:08 +0100 Subject: [PATCH 42/50] Extensions: Added support for VK_EXT_debug_utils Extensions: Added support for VK_EXT_transform_feedback Extensions: Improved support for VK_EXT_debug_marker and VK_EXT_debug_report General: Bug-fixes and improvements General: Fix zero-initialization of a handful of structs, basing on work done in !129 General: Update glslang to tag 7.10.2984 New functionality: Added debug messenger which acts a a wrapper for VK_EXT_debug_utils, VK_EXT_debug_marker and VK_EXT_debug_report --- CMakeLists.txt | 13 +- deps/glslang/.gitattributes | 4 - deps/glslang/.gitignore | 7 +- deps/glslang/BUILD.gn | 153 + deps/glslang/CMakeLists.txt | 52 +- deps/glslang/CODE_OF_CONDUCT.md | 1 + deps/glslang/External/CMakeLists.txt | 43 + deps/glslang/README.md | 512 +- deps/glslang/SPIRV/CMakeLists.txt | 43 +- deps/glslang/SPIRV/GLSL.ext.KHR.h | 2 + deps/glslang/SPIRV/GLSL.ext.NV.h | 22 +- deps/glslang/SPIRV/GlslangToSpv.cpp | 1414 ++- deps/glslang/SPIRV/GlslangToSpv.h | 9 +- deps/glslang/SPIRV/SPVRemapper.cpp | 18 +- deps/glslang/SPIRV/SpvBuilder.cpp | 232 +- deps/glslang/SPIRV/SpvBuilder.h | 72 +- deps/glslang/SPIRV/SpvPostProcess.cpp | 265 + deps/glslang/SPIRV/SpvTools.cpp | 189 + deps/glslang/SPIRV/SpvTools.h | 80 + deps/glslang/SPIRV/bitutils.h | 2 +- deps/glslang/SPIRV/disassemble.cpp | 77 +- deps/glslang/SPIRV/disassemble.h | 1 + deps/glslang/SPIRV/doc.cpp | 195 +- deps/glslang/SPIRV/spirv.hpp | 91 + deps/glslang/SPIRV/spvIR.h | 42 +- deps/glslang/StandAlone/CMakeLists.txt | 53 + .../glslang/StandAlone/DirStackFileIncluder.h | 141 + deps/glslang/StandAlone/ResourceLimits.cpp | 498 + deps/glslang/StandAlone/ResourceLimits.h | 57 + deps/glslang/StandAlone/StandAlone.cpp | 1644 +++ deps/glslang/StandAlone/Worklist.h | 95 + deps/glslang/StandAlone/spirv-remap.cpp | 343 + deps/glslang/Test/100.conf | 28 + deps/glslang/Test/100.frag | 227 + deps/glslang/Test/100Limits.vert | 76 + deps/glslang/Test/100samplerExternal.frag | 41 + deps/glslang/Test/100scope.vert | 76 + deps/glslang/Test/110scope.vert | 87 + deps/glslang/Test/120.frag | 248 + deps/glslang/Test/120.vert | 203 + deps/glslang/Test/130.frag | 169 + deps/glslang/Test/130.vert | 78 + deps/glslang/Test/140.frag | 53 + deps/glslang/Test/140.vert | 79 + deps/glslang/Test/150.frag | 50 + deps/glslang/Test/150.geom | 139 + deps/glslang/Test/150.tesc | 34 + deps/glslang/Test/150.tese | 35 + deps/glslang/Test/150.vert | 29 + deps/glslang/Test/300.frag | 161 + deps/glslang/Test/300.vert | 204 + deps/glslang/Test/300BuiltIns.frag | 76 + deps/glslang/Test/300block.frag | 58 + deps/glslang/Test/300layout.frag | 19 + deps/glslang/Test/300layout.vert | 57 + deps/glslang/Test/300link.frag | 8 + deps/glslang/Test/300link2.frag | 11 + deps/glslang/Test/300link3.frag | 7 + deps/glslang/Test/300operations.frag | 135 + deps/glslang/Test/300samplerExternal.frag | 41 + deps/glslang/Test/300scope.vert | 74 + deps/glslang/Test/310.comp | 256 + deps/glslang/Test/310.frag | 451 + deps/glslang/Test/310.geom | 152 + deps/glslang/Test/310.tesc | 169 + deps/glslang/Test/310.tese | 128 + deps/glslang/Test/310.vert | 403 + deps/glslang/Test/310AofA.vert | 121 + .../Test/310implicitSizeArrayError.vert | 8 + deps/glslang/Test/310runtimeArray.vert | 18 + deps/glslang/Test/320.comp | 5 + deps/glslang/Test/320.frag | 225 + deps/glslang/Test/320.geom | 134 + deps/glslang/Test/320.tesc | 150 + deps/glslang/Test/320.tese | 114 + deps/glslang/Test/320.vert | 255 + deps/glslang/Test/330.frag | 152 + deps/glslang/Test/330comp.frag | 12 + deps/glslang/Test/400.frag | 201 + deps/glslang/Test/400.geom | 330 + deps/glslang/Test/400.tesc | 125 + deps/glslang/Test/400.tese | 125 + deps/glslang/Test/400.vert | 106 + deps/glslang/Test/410.geom | 39 + deps/glslang/Test/410.tesc | 11 + deps/glslang/Test/410.vert | 9 + deps/glslang/Test/420.comp | 30 + deps/glslang/Test/420.frag | 14 + deps/glslang/Test/420.geom | 55 + deps/glslang/Test/420.tesc | 43 + deps/glslang/Test/420.tese | 90 + deps/glslang/Test/420.vert | 161 + deps/glslang/Test/420_size_gl_in.geom | 21 + deps/glslang/Test/430.comp | 87 + deps/glslang/Test/430.vert | 223 + deps/glslang/Test/430AofA.frag | 108 + deps/glslang/Test/430scope.vert | 74 + deps/glslang/Test/435.vert | 2 + deps/glslang/Test/440.frag | 153 + deps/glslang/Test/440.vert | 197 + deps/glslang/Test/450.comp | 6 + deps/glslang/Test/450.frag | 68 + deps/glslang/Test/450.geom | 19 + deps/glslang/Test/450.tesc | 23 + deps/glslang/Test/450.tese | 21 + deps/glslang/Test/450.vert | 56 + deps/glslang/Test/460.frag | 32 + deps/glslang/Test/460.vert | 15 + deps/glslang/Test/Operations.frag | 166 + deps/glslang/Test/aggOps.frag | 51 + deps/glslang/Test/always-discard.frag | 36 + deps/glslang/Test/always-discard2.frag | 19 + deps/glslang/Test/array.frag | 113 + deps/glslang/Test/array100.frag | 70 + deps/glslang/Test/atomic_uint.frag | 48 + deps/glslang/Test/badChars.frag | 7 + deps/glslang/Test/badMacroArgs.frag | 4 + deps/glslang/Test/bar.h | 1 + .../hlsl.aliasOpaque.frag.out | 46 + .../hlsl.flattenOpaque.frag.out | 65 + .../hlsl.flattenOpaqueInit.vert.out | 52 + .../hlsl.flattenOpaqueInitMix.vert.out | 43 + .../hlsl.flattenSubset.frag.out | 47 + .../hlsl.flattenSubset2.frag.out | 31 + .../hlsl.partialFlattenLocal.vert.out | 81 + .../hlsl.partialFlattenMixed.vert.out | 29 + deps/glslang/Test/baseResults/100.frag.out | 576 + .../Test/baseResults/100Limits.vert.out | 889 ++ .../Test/baseResults/100LimitsConf.vert.out | 24 + .../baseResults/100samplerExternal.frag.out | 172 + .../Test/baseResults/100scope.vert.out | 228 + .../Test/baseResults/110scope.vert.out | 276 + deps/glslang/Test/baseResults/120.frag.out | 698 ++ deps/glslang/Test/baseResults/120.vert.out | 505 + deps/glslang/Test/baseResults/130.frag.out | 460 + deps/glslang/Test/baseResults/130.vert.out | 286 + deps/glslang/Test/baseResults/140.frag.out | 169 + deps/glslang/Test/baseResults/140.vert.out | 215 + deps/glslang/Test/baseResults/150.frag.out | 158 + deps/glslang/Test/baseResults/150.geom.out | 289 + deps/glslang/Test/baseResults/150.tesc.out | 1676 +++ deps/glslang/Test/baseResults/150.vert.out | 95 + deps/glslang/Test/baseResults/300.frag.out | 632 ++ deps/glslang/Test/baseResults/300.vert.out | 505 + .../Test/baseResults/300BuiltIns.frag.out | 418 + .../Test/baseResults/300block.frag.out | 153 + .../Test/baseResults/300layout.frag.out | 69 + .../Test/baseResults/300layout.vert.out | 147 + .../glslang/Test/baseResults/300link.frag.out | 22 + .../Test/baseResults/300link2.frag.out | 25 + .../Test/baseResults/300link3.frag.out | 19 + .../Test/baseResults/300operations.frag.out | 420 + .../baseResults/300samplerExternal.frag.out | 197 + .../Test/baseResults/300scope.vert.out | 231 + deps/glslang/Test/baseResults/310.comp.out | 616 ++ deps/glslang/Test/baseResults/310.frag.out | 1237 +++ deps/glslang/Test/baseResults/310.geom.out | 277 + deps/glslang/Test/baseResults/310.tesc.out | 542 + deps/glslang/Test/baseResults/310.tese.out | 300 + deps/glslang/Test/baseResults/310.vert.out | 1272 +++ .../glslang/Test/baseResults/310AofA.vert.out | 394 + .../310implicitSizeArrayError.vert.out | 49 + .../Test/baseResults/310runtimeArray.vert.out | 145 + deps/glslang/Test/baseResults/320.comp.out | 19 + deps/glslang/Test/baseResults/320.frag.out | 576 + deps/glslang/Test/baseResults/320.geom.out | 251 + deps/glslang/Test/baseResults/320.tesc.out | 516 + deps/glslang/Test/baseResults/320.tese.out | 275 + deps/glslang/Test/baseResults/320.vert.out | 797 ++ deps/glslang/Test/baseResults/330.frag.out | 194 + .../glslang/Test/baseResults/330comp.frag.out | 48 + deps/glslang/Test/baseResults/400.frag.out | 728 ++ deps/glslang/Test/baseResults/400.geom.out | 1091 ++ deps/glslang/Test/baseResults/400.tesc.out | 400 + deps/glslang/Test/baseResults/400.tese.out | 295 + deps/glslang/Test/baseResults/400.vert.out | 555 + deps/glslang/Test/baseResults/410.geom.out | 82 + deps/glslang/Test/baseResults/410.tesc.out | 30 + deps/glslang/Test/baseResults/410.vert.out | 27 + deps/glslang/Test/baseResults/420.comp.out | 121 + deps/glslang/Test/baseResults/420.frag.out | 42 + deps/glslang/Test/baseResults/420.geom.out | 152 + deps/glslang/Test/baseResults/420.tesc.out | 194 + deps/glslang/Test/baseResults/420.tese.out | 364 + deps/glslang/Test/baseResults/420.vert.out | 390 + .../Test/baseResults/420_size_gl_in.geom.out | 56 + deps/glslang/Test/baseResults/430.comp.out | 209 + deps/glslang/Test/baseResults/430.vert.out | 340 + .../glslang/Test/baseResults/430AofA.frag.out | 774 ++ .../Test/baseResults/430scope.vert.out | 230 + deps/glslang/Test/baseResults/435.vert.out | 25 + deps/glslang/Test/baseResults/440.frag.out | 165 + deps/glslang/Test/baseResults/440.vert.out | 245 + deps/glslang/Test/baseResults/450.comp.out | 24 + deps/glslang/Test/baseResults/450.frag.out | 285 + deps/glslang/Test/baseResults/450.geom.out | 85 + deps/glslang/Test/baseResults/450.tesc.out | 74 + deps/glslang/Test/baseResults/450.tese.out | 87 + deps/glslang/Test/baseResults/450.vert.out | 123 + deps/glslang/Test/baseResults/460.frag.out | 101 + deps/glslang/Test/baseResults/460.vert.out | 51 + .../Test/baseResults/Operations.frag.out | 1151 ++ deps/glslang/Test/baseResults/aggOps.frag.out | 298 + .../Test/baseResults/always-discard.frag.out | 239 + .../Test/baseResults/always-discard2.frag.out | 121 + deps/glslang/Test/baseResults/array.frag.out | 480 + .../Test/baseResults/array100.frag.out | 273 + .../Test/baseResults/atomic_uint.frag.out | 107 + .../Test/baseResults/badChars.frag.out | 27 + .../Test/baseResults/badMacroArgs.frag.out | 6 + .../glslang/Test/baseResults/comment.frag.out | 22 + .../Test/baseResults/compoundsuffix.frag.hlsl | 45 + .../Test/baseResults/compoundsuffix.vert.glsl | 15 + .../baseResults/conditionalDiscard.frag.out | 63 + .../Test/baseResults/constErrors.frag.out | 54 + .../Test/baseResults/constFold.frag.out | 660 ++ .../Test/baseResults/constFoldIntMin.frag.out | 51 + .../Test/baseResults/conversion.frag.out | 955 ++ deps/glslang/Test/baseResults/cppBad.vert.out | 24 + .../glslang/Test/baseResults/cppBad2.vert.out | 18 + .../Test/baseResults/cppComplexExpr.vert.out | 181 + .../Test/baseResults/cppDeepNest.frag.out | 20 + .../Test/baseResults/cppIndent.vert.out | 84 + .../cppIntMinOverNegativeOne.frag.out | 14 + .../glslang/Test/baseResults/cppNest.vert.out | 143 + .../baseResults/cppPassMacroName.frag.out | 77 + .../cppRelaxSkipTokensErrors.vert.out | 14 + .../Test/baseResults/cppSimple.vert.out | 303 + .../glslang/Test/baseResults/dataOut.frag.out | 35 + .../Test/baseResults/dataOutIndirect.frag.out | 35 + deps/glslang/Test/baseResults/dce.frag.out | 152 + deps/glslang/Test/baseResults/decls.frag.out | 515 + .../Test/baseResults/deepRvalue.frag.out | 285 + .../Test/baseResults/depthOut.frag.out | 38 + .../Test/baseResults/discard-dce.frag.out | 239 + .../Test/baseResults/doWhileLoop.frag.out | 65 + .../baseResults/earlyReturnDiscard.frag.out | 257 + deps/glslang/Test/baseResults/empty.frag.out | 17 + deps/glslang/Test/baseResults/errors.frag.out | 32 + .../Test/baseResults/es-link1.frag.out | 27 + .../Test/baseResults/findFunction.frag.out | 233 + .../Test/baseResults/flowControl.frag.out | 81 + .../glslang/Test/baseResults/forLoop.frag.out | 361 + .../Test/baseResults/forwardRef.frag.out | 125 + .../Test/baseResults/functionCall.frag.out | 183 + .../baseResults/functionSemantics.frag.out | 401 + .../Test/baseResults/glsl.-D-U.frag.out | 55 + .../glsl.entryPointRename.vert.bad.out | 45 + .../glsl.entryPointRename.vert.out | 43 + .../glsl.entryPointRename2.vert.out | 4 + .../Test/baseResults/glspv.esversion.vert.out | 6 + deps/glslang/Test/baseResults/glspv.frag.out | 15 + .../Test/baseResults/glspv.version.frag.out | 20 + .../Test/baseResults/glspv.version.vert.out | 6 + deps/glslang/Test/baseResults/glspv.vert.out | 13 + .../Test/baseResults/hlsl.-D-U.frag.out | 65 + .../Test/baseResults/hlsl.PointSize.geom.out | 147 + .../Test/baseResults/hlsl.PointSize.vert.out | 69 + .../baseResults/hlsl.aliasOpaque.frag.out | 242 + .../Test/baseResults/hlsl.amend.frag.out | 257 + .../baseResults/hlsl.array.flatten.frag.out | 592 ++ .../Test/baseResults/hlsl.array.frag.out | 475 + .../hlsl.array.implicit-size.frag.out | 266 + .../baseResults/hlsl.array.multidim.frag.out | 224 + .../Test/baseResults/hlsl.assoc.frag.out | 245 + .../hlsl.attribute.expression.comp.out | 152 + .../Test/baseResults/hlsl.attribute.frag.out | 99 + .../baseResults/hlsl.attributeC11.frag.out | 197 + .../hlsl.attributeGlobalBuffer.frag.out | 109 + .../Test/baseResults/hlsl.automap.frag.out | 29 + .../Test/baseResults/hlsl.basic.comp.out | 132 + .../Test/baseResults/hlsl.basic.geom.out | 309 + .../Test/baseResults/hlsl.boolConv.vert.out | 333 + .../Test/baseResults/hlsl.buffer.frag.out | 327 + .../hlsl.calculatelod.dx10.frag.out | 580 + .../hlsl.calculatelodunclamped.dx10.frag.out | 580 + .../Test/baseResults/hlsl.cast.frag.out | 127 + .../hlsl.cbuffer-identifier.vert.out | 404 + .../Test/baseResults/hlsl.charLit.vert.out | 233 + .../Test/baseResults/hlsl.clip.frag.out | 123 + .../baseResults/hlsl.clipdistance-1.frag.out | 190 + .../baseResults/hlsl.clipdistance-1.geom.out | 737 ++ .../baseResults/hlsl.clipdistance-1.vert.out | 194 + .../baseResults/hlsl.clipdistance-2.frag.out | 419 + .../baseResults/hlsl.clipdistance-2.geom.out | 924 ++ .../baseResults/hlsl.clipdistance-2.vert.out | 561 + .../baseResults/hlsl.clipdistance-3.frag.out | 190 + .../baseResults/hlsl.clipdistance-3.geom.out | 830 ++ .../baseResults/hlsl.clipdistance-3.vert.out | 229 + .../baseResults/hlsl.clipdistance-4.frag.out | 262 + .../baseResults/hlsl.clipdistance-4.geom.out | 819 ++ .../baseResults/hlsl.clipdistance-4.vert.out | 382 + .../baseResults/hlsl.clipdistance-5.frag.out | 325 + .../baseResults/hlsl.clipdistance-5.vert.out | 431 + .../baseResults/hlsl.clipdistance-6.frag.out | 399 + .../baseResults/hlsl.clipdistance-6.vert.out | 556 + .../baseResults/hlsl.clipdistance-7.frag.out | 385 + .../baseResults/hlsl.clipdistance-7.vert.out | 505 + .../baseResults/hlsl.clipdistance-8.frag.out | 285 + .../baseResults/hlsl.clipdistance-8.vert.out | 336 + .../baseResults/hlsl.clipdistance-9.frag.out | 250 + .../baseResults/hlsl.clipdistance-9.vert.out | 299 + .../Test/baseResults/hlsl.color.hull.tesc.out | 572 + .../baseResults/hlsl.comparison.vec.frag.out | 416 + .../baseResults/hlsl.conditional.frag.out | 797 ++ .../baseResults/hlsl.constantbuffer.frag.out | 245 + .../baseResults/hlsl.constructArray.vert.out | 381 + .../baseResults/hlsl.constructexpr.frag.out | 164 + .../baseResults/hlsl.constructimat.frag.out | 698 ++ .../Test/baseResults/hlsl.coverage.frag.out | 208 + .../Test/baseResults/hlsl.dashI.vert.out | 69 + .../hlsl.deadFunctionMissingBody.vert.out | 33 + .../baseResults/hlsl.depthGreater.frag.out | 95 + .../Test/baseResults/hlsl.depthLess.frag.out | 76 + .../Test/baseResults/hlsl.discard.frag.out | 191 + .../Test/baseResults/hlsl.doLoop.frag.out | 271 + .../Test/baseResults/hlsl.domain.1.tese.out | 457 + .../Test/baseResults/hlsl.domain.2.tese.out | 447 + .../Test/baseResults/hlsl.domain.3.tese.out | 424 + .../hlsl.emptystruct.init.vert.out | 112 + .../hlsl.emptystructreturn.frag.out | 105 + .../hlsl.emptystructreturn.vert.out | 102 + .../Test/baseResults/hlsl.entry-in.frag.out | 286 + .../Test/baseResults/hlsl.entry-out.frag.out | 400 + .../baseResults/hlsl.entry.rename.frag.out | 133 + .../hlsl.explicitDescriptorSet-2.frag.out | 66 + .../hlsl.explicitDescriptorSet.frag.out | 66 + .../baseResults/hlsl.flatten.return.frag.out | 200 + .../baseResults/hlsl.flattenOpaque.frag.out | 478 + .../hlsl.flattenOpaqueInit.vert.out | 291 + .../hlsl.flattenOpaqueInitMix.vert.out | 195 + .../baseResults/hlsl.flattenSubset.frag.out | 216 + .../baseResults/hlsl.flattenSubset2.frag.out | 248 + .../Test/baseResults/hlsl.float1.frag.out | 111 + .../Test/baseResults/hlsl.float4.frag.out | 96 + .../Test/baseResults/hlsl.forLoop.frag.out | 705 ++ deps/glslang/Test/baseResults/hlsl.frag.out | 161 + .../Test/baseResults/hlsl.fraggeom.frag.out | 112 + .../Test/baseResults/hlsl.function.frag.out | 119 + .../hlsl.gather.array.dx10.frag.out | 453 + .../hlsl.gather.basic.dx10.frag.out | 467 + .../hlsl.gather.basic.dx10.vert.out | 411 + .../hlsl.gather.offset.dx10.frag.out | 388 + .../hlsl.gather.offsetarray.dx10.frag.out | 353 + .../hlsl.gatherRGBA.array.dx10.frag.out | 1119 ++ .../hlsl.gatherRGBA.basic.dx10.frag.out | 1145 ++ .../hlsl.gatherRGBA.offset.dx10.frag.out | 1796 ++++ .../hlsl.gatherRGBA.offsetarray.dx10.frag.out | 1770 ++++ .../hlsl.gathercmpRGBA.offset.dx10.frag.out | 711 ++ .../hlsl.getdimensions.dx10.frag.out | 3197 ++++++ .../hlsl.getdimensions.dx10.vert.out | 200 + .../hlsl.getdimensions.rw.dx10.frag.out | 1117 ++ .../hlsl.getsampleposition.dx10.frag.out | 846 ++ .../hlsl.global-const-init.frag.out | 178 + .../Test/baseResults/hlsl.groupid.comp.out | 146 + .../Test/baseResults/hlsl.gs-hs-mix.tesc.out | 1158 ++ .../Test/baseResults/hlsl.hlslOffset.vert.out | 85 + .../Test/baseResults/hlsl.hull.1.tesc.out | 373 + .../Test/baseResults/hlsl.hull.2.tesc.out | 371 + .../Test/baseResults/hlsl.hull.3.tesc.out | 372 + .../Test/baseResults/hlsl.hull.4.tesc.out | 679 ++ .../Test/baseResults/hlsl.hull.5.tesc.out | 188 + .../baseResults/hlsl.hull.ctrlpt-1.tesc.out | 604 ++ .../baseResults/hlsl.hull.ctrlpt-2.tesc.out | 625 ++ .../Test/baseResults/hlsl.hull.void.tesc.out | 204 + .../hlsl.identifier.sample.frag.out | 139 + .../glslang/Test/baseResults/hlsl.if.frag.out | 370 + .../hlsl.imagefetch-subvec4.comp.out | 142 + .../baseResults/hlsl.implicitBool.frag.out | 538 + .../Test/baseResults/hlsl.include.vert.out | 75 + .../baseResults/hlsl.includeNegative.vert.out | 10 + .../Test/baseResults/hlsl.inf.vert.out | 172 + .../Test/baseResults/hlsl.init.frag.out | 530 + .../Test/baseResults/hlsl.init2.frag.out | 531 + .../Test/baseResults/hlsl.inoutquals.frag.out | 375 + .../baseResults/hlsl.intrinsic.frexp.frag.out | 336 + .../baseResults/hlsl.intrinsic.frexp.vert.out | 222 + .../hlsl.intrinsics.barriers.comp.out | 96 + .../Test/baseResults/hlsl.intrinsics.comp.out | 1106 ++ .../hlsl.intrinsics.d3dcolortoubyte4.frag.out | 125 + .../hlsl.intrinsics.double.frag.out | 339 + .../hlsl.intrinsics.evalfns.frag.out | 290 + .../hlsl.intrinsics.f1632.frag.out | 389 + .../hlsl.intrinsics.f3216.frag.out | 402 + .../Test/baseResults/hlsl.intrinsics.frag.out | 8480 +++++++++++++++ .../baseResults/hlsl.intrinsics.lit.frag.out | 204 + .../hlsl.intrinsics.negative.comp.out | 343 + .../hlsl.intrinsics.negative.frag.out | 986 ++ .../hlsl.intrinsics.negative.vert.out | 550 + .../hlsl.intrinsics.promote.down.frag.out | 198 + .../hlsl.intrinsics.promote.frag.out | 1328 +++ .../hlsl.intrinsics.promote.outputs.frag.out | 354 + .../Test/baseResults/hlsl.intrinsics.vert.out | 4200 ++++++++ .../Test/baseResults/hlsl.isfinite.frag.out | 293 + .../Test/baseResults/hlsl.layout.frag.out | 171 + .../baseResults/hlsl.layoutOverride.vert.out | 104 + .../baseResults/hlsl.load.2dms.dx10.frag.out | 552 + .../baseResults/hlsl.load.array.dx10.frag.out | 643 ++ .../baseResults/hlsl.load.basic.dx10.frag.out | 765 ++ .../baseResults/hlsl.load.basic.dx10.vert.out | 710 ++ .../hlsl.load.buffer.dx10.frag.out | 302 + .../hlsl.load.buffer.float.dx10.frag.out | 311 + .../hlsl.load.offset.dx10.frag.out | 860 ++ .../hlsl.load.offsetarray.dx10.frag.out | 707 ++ .../hlsl.load.rwbuffer.dx10.frag.out | 214 + .../hlsl.load.rwtexture.array.dx10.frag.out | 410 + .../hlsl.load.rwtexture.dx10.frag.out | 459 + .../hlsl.localStructuredBuffer.comp.out | 34 + .../baseResults/hlsl.logical.binary.frag.out | 218 + .../hlsl.logical.binary.vec.frag.out | 415 + .../baseResults/hlsl.logical.unary.frag.out | 312 + .../baseResults/hlsl.logicalConvert.frag.out | 342 + .../Test/baseResults/hlsl.loopattr.frag.out | 233 + .../Test/baseResults/hlsl.matNx1.frag.out | 279 + .../baseResults/hlsl.matType.bool.frag.out | 437 + .../Test/baseResults/hlsl.matType.frag.out | 107 + .../baseResults/hlsl.matType.int.frag.out | 756 ++ .../Test/baseResults/hlsl.matpack-1.frag.out | 187 + .../baseResults/hlsl.matpack-pragma.frag.out | 268 + .../baseResults/hlsl.matrixSwizzle.vert.out | 856 ++ .../baseResults/hlsl.matrixindex.frag.out | 421 + .../Test/baseResults/hlsl.max.frag.out | 129 + .../baseResults/hlsl.memberFunCall.frag.out | 264 + .../Test/baseResults/hlsl.mintypes.frag.out | 238 + .../baseResults/hlsl.mip.negative.frag.out | 68 + .../baseResults/hlsl.mip.negative2.frag.out | 74 + .../baseResults/hlsl.mip.operator.frag.out | 209 + .../baseResults/hlsl.mul-truncate.frag.out | 643 ++ .../hlsl.multiDescriptorSet.frag.out | 168 + .../Test/baseResults/hlsl.multiEntry.vert.out | 140 + .../baseResults/hlsl.multiReturn.frag.out | 128 + .../Test/baseResults/hlsl.namespace.frag.out | 185 + .../hlsl.noSemantic.functionality1.comp.out | 62 + .../baseResults/hlsl.nonint-index.frag.out | 152 + .../hlsl.nonstaticMemberFunction.frag.out | 436 + .../baseResults/hlsl.numericsuffixes.frag.out | 292 + .../Test/baseResults/hlsl.numthreads.comp.out | 93 + .../baseResults/hlsl.opaque-type-bug.frag.out | 112 + .../Test/baseResults/hlsl.overload.frag.out | 1625 +++ .../baseResults/hlsl.params.default.frag.out | 653 ++ .../hlsl.params.default.negative.frag.out | 385 + .../hlsl.partialFlattenLocal.vert.out | 375 + .../hlsl.partialFlattenMixed.vert.out | 167 + .../baseResults/hlsl.partialInit.frag.out | 571 + .../Test/baseResults/hlsl.pp.expand.frag.err | 0 .../Test/baseResults/hlsl.pp.expand.frag.out | 19 + .../Test/baseResults/hlsl.pp.line.frag.out | 192 + .../glslang/Test/baseResults/hlsl.pp.vert.out | 61 + .../Test/baseResults/hlsl.precedence.frag.out | 257 + .../baseResults/hlsl.precedence2.frag.out | 218 + .../Test/baseResults/hlsl.precise.frag.out | 139 + .../baseResults/hlsl.preprocessor.frag.out | 163 + .../baseResults/hlsl.promote.atomic.frag.out | 123 + .../baseResults/hlsl.promote.binary.frag.out | 294 + .../baseResults/hlsl.promote.vec1.frag.out | 132 + .../Test/baseResults/hlsl.promotions.frag.out | 2381 +++++ .../hlsl.reflection.binding.frag.out | 19 + .../hlsl.reflection.binding.vert.out | 15 + .../Test/baseResults/hlsl.reflection.vert.out | 76 + .../Test/baseResults/hlsl.rw.atomics.frag.out | 5275 ++++++++++ .../Test/baseResults/hlsl.rw.bracket.frag.out | 2665 +++++ .../baseResults/hlsl.rw.register.frag.out | 172 + .../hlsl.rw.scalar.bracket.frag.out | 2574 +++++ .../Test/baseResults/hlsl.rw.swizzle.frag.out | 300 + .../baseResults/hlsl.rw.vec2.bracket.frag.out | 2627 +++++ .../hlsl.sample.array.dx10.frag.out | 541 + .../hlsl.sample.basic.dx10.frag.out | 862 ++ .../hlsl.sample.offset.dx10.frag.out | 603 ++ .../hlsl.sample.offsetarray.dx10.frag.out | 452 + .../hlsl.sample.sub-vec4.dx10.frag.out | 266 + .../hlsl.samplebias.array.dx10.frag.out | 577 + .../hlsl.samplebias.basic.dx10.frag.out | 678 ++ .../hlsl.samplebias.offset.dx10.frag.out | 643 ++ .../hlsl.samplebias.offsetarray.dx10.frag.out | 480 + .../hlsl.samplecmp.array.dx10.frag.out | 705 ++ .../hlsl.samplecmp.basic.dx10.frag.out | 676 ++ .../hlsl.samplecmp.dualmode.frag.out | 157 + .../hlsl.samplecmp.negative.frag.out | 98 + .../hlsl.samplecmp.negative2.frag.out | 80 + .../hlsl.samplecmp.offset.dx10.frag.out | 585 ++ .../hlsl.samplecmp.offsetarray.dx10.frag.out | 608 ++ ...lsl.samplecmplevelzero.array.dx10.frag.out | 742 ++ ...lsl.samplecmplevelzero.basic.dx10.frag.out | 713 ++ ...sl.samplecmplevelzero.offset.dx10.frag.out | 610 ++ ...mplecmplevelzero.offsetarray.dx10.frag.out | 633 ++ .../hlsl.samplegrad.array.dx10.frag.out | 643 ++ .../hlsl.samplegrad.basic.dx10.frag.out | 791 ++ .../hlsl.samplegrad.basic.dx10.vert.out | 735 ++ .../hlsl.samplegrad.offset.dx10.frag.out | 716 ++ .../hlsl.samplegrad.offsetarray.dx10.frag.out | 527 + .../hlsl.samplelevel.array.dx10.frag.out | 578 + .../hlsl.samplelevel.basic.dx10.frag.out | 684 ++ .../hlsl.samplelevel.basic.dx10.vert.out | 623 ++ .../hlsl.samplelevel.offset.dx10.frag.out | 640 ++ ...hlsl.samplelevel.offsetarray.dx10.frag.out | 477 + .../baseResults/hlsl.scalar-length.frag.out | 112 + .../baseResults/hlsl.scalar2matrix.frag.out | 506 + .../Test/baseResults/hlsl.scalarCast.vert.out | 493 + .../Test/baseResults/hlsl.scope.frag.out | 191 + .../Test/baseResults/hlsl.self_cast.frag.out | 130 + .../Test/baseResults/hlsl.semantic-1.vert.out | 374 + .../Test/baseResults/hlsl.semantic.geom.out | 284 + .../Test/baseResults/hlsl.semantic.vert.out | 333 + .../Test/baseResults/hlsl.semicolons.frag.out | 131 + .../Test/baseResults/hlsl.shapeConv.frag.out | 489 + .../baseResults/hlsl.shapeConvRet.frag.out | 127 + .../baseResults/hlsl.shift.per-set.frag.out | 230 + .../Test/baseResults/hlsl.sin.frag.out | 101 + .../Test/baseResults/hlsl.snorm.uav.comp.out | 212 + .../baseResults/hlsl.staticFuncInit.frag.out | 218 + .../hlsl.staticMemberFunction.frag.out | 200 + ...sl.store.rwbyteaddressbuffer.type.comp.out | 173 + .../Test/baseResults/hlsl.string.frag.out | 97 + .../baseResults/hlsl.stringtoken.frag.out | 132 + .../Test/baseResults/hlsl.struct.frag.out | 417 + .../baseResults/hlsl.struct.split-1.vert.out | 321 + .../hlsl.struct.split.array.geom.out | 306 + .../hlsl.struct.split.assign.frag.out | 325 + .../hlsl.struct.split.call.vert.out | 348 + .../hlsl.struct.split.nested.geom.out | 617 ++ .../hlsl.struct.split.trivial.geom.out | 309 + .../hlsl.struct.split.trivial.vert.out | 178 + .../baseResults/hlsl.structIoFourWay.frag.out | 300 + .../hlsl.structStructName.frag.out | 85 + .../hlsl.structarray.flatten.frag.out | 306 + .../hlsl.structarray.flatten.geom.out | 279 + .../hlsl.structbuffer.append.fn.frag.out | 280 + .../hlsl.structbuffer.append.frag.out | 224 + .../hlsl.structbuffer.atomics.frag.out | 605 ++ .../hlsl.structbuffer.byte.frag.out | 482 + .../hlsl.structbuffer.coherent.frag.out | 312 + .../hlsl.structbuffer.floatidx.comp.out | 327 + .../baseResults/hlsl.structbuffer.fn.frag.out | 298 + .../hlsl.structbuffer.fn2.comp.out | 248 + .../baseResults/hlsl.structbuffer.frag.out | 352 + ...hlsl.structbuffer.incdec.frag.hlslfun1.out | 125 + .../hlsl.structbuffer.incdec.frag.out | 324 + .../baseResults/hlsl.structbuffer.rw.frag.out | 310 + .../hlsl.structbuffer.rwbyte.frag.out | 1310 +++ .../Test/baseResults/hlsl.structin.vert.out | 499 + .../Test/baseResults/hlsl.subpass.frag.out | 777 ++ .../Test/baseResults/hlsl.switch.frag.out | 469 + .../Test/baseResults/hlsl.swizzle.frag.out | 123 + .../baseResults/hlsl.synthesizeInput.frag.out | 172 + .../Test/baseResults/hlsl.target.frag.out | 209 + .../baseResults/hlsl.targetStruct1.frag.out | 298 + .../baseResults/hlsl.targetStruct2.frag.out | 298 + .../baseResults/hlsl.templatetypes.frag.out | 734 ++ .../baseResults/hlsl.texture.struct.frag.out | 1201 +++ .../baseResults/hlsl.texture.subvec4.frag.out | 544 + .../baseResults/hlsl.texturebuffer.frag.out | 153 + .../Test/baseResults/hlsl.this.frag.out | 379 + .../hlsl.tristream-append.geom.out | 216 + .../Test/baseResults/hlsl.tx.bracket.frag.out | 716 ++ .../baseResults/hlsl.tx.overload.frag.out | 247 + .../Test/baseResults/hlsl.type.half.frag.out | 254 + .../baseResults/hlsl.type.identifier.frag.out | 436 + .../hlsl.type.type.conversion.all.frag.out | 1469 +++ .../hlsl.type.type.conversion.valid.frag.out | 1640 +++ .../baseResults/hlsl.typeGraphCopy.vert.out | 128 + .../Test/baseResults/hlsl.typedef.frag.out | 134 + .../Test/baseResults/hlsl.void.frag.out | 108 + .../baseResults/hlsl.wavebroadcast.comp.out | 2731 +++++ .../Test/baseResults/hlsl.waveprefix.comp.out | 2766 +++++ .../Test/baseResults/hlsl.wavequad.comp.out | 9299 +++++++++++++++++ .../Test/baseResults/hlsl.wavequery.comp.out | 116 + .../Test/baseResults/hlsl.wavequery.frag.out | 123 + .../baseResults/hlsl.wavereduction.comp.out | 7218 +++++++++++++ .../Test/baseResults/hlsl.wavevote.comp.out | 316 + .../Test/baseResults/hlsl.whileLoop.frag.out | 196 + .../Test/baseResults/hlsl.y-negate-1.vert.out | 130 + .../Test/baseResults/hlsl.y-negate-2.vert.out | 148 + .../Test/baseResults/hlsl.y-negate-3.vert.out | 211 + .../implicitInnerAtomicUint.frag.out | 20 + .../glslang/Test/baseResults/include.vert.out | 67 + .../Test/baseResults/invalidSwizzle.vert.out | 38 + deps/glslang/Test/baseResults/length.frag.out | 61 + .../baseResults/lineContinuation.vert.out | 280 + .../baseResults/lineContinuation100.vert.out | 127 + deps/glslang/Test/baseResults/link1.frag.out | 162 + .../Test/baseResults/link1.vk.frag.out | 314 + .../Test/baseResults/localAggregates.frag.out | 414 + deps/glslang/Test/baseResults/loops.frag.out | 1935 ++++ .../Test/baseResults/loopsArtificial.frag.out | 433 + deps/glslang/Test/baseResults/mains1.frag.out | 69 + deps/glslang/Test/baseResults/matrix.frag.out | 507 + .../glslang/Test/baseResults/matrix2.frag.out | 353 + .../Test/baseResults/matrixError.vert.out | 77 + .../baseResults/maxClipDistances.vert.out | 21 + .../Test/baseResults/max_vertices_0.geom.out | 35 + .../Test/baseResults/missingBodies.vert.out | 96 + .../Test/baseResults/mixedArrayDecls.frag.out | 68 + .../baseResults/negativeArraySize.comp.out | 23 + .../Test/baseResults/newTexture.frag.out | 521 + deps/glslang/Test/baseResults/noMain.vert.out | 43 + .../Test/baseResults/nonSquare.vert.out | 183 + .../Test/baseResults/nonVulkan.frag.out | 29 + .../Test/baseResults/nonuniform.frag.out | 92 + deps/glslang/Test/baseResults/nosuffix.out | 15 + .../glslang/Test/baseResults/numeral.frag.out | 832 ++ ...vShaderNoperspectiveInterpolation.frag.out | 38 + .../Test/baseResults/overlongLiteral.frag.out | 19 + .../Test/baseResults/pointCoord.frag.out | 69 + .../glslang/Test/baseResults/precise.tesc.out | 396 + .../baseResults/precise_struct_block.vert.out | 534 + .../Test/baseResults/precision.frag.out | 233 + .../Test/baseResults/precision.vert.out | 99 + .../glslang/Test/baseResults/prepost.frag.out | 271 + .../baseResults/preprocessor.bad_arg.vert.err | 4 + .../baseResults/preprocessor.bad_arg.vert.out | 0 .../preprocessor.cpp_style___FILE__.vert.err | 0 .../preprocessor.cpp_style___FILE__.vert.out | 37 + ...rocessor.cpp_style_line_directive.vert.err | 15 + ...rocessor.cpp_style_line_directive.vert.out | 0 .../baseResults/preprocessor.defined.vert.err | 4 + .../baseResults/preprocessor.defined.vert.out | 0 .../preprocessor.edge_cases.vert.err | 0 .../preprocessor.edge_cases.vert.out | 16 + .../preprocessor.eof_missing.vert.err | 0 .../preprocessor.eof_missing.vert.out | 2 + .../baseResults/preprocessor.errors.vert.err | 7 + .../baseResults/preprocessor.errors.vert.out | 0 .../preprocessor.extensions.vert.err | 2 + .../preprocessor.extensions.vert.out | 12 + .../preprocessor.function_macro.vert.err | 0 .../preprocessor.function_macro.vert.out | 21 + .../preprocessor.include.disabled.vert.err | 13 + .../preprocessor.include.disabled.vert.out | 0 .../preprocessor.include.enabled.vert.err | 20 + .../preprocessor.include.enabled.vert.out | 0 .../baseResults/preprocessor.line.frag.err | 0 .../baseResults/preprocessor.line.frag.out | 5 + .../baseResults/preprocessor.line.vert.err | 0 .../baseResults/preprocessor.line.vert.out | 39 + .../preprocessor.many.endif.vert.err | 12 + .../preprocessor.many.endif.vert.out | 0 .../baseResults/preprocessor.pragma.vert.err | 2 + .../baseResults/preprocessor.pragma.vert.out | 14 + .../baseResults/preprocessor.simple.vert.err | 0 .../baseResults/preprocessor.simple.vert.out | 66 + ...essor.success_if_parse_would_fail.vert.err | 0 ...essor.success_if_parse_would_fail.vert.out | 4 + .../Test/baseResults/recurse1.vert.out | 229 + .../Test/baseResults/reflection.vert.out | 107 + .../baseResults/remap.basic.dcefunc.frag.out | 33 + .../remap.basic.dcevartype.frag.out | 12 + .../remap.basic.everything.frag.out | 25 + .../baseResults/remap.basic.none.frag.out | 38 + .../baseResults/remap.basic.strip.frag.out | 33 + ...emap.hlsl.sample.basic.everything.frag.out | 229 + .../remap.hlsl.sample.basic.none.frag.out | 314 + .../remap.hlsl.sample.basic.strip.frag.out | 262 + ...map.hlsl.templatetypes.everything.frag.out | 38 + .../remap.hlsl.templatetypes.none.frag.out | 240 + .../baseResults/remap.if.everything.frag.out | 41 + .../Test/baseResults/remap.if.none.frag.out | 45 + .../baseResults/remap.invalid-spirv-1.out | 1 + .../baseResults/remap.invalid-spirv-2.out | 1 + .../remap.literal64.everything.spv.out | 7 + .../baseResults/remap.literal64.none.spv.out | 25 + .../remap.similar_1a.everything.frag.out | 115 + .../remap.similar_1a.none.frag.out | 129 + .../remap.similar_1b.everything.frag.out | 121 + .../remap.similar_1b.none.frag.out | 135 + .../Test/baseResults/remap.specconst.comp.out | 31 + .../remap.switch.everything.frag.out | 76 + .../baseResults/remap.switch.none.frag.out | 80 + .../remap.uniformarray.everything.frag.out | 64 + .../remap.uniformarray.none.frag.out | 77 + .../Test/baseResults/runtimeArray.vert.out | 647 ++ deps/glslang/Test/baseResults/sample.frag.out | 33 + deps/glslang/Test/baseResults/sample.vert.out | 43 + .../samplerlessTextureFunctions.frag.out | 13 + .../baseResults/simpleFunctionCall.frag.out | 43 + .../Test/baseResults/specExamples.frag.out | 599 ++ .../Test/baseResults/specExamples.vert.out | 598 ++ .../baseResults/specExamplesConf.vert.out | 599 ++ .../spv.1.3.8bitstorage-ssbo.vert.out | 56 + .../spv.1.3.8bitstorage-ubo.vert.out | 56 + .../Test/baseResults/spv.100ops.frag.out | 98 + .../glslang/Test/baseResults/spv.130.frag.out | 313 + .../glslang/Test/baseResults/spv.140.frag.out | 170 + .../glslang/Test/baseResults/spv.150.geom.out | 149 + .../glslang/Test/baseResults/spv.150.vert.out | 103 + .../baseResults/spv.16bitstorage-int.frag.out | 334 + .../spv.16bitstorage-uint.frag.out | 336 + .../baseResults/spv.16bitstorage.frag.out | 336 + .../spv.16bitstorage_Error-int.frag.out | 91 + .../spv.16bitstorage_Error-uint.frag.out | 91 + .../spv.16bitstorage_Error.frag.out | 99 + .../Test/baseResults/spv.300BuiltIns.vert.out | 73 + .../Test/baseResults/spv.300layout.frag.out | 73 + .../Test/baseResults/spv.300layout.vert.out | 248 + .../Test/baseResults/spv.300layoutp.vert.out | 200 + .../Test/baseResults/spv.310.bitcast.frag.out | 228 + .../glslang/Test/baseResults/spv.310.comp.out | 133 + .../spv.320.meshShaderUserDefined.mesh.out | 205 + .../glslang/Test/baseResults/spv.330.geom.out | 67 + .../glslang/Test/baseResults/spv.400.frag.out | 1395 +++ .../glslang/Test/baseResults/spv.400.tesc.out | 170 + .../glslang/Test/baseResults/spv.400.tese.out | 183 + .../glslang/Test/baseResults/spv.420.geom.out | 130 + .../glslang/Test/baseResults/spv.430.frag.out | 48 + .../glslang/Test/baseResults/spv.430.vert.out | 136 + .../glslang/Test/baseResults/spv.450.geom.out | 77 + .../baseResults/spv.450.noRedecl.tesc.out | 47 + .../glslang/Test/baseResults/spv.450.tesc.out | 120 + .../glslang/Test/baseResults/spv.460.comp.out | 33 + .../glslang/Test/baseResults/spv.460.frag.out | 51 + .../glslang/Test/baseResults/spv.460.vert.out | 45 + .../baseResults/spv.8bitstorage-int.frag.out | 333 + .../baseResults/spv.8bitstorage-ssbo.vert.out | 56 + .../baseResults/spv.8bitstorage-ubo.vert.out | 56 + .../baseResults/spv.8bitstorage-uint.frag.out | 335 + .../spv.8bitstorage_Error-int.frag.out | 71 + .../spv.8bitstorage_Error-uint.frag.out | 71 + .../baseResults/spv.AnyHitShader.rahit.out | 163 + .../spv.AnyHitShader_Errors.rahit.out | 8 + .../Test/baseResults/spv.AofA.frag.out | 156 + .../spv.ClosestHitShader.rchit.out | 169 + .../spv.ClosestHitShader_Errors.rchit.out | 9 + .../spv.GeometryShaderPassthrough.geom.out | 45 + .../baseResults/spv.IntersectShader.rint.out | 138 + .../spv.IntersectShader_Errors.rint.out | 10 + .../Test/baseResults/spv.MissShader.rmiss.out | 113 + .../spv.MissShader_Errors.rmiss.out | 21 + .../baseResults/spv.OVR_multiview.vert.out | 57 + .../Test/baseResults/spv.Operations.frag.out | 702 ++ .../baseResults/spv.RayCallable.rcall.out | 73 + .../spv.RayCallable_Errors.rcall.out | 33 + .../baseResults/spv.RayConstants.rgen.out | 46 + .../baseResults/spv.RayGenShader.rgen.out | 101 + .../spv.RayGenShader_Errors.rgen.out | 39 + .../Test/baseResults/spv.accessChain.frag.out | 351 + .../Test/baseResults/spv.aggOps.frag.out | 312 + .../baseResults/spv.always-discard.frag.out | 110 + .../baseResults/spv.always-discard2.frag.out | 63 + .../spv.arbPostDepthCoverage.frag.out | 42 + .../spv.arbPostDepthCoverage_Error.frag.out | 7 + .../Test/baseResults/spv.atomic.comp.out | 128 + .../Test/baseResults/spv.atomicInt64.comp.out | 215 + .../Test/baseResults/spv.barrier.vert.out | 46 + .../Test/baseResults/spv.bitCast.frag.out | 234 + .../Test/baseResults/spv.bool.vert.out | 79 + .../Test/baseResults/spv.boolInBlock.frag.out | 158 + .../baseResults/spv.branch-return.vert.out | 65 + .../spv.buffer.autoassign.frag.out | 93 + .../Test/baseResults/spv.builtInXFB.vert.out | 51 + .../spv.computeShaderDerivatives.comp.out | 358 + .../spv.computeShaderDerivatives2.comp.out | 358 + .../spv.conditionalDiscard.frag.out | 58 + .../Test/baseResults/spv.constStruct.vert.out | 45 + .../spv.controlFlowAttributes.frag.out | 240 + .../Test/baseResults/spv.conversion.frag.out | 574 + .../Test/baseResults/spv.dataOut.frag.out | 35 + .../baseResults/spv.dataOutIndirect.frag.out | 47 + .../baseResults/spv.dataOutIndirect.vert.out | 66 + .../baseResults/spv.debugInfo.1.1.frag.out | 279 + .../Test/baseResults/spv.debugInfo.frag.out | 280 + .../Test/baseResults/spv.deepRvalue.frag.out | 197 + .../Test/baseResults/spv.depthOut.frag.out | 34 + .../Test/baseResults/spv.deviceGroup.frag.out | 36 + .../Test/baseResults/spv.discard-dce.frag.out | 127 + .../Test/baseResults/spv.do-simple.vert.out | 40 + .../spv.do-while-continue-break.vert.out | 78 + .../Test/baseResults/spv.doWhileLoop.frag.out | 60 + .../Test/baseResults/spv.double.comp.out | 98 + .../Test/baseResults/spv.drawParams.vert.out | 56 + .../spv.earlyReturnDiscard.frag.out | 170 + .../baseResults/spv.explicittypes.frag.out | 886 ++ .../spv.extPostDepthCoverage.frag.out | 23 + .../spv.extPostDepthCoverage_Error.frag.out | 4 + .../Test/baseResults/spv.float16.frag.out | 845 ++ .../baseResults/spv.float16Fetch.frag.out | 7074 +++++++++++++ .../Test/baseResults/spv.float32.frag.out | 811 ++ .../Test/baseResults/spv.float64.frag.out | 799 ++ .../Test/baseResults/spv.flowControl.frag.out | 70 + .../spv.for-complex-condition.vert.out | 58 + .../spv.for-continue-break.vert.out | 81 + .../Test/baseResults/spv.for-nobody.vert.out | 48 + .../Test/baseResults/spv.for-notest.vert.out | 42 + .../Test/baseResults/spv.for-simple.vert.out | 46 + .../Test/baseResults/spv.forLoop.frag.out | 212 + .../Test/baseResults/spv.forwardFun.frag.out | 114 + .../spv.fragmentShaderBarycentric.frag.out | 69 + .../spv.fragmentShaderBarycentric2.frag.out | 65 + .../baseResults/spv.fullyCovered.frag.out | 37 + .../baseResults/spv.functionCall.frag.out | 124 + .../spv.functionNestedOpaque.vert.out | 70 + .../spv.functionSemantics.frag.out | 227 + .../Test/baseResults/spv.glFragColor.frag.out | 27 + .../spv.glsl.register.autoassign.frag.out | 223 + .../spv.glsl.register.noautoassign.frag.out | 226 + .../baseResults/spv.hlslDebugInfo.frag.out | 58 + .../Test/baseResults/spv.hlslOffsets.vert.out | 76 + .../Test/baseResults/spv.image.frag.out | 541 + .../spv.image.load-formatted.frag.out | 352 + .../spv.imageLoadStoreLod.frag.out | 139 + .../Test/baseResults/spv.int16.amd.frag.out | 803 ++ .../Test/baseResults/spv.int16.frag.out | 746 ++ .../Test/baseResults/spv.int32.frag.out | 716 ++ .../Test/baseResults/spv.int64.frag.out | 688 ++ .../Test/baseResults/spv.int8.frag.out | 741 ++ .../Test/baseResults/spv.intOps.vert.out | 347 + .../Test/baseResults/spv.interpOps.frag.out | 137 + .../baseResults/spv.layoutNested.vert.out | 241 + .../Test/baseResults/spv.length.frag.out | 52 + .../baseResults/spv.localAggregates.frag.out | 215 + .../Test/baseResults/spv.loops.frag.out | 1105 ++ .../baseResults/spv.loopsArtificial.frag.out | 240 + .../spv.looseUniformNoLoc.vert.out | 8 + .../Test/baseResults/spv.matFun.vert.out | 155 + .../Test/baseResults/spv.matrix.frag.out | 334 + .../Test/baseResults/spv.matrix2.frag.out | 269 + .../baseResults/spv.memoryQualifier.frag.out | 179 + .../spv.memoryScopeSemantics.comp.out | 239 + .../spv.memoryScopeSemantics_Error.comp.out | 17 + .../spv.merge-unreachable.frag.out | 41 + .../spv.meshShaderBuiltins.mesh.out | 258 + .../spv.meshShaderPerViewBuiltins.mesh.out | 214 + .../spv.meshShaderPerViewUserDefined.mesh.out | 156 + .../spv.meshShaderRedeclBuiltins.mesh.out | 201 + ...v.meshShaderRedeclPerViewBuiltins.mesh.out | 187 + .../spv.meshShaderSharedMem.mesh.out | 128 + .../spv.meshShaderTaskMem.mesh.out | 107 + .../spv.meshShaderUserDefined.mesh.out | 203 + .../baseResults/spv.meshTaskShader.task.out | 172 + .../Test/baseResults/spv.multiStruct.comp.out | 266 + .../spv.multiStructFuncall.frag.out | 119 + .../Test/baseResults/spv.multiView.frag.out | 36 + .../spv.multiviewPerViewAttributes.tesc.out | 79 + .../spv.multiviewPerViewAttributes.vert.out | 60 + .../Test/baseResults/spv.newTexture.frag.out | 385 + .../baseResults/spv.noBuiltInLoc.vert.out | 81 + .../spv.noDeadDecorations.vert.out | 58 + .../Test/baseResults/spv.noLocation.vert.out | 10 + .../Test/baseResults/spv.noWorkgroup.comp.out | 28 + .../Test/baseResults/spv.nonSquare.vert.out | 112 + .../Test/baseResults/spv.nonuniform.frag.out | 359 + .../Test/baseResults/spv.offsets.frag.out | 53 + .../Test/baseResults/spv.paramMemory.frag.out | 141 + .../baseResults/spv.perprimitiveNV.frag.out | 54 + .../Test/baseResults/spv.precise.tesc.out | 116 + .../Test/baseResults/spv.precise.tese.out | 185 + .../Test/baseResults/spv.precision.frag.out | 228 + .../spv.precisionNonESSamp.frag.out | 98 + .../Test/baseResults/spv.prepost.frag.out | 144 + .../baseResults/spv.pushConstant.vert.out | 61 + .../baseResults/spv.pushConstantAnon.vert.out | 64 + .../Test/baseResults/spv.qualifiers.vert.out | 48 + .../Test/baseResults/spv.queryL.frag.out | 316 + .../Test/baseResults/spv.rankShift.comp.out | 57 + .../spv.register.autoassign-2.frag.out | 81 + .../spv.register.autoassign.frag.out | 241 + ...spv.register.autoassign.rangetest.frag.out | 5 + .../spv.register.noautoassign.frag.out | 234 + .../baseResults/spv.register.subpass.frag.out | 75 + .../baseResults/spv.rw.autoassign.frag.out | 74 + .../Test/baseResults/spv.sample.frag.out | 32 + .../Test/baseResults/spv.sampleId.frag.out | 52 + .../spv.sampleMaskOverrideCoverage.frag.out | 43 + .../baseResults/spv.samplePosition.frag.out | 55 + .../spv.samplerlessTextureFunctions.frag.out | 93 + .../Test/baseResults/spv.separate.frag.out | 424 + .../glslang/Test/baseResults/spv.set.vert.out | 45 + .../baseResults/spv.shaderBallot.comp.out | 373 + .../baseResults/spv.shaderBallotAMD.comp.out | 1557 +++ .../baseResults/spv.shaderDrawParams.vert.out | 102 + .../spv.shaderFragMaskAMD.frag.out | 122 + .../baseResults/spv.shaderGroupVote.comp.out | 62 + .../spv.shaderImageFootprint.frag.out | 849 ++ .../spv.shaderStencilExport.frag.out | 28 + .../Test/baseResults/spv.shadingRate.frag.out | 48 + .../Test/baseResults/spv.shiftOps.frag.out | 64 + .../baseResults/spv.shortCircuit.frag.out | 235 + .../spv.simpleFunctionCall.frag.out | 36 + .../Test/baseResults/spv.simpleMat.vert.out | 60 + .../baseResults/spv.sparseTexture.frag.out | 593 ++ .../spv.sparseTextureClamp.frag.out | 469 + .../Test/baseResults/spv.specConst.vert.out | 56 + .../baseResults/spv.specConstant.comp.out | 49 + .../baseResults/spv.specConstant.vert.out | 142 + .../spv.specConstantComposite.vert.out | 87 + .../spv.specConstantOperations.vert.out | 261 + .../baseResults/spv.ssbo.autoassign.frag.out | 156 + .../Test/baseResults/spv.ssboAlias.frag.out | 86 + .../spv.stereoViewRendering.tesc.out | 90 + .../spv.stereoViewRendering.vert.out | 68 + .../baseResults/spv.storageBuffer.vert.out | 67 + .../baseResults/spv.structAssignment.frag.out | 99 + .../Test/baseResults/spv.structDeref.frag.out | 188 + .../Test/baseResults/spv.structure.frag.out | 96 + .../Test/baseResults/spv.subgroup.frag.out | 44 + .../Test/baseResults/spv.subgroup.geom.out | 62 + .../Test/baseResults/spv.subgroup.tesc.out | 59 + .../Test/baseResults/spv.subgroup.tese.out | 61 + .../Test/baseResults/spv.subgroup.vert.out | 58 + .../spv.subgroupArithmetic.comp.out | 2428 +++++ .../baseResults/spv.subgroupBallot.comp.out | 525 + .../baseResults/spv.subgroupBasic.comp.out | 84 + .../spv.subgroupClustered.comp.out | 880 ++ .../spv.subgroupClusteredNeg.comp.out | 13 + .../spv.subgroupPartitioned.comp.out | 2876 +++++ .../baseResults/spv.subgroupQuad.comp.out | 739 ++ .../baseResults/spv.subgroupShuffle.comp.out | 462 + .../spv.subgroupShuffleRelative.comp.out | 462 + .../baseResults/spv.subgroupVote.comp.out | 288 + .../Test/baseResults/spv.subpass.frag.out | 112 + .../Test/baseResults/spv.switch.frag.out | 527 + .../Test/baseResults/spv.swizzle.frag.out | 167 + .../baseResults/spv.swizzleInversion.frag.out | 75 + .../Test/baseResults/spv.test.frag.out | 85 + .../Test/baseResults/spv.test.vert.out | 45 + .../Test/baseResults/spv.texture.frag.out | 396 + .../spv.texture.sampler.transform.frag.out | 37 + .../Test/baseResults/spv.texture.vert.out | 201 + .../baseResults/spv.textureBuffer.vert.out | 64 + .../spv.textureGatherBiasLod.frag.out | 389 + .../Test/baseResults/spv.types.frag.out | 337 + .../Test/baseResults/spv.uint.frag.out | 441 + .../baseResults/spv.uniformArray.frag.out | 77 + .../Test/baseResults/spv.unit1.frag.out | 298 + .../spv.variableArrayIndex.frag.out | 144 + .../baseResults/spv.varyingArray.frag.out | 86 + .../spv.varyingArrayIndirect.frag.out | 99 + .../baseResults/spv.vecMatConstruct.frag.out | 87 + .../baseResults/spv.viewportArray2.tesc.out | 62 + .../baseResults/spv.viewportArray2.vert.out | 47 + .../baseResults/spv.voidFunction.frag.out | 72 + .../spv.vulkan100.subgroupArithmetic.comp.out | 305 + ...spv.vulkan100.subgroupPartitioned.comp.out | 326 + .../baseResults/spv.vulkan110.int16.frag.out | 745 ++ .../spv.vulkan110.storageBuffer.vert.out | 66 + .../spv.while-continue-break.vert.out | 73 + .../baseResults/spv.while-simple.vert.out | 42 + .../Test/baseResults/spv.whileLoop.frag.out | 62 + .../glslang/Test/baseResults/spv.xfb.vert.out | 59 + .../Test/baseResults/spv.xfb2.vert.out | 72 + .../Test/baseResults/spv.xfb3.vert.out | 72 + ...fbOffsetOnStructMembersAssignment.vert.out | 93 + .../Test/baseResults/stringToDouble.vert.out | 1045 ++ .../baseResults/structAssignment.frag.out | 103 + .../Test/baseResults/structDeref.frag.out | 345 + .../Test/baseResults/structure.frag.out | 165 + deps/glslang/Test/baseResults/switch.frag.out | 691 ++ .../glslang/Test/baseResults/swizzle.frag.out | 423 + .../Test/baseResults/syntaxError.frag.out | 24 + deps/glslang/Test/baseResults/test.conf | 101 + deps/glslang/Test/baseResults/test.frag.out | 115 + .../glslang/Test/baseResults/texture.frag.out | 564 + .../Test/baseResults/tokenLength.vert.out | 220 + .../Test/baseResults/tokenPaste.vert.out | 119 + deps/glslang/Test/baseResults/types.frag.out | 677 ++ deps/glslang/Test/baseResults/uint.frag.out | 607 ++ .../Test/baseResults/uniformArray.frag.out | 97 + .../baseResults/variableArrayIndex.frag.out | 225 + .../Test/baseResults/varyingArray.frag.out | 118 + .../baseResults/varyingArrayIndirect.frag.out | 124 + .../Test/baseResults/versionsClean.frag.out | 44 + .../Test/baseResults/versionsClean.vert.out | 47 + .../Test/baseResults/versionsErrors.frag.out | 44 + .../Test/baseResults/versionsErrors.vert.out | 57 + .../Test/baseResults/voidFunction.frag.out | 91 + .../Test/baseResults/vulkan.ast.vert.out | 325 + deps/glslang/Test/baseResults/vulkan.comp.out | 6 + deps/glslang/Test/baseResults/vulkan.frag.out | 62 + deps/glslang/Test/baseResults/vulkan.vert.out | 43 + .../Test/baseResults/whileLoop.frag.out | 65 + deps/glslang/Test/bump | 3 + deps/glslang/Test/comment.frag | 19 + deps/glslang/Test/compoundsuffix.frag.hlsl | 6 + deps/glslang/Test/compoundsuffix.vert.glsl | 4 + deps/glslang/Test/conditionalDiscard.frag | 14 + deps/glslang/Test/constErrors.frag | 35 + deps/glslang/Test/constFold.frag | 148 + deps/glslang/Test/constFoldIntMin.frag | 12 + deps/glslang/Test/conversion.frag | 112 + deps/glslang/Test/cppBad.vert | 5 + deps/glslang/Test/cppBad2.vert | 3 + deps/glslang/Test/cppComplexExpr.vert | 183 + deps/glslang/Test/cppDeepNest.frag | 117 + deps/glslang/Test/cppIndent.vert | 61 + .../Test/cppIntMinOverNegativeOne.frag | 6 + deps/glslang/Test/cppNest.vert | 177 + deps/glslang/Test/cppPassMacroName.frag | 30 + .../Test/cppRelaxSkipTokensErrors.vert | 14 + deps/glslang/Test/cppSimple.vert | 353 + deps/glslang/Test/dataOut.frag | 8 + deps/glslang/Test/dataOutIndirect.frag | 10 + deps/glslang/Test/dce.frag | 56 + deps/glslang/Test/decls.frag | 49 + deps/glslang/Test/deepRvalue.frag | 36 + deps/glslang/Test/depthOut.frag | 10 + deps/glslang/Test/discard-dce.frag | 35 + deps/glslang/Test/doWhileLoop.frag | 16 + deps/glslang/Test/earlyReturnDiscard.frag | 102 + deps/glslang/Test/empty.frag | 0 deps/glslang/Test/empty2.frag | 1 + deps/glslang/Test/empty3.frag | 1 + deps/glslang/Test/errors.frag | 4 + deps/glslang/Test/es-link1.frag | 8 + deps/glslang/Test/es-link2.frag | 8 + deps/glslang/Test/findFunction.frag | 46 + deps/glslang/Test/flowControl.frag | 23 + deps/glslang/Test/foo.h | 1 + deps/glslang/Test/forLoop.frag | 41 + deps/glslang/Test/forwardRef.frag | 37 + deps/glslang/Test/functionCall.frag | 44 + deps/glslang/Test/functionSemantics.frag | 75 + deps/glslang/Test/glsl.-D-U.frag | 32 + deps/glslang/Test/glsl.entryPointRename.vert | 11 + deps/glslang/Test/glsl.entryPointRename2.vert | 6 + deps/glslang/Test/glslangValidator | 2 + deps/glslang/Test/glspv.esversion.vert | 5 + deps/glslang/Test/glspv.frag | 28 + deps/glslang/Test/glspv.version.frag | 5 + deps/glslang/Test/glspv.version.vert | 5 + deps/glslang/Test/glspv.vert | 20 + deps/glslang/Test/hlsl.-D-U.frag | 31 + deps/glslang/Test/hlsl.PointSize.geom | 11 + deps/glslang/Test/hlsl.PointSize.vert | 4 + deps/glslang/Test/hlsl.aliasOpaque.frag | 29 + deps/glslang/Test/hlsl.amend.frag | 28 + deps/glslang/Test/hlsl.array.flatten.frag | 38 + deps/glslang/Test/hlsl.array.frag | 18 + .../Test/hlsl.array.implicit-size.frag | 32 + deps/glslang/Test/hlsl.array.multidim.frag | 20 + deps/glslang/Test/hlsl.assoc.frag | 11 + .../Test/hlsl.attribute.expression.comp | 15 + deps/glslang/Test/hlsl.attribute.frag | 13 + deps/glslang/Test/hlsl.attributeC11.frag | 22 + .../Test/hlsl.attributeGlobalBuffer.frag | 8 + deps/glslang/Test/hlsl.automap.frag | 57 + deps/glslang/Test/hlsl.basic.comp | 6 + deps/glslang/Test/hlsl.basic.geom | 25 + deps/glslang/Test/hlsl.boolConv.vert | 20 + deps/glslang/Test/hlsl.buffer.frag | 47 + deps/glslang/Test/hlsl.calculatelod.dx10.frag | 44 + .../Test/hlsl.calculatelodunclamped.dx10.frag | 44 + deps/glslang/Test/hlsl.cast.frag | 4 + .../glslang/Test/hlsl.cbuffer-identifier.vert | 32 + deps/glslang/Test/hlsl.charLit.vert | 17 + deps/glslang/Test/hlsl.clip.frag | 12 + deps/glslang/Test/hlsl.clipdistance-1.frag | 6 + deps/glslang/Test/hlsl.clipdistance-1.geom | 19 + deps/glslang/Test/hlsl.clipdistance-1.vert | 8 + deps/glslang/Test/hlsl.clipdistance-2.frag | 7 + deps/glslang/Test/hlsl.clipdistance-2.geom | 19 + deps/glslang/Test/hlsl.clipdistance-2.vert | 15 + deps/glslang/Test/hlsl.clipdistance-3.frag | 6 + deps/glslang/Test/hlsl.clipdistance-3.geom | 20 + deps/glslang/Test/hlsl.clipdistance-3.vert | 13 + deps/glslang/Test/hlsl.clipdistance-4.frag | 9 + deps/glslang/Test/hlsl.clipdistance-4.geom | 21 + deps/glslang/Test/hlsl.clipdistance-4.vert | 21 + deps/glslang/Test/hlsl.clipdistance-5.frag | 9 + deps/glslang/Test/hlsl.clipdistance-5.vert | 21 + deps/glslang/Test/hlsl.clipdistance-6.frag | 10 + deps/glslang/Test/hlsl.clipdistance-6.vert | 23 + deps/glslang/Test/hlsl.clipdistance-7.frag | 10 + deps/glslang/Test/hlsl.clipdistance-7.vert | 23 + deps/glslang/Test/hlsl.clipdistance-8.frag | 10 + deps/glslang/Test/hlsl.clipdistance-8.vert | 20 + deps/glslang/Test/hlsl.clipdistance-9.frag | 8 + deps/glslang/Test/hlsl.clipdistance-9.vert | 19 + deps/glslang/Test/hlsl.color.hull.tesc | 74 + deps/glslang/Test/hlsl.comparison.vec.frag | 34 + deps/glslang/Test/hlsl.conditional.frag | 42 + deps/glslang/Test/hlsl.constantbuffer.frag | 26 + deps/glslang/Test/hlsl.constructArray.vert | 10 + deps/glslang/Test/hlsl.constructexpr.frag | 17 + deps/glslang/Test/hlsl.constructimat.frag | 52 + deps/glslang/Test/hlsl.coverage.frag | 20 + deps/glslang/Test/hlsl.dashI.vert | 13 + .../Test/hlsl.deadFunctionMissingBody.vert | 8 + deps/glslang/Test/hlsl.depthGreater.frag | 4 + deps/glslang/Test/hlsl.depthLess.frag | 4 + deps/glslang/Test/hlsl.discard.frag | 14 + deps/glslang/Test/hlsl.doLoop.frag | 9 + deps/glslang/Test/hlsl.domain.1.tese | 32 + deps/glslang/Test/hlsl.domain.2.tese | 35 + deps/glslang/Test/hlsl.domain.3.tese | 31 + deps/glslang/Test/hlsl.emptystruct.init.vert | 8 + deps/glslang/Test/hlsl.emptystructreturn.frag | 13 + deps/glslang/Test/hlsl.emptystructreturn.vert | 13 + deps/glslang/Test/hlsl.entry-in.frag | 20 + deps/glslang/Test/hlsl.entry-out.frag | 23 + deps/glslang/Test/hlsl.entry.rename.frag | 15 + .../Test/hlsl.explicitDescriptorSet.frag | 15 + deps/glslang/Test/hlsl.flatten.return.frag | 18 + deps/glslang/Test/hlsl.flattenOpaque.frag | 40 + deps/glslang/Test/hlsl.flattenOpaqueInit.vert | 27 + .../Test/hlsl.flattenOpaqueInitMix.vert | 13 + deps/glslang/Test/hlsl.flattenSubset.frag | 36 + deps/glslang/Test/hlsl.flattenSubset2.frag | 24 + deps/glslang/Test/hlsl.float1.frag | 7 + deps/glslang/Test/hlsl.float4.frag | 11 + deps/glslang/Test/hlsl.forLoop.frag | 17 + deps/glslang/Test/hlsl.frag | 12 + deps/glslang/Test/hlsl.fraggeom.frag | 17 + deps/glslang/Test/hlsl.function.frag | 25 + deps/glslang/Test/hlsl.gather.array.dx10.frag | 43 + deps/glslang/Test/hlsl.gather.basic.dx10.frag | 48 + deps/glslang/Test/hlsl.gather.basic.dx10.vert | 46 + .../glslang/Test/hlsl.gather.offset.dx10.frag | 44 + .../Test/hlsl.gather.offsetarray.dx10.frag | 36 + .../Test/hlsl.gatherRGBA.array.dx10.frag | 71 + .../Test/hlsl.gatherRGBA.basic.dx10.frag | 77 + .../Test/hlsl.gatherRGBA.offset.dx10.frag | 116 + .../hlsl.gatherRGBA.offsetarray.dx10.frag | 110 + .../Test/hlsl.gathercmpRGBA.array.dx10.frag | 74 + .../Test/hlsl.gathercmpRGBA.basic.dx10.frag | 84 + .../Test/hlsl.gathercmpRGBA.offset.dx10.frag | 114 + .../hlsl.gathercmpRGBA.offsetarray.dx10.frag | 113 + .../glslang/Test/hlsl.getdimensions.dx10.frag | 280 + .../glslang/Test/hlsl.getdimensions.dx10.vert | 27 + .../Test/hlsl.getdimensions.rw.dx10.frag | 96 + .../Test/hlsl.getsampleposition.dx10.frag | 23 + deps/glslang/Test/hlsl.global-const-init.frag | 14 + deps/glslang/Test/hlsl.groupid.comp | 9 + deps/glslang/Test/hlsl.gs-hs-mix.tesc | 119 + deps/glslang/Test/hlsl.hlslOffset.vert | 20 + deps/glslang/Test/hlsl.hull.1.tesc | 39 + deps/glslang/Test/hlsl.hull.2.tesc | 39 + deps/glslang/Test/hlsl.hull.3.tesc | 39 + deps/glslang/Test/hlsl.hull.4.tesc | 43 + deps/glslang/Test/hlsl.hull.5.tesc | 43 + deps/glslang/Test/hlsl.hull.ctrlpt-1.tesc | 43 + deps/glslang/Test/hlsl.hull.ctrlpt-2.tesc | 47 + deps/glslang/Test/hlsl.hull.void.tesc | 34 + deps/glslang/Test/hlsl.identifier.sample.frag | 18 + deps/glslang/Test/hlsl.if.frag | 35 + .../glslang/Test/hlsl.imagefetch-subvec4.comp | 8 + deps/glslang/Test/hlsl.implicitBool.frag | 32 + deps/glslang/Test/hlsl.include.vert | 8 + deps/glslang/Test/hlsl.includeNegative.vert | 8 + deps/glslang/Test/hlsl.inf.vert | 11 + deps/glslang/Test/hlsl.init.frag | 41 + deps/glslang/Test/hlsl.init2.frag | 51 + deps/glslang/Test/hlsl.inoutquals.frag | 26 + deps/glslang/Test/hlsl.intrinsic.frexp.frag | 37 + deps/glslang/Test/hlsl.intrinsic.frexp.vert | 28 + .../Test/hlsl.intrinsics.barriers.comp | 13 + deps/glslang/Test/hlsl.intrinsics.comp | 129 + .../hlsl.intrinsics.d3dcolortoubyte4.frag | 7 + deps/glslang/Test/hlsl.intrinsics.double.frag | 11 + .../glslang/Test/hlsl.intrinsics.evalfns.frag | 10 + deps/glslang/Test/hlsl.intrinsics.f1632.frag | 29 + deps/glslang/Test/hlsl.intrinsics.f3216.frag | 29 + deps/glslang/Test/hlsl.intrinsics.frag | 493 + deps/glslang/Test/hlsl.intrinsics.lit.frag | 4 + .../Test/hlsl.intrinsics.negative.comp | 201 + .../Test/hlsl.intrinsics.negative.frag | 136 + .../Test/hlsl.intrinsics.negative.vert | 247 + .../Test/hlsl.intrinsics.promote.down.frag | 22 + .../glslang/Test/hlsl.intrinsics.promote.frag | 79 + .../Test/hlsl.intrinsics.promote.outputs.frag | 49 + deps/glslang/Test/hlsl.intrinsics.vert | 414 + deps/glslang/Test/hlsl.isfinite.frag | 18 + deps/glslang/Test/hlsl.layout.frag | 19 + deps/glslang/Test/hlsl.layoutOverride.vert | 7 + deps/glslang/Test/hlsl.load.2dms.dx10.frag | 56 + deps/glslang/Test/hlsl.load.array.dx10.frag | 71 + deps/glslang/Test/hlsl.load.basic.dx10.frag | 76 + deps/glslang/Test/hlsl.load.basic.dx10.vert | 70 + deps/glslang/Test/hlsl.load.buffer.dx10.frag | 38 + .../Test/hlsl.load.buffer.float.dx10.frag | 38 + deps/glslang/Test/hlsl.load.offset.dx10.frag | 76 + .../Test/hlsl.load.offsetarray.dx10.frag | 69 + .../glslang/Test/hlsl.load.rwbuffer.dx10.frag | 32 + .../Test/hlsl.load.rwtexture.array.dx10.frag | 57 + .../Test/hlsl.load.rwtexture.dx10.frag | 62 + .../Test/hlsl.localStructuredBuffer.comp | 4 + deps/glslang/Test/hlsl.logical.binary.frag | 21 + .../glslang/Test/hlsl.logical.binary.vec.frag | 24 + deps/glslang/Test/hlsl.logical.unary.frag | 29 + deps/glslang/Test/hlsl.logicalConvert.frag | 23 + deps/glslang/Test/hlsl.loopattr.frag | 14 + deps/glslang/Test/hlsl.matNx1.frag | 31 + deps/glslang/Test/hlsl.matType.bool.frag | 53 + deps/glslang/Test/hlsl.matType.frag | 11 + deps/glslang/Test/hlsl.matType.int.frag | 97 + deps/glslang/Test/hlsl.matpack-1.frag | 27 + deps/glslang/Test/hlsl.matpack-pragma.frag | 33 + deps/glslang/Test/hlsl.matrixSwizzle.vert | 33 + deps/glslang/Test/hlsl.matrixindex.frag | 49 + deps/glslang/Test/hlsl.max.frag | 4 + deps/glslang/Test/hlsl.memberFunCall.frag | 16 + deps/glslang/Test/hlsl.mintypes.frag | 49 + deps/glslang/Test/hlsl.mip.negative.frag | 9 + deps/glslang/Test/hlsl.mip.negative2.frag | 9 + deps/glslang/Test/hlsl.mip.operator.frag | 14 + deps/glslang/Test/hlsl.mul-truncate.frag | 38 + .../glslang/Test/hlsl.multiDescriptorSet.frag | 45 + deps/glslang/Test/hlsl.multiEntry.vert | 11 + deps/glslang/Test/hlsl.multiReturn.frag | 19 + deps/glslang/Test/hlsl.namespace.frag | 23 + .../Test/hlsl.noSemantic.functionality1.comp | 7 + deps/glslang/Test/hlsl.nonint-index.frag | 9 + .../Test/hlsl.nonstaticMemberFunction.frag | 35 + deps/glslang/Test/hlsl.numericsuffixes.frag | 24 + deps/glslang/Test/hlsl.numthreads.comp | 11 + deps/glslang/Test/hlsl.opaque-type-bug.frag | 16 + deps/glslang/Test/hlsl.overload.frag | 142 + deps/glslang/Test/hlsl.params.default.frag | 51 + .../Test/hlsl.params.default.negative.frag | 50 + .../Test/hlsl.partialFlattenLocal.vert | 27 + .../Test/hlsl.partialFlattenMixed.vert | 16 + deps/glslang/Test/hlsl.partialInit.frag | 36 + deps/glslang/Test/hlsl.pp.expand.frag | 18 + deps/glslang/Test/hlsl.pp.line.frag | 24 + deps/glslang/Test/hlsl.pp.tokenpasting.frag | 18 + deps/glslang/Test/hlsl.pp.vert | 17 + deps/glslang/Test/hlsl.precedence.frag | 9 + deps/glslang/Test/hlsl.precedence2.frag | 9 + deps/glslang/Test/hlsl.precise.frag | 14 + deps/glslang/Test/hlsl.preprocessor.frag | 13 + deps/glslang/Test/hlsl.promote.atomic.frag | 17 + deps/glslang/Test/hlsl.promote.binary.frag | 28 + deps/glslang/Test/hlsl.promote.vec1.frag | 16 + deps/glslang/Test/hlsl.promotions.frag | 201 + .../glslang/Test/hlsl.reflection.binding.frag | 34 + deps/glslang/Test/hlsl.reflection.vert | 138 + deps/glslang/Test/hlsl.rw.atomics.frag | 244 + deps/glslang/Test/hlsl.rw.bracket.frag | 140 + deps/glslang/Test/hlsl.rw.register.frag | 18 + deps/glslang/Test/hlsl.rw.scalar.bracket.frag | 140 + deps/glslang/Test/hlsl.rw.swizzle.frag | 28 + deps/glslang/Test/hlsl.rw.vec2.bracket.frag | 140 + deps/glslang/Test/hlsl.sample.array.dx10.frag | 43 + deps/glslang/Test/hlsl.sample.basic.dx10.frag | 90 + .../glslang/Test/hlsl.sample.offset.dx10.frag | 49 + .../Test/hlsl.sample.offsetarray.dx10.frag | 37 + .../Test/hlsl.sample.sub-vec4.dx10.frag | 24 + .../Test/hlsl.samplebias.array.dx10.frag | 43 + .../Test/hlsl.samplebias.basic.dx10.frag | 51 + .../Test/hlsl.samplebias.offset.dx10.frag | 49 + .../hlsl.samplebias.offsetarray.dx10.frag | 37 + .../Test/hlsl.samplecmp.array.dx10.frag | 60 + .../Test/hlsl.samplecmp.basic.dx10.frag | 61 + .../glslang/Test/hlsl.samplecmp.dualmode.frag | 14 + .../glslang/Test/hlsl.samplecmp.negative.frag | 13 + .../Test/hlsl.samplecmp.negative2.frag | 10 + .../Test/hlsl.samplecmp.offset.dx10.frag | 66 + .../Test/hlsl.samplecmp.offsetarray.dx10.frag | 67 + .../hlsl.samplecmplevelzero.array.dx10.frag | 60 + .../hlsl.samplecmplevelzero.basic.dx10.frag | 61 + .../hlsl.samplecmplevelzero.offset.dx10.frag | 66 + ...l.samplecmplevelzero.offsetarray.dx10.frag | 67 + .../Test/hlsl.samplegrad.array.dx10.frag | 43 + .../Test/hlsl.samplegrad.basic.dx10.frag | 51 + .../Test/hlsl.samplegrad.basic.dx10.vert | 49 + .../Test/hlsl.samplegrad.offset.dx10.frag | 49 + .../hlsl.samplegrad.offsetarray.dx10.frag | 39 + .../Test/hlsl.samplelevel.array.dx10.frag | 43 + .../Test/hlsl.samplelevel.basic.dx10.frag | 52 + .../Test/hlsl.samplelevel.basic.dx10.vert | 49 + .../Test/hlsl.samplelevel.offset.dx10.frag | 49 + .../hlsl.samplelevel.offsetarray.dx10.frag | 37 + deps/glslang/Test/hlsl.scalar-length.frag | 6 + deps/glslang/Test/hlsl.scalar2matrix.frag | 28 + deps/glslang/Test/hlsl.scalarCast.vert | 37 + deps/glslang/Test/hlsl.scope.frag | 30 + deps/glslang/Test/hlsl.self_cast.frag | 25 + deps/glslang/Test/hlsl.semantic-1.vert | 24 + deps/glslang/Test/hlsl.semantic.geom | 16 + deps/glslang/Test/hlsl.semantic.vert | 13 + deps/glslang/Test/hlsl.semicolons.frag | 19 + deps/glslang/Test/hlsl.shapeConv.frag | 49 + deps/glslang/Test/hlsl.shapeConvRet.frag | 9 + deps/glslang/Test/hlsl.shift.per-set.frag | 60 + deps/glslang/Test/hlsl.sin.frag | 4 + deps/glslang/Test/hlsl.snorm.uav.comp | 15 + deps/glslang/Test/hlsl.staticFuncInit.frag | 20 + .../Test/hlsl.staticMemberFunction.frag | 22 + .../hlsl.store.rwbyteaddressbuffer.type.comp | 8 + deps/glslang/Test/hlsl.string.frag | 12 + deps/glslang/Test/hlsl.stringtoken.frag | 20 + deps/glslang/Test/hlsl.struct.frag | 53 + deps/glslang/Test/hlsl.struct.split-1.vert | 25 + .../glslang/Test/hlsl.struct.split.array.geom | 21 + .../Test/hlsl.struct.split.assign.frag | 12 + deps/glslang/Test/hlsl.struct.split.call.vert | 32 + .../Test/hlsl.struct.split.nested.geom | 34 + .../Test/hlsl.struct.split.trivial.geom | 21 + .../Test/hlsl.struct.split.trivial.vert | 22 + deps/glslang/Test/hlsl.structIoFourWay.frag | 18 + deps/glslang/Test/hlsl.structStructName.frag | 7 + .../Test/hlsl.structarray.flatten.frag | 28 + .../Test/hlsl.structarray.flatten.geom | 23 + .../Test/hlsl.structbuffer.append.fn.frag | 23 + .../Test/hlsl.structbuffer.append.frag | 11 + .../Test/hlsl.structbuffer.atomics.frag | 25 + deps/glslang/Test/hlsl.structbuffer.byte.frag | 13 + .../Test/hlsl.structbuffer.coherent.frag | 23 + .../Test/hlsl.structbuffer.floatidx.comp | 19 + deps/glslang/Test/hlsl.structbuffer.fn.frag | 24 + deps/glslang/Test/hlsl.structbuffer.fn2.comp | 15 + deps/glslang/Test/hlsl.structbuffer.frag | 23 + .../Test/hlsl.structbuffer.incdec.frag | 19 + deps/glslang/Test/hlsl.structbuffer.rw.frag | 23 + .../Test/hlsl.structbuffer.rwbyte.frag | 15 + deps/glslang/Test/hlsl.structin.vert | 17 + deps/glslang/Test/hlsl.subpass.frag | 113 + deps/glslang/Test/hlsl.switch.frag | 55 + deps/glslang/Test/hlsl.swizzle.frag | 6 + deps/glslang/Test/hlsl.synthesizeInput.frag | 9 + deps/glslang/Test/hlsl.target.frag | 10 + deps/glslang/Test/hlsl.targetStruct1.frag | 19 + deps/glslang/Test/hlsl.targetStruct2.frag | 19 + deps/glslang/Test/hlsl.templatetypes.frag | 47 + .../Test/hlsl.templatetypes.negative.frag | 23 + deps/glslang/Test/hlsl.texture.struct.frag | 55 + deps/glslang/Test/hlsl.texture.subvec4.frag | 41 + deps/glslang/Test/hlsl.texturebuffer.frag | 17 + deps/glslang/Test/hlsl.this.frag | 29 + deps/glslang/Test/hlsl.tristream-append.geom | 18 + deps/glslang/Test/hlsl.tx.bracket.frag | 73 + deps/glslang/Test/hlsl.tx.overload.frag | 17 + deps/glslang/Test/hlsl.type.half.frag | 28 + deps/glslang/Test/hlsl.type.identifier.frag | 31 + .../Test/hlsl.type.type.conversion.all.frag | 190 + .../Test/hlsl.type.type.conversion.valid.frag | 90 + deps/glslang/Test/hlsl.typeGraphCopy.vert | 24 + deps/glslang/Test/hlsl.typedef.frag | 11 + deps/glslang/Test/hlsl.void.frag | 9 + deps/glslang/Test/hlsl.wavebroadcast.comp | 53 + deps/glslang/Test/hlsl.waveprefix.comp | 55 + deps/glslang/Test/hlsl.wavequad.comp | 153 + deps/glslang/Test/hlsl.wavequery.comp | 7 + deps/glslang/Test/hlsl.wavequery.frag | 11 + deps/glslang/Test/hlsl.wavereduction.comp | 125 + deps/glslang/Test/hlsl.wavevote.comp | 10 + deps/glslang/Test/hlsl.whileLoop.frag | 7 + deps/glslang/Test/hlsl.y-negate-1.vert | 9 + deps/glslang/Test/hlsl.y-negate-2.vert | 8 + deps/glslang/Test/hlsl.y-negate-3.vert | 18 + .../glslang/Test/implicitInnerAtomicUint.frag | 2 + deps/glslang/Test/inc1/badInc.h | 1 + deps/glslang/Test/inc1/bar.h | 3 + deps/glslang/Test/inc1/foo.h | 3 + deps/glslang/Test/inc1/path1/bar.h | 1 + deps/glslang/Test/inc1/path1/local.h | 1 + deps/glslang/Test/inc1/path1/notHere.h | 4 + deps/glslang/Test/inc1/path2/bar.h | 1 + deps/glslang/Test/inc1/path2/notHere.h | 1 + deps/glslang/Test/inc1/path2/remote.h | 1 + deps/glslang/Test/inc2/bar.h | 2 + deps/glslang/Test/inc2/foo.h | 1 + deps/glslang/Test/include.vert | 16 + deps/glslang/Test/invalidSwizzle.vert | 10 + deps/glslang/Test/length.frag | 18 + deps/glslang/Test/lineContinuation.vert | 151 + deps/glslang/Test/lineContinuation100.vert | 56 + deps/glslang/Test/link1.frag | 38 + deps/glslang/Test/link1.vk.frag | 24 + deps/glslang/Test/link2.frag | 36 + deps/glslang/Test/link2.vk.frag | 23 + deps/glslang/Test/link3.frag | 9 + deps/glslang/Test/localAggregates.frag | 72 + deps/glslang/Test/loops.frag | 320 + deps/glslang/Test/loopsArtificial.frag | 96 + deps/glslang/Test/mains.frag | 9 + deps/glslang/Test/mains1.frag | 5 + deps/glslang/Test/mains2.frag | 5 + deps/glslang/Test/makeDoc | 3 + deps/glslang/Test/matrix.frag | 55 + deps/glslang/Test/matrix2.frag | 51 + deps/glslang/Test/matrixError.vert | 24 + deps/glslang/Test/maxClipDistances.vert | 7 + deps/glslang/Test/max_vertices_0.geom | 12 + deps/glslang/Test/missingBodies.vert | 24 + deps/glslang/Test/mixedArrayDecls.frag | 30 + deps/glslang/Test/negativeArraySize.comp | 10 + deps/glslang/Test/newTexture.frag | 75 + deps/glslang/Test/noMain.vert | 5 + deps/glslang/Test/noMain1.geom | 7 + deps/glslang/Test/noMain2.geom | 7 + deps/glslang/Test/nonSquare.vert | 25 + deps/glslang/Test/nonVulkan.frag | 9 + deps/glslang/Test/nonuniform.frag | 33 + deps/glslang/Test/nosuffix | 4 + deps/glslang/Test/numeral.frag | 106 + .../nvShaderNoperspectiveInterpolation.frag | 15 + deps/glslang/Test/overlongLiteral.frag | 1 + deps/glslang/Test/parent.h | 1 + deps/glslang/Test/parentBad | 3 + deps/glslang/Test/pointCoord.frag | 15 + deps/glslang/Test/precise.tesc | 109 + deps/glslang/Test/precise_struct_block.vert | 89 + deps/glslang/Test/precision.frag | 76 + deps/glslang/Test/precision.vert | 25 + deps/glslang/Test/prepost.frag | 38 + deps/glslang/Test/preprocessor.bad_arg.vert | 8 + .../Test/preprocessor.cpp_style___FILE__.vert | 36 + ...preprocessor.cpp_style_line_directive.vert | 36 + deps/glslang/Test/preprocessor.defined.vert | 2 + .../glslang/Test/preprocessor.edge_cases.vert | 15 + .../Test/preprocessor.eof_missing.vert | 1 + deps/glslang/Test/preprocessor.errors.vert | 20 + .../glslang/Test/preprocessor.extensions.vert | 12 + .../Test/preprocessor.function_macro.vert | 20 + .../Test/preprocessor.include.disabled.vert | 6 + .../Test/preprocessor.include.enabled.vert | 20 + deps/glslang/Test/preprocessor.line.frag | 4 + deps/glslang/Test/preprocessor.line.vert | 39 + .../glslang/Test/preprocessor.many.endif.vert | 10 + deps/glslang/Test/preprocessor.pragma.vert | 13 + deps/glslang/Test/preprocessor.simple.vert | 65 + ...processor.success_if_parse_would_fail.vert | 4 + deps/glslang/Test/recurse1.frag | 48 + deps/glslang/Test/recurse1.vert | 44 + deps/glslang/Test/recurse2.frag | 28 + deps/glslang/Test/reflection.vert | 206 + deps/glslang/Test/remap.basic.dcefunc.frag | 11 + deps/glslang/Test/remap.basic.everything.frag | 11 + deps/glslang/Test/remap.basic.none.frag | 11 + deps/glslang/Test/remap.basic.strip.frag | 11 + .../remap.hlsl.sample.basic.everything.frag | 90 + .../Test/remap.hlsl.sample.basic.none.frag | 90 + .../Test/remap.hlsl.sample.basic.strip.frag | 90 + .../remap.hlsl.templatetypes.everything.frag | 47 + .../Test/remap.hlsl.templatetypes.none.frag | 47 + deps/glslang/Test/remap.if.everything.frag | 12 + deps/glslang/Test/remap.if.none.frag | 12 + deps/glslang/Test/remap.invalid-spirv-1.spv | 0 deps/glslang/Test/remap.invalid-spirv-2.spv | 0 .../Test/remap.literal64.everything.spv | 0 deps/glslang/Test/remap.literal64.none.spv | 0 .../Test/remap.similar_1a.everything.frag | 29 + deps/glslang/Test/remap.similar_1a.none.frag | 29 + .../Test/remap.similar_1b.everything.frag | 30 + deps/glslang/Test/remap.similar_1b.none.frag | 30 + deps/glslang/Test/remap.specconst.comp | 7 + .../glslang/Test/remap.switch.everything.frag | 16 + deps/glslang/Test/remap.switch.none.frag | 16 + .../Test/remap.uniformarray.everything.frag | 17 + .../glslang/Test/remap.uniformarray.none.frag | 17 + deps/glslang/Test/runtests | 240 + deps/glslang/Test/runtimeArray.vert | 110 + deps/glslang/Test/sample.frag | 41 + deps/glslang/Test/sample.frag.out | 15 + deps/glslang/Test/sample.vert | 43 + deps/glslang/Test/sample.vert.out | 20 + .../Test/samplerlessTextureFunctions.frag | 46 + deps/glslang/Test/simpleFunctionCall.frag | 15 + deps/glslang/Test/specExamples.frag | 237 + deps/glslang/Test/specExamples.vert | 196 + .../Test/spv.1.3.8bitstorage-ssbo.vert | 15 + .../glslang/Test/spv.1.3.8bitstorage-ubo.vert | 15 + deps/glslang/Test/spv.100ops.frag | 27 + deps/glslang/Test/spv.130.frag | 93 + deps/glslang/Test/spv.140.frag | 46 + deps/glslang/Test/spv.150.geom | 39 + deps/glslang/Test/spv.150.vert | 38 + deps/glslang/Test/spv.16bitstorage-int.frag | 90 + deps/glslang/Test/spv.16bitstorage-uint.frag | 90 + deps/glslang/Test/spv.16bitstorage.frag | 90 + .../Test/spv.16bitstorage_Error-int.frag | 101 + .../Test/spv.16bitstorage_Error-uint.frag | 101 + deps/glslang/Test/spv.16bitstorage_Error.frag | 102 + deps/glslang/Test/spv.300BuiltIns.vert | 14 + deps/glslang/Test/spv.300layout.frag | 22 + deps/glslang/Test/spv.300layout.vert | 49 + deps/glslang/Test/spv.300layoutp.vert | 49 + deps/glslang/Test/spv.310.bitcast.frag | 41 + deps/glslang/Test/spv.310.comp | 42 + .../Test/spv.320.meshShaderUserDefined.mesh | 59 + deps/glslang/Test/spv.330.geom | 26 + deps/glslang/Test/spv.400.frag | 265 + deps/glslang/Test/spv.400.tesc | 43 + deps/glslang/Test/spv.400.tese | 52 + deps/glslang/Test/spv.420.geom | 43 + deps/glslang/Test/spv.430.frag | 10 + deps/glslang/Test/spv.430.vert | 37 + deps/glslang/Test/spv.450.geom | 14 + deps/glslang/Test/spv.450.noRedecl.tesc | 10 + deps/glslang/Test/spv.450.tesc | 33 + deps/glslang/Test/spv.460.comp | 9 + deps/glslang/Test/spv.460.frag | 17 + deps/glslang/Test/spv.460.vert | 6 + deps/glslang/Test/spv.8bitstorage-int.frag | 90 + deps/glslang/Test/spv.8bitstorage-ssbo.vert | 15 + deps/glslang/Test/spv.8bitstorage-ubo.vert | 15 + deps/glslang/Test/spv.8bitstorage-uint.frag | 90 + .../Test/spv.8bitstorage_Error-int.frag | 101 + .../Test/spv.8bitstorage_Error-uint.frag | 101 + deps/glslang/Test/spv.AnyHitShader.rahit | 26 + .../Test/spv.AnyHitShader_Errors.rahit | 11 + deps/glslang/Test/spv.AofA.frag | 43 + deps/glslang/Test/spv.ClosestHitShader.rchit | 24 + .../Test/spv.ClosestHitShader_Errors.rchit | 12 + .../Test/spv.GeometryShaderPassthrough.geom | 17 + deps/glslang/Test/spv.IntersectShader.rint | 21 + .../Test/spv.IntersectShader_Errors.rint | 11 + deps/glslang/Test/spv.MissShader.rmiss | 17 + deps/glslang/Test/spv.MissShader_Errors.rmiss | 16 + deps/glslang/Test/spv.OVR_multiview.vert | 9 + deps/glslang/Test/spv.Operations.frag | 141 + deps/glslang/Test/spv.RayCallable.rcall | 15 + .../glslang/Test/spv.RayCallable_Errors.rcall | 25 + deps/glslang/Test/spv.RayConstants.rgen | 15 + deps/glslang/Test/spv.RayGenShader.rgen | 19 + .../glslang/Test/spv.RayGenShader_Errors.rgen | 40 + deps/glslang/Test/spv.accessChain.frag | 100 + deps/glslang/Test/spv.aggOps.frag | 51 + deps/glslang/Test/spv.always-discard.frag | 36 + deps/glslang/Test/spv.always-discard2.frag | 19 + .../Test/spv.arbPostDepthCoverage.frag | 13 + .../Test/spv.arbPostDepthCoverage_Error.frag | 12 + deps/glslang/Test/spv.atomic.comp | 48 + deps/glslang/Test/spv.atomicInt64.comp | 79 + deps/glslang/Test/spv.barrier.vert | 15 + deps/glslang/Test/spv.bitCast.frag | 45 + deps/glslang/Test/spv.bool.vert | 17 + deps/glslang/Test/spv.boolInBlock.frag | 31 + deps/glslang/Test/spv.branch-return.vert | 10 + deps/glslang/Test/spv.buffer.autoassign.frag | 28 + deps/glslang/Test/spv.builtInXFB.vert | 15 + .../Test/spv.computeShaderDerivatives.comp | 106 + .../Test/spv.computeShaderDerivatives2.comp | 106 + deps/glslang/Test/spv.conditionalDiscard.frag | 14 + deps/glslang/Test/spv.constStruct.vert | 22 + .../Test/spv.controlFlowAttributes.frag | 39 + deps/glslang/Test/spv.conversion.frag | 112 + deps/glslang/Test/spv.dataOut.frag | 8 + deps/glslang/Test/spv.dataOutIndirect.frag | 12 + deps/glslang/Test/spv.dataOutIndirect.vert | 12 + deps/glslang/Test/spv.debugInfo.frag | 52 + deps/glslang/Test/spv.deepRvalue.frag | 36 + deps/glslang/Test/spv.depthOut.frag | 11 + deps/glslang/Test/spv.deviceGroup.frag | 9 + deps/glslang/Test/spv.discard-dce.frag | 35 + deps/glslang/Test/spv.do-simple.vert | 7 + .../Test/spv.do-while-continue-break.vert | 20 + deps/glslang/Test/spv.doWhileLoop.frag | 16 + deps/glslang/Test/spv.double.comp | 25 + deps/glslang/Test/spv.drawParams.vert | 13 + deps/glslang/Test/spv.earlyReturnDiscard.frag | 102 + deps/glslang/Test/spv.explicittypes.frag | 334 + .../Test/spv.extPostDepthCoverage.frag | 9 + .../Test/spv.extPostDepthCoverage_Error.frag | 9 + deps/glslang/Test/spv.float16.frag | 306 + deps/glslang/Test/spv.float16Fetch.frag | 1273 +++ deps/glslang/Test/spv.float32.frag | 277 + deps/glslang/Test/spv.float64.frag | 272 + deps/glslang/Test/spv.flowControl.frag | 23 + .../Test/spv.for-complex-condition.vert | 7 + deps/glslang/Test/spv.for-continue-break.vert | 20 + deps/glslang/Test/spv.for-nobody.vert | 7 + deps/glslang/Test/spv.for-notest.vert | 6 + deps/glslang/Test/spv.for-simple.vert | 8 + deps/glslang/Test/spv.forLoop.frag | 41 + deps/glslang/Test/spv.forwardFun.frag | 39 + .../Test/spv.fragmentShaderBarycentric.frag | 15 + .../Test/spv.fragmentShaderBarycentric2.frag | 15 + deps/glslang/Test/spv.fullyCovered.frag | 9 + deps/glslang/Test/spv.functionCall.frag | 44 + .../Test/spv.functionNestedOpaque.vert | 26 + deps/glslang/Test/spv.functionSemantics.frag | 63 + deps/glslang/Test/spv.glFragColor.frag | 6 + .../Test/spv.glsl.register.autoassign.frag | 68 + .../Test/spv.glsl.register.noautoassign.frag | 68 + deps/glslang/Test/spv.hlslDebugInfo.vert | 4 + deps/glslang/Test/spv.hlslOffsets.vert | 27 + deps/glslang/Test/spv.image.frag | 97 + .../Test/spv.image.load-formatted.frag | 74 + deps/glslang/Test/spv.imageLoadStoreLod.frag | 36 + deps/glslang/Test/spv.int16.amd.frag | 314 + deps/glslang/Test/spv.int16.frag | 251 + deps/glslang/Test/spv.int32.frag | 256 + deps/glslang/Test/spv.int64.frag | 268 + deps/glslang/Test/spv.int8.frag | 253 + deps/glslang/Test/spv.intOps.vert | 72 + deps/glslang/Test/spv.interpOps.frag | 32 + deps/glslang/Test/spv.layoutNested.vert | 76 + deps/glslang/Test/spv.length.frag | 14 + deps/glslang/Test/spv.localAggregates.frag | 72 + deps/glslang/Test/spv.loops.frag | 302 + deps/glslang/Test/spv.loopsArtificial.frag | 67 + deps/glslang/Test/spv.looseUniformNoLoc.vert | 15 + deps/glslang/Test/spv.matFun.vert | 28 + deps/glslang/Test/spv.matrix.frag | 49 + deps/glslang/Test/spv.matrix2.frag | 50 + deps/glslang/Test/spv.memoryQualifier.frag | 38 + .../Test/spv.memoryScopeSemantics.comp | 61 + .../Test/spv.memoryScopeSemantics_Error.comp | 28 + deps/glslang/Test/spv.merge-unreachable.frag | 8 + deps/glslang/Test/spv.meshShaderBuiltins.mesh | 63 + .../Test/spv.meshShaderPerViewBuiltins.mesh | 42 + .../spv.meshShaderPerViewUserDefined.mesh | 56 + .../Test/spv.meshShaderRedeclBuiltins.mesh | 66 + .../spv.meshShaderRedeclPerViewBuiltins.mesh | 53 + .../glslang/Test/spv.meshShaderSharedMem.mesh | 39 + deps/glslang/Test/spv.meshShaderTaskMem.mesh | 41 + .../Test/spv.meshShaderUserDefined.mesh | 59 + deps/glslang/Test/spv.meshTaskShader.task | 49 + deps/glslang/Test/spv.multiStruct.comp | 48 + deps/glslang/Test/spv.multiStructFuncall.frag | 21 + deps/glslang/Test/spv.multiView.frag | 9 + .../Test/spv.multiviewPerViewAttributes.tesc | 14 + .../Test/spv.multiviewPerViewAttributes.vert | 10 + deps/glslang/Test/spv.newTexture.frag | 72 + deps/glslang/Test/spv.noBuiltInLoc.vert | 19 + deps/glslang/Test/spv.noDeadDecorations.vert | 13 + deps/glslang/Test/spv.noLocation.vert | 39 + deps/glslang/Test/spv.noWorkgroup.comp | 7 + deps/glslang/Test/spv.nonSquare.vert | 25 + deps/glslang/Test/spv.nonuniform.frag | 55 + deps/glslang/Test/spv.offsets.frag | 17 + deps/glslang/Test/spv.paramMemory.frag | 30 + deps/glslang/Test/spv.perprimitiveNV.frag | 21 + deps/glslang/Test/spv.precise.tesc | 24 + deps/glslang/Test/spv.precise.tese | 36 + deps/glslang/Test/spv.precision.frag | 60 + deps/glslang/Test/spv.precisionNonESSamp.frag | 24 + deps/glslang/Test/spv.prepost.frag | 38 + deps/glslang/Test/spv.pushConstant.vert | 17 + deps/glslang/Test/spv.pushConstantAnon.vert | 17 + deps/glslang/Test/spv.qualifiers.vert | 19 + deps/glslang/Test/spv.queryL.frag | 64 + deps/glslang/Test/spv.rankShift.comp | 15 + .../Test/spv.register.autoassign-2.frag | 15 + .../glslang/Test/spv.register.autoassign.frag | 71 + .../spv.register.autoassign.rangetest.frag | 15 + .../Test/spv.register.noautoassign.frag | 71 + deps/glslang/Test/spv.register.subpass.frag | 15 + deps/glslang/Test/spv.rw.autoassign.frag | 18 + deps/glslang/Test/spv.sample.frag | 9 + deps/glslang/Test/spv.sampleId.frag | 12 + .../Test/spv.sampleMaskOverrideCoverage.frag | 7 + deps/glslang/Test/spv.samplePosition.frag | 12 + .../Test/spv.samplerlessTextureFunctions.frag | 23 + deps/glslang/Test/spv.separate.frag | 95 + deps/glslang/Test/spv.set.vert | 14 + deps/glslang/Test/spv.shaderBallot.comp | 59 + deps/glslang/Test/spv.shaderBallotAMD.comp | 204 + deps/glslang/Test/spv.shaderDrawParams.vert | 16 + deps/glslang/Test/spv.shaderFragMaskAMD.frag | 29 + deps/glslang/Test/spv.shaderGroupVote.comp | 21 + .../Test/spv.shaderImageFootprint.frag | 123 + .../glslang/Test/spv.shaderStencilExport.frag | 10 + deps/glslang/Test/spv.shadingRate.frag | 11 + deps/glslang/Test/spv.shiftOps.frag | 18 + deps/glslang/Test/spv.shortCircuit.frag | 50 + deps/glslang/Test/spv.simpleFunctionCall.frag | 13 + deps/glslang/Test/spv.simpleMat.vert | 19 + deps/glslang/Test/spv.sparseTexture.frag | 91 + deps/glslang/Test/spv.sparseTextureClamp.frag | 70 + deps/glslang/Test/spv.specConst.vert | 8 + deps/glslang/Test/spv.specConstant.comp | 13 + deps/glslang/Test/spv.specConstant.vert | 51 + .../Test/spv.specConstantComposite.vert | 98 + .../Test/spv.specConstantOperations.vert | 124 + deps/glslang/Test/spv.ssbo.autoassign.frag | 24 + deps/glslang/Test/spv.ssboAlias.frag | 10 + .../glslang/Test/spv.stereoViewRendering.tesc | 19 + .../glslang/Test/spv.stereoViewRendering.vert | 12 + deps/glslang/Test/spv.storageBuffer.vert | 16 + deps/glslang/Test/spv.structAssignment.frag | 41 + deps/glslang/Test/spv.structDeref.frag | 71 + deps/glslang/Test/spv.structure.frag | 31 + deps/glslang/Test/spv.subgroup.frag | 7 + deps/glslang/Test/spv.subgroup.geom | 13 + deps/glslang/Test/spv.subgroup.tesc | 12 + deps/glslang/Test/spv.subgroup.tese | 12 + deps/glslang/Test/spv.subgroup.vert | 11 + deps/glslang/Test/spv.subgroupArithmetic.comp | 393 + deps/glslang/Test/spv.subgroupBallot.comp | 86 + deps/glslang/Test/spv.subgroupBasic.comp | 23 + deps/glslang/Test/spv.subgroupClustered.comp | 143 + .../Test/spv.subgroupClusteredNeg.comp | 39 + .../glslang/Test/spv.subgroupPartitioned.comp | 420 + deps/glslang/Test/spv.subgroupQuad.comp | 118 + deps/glslang/Test/spv.subgroupShuffle.comp | 68 + .../Test/spv.subgroupShuffleRelative.comp | 68 + deps/glslang/Test/spv.subgroupVote.comp | 49 + deps/glslang/Test/spv.subpass.frag | 29 + deps/glslang/Test/spv.switch.frag | 142 + deps/glslang/Test/spv.swizzle.frag | 52 + deps/glslang/Test/spv.swizzleInversion.frag | 16 + deps/glslang/Test/spv.targetOpenGL.vert | 10 + deps/glslang/Test/spv.targetVulkan.vert | 9 + deps/glslang/Test/spv.test.frag | 22 + deps/glslang/Test/spv.test.vert | 14 + deps/glslang/Test/spv.texture.frag | 73 + .../Test/spv.texture.sampler.transform.frag | 13 + deps/glslang/Test/spv.texture.vert | 39 + deps/glslang/Test/spv.textureBuffer.vert | 17 + .../Test/spv.textureGatherBiasLod.frag | 88 + deps/glslang/Test/spv.types.frag | 78 + deps/glslang/Test/spv.uint.frag | 102 + deps/glslang/Test/spv.uniformArray.frag | 17 + deps/glslang/Test/spv.unit1.frag | 16 + deps/glslang/Test/spv.unit2.frag | 17 + deps/glslang/Test/spv.unit3.frag | 15 + deps/glslang/Test/spv.variableArrayIndex.frag | 49 + deps/glslang/Test/spv.varyingArray.frag | 19 + .../Test/spv.varyingArrayIndirect.frag | 21 + deps/glslang/Test/spv.vecMatConstruct.frag | 14 + deps/glslang/Test/spv.viewportArray2.tesc | 16 + deps/glslang/Test/spv.viewportArray2.vert | 10 + deps/glslang/Test/spv.voidFunction.frag | 34 + .../spv.vulkan100.subgroupArithmetic.comp | 393 + .../spv.vulkan100.subgroupPartitioned.comp | 420 + deps/glslang/Test/spv.vulkan110.int16.frag | 251 + .../Test/spv.vulkan110.storageBuffer.vert | 16 + .../Test/spv.while-continue-break.vert | 20 + deps/glslang/Test/spv.while-simple.vert | 7 + deps/glslang/Test/spv.whileLoop.frag | 16 + deps/glslang/Test/spv.xfb.vert | 20 + deps/glslang/Test/spv.xfb2.vert | 18 + deps/glslang/Test/spv.xfb3.vert | 18 + ...pv.xfbOffsetOnStructMembersAssignment.vert | 23 + deps/glslang/Test/stringToDouble.vert | 116 + deps/glslang/Test/structAssignment.frag | 39 + deps/glslang/Test/structDeref.frag | 71 + deps/glslang/Test/structure.frag | 31 + deps/glslang/Test/switch.frag | 158 + deps/glslang/Test/swizzle.frag | 52 + deps/glslang/Test/syntaxError.frag | 16 + deps/glslang/Test/test.frag | 22 + deps/glslang/Test/texture.frag | 73 + deps/glslang/Test/tokenLength.vert | 72 + deps/glslang/Test/tokenPaste.vert | 86 + deps/glslang/Test/types.frag | 81 + deps/glslang/Test/uint.frag | 105 + deps/glslang/Test/uniformArray.frag | 16 + deps/glslang/Test/validate-shaders.sh | 269 + deps/glslang/Test/variableArrayIndex.frag | 48 + deps/glslang/Test/varyingArray.frag | 19 + deps/glslang/Test/varyingArrayIndirect.frag | 21 + deps/glslang/Test/versionsClean.frag | 45 + deps/glslang/Test/versionsClean.vert | 43 + deps/glslang/Test/versionsErrors.frag | 46 + deps/glslang/Test/versionsErrors.vert | 46 + deps/glslang/Test/voidFunction.frag | 34 + deps/glslang/Test/vulkan.ast.vert | 42 + deps/glslang/Test/vulkan.comp | 12 + deps/glslang/Test/vulkan.frag | 105 + deps/glslang/Test/vulkan.vert | 65 + deps/glslang/Test/whileLoop.frag | 16 + deps/glslang/build_overrides/glslang.gni | 37 + deps/glslang/glslang/CMakeLists.txt | 20 +- deps/glslang/glslang/Include/BaseTypes.h | 73 + deps/glslang/glslang/Include/ResourceLimits.h | 9 + deps/glslang/glslang/Include/Types.h | 154 +- deps/glslang/glslang/Include/arrays.h | 4 - deps/glslang/glslang/Include/intermediate.h | 43 + deps/glslang/glslang/Include/revision.h | 2 +- .../glslang/glslang/Include/revision.template | 26 +- .../glslang/MachineIndependent/Constant.cpp | 55 +- .../glslang/MachineIndependent/Initialize.cpp | 1198 ++- .../MachineIndependent/Intermediate.cpp | 182 +- .../MachineIndependent/ParseContextBase.cpp | 11 + .../MachineIndependent/ParseHelper.cpp | 1222 ++- .../glslang/MachineIndependent/ParseHelper.h | 13 +- .../glslang/MachineIndependent/Scan.cpp | 88 +- .../glslang/MachineIndependent/ScanContext.h | 6 +- .../glslang/MachineIndependent/ShaderLang.cpp | 78 + .../MachineIndependent/SymbolTable.cpp | 3 + .../glslang/MachineIndependent/Versions.cpp | 221 +- .../glslang/MachineIndependent/Versions.h | 24 +- .../glslang/MachineIndependent/glslang.y | 212 +- .../MachineIndependent/glslang_tab.cpp | 7015 +++++++------ .../MachineIndependent/glslang_tab.cpp.h | 641 +- .../glslang/MachineIndependent/intermOut.cpp | 124 +- .../glslang/MachineIndependent/iomapper.cpp | 81 +- .../MachineIndependent/linkValidate.cpp | 371 +- .../MachineIndependent/localintermediate.h | 95 +- .../MachineIndependent/parseVersions.h | 10 + .../glslang/MachineIndependent/pch.cpp | 35 + deps/glslang/glslang/MachineIndependent/pch.h | 49 + .../MachineIndependent/preprocessor/Pp.cpp | 123 +- .../preprocessor/PpContext.cpp | 3 + .../preprocessor/PpContext.h | 37 +- .../preprocessor/PpScanner.cpp | 173 +- .../preprocessor/PpTokens.cpp | 205 +- .../glslang/MachineIndependent/reflection.cpp | 9 + .../glslang/MachineIndependent/reflection.h | 10 +- .../glslang/OSDependent/Unix/ossource.cpp | 13 + deps/glslang/glslang/Public/ShaderLang.h | 26 +- deps/glslang/gtests/AST.FromFile.cpp | 250 + .../gtests/BuiltInResource.FromFile.cpp | 57 + deps/glslang/gtests/CMakeLists.txt | 61 + deps/glslang/gtests/Config.FromFile.cpp | 107 + deps/glslang/gtests/HexFloat.cpp | 1231 +++ deps/glslang/gtests/Hlsl.FromFile.cpp | 440 + deps/glslang/gtests/Initializer.h | 55 + deps/glslang/gtests/Link.FromFile.Vk.cpp | 116 + deps/glslang/gtests/Link.FromFile.cpp | 108 + deps/glslang/gtests/Pp.FromFile.cpp | 76 + deps/glslang/gtests/README.md | 26 + deps/glslang/gtests/Remap.FromFile.cpp | 118 + deps/glslang/gtests/Settings.cpp | 51 + deps/glslang/gtests/Settings.h | 58 + deps/glslang/gtests/Spv.FromFile.cpp | 554 + deps/glslang/gtests/TestFixture.cpp | 182 + deps/glslang/gtests/TestFixture.h | 651 ++ deps/glslang/gtests/main.cpp | 79 + deps/glslang/gtests/pch.cpp | 35 + deps/glslang/gtests/pch.h | 39 + deps/glslang/hlsl/CMakeLists.txt | 12 +- deps/glslang/hlsl/hlslGrammar.cpp | 31 +- deps/glslang/hlsl/hlslGrammar.h | 3 +- deps/glslang/hlsl/hlslParseHelper.cpp | 203 +- deps/glslang/hlsl/hlslParseHelper.h | 15 +- deps/glslang/hlsl/hlslParseables.cpp | 2 +- deps/glslang/hlsl/pch.cpp | 35 + deps/glslang/hlsl/pch.h | 54 + deps/glslang/known_good.json | 18 + deps/glslang/known_good_khr.json | 18 + deps/glslang/make-revision | 16 +- deps/glslang/update_glslang_sources.py | 155 + examples/DynamicBuffers/include/app.h | 8 +- examples/DynamicBuffers/src/app.cpp | 16 +- examples/MultiViewport/include/app.h | 8 +- examples/MultiViewport/src/app.cpp | 16 +- examples/OcclusionQuery/include/app.h | 8 +- examples/OcclusionQuery/src/app.cpp | 16 +- .../OutOfOrderRasterization/include/app.h | 10 +- examples/OutOfOrderRasterization/src/app.cpp | 16 +- examples/PushConstants/include/app.h | 8 +- examples/PushConstants/src/app.cpp | 16 +- include/misc/debug_marker.h | 32 +- include/misc/debug_messenger_create_info.h | 94 + include/misc/extensions.h | 30 + include/misc/graphics_pipeline_create_info.h | 62 + include/misc/object_tracker.h | 20 +- include/misc/types.h | 4 + include/misc/types_enums.h | 123 +- include/misc/types_struct.h | 159 +- include/misc/types_utils.h | 10 + include/wrappers/command_buffer.h | 284 + include/wrappers/debug_messenger.h | 108 + include/wrappers/device.h | 7 + include/wrappers/graphics_pipeline_manager.h | 40 - include/wrappers/instance.h | 36 +- include/wrappers/physical_device.h | 2 + include/wrappers/queue.h | 29 + include/wrappers/rendering_surface.h | 4 +- src/misc/debug_marker.cpp | 182 +- src/misc/debug_messenger_create_info.cpp | 52 + src/misc/glsl_to_spirv.cpp | 12 +- src/misc/graphics_pipeline_create_info.cpp | 20 +- src/misc/object_tracker.cpp | 138 +- src/misc/types.cpp | 2 + src/misc/types_struct.cpp | 150 +- src/misc/types_utils.cpp | 143 + src/wrappers/buffer.cpp | 6 +- src/wrappers/buffer_view.cpp | 6 +- src/wrappers/command_buffer.cpp | 550 +- src/wrappers/command_pool.cpp | 6 +- src/wrappers/compute_pipeline_manager.cpp | 4 +- src/wrappers/debug_messenger.cpp | 419 + src/wrappers/descriptor_pool.cpp | 6 +- src/wrappers/descriptor_set.cpp | 6 +- src/wrappers/descriptor_set_group.cpp | 6 +- src/wrappers/descriptor_set_layout.cpp | 6 +- .../descriptor_set_layout_manager.cpp | 4 +- src/wrappers/descriptor_update_template.cpp | 8 +- src/wrappers/device.cpp | 28 +- src/wrappers/event.cpp | 6 +- src/wrappers/fence.cpp | 6 +- src/wrappers/framebuffer.cpp | 6 +- src/wrappers/graphics_pipeline_manager.cpp | 26 +- src/wrappers/image.cpp | 6 +- src/wrappers/image_view.cpp | 6 +- src/wrappers/instance.cpp | 228 +- src/wrappers/memory_block.cpp | 4 +- src/wrappers/physical_device.cpp | 58 +- src/wrappers/pipeline_cache.cpp | 6 +- src/wrappers/pipeline_layout.cpp | 6 +- src/wrappers/pipeline_layout_manager.cpp | 4 +- src/wrappers/query_pool.cpp | 10 +- src/wrappers/queue.cpp | 108 +- src/wrappers/render_pass.cpp | 6 +- src/wrappers/rendering_surface.cpp | 6 +- src/wrappers/sampler.cpp | 6 +- src/wrappers/semaphore.cpp | 6 +- src/wrappers/shader_module.cpp | 14 +- src/wrappers/swapchain.cpp | 6 +- 1882 files changed, 349981 insertions(+), 5874 deletions(-) create mode 100644 deps/glslang/BUILD.gn create mode 100644 deps/glslang/CODE_OF_CONDUCT.md create mode 100644 deps/glslang/External/CMakeLists.txt create mode 100644 deps/glslang/SPIRV/SpvPostProcess.cpp create mode 100644 deps/glslang/SPIRV/SpvTools.cpp create mode 100644 deps/glslang/SPIRV/SpvTools.h create mode 100644 deps/glslang/StandAlone/CMakeLists.txt create mode 100644 deps/glslang/StandAlone/DirStackFileIncluder.h create mode 100644 deps/glslang/StandAlone/ResourceLimits.cpp create mode 100644 deps/glslang/StandAlone/ResourceLimits.h create mode 100644 deps/glslang/StandAlone/StandAlone.cpp create mode 100644 deps/glslang/StandAlone/Worklist.h create mode 100644 deps/glslang/StandAlone/spirv-remap.cpp create mode 100644 deps/glslang/Test/100.conf create mode 100644 deps/glslang/Test/100.frag create mode 100644 deps/glslang/Test/100Limits.vert create mode 100644 deps/glslang/Test/100samplerExternal.frag create mode 100644 deps/glslang/Test/100scope.vert create mode 100644 deps/glslang/Test/110scope.vert create mode 100644 deps/glslang/Test/120.frag create mode 100644 deps/glslang/Test/120.vert create mode 100644 deps/glslang/Test/130.frag create mode 100644 deps/glslang/Test/130.vert create mode 100644 deps/glslang/Test/140.frag create mode 100644 deps/glslang/Test/140.vert create mode 100644 deps/glslang/Test/150.frag create mode 100644 deps/glslang/Test/150.geom create mode 100644 deps/glslang/Test/150.tesc create mode 100644 deps/glslang/Test/150.tese create mode 100644 deps/glslang/Test/150.vert create mode 100644 deps/glslang/Test/300.frag create mode 100644 deps/glslang/Test/300.vert create mode 100644 deps/glslang/Test/300BuiltIns.frag create mode 100644 deps/glslang/Test/300block.frag create mode 100644 deps/glslang/Test/300layout.frag create mode 100644 deps/glslang/Test/300layout.vert create mode 100644 deps/glslang/Test/300link.frag create mode 100644 deps/glslang/Test/300link2.frag create mode 100644 deps/glslang/Test/300link3.frag create mode 100644 deps/glslang/Test/300operations.frag create mode 100644 deps/glslang/Test/300samplerExternal.frag create mode 100644 deps/glslang/Test/300scope.vert create mode 100644 deps/glslang/Test/310.comp create mode 100644 deps/glslang/Test/310.frag create mode 100644 deps/glslang/Test/310.geom create mode 100644 deps/glslang/Test/310.tesc create mode 100644 deps/glslang/Test/310.tese create mode 100644 deps/glslang/Test/310.vert create mode 100644 deps/glslang/Test/310AofA.vert create mode 100644 deps/glslang/Test/310implicitSizeArrayError.vert create mode 100644 deps/glslang/Test/310runtimeArray.vert create mode 100644 deps/glslang/Test/320.comp create mode 100644 deps/glslang/Test/320.frag create mode 100644 deps/glslang/Test/320.geom create mode 100644 deps/glslang/Test/320.tesc create mode 100644 deps/glslang/Test/320.tese create mode 100644 deps/glslang/Test/320.vert create mode 100644 deps/glslang/Test/330.frag create mode 100644 deps/glslang/Test/330comp.frag create mode 100644 deps/glslang/Test/400.frag create mode 100644 deps/glslang/Test/400.geom create mode 100644 deps/glslang/Test/400.tesc create mode 100644 deps/glslang/Test/400.tese create mode 100644 deps/glslang/Test/400.vert create mode 100644 deps/glslang/Test/410.geom create mode 100644 deps/glslang/Test/410.tesc create mode 100644 deps/glslang/Test/410.vert create mode 100644 deps/glslang/Test/420.comp create mode 100644 deps/glslang/Test/420.frag create mode 100644 deps/glslang/Test/420.geom create mode 100644 deps/glslang/Test/420.tesc create mode 100644 deps/glslang/Test/420.tese create mode 100644 deps/glslang/Test/420.vert create mode 100644 deps/glslang/Test/420_size_gl_in.geom create mode 100644 deps/glslang/Test/430.comp create mode 100644 deps/glslang/Test/430.vert create mode 100644 deps/glslang/Test/430AofA.frag create mode 100644 deps/glslang/Test/430scope.vert create mode 100644 deps/glslang/Test/435.vert create mode 100644 deps/glslang/Test/440.frag create mode 100644 deps/glslang/Test/440.vert create mode 100644 deps/glslang/Test/450.comp create mode 100644 deps/glslang/Test/450.frag create mode 100644 deps/glslang/Test/450.geom create mode 100644 deps/glslang/Test/450.tesc create mode 100644 deps/glslang/Test/450.tese create mode 100644 deps/glslang/Test/450.vert create mode 100644 deps/glslang/Test/460.frag create mode 100644 deps/glslang/Test/460.vert create mode 100644 deps/glslang/Test/Operations.frag create mode 100644 deps/glslang/Test/aggOps.frag create mode 100644 deps/glslang/Test/always-discard.frag create mode 100644 deps/glslang/Test/always-discard2.frag create mode 100644 deps/glslang/Test/array.frag create mode 100644 deps/glslang/Test/array100.frag create mode 100644 deps/glslang/Test/atomic_uint.frag create mode 100644 deps/glslang/Test/badChars.frag create mode 100644 deps/glslang/Test/badMacroArgs.frag create mode 100644 deps/glslang/Test/bar.h create mode 100644 deps/glslang/Test/baseLegalResults/hlsl.aliasOpaque.frag.out create mode 100644 deps/glslang/Test/baseLegalResults/hlsl.flattenOpaque.frag.out create mode 100644 deps/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out create mode 100644 deps/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out create mode 100644 deps/glslang/Test/baseLegalResults/hlsl.flattenSubset.frag.out create mode 100644 deps/glslang/Test/baseLegalResults/hlsl.flattenSubset2.frag.out create mode 100644 deps/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out create mode 100644 deps/glslang/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out create mode 100644 deps/glslang/Test/baseResults/100.frag.out create mode 100644 deps/glslang/Test/baseResults/100Limits.vert.out create mode 100644 deps/glslang/Test/baseResults/100LimitsConf.vert.out create mode 100644 deps/glslang/Test/baseResults/100samplerExternal.frag.out create mode 100644 deps/glslang/Test/baseResults/100scope.vert.out create mode 100644 deps/glslang/Test/baseResults/110scope.vert.out create mode 100644 deps/glslang/Test/baseResults/120.frag.out create mode 100644 deps/glslang/Test/baseResults/120.vert.out create mode 100644 deps/glslang/Test/baseResults/130.frag.out create mode 100644 deps/glslang/Test/baseResults/130.vert.out create mode 100644 deps/glslang/Test/baseResults/140.frag.out create mode 100644 deps/glslang/Test/baseResults/140.vert.out create mode 100644 deps/glslang/Test/baseResults/150.frag.out create mode 100644 deps/glslang/Test/baseResults/150.geom.out create mode 100644 deps/glslang/Test/baseResults/150.tesc.out create mode 100644 deps/glslang/Test/baseResults/150.vert.out create mode 100644 deps/glslang/Test/baseResults/300.frag.out create mode 100644 deps/glslang/Test/baseResults/300.vert.out create mode 100644 deps/glslang/Test/baseResults/300BuiltIns.frag.out create mode 100644 deps/glslang/Test/baseResults/300block.frag.out create mode 100644 deps/glslang/Test/baseResults/300layout.frag.out create mode 100644 deps/glslang/Test/baseResults/300layout.vert.out create mode 100644 deps/glslang/Test/baseResults/300link.frag.out create mode 100644 deps/glslang/Test/baseResults/300link2.frag.out create mode 100644 deps/glslang/Test/baseResults/300link3.frag.out create mode 100644 deps/glslang/Test/baseResults/300operations.frag.out create mode 100644 deps/glslang/Test/baseResults/300samplerExternal.frag.out create mode 100644 deps/glslang/Test/baseResults/300scope.vert.out create mode 100644 deps/glslang/Test/baseResults/310.comp.out create mode 100644 deps/glslang/Test/baseResults/310.frag.out create mode 100644 deps/glslang/Test/baseResults/310.geom.out create mode 100644 deps/glslang/Test/baseResults/310.tesc.out create mode 100644 deps/glslang/Test/baseResults/310.tese.out create mode 100644 deps/glslang/Test/baseResults/310.vert.out create mode 100644 deps/glslang/Test/baseResults/310AofA.vert.out create mode 100644 deps/glslang/Test/baseResults/310implicitSizeArrayError.vert.out create mode 100644 deps/glslang/Test/baseResults/310runtimeArray.vert.out create mode 100644 deps/glslang/Test/baseResults/320.comp.out create mode 100644 deps/glslang/Test/baseResults/320.frag.out create mode 100644 deps/glslang/Test/baseResults/320.geom.out create mode 100644 deps/glslang/Test/baseResults/320.tesc.out create mode 100644 deps/glslang/Test/baseResults/320.tese.out create mode 100644 deps/glslang/Test/baseResults/320.vert.out create mode 100644 deps/glslang/Test/baseResults/330.frag.out create mode 100644 deps/glslang/Test/baseResults/330comp.frag.out create mode 100644 deps/glslang/Test/baseResults/400.frag.out create mode 100644 deps/glslang/Test/baseResults/400.geom.out create mode 100644 deps/glslang/Test/baseResults/400.tesc.out create mode 100644 deps/glslang/Test/baseResults/400.tese.out create mode 100644 deps/glslang/Test/baseResults/400.vert.out create mode 100644 deps/glslang/Test/baseResults/410.geom.out create mode 100644 deps/glslang/Test/baseResults/410.tesc.out create mode 100644 deps/glslang/Test/baseResults/410.vert.out create mode 100644 deps/glslang/Test/baseResults/420.comp.out create mode 100644 deps/glslang/Test/baseResults/420.frag.out create mode 100644 deps/glslang/Test/baseResults/420.geom.out create mode 100644 deps/glslang/Test/baseResults/420.tesc.out create mode 100644 deps/glslang/Test/baseResults/420.tese.out create mode 100644 deps/glslang/Test/baseResults/420.vert.out create mode 100644 deps/glslang/Test/baseResults/420_size_gl_in.geom.out create mode 100644 deps/glslang/Test/baseResults/430.comp.out create mode 100644 deps/glslang/Test/baseResults/430.vert.out create mode 100644 deps/glslang/Test/baseResults/430AofA.frag.out create mode 100644 deps/glslang/Test/baseResults/430scope.vert.out create mode 100644 deps/glslang/Test/baseResults/435.vert.out create mode 100644 deps/glslang/Test/baseResults/440.frag.out create mode 100644 deps/glslang/Test/baseResults/440.vert.out create mode 100644 deps/glslang/Test/baseResults/450.comp.out create mode 100644 deps/glslang/Test/baseResults/450.frag.out create mode 100644 deps/glslang/Test/baseResults/450.geom.out create mode 100644 deps/glslang/Test/baseResults/450.tesc.out create mode 100644 deps/glslang/Test/baseResults/450.tese.out create mode 100644 deps/glslang/Test/baseResults/450.vert.out create mode 100644 deps/glslang/Test/baseResults/460.frag.out create mode 100644 deps/glslang/Test/baseResults/460.vert.out create mode 100644 deps/glslang/Test/baseResults/Operations.frag.out create mode 100644 deps/glslang/Test/baseResults/aggOps.frag.out create mode 100644 deps/glslang/Test/baseResults/always-discard.frag.out create mode 100644 deps/glslang/Test/baseResults/always-discard2.frag.out create mode 100644 deps/glslang/Test/baseResults/array.frag.out create mode 100644 deps/glslang/Test/baseResults/array100.frag.out create mode 100644 deps/glslang/Test/baseResults/atomic_uint.frag.out create mode 100644 deps/glslang/Test/baseResults/badChars.frag.out create mode 100644 deps/glslang/Test/baseResults/badMacroArgs.frag.out create mode 100644 deps/glslang/Test/baseResults/comment.frag.out create mode 100644 deps/glslang/Test/baseResults/compoundsuffix.frag.hlsl create mode 100644 deps/glslang/Test/baseResults/compoundsuffix.vert.glsl create mode 100644 deps/glslang/Test/baseResults/conditionalDiscard.frag.out create mode 100644 deps/glslang/Test/baseResults/constErrors.frag.out create mode 100644 deps/glslang/Test/baseResults/constFold.frag.out create mode 100644 deps/glslang/Test/baseResults/constFoldIntMin.frag.out create mode 100644 deps/glslang/Test/baseResults/conversion.frag.out create mode 100644 deps/glslang/Test/baseResults/cppBad.vert.out create mode 100644 deps/glslang/Test/baseResults/cppBad2.vert.out create mode 100644 deps/glslang/Test/baseResults/cppComplexExpr.vert.out create mode 100644 deps/glslang/Test/baseResults/cppDeepNest.frag.out create mode 100644 deps/glslang/Test/baseResults/cppIndent.vert.out create mode 100644 deps/glslang/Test/baseResults/cppIntMinOverNegativeOne.frag.out create mode 100644 deps/glslang/Test/baseResults/cppNest.vert.out create mode 100644 deps/glslang/Test/baseResults/cppPassMacroName.frag.out create mode 100644 deps/glslang/Test/baseResults/cppRelaxSkipTokensErrors.vert.out create mode 100644 deps/glslang/Test/baseResults/cppSimple.vert.out create mode 100644 deps/glslang/Test/baseResults/dataOut.frag.out create mode 100644 deps/glslang/Test/baseResults/dataOutIndirect.frag.out create mode 100644 deps/glslang/Test/baseResults/dce.frag.out create mode 100644 deps/glslang/Test/baseResults/decls.frag.out create mode 100644 deps/glslang/Test/baseResults/deepRvalue.frag.out create mode 100644 deps/glslang/Test/baseResults/depthOut.frag.out create mode 100644 deps/glslang/Test/baseResults/discard-dce.frag.out create mode 100644 deps/glslang/Test/baseResults/doWhileLoop.frag.out create mode 100644 deps/glslang/Test/baseResults/earlyReturnDiscard.frag.out create mode 100644 deps/glslang/Test/baseResults/empty.frag.out create mode 100644 deps/glslang/Test/baseResults/errors.frag.out create mode 100644 deps/glslang/Test/baseResults/es-link1.frag.out create mode 100644 deps/glslang/Test/baseResults/findFunction.frag.out create mode 100644 deps/glslang/Test/baseResults/flowControl.frag.out create mode 100644 deps/glslang/Test/baseResults/forLoop.frag.out create mode 100644 deps/glslang/Test/baseResults/forwardRef.frag.out create mode 100644 deps/glslang/Test/baseResults/functionCall.frag.out create mode 100644 deps/glslang/Test/baseResults/functionSemantics.frag.out create mode 100644 deps/glslang/Test/baseResults/glsl.-D-U.frag.out create mode 100644 deps/glslang/Test/baseResults/glsl.entryPointRename.vert.bad.out create mode 100644 deps/glslang/Test/baseResults/glsl.entryPointRename.vert.out create mode 100644 deps/glslang/Test/baseResults/glsl.entryPointRename2.vert.out create mode 100644 deps/glslang/Test/baseResults/glspv.esversion.vert.out create mode 100644 deps/glslang/Test/baseResults/glspv.frag.out create mode 100644 deps/glslang/Test/baseResults/glspv.version.frag.out create mode 100644 deps/glslang/Test/baseResults/glspv.version.vert.out create mode 100644 deps/glslang/Test/baseResults/glspv.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.-D-U.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.PointSize.geom.out create mode 100644 deps/glslang/Test/baseResults/hlsl.PointSize.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.aliasOpaque.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.amend.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.array.flatten.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.array.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.array.implicit-size.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.array.multidim.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.assoc.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.attribute.expression.comp.out create mode 100644 deps/glslang/Test/baseResults/hlsl.attribute.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.attributeC11.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.attributeGlobalBuffer.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.automap.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.basic.comp.out create mode 100644 deps/glslang/Test/baseResults/hlsl.basic.geom.out create mode 100644 deps/glslang/Test/baseResults/hlsl.boolConv.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.buffer.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.calculatelod.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.calculatelodunclamped.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.cast.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.cbuffer-identifier.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.charLit.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clip.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-1.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-1.geom.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-1.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-2.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-2.geom.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-2.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-3.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-3.geom.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-3.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-4.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-4.geom.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-4.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-5.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-5.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-6.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-6.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-7.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-7.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-8.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-8.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-9.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.clipdistance-9.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.color.hull.tesc.out create mode 100644 deps/glslang/Test/baseResults/hlsl.comparison.vec.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.conditional.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.constantbuffer.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.constructArray.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.constructexpr.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.constructimat.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.coverage.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.dashI.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.deadFunctionMissingBody.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.depthGreater.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.depthLess.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.discard.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.doLoop.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.domain.1.tese.out create mode 100644 deps/glslang/Test/baseResults/hlsl.domain.2.tese.out create mode 100644 deps/glslang/Test/baseResults/hlsl.domain.3.tese.out create mode 100644 deps/glslang/Test/baseResults/hlsl.emptystruct.init.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.emptystructreturn.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.emptystructreturn.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.entry-in.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.entry-out.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.entry.rename.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.explicitDescriptorSet.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.flatten.return.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.flattenOpaque.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.flattenOpaqueInit.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.flattenSubset.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.flattenSubset2.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.float1.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.float4.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.forLoop.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.fraggeom.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.function.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.gather.array.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.gather.basic.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.gather.basic.dx10.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.gather.offset.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.gather.offsetarray.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.getdimensions.dx10.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.global-const-init.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.groupid.comp.out create mode 100644 deps/glslang/Test/baseResults/hlsl.gs-hs-mix.tesc.out create mode 100644 deps/glslang/Test/baseResults/hlsl.hlslOffset.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.hull.1.tesc.out create mode 100644 deps/glslang/Test/baseResults/hlsl.hull.2.tesc.out create mode 100644 deps/glslang/Test/baseResults/hlsl.hull.3.tesc.out create mode 100644 deps/glslang/Test/baseResults/hlsl.hull.4.tesc.out create mode 100644 deps/glslang/Test/baseResults/hlsl.hull.5.tesc.out create mode 100644 deps/glslang/Test/baseResults/hlsl.hull.ctrlpt-1.tesc.out create mode 100644 deps/glslang/Test/baseResults/hlsl.hull.ctrlpt-2.tesc.out create mode 100644 deps/glslang/Test/baseResults/hlsl.hull.void.tesc.out create mode 100644 deps/glslang/Test/baseResults/hlsl.identifier.sample.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.if.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.imagefetch-subvec4.comp.out create mode 100644 deps/glslang/Test/baseResults/hlsl.implicitBool.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.include.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.includeNegative.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.inf.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.init.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.init2.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.inoutquals.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.intrinsic.frexp.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.intrinsic.frexp.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.intrinsics.barriers.comp.out create mode 100644 deps/glslang/Test/baseResults/hlsl.intrinsics.comp.out create mode 100644 deps/glslang/Test/baseResults/hlsl.intrinsics.d3dcolortoubyte4.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.intrinsics.double.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.intrinsics.evalfns.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.intrinsics.f1632.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.intrinsics.f3216.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.intrinsics.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.intrinsics.lit.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.intrinsics.negative.comp.out create mode 100644 deps/glslang/Test/baseResults/hlsl.intrinsics.negative.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.intrinsics.negative.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.intrinsics.promote.down.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.intrinsics.promote.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.intrinsics.promote.outputs.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.intrinsics.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.isfinite.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.layout.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.layoutOverride.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.load.array.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.load.basic.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.load.basic.dx10.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.load.buffer.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.load.offset.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.localStructuredBuffer.comp.out create mode 100644 deps/glslang/Test/baseResults/hlsl.logical.binary.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.logical.binary.vec.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.logical.unary.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.logicalConvert.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.loopattr.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.matNx1.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.matType.bool.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.matType.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.matType.int.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.matpack-1.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.matpack-pragma.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.matrixSwizzle.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.matrixindex.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.max.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.memberFunCall.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.mintypes.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.mip.negative.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.mip.negative2.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.mip.operator.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.mul-truncate.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.multiDescriptorSet.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.multiEntry.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.multiReturn.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.namespace.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.noSemantic.functionality1.comp.out create mode 100644 deps/glslang/Test/baseResults/hlsl.nonint-index.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.nonstaticMemberFunction.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.numericsuffixes.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.numthreads.comp.out create mode 100644 deps/glslang/Test/baseResults/hlsl.opaque-type-bug.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.overload.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.params.default.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.params.default.negative.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.partialFlattenLocal.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.partialFlattenMixed.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.partialInit.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.pp.expand.frag.err create mode 100644 deps/glslang/Test/baseResults/hlsl.pp.expand.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.pp.line.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.pp.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.precedence.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.precedence2.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.precise.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.preprocessor.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.promote.atomic.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.promote.binary.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.promote.vec1.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.promotions.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.reflection.binding.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.reflection.binding.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.reflection.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.rw.atomics.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.rw.bracket.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.rw.register.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.sample.array.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.sample.basic.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.sample.offset.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.sample.offsetarray.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.sample.sub-vec4.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplebias.array.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplebias.basic.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplebias.offset.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplecmp.array.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplecmp.basic.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplecmp.dualmode.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplecmp.negative.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplecmp.negative2.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplecmp.offset.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplecmp.offsetarray.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.array.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.basic.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.offset.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.offsetarray.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplegrad.array.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplegrad.offset.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplegrad.offsetarray.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplelevel.array.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplelevel.offset.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.samplelevel.offsetarray.dx10.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.scalar-length.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.scalar2matrix.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.scalarCast.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.scope.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.self_cast.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.semantic-1.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.semantic.geom.out create mode 100644 deps/glslang/Test/baseResults/hlsl.semantic.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.semicolons.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.shapeConv.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.shapeConvRet.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.shift.per-set.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.sin.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.snorm.uav.comp.out create mode 100644 deps/glslang/Test/baseResults/hlsl.staticFuncInit.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.staticMemberFunction.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.store.rwbyteaddressbuffer.type.comp.out create mode 100644 deps/glslang/Test/baseResults/hlsl.string.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.stringtoken.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.struct.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.struct.split-1.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.struct.split.array.geom.out create mode 100644 deps/glslang/Test/baseResults/hlsl.struct.split.assign.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.struct.split.call.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.struct.split.nested.geom.out create mode 100644 deps/glslang/Test/baseResults/hlsl.struct.split.trivial.geom.out create mode 100644 deps/glslang/Test/baseResults/hlsl.struct.split.trivial.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.structIoFourWay.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.structStructName.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.structarray.flatten.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.structarray.flatten.geom.out create mode 100644 deps/glslang/Test/baseResults/hlsl.structbuffer.append.fn.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.structbuffer.append.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.structbuffer.atomics.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.structbuffer.byte.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.structbuffer.coherent.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.structbuffer.floatidx.comp.out create mode 100644 deps/glslang/Test/baseResults/hlsl.structbuffer.fn.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out create mode 100644 deps/glslang/Test/baseResults/hlsl.structbuffer.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.hlslfun1.out create mode 100644 deps/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.structbuffer.rw.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.structin.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.subpass.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.switch.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.swizzle.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.synthesizeInput.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.target.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.targetStruct1.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.targetStruct2.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.templatetypes.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.texture.struct.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.texture.subvec4.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.texturebuffer.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.this.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.tristream-append.geom.out create mode 100644 deps/glslang/Test/baseResults/hlsl.tx.bracket.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.tx.overload.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.type.half.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.type.identifier.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.type.type.conversion.all.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.type.type.conversion.valid.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.typeGraphCopy.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.typedef.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.void.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.wavebroadcast.comp.out create mode 100644 deps/glslang/Test/baseResults/hlsl.waveprefix.comp.out create mode 100644 deps/glslang/Test/baseResults/hlsl.wavequad.comp.out create mode 100644 deps/glslang/Test/baseResults/hlsl.wavequery.comp.out create mode 100644 deps/glslang/Test/baseResults/hlsl.wavequery.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.wavereduction.comp.out create mode 100644 deps/glslang/Test/baseResults/hlsl.wavevote.comp.out create mode 100644 deps/glslang/Test/baseResults/hlsl.whileLoop.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.y-negate-1.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.y-negate-2.vert.out create mode 100644 deps/glslang/Test/baseResults/hlsl.y-negate-3.vert.out create mode 100644 deps/glslang/Test/baseResults/implicitInnerAtomicUint.frag.out create mode 100644 deps/glslang/Test/baseResults/include.vert.out create mode 100644 deps/glslang/Test/baseResults/invalidSwizzle.vert.out create mode 100644 deps/glslang/Test/baseResults/length.frag.out create mode 100644 deps/glslang/Test/baseResults/lineContinuation.vert.out create mode 100644 deps/glslang/Test/baseResults/lineContinuation100.vert.out create mode 100644 deps/glslang/Test/baseResults/link1.frag.out create mode 100644 deps/glslang/Test/baseResults/link1.vk.frag.out create mode 100644 deps/glslang/Test/baseResults/localAggregates.frag.out create mode 100644 deps/glslang/Test/baseResults/loops.frag.out create mode 100644 deps/glslang/Test/baseResults/loopsArtificial.frag.out create mode 100644 deps/glslang/Test/baseResults/mains1.frag.out create mode 100644 deps/glslang/Test/baseResults/matrix.frag.out create mode 100644 deps/glslang/Test/baseResults/matrix2.frag.out create mode 100644 deps/glslang/Test/baseResults/matrixError.vert.out create mode 100644 deps/glslang/Test/baseResults/maxClipDistances.vert.out create mode 100644 deps/glslang/Test/baseResults/max_vertices_0.geom.out create mode 100644 deps/glslang/Test/baseResults/missingBodies.vert.out create mode 100644 deps/glslang/Test/baseResults/mixedArrayDecls.frag.out create mode 100644 deps/glslang/Test/baseResults/negativeArraySize.comp.out create mode 100644 deps/glslang/Test/baseResults/newTexture.frag.out create mode 100644 deps/glslang/Test/baseResults/noMain.vert.out create mode 100644 deps/glslang/Test/baseResults/nonSquare.vert.out create mode 100644 deps/glslang/Test/baseResults/nonVulkan.frag.out create mode 100644 deps/glslang/Test/baseResults/nonuniform.frag.out create mode 100644 deps/glslang/Test/baseResults/nosuffix.out create mode 100644 deps/glslang/Test/baseResults/numeral.frag.out create mode 100644 deps/glslang/Test/baseResults/nvShaderNoperspectiveInterpolation.frag.out create mode 100644 deps/glslang/Test/baseResults/overlongLiteral.frag.out create mode 100644 deps/glslang/Test/baseResults/pointCoord.frag.out create mode 100644 deps/glslang/Test/baseResults/precise.tesc.out create mode 100644 deps/glslang/Test/baseResults/precise_struct_block.vert.out create mode 100644 deps/glslang/Test/baseResults/precision.frag.out create mode 100644 deps/glslang/Test/baseResults/precision.vert.out create mode 100644 deps/glslang/Test/baseResults/prepost.frag.out create mode 100644 deps/glslang/Test/baseResults/preprocessor.bad_arg.vert.err create mode 100644 deps/glslang/Test/baseResults/preprocessor.bad_arg.vert.out create mode 100644 deps/glslang/Test/baseResults/preprocessor.cpp_style___FILE__.vert.err create mode 100644 deps/glslang/Test/baseResults/preprocessor.cpp_style___FILE__.vert.out create mode 100644 deps/glslang/Test/baseResults/preprocessor.cpp_style_line_directive.vert.err create mode 100644 deps/glslang/Test/baseResults/preprocessor.cpp_style_line_directive.vert.out create mode 100644 deps/glslang/Test/baseResults/preprocessor.defined.vert.err create mode 100644 deps/glslang/Test/baseResults/preprocessor.defined.vert.out create mode 100644 deps/glslang/Test/baseResults/preprocessor.edge_cases.vert.err create mode 100644 deps/glslang/Test/baseResults/preprocessor.edge_cases.vert.out create mode 100644 deps/glslang/Test/baseResults/preprocessor.eof_missing.vert.err create mode 100644 deps/glslang/Test/baseResults/preprocessor.eof_missing.vert.out create mode 100644 deps/glslang/Test/baseResults/preprocessor.errors.vert.err create mode 100644 deps/glslang/Test/baseResults/preprocessor.errors.vert.out create mode 100644 deps/glslang/Test/baseResults/preprocessor.extensions.vert.err create mode 100644 deps/glslang/Test/baseResults/preprocessor.extensions.vert.out create mode 100644 deps/glslang/Test/baseResults/preprocessor.function_macro.vert.err create mode 100644 deps/glslang/Test/baseResults/preprocessor.function_macro.vert.out create mode 100644 deps/glslang/Test/baseResults/preprocessor.include.disabled.vert.err create mode 100644 deps/glslang/Test/baseResults/preprocessor.include.disabled.vert.out create mode 100644 deps/glslang/Test/baseResults/preprocessor.include.enabled.vert.err create mode 100644 deps/glslang/Test/baseResults/preprocessor.include.enabled.vert.out create mode 100644 deps/glslang/Test/baseResults/preprocessor.line.frag.err create mode 100644 deps/glslang/Test/baseResults/preprocessor.line.frag.out create mode 100644 deps/glslang/Test/baseResults/preprocessor.line.vert.err create mode 100644 deps/glslang/Test/baseResults/preprocessor.line.vert.out create mode 100644 deps/glslang/Test/baseResults/preprocessor.many.endif.vert.err create mode 100644 deps/glslang/Test/baseResults/preprocessor.many.endif.vert.out create mode 100644 deps/glslang/Test/baseResults/preprocessor.pragma.vert.err create mode 100644 deps/glslang/Test/baseResults/preprocessor.pragma.vert.out create mode 100644 deps/glslang/Test/baseResults/preprocessor.simple.vert.err create mode 100644 deps/glslang/Test/baseResults/preprocessor.simple.vert.out create mode 100644 deps/glslang/Test/baseResults/preprocessor.success_if_parse_would_fail.vert.err create mode 100644 deps/glslang/Test/baseResults/preprocessor.success_if_parse_would_fail.vert.out create mode 100644 deps/glslang/Test/baseResults/recurse1.vert.out create mode 100644 deps/glslang/Test/baseResults/reflection.vert.out create mode 100644 deps/glslang/Test/baseResults/remap.basic.dcefunc.frag.out create mode 100644 deps/glslang/Test/baseResults/remap.basic.dcevartype.frag.out create mode 100644 deps/glslang/Test/baseResults/remap.basic.everything.frag.out create mode 100644 deps/glslang/Test/baseResults/remap.basic.none.frag.out create mode 100644 deps/glslang/Test/baseResults/remap.basic.strip.frag.out create mode 100644 deps/glslang/Test/baseResults/remap.hlsl.sample.basic.everything.frag.out create mode 100644 deps/glslang/Test/baseResults/remap.hlsl.sample.basic.none.frag.out create mode 100644 deps/glslang/Test/baseResults/remap.hlsl.sample.basic.strip.frag.out create mode 100644 deps/glslang/Test/baseResults/remap.hlsl.templatetypes.everything.frag.out create mode 100644 deps/glslang/Test/baseResults/remap.hlsl.templatetypes.none.frag.out create mode 100644 deps/glslang/Test/baseResults/remap.if.everything.frag.out create mode 100644 deps/glslang/Test/baseResults/remap.if.none.frag.out create mode 100644 deps/glslang/Test/baseResults/remap.invalid-spirv-1.out create mode 100644 deps/glslang/Test/baseResults/remap.invalid-spirv-2.out create mode 100644 deps/glslang/Test/baseResults/remap.literal64.everything.spv.out create mode 100644 deps/glslang/Test/baseResults/remap.literal64.none.spv.out create mode 100644 deps/glslang/Test/baseResults/remap.similar_1a.everything.frag.out create mode 100644 deps/glslang/Test/baseResults/remap.similar_1a.none.frag.out create mode 100644 deps/glslang/Test/baseResults/remap.similar_1b.everything.frag.out create mode 100644 deps/glslang/Test/baseResults/remap.similar_1b.none.frag.out create mode 100644 deps/glslang/Test/baseResults/remap.specconst.comp.out create mode 100644 deps/glslang/Test/baseResults/remap.switch.everything.frag.out create mode 100644 deps/glslang/Test/baseResults/remap.switch.none.frag.out create mode 100644 deps/glslang/Test/baseResults/remap.uniformarray.everything.frag.out create mode 100644 deps/glslang/Test/baseResults/remap.uniformarray.none.frag.out create mode 100644 deps/glslang/Test/baseResults/runtimeArray.vert.out create mode 100644 deps/glslang/Test/baseResults/sample.frag.out create mode 100644 deps/glslang/Test/baseResults/sample.vert.out create mode 100644 deps/glslang/Test/baseResults/samplerlessTextureFunctions.frag.out create mode 100644 deps/glslang/Test/baseResults/simpleFunctionCall.frag.out create mode 100644 deps/glslang/Test/baseResults/specExamples.frag.out create mode 100644 deps/glslang/Test/baseResults/specExamples.vert.out create mode 100644 deps/glslang/Test/baseResults/specExamplesConf.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.1.3.8bitstorage-ssbo.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.1.3.8bitstorage-ubo.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.100ops.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.130.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.140.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.150.geom.out create mode 100644 deps/glslang/Test/baseResults/spv.150.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.16bitstorage-int.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.16bitstorage-uint.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.16bitstorage.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.16bitstorage_Error-int.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.16bitstorage_Error-uint.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.16bitstorage_Error.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.300BuiltIns.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.300layout.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.300layout.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.300layoutp.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.310.bitcast.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.310.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.320.meshShaderUserDefined.mesh.out create mode 100644 deps/glslang/Test/baseResults/spv.330.geom.out create mode 100644 deps/glslang/Test/baseResults/spv.400.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.400.tesc.out create mode 100644 deps/glslang/Test/baseResults/spv.400.tese.out create mode 100644 deps/glslang/Test/baseResults/spv.420.geom.out create mode 100644 deps/glslang/Test/baseResults/spv.430.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.430.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.450.geom.out create mode 100644 deps/glslang/Test/baseResults/spv.450.noRedecl.tesc.out create mode 100644 deps/glslang/Test/baseResults/spv.450.tesc.out create mode 100644 deps/glslang/Test/baseResults/spv.460.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.460.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.460.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.8bitstorage-int.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.8bitstorage-ssbo.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.8bitstorage-ubo.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.8bitstorage-uint.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.8bitstorage_Error-int.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.8bitstorage_Error-uint.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.AnyHitShader.rahit.out create mode 100644 deps/glslang/Test/baseResults/spv.AnyHitShader_Errors.rahit.out create mode 100644 deps/glslang/Test/baseResults/spv.AofA.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.ClosestHitShader.rchit.out create mode 100644 deps/glslang/Test/baseResults/spv.ClosestHitShader_Errors.rchit.out create mode 100644 deps/glslang/Test/baseResults/spv.GeometryShaderPassthrough.geom.out create mode 100644 deps/glslang/Test/baseResults/spv.IntersectShader.rint.out create mode 100644 deps/glslang/Test/baseResults/spv.IntersectShader_Errors.rint.out create mode 100644 deps/glslang/Test/baseResults/spv.MissShader.rmiss.out create mode 100644 deps/glslang/Test/baseResults/spv.MissShader_Errors.rmiss.out create mode 100644 deps/glslang/Test/baseResults/spv.OVR_multiview.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.Operations.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.RayCallable.rcall.out create mode 100644 deps/glslang/Test/baseResults/spv.RayCallable_Errors.rcall.out create mode 100644 deps/glslang/Test/baseResults/spv.RayConstants.rgen.out create mode 100644 deps/glslang/Test/baseResults/spv.RayGenShader.rgen.out create mode 100644 deps/glslang/Test/baseResults/spv.RayGenShader_Errors.rgen.out create mode 100644 deps/glslang/Test/baseResults/spv.accessChain.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.aggOps.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.always-discard.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.always-discard2.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.arbPostDepthCoverage.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.arbPostDepthCoverage_Error.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.atomic.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.atomicInt64.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.barrier.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.bitCast.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.bool.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.boolInBlock.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.branch-return.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.buffer.autoassign.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.builtInXFB.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.computeShaderDerivatives.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.computeShaderDerivatives2.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.conditionalDiscard.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.constStruct.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.controlFlowAttributes.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.conversion.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.dataOut.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.dataOutIndirect.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.dataOutIndirect.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.debugInfo.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.deepRvalue.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.depthOut.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.deviceGroup.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.discard-dce.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.do-simple.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.do-while-continue-break.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.doWhileLoop.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.double.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.drawParams.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.earlyReturnDiscard.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.explicittypes.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.extPostDepthCoverage.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.extPostDepthCoverage_Error.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.float16.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.float16Fetch.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.float32.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.float64.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.flowControl.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.for-complex-condition.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.for-continue-break.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.for-nobody.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.for-notest.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.for-simple.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.forLoop.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.forwardFun.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.fragmentShaderBarycentric.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.fragmentShaderBarycentric2.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.fullyCovered.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.functionCall.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.functionNestedOpaque.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.functionSemantics.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.glFragColor.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.glsl.register.autoassign.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.glsl.register.noautoassign.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.hlslDebugInfo.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.hlslOffsets.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.image.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.image.load-formatted.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.int16.amd.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.int16.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.int32.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.int64.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.int8.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.intOps.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.interpOps.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.layoutNested.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.length.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.localAggregates.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.loops.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.loopsArtificial.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.looseUniformNoLoc.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.matFun.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.matrix.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.matrix2.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.memoryQualifier.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.memoryScopeSemantics.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.memoryScopeSemantics_Error.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.merge-unreachable.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.meshShaderBuiltins.mesh.out create mode 100644 deps/glslang/Test/baseResults/spv.meshShaderPerViewBuiltins.mesh.out create mode 100644 deps/glslang/Test/baseResults/spv.meshShaderPerViewUserDefined.mesh.out create mode 100644 deps/glslang/Test/baseResults/spv.meshShaderRedeclBuiltins.mesh.out create mode 100644 deps/glslang/Test/baseResults/spv.meshShaderRedeclPerViewBuiltins.mesh.out create mode 100644 deps/glslang/Test/baseResults/spv.meshShaderSharedMem.mesh.out create mode 100644 deps/glslang/Test/baseResults/spv.meshShaderTaskMem.mesh.out create mode 100644 deps/glslang/Test/baseResults/spv.meshShaderUserDefined.mesh.out create mode 100644 deps/glslang/Test/baseResults/spv.meshTaskShader.task.out create mode 100644 deps/glslang/Test/baseResults/spv.multiStruct.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.multiStructFuncall.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.multiView.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.multiviewPerViewAttributes.tesc.out create mode 100644 deps/glslang/Test/baseResults/spv.multiviewPerViewAttributes.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.newTexture.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.noBuiltInLoc.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.noDeadDecorations.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.noLocation.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.noWorkgroup.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.nonSquare.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.nonuniform.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.offsets.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.paramMemory.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.perprimitiveNV.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.precise.tesc.out create mode 100644 deps/glslang/Test/baseResults/spv.precise.tese.out create mode 100644 deps/glslang/Test/baseResults/spv.precision.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.precisionNonESSamp.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.prepost.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.pushConstant.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.pushConstantAnon.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.qualifiers.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.queryL.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.rankShift.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.register.autoassign-2.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.register.autoassign.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.register.autoassign.rangetest.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.register.noautoassign.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.register.subpass.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.rw.autoassign.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.sample.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.sampleId.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.sampleMaskOverrideCoverage.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.samplePosition.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.samplerlessTextureFunctions.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.separate.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.set.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.shaderBallot.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.shaderBallotAMD.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.shaderDrawParams.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.shaderFragMaskAMD.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.shaderGroupVote.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.shaderImageFootprint.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.shaderStencilExport.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.shadingRate.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.shiftOps.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.shortCircuit.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.simpleFunctionCall.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.simpleMat.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.sparseTexture.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.sparseTextureClamp.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.specConst.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.specConstant.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.specConstant.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.specConstantComposite.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.specConstantOperations.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.ssbo.autoassign.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.ssboAlias.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.stereoViewRendering.tesc.out create mode 100644 deps/glslang/Test/baseResults/spv.stereoViewRendering.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.storageBuffer.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.structAssignment.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.structDeref.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.structure.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.subgroup.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.subgroup.geom.out create mode 100644 deps/glslang/Test/baseResults/spv.subgroup.tesc.out create mode 100644 deps/glslang/Test/baseResults/spv.subgroup.tese.out create mode 100644 deps/glslang/Test/baseResults/spv.subgroup.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.subgroupArithmetic.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.subgroupBallot.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.subgroupBasic.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.subgroupClustered.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.subgroupClusteredNeg.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.subgroupQuad.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.subgroupShuffle.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.subgroupShuffleRelative.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.subgroupVote.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.subpass.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.switch.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.swizzle.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.swizzleInversion.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.test.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.test.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.texture.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.texture.sampler.transform.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.texture.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.textureBuffer.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.textureGatherBiasLod.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.types.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.uint.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.uniformArray.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.unit1.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.variableArrayIndex.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.varyingArray.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.varyingArrayIndirect.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.vecMatConstruct.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.viewportArray2.tesc.out create mode 100644 deps/glslang/Test/baseResults/spv.viewportArray2.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.voidFunction.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.vulkan100.subgroupArithmetic.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.vulkan100.subgroupPartitioned.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.vulkan110.int16.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.vulkan110.storageBuffer.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.while-continue-break.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.while-simple.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.whileLoop.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.xfb.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.xfb2.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.xfb3.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.xfbOffsetOnStructMembersAssignment.vert.out create mode 100644 deps/glslang/Test/baseResults/stringToDouble.vert.out create mode 100644 deps/glslang/Test/baseResults/structAssignment.frag.out create mode 100644 deps/glslang/Test/baseResults/structDeref.frag.out create mode 100644 deps/glslang/Test/baseResults/structure.frag.out create mode 100644 deps/glslang/Test/baseResults/switch.frag.out create mode 100644 deps/glslang/Test/baseResults/swizzle.frag.out create mode 100644 deps/glslang/Test/baseResults/syntaxError.frag.out create mode 100644 deps/glslang/Test/baseResults/test.conf create mode 100644 deps/glslang/Test/baseResults/test.frag.out create mode 100644 deps/glslang/Test/baseResults/texture.frag.out create mode 100644 deps/glslang/Test/baseResults/tokenLength.vert.out create mode 100644 deps/glslang/Test/baseResults/tokenPaste.vert.out create mode 100644 deps/glslang/Test/baseResults/types.frag.out create mode 100644 deps/glslang/Test/baseResults/uint.frag.out create mode 100644 deps/glslang/Test/baseResults/uniformArray.frag.out create mode 100644 deps/glslang/Test/baseResults/variableArrayIndex.frag.out create mode 100644 deps/glslang/Test/baseResults/varyingArray.frag.out create mode 100644 deps/glslang/Test/baseResults/varyingArrayIndirect.frag.out create mode 100644 deps/glslang/Test/baseResults/versionsClean.frag.out create mode 100644 deps/glslang/Test/baseResults/versionsClean.vert.out create mode 100644 deps/glslang/Test/baseResults/versionsErrors.frag.out create mode 100644 deps/glslang/Test/baseResults/versionsErrors.vert.out create mode 100644 deps/glslang/Test/baseResults/voidFunction.frag.out create mode 100644 deps/glslang/Test/baseResults/vulkan.ast.vert.out create mode 100644 deps/glslang/Test/baseResults/vulkan.comp.out create mode 100644 deps/glslang/Test/baseResults/vulkan.frag.out create mode 100644 deps/glslang/Test/baseResults/vulkan.vert.out create mode 100644 deps/glslang/Test/baseResults/whileLoop.frag.out create mode 100644 deps/glslang/Test/bump create mode 100644 deps/glslang/Test/comment.frag create mode 100644 deps/glslang/Test/compoundsuffix.frag.hlsl create mode 100644 deps/glslang/Test/compoundsuffix.vert.glsl create mode 100644 deps/glslang/Test/conditionalDiscard.frag create mode 100644 deps/glslang/Test/constErrors.frag create mode 100644 deps/glslang/Test/constFold.frag create mode 100644 deps/glslang/Test/constFoldIntMin.frag create mode 100644 deps/glslang/Test/conversion.frag create mode 100644 deps/glslang/Test/cppBad.vert create mode 100644 deps/glslang/Test/cppBad2.vert create mode 100644 deps/glslang/Test/cppComplexExpr.vert create mode 100644 deps/glslang/Test/cppDeepNest.frag create mode 100644 deps/glslang/Test/cppIndent.vert create mode 100644 deps/glslang/Test/cppIntMinOverNegativeOne.frag create mode 100644 deps/glslang/Test/cppNest.vert create mode 100644 deps/glslang/Test/cppPassMacroName.frag create mode 100644 deps/glslang/Test/cppRelaxSkipTokensErrors.vert create mode 100644 deps/glslang/Test/cppSimple.vert create mode 100644 deps/glslang/Test/dataOut.frag create mode 100644 deps/glslang/Test/dataOutIndirect.frag create mode 100644 deps/glslang/Test/dce.frag create mode 100644 deps/glslang/Test/decls.frag create mode 100644 deps/glslang/Test/deepRvalue.frag create mode 100644 deps/glslang/Test/depthOut.frag create mode 100644 deps/glslang/Test/discard-dce.frag create mode 100644 deps/glslang/Test/doWhileLoop.frag create mode 100644 deps/glslang/Test/earlyReturnDiscard.frag create mode 100644 deps/glslang/Test/empty.frag create mode 100644 deps/glslang/Test/empty2.frag create mode 100644 deps/glslang/Test/empty3.frag create mode 100644 deps/glslang/Test/errors.frag create mode 100644 deps/glslang/Test/es-link1.frag create mode 100644 deps/glslang/Test/es-link2.frag create mode 100644 deps/glslang/Test/findFunction.frag create mode 100644 deps/glslang/Test/flowControl.frag create mode 100644 deps/glslang/Test/foo.h create mode 100644 deps/glslang/Test/forLoop.frag create mode 100644 deps/glslang/Test/forwardRef.frag create mode 100644 deps/glslang/Test/functionCall.frag create mode 100644 deps/glslang/Test/functionSemantics.frag create mode 100644 deps/glslang/Test/glsl.-D-U.frag create mode 100644 deps/glslang/Test/glsl.entryPointRename.vert create mode 100644 deps/glslang/Test/glsl.entryPointRename2.vert create mode 100644 deps/glslang/Test/glslangValidator create mode 100644 deps/glslang/Test/glspv.esversion.vert create mode 100644 deps/glslang/Test/glspv.frag create mode 100644 deps/glslang/Test/glspv.version.frag create mode 100644 deps/glslang/Test/glspv.version.vert create mode 100644 deps/glslang/Test/glspv.vert create mode 100644 deps/glslang/Test/hlsl.-D-U.frag create mode 100644 deps/glslang/Test/hlsl.PointSize.geom create mode 100644 deps/glslang/Test/hlsl.PointSize.vert create mode 100644 deps/glslang/Test/hlsl.aliasOpaque.frag create mode 100644 deps/glslang/Test/hlsl.amend.frag create mode 100644 deps/glslang/Test/hlsl.array.flatten.frag create mode 100644 deps/glslang/Test/hlsl.array.frag create mode 100644 deps/glslang/Test/hlsl.array.implicit-size.frag create mode 100644 deps/glslang/Test/hlsl.array.multidim.frag create mode 100644 deps/glslang/Test/hlsl.assoc.frag create mode 100644 deps/glslang/Test/hlsl.attribute.expression.comp create mode 100644 deps/glslang/Test/hlsl.attribute.frag create mode 100644 deps/glslang/Test/hlsl.attributeC11.frag create mode 100644 deps/glslang/Test/hlsl.attributeGlobalBuffer.frag create mode 100644 deps/glslang/Test/hlsl.automap.frag create mode 100644 deps/glslang/Test/hlsl.basic.comp create mode 100644 deps/glslang/Test/hlsl.basic.geom create mode 100644 deps/glslang/Test/hlsl.boolConv.vert create mode 100644 deps/glslang/Test/hlsl.buffer.frag create mode 100644 deps/glslang/Test/hlsl.calculatelod.dx10.frag create mode 100644 deps/glslang/Test/hlsl.calculatelodunclamped.dx10.frag create mode 100644 deps/glslang/Test/hlsl.cast.frag create mode 100644 deps/glslang/Test/hlsl.cbuffer-identifier.vert create mode 100644 deps/glslang/Test/hlsl.charLit.vert create mode 100644 deps/glslang/Test/hlsl.clip.frag create mode 100644 deps/glslang/Test/hlsl.clipdistance-1.frag create mode 100644 deps/glslang/Test/hlsl.clipdistance-1.geom create mode 100644 deps/glslang/Test/hlsl.clipdistance-1.vert create mode 100644 deps/glslang/Test/hlsl.clipdistance-2.frag create mode 100644 deps/glslang/Test/hlsl.clipdistance-2.geom create mode 100644 deps/glslang/Test/hlsl.clipdistance-2.vert create mode 100644 deps/glslang/Test/hlsl.clipdistance-3.frag create mode 100644 deps/glslang/Test/hlsl.clipdistance-3.geom create mode 100644 deps/glslang/Test/hlsl.clipdistance-3.vert create mode 100644 deps/glslang/Test/hlsl.clipdistance-4.frag create mode 100644 deps/glslang/Test/hlsl.clipdistance-4.geom create mode 100644 deps/glslang/Test/hlsl.clipdistance-4.vert create mode 100644 deps/glslang/Test/hlsl.clipdistance-5.frag create mode 100644 deps/glslang/Test/hlsl.clipdistance-5.vert create mode 100644 deps/glslang/Test/hlsl.clipdistance-6.frag create mode 100644 deps/glslang/Test/hlsl.clipdistance-6.vert create mode 100644 deps/glslang/Test/hlsl.clipdistance-7.frag create mode 100644 deps/glslang/Test/hlsl.clipdistance-7.vert create mode 100644 deps/glslang/Test/hlsl.clipdistance-8.frag create mode 100644 deps/glslang/Test/hlsl.clipdistance-8.vert create mode 100644 deps/glslang/Test/hlsl.clipdistance-9.frag create mode 100644 deps/glslang/Test/hlsl.clipdistance-9.vert create mode 100644 deps/glslang/Test/hlsl.color.hull.tesc create mode 100644 deps/glslang/Test/hlsl.comparison.vec.frag create mode 100644 deps/glslang/Test/hlsl.conditional.frag create mode 100644 deps/glslang/Test/hlsl.constantbuffer.frag create mode 100644 deps/glslang/Test/hlsl.constructArray.vert create mode 100644 deps/glslang/Test/hlsl.constructexpr.frag create mode 100644 deps/glslang/Test/hlsl.constructimat.frag create mode 100644 deps/glslang/Test/hlsl.coverage.frag create mode 100644 deps/glslang/Test/hlsl.dashI.vert create mode 100644 deps/glslang/Test/hlsl.deadFunctionMissingBody.vert create mode 100644 deps/glslang/Test/hlsl.depthGreater.frag create mode 100644 deps/glslang/Test/hlsl.depthLess.frag create mode 100644 deps/glslang/Test/hlsl.discard.frag create mode 100644 deps/glslang/Test/hlsl.doLoop.frag create mode 100644 deps/glslang/Test/hlsl.domain.1.tese create mode 100644 deps/glslang/Test/hlsl.domain.2.tese create mode 100644 deps/glslang/Test/hlsl.domain.3.tese create mode 100644 deps/glslang/Test/hlsl.emptystruct.init.vert create mode 100644 deps/glslang/Test/hlsl.emptystructreturn.frag create mode 100644 deps/glslang/Test/hlsl.emptystructreturn.vert create mode 100644 deps/glslang/Test/hlsl.entry-in.frag create mode 100644 deps/glslang/Test/hlsl.entry-out.frag create mode 100644 deps/glslang/Test/hlsl.entry.rename.frag create mode 100644 deps/glslang/Test/hlsl.explicitDescriptorSet.frag create mode 100644 deps/glslang/Test/hlsl.flatten.return.frag create mode 100644 deps/glslang/Test/hlsl.flattenOpaque.frag create mode 100644 deps/glslang/Test/hlsl.flattenOpaqueInit.vert create mode 100644 deps/glslang/Test/hlsl.flattenOpaqueInitMix.vert create mode 100644 deps/glslang/Test/hlsl.flattenSubset.frag create mode 100644 deps/glslang/Test/hlsl.flattenSubset2.frag create mode 100644 deps/glslang/Test/hlsl.float1.frag create mode 100644 deps/glslang/Test/hlsl.float4.frag create mode 100644 deps/glslang/Test/hlsl.forLoop.frag create mode 100644 deps/glslang/Test/hlsl.frag create mode 100644 deps/glslang/Test/hlsl.fraggeom.frag create mode 100644 deps/glslang/Test/hlsl.function.frag create mode 100644 deps/glslang/Test/hlsl.gather.array.dx10.frag create mode 100644 deps/glslang/Test/hlsl.gather.basic.dx10.frag create mode 100644 deps/glslang/Test/hlsl.gather.basic.dx10.vert create mode 100644 deps/glslang/Test/hlsl.gather.offset.dx10.frag create mode 100644 deps/glslang/Test/hlsl.gather.offsetarray.dx10.frag create mode 100644 deps/glslang/Test/hlsl.gatherRGBA.array.dx10.frag create mode 100644 deps/glslang/Test/hlsl.gatherRGBA.basic.dx10.frag create mode 100644 deps/glslang/Test/hlsl.gatherRGBA.offset.dx10.frag create mode 100644 deps/glslang/Test/hlsl.gatherRGBA.offsetarray.dx10.frag create mode 100644 deps/glslang/Test/hlsl.gathercmpRGBA.array.dx10.frag create mode 100644 deps/glslang/Test/hlsl.gathercmpRGBA.basic.dx10.frag create mode 100644 deps/glslang/Test/hlsl.gathercmpRGBA.offset.dx10.frag create mode 100644 deps/glslang/Test/hlsl.gathercmpRGBA.offsetarray.dx10.frag create mode 100644 deps/glslang/Test/hlsl.getdimensions.dx10.frag create mode 100644 deps/glslang/Test/hlsl.getdimensions.dx10.vert create mode 100644 deps/glslang/Test/hlsl.getdimensions.rw.dx10.frag create mode 100644 deps/glslang/Test/hlsl.getsampleposition.dx10.frag create mode 100644 deps/glslang/Test/hlsl.global-const-init.frag create mode 100644 deps/glslang/Test/hlsl.groupid.comp create mode 100644 deps/glslang/Test/hlsl.gs-hs-mix.tesc create mode 100644 deps/glslang/Test/hlsl.hlslOffset.vert create mode 100644 deps/glslang/Test/hlsl.hull.1.tesc create mode 100644 deps/glslang/Test/hlsl.hull.2.tesc create mode 100644 deps/glslang/Test/hlsl.hull.3.tesc create mode 100644 deps/glslang/Test/hlsl.hull.4.tesc create mode 100644 deps/glslang/Test/hlsl.hull.5.tesc create mode 100644 deps/glslang/Test/hlsl.hull.ctrlpt-1.tesc create mode 100644 deps/glslang/Test/hlsl.hull.ctrlpt-2.tesc create mode 100644 deps/glslang/Test/hlsl.hull.void.tesc create mode 100644 deps/glslang/Test/hlsl.identifier.sample.frag create mode 100644 deps/glslang/Test/hlsl.if.frag create mode 100644 deps/glslang/Test/hlsl.imagefetch-subvec4.comp create mode 100644 deps/glslang/Test/hlsl.implicitBool.frag create mode 100644 deps/glslang/Test/hlsl.include.vert create mode 100644 deps/glslang/Test/hlsl.includeNegative.vert create mode 100644 deps/glslang/Test/hlsl.inf.vert create mode 100644 deps/glslang/Test/hlsl.init.frag create mode 100644 deps/glslang/Test/hlsl.init2.frag create mode 100644 deps/glslang/Test/hlsl.inoutquals.frag create mode 100644 deps/glslang/Test/hlsl.intrinsic.frexp.frag create mode 100644 deps/glslang/Test/hlsl.intrinsic.frexp.vert create mode 100644 deps/glslang/Test/hlsl.intrinsics.barriers.comp create mode 100644 deps/glslang/Test/hlsl.intrinsics.comp create mode 100644 deps/glslang/Test/hlsl.intrinsics.d3dcolortoubyte4.frag create mode 100644 deps/glslang/Test/hlsl.intrinsics.double.frag create mode 100644 deps/glslang/Test/hlsl.intrinsics.evalfns.frag create mode 100644 deps/glslang/Test/hlsl.intrinsics.f1632.frag create mode 100644 deps/glslang/Test/hlsl.intrinsics.f3216.frag create mode 100644 deps/glslang/Test/hlsl.intrinsics.frag create mode 100644 deps/glslang/Test/hlsl.intrinsics.lit.frag create mode 100644 deps/glslang/Test/hlsl.intrinsics.negative.comp create mode 100644 deps/glslang/Test/hlsl.intrinsics.negative.frag create mode 100644 deps/glslang/Test/hlsl.intrinsics.negative.vert create mode 100644 deps/glslang/Test/hlsl.intrinsics.promote.down.frag create mode 100644 deps/glslang/Test/hlsl.intrinsics.promote.frag create mode 100644 deps/glslang/Test/hlsl.intrinsics.promote.outputs.frag create mode 100644 deps/glslang/Test/hlsl.intrinsics.vert create mode 100644 deps/glslang/Test/hlsl.isfinite.frag create mode 100644 deps/glslang/Test/hlsl.layout.frag create mode 100644 deps/glslang/Test/hlsl.layoutOverride.vert create mode 100644 deps/glslang/Test/hlsl.load.2dms.dx10.frag create mode 100644 deps/glslang/Test/hlsl.load.array.dx10.frag create mode 100644 deps/glslang/Test/hlsl.load.basic.dx10.frag create mode 100644 deps/glslang/Test/hlsl.load.basic.dx10.vert create mode 100644 deps/glslang/Test/hlsl.load.buffer.dx10.frag create mode 100644 deps/glslang/Test/hlsl.load.buffer.float.dx10.frag create mode 100644 deps/glslang/Test/hlsl.load.offset.dx10.frag create mode 100644 deps/glslang/Test/hlsl.load.offsetarray.dx10.frag create mode 100644 deps/glslang/Test/hlsl.load.rwbuffer.dx10.frag create mode 100644 deps/glslang/Test/hlsl.load.rwtexture.array.dx10.frag create mode 100644 deps/glslang/Test/hlsl.load.rwtexture.dx10.frag create mode 100644 deps/glslang/Test/hlsl.localStructuredBuffer.comp create mode 100644 deps/glslang/Test/hlsl.logical.binary.frag create mode 100644 deps/glslang/Test/hlsl.logical.binary.vec.frag create mode 100644 deps/glslang/Test/hlsl.logical.unary.frag create mode 100644 deps/glslang/Test/hlsl.logicalConvert.frag create mode 100644 deps/glslang/Test/hlsl.loopattr.frag create mode 100644 deps/glslang/Test/hlsl.matNx1.frag create mode 100644 deps/glslang/Test/hlsl.matType.bool.frag create mode 100644 deps/glslang/Test/hlsl.matType.frag create mode 100644 deps/glslang/Test/hlsl.matType.int.frag create mode 100644 deps/glslang/Test/hlsl.matpack-1.frag create mode 100644 deps/glslang/Test/hlsl.matpack-pragma.frag create mode 100644 deps/glslang/Test/hlsl.matrixSwizzle.vert create mode 100644 deps/glslang/Test/hlsl.matrixindex.frag create mode 100644 deps/glslang/Test/hlsl.max.frag create mode 100644 deps/glslang/Test/hlsl.memberFunCall.frag create mode 100644 deps/glslang/Test/hlsl.mintypes.frag create mode 100644 deps/glslang/Test/hlsl.mip.negative.frag create mode 100644 deps/glslang/Test/hlsl.mip.negative2.frag create mode 100644 deps/glslang/Test/hlsl.mip.operator.frag create mode 100644 deps/glslang/Test/hlsl.mul-truncate.frag create mode 100644 deps/glslang/Test/hlsl.multiDescriptorSet.frag create mode 100644 deps/glslang/Test/hlsl.multiEntry.vert create mode 100644 deps/glslang/Test/hlsl.multiReturn.frag create mode 100644 deps/glslang/Test/hlsl.namespace.frag create mode 100644 deps/glslang/Test/hlsl.noSemantic.functionality1.comp create mode 100644 deps/glslang/Test/hlsl.nonint-index.frag create mode 100644 deps/glslang/Test/hlsl.nonstaticMemberFunction.frag create mode 100644 deps/glslang/Test/hlsl.numericsuffixes.frag create mode 100644 deps/glslang/Test/hlsl.numthreads.comp create mode 100644 deps/glslang/Test/hlsl.opaque-type-bug.frag create mode 100644 deps/glslang/Test/hlsl.overload.frag create mode 100644 deps/glslang/Test/hlsl.params.default.frag create mode 100644 deps/glslang/Test/hlsl.params.default.negative.frag create mode 100644 deps/glslang/Test/hlsl.partialFlattenLocal.vert create mode 100644 deps/glslang/Test/hlsl.partialFlattenMixed.vert create mode 100644 deps/glslang/Test/hlsl.partialInit.frag create mode 100644 deps/glslang/Test/hlsl.pp.expand.frag create mode 100644 deps/glslang/Test/hlsl.pp.line.frag create mode 100644 deps/glslang/Test/hlsl.pp.tokenpasting.frag create mode 100644 deps/glslang/Test/hlsl.pp.vert create mode 100644 deps/glslang/Test/hlsl.precedence.frag create mode 100644 deps/glslang/Test/hlsl.precedence2.frag create mode 100644 deps/glslang/Test/hlsl.precise.frag create mode 100644 deps/glslang/Test/hlsl.preprocessor.frag create mode 100644 deps/glslang/Test/hlsl.promote.atomic.frag create mode 100644 deps/glslang/Test/hlsl.promote.binary.frag create mode 100644 deps/glslang/Test/hlsl.promote.vec1.frag create mode 100644 deps/glslang/Test/hlsl.promotions.frag create mode 100644 deps/glslang/Test/hlsl.reflection.binding.frag create mode 100644 deps/glslang/Test/hlsl.reflection.vert create mode 100644 deps/glslang/Test/hlsl.rw.atomics.frag create mode 100644 deps/glslang/Test/hlsl.rw.bracket.frag create mode 100644 deps/glslang/Test/hlsl.rw.register.frag create mode 100644 deps/glslang/Test/hlsl.rw.scalar.bracket.frag create mode 100644 deps/glslang/Test/hlsl.rw.swizzle.frag create mode 100644 deps/glslang/Test/hlsl.rw.vec2.bracket.frag create mode 100644 deps/glslang/Test/hlsl.sample.array.dx10.frag create mode 100644 deps/glslang/Test/hlsl.sample.basic.dx10.frag create mode 100644 deps/glslang/Test/hlsl.sample.offset.dx10.frag create mode 100644 deps/glslang/Test/hlsl.sample.offsetarray.dx10.frag create mode 100644 deps/glslang/Test/hlsl.sample.sub-vec4.dx10.frag create mode 100644 deps/glslang/Test/hlsl.samplebias.array.dx10.frag create mode 100644 deps/glslang/Test/hlsl.samplebias.basic.dx10.frag create mode 100644 deps/glslang/Test/hlsl.samplebias.offset.dx10.frag create mode 100644 deps/glslang/Test/hlsl.samplebias.offsetarray.dx10.frag create mode 100644 deps/glslang/Test/hlsl.samplecmp.array.dx10.frag create mode 100644 deps/glslang/Test/hlsl.samplecmp.basic.dx10.frag create mode 100644 deps/glslang/Test/hlsl.samplecmp.dualmode.frag create mode 100644 deps/glslang/Test/hlsl.samplecmp.negative.frag create mode 100644 deps/glslang/Test/hlsl.samplecmp.negative2.frag create mode 100644 deps/glslang/Test/hlsl.samplecmp.offset.dx10.frag create mode 100644 deps/glslang/Test/hlsl.samplecmp.offsetarray.dx10.frag create mode 100644 deps/glslang/Test/hlsl.samplecmplevelzero.array.dx10.frag create mode 100644 deps/glslang/Test/hlsl.samplecmplevelzero.basic.dx10.frag create mode 100644 deps/glslang/Test/hlsl.samplecmplevelzero.offset.dx10.frag create mode 100644 deps/glslang/Test/hlsl.samplecmplevelzero.offsetarray.dx10.frag create mode 100644 deps/glslang/Test/hlsl.samplegrad.array.dx10.frag create mode 100644 deps/glslang/Test/hlsl.samplegrad.basic.dx10.frag create mode 100644 deps/glslang/Test/hlsl.samplegrad.basic.dx10.vert create mode 100644 deps/glslang/Test/hlsl.samplegrad.offset.dx10.frag create mode 100644 deps/glslang/Test/hlsl.samplegrad.offsetarray.dx10.frag create mode 100644 deps/glslang/Test/hlsl.samplelevel.array.dx10.frag create mode 100644 deps/glslang/Test/hlsl.samplelevel.basic.dx10.frag create mode 100644 deps/glslang/Test/hlsl.samplelevel.basic.dx10.vert create mode 100644 deps/glslang/Test/hlsl.samplelevel.offset.dx10.frag create mode 100644 deps/glslang/Test/hlsl.samplelevel.offsetarray.dx10.frag create mode 100644 deps/glslang/Test/hlsl.scalar-length.frag create mode 100644 deps/glslang/Test/hlsl.scalar2matrix.frag create mode 100644 deps/glslang/Test/hlsl.scalarCast.vert create mode 100644 deps/glslang/Test/hlsl.scope.frag create mode 100644 deps/glslang/Test/hlsl.self_cast.frag create mode 100644 deps/glslang/Test/hlsl.semantic-1.vert create mode 100644 deps/glslang/Test/hlsl.semantic.geom create mode 100644 deps/glslang/Test/hlsl.semantic.vert create mode 100644 deps/glslang/Test/hlsl.semicolons.frag create mode 100644 deps/glslang/Test/hlsl.shapeConv.frag create mode 100644 deps/glslang/Test/hlsl.shapeConvRet.frag create mode 100644 deps/glslang/Test/hlsl.shift.per-set.frag create mode 100644 deps/glslang/Test/hlsl.sin.frag create mode 100644 deps/glslang/Test/hlsl.snorm.uav.comp create mode 100644 deps/glslang/Test/hlsl.staticFuncInit.frag create mode 100644 deps/glslang/Test/hlsl.staticMemberFunction.frag create mode 100644 deps/glslang/Test/hlsl.store.rwbyteaddressbuffer.type.comp create mode 100644 deps/glslang/Test/hlsl.string.frag create mode 100644 deps/glslang/Test/hlsl.stringtoken.frag create mode 100644 deps/glslang/Test/hlsl.struct.frag create mode 100644 deps/glslang/Test/hlsl.struct.split-1.vert create mode 100644 deps/glslang/Test/hlsl.struct.split.array.geom create mode 100644 deps/glslang/Test/hlsl.struct.split.assign.frag create mode 100644 deps/glslang/Test/hlsl.struct.split.call.vert create mode 100644 deps/glslang/Test/hlsl.struct.split.nested.geom create mode 100644 deps/glslang/Test/hlsl.struct.split.trivial.geom create mode 100644 deps/glslang/Test/hlsl.struct.split.trivial.vert create mode 100644 deps/glslang/Test/hlsl.structIoFourWay.frag create mode 100644 deps/glslang/Test/hlsl.structStructName.frag create mode 100644 deps/glslang/Test/hlsl.structarray.flatten.frag create mode 100644 deps/glslang/Test/hlsl.structarray.flatten.geom create mode 100644 deps/glslang/Test/hlsl.structbuffer.append.fn.frag create mode 100644 deps/glslang/Test/hlsl.structbuffer.append.frag create mode 100644 deps/glslang/Test/hlsl.structbuffer.atomics.frag create mode 100644 deps/glslang/Test/hlsl.structbuffer.byte.frag create mode 100644 deps/glslang/Test/hlsl.structbuffer.coherent.frag create mode 100644 deps/glslang/Test/hlsl.structbuffer.floatidx.comp create mode 100644 deps/glslang/Test/hlsl.structbuffer.fn.frag create mode 100644 deps/glslang/Test/hlsl.structbuffer.fn2.comp create mode 100644 deps/glslang/Test/hlsl.structbuffer.frag create mode 100644 deps/glslang/Test/hlsl.structbuffer.incdec.frag create mode 100644 deps/glslang/Test/hlsl.structbuffer.rw.frag create mode 100644 deps/glslang/Test/hlsl.structbuffer.rwbyte.frag create mode 100644 deps/glslang/Test/hlsl.structin.vert create mode 100644 deps/glslang/Test/hlsl.subpass.frag create mode 100644 deps/glslang/Test/hlsl.switch.frag create mode 100644 deps/glslang/Test/hlsl.swizzle.frag create mode 100644 deps/glslang/Test/hlsl.synthesizeInput.frag create mode 100644 deps/glslang/Test/hlsl.target.frag create mode 100644 deps/glslang/Test/hlsl.targetStruct1.frag create mode 100644 deps/glslang/Test/hlsl.targetStruct2.frag create mode 100644 deps/glslang/Test/hlsl.templatetypes.frag create mode 100644 deps/glslang/Test/hlsl.templatetypes.negative.frag create mode 100644 deps/glslang/Test/hlsl.texture.struct.frag create mode 100644 deps/glslang/Test/hlsl.texture.subvec4.frag create mode 100644 deps/glslang/Test/hlsl.texturebuffer.frag create mode 100644 deps/glslang/Test/hlsl.this.frag create mode 100644 deps/glslang/Test/hlsl.tristream-append.geom create mode 100644 deps/glslang/Test/hlsl.tx.bracket.frag create mode 100644 deps/glslang/Test/hlsl.tx.overload.frag create mode 100644 deps/glslang/Test/hlsl.type.half.frag create mode 100644 deps/glslang/Test/hlsl.type.identifier.frag create mode 100644 deps/glslang/Test/hlsl.type.type.conversion.all.frag create mode 100644 deps/glslang/Test/hlsl.type.type.conversion.valid.frag create mode 100644 deps/glslang/Test/hlsl.typeGraphCopy.vert create mode 100644 deps/glslang/Test/hlsl.typedef.frag create mode 100644 deps/glslang/Test/hlsl.void.frag create mode 100644 deps/glslang/Test/hlsl.wavebroadcast.comp create mode 100644 deps/glslang/Test/hlsl.waveprefix.comp create mode 100644 deps/glslang/Test/hlsl.wavequad.comp create mode 100644 deps/glslang/Test/hlsl.wavequery.comp create mode 100644 deps/glslang/Test/hlsl.wavequery.frag create mode 100644 deps/glslang/Test/hlsl.wavereduction.comp create mode 100644 deps/glslang/Test/hlsl.wavevote.comp create mode 100644 deps/glslang/Test/hlsl.whileLoop.frag create mode 100644 deps/glslang/Test/hlsl.y-negate-1.vert create mode 100644 deps/glslang/Test/hlsl.y-negate-2.vert create mode 100644 deps/glslang/Test/hlsl.y-negate-3.vert create mode 100644 deps/glslang/Test/implicitInnerAtomicUint.frag create mode 100644 deps/glslang/Test/inc1/badInc.h create mode 100644 deps/glslang/Test/inc1/bar.h create mode 100644 deps/glslang/Test/inc1/foo.h create mode 100644 deps/glslang/Test/inc1/path1/bar.h create mode 100644 deps/glslang/Test/inc1/path1/local.h create mode 100644 deps/glslang/Test/inc1/path1/notHere.h create mode 100644 deps/glslang/Test/inc1/path2/bar.h create mode 100644 deps/glslang/Test/inc1/path2/notHere.h create mode 100644 deps/glslang/Test/inc1/path2/remote.h create mode 100644 deps/glslang/Test/inc2/bar.h create mode 100644 deps/glslang/Test/inc2/foo.h create mode 100644 deps/glslang/Test/include.vert create mode 100644 deps/glslang/Test/invalidSwizzle.vert create mode 100644 deps/glslang/Test/length.frag create mode 100644 deps/glslang/Test/lineContinuation.vert create mode 100644 deps/glslang/Test/lineContinuation100.vert create mode 100644 deps/glslang/Test/link1.frag create mode 100644 deps/glslang/Test/link1.vk.frag create mode 100644 deps/glslang/Test/link2.frag create mode 100644 deps/glslang/Test/link2.vk.frag create mode 100644 deps/glslang/Test/link3.frag create mode 100644 deps/glslang/Test/localAggregates.frag create mode 100644 deps/glslang/Test/loops.frag create mode 100644 deps/glslang/Test/loopsArtificial.frag create mode 100644 deps/glslang/Test/mains.frag create mode 100644 deps/glslang/Test/mains1.frag create mode 100644 deps/glslang/Test/mains2.frag create mode 100644 deps/glslang/Test/makeDoc create mode 100644 deps/glslang/Test/matrix.frag create mode 100644 deps/glslang/Test/matrix2.frag create mode 100644 deps/glslang/Test/matrixError.vert create mode 100644 deps/glslang/Test/maxClipDistances.vert create mode 100644 deps/glslang/Test/max_vertices_0.geom create mode 100644 deps/glslang/Test/missingBodies.vert create mode 100644 deps/glslang/Test/mixedArrayDecls.frag create mode 100644 deps/glslang/Test/negativeArraySize.comp create mode 100644 deps/glslang/Test/newTexture.frag create mode 100644 deps/glslang/Test/noMain.vert create mode 100644 deps/glslang/Test/noMain1.geom create mode 100644 deps/glslang/Test/noMain2.geom create mode 100644 deps/glslang/Test/nonSquare.vert create mode 100644 deps/glslang/Test/nonVulkan.frag create mode 100644 deps/glslang/Test/nonuniform.frag create mode 100644 deps/glslang/Test/nosuffix create mode 100644 deps/glslang/Test/numeral.frag create mode 100644 deps/glslang/Test/nvShaderNoperspectiveInterpolation.frag create mode 100644 deps/glslang/Test/overlongLiteral.frag create mode 100644 deps/glslang/Test/parent.h create mode 100644 deps/glslang/Test/parentBad create mode 100644 deps/glslang/Test/pointCoord.frag create mode 100644 deps/glslang/Test/precise.tesc create mode 100644 deps/glslang/Test/precise_struct_block.vert create mode 100644 deps/glslang/Test/precision.frag create mode 100644 deps/glslang/Test/precision.vert create mode 100644 deps/glslang/Test/prepost.frag create mode 100644 deps/glslang/Test/preprocessor.bad_arg.vert create mode 100644 deps/glslang/Test/preprocessor.cpp_style___FILE__.vert create mode 100644 deps/glslang/Test/preprocessor.cpp_style_line_directive.vert create mode 100644 deps/glslang/Test/preprocessor.defined.vert create mode 100644 deps/glslang/Test/preprocessor.edge_cases.vert create mode 100644 deps/glslang/Test/preprocessor.eof_missing.vert create mode 100644 deps/glslang/Test/preprocessor.errors.vert create mode 100644 deps/glslang/Test/preprocessor.extensions.vert create mode 100644 deps/glslang/Test/preprocessor.function_macro.vert create mode 100644 deps/glslang/Test/preprocessor.include.disabled.vert create mode 100644 deps/glslang/Test/preprocessor.include.enabled.vert create mode 100644 deps/glslang/Test/preprocessor.line.frag create mode 100644 deps/glslang/Test/preprocessor.line.vert create mode 100644 deps/glslang/Test/preprocessor.many.endif.vert create mode 100644 deps/glslang/Test/preprocessor.pragma.vert create mode 100644 deps/glslang/Test/preprocessor.simple.vert create mode 100644 deps/glslang/Test/preprocessor.success_if_parse_would_fail.vert create mode 100644 deps/glslang/Test/recurse1.frag create mode 100644 deps/glslang/Test/recurse1.vert create mode 100644 deps/glslang/Test/recurse2.frag create mode 100644 deps/glslang/Test/reflection.vert create mode 100644 deps/glslang/Test/remap.basic.dcefunc.frag create mode 100644 deps/glslang/Test/remap.basic.everything.frag create mode 100644 deps/glslang/Test/remap.basic.none.frag create mode 100644 deps/glslang/Test/remap.basic.strip.frag create mode 100644 deps/glslang/Test/remap.hlsl.sample.basic.everything.frag create mode 100644 deps/glslang/Test/remap.hlsl.sample.basic.none.frag create mode 100644 deps/glslang/Test/remap.hlsl.sample.basic.strip.frag create mode 100644 deps/glslang/Test/remap.hlsl.templatetypes.everything.frag create mode 100644 deps/glslang/Test/remap.hlsl.templatetypes.none.frag create mode 100644 deps/glslang/Test/remap.if.everything.frag create mode 100644 deps/glslang/Test/remap.if.none.frag create mode 100644 deps/glslang/Test/remap.invalid-spirv-1.spv create mode 100644 deps/glslang/Test/remap.invalid-spirv-2.spv create mode 100644 deps/glslang/Test/remap.literal64.everything.spv create mode 100644 deps/glslang/Test/remap.literal64.none.spv create mode 100644 deps/glslang/Test/remap.similar_1a.everything.frag create mode 100644 deps/glslang/Test/remap.similar_1a.none.frag create mode 100644 deps/glslang/Test/remap.similar_1b.everything.frag create mode 100644 deps/glslang/Test/remap.similar_1b.none.frag create mode 100644 deps/glslang/Test/remap.specconst.comp create mode 100644 deps/glslang/Test/remap.switch.everything.frag create mode 100644 deps/glslang/Test/remap.switch.none.frag create mode 100644 deps/glslang/Test/remap.uniformarray.everything.frag create mode 100644 deps/glslang/Test/remap.uniformarray.none.frag create mode 100644 deps/glslang/Test/runtests create mode 100644 deps/glslang/Test/runtimeArray.vert create mode 100644 deps/glslang/Test/sample.frag create mode 100644 deps/glslang/Test/sample.frag.out create mode 100644 deps/glslang/Test/sample.vert create mode 100644 deps/glslang/Test/sample.vert.out create mode 100644 deps/glslang/Test/samplerlessTextureFunctions.frag create mode 100644 deps/glslang/Test/simpleFunctionCall.frag create mode 100644 deps/glslang/Test/specExamples.frag create mode 100644 deps/glslang/Test/specExamples.vert create mode 100644 deps/glslang/Test/spv.1.3.8bitstorage-ssbo.vert create mode 100644 deps/glslang/Test/spv.1.3.8bitstorage-ubo.vert create mode 100644 deps/glslang/Test/spv.100ops.frag create mode 100644 deps/glslang/Test/spv.130.frag create mode 100644 deps/glslang/Test/spv.140.frag create mode 100644 deps/glslang/Test/spv.150.geom create mode 100644 deps/glslang/Test/spv.150.vert create mode 100644 deps/glslang/Test/spv.16bitstorage-int.frag create mode 100644 deps/glslang/Test/spv.16bitstorage-uint.frag create mode 100644 deps/glslang/Test/spv.16bitstorage.frag create mode 100644 deps/glslang/Test/spv.16bitstorage_Error-int.frag create mode 100644 deps/glslang/Test/spv.16bitstorage_Error-uint.frag create mode 100644 deps/glslang/Test/spv.16bitstorage_Error.frag create mode 100644 deps/glslang/Test/spv.300BuiltIns.vert create mode 100644 deps/glslang/Test/spv.300layout.frag create mode 100644 deps/glslang/Test/spv.300layout.vert create mode 100644 deps/glslang/Test/spv.300layoutp.vert create mode 100644 deps/glslang/Test/spv.310.bitcast.frag create mode 100644 deps/glslang/Test/spv.310.comp create mode 100644 deps/glslang/Test/spv.320.meshShaderUserDefined.mesh create mode 100644 deps/glslang/Test/spv.330.geom create mode 100644 deps/glslang/Test/spv.400.frag create mode 100644 deps/glslang/Test/spv.400.tesc create mode 100644 deps/glslang/Test/spv.400.tese create mode 100644 deps/glslang/Test/spv.420.geom create mode 100644 deps/glslang/Test/spv.430.frag create mode 100644 deps/glslang/Test/spv.430.vert create mode 100644 deps/glslang/Test/spv.450.geom create mode 100644 deps/glslang/Test/spv.450.noRedecl.tesc create mode 100644 deps/glslang/Test/spv.450.tesc create mode 100644 deps/glslang/Test/spv.460.comp create mode 100644 deps/glslang/Test/spv.460.frag create mode 100644 deps/glslang/Test/spv.460.vert create mode 100644 deps/glslang/Test/spv.8bitstorage-int.frag create mode 100644 deps/glslang/Test/spv.8bitstorage-ssbo.vert create mode 100644 deps/glslang/Test/spv.8bitstorage-ubo.vert create mode 100644 deps/glslang/Test/spv.8bitstorage-uint.frag create mode 100644 deps/glslang/Test/spv.8bitstorage_Error-int.frag create mode 100644 deps/glslang/Test/spv.8bitstorage_Error-uint.frag create mode 100644 deps/glslang/Test/spv.AnyHitShader.rahit create mode 100644 deps/glslang/Test/spv.AnyHitShader_Errors.rahit create mode 100644 deps/glslang/Test/spv.AofA.frag create mode 100644 deps/glslang/Test/spv.ClosestHitShader.rchit create mode 100644 deps/glslang/Test/spv.ClosestHitShader_Errors.rchit create mode 100644 deps/glslang/Test/spv.GeometryShaderPassthrough.geom create mode 100644 deps/glslang/Test/spv.IntersectShader.rint create mode 100644 deps/glslang/Test/spv.IntersectShader_Errors.rint create mode 100644 deps/glslang/Test/spv.MissShader.rmiss create mode 100644 deps/glslang/Test/spv.MissShader_Errors.rmiss create mode 100644 deps/glslang/Test/spv.OVR_multiview.vert create mode 100644 deps/glslang/Test/spv.Operations.frag create mode 100644 deps/glslang/Test/spv.RayCallable.rcall create mode 100644 deps/glslang/Test/spv.RayCallable_Errors.rcall create mode 100644 deps/glslang/Test/spv.RayConstants.rgen create mode 100644 deps/glslang/Test/spv.RayGenShader.rgen create mode 100644 deps/glslang/Test/spv.RayGenShader_Errors.rgen create mode 100644 deps/glslang/Test/spv.accessChain.frag create mode 100644 deps/glslang/Test/spv.aggOps.frag create mode 100644 deps/glslang/Test/spv.always-discard.frag create mode 100644 deps/glslang/Test/spv.always-discard2.frag create mode 100644 deps/glslang/Test/spv.arbPostDepthCoverage.frag create mode 100644 deps/glslang/Test/spv.arbPostDepthCoverage_Error.frag create mode 100644 deps/glslang/Test/spv.atomic.comp create mode 100644 deps/glslang/Test/spv.atomicInt64.comp create mode 100644 deps/glslang/Test/spv.barrier.vert create mode 100644 deps/glslang/Test/spv.bitCast.frag create mode 100644 deps/glslang/Test/spv.bool.vert create mode 100644 deps/glslang/Test/spv.boolInBlock.frag create mode 100644 deps/glslang/Test/spv.branch-return.vert create mode 100644 deps/glslang/Test/spv.buffer.autoassign.frag create mode 100644 deps/glslang/Test/spv.builtInXFB.vert create mode 100644 deps/glslang/Test/spv.computeShaderDerivatives.comp create mode 100644 deps/glslang/Test/spv.computeShaderDerivatives2.comp create mode 100644 deps/glslang/Test/spv.conditionalDiscard.frag create mode 100644 deps/glslang/Test/spv.constStruct.vert create mode 100644 deps/glslang/Test/spv.controlFlowAttributes.frag create mode 100644 deps/glslang/Test/spv.conversion.frag create mode 100644 deps/glslang/Test/spv.dataOut.frag create mode 100644 deps/glslang/Test/spv.dataOutIndirect.frag create mode 100644 deps/glslang/Test/spv.dataOutIndirect.vert create mode 100644 deps/glslang/Test/spv.debugInfo.frag create mode 100644 deps/glslang/Test/spv.deepRvalue.frag create mode 100644 deps/glslang/Test/spv.depthOut.frag create mode 100644 deps/glslang/Test/spv.deviceGroup.frag create mode 100644 deps/glslang/Test/spv.discard-dce.frag create mode 100644 deps/glslang/Test/spv.do-simple.vert create mode 100644 deps/glslang/Test/spv.do-while-continue-break.vert create mode 100644 deps/glslang/Test/spv.doWhileLoop.frag create mode 100644 deps/glslang/Test/spv.double.comp create mode 100644 deps/glslang/Test/spv.drawParams.vert create mode 100644 deps/glslang/Test/spv.earlyReturnDiscard.frag create mode 100644 deps/glslang/Test/spv.explicittypes.frag create mode 100644 deps/glslang/Test/spv.extPostDepthCoverage.frag create mode 100644 deps/glslang/Test/spv.extPostDepthCoverage_Error.frag create mode 100644 deps/glslang/Test/spv.float16.frag create mode 100644 deps/glslang/Test/spv.float16Fetch.frag create mode 100644 deps/glslang/Test/spv.float32.frag create mode 100644 deps/glslang/Test/spv.float64.frag create mode 100644 deps/glslang/Test/spv.flowControl.frag create mode 100644 deps/glslang/Test/spv.for-complex-condition.vert create mode 100644 deps/glslang/Test/spv.for-continue-break.vert create mode 100644 deps/glslang/Test/spv.for-nobody.vert create mode 100644 deps/glslang/Test/spv.for-notest.vert create mode 100644 deps/glslang/Test/spv.for-simple.vert create mode 100644 deps/glslang/Test/spv.forLoop.frag create mode 100644 deps/glslang/Test/spv.forwardFun.frag create mode 100644 deps/glslang/Test/spv.fragmentShaderBarycentric.frag create mode 100644 deps/glslang/Test/spv.fragmentShaderBarycentric2.frag create mode 100644 deps/glslang/Test/spv.fullyCovered.frag create mode 100644 deps/glslang/Test/spv.functionCall.frag create mode 100644 deps/glslang/Test/spv.functionNestedOpaque.vert create mode 100644 deps/glslang/Test/spv.functionSemantics.frag create mode 100644 deps/glslang/Test/spv.glFragColor.frag create mode 100644 deps/glslang/Test/spv.glsl.register.autoassign.frag create mode 100644 deps/glslang/Test/spv.glsl.register.noautoassign.frag create mode 100644 deps/glslang/Test/spv.hlslDebugInfo.vert create mode 100644 deps/glslang/Test/spv.hlslOffsets.vert create mode 100644 deps/glslang/Test/spv.image.frag create mode 100644 deps/glslang/Test/spv.image.load-formatted.frag create mode 100644 deps/glslang/Test/spv.imageLoadStoreLod.frag create mode 100644 deps/glslang/Test/spv.int16.amd.frag create mode 100644 deps/glslang/Test/spv.int16.frag create mode 100644 deps/glslang/Test/spv.int32.frag create mode 100644 deps/glslang/Test/spv.int64.frag create mode 100644 deps/glslang/Test/spv.int8.frag create mode 100644 deps/glslang/Test/spv.intOps.vert create mode 100644 deps/glslang/Test/spv.interpOps.frag create mode 100644 deps/glslang/Test/spv.layoutNested.vert create mode 100644 deps/glslang/Test/spv.length.frag create mode 100644 deps/glslang/Test/spv.localAggregates.frag create mode 100644 deps/glslang/Test/spv.loops.frag create mode 100644 deps/glslang/Test/spv.loopsArtificial.frag create mode 100644 deps/glslang/Test/spv.looseUniformNoLoc.vert create mode 100644 deps/glslang/Test/spv.matFun.vert create mode 100644 deps/glslang/Test/spv.matrix.frag create mode 100644 deps/glslang/Test/spv.matrix2.frag create mode 100644 deps/glslang/Test/spv.memoryQualifier.frag create mode 100644 deps/glslang/Test/spv.memoryScopeSemantics.comp create mode 100644 deps/glslang/Test/spv.memoryScopeSemantics_Error.comp create mode 100644 deps/glslang/Test/spv.merge-unreachable.frag create mode 100644 deps/glslang/Test/spv.meshShaderBuiltins.mesh create mode 100644 deps/glslang/Test/spv.meshShaderPerViewBuiltins.mesh create mode 100644 deps/glslang/Test/spv.meshShaderPerViewUserDefined.mesh create mode 100644 deps/glslang/Test/spv.meshShaderRedeclBuiltins.mesh create mode 100644 deps/glslang/Test/spv.meshShaderRedeclPerViewBuiltins.mesh create mode 100644 deps/glslang/Test/spv.meshShaderSharedMem.mesh create mode 100644 deps/glslang/Test/spv.meshShaderTaskMem.mesh create mode 100644 deps/glslang/Test/spv.meshShaderUserDefined.mesh create mode 100644 deps/glslang/Test/spv.meshTaskShader.task create mode 100644 deps/glslang/Test/spv.multiStruct.comp create mode 100644 deps/glslang/Test/spv.multiStructFuncall.frag create mode 100644 deps/glslang/Test/spv.multiView.frag create mode 100644 deps/glslang/Test/spv.multiviewPerViewAttributes.tesc create mode 100644 deps/glslang/Test/spv.multiviewPerViewAttributes.vert create mode 100644 deps/glslang/Test/spv.newTexture.frag create mode 100644 deps/glslang/Test/spv.noBuiltInLoc.vert create mode 100644 deps/glslang/Test/spv.noDeadDecorations.vert create mode 100644 deps/glslang/Test/spv.noLocation.vert create mode 100644 deps/glslang/Test/spv.noWorkgroup.comp create mode 100644 deps/glslang/Test/spv.nonSquare.vert create mode 100644 deps/glslang/Test/spv.nonuniform.frag create mode 100644 deps/glslang/Test/spv.offsets.frag create mode 100644 deps/glslang/Test/spv.paramMemory.frag create mode 100644 deps/glslang/Test/spv.perprimitiveNV.frag create mode 100644 deps/glslang/Test/spv.precise.tesc create mode 100644 deps/glslang/Test/spv.precise.tese create mode 100644 deps/glslang/Test/spv.precision.frag create mode 100644 deps/glslang/Test/spv.precisionNonESSamp.frag create mode 100644 deps/glslang/Test/spv.prepost.frag create mode 100644 deps/glslang/Test/spv.pushConstant.vert create mode 100644 deps/glslang/Test/spv.pushConstantAnon.vert create mode 100644 deps/glslang/Test/spv.qualifiers.vert create mode 100644 deps/glslang/Test/spv.queryL.frag create mode 100644 deps/glslang/Test/spv.rankShift.comp create mode 100644 deps/glslang/Test/spv.register.autoassign-2.frag create mode 100644 deps/glslang/Test/spv.register.autoassign.frag create mode 100644 deps/glslang/Test/spv.register.autoassign.rangetest.frag create mode 100644 deps/glslang/Test/spv.register.noautoassign.frag create mode 100644 deps/glslang/Test/spv.register.subpass.frag create mode 100644 deps/glslang/Test/spv.rw.autoassign.frag create mode 100644 deps/glslang/Test/spv.sample.frag create mode 100644 deps/glslang/Test/spv.sampleId.frag create mode 100644 deps/glslang/Test/spv.sampleMaskOverrideCoverage.frag create mode 100644 deps/glslang/Test/spv.samplePosition.frag create mode 100644 deps/glslang/Test/spv.samplerlessTextureFunctions.frag create mode 100644 deps/glslang/Test/spv.separate.frag create mode 100644 deps/glslang/Test/spv.set.vert create mode 100644 deps/glslang/Test/spv.shaderBallot.comp create mode 100644 deps/glslang/Test/spv.shaderBallotAMD.comp create mode 100644 deps/glslang/Test/spv.shaderDrawParams.vert create mode 100644 deps/glslang/Test/spv.shaderFragMaskAMD.frag create mode 100644 deps/glslang/Test/spv.shaderGroupVote.comp create mode 100644 deps/glslang/Test/spv.shaderImageFootprint.frag create mode 100644 deps/glslang/Test/spv.shaderStencilExport.frag create mode 100644 deps/glslang/Test/spv.shadingRate.frag create mode 100644 deps/glslang/Test/spv.shiftOps.frag create mode 100644 deps/glslang/Test/spv.shortCircuit.frag create mode 100644 deps/glslang/Test/spv.simpleFunctionCall.frag create mode 100644 deps/glslang/Test/spv.simpleMat.vert create mode 100644 deps/glslang/Test/spv.sparseTexture.frag create mode 100644 deps/glslang/Test/spv.sparseTextureClamp.frag create mode 100644 deps/glslang/Test/spv.specConst.vert create mode 100644 deps/glslang/Test/spv.specConstant.comp create mode 100644 deps/glslang/Test/spv.specConstant.vert create mode 100644 deps/glslang/Test/spv.specConstantComposite.vert create mode 100644 deps/glslang/Test/spv.specConstantOperations.vert create mode 100644 deps/glslang/Test/spv.ssbo.autoassign.frag create mode 100644 deps/glslang/Test/spv.ssboAlias.frag create mode 100644 deps/glslang/Test/spv.stereoViewRendering.tesc create mode 100644 deps/glslang/Test/spv.stereoViewRendering.vert create mode 100644 deps/glslang/Test/spv.storageBuffer.vert create mode 100644 deps/glslang/Test/spv.structAssignment.frag create mode 100644 deps/glslang/Test/spv.structDeref.frag create mode 100644 deps/glslang/Test/spv.structure.frag create mode 100644 deps/glslang/Test/spv.subgroup.frag create mode 100644 deps/glslang/Test/spv.subgroup.geom create mode 100644 deps/glslang/Test/spv.subgroup.tesc create mode 100644 deps/glslang/Test/spv.subgroup.tese create mode 100644 deps/glslang/Test/spv.subgroup.vert create mode 100644 deps/glslang/Test/spv.subgroupArithmetic.comp create mode 100644 deps/glslang/Test/spv.subgroupBallot.comp create mode 100644 deps/glslang/Test/spv.subgroupBasic.comp create mode 100644 deps/glslang/Test/spv.subgroupClustered.comp create mode 100644 deps/glslang/Test/spv.subgroupClusteredNeg.comp create mode 100644 deps/glslang/Test/spv.subgroupPartitioned.comp create mode 100644 deps/glslang/Test/spv.subgroupQuad.comp create mode 100644 deps/glslang/Test/spv.subgroupShuffle.comp create mode 100644 deps/glslang/Test/spv.subgroupShuffleRelative.comp create mode 100644 deps/glslang/Test/spv.subgroupVote.comp create mode 100644 deps/glslang/Test/spv.subpass.frag create mode 100644 deps/glslang/Test/spv.switch.frag create mode 100644 deps/glslang/Test/spv.swizzle.frag create mode 100644 deps/glslang/Test/spv.swizzleInversion.frag create mode 100644 deps/glslang/Test/spv.targetOpenGL.vert create mode 100644 deps/glslang/Test/spv.targetVulkan.vert create mode 100644 deps/glslang/Test/spv.test.frag create mode 100644 deps/glslang/Test/spv.test.vert create mode 100644 deps/glslang/Test/spv.texture.frag create mode 100644 deps/glslang/Test/spv.texture.sampler.transform.frag create mode 100644 deps/glslang/Test/spv.texture.vert create mode 100644 deps/glslang/Test/spv.textureBuffer.vert create mode 100644 deps/glslang/Test/spv.textureGatherBiasLod.frag create mode 100644 deps/glslang/Test/spv.types.frag create mode 100644 deps/glslang/Test/spv.uint.frag create mode 100644 deps/glslang/Test/spv.uniformArray.frag create mode 100644 deps/glslang/Test/spv.unit1.frag create mode 100644 deps/glslang/Test/spv.unit2.frag create mode 100644 deps/glslang/Test/spv.unit3.frag create mode 100644 deps/glslang/Test/spv.variableArrayIndex.frag create mode 100644 deps/glslang/Test/spv.varyingArray.frag create mode 100644 deps/glslang/Test/spv.varyingArrayIndirect.frag create mode 100644 deps/glslang/Test/spv.vecMatConstruct.frag create mode 100644 deps/glslang/Test/spv.viewportArray2.tesc create mode 100644 deps/glslang/Test/spv.viewportArray2.vert create mode 100644 deps/glslang/Test/spv.voidFunction.frag create mode 100644 deps/glslang/Test/spv.vulkan100.subgroupArithmetic.comp create mode 100644 deps/glslang/Test/spv.vulkan100.subgroupPartitioned.comp create mode 100644 deps/glslang/Test/spv.vulkan110.int16.frag create mode 100644 deps/glslang/Test/spv.vulkan110.storageBuffer.vert create mode 100644 deps/glslang/Test/spv.while-continue-break.vert create mode 100644 deps/glslang/Test/spv.while-simple.vert create mode 100644 deps/glslang/Test/spv.whileLoop.frag create mode 100644 deps/glslang/Test/spv.xfb.vert create mode 100644 deps/glslang/Test/spv.xfb2.vert create mode 100644 deps/glslang/Test/spv.xfb3.vert create mode 100644 deps/glslang/Test/spv.xfbOffsetOnStructMembersAssignment.vert create mode 100644 deps/glslang/Test/stringToDouble.vert create mode 100644 deps/glslang/Test/structAssignment.frag create mode 100644 deps/glslang/Test/structDeref.frag create mode 100644 deps/glslang/Test/structure.frag create mode 100644 deps/glslang/Test/switch.frag create mode 100644 deps/glslang/Test/swizzle.frag create mode 100644 deps/glslang/Test/syntaxError.frag create mode 100644 deps/glslang/Test/test.frag create mode 100644 deps/glslang/Test/texture.frag create mode 100644 deps/glslang/Test/tokenLength.vert create mode 100644 deps/glslang/Test/tokenPaste.vert create mode 100644 deps/glslang/Test/types.frag create mode 100644 deps/glslang/Test/uint.frag create mode 100644 deps/glslang/Test/uniformArray.frag create mode 100644 deps/glslang/Test/validate-shaders.sh create mode 100644 deps/glslang/Test/variableArrayIndex.frag create mode 100644 deps/glslang/Test/varyingArray.frag create mode 100644 deps/glslang/Test/varyingArrayIndirect.frag create mode 100644 deps/glslang/Test/versionsClean.frag create mode 100644 deps/glslang/Test/versionsClean.vert create mode 100644 deps/glslang/Test/versionsErrors.frag create mode 100644 deps/glslang/Test/versionsErrors.vert create mode 100644 deps/glslang/Test/voidFunction.frag create mode 100644 deps/glslang/Test/vulkan.ast.vert create mode 100644 deps/glslang/Test/vulkan.comp create mode 100644 deps/glslang/Test/vulkan.frag create mode 100644 deps/glslang/Test/vulkan.vert create mode 100644 deps/glslang/Test/whileLoop.frag create mode 100644 deps/glslang/build_overrides/glslang.gni create mode 100644 deps/glslang/glslang/MachineIndependent/pch.cpp create mode 100644 deps/glslang/glslang/MachineIndependent/pch.h create mode 100644 deps/glslang/gtests/AST.FromFile.cpp create mode 100644 deps/glslang/gtests/BuiltInResource.FromFile.cpp create mode 100644 deps/glslang/gtests/CMakeLists.txt create mode 100644 deps/glslang/gtests/Config.FromFile.cpp create mode 100644 deps/glslang/gtests/HexFloat.cpp create mode 100644 deps/glslang/gtests/Hlsl.FromFile.cpp create mode 100644 deps/glslang/gtests/Initializer.h create mode 100644 deps/glslang/gtests/Link.FromFile.Vk.cpp create mode 100644 deps/glslang/gtests/Link.FromFile.cpp create mode 100644 deps/glslang/gtests/Pp.FromFile.cpp create mode 100644 deps/glslang/gtests/README.md create mode 100644 deps/glslang/gtests/Remap.FromFile.cpp create mode 100644 deps/glslang/gtests/Settings.cpp create mode 100644 deps/glslang/gtests/Settings.h create mode 100644 deps/glslang/gtests/Spv.FromFile.cpp create mode 100644 deps/glslang/gtests/TestFixture.cpp create mode 100644 deps/glslang/gtests/TestFixture.h create mode 100644 deps/glslang/gtests/main.cpp create mode 100644 deps/glslang/gtests/pch.cpp create mode 100644 deps/glslang/gtests/pch.h create mode 100644 deps/glslang/hlsl/pch.cpp create mode 100644 deps/glslang/hlsl/pch.h create mode 100644 deps/glslang/known_good.json create mode 100644 deps/glslang/known_good_khr.json create mode 100644 deps/glslang/update_glslang_sources.py create mode 100644 include/misc/debug_messenger_create_info.h create mode 100644 include/wrappers/debug_messenger.h create mode 100644 src/misc/debug_messenger_create_info.cpp create mode 100644 src/wrappers/debug_messenger.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 5143d3e8..55ea7888 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,6 +64,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/include/misc/compute_pipeline_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/debug.h" "${Anvil_SOURCE_DIR}/include/misc/debug_marker.h" + "${Anvil_SOURCE_DIR}/include/misc/debug_messenger_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/descriptor_set_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/dummy_window.h" "${Anvil_SOURCE_DIR}/include/misc/event_create_info.h" @@ -106,6 +107,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/include/wrappers/command_buffer.h" "${Anvil_SOURCE_DIR}/include/wrappers/command_pool.h" "${Anvil_SOURCE_DIR}/include/wrappers/compute_pipeline_manager.h" + "${Anvil_SOURCE_DIR}/include/wrappers/debug_messenger.h" "${Anvil_SOURCE_DIR}/include/wrappers/descriptor_pool.h" "${Anvil_SOURCE_DIR}/include/wrappers/descriptor_set.h" "${Anvil_SOURCE_DIR}/include/wrappers/descriptor_set_group.h" @@ -143,6 +145,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/src/misc/compute_pipeline_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/debug.cpp" "${Anvil_SOURCE_DIR}/src/misc/debug_marker.cpp" + "${Anvil_SOURCE_DIR}/src/misc/debug_messenger_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/descriptor_set_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/dummy_window.cpp" "${Anvil_SOURCE_DIR}/src/misc/external_handle.cpp" @@ -179,6 +182,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/src/wrappers/command_buffer.cpp" "${Anvil_SOURCE_DIR}/src/wrappers/command_pool.cpp" "${Anvil_SOURCE_DIR}/src/wrappers/compute_pipeline_manager.cpp" + "${Anvil_SOURCE_DIR}/src/wrappers/debug_messenger.cpp" "${Anvil_SOURCE_DIR}/src/wrappers/descriptor_pool.cpp" "${Anvil_SOURCE_DIR}/src/wrappers/descriptor_set.cpp" "${Anvil_SOURCE_DIR}/src/wrappers/descriptor_set_group.cpp" @@ -237,13 +241,13 @@ add_library(Anvil STATIC ${SRC_LIST}) if (WIN32) if (ANVIL_LINK_WITH_GLSLANG) - target_link_libraries(Anvil glslang HLSL OGLCompiler OSDependent SPIRV ${VULKAN_LIBRARY}) + target_link_libraries(Anvil glslang OGLCompiler OSDependent SPIRV ${VULKAN_LIBRARY}) else() target_link_libraries(Anvil ${VULKAN_LIBRARY}) endif() else() if (ANVIL_LINK_WITH_GLSLANG) - target_link_libraries(Anvil glslang HLSL OGLCompiler OSDependent SPIRV ${VULKAN_LIBRARY} pthread) + target_link_libraries(Anvil glslang OGLCompiler OSDependent SPIRV ${VULKAN_LIBRARY} pthread) else() target_link_libraries(Anvil ${VULKAN_LIBRARY} pthread) endif() @@ -256,7 +260,10 @@ else() endif() if (ANVIL_LINK_WITH_GLSLANG) - # Add dependendencies + set(BUILD_TESTING OFF CACHE BOOL ".." FORCE) + set(ENABLE_HLSL OFF CACHE BOOL ".." FORCE) + set(ENABLE_OPT OFF CACHE BOOL ".." FORCE) + if (WIN32) add_subdirectory("deps\\glslang") else() diff --git a/deps/glslang/.gitattributes b/deps/glslang/.gitattributes index 9ef576f6..cade3908 100644 --- a/deps/glslang/.gitattributes +++ b/deps/glslang/.gitattributes @@ -3,19 +3,15 @@ # (scripts often don't have a suffix) * -text *.sh text eof=lf -*.bash text eof=lf # txt files should be native and normalized *.txt text # source code can be native and normalized, but simpler if lf everywhere; will try that way *.h text eof=lf -*.hpp text eof=lf *.c text eof=lf *.cpp text eof=lf *.y text eof=lf *.out text eof=lf *.conf text eof=lf *.err text eof=lf -*.php text eof=lf -*.template text eof=lf diff --git a/deps/glslang/.gitignore b/deps/glslang/.gitignore index 153aa048..a1fe3944 100644 --- a/deps/glslang/.gitignore +++ b/deps/glslang/.gitignore @@ -3,9 +3,8 @@ *.so *.exe tags -glslang/MachineIndependent/glslang_tab.cpp -glslang/MachineIndependent/glslang_tab.cpp.h +TAGS build/ Test/localResults/ -Test/multiThread.out -Test/singleThread.out +External/googletest +External/spirv-tools diff --git a/deps/glslang/BUILD.gn b/deps/glslang/BUILD.gn new file mode 100644 index 00000000..5d5b1507 --- /dev/null +++ b/deps/glslang/BUILD.gn @@ -0,0 +1,153 @@ +# Copyright (C) 2018 Google, Inc. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +import("//build_overrides/glslang.gni") + +spirv_tools_dir = glslang_spirv_tools_dir + +config("glslang_public") { + include_dirs = [ "." ] +} + +source_set("glslang_sources") { + public_configs = [ ":glslang_public" ] + + sources = [ + "OGLCompilersDLL/InitializeDll.cpp", + "OGLCompilersDLL/InitializeDll.h", + "SPIRV/GLSL.ext.EXT.h", + "SPIRV/GLSL.ext.KHR.h", + "SPIRV/GLSL.std.450.h", + "SPIRV/GlslangToSpv.cpp", + "SPIRV/GlslangToSpv.h", + "SPIRV/InReadableOrder.cpp", + "SPIRV/Logger.cpp", + "SPIRV/Logger.h", + "SPIRV/SPVRemapper.cpp", + "SPIRV/SPVRemapper.h", + "SPIRV/SpvBuilder.cpp", + "SPIRV/SpvBuilder.h", + "SPIRV/SpvPostProcess.cpp", + "SPIRV/bitutils.h", + "SPIRV/disassemble.cpp", + "SPIRV/disassemble.h", + "SPIRV/doc.cpp", + "SPIRV/doc.h", + "SPIRV/hex_float.h", + "SPIRV/spirv.hpp", + "SPIRV/spvIR.h", + "glslang/GenericCodeGen/CodeGen.cpp", + "glslang/GenericCodeGen/Link.cpp", + "glslang/Include/BaseTypes.h", + "glslang/Include/Common.h", + "glslang/Include/ConstantUnion.h", + "glslang/Include/InfoSink.h", + "glslang/Include/InitializeGlobals.h", + "glslang/Include/PoolAlloc.h", + "glslang/Include/ResourceLimits.h", + "glslang/Include/ShHandle.h", + "glslang/Include/Types.h", + "glslang/Include/arrays.h", + "glslang/Include/intermediate.h", + "glslang/Include/revision.h", + "glslang/MachineIndependent/Constant.cpp", + "glslang/MachineIndependent/InfoSink.cpp", + "glslang/MachineIndependent/Initialize.cpp", + "glslang/MachineIndependent/Initialize.h", + "glslang/MachineIndependent/IntermTraverse.cpp", + "glslang/MachineIndependent/Intermediate.cpp", + "glslang/MachineIndependent/LiveTraverser.h", + "glslang/MachineIndependent/ParseContextBase.cpp", + "glslang/MachineIndependent/ParseHelper.cpp", + "glslang/MachineIndependent/ParseHelper.h", + "glslang/MachineIndependent/PoolAlloc.cpp", + "glslang/MachineIndependent/RemoveTree.cpp", + "glslang/MachineIndependent/RemoveTree.h", + "glslang/MachineIndependent/Scan.cpp", + "glslang/MachineIndependent/Scan.h", + "glslang/MachineIndependent/ScanContext.h", + "glslang/MachineIndependent/ShaderLang.cpp", + "glslang/MachineIndependent/SymbolTable.cpp", + "glslang/MachineIndependent/SymbolTable.h", + "glslang/MachineIndependent/Versions.cpp", + "glslang/MachineIndependent/Versions.h", + "glslang/MachineIndependent/attribute.cpp", + "glslang/MachineIndependent/attribute.h", + "glslang/MachineIndependent/gl_types.h", + "glslang/MachineIndependent/glslang.y", + "glslang/MachineIndependent/glslang_tab.cpp", + "glslang/MachineIndependent/glslang_tab.cpp.h", + "glslang/MachineIndependent/intermOut.cpp", + "glslang/MachineIndependent/iomapper.cpp", + "glslang/MachineIndependent/iomapper.h", + "glslang/MachineIndependent/limits.cpp", + "glslang/MachineIndependent/linkValidate.cpp", + "glslang/MachineIndependent/localintermediate.h", + "glslang/MachineIndependent/parseConst.cpp", + "glslang/MachineIndependent/parseVersions.h", + "glslang/MachineIndependent/preprocessor/Pp.cpp", + "glslang/MachineIndependent/preprocessor/PpAtom.cpp", + "glslang/MachineIndependent/preprocessor/PpContext.cpp", + "glslang/MachineIndependent/preprocessor/PpContext.h", + "glslang/MachineIndependent/preprocessor/PpScanner.cpp", + "glslang/MachineIndependent/preprocessor/PpTokens.cpp", + "glslang/MachineIndependent/preprocessor/PpTokens.h", + "glslang/MachineIndependent/propagateNoContraction.cpp", + "glslang/MachineIndependent/propagateNoContraction.h", + "glslang/MachineIndependent/reflection.cpp", + "glslang/MachineIndependent/reflection.h", + "glslang/OSDependent/osinclude.h", + "glslang/Public/ShaderLang.h", + ] + + defines = [] + if (is_win) { + sources += [ "glslang/OSDependent/Windows/ossource.cpp" ] + defines += [ "GLSLANG_OSINCLUDE_WIN32" ] + } else { + sources += [ "glslang/OSDependent/Unix/ossource.cpp" ] + defines += [ "GLSLANG_OSINCLUDE_UNIX" ] + } + + if (is_clang) { + cflags_cc = [ + "-Wno-implicit-fallthrough", + "-Wno-ignored-qualifiers", + "-Wno-unused-variable", + ] + } + + deps = [ + "${spirv_tools_dir}:spvtools_opt", + ] +} diff --git a/deps/glslang/CMakeLists.txt b/deps/glslang/CMakeLists.txt index 1ffb1859..7dc35b01 100644 --- a/deps/glslang/CMakeLists.txt +++ b/deps/glslang/CMakeLists.txt @@ -9,24 +9,57 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) # Adhere to GNU filesystem layout conventions include(GNUInstallDirs) +option(BUILD_SHARED_LIBS "Build Shared Libraries" OFF) + +set(LIB_TYPE STATIC) + +if(BUILD_SHARED_LIBS) + set(LIB_TYPE SHARED) +endif() + option(SKIP_GLSLANG_INSTALL "Skip installation" ${SKIP_GLSLANG_INSTALL}) if(NOT ${SKIP_GLSLANG_INSTALL}) set(ENABLE_GLSLANG_INSTALL ON) endif() +option(ENABLE_SPVREMAPPER "Enables building of SPVRemapper" ON) option(ENABLE_AMD_EXTENSIONS "Enables support of AMD-specific extensions" ON) -option(ENABLE_GLSLANG_BINARIES "Builds glslangValidator and spirv-remap" OFF) +option(ENABLE_GLSLANG_BINARIES "Builds glslangValidator and spirv-remap" ON) option(ENABLE_NV_EXTENSIONS "Enables support of Nvidia-specific extensions" ON) option(ENABLE_HLSL "Enables HLSL input support" ON) -option(ENABLE_OPT "Enables spirv-opt capability if present" OFF) +option(ENABLE_OPT "Enables spirv-opt capability if present" ON) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND WIN32) set(CMAKE_INSTALL_PREFIX "install" CACHE STRING "..." FORCE) endif() +option(USE_CCACHE "Use ccache" OFF) +if(USE_CCACHE) + find_program(CCACHE_FOUND ccache) + if(CCACHE_FOUND) + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + endif(CCACHE_FOUND) +endif() + +# Precompiled header macro. Parameters are source file list and filename for pch cpp file. +macro(glslang_pch SRCS PCHCPP) + if(MSVC) + if (CMAKE_GENERATOR MATCHES "^Visual Studio") + set(PCH_NAME "$(IntDir)\\pch.pch") + else() + set(PCH_NAME "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") + endif() + # make source files use/depend on PCH_NAME + set_source_files_properties(${${SRCS}} PROPERTIES COMPILE_FLAGS "/Yupch.h /FIpch.h /Fp${PCH_NAME} /Zm300" OBJECT_DEPENDS "${PCH_NAME}") + # make PCHCPP file compile and generate PCH_NAME + set_source_files_properties(${PCHCPP} PROPERTIES COMPILE_FLAGS "/Ycpch.h /Fp${PCH_NAME} /Zm300" OBJECT_OUTPUTS "${PCH_NAME}") + list(APPEND ${SRCS} "${PCHCPP}") + endif() +endmacro(glslang_pch) + project(glslang) # make testing optional include(CTest) @@ -44,7 +77,7 @@ if(ENABLE_HLSL) endif(ENABLE_HLSL) if(WIN32) - set(CMAKE_DEBUG_POSTFIX "d") + set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Adds a postfix for debug-built libraries.") if(MSVC) include(ChooseMSVCCRT.cmake) endif(MSVC) @@ -86,7 +119,7 @@ function(glslang_set_link_args TARGET) endfunction(glslang_set_link_args) # We depend on these for later projects, so they should come first. -#add_subdirectory(External) +add_subdirectory(External) if(NOT TARGET SPIRV-Tools-opt) set(ENABLE_OPT OFF) @@ -94,9 +127,12 @@ endif() if(ENABLE_OPT) message(STATUS "optimizer enabled") - add_definitions(-DENABLE_OPT) -elseif(ENABLE_HLSL) - message(STATUS "spirv-tools not linked - illegal SPIRV may be generated for HLSL") + add_definitions(-DENABLE_OPT=1) +else() + if(ENABLE_HLSL) + message(STATUS "spirv-tools not linked - illegal SPIRV may be generated for HLSL") + endif() + add_definitions(-DENABLE_OPT=0) endif() add_subdirectory(glslang) @@ -108,4 +144,4 @@ add_subdirectory(SPIRV) if(ENABLE_HLSL) add_subdirectory(hlsl) endif(ENABLE_HLSL) -#add_subdirectory(gtests) +add_subdirectory(gtests) diff --git a/deps/glslang/CODE_OF_CONDUCT.md b/deps/glslang/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..a11610bd --- /dev/null +++ b/deps/glslang/CODE_OF_CONDUCT.md @@ -0,0 +1 @@ +A reminder that this issue tracker is managed by the Khronos Group. Interactions here should follow the Khronos Code of Conduct (https://www.khronos.org/developers/code-of-conduct), which prohibits aggressive or derogatory language. Please keep the discussion friendly and civil. diff --git a/deps/glslang/External/CMakeLists.txt b/deps/glslang/External/CMakeLists.txt new file mode 100644 index 00000000..4d969013 --- /dev/null +++ b/deps/glslang/External/CMakeLists.txt @@ -0,0 +1,43 @@ +# Suppress all warnings from external projects. +set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS -w) + +if(BUILD_TESTING) + if(TARGET gmock) + message(STATUS "Google Mock already configured - use it") + elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest) + # We need to make sure Google Test does not mess up with the + # global CRT settings on Windows. + if(WIN32) + set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) + endif(WIN32) + add_subdirectory(googletest) + set(GTEST_TARGETS + gtest + gtest_main + gmock + gmock_main) + foreach(target ${GTEST_TARGETS}) + set_property(TARGET ${target} PROPERTY FOLDER gtest) + endforeach() + mark_as_advanced(gmock_build_tests + BUILD_GMOCK + BUILD_GTEST + BUILD_SHARED_LIBS + gtest_build_samples + gtest_build_tests + gtest_disable_pthreads + gtest_force_shared_crt + gtest_hide_internal_symbols) + else() + message(STATUS + "Google Mock was not found - tests based on that will not build") + endif() +endif() + +if(ENABLE_OPT AND NOT TARGET SPIRV-Tools-opt) + if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools) + set(SPIRV_SKIP_TESTS ON CACHE BOOL "Skip building SPIRV-Tools tests") + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools spirv-tools) + endif() +endif() + diff --git a/deps/glslang/README.md b/deps/glslang/README.md index c3444467..ba7160da 100644 --- a/deps/glslang/README.md +++ b/deps/glslang/README.md @@ -1,171 +1,341 @@ -Also see the Khronos landing page for glslang as a reference front end: - -https://www.khronos.org/opengles/sdk/tools/Reference-Compiler/ - -The above page includes where to get binaries, and is kept up to date -regarding the feature level of glslang. - -glslang -======= - -An OpenGL and OpenGL ES shader front end and validator. - -There are two components: - -1. A front-end library for programmatic parsing of GLSL/ESSL into an AST. - -2. A standalone wrapper, `glslangValidator`, that can be used as a shader - validation tool. - -How to add a feature protected by a version/extension/stage/profile: See the -comment in `glslang/MachineIndependent/Versions.cpp`. - -Things left to do: See `Todo.txt` - -Execution of Standalone Wrapper -------------------------------- - -To use the standalone binary form, execute `glslangValidator`, and it will print -a usage statement. Basic operation is to give it a file containing a shader, -and it will print out warnings/errors and optionally an AST. - -The applied stage-specific rules are based on the file extension: -* `.vert` for a vertex shader -* `.tesc` for a tessellation control shader -* `.tese` for a tessellation evaluation shader -* `.geom` for a geometry shader -* `.frag` for a fragment shader -* `.comp` for a compute shader - -There is also a non-shader extension -* `.conf` for a configuration file of limits, see usage statement for example - -Building --------- - -CMake: The currently maintained and preferred way of building is through CMake. -In MSVC, after running CMake, you may need to use the Configuration Manager to -check the INSTALL project. - -Programmatic Interfaces ------------------------ - -Another piece of software can programmatically translate shaders to an AST -using one of two different interfaces: -* A new C++ class-oriented interface, or -* The original C functional interface - -The `main()` in `StandAlone/StandAlone.cpp` shows examples using both styles. - -### C++ Class Interface (new, preferred) - -This interface is in roughly the last 1/3 of `ShaderLang.h`. It is in the -glslang namespace and contains the following. - -```cxx -const char* GetEsslVersionString(); -const char* GetGlslVersionString(); -bool InitializeProcess(); -void FinalizeProcess(); - -class TShader - bool parse(...); - void setStrings(...); - const char* getInfoLog(); - -class TProgram - void addShader(...); - bool link(...); - const char* getInfoLog(); - Reflection queries -``` - -See `ShaderLang.h` and the usage of it in `StandAlone/StandAlone.cpp` for more -details. - -### C Functional Interface (orginal) - -This interface is in roughly the first 2/3 of `ShaderLang.h`, and referred to -as the `Sh*()` interface, as all the entry points start `Sh`. - -The `Sh*()` interface takes a "compiler" call-back object, which it calls after -building call back that is passed the AST and can then execute a backend on it. - -The following is a simplified resulting run-time call stack: - -```c -ShCompile(shader, compiler) -> compiler(AST) -> -``` - -In practice, `ShCompile()` takes shader strings, default version, and -warning/error and other options for controling compilation. - -Testing -------- - -Test results should always be included with a pull request that modifies -functionality. There is a simple process for doing this, described here: - -`Test` is an active test directory that contains test input and a -subdirectory `baseResults` that contains the expected results of the -tests. Both the tests and `baseResults` are under source-code control. -Executing the script `./runtests` will generate current results in -the `localResults` directory and `diff` them against the `baseResults`. - -When you want to update the tracked test results, they need to be -copied from `localResults` to `baseResults`. This can be done by -the `bump` shell script. - -The list of files tested comes from `testlist`, and lists input shaders -in this directory, which must all be public for this to work. However, -you can add your own private list of tests, not tracked here, by using -`localtestlist` to list non-tracked tests. This is automatically read -by `runtests` and included in the `diff` and `bump` process. - -Basic Internal Operation ------------------------- - -* Initial lexical analysis is done by the preprocessor in - `MachineIndependent/Preprocessor`, and then refined by a GLSL scanner - in `MachineIndependent/Scan.cpp`. There is currently no use of flex. - -* Code is parsed using bison on `MachineIndependent/glslang.y` with the - aid of a symbol table and an AST. The symbol table is not passed on to - the back-end; the intermediate representation stands on its own. - The tree is built by the grammar productions, many of which are - offloaded into `ParseHelper.cpp`, and by `Intermediate.cpp`. - -* The intermediate representation is very high-level, and represented - as an in-memory tree. This serves to lose no information from the - original program, and to have efficient transfer of the result from - parsing to the back-end. In the AST, constants are propogated and - folded, and a very small amount of dead code is eliminated. - - To aid linking and reflection, the last top-level branch in the AST - lists all global symbols. - -* The primary algorithm of the back-end compiler is to traverse the - tree (high-level intermediate representation), and create an internal - object code representation. There is an example of how to do this - in `MachineIndependent/intermOut.cpp`. - -* Reduction of the tree to a linear byte-code style low-level intermediate - representation is likely a good way to generate fully optimized code. - -* There is currently some dead old-style linker-type code still lying around. - -* Memory pool: parsing uses types derived from C++ `std` types, using a - custom allocator that puts them in a memory pool. This makes allocation - of individual container/contents just few cycles and deallocation free. - This pool is popped after the AST is made and processed. - - The use is simple: if you are going to call `new`, there are three cases: - - - the object comes from the pool (its base class has the macro - `POOL_ALLOCATOR_NEW_DELETE` in it) and you do not have to call `delete` - - - it is a `TString`, in which case call `NewPoolTString()`, which gets - it from the pool, and there is no corresponding `delete` - - - the object does not come from the pool, and you have to do normal - C++ memory management of what you `new` +Also see the Khronos landing page for glslang as a reference front end: + +https://www.khronos.org/opengles/sdk/tools/Reference-Compiler/ + +The above page includes where to get binaries, and is kept up to date +regarding the feature level of glslang. + +glslang +======= + +[![Build Status](https://travis-ci.org/KhronosGroup/glslang.svg?branch=master)](https://travis-ci.org/KhronosGroup/glslang) +[![Build status](https://ci.appveyor.com/api/projects/status/q6fi9cb0qnhkla68/branch/master?svg=true)](https://ci.appveyor.com/project/Khronoswebmaster/glslang/branch/master) + +An OpenGL and OpenGL ES shader front end and validator. + +There are several components: + +1. A GLSL/ESSL front-end for reference validation and translation of GLSL/ESSL into an AST. + +2. An HLSL front-end for translation of a broad generic HLL into the AST. See [issue 362](https://github.com/KhronosGroup/glslang/issues/362) and [issue 701](https://github.com/KhronosGroup/glslang/issues/701) for current status. + +3. A SPIR-V back end for translating the AST to SPIR-V. + +4. A standalone wrapper, `glslangValidator`, that can be used as a command-line tool for the above. + +How to add a feature protected by a version/extension/stage/profile: See the +comment in `glslang/MachineIndependent/Versions.cpp`. + +Tasks waiting to be done are documented as GitHub issues. + +Execution of Standalone Wrapper +------------------------------- + +To use the standalone binary form, execute `glslangValidator`, and it will print +a usage statement. Basic operation is to give it a file containing a shader, +and it will print out warnings/errors and optionally an AST. + +The applied stage-specific rules are based on the file extension: +* `.vert` for a vertex shader +* `.tesc` for a tessellation control shader +* `.tese` for a tessellation evaluation shader +* `.geom` for a geometry shader +* `.frag` for a fragment shader +* `.comp` for a compute shader + +There is also a non-shader extension +* `.conf` for a configuration file of limits, see usage statement for example + +Building +-------- + +Instead of building manually, you can also download the binaries for your +platform directly from the [master-tot release][master-tot-release] on GitHub. +Those binaries are automatically uploaded by the buildbots after successful +testing and they always reflect the current top of the tree of the master +branch. + +### Dependencies + +* A C++11 compiler. + (For MSVS: 2015 is recommended, 2013 is fully supported/tested, and 2010 support is attempted, but not tested.) +* [CMake][cmake]: for generating compilation targets. +* make: _Linux_, ninja is an alternative, if configured. +* [Python 2.7][python]: for executing SPIRV-Tools scripts. (Optional if not using SPIRV-Tools.) +* [bison][bison]: _optional_, but needed when changing the grammar (glslang.y). +* [googletest][googletest]: _optional_, but should use if making any changes to glslang. + +### Build steps + +The following steps assume a Bash shell. On Windows, that could be the Git Bash +shell or some other shell of your choosing. + +#### 1) Check-Out this project + +```bash +cd +git clone https://github.com/KhronosGroup/glslang.git +``` + +#### 2) Check-Out External Projects + +```bash +cd +git clone https://github.com/google/googletest.git External/googletest +``` + +If you want to use googletest with Visual Studio 2013, you also need to check out an older version: + +```bash +# to use googletest with Visual Studio 2013 +cd External/googletest +git checkout 440527a61e1c91188195f7de212c63c77e8f0a45 +cd ../.. +``` + +If you wish to assure that SPIR-V generated from HLSL is legal for Vulkan, +or wish to invoke -Os to reduce SPIR-V size from HLSL or GLSL, install +spirv-tools with this: + +```bash +./update_glslang_sources.py +``` + +#### 3) Configure + +Assume the source directory is `$SOURCE_DIR` and the build directory is +`$BUILD_DIR`. First ensure the build directory exists, then navigate to it: + +```bash +mkdir -p $BUILD_DIR +cd $BUILD_DIR +``` + +For building on Linux: + +```bash +cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$(pwd)/install" $SOURCE_DIR +# "Release" (for CMAKE_BUILD_TYPE) could also be "Debug" or "RelWithDebInfo" +``` + +For building on Windows: + +```bash +cmake $SOURCE_DIR -DCMAKE_INSTALL_PREFIX="$(pwd)/install" +# The CMAKE_INSTALL_PREFIX part is for testing (explained later). +``` + +The CMake GUI also works for Windows (version 3.4.1 tested). + +#### 4) Build and Install + +```bash +# for Linux: +make -j4 install + +# for Windows: +cmake --build . --config Release --target install +# "Release" (for --config) could also be "Debug", "MinSizeRel", or "RelWithDebInfo" +``` + +If using MSVC, after running CMake to configure, use the +Configuration Manager to check the `INSTALL` project. + +### If you need to change the GLSL grammar + +The grammar in `glslang/MachineIndependent/glslang.y` has to be recompiled with +bison if it changes, the output files are committed to the repo to avoid every +developer needing to have bison configured to compile the project when grammar +changes are quite infrequent. For windows you can get binaries from +[GnuWin32][bison-gnu-win32]. + +The command to rebuild is: + +```bash +bison --defines=MachineIndependent/glslang_tab.cpp.h + -t MachineIndependent/glslang.y + -o MachineIndependent/glslang_tab.cpp +``` + +The above command is also available in the bash script at +`glslang/updateGrammar`. + +Testing +------- + +Right now, there are two test harnesses existing in glslang: one is [Google +Test](gtests/), one is the [`runtests` script](Test/runtests). The former +runs unit tests and single-shader single-threaded integration tests, while +the latter runs multiple-shader linking tests and multi-threaded tests. + +### Running tests + +The [`runtests` script](Test/runtests) requires compiled binaries to be +installed into `$BUILD_DIR/install`. Please make sure you have supplied the +correct configuration to CMake (using `-DCMAKE_INSTALL_PREFIX`) when building; +otherwise, you may want to modify the path in the `runtests` script. + +Running Google Test-backed tests: + +```bash +cd $BUILD_DIR + +# for Linux: +ctest + +# for Windows: +ctest -C {Debug|Release|RelWithDebInfo|MinSizeRel} + +# or, run the test binary directly +# (which gives more fine-grained control like filtering): +/glslangtests +``` + +Running `runtests` script-backed tests: + +```bash +cd $SOURCE_DIR/Test && ./runtests +``` + +### Contributing tests + +Test results should always be included with a pull request that modifies +functionality. + +If you are writing unit tests, please use the Google Test framework and +place the tests under the `gtests/` directory. + +Integration tests are placed in the `Test/` directory. It contains test input +and a subdirectory `baseResults/` that contains the expected results of the +tests. Both the tests and `baseResults/` are under source-code control. + +Google Test runs those integration tests by reading the test input, compiling +them, and then compare against the expected results in `baseResults/`. The +integration tests to run via Google Test is registered in various +`gtests/*.FromFile.cpp` source files. `glslangtests` provides a command-line +option `--update-mode`, which, if supplied, will overwrite the golden files +under the `baseResults/` directory with real output from that invocation. +For more information, please check `gtests/` directory's +[README](gtests/README.md). + +For the `runtests` script, it will generate current results in the +`localResults/` directory and `diff` them against the `baseResults/`. +When you want to update the tracked test results, they need to be +copied from `localResults/` to `baseResults/`. This can be done by +the `bump` shell script. + +You can add your own private list of tests, not tracked publicly, by using +`localtestlist` to list non-tracked tests. This is automatically read +by `runtests` and included in the `diff` and `bump` process. + +Programmatic Interfaces +----------------------- + +Another piece of software can programmatically translate shaders to an AST +using one of two different interfaces: +* A new C++ class-oriented interface, or +* The original C functional interface + +The `main()` in `StandAlone/StandAlone.cpp` shows examples using both styles. + +### C++ Class Interface (new, preferred) + +This interface is in roughly the last 1/3 of `ShaderLang.h`. It is in the +glslang namespace and contains the following. + +```cxx +const char* GetEsslVersionString(); +const char* GetGlslVersionString(); +bool InitializeProcess(); +void FinalizeProcess(); + +class TShader + setStrings(...); + setEnvInput(EShSourceHlsl or EShSourceGlsl, stage, EShClientVulkan or EShClientOpenGL, 100); + setEnvClient(EShClientVulkan or EShClientOpenGL, EShTargetVulkan_1_0 or EShTargetVulkan_1_1 or EShTargetOpenGL_450); + setEnvTarget(EShTargetSpv, EShTargetSpv_1_0 or EShTargetSpv_1_3); + bool parse(...); + const char* getInfoLog(); + +class TProgram + void addShader(...); + bool link(...); + const char* getInfoLog(); + Reflection queries +``` + +See `ShaderLang.h` and the usage of it in `StandAlone/StandAlone.cpp` for more +details. + +### C Functional Interface (orignal) + +This interface is in roughly the first 2/3 of `ShaderLang.h`, and referred to +as the `Sh*()` interface, as all the entry points start `Sh`. + +The `Sh*()` interface takes a "compiler" call-back object, which it calls after +building call back that is passed the AST and can then execute a backend on it. + +The following is a simplified resulting run-time call stack: + +```c +ShCompile(shader, compiler) -> compiler(AST) -> +``` + +In practice, `ShCompile()` takes shader strings, default version, and +warning/error and other options for controlling compilation. + +Basic Internal Operation +------------------------ + +* Initial lexical analysis is done by the preprocessor in + `MachineIndependent/Preprocessor`, and then refined by a GLSL scanner + in `MachineIndependent/Scan.cpp`. There is currently no use of flex. + +* Code is parsed using bison on `MachineIndependent/glslang.y` with the + aid of a symbol table and an AST. The symbol table is not passed on to + the back-end; the intermediate representation stands on its own. + The tree is built by the grammar productions, many of which are + offloaded into `ParseHelper.cpp`, and by `Intermediate.cpp`. + +* The intermediate representation is very high-level, and represented + as an in-memory tree. This serves to lose no information from the + original program, and to have efficient transfer of the result from + parsing to the back-end. In the AST, constants are propogated and + folded, and a very small amount of dead code is eliminated. + + To aid linking and reflection, the last top-level branch in the AST + lists all global symbols. + +* The primary algorithm of the back-end compiler is to traverse the + tree (high-level intermediate representation), and create an internal + object code representation. There is an example of how to do this + in `MachineIndependent/intermOut.cpp`. + +* Reduction of the tree to a linear byte-code style low-level intermediate + representation is likely a good way to generate fully optimized code. + +* There is currently some dead old-style linker-type code still lying around. + +* Memory pool: parsing uses types derived from C++ `std` types, using a + custom allocator that puts them in a memory pool. This makes allocation + of individual container/contents just few cycles and deallocation free. + This pool is popped after the AST is made and processed. + + The use is simple: if you are going to call `new`, there are three cases: + + - the object comes from the pool (its base class has the macro + `POOL_ALLOCATOR_NEW_DELETE` in it) and you do not have to call `delete` + + - it is a `TString`, in which case call `NewPoolTString()`, which gets + it from the pool, and there is no corresponding `delete` + + - the object does not come from the pool, and you have to do normal + C++ memory management of what you `new` + + +[cmake]: https://cmake.org/ +[python]: https://www.python.org/ +[bison]: https://www.gnu.org/software/bison/ +[googletest]: https://github.com/google/googletest +[bison-gnu-win32]: http://gnuwin32.sourceforge.net/packages/bison.htm +[master-tot-release]: https://github.com/KhronosGroup/glslang/releases/tag/master-tot diff --git a/deps/glslang/SPIRV/CMakeLists.txt b/deps/glslang/SPIRV/CMakeLists.txt index b6824192..1997e74c 100644 --- a/deps/glslang/SPIRV/CMakeLists.txt +++ b/deps/glslang/SPIRV/CMakeLists.txt @@ -3,7 +3,9 @@ set(SOURCES InReadableOrder.cpp Logger.cpp SpvBuilder.cpp + SpvPostProcess.cpp doc.cpp + SpvTools.cpp disassemble.cpp) set(SPVREMAP_SOURCES @@ -22,6 +24,7 @@ set(HEADERS SpvBuilder.h spvIR.h doc.h + SpvTools.h disassemble.h) set(SPVREMAP_HEADERS @@ -40,20 +43,31 @@ if(ENABLE_NV_EXTENSIONS) GLSL.ext.NV.h) endif(ENABLE_NV_EXTENSIONS) -add_library(SPIRV STATIC ${SOURCES} ${HEADERS}) +add_library(SPIRV ${LIB_TYPE} ${SOURCES} ${HEADERS}) set_property(TARGET SPIRV PROPERTY FOLDER glslang) set_property(TARGET SPIRV PROPERTY POSITION_INDEPENDENT_CODE ON) +target_include_directories(SPIRV PUBLIC ..) -add_library(SPVRemapper STATIC ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS}) -set_property(TARGET SPVRemapper PROPERTY FOLDER glslang) -set_property(TARGET SPVRemapper PROPERTY POSITION_INDEPENDENT_CODE ON) +if (ENABLE_SPVREMAPPER) + add_library(SPVRemapper ${LIB_TYPE} ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS}) + set_property(TARGET SPVRemapper PROPERTY FOLDER glslang) + set_property(TARGET SPVRemapper PROPERTY POSITION_INDEPENDENT_CODE ON) +endif() + +if(WIN32 AND BUILD_SHARED_LIBS) + set_target_properties(SPIRV PROPERTIES PREFIX "") + if (ENABLE_SPVREMAPPER) + set_target_properties(SPVRemapper PROPERTIES PREFIX "") + endif() +endif() if(ENABLE_OPT) target_include_directories(SPIRV PRIVATE ${spirv-tools_SOURCE_DIR}/include PRIVATE ${spirv-tools_SOURCE_DIR}/source ) - target_link_libraries(SPIRV glslang SPIRV-Tools-opt SPVRemapper) + target_link_libraries(SPIRV glslang SPIRV-Tools-opt) + target_include_directories(SPIRV PUBLIC ../External) else() target_link_libraries(SPIRV glslang) endif(ENABLE_OPT) @@ -64,8 +78,23 @@ if(WIN32) endif(WIN32) if(ENABLE_GLSLANG_INSTALL) - install(TARGETS SPIRV SPVRemapper - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + if(BUILD_SHARED_LIBS) + if (ENABLE_SPVREMAPPER) + install(TARGETS SPVRemapper + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + install(TARGETS SPIRV + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + else() + if (ENABLE_SPVREMAPPER) + install(TARGETS SPVRemapper + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + install(TARGETS SPIRV + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SPIRV/) endif(ENABLE_GLSLANG_INSTALL) diff --git a/deps/glslang/SPIRV/GLSL.ext.KHR.h b/deps/glslang/SPIRV/GLSL.ext.KHR.h index d8ea9b67..16b0d9cf 100644 --- a/deps/glslang/SPIRV/GLSL.ext.KHR.h +++ b/deps/glslang/SPIRV/GLSL.ext.KHR.h @@ -36,7 +36,9 @@ static const char* const E_SPV_KHR_device_group = "SPV_KHR_devic static const char* const E_SPV_KHR_multiview = "SPV_KHR_multiview"; static const char* const E_SPV_KHR_shader_draw_parameters = "SPV_KHR_shader_draw_parameters"; static const char* const E_SPV_KHR_16bit_storage = "SPV_KHR_16bit_storage"; +static const char* const E_SPV_KHR_8bit_storage = "SPV_KHR_8bit_storage"; static const char* const E_SPV_KHR_storage_buffer_storage_class = "SPV_KHR_storage_buffer_storage_class"; static const char* const E_SPV_KHR_post_depth_coverage = "SPV_KHR_post_depth_coverage"; +static const char* const E_SPV_KHR_vulkan_memory_model = "SPV_KHR_vulkan_memory_model"; #endif // #ifndef GLSLextKHR_H diff --git a/deps/glslang/SPIRV/GLSL.ext.NV.h b/deps/glslang/SPIRV/GLSL.ext.NV.h index 148d4b45..102d645c 100644 --- a/deps/glslang/SPIRV/GLSL.ext.NV.h +++ b/deps/glslang/SPIRV/GLSL.ext.NV.h @@ -33,7 +33,7 @@ enum Op; enum Capability; static const int GLSLextNVVersion = 100; -static const int GLSLextNVRevision = 5; +static const int GLSLextNVRevision = 11; //SPV_NV_sample_mask_override_coverage const char* const E_SPV_NV_sample_mask_override_coverage = "SPV_NV_sample_mask_override_coverage"; @@ -54,4 +54,22 @@ const char* const E_SPV_NVX_multiview_per_view_attributes = "SPV_NVX_multiview_p //SPV_NV_shader_subgroup_partitioned const char* const E_SPV_NV_shader_subgroup_partitioned = "SPV_NV_shader_subgroup_partitioned"; -#endif // #ifndef GLSLextNV_H \ No newline at end of file +//SPV_NV_fragment_shader_barycentric +const char* const E_SPV_NV_fragment_shader_barycentric = "SPV_NV_fragment_shader_barycentric"; + +//SPV_NV_compute_shader_derivatives +const char* const E_SPV_NV_compute_shader_derivatives = "SPV_NV_compute_shader_derivatives"; + +//SPV_NV_shader_image_footprint +const char* const E_SPV_NV_shader_image_footprint = "SPV_NV_shader_image_footprint"; + +//SPV_NV_mesh_shader +const char* const E_SPV_NV_mesh_shader = "SPV_NV_mesh_shader"; + +//SPV_NV_raytracing +const char* const E_SPV_NV_ray_tracing = "SPV_NV_ray_tracing"; + +//SPV_NV_shading_rate +const char* const E_SPV_NV_shading_rate = "SPV_NV_shading_rate"; + +#endif // #ifndef GLSLextNV_H diff --git a/deps/glslang/SPIRV/GlslangToSpv.cpp b/deps/glslang/SPIRV/GlslangToSpv.cpp index 95b507b1..3569001c 100644 --- a/deps/glslang/SPIRV/GlslangToSpv.cpp +++ b/deps/glslang/SPIRV/GlslangToSpv.cpp @@ -54,15 +54,6 @@ namespace spv { #endif } -#if ENABLE_OPT - #include "spirv-tools/optimizer.hpp" - #include "message.h" -#endif - -#if ENABLE_OPT -using namespace spvtools; -#endif - // Glslang includes #include "../glslang/MachineIndependent/localintermediate.h" #include "../glslang/MachineIndependent/SymbolTable.h" @@ -138,6 +129,10 @@ class TGlslangToSpvTraverser : public glslang::TIntermTraverser { spv::Decoration TranslateInterpolationDecoration(const glslang::TQualifier& qualifier); spv::Decoration TranslateAuxiliaryStorageDecoration(const glslang::TQualifier& qualifier); spv::Decoration TranslateNonUniformDecoration(const glslang::TQualifier& qualifier); + spv::Builder::AccessChain::CoherentFlags TranslateCoherent(const glslang::TType& type); + spv::MemoryAccessMask TranslateMemoryAccess(const spv::Builder::AccessChain::CoherentFlags &coherentFlags); + spv::ImageOperandsMask TranslateImageOperands(const spv::Builder::AccessChain::CoherentFlags &coherentFlags); + spv::Scope TranslateMemoryScope(const spv::Builder::AccessChain::CoherentFlags &coherentFlags); spv::BuiltIn TranslateBuiltInDecoration(glslang::TBuiltInVariable, bool memberDeclaration); spv::ImageFormat TranslateImageFormat(const glslang::TType& type); spv::SelectionControlMask TranslateSelectionControl(const glslang::TIntermSelection&) const; @@ -170,7 +165,7 @@ class TGlslangToSpvTraverser : public glslang::TIntermTraverser { void declareUseOfStructMember(const glslang::TTypeList& members, int glslangMember); bool isShaderEntryPoint(const glslang::TIntermAggregate* node); - bool writableParam(glslang::TStorageQualifier); + bool writableParam(glslang::TStorageQualifier) const; bool originalParam(glslang::TStorageQualifier, const glslang::TType&, bool implicitThisParam); void makeFunctions(const glslang::TIntermSequence&); void makeGlobalInitializers(const glslang::TIntermSequence&); @@ -190,7 +185,7 @@ class TGlslangToSpvTraverser : public glslang::TIntermTraverser { glslang::TBasicType typeProxy); spv::Id createConversion(glslang::TOperator op, OpDecorations&, spv::Id destTypeId, spv::Id operand, glslang::TBasicType typeProxy); - spv::Id createConversionOperation(glslang::TOperator op, spv::Id operand, int vectorSize); + spv::Id createIntWidthConversion(glslang::TOperator op, spv::Id operand, int vectorSize); spv::Id makeSmearedConstant(spv::Id constant, int vectorSize); spv::Id createAtomicOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy); spv::Id createInvocationsOperation(glslang::TOperator op, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy); @@ -199,6 +194,9 @@ class TGlslangToSpvTraverser : public glslang::TIntermTraverser { spv::Id createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy); spv::Id createNoArgOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId); spv::Id getSymbolId(const glslang::TIntermSymbol* node); +#ifdef NV_EXTENSIONS + void addMeshNVDecoration(spv::Id id, int member, const glslang::TQualifier & qualifier); +#endif spv::Id createSpvConstant(const glslang::TIntermTyped&); spv::Id createSpvConstantFromConstUnionArray(const glslang::TType& type, const glslang::TConstUnionArray&, int& nextConst, bool specConstant); bool isTrivialLeaf(const glslang::TIntermTyped* node); @@ -277,6 +275,16 @@ spv::ExecutionModel TranslateExecutionModel(EShLanguage stage) case EShLangGeometry: return spv::ExecutionModelGeometry; case EShLangFragment: return spv::ExecutionModelFragment; case EShLangCompute: return spv::ExecutionModelGLCompute; +#ifdef NV_EXTENSIONS + case EShLangRayGenNV: return spv::ExecutionModelRayGenerationNV; + case EShLangIntersectNV: return spv::ExecutionModelIntersectionNV; + case EShLangAnyHitNV: return spv::ExecutionModelAnyHitNV; + case EShLangClosestHitNV: return spv::ExecutionModelClosestHitNV; + case EShLangMissNV: return spv::ExecutionModelMissNV; + case EShLangCallableNV: return spv::ExecutionModelCallableNV; + case EShLangTaskNV: return spv::ExecutionModelTaskNV; + case EShLangMeshNV: return spv::ExecutionModelMeshNV; +#endif default: assert(0); return spv::ExecutionModelFragment; @@ -326,6 +334,13 @@ spv::Decoration TranslateBlockDecoration(const glslang::TType& type, bool useSto case glslang::EvqBuffer: return useStorageBuffer ? spv::DecorationBlock : spv::DecorationBufferBlock; case glslang::EvqVaryingIn: return spv::DecorationBlock; case glslang::EvqVaryingOut: return spv::DecorationBlock; +#ifdef NV_EXTENSIONS + case glslang::EvqPayloadNV: return spv::DecorationBlock; + case glslang::EvqPayloadInNV: return spv::DecorationBlock; + case glslang::EvqHitAttrNV: return spv::DecorationBlock; + case glslang::EvqCallableDataNV: return spv::DecorationBlock; + case glslang::EvqCallableDataInNV: return spv::DecorationBlock; +#endif default: assert(0); break; @@ -336,12 +351,16 @@ spv::Decoration TranslateBlockDecoration(const glslang::TType& type, bool useSto } // Translate glslang type to SPIR-V memory decorations. -void TranslateMemoryDecoration(const glslang::TQualifier& qualifier, std::vector& memory) +void TranslateMemoryDecoration(const glslang::TQualifier& qualifier, std::vector& memory, bool useVulkanMemoryModel) { - if (qualifier.coherent) - memory.push_back(spv::DecorationCoherent); - if (qualifier.volatil) - memory.push_back(spv::DecorationVolatile); + if (!useVulkanMemoryModel) { + if (qualifier.coherent) + memory.push_back(spv::DecorationCoherent); + if (qualifier.volatil) { + memory.push_back(spv::DecorationVolatile); + memory.push_back(spv::DecorationCoherent); + } + } if (qualifier.restrict) memory.push_back(spv::DecorationRestrict); if (qualifier.readonly) @@ -380,8 +399,24 @@ spv::Decoration TranslateLayoutDecoration(const glslang::TType& type, glslang::T } case glslang::EvqVaryingIn: case glslang::EvqVaryingOut: - assert(type.getQualifier().layoutPacking == glslang::ElpNone); + if (type.getQualifier().isTaskMemory()) { + switch (type.getQualifier().layoutPacking) { + case glslang::ElpShared: return spv::DecorationGLSLShared; + case glslang::ElpPacked: return spv::DecorationGLSLPacked; + default: break; + } + } else { + assert(type.getQualifier().layoutPacking == glslang::ElpNone); + } return spv::DecorationMax; +#ifdef NV_EXTENSIONS + case glslang::EvqPayloadNV: + case glslang::EvqPayloadInNV: + case glslang::EvqHitAttrNV: + case glslang::EvqCallableDataNV: + case glslang::EvqCallableDataInNV: + return spv::DecorationMax; +#endif default: assert(0); return spv::DecorationMax; @@ -457,6 +492,105 @@ spv::Decoration TGlslangToSpvTraverser::TranslateNonUniformDecoration(const glsl return spv::DecorationMax; } +spv::MemoryAccessMask TGlslangToSpvTraverser::TranslateMemoryAccess(const spv::Builder::AccessChain::CoherentFlags &coherentFlags) +{ + if (!glslangIntermediate->usingVulkanMemoryModel() || coherentFlags.isImage) { + return spv::MemoryAccessMaskNone; + } + spv::MemoryAccessMask mask = spv::MemoryAccessMaskNone; + if (coherentFlags.volatil || + coherentFlags.coherent || + coherentFlags.devicecoherent || + coherentFlags.queuefamilycoherent || + coherentFlags.workgroupcoherent || + coherentFlags.subgroupcoherent) { + mask = mask | spv::MemoryAccessMakePointerAvailableKHRMask | + spv::MemoryAccessMakePointerVisibleKHRMask; + } + if (coherentFlags.nonprivate) { + mask = mask | spv::MemoryAccessNonPrivatePointerKHRMask; + } + if (coherentFlags.volatil) { + mask = mask | spv::MemoryAccessVolatileMask; + } + if (mask != spv::MemoryAccessMaskNone) { + builder.addCapability(spv::CapabilityVulkanMemoryModelKHR); + } + return mask; +} + +spv::ImageOperandsMask TGlslangToSpvTraverser::TranslateImageOperands(const spv::Builder::AccessChain::CoherentFlags &coherentFlags) +{ + if (!glslangIntermediate->usingVulkanMemoryModel()) { + return spv::ImageOperandsMaskNone; + } + spv::ImageOperandsMask mask = spv::ImageOperandsMaskNone; + if (coherentFlags.volatil || + coherentFlags.coherent || + coherentFlags.devicecoherent || + coherentFlags.queuefamilycoherent || + coherentFlags.workgroupcoherent || + coherentFlags.subgroupcoherent) { + mask = mask | spv::ImageOperandsMakeTexelAvailableKHRMask | + spv::ImageOperandsMakeTexelVisibleKHRMask; + } + if (coherentFlags.nonprivate) { + mask = mask | spv::ImageOperandsNonPrivateTexelKHRMask; + } + if (coherentFlags.volatil) { + mask = mask | spv::ImageOperandsVolatileTexelKHRMask; + } + if (mask != spv::ImageOperandsMaskNone) { + builder.addCapability(spv::CapabilityVulkanMemoryModelKHR); + } + return mask; +} + +spv::Builder::AccessChain::CoherentFlags TGlslangToSpvTraverser::TranslateCoherent(const glslang::TType& type) +{ + spv::Builder::AccessChain::CoherentFlags flags; + flags.coherent = type.getQualifier().coherent; + flags.devicecoherent = type.getQualifier().devicecoherent; + flags.queuefamilycoherent = type.getQualifier().queuefamilycoherent; + // shared variables are implicitly workgroupcoherent in GLSL. + flags.workgroupcoherent = type.getQualifier().workgroupcoherent || + type.getQualifier().storage == glslang::EvqShared; + flags.subgroupcoherent = type.getQualifier().subgroupcoherent; + // *coherent variables are implicitly nonprivate in GLSL + flags.nonprivate = type.getQualifier().nonprivate || + flags.subgroupcoherent || + flags.workgroupcoherent || + flags.queuefamilycoherent || + flags.devicecoherent || + flags.coherent; + flags.volatil = type.getQualifier().volatil; + flags.isImage = type.getBasicType() == glslang::EbtSampler; + return flags; +} + +spv::Scope TGlslangToSpvTraverser::TranslateMemoryScope(const spv::Builder::AccessChain::CoherentFlags &coherentFlags) +{ + spv::Scope scope; + if (coherentFlags.coherent) { + // coherent defaults to Device scope in the old model, QueueFamilyKHR scope in the new model + scope = glslangIntermediate->usingVulkanMemoryModel() ? spv::ScopeQueueFamilyKHR : spv::ScopeDevice; + } else if (coherentFlags.devicecoherent) { + scope = spv::ScopeDevice; + } else if (coherentFlags.queuefamilycoherent) { + scope = spv::ScopeQueueFamilyKHR; + } else if (coherentFlags.workgroupcoherent) { + scope = spv::ScopeWorkgroup; + } else if (coherentFlags.subgroupcoherent) { + scope = spv::ScopeSubgroup; + } else { + scope = spv::ScopeMax; + } + if (glslangIntermediate->usingVulkanMemoryModel() && scope == spv::ScopeDevice) { + builder.addCapability(spv::CapabilityVulkanMemoryModelDeviceScopeKHR); + } + return scope; +} + // Translate a glslang built-in variable to a SPIR-V built in decoration. Also generate // associated capabilities when required. For some built-in variables, a capability // is generated only when using the variable in an executable instruction, but not when @@ -521,6 +655,11 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI return spv::BuiltInSampleMask; case glslang::EbvLayer: +#ifdef NV_EXTENSIONS + if (glslangIntermediate->getStage() == EShLangMeshNV) { + return spv::BuiltInLayer; + } +#endif builder.addCapability(spv::CapabilityGeometry); if (glslangIntermediate->getStage() == EShLangVertex || glslangIntermediate->getStage() == EShLangTessControl || @@ -729,6 +868,68 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI builder.addExtension(spv::E_SPV_EXT_fragment_fully_covered); builder.addCapability(spv::CapabilityFragmentFullyCoveredEXT); return spv::BuiltInFullyCoveredEXT; + case glslang::EbvFragmentSizeNV: + builder.addExtension(spv::E_SPV_NV_shading_rate); + builder.addCapability(spv::CapabilityShadingRateNV); + return spv::BuiltInFragmentSizeNV; + case glslang::EbvInvocationsPerPixelNV: + builder.addExtension(spv::E_SPV_NV_shading_rate); + builder.addCapability(spv::CapabilityShadingRateNV); + return spv::BuiltInInvocationsPerPixelNV; + + // raytracing + case glslang::EbvLaunchIdNV: + return spv::BuiltInLaunchIdNV; + case glslang::EbvLaunchSizeNV: + return spv::BuiltInLaunchSizeNV; + case glslang::EbvWorldRayOriginNV: + return spv::BuiltInWorldRayOriginNV; + case glslang::EbvWorldRayDirectionNV: + return spv::BuiltInWorldRayDirectionNV; + case glslang::EbvObjectRayOriginNV: + return spv::BuiltInObjectRayOriginNV; + case glslang::EbvObjectRayDirectionNV: + return spv::BuiltInObjectRayDirectionNV; + case glslang::EbvRayTminNV: + return spv::BuiltInRayTminNV; + case glslang::EbvRayTmaxNV: + return spv::BuiltInRayTmaxNV; + case glslang::EbvInstanceCustomIndexNV: + return spv::BuiltInInstanceCustomIndexNV; + case glslang::EbvHitTNV: + return spv::BuiltInHitTNV; + case glslang::EbvHitKindNV: + return spv::BuiltInHitKindNV; + case glslang::EbvObjectToWorldNV: + return spv::BuiltInObjectToWorldNV; + case glslang::EbvWorldToObjectNV: + return spv::BuiltInWorldToObjectNV; + case glslang::EbvIncomingRayFlagsNV: + return spv::BuiltInIncomingRayFlagsNV; + case glslang::EbvBaryCoordNV: + builder.addExtension(spv::E_SPV_NV_fragment_shader_barycentric); + builder.addCapability(spv::CapabilityFragmentBarycentricNV); + return spv::BuiltInBaryCoordNV; + case glslang::EbvBaryCoordNoPerspNV: + builder.addExtension(spv::E_SPV_NV_fragment_shader_barycentric); + builder.addCapability(spv::CapabilityFragmentBarycentricNV); + return spv::BuiltInBaryCoordNoPerspNV; + case glslang::EbvTaskCountNV: + return spv::BuiltInTaskCountNV; + case glslang::EbvPrimitiveCountNV: + return spv::BuiltInPrimitiveCountNV; + case glslang::EbvPrimitiveIndicesNV: + return spv::BuiltInPrimitiveIndicesNV; + case glslang::EbvClipDistancePerViewNV: + return spv::BuiltInClipDistancePerViewNV; + case glslang::EbvCullDistancePerViewNV: + return spv::BuiltInCullDistancePerViewNV; + case glslang::EbvLayerPerViewNV: + return spv::BuiltInLayerPerViewNV; + case glslang::EbvMeshViewCountNV: + return spv::BuiltInMeshViewCountNV; + case glslang::EbvMeshViewIndicesNV: + return spv::BuiltInMeshViewIndicesNV; #endif default: return spv::BuiltInMax; @@ -885,6 +1086,10 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T if (type.getQualifier().isUniformOrBuffer()) { if (type.getQualifier().layoutPushConstant) return spv::StorageClassPushConstant; +#ifdef NV_EXTENSIONS + if (type.getQualifier().layoutShaderRecordNV) + return spv::StorageClassShaderRecordBufferNV; +#endif if (type.getBasicType() == glslang::EbtBlock) return spv::StorageClassUniform; return spv::StorageClassUniformConstant; @@ -895,6 +1100,13 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T case glslang::EvqGlobal: return spv::StorageClassPrivate; case glslang::EvqConstReadOnly: return spv::StorageClassFunction; case glslang::EvqTemporary: return spv::StorageClassFunction; +#ifdef NV_EXTENSIONS + case glslang::EvqPayloadNV: return spv::StorageClassRayPayloadNV; + case glslang::EvqPayloadInNV: return spv::StorageClassIncomingRayPayloadNV; + case glslang::EvqHitAttrNV: return spv::StorageClassHitAttributeNV; + case glslang::EvqCallableDataNV: return spv::StorageClassCallableDataNV; + case glslang::EvqCallableDataInNV: return spv::StorageClassIncomingCallableDataNV; +#endif default: assert(0); break; @@ -909,6 +1121,7 @@ void TGlslangToSpvTraverser::addIndirectionIndexCapabilities(const glslang::TTyp { if (indexType.getQualifier().isNonUniform()) { // deal with an asserted non-uniform index + // SPV_EXT_descriptor_indexing already added in TranslateNonUniformDecoration if (baseType.getBasicType() == glslang::EbtSampler) { if (baseType.getQualifier().hasAttachment()) builder.addCapability(spv::CapabilityInputAttachmentArrayNonUniformIndexingEXT); @@ -929,12 +1142,16 @@ void TGlslangToSpvTraverser::addIndirectionIndexCapabilities(const glslang::TTyp } else { // assume a dynamically uniform index if (baseType.getBasicType() == glslang::EbtSampler) { - if (baseType.getQualifier().hasAttachment()) + if (baseType.getQualifier().hasAttachment()) { + builder.addExtension("SPV_EXT_descriptor_indexing"); builder.addCapability(spv::CapabilityInputAttachmentArrayDynamicIndexingEXT); - else if (baseType.isImage() && baseType.getSampler().dim == glslang::EsdBuffer) + } else if (baseType.isImage() && baseType.getSampler().dim == glslang::EsdBuffer) { + builder.addExtension("SPV_EXT_descriptor_indexing"); builder.addCapability(spv::CapabilityStorageTexelBufferArrayDynamicIndexingEXT); - else if (baseType.isTexture() && baseType.getSampler().dim == glslang::EsdBuffer) + } else if (baseType.isTexture() && baseType.getSampler().dim == glslang::EsdBuffer) { + builder.addExtension("SPV_EXT_descriptor_indexing"); builder.addCapability(spv::CapabilityUniformTexelBufferArrayDynamicIndexingEXT); + } } } } @@ -945,7 +1162,11 @@ bool IsDescriptorResource(const glslang::TType& type) { // uniform and buffer blocks are included, unless it is a push_constant if (type.getBasicType() == glslang::EbtBlock) - return type.getQualifier().isUniformOrBuffer() && ! type.getQualifier().layoutPushConstant; + return type.getQualifier().isUniformOrBuffer() && +#ifdef NV_EXTENSIONS + ! type.getQualifier().layoutShaderRecordNV && +#endif + ! type.getQualifier().layoutPushConstant; // non block... // basically samplerXXX/subpass/sampler/texture are all included @@ -981,6 +1202,16 @@ void InheritQualifiers(glslang::TQualifier& child, const glslang::TQualifier& pa child.sample = true; if (parent.coherent) child.coherent = true; + if (parent.devicecoherent) + child.devicecoherent = true; + if (parent.queuefamilycoherent) + child.queuefamilycoherent = true; + if (parent.workgroupcoherent) + child.workgroupcoherent = true; + if (parent.subgroupcoherent) + child.subgroupcoherent = true; + if (parent.nonprivate) + child.nonprivate = true; if (parent.volatil) child.volatil = true; if (parent.restrict) @@ -989,6 +1220,14 @@ void InheritQualifiers(glslang::TQualifier& child, const glslang::TQualifier& pa child.readonly = true; if (parent.writeonly) child.writeonly = true; +#ifdef NV_EXTENSIONS + if (parent.perPrimitiveNV) + child.perPrimitiveNV = true; + if (parent.perViewNV) + child.perViewNV = true; + if (parent.perTaskNV) + child.perTaskNV = true; +#endif } bool HasNonLayoutQualifiers(const glslang::TType& type, const glslang::TQualifier& qualifier) @@ -1034,20 +1273,25 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl std::string text; const std::vector& processes = glslangIntermediate->getProcesses(); for (int p = 0; p < (int)processes.size(); ++p) { - if (glslangIntermediate->getSpv().spv < 0x00010100) { + if (glslangIntermediate->getSpv().spv < glslang::EShTargetSpv_1_1) { text.append("// OpModuleProcessed "); text.append(processes[p]); text.append("\n"); } else builder.addModuleProcessed(processes[p]); } - if (glslangIntermediate->getSpv().spv < 0x00010100 && (int)processes.size() > 0) + if (glslangIntermediate->getSpv().spv < glslang::EShTargetSpv_1_1 && (int)processes.size() > 0) text.append("#line 1\n"); text.append(glslangIntermediate->getSourceText()); builder.setSourceText(text); } stdBuiltins = builder.import("GLSL.std.450"); - builder.setMemoryModel(spv::AddressingModelLogical, spv::MemoryModelGLSL450); + if (glslangIntermediate->usingVulkanMemoryModel()) { + builder.setMemoryModel(spv::AddressingModelLogical, spv::MemoryModelVulkanKHR); + builder.addExtension(spv::E_SPV_KHR_vulkan_memory_model); + } else { + builder.setMemoryModel(spv::AddressingModelLogical, spv::MemoryModelGLSL450); + } shaderEntry = builder.makeEntryPoint(glslangIntermediate->getEntryPointName().c_str()); entryPoint = builder.addEntryPoint(executionModel, shaderEntry, glslangIntermediate->getEntryPointName().c_str()); @@ -1174,8 +1418,52 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl builder.addExecutionMode(shaderEntry, spv::ExecutionModeLocalSize, glslangIntermediate->getLocalSize(0), glslangIntermediate->getLocalSize(1), glslangIntermediate->getLocalSize(2)); +#ifdef NV_EXTENSIONS + if (glslangIntermediate->getLayoutDerivativeModeNone() == glslang::LayoutDerivativeGroupQuads) { + builder.addCapability(spv::CapabilityComputeDerivativeGroupQuadsNV); + builder.addExecutionMode(shaderEntry, spv::ExecutionModeDerivativeGroupQuadsNV); + builder.addExtension(spv::E_SPV_NV_compute_shader_derivatives); + } else if (glslangIntermediate->getLayoutDerivativeModeNone() == glslang::LayoutDerivativeGroupLinear) { + builder.addCapability(spv::CapabilityComputeDerivativeGroupLinearNV); + builder.addExecutionMode(shaderEntry, spv::ExecutionModeDerivativeGroupLinearNV); + builder.addExtension(spv::E_SPV_NV_compute_shader_derivatives); + } +#endif break; +#ifdef NV_EXTENSIONS + case EShLangRayGenNV: + case EShLangIntersectNV: + case EShLangAnyHitNV: + case EShLangClosestHitNV: + case EShLangMissNV: + case EShLangCallableNV: + builder.addCapability(spv::CapabilityRayTracingNV); + builder.addExtension("SPV_NV_ray_tracing"); + break; + case EShLangTaskNV: + case EShLangMeshNV: + builder.addCapability(spv::CapabilityMeshShadingNV); + builder.addExtension(spv::E_SPV_NV_mesh_shader); + builder.addExecutionMode(shaderEntry, spv::ExecutionModeLocalSize, glslangIntermediate->getLocalSize(0), + glslangIntermediate->getLocalSize(1), + glslangIntermediate->getLocalSize(2)); + if (glslangIntermediate->getStage() == EShLangMeshNV) { + builder.addExecutionMode(shaderEntry, spv::ExecutionModeOutputVertices, glslangIntermediate->getVertices()); + builder.addExecutionMode(shaderEntry, spv::ExecutionModeOutputPrimitivesNV, glslangIntermediate->getPrimitives()); + + switch (glslangIntermediate->getOutputPrimitive()) { + case glslang::ElgPoints: mode = spv::ExecutionModeOutputPoints; break; + case glslang::ElgLines: mode = spv::ExecutionModeOutputLinesNV; break; + case glslang::ElgTriangles: mode = spv::ExecutionModeOutputTrianglesNV; break; + default: mode = spv::ExecutionModeMax; break; + } + if (mode != spv::ExecutionModeMax) + builder.addExecutionMode(shaderEntry, (spv::ExecutionMode)mode); + } + break; +#endif + default: break; } @@ -1184,6 +1472,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl // Finish creating SPV, after the traversal is complete. void TGlslangToSpvTraverser::finishSpv() { + // Finish the entry point function if (! entryPointTerminated) { builder.setBuildPoint(shaderEntry->getLastBlock()); builder.leaveFunction(); @@ -1193,7 +1482,9 @@ void TGlslangToSpvTraverser::finishSpv() for (auto it = iOSet.cbegin(); it != iOSet.cend(); ++it) entryPoint->addIdOperand(*it); - builder.eliminateDeadDecorations(); + // Add capabilities, extensions, remove unneeded decorations, etc., + // based on the resulting SPIR-V. + builder.postProcess(); } // Write the SPV into 'out'. @@ -1350,7 +1641,7 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T // store the result builder.setAccessChain(lValue); - multiTypeStore(node->getType(), rValue); + multiTypeStore(node->getLeft()->getType(), rValue); // assignments are expressions having an rValue after they are evaluated... builder.clearAccessChain(); @@ -1387,7 +1678,7 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T } // normal case for indexing array or structure or block - builder.accessChainPush(builder.makeIntConstant(spvIndex)); + builder.accessChainPush(builder.makeIntConstant(spvIndex), TranslateCoherent(node->getLeft()->getType())); // Add capabilities here for accessing PointSize and clip/cull distance. // We have deferred generation of associated capabilities until now. @@ -1423,7 +1714,7 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T if (! node->getLeft()->getType().isArray() && node->getLeft()->getType().isVector()) builder.accessChainPushComponent(index, convertGlslangToSpvType(node->getLeft()->getType())); else - builder.accessChainPush(index); + builder.accessChainPush(index, TranslateCoherent(node->getLeft()->getType())); } return false; case glslang::EOpVectorSwizzle: @@ -1657,11 +1948,11 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt builder.setAccessChainRValue(result); return false; + } else if (node->getOp() == glslang::EOpImageStore || #ifdef AMD_EXTENSIONS - } else if (node->getOp() == glslang::EOpImageStore || node->getOp() == glslang::EOpImageStoreLod) { -#else - } else if (node->getOp() == glslang::EOpImageStore) { + node->getOp() == glslang::EOpImageStoreLod || #endif + node->getOp() == glslang::EOpImageAtomicStore) { // "imageStore" is a special case, which has no result return false; } @@ -1951,6 +2242,10 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt // These all have 0 operands and will naturally finish up in the code below for 0 operands break; + case glslang::EOpAtomicStore: + noReturnValue = true; + // fallthrough + case glslang::EOpAtomicLoad: case glslang::EOpAtomicAdd: case glslang::EOpAtomicMin: case glslang::EOpAtomicMax: @@ -1976,6 +2271,16 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt atomic = true; break; +#ifdef NV_EXTENSIONS + case glslang::EOpIgnoreIntersectionNV: + case glslang::EOpTerminateRayNV: + case glslang::EOpTraceNV: + case glslang::EOpExecuteCallableNV: + case glslang::EOpWritePackedPrimitiveIndices4x8NV: + noReturnValue = true; + break; +#endif + default: break; } @@ -2049,6 +2354,8 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpAtomicXor: case glslang::EOpAtomicExchange: case glslang::EOpAtomicCompSwap: + case glslang::EOpAtomicLoad: + case glslang::EOpAtomicStore: case glslang::EOpAtomicCounterAdd: case glslang::EOpAtomicCounterSubtract: case glslang::EOpAtomicCounterMin: @@ -2468,7 +2775,9 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol* // can still have a mapping to a SPIR-V Id. // This includes specialization constants. if (node->getQualifier().isConstant()) { - return createSpvConstant(*node); + spv::Id result = createSpvConstant(*node); + if (result != spv::NoResult) + return result; } // Now, handle actual variables @@ -2479,17 +2788,44 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol* node->getType().containsBasicType(glslang::EbtInt16) || node->getType().containsBasicType(glslang::EbtUint16); if (contains16BitType) { - if (storageClass == spv::StorageClassInput || storageClass == spv::StorageClassOutput) { + switch (storageClass) { + case spv::StorageClassInput: + case spv::StorageClassOutput: addPre13Extension(spv::E_SPV_KHR_16bit_storage); builder.addCapability(spv::CapabilityStorageInputOutput16); - } else if (storageClass == spv::StorageClassPushConstant) { + break; + case spv::StorageClassPushConstant: addPre13Extension(spv::E_SPV_KHR_16bit_storage); builder.addCapability(spv::CapabilityStoragePushConstant16); - } else if (storageClass == spv::StorageClassUniform) { + break; + case spv::StorageClassUniform: addPre13Extension(spv::E_SPV_KHR_16bit_storage); - builder.addCapability(spv::CapabilityStorageUniform16); if (node->getType().getQualifier().storage == glslang::EvqBuffer) builder.addCapability(spv::CapabilityStorageUniformBufferBlock16); + else + builder.addCapability(spv::CapabilityStorageUniform16); + break; + case spv::StorageClassStorageBuffer: + addPre13Extension(spv::E_SPV_KHR_16bit_storage); + builder.addCapability(spv::CapabilityStorageUniformBufferBlock16); + break; + default: + break; + } + } + + const bool contains8BitType = node->getType().containsBasicType(glslang::EbtInt8) || + node->getType().containsBasicType(glslang::EbtUint8); + if (contains8BitType) { + if (storageClass == spv::StorageClassPushConstant) { + builder.addExtension(spv::E_SPV_KHR_8bit_storage); + builder.addCapability(spv::CapabilityStoragePushConstant8); + } else if (storageClass == spv::StorageClassUniform) { + builder.addExtension(spv::E_SPV_KHR_8bit_storage); + builder.addCapability(spv::CapabilityUniformAndStorageBuffer8BitAccess); + } else if (storageClass == spv::StorageClassStorageBuffer) { + builder.addExtension(spv::E_SPV_KHR_8bit_storage); + builder.addCapability(spv::CapabilityStorageBuffer8BitAccess); } } @@ -2576,11 +2912,6 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty spvType = builder.makeFloatType(64); break; case glslang::EbtFloat16: - builder.addCapability(spv::CapabilityFloat16); -#if AMD_EXTENSIONS - if (builder.getSpvVersion() < glslang::EShTargetSpv_1_3) - builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float); -#endif spvType = builder.makeFloatType(16); break; case glslang::EbtBool: @@ -2591,28 +2922,16 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty else spvType = builder.makeBoolType(); break; - case glslang::EbtInt8: - builder.addCapability(spv::CapabilityInt8); + case glslang::EbtInt8: spvType = builder.makeIntType(8); break; case glslang::EbtUint8: - builder.addCapability(spv::CapabilityInt8); spvType = builder.makeUintType(8); break; - case glslang::EbtInt16: - builder.addCapability(spv::CapabilityInt16); -#ifdef AMD_EXTENSIONS - if (builder.getSpvVersion() < glslang::EShTargetSpv_1_3) - builder.addExtension(spv::E_SPV_AMD_gpu_shader_int16); -#endif + case glslang::EbtInt16: spvType = builder.makeIntType(16); break; case glslang::EbtUint16: - builder.addCapability(spv::CapabilityInt16); -#ifdef AMD_EXTENSIONS - if (builder.getSpvVersion() < glslang::EShTargetSpv_1_3) - builder.addExtension(spv::E_SPV_AMD_gpu_shader_int16); -#endif spvType = builder.makeUintType(16); break; case glslang::EbtInt: @@ -2631,6 +2950,11 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty builder.addCapability(spv::CapabilityAtomicStorage); spvType = builder.makeUintType(32); break; +#ifdef NV_EXTENSIONS + case glslang::EbtAccStructNV: + spvType = builder.makeAccelerationStructureNVType(); + break; +#endif case glslang::EbtSampler: { const glslang::TSampler& sampler = type.getSampler(); @@ -2737,23 +3061,28 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty // bool TGlslangToSpvTraverser::filterMember(const glslang::TType& member) { +#ifdef NV_EXTENSIONS auto& extensions = glslangIntermediate->getRequestedExtensions(); - if (member.getFieldName() == "gl_ViewportMask" && - extensions.find("GL_NV_viewport_array2") == extensions.end()) - return true; if (member.getFieldName() == "gl_SecondaryViewportMaskNV" && extensions.find("GL_NV_stereo_view_rendering") == extensions.end()) return true; if (member.getFieldName() == "gl_SecondaryPositionNV" && extensions.find("GL_NV_stereo_view_rendering") == extensions.end()) return true; - if (member.getFieldName() == "gl_PositionPerViewNV" && - extensions.find("GL_NVX_multiview_per_view_attributes") == extensions.end()) - return true; - if (member.getFieldName() == "gl_ViewportMaskPerViewNV" && - extensions.find("GL_NVX_multiview_per_view_attributes") == extensions.end()) - return true; + + if (glslangIntermediate->getStage() != EShLangMeshNV) { + if (member.getFieldName() == "gl_ViewportMask" && + extensions.find("GL_NV_viewport_array2") == extensions.end()) + return true; + if (member.getFieldName() == "gl_PositionPerViewNV" && + extensions.find("GL_NVX_multiview_per_view_attributes") == extensions.end()) + return true; + if (member.getFieldName() == "gl_ViewportMaskPerViewNV" && + extensions.find("GL_NVX_multiview_per_view_attributes") == extensions.end()) + return true; + } +#endif return false; }; @@ -2846,6 +3175,9 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type, glslangIntermediate->getSource() == glslang::EShSourceHlsl) { builder.addMemberDecoration(spvType, member, TranslateInterpolationDecoration(memberQualifier)); builder.addMemberDecoration(spvType, member, TranslateAuxiliaryStorageDecoration(memberQualifier)); +#ifdef NV_EXTENSIONS + addMeshNVDecoration(spvType, member, memberQualifier); +#endif } } builder.addMemberDecoration(spvType, member, TranslateInvariantDecoration(memberQualifier)); @@ -2854,7 +3186,7 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type, qualifier.storage == glslang::EvqBuffer) { // Add memory decorations only to top-level members of shader storage block std::vector memory; - TranslateMemoryDecoration(memberQualifier, memory); + TranslateMemoryDecoration(memberQualifier, memory, glslangIntermediate->usingVulkanMemoryModel()); for (unsigned int i = 0; i < memory.size(); ++i) builder.addMemberDecoration(spvType, member, memory[i]); } @@ -2965,8 +3297,15 @@ spv::Id TGlslangToSpvTraverser::makeArraySizeId(const glslang::TArraySizes& arra spv::Id TGlslangToSpvTraverser::accessChainLoad(const glslang::TType& type) { spv::Id nominalTypeId = builder.accessChainGetInferredType(); + + spv::Builder::AccessChain::CoherentFlags coherentFlags = builder.getAccessChain().coherentFlags; + coherentFlags |= TranslateCoherent(type); + spv::Id loadedId = builder.accessChainLoad(TranslatePrecisionDecoration(type), - TranslateNonUniformDecoration(type.getQualifier()), nominalTypeId); + TranslateNonUniformDecoration(type.getQualifier()), + nominalTypeId, + spv::MemoryAccessMask(TranslateMemoryAccess(coherentFlags) & ~spv::MemoryAccessMakePointerAvailableKHRMask), + TranslateMemoryScope(coherentFlags)); // Need to convert to abstract types when necessary if (type.getBasicType() == glslang::EbtBool) { @@ -3022,7 +3361,12 @@ void TGlslangToSpvTraverser::accessChainStore(const glslang::TType& type, spv::I } } - builder.accessChainStore(rvalue); + spv::Builder::AccessChain::CoherentFlags coherentFlags = builder.getAccessChain().coherentFlags; + coherentFlags |= TranslateCoherent(type); + + builder.accessChainStore(rvalue, + spv::MemoryAccessMask(TranslateMemoryAccess(coherentFlags) & ~spv::MemoryAccessMakePointerVisibleKHRMask), + TranslateMemoryScope(coherentFlags)); } // For storing when types match at the glslang level, but not might match at the @@ -3068,7 +3412,7 @@ void TGlslangToSpvTraverser::multiTypeStore(const glslang::TType& type, spv::Id // set up the target storage builder.clearAccessChain(); builder.setAccessChainLValue(lValue); - builder.accessChainPush(builder.makeIntConstant(index)); + builder.accessChainPush(builder.makeIntConstant(index), TranslateCoherent(type)); // store the member multiTypeStore(glslangElementType, elementRValue); @@ -3088,7 +3432,7 @@ void TGlslangToSpvTraverser::multiTypeStore(const glslang::TType& type, spv::Id // set up the target storage builder.clearAccessChain(); builder.setAccessChainLValue(lValue); - builder.accessChainPush(builder.makeIntConstant(m)); + builder.accessChainPush(builder.makeIntConstant(m), TranslateCoherent(type)); // store the member multiTypeStore(glslangMemberType, memberRValue); @@ -3105,9 +3449,10 @@ glslang::TLayoutPacking TGlslangToSpvTraverser::getExplicitLayout(const glslang: if (type.getBasicType() != glslang::EbtBlock) return glslang::ElpNone; - // has to be a uniform or buffer block + // has to be a uniform or buffer block or task in/out blocks if (type.getQualifier().storage != glslang::EvqUniform && - type.getQualifier().storage != glslang::EvqBuffer) + type.getQualifier().storage != glslang::EvqBuffer && + !type.getQualifier().isTaskMemory()) return glslang::ElpNone; // return the layout to use @@ -3189,7 +3534,7 @@ void TGlslangToSpvTraverser::updateMemberOffset(const glslang::TType& structType // adjusting this late means inconsistencies with earlier code, which for reflection is an issue // Until reflection is brought in sync with these adjustments, don't apply to $Global, // which is the most likely to rely on reflection, and least likely to rely implicit layouts - if (glslangIntermediate->usingHlslOFfsets() && + if (glslangIntermediate->usingHlslOffsets() && ! memberType.isArray() && memberType.isVector() && structType.getTypeName().compare("$Global") != 0) { int dummySize; int componentAlignment = glslangIntermediate->getBaseAlignmentScalar(memberType, dummySize); @@ -3221,6 +3566,14 @@ void TGlslangToSpvTraverser::declareUseOfStructMember(const glslang::TTypeList& case glslang::EbvSecondaryViewportMaskNV: case glslang::EbvPositionPerViewNV: case glslang::EbvViewportMaskPerViewNV: + case glslang::EbvTaskCountNV: + case glslang::EbvPrimitiveCountNV: + case glslang::EbvPrimitiveIndicesNV: + case glslang::EbvClipDistancePerViewNV: + case glslang::EbvCullDistancePerViewNV: + case glslang::EbvLayerPerViewNV: + case glslang::EbvMeshViewCountNV: + case glslang::EbvMeshViewIndicesNV: #endif // Generate the associated capability. Delegate to TranslateBuiltInDecoration. // Alternately, we could just call this for any glslang built-in, since the @@ -3241,7 +3594,7 @@ bool TGlslangToSpvTraverser::isShaderEntryPoint(const glslang::TIntermAggregate* // Does parameter need a place to keep writes, separate from the original? // Assumes called after originalParam(), which filters out block/buffer/opaque-based // qualifiers such that we should have only in/out/inout/constreadonly here. -bool TGlslangToSpvTraverser::writableParam(glslang::TStorageQualifier qualifier) +bool TGlslangToSpvTraverser::writableParam(glslang::TStorageQualifier qualifier) const { assert(qualifier == glslang::EvqIn || qualifier == glslang::EvqOut || @@ -3265,11 +3618,11 @@ bool TGlslangToSpvTraverser::originalParam(glslang::TStorageQualifier qualifier, // Make all the functions, skeletally, without actually visiting their bodies. void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslFunctions) { - const auto getParamDecorations = [](std::vector& decorations, const glslang::TType& type) { + const auto getParamDecorations = [](std::vector& decorations, const glslang::TType& type, bool useVulkanMemoryModel) { spv::Decoration paramPrecision = TranslatePrecisionDecoration(type); if (paramPrecision != spv::NoPrecision) decorations.push_back(paramPrecision); - TranslateMemoryDecoration(type.getQualifier(), decorations); + TranslateMemoryDecoration(type.getQualifier(), decorations, useVulkanMemoryModel); }; for (int f = 0; f < (int)glslFunctions.size(); ++f) { @@ -3308,7 +3661,7 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF typeId = builder.makePointer(spv::StorageClassFunction, typeId); else rValueParameters.insert(parameters[p]->getAsSymbolNode()->getId()); - getParamDecorations(paramDecorations[p], paramType); + getParamDecorations(paramDecorations[p], paramType, glslangIntermediate->usingVulkanMemoryModel()); paramTypes.push_back(typeId); } @@ -3398,6 +3751,8 @@ void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& case glslang::EOpImageAtomicXor: case glslang::EOpImageAtomicExchange: case glslang::EOpImageAtomicCompSwap: + case glslang::EOpImageAtomicLoad: + case glslang::EOpImageAtomicStore: if (i == 0) lvalue = true; break; @@ -3498,6 +3853,25 @@ void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& if (i == 3) lvalue = true; break; +#endif +#ifdef NV_EXTENSIONS + case glslang::EOpImageSampleFootprintNV: + if (i == 4) + lvalue = true; + break; + case glslang::EOpImageSampleFootprintClampNV: + case glslang::EOpImageSampleFootprintLodNV: + if (i == 5) + lvalue = true; + break; + case glslang::EOpImageSampleFootprintGradNV: + if (i == 6) + lvalue = true; + break; + case glslang::EOpImageSampleFootprintGradClampNV: + if (i == 7) + lvalue = true; + break; #endif default: break; @@ -3525,8 +3899,10 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO builder.setLine(node->getLoc().line); // Process a GLSL texturing op (will be SPV image) - const glslang::TSampler sampler = node->getAsAggregate() ? node->getAsAggregate()->getSequence()[0]->getAsTyped()->getType().getSampler() - : node->getAsUnaryNode()->getOperand()->getAsTyped()->getType().getSampler(); + + const glslang::TType &imageType = node->getAsAggregate() ? node->getAsAggregate()->getSequence()[0]->getAsTyped()->getType() + : node->getAsUnaryNode()->getOperand()->getAsTyped()->getType(); + const glslang::TSampler sampler = imageType.getSampler(); #ifdef AMD_EXTENSIONS bool f16ShadowCompare = (sampler.shadow && node->getAsAggregate()) ? node->getAsAggregate()->getSequence()[1]->getAsTyped()->getType().getBasicType() == glslang::EbtFloat16 @@ -3594,9 +3970,10 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO // Check for image functions other than queries if (node->isImage()) { - std::vector operands; + std::vector operands; auto opIt = arguments.begin(); - operands.push_back(*(opIt++)); + spv::IdImmediate image = { true, *(opIt++) }; + operands.push_back(image); // Handle subpass operations // TODO: GLSL should change to have the "MS" only on the type rather than the @@ -3607,38 +3984,63 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO std::vector comps; comps.push_back(zero); comps.push_back(zero); - operands.push_back(builder.makeCompositeConstant(builder.makeVectorType(builder.makeIntType(32), 2), comps)); + spv::IdImmediate coord = { true, + builder.makeCompositeConstant(builder.makeVectorType(builder.makeIntType(32), 2), comps) }; + operands.push_back(coord); if (sampler.ms) { - operands.push_back(spv::ImageOperandsSampleMask); - operands.push_back(*(opIt++)); + spv::IdImmediate imageOperands = { false, spv::ImageOperandsSampleMask }; + operands.push_back(imageOperands); + spv::IdImmediate imageOperand = { true, *(opIt++) }; + operands.push_back(imageOperand); } spv::Id result = builder.createOp(spv::OpImageRead, resultType(), operands); builder.setPrecision(result, precision); return result; } - operands.push_back(*(opIt++)); + spv::IdImmediate coord = { true, *(opIt++) }; + operands.push_back(coord); #ifdef AMD_EXTENSIONS if (node->getOp() == glslang::EOpImageLoad || node->getOp() == glslang::EOpImageLoadLod) { #else if (node->getOp() == glslang::EOpImageLoad) { #endif + spv::ImageOperandsMask mask = spv::ImageOperandsMaskNone; if (sampler.ms) { - operands.push_back(spv::ImageOperandsSampleMask); - operands.push_back(*opIt); + mask = mask | spv::ImageOperandsSampleMask; + } #ifdef AMD_EXTENSIONS - } else if (cracked.lod) { + if (cracked.lod) { builder.addExtension(spv::E_SPV_AMD_shader_image_load_store_lod); builder.addCapability(spv::CapabilityImageReadWriteLodAMD); - - operands.push_back(spv::ImageOperandsLodMask); - operands.push_back(*opIt); + mask = mask | spv::ImageOperandsLodMask; + } #endif + mask = mask | TranslateImageOperands(TranslateCoherent(imageType)); + mask = (spv::ImageOperandsMask)(mask & ~spv::ImageOperandsMakeTexelAvailableKHRMask); + if (mask) { + spv::IdImmediate imageOperands = { false, (unsigned int)mask }; + operands.push_back(imageOperands); + } + if (mask & spv::ImageOperandsSampleMask) { + spv::IdImmediate imageOperand = { true, *opIt++ }; + operands.push_back(imageOperand); } - if (builder.getImageTypeFormat(builder.getImageType(operands.front())) == spv::ImageFormatUnknown) +#ifdef AMD_EXTENSIONS + if (mask & spv::ImageOperandsLodMask) { + spv::IdImmediate imageOperand = { true, *opIt++ }; + operands.push_back(imageOperand); + } +#endif + if (mask & spv::ImageOperandsMakeTexelVisibleKHRMask) { + spv::IdImmediate imageOperand = { true, builder.makeUintConstant(TranslateMemoryScope(TranslateCoherent(imageType))) }; + operands.push_back(imageOperand); + } + + if (builder.getImageTypeFormat(builder.getImageType(operands.front().word)) == spv::ImageFormatUnknown) builder.addCapability(spv::CapabilityStorageImageReadWithoutFormat); - std::vector result( 1, builder.createOp(spv::OpImageRead, resultType(), operands) ); + std::vector result(1, builder.createOp(spv::OpImageRead, resultType(), operands)); builder.setPrecision(result[0], precision); // If needed, add a conversion constructor to the proper size. @@ -3651,23 +4053,54 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO #else } else if (node->getOp() == glslang::EOpImageStore) { #endif + + // Push the texel value before the operands +#ifdef AMD_EXTENSIONS + if (sampler.ms || cracked.lod) { +#else if (sampler.ms) { - operands.push_back(*(opIt + 1)); - operands.push_back(spv::ImageOperandsSampleMask); - operands.push_back(*opIt); +#endif + spv::IdImmediate texel = { true, *(opIt + 1) }; + operands.push_back(texel); + } else { + spv::IdImmediate texel = { true, *opIt }; + operands.push_back(texel); + } + + spv::ImageOperandsMask mask = spv::ImageOperandsMaskNone; + if (sampler.ms) { + mask = mask | spv::ImageOperandsSampleMask; + } #ifdef AMD_EXTENSIONS - } else if (cracked.lod) { + if (cracked.lod) { builder.addExtension(spv::E_SPV_AMD_shader_image_load_store_lod); builder.addCapability(spv::CapabilityImageReadWriteLodAMD); - - operands.push_back(*(opIt + 1)); - operands.push_back(spv::ImageOperandsLodMask); - operands.push_back(*opIt); + mask = mask | spv::ImageOperandsLodMask; + } #endif - } else - operands.push_back(*opIt); + mask = mask | TranslateImageOperands(TranslateCoherent(imageType)); + mask = (spv::ImageOperandsMask)(mask & ~spv::ImageOperandsMakeTexelVisibleKHRMask); + if (mask) { + spv::IdImmediate imageOperands = { false, (unsigned int)mask }; + operands.push_back(imageOperands); + } + if (mask & spv::ImageOperandsSampleMask) { + spv::IdImmediate imageOperand = { true, *opIt++ }; + operands.push_back(imageOperand); + } +#ifdef AMD_EXTENSIONS + if (mask & spv::ImageOperandsLodMask) { + spv::IdImmediate imageOperand = { true, *opIt++ }; + operands.push_back(imageOperand); + } +#endif + if (mask & spv::ImageOperandsMakeTexelAvailableKHRMask) { + spv::IdImmediate imageOperand = { true, builder.makeUintConstant(TranslateMemoryScope(TranslateCoherent(imageType))) }; + operands.push_back(imageOperand); + } + builder.createNoResultOp(spv::OpImageWrite, operands); - if (builder.getImageTypeFormat(builder.getImageType(operands.front())) == spv::ImageFormatUnknown) + if (builder.getImageTypeFormat(builder.getImageType(operands.front().word)) == spv::ImageFormatUnknown) builder.addCapability(spv::CapabilityStorageImageWriteWithoutFormat); return spv::NoResult; #ifdef AMD_EXTENSIONS @@ -3676,20 +4109,40 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO } else if (node->getOp() == glslang::EOpSparseImageLoad) { #endif builder.addCapability(spv::CapabilitySparseResidency); - if (builder.getImageTypeFormat(builder.getImageType(operands.front())) == spv::ImageFormatUnknown) + if (builder.getImageTypeFormat(builder.getImageType(operands.front().word)) == spv::ImageFormatUnknown) builder.addCapability(spv::CapabilityStorageImageReadWithoutFormat); + spv::ImageOperandsMask mask = spv::ImageOperandsMaskNone; if (sampler.ms) { - operands.push_back(spv::ImageOperandsSampleMask); - operands.push_back(*opIt++); + mask = mask | spv::ImageOperandsSampleMask; + } #ifdef AMD_EXTENSIONS - } else if (cracked.lod) { + if (cracked.lod) { builder.addExtension(spv::E_SPV_AMD_shader_image_load_store_lod); builder.addCapability(spv::CapabilityImageReadWriteLodAMD); - operands.push_back(spv::ImageOperandsLodMask); - operands.push_back(*opIt++); + mask = mask | spv::ImageOperandsLodMask; + } +#endif + mask = mask | TranslateImageOperands(TranslateCoherent(imageType)); + mask = (spv::ImageOperandsMask)(mask & ~spv::ImageOperandsMakeTexelAvailableKHRMask); + if (mask) { + spv::IdImmediate imageOperands = { false, (unsigned int)mask }; + operands.push_back(imageOperands); + } + if (mask & spv::ImageOperandsSampleMask) { + spv::IdImmediate imageOperand = { true, *opIt++ }; + operands.push_back(imageOperand); + } +#ifdef AMD_EXTENSIONS + if (mask & spv::ImageOperandsLodMask) { + spv::IdImmediate imageOperand = { true, *opIt++ }; + operands.push_back(imageOperand); + } #endif + if (mask & spv::ImageOperandsMakeTexelVisibleKHRMask) { + spv::IdImmediate imageOperand = { true, builder.makeUintConstant(TranslateMemoryScope(TranslateCoherent(imageType))) }; + operands.push_back(imageOperand); } // Create the return type that was a special structure @@ -3708,9 +4161,18 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO // GLSL "IMAGE_PARAMS" will involve in constructing an image texel pointer and this pointer, // as the first source operand, is required by SPIR-V atomic operations. - operands.push_back(sampler.ms ? *(opIt++) : builder.makeUintConstant(0)); // For non-MS, the value should be 0 - - spv::Id resultTypeId = builder.makePointer(spv::StorageClassImage, resultType()); + // For non-MS, the sample value should be 0 + spv::IdImmediate sample = { true, sampler.ms ? *(opIt++) : builder.makeUintConstant(0) }; + operands.push_back(sample); + + spv::Id resultTypeId; + // imageAtomicStore has a void return type so base the pointer type on + // the type of the value operand. + if (node->getOp() == glslang::EOpImageAtomicStore) { + resultTypeId = builder.makePointer(spv::StorageClassImage, builder.getTypeId(operands[2].word)); + } else { + resultTypeId = builder.makePointer(spv::StorageClassImage, resultType()); + } spv::Id pointer = builder.createOp(spv::OpImageTexelPointer, resultTypeId, operands); std::vector operands; @@ -3763,6 +4225,10 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO // Check for texture functions other than queries bool sparse = node->isSparseTexture(); +#ifdef NV_EXTENSIONS + bool imageFootprint = node->isImageFootprint(); +#endif + bool cubeCompare = sampler.dim == glslang::EsdCube && sampler.arrayed && sampler.shadow; // check for bias argument @@ -3792,7 +4258,12 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO ++nonBiasArgCount; if (sparse) ++nonBiasArgCount; - +#ifdef NV_EXTENSIONS + if (imageFootprint) + //Following three extra arguments + // int granularity, bool coarse, out gl_TextureFootprint2DNV footprint + nonBiasArgCount += 3; +#endif if ((int)arguments.size() > nonBiasArgCount) bias = true; } @@ -3847,7 +4318,13 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO if (cracked.lod) { params.lod = arguments[2 + extraArgs]; ++extraArgs; - } else if (glslangIntermediate->getStage() != EShLangFragment) { + } else if (glslangIntermediate->getStage() != EShLangFragment +#ifdef NV_EXTENSIONS + // NV_compute_shader_derivatives layout qualifiers allow for implicit LODs + && !(glslangIntermediate->getStage() == EShLangCompute && + (glslangIntermediate->getLayoutDerivativeModeNone() != glslang::LayoutDerivativeNone)) +#endif + ) { // we need to invent the default lod for an explicit lod instruction for a non-fragment stage noImplicitLod = true; } @@ -3879,7 +4356,6 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO params.lodClamp = arguments[2 + extraArgs]; ++extraArgs; } - // sparse if (sparse) { params.texelOut = arguments[2 + extraArgs]; @@ -3895,13 +4371,81 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO } else params.component = builder.makeIntConstant(0); } - +#ifdef NV_EXTENSIONS + spv::Id resultStruct = spv::NoResult; + if (imageFootprint) { + //Following three extra arguments + // int granularity, bool coarse, out gl_TextureFootprint2DNV footprint + params.granularity = arguments[2 + extraArgs]; + params.coarse = arguments[3 + extraArgs]; + resultStruct = arguments[4 + extraArgs]; + extraArgs += 3; + } +#endif // bias if (bias) { params.bias = arguments[2 + extraArgs]; ++extraArgs; } +#ifdef NV_EXTENSIONS + if (imageFootprint) { + builder.addExtension(spv::E_SPV_NV_shader_image_footprint); + builder.addCapability(spv::CapabilityImageFootprintNV); + + + //resultStructType(OpenGL type) contains 5 elements: + //struct gl_TextureFootprint2DNV { + // uvec2 anchor; + // uvec2 offset; + // uvec2 mask; + // uint lod; + // uint granularity; + //}; + //or + //struct gl_TextureFootprint3DNV { + // uvec3 anchor; + // uvec3 offset; + // uvec2 mask; + // uint lod; + // uint granularity; + //}; + spv::Id resultStructType = builder.getContainedTypeId(builder.getTypeId(resultStruct)); + assert(builder.isStructType(resultStructType)); + + //resType (SPIR-V type) contains 6 elements: + //Member 0 must be a Boolean type scalar(LOD), + //Member 1 must be a vector of integer type, whose Signedness operand is 0(anchor), + //Member 2 must be a vector of integer type, whose Signedness operand is 0(offset), + //Member 3 must be a vector of integer type, whose Signedness operand is 0(mask), + //Member 4 must be a scalar of integer type, whose Signedness operand is 0(lod), + //Member 5 must be a scalar of integer type, whose Signedness operand is 0(granularity). + std::vector members; + members.push_back(resultType()); + for (int i = 0; i < 5; i++) { + members.push_back(builder.getContainedTypeId(resultStructType, i)); + } + spv::Id resType = builder.makeStructType(members, "ResType"); + + //call ImageFootprintNV + spv::Id res = builder.createTextureCall(precision, resType, sparse, cracked.fetch, cracked.proj, cracked.gather, noImplicitLod, params); + + //copy resType (SPIR-V type) to resultStructType(OpenGL type) + for (int i = 0; i < 5; i++) { + builder.clearAccessChain(); + builder.setAccessChainLValue(resultStruct); + + //Accessing to a struct we created, no coherent flag is set + spv::Builder::AccessChain::CoherentFlags flags; + flags.clear(); + + builder.accessChainPush(builder.makeIntConstant(i), flags); + builder.accessChainStore(builder.createCompositeExtract(res, builder.getContainedTypeId(resType, i+1), i+1)); + } + return builder.createCompositeExtract(res, resultType(), 0); + } +#endif + // projective component (might not to move) // GLSL: "The texture coordinates consumed from P, not including the last component of P, // are divided by the last component of P." @@ -3926,6 +4470,16 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO } } + // nonprivate + if (imageType.getQualifier().nonprivate) { + params.nonprivate = true; + } + + // volatile + if (imageType.getQualifier().volatil) { + params.volatil = true; + } + std::vector result( 1, builder.createTextureCall(precision, resultType(), sparse, cracked.fetch, cracked.proj, cracked.gather, noImplicitLod, params) ); @@ -3954,18 +4508,17 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg // 3. Make the call // 4. Copy back the results - // 1. Evaluate the arguments + // 1. Evaluate the arguments and their types std::vector lValues; std::vector rValues; std::vector argTypes; for (int a = 0; a < (int)glslangArgs.size(); ++a) { - const glslang::TType& paramType = glslangArgs[a]->getAsTyped()->getType(); + argTypes.push_back(&glslangArgs[a]->getAsTyped()->getType()); // build l-value builder.clearAccessChain(); glslangArgs[a]->traverse(this); - argTypes.push_back(¶mType); // keep outputs and pass-by-originals as l-values, evaluate others as r-values - if (originalParam(qualifiers[a], paramType, function->hasImplicitThis() && a == 0) || + if (originalParam(qualifiers[a], *argTypes[a], function->hasImplicitThis() && a == 0) || writableParam(qualifiers[a])) { // save l-value lValues.push_back(builder.getAccessChain()); @@ -3983,26 +4536,33 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg int rValueCount = 0; std::vector spvArgs; for (int a = 0; a < (int)glslangArgs.size(); ++a) { - const glslang::TType& paramType = glslangArgs[a]->getAsTyped()->getType(); spv::Id arg; - if (originalParam(qualifiers[a], paramType, function->hasImplicitThis() && a == 0)) { + if (originalParam(qualifiers[a], *argTypes[a], function->hasImplicitThis() && a == 0)) { builder.setAccessChain(lValues[lValueCount]); arg = builder.accessChainGetLValue(); ++lValueCount; } else if (writableParam(qualifiers[a])) { // need space to hold the copy - arg = builder.createVariable(spv::StorageClassFunction, convertGlslangToSpvType(paramType), "param"); + arg = builder.createVariable(spv::StorageClassFunction, builder.getContainedTypeId(function->getParamType(a)), "param"); if (qualifiers[a] == glslang::EvqIn || qualifiers[a] == glslang::EvqInOut) { // need to copy the input into output space builder.setAccessChain(lValues[lValueCount]); spv::Id copy = accessChainLoad(*argTypes[a]); builder.clearAccessChain(); builder.setAccessChainLValue(arg); - multiTypeStore(paramType, copy); + multiTypeStore(*argTypes[a], copy); } ++lValueCount; } else { - arg = rValues[rValueCount]; + // process r-value, which involves a copy for a type mismatch + if (function->getParamType(a) != convertGlslangToSpvType(*argTypes[a])) { + spv::Id argCopy = builder.createVariable(spv::StorageClassFunction, function->getParamType(a), "arg"); + builder.clearAccessChain(); + builder.setAccessChainLValue(argCopy); + multiTypeStore(*argTypes[a], rValues[rValueCount]); + arg = builder.createLoad(argCopy); + } else + arg = rValues[rValueCount]; ++rValueCount; } spvArgs.push_back(arg); @@ -4015,14 +4575,13 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg // 4. Copy back out an "out" arguments. lValueCount = 0; for (int a = 0; a < (int)glslangArgs.size(); ++a) { - const glslang::TType& paramType = glslangArgs[a]->getAsTyped()->getType(); - if (originalParam(qualifiers[a], paramType, function->hasImplicitThis() && a == 0)) + if (originalParam(qualifiers[a], *argTypes[a], function->hasImplicitThis() && a == 0)) ++lValueCount; else if (writableParam(qualifiers[a])) { if (qualifiers[a] == glslang::EvqOut || qualifiers[a] == glslang::EvqInOut) { spv::Id copy = builder.createLoad(spvArgs[a]); builder.setAccessChain(lValues[lValueCount]); - multiTypeStore(paramType, copy); + multiTypeStore(*argTypes[a], copy); } ++lValueCount; } @@ -4074,7 +4633,9 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, OpD assert(builder.isScalar(right)); needMatchingVectors = false; binOp = spv::OpVectorTimesScalar; - } else + } else if (isFloat) + binOp = spv::OpFMul; + else binOp = spv::OpIMul; break; case glslang::EOpVectorTimesMatrix: @@ -4589,31 +5150,28 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe unaryOp = spv::OpFwidth; break; case glslang::EOpDPdxFine: - builder.addCapability(spv::CapabilityDerivativeControl); unaryOp = spv::OpDPdxFine; break; case glslang::EOpDPdyFine: - builder.addCapability(spv::CapabilityDerivativeControl); unaryOp = spv::OpDPdyFine; break; case glslang::EOpFwidthFine: - builder.addCapability(spv::CapabilityDerivativeControl); unaryOp = spv::OpFwidthFine; break; case glslang::EOpDPdxCoarse: - builder.addCapability(spv::CapabilityDerivativeControl); unaryOp = spv::OpDPdxCoarse; break; case glslang::EOpDPdyCoarse: - builder.addCapability(spv::CapabilityDerivativeControl); unaryOp = spv::OpDPdyCoarse; break; case glslang::EOpFwidthCoarse: - builder.addCapability(spv::CapabilityDerivativeControl); unaryOp = spv::OpFwidthCoarse; break; case glslang::EOpInterpolateAtCentroid: - builder.addCapability(spv::CapabilityInterpolationFunction); +#ifdef AMD_EXTENSIONS + if (typeProxy == glslang::EbtFloat16) + builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float); +#endif libCall = spv::GLSLstd450InterpolateAtCentroid; break; case glslang::EOpAny: @@ -4749,8 +5307,6 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe #endif #ifdef NV_EXTENSIONS case glslang::EOpSubgroupPartition: - builder.addExtension(spv::E_SPV_NV_shader_subgroup_partitioned); - builder.addCapability(spv::CapabilityGroupNonUniformPartitionedNV); unaryOp = spv::OpGroupNonUniformPartitionNV; break; #endif @@ -4807,121 +5363,82 @@ spv::Id TGlslangToSpvTraverser::createUnaryMatrixOperation(spv::Op op, OpDecorat return result; } -spv::Id TGlslangToSpvTraverser::createConversionOperation(glslang::TOperator op, spv::Id operand, int vectorSize) +// For converting integers where both the bitwidth and the signedness could +// change, but only do the width change here. The caller is still responsible +// for the signedness conversion. +spv::Id TGlslangToSpvTraverser::createIntWidthConversion(glslang::TOperator op, spv::Id operand, int vectorSize) { - spv::Op convOp = spv::OpNop; - spv::Id type = 0; - - spv::Id result = 0; - + // Get the result type width, based on the type to convert to. + int width = 32; switch(op) { + case glslang::EOpConvInt16ToUint8: + case glslang::EOpConvIntToUint8: + case glslang::EOpConvInt64ToUint8: + case glslang::EOpConvUint16ToInt8: + case glslang::EOpConvUintToInt8: + case glslang::EOpConvUint64ToInt8: + width = 8; + break; case glslang::EOpConvInt8ToUint16: - convOp = spv::OpSConvert; - type = builder.makeIntType(16); + case glslang::EOpConvIntToUint16: + case glslang::EOpConvInt64ToUint16: + case glslang::EOpConvUint8ToInt16: + case glslang::EOpConvUintToInt16: + case glslang::EOpConvUint64ToInt16: + width = 16; break; case glslang::EOpConvInt8ToUint: - convOp = spv::OpSConvert; - type = builder.makeIntType(32); + case glslang::EOpConvInt16ToUint: + case glslang::EOpConvInt64ToUint: + case glslang::EOpConvUint8ToInt: + case glslang::EOpConvUint16ToInt: + case glslang::EOpConvUint64ToInt: + width = 32; break; case glslang::EOpConvInt8ToUint64: - convOp = spv::OpSConvert; - type = builder.makeIntType(64); + case glslang::EOpConvInt16ToUint64: + case glslang::EOpConvIntToUint64: + case glslang::EOpConvUint8ToInt64: + case glslang::EOpConvUint16ToInt64: + case glslang::EOpConvUintToInt64: + width = 64; break; - case glslang::EOpConvInt16ToUint8: - convOp = spv::OpSConvert; - type = builder.makeIntType(8); + + default: + assert(false && "Default missing"); break; + } + + // Get the conversion operation and result type, + // based on the target width, but the source type. + spv::Id type = spv::NoType; + spv::Op convOp = spv::OpNop; + switch(op) { + case glslang::EOpConvInt8ToUint16: + case glslang::EOpConvInt8ToUint: + case glslang::EOpConvInt8ToUint64: + case glslang::EOpConvInt16ToUint8: case glslang::EOpConvInt16ToUint: - convOp = spv::OpSConvert; - type = builder.makeIntType(32); - break; case glslang::EOpConvInt16ToUint64: - convOp = spv::OpSConvert; - type = builder.makeIntType(64); - break; case glslang::EOpConvIntToUint8: - convOp = spv::OpSConvert; - type = builder.makeIntType(8); - break; case glslang::EOpConvIntToUint16: - convOp = spv::OpSConvert; - type = builder.makeIntType(16); - break; case glslang::EOpConvIntToUint64: - convOp = spv::OpSConvert; - type = builder.makeIntType(64); - break; case glslang::EOpConvInt64ToUint8: - convOp = spv::OpSConvert; - type = builder.makeIntType(8); - break; case glslang::EOpConvInt64ToUint16: - convOp = spv::OpSConvert; - type = builder.makeIntType(16); - break; case glslang::EOpConvInt64ToUint: convOp = spv::OpSConvert; - type = builder.makeIntType(32); - break; - case glslang::EOpConvUint8ToInt16: - convOp = spv::OpUConvert; - type = builder.makeIntType(16); + type = builder.makeIntType(width); break; - case glslang::EOpConvUint8ToInt: - convOp = spv::OpUConvert; - type = builder.makeIntType(32); - break; - case glslang::EOpConvUint8ToInt64: - convOp = spv::OpUConvert; - type = builder.makeIntType(64); - break; - case glslang::EOpConvUint16ToInt8: - convOp = spv::OpUConvert; - type = builder.makeIntType(8); - break; - case glslang::EOpConvUint16ToInt: - convOp = spv::OpUConvert; - type = builder.makeIntType(32); - break; - case glslang::EOpConvUint16ToInt64: - convOp = spv::OpUConvert; - type = builder.makeIntType(64); - break; - case glslang::EOpConvUintToInt8: - convOp = spv::OpUConvert; - type = builder.makeIntType(8); - break; - case glslang::EOpConvUintToInt16: - convOp = spv::OpUConvert; - type = builder.makeIntType(16); - break; - case glslang::EOpConvUintToInt64: - convOp = spv::OpUConvert; - type = builder.makeIntType(64); - break; - case glslang::EOpConvUint64ToInt8: - convOp = spv::OpUConvert; - type = builder.makeIntType(8); - break; - case glslang::EOpConvUint64ToInt16: - convOp = spv::OpUConvert; - type = builder.makeIntType(16); - break; - case glslang::EOpConvUint64ToInt: - convOp = spv::OpUConvert; - type = builder.makeIntType(32); - break; - default: - assert(false && "Default missing"); + convOp = spv::OpUConvert; + type = builder.makeUintType(width); break; } if (vectorSize > 0) type = builder.makeVectorType(type, vectorSize); - result = builder.createUnaryOp(convOp, type, operand); - return result; + return builder.createUnaryOp(convOp, type, operand); } spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, OpDecorations& decorations, spv::Id destType, @@ -5196,7 +5713,7 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, OpDecora case glslang::EOpConvUint64ToInt16: case glslang::EOpConvUint64ToInt: // OpSConvert/OpUConvert + OpBitCast - operand = createConversionOperation(op, operand, vectorSize); + operand = createIntWidthConversion(op, operand, vectorSize); if (builder.isInSpecConstCodeGenMode()) { // Build zero scalar or vector for OpIAdd. @@ -5333,8 +5850,14 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv opCode = spv::OpAtomicIDecrement; break; case glslang::EOpAtomicCounter: + case glslang::EOpImageAtomicLoad: + case glslang::EOpAtomicLoad: opCode = spv::OpAtomicLoad; break; + case glslang::EOpAtomicStore: + case glslang::EOpImageAtomicStore: + opCode = spv::OpAtomicStore; + break; default: assert(0); break; @@ -5345,46 +5868,94 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv // Sort out the operands // - mapping from glslang -> SPV - // - there are extra SPV operands with no glslang source + // - there are extra SPV operands that are optional in glslang // - compare-exchange swaps the value and comparator // - compare-exchange has an extra memory semantics // - EOpAtomicCounterDecrement needs a post decrement + spv::Id pointerId = 0, compareId = 0, valueId = 0; + // scope defaults to Device in the old model, QueueFamilyKHR in the new model + spv::Id scopeId; + if (glslangIntermediate->usingVulkanMemoryModel()) { + scopeId = builder.makeUintConstant(spv::ScopeQueueFamilyKHR); + } else { + scopeId = builder.makeUintConstant(spv::ScopeDevice); + } + // semantics default to relaxed + spv::Id semanticsId = builder.makeUintConstant(spv::MemorySemanticsMaskNone); + spv::Id semanticsId2 = semanticsId; + + pointerId = operands[0]; + if (opCode == spv::OpAtomicIIncrement || opCode == spv::OpAtomicIDecrement) { + // no additional operands + } else if (opCode == spv::OpAtomicCompareExchange) { + compareId = operands[1]; + valueId = operands[2]; + if (operands.size() > 3) { + scopeId = operands[3]; + semanticsId = builder.makeUintConstant(builder.getConstantScalar(operands[4]) | builder.getConstantScalar(operands[5])); + semanticsId2 = builder.makeUintConstant(builder.getConstantScalar(operands[6]) | builder.getConstantScalar(operands[7])); + } + } else if (opCode == spv::OpAtomicLoad) { + if (operands.size() > 1) { + scopeId = operands[1]; + semanticsId = builder.makeUintConstant(builder.getConstantScalar(operands[2]) | builder.getConstantScalar(operands[3])); + } + } else { + // atomic store or RMW + valueId = operands[1]; + if (operands.size() > 2) { + scopeId = operands[2]; + semanticsId = builder.makeUintConstant(builder.getConstantScalar(operands[3]) | builder.getConstantScalar(operands[4])); + } + } + + // Check for capabilities + unsigned semanticsImmediate = builder.getConstantScalar(semanticsId) | builder.getConstantScalar(semanticsId2); + if (semanticsImmediate & (spv::MemorySemanticsMakeAvailableKHRMask | spv::MemorySemanticsMakeVisibleKHRMask | spv::MemorySemanticsOutputMemoryKHRMask)) { + builder.addCapability(spv::CapabilityVulkanMemoryModelKHR); + } + + if (glslangIntermediate->usingVulkanMemoryModel() && builder.getConstantScalar(scopeId) == spv::ScopeDevice) { + builder.addCapability(spv::CapabilityVulkanMemoryModelDeviceScopeKHR); + } + std::vector spvAtomicOperands; // hold the spv operands - auto opIt = operands.begin(); // walk the glslang operands - spvAtomicOperands.push_back(*(opIt++)); - spvAtomicOperands.push_back(builder.makeUintConstant(spv::ScopeDevice)); // TBD: what is the correct scope? - spvAtomicOperands.push_back(builder.makeUintConstant(spv::MemorySemanticsMaskNone)); // TBD: what are the correct memory semantics? + spvAtomicOperands.push_back(pointerId); + spvAtomicOperands.push_back(scopeId); + spvAtomicOperands.push_back(semanticsId); if (opCode == spv::OpAtomicCompareExchange) { - // There are 2 memory semantics for compare-exchange. And the operand order of "comparator" and "new value" in GLSL - // differs from that in SPIR-V. Hence, special processing is required. - spvAtomicOperands.push_back(builder.makeUintConstant(spv::MemorySemanticsMaskNone)); - spvAtomicOperands.push_back(*(opIt + 1)); - spvAtomicOperands.push_back(*opIt); - opIt += 2; + spvAtomicOperands.push_back(semanticsId2); + spvAtomicOperands.push_back(valueId); + spvAtomicOperands.push_back(compareId); + } else if (opCode != spv::OpAtomicLoad && opCode != spv::OpAtomicIIncrement && opCode != spv::OpAtomicIDecrement) { + spvAtomicOperands.push_back(valueId); } - // Add the rest of the operands, skipping any that were dealt with above. - for (; opIt != operands.end(); ++opIt) - spvAtomicOperands.push_back(*opIt); - - spv::Id resultId = builder.createOp(opCode, typeId, spvAtomicOperands); + if (opCode == spv::OpAtomicStore) { + builder.createNoResultOp(opCode, spvAtomicOperands); + return 0; + } else { + spv::Id resultId = builder.createOp(opCode, typeId, spvAtomicOperands); - // GLSL and HLSL atomic-counter decrement return post-decrement value, - // while SPIR-V returns pre-decrement value. Translate between these semantics. - if (op == glslang::EOpAtomicCounterDecrement) - resultId = builder.createBinOp(spv::OpISub, typeId, resultId, builder.makeIntConstant(1)); + // GLSL and HLSL atomic-counter decrement return post-decrement value, + // while SPIR-V returns pre-decrement value. Translate between these semantics. + if (op == glslang::EOpAtomicCounterDecrement) + resultId = builder.createBinOp(spv::OpISub, typeId, resultId, builder.makeIntConstant(1)); - return resultId; + return resultId; + } } // Create group invocation operations. spv::Id TGlslangToSpvTraverser::createInvocationsOperation(glslang::TOperator op, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy) { +#ifdef AMD_EXTENSIONS bool isUnsigned = isTypeUnsignedInt(typeProxy); bool isFloat = isTypeFloat(typeProxy); +#endif spv::Op opCode = spv::OpNop; - std::vector spvGroupOperands; + std::vector spvGroupOperands; spv::GroupOperation groupOperation = spv::GroupOperationMax; if (op == glslang::EOpBallot || op == glslang::EOpReadFirstInvocation || @@ -5411,7 +5982,6 @@ spv::Id TGlslangToSpvTraverser::createInvocationsOperation(glslang::TOperator op builder.addExtension(spv::E_SPV_AMD_shader_ballot); #endif - spvGroupOperands.push_back(builder.makeUintConstant(spv::ScopeSubgroup)); #ifdef AMD_EXTENSIONS switch (op) { case glslang::EOpMinInvocations: @@ -5421,7 +5991,6 @@ spv::Id TGlslangToSpvTraverser::createInvocationsOperation(glslang::TOperator op case glslang::EOpMaxInvocationsNonUniform: case glslang::EOpAddInvocationsNonUniform: groupOperation = spv::GroupOperationReduce; - spvGroupOperands.push_back(groupOperation); break; case glslang::EOpMinInvocationsInclusiveScan: case glslang::EOpMaxInvocationsInclusiveScan: @@ -5430,7 +5999,6 @@ spv::Id TGlslangToSpvTraverser::createInvocationsOperation(glslang::TOperator op case glslang::EOpMaxInvocationsInclusiveScanNonUniform: case glslang::EOpAddInvocationsInclusiveScanNonUniform: groupOperation = spv::GroupOperationInclusiveScan; - spvGroupOperands.push_back(groupOperation); break; case glslang::EOpMinInvocationsExclusiveScan: case glslang::EOpMaxInvocationsExclusiveScan: @@ -5439,16 +6007,23 @@ spv::Id TGlslangToSpvTraverser::createInvocationsOperation(glslang::TOperator op case glslang::EOpMaxInvocationsExclusiveScanNonUniform: case glslang::EOpAddInvocationsExclusiveScanNonUniform: groupOperation = spv::GroupOperationExclusiveScan; - spvGroupOperands.push_back(groupOperation); break; default: break; } + spv::IdImmediate scope = { true, builder.makeUintConstant(spv::ScopeSubgroup) }; + spvGroupOperands.push_back(scope); + if (groupOperation != spv::GroupOperationMax) { + spv::IdImmediate groupOp = { false, (unsigned)groupOperation }; + spvGroupOperands.push_back(groupOp); + } #endif } - for (auto opIt = operands.begin(); opIt != operands.end(); ++opIt) - spvGroupOperands.push_back(*opIt); + for (auto opIt = operands.begin(); opIt != operands.end(); ++opIt) { + spv::IdImmediate op = { true, *opIt }; + spvGroupOperands.push_back(op); + } switch (op) { case glslang::EOpAnyInvocation: @@ -5587,7 +6162,8 @@ spv::Id TGlslangToSpvTraverser::createInvocationsOperation(glslang::TOperator op } // Create group invocation operations on a vector -spv::Id TGlslangToSpvTraverser::CreateInvocationsVectorOperation(spv::Op op, spv::GroupOperation groupOperation, spv::Id typeId, std::vector& operands) +spv::Id TGlslangToSpvTraverser::CreateInvocationsVectorOperation(spv::Op op, spv::GroupOperation groupOperation, + spv::Id typeId, std::vector& operands) { #ifdef AMD_EXTENSIONS assert(op == spv::OpGroupFMin || op == spv::OpGroupUMin || op == spv::OpGroupSMin || @@ -5620,18 +6196,23 @@ spv::Id TGlslangToSpvTraverser::CreateInvocationsVectorOperation(spv::Op op, spv for (int comp = 0; comp < numComponents; ++comp) { std::vector indexes; indexes.push_back(comp); - spv::Id scalar = builder.createCompositeExtract(operands[0], scalarType, indexes); - std::vector spvGroupOperands; + spv::IdImmediate scalar = { true, builder.createCompositeExtract(operands[0], scalarType, indexes) }; + std::vector spvGroupOperands; if (op == spv::OpSubgroupReadInvocationKHR) { spvGroupOperands.push_back(scalar); - spvGroupOperands.push_back(operands[1]); + spv::IdImmediate operand = { true, operands[1] }; + spvGroupOperands.push_back(operand); } else if (op == spv::OpGroupBroadcast) { - spvGroupOperands.push_back(builder.makeUintConstant(spv::ScopeSubgroup)); + spv::IdImmediate scope = { true, builder.makeUintConstant(spv::ScopeSubgroup) }; + spvGroupOperands.push_back(scope); spvGroupOperands.push_back(scalar); - spvGroupOperands.push_back(operands[1]); + spv::IdImmediate operand = { true, operands[1] }; + spvGroupOperands.push_back(operand); } else { - spvGroupOperands.push_back(builder.makeUintConstant(spv::ScopeSubgroup)); - spvGroupOperands.push_back(groupOperation); + spv::IdImmediate scope = { true, builder.makeUintConstant(spv::ScopeSubgroup) }; + spvGroupOperands.push_back(scope); + spv::IdImmediate groupOp = { false, (unsigned)groupOperation }; + spvGroupOperands.push_back(groupOp); spvGroupOperands.push_back(scalar); } @@ -5643,7 +6224,8 @@ spv::Id TGlslangToSpvTraverser::CreateInvocationsVectorOperation(spv::Op op, spv } // Create subgroup invocation operations. -spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy) +spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, spv::Id typeId, + std::vector& operands, glslang::TBasicType typeProxy) { // Add the required capabilities. switch (op) { @@ -5891,14 +6473,11 @@ spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, s default: assert(0 && "Unhandled subgroup operation!"); } - std::vector spvGroupOperands; - - // Every operation begins with the Execution Scope operand. - spvGroupOperands.push_back(builder.makeUintConstant(spv::ScopeSubgroup)); - - // Next, for all operations that use a Group Operation, push that as an operand. + // get the right Group Operation + spv::GroupOperation groupOperation = spv::GroupOperationMax; switch (op) { - default: break; + default: + break; case glslang::EOpSubgroupBallotBitCount: case glslang::EOpSubgroupAdd: case glslang::EOpSubgroupMul: @@ -5907,7 +6486,7 @@ spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, s case glslang::EOpSubgroupAnd: case glslang::EOpSubgroupOr: case glslang::EOpSubgroupXor: - spvGroupOperands.push_back(spv::GroupOperationReduce); + groupOperation = spv::GroupOperationReduce; break; case glslang::EOpSubgroupBallotInclusiveBitCount: case glslang::EOpSubgroupInclusiveAdd: @@ -5917,7 +6496,7 @@ spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, s case glslang::EOpSubgroupInclusiveAnd: case glslang::EOpSubgroupInclusiveOr: case glslang::EOpSubgroupInclusiveXor: - spvGroupOperands.push_back(spv::GroupOperationInclusiveScan); + groupOperation = spv::GroupOperationInclusiveScan; break; case glslang::EOpSubgroupBallotExclusiveBitCount: case glslang::EOpSubgroupExclusiveAdd: @@ -5927,7 +6506,7 @@ spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, s case glslang::EOpSubgroupExclusiveAnd: case glslang::EOpSubgroupExclusiveOr: case glslang::EOpSubgroupExclusiveXor: - spvGroupOperands.push_back(spv::GroupOperationExclusiveScan); + groupOperation = spv::GroupOperationExclusiveScan; break; case glslang::EOpSubgroupClusteredAdd: case glslang::EOpSubgroupClusteredMul: @@ -5936,7 +6515,7 @@ spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, s case glslang::EOpSubgroupClusteredAnd: case glslang::EOpSubgroupClusteredOr: case glslang::EOpSubgroupClusteredXor: - spvGroupOperands.push_back(spv::GroupOperationClusteredReduce); + groupOperation = spv::GroupOperationClusteredReduce; break; #ifdef NV_EXTENSIONS case glslang::EOpSubgroupPartitionedAdd: @@ -5946,7 +6525,7 @@ spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, s case glslang::EOpSubgroupPartitionedAnd: case glslang::EOpSubgroupPartitionedOr: case glslang::EOpSubgroupPartitionedXor: - spvGroupOperands.push_back(spv::GroupOperationPartitionedReduceNV); + groupOperation = spv::GroupOperationPartitionedReduceNV; break; case glslang::EOpSubgroupPartitionedInclusiveAdd: case glslang::EOpSubgroupPartitionedInclusiveMul: @@ -5955,7 +6534,7 @@ spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, s case glslang::EOpSubgroupPartitionedInclusiveAnd: case glslang::EOpSubgroupPartitionedInclusiveOr: case glslang::EOpSubgroupPartitionedInclusiveXor: - spvGroupOperands.push_back(spv::GroupOperationPartitionedInclusiveScanNV); + groupOperation = spv::GroupOperationPartitionedInclusiveScanNV; break; case glslang::EOpSubgroupPartitionedExclusiveAdd: case glslang::EOpSubgroupPartitionedExclusiveMul: @@ -5964,22 +6543,41 @@ spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, s case glslang::EOpSubgroupPartitionedExclusiveAnd: case glslang::EOpSubgroupPartitionedExclusiveOr: case glslang::EOpSubgroupPartitionedExclusiveXor: - spvGroupOperands.push_back(spv::GroupOperationPartitionedExclusiveScanNV); + groupOperation = spv::GroupOperationPartitionedExclusiveScanNV; break; #endif } + // build the instruction + std::vector spvGroupOperands; + + // Every operation begins with the Execution Scope operand. + spv::IdImmediate executionScope = { true, builder.makeUintConstant(spv::ScopeSubgroup) }; + spvGroupOperands.push_back(executionScope); + + // Next, for all operations that use a Group Operation, push that as an operand. + if (groupOperation != spv::GroupOperationMax) { + spv::IdImmediate groupOperand = { false, (unsigned)groupOperation }; + spvGroupOperands.push_back(groupOperand); + } + // Push back the operands next. - for (auto opIt : operands) { - spvGroupOperands.push_back(opIt); + for (auto opIt = operands.cbegin(); opIt != operands.cend(); ++opIt) { + spv::IdImmediate operand = { true, *opIt }; + spvGroupOperands.push_back(operand); } // Some opcodes have additional operands. + spv::Id directionId = spv::NoResult; switch (op) { default: break; - case glslang::EOpSubgroupQuadSwapHorizontal: spvGroupOperands.push_back(builder.makeUintConstant(0)); break; - case glslang::EOpSubgroupQuadSwapVertical: spvGroupOperands.push_back(builder.makeUintConstant(1)); break; - case glslang::EOpSubgroupQuadSwapDiagonal: spvGroupOperands.push_back(builder.makeUintConstant(2)); break; + case glslang::EOpSubgroupQuadSwapHorizontal: directionId = builder.makeUintConstant(0); break; + case glslang::EOpSubgroupQuadSwapVertical: directionId = builder.makeUintConstant(1); break; + case glslang::EOpSubgroupQuadSwapDiagonal: directionId = builder.makeUintConstant(2); break; + } + if (directionId != spv::NoResult) { + spv::IdImmediate direction = { true, directionId }; + spvGroupOperands.push_back(direction); } return builder.createOp(opCode, typeId, spvGroupOperands); @@ -6080,11 +6678,17 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: libCall = spv::GLSLstd450Refract; break; case glslang::EOpInterpolateAtSample: - builder.addCapability(spv::CapabilityInterpolationFunction); +#ifdef AMD_EXTENSIONS + if (typeProxy == glslang::EbtFloat16) + builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float); +#endif libCall = spv::GLSLstd450InterpolateAtSample; break; case glslang::EOpInterpolateAtOffset: - builder.addCapability(spv::CapabilityInterpolationFunction); +#ifdef AMD_EXTENSIONS + if (typeProxy == glslang::EbtFloat16) + builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float); +#endif libCall = spv::GLSLstd450InterpolateAtOffset; break; case glslang::EOpAddCarry: @@ -6126,6 +6730,11 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: assert(builder.isPointerType(typeId1)); typeId1 = builder.getContainedTypeId(typeId1); int width = builder.getScalarTypeWidth(typeId1); +#ifdef AMD_EXTENSIONS + if (width == 16) + // Using 16-bit exp operand, enable extension SPV_AMD_gpu_shader_int16 + builder.addExtension(spv::E_SPV_AMD_gpu_shader_int16); +#endif if (builder.getNumComponents(operands[0]) == 1) frexpIntType = builder.makeIntegerType(width, true); else @@ -6229,11 +6838,71 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: break; case glslang::EOpInterpolateAtVertex: + if (typeProxy == glslang::EbtFloat16) + builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float); extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_explicit_vertex_parameter); libCall = spv::InterpolateAtVertexAMD; break; #endif + case glslang::EOpBarrier: + { + // This is for the extended controlBarrier function, with four operands. + // The unextended barrier() goes through createNoArgOperation. + assert(operands.size() == 4); + unsigned int executionScope = builder.getConstantScalar(operands[0]); + unsigned int memoryScope = builder.getConstantScalar(operands[1]); + unsigned int semantics = builder.getConstantScalar(operands[2]) | builder.getConstantScalar(operands[3]); + builder.createControlBarrier((spv::Scope)executionScope, (spv::Scope)memoryScope, (spv::MemorySemanticsMask)semantics); + if (semantics & (spv::MemorySemanticsMakeAvailableKHRMask | spv::MemorySemanticsMakeVisibleKHRMask | spv::MemorySemanticsOutputMemoryKHRMask)) { + builder.addCapability(spv::CapabilityVulkanMemoryModelKHR); + } + if (glslangIntermediate->usingVulkanMemoryModel() && (executionScope == spv::ScopeDevice || memoryScope == spv::ScopeDevice)) { + builder.addCapability(spv::CapabilityVulkanMemoryModelDeviceScopeKHR); + } + return 0; + } + break; + case glslang::EOpMemoryBarrier: + { + // This is for the extended memoryBarrier function, with three operands. + // The unextended memoryBarrier() goes through createNoArgOperation. + assert(operands.size() == 3); + unsigned int memoryScope = builder.getConstantScalar(operands[0]); + unsigned int semantics = builder.getConstantScalar(operands[1]) | builder.getConstantScalar(operands[2]); + builder.createMemoryBarrier((spv::Scope)memoryScope, (spv::MemorySemanticsMask)semantics); + if (semantics & (spv::MemorySemanticsMakeAvailableKHRMask | spv::MemorySemanticsMakeVisibleKHRMask | spv::MemorySemanticsOutputMemoryKHRMask)) { + builder.addCapability(spv::CapabilityVulkanMemoryModelKHR); + } + if (glslangIntermediate->usingVulkanMemoryModel() && memoryScope == spv::ScopeDevice) { + builder.addCapability(spv::CapabilityVulkanMemoryModelDeviceScopeKHR); + } + return 0; + } + break; +#ifdef NV_EXTENSIONS + case glslang::EOpReportIntersectionNV: + { + typeId = builder.makeBoolType(); + opCode = spv::OpReportIntersectionNV; + } + break; + case glslang::EOpTraceNV: + { + builder.createNoResultOp(spv::OpTraceNV, operands); + return 0; + } + break; + case glslang::EOpExecuteCallableNV: + { + builder.createNoResultOp(spv::OpExecuteCallableNV, operands); + return 0; + } + break; + case glslang::EOpWritePackedPrimitiveIndices4x8NV: + builder.createNoResultOp(spv::OpWritePackedPrimitiveIndices4x8NV, operands); + return 0; +#endif default: return 0; } @@ -6302,7 +6971,8 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: // Intrinsics with no arguments (or no return value, and no precision). spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId) { - // TODO: get the barrier operands correct + // GLSL memory barriers use queuefamily scope in new model, device scope in old model + spv::Scope memoryBarrierScope = glslangIntermediate->usingVulkanMemoryModel() ? spv::ScopeQueueFamilyKHR : spv::ScopeDevice; switch (op) { case glslang::EOpEmitVertex: @@ -6313,11 +6983,14 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv: return 0; case glslang::EOpBarrier: if (glslangIntermediate->getStage() == EShLangTessControl) { - builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeInvocation, spv::MemorySemanticsMaskNone); - // TODO: prefer the following, when available: - // builder.createControlBarrier(spv::ScopePatch, spv::ScopePatch, - // spv::MemorySemanticsPatchMask | - // spv::MemorySemanticsAcquireReleaseMask); + if (glslangIntermediate->usingVulkanMemoryModel()) { + builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeWorkgroup, + spv::MemorySemanticsOutputMemoryKHRMask | + spv::MemorySemanticsAcquireReleaseMask); + builder.addCapability(spv::CapabilityVulkanMemoryModelKHR); + } else { + builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeInvocation, spv::MemorySemanticsMaskNone); + } } else { builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeWorkgroup, spv::MemorySemanticsWorkgroupMemoryMask | @@ -6325,24 +6998,24 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv: } return 0; case glslang::EOpMemoryBarrier: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsAllMemory | - spv::MemorySemanticsAcquireReleaseMask); + builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsAllMemory | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpMemoryBarrierAtomicCounter: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsAtomicCounterMemoryMask | - spv::MemorySemanticsAcquireReleaseMask); + builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsAtomicCounterMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpMemoryBarrierBuffer: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsUniformMemoryMask | - spv::MemorySemanticsAcquireReleaseMask); + builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsUniformMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpMemoryBarrierImage: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsImageMemoryMask | - spv::MemorySemanticsAcquireReleaseMask); + builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsImageMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpMemoryBarrierShared: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsWorkgroupMemoryMask | - spv::MemorySemanticsAcquireReleaseMask); + builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsWorkgroupMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpGroupMemoryBarrier: builder.createMemoryBarrier(spv::ScopeWorkgroup, spv::MemorySemanticsAllMemory | @@ -6403,6 +7076,14 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv: spv::Id id = builder.createBuiltinCall(typeId, getExtBuiltins(spv::E_SPV_AMD_gcn_shader), spv::TimeAMD, args); return builder.setPrecision(id, precision); } +#endif +#ifdef NV_EXTENSIONS + case glslang::EOpIgnoreIntersectionNV: + builder.createNoResultOp(spv::OpIgnoreIntersectionNV); + return 0; + case glslang::EOpTerminateRayNV: + builder.createNoResultOp(spv::OpTerminateRayNV); + return 0; #endif default: logger->missingFunctionality("unknown operation with no arguments"); @@ -6427,6 +7108,9 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol builder.addDecoration(id, TranslatePrecisionDecoration(symbol->getType())); builder.addDecoration(id, TranslateInterpolationDecoration(symbol->getType().getQualifier())); builder.addDecoration(id, TranslateAuxiliaryStorageDecoration(symbol->getType().getQualifier())); +#ifdef NV_EXTENSIONS + addMeshNVDecoration(id, /*member*/ -1, symbol->getType().getQualifier()); +#endif if (symbol->getType().getQualifier().hasSpecConstantId()) builder.addDecoration(id, spv::DecorationSpecId, symbol->getType().getQualifier().layoutSpecConstantId); if (symbol->getQualifier().hasIndex()) @@ -6471,7 +7155,7 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol if (symbol->getType().isImage()) { std::vector memory; - TranslateMemoryDecoration(symbol->getType().getQualifier(), memory); + TranslateMemoryDecoration(symbol->getType().getQualifier(), memory, glslangIntermediate->usingVulkanMemoryModel()); for (unsigned int i = 0; i < memory.size(); ++i) builder.addDecoration(id, memory[i]); } @@ -6517,6 +7201,11 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol builder.addCapability(spv::CapabilityGeometryShaderPassthroughNV); builder.addExtension(spv::E_SPV_NV_geometry_shader_passthrough); } + if (symbol->getQualifier().pervertexNV) { + builder.addDecoration(id, spv::DecorationPerVertexNV); + builder.addCapability(spv::CapabilityFragmentBarycentricNV); + builder.addExtension(spv::E_SPV_NV_fragment_shader_barycentric); + } #endif if (glslangIntermediate->getHlslFunctionality1() && symbol->getType().getQualifier().semanticName != nullptr) { @@ -6528,6 +7217,42 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol return id; } +#ifdef NV_EXTENSIONS +// add per-primitive, per-view. per-task decorations to a struct member (member >= 0) or an object +void TGlslangToSpvTraverser::addMeshNVDecoration(spv::Id id, int member, const glslang::TQualifier& qualifier) +{ + if (member >= 0) { + if (qualifier.perPrimitiveNV) { + // Need to add capability/extension for fragment shader. + // Mesh shader already adds this by default. + if (glslangIntermediate->getStage() == EShLangFragment) { + builder.addCapability(spv::CapabilityMeshShadingNV); + builder.addExtension(spv::E_SPV_NV_mesh_shader); + } + builder.addMemberDecoration(id, (unsigned)member, spv::DecorationPerPrimitiveNV); + } + if (qualifier.perViewNV) + builder.addMemberDecoration(id, (unsigned)member, spv::DecorationPerViewNV); + if (qualifier.perTaskNV) + builder.addMemberDecoration(id, (unsigned)member, spv::DecorationPerTaskNV); + } else { + if (qualifier.perPrimitiveNV) { + // Need to add capability/extension for fragment shader. + // Mesh shader already adds this by default. + if (glslangIntermediate->getStage() == EShLangFragment) { + builder.addCapability(spv::CapabilityMeshShadingNV); + builder.addExtension(spv::E_SPV_NV_mesh_shader); + } + builder.addDecoration(id, spv::DecorationPerPrimitiveNV); + } + if (qualifier.perViewNV) + builder.addDecoration(id, spv::DecorationPerViewNV); + if (qualifier.perTaskNV) + builder.addDecoration(id, spv::DecorationPerTaskNV); + } +} +#endif + // Make a full tree of instructions to build a SPIR-V specialization constant, // or regular constant if possible. // @@ -6571,24 +7296,27 @@ spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TIntermTyped& n // An AST node labelled as specialization constant should be a symbol node. // Its initializer should either be a sub tree with constant nodes, or a constant union array. if (auto* sn = node.getAsSymbolNode()) { + spv::Id result; if (auto* sub_tree = sn->getConstSubtree()) { // Traverse the constant constructor sub tree like generating normal run-time instructions. // During the AST traversal, if the node is marked as 'specConstant', SpecConstantOpModeGuard // will set the builder into spec constant op instruction generating mode. sub_tree->traverse(this); - return accessChainLoad(sub_tree->getType()); - } else if (auto* const_union_array = &sn->getConstArray()){ + result = accessChainLoad(sub_tree->getType()); + } else if (auto* const_union_array = &sn->getConstArray()) { int nextConst = 0; - spv::Id id = createSpvConstantFromConstUnionArray(sn->getType(), *const_union_array, nextConst, true); - builder.addName(id, sn->getName().c_str()); - return id; + result = createSpvConstantFromConstUnionArray(sn->getType(), *const_union_array, nextConst, true); + } else { + logger->missingFunctionality("Invalid initializer for spec onstant."); + return spv::NoResult; } + builder.addName(result, sn->getName().c_str()); + return result; } // Neither a front-end constant node, nor a specialization constant node with constant union array or // constant sub tree as initializer. logger->missingFunctionality("Neither a front-end constant nor a spec constant."); - exit(1); return spv::NoResult; } @@ -6886,8 +7614,9 @@ int GetSpirvGeneratorVersion() // return 3; // change/correct barrier-instruction operands, to match memory model group decisions // return 4; // some deeper access chains: for dynamic vector component, and local Boolean component // return 5; // make OpArrayLength result type be an int with signedness of 0 - return 6; // revert version 5 change, which makes a different (new) kind of incorrect code, - // versions 4 and 6 each generate OpArrayLength as it has long been done + // return 6; // revert version 5 change, which makes a different (new) kind of incorrect code, + // versions 4 and 6 each generate OpArrayLength as it has long been done + return 7; // GLSL volatile keyword maps to both SPIR-V decorations Volatile and Coherent } // Write SPIR-V out to a binary file @@ -6912,7 +7641,7 @@ void OutputSpvHex(const std::vector& spirv, const char* baseName, if (out.fail()) printf("ERROR: Failed to open file: %s\n", baseName); out << "\t// " << - glslang::GetSpirvGeneratorVersion() << "." << GLSLANG_MINOR_VERSION << "." << GLSLANG_PATCH_LEVEL << + GetSpirvGeneratorVersion() << "." << GLSLANG_MINOR_VERSION << "." << GLSLANG_PATCH_LEVEL << std::endl; if (varName != nullptr) { out << "\t #pragma once" << std::endl; @@ -6939,13 +7668,13 @@ void OutputSpvHex(const std::vector& spirv, const char* baseName, // // Set up the glslang traversal // -void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, SpvOptions* options) +void GlslangToSpv(const TIntermediate& intermediate, std::vector& spirv, SpvOptions* options) { spv::SpvBuildLogger logger; GlslangToSpv(intermediate, spirv, &logger, options); } -void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, +void GlslangToSpv(const TIntermediate& intermediate, std::vector& spirv, spv::SpvBuildLogger* logger, SpvOptions* options) { TIntermNode* root = intermediate.getTreeRoot(); @@ -6953,11 +7682,11 @@ void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vectortraverse(&it); @@ -6967,53 +7696,18 @@ void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vectoroptimizeSize) && - !options->disableOptimizer) { - spv_target_env target_env = SPV_ENV_UNIVERSAL_1_2; - - spvtools::Optimizer optimizer(target_env); - optimizer.SetMessageConsumer([](spv_message_level_t level, - const char* source, - const spv_position_t& position, - const char* message) { - std::cerr << StringifyMessage(level, source, position, message) - << std::endl; - }); - - optimizer.RegisterPass(CreateMergeReturnPass()); - optimizer.RegisterPass(CreateInlineExhaustivePass()); - optimizer.RegisterPass(CreateEliminateDeadFunctionsPass()); - optimizer.RegisterPass(CreateScalarReplacementPass()); - optimizer.RegisterPass(CreateLocalAccessChainConvertPass()); - optimizer.RegisterPass(CreateLocalSingleBlockLoadStoreElimPass()); - optimizer.RegisterPass(CreateLocalSingleStoreElimPass()); - optimizer.RegisterPass(CreateAggressiveDCEPass()); - optimizer.RegisterPass(CreateInsertExtractElimPass()); - optimizer.RegisterPass(CreateDeadInsertElimPass()); - optimizer.RegisterPass(CreateAggressiveDCEPass()); - optimizer.RegisterPass(CreateCCPPass()); - optimizer.RegisterPass(CreateSimplificationPass()); - optimizer.RegisterPass(CreateDeadBranchElimPass()); - optimizer.RegisterPass(CreateCFGCleanupPass()); - optimizer.RegisterPass(CreateBlockMergePass()); - optimizer.RegisterPass(CreateLocalMultiStoreElimPass()); - optimizer.RegisterPass(CreateAggressiveDCEPass()); - optimizer.RegisterPass(CreateInsertExtractElimPass()); - optimizer.RegisterPass(CreateDeadInsertElimPass()); - if (options->optimizeSize) { - optimizer.RegisterPass(CreateRedundancyEliminationPass()); - // TODO(greg-lunarg): Add this when AMD driver issues are resolved - // optimizer.RegisterPass(CreateCommonUniformElimPass()); - } - optimizer.RegisterPass(CreateAggressiveDCEPass()); + if ((intermediate.getSource() == EShSourceHlsl || options->optimizeSize) && !options->disableOptimizer) + SpirvToolsLegalize(intermediate, spirv, logger, options); + + if (options->validate) + SpirvToolsValidate(intermediate, spirv, logger); + + if (options->disassemble) + SpirvToolsDisassemble(std::cout, spirv); - if (!optimizer.Run(spirv.data(), spirv.size(), &spirv)) - return; - } #endif - glslang::GetThreadPoolAllocator().pop(); + GetThreadPoolAllocator().pop(); } }; // end namespace glslang diff --git a/deps/glslang/SPIRV/GlslangToSpv.h b/deps/glslang/SPIRV/GlslangToSpv.h index f7f7cff6..4169c12e 100644 --- a/deps/glslang/SPIRV/GlslangToSpv.h +++ b/deps/glslang/SPIRV/GlslangToSpv.h @@ -38,6 +38,7 @@ #pragma warning(disable : 4464) // relative include path contains '..' #endif +#include "SpvTools.h" #include "../glslang/Include/intermediate.h" #include @@ -47,14 +48,6 @@ namespace glslang { -struct SpvOptions { - SpvOptions() : generateDebugInfo(false), disableOptimizer(true), - optimizeSize(false) { } - bool generateDebugInfo; - bool disableOptimizer; - bool optimizeSize; -}; - void GetSpirvVersion(std::string&); int GetSpirvGeneratorVersion(); void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, diff --git a/deps/glslang/SPIRV/SPVRemapper.cpp b/deps/glslang/SPIRV/SPVRemapper.cpp index 4bac1453..fd0bb895 100644 --- a/deps/glslang/SPIRV/SPVRemapper.cpp +++ b/deps/glslang/SPIRV/SPVRemapper.cpp @@ -220,11 +220,11 @@ namespace spv { bool spirvbin_t::isConstOp(spv::Op opCode) const { switch (opCode) { - case spv::OpConstantNull: case spv::OpConstantSampler: error("unimplemented constant type"); return true; + case spv::OpConstantNull: case spv::OpConstantTrue: case spv::OpConstantFalse: case spv::OpConstantComposite: @@ -1326,10 +1326,6 @@ namespace spv { case spv::OpTypeReserveId: return 300002; case spv::OpTypeQueue: return 300003; case spv::OpTypePipe: return 300004; - - case spv::OpConstantNull: return 300005; - case spv::OpConstantSampler: return 300006; - case spv::OpConstantTrue: return 300007; case spv::OpConstantFalse: return 300008; case spv::OpConstantComposite: @@ -1346,6 +1342,18 @@ namespace spv { hash += w * spv[typeStart+w]; return hash; } + case spv::OpConstantNull: + { + std::uint32_t hash = 500009 + hashType(idPos(spv[typeStart+1])); + return hash; + } + case spv::OpConstantSampler: + { + std::uint32_t hash = 600011 + hashType(idPos(spv[typeStart+1])); + for (unsigned w=3; w < wordCount; ++w) + hash += w * spv[typeStart+w]; + return hash; + } default: error("unknown type opcode"); diff --git a/deps/glslang/SPIRV/SpvBuilder.cpp b/deps/glslang/SPIRV/SpvBuilder.cpp index 27ce71ca..8755d9ea 100644 --- a/deps/glslang/SPIRV/SpvBuilder.cpp +++ b/deps/glslang/SPIRV/SpvBuilder.cpp @@ -81,6 +81,7 @@ Id Builder::import(const char* name) { Instruction* import = new Instruction(getUniqueId(), NoType, OpExtInstImport); import->addStringOperand(name); + module.mapInstruction(import); imports.push_back(std::unique_ptr(import)); return import->getResultId(); @@ -193,10 +194,8 @@ Id Builder::makeIntegerType(int width, bool hasSign) // deal with capabilities switch (width) { case 8: - addCapability(CapabilityInt8); - break; case 16: - addCapability(CapabilityInt16); + // these are currently handled by storage-type declarations and post processing break; case 64: addCapability(CapabilityInt64); @@ -228,7 +227,7 @@ Id Builder::makeFloatType(int width) // deal with capabilities switch (width) { case 16: - addCapability(CapabilityFloat16); + // currently handled by storage-type declarations and post processing break; case 64: addCapability(CapabilityFloat64); @@ -504,12 +503,27 @@ Id Builder::makeSampledImageType(Id imageType) return type->getResultId(); } +#ifdef NV_EXTENSIONS +Id Builder::makeAccelerationStructureNVType() +{ + Instruction *type; + if (groupedTypes[OpTypeAccelerationStructureNV].size() == 0) { + type = new Instruction(getUniqueId(), NoType, OpTypeAccelerationStructureNV); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + } else { + type = groupedTypes[OpTypeAccelerationStructureNV].back(); + } + + return type->getResultId(); +} +#endif Id Builder::getDerefTypeId(Id resultId) const { Id typeId = getTypeId(resultId); assert(isPointerType(typeId)); - return module.getInstruction(typeId)->getImmediateOperand(1); + return module.getInstruction(typeId)->getIdOperand(1); } Op Builder::getMostBasicTypeClass(Id typeId) const @@ -519,12 +533,6 @@ Op Builder::getMostBasicTypeClass(Id typeId) const Op typeClass = instr->getOpCode(); switch (typeClass) { - case OpTypeVoid: - case OpTypeBool: - case OpTypeInt: - case OpTypeFloat: - case OpTypeStruct: - return typeClass; case OpTypeVector: case OpTypeMatrix: case OpTypeArray: @@ -533,8 +541,7 @@ Op Builder::getMostBasicTypeClass(Id typeId) const case OpTypePointer: return getMostBasicTypeClass(instr->getIdOperand(1)); default: - assert(0); - return OpTypeFloat; + return typeClass; } } @@ -553,7 +560,7 @@ int Builder::getNumTypeConstituents(Id typeId) const return instr->getImmediateOperand(1); case OpTypeArray: { - Id lengthId = instr->getImmediateOperand(1); + Id lengthId = instr->getIdOperand(1); return module.getInstruction(lengthId)->getImmediateOperand(0); } case OpTypeStruct: @@ -621,6 +628,36 @@ Id Builder::getContainedTypeId(Id typeId) const return getContainedTypeId(typeId, 0); } +// Returns true if 'typeId' is or contains a scalar type declared with 'typeOp' +// of width 'width'. The 'width' is only consumed for int and float types. +// Returns false otherwise. +bool Builder::containsType(Id typeId, spv::Op typeOp, unsigned int width) const +{ + const Instruction& instr = *module.getInstruction(typeId); + + Op typeClass = instr.getOpCode(); + switch (typeClass) + { + case OpTypeInt: + case OpTypeFloat: + return typeClass == typeOp && instr.getImmediateOperand(0) == width; + case OpTypeStruct: + for (int m = 0; m < instr.getNumOperands(); ++m) { + if (containsType(instr.getIdOperand(m), typeOp, width)) + return true; + } + return false; + case OpTypeVector: + case OpTypeMatrix: + case OpTypeArray: + case OpTypeRuntimeArray: + case OpTypePointer: + return containsType(getContainedTypeId(typeId), typeOp, width); + default: + return typeClass == typeOp; + } +} + // See if a scalar constant of this type has already been created, so it // can be reused rather than duplicated. (Required by the specification). Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value) @@ -1194,19 +1231,35 @@ Id Builder::createUndefined(Id type) } // Comments in header -void Builder::createStore(Id rValue, Id lValue) +void Builder::createStore(Id rValue, Id lValue, spv::MemoryAccessMask memoryAccess, spv::Scope scope) { Instruction* store = new Instruction(OpStore); store->addIdOperand(lValue); store->addIdOperand(rValue); + + if (memoryAccess != MemoryAccessMaskNone) { + store->addImmediateOperand(memoryAccess); + if (memoryAccess & spv::MemoryAccessMakePointerAvailableKHRMask) { + store->addIdOperand(makeUintConstant(scope)); + } + } + buildPoint->addInstruction(std::unique_ptr(store)); } // Comments in header -Id Builder::createLoad(Id lValue) +Id Builder::createLoad(Id lValue, spv::MemoryAccessMask memoryAccess, spv::Scope scope) { Instruction* load = new Instruction(getUniqueId(), getDerefTypeId(lValue), OpLoad); load->addIdOperand(lValue); + + if (memoryAccess != MemoryAccessMaskNone) { + load->addImmediateOperand(memoryAccess); + if (memoryAccess & spv::MemoryAccessMakePointerVisibleKHRMask) { + load->addIdOperand(makeUintConstant(scope)); + } + } + buildPoint->addInstruction(std::unique_ptr(load)); return load->getResultId(); @@ -1331,7 +1384,7 @@ void Builder::createNoResultOp(Op opCode) buildPoint->addInstruction(std::unique_ptr(op)); } -// An opcode that has one operand, no result id, and no type +// An opcode that has one id operand, no result id, and no type void Builder::createNoResultOp(Op opCode, Id operand) { Instruction* op = new Instruction(opCode); @@ -1339,29 +1392,43 @@ void Builder::createNoResultOp(Op opCode, Id operand) buildPoint->addInstruction(std::unique_ptr(op)); } -// An opcode that has one operand, no result id, and no type +// An opcode that has one or more operands, no result id, and no type void Builder::createNoResultOp(Op opCode, const std::vector& operands) { Instruction* op = new Instruction(opCode); - for (auto it = operands.cbegin(); it != operands.cend(); ++it) + for (auto it = operands.cbegin(); it != operands.cend(); ++it) { op->addIdOperand(*it); + } + buildPoint->addInstruction(std::unique_ptr(op)); +} + +// An opcode that has multiple operands, no result id, and no type +void Builder::createNoResultOp(Op opCode, const std::vector& operands) +{ + Instruction* op = new Instruction(opCode); + for (auto it = operands.cbegin(); it != operands.cend(); ++it) { + if (it->isId) + op->addIdOperand(it->word); + else + op->addImmediateOperand(it->word); + } buildPoint->addInstruction(std::unique_ptr(op)); } void Builder::createControlBarrier(Scope execution, Scope memory, MemorySemanticsMask semantics) { Instruction* op = new Instruction(OpControlBarrier); - op->addImmediateOperand(makeUintConstant(execution)); - op->addImmediateOperand(makeUintConstant(memory)); - op->addImmediateOperand(makeUintConstant(semantics)); + op->addIdOperand(makeUintConstant(execution)); + op->addIdOperand(makeUintConstant(memory)); + op->addIdOperand(makeUintConstant(semantics)); buildPoint->addInstruction(std::unique_ptr(op)); } void Builder::createMemoryBarrier(unsigned executionScope, unsigned memorySemantics) { Instruction* op = new Instruction(OpMemoryBarrier); - op->addImmediateOperand(makeUintConstant(executionScope)); - op->addImmediateOperand(makeUintConstant(memorySemantics)); + op->addIdOperand(makeUintConstant(executionScope)); + op->addIdOperand(makeUintConstant(memorySemantics)); buildPoint->addInstruction(std::unique_ptr(op)); } @@ -1428,6 +1495,20 @@ Id Builder::createOp(Op opCode, Id typeId, const std::vector& operands) return op->getResultId(); } +Id Builder::createOp(Op opCode, Id typeId, const std::vector& operands) +{ + Instruction* op = new Instruction(getUniqueId(), typeId, opCode); + for (auto it = operands.cbegin(); it != operands.cend(); ++it) { + if (it->isId) + op->addIdOperand(it->word); + else + op->addImmediateOperand(it->word); + } + buildPoint->addInstruction(std::unique_ptr(op)); + + return op->getResultId(); +} + Id Builder::createSpecConstantOp(Op opCode, Id typeId, const std::vector& operands, const std::vector& literals) { Instruction* op = new Instruction(getUniqueId(), typeId, OpSpecConstantOp); @@ -1570,7 +1651,8 @@ Id Builder::createBuiltinCall(Id resultType, Id builtins, int entryPoint, const // Accept all parameters needed to create a texture instruction. // Create the correct instruction based on the inputs, and make the call. -Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse, bool fetch, bool proj, bool gather, bool noImplicitLod, const TextureParameters& parameters) +Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse, bool fetch, bool proj, bool gather, + bool noImplicitLod, const TextureParameters& parameters) { static const int maxTextureArgs = 10; Id texArgs[maxTextureArgs] = {}; @@ -1587,6 +1669,13 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse, if (parameters.component != NoResult) texArgs[numArgs++] = parameters.component; +#ifdef NV_EXTENSIONS + if (parameters.granularity != NoResult) + texArgs[numArgs++] = parameters.granularity; + if (parameters.coarse != NoResult) + texArgs[numArgs++] = parameters.coarse; +#endif + // // Set up the optional arguments // @@ -1623,6 +1712,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse, texArgs[numArgs++] = parameters.offset; } if (parameters.offsets) { + addCapability(CapabilityImageGatherExtended); mask = (ImageOperandsMask)(mask | ImageOperandsConstOffsetsMask); texArgs[numArgs++] = parameters.offsets; } @@ -1637,6 +1727,12 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse, mask = (ImageOperandsMask)(mask | ImageOperandsMinLodMask); texArgs[numArgs++] = parameters.lodClamp; } + if (parameters.nonprivate) { + mask = mask | ImageOperandsNonPrivateTexelKHRMask; + } + if (parameters.volatil) { + mask = mask | ImageOperandsVolatileTexelKHRMask; + } if (mask == ImageOperandsMaskNone) --numArgs; // undo speculative reservation for the mask argument else @@ -1651,6 +1747,10 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse, opCode = OpImageSparseFetch; else opCode = OpImageFetch; +#ifdef NV_EXTENSIONS + } else if (parameters.granularity && parameters.coarse) { + opCode = OpImageSampleFootprintNV; +#endif } else if (gather) { if (parameters.Dref) if (sparse) @@ -1772,9 +1872,6 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse, // Comments in header Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameters, bool isUnsignedResult) { - // All these need a capability - addCapability(CapabilityImageQuery); - // Figure out the result type Id resultType = 0; switch (opCode) { @@ -2027,9 +2124,39 @@ Id Builder::createMatrixConstructor(Decoration precision, const std::vector& int numRows = getTypeNumRows(resultTypeId); Instruction* instr = module.getInstruction(componentTypeId); - Id bitCount = instr->getIdOperand(0); + unsigned bitCount = instr->getImmediateOperand(0); + + // Optimize matrix constructed from a bigger matrix + if (isMatrix(sources[0]) && getNumColumns(sources[0]) >= numCols && getNumRows(sources[0]) >= numRows) { + // To truncate the matrix to a smaller number of rows/columns, we need to: + // 1. For each column, extract the column and truncate it to the required size using shuffle + // 2. Assemble the resulting matrix from all columns + Id matrix = sources[0]; + Id columnTypeId = getContainedTypeId(resultTypeId); + Id sourceColumnTypeId = getContainedTypeId(getTypeId(matrix)); + + std::vector channels; + for (int row = 0; row < numRows; ++row) + channels.push_back(row); - // Will use a two step process + std::vector matrixColumns; + for (int col = 0; col < numCols; ++col) { + std::vector indexes; + indexes.push_back(col); + Id colv = createCompositeExtract(matrix, sourceColumnTypeId, indexes); + setPrecision(colv, precision); + + if (numRows != getNumRows(matrix)) { + matrixColumns.push_back(createRvalueSwizzle(precision, columnTypeId, colv, channels)); + } else { + matrixColumns.push_back(colv); + } + } + + return setPrecision(createCompositeConstruct(resultTypeId, matrixColumns), precision); + } + + // Otherwise, will use a two step process // 1. make a compile-time 2D array of values // 2. construct a matrix from that array @@ -2283,6 +2410,7 @@ void Builder::clearAccessChain() accessChain.component = NoResult; accessChain.preSwizzleBaseType = NoType; accessChain.isRValue = false; + accessChain.coherentFlags.clear(); } // Comments in header @@ -2309,7 +2437,7 @@ void Builder::accessChainPushSwizzle(std::vector& swizzle, Id preSwizz } // Comments in header -void Builder::accessChainStore(Id rvalue) +void Builder::accessChainStore(Id rvalue, spv::MemoryAccessMask memoryAccess, spv::Scope scope) { assert(accessChain.isRValue == false); @@ -2327,11 +2455,11 @@ void Builder::accessChainStore(Id rvalue) source = createLvalueSwizzle(getTypeId(tempBaseId), tempBaseId, source, accessChain.swizzle); } - createStore(source, base); + createStore(source, base, memoryAccess, scope); } // Comments in header -Id Builder::accessChainLoad(Decoration precision, Decoration nonUniform, Id resultType) +Id Builder::accessChainLoad(Decoration precision, Decoration nonUniform, Id resultType, spv::MemoryAccessMask memoryAccess, spv::Scope scope) { Id id; @@ -2375,7 +2503,7 @@ Id Builder::accessChainLoad(Decoration precision, Decoration nonUniform, Id resu } else { transferAccessChainSwizzle(true); // load through the access chain - id = createLoad(collapseAccessChain()); + id = createLoad(collapseAccessChain(), memoryAccess, scope); setPrecision(id, precision); addDecoration(id, nonUniform); } @@ -2451,42 +2579,6 @@ Id Builder::accessChainGetInferredType() return type; } -// comment in header -void Builder::eliminateDeadDecorations() { - std::unordered_set reachable_blocks; - std::unordered_set unreachable_definitions; - // Collect IDs defined in unreachable blocks. For each function, label the - // reachable blocks first. Then for each unreachable block, collect the - // result IDs of the instructions in it. - for (std::vector::const_iterator fi = module.getFunctions().cbegin(); - fi != module.getFunctions().cend(); fi++) { - Function* f = *fi; - Block* entry = f->getEntryBlock(); - inReadableOrder(entry, [&reachable_blocks](const Block* b) { - reachable_blocks.insert(b); - }); - for (std::vector::const_iterator bi = f->getBlocks().cbegin(); - bi != f->getBlocks().cend(); bi++) { - Block* b = *bi; - if (!reachable_blocks.count(b)) { - for (std::vector >::const_iterator - ii = b->getInstructions().cbegin(); - ii != b->getInstructions().cend(); ii++) { - Instruction* i = ii->get(); - unreachable_definitions.insert(i->getResultId()); - } - } - } - } - decorations.erase(std::remove_if(decorations.begin(), decorations.end(), - [&unreachable_definitions](std::unique_ptr& I) -> bool { - Instruction* inst = I.get(); - Id decoration_id = inst->getIdOperand(0); - return unreachable_definitions.count(decoration_id) != 0; - }), - decorations.end()); -} - void Builder::dump(std::vector& out) const { // Header, before first instructions: diff --git a/deps/glslang/SPIRV/SpvBuilder.h b/deps/glslang/SPIRV/SpvBuilder.h index 099b1d95..7c1d421b 100644 --- a/deps/glslang/SPIRV/SpvBuilder.h +++ b/deps/glslang/SPIRV/SpvBuilder.h @@ -131,6 +131,9 @@ class Builder { Id makeSamplerType(); Id makeSampledImageType(Id imageType); + // accelerationStructureNV type + Id makeAccelerationStructureNVType(); + // For querying about types. Id getTypeId(Id resultId) const { return module.getTypeId(resultId); } Id getDerefTypeId(Id resultId) const; @@ -167,6 +170,7 @@ class Builder { bool isImageType(Id typeId) const { return getTypeClass(typeId) == OpTypeImage; } bool isSamplerType(Id typeId) const { return getTypeClass(typeId) == OpTypeSampler; } bool isSampledImageType(Id typeId) const { return getTypeClass(typeId) == OpTypeSampledImage; } + bool containsType(Id typeId, Op typeOp, unsigned int width) const; bool isConstantOpCode(Op opcode) const; bool isSpecConstantOpCode(Op opcode) const; @@ -273,10 +277,10 @@ class Builder { Id createUndefined(Id type); // Store into an Id and return the l-value - void createStore(Id rValue, Id lValue); + void createStore(Id rValue, Id lValue, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, spv::Scope scope = spv::ScopeMax); // Load from an Id and return it - Id createLoad(Id lValue); + Id createLoad(Id lValue, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, spv::Scope scope = spv::ScopeMax); // Create an OpAccessChain instruction Id createAccessChain(StorageClass, Id base, const std::vector& offsets); @@ -296,12 +300,14 @@ class Builder { void createNoResultOp(Op); void createNoResultOp(Op, Id operand); void createNoResultOp(Op, const std::vector& operands); + void createNoResultOp(Op, const std::vector& operands); void createControlBarrier(Scope execution, Scope memory, MemorySemanticsMask); void createMemoryBarrier(unsigned executionScope, unsigned memorySemantics); Id createUnaryOp(Op, Id typeId, Id operand); Id createBinOp(Op, Id typeId, Id operand1, Id operand2); Id createTriOp(Op, Id typeId, Id operand1, Id operand2, Id operand3); Id createOp(Op, Id typeId, const std::vector& operands); + Id createOp(Op, Id typeId, const std::vector& operands); Id createFunctionCall(spv::Function*, const std::vector&); Id createSpecConstantOp(Op, Id typeId, const std::vector& operands, const std::vector& literals); @@ -363,6 +369,10 @@ class Builder { Id component; Id texelOut; Id lodClamp; + Id granularity; + Id coarse; + bool nonprivate; + bool volatil; }; // Select the correct texture operation based on all inputs, and emit the correct instruction @@ -502,6 +512,43 @@ class Builder { Id component; // a dynamic component index, can coexist with a swizzle, done after the swizzle, NoResult if not present Id preSwizzleBaseType; // dereferenced type, before swizzle or component is applied; NoType unless a swizzle or component is present bool isRValue; // true if 'base' is an r-value, otherwise, base is an l-value + + // Accumulate whether anything in the chain of structures has coherent decorations. + struct CoherentFlags { + unsigned coherent : 1; + unsigned devicecoherent : 1; + unsigned queuefamilycoherent : 1; + unsigned workgroupcoherent : 1; + unsigned subgroupcoherent : 1; + unsigned nonprivate : 1; + unsigned volatil : 1; + unsigned isImage : 1; + + void clear() { + coherent = 0; + devicecoherent = 0; + queuefamilycoherent = 0; + workgroupcoherent = 0; + subgroupcoherent = 0; + nonprivate = 0; + volatil = 0; + isImage = 0; + } + + CoherentFlags() { clear(); } + CoherentFlags operator |=(const CoherentFlags &other) { + coherent |= other.coherent; + devicecoherent |= other.devicecoherent; + queuefamilycoherent |= other.queuefamilycoherent; + workgroupcoherent |= other.workgroupcoherent; + subgroupcoherent |= other.subgroupcoherent; + nonprivate |= other.nonprivate; + volatil |= other.volatil; + isImage |= other.isImage; + return *this; + } + }; + CoherentFlags coherentFlags; }; // @@ -531,9 +578,10 @@ class Builder { } // push offset onto the end of the chain - void accessChainPush(Id offset) + void accessChainPush(Id offset, AccessChain::CoherentFlags coherentFlags) { accessChain.indexChain.push_back(offset); + accessChain.coherentFlags |= coherentFlags; } // push new swizzle onto the end of any existing swizzle, merging into a single swizzle @@ -551,10 +599,10 @@ class Builder { } // use accessChain and swizzle to store value - void accessChainStore(Id rvalue); + void accessChainStore(Id rvalue, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, spv::Scope scope = spv::ScopeMax); // use accessChain and swizzle to load an r-value - Id accessChainLoad(Decoration precision, Decoration nonUniform, Id ResultType); + Id accessChainLoad(Decoration precision, Decoration nonUniform, Id ResultType, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, spv::Scope scope = spv::ScopeMax); // get the direct pointer for an l-value Id accessChainGetLValue(); @@ -563,9 +611,17 @@ class Builder { // based on the type of the base and the chain of dereferences. Id accessChainGetInferredType(); - // Remove OpDecorate instructions whose operands are defined in unreachable - // blocks. - void eliminateDeadDecorations(); + // Add capabilities, extensions, remove unneeded decorations, etc., + // based on the resulting SPIR-V. + void postProcess(); + + // Hook to visit each instruction in a block in a function + void postProcess(const Instruction&); + // Hook to visit each instruction in a reachable block in a function. + void postProcessReachable(const Instruction&); + // Hook to visit each non-32-bit sized float/int operation in a block. + void postProcessType(const Instruction&, spv::Id typeId); + void dump(std::vector&) const; void createBranch(Block* block); diff --git a/deps/glslang/SPIRV/SpvPostProcess.cpp b/deps/glslang/SPIRV/SpvPostProcess.cpp new file mode 100644 index 00000000..5eaedaf6 --- /dev/null +++ b/deps/glslang/SPIRV/SpvPostProcess.cpp @@ -0,0 +1,265 @@ +// +// Copyright (C) 2016-2018 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +// +// Post-processing for SPIR-V IR, in internal form, not standard binary form. +// + +#include +#include + +#include +#include + +#include "SpvBuilder.h" + +#include "spirv.hpp" +#include "GlslangToSpv.h" +#include "SpvBuilder.h" +namespace spv { + #include "GLSL.std.450.h" + #include "GLSL.ext.KHR.h" + #include "GLSL.ext.EXT.h" +#ifdef AMD_EXTENSIONS + #include "GLSL.ext.AMD.h" +#endif +#ifdef NV_EXTENSIONS + #include "GLSL.ext.NV.h" +#endif +} + +namespace spv { + +// Hook to visit each operand type and result type of an instruction. +// Will be called multiple times for one instruction, once for each typed +// operand and the result. +void Builder::postProcessType(const Instruction& inst, Id typeId) +{ + // Characterize the type being questioned + Id basicTypeOp = getMostBasicTypeClass(typeId); + int width = 0; + if (basicTypeOp == OpTypeFloat || basicTypeOp == OpTypeInt) + width = getScalarTypeWidth(typeId); + + // Do opcode-specific checks + switch (inst.getOpCode()) { + case OpLoad: + case OpStore: + if (basicTypeOp == OpTypeStruct) { + if (containsType(typeId, OpTypeInt, 8)) + addCapability(CapabilityInt8); + if (containsType(typeId, OpTypeInt, 16)) + addCapability(CapabilityInt16); + if (containsType(typeId, OpTypeFloat, 16)) + addCapability(CapabilityFloat16); + } else { + StorageClass storageClass = getStorageClass(inst.getIdOperand(0)); + if (width == 8) { + switch (storageClass) { + case StorageClassUniform: + case StorageClassStorageBuffer: + case StorageClassPushConstant: + break; + default: + addCapability(CapabilityInt8); + break; + } + } else if (width == 16) { + switch (storageClass) { + case StorageClassUniform: + case StorageClassStorageBuffer: + case StorageClassPushConstant: + case StorageClassInput: + case StorageClassOutput: + break; + default: + if (basicTypeOp == OpTypeInt) + addCapability(CapabilityInt16); + if (basicTypeOp == OpTypeFloat) + addCapability(CapabilityFloat16); + break; + } + } + } + break; + case OpAccessChain: + case OpPtrAccessChain: + case OpCopyObject: + case OpFConvert: + case OpSConvert: + case OpUConvert: + break; + case OpExtInst: +#if AMD_EXTENSIONS + switch (inst.getImmediateOperand(1)) { + case GLSLstd450Frexp: + case GLSLstd450FrexpStruct: + if (getSpvVersion() < glslang::EShTargetSpv_1_3 && containsType(typeId, OpTypeInt, 16)) + addExtension(spv::E_SPV_AMD_gpu_shader_int16); + break; + case GLSLstd450InterpolateAtCentroid: + case GLSLstd450InterpolateAtSample: + case GLSLstd450InterpolateAtOffset: + if (getSpvVersion() < glslang::EShTargetSpv_1_3 && containsType(typeId, OpTypeFloat, 16)) + addExtension(spv::E_SPV_AMD_gpu_shader_half_float); + break; + default: + break; + } +#endif + break; + default: + if (basicTypeOp == OpTypeFloat && width == 16) + addCapability(CapabilityFloat16); + if (basicTypeOp == OpTypeInt && width == 16) + addCapability(CapabilityInt16); + if (basicTypeOp == OpTypeInt && width == 8) + addCapability(CapabilityInt8); + break; + } +} + +// Called for each instruction that resides in a block. +void Builder::postProcess(const Instruction& inst) +{ + // Add capabilities based simply on the opcode. + switch (inst.getOpCode()) { + case OpExtInst: + switch (inst.getImmediateOperand(1)) { + case GLSLstd450InterpolateAtCentroid: + case GLSLstd450InterpolateAtSample: + case GLSLstd450InterpolateAtOffset: + addCapability(CapabilityInterpolationFunction); + break; + default: + break; + } + break; + case OpDPdxFine: + case OpDPdyFine: + case OpFwidthFine: + case OpDPdxCoarse: + case OpDPdyCoarse: + case OpFwidthCoarse: + addCapability(CapabilityDerivativeControl); + break; + + case OpImageQueryLod: + case OpImageQuerySize: + case OpImageQuerySizeLod: + case OpImageQuerySamples: + case OpImageQueryLevels: + addCapability(CapabilityImageQuery); + break; + +#ifdef NV_EXTENSIONS + case OpGroupNonUniformPartitionNV: + addExtension(E_SPV_NV_shader_subgroup_partitioned); + addCapability(CapabilityGroupNonUniformPartitionedNV); + break; +#endif + + default: + break; + } + + // Checks based on type + if (inst.getTypeId() != NoType) + postProcessType(inst, inst.getTypeId()); + for (int op = 0; op < inst.getNumOperands(); ++op) { + if (inst.isIdOperand(op)) { + // In blocks, these are always result ids, but we are relying on + // getTypeId() to return NoType for things like OpLabel. + if (getTypeId(inst.getIdOperand(op)) != NoType) + postProcessType(inst, getTypeId(inst.getIdOperand(op))); + } + } +} + +// Called for each instruction in a reachable block. +void Builder::postProcessReachable(const Instruction&) +{ + // did have code here, but questionable to do so without deleting the instructions +} + +// comment in header +void Builder::postProcess() +{ + std::unordered_set reachableBlocks; + std::unordered_set unreachableDefinitions; + // Collect IDs defined in unreachable blocks. For each function, label the + // reachable blocks first. Then for each unreachable block, collect the + // result IDs of the instructions in it. + for (auto fi = module.getFunctions().cbegin(); fi != module.getFunctions().cend(); fi++) { + Function* f = *fi; + Block* entry = f->getEntryBlock(); + inReadableOrder(entry, [&reachableBlocks](const Block* b) { reachableBlocks.insert(b); }); + for (auto bi = f->getBlocks().cbegin(); bi != f->getBlocks().cend(); bi++) { + Block* b = *bi; + if (reachableBlocks.count(b) == 0) { + for (auto ii = b->getInstructions().cbegin(); ii != b->getInstructions().cend(); ii++) + unreachableDefinitions.insert(ii->get()->getResultId()); + } + } + } + + // Remove unneeded decorations, for unreachable instructions + decorations.erase(std::remove_if(decorations.begin(), decorations.end(), + [&unreachableDefinitions](std::unique_ptr& I) -> bool { + Id decoration_id = I.get()->getIdOperand(0); + return unreachableDefinitions.count(decoration_id) != 0; + }), + decorations.end()); + + // Add per-instruction capabilities, extensions, etc., + + // process all reachable instructions... + for (auto bi = reachableBlocks.cbegin(); bi != reachableBlocks.cend(); ++bi) { + const Block* block = *bi; + const auto function = [this](const std::unique_ptr& inst) { postProcessReachable(*inst.get()); }; + std::for_each(block->getInstructions().begin(), block->getInstructions().end(), function); + } + + // process all block-contained instructions + for (auto fi = module.getFunctions().cbegin(); fi != module.getFunctions().cend(); fi++) { + Function* f = *fi; + for (auto bi = f->getBlocks().cbegin(); bi != f->getBlocks().cend(); bi++) { + Block* b = *bi; + for (auto ii = b->getInstructions().cbegin(); ii != b->getInstructions().cend(); ii++) + postProcess(*ii->get()); + } + } +} + +}; // end spv namespace diff --git a/deps/glslang/SPIRV/SpvTools.cpp b/deps/glslang/SPIRV/SpvTools.cpp new file mode 100644 index 00000000..05f234cc --- /dev/null +++ b/deps/glslang/SPIRV/SpvTools.cpp @@ -0,0 +1,189 @@ +// +// Copyright (C) 2014-2016 LunarG, Inc. +// Copyright (C) 2018 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +// +// Call into SPIRV-Tools to disassemble, validate, and optimize. +// + +#if ENABLE_OPT + +#include +#include + +#include "SpvTools.h" +#include "spirv-tools/optimizer.hpp" +#include "spirv-tools/libspirv.h" + +namespace glslang { + +// Translate glslang's view of target versioning to what SPIRV-Tools uses. +spv_target_env MapToSpirvToolsEnv(const SpvVersion& spvVersion, spv::SpvBuildLogger* logger) +{ + switch (spvVersion.vulkan) { + case glslang::EShTargetVulkan_1_0: return spv_target_env::SPV_ENV_VULKAN_1_0; + case glslang::EShTargetVulkan_1_1: return spv_target_env::SPV_ENV_VULKAN_1_1; + default: + break; + } + + if (spvVersion.openGl > 0) + return spv_target_env::SPV_ENV_OPENGL_4_5; + + logger->missingFunctionality("Target version for SPIRV-Tools validator"); + return spv_target_env::SPV_ENV_UNIVERSAL_1_0; +} + + +// Use the SPIRV-Tools disassembler to print SPIR-V. +void SpirvToolsDisassemble(std::ostream& out, const std::vector& spirv) +{ + // disassemble + spv_context context = spvContextCreate(SPV_ENV_UNIVERSAL_1_3); + spv_text text; + spv_diagnostic diagnostic = nullptr; + spvBinaryToText(context, spirv.data(), spirv.size(), + SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES | SPV_BINARY_TO_TEXT_OPTION_INDENT, + &text, &diagnostic); + + // dump + if (diagnostic == nullptr) + out << text->str; + else + spvDiagnosticPrint(diagnostic); + + // teardown + spvDiagnosticDestroy(diagnostic); + spvContextDestroy(context); +} + +// Apply the SPIRV-Tools validator to generated SPIR-V. +void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector& spirv, + spv::SpvBuildLogger* logger) +{ + // validate + spv_context context = spvContextCreate(MapToSpirvToolsEnv(intermediate.getSpv(), logger)); + spv_const_binary_t binary = { spirv.data(), spirv.size() }; + spv_diagnostic diagnostic = nullptr; + spv_validator_options options = spvValidatorOptionsCreate(); + spvValidatorOptionsSetRelaxBlockLayout(options, intermediate.usingHlslOffsets()); + spvValidateWithOptions(context, options, &binary, &diagnostic); + + // report + if (diagnostic != nullptr) { + logger->error("SPIRV-Tools Validation Errors"); + logger->error(diagnostic->error); + } + + // tear down + spvValidatorOptionsDestroy(options); + spvDiagnosticDestroy(diagnostic); + spvContextDestroy(context); +} + +// Apply the SPIRV-Tools optimizer to generated SPIR-V, for the purpose of +// legalizing HLSL SPIR-V. +void SpirvToolsLegalize(const glslang::TIntermediate&, std::vector& spirv, + spv::SpvBuildLogger*, const SpvOptions* options) +{ + spv_target_env target_env = SPV_ENV_UNIVERSAL_1_2; + + spvtools::Optimizer optimizer(target_env); + optimizer.SetMessageConsumer( + [](spv_message_level_t level, const char *source, const spv_position_t &position, const char *message) { + auto &out = std::cerr; + switch (level) + { + case SPV_MSG_FATAL: + case SPV_MSG_INTERNAL_ERROR: + case SPV_MSG_ERROR: + out << "error: "; + break; + case SPV_MSG_WARNING: + out << "warning: "; + break; + case SPV_MSG_INFO: + case SPV_MSG_DEBUG: + out << "info: "; + break; + default: + break; + } + if (source) + { + out << source << ":"; + } + out << position.line << ":" << position.column << ":" << position.index << ":"; + if (message) + { + out << " " << message; + } + out << std::endl; + }); + + optimizer.RegisterPass(spvtools::CreateDeadBranchElimPass()); + optimizer.RegisterPass(spvtools::CreateMergeReturnPass()); + optimizer.RegisterPass(spvtools::CreateInlineExhaustivePass()); + optimizer.RegisterPass(spvtools::CreateEliminateDeadFunctionsPass()); + optimizer.RegisterPass(spvtools::CreateScalarReplacementPass()); + optimizer.RegisterPass(spvtools::CreateLocalAccessChainConvertPass()); + optimizer.RegisterPass(spvtools::CreateLocalSingleBlockLoadStoreElimPass()); + optimizer.RegisterPass(spvtools::CreateLocalSingleStoreElimPass()); + optimizer.RegisterPass(spvtools::CreateSimplificationPass()); + optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass()); + optimizer.RegisterPass(spvtools::CreateVectorDCEPass()); + optimizer.RegisterPass(spvtools::CreateDeadInsertElimPass()); + optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass()); + optimizer.RegisterPass(spvtools::CreateDeadBranchElimPass()); + optimizer.RegisterPass(spvtools::CreateBlockMergePass()); + optimizer.RegisterPass(spvtools::CreateLocalMultiStoreElimPass()); + optimizer.RegisterPass(spvtools::CreateIfConversionPass()); + optimizer.RegisterPass(spvtools::CreateSimplificationPass()); + optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass()); + optimizer.RegisterPass(spvtools::CreateVectorDCEPass()); + optimizer.RegisterPass(spvtools::CreateDeadInsertElimPass()); + if (options->optimizeSize) { + optimizer.RegisterPass(spvtools::CreateRedundancyEliminationPass()); + // TODO(greg-lunarg): Add this when AMD driver issues are resolved + // optimizer.RegisterPass(CreateCommonUniformElimPass()); + } + optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass()); + optimizer.RegisterPass(spvtools::CreateCFGCleanupPass()); + + optimizer.Run(spirv.data(), spirv.size(), &spirv, spvtools::ValidatorOptions(), true); +} + +}; // end namespace glslang + +#endif diff --git a/deps/glslang/SPIRV/SpvTools.h b/deps/glslang/SPIRV/SpvTools.h new file mode 100644 index 00000000..08bcf3a2 --- /dev/null +++ b/deps/glslang/SPIRV/SpvTools.h @@ -0,0 +1,80 @@ +// +// Copyright (C) 2014-2016 LunarG, Inc. +// Copyright (C) 2018 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +// +// Call into SPIRV-Tools to disassemble, validate, and optimize. +// + +#pragma once +#ifndef GLSLANG_SPV_TOOLS_H +#define GLSLANG_SPV_TOOLS_H + +#include +#include + +#include "../glslang/MachineIndependent/localintermediate.h" +#include "Logger.h" + +namespace glslang { + +struct SpvOptions { + SpvOptions() : generateDebugInfo(false), disableOptimizer(true), + optimizeSize(false), disassemble(false), validate(false) { } + bool generateDebugInfo; + bool disableOptimizer; + bool optimizeSize; + bool disassemble; + bool validate; +}; + +#if ENABLE_OPT + +// Use the SPIRV-Tools disassembler to print SPIR-V. +void SpirvToolsDisassemble(std::ostream& out, const std::vector& spirv); + +// Apply the SPIRV-Tools validator to generated SPIR-V. +void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector& spirv, + spv::SpvBuildLogger*); + +// Apply the SPIRV-Tools optimizer to generated SPIR-V, for the purpose of +// legalizing HLSL SPIR-V. +void SpirvToolsLegalize(const glslang::TIntermediate& intermediate, std::vector& spirv, + spv::SpvBuildLogger*, const SpvOptions*); + +#endif + +}; // end namespace glslang + +#endif // GLSLANG_SPV_TOOLS_H \ No newline at end of file diff --git a/deps/glslang/SPIRV/bitutils.h b/deps/glslang/SPIRV/bitutils.h index 31288ab6..22e44cec 100644 --- a/deps/glslang/SPIRV/bitutils.h +++ b/deps/glslang/SPIRV/bitutils.h @@ -26,7 +26,7 @@ Dest BitwiseCast(Src source) { Dest dest; static_assert(sizeof(source) == sizeof(dest), "BitwiseCast: Source and destination must have the same size"); - std::memcpy(&dest, &source, sizeof(dest)); + std::memcpy(static_cast(&dest), &source, sizeof(dest)); return dest; } diff --git a/deps/glslang/SPIRV/disassemble.cpp b/deps/glslang/SPIRV/disassemble.cpp index c07dfc78..22c83ea9 100644 --- a/deps/glslang/SPIRV/disassemble.cpp +++ b/deps/glslang/SPIRV/disassemble.cpp @@ -46,6 +46,7 @@ #include "disassemble.h" #include "doc.h" +#include "SpvTools.h" namespace spv { extern "C" { @@ -353,10 +354,21 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, if (resultId != 0 && idDescriptor[resultId].size() == 0) { switch (opCode) { case OpTypeInt: - idDescriptor[resultId] = "int"; + switch (stream[word]) { + case 8: idDescriptor[resultId] = "int8_t"; break; + case 16: idDescriptor[resultId] = "int16_t"; break; + default: assert(0); // fallthrough + case 32: idDescriptor[resultId] = "int"; break; + case 64: idDescriptor[resultId] = "int64_t"; break; + } break; case OpTypeFloat: - idDescriptor[resultId] = "float"; + switch (stream[word]) { + case 16: idDescriptor[resultId] = "float16_t"; break; + default: assert(0); // fallthrough + case 32: idDescriptor[resultId] = "float"; break; + case 64: idDescriptor[resultId] = "float64_t"; break; + } break; case OpTypeBool: idDescriptor[resultId] = "bool"; @@ -368,8 +380,18 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, idDescriptor[resultId] = "ptr"; break; case OpTypeVector: - if (idDescriptor[stream[word]].size() > 0) + if (idDescriptor[stream[word]].size() > 0) { idDescriptor[resultId].append(idDescriptor[stream[word]].begin(), idDescriptor[stream[word]].begin() + 1); + if (strstr(idDescriptor[stream[word]].c_str(), "8")) { + idDescriptor[resultId].append("8"); + } + if (strstr(idDescriptor[stream[word]].c_str(), "16")) { + idDescriptor[resultId].append("16"); + } + if (strstr(idDescriptor[stream[word]].c_str(), "64")) { + idDescriptor[resultId].append("64"); + } + } idDescriptor[resultId].append("vec"); switch (stream[word + 1]) { case 2: idDescriptor[resultId].append("2"); break; @@ -488,7 +510,9 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, }else if (strcmp(spv::E_SPV_NV_sample_mask_override_coverage, name) == 0 || strcmp(spv::E_SPV_NV_geometry_shader_passthrough, name) == 0 || strcmp(spv::E_SPV_NV_viewport_array2, name) == 0 || - strcmp(spv::E_SPV_NVX_multiview_per_view_attributes, name) == 0) { + strcmp(spv::E_SPV_NVX_multiview_per_view_attributes, name) == 0 || + strcmp(spv::E_SPV_NV_fragment_shader_barycentric, name) == 0 || + strcmp(spv::E_SPV_NV_mesh_shader, name) == 0) { extInstSet = GLSLextNVInst; #endif } @@ -513,6 +537,11 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, case OperandLiteralString: numOperands -= disassembleString(); break; + case OperandMemoryAccess: + outputMask(OperandMemoryAccess, stream[word++]); + --numOperands; + disassembleIds(numOperands); + return; default: assert(operandClass >= OperandSource && operandClass < OperandOpcode); @@ -664,21 +693,45 @@ static const char* GLSLextNVGetDebugNames(const char* name, unsigned entrypoint) strcmp(name, spv::E_SPV_NV_geometry_shader_passthrough) == 0 || strcmp(name, spv::E_ARB_shader_viewport_layer_array) == 0 || strcmp(name, spv::E_SPV_NV_viewport_array2) == 0 || - strcmp(spv::E_SPV_NVX_multiview_per_view_attributes, name) == 0) { + strcmp(spv::E_SPV_NVX_multiview_per_view_attributes, name) == 0 || + strcmp(spv::E_SPV_NV_fragment_shader_barycentric, name) == 0 || + strcmp(name, spv::E_SPV_NV_mesh_shader) == 0) { switch (entrypoint) { - case DecorationOverrideCoverageNV: return "OverrideCoverageNV"; - case DecorationPassthroughNV: return "PassthroughNV"; - case CapabilityGeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV"; - case DecorationViewportRelativeNV: return "ViewportRelativeNV"; + // NV builtins case BuiltInViewportMaskNV: return "ViewportMaskNV"; - case CapabilityShaderViewportMaskNV: return "ShaderViewportMaskNV"; - case DecorationSecondaryViewportRelativeNV: return "SecondaryViewportRelativeNV"; case BuiltInSecondaryPositionNV: return "SecondaryPositionNV"; case BuiltInSecondaryViewportMaskNV: return "SecondaryViewportMaskNV"; - case CapabilityShaderStereoViewNV: return "ShaderStereoViewNV"; case BuiltInPositionPerViewNV: return "PositionPerViewNV"; case BuiltInViewportMaskPerViewNV: return "ViewportMaskPerViewNV"; + case BuiltInBaryCoordNV: return "BaryCoordNV"; + case BuiltInBaryCoordNoPerspNV: return "BaryCoordNoPerspNV"; + case BuiltInTaskCountNV: return "TaskCountNV"; + case BuiltInPrimitiveCountNV: return "PrimitiveCountNV"; + case BuiltInPrimitiveIndicesNV: return "PrimitiveIndicesNV"; + case BuiltInClipDistancePerViewNV: return "ClipDistancePerViewNV"; + case BuiltInCullDistancePerViewNV: return "CullDistancePerViewNV"; + case BuiltInLayerPerViewNV: return "LayerPerViewNV"; + case BuiltInMeshViewCountNV: return "MeshViewCountNV"; + case BuiltInMeshViewIndicesNV: return "MeshViewIndicesNV"; + + // NV Capabilities + case CapabilityGeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV"; + case CapabilityShaderViewportMaskNV: return "ShaderViewportMaskNV"; + case CapabilityShaderStereoViewNV: return "ShaderStereoViewNV"; case CapabilityPerViewAttributesNV: return "PerViewAttributesNV"; + case CapabilityFragmentBarycentricNV: return "FragmentBarycentricNV"; + case CapabilityMeshShadingNV: return "MeshShadingNV"; + + // NV Decorations + case DecorationOverrideCoverageNV: return "OverrideCoverageNV"; + case DecorationPassthroughNV: return "PassthroughNV"; + case DecorationViewportRelativeNV: return "ViewportRelativeNV"; + case DecorationSecondaryViewportRelativeNV: return "SecondaryViewportRelativeNV"; + case DecorationPerVertexNV: return "PerVertexNV"; + case DecorationPerPrimitiveNV: return "PerPrimitiveNV"; + case DecorationPerViewNV: return "PerViewNV"; + case DecorationPerTaskNV: return "PerTaskNV"; + default: return "Bad"; } } diff --git a/deps/glslang/SPIRV/disassemble.h b/deps/glslang/SPIRV/disassemble.h index 47cef65a..2a9a89b5 100644 --- a/deps/glslang/SPIRV/disassemble.h +++ b/deps/glslang/SPIRV/disassemble.h @@ -45,6 +45,7 @@ namespace spv { + // disassemble with glslang custom disassembler void Disassemble(std::ostream& out, const std::vector&); }; // end namespace spv diff --git a/deps/glslang/SPIRV/doc.cpp b/deps/glslang/SPIRV/doc.cpp index a9059687..4f7c1989 100644 --- a/deps/glslang/SPIRV/doc.cpp +++ b/deps/glslang/SPIRV/doc.cpp @@ -98,8 +98,22 @@ const char* ExecutionModelString(int model) case 4: return "Fragment"; case 5: return "GLCompute"; case 6: return "Kernel"; +#ifdef NV_EXTENSIONS + case ExecutionModelTaskNV: return "TaskNV"; + case ExecutionModelMeshNV: return "MeshNV"; +#endif default: return "Bad"; + +#ifdef NV_EXTENSIONS + case ExecutionModelRayGenerationNV: return "RayGenerationNV"; + case ExecutionModelIntersectionNV: return "IntersectionNV"; + case ExecutionModelAnyHitNV: return "AnyHitNV"; + case ExecutionModelClosestHitNV: return "ClosestHitNV"; + case ExecutionModelMissNV: return "MissNV"; + case ExecutionModelCallableNV: return "CallableNV"; +#endif + } } @@ -117,9 +131,10 @@ const char* AddressingString(int addr) const char* MemoryString(int mem) { switch (mem) { - case 0: return "Simple"; - case 1: return "GLSL450"; - case 2: return "OpenCL"; + case MemoryModelSimple: return "Simple"; + case MemoryModelGLSL450: return "GLSL450"; + case MemoryModelOpenCL: return "OpenCL"; + case MemoryModelVulkanKHR: return "VulkanKHR"; default: return "Bad"; } @@ -165,6 +180,15 @@ const char* ExecutionModeString(int mode) case 32: return "Bad"; case 4446: return "PostDepthCoverage"; + +#ifdef NV_EXTENSIONS + case ExecutionModeOutputLinesNV: return "OutputLinesNV"; + case ExecutionModeOutputPrimitivesNV: return "OutputPrimitivesNV"; + case ExecutionModeOutputTrianglesNV: return "OutputTrianglesNV"; + case ExecutionModeDerivativeGroupQuadsNV: return "DerivativeGroupQuadsNV"; + case ExecutionModeDerivativeGroupLinearNV: return "DerivativeGroupLinearNV"; +#endif + case ExecutionModeCeiling: default: return "Bad"; } @@ -187,6 +211,15 @@ const char* StorageClassString(int StorageClass) case 11: return "Image"; case 12: return "StorageBuffer"; +#ifdef NV_EXTENSIONS + case StorageClassRayPayloadNV: return "RayPayloadNV"; + case StorageClassHitAttributeNV: return "HitAttributeNV"; + case StorageClassIncomingRayPayloadNV: return "IncomingRayPayloadNV"; + case StorageClassShaderRecordBufferNV: return "ShaderRecordBufferNV"; + case StorageClassCallableDataNV: return "CallableDataNV"; + case StorageClassIncomingCallableDataNV: return "IncomingCallableDataNV"; +#endif + default: return "Bad"; } } @@ -253,6 +286,10 @@ const char* DecorationString(int decoration) case DecorationPassthroughNV: return "PassthroughNV"; case DecorationViewportRelativeNV: return "ViewportRelativeNV"; case DecorationSecondaryViewportRelativeNV: return "SecondaryViewportRelativeNV"; + case DecorationPerPrimitiveNV: return "PerPrimitiveNV"; + case DecorationPerViewNV: return "PerViewNV"; + case DecorationPerTaskNV: return "PerTaskNV"; + case DecorationPerVertexNV: return "PerVertexNV"; #endif case DecorationNonUniformEXT: return "DecorationNonUniformEXT"; @@ -332,15 +369,45 @@ const char* BuiltInString(int builtIn) #endif #ifdef NV_EXTENSIONS - case 5253: return "ViewportMaskNV"; - case 5257: return "SecondaryPositionNV"; - case 5258: return "SecondaryViewportMaskNV"; - case 5261: return "PositionPerViewNV"; - case 5262: return "ViewportMaskPerViewNV"; + case BuiltInLaunchIdNV: return "LaunchIdNV"; + case BuiltInLaunchSizeNV: return "LaunchSizeNV"; + case BuiltInWorldRayOriginNV: return "WorldRayOriginNV"; + case BuiltInWorldRayDirectionNV: return "WorldRayDirectionNV"; + case BuiltInObjectRayOriginNV: return "ObjectRayOriginNV"; + case BuiltInObjectRayDirectionNV: return "ObjectRayDirectionNV"; + case BuiltInRayTminNV: return "RayTminNV"; + case BuiltInRayTmaxNV: return "RayTmaxNV"; + case BuiltInInstanceCustomIndexNV: return "InstanceCustomIndexNV"; + case BuiltInObjectToWorldNV: return "ObjectToWorldNV"; + case BuiltInWorldToObjectNV: return "WorldToObjectNV"; + case BuiltInHitTNV: return "HitTNV"; + case BuiltInHitKindNV: return "HitKindNV"; + case BuiltInIncomingRayFlagsNV: return "IncomingRayFlagsNV"; + case BuiltInViewportMaskNV: return "ViewportMaskNV"; + case BuiltInSecondaryPositionNV: return "SecondaryPositionNV"; + case BuiltInSecondaryViewportMaskNV: return "SecondaryViewportMaskNV"; + case BuiltInPositionPerViewNV: return "PositionPerViewNV"; + case BuiltInViewportMaskPerViewNV: return "ViewportMaskPerViewNV"; + case BuiltInFragmentSizeNV: return "FragmentSizeNV"; + case BuiltInInvocationsPerPixelNV: return "InvocationsPerPixelNV"; + case BuiltInBaryCoordNV: return "BaryCoordNV"; + case BuiltInBaryCoordNoPerspNV: return "BaryCoordNoPerspNV"; #endif case 5264: return "FullyCoveredEXT"; + +#ifdef NV_EXTENSIONS + case BuiltInTaskCountNV: return "TaskCountNV"; + case BuiltInPrimitiveCountNV: return "PrimitiveCountNV"; + case BuiltInPrimitiveIndicesNV: return "PrimitiveIndicesNV"; + case BuiltInClipDistancePerViewNV: return "ClipDistancePerViewNV"; + case BuiltInCullDistancePerViewNV: return "CullDistancePerViewNV"; + case BuiltInLayerPerViewNV: return "LayerPerViewNV"; + case BuiltInMeshViewCountNV: return "MeshViewCountNV"; + case BuiltInMeshViewIndicesNV: return "MeshViewIndicesNV"; +#endif + default: return "Bad"; } } @@ -499,19 +566,23 @@ const char* ImageChannelDataTypeString(int type) } } -const int ImageOperandsCeiling = 8; +const int ImageOperandsCeiling = 12; const char* ImageOperandsString(int format) { switch (format) { - case 0: return "Bias"; - case 1: return "Lod"; - case 2: return "Grad"; - case 3: return "ConstOffset"; - case 4: return "Offset"; - case 5: return "ConstOffsets"; - case 6: return "Sample"; - case 7: return "MinLod"; + case ImageOperandsBiasShift: return "Bias"; + case ImageOperandsLodShift: return "Lod"; + case ImageOperandsGradShift: return "Grad"; + case ImageOperandsConstOffsetShift: return "ConstOffset"; + case ImageOperandsOffsetShift: return "Offset"; + case ImageOperandsConstOffsetsShift: return "ConstOffsets"; + case ImageOperandsSampleShift: return "Sample"; + case ImageOperandsMinLodShift: return "MinLod"; + case ImageOperandsMakeTexelAvailableKHRShift: return "MakeTexelAvailableKHR"; + case ImageOperandsMakeTexelVisibleKHRShift: return "MakeTexelVisibleKHR"; + case ImageOperandsNonPrivateTexelKHRShift: return "NonPrivateTexelKHR"; + case ImageOperandsVolatileTexelKHRShift: return "VolatileTexelKHR"; case ImageOperandsCeiling: default: @@ -645,12 +716,17 @@ const char* MemorySemanticsString(int mem) } } +const int MemoryAccessCeiling = 6; + const char* MemoryAccessString(int mem) { switch (mem) { - case 0: return "Volatile"; - case 1: return "Aligned"; - case 2: return "Nontemporal"; + case MemoryAccessVolatileShift: return "Volatile"; + case MemoryAccessAlignedShift: return "Aligned"; + case MemoryAccessNontemporalShift: return "Nontemporal"; + case MemoryAccessMakePointerAvailableKHRShift: return "MakePointerAvailableKHR"; + case MemoryAccessMakePointerVisibleKHRShift: return "MakePointerVisibleKHR"; + case MemoryAccessNonPrivatePointerKHRShift: return "NonPrivatePointerKHR"; default: return "Bad"; } @@ -790,6 +866,10 @@ const char* CapabilityString(int info) case CapabilityStoragePushConstant16: return "StoragePushConstant16"; case CapabilityStorageInputOutput16: return "StorageInputOutput16"; + case CapabilityStorageBuffer8BitAccess: return "CapabilityStorageBuffer8BitAccess"; + case CapabilityUniformAndStorageBuffer8BitAccess: return "CapabilityUniformAndStorageBuffer8BitAccess"; + case CapabilityStoragePushConstant8: return "CapabilityStoragePushConstant8"; + case CapabilityDeviceGroup: return "DeviceGroup"; case CapabilityMultiView: return "MultiView"; @@ -806,12 +886,18 @@ const char* CapabilityString(int info) case CapabilitySampleMaskPostDepthCoverage: return "SampleMaskPostDepthCoverage"; #ifdef NV_EXTENSIONS - case CapabilityGeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV"; - case CapabilityShaderViewportIndexLayerNV: return "ShaderViewportIndexLayerNV"; - case CapabilityShaderViewportMaskNV: return "ShaderViewportMaskNV"; - case CapabilityShaderStereoViewNV: return "ShaderStereoViewNV"; - case CapabilityPerViewAttributesNV: return "PerViewAttributesNV"; - case CapabilityGroupNonUniformPartitionedNV: return "GroupNonUniformPartitionedNV"; + case CapabilityGeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV"; + case CapabilityShaderViewportIndexLayerNV: return "ShaderViewportIndexLayerNV"; + case CapabilityShaderViewportMaskNV: return "ShaderViewportMaskNV"; + case CapabilityShaderStereoViewNV: return "ShaderStereoViewNV"; + case CapabilityPerViewAttributesNV: return "PerViewAttributesNV"; + case CapabilityGroupNonUniformPartitionedNV: return "GroupNonUniformPartitionedNV"; + case CapabilityRayTracingNV: return "RayTracingNV"; + case CapabilityComputeDerivativeGroupQuadsNV: return "ComputeDerivativeGroupQuadsNV"; + case CapabilityComputeDerivativeGroupLinearNV: return "ComputeDerivativeGroupLinearNV"; + case CapabilityFragmentBarycentricNV: return "FragmentBarycentricNV"; + case CapabilityMeshShadingNV: return "MeshShadingNV"; + case CapabilityShadingRateNV: return "ShadingRateNV"; #endif case CapabilityFragmentFullyCoveredEXT: return "FragmentFullyCoveredEXT"; @@ -829,6 +915,9 @@ const char* CapabilityString(int info) case CapabilityUniformTexelBufferArrayNonUniformIndexingEXT: return "CapabilityUniformTexelBufferArrayNonUniformIndexingEXT"; case CapabilityStorageTexelBufferArrayNonUniformIndexingEXT: return "CapabilityStorageTexelBufferArrayNonUniformIndexingEXT"; + case CapabilityVulkanMemoryModelKHR: return "CapabilityVulkanMemoryModelKHR"; + case CapabilityVulkanMemoryModelDeviceScopeKHR: return "CapabilityVulkanMemoryModelDeviceScopeKHR"; + default: return "Bad"; } } @@ -1221,8 +1310,17 @@ const char* OpcodeString(int op) case OpMemberDecorateStringGOOGLE: return "OpMemberDecorateStringGOOGLE"; #ifdef NV_EXTENSIONS - case OpGroupNonUniformPartitionNV: return "OpGroupNonUniformPartitionNV"; + case OpGroupNonUniformPartitionNV: return "OpGroupNonUniformPartitionNV"; + case OpReportIntersectionNV: return "OpReportIntersectionNV"; + case OpIgnoreIntersectionNV: return "OpIgnoreIntersectionNV"; + case OpTerminateRayNV: return "OpTerminateRayNV"; + case OpTraceNV: return "OpTraceNV"; + case OpTypeAccelerationStructureNV: return "OpTypeAccelerationStructureNV"; + case OpExecuteCallableNV: return "OpExecuteCallableNV"; + case OpImageSampleFootprintNV: return "OpImageSampleFootprintNV"; + case OpWritePackedPrimitiveIndices4x8NV: return "OpWritePackedPrimitiveIndices4x8NV"; #endif + default: return "Bad"; } @@ -1241,6 +1339,7 @@ EnumParameters DecorationParams[DecorationCeiling]; EnumParameters LoopControlParams[FunctionControlCeiling]; EnumParameters SelectionControlParams[SelectControlCeiling]; EnumParameters FunctionControlParams[FunctionControlCeiling]; +EnumParameters MemoryAccessParams[MemoryAccessCeiling]; // Set up all the parameterizing descriptions of the opcodes, operands, etc. void Parameterize() @@ -1396,7 +1495,7 @@ void Parameterize() OperandClassParams[OperandLoop].set(LoopControlCeiling, LoopControlString, LoopControlParams, true); OperandClassParams[OperandFunction].set(FunctionControlCeiling, FunctionControlString, FunctionControlParams, true); OperandClassParams[OperandMemorySemantics].set(0, MemorySemanticsString, nullptr, true); - OperandClassParams[OperandMemoryAccess].set(0, MemoryAccessString, nullptr, true); + OperandClassParams[OperandMemoryAccess].set(MemoryAccessCeiling, MemoryAccessString, MemoryAccessParams, true); OperandClassParams[OperandScope].set(0, ScopeString, nullptr); OperandClassParams[OperandGroupOperation].set(0, GroupOperationString, nullptr); OperandClassParams[OperandKernelEnqueueFlags].set(0, KernelEnqueueFlagsString, nullptr); @@ -1518,10 +1617,14 @@ void Parameterize() InstructionDesc[OpLoad].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpLoad].operands.push(OperandMemoryAccess, "", true); + InstructionDesc[OpLoad].operands.push(OperandLiteralNumber, "", true); + InstructionDesc[OpLoad].operands.push(OperandId, "", true); InstructionDesc[OpStore].operands.push(OperandId, "'Pointer'"); InstructionDesc[OpStore].operands.push(OperandId, "'Object'"); InstructionDesc[OpStore].operands.push(OperandMemoryAccess, "", true); + InstructionDesc[OpStore].operands.push(OperandLiteralNumber, "", true); + InstructionDesc[OpStore].operands.push(OperandId, "", true); InstructionDesc[OpPhi].operands.push(OperandVariableIds, "'Variable, Parent, ...'"); @@ -2562,6 +2665,42 @@ void Parameterize() #ifdef NV_EXTENSIONS InstructionDesc[OpGroupNonUniformPartitionNV].operands.push(OperandId, "X"); + + InstructionDesc[OpTypeAccelerationStructureNV].setResultAndType(true, false); + + InstructionDesc[OpTraceNV].operands.push(OperandId, "'NV Acceleration Structure'"); + InstructionDesc[OpTraceNV].operands.push(OperandId, "'Ray Flags'"); + InstructionDesc[OpTraceNV].operands.push(OperandId, "'Cull Mask'"); + InstructionDesc[OpTraceNV].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[OpTraceNV].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[OpTraceNV].operands.push(OperandId, "'Miss Index'"); + InstructionDesc[OpTraceNV].operands.push(OperandId, "'Ray Origin'"); + InstructionDesc[OpTraceNV].operands.push(OperandId, "'TMin'"); + InstructionDesc[OpTraceNV].operands.push(OperandId, "'Ray Direction'"); + InstructionDesc[OpTraceNV].operands.push(OperandId, "'TMax'"); + InstructionDesc[OpTraceNV].operands.push(OperandId, "'Payload'"); + InstructionDesc[OpTraceNV].setResultAndType(false, false); + + InstructionDesc[OpReportIntersectionNV].operands.push(OperandId, "'Hit Parameter'"); + InstructionDesc[OpReportIntersectionNV].operands.push(OperandId, "'Hit Kind'"); + + InstructionDesc[OpIgnoreIntersectionNV].setResultAndType(false, false); + + InstructionDesc[OpTerminateRayNV].setResultAndType(false, false); + + InstructionDesc[OpExecuteCallableNV].operands.push(OperandId, "SBT Record Index"); + InstructionDesc[OpExecuteCallableNV].operands.push(OperandId, "CallableData ID"); + InstructionDesc[OpExecuteCallableNV].setResultAndType(false, false); + + InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandId, "'Sampled Image'"); + InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandId, "'Granularity'"); + InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandId, "'Coarse'"); + InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandVariableIds, "", true); + + InstructionDesc[OpWritePackedPrimitiveIndices4x8NV].operands.push(OperandId, "'Index Offset'"); + InstructionDesc[OpWritePackedPrimitiveIndices4x8NV].operands.push(OperandId, "'Packed Indices'"); #endif } diff --git a/deps/glslang/SPIRV/spirv.hpp b/deps/glslang/SPIRV/spirv.hpp index e21762db..25b5ce9e 100644 --- a/deps/glslang/SPIRV/spirv.hpp +++ b/deps/glslang/SPIRV/spirv.hpp @@ -73,6 +73,14 @@ enum ExecutionModel { ExecutionModelFragment = 4, ExecutionModelGLCompute = 5, ExecutionModelKernel = 6, + ExecutionModelTaskNV = 5267, + ExecutionModelMeshNV = 5268, + ExecutionModelRayGenerationNV = 5313, + ExecutionModelIntersectionNV = 5314, + ExecutionModelAnyHitNV = 5315, + ExecutionModelClosestHitNV = 5316, + ExecutionModelMissNV = 5317, + ExecutionModelCallableNV = 5318, ExecutionModelMax = 0x7fffffff, }; @@ -87,6 +95,7 @@ enum MemoryModel { MemoryModelSimple = 0, MemoryModelGLSL450 = 1, MemoryModelOpenCL = 2, + MemoryModelVulkanKHR = 3, MemoryModelMax = 0x7fffffff, }; @@ -131,6 +140,11 @@ enum ExecutionMode { ExecutionModeLocalSizeHintId = 39, ExecutionModePostDepthCoverage = 4446, ExecutionModeStencilRefReplacingEXT = 5027, + ExecutionModeOutputLinesNV = 5269, + ExecutionModeOutputPrimitivesNV = 5270, + ExecutionModeDerivativeGroupQuadsNV = 5289, + ExecutionModeDerivativeGroupLinearNV = 5290, + ExecutionModeOutputTrianglesNV = 5298, ExecutionModeMax = 0x7fffffff, }; @@ -148,6 +162,12 @@ enum StorageClass { StorageClassAtomicCounter = 10, StorageClassImage = 11, StorageClassStorageBuffer = 12, + StorageClassCallableDataNV = 5328, + StorageClassIncomingCallableDataNV = 5329, + StorageClassRayPayloadNV = 5338, + StorageClassHitAttributeNV = 5339, + StorageClassIncomingRayPayloadNV = 5342, + StorageClassShaderRecordBufferNV = 5343, StorageClassMax = 0x7fffffff, }; @@ -275,6 +295,10 @@ enum ImageOperandsShift { ImageOperandsConstOffsetsShift = 5, ImageOperandsSampleShift = 6, ImageOperandsMinLodShift = 7, + ImageOperandsMakeTexelAvailableKHRShift = 8, + ImageOperandsMakeTexelVisibleKHRShift = 9, + ImageOperandsNonPrivateTexelKHRShift = 10, + ImageOperandsVolatileTexelKHRShift = 11, ImageOperandsMax = 0x7fffffff, }; @@ -288,6 +312,10 @@ enum ImageOperandsMask { ImageOperandsConstOffsetsMask = 0x00000020, ImageOperandsSampleMask = 0x00000040, ImageOperandsMinLodMask = 0x00000080, + ImageOperandsMakeTexelAvailableKHRMask = 0x00000100, + ImageOperandsMakeTexelVisibleKHRMask = 0x00000200, + ImageOperandsNonPrivateTexelKHRMask = 0x00000400, + ImageOperandsVolatileTexelKHRMask = 0x00000800, }; enum FPFastMathModeShift { @@ -393,6 +421,10 @@ enum Decoration { DecorationPassthroughNV = 5250, DecorationViewportRelativeNV = 5252, DecorationSecondaryViewportRelativeNV = 5256, + DecorationPerPrimitiveNV = 5271, + DecorationPerViewNV = 5272, + DecorationPerTaskNV = 5273, + DecorationPerVertexNV = 5285, DecorationNonUniformEXT = 5300, DecorationHlslCounterBufferGOOGLE = 5634, DecorationHlslSemanticGOOGLE = 5635, @@ -470,6 +502,32 @@ enum BuiltIn { BuiltInPositionPerViewNV = 5261, BuiltInViewportMaskPerViewNV = 5262, BuiltInFullyCoveredEXT = 5264, + BuiltInTaskCountNV = 5274, + BuiltInPrimitiveCountNV = 5275, + BuiltInPrimitiveIndicesNV = 5276, + BuiltInClipDistancePerViewNV = 5277, + BuiltInCullDistancePerViewNV = 5278, + BuiltInLayerPerViewNV = 5279, + BuiltInMeshViewCountNV = 5280, + BuiltInMeshViewIndicesNV = 5281, + BuiltInBaryCoordNV = 5286, + BuiltInBaryCoordNoPerspNV = 5287, + BuiltInFragmentSizeNV = 5292, + BuiltInInvocationsPerPixelNV = 5293, + BuiltInLaunchIdNV = 5319, + BuiltInLaunchSizeNV = 5320, + BuiltInWorldRayOriginNV = 5321, + BuiltInWorldRayDirectionNV = 5322, + BuiltInObjectRayOriginNV = 5323, + BuiltInObjectRayDirectionNV = 5324, + BuiltInRayTminNV = 5325, + BuiltInRayTmaxNV = 5326, + BuiltInInstanceCustomIndexNV = 5327, + BuiltInObjectToWorldNV = 5330, + BuiltInWorldToObjectNV = 5331, + BuiltInHitTNV = 5332, + BuiltInHitKindNV = 5333, + BuiltInIncomingRayFlagsNV = 5351, BuiltInMax = 0x7fffffff, }; @@ -528,6 +586,9 @@ enum MemorySemanticsShift { MemorySemanticsCrossWorkgroupMemoryShift = 9, MemorySemanticsAtomicCounterMemoryShift = 10, MemorySemanticsImageMemoryShift = 11, + MemorySemanticsOutputMemoryKHRShift = 12, + MemorySemanticsMakeAvailableKHRShift = 13, + MemorySemanticsMakeVisibleKHRShift = 14, MemorySemanticsMax = 0x7fffffff, }; @@ -543,12 +604,18 @@ enum MemorySemanticsMask { MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, MemorySemanticsAtomicCounterMemoryMask = 0x00000400, MemorySemanticsImageMemoryMask = 0x00000800, + MemorySemanticsOutputMemoryKHRMask = 0x00001000, + MemorySemanticsMakeAvailableKHRMask = 0x00002000, + MemorySemanticsMakeVisibleKHRMask = 0x00004000, }; enum MemoryAccessShift { MemoryAccessVolatileShift = 0, MemoryAccessAlignedShift = 1, MemoryAccessNontemporalShift = 2, + MemoryAccessMakePointerAvailableKHRShift = 3, + MemoryAccessMakePointerVisibleKHRShift = 4, + MemoryAccessNonPrivatePointerKHRShift = 5, MemoryAccessMax = 0x7fffffff, }; @@ -557,6 +624,9 @@ enum MemoryAccessMask { MemoryAccessVolatileMask = 0x00000001, MemoryAccessAlignedMask = 0x00000002, MemoryAccessNontemporalMask = 0x00000004, + MemoryAccessMakePointerAvailableKHRMask = 0x00000008, + MemoryAccessMakePointerVisibleKHRMask = 0x00000010, + MemoryAccessNonPrivatePointerKHRMask = 0x00000020, }; enum Scope { @@ -565,6 +635,7 @@ enum Scope { ScopeWorkgroup = 2, ScopeSubgroup = 3, ScopeInvocation = 4, + ScopeQueueFamilyKHR = 5, ScopeMax = 0x7fffffff, }; @@ -679,6 +750,9 @@ enum Capability { CapabilityVariablePointers = 4442, CapabilityAtomicStorageOps = 4445, CapabilitySampleMaskPostDepthCoverage = 4447, + CapabilityStorageBuffer8BitAccess = 4448, + CapabilityUniformAndStorageBuffer8BitAccess = 4449, + CapabilityStoragePushConstant8 = 4450, CapabilityFloat16ImageAMD = 5008, CapabilityImageGatherBiasLodAMD = 5009, CapabilityFragmentMaskAMD = 5010, @@ -692,6 +766,11 @@ enum Capability { CapabilityShaderStereoViewNV = 5259, CapabilityPerViewAttributesNV = 5260, CapabilityFragmentFullyCoveredEXT = 5265, + CapabilityMeshShadingNV = 5266, + CapabilityImageFootprintNV = 5282, + CapabilityFragmentBarycentricNV = 5284, + CapabilityComputeDerivativeGroupQuadsNV = 5288, + CapabilityShadingRateNV = 5291, CapabilityGroupNonUniformPartitionedNV = 5297, CapabilityShaderNonUniformEXT = 5301, CapabilityRuntimeDescriptorArrayEXT = 5302, @@ -705,6 +784,10 @@ enum Capability { CapabilityInputAttachmentArrayNonUniformIndexingEXT = 5310, CapabilityUniformTexelBufferArrayNonUniformIndexingEXT = 5311, CapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312, + CapabilityRayTracingNV = 5340, + CapabilityVulkanMemoryModelKHR = 5345, + CapabilityVulkanMemoryModelDeviceScopeKHR = 5346, + CapabilityComputeDerivativeGroupLinearNV = 5350, CapabilitySubgroupShuffleINTEL = 5568, CapabilitySubgroupBufferBlockIOINTEL = 5569, CapabilitySubgroupImageBlockIOINTEL = 5570, @@ -1068,7 +1151,15 @@ enum Op { OpGroupSMaxNonUniformAMD = 5007, OpFragmentMaskFetchAMD = 5011, OpFragmentFetchAMD = 5012, + OpImageSampleFootprintNV = 5283, OpGroupNonUniformPartitionNV = 5296, + OpWritePackedPrimitiveIndices4x8NV = 5299, + OpReportIntersectionNV = 5334, + OpIgnoreIntersectionNV = 5335, + OpTerminateRayNV = 5336, + OpTraceNV = 5337, + OpTypeAccelerationStructureNV = 5341, + OpExecuteCallableNV = 5344, OpSubgroupShuffleINTEL = 5571, OpSubgroupShuffleDownINTEL = 5572, OpSubgroupShuffleUpINTEL = 5573, diff --git a/deps/glslang/SPIRV/spvIR.h b/deps/glslang/SPIRV/spvIR.h index faa2701f..2532b178 100644 --- a/deps/glslang/SPIRV/spvIR.h +++ b/deps/glslang/SPIRV/spvIR.h @@ -79,6 +79,11 @@ const MemorySemanticsMask MemorySemanticsAllMemory = MemorySemanticsAtomicCounterMemoryMask | MemorySemanticsImageMemoryMask); +struct IdImmediate { + bool isId; // true if word is an Id, false if word is an immediate + unsigned word; +}; + // // SPIR-V IR instruction. // @@ -88,8 +93,14 @@ class Instruction { Instruction(Id resultId, Id typeId, Op opCode) : resultId(resultId), typeId(typeId), opCode(opCode), block(nullptr) { } explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode), block(nullptr) { } virtual ~Instruction() {} - void addIdOperand(Id id) { operands.push_back(id); } - void addImmediateOperand(unsigned int immediate) { operands.push_back(immediate); } + void addIdOperand(Id id) { + operands.push_back(id); + idOperand.push_back(true); + } + void addImmediateOperand(unsigned int immediate) { + operands.push_back(immediate); + idOperand.push_back(false); + } void addStringOperand(const char* str) { unsigned int word; @@ -116,14 +127,25 @@ class Instruction { addImmediateOperand(word); } } + bool isIdOperand(int op) const { return idOperand[op]; } void setBlock(Block* b) { block = b; } Block* getBlock() const { return block; } Op getOpCode() const { return opCode; } - int getNumOperands() const { return (int)operands.size(); } + int getNumOperands() const + { + assert(operands.size() == idOperand.size()); + return (int)operands.size(); + } Id getResultId() const { return resultId; } Id getTypeId() const { return typeId; } - Id getIdOperand(int op) const { return operands[op]; } - unsigned int getImmediateOperand(int op) const { return operands[op]; } + Id getIdOperand(int op) const { + assert(idOperand[op]); + return operands[op]; + } + unsigned int getImmediateOperand(int op) const { + assert(!idOperand[op]); + return operands[op]; + } // Write out the binary form. void dump(std::vector& out) const @@ -153,7 +175,8 @@ class Instruction { Id resultId; Id typeId; Op opCode; - std::vector operands; + std::vector operands; // operands, both and immediates (both are unsigned int) + std::vector idOperand; // true for operands that are , false for immediates Block* block; }; @@ -258,7 +281,8 @@ class Function { delete blocks[i]; } Id getId() const { return functionInstruction.getResultId(); } - Id getParamId(int p) { return parameterInstructions[p]->getResultId(); } + Id getParamId(int p) const { return parameterInstructions[p]->getResultId(); } + Id getParamType(int p) const { return parameterInstructions[p]->getTypeId(); } void addBlock(Block* block) { blocks.push_back(block); } void removeBlock(Block* block) @@ -330,7 +354,9 @@ class Module { Instruction* getInstruction(Id id) const { return idToInstruction[id]; } const std::vector& getFunctions() const { return functions; } - spv::Id getTypeId(Id resultId) const { return idToInstruction[resultId]->getTypeId(); } + spv::Id getTypeId(Id resultId) const { + return idToInstruction[resultId] == nullptr ? NoType : idToInstruction[resultId]->getTypeId(); + } StorageClass getStorageClass(Id typeId) const { assert(idToInstruction[typeId]->getOpCode() == spv::OpTypePointer); diff --git a/deps/glslang/StandAlone/CMakeLists.txt b/deps/glslang/StandAlone/CMakeLists.txt new file mode 100644 index 00000000..5cea53d9 --- /dev/null +++ b/deps/glslang/StandAlone/CMakeLists.txt @@ -0,0 +1,53 @@ +add_library(glslang-default-resource-limits + ${CMAKE_CURRENT_SOURCE_DIR}/ResourceLimits.cpp) +set_property(TARGET glslang-default-resource-limits PROPERTY FOLDER glslang) +set_property(TARGET glslang-default-resource-limits PROPERTY POSITION_INDEPENDENT_CODE ON) + +target_include_directories(glslang-default-resource-limits + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} + PUBLIC ${PROJECT_SOURCE_DIR}) + +set(SOURCES StandAlone.cpp DirStackFileIncluder.h) +set(REMAPPER_SOURCES spirv-remap.cpp) + +add_executable(glslangValidator ${SOURCES}) +add_executable(spirv-remap ${REMAPPER_SOURCES}) +set_property(TARGET glslangValidator PROPERTY FOLDER tools) +set_property(TARGET spirv-remap PROPERTY FOLDER tools) +glslang_set_link_args(glslangValidator) +glslang_set_link_args(spirv-remap) + +set(LIBRARIES + glslang + SPIRV + SPVRemapper + glslang-default-resource-limits) + +if(WIN32) + set(LIBRARIES ${LIBRARIES} psapi) +elseif(UNIX) + if(NOT ANDROID) + set(LIBRARIES ${LIBRARIES} pthread) + endif() +endif(WIN32) + +target_link_libraries(glslangValidator ${LIBRARIES}) +target_link_libraries(spirv-remap ${LIBRARIES}) +target_include_directories(glslangValidator PUBLIC ../External) + +if(WIN32) + source_group("Source" FILES ${SOURCES}) +endif(WIN32) + +if(ENABLE_GLSLANG_INSTALL) + install(TARGETS glslangValidator + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + install(TARGETS spirv-remap + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if(BUILD_SHARED_LIBS) + install(TARGETS glslang-default-resource-limits + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() +endif(ENABLE_GLSLANG_INSTALL) diff --git a/deps/glslang/StandAlone/DirStackFileIncluder.h b/deps/glslang/StandAlone/DirStackFileIncluder.h new file mode 100644 index 00000000..18734130 --- /dev/null +++ b/deps/glslang/StandAlone/DirStackFileIncluder.h @@ -0,0 +1,141 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2017 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#pragma once + +#include +#include +#include +#include + +#include "./../glslang/Public/ShaderLang.h" + +// Default include class for normal include convention of search backward +// through the stack of active include paths (for nested includes). +// Can be overridden to customize. +class DirStackFileIncluder : public glslang::TShader::Includer { +public: + DirStackFileIncluder() : externalLocalDirectoryCount(0) { } + + virtual IncludeResult* includeLocal(const char* headerName, + const char* includerName, + size_t inclusionDepth) override + { + return readLocalPath(headerName, includerName, (int)inclusionDepth); + } + + virtual IncludeResult* includeSystem(const char* headerName, + const char* /*includerName*/, + size_t /*inclusionDepth*/) override + { + return readSystemPath(headerName); + } + + // Externally set directories. E.g., from a command-line -I

. + // - Most-recently pushed are checked first. + // - All these are checked after the parse-time stack of local directories + // is checked. + // - This only applies to the "local" form of #include. + // - Makes its own copy of the path. + virtual void pushExternalLocalDirectory(const std::string& dir) + { + directoryStack.push_back(dir); + externalLocalDirectoryCount = (int)directoryStack.size(); + } + + virtual void releaseInclude(IncludeResult* result) override + { + if (result != nullptr) { + delete [] static_cast(result->userData); + delete result; + } + } + + virtual ~DirStackFileIncluder() override { } + +protected: + typedef char tUserDataElement; + std::vector directoryStack; + int externalLocalDirectoryCount; + + // Search for a valid "local" path based on combining the stack of include + // directories and the nominal name of the header. + virtual IncludeResult* readLocalPath(const char* headerName, const char* includerName, int depth) + { + // Discard popped include directories, and + // initialize when at parse-time first level. + directoryStack.resize(depth + externalLocalDirectoryCount); + if (depth == 1) + directoryStack.back() = getDirectory(includerName); + + // Find a directory that works, using a reverse search of the include stack. + for (auto it = directoryStack.rbegin(); it != directoryStack.rend(); ++it) { + std::string path = *it + '/' + headerName; + std::replace(path.begin(), path.end(), '\\', '/'); + std::ifstream file(path, std::ios_base::binary | std::ios_base::ate); + if (file) { + directoryStack.push_back(getDirectory(path)); + return newIncludeResult(path, file, (int)file.tellg()); + } + } + + return nullptr; + } + + // Search for a valid path. + // Not implemented yet; returning nullptr signals failure to find. + virtual IncludeResult* readSystemPath(const char* /*headerName*/) const + { + return nullptr; + } + + // Do actual reading of the file, filling in a new include result. + virtual IncludeResult* newIncludeResult(const std::string& path, std::ifstream& file, int length) const + { + char* content = new tUserDataElement [length]; + file.seekg(0, file.beg); + file.read(content, length); + return new IncludeResult(path, content, length, content); + } + + // If no path markers, return current working directory. + // Otherwise, strip file name and return path leading up to it. + virtual std::string getDirectory(const std::string path) const + { + size_t last = path.find_last_of("/\\"); + return last == std::string::npos ? "." : path.substr(0, last); + } +}; diff --git a/deps/glslang/StandAlone/ResourceLimits.cpp b/deps/glslang/StandAlone/ResourceLimits.cpp new file mode 100644 index 00000000..66e79af9 --- /dev/null +++ b/deps/glslang/StandAlone/ResourceLimits.cpp @@ -0,0 +1,498 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include +#include + +#include "ResourceLimits.h" + +namespace glslang { + +const TBuiltInResource DefaultTBuiltInResource = { + /* .MaxLights = */ 32, + /* .MaxClipPlanes = */ 6, + /* .MaxTextureUnits = */ 32, + /* .MaxTextureCoords = */ 32, + /* .MaxVertexAttribs = */ 64, + /* .MaxVertexUniformComponents = */ 4096, + /* .MaxVaryingFloats = */ 64, + /* .MaxVertexTextureImageUnits = */ 32, + /* .MaxCombinedTextureImageUnits = */ 80, + /* .MaxTextureImageUnits = */ 32, + /* .MaxFragmentUniformComponents = */ 4096, + /* .MaxDrawBuffers = */ 32, + /* .MaxVertexUniformVectors = */ 128, + /* .MaxVaryingVectors = */ 8, + /* .MaxFragmentUniformVectors = */ 16, + /* .MaxVertexOutputVectors = */ 16, + /* .MaxFragmentInputVectors = */ 15, + /* .MinProgramTexelOffset = */ -8, + /* .MaxProgramTexelOffset = */ 7, + /* .MaxClipDistances = */ 8, + /* .MaxComputeWorkGroupCountX = */ 65535, + /* .MaxComputeWorkGroupCountY = */ 65535, + /* .MaxComputeWorkGroupCountZ = */ 65535, + /* .MaxComputeWorkGroupSizeX = */ 1024, + /* .MaxComputeWorkGroupSizeY = */ 1024, + /* .MaxComputeWorkGroupSizeZ = */ 64, + /* .MaxComputeUniformComponents = */ 1024, + /* .MaxComputeTextureImageUnits = */ 16, + /* .MaxComputeImageUniforms = */ 8, + /* .MaxComputeAtomicCounters = */ 8, + /* .MaxComputeAtomicCounterBuffers = */ 1, + /* .MaxVaryingComponents = */ 60, + /* .MaxVertexOutputComponents = */ 64, + /* .MaxGeometryInputComponents = */ 64, + /* .MaxGeometryOutputComponents = */ 128, + /* .MaxFragmentInputComponents = */ 128, + /* .MaxImageUnits = */ 8, + /* .MaxCombinedImageUnitsAndFragmentOutputs = */ 8, + /* .MaxCombinedShaderOutputResources = */ 8, + /* .MaxImageSamples = */ 0, + /* .MaxVertexImageUniforms = */ 0, + /* .MaxTessControlImageUniforms = */ 0, + /* .MaxTessEvaluationImageUniforms = */ 0, + /* .MaxGeometryImageUniforms = */ 0, + /* .MaxFragmentImageUniforms = */ 8, + /* .MaxCombinedImageUniforms = */ 8, + /* .MaxGeometryTextureImageUnits = */ 16, + /* .MaxGeometryOutputVertices = */ 256, + /* .MaxGeometryTotalOutputComponents = */ 1024, + /* .MaxGeometryUniformComponents = */ 1024, + /* .MaxGeometryVaryingComponents = */ 64, + /* .MaxTessControlInputComponents = */ 128, + /* .MaxTessControlOutputComponents = */ 128, + /* .MaxTessControlTextureImageUnits = */ 16, + /* .MaxTessControlUniformComponents = */ 1024, + /* .MaxTessControlTotalOutputComponents = */ 4096, + /* .MaxTessEvaluationInputComponents = */ 128, + /* .MaxTessEvaluationOutputComponents = */ 128, + /* .MaxTessEvaluationTextureImageUnits = */ 16, + /* .MaxTessEvaluationUniformComponents = */ 1024, + /* .MaxTessPatchComponents = */ 120, + /* .MaxPatchVertices = */ 32, + /* .MaxTessGenLevel = */ 64, + /* .MaxViewports = */ 16, + /* .MaxVertexAtomicCounters = */ 0, + /* .MaxTessControlAtomicCounters = */ 0, + /* .MaxTessEvaluationAtomicCounters = */ 0, + /* .MaxGeometryAtomicCounters = */ 0, + /* .MaxFragmentAtomicCounters = */ 8, + /* .MaxCombinedAtomicCounters = */ 8, + /* .MaxAtomicCounterBindings = */ 1, + /* .MaxVertexAtomicCounterBuffers = */ 0, + /* .MaxTessControlAtomicCounterBuffers = */ 0, + /* .MaxTessEvaluationAtomicCounterBuffers = */ 0, + /* .MaxGeometryAtomicCounterBuffers = */ 0, + /* .MaxFragmentAtomicCounterBuffers = */ 1, + /* .MaxCombinedAtomicCounterBuffers = */ 1, + /* .MaxAtomicCounterBufferSize = */ 16384, + /* .MaxTransformFeedbackBuffers = */ 4, + /* .MaxTransformFeedbackInterleavedComponents = */ 64, + /* .MaxCullDistances = */ 8, + /* .MaxCombinedClipAndCullDistances = */ 8, + /* .MaxSamples = */ 4, + /* .maxMeshOutputVerticesNV = */ 256, + /* .maxMeshOutputPrimitivesNV = */ 512, + /* .maxMeshWorkGroupSizeX_NV = */ 32, + /* .maxMeshWorkGroupSizeY_NV = */ 1, + /* .maxMeshWorkGroupSizeZ_NV = */ 1, + /* .maxTaskWorkGroupSizeX_NV = */ 32, + /* .maxTaskWorkGroupSizeY_NV = */ 1, + /* .maxTaskWorkGroupSizeZ_NV = */ 1, + /* .maxMeshViewCountNV = */ 4, + + /* .limits = */ { + /* .nonInductiveForLoops = */ 1, + /* .whileLoops = */ 1, + /* .doWhileLoops = */ 1, + /* .generalUniformIndexing = */ 1, + /* .generalAttributeMatrixVectorIndexing = */ 1, + /* .generalVaryingIndexing = */ 1, + /* .generalSamplerIndexing = */ 1, + /* .generalVariableIndexing = */ 1, + /* .generalConstantMatrixVectorIndexing = */ 1, + }}; + +std::string GetDefaultTBuiltInResourceString() +{ + std::ostringstream ostream; + + ostream << "MaxLights " << DefaultTBuiltInResource.maxLights << "\n" + << "MaxClipPlanes " << DefaultTBuiltInResource.maxClipPlanes << "\n" + << "MaxTextureUnits " << DefaultTBuiltInResource.maxTextureUnits << "\n" + << "MaxTextureCoords " << DefaultTBuiltInResource.maxTextureCoords << "\n" + << "MaxVertexAttribs " << DefaultTBuiltInResource.maxVertexAttribs << "\n" + << "MaxVertexUniformComponents " << DefaultTBuiltInResource.maxVertexUniformComponents << "\n" + << "MaxVaryingFloats " << DefaultTBuiltInResource.maxVaryingFloats << "\n" + << "MaxVertexTextureImageUnits " << DefaultTBuiltInResource.maxVertexTextureImageUnits << "\n" + << "MaxCombinedTextureImageUnits " << DefaultTBuiltInResource.maxCombinedTextureImageUnits << "\n" + << "MaxTextureImageUnits " << DefaultTBuiltInResource.maxTextureImageUnits << "\n" + << "MaxFragmentUniformComponents " << DefaultTBuiltInResource.maxFragmentUniformComponents << "\n" + << "MaxDrawBuffers " << DefaultTBuiltInResource.maxDrawBuffers << "\n" + << "MaxVertexUniformVectors " << DefaultTBuiltInResource.maxVertexUniformVectors << "\n" + << "MaxVaryingVectors " << DefaultTBuiltInResource.maxVaryingVectors << "\n" + << "MaxFragmentUniformVectors " << DefaultTBuiltInResource.maxFragmentUniformVectors << "\n" + << "MaxVertexOutputVectors " << DefaultTBuiltInResource.maxVertexOutputVectors << "\n" + << "MaxFragmentInputVectors " << DefaultTBuiltInResource.maxFragmentInputVectors << "\n" + << "MinProgramTexelOffset " << DefaultTBuiltInResource.minProgramTexelOffset << "\n" + << "MaxProgramTexelOffset " << DefaultTBuiltInResource.maxProgramTexelOffset << "\n" + << "MaxClipDistances " << DefaultTBuiltInResource.maxClipDistances << "\n" + << "MaxComputeWorkGroupCountX " << DefaultTBuiltInResource.maxComputeWorkGroupCountX << "\n" + << "MaxComputeWorkGroupCountY " << DefaultTBuiltInResource.maxComputeWorkGroupCountY << "\n" + << "MaxComputeWorkGroupCountZ " << DefaultTBuiltInResource.maxComputeWorkGroupCountZ << "\n" + << "MaxComputeWorkGroupSizeX " << DefaultTBuiltInResource.maxComputeWorkGroupSizeX << "\n" + << "MaxComputeWorkGroupSizeY " << DefaultTBuiltInResource.maxComputeWorkGroupSizeY << "\n" + << "MaxComputeWorkGroupSizeZ " << DefaultTBuiltInResource.maxComputeWorkGroupSizeZ << "\n" + << "MaxComputeUniformComponents " << DefaultTBuiltInResource.maxComputeUniformComponents << "\n" + << "MaxComputeTextureImageUnits " << DefaultTBuiltInResource.maxComputeTextureImageUnits << "\n" + << "MaxComputeImageUniforms " << DefaultTBuiltInResource.maxComputeImageUniforms << "\n" + << "MaxComputeAtomicCounters " << DefaultTBuiltInResource.maxComputeAtomicCounters << "\n" + << "MaxComputeAtomicCounterBuffers " << DefaultTBuiltInResource.maxComputeAtomicCounterBuffers << "\n" + << "MaxVaryingComponents " << DefaultTBuiltInResource.maxVaryingComponents << "\n" + << "MaxVertexOutputComponents " << DefaultTBuiltInResource.maxVertexOutputComponents << "\n" + << "MaxGeometryInputComponents " << DefaultTBuiltInResource.maxGeometryInputComponents << "\n" + << "MaxGeometryOutputComponents " << DefaultTBuiltInResource.maxGeometryOutputComponents << "\n" + << "MaxFragmentInputComponents " << DefaultTBuiltInResource.maxFragmentInputComponents << "\n" + << "MaxImageUnits " << DefaultTBuiltInResource.maxImageUnits << "\n" + << "MaxCombinedImageUnitsAndFragmentOutputs " << DefaultTBuiltInResource.maxCombinedImageUnitsAndFragmentOutputs << "\n" + << "MaxCombinedShaderOutputResources " << DefaultTBuiltInResource.maxCombinedShaderOutputResources << "\n" + << "MaxImageSamples " << DefaultTBuiltInResource.maxImageSamples << "\n" + << "MaxVertexImageUniforms " << DefaultTBuiltInResource.maxVertexImageUniforms << "\n" + << "MaxTessControlImageUniforms " << DefaultTBuiltInResource.maxTessControlImageUniforms << "\n" + << "MaxTessEvaluationImageUniforms " << DefaultTBuiltInResource.maxTessEvaluationImageUniforms << "\n" + << "MaxGeometryImageUniforms " << DefaultTBuiltInResource.maxGeometryImageUniforms << "\n" + << "MaxFragmentImageUniforms " << DefaultTBuiltInResource.maxFragmentImageUniforms << "\n" + << "MaxCombinedImageUniforms " << DefaultTBuiltInResource.maxCombinedImageUniforms << "\n" + << "MaxGeometryTextureImageUnits " << DefaultTBuiltInResource.maxGeometryTextureImageUnits << "\n" + << "MaxGeometryOutputVertices " << DefaultTBuiltInResource.maxGeometryOutputVertices << "\n" + << "MaxGeometryTotalOutputComponents " << DefaultTBuiltInResource.maxGeometryTotalOutputComponents << "\n" + << "MaxGeometryUniformComponents " << DefaultTBuiltInResource.maxGeometryUniformComponents << "\n" + << "MaxGeometryVaryingComponents " << DefaultTBuiltInResource.maxGeometryVaryingComponents << "\n" + << "MaxTessControlInputComponents " << DefaultTBuiltInResource.maxTessControlInputComponents << "\n" + << "MaxTessControlOutputComponents " << DefaultTBuiltInResource.maxTessControlOutputComponents << "\n" + << "MaxTessControlTextureImageUnits " << DefaultTBuiltInResource.maxTessControlTextureImageUnits << "\n" + << "MaxTessControlUniformComponents " << DefaultTBuiltInResource.maxTessControlUniformComponents << "\n" + << "MaxTessControlTotalOutputComponents " << DefaultTBuiltInResource.maxTessControlTotalOutputComponents << "\n" + << "MaxTessEvaluationInputComponents " << DefaultTBuiltInResource.maxTessEvaluationInputComponents << "\n" + << "MaxTessEvaluationOutputComponents " << DefaultTBuiltInResource.maxTessEvaluationOutputComponents << "\n" + << "MaxTessEvaluationTextureImageUnits " << DefaultTBuiltInResource.maxTessEvaluationTextureImageUnits << "\n" + << "MaxTessEvaluationUniformComponents " << DefaultTBuiltInResource.maxTessEvaluationUniformComponents << "\n" + << "MaxTessPatchComponents " << DefaultTBuiltInResource.maxTessPatchComponents << "\n" + << "MaxPatchVertices " << DefaultTBuiltInResource.maxPatchVertices << "\n" + << "MaxTessGenLevel " << DefaultTBuiltInResource.maxTessGenLevel << "\n" + << "MaxViewports " << DefaultTBuiltInResource.maxViewports << "\n" + << "MaxVertexAtomicCounters " << DefaultTBuiltInResource.maxVertexAtomicCounters << "\n" + << "MaxTessControlAtomicCounters " << DefaultTBuiltInResource.maxTessControlAtomicCounters << "\n" + << "MaxTessEvaluationAtomicCounters " << DefaultTBuiltInResource.maxTessEvaluationAtomicCounters << "\n" + << "MaxGeometryAtomicCounters " << DefaultTBuiltInResource.maxGeometryAtomicCounters << "\n" + << "MaxFragmentAtomicCounters " << DefaultTBuiltInResource.maxFragmentAtomicCounters << "\n" + << "MaxCombinedAtomicCounters " << DefaultTBuiltInResource.maxCombinedAtomicCounters << "\n" + << "MaxAtomicCounterBindings " << DefaultTBuiltInResource.maxAtomicCounterBindings << "\n" + << "MaxVertexAtomicCounterBuffers " << DefaultTBuiltInResource.maxVertexAtomicCounterBuffers << "\n" + << "MaxTessControlAtomicCounterBuffers " << DefaultTBuiltInResource.maxTessControlAtomicCounterBuffers << "\n" + << "MaxTessEvaluationAtomicCounterBuffers " << DefaultTBuiltInResource.maxTessEvaluationAtomicCounterBuffers << "\n" + << "MaxGeometryAtomicCounterBuffers " << DefaultTBuiltInResource.maxGeometryAtomicCounterBuffers << "\n" + << "MaxFragmentAtomicCounterBuffers " << DefaultTBuiltInResource.maxFragmentAtomicCounterBuffers << "\n" + << "MaxCombinedAtomicCounterBuffers " << DefaultTBuiltInResource.maxCombinedAtomicCounterBuffers << "\n" + << "MaxAtomicCounterBufferSize " << DefaultTBuiltInResource.maxAtomicCounterBufferSize << "\n" + << "MaxTransformFeedbackBuffers " << DefaultTBuiltInResource.maxTransformFeedbackBuffers << "\n" + << "MaxTransformFeedbackInterleavedComponents " << DefaultTBuiltInResource.maxTransformFeedbackInterleavedComponents << "\n" + << "MaxCullDistances " << DefaultTBuiltInResource.maxCullDistances << "\n" + << "MaxCombinedClipAndCullDistances " << DefaultTBuiltInResource.maxCombinedClipAndCullDistances << "\n" + << "MaxSamples " << DefaultTBuiltInResource.maxSamples << "\n" +#ifdef NV_EXTENSIONS + << "MaxMeshOutputVerticesNV " << DefaultTBuiltInResource.maxMeshOutputVerticesNV << "\n" + << "MaxMeshOutputPrimitivesNV " << DefaultTBuiltInResource.maxMeshOutputPrimitivesNV << "\n" + << "MaxMeshWorkGroupSizeX_NV " << DefaultTBuiltInResource.maxMeshWorkGroupSizeX_NV << "\n" + << "MaxMeshWorkGroupSizeY_NV " << DefaultTBuiltInResource.maxMeshWorkGroupSizeY_NV << "\n" + << "MaxMeshWorkGroupSizeZ_NV " << DefaultTBuiltInResource.maxMeshWorkGroupSizeZ_NV << "\n" + << "MaxTaskWorkGroupSizeX_NV " << DefaultTBuiltInResource.maxTaskWorkGroupSizeX_NV << "\n" + << "MaxTaskWorkGroupSizeY_NV " << DefaultTBuiltInResource.maxTaskWorkGroupSizeY_NV << "\n" + << "MaxTaskWorkGroupSizeZ_NV " << DefaultTBuiltInResource.maxTaskWorkGroupSizeZ_NV << "\n" + << "MaxMeshViewCountNV " << DefaultTBuiltInResource.maxMeshViewCountNV << "\n" +#endif + << "nonInductiveForLoops " << DefaultTBuiltInResource.limits.nonInductiveForLoops << "\n" + << "whileLoops " << DefaultTBuiltInResource.limits.whileLoops << "\n" + << "doWhileLoops " << DefaultTBuiltInResource.limits.doWhileLoops << "\n" + << "generalUniformIndexing " << DefaultTBuiltInResource.limits.generalUniformIndexing << "\n" + << "generalAttributeMatrixVectorIndexing " << DefaultTBuiltInResource.limits.generalAttributeMatrixVectorIndexing << "\n" + << "generalVaryingIndexing " << DefaultTBuiltInResource.limits.generalVaryingIndexing << "\n" + << "generalSamplerIndexing " << DefaultTBuiltInResource.limits.generalSamplerIndexing << "\n" + << "generalVariableIndexing " << DefaultTBuiltInResource.limits.generalVariableIndexing << "\n" + << "generalConstantMatrixVectorIndexing " << DefaultTBuiltInResource.limits.generalConstantMatrixVectorIndexing << "\n" + ; + + return ostream.str(); +} + +void DecodeResourceLimits(TBuiltInResource* resources, char* config) +{ + static const char* delims = " \t\n\r"; + + size_t pos = 0; + std::string configStr(config); + + while ((pos = configStr.find_first_not_of(delims, pos)) != std::string::npos) { + const size_t token_s = pos; + const size_t token_e = configStr.find_first_of(delims, token_s); + const size_t value_s = configStr.find_first_not_of(delims, token_e); + const size_t value_e = configStr.find_first_of(delims, value_s); + pos = value_e; + + // Faster to use compare(), but prefering readability. + const std::string tokenStr = configStr.substr(token_s, token_e-token_s); + const std::string valueStr = configStr.substr(value_s, value_e-value_s); + + if (value_s == std::string::npos || ! (valueStr[0] == '-' || isdigit(valueStr[0]))) { + printf("Error: '%s' bad .conf file. Each name must be followed by one number.\n", + valueStr.c_str()); + return; + } + + const int value = std::atoi(valueStr.c_str()); + + if (tokenStr == "MaxLights") + resources->maxLights = value; + else if (tokenStr == "MaxClipPlanes") + resources->maxClipPlanes = value; + else if (tokenStr == "MaxTextureUnits") + resources->maxTextureUnits = value; + else if (tokenStr == "MaxTextureCoords") + resources->maxTextureCoords = value; + else if (tokenStr == "MaxVertexAttribs") + resources->maxVertexAttribs = value; + else if (tokenStr == "MaxVertexUniformComponents") + resources->maxVertexUniformComponents = value; + else if (tokenStr == "MaxVaryingFloats") + resources->maxVaryingFloats = value; + else if (tokenStr == "MaxVertexTextureImageUnits") + resources->maxVertexTextureImageUnits = value; + else if (tokenStr == "MaxCombinedTextureImageUnits") + resources->maxCombinedTextureImageUnits = value; + else if (tokenStr == "MaxTextureImageUnits") + resources->maxTextureImageUnits = value; + else if (tokenStr == "MaxFragmentUniformComponents") + resources->maxFragmentUniformComponents = value; + else if (tokenStr == "MaxDrawBuffers") + resources->maxDrawBuffers = value; + else if (tokenStr == "MaxVertexUniformVectors") + resources->maxVertexUniformVectors = value; + else if (tokenStr == "MaxVaryingVectors") + resources->maxVaryingVectors = value; + else if (tokenStr == "MaxFragmentUniformVectors") + resources->maxFragmentUniformVectors = value; + else if (tokenStr == "MaxVertexOutputVectors") + resources->maxVertexOutputVectors = value; + else if (tokenStr == "MaxFragmentInputVectors") + resources->maxFragmentInputVectors = value; + else if (tokenStr == "MinProgramTexelOffset") + resources->minProgramTexelOffset = value; + else if (tokenStr == "MaxProgramTexelOffset") + resources->maxProgramTexelOffset = value; + else if (tokenStr == "MaxClipDistances") + resources->maxClipDistances = value; + else if (tokenStr == "MaxComputeWorkGroupCountX") + resources->maxComputeWorkGroupCountX = value; + else if (tokenStr == "MaxComputeWorkGroupCountY") + resources->maxComputeWorkGroupCountY = value; + else if (tokenStr == "MaxComputeWorkGroupCountZ") + resources->maxComputeWorkGroupCountZ = value; + else if (tokenStr == "MaxComputeWorkGroupSizeX") + resources->maxComputeWorkGroupSizeX = value; + else if (tokenStr == "MaxComputeWorkGroupSizeY") + resources->maxComputeWorkGroupSizeY = value; + else if (tokenStr == "MaxComputeWorkGroupSizeZ") + resources->maxComputeWorkGroupSizeZ = value; + else if (tokenStr == "MaxComputeUniformComponents") + resources->maxComputeUniformComponents = value; + else if (tokenStr == "MaxComputeTextureImageUnits") + resources->maxComputeTextureImageUnits = value; + else if (tokenStr == "MaxComputeImageUniforms") + resources->maxComputeImageUniforms = value; + else if (tokenStr == "MaxComputeAtomicCounters") + resources->maxComputeAtomicCounters = value; + else if (tokenStr == "MaxComputeAtomicCounterBuffers") + resources->maxComputeAtomicCounterBuffers = value; + else if (tokenStr == "MaxVaryingComponents") + resources->maxVaryingComponents = value; + else if (tokenStr == "MaxVertexOutputComponents") + resources->maxVertexOutputComponents = value; + else if (tokenStr == "MaxGeometryInputComponents") + resources->maxGeometryInputComponents = value; + else if (tokenStr == "MaxGeometryOutputComponents") + resources->maxGeometryOutputComponents = value; + else if (tokenStr == "MaxFragmentInputComponents") + resources->maxFragmentInputComponents = value; + else if (tokenStr == "MaxImageUnits") + resources->maxImageUnits = value; + else if (tokenStr == "MaxCombinedImageUnitsAndFragmentOutputs") + resources->maxCombinedImageUnitsAndFragmentOutputs = value; + else if (tokenStr == "MaxCombinedShaderOutputResources") + resources->maxCombinedShaderOutputResources = value; + else if (tokenStr == "MaxImageSamples") + resources->maxImageSamples = value; + else if (tokenStr == "MaxVertexImageUniforms") + resources->maxVertexImageUniforms = value; + else if (tokenStr == "MaxTessControlImageUniforms") + resources->maxTessControlImageUniforms = value; + else if (tokenStr == "MaxTessEvaluationImageUniforms") + resources->maxTessEvaluationImageUniforms = value; + else if (tokenStr == "MaxGeometryImageUniforms") + resources->maxGeometryImageUniforms = value; + else if (tokenStr == "MaxFragmentImageUniforms") + resources->maxFragmentImageUniforms = value; + else if (tokenStr == "MaxCombinedImageUniforms") + resources->maxCombinedImageUniforms = value; + else if (tokenStr == "MaxGeometryTextureImageUnits") + resources->maxGeometryTextureImageUnits = value; + else if (tokenStr == "MaxGeometryOutputVertices") + resources->maxGeometryOutputVertices = value; + else if (tokenStr == "MaxGeometryTotalOutputComponents") + resources->maxGeometryTotalOutputComponents = value; + else if (tokenStr == "MaxGeometryUniformComponents") + resources->maxGeometryUniformComponents = value; + else if (tokenStr == "MaxGeometryVaryingComponents") + resources->maxGeometryVaryingComponents = value; + else if (tokenStr == "MaxTessControlInputComponents") + resources->maxTessControlInputComponents = value; + else if (tokenStr == "MaxTessControlOutputComponents") + resources->maxTessControlOutputComponents = value; + else if (tokenStr == "MaxTessControlTextureImageUnits") + resources->maxTessControlTextureImageUnits = value; + else if (tokenStr == "MaxTessControlUniformComponents") + resources->maxTessControlUniformComponents = value; + else if (tokenStr == "MaxTessControlTotalOutputComponents") + resources->maxTessControlTotalOutputComponents = value; + else if (tokenStr == "MaxTessEvaluationInputComponents") + resources->maxTessEvaluationInputComponents = value; + else if (tokenStr == "MaxTessEvaluationOutputComponents") + resources->maxTessEvaluationOutputComponents = value; + else if (tokenStr == "MaxTessEvaluationTextureImageUnits") + resources->maxTessEvaluationTextureImageUnits = value; + else if (tokenStr == "MaxTessEvaluationUniformComponents") + resources->maxTessEvaluationUniformComponents = value; + else if (tokenStr == "MaxTessPatchComponents") + resources->maxTessPatchComponents = value; + else if (tokenStr == "MaxPatchVertices") + resources->maxPatchVertices = value; + else if (tokenStr == "MaxTessGenLevel") + resources->maxTessGenLevel = value; + else if (tokenStr == "MaxViewports") + resources->maxViewports = value; + else if (tokenStr == "MaxVertexAtomicCounters") + resources->maxVertexAtomicCounters = value; + else if (tokenStr == "MaxTessControlAtomicCounters") + resources->maxTessControlAtomicCounters = value; + else if (tokenStr == "MaxTessEvaluationAtomicCounters") + resources->maxTessEvaluationAtomicCounters = value; + else if (tokenStr == "MaxGeometryAtomicCounters") + resources->maxGeometryAtomicCounters = value; + else if (tokenStr == "MaxFragmentAtomicCounters") + resources->maxFragmentAtomicCounters = value; + else if (tokenStr == "MaxCombinedAtomicCounters") + resources->maxCombinedAtomicCounters = value; + else if (tokenStr == "MaxAtomicCounterBindings") + resources->maxAtomicCounterBindings = value; + else if (tokenStr == "MaxVertexAtomicCounterBuffers") + resources->maxVertexAtomicCounterBuffers = value; + else if (tokenStr == "MaxTessControlAtomicCounterBuffers") + resources->maxTessControlAtomicCounterBuffers = value; + else if (tokenStr == "MaxTessEvaluationAtomicCounterBuffers") + resources->maxTessEvaluationAtomicCounterBuffers = value; + else if (tokenStr == "MaxGeometryAtomicCounterBuffers") + resources->maxGeometryAtomicCounterBuffers = value; + else if (tokenStr == "MaxFragmentAtomicCounterBuffers") + resources->maxFragmentAtomicCounterBuffers = value; + else if (tokenStr == "MaxCombinedAtomicCounterBuffers") + resources->maxCombinedAtomicCounterBuffers = value; + else if (tokenStr == "MaxAtomicCounterBufferSize") + resources->maxAtomicCounterBufferSize = value; + else if (tokenStr == "MaxTransformFeedbackBuffers") + resources->maxTransformFeedbackBuffers = value; + else if (tokenStr == "MaxTransformFeedbackInterleavedComponents") + resources->maxTransformFeedbackInterleavedComponents = value; + else if (tokenStr == "MaxCullDistances") + resources->maxCullDistances = value; + else if (tokenStr == "MaxCombinedClipAndCullDistances") + resources->maxCombinedClipAndCullDistances = value; + else if (tokenStr == "MaxSamples") + resources->maxSamples = value; +#ifdef NV_EXTENSIONS + else if (tokenStr == "MaxMeshOutputVerticesNV") + resources->maxMeshOutputVerticesNV = value; + else if (tokenStr == "MaxMeshOutputPrimitivesNV") + resources->maxMeshOutputPrimitivesNV = value; + else if (tokenStr == "MaxMeshWorkGroupSizeX_NV") + resources->maxMeshWorkGroupSizeX_NV = value; + else if (tokenStr == "MaxMeshWorkGroupSizeY_NV") + resources->maxMeshWorkGroupSizeY_NV = value; + else if (tokenStr == "MaxMeshWorkGroupSizeZ_NV") + resources->maxMeshWorkGroupSizeZ_NV = value; + else if (tokenStr == "MaxTaskWorkGroupSizeX_NV") + resources->maxTaskWorkGroupSizeX_NV = value; + else if (tokenStr == "MaxTaskWorkGroupSizeY_NV") + resources->maxTaskWorkGroupSizeY_NV = value; + else if (tokenStr == "MaxTaskWorkGroupSizeZ_NV") + resources->maxTaskWorkGroupSizeZ_NV = value; + else if (tokenStr == "MaxMeshViewCountNV") + resources->maxMeshViewCountNV = value; +#endif + else if (tokenStr == "nonInductiveForLoops") + resources->limits.nonInductiveForLoops = (value != 0); + else if (tokenStr == "whileLoops") + resources->limits.whileLoops = (value != 0); + else if (tokenStr == "doWhileLoops") + resources->limits.doWhileLoops = (value != 0); + else if (tokenStr == "generalUniformIndexing") + resources->limits.generalUniformIndexing = (value != 0); + else if (tokenStr == "generalAttributeMatrixVectorIndexing") + resources->limits.generalAttributeMatrixVectorIndexing = (value != 0); + else if (tokenStr == "generalVaryingIndexing") + resources->limits.generalVaryingIndexing = (value != 0); + else if (tokenStr == "generalSamplerIndexing") + resources->limits.generalSamplerIndexing = (value != 0); + else if (tokenStr == "generalVariableIndexing") + resources->limits.generalVariableIndexing = (value != 0); + else if (tokenStr == "generalConstantMatrixVectorIndexing") + resources->limits.generalConstantMatrixVectorIndexing = (value != 0); + else + printf("Warning: unrecognized limit (%s) in configuration file.\n", tokenStr.c_str()); + + } +} + +} // end namespace glslang diff --git a/deps/glslang/StandAlone/ResourceLimits.h b/deps/glslang/StandAlone/ResourceLimits.h new file mode 100644 index 00000000..9c3eb3e9 --- /dev/null +++ b/deps/glslang/StandAlone/ResourceLimits.h @@ -0,0 +1,57 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_ +#define _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_ + +#include + +#include "glslang/Include/ResourceLimits.h" + +namespace glslang { + +// These are the default resources for TBuiltInResources, used for both +// - parsing this string for the case where the user didn't supply one, +// - dumping out a template for user construction of a config file. +extern const TBuiltInResource DefaultTBuiltInResource; + +// Returns the DefaultTBuiltInResource as a human-readable string. +std::string GetDefaultTBuiltInResourceString(); + +// Decodes the resource limits from |config| to |resources|. +void DecodeResourceLimits(TBuiltInResource* resources, char* config); + +} // end namespace glslang + +#endif // _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_ diff --git a/deps/glslang/StandAlone/StandAlone.cpp b/deps/glslang/StandAlone/StandAlone.cpp new file mode 100644 index 00000000..060428bf --- /dev/null +++ b/deps/glslang/StandAlone/StandAlone.cpp @@ -0,0 +1,1644 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013-2016 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +// this only applies to the standalone wrapper, not the front end in general +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS +#endif + +#include "ResourceLimits.h" +#include "Worklist.h" +#include "DirStackFileIncluder.h" +#include "./../glslang/Include/ShHandle.h" +#include "./../glslang/Include/revision.h" +#include "./../glslang/Public/ShaderLang.h" +#include "../SPIRV/GlslangToSpv.h" +#include "../SPIRV/GLSL.std.450.h" +#include "../SPIRV/doc.h" +#include "../SPIRV/disassemble.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../glslang/OSDependent/osinclude.h" + +extern "C" { + SH_IMPORT_EXPORT void ShOutputHtml(); +} + +// Command-line options +enum TOptions { + EOptionNone = 0, + EOptionIntermediate = (1 << 0), + EOptionSuppressInfolog = (1 << 1), + EOptionMemoryLeakMode = (1 << 2), + EOptionRelaxedErrors = (1 << 3), + EOptionGiveWarnings = (1 << 4), + EOptionLinkProgram = (1 << 5), + EOptionMultiThreaded = (1 << 6), + EOptionDumpConfig = (1 << 7), + EOptionDumpReflection = (1 << 8), + EOptionSuppressWarnings = (1 << 9), + EOptionDumpVersions = (1 << 10), + EOptionSpv = (1 << 11), + EOptionHumanReadableSpv = (1 << 12), + EOptionVulkanRules = (1 << 13), + EOptionDefaultDesktop = (1 << 14), + EOptionOutputPreprocessed = (1 << 15), + EOptionOutputHexadecimal = (1 << 16), + EOptionReadHlsl = (1 << 17), + EOptionCascadingErrors = (1 << 18), + EOptionAutoMapBindings = (1 << 19), + EOptionFlattenUniformArrays = (1 << 20), + EOptionNoStorageFormat = (1 << 21), + EOptionKeepUncalled = (1 << 22), + EOptionHlslOffsets = (1 << 23), + EOptionHlslIoMapping = (1 << 24), + EOptionAutoMapLocations = (1 << 25), + EOptionDebug = (1 << 26), + EOptionStdin = (1 << 27), + EOptionOptimizeDisable = (1 << 28), + EOptionOptimizeSize = (1 << 29), + EOptionInvertY = (1 << 30), + EOptionDumpBareVersion = (1 << 31), +}; +bool targetHlslFunctionality1 = false; +bool SpvToolsDisassembler = false; +bool SpvToolsValidate = false; + +// +// Return codes from main/exit(). +// +enum TFailCode { + ESuccess = 0, + EFailUsage, + EFailCompile, + EFailLink, + EFailCompilerCreate, + EFailThreadCreate, + EFailLinkerCreate +}; + +// +// Forward declarations. +// +EShLanguage FindLanguage(const std::string& name, bool parseSuffix=true); +void CompileFile(const char* fileName, ShHandle); +void usage(); +char* ReadFileData(const char* fileName); +void FreeFileData(char* data); +void InfoLogMsg(const char* msg, const char* name, const int num); + +// Globally track if any compile or link failure. +bool CompileFailed = false; +bool LinkFailed = false; + +// array of unique places to leave the shader names and infologs for the asynchronous compiles +std::vector> WorkItems; + +TBuiltInResource Resources; +std::string ConfigFile; + +// +// Parse either a .conf file provided by the user or the default from glslang::DefaultTBuiltInResource +// +void ProcessConfigFile() +{ + if (ConfigFile.size() == 0) + Resources = glslang::DefaultTBuiltInResource; + else { + char* configString = ReadFileData(ConfigFile.c_str()); + glslang::DecodeResourceLimits(&Resources, configString); + FreeFileData(configString); + } +} + +int Options = 0; +const char* ExecutableName = nullptr; +const char* binaryFileName = nullptr; +const char* entryPointName = nullptr; +const char* sourceEntryPointName = nullptr; +const char* shaderStageName = nullptr; +const char* variableName = nullptr; +bool HlslEnable16BitTypes = false; +std::vector IncludeDirectoryList; + +// Source environment +// (source 'Client' is currently the same as target 'Client') +int ClientInputSemanticsVersion = 100; + +// Target environment +glslang::EShClient Client = glslang::EShClientNone; // will stay EShClientNone if only validating +glslang::EShTargetClientVersion ClientVersion; // not valid until Client is set +glslang::EShTargetLanguage TargetLanguage = glslang::EShTargetNone; +glslang::EShTargetLanguageVersion TargetVersion; // not valid until TargetLanguage is set + +std::vector Processes; // what should be recorded by OpModuleProcessed, or equivalent + +// Per descriptor-set binding base data +typedef std::map TPerSetBaseBinding; + +std::vector> uniformLocationOverrides; +int uniformBase = 0; + +std::array, glslang::EResCount> baseBinding; +std::array, glslang::EResCount> baseBindingForSet; +std::array, EShLangCount> baseResourceSetBinding; + +// Add things like "#define ..." to a preamble to use in the beginning of the shader. +class TPreamble { +public: + TPreamble() { } + + bool isSet() const { return text.size() > 0; } + const char* get() const { return text.c_str(); } + + // #define... + void addDef(std::string def) + { + text.append("#define "); + fixLine(def); + + Processes.push_back("D"); + Processes.back().append(def); + + // The first "=" needs to turn into a space + const size_t equal = def.find_first_of("="); + if (equal != def.npos) + def[equal] = ' '; + + text.append(def); + text.append("\n"); + } + + // #undef... + void addUndef(std::string undef) + { + text.append("#undef "); + fixLine(undef); + + Processes.push_back("U"); + Processes.back().append(undef); + + text.append(undef); + text.append("\n"); + } + +protected: + void fixLine(std::string& line) + { + // Can't go past a newline in the line + const size_t end = line.find_first_of("\n"); + if (end != line.npos) + line = line.substr(0, end); + } + + std::string text; // contents of preamble +}; + +TPreamble UserPreamble; + +// +// Create the default name for saving a binary if -o is not provided. +// +const char* GetBinaryName(EShLanguage stage) +{ + const char* name; + if (binaryFileName == nullptr) { + switch (stage) { + case EShLangVertex: name = "vert.spv"; break; + case EShLangTessControl: name = "tesc.spv"; break; + case EShLangTessEvaluation: name = "tese.spv"; break; + case EShLangGeometry: name = "geom.spv"; break; + case EShLangFragment: name = "frag.spv"; break; + case EShLangCompute: name = "comp.spv"; break; +#ifdef NV_EXTENSIONS + case EShLangRayGenNV: name = "rgen.spv"; break; + case EShLangIntersectNV: name = "rint.spv"; break; + case EShLangAnyHitNV: name = "rahit.spv"; break; + case EShLangClosestHitNV: name = "rchit.spv"; break; + case EShLangMissNV: name = "rmiss.spv"; break; + case EShLangCallableNV: name = "rcall.spv"; break; + case EShLangMeshNV: name = "mesh.spv"; break; + case EShLangTaskNV: name = "task.spv"; break; +#endif + default: name = "unknown"; break; + } + } else + name = binaryFileName; + + return name; +} + +// +// *.conf => this is a config file that can set limits/resources +// +bool SetConfigFile(const std::string& name) +{ + if (name.size() < 5) + return false; + + if (name.compare(name.size() - 5, 5, ".conf") == 0) { + ConfigFile = name; + return true; + } + + return false; +} + +// +// Give error and exit with failure code. +// +void Error(const char* message) +{ + fprintf(stderr, "%s: Error %s (use -h for usage)\n", ExecutableName, message); + exit(EFailUsage); +} + +// +// Process an optional binding base of one the forms: +// --argname [stage] base // base for stage (if given) or all stages (if not) +// --argname [stage] [base set]... // set/base pairs: set the base for given binding set. + +// Where stage is one of the forms accepted by FindLanguage, and base is an integer +// +void ProcessBindingBase(int& argc, char**& argv, glslang::TResourceType res) +{ + if (argc < 2) + usage(); + + EShLanguage lang = EShLangCount; + int singleBase = 0; + TPerSetBaseBinding perSetBase; + int arg = 1; + + // Parse stage, if given + if (!isdigit(argv[arg][0])) { + if (argc < 3) // this form needs one more argument + usage(); + + lang = FindLanguage(argv[arg++], false); + } + + if ((argc - arg) > 2 && isdigit(argv[arg+0][0]) && isdigit(argv[arg+1][0])) { + // Parse a per-set binding base + while ((argc - arg) > 2 && isdigit(argv[arg+0][0]) && isdigit(argv[arg+1][0])) { + const int baseNum = atoi(argv[arg++]); + const int setNum = atoi(argv[arg++]); + perSetBase[setNum] = baseNum; + } + } else { + // Parse single binding base + singleBase = atoi(argv[arg++]); + } + + argc -= (arg-1); + argv += (arg-1); + + // Set one or all languages + const int langMin = (lang < EShLangCount) ? lang+0 : 0; + const int langMax = (lang < EShLangCount) ? lang+1 : EShLangCount; + + for (int lang = langMin; lang < langMax; ++lang) { + if (!perSetBase.empty()) + baseBindingForSet[res][lang].insert(perSetBase.begin(), perSetBase.end()); + else + baseBinding[res][lang] = singleBase; + } +} + +void ProcessResourceSetBindingBase(int& argc, char**& argv, std::array, EShLangCount>& base) +{ + if (argc < 2) + usage(); + + if (!isdigit(argv[1][0])) { + if (argc < 3) // this form needs one more argument + usage(); + + // Parse form: --argname stage [regname set base...], or: + // --argname stage set + const EShLanguage lang = FindLanguage(argv[1], false); + + argc--; + argv++; + + while (argc > 1 && argv[1] != nullptr && argv[1][0] != '-') { + base[lang].push_back(argv[1]); + + argc--; + argv++; + } + + // Must have one arg, or a multiple of three (for [regname set binding] triples) + if (base[lang].size() != 1 && (base[lang].size() % 3) != 0) + usage(); + + } else { + // Parse form: --argname set + for (int lang=0; lang>& workItems, int argc, char* argv[]) +{ + for (int res = 0; res < glslang::EResCount; ++res) + baseBinding[res].fill(0); + + ExecutableName = argv[0]; + workItems.reserve(argc); + + const auto bumpArg = [&]() { + if (argc > 0) { + argc--; + argv++; + } + }; + + // read a string directly attached to a single-letter option + const auto getStringOperand = [&](const char* desc) { + if (argv[0][2] == 0) { + printf("%s must immediately follow option (no spaces)\n", desc); + exit(EFailUsage); + } + return argv[0] + 2; + }; + + // read a number attached to a single-letter option + const auto getAttachedNumber = [&](const char* desc) { + int num = atoi(argv[0] + 2); + if (num == 0) { + printf("%s: expected attached non-0 number\n", desc); + exit(EFailUsage); + } + return num; + }; + + // minimum needed (without overriding something else) to target Vulkan SPIR-V + const auto setVulkanSpv = []() { + if (Client == glslang::EShClientNone) + ClientVersion = glslang::EShTargetVulkan_1_0; + Client = glslang::EShClientVulkan; + Options |= EOptionSpv; + Options |= EOptionVulkanRules; + Options |= EOptionLinkProgram; + }; + + // minimum needed (without overriding something else) to target OpenGL SPIR-V + const auto setOpenGlSpv = []() { + if (Client == glslang::EShClientNone) + ClientVersion = glslang::EShTargetOpenGL_450; + Client = glslang::EShClientOpenGL; + Options |= EOptionSpv; + Options |= EOptionLinkProgram; + // undo a -H default to Vulkan + Options &= ~EOptionVulkanRules; + }; + + const auto getUniformOverride = [getStringOperand]() { + const char *arg = getStringOperand("-u:"); + const char *split = strchr(arg, ':'); + if (split == NULL) { + printf("%s: missing location\n", arg); + exit(EFailUsage); + } + errno = 0; + int location = ::strtol(split + 1, NULL, 10); + if (errno) { + printf("%s: invalid location\n", arg); + exit(EFailUsage); + } + return std::make_pair(std::string(arg, split - arg), location); + }; + + for (bumpArg(); argc >= 1; bumpArg()) { + if (argv[0][0] == '-') { + switch (argv[0][1]) { + case '-': + { + std::string lowerword(argv[0]+2); + std::transform(lowerword.begin(), lowerword.end(), lowerword.begin(), ::tolower); + + // handle --word style options + if (lowerword == "auto-map-bindings" || // synonyms + lowerword == "auto-map-binding" || + lowerword == "amb") { + Options |= EOptionAutoMapBindings; + } else if (lowerword == "auto-map-locations" || // synonyms + lowerword == "aml") { + Options |= EOptionAutoMapLocations; + } else if (lowerword == "uniform-base") { + if (argc <= 1) + Error("no provided for --uniform-base"); + uniformBase = ::strtol(argv[1], NULL, 10); + bumpArg(); + break; + } else if (lowerword == "client") { + if (argc > 1) { + if (strcmp(argv[1], "vulkan100") == 0) + setVulkanSpv(); + else if (strcmp(argv[1], "opengl100") == 0) + setOpenGlSpv(); + else + Error("--client expects vulkan100 or opengl100"); + } + bumpArg(); + } else if (lowerword == "entry-point") { + entryPointName = argv[1]; + if (argc <= 1) + Error("no provided for --entry-point"); + bumpArg(); + } else if (lowerword == "flatten-uniform-arrays" || // synonyms + lowerword == "flatten-uniform-array" || + lowerword == "fua") { + Options |= EOptionFlattenUniformArrays; + } else if (lowerword == "hlsl-offsets") { + Options |= EOptionHlslOffsets; + } else if (lowerword == "hlsl-iomap" || + lowerword == "hlsl-iomapper" || + lowerword == "hlsl-iomapping") { + Options |= EOptionHlslIoMapping; + } else if (lowerword == "hlsl-enable-16bit-types") { + HlslEnable16BitTypes = true; + } else if (lowerword == "invert-y" || // synonyms + lowerword == "iy") { + Options |= EOptionInvertY; + } else if (lowerword == "keep-uncalled" || // synonyms + lowerword == "ku") { + Options |= EOptionKeepUncalled; + } else if (lowerword == "no-storage-format" || // synonyms + lowerword == "nsf") { + Options |= EOptionNoStorageFormat; + } else if (lowerword == "relaxed-errors") { + Options |= EOptionRelaxedErrors; + } else if (lowerword == "resource-set-bindings" || // synonyms + lowerword == "resource-set-binding" || + lowerword == "rsb") { + ProcessResourceSetBindingBase(argc, argv, baseResourceSetBinding); + } else if (lowerword == "shift-image-bindings" || // synonyms + lowerword == "shift-image-binding" || + lowerword == "sib") { + ProcessBindingBase(argc, argv, glslang::EResImage); + } else if (lowerword == "shift-sampler-bindings" || // synonyms + lowerword == "shift-sampler-binding" || + lowerword == "ssb") { + ProcessBindingBase(argc, argv, glslang::EResSampler); + } else if (lowerword == "shift-uav-bindings" || // synonyms + lowerword == "shift-uav-binding" || + lowerword == "suavb") { + ProcessBindingBase(argc, argv, glslang::EResUav); + } else if (lowerword == "shift-texture-bindings" || // synonyms + lowerword == "shift-texture-binding" || + lowerword == "stb") { + ProcessBindingBase(argc, argv, glslang::EResTexture); + } else if (lowerword == "shift-ubo-bindings" || // synonyms + lowerword == "shift-ubo-binding" || + lowerword == "shift-cbuffer-bindings" || + lowerword == "shift-cbuffer-binding" || + lowerword == "sub" || + lowerword == "scb") { + ProcessBindingBase(argc, argv, glslang::EResUbo); + } else if (lowerword == "shift-ssbo-bindings" || // synonyms + lowerword == "shift-ssbo-binding" || + lowerword == "sbb") { + ProcessBindingBase(argc, argv, glslang::EResSsbo); + } else if (lowerword == "source-entrypoint" || // synonyms + lowerword == "sep") { + if (argc <= 1) + Error("no provided for --source-entrypoint"); + sourceEntryPointName = argv[1]; + bumpArg(); + break; + } else if (lowerword == "spirv-dis") { + SpvToolsDisassembler = true; + } else if (lowerword == "spirv-val") { + SpvToolsValidate = true; + } else if (lowerword == "stdin") { + Options |= EOptionStdin; + shaderStageName = argv[1]; + } else if (lowerword == "suppress-warnings") { + Options |= EOptionSuppressWarnings; + } else if (lowerword == "target-env") { + if (argc > 1) { + if (strcmp(argv[1], "vulkan1.0") == 0) { + setVulkanSpv(); + ClientVersion = glslang::EShTargetVulkan_1_0; + } else if (strcmp(argv[1], "vulkan1.1") == 0) { + setVulkanSpv(); + ClientVersion = glslang::EShTargetVulkan_1_1; + } else if (strcmp(argv[1], "opengl") == 0) { + setOpenGlSpv(); + ClientVersion = glslang::EShTargetOpenGL_450; + } else if (strcmp(argv[1], "spirv1.0") == 0) { + TargetLanguage = glslang::EShTargetSpv; + TargetVersion = glslang::EShTargetSpv_1_0; + } else if (strcmp(argv[1], "spirv1.1") == 0) { + TargetLanguage = glslang::EShTargetSpv; + TargetVersion = glslang::EShTargetSpv_1_1; + } else if (strcmp(argv[1], "spirv1.2") == 0) { + TargetLanguage = glslang::EShTargetSpv; + TargetVersion = glslang::EShTargetSpv_1_2; + } else if (strcmp(argv[1], "spirv1.3") == 0) { + TargetLanguage = glslang::EShTargetSpv; + TargetVersion = glslang::EShTargetSpv_1_3; + } else if (strcmp(argv[1], "spirv1.4") == 0) { + TargetLanguage = glslang::EShTargetSpv; + TargetVersion = glslang::EShTargetSpv_1_4; + } else + Error("--target-env expected one of: vulkan1.0, vulkan1.1, opengl, spirv1.0, spirv1.1, spirv1.2, or spirv1.3"); + } + bumpArg(); + } else if (lowerword == "variable-name" || // synonyms + lowerword == "vn") { + Options |= EOptionOutputHexadecimal; + if (argc <= 1) + Error("no provided for --variable-name"); + variableName = argv[1]; + bumpArg(); + break; + } else if (lowerword == "version") { + Options |= EOptionDumpVersions; + } else { + usage(); + } + } + break; + case 'C': + Options |= EOptionCascadingErrors; + break; + case 'D': + if (argv[0][2] == 0) + Options |= EOptionReadHlsl; + else + UserPreamble.addDef(getStringOperand("-D macro name")); + break; + case 'u': + uniformLocationOverrides.push_back(getUniformOverride()); + break; + case 'E': + Options |= EOptionOutputPreprocessed; + break; + case 'G': + // OpenGL client + setOpenGlSpv(); + if (argv[0][2] != 0) + ClientInputSemanticsVersion = getAttachedNumber("-G client input semantics"); + break; + case 'H': + Options |= EOptionHumanReadableSpv; + if ((Options & EOptionSpv) == 0) { + // default to Vulkan + setVulkanSpv(); + } + break; + case 'I': + IncludeDirectoryList.push_back(getStringOperand("-I include path")); + break; + case 'O': + if (argv[0][2] == 'd') + Options |= EOptionOptimizeDisable; + else if (argv[0][2] == 's') +#if ENABLE_OPT + Options |= EOptionOptimizeSize; +#else + Error("-Os not available; optimizer not linked"); +#endif + else + Error("unknown -O option"); + break; + case 'S': + if (argc <= 1) + Error("no specified for -S"); + shaderStageName = argv[1]; + bumpArg(); + break; + case 'U': + UserPreamble.addUndef(getStringOperand("-U: macro name")); + break; + case 'V': + setVulkanSpv(); + if (argv[0][2] != 0) + ClientInputSemanticsVersion = getAttachedNumber("-V client input semantics"); + break; + case 'c': + Options |= EOptionDumpConfig; + break; + case 'd': + if (strncmp(&argv[0][1], "dumpversion", strlen(&argv[0][1]) + 1) == 0 || + strncmp(&argv[0][1], "dumpfullversion", strlen(&argv[0][1]) + 1) == 0) + Options |= EOptionDumpBareVersion; + else + Options |= EOptionDefaultDesktop; + break; + case 'e': + entryPointName = argv[1]; + if (argc <= 1) + Error("no provided for -e"); + bumpArg(); + break; + case 'f': + if (strcmp(&argv[0][2], "hlsl_functionality1") == 0) + targetHlslFunctionality1 = true; + else + Error("-f: expected hlsl_functionality1"); + break; + case 'g': + Options |= EOptionDebug; + break; + case 'h': + usage(); + break; + case 'i': + Options |= EOptionIntermediate; + break; + case 'l': + Options |= EOptionLinkProgram; + break; + case 'm': + Options |= EOptionMemoryLeakMode; + break; + case 'o': + if (argc <= 1) + Error("no provided for -o"); + binaryFileName = argv[1]; + bumpArg(); + break; + case 'q': + Options |= EOptionDumpReflection; + break; + case 'r': + Options |= EOptionRelaxedErrors; + break; + case 's': + Options |= EOptionSuppressInfolog; + break; + case 't': + Options |= EOptionMultiThreaded; + break; + case 'v': + Options |= EOptionDumpVersions; + break; + case 'w': + Options |= EOptionSuppressWarnings; + break; + case 'x': + Options |= EOptionOutputHexadecimal; + break; + default: + usage(); + break; + } + } else { + std::string name(argv[0]); + if (! SetConfigFile(name)) { + workItems.push_back(std::unique_ptr(new glslang::TWorkItem(name))); + } + } + } + + // Make sure that -S is always specified if --stdin is specified + if ((Options & EOptionStdin) && shaderStageName == nullptr) + Error("must provide -S when --stdin is given"); + + // Make sure that -E is not specified alongside linking (which includes SPV generation) + if ((Options & EOptionOutputPreprocessed) && (Options & EOptionLinkProgram)) + Error("can't use -E when linking is selected"); + + // -o or -x makes no sense if there is no target binary + if (binaryFileName && (Options & EOptionSpv) == 0) + Error("no binary generation requested (e.g., -V)"); + + if ((Options & EOptionFlattenUniformArrays) != 0 && + (Options & EOptionReadHlsl) == 0) + Error("uniform array flattening only valid when compiling HLSL source."); + + // rationalize client and target language + if (TargetLanguage == glslang::EShTargetNone) { + switch (ClientVersion) { + case glslang::EShTargetVulkan_1_0: + TargetLanguage = glslang::EShTargetSpv; + TargetVersion = glslang::EShTargetSpv_1_0; + break; + case glslang::EShTargetVulkan_1_1: + TargetLanguage = glslang::EShTargetSpv; + TargetVersion = glslang::EShTargetSpv_1_3; + break; + case glslang::EShTargetOpenGL_450: + TargetLanguage = glslang::EShTargetSpv; + TargetVersion = glslang::EShTargetSpv_1_0; + break; + default: + break; + } + } + if (TargetLanguage != glslang::EShTargetNone && Client == glslang::EShClientNone) + Error("To generate SPIR-V, also specify client semantics. See -G and -V."); +} + +// +// Translate the meaningful subset of command-line options to parser-behavior options. +// +void SetMessageOptions(EShMessages& messages) +{ + if (Options & EOptionRelaxedErrors) + messages = (EShMessages)(messages | EShMsgRelaxedErrors); + if (Options & EOptionIntermediate) + messages = (EShMessages)(messages | EShMsgAST); + if (Options & EOptionSuppressWarnings) + messages = (EShMessages)(messages | EShMsgSuppressWarnings); + if (Options & EOptionSpv) + messages = (EShMessages)(messages | EShMsgSpvRules); + if (Options & EOptionVulkanRules) + messages = (EShMessages)(messages | EShMsgVulkanRules); + if (Options & EOptionOutputPreprocessed) + messages = (EShMessages)(messages | EShMsgOnlyPreprocessor); + if (Options & EOptionReadHlsl) + messages = (EShMessages)(messages | EShMsgReadHlsl); + if (Options & EOptionCascadingErrors) + messages = (EShMessages)(messages | EShMsgCascadingErrors); + if (Options & EOptionKeepUncalled) + messages = (EShMessages)(messages | EShMsgKeepUncalled); + if (Options & EOptionHlslOffsets) + messages = (EShMessages)(messages | EShMsgHlslOffsets); + if (Options & EOptionDebug) + messages = (EShMessages)(messages | EShMsgDebugInfo); + if (HlslEnable16BitTypes) + messages = (EShMessages)(messages | EShMsgHlslEnable16BitTypes); + if ((Options & EOptionOptimizeDisable) || !ENABLE_OPT) + messages = (EShMessages)(messages | EShMsgHlslLegalization); +} + +// +// Thread entry point, for non-linking asynchronous mode. +// +void CompileShaders(glslang::TWorklist& worklist) +{ + if (Options & EOptionDebug) + Error("cannot generate debug information unless linking to generate code"); + + glslang::TWorkItem* workItem; + if (Options & EOptionStdin) { + if (worklist.remove(workItem)) { + ShHandle compiler = ShConstructCompiler(FindLanguage("stdin"), Options); + if (compiler == nullptr) + return; + + CompileFile("stdin", compiler); + + if (! (Options & EOptionSuppressInfolog)) + workItem->results = ShGetInfoLog(compiler); + + ShDestruct(compiler); + } + } else { + while (worklist.remove(workItem)) { + ShHandle compiler = ShConstructCompiler(FindLanguage(workItem->name), Options); + if (compiler == 0) + return; + + CompileFile(workItem->name.c_str(), compiler); + + if (! (Options & EOptionSuppressInfolog)) + workItem->results = ShGetInfoLog(compiler); + + ShDestruct(compiler); + } + } +} + +// Outputs the given string, but only if it is non-null and non-empty. +// This prevents erroneous newlines from appearing. +void PutsIfNonEmpty(const char* str) +{ + if (str && str[0]) { + puts(str); + } +} + +// Outputs the given string to stderr, but only if it is non-null and non-empty. +// This prevents erroneous newlines from appearing. +void StderrIfNonEmpty(const char* str) +{ + if (str && str[0]) + fprintf(stderr, "%s\n", str); +} + +// Simple bundling of what makes a compilation unit for ease in passing around, +// and separation of handling file IO versus API (programmatic) compilation. +struct ShaderCompUnit { + EShLanguage stage; + static const int maxCount = 1; + int count; // live number of strings/names + const char* text[maxCount]; // memory owned/managed externally + std::string fileName[maxCount]; // hold's the memory, but... + const char* fileNameList[maxCount]; // downstream interface wants pointers + + ShaderCompUnit(EShLanguage stage) : stage(stage), count(0) { } + + ShaderCompUnit(const ShaderCompUnit& rhs) + { + stage = rhs.stage; + count = rhs.count; + for (int i = 0; i < count; ++i) { + fileName[i] = rhs.fileName[i]; + text[i] = rhs.text[i]; + fileNameList[i] = rhs.fileName[i].c_str(); + } + } + + void addString(std::string& ifileName, const char* itext) + { + assert(count < maxCount); + fileName[count] = ifileName; + text[count] = itext; + fileNameList[count] = fileName[count].c_str(); + ++count; + } +}; + +// +// For linking mode: Will independently parse each compilation unit, but then put them +// in the same program and link them together, making at most one linked module per +// pipeline stage. +// +// Uses the new C++ interface instead of the old handle-based interface. +// + +void CompileAndLinkShaderUnits(std::vector compUnits) +{ + // keep track of what to free + std::list shaders; + + EShMessages messages = EShMsgDefault; + SetMessageOptions(messages); + + // + // Per-shader processing... + // + + glslang::TProgram& program = *new glslang::TProgram; + for (auto it = compUnits.cbegin(); it != compUnits.cend(); ++it) { + const auto &compUnit = *it; + glslang::TShader* shader = new glslang::TShader(compUnit.stage); + shader->setStringsWithLengthsAndNames(compUnit.text, NULL, compUnit.fileNameList, compUnit.count); + if (entryPointName) + shader->setEntryPoint(entryPointName); + if (sourceEntryPointName) { + if (entryPointName == nullptr) + printf("Warning: Changing source entry point name without setting an entry-point name.\n" + "Use '-e '.\n"); + shader->setSourceEntryPoint(sourceEntryPointName); + } + if (UserPreamble.isSet()) + shader->setPreamble(UserPreamble.get()); + shader->addProcesses(Processes); + + // Set IO mapper binding shift values + for (int r = 0; r < glslang::EResCount; ++r) { + const glslang::TResourceType res = glslang::TResourceType(r); + + // Set base bindings + shader->setShiftBinding(res, baseBinding[res][compUnit.stage]); + + // Set bindings for particular resource sets + // TODO: use a range based for loop here, when available in all environments. + for (auto i = baseBindingForSet[res][compUnit.stage].begin(); + i != baseBindingForSet[res][compUnit.stage].end(); ++i) + shader->setShiftBindingForSet(res, i->second, i->first); + } + + shader->setFlattenUniformArrays((Options & EOptionFlattenUniformArrays) != 0); + shader->setNoStorageFormat((Options & EOptionNoStorageFormat) != 0); + shader->setResourceSetBinding(baseResourceSetBinding[compUnit.stage]); + + if (Options & EOptionHlslIoMapping) + shader->setHlslIoMapping(true); + + if (Options & EOptionAutoMapBindings) + shader->setAutoMapBindings(true); + + if (Options & EOptionAutoMapLocations) + shader->setAutoMapLocations(true); + + if (Options & EOptionInvertY) + shader->setInvertY(true); + + for (auto& uniOverride : uniformLocationOverrides) { + shader->addUniformLocationOverride(uniOverride.first.c_str(), + uniOverride.second); + } + + shader->setUniformLocationBase(uniformBase); + + // Set up the environment, some subsettings take precedence over earlier + // ways of setting things. + if (Options & EOptionSpv) { + shader->setEnvInput((Options & EOptionReadHlsl) ? glslang::EShSourceHlsl + : glslang::EShSourceGlsl, + compUnit.stage, Client, ClientInputSemanticsVersion); + shader->setEnvClient(Client, ClientVersion); + shader->setEnvTarget(TargetLanguage, TargetVersion); + if (targetHlslFunctionality1) + shader->setEnvTargetHlslFunctionality1(); + } + + shaders.push_back(shader); + + const int defaultVersion = Options & EOptionDefaultDesktop ? 110 : 100; + + DirStackFileIncluder includer; + std::for_each(IncludeDirectoryList.rbegin(), IncludeDirectoryList.rend(), [&includer](const std::string& dir) { + includer.pushExternalLocalDirectory(dir); }); + if (Options & EOptionOutputPreprocessed) { + std::string str; + if (shader->preprocess(&Resources, defaultVersion, ENoProfile, false, false, messages, &str, includer)) { + PutsIfNonEmpty(str.c_str()); + } else { + CompileFailed = true; + } + StderrIfNonEmpty(shader->getInfoLog()); + StderrIfNonEmpty(shader->getInfoDebugLog()); + continue; + } + + if (! shader->parse(&Resources, defaultVersion, false, messages, includer)) + CompileFailed = true; + + program.addShader(shader); + + if (! (Options & EOptionSuppressInfolog) && + ! (Options & EOptionMemoryLeakMode)) { + PutsIfNonEmpty(compUnit.fileName[0].c_str()); + PutsIfNonEmpty(shader->getInfoLog()); + PutsIfNonEmpty(shader->getInfoDebugLog()); + } + } + + // + // Program-level processing... + // + + // Link + if (! (Options & EOptionOutputPreprocessed) && ! program.link(messages)) + LinkFailed = true; + + // Map IO + if (Options & EOptionSpv) { + if (!program.mapIO()) + LinkFailed = true; + } + + // Report + if (! (Options & EOptionSuppressInfolog) && + ! (Options & EOptionMemoryLeakMode)) { + PutsIfNonEmpty(program.getInfoLog()); + PutsIfNonEmpty(program.getInfoDebugLog()); + } + + // Reflect + if (Options & EOptionDumpReflection) { + program.buildReflection(); + program.dumpReflection(); + } + + // Dump SPIR-V + if (Options & EOptionSpv) { + if (CompileFailed || LinkFailed) + printf("SPIR-V is not generated for failed compile or link\n"); + else { + for (int stage = 0; stage < EShLangCount; ++stage) { + if (program.getIntermediate((EShLanguage)stage)) { + std::vector spirv; + std::string warningsErrors; + spv::SpvBuildLogger logger; + glslang::SpvOptions spvOptions; + if (Options & EOptionDebug) + spvOptions.generateDebugInfo = true; + spvOptions.disableOptimizer = (Options & EOptionOptimizeDisable) != 0; + spvOptions.optimizeSize = (Options & EOptionOptimizeSize) != 0; + spvOptions.disassemble = SpvToolsDisassembler; + spvOptions.validate = SpvToolsValidate; + glslang::GlslangToSpv(*program.getIntermediate((EShLanguage)stage), spirv, &logger, &spvOptions); + + // Dump the spv to a file or stdout, etc., but only if not doing + // memory/perf testing, as it's not internal to programmatic use. + if (! (Options & EOptionMemoryLeakMode)) { + printf("%s", logger.getAllMessages().c_str()); + if (Options & EOptionOutputHexadecimal) { + glslang::OutputSpvHex(spirv, GetBinaryName((EShLanguage)stage), variableName); + } else { + glslang::OutputSpvBin(spirv, GetBinaryName((EShLanguage)stage)); + } + if (!SpvToolsDisassembler && (Options & EOptionHumanReadableSpv)) + spv::Disassemble(std::cout, spirv); + } + } + } + } + } + + // Free everything up, program has to go before the shaders + // because it might have merged stuff from the shaders, and + // the stuff from the shaders has to have its destructors called + // before the pools holding the memory in the shaders is freed. + delete &program; + while (shaders.size() > 0) { + delete shaders.back(); + shaders.pop_back(); + } +} + +// +// Do file IO part of compile and link, handing off the pure +// API/programmatic mode to CompileAndLinkShaderUnits(), which can +// be put in a loop for testing memory footprint and performance. +// +// This is just for linking mode: meaning all the shaders will be put into the +// the same program linked together. +// +// This means there are a limited number of work items (not multi-threading mode) +// and that the point is testing at the linking level. Hence, to enable +// performance and memory testing, the actual compile/link can be put in +// a loop, independent of processing the work items and file IO. +// +void CompileAndLinkShaderFiles(glslang::TWorklist& Worklist) +{ + std::vector compUnits; + + // If this is using stdin, we can't really detect multiple different file + // units by input type. We need to assume that we're just being given one + // file of a certain type. + if ((Options & EOptionStdin) != 0) { + ShaderCompUnit compUnit(FindLanguage("stdin")); + std::istreambuf_iterator begin(std::cin), end; + std::string tempString(begin, end); + char* fileText = strdup(tempString.c_str()); + std::string fileName = "stdin"; + compUnit.addString(fileName, fileText); + compUnits.push_back(compUnit); + } else { + // Transfer all the work items from to a simple list of + // of compilation units. (We don't care about the thread + // work-item distribution properties in this path, which + // is okay due to the limited number of shaders, know since + // they are all getting linked together.) + glslang::TWorkItem* workItem; + while (Worklist.remove(workItem)) { + ShaderCompUnit compUnit(FindLanguage(workItem->name)); + char* fileText = ReadFileData(workItem->name.c_str()); + if (fileText == nullptr) + usage(); + compUnit.addString(workItem->name, fileText); + compUnits.push_back(compUnit); + } + } + + // Actual call to programmatic processing of compile and link, + // in a loop for testing memory and performance. This part contains + // all the perf/memory that a programmatic consumer will care about. + for (int i = 0; i < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++i) { + for (int j = 0; j < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++j) + CompileAndLinkShaderUnits(compUnits); + + if (Options & EOptionMemoryLeakMode) + glslang::OS_DumpMemoryCounters(); + } + + // free memory from ReadFileData, which got stored in a const char* + // as the first string above + for (auto it = compUnits.begin(); it != compUnits.end(); ++it) + FreeFileData(const_cast(it->text[0])); +} + +int singleMain() +{ + glslang::TWorklist workList; + std::for_each(WorkItems.begin(), WorkItems.end(), [&workList](std::unique_ptr& item) { + assert(item); + workList.add(item.get()); + }); + + if (Options & EOptionDumpConfig) { + printf("%s", glslang::GetDefaultTBuiltInResourceString().c_str()); + if (workList.empty()) + return ESuccess; + } + + if (Options & EOptionDumpBareVersion) { + printf("%d.%d.%d\n", + glslang::GetSpirvGeneratorVersion(), GLSLANG_MINOR_VERSION, GLSLANG_PATCH_LEVEL); + if (workList.empty()) + return ESuccess; + } else if (Options & EOptionDumpVersions) { + printf("Glslang Version: %d.%d.%d\n", + glslang::GetSpirvGeneratorVersion(), GLSLANG_MINOR_VERSION, GLSLANG_PATCH_LEVEL); + printf("ESSL Version: %s\n", glslang::GetEsslVersionString()); + printf("GLSL Version: %s\n", glslang::GetGlslVersionString()); + std::string spirvVersion; + glslang::GetSpirvVersion(spirvVersion); + printf("SPIR-V Version %s\n", spirvVersion.c_str()); + printf("GLSL.std.450 Version %d, Revision %d\n", GLSLstd450Version, GLSLstd450Revision); + printf("Khronos Tool ID %d\n", glslang::GetKhronosToolId()); + printf("SPIR-V Generator Version %d\n", glslang::GetSpirvGeneratorVersion()); + printf("GL_KHR_vulkan_glsl version %d\n", 100); + printf("ARB_GL_gl_spirv version %d\n", 100); + if (workList.empty()) + return ESuccess; + } + + if (workList.empty() && ((Options & EOptionStdin) == 0)) { + usage(); + } + + if (Options & EOptionStdin) { + WorkItems.push_back(std::unique_ptr{new glslang::TWorkItem("stdin")}); + workList.add(WorkItems.back().get()); + } + + ProcessConfigFile(); + + if ((Options & EOptionReadHlsl) && !((Options & EOptionOutputPreprocessed) || (Options & EOptionSpv))) + Error("ERROR: HLSL requires SPIR-V code generation (or preprocessing only)"); + + // + // Two modes: + // 1) linking all arguments together, single-threaded, new C++ interface + // 2) independent arguments, can be tackled by multiple asynchronous threads, for testing thread safety, using the old handle interface + // + if (Options & (EOptionLinkProgram | EOptionOutputPreprocessed)) { + glslang::InitializeProcess(); + glslang::InitializeProcess(); // also test reference counting of users + glslang::InitializeProcess(); // also test reference counting of users + glslang::FinalizeProcess(); // also test reference counting of users + glslang::FinalizeProcess(); // also test reference counting of users + CompileAndLinkShaderFiles(workList); + glslang::FinalizeProcess(); + } else { + ShInitialize(); + ShInitialize(); // also test reference counting of users + ShFinalize(); // also test reference counting of users + + bool printShaderNames = workList.size() > 1; + + if (Options & EOptionMultiThreaded) { + std::array threads; + for (unsigned int t = 0; t < threads.size(); ++t) { + threads[t] = std::thread(CompileShaders, std::ref(workList)); + if (threads[t].get_id() == std::thread::id()) { + fprintf(stderr, "Failed to create thread\n"); + return EFailThreadCreate; + } + } + + std::for_each(threads.begin(), threads.end(), [](std::thread& t) { t.join(); }); + } else + CompileShaders(workList); + + // Print out all the resulting infologs + for (size_t w = 0; w < WorkItems.size(); ++w) { + if (WorkItems[w]) { + if (printShaderNames || WorkItems[w]->results.size() > 0) + PutsIfNonEmpty(WorkItems[w]->name.c_str()); + PutsIfNonEmpty(WorkItems[w]->results.c_str()); + } + } + + ShFinalize(); + } + + if (CompileFailed) + return EFailCompile; + if (LinkFailed) + return EFailLink; + + return 0; +} + +int C_DECL main(int argc, char* argv[]) +{ + ProcessArguments(WorkItems, argc, argv); + + int ret = 0; + + // Loop over the entire init/finalize cycle to watch memory changes + const int iterations = 1; + if (iterations > 1) + glslang::OS_DumpMemoryCounters(); + for (int i = 0; i < iterations; ++i) { + ret = singleMain(); + if (iterations > 1) + glslang::OS_DumpMemoryCounters(); + } + + return ret; +} + +// +// Deduce the language from the filename. Files must end in one of the +// following extensions: +// +// .vert = vertex +// .tesc = tessellation control +// .tese = tessellation evaluation +// .geom = geometry +// .frag = fragment +// .comp = compute +// .rgen = ray generation +// .rint = ray intersection +// .rahit = ray any hit +// .rchit = ray closest hit +// .rmiss = ray miss +// .rcall = ray callable +// .mesh = mesh +// .task = task +// Additionally, the file names may end in ..glsl and ..hlsl +// where is one of the stages listed above. +// +EShLanguage FindLanguage(const std::string& name, bool parseStageName) +{ + std::string stageName; + if (shaderStageName) + stageName = shaderStageName; + else if (parseStageName) { + // Note: "first" extension means "first from the end", i.e. + // if the file is named foo.vert.glsl, then "glsl" is first, + // "vert" is second. + size_t firstExtStart = name.find_last_of("."); + bool hasFirstExt = firstExtStart != std::string::npos; + size_t secondExtStart = hasFirstExt ? name.find_last_of(".", firstExtStart - 1) : std::string::npos; + bool hasSecondExt = secondExtStart != std::string::npos; + std::string firstExt = name.substr(firstExtStart + 1, std::string::npos); + bool usesUnifiedExt = hasFirstExt && (firstExt == "glsl" || firstExt == "hlsl"); + if (usesUnifiedExt && firstExt == "hlsl") + Options |= EOptionReadHlsl; + if (hasFirstExt && !usesUnifiedExt) + stageName = firstExt; + else if (usesUnifiedExt && hasSecondExt) + stageName = name.substr(secondExtStart + 1, firstExtStart - secondExtStart - 1); + else { + usage(); + return EShLangVertex; + } + } else + stageName = name; + + if (stageName == "vert") + return EShLangVertex; + else if (stageName == "tesc") + return EShLangTessControl; + else if (stageName == "tese") + return EShLangTessEvaluation; + else if (stageName == "geom") + return EShLangGeometry; + else if (stageName == "frag") + return EShLangFragment; + else if (stageName == "comp") + return EShLangCompute; +#ifdef NV_EXTENSIONS + else if (stageName == "rgen") + return EShLangRayGenNV; + else if (stageName == "rint") + return EShLangIntersectNV; + else if (stageName == "rahit") + return EShLangAnyHitNV; + else if (stageName == "rchit") + return EShLangClosestHitNV; + else if (stageName == "rmiss") + return EShLangMissNV; + else if (stageName == "rcall") + return EShLangCallableNV; + else if (stageName == "mesh") + return EShLangMeshNV; + else if (stageName == "task") + return EShLangTaskNV; +#endif + + usage(); + return EShLangVertex; +} + +// +// Read a file's data into a string, and compile it using the old interface ShCompile, +// for non-linkable results. +// +void CompileFile(const char* fileName, ShHandle compiler) +{ + int ret = 0; + char* shaderString; + if ((Options & EOptionStdin) != 0) { + std::istreambuf_iterator begin(std::cin), end; + std::string tempString(begin, end); + shaderString = strdup(tempString.c_str()); + } else { + shaderString = ReadFileData(fileName); + } + + // move to length-based strings, rather than null-terminated strings + int* lengths = new int[1]; + lengths[0] = (int)strlen(shaderString); + + EShMessages messages = EShMsgDefault; + SetMessageOptions(messages); + + if (UserPreamble.isSet()) + Error("-D and -U options require -l (linking)\n"); + + for (int i = 0; i < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++i) { + for (int j = 0; j < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++j) { + // ret = ShCompile(compiler, shaderStrings, NumShaderStrings, lengths, EShOptNone, &Resources, Options, (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages); + ret = ShCompile(compiler, &shaderString, 1, nullptr, EShOptNone, &Resources, Options, (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages); + // const char* multi[12] = { "# ve", "rsion", " 300 e", "s", "\n#err", + // "or should be l", "ine 1", "string 5\n", "float glo", "bal", + // ";\n#error should be line 2\n void main() {", "global = 2.3;}" }; + // const char* multi[7] = { "/", "/", "\\", "\n", "\n", "#", "version 300 es" }; + // ret = ShCompile(compiler, multi, 7, nullptr, EShOptNone, &Resources, Options, (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages); + } + + if (Options & EOptionMemoryLeakMode) + glslang::OS_DumpMemoryCounters(); + } + + delete [] lengths; + FreeFileData(shaderString); + + if (ret == 0) + CompileFailed = true; +} + +// +// print usage to stdout +// +void usage() +{ + printf("Usage: glslangValidator [option]... [file]...\n" + "\n" + "'file' can end in . for auto-stage classification, where is:\n" + " .conf to provide a config file that replaces the default configuration\n" + " (see -c option below for generating a template)\n" + " .vert for a vertex shader\n" + " .tesc for a tessellation control shader\n" + " .tese for a tessellation evaluation shader\n" + " .geom for a geometry shader\n" + " .frag for a fragment shader\n" + " .comp for a compute shader\n" +#ifdef NV_EXTENSIONS + " .mesh for a mesh shader\n" + " .task for a task shader\n" + " .rgen for a ray generation shader\n" + " .rint for a ray intersection shader\n" + " .rahit for a ray any hit shader\n" + " .rchit for a ray closest hit shader\n" + " .rmiss for a ray miss shader\n" + " .rcall for a ray callable shader\n" +#endif + " .glsl for .vert.glsl, .tesc.glsl, ..., .comp.glsl compound suffixes\n" + " .hlsl for .vert.hlsl, .tesc.hlsl, ..., .comp.hlsl compound suffixes\n" + "\n" + "Options:\n" + " -C cascading errors; risk crash from accumulation of error recoveries\n" + " -D input is HLSL (this is the default when any suffix is .hlsl)\n" + " -D\n" + " -D define a pre-processor macro\n" + " -E print pre-processed GLSL; cannot be used with -l;\n" + " errors will appear on stderr\n" + " -G[ver] create SPIR-V binary, under OpenGL semantics; turns on -l;\n" + " default file name is .spv (-o overrides this);\n" + " 'ver', when present, is the version of the input semantics,\n" + " which will appear in #define GL_SPIRV ver;\n" + " '--client opengl100' is the same as -G100;\n" + " a '--target-env' for OpenGL will also imply '-G'\n" + " -H print human readable form of SPIR-V; turns on -V\n" + " -I add dir to the include search path; includer's directory\n" + " is searched first, followed by left-to-right order of -I\n" + " -Od disables optimization; may cause illegal SPIR-V for HLSL\n" + " -Os optimizes SPIR-V to minimize size\n" + " -S uses specified stage rather than parsing the file extension\n" + " choices for are vert, tesc, tese, geom, frag, or comp\n" + " -U undefine a pre-processor macro\n" + " -V[ver] create SPIR-V binary, under Vulkan semantics; turns on -l;\n" + " default file name is .spv (-o overrides this)\n" + " 'ver', when present, is the version of the input semantics,\n" + " which will appear in #define VULKAN ver\n" + " '--client vulkan100' is the same as -V100\n" + " a '--target-env' for Vulkan will also imply '-V'\n" + " -c configuration dump;\n" + " creates the default configuration file (redirect to a .conf file)\n" + " -d default to desktop (#version 110) when there is no shader #version\n" + " (default is ES version 100)\n" + " -e | --entry-point \n" + " specify as the entry-point function name\n" + " -f{hlsl_functionality1}\n" + " 'hlsl_functionality1' enables use of the\n" + " SPV_GOOGLE_hlsl_functionality1 extension\n" + " -g generate debug information\n" + " -h print this usage message\n" + " -i intermediate tree (glslang AST) is printed out\n" + " -l link all input files together to form a single module\n" + " -m memory leak mode\n" + " -o save binary to , requires a binary option (e.g., -V)\n" + " -q dump reflection query database\n" + " -r | --relaxed-errors" + " relaxed GLSL semantic error-checking mode\n" + " -s silence syntax and semantic error reporting\n" + " -t multi-threaded mode\n" + " -v | --version\n" + " print version strings\n" + " -w | --suppress-warnings\n" + " suppress GLSL warnings, except as required by \"#extension : warn\"\n" + " -x save binary output as text-based 32-bit hexadecimal numbers\n" + " -u: specify a uniform location override for --aml\n" + " --uniform-base set a base to use for generated uniform locations\n" + " --auto-map-bindings | --amb automatically bind uniform variables\n" + " without explicit bindings\n" + " --auto-map-locations | --aml automatically locate input/output lacking\n" + " 'location' (fragile, not cross stage)\n" + " --client {vulkan|opengl} see -V and -G\n" + " -dumpfullversion | -dumpversion print bare major.minor.patchlevel\n" + " --flatten-uniform-arrays | --fua flatten uniform texture/sampler arrays to\n" + " scalars\n" + " --hlsl-offsets allow block offsets to follow HLSL rules\n" + " works independently of source language\n" + " --hlsl-iomap perform IO mapping in HLSL register space\n" + " --hlsl-enable-16bit-types allow 16-bit types in SPIR-V for HLSL\n" + " --invert-y | --iy invert position.Y output in vertex shader\n" + " --keep-uncalled | --ku don't eliminate uncalled functions\n" + " --no-storage-format | --nsf use Unknown image format\n" + " --resource-set-binding [stage] name set binding\n" + " set descriptor set and binding for\n" + " individual resources\n" + " --resource-set-binding [stage] set\n" + " set descriptor set for all resources\n" + " --rsb synonym for --resource-set-binding\n" + " --shift-image-binding [stage] num\n" + " base binding number for images (uav)\n" + " --shift-image-binding [stage] [num set]...\n" + " per-descriptor-set shift values\n" + " --sib synonym for --shift-image-binding\n" + " --shift-sampler-binding [stage] num\n" + " base binding number for samplers\n" + " --shift-sampler-binding [stage] [num set]...\n" + " per-descriptor-set shift values\n" + " --ssb synonym for --shift-sampler-binding\n" + " --shift-ssbo-binding [stage] num base binding number for SSBOs\n" + " --shift-ssbo-binding [stage] [num set]...\n" + " per-descriptor-set shift values\n" + " --sbb synonym for --shift-ssbo-binding\n" + " --shift-texture-binding [stage] num\n" + " base binding number for textures\n" + " --shift-texture-binding [stage] [num set]...\n" + " per-descriptor-set shift values\n" + " --stb synonym for --shift-texture-binding\n" + " --shift-uav-binding [stage] num base binding number for UAVs\n" + " --shift-uav-binding [stage] [num set]...\n" + " per-descriptor-set shift values\n" + " --suavb synonym for --shift-uav-binding\n" + " --shift-UBO-binding [stage] num base binding number for UBOs\n" + " --shift-UBO-binding [stage] [num set]...\n" + " per-descriptor-set shift values\n" + " --sub synonym for --shift-UBO-binding\n" + " --shift-cbuffer-binding | --scb synonyms for --shift-UBO-binding\n" + " --spirv-dis output standard-form disassembly; works only\n" + " when a SPIR-V generation option is also used\n" + " --spirv-val execute the SPIRV-Tools validator\n" + " --source-entrypoint the given shader source function is\n" + " renamed to be the given in -e\n" + " --sep synonym for --source-entrypoint\n" + " --stdin read from stdin instead of from a file;\n" + " requires providing the shader stage using -S\n" + " --target-env {vulkan1.0 | vulkan1.1 | opengl | \n" + " spirv1.0 | spirv1.1 | spirv1.2 | spirv1.3}\n" + " set execution environment that emitted code\n" + " will execute in (versus source language\n" + " semantics selected by --client) defaults:\n" + " * 'vulkan1.0' under '--client vulkan'\n" + " * 'opengl' under '--client opengl'\n" + " * 'spirv1.0' under --target-env vulkan1.0\n" + " * 'spirv1.3' under --target-env vulkan1.1\n" + " multiple --targen-env can be specified.\n" + " --variable-name \n" + " --vn creates a C header file that contains a\n" + " uint32_t array named \n" + " initialized with the shader binary code\n" + ); + + exit(EFailUsage); +} + +#if !defined _MSC_VER && !defined MINGW_HAS_SECURE_API + +#include + +int fopen_s( + FILE** pFile, + const char* filename, + const char* mode +) +{ + if (!pFile || !filename || !mode) { + return EINVAL; + } + + FILE* f = fopen(filename, mode); + if (! f) { + if (errno != 0) { + return errno; + } else { + return ENOENT; + } + } + *pFile = f; + + return 0; +} + +#endif + +// +// Malloc a string of sufficient size and read a string into it. +// +char* ReadFileData(const char* fileName) +{ + FILE *in = nullptr; + int errorCode = fopen_s(&in, fileName, "r"); + if (errorCode || in == nullptr) + Error("unable to open input file"); + + int count = 0; + while (fgetc(in) != EOF) + count++; + + fseek(in, 0, SEEK_SET); + + char* return_data = (char*)malloc(count + 1); // freed in FreeFileData() + if ((int)fread(return_data, 1, count, in) != count) { + free(return_data); + Error("can't read input file"); + } + + return_data[count] = '\0'; + fclose(in); + + return return_data; +} + +void FreeFileData(char* data) +{ + free(data); +} + +void InfoLogMsg(const char* msg, const char* name, const int num) +{ + if (num >= 0 ) + printf("#### %s %s %d INFO LOG ####\n", msg, name, num); + else + printf("#### %s %s INFO LOG ####\n", msg, name); +} diff --git a/deps/glslang/StandAlone/Worklist.h b/deps/glslang/StandAlone/Worklist.h new file mode 100644 index 00000000..91b6f516 --- /dev/null +++ b/deps/glslang/StandAlone/Worklist.h @@ -0,0 +1,95 @@ +// +// Copyright (C) 2013 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +#ifndef WORKLIST_H_INCLUDED +#define WORKLIST_H_INCLUDED + +#include "../glslang/OSDependent/osinclude.h" +#include +#include +#include + +namespace glslang { + + class TWorkItem { + public: + TWorkItem() { } + explicit TWorkItem(const std::string& s) : + name(s) { } + std::string name; + std::string results; + std::string resultsIndex; + }; + + class TWorklist { + public: + TWorklist() { } + virtual ~TWorklist() { } + + void add(TWorkItem* item) + { + std::lock_guard guard(mutex); + worklist.push_back(item); + } + + bool remove(TWorkItem*& item) + { + std::lock_guard guard(mutex); + + if (worklist.empty()) + return false; + item = worklist.front(); + worklist.pop_front(); + + return true; + } + + int size() + { + return (int)worklist.size(); + } + + bool empty() + { + return worklist.empty(); + } + + protected: + std::mutex mutex; + std::list worklist; + }; + +} // end namespace glslang + +#endif // WORKLIST_H_INCLUDED diff --git a/deps/glslang/StandAlone/spirv-remap.cpp b/deps/glslang/StandAlone/spirv-remap.cpp new file mode 100644 index 00000000..998f7428 --- /dev/null +++ b/deps/glslang/StandAlone/spirv-remap.cpp @@ -0,0 +1,343 @@ +// +// Copyright (C) 2015 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include +#include +#include +#include + +#include "../SPIRV/SPVRemapper.h" + +namespace { + + typedef unsigned int SpvWord; + + // Poor man's basename: given a complete path, return file portion. + // E.g: + // Linux: /foo/bar/test -> test + // Win: c:\foo\bar\test -> test + // It's not very efficient, but that doesn't matter for our minimal-duty use. + // Using boost::filesystem would be better in many ways, but want to avoid that dependency. + + // OS dependent path separator (avoiding boost::filesystem dependency) +#if defined(_WIN32) + char path_sep_char() { return '\\'; } +#else + char path_sep_char() { return '/'; } +#endif + + std::string basename(const std::string filename) + { + const size_t sepLoc = filename.find_last_of(path_sep_char()); + + return (sepLoc == filename.npos) ? filename : filename.substr(sepLoc+1); + } + + void errHandler(const std::string& str) { + std::cout << str << std::endl; + exit(5); + } + + void logHandler(const std::string& str) { + std::cout << str << std::endl; + } + + // Read word stream from disk + void read(std::vector& spv, const std::string& inFilename, int verbosity) + { + std::ifstream fp; + + if (verbosity > 0) + logHandler(std::string(" reading: ") + inFilename); + + spv.clear(); + fp.open(inFilename, std::fstream::in | std::fstream::binary); + + if (fp.fail()) + errHandler("error opening file for read: "); + + // Reserve space (for efficiency, not for correctness) + fp.seekg(0, fp.end); + spv.reserve(size_t(fp.tellg()) / sizeof(SpvWord)); + fp.seekg(0, fp.beg); + + while (!fp.eof()) { + SpvWord inWord; + fp.read((char *)&inWord, sizeof(inWord)); + + if (!fp.eof()) { + spv.push_back(inWord); + if (fp.fail()) + errHandler(std::string("error reading file: ") + inFilename); + } + } + } + + void write(std::vector& spv, const std::string& outFile, int verbosity) + { + if (outFile.empty()) + errHandler("missing output filename."); + + std::ofstream fp; + + if (verbosity > 0) + logHandler(std::string(" writing: ") + outFile); + + fp.open(outFile, std::fstream::out | std::fstream::binary); + + if (fp.fail()) + errHandler(std::string("error opening file for write: ") + outFile); + + for (auto it = spv.cbegin(); it != spv.cend(); ++it) { + SpvWord word = *it; + fp.write((char *)&word, sizeof(word)); + if (fp.fail()) + errHandler(std::string("error writing file: ") + outFile); + } + + // file is closed by destructor + } + + // Print helpful usage message to stdout, and exit + void usage(const char* const name, const char* const msg = 0) + { + if (msg) + std::cout << msg << std::endl << std::endl; + + std::cout << "Usage: " << std::endl; + + std::cout << " " << basename(name) + << " [-v[v[...]] | --verbose [int]]" + << " [--map (all|types|names|funcs)]" + << " [--dce (all|types|funcs)]" + << " [--opt (all|loadstore)]" + << " [--strip-all | --strip all | -s]" + << " [--do-everything]" + << " --input | -i file1 [file2...] --output|-o DESTDIR" + << std::endl; + + std::cout << " " << basename(name) << " [--version | -V]" << std::endl; + std::cout << " " << basename(name) << " [--help | -?]" << std::endl; + + exit(5); + } + + // grind through each SPIR in turn + void execute(const std::vector& inputFile, const std::string& outputDir, + int opts, int verbosity) + { + for (auto it = inputFile.cbegin(); it != inputFile.cend(); ++it) { + const std::string &filename = *it; + std::vector spv; + read(spv, filename, verbosity); + spv::spirvbin_t(verbosity).remap(spv, opts); + + const std::string outfile = outputDir + path_sep_char() + basename(filename); + + write(spv, outfile, verbosity); + } + + if (verbosity > 0) + std::cout << "Done: " << inputFile.size() << " file(s) processed" << std::endl; + } + + // Parse command line options + void parseCmdLine(int argc, char** argv, std::vector& inputFile, + std::string& outputDir, + int& options, + int& verbosity) + { + if (argc < 2) + usage(argv[0]); + + verbosity = 0; + options = spv::spirvbin_t::NONE; + + // Parse command line. + // boost::program_options would be quite a bit nicer, but we don't want to + // introduce a dependency on boost. + for (int a=1; a= argc) + usage(argv[0], "--output requires an argument"); + if (!outputDir.empty()) + usage(argv[0], "--output can be provided only once"); + + outputDir = argv[a++]; + + // Remove trailing directory separator characters + while (!outputDir.empty() && outputDir.back() == path_sep_char()) + outputDir.pop_back(); + + } + else if (arg == "-vv") { verbosity = 2; ++a; } // verbosity shortcuts + else if (arg == "-vvv") { verbosity = 3; ++a; } // ... + else if (arg == "-vvvv") { verbosity = 4; ++a; } // ... + else if (arg == "-vvvvv") { verbosity = 5; ++a; } // ... + + else if (arg == "--verbose" || arg == "-v") { + ++a; + verbosity = 1; + + if (a < argc) { + char* end_ptr = 0; + int verb = ::strtol(argv[a], &end_ptr, 10); + // If we have not read to the end of the string or + // the string contained no elements, then we do not want to + // store the value. + if (*end_ptr == '\0' && end_ptr != argv[a]) { + verbosity = verb; + ++a; + } + } + } + else if (arg == "--version" || arg == "-V") { + std::cout << basename(argv[0]) << " version 0.97 " << __DATE__ << " " << __TIME__ << std::endl; + exit(0); + } else if (arg == "--input" || arg == "-i") { + // Collect input files + for (++a; a < argc && argv[a][0] != '-'; ++a) + inputFile.push_back(argv[a]); + } else if (arg == "--do-everything") { + ++a; + options = options | spv::spirvbin_t::DO_EVERYTHING; + } else if (arg == "--strip-all" || arg == "-s") { + ++a; + options = options | spv::spirvbin_t::STRIP; + } else if (arg == "--strip") { + ++a; + if (strncmp(argv[a], "all", 3) == 0) { + options = options | spv::spirvbin_t::STRIP; + ++a; + } + } else if (arg == "--dce") { + // Parse comma (or colon, etc) separated list of things to dce + ++a; + for (const char* c = argv[a]; *c; ++c) { + if (strncmp(c, "all", 3) == 0) { + options = (options | spv::spirvbin_t::DCE_ALL); + c += 3; + } else if (strncmp(c, "*", 1) == 0) { + options = (options | spv::spirvbin_t::DCE_ALL); + c += 1; + } else if (strncmp(c, "funcs", 5) == 0) { + options = (options | spv::spirvbin_t::DCE_FUNCS); + c += 5; + } else if (strncmp(c, "types", 5) == 0) { + options = (options | spv::spirvbin_t::DCE_TYPES); + c += 5; + } + } + ++a; + } else if (arg == "--map") { + // Parse comma (or colon, etc) separated list of things to map + ++a; + for (const char* c = argv[a]; *c; ++c) { + if (strncmp(c, "all", 3) == 0) { + options = (options | spv::spirvbin_t::MAP_ALL); + c += 3; + } else if (strncmp(c, "*", 1) == 0) { + options = (options | spv::spirvbin_t::MAP_ALL); + c += 1; + } else if (strncmp(c, "types", 5) == 0) { + options = (options | spv::spirvbin_t::MAP_TYPES); + c += 5; + } else if (strncmp(c, "names", 5) == 0) { + options = (options | spv::spirvbin_t::MAP_NAMES); + c += 5; + } else if (strncmp(c, "funcs", 5) == 0) { + options = (options | spv::spirvbin_t::MAP_FUNCS); + c += 5; + } + } + ++a; + } else if (arg == "--opt") { + ++a; + for (const char* c = argv[a]; *c; ++c) { + if (strncmp(c, "all", 3) == 0) { + options = (options | spv::spirvbin_t::OPT_ALL); + c += 3; + } else if (strncmp(c, "*", 1) == 0) { + options = (options | spv::spirvbin_t::OPT_ALL); + c += 1; + } else if (strncmp(c, "loadstore", 9) == 0) { + options = (options | spv::spirvbin_t::OPT_LOADSTORE); + c += 9; + } + } + ++a; + } else if (arg == "--help" || arg == "-?") { + usage(argv[0]); + } else { + usage(argv[0], "Unknown command line option"); + } + } + } + +} // namespace + +int main(int argc, char** argv) +{ + std::vector inputFile; + std::string outputDir; + int opts; + int verbosity; + +#ifdef use_cpp11 + // handle errors by exiting + spv::spirvbin_t::registerErrorHandler(errHandler); + + // Log messages to std::cout + spv::spirvbin_t::registerLogHandler(logHandler); +#endif + + if (argc < 2) + usage(argv[0]); + + parseCmdLine(argc, argv, inputFile, outputDir, opts, verbosity); + + if (outputDir.empty()) + usage(argv[0], "Output directory required"); + + std::string errmsg; + + // Main operations: read, remap, and write. + execute(inputFile, outputDir, opts, verbosity); + + // If we get here, everything went OK! Nothing more to be done. +} diff --git a/deps/glslang/Test/100.conf b/deps/glslang/Test/100.conf new file mode 100644 index 00000000..3899d343 --- /dev/null +++ b/deps/glslang/Test/100.conf @@ -0,0 +1,28 @@ +MaxLights 32 +MaxClipPlanes 6 +MaxTextureUnits 32 +MaxTextureCoords 32 +MaxVertexAttribs 8 +MaxVertexUniformComponents 4096 +MaxVaryingFloats 64 +MaxVertexTextureImageUnits 0 +MaxCombinedTextureImageUnits 8 +MaxTextureImageUnits 8 +MaxFragmentUniformComponents 4096 +MaxDrawBuffers 1 +MaxVertexUniformVectors 16 +MaxVaryingVectors 8 +MaxFragmentUniformVectors 16 +MaxVertexOutputVectors 16 +MaxFragmentInputVectors 15 +MinProgramTexelOffset -8 +MaxProgramTexelOffset 7 +nonInductiveForLoops 0 +whileLoops 0 +doWhileLoops 0 +generalUniformIndexing 0 +generalAttributeMatrixVectorIndexing 0 +generalVaryingIndexing 0 +generalSamplerIndexing 0 +generalVariableIndexing 0 +generalConstantMatrixVectorIndexing 0 diff --git a/deps/glslang/Test/100.frag b/deps/glslang/Test/100.frag new file mode 100644 index 00000000..4f0c69b5 --- /dev/null +++ b/deps/glslang/Test/100.frag @@ -0,0 +1,227 @@ +// okay +#version 100 +int a[3] = { 2, 3, 4, }; // ERROR (lots) +#version 100 +int uint; + +attribute vec4 v[3]; // ERROR + +float f = 2; // ERROR + +uniform block { // ERROR + int x; +}; + +void foo(float); + +void main() +{ + foo(3); // ERROR + int s = 1 << 4; // ERROR + s = 16 >> 2; // ERROR + if (a == a); // ERROR + int b, c; + b = c & 4; // ERROR + b = c % 4; // ERROR + b = c | 4; // ERROR + b >>= 2; // ERROR + b <<= 2; // ERROR + b %= 3; // ERROR + + struct S { + float f; + float a[10]; + } s1, s2; + + s1 = s2; // ERROR + if (s1 == s2); // ERROR + if (s1 != s2); // ERROR + + switch(b) { // ERROR + } +} + +invariant gl_FragColor; +float fa[]; // ERROR +float f13; +invariant f13; // ERROR +struct S { int a; }; +invariant S; // ERROR, not an input or output +invariant float fi; // ERROR +varying vec4 av; +invariant av; // okay in v100 + +void foo10() +{ + invariant f; // ERROR + invariant float f2; // ERROR + float f3; + invariant f3; // ERROR +} + +uniform vec2 uv2; +invariant uv2; // ERROR +invariant uniform vec3 uv3; // ERROR + +sampler2D glob2D; // ERROR +void f11(sampler2D p2d) +{ + sampler2D v2D; // ERROR +} +varying sampler2D vary2D; // ERROR + +struct sp { + highp float f; + in float g; // ERROR + uniform float h; // ERROR + invariant float i; // ERROR +}; + +uniform sampler3D s3D; // ERROR + +#extension GL_OES_texture_3D : enable + +precision highp sampler3D; +uniform sampler3D s3D2; + +void foo234() +{ + texture3D(s3D2, vec3(0.2), 0.2); + texture3DProj(s3D2, v[1], 0.4); + dFdx(v[0]); // ERROR + dFdy(3.2); // ERROR + fwidth(f13); // ERROR +} + +#extension GL_OES_standard_derivatives : enable + +void foo236() +{ + dFdx(v[0]); + dFdy(3.2); + fwidth(f13); + gl_FragDepth = f13; // ERROR + gl_FragDepthEXT = f13; // ERROR +} + +#extension GL_EXT_frag_depth : enable + +void foo239() +{ + gl_FragDepth = f13; // ERROR + gl_FragDepthEXT = f13; +} + +#extension GL_OES_EGL_image_external : enable + +uniform samplerExternalOES sExt; + +void foo245() +{ + texture2D(sExt, vec2(0.2)); + texture2DProj(sExt, vec3(f13)); + texture2DProj(sExt, v[2]); +} + +precision mediump samplerExternalOES; +uniform samplerExternalOES mediumExt; +uniform highp samplerExternalOES highExt; + +void foo246() +{ + texture2D(mediumExt, vec2(0.2)); + texture2DProj(highExt, v[2]); + texture3D(sExt, vec3(f13)); // ERROR + texture2DProjLod(sExt, vec3(f13), f13); // ERROR + int a; + ~a; // ERROR + a | a; // ERROR + a & a; // ERROR +} + +#extension GL_OES_EGL_image_external : disable +uniform sampler2D s2Dg; + +int foo203940(int a, float b, float a) // ERROR, a redefined +{ + texture2DProjGradEXT(s2Dg, vec3(f13), uv2, uv2); // ERROR, extension not enabled + return a; +} + +float f123 = 4.0f; // ERROR +float f124 = 5e10F; // ERROR + +#extension GL_EXT_shader_texture_lod : enable + +uniform samplerCube sCube; + +void foo323433() +{ + texture2DLodEXT(s2Dg, uv2, f13); + texture2DProjGradEXT(s2Dg, vec3(f13), uv2, uv2); + texture2DGradEXT(s2Dg, uv2, uv2, uv2); + textureCubeGradEXT(sCube, vec3(f13), vec3(f13), vec3(f13)); +} + +int fgfg(float f, mediump int i); +int fgfg(float f, highp int i) { return 2; } // ERROR, precision qualifier difference + +int fffg(float f); +int fffg(float f); // ERROR, can't have multiple prototypes + +int gggf(float f); +int gggf(float f) { return 2; } + +int agggf(float f) { return 2; } +int agggf(float f); +int agggf(float f); // ERROR, second prototype + +varying struct SSS { float f; } s; // ERROR + +int vf(void); +int vf2(); +int vf3(void v); // ERROR +int vf4(int, void); // ERROR +int vf5(int, void v); // ERROR + +void badswizzle() +{ + vec3 a[5]; + a.y; // ERROR, no array swizzle + a.zy; // ERROR, no array swizzle + a.nothing; // ERROR + a.length(); // ERROR, not this version + a.method(); // ERROR +} + +float fooinit(); + +float fooinittest() +{ + return fooinit(); +} + +// Test extra-function initializers +const float fi1 = 3.0; +const float fi2 = 4.0; +const float fi3 = 5.0; + +float fooinit() +{ + return fi1 + fi2 + fi3; // should make a constant of 12.0 +} + +int init1 = gl_FrontFacing ? 1 : 2; // ERROR, non-const initializer + +#ifdef GL_EXT_shader_non_constant_global_initializers +#extension GL_EXT_shader_non_constant_global_initializers : enable +#endif + +int init2 = gl_FrontFacing ? 1 : 2; + +#pragma STDGL invariant(all) + +#line 3000 +#error line of this error should be 3000 + +uniform samplerExternalOES badExt; // syntax ERROR diff --git a/deps/glslang/Test/100Limits.vert b/deps/glslang/Test/100Limits.vert new file mode 100644 index 00000000..d23b7e89 --- /dev/null +++ b/deps/glslang/Test/100Limits.vert @@ -0,0 +1,76 @@ +#version 100 + +int ga, gb; +float f; + +uniform sampler2D fsa[3]; +uniform float fua[10]; +attribute mat3 am3; +attribute vec2 av2; +varying vec4 va[4]; + +const mat2 m2 = mat2(1.0); +const vec3 v3 = vec3(2.0); + +void foo(inout float a) {} + +int bar() +{ + return 1; +} + +void main() +{ + while (ga < gb) { } + + do { } while (false); + + for ( ; ; ); // ERROR + for ( ; ga==gb; ); // ERROR + for ( ; ; f++); // ERROR + for ( ga = 0; ; ); // ERROR + for ( bool a = false; ; ); // ERROR + for (float a = 0.0; a == sin(f); ); // ERROR + for ( int a = 0; a < 10; a *= 2); // ERROR + for ( int a = 0; a <= 20; a++) --a; // ERROR + for ( int a = 0; a <= 20; a++) { if (ga==0) a = 4; } // ERROR + for (float a = 0.0; a <= 20.0; a += 2.0); + for (float a = 0.0; a != 20.0; a -= 2.0) { if (ga==0) ga = 4; } + for (float a = 0.0; a == 20.0; a--) for (float a = 0.0; a == 20.0; a--); // two different 'a's, everything okay + for (float a = 0.0; a <= 20.0; a += 2.0); + for (float a = 0.0; a <= 20.0; a += 2.0); + for (float a = 0.0; a > 2.0 * 20.0; a += v3.y); + for (float a = 0.0; a >= 20.0; a += 2.0) foo(a); // ERROR + + int ia[9]; + + fsa[ga]; // ERROR + fua[ga]; + am3[ga]; // ERROR + av2[ga]; // ERROR + va[2+ga]; // ERROR + m2[ga]; // ERROR + v3[ga/2]; // ERROR + ia[ga]; // ERROR + + for (int a = 3; a >= 0; a--) { + fsa[a]; + fua[a+2]; + am3[3*a]; + av2[3*a]; + va[a-1]; + m2[a/2]; + v3[a]; + ia[a]; + ia[bar()]; // ERROR + } + + fsa[2]; + fua[3]; + am3[2]; + av2[1]; + va[1]; + m2[1]; + v3[1]; + ia[3]; +} diff --git a/deps/glslang/Test/100samplerExternal.frag b/deps/glslang/Test/100samplerExternal.frag new file mode 100644 index 00000000..9f6f397e --- /dev/null +++ b/deps/glslang/Test/100samplerExternal.frag @@ -0,0 +1,41 @@ +#version 100 + +#extension GL_OES_EGL_image_external : enable + +uniform samplerExternalOES sExt; +precision mediump samplerExternalOES; +uniform samplerExternalOES mediumExt; +uniform highp samplerExternalOES highExt; + +void main() +{ + texture2D(sExt, vec2(0.2)); + texture2D(mediumExt, vec2(0.2)); + texture2D(highExt, vec2(0.2)); + texture2DProj(sExt, vec3(0.3)); + texture2DProj(sExt, vec4(0.3)); + + int lod = 0; + highp float bias = 0.01; + textureSize(sExt, lod); // ERROR + texture(sExt, vec2(0.2)); // ERROR + texture(sExt, vec2(0.2), bias); // ERROR + textureProj(sExt, vec3(0.2)); // ERROR + textureProj(sExt, vec3(0.2), bias); // ERROR + textureProj(sExt, vec4(0.2)); // ERROR + textureProj(sExt, vec4(0.2), bias); // ERROR + texelFetch(sExt, ivec2(4), lod); // ERROR + + texture3D(sExt, vec3(0.3)); // ERROR + texture2DProjLod(sExt, vec3(0.3), 0.3); // ERROR + texture(sExt, vec3(0.3)); // ERROR + textureProjLod(sExt, vec3(0.3), 0.3); // ERROR +} + +#extension GL_OES_EGL_image_external : disable + +#extension GL_OES_EGL_image_external_essl3 : enable +uniform samplerExternalOES badExt; // ERROR +#extension GL_OES_EGL_image_external_essl3 : disable + +uniform samplerExternalOES badExt; // ERROR diff --git a/deps/glslang/Test/100scope.vert b/deps/glslang/Test/100scope.vert new file mode 100644 index 00000000..b0a72d1f --- /dev/null +++ b/deps/glslang/Test/100scope.vert @@ -0,0 +1,76 @@ +#version 100 + +int f(int a, int b, int c) +{ + int a = b; // ERROR, redefinition + + { + float a = float(a) + 1.0; + } + + return a; +} + +int f(int a, int b, int c); // okay to redeclare + +bool b; +float b(int a); // ERROR: redefinition + +float c(int a); +bool c; // ERROR: redefinition + +float f; // ERROR: redefinition +float tan; // okay, built-in is in an outer scope +float sin(float x); // ERROR: can't redefine built-in functions +float cos(float x) // ERROR: can't redefine built-in functions +{ + return 1.0; +} +bool radians(bool x) // okay, can overload built-in functions +{ + return true; +} + +invariant gl_Position; + +void main() +{ + int g(); // ERROR: no local function declarations + g(); + + float sin; // okay + sin; + sin(0.7); // ERROR, use of hidden function + f(1,2,3); + + float f; // hides f() + f = 3.0; + + gl_Position = vec4(f); + + for (int f = 0; f < 10; ++f) + ++f; + + int x = 1; + { + float x = 2.0, /* 2nd x visible here */ y = x; // y is initialized to 2 + int z = z; // ERROR: z not previously defined. + } + { + int x = x; // x is initialized to '1' + } + + struct S + { + int x; + }; + { + S S = S(0); // 'S' is only visible as a struct and constructor + S.x; // 'S' is now visible as a variable + } + + int degrees; + degrees(3.2); // ERROR, use of hidden built-in function +} + +varying struct SSS { float f; } s; // ERROR diff --git a/deps/glslang/Test/110scope.vert b/deps/glslang/Test/110scope.vert new file mode 100644 index 00000000..86c27a58 --- /dev/null +++ b/deps/glslang/Test/110scope.vert @@ -0,0 +1,87 @@ +#version 110 + +int f(int a, int b, int c) +{ + int a = b; // ERROR, redefinition + + { + float a = float(a) + 1.0; // okay + } + + return a; +} + +int f(int a, int b, int c); // okay to redeclare + +bool b; +float b(int a); // okay, b and b() are different + +float c(int a); +bool c; // okay, and c() are different + +float f; // okay f and f() are different +float tan; // okay, hides built-in function +float sin(float x); // okay, can redefine built-in functions +float cos(float x) // okay, can redefine built-in functions +{ + return 1.0; +} +bool radians(bool x) // okay, can overload built-in functions +{ + return true; +} + +int gi = f(1,2,3); // ERROR, can't call user-defined function from global scope + +void main() +{ + int g(); // okay + g(); + + float sin; // okay + sin; + sin(0.7); // okay + f(1,2,3); + + float f; + f = 3.0; + + gl_Position = vec4(f); + + for (int f = 0; f < 10; ++f) + ++f; + + int x = 1; + { + float x = 2.0, /* 2nd x visible here */ y = x; // y is initialized to 2 + int z = z; // ERROR: z not previously defined. + } + { + int x = x; // x is initialized to '1' + } + + struct S + { + int x; + }; + { + S S = S(0); // 'S' is only visible as a struct and constructor + S.x; // 'S' is now visible as a variable + } + + int degrees; + degrees(3.2); + + { + S s; + s.x = 3; + struct S { // okay, hides S + bool b; + }; + S t; + t.b = true; + struct S { // ERROR, redefinition of struct S + float f; + }; + } +} diff --git a/deps/glslang/Test/120.frag b/deps/glslang/Test/120.frag new file mode 100644 index 00000000..ea35b80e --- /dev/null +++ b/deps/glslang/Test/120.frag @@ -0,0 +1,248 @@ +#version 120 + +float lowp; +float mediump; +float highp; + +float precision; + +in vec4 i; +out vec4 o; + +uniform sampler2D s2D; +centroid varying vec2 centTexCoord; + +uniform mat4x2 m; + +struct s { + float f; +}; + +void main() +{ + mat2x3 m23 = mat2x3(m); + + int a; + bool b; + s sv = s(a); + float[2] ia = float[2](3, i.y); + float f1 = 1; + float f = a; + f = a; + ivec3 iv3; + vec3 v3 = iv3; + f = f + a; + f = a - f; + f += a; + f = a - f; + v3 *= iv3; + v3 = iv3 / 2.0f; + v3 = 3.0 * iv3; + v3 = 2 * v3; + v3 = v3 - 2; + if (f < a || + a <= f || + f > a || + f >= a || + a == f || + f != a); + f = b ? a : f; + f = b ? f : a; + f = b ? a : a; + s news = sv; + + i.xy + i.xyz; // ERROR + m * i.xyz; // ERROR + m + i; // ERROR + int aoeu = 1.0; // ERROR + f = b; // ERROR + f = a + b; // ERROR + f = b * a; // ERROR + b = a; // ERROR + b = b + f; // ERROR + f |= b; // ERROR + + gl_FragColor = texture2D(s2D, centTexCoord); + + float flat; + float smooth; + float noperspective; + float uvec2; + float uvec3; + float uvec4; + //packed; // ERROR, reserved word + + { + mat4 m; + vec4 v; + bool b; + gl_FragColor += b ? v : m; // ERROR, types don't match around ":" + } + + gl_FragColor.xr; // ERROR, swizzlers not from same field space + gl_FragColor.xyxyx.xy; // ERROR, cannot make a vec5, even temporarily + centTexCoord.z; // ERROR, swizzler out of range + (a,b) = true; // ERROR, not an l-value +} + +float imageBuffer; +float uimage2DRect; + +int main() {} // ERROR +void main(int a) {} // ERROR + +const int a; // ERROR + +int foo(in float a); +int foo(out float a) // ERROR +{ + return 3.2; // ERROR + foo(a); // ERROR +} + +bool gen(vec3 v) +{ + if (abs(v[0]) < 1e-4F && abs(v[1]) < 1e-4) + return true; +} + +void v1() +{ +} + +void v2() +{ + return v1(); // ERROR, no expression allowed, even though void +} + +void atest() +{ + vec4 v = gl_TexCoord[1]; + v += gl_TexCoord[3]; +} + +varying vec4 gl_TexCoord[6]; // okay, assigning a size +varying vec4 gl_TexCoord[5]; // ERROR, changing size + +mat2x2 m22; +mat2x3 m23; +mat2x4 m24; + +mat3x2 m32; +mat3x3 m33; +mat3x4 m34; + +mat4x2 m42; +mat4x3 m43; +mat4x4 m44; + +void foo123() +{ + mat2 r2 = matrixCompMult(m22, m22); + mat3 r3 = matrixCompMult(m33, m33); + mat4 r4 = matrixCompMult(m44, m44); + + mat2x3 r23 = matrixCompMult(m23, m23); + mat2x4 r24 = matrixCompMult(m24, m24); + mat3x2 r32 = matrixCompMult(m32, m32); + mat3x4 r34 = matrixCompMult(m34, m34); + mat4x2 r42 = matrixCompMult(m42, m42); + mat4x3 r43 = matrixCompMult(m43, m43); + + mat3x2 rfoo1 = matrixCompMult(m23, m32); // ERROR + mat3x4 rfoo2 = matrixCompMult(m34, m44); // ERROR +} + +void matConst() +{ + vec2 v2; + vec3 v3; + mat4 m4b1 = mat4(v2, v3); // ERROR, not enough + mat4 m4b2 = mat4(v2, v3, v3, v3, v3, v2, v2); // ERROR, too much + mat4 m4g = mat4(v2, v3, v3, v3, v3, v3); + mat4 m4 = mat4(v2, v3, v3, v3, v3, v2); + mat3 m3 = mat3(m4); + mat3 m3b1 = mat3(m4, v2); // ERROR, extra arg + mat3 m3b2 = mat3(m4, m4); // ERROR, extra arg + mat3x2 m32 = mat3x2(m4); + mat4 m4c = mat4(m32); + mat3 m3s = mat3(v2.x); + + mat3 m3a1[2] = mat3[2](m3s, m3s); + mat3 m3a2[2] = mat3[2](m3s, m3s, m3s); // ERROR, too many args +} + +uniform sampler3D s3D; +uniform sampler1D s1D; +uniform sampler2DShadow s2DS; + +void foo2323() +{ + vec4 v; + vec2 v2; + float f; + v = texture2DLod(s2D, v2, f); // ERROR + v = texture3DProjLod(s3D, v, f); // ERROR + v = texture1DProjLod(s1D, v, f); // ERROR + v = shadow2DProjLod(s2DS, v, f); // ERROR + + v = texture1DGradARB(s1D, f, f, f); // ERROR + v = texture2DProjGradARB(s2D, v, v2, v2); // ERROR + v = shadow2DProjGradARB(s2DS, v, v2, v2); // ERROR +} + +#extension GL_ARB_shader_texture_lod : require + +void foo2324() +{ + vec4 v; + vec2 v2; + float f; + v = texture2DLod(s2D, v2, f); + v = texture3DProjLod(s3D, v, f); + v = texture1DProjLod(s1D, v, f); + v = shadow2DProjLod(s2DS, v, f); + + v = texture1DGradARB(s1D, f, f, f); + v = texture2DProjGradARB(s2D, v, v2, v2); + v = shadow2DProjGradARB(s2DS, v, v2, v2); + v = shadow2DRectProjGradARB(s2DS, v, v2, v2); // ERROR +} + +uniform sampler2DRect s2DRbad; // ERROR + +void foo121111() +{ + vec2 v2; + vec4 v = texture2DRect(s2DRbad, v2); +} + +#extension GL_ARB_texture_rectangle : enable + +uniform sampler2DRect s2DR; +uniform sampler2DRectShadow s2DRS; + +void foo12111() +{ + vec2 v2; + vec3 v3; + vec4 v4; + vec4 v; + v = texture2DRect(s2DR, v2); + v = texture2DRectProj(s2DR, v3); + v = texture2DRectProj(s2DR, v4); + v = shadow2DRect(s2DRS, v3); + v = shadow2DRectProj(s2DRS, v4); + + v = shadow2DRectProjGradARB(s2DRS, v, v2, v2); +} + +void voidTernary() +{ + bool b; + b ? foo121111() : foo12111(); + b ? foo121111() : 4; // ERROR + b ? 3 : foo12111(); // ERROR +} + +float halfFloat1 = 1.0h; // syntax ERROR diff --git a/deps/glslang/Test/120.vert b/deps/glslang/Test/120.vert new file mode 100644 index 00000000..d2765571 --- /dev/null +++ b/deps/glslang/Test/120.vert @@ -0,0 +1,203 @@ +#version 120 + +in vec4 i; // ERROR +out vec4 o; // ERROR + +attribute vec2 attv2; +attribute vec4 attv4; +uniform sampler2D s2D; +invariant varying vec2 centTexCoord; +invariant gl_Position; +centroid gl_Position; // ERROR +centroid centroid foo; // ERROR +invariant gl_Position, gl_PointSize; + +void main() +{ + centTexCoord = attv2; + gl_Position = attv4; + + gl_ClipVertex = attv4; + gl_ClipDistance[1] = 0.2; // ERROR + + vec3[12] a; + vec4[a.length()] b; + gl_Position = b[b.length()-1]; + + float f[]; + int a1 = f.length(); // ERROR + float f[7]; + int aa = f.length(); + int a2 = f.length; // ERROR + int a3 = f.length(a); // ERROR + int a4 = f.flizbit; // ERROR + int a4 = f.flizbit(); // ERROR + float md[2][4]; // ERROR + float[2] md2[4]; // ERROR + float[2][4] md3; // ERROR + float md5, md6[2][3]; // ERROR + float[2] md4, md7[4]; // ERROR + float md9[2][3] = float[2][3](1, 2, 3, 4, 5, 6); // ERROR + float md10, md11[2][3] = float[2][3](1, 2, 3, 4, 5, 6); // ERROR + + gl_PointSize = 3.8; +} + +uniform float initted = 3.4; // okay + +const float concall = sin(0.3); + +int[2][3] foo( // ERROR + float[2][3] a, // ERROR + float[2] b[3], // ERROR + float c[2][3]); // ERROR + +int overloadA(in float f); +int overloadA(out float f); // ERROR, different qualifiers +float overloadA(float); // ERROR, different return value for same signature +float overloadA(out float f, int); +float overloadA(int i); + +void overloadB(float, const in float) { } + +vec2 overloadC(int, int); +vec2 overloadC(const in int, float); +vec2 overloadC(float, int); +vec2 overloadC(vec2, vec2); + +vec3 overloadD(int, float); +vec3 overloadD(float, in int); + +vec3 overloadE(float[2]); +vec3 overloadE(mat2 m); +vec3 overloadE(vec2 v); + +vec3 overloadF(int); +vec3 overloadF(float); + +void foo() +{ + float f; + int i; + + overloadB(f, f); + overloadB(f, 2); + overloadB(1, i); + + overloadC(1); // ERROR + overloadC(1, i); + overloadC(vec2(1), vec2(2)); + overloadC(f, 3.0); // ERROR, no way + overloadC(ivec2(1), vec2(2)); + + overloadD(i, f); + overloadD(f, i); + overloadD(i, i); // ERROR, ambiguous + + int overloadB; // hiding + overloadB(1, i); // ERROR + + sin(1); + texture2D(s2D, ivec2(0)); + clamp(attv4, 0, 1); + clamp(ivec4(attv4), 0, 1); + + int a[2]; + overloadC(a, 3); // ERROR + overloadE(a); // ERROR + overloadE(3.3); // ERROR + overloadE(vec2(3.3)); + overloadE(mat2(0.5)); + overloadE(ivec4(1)); // ERROR + overloadE(ivec2(1)); + + float b[2]; + overloadE(b); + + overloadF(1, 1); // ERROR + overloadF(1); +} + +varying vec4 gl_TexCoord[35]; // ERROR, size too big + +// tests for output conversions +void outFun(in float, out ivec2, in int, out float); +int outFunRet(in float, out int, const in int, out ivec4); +ivec2 outFunRet(in float, out ivec4, in int, out ivec4); + +void foo2() +{ + vec2 v2; + vec4 v4; + float f; + int i; + + outFun(i, v2, i, f); + outFunRet(i, f, i, v4); + float ret = outFunRet(i, f, i, v4); + vec2 ret2 = outFunRet(i, v4, i, v4); + bool b = any(lessThan(v4, attv4)); // tests aggregate arg to unary built-in +} + +void noise() +{ + float f1 = noise1(1.0); + vec2 f2 = noise2(vec2(1.0)); + vec3 f3 = noise3(vec3(1.0)); + vec4 f4 = noise4(vec4(1.0)); +} + +// version 130 features + +uniform int c; + +attribute ivec2 x; +attribute vec2 v2a; +attribute float c1D; +attribute vec2 c2D; +attribute vec3 c3D; + +uniform vec4 v4; + +void foo213() +{ + float f = 3; + switch (c) { // ERRORs... + case 1: + f = sin(f); + break; + case 2: + f = f * f; + default: + f = 3.0; + } + + int i; + i << 3 | 0x8A >> 1 & 0xFF; // ERRORs... + + vec3 modfOut, modfIn; + vec3 v11 = modf(modfIn, modfOut); // ERRORS... + float t = trunc(f); + vec2 v12 = round(v2a); + vec2 v13 = roundEven(v2a); + bvec2 b10 = isnan(v2a); + bvec4 b11 = isinf(v4); + + sinh(c1D) + // ERRORS... + cosh(c1D) * tanh(c2D); + asinh(c4D) + acosh(c4D); + atanh(c3D); + + int id = gl_VertexID; // ERROR + gl_ClipDistance[1] = 0.3; // ERROR +} + +int gl_ModelViewMatrix[] = 0; + +// token pasting (ERRORS...) + +#define mac abc##def +int mac; + +#define macr(A,B) A ## B +int macr(qrs,tuv); diff --git a/deps/glslang/Test/130.frag b/deps/glslang/Test/130.frag new file mode 100644 index 00000000..3e394110 --- /dev/null +++ b/deps/glslang/Test/130.frag @@ -0,0 +1,169 @@ +#version 130 + +lowp vec3 a; +mediump float b; +highp int c; + +precision highp float; + +in vec4 i; +out vec4 o; + +flat in float fflat; +smooth in float fsmooth; +noperspective in float fnop; + +void main() +{ + float clip = gl_ClipDistance[3]; +} + +uniform samplerCube sampC; + +void foo() +{ + vec4 s = textureGather(sampC, vec3(0.2)); +} + +#extension GL_ARB_texture_gather : enable + +void bar() +{ + vec4 s = textureGather(sampC, vec3(0.2)); +} + +flat in vec3 gl_Color; // ERROR, type +in vec4 gl_Color; +flat in vec4 gl_Color; +flat in vec4 gl_Color[2]; // ERROR, array +vec4 gl_Color; // ERROR, storage + +#extension GL_ARB_texture_gather : warn + +void bar2() +{ + vec4 s = textureGather(sampC, vec3(0.2)); + + uvec3 uv3; + bvec3 b3; + b3 = lessThan(uv3, uv3); + b3 = equal(uv3, uv3); + const bvec2 bl1 = greaterThanEqual(uvec2(2, 3), uvec2(3,3)); + const bvec2 bl2 = equal(uvec2(2, 3), uvec2(3,3)); + const bvec2 bl3 = equal(bl1, bl2); // yes, equal + int a1[int(bl3.x)]; + int a2[int(bl3.y)]; + a1[0]; // size 1 + a2[0]; // size 1 + const bvec4 bl4 = notEqual(greaterThan(uvec4(1,2,3,4), uvec4(0,2,0,6)), lessThanEqual(uvec4(7,8,9,10), uvec4(6, 8, 0, 11))); // compare (t,f,t,f) with (f,t,f,t) + int a3[int(bl4.x)+int(bl4.y)+int(bl4.z)+int(bl4.w)]; + a3[3]; // size 4 + b3 != b3; + b3 < b3; // ERROR + uv3 > uv3; // ERROR + uvec2(2, 3) >= uvec2(3,3); // ERROR + int(bl4) <= int(bl4); // true + int(bl4.x) > int(bl4.y); // false +} + +#extension GL_ARB_texture_gather : enable +#extension GL_ARB_texture_rectangle : enable + +uniform sampler2D samp2D; +uniform sampler2DShadow samp2DS; +uniform sampler2DRect samp2DR; +uniform sampler2DArray samp2DA; + +void bar23() +{ + vec4 s; + s = textureGatherOffset(sampC, vec3(0.3), ivec2(1)); // ERROR + s = textureGatherOffset(samp2DR, vec2(0.3), ivec2(1)); // ERROR + s = textureGatherOffset(samp2D, vec2(0.3), ivec2(1)); + s = textureGatherOffset(samp2DA, vec3(0.3), ivec2(1)); + s = textureGatherOffset(samp2DS, vec2(0.3), 1.3, ivec2(1)); // ERROR + s = textureGatherOffset(samp2D, vec2(0.3), ivec2(1), 2); // ERROR +} + +#extension GL_ARB_gpu_shader5 : enable + +void bar234() +{ + vec4 s; + s = textureGatherOffset(samp2D, vec2(0.3), ivec2(1)); + s = textureGatherOffset(samp2DA, vec3(0.3), ivec2(1)); + s = textureGatherOffset(samp2DR, vec2(0.3), ivec2(1)); + s = textureGatherOffset(samp2DS, vec2(0.3), 1.3, ivec2(1)); + s = textureGatherOffset(samp2D, vec2(0.3), ivec2(1), 2); +} + +#extension GL_ARB_texture_cube_map_array : enable + +uniform samplerCubeArray Sca; +uniform isamplerCubeArray Isca; +uniform usamplerCubeArray Usca; +uniform samplerCubeArrayShadow Scas; + +void bar235() +{ + ivec3 a = textureSize(Sca, 3); + vec4 b = texture(Sca, i); + ivec4 c = texture(Isca, i, 0.7); + uvec4 d = texture(Usca, i); + + b = textureLod(Sca, i, 1.7); + a = textureSize(Scas, a.x); + float f = texture(Scas, i, b.y); + c = textureGrad(Isca, i, vec3(0.1), vec3(0.2)); +} + +int \ + x; // ERROR until 420pack is turned on + +#extension GL_ARB_shading_language_420pack : enable + +const int ai[3] = { 10, 23, 32 }; +layout(binding=0) uniform blockname { int a; } instanceName; // ERROR +uniform layout(binding=0) sampler2D bounds; + +void bar23444() +{ + mat4x3 m43; \ + float a1 = m43[3].y; + vec3 v3; + int a2 = m43.length(); + a2 += m43[1].length(); + a2 += v3.length(); + const float b = 2 * a1; + a.x = gl_MinProgramTexelOffset + gl_MaxProgramTexelOffset; + bool boolb; + boolb.length(); // ERROR + m43[3][1].length(); // ERROR + v3.length; // ERROR + v3.length(b); // ERROR +} + +in float gl_FogFragCoord; + +#extension GL_ARB_separate_shader_objects : enable + +in float gl_FogFragCoord; +in int gl_FogFragCoord; // ERROR + +layout(early_fragment_tests) in; // ERROR +layout(r32i) uniform iimage2D iimg2Dbad; // ERROR + +#extension GL_ARB_shader_image_load_store : enable + +layout(early_fragment_tests) in; + +layout(r32i) uniform iimage2D iimg2D; + +void qux2() +{ + int i; + imageAtomicCompSwap(iimg2D, ivec2(i,i), i, i); + ivec4 pos = imageLoad(iimg2D, ivec2(i,i)); +} + +layout(early_fragment_tests) out; // ERROR diff --git a/deps/glslang/Test/130.vert b/deps/glslang/Test/130.vert new file mode 100644 index 00000000..d5208cb1 --- /dev/null +++ b/deps/glslang/Test/130.vert @@ -0,0 +1,78 @@ +#version 130 + +uniform int c; +uniform usampler2D us2D; + +in ivec2 x; +in vec2 v2a; +in float c1D; +in vec2 c2D; +in vec3 c3D; +smooth vec4 c4D; // ?? + +uniform vec4 v4; + +void main() +{ + float f = 3; + switch (c) { // full switch testing in switch.frag + case 1: + f = sin(f); + break; + case 2: + f = f * f; + default: + f = 3.0; + } + + uint i; + i = texture(us2D, x).w; // full uint testing in uint.frag + i << 3u | 0x8Au >> 1u & 0xFFu; + + vec3 modfOut, modfIn; + vec3 v11 = modf(modfIn, modfOut); + float t = trunc(f); + vec2 v12 = round(v2a); + vec2 v13 = roundEven(v2a); + bvec2 b10 = isnan(v2a); + bvec4 b11 = isinf(v4); + + sinh(c1D) + + cosh(c1D) * tanh(c2D); + asinh(c4D) + acosh(c4D); + atanh(c3D); + + int id = gl_VertexID; + gl_ClipDistance[1] = 0.3; +} + +// version 140 features + +//uniform isamplerBuffer sbuf; + +//layout(std140) uniform blockName { +// int anonMem; +//}; + +void foo88() +{ + int id = gl_InstanceID; // ERROR + //id += anonMem; + id += texelFetch(id, 8); + + gl_ClipVertex; // these are all present... + gl_Color; + gl_LightSource[0]; + gl_DepthRange.far; + gl_TexCoord; + gl_FogFragCoord; + gl_FrontColor; +} + +// token pasting + +#define mac abc##def +int mac; + +#define macr(A,B) A##B +int macr(qrs,tuv); diff --git a/deps/glslang/Test/140.frag b/deps/glslang/Test/140.frag new file mode 100644 index 00000000..2bc2f59f --- /dev/null +++ b/deps/glslang/Test/140.frag @@ -0,0 +1,53 @@ +#version 140 + +varying vec4 v; + +in vec4 i; +out vec4 o; + +in float gl_ClipDistance[5]; + +void main() +{ + float clip = gl_ClipDistance[2]; +} +#ifdef GL_ES +#error GL_ES is set +#else +#error GL_ES is not set +#endif + +in struct S { float f; } s; // ERROR + +float patch = 3.1; + +layout(location=3) in vec4 vl; // ERROR + +layout(location = 3) out vec4 factorBad; // ERROR + +#extension GL_ARB_explicit_attrib_location : enable + +layout(location = 5) out vec4 factor; + +#extension GL_ARB_separate_shader_objects : enable + +layout(location=4) in vec4 vl2; + +float fooi(); + +void foo() +{ + vec2 r1 = modf(v.xy, v.zw); // ERROR, v.zw not l-value + vec2 r2 = modf(o.xy, o.zw); + o.z = fooi(); +} + +// Test extra-function initializers + +float i1 = gl_FrontFacing ? -2.0 : 2.0; +float i2 = 102; + +float fooi() +{ + return i1 + i2; +} diff --git a/deps/glslang/Test/140.vert b/deps/glslang/Test/140.vert new file mode 100644 index 00000000..914e672d --- /dev/null +++ b/deps/glslang/Test/140.vert @@ -0,0 +1,79 @@ +#version 140 + +uniform isamplerBuffer sbuf; + +layout(std140) uniform blockName { + int anonMem; +}; + +void main() +{ + int id = gl_InstanceID; + id += anonMem; + id += texelFetch(sbuf, 8).w; + gl_ClipVertex; // could be ERROR, but compiling under compatibility profile + gl_Color; // could be ERROR, but compiling under compatibility profile + gl_LightSource[0]; // could be ERROR, but compiling under compatibility profile + gl_DepthRange.far; + gl_TexCoord; // could be ERROR, but compiling under compatibility profile + gl_FogFragCoord; // could be ERROR, but compiling under compatibility profile + gl_FrontColor; // could be ERROR, but compiling under compatibility profile +} + +out vec4 gl_Position; // ERROR + +layout(location = 9) in vec4 locBad; // ERROR + +#extension GL_ARB_explicit_attrib_location : enable + +layout(location = 9) in vec4 loc; + +#extension GL_ARB_separate_shader_objects : enable + +out vec4 gl_Position; +in vec4 gl_Position; // ERROR +out vec3 gl_Position; // ERROR + +out float gl_PointSize; +out vec4 gl_ClipVertex; +out float gl_FogFragCoord; + +uniform sampler2DRect s2dr; +uniform sampler2DRectShadow s2drs; +in ivec2 itloc2; +in vec2 tloc2; +in vec3 tloc3; +in vec4 tloc4; + +void foo() +{ + vec4 v = texelFetch(s2dr, itloc2); + v += texelFetch(s2dr, itloc2, 0.2); // ERROR, no lod + v += texture(s2dr, tloc2); + v += texture(s2dr, tloc2, 0.3); // ERROR, no bias + v += texture(s2drs, tloc3); + v += textureProj(s2dr, tloc3); + v += textureProj(s2dr, tloc4); + v += textureProjGradOffset(s2dr, tloc4, ivec2(0.0), ivec2(0.0), ivec2(1,2)); + v += textureProjGradOffset(s2drs, tloc4, ivec2(0.0), ivec2(0.0), ivec2(1,2)); +} + +void devi() +{ + gl_DeviceIndex; // ERROR, no extension + gl_ViewIndex; // ERROR, no extension +} + +#ifdef GL_EXT_device_group +#extension GL_EXT_device_group : enable +#endif + +#ifdef GL_EXT_device_group +#extension GL_EXT_multiview : enable +#endif + +void devie() +{ + gl_DeviceIndex; + gl_ViewIndex; +} diff --git a/deps/glslang/Test/150.frag b/deps/glslang/Test/150.frag new file mode 100644 index 00000000..16963afb --- /dev/null +++ b/deps/glslang/Test/150.frag @@ -0,0 +1,50 @@ +#version 150 core + +in vec4 gl_FragCoord; +layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; // ERROR +layout(pixel_center_integer) in vec4 gl_FragCoord; // ERROR +layout(origin_upper_left) in vec4 foo; // ERROR +layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; + +void main() +{ + vec4 c = gl_FragCoord; +} + +layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; // ERROR, declared after use + +in struct S { float f; } s; + +float patch = 3.1; + +uniform sampler2DMS sms; +uniform isampler2DMS isms; +uniform usampler2DMS usms; +uniform sampler2DMSArray smsa; +uniform isampler2DMSArray ismsa; +uniform usampler2DMSArray usmsa; + +flat in ivec2 p2; +flat in ivec3 p3; +flat in int samp; + +void barWxyz() +{ + ivec2 t11 = textureSize( sms); + ivec2 t12 = textureSize(isms); + ivec2 t13 = textureSize(usms); + ivec3 t21 = textureSize( smsa); + ivec3 t22 = textureSize(ismsa); + ivec3 t23 = textureSize(usmsa); + vec4 t31 = texelFetch( sms, p2, samp); + ivec4 t32 = texelFetch(isms, p2, samp); + uvec4 t33 = texelFetch(usms, p2, 3); + vec4 t41 = texelFetch( smsa, p3, samp); + ivec4 t42 = texelFetch(ismsa, ivec3(2), samp); + uvec4 t43 = texelFetch(usmsa, p3, samp); +} + +int primitiveID() +{ + return gl_PrimitiveID; +} diff --git a/deps/glslang/Test/150.geom b/deps/glslang/Test/150.geom new file mode 100644 index 00000000..d5b3c9b3 --- /dev/null +++ b/deps/glslang/Test/150.geom @@ -0,0 +1,139 @@ +#version 150 core + +in fromVertex { + in vec3 color; +} fromV[]; + +out toFragment { + out vec3 color; +} toF; + +out fromVertex { // okay to reuse a block name for another block name + vec3 color; +}; + +out fooB { + vec2 color; +} fromVertex; // ERROR, cannot reuse block name as block instance + +int fromVertex; // ERROR, cannot reuse a block name for something else + +out fooC { + vec2 color; +} fooC; // ERROR, cannot have same name for block and instance name + +void main() +{ + EmitVertex(); + EndPrimitive(); + EmitStreamVertex(1); // ERROR + EndStreamPrimitive(0); // ERROR + + color = fromV[0].color; + gl_ClipDistance[3] = gl_in[1].gl_ClipDistance[2]; + gl_Position = gl_in[0].gl_Position; + gl_PointSize = gl_in[3].gl_PointSize; + gl_PrimitiveID = gl_PrimitiveIDIn; + gl_Layer = 2; +} + +out vec4 ov0; // stream should be 0 +layout(stream = 4) out vec4 ov4; +out vec4 o1v0; // stream should be 0 + +layout(stream = 3) uniform; // ERROR +layout(stream = 3) in; // ERROR +layout(stream = 3) uniform int ua; // ERROR +layout(stream = 3) uniform ubb { int ua; } ibb; // ERROR + +layout(line_strip, points, triangle_strip, stream = 3, points, triangle_strip) out; // just means "stream = 3, triangle_strip" +layout(stream = 3, triangle_strip) out; +out vec4 ov3; // stream should be 3 + +layout(stream = 6) out ooutb { vec4 a; } ouuaa6; + +layout(stream = 6) out ooutb2 { + layout(stream = 6) vec4 a; +} ouua6; + +layout(stream = 7) out ooutb3 { + layout(stream = 6) vec4 a; // ERROR +} ouua7; + +out vec4 ov2s3; // stream should be 3 + +layout(max_vertices = 200) out; +layout(max_vertices = 300) out; // ERROR, too big +void foo(layout(max_vertices = 4) int a) // ERROR +{ + ouuaa6.a = vec4(1.0); +} + +layout(line_strip, points, triangle_strip, stream = 3, points) out; // ERROR, changing output primitive +layout(line_strip, points, stream = 3) out; // ERROR, changing output primitive +layout(triangle_strip) in; // ERROR, not an input primitive +layout(triangle_strip) uniform; // ERROR +layout(triangle_strip) out vec4 badv4; // ERROR, not on a variable +layout(triangle_strip) in vec4 bad2v4[]; // ERROR, not on a variable or input +layout(invocations = 3) out outbn { int a; }; // 2 ERROR, not on a block, not until 4.0 +out outbn2 { + layout(invocations = 3) int a; // 2 ERRORs, not on a block member, not until 4.0 + layout(max_vertices = 3) int b; // ERROR, not on a block member + layout(triangle_strip) int c; // ERROR, not on a block member +} outbi; + +layout(lines) out; // ERROR, not on output +layout(lines_adjacency) in; +layout(triangles) in; // ERROR, can't change it +layout(triangles_adjacency) in; // ERROR, can't change it +layout(invocations = 4) in; // ERROR, not until 4.0 + +in inbn { + layout(stream = 2) int a; // ERROR, stream on input +} inbi[]; + +in sameName { + int a15; +} insn[]; + +out sameName { + float f15; +}; + +uniform sameName { + bool b15; +}; + +float summ = gl_MaxVertexAttribs + + gl_MaxVertexUniformComponents + + gl_MaxVaryingFloats + + gl_MaxVaryingComponents + + gl_MaxVertexOutputComponents + + gl_MaxGeometryInputComponents + + gl_MaxGeometryOutputComponents + + gl_MaxFragmentInputComponents + + gl_MaxVertexTextureImageUnits + + gl_MaxCombinedTextureImageUnits + + gl_MaxTextureImageUnits + + gl_MaxFragmentUniformComponents + + gl_MaxDrawBuffers + + gl_MaxClipDistances + + gl_MaxGeometryTextureImageUnits + + gl_MaxGeometryOutputVertices + + gl_MaxGeometryTotalOutputComponents + + gl_MaxGeometryUniformComponents + + gl_MaxGeometryVaryingComponents; + +void fooe1() +{ + gl_ViewportIndex = gl_MaxViewports - 1; +} + +#extension GL_ARB_viewport_array : enable + +void fooe2() +{ + gl_ViewportIndex = gl_MaxViewports - 1; +} + +out int gl_ViewportIndex; diff --git a/deps/glslang/Test/150.tesc b/deps/glslang/Test/150.tesc new file mode 100644 index 00000000..66c0f3ea --- /dev/null +++ b/deps/glslang/Test/150.tesc @@ -0,0 +1,34 @@ +#version 150 + +#extension GL_ARB_tessellation_shader : enable + +layout(vertices = 4) out; +int outa[gl_out.length()]; + +patch out vec4 patchOut; + +void main() +{ + barrier(); + + int a = gl_MaxTessControlInputComponents + + gl_MaxTessControlOutputComponents + + gl_MaxTessControlTextureImageUnits + + gl_MaxTessControlUniformComponents + + gl_MaxTessControlTotalOutputComponents; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; + float cd = gl_in[1].gl_ClipDistance[2]; + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + int iid = gl_InvocationID; + + gl_out[gl_InvocationID].gl_Position = p; + gl_out[gl_InvocationID].gl_PointSize = ps; + gl_out[gl_InvocationID].gl_ClipDistance[1] = cd; + + gl_TessLevelOuter[3] = 3.2; + gl_TessLevelInner[1] = 1.3; +} diff --git a/deps/glslang/Test/150.tese b/deps/glslang/Test/150.tese new file mode 100644 index 00000000..aea65e81 --- /dev/null +++ b/deps/glslang/Test/150.tese @@ -0,0 +1,35 @@ +#version 150 + +#extension GL_ARB_tessellation_shader : enable + +layout(quads, cw) in; +layout(fractional_odd_spacing) in; +layout(point_mode) in; +patch in vec4 patchIn; + +void main() +{ + barrier(); // ERROR + + int a = gl_MaxTessEvaluationInputComponents + + gl_MaxTessEvaluationOutputComponents + + gl_MaxTessEvaluationTextureImageUnits + + gl_MaxTessEvaluationUniformComponents + + gl_MaxTessPatchComponents + + gl_MaxPatchVertices + + gl_MaxTessGenLevel; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; + float cd = gl_in[1].gl_ClipDistance[2]; + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + vec3 tc = gl_TessCoord; + float tlo = gl_TessLevelOuter[3]; + float tli = gl_TessLevelInner[1]; + + gl_Position = p; + gl_PointSize = ps; + gl_ClipDistance[2] = cd; +} diff --git a/deps/glslang/Test/150.vert b/deps/glslang/Test/150.vert new file mode 100644 index 00000000..4dd9e5ca --- /dev/null +++ b/deps/glslang/Test/150.vert @@ -0,0 +1,29 @@ +#version 150 core + +#ifndef GL_core_profile +# error standard macro GL_core_profile not defined +#endif + +in vec4 iv4; + +uniform float ps; + +invariant gl_Position; + +void main() +{ + gl_Position = iv4; + gl_PointSize = ps; + gl_ClipDistance[2] = iv4.x; + gl_ClipVertex = iv4; +} + +out float gl_ClipDistance[4]; + +uniform foob { + int a[]; +}; +int a[5]; // ERROR, resizing user-block member + +#line 3000 +#error line of this error should be 3001 diff --git a/deps/glslang/Test/300.frag b/deps/glslang/Test/300.frag new file mode 100644 index 00000000..ca2e2cb3 --- /dev/null +++ b/deps/glslang/Test/300.frag @@ -0,0 +1,161 @@ +#version 300 es +void nodef1(float f); // ERROR, no default precision +uniform sampler2D s2D; +uniform lowp sampler3D s3D; +uniform samplerCube sCube; +uniform lowp samplerCubeShadow sCubeShadow; +uniform lowp sampler2DShadow s2DShadow; +uniform lowp sampler2DArray s2DArray; +uniform lowp sampler2DArrayShadow s2DArrayShadow; + +uniform lowp isampler2D is2D; +uniform lowp isampler3D is3D; +uniform lowp isamplerCube isCube; +uniform lowp isampler2DArray is2DArray; + +uniform lowp usampler2D us2D; +uniform lowp usampler3D us3D; +uniform lowp usamplerCube usCube; +uniform lowp usampler2DArray us2DArray; +precision lowp float; +in float c1D; +in vec2 c2D; +in vec3 c3D; +smooth vec4 c4D; + +flat in int ic1D; +flat in ivec2 ic2D; +flat in ivec3 ic3D; +flat in ivec4 ic4D; +noperspective in vec4 badv; // ERROR +in sampler2D bads; // ERROR +precision lowp uint; // ERROR + +struct s { + int i; + sampler2D s; +}; + +in s badout; // ERROR, can't contain a sampler + // ERROR, can't have int in struct without flat +struct S2 { + vec3 c; + float f; +}; + +in S2 s2; + +out vec3 sc; +out float sf; + +uniform sampler2D arrayedSampler[5]; + +void main() +{ + float f; + vec4 v; + v = texture(s2D, c2D); + v = textureProj(s3D, c4D); + v = textureLod(s2DArray, c3D, 1.2); + f = textureOffset(s2DShadow, c3D, ic2D, c1D); // ERROR, offset argument not constant + v = texelFetch(s3D, ic3D, ic1D); + v = texelFetchOffset(arrayedSampler[2], ic2D, 4, ic2D); // ERROR, offset argument not constant + f = textureLodOffset(s2DShadow, c3D, c1D, ic2D); + v = textureProjLodOffset(s2D, c3D, c1D, ic2D); + v = textureGrad(sCube, c3D, c3D, c3D); + f = textureGradOffset(s2DArrayShadow, c4D, c2D, c2D, ic2D); + v = textureProjGrad(s3D, c4D, c3D, c3D); + v = textureProjGradOffset(s2D, c3D, c2D, c2D, ic2D); + v = texture(arrayedSampler[ic1D], c2D); // ERROR + + ivec4 iv; + iv = texture(is2D, c2D); + iv = textureProjOffset(is2D, c4D, ic2D); + iv = textureProjLod(is2D, c3D, c1D); + iv = textureProjGrad(is2D, c3D, c2D, c2D); + iv = texture(is3D, c3D, 4.2); + iv = textureLod(isCube, c3D, c1D); + iv = texelFetch(is2DArray, ic3D, ic1D); + + iv.xy = textureSize(sCubeShadow, 2); + + float precise; + double boo; // ERROR + dvec2 boo2; // ERROR + dvec3 boo3; // ERROR + dvec4 boo4; // ERROR + + f += gl_FragCoord.y; + gl_FragDepth = f; + + sc = s2.c; + sf = s2.f; + + sinh(c1D) + + cosh(c1D) * tanh(c2D); + asinh(c4D) + acosh(c4D); + atanh(c3D); +} + +uniform multi { + int[2] a[3]; // ERROR + int[2][3] b; // ERROR + int c[2][3]; // ERROR +} multiInst[2][3]; // ERROR + +out vec4 colors[4]; + +void foo() +{ + colors[2] = c4D; + colors[ic1D] = c4D; // ERROR +} + +uniform s st1; +uniform s st2; + +void foo13(s inSt2) +{ + if (st1 == st2); // ERROR + if (st1 != st2); // ERROR + st1.s == st2.s; // ERROR + inSt2 = st1; // ERROR + inSt2 == st1; // ERROR +} + +void foo23() +{ + textureOffset(s2DShadow, c3D, ivec2(-8, 7), c1D); + textureOffset(s2DShadow, c3D, ivec2(-9, 8), c1D); +} + +void foo324(void) +{ + float p = pow(3.2, 4.6); + p += sin(0.4); + p += distance(vec2(10.0, 11.0), vec2(13.0, 15.0)); // 5 + p += dot(vec3(2,3,5), vec3(-2,-1,4)); // 13 + vec3 c3 = cross(vec3(3,-3,1), vec3(4,9,2)); // (-15, -2, 39) + c3 += faceforward(vec3(1,2,3), vec3(2,3,5), vec3(-2,-1,4)); // (-1,-2,-3) + c3 += faceforward(vec3(1,2,3), vec3(-2,-3,-5), vec3(-2,-1,4)); // (1,2,3) + vec2 c2 = reflect(vec2(1,3), vec2(0,1)); // (1,-3) + c2 += refract(vec2(1,3), vec2(0,1), 1.0); // (1,-3) + c2 += refract(vec2(1,3), vec2(0,1), 3.0); + c2 += refract(vec2(1,0.1), vec2(0,1), 5.0); // (0,0) + mat3x2 m32 = outerProduct(vec2(2,3), vec3(5,7,11));// rows: (10, 14, 22), (15, 21, 33) +} + +uniform mediump; // ERROR + +layout(early_fragment_tests) in; // ERROR + +#ifndef GL_FRAGMENT_PRECISION_HIGH +#error missing GL_FRAGMENT_PRECISION_HIGH +#endif + +invariant in; // ERROR +invariant in vec4; // ERROR +invariant in vec4 fooinv; // ERROR + +float imageBuffer; // ERROR, reserved +float uimage2DRect; // ERROR, reserved diff --git a/deps/glslang/Test/300.vert b/deps/glslang/Test/300.vert new file mode 100644 index 00000000..daf98b83 --- /dev/null +++ b/deps/glslang/Test/300.vert @@ -0,0 +1,204 @@ +#version 300 es + +uniform mat4x3 m43; +uniform mat3x3 m33; +uniform mat4x4 m44; + +in vec3 v3; +varying vec2 v2; // ERROR, varying reserved +in vec4 bad[10]; // ERROR, no arrayed inputs +highp in vec4 badorder; // ERROR, incorrect qualifier order +out invariant vec4 badorder2; // ERROR, incorrect qualifier order +in centroid vec4 badorder4; // ERROR, incorrect qualifier order +out flat vec4 badorder3; // ERROR, incorrect qualifier order +void bar(in const float a); // ERROR, incorrect qualifier order +void bar2(highp in float b); // ERROR, incorrect qualifier order +smooth flat out vec4 rep; // ERROR, replicating interpolation qualification +centroid sample out vec4 rep2; // ERROR, replicating auxiliary qualification +in uniform vec4 rep3; // ERROR, replicating storage qualification + +struct S { + vec3 c; + float f; +}; + +out S s; + +void main() +{ + int id = gl_VertexID + gl_InstanceID; + + int c0 = gl_MaxVertexAttribs; + int c1 = gl_MaxVertexUniformVectors; + int c2 = gl_MaxVertexOutputVectors; + int c3 = gl_MaxFragmentInputVectors; + int c4 = gl_MaxVertexTextureImageUnits; + int c5 = gl_MaxCombinedTextureImageUnits; + int c6 = gl_MaxTextureImageUnits; + int c7 = gl_MaxFragmentUniformVectors; + int c8 = gl_MaxDrawBuffers; + int c9 = gl_MinProgramTexelOffset; + int c10 = gl_MaxProgramTexelOffset; + + mat3x4 tm = transpose(m43); + highp float dm = determinant(m44); + mat3x3 im = inverse(m33); + + mat3x2 op = outerProduct(v2, v3); + + gl_Position = m44[2]; + gl_PointSize = v2.y; + + s.c = v3; + s.f = dm; + +#ifdef GL_ES +#error GL_ES is set +#else +#error GL_ES is not set +#endif +} + +float badsize[]; // ERROR +float[] badsize2; // ERROR +uniform ub { + int a[]; // ERROR +} ubInst[]; // ERROR +void foo(int a[]); // ERROR +float okayA[] = float[](3.0f, 4.0F); // Okay + +out vec3 newV; +void newVFun() +{ + newV = v3; +} + +invariant newV; // ERROR, variable already used +in vec4 invIn; +invariant invIn; // ERROR, in v300 +out S s2; +invariant s2; +invariant out S s3; +flat out int; + +uniform ub2 { + float f; +} a; + +uniform ub2 { // ERROR redeclaration of block name (same instance name) + float g; +} a; + +uniform ub2 { // ERROR redeclaration of block name (different instance name) + float f; +} c; + +uniform ub2 { // ERROR redeclaration of block name (no instance name) + float f123; +}; + +uniform ub3 { + bool b23; +}; + +uniform ub3 { // ERROR redeclaration of block name (no instance name in first or declared) + bool b234; +}; + +precision lowp sampler3D; +precision lowp sampler2DShadow; +precision lowp sampler2DArrayShadow; + +uniform sampler2D s2D; +uniform sampler3D s3D; +uniform sampler2DShadow s2DS; +uniform sampler2DArrayShadow s2DAS; +in vec2 c2D; + +void foo23() +{ + ivec2 x1 = textureSize(s2D, 2); + textureSize(s2D); // ERROR, no lod + ivec3 x3 = textureSize(s2DAS, -1); + textureSize(s2DAS); // ERROR, no lod + vec4 x4 = texture(s2D, c2D); + texture(s2D, c2D, 0.2); // ERROR, bias + vec4 x5 = textureProjOffset(s3D, vec4(0.2), ivec3(1)); + textureProjOffset(s3D, vec4(0.2), ivec3(1), .03); // ERROR, bias + float x6 = textureProjGradOffset(s2DS, invIn, vec2(4.2), vec2(5.3), ivec2(1)); +} + +int fgfg(float f, mediump int i); +int fgfg(float f, highp int i); // ERROR, precision qualifier difference + +int fgfgh(float f, const in mediump int i); +int fgfgh(float f, in mediump int i); // ERROR, precision qualifier difference + +void foo2349() +{ + float[] x = float[] (1.0, 2.0, 3.0); + float[] y = x; + float[3] z = x; + float[3] w; + w = y; +} + +int[] foo213234(); // ERROR +int foo234234(float[]); // ERROR +int foo234235(vec2[] v); // ERROR +precision highp float[2]; // ERROR + +int fffg(float f); +int fffg(float f); + +int gggf(float f); +int gggf(float f) { return 2; } +int gggf(float f); + +int agggf(float f) { return 2; } +int agggf(float f); + +out struct Ssss { float f; } ssss; + +uniform Bblock { + int a; +} Binst; +int Bfoo; + +layout(std140) Binst; // ERROR +layout(std140) Bblock; // ERROR +layout(std140) Bfoo; // ERROR + +layout(std430) uniform B430 { int a; } B430i; // ERROR + +struct SNA { + int a[]; // ERROR +}; + +void fooDeeparray() +{ + float[] x = float[] (1.0, 2.0, 3.0), + y = float[] (1.0, 2.0, 3.0, 4.0); + float xp[3], yp[4]; + xp = x; + yp = y; + xp = y; // ERROR, wrong size + yp = x; // ERROR, wrong size +} + +layout(num_views = 2) in; // ERROR, no extension + +void mwErr() +{ + gl_ViewID_OVR; // ERROR, no extension +} + +#extension GL_OVR_multiview : enable + +layout(num_views = 2) uniform float mwUniform; // ERROR, must be global +layout(num_views = 2) in; // OK + +void mwOk() +{ + gl_ViewID_OVR; +} diff --git a/deps/glslang/Test/300BuiltIns.frag b/deps/glslang/Test/300BuiltIns.frag new file mode 100644 index 00000000..89233e26 --- /dev/null +++ b/deps/glslang/Test/300BuiltIns.frag @@ -0,0 +1,76 @@ +#version 300 es + +int imax, imin; +uint umax, umin; + +vec3 x, y; // ERROR, needs default precision +bvec3 bv; + +uint uy; +uvec2 uv2c; +uvec2 uv2y; +uvec2 uv2x; +uvec4 uv4y; + +ivec3 iv3a; +ivec3 iv3b; + +ivec4 iv4a; +ivec4 iv4b; + +float f; + +vec2 v2a, v2b; +vec4 v4; + +void main() +{ + // 1.3 int + vec3 v = mix(x, y, bv); + ivec4 iv10 = abs(iv4a); + ivec4 iv11 = sign(iv4a); + ivec4 iv12 = min(iv4a, iv4b); + ivec4 iv13 = min(iv4a, imin); + uvec2 u = min(uv2x, uv2y); + uvec4 uv = min(uv4y, uy); + ivec3 iv14 = max(iv3a, iv3b); + ivec4 iv15 = max(iv4a, imax); + uvec2 u10 = max(uv2x, uv2y); + uvec2 u11 = max(uv2x, uy); + ivec4 iv16 = clamp(iv4a, iv4a, iv4b); + ivec4 iv17 = clamp(iv4a, imin, imax); + uvec2 u12 = clamp(uv2x, uv2y, uv2c); + uvec4 uv10 = clamp(uv4y, umin, umax); + + // 1.3 float + vec3 modfOut; + vec3 v11 = modf(x, modfOut); + + float t = trunc(f); + vec2 v12 = round(v2a); + vec2 v13 = roundEven(v2a); + bvec2 b10 = isnan(v2a); + bvec4 b11 = isinf(v4); + + // 3.3 float + int i = floatBitsToInt(f); + uvec4 uv11 = floatBitsToUint(v4); + vec4 v14 = intBitsToFloat(iv4a); + vec2 v15 = uintBitsToFloat(uv2c); + + // 4.0 pack + uint u19 = packSnorm2x16(v2a); + vec2 v20 = unpackSnorm2x16(uy); + uint u15 = packUnorm2x16(v2a); + vec2 v16 = unpackUnorm2x16(uy); + uint u17 = packHalf2x16(v2b); + vec2 v18 = unpackHalf2x16(uy); + + // not present + noise2(v18); // ERROR, not present + + float t__; // ERROR, no __ until revision 310 + + // ERROR, no __ until revision 310 + #define __D +} diff --git a/deps/glslang/Test/300block.frag b/deps/glslang/Test/300block.frag new file mode 100644 index 00000000..9820e2a9 --- /dev/null +++ b/deps/glslang/Test/300block.frag @@ -0,0 +1,58 @@ +#version 300 es + +precision mediump float; + +struct S { + vec4 u; + uvec4 v; + lowp isampler3D sampler; + vec3 w; + struct T1 { // ERROR + int a; + } t; +}; + +uniform S s; + +uniform fooBlock { + uvec4 bv; + uniform mat2 bm2; + lowp isampler2D sampler; // ERROR + struct T2 { // ERROR + int a; + } t; + S fbs; // ERROR, contains a sampler +}; + +uniform barBlock { + uvec4 nbv; + int ni; +} inst; + +uniform barBlockArray { + uvec4 nbv; + int ni; +} insts[4]; + +uniform unreferenced { + float f; + uint u; +}; + +void main() +{ + texture(s.sampler, vec3(inst.ni, bv.y, insts[2].nbv.z)); + insts[s.v.x]; // ERROR + fooBlock; // ERROR + mat4(s); // ERROR + int insts; + float barBlock; + mat4(barBlock); + mat4(unreferenced); // ERROR, bad type + ++s; // ERROR + inst - 1; // ERROR + ++barBlock; + 2 * barBlockArray; // ERROR +} + +int fooBlock; // ERROR, redef. diff --git a/deps/glslang/Test/300layout.frag b/deps/glslang/Test/300layout.frag new file mode 100644 index 00000000..32a6b026 --- /dev/null +++ b/deps/glslang/Test/300layout.frag @@ -0,0 +1,19 @@ +#version 300 es +precision mediump float; +in vec4 pos; +layout (location = 2) in vec4 color; // ERROR + +layout(location = 1) out vec4 c; +layout(location = 3) out vec4 p; +layout(location = 4) out vec4 q[2]; + +void main() +{ + c = color; + p = pos; + q[1] = pos; +} + +layout(location = 40) out float ca[4]; // ERROR, overlap, ERROR too big +layout(location = 41) out float cb[2]; // ERROR, overlap, ERROR too big +layout(location = 39) out float cc[6]; // ERROR, overlap, ERROR too big diff --git a/deps/glslang/Test/300layout.vert b/deps/glslang/Test/300layout.vert new file mode 100644 index 00000000..06d1206d --- /dev/null +++ b/deps/glslang/Test/300layout.vert @@ -0,0 +1,57 @@ +#version 300 es + +struct s { vec4 v; }; + +layout(location = 7) in vec3 c; +layout(LocatioN = 3) in vec4 p; +layout(LocatioN = 9) in vec4 q[4]; // ERROR, no array +layout(LocatioN = 10) in s r[4]; // ERROR, no struct, ERROR, location overlap +out vec4 pos; +out vec3 color; + +layout(shared, column_major) uniform mat4 badm4; // ERROR +layout(shared, column_major, row_major) uniform; // default is now shared and row_major + +layout(std140) uniform Transform { // layout of this block is std140 + mat4 M1; // row_major + layout(column_major) mat4 M2; // column major + mat3 N1; // row_major + centroid float badf; // ERROR + in float badg; // ERROR + layout(std140) float bad1; + layout(shared) float bad2; + layout(packed) float bad3; +} tblock; + +uniform T2 { // layout of this block is shared + bool b; + mat4 t2m; +}; + +layout(column_major) uniform T3 { // shared and column_major + mat4 M3; // column_major + layout(row_major) mat4 M4; // row major + mat3 N2; // column_major + int b; // ERROR, redefinition (needs to be last member of block for testing, following members are skipped) +}; + +out badout { // ERROR + float f; +}; + +layout (location = 10) out vec4 badoutA; // ERROR + +void main() +{ + pos = p * (tblock.M1 + tblock.M2 + M4 + M3 + t2m); + color = c * tblock.N1; +} + +shared vec4 compute_only; // ERROR + +layout(packed) uniform; + +layout(packed) uniform float aoeuntaoeu; // ERROR, packed on variable + +layout(location = 40) in float cd; +layout(location = 37) in mat4x3 ce; // ERROR, overlap diff --git a/deps/glslang/Test/300link.frag b/deps/glslang/Test/300link.frag new file mode 100644 index 00000000..5d39cc0f --- /dev/null +++ b/deps/glslang/Test/300link.frag @@ -0,0 +1,8 @@ +#version 300 es + +precision highp float; + +out vec4 color1; +out vec4 color2; + +void main() {} diff --git a/deps/glslang/Test/300link2.frag b/deps/glslang/Test/300link2.frag new file mode 100644 index 00000000..7800ac9b --- /dev/null +++ b/deps/glslang/Test/300link2.frag @@ -0,0 +1,11 @@ +#version 300 es +precision mediump float; +in vec4 pos; + +layout(location = 1) out vec4 c; +layout(location = 5) out vec4 p; +layout(location = 9) out vec4 q[2]; + +void main() +{ +} diff --git a/deps/glslang/Test/300link3.frag b/deps/glslang/Test/300link3.frag new file mode 100644 index 00000000..410592c6 --- /dev/null +++ b/deps/glslang/Test/300link3.frag @@ -0,0 +1,7 @@ +#version 300 es + +precision highp float; + +out vec4 color1; + +void main() {} diff --git a/deps/glslang/Test/300operations.frag b/deps/glslang/Test/300operations.frag new file mode 100644 index 00000000..5992987a --- /dev/null +++ b/deps/glslang/Test/300operations.frag @@ -0,0 +1,135 @@ +#version 300 es + +uniform block { + mediump float f; +} instanceName; + +struct S { + int i; +} s; + +float a[5]; + +void main() +{ + bool b; + float f; + int i; + uint u; + bvec3 b3; + vec3 v3; + ivec3 iv3; + uvec3 uv3; + vec4 v4; + ivec4 iv4; + uvec4 uv4; + mat2 m2; + mat4 m4; + + // These are all errors: + instanceName + instanceName; + s + s; + i + f; + u + f; + u + i; + iv3 *= iv4; + iv4 / uv4; + i - v3; + iv3 + uv3; + a * a; + b / b; + + f % f; + i % f; + f % u; + instanceName++; + ++s; + a--; + ++b3; + + iv3 < uv3; + m2 > m2; + m2 != m4; + i >= u; + a <= a; + b > b; + + b && b3; + b3 ^^ b3; + b3 || b; + i && i; + u || u; + m2 ^^ m2; + + !u; + !i; + !m2; + !v3; + !a; + + ~f; + ~m4; + ~v3; + ~a; + ~instanceName; + + i << iv3; + u << uv3; + i >> f; + f >> i; + m4 >> i; + a >> u; + iv3 >> iv4; + + i & u; + u &= uv3; + i | uv3; + u & f; + m2 | m2; + s ^ s; + (f = f) = f; + + // These are all okay: + f * v4; + u + u; + uv4 / u; + iv3 -= iv3; + + i %= 3; + uv3 % 4u; + --m2; + iv4++; + + m4 != m4; + m2 == m2; + i <= i; + a == a; + s != s; + + b && b; + b || b; + b ^^ b; + + !b, uv3; + + ~i; + ~u; + ~uv3; + ~iv3; + + uv3 <<= i; + i >> i; + u << u; + iv3 >> iv3; + + i & i; + u | u; + iv3 ^ iv3; + u & uv3; + uv3 | u; + uv3 &= u; + int arr[0x222 & 0xf]; + arr[1]; // size 2 + int arr2[(uvec2(0, 0x2) | 0x1u).y]; + arr2[2]; // size 3 +} diff --git a/deps/glslang/Test/300samplerExternal.frag b/deps/glslang/Test/300samplerExternal.frag new file mode 100644 index 00000000..3724f8e0 --- /dev/null +++ b/deps/glslang/Test/300samplerExternal.frag @@ -0,0 +1,41 @@ +#version 300 es + +#extension GL_OES_EGL_image_external_essl3 : enable + +uniform samplerExternalOES sExt; +precision mediump samplerExternalOES; +uniform samplerExternalOES mediumExt; +uniform highp samplerExternalOES highExt; + +void main() +{ + texture2D(sExt, vec2(0.2)); // ERROR + texture2D(mediumExt, vec2(0.2)); // ERROR + texture2D(highExt, vec2(0.2)); // ERROR + texture2DProj(sExt, vec3(0.3)); // ERROR + texture2DProj(sExt, vec4(0.3)); // ERROR + + int lod = 0; + highp float bias = 0.01; + textureSize(sExt, lod); + texture(sExt, vec2(0.2)); + texture(sExt, vec2(0.2), bias); + textureProj(sExt, vec3(0.2)); + textureProj(sExt, vec3(0.2), bias); + textureProj(sExt, vec4(0.2)); + textureProj(sExt, vec4(0.2), bias); + texelFetch(sExt, ivec2(4), lod); + + texture3D(sExt, vec3(0.3)); // ERROR + texture2DProjLod(sExt, vec3(0.3), 0.3); // ERROR + texture(sExt, vec3(0.3)); // ERROR + textureProjLod(sExt, vec3(0.3), 0.3); // ERROR +} + +#extension GL_OES_EGL_image_external_essl3 : disable + +#extension GL_OES_EGL_image_external : enable +uniform samplerExternalOES badExt; // ERROR +#extension GL_OES_EGL_image_external : disable + +uniform samplerExternalOES badExt; // ERROR diff --git a/deps/glslang/Test/300scope.vert b/deps/glslang/Test/300scope.vert new file mode 100644 index 00000000..162e9982 --- /dev/null +++ b/deps/glslang/Test/300scope.vert @@ -0,0 +1,74 @@ +#version 300 es + +int f(int a, int b, int c) +{ + int a = b; // ERROR, redefinition + + { + float a = float(a) + 1.0; + } + + return a; +} + +int f(int a, int b, int c); // okay to redeclare + +bool b; +float b(int a); // ERROR: redefinition + +float c(int a); +bool c; // ERROR: redefinition + +float f; // ERROR: redefinition +float tan; // ERROR: redefines built-in function +float sin(float x); // ERROR: can't redefine built-in functions +float cos(float x) // ERROR: can't redefine built-in functions +{ + return 1.0; +} +bool radians(bool x) // ERROR: can't overload built-in functions +{ + return true; +} + +invariant gl_Position; + +void main() +{ + int g(); // ERROR: no local function declarations + g(); + + float sin; // okay + sin; + sin(0.7); // ERROR, use of hidden function + f(1,2,3); + + float f; // hides f() + f = 3.0; + + gl_Position = vec4(f); + + for (int f = 0; f < 10; ++f) + ++f; + + int x = 1; + { + float x = 2.0, /* 2nd x visible here */ y = x; // y is initialized to 2 + int z = z; // ERROR: z not previously defined. + } + { + int x = x; // x is initialized to '1' + } + + struct S + { + int x; + }; + { + S S = S(0); // 'S' is only visible as a struct and constructor + S.x; // 'S' is now visible as a variable + } + + int degrees; + degrees(3.2); // ERROR, use of hidden built-in function +} diff --git a/deps/glslang/Test/310.comp b/deps/glslang/Test/310.comp new file mode 100644 index 00000000..9ca8eaaa --- /dev/null +++ b/deps/glslang/Test/310.comp @@ -0,0 +1,256 @@ +#version 310 es + +layout(local_size_x = 2) in; +layout(local_size_x = 16) in; // ERROR, changing +layout(local_size_z = 4096) in; // ERROR, too large +layout(local_size_x = 2) in; +layout(local_size_y = 0) in; // ERROR, 0 not allowed +const int total = gl_MaxComputeWorkGroupCount.y + + gl_MaxComputeUniformComponents + + gl_MaxComputeTextureImageUnits + + gl_MaxComputeImageUniforms + + gl_MaxComputeAtomicCounters + + gl_MaxComputeAtomicCounterBuffers; + +buffer ShaderStorageBlock +{ + int value; + float values[]; +}; + +buffer InvalidShaderStorageBlock +{ + float values[]; // ERROR + int value; +} invalid; + +void main() +{ + barrier(); + memoryBarrier(); + memoryBarrierAtomicCounter(); + memoryBarrierBuffer(); + memoryBarrierShared(); + memoryBarrierImage(); + groupMemoryBarrier(); + value = int(values[gl_LocalInvocationIndex]); +} + +layout(location = 2) in vec3 v3; // ERROR +in float f; // ERROR +out float fo; // ERROR + +shared vec4 s; +layout(location = 2) shared vec4 sl; // ERROR +shared float fs = 4.2; // ERROR + +layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) out; // ERROR + +int arrX[gl_WorkGroupSize.x]; +int arrY[gl_WorkGroupSize.y]; +int arrZ[gl_WorkGroupSize.z]; + +readonly buffer roblock +{ + int value; + float values[]; +} ro; + +void foo() +{ + ro.values[2] = 4.7; // ERROR, readonly + ro.values.length(); + ++s; +} + +buffer vec4 v; // ERROR + +uniform usampler2D us2dbad; // ERROR, default precision + +precision highp usampler2D; +precision highp iimage2DArray; +precision highp iimage2D; + +uniform usampler2D us2d; + +uniform iimage2DArray ii2dabad; // ERROR, not writeonly +uniform writeonly iimage2DArray ii2da; + +layout(r32i) uniform iimage2D iimg2D; +layout(rgba32i) uniform readonly iimage2D iimg2Drgba; +layout(rgba32f) uniform readonly image2D img2Drgba; // ERROR, no default +layout(r32ui) uniform uimage2D uimg2D; // ERROR, no default + +void qux() +{ + int i = 4; + imageAtomicCompSwap(iimg2D, ivec2(i,i), i, i);// ERROR no longer in 310 + imageAtomicAdd(uimg2D, ivec2(i,i), uint(i)); // ERROR no longer in 310 + imageAtomicMin(iimg2Drgba, ivec2(i,i), i); // ERROR no longer in 310 // ERROR iimg2Drgba does not have r32i layout + imageAtomicMax(img2Drgba, ivec2(i,i), i); // ERROR no longer in 310 // ERROR img2Drgba is not integer image + ivec4 pos = imageLoad(iimg2D, ivec2(i,i)); + imageStore(ii2da, ivec3(i,i,i), ivec4(0)); + imageLoad(img2Drgba, ivec2(i,i)); + imageLoad(ii2da, ivec3(i,i,i)); // ERROR, drops writeonly +} + +volatile float vol; // ERROR, not an image +readonly int vol2; // ERROR, not an image + +void passr(coherent readonly iimage2D image) +{ +} + +layout(r32i) coherent readonly uniform iimage2D qualim1; +layout(r32i) coherent restrict readonly uniform iimage2D qualim2; + +void passrc() +{ + passr(qualim1); + passr(qualim2); // ERROR, drops restrict + passr(iimg2D); +} + +highp layout(rg8i) uniform readonly uimage2D i1bad; // ERROR, type mismatch +highp layout(rgba32i) uniform readonly image2D i2bad; // ERROR, type mismatch +highp layout(rgba32f) uniform readonly uimage2D i3bad; // ERROR, type mismatch +layout(r8_snorm) uniform readonly iimage2D i4bad; // ERROR, type mismatch +layout(rgba32ui) uniform readonly iimage2D i5bad; // ERROR, type mismatch +layout(r8ui) uniform readonly iimage2D i6bad; // ERROR, type mismatch + +layout(binding = 0) uniform atomic_uint counter; + +uint func(atomic_uint c) +{ + return atomicCounterIncrement(c); +} + +uint func2(out atomic_uint c) // ERROR, output +{ + return counter; // ERROR, type mismatch + return atomicCounter(counter); +} + +void mainAC() +{ + atomic_uint non_uniform_counter; // ERROR + uint val = atomicCounter(counter); + atomicCounterDecrement(counter); +} + +layout(binding = 1) uniform mediump atomic_uint counterBad; // ERROR, not highp + +layout(binding = 2, offset = 4) uniform atomic_uint countArr[4]; +uniform int i; + +void opac() +{ + int a[3]; + a[counter]; // ERROR, non-integer + countArr[2]; + countArr[i]; +} + +shared int atomi; +shared uint atomu; + +void atoms() +{ + int origi = atomicAdd(atomi, 3); + uint origu = atomicAnd(atomu, 7u); + origi = atomicExchange(atomi, 4); + origu = atomicCompSwap(atomu, 10u, 8u); +} + +precision highp atomic_uint; +precision lowp atomic_uint; // ERROR + +precise int pfoo; // ERROR, reserved + +dmat2x4 dm; // ERROR +uniform samplerCubeArray sca; // ERROR +uniform iimage2DRect i2dr; // ERROR +highp uniform image2DMS i2dms; // ERROR +uniform uimage2DMSArray u2dmsa; // ERROR + +highp layout(r32f) coherent volatile restrict readonly writeonly uniform image2D okay1; + layout(r32i) coherent volatile restrict readonly uniform iimage2D okay2; +highp layout(r32ui) coherent volatile restrict writeonly uniform uimage2D okay3; +highp layout(r32f) coherent volatile restrict uniform image2D okay4; + +highp layout(rgba32f) coherent volatile restrict uniform image2D badQ1; // ERROR, bad qualifiers + layout(rgba8i) coherent volatile restrict uniform iimage2D badQ2; // ERROR, bad qualifiers +highp layout(rgba16ui) coherent volatile restrict uniform uimage2D badQ3; // ERROR, bad qualifiers + +writeonly buffer woblock +{ + int value; + float values[]; +} wo; + +void foowo() +{ + float g; + g = wo.values[2]; // ERROR, writeonly + float f = wo.values[2]; // ERROR, writeonly + ++wo.values[2]; // ERROR, writeonly + wo.values[2]--; // ERROR, writeonly + f + wo.values[2]; // ERROR, writeonly + wo.values[2] - f; // ERROR, writeonly + bool b; + b ? f : wo.values[2]; // ERROR, writeonly + b ? wo.values[2] : f; // ERROR, writeonly + if (f == wo.values[2]) // ERROR, writeonly + ++f; + if (f >= wo.values[2]) // ERROR, writeonly + ++f; + f = vec3(wo.values[2]).x; // ERROR, writeonly + ~wo.value; // ERROR, writeonly + wo.values[2] = 3.4; +} + +buffer multioblock +{ + readonly int value; + writeonly float values[]; +} multio; + +void foomultio() +{ + float g; + g = wo.values[2]; // ERROR, writeonly + ~wo.value; + wo.values[2] = 3.4; + wo.value = 2; // ERROR, readonly +} + +in inb { // ERROR + int a; +} inbi; + +out outb { // ERROR + int a; +} outbi; + +float t__; // ERROR, no __ until revision 310 + + // ERROR, no __ until revision 310 +#define __D + +shared vec4 arr[2][3][4]; + +void devi() +{ + gl_DeviceIndex; // ERROR, no extension + gl_ViewIndex; // ERROR, never this stage +} + +#ifdef GL_EXT_device_group +#extension GL_EXT_device_group : enable +#endif + +void devie() +{ + gl_DeviceIndex; + gl_ViewIndex; // ERROR, never this stage +} diff --git a/deps/glslang/Test/310.frag b/deps/glslang/Test/310.frag new file mode 100644 index 00000000..6814e6c5 --- /dev/null +++ b/deps/glslang/Test/310.frag @@ -0,0 +1,451 @@ +#version 310 es +highp float nodef3(float); // ERROR, no default precision +precision mediump float; +precision highp usampler2D; +precision highp sampler2D; +precision highp isampler2DArray; + +layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; // ERROR, not supported + +layout(location = 2) in vec3 v3; +layout(location = 2) in mat4 yi; // ERROR, locations conflict with xi + +uniform sampler2D arrayedSampler[5]; +uniform usampler2D usamp2d; +uniform usampler2DRect samp2dr; // ERROR, reserved +uniform isampler2DArray isamp2DA; + +in vec2 c2D; +uniform int i; + +void main() +{ + vec4 v = texture(arrayedSampler[i], c2D); // ERROR + + ivec2 offsets[4]; + const ivec2 constOffsets[4] = ivec2[4](ivec2(1,2), ivec2(3,4), ivec2(15,16), ivec2(-2,0)); + uvec4 uv4 = textureGatherOffsets(samp2dr, c2D, offsets, 2); // ERROR, not supported + vec4 v4 = textureGather(arrayedSampler[0], c2D); + ivec4 iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 3); + iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), i); // ERROR, last argument not const + iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 4); // ERROR, last argument out of range + iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 1+2); + iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(0.5)); + iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(i)); // ERROR, offset not constant +} + +out vec4 outp; +void foo23() +{ + const ivec2[3] offsets = ivec2[3](ivec2(1,2), ivec2(3,4), ivec2(15,16)); + + textureProjGradOffset(usamp2d, outp, vec2(0.0), vec2(0.0), ivec2(c2D)); // ERROR, offset not constant + textureProjGradOffset(usamp2d, outp, vec2(0.0), vec2(0.0), offsets[1]); + textureProjGradOffset(usamp2d, outp, vec2(0.0), vec2(0.0), offsets[2]); // ERROR, offset out of range + textureProjGradOffset(usamp2d, outp, vec2(0.0), vec2(0.0), ivec2(-10, 20)); // ERROR, offset out of range + + if (gl_HelperInvocation) + ++outp; + + int sum = gl_MaxVertexImageUniforms + + gl_MaxFragmentImageUniforms + + gl_MaxComputeImageUniforms + + gl_MaxCombinedImageUniforms + + gl_MaxCombinedShaderOutputResources; + + bool b1, b2, b3, b; + + b1 = mix(b2, b3, b); + uvec3 um3 = mix(uvec3(i), uvec3(i), bvec3(b)); + ivec4 im4 = mix(ivec4(i), ivec4(i), bvec4(b)); +} + +layout(binding=3) uniform sampler2D s1; +layout(binding=3) uniform sampler2D s2; // ERROR: overlapping bindings? Don't see that in the 310 spec. +highp layout(binding=2) uniform writeonly image2D i2D; + layout(binding=4) uniform readonly image3D i3D; // ERROR, no default precision + layout(binding=5) uniform imageCube iCube; // ERROR, no default precision + layout(binding=6) uniform image2DArray i2DA; // ERROR, no default precision + layout(binding=6) uniform coherent volatile restrict image2D i2Dqualified; // ERROR, no default precision + +layout(binding = 1) uniform bb { + int foo; + layout(binding = 2) float f; // ERROR +} bbi; + +in centroid vec4 centroidIn; +layout(location = 200000) uniform vec4 bigl; // ERROR, location too big + +layout(early_fragment_tests) in; + +layout(location = 40) out vec4 bigout1; // ERROR, too big +layout(location = 40) out vec4 bigout2; // ERROR, overlap +layout(location = -2) out vec4 neg; // ERROR, negative + +layout(std430) buffer b430 { + int i; +} b430i; + +layout(shared) uniform bshar { + int i; +} bshari; + +in smooth vec4 smoothIn; +in flat int flatIn; + +uniform sampler2DMS s2dms; // ERROR, no default precision qualifier + +void foots() +{ + highp ivec2 v2 = textureSize(s1, 2); + highp ivec3 v3 = textureSize(isamp2DA, 3); + v2 = textureSize(s2dms); + v2 = imageSize(i2D); + v3 = imageSize(i3D); + v2 = imageSize(iCube); + v3 = imageSize(i2DA); + v2 = imageSize(i2Dqualified); +} + +out bool bout; // ERROR +highp out image2D imageOut; // ERROR +out mat2x3 mout; // ERROR + +in bool inb; // ERROR +in sampler2D ino; // ERROR +in float ina[4]; +in float inaa[4][2]; // ERROR +struct S { float f; }; +in S ins; +in S[4] inasa; // ERROR +in S insa[4]; // ERROR +struct SA { float f[4]; }; +in SA inSA; // ERROR +struct SS { float f; S s; }; +in SS inSS; // ERROR + +#ifndef GL_EXT_shader_io_blocks +#error GL_EXT_shader_io_blocks not defined +#endif + +#extension GL_EXT_shader_io_blocks : enable + +out outbname { int a; } outbinst; // ERROR, not out block in fragment shader + +in inbname { + int a; + vec4 v; + struct { int b; } s; // ERROR, nested struct definition +} inbinst; + +in inbname2 { + layout(location = 12) int aAnon; + layout(location = 13) centroid in vec4 vAnon; +}; + +in layout(location = 13) vec4 aliased; // ERROR, aliased + +in inbname2 { // ERROR, reuse of block name + int aAnon; + centroid in vec4 vAnon; +}; + +in badmember { // ERROR, aAnon already in global scope + int aAnon; +}; + +int inbname; // ERROR, redefinition of block name + +vec4 vAnon; // ERROR, anon in global scope; redefinition + +in arrayed { + float f; +} arrayedInst[4]; + +void fooIO() +{ + vec4 v = inbinst.v + vAnon; + v *= arrayedInst[2].f; + v *= arrayedInst[i].f; +} + +in vec4 gl_FragCoord; +layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; // ERROR, non-ES + +layout(early_fragment_tests) in; +out float gl_FragDepth; +layout(depth_any) out float gl_FragDepth; // ERROR, non-ES + +void foo_IO() +{ + gl_FragDepth = 0.2; // ERROR, early_fragment_tests declared + gl_Layer; // ERROR, not present + gl_PrimitiveID; // ERROR, not present + bool f = gl_FrontFacing; +} + +out float gl_FragDepth; + +#extension GL_OES_geometry_shader : enable + +void foo_GS() +{ + highp int l = gl_Layer; + highp int p = gl_PrimitiveID; +} + +in vec2 inf, ing; +uniform ivec2 offsets[4]; +uniform sampler2D sArray[4]; +uniform int sIndex; +layout(binding = 0) uniform atomic_uint auArray[2]; +uniform ubName { int i; } ubInst[4]; +buffer bbName { int i; } bbInst[4]; +highp uniform writeonly image2D iArray[5]; +const ivec2 constOffsets[4] = ivec2[4](ivec2(0.1), ivec2(0.2), ivec2(0.3), ivec2(0.4)); + +void pfooBad() +{ + precise vec2 h; // ERROR reserved + h = fma(inf, ing, h); // ERROR, not available + textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf)); // ERROR, offset not constant + textureGatherOffsets(sArray[0], vec2(0.1), constOffsets); // ERROR, not available +} + +#extension GL_OES_gpu_shader5 : enable + +void pfoo() +{ + precise vec2 h; + h = fma(inf, ing, h); + textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf)); + textureGatherOffsets(sArray[0], vec2(0.1), constOffsets); + textureGatherOffsets(sArray[0], vec2(0.1), offsets); // ERROR, offset not constant +} + +#extension GL_EXT_texture_cube_map_array : enable + +precision highp imageCubeArray ; +precision highp iimageCubeArray ; +precision highp uimageCubeArray ; + +precision highp samplerCubeArray ; +precision highp samplerCubeArrayShadow; +precision highp isamplerCubeArray ; +precision highp usamplerCubeArray ; + +uniform writeonly imageCubeArray CA1; +uniform writeonly iimageCubeArray CA2; +uniform writeonly uimageCubeArray CA3; + +#ifdef GL_EXT_texture_cube_map_array +uniform samplerCubeArray CA4; +uniform samplerCubeArrayShadow CA5; +uniform isamplerCubeArray CA6; +uniform usamplerCubeArray CA7; +#endif + +void CAT() +{ + highp vec4 b4 = texture(CA4, vec4(0.5), 0.24); + highp ivec4 b6 = texture(CA6, vec4(0.5), 0.26); + highp uvec4 b7 = texture(CA7, vec4(0.5), 0.27); +} + +void badSample() +{ + lowp int a1 = gl_SampleID; // ERROR, need extension + mediump vec2 a2 = gl_SamplePosition; // ERROR, need extension + highp int a3 = gl_SampleMaskIn[0]; // ERROR, need extension + gl_SampleMask[0] = a3; // ERROR, need extension + mediump int n = gl_NumSamples; // ERROR, need extension +} + +#ifdef GL_OES_sample_variables +#extension GL_OES_sample_variables : enable +#endif + +void goodSample() +{ + lowp int a1 = gl_SampleID; + mediump vec2 a2 = gl_SamplePosition; + highp int a3 = gl_SampleMaskIn[0]; + gl_SampleMask[0] = a3; + mediump int n1 = gl_MaxSamples; + mediump int n2 = gl_NumSamples; +} + +uniform layout(r32f) highp image2D im2Df; +uniform layout(r32ui) highp uimage2D im2Du; +uniform layout(r32i) highp iimage2D im2Di; +uniform ivec2 P; + +void badImageAtom() +{ + float datf; + int dati; + uint datu; + + imageAtomicAdd( im2Di, P, dati); // ERROR, need extension + imageAtomicAdd( im2Du, P, datu); // ERROR, need extension + imageAtomicMin( im2Di, P, dati); // ERROR, need extension + imageAtomicMin( im2Du, P, datu); // ERROR, need extension + imageAtomicMax( im2Di, P, dati); // ERROR, need extension + imageAtomicMax( im2Du, P, datu); // ERROR, need extension + imageAtomicAnd( im2Di, P, dati); // ERROR, need extension + imageAtomicAnd( im2Du, P, datu); // ERROR, need extension + imageAtomicOr( im2Di, P, dati); // ERROR, need extension + imageAtomicOr( im2Du, P, datu); // ERROR, need extension + imageAtomicXor( im2Di, P, dati); // ERROR, need extension + imageAtomicXor( im2Du, P, datu); // ERROR, need extension + imageAtomicExchange(im2Di, P, dati); // ERROR, need extension + imageAtomicExchange(im2Du, P, datu); // ERROR, need extension + imageAtomicExchange(im2Df, P, datf); // ERROR, need extension + imageAtomicCompSwap(im2Di, P, 3, dati); // ERROR, need extension + imageAtomicCompSwap(im2Du, P, 5u, datu); // ERROR, need extension +} + +#ifdef GL_OES_shader_image_atomic +#extension GL_OES_shader_image_atomic : enable +#endif + +uniform layout(rgba32f) highp image2D badIm2Df; // ERROR, needs readonly or writeonly +uniform layout(rgba8ui) highp uimage2D badIm2Du; // ERROR, needs readonly or writeonly +uniform layout(rgba16i) highp iimage2D badIm2Di; // ERROR, needs readonly or writeonly + +void goodImageAtom() +{ + float datf; + int dati; + uint datu; + + imageAtomicAdd( im2Di, P, dati); + imageAtomicAdd( im2Du, P, datu); + imageAtomicMin( im2Di, P, dati); + imageAtomicMin( im2Du, P, datu); + imageAtomicMax( im2Di, P, dati); + imageAtomicMax( im2Du, P, datu); + imageAtomicAnd( im2Di, P, dati); + imageAtomicAnd( im2Du, P, datu); + imageAtomicOr( im2Di, P, dati); + imageAtomicOr( im2Du, P, datu); + imageAtomicXor( im2Di, P, dati); + imageAtomicXor( im2Du, P, datu); + imageAtomicExchange(im2Di, P, dati); + imageAtomicExchange(im2Du, P, datu); + imageAtomicExchange(im2Df, P, datf); + imageAtomicCompSwap(im2Di, P, 3, dati); + imageAtomicCompSwap(im2Du, P, 5u, datu); + + imageAtomicMax(badIm2Di, P, dati); // ERROR, not an allowed layout() on the image + imageAtomicMax(badIm2Du, P, datu); // ERROR, not an allowed layout() on the image + imageAtomicExchange(badIm2Df, P, datf); // ERROR, not an allowed layout() on the image +} + +sample in vec4 colorSampInBad; // ERROR, reserved +centroid out vec4 colorCentroidBad; // ERROR +flat out vec4 colorBadFlat; // ERROR +smooth out vec4 colorBadSmooth; // ERROR +noperspective out vec4 colorBadNo; // ERROR +flat centroid in vec2 colorfc; +in float scalarIn; + +void badInterp() +{ + interpolateAtCentroid(colorfc); // ERROR, need extension + interpolateAtSample(colorfc, 1); // ERROR, need extension + interpolateAtOffset(colorfc, vec2(0.2)); // ERROR, need extension +} + +#if defined GL_OES_shader_multisample_interpolation +#extension GL_OES_shader_multisample_interpolation : enable +#endif + +sample in vec4 colorSampIn; +sample out vec4 colorSampleBad; // ERROR +flat sample in vec4 colorfsi; +sample in vec3 sampInArray[4]; + +void interp() +{ + float res; + vec2 res2; + vec3 res3; + vec4 res4; + + res2 = interpolateAtCentroid(colorfc); + res4 = interpolateAtCentroid(colorSampIn); + res4 = interpolateAtCentroid(colorfsi); + res = interpolateAtCentroid(scalarIn); + res3 = interpolateAtCentroid(sampInArray); // ERROR + res3 = interpolateAtCentroid(sampInArray[2]); + res2 = interpolateAtCentroid(sampInArray[2].xy); // ERROR + + res3 = interpolateAtSample(sampInArray, 1); // ERROR + res3 = interpolateAtSample(sampInArray[i], 0); + res2 = interpolateAtSample(sampInArray[2].xy, 2); // ERROR + res = interpolateAtSample(scalarIn, 1); + + res3 = interpolateAtOffset(sampInArray, vec2(0.2)); // ERROR + res3 = interpolateAtOffset(sampInArray[2], vec2(0.2)); + res2 = interpolateAtOffset(sampInArray[2].xy, vec2(0.2)); // ERROR, no swizzle + res = interpolateAtOffset(scalarIn + scalarIn, vec2(0.2)); // ERROR, no binary ops other than dereference + res = interpolateAtOffset(scalarIn, vec2(0.2)); + + float f; + res = interpolateAtCentroid(f); // ERROR, not interpolant + res4 = interpolateAtSample(outp, 0); // ERROR, not interpolant +} + +layout(blend_support_softlight) out; // ERROR, need extension + +#ifdef GL_KHR_blend_equation_advanced +#extension GL_KHR_blend_equation_advanced : enable +#endif + +layout(blend_support_multiply) out; +layout(blend_support_screen) out; +layout(blend_support_overlay) out; +layout(blend_support_darken, blend_support_lighten) out; +layout(blend_support_colordodge) layout(blend_support_colorburn) out; +layout(blend_support_hardlight) out; +layout(blend_support_softlight) out; +layout(blend_support_difference) out; +layout(blend_support_exclusion) out; +layout(blend_support_hsl_hue) out; +layout(blend_support_hsl_saturation) out; +layout(blend_support_hsl_color) out; +layout(blend_support_hsl_luminosity) out; +layout(blend_support_all_equations) out; + +layout(blend_support_hsl_luminosity) out; // okay to repeat + +layout(blend_support_hsl_luminosity) in; // ERROR, only on "out" +layout(blend_support_hsl_luminosity) out vec4; // ERROR, only on standalone +layout(blend_support_hsl_luminosity) out vec4 badout; // ERROR, only on standalone +layout(blend_support_hsl_luminosity) struct badS {int i;}; // ERROR, only on standalone +layout(blend_support_hsl_luminosity) void blendFoo() { } // ERROR, only on standalone +void blendFoo(layout(blend_support_hsl_luminosity) vec3 v) { } // ERROR, only on standalone +layout(blend_support_flizbit) out; // ERROR, no flizbit + +out vec4 outAA[2][2]; // ERROR + +void devi() +{ + gl_DeviceIndex; // ERROR, no extension + gl_ViewIndex; // ERROR, no extension +} + +#ifdef GL_EXT_device_group +#extension GL_EXT_device_group : enable +#endif + +#ifdef GL_EXT_device_group +#extension GL_EXT_multiview : enable +#endif + +void devie() +{ + gl_DeviceIndex; + gl_ViewIndex; +} diff --git a/deps/glslang/Test/310.geom b/deps/glslang/Test/310.geom new file mode 100644 index 00000000..bf0b1ae0 --- /dev/null +++ b/deps/glslang/Test/310.geom @@ -0,0 +1,152 @@ +#version 310 es + +#ifdef GL_EXT_geometry_shader +#extension GL_EXT_geometry_shader : enable +#else +#error no GL_EXT_geometry_shader +#endif + +#ifndef GL_OES_geometry_shader +#error no GL_OES_geometry_shader +#endif + +precision mediump float; + +in fromVertex { + in vec3 color; +} fromV[]; + +in vec4 nonBlockUnsized[]; + +out toFragment { + out vec3 color; +} toF; + +out fromVertex { // okay to reuse a block name for another block name + vec3 color; +}; + +out fooB { // ERROR, cannot reuse block name as block instance + vec2 color; +} fromVertex; + +int fromVertex; // ERROR, cannot reuse a block name for something else + +out fooC { // ERROR, cannot have same name for block and instance name + vec2 color; +} fooC; + +void main() +{ + EmitVertex(); + EndPrimitive(); + EmitStreamVertex(1); // ERROR + EndStreamPrimitive(0); // ERROR + + color = fromV[0].color; + gl_ClipDistance[3] = // ERROR, no ClipDistance + gl_in[1].gl_ClipDistance[2]; // ERROR, no ClipDistance + gl_Position = gl_in[0].gl_Position; + + gl_PrimitiveID = gl_PrimitiveIDIn; + gl_Layer = 2; +} + +layout(stream = 4) out vec4 ov4; // ERROR, no streams + +layout(line_strip, points, triangle_strip, points, triangle_strip) out; // just means triangle_strip" + +out ooutb { vec4 a; } ouuaa6; + +layout(max_vertices = 200) out; +layout(max_vertices = 300) out; // ERROR, too big +void foo(layout(max_vertices = 4) int a) // ERROR +{ + ouuaa6.a = vec4(1.0); +} + +layout(line_strip, points, triangle_strip, points) out; // ERROR, changing output primitive +layout(line_strip, points) out; // ERROR, changing output primitive +layout(triangle_strip) in; // ERROR, not an input primitive +layout(triangle_strip) uniform; // ERROR +layout(triangle_strip) out vec4 badv4; // ERROR, not on a variable +layout(triangle_strip) in vec4 bad2v4[]; // ERROR, not on a variable or input +layout(invocations = 3) out outbn { int a; }; // 2 ERROR, not on a block, not until 4.0 +out outbn2 { + layout(invocations = 3) int a; // 2 ERRORs, not on a block member, not until 4.0 + layout(max_vertices = 3) int b; // ERROR, not on a block member + layout(triangle_strip) int c; // ERROR, not on a block member +} outbi; + +layout(lines) out; // ERROR, not on output +layout(lines_adjacency) in; +layout(triangles) in; // ERROR, can't change it +layout(triangles_adjacency) in; // ERROR, can't change it +layout(invocations = 4) in; + +in sameName { + int a15; +} insn[]; + +out sameName { + float f15; +}; + +uniform sameName { + bool b15; +}; + +const int summ = gl_MaxVertexAttribs + + gl_MaxGeometryInputComponents + + gl_MaxGeometryOutputComponents + + gl_MaxGeometryImageUniforms + + gl_MaxGeometryTextureImageUnits + + gl_MaxGeometryOutputVertices + + gl_MaxGeometryTotalOutputComponents + + gl_MaxGeometryUniformComponents + + gl_MaxGeometryAtomicCounters + + gl_MaxGeometryAtomicCounterBuffers + + gl_MaxVertexTextureImageUnits + + gl_MaxCombinedTextureImageUnits + + gl_MaxTextureImageUnits + + gl_MaxDrawBuffers; + +void fooe1() +{ + gl_ViewportIndex; // ERROR, not in ES + gl_MaxViewports; // ERROR, not in ES + insn.length(); // 4: lines_adjacency + int inv = gl_InvocationID; +} + +in vec4 explArray[4]; +in vec4 explArrayBad[5]; // ERROR, wrong size +in vec4 nonArrayed; // ERROR, not an array +flat out vec3 myColor1; +centroid out vec3 myColor2; +centroid in vec3 centr[]; +sample out vec4 perSampleColor; // ERROR without sample extensions + +layout(max_vertices = 200) out; // matching redecl + +layout(location = 7, component = 2) in float comp[]; // ERROR, es has no component + +void notHere() +{ + gl_MaxGeometryVaryingComponents; // ERROR, not in ES + gl_VerticesIn; // ERROR, not in ES +} + +void pointSize1() +{ + highp float ps = gl_in[3].gl_PointSize; // ERROR, need point_size extension + gl_PointSize = ps; // ERROR, need point_size extension +} + +#extension GL_OES_geometry_point_size : enable + +void pointSize2() +{ + highp float ps = gl_in[3].gl_PointSize; + gl_PointSize = ps; +} diff --git a/deps/glslang/Test/310.tesc b/deps/glslang/Test/310.tesc new file mode 100644 index 00000000..29c39323 --- /dev/null +++ b/deps/glslang/Test/310.tesc @@ -0,0 +1,169 @@ +#version 310 es + +#extension GL_OES_tessellation_shader : enable + +layout(vertices = 4) out; +out int outa[gl_out.length()]; + +layout(quads) in; // ERROR +layout(ccw) out; // ERROR +layout(fractional_even_spacing) in; // ERROR + +patch in vec4 patchIn; // ERROR +patch out vec4 patchOut; + +void main() +{ + barrier(); + + int a = gl_MaxTessControlInputComponents + + gl_MaxTessControlOutputComponents + + gl_MaxTessControlTextureImageUnits + + gl_MaxTessControlUniformComponents + + gl_MaxTessControlTotalOutputComponents; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; // ERROR, need point_size extension + float cd = gl_in[1].gl_ClipDistance[2]; // ERROR, not in ES + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + int iid = gl_InvocationID; + + gl_out[gl_InvocationID].gl_Position = p; + gl_out[gl_InvocationID].gl_PointSize = ps; // ERROR, need point_size extension + gl_out[gl_InvocationID].gl_ClipDistance[1] = cd; // ERROR, not in ES + + gl_TessLevelOuter[3] = 3.2; + gl_TessLevelInner[1] = 1.3; + + if (a > 10) + barrier(); // ERROR + else + barrier(); // ERROR + + barrier(); + + do { + barrier(); // ERROR + } while (a > 10); + + switch (a) { + default: + barrier(); // ERROR + break; + } + a < 12 ? a : (barrier(), a); // ERROR + { + barrier(); + } + + return; + + barrier(); // ERROR +} + +layout(vertices = 4) in; // ERROR, not on in +layout(vertices = 5) out; // ERROR, changing # + +void foo() +{ + gl_out[4].gl_Position; // ERROR, out of range + + barrier(); // ERROR, not in main +} + +in vec2 ina; // ERROR, not array +in vec2 inb[]; +in vec2 inc[18]; // ERROR, wrong size +in vec2 ind[gl_MaxPatchVertices]; +patch out float implA[]; // ERROR, not sized + +#extension GL_ARB_separate_shader_objects : enable + +layout(location = 3) in vec4 ivla[]; +layout(location = 4) in vec4 ivlb[]; +layout(location = 4) in vec4 ivlc[]; // ERROR, overlapping + +layout(location = 3) out vec4 ovla[]; +layout(location = 4) out vec4 ovlb[]; +layout(location = 4) out vec4 ovlc[]; // ERROR, overlapping + +void foop() +{ + precise float d; // ERROR without gpu_shader5 + d = fma(d, d, d); // ERROR without gpu_shader5 +} + +patch out pinbn { + int a; +} pinbi; + +centroid out vec3 myColor2[]; +centroid in vec3 centr[]; +sample out vec4 perSampleColor[]; // ERROR without sample extensions + +layout(vertices = 4) out float badlay[]; // ERROR, not on a variable +out float misSized[5]; // ERROR, size doesn't match +out float okaySize[4]; + +#extension GL_OES_tessellation_point_size : enable + +void pointSize2() +{ + float ps = gl_in[1].gl_PointSize; + gl_out[gl_InvocationID].gl_PointSize = ps; +} + +#extension GL_OES_gpu_shader5 : enable + +precise vec3 pv3; + +void goodfoop() +{ + precise float d; + + pv3 *= pv3; + pv3 = fma(pv3, pv3, pv3); + d = fma(d, d, d); +} + +void bbBad() +{ + gl_BoundingBoxOES; // ERROR without GL_OES_primitive_bounding_box +} + +#extension GL_OES_primitive_bounding_box : enable + +void bb() +{ + gl_BoundingBoxOES[0] = vec4(0.0); + gl_BoundingBoxOES[1] = vec4(1.0); + gl_BoundingBoxOES[2] = vec4(2.0); // ERROR, overflow +} + +out patch badpatchBName { // ERROR, array size required + float f; +} badpatchIName[]; + +out patch patchBName { + float f; +} patchIName[4]; + +void outputtingOutparam(out int a) +{ + a = 2; +} + +void outputting() +{ + outa[gl_InvocationID] = 2; + outa[1] = 2; // ERROR, not gl_InvocationID + gl_out[0].gl_Position = vec4(1.0); // ERROR, not gl_InvocationID + outa[1]; + gl_out[0]; + outputtingOutparam(outa[0]); // ERROR, not gl_InvocationID + outputtingOutparam(outa[gl_InvocationID]); + patchIName[1].f = 3.14; + outa[(gl_InvocationID)] = 2; +} diff --git a/deps/glslang/Test/310.tese b/deps/glslang/Test/310.tese new file mode 100644 index 00000000..bbeaa87f --- /dev/null +++ b/deps/glslang/Test/310.tese @@ -0,0 +1,128 @@ +#version 310 es + +#extension GL_EXT_tessellation_shader : enable +#extension GL_OES_tessellation_shader : enable +#extension GL_EXT_tessellation_shader : disable + +layout(vertices = 4) out; // ERROR +layout(quads, cw) in; +layout(triangles) in; // ERROR +layout(isolines) in; // ERROR + +layout(ccw) in; // ERROR +layout(cw) in; + +layout(fractional_odd_spacing) in; +layout(equal_spacing) in; // ERROR +layout(fractional_even_spacing) in; // ERROR + +layout(point_mode) in; + +patch in vec4 patchIn; +patch out vec4 patchOut; // ERROR + +void main() +{ + barrier(); // ERROR + + int a = gl_MaxTessEvaluationInputComponents + + gl_MaxTessEvaluationOutputComponents + + gl_MaxTessEvaluationTextureImageUnits + + gl_MaxTessEvaluationUniformComponents + + gl_MaxTessPatchComponents + + gl_MaxPatchVertices + + gl_MaxTessGenLevel; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; // ERROR, need point_size extension + float cd = gl_in[1].gl_ClipDistance[2]; // ERROR, not in ES + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + vec3 tc = gl_TessCoord; + float tlo = gl_TessLevelOuter[3]; + float tli = gl_TessLevelInner[1]; + + gl_Position = p; + gl_PointSize = ps; // ERROR, need point_size extension + gl_ClipDistance[2] = cd; // ERROR, not in ES +} + +smooth patch in vec4 badp1; // ERROR +flat patch in vec4 badp2; // ERROR +noperspective patch in vec4 badp3; // ERROR +patch sample in vec3 badp4; // ERROR + +#extension GL_ARB_separate_shader_objects : enable + +in gl_PerVertex +{ + vec4 gl_Position; +} gl_in[]; + +in gl_PerVertex // ERROR, second redeclaration of gl_in +{ + vec4 gl_Position; +} gl_in[]; + +layout(quads, cw) out; // ERROR +layout(triangles) out; // ERROR +layout(isolines) out; // ERROR +layout(cw) out; // ERROR +layout(fractional_odd_spacing) out; // ERROR +layout(equal_spacing) out; // ERROR +layout(fractional_even_spacing) out; // ERROR +layout(point_mode) out; // ERROR + +in vec2 ina; // ERROR, not array +in vec2 inb[]; +in vec2 inc[18]; // ERROR, wrong size +in vec2 ind[gl_MaxPatchVertices]; + +in testbla { // ERROR, not array + int f; +} bla; + +in testblb { + int f; +} blb[]; + +in testblc { // ERROR wrong size + int f; +} blc[18]; + +in testbld { + int f; +} bld[gl_MaxPatchVertices]; + +layout(location = 23) in vec4 ivla[]; +layout(location = 24) in vec4 ivlb[]; +layout(location = 24) in vec4 ivlc[]; // ERROR, overlap + +layout(location = 23) out vec4 ovla[2]; +layout(location = 24) out vec4 ovlb[2]; // ERROR, overlap + +in float gl_TessLevelOuter[4]; // ERROR, can't redeclare + +patch in pinbn { + int a; +} pinbi; + +centroid out vec3 myColor2; +centroid in vec3 centr[]; +sample out vec4 perSampleColor; // ERROR without sample extensions + +#extension GL_OES_tessellation_point_size : enable + +void pointSize2() +{ + float ps = gl_in[1].gl_PointSize; // ERROR, not in the redeclaration, but no error on use of gl_PointSize + gl_PointSize = ps; +} + +#extension GL_EXT_primitive_bounding_box : enable + +void bbbad() +{ + gl_BoundingBoxOES; // ERROR, wrong stage +} diff --git a/deps/glslang/Test/310.vert b/deps/glslang/Test/310.vert new file mode 100644 index 00000000..92a50e2e --- /dev/null +++ b/deps/glslang/Test/310.vert @@ -0,0 +1,403 @@ +#version 310 es + +shared vec4 s; // ERROR +layout(local_size_x = 2) out; // ERROR +buffer vec4 v; // ERROR +in int ini; +layout(location = 2) uniform mat4 x; +layout(location = 3) uniform mat4 y; +layout(location = 2) out mat4 xi; +layout(location = 3) out mat4 yi; // ERROR, locations conflict with xi + +void main() +{ + uvec2 u2; + u2 = uaddCarry(u2, u2, u2); + uint u1; + u1 = usubBorrow(u1, u1, u1); + uvec4 u4; + umulExtended(u4, u4, u4, u4); + ivec4 i4; + imulExtended(i4, i4, i4, i4); + int i1; + i1 = bitfieldExtract(i1, 4, 5); + uvec3 u3; + u3 = bitfieldExtract(u3, 4, 5); + ivec3 i3; + i3 = bitfieldInsert(i3, i3, 4, 5); + u1 = bitfieldInsert(u1, u1, 4, 5); + ivec2 i2; + i2 = bitfieldReverse(i2); + u4 = bitfieldReverse(u4); + i1 = bitCount(i1); + i3 = bitCount(u3); + i2 = findLSB(i2); + i4 = findLSB(u4); + i1 = findMSB(i1); + i2 = findMSB(u2); + + vec3 v3; + v3 = frexp(v3, i3); + vec2 v2; + v2 = ldexp(v2, i2); + + mediump vec4 v4; + u1 = packUnorm4x8(v4); + u1 = packSnorm4x8(v4); + v4 = unpackUnorm4x8(u1); + v4 = unpackSnorm4x8(u1); +} + +precision highp sampler2DMS; +precision highp isampler2DMS; +precision highp usampler2DMS; + +uniform sampler2DMS s2dms; +uniform isampler2DMS is2dms; +uniform usampler2DMS us2dms; +uniform usampler2DMSArray us2dmsa; // ERROR + +void foo() +{ + ivec2 v2; + v2 = textureSize(s2dms); + v2 = textureSize(us2dms); + vec4 v4 = texelFetch(s2dms, v2, 2); + ivec4 iv4 = texelFetch(is2dms, v2, 2); + textureSamples(s2dms); // ERROR + float f; + frexp(f, ini); // ERROR, i not writable +} + +out bool outb; // ERROR +out sampler2D outo; // ERROR +out float outa[4]; +out float outaa[4][2]; // ERROR +struct S { float f; }; +out S outs; +out S[4] outasa; // ERROR +out S outsa[4]; // ERROR +struct SA { float f[4]; }; +out SA outSA; // ERROR +struct SS { float f; S s; }; +out SS outSS; // ERROR + +layout(std430) uniform U430 { int a; } U430i; // ERROR +layout(std430) buffer B430 { int a; } B430i; + +#ifndef GL_OES_shader_io_blocks +#error GL_OES_shader_io_blocks not defined +#endif + +#extension GL_OES_shader_io_blocks : enable + +out outbname { + int a; + out vec4 v; + highp sampler2D s; // ERROR, opaque type +} outbinst; + +out outbname2 { + layout(location = 12) int aAnon; + layout(location = 13) vec4 vAnon; +}; + +layout(location = 12) out highp int aliased; // ERROR, aliasing location + +in inbname { int a; } inbinst; // ERROR, no in block in vertex shader + +out gl_PerVertex { // ERROR, has extra member + highp vec4 gl_Position; + highp vec4 t; +}; + +void foo_IO() +{ + int sum = gl_VertexID + + gl_InstanceID; + gl_Position = vec4(1.0); + gl_PointSize = 2.0; // ERROR, removed by redeclaration +} + +out gl_PerVertex { // ERROR, already used and already redeclared + highp vec4 gl_Position; + highp vec4 t; +}; + +smooth out smo { // ERROR, no smooth on a block + int i; +} smon; + +flat out fmo { // ERROR, no flat on a block + int i; +} fmon; + +centroid out cmo { // ERROR, no centroid on a block + int i; +} cmon; + +invariant out imo { // ERROR, no invariant on a block + int i; +} imon; + +in vec2 inf, ing; +uniform ivec2 offsets[4]; +uniform sampler2D sArray[4]; +uniform int sIndex; +layout(binding = 0) uniform atomic_uint auArray[2]; +uniform ubName { int i; } ubInst[4]; +buffer bbName { int i; } bbInst[4]; +highp uniform writeonly image2D iArray[5]; +const ivec2 constOffsets[4] = ivec2[4](ivec2(0.1), ivec2(0.2), ivec2(0.3), ivec2(0.4)); + +void pfooBad() +{ + precise vec2 h; // ERROR reserved + h = fma(inf, ing, h); // ERROR, not available + sArray[sIndex + 1]; // ERRRO, not supported + auArray[sIndex + 1]; + ubInst[1]; + bbInst[2]; + ubInst[sIndex + 1]; // ERROR, not supported + bbInst[sIndex]; // ERROR, not supported + iArray[2]; + iArray[sIndex * 2]; // ERROR, not supported + textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf)); // ERROR, offset not constant + textureGatherOffsets(sArray[0], vec2(0.1), constOffsets); // ERROR, not available +} + +#extension GL_OES_gpu_shader5 : enable + +void pfoo() +{ + precise vec2 h; + h = fma(inf, ing, h); + sArray[sIndex + 1]; + ubInst[sIndex + 1]; + bbInst[sIndex - 2]; // ERROR, still not supported + iArray[2]; + iArray[sIndex - 2]; + textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf)); + textureGatherOffsets(sArray[0], vec2(0.1), constOffsets); + textureGatherOffsets(sArray[0], vec2(0.1), offsets); // ERROR, offset not constant +} + +uniform samplerBuffer badSamp1; // ERROR, reserved +uniform isamplerBuffer badSamp2; // ERROR, reserved +uniform usamplerBuffer badSamp3; // ERROR, reserved +uniform writeonly imageBuffer badSamp4; // ERROR, reserved +uniform writeonly iimageBuffer badSamp5; // ERROR, reserved +uniform writeonly uimageBuffer badSamp6; // ERROR, reserved + +#extension GL_OES_texture_buffer : enable +#extension GL_EXT_texture_buffer : enable + +uniform samplerBuffer noPreSamp1; // ERROR, no default precision +uniform isamplerBuffer noPreSamp2; // ERROR, no default precision +uniform usamplerBuffer noPreSamp3; // ERROR, no default precision +uniform writeonly imageBuffer noPreSamp4; // ERROR, no default precision +uniform writeonly iimageBuffer noPreSamp5; // ERROR, no default precision +uniform writeonly uimageBuffer noPreSamp6; // ERROR, no default precision + +precision highp samplerBuffer; +precision highp isamplerBuffer; +precision highp usamplerBuffer; +precision highp imageBuffer; +precision highp iimageBuffer; +precision highp uimageBuffer; + +#ifdef GL_OES_texture_buffer +uniform samplerBuffer bufSamp1; +uniform isamplerBuffer bufSamp2; +uniform usamplerBuffer bufSamp3; +#endif +#ifdef GL_EXT_texture_buffer +uniform writeonly imageBuffer bufSamp4; +uniform writeonly iimageBuffer bufSamp5; +uniform writeonly uimageBuffer bufSamp6; +#endif + +void bufferT() +{ + highp int s1 = textureSize(bufSamp1); + highp int s2 = textureSize(bufSamp2); + highp int s3 = textureSize(bufSamp3); + + highp int s4 = imageSize(bufSamp4); + highp int s5 = imageSize(bufSamp5); + highp int s6 = imageSize(bufSamp6); + + highp vec4 f1 = texelFetch(bufSamp1, s1); + highp ivec4 f2 = texelFetch(bufSamp2, s2); + highp uvec4 f3 = texelFetch(bufSamp3, s3); +} + +uniform writeonly imageCubeArray badCA1; // ERROR, reserved +uniform writeonly iimageCubeArray badCA2; // ERROR, reserved +uniform writeonly uimageCubeArray badCA3; // ERROR, reserved + +uniform samplerCubeArray badCA4; // ERROR, reserved +uniform samplerCubeArrayShadow badCA5; // ERROR, reserved +uniform isamplerCubeArray badCA6; // ERROR, reserved +uniform usamplerCubeArray badCA7; // ERROR, reserved + +#extension GL_OES_texture_cube_map_array : enable + +uniform writeonly imageCubeArray noPreCA1; // ERROR, no default precision +uniform writeonly iimageCubeArray noPreCA2; // ERROR, no default precision +uniform writeonly uimageCubeArray noPreCA3; // ERROR, no default precision + +uniform samplerCubeArray noPreCA4; // ERROR, no default precision +uniform samplerCubeArrayShadow noPreCA5; // ERROR, no default precision +uniform isamplerCubeArray noPreCA6; // ERROR, no default precision +uniform usamplerCubeArray noPreCA7; // ERROR, no default precision + +precision highp imageCubeArray ; +precision highp iimageCubeArray ; +precision highp uimageCubeArray ; + +precision highp samplerCubeArray ; +precision highp samplerCubeArrayShadow; +precision highp isamplerCubeArray ; +precision highp usamplerCubeArray ; + +uniform writeonly imageCubeArray CA1; +uniform writeonly iimageCubeArray CA2; +uniform writeonly uimageCubeArray CA3; + +layout(rgba16f) uniform readonly imageCubeArray rCA1; +layout(rgba32i) uniform readonly iimageCubeArray rCA2; +layout(r32ui) uniform readonly uimageCubeArray rCA3; + +#ifdef GL_OES_texture_cube_map_array +uniform samplerCubeArray CA4; +uniform samplerCubeArrayShadow CA5; +uniform isamplerCubeArray CA6; +uniform usamplerCubeArray CA7; +#endif + +void CAT() +{ + highp ivec3 s4 = textureSize(CA4, 1); + highp ivec3 s5 = textureSize(CA5, 1); + highp ivec3 s6 = textureSize(CA6, 1); + highp ivec3 s7 = textureSize(CA7, 1); + + highp vec4 t4 = texture(CA4, vec4(0.5)); + highp float t5 = texture(CA5, vec4(0.5), 3.0); + highp ivec4 t6 = texture(CA6, vec4(0.5)); + highp uvec4 t7 = texture(CA7, vec4(0.5)); + + highp vec4 L4 = textureLod(CA4, vec4(0.5), 0.24); + highp ivec4 L6 = textureLod(CA6, vec4(0.5), 0.26); + highp uvec4 L7 = textureLod(CA7, vec4(0.5), 0.27); + + highp vec4 g4 = textureGrad(CA4, vec4(0.5), vec3(0.1), vec3(0.2)); + highp ivec4 g6 = textureGrad(CA6, vec4(0.5), vec3(0.1), vec3(0.2)); + highp uvec4 g7 = textureGrad(CA7, vec4(0.5), vec3(0.1), vec3(0.2)); + + highp vec4 gath4 = textureGather(CA4, vec4(0.5)); + highp vec4 gathC4 = textureGather(CA4, vec4(0.5), 2); + highp ivec4 gath6 = textureGather(CA6, vec4(0.5)); + highp ivec4 gathC6 = textureGather(CA6, vec4(0.5), 1); + highp uvec4 gath7 = textureGather(CA7, vec4(0.5)); + highp uvec4 gathC7 = textureGather(CA7, vec4(0.5), 0); + + highp vec4 gath5 = textureGather(CA5, vec4(0.5), 2.5); + + highp ivec3 s1 = imageSize(CA1); + highp ivec3 s2 = imageSize(CA2); + highp ivec3 s3 = imageSize(CA3); + + imageStore(CA1, s3, vec4(1)); + imageStore(CA2, s3, ivec4(1)); + imageStore(CA3, s3, uvec4(1)); + + highp vec4 cl1 = imageLoad(rCA1, s3); + highp ivec4 cl2 = imageLoad(rCA2, s3); + highp uvec4 cl3 = imageLoad(rCA3, s3); +} + +uniform sampler2DMSArray bad2DMS; // ERROR, reserved +uniform isampler2DMSArray bad2DMSi; // ERROR, reserved +uniform usampler2DMSArray bad2DMSu; // ERROR, reserved + +#extension GL_OES_texture_storage_multisample_2d_array : enable + +#ifdef GL_OES_texture_storage_multisample_2d_array + +uniform sampler2DMSArray noPrec2DMS; // ERROR, no default +uniform isampler2DMSArray noPrec2DMSi; // ERROR, no default +uniform usampler2DMSArray noPrec2DMSu; // ERROR, no default + +#endif + +precision highp sampler2DMSArray; +precision highp isampler2DMSArray; +precision highp usampler2DMSArray; + +uniform sampler2DMSArray samp2DMSA; +uniform isampler2DMSArray samp2DMSAi; +uniform usampler2DMSArray samp2DMSAu; + +void MSA() +{ + vec4 tf = texelFetch(samp2DMSA, ivec3(5), 2); + ivec4 tfi = texelFetch(samp2DMSAi, ivec3(5), 2); + uvec4 tfu = texelFetch(samp2DMSAu, ivec3(5), 2); + + ivec3 tfs = textureSize(samp2DMSA); + ivec3 tfsi = textureSize(samp2DMSAi); + ivec3 tfsb = textureSize(samp2DMSAi, 4); // ERROR, no lod + ivec3 tfsu = textureSize(samp2DMSAu); +} + +#ifdef GL_OES_shader_image_atomic +#extension GL_OES_shader_image_atomic : enable +#endif + +uniform layout(r32f) highp image2D im2Df; +uniform layout(r32ui) highp uimage2D im2Du; +uniform layout(r32i) highp iimage2D im2Di; +uniform ivec2 P; + +void goodImageAtom() +{ + float datf; + int dati; + uint datu; + + imageAtomicAdd( im2Di, P, dati); + imageAtomicAdd( im2Du, P, datu); + imageAtomicMin( im2Di, P, dati); + imageAtomicMin( im2Du, P, datu); + imageAtomicMax( im2Di, P, dati); + imageAtomicMax( im2Du, P, datu); + imageAtomicAnd( im2Di, P, dati); + imageAtomicAnd( im2Du, P, datu); + imageAtomicOr( im2Di, P, dati); + imageAtomicOr( im2Du, P, datu); + imageAtomicXor( im2Di, P, dati); + imageAtomicXor( im2Du, P, datu); + imageAtomicExchange(im2Di, P, dati); + imageAtomicExchange(im2Du, P, datu); + imageAtomicExchange(im2Df, P, datf); + imageAtomicCompSwap(im2Di, P, 3, dati); + imageAtomicCompSwap(im2Du, P, 5u, datu); +} + +sample out vec4 colorSampInBad; // ERROR, reserved + +#extension GL_OES_shader_multisample_interpolation : enable + +sample out vec4 colorSample; +flat sample out vec4 colorfsi; +sample out vec3 sampInArray[4]; +in vec4 inv4; + +void badInterp() +{ + interpolateAtCentroid(inv4); // ERROR, wrong stage + interpolateAtSample(inv4, 1); // ERROR, need extension + interpolateAtOffset(inv4, vec2(0.2)); // ERROR, need extension +} diff --git a/deps/glslang/Test/310AofA.vert b/deps/glslang/Test/310AofA.vert new file mode 100644 index 00000000..fba29772 --- /dev/null +++ b/deps/glslang/Test/310AofA.vert @@ -0,0 +1,121 @@ +#version 310 es + +// Check name mangling of functions with parameters that are multi-dimensional arrays. + +#define NX 2 +#define NY 3 +#define NZ 4 +void f(bool a, float b, uint[4] c, int[NY][NX] d) { +} + +void main() { + int[NY][NX] d; + f(false, 12.1, uint[NZ](uint(0),uint(1),uint(1),uint(2)), d); +} + +buffer b { + float u[]; // ERROR + vec4 v[]; +} name[3]; + +uniform ub { + float u; + vec4 v[]; // ERROR +} uname[3]; + +buffer b2 { + float u; + vec4 v[][]; // ERROR +} name2[3]; + +buffer b3 { + float u; + vec4 v[][7]; +} name3[3]; + +// General arrays of arrays + +float[4][5][6] many[1][2][3]; + +float gu[][7]; // ERROR, size required +float g4[4][7]; +float g5[5][7]; + +float[4][7] foo(float a[5][7]) +{ + float r[7]; + r = a[2]; + float[](a[0], a[1], r, a[3]); // ERROR, too few dims + float[4][7][4](a[0], a[1], r, a[3]); // ERROR, too many dims + return float[4][7](a[0], a[1], r, a[3]); + return float[][](a[0], a[1], r, a[3]); + return float[][7](a[0], a[1], a[2], a[3]); +} + +void bar(float[5][7]) {} + +void foo2() +{ + { + float gu[3][4][2]; + + gu[2][4][1] = 4.0; // ERROR, overflow + } + vec4 ca4[3][2] = vec4[][](vec4[2](vec4(0.0), vec4(1.0)), + vec4[2](vec4(0.0), vec4(1.0)), + vec4[2](vec4(0.0), vec4(1.0))); + vec4 caim[][2] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0))); + vec4 caim2[][] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0))); + vec4 caim3[3][] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0))); + + g4 = foo(g5); + g5 = g4; // ERROR, wrong types + gu = g4; // ERROR, not yet sized + + foo(gu); // ERROR, not yet sized + bar(g5); + + if (foo(g5) == g4) + ; + if (foo(g5) == g5) // ERROR, different types + ; + + float u[5][7]; + u[5][2] = 5.0; // ERROR + foo(u); + + vec4 badAss[3]; + name[1].v[-1]; // ERROR + name[1].v[1] = vec4(4.3); + name[1].v = badAss; // ERROR, bad assignemnt + + name3[0].v[1].length(); // 7 + name3[0].v.length(); // run time +} + +struct badS { + int sa[]; // ERROR + int a[][]; // ERROR + int b[][2]; // ERROR + int c[2][]; // ERROR + int d[][4]; // ERROR +}; + +in float inArray[2][3]; // ERROR +out float outArray[2][3]; // ERROR + +uniform ubaa { + int a; +} ubaaname[2][3]; // ERROR + +vec3 func(in mat3[2] x[3]) +{ + mat3 a0 = x[2][1]; + return a0[2]; +} diff --git a/deps/glslang/Test/310implicitSizeArrayError.vert b/deps/glslang/Test/310implicitSizeArrayError.vert new file mode 100644 index 00000000..7aa0ee1b --- /dev/null +++ b/deps/glslang/Test/310implicitSizeArrayError.vert @@ -0,0 +1,8 @@ +#version 310 es +layout (binding=0) uniform Block { + highp int a[]; +} uni; +layout (location=0) out highp int o; +void main() { + o = uni.a[2]; +} diff --git a/deps/glslang/Test/310runtimeArray.vert b/deps/glslang/Test/310runtimeArray.vert new file mode 100644 index 00000000..3d7b018e --- /dev/null +++ b/deps/glslang/Test/310runtimeArray.vert @@ -0,0 +1,18 @@ +#version 310 es + +precision highp float; +layout(location=0) out float o; + +struct S { float f; }; +buffer b1 { S s[]; }; +buffer b2 { S s[]; } b2name; +buffer b3 { S s[]; } b3name[]; +buffer b4 { S s[]; } b4name[4]; + +void main() +{ + o = s[5].f; + o += b2name.s[6].f; + o += b3name[3].s[7].f; + o += b4name[2].s[8].f; +} diff --git a/deps/glslang/Test/320.comp b/deps/glslang/Test/320.comp new file mode 100644 index 00000000..c31b047f --- /dev/null +++ b/deps/glslang/Test/320.comp @@ -0,0 +1,5 @@ +#version 320 es + +void main() +{ +} diff --git a/deps/glslang/Test/320.frag b/deps/glslang/Test/320.frag new file mode 100644 index 00000000..bed3f120 --- /dev/null +++ b/deps/glslang/Test/320.frag @@ -0,0 +1,225 @@ +#version 320 es + +out outbname { int a; } outbinst; // ERROR, not out block in fragment shader + +in inbname { + int a; + vec4 v; + struct { int b; } s; // ERROR, nested struct definition +} inbinst; + +in inbname2 { + layout(location = 12) int aAnon; + layout(location = 13) centroid in vec4 vAnon; +}; + +in layout(location = 13) vec4 aliased; // ERROR, aliased + +in inbname2 { // ERROR, reuse of block name + int aAnon; + centroid in vec4 vAnon; +}; + +in badmember { // ERROR, aAnon already in global scope + int aAnon; +}; + +int inbname; // ERROR, redefinition of block name + +vec4 vAnon; // ERROR, anon in global scope; redefinition + +in arrayed { + float f; +} arrayedInst[4]; +uniform int i; +void fooIO() +{ + vec4 v = inbinst.v + vAnon; + v *= arrayedInst[2].f; + v *= arrayedInst[i].f; +} + +in vec4 gl_FragCoord; +layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; // ERROR, non-ES + +layout(early_fragment_tests) in; +out float gl_FragDepth; +layout(depth_any) out float gl_FragDepth; // ERROR, non-ES + +void main() +{ + gl_FragDepth = 0.2; // ERROR, early_fragment_tests declared + bool f = gl_FrontFacing; +} + +out float gl_FragDepth; + +void foo_GS() +{ + highp int l = gl_Layer; + highp int p = gl_PrimitiveID; +} + +in vec2 inf, ing; +uniform ivec2 offsets[4]; +uniform sampler2D sArray[4]; +uniform int sIndex; +layout(binding = 0) uniform atomic_uint auArray[2]; +uniform ubName { int i; } ubInst[4]; +buffer bbName { int i; } bbInst[4]; +highp uniform writeonly image2D iArray[5]; +const ivec2 constOffsets[4] = ivec2[4](ivec2(0.1), ivec2(0.2), ivec2(0.3), ivec2(0.4)); + +void pfoo() +{ + precise vec2 h; + h = fma(inf, ing, h); + textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf)); + textureGatherOffsets(sArray[0], vec2(0.1), constOffsets); + textureGatherOffsets(sArray[0], vec2(0.1), offsets); // ERROR, offset not constant +} + +precision highp imageCubeArray ; +precision highp iimageCubeArray ; +precision highp uimageCubeArray ; + +precision highp samplerCubeArray ; +precision highp samplerCubeArrayShadow; +precision highp isamplerCubeArray ; +precision highp usamplerCubeArray ; + +uniform writeonly imageCubeArray CA1; +uniform writeonly iimageCubeArray CA2; +uniform writeonly uimageCubeArray CA3; + +#ifdef GL_EXT_texture_cube_map_array +uniform samplerCubeArray CA4; +uniform samplerCubeArrayShadow CA5; +uniform isamplerCubeArray CA6; +uniform usamplerCubeArray CA7; +#endif + +void CAT() +{ + highp vec4 b4 = texture(CA4, vec4(0.5), 0.24); + highp ivec4 b6 = texture(CA6, vec4(0.5), 0.26); + highp uvec4 b7 = texture(CA7, vec4(0.5), 0.27); +} + +void goodSample() +{ + lowp int a1 = gl_SampleID; + mediump vec2 a2 = gl_SamplePosition; + highp int a3 = gl_SampleMaskIn[0]; + gl_SampleMask[0] = a3; + mediump int n1 = gl_MaxSamples; + mediump int n2 = gl_NumSamples; +} + +uniform layout(r32f) highp image2D im2Df; +uniform layout(r32ui) highp uimage2D im2Du; +uniform layout(r32i) highp iimage2D im2Di; +uniform ivec2 P; + +uniform layout(rgba32f) highp image2D badIm2Df; // ERROR, needs readonly or writeonly +uniform layout(rgba8ui) highp uimage2D badIm2Du; // ERROR, needs readonly or writeonly +uniform layout(rgba16i) highp iimage2D badIm2Di; // ERROR, needs readonly or writeonly + +void goodImageAtom() +{ + float datf; + int dati; + uint datu; + + imageAtomicAdd( im2Di, P, dati); + imageAtomicAdd( im2Du, P, datu); + imageAtomicMin( im2Di, P, dati); + imageAtomicMin( im2Du, P, datu); + imageAtomicMax( im2Di, P, dati); + imageAtomicMax( im2Du, P, datu); + imageAtomicAnd( im2Di, P, dati); + imageAtomicAnd( im2Du, P, datu); + imageAtomicOr( im2Di, P, dati); + imageAtomicOr( im2Du, P, datu); + imageAtomicXor( im2Di, P, dati); + imageAtomicXor( im2Du, P, datu); + imageAtomicExchange(im2Di, P, dati); + imageAtomicExchange(im2Du, P, datu); + imageAtomicExchange(im2Df, P, datf); + imageAtomicCompSwap(im2Di, P, 3, dati); + imageAtomicCompSwap(im2Du, P, 5u, datu); + + imageAtomicMax(badIm2Di, P, dati); // ERROR, not an allowed layout() on the image + imageAtomicMax(badIm2Du, P, datu); // ERROR, not an allowed layout() on the image + imageAtomicExchange(badIm2Df, P, datf); // ERROR, not an allowed layout() on the image +} + +centroid out vec4 colorCentroidBad; // ERROR +flat out vec4 colorBadFlat; // ERROR +smooth out vec4 colorBadSmooth; // ERROR +noperspective out vec4 colorBadNo; // ERROR +flat centroid in vec2 colorfc; +in float scalarIn; + +sample in vec4 colorSampIn; +sample out vec4 colorSampleBad; // ERROR +flat sample in vec4 colorfsi; +sample in vec3 sampInArray[4]; + +void interp() +{ + float res; + vec2 res2; + vec3 res3; + vec4 res4; + + res2 = interpolateAtCentroid(colorfc); + res4 = interpolateAtCentroid(colorSampIn); + res4 = interpolateAtCentroid(colorfsi); + res = interpolateAtCentroid(scalarIn); + res3 = interpolateAtCentroid(sampInArray); // ERROR + res3 = interpolateAtCentroid(sampInArray[2]); + res2 = interpolateAtCentroid(sampInArray[2].xy); // ERROR + + res3 = interpolateAtSample(sampInArray, 1); // ERROR + res3 = interpolateAtSample(sampInArray[i], 0); + res2 = interpolateAtSample(sampInArray[2].xy, 2); // ERROR + res = interpolateAtSample(scalarIn, 1); + + res3 = interpolateAtOffset(sampInArray, vec2(0.2)); // ERROR + res3 = interpolateAtOffset(sampInArray[2], vec2(0.2)); + res2 = interpolateAtOffset(sampInArray[2].xy, vec2(0.2)); // ERROR, no swizzle + res = interpolateAtOffset(scalarIn + scalarIn, vec2(0.2)); // ERROR, no binary ops other than dereference + res = interpolateAtOffset(scalarIn, vec2(0.2)); + + float f; + res = interpolateAtCentroid(f); // ERROR, not interpolant + res4 = interpolateAtSample(outp, 0); // ERROR, not interpolant +} + +layout(blend_support_multiply) out; +layout(blend_support_screen) out; +layout(blend_support_overlay) out; +layout(blend_support_darken, blend_support_lighten) out; +layout(blend_support_colordodge) layout(blend_support_colorburn) out; +layout(blend_support_hardlight) out; +layout(blend_support_softlight) out; +layout(blend_support_difference) out; +layout(blend_support_exclusion) out; +layout(blend_support_hsl_hue) out; +layout(blend_support_hsl_saturation) out; +layout(blend_support_hsl_color) out; +layout(blend_support_hsl_luminosity) out; +layout(blend_support_all_equations) out; + +layout(blend_support_hsl_luminosity) out; // okay to repeat + +layout(blend_support_hsl_luminosity) in; // ERROR, only on "out" +layout(blend_support_hsl_luminosity) out vec4; // ERROR, only on standalone +layout(blend_support_hsl_luminosity) out vec4 badout; // ERROR, only on standalone +layout(blend_support_hsl_luminosity) struct badS {int i;}; // ERROR, only on standalone +layout(blend_support_hsl_luminosity) void blendFoo() { } // ERROR, only on standalone +void blendFoo(layout(blend_support_hsl_luminosity) vec3 v) { } // ERROR, only on standalone +layout(blend_support_flizbit) out; // ERROR, no flizbit + +out vec4 outAA[2][2]; // ERROR diff --git a/deps/glslang/Test/320.geom b/deps/glslang/Test/320.geom new file mode 100644 index 00000000..38d71c31 --- /dev/null +++ b/deps/glslang/Test/320.geom @@ -0,0 +1,134 @@ +#version 320 es + +precision mediump float; + +in fromVertex { + in vec3 color; +} fromV[]; + +in vec4 nonBlockUnsized[]; + +out toFragment { + out vec3 color; +} toF; + +out fromVertex { // okay to reuse a block name for another block name + vec3 color; +}; + +out fooB { // ERROR, cannot reuse block name as block instance + vec2 color; +} fromVertex; + +int fromVertex; // ERROR, cannot reuse a block name for something else + +out fooC { // ERROR, cannot have same name for block and instance name + vec2 color; +} fooC; + +void main() +{ + EmitVertex(); + EndPrimitive(); + EmitStreamVertex(1); // ERROR + EndStreamPrimitive(0); // ERROR + + color = fromV[0].color; + gl_ClipDistance[3] = // ERROR, no ClipDistance + gl_in[1].gl_ClipDistance[2]; // ERROR, no ClipDistance + gl_Position = gl_in[0].gl_Position; + + gl_PrimitiveID = gl_PrimitiveIDIn; + gl_Layer = 2; +} + +layout(stream = 4) out vec4 ov4; // ERROR, no streams + +layout(line_strip, points, triangle_strip, points, triangle_strip) out; // just means triangle_strip" + +out ooutb { vec4 a; } ouuaa6; + +layout(max_vertices = 200) out; +layout(max_vertices = 300) out; // ERROR, too big +void foo(layout(max_vertices = 4) int a) // ERROR +{ + ouuaa6.a = vec4(1.0); +} + +layout(line_strip, points, triangle_strip, points) out; // ERROR, changing output primitive +layout(line_strip, points) out; // ERROR, changing output primitive +layout(triangle_strip) in; // ERROR, not an input primitive +layout(triangle_strip) uniform; // ERROR +layout(triangle_strip) out vec4 badv4; // ERROR, not on a variable +layout(triangle_strip) in vec4 bad2v4[]; // ERROR, not on a variable or input +layout(invocations = 3) out outbn { int a; }; // 2 ERROR, not on a block, not until 4.0 +out outbn2 { + layout(invocations = 3) int a; // 2 ERRORs, not on a block member, not until 4.0 + layout(max_vertices = 3) int b; // ERROR, not on a block member + layout(triangle_strip) int c; // ERROR, not on a block member +} outbi; + +layout(lines) out; // ERROR, not on output +layout(lines_adjacency) in; +layout(triangles) in; // ERROR, can't change it +layout(triangles_adjacency) in; // ERROR, can't change it +layout(invocations = 4) in; + +in sameName { + int a15; +} insn[]; + +out sameName { + float f15; +}; + +uniform sameName { + bool b15; +}; + +const int summ = gl_MaxVertexAttribs + + gl_MaxGeometryInputComponents + + gl_MaxGeometryOutputComponents + + gl_MaxGeometryImageUniforms + + gl_MaxGeometryTextureImageUnits + + gl_MaxGeometryOutputVertices + + gl_MaxGeometryTotalOutputComponents + + gl_MaxGeometryUniformComponents + + gl_MaxGeometryAtomicCounters + + gl_MaxGeometryAtomicCounterBuffers + + gl_MaxVertexTextureImageUnits + + gl_MaxCombinedTextureImageUnits + + gl_MaxTextureImageUnits + + gl_MaxDrawBuffers; + +void fooe1() +{ + gl_ViewportIndex; // ERROR, not in ES + gl_MaxViewports; // ERROR, not in ES + insn.length(); // 4: lines_adjacency + int inv = gl_InvocationID; +} + +in vec4 explArray[4]; +in vec4 explArrayBad[5]; // ERROR, wrong size +in vec4 nonArrayed; // ERROR, not an array +flat out vec3 myColor1; +centroid out vec3 myColor2; +centroid in vec3 centr[]; +sample out vec4 perSampleColor; // ERROR without sample extensions + +layout(max_vertices = 200) out; // matching redecl + +layout(location = 7, component = 2) in float comp[]; // ERROR, es has no component + +void notHere() +{ + gl_MaxGeometryVaryingComponents; // ERROR, not in ES + gl_VerticesIn; // ERROR, not in ES +} + +void pointSize2() +{ + highp float ps = gl_in[3].gl_PointSize; // ERROR, need extension + gl_PointSize = ps; // ERROR, need extension +} diff --git a/deps/glslang/Test/320.tesc b/deps/glslang/Test/320.tesc new file mode 100644 index 00000000..4fa20f63 --- /dev/null +++ b/deps/glslang/Test/320.tesc @@ -0,0 +1,150 @@ +#version 320 es + +layout(vertices = 4) out; +out int outa[gl_out.length()]; + +layout(quads) in; // ERROR +layout(ccw) out; // ERROR +layout(fractional_even_spacing) in; // ERROR + +patch in vec4 patchIn; // ERROR +patch out vec4 patchOut; + +void main() +{ + barrier(); + + int a = gl_MaxTessControlInputComponents + + gl_MaxTessControlOutputComponents + + gl_MaxTessControlTextureImageUnits + + gl_MaxTessControlUniformComponents + + gl_MaxTessControlTotalOutputComponents; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; // ERROR, need point_size extension + float cd = gl_in[1].gl_ClipDistance[2]; // ERROR, not in ES + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + int iid = gl_InvocationID; + + gl_out[gl_InvocationID].gl_Position = p; + gl_out[gl_InvocationID].gl_PointSize = ps; // ERROR, need point_size extension + gl_out[gl_InvocationID].gl_ClipDistance[1] = cd; // ERROR, not in ES + + gl_TessLevelOuter[3] = 3.2; + gl_TessLevelInner[1] = 1.3; + + if (a > 10) + barrier(); // ERROR + else + barrier(); // ERROR + + barrier(); + + do { + barrier(); // ERROR + } while (a > 10); + + switch (a) { + default: + barrier(); // ERROR + break; + } + a < 12 ? a : (barrier(), a); // ERROR + { + barrier(); + } + + return; + + barrier(); // ERROR +} + +layout(vertices = 4) in; // ERROR, not on in +layout(vertices = 5) out; // ERROR, changing # + +void foo() +{ + gl_out[4].gl_Position; // ERROR, out of range + + barrier(); // ERROR, not in main +} + +in vec2 ina; // ERROR, not array +in vec2 inb[]; +in vec2 inc[18]; // ERROR, wrong size +in vec2 ind[gl_MaxPatchVertices]; +patch out float implA[]; // ERROR, not sized + +#extension GL_ARB_separate_shader_objects : enable + +layout(location = 3) in vec4 ivla[]; +layout(location = 4) in vec4 ivlb[]; +layout(location = 4) in vec4 ivlc[]; // ERROR, overlapping + +layout(location = 3) out vec4 ovla[]; +layout(location = 4) out vec4 ovlb[]; +layout(location = 4) out vec4 ovlc[]; // ERROR, overlapping + +patch out pinbn { + int a; +} pinbi; + +centroid out vec3 myColor2[]; +centroid in vec3 centr[]; +sample out vec4 perSampleColor[]; + +layout(vertices = 4) out float badlay[]; // ERROR, not on a variable +out float misSized[5]; // ERROR, size doesn't match +out float okaySize[4]; + +void pointSize2() +{ + float ps = gl_in[1].gl_PointSize; // ERROR, need point_size extension + gl_out[gl_InvocationID].gl_PointSize = ps; // ERROR, need point_size extension +} + +precise vec3 pv3; + +void goodfoop() +{ + precise float d; + + pv3 *= pv3; + pv3 = fma(pv3, pv3, pv3); + d = fma(d, d, d); +} + +void bb() +{ + gl_BoundingBoxOES[0] = vec4(0.0); + gl_BoundingBoxOES[1] = vec4(1.0); + gl_BoundingBoxOES[2] = vec4(2.0); // ERROR, overflow +} + +out patch badpatchBName { // ERROR, array size required + float f; +} badpatchIName[]; + +out patch patchBName { + float f; +} patchIName[4]; + +void outputtingOutparam(out int a) +{ + a = 2; +} + +void outputting() +{ + outa[gl_InvocationID] = 2; + outa[1] = 2; // ERROR, not gl_InvocationID + gl_out[0].gl_Position = vec4(1.0); // ERROR, not gl_InvocationID + outa[1]; + gl_out[0]; + outputtingOutparam(outa[0]); // ERROR, not gl_InvocationID + outputtingOutparam(outa[gl_InvocationID]); + patchIName[1].f = 3.14; + outa[(gl_InvocationID)] = 2; +} diff --git a/deps/glslang/Test/320.tese b/deps/glslang/Test/320.tese new file mode 100644 index 00000000..cce2637c --- /dev/null +++ b/deps/glslang/Test/320.tese @@ -0,0 +1,114 @@ +#version 320 es + +layout(vertices = 4) out; // ERROR +layout(quads, cw) in; +layout(triangles) in; // ERROR +layout(isolines) in; // ERROR + +layout(ccw) in; // ERROR +layout(cw) in; + +layout(fractional_odd_spacing) in; +layout(equal_spacing) in; // ERROR +layout(fractional_even_spacing) in; // ERROR + +layout(point_mode) in; + +patch in vec4 patchIn; +patch out vec4 patchOut; // ERROR + +void main() +{ + barrier(); // ERROR + + int a = gl_MaxTessEvaluationInputComponents + + gl_MaxTessEvaluationOutputComponents + + gl_MaxTessEvaluationTextureImageUnits + + gl_MaxTessEvaluationUniformComponents + + gl_MaxTessPatchComponents + + gl_MaxPatchVertices + + gl_MaxTessGenLevel; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; // ERROR, need point_size extension + float cd = gl_in[1].gl_ClipDistance[2]; // ERROR, not in ES + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + vec3 tc = gl_TessCoord; + float tlo = gl_TessLevelOuter[3]; + float tli = gl_TessLevelInner[1]; + + gl_Position = p; + gl_PointSize = ps; // ERROR, need point_size extension + gl_ClipDistance[2] = cd; // ERROR, not in ES +} + +smooth patch in vec4 badp1; // ERROR +flat patch in vec4 badp2; // ERROR +noperspective patch in vec4 badp3; // ERROR +patch sample in vec3 badp4; // ERROR + +#extension GL_ARB_separate_shader_objects : enable + +in gl_PerVertex +{ + vec4 gl_Position; +} gl_in[]; + +in gl_PerVertex // ERROR, second redeclaration of gl_in +{ + vec4 gl_Position; +} gl_in[]; + +layout(quads, cw) out; // ERROR +layout(triangles) out; // ERROR +layout(isolines) out; // ERROR +layout(cw) out; // ERROR +layout(fractional_odd_spacing) out; // ERROR +layout(equal_spacing) out; // ERROR +layout(fractional_even_spacing) out; // ERROR +layout(point_mode) out; // ERROR + +in vec2 ina; // ERROR, not array +in vec2 inb[]; +in vec2 inc[18]; // ERROR, wrong size +in vec2 ind[gl_MaxPatchVertices]; + +in testbla { // ERROR, not array + int f; +} bla; + +in testblb { + int f; +} blb[]; + +in testblc { // ERROR wrong size + int f; +} blc[18]; + +in testbld { + int f; +} bld[gl_MaxPatchVertices]; + +layout(location = 23) in vec4 ivla[]; +layout(location = 24) in vec4 ivlb[]; +layout(location = 24) in vec4 ivlc[]; // ERROR, overlap + +layout(location = 23) out vec4 ovla[2]; +layout(location = 24) out vec4 ovlb[2]; // ERROR, overlap + +in float gl_TessLevelOuter[4]; // ERROR, can't redeclare + +patch in pinbn { + int a; +} pinbi; + +centroid out vec3 myColor2; +centroid in vec3 centr[]; +sample out vec4 perSampleColor; + +void bbbad() +{ + gl_BoundingBoxOES; // ERROR, wrong stage +} diff --git a/deps/glslang/Test/320.vert b/deps/glslang/Test/320.vert new file mode 100644 index 00000000..42f1515c --- /dev/null +++ b/deps/glslang/Test/320.vert @@ -0,0 +1,255 @@ +#version 320 es + +out outbname { + int a; + out vec4 v; + highp sampler2D s; // ERROR, opaque type +} outbinst; + +out outbname2 { + layout(location = 12) int aAnon; + layout(location = 13) vec4 vAnon; +}; + +layout(location = 12) out highp int aliased; // ERROR, aliasing location + +in inbname { int a; } inbinst; // ERROR, no in block in vertex shader + +out gl_PerVertex { // ERROR, has extra member + highp vec4 gl_Position; + highp vec4 t; +}; + +void main() +{ + int sum = gl_VertexID + + gl_InstanceID; + gl_Position = vec4(1.0); + gl_PointSize = 2.0; // ERROR, removed by redeclaration +} + +out gl_PerVertex { // ERROR, already used and already redeclared + highp vec4 gl_Position; + highp vec4 t; +}; + +smooth out smo { // ERROR, no smooth on a block + int i; +} smon; + +flat out fmo { // ERROR, no flat on a block + int i; +} fmon; + +centroid out cmo { // ERROR, no centroid on a block + int i; +} cmon; + +invariant out imo { // ERROR, no invariant on a block + int i; +} imon; + +in vec2 inf, ing; +uniform ivec2 offsets[4]; +uniform sampler2D sArray[4]; +uniform int sIndex; +layout(binding = 0) uniform atomic_uint auArray[2]; +uniform ubName { int i; } ubInst[4]; +buffer bbName { int i; } bbInst[4]; +highp uniform writeonly image2D iArray[5]; +const ivec2 constOffsets[4] = ivec2[4](ivec2(0.1), ivec2(0.2), ivec2(0.3), ivec2(0.4)); + +void pfoo() +{ + precise vec2 h; + h = fma(inf, ing, h); + sArray[sIndex + 1]; + ubInst[sIndex + 1]; + bbInst[sIndex - 2]; // ERROR, still not supported + iArray[2]; + iArray[sIndex - 2]; + textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf)); + textureGatherOffsets(sArray[0], vec2(0.1), constOffsets); + textureGatherOffsets(sArray[0], vec2(0.1), offsets); // ERROR, offset not constant +} + +uniform samplerBuffer noPreSamp1; // ERROR, no default precision +uniform isamplerBuffer noPreSamp2; // ERROR, no default precision +uniform usamplerBuffer noPreSamp3; // ERROR, no default precision +uniform writeonly imageBuffer noPreSamp4; // ERROR, no default precision +uniform writeonly iimageBuffer noPreSamp5; // ERROR, no default precision +uniform writeonly uimageBuffer noPreSamp6; // ERROR, no default precision + +precision highp samplerBuffer; +precision highp isamplerBuffer; +precision highp usamplerBuffer; +precision highp imageBuffer; +precision highp iimageBuffer; +precision highp uimageBuffer; + +#ifdef GL_OES_texture_buffer +uniform samplerBuffer bufSamp1; +uniform isamplerBuffer bufSamp2; +uniform usamplerBuffer bufSamp3; +#endif +#ifdef GL_EXT_texture_buffer +uniform writeonly imageBuffer bufSamp4; +uniform writeonly iimageBuffer bufSamp5; +uniform writeonly uimageBuffer bufSamp6; +#endif + +void bufferT() +{ + highp int s1 = textureSize(bufSamp1); + highp int s2 = textureSize(bufSamp2); + highp int s3 = textureSize(bufSamp3); + + highp int s4 = imageSize(bufSamp4); + highp int s5 = imageSize(bufSamp5); + highp int s6 = imageSize(bufSamp6); + + highp vec4 f1 = texelFetch(bufSamp1, s1); + highp ivec4 f2 = texelFetch(bufSamp2, s2); + highp uvec4 f3 = texelFetch(bufSamp3, s3); +} + +uniform writeonly imageCubeArray noPreCA1; // ERROR, no default precision +uniform writeonly iimageCubeArray noPreCA2; // ERROR, no default precision +uniform writeonly uimageCubeArray noPreCA3; // ERROR, no default precision + +uniform samplerCubeArray noPreCA4; // ERROR, no default precision +uniform samplerCubeArrayShadow noPreCA5; // ERROR, no default precision +uniform isamplerCubeArray noPreCA6; // ERROR, no default precision +uniform usamplerCubeArray noPreCA7; // ERROR, no default precision + +precision highp imageCubeArray ; +precision highp iimageCubeArray ; +precision highp uimageCubeArray ; + +precision highp samplerCubeArray ; +precision highp samplerCubeArrayShadow; +precision highp isamplerCubeArray ; +precision highp usamplerCubeArray ; + +uniform writeonly imageCubeArray CA1; +uniform writeonly iimageCubeArray CA2; +uniform writeonly uimageCubeArray CA3; + +layout(rgba16f) uniform readonly imageCubeArray rCA1; +layout(rgba32i) uniform readonly iimageCubeArray rCA2; +layout(r32ui) uniform readonly uimageCubeArray rCA3; + +#ifdef GL_OES_texture_cube_map_array +uniform samplerCubeArray CA4; +uniform samplerCubeArrayShadow CA5; +uniform isamplerCubeArray CA6; +uniform usamplerCubeArray CA7; +#endif + +void CAT() +{ + highp ivec3 s4 = textureSize(CA4, 1); + highp ivec3 s5 = textureSize(CA5, 1); + highp ivec3 s6 = textureSize(CA6, 1); + highp ivec3 s7 = textureSize(CA7, 1); + + highp vec4 t4 = texture(CA4, vec4(0.5)); + highp float t5 = texture(CA5, vec4(0.5), 3.0); + highp ivec4 t6 = texture(CA6, vec4(0.5)); + highp uvec4 t7 = texture(CA7, vec4(0.5)); + + highp vec4 L4 = textureLod(CA4, vec4(0.5), 0.24); + highp ivec4 L6 = textureLod(CA6, vec4(0.5), 0.26); + highp uvec4 L7 = textureLod(CA7, vec4(0.5), 0.27); + + highp vec4 g4 = textureGrad(CA4, vec4(0.5), vec3(0.1), vec3(0.2)); + highp ivec4 g6 = textureGrad(CA6, vec4(0.5), vec3(0.1), vec3(0.2)); + highp uvec4 g7 = textureGrad(CA7, vec4(0.5), vec3(0.1), vec3(0.2)); + + highp vec4 gath4 = textureGather(CA4, vec4(0.5)); + highp vec4 gathC4 = textureGather(CA4, vec4(0.5), 2); + highp ivec4 gath6 = textureGather(CA6, vec4(0.5)); + highp ivec4 gathC6 = textureGather(CA6, vec4(0.5), 1); + highp uvec4 gath7 = textureGather(CA7, vec4(0.5)); + highp uvec4 gathC7 = textureGather(CA7, vec4(0.5), 0); + + highp vec4 gath5 = textureGather(CA5, vec4(0.5), 2.5); + + highp ivec3 s1 = imageSize(CA1); + highp ivec3 s2 = imageSize(CA2); + highp ivec3 s3 = imageSize(CA3); + + imageStore(CA1, s3, vec4(1)); + imageStore(CA2, s3, ivec4(1)); + imageStore(CA3, s3, uvec4(1)); + + highp vec4 cl1 = imageLoad(rCA1, s3); + highp ivec4 cl2 = imageLoad(rCA2, s3); + highp uvec4 cl3 = imageLoad(rCA3, s3); +} + +uniform sampler2DMSArray noPrec2DMS; // ERROR, no default +uniform isampler2DMSArray noPrec2DMSi; // ERROR, no default +uniform usampler2DMSArray noPrec2DMSu; // ERROR, no default + +precision highp sampler2DMSArray; +precision highp isampler2DMSArray; +precision highp usampler2DMSArray; + +uniform sampler2DMSArray samp2DMSA; +uniform isampler2DMSArray samp2DMSAi; +uniform usampler2DMSArray samp2DMSAu; + +void MSA() +{ + vec4 tf = texelFetch(samp2DMSA, ivec3(5), 2); + ivec4 tfi = texelFetch(samp2DMSAi, ivec3(5), 2); + uvec4 tfu = texelFetch(samp2DMSAu, ivec3(5), 2); + + ivec3 tfs = textureSize(samp2DMSA); + ivec3 tfsi = textureSize(samp2DMSAi); + ivec3 tfsb = textureSize(samp2DMSAi, 4); // ERROR, no lod + ivec3 tfsu = textureSize(samp2DMSAu); +} + +uniform layout(r32f) highp image2D im2Df; +uniform layout(r32ui) highp uimage2D im2Du; +uniform layout(r32i) highp iimage2D im2Di; +uniform ivec2 P; + +void goodImageAtom() +{ + float datf; + int dati; + uint datu; + + imageAtomicAdd( im2Di, P, dati); + imageAtomicAdd( im2Du, P, datu); + imageAtomicMin( im2Di, P, dati); + imageAtomicMin( im2Du, P, datu); + imageAtomicMax( im2Di, P, dati); + imageAtomicMax( im2Du, P, datu); + imageAtomicAnd( im2Di, P, dati); + imageAtomicAnd( im2Du, P, datu); + imageAtomicOr( im2Di, P, dati); + imageAtomicOr( im2Du, P, datu); + imageAtomicXor( im2Di, P, dati); + imageAtomicXor( im2Du, P, datu); + imageAtomicExchange(im2Di, P, dati); + imageAtomicExchange(im2Du, P, datu); + imageAtomicExchange(im2Df, P, datf); + imageAtomicCompSwap(im2Di, P, 3, dati); + imageAtomicCompSwap(im2Du, P, 5u, datu); +} + +sample out vec4 colorSample; +flat sample out vec4 colorfsi; +sample out vec3 sampInArray[4]; +in vec4 inv4; + +void badInterp() +{ + interpolateAtCentroid(inv4); // ERROR, wrong stage + interpolateAtSample(inv4, 1); // ERROR, need extension + interpolateAtOffset(inv4, vec2(0.2)); // ERROR, need extension +} diff --git a/deps/glslang/Test/330.frag b/deps/glslang/Test/330.frag new file mode 100644 index 00000000..9afa8f82 --- /dev/null +++ b/deps/glslang/Test/330.frag @@ -0,0 +1,152 @@ +#version 330 compatibility + +in vec4 inVar; +layout(location=0, index=0) out vec4 outVar; + +varying vec4 varyingVar; + +void main() +{ + gl_FragColor = varyingVar; // link ERROR: user output was used + gl_FragData[1] = inVar; // link ERROR: user output was used + int buffer = 4; +} + +#extension GL_ARB_separate_shader_objects : enable + +in gl_PerFragment { + vec4 gl_Color; +}; + +void foo() +{ + vec4 c = gl_Color; + outVar = inVar; +} + +in gl_block { // ERROR + int gl_i; +} gl_name; + +in myBlock { + int gl_i; // ERROR +} gl_name; // ERROR + +in gl_PerVertex { // ERROR + vec4 gl_FragCoord; +} gl_in[]; + +in gl_PerVertex { // ERROR + vec4 gl_FragCoord; +}; // ERROR + +const int start = 6; +layout(location = -2) in vec4 v1; // ERROR +layout(location = start + 2) in vec4 v2; // ERROR +layout(location = 4.7e10) in vec4 v20; // ERROR +layout(location = +60) in float v21; // ERROR +layout(location = (2)) in float v22; // ERROR + +struct S { + float f1; + layout(location = 3) float f2; // ERROR +}; + +layout(location = 1) in inblock { // ERROR + float f1; + layout(location = 3) float f2; // ERROR +}; + +layout(location = 1) uniform ublock { // ERROR + float f1; + layout(location = 3) float f2; // ERROR +} uinst; + +#extension GL_ARB_enhanced_layouts : enable + +layout(location = start) in vec4 v3; +layout(location = -2) in vec4 v4; // ERROR +layout(location = -start) in vec4 v5; // ERROR +layout(location = start*start - 2 - 4) in vec4 v6; +layout(location = +61) in float v23; +layout(location = (62)) in float v24; + +struct S2 { + float f1; + layout(location = 3) float f2; // ERROR +}; + +layout(location = 28) in inblock2 { + bool b1; + float f1; + layout(location = 25) float f2; + vec4 f3; + layout(location = 21) S2 s2; + vec4 f4; + vec4 f5; +} ininst2; + +layout(location = 13) uniform ublock2 { // ERROR + float f1; + layout(location = 3) float f2; // ERROR +} uinst2; + +in inblock3 { // ERROR, mix of location internal with no location external + float f1; + layout(location = 40) float f2; +} in3; + +in ublock4 { + layout(location = 50) float f1; + layout(location = 51) float f2; +} in4; + +layout(location = 33) in struct SS { + vec3 a; // gets location 33 + mat2 b; // gets locations 34 and 35 + vec4 c[2]; // gets locations 36 and 37 + layout (location = 38) vec2 A; // ERROR, can't use on struct member +} s; + +layout(location = 44) in block { + vec4 d; // gets location 44 + vec4 e; // gets location 45 + layout(location = 47) vec4 f; // gets location 47 + vec4 g; // gets location 48 + layout (location = 41) vec4 h; // gets location 41 + vec4 i; // gets location 42 + vec4 j; // gets location 43 + vec4 k; // ERROR, location 44 already used +}; + +layout(index=0) out vec4 outVar2; // ERROR: missing explicit location +layout(location=0, index=1) out vec4 outVar3; // no error even though location is overlapping +layout(location=0, index=1) out vec4 outVar4; // ERROR overlapping +layout(location=27, index=0) in vec4 indexIn; // ERROR, not on in +layout(location=0, index=0) in; // ERROR, not just on in +layout(location=0, index=0) out; // ERROR, need a variable +layout(location=26, index=0) out indexBlock { int a; } indexBlockI; // ERROR, not on a block + +uniform sampler1D samp1D; +uniform sampler2DShadow samp2Ds; + +void qlod() +{ + vec2 lod; + float pf; + vec2 pf2; + vec3 pf3; + + lod = textureQueryLod(samp1D, pf); // ERROR, not until 400 + lod = textureQueryLod(samp2Ds, pf2); // ERROR, not until 400 +} + +int precise; // okay, not a keyword yet +struct SKeyMem { int precise; } KeyMem; // okay, not a keyword yet + +void fooKeyMem() +{ + KeyMem.precise; +} + +layout(location=28, index=2) out vec4 outIndex2; // ERROR index out of range \ No newline at end of file diff --git a/deps/glslang/Test/330comp.frag b/deps/glslang/Test/330comp.frag new file mode 100644 index 00000000..50b037da --- /dev/null +++ b/deps/glslang/Test/330comp.frag @@ -0,0 +1,12 @@ +#version 330 compatibility + +in vec4 inVar; +out vec4 outVar; + +varying vec4 varyingVar; + +void main() +{ + gl_FragColor = varyingVar; + gl_FragData[1] = inVar * gl_ModelViewMatrix; +} diff --git a/deps/glslang/Test/400.frag b/deps/glslang/Test/400.frag new file mode 100644 index 00000000..039d4809 --- /dev/null +++ b/deps/glslang/Test/400.frag @@ -0,0 +1,201 @@ +#version 400 core + +in vec2 c2D; +flat in int i; +out vec4 outp; +uniform sampler2D arrayedSampler[5]; +uniform usampler2DRect samp2dr; +uniform isampler2DArray isamp2DA; + +void main() +{ + vec4 v; + v = texture(arrayedSampler[i], c2D); + outp.x = gl_ClipDistance[1]; + + ivec2 offsets[4]; + const ivec2 constOffsets[4] = ivec2[4](ivec2(1,2), ivec2(3,4), ivec2(15,16), ivec2(-2,0)); + uvec4 uv4 = textureGatherOffsets(samp2dr, c2D, offsets, 2); // ERROR, offsets not constant + uv4 = textureGatherOffsets(samp2dr, c2D, constOffsets, 2); + vec4 v4 = textureGather(arrayedSampler[0], c2D); + ivec4 iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 3); + iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), i); // ERROR, last argument not const + iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 4); // ERROR, last argument out of range + iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 1+2); + iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(i)); + + vec4 c = gl_FragCoord; +} + +layout(location = 4) in vec4 vl; // ERROR, not supported + +#ifdef GL_ARB_separate_shader_objects +#extension GL_ARB_separate_shader_objects : enable +#endif + +layout(location = 6) in vec4 vl2; + +layout(location = 3) uniform vec3 uv3; + +layout(location = 5) in vec4 gl_Color; // ERROR, layout +noperspective in float gl_ClipDistance[4]; // ERROR, can't change qualifier + +layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; // ERROR, declared after use + +uniform sampler2DRectShadow u2drs; + +void foo23() +{ + const ivec2[3] offsets = ivec2[3](ivec2(1,2), ivec2(3,4), ivec2(15,16)); + + textureProjGradOffset(u2drs, outp, vec2(0.0), vec2(0.0), ivec2(c2D)); // ERROR, offset not constant + textureProjGradOffset(u2drs, outp, vec2(0.0), vec2(0.0), offsets[1]); + textureProjGradOffset(u2drs, outp, vec2(0.0), vec2(0.0), offsets[2]); // ERROR, offset out of range + textureProjGradOffset(u2drs, outp, vec2(0.0), vec2(0.0), ivec2(-10, 20)); // ERROR, offset out of range +} + +patch in vec4 patchIn; // ERROR +patch out vec4 patchOut; // ERROR + +void foo24() +{ + dvec3 df, di; + df = modf(dvec3(outp.xyz), di); +} + +in float in1; +in vec2 in2; +in vec3 in3; +in vec4 in4; + +void foodc1() +{ + vec2 v2 = dFdxFine(in2); // ERROR + vec3 v3 = dFdyCoarse(in3); // ERROR + vec4 v4 = fwidthCoarse(in4) + fwidthFine(in4); // ERROR +} + +#extension GL_ARB_derivative_control : enable + +void foodc2() +{ + vec2 v2 = dFdxFine(in2); + vec3 v3 = dFdyCoarse(in3); + vec4 v4 = fwidthCoarse(in4) + fwidthFine(in4); + + uint u1; + ivec3 i3; + ivec2 i2; + v2 = frexp(v2, i2); + v3 = ldexp(v3, i3); + + u1 = packUnorm4x8(v4); + u1 = packSnorm4x8(v4); + v4 = unpackUnorm4x8(u1); + v4 = unpackSnorm4x8(u1); + + double d; + uvec2 u2; + d = packDouble2x32(u2); + u2 = unpackDouble2x32(d); +} + +sample in vec4 colorSampIn; +sample out vec4 colorSampleBad; // ERROR +noperspective in vec4 colorfsi; +sample in vec3 sampInArray[4]; +smooth in float scalarIn; +flat centroid in vec2 colorfc; + +struct S { + float x; +}; + +in S s1; +sample S s2; + +void interp() +{ + interpolateAtCentroid(colorfc); + interpolateAtCentroid(colorSampIn); + interpolateAtCentroid(colorfsi); + interpolateAtCentroid(scalarIn); + interpolateAtCentroid(sampInArray); // ERROR + interpolateAtCentroid(sampInArray[2]); + interpolateAtCentroid(sampInArray[2].xy); // ERROR + + interpolateAtSample(sampInArray, 1); // ERROR + interpolateAtSample(sampInArray[i], 0); + interpolateAtSample(s1.x, 2); + interpolateAtSample(scalarIn, 1); + + interpolateAtOffset(sampInArray, vec2(0.2)); // ERROR + interpolateAtOffset(sampInArray[2], vec2(0.2)); + interpolateAtOffset(sampInArray[2].xy, vec2(0.2)); // ERROR, no swizzle + interpolateAtOffset(scalarIn + scalarIn, vec2(0.2)); // ERROR, no binary ops other than dereference + interpolateAtOffset(s2.x, vec2(0.2)); // ERROR + + float f; + interpolateAtCentroid(f); // ERROR, not interpolant + interpolateAtSample(outp, 0); // ERROR, not interpolant +} + +uniform sampler1D samp1D; +uniform isampler2D isamp2D; +uniform usampler3D usamp3D; +uniform samplerCube sampCube; +uniform isampler1DArray isamp1DA; +uniform usampler2DArray usamp2DA; +uniform isamplerCubeArray isampCubeA; + +uniform sampler1DShadow samp1Ds; +uniform sampler2DShadow samp2Ds; +uniform samplerCubeShadow sampCubes; +uniform sampler1DArrayShadow samp1DAs; +uniform sampler2DArrayShadow samp2DAs; +uniform samplerCubeArrayShadow sampCubeAs; + +uniform samplerBuffer sampBuf; +uniform sampler2DRect sampRect; + +void qlod() +{ + vec2 lod; + float pf; + vec2 pf2; + vec3 pf3; + + lod = textureQueryLod(samp1D, pf); + lod = textureQueryLod(isamp2D, pf2); + lod = textureQueryLod(usamp3D, pf3); + lod = textureQueryLod(sampCube, pf3); + lod = textureQueryLod(isamp1DA, pf); + lod = textureQueryLod(usamp2DA, pf2); + lod = textureQueryLod(isampCubeA, pf3); + + lod = textureQueryLod(samp1Ds, pf); + lod = textureQueryLod(samp2Ds, pf2); + lod = textureQueryLod(sampCubes, pf3); + lod = textureQueryLod(samp1DAs, pf); + lod = textureQueryLod(samp2DAs, pf2); + lod = textureQueryLod(sampCubeAs, pf3); + + lod = textureQueryLod(sampBuf, pf); // ERROR + lod = textureQueryLod(sampRect, pf2); // ERROR +} + +uniform uint uu; +out uint iout; + +void bitwiseConv() +{ + iout = uu & i; + iout += uu ^ i; + iout += i | uu; +} + +subroutine(subT1, subT2); +subroutine float subT1() { return 1.0; } +subroutine float subT2() { return 1.0; } + +struct SKeyMem { int precise; } KeyMem; // ERROR, keyword can't be a member diff --git a/deps/glslang/Test/400.geom b/deps/glslang/Test/400.geom new file mode 100644 index 00000000..f8e89558 --- /dev/null +++ b/deps/glslang/Test/400.geom @@ -0,0 +1,330 @@ +#version 400 core + +void main() +{ + EmitStreamVertex(1); + EndStreamPrimitive(0); + EmitVertex(); + EndPrimitive(); + int id = gl_InvocationID; +} + +layout(invocations = 4) in outbn { int a; } bn[]; // ERROR, not on a block +layout(max_vertices = 127) out; +layout(invocations = 4) in; + +#extension GL_ARB_separate_shader_objects : enable + +in gl_PerVertex { // testing input arrays with a block redeclaration, see 420.geom for without + vec4 gl_Position; + layout(std140, location = 3) patch float gl_PointSize; // ERRORs... +} gl_in[]; + +void foo() +{ + gl_in.length(); // ERROR + gl_in[1].gl_Position; +} + +in vec4 color[]; +in vec4 color2[]; +in vec4 colorS[3]; +in vec4 colorBad[4]; + +void foo2() +{ + color.length(); // ERROR + colorS.length(); +} + +layout(triangles) in; // give ERROR just for colorBad + +in vec4 color[3]; +in vec4 color2[3]; +in vec4 colorbad2[2]; // ERROR + +void foo3() +{ + gl_in.length(); + color.length(); + color2.length(); + colorS.length(); +} + +layout(location = 4) in vec4 cva[3]; +layout(location = 5) in vec4 cvb[3]; +layout(location = 2) in mat3 cmc[3]; // ERROR, collision + +patch in vec4 patchIn[]; // ERROR +patch out vec4 patchOut; // ERROR + +in float scalar; // ERROR, no array + +layout(max_vertices = 127, invocations = 4) out; // ERROR +layout(invocations = 4, max_vertices = 127) in; // ERROR +layout(max_vertices = 127, invocations = 4) uniform; // 2 ERRORs + +in inblockscalar { + int a; +} inbls; // ERROR, not an array + +in inblocka { + int a; +} inbla[17]; // ERROR, wrong array size + +void bits() +{ + uvec2 u2; + u2 = uaddCarry(u2, u2, u2); + uint u1; + u1 = usubBorrow(u1, u1, u1); + uvec4 u4; + umulExtended(u4, u4, u4, u4); + ivec4 i4; + imulExtended(i4, i4, i4, i4); + int i1; + i1 = bitfieldExtract(i1, 4, 5); + uvec3 u3; + u3 = bitfieldExtract(u3, 4, 5); + ivec3 i3; + i3 = bitfieldInsert(i3, i3, 4, 5); + u1 = bitfieldInsert(u1, u1, 4, 5); + ivec2 i2; + i2 = bitfieldReverse(i2); + u4 = bitfieldReverse(u4); + i1 = bitCount(i1); + i3 = bitCount(u3); + i2 = findLSB(i2); + i4 = findLSB(u4); + i1 = findMSB(i1); + i2 = findMSB(u2); +} + +layout(location = 7, index = 1) out vec4 indexedOut; + +uniform sampler1D samp1D; +uniform sampler2DShadow samp2Ds; + +void qlod() +{ + vec2 lod; + float pf; + vec2 pf2; + vec3 pf3; + + lod = textureQueryLod(samp1D, pf); // ERROR, only in fragment + lod = textureQueryLod(samp2Ds, pf2); // ERROR, only in fragment +} + +void doubles() +{ + double doublev; + dvec2 dvec2v; + dvec3 dvec3v; + dvec4 dvec4v; + + bool boolv; + bvec2 bvec2v; + bvec3 bvec3v; + bvec4 bvec4v; + + doublev = sqrt(2.9); + dvec2v = sqrt(dvec2(2.7)); + dvec3v = sqrt(dvec3(2.0)); + dvec4v = sqrt(dvec4(2.1)); + + doublev += inversesqrt(doublev); + dvec2v += inversesqrt(dvec2v); + dvec3v += inversesqrt(dvec3v); + dvec4v += inversesqrt(dvec4v); + + doublev += abs(doublev); + dvec2v += abs(dvec2v); + dvec3v += abs(dvec3v); + dvec4v += abs(dvec4v); + + doublev += sign(doublev); + dvec2v += sign(dvec2v); + dvec3v += sign(dvec3v); + dvec4v += sign(dvec4v); + + doublev += floor(doublev); + dvec2v += floor(dvec2v); + dvec3v += floor(dvec3v); + dvec4v += floor(dvec4v); + + doublev += trunc(doublev); + dvec2v += trunc(dvec2v); + dvec3v += trunc(dvec3v); + dvec4v += trunc(dvec4v); + + doublev += round(doublev); + dvec2v += round(dvec2v); + dvec3v += round(dvec3v); + dvec4v += round(dvec4v); + + doublev += roundEven(doublev); + dvec2v += roundEven(dvec2v); + dvec3v += roundEven(dvec3v); + dvec4v += roundEven(dvec4v); + + doublev += ceil(doublev); + dvec2v += ceil(dvec2v); + dvec3v += ceil(dvec3v); + dvec4v += ceil(dvec4v); + + doublev += fract(doublev); + dvec2v += fract(dvec2v); + dvec3v += fract(dvec3v); + dvec4v += fract(dvec4v); + + doublev += mod(doublev, doublev); + dvec2v += mod(dvec2v, doublev); + dvec3v += mod(dvec3v, doublev); + dvec4v += mod(dvec4v, doublev); + dvec2v += mod(dvec2v, dvec2v); + dvec3v += mod(dvec3v, dvec3v); + dvec4v += mod(dvec4v, dvec4v); + + doublev += modf(doublev, doublev); + dvec2v += modf(dvec2v, dvec2v); + dvec3v += modf(dvec3v, dvec3v); + dvec4v += modf(dvec4v, dvec4v); + + doublev += min(doublev, doublev); + dvec2v += min(dvec2v, doublev); + dvec3v += min(dvec3v, doublev); + dvec4v += min(dvec4v, doublev); + dvec2v += min(dvec2v, dvec2v); + dvec3v += min(dvec3v, dvec3v); + dvec4v += min(dvec4v, dvec4v); + + doublev += max(doublev, doublev); + dvec2v += max(dvec2v, doublev); + dvec3v += max(dvec3v, doublev); + dvec4v += max(dvec4v, doublev); + dvec2v += max(dvec2v, dvec2v); + dvec3v += max(dvec3v, dvec3v); + dvec4v += max(dvec4v, dvec4v); + + doublev += clamp(doublev, doublev, doublev); + dvec2v += clamp(dvec2v, doublev, doublev); + dvec3v += clamp(dvec3v, doublev, doublev); + dvec4v += clamp(dvec4v, doublev, doublev); + dvec2v += clamp(dvec2v, dvec2v, dvec2v); + dvec3v += clamp(dvec3v, dvec3v, dvec3v); + dvec4v += clamp(dvec4v, dvec4v, dvec4v); + + doublev += mix(doublev, doublev, doublev); + dvec2v += mix(dvec2v, dvec2v, doublev); + dvec3v += mix(dvec3v, dvec3v, doublev); + dvec4v += mix(dvec4v, dvec4v, doublev); + dvec2v += mix(dvec2v, dvec2v, dvec2v); + dvec3v += mix(dvec3v, dvec3v, dvec3v); + dvec4v += mix(dvec4v, dvec4v, dvec4v); + doublev += mix(doublev, doublev, boolv); + dvec2v += mix(dvec2v, dvec2v, bvec2v); + dvec3v += mix(dvec3v, dvec3v, bvec3v); + dvec4v += mix(dvec4v, dvec4v, bvec4v); + + doublev += step(doublev, doublev); + dvec2v += step(dvec2v, dvec2v); + dvec3v += step(dvec3v, dvec3v); + dvec4v += step(dvec4v, dvec4v); + dvec2v += step(doublev, dvec2v); + dvec3v += step(doublev, dvec3v); + dvec4v += step(doublev, dvec4v); + + doublev += smoothstep(doublev, doublev, doublev); + dvec2v += smoothstep(dvec2v, dvec2v, dvec2v); + dvec3v += smoothstep(dvec3v, dvec3v, dvec3v); + dvec4v += smoothstep(dvec4v, dvec4v, dvec4v); + dvec2v += smoothstep(doublev, doublev, dvec2v); + dvec3v += smoothstep(doublev, doublev, dvec3v); + dvec4v += smoothstep(doublev, doublev, dvec4v); + + boolv = isnan(doublev); + bvec2v = isnan(dvec2v); + bvec3v = isnan(dvec3v); + bvec4v = isnan(dvec4v); + + boolv = boolv ? isinf(doublev) : false; + bvec2v = boolv ? isinf(dvec2v) : bvec2(false); + bvec3v = boolv ? isinf(dvec3v) : bvec3(false); + bvec4v = boolv ? isinf(dvec4v) : bvec4(false); + + doublev += length(doublev); + doublev += length(dvec2v); + doublev += length(dvec3v); + doublev += length(dvec4v); + + doublev += distance(doublev, doublev); + doublev += distance(dvec2v, dvec2v); + doublev += distance(dvec3v, dvec3v); + doublev += distance(dvec4v, dvec4v); + + doublev += dot(doublev, doublev); + doublev += dot(dvec2v, dvec2v); + doublev += dot(dvec3v, dvec3v); + doublev += dot(dvec4v, dvec4v); + + dvec3v += cross(dvec3v, dvec3v); + + doublev += normalize(doublev); + dvec2v += normalize(dvec2v); + dvec3v += normalize(dvec3v); + dvec4v += normalize(dvec4v); + + doublev += faceforward(doublev, doublev, doublev); + dvec2v += faceforward(dvec2v, dvec2v, dvec2v); + dvec3v += faceforward(dvec3v, dvec3v, dvec3v); + dvec4v += faceforward(dvec4v, dvec4v, dvec4v); + + doublev += reflect(doublev, doublev); + dvec2v += reflect(dvec2v, dvec2v); + dvec3v += reflect(dvec3v, dvec3v); + dvec4v += reflect(dvec4v, dvec4v); + + doublev += refract(doublev, doublev, doublev); + dvec2v += refract(dvec2v, dvec2v, doublev); + dvec3v += refract(dvec3v, dvec3v, doublev); + dvec4v += refract(dvec4v, dvec4v, doublev); + + dmat2 dmat2v = outerProduct(dvec2v, dvec2v); + dmat3 dmat3v = outerProduct(dvec3v, dvec3v); + dmat4 dmat4v = outerProduct(dvec4v, dvec4v); + dmat2x3 dmat2x3v = outerProduct(dvec3v, dvec2v); + dmat3x2 dmat3x2v = outerProduct(dvec2v, dvec3v); + dmat2x4 dmat2x4v = outerProduct(dvec4v, dvec2v); + dmat4x2 dmat4x2v = outerProduct(dvec2v, dvec4v); + dmat3x4 dmat3x4v = outerProduct(dvec4v, dvec3v); + dmat4x3 dmat4x3v = outerProduct(dvec3v, dvec4v); + + dmat2v *= matrixCompMult(dmat2v, dmat2v); + dmat3v *= matrixCompMult(dmat3v, dmat3v); + dmat4v *= matrixCompMult(dmat4v, dmat4v); + dmat2x3v = matrixCompMult(dmat2x3v, dmat2x3v); + dmat2x4v = matrixCompMult(dmat2x4v, dmat2x4v); + dmat3x2v = matrixCompMult(dmat3x2v, dmat3x2v); + dmat3x4v = matrixCompMult(dmat3x4v, dmat3x4v); + dmat4x2v = matrixCompMult(dmat4x2v, dmat4x2v); + dmat4x3v = matrixCompMult(dmat4x3v, dmat4x3v); + + dmat2v *= transpose(dmat2v); + dmat3v *= transpose(dmat3v); + dmat4v *= transpose(dmat4v); + dmat2x3v = transpose(dmat3x2v); + dmat3x2v = transpose(dmat2x3v); + dmat2x4v = transpose(dmat4x2v); + dmat4x2v = transpose(dmat2x4v); + dmat3x4v = transpose(dmat4x3v); + dmat4x3v = transpose(dmat3x4v); + + doublev += determinant(dmat2v); + doublev += determinant(dmat3v); + doublev += determinant(dmat4v); + + dmat2v *= inverse(dmat2v); + dmat3v *= inverse(dmat3v); + dmat4v *= inverse(dmat4v); +} diff --git a/deps/glslang/Test/400.tesc b/deps/glslang/Test/400.tesc new file mode 100644 index 00000000..415d7f7d --- /dev/null +++ b/deps/glslang/Test/400.tesc @@ -0,0 +1,125 @@ +#version 400 core + +layout(vertices = 4) out; +int outa[gl_out.length()]; + +layout(quads) in; // ERROR +layout(ccw) out; // ERROR +layout(fractional_even_spacing) in; // ERROR + +patch in vec4 patchIn; // ERROR +patch out vec4 patchOut; + +void main() +{ + barrier(); + + int a = gl_MaxTessControlInputComponents + + gl_MaxTessControlOutputComponents + + gl_MaxTessControlTextureImageUnits + + gl_MaxTessControlUniformComponents + + gl_MaxTessControlTotalOutputComponents; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; + float cd = gl_in[1].gl_ClipDistance[2]; + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + int iid = gl_InvocationID; + + gl_out[gl_InvocationID].gl_Position = p; + gl_out[gl_InvocationID].gl_PointSize = ps; + gl_out[gl_InvocationID].gl_ClipDistance[1] = cd; + + gl_TessLevelOuter[3] = 3.2; + gl_TessLevelInner[1] = 1.3; + + if (a > 10) + barrier(); // ERROR + else + barrier(); // ERROR + + barrier(); + + do { + barrier(); // ERROR + } while (a > 10); + + switch (a) { + default: + barrier(); // ERROR + break; + } + a < 12 ? a : (barrier(), a); // ERROR + { + barrier(); + } + + return; + + barrier(); // ERROR +} + +layout(vertices = 4) in; // ERROR +layout(vertices = 5) out; // ERROR + +void foo() +{ + gl_out[4].gl_PointSize; // ERROR + + barrier(); // ERROR +} + +in vec2 ina; // ERROR, not array +in vec2 inb[]; +in vec2 inc[18]; // ERROR, wrong size +in vec2 ind[gl_MaxPatchVertices]; + +#extension GL_ARB_separate_shader_objects : enable + +layout(location = 3) in vec4 ivla[]; +layout(location = 4) in vec4 ivlb[]; +layout(location = 4) in vec4 ivlc[]; // ERROR, overlapping + +layout(location = 3) out vec4 ovla[]; +layout(location = 4) out vec4 ovlb[]; +layout(location = 4) out vec4 ovlc[]; // ERROR, overlapping + +precise vec3 pv3; + +void foop() +{ + precise double d; + + pv3 *= pv3; + pv3 = fma(pv3, pv3, pv3); + d = fma(d, d, d); +} + +patch out pinbn { + int a; +} pinbi; + +invariant precise out vec4 badOrder[]; // ERROR, precise must appear first +void badp(out precise float f); // ERROR, precise must appear first + +void devi() +{ + gl_DeviceIndex; // ERROR, no extension + gl_ViewIndex; // ERROR, no extension +} + +#ifdef GL_EXT_device_group +#extension GL_EXT_device_group : enable +#endif + +#ifdef GL_EXT_device_group +#extension GL_EXT_multiview : enable +#endif + +void devie() +{ + gl_DeviceIndex; + gl_ViewIndex; +} diff --git a/deps/glslang/Test/400.tese b/deps/glslang/Test/400.tese new file mode 100644 index 00000000..c110a1c4 --- /dev/null +++ b/deps/glslang/Test/400.tese @@ -0,0 +1,125 @@ +#version 400 core + +layout(vertices = 4) out; // ERROR +layout(quads, cw) in; +layout(triangles) in; // ERROR +layout(isolines) in; // ERROR + +layout(ccw) in; // ERROR +layout(cw) in; + +layout(fractional_odd_spacing) in; +layout(equal_spacing) in; // ERROR +layout(fractional_even_spacing) in; // ERROR + +layout(point_mode) in; + +patch in vec4 patchIn; +patch out vec4 patchOut; // ERROR + +void main() +{ + barrier(); // ERROR + + int a = gl_MaxTessEvaluationInputComponents + + gl_MaxTessEvaluationOutputComponents + + gl_MaxTessEvaluationTextureImageUnits + + gl_MaxTessEvaluationUniformComponents + + gl_MaxTessPatchComponents + + gl_MaxPatchVertices + + gl_MaxTessGenLevel; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; + float cd = gl_in[1].gl_ClipDistance[2]; + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + vec3 tc = gl_TessCoord; + float tlo = gl_TessLevelOuter[3]; + float tli = gl_TessLevelInner[1]; + + gl_Position = p; + gl_PointSize = ps; + gl_ClipDistance[2] = cd; +} + +smooth patch in vec4 badp1; // ERROR +flat patch in vec4 badp2; // ERROR +noperspective patch in vec4 badp3; // ERROR +patch sample in vec3 badp4; // ERROR + +#extension GL_ARB_separate_shader_objects : enable + +in gl_PerVertex +{ + float gl_ClipDistance[1]; +} gl_in[]; + +in gl_PerVertex // ERROR, second redeclaration of gl_in +{ + float gl_ClipDistance[1]; +} gl_in[]; + +layout(quads, cw) out; // ERROR +layout(triangles) out; // ERROR +layout(isolines) out; // ERROR +layout(cw) out; // ERROR +layout(fractional_odd_spacing) out; // ERROR +layout(equal_spacing) out; // ERROR +layout(fractional_even_spacing) out; // ERROR +layout(point_mode) out; // ERROR + +in vec2 ina; // ERROR, not array +in vec2 inb[]; +in vec2 inc[18]; // ERROR, wrong size +in vec2 ind[gl_MaxPatchVertices]; + +in testbla { + int f; +} bla; // ERROR, not array + +in testblb { + int f; +} blb[]; + +in testblc { + int f; +} blc[18]; // ERROR wrong size + +in testbld { + int f; +} bld[gl_MaxPatchVertices]; + +layout(location = 23) in vec4 ivla[]; +layout(location = 24) in vec4 ivlb[]; +layout(location = 24) in vec4 ivlc[]; // ERROR + +layout(location = 23) out vec4 ovla[2]; +layout(location = 24) out vec4 ovlb[2]; // ERROR + +in float gl_TessLevelOuter[4]; // ERROR, can't redeclare + +patch in pinbn { + int a; +} pinbi; + +void devi() +{ + gl_DeviceIndex; // ERROR, no extension + gl_ViewIndex; // ERROR, no extension +} + +#ifdef GL_EXT_device_group +#extension GL_EXT_device_group : enable +#endif + +#ifdef GL_EXT_device_group +#extension GL_EXT_multiview : enable +#endif + +void devie() +{ + gl_DeviceIndex; + gl_ViewIndex; +} diff --git a/deps/glslang/Test/400.vert b/deps/glslang/Test/400.vert new file mode 100644 index 00000000..315c7ea0 --- /dev/null +++ b/deps/glslang/Test/400.vert @@ -0,0 +1,106 @@ +#version 400 core + +in double d; // ERROR, no doubles +in dvec3 d3; // ERROR, no doubles +in dmat4 dm4; // ERROR, no doubles + +// function selection under type conversion +void foo1(double a, uint b) {} +void foo1(double a, int b) {} +void foo1(double a, float b) {} +void foo1(double a, double b){} + +void foo2(double a, float b) {} +void foo2(double a, double b){} + +void foo3(double a, float b) {} +void foo3(float a, double b) {} + +void ftd( int, float, double) {} +void ftd( uint, float, double) {} +void ftd(float, double, double) {} + +void main() +{ + double d; + uint u; + int i; + float f; + + foo1(d, d); + foo1(d, u); + foo1(d, i); + foo1(d, f); + + foo1(f, d); + foo1(f, u); + foo1(f, i); + foo1(f, f); + + foo1(u, d); + foo1(u, u); + foo1(u, i); + foo1(u, f); + + foo1(i, d); + foo1(i, u); + foo1(i, i); + foo1(i, f); + + foo2(d, d); + foo2(d, u); + foo2(d, i); + foo2(d, f); + + foo2(f, d); + foo2(f, u); + foo2(f, i); + foo2(f, f); + + foo2(u, d); + foo2(u, u); + foo2(u, i); + foo2(u, f); + + foo2(i, d); + foo2(i, u); + foo2(i, i); + foo2(i, f); + + foo3(d, d); // ERROR, no match + foo3(d, u); + foo3(d, i); + foo3(d, f); + + foo3(f, d); + foo3(f, u); // ERROR, ambiguous + foo3(f, i); // ERROR, ambiguous + foo3(f, f); // ERROR, ambiguous + + foo3(u, d); + foo3(u, u); // ERROR, ambiguous + foo3(u, i); // ERROR, ambiguous + foo3(u, f); // ERROR, ambiguous + + foo3(i, d); + foo3(i, u); // ERROR, ambiguous + foo3(i, i); // ERROR, ambiguous + foo3(i, f); // ERROR, ambiguous + + ftd(i, f, f); + ftd(u, f, f); +} + +void itf(int, float, int); +void itf(int, double, int); + +void tf() +{ + double d; + uint u; + int i; + float f; + + itf(i, i, i); + itf(i, u, i); +} diff --git a/deps/glslang/Test/410.geom b/deps/glslang/Test/410.geom new file mode 100644 index 00000000..8775aeb1 --- /dev/null +++ b/deps/glslang/Test/410.geom @@ -0,0 +1,39 @@ +#version 410 core + +void main() +{ + gl_ViewportIndex = 7; +} + +in gl_PerVertex { + float gl_PointSize; +} myIn[]; // ERROR, can't redeclare a different name + +in gl_PerVertex { + float gl_PointSize; +} gl_myIn[]; // ERROR, can't redeclare a different name + +in gl_PerVertex { + float gl_PointSize; +} gl_in[]; + +in gl_PerVertex { + float gl_PointSize; +} gl_in[]; // ERROR, can't do it again + +out gl_PerVertex { + float gl_PointSize; +}; + +void foo() +{ + float p = gl_in[1].gl_PointSize; // use of redeclared + gl_PointSize = p; // use of redeclared + vec4 v = gl_in[1].gl_Position; // ERROR, not included in the redeclaration + gl_Position = vec4(1.0); // ERROR, not included in the redeclaration +} + +float foo5() +{ + return 4; // implicit conversion of return type +} diff --git a/deps/glslang/Test/410.tesc b/deps/glslang/Test/410.tesc new file mode 100644 index 00000000..d96a2700 --- /dev/null +++ b/deps/glslang/Test/410.tesc @@ -0,0 +1,11 @@ +#version 400 core + +// no layout(vertices = ...) out; +int outa[gl_out.length()]; // ERROR + +patch out vec4 patchOut; + +void main() +{ + +} diff --git a/deps/glslang/Test/410.vert b/deps/glslang/Test/410.vert new file mode 100644 index 00000000..0ecf4768 --- /dev/null +++ b/deps/glslang/Test/410.vert @@ -0,0 +1,9 @@ +#version 410 core + +in double d; +in dvec3 d3; +in dmat4 dm4; + +void main() +{ +} diff --git a/deps/glslang/Test/420.comp b/deps/glslang/Test/420.comp new file mode 100644 index 00000000..d92e6f0d --- /dev/null +++ b/deps/glslang/Test/420.comp @@ -0,0 +1,30 @@ +#version 420 + +layout(local_size_x = 2) in; // ERROR, no compute + +#extension GL_ARB_compute_shader : enable + +layout(local_size_x = 2, local_size_y = 4, local_size_z = 6) in; + +shared vec3 sfoo; + +void main() +{ + sfoo = vec3(gl_WorkGroupSize.x, gl_WorkGroupSize.y, gl_WorkGroupSize.z); + sfoo += gl_WorkGroupSize + gl_NumWorkGroups + gl_WorkGroupID + gl_LocalInvocationID + gl_GlobalInvocationID; + sfoo *= gl_LocalInvocationIndex; + sfoo += gl_MaxComputeWorkGroupCount + gl_MaxComputeWorkGroupSize; + sfoo *= gl_MaxComputeUniformComponents + + gl_MaxComputeTextureImageUnits + + gl_MaxComputeImageUniforms + + gl_MaxComputeAtomicCounters + + gl_MaxComputeAtomicCounterBuffers; + + barrier(); + memoryBarrier(); + memoryBarrierAtomicCounter(); + memoryBarrierBuffer(); + memoryBarrierImage(); + memoryBarrierShared(); + groupMemoryBarrier(); +} \ No newline at end of file diff --git a/deps/glslang/Test/420.frag b/deps/glslang/Test/420.frag new file mode 100644 index 00000000..1444758e --- /dev/null +++ b/deps/glslang/Test/420.frag @@ -0,0 +1,14 @@ +#version 420 core + +layout(depth_any) out float gl_FragDepth; +layout(depth_greater) out float gl_FragDepth; // ERROR: redeclaration with different qualifier + +void main() +{ + gl_FragDepth = 0.3; +} + +layout(depth_less) in float depth; // ERROR: depth_less only applies to gl_FragDepth +layout(depth_any) out float gl_FragDepth; // ERROR, done after use + +layout(binding=0) uniform atomic_uint a[]; diff --git a/deps/glslang/Test/420.geom b/deps/glslang/Test/420.geom new file mode 100644 index 00000000..43903bc7 --- /dev/null +++ b/deps/glslang/Test/420.geom @@ -0,0 +1,55 @@ +#version 420 core + +// testing input arrays without a gl_in[] block redeclaration, see 400.geom for with + +int i; + +void foo() +{ + gl_in.length(); // ERROR + gl_in[1].gl_Position; + gl_in[i].gl_Position; // ERROR +} + +layout(triangles) in; + +in vec4 color3[3]; + +void foo3() +{ + gl_in.length(); + gl_in[i].gl_Position; + color3.length(); +} + +uniform sampler2D s2D; +in vec2 coord[]; +uniform vec4 v4; + +void foo4() +{ + const ivec2 offsets[5] = + { + ivec2(0,1), + ivec2(1,-2), + ivec2(0,3), + ivec2(-3,0), + ivec2(2,1) + }; + + vec4 v = textureGatherOffset(s2D, coord[0], offsets[i].xy); + + offsets[i].xy = ivec2(3); // ERROR + v4.x = 3.2; // ERROR + v4.xy; // should have non-uniform type +} + +out gl_PerVertex { + float gl_PointSize[1]; // ERROR, adding array + float gl_ClipDistance; // ERROR, removing array +}; + +float foo5() +{ + return i; // implicit conversion of return type +} diff --git a/deps/glslang/Test/420.tesc b/deps/glslang/Test/420.tesc new file mode 100644 index 00000000..b9fd21c2 --- /dev/null +++ b/deps/glslang/Test/420.tesc @@ -0,0 +1,43 @@ +#version 420 core + +#extension GL_ARB_separate_shader_objects : enable + +layout(vertices = 4) out; + +out gl_PerVertex { + vec4 gl_Position; +} gl_out[3]; // ERROR, wrong size + +out int a[gl_out.length()]; +out int outb[5]; // ERROR, wrong size +out int outc[]; + +void main() +{ + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; + float cd = gl_in[1].gl_ClipDistance[2]; + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + int iid = gl_InvocationID; + + gl_out[gl_InvocationID].gl_Position = p; + gl_out[gl_InvocationID].gl_PointSize = ps; // ERROR +} + +out float outf; // ERROR, no array + +layout (location = 0) in dmat2x4 vs_tcs_first[]; +layout (location = 12) in dmat2x4 vs_tcs_last[]; + +void foo() +{ + if ((dmat2x4(dvec4(-0.625, -0.5, -0.375lf, -0.25), dvec4(-0.375, -0.25, -0.125, 0)) != vs_tcs_first[0]) || + (dmat2x4(dvec4(0.375, 0.5, 0.625, 0.75), dvec4(0.625, 0.75, 0.875, -0.625)) != vs_tcs_last[0])) + { + ; + } +} + +layout(vertices = 0) out; // ERROR, can't be 0 diff --git a/deps/glslang/Test/420.tese b/deps/glslang/Test/420.tese new file mode 100644 index 00000000..4c3693a8 --- /dev/null +++ b/deps/glslang/Test/420.tese @@ -0,0 +1,90 @@ +#version 420 core + +const mat2x2 a = mat2( vec2( 1.0, 0.0 ), vec2( 0.0, 1.0 ) ); +mat2x2 b = { vec2( 1.0, 0.0 ), vec2( 0.0, 1.0 ) }; +const mat2x2 c = { { 1.0, 0.0, }, { 0.0, 1.0 } }; + +float a2[2] = { 3.4, 4.2, 5.0 }; // illegal +vec2 b2 = { 1.0, 2.0, 3.0 }; // illegal +mat3x3 c2 = { vec3(0.0), vec3(1.0), vec3(2.0), vec3(3.0) }; // illegal +mat2x2 d = { 1.0, 0.0, 0.0, 1.0 }; // illegal, can't flatten nesting + +struct { + float a; + int b; +} e = { 1.2, 2, }; + +struct { + float a; + int b; +} e2 = { 1, 3 }; // legal, first initializer is converted + +struct { + float a; + int b; +} e3 = { 1.2, 2, 3 }; // illegal + +int a3 = true; // illegal +vec4 b3[2] = { vec4(0.0), 1.0 }; // illegal +vec4 b4[2] = vec4[2](vec4(0.0), mat2x2(1.0)); // illegal +mat4x2 c3 = { vec3(0.0), vec3(1.0) }; // illegal + +struct S1 { + vec4 a; + vec4 b; +}; + +struct { + float s; + float t; +} d2[] = { S1(vec4(0.0), vec4(1.1)) }; // illegal + +float b5[] = { 3.4, 4.2, 5.0, 5.2, 1.1 }; + +struct S3 { + float f; + mat2x3 m23; +}; + +struct S4 { + uvec2 uv2; + S3 s[2]; +}; + +struct Single1 { int f; }; +Single1 single1 = { 10 }; + +struct Single2 { uvec2 v; }; +Single2 single2 = { { 1, 2 } }; + +struct Single3 { Single1 s1; }; +Single3 single3 = { { 3 } }; + +struct Single4 { Single2 s1; }; +Single4 single4 = { { { 4u, 5u } } }; + +const S4 constructed = S4(uvec2(1, 2), + S3[2](S3(3.0, mat2x3(4.0)), + S3(5.0, mat2x3(6.0)))); + +const S4 curlybad1 = { {1, 2}, + { {3, {4.0, 0, 0.0}, {0.0, 4.0, 0.0 } }, // ERROR, the mat2x3 isn't isolated + {5.0, {6, 0.0, 0.0}, {0.0, 6.0, 0.0 } } } }; + +const S4 curlyInit = { {1, 2}, + { {3, { {4.0, 0, 0.0}, {0.0, 4.0, 0.0 } } }, + {5.0, { {6, 0.0, 0.0}, {0.0, 6.0, 0.0 } } } } }; + +float vc1, vc2, vc3; +vec3 av3 = vec3(vc1, vc2, vc3); +vec3 bv3 = { vc1, vc2, vc3 }; + +void main() +{ + memoryBarrier(); + + if (constructed == curlybad1) + ; + if (constructed == curlyInit) + ; +} diff --git a/deps/glslang/Test/420.vert b/deps/glslang/Test/420.vert new file mode 100644 index 00000000..ab28140e --- /dev/null +++ b/deps/glslang/Test/420.vert @@ -0,0 +1,161 @@ +#version 420 core +#version 420 core +varying vec2 v2; // ERROR, varying reserved +in vec4 bad[10]; +highp in vec4 badorder; +out invariant vec4 badorder2; +in centroid vec4 badorder4; // ERROR, no centroid input to vertex stage +out flat vec4 badorder3; +void bar(in const float a); +void bar2(highp in float b); +smooth flat out vec4 rep; // ERROR, replicating interpolation qualification +centroid sample out vec4 rep2; // ERROR, replicating auxiliary qualification +in uniform vec4 rep3; // ERROR, replicating storage qualification + +int anonconst; +const int aconst = 5; +const int a = aconst; +const int b = anonconst; // ERROR at global scope + +const int foo() // ERROR, no const functions +{ + const int a = aconst; + const int b = anonconst; + const int c = a; // still compile-time const + const int d = b; // not a compile-time const + float x[c]; // okay + float y[d]; // ERROR + + return b; +} + +void main() +{ + int i; + if (i == 3) + int j = i; + else + int k = j; // ERROR, j is undeclared + int m = k; // ERROR, k is undeclared + int n = j; // ERROR, j is undeclared + + while (true) + int jj; + int kk = jj; // ERROR, jj is undeclared +} + +const float cx = 4.20; +const float dx = 4.20; + +void bar(in highp volatile vec4 v) +{ + int s; + s.x; // okay + s.y; // ERROR + if (bad[0].x == cx.x) + ; + if (cx.x == dx.x) + badorder3 = bad[0]; + + float f; + vec3 smeared = f.xxx; + f.xxxxx; // ERROR + f.xxy; // ERROR +} + +layout(binding = 3) uniform; // ERROR +layout(binding = 3) uniform boundblock { int aoeu; } boundInst; +layout(binding = 7) uniform anonblock { int aoeu; } ; +layout(location = 1) in; // ERROR +layout(binding = 1) in inblock { int aoeua; }; // ERROR +layout(binding = 100000) uniform anonblock2 { int aooeu; } ; +layout(binding = 4) uniform sampler2D sampb1; +layout(binding = 5) uniform sampler2D sampb2[10]; +layout(binding = 80) uniform sampler2D sampb3; // ERROR, binding too big +layout(binding = 31) uniform sampler2D sampb4; +layout(binding = 79) uniform sampler2D sampb5[2]; // ERROR, binding too big + +int fgfg(float f, mediump int i); +int fgfg(float f, highp int i); + +out gl_PerVertex { + float gl_ClipDistance[4]; +}; + +patch in vec4 patchIn; // ERROR +patch out vec4 patchOut; // ERROR + +void bar23444() +{ + mat4x3 m43; \ + float a1 = m43[3].y; + vec3 v3; + int a2 = m43.length(); + a2 += m43[1].length(); + a2 += v3.length(); + const float b = 2 * a1; + int a = gl_MinProgramTexelOffset + gl_MaxProgramTexelOffset; +} + +const int comma0 = (2, 3); // ERROR +int comma1[(2, 3)]; // ERROR + +layout(r32i) uniform iimage2D iimg2D; +layout(rgba32i) uniform iimage2D iimg2Drgba; +layout(rgba32f) uniform image2D img2Drgba; +layout(r32ui) uniform uimage2D uimg2D; +uniform image2DMS img2DMS; // ERROR image variables not declared writeonly must have format layout qualifier +uniform writeonly image2DMS img2DMSWO; +void qux() +{ + int i = aoeu; + imageAtomicCompSwap(iimg2D, ivec2(i,i), i, i); + imageAtomicAdd(uimg2D, ivec2(i,i), uint(i)); + imageAtomicMin(iimg2Drgba, ivec2(i,i), i); // ERROR iimg2Drgba does not have r32i layout + imageAtomicMax(img2Drgba, ivec2(i,i), i); // ERROR img2Drgba is not integer image + ivec4 pos = imageLoad(iimg2D, ivec2(i,i)); + vec4 col = imageLoad(img2DMS, ivec2(i,i), i); + imageStore(img2DMSWO, ivec2(i,i), i, vec4(0)); + imageLoad(img2DMSWO, ivec2(i,i), i); // ERROR, drops writeonly +} + +volatile float vol; // ERROR, not an image +readonly int vol2; // ERROR, not an image + +void passr(coherent readonly iimage2D image) +{ +} + +layout(r32i) coherent readonly uniform iimage2D qualim1; +layout(r32i) coherent volatile readonly uniform iimage2D qualim2; + +void passrc() +{ + passr(qualim1); + passr(qualim2); // ERROR, drops volatile + passr(iimg2D); +} + +layout(rg8i) uniform uimage2D i1bad; // ERROR, type mismatch +layout(rgba32i) uniform image2D i2bad; // ERROR, type mismatch +layout(rgba32f) uniform uimage2D i3bad; // ERROR, type mismatch +layout(r8_snorm) uniform iimage2D i4bad; // ERROR, type mismatch +layout(rgba32ui) uniform iimage2D i5bad; // ERROR, type mismatch +layout(r8ui) uniform iimage2D i6bad; // ERROR, type mismatch + +uniform offcheck { + layout(offset = 16) int foo; // ERROR +} offcheckI; + +uniform sampler1D samp1D; +uniform sampler1DShadow samp1Ds; + +void qlod() +{ + int levels; + + levels = textureQueryLevels(samp1D); // ERROR, not until 430 + levels = textureQueryLevels(samp1Ds); // ERROR, not until 430 +} + +layout(binding=0) writeonly uniform image1D badArray[]; diff --git a/deps/glslang/Test/420_size_gl_in.geom b/deps/glslang/Test/420_size_gl_in.geom new file mode 100644 index 00000000..b709d5aa --- /dev/null +++ b/deps/glslang/Test/420_size_gl_in.geom @@ -0,0 +1,21 @@ +#version 420 core + +// testing input arrays without a gl_in[] block redeclaration, see 400.geom for with + +int i; + +layout(triangles) in; +in vec4 colorun[]; +in vec4 color3[3]; + +void foo() +{ + gl_in.length(); + gl_in[1].gl_Position; + gl_in.length(); + gl_in[i].gl_Position; // should be sized to 3 by 'triangles' +} + +in gl_PerVertex { // ERROR, already used + vec4 gl_Position; +} gl_in[]; diff --git a/deps/glslang/Test/430.comp b/deps/glslang/Test/430.comp new file mode 100644 index 00000000..0929432b --- /dev/null +++ b/deps/glslang/Test/430.comp @@ -0,0 +1,87 @@ +#version 430 core + +layout(local_size_x = 2) in; +layout(local_size_x = 16) in; // ERROR, changing +layout(local_size_z = 4096) in; // ERROR, too large +layout(local_size_x = 2) in; + +const int total = gl_MaxComputeWorkGroupCount.y + + gl_MaxComputeUniformComponents + + gl_MaxComputeTextureImageUnits + + gl_MaxComputeImageUniforms + + gl_MaxComputeAtomicCounters + + gl_MaxComputeAtomicCounterBuffers; + +buffer ShaderStorageBlock +{ + int value; + float values[]; +}; + +buffer InvalidShaderStorageBlock +{ + float values[]; + int value; +} invalid; + +void main() +{ + barrier(); + memoryBarrier(); + memoryBarrierAtomicCounter(); + memoryBarrierBuffer(); + memoryBarrierShared(); + memoryBarrierImage(); + groupMemoryBarrier(); + value = int(values[gl_LocalInvocationIndex]); + + int a; + if (a > 10) + barrier(); +} + +layout(location = 2) in vec3 v3; // ERROR +in float f; // ERROR +out float fo; // ERROR + +shared vec4 s; +layout(location = 2) shared vec4 sl; // ERROR +shared float fs = 4.2; // ERROR + +layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) out; // ERROR + +int arrX[gl_WorkGroupSize.x]; +int arrY[gl_WorkGroupSize.y]; +int arrZ[gl_WorkGroupSize.z]; + +readonly buffer roblock +{ + int value; + float values[]; +} ro; + +void foo() +{ + ro.values[2] = 4.7; // ERROR, readonly + ro.values.length(); + barrier(); +} + +uniform double roll; +uniform writeonly image2D destTex; +void fooaoeu() { + ivec2 storePos = ivec2(gl_GlobalInvocationID.xy); + double localCoef = length(vec2(ivec2(gl_LocalInvocationID.xy)-8)/8.0); + dvec4 aa = dvec4(0.4, 0.2, 0.3, 0.4); + double globalCoef = 1.0; + int i = globalCoef; // ERROR, can't convert from double to int + double di = i; +} + +in inb { // ERROR + int a; +} inbi; + +out outb { // ERROR + int a; +} outbi; diff --git a/deps/glslang/Test/430.vert b/deps/glslang/Test/430.vert new file mode 100644 index 00000000..84c32208 --- /dev/null +++ b/deps/glslang/Test/430.vert @@ -0,0 +1,223 @@ +#version 430 core + +layout(location = 3) vec4 v4; // ERROR + +layout(location = 4) uniform vec4 uv4; + +layout(location = 2) in inb1 { vec4 v; } b1; // ERROR +layout(location = 2) out outb1 { vec4 v; } b2; // ERROR + +out gl_PerVertex { + float gl_ClipDistance[]; +}; + +void foo() +{ + gl_ClipDistance[2] = 3.7; +} + +struct sp { + highp float f; + in float g; // ERROR + uniform float h; // ERROR + invariant float i; // ERROR + volatile float j; // ERROR + layout(row_major) mat3 m3; // ERROR +}; + +void foo3(invariant vec4 v4, // ERROR + volatile vec3 v3, + layout(location = 3) vec2 v2, // ERROR + centroid vec3 cv3) // ERROR +{ +} + +struct S { + mat3x2 m[7]; // needs 7*3 locations + float f; // needs 1 location +}; // needs 22 locations + +layout(location = 10) out S cs[2]; // 10 through 10 + 2 * 22 - 1 = 53 +layout(location = 54) out float cf; +layout(location = 53) out float cg; // ERROR, collision at 31 + +layout(location = 10) in vec4 alias1; +layout(location = 10) in vec4 alias2; // okay for vertex input on desktop + +out float gl_ClipDistance[17]; // ERROR, size too big + +// enhanced_layouts (most tests are in 440.*) + +layout(location = start*start - 2 - 4) in vec4 v6e; // ERROR + +layout(location = 28) in inblock2e { + layout(location = 25) float f2; // ERROR +} ininst2e; + +in ublock4e { + layout(location = 50) float f1; // ERROR + layout(location = 51) float f2; // ERROR +} in4e; + +layout(align=16, std140) uniform ubl4e { int a; } inst4e;// ERROR + +layout(align=32) uniform ubl9e { // ERROR + layout(offset=12, align=4) float f; // ERROR + layout(offset=20) float g; // ERROR +} inst9e; + +layout(std140) uniform blocke { + vec4 a; + layout(offset = 32) vec3 b; // ERROR +} spinste; + +int aconste[gl_MaxTransformFeedbackBuffers]; // ERROR +int bconste[gl_MaxTransformFeedbackInterleavedComponents]; // ERROR + +out bblck2 { + layout(xfb_offset=64) vec4 bbv; // ERROR +} bbinst2; + +layout(xfb_buffer = 3, xfb_stride = 64) out; // ERROR + +layout(xfb_buffer=2, xfb_offset=48, xfb_stride=80) out vec4 bge; // ERROR +layout( xfb_offset=32, xfb_stride=64) out vec4 bhe; // ERROR + +layout(xfb_stride=80, xfb_buffer=2, xfb_offset=16) out bblck4e { // ERROR + vec4 bbv1; + vec4 bbv2; +} bbinst4e; + +out bblck5e { + layout(xfb_offset=0) vec4 bbv1; // ERROR + layout(xfb_stride=64, xfb_buffer=3, xfb_offset=48) vec4 bbv2; // ERROR +} bbinst5e; + +#extension GL_ARB_enhanced_layouts : enable + +layout(align=16, std140) uniform ubl4 { int a; } inst4; +layout(std430) uniform; + +layout(align=32) uniform ubl9 { + layout(offset=12, align=4) float f; + layout(offset=20) float g; +} inst9; + +layout(std140) uniform block { + vec4 a; // a takes offsets 0-15 + layout(offset = 32) vec3 b; // b takes offsets 32-43 +} spinst; + +int aconst[gl_MaxTransformFeedbackBuffers]; +int bconst[gl_MaxTransformFeedbackInterleavedComponents]; + +const int start2 = 5; +layout(location = start2 * start2 - 2 - 4) in vec4 v6; + +layout(location = 28) in inblock2 { // ERROR, input block in vertex shader, other errors are valid checks still... + bool b1; + float f1; + layout(location = 25) float f2; +} ininst2; + +in ublock4 { // ERROR, input block in vertex shader, other errors are valid checks still... + layout(location = 50) float f1; + layout(location = 51) float f2; +} in4; + +out bblck2g { + layout(xfb_offset=64) vec4 bbv; +} bbinst2g; + +layout(xfb_buffer = 1, xfb_stride = 80) out; // default buffer is 3 + +layout(xfb_buffer=1, xfb_offset=48, xfb_stride=80) out vec4 bg; +layout( xfb_offset=32, xfb_stride=80) out vec4 bh; + +layout(xfb_stride=80, xfb_buffer=1, xfb_offset=16) out bblck4 { + vec4 bbv1; +} bbinst4; + +out bblck5 { + layout(xfb_offset=0) vec4 bbv1; + layout(xfb_stride=80, xfb_buffer=1, xfb_offset=64) vec4 bbv2; +} bbinst5; + +shared vec4 sharedv; // ERROR + +void fooBarrier() +{ + barrier(); // ERROR + memoryBarrier(); + memoryBarrierAtomicCounter(); + memoryBarrierBuffer(); + memoryBarrierShared(); // ERROR + memoryBarrierImage(); + groupMemoryBarrier(); // ERROR +} + +buffer vec4 v; // ERROR + +uniform sampler2DMS s2dms; +uniform usampler2DMSArray us2dmsa; +layout(rgba32i) uniform iimage2DMS ii2dms; +layout(rgba32f) uniform image2DMSArray i2dmsa; + +void fooq() +{ + int s = textureSamples(s2dms); // ERROR + s += textureSamples(us2dmsa); // ERROR + s += imageSamples(ii2dms); // ERROR + s += imageSamples(i2dmsa); // ERROR +} + +#extension GL_ARB_shader_texture_image_samples : enable + +void fooq2() +{ + int s = textureSamples(s2dms); + s += textureSamples(us2dmsa); + s += imageSamples(ii2dms); + s += imageSamples(i2dmsa); +} + +uniform sampler1D samp1D; +uniform usampler2D usamp2D; +uniform isampler3D isamp3D; +uniform isamplerCube isampCube; +uniform isampler1DArray isamp1DA; +uniform sampler2DArray samp2DA; +uniform usamplerCubeArray usampCubeA; + +uniform sampler1DShadow samp1Ds; +uniform sampler2DShadow samp2Ds; +uniform samplerCubeShadow sampCubes; +uniform sampler1DArrayShadow samp1DAs; +uniform sampler2DArrayShadow samp2DAs; +uniform samplerCubeArrayShadow sampCubeAs; + +uniform samplerBuffer sampBuf; +uniform sampler2DRect sampRect; + +void qlod() +{ + int levels; + + levels = textureQueryLevels(samp1D); + levels = textureQueryLevels(usamp2D); + levels = textureQueryLevels(isamp3D); + levels = textureQueryLevels(isampCube); + levels = textureQueryLevels(isamp1DA); + levels = textureQueryLevels(samp2DA); + levels = textureQueryLevels(usampCubeA); + + levels = textureQueryLevels(samp1Ds); + levels = textureQueryLevels(samp2Ds); + levels = textureQueryLevels(sampCubes); + levels = textureQueryLevels(samp1DAs); + levels = textureQueryLevels(samp2DAs); + levels = textureQueryLevels(sampCubeAs); + + levels = textureQueryLevels(sampBuf); // ERROR + levels = textureQueryLevels(sampRect); // ERROR +} diff --git a/deps/glslang/Test/430AofA.frag b/deps/glslang/Test/430AofA.frag new file mode 100644 index 00000000..54d09230 --- /dev/null +++ b/deps/glslang/Test/430AofA.frag @@ -0,0 +1,108 @@ +#version 430 + +float[4][5][6] many[1][2][3]; + +float gu[][7]; +float gimp[][]; // ERROR, implicit inner +float g4[4][7]; +float g5[5][7]; + +float[4][7] foo(float a[5][7]) +{ + float r[7]; + r = a[2]; + float[](a[0], a[1], r, a[3]); // ERROR, too few dims + float[4][7][4](a[0], a[1], r, a[3]); // ERROR, too many dims + return float[4][7](a[0], a[1], r, a[3]); + return float[][](a[0], a[1], r, a[3]); + return float[][7](a[0], a[1], a[2], a[3]); +} + +void bar(float[5][7]) {} + +void main() +{ + { + float gu[3][4][2]; + + gu[2][4][1] = 4.0; // ERROR, overflow + } + vec4 ca4[3][2] = vec4[][](vec4[2](vec4(0.0), vec4(1.0)), + vec4[2](vec4(0.0), vec4(1.0)), + vec4[2](vec4(0.0), vec4(1.0))); + vec4 caim[][2] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0))); + vec4 caim2[][] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0))); + vec4 caim3[3][] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0))); + + vec4 a4[3][2] = {vec4[](vec4(0.0), vec4(1.0)), + vec4[2](vec4(0.0), vec4(1.0)), + vec4[2](vec4(0.0), vec4(1.0)) }; + vec4 aim[][2] = {vec4[2](vec4(4.0), vec4(2.0)), + vec4[](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)) }; + vec4 aim2[][] = {vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)), + vec4[](vec4(4.0), vec4(2.0)) }; + vec4 aim3[3][] = {vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)) }; + + vec4 bad2[3][] = {vec4[2](vec4(4.0), vec4(2.0)), // ERROR + vec4[3](vec4(4.0), vec4(2.0), vec4(5.0)), + vec4[2](vec4(4.0), vec4(2.0)) }; + + vec4 bad3[3][] = {vec4[3](vec4(4.0), vec4(2.0), vec4(5.0)), // ERROR + vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)) }; + + vec4 bad4[4][] = {vec4[2](vec4(4.0), vec4(2.0)), // ERROR + vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)) }; + + + g4 = foo(g5); + g5 = g4; // ERROR, wrong types + gu = g4; // ERROR, not yet sized + + foo(gu); // ERROR, not yet sized + bar(g5); + + if (foo(g5) == g4) + ; + if (foo(g5) == g5) // ERROR, different types + ; + + float u[][7]; + u[2][2] = 3.0; + float u[5][7]; + u[5][2] = 5.0; // ERROR + foo(u); +} + +void foo3() +{ + float resize1[][5][7]; + resize1.length(); // ERROR + resize1[1][4][5] = 2.0; + resize1.length(); // ERROR + float resize1[3][5][7]; + resize1.length(); // 3 in AST + resize1[1].length(); // 5 in AST + resize1[1][1].length(); // 7 in AST + resize1[1][1][1].length(); // ERROR + + float resize2[][5][7]; + float resize2[3][4][7]; // ERROR, inner dim change + + float resize3[][5][7]; + float resize3[3][5][9]; // ERROR, inner dim changed + + float resize4[][5][7]; + int resize4[3][5][7]; // ERROR, element type +} diff --git a/deps/glslang/Test/430scope.vert b/deps/glslang/Test/430scope.vert new file mode 100644 index 00000000..7efa1623 --- /dev/null +++ b/deps/glslang/Test/430scope.vert @@ -0,0 +1,74 @@ +#version 430 core + +int f(int a, int b, int c) +{ + int a = b; // ERROR, redefinition + + { + float a = float(a) + 1.0; // okay + } + + return a; +} + +int f(int a, int b, int c); // okay to redeclare + +bool b; +float b(int a); // ERROR: redefinition + +float c(int a); +bool c; // ERROR: redefinition + +float f; // ERROR: redefinition +float tan; // okay, hides built-in function +float sin(float x); // okay, can redefine built-in functions +float cos(float x) // okay, can redefine built-in functions +{ + return 1.0; +} +bool radians(bool x) // okay, can overload built-in functions +{ + return true; +} + +invariant gl_Position; + +void main() +{ + int g(); // okay + g(); + + float sin; // okay + sin; + sin(0.7); // ERROR, use of hidden function + f(1,2,3); + + float f; // hides f() + f = 3.0; + + gl_Position = vec4(f); + + for (int f = 0; f < 10; ++f) + ++f; + + int x = 1; + { + float x = 2.0, /* 2nd x visible here */ y = x; // y is initialized to 2 + int z = z; // ERROR: z not previously defined. + } + { + int x = x; // x is initialized to '1' + } + + struct S + { + int x; + }; + { + S S = S(0); // 'S' is only visible as a struct and constructor + S.x; // 'S' is now visible as a variable + } + + int degrees; + degrees(3.2); // ERROR, use of hidden built-in function +} diff --git a/deps/glslang/Test/435.vert b/deps/glslang/Test/435.vert new file mode 100644 index 00000000..bf27ce96 --- /dev/null +++ b/deps/glslang/Test/435.vert @@ -0,0 +1,2 @@ +#version 435 +void main() {} \ No newline at end of file diff --git a/deps/glslang/Test/440.frag b/deps/glslang/Test/440.frag new file mode 100644 index 00000000..4eb1a3ff --- /dev/null +++ b/deps/glslang/Test/440.frag @@ -0,0 +1,153 @@ +#version 440 + +// Note 'location'-only tests for enhanced layouts are in 330.frag +// Generic 'component' tests are in 440.vert + +// a consumes components 2 and 3 of location 4 +layout(location = 4, component = 2) in vec2 a; + +// b consumes component 1 of location 4 +layout(location = 4, component = 1) in float b; +layout(location = 4, component = 2) in vec2 h; // ERROR, component overlap not okay for fragment in + +layout(location = 3, component = 2) in vec3 c; // ERROR: c overflows components 2 and 3 + +// e consumes beginning (components 0, 1 and 2) of each of 6 slots +layout(location = 20, component = 0) in vec3 e[6]; + +// f consumes last component of the same 6 slots +layout(location = 20, component = 3) in float f[6]; + +layout(location = 30, component = 3) out int be; +layout(location = 30, component = 0) out vec3 bf; // ERROR, not the same basic type + +writeonly uniform; // ERROR +readonly in; // ERROR +flat out; // ERROR +mediump uniform; + +layout(offset=12) uniform; // ERROR +layout(offset=12) in; // ERROR +layout(offset=12) out; // ERROR + +layout(align=16) uniform; // ERROR +layout(align=16) in; // ERROR +layout(align=16) out; // ERROR + +layout(offset=12) uniform ubl1 { int a; } inst1; // ERROR +layout(offset=12) in inbl2 { int a; } inst2; // ERROR +layout(offset=12) out inbl3 { int a; } inst3; // ERROR + +layout(align=16, std140) uniform ubl4 { int a; } inst4; +layout(align=16) uniform ubl8 { int a; } inst8; // ERROR, no packing +layout(align=16) in inbl5 { int a; } inst5; // ERROR +layout(align=16) out inbl6 { int a; } inst6; // ERROR + +layout(offset=12) uniform vec4 v1; // ERROR +layout(offset=12) in vec4 v2; // ERROR +layout(offset=12) out vec4 v3; // ERROR + +layout(align=16) uniform vec4 v4; // ERROR +layout(align=16) in vec4 v5; // ERROR +layout(align=16) out vec4 v6; // ERROR + +layout(std140) in; // ERROR +layout(std140) uniform vec4 v7; // ERROR + +layout(align=48) uniform ubl7 { // ERROR, not power of 2 + layout(offset=12, align=4) float f; // ERROR, no packing +} inst7; + +in ibl10 { + layout(offset=12) float f; // ERROR + layout(align=4) float g; // ERROR +} inst10; + +layout(std430) uniform; + +layout(align=32) uniform ubl9 { + float e; + layout(offset=12, align=4) float f; + layout(offset=20) float g; + float h; +} inst9; + +uniform ubl11 { + layout(offset=12, align=4) float f; + float g; +} inst11; + +layout(std140) uniform block { + vec4 a; // a takes offsets 0-15 + layout(offset = 32) vec3 b; // b takes offsets 32-43 + layout(offset = 40) vec2 c; // ERROR, lies within previous member + layout(align = 6) double g; // ERROR, 6 is not a power of 2 + layout(offset=68) double h; // ERROR, offset not aligned +} specExampleErrors; + +layout(std140) uniform block2 { + vec4 a; // a takes offsets 0-15 + layout(offset = 32) vec3 b; // b takes offsets 32-43 + layout(offset = 48) vec2 d; // d takes offsets 48-55 + layout(align = 16) float e; // e takes offsets 64-67 + layout(align = 2) double f; // f takes offsets 72-79 + layout(offset = 80) float h; // h takes offsets 80-83 + layout(align = 64) dvec3 i; // i takes offsets 128-151 + layout(offset = 164, align = 8) float j; // j takes offsets 168-171 +} specExample; + +layout(std430) buffer block430 { + vec4 a; // a takes offsets 0-15 + layout(offset = 32) vec3 b; // b takes offsets 32-43 + layout(offset = 40) vec2 c; // ERROR, lies within previous member + layout(align = 6) double g; // ERROR, 6 is not a power of 2 + layout(offset=68) double h; // ERROR, offset not aligned + layout(align = 0) double i; // ERROR, 0 not a power of 2 +} specExampleErrors430; + +layout(std430) buffer block2430 { + vec4 a; // a takes offsets 0-15 + layout(offset = 32) vec3 b; // b takes offsets 32-43 + layout(offset = 48) vec2 d; // d takes offsets 48-55 + layout(align = 16) float e; // e takes offsets 64-67 + layout(align = 2) double f; // f takes offsets 72-79 + layout(offset = 80) float h; // h takes offsets 80-83 + layout(align = 64) dvec3 i; // i takes offsets 128-151 + layout(offset = 164, align = 8) float j; // j takes offsets 168-171 +} specExample430; + +layout(std430, align = 128) buffer block24300 { + vec4 a; + vec3 b; + vec2 d; + float e; + double f; + float h; + dvec3 i; +} specExample4300; + +layout(std430, align = 128) buffer block24301 { + vec4 a; + vec3 b; + vec2 d; + layout(offset=388) float e; + layout(align=8) double f; + float h; + dvec3 i; +} specExample4301; + +int aconst[gl_MaxTransformFeedbackBuffers]; +int bconst[gl_MaxTransformFeedbackInterleavedComponents]; + +sample in vec3 sampInArray[4]; + +void interp() +{ + interpolateAtCentroid(sampInArray[2].xy); + interpolateAtSample(sampInArray[2].x.x, 2); +} + +int layer() +{ + return gl_Layer; +} diff --git a/deps/glslang/Test/440.vert b/deps/glslang/Test/440.vert new file mode 100644 index 00000000..4ab6f2ee --- /dev/null +++ b/deps/glslang/Test/440.vert @@ -0,0 +1,197 @@ +#version 440 + +// Note 'location' tests for enhanced layouts are in 330.frag + +layout(location = 2, component = 2) in vec2 a; +layout(location = 2, component = 1) in float b; + +layout(location = 3, component = 2) in vec3 c; // ERROR: c overflows components 2 and 3 + +layout(location = 0, component = 3) in float d[4]; + +layout(location = 4, component = 0) in vec3 e[5]; +layout(location = 4, component = 3) in float f[5]; + +layout(location = 9, component = 4) in float g[6]; // ERROR, component too big + +layout(location = 4, component = 2) in vec2 h; // component overlap okay for vertex in + +layout(location = 3, component = 2) out vec2 i; +layout(location = 3, component = 0) out vec2 j; + +layout(location = 4, component = 2) out vec2 k; +layout(location = 4, component = 2) out vec2 m; // ERROR, component overlap + +layout(location = 2, component = 2) out vec2 n; +layout(location = 2, component = 0) out vec3 p; // ERROR, component overlap + +layout(location = 10, component = 3) out float q[6]; +layout(location = 10, component = 0) out vec3 r[6]; + +layout(location = 15, component = 3) out float s; // ERROR, overlap +layout(location = 10, component = 1) out float t; // ERROR, overlap + +layout(location = 20, component = 2) out float u; +layout(location = 20, component = 0) out float v; +layout(location = 20, component = 3) out float w; +layout(location = 20, component = 1) out vec2 x; // ERROR, overlap + +layout(location = 30, component = 3) out vec2 y; // ERROR, goes to component 4 +layout(location = 31, component = 1) out vec4 z; // ERROR, goes to component 4 + +layout(location = 32, component = 1) out mat4 ba; // ERROR +layout(location = 33, component = 1) out struct S {int a;} Ss; // ERROR +layout(location = 34, component = 1) out bn { int a;} bb; // ERROR + +layout(component = 1) out float bc; // ERROR, no location + +out blockname { + layout(location = 40, component = 2) out float u; + layout(location = 40, component = 0) out float v; + layout(location = 40, component = 3) out float w; + layout(location = 40, component = 1) out vec2 x; // ERROR, overlap + + layout(location = 41, component = 3) out vec2 y; // ERROR, goes to component 4 + layout(location = 42, component = 1) out vec4 z; // ERROR, goes to component 4 + + layout(location = 42, component = 1) out mat4 ba; // ERROR + layout(location = 43, component = 1) out S Ss; // ERROR +} bd; + +layout(location = 1, component = 1) out; // ERROR, no global setting + +layout(location = 50, component = 3) out int be; +layout(location = 50, component = 0) out vec3 bf; + +layout(location = 51, component = 1) out double dfo; // ERROR, odd component +layout(location = 52, component = 2) out dvec2 dvo; // ERROR, overflow +layout(location = 53) out double dfo2; +layout(location = 53, component = 2) out vec2 ffv2; // okay, fits +layout(location = 54) out dvec4 dvec4out; // uses up location 55 too +layout(location = 55) out float overf; // ERROR, collides with previous dvec4 +layout(location = 56, component = 1) out vec2 df2o; +layout(location = 56, component = 3) out float sf2o; +layout(location = 57, component = 2) out vec2 dv3o; +layout(location = 57, component = 3) out float sf4o; // ERROR, overlapping component +layout(location=58) out flat dvec3 dv3o2; // uses part of location 59 +layout(location=59, component=2) out flat double dfo3; // okay, fits +layout(location=59, component=0) out flat double dfo4; // ERROR, overlaps the dvec3 in starting in 58 + +out bblck1 { + vec4 bbv; +} bbinst1; + +out bblck2 { + layout(xfb_offset=64) vec4 bbv; +} bbinst2; + +layout(xfb_buffer = 3, xfb_stride = 64) out; // default buffer is 3 + +out bblck3 { + layout(xfb_offset=16) vec4 bbv; // in xfb_buffer 3 +} bbinst3; + +uniform ubblck3 { + layout(xfb_offset=16) vec4 bbv; // ERROR, not in a uniform +} ubbinst3; + +layout(xfb_buffer=2, xfb_offset=48, xfb_stride=80) out vec4 bg; +layout( xfb_offset=32, xfb_stride=64) out vec4 bh; + +layout(xfb_offset=48) out; // ERROR + +layout(xfb_stride=80, xfb_buffer=2, xfb_offset=16) out bblck4 { + vec4 bbv1; + vec4 bbv2; +} bbinst4; + +out bblck5 { + layout(xfb_offset=0) vec4 bbv1; + layout(xfb_stride=64, xfb_buffer=3, xfb_offset=48) vec4 bbv2; + layout(xfb_buffer=2) vec4 bbv3; // ERROR, wrong buffer +} bbinst5; + +out layout(xfb_buffer=2) bblck6 { + layout(xfb_offset=0) vec4 bbv1; + layout(xfb_stride=64, xfb_buffer=3, xfb_offset=32) vec4 bbv2; // ERROR, overlap 32 from bh, and buffer contradiction + layout(xfb_buffer=2, xfb_offset=0) vec4 bbv3; // ERROR, overlap 0 from bbinst5 + layout(xfb_buffer=2) vec4 bbv5; + layout(xfb_offset=24) float bbf6; // ERROR, overlap 24 from bbv1 in bbinst4 +} bbinst6; + +layout(xfb_stride=48) out; // ERROR, stride of buffer 3 + +layout(xfb_buffer=1) out; // default buffer is 1 +layout(xfb_offset=4) out float bj; +layout(xfb_offset=0) out ivec2 bk; // ERROR, overlap 4 + +layout(xfb_buffer=3, xfb_stride=48) out; // ERROR, stride of buffer 3 (default is now 3) +layout(xfb_stride=48) out float bl; // ERROR, stride of buffer 3 + +layout(xfb_stride=48) out bblck7 { // ERROR, stride of buffer 3 + layout(xfb_stride=64) vec4 bbv1; + layout(xfb_stride=32) vec4 bbv2; // ERROR, stride of buffer 3 +} bbinst7; + +struct S5 { + int i; // 4 bytes plus 4 byte hole + double d; // 8 bytes + float f; // 4 bytes +}; // total size = 20 + +struct T { + bool b; // 4 plus 4 byte hole + S5 s; // 20 + vec2 v2; // 8 +}; // total size = 36 + +out layout(xfb_buffer=0, xfb_offset=0, xfb_stride=92) bblck8 { // ERROR, stride not multiple of 8 + bool b; // offset 0 + T t; // offset 8, size 40 + int i; // offset 40 + 4 = 48 + mat3x3 m3; // offset 52 + float f; // offset 52 + 9*4 = 88 + float g; // ERROR, overflow stride +} bbinst8; + +out layout(xfb_buffer=4) bblck9 { + layout(xfb_offset=1) bool b; // ERROR + layout(xfb_offset=12) T t; // ERROR + layout(xfb_offset=52) mat3x3 m3; // non-multiple of 8 okay + layout(xfb_offset=90) int i; // ERROR + layout(xfb_offset=98) double d; // ERROR + layout(xfb_offset=108) S s; // non-multiple of 8 okay +} bbinst9; + +layout(xfb_buffer=5, xfb_stride=6) out; // link ERROR, stride not multiple of 4 +layout(xfb_offset=0) out float bm; + +layout(xfb_buffer=6, xfb_stride=2000) out; // ERROR, stride too big + +out layout(xfb_buffer=7, xfb_offset=0) bblck10 { // link ERROR, implicit stride too big + dmat4x4 m1; + dmat4x4 m2; + float f; +} bbinst10; + +layout(xfb_buffer = 3) out; +layout(xfb_offset = 32) out gl_PerVertex { + layout(xfb_buffer = 2) float gl_PointSize; // ERROR, change in xfb_buffer + vec4 gl_Position; +}; + +int drawParamsBad() +{ + return gl_BaseVertexARB + gl_BaseInstanceARB + gl_DrawIDARB; // ERROR, extension not requested +} + +#extension GL_ARB_shader_draw_parameters: enable + +int drawParams() +{ + return gl_BaseVertexARB + gl_BaseInstanceARB + gl_DrawIDARB; + gl_BaseVertexARB = 3; // ERROR, can't write to shader 'in' + gl_BaseInstanceARB = 3; // ERROR, can't write to shader 'in' + gl_DrawIDARB = 3; // ERROR, can't write to shader 'in' + glBaseInstanceARB; // ERROR, not defined +} diff --git a/deps/glslang/Test/450.comp b/deps/glslang/Test/450.comp new file mode 100644 index 00000000..fb2b56a7 --- /dev/null +++ b/deps/glslang/Test/450.comp @@ -0,0 +1,6 @@ +#version 450 core +layout(local_size_x = 0) in; // ERROR, 0 not allowed +void main() +{ + shared float f; // ERROR shared must be global +} diff --git a/deps/glslang/Test/450.frag b/deps/glslang/Test/450.frag new file mode 100644 index 00000000..076d0b3a --- /dev/null +++ b/deps/glslang/Test/450.frag @@ -0,0 +1,68 @@ +#version 450 core + +in float in1; +in vec2 in2; +in vec3 in3; +in vec4 in4; + +void main() +{ + vec2 v2 = dFdxFine(in2); + vec3 v3 = dFdyCoarse(in3); + vec4 v4 = fwidth(in4); + v4 = dFdyFine(in4); + v3 = dFdyFine(in3); + float f = dFdx(in1) + dFdxFine(in1) + dFdxCoarse(in1); + v4 = fwidthCoarse(in4) + fwidthFine(in4); + + float cull = gl_CullDistance[2]; + float consts = gl_MaxCullDistances + gl_MaxCombinedClipAndCullDistances + gl_MaxSamples; + + if (gl_HelperInvocation) + ++v4; + + int sum = gl_MaxVertexImageUniforms + + gl_MaxFragmentImageUniforms + + gl_MaxComputeImageUniforms + + gl_MaxCombinedImageUniforms + + gl_MaxCombinedShaderOutputResources; + + bool b1, b3, b; + uint uin; + bvec2 b2 = mix(bvec2(b1), bvec2(b3), bvec2(b)); + uint um = mix(uin, uin, b); + ivec3 im3 = mix(ivec3(uin), ivec3(uin), bvec3(b)); +} + +uniform sampler2DMS s2dms; +uniform usampler2DMSArray us2dmsa; +layout(rgba32i) uniform iimage2DMS ii2dms; +layout(rgba32f) uniform image2DMSArray i2dmsa; + +void foo() +{ + int s = textureSamples(s2dms); + s += textureSamples(us2dmsa); + s += imageSamples(ii2dms); + s += imageSamples(i2dmsa); + float f = imageAtomicExchange(i2dmsa, ivec3(in3), 2, 4.5); +} + +in float gl_CullDistance[6]; + +float cull(int i) +{ + return (i >= 6) ? gl_CullDistance[5] : gl_CullDistance[i]; +} + +layout(location = 6) in bName1 { + float f; + layout(location = 7) float g; + mat4 m; +} bInst1; +layout(location = 12) in bName2 { + float f; + layout(location = 13) float g; // ERROR, location on array +} bInst2[3]; + +layout(early_fragment_tests) in float f; // ERROR, must be standalone diff --git a/deps/glslang/Test/450.geom b/deps/glslang/Test/450.geom new file mode 100644 index 00000000..45cbecba --- /dev/null +++ b/deps/glslang/Test/450.geom @@ -0,0 +1,19 @@ +#version 450 core + +in gl_PerVertex { + float gl_CullDistance[3]; +} gl_in[]; + +out gl_PerVertex { + float gl_CullDistance[3]; +}; + +layout(triangles) in; + +void main() +{ + gl_in[3].gl_Position; // ERROR, out of range + gl_CullDistance[2] = gl_in[1].gl_CullDistance[2]; +} + +layout(points) in float f[3]; // ERROR, must be standalone diff --git a/deps/glslang/Test/450.tesc b/deps/glslang/Test/450.tesc new file mode 100644 index 00000000..bf5c0837 --- /dev/null +++ b/deps/glslang/Test/450.tesc @@ -0,0 +1,23 @@ +#version 450 core + +in gl_PerVertex { + float gl_CullDistance[3]; +} gl_in[gl_MaxPatchVertices]; + +out gl_PerVertex { + float gl_CullDistance[3]; +} gl_out[4]; + +void main() +{ + gl_out[gl_InvocationID].gl_CullDistance[2] = gl_in[1].gl_CullDistance[2]; +} + +layout(location = 4) out bName1 { + float f; + layout(location = 5) float g; +} bInst1[2]; +layout(location = 6) out bName2 { + float f; + layout(location = 7) float g; // ERROR, location on array +} bInst2[2][3]; diff --git a/deps/glslang/Test/450.tese b/deps/glslang/Test/450.tese new file mode 100644 index 00000000..8cdeb207 --- /dev/null +++ b/deps/glslang/Test/450.tese @@ -0,0 +1,21 @@ +#version 450 core + +in gl_PerVertex { + float gl_CullDistance[3]; +} gl_in[gl_MaxPatchVertices]; + +out gl_PerVertex { + float gl_CullDistance[3]; +}; + +void main() +{ + gl_CullDistance[2] = gl_in[1].gl_CullDistance[2]; +} + +layout(equal_spacing) in float f1[]; // ERROR, must be standalone +layout(fractional_even_spacing) in float f2[]; // ERROR, must be standalone +layout(fractional_odd_spacing) in float f3[]; // ERROR, must be standalone +layout(cw) in float f4[]; // ERROR, must be standalone +layout(ccw) in float f5[]; // ERROR, must be standalone +layout(point_mode) in float f6[]; // ERROR, must be standalone diff --git a/deps/glslang/Test/450.vert b/deps/glslang/Test/450.vert new file mode 100644 index 00000000..e99a133c --- /dev/null +++ b/deps/glslang/Test/450.vert @@ -0,0 +1,56 @@ +#version 450 core + +out gl_PerVertex { + float gl_CullDistance[3]; +}; + +void main() +{ + gl_CullDistance[2] = 4.5; +} + +out bool outb; // ERROR +out sampler2D outo; // ERROR +out float outa[4]; +out float outaa[4][2]; +struct S { float f; }; +out S outs; +out S[4] outasa; +out S outsa[4]; +struct SA { float f[4]; }; +out SA outSA; +struct SS { float f; S s; }; +out SS outSS; + +layout(binding = 0) uniform atomic_uint aui; +uint ui; + +void foo() +{ + SS::f; + atomicCounterAdd(aui, ui); // ERROR, need 4.6 + atomicCounterSubtract(aui, ui); // ERROR, need 4.6 + atomicCounterMin(aui, ui); // ERROR, need 4.6 + atomicCounterMax(aui, ui); // ERROR, need 4.6 + atomicCounterAnd(aui, ui); // ERROR, need 4.6 + atomicCounterOr(aui, ui); // ERROR, need 4.6 + atomicCounterXor(aui, ui); // ERROR, need 4.6 + atomicCounterExchange(aui, ui); // ERROR, need 4.6 + atomicCounterCompSwap(aui, ui, ui); // ERROR, need 4.6 + + int a = gl_BaseVertex + gl_BaseInstance + gl_DrawID; // ERROR, need 4.6 + + bool b1; + anyInvocation(b1); // ERROR, need 4.6 + allInvocations(b1); // ERROR, need 4.6 + allInvocationsEqual(b1); // ERROR, need 4.6 +} +; // ERROR: no extraneous semicolons + +layout(location = 0) uniform locBlock { // ERROR, no location uniform block + int a; +}; + +layout(location = 0) buffer locBuffBlock { // ERROR, no location on buffer block + int b; +}; diff --git a/deps/glslang/Test/460.frag b/deps/glslang/Test/460.frag new file mode 100644 index 00000000..23f8eea6 --- /dev/null +++ b/deps/glslang/Test/460.frag @@ -0,0 +1,32 @@ +#version 460 core + +struct S { + float f; + vec4 v; +}; + +in S s; + +void main() +{ + interpolateAtCentroid(s.v); + bool b1; + b1 = anyInvocation(b1); + b1 = allInvocations(b1); + b1 = allInvocationsEqual(b1); +} + +void attExtBad() +{ + // ERRORs, not enabled + [[dependency_length(1+3)]] for (int i = 0; i < 8; ++i) { } + [[flatten]] if (true) { } else { } +} + +#extension GL_EXT_control_flow_attributes : enable + +void attExt() +{ + [[dependency_length(-3)]] do { } while(true); // ERROR, not positive + [[dependency_length(0)]] do { } while(true); // ERROR, not positive +} diff --git a/deps/glslang/Test/460.vert b/deps/glslang/Test/460.vert new file mode 100644 index 00000000..fd87d8b1 --- /dev/null +++ b/deps/glslang/Test/460.vert @@ -0,0 +1,15 @@ +#version 460 core + +int i; +; // extraneous semicolon okay +float f;;; + +void main() +{ + bool b1; + b1 = anyInvocation(b1); + b1 = allInvocations(b1); + b1 = allInvocationsEqual(b1); +} +; +; diff --git a/deps/glslang/Test/Operations.frag b/deps/glslang/Test/Operations.frag new file mode 100644 index 00000000..ca06a752 --- /dev/null +++ b/deps/glslang/Test/Operations.frag @@ -0,0 +1,166 @@ +#version 130 + +uniform ivec4 uiv4; +uniform vec4 uv4; +uniform bool ub; +uniform bvec4 ub41, ub42; +uniform float uf; +uniform int ui; + + +uniform uvec4 uuv4; +uniform uint uui; + + +void main() +{ + vec4 v; + float f; + bool b; + bvec4 bv4; + int i; + + uint u; + + + // floating point + v = radians(uv4); + v += degrees(v); + v += (i = ui*ui, sin(v)); + v += cos(v); + v += tan(v); + v += asin(v); + v += acos(v); + + v += atan(v); + v += sinh(v); + v += cosh(v); + v += tanh(v); + v += asinh(v); + v += acosh(v); + v += atanh(v); + + v += pow(v, v); + v += exp(v); + v += log(v); + v += exp2(v); + v += log2(v); + v += sqrt(v); + v += inversesqrt(v); + v += abs(v); + v += sign(v); + v += floor(v); + + + v += trunc(v); + v += round(v); + v += roundEven(v); + + + v += ceil(v); + v += fract(v); + v += mod(v, v); + v += mod(v, v.x); + + + v += modf(v, v); + + + v += min(v, uv4); + v += max(v, uv4); + v += clamp(v, uv4, uv4); + v += mix(v,v,v); + + + v += mix(v,v,bv4); + v += intBitsToFloat(ivec4(i)); + v += uintBitsToFloat(uv4); + v += fma(v,v,v); + v += frexp(v); + v += ldexp(v); + v += unpackUnorm2x16(v); + v += unpackUnorm4x8(v); + v += unpackSnorm4x8(v); + + + v += step(v,v); + v += smoothstep(v,v,v); + v += step(uf,v); + v += smoothstep(uf,uf,v); + v += normalize(v); + v += faceforward(v, v, v); + v += reflect(v, v); + v += refract(v, v, uf); + v += dFdx(v); + v += dFdy(v); + v += fwidth(v); + //noise*(v); + + + // signed integer + i += abs(ui); + i += sign(i); + i += min(i, ui); + i += max(i, ui); + i += clamp(i, ui, ui); + + floatsBitsToInt(v); + packUnorm2x16(v); + packUnorm4x8(v); + packSnorm4x8(v); + + // unsigned integer + u = abs(uui); + u += sign(u); + u += min(u, uui); + u += max(u, uui); + u += clamp(u, uui, uui); + u += floatsBitToInt(v); + u += packUnorm2x16(v); + u += packUnorm4x8(v); + i += uui & i; // ERRORs, no int/uint conversions before 400 + i += uui ^ i; + i += i | uui; + + // bool + + b = isnan(uf); + b = isinf(v.y); + + b = any(lessThan(v, uv4)); + b = (b && any(lessThanEqual(v, uv4))); + b = (b && any(greaterThan(v, uv4))); + b = (b && any(greaterThanEqual(v, uv4))); + b = (b && any(equal(ub41, ub42))); + b = (b && any(notEqual(ub41, ub42))); + b = (b && any(ub41)); + b = (b && all(ub41)); + b = (b && any(not(ub41))); + + i = ((i + ui) * i - ui) / i; + i = i % ui; + if (i == ui || i != ui && i == ui ^^ i != 2) + ++i; + + f = ((uf + uf) * uf - uf) / uf; + + f += length(v); + f += distance(v, v); + f += dot(v, v); + f += dot(f, uf); + f += cross(v.xyz, v.xyz).x; + + if (f == uf || f != uf && f != 2.0) + ++f; + + i &= ui; + i |= 0x42; + i ^= ui; + i %= 17; + i >>= 2; + i <<= ui; + i = ~i; + b = !b; + + gl_FragColor = b ? vec4(i) + vec4(f) + v : v; +} diff --git a/deps/glslang/Test/aggOps.frag b/deps/glslang/Test/aggOps.frag new file mode 100644 index 00000000..a0450dca --- /dev/null +++ b/deps/glslang/Test/aggOps.frag @@ -0,0 +1,51 @@ +#version 130 + +uniform sampler2D sampler; +varying mediump vec2 coord; + +varying vec4 u, w; + +struct s1 { + int i; + float f; +}; + +struct s2 { + int i; + float f; + s1 s1_1; +}; + +uniform s1 foo1; +uniform s2 foo2a; +uniform s2 foo2b; + +void main() +{ + vec4 v; + s1 a[3], b[3]; + a = s1[3](s1(int(u.x), u.y), s1(int(u.z), u.w), s1(14, 14.0)); + b = s1[3](s1(17, 17.0), s1(int(w.x), w.y), s1(int(w.z), w.w)); + + if (foo2a == foo2b) + v = texture2D(sampler, coord); + else + v = texture2D(sampler, 2.0*coord); + + if (u == v) + v *= 3.0; + + if (u != v) + v *= 4.0; + + if (coord == v.yw) + v *= 5.0; + + if (a == b) + v *= 6.0; + + if (a != b) + v *= 7.0; + + gl_FragColor = v; +} diff --git a/deps/glslang/Test/always-discard.frag b/deps/glslang/Test/always-discard.frag new file mode 100644 index 00000000..cea4ceec --- /dev/null +++ b/deps/glslang/Test/always-discard.frag @@ -0,0 +1,36 @@ +#version 110 +varying vec2 tex_coord; + +void main (void) +{ + vec4 white = vec4(1.0); + vec4 black = vec4(0.2); + vec4 color = white; + + // First, cut out our circle + float x = tex_coord.x*2.0 - 1.0; + float y = tex_coord.y*2.0 - 1.0; + + float radius = sqrt(x*x + y*y); + if (radius > 1.0) { + if (radius > 1.1) { + ++color; + } + + gl_FragColor = color; + + if (radius > 1.2) { + ++color; + } + + } + + discard; + + // If we're near an edge, darken us a tiny bit + if (radius >= 0.75) + color -= abs(pow(radius, 16.0)/2.0); + + gl_FragColor = color; + +} diff --git a/deps/glslang/Test/always-discard2.frag b/deps/glslang/Test/always-discard2.frag new file mode 100644 index 00000000..a619369d --- /dev/null +++ b/deps/glslang/Test/always-discard2.frag @@ -0,0 +1,19 @@ +#version 110 +varying vec2 tex_coord; + +void main (void) +{ + vec4 white = vec4(1.0); + vec4 black = vec4(0.2); + vec4 color = white; + + // First, cut out our circle + float x = tex_coord.x*2.0 - 1.0; + float y = tex_coord.y*2.0 - 1.0; + + discard; + + + gl_FragColor = color; + +} diff --git a/deps/glslang/Test/array.frag b/deps/glslang/Test/array.frag new file mode 100644 index 00000000..a7b96a44 --- /dev/null +++ b/deps/glslang/Test/array.frag @@ -0,0 +1,113 @@ +#version 130 + +float gu[]; +float g4[4]; +float g5[5]; + +uniform int a; + +float[4] foo(float a[5]) +{ + return float[](a[0], a[1], a[2], a[3]); +} + +void bar(float[5]) {} + +void main() +{ + { + float gu[2]; // okay, new scope + + gu[2] = 4.0; // ERROR, overflow + } + + gu[2] = 4.0; // okay + + gu[3] = 3.0; + gu[a] = 5.0; // ERROR + + g4 = foo(g5); + g5 = g4; // ERROR + gu = g4; // ERROR + + foo(gu); // ERROR + bar(g5); + + if (float[4](1.0, 2.0, 3.0, 4.0) == g4) + gu[0] = 2.0; + + float u[]; + u[2] = 3.0; // okay + float u[5]; + u[5] = 5.0; // ERROR + foo(u); // okay + + gl_FragData[1000] = vec4(1.0); // ERROR + gl_FragData[-1] = vec4(1.0); // ERROR + gl_FragData[3] = vec4(1.0); + + const int ca[] = int[](3, 2); + int sum = ca[0]; + sum += ca[1]; + sum += ca[2]; // ERROR + + const int ca3[3] = int[](3, 2); // ERROR + int ica[] = int[](3, 2); + int ica3[3] = int[](3, 2); // ERROR + ica[3.1] = 3; // ERROR + ica[u[1]] = 4; // ERROR +} + +int[] foo213234(); // ERROR +int foo234234(float[]); // ERROR +int foo234235(vec2[] v); // ERROR + +vec3 guns[]; +float f = guns[7]; + +void foo() +{ + int uns[]; + uns[3] = 40; + uns[1] = 30; + guns[2] = vec3(2.4); + + float unsf[]; + bar(unsf); // ERROR +} + +float[] foo2() // ERROR +{ + float f[]; + return f; + float g[9]; + return g; // ERROR +} + +float gUnusedUnsized[]; + +void foo3() +{ + float resize1[]; + resize1[2] = 4.0; + resize1.length(); // ERROR + float resize1[3]; + resize1.length(); + + float resize2[]; + resize2[5] = 4.0; + float resize2[5]; // should be ERROR, but is not + resize2.length(); + resize2[5] = 4.0; // ERROR +} + +int[] i = int[](); // ERROR, need constructor arguments +float emptyA[]; +float b = vec4(emptyA); // ERROR, array can't be a constructor argument +uniform sampler2D s2d[]; + +void foo4() +{ + s2d[a]; // ERROR, can't variably index unsized array + float local[] = gUnusedUnsized; // ERROR, can initialize with runtime-sized array +} diff --git a/deps/glslang/Test/array100.frag b/deps/glslang/Test/array100.frag new file mode 100644 index 00000000..b77aedf6 --- /dev/null +++ b/deps/glslang/Test/array100.frag @@ -0,0 +1,70 @@ +#version 100 + +float gu[]; // ERROR +float g4[4]; +float g5[5]; + +uniform int a; + +float[4] foo(float[5] a) // ERROR // ERROR +{ + return float[](a[0], a[1], a[2], a[3]); // ERROR +} + +void bar(float[5]) {} + +void main() +{ + { + float gu[2]; // okay, new scope + + gu[2] = 4.0; // ERROR, overflow + } + + g4 = foo(g5); // ERROR + g5 = g4; // ERROR + gu = g4; // ERROR + + foo(gu); // ERROR + bar(g5); + + if (float[4](1.0, 2.0, 3.0, 4.0) == g4) // ERROR + gu[0] = 2.0; + + float u[5]; + u[5] = 5.0; // ERROR + foo(u); // okay + + gl_FragData[1000] = vec4(1.0); // ERROR + gl_FragData[-1] = vec4(1.0); // ERROR + gl_FragData[3] = vec4(1.0); +} + +struct SA { + vec3 v3; + vec2 v2[4]; +}; + +struct SB { + vec4 v4; + SA sa; +}; + +SB bar9() +{ + SB s; + return s; // ERROR +} + +void bar10(SB s) // okay +{ +} + +void bar11() +{ + SB s1, s2; + s1 = s2; // ERROR + bar10(s1); + s2 = bar9(); // ERROR + SB initSb = s1; // ERROR +} diff --git a/deps/glslang/Test/atomic_uint.frag b/deps/glslang/Test/atomic_uint.frag new file mode 100644 index 00000000..9a95a48a --- /dev/null +++ b/deps/glslang/Test/atomic_uint.frag @@ -0,0 +1,48 @@ +#version 420 core + +layout(binding = 0) uniform atomic_uint counter; + +uint func(atomic_uint c) +{ + return atomicCounterIncrement(c); +} + +uint func2(out atomic_uint c) // ERROR +{ + return counter; // ERROR, type mismatch + return atomicCounter(counter); +} + +void main() +{ + atomic_uint non_uniform_counter; // ERROR + uint val = atomicCounter(counter); + atomicCounterDecrement(counter); +} + +layout(binding = 1, offset = 3) uniform atomic_uint countArr[4]; +uniform int i; + +void opac() +{ + counter + counter; // ERROR + -counter; // ERROR + int a[3]; + a[counter]; // ERROR + countArr[2]; + countArr[i]; + counter = 4; // ERROR +} + +in atomic_uint acin; // ERROR +atomic_uint acg; // ERROR +uniform atomic_uint; +uniform atomic_uint aNoBind; // ERROR, no binding +layout(binding=0, offset=32) uniform atomic_uint aOffset; +layout(binding=0, offset=4) uniform atomic_uint; +layout(binding=0) uniform atomic_uint bar3; // offset is 4 +layout(binding=0) uniform atomic_uint ac[3]; // offset = 8 +layout(binding=0) uniform atomic_uint ad; // offset = 20 +layout(offset=8) uniform atomic_uint bar4; // ERROR, no binding +layout(binding = 0, offset = 12) uniform atomic_uint overlap; // ERROR, overlapping offsets +layout(binding = 20) uniform atomic_uint bigBind; // ERROR, binding too big diff --git a/deps/glslang/Test/badChars.frag b/deps/glslang/Test/badChars.frag new file mode 100644 index 00000000..3e9700d9 --- /dev/null +++ b/deps/glslang/Test/badChars.frag @@ -0,0 +1,7 @@ +#ifþ +#endif +#error AÿB +#if +#endif +int aÿ +#define A "ÿ \ No newline at end of file diff --git a/deps/glslang/Test/badMacroArgs.frag b/deps/glslang/Test/badMacroArgs.frag new file mode 100644 index 00000000..7d7de870 --- /dev/null +++ b/deps/glslang/Test/badMacroArgs.frag @@ -0,0 +1,4 @@ +#version 400 + +#define m(a) a +m() \ No newline at end of file diff --git a/deps/glslang/Test/bar.h b/deps/glslang/Test/bar.h new file mode 100644 index 00000000..c206a325 --- /dev/null +++ b/deps/glslang/Test/bar.h @@ -0,0 +1 @@ +float4 i1; diff --git a/deps/glslang/Test/baseLegalResults/hlsl.aliasOpaque.frag.out b/deps/glslang/Test/baseLegalResults/hlsl.aliasOpaque.frag.out new file mode 100644 index 00000000..e65ee7ba --- /dev/null +++ b/deps/glslang/Test/baseLegalResults/hlsl.aliasOpaque.frag.out @@ -0,0 +1,46 @@ +hlsl.aliasOpaque.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 87 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 62 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 47 "gss" + Name 51 "gtex" + Name 62 "@entryPointOutput" + Decorate 47(gss) DescriptorSet 0 + Decorate 51(gtex) DescriptorSet 0 + Decorate 62(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeSampler + 7: TypeFloat 32 + 8: TypeImage 7(float) 2D sampled format:Unknown + 11: TypeVector 7(float) 4 + 32: TypeSampledImage 8 + 34: TypeVector 7(float) 2 + 35: 7(float) Constant 1045220557 + 36: 7(float) Constant 1050253722 + 37: 34(fvec2) ConstantComposite 35 36 + 43: TypePointer UniformConstant 6 + 47(gss): 43(ptr) Variable UniformConstant + 50: TypePointer UniformConstant 8 + 51(gtex): 50(ptr) Variable UniformConstant + 54: 7(float) Constant 1077936128 + 61: TypePointer Output 11(fvec4) +62(@entryPointOutput): 61(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 70: 6 Load 47(gss) + 72: 8 Load 51(gtex) + 84: 32 SampledImage 72 70 + 85: 11(fvec4) ImageSampleImplicitLod 84 37 + 86: 11(fvec4) VectorTimesScalar 85 54 + Store 62(@entryPointOutput) 86 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseLegalResults/hlsl.flattenOpaque.frag.out b/deps/glslang/Test/baseLegalResults/hlsl.flattenOpaque.frag.out new file mode 100644 index 00000000..cf3fbabc --- /dev/null +++ b/deps/glslang/Test/baseLegalResults/hlsl.flattenOpaque.frag.out @@ -0,0 +1,65 @@ +hlsl.flattenOpaque.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 185 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 120 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 38 "tex" + Name 82 "s.s2D" + Name 97 "s2.s2D" + Name 100 "s2.tex" + Name 120 "@entryPointOutput" + Decorate 38(tex) DescriptorSet 0 + Decorate 82(s.s2D) DescriptorSet 0 + Decorate 97(s2.s2D) DescriptorSet 0 + Decorate 100(s2.tex) DescriptorSet 0 + Decorate 120(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeSampler + 9: TypeFloat 32 + 10: TypeVector 9(float) 4 + 15: TypeVector 9(float) 2 + 22: TypeImage 9(float) 2D sampled format:Unknown + 37: TypePointer UniformConstant 22 + 38(tex): 37(ptr) Variable UniformConstant + 45: TypeSampledImage 22 + 47: 9(float) Constant 1045220557 + 48: 9(float) Constant 1050253722 + 49: 15(fvec2) ConstantComposite 47 48 + 81: TypePointer UniformConstant 6 + 82(s.s2D): 81(ptr) Variable UniformConstant + 97(s2.s2D): 81(ptr) Variable UniformConstant + 100(s2.tex): 37(ptr) Variable UniformConstant + 119: TypePointer Output 10(fvec4) +120(@entryPointOutput): 119(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 134: 6 Load 82(s.s2D) + 158: 22 Load 38(tex) + 161: 45 SampledImage 158 134 + 162: 10(fvec4) ImageSampleImplicitLod 161 49 + 138: 6 Load 82(s.s2D) + 164: 22 Load 38(tex) + 167: 45 SampledImage 164 138 + 169: 10(fvec4) ImageSampleImplicitLod 167 49 + 142: 10(fvec4) FAdd 162 169 + 143: 6 Load 97(s2.s2D) + 145: 22 Load 100(s2.tex) + 175: 45 SampledImage 145 143 + 176: 10(fvec4) ImageSampleImplicitLod 175 49 + 149: 10(fvec4) FAdd 142 176 + 150: 6 Load 97(s2.s2D) + 152: 22 Load 100(s2.tex) + 182: 45 SampledImage 152 150 + 184: 10(fvec4) ImageSampleImplicitLod 182 49 + 156: 10(fvec4) FAdd 149 184 + Store 120(@entryPointOutput) 156 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out b/deps/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out new file mode 100644 index 00000000..bec5aa22 --- /dev/null +++ b/deps/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out @@ -0,0 +1,52 @@ +hlsl.flattenOpaqueInit.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 134 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 80 + Source HLSL 500 + Name 4 "main" + Name 43 "g_tInputTexture_sampler" + Name 47 "g_tInputTexture" + Name 80 "@entryPointOutput" + Decorate 43(g_tInputTexture_sampler) DescriptorSet 0 + Decorate 47(g_tInputTexture) DescriptorSet 0 + Decorate 80(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeSampler + 7: TypeFloat 32 + 8: TypeImage 7(float) 2D sampled format:Unknown + 11: TypeVector 7(float) 4 + 31: TypeSampledImage 8 + 33: TypeVector 7(float) 2 + 34: 7(float) Constant 1050253722 + 35: 7(float) Constant 1053609165 + 36: 33(fvec2) ConstantComposite 34 35 + 37: 7(float) Constant 0 + 42: TypePointer UniformConstant 6 +43(g_tInputTexture_sampler): 42(ptr) Variable UniformConstant + 46: TypePointer UniformConstant 8 +47(g_tInputTexture): 46(ptr) Variable UniformConstant + 79: TypePointer Output 11(fvec4) +80(@entryPointOutput): 79(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 90: 6 Load 43(g_tInputTexture_sampler) + 91: 8 Load 47(g_tInputTexture) + 111: 31 SampledImage 91 90 + 112: 11(fvec4) ImageSampleExplicitLod 111 36 Lod 37 + 115: 6 Load 43(g_tInputTexture_sampler) + 117: 8 Load 47(g_tInputTexture) + 125: 31 SampledImage 117 115 + 126: 11(fvec4) ImageSampleExplicitLod 125 36 Lod 37 + 99: 11(fvec4) FAdd 112 126 + 132: 31 SampledImage 91 90 + 133: 11(fvec4) ImageSampleExplicitLod 132 36 Lod 37 + 104: 11(fvec4) FAdd 99 133 + Store 80(@entryPointOutput) 104 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out b/deps/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out new file mode 100644 index 00000000..14d0cd3f --- /dev/null +++ b/deps/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out @@ -0,0 +1,43 @@ +hlsl.flattenOpaqueInitMix.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 97 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 57 + Source HLSL 500 + Name 4 "main" + Name 44 "g_tInputTexture_sampler" + Name 47 "g_tInputTexture" + Name 57 "@entryPointOutput" + Decorate 44(g_tInputTexture_sampler) DescriptorSet 0 + Decorate 47(g_tInputTexture) DescriptorSet 0 + Decorate 57(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeSampler + 7: TypeFloat 32 + 8: TypeImage 7(float) 2D sampled format:Unknown + 11: TypeVector 7(float) 4 + 28: TypeSampledImage 8 + 36: TypeVector 7(float) 2 + 38: 7(float) Constant 0 + 43: TypePointer UniformConstant 6 +44(g_tInputTexture_sampler): 43(ptr) Variable UniformConstant + 46: TypePointer UniformConstant 8 +47(g_tInputTexture): 46(ptr) Variable UniformConstant + 49: 7(float) Constant 1056964608 + 56: TypePointer Output 11(fvec4) +57(@entryPointOutput): 56(ptr) Variable Output + 96: 36(fvec2) ConstantComposite 49 49 + 4(main): 2 Function None 3 + 5: Label + 63: 6 Load 44(g_tInputTexture_sampler) + 64: 8 Load 47(g_tInputTexture) + 73: 28 SampledImage 64 63 + 79: 11(fvec4) ImageSampleExplicitLod 73 96 Lod 38 + Store 57(@entryPointOutput) 79 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseLegalResults/hlsl.flattenSubset.frag.out b/deps/glslang/Test/baseLegalResults/hlsl.flattenSubset.frag.out new file mode 100644 index 00000000..143c96c5 --- /dev/null +++ b/deps/glslang/Test/baseLegalResults/hlsl.flattenSubset.frag.out @@ -0,0 +1,47 @@ +hlsl.flattenSubset.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 66 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 47 50 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 21 "samp" + Name 33 "tex" + Name 47 "vpos" + Name 50 "@entryPointOutput" + Decorate 21(samp) DescriptorSet 0 + Decorate 33(tex) DescriptorSet 0 + Decorate 47(vpos) Location 0 + Decorate 50(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 13: TypeSampler + 20: TypePointer UniformConstant 13 + 21(samp): 20(ptr) Variable UniformConstant + 31: TypeImage 6(float) 2D sampled format:Unknown + 32: TypePointer UniformConstant 31 + 33(tex): 32(ptr) Variable UniformConstant + 37: TypeSampledImage 31 + 39: TypeVector 6(float) 2 + 40: 6(float) Constant 1056964608 + 41: 39(fvec2) ConstantComposite 40 40 + 46: TypePointer Input 7(fvec4) + 47(vpos): 46(ptr) Variable Input + 49: TypePointer Output 7(fvec4) +50(@entryPointOutput): 49(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 57: 13 Load 21(samp) + 61: 31 Load 33(tex) + 64: 37 SampledImage 61 57 + 65: 7(fvec4) ImageSampleImplicitLod 64 41 + Store 50(@entryPointOutput) 65 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseLegalResults/hlsl.flattenSubset2.frag.out b/deps/glslang/Test/baseLegalResults/hlsl.flattenSubset2.frag.out new file mode 100644 index 00000000..0d7ab560 --- /dev/null +++ b/deps/glslang/Test/baseLegalResults/hlsl.flattenSubset2.frag.out @@ -0,0 +1,31 @@ +hlsl.flattenSubset2.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 53 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 49 52 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 49 "vpos" + Name 52 "@entryPointOutput" + Decorate 49(vpos) Location 0 + Decorate 52(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 43: 6(float) Constant 0 + 44: 7(fvec4) ConstantComposite 43 43 43 43 + 48: TypePointer Input 7(fvec4) + 49(vpos): 48(ptr) Variable Input + 51: TypePointer Output 7(fvec4) +52(@entryPointOutput): 51(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + Store 52(@entryPointOutput) 44 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out b/deps/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out new file mode 100644 index 00000000..27482b34 --- /dev/null +++ b/deps/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out @@ -0,0 +1,81 @@ +hlsl.partialFlattenLocal.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 158 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 83 86 + Source HLSL 500 + Name 4 "main" + Name 83 "pos" + Name 86 "@entryPointOutput" + Decorate 83(pos) Location 0 + Decorate 86(@entryPointOutput) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 14: TypeVector 6(float) 3 + 15: TypeInt 32 0 + 16: 15(int) Constant 3 + 17: TypeArray 14(fvec3) 16 + 18: TypeVector 6(float) 2 + 19: 15(int) Constant 2 + 20: TypeArray 18(fvec2) 19 + 21: TypeInt 32 1 + 25: 21(int) Constant 0 + 31: 21(int) Constant 1 + 32: 6(float) Constant 0 + 33: 14(fvec3) ConstantComposite 32 32 32 + 34: TypePointer Function 14(fvec3) + 37: 6(float) Constant 1065353216 + 38: 18(fvec2) ConstantComposite 32 37 + 39: TypePointer Function 18(fvec2) + 54: TypeBool + 82: TypePointer Input 7(fvec4) + 83(pos): 82(ptr) Variable Input + 85: TypePointer Output 7(fvec4) +86(@entryPointOutput): 85(ptr) Variable Output + 130: TypePointer Function 17 + 132: TypePointer Function 20 + 4(main): 2 Function None 3 + 5: Label + 133: 132(ptr) Variable Function + 131: 130(ptr) Variable Function + 84: 7(fvec4) Load 83(pos) + 136: 34(ptr) AccessChain 131 25 + Store 136 33 + 137: 39(ptr) AccessChain 133 25 + Store 137 38 + Branch 100 + 100: Label + 157: 21(int) Phi 25 5 119 106 + 105: 54(bool) SLessThan 157 31 + LoopMerge 101 106 None + BranchConditional 105 106 101 + 106: Label + 138: 39(ptr) AccessChain 133 157 + 110: 18(fvec2) Load 138 + 139: 34(ptr) AccessChain 131 157 + 112: 14(fvec3) Load 139 + 113: 18(fvec2) VectorShuffle 112 112 0 1 + 114: 18(fvec2) FAdd 113 110 + 140: 34(ptr) AccessChain 131 157 + 116: 14(fvec3) Load 140 + 117: 14(fvec3) VectorShuffle 116 114 3 4 2 + Store 140 117 + 119: 21(int) IAdd 157 31 + Branch 100 + 101: Label + 142: 17 Load 131 + 156: 14(fvec3) CompositeExtract 142 0 + 124: 6(float) CompositeExtract 156 0 + 125: 6(float) CompositeExtract 156 1 + 126: 6(float) CompositeExtract 156 2 + 127: 7(fvec4) CompositeConstruct 124 125 126 32 + 128: 7(fvec4) FAdd 84 127 + Store 86(@entryPointOutput) 128 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out b/deps/glslang/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out new file mode 100644 index 00000000..e54fb7ef --- /dev/null +++ b/deps/glslang/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out @@ -0,0 +1,29 @@ +hlsl.partialFlattenMixed.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 36 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 32 35 + Source HLSL 500 + Name 4 "main" + Name 32 "pos" + Name 35 "@entryPointOutput" + Decorate 32(pos) Location 0 + Decorate 35(@entryPointOutput) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 31: TypePointer Input 7(fvec4) + 32(pos): 31(ptr) Variable Input + 34: TypePointer Output 7(fvec4) +35(@entryPointOutput): 34(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 33: 7(fvec4) Load 32(pos) + Store 35(@entryPointOutput) 33 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/100.frag.out b/deps/glslang/Test/baseResults/100.frag.out new file mode 100644 index 00000000..5e702e87 --- /dev/null +++ b/deps/glslang/Test/baseResults/100.frag.out @@ -0,0 +1,576 @@ +100.frag +ERROR: 0:3: '{ } style initializers' : not supported with this profile: es +ERROR: 0:3: 'initializer' : not supported for this version or the enabled extensions +ERROR: 0:3: 'array initializer' : not supported for this version or the enabled extensions +ERROR: 0:4: '#version' : must occur first in shader +ERROR: 0:7: 'attribute' : not supported in this stage: fragment +ERROR: 0:7: 'float' : type requires declaration of default precision qualifier +ERROR: 0:9: '=' : cannot convert from ' const int' to ' global mediump float' +ERROR: 0:11: 'uniform block' : not supported for this version or the enabled extensions +ERROR: 0:19: 'foo' : no matching overloaded function found +ERROR: 0:20: 'bit shift left' : not supported for this version or the enabled extensions +ERROR: 0:21: 'bit shift right' : not supported for this version or the enabled extensions +ERROR: 0:22: 'array comparison' : not supported for this version or the enabled extensions +ERROR: 0:24: 'bitwise and' : not supported for this version or the enabled extensions +ERROR: 0:25: '%' : not supported for this version or the enabled extensions +ERROR: 0:26: 'bitwise inclusive or' : not supported for this version or the enabled extensions +ERROR: 0:27: 'bit-shift right assign' : not supported for this version or the enabled extensions +ERROR: 0:28: 'bit-shift left assign' : not supported for this version or the enabled extensions +ERROR: 0:29: '%=' : not supported for this version or the enabled extensions +ERROR: 0:36: 'array assignment' : not supported for this version or the enabled extensions +ERROR: 0:37: 'array comparison' : not supported for this version or the enabled extensions +ERROR: 0:38: 'array comparison' : not supported for this version or the enabled extensions +ERROR: 0:40: 'switch' : Reserved word. +ERROR: 0:40: 'switch statements' : not supported for this version or the enabled extensions +ERROR: 0:45: '' : array size required +ERROR: 0:47: 'invariant' : can only apply to an output, or to an input in a non-vertex stage + +ERROR: 0:49: 'invariant' : can only apply to an output, or to an input in a non-vertex stage + +ERROR: 0:50: 'invariant' : can only apply to an output, or to an input in a non-vertex stage + +ERROR: 0:56: 'invariant' : not allowed in nested scope +ERROR: 0:56: 'invariant' : can only apply to an output, or to an input in a non-vertex stage + +ERROR: 0:57: 'invariant' : not allowed in nested scope +ERROR: 0:57: 'invariant' : can only apply to an output, or to an input in a non-vertex stage + +ERROR: 0:59: 'invariant' : not allowed in nested scope +ERROR: 0:59: 'invariant' : can only apply to an output, or to an input in a non-vertex stage + +ERROR: 0:63: 'invariant' : can only apply to an output, or to an input in a non-vertex stage + +ERROR: 0:64: 'invariant' : can only apply to an output, or to an input in a non-vertex stage + +ERROR: 0:66: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: glob2D +ERROR: 0:69: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: v2D +ERROR: 0:71: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: vary2D +ERROR: 0:75: 'in for stage inputs' : not supported for this version or the enabled extensions +ERROR: 0:77: 'invariant' : can only apply to an output, or to an input in a non-vertex stage + +ERROR: 0:75: 'g' : cannot use storage or interpolation qualifiers on structure members +ERROR: 0:76: 'h' : cannot use storage or interpolation qualifiers on structure members +ERROR: 0:77: 'i' : cannot use invariant qualifier on structure members +ERROR: 0:80: 'sampler3D' : Reserved word. +ERROR: 0:80: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:91: 'dFdx' : required extension not requested: GL_OES_standard_derivatives +ERROR: 0:92: 'dFdy' : required extension not requested: GL_OES_standard_derivatives +ERROR: 0:93: 'fwidth' : required extension not requested: GL_OES_standard_derivatives +ERROR: 0:103: 'gl_FragDepth' : undeclared identifier +ERROR: 0:104: 'gl_FragDepthEXT' : required extension not requested: GL_EXT_frag_depth +ERROR: 0:111: 'gl_FragDepth' : undeclared identifier +ERROR: 0:134: 'texture3D' : no matching overloaded function found +ERROR: 0:135: 'texture2DProjLod' : no matching overloaded function found +ERROR: 0:137: 'bitwise not' : not supported for this version or the enabled extensions +ERROR: 0:138: 'bitwise inclusive or' : not supported for this version or the enabled extensions +ERROR: 0:139: 'bitwise and' : not supported for this version or the enabled extensions +ERROR: 0:145: 'a' : redefinition +ERROR: 0:147: 'texture2DProjGradEXT' : required extension not requested: GL_EXT_shader_texture_lod +ERROR: 0:151: 'floating-point suffix' : not supported for this version or the enabled extensions +ERROR: 0:152: 'floating-point suffix' : not supported for this version or the enabled extensions +ERROR: 0:167: 'highp' : overloaded functions must have the same parameter precision qualifiers for argument 2 +ERROR: 0:170: 'multiple prototypes for same function' : not supported for this version or the enabled extensions +ERROR: 0:177: 'multiple prototypes for same function' : not supported for this version or the enabled extensions +ERROR: 0:179: 'fragment-shader struct input' : not supported for this version or the enabled extensions +ERROR: 0:183: 'v' : illegal use of type 'void' +ERROR: 0:184: 'void' : cannot be an argument type except for '(void)' +ERROR: 0:185: 'v' : illegal use of type 'void' +ERROR: 0:185: 'void' : cannot be an argument type except for '(void)' +ERROR: 0:190: '.' : cannot apply to an array: y +ERROR: 0:191: '.' : cannot apply to an array: zy +ERROR: 0:192: '.' : cannot apply to an array: nothing +ERROR: 0:193: '.length' : not supported for this version or the enabled extensions +ERROR: 0:194: '.' : cannot apply to an array: method +ERROR: 0:194: 'a' : can't use function syntax on variable +ERROR: 0:214: 'non-constant global initializer (needs GL_EXT_shader_non_constant_global_initializers)' : not supported for this version or the enabled extensions +ERROR: 0:3000: '#error' : line of this error should be 3000 +ERROR: 0:3002: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON +ERROR: 77 compilation errors. No code generated. + + +Shader version: 100 +Requested GL_EXT_frag_depth +Requested GL_EXT_shader_non_constant_global_initializers +Requested GL_EXT_shader_texture_lod +Requested GL_OES_EGL_image_external +Requested GL_OES_standard_derivatives +Requested GL_OES_texture_3D +ERROR: node is still EOpNull! +0:3 Sequence +0:3 move second child to first child ( temp 3-element array of mediump int) +0:3 'a' ( global 3-element array of mediump int) +0:3 Constant: +0:3 2 (const int) +0:3 3 (const int) +0:3 4 (const int) +0:17 Function Definition: main( ( global void) +0:17 Function Parameters: +0:19 Sequence +0:19 Constant: +0:19 0.000000 +0:20 Sequence +0:20 move second child to first child ( temp mediump int) +0:20 's' ( temp mediump int) +0:20 Constant: +0:20 16 (const int) +0:21 move second child to first child ( temp mediump int) +0:21 's' ( temp mediump int) +0:21 Constant: +0:21 4 (const int) +0:22 Test condition and select ( temp void) +0:22 Condition +0:22 Compare Equal ( temp bool) +0:22 'a' ( global 3-element array of mediump int) +0:22 'a' ( global 3-element array of mediump int) +0:22 true case is null +0:24 move second child to first child ( temp mediump int) +0:24 'b' ( temp mediump int) +0:24 bitwise and ( temp mediump int) +0:24 'c' ( temp mediump int) +0:24 Constant: +0:24 4 (const int) +0:25 move second child to first child ( temp mediump int) +0:25 'b' ( temp mediump int) +0:25 mod ( temp mediump int) +0:25 'c' ( temp mediump int) +0:25 Constant: +0:25 4 (const int) +0:26 move second child to first child ( temp mediump int) +0:26 'b' ( temp mediump int) +0:26 inclusive-or ( temp mediump int) +0:26 'c' ( temp mediump int) +0:26 Constant: +0:26 4 (const int) +0:27 right shift second child into first child ( temp mediump int) +0:27 'b' ( temp mediump int) +0:27 Constant: +0:27 2 (const int) +0:28 left shift second child into first child ( temp mediump int) +0:28 'b' ( temp mediump int) +0:28 Constant: +0:28 2 (const int) +0:29 mod second child into first child ( temp mediump int) +0:29 'b' ( temp mediump int) +0:29 Constant: +0:29 3 (const int) +0:36 move second child to first child ( temp structure{ temp mediump float f, temp 10-element array of mediump float a}) +0:36 's1' ( temp structure{ temp mediump float f, temp 10-element array of mediump float a}) +0:36 's2' ( temp structure{ temp mediump float f, temp 10-element array of mediump float a}) +0:37 Test condition and select ( temp void) +0:37 Condition +0:37 Compare Equal ( temp bool) +0:37 's1' ( temp structure{ temp mediump float f, temp 10-element array of mediump float a}) +0:37 's2' ( temp structure{ temp mediump float f, temp 10-element array of mediump float a}) +0:37 true case is null +0:38 Test condition and select ( temp void) +0:38 Condition +0:38 Compare Not Equal ( temp bool) +0:38 's1' ( temp structure{ temp mediump float f, temp 10-element array of mediump float a}) +0:38 's2' ( temp structure{ temp mediump float f, temp 10-element array of mediump float a}) +0:38 true case is null +0:40 'b' ( temp mediump int) +0:54 Function Definition: foo10( ( global void) +0:54 Function Parameters: +0:67 Function Definition: f11(s21; ( global void) +0:67 Function Parameters: +0:67 'p2d' ( in lowp sampler2D) +0:87 Function Definition: foo234( ( global void) +0:87 Function Parameters: +0:89 Sequence +0:89 texture ( global highp 4-component vector of float) +0:89 's3D2' ( uniform highp sampler3D) +0:89 Constant: +0:89 0.200000 +0:89 0.200000 +0:89 0.200000 +0:89 Constant: +0:89 0.200000 +0:90 textureProj ( global highp 4-component vector of float) +0:90 's3D2' ( uniform highp sampler3D) +0:90 direct index ( smooth temp mediump 4-component vector of float) +0:90 'v' ( smooth in 3-element array of mediump 4-component vector of float) +0:90 Constant: +0:90 1 (const int) +0:90 Constant: +0:90 0.400000 +0:91 dPdx ( global mediump 4-component vector of float) +0:91 direct index ( smooth temp mediump 4-component vector of float) +0:91 'v' ( smooth in 3-element array of mediump 4-component vector of float) +0:91 Constant: +0:91 0 (const int) +0:92 Constant: +0:92 0.000000 +0:93 fwidth ( global mediump float) +0:93 'f13' ( invariant global mediump float) +0:98 Function Definition: foo236( ( global void) +0:98 Function Parameters: +0:100 Sequence +0:100 dPdx ( global mediump 4-component vector of float) +0:100 direct index ( smooth temp mediump 4-component vector of float) +0:100 'v' ( smooth in 3-element array of mediump 4-component vector of float) +0:100 Constant: +0:100 0 (const int) +0:101 Constant: +0:101 0.000000 +0:102 fwidth ( global mediump float) +0:102 'f13' ( invariant global mediump float) +0:103 move second child to first child ( temp mediump float) +0:103 'gl_FragDepth' ( temp mediump float) +0:103 'f13' ( invariant global mediump float) +0:104 move second child to first child ( temp highp float) +0:104 'gl_FragDepthEXT' ( gl_FragDepth highp float FragDepth) +0:104 'f13' ( invariant global mediump float) +0:109 Function Definition: foo239( ( global void) +0:109 Function Parameters: +0:111 Sequence +0:111 move second child to first child ( temp mediump float) +0:111 'gl_FragDepth' ( temp mediump float) +0:111 'f13' ( invariant global mediump float) +0:112 move second child to first child ( temp highp float) +0:112 'gl_FragDepthEXT' ( gl_FragDepth highp float FragDepth) +0:112 'f13' ( invariant global mediump float) +0:119 Function Definition: foo245( ( global void) +0:119 Function Parameters: +0:121 Sequence +0:121 texture ( global lowp 4-component vector of float) +0:121 'sExt' ( uniform lowp samplerExternalOES) +0:121 Constant: +0:121 0.200000 +0:121 0.200000 +0:122 textureProj ( global lowp 4-component vector of float) +0:122 'sExt' ( uniform lowp samplerExternalOES) +0:122 Construct vec3 ( temp lowp 3-component vector of float) +0:122 'f13' ( invariant global mediump float) +0:123 textureProj ( global lowp 4-component vector of float, operation at mediump) +0:123 'sExt' ( uniform lowp samplerExternalOES) +0:123 direct index ( smooth temp mediump 4-component vector of float) +0:123 'v' ( smooth in 3-element array of mediump 4-component vector of float) +0:123 Constant: +0:123 2 (const int) +0:130 Function Definition: foo246( ( global void) +0:130 Function Parameters: +0:132 Sequence +0:132 texture ( global mediump 4-component vector of float) +0:132 'mediumExt' ( uniform mediump samplerExternalOES) +0:132 Constant: +0:132 0.200000 +0:132 0.200000 +0:133 textureProj ( global highp 4-component vector of float) +0:133 'highExt' ( uniform highp samplerExternalOES) +0:133 direct index ( smooth temp mediump 4-component vector of float) +0:133 'v' ( smooth in 3-element array of mediump 4-component vector of float) +0:133 Constant: +0:133 2 (const int) +0:134 Constant: +0:134 0.000000 +0:135 Constant: +0:135 0.000000 +0:137 Bitwise not ( temp mediump int) +0:137 'a' ( temp mediump int) +0:138 inclusive-or ( temp mediump int) +0:138 'a' ( temp mediump int) +0:138 'a' ( temp mediump int) +0:139 bitwise and ( temp mediump int) +0:139 'a' ( temp mediump int) +0:139 'a' ( temp mediump int) +0:145 Function Definition: foo203940(i1;f1;f1; ( global mediump int) +0:145 Function Parameters: +0:145 'a' ( in mediump int) +0:145 'b' ( in mediump float) +0:147 Sequence +0:147 textureProjGrad ( global lowp 4-component vector of float, operation at mediump) +0:147 's2Dg' ( uniform lowp sampler2D) +0:147 Construct vec3 ( temp mediump 3-component vector of float) +0:147 'f13' ( invariant global mediump float) +0:147 'uv2' ( invariant uniform mediump 2-component vector of float) +0:147 'uv2' ( invariant uniform mediump 2-component vector of float) +0:148 Branch: Return with expression +0:148 'a' ( in mediump int) +0:151 Sequence +0:151 move second child to first child ( temp mediump float) +0:151 'f123' ( global mediump float) +0:151 Constant: +0:151 4.000000 +0:152 Sequence +0:152 move second child to first child ( temp mediump float) +0:152 'f124' ( global mediump float) +0:152 Constant: +0:152 50000000000.000000 +0:158 Function Definition: foo323433( ( global void) +0:158 Function Parameters: +0:160 Sequence +0:160 textureLod ( global lowp 4-component vector of float, operation at mediump) +0:160 's2Dg' ( uniform lowp sampler2D) +0:160 'uv2' ( invariant uniform mediump 2-component vector of float) +0:160 'f13' ( invariant global mediump float) +0:161 textureProjGrad ( global lowp 4-component vector of float, operation at mediump) +0:161 's2Dg' ( uniform lowp sampler2D) +0:161 Construct vec3 ( temp mediump 3-component vector of float) +0:161 'f13' ( invariant global mediump float) +0:161 'uv2' ( invariant uniform mediump 2-component vector of float) +0:161 'uv2' ( invariant uniform mediump 2-component vector of float) +0:162 textureGrad ( global lowp 4-component vector of float, operation at mediump) +0:162 's2Dg' ( uniform lowp sampler2D) +0:162 'uv2' ( invariant uniform mediump 2-component vector of float) +0:162 'uv2' ( invariant uniform mediump 2-component vector of float) +0:162 'uv2' ( invariant uniform mediump 2-component vector of float) +0:163 textureGrad ( global lowp 4-component vector of float) +0:163 'sCube' ( uniform lowp samplerCube) +0:163 Construct vec3 ( temp lowp 3-component vector of float) +0:163 'f13' ( invariant global mediump float) +0:163 Construct vec3 ( temp lowp 3-component vector of float) +0:163 'f13' ( invariant global mediump float) +0:163 Construct vec3 ( temp lowp 3-component vector of float) +0:163 'f13' ( invariant global mediump float) +0:167 Function Definition: fgfg(f1;i1; ( global mediump int) +0:167 Function Parameters: +0:167 'f' ( in mediump float) +0:167 'i' ( in highp int) +0:167 Sequence +0:167 Branch: Return with expression +0:167 Constant: +0:167 2 (const int) +0:173 Function Definition: gggf(f1; ( global mediump int) +0:173 Function Parameters: +0:173 'f' ( in mediump float) +0:173 Sequence +0:173 Branch: Return with expression +0:173 Constant: +0:173 2 (const int) +0:175 Function Definition: agggf(f1; ( global mediump int) +0:175 Function Parameters: +0:175 'f' ( in mediump float) +0:175 Sequence +0:175 Branch: Return with expression +0:175 Constant: +0:175 2 (const int) +0:187 Function Definition: badswizzle( ( global void) +0:187 Function Parameters: +0:? Sequence +0:190 'a' ( temp 5-element array of mediump 3-component vector of float) +0:191 'a' ( temp 5-element array of mediump 3-component vector of float) +0:192 'a' ( temp 5-element array of mediump 3-component vector of float) +0:193 Constant: +0:193 5 (const int) +0:194 Constant: +0:194 0.000000 +0:199 Function Definition: fooinittest( ( global mediump float) +0:199 Function Parameters: +0:201 Sequence +0:201 Branch: Return with expression +0:201 Function Call: fooinit( ( global mediump float) +0:209 Function Definition: fooinit( ( global mediump float) +0:209 Function Parameters: +0:211 Sequence +0:211 Branch: Return with expression +0:211 Constant: +0:211 12.000000 +0:214 Sequence +0:214 move second child to first child ( temp mediump int) +0:214 'init1' ( global mediump int) +0:214 Test condition and select ( temp mediump int) +0:214 Condition +0:214 'gl_FrontFacing' ( gl_FrontFacing bool Face) +0:214 true case +0:214 Constant: +0:214 1 (const int) +0:214 false case +0:214 Constant: +0:214 2 (const int) +0:220 Sequence +0:220 move second child to first child ( temp mediump int) +0:220 'init2' ( global mediump int) +0:220 Test condition and select ( temp mediump int) +0:220 Condition +0:220 'gl_FrontFacing' ( gl_FrontFacing bool Face) +0:220 true case +0:220 Constant: +0:220 1 (const int) +0:220 false case +0:220 Constant: +0:220 2 (const int) +0:? Linker Objects +0:? 'a' ( global 3-element array of mediump int) +0:? 'uint' ( global mediump int) +0:? 'v' ( smooth in 3-element array of mediump 4-component vector of float) +0:? 'f' ( invariant global mediump float) +0:? 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump int x}) +0:? 'fa' ( global unsized 1-element array of mediump float) +0:? 'f13' ( invariant global mediump float) +0:? 'fi' ( invariant temp mediump float) +0:? 'av' ( invariant smooth in mediump 4-component vector of float) +0:? 'uv2' ( invariant uniform mediump 2-component vector of float) +0:? 'uv3' ( invariant uniform mediump 3-component vector of float) +0:? 'glob2D' ( global lowp sampler2D) +0:? 'vary2D' ( smooth in lowp sampler2D) +0:? 's3D' ( uniform mediump sampler3D) +0:? 's3D2' ( uniform highp sampler3D) +0:? 'sExt' ( uniform lowp samplerExternalOES) +0:? 'mediumExt' ( uniform mediump samplerExternalOES) +0:? 'highExt' ( uniform highp samplerExternalOES) +0:? 's2Dg' ( uniform lowp sampler2D) +0:? 'f123' ( global mediump float) +0:? 'f124' ( global mediump float) +0:? 'sCube' ( uniform lowp samplerCube) +0:? 's' ( smooth in structure{ global mediump float f}) +0:? 'fi1' ( const mediump float) +0:? 3.000000 +0:? 'fi2' ( const mediump float) +0:? 4.000000 +0:? 'fi3' ( const mediump float) +0:? 5.000000 +0:? 'init1' ( global mediump int) +0:? 'init2' ( global mediump int) + + +Linked fragment stage: + + +Shader version: 100 +Requested GL_EXT_frag_depth +Requested GL_EXT_shader_non_constant_global_initializers +Requested GL_EXT_shader_texture_lod +Requested GL_OES_EGL_image_external +Requested GL_OES_standard_derivatives +Requested GL_OES_texture_3D +ERROR: node is still EOpNull! +0:3 Sequence +0:3 move second child to first child ( temp 3-element array of mediump int) +0:3 'a' ( global 3-element array of mediump int) +0:3 Constant: +0:3 2 (const int) +0:3 3 (const int) +0:3 4 (const int) +0:17 Function Definition: main( ( global void) +0:17 Function Parameters: +0:19 Sequence +0:19 Constant: +0:19 0.000000 +0:20 Sequence +0:20 move second child to first child ( temp mediump int) +0:20 's' ( temp mediump int) +0:20 Constant: +0:20 16 (const int) +0:21 move second child to first child ( temp mediump int) +0:21 's' ( temp mediump int) +0:21 Constant: +0:21 4 (const int) +0:22 Test condition and select ( temp void) +0:22 Condition +0:22 Compare Equal ( temp bool) +0:22 'a' ( global 3-element array of mediump int) +0:22 'a' ( global 3-element array of mediump int) +0:22 true case is null +0:24 move second child to first child ( temp mediump int) +0:24 'b' ( temp mediump int) +0:24 bitwise and ( temp mediump int) +0:24 'c' ( temp mediump int) +0:24 Constant: +0:24 4 (const int) +0:25 move second child to first child ( temp mediump int) +0:25 'b' ( temp mediump int) +0:25 mod ( temp mediump int) +0:25 'c' ( temp mediump int) +0:25 Constant: +0:25 4 (const int) +0:26 move second child to first child ( temp mediump int) +0:26 'b' ( temp mediump int) +0:26 inclusive-or ( temp mediump int) +0:26 'c' ( temp mediump int) +0:26 Constant: +0:26 4 (const int) +0:27 right shift second child into first child ( temp mediump int) +0:27 'b' ( temp mediump int) +0:27 Constant: +0:27 2 (const int) +0:28 left shift second child into first child ( temp mediump int) +0:28 'b' ( temp mediump int) +0:28 Constant: +0:28 2 (const int) +0:29 mod second child into first child ( temp mediump int) +0:29 'b' ( temp mediump int) +0:29 Constant: +0:29 3 (const int) +0:36 move second child to first child ( temp structure{ temp mediump float f, temp 10-element array of mediump float a}) +0:36 's1' ( temp structure{ temp mediump float f, temp 10-element array of mediump float a}) +0:36 's2' ( temp structure{ temp mediump float f, temp 10-element array of mediump float a}) +0:37 Test condition and select ( temp void) +0:37 Condition +0:37 Compare Equal ( temp bool) +0:37 's1' ( temp structure{ temp mediump float f, temp 10-element array of mediump float a}) +0:37 's2' ( temp structure{ temp mediump float f, temp 10-element array of mediump float a}) +0:37 true case is null +0:38 Test condition and select ( temp void) +0:38 Condition +0:38 Compare Not Equal ( temp bool) +0:38 's1' ( temp structure{ temp mediump float f, temp 10-element array of mediump float a}) +0:38 's2' ( temp structure{ temp mediump float f, temp 10-element array of mediump float a}) +0:38 true case is null +0:40 'b' ( temp mediump int) +0:151 Sequence +0:151 move second child to first child ( temp mediump float) +0:151 'f123' ( global mediump float) +0:151 Constant: +0:151 4.000000 +0:152 Sequence +0:152 move second child to first child ( temp mediump float) +0:152 'f124' ( global mediump float) +0:152 Constant: +0:152 50000000000.000000 +0:214 Sequence +0:214 move second child to first child ( temp mediump int) +0:214 'init1' ( global mediump int) +0:214 Test condition and select ( temp mediump int) +0:214 Condition +0:214 'gl_FrontFacing' ( gl_FrontFacing bool Face) +0:214 true case +0:214 Constant: +0:214 1 (const int) +0:214 false case +0:214 Constant: +0:214 2 (const int) +0:220 Sequence +0:220 move second child to first child ( temp mediump int) +0:220 'init2' ( global mediump int) +0:220 Test condition and select ( temp mediump int) +0:220 Condition +0:220 'gl_FrontFacing' ( gl_FrontFacing bool Face) +0:220 true case +0:220 Constant: +0:220 1 (const int) +0:220 false case +0:220 Constant: +0:220 2 (const int) +0:? Linker Objects +0:? 'a' ( global 3-element array of mediump int) +0:? 'uint' ( global mediump int) +0:? 'v' ( smooth in 3-element array of mediump 4-component vector of float) +0:? 'f' ( invariant global mediump float) +0:? 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump int x}) +0:? 'fa' ( global 1-element array of mediump float) +0:? 'f13' ( invariant global mediump float) +0:? 'fi' ( invariant temp mediump float) +0:? 'av' ( invariant smooth in mediump 4-component vector of float) +0:? 'uv2' ( invariant uniform mediump 2-component vector of float) +0:? 'uv3' ( invariant uniform mediump 3-component vector of float) +0:? 'glob2D' ( global lowp sampler2D) +0:? 'vary2D' ( smooth in lowp sampler2D) +0:? 's3D' ( uniform mediump sampler3D) +0:? 's3D2' ( uniform highp sampler3D) +0:? 'sExt' ( uniform lowp samplerExternalOES) +0:? 'mediumExt' ( uniform mediump samplerExternalOES) +0:? 'highExt' ( uniform highp samplerExternalOES) +0:? 's2Dg' ( uniform lowp sampler2D) +0:? 'f123' ( global mediump float) +0:? 'f124' ( global mediump float) +0:? 'sCube' ( uniform lowp samplerCube) +0:? 's' ( smooth in structure{ global mediump float f}) +0:? 'fi1' ( const mediump float) +0:? 3.000000 +0:? 'fi2' ( const mediump float) +0:? 4.000000 +0:? 'fi3' ( const mediump float) +0:? 5.000000 +0:? 'init1' ( global mediump int) +0:? 'init2' ( global mediump int) + diff --git a/deps/glslang/Test/baseResults/100Limits.vert.out b/deps/glslang/Test/baseResults/100Limits.vert.out new file mode 100644 index 00000000..ab0ff1ee --- /dev/null +++ b/deps/glslang/Test/baseResults/100Limits.vert.out @@ -0,0 +1,889 @@ +100Limits.vert +Shader version: 100 +0:? Sequence +0:15 Function Definition: foo(f1; ( global void) +0:15 Function Parameters: +0:15 'a' ( inout highp float) +0:17 Function Definition: bar( ( global highp int) +0:17 Function Parameters: +0:19 Sequence +0:19 Branch: Return with expression +0:19 Constant: +0:19 1 (const int) +0:22 Function Definition: main( ( global void) +0:22 Function Parameters: +0:24 Sequence +0:24 Loop with condition tested first +0:24 Loop Condition +0:24 Compare Less Than ( temp bool) +0:24 'ga' ( global highp int) +0:24 'gb' ( global highp int) +0:24 No loop body +0:26 Loop with condition not tested first +0:26 Loop Condition +0:26 Constant: +0:26 false (const bool) +0:26 No loop body +0:28 Sequence +0:28 Loop with condition tested first +0:28 No loop condition +0:28 No loop body +0:29 Sequence +0:29 Loop with condition tested first +0:29 Loop Condition +0:29 Compare Equal ( temp bool) +0:29 'ga' ( global highp int) +0:29 'gb' ( global highp int) +0:29 No loop body +0:30 Sequence +0:30 Loop with condition tested first +0:30 No loop condition +0:30 No loop body +0:30 Loop Terminal Expression +0:30 Post-Increment ( temp highp float) +0:30 'f' ( global highp float) +0:31 Sequence +0:31 move second child to first child ( temp highp int) +0:31 'ga' ( global highp int) +0:31 Constant: +0:31 0 (const int) +0:31 Loop with condition tested first +0:31 No loop condition +0:31 No loop body +0:32 Sequence +0:32 Sequence +0:32 move second child to first child ( temp bool) +0:32 'a' ( temp bool) +0:32 Constant: +0:32 false (const bool) +0:32 Loop with condition tested first +0:32 No loop condition +0:32 No loop body +0:33 Sequence +0:33 Sequence +0:33 move second child to first child ( temp highp float) +0:33 'a' ( temp highp float) +0:33 Constant: +0:33 0.000000 +0:33 Loop with condition tested first +0:33 Loop Condition +0:33 Compare Equal ( temp bool) +0:33 'a' ( temp highp float) +0:33 sine ( global highp float) +0:33 'f' ( global highp float) +0:33 No loop body +0:34 Sequence +0:34 Sequence +0:34 move second child to first child ( temp highp int) +0:34 'a' ( temp highp int) +0:34 Constant: +0:34 0 (const int) +0:34 Loop with condition tested first +0:34 Loop Condition +0:34 Compare Less Than ( temp bool) +0:34 'a' ( temp highp int) +0:34 Constant: +0:34 10 (const int) +0:34 No loop body +0:34 Loop Terminal Expression +0:34 multiply second child into first child ( temp highp int) +0:34 'a' ( temp highp int) +0:34 Constant: +0:34 2 (const int) +0:35 Sequence +0:35 Sequence +0:35 move second child to first child ( temp highp int) +0:35 'a' ( temp highp int) +0:35 Constant: +0:35 0 (const int) +0:35 Loop with condition tested first +0:35 Loop Condition +0:35 Compare Less Than or Equal ( temp bool) +0:35 'a' ( temp highp int) +0:35 Constant: +0:35 20 (const int) +0:35 Loop Body +0:35 Pre-Decrement ( temp highp int) +0:35 'a' ( temp highp int) +0:35 Loop Terminal Expression +0:35 Post-Increment ( temp highp int) +0:35 'a' ( temp highp int) +0:36 Sequence +0:36 Sequence +0:36 move second child to first child ( temp highp int) +0:36 'a' ( temp highp int) +0:36 Constant: +0:36 0 (const int) +0:36 Loop with condition tested first +0:36 Loop Condition +0:36 Compare Less Than or Equal ( temp bool) +0:36 'a' ( temp highp int) +0:36 Constant: +0:36 20 (const int) +0:36 Loop Body +0:36 Sequence +0:36 Test condition and select ( temp void) +0:36 Condition +0:36 Compare Equal ( temp bool) +0:36 'ga' ( global highp int) +0:36 Constant: +0:36 0 (const int) +0:36 true case +0:36 move second child to first child ( temp highp int) +0:36 'a' ( temp highp int) +0:36 Constant: +0:36 4 (const int) +0:36 Loop Terminal Expression +0:36 Post-Increment ( temp highp int) +0:36 'a' ( temp highp int) +0:37 Sequence +0:37 Sequence +0:37 move second child to first child ( temp highp float) +0:37 'a' ( temp highp float) +0:37 Constant: +0:37 0.000000 +0:37 Loop with condition tested first +0:37 Loop Condition +0:37 Compare Less Than or Equal ( temp bool) +0:37 'a' ( temp highp float) +0:37 Constant: +0:37 20.000000 +0:37 No loop body +0:37 Loop Terminal Expression +0:37 add second child into first child ( temp highp float) +0:37 'a' ( temp highp float) +0:37 Constant: +0:37 2.000000 +0:38 Sequence +0:38 Sequence +0:38 move second child to first child ( temp highp float) +0:38 'a' ( temp highp float) +0:38 Constant: +0:38 0.000000 +0:38 Loop with condition tested first +0:38 Loop Condition +0:38 Compare Not Equal ( temp bool) +0:38 'a' ( temp highp float) +0:38 Constant: +0:38 20.000000 +0:38 Loop Body +0:38 Sequence +0:38 Test condition and select ( temp void) +0:38 Condition +0:38 Compare Equal ( temp bool) +0:38 'ga' ( global highp int) +0:38 Constant: +0:38 0 (const int) +0:38 true case +0:38 move second child to first child ( temp highp int) +0:38 'ga' ( global highp int) +0:38 Constant: +0:38 4 (const int) +0:38 Loop Terminal Expression +0:38 subtract second child into first child ( temp highp float) +0:38 'a' ( temp highp float) +0:38 Constant: +0:38 2.000000 +0:39 Sequence +0:39 Sequence +0:39 move second child to first child ( temp highp float) +0:39 'a' ( temp highp float) +0:39 Constant: +0:39 0.000000 +0:39 Loop with condition tested first +0:39 Loop Condition +0:39 Compare Equal ( temp bool) +0:39 'a' ( temp highp float) +0:39 Constant: +0:39 20.000000 +0:39 Loop Body +0:39 Sequence +0:39 Sequence +0:39 move second child to first child ( temp highp float) +0:39 'a' ( temp highp float) +0:39 Constant: +0:39 0.000000 +0:39 Loop with condition tested first +0:39 Loop Condition +0:39 Compare Equal ( temp bool) +0:39 'a' ( temp highp float) +0:39 Constant: +0:39 20.000000 +0:39 No loop body +0:39 Loop Terminal Expression +0:39 Post-Decrement ( temp highp float) +0:39 'a' ( temp highp float) +0:39 Loop Terminal Expression +0:39 Post-Decrement ( temp highp float) +0:39 'a' ( temp highp float) +0:40 Sequence +0:40 Sequence +0:40 move second child to first child ( temp highp float) +0:40 'a' ( temp highp float) +0:40 Constant: +0:40 0.000000 +0:40 Loop with condition tested first +0:40 Loop Condition +0:40 Compare Less Than or Equal ( temp bool) +0:40 'a' ( temp highp float) +0:40 Constant: +0:40 20.000000 +0:40 No loop body +0:40 Loop Terminal Expression +0:40 add second child into first child ( temp highp float) +0:40 'a' ( temp highp float) +0:40 Constant: +0:40 2.000000 +0:41 Sequence +0:41 Sequence +0:41 move second child to first child ( temp highp float) +0:41 'a' ( temp highp float) +0:41 Constant: +0:41 0.000000 +0:41 Loop with condition tested first +0:41 Loop Condition +0:41 Compare Less Than or Equal ( temp bool) +0:41 'a' ( temp highp float) +0:41 Constant: +0:41 20.000000 +0:41 No loop body +0:41 Loop Terminal Expression +0:41 add second child into first child ( temp highp float) +0:41 'a' ( temp highp float) +0:41 Constant: +0:41 2.000000 +0:42 Sequence +0:42 Sequence +0:42 move second child to first child ( temp highp float) +0:42 'a' ( temp highp float) +0:42 Constant: +0:42 0.000000 +0:42 Loop with condition tested first +0:42 Loop Condition +0:42 Compare Greater Than ( temp bool) +0:42 'a' ( temp highp float) +0:42 Constant: +0:42 40.000000 +0:42 No loop body +0:42 Loop Terminal Expression +0:42 add second child into first child ( temp highp float) +0:42 'a' ( temp highp float) +0:42 Constant: +0:42 2.000000 +0:43 Sequence +0:43 Sequence +0:43 move second child to first child ( temp highp float) +0:43 'a' ( temp highp float) +0:43 Constant: +0:43 0.000000 +0:43 Loop with condition tested first +0:43 Loop Condition +0:43 Compare Greater Than or Equal ( temp bool) +0:43 'a' ( temp highp float) +0:43 Constant: +0:43 20.000000 +0:43 Loop Body +0:43 Function Call: foo(f1; ( global void) +0:43 'a' ( temp highp float) +0:43 Loop Terminal Expression +0:43 add second child into first child ( temp highp float) +0:43 'a' ( temp highp float) +0:43 Constant: +0:43 2.000000 +0:47 indirect index ( temp lowp sampler2D) +0:47 'fsa' ( uniform 3-element array of lowp sampler2D) +0:47 'ga' ( global highp int) +0:48 indirect index ( temp highp float) +0:48 'fua' ( uniform 10-element array of highp float) +0:48 'ga' ( global highp int) +0:49 indirect index ( temp highp 3-component vector of float) +0:49 'am3' ( in highp 3X3 matrix of float) +0:49 'ga' ( global highp int) +0:50 indirect index ( temp highp float) +0:50 'av2' ( in highp 2-component vector of float) +0:50 'ga' ( global highp int) +0:51 indirect index ( smooth temp highp 4-component vector of float) +0:51 'va' ( smooth out 4-element array of highp 4-component vector of float) +0:51 add ( temp highp int) +0:51 Constant: +0:51 2 (const int) +0:51 'ga' ( global highp int) +0:52 indirect index ( temp highp 2-component vector of float) +0:52 Constant: +0:52 1.000000 +0:52 0.000000 +0:52 0.000000 +0:52 1.000000 +0:52 'ga' ( global highp int) +0:53 indirect index ( temp highp float) +0:53 Constant: +0:53 2.000000 +0:53 2.000000 +0:53 2.000000 +0:53 divide ( temp highp int) +0:53 'ga' ( global highp int) +0:53 Constant: +0:53 2 (const int) +0:54 indirect index ( temp highp int) +0:54 'ia' ( temp 9-element array of highp int) +0:54 'ga' ( global highp int) +0:56 Sequence +0:56 Sequence +0:56 move second child to first child ( temp highp int) +0:56 'a' ( temp highp int) +0:56 Constant: +0:56 3 (const int) +0:56 Loop with condition tested first +0:56 Loop Condition +0:56 Compare Greater Than or Equal ( temp bool) +0:56 'a' ( temp highp int) +0:56 Constant: +0:56 0 (const int) +0:56 Loop Body +0:57 Sequence +0:57 indirect index ( temp lowp sampler2D) +0:57 'fsa' ( uniform 3-element array of lowp sampler2D) +0:57 'a' ( temp highp int) +0:58 indirect index ( temp highp float) +0:58 'fua' ( uniform 10-element array of highp float) +0:58 add ( temp highp int) +0:58 'a' ( temp highp int) +0:58 Constant: +0:58 2 (const int) +0:59 indirect index ( temp highp 3-component vector of float) +0:59 'am3' ( in highp 3X3 matrix of float) +0:59 component-wise multiply ( temp highp int) +0:59 Constant: +0:59 3 (const int) +0:59 'a' ( temp highp int) +0:60 indirect index ( temp highp float) +0:60 'av2' ( in highp 2-component vector of float) +0:60 component-wise multiply ( temp highp int) +0:60 Constant: +0:60 3 (const int) +0:60 'a' ( temp highp int) +0:61 indirect index ( smooth temp highp 4-component vector of float) +0:61 'va' ( smooth out 4-element array of highp 4-component vector of float) +0:61 subtract ( temp highp int) +0:61 'a' ( temp highp int) +0:61 Constant: +0:61 1 (const int) +0:62 indirect index ( temp highp 2-component vector of float) +0:62 Constant: +0:62 1.000000 +0:62 0.000000 +0:62 0.000000 +0:62 1.000000 +0:62 divide ( temp highp int) +0:62 'a' ( temp highp int) +0:62 Constant: +0:62 2 (const int) +0:63 indirect index ( temp highp float) +0:63 Constant: +0:63 2.000000 +0:63 2.000000 +0:63 2.000000 +0:63 'a' ( temp highp int) +0:64 indirect index ( temp highp int) +0:64 'ia' ( temp 9-element array of highp int) +0:64 'a' ( temp highp int) +0:65 indirect index ( temp highp int) +0:65 'ia' ( temp 9-element array of highp int) +0:65 Function Call: bar( ( global highp int) +0:56 Loop Terminal Expression +0:56 Post-Decrement ( temp highp int) +0:56 'a' ( temp highp int) +0:68 direct index ( temp lowp sampler2D) +0:68 'fsa' ( uniform 3-element array of lowp sampler2D) +0:68 Constant: +0:68 2 (const int) +0:69 direct index ( temp highp float) +0:69 'fua' ( uniform 10-element array of highp float) +0:69 Constant: +0:69 3 (const int) +0:70 direct index ( temp highp 3-component vector of float) +0:70 'am3' ( in highp 3X3 matrix of float) +0:70 Constant: +0:70 2 (const int) +0:71 direct index ( temp highp float) +0:71 'av2' ( in highp 2-component vector of float) +0:71 Constant: +0:71 1 (const int) +0:72 direct index ( smooth temp highp 4-component vector of float) +0:72 'va' ( smooth out 4-element array of highp 4-component vector of float) +0:72 Constant: +0:72 1 (const int) +0:73 Constant: +0:73 0.000000 +0:73 1.000000 +0:74 Constant: +0:74 2.000000 +0:75 direct index ( temp highp int) +0:75 'ia' ( temp 9-element array of highp int) +0:75 Constant: +0:75 3 (const int) +0:? Linker Objects +0:? 'ga' ( global highp int) +0:? 'gb' ( global highp int) +0:? 'f' ( global highp float) +0:? 'fsa' ( uniform 3-element array of lowp sampler2D) +0:? 'fua' ( uniform 10-element array of highp float) +0:? 'am3' ( in highp 3X3 matrix of float) +0:? 'av2' ( in highp 2-component vector of float) +0:? 'va' ( smooth out 4-element array of highp 4-component vector of float) +0:? 'm2' ( const highp 2X2 matrix of float) +0:? 1.000000 +0:? 0.000000 +0:? 0.000000 +0:? 1.000000 +0:? 'v3' ( const highp 3-component vector of float) +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 + + +Linked vertex stage: + + +Shader version: 100 +0:? Sequence +0:15 Function Definition: foo(f1; ( global void) +0:15 Function Parameters: +0:15 'a' ( inout highp float) +0:17 Function Definition: bar( ( global highp int) +0:17 Function Parameters: +0:19 Sequence +0:19 Branch: Return with expression +0:19 Constant: +0:19 1 (const int) +0:22 Function Definition: main( ( global void) +0:22 Function Parameters: +0:24 Sequence +0:24 Loop with condition tested first +0:24 Loop Condition +0:24 Compare Less Than ( temp bool) +0:24 'ga' ( global highp int) +0:24 'gb' ( global highp int) +0:24 No loop body +0:26 Loop with condition not tested first +0:26 Loop Condition +0:26 Constant: +0:26 false (const bool) +0:26 No loop body +0:28 Sequence +0:28 Loop with condition tested first +0:28 No loop condition +0:28 No loop body +0:29 Sequence +0:29 Loop with condition tested first +0:29 Loop Condition +0:29 Compare Equal ( temp bool) +0:29 'ga' ( global highp int) +0:29 'gb' ( global highp int) +0:29 No loop body +0:30 Sequence +0:30 Loop with condition tested first +0:30 No loop condition +0:30 No loop body +0:30 Loop Terminal Expression +0:30 Post-Increment ( temp highp float) +0:30 'f' ( global highp float) +0:31 Sequence +0:31 move second child to first child ( temp highp int) +0:31 'ga' ( global highp int) +0:31 Constant: +0:31 0 (const int) +0:31 Loop with condition tested first +0:31 No loop condition +0:31 No loop body +0:32 Sequence +0:32 Sequence +0:32 move second child to first child ( temp bool) +0:32 'a' ( temp bool) +0:32 Constant: +0:32 false (const bool) +0:32 Loop with condition tested first +0:32 No loop condition +0:32 No loop body +0:33 Sequence +0:33 Sequence +0:33 move second child to first child ( temp highp float) +0:33 'a' ( temp highp float) +0:33 Constant: +0:33 0.000000 +0:33 Loop with condition tested first +0:33 Loop Condition +0:33 Compare Equal ( temp bool) +0:33 'a' ( temp highp float) +0:33 sine ( global highp float) +0:33 'f' ( global highp float) +0:33 No loop body +0:34 Sequence +0:34 Sequence +0:34 move second child to first child ( temp highp int) +0:34 'a' ( temp highp int) +0:34 Constant: +0:34 0 (const int) +0:34 Loop with condition tested first +0:34 Loop Condition +0:34 Compare Less Than ( temp bool) +0:34 'a' ( temp highp int) +0:34 Constant: +0:34 10 (const int) +0:34 No loop body +0:34 Loop Terminal Expression +0:34 multiply second child into first child ( temp highp int) +0:34 'a' ( temp highp int) +0:34 Constant: +0:34 2 (const int) +0:35 Sequence +0:35 Sequence +0:35 move second child to first child ( temp highp int) +0:35 'a' ( temp highp int) +0:35 Constant: +0:35 0 (const int) +0:35 Loop with condition tested first +0:35 Loop Condition +0:35 Compare Less Than or Equal ( temp bool) +0:35 'a' ( temp highp int) +0:35 Constant: +0:35 20 (const int) +0:35 Loop Body +0:35 Pre-Decrement ( temp highp int) +0:35 'a' ( temp highp int) +0:35 Loop Terminal Expression +0:35 Post-Increment ( temp highp int) +0:35 'a' ( temp highp int) +0:36 Sequence +0:36 Sequence +0:36 move second child to first child ( temp highp int) +0:36 'a' ( temp highp int) +0:36 Constant: +0:36 0 (const int) +0:36 Loop with condition tested first +0:36 Loop Condition +0:36 Compare Less Than or Equal ( temp bool) +0:36 'a' ( temp highp int) +0:36 Constant: +0:36 20 (const int) +0:36 Loop Body +0:36 Sequence +0:36 Test condition and select ( temp void) +0:36 Condition +0:36 Compare Equal ( temp bool) +0:36 'ga' ( global highp int) +0:36 Constant: +0:36 0 (const int) +0:36 true case +0:36 move second child to first child ( temp highp int) +0:36 'a' ( temp highp int) +0:36 Constant: +0:36 4 (const int) +0:36 Loop Terminal Expression +0:36 Post-Increment ( temp highp int) +0:36 'a' ( temp highp int) +0:37 Sequence +0:37 Sequence +0:37 move second child to first child ( temp highp float) +0:37 'a' ( temp highp float) +0:37 Constant: +0:37 0.000000 +0:37 Loop with condition tested first +0:37 Loop Condition +0:37 Compare Less Than or Equal ( temp bool) +0:37 'a' ( temp highp float) +0:37 Constant: +0:37 20.000000 +0:37 No loop body +0:37 Loop Terminal Expression +0:37 add second child into first child ( temp highp float) +0:37 'a' ( temp highp float) +0:37 Constant: +0:37 2.000000 +0:38 Sequence +0:38 Sequence +0:38 move second child to first child ( temp highp float) +0:38 'a' ( temp highp float) +0:38 Constant: +0:38 0.000000 +0:38 Loop with condition tested first +0:38 Loop Condition +0:38 Compare Not Equal ( temp bool) +0:38 'a' ( temp highp float) +0:38 Constant: +0:38 20.000000 +0:38 Loop Body +0:38 Sequence +0:38 Test condition and select ( temp void) +0:38 Condition +0:38 Compare Equal ( temp bool) +0:38 'ga' ( global highp int) +0:38 Constant: +0:38 0 (const int) +0:38 true case +0:38 move second child to first child ( temp highp int) +0:38 'ga' ( global highp int) +0:38 Constant: +0:38 4 (const int) +0:38 Loop Terminal Expression +0:38 subtract second child into first child ( temp highp float) +0:38 'a' ( temp highp float) +0:38 Constant: +0:38 2.000000 +0:39 Sequence +0:39 Sequence +0:39 move second child to first child ( temp highp float) +0:39 'a' ( temp highp float) +0:39 Constant: +0:39 0.000000 +0:39 Loop with condition tested first +0:39 Loop Condition +0:39 Compare Equal ( temp bool) +0:39 'a' ( temp highp float) +0:39 Constant: +0:39 20.000000 +0:39 Loop Body +0:39 Sequence +0:39 Sequence +0:39 move second child to first child ( temp highp float) +0:39 'a' ( temp highp float) +0:39 Constant: +0:39 0.000000 +0:39 Loop with condition tested first +0:39 Loop Condition +0:39 Compare Equal ( temp bool) +0:39 'a' ( temp highp float) +0:39 Constant: +0:39 20.000000 +0:39 No loop body +0:39 Loop Terminal Expression +0:39 Post-Decrement ( temp highp float) +0:39 'a' ( temp highp float) +0:39 Loop Terminal Expression +0:39 Post-Decrement ( temp highp float) +0:39 'a' ( temp highp float) +0:40 Sequence +0:40 Sequence +0:40 move second child to first child ( temp highp float) +0:40 'a' ( temp highp float) +0:40 Constant: +0:40 0.000000 +0:40 Loop with condition tested first +0:40 Loop Condition +0:40 Compare Less Than or Equal ( temp bool) +0:40 'a' ( temp highp float) +0:40 Constant: +0:40 20.000000 +0:40 No loop body +0:40 Loop Terminal Expression +0:40 add second child into first child ( temp highp float) +0:40 'a' ( temp highp float) +0:40 Constant: +0:40 2.000000 +0:41 Sequence +0:41 Sequence +0:41 move second child to first child ( temp highp float) +0:41 'a' ( temp highp float) +0:41 Constant: +0:41 0.000000 +0:41 Loop with condition tested first +0:41 Loop Condition +0:41 Compare Less Than or Equal ( temp bool) +0:41 'a' ( temp highp float) +0:41 Constant: +0:41 20.000000 +0:41 No loop body +0:41 Loop Terminal Expression +0:41 add second child into first child ( temp highp float) +0:41 'a' ( temp highp float) +0:41 Constant: +0:41 2.000000 +0:42 Sequence +0:42 Sequence +0:42 move second child to first child ( temp highp float) +0:42 'a' ( temp highp float) +0:42 Constant: +0:42 0.000000 +0:42 Loop with condition tested first +0:42 Loop Condition +0:42 Compare Greater Than ( temp bool) +0:42 'a' ( temp highp float) +0:42 Constant: +0:42 40.000000 +0:42 No loop body +0:42 Loop Terminal Expression +0:42 add second child into first child ( temp highp float) +0:42 'a' ( temp highp float) +0:42 Constant: +0:42 2.000000 +0:43 Sequence +0:43 Sequence +0:43 move second child to first child ( temp highp float) +0:43 'a' ( temp highp float) +0:43 Constant: +0:43 0.000000 +0:43 Loop with condition tested first +0:43 Loop Condition +0:43 Compare Greater Than or Equal ( temp bool) +0:43 'a' ( temp highp float) +0:43 Constant: +0:43 20.000000 +0:43 Loop Body +0:43 Function Call: foo(f1; ( global void) +0:43 'a' ( temp highp float) +0:43 Loop Terminal Expression +0:43 add second child into first child ( temp highp float) +0:43 'a' ( temp highp float) +0:43 Constant: +0:43 2.000000 +0:47 indirect index ( temp lowp sampler2D) +0:47 'fsa' ( uniform 3-element array of lowp sampler2D) +0:47 'ga' ( global highp int) +0:48 indirect index ( temp highp float) +0:48 'fua' ( uniform 10-element array of highp float) +0:48 'ga' ( global highp int) +0:49 indirect index ( temp highp 3-component vector of float) +0:49 'am3' ( in highp 3X3 matrix of float) +0:49 'ga' ( global highp int) +0:50 indirect index ( temp highp float) +0:50 'av2' ( in highp 2-component vector of float) +0:50 'ga' ( global highp int) +0:51 indirect index ( smooth temp highp 4-component vector of float) +0:51 'va' ( smooth out 4-element array of highp 4-component vector of float) +0:51 add ( temp highp int) +0:51 Constant: +0:51 2 (const int) +0:51 'ga' ( global highp int) +0:52 indirect index ( temp highp 2-component vector of float) +0:52 Constant: +0:52 1.000000 +0:52 0.000000 +0:52 0.000000 +0:52 1.000000 +0:52 'ga' ( global highp int) +0:53 indirect index ( temp highp float) +0:53 Constant: +0:53 2.000000 +0:53 2.000000 +0:53 2.000000 +0:53 divide ( temp highp int) +0:53 'ga' ( global highp int) +0:53 Constant: +0:53 2 (const int) +0:54 indirect index ( temp highp int) +0:54 'ia' ( temp 9-element array of highp int) +0:54 'ga' ( global highp int) +0:56 Sequence +0:56 Sequence +0:56 move second child to first child ( temp highp int) +0:56 'a' ( temp highp int) +0:56 Constant: +0:56 3 (const int) +0:56 Loop with condition tested first +0:56 Loop Condition +0:56 Compare Greater Than or Equal ( temp bool) +0:56 'a' ( temp highp int) +0:56 Constant: +0:56 0 (const int) +0:56 Loop Body +0:57 Sequence +0:57 indirect index ( temp lowp sampler2D) +0:57 'fsa' ( uniform 3-element array of lowp sampler2D) +0:57 'a' ( temp highp int) +0:58 indirect index ( temp highp float) +0:58 'fua' ( uniform 10-element array of highp float) +0:58 add ( temp highp int) +0:58 'a' ( temp highp int) +0:58 Constant: +0:58 2 (const int) +0:59 indirect index ( temp highp 3-component vector of float) +0:59 'am3' ( in highp 3X3 matrix of float) +0:59 component-wise multiply ( temp highp int) +0:59 Constant: +0:59 3 (const int) +0:59 'a' ( temp highp int) +0:60 indirect index ( temp highp float) +0:60 'av2' ( in highp 2-component vector of float) +0:60 component-wise multiply ( temp highp int) +0:60 Constant: +0:60 3 (const int) +0:60 'a' ( temp highp int) +0:61 indirect index ( smooth temp highp 4-component vector of float) +0:61 'va' ( smooth out 4-element array of highp 4-component vector of float) +0:61 subtract ( temp highp int) +0:61 'a' ( temp highp int) +0:61 Constant: +0:61 1 (const int) +0:62 indirect index ( temp highp 2-component vector of float) +0:62 Constant: +0:62 1.000000 +0:62 0.000000 +0:62 0.000000 +0:62 1.000000 +0:62 divide ( temp highp int) +0:62 'a' ( temp highp int) +0:62 Constant: +0:62 2 (const int) +0:63 indirect index ( temp highp float) +0:63 Constant: +0:63 2.000000 +0:63 2.000000 +0:63 2.000000 +0:63 'a' ( temp highp int) +0:64 indirect index ( temp highp int) +0:64 'ia' ( temp 9-element array of highp int) +0:64 'a' ( temp highp int) +0:65 indirect index ( temp highp int) +0:65 'ia' ( temp 9-element array of highp int) +0:65 Function Call: bar( ( global highp int) +0:56 Loop Terminal Expression +0:56 Post-Decrement ( temp highp int) +0:56 'a' ( temp highp int) +0:68 direct index ( temp lowp sampler2D) +0:68 'fsa' ( uniform 3-element array of lowp sampler2D) +0:68 Constant: +0:68 2 (const int) +0:69 direct index ( temp highp float) +0:69 'fua' ( uniform 10-element array of highp float) +0:69 Constant: +0:69 3 (const int) +0:70 direct index ( temp highp 3-component vector of float) +0:70 'am3' ( in highp 3X3 matrix of float) +0:70 Constant: +0:70 2 (const int) +0:71 direct index ( temp highp float) +0:71 'av2' ( in highp 2-component vector of float) +0:71 Constant: +0:71 1 (const int) +0:72 direct index ( smooth temp highp 4-component vector of float) +0:72 'va' ( smooth out 4-element array of highp 4-component vector of float) +0:72 Constant: +0:72 1 (const int) +0:73 Constant: +0:73 0.000000 +0:73 1.000000 +0:74 Constant: +0:74 2.000000 +0:75 direct index ( temp highp int) +0:75 'ia' ( temp 9-element array of highp int) +0:75 Constant: +0:75 3 (const int) +0:? Linker Objects +0:? 'ga' ( global highp int) +0:? 'gb' ( global highp int) +0:? 'f' ( global highp float) +0:? 'fsa' ( uniform 3-element array of lowp sampler2D) +0:? 'fua' ( uniform 10-element array of highp float) +0:? 'am3' ( in highp 3X3 matrix of float) +0:? 'av2' ( in highp 2-component vector of float) +0:? 'va' ( smooth out 4-element array of highp 4-component vector of float) +0:? 'm2' ( const highp 2X2 matrix of float) +0:? 1.000000 +0:? 0.000000 +0:? 0.000000 +0:? 1.000000 +0:? 'v3' ( const highp 3-component vector of float) +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 + diff --git a/deps/glslang/Test/baseResults/100LimitsConf.vert.out b/deps/glslang/Test/baseResults/100LimitsConf.vert.out new file mode 100644 index 00000000..46cb8453 --- /dev/null +++ b/deps/glslang/Test/baseResults/100LimitsConf.vert.out @@ -0,0 +1,24 @@ +100Limits.vert +ERROR: 0:24: 'limitation' : while loops not available +ERROR: 0:26: 'limitation' : do-while loops not available +ERROR: 0:28: 'limitations' : inductive-loop init-declaration requires the form "type-specifier loop-index = constant-expression" +ERROR: 0:29: 'limitations' : inductive-loop init-declaration requires the form "type-specifier loop-index = constant-expression" +ERROR: 0:30: 'limitations' : inductive-loop init-declaration requires the form "type-specifier loop-index = constant-expression" +ERROR: 0:31: 'limitations' : inductive-loop init-declaration requires the form "type-specifier loop-index = constant-expression" +ERROR: 0:32: 'limitations' : inductive loop requires a scalar 'int' or 'float' loop index +ERROR: 0:33: 'limitations' : inductive-loop condition requires the form "loop-index constant-expression" +ERROR: 0:34: 'limitations' : inductive-loop termination requires the form "loop-index++, loop-index--, loop-index += constant-expression, or loop-index -= constant-expression" +ERROR: 0:35: 'limitations' : inductive loop index modified +ERROR: 0:36: 'limitations' : inductive loop index modified +ERROR: 0:43: 'limitations' : inductive loop index modified +ERROR: 0:47: 'limitations' : Non-constant-index-expression +ERROR: 0:49: 'limitations' : Non-constant-index-expression +ERROR: 0:50: 'limitations' : Non-constant-index-expression +ERROR: 0:51: 'limitations' : Non-constant-index-expression +ERROR: 0:52: 'limitations' : Non-constant-index-expression +ERROR: 0:53: 'limitations' : Non-constant-index-expression +ERROR: 0:54: 'limitations' : Non-constant-index-expression +ERROR: 0:65: 'limitations' : Non-constant-index-expression +ERROR: 20 compilation errors. No code generated. + + diff --git a/deps/glslang/Test/baseResults/100samplerExternal.frag.out b/deps/glslang/Test/baseResults/100samplerExternal.frag.out new file mode 100644 index 00000000..8b689c76 --- /dev/null +++ b/deps/glslang/Test/baseResults/100samplerExternal.frag.out @@ -0,0 +1,172 @@ +100samplerExternal.frag +ERROR: 0:20: 'textureSize' : no matching overloaded function found +ERROR: 0:21: 'texture' : no matching overloaded function found +ERROR: 0:22: 'texture' : no matching overloaded function found +ERROR: 0:23: 'textureProj' : no matching overloaded function found +ERROR: 0:24: 'textureProj' : no matching overloaded function found +ERROR: 0:25: 'textureProj' : no matching overloaded function found +ERROR: 0:26: 'textureProj' : no matching overloaded function found +ERROR: 0:27: 'texelFetch' : no matching overloaded function found +ERROR: 0:29: 'texture3D' : no matching overloaded function found +ERROR: 0:30: 'texture2DProjLod' : no matching overloaded function found +ERROR: 0:31: 'texture' : no matching overloaded function found +ERROR: 0:32: 'textureProjLod' : no matching overloaded function found +ERROR: 0:38: 'samplerExternalOES' : required extension not requested: GL_OES_EGL_image_external +ERROR: 0:41: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON +ERROR: 14 compilation errors. No code generated. + + +Shader version: 100 +Requested GL_OES_EGL_image_external +Requested GL_OES_EGL_image_external_essl3 +ERROR: node is still EOpNull! +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 texture ( global lowp 4-component vector of float) +0:12 'sExt' ( uniform lowp samplerExternalOES) +0:12 Constant: +0:12 0.200000 +0:12 0.200000 +0:13 texture ( global mediump 4-component vector of float) +0:13 'mediumExt' ( uniform mediump samplerExternalOES) +0:13 Constant: +0:13 0.200000 +0:13 0.200000 +0:14 texture ( global highp 4-component vector of float) +0:14 'highExt' ( uniform highp samplerExternalOES) +0:14 Constant: +0:14 0.200000 +0:14 0.200000 +0:15 textureProj ( global lowp 4-component vector of float) +0:15 'sExt' ( uniform lowp samplerExternalOES) +0:15 Constant: +0:15 0.300000 +0:15 0.300000 +0:15 0.300000 +0:16 textureProj ( global lowp 4-component vector of float) +0:16 'sExt' ( uniform lowp samplerExternalOES) +0:16 Constant: +0:16 0.300000 +0:16 0.300000 +0:16 0.300000 +0:16 0.300000 +0:18 Sequence +0:18 move second child to first child ( temp mediump int) +0:18 'lod' ( temp mediump int) +0:18 Constant: +0:18 0 (const int) +0:19 Sequence +0:19 move second child to first child ( temp highp float) +0:19 'bias' ( temp highp float) +0:19 Constant: +0:19 0.010000 +0:20 Constant: +0:20 0.000000 +0:21 Constant: +0:21 0.000000 +0:22 Constant: +0:22 0.000000 +0:23 Constant: +0:23 0.000000 +0:24 Constant: +0:24 0.000000 +0:25 Constant: +0:25 0.000000 +0:26 Constant: +0:26 0.000000 +0:27 Constant: +0:27 0.000000 +0:29 Constant: +0:29 0.000000 +0:30 Constant: +0:30 0.000000 +0:31 Constant: +0:31 0.000000 +0:32 Constant: +0:32 0.000000 +0:? Linker Objects +0:? 'sExt' ( uniform lowp samplerExternalOES) +0:? 'mediumExt' ( uniform mediump samplerExternalOES) +0:? 'highExt' ( uniform highp samplerExternalOES) +0:? 'badExt' ( uniform mediump samplerExternalOES) + + +Linked fragment stage: + + +Shader version: 100 +Requested GL_OES_EGL_image_external +Requested GL_OES_EGL_image_external_essl3 +ERROR: node is still EOpNull! +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 texture ( global lowp 4-component vector of float) +0:12 'sExt' ( uniform lowp samplerExternalOES) +0:12 Constant: +0:12 0.200000 +0:12 0.200000 +0:13 texture ( global mediump 4-component vector of float) +0:13 'mediumExt' ( uniform mediump samplerExternalOES) +0:13 Constant: +0:13 0.200000 +0:13 0.200000 +0:14 texture ( global highp 4-component vector of float) +0:14 'highExt' ( uniform highp samplerExternalOES) +0:14 Constant: +0:14 0.200000 +0:14 0.200000 +0:15 textureProj ( global lowp 4-component vector of float) +0:15 'sExt' ( uniform lowp samplerExternalOES) +0:15 Constant: +0:15 0.300000 +0:15 0.300000 +0:15 0.300000 +0:16 textureProj ( global lowp 4-component vector of float) +0:16 'sExt' ( uniform lowp samplerExternalOES) +0:16 Constant: +0:16 0.300000 +0:16 0.300000 +0:16 0.300000 +0:16 0.300000 +0:18 Sequence +0:18 move second child to first child ( temp mediump int) +0:18 'lod' ( temp mediump int) +0:18 Constant: +0:18 0 (const int) +0:19 Sequence +0:19 move second child to first child ( temp highp float) +0:19 'bias' ( temp highp float) +0:19 Constant: +0:19 0.010000 +0:20 Constant: +0:20 0.000000 +0:21 Constant: +0:21 0.000000 +0:22 Constant: +0:22 0.000000 +0:23 Constant: +0:23 0.000000 +0:24 Constant: +0:24 0.000000 +0:25 Constant: +0:25 0.000000 +0:26 Constant: +0:26 0.000000 +0:27 Constant: +0:27 0.000000 +0:29 Constant: +0:29 0.000000 +0:30 Constant: +0:30 0.000000 +0:31 Constant: +0:31 0.000000 +0:32 Constant: +0:32 0.000000 +0:? Linker Objects +0:? 'sExt' ( uniform lowp samplerExternalOES) +0:? 'mediumExt' ( uniform mediump samplerExternalOES) +0:? 'highExt' ( uniform highp samplerExternalOES) +0:? 'badExt' ( uniform mediump samplerExternalOES) + diff --git a/deps/glslang/Test/baseResults/100scope.vert.out b/deps/glslang/Test/baseResults/100scope.vert.out new file mode 100644 index 00000000..c59c8fd7 --- /dev/null +++ b/deps/glslang/Test/baseResults/100scope.vert.out @@ -0,0 +1,228 @@ +100scope.vert +ERROR: 0:5: 'a' : redefinition +ERROR: 0:17: 'b' : function name is redeclaration of existing name +ERROR: 0:20: 'c' : redefinition +ERROR: 0:22: 'f' : redefinition +ERROR: 0:24: 'redefinition of built-in function' : not supported with this profile: es +ERROR: 0:24: 'highp' : overloaded functions must have the same parameter precision qualifiers for argument 1 +ERROR: 0:25: 'redefinition of built-in function' : not supported with this profile: es +ERROR: 0:25: 'highp' : overloaded functions must have the same parameter precision qualifiers for argument 1 +ERROR: 0:38: 'local function declaration' : not supported with this profile: es +ERROR: 0:43: 'sin' : can't use function syntax on variable +ERROR: 0:57: 'z' : undeclared identifier +ERROR: 0:57: 'z' : redefinition +ERROR: 0:73: 'degrees' : can't use function syntax on variable +ERROR: 0:76: 'vertex-shader struct output' : not supported for this version or the enabled extensions +ERROR: 14 compilation errors. No code generated. + + +Shader version: 100 +ERROR: node is still EOpNull! +0:3 Function Definition: f(i1;i1;i1; ( global highp int) +0:3 Function Parameters: +0:3 'a' ( in highp int) +0:3 'b' ( in highp int) +0:3 'c' ( in highp int) +0:? Sequence +0:8 Sequence +0:8 Sequence +0:8 move second child to first child ( temp highp float) +0:8 'a' ( temp highp float) +0:8 add ( temp highp float) +0:8 Convert int to float ( temp highp float) +0:8 'a' ( in highp int) +0:8 Constant: +0:8 1.000000 +0:11 Branch: Return with expression +0:11 'a' ( in highp int) +0:25 Function Definition: cos(f1; ( global highp float) +0:25 Function Parameters: +0:25 'x' ( in highp float) +0:27 Sequence +0:27 Branch: Return with expression +0:27 Constant: +0:27 1.000000 +0:29 Function Definition: radians(b1; ( global bool) +0:29 Function Parameters: +0:29 'x' ( in bool) +0:31 Sequence +0:31 Branch: Return with expression +0:31 Constant: +0:31 true (const bool) +0:36 Function Definition: main( ( global void) +0:36 Function Parameters: +0:? Sequence +0:39 Function Call: g( ( temp highp int) +0:42 'sin' ( temp highp float) +0:43 Constant: +0:43 0.000000 +0:44 Function Call: f(i1;i1;i1; ( global highp int) +0:44 Constant: +0:44 1 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 Constant: +0:44 3 (const int) +0:47 move second child to first child ( temp highp float) +0:47 'f' ( temp highp float) +0:47 Constant: +0:47 3.000000 +0:49 move second child to first child ( temp highp 4-component vector of float) +0:49 'gl_Position' ( invariant gl_Position highp 4-component vector of float Position) +0:49 Construct vec4 ( temp highp 4-component vector of float) +0:49 'f' ( temp highp float) +0:51 Sequence +0:51 Sequence +0:51 move second child to first child ( temp highp int) +0:51 'f' ( temp highp int) +0:51 Constant: +0:51 0 (const int) +0:51 Loop with condition tested first +0:51 Loop Condition +0:51 Compare Less Than ( temp bool) +0:51 'f' ( temp highp int) +0:51 Constant: +0:51 10 (const int) +0:51 Loop Body +0:52 Pre-Increment ( temp highp int) +0:52 'f' ( temp highp int) +0:51 Loop Terminal Expression +0:51 Pre-Increment ( temp highp int) +0:51 'f' ( temp highp int) +0:54 Sequence +0:54 move second child to first child ( temp highp int) +0:54 'x' ( temp highp int) +0:54 Constant: +0:54 1 (const int) +0:56 Sequence +0:56 Sequence +0:56 move second child to first child ( temp highp float) +0:56 'x' ( temp highp float) +0:56 Constant: +0:56 2.000000 +0:56 move second child to first child ( temp highp float) +0:56 'y' ( temp highp float) +0:56 'x' ( temp highp float) +0:60 Sequence +0:60 Sequence +0:60 move second child to first child ( temp highp int) +0:60 'x' ( temp highp int) +0:60 'x' ( temp highp int) +0:68 Sequence +0:68 Sequence +0:68 move second child to first child ( temp structure{ temp highp int x}) +0:68 'S' ( temp structure{ temp highp int x}) +0:68 Constant: +0:68 0 (const int) +0:69 x: direct index for structure ( temp highp int) +0:69 'S' ( temp structure{ temp highp int x}) +0:69 Constant: +0:69 0 (const int) +0:73 Constant: +0:73 0.000000 +0:? Linker Objects +0:? 'b' ( global bool) +0:? 'tan' ( global highp float) +0:? 's' ( smooth out structure{ global highp float f}) + + +Linked vertex stage: + +ERROR: Linking vertex stage: No function definition (body) found: + g( + +Shader version: 100 +ERROR: node is still EOpNull! +0:3 Function Definition: f(i1;i1;i1; ( global highp int) +0:3 Function Parameters: +0:3 'a' ( in highp int) +0:3 'b' ( in highp int) +0:3 'c' ( in highp int) +0:? Sequence +0:8 Sequence +0:8 Sequence +0:8 move second child to first child ( temp highp float) +0:8 'a' ( temp highp float) +0:8 add ( temp highp float) +0:8 Convert int to float ( temp highp float) +0:8 'a' ( in highp int) +0:8 Constant: +0:8 1.000000 +0:11 Branch: Return with expression +0:11 'a' ( in highp int) +0:36 Function Definition: main( ( global void) +0:36 Function Parameters: +0:? Sequence +0:39 Function Call: g( ( temp highp int) +0:42 'sin' ( temp highp float) +0:43 Constant: +0:43 0.000000 +0:44 Function Call: f(i1;i1;i1; ( global highp int) +0:44 Constant: +0:44 1 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 Constant: +0:44 3 (const int) +0:47 move second child to first child ( temp highp float) +0:47 'f' ( temp highp float) +0:47 Constant: +0:47 3.000000 +0:49 move second child to first child ( temp highp 4-component vector of float) +0:49 'gl_Position' ( invariant gl_Position highp 4-component vector of float Position) +0:49 Construct vec4 ( temp highp 4-component vector of float) +0:49 'f' ( temp highp float) +0:51 Sequence +0:51 Sequence +0:51 move second child to first child ( temp highp int) +0:51 'f' ( temp highp int) +0:51 Constant: +0:51 0 (const int) +0:51 Loop with condition tested first +0:51 Loop Condition +0:51 Compare Less Than ( temp bool) +0:51 'f' ( temp highp int) +0:51 Constant: +0:51 10 (const int) +0:51 Loop Body +0:52 Pre-Increment ( temp highp int) +0:52 'f' ( temp highp int) +0:51 Loop Terminal Expression +0:51 Pre-Increment ( temp highp int) +0:51 'f' ( temp highp int) +0:54 Sequence +0:54 move second child to first child ( temp highp int) +0:54 'x' ( temp highp int) +0:54 Constant: +0:54 1 (const int) +0:56 Sequence +0:56 Sequence +0:56 move second child to first child ( temp highp float) +0:56 'x' ( temp highp float) +0:56 Constant: +0:56 2.000000 +0:56 move second child to first child ( temp highp float) +0:56 'y' ( temp highp float) +0:56 'x' ( temp highp float) +0:60 Sequence +0:60 Sequence +0:60 move second child to first child ( temp highp int) +0:60 'x' ( temp highp int) +0:60 'x' ( temp highp int) +0:68 Sequence +0:68 Sequence +0:68 move second child to first child ( temp structure{ temp highp int x}) +0:68 'S' ( temp structure{ temp highp int x}) +0:68 Constant: +0:68 0 (const int) +0:69 x: direct index for structure ( temp highp int) +0:69 'S' ( temp structure{ temp highp int x}) +0:69 Constant: +0:69 0 (const int) +0:73 Constant: +0:73 0.000000 +0:? Linker Objects +0:? 'b' ( global bool) +0:? 'tan' ( global highp float) +0:? 's' ( smooth out structure{ global highp float f}) + diff --git a/deps/glslang/Test/baseResults/110scope.vert.out b/deps/glslang/Test/baseResults/110scope.vert.out new file mode 100644 index 00000000..e23d3c0f --- /dev/null +++ b/deps/glslang/Test/baseResults/110scope.vert.out @@ -0,0 +1,276 @@ +110scope.vert +ERROR: 0:5: 'a' : redefinition +ERROR: 0:57: 'z' : undeclared identifier +ERROR: 0:57: 'z' : redefinition +ERROR: 0:83: 'S' : redefinition struct +ERROR: 4 compilation errors. No code generated. + + +Shader version: 110 +ERROR: node is still EOpNull! +0:3 Function Definition: f(i1;i1;i1; ( global int) +0:3 Function Parameters: +0:3 'a' ( in int) +0:3 'b' ( in int) +0:3 'c' ( in int) +0:? Sequence +0:8 Sequence +0:8 Sequence +0:8 move second child to first child ( temp float) +0:8 'a' ( temp float) +0:8 add ( temp float) +0:8 Convert int to float ( temp float) +0:8 'a' ( in int) +0:8 Constant: +0:8 1.000000 +0:11 Branch: Return with expression +0:11 'a' ( in int) +0:25 Function Definition: cos(f1; ( global float) +0:25 Function Parameters: +0:25 'x' ( in float) +0:27 Sequence +0:27 Branch: Return with expression +0:27 Constant: +0:27 1.000000 +0:29 Function Definition: radians(b1; ( global bool) +0:29 Function Parameters: +0:29 'x' ( in bool) +0:31 Sequence +0:31 Branch: Return with expression +0:31 Constant: +0:31 true (const bool) +0:34 Sequence +0:34 move second child to first child ( temp int) +0:34 'gi' ( global int) +0:34 Function Call: f(i1;i1;i1; ( global int) +0:34 Constant: +0:34 1 (const int) +0:34 Constant: +0:34 2 (const int) +0:34 Constant: +0:34 3 (const int) +0:36 Function Definition: main( ( global void) +0:36 Function Parameters: +0:? Sequence +0:39 Function Call: g( ( temp int) +0:42 'sin' ( temp float) +0:43 Function Call: sin(f1; ( global float) +0:43 Constant: +0:43 0.700000 +0:44 Function Call: f(i1;i1;i1; ( global int) +0:44 Constant: +0:44 1 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 Constant: +0:44 3 (const int) +0:47 move second child to first child ( temp float) +0:47 'f' ( temp float) +0:47 Constant: +0:47 3.000000 +0:49 move second child to first child ( temp 4-component vector of float) +0:49 'gl_Position' ( gl_Position 4-component vector of float Position) +0:49 Construct vec4 ( temp 4-component vector of float) +0:49 'f' ( temp float) +0:51 Sequence +0:51 Sequence +0:51 move second child to first child ( temp int) +0:51 'f' ( temp int) +0:51 Constant: +0:51 0 (const int) +0:51 Loop with condition tested first +0:51 Loop Condition +0:51 Compare Less Than ( temp bool) +0:51 'f' ( temp int) +0:51 Constant: +0:51 10 (const int) +0:51 Loop Body +0:52 Pre-Increment ( temp int) +0:52 'f' ( temp int) +0:51 Loop Terminal Expression +0:51 Pre-Increment ( temp int) +0:51 'f' ( temp int) +0:54 Sequence +0:54 move second child to first child ( temp int) +0:54 'x' ( temp int) +0:54 Constant: +0:54 1 (const int) +0:56 Sequence +0:56 Sequence +0:56 move second child to first child ( temp float) +0:56 'x' ( temp float) +0:56 Constant: +0:56 2.000000 +0:56 move second child to first child ( temp float) +0:56 'y' ( temp float) +0:56 'x' ( temp float) +0:60 Sequence +0:60 Sequence +0:60 move second child to first child ( temp int) +0:60 'x' ( temp int) +0:60 'x' ( temp int) +0:68 Sequence +0:68 Sequence +0:68 move second child to first child ( temp structure{ temp int x}) +0:68 'S' ( temp structure{ temp int x}) +0:68 Constant: +0:68 0 (const int) +0:69 x: direct index for structure ( temp int) +0:69 'S' ( temp structure{ temp int x}) +0:69 Constant: +0:69 0 (const int) +0:73 Constant: +0:73 183.346494 +0:? Sequence +0:77 move second child to first child ( temp int) +0:77 x: direct index for structure ( temp int) +0:77 's' ( temp structure{ temp int x}) +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 3 (const int) +0:82 move second child to first child ( temp bool) +0:82 b: direct index for structure ( temp bool) +0:82 't' ( temp structure{ temp bool b}) +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 true (const bool) +0:? Linker Objects +0:? 'b' ( global bool) +0:? 'c' ( global bool) +0:? 'f' ( global float) +0:? 'tan' ( global float) +0:? 'gi' ( global int) + + +Linked vertex stage: + +ERROR: Linking vertex stage: No function definition (body) found: + sin(f1; +ERROR: Linking vertex stage: No function definition (body) found: + g( + +Shader version: 110 +ERROR: node is still EOpNull! +0:3 Function Definition: f(i1;i1;i1; ( global int) +0:3 Function Parameters: +0:3 'a' ( in int) +0:3 'b' ( in int) +0:3 'c' ( in int) +0:? Sequence +0:8 Sequence +0:8 Sequence +0:8 move second child to first child ( temp float) +0:8 'a' ( temp float) +0:8 add ( temp float) +0:8 Convert int to float ( temp float) +0:8 'a' ( in int) +0:8 Constant: +0:8 1.000000 +0:11 Branch: Return with expression +0:11 'a' ( in int) +0:34 Sequence +0:34 move second child to first child ( temp int) +0:34 'gi' ( global int) +0:34 Function Call: f(i1;i1;i1; ( global int) +0:34 Constant: +0:34 1 (const int) +0:34 Constant: +0:34 2 (const int) +0:34 Constant: +0:34 3 (const int) +0:36 Function Definition: main( ( global void) +0:36 Function Parameters: +0:? Sequence +0:39 Function Call: g( ( temp int) +0:42 'sin' ( temp float) +0:43 Function Call: sin(f1; ( global float) +0:43 Constant: +0:43 0.700000 +0:44 Function Call: f(i1;i1;i1; ( global int) +0:44 Constant: +0:44 1 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 Constant: +0:44 3 (const int) +0:47 move second child to first child ( temp float) +0:47 'f' ( temp float) +0:47 Constant: +0:47 3.000000 +0:49 move second child to first child ( temp 4-component vector of float) +0:49 'gl_Position' ( gl_Position 4-component vector of float Position) +0:49 Construct vec4 ( temp 4-component vector of float) +0:49 'f' ( temp float) +0:51 Sequence +0:51 Sequence +0:51 move second child to first child ( temp int) +0:51 'f' ( temp int) +0:51 Constant: +0:51 0 (const int) +0:51 Loop with condition tested first +0:51 Loop Condition +0:51 Compare Less Than ( temp bool) +0:51 'f' ( temp int) +0:51 Constant: +0:51 10 (const int) +0:51 Loop Body +0:52 Pre-Increment ( temp int) +0:52 'f' ( temp int) +0:51 Loop Terminal Expression +0:51 Pre-Increment ( temp int) +0:51 'f' ( temp int) +0:54 Sequence +0:54 move second child to first child ( temp int) +0:54 'x' ( temp int) +0:54 Constant: +0:54 1 (const int) +0:56 Sequence +0:56 Sequence +0:56 move second child to first child ( temp float) +0:56 'x' ( temp float) +0:56 Constant: +0:56 2.000000 +0:56 move second child to first child ( temp float) +0:56 'y' ( temp float) +0:56 'x' ( temp float) +0:60 Sequence +0:60 Sequence +0:60 move second child to first child ( temp int) +0:60 'x' ( temp int) +0:60 'x' ( temp int) +0:68 Sequence +0:68 Sequence +0:68 move second child to first child ( temp structure{ temp int x}) +0:68 'S' ( temp structure{ temp int x}) +0:68 Constant: +0:68 0 (const int) +0:69 x: direct index for structure ( temp int) +0:69 'S' ( temp structure{ temp int x}) +0:69 Constant: +0:69 0 (const int) +0:73 Constant: +0:73 183.346494 +0:? Sequence +0:77 move second child to first child ( temp int) +0:77 x: direct index for structure ( temp int) +0:77 's' ( temp structure{ temp int x}) +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 3 (const int) +0:82 move second child to first child ( temp bool) +0:82 b: direct index for structure ( temp bool) +0:82 't' ( temp structure{ temp bool b}) +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 true (const bool) +0:? Linker Objects +0:? 'b' ( global bool) +0:? 'c' ( global bool) +0:? 'f' ( global float) +0:? 'tan' ( global float) +0:? 'gi' ( global int) + diff --git a/deps/glslang/Test/baseResults/120.frag.out b/deps/glslang/Test/baseResults/120.frag.out new file mode 100644 index 00000000..8909f16f --- /dev/null +++ b/deps/glslang/Test/baseResults/120.frag.out @@ -0,0 +1,698 @@ +120.frag +ERROR: 0:9: 'in for stage inputs' : not supported for this version or the enabled extensions +ERROR: 0:10: 'out for stage outputs' : not supported for this version or the enabled extensions +ERROR: 0:54: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type ' temp 2-component vector of float' and a right operand of type ' temp 3-component vector of float' (or there is no acceptable conversion) +ERROR: 0:55: '*' : wrong operand types: no operation '*' exists that takes a left-hand operand of type ' uniform 4X2 matrix of float' and a right operand of type ' temp 3-component vector of float' (or there is no acceptable conversion) +ERROR: 0:56: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type ' uniform 4X2 matrix of float' and a right operand of type ' smooth in 4-component vector of float' (or there is no acceptable conversion) +ERROR: 0:57: '=' : cannot convert from ' const float' to ' temp int' +ERROR: 0:58: 'assign' : cannot convert from ' temp bool' to ' temp float' +ERROR: 0:59: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type ' temp int' and a right operand of type ' temp bool' (or there is no acceptable conversion) +ERROR: 0:60: '*' : wrong operand types: no operation '*' exists that takes a left-hand operand of type ' temp bool' and a right operand of type ' temp int' (or there is no acceptable conversion) +ERROR: 0:60: 'assign' : cannot convert from ' temp bool' to ' temp float' +ERROR: 0:61: 'assign' : cannot convert from ' temp int' to ' temp bool' +ERROR: 0:62: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type ' temp bool' and a right operand of type ' temp float' (or there is no acceptable conversion) +ERROR: 0:63: 'bitwise-or assign' : not supported for this version or the enabled extensions +ERROR: 0:63: 'assign' : cannot convert from ' temp bool' to ' temp float' +ERROR: 0:79: ':' : wrong operand types: no operation ':' exists that takes a left-hand operand of type ' temp 4-component vector of float' and a right operand of type ' temp 4X4 matrix of float' (or there is no acceptable conversion) +ERROR: 0:79: 'assign' : cannot convert from ' temp 4X4 matrix of float' to ' fragColor 4-component vector of float FragColor' +ERROR: 0:82: 'xr' : vector swizzle selectors not from the same set +ERROR: 0:83: 'xyxyx' : vector swizzle too long +ERROR: 0:84: 'z' : vector swizzle selection out of range +ERROR: 0:85: 'assign' : l-value required +ERROR: 0:91: 'main' : overloaded functions must have the same return type +ERROR: 0:91: 'main' : function already has a body +ERROR: 0:91: 'int' : entry point cannot return a value +ERROR: 0:92: 'main' : function cannot take any parameter(s) +ERROR: 0:94: 'a' : variables with qualifier 'const' must be initialized +ERROR: 0:97: 'out' : overloaded functions must have the same parameter storage qualifiers for argument 1 +ERROR: 0:99: 'return' : type does not match, or is not convertible to, the function's return type +ERROR: 0:115: 'return' : void function cannot return a value +ERROR: 0:125: 'gl_TexCoord' : redeclaration of array with size +ERROR: 0:152: 'matrixCompMult' : no matching overloaded function found +ERROR: 0:152: '=' : cannot convert from ' const float' to ' temp 3X2 matrix of float' +ERROR: 0:153: 'matrixCompMult' : no matching overloaded function found +ERROR: 0:153: '=' : cannot convert from ' const float' to ' temp 3X4 matrix of float' +ERROR: 0:160: 'constructor' : not enough data provided for construction +ERROR: 0:160: '=' : cannot convert from ' const float' to ' temp 4X4 matrix of float' +ERROR: 0:161: 'constructor' : too many arguments +ERROR: 0:161: '=' : cannot convert from ' const float' to ' temp 4X4 matrix of float' +ERROR: 0:165: 'constructor' : matrix constructed from matrix can only have one argument +ERROR: 0:166: 'constructor' : matrix constructed from matrix can only have one argument +ERROR: 0:172: 'constructor' : array constructor needs one argument per array element +ERROR: 0:172: '=' : cannot convert from ' const float' to ' temp 2-element array of 3X3 matrix of float' +ERROR: 0:184: 'texture2DLod' : required extension not requested: GL_ARB_shader_texture_lod +ERROR: 0:185: 'texture3DProjLod' : required extension not requested: GL_ARB_shader_texture_lod +ERROR: 0:186: 'texture1DProjLod' : required extension not requested: GL_ARB_shader_texture_lod +ERROR: 0:187: 'shadow2DProjLod' : required extension not requested: GL_ARB_shader_texture_lod +ERROR: 0:189: 'texture1DGradARB' : required extension not requested: GL_ARB_shader_texture_lod +ERROR: 0:190: 'texture2DProjGradARB' : required extension not requested: GL_ARB_shader_texture_lod +ERROR: 0:191: 'shadow2DProjGradARB' : required extension not requested: GL_ARB_shader_texture_lod +ERROR: 0:209: 'shadow2DRectProjGradARB' : no matching overloaded function found +ERROR: 0:209: 'assign' : cannot convert from ' const float' to ' temp 4-component vector of float' +ERROR: 0:212: 'sampler2DRect' : Reserved word. +ERROR: 0:244: ':' : wrong operand types: no operation ':' exists that takes a left-hand operand of type ' global void' and a right operand of type ' const int' (or there is no acceptable conversion) +ERROR: 0:245: ':' : wrong operand types: no operation ':' exists that takes a left-hand operand of type ' const int' and a right operand of type ' global void' (or there is no acceptable conversion) +ERROR: 0:248: 'half floating-point suffix' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:248: '' : syntax error, unexpected IDENTIFIER, expecting COMMA or SEMICOLON +ERROR: 55 compilation errors. No code generated. + + +Shader version: 120 +Requested GL_ARB_shader_texture_lod +Requested GL_ARB_texture_rectangle +ERROR: node is still EOpNull! +0:21 Function Definition: main( ( global void) +0:21 Function Parameters: +0:23 Sequence +0:23 Sequence +0:23 move second child to first child ( temp 2X3 matrix of float) +0:23 'm23' ( temp 2X3 matrix of float) +0:23 Construct mat2x3 ( temp 2X3 matrix of float) +0:23 'm' ( uniform 4X2 matrix of float) +0:27 Sequence +0:27 move second child to first child ( temp structure{ global float f}) +0:27 'sv' ( temp structure{ global float f}) +0:27 Construct structure ( temp structure{ global float f}) +0:27 Convert int to float ( temp float) +0:27 'a' ( temp int) +0:28 Sequence +0:28 move second child to first child ( temp 2-element array of float) +0:28 'ia' ( temp 2-element array of float) +0:28 Construct float ( temp 2-element array of float) +0:28 Constant: +0:28 3.000000 +0:28 direct index ( temp float) +0:28 'i' ( smooth in 4-component vector of float) +0:28 Constant: +0:28 1 (const int) +0:29 Sequence +0:29 move second child to first child ( temp float) +0:29 'f1' ( temp float) +0:29 Constant: +0:29 1.000000 +0:30 Sequence +0:30 move second child to first child ( temp float) +0:30 'f' ( temp float) +0:30 Convert int to float ( temp float) +0:30 'a' ( temp int) +0:31 move second child to first child ( temp float) +0:31 'f' ( temp float) +0:31 Convert int to float ( temp float) +0:31 'a' ( temp int) +0:33 Sequence +0:33 move second child to first child ( temp 3-component vector of float) +0:33 'v3' ( temp 3-component vector of float) +0:33 Convert int to float ( temp 3-component vector of float) +0:33 'iv3' ( temp 3-component vector of int) +0:34 move second child to first child ( temp float) +0:34 'f' ( temp float) +0:34 add ( temp float) +0:34 'f' ( temp float) +0:34 Convert int to float ( temp float) +0:34 'a' ( temp int) +0:35 move second child to first child ( temp float) +0:35 'f' ( temp float) +0:35 subtract ( temp float) +0:35 Convert int to float ( temp float) +0:35 'a' ( temp int) +0:35 'f' ( temp float) +0:36 add second child into first child ( temp float) +0:36 'f' ( temp float) +0:36 Convert int to float ( temp float) +0:36 'a' ( temp int) +0:37 move second child to first child ( temp float) +0:37 'f' ( temp float) +0:37 subtract ( temp float) +0:37 Convert int to float ( temp float) +0:37 'a' ( temp int) +0:37 'f' ( temp float) +0:38 multiply second child into first child ( temp 3-component vector of float) +0:38 'v3' ( temp 3-component vector of float) +0:38 Convert int to float ( temp 3-component vector of float) +0:38 'iv3' ( temp 3-component vector of int) +0:39 move second child to first child ( temp 3-component vector of float) +0:39 'v3' ( temp 3-component vector of float) +0:39 divide ( temp 3-component vector of float) +0:39 Convert int to float ( temp 3-component vector of float) +0:39 'iv3' ( temp 3-component vector of int) +0:39 Constant: +0:39 2.000000 +0:40 move second child to first child ( temp 3-component vector of float) +0:40 'v3' ( temp 3-component vector of float) +0:40 vector-scale ( temp 3-component vector of float) +0:40 Constant: +0:40 3.000000 +0:40 Convert int to float ( temp 3-component vector of float) +0:40 'iv3' ( temp 3-component vector of int) +0:41 move second child to first child ( temp 3-component vector of float) +0:41 'v3' ( temp 3-component vector of float) +0:41 vector-scale ( temp 3-component vector of float) +0:41 Constant: +0:41 2.000000 +0:41 'v3' ( temp 3-component vector of float) +0:42 move second child to first child ( temp 3-component vector of float) +0:42 'v3' ( temp 3-component vector of float) +0:42 subtract ( temp 3-component vector of float) +0:42 'v3' ( temp 3-component vector of float) +0:42 Constant: +0:42 2.000000 +0:43 Test condition and select ( temp void) +0:43 Condition +0:47 logical-or ( temp bool) +0:46 logical-or ( temp bool) +0:45 logical-or ( temp bool) +0:44 logical-or ( temp bool) +0:43 logical-or ( temp bool) +0:43 Compare Less Than ( temp bool) +0:43 'f' ( temp float) +0:43 Convert int to float ( temp float) +0:43 'a' ( temp int) +0:44 Compare Less Than or Equal ( temp bool) +0:44 Convert int to float ( temp float) +0:44 'a' ( temp int) +0:44 'f' ( temp float) +0:45 Compare Greater Than ( temp bool) +0:45 'f' ( temp float) +0:45 Convert int to float ( temp float) +0:45 'a' ( temp int) +0:46 Compare Greater Than or Equal ( temp bool) +0:46 'f' ( temp float) +0:46 Convert int to float ( temp float) +0:46 'a' ( temp int) +0:47 Compare Equal ( temp bool) +0:47 Convert int to float ( temp float) +0:47 'a' ( temp int) +0:47 'f' ( temp float) +0:48 Compare Not Equal ( temp bool) +0:48 'f' ( temp float) +0:48 Convert int to float ( temp float) +0:48 'a' ( temp int) +0:43 true case is null +0:49 move second child to first child ( temp float) +0:49 'f' ( temp float) +0:49 Test condition and select ( temp float) +0:49 Condition +0:49 'b' ( temp bool) +0:49 true case +0:49 Convert int to float ( temp float) +0:49 'a' ( temp int) +0:49 false case +0:49 'f' ( temp float) +0:50 move second child to first child ( temp float) +0:50 'f' ( temp float) +0:50 Test condition and select ( temp float) +0:50 Condition +0:50 'b' ( temp bool) +0:50 true case +0:50 'f' ( temp float) +0:50 false case +0:50 Convert int to float ( temp float) +0:50 'a' ( temp int) +0:51 move second child to first child ( temp float) +0:51 'f' ( temp float) +0:51 Convert int to float ( temp float) +0:51 Test condition and select ( temp int) +0:51 Condition +0:51 'b' ( temp bool) +0:51 true case +0:51 'a' ( temp int) +0:51 false case +0:51 'a' ( temp int) +0:52 Sequence +0:52 move second child to first child ( temp structure{ global float f}) +0:52 'news' ( temp structure{ global float f}) +0:52 'sv' ( temp structure{ global float f}) +0:54 vector swizzle ( temp 2-component vector of float) +0:54 'i' ( smooth in 4-component vector of float) +0:54 Sequence +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 1 (const int) +0:55 'm' ( uniform 4X2 matrix of float) +0:56 'm' ( uniform 4X2 matrix of float) +0:58 'f' ( temp float) +0:59 move second child to first child ( temp float) +0:59 'f' ( temp float) +0:59 Convert int to float ( temp float) +0:59 'a' ( temp int) +0:60 'f' ( temp float) +0:61 'b' ( temp bool) +0:62 move second child to first child ( temp bool) +0:62 'b' ( temp bool) +0:62 'b' ( temp bool) +0:63 'f' ( temp float) +0:65 move second child to first child ( temp 4-component vector of float) +0:65 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:65 texture ( global 4-component vector of float) +0:65 's2D' ( uniform sampler2D) +0:65 'centTexCoord' ( centroid smooth in 2-component vector of float) +0:? Sequence +0:79 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:82 direct index ( temp float) +0:82 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:82 Constant: +0:82 0 (const int) +0:83 vector swizzle ( temp 2-component vector of float) +0:83 vector swizzle ( temp 4-component vector of float) +0:83 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:83 Sequence +0:83 Constant: +0:83 0 (const int) +0:83 Constant: +0:83 1 (const int) +0:83 Constant: +0:83 0 (const int) +0:83 Constant: +0:83 1 (const int) +0:83 Sequence +0:83 Constant: +0:83 0 (const int) +0:83 Constant: +0:83 1 (const int) +0:84 direct index ( temp float) +0:84 'centTexCoord' ( centroid smooth in 2-component vector of float) +0:84 Constant: +0:84 0 (const int) +0:85 move second child to first child ( temp bool) +0:85 Comma ( temp bool) +0:85 'a' ( temp int) +0:85 'b' ( temp bool) +0:85 Constant: +0:85 true (const bool) +0:91 Function Definition: main( ( global int) +0:91 Function Parameters: +0:92 Function Definition: main(i1; ( global void) +0:92 Function Parameters: +0:92 'a' ( in int) +0:97 Function Definition: foo(f1; ( global int) +0:97 Function Parameters: +0:97 'a' ( out float) +0:99 Sequence +0:99 Branch: Return with expression +0:99 Constant: +0:99 3.200000 +0:100 Function Call: foo(f1; ( global int) +0:100 'a' ( out float) +0:103 Function Definition: gen(vf3; ( global bool) +0:103 Function Parameters: +0:103 'v' ( in 3-component vector of float) +0:105 Sequence +0:105 Test condition and select ( temp void) +0:105 Condition +0:105 logical-and ( temp bool) +0:105 Compare Less Than ( temp bool) +0:105 Absolute value ( global float) +0:105 direct index ( temp float) +0:105 'v' ( in 3-component vector of float) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 0.000100 +0:105 Compare Less Than ( temp bool) +0:105 Absolute value ( global float) +0:105 direct index ( temp float) +0:105 'v' ( in 3-component vector of float) +0:105 Constant: +0:105 1 (const int) +0:105 Constant: +0:105 0.000100 +0:105 true case +0:106 Branch: Return with expression +0:106 Constant: +0:106 true (const bool) +0:109 Function Definition: v1( ( global void) +0:109 Function Parameters: +0:113 Function Definition: v2( ( global void) +0:113 Function Parameters: +0:115 Sequence +0:115 Branch: Return +0:118 Function Definition: atest( ( global void) +0:118 Function Parameters: +0:120 Sequence +0:120 Sequence +0:120 move second child to first child ( temp 4-component vector of float) +0:120 'v' ( temp 4-component vector of float) +0:120 direct index ( smooth temp 4-component vector of float TexCoord) +0:120 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:120 Constant: +0:120 1 (const int) +0:121 add second child into first child ( temp 4-component vector of float) +0:121 'v' ( temp 4-component vector of float) +0:121 direct index ( smooth temp 4-component vector of float TexCoord) +0:121 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:121 Constant: +0:121 3 (const int) +0:139 Function Definition: foo123( ( global void) +0:139 Function Parameters: +0:141 Sequence +0:141 Sequence +0:141 move second child to first child ( temp 2X2 matrix of float) +0:141 'r2' ( temp 2X2 matrix of float) +0:141 component-wise multiply ( global 2X2 matrix of float) +0:141 'm22' ( global 2X2 matrix of float) +0:141 'm22' ( global 2X2 matrix of float) +0:142 Sequence +0:142 move second child to first child ( temp 3X3 matrix of float) +0:142 'r3' ( temp 3X3 matrix of float) +0:142 component-wise multiply ( global 3X3 matrix of float) +0:142 'm33' ( global 3X3 matrix of float) +0:142 'm33' ( global 3X3 matrix of float) +0:143 Sequence +0:143 move second child to first child ( temp 4X4 matrix of float) +0:143 'r4' ( temp 4X4 matrix of float) +0:143 component-wise multiply ( global 4X4 matrix of float) +0:143 'm44' ( global 4X4 matrix of float) +0:143 'm44' ( global 4X4 matrix of float) +0:145 Sequence +0:145 move second child to first child ( temp 2X3 matrix of float) +0:145 'r23' ( temp 2X3 matrix of float) +0:145 component-wise multiply ( global 2X3 matrix of float) +0:145 'm23' ( global 2X3 matrix of float) +0:145 'm23' ( global 2X3 matrix of float) +0:146 Sequence +0:146 move second child to first child ( temp 2X4 matrix of float) +0:146 'r24' ( temp 2X4 matrix of float) +0:146 component-wise multiply ( global 2X4 matrix of float) +0:146 'm24' ( global 2X4 matrix of float) +0:146 'm24' ( global 2X4 matrix of float) +0:147 Sequence +0:147 move second child to first child ( temp 3X2 matrix of float) +0:147 'r32' ( temp 3X2 matrix of float) +0:147 component-wise multiply ( global 3X2 matrix of float) +0:147 'm32' ( global 3X2 matrix of float) +0:147 'm32' ( global 3X2 matrix of float) +0:148 Sequence +0:148 move second child to first child ( temp 3X4 matrix of float) +0:148 'r34' ( temp 3X4 matrix of float) +0:148 component-wise multiply ( global 3X4 matrix of float) +0:148 'm34' ( global 3X4 matrix of float) +0:148 'm34' ( global 3X4 matrix of float) +0:149 Sequence +0:149 move second child to first child ( temp 4X2 matrix of float) +0:149 'r42' ( temp 4X2 matrix of float) +0:149 component-wise multiply ( global 4X2 matrix of float) +0:149 'm42' ( global 4X2 matrix of float) +0:149 'm42' ( global 4X2 matrix of float) +0:150 Sequence +0:150 move second child to first child ( temp 4X3 matrix of float) +0:150 'r43' ( temp 4X3 matrix of float) +0:150 component-wise multiply ( global 4X3 matrix of float) +0:150 'm43' ( global 4X3 matrix of float) +0:150 'm43' ( global 4X3 matrix of float) +0:156 Function Definition: matConst( ( global void) +0:156 Function Parameters: +0:? Sequence +0:162 Sequence +0:162 move second child to first child ( temp 4X4 matrix of float) +0:162 'm4g' ( temp 4X4 matrix of float) +0:162 Construct mat4 ( temp 4X4 matrix of float) +0:162 'v2' ( temp 2-component vector of float) +0:162 'v3' ( temp 3-component vector of float) +0:162 'v3' ( temp 3-component vector of float) +0:162 'v3' ( temp 3-component vector of float) +0:162 'v3' ( temp 3-component vector of float) +0:162 'v3' ( temp 3-component vector of float) +0:163 Sequence +0:163 move second child to first child ( temp 4X4 matrix of float) +0:163 'm4' ( temp 4X4 matrix of float) +0:163 Construct mat4 ( temp 4X4 matrix of float) +0:163 'v2' ( temp 2-component vector of float) +0:163 'v3' ( temp 3-component vector of float) +0:163 'v3' ( temp 3-component vector of float) +0:163 'v3' ( temp 3-component vector of float) +0:163 'v3' ( temp 3-component vector of float) +0:163 'v2' ( temp 2-component vector of float) +0:164 Sequence +0:164 move second child to first child ( temp 3X3 matrix of float) +0:164 'm3' ( temp 3X3 matrix of float) +0:164 Construct mat3 ( temp 3X3 matrix of float) +0:164 'm4' ( temp 4X4 matrix of float) +0:165 Sequence +0:165 move second child to first child ( temp 3X3 matrix of float) +0:165 'm3b1' ( temp 3X3 matrix of float) +0:165 Construct mat3 ( temp 3X3 matrix of float) +0:165 'm4' ( temp 4X4 matrix of float) +0:165 'v2' ( temp 2-component vector of float) +0:166 Sequence +0:166 move second child to first child ( temp 3X3 matrix of float) +0:166 'm3b2' ( temp 3X3 matrix of float) +0:166 Construct mat3 ( temp 3X3 matrix of float) +0:166 'm4' ( temp 4X4 matrix of float) +0:166 'm4' ( temp 4X4 matrix of float) +0:167 Sequence +0:167 move second child to first child ( temp 3X2 matrix of float) +0:167 'm32' ( temp 3X2 matrix of float) +0:167 Construct mat3x2 ( temp 3X2 matrix of float) +0:167 'm4' ( temp 4X4 matrix of float) +0:168 Sequence +0:168 move second child to first child ( temp 4X4 matrix of float) +0:168 'm4c' ( temp 4X4 matrix of float) +0:168 Construct mat4 ( temp 4X4 matrix of float) +0:168 'm32' ( temp 3X2 matrix of float) +0:169 Sequence +0:169 move second child to first child ( temp 3X3 matrix of float) +0:169 'm3s' ( temp 3X3 matrix of float) +0:169 Construct mat3 ( temp 3X3 matrix of float) +0:169 direct index ( temp float) +0:169 'v2' ( temp 2-component vector of float) +0:169 Constant: +0:169 0 (const int) +0:171 Sequence +0:171 move second child to first child ( temp 2-element array of 3X3 matrix of float) +0:171 'm3a1' ( temp 2-element array of 3X3 matrix of float) +0:171 Construct mat3 ( temp 2-element array of 3X3 matrix of float) +0:171 'm3s' ( temp 3X3 matrix of float) +0:171 'm3s' ( temp 3X3 matrix of float) +0:179 Function Definition: foo2323( ( global void) +0:179 Function Parameters: +0:? Sequence +0:184 move second child to first child ( temp 4-component vector of float) +0:184 'v' ( temp 4-component vector of float) +0:184 textureLod ( global 4-component vector of float) +0:184 's2D' ( uniform sampler2D) +0:184 'v2' ( temp 2-component vector of float) +0:184 'f' ( temp float) +0:185 move second child to first child ( temp 4-component vector of float) +0:185 'v' ( temp 4-component vector of float) +0:185 textureProjLod ( global 4-component vector of float) +0:185 's3D' ( uniform sampler3D) +0:185 'v' ( temp 4-component vector of float) +0:185 'f' ( temp float) +0:186 move second child to first child ( temp 4-component vector of float) +0:186 'v' ( temp 4-component vector of float) +0:186 textureProjLod ( global 4-component vector of float) +0:186 's1D' ( uniform sampler1D) +0:186 'v' ( temp 4-component vector of float) +0:186 'f' ( temp float) +0:187 move second child to first child ( temp 4-component vector of float) +0:187 'v' ( temp 4-component vector of float) +0:187 textureProjLod ( global 4-component vector of float) +0:187 's2DS' ( uniform sampler2DShadow) +0:187 'v' ( temp 4-component vector of float) +0:187 'f' ( temp float) +0:189 move second child to first child ( temp 4-component vector of float) +0:189 'v' ( temp 4-component vector of float) +0:189 textureGrad ( global 4-component vector of float) +0:189 's1D' ( uniform sampler1D) +0:189 'f' ( temp float) +0:189 'f' ( temp float) +0:189 'f' ( temp float) +0:190 move second child to first child ( temp 4-component vector of float) +0:190 'v' ( temp 4-component vector of float) +0:190 textureProjGrad ( global 4-component vector of float) +0:190 's2D' ( uniform sampler2D) +0:190 'v' ( temp 4-component vector of float) +0:190 'v2' ( temp 2-component vector of float) +0:190 'v2' ( temp 2-component vector of float) +0:191 move second child to first child ( temp 4-component vector of float) +0:191 'v' ( temp 4-component vector of float) +0:191 textureProjGrad ( global 4-component vector of float) +0:191 's2DS' ( uniform sampler2DShadow) +0:191 'v' ( temp 4-component vector of float) +0:191 'v2' ( temp 2-component vector of float) +0:191 'v2' ( temp 2-component vector of float) +0:196 Function Definition: foo2324( ( global void) +0:196 Function Parameters: +0:? Sequence +0:201 move second child to first child ( temp 4-component vector of float) +0:201 'v' ( temp 4-component vector of float) +0:201 textureLod ( global 4-component vector of float) +0:201 's2D' ( uniform sampler2D) +0:201 'v2' ( temp 2-component vector of float) +0:201 'f' ( temp float) +0:202 move second child to first child ( temp 4-component vector of float) +0:202 'v' ( temp 4-component vector of float) +0:202 textureProjLod ( global 4-component vector of float) +0:202 's3D' ( uniform sampler3D) +0:202 'v' ( temp 4-component vector of float) +0:202 'f' ( temp float) +0:203 move second child to first child ( temp 4-component vector of float) +0:203 'v' ( temp 4-component vector of float) +0:203 textureProjLod ( global 4-component vector of float) +0:203 's1D' ( uniform sampler1D) +0:203 'v' ( temp 4-component vector of float) +0:203 'f' ( temp float) +0:204 move second child to first child ( temp 4-component vector of float) +0:204 'v' ( temp 4-component vector of float) +0:204 textureProjLod ( global 4-component vector of float) +0:204 's2DS' ( uniform sampler2DShadow) +0:204 'v' ( temp 4-component vector of float) +0:204 'f' ( temp float) +0:206 move second child to first child ( temp 4-component vector of float) +0:206 'v' ( temp 4-component vector of float) +0:206 textureGrad ( global 4-component vector of float) +0:206 's1D' ( uniform sampler1D) +0:206 'f' ( temp float) +0:206 'f' ( temp float) +0:206 'f' ( temp float) +0:207 move second child to first child ( temp 4-component vector of float) +0:207 'v' ( temp 4-component vector of float) +0:207 textureProjGrad ( global 4-component vector of float) +0:207 's2D' ( uniform sampler2D) +0:207 'v' ( temp 4-component vector of float) +0:207 'v2' ( temp 2-component vector of float) +0:207 'v2' ( temp 2-component vector of float) +0:208 move second child to first child ( temp 4-component vector of float) +0:208 'v' ( temp 4-component vector of float) +0:208 textureProjGrad ( global 4-component vector of float) +0:208 's2DS' ( uniform sampler2DShadow) +0:208 'v' ( temp 4-component vector of float) +0:208 'v2' ( temp 2-component vector of float) +0:208 'v2' ( temp 2-component vector of float) +0:209 'v' ( temp 4-component vector of float) +0:214 Function Definition: foo121111( ( global void) +0:214 Function Parameters: +0:? Sequence +0:217 Sequence +0:217 move second child to first child ( temp 4-component vector of float) +0:217 'v' ( temp 4-component vector of float) +0:217 texture ( global 4-component vector of float) +0:217 's2DRbad' ( uniform sampler2DRect) +0:217 'v2' ( temp 2-component vector of float) +0:225 Function Definition: foo12111( ( global void) +0:225 Function Parameters: +0:? Sequence +0:231 move second child to first child ( temp 4-component vector of float) +0:231 'v' ( temp 4-component vector of float) +0:231 texture ( global 4-component vector of float) +0:231 's2DR' ( uniform sampler2DRect) +0:231 'v2' ( temp 2-component vector of float) +0:232 move second child to first child ( temp 4-component vector of float) +0:232 'v' ( temp 4-component vector of float) +0:232 textureProj ( global 4-component vector of float) +0:232 's2DR' ( uniform sampler2DRect) +0:232 'v3' ( temp 3-component vector of float) +0:233 move second child to first child ( temp 4-component vector of float) +0:233 'v' ( temp 4-component vector of float) +0:233 textureProj ( global 4-component vector of float) +0:233 's2DR' ( uniform sampler2DRect) +0:233 'v4' ( temp 4-component vector of float) +0:234 move second child to first child ( temp 4-component vector of float) +0:234 'v' ( temp 4-component vector of float) +0:234 texture ( global 4-component vector of float) +0:234 's2DRS' ( uniform sampler2DRectShadow) +0:234 'v3' ( temp 3-component vector of float) +0:235 move second child to first child ( temp 4-component vector of float) +0:235 'v' ( temp 4-component vector of float) +0:235 textureProj ( global 4-component vector of float) +0:235 's2DRS' ( uniform sampler2DRectShadow) +0:235 'v4' ( temp 4-component vector of float) +0:237 move second child to first child ( temp 4-component vector of float) +0:237 'v' ( temp 4-component vector of float) +0:237 textureProjGrad ( global 4-component vector of float) +0:237 's2DRS' ( uniform sampler2DRectShadow) +0:237 'v' ( temp 4-component vector of float) +0:237 'v2' ( temp 2-component vector of float) +0:237 'v2' ( temp 2-component vector of float) +0:240 Function Definition: voidTernary( ( global void) +0:240 Function Parameters: +0:? Sequence +0:243 Test condition and select ( temp void) +0:243 Condition +0:243 'b' ( temp bool) +0:243 true case +0:243 Function Call: foo121111( ( global void) +0:243 false case +0:243 Function Call: foo12111( ( global void) +0:244 Constant: +0:244 4 (const int) +0:245 Function Call: foo12111( ( global void) +0:? Linker Objects +0:? 'lowp' ( global float) +0:? 'mediump' ( global float) +0:? 'highp' ( global float) +0:? 'precision' ( global float) +0:? 'i' ( smooth in 4-component vector of float) +0:? 'o' ( out 4-component vector of float) +0:? 's2D' ( uniform sampler2D) +0:? 'centTexCoord' ( centroid smooth in 2-component vector of float) +0:? 'm' ( uniform 4X2 matrix of float) +0:? 'imageBuffer' ( global float) +0:? 'uimage2DRect' ( global float) +0:? 'a' ( temp int) +0:? 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:? 'm22' ( global 2X2 matrix of float) +0:? 'm23' ( global 2X3 matrix of float) +0:? 'm24' ( global 2X4 matrix of float) +0:? 'm32' ( global 3X2 matrix of float) +0:? 'm33' ( global 3X3 matrix of float) +0:? 'm34' ( global 3X4 matrix of float) +0:? 'm42' ( global 4X2 matrix of float) +0:? 'm43' ( global 4X3 matrix of float) +0:? 'm44' ( global 4X4 matrix of float) +0:? 's3D' ( uniform sampler3D) +0:? 's1D' ( uniform sampler1D) +0:? 's2DS' ( uniform sampler2DShadow) +0:? 's2DRbad' ( uniform sampler2DRect) +0:? 's2DR' ( uniform sampler2DRect) +0:? 's2DRS' ( uniform sampler2DRectShadow) +0:? 'halfFloat1' ( global float) + + +Linked fragment stage: + +ERROR: Linking fragment stage: Recursion detected: + foo(f1; calling foo(f1; + +Shader version: 120 +Requested GL_ARB_shader_texture_lod +Requested GL_ARB_texture_rectangle +ERROR: node is still EOpNull! +0:92 Function Definition: main(i1; ( global void) +0:92 Function Parameters: +0:92 'a' ( in int) +0:? Linker Objects +0:? 'lowp' ( global float) +0:? 'mediump' ( global float) +0:? 'highp' ( global float) +0:? 'precision' ( global float) +0:? 'i' ( smooth in 4-component vector of float) +0:? 'o' ( out 4-component vector of float) +0:? 's2D' ( uniform sampler2D) +0:? 'centTexCoord' ( centroid smooth in 2-component vector of float) +0:? 'm' ( uniform 4X2 matrix of float) +0:? 'imageBuffer' ( global float) +0:? 'uimage2DRect' ( global float) +0:? 'a' ( temp int) +0:? 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:? 'm22' ( global 2X2 matrix of float) +0:? 'm23' ( global 2X3 matrix of float) +0:? 'm24' ( global 2X4 matrix of float) +0:? 'm32' ( global 3X2 matrix of float) +0:? 'm33' ( global 3X3 matrix of float) +0:? 'm34' ( global 3X4 matrix of float) +0:? 'm42' ( global 4X2 matrix of float) +0:? 'm43' ( global 4X3 matrix of float) +0:? 'm44' ( global 4X4 matrix of float) +0:? 's3D' ( uniform sampler3D) +0:? 's1D' ( uniform sampler1D) +0:? 's2DS' ( uniform sampler2DShadow) +0:? 's2DRbad' ( uniform sampler2DRect) +0:? 's2DR' ( uniform sampler2DRect) +0:? 's2DRS' ( uniform sampler2DRectShadow) +0:? 'halfFloat1' ( global float) + diff --git a/deps/glslang/Test/baseResults/120.vert.out b/deps/glslang/Test/baseResults/120.vert.out new file mode 100644 index 00000000..5a91ed66 --- /dev/null +++ b/deps/glslang/Test/baseResults/120.vert.out @@ -0,0 +1,505 @@ +120.vert +ERROR: 0:3: 'in for stage inputs' : not supported for this version or the enabled extensions +ERROR: 0:4: 'out for stage outputs' : not supported for this version or the enabled extensions +ERROR: 0:11: 'gl_Position' : cannot add storage, auxiliary, memory, interpolation, layout, or precision qualifier to an existing variable +ERROR: 0:12: '' : can only have one auxiliary qualifier (centroid, patch, and sample) +ERROR: 0:12: '' : replicated qualifiers +ERROR: 0:12: 'foo' : identifier not previously declared +ERROR: 0:21: 'gl_ClipDistance' : undeclared identifier +ERROR: 0:21: 'gl_ClipDistance' : left of '[' is not of type array, matrix, or vector +ERROR: 0:21: 'assign' : l-value required (can't modify a const) +ERROR: 0:28: 'length' : array must be declared with a size before using this method +ERROR: 0:31: 'length' : incomplete method syntax +ERROR: 0:32: 'length' : method does not accept any arguments +ERROR: 0:33: '.' : cannot apply to an array: flizbit +ERROR: 0:33: '=' : cannot convert from ' temp 7-element array of float' to ' temp int' +ERROR: 0:34: '.' : cannot apply to an array: flizbit +ERROR: 0:34: 'f' : can't use function syntax on variable +ERROR: 0:34: 'a4' : redefinition +ERROR: 0:35: 'arrays of arrays' : not supported with this profile: none +ERROR: 0:36: 'arrays of arrays' : not supported with this profile: none +ERROR: 0:37: 'arrays of arrays' : not supported with this profile: none +ERROR: 0:37: 'arrays of arrays' : not supported with this profile: none +ERROR: 0:38: 'arrays of arrays' : not supported with this profile: none +ERROR: 0:39: 'arrays of arrays' : not supported with this profile: none +ERROR: 0:40: 'arrays of arrays' : not supported with this profile: none +ERROR: 0:40: 'constructor' : array constructor needs one argument per array element +ERROR: 0:40: 'arrays of arrays' : not supported with this profile: none +ERROR: 0:40: '=' : cannot convert from ' const float' to ' temp 2-element array of 3-element array of float' +ERROR: 0:41: 'arrays of arrays' : not supported with this profile: none +ERROR: 0:41: 'constructor' : array constructor needs one argument per array element +ERROR: 0:41: 'arrays of arrays' : not supported with this profile: none +ERROR: 0:41: '=' : cannot convert from ' const float' to ' temp 2-element array of 3-element array of float' +ERROR: 0:50: 'arrays of arrays' : not supported with this profile: none +ERROR: 0:51: 'arrays of arrays' : not supported with this profile: none +ERROR: 0:52: 'arrays of arrays' : not supported with this profile: none +ERROR: 0:53: 'arrays of arrays' : not supported with this profile: none +ERROR: 0:56: 'out' : overloaded functions must have the same parameter storage qualifiers for argument 1 +ERROR: 0:57: 'overloadA' : overloaded functions must have the same return type +ERROR: 0:87: 'overloadC' : no matching overloaded function found +ERROR: 0:90: 'overloadC' : no matching overloaded function found +ERROR: 0:95: 'overloadD' : ambiguous function signature match: multiple signatures match under implicit type conversion +ERROR: 0:98: 'overloadB' : can't use function syntax on variable +ERROR: 0:106: 'overloadC' : no matching overloaded function found +ERROR: 0:107: 'overloadE' : no matching overloaded function found +ERROR: 0:108: 'overloadE' : no matching overloaded function found +ERROR: 0:111: 'overloadE' : no matching overloaded function found +ERROR: 0:117: 'overloadF' : no matching overloaded function found +ERROR: 0:121: 'gl_TexCoord array size' : must be less than or equal to gl_MaxTextureCoords (32) +ERROR: 0:165: 'switch' : Reserved word. +ERROR: 0:171: 'default' : Reserved word. +ERROR: 0:165: 'switch statements' : not supported for this version or the enabled extensions +ERROR: 0:176: 'bit shift left' : not supported for this version or the enabled extensions +ERROR: 0:176: 'bit shift right' : not supported for this version or the enabled extensions +ERROR: 0:176: 'bitwise and' : not supported for this version or the enabled extensions +ERROR: 0:176: 'bitwise inclusive or' : not supported for this version or the enabled extensions +ERROR: 0:179: 'modf' : no matching overloaded function found +ERROR: 0:179: '=' : cannot convert from ' const float' to ' temp 3-component vector of float' +ERROR: 0:180: 'trunc' : no matching overloaded function found +ERROR: 0:181: 'round' : no matching overloaded function found +ERROR: 0:181: '=' : cannot convert from ' const float' to ' temp 2-component vector of float' +ERROR: 0:182: 'roundEven' : no matching overloaded function found +ERROR: 0:182: '=' : cannot convert from ' const float' to ' temp 2-component vector of float' +ERROR: 0:183: 'isnan' : no matching overloaded function found +ERROR: 0:183: '=' : cannot convert from ' const float' to ' temp 2-component vector of bool' +ERROR: 0:184: 'isinf' : no matching overloaded function found +ERROR: 0:184: '=' : cannot convert from ' const float' to ' temp 4-component vector of bool' +ERROR: 0:186: 'sinh' : no matching overloaded function found +ERROR: 0:187: 'cosh' : no matching overloaded function found +ERROR: 0:187: 'tanh' : no matching overloaded function found +ERROR: 0:188: 'c4D' : undeclared identifier +ERROR: 0:188: 'asinh' : no matching overloaded function found +ERROR: 0:188: 'acosh' : no matching overloaded function found +ERROR: 0:189: 'atanh' : no matching overloaded function found +ERROR: 0:191: 'gl_VertexID' : undeclared identifier +ERROR: 0:191: '=' : cannot convert from ' temp float' to ' temp int' +ERROR: 0:192: 'gl_ClipDistance' : undeclared identifier +ERROR: 0:192: 'gl_ClipDistance' : left of '[' is not of type array, matrix, or vector +ERROR: 0:192: 'assign' : l-value required (can't modify a const) +ERROR: 0:195: 'gl_ModelViewMatrix' : identifiers starting with "gl_" are reserved +ERROR: 0:200: 'token pasting (##)' : not supported for this version or the enabled extensions +ERROR: 0:203: 'token pasting (##)' : not supported for this version or the enabled extensions +ERROR: 80 compilation errors. No code generated. + + +Shader version: 120 +ERROR: node is still EOpNull! +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:17 Sequence +0:17 move second child to first child ( temp 2-component vector of float) +0:17 'centTexCoord' ( invariant smooth out 2-component vector of float) +0:17 'attv2' ( in 2-component vector of float) +0:18 move second child to first child ( temp 4-component vector of float) +0:18 'gl_Position' ( invariant gl_Position 4-component vector of float Position) +0:18 'attv4' ( in 4-component vector of float) +0:20 move second child to first child ( temp 4-component vector of float) +0:20 'gl_ClipVertex' ( gl_ClipVertex 4-component vector of float ClipVertex) +0:20 'attv4' ( in 4-component vector of float) +0:21 move second child to first child ( temp float) +0:21 Constant: +0:21 0.000000 +0:21 Constant: +0:21 0.200000 +0:25 move second child to first child ( temp 4-component vector of float) +0:25 'gl_Position' ( invariant gl_Position 4-component vector of float Position) +0:25 direct index ( temp 4-component vector of float) +0:25 'b' ( temp 12-element array of 4-component vector of float) +0:25 Constant: +0:25 11 (const int) +0:28 Sequence +0:28 move second child to first child ( temp int) +0:28 'a1' ( temp int) +0:28 Constant: +0:28 1 (const int) +0:30 Sequence +0:30 move second child to first child ( temp int) +0:30 'aa' ( temp int) +0:30 Constant: +0:30 7 (const int) +0:31 Sequence +0:31 move second child to first child ( temp int) +0:31 'a2' ( temp int) +0:32 Sequence +0:32 move second child to first child ( temp int) +0:32 'a3' ( temp int) +0:32 Constant: +0:32 1 (const int) +0:43 move second child to first child ( temp float) +0:43 'gl_PointSize' ( invariant gl_PointSize float PointSize) +0:43 Constant: +0:43 3.800000 +0:61 Function Definition: overloadB(f1;f1; ( global void) +0:61 Function Parameters: +0:61 '' ( in float) +0:61 '' ( const (read only) float) +0:78 Function Definition: foo( ( global void) +0:78 Function Parameters: +0:? Sequence +0:83 Function Call: overloadB(f1;f1; ( global void) +0:83 'f' ( temp float) +0:83 'f' ( temp float) +0:84 Function Call: overloadB(f1;f1; ( global void) +0:84 'f' ( temp float) +0:84 Constant: +0:84 2.000000 +0:85 Function Call: overloadB(f1;f1; ( global void) +0:85 Constant: +0:85 1.000000 +0:85 Convert int to float ( temp float) +0:85 'i' ( temp int) +0:87 Constant: +0:87 0.000000 +0:88 Function Call: overloadC(i1;i1; ( global 2-component vector of float) +0:88 Constant: +0:88 1 (const int) +0:88 'i' ( temp int) +0:89 Function Call: overloadC(vf2;vf2; ( global 2-component vector of float) +0:89 Constant: +0:89 1.000000 +0:89 1.000000 +0:89 Constant: +0:89 2.000000 +0:89 2.000000 +0:90 Constant: +0:90 0.000000 +0:91 Function Call: overloadC(vf2;vf2; ( global 2-component vector of float) +0:91 Constant: +0:91 1.000000 +0:91 1.000000 +0:91 Constant: +0:91 2.000000 +0:91 2.000000 +0:93 Function Call: overloadD(i1;f1; ( global 3-component vector of float) +0:93 'i' ( temp int) +0:93 'f' ( temp float) +0:94 Function Call: overloadD(f1;i1; ( global 3-component vector of float) +0:94 'f' ( temp float) +0:94 'i' ( temp int) +0:95 Function Call: overloadD(f1;i1; ( global 3-component vector of float) +0:95 Convert int to float ( temp float) +0:95 'i' ( temp int) +0:95 'i' ( temp int) +0:98 Constant: +0:98 0.000000 +0:100 Constant: +0:100 0.841471 +0:101 texture ( global 4-component vector of float) +0:101 's2D' ( uniform sampler2D) +0:101 Constant: +0:101 0.000000 +0:101 0.000000 +0:102 clamp ( global 4-component vector of float) +0:102 'attv4' ( in 4-component vector of float) +0:102 Constant: +0:102 0.000000 +0:102 Constant: +0:102 1.000000 +0:103 clamp ( global 4-component vector of float) +0:103 Convert int to float ( temp 4-component vector of float) +0:103 Convert float to int ( temp 4-component vector of int) +0:103 'attv4' ( in 4-component vector of float) +0:103 Constant: +0:103 0.000000 +0:103 Constant: +0:103 1.000000 +0:106 Constant: +0:106 0.000000 +0:107 Constant: +0:107 0.000000 +0:108 Constant: +0:108 0.000000 +0:109 Function Call: overloadE(vf2; ( global 3-component vector of float) +0:109 Constant: +0:109 3.300000 +0:109 3.300000 +0:110 Function Call: overloadE(mf22; ( global 3-component vector of float) +0:110 Constant: +0:110 0.500000 +0:110 0.000000 +0:110 0.000000 +0:110 0.500000 +0:111 Constant: +0:111 0.000000 +0:112 Function Call: overloadE(vf2; ( global 3-component vector of float) +0:112 Constant: +0:112 1.000000 +0:112 1.000000 +0:115 Function Call: overloadE(f1[2]; ( global 3-component vector of float) +0:115 'b' ( temp 2-element array of float) +0:117 Constant: +0:117 0.000000 +0:118 Function Call: overloadF(i1; ( global 3-component vector of float) +0:118 Constant: +0:118 1 (const int) +0:128 Function Definition: foo2( ( global void) +0:128 Function Parameters: +0:? Sequence +0:135 Comma ( global void) +0:135 Function Call: outFun(f1;vi2;i1;f1; ( global void) +0:135 Convert int to float ( temp float) +0:135 'i' ( temp int) +0:135 'tempArg' ( temp 2-component vector of int) +0:135 'i' ( temp int) +0:135 'f' ( temp float) +0:135 move second child to first child ( temp 2-component vector of float) +0:135 'v2' ( temp 2-component vector of float) +0:135 Convert int to float ( temp 2-component vector of float) +0:135 'tempArg' ( temp 2-component vector of int) +0:136 Comma ( global int) +0:136 move second child to first child ( temp int) +0:136 'tempReturn' ( global int) +0:136 Function Call: outFunRet(f1;i1;i1;vi4; ( global int) +0:136 Convert int to float ( temp float) +0:136 'i' ( temp int) +0:136 'tempArg' ( temp int) +0:136 'i' ( temp int) +0:136 'tempArg' ( temp 4-component vector of int) +0:136 move second child to first child ( temp float) +0:136 'f' ( temp float) +0:136 Convert int to float ( temp float) +0:136 'tempArg' ( temp int) +0:136 move second child to first child ( temp 4-component vector of float) +0:136 'v4' ( temp 4-component vector of float) +0:136 Convert int to float ( temp 4-component vector of float) +0:136 'tempArg' ( temp 4-component vector of int) +0:136 'tempReturn' ( global int) +0:137 Sequence +0:137 move second child to first child ( temp float) +0:137 'ret' ( temp float) +0:137 Convert int to float ( temp float) +0:137 Comma ( global int) +0:137 move second child to first child ( temp int) +0:137 'tempReturn' ( global int) +0:137 Function Call: outFunRet(f1;i1;i1;vi4; ( global int) +0:137 Convert int to float ( temp float) +0:137 'i' ( temp int) +0:137 'tempArg' ( temp int) +0:137 'i' ( temp int) +0:137 'tempArg' ( temp 4-component vector of int) +0:137 move second child to first child ( temp float) +0:137 'f' ( temp float) +0:137 Convert int to float ( temp float) +0:137 'tempArg' ( temp int) +0:137 move second child to first child ( temp 4-component vector of float) +0:137 'v4' ( temp 4-component vector of float) +0:137 Convert int to float ( temp 4-component vector of float) +0:137 'tempArg' ( temp 4-component vector of int) +0:137 'tempReturn' ( global int) +0:138 Sequence +0:138 move second child to first child ( temp 2-component vector of float) +0:138 'ret2' ( temp 2-component vector of float) +0:138 Convert int to float ( temp 2-component vector of float) +0:138 Comma ( global 2-component vector of int) +0:138 move second child to first child ( temp 2-component vector of int) +0:138 'tempReturn' ( global 2-component vector of int) +0:138 Function Call: outFunRet(f1;vi4;i1;vi4; ( global 2-component vector of int) +0:138 Convert int to float ( temp float) +0:138 'i' ( temp int) +0:138 'tempArg' ( temp 4-component vector of int) +0:138 'i' ( temp int) +0:138 'tempArg' ( temp 4-component vector of int) +0:138 move second child to first child ( temp 4-component vector of float) +0:138 'v4' ( temp 4-component vector of float) +0:138 Convert int to float ( temp 4-component vector of float) +0:138 'tempArg' ( temp 4-component vector of int) +0:138 move second child to first child ( temp 4-component vector of float) +0:138 'v4' ( temp 4-component vector of float) +0:138 Convert int to float ( temp 4-component vector of float) +0:138 'tempArg' ( temp 4-component vector of int) +0:138 'tempReturn' ( global 2-component vector of int) +0:139 Sequence +0:139 move second child to first child ( temp bool) +0:139 'b' ( temp bool) +0:139 any ( global bool) +0:139 Compare Less Than ( global 4-component vector of bool) +0:139 'v4' ( temp 4-component vector of float) +0:139 'attv4' ( in 4-component vector of float) +0:142 Function Definition: noise( ( global void) +0:142 Function Parameters: +0:144 Sequence +0:144 Sequence +0:144 move second child to first child ( temp float) +0:144 'f1' ( temp float) +0:144 noise ( global float) +0:144 Constant: +0:144 1.000000 +0:145 Sequence +0:145 move second child to first child ( temp 2-component vector of float) +0:145 'f2' ( temp 2-component vector of float) +0:145 noise ( global 2-component vector of float) +0:145 Constant: +0:145 1.000000 +0:145 1.000000 +0:146 Sequence +0:146 move second child to first child ( temp 3-component vector of float) +0:146 'f3' ( temp 3-component vector of float) +0:146 noise ( global 3-component vector of float) +0:146 Constant: +0:146 1.000000 +0:146 1.000000 +0:146 1.000000 +0:147 Sequence +0:147 move second child to first child ( temp 4-component vector of float) +0:147 'f4' ( temp 4-component vector of float) +0:147 noise ( global 4-component vector of float) +0:147 Constant: +0:147 1.000000 +0:147 1.000000 +0:147 1.000000 +0:147 1.000000 +0:162 Function Definition: foo213( ( global void) +0:162 Function Parameters: +0:164 Sequence +0:164 Sequence +0:164 move second child to first child ( temp float) +0:164 'f' ( temp float) +0:164 Constant: +0:164 3.000000 +0:165 switch +0:165 condition +0:165 'c' ( uniform int) +0:165 body +0:165 Sequence +0:166 case: with expression +0:166 Constant: +0:166 1 (const int) +0:? Sequence +0:167 move second child to first child ( temp float) +0:167 'f' ( temp float) +0:167 sine ( global float) +0:167 'f' ( temp float) +0:168 Branch: Break +0:169 case: with expression +0:169 Constant: +0:169 2 (const int) +0:? Sequence +0:170 move second child to first child ( temp float) +0:170 'f' ( temp float) +0:170 component-wise multiply ( temp float) +0:170 'f' ( temp float) +0:170 'f' ( temp float) +0:171 default: +0:? Sequence +0:172 move second child to first child ( temp float) +0:172 'f' ( temp float) +0:172 Constant: +0:172 3.000000 +0:176 inclusive-or ( temp int) +0:176 left-shift ( temp int) +0:176 'i' ( temp int) +0:176 Constant: +0:176 3 (const int) +0:176 Constant: +0:176 69 (const int) +0:180 Sequence +0:180 move second child to first child ( temp float) +0:180 't' ( temp float) +0:180 Constant: +0:180 0.000000 +0:186 Constant: +0:186 0.000000 +0:188 Constant: +0:188 0.000000 +0:189 Constant: +0:189 0.000000 +0:192 move second child to first child ( temp float) +0:192 Constant: +0:192 0.000000 +0:192 Constant: +0:192 0.300000 +0:? Linker Objects +0:? 'i' ( in 4-component vector of float) +0:? 'o' ( smooth out 4-component vector of float) +0:? 'attv2' ( in 2-component vector of float) +0:? 'attv4' ( in 4-component vector of float) +0:? 's2D' ( uniform sampler2D) +0:? 'centTexCoord' ( invariant smooth out 2-component vector of float) +0:? 'initted' ( uniform float) +0:? 3.400000 +0:? 'concall' ( const float) +0:? 0.295520 +0:? 'gl_TexCoord' ( smooth out 35-element array of 4-component vector of float TexCoord) +0:? 'c' ( uniform int) +0:? 'x' ( in 2-component vector of int) +0:? 'v2a' ( in 2-component vector of float) +0:? 'c1D' ( in float) +0:? 'c2D' ( in 2-component vector of float) +0:? 'c3D' ( in 3-component vector of float) +0:? 'v4' ( uniform 4-component vector of float) +0:? 'abcdef' ( global int) +0:? 'qrstuv' ( global int) + + +Linked vertex stage: + + +Shader version: 120 +ERROR: node is still EOpNull! +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:17 Sequence +0:17 move second child to first child ( temp 2-component vector of float) +0:17 'centTexCoord' ( invariant smooth out 2-component vector of float) +0:17 'attv2' ( in 2-component vector of float) +0:18 move second child to first child ( temp 4-component vector of float) +0:18 'gl_Position' ( invariant gl_Position 4-component vector of float Position) +0:18 'attv4' ( in 4-component vector of float) +0:20 move second child to first child ( temp 4-component vector of float) +0:20 'gl_ClipVertex' ( gl_ClipVertex 4-component vector of float ClipVertex) +0:20 'attv4' ( in 4-component vector of float) +0:21 move second child to first child ( temp float) +0:21 Constant: +0:21 0.000000 +0:21 Constant: +0:21 0.200000 +0:25 move second child to first child ( temp 4-component vector of float) +0:25 'gl_Position' ( invariant gl_Position 4-component vector of float Position) +0:25 direct index ( temp 4-component vector of float) +0:25 'b' ( temp 12-element array of 4-component vector of float) +0:25 Constant: +0:25 11 (const int) +0:28 Sequence +0:28 move second child to first child ( temp int) +0:28 'a1' ( temp int) +0:28 Constant: +0:28 1 (const int) +0:30 Sequence +0:30 move second child to first child ( temp int) +0:30 'aa' ( temp int) +0:30 Constant: +0:30 7 (const int) +0:31 Sequence +0:31 move second child to first child ( temp int) +0:31 'a2' ( temp int) +0:32 Sequence +0:32 move second child to first child ( temp int) +0:32 'a3' ( temp int) +0:32 Constant: +0:32 1 (const int) +0:43 move second child to first child ( temp float) +0:43 'gl_PointSize' ( invariant gl_PointSize float PointSize) +0:43 Constant: +0:43 3.800000 +0:? Linker Objects +0:? 'i' ( in 4-component vector of float) +0:? 'o' ( smooth out 4-component vector of float) +0:? 'attv2' ( in 2-component vector of float) +0:? 'attv4' ( in 4-component vector of float) +0:? 's2D' ( uniform sampler2D) +0:? 'centTexCoord' ( invariant smooth out 2-component vector of float) +0:? 'initted' ( uniform float) +0:? 3.400000 +0:? 'concall' ( const float) +0:? 0.295520 +0:? 'gl_TexCoord' ( smooth out 35-element array of 4-component vector of float TexCoord) +0:? 'c' ( uniform int) +0:? 'x' ( in 2-component vector of int) +0:? 'v2a' ( in 2-component vector of float) +0:? 'c1D' ( in float) +0:? 'c2D' ( in 2-component vector of float) +0:? 'c3D' ( in 3-component vector of float) +0:? 'v4' ( uniform 4-component vector of float) +0:? 'abcdef' ( global int) +0:? 'qrstuv' ( global int) + diff --git a/deps/glslang/Test/baseResults/130.frag.out b/deps/glslang/Test/baseResults/130.frag.out new file mode 100644 index 00000000..81d055be --- /dev/null +++ b/deps/glslang/Test/baseResults/130.frag.out @@ -0,0 +1,460 @@ +130.frag +ERROR: 0:25: 'textureGather(...)' : not supported for this version or the enabled extensions +ERROR: 0:35: 'redeclaration' : cannot change the type of gl_Color +ERROR: 0:38: 'gl_Color' : redeclaring non-array as array +ERROR: 0:39: 'redeclaration' : cannot change storage, memory, or auxiliary qualification of gl_Color +WARNING: 0:45: extension GL_ARB_texture_gather is being used for textureGather(...) +ERROR: 0:62: '<' : wrong operand types: no operation '<' exists that takes a left-hand operand of type ' temp 3-component vector of bool' and a right operand of type ' temp 3-component vector of bool' (or there is no acceptable conversion) +ERROR: 0:63: '>' : wrong operand types: no operation '>' exists that takes a left-hand operand of type ' temp 3-component vector of uint' and a right operand of type ' temp 3-component vector of uint' (or there is no acceptable conversion) +ERROR: 0:64: '>=' : wrong operand types: no operation '>=' exists that takes a left-hand operand of type ' const 2-component vector of uint' and a right operand of type ' const 2-component vector of uint' (or there is no acceptable conversion) +ERROR: 0:80: 'textureGatherOffset' : no matching overloaded function found +ERROR: 0:80: 'assign' : cannot convert from ' const float' to ' temp 4-component vector of float' +ERROR: 0:81: 'textureGatherOffset(...)' : not supported for this version or the enabled extensions +ERROR: 0:84: 'textureGatherOffset(...)' : not supported for this version or the enabled extensions +ERROR: 0:85: 'textureGatherOffset(...)' : not supported for this version or the enabled extensions +WARNING: 0:88: '#extension' : extension is only partially supported: GL_ARB_gpu_shader5 +ERROR: 0:120: 'line continuation' : not supported for this version or the enabled extensions +ERROR: 0:126: 'uniform block' : not supported for this version or the enabled extensions +ERROR: 0:140: 'length' : does not operate on this type: temp bool +ERROR: 0:140: 'boolb' : can't use function syntax on variable +ERROR: 0:141: 'length' : does not operate on this type: temp float +ERROR: 0:141: '' : function call, method, or subroutine call expected +ERROR: 0:141: '' : no matching overloaded function found +ERROR: 0:142: 'length' : incomplete method syntax +ERROR: 0:143: 'length' : method does not accept any arguments +ERROR: 0:146: 'gl_FogFragCoord' : identifiers starting with "gl_" are reserved +ERROR: 0:151: 'int' : must be qualified as flat in +ERROR: 0:151: 'redeclaration' : cannot change the type of gl_FogFragCoord +ERROR: 0:153: 'early_fragment_tests' : not supported for this version or the enabled extensions +ERROR: 0:154: 'image load store' : not supported for this version or the enabled extensions +ERROR: 0:154: 'iimage2D' : Reserved word. +ERROR: 0:169: 'early_fragment_tests' : can only apply to 'in' +ERROR: 28 compilation errors. No code generated. + + +Shader version: 130 +Requested GL_ARB_gpu_shader5 +Requested GL_ARB_separate_shader_objects +Requested GL_ARB_shader_image_load_store +Requested GL_ARB_shading_language_420pack +Requested GL_ARB_texture_cube_map_array +Requested GL_ARB_texture_gather +Requested GL_ARB_texture_rectangle +using early_fragment_tests +ERROR: node is still EOpNull! +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:18 Sequence +0:18 Sequence +0:18 move second child to first child ( temp float) +0:18 'clip' ( temp float) +0:18 direct index ( smooth temp float ClipDistance) +0:18 'gl_ClipDistance' ( smooth in unsized 4-element array of float ClipDistance) +0:18 Constant: +0:18 3 (const int) +0:23 Function Definition: foo( ( global void) +0:23 Function Parameters: +0:25 Sequence +0:25 Sequence +0:25 move second child to first child ( temp 4-component vector of float) +0:25 's' ( temp 4-component vector of float) +0:25 textureGather ( global 4-component vector of float) +0:25 'sampC' ( uniform samplerCube) +0:25 Constant: +0:25 0.200000 +0:25 0.200000 +0:25 0.200000 +0:30 Function Definition: bar( ( global void) +0:30 Function Parameters: +0:32 Sequence +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of float) +0:32 's' ( temp 4-component vector of float) +0:32 textureGather ( global 4-component vector of float) +0:32 'sampC' ( uniform samplerCube) +0:32 Constant: +0:32 0.200000 +0:32 0.200000 +0:32 0.200000 +0:43 Function Definition: bar2( ( global void) +0:43 Function Parameters: +0:45 Sequence +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of float) +0:45 's' ( temp 4-component vector of float) +0:45 textureGather ( global 4-component vector of float) +0:45 'sampC' ( uniform samplerCube) +0:45 Constant: +0:45 0.200000 +0:45 0.200000 +0:45 0.200000 +0:49 move second child to first child ( temp 3-component vector of bool) +0:49 'b3' ( temp 3-component vector of bool) +0:49 Compare Less Than ( global 3-component vector of bool) +0:49 'uv3' ( temp 3-component vector of uint) +0:49 'uv3' ( temp 3-component vector of uint) +0:50 move second child to first child ( temp 3-component vector of bool) +0:50 'b3' ( temp 3-component vector of bool) +0:50 Equal ( global 3-component vector of bool) +0:50 'uv3' ( temp 3-component vector of uint) +0:50 'uv3' ( temp 3-component vector of uint) +0:56 direct index ( temp int) +0:56 'a1' ( temp 1-element array of int) +0:56 Constant: +0:56 0 (const int) +0:57 direct index ( temp int) +0:57 'a2' ( temp 1-element array of int) +0:57 Constant: +0:57 0 (const int) +0:60 direct index ( temp int) +0:60 'a3' ( temp 4-element array of int) +0:60 Constant: +0:60 3 (const int) +0:61 Compare Not Equal ( temp bool) +0:61 'b3' ( temp 3-component vector of bool) +0:61 'b3' ( temp 3-component vector of bool) +0:62 Constant: +0:62 false (const bool) +0:63 Constant: +0:63 false (const bool) +0:64 Constant: +0:64 false (const bool) +0:65 Constant: +0:65 true (const bool) +0:66 Constant: +0:66 false (const bool) +0:77 Function Definition: bar23( ( global void) +0:77 Function Parameters: +0:? Sequence +0:80 's' ( temp 4-component vector of float) +0:81 move second child to first child ( temp 4-component vector of float) +0:81 's' ( temp 4-component vector of float) +0:81 textureGatherOffset ( global 4-component vector of float) +0:81 'samp2DR' ( uniform sampler2DRect) +0:81 Constant: +0:81 0.300000 +0:81 0.300000 +0:81 Constant: +0:81 1 (const int) +0:81 1 (const int) +0:82 move second child to first child ( temp 4-component vector of float) +0:82 's' ( temp 4-component vector of float) +0:82 textureGatherOffset ( global 4-component vector of float) +0:82 'samp2D' ( uniform sampler2D) +0:82 Constant: +0:82 0.300000 +0:82 0.300000 +0:82 Constant: +0:82 1 (const int) +0:82 1 (const int) +0:83 move second child to first child ( temp 4-component vector of float) +0:83 's' ( temp 4-component vector of float) +0:83 textureGatherOffset ( global 4-component vector of float) +0:83 'samp2DA' ( uniform sampler2DArray) +0:83 Constant: +0:83 0.300000 +0:83 0.300000 +0:83 0.300000 +0:83 Constant: +0:83 1 (const int) +0:83 1 (const int) +0:84 move second child to first child ( temp 4-component vector of float) +0:84 's' ( temp 4-component vector of float) +0:84 textureGatherOffset ( global 4-component vector of float) +0:84 'samp2DS' ( uniform sampler2DShadow) +0:84 Constant: +0:84 0.300000 +0:84 0.300000 +0:84 Constant: +0:84 1.300000 +0:84 Constant: +0:84 1 (const int) +0:84 1 (const int) +0:85 move second child to first child ( temp 4-component vector of float) +0:85 's' ( temp 4-component vector of float) +0:85 textureGatherOffset ( global 4-component vector of float) +0:85 'samp2D' ( uniform sampler2D) +0:85 Constant: +0:85 0.300000 +0:85 0.300000 +0:85 Constant: +0:85 1 (const int) +0:85 1 (const int) +0:85 Constant: +0:85 2 (const int) +0:90 Function Definition: bar234( ( global void) +0:90 Function Parameters: +0:? Sequence +0:93 move second child to first child ( temp 4-component vector of float) +0:93 's' ( temp 4-component vector of float) +0:93 textureGatherOffset ( global 4-component vector of float) +0:93 'samp2D' ( uniform sampler2D) +0:93 Constant: +0:93 0.300000 +0:93 0.300000 +0:93 Constant: +0:93 1 (const int) +0:93 1 (const int) +0:94 move second child to first child ( temp 4-component vector of float) +0:94 's' ( temp 4-component vector of float) +0:94 textureGatherOffset ( global 4-component vector of float) +0:94 'samp2DA' ( uniform sampler2DArray) +0:94 Constant: +0:94 0.300000 +0:94 0.300000 +0:94 0.300000 +0:94 Constant: +0:94 1 (const int) +0:94 1 (const int) +0:95 move second child to first child ( temp 4-component vector of float) +0:95 's' ( temp 4-component vector of float) +0:95 textureGatherOffset ( global 4-component vector of float) +0:95 'samp2DR' ( uniform sampler2DRect) +0:95 Constant: +0:95 0.300000 +0:95 0.300000 +0:95 Constant: +0:95 1 (const int) +0:95 1 (const int) +0:96 move second child to first child ( temp 4-component vector of float) +0:96 's' ( temp 4-component vector of float) +0:96 textureGatherOffset ( global 4-component vector of float) +0:96 'samp2DS' ( uniform sampler2DShadow) +0:96 Constant: +0:96 0.300000 +0:96 0.300000 +0:96 Constant: +0:96 1.300000 +0:96 Constant: +0:96 1 (const int) +0:96 1 (const int) +0:97 move second child to first child ( temp 4-component vector of float) +0:97 's' ( temp 4-component vector of float) +0:97 textureGatherOffset ( global 4-component vector of float) +0:97 'samp2D' ( uniform sampler2D) +0:97 Constant: +0:97 0.300000 +0:97 0.300000 +0:97 Constant: +0:97 1 (const int) +0:97 1 (const int) +0:97 Constant: +0:97 2 (const int) +0:107 Function Definition: bar235( ( global void) +0:107 Function Parameters: +0:109 Sequence +0:109 Sequence +0:109 move second child to first child ( temp 3-component vector of int) +0:109 'a' ( temp 3-component vector of int) +0:109 textureSize ( global 3-component vector of int) +0:109 'Sca' ( uniform samplerCubeArray) +0:109 Constant: +0:109 3 (const int) +0:110 Sequence +0:110 move second child to first child ( temp 4-component vector of float) +0:110 'b' ( temp 4-component vector of float) +0:110 texture ( global 4-component vector of float) +0:110 'Sca' ( uniform samplerCubeArray) +0:110 'i' ( smooth in 4-component vector of float) +0:111 Sequence +0:111 move second child to first child ( temp 4-component vector of int) +0:111 'c' ( temp 4-component vector of int) +0:111 texture ( global 4-component vector of int) +0:111 'Isca' ( uniform isamplerCubeArray) +0:111 'i' ( smooth in 4-component vector of float) +0:111 Constant: +0:111 0.700000 +0:112 Sequence +0:112 move second child to first child ( temp 4-component vector of uint) +0:112 'd' ( temp 4-component vector of uint) +0:112 texture ( global 4-component vector of uint) +0:112 'Usca' ( uniform usamplerCubeArray) +0:112 'i' ( smooth in 4-component vector of float) +0:114 move second child to first child ( temp 4-component vector of float) +0:114 'b' ( temp 4-component vector of float) +0:114 textureLod ( global 4-component vector of float) +0:114 'Sca' ( uniform samplerCubeArray) +0:114 'i' ( smooth in 4-component vector of float) +0:114 Constant: +0:114 1.700000 +0:115 move second child to first child ( temp 3-component vector of int) +0:115 'a' ( temp 3-component vector of int) +0:115 textureSize ( global 3-component vector of int) +0:115 'Scas' ( uniform samplerCubeArrayShadow) +0:115 direct index ( temp int) +0:115 'a' ( temp 3-component vector of int) +0:115 Constant: +0:115 0 (const int) +0:116 Sequence +0:116 move second child to first child ( temp float) +0:116 'f' ( temp float) +0:116 texture ( global float) +0:116 'Scas' ( uniform samplerCubeArrayShadow) +0:116 'i' ( smooth in 4-component vector of float) +0:116 direct index ( temp float) +0:116 'b' ( temp 4-component vector of float) +0:116 Constant: +0:116 1 (const int) +0:117 move second child to first child ( temp 4-component vector of int) +0:117 'c' ( temp 4-component vector of int) +0:117 textureGrad ( global 4-component vector of int) +0:117 'Isca' ( uniform isamplerCubeArray) +0:117 'i' ( smooth in 4-component vector of float) +0:117 Constant: +0:117 0.100000 +0:117 0.100000 +0:117 0.100000 +0:117 Constant: +0:117 0.200000 +0:117 0.200000 +0:117 0.200000 +0:129 Function Definition: bar23444( ( global void) +0:129 Function Parameters: +0:? Sequence +0:132 Sequence +0:132 move second child to first child ( temp float) +0:132 'a1' ( temp float) +0:132 direct index ( temp float) +0:132 direct index ( temp 3-component vector of float) +0:132 'm43' ( temp 4X3 matrix of float) +0:132 Constant: +0:132 3 (const int) +0:132 Constant: +0:132 1 (const int) +0:134 Sequence +0:134 move second child to first child ( temp int) +0:134 'a2' ( temp int) +0:134 Constant: +0:134 4 (const int) +0:135 add second child into first child ( temp int) +0:135 'a2' ( temp int) +0:135 Constant: +0:135 3 (const int) +0:136 add second child into first child ( temp int) +0:136 'a2' ( temp int) +0:136 Constant: +0:136 3 (const int) +0:137 Sequence +0:137 move second child to first child ( temp float) +0:137 'b' ( const (read only) float) +0:137 component-wise multiply ( temp float) +0:137 Constant: +0:137 2.000000 +0:137 'a1' ( temp float) +0:138 move second child to first child ( temp float) +0:138 direct index ( temp float) +0:138 'a' ( global 3-component vector of float) +0:138 Constant: +0:138 0 (const int) +0:138 Constant: +0:138 -1.000000 +0:140 Constant: +0:140 0.000000 +0:141 Constant: +0:141 0.000000 +0:143 Constant: +0:143 1 (const int) +0:162 Function Definition: qux2( ( global void) +0:162 Function Parameters: +0:? Sequence +0:165 imageAtomicCompSwap ( global int) +0:165 'iimg2D' (layout( r32i) uniform iimage2D) +0:165 Construct ivec2 ( temp 2-component vector of int) +0:165 'i' ( temp int) +0:165 'i' ( temp int) +0:165 'i' ( temp int) +0:165 'i' ( temp int) +0:166 Sequence +0:166 move second child to first child ( temp 4-component vector of int) +0:166 'pos' ( temp 4-component vector of int) +0:166 imageLoad ( global 4-component vector of int) +0:166 'iimg2D' (layout( r32i) uniform iimage2D) +0:166 Construct ivec2 ( temp 2-component vector of int) +0:166 'i' ( temp int) +0:166 'i' ( temp int) +0:? Linker Objects +0:? 'a' ( global 3-component vector of float) +0:? 'b' ( global float) +0:? 'c' ( global int) +0:? 'i' ( smooth in 4-component vector of float) +0:? 'o' ( out 4-component vector of float) +0:? 'fflat' ( flat in float) +0:? 'fsmooth' ( smooth in float) +0:? 'fnop' ( noperspective in float) +0:? 'gl_ClipDistance' ( smooth in unsized 4-element array of float ClipDistance) +0:? 'sampC' ( uniform samplerCube) +0:? 'gl_Color' ( in 4-component vector of float Color) +0:? 'samp2D' ( uniform sampler2D) +0:? 'samp2DS' ( uniform sampler2DShadow) +0:? 'samp2DR' ( uniform sampler2DRect) +0:? 'samp2DA' ( uniform sampler2DArray) +0:? 'Sca' ( uniform samplerCubeArray) +0:? 'Isca' ( uniform isamplerCubeArray) +0:? 'Usca' ( uniform usamplerCubeArray) +0:? 'Scas' ( uniform samplerCubeArrayShadow) +0:? 'x' ( global int) +0:? 'ai' ( const 3-element array of int) +0:? 10 (const int) +0:? 23 (const int) +0:? 32 (const int) +0:? 'instanceName' (layout( binding=0 column_major shared) uniform block{layout( column_major shared) uniform int a}) +0:? 'bounds' (layout( binding=0) uniform sampler2D) +0:? 'gl_FogFragCoord' ( smooth in float) +0:? 'iimg2Dbad' (layout( r32i) uniform iimage2D) +0:? 'iimg2D' (layout( r32i) uniform iimage2D) + + +Linked fragment stage: + + +Shader version: 130 +Requested GL_ARB_gpu_shader5 +Requested GL_ARB_separate_shader_objects +Requested GL_ARB_shader_image_load_store +Requested GL_ARB_shading_language_420pack +Requested GL_ARB_texture_cube_map_array +Requested GL_ARB_texture_gather +Requested GL_ARB_texture_rectangle +using early_fragment_tests +ERROR: node is still EOpNull! +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:18 Sequence +0:18 Sequence +0:18 move second child to first child ( temp float) +0:18 'clip' ( temp float) +0:18 direct index ( smooth temp float ClipDistance) +0:18 'gl_ClipDistance' ( smooth in 4-element array of float ClipDistance) +0:18 Constant: +0:18 3 (const int) +0:? Linker Objects +0:? 'a' ( global 3-component vector of float) +0:? 'b' ( global float) +0:? 'c' ( global int) +0:? 'i' ( smooth in 4-component vector of float) +0:? 'o' ( out 4-component vector of float) +0:? 'fflat' ( flat in float) +0:? 'fsmooth' ( smooth in float) +0:? 'fnop' ( noperspective in float) +0:? 'gl_ClipDistance' ( smooth in 4-element array of float ClipDistance) +0:? 'sampC' ( uniform samplerCube) +0:? 'gl_Color' ( in 4-component vector of float Color) +0:? 'samp2D' ( uniform sampler2D) +0:? 'samp2DS' ( uniform sampler2DShadow) +0:? 'samp2DR' ( uniform sampler2DRect) +0:? 'samp2DA' ( uniform sampler2DArray) +0:? 'Sca' ( uniform samplerCubeArray) +0:? 'Isca' ( uniform isamplerCubeArray) +0:? 'Usca' ( uniform usamplerCubeArray) +0:? 'Scas' ( uniform samplerCubeArrayShadow) +0:? 'x' ( global int) +0:? 'ai' ( const 3-element array of int) +0:? 10 (const int) +0:? 23 (const int) +0:? 32 (const int) +0:? 'instanceName' (layout( binding=0 column_major shared) uniform block{layout( column_major shared) uniform int a}) +0:? 'bounds' (layout( binding=0) uniform sampler2D) +0:? 'gl_FogFragCoord' ( smooth in float) +0:? 'iimg2Dbad' (layout( r32i) uniform iimage2D) +0:? 'iimg2D' (layout( r32i) uniform iimage2D) + diff --git a/deps/glslang/Test/baseResults/130.vert.out b/deps/glslang/Test/baseResults/130.vert.out new file mode 100644 index 00000000..e38043c6 --- /dev/null +++ b/deps/glslang/Test/baseResults/130.vert.out @@ -0,0 +1,286 @@ +130.vert +ERROR: 0:59: 'gl_InstanceID' : undeclared identifier +ERROR: 0:59: '=' : cannot convert from ' temp float' to ' temp int' +ERROR: 0:61: 'texelFetch' : no matching overloaded function found +ERROR: 0:61: 'assign' : cannot convert from ' const float' to ' temp int' +ERROR: 4 compilation errors. No code generated. + + +Shader version: 130 +ERROR: node is still EOpNull! +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:17 Sequence +0:17 Sequence +0:17 move second child to first child ( temp float) +0:17 'f' ( temp float) +0:17 Constant: +0:17 3.000000 +0:18 switch +0:18 condition +0:18 'c' ( uniform int) +0:18 body +0:18 Sequence +0:19 case: with expression +0:19 Constant: +0:19 1 (const int) +0:? Sequence +0:20 move second child to first child ( temp float) +0:20 'f' ( temp float) +0:20 sine ( global float) +0:20 'f' ( temp float) +0:21 Branch: Break +0:22 case: with expression +0:22 Constant: +0:22 2 (const int) +0:? Sequence +0:23 move second child to first child ( temp float) +0:23 'f' ( temp float) +0:23 component-wise multiply ( temp float) +0:23 'f' ( temp float) +0:23 'f' ( temp float) +0:24 default: +0:? Sequence +0:25 move second child to first child ( temp float) +0:25 'f' ( temp float) +0:25 Constant: +0:25 3.000000 +0:29 move second child to first child ( temp uint) +0:29 'i' ( temp uint) +0:29 direct index ( temp uint) +0:29 texture ( global 4-component vector of uint) +0:29 'us2D' ( uniform usampler2D) +0:29 Convert int to float ( temp 2-component vector of float) +0:29 'x' ( in 2-component vector of int) +0:29 Constant: +0:29 3 (const int) +0:30 inclusive-or ( temp uint) +0:30 left-shift ( temp uint) +0:30 'i' ( temp uint) +0:30 Constant: +0:30 3 (const uint) +0:30 Constant: +0:30 69 (const uint) +0:33 Sequence +0:33 move second child to first child ( temp 3-component vector of float) +0:33 'v11' ( temp 3-component vector of float) +0:33 modf ( global 3-component vector of float) +0:33 'modfIn' ( temp 3-component vector of float) +0:33 'modfOut' ( temp 3-component vector of float) +0:34 Sequence +0:34 move second child to first child ( temp float) +0:34 't' ( temp float) +0:34 trunc ( global float) +0:34 'f' ( temp float) +0:35 Sequence +0:35 move second child to first child ( temp 2-component vector of float) +0:35 'v12' ( temp 2-component vector of float) +0:35 round ( global 2-component vector of float) +0:35 'v2a' ( in 2-component vector of float) +0:36 Sequence +0:36 move second child to first child ( temp 2-component vector of float) +0:36 'v13' ( temp 2-component vector of float) +0:36 roundEven ( global 2-component vector of float) +0:36 'v2a' ( in 2-component vector of float) +0:37 Sequence +0:37 move second child to first child ( temp 2-component vector of bool) +0:37 'b10' ( temp 2-component vector of bool) +0:37 isnan ( global 2-component vector of bool) +0:37 'v2a' ( in 2-component vector of float) +0:38 Sequence +0:38 move second child to first child ( temp 4-component vector of bool) +0:38 'b11' ( temp 4-component vector of bool) +0:38 isinf ( global 4-component vector of bool) +0:38 'v4' ( uniform 4-component vector of float) +0:40 add ( temp 2-component vector of float) +0:40 hyp. sine ( global float) +0:40 'c1D' ( in float) +0:41 vector-scale ( temp 2-component vector of float) +0:41 hyp. cosine ( global float) +0:41 'c1D' ( in float) +0:41 hyp. tangent ( global 2-component vector of float) +0:41 'c2D' ( in 2-component vector of float) +0:42 add ( temp 4-component vector of float) +0:42 arc hyp. sine ( global 4-component vector of float) +0:42 'c4D' ( smooth temp 4-component vector of float) +0:42 arc hyp. cosine ( global 4-component vector of float) +0:42 'c4D' ( smooth temp 4-component vector of float) +0:43 arc hyp. tangent ( global 3-component vector of float) +0:43 'c3D' ( in 3-component vector of float) +0:45 Sequence +0:45 move second child to first child ( temp int) +0:45 'id' ( temp int) +0:45 'gl_VertexID' ( gl_VertexId int VertexId) +0:46 move second child to first child ( temp float) +0:46 direct index ( smooth temp float ClipDistance) +0:46 'gl_ClipDistance' ( smooth out unsized 2-element array of float ClipDistance) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 0.300000 +0:57 Function Definition: foo88( ( global void) +0:57 Function Parameters: +0:? Sequence +0:61 'id' ( temp int) +0:63 'gl_ClipVertex' ( gl_ClipVertex 4-component vector of float ClipVertex) +0:64 'gl_Color' ( in 4-component vector of float Color) +0:65 direct index ( temp structure{ global 4-component vector of float ambient, global 4-component vector of float diffuse, global 4-component vector of float specular, global 4-component vector of float position, global 4-component vector of float halfVector, global 3-component vector of float spotDirection, global float spotExponent, global float spotCutoff, global float spotCosCutoff, global float constantAttenuation, global float linearAttenuation, global float quadraticAttenuation}) +0:65 'gl_LightSource' ( uniform 32-element array of structure{ global 4-component vector of float ambient, global 4-component vector of float diffuse, global 4-component vector of float specular, global 4-component vector of float position, global 4-component vector of float halfVector, global 3-component vector of float spotDirection, global float spotExponent, global float spotCutoff, global float spotCosCutoff, global float constantAttenuation, global float linearAttenuation, global float quadraticAttenuation}) +0:65 Constant: +0:65 0 (const int) +0:66 far: direct index for structure ( global float) +0:66 'gl_DepthRange' ( uniform structure{ global float near, global float far, global float diff}) +0:66 Constant: +0:66 1 (const int) +0:67 'gl_TexCoord' ( smooth out unsized 1-element array of 4-component vector of float TexCoord) +0:68 'gl_FogFragCoord' ( smooth out float FogFragCoord) +0:69 'gl_FrontColor' ( smooth out 4-component vector of float FrontColor) +0:? Linker Objects +0:? 'c' ( uniform int) +0:? 'us2D' ( uniform usampler2D) +0:? 'x' ( in 2-component vector of int) +0:? 'v2a' ( in 2-component vector of float) +0:? 'c1D' ( in float) +0:? 'c2D' ( in 2-component vector of float) +0:? 'c3D' ( in 3-component vector of float) +0:? 'c4D' ( smooth temp 4-component vector of float) +0:? 'v4' ( uniform 4-component vector of float) +0:? 'gl_ClipDistance' ( smooth out unsized 2-element array of float ClipDistance) +0:? 'gl_TexCoord' ( smooth out unsized 1-element array of 4-component vector of float TexCoord) +0:? 'abcdef' ( global int) +0:? 'qrstuv' ( global int) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) + + +Linked vertex stage: + +ERROR: Linking vertex stage: Can only use one of gl_ClipDistance or gl_ClipVertex (gl_ClipDistance is preferred) + +Shader version: 130 +ERROR: node is still EOpNull! +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:17 Sequence +0:17 Sequence +0:17 move second child to first child ( temp float) +0:17 'f' ( temp float) +0:17 Constant: +0:17 3.000000 +0:18 switch +0:18 condition +0:18 'c' ( uniform int) +0:18 body +0:18 Sequence +0:19 case: with expression +0:19 Constant: +0:19 1 (const int) +0:? Sequence +0:20 move second child to first child ( temp float) +0:20 'f' ( temp float) +0:20 sine ( global float) +0:20 'f' ( temp float) +0:21 Branch: Break +0:22 case: with expression +0:22 Constant: +0:22 2 (const int) +0:? Sequence +0:23 move second child to first child ( temp float) +0:23 'f' ( temp float) +0:23 component-wise multiply ( temp float) +0:23 'f' ( temp float) +0:23 'f' ( temp float) +0:24 default: +0:? Sequence +0:25 move second child to first child ( temp float) +0:25 'f' ( temp float) +0:25 Constant: +0:25 3.000000 +0:29 move second child to first child ( temp uint) +0:29 'i' ( temp uint) +0:29 direct index ( temp uint) +0:29 texture ( global 4-component vector of uint) +0:29 'us2D' ( uniform usampler2D) +0:29 Convert int to float ( temp 2-component vector of float) +0:29 'x' ( in 2-component vector of int) +0:29 Constant: +0:29 3 (const int) +0:30 inclusive-or ( temp uint) +0:30 left-shift ( temp uint) +0:30 'i' ( temp uint) +0:30 Constant: +0:30 3 (const uint) +0:30 Constant: +0:30 69 (const uint) +0:33 Sequence +0:33 move second child to first child ( temp 3-component vector of float) +0:33 'v11' ( temp 3-component vector of float) +0:33 modf ( global 3-component vector of float) +0:33 'modfIn' ( temp 3-component vector of float) +0:33 'modfOut' ( temp 3-component vector of float) +0:34 Sequence +0:34 move second child to first child ( temp float) +0:34 't' ( temp float) +0:34 trunc ( global float) +0:34 'f' ( temp float) +0:35 Sequence +0:35 move second child to first child ( temp 2-component vector of float) +0:35 'v12' ( temp 2-component vector of float) +0:35 round ( global 2-component vector of float) +0:35 'v2a' ( in 2-component vector of float) +0:36 Sequence +0:36 move second child to first child ( temp 2-component vector of float) +0:36 'v13' ( temp 2-component vector of float) +0:36 roundEven ( global 2-component vector of float) +0:36 'v2a' ( in 2-component vector of float) +0:37 Sequence +0:37 move second child to first child ( temp 2-component vector of bool) +0:37 'b10' ( temp 2-component vector of bool) +0:37 isnan ( global 2-component vector of bool) +0:37 'v2a' ( in 2-component vector of float) +0:38 Sequence +0:38 move second child to first child ( temp 4-component vector of bool) +0:38 'b11' ( temp 4-component vector of bool) +0:38 isinf ( global 4-component vector of bool) +0:38 'v4' ( uniform 4-component vector of float) +0:40 add ( temp 2-component vector of float) +0:40 hyp. sine ( global float) +0:40 'c1D' ( in float) +0:41 vector-scale ( temp 2-component vector of float) +0:41 hyp. cosine ( global float) +0:41 'c1D' ( in float) +0:41 hyp. tangent ( global 2-component vector of float) +0:41 'c2D' ( in 2-component vector of float) +0:42 add ( temp 4-component vector of float) +0:42 arc hyp. sine ( global 4-component vector of float) +0:42 'c4D' ( smooth temp 4-component vector of float) +0:42 arc hyp. cosine ( global 4-component vector of float) +0:42 'c4D' ( smooth temp 4-component vector of float) +0:43 arc hyp. tangent ( global 3-component vector of float) +0:43 'c3D' ( in 3-component vector of float) +0:45 Sequence +0:45 move second child to first child ( temp int) +0:45 'id' ( temp int) +0:45 'gl_VertexID' ( gl_VertexId int VertexId) +0:46 move second child to first child ( temp float) +0:46 direct index ( smooth temp float ClipDistance) +0:46 'gl_ClipDistance' ( smooth out 2-element array of float ClipDistance) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 0.300000 +0:? Linker Objects +0:? 'c' ( uniform int) +0:? 'us2D' ( uniform usampler2D) +0:? 'x' ( in 2-component vector of int) +0:? 'v2a' ( in 2-component vector of float) +0:? 'c1D' ( in float) +0:? 'c2D' ( in 2-component vector of float) +0:? 'c3D' ( in 3-component vector of float) +0:? 'c4D' ( smooth temp 4-component vector of float) +0:? 'v4' ( uniform 4-component vector of float) +0:? 'gl_ClipDistance' ( smooth out 2-element array of float ClipDistance) +0:? 'gl_TexCoord' ( smooth out 1-element array of 4-component vector of float TexCoord) +0:? 'abcdef' ( global int) +0:? 'qrstuv' ( global int) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) + diff --git a/deps/glslang/Test/baseResults/140.frag.out b/deps/glslang/Test/baseResults/140.frag.out new file mode 100644 index 00000000..7ce21703 --- /dev/null +++ b/deps/glslang/Test/baseResults/140.frag.out @@ -0,0 +1,169 @@ +140.frag +WARNING: 0:3: varying deprecated in version 130; may be removed in future release +ERROR: 0:17: '#error' : GL_ES is not set +ERROR: 0:20: 'fragment-shader struct input' : not supported for this version or the enabled extensions +ERROR: 0:24: 'location' : not supported for this version or the enabled extensions +ERROR: 0:24: 'location qualifier on input' : not supported for this version or the enabled extensions +ERROR: 0:26: 'location' : not supported for this version or the enabled extensions +ERROR: 0:26: 'location qualifier on output' : not supported for this version or the enabled extensions +ERROR: 0:40: 'assign' : l-value required "v" (can't modify shader input) +ERROR: 0:40: 'out' : Non-L-value cannot be passed for 'out' or 'inout' parameters. +ERROR: 8 compilation errors. No code generated. + + +Shader version: 140 +Requested GL_ARB_explicit_attrib_location +Requested GL_ARB_separate_shader_objects +ERROR: node is still EOpNull! +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 Sequence +0:12 move second child to first child ( temp float) +0:12 'clip' ( temp float) +0:12 direct index ( smooth temp float ClipDistance) +0:12 'gl_ClipDistance' ( smooth in 5-element array of float ClipDistance) +0:12 Constant: +0:12 2 (const int) +0:22 Sequence +0:22 move second child to first child ( temp float) +0:22 'patch' ( global float) +0:22 Constant: +0:22 3.100000 +0:38 Function Definition: foo( ( global void) +0:38 Function Parameters: +0:40 Sequence +0:40 Sequence +0:40 move second child to first child ( temp 2-component vector of float) +0:40 'r1' ( temp 2-component vector of float) +0:40 modf ( global 2-component vector of float) +0:40 vector swizzle ( temp 2-component vector of float) +0:40 'v' ( smooth in 4-component vector of float) +0:40 Sequence +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 vector swizzle ( temp 2-component vector of float) +0:40 'v' ( smooth in 4-component vector of float) +0:40 Sequence +0:40 Constant: +0:40 2 (const int) +0:40 Constant: +0:40 3 (const int) +0:41 Sequence +0:41 move second child to first child ( temp 2-component vector of float) +0:41 'r2' ( temp 2-component vector of float) +0:41 modf ( global 2-component vector of float) +0:41 vector swizzle ( temp 2-component vector of float) +0:41 'o' ( out 4-component vector of float) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 vector swizzle ( temp 2-component vector of float) +0:41 'o' ( out 4-component vector of float) +0:41 Sequence +0:41 Constant: +0:41 2 (const int) +0:41 Constant: +0:41 3 (const int) +0:42 move second child to first child ( temp float) +0:42 direct index ( temp float) +0:42 'o' ( out 4-component vector of float) +0:42 Constant: +0:42 2 (const int) +0:42 Function Call: fooi( ( global float) +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'i1' ( global float) +0:47 Test condition and select ( temp float) +0:47 Condition +0:47 'gl_FrontFacing' ( gl_FrontFacing bool Face) +0:47 true case +0:47 Constant: +0:47 -2.000000 +0:47 false case +0:47 Constant: +0:47 2.000000 +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'i2' ( global float) +0:48 Constant: +0:48 102.000000 +0:50 Function Definition: fooi( ( global float) +0:50 Function Parameters: +0:52 Sequence +0:52 Branch: Return with expression +0:52 add ( temp float) +0:52 'i1' ( global float) +0:52 'i2' ( global float) +0:? Linker Objects +0:? 'v' ( smooth in 4-component vector of float) +0:? 'i' ( smooth in 4-component vector of float) +0:? 'o' ( out 4-component vector of float) +0:? 'gl_ClipDistance' ( smooth in 5-element array of float ClipDistance) +0:? 's' ( smooth in structure{ global float f}) +0:? 'patch' ( global float) +0:? 'vl' (layout( location=3) smooth in 4-component vector of float) +0:? 'factorBad' (layout( location=3) out 4-component vector of float) +0:? 'factor' (layout( location=5) out 4-component vector of float) +0:? 'vl2' (layout( location=4) smooth in 4-component vector of float) +0:? 'i1' ( global float) +0:? 'i2' ( global float) + + +Linked fragment stage: + + +Shader version: 140 +Requested GL_ARB_explicit_attrib_location +Requested GL_ARB_separate_shader_objects +ERROR: node is still EOpNull! +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 Sequence +0:12 move second child to first child ( temp float) +0:12 'clip' ( temp float) +0:12 direct index ( smooth temp float ClipDistance) +0:12 'gl_ClipDistance' ( smooth in 5-element array of float ClipDistance) +0:12 Constant: +0:12 2 (const int) +0:22 Sequence +0:22 move second child to first child ( temp float) +0:22 'patch' ( global float) +0:22 Constant: +0:22 3.100000 +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'i1' ( global float) +0:47 Test condition and select ( temp float) +0:47 Condition +0:47 'gl_FrontFacing' ( gl_FrontFacing bool Face) +0:47 true case +0:47 Constant: +0:47 -2.000000 +0:47 false case +0:47 Constant: +0:47 2.000000 +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'i2' ( global float) +0:48 Constant: +0:48 102.000000 +0:? Linker Objects +0:? 'v' ( smooth in 4-component vector of float) +0:? 'i' ( smooth in 4-component vector of float) +0:? 'o' ( out 4-component vector of float) +0:? 'gl_ClipDistance' ( smooth in 5-element array of float ClipDistance) +0:? 's' ( smooth in structure{ global float f}) +0:? 'patch' ( global float) +0:? 'vl' (layout( location=3) smooth in 4-component vector of float) +0:? 'factorBad' (layout( location=3) out 4-component vector of float) +0:? 'factor' (layout( location=5) out 4-component vector of float) +0:? 'vl2' (layout( location=4) smooth in 4-component vector of float) +0:? 'i1' ( global float) +0:? 'i2' ( global float) + diff --git a/deps/glslang/Test/baseResults/140.vert.out b/deps/glslang/Test/baseResults/140.vert.out new file mode 100644 index 00000000..020afd08 --- /dev/null +++ b/deps/glslang/Test/baseResults/140.vert.out @@ -0,0 +1,215 @@ +140.vert +ERROR: 0:23: 'gl_Position' : identifiers starting with "gl_" are reserved +ERROR: 0:25: 'location' : not supported for this version or the enabled extensions +ERROR: 0:25: 'location qualifier on input' : not supported for this version or the enabled extensions +ERROR: 0:34: 'redeclaration' : cannot change storage, memory, or auxiliary qualification of gl_Position +ERROR: 0:34: 'redeclaration' : cannot change interpolation qualification of gl_Position +ERROR: 0:35: 'redeclaration' : cannot change the type of gl_Position +ERROR: 0:38: 'gl_ClipVertex' : cannot redeclare after use +ERROR: 0:39: 'gl_FogFragCoord' : cannot redeclare after use +ERROR: 0:51: 'texelFetch' : no matching overloaded function found +ERROR: 0:53: 'texture' : no matching overloaded function found +ERROR: 0:63: 'gl_DeviceIndex' : required extension not requested: GL_EXT_device_group +ERROR: 0:64: 'gl_ViewIndex' : required extension not requested: GL_EXT_multiview +ERROR: 12 compilation errors. No code generated. + + +Shader version: 140 +Requested GL_ARB_explicit_attrib_location +Requested GL_ARB_separate_shader_objects +Requested GL_EXT_device_group +Requested GL_EXT_multiview +ERROR: node is still EOpNull! +0:9 Function Definition: main( ( global void) +0:9 Function Parameters: +0:11 Sequence +0:11 Sequence +0:11 move second child to first child ( temp int) +0:11 'id' ( temp int) +0:11 'gl_InstanceID' ( gl_InstanceId int InstanceId) +0:12 add second child into first child ( temp int) +0:12 'id' ( temp int) +0:12 anonMem: direct index for structure (layout( column_major std140 offset=0) uniform int) +0:12 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform int anonMem}) +0:12 Constant: +0:12 0 (const uint) +0:13 add second child into first child ( temp int) +0:13 'id' ( temp int) +0:13 direct index ( temp int) +0:13 textureFetch ( global 4-component vector of int) +0:13 'sbuf' ( uniform isamplerBuffer) +0:13 Constant: +0:13 8 (const int) +0:13 Constant: +0:13 3 (const int) +0:14 'gl_ClipVertex' ( gl_ClipVertex 4-component vector of float ClipVertex) +0:15 'gl_Color' ( in 4-component vector of float Color) +0:16 direct index ( temp structure{ global 4-component vector of float ambient, global 4-component vector of float diffuse, global 4-component vector of float specular, global 4-component vector of float position, global 4-component vector of float halfVector, global 3-component vector of float spotDirection, global float spotExponent, global float spotCutoff, global float spotCosCutoff, global float constantAttenuation, global float linearAttenuation, global float quadraticAttenuation}) +0:16 'gl_LightSource' ( uniform 32-element array of structure{ global 4-component vector of float ambient, global 4-component vector of float diffuse, global 4-component vector of float specular, global 4-component vector of float position, global 4-component vector of float halfVector, global 3-component vector of float spotDirection, global float spotExponent, global float spotCutoff, global float spotCosCutoff, global float constantAttenuation, global float linearAttenuation, global float quadraticAttenuation}) +0:16 Constant: +0:16 0 (const int) +0:17 far: direct index for structure ( global float) +0:17 'gl_DepthRange' ( uniform structure{ global float near, global float far, global float diff}) +0:17 Constant: +0:17 1 (const int) +0:18 'gl_TexCoord' ( smooth out unsized 1-element array of 4-component vector of float TexCoord) +0:19 'gl_FogFragCoord' ( smooth out float FogFragCoord) +0:20 'gl_FrontColor' ( smooth out 4-component vector of float FrontColor) +0:48 Function Definition: foo( ( global void) +0:48 Function Parameters: +0:50 Sequence +0:50 Sequence +0:50 move second child to first child ( temp 4-component vector of float) +0:50 'v' ( temp 4-component vector of float) +0:50 textureFetch ( global 4-component vector of float) +0:50 's2dr' ( uniform sampler2DRect) +0:50 'itloc2' ( in 2-component vector of int) +0:51 add second child into first child ( temp 4-component vector of float) +0:51 'v' ( temp 4-component vector of float) +0:51 Constant: +0:51 0.000000 +0:52 add second child into first child ( temp 4-component vector of float) +0:52 'v' ( temp 4-component vector of float) +0:52 texture ( global 4-component vector of float) +0:52 's2dr' ( uniform sampler2DRect) +0:52 'tloc2' ( in 2-component vector of float) +0:53 add second child into first child ( temp 4-component vector of float) +0:53 'v' ( temp 4-component vector of float) +0:53 Constant: +0:53 0.000000 +0:54 add second child into first child ( temp 4-component vector of float) +0:54 'v' ( temp 4-component vector of float) +0:54 texture ( global float) +0:54 's2drs' ( uniform sampler2DRectShadow) +0:54 'tloc3' ( in 3-component vector of float) +0:55 add second child into first child ( temp 4-component vector of float) +0:55 'v' ( temp 4-component vector of float) +0:55 textureProj ( global 4-component vector of float) +0:55 's2dr' ( uniform sampler2DRect) +0:55 'tloc3' ( in 3-component vector of float) +0:56 add second child into first child ( temp 4-component vector of float) +0:56 'v' ( temp 4-component vector of float) +0:56 textureProj ( global 4-component vector of float) +0:56 's2dr' ( uniform sampler2DRect) +0:56 'tloc4' ( in 4-component vector of float) +0:57 add second child into first child ( temp 4-component vector of float) +0:57 'v' ( temp 4-component vector of float) +0:57 textureProjGradOffset ( global 4-component vector of float) +0:57 's2dr' ( uniform sampler2DRect) +0:57 'tloc4' ( in 4-component vector of float) +0:57 Constant: +0:57 0.000000 +0:57 0.000000 +0:57 Constant: +0:57 0.000000 +0:57 0.000000 +0:57 Constant: +0:57 1 (const int) +0:57 2 (const int) +0:58 add second child into first child ( temp 4-component vector of float) +0:58 'v' ( temp 4-component vector of float) +0:58 textureProjGradOffset ( global float) +0:58 's2drs' ( uniform sampler2DRectShadow) +0:58 'tloc4' ( in 4-component vector of float) +0:58 Constant: +0:58 0.000000 +0:58 0.000000 +0:58 Constant: +0:58 0.000000 +0:58 0.000000 +0:58 Constant: +0:58 1 (const int) +0:58 2 (const int) +0:61 Function Definition: devi( ( global void) +0:61 Function Parameters: +0:63 Sequence +0:63 'gl_DeviceIndex' ( in int DeviceIndex) +0:64 'gl_ViewIndex' ( in int ViewIndex) +0:75 Function Definition: devie( ( global void) +0:75 Function Parameters: +0:77 Sequence +0:77 'gl_DeviceIndex' ( in int DeviceIndex) +0:78 'gl_ViewIndex' ( in int ViewIndex) +0:? Linker Objects +0:? 'sbuf' ( uniform isamplerBuffer) +0:? 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform int anonMem}) +0:? 'gl_TexCoord' ( smooth out unsized 1-element array of 4-component vector of float TexCoord) +0:? 'gl_Position' ( smooth out 4-component vector of float) +0:? 'locBad' (layout( location=9) in 4-component vector of float) +0:? 'loc' (layout( location=9) in 4-component vector of float) +0:? 'gl_PointSize' ( gl_PointSize float PointSize) +0:? 'gl_ClipVertex' ( gl_ClipVertex 4-component vector of float ClipVertex) +0:? 'gl_FogFragCoord' ( smooth out float FogFragCoord) +0:? 's2dr' ( uniform sampler2DRect) +0:? 's2drs' ( uniform sampler2DRectShadow) +0:? 'itloc2' ( in 2-component vector of int) +0:? 'tloc2' ( in 2-component vector of float) +0:? 'tloc3' ( in 3-component vector of float) +0:? 'tloc4' ( in 4-component vector of float) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 140 +Requested GL_ARB_explicit_attrib_location +Requested GL_ARB_separate_shader_objects +Requested GL_EXT_device_group +Requested GL_EXT_multiview +ERROR: node is still EOpNull! +0:9 Function Definition: main( ( global void) +0:9 Function Parameters: +0:11 Sequence +0:11 Sequence +0:11 move second child to first child ( temp int) +0:11 'id' ( temp int) +0:11 'gl_InstanceID' ( gl_InstanceId int InstanceId) +0:12 add second child into first child ( temp int) +0:12 'id' ( temp int) +0:12 anonMem: direct index for structure (layout( column_major std140 offset=0) uniform int) +0:12 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform int anonMem}) +0:12 Constant: +0:12 0 (const uint) +0:13 add second child into first child ( temp int) +0:13 'id' ( temp int) +0:13 direct index ( temp int) +0:13 textureFetch ( global 4-component vector of int) +0:13 'sbuf' ( uniform isamplerBuffer) +0:13 Constant: +0:13 8 (const int) +0:13 Constant: +0:13 3 (const int) +0:14 'gl_ClipVertex' ( gl_ClipVertex 4-component vector of float ClipVertex) +0:15 'gl_Color' ( in 4-component vector of float Color) +0:16 direct index ( temp structure{ global 4-component vector of float ambient, global 4-component vector of float diffuse, global 4-component vector of float specular, global 4-component vector of float position, global 4-component vector of float halfVector, global 3-component vector of float spotDirection, global float spotExponent, global float spotCutoff, global float spotCosCutoff, global float constantAttenuation, global float linearAttenuation, global float quadraticAttenuation}) +0:16 'gl_LightSource' ( uniform 32-element array of structure{ global 4-component vector of float ambient, global 4-component vector of float diffuse, global 4-component vector of float specular, global 4-component vector of float position, global 4-component vector of float halfVector, global 3-component vector of float spotDirection, global float spotExponent, global float spotCutoff, global float spotCosCutoff, global float constantAttenuation, global float linearAttenuation, global float quadraticAttenuation}) +0:16 Constant: +0:16 0 (const int) +0:17 far: direct index for structure ( global float) +0:17 'gl_DepthRange' ( uniform structure{ global float near, global float far, global float diff}) +0:17 Constant: +0:17 1 (const int) +0:18 'gl_TexCoord' ( smooth out 1-element array of 4-component vector of float TexCoord) +0:19 'gl_FogFragCoord' ( smooth out float FogFragCoord) +0:20 'gl_FrontColor' ( smooth out 4-component vector of float FrontColor) +0:? Linker Objects +0:? 'sbuf' ( uniform isamplerBuffer) +0:? 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform int anonMem}) +0:? 'gl_TexCoord' ( smooth out 1-element array of 4-component vector of float TexCoord) +0:? 'gl_Position' ( smooth out 4-component vector of float) +0:? 'locBad' (layout( location=9) in 4-component vector of float) +0:? 'loc' (layout( location=9) in 4-component vector of float) +0:? 'gl_PointSize' ( gl_PointSize float PointSize) +0:? 'gl_ClipVertex' ( gl_ClipVertex 4-component vector of float ClipVertex) +0:? 'gl_FogFragCoord' ( smooth out float FogFragCoord) +0:? 's2dr' ( uniform sampler2DRect) +0:? 's2drs' ( uniform sampler2DRectShadow) +0:? 'itloc2' ( in 2-component vector of int) +0:? 'tloc2' ( in 2-component vector of float) +0:? 'tloc3' ( in 3-component vector of float) +0:? 'tloc4' ( in 4-component vector of float) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/150.frag.out b/deps/glslang/Test/baseResults/150.frag.out new file mode 100644 index 00000000..1454b558 --- /dev/null +++ b/deps/glslang/Test/baseResults/150.frag.out @@ -0,0 +1,158 @@ +150.frag +ERROR: 0:4: 'redeclaration' : cannot redeclare with different qualification: gl_FragCoord +ERROR: 0:5: 'redeclaration' : cannot redeclare with different qualification: gl_FragCoord +ERROR: 0:6: 'layout qualifier' : can only apply origin_upper_left and pixel_center_origin to gl_FragCoord +ERROR: 0:14: 'gl_FragCoord' : cannot redeclare after use +ERROR: 4 compilation errors. No code generated. + + +Shader version: 150 +gl_FragCoord pixel center is integer +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:9 Function Definition: main( ( global void) +0:9 Function Parameters: +0:11 Sequence +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:11 'c' ( temp 4-component vector of float) +0:11 'gl_FragCoord' ( gl_FragCoord 4-component vector of float FragCoord) +0:18 Sequence +0:18 move second child to first child ( temp float) +0:18 'patch' ( global float) +0:18 Constant: +0:18 3.100000 +0:31 Function Definition: barWxyz( ( global void) +0:31 Function Parameters: +0:33 Sequence +0:33 Sequence +0:33 move second child to first child ( temp 2-component vector of int) +0:33 't11' ( temp 2-component vector of int) +0:33 textureSize ( global 2-component vector of int) +0:33 'sms' ( uniform sampler2DMS) +0:34 Sequence +0:34 move second child to first child ( temp 2-component vector of int) +0:34 't12' ( temp 2-component vector of int) +0:34 textureSize ( global 2-component vector of int) +0:34 'isms' ( uniform isampler2DMS) +0:35 Sequence +0:35 move second child to first child ( temp 2-component vector of int) +0:35 't13' ( temp 2-component vector of int) +0:35 textureSize ( global 2-component vector of int) +0:35 'usms' ( uniform usampler2DMS) +0:36 Sequence +0:36 move second child to first child ( temp 3-component vector of int) +0:36 't21' ( temp 3-component vector of int) +0:36 textureSize ( global 3-component vector of int) +0:36 'smsa' ( uniform sampler2DMSArray) +0:37 Sequence +0:37 move second child to first child ( temp 3-component vector of int) +0:37 't22' ( temp 3-component vector of int) +0:37 textureSize ( global 3-component vector of int) +0:37 'ismsa' ( uniform isampler2DMSArray) +0:38 Sequence +0:38 move second child to first child ( temp 3-component vector of int) +0:38 't23' ( temp 3-component vector of int) +0:38 textureSize ( global 3-component vector of int) +0:38 'usmsa' ( uniform usampler2DMSArray) +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 't31' ( temp 4-component vector of float) +0:39 textureFetch ( global 4-component vector of float) +0:39 'sms' ( uniform sampler2DMS) +0:39 'p2' ( flat in 2-component vector of int) +0:39 'samp' ( flat in int) +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of int) +0:40 't32' ( temp 4-component vector of int) +0:40 textureFetch ( global 4-component vector of int) +0:40 'isms' ( uniform isampler2DMS) +0:40 'p2' ( flat in 2-component vector of int) +0:40 'samp' ( flat in int) +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of uint) +0:41 't33' ( temp 4-component vector of uint) +0:41 textureFetch ( global 4-component vector of uint) +0:41 'usms' ( uniform usampler2DMS) +0:41 'p2' ( flat in 2-component vector of int) +0:41 Constant: +0:41 3 (const int) +0:42 Sequence +0:42 move second child to first child ( temp 4-component vector of float) +0:42 't41' ( temp 4-component vector of float) +0:42 textureFetch ( global 4-component vector of float) +0:42 'smsa' ( uniform sampler2DMSArray) +0:42 'p3' ( flat in 3-component vector of int) +0:42 'samp' ( flat in int) +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of int) +0:43 't42' ( temp 4-component vector of int) +0:43 textureFetch ( global 4-component vector of int) +0:43 'ismsa' ( uniform isampler2DMSArray) +0:43 Constant: +0:43 2 (const int) +0:43 2 (const int) +0:43 2 (const int) +0:43 'samp' ( flat in int) +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of uint) +0:44 't43' ( temp 4-component vector of uint) +0:44 textureFetch ( global 4-component vector of uint) +0:44 'usmsa' ( uniform usampler2DMSArray) +0:44 'p3' ( flat in 3-component vector of int) +0:44 'samp' ( flat in int) +0:47 Function Definition: primitiveID( ( global int) +0:47 Function Parameters: +0:49 Sequence +0:49 Branch: Return with expression +0:49 'gl_PrimitiveID' ( flat in int PrimitiveID) +0:? Linker Objects +0:? 'gl_FragCoord' ( gl_FragCoord 4-component vector of float FragCoord) +0:? 'foo' ( smooth in 4-component vector of float) +0:? 's' ( smooth in structure{ global float f}) +0:? 'patch' ( global float) +0:? 'sms' ( uniform sampler2DMS) +0:? 'isms' ( uniform isampler2DMS) +0:? 'usms' ( uniform usampler2DMS) +0:? 'smsa' ( uniform sampler2DMSArray) +0:? 'ismsa' ( uniform isampler2DMSArray) +0:? 'usmsa' ( uniform usampler2DMSArray) +0:? 'p2' ( flat in 2-component vector of int) +0:? 'p3' ( flat in 3-component vector of int) +0:? 'samp' ( flat in int) + + +Linked fragment stage: + + +Shader version: 150 +gl_FragCoord pixel center is integer +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:9 Function Definition: main( ( global void) +0:9 Function Parameters: +0:11 Sequence +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:11 'c' ( temp 4-component vector of float) +0:11 'gl_FragCoord' ( gl_FragCoord 4-component vector of float FragCoord) +0:18 Sequence +0:18 move second child to first child ( temp float) +0:18 'patch' ( global float) +0:18 Constant: +0:18 3.100000 +0:? Linker Objects +0:? 'gl_FragCoord' ( gl_FragCoord 4-component vector of float FragCoord) +0:? 'foo' ( smooth in 4-component vector of float) +0:? 's' ( smooth in structure{ global float f}) +0:? 'patch' ( global float) +0:? 'sms' ( uniform sampler2DMS) +0:? 'isms' ( uniform isampler2DMS) +0:? 'usms' ( uniform usampler2DMS) +0:? 'smsa' ( uniform sampler2DMSArray) +0:? 'ismsa' ( uniform isampler2DMSArray) +0:? 'usmsa' ( uniform usampler2DMSArray) +0:? 'p2' ( flat in 2-component vector of int) +0:? 'p3' ( flat in 3-component vector of int) +0:? 'samp' ( flat in int) + diff --git a/deps/glslang/Test/baseResults/150.geom.out b/deps/glslang/Test/baseResults/150.geom.out new file mode 100644 index 00000000..92b8e1aa --- /dev/null +++ b/deps/glslang/Test/baseResults/150.geom.out @@ -0,0 +1,289 @@ +150.geom +ERROR: 0:15: 'fromVertex' : block instance name redefinition +ERROR: 0:19: 'fromVertex' : redefinition +ERROR: 0:21: 'fooC' : block instance name redefinition +ERROR: 0:29: 'EmitStreamVertex' : no matching overloaded function found +ERROR: 0:30: 'EndStreamPrimitive' : no matching overloaded function found +ERROR: 0:44: 'stream' : can only be used on an output +ERROR: 0:45: 'stream' : can only be used on an output +ERROR: 0:46: 'stream' : can only be used on an output +ERROR: 0:47: 'stream' : can only be used on an output +ERROR: 0:47: 'stream' : can only be used on an output +ERROR: 0:60: 'stream' : member cannot contradict block +ERROR: 0:66: 'max_vertices' : too large, must be less than gl_MaxGeometryOutputVertices +ERROR: 0:66: 'max_vertices' : cannot change previously set layout value +ERROR: 0:67: 'max_vertices' : can only apply to a standalone qualifier +ERROR: 0:72: 'points' : cannot change previously set output primitive +ERROR: 0:73: 'points' : cannot change previously set output primitive +ERROR: 0:74: 'triangle_strip' : cannot apply to input +ERROR: 0:75: 'triangle_strip' : cannot apply to: uniform +ERROR: 0:76: 'triangle_strip' : can only apply to a standalone qualifier +ERROR: 0:77: 'triangle_strip' : can only apply to a standalone qualifier +ERROR: 0:78: 'invocations' : not supported for this version or the enabled extensions +ERROR: 0:78: 'invocations' : can only apply to a standalone qualifier +ERROR: 0:80: 'invocations' : not supported for this version or the enabled extensions +ERROR: 0:80: 'invocations' : can only apply to a standalone qualifier +ERROR: 0:81: 'max_vertices' : can only apply to a standalone qualifier +ERROR: 0:82: 'triangle_strip' : can only apply to a standalone qualifier +ERROR: 0:85: 'lines' : cannot apply to 'out' +ERROR: 0:87: 'triangles' : cannot change previously set input primitive +ERROR: 0:88: 'triangles_adjacency' : cannot change previously set input primitive +ERROR: 0:89: 'invocations' : not supported for this version or the enabled extensions +ERROR: 0:92: 'stream' : member cannot contradict block +ERROR: 0:92: 'stream' : can only be used on an output +ERROR: 0:129: 'gl_ViewportIndex' : required extension not requested: GL_ARB_viewport_array +ERROR: 0:129: 'gl_MaxViewports' : required extension not requested: GL_ARB_viewport_array +ERROR: 0:139: 'gl_ViewportIndex' : identifiers starting with "gl_" are reserved +ERROR: 35 compilation errors. No code generated. + + +Shader version: 150 +Requested GL_ARB_viewport_array +invocations = 4 +max_vertices = 200 +input primitive = lines_adjacency +output primitive = triangle_strip +ERROR: node is still EOpNull! +0:25 Function Definition: main( ( global void) +0:25 Function Parameters: +0:27 Sequence +0:27 EmitVertex ( global void) +0:28 EndPrimitive ( global void) +0:29 Constant: +0:29 0.000000 +0:30 Constant: +0:30 0.000000 +0:32 move second child to first child ( temp 3-component vector of float) +0:32 color: direct index for structure (layout( stream=0) out 3-component vector of float) +0:32 'anon@0' (layout( stream=0) out block{layout( stream=0) out 3-component vector of float color}) +0:32 Constant: +0:32 0 (const uint) +0:32 color: direct index for structure ( in 3-component vector of float) +0:32 direct index ( temp block{ in 3-component vector of float color}) +0:32 'fromV' ( in 4-element array of block{ in 3-component vector of float color}) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 0 (const int) +0:33 move second child to first child ( temp float) +0:33 direct index (layout( stream=0) temp float ClipDistance) +0:33 gl_ClipDistance: direct index for structure (layout( stream=0) out unsized 4-element array of float ClipDistance) +0:33 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out unsized 4-element array of float ClipDistance gl_ClipDistance}) +0:33 Constant: +0:33 2 (const uint) +0:33 Constant: +0:33 3 (const int) +0:33 direct index ( temp float ClipDistance) +0:33 gl_ClipDistance: direct index for structure ( in unsized 3-element array of float ClipDistance) +0:33 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_in' ( in 4-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 2 (const int) +0:33 Constant: +0:33 2 (const int) +0:34 move second child to first child ( temp 4-component vector of float) +0:34 gl_Position: direct index for structure (layout( stream=0) gl_Position 4-component vector of float Position) +0:34 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out unsized 4-element array of float ClipDistance gl_ClipDistance}) +0:34 Constant: +0:34 0 (const uint) +0:34 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:34 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:34 'gl_in' ( in 4-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:35 move second child to first child ( temp float) +0:35 gl_PointSize: direct index for structure (layout( stream=0) gl_PointSize float PointSize) +0:35 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out unsized 4-element array of float ClipDistance gl_ClipDistance}) +0:35 Constant: +0:35 1 (const uint) +0:35 gl_PointSize: direct index for structure ( in float PointSize) +0:35 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:35 'gl_in' ( in 4-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:35 Constant: +0:35 3 (const int) +0:35 Constant: +0:35 1 (const int) +0:36 move second child to first child ( temp int) +0:36 'gl_PrimitiveID' (layout( stream=0) out int PrimitiveID) +0:36 'gl_PrimitiveIDIn' ( in int PrimitiveID) +0:37 move second child to first child ( temp int) +0:37 'gl_Layer' (layout( stream=0) out int Layer) +0:37 Constant: +0:37 2 (const int) +0:67 Function Definition: foo(i1; ( global void) +0:67 Function Parameters: +0:67 'a' ( in int) +0:69 Sequence +0:69 move second child to first child ( temp 4-component vector of float) +0:69 a: direct index for structure (layout( stream=6) out 4-component vector of float) +0:69 'ouuaa6' (layout( stream=6) out block{layout( stream=6) out 4-component vector of float a}) +0:69 Constant: +0:69 0 (const int) +0:69 Constant: +0:69 1.000000 +0:69 1.000000 +0:69 1.000000 +0:69 1.000000 +0:107 Sequence +0:107 move second child to first child ( temp float) +0:107 'summ' ( global float) +0:107 Constant: +0:107 11332.000000 +0:127 Function Definition: fooe1( ( global void) +0:127 Function Parameters: +0:129 Sequence +0:129 move second child to first child ( temp int) +0:129 'gl_ViewportIndex' (layout( stream=0) out int ViewportIndex) +0:129 Constant: +0:129 15 (const int) +0:134 Function Definition: fooe2( ( global void) +0:134 Function Parameters: +0:136 Sequence +0:136 move second child to first child ( temp int) +0:136 'gl_ViewportIndex' (layout( stream=0) out int ViewportIndex) +0:136 Constant: +0:136 15 (const int) +0:? Linker Objects +0:? 'fromV' ( in 4-element array of block{ in 3-component vector of float color}) +0:? 'toF' (layout( stream=0) out block{layout( stream=0) out 3-component vector of float color}) +0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) out 3-component vector of float color}) +0:? 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out unsized 4-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_in' ( in 4-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:? 'ov0' (layout( stream=0) out 4-component vector of float) +0:? 'ov4' (layout( stream=4) out 4-component vector of float) +0:? 'o1v0' (layout( stream=0) out 4-component vector of float) +0:? 'ua' (layout( stream=3) uniform int) +0:? 'ibb' (layout( stream=3 column_major shared) uniform block{layout( stream=3 column_major shared) uniform int ua}) +0:? 'ov3' (layout( stream=3) out 4-component vector of float) +0:? 'ouuaa6' (layout( stream=6) out block{layout( stream=6) out 4-component vector of float a}) +0:? 'ouua6' (layout( stream=6) out block{layout( stream=6) out 4-component vector of float a}) +0:? 'ouua7' (layout( stream=7) out block{layout( stream=6) out 4-component vector of float a}) +0:? 'ov2s3' (layout( stream=3) out 4-component vector of float) +0:? 'badv4' (layout( stream=3) out 4-component vector of float) +0:? 'bad2v4' ( in 4-element array of 4-component vector of float) +0:? 'anon@2' (layout( stream=3) out block{layout( stream=3) out int a}) +0:? 'outbi' (layout( stream=3) out block{layout( stream=3) out int a, layout( stream=3) out int b, layout( stream=3) out int c}) +0:? 'inbi' ( in 4-element array of block{layout( stream=2) in int a}) +0:? 'insn' ( in 4-element array of block{ in int a15}) +0:? 'anon@3' (layout( stream=3) out block{layout( stream=3) out float f15}) +0:? 'anon@4' (layout( column_major shared) uniform block{layout( column_major shared) uniform bool b15}) +0:? 'summ' ( global float) +0:? 'gl_ViewportIndex' (layout( stream=3) out int) + + +Linked geometry stage: + + +Shader version: 150 +Requested GL_ARB_viewport_array +invocations = 4 +max_vertices = 200 +input primitive = lines_adjacency +output primitive = triangle_strip +ERROR: node is still EOpNull! +0:25 Function Definition: main( ( global void) +0:25 Function Parameters: +0:27 Sequence +0:27 EmitVertex ( global void) +0:28 EndPrimitive ( global void) +0:29 Constant: +0:29 0.000000 +0:30 Constant: +0:30 0.000000 +0:32 move second child to first child ( temp 3-component vector of float) +0:32 color: direct index for structure (layout( stream=0) out 3-component vector of float) +0:32 'anon@0' (layout( stream=0) out block{layout( stream=0) out 3-component vector of float color}) +0:32 Constant: +0:32 0 (const uint) +0:32 color: direct index for structure ( in 3-component vector of float) +0:32 direct index ( temp block{ in 3-component vector of float color}) +0:32 'fromV' ( in 4-element array of block{ in 3-component vector of float color}) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 0 (const int) +0:33 move second child to first child ( temp float) +0:33 direct index (layout( stream=0) temp float ClipDistance) +0:33 gl_ClipDistance: direct index for structure (layout( stream=0) out 4-element array of float ClipDistance) +0:33 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out 4-element array of float ClipDistance gl_ClipDistance}) +0:33 Constant: +0:33 2 (const uint) +0:33 Constant: +0:33 3 (const int) +0:33 direct index ( temp float ClipDistance) +0:33 gl_ClipDistance: direct index for structure ( in 3-element array of float ClipDistance) +0:33 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_in' ( in 4-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 2 (const int) +0:33 Constant: +0:33 2 (const int) +0:34 move second child to first child ( temp 4-component vector of float) +0:34 gl_Position: direct index for structure (layout( stream=0) gl_Position 4-component vector of float Position) +0:34 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out 4-element array of float ClipDistance gl_ClipDistance}) +0:34 Constant: +0:34 0 (const uint) +0:34 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:34 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:34 'gl_in' ( in 4-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:35 move second child to first child ( temp float) +0:35 gl_PointSize: direct index for structure (layout( stream=0) gl_PointSize float PointSize) +0:35 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out 4-element array of float ClipDistance gl_ClipDistance}) +0:35 Constant: +0:35 1 (const uint) +0:35 gl_PointSize: direct index for structure ( in float PointSize) +0:35 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:35 'gl_in' ( in 4-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:35 Constant: +0:35 3 (const int) +0:35 Constant: +0:35 1 (const int) +0:36 move second child to first child ( temp int) +0:36 'gl_PrimitiveID' (layout( stream=0) out int PrimitiveID) +0:36 'gl_PrimitiveIDIn' ( in int PrimitiveID) +0:37 move second child to first child ( temp int) +0:37 'gl_Layer' (layout( stream=0) out int Layer) +0:37 Constant: +0:37 2 (const int) +0:107 Sequence +0:107 move second child to first child ( temp float) +0:107 'summ' ( global float) +0:107 Constant: +0:107 11332.000000 +0:? Linker Objects +0:? 'fromV' ( in 4-element array of block{ in 3-component vector of float color}) +0:? 'toF' (layout( stream=0) out block{layout( stream=0) out 3-component vector of float color}) +0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) out 3-component vector of float color}) +0:? 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out 4-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_in' ( in 4-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:? 'ov0' (layout( stream=0) out 4-component vector of float) +0:? 'ov4' (layout( stream=4) out 4-component vector of float) +0:? 'o1v0' (layout( stream=0) out 4-component vector of float) +0:? 'ua' (layout( stream=3) uniform int) +0:? 'ibb' (layout( stream=3 column_major shared) uniform block{layout( stream=3 column_major shared) uniform int ua}) +0:? 'ov3' (layout( stream=3) out 4-component vector of float) +0:? 'ouuaa6' (layout( stream=6) out block{layout( stream=6) out 4-component vector of float a}) +0:? 'ouua6' (layout( stream=6) out block{layout( stream=6) out 4-component vector of float a}) +0:? 'ouua7' (layout( stream=7) out block{layout( stream=6) out 4-component vector of float a}) +0:? 'ov2s3' (layout( stream=3) out 4-component vector of float) +0:? 'badv4' (layout( stream=3) out 4-component vector of float) +0:? 'bad2v4' ( in 4-element array of 4-component vector of float) +0:? 'anon@2' (layout( stream=3) out block{layout( stream=3) out int a}) +0:? 'outbi' (layout( stream=3) out block{layout( stream=3) out int a, layout( stream=3) out int b, layout( stream=3) out int c}) +0:? 'inbi' ( in 4-element array of block{layout( stream=2) in int a}) +0:? 'insn' ( in 4-element array of block{ in int a15}) +0:? 'anon@3' (layout( stream=3) out block{layout( stream=3) out float f15}) +0:? 'anon@4' (layout( column_major shared) uniform block{layout( column_major shared) uniform bool b15}) +0:? 'summ' ( global float) +0:? 'gl_ViewportIndex' (layout( stream=3) out int) + diff --git a/deps/glslang/Test/baseResults/150.tesc.out b/deps/glslang/Test/baseResults/150.tesc.out new file mode 100644 index 00000000..89220264 --- /dev/null +++ b/deps/glslang/Test/baseResults/150.tesc.out @@ -0,0 +1,1676 @@ +150.tesc +Shader version: 150 +Requested GL_ARB_tessellation_shader +vertices = 4 +0:? Sequence +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 Barrier ( global void) +0:14 Sequence +0:14 move second child to first child ( temp int) +0:14 'a' ( temp int) +0:14 Constant: +0:14 5392 (const int) +0:20 Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:20 'p' ( temp 4-component vector of float) +0:20 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:20 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:20 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:21 Sequence +0:21 move second child to first child ( temp float) +0:21 'ps' ( temp float) +0:21 gl_PointSize: direct index for structure ( in float PointSize) +0:21 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:21 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 1 (const int) +0:22 Sequence +0:22 move second child to first child ( temp float) +0:22 'cd' ( temp float) +0:22 direct index ( temp float ClipDistance) +0:22 gl_ClipDistance: direct index for structure ( in unsized 3-element array of float ClipDistance) +0:22 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:22 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 Constant: +0:22 2 (const int) +0:24 Sequence +0:24 move second child to first child ( temp int) +0:24 'pvi' ( temp int) +0:24 'gl_PatchVerticesIn' ( in int PatchVertices) +0:25 Sequence +0:25 move second child to first child ( temp int) +0:25 'pid' ( temp int) +0:25 'gl_PrimitiveID' ( in int PrimitiveID) +0:26 Sequence +0:26 move second child to first child ( temp int) +0:26 'iid' ( temp int) +0:26 'gl_InvocationID' ( in int InvocationID) +0:28 move second child to first child ( temp 4-component vector of float) +0:28 gl_Position: direct index for structure ( out 4-component vector of float Position) +0:28 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:28 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:28 'gl_InvocationID' ( in int InvocationID) +0:28 Constant: +0:28 0 (const int) +0:28 'p' ( temp 4-component vector of float) +0:29 move second child to first child ( temp float) +0:29 gl_PointSize: direct index for structure ( out float PointSize) +0:29 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:29 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:29 'gl_InvocationID' ( in int InvocationID) +0:29 Constant: +0:29 1 (const int) +0:29 'ps' ( temp float) +0:30 move second child to first child ( temp float) +0:30 direct index ( temp float ClipDistance) +0:30 gl_ClipDistance: direct index for structure ( out unsized 2-element array of float ClipDistance) +0:30 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:30 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:30 'gl_InvocationID' ( in int InvocationID) +0:30 Constant: +0:30 2 (const int) +0:30 Constant: +0:30 1 (const int) +0:30 'cd' ( temp float) +0:32 move second child to first child ( temp float) +0:32 direct index ( patch temp float TessLevelOuter) +0:32 'gl_TessLevelOuter' ( patch out 4-element array of float TessLevelOuter) +0:32 Constant: +0:32 3 (const int) +0:32 Constant: +0:32 3.200000 +0:33 move second child to first child ( temp float) +0:33 direct index ( patch temp float TessLevelInner) +0:33 'gl_TessLevelInner' ( patch out 2-element array of float TessLevelInner) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 1.300000 +0:? Linker Objects +0:? 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:? 'outa' ( global 4-element array of int) +0:? 'patchOut' ( patch out 4-component vector of float) + +150.tese +ERROR: 0:12: 'barrier' : no matching overloaded function found +ERROR: 1 compilation errors. No code generated. + + +Shader version: 150 +Requested GL_ARB_tessellation_shader +input primitive = quads +vertex spacing = fractional_odd_spacing +triangle order = cw +using point mode +ERROR: node is still EOpNull! +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 Constant: +0:12 0.000000 +0:14 Sequence +0:14 move second child to first child ( temp int) +0:14 'a' ( temp int) +0:14 Constant: +0:14 1512 (const int) +0:22 Sequence +0:22 move second child to first child ( temp 4-component vector of float) +0:22 'p' ( temp 4-component vector of float) +0:22 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:22 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:22 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 0 (const int) +0:23 Sequence +0:23 move second child to first child ( temp float) +0:23 'ps' ( temp float) +0:23 gl_PointSize: direct index for structure ( in float PointSize) +0:23 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:23 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:23 Constant: +0:23 1 (const int) +0:23 Constant: +0:23 1 (const int) +0:24 Sequence +0:24 move second child to first child ( temp float) +0:24 'cd' ( temp float) +0:24 direct index ( temp float ClipDistance) +0:24 gl_ClipDistance: direct index for structure ( in unsized 3-element array of float ClipDistance) +0:24 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:24 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:24 Constant: +0:24 1 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 2 (const int) +0:26 Sequence +0:26 move second child to first child ( temp int) +0:26 'pvi' ( temp int) +0:26 'gl_PatchVerticesIn' ( in int PatchVertices) +0:27 Sequence +0:27 move second child to first child ( temp int) +0:27 'pid' ( temp int) +0:27 'gl_PrimitiveID' ( in int PrimitiveID) +0:28 Sequence +0:28 move second child to first child ( temp 3-component vector of float) +0:28 'tc' ( temp 3-component vector of float) +0:28 'gl_TessCoord' ( in 3-component vector of float TessCoord) +0:29 Sequence +0:29 move second child to first child ( temp float) +0:29 'tlo' ( temp float) +0:29 direct index ( patch temp float TessLevelOuter) +0:29 'gl_TessLevelOuter' ( patch in 4-element array of float TessLevelOuter) +0:29 Constant: +0:29 3 (const int) +0:30 Sequence +0:30 move second child to first child ( temp float) +0:30 'tli' ( temp float) +0:30 direct index ( patch temp float TessLevelInner) +0:30 'gl_TessLevelInner' ( patch in 2-element array of float TessLevelInner) +0:30 Constant: +0:30 1 (const int) +0:32 move second child to first child ( temp 4-component vector of float) +0:32 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:32 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:32 Constant: +0:32 0 (const uint) +0:32 'p' ( temp 4-component vector of float) +0:33 move second child to first child ( temp float) +0:33 gl_PointSize: direct index for structure ( gl_PointSize float PointSize) +0:33 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:33 Constant: +0:33 1 (const uint) +0:33 'ps' ( temp float) +0:34 move second child to first child ( temp float) +0:34 direct index ( temp float ClipDistance) +0:34 gl_ClipDistance: direct index for structure ( out unsized 3-element array of float ClipDistance) +0:34 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:34 Constant: +0:34 2 (const uint) +0:34 Constant: +0:34 2 (const int) +0:34 'cd' ( temp float) +0:? Linker Objects +0:? 'patchIn' ( patch in 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) + +400.tesc +ERROR: 0:6: 'quads' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:7: 'ccw' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:8: 'fractional_even_spacing' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:10: 'patch' : can only use on output in tessellation-control shader +ERROR: 0:39: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:41: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:46: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:51: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:54: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:61: '' : tessellation control barrier() cannot be placed after a return from main() +ERROR: 0:64: 'vertices' : can only apply to 'out' +ERROR: 0:65: 'vertices' : cannot change previously set layout value +ERROR: 0:69: '[' : array index out of range '4' +ERROR: 0:71: '' : tessellation control barrier() must be in main() +ERROR: 0:74: 'in' : type must be an array: ina +ERROR: 0:76: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized +ERROR: 0:83: 'location' : overlapping use of location 4 +ERROR: 0:87: 'location' : overlapping use of location 4 +ERROR: 0:104: '' : precise qualifier must appear first +ERROR: 0:105: '' : precise qualifier must appear first +ERROR: 0:105: '' : precise qualifier must appear first +ERROR: 0:109: 'gl_DeviceIndex' : required extension not requested: GL_EXT_device_group +ERROR: 0:110: 'gl_ViewIndex' : required extension not requested: GL_EXT_multiview +ERROR: 23 compilation errors. No code generated. + + +Shader version: 400 +Requested GL_ARB_separate_shader_objects +Requested GL_EXT_device_group +Requested GL_EXT_multiview +vertices = 4 +ERROR: node is still EOpNull! +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:15 Sequence +0:15 Barrier ( global void) +0:17 Sequence +0:17 move second child to first child ( temp int) +0:17 'a' ( temp int) +0:17 Constant: +0:17 5392 (const int) +0:23 Sequence +0:23 move second child to first child ( temp 4-component vector of float) +0:23 'p' ( temp 4-component vector of float) +0:23 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:23 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:23 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:23 Constant: +0:23 1 (const int) +0:23 Constant: +0:23 0 (const int) +0:24 Sequence +0:24 move second child to first child ( temp float) +0:24 'ps' ( temp float) +0:24 gl_PointSize: direct index for structure ( in float PointSize) +0:24 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:24 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:24 Constant: +0:24 1 (const int) +0:24 Constant: +0:24 1 (const int) +0:25 Sequence +0:25 move second child to first child ( temp float) +0:25 'cd' ( temp float) +0:25 direct index ( temp float ClipDistance) +0:25 gl_ClipDistance: direct index for structure ( in unsized 3-element array of float ClipDistance) +0:25 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:25 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:25 Constant: +0:25 1 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 2 (const int) +0:27 Sequence +0:27 move second child to first child ( temp int) +0:27 'pvi' ( temp int) +0:27 'gl_PatchVerticesIn' ( in int PatchVertices) +0:28 Sequence +0:28 move second child to first child ( temp int) +0:28 'pid' ( temp int) +0:28 'gl_PrimitiveID' ( in int PrimitiveID) +0:29 Sequence +0:29 move second child to first child ( temp int) +0:29 'iid' ( temp int) +0:29 'gl_InvocationID' ( in int InvocationID) +0:31 move second child to first child ( temp 4-component vector of float) +0:31 gl_Position: direct index for structure ( out 4-component vector of float Position) +0:31 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:31 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:31 'gl_InvocationID' ( in int InvocationID) +0:31 Constant: +0:31 0 (const int) +0:31 'p' ( temp 4-component vector of float) +0:32 move second child to first child ( temp float) +0:32 gl_PointSize: direct index for structure ( out float PointSize) +0:32 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:32 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:32 'gl_InvocationID' ( in int InvocationID) +0:32 Constant: +0:32 1 (const int) +0:32 'ps' ( temp float) +0:33 move second child to first child ( temp float) +0:33 direct index ( temp float ClipDistance) +0:33 gl_ClipDistance: direct index for structure ( out unsized 2-element array of float ClipDistance) +0:33 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_InvocationID' ( in int InvocationID) +0:33 Constant: +0:33 2 (const int) +0:33 Constant: +0:33 1 (const int) +0:33 'cd' ( temp float) +0:35 move second child to first child ( temp float) +0:35 direct index ( patch temp float TessLevelOuter) +0:35 'gl_TessLevelOuter' ( patch out 4-element array of float TessLevelOuter) +0:35 Constant: +0:35 3 (const int) +0:35 Constant: +0:35 3.200000 +0:36 move second child to first child ( temp float) +0:36 direct index ( patch temp float TessLevelInner) +0:36 'gl_TessLevelInner' ( patch out 2-element array of float TessLevelInner) +0:36 Constant: +0:36 1 (const int) +0:36 Constant: +0:36 1.300000 +0:38 Test condition and select ( temp void) +0:38 Condition +0:38 Compare Greater Than ( temp bool) +0:38 'a' ( temp int) +0:38 Constant: +0:38 10 (const int) +0:38 true case +0:39 Barrier ( global void) +0:38 false case +0:41 Barrier ( global void) +0:43 Barrier ( global void) +0:47 Loop with condition not tested first +0:47 Loop Condition +0:47 Compare Greater Than ( temp bool) +0:47 'a' ( temp int) +0:47 Constant: +0:47 10 (const int) +0:47 Loop Body +0:46 Sequence +0:46 Barrier ( global void) +0:49 switch +0:49 condition +0:49 'a' ( temp int) +0:49 body +0:49 Sequence +0:50 default: +0:? Sequence +0:51 Barrier ( global void) +0:52 Branch: Break +0:54 Test condition and select ( temp int) +0:54 Condition +0:54 Compare Less Than ( temp bool) +0:54 'a' ( temp int) +0:54 Constant: +0:54 12 (const int) +0:54 true case +0:54 'a' ( temp int) +0:54 false case +0:54 Comma ( temp int) +0:54 Barrier ( global void) +0:54 'a' ( temp int) +0:56 Sequence +0:56 Barrier ( global void) +0:59 Branch: Return +0:61 Barrier ( global void) +0:67 Function Definition: foo( ( global void) +0:67 Function Parameters: +0:69 Sequence +0:69 gl_PointSize: direct index for structure ( out float PointSize) +0:69 direct index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:69 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:69 Constant: +0:69 4 (const int) +0:69 Constant: +0:69 1 (const int) +0:71 Barrier ( global void) +0:91 Function Definition: foop( ( global void) +0:91 Function Parameters: +0:? Sequence +0:95 multiply second child into first child ( temp 3-component vector of float) +0:95 'pv3' ( noContraction temp 3-component vector of float) +0:95 'pv3' ( noContraction temp 3-component vector of float) +0:96 move second child to first child ( temp 3-component vector of float) +0:96 'pv3' ( noContraction temp 3-component vector of float) +0:96 fma ( global 3-component vector of float) +0:96 'pv3' ( noContraction temp 3-component vector of float) +0:96 'pv3' ( noContraction temp 3-component vector of float) +0:96 'pv3' ( noContraction temp 3-component vector of float) +0:97 move second child to first child ( temp double) +0:97 'd' ( noContraction temp double) +0:97 fma ( global double) +0:97 'd' ( noContraction temp double) +0:97 'd' ( noContraction temp double) +0:97 'd' ( noContraction temp double) +0:107 Function Definition: devi( ( global void) +0:107 Function Parameters: +0:109 Sequence +0:109 'gl_DeviceIndex' ( in int DeviceIndex) +0:110 'gl_ViewIndex' ( in int ViewIndex) +0:121 Function Definition: devie( ( global void) +0:121 Function Parameters: +0:123 Sequence +0:123 'gl_DeviceIndex' ( in int DeviceIndex) +0:124 'gl_ViewIndex' ( in int ViewIndex) +0:? Linker Objects +0:? 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:? 'outa' ( global 4-element array of int) +0:? 'patchIn' ( patch in 4-component vector of float) +0:? 'patchOut' ( patch out 4-component vector of float) +0:? 'ina' ( in 2-component vector of float) +0:? 'inb' ( in 32-element array of 2-component vector of float) +0:? 'inc' ( in 32-element array of 2-component vector of float) +0:? 'ind' ( in 32-element array of 2-component vector of float) +0:? 'ivla' (layout( location=3) in 32-element array of 4-component vector of float) +0:? 'ivlb' (layout( location=4) in 32-element array of 4-component vector of float) +0:? 'ivlc' (layout( location=4) in 32-element array of 4-component vector of float) +0:? 'ovla' (layout( location=3) out 4-element array of 4-component vector of float) +0:? 'ovlb' (layout( location=4) out 4-element array of 4-component vector of float) +0:? 'ovlc' (layout( location=4) out 4-element array of 4-component vector of float) +0:? 'pv3' ( noContraction temp 3-component vector of float) +0:? 'pinbi' ( patch out block{ out int a}) +0:? 'badOrder' ( invariant noContraction out 4-element array of 4-component vector of float) + +400.tese +ERROR: 0:3: 'vertices' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:5: 'triangles' : cannot change previously set input primitive +ERROR: 0:6: 'isolines' : cannot change previously set input primitive +ERROR: 0:8: 'ccw' : cannot change previously set vertex order +ERROR: 0:12: 'equal_spacing' : cannot change previously set vertex spacing +ERROR: 0:13: 'fractional_even_spacing' : cannot change previously set vertex spacing +ERROR: 0:18: 'patch' : can only use on input in tessellation-evaluation shader +ERROR: 0:22: 'barrier' : no matching overloaded function found +ERROR: 0:47: 'patch' : cannot use interpolation qualifiers with patch +ERROR: 0:48: 'patch' : cannot use interpolation qualifiers with patch +ERROR: 0:49: 'patch' : cannot use interpolation qualifiers with patch +ERROR: 0:50: '' : can only have one auxiliary qualifier (centroid, patch, and sample) +ERROR: 0:59: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use +ERROR: 0:64: 'quads' : cannot apply to 'out' +ERROR: 0:64: 'cw' : can only apply to 'in' +ERROR: 0:65: 'triangles' : cannot apply to 'out' +ERROR: 0:66: 'isolines' : cannot apply to 'out' +ERROR: 0:67: 'cw' : can only apply to 'in' +ERROR: 0:68: 'fractional_odd_spacing' : can only apply to 'in' +ERROR: 0:69: 'equal_spacing' : can only apply to 'in' +ERROR: 0:70: 'fractional_even_spacing' : can only apply to 'in' +ERROR: 0:71: 'point_mode' : can only apply to 'in' +ERROR: 0:73: 'in' : type must be an array: ina +ERROR: 0:75: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized +ERROR: 0:78: 'in' : type must be an array: bla +ERROR: 0:86: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized +ERROR: 0:96: 'location' : overlapping use of location 24 +ERROR: 0:99: 'location' : overlapping use of location 24 +ERROR: 0:101: 'gl_TessLevelOuter' : identifiers starting with "gl_" are reserved +ERROR: 0:109: 'gl_DeviceIndex' : required extension not requested: GL_EXT_device_group +ERROR: 0:110: 'gl_ViewIndex' : required extension not requested: GL_EXT_multiview +ERROR: 31 compilation errors. No code generated. + + +Shader version: 400 +Requested GL_ARB_separate_shader_objects +Requested GL_EXT_device_group +Requested GL_EXT_multiview +input primitive = quads +vertex spacing = fractional_odd_spacing +triangle order = cw +using point mode +ERROR: node is still EOpNull! +0:20 Function Definition: main( ( global void) +0:20 Function Parameters: +0:22 Sequence +0:22 Constant: +0:22 0.000000 +0:24 Sequence +0:24 move second child to first child ( temp int) +0:24 'a' ( temp int) +0:24 Constant: +0:24 1512 (const int) +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of float) +0:32 'p' ( temp 4-component vector of float) +0:32 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:32 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:32 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 0 (const int) +0:33 Sequence +0:33 move second child to first child ( temp float) +0:33 'ps' ( temp float) +0:33 gl_PointSize: direct index for structure ( in float PointSize) +0:33 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 1 (const int) +0:34 Sequence +0:34 move second child to first child ( temp float) +0:34 'cd' ( temp float) +0:34 direct index ( temp float ClipDistance) +0:34 gl_ClipDistance: direct index for structure ( in unsized 3-element array of float ClipDistance) +0:34 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:34 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:34 Constant: +0:34 1 (const int) +0:34 Constant: +0:34 2 (const int) +0:34 Constant: +0:34 2 (const int) +0:36 Sequence +0:36 move second child to first child ( temp int) +0:36 'pvi' ( temp int) +0:36 'gl_PatchVerticesIn' ( in int PatchVertices) +0:37 Sequence +0:37 move second child to first child ( temp int) +0:37 'pid' ( temp int) +0:37 'gl_PrimitiveID' ( in int PrimitiveID) +0:38 Sequence +0:38 move second child to first child ( temp 3-component vector of float) +0:38 'tc' ( temp 3-component vector of float) +0:38 'gl_TessCoord' ( in 3-component vector of float TessCoord) +0:39 Sequence +0:39 move second child to first child ( temp float) +0:39 'tlo' ( temp float) +0:39 direct index ( patch temp float TessLevelOuter) +0:39 'gl_TessLevelOuter' ( patch in 4-element array of float TessLevelOuter) +0:39 Constant: +0:39 3 (const int) +0:40 Sequence +0:40 move second child to first child ( temp float) +0:40 'tli' ( temp float) +0:40 direct index ( patch temp float TessLevelInner) +0:40 'gl_TessLevelInner' ( patch in 2-element array of float TessLevelInner) +0:40 Constant: +0:40 1 (const int) +0:42 move second child to first child ( temp 4-component vector of float) +0:42 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:42 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:42 Constant: +0:42 0 (const uint) +0:42 'p' ( temp 4-component vector of float) +0:43 move second child to first child ( temp float) +0:43 gl_PointSize: direct index for structure ( gl_PointSize float PointSize) +0:43 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:43 Constant: +0:43 1 (const uint) +0:43 'ps' ( temp float) +0:44 move second child to first child ( temp float) +0:44 direct index ( temp float ClipDistance) +0:44 gl_ClipDistance: direct index for structure ( out unsized 3-element array of float ClipDistance) +0:44 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:44 Constant: +0:44 2 (const uint) +0:44 Constant: +0:44 2 (const int) +0:44 'cd' ( temp float) +0:107 Function Definition: devi( ( global void) +0:107 Function Parameters: +0:109 Sequence +0:109 'gl_DeviceIndex' ( in int DeviceIndex) +0:110 'gl_ViewIndex' ( in int ViewIndex) +0:121 Function Definition: devie( ( global void) +0:121 Function Parameters: +0:123 Sequence +0:123 'gl_DeviceIndex' ( in int DeviceIndex) +0:124 'gl_ViewIndex' ( in int ViewIndex) +0:? Linker Objects +0:? 'patchIn' ( patch in 4-component vector of float) +0:? 'patchOut' ( patch out 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:? 'badp1' ( smooth patch in 4-component vector of float) +0:? 'badp2' ( flat patch in 4-component vector of float) +0:? 'badp3' ( noperspective patch in 4-component vector of float) +0:? 'badp4' ( patch sample in 3-component vector of float) +0:? 'gl_in' ( in 32-element array of block{ in 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'ina' ( in 2-component vector of float) +0:? 'inb' ( in 32-element array of 2-component vector of float) +0:? 'inc' ( in 32-element array of 2-component vector of float) +0:? 'ind' ( in 32-element array of 2-component vector of float) +0:? 'bla' ( in block{ in int f}) +0:? 'blb' ( in 32-element array of block{ in int f}) +0:? 'blc' ( in 32-element array of block{ in int f}) +0:? 'bld' ( in 32-element array of block{ in int f}) +0:? 'ivla' (layout( location=23) in 32-element array of 4-component vector of float) +0:? 'ivlb' (layout( location=24) in 32-element array of 4-component vector of float) +0:? 'ivlc' (layout( location=24) in 32-element array of 4-component vector of float) +0:? 'ovla' (layout( location=23) out 2-element array of 4-component vector of float) +0:? 'ovlb' (layout( location=24) out 2-element array of 4-component vector of float) +0:? 'pinbi' ( patch in block{ in int a}) + +410.tesc +ERROR: 0:4: 'length' : array must first be sized by a redeclaration or layout qualifier +ERROR: 1 compilation errors. No code generated. + + +Shader version: 400 +vertices = -1 +ERROR: node is still EOpNull! +0:8 Function Definition: main( ( global void) +0:8 Function Parameters: +0:? Linker Objects +0:? 'gl_out' ( out unsized 1-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'outa' ( global 1-element array of int) +0:? 'patchOut' ( patch out 4-component vector of float) + +420.tesc +ERROR: 0:7: 'vertices' : inconsistent output number of vertices for array size of gl_out +ERROR: 0:11: 'vertices' : inconsistent output number of vertices for array size of a +ERROR: 0:12: 'vertices' : inconsistent output number of vertices for array size of outb +ERROR: 0:26: 'gl_PointSize' : no such field in structure +ERROR: 0:26: 'assign' : cannot convert from ' temp float' to ' temp block{ out 4-component vector of float Position gl_Position}' +ERROR: 0:29: 'out' : type must be an array: outf +ERROR: 0:43: 'vertices' : must be greater than 0 +ERROR: 7 compilation errors. No code generated. + + +Shader version: 420 +Requested GL_ARB_separate_shader_objects +vertices = 4 +ERROR: node is still EOpNull! +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:17 Sequence +0:17 Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:17 'p' ( temp 4-component vector of float) +0:17 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:17 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:17 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 0 (const int) +0:18 Sequence +0:18 move second child to first child ( temp float) +0:18 'ps' ( temp float) +0:18 gl_PointSize: direct index for structure ( in float PointSize) +0:18 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:18 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 1 (const int) +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'cd' ( temp float) +0:19 direct index ( temp float ClipDistance) +0:19 gl_ClipDistance: direct index for structure ( in unsized 3-element array of float ClipDistance) +0:19 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:19 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 2 (const int) +0:21 Sequence +0:21 move second child to first child ( temp int) +0:21 'pvi' ( temp int) +0:21 'gl_PatchVerticesIn' ( in int PatchVertices) +0:22 Sequence +0:22 move second child to first child ( temp int) +0:22 'pid' ( temp int) +0:22 'gl_PrimitiveID' ( in int PrimitiveID) +0:23 Sequence +0:23 move second child to first child ( temp int) +0:23 'iid' ( temp int) +0:23 'gl_InvocationID' ( in int InvocationID) +0:25 move second child to first child ( temp 4-component vector of float) +0:25 gl_Position: direct index for structure ( out 4-component vector of float Position) +0:25 indirect index ( temp block{ out 4-component vector of float Position gl_Position}) +0:25 'gl_out' ( out 3-element array of block{ out 4-component vector of float Position gl_Position}) +0:25 'gl_InvocationID' ( in int InvocationID) +0:25 Constant: +0:25 0 (const int) +0:25 'p' ( temp 4-component vector of float) +0:26 indirect index ( temp block{ out 4-component vector of float Position gl_Position}) +0:26 'gl_out' ( out 3-element array of block{ out 4-component vector of float Position gl_Position}) +0:26 'gl_InvocationID' ( in int InvocationID) +0:34 Function Definition: foo( ( global void) +0:34 Function Parameters: +0:36 Sequence +0:36 Test condition and select ( temp void) +0:36 Condition +0:36 logical-or ( temp bool) +0:36 Compare Not Equal ( temp bool) +0:36 Constant: +0:36 -0.625000 +0:36 -0.500000 +0:36 -0.375000 +0:36 -0.250000 +0:36 -0.375000 +0:36 -0.250000 +0:36 -0.125000 +0:36 0.000000 +0:36 direct index (layout( location=0) temp 2X4 matrix of double) +0:36 'vs_tcs_first' (layout( location=0) in 32-element array of 2X4 matrix of double) +0:36 Constant: +0:36 0 (const int) +0:37 Compare Not Equal ( temp bool) +0:37 Constant: +0:37 0.375000 +0:37 0.500000 +0:37 0.625000 +0:37 0.750000 +0:37 0.625000 +0:37 0.750000 +0:37 0.875000 +0:37 -0.625000 +0:37 direct index (layout( location=12) temp 2X4 matrix of double) +0:37 'vs_tcs_last' (layout( location=12) in 32-element array of 2X4 matrix of double) +0:37 Constant: +0:37 0 (const int) +0:36 true case is null +0:? Linker Objects +0:? 'gl_out' ( out 3-element array of block{ out 4-component vector of float Position gl_Position}) +0:? 'a' ( out 3-element array of int) +0:? 'outb' ( out 5-element array of int) +0:? 'outc' ( out 4-element array of int) +0:? 'outf' ( out float) +0:? 'vs_tcs_first' (layout( location=0) in 32-element array of 2X4 matrix of double) +0:? 'vs_tcs_last' (layout( location=12) in 32-element array of 2X4 matrix of double) + +420.tese +ERROR: 0:7: '=' : cannot convert from ' const 3-element array of float' to ' global 2-element array of float' +ERROR: 0:8: 'initializer list' : wrong vector size (or rows in a matrix column): temp 2-component vector of float +ERROR: 0:9: 'initializer list' : wrong number of matrix columns: temp 3X3 matrix of float +ERROR: 0:10: 'initializer list' : wrong number of matrix columns: temp 2X2 matrix of float +ERROR: 0:25: 'initializer list' : wrong number of structure members +ERROR: 0:27: '=' : cannot convert from ' const bool' to ' global int' +ERROR: 0:28: 'constructor' : cannot convert parameter 2 from ' const float' to ' temp 4-component vector of float' +ERROR: 0:29: 'constructor' : cannot convert parameter 2 from ' const 2X2 matrix of float' to ' const 4-component vector of float' +ERROR: 0:29: ' const 2-element array of 4-component vector of float' : cannot construct with these arguments +ERROR: 0:29: '=' : cannot convert from ' const float' to ' global 2-element array of 4-component vector of float' +ERROR: 0:30: 'initializer list' : wrong number of matrix columns: temp 4X2 matrix of float +ERROR: 0:40: 'constructor' : cannot convert parameter 1 from ' const structure{ global 4-component vector of float a, global 4-component vector of float b}' to ' temp structure{ global float s, global float t}' +ERROR: 0:70: 'initializer list' : wrong number of structure members +ERROR: 13 compilation errors. No code generated. + + +Shader version: 420 +input primitive = none +vertex spacing = none +triangle order = none +ERROR: node is still EOpNull! +0:4 Sequence +0:4 move second child to first child ( temp 2X2 matrix of float) +0:4 'b' ( global 2X2 matrix of float) +0:4 Constant: +0:4 1.000000 +0:4 0.000000 +0:4 0.000000 +0:4 1.000000 +0:15 Sequence +0:15 move second child to first child ( temp structure{ global float a, global int b}) +0:15 'e' ( global structure{ global float a, global int b}) +0:15 Constant: +0:15 1.200000 +0:15 2 (const int) +0:20 Sequence +0:20 move second child to first child ( temp structure{ global float a, global int b}) +0:20 'e2' ( global structure{ global float a, global int b}) +0:20 Constant: +0:20 1.000000 +0:20 3 (const int) +0:42 Sequence +0:42 move second child to first child ( temp 5-element array of float) +0:42 'b5' ( global 5-element array of float) +0:42 Constant: +0:42 3.400000 +0:42 4.200000 +0:42 5.000000 +0:42 5.200000 +0:42 1.100000 +0:55 Sequence +0:55 move second child to first child ( temp structure{ global int f}) +0:55 'single1' ( global structure{ global int f}) +0:55 Constant: +0:55 10 (const int) +0:58 Sequence +0:58 move second child to first child ( temp structure{ global 2-component vector of uint v}) +0:58 'single2' ( global structure{ global 2-component vector of uint v}) +0:58 Constant: +0:58 1 (const uint) +0:58 2 (const uint) +0:61 Sequence +0:61 move second child to first child ( temp structure{ global structure{ global int f} s1}) +0:61 'single3' ( global structure{ global structure{ global int f} s1}) +0:61 Constant: +0:61 3 (const int) +0:64 Sequence +0:64 move second child to first child ( temp structure{ global structure{ global 2-component vector of uint v} s1}) +0:64 'single4' ( global structure{ global structure{ global 2-component vector of uint v} s1}) +0:64 Constant: +0:64 4 (const uint) +0:64 5 (const uint) +0:79 Sequence +0:79 move second child to first child ( temp 3-component vector of float) +0:79 'av3' ( global 3-component vector of float) +0:79 Construct vec3 ( global 3-component vector of float) +0:79 'vc1' ( global float) +0:79 'vc2' ( global float) +0:79 'vc3' ( global float) +0:80 Sequence +0:80 move second child to first child ( temp 3-component vector of float) +0:80 'bv3' ( global 3-component vector of float) +0:80 Construct vec3 ( temp 3-component vector of float) +0:80 'vc1' ( global float) +0:80 'vc2' ( global float) +0:80 'vc3' ( global float) +0:82 Function Definition: main( ( global void) +0:82 Function Parameters: +0:84 Sequence +0:84 MemoryBarrier ( global void) +0:86 Test condition and select ( temp void) +0:86 Condition +0:86 Compare Equal ( temp bool) +0:86 Constant: +0:86 1 (const uint) +0:86 2 (const uint) +0:86 3.000000 +0:86 4.000000 +0:86 0.000000 +0:86 0.000000 +0:86 0.000000 +0:86 4.000000 +0:86 0.000000 +0:86 5.000000 +0:86 6.000000 +0:86 0.000000 +0:86 0.000000 +0:86 0.000000 +0:86 6.000000 +0:86 0.000000 +0:86 'curlybad1' ( temp structure{ global 2-component vector of uint uv2, global 2-element array of structure{ global float f, global 2X3 matrix of float m23} s}) +0:86 true case is null +0:88 Test condition and select ( temp void) +0:88 Condition +0:88 Constant: +0:88 true (const bool) +0:88 true case is null +0:? Linker Objects +0:? 'a' ( const 2X2 matrix of float) +0:? 1.000000 +0:? 0.000000 +0:? 0.000000 +0:? 1.000000 +0:? 'b' ( global 2X2 matrix of float) +0:? 'c' ( const 2X2 matrix of float) +0:? 1.000000 +0:? 0.000000 +0:? 0.000000 +0:? 1.000000 +0:? 'a2' ( global 2-element array of float) +0:? 'b2' ( global 2-component vector of float) +0:? 'c2' ( global 3X3 matrix of float) +0:? 'd' ( global 2X2 matrix of float) +0:? 'e' ( global structure{ global float a, global int b}) +0:? 'e2' ( global structure{ global float a, global int b}) +0:? 'e3' ( global structure{ global float a, global int b}) +0:? 'a3' ( global int) +0:? 'b3' ( global 2-element array of 4-component vector of float) +0:? 'b4' ( global 2-element array of 4-component vector of float) +0:? 'c3' ( global 4X2 matrix of float) +0:? 'd2' ( global unsized 1-element array of structure{ global float s, global float t}) +0:? 'b5' ( global 5-element array of float) +0:? 'single1' ( global structure{ global int f}) +0:? 'single2' ( global structure{ global 2-component vector of uint v}) +0:? 'single3' ( global structure{ global structure{ global int f} s1}) +0:? 'single4' ( global structure{ global structure{ global 2-component vector of uint v} s1}) +0:? 'constructed' ( const structure{ global 2-component vector of uint uv2, global 2-element array of structure{ global float f, global 2X3 matrix of float m23} s}) +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3.000000 +0:? 4.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 4.000000 +0:? 0.000000 +0:? 5.000000 +0:? 6.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 6.000000 +0:? 0.000000 +0:? 'curlybad1' ( temp structure{ global 2-component vector of uint uv2, global 2-element array of structure{ global float f, global 2X3 matrix of float m23} s}) +0:? 'curlyInit' ( const structure{ global 2-component vector of uint uv2, global 2-element array of structure{ global float f, global 2X3 matrix of float m23} s}) +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3.000000 +0:? 4.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 4.000000 +0:? 0.000000 +0:? 5.000000 +0:? 6.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 6.000000 +0:? 0.000000 +0:? 'vc1' ( global float) +0:? 'vc2' ( global float) +0:? 'vc3' ( global float) +0:? 'av3' ( global 3-component vector of float) +0:? 'bv3' ( global 3-component vector of float) + + +Linked tessellation control stage: + +ERROR: Linking tessellation control stage: can't handle multiple entry points per stage +ERROR: Linking tessellation control stage: Multiple function bodies in multiple compilation units for the same signature in the same stage: + main( +ERROR: Linking tessellation control stage: can't handle multiple entry points per stage +ERROR: Linking tessellation control stage: Contradictory layout vertices values +ERROR: Linking tessellation control stage: Multiple function bodies in multiple compilation units for the same signature in the same stage: + main( +ERROR: Linking tessellation control stage: Multiple function bodies in multiple compilation units for the same signature in the same stage: + main( +ERROR: Linking tessellation control stage: Types must match: + outa: " global 4-element array of int" versus " global 1-element array of int" +ERROR: Linking tessellation control stage: can't handle multiple entry points per stage +ERROR: Linking tessellation control stage: Multiple function bodies in multiple compilation units for the same signature in the same stage: + main( +ERROR: Linking tessellation control stage: Multiple function bodies in multiple compilation units for the same signature in the same stage: + main( +ERROR: Linking tessellation control stage: Multiple function bodies in multiple compilation units for the same signature in the same stage: + foo( +ERROR: Linking tessellation control stage: Multiple function bodies in multiple compilation units for the same signature in the same stage: + main( +ERROR: Linking tessellation control stage: Types must match: + gl_out: " out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}" versus " out 3-element array of block{ out 4-component vector of float Position gl_Position}" + +Linked tessellation evaluation stage: + +ERROR: Linking tessellation evaluation stage: can't handle multiple entry points per stage +ERROR: Linking tessellation evaluation stage: Multiple function bodies in multiple compilation units for the same signature in the same stage: + main( +ERROR: Linking tessellation evaluation stage: can't handle multiple entry points per stage +ERROR: Linking tessellation evaluation stage: Contradictory input layout primitives +ERROR: Linking tessellation evaluation stage: Contradictory input vertex spacing +ERROR: Linking tessellation evaluation stage: Contradictory triangle ordering +ERROR: Linking tessellation evaluation stage: Multiple function bodies in multiple compilation units for the same signature in the same stage: + main( +ERROR: Linking tessellation evaluation stage: Multiple function bodies in multiple compilation units for the same signature in the same stage: + main( + +Shader version: 420 +Requested GL_ARB_separate_shader_objects +Requested GL_ARB_tessellation_shader +Requested GL_EXT_device_group +Requested GL_EXT_multiview +vertices = 4 +0:? Sequence +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 Barrier ( global void) +0:14 Sequence +0:14 move second child to first child ( temp int) +0:14 'a' ( temp int) +0:14 Constant: +0:14 5392 (const int) +0:20 Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:20 'p' ( temp 4-component vector of float) +0:20 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:20 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:20 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:21 Sequence +0:21 move second child to first child ( temp float) +0:21 'ps' ( temp float) +0:21 gl_PointSize: direct index for structure ( in float PointSize) +0:21 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:21 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 1 (const int) +0:22 Sequence +0:22 move second child to first child ( temp float) +0:22 'cd' ( temp float) +0:22 direct index ( temp float ClipDistance) +0:22 gl_ClipDistance: direct index for structure ( in 3-element array of float ClipDistance) +0:22 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:22 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 Constant: +0:22 2 (const int) +0:24 Sequence +0:24 move second child to first child ( temp int) +0:24 'pvi' ( temp int) +0:24 'gl_PatchVerticesIn' ( in int PatchVertices) +0:25 Sequence +0:25 move second child to first child ( temp int) +0:25 'pid' ( temp int) +0:25 'gl_PrimitiveID' ( in int PrimitiveID) +0:26 Sequence +0:26 move second child to first child ( temp int) +0:26 'iid' ( temp int) +0:26 'gl_InvocationID' ( in int InvocationID) +0:28 move second child to first child ( temp 4-component vector of float) +0:28 gl_Position: direct index for structure ( out 4-component vector of float Position) +0:28 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:28 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:28 'gl_InvocationID' ( in int InvocationID) +0:28 Constant: +0:28 0 (const int) +0:28 'p' ( temp 4-component vector of float) +0:29 move second child to first child ( temp float) +0:29 gl_PointSize: direct index for structure ( out float PointSize) +0:29 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:29 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:29 'gl_InvocationID' ( in int InvocationID) +0:29 Constant: +0:29 1 (const int) +0:29 'ps' ( temp float) +0:30 move second child to first child ( temp float) +0:30 direct index ( temp float ClipDistance) +0:30 gl_ClipDistance: direct index for structure ( out 2-element array of float ClipDistance) +0:30 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:30 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:30 'gl_InvocationID' ( in int InvocationID) +0:30 Constant: +0:30 2 (const int) +0:30 Constant: +0:30 1 (const int) +0:30 'cd' ( temp float) +0:32 move second child to first child ( temp float) +0:32 direct index ( patch temp float TessLevelOuter) +0:32 'gl_TessLevelOuter' ( patch out 4-element array of float TessLevelOuter) +0:32 Constant: +0:32 3 (const int) +0:32 Constant: +0:32 3.200000 +0:33 move second child to first child ( temp float) +0:33 direct index ( patch temp float TessLevelInner) +0:33 'gl_TessLevelInner' ( patch out 2-element array of float TessLevelInner) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 1.300000 +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:15 Sequence +0:15 Barrier ( global void) +0:17 Sequence +0:17 move second child to first child ( temp int) +0:17 'a' ( temp int) +0:17 Constant: +0:17 5392 (const int) +0:23 Sequence +0:23 move second child to first child ( temp 4-component vector of float) +0:23 'p' ( temp 4-component vector of float) +0:23 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:23 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:23 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:23 Constant: +0:23 1 (const int) +0:23 Constant: +0:23 0 (const int) +0:24 Sequence +0:24 move second child to first child ( temp float) +0:24 'ps' ( temp float) +0:24 gl_PointSize: direct index for structure ( in float PointSize) +0:24 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:24 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:24 Constant: +0:24 1 (const int) +0:24 Constant: +0:24 1 (const int) +0:25 Sequence +0:25 move second child to first child ( temp float) +0:25 'cd' ( temp float) +0:25 direct index ( temp float ClipDistance) +0:25 gl_ClipDistance: direct index for structure ( in 3-element array of float ClipDistance) +0:25 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:25 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:25 Constant: +0:25 1 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 2 (const int) +0:27 Sequence +0:27 move second child to first child ( temp int) +0:27 'pvi' ( temp int) +0:27 'gl_PatchVerticesIn' ( in int PatchVertices) +0:28 Sequence +0:28 move second child to first child ( temp int) +0:28 'pid' ( temp int) +0:28 'gl_PrimitiveID' ( in int PrimitiveID) +0:29 Sequence +0:29 move second child to first child ( temp int) +0:29 'iid' ( temp int) +0:29 'gl_InvocationID' ( in int InvocationID) +0:31 move second child to first child ( temp 4-component vector of float) +0:31 gl_Position: direct index for structure ( out 4-component vector of float Position) +0:31 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:31 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:31 'gl_InvocationID' ( in int InvocationID) +0:31 Constant: +0:31 0 (const int) +0:31 'p' ( temp 4-component vector of float) +0:32 move second child to first child ( temp float) +0:32 gl_PointSize: direct index for structure ( out float PointSize) +0:32 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:32 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:32 'gl_InvocationID' ( in int InvocationID) +0:32 Constant: +0:32 1 (const int) +0:32 'ps' ( temp float) +0:33 move second child to first child ( temp float) +0:33 direct index ( temp float ClipDistance) +0:33 gl_ClipDistance: direct index for structure ( out 2-element array of float ClipDistance) +0:33 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_InvocationID' ( in int InvocationID) +0:33 Constant: +0:33 2 (const int) +0:33 Constant: +0:33 1 (const int) +0:33 'cd' ( temp float) +0:35 move second child to first child ( temp float) +0:35 direct index ( patch temp float TessLevelOuter) +0:35 'gl_TessLevelOuter' ( patch out 4-element array of float TessLevelOuter) +0:35 Constant: +0:35 3 (const int) +0:35 Constant: +0:35 3.200000 +0:36 move second child to first child ( temp float) +0:36 direct index ( patch temp float TessLevelInner) +0:36 'gl_TessLevelInner' ( patch out 2-element array of float TessLevelInner) +0:36 Constant: +0:36 1 (const int) +0:36 Constant: +0:36 1.300000 +0:38 Test condition and select ( temp void) +0:38 Condition +0:38 Compare Greater Than ( temp bool) +0:38 'a' ( temp int) +0:38 Constant: +0:38 10 (const int) +0:38 true case +0:39 Barrier ( global void) +0:38 false case +0:41 Barrier ( global void) +0:43 Barrier ( global void) +0:47 Loop with condition not tested first +0:47 Loop Condition +0:47 Compare Greater Than ( temp bool) +0:47 'a' ( temp int) +0:47 Constant: +0:47 10 (const int) +0:47 Loop Body +0:46 Sequence +0:46 Barrier ( global void) +0:49 switch +0:49 condition +0:49 'a' ( temp int) +0:49 body +0:49 Sequence +0:50 default: +0:? Sequence +0:51 Barrier ( global void) +0:52 Branch: Break +0:54 Test condition and select ( temp int) +0:54 Condition +0:54 Compare Less Than ( temp bool) +0:54 'a' ( temp int) +0:54 Constant: +0:54 12 (const int) +0:54 true case +0:54 'a' ( temp int) +0:54 false case +0:54 Comma ( temp int) +0:54 Barrier ( global void) +0:54 'a' ( temp int) +0:56 Sequence +0:56 Barrier ( global void) +0:59 Branch: Return +0:61 Barrier ( global void) +0:8 Function Definition: main( ( global void) +0:8 Function Parameters: +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:17 Sequence +0:17 Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:17 'p' ( temp 4-component vector of float) +0:17 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:17 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:17 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 0 (const int) +0:18 Sequence +0:18 move second child to first child ( temp float) +0:18 'ps' ( temp float) +0:18 gl_PointSize: direct index for structure ( in float PointSize) +0:18 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:18 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 1 (const int) +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'cd' ( temp float) +0:19 direct index ( temp float ClipDistance) +0:19 gl_ClipDistance: direct index for structure ( in 3-element array of float ClipDistance) +0:19 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:19 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 2 (const int) +0:21 Sequence +0:21 move second child to first child ( temp int) +0:21 'pvi' ( temp int) +0:21 'gl_PatchVerticesIn' ( in int PatchVertices) +0:22 Sequence +0:22 move second child to first child ( temp int) +0:22 'pid' ( temp int) +0:22 'gl_PrimitiveID' ( in int PrimitiveID) +0:23 Sequence +0:23 move second child to first child ( temp int) +0:23 'iid' ( temp int) +0:23 'gl_InvocationID' ( in int InvocationID) +0:25 move second child to first child ( temp 4-component vector of float) +0:25 gl_Position: direct index for structure ( out 4-component vector of float Position) +0:25 indirect index ( temp block{ out 4-component vector of float Position gl_Position}) +0:25 'gl_out' ( out 3-element array of block{ out 4-component vector of float Position gl_Position}) +0:25 'gl_InvocationID' ( in int InvocationID) +0:25 Constant: +0:25 0 (const int) +0:25 'p' ( temp 4-component vector of float) +0:26 indirect index ( temp block{ out 4-component vector of float Position gl_Position}) +0:26 'gl_out' ( out 3-element array of block{ out 4-component vector of float Position gl_Position}) +0:26 'gl_InvocationID' ( in int InvocationID) +0:? Linker Objects +0:? 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:? 'outa' ( global 4-element array of int) +0:? 'patchOut' ( patch out 4-component vector of float) +0:? 'patchIn' ( patch in 4-component vector of float) +0:? 'ina' ( in 2-component vector of float) +0:? 'inb' ( in 32-element array of 2-component vector of float) +0:? 'inc' ( in 32-element array of 2-component vector of float) +0:? 'ind' ( in 32-element array of 2-component vector of float) +0:? 'ivla' (layout( location=3) in 32-element array of 4-component vector of float) +0:? 'ivlb' (layout( location=4) in 32-element array of 4-component vector of float) +0:? 'ivlc' (layout( location=4) in 32-element array of 4-component vector of float) +0:? 'ovla' (layout( location=3) out 4-element array of 4-component vector of float) +0:? 'ovlb' (layout( location=4) out 4-element array of 4-component vector of float) +0:? 'ovlc' (layout( location=4) out 4-element array of 4-component vector of float) +0:? 'pv3' ( noContraction temp 3-component vector of float) +0:? 'pinbi' ( patch out block{ out int a}) +0:? 'badOrder' ( invariant noContraction out 4-element array of 4-component vector of float) +0:? 'a' ( out 3-element array of int) +0:? 'outb' ( out 5-element array of int) +0:? 'outc' ( out 4-element array of int) +0:? 'outf' ( out float) +0:? 'vs_tcs_first' (layout( location=0) in 32-element array of 2X4 matrix of double) +0:? 'vs_tcs_last' (layout( location=12) in 32-element array of 2X4 matrix of double) +Shader version: 420 +Requested GL_ARB_separate_shader_objects +Requested GL_ARB_tessellation_shader +Requested GL_EXT_device_group +Requested GL_EXT_multiview +input primitive = quads +vertex spacing = fractional_odd_spacing +triangle order = cw +using point mode +ERROR: node is still EOpNull! +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 Constant: +0:12 0.000000 +0:14 Sequence +0:14 move second child to first child ( temp int) +0:14 'a' ( temp int) +0:14 Constant: +0:14 1512 (const int) +0:22 Sequence +0:22 move second child to first child ( temp 4-component vector of float) +0:22 'p' ( temp 4-component vector of float) +0:22 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:22 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:22 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 0 (const int) +0:23 Sequence +0:23 move second child to first child ( temp float) +0:23 'ps' ( temp float) +0:23 gl_PointSize: direct index for structure ( in float PointSize) +0:23 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:23 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:23 Constant: +0:23 1 (const int) +0:23 Constant: +0:23 1 (const int) +0:24 Sequence +0:24 move second child to first child ( temp float) +0:24 'cd' ( temp float) +0:24 direct index ( temp float ClipDistance) +0:24 gl_ClipDistance: direct index for structure ( in 3-element array of float ClipDistance) +0:24 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:24 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:24 Constant: +0:24 1 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 2 (const int) +0:26 Sequence +0:26 move second child to first child ( temp int) +0:26 'pvi' ( temp int) +0:26 'gl_PatchVerticesIn' ( in int PatchVertices) +0:27 Sequence +0:27 move second child to first child ( temp int) +0:27 'pid' ( temp int) +0:27 'gl_PrimitiveID' ( in int PrimitiveID) +0:28 Sequence +0:28 move second child to first child ( temp 3-component vector of float) +0:28 'tc' ( temp 3-component vector of float) +0:28 'gl_TessCoord' ( in 3-component vector of float TessCoord) +0:29 Sequence +0:29 move second child to first child ( temp float) +0:29 'tlo' ( temp float) +0:29 direct index ( patch temp float TessLevelOuter) +0:29 'gl_TessLevelOuter' ( patch in 4-element array of float TessLevelOuter) +0:29 Constant: +0:29 3 (const int) +0:30 Sequence +0:30 move second child to first child ( temp float) +0:30 'tli' ( temp float) +0:30 direct index ( patch temp float TessLevelInner) +0:30 'gl_TessLevelInner' ( patch in 2-element array of float TessLevelInner) +0:30 Constant: +0:30 1 (const int) +0:32 move second child to first child ( temp 4-component vector of float) +0:32 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:32 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 3-element array of float ClipDistance gl_ClipDistance}) +0:32 Constant: +0:32 0 (const uint) +0:32 'p' ( temp 4-component vector of float) +0:33 move second child to first child ( temp float) +0:33 gl_PointSize: direct index for structure ( gl_PointSize float PointSize) +0:33 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 3-element array of float ClipDistance gl_ClipDistance}) +0:33 Constant: +0:33 1 (const uint) +0:33 'ps' ( temp float) +0:34 move second child to first child ( temp float) +0:34 direct index ( temp float ClipDistance) +0:34 gl_ClipDistance: direct index for structure ( out 3-element array of float ClipDistance) +0:34 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 3-element array of float ClipDistance gl_ClipDistance}) +0:34 Constant: +0:34 2 (const uint) +0:34 Constant: +0:34 2 (const int) +0:34 'cd' ( temp float) +0:20 Function Definition: main( ( global void) +0:20 Function Parameters: +0:22 Sequence +0:22 Constant: +0:22 0.000000 +0:24 Sequence +0:24 move second child to first child ( temp int) +0:24 'a' ( temp int) +0:24 Constant: +0:24 1512 (const int) +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of float) +0:32 'p' ( temp 4-component vector of float) +0:32 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:32 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:32 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 0 (const int) +0:33 Sequence +0:33 move second child to first child ( temp float) +0:33 'ps' ( temp float) +0:33 gl_PointSize: direct index for structure ( in float PointSize) +0:33 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 1 (const int) +0:34 Sequence +0:34 move second child to first child ( temp float) +0:34 'cd' ( temp float) +0:34 direct index ( temp float ClipDistance) +0:34 gl_ClipDistance: direct index for structure ( in 3-element array of float ClipDistance) +0:34 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:34 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:34 Constant: +0:34 1 (const int) +0:34 Constant: +0:34 2 (const int) +0:34 Constant: +0:34 2 (const int) +0:36 Sequence +0:36 move second child to first child ( temp int) +0:36 'pvi' ( temp int) +0:36 'gl_PatchVerticesIn' ( in int PatchVertices) +0:37 Sequence +0:37 move second child to first child ( temp int) +0:37 'pid' ( temp int) +0:37 'gl_PrimitiveID' ( in int PrimitiveID) +0:38 Sequence +0:38 move second child to first child ( temp 3-component vector of float) +0:38 'tc' ( temp 3-component vector of float) +0:38 'gl_TessCoord' ( in 3-component vector of float TessCoord) +0:39 Sequence +0:39 move second child to first child ( temp float) +0:39 'tlo' ( temp float) +0:39 direct index ( patch temp float TessLevelOuter) +0:39 'gl_TessLevelOuter' ( patch in 4-element array of float TessLevelOuter) +0:39 Constant: +0:39 3 (const int) +0:40 Sequence +0:40 move second child to first child ( temp float) +0:40 'tli' ( temp float) +0:40 direct index ( patch temp float TessLevelInner) +0:40 'gl_TessLevelInner' ( patch in 2-element array of float TessLevelInner) +0:40 Constant: +0:40 1 (const int) +0:42 move second child to first child ( temp 4-component vector of float) +0:42 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:42 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 3-element array of float ClipDistance gl_ClipDistance}) +0:42 Constant: +0:42 0 (const uint) +0:42 'p' ( temp 4-component vector of float) +0:43 move second child to first child ( temp float) +0:43 gl_PointSize: direct index for structure ( gl_PointSize float PointSize) +0:43 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 3-element array of float ClipDistance gl_ClipDistance}) +0:43 Constant: +0:43 1 (const uint) +0:43 'ps' ( temp float) +0:44 move second child to first child ( temp float) +0:44 direct index ( temp float ClipDistance) +0:44 gl_ClipDistance: direct index for structure ( out 3-element array of float ClipDistance) +0:44 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 3-element array of float ClipDistance gl_ClipDistance}) +0:44 Constant: +0:44 2 (const uint) +0:44 Constant: +0:44 2 (const int) +0:44 'cd' ( temp float) +0:4 Sequence +0:4 move second child to first child ( temp 2X2 matrix of float) +0:4 'b' ( global 2X2 matrix of float) +0:4 Constant: +0:4 1.000000 +0:4 0.000000 +0:4 0.000000 +0:4 1.000000 +0:15 Sequence +0:15 move second child to first child ( temp structure{ global float a, global int b}) +0:15 'e' ( global structure{ global float a, global int b}) +0:15 Constant: +0:15 1.200000 +0:15 2 (const int) +0:20 Sequence +0:20 move second child to first child ( temp structure{ global float a, global int b}) +0:20 'e2' ( global structure{ global float a, global int b}) +0:20 Constant: +0:20 1.000000 +0:20 3 (const int) +0:42 Sequence +0:42 move second child to first child ( temp 5-element array of float) +0:42 'b5' ( global 5-element array of float) +0:42 Constant: +0:42 3.400000 +0:42 4.200000 +0:42 5.000000 +0:42 5.200000 +0:42 1.100000 +0:55 Sequence +0:55 move second child to first child ( temp structure{ global int f}) +0:55 'single1' ( global structure{ global int f}) +0:55 Constant: +0:55 10 (const int) +0:58 Sequence +0:58 move second child to first child ( temp structure{ global 2-component vector of uint v}) +0:58 'single2' ( global structure{ global 2-component vector of uint v}) +0:58 Constant: +0:58 1 (const uint) +0:58 2 (const uint) +0:61 Sequence +0:61 move second child to first child ( temp structure{ global structure{ global int f} s1}) +0:61 'single3' ( global structure{ global structure{ global int f} s1}) +0:61 Constant: +0:61 3 (const int) +0:64 Sequence +0:64 move second child to first child ( temp structure{ global structure{ global 2-component vector of uint v} s1}) +0:64 'single4' ( global structure{ global structure{ global 2-component vector of uint v} s1}) +0:64 Constant: +0:64 4 (const uint) +0:64 5 (const uint) +0:79 Sequence +0:79 move second child to first child ( temp 3-component vector of float) +0:79 'av3' ( global 3-component vector of float) +0:79 Construct vec3 ( global 3-component vector of float) +0:79 'vc1' ( global float) +0:79 'vc2' ( global float) +0:79 'vc3' ( global float) +0:80 Sequence +0:80 move second child to first child ( temp 3-component vector of float) +0:80 'bv3' ( global 3-component vector of float) +0:80 Construct vec3 ( temp 3-component vector of float) +0:80 'vc1' ( global float) +0:80 'vc2' ( global float) +0:80 'vc3' ( global float) +0:82 Function Definition: main( ( global void) +0:82 Function Parameters: +0:84 Sequence +0:84 MemoryBarrier ( global void) +0:86 Test condition and select ( temp void) +0:86 Condition +0:86 Compare Equal ( temp bool) +0:86 Constant: +0:86 1 (const uint) +0:86 2 (const uint) +0:86 3.000000 +0:86 4.000000 +0:86 0.000000 +0:86 0.000000 +0:86 0.000000 +0:86 4.000000 +0:86 0.000000 +0:86 5.000000 +0:86 6.000000 +0:86 0.000000 +0:86 0.000000 +0:86 0.000000 +0:86 6.000000 +0:86 0.000000 +0:86 'curlybad1' ( temp structure{ global 2-component vector of uint uv2, global 2-element array of structure{ global float f, global 2X3 matrix of float m23} s}) +0:86 true case is null +0:88 Test condition and select ( temp void) +0:88 Condition +0:88 Constant: +0:88 true (const bool) +0:88 true case is null +0:? Linker Objects +0:? 'patchIn' ( patch in 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 3-element array of float ClipDistance gl_ClipDistance}) +0:? 'patchOut' ( patch out 4-component vector of float) +0:? 'badp1' ( smooth patch in 4-component vector of float) +0:? 'badp2' ( flat patch in 4-component vector of float) +0:? 'badp3' ( noperspective patch in 4-component vector of float) +0:? 'badp4' ( patch sample in 3-component vector of float) +0:? 'gl_in' ( in 32-element array of block{ in 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'ina' ( in 2-component vector of float) +0:? 'inb' ( in 32-element array of 2-component vector of float) +0:? 'inc' ( in 32-element array of 2-component vector of float) +0:? 'ind' ( in 32-element array of 2-component vector of float) +0:? 'bla' ( in block{ in int f}) +0:? 'blb' ( in 32-element array of block{ in int f}) +0:? 'blc' ( in 32-element array of block{ in int f}) +0:? 'bld' ( in 32-element array of block{ in int f}) +0:? 'ivla' (layout( location=23) in 32-element array of 4-component vector of float) +0:? 'ivlb' (layout( location=24) in 32-element array of 4-component vector of float) +0:? 'ivlc' (layout( location=24) in 32-element array of 4-component vector of float) +0:? 'ovla' (layout( location=23) out 2-element array of 4-component vector of float) +0:? 'ovlb' (layout( location=24) out 2-element array of 4-component vector of float) +0:? 'pinbi' ( patch in block{ in int a}) +0:? 'a' ( const 2X2 matrix of float) +0:? 1.000000 +0:? 0.000000 +0:? 0.000000 +0:? 1.000000 +0:? 'b' ( global 2X2 matrix of float) +0:? 'c' ( const 2X2 matrix of float) +0:? 1.000000 +0:? 0.000000 +0:? 0.000000 +0:? 1.000000 +0:? 'a2' ( global 2-element array of float) +0:? 'b2' ( global 2-component vector of float) +0:? 'c2' ( global 3X3 matrix of float) +0:? 'd' ( global 2X2 matrix of float) +0:? 'e' ( global structure{ global float a, global int b}) +0:? 'e2' ( global structure{ global float a, global int b}) +0:? 'e3' ( global structure{ global float a, global int b}) +0:? 'a3' ( global int) +0:? 'b3' ( global 2-element array of 4-component vector of float) +0:? 'b4' ( global 2-element array of 4-component vector of float) +0:? 'c3' ( global 4X2 matrix of float) +0:? 'd2' ( global 1-element array of structure{ global float s, global float t}) +0:? 'b5' ( global 5-element array of float) +0:? 'single1' ( global structure{ global int f}) +0:? 'single2' ( global structure{ global 2-component vector of uint v}) +0:? 'single3' ( global structure{ global structure{ global int f} s1}) +0:? 'single4' ( global structure{ global structure{ global 2-component vector of uint v} s1}) +0:? 'constructed' ( const structure{ global 2-component vector of uint uv2, global 2-element array of structure{ global float f, global 2X3 matrix of float m23} s}) +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3.000000 +0:? 4.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 4.000000 +0:? 0.000000 +0:? 5.000000 +0:? 6.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 6.000000 +0:? 0.000000 +0:? 'curlybad1' ( temp structure{ global 2-component vector of uint uv2, global 2-element array of structure{ global float f, global 2X3 matrix of float m23} s}) +0:? 'curlyInit' ( const structure{ global 2-component vector of uint uv2, global 2-element array of structure{ global float f, global 2X3 matrix of float m23} s}) +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3.000000 +0:? 4.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 4.000000 +0:? 0.000000 +0:? 5.000000 +0:? 6.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 6.000000 +0:? 0.000000 +0:? 'vc1' ( global float) +0:? 'vc2' ( global float) +0:? 'vc3' ( global float) +0:? 'av3' ( global 3-component vector of float) +0:? 'bv3' ( global 3-component vector of float) + diff --git a/deps/glslang/Test/baseResults/150.vert.out b/deps/glslang/Test/baseResults/150.vert.out new file mode 100644 index 00000000..504160d5 --- /dev/null +++ b/deps/glslang/Test/baseResults/150.vert.out @@ -0,0 +1,95 @@ +150.vert +ERROR: 0:26: 'a' : cannot redeclare a user-block member array +ERROR: 0:3001: '#error' : line of this error should be 3001 +ERROR: 2 compilation errors. No code generated. + + +Shader version: 150 +ERROR: node is still EOpNull! +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:15 Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:15 gl_Position: direct index for structure ( invariant gl_Position 4-component vector of float Position) +0:15 'anon@0' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:15 Constant: +0:15 0 (const uint) +0:15 'iv4' ( in 4-component vector of float) +0:16 move second child to first child ( temp float) +0:16 gl_PointSize: direct index for structure ( gl_PointSize float PointSize) +0:16 'anon@0' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:16 Constant: +0:16 1 (const uint) +0:16 'ps' ( uniform float) +0:17 move second child to first child ( temp float) +0:17 direct index ( temp float ClipDistance) +0:17 gl_ClipDistance: direct index for structure ( out 4-element array of float ClipDistance) +0:17 'anon@0' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:17 Constant: +0:17 2 (const uint) +0:17 Constant: +0:17 2 (const int) +0:17 direct index ( temp float) +0:17 'iv4' ( in 4-component vector of float) +0:17 Constant: +0:17 0 (const int) +0:18 move second child to first child ( temp 4-component vector of float) +0:18 gl_ClipVertex: direct index for structure ( gl_ClipVertex 4-component vector of float ClipVertex) +0:18 'anon@0' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:18 Constant: +0:18 3 (const uint) +0:18 'iv4' ( in 4-component vector of float) +0:? Linker Objects +0:? 'iv4' ( in 4-component vector of float) +0:? 'ps' ( uniform float) +0:? 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform unsized 1-element array of int a}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + +ERROR: Linking vertex stage: Can only use one of gl_ClipDistance or gl_ClipVertex (gl_ClipDistance is preferred) + +Shader version: 150 +ERROR: node is still EOpNull! +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:15 Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:15 gl_Position: direct index for structure ( invariant gl_Position 4-component vector of float Position) +0:15 'anon@0' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:15 Constant: +0:15 0 (const uint) +0:15 'iv4' ( in 4-component vector of float) +0:16 move second child to first child ( temp float) +0:16 gl_PointSize: direct index for structure ( gl_PointSize float PointSize) +0:16 'anon@0' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:16 Constant: +0:16 1 (const uint) +0:16 'ps' ( uniform float) +0:17 move second child to first child ( temp float) +0:17 direct index ( temp float ClipDistance) +0:17 gl_ClipDistance: direct index for structure ( out 4-element array of float ClipDistance) +0:17 'anon@0' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:17 Constant: +0:17 2 (const uint) +0:17 Constant: +0:17 2 (const int) +0:17 direct index ( temp float) +0:17 'iv4' ( in 4-component vector of float) +0:17 Constant: +0:17 0 (const int) +0:18 move second child to first child ( temp 4-component vector of float) +0:18 gl_ClipVertex: direct index for structure ( gl_ClipVertex 4-component vector of float ClipVertex) +0:18 'anon@0' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:18 Constant: +0:18 3 (const uint) +0:18 'iv4' ( in 4-component vector of float) +0:? Linker Objects +0:? 'iv4' ( in 4-component vector of float) +0:? 'ps' ( uniform float) +0:? 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform 1-element array of int a}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/300.frag.out b/deps/glslang/Test/baseResults/300.frag.out new file mode 100644 index 00000000..ee1b8a55 --- /dev/null +++ b/deps/glslang/Test/baseResults/300.frag.out @@ -0,0 +1,632 @@ +300.frag +ERROR: 0:2: 'float' : type requires declaration of default precision qualifier +ERROR: 0:30: 'noperspective' : Reserved word. +ERROR: 0:30: 'noperspective' : not supported for this version or the enabled extensions +ERROR: 0:31: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: bads +ERROR: 0:32: 'uint' : cannot apply precision statement to this type; use 'float', 'int' or a sampler type +ERROR: 0:39: 'structure' : must be qualified as flat in +ERROR: 0:39: 'structure' : non-uniform struct contains a sampler or image: badout +ERROR: 0:60: 'texel offset' : argument must be compile-time constant +ERROR: 0:62: 'texel offset' : argument must be compile-time constant +ERROR: 0:63: 'texel offset' : argument must be compile-time constant +ERROR: 0:64: 'texel offset' : argument must be compile-time constant +ERROR: 0:66: 'texel offset' : argument must be compile-time constant +ERROR: 0:68: 'texel offset' : argument must be compile-time constant +ERROR: 0:69: 'variable indexing sampler array' : not supported for this version or the enabled extensions +ERROR: 0:73: 'texel offset' : argument must be compile-time constant +ERROR: 0:83: 'double' : Reserved word. +ERROR: 0:83: 'double' : not supported with this profile: es +ERROR: 0:84: 'dvec2' : Reserved word. +ERROR: 0:84: 'double vector' : not supported with this profile: es +ERROR: 0:85: 'dvec3' : Reserved word. +ERROR: 0:85: 'double vector' : not supported with this profile: es +ERROR: 0:86: 'dvec4' : Reserved word. +ERROR: 0:86: 'double vector' : not supported with this profile: es +ERROR: 0:101: 'arrays of arrays' : not supported for this version or the enabled extensions +ERROR: 0:102: 'arrays of arrays' : not supported for this version or the enabled extensions +ERROR: 0:102: 'arrays of arrays' : not supported for this version or the enabled extensions +ERROR: 0:103: 'arrays of arrays' : not supported for this version or the enabled extensions +ERROR: 0:103: 'arrays of arrays' : not supported for this version or the enabled extensions +ERROR: 0:100: 'arrays of arrays' : not supported for this version or the enabled extensions +ERROR: 0:100: 'array-of-array of block' : not supported with this profile: es +ERROR: 0:111: 'variable indexing fragment shader output array' : not supported with this profile: es +ERROR: 0:119: '==' : can't use with samplers or structs containing samplers +ERROR: 0:120: '!=' : can't use with samplers or structs containing samplers +ERROR: 0:121: '==' : can't use with samplers or structs containing samplers +ERROR: 0:121: '==' : wrong operand types: no operation '==' exists that takes a left-hand operand of type ' global lowp sampler2D' and a right operand of type ' global lowp sampler2D' (or there is no acceptable conversion) +ERROR: 0:122: '=' : can't use with samplers or structs containing samplers +ERROR: 0:123: '==' : can't use with samplers or structs containing samplers +ERROR: 0:129: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset] +ERROR: 0:129: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset] +ERROR: 0:148: 'qualifier' : cannot use auxiliary, memory, interpolation, or precision qualifier in a default qualifier declaration (declaration with no type) +ERROR: 0:150: 'early_fragment_tests' : not supported for this version or the enabled extensions +ERROR: 0:156: 'invariant' : can only apply to an output +ERROR: 0:157: 'invariant' : can only apply to an output +ERROR: 0:158: 'invariant' : can only apply to an output +ERROR: 0:160: 'imageBuffer' : Reserved word. +ERROR: 0:160: '' : syntax error, unexpected IMAGEBUFFER, expecting COMMA or SEMICOLON +ERROR: 46 compilation errors. No code generated. + + +Shader version: 300 +using early_fragment_tests +ERROR: node is still EOpNull! +0:53 Function Definition: main( ( global void) +0:53 Function Parameters: +0:? Sequence +0:57 move second child to first child ( temp lowp 4-component vector of float) +0:57 'v' ( temp lowp 4-component vector of float) +0:57 texture ( global lowp 4-component vector of float) +0:57 's2D' ( uniform lowp sampler2D) +0:57 'c2D' ( smooth in lowp 2-component vector of float) +0:58 move second child to first child ( temp lowp 4-component vector of float) +0:58 'v' ( temp lowp 4-component vector of float) +0:58 textureProj ( global lowp 4-component vector of float) +0:58 's3D' ( uniform lowp sampler3D) +0:58 'c4D' ( smooth temp lowp 4-component vector of float) +0:59 move second child to first child ( temp lowp 4-component vector of float) +0:59 'v' ( temp lowp 4-component vector of float) +0:59 textureLod ( global lowp 4-component vector of float) +0:59 's2DArray' ( uniform lowp sampler2DArray) +0:59 'c3D' ( smooth in lowp 3-component vector of float) +0:59 Constant: +0:59 1.200000 +0:60 move second child to first child ( temp lowp float) +0:60 'f' ( temp lowp float) +0:60 textureOffset ( global lowp float, operation at mediump) +0:60 's2DShadow' ( uniform lowp sampler2DShadow) +0:60 'c3D' ( smooth in lowp 3-component vector of float) +0:60 'ic2D' ( flat in mediump 2-component vector of int) +0:60 'c1D' ( smooth in lowp float) +0:61 move second child to first child ( temp lowp 4-component vector of float) +0:61 'v' ( temp lowp 4-component vector of float) +0:61 textureFetch ( global lowp 4-component vector of float, operation at mediump) +0:61 's3D' ( uniform lowp sampler3D) +0:61 'ic3D' ( flat in mediump 3-component vector of int) +0:61 'ic1D' ( flat in mediump int) +0:62 move second child to first child ( temp lowp 4-component vector of float) +0:62 'v' ( temp lowp 4-component vector of float) +0:62 textureFetchOffset ( global lowp 4-component vector of float, operation at mediump) +0:62 direct index ( temp lowp sampler2D) +0:62 'arrayedSampler' ( uniform 5-element array of lowp sampler2D) +0:62 Constant: +0:62 2 (const int) +0:62 'ic2D' ( flat in mediump 2-component vector of int) +0:62 Constant: +0:62 4 (const int) +0:62 'ic2D' ( flat in mediump 2-component vector of int) +0:63 move second child to first child ( temp lowp float) +0:63 'f' ( temp lowp float) +0:63 textureLodOffset ( global lowp float, operation at mediump) +0:63 's2DShadow' ( uniform lowp sampler2DShadow) +0:63 'c3D' ( smooth in lowp 3-component vector of float) +0:63 'c1D' ( smooth in lowp float) +0:63 'ic2D' ( flat in mediump 2-component vector of int) +0:64 move second child to first child ( temp lowp 4-component vector of float) +0:64 'v' ( temp lowp 4-component vector of float) +0:64 textureProjLodOffset ( global lowp 4-component vector of float, operation at mediump) +0:64 's2D' ( uniform lowp sampler2D) +0:64 'c3D' ( smooth in lowp 3-component vector of float) +0:64 'c1D' ( smooth in lowp float) +0:64 'ic2D' ( flat in mediump 2-component vector of int) +0:65 move second child to first child ( temp lowp 4-component vector of float) +0:65 'v' ( temp lowp 4-component vector of float) +0:65 textureGrad ( global lowp 4-component vector of float) +0:65 'sCube' ( uniform lowp samplerCube) +0:65 'c3D' ( smooth in lowp 3-component vector of float) +0:65 'c3D' ( smooth in lowp 3-component vector of float) +0:65 'c3D' ( smooth in lowp 3-component vector of float) +0:66 move second child to first child ( temp lowp float) +0:66 'f' ( temp lowp float) +0:66 textureGradOffset ( global lowp float, operation at mediump) +0:66 's2DArrayShadow' ( uniform lowp sampler2DArrayShadow) +0:66 'c4D' ( smooth temp lowp 4-component vector of float) +0:66 'c2D' ( smooth in lowp 2-component vector of float) +0:66 'c2D' ( smooth in lowp 2-component vector of float) +0:66 'ic2D' ( flat in mediump 2-component vector of int) +0:67 move second child to first child ( temp lowp 4-component vector of float) +0:67 'v' ( temp lowp 4-component vector of float) +0:67 textureProjGrad ( global lowp 4-component vector of float) +0:67 's3D' ( uniform lowp sampler3D) +0:67 'c4D' ( smooth temp lowp 4-component vector of float) +0:67 'c3D' ( smooth in lowp 3-component vector of float) +0:67 'c3D' ( smooth in lowp 3-component vector of float) +0:68 move second child to first child ( temp lowp 4-component vector of float) +0:68 'v' ( temp lowp 4-component vector of float) +0:68 textureProjGradOffset ( global lowp 4-component vector of float, operation at mediump) +0:68 's2D' ( uniform lowp sampler2D) +0:68 'c3D' ( smooth in lowp 3-component vector of float) +0:68 'c2D' ( smooth in lowp 2-component vector of float) +0:68 'c2D' ( smooth in lowp 2-component vector of float) +0:68 'ic2D' ( flat in mediump 2-component vector of int) +0:69 move second child to first child ( temp lowp 4-component vector of float) +0:69 'v' ( temp lowp 4-component vector of float) +0:69 texture ( global lowp 4-component vector of float) +0:69 indirect index ( temp lowp sampler2D) +0:69 'arrayedSampler' ( uniform 5-element array of lowp sampler2D) +0:69 'ic1D' ( flat in mediump int) +0:69 'c2D' ( smooth in lowp 2-component vector of float) +0:72 move second child to first child ( temp mediump 4-component vector of int) +0:72 'iv' ( temp mediump 4-component vector of int) +0:72 texture ( global lowp 4-component vector of int) +0:72 'is2D' ( uniform lowp isampler2D) +0:72 'c2D' ( smooth in lowp 2-component vector of float) +0:73 move second child to first child ( temp mediump 4-component vector of int) +0:73 'iv' ( temp mediump 4-component vector of int) +0:73 textureProjOffset ( global lowp 4-component vector of int, operation at mediump) +0:73 'is2D' ( uniform lowp isampler2D) +0:73 'c4D' ( smooth temp lowp 4-component vector of float) +0:73 'ic2D' ( flat in mediump 2-component vector of int) +0:74 move second child to first child ( temp mediump 4-component vector of int) +0:74 'iv' ( temp mediump 4-component vector of int) +0:74 textureProjLod ( global lowp 4-component vector of int) +0:74 'is2D' ( uniform lowp isampler2D) +0:74 'c3D' ( smooth in lowp 3-component vector of float) +0:74 'c1D' ( smooth in lowp float) +0:75 move second child to first child ( temp mediump 4-component vector of int) +0:75 'iv' ( temp mediump 4-component vector of int) +0:75 textureProjGrad ( global lowp 4-component vector of int) +0:75 'is2D' ( uniform lowp isampler2D) +0:75 'c3D' ( smooth in lowp 3-component vector of float) +0:75 'c2D' ( smooth in lowp 2-component vector of float) +0:75 'c2D' ( smooth in lowp 2-component vector of float) +0:76 move second child to first child ( temp mediump 4-component vector of int) +0:76 'iv' ( temp mediump 4-component vector of int) +0:76 texture ( global lowp 4-component vector of int) +0:76 'is3D' ( uniform lowp isampler3D) +0:76 'c3D' ( smooth in lowp 3-component vector of float) +0:76 Constant: +0:76 4.200000 +0:77 move second child to first child ( temp mediump 4-component vector of int) +0:77 'iv' ( temp mediump 4-component vector of int) +0:77 textureLod ( global lowp 4-component vector of int) +0:77 'isCube' ( uniform lowp isamplerCube) +0:77 'c3D' ( smooth in lowp 3-component vector of float) +0:77 'c1D' ( smooth in lowp float) +0:78 move second child to first child ( temp mediump 4-component vector of int) +0:78 'iv' ( temp mediump 4-component vector of int) +0:78 textureFetch ( global lowp 4-component vector of int, operation at mediump) +0:78 'is2DArray' ( uniform lowp isampler2DArray) +0:78 'ic3D' ( flat in mediump 3-component vector of int) +0:78 'ic1D' ( flat in mediump int) +0:80 move second child to first child ( temp highp 2-component vector of int) +0:80 vector swizzle ( temp mediump 2-component vector of int) +0:80 'iv' ( temp mediump 4-component vector of int) +0:80 Sequence +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 1 (const int) +0:80 textureSize ( global highp 2-component vector of int, operation at lowp) +0:80 'sCubeShadow' ( uniform lowp samplerCubeShadow) +0:80 Constant: +0:80 2 (const int) +0:88 add second child into first child ( temp highp float) +0:88 'f' ( temp lowp float) +0:88 direct index ( temp highp float) +0:88 'gl_FragCoord' ( gl_FragCoord highp 4-component vector of float FragCoord) +0:88 Constant: +0:88 1 (const int) +0:89 move second child to first child ( temp highp float) +0:89 'gl_FragDepth' ( gl_FragDepth highp float FragDepth) +0:89 'f' ( temp lowp float) +0:91 move second child to first child ( temp lowp 3-component vector of float) +0:91 'sc' ( out lowp 3-component vector of float) +0:91 c: direct index for structure ( global lowp 3-component vector of float) +0:91 's2' ( smooth in structure{ global lowp 3-component vector of float c, global lowp float f}) +0:91 Constant: +0:91 0 (const int) +0:92 move second child to first child ( temp lowp float) +0:92 'sf' ( out lowp float) +0:92 f: direct index for structure ( global lowp float) +0:92 's2' ( smooth in structure{ global lowp 3-component vector of float c, global lowp float f}) +0:92 Constant: +0:92 1 (const int) +0:94 add ( temp lowp 2-component vector of float) +0:94 hyp. sine ( global lowp float) +0:94 'c1D' ( smooth in lowp float) +0:95 vector-scale ( temp lowp 2-component vector of float) +0:95 hyp. cosine ( global lowp float) +0:95 'c1D' ( smooth in lowp float) +0:95 hyp. tangent ( global lowp 2-component vector of float) +0:95 'c2D' ( smooth in lowp 2-component vector of float) +0:96 add ( temp lowp 4-component vector of float) +0:96 arc hyp. sine ( global lowp 4-component vector of float) +0:96 'c4D' ( smooth temp lowp 4-component vector of float) +0:96 arc hyp. cosine ( global lowp 4-component vector of float) +0:96 'c4D' ( smooth temp lowp 4-component vector of float) +0:97 arc hyp. tangent ( global lowp 3-component vector of float) +0:97 'c3D' ( smooth in lowp 3-component vector of float) +0:108 Function Definition: foo( ( global void) +0:108 Function Parameters: +0:110 Sequence +0:110 move second child to first child ( temp lowp 4-component vector of float) +0:110 direct index ( temp lowp 4-component vector of float) +0:110 'colors' ( out 4-element array of lowp 4-component vector of float) +0:110 Constant: +0:110 2 (const int) +0:110 'c4D' ( smooth temp lowp 4-component vector of float) +0:111 move second child to first child ( temp lowp 4-component vector of float) +0:111 indirect index ( temp lowp 4-component vector of float) +0:111 'colors' ( out 4-element array of lowp 4-component vector of float) +0:111 'ic1D' ( flat in mediump int) +0:111 'c4D' ( smooth temp lowp 4-component vector of float) +0:117 Function Definition: foo13(struct-s-i1-s211; ( global void) +0:117 Function Parameters: +0:117 'inSt2' ( in structure{ global mediump int i, global lowp sampler2D s}) +0:119 Sequence +0:119 Test condition and select ( temp void) +0:119 Condition +0:119 Compare Equal ( temp bool) +0:119 'st1' ( uniform structure{ global mediump int i, global lowp sampler2D s}) +0:119 'st2' ( uniform structure{ global mediump int i, global lowp sampler2D s}) +0:119 true case is null +0:120 Test condition and select ( temp void) +0:120 Condition +0:120 Compare Not Equal ( temp bool) +0:120 'st1' ( uniform structure{ global mediump int i, global lowp sampler2D s}) +0:120 'st2' ( uniform structure{ global mediump int i, global lowp sampler2D s}) +0:120 true case is null +0:121 Constant: +0:121 false (const bool) +0:122 move second child to first child ( temp structure{ global mediump int i, global lowp sampler2D s}) +0:122 'inSt2' ( in structure{ global mediump int i, global lowp sampler2D s}) +0:122 'st1' ( uniform structure{ global mediump int i, global lowp sampler2D s}) +0:123 Compare Equal ( temp bool) +0:123 'inSt2' ( in structure{ global mediump int i, global lowp sampler2D s}) +0:123 'st1' ( uniform structure{ global mediump int i, global lowp sampler2D s}) +0:126 Function Definition: foo23( ( global void) +0:126 Function Parameters: +0:128 Sequence +0:128 textureOffset ( global lowp float) +0:128 's2DShadow' ( uniform lowp sampler2DShadow) +0:128 'c3D' ( smooth in lowp 3-component vector of float) +0:128 Constant: +0:128 -8 (const int) +0:128 7 (const int) +0:128 'c1D' ( smooth in lowp float) +0:129 textureOffset ( global lowp float) +0:129 's2DShadow' ( uniform lowp sampler2DShadow) +0:129 'c3D' ( smooth in lowp 3-component vector of float) +0:129 Constant: +0:129 -9 (const int) +0:129 8 (const int) +0:129 'c1D' ( smooth in lowp float) +0:132 Function Definition: foo324( ( global void) +0:132 Function Parameters: +0:134 Sequence +0:134 Sequence +0:134 move second child to first child ( temp lowp float) +0:134 'p' ( temp lowp float) +0:134 Constant: +0:134 210.712306 +0:135 add second child into first child ( temp lowp float) +0:135 'p' ( temp lowp float) +0:135 Constant: +0:135 0.389418 +0:136 add second child into first child ( temp lowp float) +0:136 'p' ( temp lowp float) +0:136 Constant: +0:136 5.000000 +0:137 add second child into first child ( temp lowp float) +0:137 'p' ( temp lowp float) +0:137 Constant: +0:137 13.000000 +0:138 Sequence +0:138 move second child to first child ( temp lowp 3-component vector of float) +0:138 'c3' ( temp lowp 3-component vector of float) +0:138 Constant: +0:138 -15.000000 +0:138 -2.000000 +0:138 39.000000 +0:139 add second child into first child ( temp lowp 3-component vector of float) +0:139 'c3' ( temp lowp 3-component vector of float) +0:139 Constant: +0:139 -1.000000 +0:139 -2.000000 +0:139 -3.000000 +0:140 add second child into first child ( temp lowp 3-component vector of float) +0:140 'c3' ( temp lowp 3-component vector of float) +0:140 Constant: +0:140 1.000000 +0:140 2.000000 +0:140 3.000000 +0:141 Sequence +0:141 move second child to first child ( temp lowp 2-component vector of float) +0:141 'c2' ( temp lowp 2-component vector of float) +0:141 Constant: +0:141 1.000000 +0:141 -3.000000 +0:142 add second child into first child ( temp lowp 2-component vector of float) +0:142 'c2' ( temp lowp 2-component vector of float) +0:142 Constant: +0:142 1.000000 +0:142 -3.000000 +0:143 add second child into first child ( temp lowp 2-component vector of float) +0:143 'c2' ( temp lowp 2-component vector of float) +0:143 Constant: +0:143 3.000000 +0:143 -8.544004 +0:144 add second child into first child ( temp lowp 2-component vector of float) +0:144 'c2' ( temp lowp 2-component vector of float) +0:144 Constant: +0:144 0.000000 +0:144 0.000000 +0:145 Sequence +0:145 move second child to first child ( temp lowp 3X2 matrix of float) +0:145 'm32' ( temp lowp 3X2 matrix of float) +0:145 Constant: +0:145 10.000000 +0:145 15.000000 +0:145 14.000000 +0:145 21.000000 +0:145 22.000000 +0:145 33.000000 +0:? Linker Objects +0:? 's2D' ( uniform lowp sampler2D) +0:? 's3D' ( uniform lowp sampler3D) +0:? 'sCube' ( uniform lowp samplerCube) +0:? 'sCubeShadow' ( uniform lowp samplerCubeShadow) +0:? 's2DShadow' ( uniform lowp sampler2DShadow) +0:? 's2DArray' ( uniform lowp sampler2DArray) +0:? 's2DArrayShadow' ( uniform lowp sampler2DArrayShadow) +0:? 'is2D' ( uniform lowp isampler2D) +0:? 'is3D' ( uniform lowp isampler3D) +0:? 'isCube' ( uniform lowp isamplerCube) +0:? 'is2DArray' ( uniform lowp isampler2DArray) +0:? 'us2D' ( uniform lowp usampler2D) +0:? 'us3D' ( uniform lowp usampler3D) +0:? 'usCube' ( uniform lowp usamplerCube) +0:? 'us2DArray' ( uniform lowp usampler2DArray) +0:? 'c1D' ( smooth in lowp float) +0:? 'c2D' ( smooth in lowp 2-component vector of float) +0:? 'c3D' ( smooth in lowp 3-component vector of float) +0:? 'c4D' ( smooth temp lowp 4-component vector of float) +0:? 'ic1D' ( flat in mediump int) +0:? 'ic2D' ( flat in mediump 2-component vector of int) +0:? 'ic3D' ( flat in mediump 3-component vector of int) +0:? 'ic4D' ( flat in mediump 4-component vector of int) +0:? 'badv' ( noperspective in lowp 4-component vector of float) +0:? 'bads' ( smooth in lowp sampler2D) +0:? 'badout' ( smooth in structure{ global mediump int i, global lowp sampler2D s}) +0:? 's2' ( smooth in structure{ global lowp 3-component vector of float c, global lowp float f}) +0:? 'sc' ( out lowp 3-component vector of float) +0:? 'sf' ( out lowp float) +0:? 'arrayedSampler' ( uniform 5-element array of lowp sampler2D) +0:? 'multiInst' (layout( column_major shared) uniform 2-element array of 3-element array of block{layout( column_major shared) uniform 3-element array of 2-element array of mediump int a, layout( column_major shared) uniform 2-element array of 3-element array of mediump int b, layout( column_major shared) uniform 2-element array of 3-element array of mediump int c}) +0:? 'colors' ( out 4-element array of lowp 4-component vector of float) +0:? 'st1' ( uniform structure{ global mediump int i, global lowp sampler2D s}) +0:? 'st2' ( uniform structure{ global mediump int i, global lowp sampler2D s}) +0:? 'fooinv' ( invariant smooth in lowp 4-component vector of float) + + +Linked fragment stage: + +ERROR: Linking fragment stage: when more than one fragment shader output, all must have location qualifiers + +Shader version: 300 +using early_fragment_tests +ERROR: node is still EOpNull! +0:53 Function Definition: main( ( global void) +0:53 Function Parameters: +0:? Sequence +0:57 move second child to first child ( temp lowp 4-component vector of float) +0:57 'v' ( temp lowp 4-component vector of float) +0:57 texture ( global lowp 4-component vector of float) +0:57 's2D' ( uniform lowp sampler2D) +0:57 'c2D' ( smooth in lowp 2-component vector of float) +0:58 move second child to first child ( temp lowp 4-component vector of float) +0:58 'v' ( temp lowp 4-component vector of float) +0:58 textureProj ( global lowp 4-component vector of float) +0:58 's3D' ( uniform lowp sampler3D) +0:58 'c4D' ( smooth temp lowp 4-component vector of float) +0:59 move second child to first child ( temp lowp 4-component vector of float) +0:59 'v' ( temp lowp 4-component vector of float) +0:59 textureLod ( global lowp 4-component vector of float) +0:59 's2DArray' ( uniform lowp sampler2DArray) +0:59 'c3D' ( smooth in lowp 3-component vector of float) +0:59 Constant: +0:59 1.200000 +0:60 move second child to first child ( temp lowp float) +0:60 'f' ( temp lowp float) +0:60 textureOffset ( global lowp float, operation at mediump) +0:60 's2DShadow' ( uniform lowp sampler2DShadow) +0:60 'c3D' ( smooth in lowp 3-component vector of float) +0:60 'ic2D' ( flat in mediump 2-component vector of int) +0:60 'c1D' ( smooth in lowp float) +0:61 move second child to first child ( temp lowp 4-component vector of float) +0:61 'v' ( temp lowp 4-component vector of float) +0:61 textureFetch ( global lowp 4-component vector of float, operation at mediump) +0:61 's3D' ( uniform lowp sampler3D) +0:61 'ic3D' ( flat in mediump 3-component vector of int) +0:61 'ic1D' ( flat in mediump int) +0:62 move second child to first child ( temp lowp 4-component vector of float) +0:62 'v' ( temp lowp 4-component vector of float) +0:62 textureFetchOffset ( global lowp 4-component vector of float, operation at mediump) +0:62 direct index ( temp lowp sampler2D) +0:62 'arrayedSampler' ( uniform 5-element array of lowp sampler2D) +0:62 Constant: +0:62 2 (const int) +0:62 'ic2D' ( flat in mediump 2-component vector of int) +0:62 Constant: +0:62 4 (const int) +0:62 'ic2D' ( flat in mediump 2-component vector of int) +0:63 move second child to first child ( temp lowp float) +0:63 'f' ( temp lowp float) +0:63 textureLodOffset ( global lowp float, operation at mediump) +0:63 's2DShadow' ( uniform lowp sampler2DShadow) +0:63 'c3D' ( smooth in lowp 3-component vector of float) +0:63 'c1D' ( smooth in lowp float) +0:63 'ic2D' ( flat in mediump 2-component vector of int) +0:64 move second child to first child ( temp lowp 4-component vector of float) +0:64 'v' ( temp lowp 4-component vector of float) +0:64 textureProjLodOffset ( global lowp 4-component vector of float, operation at mediump) +0:64 's2D' ( uniform lowp sampler2D) +0:64 'c3D' ( smooth in lowp 3-component vector of float) +0:64 'c1D' ( smooth in lowp float) +0:64 'ic2D' ( flat in mediump 2-component vector of int) +0:65 move second child to first child ( temp lowp 4-component vector of float) +0:65 'v' ( temp lowp 4-component vector of float) +0:65 textureGrad ( global lowp 4-component vector of float) +0:65 'sCube' ( uniform lowp samplerCube) +0:65 'c3D' ( smooth in lowp 3-component vector of float) +0:65 'c3D' ( smooth in lowp 3-component vector of float) +0:65 'c3D' ( smooth in lowp 3-component vector of float) +0:66 move second child to first child ( temp lowp float) +0:66 'f' ( temp lowp float) +0:66 textureGradOffset ( global lowp float, operation at mediump) +0:66 's2DArrayShadow' ( uniform lowp sampler2DArrayShadow) +0:66 'c4D' ( smooth temp lowp 4-component vector of float) +0:66 'c2D' ( smooth in lowp 2-component vector of float) +0:66 'c2D' ( smooth in lowp 2-component vector of float) +0:66 'ic2D' ( flat in mediump 2-component vector of int) +0:67 move second child to first child ( temp lowp 4-component vector of float) +0:67 'v' ( temp lowp 4-component vector of float) +0:67 textureProjGrad ( global lowp 4-component vector of float) +0:67 's3D' ( uniform lowp sampler3D) +0:67 'c4D' ( smooth temp lowp 4-component vector of float) +0:67 'c3D' ( smooth in lowp 3-component vector of float) +0:67 'c3D' ( smooth in lowp 3-component vector of float) +0:68 move second child to first child ( temp lowp 4-component vector of float) +0:68 'v' ( temp lowp 4-component vector of float) +0:68 textureProjGradOffset ( global lowp 4-component vector of float, operation at mediump) +0:68 's2D' ( uniform lowp sampler2D) +0:68 'c3D' ( smooth in lowp 3-component vector of float) +0:68 'c2D' ( smooth in lowp 2-component vector of float) +0:68 'c2D' ( smooth in lowp 2-component vector of float) +0:68 'ic2D' ( flat in mediump 2-component vector of int) +0:69 move second child to first child ( temp lowp 4-component vector of float) +0:69 'v' ( temp lowp 4-component vector of float) +0:69 texture ( global lowp 4-component vector of float) +0:69 indirect index ( temp lowp sampler2D) +0:69 'arrayedSampler' ( uniform 5-element array of lowp sampler2D) +0:69 'ic1D' ( flat in mediump int) +0:69 'c2D' ( smooth in lowp 2-component vector of float) +0:72 move second child to first child ( temp mediump 4-component vector of int) +0:72 'iv' ( temp mediump 4-component vector of int) +0:72 texture ( global lowp 4-component vector of int) +0:72 'is2D' ( uniform lowp isampler2D) +0:72 'c2D' ( smooth in lowp 2-component vector of float) +0:73 move second child to first child ( temp mediump 4-component vector of int) +0:73 'iv' ( temp mediump 4-component vector of int) +0:73 textureProjOffset ( global lowp 4-component vector of int, operation at mediump) +0:73 'is2D' ( uniform lowp isampler2D) +0:73 'c4D' ( smooth temp lowp 4-component vector of float) +0:73 'ic2D' ( flat in mediump 2-component vector of int) +0:74 move second child to first child ( temp mediump 4-component vector of int) +0:74 'iv' ( temp mediump 4-component vector of int) +0:74 textureProjLod ( global lowp 4-component vector of int) +0:74 'is2D' ( uniform lowp isampler2D) +0:74 'c3D' ( smooth in lowp 3-component vector of float) +0:74 'c1D' ( smooth in lowp float) +0:75 move second child to first child ( temp mediump 4-component vector of int) +0:75 'iv' ( temp mediump 4-component vector of int) +0:75 textureProjGrad ( global lowp 4-component vector of int) +0:75 'is2D' ( uniform lowp isampler2D) +0:75 'c3D' ( smooth in lowp 3-component vector of float) +0:75 'c2D' ( smooth in lowp 2-component vector of float) +0:75 'c2D' ( smooth in lowp 2-component vector of float) +0:76 move second child to first child ( temp mediump 4-component vector of int) +0:76 'iv' ( temp mediump 4-component vector of int) +0:76 texture ( global lowp 4-component vector of int) +0:76 'is3D' ( uniform lowp isampler3D) +0:76 'c3D' ( smooth in lowp 3-component vector of float) +0:76 Constant: +0:76 4.200000 +0:77 move second child to first child ( temp mediump 4-component vector of int) +0:77 'iv' ( temp mediump 4-component vector of int) +0:77 textureLod ( global lowp 4-component vector of int) +0:77 'isCube' ( uniform lowp isamplerCube) +0:77 'c3D' ( smooth in lowp 3-component vector of float) +0:77 'c1D' ( smooth in lowp float) +0:78 move second child to first child ( temp mediump 4-component vector of int) +0:78 'iv' ( temp mediump 4-component vector of int) +0:78 textureFetch ( global lowp 4-component vector of int, operation at mediump) +0:78 'is2DArray' ( uniform lowp isampler2DArray) +0:78 'ic3D' ( flat in mediump 3-component vector of int) +0:78 'ic1D' ( flat in mediump int) +0:80 move second child to first child ( temp highp 2-component vector of int) +0:80 vector swizzle ( temp mediump 2-component vector of int) +0:80 'iv' ( temp mediump 4-component vector of int) +0:80 Sequence +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 1 (const int) +0:80 textureSize ( global highp 2-component vector of int, operation at lowp) +0:80 'sCubeShadow' ( uniform lowp samplerCubeShadow) +0:80 Constant: +0:80 2 (const int) +0:88 add second child into first child ( temp highp float) +0:88 'f' ( temp lowp float) +0:88 direct index ( temp highp float) +0:88 'gl_FragCoord' ( gl_FragCoord highp 4-component vector of float FragCoord) +0:88 Constant: +0:88 1 (const int) +0:89 move second child to first child ( temp highp float) +0:89 'gl_FragDepth' ( gl_FragDepth highp float FragDepth) +0:89 'f' ( temp lowp float) +0:91 move second child to first child ( temp lowp 3-component vector of float) +0:91 'sc' ( out lowp 3-component vector of float) +0:91 c: direct index for structure ( global lowp 3-component vector of float) +0:91 's2' ( smooth in structure{ global lowp 3-component vector of float c, global lowp float f}) +0:91 Constant: +0:91 0 (const int) +0:92 move second child to first child ( temp lowp float) +0:92 'sf' ( out lowp float) +0:92 f: direct index for structure ( global lowp float) +0:92 's2' ( smooth in structure{ global lowp 3-component vector of float c, global lowp float f}) +0:92 Constant: +0:92 1 (const int) +0:94 add ( temp lowp 2-component vector of float) +0:94 hyp. sine ( global lowp float) +0:94 'c1D' ( smooth in lowp float) +0:95 vector-scale ( temp lowp 2-component vector of float) +0:95 hyp. cosine ( global lowp float) +0:95 'c1D' ( smooth in lowp float) +0:95 hyp. tangent ( global lowp 2-component vector of float) +0:95 'c2D' ( smooth in lowp 2-component vector of float) +0:96 add ( temp lowp 4-component vector of float) +0:96 arc hyp. sine ( global lowp 4-component vector of float) +0:96 'c4D' ( smooth temp lowp 4-component vector of float) +0:96 arc hyp. cosine ( global lowp 4-component vector of float) +0:96 'c4D' ( smooth temp lowp 4-component vector of float) +0:97 arc hyp. tangent ( global lowp 3-component vector of float) +0:97 'c3D' ( smooth in lowp 3-component vector of float) +0:? Linker Objects +0:? 's2D' ( uniform lowp sampler2D) +0:? 's3D' ( uniform lowp sampler3D) +0:? 'sCube' ( uniform lowp samplerCube) +0:? 'sCubeShadow' ( uniform lowp samplerCubeShadow) +0:? 's2DShadow' ( uniform lowp sampler2DShadow) +0:? 's2DArray' ( uniform lowp sampler2DArray) +0:? 's2DArrayShadow' ( uniform lowp sampler2DArrayShadow) +0:? 'is2D' ( uniform lowp isampler2D) +0:? 'is3D' ( uniform lowp isampler3D) +0:? 'isCube' ( uniform lowp isamplerCube) +0:? 'is2DArray' ( uniform lowp isampler2DArray) +0:? 'us2D' ( uniform lowp usampler2D) +0:? 'us3D' ( uniform lowp usampler3D) +0:? 'usCube' ( uniform lowp usamplerCube) +0:? 'us2DArray' ( uniform lowp usampler2DArray) +0:? 'c1D' ( smooth in lowp float) +0:? 'c2D' ( smooth in lowp 2-component vector of float) +0:? 'c3D' ( smooth in lowp 3-component vector of float) +0:? 'c4D' ( smooth temp lowp 4-component vector of float) +0:? 'ic1D' ( flat in mediump int) +0:? 'ic2D' ( flat in mediump 2-component vector of int) +0:? 'ic3D' ( flat in mediump 3-component vector of int) +0:? 'ic4D' ( flat in mediump 4-component vector of int) +0:? 'badv' ( noperspective in lowp 4-component vector of float) +0:? 'bads' ( smooth in lowp sampler2D) +0:? 'badout' ( smooth in structure{ global mediump int i, global lowp sampler2D s}) +0:? 's2' ( smooth in structure{ global lowp 3-component vector of float c, global lowp float f}) +0:? 'sc' ( out lowp 3-component vector of float) +0:? 'sf' ( out lowp float) +0:? 'arrayedSampler' ( uniform 5-element array of lowp sampler2D) +0:? 'multiInst' (layout( column_major shared) uniform 2-element array of 3-element array of block{layout( column_major shared) uniform 3-element array of 2-element array of mediump int a, layout( column_major shared) uniform 2-element array of 3-element array of mediump int b, layout( column_major shared) uniform 2-element array of 3-element array of mediump int c}) +0:? 'colors' ( out 4-element array of lowp 4-component vector of float) +0:? 'st1' ( uniform structure{ global mediump int i, global lowp sampler2D s}) +0:? 'st2' ( uniform structure{ global mediump int i, global lowp sampler2D s}) +0:? 'fooinv' ( invariant smooth in lowp 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/300.vert.out b/deps/glslang/Test/baseResults/300.vert.out new file mode 100644 index 00000000..95ebb92e --- /dev/null +++ b/deps/glslang/Test/baseResults/300.vert.out @@ -0,0 +1,505 @@ +300.vert +ERROR: 0:8: 'varying' : Reserved word. +ERROR: 0:8: 'varying' : no longer supported in es profile; removed in version 300 +ERROR: 0:9: 'vertex input arrays' : not supported with this profile: es +ERROR: 0:10: '' : precision qualifier must appear as last qualifier +ERROR: 0:11: '' : invariant qualifier must appear before interpolation, storage, and precision qualifiers +ERROR: 0:12: '' : Auxiliary qualifiers (centroid, patch, and sample) must appear before storage and precision qualifiers +ERROR: 0:12: '' : vertex input cannot be further qualified +ERROR: 0:13: '' : interpolation qualifiers must appear before storage and precision qualifiers +ERROR: 0:14: '' : in/out must appear before const +ERROR: 0:15: '' : precision qualifier must appear as last qualifier +ERROR: 0:16: '' : can only have one interpolation qualifier (flat, smooth, noperspective, __explicitInterpAMD) +ERROR: 0:17: 'sample' : Reserved word. +ERROR: 0:17: '' : can only have one auxiliary qualifier (centroid, patch, and sample) +ERROR: 0:18: 'uniform' : too many storage qualifiers +ERROR: 0:56: '#error' : GL_ES is set +ERROR: 0:62: '' : array size required +ERROR: 0:63: '' : array size required +ERROR: 0:64: '' : array size required +ERROR: 0:65: '' : array size required +ERROR: 0:67: '' : array size required +ERROR: 0:76: 'invariant' : cannot change qualification after use +ERROR: 0:78: 'invariant' : can only apply to an output +ERROR: 0:88: 'ub2' : Cannot reuse block name within the same interface: uniform +ERROR: 0:92: 'ub2' : Cannot reuse block name within the same interface: uniform +ERROR: 0:96: 'ub2' : Cannot reuse block name within the same interface: uniform +ERROR: 0:104: 'ub3' : Cannot reuse block name within the same interface: uniform +ERROR: 0:121: 'textureSize' : no matching overloaded function found +ERROR: 0:123: 'textureSize' : no matching overloaded function found +ERROR: 0:125: 'texture' : no matching overloaded function found +ERROR: 0:127: 'textureProjOffset' : no matching overloaded function found +ERROR: 0:132: 'highp' : overloaded functions must have the same parameter precision qualifiers for argument 2 +ERROR: 0:135: 'in' : overloaded functions must have the same parameter storage qualifiers for argument 2 +ERROR: 0:146: '' : array size required +ERROR: 0:147: '' : array size required +ERROR: 0:148: '' : array size required +ERROR: 0:149: 'float' : cannot apply precision statement to this type; use 'float', 'int' or a sampler type +ERROR: 0:168: 'Binst' : cannot add storage, auxiliary, memory, interpolation, layout, or precision qualifier to an existing variable +ERROR: 0:169: 'Bblock' : cannot add storage, auxiliary, memory, interpolation, layout, or precision qualifier to an existing variable +ERROR: 0:170: 'Bfoo' : cannot add storage, auxiliary, memory, interpolation, layout, or precision qualifier to an existing variable +ERROR: 0:172: 'std430' : not supported for this version or the enabled extensions +ERROR: 0:172: 'std430' : requires the 'buffer' storage qualifier +ERROR: 0:175: '' : array size required +ERROR: 0:185: 'assign' : cannot convert from ' temp 4-element array of highp float' to ' temp 3-element array of highp float' +ERROR: 0:186: 'assign' : cannot convert from ' temp 3-element array of highp float' to ' temp 4-element array of highp float' +ERROR: 0:189: 'num_views' : required extension not requested: Possible extensions include: +GL_OVR_multiview +GL_OVR_multiview2 +ERROR: 0:193: 'gl_ViewID_OVR' : required extension not requested: Possible extensions include: +GL_OVR_multiview +GL_OVR_multiview2 +ERROR: 0:198: 'num_views' : can only apply to a standalone qualifier +ERROR: 47 compilation errors. No code generated. + + +Shader version: 300 +Requested GL_OVR_multiview +ERROR: node is still EOpNull! +0:27 Function Definition: main( ( global void) +0:27 Function Parameters: +0:29 Sequence +0:29 Sequence +0:29 move second child to first child ( temp highp int) +0:29 'id' ( temp highp int) +0:29 add ( temp highp int) +0:29 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:29 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) +0:31 Sequence +0:31 move second child to first child ( temp highp int) +0:31 'c0' ( temp highp int) +0:31 Constant: +0:31 64 (const int) +0:32 Sequence +0:32 move second child to first child ( temp highp int) +0:32 'c1' ( temp highp int) +0:32 Constant: +0:32 128 (const int) +0:33 Sequence +0:33 move second child to first child ( temp highp int) +0:33 'c2' ( temp highp int) +0:33 Constant: +0:33 16 (const int) +0:34 Sequence +0:34 move second child to first child ( temp highp int) +0:34 'c3' ( temp highp int) +0:34 Constant: +0:34 15 (const int) +0:35 Sequence +0:35 move second child to first child ( temp highp int) +0:35 'c4' ( temp highp int) +0:35 Constant: +0:35 32 (const int) +0:36 Sequence +0:36 move second child to first child ( temp highp int) +0:36 'c5' ( temp highp int) +0:36 Constant: +0:36 80 (const int) +0:37 Sequence +0:37 move second child to first child ( temp highp int) +0:37 'c6' ( temp highp int) +0:37 Constant: +0:37 32 (const int) +0:38 Sequence +0:38 move second child to first child ( temp highp int) +0:38 'c7' ( temp highp int) +0:38 Constant: +0:38 16 (const int) +0:39 Sequence +0:39 move second child to first child ( temp highp int) +0:39 'c8' ( temp highp int) +0:39 Constant: +0:39 32 (const int) +0:40 Sequence +0:40 move second child to first child ( temp highp int) +0:40 'c9' ( temp highp int) +0:40 Constant: +0:40 -8 (const int) +0:41 Sequence +0:41 move second child to first child ( temp highp int) +0:41 'c10' ( temp highp int) +0:41 Constant: +0:41 7 (const int) +0:43 Sequence +0:43 move second child to first child ( temp highp 3X4 matrix of float) +0:43 'tm' ( temp highp 3X4 matrix of float) +0:43 transpose ( global highp 3X4 matrix of float) +0:43 'm43' ( uniform highp 4X3 matrix of float) +0:44 Sequence +0:44 move second child to first child ( temp highp float) +0:44 'dm' ( temp highp float) +0:44 determinant ( global highp float) +0:44 'm44' ( uniform highp 4X4 matrix of float) +0:45 Sequence +0:45 move second child to first child ( temp highp 3X3 matrix of float) +0:45 'im' ( temp highp 3X3 matrix of float) +0:45 inverse ( global highp 3X3 matrix of float) +0:45 'm33' ( uniform highp 3X3 matrix of float) +0:47 Sequence +0:47 move second child to first child ( temp highp 3X2 matrix of float) +0:47 'op' ( temp highp 3X2 matrix of float) +0:47 outer product ( global highp 3X2 matrix of float) +0:47 'v2' ( smooth out highp 2-component vector of float) +0:47 'v3' ( in highp 3-component vector of float) +0:49 move second child to first child ( temp highp 4-component vector of float) +0:49 'gl_Position' ( gl_Position highp 4-component vector of float Position) +0:49 direct index ( temp highp 4-component vector of float) +0:49 'm44' ( uniform highp 4X4 matrix of float) +0:49 Constant: +0:49 2 (const int) +0:50 move second child to first child ( temp highp float) +0:50 'gl_PointSize' ( gl_PointSize highp float PointSize) +0:50 direct index ( temp highp float) +0:50 'v2' ( smooth out highp 2-component vector of float) +0:50 Constant: +0:50 1 (const int) +0:52 move second child to first child ( temp highp 3-component vector of float) +0:52 c: direct index for structure ( global highp 3-component vector of float) +0:52 's' ( smooth out structure{ global highp 3-component vector of float c, global highp float f}) +0:52 Constant: +0:52 0 (const int) +0:52 'v3' ( in highp 3-component vector of float) +0:53 move second child to first child ( temp highp float) +0:53 f: direct index for structure ( global highp float) +0:53 's' ( smooth out structure{ global highp 3-component vector of float c, global highp float f}) +0:53 Constant: +0:53 1 (const int) +0:53 'dm' ( temp highp float) +0:68 Sequence +0:68 move second child to first child ( temp 2-element array of highp float) +0:68 'okayA' ( global 2-element array of highp float) +0:68 Constant: +0:68 3.000000 +0:68 4.000000 +0:71 Function Definition: newVFun( ( global void) +0:71 Function Parameters: +0:73 Sequence +0:73 move second child to first child ( temp highp 3-component vector of float) +0:73 'newV' ( smooth out highp 3-component vector of float) +0:73 'v3' ( in highp 3-component vector of float) +0:118 Function Definition: foo23( ( global void) +0:118 Function Parameters: +0:120 Sequence +0:120 Sequence +0:120 move second child to first child ( temp highp 2-component vector of int) +0:120 'x1' ( temp highp 2-component vector of int) +0:120 textureSize ( global highp 2-component vector of int, operation at lowp) +0:120 's2D' ( uniform lowp sampler2D) +0:120 Constant: +0:120 2 (const int) +0:121 Constant: +0:121 0.000000 +0:122 Sequence +0:122 move second child to first child ( temp highp 3-component vector of int) +0:122 'x3' ( temp highp 3-component vector of int) +0:122 textureSize ( global highp 3-component vector of int, operation at lowp) +0:122 's2DAS' ( uniform lowp sampler2DArrayShadow) +0:122 Constant: +0:122 -1 (const int) +0:123 Constant: +0:123 0.000000 +0:124 Sequence +0:124 move second child to first child ( temp highp 4-component vector of float) +0:124 'x4' ( temp highp 4-component vector of float) +0:124 texture ( global lowp 4-component vector of float, operation at highp) +0:124 's2D' ( uniform lowp sampler2D) +0:124 'c2D' ( in highp 2-component vector of float) +0:125 Constant: +0:125 0.000000 +0:126 Sequence +0:126 move second child to first child ( temp highp 4-component vector of float) +0:126 'x5' ( temp highp 4-component vector of float) +0:126 textureProjOffset ( global lowp 4-component vector of float) +0:126 's3D' ( uniform lowp sampler3D) +0:126 Constant: +0:126 0.200000 +0:126 0.200000 +0:126 0.200000 +0:126 0.200000 +0:126 Constant: +0:126 1 (const int) +0:126 1 (const int) +0:126 1 (const int) +0:127 Constant: +0:127 0.000000 +0:128 Sequence +0:128 move second child to first child ( temp highp float) +0:128 'x6' ( temp highp float) +0:128 textureProjGradOffset ( global lowp float, operation at highp) +0:128 's2DS' ( uniform lowp sampler2DShadow) +0:128 'invIn' ( invariant in highp 4-component vector of float) +0:128 Constant: +0:128 4.200000 +0:128 4.200000 +0:128 Constant: +0:128 5.300000 +0:128 5.300000 +0:128 Constant: +0:128 1 (const int) +0:128 1 (const int) +0:137 Function Definition: foo2349( ( global void) +0:137 Function Parameters: +0:139 Sequence +0:139 Sequence +0:139 move second child to first child ( temp 3-element array of highp float) +0:139 'x' ( temp 3-element array of highp float) +0:139 Constant: +0:139 1.000000 +0:139 2.000000 +0:139 3.000000 +0:140 Sequence +0:140 move second child to first child ( temp 3-element array of highp float) +0:140 'y' ( temp 3-element array of highp float) +0:140 'x' ( temp 3-element array of highp float) +0:141 Sequence +0:141 move second child to first child ( temp 3-element array of highp float) +0:141 'z' ( temp 3-element array of highp float) +0:141 'x' ( temp 3-element array of highp float) +0:143 move second child to first child ( temp 3-element array of highp float) +0:143 'w' ( temp 3-element array of highp float) +0:143 'y' ( temp 3-element array of highp float) +0:155 Function Definition: gggf(f1; ( global highp int) +0:155 Function Parameters: +0:155 'f' ( in highp float) +0:155 Sequence +0:155 Branch: Return with expression +0:155 Constant: +0:155 2 (const int) +0:158 Function Definition: agggf(f1; ( global highp int) +0:158 Function Parameters: +0:158 'f' ( in highp float) +0:158 Sequence +0:158 Branch: Return with expression +0:158 Constant: +0:158 2 (const int) +0:178 Function Definition: fooDeeparray( ( global void) +0:178 Function Parameters: +0:181 Sequence +0:181 Sequence +0:180 move second child to first child ( temp 3-element array of highp float) +0:180 'x' ( temp 3-element array of highp float) +0:180 Constant: +0:180 1.000000 +0:180 2.000000 +0:180 3.000000 +0:181 move second child to first child ( temp 4-element array of highp float) +0:181 'y' ( temp 4-element array of highp float) +0:181 Constant: +0:181 1.000000 +0:181 2.000000 +0:181 3.000000 +0:181 4.000000 +0:183 move second child to first child ( temp 3-element array of highp float) +0:183 'xp' ( temp 3-element array of highp float) +0:183 'x' ( temp 3-element array of highp float) +0:184 move second child to first child ( temp 4-element array of highp float) +0:184 'yp' ( temp 4-element array of highp float) +0:184 'y' ( temp 4-element array of highp float) +0:185 'xp' ( temp 3-element array of highp float) +0:186 'yp' ( temp 4-element array of highp float) +0:191 Function Definition: mwErr( ( global void) +0:191 Function Parameters: +0:193 Sequence +0:193 'gl_ViewID_OVR' ( in highp uint ViewIndex) +0:201 Function Definition: mwOk( ( global void) +0:201 Function Parameters: +0:203 Sequence +0:203 'gl_ViewID_OVR' ( in highp uint ViewIndex) +0:? Linker Objects +0:? 'm43' ( uniform highp 4X3 matrix of float) +0:? 'm33' ( uniform highp 3X3 matrix of float) +0:? 'm44' ( uniform highp 4X4 matrix of float) +0:? 'v3' ( in highp 3-component vector of float) +0:? 'v2' ( smooth out highp 2-component vector of float) +0:? 'bad' ( in 10-element array of highp 4-component vector of float) +0:? 'badorder' ( in highp 4-component vector of float) +0:? 'badorder2' ( invariant smooth out highp 4-component vector of float) +0:? 'badorder4' ( centroid in highp 4-component vector of float) +0:? 'badorder3' ( flat out highp 4-component vector of float) +0:? 'rep' ( smooth flat out highp 4-component vector of float) +0:? 'rep2' ( centroid smooth sample out highp 4-component vector of float) +0:? 'rep3' ( in highp 4-component vector of float) +0:? 's' ( smooth out structure{ global highp 3-component vector of float c, global highp float f}) +0:? 'badsize' ( global unsized 1-element array of highp float) +0:? 'badsize2' ( global unsized 1-element array of highp float) +0:? 'ubInst' (layout( column_major shared) uniform unsized 1-element array of block{layout( column_major shared) uniform unsized 1-element array of highp int a}) +0:? 'okayA' ( global 2-element array of highp float) +0:? 'newV' ( invariant smooth out highp 3-component vector of float) +0:? 'invIn' ( invariant in highp 4-component vector of float) +0:? 's2' ( invariant smooth out structure{ global highp 3-component vector of float c, global highp float f}) +0:? 's3' ( invariant smooth out structure{ global highp 3-component vector of float c, global highp float f}) +0:? 'a' (layout( column_major shared) uniform block{layout( column_major shared) uniform highp float f}) +0:? 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared) uniform bool b23}) +0:? 's2D' ( uniform lowp sampler2D) +0:? 's3D' ( uniform lowp sampler3D) +0:? 's2DS' ( uniform lowp sampler2DShadow) +0:? 's2DAS' ( uniform lowp sampler2DArrayShadow) +0:? 'c2D' ( in highp 2-component vector of float) +0:? 'ssss' ( smooth out structure{ global highp float f}) +0:? 'Binst' (layout( column_major shared) uniform block{layout( column_major shared) uniform highp int a}) +0:? 'Bfoo' ( global highp int) +0:? 'B430i' (layout( column_major std430) uniform block{layout( column_major std430 offset=0) uniform highp int a}) +0:? 'mwUniform' ( uniform highp float) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + + +Linked vertex stage: + + +Shader version: 300 +Requested GL_OVR_multiview +ERROR: node is still EOpNull! +0:27 Function Definition: main( ( global void) +0:27 Function Parameters: +0:29 Sequence +0:29 Sequence +0:29 move second child to first child ( temp highp int) +0:29 'id' ( temp highp int) +0:29 add ( temp highp int) +0:29 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:29 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) +0:31 Sequence +0:31 move second child to first child ( temp highp int) +0:31 'c0' ( temp highp int) +0:31 Constant: +0:31 64 (const int) +0:32 Sequence +0:32 move second child to first child ( temp highp int) +0:32 'c1' ( temp highp int) +0:32 Constant: +0:32 128 (const int) +0:33 Sequence +0:33 move second child to first child ( temp highp int) +0:33 'c2' ( temp highp int) +0:33 Constant: +0:33 16 (const int) +0:34 Sequence +0:34 move second child to first child ( temp highp int) +0:34 'c3' ( temp highp int) +0:34 Constant: +0:34 15 (const int) +0:35 Sequence +0:35 move second child to first child ( temp highp int) +0:35 'c4' ( temp highp int) +0:35 Constant: +0:35 32 (const int) +0:36 Sequence +0:36 move second child to first child ( temp highp int) +0:36 'c5' ( temp highp int) +0:36 Constant: +0:36 80 (const int) +0:37 Sequence +0:37 move second child to first child ( temp highp int) +0:37 'c6' ( temp highp int) +0:37 Constant: +0:37 32 (const int) +0:38 Sequence +0:38 move second child to first child ( temp highp int) +0:38 'c7' ( temp highp int) +0:38 Constant: +0:38 16 (const int) +0:39 Sequence +0:39 move second child to first child ( temp highp int) +0:39 'c8' ( temp highp int) +0:39 Constant: +0:39 32 (const int) +0:40 Sequence +0:40 move second child to first child ( temp highp int) +0:40 'c9' ( temp highp int) +0:40 Constant: +0:40 -8 (const int) +0:41 Sequence +0:41 move second child to first child ( temp highp int) +0:41 'c10' ( temp highp int) +0:41 Constant: +0:41 7 (const int) +0:43 Sequence +0:43 move second child to first child ( temp highp 3X4 matrix of float) +0:43 'tm' ( temp highp 3X4 matrix of float) +0:43 transpose ( global highp 3X4 matrix of float) +0:43 'm43' ( uniform highp 4X3 matrix of float) +0:44 Sequence +0:44 move second child to first child ( temp highp float) +0:44 'dm' ( temp highp float) +0:44 determinant ( global highp float) +0:44 'm44' ( uniform highp 4X4 matrix of float) +0:45 Sequence +0:45 move second child to first child ( temp highp 3X3 matrix of float) +0:45 'im' ( temp highp 3X3 matrix of float) +0:45 inverse ( global highp 3X3 matrix of float) +0:45 'm33' ( uniform highp 3X3 matrix of float) +0:47 Sequence +0:47 move second child to first child ( temp highp 3X2 matrix of float) +0:47 'op' ( temp highp 3X2 matrix of float) +0:47 outer product ( global highp 3X2 matrix of float) +0:47 'v2' ( smooth out highp 2-component vector of float) +0:47 'v3' ( in highp 3-component vector of float) +0:49 move second child to first child ( temp highp 4-component vector of float) +0:49 'gl_Position' ( gl_Position highp 4-component vector of float Position) +0:49 direct index ( temp highp 4-component vector of float) +0:49 'm44' ( uniform highp 4X4 matrix of float) +0:49 Constant: +0:49 2 (const int) +0:50 move second child to first child ( temp highp float) +0:50 'gl_PointSize' ( gl_PointSize highp float PointSize) +0:50 direct index ( temp highp float) +0:50 'v2' ( smooth out highp 2-component vector of float) +0:50 Constant: +0:50 1 (const int) +0:52 move second child to first child ( temp highp 3-component vector of float) +0:52 c: direct index for structure ( global highp 3-component vector of float) +0:52 's' ( smooth out structure{ global highp 3-component vector of float c, global highp float f}) +0:52 Constant: +0:52 0 (const int) +0:52 'v3' ( in highp 3-component vector of float) +0:53 move second child to first child ( temp highp float) +0:53 f: direct index for structure ( global highp float) +0:53 's' ( smooth out structure{ global highp 3-component vector of float c, global highp float f}) +0:53 Constant: +0:53 1 (const int) +0:53 'dm' ( temp highp float) +0:68 Sequence +0:68 move second child to first child ( temp 2-element array of highp float) +0:68 'okayA' ( global 2-element array of highp float) +0:68 Constant: +0:68 3.000000 +0:68 4.000000 +0:? Linker Objects +0:? 'm43' ( uniform highp 4X3 matrix of float) +0:? 'm33' ( uniform highp 3X3 matrix of float) +0:? 'm44' ( uniform highp 4X4 matrix of float) +0:? 'v3' ( in highp 3-component vector of float) +0:? 'v2' ( smooth out highp 2-component vector of float) +0:? 'bad' ( in 10-element array of highp 4-component vector of float) +0:? 'badorder' ( in highp 4-component vector of float) +0:? 'badorder2' ( invariant smooth out highp 4-component vector of float) +0:? 'badorder4' ( centroid in highp 4-component vector of float) +0:? 'badorder3' ( flat out highp 4-component vector of float) +0:? 'rep' ( smooth flat out highp 4-component vector of float) +0:? 'rep2' ( centroid smooth sample out highp 4-component vector of float) +0:? 'rep3' ( in highp 4-component vector of float) +0:? 's' ( smooth out structure{ global highp 3-component vector of float c, global highp float f}) +0:? 'badsize' ( global 1-element array of highp float) +0:? 'badsize2' ( global 1-element array of highp float) +0:? 'ubInst' (layout( column_major shared) uniform 1-element array of block{layout( column_major shared) uniform 1-element array of highp int a}) +0:? 'okayA' ( global 2-element array of highp float) +0:? 'newV' ( invariant smooth out highp 3-component vector of float) +0:? 'invIn' ( invariant in highp 4-component vector of float) +0:? 's2' ( invariant smooth out structure{ global highp 3-component vector of float c, global highp float f}) +0:? 's3' ( invariant smooth out structure{ global highp 3-component vector of float c, global highp float f}) +0:? 'a' (layout( column_major shared) uniform block{layout( column_major shared) uniform highp float f}) +0:? 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared) uniform bool b23}) +0:? 's2D' ( uniform lowp sampler2D) +0:? 's3D' ( uniform lowp sampler3D) +0:? 's2DS' ( uniform lowp sampler2DShadow) +0:? 's2DAS' ( uniform lowp sampler2DArrayShadow) +0:? 'c2D' ( in highp 2-component vector of float) +0:? 'ssss' ( smooth out structure{ global highp float f}) +0:? 'Binst' (layout( column_major shared) uniform block{layout( column_major shared) uniform highp int a}) +0:? 'Bfoo' ( global highp int) +0:? 'B430i' (layout( column_major std430) uniform block{layout( column_major std430 offset=0) uniform highp int a}) +0:? 'mwUniform' ( uniform highp float) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + diff --git a/deps/glslang/Test/baseResults/300BuiltIns.frag.out b/deps/glslang/Test/baseResults/300BuiltIns.frag.out new file mode 100644 index 00000000..84d4d086 --- /dev/null +++ b/deps/glslang/Test/baseResults/300BuiltIns.frag.out @@ -0,0 +1,418 @@ +300BuiltIns.frag +ERROR: 0:6: 'float' : type requires declaration of default precision qualifier +ERROR: 0:70: 'noise2' : no matching overloaded function found +ERROR: 0:72: 't__' : identifiers containing consecutive underscores ("__") are reserved, and an error if version <= 300 +ERROR: 0:75: '#define' : names containing consecutive underscores are reserved, and an error if version <= 300: __D +ERROR: 4 compilation errors. No code generated. + + +Shader version: 300 +ERROR: node is still EOpNull! +0:26 Function Definition: main( ( global void) +0:26 Function Parameters: +0:29 Sequence +0:29 Sequence +0:29 move second child to first child ( temp mediump 3-component vector of float) +0:29 'v' ( temp mediump 3-component vector of float) +0:29 mix ( global mediump 3-component vector of float) +0:29 'x' ( global mediump 3-component vector of float) +0:29 'y' ( global mediump 3-component vector of float) +0:29 'bv' ( global 3-component vector of bool) +0:30 Sequence +0:30 move second child to first child ( temp mediump 4-component vector of int) +0:30 'iv10' ( temp mediump 4-component vector of int) +0:30 Absolute value ( global mediump 4-component vector of int) +0:30 'iv4a' ( global mediump 4-component vector of int) +0:31 Sequence +0:31 move second child to first child ( temp mediump 4-component vector of int) +0:31 'iv11' ( temp mediump 4-component vector of int) +0:31 Sign ( global mediump 4-component vector of int) +0:31 'iv4a' ( global mediump 4-component vector of int) +0:32 Sequence +0:32 move second child to first child ( temp mediump 4-component vector of int) +0:32 'iv12' ( temp mediump 4-component vector of int) +0:32 min ( global mediump 4-component vector of int) +0:32 'iv4a' ( global mediump 4-component vector of int) +0:32 'iv4b' ( global mediump 4-component vector of int) +0:33 Sequence +0:33 move second child to first child ( temp mediump 4-component vector of int) +0:33 'iv13' ( temp mediump 4-component vector of int) +0:33 min ( global mediump 4-component vector of int) +0:33 'iv4a' ( global mediump 4-component vector of int) +0:33 'imin' ( global mediump int) +0:34 Sequence +0:34 move second child to first child ( temp mediump 2-component vector of uint) +0:34 'u' ( temp mediump 2-component vector of uint) +0:34 min ( global mediump 2-component vector of uint) +0:34 'uv2x' ( global mediump 2-component vector of uint) +0:34 'uv2y' ( global mediump 2-component vector of uint) +0:35 Sequence +0:35 move second child to first child ( temp mediump 4-component vector of uint) +0:35 'uv' ( temp mediump 4-component vector of uint) +0:35 min ( global mediump 4-component vector of uint) +0:35 'uv4y' ( global mediump 4-component vector of uint) +0:35 'uy' ( global mediump uint) +0:36 Sequence +0:36 move second child to first child ( temp mediump 3-component vector of int) +0:36 'iv14' ( temp mediump 3-component vector of int) +0:36 max ( global mediump 3-component vector of int) +0:36 'iv3a' ( global mediump 3-component vector of int) +0:36 'iv3b' ( global mediump 3-component vector of int) +0:37 Sequence +0:37 move second child to first child ( temp mediump 4-component vector of int) +0:37 'iv15' ( temp mediump 4-component vector of int) +0:37 max ( global mediump 4-component vector of int) +0:37 'iv4a' ( global mediump 4-component vector of int) +0:37 'imax' ( global mediump int) +0:38 Sequence +0:38 move second child to first child ( temp mediump 2-component vector of uint) +0:38 'u10' ( temp mediump 2-component vector of uint) +0:38 max ( global mediump 2-component vector of uint) +0:38 'uv2x' ( global mediump 2-component vector of uint) +0:38 'uv2y' ( global mediump 2-component vector of uint) +0:39 Sequence +0:39 move second child to first child ( temp mediump 2-component vector of uint) +0:39 'u11' ( temp mediump 2-component vector of uint) +0:39 max ( global mediump 2-component vector of uint) +0:39 'uv2x' ( global mediump 2-component vector of uint) +0:39 'uy' ( global mediump uint) +0:40 Sequence +0:40 move second child to first child ( temp mediump 4-component vector of int) +0:40 'iv16' ( temp mediump 4-component vector of int) +0:40 clamp ( global mediump 4-component vector of int) +0:40 'iv4a' ( global mediump 4-component vector of int) +0:40 'iv4a' ( global mediump 4-component vector of int) +0:40 'iv4b' ( global mediump 4-component vector of int) +0:41 Sequence +0:41 move second child to first child ( temp mediump 4-component vector of int) +0:41 'iv17' ( temp mediump 4-component vector of int) +0:41 clamp ( global mediump 4-component vector of int) +0:41 'iv4a' ( global mediump 4-component vector of int) +0:41 'imin' ( global mediump int) +0:41 'imax' ( global mediump int) +0:42 Sequence +0:42 move second child to first child ( temp mediump 2-component vector of uint) +0:42 'u12' ( temp mediump 2-component vector of uint) +0:42 clamp ( global mediump 2-component vector of uint) +0:42 'uv2x' ( global mediump 2-component vector of uint) +0:42 'uv2y' ( global mediump 2-component vector of uint) +0:42 'uv2c' ( global mediump 2-component vector of uint) +0:43 Sequence +0:43 move second child to first child ( temp mediump 4-component vector of uint) +0:43 'uv10' ( temp mediump 4-component vector of uint) +0:43 clamp ( global mediump 4-component vector of uint) +0:43 'uv4y' ( global mediump 4-component vector of uint) +0:43 'umin' ( global mediump uint) +0:43 'umax' ( global mediump uint) +0:47 Sequence +0:47 move second child to first child ( temp mediump 3-component vector of float) +0:47 'v11' ( temp mediump 3-component vector of float) +0:47 modf ( global mediump 3-component vector of float) +0:47 'x' ( global mediump 3-component vector of float) +0:47 'modfOut' ( temp mediump 3-component vector of float) +0:49 Sequence +0:49 move second child to first child ( temp mediump float) +0:49 't' ( temp mediump float) +0:49 trunc ( global mediump float) +0:49 'f' ( global mediump float) +0:50 Sequence +0:50 move second child to first child ( temp mediump 2-component vector of float) +0:50 'v12' ( temp mediump 2-component vector of float) +0:50 round ( global mediump 2-component vector of float) +0:50 'v2a' ( global mediump 2-component vector of float) +0:51 Sequence +0:51 move second child to first child ( temp mediump 2-component vector of float) +0:51 'v13' ( temp mediump 2-component vector of float) +0:51 roundEven ( global mediump 2-component vector of float) +0:51 'v2a' ( global mediump 2-component vector of float) +0:52 Sequence +0:52 move second child to first child ( temp 2-component vector of bool) +0:52 'b10' ( temp 2-component vector of bool) +0:52 isnan ( global 2-component vector of bool, operation at mediump) +0:52 'v2a' ( global mediump 2-component vector of float) +0:53 Sequence +0:53 move second child to first child ( temp 4-component vector of bool) +0:53 'b11' ( temp 4-component vector of bool) +0:53 isinf ( global 4-component vector of bool, operation at mediump) +0:53 'v4' ( global mediump 4-component vector of float) +0:56 Sequence +0:56 move second child to first child ( temp highp int) +0:56 'i' ( temp mediump int) +0:56 floatBitsToInt ( global highp int) +0:56 'f' ( global mediump float) +0:57 Sequence +0:57 move second child to first child ( temp highp 4-component vector of uint) +0:57 'uv11' ( temp mediump 4-component vector of uint) +0:57 floatBitsToUint ( global highp 4-component vector of uint) +0:57 'v4' ( global mediump 4-component vector of float) +0:58 Sequence +0:58 move second child to first child ( temp highp 4-component vector of float) +0:58 'v14' ( temp mediump 4-component vector of float) +0:58 intBitsToFloat ( global highp 4-component vector of float) +0:58 'iv4a' ( global mediump 4-component vector of int) +0:59 Sequence +0:59 move second child to first child ( temp highp 2-component vector of float) +0:59 'v15' ( temp mediump 2-component vector of float) +0:59 uintBitsToFloat ( global highp 2-component vector of float) +0:59 'uv2c' ( global mediump 2-component vector of uint) +0:62 Sequence +0:62 move second child to first child ( temp highp uint) +0:62 'u19' ( temp mediump uint) +0:62 packSnorm2x16 ( global highp uint, operation at mediump) +0:62 'v2a' ( global mediump 2-component vector of float) +0:63 Sequence +0:63 move second child to first child ( temp highp 2-component vector of float) +0:63 'v20' ( temp mediump 2-component vector of float) +0:63 unpackSnorm2x16 ( global highp 2-component vector of float) +0:63 'uy' ( global mediump uint) +0:64 Sequence +0:64 move second child to first child ( temp highp uint) +0:64 'u15' ( temp mediump uint) +0:64 packUnorm2x16 ( global highp uint, operation at mediump) +0:64 'v2a' ( global mediump 2-component vector of float) +0:65 Sequence +0:65 move second child to first child ( temp highp 2-component vector of float) +0:65 'v16' ( temp mediump 2-component vector of float) +0:65 unpackUnorm2x16 ( global highp 2-component vector of float) +0:65 'uy' ( global mediump uint) +0:66 Sequence +0:66 move second child to first child ( temp highp uint) +0:66 'u17' ( temp mediump uint) +0:66 packHalf2x16 ( global highp uint, operation at mediump) +0:66 'v2b' ( global mediump 2-component vector of float) +0:67 Sequence +0:67 move second child to first child ( temp mediump 2-component vector of float) +0:67 'v18' ( temp mediump 2-component vector of float) +0:67 unpackHalf2x16 ( global mediump 2-component vector of float, operation at highp) +0:67 'uy' ( global mediump uint) +0:70 Constant: +0:70 0.000000 +0:? Linker Objects +0:? 'imax' ( global mediump int) +0:? 'imin' ( global mediump int) +0:? 'umax' ( global mediump uint) +0:? 'umin' ( global mediump uint) +0:? 'x' ( global mediump 3-component vector of float) +0:? 'y' ( global mediump 3-component vector of float) +0:? 'bv' ( global 3-component vector of bool) +0:? 'uy' ( global mediump uint) +0:? 'uv2c' ( global mediump 2-component vector of uint) +0:? 'uv2y' ( global mediump 2-component vector of uint) +0:? 'uv2x' ( global mediump 2-component vector of uint) +0:? 'uv4y' ( global mediump 4-component vector of uint) +0:? 'iv3a' ( global mediump 3-component vector of int) +0:? 'iv3b' ( global mediump 3-component vector of int) +0:? 'iv4a' ( global mediump 4-component vector of int) +0:? 'iv4b' ( global mediump 4-component vector of int) +0:? 'f' ( global mediump float) +0:? 'v2a' ( global mediump 2-component vector of float) +0:? 'v2b' ( global mediump 2-component vector of float) +0:? 'v4' ( global mediump 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 300 +ERROR: node is still EOpNull! +0:26 Function Definition: main( ( global void) +0:26 Function Parameters: +0:29 Sequence +0:29 Sequence +0:29 move second child to first child ( temp mediump 3-component vector of float) +0:29 'v' ( temp mediump 3-component vector of float) +0:29 mix ( global mediump 3-component vector of float) +0:29 'x' ( global mediump 3-component vector of float) +0:29 'y' ( global mediump 3-component vector of float) +0:29 'bv' ( global 3-component vector of bool) +0:30 Sequence +0:30 move second child to first child ( temp mediump 4-component vector of int) +0:30 'iv10' ( temp mediump 4-component vector of int) +0:30 Absolute value ( global mediump 4-component vector of int) +0:30 'iv4a' ( global mediump 4-component vector of int) +0:31 Sequence +0:31 move second child to first child ( temp mediump 4-component vector of int) +0:31 'iv11' ( temp mediump 4-component vector of int) +0:31 Sign ( global mediump 4-component vector of int) +0:31 'iv4a' ( global mediump 4-component vector of int) +0:32 Sequence +0:32 move second child to first child ( temp mediump 4-component vector of int) +0:32 'iv12' ( temp mediump 4-component vector of int) +0:32 min ( global mediump 4-component vector of int) +0:32 'iv4a' ( global mediump 4-component vector of int) +0:32 'iv4b' ( global mediump 4-component vector of int) +0:33 Sequence +0:33 move second child to first child ( temp mediump 4-component vector of int) +0:33 'iv13' ( temp mediump 4-component vector of int) +0:33 min ( global mediump 4-component vector of int) +0:33 'iv4a' ( global mediump 4-component vector of int) +0:33 'imin' ( global mediump int) +0:34 Sequence +0:34 move second child to first child ( temp mediump 2-component vector of uint) +0:34 'u' ( temp mediump 2-component vector of uint) +0:34 min ( global mediump 2-component vector of uint) +0:34 'uv2x' ( global mediump 2-component vector of uint) +0:34 'uv2y' ( global mediump 2-component vector of uint) +0:35 Sequence +0:35 move second child to first child ( temp mediump 4-component vector of uint) +0:35 'uv' ( temp mediump 4-component vector of uint) +0:35 min ( global mediump 4-component vector of uint) +0:35 'uv4y' ( global mediump 4-component vector of uint) +0:35 'uy' ( global mediump uint) +0:36 Sequence +0:36 move second child to first child ( temp mediump 3-component vector of int) +0:36 'iv14' ( temp mediump 3-component vector of int) +0:36 max ( global mediump 3-component vector of int) +0:36 'iv3a' ( global mediump 3-component vector of int) +0:36 'iv3b' ( global mediump 3-component vector of int) +0:37 Sequence +0:37 move second child to first child ( temp mediump 4-component vector of int) +0:37 'iv15' ( temp mediump 4-component vector of int) +0:37 max ( global mediump 4-component vector of int) +0:37 'iv4a' ( global mediump 4-component vector of int) +0:37 'imax' ( global mediump int) +0:38 Sequence +0:38 move second child to first child ( temp mediump 2-component vector of uint) +0:38 'u10' ( temp mediump 2-component vector of uint) +0:38 max ( global mediump 2-component vector of uint) +0:38 'uv2x' ( global mediump 2-component vector of uint) +0:38 'uv2y' ( global mediump 2-component vector of uint) +0:39 Sequence +0:39 move second child to first child ( temp mediump 2-component vector of uint) +0:39 'u11' ( temp mediump 2-component vector of uint) +0:39 max ( global mediump 2-component vector of uint) +0:39 'uv2x' ( global mediump 2-component vector of uint) +0:39 'uy' ( global mediump uint) +0:40 Sequence +0:40 move second child to first child ( temp mediump 4-component vector of int) +0:40 'iv16' ( temp mediump 4-component vector of int) +0:40 clamp ( global mediump 4-component vector of int) +0:40 'iv4a' ( global mediump 4-component vector of int) +0:40 'iv4a' ( global mediump 4-component vector of int) +0:40 'iv4b' ( global mediump 4-component vector of int) +0:41 Sequence +0:41 move second child to first child ( temp mediump 4-component vector of int) +0:41 'iv17' ( temp mediump 4-component vector of int) +0:41 clamp ( global mediump 4-component vector of int) +0:41 'iv4a' ( global mediump 4-component vector of int) +0:41 'imin' ( global mediump int) +0:41 'imax' ( global mediump int) +0:42 Sequence +0:42 move second child to first child ( temp mediump 2-component vector of uint) +0:42 'u12' ( temp mediump 2-component vector of uint) +0:42 clamp ( global mediump 2-component vector of uint) +0:42 'uv2x' ( global mediump 2-component vector of uint) +0:42 'uv2y' ( global mediump 2-component vector of uint) +0:42 'uv2c' ( global mediump 2-component vector of uint) +0:43 Sequence +0:43 move second child to first child ( temp mediump 4-component vector of uint) +0:43 'uv10' ( temp mediump 4-component vector of uint) +0:43 clamp ( global mediump 4-component vector of uint) +0:43 'uv4y' ( global mediump 4-component vector of uint) +0:43 'umin' ( global mediump uint) +0:43 'umax' ( global mediump uint) +0:47 Sequence +0:47 move second child to first child ( temp mediump 3-component vector of float) +0:47 'v11' ( temp mediump 3-component vector of float) +0:47 modf ( global mediump 3-component vector of float) +0:47 'x' ( global mediump 3-component vector of float) +0:47 'modfOut' ( temp mediump 3-component vector of float) +0:49 Sequence +0:49 move second child to first child ( temp mediump float) +0:49 't' ( temp mediump float) +0:49 trunc ( global mediump float) +0:49 'f' ( global mediump float) +0:50 Sequence +0:50 move second child to first child ( temp mediump 2-component vector of float) +0:50 'v12' ( temp mediump 2-component vector of float) +0:50 round ( global mediump 2-component vector of float) +0:50 'v2a' ( global mediump 2-component vector of float) +0:51 Sequence +0:51 move second child to first child ( temp mediump 2-component vector of float) +0:51 'v13' ( temp mediump 2-component vector of float) +0:51 roundEven ( global mediump 2-component vector of float) +0:51 'v2a' ( global mediump 2-component vector of float) +0:52 Sequence +0:52 move second child to first child ( temp 2-component vector of bool) +0:52 'b10' ( temp 2-component vector of bool) +0:52 isnan ( global 2-component vector of bool, operation at mediump) +0:52 'v2a' ( global mediump 2-component vector of float) +0:53 Sequence +0:53 move second child to first child ( temp 4-component vector of bool) +0:53 'b11' ( temp 4-component vector of bool) +0:53 isinf ( global 4-component vector of bool, operation at mediump) +0:53 'v4' ( global mediump 4-component vector of float) +0:56 Sequence +0:56 move second child to first child ( temp highp int) +0:56 'i' ( temp mediump int) +0:56 floatBitsToInt ( global highp int) +0:56 'f' ( global mediump float) +0:57 Sequence +0:57 move second child to first child ( temp highp 4-component vector of uint) +0:57 'uv11' ( temp mediump 4-component vector of uint) +0:57 floatBitsToUint ( global highp 4-component vector of uint) +0:57 'v4' ( global mediump 4-component vector of float) +0:58 Sequence +0:58 move second child to first child ( temp highp 4-component vector of float) +0:58 'v14' ( temp mediump 4-component vector of float) +0:58 intBitsToFloat ( global highp 4-component vector of float) +0:58 'iv4a' ( global mediump 4-component vector of int) +0:59 Sequence +0:59 move second child to first child ( temp highp 2-component vector of float) +0:59 'v15' ( temp mediump 2-component vector of float) +0:59 uintBitsToFloat ( global highp 2-component vector of float) +0:59 'uv2c' ( global mediump 2-component vector of uint) +0:62 Sequence +0:62 move second child to first child ( temp highp uint) +0:62 'u19' ( temp mediump uint) +0:62 packSnorm2x16 ( global highp uint, operation at mediump) +0:62 'v2a' ( global mediump 2-component vector of float) +0:63 Sequence +0:63 move second child to first child ( temp highp 2-component vector of float) +0:63 'v20' ( temp mediump 2-component vector of float) +0:63 unpackSnorm2x16 ( global highp 2-component vector of float) +0:63 'uy' ( global mediump uint) +0:64 Sequence +0:64 move second child to first child ( temp highp uint) +0:64 'u15' ( temp mediump uint) +0:64 packUnorm2x16 ( global highp uint, operation at mediump) +0:64 'v2a' ( global mediump 2-component vector of float) +0:65 Sequence +0:65 move second child to first child ( temp highp 2-component vector of float) +0:65 'v16' ( temp mediump 2-component vector of float) +0:65 unpackUnorm2x16 ( global highp 2-component vector of float) +0:65 'uy' ( global mediump uint) +0:66 Sequence +0:66 move second child to first child ( temp highp uint) +0:66 'u17' ( temp mediump uint) +0:66 packHalf2x16 ( global highp uint, operation at mediump) +0:66 'v2b' ( global mediump 2-component vector of float) +0:67 Sequence +0:67 move second child to first child ( temp mediump 2-component vector of float) +0:67 'v18' ( temp mediump 2-component vector of float) +0:67 unpackHalf2x16 ( global mediump 2-component vector of float, operation at highp) +0:67 'uy' ( global mediump uint) +0:70 Constant: +0:70 0.000000 +0:? Linker Objects +0:? 'imax' ( global mediump int) +0:? 'imin' ( global mediump int) +0:? 'umax' ( global mediump uint) +0:? 'umin' ( global mediump uint) +0:? 'x' ( global mediump 3-component vector of float) +0:? 'y' ( global mediump 3-component vector of float) +0:? 'bv' ( global 3-component vector of bool) +0:? 'uy' ( global mediump uint) +0:? 'uv2c' ( global mediump 2-component vector of uint) +0:? 'uv2y' ( global mediump 2-component vector of uint) +0:? 'uv2x' ( global mediump 2-component vector of uint) +0:? 'uv4y' ( global mediump 4-component vector of uint) +0:? 'iv3a' ( global mediump 3-component vector of int) +0:? 'iv3b' ( global mediump 3-component vector of int) +0:? 'iv4a' ( global mediump 4-component vector of int) +0:? 'iv4b' ( global mediump 4-component vector of int) +0:? 'f' ( global mediump float) +0:? 'v2a' ( global mediump 2-component vector of float) +0:? 'v2b' ( global mediump 2-component vector of float) +0:? 'v4' ( global mediump 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/300block.frag.out b/deps/glslang/Test/baseResults/300block.frag.out new file mode 100644 index 00000000..6f7de91b --- /dev/null +++ b/deps/glslang/Test/baseResults/300block.frag.out @@ -0,0 +1,153 @@ +300block.frag +ERROR: 0:10: '' : cannot nest a structure definition inside a structure or block +ERROR: 0:21: '' : cannot nest a structure definition inside a structure or block +ERROR: 0:20: 'sampler' : member of block cannot be or contain a sampler, image, or atomic_uint type +ERROR: 0:24: 'fbs' : member of block cannot be or contain a sampler, image, or atomic_uint type +ERROR: 0:45: 'variable indexing uniform block array' : not supported for this version or the enabled extensions +ERROR: 0:46: 'fooBlock' : cannot be used (maybe an instance name is needed) +ERROR: 0:46: 'fooBlock' : undeclared identifier +ERROR: 0:47: 'constructor' : not enough data provided for construction +ERROR: 0:51: 'unreferenced' : cannot be used (maybe an instance name is needed) +ERROR: 0:51: 'unreferenced' : undeclared identifier +ERROR: 0:52: '++' : l-value required "s" (can't modify a uniform) +ERROR: 0:52: '++' : wrong operand type no operation '++' exists that takes an operand of type uniform structure{ global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, global structure{ global mediump int a} t} (or there is no acceptable conversion) +ERROR: 0:53: '-' : wrong operand types: no operation '-' exists that takes a left-hand operand of type 'layout( column_major shared) uniform block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni}' and a right operand of type ' const int' (or there is no acceptable conversion) +ERROR: 0:55: 'barBlockArray' : cannot be used (maybe an instance name is needed) +ERROR: 0:55: 'barBlockArray' : undeclared identifier +ERROR: 0:55: '*' : wrong operand types: no operation '*' exists that takes a left-hand operand of type ' const int' and a right operand of type ' temp float' (or there is no acceptable conversion) +ERROR: 0:58: 'fooBlock' : redefinition +ERROR: 17 compilation errors. No code generated. + + +Shader version: 300 +ERROR: node is still EOpNull! +0:42 Function Definition: main( ( global void) +0:42 Function Parameters: +0:44 Sequence +0:44 texture ( global lowp 4-component vector of int) +0:44 sampler: direct index for structure ( global lowp isampler3D) +0:44 's' ( uniform structure{ global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, global structure{ global mediump int a} t}) +0:44 Constant: +0:44 2 (const int) +0:44 Construct vec3 ( temp lowp 3-component vector of float) +0:44 Convert int to float ( temp lowp float) +0:44 ni: direct index for structure (layout( column_major shared) uniform mediump int) +0:44 'inst' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni}) +0:44 Constant: +0:44 1 (const int) +0:44 Convert uint to float ( temp lowp float) +0:44 direct index ( temp mediump uint) +0:44 bv: direct index for structure (layout( column_major shared) uniform mediump 4-component vector of uint) +0:44 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump 4-component vector of uint bv, layout( column_major shared) uniform mediump 2X2 matrix of float bm2, layout( column_major shared) uniform lowp isampler2D sampler, layout( column_major shared) uniform structure{ global mediump int a} t, layout( column_major shared) uniform structure{ global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, global structure{ global mediump int a} t} fbs}) +0:44 Constant: +0:44 0 (const uint) +0:44 Constant: +0:44 1 (const int) +0:44 Convert uint to float ( temp lowp float) +0:44 direct index ( temp mediump uint) +0:44 nbv: direct index for structure (layout( column_major shared) uniform mediump 4-component vector of uint) +0:44 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni}) +0:44 'insts' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni}) +0:44 Constant: +0:44 2 (const int) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:45 indirect index (layout( column_major shared) temp block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni}) +0:45 'insts' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni}) +0:45 direct index ( temp mediump uint) +0:45 v: direct index for structure ( global mediump 4-component vector of uint) +0:45 's' ( uniform structure{ global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, global structure{ global mediump int a} t}) +0:45 Constant: +0:45 1 (const int) +0:45 Constant: +0:45 0 (const int) +0:46 'fooBlock' ( temp float) +0:47 Constant: +0:47 0.000000 +0:50 Construct mat4 ( temp 4X4 matrix of float) +0:50 'barBlock' ( temp mediump float) +0:51 Construct mat4 ( temp 4X4 matrix of float) +0:51 'unreferenced' ( temp float) +0:52 's' ( uniform structure{ global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, global structure{ global mediump int a} t}) +0:53 'inst' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni}) +0:54 Pre-Increment ( temp mediump float) +0:54 'barBlock' ( temp mediump float) +0:55 Constant: +0:55 2 (const int) +0:? Linker Objects +0:? 's' ( uniform structure{ global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, global structure{ global mediump int a} t}) +0:? 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump 4-component vector of uint bv, layout( column_major shared) uniform mediump 2X2 matrix of float bm2, layout( column_major shared) uniform lowp isampler2D sampler, layout( column_major shared) uniform structure{ global mediump int a} t, layout( column_major shared) uniform structure{ global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, global structure{ global mediump int a} t} fbs}) +0:? 'inst' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni}) +0:? 'insts' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni}) +0:? 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump float f, layout( column_major shared) uniform mediump uint u}) + + +Linked fragment stage: + + +Shader version: 300 +ERROR: node is still EOpNull! +0:42 Function Definition: main( ( global void) +0:42 Function Parameters: +0:44 Sequence +0:44 texture ( global lowp 4-component vector of int) +0:44 sampler: direct index for structure ( global lowp isampler3D) +0:44 's' ( uniform structure{ global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, global structure{ global mediump int a} t}) +0:44 Constant: +0:44 2 (const int) +0:44 Construct vec3 ( temp lowp 3-component vector of float) +0:44 Convert int to float ( temp lowp float) +0:44 ni: direct index for structure (layout( column_major shared) uniform mediump int) +0:44 'inst' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni}) +0:44 Constant: +0:44 1 (const int) +0:44 Convert uint to float ( temp lowp float) +0:44 direct index ( temp mediump uint) +0:44 bv: direct index for structure (layout( column_major shared) uniform mediump 4-component vector of uint) +0:44 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump 4-component vector of uint bv, layout( column_major shared) uniform mediump 2X2 matrix of float bm2, layout( column_major shared) uniform lowp isampler2D sampler, layout( column_major shared) uniform structure{ global mediump int a} t, layout( column_major shared) uniform structure{ global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, global structure{ global mediump int a} t} fbs}) +0:44 Constant: +0:44 0 (const uint) +0:44 Constant: +0:44 1 (const int) +0:44 Convert uint to float ( temp lowp float) +0:44 direct index ( temp mediump uint) +0:44 nbv: direct index for structure (layout( column_major shared) uniform mediump 4-component vector of uint) +0:44 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni}) +0:44 'insts' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni}) +0:44 Constant: +0:44 2 (const int) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:45 indirect index (layout( column_major shared) temp block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni}) +0:45 'insts' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni}) +0:45 direct index ( temp mediump uint) +0:45 v: direct index for structure ( global mediump 4-component vector of uint) +0:45 's' ( uniform structure{ global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, global structure{ global mediump int a} t}) +0:45 Constant: +0:45 1 (const int) +0:45 Constant: +0:45 0 (const int) +0:46 'fooBlock' ( temp float) +0:47 Constant: +0:47 0.000000 +0:50 Construct mat4 ( temp 4X4 matrix of float) +0:50 'barBlock' ( temp mediump float) +0:51 Construct mat4 ( temp 4X4 matrix of float) +0:51 'unreferenced' ( temp float) +0:52 's' ( uniform structure{ global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, global structure{ global mediump int a} t}) +0:53 'inst' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni}) +0:54 Pre-Increment ( temp mediump float) +0:54 'barBlock' ( temp mediump float) +0:55 Constant: +0:55 2 (const int) +0:? Linker Objects +0:? 's' ( uniform structure{ global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, global structure{ global mediump int a} t}) +0:? 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump 4-component vector of uint bv, layout( column_major shared) uniform mediump 2X2 matrix of float bm2, layout( column_major shared) uniform lowp isampler2D sampler, layout( column_major shared) uniform structure{ global mediump int a} t, layout( column_major shared) uniform structure{ global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, global structure{ global mediump int a} t} fbs}) +0:? 'inst' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni}) +0:? 'insts' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni}) +0:? 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump float f, layout( column_major shared) uniform mediump uint u}) + diff --git a/deps/glslang/Test/baseResults/300layout.frag.out b/deps/glslang/Test/baseResults/300layout.frag.out new file mode 100644 index 00000000..3266d9b7 --- /dev/null +++ b/deps/glslang/Test/baseResults/300layout.frag.out @@ -0,0 +1,69 @@ +300layout.frag +ERROR: 0:4: 'location qualifier on input' : not supported in this stage: fragment +ERROR: 0:4: 'location qualifier on input' : not supported for this version or the enabled extensions +ERROR: 0:17: 'location' : too large for fragment output +ERROR: 0:18: 'location' : too large for fragment output +ERROR: 0:18: 'location' : overlapping use of location 41 +ERROR: 0:19: 'location' : too large for fragment output +ERROR: 0:19: 'location' : overlapping use of location 40 +ERROR: 7 compilation errors. No code generated. + + +Shader version: 300 +ERROR: node is still EOpNull! +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 move second child to first child ( temp mediump 4-component vector of float) +0:12 'c' (layout( location=1) out mediump 4-component vector of float) +0:12 'color' (layout( location=2) smooth in mediump 4-component vector of float) +0:13 move second child to first child ( temp mediump 4-component vector of float) +0:13 'p' (layout( location=3) out mediump 4-component vector of float) +0:13 'pos' ( smooth in mediump 4-component vector of float) +0:14 move second child to first child ( temp mediump 4-component vector of float) +0:14 direct index (layout( location=4) temp mediump 4-component vector of float) +0:14 'q' (layout( location=4) out 2-element array of mediump 4-component vector of float) +0:14 Constant: +0:14 1 (const int) +0:14 'pos' ( smooth in mediump 4-component vector of float) +0:? Linker Objects +0:? 'pos' ( smooth in mediump 4-component vector of float) +0:? 'color' (layout( location=2) smooth in mediump 4-component vector of float) +0:? 'c' (layout( location=1) out mediump 4-component vector of float) +0:? 'p' (layout( location=3) out mediump 4-component vector of float) +0:? 'q' (layout( location=4) out 2-element array of mediump 4-component vector of float) +0:? 'ca' (layout( location=40) out 4-element array of mediump float) +0:? 'cb' (layout( location=41) out 2-element array of mediump float) +0:? 'cc' (layout( location=39) out 6-element array of mediump float) + + +Linked fragment stage: + + +Shader version: 300 +ERROR: node is still EOpNull! +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 move second child to first child ( temp mediump 4-component vector of float) +0:12 'c' (layout( location=1) out mediump 4-component vector of float) +0:12 'color' (layout( location=2) smooth in mediump 4-component vector of float) +0:13 move second child to first child ( temp mediump 4-component vector of float) +0:13 'p' (layout( location=3) out mediump 4-component vector of float) +0:13 'pos' ( smooth in mediump 4-component vector of float) +0:14 move second child to first child ( temp mediump 4-component vector of float) +0:14 direct index (layout( location=4) temp mediump 4-component vector of float) +0:14 'q' (layout( location=4) out 2-element array of mediump 4-component vector of float) +0:14 Constant: +0:14 1 (const int) +0:14 'pos' ( smooth in mediump 4-component vector of float) +0:? Linker Objects +0:? 'pos' ( smooth in mediump 4-component vector of float) +0:? 'color' (layout( location=2) smooth in mediump 4-component vector of float) +0:? 'c' (layout( location=1) out mediump 4-component vector of float) +0:? 'p' (layout( location=3) out mediump 4-component vector of float) +0:? 'q' (layout( location=4) out 2-element array of mediump 4-component vector of float) +0:? 'ca' (layout( location=40) out 4-element array of mediump float) +0:? 'cb' (layout( location=41) out 2-element array of mediump float) +0:? 'cc' (layout( location=39) out 6-element array of mediump float) + diff --git a/deps/glslang/Test/baseResults/300layout.vert.out b/deps/glslang/Test/baseResults/300layout.vert.out new file mode 100644 index 00000000..e245cbcf --- /dev/null +++ b/deps/glslang/Test/baseResults/300layout.vert.out @@ -0,0 +1,147 @@ +300layout.vert +ERROR: 0:7: 'vertex input arrays' : not supported with this profile: es +ERROR: 0:8: 'in' : cannot be a structure or array +ERROR: 0:8: 'vertex input arrays' : not supported with this profile: es +ERROR: 0:8: 'location' : overlapping use of location 10 +ERROR: 0:12: 'layout' : cannot specify matrix layout on a variable declaration +ERROR: 0:12: 'layout' : cannot specify packing on a variable declaration +ERROR: 0:19: 'badf' : member of uniform or buffer block cannot have an auxiliary or interpolation qualifier +ERROR: 0:20: 'badg' : member storage qualifier cannot contradict block storage qualifier +ERROR: 0:21: 'bad1' : member of block cannot have a packing layout qualifier +ERROR: 0:22: 'bad2' : member of block cannot have a packing layout qualifier +ERROR: 0:23: 'bad3' : member of block cannot have a packing layout qualifier +ERROR: 0:31: 'T3' : nameless block contains a member that already has a name at global scope +ERROR: 0:38: 'vertex output block' : not supported for this version or the enabled extensions +ERROR: 0:42: 'location qualifier on output' : not supported in this stage: vertex +ERROR: 0:42: 'location qualifier on output' : not supported for this version or the enabled extensions +ERROR: 0:50: 'shared' : not supported for this version or the enabled extensions +ERROR: 0:50: 'shared' : not supported in this stage: vertex +ERROR: 0:54: 'layout' : cannot specify packing on a variable declaration +ERROR: 0:57: 'location' : overlapping use of location 40 +ERROR: 19 compilation errors. No code generated. + + +Shader version: 300 +ERROR: node is still EOpNull! +0:44 Function Definition: main( ( global void) +0:44 Function Parameters: +0:46 Sequence +0:46 move second child to first child ( temp highp 4-component vector of float) +0:46 'pos' ( smooth out highp 4-component vector of float) +0:46 vector-times-matrix ( temp highp 4-component vector of float) +0:46 'p' (layout( location=3) in highp 4-component vector of float) +0:46 add ( temp highp 4X4 matrix of float) +0:46 add ( temp highp 4X4 matrix of float) +0:46 add ( temp highp 4X4 matrix of float) +0:46 add ( temp highp 4X4 matrix of float) +0:46 M1: direct index for structure (layout( row_major std140 offset=0) uniform highp 4X4 matrix of float) +0:46 'tblock' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform highp 4X4 matrix of float M1, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float M2, layout( row_major std140 offset=128) uniform highp 3X3 matrix of float N1, layout( row_major std140 offset=176) centroid uniform highp float badf, layout( row_major std140 offset=180) uniform highp float badg, layout( row_major std140 offset=184) uniform highp float bad1, layout( row_major shared offset=188) uniform highp float bad2, layout( row_major packed offset=192) uniform highp float bad3}) +0:46 Constant: +0:46 0 (const int) +0:46 M2: direct index for structure (layout( column_major std140 offset=64) uniform highp 4X4 matrix of float) +0:46 'tblock' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform highp 4X4 matrix of float M1, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float M2, layout( row_major std140 offset=128) uniform highp 3X3 matrix of float N1, layout( row_major std140 offset=176) centroid uniform highp float badf, layout( row_major std140 offset=180) uniform highp float badg, layout( row_major std140 offset=184) uniform highp float bad1, layout( row_major shared offset=188) uniform highp float bad2, layout( row_major packed offset=192) uniform highp float bad3}) +0:46 Constant: +0:46 1 (const int) +0:46 M4: direct index for structure (layout( row_major shared) uniform highp 4X4 matrix of float) +0:46 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform highp 4X4 matrix of float M3, layout( row_major shared) uniform highp 4X4 matrix of float M4, layout( column_major shared) uniform highp 3X3 matrix of float N2, layout( column_major shared) uniform highp int b}) +0:46 Constant: +0:46 1 (const uint) +0:46 M3: direct index for structure (layout( column_major shared) uniform highp 4X4 matrix of float) +0:46 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform highp 4X4 matrix of float M3, layout( row_major shared) uniform highp 4X4 matrix of float M4, layout( column_major shared) uniform highp 3X3 matrix of float N2, layout( column_major shared) uniform highp int b}) +0:46 Constant: +0:46 0 (const uint) +0:46 t2m: direct index for structure (layout( row_major shared) uniform highp 4X4 matrix of float) +0:46 'anon@0' (layout( row_major shared) uniform block{layout( row_major shared) uniform bool b, layout( row_major shared) uniform highp 4X4 matrix of float t2m}) +0:46 Constant: +0:46 1 (const uint) +0:47 move second child to first child ( temp highp 3-component vector of float) +0:47 'color' ( smooth out highp 3-component vector of float) +0:47 vector-times-matrix ( temp highp 3-component vector of float) +0:47 'c' (layout( location=7) in highp 3-component vector of float) +0:47 N1: direct index for structure (layout( row_major std140 offset=128) uniform highp 3X3 matrix of float) +0:47 'tblock' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform highp 4X4 matrix of float M1, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float M2, layout( row_major std140 offset=128) uniform highp 3X3 matrix of float N1, layout( row_major std140 offset=176) centroid uniform highp float badf, layout( row_major std140 offset=180) uniform highp float badg, layout( row_major std140 offset=184) uniform highp float bad1, layout( row_major shared offset=188) uniform highp float bad2, layout( row_major packed offset=192) uniform highp float bad3}) +0:47 Constant: +0:47 2 (const int) +0:? Linker Objects +0:? 'c' (layout( location=7) in highp 3-component vector of float) +0:? 'p' (layout( location=3) in highp 4-component vector of float) +0:? 'q' (layout( location=9) in 4-element array of highp 4-component vector of float) +0:? 'r' (layout( location=10) in 4-element array of structure{ global highp 4-component vector of float v}) +0:? 'pos' ( smooth out highp 4-component vector of float) +0:? 'color' ( smooth out highp 3-component vector of float) +0:? 'badm4' (layout( column_major shared) uniform highp 4X4 matrix of float) +0:? 'tblock' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform highp 4X4 matrix of float M1, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float M2, layout( row_major std140 offset=128) uniform highp 3X3 matrix of float N1, layout( row_major std140 offset=176) centroid uniform highp float badf, layout( row_major std140 offset=180) uniform highp float badg, layout( row_major std140 offset=184) uniform highp float bad1, layout( row_major shared offset=188) uniform highp float bad2, layout( row_major packed offset=192) uniform highp float bad3}) +0:? 'anon@0' (layout( row_major shared) uniform block{layout( row_major shared) uniform bool b, layout( row_major shared) uniform highp 4X4 matrix of float t2m}) +0:? 'anon@2' ( out block{ out highp float f}) +0:? 'badoutA' (layout( location=10) smooth out highp 4-component vector of float) +0:? 'compute_only' ( shared highp 4-component vector of float) +0:? 'aoeuntaoeu' (layout( packed) uniform highp float) +0:? 'cd' (layout( location=40) in highp float) +0:? 'ce' (layout( location=37) in highp 4X3 matrix of float) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + + +Linked vertex stage: + + +Shader version: 300 +ERROR: node is still EOpNull! +0:44 Function Definition: main( ( global void) +0:44 Function Parameters: +0:46 Sequence +0:46 move second child to first child ( temp highp 4-component vector of float) +0:46 'pos' ( smooth out highp 4-component vector of float) +0:46 vector-times-matrix ( temp highp 4-component vector of float) +0:46 'p' (layout( location=3) in highp 4-component vector of float) +0:46 add ( temp highp 4X4 matrix of float) +0:46 add ( temp highp 4X4 matrix of float) +0:46 add ( temp highp 4X4 matrix of float) +0:46 add ( temp highp 4X4 matrix of float) +0:46 M1: direct index for structure (layout( row_major std140 offset=0) uniform highp 4X4 matrix of float) +0:46 'tblock' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform highp 4X4 matrix of float M1, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float M2, layout( row_major std140 offset=128) uniform highp 3X3 matrix of float N1, layout( row_major std140 offset=176) centroid uniform highp float badf, layout( row_major std140 offset=180) uniform highp float badg, layout( row_major std140 offset=184) uniform highp float bad1, layout( row_major shared offset=188) uniform highp float bad2, layout( row_major packed offset=192) uniform highp float bad3}) +0:46 Constant: +0:46 0 (const int) +0:46 M2: direct index for structure (layout( column_major std140 offset=64) uniform highp 4X4 matrix of float) +0:46 'tblock' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform highp 4X4 matrix of float M1, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float M2, layout( row_major std140 offset=128) uniform highp 3X3 matrix of float N1, layout( row_major std140 offset=176) centroid uniform highp float badf, layout( row_major std140 offset=180) uniform highp float badg, layout( row_major std140 offset=184) uniform highp float bad1, layout( row_major shared offset=188) uniform highp float bad2, layout( row_major packed offset=192) uniform highp float bad3}) +0:46 Constant: +0:46 1 (const int) +0:46 M4: direct index for structure (layout( row_major shared) uniform highp 4X4 matrix of float) +0:46 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform highp 4X4 matrix of float M3, layout( row_major shared) uniform highp 4X4 matrix of float M4, layout( column_major shared) uniform highp 3X3 matrix of float N2, layout( column_major shared) uniform highp int b}) +0:46 Constant: +0:46 1 (const uint) +0:46 M3: direct index for structure (layout( column_major shared) uniform highp 4X4 matrix of float) +0:46 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform highp 4X4 matrix of float M3, layout( row_major shared) uniform highp 4X4 matrix of float M4, layout( column_major shared) uniform highp 3X3 matrix of float N2, layout( column_major shared) uniform highp int b}) +0:46 Constant: +0:46 0 (const uint) +0:46 t2m: direct index for structure (layout( row_major shared) uniform highp 4X4 matrix of float) +0:46 'anon@0' (layout( row_major shared) uniform block{layout( row_major shared) uniform bool b, layout( row_major shared) uniform highp 4X4 matrix of float t2m}) +0:46 Constant: +0:46 1 (const uint) +0:47 move second child to first child ( temp highp 3-component vector of float) +0:47 'color' ( smooth out highp 3-component vector of float) +0:47 vector-times-matrix ( temp highp 3-component vector of float) +0:47 'c' (layout( location=7) in highp 3-component vector of float) +0:47 N1: direct index for structure (layout( row_major std140 offset=128) uniform highp 3X3 matrix of float) +0:47 'tblock' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform highp 4X4 matrix of float M1, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float M2, layout( row_major std140 offset=128) uniform highp 3X3 matrix of float N1, layout( row_major std140 offset=176) centroid uniform highp float badf, layout( row_major std140 offset=180) uniform highp float badg, layout( row_major std140 offset=184) uniform highp float bad1, layout( row_major shared offset=188) uniform highp float bad2, layout( row_major packed offset=192) uniform highp float bad3}) +0:47 Constant: +0:47 2 (const int) +0:? Linker Objects +0:? 'c' (layout( location=7) in highp 3-component vector of float) +0:? 'p' (layout( location=3) in highp 4-component vector of float) +0:? 'q' (layout( location=9) in 4-element array of highp 4-component vector of float) +0:? 'r' (layout( location=10) in 4-element array of structure{ global highp 4-component vector of float v}) +0:? 'pos' ( smooth out highp 4-component vector of float) +0:? 'color' ( smooth out highp 3-component vector of float) +0:? 'badm4' (layout( column_major shared) uniform highp 4X4 matrix of float) +0:? 'tblock' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform highp 4X4 matrix of float M1, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float M2, layout( row_major std140 offset=128) uniform highp 3X3 matrix of float N1, layout( row_major std140 offset=176) centroid uniform highp float badf, layout( row_major std140 offset=180) uniform highp float badg, layout( row_major std140 offset=184) uniform highp float bad1, layout( row_major shared offset=188) uniform highp float bad2, layout( row_major packed offset=192) uniform highp float bad3}) +0:? 'anon@0' (layout( row_major shared) uniform block{layout( row_major shared) uniform bool b, layout( row_major shared) uniform highp 4X4 matrix of float t2m}) +0:? 'anon@2' ( out block{ out highp float f}) +0:? 'badoutA' (layout( location=10) smooth out highp 4-component vector of float) +0:? 'compute_only' ( shared highp 4-component vector of float) +0:? 'aoeuntaoeu' (layout( packed) uniform highp float) +0:? 'cd' (layout( location=40) in highp float) +0:? 'ce' (layout( location=37) in highp 4X3 matrix of float) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + diff --git a/deps/glslang/Test/baseResults/300link.frag.out b/deps/glslang/Test/baseResults/300link.frag.out new file mode 100644 index 00000000..dc54e765 --- /dev/null +++ b/deps/glslang/Test/baseResults/300link.frag.out @@ -0,0 +1,22 @@ +300link.frag +Shader version: 300 +0:? Sequence +0:8 Function Definition: main( ( global void) +0:8 Function Parameters: +0:? Linker Objects +0:? 'color1' ( out highp 4-component vector of float) +0:? 'color2' ( out highp 4-component vector of float) + + +Linked fragment stage: + +ERROR: Linking fragment stage: when more than one fragment shader output, all must have location qualifiers + +Shader version: 300 +0:? Sequence +0:8 Function Definition: main( ( global void) +0:8 Function Parameters: +0:? Linker Objects +0:? 'color1' ( out highp 4-component vector of float) +0:? 'color2' ( out highp 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/300link2.frag.out b/deps/glslang/Test/baseResults/300link2.frag.out new file mode 100644 index 00000000..6bbb287e --- /dev/null +++ b/deps/glslang/Test/baseResults/300link2.frag.out @@ -0,0 +1,25 @@ +300link2.frag +Shader version: 300 +0:? Sequence +0:9 Function Definition: main( ( global void) +0:9 Function Parameters: +0:? Linker Objects +0:? 'pos' ( smooth in mediump 4-component vector of float) +0:? 'c' (layout( location=1) out mediump 4-component vector of float) +0:? 'p' (layout( location=5) out mediump 4-component vector of float) +0:? 'q' (layout( location=9) out 2-element array of mediump 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 300 +0:? Sequence +0:9 Function Definition: main( ( global void) +0:9 Function Parameters: +0:? Linker Objects +0:? 'pos' ( smooth in mediump 4-component vector of float) +0:? 'c' (layout( location=1) out mediump 4-component vector of float) +0:? 'p' (layout( location=5) out mediump 4-component vector of float) +0:? 'q' (layout( location=9) out 2-element array of mediump 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/300link3.frag.out b/deps/glslang/Test/baseResults/300link3.frag.out new file mode 100644 index 00000000..e6114c5f --- /dev/null +++ b/deps/glslang/Test/baseResults/300link3.frag.out @@ -0,0 +1,19 @@ +300link3.frag +Shader version: 300 +0:? Sequence +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:? Linker Objects +0:? 'color1' ( out highp 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 300 +0:? Sequence +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:? Linker Objects +0:? 'color1' ( out highp 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/300operations.frag.out b/deps/glslang/Test/baseResults/300operations.frag.out new file mode 100644 index 00000000..27772cb2 --- /dev/null +++ b/deps/glslang/Test/baseResults/300operations.frag.out @@ -0,0 +1,420 @@ +300operations.frag +ERROR: 0:11: 'float' : type requires declaration of default precision qualifier +ERROR: 0:30: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( column_major shared) uniform block{layout( column_major shared) uniform mediump float f}' and a right operand of type 'layout( column_major shared) uniform block{layout( column_major shared) uniform mediump float f}' (or there is no acceptable conversion) +ERROR: 0:31: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type ' global structure{ global mediump int i}' and a right operand of type ' global structure{ global mediump int i}' (or there is no acceptable conversion) +ERROR: 0:32: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type ' temp mediump int' and a right operand of type ' temp mediump float' (or there is no acceptable conversion) +ERROR: 0:33: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type ' temp mediump uint' and a right operand of type ' temp mediump float' (or there is no acceptable conversion) +ERROR: 0:34: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type ' temp mediump uint' and a right operand of type ' temp mediump int' (or there is no acceptable conversion) +ERROR: 0:35: 'assign' : cannot convert from ' temp mediump 4-component vector of int' to ' temp mediump 3-component vector of int' +ERROR: 0:36: '/' : wrong operand types: no operation '/' exists that takes a left-hand operand of type ' temp mediump 4-component vector of int' and a right operand of type ' temp mediump 4-component vector of uint' (or there is no acceptable conversion) +ERROR: 0:37: '-' : wrong operand types: no operation '-' exists that takes a left-hand operand of type ' temp mediump int' and a right operand of type ' temp mediump 3-component vector of float' (or there is no acceptable conversion) +ERROR: 0:38: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type ' temp mediump 3-component vector of int' and a right operand of type ' temp mediump 3-component vector of uint' (or there is no acceptable conversion) +ERROR: 0:39: '*' : wrong operand types: no operation '*' exists that takes a left-hand operand of type ' global 5-element array of mediump float' and a right operand of type ' global 5-element array of mediump float' (or there is no acceptable conversion) +ERROR: 0:40: '/' : wrong operand types: no operation '/' exists that takes a left-hand operand of type ' temp bool' and a right operand of type ' temp bool' (or there is no acceptable conversion) +ERROR: 0:42: '%' : wrong operand types: no operation '%' exists that takes a left-hand operand of type ' temp mediump float' and a right operand of type ' temp mediump float' (or there is no acceptable conversion) +ERROR: 0:43: '%' : wrong operand types: no operation '%' exists that takes a left-hand operand of type ' temp mediump int' and a right operand of type ' temp mediump float' (or there is no acceptable conversion) +ERROR: 0:44: '%' : wrong operand types: no operation '%' exists that takes a left-hand operand of type ' temp mediump float' and a right operand of type ' temp mediump uint' (or there is no acceptable conversion) +ERROR: 0:45: '++' : l-value required "instanceName" (can't modify a uniform) +ERROR: 0:45: '++' : wrong operand type no operation '++' exists that takes an operand of type layout( column_major shared) uniform block{layout( column_major shared) uniform mediump float f} (or there is no acceptable conversion) +ERROR: 0:46: '++' : wrong operand type no operation '++' exists that takes an operand of type global structure{ global mediump int i} (or there is no acceptable conversion) +ERROR: 0:47: '--' : wrong operand type no operation '--' exists that takes an operand of type global 5-element array of mediump float (or there is no acceptable conversion) +ERROR: 0:48: '++' : wrong operand type no operation '++' exists that takes an operand of type temp 3-component vector of bool (or there is no acceptable conversion) +ERROR: 0:50: '<' : wrong operand types: no operation '<' exists that takes a left-hand operand of type ' temp mediump 3-component vector of int' and a right operand of type ' temp mediump 3-component vector of uint' (or there is no acceptable conversion) +ERROR: 0:51: '>' : wrong operand types: no operation '>' exists that takes a left-hand operand of type ' temp mediump 2X2 matrix of float' and a right operand of type ' temp mediump 2X2 matrix of float' (or there is no acceptable conversion) +ERROR: 0:52: '!=' : wrong operand types: no operation '!=' exists that takes a left-hand operand of type ' temp mediump 2X2 matrix of float' and a right operand of type ' temp mediump 4X4 matrix of float' (or there is no acceptable conversion) +ERROR: 0:53: '>=' : wrong operand types: no operation '>=' exists that takes a left-hand operand of type ' temp mediump int' and a right operand of type ' temp mediump uint' (or there is no acceptable conversion) +ERROR: 0:54: '<=' : wrong operand types: no operation '<=' exists that takes a left-hand operand of type ' global 5-element array of mediump float' and a right operand of type ' global 5-element array of mediump float' (or there is no acceptable conversion) +ERROR: 0:55: '>' : wrong operand types: no operation '>' exists that takes a left-hand operand of type ' temp bool' and a right operand of type ' temp bool' (or there is no acceptable conversion) +ERROR: 0:57: '&&' : wrong operand types: no operation '&&' exists that takes a left-hand operand of type ' temp bool' and a right operand of type ' temp 3-component vector of bool' (or there is no acceptable conversion) +ERROR: 0:58: '^^' : wrong operand types: no operation '^^' exists that takes a left-hand operand of type ' temp 3-component vector of bool' and a right operand of type ' temp 3-component vector of bool' (or there is no acceptable conversion) +ERROR: 0:59: '||' : wrong operand types: no operation '||' exists that takes a left-hand operand of type ' temp 3-component vector of bool' and a right operand of type ' temp bool' (or there is no acceptable conversion) +ERROR: 0:60: '&&' : wrong operand types: no operation '&&' exists that takes a left-hand operand of type ' temp mediump int' and a right operand of type ' temp mediump int' (or there is no acceptable conversion) +ERROR: 0:61: '||' : wrong operand types: no operation '||' exists that takes a left-hand operand of type ' temp mediump uint' and a right operand of type ' temp mediump uint' (or there is no acceptable conversion) +ERROR: 0:62: '^^' : wrong operand types: no operation '^^' exists that takes a left-hand operand of type ' temp mediump 2X2 matrix of float' and a right operand of type ' temp mediump 2X2 matrix of float' (or there is no acceptable conversion) +ERROR: 0:64: '!' : wrong operand type no operation '!' exists that takes an operand of type temp mediump uint (or there is no acceptable conversion) +ERROR: 0:65: '!' : wrong operand type no operation '!' exists that takes an operand of type temp mediump int (or there is no acceptable conversion) +ERROR: 0:66: '!' : wrong operand type no operation '!' exists that takes an operand of type temp mediump 2X2 matrix of float (or there is no acceptable conversion) +ERROR: 0:67: '!' : wrong operand type no operation '!' exists that takes an operand of type temp mediump 3-component vector of float (or there is no acceptable conversion) +ERROR: 0:68: '!' : wrong operand type no operation '!' exists that takes an operand of type global 5-element array of mediump float (or there is no acceptable conversion) +ERROR: 0:70: '~' : wrong operand type no operation '~' exists that takes an operand of type temp mediump float (or there is no acceptable conversion) +ERROR: 0:71: '~' : wrong operand type no operation '~' exists that takes an operand of type temp mediump 4X4 matrix of float (or there is no acceptable conversion) +ERROR: 0:72: '~' : wrong operand type no operation '~' exists that takes an operand of type temp mediump 3-component vector of float (or there is no acceptable conversion) +ERROR: 0:73: '~' : wrong operand type no operation '~' exists that takes an operand of type global 5-element array of mediump float (or there is no acceptable conversion) +ERROR: 0:74: '~' : wrong operand type no operation '~' exists that takes an operand of type layout( column_major shared) uniform block{layout( column_major shared) uniform mediump float f} (or there is no acceptable conversion) +ERROR: 0:76: '<<' : wrong operand types: no operation '<<' exists that takes a left-hand operand of type ' temp mediump int' and a right operand of type ' temp mediump 3-component vector of int' (or there is no acceptable conversion) +ERROR: 0:77: '<<' : wrong operand types: no operation '<<' exists that takes a left-hand operand of type ' temp mediump uint' and a right operand of type ' temp mediump 3-component vector of uint' (or there is no acceptable conversion) +ERROR: 0:78: '>>' : wrong operand types: no operation '>>' exists that takes a left-hand operand of type ' temp mediump int' and a right operand of type ' temp mediump float' (or there is no acceptable conversion) +ERROR: 0:79: '>>' : wrong operand types: no operation '>>' exists that takes a left-hand operand of type ' temp mediump float' and a right operand of type ' temp mediump int' (or there is no acceptable conversion) +ERROR: 0:80: '>>' : wrong operand types: no operation '>>' exists that takes a left-hand operand of type ' temp mediump 4X4 matrix of float' and a right operand of type ' temp mediump int' (or there is no acceptable conversion) +ERROR: 0:81: '>>' : wrong operand types: no operation '>>' exists that takes a left-hand operand of type ' global 5-element array of mediump float' and a right operand of type ' temp mediump uint' (or there is no acceptable conversion) +ERROR: 0:82: '>>' : wrong operand types: no operation '>>' exists that takes a left-hand operand of type ' temp mediump 3-component vector of int' and a right operand of type ' temp mediump 4-component vector of int' (or there is no acceptable conversion) +ERROR: 0:84: '&' : wrong operand types: no operation '&' exists that takes a left-hand operand of type ' temp mediump int' and a right operand of type ' temp mediump uint' (or there is no acceptable conversion) +ERROR: 0:85: 'assign' : cannot convert from ' temp mediump 3-component vector of uint' to ' temp mediump uint' +ERROR: 0:86: '|' : wrong operand types: no operation '|' exists that takes a left-hand operand of type ' temp mediump int' and a right operand of type ' temp mediump 3-component vector of uint' (or there is no acceptable conversion) +ERROR: 0:87: '&' : wrong operand types: no operation '&' exists that takes a left-hand operand of type ' temp mediump uint' and a right operand of type ' temp mediump float' (or there is no acceptable conversion) +ERROR: 0:88: '|' : wrong operand types: no operation '|' exists that takes a left-hand operand of type ' temp mediump 2X2 matrix of float' and a right operand of type ' temp mediump 2X2 matrix of float' (or there is no acceptable conversion) +ERROR: 0:89: '^' : wrong operand types: no operation '^' exists that takes a left-hand operand of type ' global structure{ global mediump int i}' and a right operand of type ' global structure{ global mediump int i}' (or there is no acceptable conversion) +ERROR: 0:90: 'assign' : l-value required +ERROR: 56 compilation errors. No code generated. + + +Shader version: 300 +ERROR: node is still EOpNull! +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:? Sequence +0:30 'instanceName' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump float f}) +0:31 's' ( global structure{ global mediump int i}) +0:32 'i' ( temp mediump int) +0:33 'u' ( temp mediump uint) +0:34 'u' ( temp mediump uint) +0:35 'iv3' ( temp mediump 3-component vector of int) +0:36 'iv4' ( temp mediump 4-component vector of int) +0:37 'i' ( temp mediump int) +0:38 'iv3' ( temp mediump 3-component vector of int) +0:39 'a' ( global 5-element array of mediump float) +0:40 'b' ( temp bool) +0:42 'f' ( temp mediump float) +0:43 'i' ( temp mediump int) +0:44 'f' ( temp mediump float) +0:45 'instanceName' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump float f}) +0:46 's' ( global structure{ global mediump int i}) +0:47 'a' ( global 5-element array of mediump float) +0:48 'b3' ( temp 3-component vector of bool) +0:50 Constant: +0:50 false (const bool) +0:51 Constant: +0:51 false (const bool) +0:52 Constant: +0:52 false (const bool) +0:53 Constant: +0:53 false (const bool) +0:54 Constant: +0:54 false (const bool) +0:55 Constant: +0:55 false (const bool) +0:57 Constant: +0:57 false (const bool) +0:58 Constant: +0:58 false (const bool) +0:59 Constant: +0:59 false (const bool) +0:60 Constant: +0:60 false (const bool) +0:61 Constant: +0:61 false (const bool) +0:62 Constant: +0:62 false (const bool) +0:64 'u' ( temp mediump uint) +0:65 'i' ( temp mediump int) +0:66 'm2' ( temp mediump 2X2 matrix of float) +0:67 'v3' ( temp mediump 3-component vector of float) +0:68 'a' ( global 5-element array of mediump float) +0:70 'f' ( temp mediump float) +0:71 'm4' ( temp mediump 4X4 matrix of float) +0:72 'v3' ( temp mediump 3-component vector of float) +0:73 'a' ( global 5-element array of mediump float) +0:74 'instanceName' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump float f}) +0:76 'i' ( temp mediump int) +0:77 'u' ( temp mediump uint) +0:78 'i' ( temp mediump int) +0:79 'f' ( temp mediump float) +0:80 'm4' ( temp mediump 4X4 matrix of float) +0:81 'a' ( global 5-element array of mediump float) +0:82 'iv3' ( temp mediump 3-component vector of int) +0:84 'i' ( temp mediump int) +0:85 'u' ( temp mediump uint) +0:86 'i' ( temp mediump int) +0:87 'u' ( temp mediump uint) +0:88 'm2' ( temp mediump 2X2 matrix of float) +0:89 's' ( global structure{ global mediump int i}) +0:90 move second child to first child ( temp mediump float) +0:90 move second child to first child ( temp mediump float) +0:90 'f' ( temp mediump float) +0:90 'f' ( temp mediump float) +0:90 'f' ( temp mediump float) +0:93 vector-scale ( temp mediump 4-component vector of float) +0:93 'f' ( temp mediump float) +0:93 'v4' ( temp mediump 4-component vector of float) +0:94 add ( temp mediump uint) +0:94 'u' ( temp mediump uint) +0:94 'u' ( temp mediump uint) +0:95 divide ( temp mediump 4-component vector of uint) +0:95 'uv4' ( temp mediump 4-component vector of uint) +0:95 'u' ( temp mediump uint) +0:96 subtract second child into first child ( temp mediump 3-component vector of int) +0:96 'iv3' ( temp mediump 3-component vector of int) +0:96 'iv3' ( temp mediump 3-component vector of int) +0:98 mod second child into first child ( temp mediump int) +0:98 'i' ( temp mediump int) +0:98 Constant: +0:98 3 (const int) +0:99 mod ( temp mediump 3-component vector of uint) +0:99 'uv3' ( temp mediump 3-component vector of uint) +0:99 Constant: +0:99 4 (const uint) +0:100 Pre-Decrement ( temp mediump 2X2 matrix of float) +0:100 'm2' ( temp mediump 2X2 matrix of float) +0:101 Post-Increment ( temp mediump 4-component vector of int) +0:101 'iv4' ( temp mediump 4-component vector of int) +0:103 Compare Not Equal ( temp bool) +0:103 'm4' ( temp mediump 4X4 matrix of float) +0:103 'm4' ( temp mediump 4X4 matrix of float) +0:104 Compare Equal ( temp bool) +0:104 'm2' ( temp mediump 2X2 matrix of float) +0:104 'm2' ( temp mediump 2X2 matrix of float) +0:105 Compare Less Than or Equal ( temp bool) +0:105 'i' ( temp mediump int) +0:105 'i' ( temp mediump int) +0:106 Compare Equal ( temp bool) +0:106 'a' ( global 5-element array of mediump float) +0:106 'a' ( global 5-element array of mediump float) +0:107 Compare Not Equal ( temp bool) +0:107 's' ( global structure{ global mediump int i}) +0:107 's' ( global structure{ global mediump int i}) +0:109 logical-and ( temp bool) +0:109 'b' ( temp bool) +0:109 'b' ( temp bool) +0:110 logical-or ( temp bool) +0:110 'b' ( temp bool) +0:110 'b' ( temp bool) +0:111 logical-xor ( temp bool) +0:111 'b' ( temp bool) +0:111 'b' ( temp bool) +0:113 Comma ( temp mediump 3-component vector of uint) +0:113 Negate conditional ( temp bool) +0:113 'b' ( temp bool) +0:113 'uv3' ( temp mediump 3-component vector of uint) +0:115 Bitwise not ( temp mediump int) +0:115 'i' ( temp mediump int) +0:116 Bitwise not ( temp mediump uint) +0:116 'u' ( temp mediump uint) +0:117 Bitwise not ( temp mediump 3-component vector of uint) +0:117 'uv3' ( temp mediump 3-component vector of uint) +0:118 Bitwise not ( temp mediump 3-component vector of int) +0:118 'iv3' ( temp mediump 3-component vector of int) +0:120 left shift second child into first child ( temp mediump 3-component vector of uint) +0:120 'uv3' ( temp mediump 3-component vector of uint) +0:120 'i' ( temp mediump int) +0:121 right-shift ( temp mediump int) +0:121 'i' ( temp mediump int) +0:121 'i' ( temp mediump int) +0:122 left-shift ( temp mediump uint) +0:122 'u' ( temp mediump uint) +0:122 'u' ( temp mediump uint) +0:123 right-shift ( temp mediump 3-component vector of int) +0:123 'iv3' ( temp mediump 3-component vector of int) +0:123 'iv3' ( temp mediump 3-component vector of int) +0:125 bitwise and ( temp mediump int) +0:125 'i' ( temp mediump int) +0:125 'i' ( temp mediump int) +0:126 inclusive-or ( temp mediump uint) +0:126 'u' ( temp mediump uint) +0:126 'u' ( temp mediump uint) +0:127 exclusive-or ( temp mediump 3-component vector of int) +0:127 'iv3' ( temp mediump 3-component vector of int) +0:127 'iv3' ( temp mediump 3-component vector of int) +0:128 bitwise and ( temp mediump 3-component vector of uint) +0:128 'u' ( temp mediump uint) +0:128 'uv3' ( temp mediump 3-component vector of uint) +0:129 inclusive-or ( temp mediump 3-component vector of uint) +0:129 'uv3' ( temp mediump 3-component vector of uint) +0:129 'u' ( temp mediump uint) +0:130 and second child into first child ( temp mediump 3-component vector of uint) +0:130 'uv3' ( temp mediump 3-component vector of uint) +0:130 'u' ( temp mediump uint) +0:132 direct index ( temp mediump int) +0:132 'arr' ( temp 2-element array of mediump int) +0:132 Constant: +0:132 1 (const int) +0:134 direct index ( temp mediump int) +0:134 'arr2' ( temp 3-element array of mediump int) +0:134 Constant: +0:134 2 (const int) +0:? Linker Objects +0:? 'instanceName' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump float f}) +0:? 's' ( global structure{ global mediump int i}) +0:? 'a' ( global 5-element array of mediump float) + + +Linked fragment stage: + + +Shader version: 300 +ERROR: node is still EOpNull! +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:? Sequence +0:30 'instanceName' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump float f}) +0:31 's' ( global structure{ global mediump int i}) +0:32 'i' ( temp mediump int) +0:33 'u' ( temp mediump uint) +0:34 'u' ( temp mediump uint) +0:35 'iv3' ( temp mediump 3-component vector of int) +0:36 'iv4' ( temp mediump 4-component vector of int) +0:37 'i' ( temp mediump int) +0:38 'iv3' ( temp mediump 3-component vector of int) +0:39 'a' ( global 5-element array of mediump float) +0:40 'b' ( temp bool) +0:42 'f' ( temp mediump float) +0:43 'i' ( temp mediump int) +0:44 'f' ( temp mediump float) +0:45 'instanceName' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump float f}) +0:46 's' ( global structure{ global mediump int i}) +0:47 'a' ( global 5-element array of mediump float) +0:48 'b3' ( temp 3-component vector of bool) +0:50 Constant: +0:50 false (const bool) +0:51 Constant: +0:51 false (const bool) +0:52 Constant: +0:52 false (const bool) +0:53 Constant: +0:53 false (const bool) +0:54 Constant: +0:54 false (const bool) +0:55 Constant: +0:55 false (const bool) +0:57 Constant: +0:57 false (const bool) +0:58 Constant: +0:58 false (const bool) +0:59 Constant: +0:59 false (const bool) +0:60 Constant: +0:60 false (const bool) +0:61 Constant: +0:61 false (const bool) +0:62 Constant: +0:62 false (const bool) +0:64 'u' ( temp mediump uint) +0:65 'i' ( temp mediump int) +0:66 'm2' ( temp mediump 2X2 matrix of float) +0:67 'v3' ( temp mediump 3-component vector of float) +0:68 'a' ( global 5-element array of mediump float) +0:70 'f' ( temp mediump float) +0:71 'm4' ( temp mediump 4X4 matrix of float) +0:72 'v3' ( temp mediump 3-component vector of float) +0:73 'a' ( global 5-element array of mediump float) +0:74 'instanceName' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump float f}) +0:76 'i' ( temp mediump int) +0:77 'u' ( temp mediump uint) +0:78 'i' ( temp mediump int) +0:79 'f' ( temp mediump float) +0:80 'm4' ( temp mediump 4X4 matrix of float) +0:81 'a' ( global 5-element array of mediump float) +0:82 'iv3' ( temp mediump 3-component vector of int) +0:84 'i' ( temp mediump int) +0:85 'u' ( temp mediump uint) +0:86 'i' ( temp mediump int) +0:87 'u' ( temp mediump uint) +0:88 'm2' ( temp mediump 2X2 matrix of float) +0:89 's' ( global structure{ global mediump int i}) +0:90 move second child to first child ( temp mediump float) +0:90 move second child to first child ( temp mediump float) +0:90 'f' ( temp mediump float) +0:90 'f' ( temp mediump float) +0:90 'f' ( temp mediump float) +0:93 vector-scale ( temp mediump 4-component vector of float) +0:93 'f' ( temp mediump float) +0:93 'v4' ( temp mediump 4-component vector of float) +0:94 add ( temp mediump uint) +0:94 'u' ( temp mediump uint) +0:94 'u' ( temp mediump uint) +0:95 divide ( temp mediump 4-component vector of uint) +0:95 'uv4' ( temp mediump 4-component vector of uint) +0:95 'u' ( temp mediump uint) +0:96 subtract second child into first child ( temp mediump 3-component vector of int) +0:96 'iv3' ( temp mediump 3-component vector of int) +0:96 'iv3' ( temp mediump 3-component vector of int) +0:98 mod second child into first child ( temp mediump int) +0:98 'i' ( temp mediump int) +0:98 Constant: +0:98 3 (const int) +0:99 mod ( temp mediump 3-component vector of uint) +0:99 'uv3' ( temp mediump 3-component vector of uint) +0:99 Constant: +0:99 4 (const uint) +0:100 Pre-Decrement ( temp mediump 2X2 matrix of float) +0:100 'm2' ( temp mediump 2X2 matrix of float) +0:101 Post-Increment ( temp mediump 4-component vector of int) +0:101 'iv4' ( temp mediump 4-component vector of int) +0:103 Compare Not Equal ( temp bool) +0:103 'm4' ( temp mediump 4X4 matrix of float) +0:103 'm4' ( temp mediump 4X4 matrix of float) +0:104 Compare Equal ( temp bool) +0:104 'm2' ( temp mediump 2X2 matrix of float) +0:104 'm2' ( temp mediump 2X2 matrix of float) +0:105 Compare Less Than or Equal ( temp bool) +0:105 'i' ( temp mediump int) +0:105 'i' ( temp mediump int) +0:106 Compare Equal ( temp bool) +0:106 'a' ( global 5-element array of mediump float) +0:106 'a' ( global 5-element array of mediump float) +0:107 Compare Not Equal ( temp bool) +0:107 's' ( global structure{ global mediump int i}) +0:107 's' ( global structure{ global mediump int i}) +0:109 logical-and ( temp bool) +0:109 'b' ( temp bool) +0:109 'b' ( temp bool) +0:110 logical-or ( temp bool) +0:110 'b' ( temp bool) +0:110 'b' ( temp bool) +0:111 logical-xor ( temp bool) +0:111 'b' ( temp bool) +0:111 'b' ( temp bool) +0:113 Comma ( temp mediump 3-component vector of uint) +0:113 Negate conditional ( temp bool) +0:113 'b' ( temp bool) +0:113 'uv3' ( temp mediump 3-component vector of uint) +0:115 Bitwise not ( temp mediump int) +0:115 'i' ( temp mediump int) +0:116 Bitwise not ( temp mediump uint) +0:116 'u' ( temp mediump uint) +0:117 Bitwise not ( temp mediump 3-component vector of uint) +0:117 'uv3' ( temp mediump 3-component vector of uint) +0:118 Bitwise not ( temp mediump 3-component vector of int) +0:118 'iv3' ( temp mediump 3-component vector of int) +0:120 left shift second child into first child ( temp mediump 3-component vector of uint) +0:120 'uv3' ( temp mediump 3-component vector of uint) +0:120 'i' ( temp mediump int) +0:121 right-shift ( temp mediump int) +0:121 'i' ( temp mediump int) +0:121 'i' ( temp mediump int) +0:122 left-shift ( temp mediump uint) +0:122 'u' ( temp mediump uint) +0:122 'u' ( temp mediump uint) +0:123 right-shift ( temp mediump 3-component vector of int) +0:123 'iv3' ( temp mediump 3-component vector of int) +0:123 'iv3' ( temp mediump 3-component vector of int) +0:125 bitwise and ( temp mediump int) +0:125 'i' ( temp mediump int) +0:125 'i' ( temp mediump int) +0:126 inclusive-or ( temp mediump uint) +0:126 'u' ( temp mediump uint) +0:126 'u' ( temp mediump uint) +0:127 exclusive-or ( temp mediump 3-component vector of int) +0:127 'iv3' ( temp mediump 3-component vector of int) +0:127 'iv3' ( temp mediump 3-component vector of int) +0:128 bitwise and ( temp mediump 3-component vector of uint) +0:128 'u' ( temp mediump uint) +0:128 'uv3' ( temp mediump 3-component vector of uint) +0:129 inclusive-or ( temp mediump 3-component vector of uint) +0:129 'uv3' ( temp mediump 3-component vector of uint) +0:129 'u' ( temp mediump uint) +0:130 and second child into first child ( temp mediump 3-component vector of uint) +0:130 'uv3' ( temp mediump 3-component vector of uint) +0:130 'u' ( temp mediump uint) +0:132 direct index ( temp mediump int) +0:132 'arr' ( temp 2-element array of mediump int) +0:132 Constant: +0:132 1 (const int) +0:134 direct index ( temp mediump int) +0:134 'arr2' ( temp 3-element array of mediump int) +0:134 Constant: +0:134 2 (const int) +0:? Linker Objects +0:? 'instanceName' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump float f}) +0:? 's' ( global structure{ global mediump int i}) +0:? 'a' ( global 5-element array of mediump float) + diff --git a/deps/glslang/Test/baseResults/300samplerExternal.frag.out b/deps/glslang/Test/baseResults/300samplerExternal.frag.out new file mode 100644 index 00000000..9074552e --- /dev/null +++ b/deps/glslang/Test/baseResults/300samplerExternal.frag.out @@ -0,0 +1,197 @@ +300samplerExternal.frag +ERROR: 0:12: 'texture2D' : no matching overloaded function found +ERROR: 0:13: 'texture2D' : no matching overloaded function found +ERROR: 0:14: 'texture2D' : no matching overloaded function found +ERROR: 0:15: 'texture2DProj' : no matching overloaded function found +ERROR: 0:16: 'texture2DProj' : no matching overloaded function found +ERROR: 0:29: 'texture3D' : no matching overloaded function found +ERROR: 0:30: 'texture2DProjLod' : no matching overloaded function found +ERROR: 0:31: 'texture' : no matching overloaded function found +ERROR: 0:32: 'textureProjLod' : no matching overloaded function found +ERROR: 0:38: 'samplerExternalOES' : required extension not requested: GL_OES_EGL_image_external_essl3 +ERROR: 0:41: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON +ERROR: 11 compilation errors. No code generated. + + +Shader version: 300 +Requested GL_OES_EGL_image_external +Requested GL_OES_EGL_image_external_essl3 +ERROR: node is still EOpNull! +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 Constant: +0:12 0.000000 +0:13 Constant: +0:13 0.000000 +0:14 Constant: +0:14 0.000000 +0:15 Constant: +0:15 0.000000 +0:16 Constant: +0:16 0.000000 +0:18 Sequence +0:18 move second child to first child ( temp mediump int) +0:18 'lod' ( temp mediump int) +0:18 Constant: +0:18 0 (const int) +0:19 Sequence +0:19 move second child to first child ( temp highp float) +0:19 'bias' ( temp highp float) +0:19 Constant: +0:19 0.010000 +0:20 textureSize ( global highp 2-component vector of int, operation at mediump) +0:20 'sExt' ( uniform lowp samplerExternalOES) +0:20 'lod' ( temp mediump int) +0:21 texture ( global lowp 4-component vector of float) +0:21 'sExt' ( uniform lowp samplerExternalOES) +0:21 Constant: +0:21 0.200000 +0:21 0.200000 +0:22 texture ( global lowp 4-component vector of float, operation at highp) +0:22 'sExt' ( uniform lowp samplerExternalOES) +0:22 Constant: +0:22 0.200000 +0:22 0.200000 +0:22 'bias' ( temp highp float) +0:23 textureProj ( global lowp 4-component vector of float) +0:23 'sExt' ( uniform lowp samplerExternalOES) +0:23 Constant: +0:23 0.200000 +0:23 0.200000 +0:23 0.200000 +0:24 textureProj ( global lowp 4-component vector of float, operation at highp) +0:24 'sExt' ( uniform lowp samplerExternalOES) +0:24 Constant: +0:24 0.200000 +0:24 0.200000 +0:24 0.200000 +0:24 'bias' ( temp highp float) +0:25 textureProj ( global lowp 4-component vector of float) +0:25 'sExt' ( uniform lowp samplerExternalOES) +0:25 Constant: +0:25 0.200000 +0:25 0.200000 +0:25 0.200000 +0:25 0.200000 +0:26 textureProj ( global lowp 4-component vector of float, operation at highp) +0:26 'sExt' ( uniform lowp samplerExternalOES) +0:26 Constant: +0:26 0.200000 +0:26 0.200000 +0:26 0.200000 +0:26 0.200000 +0:26 'bias' ( temp highp float) +0:27 textureFetch ( global lowp 4-component vector of float, operation at mediump) +0:27 'sExt' ( uniform lowp samplerExternalOES) +0:27 Constant: +0:27 4 (const int) +0:27 4 (const int) +0:27 'lod' ( temp mediump int) +0:29 Constant: +0:29 0.000000 +0:30 Constant: +0:30 0.000000 +0:31 Constant: +0:31 0.000000 +0:32 Constant: +0:32 0.000000 +0:? Linker Objects +0:? 'sExt' ( uniform lowp samplerExternalOES) +0:? 'mediumExt' ( uniform mediump samplerExternalOES) +0:? 'highExt' ( uniform highp samplerExternalOES) +0:? 'badExt' ( uniform mediump samplerExternalOES) + + +Linked fragment stage: + + +Shader version: 300 +Requested GL_OES_EGL_image_external +Requested GL_OES_EGL_image_external_essl3 +ERROR: node is still EOpNull! +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 Constant: +0:12 0.000000 +0:13 Constant: +0:13 0.000000 +0:14 Constant: +0:14 0.000000 +0:15 Constant: +0:15 0.000000 +0:16 Constant: +0:16 0.000000 +0:18 Sequence +0:18 move second child to first child ( temp mediump int) +0:18 'lod' ( temp mediump int) +0:18 Constant: +0:18 0 (const int) +0:19 Sequence +0:19 move second child to first child ( temp highp float) +0:19 'bias' ( temp highp float) +0:19 Constant: +0:19 0.010000 +0:20 textureSize ( global highp 2-component vector of int, operation at mediump) +0:20 'sExt' ( uniform lowp samplerExternalOES) +0:20 'lod' ( temp mediump int) +0:21 texture ( global lowp 4-component vector of float) +0:21 'sExt' ( uniform lowp samplerExternalOES) +0:21 Constant: +0:21 0.200000 +0:21 0.200000 +0:22 texture ( global lowp 4-component vector of float, operation at highp) +0:22 'sExt' ( uniform lowp samplerExternalOES) +0:22 Constant: +0:22 0.200000 +0:22 0.200000 +0:22 'bias' ( temp highp float) +0:23 textureProj ( global lowp 4-component vector of float) +0:23 'sExt' ( uniform lowp samplerExternalOES) +0:23 Constant: +0:23 0.200000 +0:23 0.200000 +0:23 0.200000 +0:24 textureProj ( global lowp 4-component vector of float, operation at highp) +0:24 'sExt' ( uniform lowp samplerExternalOES) +0:24 Constant: +0:24 0.200000 +0:24 0.200000 +0:24 0.200000 +0:24 'bias' ( temp highp float) +0:25 textureProj ( global lowp 4-component vector of float) +0:25 'sExt' ( uniform lowp samplerExternalOES) +0:25 Constant: +0:25 0.200000 +0:25 0.200000 +0:25 0.200000 +0:25 0.200000 +0:26 textureProj ( global lowp 4-component vector of float, operation at highp) +0:26 'sExt' ( uniform lowp samplerExternalOES) +0:26 Constant: +0:26 0.200000 +0:26 0.200000 +0:26 0.200000 +0:26 0.200000 +0:26 'bias' ( temp highp float) +0:27 textureFetch ( global lowp 4-component vector of float, operation at mediump) +0:27 'sExt' ( uniform lowp samplerExternalOES) +0:27 Constant: +0:27 4 (const int) +0:27 4 (const int) +0:27 'lod' ( temp mediump int) +0:29 Constant: +0:29 0.000000 +0:30 Constant: +0:30 0.000000 +0:31 Constant: +0:31 0.000000 +0:32 Constant: +0:32 0.000000 +0:? Linker Objects +0:? 'sExt' ( uniform lowp samplerExternalOES) +0:? 'mediumExt' ( uniform mediump samplerExternalOES) +0:? 'highExt' ( uniform highp samplerExternalOES) +0:? 'badExt' ( uniform mediump samplerExternalOES) + diff --git a/deps/glslang/Test/baseResults/300scope.vert.out b/deps/glslang/Test/baseResults/300scope.vert.out new file mode 100644 index 00000000..5a12020e --- /dev/null +++ b/deps/glslang/Test/baseResults/300scope.vert.out @@ -0,0 +1,231 @@ +300scope.vert +ERROR: 0:5: 'a' : redefinition +ERROR: 0:17: 'b' : function name is redeclaration of existing name +ERROR: 0:20: 'c' : redefinition +ERROR: 0:22: 'f' : redefinition +ERROR: 0:23: 'tan' : redefinition +ERROR: 0:24: 'redefinition of built-in function' : not supported with this profile: es +ERROR: 0:24: 'highp' : overloaded functions must have the same parameter precision qualifiers for argument 1 +ERROR: 0:24: 'sin' : function name is redeclaration of existing name +ERROR: 0:25: 'redefinition of built-in function' : not supported with this profile: es +ERROR: 0:25: 'highp' : overloaded functions must have the same parameter precision qualifiers for argument 1 +ERROR: 0:25: 'cos' : function name is redeclaration of existing name +ERROR: 0:25: 'cos' : function already has a body +ERROR: 0:27: 'return' : void function cannot return a value +ERROR: 0:29: 'radians' : function name is redeclaration of existing name +ERROR: 0:29: 'radians' : can't find function +ERROR: 0:31: 'return' : void function cannot return a value +ERROR: 0:38: 'local function declaration' : not supported with this profile: es +ERROR: 0:43: 'sin' : can't use function syntax on variable +ERROR: 0:57: 'z' : undeclared identifier +ERROR: 0:57: 'z' : redefinition +ERROR: 0:73: 'degrees' : can't use function syntax on variable +ERROR: 21 compilation errors. No code generated. + + +Shader version: 300 +ERROR: node is still EOpNull! +0:3 Function Definition: f(i1;i1;i1; ( global highp int) +0:3 Function Parameters: +0:3 'a' ( in highp int) +0:3 'b' ( in highp int) +0:3 'c' ( in highp int) +0:? Sequence +0:8 Sequence +0:8 Sequence +0:8 move second child to first child ( temp highp float) +0:8 'a' ( temp highp float) +0:8 add ( temp highp float) +0:8 Convert int to float ( temp highp float) +0:8 'a' ( in highp int) +0:8 Constant: +0:8 1.000000 +0:11 Branch: Return with expression +0:11 'a' ( in highp int) +0:25 Function Definition: cos(f1; ( global highp float) +0:25 Function Parameters: +0:25 'x' ( in highp float) +0:27 Sequence +0:27 Branch: Return +0:29 Function Definition: radians(b1; ( global bool) +0:29 Function Parameters: +0:29 'x' ( in bool) +0:31 Sequence +0:31 Branch: Return +0:36 Function Definition: main( ( global void) +0:36 Function Parameters: +0:? Sequence +0:39 Function Call: g( ( temp highp int) +0:42 'sin' ( temp highp float) +0:43 Constant: +0:43 0.000000 +0:44 Function Call: f(i1;i1;i1; ( global highp int) +0:44 Constant: +0:44 1 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 Constant: +0:44 3 (const int) +0:47 move second child to first child ( temp highp float) +0:47 'f' ( temp highp float) +0:47 Constant: +0:47 3.000000 +0:49 move second child to first child ( temp highp 4-component vector of float) +0:49 'gl_Position' ( invariant gl_Position highp 4-component vector of float Position) +0:49 Construct vec4 ( temp highp 4-component vector of float) +0:49 'f' ( temp highp float) +0:51 Sequence +0:51 Sequence +0:51 move second child to first child ( temp highp int) +0:51 'f' ( temp highp int) +0:51 Constant: +0:51 0 (const int) +0:51 Loop with condition tested first +0:51 Loop Condition +0:51 Compare Less Than ( temp bool) +0:51 'f' ( temp highp int) +0:51 Constant: +0:51 10 (const int) +0:51 Loop Body +0:52 Pre-Increment ( temp highp int) +0:52 'f' ( temp highp int) +0:51 Loop Terminal Expression +0:51 Pre-Increment ( temp highp int) +0:51 'f' ( temp highp int) +0:54 Sequence +0:54 move second child to first child ( temp highp int) +0:54 'x' ( temp highp int) +0:54 Constant: +0:54 1 (const int) +0:56 Sequence +0:56 Sequence +0:56 move second child to first child ( temp highp float) +0:56 'x' ( temp highp float) +0:56 Constant: +0:56 2.000000 +0:56 move second child to first child ( temp highp float) +0:56 'y' ( temp highp float) +0:56 'x' ( temp highp float) +0:60 Sequence +0:60 Sequence +0:60 move second child to first child ( temp highp int) +0:60 'x' ( temp highp int) +0:60 'x' ( temp highp int) +0:68 Sequence +0:68 Sequence +0:68 move second child to first child ( temp structure{ temp highp int x}) +0:68 'S' ( temp structure{ temp highp int x}) +0:68 Constant: +0:68 0 (const int) +0:69 x: direct index for structure ( temp highp int) +0:69 'S' ( temp structure{ temp highp int x}) +0:69 Constant: +0:69 0 (const int) +0:73 Constant: +0:73 0.000000 +0:? Linker Objects +0:? 'b' ( global bool) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + + +Linked vertex stage: + +ERROR: Linking vertex stage: No function definition (body) found: + g( + +Shader version: 300 +ERROR: node is still EOpNull! +0:3 Function Definition: f(i1;i1;i1; ( global highp int) +0:3 Function Parameters: +0:3 'a' ( in highp int) +0:3 'b' ( in highp int) +0:3 'c' ( in highp int) +0:? Sequence +0:8 Sequence +0:8 Sequence +0:8 move second child to first child ( temp highp float) +0:8 'a' ( temp highp float) +0:8 add ( temp highp float) +0:8 Convert int to float ( temp highp float) +0:8 'a' ( in highp int) +0:8 Constant: +0:8 1.000000 +0:11 Branch: Return with expression +0:11 'a' ( in highp int) +0:36 Function Definition: main( ( global void) +0:36 Function Parameters: +0:? Sequence +0:39 Function Call: g( ( temp highp int) +0:42 'sin' ( temp highp float) +0:43 Constant: +0:43 0.000000 +0:44 Function Call: f(i1;i1;i1; ( global highp int) +0:44 Constant: +0:44 1 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 Constant: +0:44 3 (const int) +0:47 move second child to first child ( temp highp float) +0:47 'f' ( temp highp float) +0:47 Constant: +0:47 3.000000 +0:49 move second child to first child ( temp highp 4-component vector of float) +0:49 'gl_Position' ( invariant gl_Position highp 4-component vector of float Position) +0:49 Construct vec4 ( temp highp 4-component vector of float) +0:49 'f' ( temp highp float) +0:51 Sequence +0:51 Sequence +0:51 move second child to first child ( temp highp int) +0:51 'f' ( temp highp int) +0:51 Constant: +0:51 0 (const int) +0:51 Loop with condition tested first +0:51 Loop Condition +0:51 Compare Less Than ( temp bool) +0:51 'f' ( temp highp int) +0:51 Constant: +0:51 10 (const int) +0:51 Loop Body +0:52 Pre-Increment ( temp highp int) +0:52 'f' ( temp highp int) +0:51 Loop Terminal Expression +0:51 Pre-Increment ( temp highp int) +0:51 'f' ( temp highp int) +0:54 Sequence +0:54 move second child to first child ( temp highp int) +0:54 'x' ( temp highp int) +0:54 Constant: +0:54 1 (const int) +0:56 Sequence +0:56 Sequence +0:56 move second child to first child ( temp highp float) +0:56 'x' ( temp highp float) +0:56 Constant: +0:56 2.000000 +0:56 move second child to first child ( temp highp float) +0:56 'y' ( temp highp float) +0:56 'x' ( temp highp float) +0:60 Sequence +0:60 Sequence +0:60 move second child to first child ( temp highp int) +0:60 'x' ( temp highp int) +0:60 'x' ( temp highp int) +0:68 Sequence +0:68 Sequence +0:68 move second child to first child ( temp structure{ temp highp int x}) +0:68 'S' ( temp structure{ temp highp int x}) +0:68 Constant: +0:68 0 (const int) +0:69 x: direct index for structure ( temp highp int) +0:69 'S' ( temp structure{ temp highp int x}) +0:69 Constant: +0:69 0 (const int) +0:73 Constant: +0:73 0.000000 +0:? Linker Objects +0:? 'b' ( global bool) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + diff --git a/deps/glslang/Test/baseResults/310.comp.out b/deps/glslang/Test/baseResults/310.comp.out new file mode 100644 index 00000000..5a926f67 --- /dev/null +++ b/deps/glslang/Test/baseResults/310.comp.out @@ -0,0 +1,616 @@ +310.comp +ERROR: 0:4: 'local_size' : cannot change previously set size +ERROR: 0:5: 'local_size' : too large; see gl_MaxComputeWorkGroupSize +ERROR: 0:7: 'local_size_y' : must be at least 1 +ERROR: 0:23: '' : array size required +ERROR: 0:39: 'in' : global storage input qualifier cannot be used in a compute shader +ERROR: 0:39: 'location qualifier on input' : not supported in this stage: compute +ERROR: 0:40: 'in' : global storage input qualifier cannot be used in a compute shader +ERROR: 0:41: 'out' : global storage output qualifier cannot be used in a compute shader +ERROR: 0:44: 'shared' : cannot apply layout qualifiers to a shared variable +ERROR: 0:44: 'location' : can only apply to uniform, buffer, in, or out storage qualifiers +ERROR: 0:45: 'shared' : cannot initialize this type of qualifier +ERROR: 0:47: 'local_size' : can only apply to 'in' +ERROR: 0:47: 'local_size' : can only apply to 'in' +ERROR: 0:47: 'local_size' : can only apply to 'in' +ERROR: 0:61: 'assign' : l-value required "ro" (can't modify a readonly buffer) +ERROR: 0:66: 'buffer' : buffers can be declared only as blocks +ERROR: 0:68: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:76: 'image variables not declared 'writeonly' and without a format layout qualifier' : not supported with this profile: es +ERROR: 0:81: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:82: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:87: 'imageAtomicCompSwap' : required extension not requested: GL_OES_shader_image_atomic +ERROR: 0:88: 'imageAtomicAdd' : required extension not requested: GL_OES_shader_image_atomic +ERROR: 0:89: 'imageAtomicMin' : required extension not requested: GL_OES_shader_image_atomic +ERROR: 0:89: 'readonly' : argument cannot drop memory qualifier when passed to formal parameter +ERROR: 0:89: 'imageAtomicMin' : only supported on image with format r32i or r32ui +ERROR: 0:90: 'imageAtomicMax' : no matching overloaded function found +ERROR: 0:94: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter +ERROR: 0:97: '' : memory qualifiers cannot be used on this type +ERROR: 0:98: '' : memory qualifiers cannot be used on this type +ERROR: 0:114: 'image load-store format' : not supported with this profile: es +ERROR: 0:114: 'rg8i' : does not apply to unsigned integer images +ERROR: 0:115: 'rgba32i' : does not apply to floating point images +ERROR: 0:116: 'rgba32f' : does not apply to unsigned integer images +ERROR: 0:117: 'image load-store format' : not supported with this profile: es +ERROR: 0:117: 'r8_snorm' : does not apply to signed integer images +ERROR: 0:118: 'rgba32ui' : does not apply to signed integer images +ERROR: 0:119: 'image load-store format' : not supported with this profile: es +ERROR: 0:119: 'r8ui' : does not apply to signed integer images +ERROR: 0:128: 'atomic_uint' : samplers and atomic_uints cannot be output parameters +ERROR: 0:130: 'return' : type does not match, or is not convertible to, the function's return type +ERROR: 0:136: 'atomic_uint' : atomic_uints can only be used in uniform variables or function parameters: non_uniform_counter +ERROR: 0:141: 'atomic_uint' : atomic counters can only be highp +ERROR: 0:141: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings +ERROR: 0:143: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings +ERROR: 0:149: '[]' : scalar integer expression required +ERROR: 0:166: 'precision' : can only apply highp to atomic_uint +ERROR: 0:168: 'precise' : Reserved word. +ERROR: 0:168: 'precise' : not supported for this version or the enabled extensions +ERROR: 0:170: 'dmat2x4' : Reserved word. +ERROR: 0:170: 'double matrix' : not supported with this profile: es +ERROR: 0:171: 'samplerCubeArray' : Reserved word. +ERROR: 0:171: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:172: 'iimage2DRect' : Reserved word. +ERROR: 0:172: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:172: 'image variables not declared 'writeonly' and without a format layout qualifier' : not supported with this profile: es +ERROR: 0:173: 'image2DMS' : Reserved word. +ERROR: 0:173: 'image variables not declared 'writeonly' and without a format layout qualifier' : not supported with this profile: es +ERROR: 0:174: 'uimage2DMSArray' : Reserved word. +ERROR: 0:174: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:174: 'image variables not declared 'writeonly' and without a format layout qualifier' : not supported with this profile: es +ERROR: 0:181: 'rgba32f' : format requires readonly or writeonly memory qualifier +ERROR: 0:182: 'rgba8i' : format requires readonly or writeonly memory qualifier +ERROR: 0:183: 'rgba16ui' : format requires readonly or writeonly memory qualifier +ERROR: 0:194: 'assign' : can't read from writeonly object: wo +ERROR: 0:195: 'initializer' : can't read from writeonly object: wo +ERROR: 0:196: '++' : can't read from writeonly object: wo +ERROR: 0:197: '--' : can't read from writeonly object: wo +ERROR: 0:198: '+' : can't read from writeonly object: wo +ERROR: 0:199: '-' : can't read from writeonly object: wo +ERROR: 0:201: ':' : can't read from writeonly object: wo +ERROR: 0:202: ':' : can't read from writeonly object: wo +ERROR: 0:203: '==' : can't read from writeonly object: wo +ERROR: 0:205: '>=' : can't read from writeonly object: wo +ERROR: 0:207: 'constructor' : can't read from writeonly object: wo +ERROR: 0:208: '~' : can't read from writeonly object: wo +ERROR: 0:221: 'assign' : can't read from writeonly object: wo +ERROR: 0:222: '~' : can't read from writeonly object: wo +ERROR: 0:227: 'input block' : not supported in this stage: compute +ERROR: 0:231: 'output block' : not supported in this stage: compute +WARNING: 0:235: 't__' : identifiers containing consecutive underscores ("__") are reserved +WARNING: 0:238: '#define' : names containing consecutive underscores are reserved: __D +ERROR: 0:244: 'gl_DeviceIndex' : required extension not requested: GL_EXT_device_group +ERROR: 0:245: 'gl_ViewIndex' : undeclared identifier +ERROR: 0:255: 'gl_ViewIndex' : undeclared identifier +ERROR: 82 compilation errors. No code generated. + + +Shader version: 310 +Requested GL_EXT_device_group +local_size = (2, 1, 4096) +ERROR: node is still EOpNull! +0:27 Function Definition: main( ( global void) +0:27 Function Parameters: +0:29 Sequence +0:29 Barrier ( global void) +0:30 MemoryBarrier ( global void) +0:31 MemoryBarrierAtomicCounter ( global void) +0:32 MemoryBarrierBuffer ( global void) +0:33 MemoryBarrierShared ( global void) +0:34 MemoryBarrierImage ( global void) +0:35 GroupMemoryBarrier ( global void) +0:36 move second child to first child ( temp highp int) +0:36 value: direct index for structure (layout( column_major shared) buffer highp int) +0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer runtime-sized array of highp float values}) +0:36 Constant: +0:36 0 (const uint) +0:36 Convert float to int ( temp highp int) +0:36 indirect index (layout( column_major shared) temp highp float) +0:36 values: direct index for structure (layout( column_major shared) buffer runtime-sized array of highp float) +0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer runtime-sized array of highp float values}) +0:36 Constant: +0:36 1 (const uint) +0:36 'gl_LocalInvocationIndex' ( in highp uint LocalInvocationIndex) +0:59 Function Definition: foo( ( global void) +0:59 Function Parameters: +0:61 Sequence +0:61 move second child to first child ( temp highp float) +0:61 direct index (layout( column_major shared) temp highp float) +0:61 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:61 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:61 Constant: +0:61 1 (const int) +0:61 Constant: +0:61 2 (const int) +0:61 Constant: +0:61 4.700000 +0:62 array length ( temp int) +0:62 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:62 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:62 Constant: +0:62 1 (const int) +0:63 Pre-Increment ( temp highp 4-component vector of float) +0:63 's' ( shared highp 4-component vector of float) +0:84 Function Definition: qux( ( global void) +0:84 Function Parameters: +0:86 Sequence +0:86 Sequence +0:86 move second child to first child ( temp highp int) +0:86 'i' ( temp highp int) +0:86 Constant: +0:86 4 (const int) +0:87 imageAtomicCompSwap ( global highp int) +0:87 'iimg2D' (layout( r32i) uniform highp iimage2D) +0:87 Construct ivec2 ( temp highp 2-component vector of int) +0:87 'i' ( temp highp int) +0:87 'i' ( temp highp int) +0:87 'i' ( temp highp int) +0:87 'i' ( temp highp int) +0:88 imageAtomicAdd ( global highp uint) +0:88 'uimg2D' (layout( r32ui) uniform mediump uimage2D) +0:88 Construct ivec2 ( temp highp 2-component vector of int) +0:88 'i' ( temp highp int) +0:88 'i' ( temp highp int) +0:88 Convert int to uint ( temp highp uint) +0:88 'i' ( temp highp int) +0:89 imageAtomicMin ( global highp int) +0:89 'iimg2Drgba' (layout( rgba32i) readonly uniform highp iimage2D) +0:89 Construct ivec2 ( temp highp 2-component vector of int) +0:89 'i' ( temp highp int) +0:89 'i' ( temp highp int) +0:89 'i' ( temp highp int) +0:90 Constant: +0:90 0.000000 +0:91 Sequence +0:91 move second child to first child ( temp highp 4-component vector of int) +0:91 'pos' ( temp highp 4-component vector of int) +0:91 imageLoad ( global highp 4-component vector of int) +0:91 'iimg2D' (layout( r32i) uniform highp iimage2D) +0:91 Construct ivec2 ( temp highp 2-component vector of int) +0:91 'i' ( temp highp int) +0:91 'i' ( temp highp int) +0:92 imageStore ( global highp void) +0:92 'ii2da' ( writeonly uniform highp iimage2DArray) +0:92 Construct ivec3 ( temp 3-component vector of int) +0:92 'i' ( temp highp int) +0:92 'i' ( temp highp int) +0:92 'i' ( temp highp int) +0:92 Constant: +0:92 0 (const int) +0:92 0 (const int) +0:92 0 (const int) +0:92 0 (const int) +0:93 imageLoad ( global mediump 4-component vector of float) +0:93 'img2Drgba' (layout( rgba32f) readonly uniform mediump image2D) +0:93 Construct ivec2 ( temp mediump 2-component vector of int) +0:93 'i' ( temp highp int) +0:93 'i' ( temp highp int) +0:94 imageLoad ( global highp 4-component vector of int) +0:94 'ii2da' ( writeonly uniform highp iimage2DArray) +0:94 Construct ivec3 ( temp highp 3-component vector of int) +0:94 'i' ( temp highp int) +0:94 'i' ( temp highp int) +0:94 'i' ( temp highp int) +0:100 Function Definition: passr(iI21; ( global void) +0:100 Function Parameters: +0:100 'image' ( coherent readonly in highp iimage2D) +0:107 Function Definition: passrc( ( global void) +0:107 Function Parameters: +0:109 Sequence +0:109 Function Call: passr(iI21; ( global void) +0:109 'qualim1' (layout( r32i) coherent readonly uniform highp iimage2D) +0:110 Function Call: passr(iI21; ( global void) +0:110 'qualim2' (layout( r32i) coherent restrict readonly uniform highp iimage2D) +0:111 Function Call: passr(iI21; ( global void) +0:111 'iimg2D' (layout( r32i) uniform highp iimage2D) +0:123 Function Definition: func(au1; ( global highp uint) +0:123 Function Parameters: +0:123 'c' ( in highp atomic_uint) +0:125 Sequence +0:125 Branch: Return with expression +0:125 AtomicCounterIncrement ( global highp uint) +0:125 'c' ( in highp atomic_uint) +0:128 Function Definition: func2(au1; ( global highp uint) +0:128 Function Parameters: +0:128 'c' ( out highp atomic_uint) +0:130 Sequence +0:130 Branch: Return with expression +0:130 'counter' (layout( binding=0 offset=0) uniform highp atomic_uint) +0:131 Branch: Return with expression +0:131 AtomicCounter ( global highp uint) +0:131 'counter' (layout( binding=0 offset=0) uniform highp atomic_uint) +0:134 Function Definition: mainAC( ( global void) +0:134 Function Parameters: +0:? Sequence +0:137 Sequence +0:137 move second child to first child ( temp highp uint) +0:137 'val' ( temp highp uint) +0:137 AtomicCounter ( global highp uint) +0:137 'counter' (layout( binding=0 offset=0) uniform highp atomic_uint) +0:138 AtomicCounterDecrement ( global highp uint) +0:138 'counter' (layout( binding=0 offset=0) uniform highp atomic_uint) +0:146 Function Definition: opac( ( global void) +0:146 Function Parameters: +0:? Sequence +0:149 indirect index ( temp highp int) +0:149 'a' ( temp 3-element array of highp int) +0:149 'counter' (layout( binding=0 offset=0) uniform highp atomic_uint) +0:150 direct index (layout( binding=2 offset=4) temp highp atomic_uint) +0:150 'countArr' (layout( binding=2 offset=4) uniform 4-element array of highp atomic_uint) +0:150 Constant: +0:150 2 (const int) +0:151 indirect index (layout( binding=2 offset=4) temp highp atomic_uint) +0:151 'countArr' (layout( binding=2 offset=4) uniform 4-element array of highp atomic_uint) +0:151 'i' ( uniform highp int) +0:157 Function Definition: atoms( ( global void) +0:157 Function Parameters: +0:159 Sequence +0:159 Sequence +0:159 move second child to first child ( temp highp int) +0:159 'origi' ( temp highp int) +0:159 AtomicAdd ( global highp int) +0:159 'atomi' ( shared highp int) +0:159 Constant: +0:159 3 (const int) +0:160 Sequence +0:160 move second child to first child ( temp highp uint) +0:160 'origu' ( temp highp uint) +0:160 AtomicAnd ( global highp uint) +0:160 'atomu' ( shared highp uint) +0:160 Constant: +0:160 7 (const uint) +0:161 move second child to first child ( temp highp int) +0:161 'origi' ( temp highp int) +0:161 AtomicExchange ( global highp int) +0:161 'atomi' ( shared highp int) +0:161 Constant: +0:161 4 (const int) +0:162 move second child to first child ( temp highp uint) +0:162 'origu' ( temp highp uint) +0:162 AtomicCompSwap ( global highp uint) +0:162 'atomu' ( shared highp uint) +0:162 Constant: +0:162 10 (const uint) +0:162 Constant: +0:162 8 (const uint) +0:191 Function Definition: foowo( ( global void) +0:191 Function Parameters: +0:? Sequence +0:194 move second child to first child ( temp highp float) +0:194 'g' ( temp highp float) +0:194 direct index (layout( column_major shared) temp highp float) +0:194 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:194 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:194 Constant: +0:194 1 (const int) +0:194 Constant: +0:194 2 (const int) +0:195 Sequence +0:195 move second child to first child ( temp highp float) +0:195 'f' ( temp highp float) +0:195 direct index (layout( column_major shared) temp highp float) +0:195 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:195 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:195 Constant: +0:195 1 (const int) +0:195 Constant: +0:195 2 (const int) +0:196 Pre-Increment ( temp highp float) +0:196 direct index (layout( column_major shared) temp highp float) +0:196 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:196 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:196 Constant: +0:196 1 (const int) +0:196 Constant: +0:196 2 (const int) +0:197 Post-Decrement ( temp highp float) +0:197 direct index (layout( column_major shared) temp highp float) +0:197 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:197 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:197 Constant: +0:197 1 (const int) +0:197 Constant: +0:197 2 (const int) +0:198 add ( temp highp float) +0:198 'f' ( temp highp float) +0:198 direct index (layout( column_major shared) temp highp float) +0:198 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:198 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:198 Constant: +0:198 1 (const int) +0:198 Constant: +0:198 2 (const int) +0:199 subtract ( temp highp float) +0:199 direct index (layout( column_major shared) temp highp float) +0:199 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:199 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:199 Constant: +0:199 1 (const int) +0:199 Constant: +0:199 2 (const int) +0:199 'f' ( temp highp float) +0:201 Test condition and select ( temp highp float) +0:201 Condition +0:201 'b' ( temp bool) +0:201 true case +0:201 'f' ( temp highp float) +0:201 false case +0:201 direct index (layout( column_major shared) temp highp float) +0:201 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:201 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:201 Constant: +0:201 1 (const int) +0:201 Constant: +0:201 2 (const int) +0:202 Test condition and select ( temp highp float) +0:202 Condition +0:202 'b' ( temp bool) +0:202 true case +0:202 direct index (layout( column_major shared) temp highp float) +0:202 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:202 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:202 Constant: +0:202 1 (const int) +0:202 Constant: +0:202 2 (const int) +0:202 false case +0:202 'f' ( temp highp float) +0:203 Test condition and select ( temp void) +0:203 Condition +0:203 Compare Equal ( temp bool) +0:203 'f' ( temp highp float) +0:203 direct index (layout( column_major shared) temp highp float) +0:203 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:203 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:203 Constant: +0:203 1 (const int) +0:203 Constant: +0:203 2 (const int) +0:203 true case +0:204 Pre-Increment ( temp highp float) +0:204 'f' ( temp highp float) +0:205 Test condition and select ( temp void) +0:205 Condition +0:205 Compare Greater Than or Equal ( temp bool) +0:205 'f' ( temp highp float) +0:205 direct index (layout( column_major shared) temp highp float) +0:205 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:205 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:205 Constant: +0:205 1 (const int) +0:205 Constant: +0:205 2 (const int) +0:205 true case +0:206 Pre-Increment ( temp highp float) +0:206 'f' ( temp highp float) +0:207 move second child to first child ( temp highp float) +0:207 'f' ( temp highp float) +0:207 direct index ( temp highp float) +0:207 Construct vec3 ( temp highp 3-component vector of float) +0:207 direct index (layout( column_major shared) temp highp float) +0:207 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:207 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:207 Constant: +0:207 1 (const int) +0:207 Constant: +0:207 2 (const int) +0:207 Constant: +0:207 0 (const int) +0:208 Bitwise not ( temp highp int) +0:208 value: direct index for structure (layout( column_major shared) buffer highp int) +0:208 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:208 Constant: +0:208 0 (const int) +0:209 move second child to first child ( temp highp float) +0:209 direct index (layout( column_major shared) temp highp float) +0:209 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:209 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:209 Constant: +0:209 1 (const int) +0:209 Constant: +0:209 2 (const int) +0:209 Constant: +0:209 3.400000 +0:218 Function Definition: foomultio( ( global void) +0:218 Function Parameters: +0:? Sequence +0:221 move second child to first child ( temp highp float) +0:221 'g' ( temp highp float) +0:221 direct index (layout( column_major shared) temp highp float) +0:221 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:221 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:221 Constant: +0:221 1 (const int) +0:221 Constant: +0:221 2 (const int) +0:222 Bitwise not ( temp highp int) +0:222 value: direct index for structure (layout( column_major shared) buffer highp int) +0:222 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:222 Constant: +0:222 0 (const int) +0:223 move second child to first child ( temp highp float) +0:223 direct index (layout( column_major shared) temp highp float) +0:223 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float) +0:223 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:223 Constant: +0:223 1 (const int) +0:223 Constant: +0:223 2 (const int) +0:223 Constant: +0:223 3.400000 +0:224 move second child to first child ( temp highp int) +0:224 value: direct index for structure (layout( column_major shared) buffer highp int) +0:224 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:224 Constant: +0:224 0 (const int) +0:224 Constant: +0:224 2 (const int) +0:242 Function Definition: devi( ( global void) +0:242 Function Parameters: +0:244 Sequence +0:244 'gl_DeviceIndex' ( in highp int DeviceIndex) +0:245 'gl_ViewIndex' ( temp float) +0:252 Function Definition: devie( ( global void) +0:252 Function Parameters: +0:254 Sequence +0:254 'gl_DeviceIndex' ( in highp int DeviceIndex) +0:255 'gl_ViewIndex' ( temp float) +0:? Linker Objects +0:? 'gl_WorkGroupSize' ( const highp 3-component vector of uint WorkGroupSize) +0:? 2 (const uint) +0:? 1 (const uint) +0:? 4096 (const uint) +0:? 'total' ( const highp int) +0:? 66592 (const int) +0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer runtime-sized array of highp float values}) +0:? 'invalid' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 1-element array of highp float values, layout( column_major shared) buffer highp int value}) +0:? 'v3' (layout( location=2) in highp 3-component vector of float) +0:? 'f' ( in highp float) +0:? 'fo' ( out highp float) +0:? 's' ( shared highp 4-component vector of float) +0:? 'sl' (layout( location=2) shared highp 4-component vector of float) +0:? 'fs' ( shared highp float) +0:? 'arrX' ( global 2-element array of highp int) +0:? 'arrY' ( global 1-element array of highp int) +0:? 'arrZ' ( global 4096-element array of highp int) +0:? 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:? 'v' ( buffer highp 4-component vector of float) +0:? 'us2dbad' ( uniform mediump usampler2D) +0:? 'us2d' ( uniform highp usampler2D) +0:? 'ii2dabad' ( uniform highp iimage2DArray) +0:? 'ii2da' ( writeonly uniform highp iimage2DArray) +0:? 'iimg2D' (layout( r32i) uniform highp iimage2D) +0:? 'iimg2Drgba' (layout( rgba32i) readonly uniform highp iimage2D) +0:? 'img2Drgba' (layout( rgba32f) readonly uniform mediump image2D) +0:? 'uimg2D' (layout( r32ui) uniform mediump uimage2D) +0:? 'vol' ( volatile temp highp float) +0:? 'vol2' ( readonly temp highp int) +0:? 'qualim1' (layout( r32i) coherent readonly uniform highp iimage2D) +0:? 'qualim2' (layout( r32i) coherent restrict readonly uniform highp iimage2D) +0:? 'i1bad' (layout( rg8i) readonly uniform highp uimage2D) +0:? 'i2bad' (layout( rgba32i) readonly uniform highp image2D) +0:? 'i3bad' (layout( rgba32f) readonly uniform highp uimage2D) +0:? 'i4bad' (layout( r8_snorm) readonly uniform highp iimage2D) +0:? 'i5bad' (layout( rgba32ui) readonly uniform highp iimage2D) +0:? 'i6bad' (layout( r8ui) readonly uniform highp iimage2D) +0:? 'counter' (layout( binding=0 offset=0) uniform highp atomic_uint) +0:? 'counterBad' (layout( binding=1) uniform mediump atomic_uint) +0:? 'countArr' (layout( binding=2 offset=4) uniform 4-element array of highp atomic_uint) +0:? 'i' ( uniform highp int) +0:? 'atomi' ( shared highp int) +0:? 'atomu' ( shared highp uint) +0:? 'pfoo' ( noContraction temp highp int) +0:? 'dm' ( global 2X4 matrix of double) +0:? 'sca' ( uniform mediump samplerCubeArray) +0:? 'i2dr' ( uniform mediump iimage2DRect) +0:? 'i2dms' ( uniform highp image2DMS) +0:? 'u2dmsa' ( uniform mediump uimage2DMSArray) +0:? 'okay1' (layout( r32f) coherent volatile restrict readonly writeonly uniform highp image2D) +0:? 'okay2' (layout( r32i) coherent volatile restrict readonly uniform highp iimage2D) +0:? 'okay3' (layout( r32ui) coherent volatile restrict writeonly uniform highp uimage2D) +0:? 'okay4' (layout( r32f) coherent volatile restrict uniform highp image2D) +0:? 'badQ1' (layout( rgba32f) coherent volatile restrict uniform highp image2D) +0:? 'badQ2' (layout( rgba8i) coherent volatile restrict uniform highp iimage2D) +0:? 'badQ3' (layout( rgba16ui) coherent volatile restrict uniform highp uimage2D) +0:? 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:? 'multio' (layout( column_major shared) buffer block{layout( column_major shared) readonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 1-element array of highp float values}) +0:? 'inbi' ( in block{ in highp int a}) +0:? 'outbi' ( out block{ out highp int a}) +0:? 't__' ( global highp float) +0:? 'arr' ( shared 2-element array of 3-element array of 4-element array of highp 4-component vector of float) + + +Linked compute stage: + + +Shader version: 310 +Requested GL_EXT_device_group +local_size = (2, 1, 4096) +ERROR: node is still EOpNull! +0:27 Function Definition: main( ( global void) +0:27 Function Parameters: +0:29 Sequence +0:29 Barrier ( global void) +0:30 MemoryBarrier ( global void) +0:31 MemoryBarrierAtomicCounter ( global void) +0:32 MemoryBarrierBuffer ( global void) +0:33 MemoryBarrierShared ( global void) +0:34 MemoryBarrierImage ( global void) +0:35 GroupMemoryBarrier ( global void) +0:36 move second child to first child ( temp highp int) +0:36 value: direct index for structure (layout( column_major shared) buffer highp int) +0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer runtime-sized array of highp float values}) +0:36 Constant: +0:36 0 (const uint) +0:36 Convert float to int ( temp highp int) +0:36 indirect index (layout( column_major shared) temp highp float) +0:36 values: direct index for structure (layout( column_major shared) buffer runtime-sized array of highp float) +0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer runtime-sized array of highp float values}) +0:36 Constant: +0:36 1 (const uint) +0:36 'gl_LocalInvocationIndex' ( in highp uint LocalInvocationIndex) +0:? Linker Objects +0:? 'gl_WorkGroupSize' ( const highp 3-component vector of uint WorkGroupSize) +0:? 2 (const uint) +0:? 1 (const uint) +0:? 4096 (const uint) +0:? 'total' ( const highp int) +0:? 66592 (const int) +0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer runtime-sized array of highp float values}) +0:? 'invalid' (layout( column_major shared) buffer block{layout( column_major shared) buffer 1-element array of highp float values, layout( column_major shared) buffer highp int value}) +0:? 'v3' (layout( location=2) in highp 3-component vector of float) +0:? 'f' ( in highp float) +0:? 'fo' ( out highp float) +0:? 's' ( shared highp 4-component vector of float) +0:? 'sl' (layout( location=2) shared highp 4-component vector of float) +0:? 'fs' ( shared highp float) +0:? 'arrX' ( global 2-element array of highp int) +0:? 'arrY' ( global 1-element array of highp int) +0:? 'arrZ' ( global 4096-element array of highp int) +0:? 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:? 'v' ( buffer highp 4-component vector of float) +0:? 'us2dbad' ( uniform mediump usampler2D) +0:? 'us2d' ( uniform highp usampler2D) +0:? 'ii2dabad' ( uniform highp iimage2DArray) +0:? 'ii2da' ( writeonly uniform highp iimage2DArray) +0:? 'iimg2D' (layout( r32i) uniform highp iimage2D) +0:? 'iimg2Drgba' (layout( rgba32i) readonly uniform highp iimage2D) +0:? 'img2Drgba' (layout( rgba32f) readonly uniform mediump image2D) +0:? 'uimg2D' (layout( r32ui) uniform mediump uimage2D) +0:? 'vol' ( volatile temp highp float) +0:? 'vol2' ( readonly temp highp int) +0:? 'qualim1' (layout( r32i) coherent readonly uniform highp iimage2D) +0:? 'qualim2' (layout( r32i) coherent restrict readonly uniform highp iimage2D) +0:? 'i1bad' (layout( rg8i) readonly uniform highp uimage2D) +0:? 'i2bad' (layout( rgba32i) readonly uniform highp image2D) +0:? 'i3bad' (layout( rgba32f) readonly uniform highp uimage2D) +0:? 'i4bad' (layout( r8_snorm) readonly uniform highp iimage2D) +0:? 'i5bad' (layout( rgba32ui) readonly uniform highp iimage2D) +0:? 'i6bad' (layout( r8ui) readonly uniform highp iimage2D) +0:? 'counter' (layout( binding=0 offset=0) uniform highp atomic_uint) +0:? 'counterBad' (layout( binding=1) uniform mediump atomic_uint) +0:? 'countArr' (layout( binding=2 offset=4) uniform 4-element array of highp atomic_uint) +0:? 'i' ( uniform highp int) +0:? 'atomi' ( shared highp int) +0:? 'atomu' ( shared highp uint) +0:? 'pfoo' ( noContraction temp highp int) +0:? 'dm' ( global 2X4 matrix of double) +0:? 'sca' ( uniform mediump samplerCubeArray) +0:? 'i2dr' ( uniform mediump iimage2DRect) +0:? 'i2dms' ( uniform highp image2DMS) +0:? 'u2dmsa' ( uniform mediump uimage2DMSArray) +0:? 'okay1' (layout( r32f) coherent volatile restrict readonly writeonly uniform highp image2D) +0:? 'okay2' (layout( r32i) coherent volatile restrict readonly uniform highp iimage2D) +0:? 'okay3' (layout( r32ui) coherent volatile restrict writeonly uniform highp uimage2D) +0:? 'okay4' (layout( r32f) coherent volatile restrict uniform highp image2D) +0:? 'badQ1' (layout( rgba32f) coherent volatile restrict uniform highp image2D) +0:? 'badQ2' (layout( rgba8i) coherent volatile restrict uniform highp iimage2D) +0:? 'badQ3' (layout( rgba16ui) coherent volatile restrict uniform highp uimage2D) +0:? 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values}) +0:? 'multio' (layout( column_major shared) buffer block{layout( column_major shared) readonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 1-element array of highp float values}) +0:? 'inbi' ( in block{ in highp int a}) +0:? 'outbi' ( out block{ out highp int a}) +0:? 't__' ( global highp float) +0:? 'arr' ( shared 2-element array of 3-element array of 4-element array of highp 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/310.frag.out b/deps/glslang/Test/baseResults/310.frag.out new file mode 100644 index 00000000..6763c0a1 --- /dev/null +++ b/deps/glslang/Test/baseResults/310.frag.out @@ -0,0 +1,1237 @@ +310.frag +ERROR: 0:2: 'float' : type requires declaration of default precision qualifier +ERROR: 0:8: 'origin_upper_left' : not supported with this profile: es +ERROR: 0:8: 'pixel_center_integer' : not supported with this profile: es +ERROR: 0:8: 'gl_FragCoord' : identifiers starting with "gl_" are reserved +ERROR: 0:11: 'location' : overlapping use of location 2 +ERROR: 0:15: 'usampler2DRect' : Reserved word. +ERROR: 0:15: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:23: 'variable indexing sampler array' : not supported for this version or the enabled extensions +ERROR: 0:27: 'textureGatherOffsets' : no matching overloaded function found +ERROR: 0:27: '=' : cannot convert from ' const float' to ' temp mediump 4-component vector of uint' +ERROR: 0:30: 'textureGatherOffset(...)' : must be a compile-time constant: component argument +ERROR: 0:31: 'textureGatherOffset(...)' : must be 0, 1, 2, or 3: component argument +ERROR: 0:34: 'non-constant offset argument' : not supported for this version or the enabled extensions +ERROR: 0:42: 'texel offset' : argument must be compile-time constant +ERROR: 0:44: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset] +ERROR: 0:44: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset] +ERROR: 0:45: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset] +ERROR: 0:45: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset] +ERROR: 0:66: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:66: 'image variables not declared 'writeonly' and without a format layout qualifier' : not supported with this profile: es +ERROR: 0:67: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:67: 'image variables not declared 'writeonly' and without a format layout qualifier' : not supported with this profile: es +ERROR: 0:68: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:68: 'image variables not declared 'writeonly' and without a format layout qualifier' : not supported with this profile: es +ERROR: 0:69: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:69: 'image variables not declared 'writeonly' and without a format layout qualifier' : not supported with this profile: es +ERROR: 0:73: 'binding' : requires block, or sampler/image, or atomic-counter type +ERROR: 0:77: 'location' : location is too large +ERROR: 0:81: 'location' : too large for fragment output +ERROR: 0:82: 'location' : too large for fragment output +ERROR: 0:82: 'location' : overlapping use of location 40 +ERROR: 0:83: 'non-literal layout-id value' : not supported with this profile: es +ERROR: 0:83: 'layout-id value' : cannot be negative +ERROR: 0:96: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:110: 'out' : cannot be bool +ERROR: 0:111: 'image2D' : sampler/image types can only be used in uniform variables or function parameters: imageOut +ERROR: 0:111: 'image variables not declared 'writeonly' and without a format layout qualifier' : not supported with this profile: es +ERROR: 0:112: 'out' : cannot be a matrix +ERROR: 0:114: 'in' : cannot be bool +ERROR: 0:115: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: ino +ERROR: 0:117: 'fragment-shader array-of-array input' : not supported with this profile: es +ERROR: 0:120: 'fragment-shader array-of-struct input' : not supported with this profile: es +ERROR: 0:121: 'fragment-shader array-of-struct input' : not supported with this profile: es +ERROR: 0:123: 'fragment-shader struct input containing an array' : not supported with this profile: es +ERROR: 0:125: 'fragment-shader struct input containing structure' : not supported with this profile: es +ERROR: 0:133: 'output block' : not supported in this stage: fragment +ERROR: 0:138: '' : cannot nest a structure definition inside a structure or block +ERROR: 0:146: 'location' : overlapping use of location 13 +ERROR: 0:148: 'inbname2' : Cannot reuse block name within the same interface: in +ERROR: 0:153: 'badmember' : nameless block contains a member that already has a name at global scope +ERROR: 0:157: 'inbname' : redefinition +ERROR: 0:159: 'vAnon' : redefinition +ERROR: 0:173: 'origin_upper_left' : not supported with this profile: es +ERROR: 0:173: 'pixel_center_integer' : not supported with this profile: es +ERROR: 0:173: 'redeclaration' : cannot redeclare with different qualification: gl_FragCoord +ERROR: 0:177: 'depth layout qualifier' : not supported with this profile: es +ERROR: 0:181: 'assign' : l-value required "gl_FragDepth" (can't modify gl_FragDepth if using early_fragment_tests) +ERROR: 0:182: 'gl_Layer' : required extension not requested: Possible extensions include: +GL_EXT_geometry_shader +GL_OES_geometry_shader +ERROR: 0:183: 'gl_PrimitiveID' : required extension not requested: Possible extensions include: +GL_EXT_geometry_shader +GL_OES_geometry_shader +ERROR: 0:209: 'precise' : Reserved word. +ERROR: 0:209: 'precise' : not supported for this version or the enabled extensions +ERROR: 0:210: 'fma' : required extension not requested: Possible extensions include: +GL_EXT_gpu_shader5 +GL_OES_gpu_shader5 +ERROR: 0:211: 'non-constant offset argument' : not supported for this version or the enabled extensions +ERROR: 0:212: 'textureGatherOffsets' : required extension not requested: Possible extensions include: +GL_EXT_gpu_shader5 +GL_OES_gpu_shader5 +ERROR: 0:223: 'textureGatherOffsets(...)' : must be a compile-time constant: offsets argument +ERROR: 0:257: 'gl_SampleID' : required extension not requested: GL_OES_sample_variables +ERROR: 0:258: 'gl_SamplePosition' : required extension not requested: GL_OES_sample_variables +ERROR: 0:259: 'gl_SampleMaskIn' : required extension not requested: GL_OES_sample_variables +ERROR: 0:260: 'gl_SampleMask' : required extension not requested: GL_OES_sample_variables +ERROR: 0:261: 'gl_NumSamples' : required extension not requested: GL_OES_sample_variables +ERROR: 0:289: 'imageAtomicAdd' : required extension not requested: GL_OES_shader_image_atomic +ERROR: 0:290: 'imageAtomicAdd' : required extension not requested: GL_OES_shader_image_atomic +ERROR: 0:291: 'imageAtomicMin' : required extension not requested: GL_OES_shader_image_atomic +ERROR: 0:292: 'imageAtomicMin' : required extension not requested: GL_OES_shader_image_atomic +ERROR: 0:293: 'imageAtomicMax' : required extension not requested: GL_OES_shader_image_atomic +ERROR: 0:294: 'imageAtomicMax' : required extension not requested: GL_OES_shader_image_atomic +ERROR: 0:295: 'imageAtomicAnd' : required extension not requested: GL_OES_shader_image_atomic +ERROR: 0:296: 'imageAtomicAnd' : required extension not requested: GL_OES_shader_image_atomic +ERROR: 0:297: 'imageAtomicOr' : required extension not requested: GL_OES_shader_image_atomic +ERROR: 0:298: 'imageAtomicOr' : required extension not requested: GL_OES_shader_image_atomic +ERROR: 0:299: 'imageAtomicXor' : required extension not requested: GL_OES_shader_image_atomic +ERROR: 0:300: 'imageAtomicXor' : required extension not requested: GL_OES_shader_image_atomic +ERROR: 0:301: 'imageAtomicExchange' : required extension not requested: GL_OES_shader_image_atomic +ERROR: 0:302: 'imageAtomicExchange' : required extension not requested: GL_OES_shader_image_atomic +ERROR: 0:303: 'imageAtomicExchange' : required extension not requested: GL_OES_shader_image_atomic +ERROR: 0:304: 'imageAtomicCompSwap' : required extension not requested: GL_OES_shader_image_atomic +ERROR: 0:305: 'imageAtomicCompSwap' : required extension not requested: GL_OES_shader_image_atomic +ERROR: 0:312: 'rgba32f' : format requires readonly or writeonly memory qualifier +ERROR: 0:313: 'rgba8ui' : format requires readonly or writeonly memory qualifier +ERROR: 0:314: 'rgba16i' : format requires readonly or writeonly memory qualifier +ERROR: 0:340: 'imageAtomicMax' : only supported on image with format r32i or r32ui +ERROR: 0:341: 'imageAtomicMax' : only supported on image with format r32i or r32ui +ERROR: 0:342: 'imageAtomicExchange' : only supported on image with format r32f +ERROR: 0:345: 'sample' : Reserved word. +ERROR: 0:346: 'centroid/sample/patch' : can't use auxiliary qualifier on a fragment output +ERROR: 0:347: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output +ERROR: 0:348: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output +ERROR: 0:349: 'noperspective' : Reserved word. +ERROR: 0:349: 'noperspective' : not supported for this version or the enabled extensions +ERROR: 0:349: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output +ERROR: 0:355: 'interpolateAtCentroid' : required extension not requested: GL_OES_shader_multisample_interpolation +ERROR: 0:356: 'interpolateAtSample' : required extension not requested: GL_OES_shader_multisample_interpolation +ERROR: 0:357: 'interpolateAtOffset' : required extension not requested: GL_OES_shader_multisample_interpolation +ERROR: 0:365: 'centroid/sample/patch' : can't use auxiliary qualifier on a fragment output +ERROR: 0:380: 'interpolateAtCentroid' : no matching overloaded function found +ERROR: 0:380: 'assign' : cannot convert from ' const float' to ' temp mediump 3-component vector of float' +ERROR: 0:382: 'interpolateAtCentroid' : first argument must be an interpolant, or interpolant-array element +ERROR: 0:384: 'interpolateAtSample' : no matching overloaded function found +ERROR: 0:384: 'assign' : cannot convert from ' const float' to ' temp mediump 3-component vector of float' +ERROR: 0:386: 'interpolateAtSample' : first argument must be an interpolant, or interpolant-array element +ERROR: 0:389: 'interpolateAtOffset' : no matching overloaded function found +ERROR: 0:389: 'assign' : cannot convert from ' const float' to ' temp mediump 3-component vector of float' +ERROR: 0:391: 'interpolateAtOffset' : first argument must be an interpolant, or interpolant-array element +ERROR: 0:392: 'interpolateAtOffset' : first argument must be an interpolant, or interpolant-array element +ERROR: 0:396: 'interpolateAtCentroid' : first argument must be an interpolant, or interpolant-array element +ERROR: 0:397: 'interpolateAtSample' : first argument must be an interpolant, or interpolant-array element +ERROR: 0:400: 'blend equation' : not supported for this version or the enabled extensions +ERROR: 0:423: 'blend equation' : can only apply to 'out' +ERROR: 0:424: 'blend equation' : can only apply to a standalone qualifier +ERROR: 0:425: 'blend equation' : can only apply to a standalone qualifier +ERROR: 0:426: 'blend equation' : can only apply to a standalone qualifier +ERROR: 0:427: 'blend equation' : can only apply to a standalone qualifier +ERROR: 0:428: 'blend equation' : can only apply to a standalone qualifier +ERROR: 0:429: 'blend_support' : unknown blend equation +ERROR: 0:431: 'fragment-shader array-of-array output' : not supported with this profile: es +ERROR: 0:435: 'gl_DeviceIndex' : required extension not requested: GL_EXT_device_group +ERROR: 0:436: 'gl_ViewIndex' : required extension not requested: GL_EXT_multiview +ERROR: 127 compilation errors. No code generated. + + +Shader version: 310 +Requested GL_EXT_device_group +Requested GL_EXT_multiview +Requested GL_EXT_shader_io_blocks +Requested GL_EXT_texture_cube_map_array +Requested GL_KHR_blend_equation_advanced +Requested GL_OES_geometry_shader +Requested GL_OES_gpu_shader5 +Requested GL_OES_sample_variables +Requested GL_OES_shader_image_atomic +Requested GL_OES_shader_io_blocks +Requested GL_OES_shader_multisample_interpolation +gl_FragCoord pixel center is integer +gl_FragCoord origin is upper left +using early_fragment_tests +using depth_any +using blend_support_multiply blend_support_screen blend_support_overlay blend_support_darken blend_support_lighten blend_support_colordodge blend_support_colorburn blend_support_hardlight blend_support_softlight blend_support_difference blend_support_exclusion blend_support_hsl_hue blend_support_hsl_saturation blend_support_hsl_color blend_support_hsl_luminosity blend_support_all_equations +ERROR: node is still EOpNull! +0:21 Function Definition: main( ( global void) +0:21 Function Parameters: +0:23 Sequence +0:23 Sequence +0:23 move second child to first child ( temp highp 4-component vector of float) +0:23 'v' ( temp mediump 4-component vector of float) +0:23 texture ( global highp 4-component vector of float) +0:23 indirect index ( temp highp sampler2D) +0:23 'arrayedSampler' ( uniform 5-element array of highp sampler2D) +0:23 'i' ( uniform mediump int) +0:23 'c2D' ( smooth in mediump 2-component vector of float) +0:28 Sequence +0:28 move second child to first child ( temp highp 4-component vector of float) +0:28 'v4' ( temp mediump 4-component vector of float) +0:28 textureGather ( global highp 4-component vector of float) +0:28 direct index ( temp highp sampler2D) +0:28 'arrayedSampler' ( uniform 5-element array of highp sampler2D) +0:28 Constant: +0:28 0 (const int) +0:28 'c2D' ( smooth in mediump 2-component vector of float) +0:29 Sequence +0:29 move second child to first child ( temp highp 4-component vector of int) +0:29 'iv4' ( temp mediump 4-component vector of int) +0:29 textureGatherOffset ( global highp 4-component vector of int) +0:29 'isamp2DA' ( uniform highp isampler2DArray) +0:29 Constant: +0:29 0.100000 +0:29 0.100000 +0:29 0.100000 +0:29 Constant: +0:29 1 (const int) +0:29 1 (const int) +0:29 Constant: +0:29 3 (const int) +0:30 move second child to first child ( temp highp 4-component vector of int) +0:30 'iv4' ( temp mediump 4-component vector of int) +0:30 textureGatherOffset ( global highp 4-component vector of int) +0:30 'isamp2DA' ( uniform highp isampler2DArray) +0:30 Constant: +0:30 0.100000 +0:30 0.100000 +0:30 0.100000 +0:30 Constant: +0:30 1 (const int) +0:30 1 (const int) +0:30 'i' ( uniform mediump int) +0:31 move second child to first child ( temp highp 4-component vector of int) +0:31 'iv4' ( temp mediump 4-component vector of int) +0:31 textureGatherOffset ( global highp 4-component vector of int) +0:31 'isamp2DA' ( uniform highp isampler2DArray) +0:31 Constant: +0:31 0.100000 +0:31 0.100000 +0:31 0.100000 +0:31 Constant: +0:31 1 (const int) +0:31 1 (const int) +0:31 Constant: +0:31 4 (const int) +0:32 move second child to first child ( temp highp 4-component vector of int) +0:32 'iv4' ( temp mediump 4-component vector of int) +0:32 textureGatherOffset ( global highp 4-component vector of int) +0:32 'isamp2DA' ( uniform highp isampler2DArray) +0:32 Constant: +0:32 0.100000 +0:32 0.100000 +0:32 0.100000 +0:32 Constant: +0:32 1 (const int) +0:32 1 (const int) +0:32 Constant: +0:32 3 (const int) +0:33 move second child to first child ( temp highp 4-component vector of int) +0:33 'iv4' ( temp mediump 4-component vector of int) +0:33 textureGatherOffset ( global highp 4-component vector of int) +0:33 'isamp2DA' ( uniform highp isampler2DArray) +0:33 Constant: +0:33 0.100000 +0:33 0.100000 +0:33 0.100000 +0:33 Constant: +0:33 0 (const int) +0:33 0 (const int) +0:34 move second child to first child ( temp highp 4-component vector of int) +0:34 'iv4' ( temp mediump 4-component vector of int) +0:34 textureGatherOffset ( global highp 4-component vector of int) +0:34 'isamp2DA' ( uniform highp isampler2DArray) +0:34 Constant: +0:34 0.100000 +0:34 0.100000 +0:34 0.100000 +0:34 Construct ivec2 ( temp highp 2-component vector of int) +0:34 'i' ( uniform mediump int) +0:38 Function Definition: foo23( ( global void) +0:38 Function Parameters: +0:? Sequence +0:42 textureProjGradOffset ( global highp 4-component vector of uint) +0:42 'usamp2d' ( uniform highp usampler2D) +0:42 'outp' ( out mediump 4-component vector of float) +0:42 Constant: +0:42 0.000000 +0:42 0.000000 +0:42 Constant: +0:42 0.000000 +0:42 0.000000 +0:42 Convert float to int ( temp highp 2-component vector of int) +0:42 'c2D' ( smooth in mediump 2-component vector of float) +0:43 textureProjGradOffset ( global highp 4-component vector of uint) +0:43 'usamp2d' ( uniform highp usampler2D) +0:43 'outp' ( out mediump 4-component vector of float) +0:43 Constant: +0:43 0.000000 +0:43 0.000000 +0:43 Constant: +0:43 0.000000 +0:43 0.000000 +0:43 Constant: +0:43 3 (const int) +0:43 4 (const int) +0:44 textureProjGradOffset ( global highp 4-component vector of uint) +0:44 'usamp2d' ( uniform highp usampler2D) +0:44 'outp' ( out mediump 4-component vector of float) +0:44 Constant: +0:44 0.000000 +0:44 0.000000 +0:44 Constant: +0:44 0.000000 +0:44 0.000000 +0:44 Constant: +0:44 15 (const int) +0:44 16 (const int) +0:45 textureProjGradOffset ( global highp 4-component vector of uint) +0:45 'usamp2d' ( uniform highp usampler2D) +0:45 'outp' ( out mediump 4-component vector of float) +0:45 Constant: +0:45 0.000000 +0:45 0.000000 +0:45 Constant: +0:45 0.000000 +0:45 0.000000 +0:45 Constant: +0:45 -10 (const int) +0:45 20 (const int) +0:47 Test condition and select ( temp void) +0:47 Condition +0:47 'gl_HelperInvocation' ( in bool HelperInvocation) +0:47 true case +0:48 Pre-Increment ( temp mediump 4-component vector of float) +0:48 'outp' ( out mediump 4-component vector of float) +0:50 Sequence +0:50 move second child to first child ( temp mediump int) +0:50 'sum' ( temp mediump int) +0:50 Constant: +0:50 32 (const int) +0:58 move second child to first child ( temp bool) +0:58 'b1' ( temp bool) +0:58 mix ( global bool) +0:58 'b2' ( temp bool) +0:58 'b3' ( temp bool) +0:58 'b' ( temp bool) +0:59 Sequence +0:59 move second child to first child ( temp mediump 3-component vector of uint) +0:59 'um3' ( temp mediump 3-component vector of uint) +0:59 mix ( global mediump 3-component vector of uint) +0:59 Construct uvec3 ( temp mediump 3-component vector of uint) +0:59 Convert int to uint ( temp mediump uint) +0:59 'i' ( uniform mediump int) +0:59 Construct uvec3 ( temp mediump 3-component vector of uint) +0:59 Convert int to uint ( temp mediump uint) +0:59 'i' ( uniform mediump int) +0:59 Construct bvec3 ( temp 3-component vector of bool) +0:59 'b' ( temp bool) +0:60 Sequence +0:60 move second child to first child ( temp mediump 4-component vector of int) +0:60 'im4' ( temp mediump 4-component vector of int) +0:60 mix ( global mediump 4-component vector of int) +0:60 Construct ivec4 ( temp mediump 4-component vector of int) +0:60 'i' ( uniform mediump int) +0:60 Construct ivec4 ( temp mediump 4-component vector of int) +0:60 'i' ( uniform mediump int) +0:60 Construct bvec4 ( temp 4-component vector of bool) +0:60 'b' ( temp bool) +0:98 Function Definition: foots( ( global void) +0:98 Function Parameters: +0:100 Sequence +0:100 Sequence +0:100 move second child to first child ( temp highp 2-component vector of int) +0:100 'v2' ( temp highp 2-component vector of int) +0:100 textureSize ( global highp 2-component vector of int) +0:100 's1' (layout( binding=3) uniform highp sampler2D) +0:100 Constant: +0:100 2 (const int) +0:101 Sequence +0:101 move second child to first child ( temp highp 3-component vector of int) +0:101 'v3' ( temp highp 3-component vector of int) +0:101 textureSize ( global highp 3-component vector of int) +0:101 'isamp2DA' ( uniform highp isampler2DArray) +0:101 Constant: +0:101 3 (const int) +0:102 move second child to first child ( temp highp 2-component vector of int) +0:102 'v2' ( temp highp 2-component vector of int) +0:102 textureSize ( global highp 2-component vector of int, operation at mediump) +0:102 's2dms' ( uniform mediump sampler2DMS) +0:103 move second child to first child ( temp highp 2-component vector of int) +0:103 'v2' ( temp highp 2-component vector of int) +0:103 imageQuerySize ( global highp 2-component vector of int) +0:103 'i2D' (layout( binding=2) writeonly uniform highp image2D) +0:104 move second child to first child ( temp highp 3-component vector of int) +0:104 'v3' ( temp highp 3-component vector of int) +0:104 imageQuerySize ( global highp 3-component vector of int, operation at mediump) +0:104 'i3D' (layout( binding=4) readonly uniform mediump image3D) +0:105 move second child to first child ( temp highp 2-component vector of int) +0:105 'v2' ( temp highp 2-component vector of int) +0:105 imageQuerySize ( global highp 2-component vector of int, operation at mediump) +0:105 'iCube' (layout( binding=5) uniform mediump imageCube) +0:106 move second child to first child ( temp highp 3-component vector of int) +0:106 'v3' ( temp highp 3-component vector of int) +0:106 imageQuerySize ( global highp 3-component vector of int, operation at mediump) +0:106 'i2DA' (layout( binding=6) uniform mediump image2DArray) +0:107 move second child to first child ( temp highp 2-component vector of int) +0:107 'v2' ( temp highp 2-component vector of int) +0:107 imageQuerySize ( global highp 2-component vector of int, operation at mediump) +0:107 'i2Dqualified' (layout( binding=6) coherent volatile restrict uniform mediump image2D) +0:165 Function Definition: fooIO( ( global void) +0:165 Function Parameters: +0:167 Sequence +0:167 Sequence +0:167 move second child to first child ( temp mediump 4-component vector of float) +0:167 'v' ( temp mediump 4-component vector of float) +0:167 add ( temp mediump 4-component vector of float) +0:167 v: direct index for structure ( in mediump 4-component vector of float) +0:167 'inbinst' ( in block{ in mediump int a, in mediump 4-component vector of float v, in structure{ global mediump int b} s}) +0:167 Constant: +0:167 1 (const int) +0:167 vAnon: direct index for structure (layout( location=13) centroid in mediump 4-component vector of float) +0:167 'anon@0' ( in block{layout( location=12) in mediump int aAnon, layout( location=13) centroid in mediump 4-component vector of float vAnon}) +0:167 Constant: +0:167 1 (const uint) +0:168 vector scale second child into first child ( temp mediump 4-component vector of float) +0:168 'v' ( temp mediump 4-component vector of float) +0:168 f: direct index for structure ( in mediump float) +0:168 direct index ( temp block{ in mediump float f}) +0:168 'arrayedInst' ( in 4-element array of block{ in mediump float f}) +0:168 Constant: +0:168 2 (const int) +0:168 Constant: +0:168 0 (const int) +0:169 vector scale second child into first child ( temp mediump 4-component vector of float) +0:169 'v' ( temp mediump 4-component vector of float) +0:169 f: direct index for structure ( in mediump float) +0:169 indirect index ( temp block{ in mediump float f}) +0:169 'arrayedInst' ( in 4-element array of block{ in mediump float f}) +0:169 'i' ( uniform mediump int) +0:169 Constant: +0:169 0 (const int) +0:179 Function Definition: foo_IO( ( global void) +0:179 Function Parameters: +0:181 Sequence +0:181 move second child to first child ( temp highp float) +0:181 'gl_FragDepth' ( gl_FragDepth highp float FragDepth) +0:181 Constant: +0:181 0.200000 +0:182 'gl_Layer' ( flat in highp int Layer) +0:183 'gl_PrimitiveID' ( flat in highp int PrimitiveID) +0:184 Sequence +0:184 move second child to first child ( temp bool) +0:184 'f' ( temp bool) +0:184 'gl_FrontFacing' ( gl_FrontFacing bool Face) +0:191 Function Definition: foo_GS( ( global void) +0:191 Function Parameters: +0:193 Sequence +0:193 Sequence +0:193 move second child to first child ( temp highp int) +0:193 'l' ( temp highp int) +0:193 'gl_Layer' ( flat in highp int Layer) +0:194 Sequence +0:194 move second child to first child ( temp highp int) +0:194 'p' ( temp highp int) +0:194 'gl_PrimitiveID' ( flat in highp int PrimitiveID) +0:207 Function Definition: pfooBad( ( global void) +0:207 Function Parameters: +0:? Sequence +0:210 move second child to first child ( temp mediump 2-component vector of float) +0:210 'h' ( noContraction temp mediump 2-component vector of float) +0:210 fma ( global mediump 2-component vector of float) +0:210 'inf' ( smooth in mediump 2-component vector of float) +0:210 'ing' ( smooth in mediump 2-component vector of float) +0:210 'h' ( noContraction temp mediump 2-component vector of float) +0:211 textureGatherOffset ( global highp 4-component vector of float) +0:211 direct index ( temp highp sampler2D) +0:211 'sArray' ( uniform 4-element array of highp sampler2D) +0:211 Constant: +0:211 0 (const int) +0:211 Constant: +0:211 0.100000 +0:211 0.100000 +0:211 Convert float to int ( temp highp 2-component vector of int) +0:211 'inf' ( smooth in mediump 2-component vector of float) +0:212 textureGatherOffsets ( global highp 4-component vector of float) +0:212 direct index ( temp highp sampler2D) +0:212 'sArray' ( uniform 4-element array of highp sampler2D) +0:212 Constant: +0:212 0 (const int) +0:212 Constant: +0:212 0.100000 +0:212 0.100000 +0:212 Constant: +0:212 0 (const int) +0:212 0 (const int) +0:212 0 (const int) +0:212 0 (const int) +0:212 0 (const int) +0:212 0 (const int) +0:212 0 (const int) +0:212 0 (const int) +0:217 Function Definition: pfoo( ( global void) +0:217 Function Parameters: +0:? Sequence +0:220 move second child to first child ( temp mediump 2-component vector of float) +0:220 'h' ( noContraction temp mediump 2-component vector of float) +0:220 fma ( global mediump 2-component vector of float) +0:220 'inf' ( smooth in mediump 2-component vector of float) +0:220 'ing' ( smooth in mediump 2-component vector of float) +0:220 'h' ( noContraction temp mediump 2-component vector of float) +0:221 textureGatherOffset ( global highp 4-component vector of float) +0:221 direct index ( temp highp sampler2D) +0:221 'sArray' ( uniform 4-element array of highp sampler2D) +0:221 Constant: +0:221 0 (const int) +0:221 Constant: +0:221 0.100000 +0:221 0.100000 +0:221 Convert float to int ( temp highp 2-component vector of int) +0:221 'inf' ( smooth in mediump 2-component vector of float) +0:222 textureGatherOffsets ( global highp 4-component vector of float) +0:222 direct index ( temp highp sampler2D) +0:222 'sArray' ( uniform 4-element array of highp sampler2D) +0:222 Constant: +0:222 0 (const int) +0:222 Constant: +0:222 0.100000 +0:222 0.100000 +0:222 Constant: +0:222 0 (const int) +0:222 0 (const int) +0:222 0 (const int) +0:222 0 (const int) +0:222 0 (const int) +0:222 0 (const int) +0:222 0 (const int) +0:222 0 (const int) +0:223 textureGatherOffsets ( global highp 4-component vector of float) +0:223 direct index ( temp highp sampler2D) +0:223 'sArray' ( uniform 4-element array of highp sampler2D) +0:223 Constant: +0:223 0 (const int) +0:223 Constant: +0:223 0.100000 +0:223 0.100000 +0:223 'offsets' ( uniform 4-element array of mediump 2-component vector of int) +0:248 Function Definition: CAT( ( global void) +0:248 Function Parameters: +0:250 Sequence +0:250 Sequence +0:250 move second child to first child ( temp highp 4-component vector of float) +0:250 'b4' ( temp highp 4-component vector of float) +0:250 texture ( global highp 4-component vector of float) +0:250 'CA4' ( uniform highp samplerCubeArray) +0:250 Constant: +0:250 0.500000 +0:250 0.500000 +0:250 0.500000 +0:250 0.500000 +0:250 Constant: +0:250 0.240000 +0:251 Sequence +0:251 move second child to first child ( temp highp 4-component vector of int) +0:251 'b6' ( temp highp 4-component vector of int) +0:251 texture ( global highp 4-component vector of int) +0:251 'CA6' ( uniform highp isamplerCubeArray) +0:251 Constant: +0:251 0.500000 +0:251 0.500000 +0:251 0.500000 +0:251 0.500000 +0:251 Constant: +0:251 0.260000 +0:252 Sequence +0:252 move second child to first child ( temp highp 4-component vector of uint) +0:252 'b7' ( temp highp 4-component vector of uint) +0:252 texture ( global highp 4-component vector of uint) +0:252 'CA7' ( uniform highp usamplerCubeArray) +0:252 Constant: +0:252 0.500000 +0:252 0.500000 +0:252 0.500000 +0:252 0.500000 +0:252 Constant: +0:252 0.270000 +0:255 Function Definition: badSample( ( global void) +0:255 Function Parameters: +0:257 Sequence +0:257 Sequence +0:257 move second child to first child ( temp lowp int) +0:257 'a1' ( temp lowp int) +0:257 'gl_SampleID' ( flat in lowp int SampleId) +0:258 Sequence +0:258 move second child to first child ( temp mediump 2-component vector of float) +0:258 'a2' ( temp mediump 2-component vector of float) +0:258 'gl_SamplePosition' ( smooth in mediump 2-component vector of float SamplePosition) +0:259 Sequence +0:259 move second child to first child ( temp highp int) +0:259 'a3' ( temp highp int) +0:259 direct index ( flat temp highp int SampleMaskIn) +0:259 'gl_SampleMaskIn' ( flat in unsized 1-element array of highp int SampleMaskIn) +0:259 Constant: +0:259 0 (const int) +0:260 move second child to first child ( temp highp int) +0:260 direct index ( temp highp int SampleMaskIn) +0:260 'gl_SampleMask' ( out unsized 1-element array of highp int SampleMaskIn) +0:260 Constant: +0:260 0 (const int) +0:260 'a3' ( temp highp int) +0:261 Sequence +0:261 move second child to first child ( temp mediump int) +0:261 'n' ( temp mediump int) +0:261 'gl_NumSamples' ( uniform lowp int) +0:268 Function Definition: goodSample( ( global void) +0:268 Function Parameters: +0:270 Sequence +0:270 Sequence +0:270 move second child to first child ( temp lowp int) +0:270 'a1' ( temp lowp int) +0:270 'gl_SampleID' ( flat in lowp int SampleId) +0:271 Sequence +0:271 move second child to first child ( temp mediump 2-component vector of float) +0:271 'a2' ( temp mediump 2-component vector of float) +0:271 'gl_SamplePosition' ( smooth in mediump 2-component vector of float SamplePosition) +0:272 Sequence +0:272 move second child to first child ( temp highp int) +0:272 'a3' ( temp highp int) +0:272 direct index ( flat temp highp int SampleMaskIn) +0:272 'gl_SampleMaskIn' ( flat in unsized 1-element array of highp int SampleMaskIn) +0:272 Constant: +0:272 0 (const int) +0:273 move second child to first child ( temp highp int) +0:273 direct index ( temp highp int SampleMaskIn) +0:273 'gl_SampleMask' ( out unsized 1-element array of highp int SampleMaskIn) +0:273 Constant: +0:273 0 (const int) +0:273 'a3' ( temp highp int) +0:274 Sequence +0:274 move second child to first child ( temp mediump int) +0:274 'n1' ( temp mediump int) +0:274 Constant: +0:274 4 (const int) +0:275 Sequence +0:275 move second child to first child ( temp mediump int) +0:275 'n2' ( temp mediump int) +0:275 'gl_NumSamples' ( uniform lowp int) +0:283 Function Definition: badImageAtom( ( global void) +0:283 Function Parameters: +0:? Sequence +0:289 imageAtomicAdd ( global highp int) +0:289 'im2Di' (layout( r32i) uniform highp iimage2D) +0:289 'P' ( uniform mediump 2-component vector of int) +0:289 'dati' ( temp mediump int) +0:290 imageAtomicAdd ( global highp uint) +0:290 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:290 'P' ( uniform mediump 2-component vector of int) +0:290 'datu' ( temp mediump uint) +0:291 imageAtomicMin ( global highp int) +0:291 'im2Di' (layout( r32i) uniform highp iimage2D) +0:291 'P' ( uniform mediump 2-component vector of int) +0:291 'dati' ( temp mediump int) +0:292 imageAtomicMin ( global highp uint) +0:292 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:292 'P' ( uniform mediump 2-component vector of int) +0:292 'datu' ( temp mediump uint) +0:293 imageAtomicMax ( global highp int) +0:293 'im2Di' (layout( r32i) uniform highp iimage2D) +0:293 'P' ( uniform mediump 2-component vector of int) +0:293 'dati' ( temp mediump int) +0:294 imageAtomicMax ( global highp uint) +0:294 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:294 'P' ( uniform mediump 2-component vector of int) +0:294 'datu' ( temp mediump uint) +0:295 imageAtomicAnd ( global highp int) +0:295 'im2Di' (layout( r32i) uniform highp iimage2D) +0:295 'P' ( uniform mediump 2-component vector of int) +0:295 'dati' ( temp mediump int) +0:296 imageAtomicAnd ( global highp uint) +0:296 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:296 'P' ( uniform mediump 2-component vector of int) +0:296 'datu' ( temp mediump uint) +0:297 imageAtomicOr ( global highp int) +0:297 'im2Di' (layout( r32i) uniform highp iimage2D) +0:297 'P' ( uniform mediump 2-component vector of int) +0:297 'dati' ( temp mediump int) +0:298 imageAtomicOr ( global highp uint) +0:298 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:298 'P' ( uniform mediump 2-component vector of int) +0:298 'datu' ( temp mediump uint) +0:299 imageAtomicXor ( global highp int) +0:299 'im2Di' (layout( r32i) uniform highp iimage2D) +0:299 'P' ( uniform mediump 2-component vector of int) +0:299 'dati' ( temp mediump int) +0:300 imageAtomicXor ( global highp uint) +0:300 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:300 'P' ( uniform mediump 2-component vector of int) +0:300 'datu' ( temp mediump uint) +0:301 imageAtomicExchange ( global highp int) +0:301 'im2Di' (layout( r32i) uniform highp iimage2D) +0:301 'P' ( uniform mediump 2-component vector of int) +0:301 'dati' ( temp mediump int) +0:302 imageAtomicExchange ( global highp uint) +0:302 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:302 'P' ( uniform mediump 2-component vector of int) +0:302 'datu' ( temp mediump uint) +0:303 imageAtomicExchange ( global highp float) +0:303 'im2Df' (layout( r32f) uniform highp image2D) +0:303 'P' ( uniform mediump 2-component vector of int) +0:303 'datf' ( temp mediump float) +0:304 imageAtomicCompSwap ( global highp int) +0:304 'im2Di' (layout( r32i) uniform highp iimage2D) +0:304 'P' ( uniform mediump 2-component vector of int) +0:304 Constant: +0:304 3 (const int) +0:304 'dati' ( temp mediump int) +0:305 imageAtomicCompSwap ( global highp uint) +0:305 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:305 'P' ( uniform mediump 2-component vector of int) +0:305 Constant: +0:305 5 (const uint) +0:305 'datu' ( temp mediump uint) +0:316 Function Definition: goodImageAtom( ( global void) +0:316 Function Parameters: +0:? Sequence +0:322 imageAtomicAdd ( global highp int) +0:322 'im2Di' (layout( r32i) uniform highp iimage2D) +0:322 'P' ( uniform mediump 2-component vector of int) +0:322 'dati' ( temp mediump int) +0:323 imageAtomicAdd ( global highp uint) +0:323 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:323 'P' ( uniform mediump 2-component vector of int) +0:323 'datu' ( temp mediump uint) +0:324 imageAtomicMin ( global highp int) +0:324 'im2Di' (layout( r32i) uniform highp iimage2D) +0:324 'P' ( uniform mediump 2-component vector of int) +0:324 'dati' ( temp mediump int) +0:325 imageAtomicMin ( global highp uint) +0:325 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:325 'P' ( uniform mediump 2-component vector of int) +0:325 'datu' ( temp mediump uint) +0:326 imageAtomicMax ( global highp int) +0:326 'im2Di' (layout( r32i) uniform highp iimage2D) +0:326 'P' ( uniform mediump 2-component vector of int) +0:326 'dati' ( temp mediump int) +0:327 imageAtomicMax ( global highp uint) +0:327 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:327 'P' ( uniform mediump 2-component vector of int) +0:327 'datu' ( temp mediump uint) +0:328 imageAtomicAnd ( global highp int) +0:328 'im2Di' (layout( r32i) uniform highp iimage2D) +0:328 'P' ( uniform mediump 2-component vector of int) +0:328 'dati' ( temp mediump int) +0:329 imageAtomicAnd ( global highp uint) +0:329 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:329 'P' ( uniform mediump 2-component vector of int) +0:329 'datu' ( temp mediump uint) +0:330 imageAtomicOr ( global highp int) +0:330 'im2Di' (layout( r32i) uniform highp iimage2D) +0:330 'P' ( uniform mediump 2-component vector of int) +0:330 'dati' ( temp mediump int) +0:331 imageAtomicOr ( global highp uint) +0:331 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:331 'P' ( uniform mediump 2-component vector of int) +0:331 'datu' ( temp mediump uint) +0:332 imageAtomicXor ( global highp int) +0:332 'im2Di' (layout( r32i) uniform highp iimage2D) +0:332 'P' ( uniform mediump 2-component vector of int) +0:332 'dati' ( temp mediump int) +0:333 imageAtomicXor ( global highp uint) +0:333 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:333 'P' ( uniform mediump 2-component vector of int) +0:333 'datu' ( temp mediump uint) +0:334 imageAtomicExchange ( global highp int) +0:334 'im2Di' (layout( r32i) uniform highp iimage2D) +0:334 'P' ( uniform mediump 2-component vector of int) +0:334 'dati' ( temp mediump int) +0:335 imageAtomicExchange ( global highp uint) +0:335 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:335 'P' ( uniform mediump 2-component vector of int) +0:335 'datu' ( temp mediump uint) +0:336 imageAtomicExchange ( global highp float) +0:336 'im2Df' (layout( r32f) uniform highp image2D) +0:336 'P' ( uniform mediump 2-component vector of int) +0:336 'datf' ( temp mediump float) +0:337 imageAtomicCompSwap ( global highp int) +0:337 'im2Di' (layout( r32i) uniform highp iimage2D) +0:337 'P' ( uniform mediump 2-component vector of int) +0:337 Constant: +0:337 3 (const int) +0:337 'dati' ( temp mediump int) +0:338 imageAtomicCompSwap ( global highp uint) +0:338 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:338 'P' ( uniform mediump 2-component vector of int) +0:338 Constant: +0:338 5 (const uint) +0:338 'datu' ( temp mediump uint) +0:340 imageAtomicMax ( global highp int) +0:340 'badIm2Di' (layout( rgba16i) uniform highp iimage2D) +0:340 'P' ( uniform mediump 2-component vector of int) +0:340 'dati' ( temp mediump int) +0:341 imageAtomicMax ( global highp uint) +0:341 'badIm2Du' (layout( rgba8ui) uniform highp uimage2D) +0:341 'P' ( uniform mediump 2-component vector of int) +0:341 'datu' ( temp mediump uint) +0:342 imageAtomicExchange ( global highp float) +0:342 'badIm2Df' (layout( rgba32f) uniform highp image2D) +0:342 'P' ( uniform mediump 2-component vector of int) +0:342 'datf' ( temp mediump float) +0:353 Function Definition: badInterp( ( global void) +0:353 Function Parameters: +0:355 Sequence +0:355 interpolateAtCentroid ( global mediump 2-component vector of float) +0:355 'colorfc' ( centroid flat in mediump 2-component vector of float) +0:356 interpolateAtSample ( global mediump 2-component vector of float) +0:356 'colorfc' ( centroid flat in mediump 2-component vector of float) +0:356 Constant: +0:356 1 (const int) +0:357 interpolateAtOffset ( global mediump 2-component vector of float) +0:357 'colorfc' ( centroid flat in mediump 2-component vector of float) +0:357 Constant: +0:357 0.200000 +0:357 0.200000 +0:369 Function Definition: interp( ( global void) +0:369 Function Parameters: +0:? Sequence +0:376 move second child to first child ( temp mediump 2-component vector of float) +0:376 'res2' ( temp mediump 2-component vector of float) +0:376 interpolateAtCentroid ( global mediump 2-component vector of float) +0:376 'colorfc' ( centroid flat in mediump 2-component vector of float) +0:377 move second child to first child ( temp mediump 4-component vector of float) +0:377 'res4' ( temp mediump 4-component vector of float) +0:377 interpolateAtCentroid ( global mediump 4-component vector of float) +0:377 'colorSampIn' ( smooth sample in mediump 4-component vector of float) +0:378 move second child to first child ( temp mediump 4-component vector of float) +0:378 'res4' ( temp mediump 4-component vector of float) +0:378 interpolateAtCentroid ( global mediump 4-component vector of float) +0:378 'colorfsi' ( flat sample in mediump 4-component vector of float) +0:379 move second child to first child ( temp mediump float) +0:379 'res' ( temp mediump float) +0:379 interpolateAtCentroid ( global mediump float) +0:379 'scalarIn' ( smooth in mediump float) +0:380 'res3' ( temp mediump 3-component vector of float) +0:381 move second child to first child ( temp mediump 3-component vector of float) +0:381 'res3' ( temp mediump 3-component vector of float) +0:381 interpolateAtCentroid ( global mediump 3-component vector of float) +0:381 direct index ( smooth sample temp mediump 3-component vector of float) +0:381 'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float) +0:381 Constant: +0:381 2 (const int) +0:382 move second child to first child ( temp mediump 2-component vector of float) +0:382 'res2' ( temp mediump 2-component vector of float) +0:382 interpolateAtCentroid ( global mediump 2-component vector of float) +0:382 vector swizzle ( temp mediump 2-component vector of float) +0:382 direct index ( smooth sample temp mediump 3-component vector of float) +0:382 'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float) +0:382 Constant: +0:382 2 (const int) +0:382 Sequence +0:382 Constant: +0:382 0 (const int) +0:382 Constant: +0:382 1 (const int) +0:384 'res3' ( temp mediump 3-component vector of float) +0:385 move second child to first child ( temp mediump 3-component vector of float) +0:385 'res3' ( temp mediump 3-component vector of float) +0:385 interpolateAtSample ( global mediump 3-component vector of float) +0:385 indirect index ( smooth sample temp mediump 3-component vector of float) +0:385 'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float) +0:385 'i' ( uniform mediump int) +0:385 Constant: +0:385 0 (const int) +0:386 move second child to first child ( temp mediump 2-component vector of float) +0:386 'res2' ( temp mediump 2-component vector of float) +0:386 interpolateAtSample ( global mediump 2-component vector of float) +0:386 vector swizzle ( temp mediump 2-component vector of float) +0:386 direct index ( smooth sample temp mediump 3-component vector of float) +0:386 'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float) +0:386 Constant: +0:386 2 (const int) +0:386 Sequence +0:386 Constant: +0:386 0 (const int) +0:386 Constant: +0:386 1 (const int) +0:386 Constant: +0:386 2 (const int) +0:387 move second child to first child ( temp mediump float) +0:387 'res' ( temp mediump float) +0:387 interpolateAtSample ( global mediump float) +0:387 'scalarIn' ( smooth in mediump float) +0:387 Constant: +0:387 1 (const int) +0:389 'res3' ( temp mediump 3-component vector of float) +0:390 move second child to first child ( temp mediump 3-component vector of float) +0:390 'res3' ( temp mediump 3-component vector of float) +0:390 interpolateAtOffset ( global mediump 3-component vector of float) +0:390 direct index ( smooth sample temp mediump 3-component vector of float) +0:390 'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float) +0:390 Constant: +0:390 2 (const int) +0:390 Constant: +0:390 0.200000 +0:390 0.200000 +0:391 move second child to first child ( temp mediump 2-component vector of float) +0:391 'res2' ( temp mediump 2-component vector of float) +0:391 interpolateAtOffset ( global mediump 2-component vector of float) +0:391 vector swizzle ( temp mediump 2-component vector of float) +0:391 direct index ( smooth sample temp mediump 3-component vector of float) +0:391 'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float) +0:391 Constant: +0:391 2 (const int) +0:391 Sequence +0:391 Constant: +0:391 0 (const int) +0:391 Constant: +0:391 1 (const int) +0:391 Constant: +0:391 0.200000 +0:391 0.200000 +0:392 move second child to first child ( temp mediump float) +0:392 'res' ( temp mediump float) +0:392 interpolateAtOffset ( global mediump float) +0:392 add ( temp mediump float) +0:392 'scalarIn' ( smooth in mediump float) +0:392 'scalarIn' ( smooth in mediump float) +0:392 Constant: +0:392 0.200000 +0:392 0.200000 +0:393 move second child to first child ( temp mediump float) +0:393 'res' ( temp mediump float) +0:393 interpolateAtOffset ( global mediump float) +0:393 'scalarIn' ( smooth in mediump float) +0:393 Constant: +0:393 0.200000 +0:393 0.200000 +0:396 move second child to first child ( temp mediump float) +0:396 'res' ( temp mediump float) +0:396 interpolateAtCentroid ( global mediump float) +0:396 'f' ( temp mediump float) +0:397 move second child to first child ( temp mediump 4-component vector of float) +0:397 'res4' ( temp mediump 4-component vector of float) +0:397 interpolateAtSample ( global mediump 4-component vector of float) +0:397 'outp' ( out mediump 4-component vector of float) +0:397 Constant: +0:397 0 (const int) +0:427 Function Definition: blendFoo( ( temp void) +0:427 Function Parameters: +0:428 Function Definition: blendFoo(vf3; ( global void) +0:428 Function Parameters: +0:428 'v' ( in mediump 3-component vector of float) +0:433 Function Definition: devi( ( global void) +0:433 Function Parameters: +0:435 Sequence +0:435 'gl_DeviceIndex' ( flat in highp int DeviceIndex) +0:436 'gl_ViewIndex' ( flat in highp int ViewIndex) +0:447 Function Definition: devie( ( global void) +0:447 Function Parameters: +0:449 Sequence +0:449 'gl_DeviceIndex' ( flat in highp int DeviceIndex) +0:450 'gl_ViewIndex' ( flat in highp int ViewIndex) +0:? Linker Objects +0:? 'gl_FragCoord' ( smooth in mediump 4-component vector of float) +0:? 'v3' (layout( location=2) smooth in mediump 3-component vector of float) +0:? 'yi' (layout( location=2) smooth in mediump 4X4 matrix of float) +0:? 'arrayedSampler' ( uniform 5-element array of highp sampler2D) +0:? 'usamp2d' ( uniform highp usampler2D) +0:? 'samp2dr' ( uniform mediump usampler2DRect) +0:? 'isamp2DA' ( uniform highp isampler2DArray) +0:? 'c2D' ( smooth in mediump 2-component vector of float) +0:? 'i' ( uniform mediump int) +0:? 'outp' ( out mediump 4-component vector of float) +0:? 's1' (layout( binding=3) uniform highp sampler2D) +0:? 's2' (layout( binding=3) uniform highp sampler2D) +0:? 'i2D' (layout( binding=2) writeonly uniform highp image2D) +0:? 'i3D' (layout( binding=4) readonly uniform mediump image3D) +0:? 'iCube' (layout( binding=5) uniform mediump imageCube) +0:? 'i2DA' (layout( binding=6) uniform mediump image2DArray) +0:? 'i2Dqualified' (layout( binding=6) coherent volatile restrict uniform mediump image2D) +0:? 'bbi' (layout( binding=1 column_major shared) uniform block{layout( column_major shared) uniform mediump int foo, layout( binding=2 column_major shared) uniform mediump float f}) +0:? 'centroidIn' ( centroid smooth in mediump 4-component vector of float) +0:? 'bigl' ( uniform mediump 4-component vector of float) +0:? 'bigout1' (layout( location=40) out mediump 4-component vector of float) +0:? 'bigout2' (layout( location=40) out mediump 4-component vector of float) +0:? 'neg' ( out mediump 4-component vector of float) +0:? 'b430i' (layout( column_major std430) buffer block{layout( column_major std430 offset=0) buffer mediump int i}) +0:? 'bshari' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump int i}) +0:? 'smoothIn' ( smooth in mediump 4-component vector of float) +0:? 'flatIn' ( flat in mediump int) +0:? 's2dms' ( uniform mediump sampler2DMS) +0:? 'bout' ( out bool) +0:? 'imageOut' ( out highp image2D) +0:? 'mout' ( out mediump 2X3 matrix of float) +0:? 'inb' ( smooth in bool) +0:? 'ino' ( smooth in highp sampler2D) +0:? 'ina' ( smooth in 4-element array of mediump float) +0:? 'inaa' ( smooth in 4-element array of 2-element array of mediump float) +0:? 'ins' ( smooth in structure{ global mediump float f}) +0:? 'inasa' ( smooth in 4-element array of structure{ global mediump float f}) +0:? 'insa' ( smooth in 4-element array of structure{ global mediump float f}) +0:? 'inSA' ( smooth in structure{ global 4-element array of mediump float f}) +0:? 'inSS' ( smooth in structure{ global mediump float f, global structure{ global mediump float f} s}) +0:? 'outbinst' ( out block{ out mediump int a}) +0:? 'inbinst' ( in block{ in mediump int a, in mediump 4-component vector of float v, in structure{ global mediump int b} s}) +0:? 'anon@0' ( in block{layout( location=12) in mediump int aAnon, layout( location=13) centroid in mediump 4-component vector of float vAnon}) +0:? 'aliased' (layout( location=13) smooth in mediump 4-component vector of float) +0:? 'arrayedInst' ( in 4-element array of block{ in mediump float f}) +0:? 'gl_FragDepth' ( gl_FragDepth highp float FragDepth) +0:? 'inf' ( smooth in mediump 2-component vector of float) +0:? 'ing' ( smooth in mediump 2-component vector of float) +0:? 'offsets' ( uniform 4-element array of mediump 2-component vector of int) +0:? 'sArray' ( uniform 4-element array of highp sampler2D) +0:? 'sIndex' ( uniform mediump int) +0:? 'auArray' (layout( binding=0 offset=0) uniform 2-element array of highp atomic_uint) +0:? 'ubInst' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform mediump int i}) +0:? 'bbInst' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer mediump int i}) +0:? 'iArray' ( writeonly uniform 5-element array of highp image2D) +0:? 'constOffsets' ( const 4-element array of mediump 2-component vector of int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 'CA1' ( writeonly uniform highp imageCubeArray) +0:? 'CA2' ( writeonly uniform highp iimageCubeArray) +0:? 'CA3' ( writeonly uniform highp uimageCubeArray) +0:? 'CA4' ( uniform highp samplerCubeArray) +0:? 'CA5' ( uniform highp samplerCubeArrayShadow) +0:? 'CA6' ( uniform highp isamplerCubeArray) +0:? 'CA7' ( uniform highp usamplerCubeArray) +0:? 'gl_SampleMaskIn' ( flat in unsized 1-element array of highp int SampleMaskIn) +0:? 'gl_SampleMask' ( out unsized 1-element array of highp int SampleMaskIn) +0:? 'im2Df' (layout( r32f) uniform highp image2D) +0:? 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:? 'im2Di' (layout( r32i) uniform highp iimage2D) +0:? 'P' ( uniform mediump 2-component vector of int) +0:? 'badIm2Df' (layout( rgba32f) uniform highp image2D) +0:? 'badIm2Du' (layout( rgba8ui) uniform highp uimage2D) +0:? 'badIm2Di' (layout( rgba16i) uniform highp iimage2D) +0:? 'colorSampInBad' ( smooth sample in mediump 4-component vector of float) +0:? 'colorCentroidBad' ( centroid out mediump 4-component vector of float) +0:? 'colorBadFlat' ( flat out mediump 4-component vector of float) +0:? 'colorBadSmooth' ( smooth out mediump 4-component vector of float) +0:? 'colorBadNo' ( noperspective out mediump 4-component vector of float) +0:? 'colorfc' ( centroid flat in mediump 2-component vector of float) +0:? 'scalarIn' ( smooth in mediump float) +0:? 'colorSampIn' ( smooth sample in mediump 4-component vector of float) +0:? 'colorSampleBad' ( sample out mediump 4-component vector of float) +0:? 'colorfsi' ( flat sample in mediump 4-component vector of float) +0:? 'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float) +0:? 'badout' ( out mediump 4-component vector of float) +0:? 'outAA' ( out 2-element array of 2-element array of mediump 4-component vector of float) + + +Linked fragment stage: + +ERROR: Linking fragment stage: when more than one fragment shader output, all must have location qualifiers + +Shader version: 310 +Requested GL_EXT_device_group +Requested GL_EXT_multiview +Requested GL_EXT_shader_io_blocks +Requested GL_EXT_texture_cube_map_array +Requested GL_KHR_blend_equation_advanced +Requested GL_OES_geometry_shader +Requested GL_OES_gpu_shader5 +Requested GL_OES_sample_variables +Requested GL_OES_shader_image_atomic +Requested GL_OES_shader_io_blocks +Requested GL_OES_shader_multisample_interpolation +gl_FragCoord pixel center is integer +gl_FragCoord origin is upper left +using early_fragment_tests +using depth_any +using blend_support_multiply blend_support_screen blend_support_overlay blend_support_darken blend_support_lighten blend_support_colordodge blend_support_colorburn blend_support_hardlight blend_support_softlight blend_support_difference blend_support_exclusion blend_support_hsl_hue blend_support_hsl_saturation blend_support_hsl_color blend_support_hsl_luminosity blend_support_all_equations +ERROR: node is still EOpNull! +0:21 Function Definition: main( ( global void) +0:21 Function Parameters: +0:23 Sequence +0:23 Sequence +0:23 move second child to first child ( temp highp 4-component vector of float) +0:23 'v' ( temp mediump 4-component vector of float) +0:23 texture ( global highp 4-component vector of float) +0:23 indirect index ( temp highp sampler2D) +0:23 'arrayedSampler' ( uniform 5-element array of highp sampler2D) +0:23 'i' ( uniform mediump int) +0:23 'c2D' ( smooth in mediump 2-component vector of float) +0:28 Sequence +0:28 move second child to first child ( temp highp 4-component vector of float) +0:28 'v4' ( temp mediump 4-component vector of float) +0:28 textureGather ( global highp 4-component vector of float) +0:28 direct index ( temp highp sampler2D) +0:28 'arrayedSampler' ( uniform 5-element array of highp sampler2D) +0:28 Constant: +0:28 0 (const int) +0:28 'c2D' ( smooth in mediump 2-component vector of float) +0:29 Sequence +0:29 move second child to first child ( temp highp 4-component vector of int) +0:29 'iv4' ( temp mediump 4-component vector of int) +0:29 textureGatherOffset ( global highp 4-component vector of int) +0:29 'isamp2DA' ( uniform highp isampler2DArray) +0:29 Constant: +0:29 0.100000 +0:29 0.100000 +0:29 0.100000 +0:29 Constant: +0:29 1 (const int) +0:29 1 (const int) +0:29 Constant: +0:29 3 (const int) +0:30 move second child to first child ( temp highp 4-component vector of int) +0:30 'iv4' ( temp mediump 4-component vector of int) +0:30 textureGatherOffset ( global highp 4-component vector of int) +0:30 'isamp2DA' ( uniform highp isampler2DArray) +0:30 Constant: +0:30 0.100000 +0:30 0.100000 +0:30 0.100000 +0:30 Constant: +0:30 1 (const int) +0:30 1 (const int) +0:30 'i' ( uniform mediump int) +0:31 move second child to first child ( temp highp 4-component vector of int) +0:31 'iv4' ( temp mediump 4-component vector of int) +0:31 textureGatherOffset ( global highp 4-component vector of int) +0:31 'isamp2DA' ( uniform highp isampler2DArray) +0:31 Constant: +0:31 0.100000 +0:31 0.100000 +0:31 0.100000 +0:31 Constant: +0:31 1 (const int) +0:31 1 (const int) +0:31 Constant: +0:31 4 (const int) +0:32 move second child to first child ( temp highp 4-component vector of int) +0:32 'iv4' ( temp mediump 4-component vector of int) +0:32 textureGatherOffset ( global highp 4-component vector of int) +0:32 'isamp2DA' ( uniform highp isampler2DArray) +0:32 Constant: +0:32 0.100000 +0:32 0.100000 +0:32 0.100000 +0:32 Constant: +0:32 1 (const int) +0:32 1 (const int) +0:32 Constant: +0:32 3 (const int) +0:33 move second child to first child ( temp highp 4-component vector of int) +0:33 'iv4' ( temp mediump 4-component vector of int) +0:33 textureGatherOffset ( global highp 4-component vector of int) +0:33 'isamp2DA' ( uniform highp isampler2DArray) +0:33 Constant: +0:33 0.100000 +0:33 0.100000 +0:33 0.100000 +0:33 Constant: +0:33 0 (const int) +0:33 0 (const int) +0:34 move second child to first child ( temp highp 4-component vector of int) +0:34 'iv4' ( temp mediump 4-component vector of int) +0:34 textureGatherOffset ( global highp 4-component vector of int) +0:34 'isamp2DA' ( uniform highp isampler2DArray) +0:34 Constant: +0:34 0.100000 +0:34 0.100000 +0:34 0.100000 +0:34 Construct ivec2 ( temp highp 2-component vector of int) +0:34 'i' ( uniform mediump int) +0:? Linker Objects +0:? 'gl_FragCoord' ( smooth in mediump 4-component vector of float) +0:? 'v3' (layout( location=2) smooth in mediump 3-component vector of float) +0:? 'yi' (layout( location=2) smooth in mediump 4X4 matrix of float) +0:? 'arrayedSampler' ( uniform 5-element array of highp sampler2D) +0:? 'usamp2d' ( uniform highp usampler2D) +0:? 'samp2dr' ( uniform mediump usampler2DRect) +0:? 'isamp2DA' ( uniform highp isampler2DArray) +0:? 'c2D' ( smooth in mediump 2-component vector of float) +0:? 'i' ( uniform mediump int) +0:? 'outp' ( out mediump 4-component vector of float) +0:? 's1' (layout( binding=3) uniform highp sampler2D) +0:? 's2' (layout( binding=3) uniform highp sampler2D) +0:? 'i2D' (layout( binding=2) writeonly uniform highp image2D) +0:? 'i3D' (layout( binding=4) readonly uniform mediump image3D) +0:? 'iCube' (layout( binding=5) uniform mediump imageCube) +0:? 'i2DA' (layout( binding=6) uniform mediump image2DArray) +0:? 'i2Dqualified' (layout( binding=6) coherent volatile restrict uniform mediump image2D) +0:? 'bbi' (layout( binding=1 column_major shared) uniform block{layout( column_major shared) uniform mediump int foo, layout( binding=2 column_major shared) uniform mediump float f}) +0:? 'centroidIn' ( centroid smooth in mediump 4-component vector of float) +0:? 'bigl' ( uniform mediump 4-component vector of float) +0:? 'bigout1' (layout( location=40) out mediump 4-component vector of float) +0:? 'bigout2' (layout( location=40) out mediump 4-component vector of float) +0:? 'neg' ( out mediump 4-component vector of float) +0:? 'b430i' (layout( column_major std430) buffer block{layout( column_major std430 offset=0) buffer mediump int i}) +0:? 'bshari' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump int i}) +0:? 'smoothIn' ( smooth in mediump 4-component vector of float) +0:? 'flatIn' ( flat in mediump int) +0:? 's2dms' ( uniform mediump sampler2DMS) +0:? 'bout' ( out bool) +0:? 'imageOut' ( out highp image2D) +0:? 'mout' ( out mediump 2X3 matrix of float) +0:? 'inb' ( smooth in bool) +0:? 'ino' ( smooth in highp sampler2D) +0:? 'ina' ( smooth in 4-element array of mediump float) +0:? 'inaa' ( smooth in 4-element array of 2-element array of mediump float) +0:? 'ins' ( smooth in structure{ global mediump float f}) +0:? 'inasa' ( smooth in 4-element array of structure{ global mediump float f}) +0:? 'insa' ( smooth in 4-element array of structure{ global mediump float f}) +0:? 'inSA' ( smooth in structure{ global 4-element array of mediump float f}) +0:? 'inSS' ( smooth in structure{ global mediump float f, global structure{ global mediump float f} s}) +0:? 'outbinst' ( out block{ out mediump int a}) +0:? 'inbinst' ( in block{ in mediump int a, in mediump 4-component vector of float v, in structure{ global mediump int b} s}) +0:? 'anon@0' ( in block{layout( location=12) in mediump int aAnon, layout( location=13) centroid in mediump 4-component vector of float vAnon}) +0:? 'aliased' (layout( location=13) smooth in mediump 4-component vector of float) +0:? 'arrayedInst' ( in 4-element array of block{ in mediump float f}) +0:? 'gl_FragDepth' ( gl_FragDepth highp float FragDepth) +0:? 'inf' ( smooth in mediump 2-component vector of float) +0:? 'ing' ( smooth in mediump 2-component vector of float) +0:? 'offsets' ( uniform 4-element array of mediump 2-component vector of int) +0:? 'sArray' ( uniform 4-element array of highp sampler2D) +0:? 'sIndex' ( uniform mediump int) +0:? 'auArray' (layout( binding=0 offset=0) uniform 2-element array of highp atomic_uint) +0:? 'ubInst' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform mediump int i}) +0:? 'bbInst' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer mediump int i}) +0:? 'iArray' ( writeonly uniform 5-element array of highp image2D) +0:? 'constOffsets' ( const 4-element array of mediump 2-component vector of int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 'CA1' ( writeonly uniform highp imageCubeArray) +0:? 'CA2' ( writeonly uniform highp iimageCubeArray) +0:? 'CA3' ( writeonly uniform highp uimageCubeArray) +0:? 'CA4' ( uniform highp samplerCubeArray) +0:? 'CA5' ( uniform highp samplerCubeArrayShadow) +0:? 'CA6' ( uniform highp isamplerCubeArray) +0:? 'CA7' ( uniform highp usamplerCubeArray) +0:? 'gl_SampleMaskIn' ( flat in 1-element array of highp int SampleMaskIn) +0:? 'gl_SampleMask' ( out 1-element array of highp int SampleMaskIn) +0:? 'im2Df' (layout( r32f) uniform highp image2D) +0:? 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:? 'im2Di' (layout( r32i) uniform highp iimage2D) +0:? 'P' ( uniform mediump 2-component vector of int) +0:? 'badIm2Df' (layout( rgba32f) uniform highp image2D) +0:? 'badIm2Du' (layout( rgba8ui) uniform highp uimage2D) +0:? 'badIm2Di' (layout( rgba16i) uniform highp iimage2D) +0:? 'colorSampInBad' ( smooth sample in mediump 4-component vector of float) +0:? 'colorCentroidBad' ( centroid out mediump 4-component vector of float) +0:? 'colorBadFlat' ( flat out mediump 4-component vector of float) +0:? 'colorBadSmooth' ( smooth out mediump 4-component vector of float) +0:? 'colorBadNo' ( noperspective out mediump 4-component vector of float) +0:? 'colorfc' ( centroid flat in mediump 2-component vector of float) +0:? 'scalarIn' ( smooth in mediump float) +0:? 'colorSampIn' ( smooth sample in mediump 4-component vector of float) +0:? 'colorSampleBad' ( sample out mediump 4-component vector of float) +0:? 'colorfsi' ( flat sample in mediump 4-component vector of float) +0:? 'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float) +0:? 'badout' ( out mediump 4-component vector of float) +0:? 'outAA' ( out 2-element array of 2-element array of mediump 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/310.geom.out b/deps/glslang/Test/baseResults/310.geom.out new file mode 100644 index 00000000..b0dabc3b --- /dev/null +++ b/deps/glslang/Test/baseResults/310.geom.out @@ -0,0 +1,277 @@ +310.geom +ERROR: 0:29: 'fromVertex' : block instance name redefinition +ERROR: 0:33: 'fromVertex' : redefinition +ERROR: 0:35: 'fooC' : block instance name redefinition +ERROR: 0:43: 'EmitStreamVertex' : no matching overloaded function found +ERROR: 0:44: 'EndStreamPrimitive' : no matching overloaded function found +ERROR: 0:47: 'gl_ClipDistance' : undeclared identifier +ERROR: 0:47: 'gl_ClipDistance' : left of '[' is not of type array, matrix, or vector +ERROR: 0:48: 'gl_ClipDistance' : no such field in structure +ERROR: 0:48: 'expression' : left of '[' is not of type array, matrix, or vector +ERROR: 0:47: 'assign' : l-value required (can't modify a const) +ERROR: 0:55: 'selecting output stream' : not supported with this profile: es +ERROR: 0:62: 'max_vertices' : too large, must be less than gl_MaxGeometryOutputVertices +ERROR: 0:62: 'max_vertices' : cannot change previously set layout value +ERROR: 0:63: 'max_vertices' : can only apply to a standalone qualifier +ERROR: 0:68: 'points' : cannot change previously set output primitive +ERROR: 0:69: 'points' : cannot change previously set output primitive +ERROR: 0:70: 'triangle_strip' : cannot apply to input +ERROR: 0:71: 'triangle_strip' : cannot apply to: uniform +ERROR: 0:72: 'triangle_strip' : can only apply to a standalone qualifier +ERROR: 0:73: 'triangle_strip' : can only apply to a standalone qualifier +ERROR: 0:74: 'invocations' : can only apply to a standalone qualifier +ERROR: 0:76: 'invocations' : can only apply to a standalone qualifier +ERROR: 0:77: 'max_vertices' : can only apply to a standalone qualifier +ERROR: 0:78: 'triangle_strip' : can only apply to a standalone qualifier +ERROR: 0:81: 'lines' : cannot apply to 'out' +ERROR: 0:83: 'triangles' : cannot change previously set input primitive +ERROR: 0:84: 'triangles_adjacency' : cannot change previously set input primitive +ERROR: 0:116: 'gl_ViewportIndex' : undeclared identifier +ERROR: 0:117: 'gl_MaxViewports' : undeclared identifier +ERROR: 0:123: 'lines_adjacency' : inconsistent input primitive for array size of explArrayBad +ERROR: 0:124: 'in' : type must be an array: nonArrayed +ERROR: 0:128: 'sample' : Reserved word. +ERROR: 0:132: 'component' : not supported with this profile: es +ERROR: 0:136: 'gl_MaxGeometryVaryingComponents' : undeclared identifier +ERROR: 0:137: 'gl_VerticesIn' : undeclared identifier +ERROR: 0:142: 'gl_PointSize' : required extension not requested: Possible extensions include: +GL_EXT_geometry_point_size +GL_OES_geometry_point_size +ERROR: 0:143: 'gl_PointSize' : required extension not requested: Possible extensions include: +GL_EXT_geometry_point_size +GL_OES_geometry_point_size +ERROR: 37 compilation errors. No code generated. + + +Shader version: 310 +Requested GL_EXT_geometry_shader +Requested GL_EXT_shader_io_blocks +Requested GL_OES_geometry_point_size +invocations = 4 +max_vertices = 200 +input primitive = lines_adjacency +output primitive = triangle_strip +ERROR: node is still EOpNull! +0:39 Function Definition: main( ( global void) +0:39 Function Parameters: +0:41 Sequence +0:41 EmitVertex ( global void) +0:42 EndPrimitive ( global void) +0:43 Constant: +0:43 0.000000 +0:44 Constant: +0:44 0.000000 +0:46 move second child to first child ( temp mediump 3-component vector of float) +0:46 color: direct index for structure (layout( stream=0) out mediump 3-component vector of float) +0:46 'anon@0' (layout( stream=0) out block{layout( stream=0) out mediump 3-component vector of float color}) +0:46 Constant: +0:46 0 (const uint) +0:46 color: direct index for structure ( in mediump 3-component vector of float) +0:46 direct index ( temp block{ in mediump 3-component vector of float color}) +0:46 'fromV' ( in 4-element array of block{ in mediump 3-component vector of float color}) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 0 (const int) +0:47 move second child to first child ( temp float) +0:47 Constant: +0:47 0.000000 +0:48 Constant: +0:48 0.000000 +0:49 move second child to first child ( temp highp 4-component vector of float) +0:49 gl_Position: direct index for structure (layout( stream=0) gl_Position highp 4-component vector of float Position) +0:49 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position highp 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize highp float PointSize gl_PointSize}) +0:49 Constant: +0:49 0 (const uint) +0:49 gl_Position: direct index for structure ( in highp 4-component vector of float Position) +0:49 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize}) +0:49 'gl_in' ( in 4-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize}) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 0 (const int) +0:51 move second child to first child ( temp highp int) +0:51 'gl_PrimitiveID' (layout( stream=0) out highp int PrimitiveID) +0:51 'gl_PrimitiveIDIn' ( in highp int PrimitiveID) +0:52 move second child to first child ( temp highp int) +0:52 'gl_Layer' (layout( stream=0) out highp int Layer) +0:52 Constant: +0:52 2 (const int) +0:63 Function Definition: foo(i1; ( global void) +0:63 Function Parameters: +0:63 'a' ( in highp int) +0:65 Sequence +0:65 move second child to first child ( temp mediump 4-component vector of float) +0:65 a: direct index for structure (layout( stream=0) out mediump 4-component vector of float) +0:65 'ouuaa6' (layout( stream=0) out block{layout( stream=0) out mediump 4-component vector of float a}) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 1.000000 +0:65 1.000000 +0:65 1.000000 +0:65 1.000000 +0:114 Function Definition: fooe1( ( global void) +0:114 Function Parameters: +0:116 Sequence +0:116 'gl_ViewportIndex' ( temp float) +0:117 'gl_MaxViewports' ( temp float) +0:118 Constant: +0:118 4 (const int) +0:119 Sequence +0:119 move second child to first child ( temp highp int) +0:119 'inv' ( temp highp int) +0:119 'gl_InvocationID' ( in highp int InvocationID) +0:134 Function Definition: notHere( ( global void) +0:134 Function Parameters: +0:136 Sequence +0:136 'gl_MaxGeometryVaryingComponents' ( temp float) +0:137 'gl_VerticesIn' ( temp float) +0:140 Function Definition: pointSize1( ( global void) +0:140 Function Parameters: +0:142 Sequence +0:142 Sequence +0:142 move second child to first child ( temp highp float) +0:142 'ps' ( temp highp float) +0:142 gl_PointSize: direct index for structure ( in highp float PointSize) +0:142 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize}) +0:142 'gl_in' ( in 4-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize}) +0:142 Constant: +0:142 3 (const int) +0:142 Constant: +0:142 1 (const int) +0:143 move second child to first child ( temp highp float) +0:143 gl_PointSize: direct index for structure (layout( stream=0) gl_PointSize highp float PointSize) +0:143 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position highp 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize highp float PointSize gl_PointSize}) +0:143 Constant: +0:143 1 (const uint) +0:143 'ps' ( temp highp float) +0:148 Function Definition: pointSize2( ( global void) +0:148 Function Parameters: +0:150 Sequence +0:150 Sequence +0:150 move second child to first child ( temp highp float) +0:150 'ps' ( temp highp float) +0:150 gl_PointSize: direct index for structure ( in highp float PointSize) +0:150 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize}) +0:150 'gl_in' ( in 4-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize}) +0:150 Constant: +0:150 3 (const int) +0:150 Constant: +0:150 1 (const int) +0:151 move second child to first child ( temp highp float) +0:151 gl_PointSize: direct index for structure (layout( stream=0) gl_PointSize highp float PointSize) +0:151 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position highp 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize highp float PointSize gl_PointSize}) +0:151 Constant: +0:151 1 (const uint) +0:151 'ps' ( temp highp float) +0:? Linker Objects +0:? 'fromV' ( in 4-element array of block{ in mediump 3-component vector of float color}) +0:? 'nonBlockUnsized' ( in 4-element array of mediump 4-component vector of float) +0:? 'toF' (layout( stream=0) out block{layout( stream=0) out mediump 3-component vector of float color}) +0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) out mediump 3-component vector of float color}) +0:? 'gl_in' ( in 4-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize}) +0:? 'ov4' (layout( stream=4) out mediump 4-component vector of float) +0:? 'ouuaa6' (layout( stream=0) out block{layout( stream=0) out mediump 4-component vector of float a}) +0:? 'badv4' (layout( stream=0) out mediump 4-component vector of float) +0:? 'bad2v4' ( in 4-element array of mediump 4-component vector of float) +0:? 'anon@1' (layout( stream=0) out block{layout( stream=0) out highp int a}) +0:? 'outbi' (layout( stream=0) out block{layout( stream=0) out highp int a, layout( stream=0) out highp int b, layout( stream=0) out highp int c}) +0:? 'insn' ( in 4-element array of block{ in highp int a15}) +0:? 'anon@2' (layout( stream=0) out block{layout( stream=0) out mediump float f15}) +0:? 'anon@3' (layout( column_major shared) uniform block{layout( column_major shared) uniform bool b15}) +0:? 'summ' ( const highp int) +0:? 2752 (const int) +0:? 'explArray' ( in 4-element array of mediump 4-component vector of float) +0:? 'explArrayBad' ( in 5-element array of mediump 4-component vector of float) +0:? 'nonArrayed' ( in mediump 4-component vector of float) +0:? 'myColor1' (layout( stream=0) flat out mediump 3-component vector of float) +0:? 'myColor2' (layout( stream=0) centroid out mediump 3-component vector of float) +0:? 'centr' ( centroid in 4-element array of mediump 3-component vector of float) +0:? 'perSampleColor' (layout( stream=0) sample out mediump 4-component vector of float) +0:? 'comp' (layout( location=7 component=2) in 4-element array of mediump float) + + +Linked geometry stage: + + +Shader version: 310 +Requested GL_EXT_geometry_shader +Requested GL_EXT_shader_io_blocks +Requested GL_OES_geometry_point_size +invocations = 4 +max_vertices = 200 +input primitive = lines_adjacency +output primitive = triangle_strip +ERROR: node is still EOpNull! +0:39 Function Definition: main( ( global void) +0:39 Function Parameters: +0:41 Sequence +0:41 EmitVertex ( global void) +0:42 EndPrimitive ( global void) +0:43 Constant: +0:43 0.000000 +0:44 Constant: +0:44 0.000000 +0:46 move second child to first child ( temp mediump 3-component vector of float) +0:46 color: direct index for structure (layout( stream=0) out mediump 3-component vector of float) +0:46 'anon@0' (layout( stream=0) out block{layout( stream=0) out mediump 3-component vector of float color}) +0:46 Constant: +0:46 0 (const uint) +0:46 color: direct index for structure ( in mediump 3-component vector of float) +0:46 direct index ( temp block{ in mediump 3-component vector of float color}) +0:46 'fromV' ( in 4-element array of block{ in mediump 3-component vector of float color}) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 0 (const int) +0:47 move second child to first child ( temp float) +0:47 Constant: +0:47 0.000000 +0:48 Constant: +0:48 0.000000 +0:49 move second child to first child ( temp highp 4-component vector of float) +0:49 gl_Position: direct index for structure (layout( stream=0) gl_Position highp 4-component vector of float Position) +0:49 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position highp 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize highp float PointSize gl_PointSize}) +0:49 Constant: +0:49 0 (const uint) +0:49 gl_Position: direct index for structure ( in highp 4-component vector of float Position) +0:49 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize}) +0:49 'gl_in' ( in 4-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize}) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 0 (const int) +0:51 move second child to first child ( temp highp int) +0:51 'gl_PrimitiveID' (layout( stream=0) out highp int PrimitiveID) +0:51 'gl_PrimitiveIDIn' ( in highp int PrimitiveID) +0:52 move second child to first child ( temp highp int) +0:52 'gl_Layer' (layout( stream=0) out highp int Layer) +0:52 Constant: +0:52 2 (const int) +0:? Linker Objects +0:? 'fromV' ( in 4-element array of block{ in mediump 3-component vector of float color}) +0:? 'nonBlockUnsized' ( in 4-element array of mediump 4-component vector of float) +0:? 'toF' (layout( stream=0) out block{layout( stream=0) out mediump 3-component vector of float color}) +0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) out mediump 3-component vector of float color}) +0:? 'gl_in' ( in 4-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize}) +0:? 'ov4' (layout( stream=4) out mediump 4-component vector of float) +0:? 'ouuaa6' (layout( stream=0) out block{layout( stream=0) out mediump 4-component vector of float a}) +0:? 'badv4' (layout( stream=0) out mediump 4-component vector of float) +0:? 'bad2v4' ( in 4-element array of mediump 4-component vector of float) +0:? 'anon@1' (layout( stream=0) out block{layout( stream=0) out highp int a}) +0:? 'outbi' (layout( stream=0) out block{layout( stream=0) out highp int a, layout( stream=0) out highp int b, layout( stream=0) out highp int c}) +0:? 'insn' ( in 4-element array of block{ in highp int a15}) +0:? 'anon@2' (layout( stream=0) out block{layout( stream=0) out mediump float f15}) +0:? 'anon@3' (layout( column_major shared) uniform block{layout( column_major shared) uniform bool b15}) +0:? 'summ' ( const highp int) +0:? 2752 (const int) +0:? 'explArray' ( in 4-element array of mediump 4-component vector of float) +0:? 'explArrayBad' ( in 5-element array of mediump 4-component vector of float) +0:? 'nonArrayed' ( in mediump 4-component vector of float) +0:? 'myColor1' (layout( stream=0) flat out mediump 3-component vector of float) +0:? 'myColor2' (layout( stream=0) centroid out mediump 3-component vector of float) +0:? 'centr' ( centroid in 4-element array of mediump 3-component vector of float) +0:? 'perSampleColor' (layout( stream=0) sample out mediump 4-component vector of float) +0:? 'comp' (layout( location=7 component=2) in 4-element array of mediump float) + diff --git a/deps/glslang/Test/baseResults/310.tesc.out b/deps/glslang/Test/baseResults/310.tesc.out new file mode 100644 index 00000000..433a7dc1 --- /dev/null +++ b/deps/glslang/Test/baseResults/310.tesc.out @@ -0,0 +1,542 @@ +310.tesc +ERROR: 0:8: 'quads' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:9: 'ccw' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:10: 'fractional_even_spacing' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:12: 'patch' : can only use on output in tessellation-control shader +ERROR: 0:26: 'gl_PointSize' : required extension not requested: Possible extensions include: +GL_EXT_tessellation_point_size +GL_OES_tessellation_point_size +ERROR: 0:27: 'gl_ClipDistance' : no such field in structure +ERROR: 0:27: 'expression' : left of '[' is not of type array, matrix, or vector +ERROR: 0:34: 'gl_PointSize' : required extension not requested: Possible extensions include: +GL_EXT_tessellation_point_size +GL_OES_tessellation_point_size +ERROR: 0:35: 'gl_ClipDistance' : no such field in structure +ERROR: 0:35: 'expression' : left of '[' is not of type array, matrix, or vector +ERROR: 0:35: 'assign' : l-value required (can't modify a const) +ERROR: 0:41: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:43: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:48: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:53: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:56: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:63: '' : tessellation control barrier() cannot be placed after a return from main() +ERROR: 0:66: 'vertices' : can only apply to 'out' +ERROR: 0:67: 'vertices' : cannot change previously set layout value +ERROR: 0:71: '[' : array index out of range '4' +ERROR: 0:73: '' : tessellation control barrier() must be in main() +ERROR: 0:76: 'in' : type must be an array: ina +ERROR: 0:78: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized +ERROR: 0:80: '' : array size required +ERROR: 0:86: 'location' : overlapping use of location 4 +ERROR: 0:90: 'location' : overlapping use of location 4 +ERROR: 0:94: 'precise' : Reserved word. +ERROR: 0:94: 'precise' : not supported for this version or the enabled extensions +ERROR: 0:95: 'fma' : required extension not requested: Possible extensions include: +GL_EXT_gpu_shader5 +GL_OES_gpu_shader5 +ERROR: 0:104: 'sample' : Reserved word. +ERROR: 0:106: 'vertices' : can only apply to a standalone qualifier +ERROR: 0:107: 'vertices' : inconsistent output number of vertices for array size of misSized +ERROR: 0:133: 'gl_BoundingBoxOES' : required extension not requested: Possible extensions include: +GL_EXT_primitive_bounding_box +GL_OES_primitive_bounding_box +ERROR: 0:142: '[' : array index out of range '2' +ERROR: 0:145: '' : array size required +ERROR: 0:161: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID +ERROR: 0:162: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID +ERROR: 0:165: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID +ERROR: 38 compilation errors. No code generated. + + +Shader version: 310 +Requested GL_ARB_separate_shader_objects +Requested GL_OES_gpu_shader5 +Requested GL_OES_primitive_bounding_box +Requested GL_OES_shader_io_blocks +Requested GL_OES_tessellation_point_size +Requested GL_OES_tessellation_shader +vertices = 4 +ERROR: node is still EOpNull! +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:17 Sequence +0:17 Barrier ( global void) +0:19 Sequence +0:19 move second child to first child ( temp highp int) +0:19 'a' ( temp highp int) +0:19 Constant: +0:19 5392 (const int) +0:25 Sequence +0:25 move second child to first child ( temp highp 4-component vector of float) +0:25 'p' ( temp highp 4-component vector of float) +0:25 gl_Position: direct index for structure ( in highp 4-component vector of float Position) +0:25 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:25 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:25 Constant: +0:25 1 (const int) +0:25 Constant: +0:25 0 (const int) +0:26 Sequence +0:26 move second child to first child ( temp highp float) +0:26 'ps' ( temp highp float) +0:26 gl_PointSize: direct index for structure ( in highp float PointSize) +0:26 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:26 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:26 Constant: +0:26 1 (const int) +0:26 Constant: +0:26 1 (const int) +0:27 Sequence +0:27 move second child to first child ( temp highp float) +0:27 'cd' ( temp highp float) +0:27 Constant: +0:27 0.000000 +0:29 Sequence +0:29 move second child to first child ( temp highp int) +0:29 'pvi' ( temp highp int) +0:29 'gl_PatchVerticesIn' ( in highp int PatchVertices) +0:30 Sequence +0:30 move second child to first child ( temp highp int) +0:30 'pid' ( temp highp int) +0:30 'gl_PrimitiveID' ( in highp int PrimitiveID) +0:31 Sequence +0:31 move second child to first child ( temp highp int) +0:31 'iid' ( temp highp int) +0:31 'gl_InvocationID' ( in highp int InvocationID) +0:33 move second child to first child ( temp highp 4-component vector of float) +0:33 gl_Position: direct index for structure ( out highp 4-component vector of float Position) +0:33 indirect index ( temp block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:33 'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:33 'gl_InvocationID' ( in highp int InvocationID) +0:33 Constant: +0:33 0 (const int) +0:33 'p' ( temp highp 4-component vector of float) +0:34 move second child to first child ( temp highp float) +0:34 gl_PointSize: direct index for structure ( out highp float PointSize) +0:34 indirect index ( temp block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:34 'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:34 'gl_InvocationID' ( in highp int InvocationID) +0:34 Constant: +0:34 1 (const int) +0:34 'ps' ( temp highp float) +0:35 move second child to first child ( temp highp float) +0:35 Constant: +0:35 0.000000 +0:35 'cd' ( temp highp float) +0:37 move second child to first child ( temp highp float) +0:37 direct index ( patch temp highp float TessLevelOuter) +0:37 'gl_TessLevelOuter' ( patch out 4-element array of highp float TessLevelOuter) +0:37 Constant: +0:37 3 (const int) +0:37 Constant: +0:37 3.200000 +0:38 move second child to first child ( temp highp float) +0:38 direct index ( patch temp highp float TessLevelInner) +0:38 'gl_TessLevelInner' ( patch out 2-element array of highp float TessLevelInner) +0:38 Constant: +0:38 1 (const int) +0:38 Constant: +0:38 1.300000 +0:40 Test condition and select ( temp void) +0:40 Condition +0:40 Compare Greater Than ( temp bool) +0:40 'a' ( temp highp int) +0:40 Constant: +0:40 10 (const int) +0:40 true case +0:41 Barrier ( global void) +0:40 false case +0:43 Barrier ( global void) +0:45 Barrier ( global void) +0:49 Loop with condition not tested first +0:49 Loop Condition +0:49 Compare Greater Than ( temp bool) +0:49 'a' ( temp highp int) +0:49 Constant: +0:49 10 (const int) +0:49 Loop Body +0:48 Sequence +0:48 Barrier ( global void) +0:51 switch +0:51 condition +0:51 'a' ( temp highp int) +0:51 body +0:51 Sequence +0:52 default: +0:? Sequence +0:53 Barrier ( global void) +0:54 Branch: Break +0:56 Test condition and select ( temp highp int) +0:56 Condition +0:56 Compare Less Than ( temp bool) +0:56 'a' ( temp highp int) +0:56 Constant: +0:56 12 (const int) +0:56 true case +0:56 'a' ( temp highp int) +0:56 false case +0:56 Comma ( temp highp int) +0:56 Barrier ( global void) +0:56 'a' ( temp highp int) +0:58 Sequence +0:58 Barrier ( global void) +0:61 Branch: Return +0:63 Barrier ( global void) +0:69 Function Definition: foo( ( global void) +0:69 Function Parameters: +0:71 Sequence +0:71 gl_Position: direct index for structure ( out highp 4-component vector of float Position) +0:71 direct index ( temp block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:71 'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:71 Constant: +0:71 4 (const int) +0:71 Constant: +0:71 0 (const int) +0:73 Barrier ( global void) +0:92 Function Definition: foop( ( global void) +0:92 Function Parameters: +0:? Sequence +0:95 move second child to first child ( temp highp float) +0:95 'd' ( noContraction temp highp float) +0:95 fma ( global highp float) +0:95 'd' ( noContraction temp highp float) +0:95 'd' ( noContraction temp highp float) +0:95 'd' ( noContraction temp highp float) +0:112 Function Definition: pointSize2( ( global void) +0:112 Function Parameters: +0:114 Sequence +0:114 Sequence +0:114 move second child to first child ( temp highp float) +0:114 'ps' ( temp highp float) +0:114 gl_PointSize: direct index for structure ( in highp float PointSize) +0:114 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:114 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:114 Constant: +0:114 1 (const int) +0:114 Constant: +0:114 1 (const int) +0:115 move second child to first child ( temp highp float) +0:115 gl_PointSize: direct index for structure ( out highp float PointSize) +0:115 indirect index ( temp block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:115 'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:115 'gl_InvocationID' ( in highp int InvocationID) +0:115 Constant: +0:115 1 (const int) +0:115 'ps' ( temp highp float) +0:122 Function Definition: goodfoop( ( global void) +0:122 Function Parameters: +0:? Sequence +0:126 multiply second child into first child ( temp highp 3-component vector of float) +0:126 'pv3' ( noContraction temp highp 3-component vector of float) +0:126 'pv3' ( noContraction temp highp 3-component vector of float) +0:127 move second child to first child ( temp highp 3-component vector of float) +0:127 'pv3' ( noContraction temp highp 3-component vector of float) +0:127 fma ( global highp 3-component vector of float) +0:127 'pv3' ( noContraction temp highp 3-component vector of float) +0:127 'pv3' ( noContraction temp highp 3-component vector of float) +0:127 'pv3' ( noContraction temp highp 3-component vector of float) +0:128 move second child to first child ( temp highp float) +0:128 'd' ( noContraction temp highp float) +0:128 fma ( global highp float) +0:128 'd' ( noContraction temp highp float) +0:128 'd' ( noContraction temp highp float) +0:128 'd' ( noContraction temp highp float) +0:131 Function Definition: bbBad( ( global void) +0:131 Function Parameters: +0:133 Sequence +0:133 'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox) +0:138 Function Definition: bb( ( global void) +0:138 Function Parameters: +0:140 Sequence +0:140 move second child to first child ( temp highp 4-component vector of float) +0:140 direct index ( patch temp highp 4-component vector of float BoundingBox) +0:140 'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox) +0:140 Constant: +0:140 0 (const int) +0:140 Constant: +0:140 0.000000 +0:140 0.000000 +0:140 0.000000 +0:140 0.000000 +0:141 move second child to first child ( temp highp 4-component vector of float) +0:141 direct index ( patch temp highp 4-component vector of float BoundingBox) +0:141 'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox) +0:141 Constant: +0:141 1 (const int) +0:141 Constant: +0:141 1.000000 +0:141 1.000000 +0:141 1.000000 +0:141 1.000000 +0:142 move second child to first child ( temp highp 4-component vector of float) +0:142 direct index ( patch temp highp 4-component vector of float BoundingBox) +0:142 'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox) +0:142 Constant: +0:142 2 (const int) +0:142 Constant: +0:142 2.000000 +0:142 2.000000 +0:142 2.000000 +0:142 2.000000 +0:153 Function Definition: outputtingOutparam(i1; ( global void) +0:153 Function Parameters: +0:153 'a' ( out highp int) +0:155 Sequence +0:155 move second child to first child ( temp highp int) +0:155 'a' ( out highp int) +0:155 Constant: +0:155 2 (const int) +0:158 Function Definition: outputting( ( global void) +0:158 Function Parameters: +0:160 Sequence +0:160 move second child to first child ( temp highp int) +0:160 indirect index ( temp highp int) +0:160 'outa' ( out 4-element array of highp int) +0:160 'gl_InvocationID' ( in highp int InvocationID) +0:160 Constant: +0:160 2 (const int) +0:161 move second child to first child ( temp highp int) +0:161 direct index ( temp highp int) +0:161 'outa' ( out 4-element array of highp int) +0:161 Constant: +0:161 1 (const int) +0:161 Constant: +0:161 2 (const int) +0:162 move second child to first child ( temp highp 4-component vector of float) +0:162 gl_Position: direct index for structure ( out highp 4-component vector of float Position) +0:162 direct index ( temp block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:162 'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:162 Constant: +0:162 0 (const int) +0:162 Constant: +0:162 0 (const int) +0:162 Constant: +0:162 1.000000 +0:162 1.000000 +0:162 1.000000 +0:162 1.000000 +0:163 direct index ( temp highp int) +0:163 'outa' ( out 4-element array of highp int) +0:163 Constant: +0:163 1 (const int) +0:164 direct index ( temp block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:164 'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:164 Constant: +0:164 0 (const int) +0:165 Function Call: outputtingOutparam(i1; ( global void) +0:165 direct index ( temp highp int) +0:165 'outa' ( out 4-element array of highp int) +0:165 Constant: +0:165 0 (const int) +0:166 Function Call: outputtingOutparam(i1; ( global void) +0:166 indirect index ( temp highp int) +0:166 'outa' ( out 4-element array of highp int) +0:166 'gl_InvocationID' ( in highp int InvocationID) +0:167 move second child to first child ( temp highp float) +0:167 f: direct index for structure ( out highp float) +0:167 direct index ( patch temp block{ out highp float f}) +0:167 'patchIName' ( patch out 4-element array of block{ out highp float f}) +0:167 Constant: +0:167 1 (const int) +0:167 Constant: +0:167 0 (const int) +0:167 Constant: +0:167 3.140000 +0:168 move second child to first child ( temp highp int) +0:168 indirect index ( temp highp int) +0:168 'outa' ( out 4-element array of highp int) +0:168 'gl_InvocationID' ( in highp int InvocationID) +0:168 Constant: +0:168 2 (const int) +0:? Linker Objects +0:? 'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:? 'outa' ( out 4-element array of highp int) +0:? 'patchIn' ( patch in highp 4-component vector of float) +0:? 'patchOut' ( patch out highp 4-component vector of float) +0:? 'ina' ( in highp 2-component vector of float) +0:? 'inb' ( in 32-element array of highp 2-component vector of float) +0:? 'inc' ( in 32-element array of highp 2-component vector of float) +0:? 'ind' ( in 32-element array of highp 2-component vector of float) +0:? 'implA' ( patch out unsized 1-element array of highp float) +0:? 'ivla' (layout( location=3) in 32-element array of highp 4-component vector of float) +0:? 'ivlb' (layout( location=4) in 32-element array of highp 4-component vector of float) +0:? 'ivlc' (layout( location=4) in 32-element array of highp 4-component vector of float) +0:? 'ovla' (layout( location=3) out 4-element array of highp 4-component vector of float) +0:? 'ovlb' (layout( location=4) out 4-element array of highp 4-component vector of float) +0:? 'ovlc' (layout( location=4) out 4-element array of highp 4-component vector of float) +0:? 'pinbi' ( patch out block{ out highp int a}) +0:? 'myColor2' ( centroid out 4-element array of highp 3-component vector of float) +0:? 'centr' ( centroid in 32-element array of highp 3-component vector of float) +0:? 'perSampleColor' ( sample out 4-element array of highp 4-component vector of float) +0:? 'badlay' ( out 4-element array of highp float) +0:? 'misSized' ( out 5-element array of highp float) +0:? 'okaySize' ( out 4-element array of highp float) +0:? 'pv3' ( noContraction temp highp 3-component vector of float) +0:? 'badpatchIName' ( patch out unsized 1-element array of block{ out highp float f}) +0:? 'patchIName' ( patch out 4-element array of block{ out highp float f}) + + +Linked tessellation control stage: + + +Shader version: 310 +Requested GL_ARB_separate_shader_objects +Requested GL_OES_gpu_shader5 +Requested GL_OES_primitive_bounding_box +Requested GL_OES_shader_io_blocks +Requested GL_OES_tessellation_point_size +Requested GL_OES_tessellation_shader +vertices = 4 +ERROR: node is still EOpNull! +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:17 Sequence +0:17 Barrier ( global void) +0:19 Sequence +0:19 move second child to first child ( temp highp int) +0:19 'a' ( temp highp int) +0:19 Constant: +0:19 5392 (const int) +0:25 Sequence +0:25 move second child to first child ( temp highp 4-component vector of float) +0:25 'p' ( temp highp 4-component vector of float) +0:25 gl_Position: direct index for structure ( in highp 4-component vector of float Position) +0:25 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:25 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:25 Constant: +0:25 1 (const int) +0:25 Constant: +0:25 0 (const int) +0:26 Sequence +0:26 move second child to first child ( temp highp float) +0:26 'ps' ( temp highp float) +0:26 gl_PointSize: direct index for structure ( in highp float PointSize) +0:26 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:26 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:26 Constant: +0:26 1 (const int) +0:26 Constant: +0:26 1 (const int) +0:27 Sequence +0:27 move second child to first child ( temp highp float) +0:27 'cd' ( temp highp float) +0:27 Constant: +0:27 0.000000 +0:29 Sequence +0:29 move second child to first child ( temp highp int) +0:29 'pvi' ( temp highp int) +0:29 'gl_PatchVerticesIn' ( in highp int PatchVertices) +0:30 Sequence +0:30 move second child to first child ( temp highp int) +0:30 'pid' ( temp highp int) +0:30 'gl_PrimitiveID' ( in highp int PrimitiveID) +0:31 Sequence +0:31 move second child to first child ( temp highp int) +0:31 'iid' ( temp highp int) +0:31 'gl_InvocationID' ( in highp int InvocationID) +0:33 move second child to first child ( temp highp 4-component vector of float) +0:33 gl_Position: direct index for structure ( out highp 4-component vector of float Position) +0:33 indirect index ( temp block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:33 'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:33 'gl_InvocationID' ( in highp int InvocationID) +0:33 Constant: +0:33 0 (const int) +0:33 'p' ( temp highp 4-component vector of float) +0:34 move second child to first child ( temp highp float) +0:34 gl_PointSize: direct index for structure ( out highp float PointSize) +0:34 indirect index ( temp block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:34 'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:34 'gl_InvocationID' ( in highp int InvocationID) +0:34 Constant: +0:34 1 (const int) +0:34 'ps' ( temp highp float) +0:35 move second child to first child ( temp highp float) +0:35 Constant: +0:35 0.000000 +0:35 'cd' ( temp highp float) +0:37 move second child to first child ( temp highp float) +0:37 direct index ( patch temp highp float TessLevelOuter) +0:37 'gl_TessLevelOuter' ( patch out 4-element array of highp float TessLevelOuter) +0:37 Constant: +0:37 3 (const int) +0:37 Constant: +0:37 3.200000 +0:38 move second child to first child ( temp highp float) +0:38 direct index ( patch temp highp float TessLevelInner) +0:38 'gl_TessLevelInner' ( patch out 2-element array of highp float TessLevelInner) +0:38 Constant: +0:38 1 (const int) +0:38 Constant: +0:38 1.300000 +0:40 Test condition and select ( temp void) +0:40 Condition +0:40 Compare Greater Than ( temp bool) +0:40 'a' ( temp highp int) +0:40 Constant: +0:40 10 (const int) +0:40 true case +0:41 Barrier ( global void) +0:40 false case +0:43 Barrier ( global void) +0:45 Barrier ( global void) +0:49 Loop with condition not tested first +0:49 Loop Condition +0:49 Compare Greater Than ( temp bool) +0:49 'a' ( temp highp int) +0:49 Constant: +0:49 10 (const int) +0:49 Loop Body +0:48 Sequence +0:48 Barrier ( global void) +0:51 switch +0:51 condition +0:51 'a' ( temp highp int) +0:51 body +0:51 Sequence +0:52 default: +0:? Sequence +0:53 Barrier ( global void) +0:54 Branch: Break +0:56 Test condition and select ( temp highp int) +0:56 Condition +0:56 Compare Less Than ( temp bool) +0:56 'a' ( temp highp int) +0:56 Constant: +0:56 12 (const int) +0:56 true case +0:56 'a' ( temp highp int) +0:56 false case +0:56 Comma ( temp highp int) +0:56 Barrier ( global void) +0:56 'a' ( temp highp int) +0:58 Sequence +0:58 Barrier ( global void) +0:61 Branch: Return +0:63 Barrier ( global void) +0:? Linker Objects +0:? 'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:? 'outa' ( out 4-element array of highp int) +0:? 'patchIn' ( patch in highp 4-component vector of float) +0:? 'patchOut' ( patch out highp 4-component vector of float) +0:? 'ina' ( in highp 2-component vector of float) +0:? 'inb' ( in 32-element array of highp 2-component vector of float) +0:? 'inc' ( in 32-element array of highp 2-component vector of float) +0:? 'ind' ( in 32-element array of highp 2-component vector of float) +0:? 'implA' ( patch out 1-element array of highp float) +0:? 'ivla' (layout( location=3) in 32-element array of highp 4-component vector of float) +0:? 'ivlb' (layout( location=4) in 32-element array of highp 4-component vector of float) +0:? 'ivlc' (layout( location=4) in 32-element array of highp 4-component vector of float) +0:? 'ovla' (layout( location=3) out 4-element array of highp 4-component vector of float) +0:? 'ovlb' (layout( location=4) out 4-element array of highp 4-component vector of float) +0:? 'ovlc' (layout( location=4) out 4-element array of highp 4-component vector of float) +0:? 'pinbi' ( patch out block{ out highp int a}) +0:? 'myColor2' ( centroid out 4-element array of highp 3-component vector of float) +0:? 'centr' ( centroid in 32-element array of highp 3-component vector of float) +0:? 'perSampleColor' ( sample out 4-element array of highp 4-component vector of float) +0:? 'badlay' ( out 4-element array of highp float) +0:? 'misSized' ( out 5-element array of highp float) +0:? 'okaySize' ( out 4-element array of highp float) +0:? 'pv3' ( noContraction temp highp 3-component vector of float) +0:? 'badpatchIName' ( patch out 1-element array of block{ out highp float f}) +0:? 'patchIName' ( patch out 4-element array of block{ out highp float f}) + diff --git a/deps/glslang/Test/baseResults/310.tese.out b/deps/glslang/Test/baseResults/310.tese.out new file mode 100644 index 00000000..9c7c679d --- /dev/null +++ b/deps/glslang/Test/baseResults/310.tese.out @@ -0,0 +1,300 @@ +310.tese +ERROR: 0:7: 'vertices' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:9: 'triangles' : cannot change previously set input primitive +ERROR: 0:10: 'isolines' : cannot change previously set input primitive +ERROR: 0:12: 'ccw' : cannot change previously set vertex order +ERROR: 0:16: 'equal_spacing' : cannot change previously set vertex spacing +ERROR: 0:17: 'fractional_even_spacing' : cannot change previously set vertex spacing +ERROR: 0:22: 'patch' : can only use on input in tessellation-evaluation shader +ERROR: 0:26: 'barrier' : no matching overloaded function found +ERROR: 0:37: 'gl_PointSize' : required extension not requested: Possible extensions include: +GL_EXT_tessellation_point_size +GL_OES_tessellation_point_size +ERROR: 0:38: 'gl_ClipDistance' : no such field in structure +ERROR: 0:38: 'expression' : left of '[' is not of type array, matrix, or vector +ERROR: 0:47: 'gl_PointSize' : required extension not requested: Possible extensions include: +GL_EXT_tessellation_point_size +GL_OES_tessellation_point_size +ERROR: 0:48: 'gl_ClipDistance' : undeclared identifier +ERROR: 0:48: 'gl_ClipDistance' : left of '[' is not of type array, matrix, or vector +ERROR: 0:48: 'assign' : l-value required (can't modify a const) +ERROR: 0:51: 'patch' : cannot use interpolation qualifiers with patch +ERROR: 0:52: 'patch' : cannot use interpolation qualifiers with patch +ERROR: 0:53: 'noperspective' : Reserved word. +ERROR: 0:53: 'noperspective' : not supported for this version or the enabled extensions +ERROR: 0:53: 'patch' : cannot use interpolation qualifiers with patch +ERROR: 0:54: 'sample' : Reserved word. +ERROR: 0:54: '' : can only have one auxiliary qualifier (centroid, patch, and sample) +ERROR: 0:63: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use +ERROR: 0:68: 'quads' : cannot apply to 'out' +ERROR: 0:68: 'cw' : can only apply to 'in' +ERROR: 0:69: 'triangles' : cannot apply to 'out' +ERROR: 0:70: 'isolines' : cannot apply to 'out' +ERROR: 0:71: 'cw' : can only apply to 'in' +ERROR: 0:72: 'fractional_odd_spacing' : can only apply to 'in' +ERROR: 0:73: 'equal_spacing' : can only apply to 'in' +ERROR: 0:74: 'fractional_even_spacing' : can only apply to 'in' +ERROR: 0:75: 'point_mode' : can only apply to 'in' +ERROR: 0:77: 'in' : type must be an array: ina +ERROR: 0:79: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized +ERROR: 0:82: 'in' : type must be an array: bla +ERROR: 0:90: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized +ERROR: 0:100: 'location' : overlapping use of location 24 +ERROR: 0:103: 'location' : overlapping use of location 24 +ERROR: 0:105: 'gl_TessLevelOuter' : identifiers starting with "gl_" are reserved +ERROR: 0:113: 'sample' : Reserved word. +ERROR: 0:119: 'gl_PointSize' : no such field in structure +ERROR: 0:119: '=' : cannot convert from ' temp block{ in highp 4-component vector of float Position gl_Position}' to ' temp highp float' +ERROR: 0:127: 'gl_BoundingBoxOES' : undeclared identifier +ERROR: 43 compilation errors. No code generated. + + +Shader version: 310 +Requested GL_ARB_separate_shader_objects +Requested GL_EXT_primitive_bounding_box +Requested GL_EXT_shader_io_blocks +Requested GL_EXT_tessellation_shader +Requested GL_OES_shader_io_blocks +Requested GL_OES_tessellation_point_size +Requested GL_OES_tessellation_shader +input primitive = quads +vertex spacing = fractional_odd_spacing +triangle order = cw +using point mode +ERROR: node is still EOpNull! +0:24 Function Definition: main( ( global void) +0:24 Function Parameters: +0:26 Sequence +0:26 Constant: +0:26 0.000000 +0:28 Sequence +0:28 move second child to first child ( temp highp int) +0:28 'a' ( temp highp int) +0:28 Constant: +0:28 1512 (const int) +0:36 Sequence +0:36 move second child to first child ( temp highp 4-component vector of float) +0:36 'p' ( temp highp 4-component vector of float) +0:36 gl_Position: direct index for structure ( in highp 4-component vector of float Position) +0:36 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:36 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:36 Constant: +0:36 1 (const int) +0:36 Constant: +0:36 0 (const int) +0:37 Sequence +0:37 move second child to first child ( temp highp float) +0:37 'ps' ( temp highp float) +0:37 gl_PointSize: direct index for structure ( in highp float PointSize) +0:37 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:37 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 1 (const int) +0:38 Sequence +0:38 move second child to first child ( temp highp float) +0:38 'cd' ( temp highp float) +0:38 Constant: +0:38 0.000000 +0:40 Sequence +0:40 move second child to first child ( temp highp int) +0:40 'pvi' ( temp highp int) +0:40 'gl_PatchVerticesIn' ( in highp int PatchVertices) +0:41 Sequence +0:41 move second child to first child ( temp highp int) +0:41 'pid' ( temp highp int) +0:41 'gl_PrimitiveID' ( in highp int PrimitiveID) +0:42 Sequence +0:42 move second child to first child ( temp highp 3-component vector of float) +0:42 'tc' ( temp highp 3-component vector of float) +0:42 'gl_TessCoord' ( in highp 3-component vector of float TessCoord) +0:43 Sequence +0:43 move second child to first child ( temp highp float) +0:43 'tlo' ( temp highp float) +0:43 direct index ( patch temp highp float TessLevelOuter) +0:43 'gl_TessLevelOuter' ( patch in 4-element array of highp float TessLevelOuter) +0:43 Constant: +0:43 3 (const int) +0:44 Sequence +0:44 move second child to first child ( temp highp float) +0:44 'tli' ( temp highp float) +0:44 direct index ( patch temp highp float TessLevelInner) +0:44 'gl_TessLevelInner' ( patch in 2-element array of highp float TessLevelInner) +0:44 Constant: +0:44 1 (const int) +0:46 move second child to first child ( temp highp 4-component vector of float) +0:46 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) +0:46 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, gl_PointSize highp float PointSize gl_PointSize}) +0:46 Constant: +0:46 0 (const uint) +0:46 'p' ( temp highp 4-component vector of float) +0:47 move second child to first child ( temp highp float) +0:47 gl_PointSize: direct index for structure ( gl_PointSize highp float PointSize) +0:47 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, gl_PointSize highp float PointSize gl_PointSize}) +0:47 Constant: +0:47 1 (const uint) +0:47 'ps' ( temp highp float) +0:48 move second child to first child ( temp highp float) +0:48 Constant: +0:48 0.000000 +0:48 'cd' ( temp highp float) +0:117 Function Definition: pointSize2( ( global void) +0:117 Function Parameters: +0:? Sequence +0:120 move second child to first child ( temp highp float) +0:120 gl_PointSize: direct index for structure ( gl_PointSize highp float PointSize) +0:120 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, gl_PointSize highp float PointSize gl_PointSize}) +0:120 Constant: +0:120 1 (const uint) +0:120 'ps' ( temp highp float) +0:125 Function Definition: bbbad( ( global void) +0:125 Function Parameters: +0:127 Sequence +0:127 'gl_BoundingBoxOES' ( temp float) +0:? Linker Objects +0:? 'patchIn' ( patch in highp 4-component vector of float) +0:? 'patchOut' ( patch out highp 4-component vector of float) +0:? 'badp1' ( smooth patch in highp 4-component vector of float) +0:? 'badp2' ( flat patch in highp 4-component vector of float) +0:? 'badp3' ( noperspective patch in highp 4-component vector of float) +0:? 'badp4' ( patch sample in highp 3-component vector of float) +0:? 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position}) +0:? 'ina' ( in highp 2-component vector of float) +0:? 'inb' ( in 32-element array of highp 2-component vector of float) +0:? 'inc' ( in 32-element array of highp 2-component vector of float) +0:? 'ind' ( in 32-element array of highp 2-component vector of float) +0:? 'bla' ( in block{ in highp int f}) +0:? 'blb' ( in 32-element array of block{ in highp int f}) +0:? 'blc' ( in 32-element array of block{ in highp int f}) +0:? 'bld' ( in 32-element array of block{ in highp int f}) +0:? 'ivla' (layout( location=23) in 32-element array of highp 4-component vector of float) +0:? 'ivlb' (layout( location=24) in 32-element array of highp 4-component vector of float) +0:? 'ivlc' (layout( location=24) in 32-element array of highp 4-component vector of float) +0:? 'ovla' (layout( location=23) out 2-element array of highp 4-component vector of float) +0:? 'ovlb' (layout( location=24) out 2-element array of highp 4-component vector of float) +0:? 'pinbi' ( patch in block{ in highp int a}) +0:? 'myColor2' ( centroid out highp 3-component vector of float) +0:? 'centr' ( centroid in 32-element array of highp 3-component vector of float) +0:? 'perSampleColor' ( sample out highp 4-component vector of float) + + +Linked tessellation evaluation stage: + + +Shader version: 310 +Requested GL_ARB_separate_shader_objects +Requested GL_EXT_primitive_bounding_box +Requested GL_EXT_shader_io_blocks +Requested GL_EXT_tessellation_shader +Requested GL_OES_shader_io_blocks +Requested GL_OES_tessellation_point_size +Requested GL_OES_tessellation_shader +input primitive = quads +vertex spacing = fractional_odd_spacing +triangle order = cw +using point mode +ERROR: node is still EOpNull! +0:24 Function Definition: main( ( global void) +0:24 Function Parameters: +0:26 Sequence +0:26 Constant: +0:26 0.000000 +0:28 Sequence +0:28 move second child to first child ( temp highp int) +0:28 'a' ( temp highp int) +0:28 Constant: +0:28 1512 (const int) +0:36 Sequence +0:36 move second child to first child ( temp highp 4-component vector of float) +0:36 'p' ( temp highp 4-component vector of float) +0:36 gl_Position: direct index for structure ( in highp 4-component vector of float Position) +0:36 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:36 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:36 Constant: +0:36 1 (const int) +0:36 Constant: +0:36 0 (const int) +0:37 Sequence +0:37 move second child to first child ( temp highp float) +0:37 'ps' ( temp highp float) +0:37 gl_PointSize: direct index for structure ( in highp float PointSize) +0:37 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:37 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 1 (const int) +0:38 Sequence +0:38 move second child to first child ( temp highp float) +0:38 'cd' ( temp highp float) +0:38 Constant: +0:38 0.000000 +0:40 Sequence +0:40 move second child to first child ( temp highp int) +0:40 'pvi' ( temp highp int) +0:40 'gl_PatchVerticesIn' ( in highp int PatchVertices) +0:41 Sequence +0:41 move second child to first child ( temp highp int) +0:41 'pid' ( temp highp int) +0:41 'gl_PrimitiveID' ( in highp int PrimitiveID) +0:42 Sequence +0:42 move second child to first child ( temp highp 3-component vector of float) +0:42 'tc' ( temp highp 3-component vector of float) +0:42 'gl_TessCoord' ( in highp 3-component vector of float TessCoord) +0:43 Sequence +0:43 move second child to first child ( temp highp float) +0:43 'tlo' ( temp highp float) +0:43 direct index ( patch temp highp float TessLevelOuter) +0:43 'gl_TessLevelOuter' ( patch in 4-element array of highp float TessLevelOuter) +0:43 Constant: +0:43 3 (const int) +0:44 Sequence +0:44 move second child to first child ( temp highp float) +0:44 'tli' ( temp highp float) +0:44 direct index ( patch temp highp float TessLevelInner) +0:44 'gl_TessLevelInner' ( patch in 2-element array of highp float TessLevelInner) +0:44 Constant: +0:44 1 (const int) +0:46 move second child to first child ( temp highp 4-component vector of float) +0:46 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) +0:46 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, gl_PointSize highp float PointSize gl_PointSize}) +0:46 Constant: +0:46 0 (const uint) +0:46 'p' ( temp highp 4-component vector of float) +0:47 move second child to first child ( temp highp float) +0:47 gl_PointSize: direct index for structure ( gl_PointSize highp float PointSize) +0:47 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, gl_PointSize highp float PointSize gl_PointSize}) +0:47 Constant: +0:47 1 (const uint) +0:47 'ps' ( temp highp float) +0:48 move second child to first child ( temp highp float) +0:48 Constant: +0:48 0.000000 +0:48 'cd' ( temp highp float) +0:? Linker Objects +0:? 'patchIn' ( patch in highp 4-component vector of float) +0:? 'patchOut' ( patch out highp 4-component vector of float) +0:? 'badp1' ( smooth patch in highp 4-component vector of float) +0:? 'badp2' ( flat patch in highp 4-component vector of float) +0:? 'badp3' ( noperspective patch in highp 4-component vector of float) +0:? 'badp4' ( patch sample in highp 3-component vector of float) +0:? 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position}) +0:? 'ina' ( in highp 2-component vector of float) +0:? 'inb' ( in 32-element array of highp 2-component vector of float) +0:? 'inc' ( in 32-element array of highp 2-component vector of float) +0:? 'ind' ( in 32-element array of highp 2-component vector of float) +0:? 'bla' ( in block{ in highp int f}) +0:? 'blb' ( in 32-element array of block{ in highp int f}) +0:? 'blc' ( in 32-element array of block{ in highp int f}) +0:? 'bld' ( in 32-element array of block{ in highp int f}) +0:? 'ivla' (layout( location=23) in 32-element array of highp 4-component vector of float) +0:? 'ivlb' (layout( location=24) in 32-element array of highp 4-component vector of float) +0:? 'ivlc' (layout( location=24) in 32-element array of highp 4-component vector of float) +0:? 'ovla' (layout( location=23) out 2-element array of highp 4-component vector of float) +0:? 'ovlb' (layout( location=24) out 2-element array of highp 4-component vector of float) +0:? 'pinbi' ( patch in block{ in highp int a}) +0:? 'myColor2' ( centroid out highp 3-component vector of float) +0:? 'centr' ( centroid in 32-element array of highp 3-component vector of float) +0:? 'perSampleColor' ( sample out highp 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/310.vert.out b/deps/glslang/Test/baseResults/310.vert.out new file mode 100644 index 00000000..21fa27b9 --- /dev/null +++ b/deps/glslang/Test/baseResults/310.vert.out @@ -0,0 +1,1272 @@ +310.vert +ERROR: 0:3: 'shared' : not supported in this stage: vertex +ERROR: 0:4: 'local_size_x' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:5: 'buffer' : buffers can be declared only as blocks +ERROR: 0:10: 'location' : overlapping use of location 3 +ERROR: 0:58: 'usampler2DMSArray' : Reserved word. +ERROR: 0:58: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:67: 'textureSamples' : no matching overloaded function found +ERROR: 0:69: 'assign' : l-value required "ini" (can't modify shader input) +ERROR: 0:69: 'out' : Non-L-value cannot be passed for 'out' or 'inout' parameters. +ERROR: 0:72: 'out' : cannot be bool +ERROR: 0:73: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: outo +ERROR: 0:75: 'vertex-shader array-of-array output' : not supported with this profile: es +ERROR: 0:78: 'vertex-shader array-of-struct output' : not supported with this profile: es +ERROR: 0:79: 'vertex-shader array-of-struct output' : not supported with this profile: es +ERROR: 0:81: 'vertex-shader struct output containing an array' : not supported with this profile: es +ERROR: 0:83: 'vertex-shader struct output containing structure' : not supported with this profile: es +ERROR: 0:85: 'std430' : requires the 'buffer' storage qualifier +ERROR: 0:97: 's' : member of block cannot be or contain a sampler, image, or atomic_uint type +ERROR: 0:105: 'location' : overlapping use of location 12 +ERROR: 0:107: 'input block' : not supported in this stage: vertex +ERROR: 0:109: 'gl_PerVertex' : block redeclaration has extra members +ERROR: 0:119: 'gl_PointSize' : member of nameless block was not redeclared +ERROR: 0:119: 'assign' : cannot convert from ' const float' to ' gl_PointSize highp void PointSize' +ERROR: 0:122: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use +ERROR: 0:127: 'flat/smooth/noperspective' : cannot use interpolation qualifiers on an interface block +ERROR: 0:131: 'flat/smooth/noperspective' : cannot use interpolation qualifiers on an interface block +ERROR: 0:135: 'centroid' : cannot use centroid qualifier on an interface block +ERROR: 0:139: 'invariant' : cannot use invariant qualifier on an interface block +ERROR: 0:155: 'precise' : Reserved word. +ERROR: 0:155: 'precise' : not supported for this version or the enabled extensions +ERROR: 0:156: 'fma' : required extension not requested: Possible extensions include: +GL_EXT_gpu_shader5 +GL_OES_gpu_shader5 +ERROR: 0:157: 'variable indexing sampler array' : not supported for this version or the enabled extensions +ERROR: 0:161: 'variable indexing uniform block array' : not supported for this version or the enabled extensions +ERROR: 0:162: 'variable indexing buffer block array' : not supported with this profile: es +ERROR: 0:164: 'variable indexing sampler array' : not supported for this version or the enabled extensions +ERROR: 0:165: 'non-constant offset argument' : not supported for this version or the enabled extensions +ERROR: 0:166: 'textureGatherOffsets' : required extension not requested: Possible extensions include: +GL_EXT_gpu_shader5 +GL_OES_gpu_shader5 +ERROR: 0:177: 'variable indexing buffer block array' : not supported with this profile: es +ERROR: 0:182: 'textureGatherOffsets(...)' : must be a compile-time constant: offsets argument +ERROR: 0:185: 'samplerBuffer' : Reserved word. +ERROR: 0:185: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:186: 'isamplerBuffer' : Reserved word. +ERROR: 0:186: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:187: 'usamplerBuffer' : Reserved word. +ERROR: 0:187: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:188: 'imageBuffer' : Reserved word. +ERROR: 0:188: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:189: 'iimageBuffer' : Reserved word. +ERROR: 0:189: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:190: 'uimageBuffer' : Reserved word. +ERROR: 0:190: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:195: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:196: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:197: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:198: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:199: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:200: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:235: 'imageCubeArray' : Reserved word. +ERROR: 0:235: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:236: 'iimageCubeArray' : Reserved word. +ERROR: 0:236: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:237: 'uimageCubeArray' : Reserved word. +ERROR: 0:237: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:239: 'samplerCubeArray' : Reserved word. +ERROR: 0:239: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:240: 'samplerCubeArrayShadow' : Reserved word. +ERROR: 0:240: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:241: 'isamplerCubeArray' : Reserved word. +ERROR: 0:241: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:242: 'usamplerCubeArray' : Reserved word. +ERROR: 0:242: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:246: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:247: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:248: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:250: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:251: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:252: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:253: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:321: 'sampler2DMSArray' : Reserved word. +ERROR: 0:321: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:322: 'isampler2DMSArray' : Reserved word. +ERROR: 0:322: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:323: 'usampler2DMSArray' : Reserved word. +ERROR: 0:323: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:329: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:330: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:331: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:351: 'textureSize' : no matching overloaded function found +ERROR: 0:351: '=' : cannot convert from ' const float' to ' temp highp 3-component vector of int' +ERROR: 0:389: 'sample' : Reserved word. +ERROR: 0:400: 'interpolateAtCentroid' : no matching overloaded function found +ERROR: 0:401: 'interpolateAtSample' : no matching overloaded function found +ERROR: 0:402: 'interpolateAtOffset' : no matching overloaded function found +ERROR: 93 compilation errors. No code generated. + + +Shader version: 310 +Requested GL_EXT_texture_buffer +Requested GL_OES_gpu_shader5 +Requested GL_OES_shader_image_atomic +Requested GL_OES_shader_io_blocks +Requested GL_OES_shader_multisample_interpolation +Requested GL_OES_texture_buffer +Requested GL_OES_texture_cube_map_array +Requested GL_OES_texture_storage_multisample_2d_array +ERROR: node is still EOpNull! +0:12 Function Definition: main( ( global void) +0:12 Function Parameters: +0:? Sequence +0:15 move second child to first child ( temp highp 2-component vector of uint) +0:15 'u2' ( temp highp 2-component vector of uint) +0:15 addCarry ( global highp 2-component vector of uint) +0:15 'u2' ( temp highp 2-component vector of uint) +0:15 'u2' ( temp highp 2-component vector of uint) +0:15 'u2' ( temp highp 2-component vector of uint) +0:17 move second child to first child ( temp highp uint) +0:17 'u1' ( temp highp uint) +0:17 subBorrow ( global highp uint) +0:17 'u1' ( temp highp uint) +0:17 'u1' ( temp highp uint) +0:17 'u1' ( temp highp uint) +0:19 uMulExtended ( global highp void) +0:19 'u4' ( temp highp 4-component vector of uint) +0:19 'u4' ( temp highp 4-component vector of uint) +0:19 'u4' ( temp highp 4-component vector of uint) +0:19 'u4' ( temp highp 4-component vector of uint) +0:21 iMulExtended ( global highp void) +0:21 'i4' ( temp highp 4-component vector of int) +0:21 'i4' ( temp highp 4-component vector of int) +0:21 'i4' ( temp highp 4-component vector of int) +0:21 'i4' ( temp highp 4-component vector of int) +0:23 move second child to first child ( temp highp int) +0:23 'i1' ( temp highp int) +0:23 bitfieldExtract ( global highp int) +0:23 'i1' ( temp highp int) +0:23 Constant: +0:23 4 (const int) +0:23 Constant: +0:23 5 (const int) +0:25 move second child to first child ( temp highp 3-component vector of uint) +0:25 'u3' ( temp highp 3-component vector of uint) +0:25 bitfieldExtract ( global highp 3-component vector of uint) +0:25 'u3' ( temp highp 3-component vector of uint) +0:25 Constant: +0:25 4 (const int) +0:25 Constant: +0:25 5 (const int) +0:27 move second child to first child ( temp highp 3-component vector of int) +0:27 'i3' ( temp highp 3-component vector of int) +0:27 bitfieldInsert ( global highp 3-component vector of int) +0:27 'i3' ( temp highp 3-component vector of int) +0:27 'i3' ( temp highp 3-component vector of int) +0:27 Constant: +0:27 4 (const int) +0:27 Constant: +0:27 5 (const int) +0:28 move second child to first child ( temp highp uint) +0:28 'u1' ( temp highp uint) +0:28 bitfieldInsert ( global highp uint) +0:28 'u1' ( temp highp uint) +0:28 'u1' ( temp highp uint) +0:28 Constant: +0:28 4 (const int) +0:28 Constant: +0:28 5 (const int) +0:30 move second child to first child ( temp highp 2-component vector of int) +0:30 'i2' ( temp highp 2-component vector of int) +0:30 bitFieldReverse ( global highp 2-component vector of int) +0:30 'i2' ( temp highp 2-component vector of int) +0:31 move second child to first child ( temp highp 4-component vector of uint) +0:31 'u4' ( temp highp 4-component vector of uint) +0:31 bitFieldReverse ( global highp 4-component vector of uint) +0:31 'u4' ( temp highp 4-component vector of uint) +0:32 move second child to first child ( temp highp int) +0:32 'i1' ( temp highp int) +0:32 bitCount ( global lowp int, operation at highp) +0:32 'i1' ( temp highp int) +0:33 move second child to first child ( temp highp 3-component vector of int) +0:33 'i3' ( temp highp 3-component vector of int) +0:33 bitCount ( global lowp 3-component vector of int, operation at highp) +0:33 'u3' ( temp highp 3-component vector of uint) +0:34 move second child to first child ( temp highp 2-component vector of int) +0:34 'i2' ( temp highp 2-component vector of int) +0:34 findLSB ( global lowp 2-component vector of int, operation at highp) +0:34 'i2' ( temp highp 2-component vector of int) +0:35 move second child to first child ( temp highp 4-component vector of int) +0:35 'i4' ( temp highp 4-component vector of int) +0:35 findLSB ( global lowp 4-component vector of int, operation at highp) +0:35 'u4' ( temp highp 4-component vector of uint) +0:36 move second child to first child ( temp highp int) +0:36 'i1' ( temp highp int) +0:36 findMSB ( global lowp int, operation at highp) +0:36 'i1' ( temp highp int) +0:37 move second child to first child ( temp highp 2-component vector of int) +0:37 'i2' ( temp highp 2-component vector of int) +0:37 findMSB ( global lowp 2-component vector of int, operation at highp) +0:37 'u2' ( temp highp 2-component vector of uint) +0:40 move second child to first child ( temp highp 3-component vector of float) +0:40 'v3' ( temp highp 3-component vector of float) +0:40 frexp ( global highp 3-component vector of float) +0:40 'v3' ( temp highp 3-component vector of float) +0:40 'i3' ( temp highp 3-component vector of int) +0:42 move second child to first child ( temp highp 2-component vector of float) +0:42 'v2' ( temp highp 2-component vector of float) +0:42 ldexp ( global highp 2-component vector of float) +0:42 'v2' ( temp highp 2-component vector of float) +0:42 'i2' ( temp highp 2-component vector of int) +0:45 move second child to first child ( temp highp uint) +0:45 'u1' ( temp highp uint) +0:45 PackUnorm4x8 ( global highp uint, operation at mediump) +0:45 'v4' ( temp mediump 4-component vector of float) +0:46 move second child to first child ( temp highp uint) +0:46 'u1' ( temp highp uint) +0:46 PackSnorm4x8 ( global highp uint, operation at mediump) +0:46 'v4' ( temp mediump 4-component vector of float) +0:47 move second child to first child ( temp mediump 4-component vector of float) +0:47 'v4' ( temp mediump 4-component vector of float) +0:47 UnpackUnorm4x8 ( global mediump 4-component vector of float, operation at highp) +0:47 'u1' ( temp highp uint) +0:48 move second child to first child ( temp mediump 4-component vector of float) +0:48 'v4' ( temp mediump 4-component vector of float) +0:48 UnpackSnorm4x8 ( global mediump 4-component vector of float, operation at highp) +0:48 'u1' ( temp highp uint) +0:60 Function Definition: foo( ( global void) +0:60 Function Parameters: +0:? Sequence +0:63 move second child to first child ( temp highp 2-component vector of int) +0:63 'v2' ( temp highp 2-component vector of int) +0:63 textureSize ( global highp 2-component vector of int) +0:63 's2dms' ( uniform highp sampler2DMS) +0:64 move second child to first child ( temp highp 2-component vector of int) +0:64 'v2' ( temp highp 2-component vector of int) +0:64 textureSize ( global highp 2-component vector of int) +0:64 'us2dms' ( uniform highp usampler2DMS) +0:65 Sequence +0:65 move second child to first child ( temp highp 4-component vector of float) +0:65 'v4' ( temp highp 4-component vector of float) +0:65 textureFetch ( global highp 4-component vector of float) +0:65 's2dms' ( uniform highp sampler2DMS) +0:65 'v2' ( temp highp 2-component vector of int) +0:65 Constant: +0:65 2 (const int) +0:66 Sequence +0:66 move second child to first child ( temp highp 4-component vector of int) +0:66 'iv4' ( temp highp 4-component vector of int) +0:66 textureFetch ( global highp 4-component vector of int) +0:66 'is2dms' ( uniform highp isampler2DMS) +0:66 'v2' ( temp highp 2-component vector of int) +0:66 Constant: +0:66 2 (const int) +0:67 Constant: +0:67 0.000000 +0:69 frexp ( global highp float) +0:69 'f' ( temp highp float) +0:69 'ini' ( in highp int) +0:114 Function Definition: foo_IO( ( global void) +0:114 Function Parameters: +0:116 Sequence +0:116 Sequence +0:116 move second child to first child ( temp highp int) +0:116 'sum' ( temp highp int) +0:116 add ( temp highp int) +0:116 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:117 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) +0:118 move second child to first child ( temp highp 4-component vector of float) +0:118 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) +0:118 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, }) +0:118 Constant: +0:118 0 (const uint) +0:118 Constant: +0:118 1.000000 +0:118 1.000000 +0:118 1.000000 +0:118 1.000000 +0:119 gl_PointSize: direct index for structure ( gl_PointSize highp void PointSize) +0:119 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, }) +0:119 Constant: +0:119 1 (const uint) +0:153 Function Definition: pfooBad( ( global void) +0:153 Function Parameters: +0:? Sequence +0:156 move second child to first child ( temp highp 2-component vector of float) +0:156 'h' ( noContraction temp highp 2-component vector of float) +0:156 fma ( global highp 2-component vector of float) +0:156 'inf' ( in highp 2-component vector of float) +0:156 'ing' ( in highp 2-component vector of float) +0:156 'h' ( noContraction temp highp 2-component vector of float) +0:157 indirect index ( temp lowp sampler2D) +0:157 'sArray' ( uniform 4-element array of lowp sampler2D) +0:157 add ( temp highp int) +0:157 'sIndex' ( uniform highp int) +0:157 Constant: +0:157 1 (const int) +0:158 indirect index (layout( binding=0 offset=0) temp highp atomic_uint) +0:158 'auArray' (layout( binding=0 offset=0) uniform 2-element array of highp atomic_uint) +0:158 add ( temp highp int) +0:158 'sIndex' ( uniform highp int) +0:158 Constant: +0:158 1 (const int) +0:159 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform highp int i}) +0:159 'ubInst' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform highp int i}) +0:159 Constant: +0:159 1 (const int) +0:160 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer highp int i}) +0:160 'bbInst' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer highp int i}) +0:160 Constant: +0:160 2 (const int) +0:161 indirect index (layout( column_major shared) temp block{layout( column_major shared) uniform highp int i}) +0:161 'ubInst' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform highp int i}) +0:161 add ( temp highp int) +0:161 'sIndex' ( uniform highp int) +0:161 Constant: +0:161 1 (const int) +0:162 indirect index (layout( column_major shared) temp block{layout( column_major shared) buffer highp int i}) +0:162 'bbInst' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer highp int i}) +0:162 'sIndex' ( uniform highp int) +0:163 direct index ( writeonly temp highp image2D) +0:163 'iArray' ( writeonly uniform 5-element array of highp image2D) +0:163 Constant: +0:163 2 (const int) +0:164 indirect index ( writeonly temp highp image2D) +0:164 'iArray' ( writeonly uniform 5-element array of highp image2D) +0:164 component-wise multiply ( temp highp int) +0:164 'sIndex' ( uniform highp int) +0:164 Constant: +0:164 2 (const int) +0:165 textureGatherOffset ( global lowp 4-component vector of float) +0:165 direct index ( temp lowp sampler2D) +0:165 'sArray' ( uniform 4-element array of lowp sampler2D) +0:165 Constant: +0:165 0 (const int) +0:165 Constant: +0:165 0.100000 +0:165 0.100000 +0:165 Convert float to int ( temp lowp 2-component vector of int) +0:165 'inf' ( in highp 2-component vector of float) +0:166 textureGatherOffsets ( global lowp 4-component vector of float, operation at highp) +0:166 direct index ( temp lowp sampler2D) +0:166 'sArray' ( uniform 4-element array of lowp sampler2D) +0:166 Constant: +0:166 0 (const int) +0:166 Constant: +0:166 0.100000 +0:166 0.100000 +0:166 Constant: +0:166 0 (const int) +0:166 0 (const int) +0:166 0 (const int) +0:166 0 (const int) +0:166 0 (const int) +0:166 0 (const int) +0:166 0 (const int) +0:166 0 (const int) +0:171 Function Definition: pfoo( ( global void) +0:171 Function Parameters: +0:? Sequence +0:174 move second child to first child ( temp highp 2-component vector of float) +0:174 'h' ( noContraction temp highp 2-component vector of float) +0:174 fma ( global highp 2-component vector of float) +0:174 'inf' ( in highp 2-component vector of float) +0:174 'ing' ( in highp 2-component vector of float) +0:174 'h' ( noContraction temp highp 2-component vector of float) +0:175 indirect index ( temp lowp sampler2D) +0:175 'sArray' ( uniform 4-element array of lowp sampler2D) +0:175 add ( temp highp int) +0:175 'sIndex' ( uniform highp int) +0:175 Constant: +0:175 1 (const int) +0:176 indirect index (layout( column_major shared) temp block{layout( column_major shared) uniform highp int i}) +0:176 'ubInst' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform highp int i}) +0:176 add ( temp highp int) +0:176 'sIndex' ( uniform highp int) +0:176 Constant: +0:176 1 (const int) +0:177 indirect index (layout( column_major shared) temp block{layout( column_major shared) buffer highp int i}) +0:177 'bbInst' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer highp int i}) +0:177 subtract ( temp highp int) +0:177 'sIndex' ( uniform highp int) +0:177 Constant: +0:177 2 (const int) +0:178 direct index ( writeonly temp highp image2D) +0:178 'iArray' ( writeonly uniform 5-element array of highp image2D) +0:178 Constant: +0:178 2 (const int) +0:179 indirect index ( writeonly temp highp image2D) +0:179 'iArray' ( writeonly uniform 5-element array of highp image2D) +0:179 subtract ( temp highp int) +0:179 'sIndex' ( uniform highp int) +0:179 Constant: +0:179 2 (const int) +0:180 textureGatherOffset ( global lowp 4-component vector of float) +0:180 direct index ( temp lowp sampler2D) +0:180 'sArray' ( uniform 4-element array of lowp sampler2D) +0:180 Constant: +0:180 0 (const int) +0:180 Constant: +0:180 0.100000 +0:180 0.100000 +0:180 Convert float to int ( temp lowp 2-component vector of int) +0:180 'inf' ( in highp 2-component vector of float) +0:181 textureGatherOffsets ( global lowp 4-component vector of float, operation at highp) +0:181 direct index ( temp lowp sampler2D) +0:181 'sArray' ( uniform 4-element array of lowp sampler2D) +0:181 Constant: +0:181 0 (const int) +0:181 Constant: +0:181 0.100000 +0:181 0.100000 +0:181 Constant: +0:181 0 (const int) +0:181 0 (const int) +0:181 0 (const int) +0:181 0 (const int) +0:181 0 (const int) +0:181 0 (const int) +0:181 0 (const int) +0:181 0 (const int) +0:182 textureGatherOffsets ( global lowp 4-component vector of float, operation at highp) +0:182 direct index ( temp lowp sampler2D) +0:182 'sArray' ( uniform 4-element array of lowp sampler2D) +0:182 Constant: +0:182 0 (const int) +0:182 Constant: +0:182 0.100000 +0:182 0.100000 +0:182 'offsets' ( uniform 4-element array of highp 2-component vector of int) +0:220 Function Definition: bufferT( ( global void) +0:220 Function Parameters: +0:222 Sequence +0:222 Sequence +0:222 move second child to first child ( temp highp int) +0:222 's1' ( temp highp int) +0:222 textureSize ( global highp int) +0:222 'bufSamp1' ( uniform highp samplerBuffer) +0:223 Sequence +0:223 move second child to first child ( temp highp int) +0:223 's2' ( temp highp int) +0:223 textureSize ( global highp int) +0:223 'bufSamp2' ( uniform highp isamplerBuffer) +0:224 Sequence +0:224 move second child to first child ( temp highp int) +0:224 's3' ( temp highp int) +0:224 textureSize ( global highp int) +0:224 'bufSamp3' ( uniform highp usamplerBuffer) +0:226 Sequence +0:226 move second child to first child ( temp highp int) +0:226 's4' ( temp highp int) +0:226 imageQuerySize ( global highp int) +0:226 'bufSamp4' ( writeonly uniform highp imageBuffer) +0:227 Sequence +0:227 move second child to first child ( temp highp int) +0:227 's5' ( temp highp int) +0:227 imageQuerySize ( global highp int) +0:227 'bufSamp5' ( writeonly uniform highp iimageBuffer) +0:228 Sequence +0:228 move second child to first child ( temp highp int) +0:228 's6' ( temp highp int) +0:228 imageQuerySize ( global highp int) +0:228 'bufSamp6' ( writeonly uniform highp uimageBuffer) +0:230 Sequence +0:230 move second child to first child ( temp highp 4-component vector of float) +0:230 'f1' ( temp highp 4-component vector of float) +0:230 textureFetch ( global highp 4-component vector of float) +0:230 'bufSamp1' ( uniform highp samplerBuffer) +0:230 's1' ( temp highp int) +0:231 Sequence +0:231 move second child to first child ( temp highp 4-component vector of int) +0:231 'f2' ( temp highp 4-component vector of int) +0:231 textureFetch ( global highp 4-component vector of int) +0:231 'bufSamp2' ( uniform highp isamplerBuffer) +0:231 's2' ( temp highp int) +0:232 Sequence +0:232 move second child to first child ( temp highp 4-component vector of uint) +0:232 'f3' ( temp highp 4-component vector of uint) +0:232 textureFetch ( global highp 4-component vector of uint) +0:232 'bufSamp3' ( uniform highp usamplerBuffer) +0:232 's3' ( temp highp int) +0:279 Function Definition: CAT( ( global void) +0:279 Function Parameters: +0:281 Sequence +0:281 Sequence +0:281 move second child to first child ( temp highp 3-component vector of int) +0:281 's4' ( temp highp 3-component vector of int) +0:281 textureSize ( global highp 3-component vector of int) +0:281 'CA4' ( uniform highp samplerCubeArray) +0:281 Constant: +0:281 1 (const int) +0:282 Sequence +0:282 move second child to first child ( temp highp 3-component vector of int) +0:282 's5' ( temp highp 3-component vector of int) +0:282 textureSize ( global highp 3-component vector of int) +0:282 'CA5' ( uniform highp samplerCubeArrayShadow) +0:282 Constant: +0:282 1 (const int) +0:283 Sequence +0:283 move second child to first child ( temp highp 3-component vector of int) +0:283 's6' ( temp highp 3-component vector of int) +0:283 textureSize ( global highp 3-component vector of int) +0:283 'CA6' ( uniform highp isamplerCubeArray) +0:283 Constant: +0:283 1 (const int) +0:284 Sequence +0:284 move second child to first child ( temp highp 3-component vector of int) +0:284 's7' ( temp highp 3-component vector of int) +0:284 textureSize ( global highp 3-component vector of int) +0:284 'CA7' ( uniform highp usamplerCubeArray) +0:284 Constant: +0:284 1 (const int) +0:286 Sequence +0:286 move second child to first child ( temp highp 4-component vector of float) +0:286 't4' ( temp highp 4-component vector of float) +0:286 texture ( global highp 4-component vector of float) +0:286 'CA4' ( uniform highp samplerCubeArray) +0:286 Constant: +0:286 0.500000 +0:286 0.500000 +0:286 0.500000 +0:286 0.500000 +0:287 Sequence +0:287 move second child to first child ( temp highp float) +0:287 't5' ( temp highp float) +0:287 texture ( global highp float) +0:287 'CA5' ( uniform highp samplerCubeArrayShadow) +0:287 Constant: +0:287 0.500000 +0:287 0.500000 +0:287 0.500000 +0:287 0.500000 +0:287 Constant: +0:287 3.000000 +0:288 Sequence +0:288 move second child to first child ( temp highp 4-component vector of int) +0:288 't6' ( temp highp 4-component vector of int) +0:288 texture ( global highp 4-component vector of int) +0:288 'CA6' ( uniform highp isamplerCubeArray) +0:288 Constant: +0:288 0.500000 +0:288 0.500000 +0:288 0.500000 +0:288 0.500000 +0:289 Sequence +0:289 move second child to first child ( temp highp 4-component vector of uint) +0:289 't7' ( temp highp 4-component vector of uint) +0:289 texture ( global highp 4-component vector of uint) +0:289 'CA7' ( uniform highp usamplerCubeArray) +0:289 Constant: +0:289 0.500000 +0:289 0.500000 +0:289 0.500000 +0:289 0.500000 +0:291 Sequence +0:291 move second child to first child ( temp highp 4-component vector of float) +0:291 'L4' ( temp highp 4-component vector of float) +0:291 textureLod ( global highp 4-component vector of float) +0:291 'CA4' ( uniform highp samplerCubeArray) +0:291 Constant: +0:291 0.500000 +0:291 0.500000 +0:291 0.500000 +0:291 0.500000 +0:291 Constant: +0:291 0.240000 +0:292 Sequence +0:292 move second child to first child ( temp highp 4-component vector of int) +0:292 'L6' ( temp highp 4-component vector of int) +0:292 textureLod ( global highp 4-component vector of int) +0:292 'CA6' ( uniform highp isamplerCubeArray) +0:292 Constant: +0:292 0.500000 +0:292 0.500000 +0:292 0.500000 +0:292 0.500000 +0:292 Constant: +0:292 0.260000 +0:293 Sequence +0:293 move second child to first child ( temp highp 4-component vector of uint) +0:293 'L7' ( temp highp 4-component vector of uint) +0:293 textureLod ( global highp 4-component vector of uint) +0:293 'CA7' ( uniform highp usamplerCubeArray) +0:293 Constant: +0:293 0.500000 +0:293 0.500000 +0:293 0.500000 +0:293 0.500000 +0:293 Constant: +0:293 0.270000 +0:295 Sequence +0:295 move second child to first child ( temp highp 4-component vector of float) +0:295 'g4' ( temp highp 4-component vector of float) +0:295 textureGrad ( global highp 4-component vector of float) +0:295 'CA4' ( uniform highp samplerCubeArray) +0:295 Constant: +0:295 0.500000 +0:295 0.500000 +0:295 0.500000 +0:295 0.500000 +0:295 Constant: +0:295 0.100000 +0:295 0.100000 +0:295 0.100000 +0:295 Constant: +0:295 0.200000 +0:295 0.200000 +0:295 0.200000 +0:296 Sequence +0:296 move second child to first child ( temp highp 4-component vector of int) +0:296 'g6' ( temp highp 4-component vector of int) +0:296 textureGrad ( global highp 4-component vector of int) +0:296 'CA6' ( uniform highp isamplerCubeArray) +0:296 Constant: +0:296 0.500000 +0:296 0.500000 +0:296 0.500000 +0:296 0.500000 +0:296 Constant: +0:296 0.100000 +0:296 0.100000 +0:296 0.100000 +0:296 Constant: +0:296 0.200000 +0:296 0.200000 +0:296 0.200000 +0:297 Sequence +0:297 move second child to first child ( temp highp 4-component vector of uint) +0:297 'g7' ( temp highp 4-component vector of uint) +0:297 textureGrad ( global highp 4-component vector of uint) +0:297 'CA7' ( uniform highp usamplerCubeArray) +0:297 Constant: +0:297 0.500000 +0:297 0.500000 +0:297 0.500000 +0:297 0.500000 +0:297 Constant: +0:297 0.100000 +0:297 0.100000 +0:297 0.100000 +0:297 Constant: +0:297 0.200000 +0:297 0.200000 +0:297 0.200000 +0:299 Sequence +0:299 move second child to first child ( temp highp 4-component vector of float) +0:299 'gath4' ( temp highp 4-component vector of float) +0:299 textureGather ( global highp 4-component vector of float) +0:299 'CA4' ( uniform highp samplerCubeArray) +0:299 Constant: +0:299 0.500000 +0:299 0.500000 +0:299 0.500000 +0:299 0.500000 +0:300 Sequence +0:300 move second child to first child ( temp highp 4-component vector of float) +0:300 'gathC4' ( temp highp 4-component vector of float) +0:300 textureGather ( global highp 4-component vector of float) +0:300 'CA4' ( uniform highp samplerCubeArray) +0:300 Constant: +0:300 0.500000 +0:300 0.500000 +0:300 0.500000 +0:300 0.500000 +0:300 Constant: +0:300 2 (const int) +0:301 Sequence +0:301 move second child to first child ( temp highp 4-component vector of int) +0:301 'gath6' ( temp highp 4-component vector of int) +0:301 textureGather ( global highp 4-component vector of int) +0:301 'CA6' ( uniform highp isamplerCubeArray) +0:301 Constant: +0:301 0.500000 +0:301 0.500000 +0:301 0.500000 +0:301 0.500000 +0:302 Sequence +0:302 move second child to first child ( temp highp 4-component vector of int) +0:302 'gathC6' ( temp highp 4-component vector of int) +0:302 textureGather ( global highp 4-component vector of int) +0:302 'CA6' ( uniform highp isamplerCubeArray) +0:302 Constant: +0:302 0.500000 +0:302 0.500000 +0:302 0.500000 +0:302 0.500000 +0:302 Constant: +0:302 1 (const int) +0:303 Sequence +0:303 move second child to first child ( temp highp 4-component vector of uint) +0:303 'gath7' ( temp highp 4-component vector of uint) +0:303 textureGather ( global highp 4-component vector of uint) +0:303 'CA7' ( uniform highp usamplerCubeArray) +0:303 Constant: +0:303 0.500000 +0:303 0.500000 +0:303 0.500000 +0:303 0.500000 +0:304 Sequence +0:304 move second child to first child ( temp highp 4-component vector of uint) +0:304 'gathC7' ( temp highp 4-component vector of uint) +0:304 textureGather ( global highp 4-component vector of uint) +0:304 'CA7' ( uniform highp usamplerCubeArray) +0:304 Constant: +0:304 0.500000 +0:304 0.500000 +0:304 0.500000 +0:304 0.500000 +0:304 Constant: +0:304 0 (const int) +0:306 Sequence +0:306 move second child to first child ( temp highp 4-component vector of float) +0:306 'gath5' ( temp highp 4-component vector of float) +0:306 textureGather ( global highp 4-component vector of float) +0:306 'CA5' ( uniform highp samplerCubeArrayShadow) +0:306 Constant: +0:306 0.500000 +0:306 0.500000 +0:306 0.500000 +0:306 0.500000 +0:306 Constant: +0:306 2.500000 +0:308 Sequence +0:308 move second child to first child ( temp highp 3-component vector of int) +0:308 's1' ( temp highp 3-component vector of int) +0:308 imageQuerySize ( global highp 3-component vector of int) +0:308 'CA1' ( writeonly uniform highp imageCubeArray) +0:309 Sequence +0:309 move second child to first child ( temp highp 3-component vector of int) +0:309 's2' ( temp highp 3-component vector of int) +0:309 imageQuerySize ( global highp 3-component vector of int) +0:309 'CA2' ( writeonly uniform highp iimageCubeArray) +0:310 Sequence +0:310 move second child to first child ( temp highp 3-component vector of int) +0:310 's3' ( temp highp 3-component vector of int) +0:310 imageQuerySize ( global highp 3-component vector of int) +0:310 'CA3' ( writeonly uniform highp uimageCubeArray) +0:312 imageStore ( global highp void) +0:312 'CA1' ( writeonly uniform highp imageCubeArray) +0:312 's3' ( temp highp 3-component vector of int) +0:312 Constant: +0:312 1.000000 +0:312 1.000000 +0:312 1.000000 +0:312 1.000000 +0:313 imageStore ( global highp void) +0:313 'CA2' ( writeonly uniform highp iimageCubeArray) +0:313 's3' ( temp highp 3-component vector of int) +0:313 Constant: +0:313 1 (const int) +0:313 1 (const int) +0:313 1 (const int) +0:313 1 (const int) +0:314 imageStore ( global highp void) +0:314 'CA3' ( writeonly uniform highp uimageCubeArray) +0:314 's3' ( temp highp 3-component vector of int) +0:314 Constant: +0:314 1 (const uint) +0:314 1 (const uint) +0:314 1 (const uint) +0:314 1 (const uint) +0:316 Sequence +0:316 move second child to first child ( temp highp 4-component vector of float) +0:316 'cl1' ( temp highp 4-component vector of float) +0:316 imageLoad ( global highp 4-component vector of float) +0:316 'rCA1' (layout( rgba16f) readonly uniform highp imageCubeArray) +0:316 's3' ( temp highp 3-component vector of int) +0:317 Sequence +0:317 move second child to first child ( temp highp 4-component vector of int) +0:317 'cl2' ( temp highp 4-component vector of int) +0:317 imageLoad ( global highp 4-component vector of int) +0:317 'rCA2' (layout( rgba32i) readonly uniform highp iimageCubeArray) +0:317 's3' ( temp highp 3-component vector of int) +0:318 Sequence +0:318 move second child to first child ( temp highp 4-component vector of uint) +0:318 'cl3' ( temp highp 4-component vector of uint) +0:318 imageLoad ( global highp 4-component vector of uint) +0:318 'rCA3' (layout( r32ui) readonly uniform highp uimageCubeArray) +0:318 's3' ( temp highp 3-component vector of int) +0:343 Function Definition: MSA( ( global void) +0:343 Function Parameters: +0:345 Sequence +0:345 Sequence +0:345 move second child to first child ( temp highp 4-component vector of float) +0:345 'tf' ( temp highp 4-component vector of float) +0:345 textureFetch ( global highp 4-component vector of float) +0:345 'samp2DMSA' ( uniform highp sampler2DMSArray) +0:345 Constant: +0:345 5 (const int) +0:345 5 (const int) +0:345 5 (const int) +0:345 Constant: +0:345 2 (const int) +0:346 Sequence +0:346 move second child to first child ( temp highp 4-component vector of int) +0:346 'tfi' ( temp highp 4-component vector of int) +0:346 textureFetch ( global highp 4-component vector of int) +0:346 'samp2DMSAi' ( uniform highp isampler2DMSArray) +0:346 Constant: +0:346 5 (const int) +0:346 5 (const int) +0:346 5 (const int) +0:346 Constant: +0:346 2 (const int) +0:347 Sequence +0:347 move second child to first child ( temp highp 4-component vector of uint) +0:347 'tfu' ( temp highp 4-component vector of uint) +0:347 textureFetch ( global highp 4-component vector of uint) +0:347 'samp2DMSAu' ( uniform highp usampler2DMSArray) +0:347 Constant: +0:347 5 (const int) +0:347 5 (const int) +0:347 5 (const int) +0:347 Constant: +0:347 2 (const int) +0:349 Sequence +0:349 move second child to first child ( temp highp 3-component vector of int) +0:349 'tfs' ( temp highp 3-component vector of int) +0:349 textureSize ( global highp 3-component vector of int) +0:349 'samp2DMSA' ( uniform highp sampler2DMSArray) +0:350 Sequence +0:350 move second child to first child ( temp highp 3-component vector of int) +0:350 'tfsi' ( temp highp 3-component vector of int) +0:350 textureSize ( global highp 3-component vector of int) +0:350 'samp2DMSAi' ( uniform highp isampler2DMSArray) +0:352 Sequence +0:352 move second child to first child ( temp highp 3-component vector of int) +0:352 'tfsu' ( temp highp 3-component vector of int) +0:352 textureSize ( global highp 3-component vector of int) +0:352 'samp2DMSAu' ( uniform highp usampler2DMSArray) +0:364 Function Definition: goodImageAtom( ( global void) +0:364 Function Parameters: +0:? Sequence +0:370 imageAtomicAdd ( global highp int) +0:370 'im2Di' (layout( r32i) uniform highp iimage2D) +0:370 'P' ( uniform highp 2-component vector of int) +0:370 'dati' ( temp highp int) +0:371 imageAtomicAdd ( global highp uint) +0:371 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:371 'P' ( uniform highp 2-component vector of int) +0:371 'datu' ( temp highp uint) +0:372 imageAtomicMin ( global highp int) +0:372 'im2Di' (layout( r32i) uniform highp iimage2D) +0:372 'P' ( uniform highp 2-component vector of int) +0:372 'dati' ( temp highp int) +0:373 imageAtomicMin ( global highp uint) +0:373 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:373 'P' ( uniform highp 2-component vector of int) +0:373 'datu' ( temp highp uint) +0:374 imageAtomicMax ( global highp int) +0:374 'im2Di' (layout( r32i) uniform highp iimage2D) +0:374 'P' ( uniform highp 2-component vector of int) +0:374 'dati' ( temp highp int) +0:375 imageAtomicMax ( global highp uint) +0:375 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:375 'P' ( uniform highp 2-component vector of int) +0:375 'datu' ( temp highp uint) +0:376 imageAtomicAnd ( global highp int) +0:376 'im2Di' (layout( r32i) uniform highp iimage2D) +0:376 'P' ( uniform highp 2-component vector of int) +0:376 'dati' ( temp highp int) +0:377 imageAtomicAnd ( global highp uint) +0:377 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:377 'P' ( uniform highp 2-component vector of int) +0:377 'datu' ( temp highp uint) +0:378 imageAtomicOr ( global highp int) +0:378 'im2Di' (layout( r32i) uniform highp iimage2D) +0:378 'P' ( uniform highp 2-component vector of int) +0:378 'dati' ( temp highp int) +0:379 imageAtomicOr ( global highp uint) +0:379 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:379 'P' ( uniform highp 2-component vector of int) +0:379 'datu' ( temp highp uint) +0:380 imageAtomicXor ( global highp int) +0:380 'im2Di' (layout( r32i) uniform highp iimage2D) +0:380 'P' ( uniform highp 2-component vector of int) +0:380 'dati' ( temp highp int) +0:381 imageAtomicXor ( global highp uint) +0:381 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:381 'P' ( uniform highp 2-component vector of int) +0:381 'datu' ( temp highp uint) +0:382 imageAtomicExchange ( global highp int) +0:382 'im2Di' (layout( r32i) uniform highp iimage2D) +0:382 'P' ( uniform highp 2-component vector of int) +0:382 'dati' ( temp highp int) +0:383 imageAtomicExchange ( global highp uint) +0:383 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:383 'P' ( uniform highp 2-component vector of int) +0:383 'datu' ( temp highp uint) +0:384 imageAtomicExchange ( global highp float) +0:384 'im2Df' (layout( r32f) uniform highp image2D) +0:384 'P' ( uniform highp 2-component vector of int) +0:384 'datf' ( temp highp float) +0:385 imageAtomicCompSwap ( global highp int) +0:385 'im2Di' (layout( r32i) uniform highp iimage2D) +0:385 'P' ( uniform highp 2-component vector of int) +0:385 Constant: +0:385 3 (const int) +0:385 'dati' ( temp highp int) +0:386 imageAtomicCompSwap ( global highp uint) +0:386 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:386 'P' ( uniform highp 2-component vector of int) +0:386 Constant: +0:386 5 (const uint) +0:386 'datu' ( temp highp uint) +0:398 Function Definition: badInterp( ( global void) +0:398 Function Parameters: +0:400 Sequence +0:400 Constant: +0:400 0.000000 +0:401 Constant: +0:401 0.000000 +0:402 Constant: +0:402 0.000000 +0:? Linker Objects +0:? 's' ( shared highp 4-component vector of float) +0:? 'v' ( buffer highp 4-component vector of float) +0:? 'ini' ( in highp int) +0:? 'x' (layout( location=2) uniform highp 4X4 matrix of float) +0:? 'y' (layout( location=3) uniform highp 4X4 matrix of float) +0:? 'xi' (layout( location=2) smooth out highp 4X4 matrix of float) +0:? 'yi' (layout( location=3) smooth out highp 4X4 matrix of float) +0:? 's2dms' ( uniform highp sampler2DMS) +0:? 'is2dms' ( uniform highp isampler2DMS) +0:? 'us2dms' ( uniform highp usampler2DMS) +0:? 'us2dmsa' ( uniform mediump usampler2DMSArray) +0:? 'outb' ( smooth out bool) +0:? 'outo' ( smooth out lowp sampler2D) +0:? 'outa' ( smooth out 4-element array of highp float) +0:? 'outaa' ( smooth out 4-element array of 2-element array of highp float) +0:? 'outs' ( smooth out structure{ global highp float f}) +0:? 'outasa' ( smooth out 4-element array of structure{ global highp float f}) +0:? 'outsa' ( smooth out 4-element array of structure{ global highp float f}) +0:? 'outSA' ( smooth out structure{ global 4-element array of highp float f}) +0:? 'outSS' ( smooth out structure{ global highp float f, global structure{ global highp float f} s}) +0:? 'U430i' (layout( column_major std430) uniform block{layout( column_major std430 offset=0) uniform highp int a}) +0:? 'B430i' (layout( column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp int a}) +0:? 'outbinst' ( out block{ out highp int a, out highp 4-component vector of float v, out highp sampler2D s}) +0:? 'anon@0' ( out block{layout( location=12) out highp int aAnon, layout( location=13) out highp 4-component vector of float vAnon}) +0:? 'aliased' (layout( location=12) smooth out highp int) +0:? 'inbinst' ( in block{ in highp int a}) +0:? 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, }) +0:? 'smon' ( smooth out block{ out highp int i}) +0:? 'fmon' ( flat out block{ out highp int i}) +0:? 'cmon' ( centroid out block{ out highp int i}) +0:? 'imon' ( invariant out block{ out highp int i}) +0:? 'inf' ( in highp 2-component vector of float) +0:? 'ing' ( in highp 2-component vector of float) +0:? 'offsets' ( uniform 4-element array of highp 2-component vector of int) +0:? 'sArray' ( uniform 4-element array of lowp sampler2D) +0:? 'sIndex' ( uniform highp int) +0:? 'auArray' (layout( binding=0 offset=0) uniform 2-element array of highp atomic_uint) +0:? 'ubInst' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform highp int i}) +0:? 'bbInst' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer highp int i}) +0:? 'iArray' ( writeonly uniform 5-element array of highp image2D) +0:? 'constOffsets' ( const 4-element array of highp 2-component vector of int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 'badSamp1' ( uniform mediump samplerBuffer) +0:? 'badSamp2' ( uniform mediump isamplerBuffer) +0:? 'badSamp3' ( uniform mediump usamplerBuffer) +0:? 'badSamp4' ( writeonly uniform mediump imageBuffer) +0:? 'badSamp5' ( writeonly uniform mediump iimageBuffer) +0:? 'badSamp6' ( writeonly uniform mediump uimageBuffer) +0:? 'noPreSamp1' ( uniform mediump samplerBuffer) +0:? 'noPreSamp2' ( uniform mediump isamplerBuffer) +0:? 'noPreSamp3' ( uniform mediump usamplerBuffer) +0:? 'noPreSamp4' ( writeonly uniform mediump imageBuffer) +0:? 'noPreSamp5' ( writeonly uniform mediump iimageBuffer) +0:? 'noPreSamp6' ( writeonly uniform mediump uimageBuffer) +0:? 'bufSamp1' ( uniform highp samplerBuffer) +0:? 'bufSamp2' ( uniform highp isamplerBuffer) +0:? 'bufSamp3' ( uniform highp usamplerBuffer) +0:? 'bufSamp4' ( writeonly uniform highp imageBuffer) +0:? 'bufSamp5' ( writeonly uniform highp iimageBuffer) +0:? 'bufSamp6' ( writeonly uniform highp uimageBuffer) +0:? 'badCA1' ( writeonly uniform mediump imageCubeArray) +0:? 'badCA2' ( writeonly uniform mediump iimageCubeArray) +0:? 'badCA3' ( writeonly uniform mediump uimageCubeArray) +0:? 'badCA4' ( uniform mediump samplerCubeArray) +0:? 'badCA5' ( uniform mediump samplerCubeArrayShadow) +0:? 'badCA6' ( uniform mediump isamplerCubeArray) +0:? 'badCA7' ( uniform mediump usamplerCubeArray) +0:? 'noPreCA1' ( writeonly uniform mediump imageCubeArray) +0:? 'noPreCA2' ( writeonly uniform mediump iimageCubeArray) +0:? 'noPreCA3' ( writeonly uniform mediump uimageCubeArray) +0:? 'noPreCA4' ( uniform mediump samplerCubeArray) +0:? 'noPreCA5' ( uniform mediump samplerCubeArrayShadow) +0:? 'noPreCA6' ( uniform mediump isamplerCubeArray) +0:? 'noPreCA7' ( uniform mediump usamplerCubeArray) +0:? 'CA1' ( writeonly uniform highp imageCubeArray) +0:? 'CA2' ( writeonly uniform highp iimageCubeArray) +0:? 'CA3' ( writeonly uniform highp uimageCubeArray) +0:? 'rCA1' (layout( rgba16f) readonly uniform highp imageCubeArray) +0:? 'rCA2' (layout( rgba32i) readonly uniform highp iimageCubeArray) +0:? 'rCA3' (layout( r32ui) readonly uniform highp uimageCubeArray) +0:? 'CA4' ( uniform highp samplerCubeArray) +0:? 'CA5' ( uniform highp samplerCubeArrayShadow) +0:? 'CA6' ( uniform highp isamplerCubeArray) +0:? 'CA7' ( uniform highp usamplerCubeArray) +0:? 'bad2DMS' ( uniform mediump sampler2DMSArray) +0:? 'bad2DMSi' ( uniform mediump isampler2DMSArray) +0:? 'bad2DMSu' ( uniform mediump usampler2DMSArray) +0:? 'noPrec2DMS' ( uniform mediump sampler2DMSArray) +0:? 'noPrec2DMSi' ( uniform mediump isampler2DMSArray) +0:? 'noPrec2DMSu' ( uniform mediump usampler2DMSArray) +0:? 'samp2DMSA' ( uniform highp sampler2DMSArray) +0:? 'samp2DMSAi' ( uniform highp isampler2DMSArray) +0:? 'samp2DMSAu' ( uniform highp usampler2DMSArray) +0:? 'im2Df' (layout( r32f) uniform highp image2D) +0:? 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:? 'im2Di' (layout( r32i) uniform highp iimage2D) +0:? 'P' ( uniform highp 2-component vector of int) +0:? 'colorSampInBad' ( smooth sample out highp 4-component vector of float) +0:? 'colorSample' ( smooth sample out highp 4-component vector of float) +0:? 'colorfsi' ( flat sample out highp 4-component vector of float) +0:? 'sampInArray' ( smooth sample out 4-element array of highp 3-component vector of float) +0:? 'inv4' ( in highp 4-component vector of float) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + + +Linked vertex stage: + + +Shader version: 310 +Requested GL_EXT_texture_buffer +Requested GL_OES_gpu_shader5 +Requested GL_OES_shader_image_atomic +Requested GL_OES_shader_io_blocks +Requested GL_OES_shader_multisample_interpolation +Requested GL_OES_texture_buffer +Requested GL_OES_texture_cube_map_array +Requested GL_OES_texture_storage_multisample_2d_array +ERROR: node is still EOpNull! +0:12 Function Definition: main( ( global void) +0:12 Function Parameters: +0:? Sequence +0:15 move second child to first child ( temp highp 2-component vector of uint) +0:15 'u2' ( temp highp 2-component vector of uint) +0:15 addCarry ( global highp 2-component vector of uint) +0:15 'u2' ( temp highp 2-component vector of uint) +0:15 'u2' ( temp highp 2-component vector of uint) +0:15 'u2' ( temp highp 2-component vector of uint) +0:17 move second child to first child ( temp highp uint) +0:17 'u1' ( temp highp uint) +0:17 subBorrow ( global highp uint) +0:17 'u1' ( temp highp uint) +0:17 'u1' ( temp highp uint) +0:17 'u1' ( temp highp uint) +0:19 uMulExtended ( global highp void) +0:19 'u4' ( temp highp 4-component vector of uint) +0:19 'u4' ( temp highp 4-component vector of uint) +0:19 'u4' ( temp highp 4-component vector of uint) +0:19 'u4' ( temp highp 4-component vector of uint) +0:21 iMulExtended ( global highp void) +0:21 'i4' ( temp highp 4-component vector of int) +0:21 'i4' ( temp highp 4-component vector of int) +0:21 'i4' ( temp highp 4-component vector of int) +0:21 'i4' ( temp highp 4-component vector of int) +0:23 move second child to first child ( temp highp int) +0:23 'i1' ( temp highp int) +0:23 bitfieldExtract ( global highp int) +0:23 'i1' ( temp highp int) +0:23 Constant: +0:23 4 (const int) +0:23 Constant: +0:23 5 (const int) +0:25 move second child to first child ( temp highp 3-component vector of uint) +0:25 'u3' ( temp highp 3-component vector of uint) +0:25 bitfieldExtract ( global highp 3-component vector of uint) +0:25 'u3' ( temp highp 3-component vector of uint) +0:25 Constant: +0:25 4 (const int) +0:25 Constant: +0:25 5 (const int) +0:27 move second child to first child ( temp highp 3-component vector of int) +0:27 'i3' ( temp highp 3-component vector of int) +0:27 bitfieldInsert ( global highp 3-component vector of int) +0:27 'i3' ( temp highp 3-component vector of int) +0:27 'i3' ( temp highp 3-component vector of int) +0:27 Constant: +0:27 4 (const int) +0:27 Constant: +0:27 5 (const int) +0:28 move second child to first child ( temp highp uint) +0:28 'u1' ( temp highp uint) +0:28 bitfieldInsert ( global highp uint) +0:28 'u1' ( temp highp uint) +0:28 'u1' ( temp highp uint) +0:28 Constant: +0:28 4 (const int) +0:28 Constant: +0:28 5 (const int) +0:30 move second child to first child ( temp highp 2-component vector of int) +0:30 'i2' ( temp highp 2-component vector of int) +0:30 bitFieldReverse ( global highp 2-component vector of int) +0:30 'i2' ( temp highp 2-component vector of int) +0:31 move second child to first child ( temp highp 4-component vector of uint) +0:31 'u4' ( temp highp 4-component vector of uint) +0:31 bitFieldReverse ( global highp 4-component vector of uint) +0:31 'u4' ( temp highp 4-component vector of uint) +0:32 move second child to first child ( temp highp int) +0:32 'i1' ( temp highp int) +0:32 bitCount ( global lowp int, operation at highp) +0:32 'i1' ( temp highp int) +0:33 move second child to first child ( temp highp 3-component vector of int) +0:33 'i3' ( temp highp 3-component vector of int) +0:33 bitCount ( global lowp 3-component vector of int, operation at highp) +0:33 'u3' ( temp highp 3-component vector of uint) +0:34 move second child to first child ( temp highp 2-component vector of int) +0:34 'i2' ( temp highp 2-component vector of int) +0:34 findLSB ( global lowp 2-component vector of int, operation at highp) +0:34 'i2' ( temp highp 2-component vector of int) +0:35 move second child to first child ( temp highp 4-component vector of int) +0:35 'i4' ( temp highp 4-component vector of int) +0:35 findLSB ( global lowp 4-component vector of int, operation at highp) +0:35 'u4' ( temp highp 4-component vector of uint) +0:36 move second child to first child ( temp highp int) +0:36 'i1' ( temp highp int) +0:36 findMSB ( global lowp int, operation at highp) +0:36 'i1' ( temp highp int) +0:37 move second child to first child ( temp highp 2-component vector of int) +0:37 'i2' ( temp highp 2-component vector of int) +0:37 findMSB ( global lowp 2-component vector of int, operation at highp) +0:37 'u2' ( temp highp 2-component vector of uint) +0:40 move second child to first child ( temp highp 3-component vector of float) +0:40 'v3' ( temp highp 3-component vector of float) +0:40 frexp ( global highp 3-component vector of float) +0:40 'v3' ( temp highp 3-component vector of float) +0:40 'i3' ( temp highp 3-component vector of int) +0:42 move second child to first child ( temp highp 2-component vector of float) +0:42 'v2' ( temp highp 2-component vector of float) +0:42 ldexp ( global highp 2-component vector of float) +0:42 'v2' ( temp highp 2-component vector of float) +0:42 'i2' ( temp highp 2-component vector of int) +0:45 move second child to first child ( temp highp uint) +0:45 'u1' ( temp highp uint) +0:45 PackUnorm4x8 ( global highp uint, operation at mediump) +0:45 'v4' ( temp mediump 4-component vector of float) +0:46 move second child to first child ( temp highp uint) +0:46 'u1' ( temp highp uint) +0:46 PackSnorm4x8 ( global highp uint, operation at mediump) +0:46 'v4' ( temp mediump 4-component vector of float) +0:47 move second child to first child ( temp mediump 4-component vector of float) +0:47 'v4' ( temp mediump 4-component vector of float) +0:47 UnpackUnorm4x8 ( global mediump 4-component vector of float, operation at highp) +0:47 'u1' ( temp highp uint) +0:48 move second child to first child ( temp mediump 4-component vector of float) +0:48 'v4' ( temp mediump 4-component vector of float) +0:48 UnpackSnorm4x8 ( global mediump 4-component vector of float, operation at highp) +0:48 'u1' ( temp highp uint) +0:? Linker Objects +0:? 's' ( shared highp 4-component vector of float) +0:? 'v' ( buffer highp 4-component vector of float) +0:? 'ini' ( in highp int) +0:? 'x' (layout( location=2) uniform highp 4X4 matrix of float) +0:? 'y' (layout( location=3) uniform highp 4X4 matrix of float) +0:? 'xi' (layout( location=2) smooth out highp 4X4 matrix of float) +0:? 'yi' (layout( location=3) smooth out highp 4X4 matrix of float) +0:? 's2dms' ( uniform highp sampler2DMS) +0:? 'is2dms' ( uniform highp isampler2DMS) +0:? 'us2dms' ( uniform highp usampler2DMS) +0:? 'us2dmsa' ( uniform mediump usampler2DMSArray) +0:? 'outb' ( smooth out bool) +0:? 'outo' ( smooth out lowp sampler2D) +0:? 'outa' ( smooth out 4-element array of highp float) +0:? 'outaa' ( smooth out 4-element array of 2-element array of highp float) +0:? 'outs' ( smooth out structure{ global highp float f}) +0:? 'outasa' ( smooth out 4-element array of structure{ global highp float f}) +0:? 'outsa' ( smooth out 4-element array of structure{ global highp float f}) +0:? 'outSA' ( smooth out structure{ global 4-element array of highp float f}) +0:? 'outSS' ( smooth out structure{ global highp float f, global structure{ global highp float f} s}) +0:? 'U430i' (layout( column_major std430) uniform block{layout( column_major std430 offset=0) uniform highp int a}) +0:? 'B430i' (layout( column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp int a}) +0:? 'outbinst' ( out block{ out highp int a, out highp 4-component vector of float v, out highp sampler2D s}) +0:? 'anon@0' ( out block{layout( location=12) out highp int aAnon, layout( location=13) out highp 4-component vector of float vAnon}) +0:? 'aliased' (layout( location=12) smooth out highp int) +0:? 'inbinst' ( in block{ in highp int a}) +0:? 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, }) +0:? 'smon' ( smooth out block{ out highp int i}) +0:? 'fmon' ( flat out block{ out highp int i}) +0:? 'cmon' ( centroid out block{ out highp int i}) +0:? 'imon' ( invariant out block{ out highp int i}) +0:? 'inf' ( in highp 2-component vector of float) +0:? 'ing' ( in highp 2-component vector of float) +0:? 'offsets' ( uniform 4-element array of highp 2-component vector of int) +0:? 'sArray' ( uniform 4-element array of lowp sampler2D) +0:? 'sIndex' ( uniform highp int) +0:? 'auArray' (layout( binding=0 offset=0) uniform 2-element array of highp atomic_uint) +0:? 'ubInst' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform highp int i}) +0:? 'bbInst' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer highp int i}) +0:? 'iArray' ( writeonly uniform 5-element array of highp image2D) +0:? 'constOffsets' ( const 4-element array of highp 2-component vector of int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 'badSamp1' ( uniform mediump samplerBuffer) +0:? 'badSamp2' ( uniform mediump isamplerBuffer) +0:? 'badSamp3' ( uniform mediump usamplerBuffer) +0:? 'badSamp4' ( writeonly uniform mediump imageBuffer) +0:? 'badSamp5' ( writeonly uniform mediump iimageBuffer) +0:? 'badSamp6' ( writeonly uniform mediump uimageBuffer) +0:? 'noPreSamp1' ( uniform mediump samplerBuffer) +0:? 'noPreSamp2' ( uniform mediump isamplerBuffer) +0:? 'noPreSamp3' ( uniform mediump usamplerBuffer) +0:? 'noPreSamp4' ( writeonly uniform mediump imageBuffer) +0:? 'noPreSamp5' ( writeonly uniform mediump iimageBuffer) +0:? 'noPreSamp6' ( writeonly uniform mediump uimageBuffer) +0:? 'bufSamp1' ( uniform highp samplerBuffer) +0:? 'bufSamp2' ( uniform highp isamplerBuffer) +0:? 'bufSamp3' ( uniform highp usamplerBuffer) +0:? 'bufSamp4' ( writeonly uniform highp imageBuffer) +0:? 'bufSamp5' ( writeonly uniform highp iimageBuffer) +0:? 'bufSamp6' ( writeonly uniform highp uimageBuffer) +0:? 'badCA1' ( writeonly uniform mediump imageCubeArray) +0:? 'badCA2' ( writeonly uniform mediump iimageCubeArray) +0:? 'badCA3' ( writeonly uniform mediump uimageCubeArray) +0:? 'badCA4' ( uniform mediump samplerCubeArray) +0:? 'badCA5' ( uniform mediump samplerCubeArrayShadow) +0:? 'badCA6' ( uniform mediump isamplerCubeArray) +0:? 'badCA7' ( uniform mediump usamplerCubeArray) +0:? 'noPreCA1' ( writeonly uniform mediump imageCubeArray) +0:? 'noPreCA2' ( writeonly uniform mediump iimageCubeArray) +0:? 'noPreCA3' ( writeonly uniform mediump uimageCubeArray) +0:? 'noPreCA4' ( uniform mediump samplerCubeArray) +0:? 'noPreCA5' ( uniform mediump samplerCubeArrayShadow) +0:? 'noPreCA6' ( uniform mediump isamplerCubeArray) +0:? 'noPreCA7' ( uniform mediump usamplerCubeArray) +0:? 'CA1' ( writeonly uniform highp imageCubeArray) +0:? 'CA2' ( writeonly uniform highp iimageCubeArray) +0:? 'CA3' ( writeonly uniform highp uimageCubeArray) +0:? 'rCA1' (layout( rgba16f) readonly uniform highp imageCubeArray) +0:? 'rCA2' (layout( rgba32i) readonly uniform highp iimageCubeArray) +0:? 'rCA3' (layout( r32ui) readonly uniform highp uimageCubeArray) +0:? 'CA4' ( uniform highp samplerCubeArray) +0:? 'CA5' ( uniform highp samplerCubeArrayShadow) +0:? 'CA6' ( uniform highp isamplerCubeArray) +0:? 'CA7' ( uniform highp usamplerCubeArray) +0:? 'bad2DMS' ( uniform mediump sampler2DMSArray) +0:? 'bad2DMSi' ( uniform mediump isampler2DMSArray) +0:? 'bad2DMSu' ( uniform mediump usampler2DMSArray) +0:? 'noPrec2DMS' ( uniform mediump sampler2DMSArray) +0:? 'noPrec2DMSi' ( uniform mediump isampler2DMSArray) +0:? 'noPrec2DMSu' ( uniform mediump usampler2DMSArray) +0:? 'samp2DMSA' ( uniform highp sampler2DMSArray) +0:? 'samp2DMSAi' ( uniform highp isampler2DMSArray) +0:? 'samp2DMSAu' ( uniform highp usampler2DMSArray) +0:? 'im2Df' (layout( r32f) uniform highp image2D) +0:? 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:? 'im2Di' (layout( r32i) uniform highp iimage2D) +0:? 'P' ( uniform highp 2-component vector of int) +0:? 'colorSampInBad' ( smooth sample out highp 4-component vector of float) +0:? 'colorSample' ( smooth sample out highp 4-component vector of float) +0:? 'colorfsi' ( flat sample out highp 4-component vector of float) +0:? 'sampInArray' ( smooth sample out 4-element array of highp 3-component vector of float) +0:? 'inv4' ( in highp 4-component vector of float) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + diff --git a/deps/glslang/Test/baseResults/310AofA.vert.out b/deps/glslang/Test/baseResults/310AofA.vert.out new file mode 100644 index 00000000..451cc0b4 --- /dev/null +++ b/deps/glslang/Test/baseResults/310AofA.vert.out @@ -0,0 +1,394 @@ +310AofA.vert +ERROR: 0:17: '' : array size required +ERROR: 0:23: '' : array size required +ERROR: 0:28: '[]' : only outermost dimension of an array of arrays can be implicitly sized +ERROR: 0:40: '' : array size required +ERROR: 0:48: 'constructor' : constructing non-array constituent from array argument +ERROR: 0:49: 'constructor' : array constructor argument not correct type to construct array element +ERROR: 0:62: '[' : array index out of range '4' +ERROR: 0:78: 'assign' : cannot convert from ' global 4-element array of 7-element array of highp float' to ' global 5-element array of 7-element array of highp float' +ERROR: 0:79: 'assign' : cannot convert from ' global 4-element array of 7-element array of highp float' to ' global unsized 1-element array of 7-element array of highp float' +ERROR: 0:81: 'foo' : no matching overloaded function found +ERROR: 0:86: '==' : wrong operand types: no operation '==' exists that takes a left-hand operand of type ' global 4-element array of 7-element array of highp float' and a right operand of type ' global 5-element array of 7-element array of highp float' (or there is no acceptable conversion) +ERROR: 0:90: '[' : array index out of range '5' +ERROR: 0:94: '[' : index out of range '-1' +ERROR: 0:96: 'assign' : cannot convert from ' temp 3-element array of highp 4-component vector of float' to 'layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float' +ERROR: 0:103: '' : array size required +ERROR: 0:104: '' : array size required +ERROR: 0:105: '' : array size required +ERROR: 0:106: '' : array size required +ERROR: 0:107: '' : array size required +ERROR: 0:110: 'vertex input arrays' : not supported with this profile: es +ERROR: 0:111: 'vertex-shader array-of-array output' : not supported with this profile: es +ERROR: 0:113: 'array-of-array of block' : not supported with this profile: es +ERROR: 22 compilation errors. No code generated. + + +Shader version: 310 +ERROR: node is still EOpNull! +0:8 Function Definition: f(b1;f1;u1[4];i1[3][2]; ( global void) +0:8 Function Parameters: +0:8 'a' ( in bool) +0:8 'b' ( in highp float) +0:8 'c' ( in 4-element array of highp uint) +0:8 'd' ( in 3-element array of 2-element array of highp int) +0:11 Function Definition: main( ( global void) +0:11 Function Parameters: +0:? Sequence +0:13 Function Call: f(b1;f1;u1[4];i1[3][2]; ( global void) +0:13 Constant: +0:13 false (const bool) +0:13 Constant: +0:13 12.100000 +0:13 Constant: +0:13 0 (const uint) +0:13 1 (const uint) +0:13 1 (const uint) +0:13 2 (const uint) +0:13 'd' ( temp 3-element array of 2-element array of highp int) +0:44 Function Definition: foo(f1[5][7]; ( global 4-element array of 7-element array of highp float) +0:44 Function Parameters: +0:44 'a' ( in 5-element array of 7-element array of highp float) +0:? Sequence +0:47 move second child to first child ( temp 7-element array of highp float) +0:47 'r' ( temp 7-element array of highp float) +0:47 direct index ( temp 7-element array of highp float) +0:47 'a' ( in 5-element array of 7-element array of highp float) +0:47 Constant: +0:47 2 (const int) +0:48 Constant: +0:48 0.000000 +0:49 Constant: +0:49 0.000000 +0:50 Branch: Return with expression +0:50 Construct float ( temp 4-element array of 7-element array of float) +0:50 direct index ( temp 7-element array of highp float) +0:50 'a' ( in 5-element array of 7-element array of highp float) +0:50 Constant: +0:50 0 (const int) +0:50 direct index ( temp 7-element array of highp float) +0:50 'a' ( in 5-element array of 7-element array of highp float) +0:50 Constant: +0:50 1 (const int) +0:50 'r' ( temp 7-element array of highp float) +0:50 direct index ( temp 7-element array of highp float) +0:50 'a' ( in 5-element array of 7-element array of highp float) +0:50 Constant: +0:50 3 (const int) +0:51 Branch: Return with expression +0:51 Construct float ( temp 4-element array of 7-element array of float) +0:51 direct index ( temp 7-element array of highp float) +0:51 'a' ( in 5-element array of 7-element array of highp float) +0:51 Constant: +0:51 0 (const int) +0:51 direct index ( temp 7-element array of highp float) +0:51 'a' ( in 5-element array of 7-element array of highp float) +0:51 Constant: +0:51 1 (const int) +0:51 'r' ( temp 7-element array of highp float) +0:51 direct index ( temp 7-element array of highp float) +0:51 'a' ( in 5-element array of 7-element array of highp float) +0:51 Constant: +0:51 3 (const int) +0:52 Branch: Return with expression +0:52 Construct float ( temp 4-element array of 7-element array of float) +0:52 direct index ( temp 7-element array of highp float) +0:52 'a' ( in 5-element array of 7-element array of highp float) +0:52 Constant: +0:52 0 (const int) +0:52 direct index ( temp 7-element array of highp float) +0:52 'a' ( in 5-element array of 7-element array of highp float) +0:52 Constant: +0:52 1 (const int) +0:52 direct index ( temp 7-element array of highp float) +0:52 'a' ( in 5-element array of 7-element array of highp float) +0:52 Constant: +0:52 2 (const int) +0:52 direct index ( temp 7-element array of highp float) +0:52 'a' ( in 5-element array of 7-element array of highp float) +0:52 Constant: +0:52 3 (const int) +0:55 Function Definition: bar(f1[5][7]; ( global void) +0:55 Function Parameters: +0:55 '' ( in 5-element array of 7-element array of highp float) +0:57 Function Definition: foo2( ( global void) +0:57 Function Parameters: +0:? Sequence +0:? Sequence +0:62 move second child to first child ( temp highp float) +0:62 direct index ( temp highp float) +0:62 direct index ( temp 2-element array of highp float) +0:62 direct index ( temp 4-element array of 2-element array of highp float) +0:62 'gu' ( temp 3-element array of 4-element array of 2-element array of highp float) +0:62 Constant: +0:62 2 (const int) +0:62 Constant: +0:62 4 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 4.000000 +0:64 Sequence +0:64 move second child to first child ( temp 3-element array of 2-element array of highp 4-component vector of float) +0:64 'ca4' ( temp 3-element array of 2-element array of highp 4-component vector of float) +0:66 Constant: +0:66 0.000000 +0:66 0.000000 +0:66 0.000000 +0:66 0.000000 +0:66 1.000000 +0:66 1.000000 +0:66 1.000000 +0:66 1.000000 +0:66 0.000000 +0:66 0.000000 +0:66 0.000000 +0:66 0.000000 +0:66 1.000000 +0:66 1.000000 +0:66 1.000000 +0:66 1.000000 +0:66 0.000000 +0:66 0.000000 +0:66 0.000000 +0:66 0.000000 +0:66 1.000000 +0:66 1.000000 +0:66 1.000000 +0:66 1.000000 +0:67 Sequence +0:67 move second child to first child ( temp 3-element array of 2-element array of highp 4-component vector of float) +0:67 'caim' ( temp 3-element array of 2-element array of highp 4-component vector of float) +0:69 Constant: +0:69 4.000000 +0:69 4.000000 +0:69 4.000000 +0:69 4.000000 +0:69 2.000000 +0:69 2.000000 +0:69 2.000000 +0:69 2.000000 +0:69 4.000000 +0:69 4.000000 +0:69 4.000000 +0:69 4.000000 +0:69 2.000000 +0:69 2.000000 +0:69 2.000000 +0:69 2.000000 +0:69 4.000000 +0:69 4.000000 +0:69 4.000000 +0:69 4.000000 +0:69 2.000000 +0:69 2.000000 +0:69 2.000000 +0:69 2.000000 +0:70 Sequence +0:70 move second child to first child ( temp 3-element array of 2-element array of highp 4-component vector of float) +0:70 'caim2' ( temp 3-element array of 2-element array of highp 4-component vector of float) +0:72 Constant: +0:72 4.000000 +0:72 4.000000 +0:72 4.000000 +0:72 4.000000 +0:72 2.000000 +0:72 2.000000 +0:72 2.000000 +0:72 2.000000 +0:72 4.000000 +0:72 4.000000 +0:72 4.000000 +0:72 4.000000 +0:72 2.000000 +0:72 2.000000 +0:72 2.000000 +0:72 2.000000 +0:72 4.000000 +0:72 4.000000 +0:72 4.000000 +0:72 4.000000 +0:72 2.000000 +0:72 2.000000 +0:72 2.000000 +0:72 2.000000 +0:73 Sequence +0:73 move second child to first child ( temp 3-element array of 2-element array of highp 4-component vector of float) +0:73 'caim3' ( temp 3-element array of 2-element array of highp 4-component vector of float) +0:75 Constant: +0:75 4.000000 +0:75 4.000000 +0:75 4.000000 +0:75 4.000000 +0:75 2.000000 +0:75 2.000000 +0:75 2.000000 +0:75 2.000000 +0:75 4.000000 +0:75 4.000000 +0:75 4.000000 +0:75 4.000000 +0:75 2.000000 +0:75 2.000000 +0:75 2.000000 +0:75 2.000000 +0:75 4.000000 +0:75 4.000000 +0:75 4.000000 +0:75 4.000000 +0:75 2.000000 +0:75 2.000000 +0:75 2.000000 +0:75 2.000000 +0:77 move second child to first child ( temp 4-element array of 7-element array of highp float) +0:77 'g4' ( global 4-element array of 7-element array of highp float) +0:77 Function Call: foo(f1[5][7]; ( global 4-element array of 7-element array of highp float) +0:77 'g5' ( global 5-element array of 7-element array of highp float) +0:78 'g5' ( global 5-element array of 7-element array of highp float) +0:79 'gu' ( global unsized 1-element array of 7-element array of highp float) +0:81 Constant: +0:81 0.000000 +0:82 Function Call: bar(f1[5][7]; ( global void) +0:82 'g5' ( global 5-element array of 7-element array of highp float) +0:84 Test condition and select ( temp void) +0:84 Condition +0:84 Compare Equal ( temp bool) +0:84 Function Call: foo(f1[5][7]; ( global 4-element array of 7-element array of highp float) +0:84 'g5' ( global 5-element array of 7-element array of highp float) +0:84 'g4' ( global 4-element array of 7-element array of highp float) +0:84 true case is null +0:86 Test condition and select ( temp void) +0:86 Condition +0:86 Constant: +0:86 false (const bool) +0:86 true case is null +0:90 move second child to first child ( temp highp float) +0:90 direct index ( temp highp float) +0:90 direct index ( temp 7-element array of highp float) +0:90 'u' ( temp 5-element array of 7-element array of highp float) +0:90 Constant: +0:90 5 (const int) +0:90 Constant: +0:90 2 (const int) +0:90 Constant: +0:90 5.000000 +0:91 Function Call: foo(f1[5][7]; ( global 4-element array of 7-element array of highp float) +0:91 'u' ( temp 5-element array of 7-element array of highp float) +0:94 direct index (layout( column_major shared) temp highp 4-component vector of float) +0:94 v: direct index for structure (layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float) +0:94 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer unsized 1-element array of highp float u, layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float v}) +0:94 'name' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer unsized 1-element array of highp float u, layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float v}) +0:94 Constant: +0:94 1 (const int) +0:94 Constant: +0:94 1 (const int) +0:94 Constant: +0:94 -1 (const int) +0:95 move second child to first child ( temp highp 4-component vector of float) +0:95 direct index (layout( column_major shared) temp highp 4-component vector of float) +0:95 v: direct index for structure (layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float) +0:95 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer unsized 1-element array of highp float u, layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float v}) +0:95 'name' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer unsized 1-element array of highp float u, layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float v}) +0:95 Constant: +0:95 1 (const int) +0:95 Constant: +0:95 1 (const int) +0:95 Constant: +0:95 1 (const int) +0:95 Constant: +0:95 4.300000 +0:95 4.300000 +0:95 4.300000 +0:95 4.300000 +0:96 v: direct index for structure (layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float) +0:96 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer unsized 1-element array of highp float u, layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float v}) +0:96 'name' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer unsized 1-element array of highp float u, layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float v}) +0:96 Constant: +0:96 1 (const int) +0:96 Constant: +0:96 1 (const int) +0:98 Constant: +0:98 7 (const int) +0:99 array length ( temp int) +0:99 v: direct index for structure (layout( column_major shared) buffer unsized 2-element array of 7-element array of highp 4-component vector of float) +0:99 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer highp float u, layout( column_major shared) buffer unsized 2-element array of 7-element array of highp 4-component vector of float v}) +0:99 'name3' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer highp float u, layout( column_major shared) buffer unsized 2-element array of 7-element array of highp 4-component vector of float v}) +0:99 Constant: +0:99 0 (const int) +0:99 Constant: +0:99 1 (const int) +0:117 Function Definition: func(mf33[3][2]; ( global highp 3-component vector of float) +0:117 Function Parameters: +0:117 'x' ( in 3-element array of 2-element array of highp 3X3 matrix of float) +0:119 Sequence +0:119 Sequence +0:119 move second child to first child ( temp highp 3X3 matrix of float) +0:119 'a0' ( temp highp 3X3 matrix of float) +0:119 direct index ( temp highp 3X3 matrix of float) +0:119 direct index ( temp 2-element array of highp 3X3 matrix of float) +0:119 'x' ( in 3-element array of 2-element array of highp 3X3 matrix of float) +0:119 Constant: +0:119 2 (const int) +0:119 Constant: +0:119 1 (const int) +0:120 Branch: Return with expression +0:120 direct index ( temp highp 3-component vector of float) +0:120 'a0' ( temp highp 3X3 matrix of float) +0:120 Constant: +0:120 2 (const int) +0:? Linker Objects +0:? 'name' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer unsized 1-element array of highp float u, layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float v}) +0:? 'uname' (layout( column_major shared) uniform 3-element array of block{layout( column_major shared) uniform highp float u, layout( column_major shared) uniform unsized 1-element array of highp 4-component vector of float v}) +0:? 'name2' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer highp float u, layout( column_major shared) buffer unsized 1-element array of 1-element array of highp 4-component vector of float v}) +0:? 'name3' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer highp float u, layout( column_major shared) buffer unsized 2-element array of 7-element array of highp 4-component vector of float v}) +0:? 'many' ( global 1-element array of 2-element array of 3-element array of 4-element array of 5-element array of 6-element array of highp float) +0:? 'gu' ( global unsized 1-element array of 7-element array of highp float) +0:? 'g4' ( global 4-element array of 7-element array of highp float) +0:? 'g5' ( global 5-element array of 7-element array of highp float) +0:? 'inArray' ( in 2-element array of 3-element array of highp float) +0:? 'outArray' ( smooth out 2-element array of 3-element array of highp float) +0:? 'ubaaname' (layout( column_major shared) uniform 2-element array of 3-element array of block{layout( column_major shared) uniform highp int a}) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + + +Linked vertex stage: + + +Shader version: 310 +ERROR: node is still EOpNull! +0:8 Function Definition: f(b1;f1;u1[4];i1[3][2]; ( global void) +0:8 Function Parameters: +0:8 'a' ( in bool) +0:8 'b' ( in highp float) +0:8 'c' ( in 4-element array of highp uint) +0:8 'd' ( in 3-element array of 2-element array of highp int) +0:11 Function Definition: main( ( global void) +0:11 Function Parameters: +0:? Sequence +0:13 Function Call: f(b1;f1;u1[4];i1[3][2]; ( global void) +0:13 Constant: +0:13 false (const bool) +0:13 Constant: +0:13 12.100000 +0:13 Constant: +0:13 0 (const uint) +0:13 1 (const uint) +0:13 1 (const uint) +0:13 2 (const uint) +0:13 'd' ( temp 3-element array of 2-element array of highp int) +0:? Linker Objects +0:? 'name' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer 1-element array of highp float u, layout( column_major shared) buffer unsized 2-element array of highp 4-component vector of float v}) +0:? 'uname' (layout( column_major shared) uniform 3-element array of block{layout( column_major shared) uniform highp float u, layout( column_major shared) uniform 1-element array of highp 4-component vector of float v}) +0:? 'name2' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer highp float u, layout( column_major shared) buffer unsized 1-element array of 1-element array of highp 4-component vector of float v}) +0:? 'name3' (layout( column_major shared) buffer 3-element array of block{layout( column_major shared) buffer highp float u, layout( column_major shared) buffer unsized 2-element array of 7-element array of highp 4-component vector of float v}) +0:? 'many' ( global 1-element array of 2-element array of 3-element array of 4-element array of 5-element array of 6-element array of highp float) +0:? 'gu' ( global 1-element array of 7-element array of highp float) +0:? 'g4' ( global 4-element array of 7-element array of highp float) +0:? 'g5' ( global 5-element array of 7-element array of highp float) +0:? 'inArray' ( in 2-element array of 3-element array of highp float) +0:? 'outArray' ( smooth out 2-element array of 3-element array of highp float) +0:? 'ubaaname' (layout( column_major shared) uniform 2-element array of 3-element array of block{layout( column_major shared) uniform highp int a}) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + diff --git a/deps/glslang/Test/baseResults/310implicitSizeArrayError.vert.out b/deps/glslang/Test/baseResults/310implicitSizeArrayError.vert.out new file mode 100644 index 00000000..6975cde2 --- /dev/null +++ b/deps/glslang/Test/baseResults/310implicitSizeArrayError.vert.out @@ -0,0 +1,49 @@ +310implicitSizeArrayError.vert +ERROR: 0:3: '' : array size required +ERROR: 1 compilation errors. No code generated. + + +Shader version: 310 +ERROR: node is still EOpNull! +0:6 Function Definition: main( ( global void) +0:6 Function Parameters: +0:7 Sequence +0:7 move second child to first child ( temp highp int) +0:7 'o' (layout( location=0) smooth out highp int) +0:7 direct index (layout( column_major shared) temp highp int) +0:7 a: direct index for structure (layout( column_major shared) uniform unsized 3-element array of highp int) +0:7 'uni' (layout( binding=0 column_major shared) uniform block{layout( column_major shared) uniform unsized 3-element array of highp int a}) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 2 (const int) +0:? Linker Objects +0:? 'uni' (layout( binding=0 column_major shared) uniform block{layout( column_major shared) uniform unsized 3-element array of highp int a}) +0:? 'o' (layout( location=0) smooth out highp int) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + + +Linked vertex stage: + + +Shader version: 310 +ERROR: node is still EOpNull! +0:6 Function Definition: main( ( global void) +0:6 Function Parameters: +0:7 Sequence +0:7 move second child to first child ( temp highp int) +0:7 'o' (layout( location=0) smooth out highp int) +0:7 direct index (layout( column_major shared) temp highp int) +0:7 a: direct index for structure (layout( column_major shared) uniform 3-element array of highp int) +0:7 'uni' (layout( binding=0 column_major shared) uniform block{layout( column_major shared) uniform 3-element array of highp int a}) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 2 (const int) +0:? Linker Objects +0:? 'uni' (layout( binding=0 column_major shared) uniform block{layout( column_major shared) uniform 3-element array of highp int a}) +0:? 'o' (layout( location=0) smooth out highp int) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + diff --git a/deps/glslang/Test/baseResults/310runtimeArray.vert.out b/deps/glslang/Test/baseResults/310runtimeArray.vert.out new file mode 100644 index 00000000..84c731ed --- /dev/null +++ b/deps/glslang/Test/baseResults/310runtimeArray.vert.out @@ -0,0 +1,145 @@ +310runtimeArray.vert +ERROR: 0:9: '' : array size required +ERROR: 1 compilation errors. No code generated. + + +Shader version: 310 +ERROR: node is still EOpNull! +0:12 Function Definition: main( ( global void) +0:12 Function Parameters: +0:14 Sequence +0:14 move second child to first child ( temp highp float) +0:14 'o' (layout( location=0) smooth out highp float) +0:14 f: direct index for structure ( global highp float) +0:14 direct index (layout( column_major shared) temp structure{ global highp float f}) +0:14 s: direct index for structure (layout( column_major shared) buffer unsized 6-element array of structure{ global highp float f}) +0:14 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 6-element array of structure{ global highp float f} s}) +0:14 Constant: +0:14 0 (const uint) +0:14 Constant: +0:14 5 (const int) +0:14 Constant: +0:14 0 (const int) +0:15 add second child into first child ( temp highp float) +0:15 'o' (layout( location=0) smooth out highp float) +0:15 f: direct index for structure ( global highp float) +0:15 direct index (layout( column_major shared) temp structure{ global highp float f}) +0:15 s: direct index for structure (layout( column_major shared) buffer unsized 7-element array of structure{ global highp float f}) +0:15 'b2name' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 7-element array of structure{ global highp float f} s}) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 6 (const int) +0:15 Constant: +0:15 0 (const int) +0:16 add second child into first child ( temp highp float) +0:16 'o' (layout( location=0) smooth out highp float) +0:16 f: direct index for structure ( global highp float) +0:16 direct index (layout( column_major shared) temp structure{ global highp float f}) +0:16 s: direct index for structure (layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f}) +0:16 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f} s}) +0:16 'b3name' (layout( column_major shared) buffer unsized 4-element array of block{layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f} s}) +0:16 Constant: +0:16 3 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 7 (const int) +0:16 Constant: +0:16 0 (const int) +0:17 add second child into first child ( temp highp float) +0:17 'o' (layout( location=0) smooth out highp float) +0:17 f: direct index for structure ( global highp float) +0:17 direct index (layout( column_major shared) temp structure{ global highp float f}) +0:17 s: direct index for structure (layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f}) +0:17 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f} s}) +0:17 'b4name' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f} s}) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 8 (const int) +0:17 Constant: +0:17 0 (const int) +0:? Linker Objects +0:? 'o' (layout( location=0) smooth out highp float) +0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 6-element array of structure{ global highp float f} s}) +0:? 'b2name' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 7-element array of structure{ global highp float f} s}) +0:? 'b3name' (layout( column_major shared) buffer unsized 4-element array of block{layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f} s}) +0:? 'b4name' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f} s}) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + + +Linked vertex stage: + + +Shader version: 310 +ERROR: node is still EOpNull! +0:12 Function Definition: main( ( global void) +0:12 Function Parameters: +0:14 Sequence +0:14 move second child to first child ( temp highp float) +0:14 'o' (layout( location=0) smooth out highp float) +0:14 f: direct index for structure ( global highp float) +0:14 direct index (layout( column_major shared) temp structure{ global highp float f}) +0:14 s: direct index for structure (layout( column_major shared) buffer unsized 6-element array of structure{ global highp float f}) +0:14 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 6-element array of structure{ global highp float f} s}) +0:14 Constant: +0:14 0 (const uint) +0:14 Constant: +0:14 5 (const int) +0:14 Constant: +0:14 0 (const int) +0:15 add second child into first child ( temp highp float) +0:15 'o' (layout( location=0) smooth out highp float) +0:15 f: direct index for structure ( global highp float) +0:15 direct index (layout( column_major shared) temp structure{ global highp float f}) +0:15 s: direct index for structure (layout( column_major shared) buffer unsized 7-element array of structure{ global highp float f}) +0:15 'b2name' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 7-element array of structure{ global highp float f} s}) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 6 (const int) +0:15 Constant: +0:15 0 (const int) +0:16 add second child into first child ( temp highp float) +0:16 'o' (layout( location=0) smooth out highp float) +0:16 f: direct index for structure ( global highp float) +0:16 direct index (layout( column_major shared) temp structure{ global highp float f}) +0:16 s: direct index for structure (layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f}) +0:16 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f} s}) +0:16 'b3name' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f} s}) +0:16 Constant: +0:16 3 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 7 (const int) +0:16 Constant: +0:16 0 (const int) +0:17 add second child into first child ( temp highp float) +0:17 'o' (layout( location=0) smooth out highp float) +0:17 f: direct index for structure ( global highp float) +0:17 direct index (layout( column_major shared) temp structure{ global highp float f}) +0:17 s: direct index for structure (layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f}) +0:17 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f} s}) +0:17 'b4name' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f} s}) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 8 (const int) +0:17 Constant: +0:17 0 (const int) +0:? Linker Objects +0:? 'o' (layout( location=0) smooth out highp float) +0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 6-element array of structure{ global highp float f} s}) +0:? 'b2name' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 7-element array of structure{ global highp float f} s}) +0:? 'b3name' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f} s}) +0:? 'b4name' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f} s}) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + diff --git a/deps/glslang/Test/baseResults/320.comp.out b/deps/glslang/Test/baseResults/320.comp.out new file mode 100644 index 00000000..09cedd0a --- /dev/null +++ b/deps/glslang/Test/baseResults/320.comp.out @@ -0,0 +1,19 @@ +320.comp +Shader version: 320 +local_size = (1, 1, 1) +0:? Sequence +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:? Linker Objects + + +Linked compute stage: + + +Shader version: 320 +local_size = (1, 1, 1) +0:? Sequence +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:? Linker Objects + diff --git a/deps/glslang/Test/baseResults/320.frag.out b/deps/glslang/Test/baseResults/320.frag.out new file mode 100644 index 00000000..002aa7f6 --- /dev/null +++ b/deps/glslang/Test/baseResults/320.frag.out @@ -0,0 +1,576 @@ +320.frag +ERROR: 0:3: 'output block' : not supported in this stage: fragment +ERROR: 0:7: 'float' : type requires declaration of default precision qualifier +ERROR: 0:8: '' : cannot nest a structure definition inside a structure or block +ERROR: 0:16: 'location' : overlapping use of location 13 +ERROR: 0:18: 'inbname2' : Cannot reuse block name within the same interface: in +ERROR: 0:23: 'badmember' : nameless block contains a member that already has a name at global scope +ERROR: 0:27: 'inbname' : redefinition +ERROR: 0:29: 'vAnon' : redefinition +ERROR: 0:43: 'origin_upper_left' : not supported with this profile: es +ERROR: 0:43: 'pixel_center_integer' : not supported with this profile: es +ERROR: 0:43: 'redeclaration' : cannot redeclare with different qualification: gl_FragCoord +ERROR: 0:47: 'depth layout qualifier' : not supported with this profile: es +ERROR: 0:51: 'assign' : l-value required "gl_FragDepth" (can't modify gl_FragDepth if using early_fragment_tests) +ERROR: 0:79: 'textureGatherOffsets(...)' : must be a compile-time constant: offsets argument +ERROR: 0:124: 'rgba32f' : format requires readonly or writeonly memory qualifier +ERROR: 0:125: 'rgba8ui' : format requires readonly or writeonly memory qualifier +ERROR: 0:126: 'rgba16i' : format requires readonly or writeonly memory qualifier +ERROR: 0:152: 'imageAtomicMax' : only supported on image with format r32i or r32ui +ERROR: 0:153: 'imageAtomicMax' : only supported on image with format r32i or r32ui +ERROR: 0:154: 'imageAtomicExchange' : only supported on image with format r32f +ERROR: 0:157: 'centroid/sample/patch' : can't use auxiliary qualifier on a fragment output +ERROR: 0:158: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output +ERROR: 0:159: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output +ERROR: 0:160: 'noperspective' : Reserved word. +ERROR: 0:160: 'noperspective' : not supported for this version or the enabled extensions +ERROR: 0:160: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output +ERROR: 0:165: 'centroid/sample/patch' : can't use auxiliary qualifier on a fragment output +ERROR: 0:180: 'interpolateAtCentroid' : no matching overloaded function found +ERROR: 0:180: 'assign' : cannot convert from ' const float' to ' temp mediump 3-component vector of float' +ERROR: 0:182: 'interpolateAtCentroid' : first argument must be an interpolant, or interpolant-array element +ERROR: 0:184: 'interpolateAtSample' : no matching overloaded function found +ERROR: 0:184: 'assign' : cannot convert from ' const float' to ' temp mediump 3-component vector of float' +ERROR: 0:186: 'interpolateAtSample' : first argument must be an interpolant, or interpolant-array element +ERROR: 0:189: 'interpolateAtOffset' : no matching overloaded function found +ERROR: 0:189: 'assign' : cannot convert from ' const float' to ' temp mediump 3-component vector of float' +ERROR: 0:191: 'interpolateAtOffset' : first argument must be an interpolant, or interpolant-array element +ERROR: 0:192: 'interpolateAtOffset' : first argument must be an interpolant, or interpolant-array element +ERROR: 0:196: 'interpolateAtCentroid' : first argument must be an interpolant, or interpolant-array element +ERROR: 0:197: 'outp' : undeclared identifier +ERROR: 0:197: 'interpolateAtSample' : first argument must be an interpolant, or interpolant-array element +ERROR: 0:197: 'assign' : cannot convert from ' global float' to ' temp mediump 4-component vector of float' +ERROR: 0:217: 'blend equation' : can only apply to 'out' +ERROR: 0:218: 'blend equation' : can only apply to a standalone qualifier +ERROR: 0:219: 'blend equation' : can only apply to a standalone qualifier +ERROR: 0:220: 'blend equation' : can only apply to a standalone qualifier +ERROR: 0:221: 'blend equation' : can only apply to a standalone qualifier +ERROR: 0:222: 'blend equation' : can only apply to a standalone qualifier +ERROR: 0:223: 'blend_support' : unknown blend equation +ERROR: 0:225: 'fragment-shader array-of-array output' : not supported with this profile: es +ERROR: 49 compilation errors. No code generated. + + +Shader version: 320 +gl_FragCoord pixel center is integer +gl_FragCoord origin is upper left +using early_fragment_tests +using depth_any +using blend_support_multiply blend_support_screen blend_support_overlay blend_support_darken blend_support_lighten blend_support_colordodge blend_support_colorburn blend_support_hardlight blend_support_softlight blend_support_difference blend_support_exclusion blend_support_hsl_hue blend_support_hsl_saturation blend_support_hsl_color blend_support_hsl_luminosity blend_support_all_equations +ERROR: node is still EOpNull! +0:35 Function Definition: fooIO( ( global void) +0:35 Function Parameters: +0:37 Sequence +0:37 Sequence +0:37 move second child to first child ( temp mediump 4-component vector of float) +0:37 'v' ( temp mediump 4-component vector of float) +0:37 add ( temp mediump 4-component vector of float) +0:37 v: direct index for structure ( in mediump 4-component vector of float) +0:37 'inbinst' ( in block{ in mediump int a, in mediump 4-component vector of float v, in structure{ global mediump int b} s}) +0:37 Constant: +0:37 1 (const int) +0:37 vAnon: direct index for structure (layout( location=13) centroid in mediump 4-component vector of float) +0:37 'anon@0' ( in block{layout( location=12) in mediump int aAnon, layout( location=13) centroid in mediump 4-component vector of float vAnon}) +0:37 Constant: +0:37 1 (const uint) +0:38 vector scale second child into first child ( temp mediump 4-component vector of float) +0:38 'v' ( temp mediump 4-component vector of float) +0:38 f: direct index for structure ( in mediump float) +0:38 direct index ( temp block{ in mediump float f}) +0:38 'arrayedInst' ( in 4-element array of block{ in mediump float f}) +0:38 Constant: +0:38 2 (const int) +0:38 Constant: +0:38 0 (const int) +0:39 vector scale second child into first child ( temp mediump 4-component vector of float) +0:39 'v' ( temp mediump 4-component vector of float) +0:39 f: direct index for structure ( in mediump float) +0:39 indirect index ( temp block{ in mediump float f}) +0:39 'arrayedInst' ( in 4-element array of block{ in mediump float f}) +0:39 'i' ( uniform mediump int) +0:39 Constant: +0:39 0 (const int) +0:49 Function Definition: main( ( global void) +0:49 Function Parameters: +0:51 Sequence +0:51 move second child to first child ( temp highp float) +0:51 'gl_FragDepth' ( gl_FragDepth highp float FragDepth) +0:51 Constant: +0:51 0.200000 +0:52 Sequence +0:52 move second child to first child ( temp bool) +0:52 'f' ( temp bool) +0:52 'gl_FrontFacing' ( gl_FrontFacing bool Face) +0:57 Function Definition: foo_GS( ( global void) +0:57 Function Parameters: +0:59 Sequence +0:59 Sequence +0:59 move second child to first child ( temp highp int) +0:59 'l' ( temp highp int) +0:59 'gl_Layer' ( flat in highp int Layer) +0:60 Sequence +0:60 move second child to first child ( temp highp int) +0:60 'p' ( temp highp int) +0:60 'gl_PrimitiveID' ( flat in highp int PrimitiveID) +0:73 Function Definition: pfoo( ( global void) +0:73 Function Parameters: +0:? Sequence +0:76 move second child to first child ( temp mediump 2-component vector of float) +0:76 'h' ( noContraction temp mediump 2-component vector of float) +0:76 fma ( global mediump 2-component vector of float) +0:76 'inf' ( smooth in mediump 2-component vector of float) +0:76 'ing' ( smooth in mediump 2-component vector of float) +0:76 'h' ( noContraction temp mediump 2-component vector of float) +0:77 textureGatherOffset ( global lowp 4-component vector of float) +0:77 direct index ( temp lowp sampler2D) +0:77 'sArray' ( uniform 4-element array of lowp sampler2D) +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 0.100000 +0:77 0.100000 +0:77 Convert float to int ( temp lowp 2-component vector of int) +0:77 'inf' ( smooth in mediump 2-component vector of float) +0:78 textureGatherOffsets ( global lowp 4-component vector of float, operation at mediump) +0:78 direct index ( temp lowp sampler2D) +0:78 'sArray' ( uniform 4-element array of lowp sampler2D) +0:78 Constant: +0:78 0 (const int) +0:78 Constant: +0:78 0.100000 +0:78 0.100000 +0:78 Constant: +0:78 0 (const int) +0:78 0 (const int) +0:78 0 (const int) +0:78 0 (const int) +0:78 0 (const int) +0:78 0 (const int) +0:78 0 (const int) +0:78 0 (const int) +0:79 textureGatherOffsets ( global lowp 4-component vector of float, operation at mediump) +0:79 direct index ( temp lowp sampler2D) +0:79 'sArray' ( uniform 4-element array of lowp sampler2D) +0:79 Constant: +0:79 0 (const int) +0:79 Constant: +0:79 0.100000 +0:79 0.100000 +0:79 'offsets' ( uniform 4-element array of mediump 2-component vector of int) +0:102 Function Definition: CAT( ( global void) +0:102 Function Parameters: +0:104 Sequence +0:104 Sequence +0:104 move second child to first child ( temp highp 4-component vector of float) +0:104 'b4' ( temp highp 4-component vector of float) +0:104 texture ( global highp 4-component vector of float) +0:104 'CA4' ( uniform highp samplerCubeArray) +0:104 Constant: +0:104 0.500000 +0:104 0.500000 +0:104 0.500000 +0:104 0.500000 +0:104 Constant: +0:104 0.240000 +0:105 Sequence +0:105 move second child to first child ( temp highp 4-component vector of int) +0:105 'b6' ( temp highp 4-component vector of int) +0:105 texture ( global highp 4-component vector of int) +0:105 'CA6' ( uniform highp isamplerCubeArray) +0:105 Constant: +0:105 0.500000 +0:105 0.500000 +0:105 0.500000 +0:105 0.500000 +0:105 Constant: +0:105 0.260000 +0:106 Sequence +0:106 move second child to first child ( temp highp 4-component vector of uint) +0:106 'b7' ( temp highp 4-component vector of uint) +0:106 texture ( global highp 4-component vector of uint) +0:106 'CA7' ( uniform highp usamplerCubeArray) +0:106 Constant: +0:106 0.500000 +0:106 0.500000 +0:106 0.500000 +0:106 0.500000 +0:106 Constant: +0:106 0.270000 +0:109 Function Definition: goodSample( ( global void) +0:109 Function Parameters: +0:111 Sequence +0:111 Sequence +0:111 move second child to first child ( temp lowp int) +0:111 'a1' ( temp lowp int) +0:111 'gl_SampleID' ( flat in lowp int SampleId) +0:112 Sequence +0:112 move second child to first child ( temp mediump 2-component vector of float) +0:112 'a2' ( temp mediump 2-component vector of float) +0:112 'gl_SamplePosition' ( smooth in mediump 2-component vector of float SamplePosition) +0:113 Sequence +0:113 move second child to first child ( temp highp int) +0:113 'a3' ( temp highp int) +0:113 direct index ( flat temp highp int SampleMaskIn) +0:113 'gl_SampleMaskIn' ( flat in unsized 1-element array of highp int SampleMaskIn) +0:113 Constant: +0:113 0 (const int) +0:114 move second child to first child ( temp highp int) +0:114 direct index ( temp highp int SampleMaskIn) +0:114 'gl_SampleMask' ( out unsized 1-element array of highp int SampleMaskIn) +0:114 Constant: +0:114 0 (const int) +0:114 'a3' ( temp highp int) +0:115 Sequence +0:115 move second child to first child ( temp mediump int) +0:115 'n1' ( temp mediump int) +0:115 Constant: +0:115 4 (const int) +0:116 Sequence +0:116 move second child to first child ( temp mediump int) +0:116 'n2' ( temp mediump int) +0:116 'gl_NumSamples' ( uniform lowp int) +0:128 Function Definition: goodImageAtom( ( global void) +0:128 Function Parameters: +0:? Sequence +0:134 imageAtomicAdd ( global highp int) +0:134 'im2Di' (layout( r32i) uniform highp iimage2D) +0:134 'P' ( uniform mediump 2-component vector of int) +0:134 'dati' ( temp mediump int) +0:135 imageAtomicAdd ( global highp uint) +0:135 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:135 'P' ( uniform mediump 2-component vector of int) +0:135 'datu' ( temp mediump uint) +0:136 imageAtomicMin ( global highp int) +0:136 'im2Di' (layout( r32i) uniform highp iimage2D) +0:136 'P' ( uniform mediump 2-component vector of int) +0:136 'dati' ( temp mediump int) +0:137 imageAtomicMin ( global highp uint) +0:137 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:137 'P' ( uniform mediump 2-component vector of int) +0:137 'datu' ( temp mediump uint) +0:138 imageAtomicMax ( global highp int) +0:138 'im2Di' (layout( r32i) uniform highp iimage2D) +0:138 'P' ( uniform mediump 2-component vector of int) +0:138 'dati' ( temp mediump int) +0:139 imageAtomicMax ( global highp uint) +0:139 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:139 'P' ( uniform mediump 2-component vector of int) +0:139 'datu' ( temp mediump uint) +0:140 imageAtomicAnd ( global highp int) +0:140 'im2Di' (layout( r32i) uniform highp iimage2D) +0:140 'P' ( uniform mediump 2-component vector of int) +0:140 'dati' ( temp mediump int) +0:141 imageAtomicAnd ( global highp uint) +0:141 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:141 'P' ( uniform mediump 2-component vector of int) +0:141 'datu' ( temp mediump uint) +0:142 imageAtomicOr ( global highp int) +0:142 'im2Di' (layout( r32i) uniform highp iimage2D) +0:142 'P' ( uniform mediump 2-component vector of int) +0:142 'dati' ( temp mediump int) +0:143 imageAtomicOr ( global highp uint) +0:143 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:143 'P' ( uniform mediump 2-component vector of int) +0:143 'datu' ( temp mediump uint) +0:144 imageAtomicXor ( global highp int) +0:144 'im2Di' (layout( r32i) uniform highp iimage2D) +0:144 'P' ( uniform mediump 2-component vector of int) +0:144 'dati' ( temp mediump int) +0:145 imageAtomicXor ( global highp uint) +0:145 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:145 'P' ( uniform mediump 2-component vector of int) +0:145 'datu' ( temp mediump uint) +0:146 imageAtomicExchange ( global highp int) +0:146 'im2Di' (layout( r32i) uniform highp iimage2D) +0:146 'P' ( uniform mediump 2-component vector of int) +0:146 'dati' ( temp mediump int) +0:147 imageAtomicExchange ( global highp uint) +0:147 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:147 'P' ( uniform mediump 2-component vector of int) +0:147 'datu' ( temp mediump uint) +0:148 imageAtomicExchange ( global highp float) +0:148 'im2Df' (layout( r32f) uniform highp image2D) +0:148 'P' ( uniform mediump 2-component vector of int) +0:148 'datf' ( temp mediump float) +0:149 imageAtomicCompSwap ( global highp int) +0:149 'im2Di' (layout( r32i) uniform highp iimage2D) +0:149 'P' ( uniform mediump 2-component vector of int) +0:149 Constant: +0:149 3 (const int) +0:149 'dati' ( temp mediump int) +0:150 imageAtomicCompSwap ( global highp uint) +0:150 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:150 'P' ( uniform mediump 2-component vector of int) +0:150 Constant: +0:150 5 (const uint) +0:150 'datu' ( temp mediump uint) +0:152 imageAtomicMax ( global highp int) +0:152 'badIm2Di' (layout( rgba16i) uniform highp iimage2D) +0:152 'P' ( uniform mediump 2-component vector of int) +0:152 'dati' ( temp mediump int) +0:153 imageAtomicMax ( global highp uint) +0:153 'badIm2Du' (layout( rgba8ui) uniform highp uimage2D) +0:153 'P' ( uniform mediump 2-component vector of int) +0:153 'datu' ( temp mediump uint) +0:154 imageAtomicExchange ( global highp float) +0:154 'badIm2Df' (layout( rgba32f) uniform highp image2D) +0:154 'P' ( uniform mediump 2-component vector of int) +0:154 'datf' ( temp mediump float) +0:169 Function Definition: interp( ( global void) +0:169 Function Parameters: +0:? Sequence +0:176 move second child to first child ( temp mediump 2-component vector of float) +0:176 'res2' ( temp mediump 2-component vector of float) +0:176 interpolateAtCentroid ( global mediump 2-component vector of float) +0:176 'colorfc' ( centroid flat in mediump 2-component vector of float) +0:177 move second child to first child ( temp mediump 4-component vector of float) +0:177 'res4' ( temp mediump 4-component vector of float) +0:177 interpolateAtCentroid ( global mediump 4-component vector of float) +0:177 'colorSampIn' ( smooth sample in mediump 4-component vector of float) +0:178 move second child to first child ( temp mediump 4-component vector of float) +0:178 'res4' ( temp mediump 4-component vector of float) +0:178 interpolateAtCentroid ( global mediump 4-component vector of float) +0:178 'colorfsi' ( flat sample in mediump 4-component vector of float) +0:179 move second child to first child ( temp mediump float) +0:179 'res' ( temp mediump float) +0:179 interpolateAtCentroid ( global mediump float) +0:179 'scalarIn' ( smooth in mediump float) +0:180 'res3' ( temp mediump 3-component vector of float) +0:181 move second child to first child ( temp mediump 3-component vector of float) +0:181 'res3' ( temp mediump 3-component vector of float) +0:181 interpolateAtCentroid ( global mediump 3-component vector of float) +0:181 direct index ( smooth sample temp mediump 3-component vector of float) +0:181 'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float) +0:181 Constant: +0:181 2 (const int) +0:182 move second child to first child ( temp mediump 2-component vector of float) +0:182 'res2' ( temp mediump 2-component vector of float) +0:182 interpolateAtCentroid ( global mediump 2-component vector of float) +0:182 vector swizzle ( temp mediump 2-component vector of float) +0:182 direct index ( smooth sample temp mediump 3-component vector of float) +0:182 'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float) +0:182 Constant: +0:182 2 (const int) +0:182 Sequence +0:182 Constant: +0:182 0 (const int) +0:182 Constant: +0:182 1 (const int) +0:184 'res3' ( temp mediump 3-component vector of float) +0:185 move second child to first child ( temp mediump 3-component vector of float) +0:185 'res3' ( temp mediump 3-component vector of float) +0:185 interpolateAtSample ( global mediump 3-component vector of float) +0:185 indirect index ( smooth sample temp mediump 3-component vector of float) +0:185 'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float) +0:185 'i' ( uniform mediump int) +0:185 Constant: +0:185 0 (const int) +0:186 move second child to first child ( temp mediump 2-component vector of float) +0:186 'res2' ( temp mediump 2-component vector of float) +0:186 interpolateAtSample ( global mediump 2-component vector of float) +0:186 vector swizzle ( temp mediump 2-component vector of float) +0:186 direct index ( smooth sample temp mediump 3-component vector of float) +0:186 'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float) +0:186 Constant: +0:186 2 (const int) +0:186 Sequence +0:186 Constant: +0:186 0 (const int) +0:186 Constant: +0:186 1 (const int) +0:186 Constant: +0:186 2 (const int) +0:187 move second child to first child ( temp mediump float) +0:187 'res' ( temp mediump float) +0:187 interpolateAtSample ( global mediump float) +0:187 'scalarIn' ( smooth in mediump float) +0:187 Constant: +0:187 1 (const int) +0:189 'res3' ( temp mediump 3-component vector of float) +0:190 move second child to first child ( temp mediump 3-component vector of float) +0:190 'res3' ( temp mediump 3-component vector of float) +0:190 interpolateAtOffset ( global mediump 3-component vector of float) +0:190 direct index ( smooth sample temp mediump 3-component vector of float) +0:190 'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float) +0:190 Constant: +0:190 2 (const int) +0:190 Constant: +0:190 0.200000 +0:190 0.200000 +0:191 move second child to first child ( temp mediump 2-component vector of float) +0:191 'res2' ( temp mediump 2-component vector of float) +0:191 interpolateAtOffset ( global mediump 2-component vector of float) +0:191 vector swizzle ( temp mediump 2-component vector of float) +0:191 direct index ( smooth sample temp mediump 3-component vector of float) +0:191 'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float) +0:191 Constant: +0:191 2 (const int) +0:191 Sequence +0:191 Constant: +0:191 0 (const int) +0:191 Constant: +0:191 1 (const int) +0:191 Constant: +0:191 0.200000 +0:191 0.200000 +0:192 move second child to first child ( temp mediump float) +0:192 'res' ( temp mediump float) +0:192 interpolateAtOffset ( global mediump float) +0:192 add ( temp mediump float) +0:192 'scalarIn' ( smooth in mediump float) +0:192 'scalarIn' ( smooth in mediump float) +0:192 Constant: +0:192 0.200000 +0:192 0.200000 +0:193 move second child to first child ( temp mediump float) +0:193 'res' ( temp mediump float) +0:193 interpolateAtOffset ( global mediump float) +0:193 'scalarIn' ( smooth in mediump float) +0:193 Constant: +0:193 0.200000 +0:193 0.200000 +0:196 move second child to first child ( temp mediump float) +0:196 'res' ( temp mediump float) +0:196 interpolateAtCentroid ( global mediump float) +0:196 'f' ( temp mediump float) +0:197 'res4' ( temp mediump 4-component vector of float) +0:221 Function Definition: blendFoo( ( temp void) +0:221 Function Parameters: +0:222 Function Definition: blendFoo(vf3; ( global void) +0:222 Function Parameters: +0:222 'v' ( in mediump 3-component vector of float) +0:? Linker Objects +0:? 'outbinst' ( out block{ out mediump int a}) +0:? 'inbinst' ( in block{ in mediump int a, in mediump 4-component vector of float v, in structure{ global mediump int b} s}) +0:? 'anon@0' ( in block{layout( location=12) in mediump int aAnon, layout( location=13) centroid in mediump 4-component vector of float vAnon}) +0:? 'aliased' (layout( location=13) smooth in mediump 4-component vector of float) +0:? 'arrayedInst' ( in 4-element array of block{ in mediump float f}) +0:? 'i' ( uniform mediump int) +0:? 'gl_FragCoord' ( gl_FragCoord highp 4-component vector of float FragCoord) +0:? 'gl_FragDepth' ( gl_FragDepth highp float FragDepth) +0:? 'inf' ( smooth in mediump 2-component vector of float) +0:? 'ing' ( smooth in mediump 2-component vector of float) +0:? 'offsets' ( uniform 4-element array of mediump 2-component vector of int) +0:? 'sArray' ( uniform 4-element array of lowp sampler2D) +0:? 'sIndex' ( uniform mediump int) +0:? 'auArray' (layout( binding=0 offset=0) uniform 2-element array of highp atomic_uint) +0:? 'ubInst' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform mediump int i}) +0:? 'bbInst' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer mediump int i}) +0:? 'iArray' ( writeonly uniform 5-element array of highp image2D) +0:? 'constOffsets' ( const 4-element array of mediump 2-component vector of int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 'CA1' ( writeonly uniform highp imageCubeArray) +0:? 'CA2' ( writeonly uniform highp iimageCubeArray) +0:? 'CA3' ( writeonly uniform highp uimageCubeArray) +0:? 'CA4' ( uniform highp samplerCubeArray) +0:? 'CA5' ( uniform highp samplerCubeArrayShadow) +0:? 'CA6' ( uniform highp isamplerCubeArray) +0:? 'CA7' ( uniform highp usamplerCubeArray) +0:? 'gl_SampleMaskIn' ( flat in unsized 1-element array of highp int SampleMaskIn) +0:? 'gl_SampleMask' ( out unsized 1-element array of highp int SampleMaskIn) +0:? 'im2Df' (layout( r32f) uniform highp image2D) +0:? 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:? 'im2Di' (layout( r32i) uniform highp iimage2D) +0:? 'P' ( uniform mediump 2-component vector of int) +0:? 'badIm2Df' (layout( rgba32f) uniform highp image2D) +0:? 'badIm2Du' (layout( rgba8ui) uniform highp uimage2D) +0:? 'badIm2Di' (layout( rgba16i) uniform highp iimage2D) +0:? 'colorCentroidBad' ( centroid out mediump 4-component vector of float) +0:? 'colorBadFlat' ( flat out mediump 4-component vector of float) +0:? 'colorBadSmooth' ( smooth out mediump 4-component vector of float) +0:? 'colorBadNo' ( noperspective out mediump 4-component vector of float) +0:? 'colorfc' ( centroid flat in mediump 2-component vector of float) +0:? 'scalarIn' ( smooth in mediump float) +0:? 'colorSampIn' ( smooth sample in mediump 4-component vector of float) +0:? 'colorSampleBad' ( sample out mediump 4-component vector of float) +0:? 'colorfsi' ( flat sample in mediump 4-component vector of float) +0:? 'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float) +0:? 'badout' ( out mediump 4-component vector of float) +0:? 'outAA' ( out 2-element array of 2-element array of mediump 4-component vector of float) + + +Linked fragment stage: + +ERROR: Linking fragment stage: when more than one fragment shader output, all must have location qualifiers + +Shader version: 320 +gl_FragCoord pixel center is integer +gl_FragCoord origin is upper left +using early_fragment_tests +using depth_any +using blend_support_multiply blend_support_screen blend_support_overlay blend_support_darken blend_support_lighten blend_support_colordodge blend_support_colorburn blend_support_hardlight blend_support_softlight blend_support_difference blend_support_exclusion blend_support_hsl_hue blend_support_hsl_saturation blend_support_hsl_color blend_support_hsl_luminosity blend_support_all_equations +ERROR: node is still EOpNull! +0:49 Function Definition: main( ( global void) +0:49 Function Parameters: +0:51 Sequence +0:51 move second child to first child ( temp highp float) +0:51 'gl_FragDepth' ( gl_FragDepth highp float FragDepth) +0:51 Constant: +0:51 0.200000 +0:52 Sequence +0:52 move second child to first child ( temp bool) +0:52 'f' ( temp bool) +0:52 'gl_FrontFacing' ( gl_FrontFacing bool Face) +0:? Linker Objects +0:? 'outbinst' ( out block{ out mediump int a}) +0:? 'inbinst' ( in block{ in mediump int a, in mediump 4-component vector of float v, in structure{ global mediump int b} s}) +0:? 'anon@0' ( in block{layout( location=12) in mediump int aAnon, layout( location=13) centroid in mediump 4-component vector of float vAnon}) +0:? 'aliased' (layout( location=13) smooth in mediump 4-component vector of float) +0:? 'arrayedInst' ( in 4-element array of block{ in mediump float f}) +0:? 'i' ( uniform mediump int) +0:? 'gl_FragCoord' ( gl_FragCoord highp 4-component vector of float FragCoord) +0:? 'gl_FragDepth' ( gl_FragDepth highp float FragDepth) +0:? 'inf' ( smooth in mediump 2-component vector of float) +0:? 'ing' ( smooth in mediump 2-component vector of float) +0:? 'offsets' ( uniform 4-element array of mediump 2-component vector of int) +0:? 'sArray' ( uniform 4-element array of lowp sampler2D) +0:? 'sIndex' ( uniform mediump int) +0:? 'auArray' (layout( binding=0 offset=0) uniform 2-element array of highp atomic_uint) +0:? 'ubInst' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform mediump int i}) +0:? 'bbInst' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer mediump int i}) +0:? 'iArray' ( writeonly uniform 5-element array of highp image2D) +0:? 'constOffsets' ( const 4-element array of mediump 2-component vector of int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 'CA1' ( writeonly uniform highp imageCubeArray) +0:? 'CA2' ( writeonly uniform highp iimageCubeArray) +0:? 'CA3' ( writeonly uniform highp uimageCubeArray) +0:? 'CA4' ( uniform highp samplerCubeArray) +0:? 'CA5' ( uniform highp samplerCubeArrayShadow) +0:? 'CA6' ( uniform highp isamplerCubeArray) +0:? 'CA7' ( uniform highp usamplerCubeArray) +0:? 'gl_SampleMaskIn' ( flat in 1-element array of highp int SampleMaskIn) +0:? 'gl_SampleMask' ( out 1-element array of highp int SampleMaskIn) +0:? 'im2Df' (layout( r32f) uniform highp image2D) +0:? 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:? 'im2Di' (layout( r32i) uniform highp iimage2D) +0:? 'P' ( uniform mediump 2-component vector of int) +0:? 'badIm2Df' (layout( rgba32f) uniform highp image2D) +0:? 'badIm2Du' (layout( rgba8ui) uniform highp uimage2D) +0:? 'badIm2Di' (layout( rgba16i) uniform highp iimage2D) +0:? 'colorCentroidBad' ( centroid out mediump 4-component vector of float) +0:? 'colorBadFlat' ( flat out mediump 4-component vector of float) +0:? 'colorBadSmooth' ( smooth out mediump 4-component vector of float) +0:? 'colorBadNo' ( noperspective out mediump 4-component vector of float) +0:? 'colorfc' ( centroid flat in mediump 2-component vector of float) +0:? 'scalarIn' ( smooth in mediump float) +0:? 'colorSampIn' ( smooth sample in mediump 4-component vector of float) +0:? 'colorSampleBad' ( sample out mediump 4-component vector of float) +0:? 'colorfsi' ( flat sample in mediump 4-component vector of float) +0:? 'sampInArray' ( smooth sample in 4-element array of mediump 3-component vector of float) +0:? 'badout' ( out mediump 4-component vector of float) +0:? 'outAA' ( out 2-element array of 2-element array of mediump 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/320.geom.out b/deps/glslang/Test/baseResults/320.geom.out new file mode 100644 index 00000000..f3337660 --- /dev/null +++ b/deps/glslang/Test/baseResults/320.geom.out @@ -0,0 +1,251 @@ +320.geom +ERROR: 0:19: 'fromVertex' : block instance name redefinition +ERROR: 0:23: 'fromVertex' : redefinition +ERROR: 0:25: 'fooC' : block instance name redefinition +ERROR: 0:33: 'EmitStreamVertex' : no matching overloaded function found +ERROR: 0:34: 'EndStreamPrimitive' : no matching overloaded function found +ERROR: 0:37: 'gl_ClipDistance' : undeclared identifier +ERROR: 0:37: 'gl_ClipDistance' : left of '[' is not of type array, matrix, or vector +ERROR: 0:38: 'gl_ClipDistance' : no such field in structure +ERROR: 0:38: 'expression' : left of '[' is not of type array, matrix, or vector +ERROR: 0:37: 'assign' : l-value required (can't modify a const) +ERROR: 0:45: 'selecting output stream' : not supported with this profile: es +ERROR: 0:52: 'max_vertices' : too large, must be less than gl_MaxGeometryOutputVertices +ERROR: 0:52: 'max_vertices' : cannot change previously set layout value +ERROR: 0:53: 'max_vertices' : can only apply to a standalone qualifier +ERROR: 0:58: 'points' : cannot change previously set output primitive +ERROR: 0:59: 'points' : cannot change previously set output primitive +ERROR: 0:60: 'triangle_strip' : cannot apply to input +ERROR: 0:61: 'triangle_strip' : cannot apply to: uniform +ERROR: 0:62: 'triangle_strip' : can only apply to a standalone qualifier +ERROR: 0:63: 'triangle_strip' : can only apply to a standalone qualifier +ERROR: 0:64: 'invocations' : can only apply to a standalone qualifier +ERROR: 0:66: 'invocations' : can only apply to a standalone qualifier +ERROR: 0:67: 'max_vertices' : can only apply to a standalone qualifier +ERROR: 0:68: 'triangle_strip' : can only apply to a standalone qualifier +ERROR: 0:71: 'lines' : cannot apply to 'out' +ERROR: 0:73: 'triangles' : cannot change previously set input primitive +ERROR: 0:74: 'triangles_adjacency' : cannot change previously set input primitive +ERROR: 0:106: 'gl_ViewportIndex' : undeclared identifier +ERROR: 0:107: 'gl_MaxViewports' : undeclared identifier +ERROR: 0:113: 'lines_adjacency' : inconsistent input primitive for array size of explArrayBad +ERROR: 0:114: 'in' : type must be an array: nonArrayed +ERROR: 0:122: 'component' : not supported with this profile: es +ERROR: 0:126: 'gl_MaxGeometryVaryingComponents' : undeclared identifier +ERROR: 0:127: 'gl_VerticesIn' : undeclared identifier +ERROR: 0:132: 'gl_PointSize' : required extension not requested: Possible extensions include: +GL_EXT_geometry_point_size +GL_OES_geometry_point_size +ERROR: 0:133: 'gl_PointSize' : required extension not requested: Possible extensions include: +GL_EXT_geometry_point_size +GL_OES_geometry_point_size +ERROR: 36 compilation errors. No code generated. + + +Shader version: 320 +invocations = 4 +max_vertices = 200 +input primitive = lines_adjacency +output primitive = triangle_strip +ERROR: node is still EOpNull! +0:29 Function Definition: main( ( global void) +0:29 Function Parameters: +0:31 Sequence +0:31 EmitVertex ( global void) +0:32 EndPrimitive ( global void) +0:33 Constant: +0:33 0.000000 +0:34 Constant: +0:34 0.000000 +0:36 move second child to first child ( temp mediump 3-component vector of float) +0:36 color: direct index for structure (layout( stream=0) out mediump 3-component vector of float) +0:36 'anon@0' (layout( stream=0) out block{layout( stream=0) out mediump 3-component vector of float color}) +0:36 Constant: +0:36 0 (const uint) +0:36 color: direct index for structure ( in mediump 3-component vector of float) +0:36 direct index ( temp block{ in mediump 3-component vector of float color}) +0:36 'fromV' ( in 4-element array of block{ in mediump 3-component vector of float color}) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:37 move second child to first child ( temp float) +0:37 Constant: +0:37 0.000000 +0:38 Constant: +0:38 0.000000 +0:39 move second child to first child ( temp highp 4-component vector of float) +0:39 gl_Position: direct index for structure (layout( stream=0) gl_Position highp 4-component vector of float Position) +0:39 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position highp 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize highp float PointSize gl_PointSize}) +0:39 Constant: +0:39 0 (const uint) +0:39 gl_Position: direct index for structure ( in highp 4-component vector of float Position) +0:39 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize}) +0:39 'gl_in' ( in 4-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 0 (const int) +0:41 move second child to first child ( temp highp int) +0:41 'gl_PrimitiveID' (layout( stream=0) out highp int PrimitiveID) +0:41 'gl_PrimitiveIDIn' ( in highp int PrimitiveID) +0:42 move second child to first child ( temp highp int) +0:42 'gl_Layer' (layout( stream=0) out highp int Layer) +0:42 Constant: +0:42 2 (const int) +0:53 Function Definition: foo(i1; ( global void) +0:53 Function Parameters: +0:53 'a' ( in highp int) +0:55 Sequence +0:55 move second child to first child ( temp mediump 4-component vector of float) +0:55 a: direct index for structure (layout( stream=0) out mediump 4-component vector of float) +0:55 'ouuaa6' (layout( stream=0) out block{layout( stream=0) out mediump 4-component vector of float a}) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 1.000000 +0:55 1.000000 +0:55 1.000000 +0:55 1.000000 +0:104 Function Definition: fooe1( ( global void) +0:104 Function Parameters: +0:106 Sequence +0:106 'gl_ViewportIndex' ( temp float) +0:107 'gl_MaxViewports' ( temp float) +0:108 Constant: +0:108 4 (const int) +0:109 Sequence +0:109 move second child to first child ( temp highp int) +0:109 'inv' ( temp highp int) +0:109 'gl_InvocationID' ( in highp int InvocationID) +0:124 Function Definition: notHere( ( global void) +0:124 Function Parameters: +0:126 Sequence +0:126 'gl_MaxGeometryVaryingComponents' ( temp float) +0:127 'gl_VerticesIn' ( temp float) +0:130 Function Definition: pointSize2( ( global void) +0:130 Function Parameters: +0:132 Sequence +0:132 Sequence +0:132 move second child to first child ( temp highp float) +0:132 'ps' ( temp highp float) +0:132 gl_PointSize: direct index for structure ( in highp float PointSize) +0:132 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize}) +0:132 'gl_in' ( in 4-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize}) +0:132 Constant: +0:132 3 (const int) +0:132 Constant: +0:132 1 (const int) +0:133 move second child to first child ( temp highp float) +0:133 gl_PointSize: direct index for structure (layout( stream=0) gl_PointSize highp float PointSize) +0:133 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position highp 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize highp float PointSize gl_PointSize}) +0:133 Constant: +0:133 1 (const uint) +0:133 'ps' ( temp highp float) +0:? Linker Objects +0:? 'fromV' ( in 4-element array of block{ in mediump 3-component vector of float color}) +0:? 'nonBlockUnsized' ( in 4-element array of mediump 4-component vector of float) +0:? 'toF' (layout( stream=0) out block{layout( stream=0) out mediump 3-component vector of float color}) +0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) out mediump 3-component vector of float color}) +0:? 'gl_in' ( in 4-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize}) +0:? 'ov4' (layout( stream=4) out mediump 4-component vector of float) +0:? 'ouuaa6' (layout( stream=0) out block{layout( stream=0) out mediump 4-component vector of float a}) +0:? 'badv4' (layout( stream=0) out mediump 4-component vector of float) +0:? 'bad2v4' ( in 4-element array of mediump 4-component vector of float) +0:? 'anon@1' (layout( stream=0) out block{layout( stream=0) out highp int a}) +0:? 'outbi' (layout( stream=0) out block{layout( stream=0) out highp int a, layout( stream=0) out highp int b, layout( stream=0) out highp int c}) +0:? 'insn' ( in 4-element array of block{ in highp int a15}) +0:? 'anon@2' (layout( stream=0) out block{layout( stream=0) out mediump float f15}) +0:? 'anon@3' (layout( column_major shared) uniform block{layout( column_major shared) uniform bool b15}) +0:? 'summ' ( const highp int) +0:? 2752 (const int) +0:? 'explArray' ( in 4-element array of mediump 4-component vector of float) +0:? 'explArrayBad' ( in 5-element array of mediump 4-component vector of float) +0:? 'nonArrayed' ( in mediump 4-component vector of float) +0:? 'myColor1' (layout( stream=0) flat out mediump 3-component vector of float) +0:? 'myColor2' (layout( stream=0) centroid out mediump 3-component vector of float) +0:? 'centr' ( centroid in 4-element array of mediump 3-component vector of float) +0:? 'perSampleColor' (layout( stream=0) sample out mediump 4-component vector of float) +0:? 'comp' (layout( location=7 component=2) in 4-element array of mediump float) + + +Linked geometry stage: + + +Shader version: 320 +invocations = 4 +max_vertices = 200 +input primitive = lines_adjacency +output primitive = triangle_strip +ERROR: node is still EOpNull! +0:29 Function Definition: main( ( global void) +0:29 Function Parameters: +0:31 Sequence +0:31 EmitVertex ( global void) +0:32 EndPrimitive ( global void) +0:33 Constant: +0:33 0.000000 +0:34 Constant: +0:34 0.000000 +0:36 move second child to first child ( temp mediump 3-component vector of float) +0:36 color: direct index for structure (layout( stream=0) out mediump 3-component vector of float) +0:36 'anon@0' (layout( stream=0) out block{layout( stream=0) out mediump 3-component vector of float color}) +0:36 Constant: +0:36 0 (const uint) +0:36 color: direct index for structure ( in mediump 3-component vector of float) +0:36 direct index ( temp block{ in mediump 3-component vector of float color}) +0:36 'fromV' ( in 4-element array of block{ in mediump 3-component vector of float color}) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:37 move second child to first child ( temp float) +0:37 Constant: +0:37 0.000000 +0:38 Constant: +0:38 0.000000 +0:39 move second child to first child ( temp highp 4-component vector of float) +0:39 gl_Position: direct index for structure (layout( stream=0) gl_Position highp 4-component vector of float Position) +0:39 'anon@1' (layout( stream=0) out block{layout( stream=0) gl_Position highp 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize highp float PointSize gl_PointSize}) +0:39 Constant: +0:39 0 (const uint) +0:39 gl_Position: direct index for structure ( in highp 4-component vector of float Position) +0:39 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize}) +0:39 'gl_in' ( in 4-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 0 (const int) +0:41 move second child to first child ( temp highp int) +0:41 'gl_PrimitiveID' (layout( stream=0) out highp int PrimitiveID) +0:41 'gl_PrimitiveIDIn' ( in highp int PrimitiveID) +0:42 move second child to first child ( temp highp int) +0:42 'gl_Layer' (layout( stream=0) out highp int Layer) +0:42 Constant: +0:42 2 (const int) +0:? Linker Objects +0:? 'fromV' ( in 4-element array of block{ in mediump 3-component vector of float color}) +0:? 'nonBlockUnsized' ( in 4-element array of mediump 4-component vector of float) +0:? 'toF' (layout( stream=0) out block{layout( stream=0) out mediump 3-component vector of float color}) +0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) out mediump 3-component vector of float color}) +0:? 'gl_in' ( in 4-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize}) +0:? 'ov4' (layout( stream=4) out mediump 4-component vector of float) +0:? 'ouuaa6' (layout( stream=0) out block{layout( stream=0) out mediump 4-component vector of float a}) +0:? 'badv4' (layout( stream=0) out mediump 4-component vector of float) +0:? 'bad2v4' ( in 4-element array of mediump 4-component vector of float) +0:? 'anon@1' (layout( stream=0) out block{layout( stream=0) out highp int a}) +0:? 'outbi' (layout( stream=0) out block{layout( stream=0) out highp int a, layout( stream=0) out highp int b, layout( stream=0) out highp int c}) +0:? 'insn' ( in 4-element array of block{ in highp int a15}) +0:? 'anon@2' (layout( stream=0) out block{layout( stream=0) out mediump float f15}) +0:? 'anon@3' (layout( column_major shared) uniform block{layout( column_major shared) uniform bool b15}) +0:? 'summ' ( const highp int) +0:? 2752 (const int) +0:? 'explArray' ( in 4-element array of mediump 4-component vector of float) +0:? 'explArrayBad' ( in 5-element array of mediump 4-component vector of float) +0:? 'nonArrayed' ( in mediump 4-component vector of float) +0:? 'myColor1' (layout( stream=0) flat out mediump 3-component vector of float) +0:? 'myColor2' (layout( stream=0) centroid out mediump 3-component vector of float) +0:? 'centr' ( centroid in 4-element array of mediump 3-component vector of float) +0:? 'perSampleColor' (layout( stream=0) sample out mediump 4-component vector of float) +0:? 'comp' (layout( location=7 component=2) in 4-element array of mediump float) + diff --git a/deps/glslang/Test/baseResults/320.tesc.out b/deps/glslang/Test/baseResults/320.tesc.out new file mode 100644 index 00000000..41ee29c3 --- /dev/null +++ b/deps/glslang/Test/baseResults/320.tesc.out @@ -0,0 +1,516 @@ +320.tesc +ERROR: 0:6: 'quads' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:7: 'ccw' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:8: 'fractional_even_spacing' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:10: 'patch' : can only use on output in tessellation-control shader +ERROR: 0:24: 'gl_PointSize' : required extension not requested: Possible extensions include: +GL_EXT_tessellation_point_size +GL_OES_tessellation_point_size +ERROR: 0:25: 'gl_ClipDistance' : no such field in structure +ERROR: 0:25: 'expression' : left of '[' is not of type array, matrix, or vector +ERROR: 0:32: 'gl_PointSize' : required extension not requested: Possible extensions include: +GL_EXT_tessellation_point_size +GL_OES_tessellation_point_size +ERROR: 0:33: 'gl_ClipDistance' : no such field in structure +ERROR: 0:33: 'expression' : left of '[' is not of type array, matrix, or vector +ERROR: 0:33: 'assign' : l-value required (can't modify a const) +ERROR: 0:39: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:41: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:46: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:51: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:54: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:61: '' : tessellation control barrier() cannot be placed after a return from main() +ERROR: 0:64: 'vertices' : can only apply to 'out' +ERROR: 0:65: 'vertices' : cannot change previously set layout value +ERROR: 0:69: '[' : array index out of range '4' +ERROR: 0:71: '' : tessellation control barrier() must be in main() +ERROR: 0:74: 'in' : type must be an array: ina +ERROR: 0:76: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized +ERROR: 0:78: '' : array size required +ERROR: 0:84: 'location' : overlapping use of location 4 +ERROR: 0:88: 'location' : overlapping use of location 4 +ERROR: 0:98: 'vertices' : can only apply to a standalone qualifier +ERROR: 0:99: 'vertices' : inconsistent output number of vertices for array size of misSized +ERROR: 0:104: 'gl_PointSize' : required extension not requested: Possible extensions include: +GL_EXT_tessellation_point_size +GL_OES_tessellation_point_size +ERROR: 0:105: 'gl_PointSize' : required extension not requested: Possible extensions include: +GL_EXT_tessellation_point_size +GL_OES_tessellation_point_size +ERROR: 0:123: '[' : array index out of range '2' +ERROR: 0:126: '' : array size required +ERROR: 0:142: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID +ERROR: 0:143: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID +ERROR: 0:146: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID +ERROR: 35 compilation errors. No code generated. + + +Shader version: 320 +Requested GL_ARB_separate_shader_objects +vertices = 4 +ERROR: node is still EOpNull! +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:15 Sequence +0:15 Barrier ( global void) +0:17 Sequence +0:17 move second child to first child ( temp highp int) +0:17 'a' ( temp highp int) +0:17 Constant: +0:17 5392 (const int) +0:23 Sequence +0:23 move second child to first child ( temp highp 4-component vector of float) +0:23 'p' ( temp highp 4-component vector of float) +0:23 gl_Position: direct index for structure ( in highp 4-component vector of float Position) +0:23 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:23 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:23 Constant: +0:23 1 (const int) +0:23 Constant: +0:23 0 (const int) +0:24 Sequence +0:24 move second child to first child ( temp highp float) +0:24 'ps' ( temp highp float) +0:24 gl_PointSize: direct index for structure ( in highp float PointSize) +0:24 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:24 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:24 Constant: +0:24 1 (const int) +0:24 Constant: +0:24 1 (const int) +0:25 Sequence +0:25 move second child to first child ( temp highp float) +0:25 'cd' ( temp highp float) +0:25 Constant: +0:25 0.000000 +0:27 Sequence +0:27 move second child to first child ( temp highp int) +0:27 'pvi' ( temp highp int) +0:27 'gl_PatchVerticesIn' ( in highp int PatchVertices) +0:28 Sequence +0:28 move second child to first child ( temp highp int) +0:28 'pid' ( temp highp int) +0:28 'gl_PrimitiveID' ( in highp int PrimitiveID) +0:29 Sequence +0:29 move second child to first child ( temp highp int) +0:29 'iid' ( temp highp int) +0:29 'gl_InvocationID' ( in highp int InvocationID) +0:31 move second child to first child ( temp highp 4-component vector of float) +0:31 gl_Position: direct index for structure ( out highp 4-component vector of float Position) +0:31 indirect index ( temp block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:31 'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:31 'gl_InvocationID' ( in highp int InvocationID) +0:31 Constant: +0:31 0 (const int) +0:31 'p' ( temp highp 4-component vector of float) +0:32 move second child to first child ( temp highp float) +0:32 gl_PointSize: direct index for structure ( out highp float PointSize) +0:32 indirect index ( temp block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:32 'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:32 'gl_InvocationID' ( in highp int InvocationID) +0:32 Constant: +0:32 1 (const int) +0:32 'ps' ( temp highp float) +0:33 move second child to first child ( temp highp float) +0:33 Constant: +0:33 0.000000 +0:33 'cd' ( temp highp float) +0:35 move second child to first child ( temp highp float) +0:35 direct index ( patch temp highp float TessLevelOuter) +0:35 'gl_TessLevelOuter' ( patch out 4-element array of highp float TessLevelOuter) +0:35 Constant: +0:35 3 (const int) +0:35 Constant: +0:35 3.200000 +0:36 move second child to first child ( temp highp float) +0:36 direct index ( patch temp highp float TessLevelInner) +0:36 'gl_TessLevelInner' ( patch out 2-element array of highp float TessLevelInner) +0:36 Constant: +0:36 1 (const int) +0:36 Constant: +0:36 1.300000 +0:38 Test condition and select ( temp void) +0:38 Condition +0:38 Compare Greater Than ( temp bool) +0:38 'a' ( temp highp int) +0:38 Constant: +0:38 10 (const int) +0:38 true case +0:39 Barrier ( global void) +0:38 false case +0:41 Barrier ( global void) +0:43 Barrier ( global void) +0:47 Loop with condition not tested first +0:47 Loop Condition +0:47 Compare Greater Than ( temp bool) +0:47 'a' ( temp highp int) +0:47 Constant: +0:47 10 (const int) +0:47 Loop Body +0:46 Sequence +0:46 Barrier ( global void) +0:49 switch +0:49 condition +0:49 'a' ( temp highp int) +0:49 body +0:49 Sequence +0:50 default: +0:? Sequence +0:51 Barrier ( global void) +0:52 Branch: Break +0:54 Test condition and select ( temp highp int) +0:54 Condition +0:54 Compare Less Than ( temp bool) +0:54 'a' ( temp highp int) +0:54 Constant: +0:54 12 (const int) +0:54 true case +0:54 'a' ( temp highp int) +0:54 false case +0:54 Comma ( temp highp int) +0:54 Barrier ( global void) +0:54 'a' ( temp highp int) +0:56 Sequence +0:56 Barrier ( global void) +0:59 Branch: Return +0:61 Barrier ( global void) +0:67 Function Definition: foo( ( global void) +0:67 Function Parameters: +0:69 Sequence +0:69 gl_Position: direct index for structure ( out highp 4-component vector of float Position) +0:69 direct index ( temp block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:69 'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:69 Constant: +0:69 4 (const int) +0:69 Constant: +0:69 0 (const int) +0:71 Barrier ( global void) +0:102 Function Definition: pointSize2( ( global void) +0:102 Function Parameters: +0:104 Sequence +0:104 Sequence +0:104 move second child to first child ( temp highp float) +0:104 'ps' ( temp highp float) +0:104 gl_PointSize: direct index for structure ( in highp float PointSize) +0:104 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:104 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:104 Constant: +0:104 1 (const int) +0:104 Constant: +0:104 1 (const int) +0:105 move second child to first child ( temp highp float) +0:105 gl_PointSize: direct index for structure ( out highp float PointSize) +0:105 indirect index ( temp block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:105 'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:105 'gl_InvocationID' ( in highp int InvocationID) +0:105 Constant: +0:105 1 (const int) +0:105 'ps' ( temp highp float) +0:110 Function Definition: goodfoop( ( global void) +0:110 Function Parameters: +0:? Sequence +0:114 multiply second child into first child ( temp highp 3-component vector of float) +0:114 'pv3' ( noContraction temp highp 3-component vector of float) +0:114 'pv3' ( noContraction temp highp 3-component vector of float) +0:115 move second child to first child ( temp highp 3-component vector of float) +0:115 'pv3' ( noContraction temp highp 3-component vector of float) +0:115 fma ( global highp 3-component vector of float) +0:115 'pv3' ( noContraction temp highp 3-component vector of float) +0:115 'pv3' ( noContraction temp highp 3-component vector of float) +0:115 'pv3' ( noContraction temp highp 3-component vector of float) +0:116 move second child to first child ( temp highp float) +0:116 'd' ( noContraction temp highp float) +0:116 fma ( global highp float) +0:116 'd' ( noContraction temp highp float) +0:116 'd' ( noContraction temp highp float) +0:116 'd' ( noContraction temp highp float) +0:119 Function Definition: bb( ( global void) +0:119 Function Parameters: +0:121 Sequence +0:121 move second child to first child ( temp highp 4-component vector of float) +0:121 direct index ( patch temp highp 4-component vector of float BoundingBox) +0:121 'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox) +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 0.000000 +0:121 0.000000 +0:121 0.000000 +0:121 0.000000 +0:122 move second child to first child ( temp highp 4-component vector of float) +0:122 direct index ( patch temp highp 4-component vector of float BoundingBox) +0:122 'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox) +0:122 Constant: +0:122 1 (const int) +0:122 Constant: +0:122 1.000000 +0:122 1.000000 +0:122 1.000000 +0:122 1.000000 +0:123 move second child to first child ( temp highp 4-component vector of float) +0:123 direct index ( patch temp highp 4-component vector of float BoundingBox) +0:123 'gl_BoundingBoxOES' ( patch out 2-element array of highp 4-component vector of float BoundingBox) +0:123 Constant: +0:123 2 (const int) +0:123 Constant: +0:123 2.000000 +0:123 2.000000 +0:123 2.000000 +0:123 2.000000 +0:134 Function Definition: outputtingOutparam(i1; ( global void) +0:134 Function Parameters: +0:134 'a' ( out highp int) +0:136 Sequence +0:136 move second child to first child ( temp highp int) +0:136 'a' ( out highp int) +0:136 Constant: +0:136 2 (const int) +0:139 Function Definition: outputting( ( global void) +0:139 Function Parameters: +0:141 Sequence +0:141 move second child to first child ( temp highp int) +0:141 indirect index ( temp highp int) +0:141 'outa' ( out 4-element array of highp int) +0:141 'gl_InvocationID' ( in highp int InvocationID) +0:141 Constant: +0:141 2 (const int) +0:142 move second child to first child ( temp highp int) +0:142 direct index ( temp highp int) +0:142 'outa' ( out 4-element array of highp int) +0:142 Constant: +0:142 1 (const int) +0:142 Constant: +0:142 2 (const int) +0:143 move second child to first child ( temp highp 4-component vector of float) +0:143 gl_Position: direct index for structure ( out highp 4-component vector of float Position) +0:143 direct index ( temp block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:143 'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:143 Constant: +0:143 0 (const int) +0:143 Constant: +0:143 0 (const int) +0:143 Constant: +0:143 1.000000 +0:143 1.000000 +0:143 1.000000 +0:143 1.000000 +0:144 direct index ( temp highp int) +0:144 'outa' ( out 4-element array of highp int) +0:144 Constant: +0:144 1 (const int) +0:145 direct index ( temp block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:145 'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:145 Constant: +0:145 0 (const int) +0:146 Function Call: outputtingOutparam(i1; ( global void) +0:146 direct index ( temp highp int) +0:146 'outa' ( out 4-element array of highp int) +0:146 Constant: +0:146 0 (const int) +0:147 Function Call: outputtingOutparam(i1; ( global void) +0:147 indirect index ( temp highp int) +0:147 'outa' ( out 4-element array of highp int) +0:147 'gl_InvocationID' ( in highp int InvocationID) +0:148 move second child to first child ( temp highp float) +0:148 f: direct index for structure ( out highp float) +0:148 direct index ( patch temp block{ out highp float f}) +0:148 'patchIName' ( patch out 4-element array of block{ out highp float f}) +0:148 Constant: +0:148 1 (const int) +0:148 Constant: +0:148 0 (const int) +0:148 Constant: +0:148 3.140000 +0:149 move second child to first child ( temp highp int) +0:149 indirect index ( temp highp int) +0:149 'outa' ( out 4-element array of highp int) +0:149 'gl_InvocationID' ( in highp int InvocationID) +0:149 Constant: +0:149 2 (const int) +0:? Linker Objects +0:? 'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:? 'outa' ( out 4-element array of highp int) +0:? 'patchIn' ( patch in highp 4-component vector of float) +0:? 'patchOut' ( patch out highp 4-component vector of float) +0:? 'ina' ( in highp 2-component vector of float) +0:? 'inb' ( in 32-element array of highp 2-component vector of float) +0:? 'inc' ( in 32-element array of highp 2-component vector of float) +0:? 'ind' ( in 32-element array of highp 2-component vector of float) +0:? 'implA' ( patch out unsized 1-element array of highp float) +0:? 'ivla' (layout( location=3) in 32-element array of highp 4-component vector of float) +0:? 'ivlb' (layout( location=4) in 32-element array of highp 4-component vector of float) +0:? 'ivlc' (layout( location=4) in 32-element array of highp 4-component vector of float) +0:? 'ovla' (layout( location=3) out 4-element array of highp 4-component vector of float) +0:? 'ovlb' (layout( location=4) out 4-element array of highp 4-component vector of float) +0:? 'ovlc' (layout( location=4) out 4-element array of highp 4-component vector of float) +0:? 'pinbi' ( patch out block{ out highp int a}) +0:? 'myColor2' ( centroid out 4-element array of highp 3-component vector of float) +0:? 'centr' ( centroid in 32-element array of highp 3-component vector of float) +0:? 'perSampleColor' ( sample out 4-element array of highp 4-component vector of float) +0:? 'badlay' ( out 4-element array of highp float) +0:? 'misSized' ( out 5-element array of highp float) +0:? 'okaySize' ( out 4-element array of highp float) +0:? 'pv3' ( noContraction temp highp 3-component vector of float) +0:? 'badpatchIName' ( patch out unsized 1-element array of block{ out highp float f}) +0:? 'patchIName' ( patch out 4-element array of block{ out highp float f}) + + +Linked tessellation control stage: + + +Shader version: 320 +Requested GL_ARB_separate_shader_objects +vertices = 4 +ERROR: node is still EOpNull! +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:15 Sequence +0:15 Barrier ( global void) +0:17 Sequence +0:17 move second child to first child ( temp highp int) +0:17 'a' ( temp highp int) +0:17 Constant: +0:17 5392 (const int) +0:23 Sequence +0:23 move second child to first child ( temp highp 4-component vector of float) +0:23 'p' ( temp highp 4-component vector of float) +0:23 gl_Position: direct index for structure ( in highp 4-component vector of float Position) +0:23 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:23 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:23 Constant: +0:23 1 (const int) +0:23 Constant: +0:23 0 (const int) +0:24 Sequence +0:24 move second child to first child ( temp highp float) +0:24 'ps' ( temp highp float) +0:24 gl_PointSize: direct index for structure ( in highp float PointSize) +0:24 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:24 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:24 Constant: +0:24 1 (const int) +0:24 Constant: +0:24 1 (const int) +0:25 Sequence +0:25 move second child to first child ( temp highp float) +0:25 'cd' ( temp highp float) +0:25 Constant: +0:25 0.000000 +0:27 Sequence +0:27 move second child to first child ( temp highp int) +0:27 'pvi' ( temp highp int) +0:27 'gl_PatchVerticesIn' ( in highp int PatchVertices) +0:28 Sequence +0:28 move second child to first child ( temp highp int) +0:28 'pid' ( temp highp int) +0:28 'gl_PrimitiveID' ( in highp int PrimitiveID) +0:29 Sequence +0:29 move second child to first child ( temp highp int) +0:29 'iid' ( temp highp int) +0:29 'gl_InvocationID' ( in highp int InvocationID) +0:31 move second child to first child ( temp highp 4-component vector of float) +0:31 gl_Position: direct index for structure ( out highp 4-component vector of float Position) +0:31 indirect index ( temp block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:31 'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:31 'gl_InvocationID' ( in highp int InvocationID) +0:31 Constant: +0:31 0 (const int) +0:31 'p' ( temp highp 4-component vector of float) +0:32 move second child to first child ( temp highp float) +0:32 gl_PointSize: direct index for structure ( out highp float PointSize) +0:32 indirect index ( temp block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:32 'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:32 'gl_InvocationID' ( in highp int InvocationID) +0:32 Constant: +0:32 1 (const int) +0:32 'ps' ( temp highp float) +0:33 move second child to first child ( temp highp float) +0:33 Constant: +0:33 0.000000 +0:33 'cd' ( temp highp float) +0:35 move second child to first child ( temp highp float) +0:35 direct index ( patch temp highp float TessLevelOuter) +0:35 'gl_TessLevelOuter' ( patch out 4-element array of highp float TessLevelOuter) +0:35 Constant: +0:35 3 (const int) +0:35 Constant: +0:35 3.200000 +0:36 move second child to first child ( temp highp float) +0:36 direct index ( patch temp highp float TessLevelInner) +0:36 'gl_TessLevelInner' ( patch out 2-element array of highp float TessLevelInner) +0:36 Constant: +0:36 1 (const int) +0:36 Constant: +0:36 1.300000 +0:38 Test condition and select ( temp void) +0:38 Condition +0:38 Compare Greater Than ( temp bool) +0:38 'a' ( temp highp int) +0:38 Constant: +0:38 10 (const int) +0:38 true case +0:39 Barrier ( global void) +0:38 false case +0:41 Barrier ( global void) +0:43 Barrier ( global void) +0:47 Loop with condition not tested first +0:47 Loop Condition +0:47 Compare Greater Than ( temp bool) +0:47 'a' ( temp highp int) +0:47 Constant: +0:47 10 (const int) +0:47 Loop Body +0:46 Sequence +0:46 Barrier ( global void) +0:49 switch +0:49 condition +0:49 'a' ( temp highp int) +0:49 body +0:49 Sequence +0:50 default: +0:? Sequence +0:51 Barrier ( global void) +0:52 Branch: Break +0:54 Test condition and select ( temp highp int) +0:54 Condition +0:54 Compare Less Than ( temp bool) +0:54 'a' ( temp highp int) +0:54 Constant: +0:54 12 (const int) +0:54 true case +0:54 'a' ( temp highp int) +0:54 false case +0:54 Comma ( temp highp int) +0:54 Barrier ( global void) +0:54 'a' ( temp highp int) +0:56 Sequence +0:56 Barrier ( global void) +0:59 Branch: Return +0:61 Barrier ( global void) +0:? Linker Objects +0:? 'gl_out' ( out 4-element array of block{ out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:? 'outa' ( out 4-element array of highp int) +0:? 'patchIn' ( patch in highp 4-component vector of float) +0:? 'patchOut' ( patch out highp 4-component vector of float) +0:? 'ina' ( in highp 2-component vector of float) +0:? 'inb' ( in 32-element array of highp 2-component vector of float) +0:? 'inc' ( in 32-element array of highp 2-component vector of float) +0:? 'ind' ( in 32-element array of highp 2-component vector of float) +0:? 'implA' ( patch out 1-element array of highp float) +0:? 'ivla' (layout( location=3) in 32-element array of highp 4-component vector of float) +0:? 'ivlb' (layout( location=4) in 32-element array of highp 4-component vector of float) +0:? 'ivlc' (layout( location=4) in 32-element array of highp 4-component vector of float) +0:? 'ovla' (layout( location=3) out 4-element array of highp 4-component vector of float) +0:? 'ovlb' (layout( location=4) out 4-element array of highp 4-component vector of float) +0:? 'ovlc' (layout( location=4) out 4-element array of highp 4-component vector of float) +0:? 'pinbi' ( patch out block{ out highp int a}) +0:? 'myColor2' ( centroid out 4-element array of highp 3-component vector of float) +0:? 'centr' ( centroid in 32-element array of highp 3-component vector of float) +0:? 'perSampleColor' ( sample out 4-element array of highp 4-component vector of float) +0:? 'badlay' ( out 4-element array of highp float) +0:? 'misSized' ( out 5-element array of highp float) +0:? 'okaySize' ( out 4-element array of highp float) +0:? 'pv3' ( noContraction temp highp 3-component vector of float) +0:? 'badpatchIName' ( patch out 1-element array of block{ out highp float f}) +0:? 'patchIName' ( patch out 4-element array of block{ out highp float f}) + diff --git a/deps/glslang/Test/baseResults/320.tese.out b/deps/glslang/Test/baseResults/320.tese.out new file mode 100644 index 00000000..93165ae1 --- /dev/null +++ b/deps/glslang/Test/baseResults/320.tese.out @@ -0,0 +1,275 @@ +320.tese +ERROR: 0:3: 'vertices' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:5: 'triangles' : cannot change previously set input primitive +ERROR: 0:6: 'isolines' : cannot change previously set input primitive +ERROR: 0:8: 'ccw' : cannot change previously set vertex order +ERROR: 0:12: 'equal_spacing' : cannot change previously set vertex spacing +ERROR: 0:13: 'fractional_even_spacing' : cannot change previously set vertex spacing +ERROR: 0:18: 'patch' : can only use on input in tessellation-evaluation shader +ERROR: 0:22: 'barrier' : no matching overloaded function found +ERROR: 0:33: 'gl_PointSize' : required extension not requested: Possible extensions include: +GL_EXT_tessellation_point_size +GL_OES_tessellation_point_size +ERROR: 0:34: 'gl_ClipDistance' : no such field in structure +ERROR: 0:34: 'expression' : left of '[' is not of type array, matrix, or vector +ERROR: 0:43: 'gl_PointSize' : required extension not requested: Possible extensions include: +GL_EXT_tessellation_point_size +GL_OES_tessellation_point_size +ERROR: 0:44: 'gl_ClipDistance' : undeclared identifier +ERROR: 0:44: 'gl_ClipDistance' : left of '[' is not of type array, matrix, or vector +ERROR: 0:44: 'assign' : l-value required (can't modify a const) +ERROR: 0:47: 'patch' : cannot use interpolation qualifiers with patch +ERROR: 0:48: 'patch' : cannot use interpolation qualifiers with patch +ERROR: 0:49: 'noperspective' : Reserved word. +ERROR: 0:49: 'noperspective' : not supported for this version or the enabled extensions +ERROR: 0:49: 'patch' : cannot use interpolation qualifiers with patch +ERROR: 0:50: '' : can only have one auxiliary qualifier (centroid, patch, and sample) +ERROR: 0:59: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use +ERROR: 0:64: 'quads' : cannot apply to 'out' +ERROR: 0:64: 'cw' : can only apply to 'in' +ERROR: 0:65: 'triangles' : cannot apply to 'out' +ERROR: 0:66: 'isolines' : cannot apply to 'out' +ERROR: 0:67: 'cw' : can only apply to 'in' +ERROR: 0:68: 'fractional_odd_spacing' : can only apply to 'in' +ERROR: 0:69: 'equal_spacing' : can only apply to 'in' +ERROR: 0:70: 'fractional_even_spacing' : can only apply to 'in' +ERROR: 0:71: 'point_mode' : can only apply to 'in' +ERROR: 0:73: 'in' : type must be an array: ina +ERROR: 0:75: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized +ERROR: 0:78: 'in' : type must be an array: bla +ERROR: 0:86: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized +ERROR: 0:96: 'location' : overlapping use of location 24 +ERROR: 0:99: 'location' : overlapping use of location 24 +ERROR: 0:101: 'gl_TessLevelOuter' : identifiers starting with "gl_" are reserved +ERROR: 0:113: 'gl_BoundingBoxOES' : undeclared identifier +ERROR: 39 compilation errors. No code generated. + + +Shader version: 320 +Requested GL_ARB_separate_shader_objects +input primitive = quads +vertex spacing = fractional_odd_spacing +triangle order = cw +using point mode +ERROR: node is still EOpNull! +0:20 Function Definition: main( ( global void) +0:20 Function Parameters: +0:22 Sequence +0:22 Constant: +0:22 0.000000 +0:24 Sequence +0:24 move second child to first child ( temp highp int) +0:24 'a' ( temp highp int) +0:24 Constant: +0:24 1512 (const int) +0:32 Sequence +0:32 move second child to first child ( temp highp 4-component vector of float) +0:32 'p' ( temp highp 4-component vector of float) +0:32 gl_Position: direct index for structure ( in highp 4-component vector of float Position) +0:32 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:32 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 0 (const int) +0:33 Sequence +0:33 move second child to first child ( temp highp float) +0:33 'ps' ( temp highp float) +0:33 gl_PointSize: direct index for structure ( in highp float PointSize) +0:33 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:33 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in unsized 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 1 (const int) +0:34 Sequence +0:34 move second child to first child ( temp highp float) +0:34 'cd' ( temp highp float) +0:34 Constant: +0:34 0.000000 +0:36 Sequence +0:36 move second child to first child ( temp highp int) +0:36 'pvi' ( temp highp int) +0:36 'gl_PatchVerticesIn' ( in highp int PatchVertices) +0:37 Sequence +0:37 move second child to first child ( temp highp int) +0:37 'pid' ( temp highp int) +0:37 'gl_PrimitiveID' ( in highp int PrimitiveID) +0:38 Sequence +0:38 move second child to first child ( temp highp 3-component vector of float) +0:38 'tc' ( temp highp 3-component vector of float) +0:38 'gl_TessCoord' ( in highp 3-component vector of float TessCoord) +0:39 Sequence +0:39 move second child to first child ( temp highp float) +0:39 'tlo' ( temp highp float) +0:39 direct index ( patch temp highp float TessLevelOuter) +0:39 'gl_TessLevelOuter' ( patch in 4-element array of highp float TessLevelOuter) +0:39 Constant: +0:39 3 (const int) +0:40 Sequence +0:40 move second child to first child ( temp highp float) +0:40 'tli' ( temp highp float) +0:40 direct index ( patch temp highp float TessLevelInner) +0:40 'gl_TessLevelInner' ( patch in 2-element array of highp float TessLevelInner) +0:40 Constant: +0:40 1 (const int) +0:42 move second child to first child ( temp highp 4-component vector of float) +0:42 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) +0:42 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, gl_PointSize highp float PointSize gl_PointSize}) +0:42 Constant: +0:42 0 (const uint) +0:42 'p' ( temp highp 4-component vector of float) +0:43 move second child to first child ( temp highp float) +0:43 gl_PointSize: direct index for structure ( gl_PointSize highp float PointSize) +0:43 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, gl_PointSize highp float PointSize gl_PointSize}) +0:43 Constant: +0:43 1 (const uint) +0:43 'ps' ( temp highp float) +0:44 move second child to first child ( temp highp float) +0:44 Constant: +0:44 0.000000 +0:44 'cd' ( temp highp float) +0:111 Function Definition: bbbad( ( global void) +0:111 Function Parameters: +0:113 Sequence +0:113 'gl_BoundingBoxOES' ( temp float) +0:? Linker Objects +0:? 'patchIn' ( patch in highp 4-component vector of float) +0:? 'patchOut' ( patch out highp 4-component vector of float) +0:? 'badp1' ( smooth patch in highp 4-component vector of float) +0:? 'badp2' ( flat patch in highp 4-component vector of float) +0:? 'badp3' ( noperspective patch in highp 4-component vector of float) +0:? 'badp4' ( patch sample in highp 3-component vector of float) +0:? 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position}) +0:? 'ina' ( in highp 2-component vector of float) +0:? 'inb' ( in 32-element array of highp 2-component vector of float) +0:? 'inc' ( in 32-element array of highp 2-component vector of float) +0:? 'ind' ( in 32-element array of highp 2-component vector of float) +0:? 'bla' ( in block{ in highp int f}) +0:? 'blb' ( in 32-element array of block{ in highp int f}) +0:? 'blc' ( in 32-element array of block{ in highp int f}) +0:? 'bld' ( in 32-element array of block{ in highp int f}) +0:? 'ivla' (layout( location=23) in 32-element array of highp 4-component vector of float) +0:? 'ivlb' (layout( location=24) in 32-element array of highp 4-component vector of float) +0:? 'ivlc' (layout( location=24) in 32-element array of highp 4-component vector of float) +0:? 'ovla' (layout( location=23) out 2-element array of highp 4-component vector of float) +0:? 'ovlb' (layout( location=24) out 2-element array of highp 4-component vector of float) +0:? 'pinbi' ( patch in block{ in highp int a}) +0:? 'myColor2' ( centroid out highp 3-component vector of float) +0:? 'centr' ( centroid in 32-element array of highp 3-component vector of float) +0:? 'perSampleColor' ( sample out highp 4-component vector of float) + + +Linked tessellation evaluation stage: + + +Shader version: 320 +Requested GL_ARB_separate_shader_objects +input primitive = quads +vertex spacing = fractional_odd_spacing +triangle order = cw +using point mode +ERROR: node is still EOpNull! +0:20 Function Definition: main( ( global void) +0:20 Function Parameters: +0:22 Sequence +0:22 Constant: +0:22 0.000000 +0:24 Sequence +0:24 move second child to first child ( temp highp int) +0:24 'a' ( temp highp int) +0:24 Constant: +0:24 1512 (const int) +0:32 Sequence +0:32 move second child to first child ( temp highp 4-component vector of float) +0:32 'p' ( temp highp 4-component vector of float) +0:32 gl_Position: direct index for structure ( in highp 4-component vector of float Position) +0:32 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:32 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 0 (const int) +0:33 Sequence +0:33 move second child to first child ( temp highp float) +0:33 'ps' ( temp highp float) +0:33 gl_PointSize: direct index for structure ( in highp float PointSize) +0:33 direct index ( temp block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:33 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize, in highp 4-component vector of float gl_SecondaryPositionNV, in 1-element array of highp 4-component vector of float gl_PositionPerViewNV}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 1 (const int) +0:34 Sequence +0:34 move second child to first child ( temp highp float) +0:34 'cd' ( temp highp float) +0:34 Constant: +0:34 0.000000 +0:36 Sequence +0:36 move second child to first child ( temp highp int) +0:36 'pvi' ( temp highp int) +0:36 'gl_PatchVerticesIn' ( in highp int PatchVertices) +0:37 Sequence +0:37 move second child to first child ( temp highp int) +0:37 'pid' ( temp highp int) +0:37 'gl_PrimitiveID' ( in highp int PrimitiveID) +0:38 Sequence +0:38 move second child to first child ( temp highp 3-component vector of float) +0:38 'tc' ( temp highp 3-component vector of float) +0:38 'gl_TessCoord' ( in highp 3-component vector of float TessCoord) +0:39 Sequence +0:39 move second child to first child ( temp highp float) +0:39 'tlo' ( temp highp float) +0:39 direct index ( patch temp highp float TessLevelOuter) +0:39 'gl_TessLevelOuter' ( patch in 4-element array of highp float TessLevelOuter) +0:39 Constant: +0:39 3 (const int) +0:40 Sequence +0:40 move second child to first child ( temp highp float) +0:40 'tli' ( temp highp float) +0:40 direct index ( patch temp highp float TessLevelInner) +0:40 'gl_TessLevelInner' ( patch in 2-element array of highp float TessLevelInner) +0:40 Constant: +0:40 1 (const int) +0:42 move second child to first child ( temp highp 4-component vector of float) +0:42 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) +0:42 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, gl_PointSize highp float PointSize gl_PointSize}) +0:42 Constant: +0:42 0 (const uint) +0:42 'p' ( temp highp 4-component vector of float) +0:43 move second child to first child ( temp highp float) +0:43 gl_PointSize: direct index for structure ( gl_PointSize highp float PointSize) +0:43 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, gl_PointSize highp float PointSize gl_PointSize}) +0:43 Constant: +0:43 1 (const uint) +0:43 'ps' ( temp highp float) +0:44 move second child to first child ( temp highp float) +0:44 Constant: +0:44 0.000000 +0:44 'cd' ( temp highp float) +0:? Linker Objects +0:? 'patchIn' ( patch in highp 4-component vector of float) +0:? 'patchOut' ( patch out highp 4-component vector of float) +0:? 'badp1' ( smooth patch in highp 4-component vector of float) +0:? 'badp2' ( flat patch in highp 4-component vector of float) +0:? 'badp3' ( noperspective patch in highp 4-component vector of float) +0:? 'badp4' ( patch sample in highp 3-component vector of float) +0:? 'gl_in' ( in 32-element array of block{ in highp 4-component vector of float Position gl_Position}) +0:? 'ina' ( in highp 2-component vector of float) +0:? 'inb' ( in 32-element array of highp 2-component vector of float) +0:? 'inc' ( in 32-element array of highp 2-component vector of float) +0:? 'ind' ( in 32-element array of highp 2-component vector of float) +0:? 'bla' ( in block{ in highp int f}) +0:? 'blb' ( in 32-element array of block{ in highp int f}) +0:? 'blc' ( in 32-element array of block{ in highp int f}) +0:? 'bld' ( in 32-element array of block{ in highp int f}) +0:? 'ivla' (layout( location=23) in 32-element array of highp 4-component vector of float) +0:? 'ivlb' (layout( location=24) in 32-element array of highp 4-component vector of float) +0:? 'ivlc' (layout( location=24) in 32-element array of highp 4-component vector of float) +0:? 'ovla' (layout( location=23) out 2-element array of highp 4-component vector of float) +0:? 'ovlb' (layout( location=24) out 2-element array of highp 4-component vector of float) +0:? 'pinbi' ( patch in block{ in highp int a}) +0:? 'myColor2' ( centroid out highp 3-component vector of float) +0:? 'centr' ( centroid in 32-element array of highp 3-component vector of float) +0:? 'perSampleColor' ( sample out highp 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/320.vert.out b/deps/glslang/Test/baseResults/320.vert.out new file mode 100644 index 00000000..2838ab89 --- /dev/null +++ b/deps/glslang/Test/baseResults/320.vert.out @@ -0,0 +1,797 @@ +320.vert +ERROR: 0:6: 's' : member of block cannot be or contain a sampler, image, or atomic_uint type +ERROR: 0:14: 'location' : overlapping use of location 12 +ERROR: 0:16: 'input block' : not supported in this stage: vertex +ERROR: 0:18: 'gl_PerVertex' : block redeclaration has extra members +ERROR: 0:28: 'gl_PointSize' : member of nameless block was not redeclared +ERROR: 0:28: 'assign' : cannot convert from ' const float' to ' gl_PointSize highp void PointSize' +ERROR: 0:31: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use +ERROR: 0:36: 'flat/smooth/noperspective' : cannot use interpolation qualifiers on an interface block +ERROR: 0:40: 'flat/smooth/noperspective' : cannot use interpolation qualifiers on an interface block +ERROR: 0:44: 'centroid' : cannot use centroid qualifier on an interface block +ERROR: 0:48: 'invariant' : cannot use invariant qualifier on an interface block +ERROR: 0:68: 'variable indexing buffer block array' : not supported with this profile: es +ERROR: 0:73: 'textureGatherOffsets(...)' : must be a compile-time constant: offsets argument +ERROR: 0:76: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:77: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:78: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:79: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:80: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:81: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:116: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:117: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:118: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:120: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:121: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:122: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:123: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:191: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:192: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:193: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:211: 'textureSize' : no matching overloaded function found +ERROR: 0:211: '=' : cannot convert from ' const float' to ' temp highp 3-component vector of int' +ERROR: 0:252: 'interpolateAtCentroid' : no matching overloaded function found +ERROR: 0:253: 'interpolateAtSample' : no matching overloaded function found +ERROR: 0:254: 'interpolateAtOffset' : no matching overloaded function found +ERROR: 34 compilation errors. No code generated. + + +Shader version: 320 +ERROR: node is still EOpNull! +0:23 Function Definition: main( ( global void) +0:23 Function Parameters: +0:25 Sequence +0:25 Sequence +0:25 move second child to first child ( temp highp int) +0:25 'sum' ( temp highp int) +0:25 add ( temp highp int) +0:25 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:26 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) +0:27 move second child to first child ( temp highp 4-component vector of float) +0:27 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) +0:27 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, }) +0:27 Constant: +0:27 0 (const uint) +0:27 Constant: +0:27 1.000000 +0:27 1.000000 +0:27 1.000000 +0:27 1.000000 +0:28 gl_PointSize: direct index for structure ( gl_PointSize highp void PointSize) +0:28 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, }) +0:28 Constant: +0:28 1 (const uint) +0:62 Function Definition: pfoo( ( global void) +0:62 Function Parameters: +0:? Sequence +0:65 move second child to first child ( temp highp 2-component vector of float) +0:65 'h' ( noContraction temp highp 2-component vector of float) +0:65 fma ( global highp 2-component vector of float) +0:65 'inf' ( in highp 2-component vector of float) +0:65 'ing' ( in highp 2-component vector of float) +0:65 'h' ( noContraction temp highp 2-component vector of float) +0:66 indirect index ( temp lowp sampler2D) +0:66 'sArray' ( uniform 4-element array of lowp sampler2D) +0:66 add ( temp highp int) +0:66 'sIndex' ( uniform highp int) +0:66 Constant: +0:66 1 (const int) +0:67 indirect index (layout( column_major shared) temp block{layout( column_major shared) uniform highp int i}) +0:67 'ubInst' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform highp int i}) +0:67 add ( temp highp int) +0:67 'sIndex' ( uniform highp int) +0:67 Constant: +0:67 1 (const int) +0:68 indirect index (layout( column_major shared) temp block{layout( column_major shared) buffer highp int i}) +0:68 'bbInst' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer highp int i}) +0:68 subtract ( temp highp int) +0:68 'sIndex' ( uniform highp int) +0:68 Constant: +0:68 2 (const int) +0:69 direct index ( writeonly temp highp image2D) +0:69 'iArray' ( writeonly uniform 5-element array of highp image2D) +0:69 Constant: +0:69 2 (const int) +0:70 indirect index ( writeonly temp highp image2D) +0:70 'iArray' ( writeonly uniform 5-element array of highp image2D) +0:70 subtract ( temp highp int) +0:70 'sIndex' ( uniform highp int) +0:70 Constant: +0:70 2 (const int) +0:71 textureGatherOffset ( global lowp 4-component vector of float) +0:71 direct index ( temp lowp sampler2D) +0:71 'sArray' ( uniform 4-element array of lowp sampler2D) +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 0.100000 +0:71 0.100000 +0:71 Convert float to int ( temp lowp 2-component vector of int) +0:71 'inf' ( in highp 2-component vector of float) +0:72 textureGatherOffsets ( global lowp 4-component vector of float, operation at highp) +0:72 direct index ( temp lowp sampler2D) +0:72 'sArray' ( uniform 4-element array of lowp sampler2D) +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 0.100000 +0:72 0.100000 +0:72 Constant: +0:72 0 (const int) +0:72 0 (const int) +0:72 0 (const int) +0:72 0 (const int) +0:72 0 (const int) +0:72 0 (const int) +0:72 0 (const int) +0:72 0 (const int) +0:73 textureGatherOffsets ( global lowp 4-component vector of float, operation at highp) +0:73 direct index ( temp lowp sampler2D) +0:73 'sArray' ( uniform 4-element array of lowp sampler2D) +0:73 Constant: +0:73 0 (const int) +0:73 Constant: +0:73 0.100000 +0:73 0.100000 +0:73 'offsets' ( uniform 4-element array of highp 2-component vector of int) +0:101 Function Definition: bufferT( ( global void) +0:101 Function Parameters: +0:103 Sequence +0:103 Sequence +0:103 move second child to first child ( temp highp int) +0:103 's1' ( temp highp int) +0:103 textureSize ( global highp int) +0:103 'bufSamp1' ( uniform highp samplerBuffer) +0:104 Sequence +0:104 move second child to first child ( temp highp int) +0:104 's2' ( temp highp int) +0:104 textureSize ( global highp int) +0:104 'bufSamp2' ( uniform highp isamplerBuffer) +0:105 Sequence +0:105 move second child to first child ( temp highp int) +0:105 's3' ( temp highp int) +0:105 textureSize ( global highp int) +0:105 'bufSamp3' ( uniform highp usamplerBuffer) +0:107 Sequence +0:107 move second child to first child ( temp highp int) +0:107 's4' ( temp highp int) +0:107 imageQuerySize ( global highp int) +0:107 'bufSamp4' ( writeonly uniform highp imageBuffer) +0:108 Sequence +0:108 move second child to first child ( temp highp int) +0:108 's5' ( temp highp int) +0:108 imageQuerySize ( global highp int) +0:108 'bufSamp5' ( writeonly uniform highp iimageBuffer) +0:109 Sequence +0:109 move second child to first child ( temp highp int) +0:109 's6' ( temp highp int) +0:109 imageQuerySize ( global highp int) +0:109 'bufSamp6' ( writeonly uniform highp uimageBuffer) +0:111 Sequence +0:111 move second child to first child ( temp highp 4-component vector of float) +0:111 'f1' ( temp highp 4-component vector of float) +0:111 textureFetch ( global highp 4-component vector of float) +0:111 'bufSamp1' ( uniform highp samplerBuffer) +0:111 's1' ( temp highp int) +0:112 Sequence +0:112 move second child to first child ( temp highp 4-component vector of int) +0:112 'f2' ( temp highp 4-component vector of int) +0:112 textureFetch ( global highp 4-component vector of int) +0:112 'bufSamp2' ( uniform highp isamplerBuffer) +0:112 's2' ( temp highp int) +0:113 Sequence +0:113 move second child to first child ( temp highp 4-component vector of uint) +0:113 'f3' ( temp highp 4-component vector of uint) +0:113 textureFetch ( global highp 4-component vector of uint) +0:113 'bufSamp3' ( uniform highp usamplerBuffer) +0:113 's3' ( temp highp int) +0:149 Function Definition: CAT( ( global void) +0:149 Function Parameters: +0:151 Sequence +0:151 Sequence +0:151 move second child to first child ( temp highp 3-component vector of int) +0:151 's4' ( temp highp 3-component vector of int) +0:151 textureSize ( global highp 3-component vector of int) +0:151 'CA4' ( uniform highp samplerCubeArray) +0:151 Constant: +0:151 1 (const int) +0:152 Sequence +0:152 move second child to first child ( temp highp 3-component vector of int) +0:152 's5' ( temp highp 3-component vector of int) +0:152 textureSize ( global highp 3-component vector of int) +0:152 'CA5' ( uniform highp samplerCubeArrayShadow) +0:152 Constant: +0:152 1 (const int) +0:153 Sequence +0:153 move second child to first child ( temp highp 3-component vector of int) +0:153 's6' ( temp highp 3-component vector of int) +0:153 textureSize ( global highp 3-component vector of int) +0:153 'CA6' ( uniform highp isamplerCubeArray) +0:153 Constant: +0:153 1 (const int) +0:154 Sequence +0:154 move second child to first child ( temp highp 3-component vector of int) +0:154 's7' ( temp highp 3-component vector of int) +0:154 textureSize ( global highp 3-component vector of int) +0:154 'CA7' ( uniform highp usamplerCubeArray) +0:154 Constant: +0:154 1 (const int) +0:156 Sequence +0:156 move second child to first child ( temp highp 4-component vector of float) +0:156 't4' ( temp highp 4-component vector of float) +0:156 texture ( global highp 4-component vector of float) +0:156 'CA4' ( uniform highp samplerCubeArray) +0:156 Constant: +0:156 0.500000 +0:156 0.500000 +0:156 0.500000 +0:156 0.500000 +0:157 Sequence +0:157 move second child to first child ( temp highp float) +0:157 't5' ( temp highp float) +0:157 texture ( global highp float) +0:157 'CA5' ( uniform highp samplerCubeArrayShadow) +0:157 Constant: +0:157 0.500000 +0:157 0.500000 +0:157 0.500000 +0:157 0.500000 +0:157 Constant: +0:157 3.000000 +0:158 Sequence +0:158 move second child to first child ( temp highp 4-component vector of int) +0:158 't6' ( temp highp 4-component vector of int) +0:158 texture ( global highp 4-component vector of int) +0:158 'CA6' ( uniform highp isamplerCubeArray) +0:158 Constant: +0:158 0.500000 +0:158 0.500000 +0:158 0.500000 +0:158 0.500000 +0:159 Sequence +0:159 move second child to first child ( temp highp 4-component vector of uint) +0:159 't7' ( temp highp 4-component vector of uint) +0:159 texture ( global highp 4-component vector of uint) +0:159 'CA7' ( uniform highp usamplerCubeArray) +0:159 Constant: +0:159 0.500000 +0:159 0.500000 +0:159 0.500000 +0:159 0.500000 +0:161 Sequence +0:161 move second child to first child ( temp highp 4-component vector of float) +0:161 'L4' ( temp highp 4-component vector of float) +0:161 textureLod ( global highp 4-component vector of float) +0:161 'CA4' ( uniform highp samplerCubeArray) +0:161 Constant: +0:161 0.500000 +0:161 0.500000 +0:161 0.500000 +0:161 0.500000 +0:161 Constant: +0:161 0.240000 +0:162 Sequence +0:162 move second child to first child ( temp highp 4-component vector of int) +0:162 'L6' ( temp highp 4-component vector of int) +0:162 textureLod ( global highp 4-component vector of int) +0:162 'CA6' ( uniform highp isamplerCubeArray) +0:162 Constant: +0:162 0.500000 +0:162 0.500000 +0:162 0.500000 +0:162 0.500000 +0:162 Constant: +0:162 0.260000 +0:163 Sequence +0:163 move second child to first child ( temp highp 4-component vector of uint) +0:163 'L7' ( temp highp 4-component vector of uint) +0:163 textureLod ( global highp 4-component vector of uint) +0:163 'CA7' ( uniform highp usamplerCubeArray) +0:163 Constant: +0:163 0.500000 +0:163 0.500000 +0:163 0.500000 +0:163 0.500000 +0:163 Constant: +0:163 0.270000 +0:165 Sequence +0:165 move second child to first child ( temp highp 4-component vector of float) +0:165 'g4' ( temp highp 4-component vector of float) +0:165 textureGrad ( global highp 4-component vector of float) +0:165 'CA4' ( uniform highp samplerCubeArray) +0:165 Constant: +0:165 0.500000 +0:165 0.500000 +0:165 0.500000 +0:165 0.500000 +0:165 Constant: +0:165 0.100000 +0:165 0.100000 +0:165 0.100000 +0:165 Constant: +0:165 0.200000 +0:165 0.200000 +0:165 0.200000 +0:166 Sequence +0:166 move second child to first child ( temp highp 4-component vector of int) +0:166 'g6' ( temp highp 4-component vector of int) +0:166 textureGrad ( global highp 4-component vector of int) +0:166 'CA6' ( uniform highp isamplerCubeArray) +0:166 Constant: +0:166 0.500000 +0:166 0.500000 +0:166 0.500000 +0:166 0.500000 +0:166 Constant: +0:166 0.100000 +0:166 0.100000 +0:166 0.100000 +0:166 Constant: +0:166 0.200000 +0:166 0.200000 +0:166 0.200000 +0:167 Sequence +0:167 move second child to first child ( temp highp 4-component vector of uint) +0:167 'g7' ( temp highp 4-component vector of uint) +0:167 textureGrad ( global highp 4-component vector of uint) +0:167 'CA7' ( uniform highp usamplerCubeArray) +0:167 Constant: +0:167 0.500000 +0:167 0.500000 +0:167 0.500000 +0:167 0.500000 +0:167 Constant: +0:167 0.100000 +0:167 0.100000 +0:167 0.100000 +0:167 Constant: +0:167 0.200000 +0:167 0.200000 +0:167 0.200000 +0:169 Sequence +0:169 move second child to first child ( temp highp 4-component vector of float) +0:169 'gath4' ( temp highp 4-component vector of float) +0:169 textureGather ( global highp 4-component vector of float) +0:169 'CA4' ( uniform highp samplerCubeArray) +0:169 Constant: +0:169 0.500000 +0:169 0.500000 +0:169 0.500000 +0:169 0.500000 +0:170 Sequence +0:170 move second child to first child ( temp highp 4-component vector of float) +0:170 'gathC4' ( temp highp 4-component vector of float) +0:170 textureGather ( global highp 4-component vector of float) +0:170 'CA4' ( uniform highp samplerCubeArray) +0:170 Constant: +0:170 0.500000 +0:170 0.500000 +0:170 0.500000 +0:170 0.500000 +0:170 Constant: +0:170 2 (const int) +0:171 Sequence +0:171 move second child to first child ( temp highp 4-component vector of int) +0:171 'gath6' ( temp highp 4-component vector of int) +0:171 textureGather ( global highp 4-component vector of int) +0:171 'CA6' ( uniform highp isamplerCubeArray) +0:171 Constant: +0:171 0.500000 +0:171 0.500000 +0:171 0.500000 +0:171 0.500000 +0:172 Sequence +0:172 move second child to first child ( temp highp 4-component vector of int) +0:172 'gathC6' ( temp highp 4-component vector of int) +0:172 textureGather ( global highp 4-component vector of int) +0:172 'CA6' ( uniform highp isamplerCubeArray) +0:172 Constant: +0:172 0.500000 +0:172 0.500000 +0:172 0.500000 +0:172 0.500000 +0:172 Constant: +0:172 1 (const int) +0:173 Sequence +0:173 move second child to first child ( temp highp 4-component vector of uint) +0:173 'gath7' ( temp highp 4-component vector of uint) +0:173 textureGather ( global highp 4-component vector of uint) +0:173 'CA7' ( uniform highp usamplerCubeArray) +0:173 Constant: +0:173 0.500000 +0:173 0.500000 +0:173 0.500000 +0:173 0.500000 +0:174 Sequence +0:174 move second child to first child ( temp highp 4-component vector of uint) +0:174 'gathC7' ( temp highp 4-component vector of uint) +0:174 textureGather ( global highp 4-component vector of uint) +0:174 'CA7' ( uniform highp usamplerCubeArray) +0:174 Constant: +0:174 0.500000 +0:174 0.500000 +0:174 0.500000 +0:174 0.500000 +0:174 Constant: +0:174 0 (const int) +0:176 Sequence +0:176 move second child to first child ( temp highp 4-component vector of float) +0:176 'gath5' ( temp highp 4-component vector of float) +0:176 textureGather ( global highp 4-component vector of float) +0:176 'CA5' ( uniform highp samplerCubeArrayShadow) +0:176 Constant: +0:176 0.500000 +0:176 0.500000 +0:176 0.500000 +0:176 0.500000 +0:176 Constant: +0:176 2.500000 +0:178 Sequence +0:178 move second child to first child ( temp highp 3-component vector of int) +0:178 's1' ( temp highp 3-component vector of int) +0:178 imageQuerySize ( global highp 3-component vector of int) +0:178 'CA1' ( writeonly uniform highp imageCubeArray) +0:179 Sequence +0:179 move second child to first child ( temp highp 3-component vector of int) +0:179 's2' ( temp highp 3-component vector of int) +0:179 imageQuerySize ( global highp 3-component vector of int) +0:179 'CA2' ( writeonly uniform highp iimageCubeArray) +0:180 Sequence +0:180 move second child to first child ( temp highp 3-component vector of int) +0:180 's3' ( temp highp 3-component vector of int) +0:180 imageQuerySize ( global highp 3-component vector of int) +0:180 'CA3' ( writeonly uniform highp uimageCubeArray) +0:182 imageStore ( global highp void) +0:182 'CA1' ( writeonly uniform highp imageCubeArray) +0:182 's3' ( temp highp 3-component vector of int) +0:182 Constant: +0:182 1.000000 +0:182 1.000000 +0:182 1.000000 +0:182 1.000000 +0:183 imageStore ( global highp void) +0:183 'CA2' ( writeonly uniform highp iimageCubeArray) +0:183 's3' ( temp highp 3-component vector of int) +0:183 Constant: +0:183 1 (const int) +0:183 1 (const int) +0:183 1 (const int) +0:183 1 (const int) +0:184 imageStore ( global highp void) +0:184 'CA3' ( writeonly uniform highp uimageCubeArray) +0:184 's3' ( temp highp 3-component vector of int) +0:184 Constant: +0:184 1 (const uint) +0:184 1 (const uint) +0:184 1 (const uint) +0:184 1 (const uint) +0:186 Sequence +0:186 move second child to first child ( temp highp 4-component vector of float) +0:186 'cl1' ( temp highp 4-component vector of float) +0:186 imageLoad ( global highp 4-component vector of float) +0:186 'rCA1' (layout( rgba16f) readonly uniform highp imageCubeArray) +0:186 's3' ( temp highp 3-component vector of int) +0:187 Sequence +0:187 move second child to first child ( temp highp 4-component vector of int) +0:187 'cl2' ( temp highp 4-component vector of int) +0:187 imageLoad ( global highp 4-component vector of int) +0:187 'rCA2' (layout( rgba32i) readonly uniform highp iimageCubeArray) +0:187 's3' ( temp highp 3-component vector of int) +0:188 Sequence +0:188 move second child to first child ( temp highp 4-component vector of uint) +0:188 'cl3' ( temp highp 4-component vector of uint) +0:188 imageLoad ( global highp 4-component vector of uint) +0:188 'rCA3' (layout( r32ui) readonly uniform highp uimageCubeArray) +0:188 's3' ( temp highp 3-component vector of int) +0:203 Function Definition: MSA( ( global void) +0:203 Function Parameters: +0:205 Sequence +0:205 Sequence +0:205 move second child to first child ( temp highp 4-component vector of float) +0:205 'tf' ( temp highp 4-component vector of float) +0:205 textureFetch ( global highp 4-component vector of float) +0:205 'samp2DMSA' ( uniform highp sampler2DMSArray) +0:205 Constant: +0:205 5 (const int) +0:205 5 (const int) +0:205 5 (const int) +0:205 Constant: +0:205 2 (const int) +0:206 Sequence +0:206 move second child to first child ( temp highp 4-component vector of int) +0:206 'tfi' ( temp highp 4-component vector of int) +0:206 textureFetch ( global highp 4-component vector of int) +0:206 'samp2DMSAi' ( uniform highp isampler2DMSArray) +0:206 Constant: +0:206 5 (const int) +0:206 5 (const int) +0:206 5 (const int) +0:206 Constant: +0:206 2 (const int) +0:207 Sequence +0:207 move second child to first child ( temp highp 4-component vector of uint) +0:207 'tfu' ( temp highp 4-component vector of uint) +0:207 textureFetch ( global highp 4-component vector of uint) +0:207 'samp2DMSAu' ( uniform highp usampler2DMSArray) +0:207 Constant: +0:207 5 (const int) +0:207 5 (const int) +0:207 5 (const int) +0:207 Constant: +0:207 2 (const int) +0:209 Sequence +0:209 move second child to first child ( temp highp 3-component vector of int) +0:209 'tfs' ( temp highp 3-component vector of int) +0:209 textureSize ( global highp 3-component vector of int) +0:209 'samp2DMSA' ( uniform highp sampler2DMSArray) +0:210 Sequence +0:210 move second child to first child ( temp highp 3-component vector of int) +0:210 'tfsi' ( temp highp 3-component vector of int) +0:210 textureSize ( global highp 3-component vector of int) +0:210 'samp2DMSAi' ( uniform highp isampler2DMSArray) +0:212 Sequence +0:212 move second child to first child ( temp highp 3-component vector of int) +0:212 'tfsu' ( temp highp 3-component vector of int) +0:212 textureSize ( global highp 3-component vector of int) +0:212 'samp2DMSAu' ( uniform highp usampler2DMSArray) +0:220 Function Definition: goodImageAtom( ( global void) +0:220 Function Parameters: +0:? Sequence +0:226 imageAtomicAdd ( global highp int) +0:226 'im2Di' (layout( r32i) uniform highp iimage2D) +0:226 'P' ( uniform highp 2-component vector of int) +0:226 'dati' ( temp highp int) +0:227 imageAtomicAdd ( global highp uint) +0:227 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:227 'P' ( uniform highp 2-component vector of int) +0:227 'datu' ( temp highp uint) +0:228 imageAtomicMin ( global highp int) +0:228 'im2Di' (layout( r32i) uniform highp iimage2D) +0:228 'P' ( uniform highp 2-component vector of int) +0:228 'dati' ( temp highp int) +0:229 imageAtomicMin ( global highp uint) +0:229 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:229 'P' ( uniform highp 2-component vector of int) +0:229 'datu' ( temp highp uint) +0:230 imageAtomicMax ( global highp int) +0:230 'im2Di' (layout( r32i) uniform highp iimage2D) +0:230 'P' ( uniform highp 2-component vector of int) +0:230 'dati' ( temp highp int) +0:231 imageAtomicMax ( global highp uint) +0:231 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:231 'P' ( uniform highp 2-component vector of int) +0:231 'datu' ( temp highp uint) +0:232 imageAtomicAnd ( global highp int) +0:232 'im2Di' (layout( r32i) uniform highp iimage2D) +0:232 'P' ( uniform highp 2-component vector of int) +0:232 'dati' ( temp highp int) +0:233 imageAtomicAnd ( global highp uint) +0:233 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:233 'P' ( uniform highp 2-component vector of int) +0:233 'datu' ( temp highp uint) +0:234 imageAtomicOr ( global highp int) +0:234 'im2Di' (layout( r32i) uniform highp iimage2D) +0:234 'P' ( uniform highp 2-component vector of int) +0:234 'dati' ( temp highp int) +0:235 imageAtomicOr ( global highp uint) +0:235 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:235 'P' ( uniform highp 2-component vector of int) +0:235 'datu' ( temp highp uint) +0:236 imageAtomicXor ( global highp int) +0:236 'im2Di' (layout( r32i) uniform highp iimage2D) +0:236 'P' ( uniform highp 2-component vector of int) +0:236 'dati' ( temp highp int) +0:237 imageAtomicXor ( global highp uint) +0:237 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:237 'P' ( uniform highp 2-component vector of int) +0:237 'datu' ( temp highp uint) +0:238 imageAtomicExchange ( global highp int) +0:238 'im2Di' (layout( r32i) uniform highp iimage2D) +0:238 'P' ( uniform highp 2-component vector of int) +0:238 'dati' ( temp highp int) +0:239 imageAtomicExchange ( global highp uint) +0:239 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:239 'P' ( uniform highp 2-component vector of int) +0:239 'datu' ( temp highp uint) +0:240 imageAtomicExchange ( global highp float) +0:240 'im2Df' (layout( r32f) uniform highp image2D) +0:240 'P' ( uniform highp 2-component vector of int) +0:240 'datf' ( temp highp float) +0:241 imageAtomicCompSwap ( global highp int) +0:241 'im2Di' (layout( r32i) uniform highp iimage2D) +0:241 'P' ( uniform highp 2-component vector of int) +0:241 Constant: +0:241 3 (const int) +0:241 'dati' ( temp highp int) +0:242 imageAtomicCompSwap ( global highp uint) +0:242 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:242 'P' ( uniform highp 2-component vector of int) +0:242 Constant: +0:242 5 (const uint) +0:242 'datu' ( temp highp uint) +0:250 Function Definition: badInterp( ( global void) +0:250 Function Parameters: +0:252 Sequence +0:252 Constant: +0:252 0.000000 +0:253 Constant: +0:253 0.000000 +0:254 Constant: +0:254 0.000000 +0:? Linker Objects +0:? 'outbinst' ( out block{ out highp int a, out highp 4-component vector of float v, out highp sampler2D s}) +0:? 'anon@0' ( out block{layout( location=12) out highp int aAnon, layout( location=13) out highp 4-component vector of float vAnon}) +0:? 'aliased' (layout( location=12) smooth out highp int) +0:? 'inbinst' ( in block{ in highp int a}) +0:? 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, }) +0:? 'smon' ( smooth out block{ out highp int i}) +0:? 'fmon' ( flat out block{ out highp int i}) +0:? 'cmon' ( centroid out block{ out highp int i}) +0:? 'imon' ( invariant out block{ out highp int i}) +0:? 'inf' ( in highp 2-component vector of float) +0:? 'ing' ( in highp 2-component vector of float) +0:? 'offsets' ( uniform 4-element array of highp 2-component vector of int) +0:? 'sArray' ( uniform 4-element array of lowp sampler2D) +0:? 'sIndex' ( uniform highp int) +0:? 'auArray' (layout( binding=0 offset=0) uniform 2-element array of highp atomic_uint) +0:? 'ubInst' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform highp int i}) +0:? 'bbInst' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer highp int i}) +0:? 'iArray' ( writeonly uniform 5-element array of highp image2D) +0:? 'constOffsets' ( const 4-element array of highp 2-component vector of int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 'noPreSamp1' ( uniform mediump samplerBuffer) +0:? 'noPreSamp2' ( uniform mediump isamplerBuffer) +0:? 'noPreSamp3' ( uniform mediump usamplerBuffer) +0:? 'noPreSamp4' ( writeonly uniform mediump imageBuffer) +0:? 'noPreSamp5' ( writeonly uniform mediump iimageBuffer) +0:? 'noPreSamp6' ( writeonly uniform mediump uimageBuffer) +0:? 'bufSamp1' ( uniform highp samplerBuffer) +0:? 'bufSamp2' ( uniform highp isamplerBuffer) +0:? 'bufSamp3' ( uniform highp usamplerBuffer) +0:? 'bufSamp4' ( writeonly uniform highp imageBuffer) +0:? 'bufSamp5' ( writeonly uniform highp iimageBuffer) +0:? 'bufSamp6' ( writeonly uniform highp uimageBuffer) +0:? 'noPreCA1' ( writeonly uniform mediump imageCubeArray) +0:? 'noPreCA2' ( writeonly uniform mediump iimageCubeArray) +0:? 'noPreCA3' ( writeonly uniform mediump uimageCubeArray) +0:? 'noPreCA4' ( uniform mediump samplerCubeArray) +0:? 'noPreCA5' ( uniform mediump samplerCubeArrayShadow) +0:? 'noPreCA6' ( uniform mediump isamplerCubeArray) +0:? 'noPreCA7' ( uniform mediump usamplerCubeArray) +0:? 'CA1' ( writeonly uniform highp imageCubeArray) +0:? 'CA2' ( writeonly uniform highp iimageCubeArray) +0:? 'CA3' ( writeonly uniform highp uimageCubeArray) +0:? 'rCA1' (layout( rgba16f) readonly uniform highp imageCubeArray) +0:? 'rCA2' (layout( rgba32i) readonly uniform highp iimageCubeArray) +0:? 'rCA3' (layout( r32ui) readonly uniform highp uimageCubeArray) +0:? 'CA4' ( uniform highp samplerCubeArray) +0:? 'CA5' ( uniform highp samplerCubeArrayShadow) +0:? 'CA6' ( uniform highp isamplerCubeArray) +0:? 'CA7' ( uniform highp usamplerCubeArray) +0:? 'noPrec2DMS' ( uniform mediump sampler2DMSArray) +0:? 'noPrec2DMSi' ( uniform mediump isampler2DMSArray) +0:? 'noPrec2DMSu' ( uniform mediump usampler2DMSArray) +0:? 'samp2DMSA' ( uniform highp sampler2DMSArray) +0:? 'samp2DMSAi' ( uniform highp isampler2DMSArray) +0:? 'samp2DMSAu' ( uniform highp usampler2DMSArray) +0:? 'im2Df' (layout( r32f) uniform highp image2D) +0:? 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:? 'im2Di' (layout( r32i) uniform highp iimage2D) +0:? 'P' ( uniform highp 2-component vector of int) +0:? 'colorSample' ( smooth sample out highp 4-component vector of float) +0:? 'colorfsi' ( flat sample out highp 4-component vector of float) +0:? 'sampInArray' ( smooth sample out 4-element array of highp 3-component vector of float) +0:? 'inv4' ( in highp 4-component vector of float) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + + +Linked vertex stage: + + +Shader version: 320 +ERROR: node is still EOpNull! +0:23 Function Definition: main( ( global void) +0:23 Function Parameters: +0:25 Sequence +0:25 Sequence +0:25 move second child to first child ( temp highp int) +0:25 'sum' ( temp highp int) +0:25 add ( temp highp int) +0:25 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:26 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) +0:27 move second child to first child ( temp highp 4-component vector of float) +0:27 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) +0:27 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, }) +0:27 Constant: +0:27 0 (const uint) +0:27 Constant: +0:27 1.000000 +0:27 1.000000 +0:27 1.000000 +0:27 1.000000 +0:28 gl_PointSize: direct index for structure ( gl_PointSize highp void PointSize) +0:28 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, }) +0:28 Constant: +0:28 1 (const uint) +0:? Linker Objects +0:? 'outbinst' ( out block{ out highp int a, out highp 4-component vector of float v, out highp sampler2D s}) +0:? 'anon@0' ( out block{layout( location=12) out highp int aAnon, layout( location=13) out highp 4-component vector of float vAnon}) +0:? 'aliased' (layout( location=12) smooth out highp int) +0:? 'inbinst' ( in block{ in highp int a}) +0:? 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, }) +0:? 'smon' ( smooth out block{ out highp int i}) +0:? 'fmon' ( flat out block{ out highp int i}) +0:? 'cmon' ( centroid out block{ out highp int i}) +0:? 'imon' ( invariant out block{ out highp int i}) +0:? 'inf' ( in highp 2-component vector of float) +0:? 'ing' ( in highp 2-component vector of float) +0:? 'offsets' ( uniform 4-element array of highp 2-component vector of int) +0:? 'sArray' ( uniform 4-element array of lowp sampler2D) +0:? 'sIndex' ( uniform highp int) +0:? 'auArray' (layout( binding=0 offset=0) uniform 2-element array of highp atomic_uint) +0:? 'ubInst' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform highp int i}) +0:? 'bbInst' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer highp int i}) +0:? 'iArray' ( writeonly uniform 5-element array of highp image2D) +0:? 'constOffsets' ( const 4-element array of highp 2-component vector of int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 'noPreSamp1' ( uniform mediump samplerBuffer) +0:? 'noPreSamp2' ( uniform mediump isamplerBuffer) +0:? 'noPreSamp3' ( uniform mediump usamplerBuffer) +0:? 'noPreSamp4' ( writeonly uniform mediump imageBuffer) +0:? 'noPreSamp5' ( writeonly uniform mediump iimageBuffer) +0:? 'noPreSamp6' ( writeonly uniform mediump uimageBuffer) +0:? 'bufSamp1' ( uniform highp samplerBuffer) +0:? 'bufSamp2' ( uniform highp isamplerBuffer) +0:? 'bufSamp3' ( uniform highp usamplerBuffer) +0:? 'bufSamp4' ( writeonly uniform highp imageBuffer) +0:? 'bufSamp5' ( writeonly uniform highp iimageBuffer) +0:? 'bufSamp6' ( writeonly uniform highp uimageBuffer) +0:? 'noPreCA1' ( writeonly uniform mediump imageCubeArray) +0:? 'noPreCA2' ( writeonly uniform mediump iimageCubeArray) +0:? 'noPreCA3' ( writeonly uniform mediump uimageCubeArray) +0:? 'noPreCA4' ( uniform mediump samplerCubeArray) +0:? 'noPreCA5' ( uniform mediump samplerCubeArrayShadow) +0:? 'noPreCA6' ( uniform mediump isamplerCubeArray) +0:? 'noPreCA7' ( uniform mediump usamplerCubeArray) +0:? 'CA1' ( writeonly uniform highp imageCubeArray) +0:? 'CA2' ( writeonly uniform highp iimageCubeArray) +0:? 'CA3' ( writeonly uniform highp uimageCubeArray) +0:? 'rCA1' (layout( rgba16f) readonly uniform highp imageCubeArray) +0:? 'rCA2' (layout( rgba32i) readonly uniform highp iimageCubeArray) +0:? 'rCA3' (layout( r32ui) readonly uniform highp uimageCubeArray) +0:? 'CA4' ( uniform highp samplerCubeArray) +0:? 'CA5' ( uniform highp samplerCubeArrayShadow) +0:? 'CA6' ( uniform highp isamplerCubeArray) +0:? 'CA7' ( uniform highp usamplerCubeArray) +0:? 'noPrec2DMS' ( uniform mediump sampler2DMSArray) +0:? 'noPrec2DMSi' ( uniform mediump isampler2DMSArray) +0:? 'noPrec2DMSu' ( uniform mediump usampler2DMSArray) +0:? 'samp2DMSA' ( uniform highp sampler2DMSArray) +0:? 'samp2DMSAi' ( uniform highp isampler2DMSArray) +0:? 'samp2DMSAu' ( uniform highp usampler2DMSArray) +0:? 'im2Df' (layout( r32f) uniform highp image2D) +0:? 'im2Du' (layout( r32ui) uniform highp uimage2D) +0:? 'im2Di' (layout( r32i) uniform highp iimage2D) +0:? 'P' ( uniform highp 2-component vector of int) +0:? 'colorSample' ( smooth sample out highp 4-component vector of float) +0:? 'colorfsi' ( flat sample out highp 4-component vector of float) +0:? 'sampInArray' ( smooth sample out 4-element array of highp 3-component vector of float) +0:? 'inv4' ( in highp 4-component vector of float) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + diff --git a/deps/glslang/Test/baseResults/330.frag.out b/deps/glslang/Test/baseResults/330.frag.out new file mode 100644 index 00000000..77456312 --- /dev/null +++ b/deps/glslang/Test/baseResults/330.frag.out @@ -0,0 +1,194 @@ +330.frag +ERROR: 0:27: 'block declaration' : cannot redeclare block: gl_block +ERROR: 0:31: 'gl_name' : identifiers starting with "gl_" are reserved +ERROR: 0:32: 'gl_i' : identifiers starting with "gl_" are reserved +ERROR: 0:35: 'gl_in' : no declaration found for redeclaration +ERROR: 0:39: 'gl_FragCoord' : cannot redeclare a non block as a block +ERROR: 0:44: 'non-literal layout-id value' : not supported for this version or the enabled extensions +ERROR: 0:44: 'layout-id value' : cannot be negative +ERROR: 0:45: 'non-literal layout-id value' : not supported for this version or the enabled extensions +ERROR: 0:46: 'layout-id value' : scalar integer expression required +ERROR: 0:46: 'location' : location is too large +ERROR: 0:47: 'non-literal layout-id value' : not supported for this version or the enabled extensions +ERROR: 0:48: 'non-literal layout-id value' : not supported for this version or the enabled extensions +ERROR: 0:52: 'f2' : cannot use layout qualifiers on structure members +ERROR: 0:57: 'location on block member' : not supported for this version or the enabled extensions +ERROR: 0:62: 'location on block member' : can only use in an in/out block +ERROR: 0:62: 'location qualifier on uniform or buffer' : not supported for this version or the enabled extensions +ERROR: 0:60: 'location qualifier on uniform or buffer' : not supported for this version or the enabled extensions +ERROR: 0:60: 'location' : cannot apply to uniform or buffer block +ERROR: 0:68: 'layout-id value' : cannot be negative +ERROR: 0:69: 'layout-id value' : cannot be negative +ERROR: 0:76: 'f2' : cannot use layout qualifiers on structure members +ERROR: 0:91: 'location on block member' : can only use in an in/out block +ERROR: 0:91: 'location qualifier on uniform or buffer' : not supported for this version or the enabled extensions +ERROR: 0:91: 'location' : overlapping use of location 3 +ERROR: 0:89: 'location qualifier on uniform or buffer' : not supported for this version or the enabled extensions +ERROR: 0:89: 'location' : cannot apply to uniform or buffer block +ERROR: 0:94: 'location' : either the block needs a location, or all members need a location, or no members have a location +ERROR: 0:108: 'A' : cannot use layout qualifiers on structure members +ERROR: 0:119: 'location' : overlapping use of location 44 +ERROR: 0:122: 'index' : can only be used with an explicit location +ERROR: 0:124: 'location' : overlapping use of location 0 +ERROR: 0:125: 'index' : can only be used on an output +ERROR: 0:126: 'index' : can only be used on an output +ERROR: 0:126: 'location/component/index' : cannot declare a default, use a full declaration +ERROR: 0:127: 'location/component/index' : cannot declare a default, use a full declaration +ERROR: 0:128: 'output block' : not supported in this stage: fragment +ERROR: 0:140: 'textureQueryLod' : no matching overloaded function found +ERROR: 0:140: 'assign' : cannot convert from ' const float' to ' temp 2-component vector of float' +ERROR: 0:141: 'textureQueryLod' : no matching overloaded function found +ERROR: 0:141: 'assign' : cannot convert from ' const float' to ' temp 2-component vector of float' +ERROR: 0:152: 'index' : value must be 0 or 1 +ERROR: 41 compilation errors. No code generated. + + +Shader version: 330 +Requested GL_ARB_enhanced_layouts +Requested GL_ARB_separate_shader_objects +ERROR: node is still EOpNull! +0:8 Function Definition: main( ( global void) +0:8 Function Parameters: +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:10 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:10 'varyingVar' ( smooth in 4-component vector of float) +0:11 move second child to first child ( temp 4-component vector of float) +0:11 direct index ( temp 4-component vector of float FragData) +0:11 'gl_FragData' ( fragColor 32-element array of 4-component vector of float FragData) +0:11 Constant: +0:11 1 (const int) +0:11 'inVar' ( smooth in 4-component vector of float) +0:12 Sequence +0:12 move second child to first child ( temp int) +0:12 'buffer' ( temp int) +0:12 Constant: +0:12 4 (const int) +0:21 Function Definition: foo( ( global void) +0:21 Function Parameters: +0:23 Sequence +0:23 Sequence +0:23 move second child to first child ( temp 4-component vector of float) +0:23 'c' ( temp 4-component vector of float) +0:23 gl_Color: direct index for structure ( in 4-component vector of float Color) +0:23 'anon@0' ( in block{ in 4-component vector of float Color gl_Color, }) +0:23 Constant: +0:23 2 (const uint) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 'outVar' (layout( location=0 index=0) out 4-component vector of float) +0:24 'inVar' ( smooth in 4-component vector of float) +0:133 Function Definition: qlod( ( global void) +0:133 Function Parameters: +0:? Sequence +0:140 'lod' ( temp 2-component vector of float) +0:141 'lod' ( temp 2-component vector of float) +0:147 Function Definition: fooKeyMem( ( global void) +0:147 Function Parameters: +0:149 Sequence +0:149 precise: direct index for structure ( global int) +0:149 'KeyMem' ( global structure{ global int precise}) +0:149 Constant: +0:149 0 (const int) +0:? Linker Objects +0:? 'inVar' ( smooth in 4-component vector of float) +0:? 'outVar' (layout( location=0 index=0) out 4-component vector of float) +0:? 'varyingVar' ( smooth in 4-component vector of float) +0:? 'anon@0' ( in block{ in 4-component vector of float Color gl_Color, }) +0:? 'gl_name' ( in block{ in int gl_i}) +0:? 'start' ( const int) +0:? 6 (const int) +0:? 'v1' ( smooth in 4-component vector of float) +0:? 'v2' (layout( location=8) smooth in 4-component vector of float) +0:? 'v20' ( smooth in 4-component vector of float) +0:? 'v21' (layout( location=60) smooth in float) +0:? 'v22' (layout( location=2) smooth in float) +0:? 'anon@1' ( in block{layout( location=1) in float f1, layout( location=3) in float f2}) +0:? 'uinst' (layout( location=1 column_major shared) uniform block{layout( column_major shared) uniform float f1, layout( location=3 column_major shared) uniform float f2}) +0:? 'v3' (layout( location=6) smooth in 4-component vector of float) +0:? 'v4' ( smooth in 4-component vector of float) +0:? 'v5' ( smooth in 4-component vector of float) +0:? 'v6' (layout( location=30) smooth in 4-component vector of float) +0:? 'v23' (layout( location=61) smooth in float) +0:? 'v24' (layout( location=62) smooth in float) +0:? 'ininst2' ( in block{layout( location=28) in bool b1, layout( location=29) in float f1, layout( location=25) in float f2, layout( location=26) in 4-component vector of float f3, layout( location=21) in structure{ global float f1, temp float f2} s2, layout( location=23) in 4-component vector of float f4, layout( location=24) in 4-component vector of float f5}) +0:? 'uinst2' (layout( location=13 column_major shared) uniform block{layout( column_major shared) uniform float f1, layout( location=3 column_major shared) uniform float f2}) +0:? 'in3' ( in block{ in float f1, layout( location=40) in float f2}) +0:? 'in4' ( in block{layout( location=50) in float f1, layout( location=51) in float f2}) +0:? 's' (layout( location=33) smooth in structure{ global 3-component vector of float a, global 2X2 matrix of float b, global 2-element array of 4-component vector of float c, temp 2-component vector of float A}) +0:? 'anon@2' ( in block{layout( location=44) in 4-component vector of float d, layout( location=45) in 4-component vector of float e, layout( location=47) in 4-component vector of float f, layout( location=48) in 4-component vector of float g, layout( location=41) in 4-component vector of float h, layout( location=42) in 4-component vector of float i, layout( location=43) in 4-component vector of float j, layout( location=44) in 4-component vector of float k}) +0:? 'outVar2' (layout( location=4095 index=0) out 4-component vector of float) +0:? 'outVar3' (layout( location=0 index=1) out 4-component vector of float) +0:? 'outVar4' (layout( location=0 index=1) out 4-component vector of float) +0:? 'indexIn' (layout( location=27 index=0) smooth in 4-component vector of float) +0:? 'indexBlockI' (layout( location=26 index=0) out block{ out int a}) +0:? 'samp1D' ( uniform sampler1D) +0:? 'samp2Ds' ( uniform sampler2DShadow) +0:? 'precise' ( global int) +0:? 'KeyMem' ( global structure{ global int precise}) +0:? 'outIndex2' (layout( location=28 index=0) out 4-component vector of float) + + +Linked fragment stage: + +ERROR: Linking fragment stage: Cannot use gl_FragColor or gl_FragData when using user-defined outputs +ERROR: Linking fragment stage: Cannot use both gl_FragColor and gl_FragData + +Shader version: 330 +Requested GL_ARB_enhanced_layouts +Requested GL_ARB_separate_shader_objects +ERROR: node is still EOpNull! +0:8 Function Definition: main( ( global void) +0:8 Function Parameters: +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:10 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:10 'varyingVar' ( smooth in 4-component vector of float) +0:11 move second child to first child ( temp 4-component vector of float) +0:11 direct index ( temp 4-component vector of float FragData) +0:11 'gl_FragData' ( fragColor 32-element array of 4-component vector of float FragData) +0:11 Constant: +0:11 1 (const int) +0:11 'inVar' ( smooth in 4-component vector of float) +0:12 Sequence +0:12 move second child to first child ( temp int) +0:12 'buffer' ( temp int) +0:12 Constant: +0:12 4 (const int) +0:? Linker Objects +0:? 'inVar' ( smooth in 4-component vector of float) +0:? 'outVar' (layout( location=0 index=0) out 4-component vector of float) +0:? 'varyingVar' ( smooth in 4-component vector of float) +0:? 'anon@0' ( in block{ in 4-component vector of float Color gl_Color, }) +0:? 'gl_name' ( in block{ in int gl_i}) +0:? 'start' ( const int) +0:? 6 (const int) +0:? 'v1' ( smooth in 4-component vector of float) +0:? 'v2' (layout( location=8) smooth in 4-component vector of float) +0:? 'v20' ( smooth in 4-component vector of float) +0:? 'v21' (layout( location=60) smooth in float) +0:? 'v22' (layout( location=2) smooth in float) +0:? 'anon@1' ( in block{layout( location=1) in float f1, layout( location=3) in float f2}) +0:? 'uinst' (layout( location=1 column_major shared) uniform block{layout( column_major shared) uniform float f1, layout( location=3 column_major shared) uniform float f2}) +0:? 'v3' (layout( location=6) smooth in 4-component vector of float) +0:? 'v4' ( smooth in 4-component vector of float) +0:? 'v5' ( smooth in 4-component vector of float) +0:? 'v6' (layout( location=30) smooth in 4-component vector of float) +0:? 'v23' (layout( location=61) smooth in float) +0:? 'v24' (layout( location=62) smooth in float) +0:? 'ininst2' ( in block{layout( location=28) in bool b1, layout( location=29) in float f1, layout( location=25) in float f2, layout( location=26) in 4-component vector of float f3, layout( location=21) in structure{ global float f1, temp float f2} s2, layout( location=23) in 4-component vector of float f4, layout( location=24) in 4-component vector of float f5}) +0:? 'uinst2' (layout( location=13 column_major shared) uniform block{layout( column_major shared) uniform float f1, layout( location=3 column_major shared) uniform float f2}) +0:? 'in3' ( in block{ in float f1, layout( location=40) in float f2}) +0:? 'in4' ( in block{layout( location=50) in float f1, layout( location=51) in float f2}) +0:? 's' (layout( location=33) smooth in structure{ global 3-component vector of float a, global 2X2 matrix of float b, global 2-element array of 4-component vector of float c, temp 2-component vector of float A}) +0:? 'anon@2' ( in block{layout( location=44) in 4-component vector of float d, layout( location=45) in 4-component vector of float e, layout( location=47) in 4-component vector of float f, layout( location=48) in 4-component vector of float g, layout( location=41) in 4-component vector of float h, layout( location=42) in 4-component vector of float i, layout( location=43) in 4-component vector of float j, layout( location=44) in 4-component vector of float k}) +0:? 'outVar2' (layout( location=4095 index=0) out 4-component vector of float) +0:? 'outVar3' (layout( location=0 index=1) out 4-component vector of float) +0:? 'outVar4' (layout( location=0 index=1) out 4-component vector of float) +0:? 'indexIn' (layout( location=27 index=0) smooth in 4-component vector of float) +0:? 'indexBlockI' (layout( location=26 index=0) out block{ out int a}) +0:? 'samp1D' ( uniform sampler1D) +0:? 'samp2Ds' ( uniform sampler2DShadow) +0:? 'precise' ( global int) +0:? 'KeyMem' ( global structure{ global int precise}) +0:? 'outIndex2' (layout( location=28 index=0) out 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/330comp.frag.out b/deps/glslang/Test/baseResults/330comp.frag.out new file mode 100644 index 00000000..1b8ded12 --- /dev/null +++ b/deps/glslang/Test/baseResults/330comp.frag.out @@ -0,0 +1,48 @@ +330comp.frag +Shader version: 330 +0:? Sequence +0:8 Function Definition: main( ( global void) +0:8 Function Parameters: +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:10 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:10 'varyingVar' ( smooth in 4-component vector of float) +0:11 move second child to first child ( temp 4-component vector of float) +0:11 direct index ( temp 4-component vector of float FragData) +0:11 'gl_FragData' ( fragColor 32-element array of 4-component vector of float FragData) +0:11 Constant: +0:11 1 (const int) +0:11 vector-times-matrix ( temp 4-component vector of float) +0:11 'inVar' ( smooth in 4-component vector of float) +0:11 'gl_ModelViewMatrix' ( uniform 4X4 matrix of float) +0:? Linker Objects +0:? 'inVar' ( smooth in 4-component vector of float) +0:? 'outVar' ( out 4-component vector of float) +0:? 'varyingVar' ( smooth in 4-component vector of float) + + +Linked fragment stage: + +ERROR: Linking fragment stage: Cannot use both gl_FragColor and gl_FragData + +Shader version: 330 +0:? Sequence +0:8 Function Definition: main( ( global void) +0:8 Function Parameters: +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:10 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:10 'varyingVar' ( smooth in 4-component vector of float) +0:11 move second child to first child ( temp 4-component vector of float) +0:11 direct index ( temp 4-component vector of float FragData) +0:11 'gl_FragData' ( fragColor 32-element array of 4-component vector of float FragData) +0:11 Constant: +0:11 1 (const int) +0:11 vector-times-matrix ( temp 4-component vector of float) +0:11 'inVar' ( smooth in 4-component vector of float) +0:11 'gl_ModelViewMatrix' ( uniform 4X4 matrix of float) +0:? Linker Objects +0:? 'inVar' ( smooth in 4-component vector of float) +0:? 'outVar' ( out 4-component vector of float) +0:? 'varyingVar' ( smooth in 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/400.frag.out b/deps/glslang/Test/baseResults/400.frag.out new file mode 100644 index 00000000..90f73dc7 --- /dev/null +++ b/deps/glslang/Test/baseResults/400.frag.out @@ -0,0 +1,728 @@ +400.frag +ERROR: 0:18: 'textureGatherOffsets(...)' : must be a compile-time constant: offsets argument +ERROR: 0:22: 'textureGatherOffset(...)' : must be a compile-time constant: component argument +ERROR: 0:23: 'textureGatherOffset(...)' : must be 0, 1, 2, or 3: component argument +ERROR: 0:30: 'location qualifier on input' : not supported for this version or the enabled extensions +ERROR: 0:38: 'location qualifier on uniform or buffer' : not supported for this version or the enabled extensions +ERROR: 0:40: 'redeclaration' : cannot apply layout qualifier to gl_Color +ERROR: 0:41: 'redeclaration' : cannot change qualification of gl_ClipDistance +ERROR: 0:43: 'gl_FragCoord' : cannot redeclare after use +ERROR: 0:51: 'texel offset' : argument must be compile-time constant +ERROR: 0:53: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset] +ERROR: 0:53: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset] +ERROR: 0:54: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset] +ERROR: 0:54: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset] +ERROR: 0:57: 'patch' : not supported in this stage: fragment +ERROR: 0:58: 'patch' : not supported in this stage: fragment +ERROR: 0:58: 'centroid/sample/patch' : can't use auxiliary qualifier on a fragment output +ERROR: 0:73: 'dFdxFine' : required extension not requested: GL_ARB_derivative_control +ERROR: 0:74: 'dFdyCoarse' : required extension not requested: GL_ARB_derivative_control +ERROR: 0:75: 'fwidthCoarse' : required extension not requested: GL_ARB_derivative_control +ERROR: 0:75: 'fwidthFine' : required extension not requested: GL_ARB_derivative_control +ERROR: 0:104: 'centroid/sample/patch' : can't use auxiliary qualifier on a fragment output +ERROR: 0:123: 'interpolateAtCentroid' : no matching overloaded function found +ERROR: 0:125: 'interpolateAtCentroid' : first argument must be an interpolant, or interpolant-array element +ERROR: 0:127: 'interpolateAtSample' : no matching overloaded function found +ERROR: 0:132: 'interpolateAtOffset' : no matching overloaded function found +ERROR: 0:134: 'interpolateAtOffset' : first argument must be an interpolant, or interpolant-array element +ERROR: 0:135: 'interpolateAtOffset' : first argument must be an interpolant, or interpolant-array element +ERROR: 0:136: 'interpolateAtOffset' : first argument must be an interpolant, or interpolant-array element +ERROR: 0:139: 'interpolateAtCentroid' : first argument must be an interpolant, or interpolant-array element +ERROR: 0:140: 'interpolateAtSample' : first argument must be an interpolant, or interpolant-array element +ERROR: 0:183: 'textureQueryLod' : no matching overloaded function found +ERROR: 0:183: 'assign' : cannot convert from ' const float' to ' temp 2-component vector of float' +ERROR: 0:184: 'textureQueryLod' : no matching overloaded function found +ERROR: 0:184: 'assign' : cannot convert from ' const float' to ' temp 2-component vector of float' +ERROR: 0:197: 'subroutine' : feature not yet implemented +ERROR: 0:197: '' : default qualifier requires 'uniform', 'buffer', 'in', or 'out' storage qualification +ERROR: 0:198: 'subroutine' : feature not yet implemented +ERROR: 0:199: 'subroutine' : feature not yet implemented +ERROR: 0:201: '' : syntax error, unexpected PRECISE, expecting IDENTIFIER +ERROR: 39 compilation errors. No code generated. + + +Shader version: 400 +Requested GL_ARB_derivative_control +Requested GL_ARB_separate_shader_objects +gl_FragCoord pixel center is integer +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 'v' ( temp 4-component vector of float) +0:13 texture ( global 4-component vector of float) +0:13 indirect index ( temp sampler2D) +0:13 'arrayedSampler' ( uniform 5-element array of sampler2D) +0:13 'i' ( flat in int) +0:13 'c2D' ( smooth in 2-component vector of float) +0:14 move second child to first child ( temp float) +0:14 direct index ( temp float) +0:14 'outp' ( out 4-component vector of float) +0:14 Constant: +0:14 0 (const int) +0:14 direct index ( smooth temp float ClipDistance) +0:14 'gl_ClipDistance' ( smooth in 4-element array of float ClipDistance) +0:14 Constant: +0:14 1 (const int) +0:18 Sequence +0:18 move second child to first child ( temp 4-component vector of uint) +0:18 'uv4' ( temp 4-component vector of uint) +0:18 textureGatherOffsets ( global 4-component vector of uint) +0:18 'samp2dr' ( uniform usampler2DRect) +0:18 'c2D' ( smooth in 2-component vector of float) +0:18 'offsets' ( temp 4-element array of 2-component vector of int) +0:18 Constant: +0:18 2 (const int) +0:19 move second child to first child ( temp 4-component vector of uint) +0:19 'uv4' ( temp 4-component vector of uint) +0:19 textureGatherOffsets ( global 4-component vector of uint) +0:19 'samp2dr' ( uniform usampler2DRect) +0:19 'c2D' ( smooth in 2-component vector of float) +0:19 Constant: +0:19 1 (const int) +0:19 2 (const int) +0:19 3 (const int) +0:19 4 (const int) +0:19 15 (const int) +0:19 16 (const int) +0:19 -2 (const int) +0:19 0 (const int) +0:19 Constant: +0:19 2 (const int) +0:20 Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:20 'v4' ( temp 4-component vector of float) +0:20 textureGather ( global 4-component vector of float) +0:20 direct index ( temp sampler2D) +0:20 'arrayedSampler' ( uniform 5-element array of sampler2D) +0:20 Constant: +0:20 0 (const int) +0:20 'c2D' ( smooth in 2-component vector of float) +0:21 Sequence +0:21 move second child to first child ( temp 4-component vector of int) +0:21 'iv4' ( temp 4-component vector of int) +0:21 textureGatherOffset ( global 4-component vector of int) +0:21 'isamp2DA' ( uniform isampler2DArray) +0:21 Constant: +0:21 0.100000 +0:21 0.100000 +0:21 0.100000 +0:21 Constant: +0:21 1 (const int) +0:21 1 (const int) +0:21 Constant: +0:21 3 (const int) +0:22 move second child to first child ( temp 4-component vector of int) +0:22 'iv4' ( temp 4-component vector of int) +0:22 textureGatherOffset ( global 4-component vector of int) +0:22 'isamp2DA' ( uniform isampler2DArray) +0:22 Constant: +0:22 0.100000 +0:22 0.100000 +0:22 0.100000 +0:22 Constant: +0:22 1 (const int) +0:22 1 (const int) +0:22 'i' ( flat in int) +0:23 move second child to first child ( temp 4-component vector of int) +0:23 'iv4' ( temp 4-component vector of int) +0:23 textureGatherOffset ( global 4-component vector of int) +0:23 'isamp2DA' ( uniform isampler2DArray) +0:23 Constant: +0:23 0.100000 +0:23 0.100000 +0:23 0.100000 +0:23 Constant: +0:23 1 (const int) +0:23 1 (const int) +0:23 Constant: +0:23 4 (const int) +0:24 move second child to first child ( temp 4-component vector of int) +0:24 'iv4' ( temp 4-component vector of int) +0:24 textureGatherOffset ( global 4-component vector of int) +0:24 'isamp2DA' ( uniform isampler2DArray) +0:24 Constant: +0:24 0.100000 +0:24 0.100000 +0:24 0.100000 +0:24 Constant: +0:24 1 (const int) +0:24 1 (const int) +0:24 Constant: +0:24 3 (const int) +0:25 move second child to first child ( temp 4-component vector of int) +0:25 'iv4' ( temp 4-component vector of int) +0:25 textureGatherOffset ( global 4-component vector of int) +0:25 'isamp2DA' ( uniform isampler2DArray) +0:25 Constant: +0:25 0.100000 +0:25 0.100000 +0:25 0.100000 +0:25 Construct ivec2 ( temp 2-component vector of int) +0:25 'i' ( flat in int) +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'c' ( temp 4-component vector of float) +0:27 'gl_FragCoord' ( gl_FragCoord 4-component vector of float FragCoord) +0:47 Function Definition: foo23( ( global void) +0:47 Function Parameters: +0:? Sequence +0:51 textureProjGradOffset ( global float) +0:51 'u2drs' ( uniform sampler2DRectShadow) +0:51 'outp' ( out 4-component vector of float) +0:51 Constant: +0:51 0.000000 +0:51 0.000000 +0:51 Constant: +0:51 0.000000 +0:51 0.000000 +0:51 Convert float to int ( temp 2-component vector of int) +0:51 'c2D' ( smooth in 2-component vector of float) +0:52 textureProjGradOffset ( global float) +0:52 'u2drs' ( uniform sampler2DRectShadow) +0:52 'outp' ( out 4-component vector of float) +0:52 Constant: +0:52 0.000000 +0:52 0.000000 +0:52 Constant: +0:52 0.000000 +0:52 0.000000 +0:52 Constant: +0:52 3 (const int) +0:52 4 (const int) +0:53 textureProjGradOffset ( global float) +0:53 'u2drs' ( uniform sampler2DRectShadow) +0:53 'outp' ( out 4-component vector of float) +0:53 Constant: +0:53 0.000000 +0:53 0.000000 +0:53 Constant: +0:53 0.000000 +0:53 0.000000 +0:53 Constant: +0:53 15 (const int) +0:53 16 (const int) +0:54 textureProjGradOffset ( global float) +0:54 'u2drs' ( uniform sampler2DRectShadow) +0:54 'outp' ( out 4-component vector of float) +0:54 Constant: +0:54 0.000000 +0:54 0.000000 +0:54 Constant: +0:54 0.000000 +0:54 0.000000 +0:54 Constant: +0:54 -10 (const int) +0:54 20 (const int) +0:60 Function Definition: foo24( ( global void) +0:60 Function Parameters: +0:? Sequence +0:63 move second child to first child ( temp 3-component vector of double) +0:63 'df' ( temp 3-component vector of double) +0:63 modf ( global 3-component vector of double) +0:63 Convert float to double ( temp 3-component vector of double) +0:63 vector swizzle ( temp 3-component vector of float) +0:63 'outp' ( out 4-component vector of float) +0:63 Sequence +0:63 Constant: +0:63 0 (const int) +0:63 Constant: +0:63 1 (const int) +0:63 Constant: +0:63 2 (const int) +0:63 'di' ( temp 3-component vector of double) +0:71 Function Definition: foodc1( ( global void) +0:71 Function Parameters: +0:73 Sequence +0:73 Sequence +0:73 move second child to first child ( temp 2-component vector of float) +0:73 'v2' ( temp 2-component vector of float) +0:73 dPdxFine ( global 2-component vector of float) +0:73 'in2' ( smooth in 2-component vector of float) +0:74 Sequence +0:74 move second child to first child ( temp 3-component vector of float) +0:74 'v3' ( temp 3-component vector of float) +0:74 dPdyCoarse ( global 3-component vector of float) +0:74 'in3' ( smooth in 3-component vector of float) +0:75 Sequence +0:75 move second child to first child ( temp 4-component vector of float) +0:75 'v4' ( temp 4-component vector of float) +0:75 add ( temp 4-component vector of float) +0:75 fwidthCoarse ( global 4-component vector of float) +0:75 'in4' ( smooth in 4-component vector of float) +0:75 fwidthFine ( global 4-component vector of float) +0:75 'in4' ( smooth in 4-component vector of float) +0:80 Function Definition: foodc2( ( global void) +0:80 Function Parameters: +0:82 Sequence +0:82 Sequence +0:82 move second child to first child ( temp 2-component vector of float) +0:82 'v2' ( temp 2-component vector of float) +0:82 dPdxFine ( global 2-component vector of float) +0:82 'in2' ( smooth in 2-component vector of float) +0:83 Sequence +0:83 move second child to first child ( temp 3-component vector of float) +0:83 'v3' ( temp 3-component vector of float) +0:83 dPdyCoarse ( global 3-component vector of float) +0:83 'in3' ( smooth in 3-component vector of float) +0:84 Sequence +0:84 move second child to first child ( temp 4-component vector of float) +0:84 'v4' ( temp 4-component vector of float) +0:84 add ( temp 4-component vector of float) +0:84 fwidthCoarse ( global 4-component vector of float) +0:84 'in4' ( smooth in 4-component vector of float) +0:84 fwidthFine ( global 4-component vector of float) +0:84 'in4' ( smooth in 4-component vector of float) +0:89 move second child to first child ( temp 2-component vector of float) +0:89 'v2' ( temp 2-component vector of float) +0:89 frexp ( global 2-component vector of float) +0:89 'v2' ( temp 2-component vector of float) +0:89 'i2' ( temp 2-component vector of int) +0:90 move second child to first child ( temp 3-component vector of float) +0:90 'v3' ( temp 3-component vector of float) +0:90 ldexp ( global 3-component vector of float) +0:90 'v3' ( temp 3-component vector of float) +0:90 'i3' ( temp 3-component vector of int) +0:92 move second child to first child ( temp uint) +0:92 'u1' ( temp uint) +0:92 PackUnorm4x8 ( global uint) +0:92 'v4' ( temp 4-component vector of float) +0:93 move second child to first child ( temp uint) +0:93 'u1' ( temp uint) +0:93 PackSnorm4x8 ( global uint) +0:93 'v4' ( temp 4-component vector of float) +0:94 move second child to first child ( temp 4-component vector of float) +0:94 'v4' ( temp 4-component vector of float) +0:94 UnpackUnorm4x8 ( global 4-component vector of float) +0:94 'u1' ( temp uint) +0:95 move second child to first child ( temp 4-component vector of float) +0:95 'v4' ( temp 4-component vector of float) +0:95 UnpackSnorm4x8 ( global 4-component vector of float) +0:95 'u1' ( temp uint) +0:99 move second child to first child ( temp double) +0:99 'd' ( temp double) +0:99 PackDouble2x32 ( global double) +0:99 'u2' ( temp 2-component vector of uint) +0:100 move second child to first child ( temp 2-component vector of uint) +0:100 'u2' ( temp 2-component vector of uint) +0:100 UnpackDouble2x32 ( global 2-component vector of uint) +0:100 'd' ( temp double) +0:117 Function Definition: interp( ( global void) +0:117 Function Parameters: +0:119 Sequence +0:119 interpolateAtCentroid ( global 2-component vector of float) +0:119 'colorfc' ( centroid flat in 2-component vector of float) +0:120 interpolateAtCentroid ( global 4-component vector of float) +0:120 'colorSampIn' ( smooth sample in 4-component vector of float) +0:121 interpolateAtCentroid ( global 4-component vector of float) +0:121 'colorfsi' ( noperspective in 4-component vector of float) +0:122 interpolateAtCentroid ( global float) +0:122 'scalarIn' ( smooth in float) +0:123 Constant: +0:123 0.000000 +0:124 interpolateAtCentroid ( global 3-component vector of float) +0:124 direct index ( smooth sample temp 3-component vector of float) +0:124 'sampInArray' ( smooth sample in 4-element array of 3-component vector of float) +0:124 Constant: +0:124 2 (const int) +0:125 interpolateAtCentroid ( global 2-component vector of float) +0:125 vector swizzle ( temp 2-component vector of float) +0:125 direct index ( smooth sample temp 3-component vector of float) +0:125 'sampInArray' ( smooth sample in 4-element array of 3-component vector of float) +0:125 Constant: +0:125 2 (const int) +0:125 Sequence +0:125 Constant: +0:125 0 (const int) +0:125 Constant: +0:125 1 (const int) +0:127 Constant: +0:127 0.000000 +0:128 interpolateAtSample ( global 3-component vector of float) +0:128 indirect index ( smooth sample temp 3-component vector of float) +0:128 'sampInArray' ( smooth sample in 4-element array of 3-component vector of float) +0:128 'i' ( flat in int) +0:128 Constant: +0:128 0 (const int) +0:129 interpolateAtSample ( global float) +0:129 x: direct index for structure ( global float) +0:129 's1' ( smooth in structure{ global float x}) +0:129 Constant: +0:129 0 (const int) +0:129 Constant: +0:129 2 (const int) +0:130 interpolateAtSample ( global float) +0:130 'scalarIn' ( smooth in float) +0:130 Constant: +0:130 1 (const int) +0:132 Constant: +0:132 0.000000 +0:133 interpolateAtOffset ( global 3-component vector of float) +0:133 direct index ( smooth sample temp 3-component vector of float) +0:133 'sampInArray' ( smooth sample in 4-element array of 3-component vector of float) +0:133 Constant: +0:133 2 (const int) +0:133 Constant: +0:133 0.200000 +0:133 0.200000 +0:134 interpolateAtOffset ( global 2-component vector of float) +0:134 vector swizzle ( temp 2-component vector of float) +0:134 direct index ( smooth sample temp 3-component vector of float) +0:134 'sampInArray' ( smooth sample in 4-element array of 3-component vector of float) +0:134 Constant: +0:134 2 (const int) +0:134 Sequence +0:134 Constant: +0:134 0 (const int) +0:134 Constant: +0:134 1 (const int) +0:134 Constant: +0:134 0.200000 +0:134 0.200000 +0:135 interpolateAtOffset ( global float) +0:135 add ( temp float) +0:135 'scalarIn' ( smooth in float) +0:135 'scalarIn' ( smooth in float) +0:135 Constant: +0:135 0.200000 +0:135 0.200000 +0:136 interpolateAtOffset ( global float) +0:136 x: direct index for structure ( global float) +0:136 's2' ( sample temp structure{ global float x}) +0:136 Constant: +0:136 0 (const int) +0:136 Constant: +0:136 0.200000 +0:136 0.200000 +0:139 interpolateAtCentroid ( global float) +0:139 'f' ( temp float) +0:140 interpolateAtSample ( global 4-component vector of float) +0:140 'outp' ( out 4-component vector of float) +0:140 Constant: +0:140 0 (const int) +0:161 Function Definition: qlod( ( global void) +0:161 Function Parameters: +0:? Sequence +0:168 move second child to first child ( temp 2-component vector of float) +0:168 'lod' ( temp 2-component vector of float) +0:168 textureQueryLod ( global 2-component vector of float) +0:168 'samp1D' ( uniform sampler1D) +0:168 'pf' ( temp float) +0:169 move second child to first child ( temp 2-component vector of float) +0:169 'lod' ( temp 2-component vector of float) +0:169 textureQueryLod ( global 2-component vector of float) +0:169 'isamp2D' ( uniform isampler2D) +0:169 'pf2' ( temp 2-component vector of float) +0:170 move second child to first child ( temp 2-component vector of float) +0:170 'lod' ( temp 2-component vector of float) +0:170 textureQueryLod ( global 2-component vector of float) +0:170 'usamp3D' ( uniform usampler3D) +0:170 'pf3' ( temp 3-component vector of float) +0:171 move second child to first child ( temp 2-component vector of float) +0:171 'lod' ( temp 2-component vector of float) +0:171 textureQueryLod ( global 2-component vector of float) +0:171 'sampCube' ( uniform samplerCube) +0:171 'pf3' ( temp 3-component vector of float) +0:172 move second child to first child ( temp 2-component vector of float) +0:172 'lod' ( temp 2-component vector of float) +0:172 textureQueryLod ( global 2-component vector of float) +0:172 'isamp1DA' ( uniform isampler1DArray) +0:172 'pf' ( temp float) +0:173 move second child to first child ( temp 2-component vector of float) +0:173 'lod' ( temp 2-component vector of float) +0:173 textureQueryLod ( global 2-component vector of float) +0:173 'usamp2DA' ( uniform usampler2DArray) +0:173 'pf2' ( temp 2-component vector of float) +0:174 move second child to first child ( temp 2-component vector of float) +0:174 'lod' ( temp 2-component vector of float) +0:174 textureQueryLod ( global 2-component vector of float) +0:174 'isampCubeA' ( uniform isamplerCubeArray) +0:174 'pf3' ( temp 3-component vector of float) +0:176 move second child to first child ( temp 2-component vector of float) +0:176 'lod' ( temp 2-component vector of float) +0:176 textureQueryLod ( global 2-component vector of float) +0:176 'samp1Ds' ( uniform sampler1DShadow) +0:176 'pf' ( temp float) +0:177 move second child to first child ( temp 2-component vector of float) +0:177 'lod' ( temp 2-component vector of float) +0:177 textureQueryLod ( global 2-component vector of float) +0:177 'samp2Ds' ( uniform sampler2DShadow) +0:177 'pf2' ( temp 2-component vector of float) +0:178 move second child to first child ( temp 2-component vector of float) +0:178 'lod' ( temp 2-component vector of float) +0:178 textureQueryLod ( global 2-component vector of float) +0:178 'sampCubes' ( uniform samplerCubeShadow) +0:178 'pf3' ( temp 3-component vector of float) +0:179 move second child to first child ( temp 2-component vector of float) +0:179 'lod' ( temp 2-component vector of float) +0:179 textureQueryLod ( global 2-component vector of float) +0:179 'samp1DAs' ( uniform sampler1DArrayShadow) +0:179 'pf' ( temp float) +0:180 move second child to first child ( temp 2-component vector of float) +0:180 'lod' ( temp 2-component vector of float) +0:180 textureQueryLod ( global 2-component vector of float) +0:180 'samp2DAs' ( uniform sampler2DArrayShadow) +0:180 'pf2' ( temp 2-component vector of float) +0:181 move second child to first child ( temp 2-component vector of float) +0:181 'lod' ( temp 2-component vector of float) +0:181 textureQueryLod ( global 2-component vector of float) +0:181 'sampCubeAs' ( uniform samplerCubeArrayShadow) +0:181 'pf3' ( temp 3-component vector of float) +0:183 'lod' ( temp 2-component vector of float) +0:184 'lod' ( temp 2-component vector of float) +0:190 Function Definition: bitwiseConv( ( global void) +0:190 Function Parameters: +0:192 Sequence +0:192 move second child to first child ( temp uint) +0:192 'iout' ( out uint) +0:192 bitwise and ( temp uint) +0:192 'uu' ( uniform uint) +0:192 Convert int to uint ( temp uint) +0:192 'i' ( flat in int) +0:193 add second child into first child ( temp uint) +0:193 'iout' ( out uint) +0:193 exclusive-or ( temp uint) +0:193 'uu' ( uniform uint) +0:193 Convert int to uint ( temp uint) +0:193 'i' ( flat in int) +0:194 add second child into first child ( temp uint) +0:194 'iout' ( out uint) +0:194 inclusive-or ( temp uint) +0:194 Convert int to uint ( temp uint) +0:194 'i' ( flat in int) +0:194 'uu' ( uniform uint) +0:198 Function Definition: subT1( ( temp float) +0:198 Function Parameters: +0:198 Sequence +0:198 Branch: Return with expression +0:198 Constant: +0:198 1.000000 +0:199 Function Definition: subT2( ( temp float) +0:199 Function Parameters: +0:199 Sequence +0:199 Branch: Return with expression +0:199 Constant: +0:199 1.000000 +0:? Linker Objects +0:? 'c2D' ( smooth in 2-component vector of float) +0:? 'i' ( flat in int) +0:? 'outp' ( out 4-component vector of float) +0:? 'arrayedSampler' ( uniform 5-element array of sampler2D) +0:? 'samp2dr' ( uniform usampler2DRect) +0:? 'isamp2DA' ( uniform isampler2DArray) +0:? 'gl_ClipDistance' ( smooth in 4-element array of float ClipDistance) +0:? 'vl' (layout( location=4) smooth in 4-component vector of float) +0:? 'vl2' (layout( location=6) smooth in 4-component vector of float) +0:? 'uv3' (layout( location=3) uniform 3-component vector of float) +0:? 'anon@0' ( in block{ in float FogFragCoord gl_FogFragCoord, in unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, smooth in 4-component vector of float Color gl_Color, in 4-component vector of float SecondaryColor gl_SecondaryColor}) +0:? 'gl_FragCoord' ( gl_FragCoord 4-component vector of float FragCoord) +0:? 'u2drs' ( uniform sampler2DRectShadow) +0:? 'patchIn' ( smooth patch in 4-component vector of float) +0:? 'patchOut' ( patch out 4-component vector of float) +0:? 'in1' ( smooth in float) +0:? 'in2' ( smooth in 2-component vector of float) +0:? 'in3' ( smooth in 3-component vector of float) +0:? 'in4' ( smooth in 4-component vector of float) +0:? 'colorSampIn' ( smooth sample in 4-component vector of float) +0:? 'colorSampleBad' ( sample out 4-component vector of float) +0:? 'colorfsi' ( noperspective in 4-component vector of float) +0:? 'sampInArray' ( smooth sample in 4-element array of 3-component vector of float) +0:? 'scalarIn' ( smooth in float) +0:? 'colorfc' ( centroid flat in 2-component vector of float) +0:? 's1' ( smooth in structure{ global float x}) +0:? 's2' ( sample temp structure{ global float x}) +0:? 'samp1D' ( uniform sampler1D) +0:? 'isamp2D' ( uniform isampler2D) +0:? 'usamp3D' ( uniform usampler3D) +0:? 'sampCube' ( uniform samplerCube) +0:? 'isamp1DA' ( uniform isampler1DArray) +0:? 'usamp2DA' ( uniform usampler2DArray) +0:? 'isampCubeA' ( uniform isamplerCubeArray) +0:? 'samp1Ds' ( uniform sampler1DShadow) +0:? 'samp2Ds' ( uniform sampler2DShadow) +0:? 'sampCubes' ( uniform samplerCubeShadow) +0:? 'samp1DAs' ( uniform sampler1DArrayShadow) +0:? 'samp2DAs' ( uniform sampler2DArrayShadow) +0:? 'sampCubeAs' ( uniform samplerCubeArrayShadow) +0:? 'sampBuf' ( uniform samplerBuffer) +0:? 'sampRect' ( uniform sampler2DRect) +0:? 'uu' ( uniform uint) +0:? 'iout' ( out uint) + + +Linked fragment stage: + + +Shader version: 400 +Requested GL_ARB_derivative_control +Requested GL_ARB_separate_shader_objects +gl_FragCoord pixel center is integer +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 'v' ( temp 4-component vector of float) +0:13 texture ( global 4-component vector of float) +0:13 indirect index ( temp sampler2D) +0:13 'arrayedSampler' ( uniform 5-element array of sampler2D) +0:13 'i' ( flat in int) +0:13 'c2D' ( smooth in 2-component vector of float) +0:14 move second child to first child ( temp float) +0:14 direct index ( temp float) +0:14 'outp' ( out 4-component vector of float) +0:14 Constant: +0:14 0 (const int) +0:14 direct index ( smooth temp float ClipDistance) +0:14 'gl_ClipDistance' ( smooth in 4-element array of float ClipDistance) +0:14 Constant: +0:14 1 (const int) +0:18 Sequence +0:18 move second child to first child ( temp 4-component vector of uint) +0:18 'uv4' ( temp 4-component vector of uint) +0:18 textureGatherOffsets ( global 4-component vector of uint) +0:18 'samp2dr' ( uniform usampler2DRect) +0:18 'c2D' ( smooth in 2-component vector of float) +0:18 'offsets' ( temp 4-element array of 2-component vector of int) +0:18 Constant: +0:18 2 (const int) +0:19 move second child to first child ( temp 4-component vector of uint) +0:19 'uv4' ( temp 4-component vector of uint) +0:19 textureGatherOffsets ( global 4-component vector of uint) +0:19 'samp2dr' ( uniform usampler2DRect) +0:19 'c2D' ( smooth in 2-component vector of float) +0:19 Constant: +0:19 1 (const int) +0:19 2 (const int) +0:19 3 (const int) +0:19 4 (const int) +0:19 15 (const int) +0:19 16 (const int) +0:19 -2 (const int) +0:19 0 (const int) +0:19 Constant: +0:19 2 (const int) +0:20 Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:20 'v4' ( temp 4-component vector of float) +0:20 textureGather ( global 4-component vector of float) +0:20 direct index ( temp sampler2D) +0:20 'arrayedSampler' ( uniform 5-element array of sampler2D) +0:20 Constant: +0:20 0 (const int) +0:20 'c2D' ( smooth in 2-component vector of float) +0:21 Sequence +0:21 move second child to first child ( temp 4-component vector of int) +0:21 'iv4' ( temp 4-component vector of int) +0:21 textureGatherOffset ( global 4-component vector of int) +0:21 'isamp2DA' ( uniform isampler2DArray) +0:21 Constant: +0:21 0.100000 +0:21 0.100000 +0:21 0.100000 +0:21 Constant: +0:21 1 (const int) +0:21 1 (const int) +0:21 Constant: +0:21 3 (const int) +0:22 move second child to first child ( temp 4-component vector of int) +0:22 'iv4' ( temp 4-component vector of int) +0:22 textureGatherOffset ( global 4-component vector of int) +0:22 'isamp2DA' ( uniform isampler2DArray) +0:22 Constant: +0:22 0.100000 +0:22 0.100000 +0:22 0.100000 +0:22 Constant: +0:22 1 (const int) +0:22 1 (const int) +0:22 'i' ( flat in int) +0:23 move second child to first child ( temp 4-component vector of int) +0:23 'iv4' ( temp 4-component vector of int) +0:23 textureGatherOffset ( global 4-component vector of int) +0:23 'isamp2DA' ( uniform isampler2DArray) +0:23 Constant: +0:23 0.100000 +0:23 0.100000 +0:23 0.100000 +0:23 Constant: +0:23 1 (const int) +0:23 1 (const int) +0:23 Constant: +0:23 4 (const int) +0:24 move second child to first child ( temp 4-component vector of int) +0:24 'iv4' ( temp 4-component vector of int) +0:24 textureGatherOffset ( global 4-component vector of int) +0:24 'isamp2DA' ( uniform isampler2DArray) +0:24 Constant: +0:24 0.100000 +0:24 0.100000 +0:24 0.100000 +0:24 Constant: +0:24 1 (const int) +0:24 1 (const int) +0:24 Constant: +0:24 3 (const int) +0:25 move second child to first child ( temp 4-component vector of int) +0:25 'iv4' ( temp 4-component vector of int) +0:25 textureGatherOffset ( global 4-component vector of int) +0:25 'isamp2DA' ( uniform isampler2DArray) +0:25 Constant: +0:25 0.100000 +0:25 0.100000 +0:25 0.100000 +0:25 Construct ivec2 ( temp 2-component vector of int) +0:25 'i' ( flat in int) +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'c' ( temp 4-component vector of float) +0:27 'gl_FragCoord' ( gl_FragCoord 4-component vector of float FragCoord) +0:? Linker Objects +0:? 'c2D' ( smooth in 2-component vector of float) +0:? 'i' ( flat in int) +0:? 'outp' ( out 4-component vector of float) +0:? 'arrayedSampler' ( uniform 5-element array of sampler2D) +0:? 'samp2dr' ( uniform usampler2DRect) +0:? 'isamp2DA' ( uniform isampler2DArray) +0:? 'gl_ClipDistance' ( smooth in 4-element array of float ClipDistance) +0:? 'vl' (layout( location=4) smooth in 4-component vector of float) +0:? 'vl2' (layout( location=6) smooth in 4-component vector of float) +0:? 'uv3' (layout( location=3) uniform 3-component vector of float) +0:? 'anon@0' ( in block{ in float FogFragCoord gl_FogFragCoord, in 1-element array of 4-component vector of float TexCoord gl_TexCoord, smooth in 4-component vector of float Color gl_Color, in 4-component vector of float SecondaryColor gl_SecondaryColor}) +0:? 'gl_FragCoord' ( gl_FragCoord 4-component vector of float FragCoord) +0:? 'u2drs' ( uniform sampler2DRectShadow) +0:? 'patchIn' ( smooth patch in 4-component vector of float) +0:? 'patchOut' ( patch out 4-component vector of float) +0:? 'in1' ( smooth in float) +0:? 'in2' ( smooth in 2-component vector of float) +0:? 'in3' ( smooth in 3-component vector of float) +0:? 'in4' ( smooth in 4-component vector of float) +0:? 'colorSampIn' ( smooth sample in 4-component vector of float) +0:? 'colorSampleBad' ( sample out 4-component vector of float) +0:? 'colorfsi' ( noperspective in 4-component vector of float) +0:? 'sampInArray' ( smooth sample in 4-element array of 3-component vector of float) +0:? 'scalarIn' ( smooth in float) +0:? 'colorfc' ( centroid flat in 2-component vector of float) +0:? 's1' ( smooth in structure{ global float x}) +0:? 's2' ( sample temp structure{ global float x}) +0:? 'samp1D' ( uniform sampler1D) +0:? 'isamp2D' ( uniform isampler2D) +0:? 'usamp3D' ( uniform usampler3D) +0:? 'sampCube' ( uniform samplerCube) +0:? 'isamp1DA' ( uniform isampler1DArray) +0:? 'usamp2DA' ( uniform usampler2DArray) +0:? 'isampCubeA' ( uniform isamplerCubeArray) +0:? 'samp1Ds' ( uniform sampler1DShadow) +0:? 'samp2Ds' ( uniform sampler2DShadow) +0:? 'sampCubes' ( uniform samplerCubeShadow) +0:? 'samp1DAs' ( uniform sampler1DArrayShadow) +0:? 'samp2DAs' ( uniform sampler2DArrayShadow) +0:? 'sampCubeAs' ( uniform samplerCubeArrayShadow) +0:? 'sampBuf' ( uniform samplerBuffer) +0:? 'sampRect' ( uniform sampler2DRect) +0:? 'uu' ( uniform uint) +0:? 'iout' ( out uint) + diff --git a/deps/glslang/Test/baseResults/400.geom.out b/deps/glslang/Test/baseResults/400.geom.out new file mode 100644 index 00000000..52ebebce --- /dev/null +++ b/deps/glslang/Test/baseResults/400.geom.out @@ -0,0 +1,1091 @@ +400.geom +ERROR: 0:12: 'invocations' : can only apply to a standalone qualifier +ERROR: 0:20: 'patch' : not supported in this stage: geometry +ERROR: 0:20: 'gl_PointSize' : cannot add non-XFB layout to redeclared block member +ERROR: 0:20: 'gl_PointSize' : cannot add patch to redeclared block member +ERROR: 0:25: 'length' : array must first be sized by a redeclaration or layout qualifier +ERROR: 0:36: 'length' : array must first be sized by a redeclaration or layout qualifier +ERROR: 0:40: 'triangles' : inconsistent input primitive for array size of colorBad +ERROR: 0:44: 'triangles' : inconsistent input primitive for array size of colorbad2 +ERROR: 0:56: 'location' : overlapping use of location 4 +ERROR: 0:58: 'patch' : not supported in this stage: geometry +ERROR: 0:59: 'patch' : not supported in this stage: geometry +ERROR: 0:61: 'in' : type must be an array: scalar +ERROR: 0:63: 'invocations' : can only apply to 'in' +ERROR: 0:64: 'max_vertices' : can only apply to 'out' +ERROR: 0:65: 'max_vertices' : can only apply to 'out' +ERROR: 0:65: 'invocations' : can only apply to 'in' +ERROR: 0:67: 'in' : type must be an array: inbls +ERROR: 0:71: 'triangles' : inconsistent input primitive for array size of inbla +ERROR: 0:103: 'index' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:115: 'textureQueryLod' : no matching overloaded function found +ERROR: 0:115: 'assign' : cannot convert from ' const float' to ' temp 2-component vector of float' +ERROR: 0:116: 'textureQueryLod' : no matching overloaded function found +ERROR: 0:116: 'assign' : cannot convert from ' const float' to ' temp 2-component vector of float' +ERROR: 23 compilation errors. No code generated. + + +Shader version: 400 +Requested GL_ARB_separate_shader_objects +invocations = 4 +max_vertices = 127 +input primitive = triangles +output primitive = none +ERROR: node is still EOpNull! +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:5 Sequence +0:5 EmitStreamVertex ( global void) +0:5 Constant: +0:5 1 (const int) +0:6 EndStreamPrimitive ( global void) +0:6 Constant: +0:6 0 (const int) +0:7 EmitVertex ( global void) +0:8 EndPrimitive ( global void) +0:9 Sequence +0:9 move second child to first child ( temp int) +0:9 'id' ( temp int) +0:9 'gl_InvocationID' ( in int InvocationID) +0:23 Function Definition: foo( ( global void) +0:23 Function Parameters: +0:25 Sequence +0:25 Constant: +0:25 1 (const int) +0:26 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:26 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize}) +0:26 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize}) +0:26 Constant: +0:26 1 (const int) +0:26 Constant: +0:26 0 (const int) +0:34 Function Definition: foo2( ( global void) +0:34 Function Parameters: +0:36 Sequence +0:36 Constant: +0:36 1 (const int) +0:37 Constant: +0:37 3 (const int) +0:46 Function Definition: foo3( ( global void) +0:46 Function Parameters: +0:48 Sequence +0:48 Constant: +0:48 3 (const int) +0:49 Constant: +0:49 3 (const int) +0:50 Constant: +0:50 3 (const int) +0:51 Constant: +0:51 3 (const int) +0:75 Function Definition: bits( ( global void) +0:75 Function Parameters: +0:? Sequence +0:78 move second child to first child ( temp 2-component vector of uint) +0:78 'u2' ( temp 2-component vector of uint) +0:78 addCarry ( global 2-component vector of uint) +0:78 'u2' ( temp 2-component vector of uint) +0:78 'u2' ( temp 2-component vector of uint) +0:78 'u2' ( temp 2-component vector of uint) +0:80 move second child to first child ( temp uint) +0:80 'u1' ( temp uint) +0:80 subBorrow ( global uint) +0:80 'u1' ( temp uint) +0:80 'u1' ( temp uint) +0:80 'u1' ( temp uint) +0:82 uMulExtended ( global void) +0:82 'u4' ( temp 4-component vector of uint) +0:82 'u4' ( temp 4-component vector of uint) +0:82 'u4' ( temp 4-component vector of uint) +0:82 'u4' ( temp 4-component vector of uint) +0:84 iMulExtended ( global void) +0:84 'i4' ( temp 4-component vector of int) +0:84 'i4' ( temp 4-component vector of int) +0:84 'i4' ( temp 4-component vector of int) +0:84 'i4' ( temp 4-component vector of int) +0:86 move second child to first child ( temp int) +0:86 'i1' ( temp int) +0:86 bitfieldExtract ( global int) +0:86 'i1' ( temp int) +0:86 Constant: +0:86 4 (const int) +0:86 Constant: +0:86 5 (const int) +0:88 move second child to first child ( temp 3-component vector of uint) +0:88 'u3' ( temp 3-component vector of uint) +0:88 bitfieldExtract ( global 3-component vector of uint) +0:88 'u3' ( temp 3-component vector of uint) +0:88 Constant: +0:88 4 (const int) +0:88 Constant: +0:88 5 (const int) +0:90 move second child to first child ( temp 3-component vector of int) +0:90 'i3' ( temp 3-component vector of int) +0:90 bitfieldInsert ( global 3-component vector of int) +0:90 'i3' ( temp 3-component vector of int) +0:90 'i3' ( temp 3-component vector of int) +0:90 Constant: +0:90 4 (const int) +0:90 Constant: +0:90 5 (const int) +0:91 move second child to first child ( temp uint) +0:91 'u1' ( temp uint) +0:91 bitfieldInsert ( global uint) +0:91 'u1' ( temp uint) +0:91 'u1' ( temp uint) +0:91 Constant: +0:91 4 (const int) +0:91 Constant: +0:91 5 (const int) +0:93 move second child to first child ( temp 2-component vector of int) +0:93 'i2' ( temp 2-component vector of int) +0:93 bitFieldReverse ( global 2-component vector of int) +0:93 'i2' ( temp 2-component vector of int) +0:94 move second child to first child ( temp 4-component vector of uint) +0:94 'u4' ( temp 4-component vector of uint) +0:94 bitFieldReverse ( global 4-component vector of uint) +0:94 'u4' ( temp 4-component vector of uint) +0:95 move second child to first child ( temp int) +0:95 'i1' ( temp int) +0:95 bitCount ( global int) +0:95 'i1' ( temp int) +0:96 move second child to first child ( temp 3-component vector of int) +0:96 'i3' ( temp 3-component vector of int) +0:96 bitCount ( global 3-component vector of int) +0:96 'u3' ( temp 3-component vector of uint) +0:97 move second child to first child ( temp 2-component vector of int) +0:97 'i2' ( temp 2-component vector of int) +0:97 findLSB ( global 2-component vector of int) +0:97 'i2' ( temp 2-component vector of int) +0:98 move second child to first child ( temp 4-component vector of int) +0:98 'i4' ( temp 4-component vector of int) +0:98 findLSB ( global 4-component vector of int) +0:98 'u4' ( temp 4-component vector of uint) +0:99 move second child to first child ( temp int) +0:99 'i1' ( temp int) +0:99 findMSB ( global int) +0:99 'i1' ( temp int) +0:100 move second child to first child ( temp 2-component vector of int) +0:100 'i2' ( temp 2-component vector of int) +0:100 findMSB ( global 2-component vector of int) +0:100 'u2' ( temp 2-component vector of uint) +0:108 Function Definition: qlod( ( global void) +0:108 Function Parameters: +0:? Sequence +0:115 'lod' ( temp 2-component vector of float) +0:116 'lod' ( temp 2-component vector of float) +0:119 Function Definition: doubles( ( global void) +0:119 Function Parameters: +0:? Sequence +0:131 move second child to first child ( temp double) +0:131 'doublev' ( temp double) +0:131 Constant: +0:131 1.702939 +0:132 move second child to first child ( temp 2-component vector of double) +0:132 'dvec2v' ( temp 2-component vector of double) +0:132 Constant: +0:132 1.643168 +0:132 1.643168 +0:133 move second child to first child ( temp 3-component vector of double) +0:133 'dvec3v' ( temp 3-component vector of double) +0:133 Constant: +0:133 1.414214 +0:133 1.414214 +0:133 1.414214 +0:134 move second child to first child ( temp 4-component vector of double) +0:134 'dvec4v' ( temp 4-component vector of double) +0:134 Constant: +0:134 1.449138 +0:134 1.449138 +0:134 1.449138 +0:134 1.449138 +0:136 add second child into first child ( temp double) +0:136 'doublev' ( temp double) +0:136 inverse sqrt ( global double) +0:136 'doublev' ( temp double) +0:137 add second child into first child ( temp 2-component vector of double) +0:137 'dvec2v' ( temp 2-component vector of double) +0:137 inverse sqrt ( global 2-component vector of double) +0:137 'dvec2v' ( temp 2-component vector of double) +0:138 add second child into first child ( temp 3-component vector of double) +0:138 'dvec3v' ( temp 3-component vector of double) +0:138 inverse sqrt ( global 3-component vector of double) +0:138 'dvec3v' ( temp 3-component vector of double) +0:139 add second child into first child ( temp 4-component vector of double) +0:139 'dvec4v' ( temp 4-component vector of double) +0:139 inverse sqrt ( global 4-component vector of double) +0:139 'dvec4v' ( temp 4-component vector of double) +0:141 add second child into first child ( temp double) +0:141 'doublev' ( temp double) +0:141 Absolute value ( global double) +0:141 'doublev' ( temp double) +0:142 add second child into first child ( temp 2-component vector of double) +0:142 'dvec2v' ( temp 2-component vector of double) +0:142 Absolute value ( global 2-component vector of double) +0:142 'dvec2v' ( temp 2-component vector of double) +0:143 add second child into first child ( temp 3-component vector of double) +0:143 'dvec3v' ( temp 3-component vector of double) +0:143 Absolute value ( global 3-component vector of double) +0:143 'dvec3v' ( temp 3-component vector of double) +0:144 add second child into first child ( temp 4-component vector of double) +0:144 'dvec4v' ( temp 4-component vector of double) +0:144 Absolute value ( global 4-component vector of double) +0:144 'dvec4v' ( temp 4-component vector of double) +0:146 add second child into first child ( temp double) +0:146 'doublev' ( temp double) +0:146 Sign ( global double) +0:146 'doublev' ( temp double) +0:147 add second child into first child ( temp 2-component vector of double) +0:147 'dvec2v' ( temp 2-component vector of double) +0:147 Sign ( global 2-component vector of double) +0:147 'dvec2v' ( temp 2-component vector of double) +0:148 add second child into first child ( temp 3-component vector of double) +0:148 'dvec3v' ( temp 3-component vector of double) +0:148 Sign ( global 3-component vector of double) +0:148 'dvec3v' ( temp 3-component vector of double) +0:149 add second child into first child ( temp 4-component vector of double) +0:149 'dvec4v' ( temp 4-component vector of double) +0:149 Sign ( global 4-component vector of double) +0:149 'dvec4v' ( temp 4-component vector of double) +0:151 add second child into first child ( temp double) +0:151 'doublev' ( temp double) +0:151 Floor ( global double) +0:151 'doublev' ( temp double) +0:152 add second child into first child ( temp 2-component vector of double) +0:152 'dvec2v' ( temp 2-component vector of double) +0:152 Floor ( global 2-component vector of double) +0:152 'dvec2v' ( temp 2-component vector of double) +0:153 add second child into first child ( temp 3-component vector of double) +0:153 'dvec3v' ( temp 3-component vector of double) +0:153 Floor ( global 3-component vector of double) +0:153 'dvec3v' ( temp 3-component vector of double) +0:154 add second child into first child ( temp 4-component vector of double) +0:154 'dvec4v' ( temp 4-component vector of double) +0:154 Floor ( global 4-component vector of double) +0:154 'dvec4v' ( temp 4-component vector of double) +0:156 add second child into first child ( temp double) +0:156 'doublev' ( temp double) +0:156 trunc ( global double) +0:156 'doublev' ( temp double) +0:157 add second child into first child ( temp 2-component vector of double) +0:157 'dvec2v' ( temp 2-component vector of double) +0:157 trunc ( global 2-component vector of double) +0:157 'dvec2v' ( temp 2-component vector of double) +0:158 add second child into first child ( temp 3-component vector of double) +0:158 'dvec3v' ( temp 3-component vector of double) +0:158 trunc ( global 3-component vector of double) +0:158 'dvec3v' ( temp 3-component vector of double) +0:159 add second child into first child ( temp 4-component vector of double) +0:159 'dvec4v' ( temp 4-component vector of double) +0:159 trunc ( global 4-component vector of double) +0:159 'dvec4v' ( temp 4-component vector of double) +0:161 add second child into first child ( temp double) +0:161 'doublev' ( temp double) +0:161 round ( global double) +0:161 'doublev' ( temp double) +0:162 add second child into first child ( temp 2-component vector of double) +0:162 'dvec2v' ( temp 2-component vector of double) +0:162 round ( global 2-component vector of double) +0:162 'dvec2v' ( temp 2-component vector of double) +0:163 add second child into first child ( temp 3-component vector of double) +0:163 'dvec3v' ( temp 3-component vector of double) +0:163 round ( global 3-component vector of double) +0:163 'dvec3v' ( temp 3-component vector of double) +0:164 add second child into first child ( temp 4-component vector of double) +0:164 'dvec4v' ( temp 4-component vector of double) +0:164 round ( global 4-component vector of double) +0:164 'dvec4v' ( temp 4-component vector of double) +0:166 add second child into first child ( temp double) +0:166 'doublev' ( temp double) +0:166 roundEven ( global double) +0:166 'doublev' ( temp double) +0:167 add second child into first child ( temp 2-component vector of double) +0:167 'dvec2v' ( temp 2-component vector of double) +0:167 roundEven ( global 2-component vector of double) +0:167 'dvec2v' ( temp 2-component vector of double) +0:168 add second child into first child ( temp 3-component vector of double) +0:168 'dvec3v' ( temp 3-component vector of double) +0:168 roundEven ( global 3-component vector of double) +0:168 'dvec3v' ( temp 3-component vector of double) +0:169 add second child into first child ( temp 4-component vector of double) +0:169 'dvec4v' ( temp 4-component vector of double) +0:169 roundEven ( global 4-component vector of double) +0:169 'dvec4v' ( temp 4-component vector of double) +0:171 add second child into first child ( temp double) +0:171 'doublev' ( temp double) +0:171 Ceiling ( global double) +0:171 'doublev' ( temp double) +0:172 add second child into first child ( temp 2-component vector of double) +0:172 'dvec2v' ( temp 2-component vector of double) +0:172 Ceiling ( global 2-component vector of double) +0:172 'dvec2v' ( temp 2-component vector of double) +0:173 add second child into first child ( temp 3-component vector of double) +0:173 'dvec3v' ( temp 3-component vector of double) +0:173 Ceiling ( global 3-component vector of double) +0:173 'dvec3v' ( temp 3-component vector of double) +0:174 add second child into first child ( temp 4-component vector of double) +0:174 'dvec4v' ( temp 4-component vector of double) +0:174 Ceiling ( global 4-component vector of double) +0:174 'dvec4v' ( temp 4-component vector of double) +0:176 add second child into first child ( temp double) +0:176 'doublev' ( temp double) +0:176 Fraction ( global double) +0:176 'doublev' ( temp double) +0:177 add second child into first child ( temp 2-component vector of double) +0:177 'dvec2v' ( temp 2-component vector of double) +0:177 Fraction ( global 2-component vector of double) +0:177 'dvec2v' ( temp 2-component vector of double) +0:178 add second child into first child ( temp 3-component vector of double) +0:178 'dvec3v' ( temp 3-component vector of double) +0:178 Fraction ( global 3-component vector of double) +0:178 'dvec3v' ( temp 3-component vector of double) +0:179 add second child into first child ( temp 4-component vector of double) +0:179 'dvec4v' ( temp 4-component vector of double) +0:179 Fraction ( global 4-component vector of double) +0:179 'dvec4v' ( temp 4-component vector of double) +0:181 add second child into first child ( temp double) +0:181 'doublev' ( temp double) +0:181 mod ( global double) +0:181 'doublev' ( temp double) +0:181 'doublev' ( temp double) +0:182 add second child into first child ( temp 2-component vector of double) +0:182 'dvec2v' ( temp 2-component vector of double) +0:182 mod ( global 2-component vector of double) +0:182 'dvec2v' ( temp 2-component vector of double) +0:182 'doublev' ( temp double) +0:183 add second child into first child ( temp 3-component vector of double) +0:183 'dvec3v' ( temp 3-component vector of double) +0:183 mod ( global 3-component vector of double) +0:183 'dvec3v' ( temp 3-component vector of double) +0:183 'doublev' ( temp double) +0:184 add second child into first child ( temp 4-component vector of double) +0:184 'dvec4v' ( temp 4-component vector of double) +0:184 mod ( global 4-component vector of double) +0:184 'dvec4v' ( temp 4-component vector of double) +0:184 'doublev' ( temp double) +0:185 add second child into first child ( temp 2-component vector of double) +0:185 'dvec2v' ( temp 2-component vector of double) +0:185 mod ( global 2-component vector of double) +0:185 'dvec2v' ( temp 2-component vector of double) +0:185 'dvec2v' ( temp 2-component vector of double) +0:186 add second child into first child ( temp 3-component vector of double) +0:186 'dvec3v' ( temp 3-component vector of double) +0:186 mod ( global 3-component vector of double) +0:186 'dvec3v' ( temp 3-component vector of double) +0:186 'dvec3v' ( temp 3-component vector of double) +0:187 add second child into first child ( temp 4-component vector of double) +0:187 'dvec4v' ( temp 4-component vector of double) +0:187 mod ( global 4-component vector of double) +0:187 'dvec4v' ( temp 4-component vector of double) +0:187 'dvec4v' ( temp 4-component vector of double) +0:189 add second child into first child ( temp double) +0:189 'doublev' ( temp double) +0:189 modf ( global double) +0:189 'doublev' ( temp double) +0:189 'doublev' ( temp double) +0:190 add second child into first child ( temp 2-component vector of double) +0:190 'dvec2v' ( temp 2-component vector of double) +0:190 modf ( global 2-component vector of double) +0:190 'dvec2v' ( temp 2-component vector of double) +0:190 'dvec2v' ( temp 2-component vector of double) +0:191 add second child into first child ( temp 3-component vector of double) +0:191 'dvec3v' ( temp 3-component vector of double) +0:191 modf ( global 3-component vector of double) +0:191 'dvec3v' ( temp 3-component vector of double) +0:191 'dvec3v' ( temp 3-component vector of double) +0:192 add second child into first child ( temp 4-component vector of double) +0:192 'dvec4v' ( temp 4-component vector of double) +0:192 modf ( global 4-component vector of double) +0:192 'dvec4v' ( temp 4-component vector of double) +0:192 'dvec4v' ( temp 4-component vector of double) +0:194 add second child into first child ( temp double) +0:194 'doublev' ( temp double) +0:194 min ( global double) +0:194 'doublev' ( temp double) +0:194 'doublev' ( temp double) +0:195 add second child into first child ( temp 2-component vector of double) +0:195 'dvec2v' ( temp 2-component vector of double) +0:195 min ( global 2-component vector of double) +0:195 'dvec2v' ( temp 2-component vector of double) +0:195 'doublev' ( temp double) +0:196 add second child into first child ( temp 3-component vector of double) +0:196 'dvec3v' ( temp 3-component vector of double) +0:196 min ( global 3-component vector of double) +0:196 'dvec3v' ( temp 3-component vector of double) +0:196 'doublev' ( temp double) +0:197 add second child into first child ( temp 4-component vector of double) +0:197 'dvec4v' ( temp 4-component vector of double) +0:197 min ( global 4-component vector of double) +0:197 'dvec4v' ( temp 4-component vector of double) +0:197 'doublev' ( temp double) +0:198 add second child into first child ( temp 2-component vector of double) +0:198 'dvec2v' ( temp 2-component vector of double) +0:198 min ( global 2-component vector of double) +0:198 'dvec2v' ( temp 2-component vector of double) +0:198 'dvec2v' ( temp 2-component vector of double) +0:199 add second child into first child ( temp 3-component vector of double) +0:199 'dvec3v' ( temp 3-component vector of double) +0:199 min ( global 3-component vector of double) +0:199 'dvec3v' ( temp 3-component vector of double) +0:199 'dvec3v' ( temp 3-component vector of double) +0:200 add second child into first child ( temp 4-component vector of double) +0:200 'dvec4v' ( temp 4-component vector of double) +0:200 min ( global 4-component vector of double) +0:200 'dvec4v' ( temp 4-component vector of double) +0:200 'dvec4v' ( temp 4-component vector of double) +0:202 add second child into first child ( temp double) +0:202 'doublev' ( temp double) +0:202 max ( global double) +0:202 'doublev' ( temp double) +0:202 'doublev' ( temp double) +0:203 add second child into first child ( temp 2-component vector of double) +0:203 'dvec2v' ( temp 2-component vector of double) +0:203 max ( global 2-component vector of double) +0:203 'dvec2v' ( temp 2-component vector of double) +0:203 'doublev' ( temp double) +0:204 add second child into first child ( temp 3-component vector of double) +0:204 'dvec3v' ( temp 3-component vector of double) +0:204 max ( global 3-component vector of double) +0:204 'dvec3v' ( temp 3-component vector of double) +0:204 'doublev' ( temp double) +0:205 add second child into first child ( temp 4-component vector of double) +0:205 'dvec4v' ( temp 4-component vector of double) +0:205 max ( global 4-component vector of double) +0:205 'dvec4v' ( temp 4-component vector of double) +0:205 'doublev' ( temp double) +0:206 add second child into first child ( temp 2-component vector of double) +0:206 'dvec2v' ( temp 2-component vector of double) +0:206 max ( global 2-component vector of double) +0:206 'dvec2v' ( temp 2-component vector of double) +0:206 'dvec2v' ( temp 2-component vector of double) +0:207 add second child into first child ( temp 3-component vector of double) +0:207 'dvec3v' ( temp 3-component vector of double) +0:207 max ( global 3-component vector of double) +0:207 'dvec3v' ( temp 3-component vector of double) +0:207 'dvec3v' ( temp 3-component vector of double) +0:208 add second child into first child ( temp 4-component vector of double) +0:208 'dvec4v' ( temp 4-component vector of double) +0:208 max ( global 4-component vector of double) +0:208 'dvec4v' ( temp 4-component vector of double) +0:208 'dvec4v' ( temp 4-component vector of double) +0:210 add second child into first child ( temp double) +0:210 'doublev' ( temp double) +0:210 clamp ( global double) +0:210 'doublev' ( temp double) +0:210 'doublev' ( temp double) +0:210 'doublev' ( temp double) +0:211 add second child into first child ( temp 2-component vector of double) +0:211 'dvec2v' ( temp 2-component vector of double) +0:211 clamp ( global 2-component vector of double) +0:211 'dvec2v' ( temp 2-component vector of double) +0:211 'doublev' ( temp double) +0:211 'doublev' ( temp double) +0:212 add second child into first child ( temp 3-component vector of double) +0:212 'dvec3v' ( temp 3-component vector of double) +0:212 clamp ( global 3-component vector of double) +0:212 'dvec3v' ( temp 3-component vector of double) +0:212 'doublev' ( temp double) +0:212 'doublev' ( temp double) +0:213 add second child into first child ( temp 4-component vector of double) +0:213 'dvec4v' ( temp 4-component vector of double) +0:213 clamp ( global 4-component vector of double) +0:213 'dvec4v' ( temp 4-component vector of double) +0:213 'doublev' ( temp double) +0:213 'doublev' ( temp double) +0:214 add second child into first child ( temp 2-component vector of double) +0:214 'dvec2v' ( temp 2-component vector of double) +0:214 clamp ( global 2-component vector of double) +0:214 'dvec2v' ( temp 2-component vector of double) +0:214 'dvec2v' ( temp 2-component vector of double) +0:214 'dvec2v' ( temp 2-component vector of double) +0:215 add second child into first child ( temp 3-component vector of double) +0:215 'dvec3v' ( temp 3-component vector of double) +0:215 clamp ( global 3-component vector of double) +0:215 'dvec3v' ( temp 3-component vector of double) +0:215 'dvec3v' ( temp 3-component vector of double) +0:215 'dvec3v' ( temp 3-component vector of double) +0:216 add second child into first child ( temp 4-component vector of double) +0:216 'dvec4v' ( temp 4-component vector of double) +0:216 clamp ( global 4-component vector of double) +0:216 'dvec4v' ( temp 4-component vector of double) +0:216 'dvec4v' ( temp 4-component vector of double) +0:216 'dvec4v' ( temp 4-component vector of double) +0:218 add second child into first child ( temp double) +0:218 'doublev' ( temp double) +0:218 mix ( global double) +0:218 'doublev' ( temp double) +0:218 'doublev' ( temp double) +0:218 'doublev' ( temp double) +0:219 add second child into first child ( temp 2-component vector of double) +0:219 'dvec2v' ( temp 2-component vector of double) +0:219 mix ( global 2-component vector of double) +0:219 'dvec2v' ( temp 2-component vector of double) +0:219 'dvec2v' ( temp 2-component vector of double) +0:219 'doublev' ( temp double) +0:220 add second child into first child ( temp 3-component vector of double) +0:220 'dvec3v' ( temp 3-component vector of double) +0:220 mix ( global 3-component vector of double) +0:220 'dvec3v' ( temp 3-component vector of double) +0:220 'dvec3v' ( temp 3-component vector of double) +0:220 'doublev' ( temp double) +0:221 add second child into first child ( temp 4-component vector of double) +0:221 'dvec4v' ( temp 4-component vector of double) +0:221 mix ( global 4-component vector of double) +0:221 'dvec4v' ( temp 4-component vector of double) +0:221 'dvec4v' ( temp 4-component vector of double) +0:221 'doublev' ( temp double) +0:222 add second child into first child ( temp 2-component vector of double) +0:222 'dvec2v' ( temp 2-component vector of double) +0:222 mix ( global 2-component vector of double) +0:222 'dvec2v' ( temp 2-component vector of double) +0:222 'dvec2v' ( temp 2-component vector of double) +0:222 'dvec2v' ( temp 2-component vector of double) +0:223 add second child into first child ( temp 3-component vector of double) +0:223 'dvec3v' ( temp 3-component vector of double) +0:223 mix ( global 3-component vector of double) +0:223 'dvec3v' ( temp 3-component vector of double) +0:223 'dvec3v' ( temp 3-component vector of double) +0:223 'dvec3v' ( temp 3-component vector of double) +0:224 add second child into first child ( temp 4-component vector of double) +0:224 'dvec4v' ( temp 4-component vector of double) +0:224 mix ( global 4-component vector of double) +0:224 'dvec4v' ( temp 4-component vector of double) +0:224 'dvec4v' ( temp 4-component vector of double) +0:224 'dvec4v' ( temp 4-component vector of double) +0:225 add second child into first child ( temp double) +0:225 'doublev' ( temp double) +0:225 mix ( global double) +0:225 'doublev' ( temp double) +0:225 'doublev' ( temp double) +0:225 'boolv' ( temp bool) +0:226 add second child into first child ( temp 2-component vector of double) +0:226 'dvec2v' ( temp 2-component vector of double) +0:226 mix ( global 2-component vector of double) +0:226 'dvec2v' ( temp 2-component vector of double) +0:226 'dvec2v' ( temp 2-component vector of double) +0:226 'bvec2v' ( temp 2-component vector of bool) +0:227 add second child into first child ( temp 3-component vector of double) +0:227 'dvec3v' ( temp 3-component vector of double) +0:227 mix ( global 3-component vector of double) +0:227 'dvec3v' ( temp 3-component vector of double) +0:227 'dvec3v' ( temp 3-component vector of double) +0:227 'bvec3v' ( temp 3-component vector of bool) +0:228 add second child into first child ( temp 4-component vector of double) +0:228 'dvec4v' ( temp 4-component vector of double) +0:228 mix ( global 4-component vector of double) +0:228 'dvec4v' ( temp 4-component vector of double) +0:228 'dvec4v' ( temp 4-component vector of double) +0:228 'bvec4v' ( temp 4-component vector of bool) +0:230 add second child into first child ( temp double) +0:230 'doublev' ( temp double) +0:230 step ( global double) +0:230 'doublev' ( temp double) +0:230 'doublev' ( temp double) +0:231 add second child into first child ( temp 2-component vector of double) +0:231 'dvec2v' ( temp 2-component vector of double) +0:231 step ( global 2-component vector of double) +0:231 'dvec2v' ( temp 2-component vector of double) +0:231 'dvec2v' ( temp 2-component vector of double) +0:232 add second child into first child ( temp 3-component vector of double) +0:232 'dvec3v' ( temp 3-component vector of double) +0:232 step ( global 3-component vector of double) +0:232 'dvec3v' ( temp 3-component vector of double) +0:232 'dvec3v' ( temp 3-component vector of double) +0:233 add second child into first child ( temp 4-component vector of double) +0:233 'dvec4v' ( temp 4-component vector of double) +0:233 step ( global 4-component vector of double) +0:233 'dvec4v' ( temp 4-component vector of double) +0:233 'dvec4v' ( temp 4-component vector of double) +0:234 add second child into first child ( temp 2-component vector of double) +0:234 'dvec2v' ( temp 2-component vector of double) +0:234 step ( global 2-component vector of double) +0:234 'doublev' ( temp double) +0:234 'dvec2v' ( temp 2-component vector of double) +0:235 add second child into first child ( temp 3-component vector of double) +0:235 'dvec3v' ( temp 3-component vector of double) +0:235 step ( global 3-component vector of double) +0:235 'doublev' ( temp double) +0:235 'dvec3v' ( temp 3-component vector of double) +0:236 add second child into first child ( temp 4-component vector of double) +0:236 'dvec4v' ( temp 4-component vector of double) +0:236 step ( global 4-component vector of double) +0:236 'doublev' ( temp double) +0:236 'dvec4v' ( temp 4-component vector of double) +0:238 add second child into first child ( temp double) +0:238 'doublev' ( temp double) +0:238 smoothstep ( global double) +0:238 'doublev' ( temp double) +0:238 'doublev' ( temp double) +0:238 'doublev' ( temp double) +0:239 add second child into first child ( temp 2-component vector of double) +0:239 'dvec2v' ( temp 2-component vector of double) +0:239 smoothstep ( global 2-component vector of double) +0:239 'dvec2v' ( temp 2-component vector of double) +0:239 'dvec2v' ( temp 2-component vector of double) +0:239 'dvec2v' ( temp 2-component vector of double) +0:240 add second child into first child ( temp 3-component vector of double) +0:240 'dvec3v' ( temp 3-component vector of double) +0:240 smoothstep ( global 3-component vector of double) +0:240 'dvec3v' ( temp 3-component vector of double) +0:240 'dvec3v' ( temp 3-component vector of double) +0:240 'dvec3v' ( temp 3-component vector of double) +0:241 add second child into first child ( temp 4-component vector of double) +0:241 'dvec4v' ( temp 4-component vector of double) +0:241 smoothstep ( global 4-component vector of double) +0:241 'dvec4v' ( temp 4-component vector of double) +0:241 'dvec4v' ( temp 4-component vector of double) +0:241 'dvec4v' ( temp 4-component vector of double) +0:242 add second child into first child ( temp 2-component vector of double) +0:242 'dvec2v' ( temp 2-component vector of double) +0:242 smoothstep ( global 2-component vector of double) +0:242 'doublev' ( temp double) +0:242 'doublev' ( temp double) +0:242 'dvec2v' ( temp 2-component vector of double) +0:243 add second child into first child ( temp 3-component vector of double) +0:243 'dvec3v' ( temp 3-component vector of double) +0:243 smoothstep ( global 3-component vector of double) +0:243 'doublev' ( temp double) +0:243 'doublev' ( temp double) +0:243 'dvec3v' ( temp 3-component vector of double) +0:244 add second child into first child ( temp 4-component vector of double) +0:244 'dvec4v' ( temp 4-component vector of double) +0:244 smoothstep ( global 4-component vector of double) +0:244 'doublev' ( temp double) +0:244 'doublev' ( temp double) +0:244 'dvec4v' ( temp 4-component vector of double) +0:246 move second child to first child ( temp bool) +0:246 'boolv' ( temp bool) +0:246 isnan ( global bool) +0:246 'doublev' ( temp double) +0:247 move second child to first child ( temp 2-component vector of bool) +0:247 'bvec2v' ( temp 2-component vector of bool) +0:247 isnan ( global 2-component vector of bool) +0:247 'dvec2v' ( temp 2-component vector of double) +0:248 move second child to first child ( temp 3-component vector of bool) +0:248 'bvec3v' ( temp 3-component vector of bool) +0:248 isnan ( global 3-component vector of bool) +0:248 'dvec3v' ( temp 3-component vector of double) +0:249 move second child to first child ( temp 4-component vector of bool) +0:249 'bvec4v' ( temp 4-component vector of bool) +0:249 isnan ( global 4-component vector of bool) +0:249 'dvec4v' ( temp 4-component vector of double) +0:251 move second child to first child ( temp bool) +0:251 'boolv' ( temp bool) +0:251 Test condition and select ( temp bool) +0:251 Condition +0:251 'boolv' ( temp bool) +0:251 true case +0:251 isinf ( global bool) +0:251 'doublev' ( temp double) +0:251 false case +0:251 Constant: +0:251 false (const bool) +0:252 move second child to first child ( temp 2-component vector of bool) +0:252 'bvec2v' ( temp 2-component vector of bool) +0:252 Test condition and select ( temp 2-component vector of bool) +0:252 Condition +0:252 'boolv' ( temp bool) +0:252 true case +0:252 isinf ( global 2-component vector of bool) +0:252 'dvec2v' ( temp 2-component vector of double) +0:252 false case +0:252 Constant: +0:252 false (const bool) +0:252 false (const bool) +0:253 move second child to first child ( temp 3-component vector of bool) +0:253 'bvec3v' ( temp 3-component vector of bool) +0:253 Test condition and select ( temp 3-component vector of bool) +0:253 Condition +0:253 'boolv' ( temp bool) +0:253 true case +0:253 isinf ( global 3-component vector of bool) +0:253 'dvec3v' ( temp 3-component vector of double) +0:253 false case +0:253 Constant: +0:253 false (const bool) +0:253 false (const bool) +0:253 false (const bool) +0:254 move second child to first child ( temp 4-component vector of bool) +0:254 'bvec4v' ( temp 4-component vector of bool) +0:254 Test condition and select ( temp 4-component vector of bool) +0:254 Condition +0:254 'boolv' ( temp bool) +0:254 true case +0:254 isinf ( global 4-component vector of bool) +0:254 'dvec4v' ( temp 4-component vector of double) +0:254 false case +0:254 Constant: +0:254 false (const bool) +0:254 false (const bool) +0:254 false (const bool) +0:254 false (const bool) +0:256 add second child into first child ( temp double) +0:256 'doublev' ( temp double) +0:256 length ( global double) +0:256 'doublev' ( temp double) +0:257 add second child into first child ( temp double) +0:257 'doublev' ( temp double) +0:257 length ( global double) +0:257 'dvec2v' ( temp 2-component vector of double) +0:258 add second child into first child ( temp double) +0:258 'doublev' ( temp double) +0:258 length ( global double) +0:258 'dvec3v' ( temp 3-component vector of double) +0:259 add second child into first child ( temp double) +0:259 'doublev' ( temp double) +0:259 length ( global double) +0:259 'dvec4v' ( temp 4-component vector of double) +0:261 add second child into first child ( temp double) +0:261 'doublev' ( temp double) +0:261 distance ( global double) +0:261 'doublev' ( temp double) +0:261 'doublev' ( temp double) +0:262 add second child into first child ( temp double) +0:262 'doublev' ( temp double) +0:262 distance ( global double) +0:262 'dvec2v' ( temp 2-component vector of double) +0:262 'dvec2v' ( temp 2-component vector of double) +0:263 add second child into first child ( temp double) +0:263 'doublev' ( temp double) +0:263 distance ( global double) +0:263 'dvec3v' ( temp 3-component vector of double) +0:263 'dvec3v' ( temp 3-component vector of double) +0:264 add second child into first child ( temp double) +0:264 'doublev' ( temp double) +0:264 distance ( global double) +0:264 'dvec4v' ( temp 4-component vector of double) +0:264 'dvec4v' ( temp 4-component vector of double) +0:266 add second child into first child ( temp double) +0:266 'doublev' ( temp double) +0:266 dot-product ( global double) +0:266 'doublev' ( temp double) +0:266 'doublev' ( temp double) +0:267 add second child into first child ( temp double) +0:267 'doublev' ( temp double) +0:267 dot-product ( global double) +0:267 'dvec2v' ( temp 2-component vector of double) +0:267 'dvec2v' ( temp 2-component vector of double) +0:268 add second child into first child ( temp double) +0:268 'doublev' ( temp double) +0:268 dot-product ( global double) +0:268 'dvec3v' ( temp 3-component vector of double) +0:268 'dvec3v' ( temp 3-component vector of double) +0:269 add second child into first child ( temp double) +0:269 'doublev' ( temp double) +0:269 dot-product ( global double) +0:269 'dvec4v' ( temp 4-component vector of double) +0:269 'dvec4v' ( temp 4-component vector of double) +0:271 add second child into first child ( temp 3-component vector of double) +0:271 'dvec3v' ( temp 3-component vector of double) +0:271 cross-product ( global 3-component vector of double) +0:271 'dvec3v' ( temp 3-component vector of double) +0:271 'dvec3v' ( temp 3-component vector of double) +0:273 add second child into first child ( temp double) +0:273 'doublev' ( temp double) +0:273 normalize ( global double) +0:273 'doublev' ( temp double) +0:274 add second child into first child ( temp 2-component vector of double) +0:274 'dvec2v' ( temp 2-component vector of double) +0:274 normalize ( global 2-component vector of double) +0:274 'dvec2v' ( temp 2-component vector of double) +0:275 add second child into first child ( temp 3-component vector of double) +0:275 'dvec3v' ( temp 3-component vector of double) +0:275 normalize ( global 3-component vector of double) +0:275 'dvec3v' ( temp 3-component vector of double) +0:276 add second child into first child ( temp 4-component vector of double) +0:276 'dvec4v' ( temp 4-component vector of double) +0:276 normalize ( global 4-component vector of double) +0:276 'dvec4v' ( temp 4-component vector of double) +0:278 add second child into first child ( temp double) +0:278 'doublev' ( temp double) +0:278 face-forward ( global double) +0:278 'doublev' ( temp double) +0:278 'doublev' ( temp double) +0:278 'doublev' ( temp double) +0:279 add second child into first child ( temp 2-component vector of double) +0:279 'dvec2v' ( temp 2-component vector of double) +0:279 face-forward ( global 2-component vector of double) +0:279 'dvec2v' ( temp 2-component vector of double) +0:279 'dvec2v' ( temp 2-component vector of double) +0:279 'dvec2v' ( temp 2-component vector of double) +0:280 add second child into first child ( temp 3-component vector of double) +0:280 'dvec3v' ( temp 3-component vector of double) +0:280 face-forward ( global 3-component vector of double) +0:280 'dvec3v' ( temp 3-component vector of double) +0:280 'dvec3v' ( temp 3-component vector of double) +0:280 'dvec3v' ( temp 3-component vector of double) +0:281 add second child into first child ( temp 4-component vector of double) +0:281 'dvec4v' ( temp 4-component vector of double) +0:281 face-forward ( global 4-component vector of double) +0:281 'dvec4v' ( temp 4-component vector of double) +0:281 'dvec4v' ( temp 4-component vector of double) +0:281 'dvec4v' ( temp 4-component vector of double) +0:283 add second child into first child ( temp double) +0:283 'doublev' ( temp double) +0:283 reflect ( global double) +0:283 'doublev' ( temp double) +0:283 'doublev' ( temp double) +0:284 add second child into first child ( temp 2-component vector of double) +0:284 'dvec2v' ( temp 2-component vector of double) +0:284 reflect ( global 2-component vector of double) +0:284 'dvec2v' ( temp 2-component vector of double) +0:284 'dvec2v' ( temp 2-component vector of double) +0:285 add second child into first child ( temp 3-component vector of double) +0:285 'dvec3v' ( temp 3-component vector of double) +0:285 reflect ( global 3-component vector of double) +0:285 'dvec3v' ( temp 3-component vector of double) +0:285 'dvec3v' ( temp 3-component vector of double) +0:286 add second child into first child ( temp 4-component vector of double) +0:286 'dvec4v' ( temp 4-component vector of double) +0:286 reflect ( global 4-component vector of double) +0:286 'dvec4v' ( temp 4-component vector of double) +0:286 'dvec4v' ( temp 4-component vector of double) +0:288 add second child into first child ( temp double) +0:288 'doublev' ( temp double) +0:288 refract ( global double) +0:288 'doublev' ( temp double) +0:288 'doublev' ( temp double) +0:288 'doublev' ( temp double) +0:289 add second child into first child ( temp 2-component vector of double) +0:289 'dvec2v' ( temp 2-component vector of double) +0:289 refract ( global 2-component vector of double) +0:289 'dvec2v' ( temp 2-component vector of double) +0:289 'dvec2v' ( temp 2-component vector of double) +0:289 'doublev' ( temp double) +0:290 add second child into first child ( temp 3-component vector of double) +0:290 'dvec3v' ( temp 3-component vector of double) +0:290 refract ( global 3-component vector of double) +0:290 'dvec3v' ( temp 3-component vector of double) +0:290 'dvec3v' ( temp 3-component vector of double) +0:290 'doublev' ( temp double) +0:291 add second child into first child ( temp 4-component vector of double) +0:291 'dvec4v' ( temp 4-component vector of double) +0:291 refract ( global 4-component vector of double) +0:291 'dvec4v' ( temp 4-component vector of double) +0:291 'dvec4v' ( temp 4-component vector of double) +0:291 'doublev' ( temp double) +0:293 Sequence +0:293 move second child to first child ( temp 2X2 matrix of double) +0:293 'dmat2v' ( temp 2X2 matrix of double) +0:293 outer product ( global 2X2 matrix of double) +0:293 'dvec2v' ( temp 2-component vector of double) +0:293 'dvec2v' ( temp 2-component vector of double) +0:294 Sequence +0:294 move second child to first child ( temp 3X3 matrix of double) +0:294 'dmat3v' ( temp 3X3 matrix of double) +0:294 outer product ( global 3X3 matrix of double) +0:294 'dvec3v' ( temp 3-component vector of double) +0:294 'dvec3v' ( temp 3-component vector of double) +0:295 Sequence +0:295 move second child to first child ( temp 4X4 matrix of double) +0:295 'dmat4v' ( temp 4X4 matrix of double) +0:295 outer product ( global 4X4 matrix of double) +0:295 'dvec4v' ( temp 4-component vector of double) +0:295 'dvec4v' ( temp 4-component vector of double) +0:296 Sequence +0:296 move second child to first child ( temp 2X3 matrix of double) +0:296 'dmat2x3v' ( temp 2X3 matrix of double) +0:296 outer product ( global 2X3 matrix of double) +0:296 'dvec3v' ( temp 3-component vector of double) +0:296 'dvec2v' ( temp 2-component vector of double) +0:297 Sequence +0:297 move second child to first child ( temp 3X2 matrix of double) +0:297 'dmat3x2v' ( temp 3X2 matrix of double) +0:297 outer product ( global 3X2 matrix of double) +0:297 'dvec2v' ( temp 2-component vector of double) +0:297 'dvec3v' ( temp 3-component vector of double) +0:298 Sequence +0:298 move second child to first child ( temp 2X4 matrix of double) +0:298 'dmat2x4v' ( temp 2X4 matrix of double) +0:298 outer product ( global 2X4 matrix of double) +0:298 'dvec4v' ( temp 4-component vector of double) +0:298 'dvec2v' ( temp 2-component vector of double) +0:299 Sequence +0:299 move second child to first child ( temp 4X2 matrix of double) +0:299 'dmat4x2v' ( temp 4X2 matrix of double) +0:299 outer product ( global 4X2 matrix of double) +0:299 'dvec2v' ( temp 2-component vector of double) +0:299 'dvec4v' ( temp 4-component vector of double) +0:300 Sequence +0:300 move second child to first child ( temp 3X4 matrix of double) +0:300 'dmat3x4v' ( temp 3X4 matrix of double) +0:300 outer product ( global 3X4 matrix of double) +0:300 'dvec4v' ( temp 4-component vector of double) +0:300 'dvec3v' ( temp 3-component vector of double) +0:301 Sequence +0:301 move second child to first child ( temp 4X3 matrix of double) +0:301 'dmat4x3v' ( temp 4X3 matrix of double) +0:301 outer product ( global 4X3 matrix of double) +0:301 'dvec3v' ( temp 3-component vector of double) +0:301 'dvec4v' ( temp 4-component vector of double) +0:303 matrix mult second child into first child ( temp 2X2 matrix of double) +0:303 'dmat2v' ( temp 2X2 matrix of double) +0:303 component-wise multiply ( global 2X2 matrix of double) +0:303 'dmat2v' ( temp 2X2 matrix of double) +0:303 'dmat2v' ( temp 2X2 matrix of double) +0:304 matrix mult second child into first child ( temp 3X3 matrix of double) +0:304 'dmat3v' ( temp 3X3 matrix of double) +0:304 component-wise multiply ( global 3X3 matrix of double) +0:304 'dmat3v' ( temp 3X3 matrix of double) +0:304 'dmat3v' ( temp 3X3 matrix of double) +0:305 matrix mult second child into first child ( temp 4X4 matrix of double) +0:305 'dmat4v' ( temp 4X4 matrix of double) +0:305 component-wise multiply ( global 4X4 matrix of double) +0:305 'dmat4v' ( temp 4X4 matrix of double) +0:305 'dmat4v' ( temp 4X4 matrix of double) +0:306 move second child to first child ( temp 2X3 matrix of double) +0:306 'dmat2x3v' ( temp 2X3 matrix of double) +0:306 component-wise multiply ( global 2X3 matrix of double) +0:306 'dmat2x3v' ( temp 2X3 matrix of double) +0:306 'dmat2x3v' ( temp 2X3 matrix of double) +0:307 move second child to first child ( temp 2X4 matrix of double) +0:307 'dmat2x4v' ( temp 2X4 matrix of double) +0:307 component-wise multiply ( global 2X4 matrix of double) +0:307 'dmat2x4v' ( temp 2X4 matrix of double) +0:307 'dmat2x4v' ( temp 2X4 matrix of double) +0:308 move second child to first child ( temp 3X2 matrix of double) +0:308 'dmat3x2v' ( temp 3X2 matrix of double) +0:308 component-wise multiply ( global 3X2 matrix of double) +0:308 'dmat3x2v' ( temp 3X2 matrix of double) +0:308 'dmat3x2v' ( temp 3X2 matrix of double) +0:309 move second child to first child ( temp 3X4 matrix of double) +0:309 'dmat3x4v' ( temp 3X4 matrix of double) +0:309 component-wise multiply ( global 3X4 matrix of double) +0:309 'dmat3x4v' ( temp 3X4 matrix of double) +0:309 'dmat3x4v' ( temp 3X4 matrix of double) +0:310 move second child to first child ( temp 4X2 matrix of double) +0:310 'dmat4x2v' ( temp 4X2 matrix of double) +0:310 component-wise multiply ( global 4X2 matrix of double) +0:310 'dmat4x2v' ( temp 4X2 matrix of double) +0:310 'dmat4x2v' ( temp 4X2 matrix of double) +0:311 move second child to first child ( temp 4X3 matrix of double) +0:311 'dmat4x3v' ( temp 4X3 matrix of double) +0:311 component-wise multiply ( global 4X3 matrix of double) +0:311 'dmat4x3v' ( temp 4X3 matrix of double) +0:311 'dmat4x3v' ( temp 4X3 matrix of double) +0:313 matrix mult second child into first child ( temp 2X2 matrix of double) +0:313 'dmat2v' ( temp 2X2 matrix of double) +0:313 transpose ( global 2X2 matrix of double) +0:313 'dmat2v' ( temp 2X2 matrix of double) +0:314 matrix mult second child into first child ( temp 3X3 matrix of double) +0:314 'dmat3v' ( temp 3X3 matrix of double) +0:314 transpose ( global 3X3 matrix of double) +0:314 'dmat3v' ( temp 3X3 matrix of double) +0:315 matrix mult second child into first child ( temp 4X4 matrix of double) +0:315 'dmat4v' ( temp 4X4 matrix of double) +0:315 transpose ( global 4X4 matrix of double) +0:315 'dmat4v' ( temp 4X4 matrix of double) +0:316 move second child to first child ( temp 2X3 matrix of double) +0:316 'dmat2x3v' ( temp 2X3 matrix of double) +0:316 transpose ( global 2X3 matrix of double) +0:316 'dmat3x2v' ( temp 3X2 matrix of double) +0:317 move second child to first child ( temp 3X2 matrix of double) +0:317 'dmat3x2v' ( temp 3X2 matrix of double) +0:317 transpose ( global 3X2 matrix of double) +0:317 'dmat2x3v' ( temp 2X3 matrix of double) +0:318 move second child to first child ( temp 2X4 matrix of double) +0:318 'dmat2x4v' ( temp 2X4 matrix of double) +0:318 transpose ( global 2X4 matrix of double) +0:318 'dmat4x2v' ( temp 4X2 matrix of double) +0:319 move second child to first child ( temp 4X2 matrix of double) +0:319 'dmat4x2v' ( temp 4X2 matrix of double) +0:319 transpose ( global 4X2 matrix of double) +0:319 'dmat2x4v' ( temp 2X4 matrix of double) +0:320 move second child to first child ( temp 3X4 matrix of double) +0:320 'dmat3x4v' ( temp 3X4 matrix of double) +0:320 transpose ( global 3X4 matrix of double) +0:320 'dmat4x3v' ( temp 4X3 matrix of double) +0:321 move second child to first child ( temp 4X3 matrix of double) +0:321 'dmat4x3v' ( temp 4X3 matrix of double) +0:321 transpose ( global 4X3 matrix of double) +0:321 'dmat3x4v' ( temp 3X4 matrix of double) +0:323 add second child into first child ( temp double) +0:323 'doublev' ( temp double) +0:323 determinant ( global double) +0:323 'dmat2v' ( temp 2X2 matrix of double) +0:324 add second child into first child ( temp double) +0:324 'doublev' ( temp double) +0:324 determinant ( global double) +0:324 'dmat3v' ( temp 3X3 matrix of double) +0:325 add second child into first child ( temp double) +0:325 'doublev' ( temp double) +0:325 determinant ( global double) +0:325 'dmat4v' ( temp 4X4 matrix of double) +0:327 matrix mult second child into first child ( temp 2X2 matrix of double) +0:327 'dmat2v' ( temp 2X2 matrix of double) +0:327 inverse ( global 2X2 matrix of double) +0:327 'dmat2v' ( temp 2X2 matrix of double) +0:328 matrix mult second child into first child ( temp 3X3 matrix of double) +0:328 'dmat3v' ( temp 3X3 matrix of double) +0:328 inverse ( global 3X3 matrix of double) +0:328 'dmat3v' ( temp 3X3 matrix of double) +0:329 matrix mult second child into first child ( temp 4X4 matrix of double) +0:329 'dmat4v' ( temp 4X4 matrix of double) +0:329 inverse ( global 4X4 matrix of double) +0:329 'dmat4v' ( temp 4X4 matrix of double) +0:? Linker Objects +0:? 'bn' ( in 3-element array of block{ in int a}) +0:? 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize}) +0:? 'color' ( in 3-element array of 4-component vector of float) +0:? 'color2' ( in 3-element array of 4-component vector of float) +0:? 'colorS' ( in 3-element array of 4-component vector of float) +0:? 'colorBad' ( in 4-element array of 4-component vector of float) +0:? 'colorbad2' ( in 2-element array of 4-component vector of float) +0:? 'cva' (layout( location=4) in 3-element array of 4-component vector of float) +0:? 'cvb' (layout( location=5) in 3-element array of 4-component vector of float) +0:? 'cmc' (layout( location=2) in 3-element array of 3X3 matrix of float) +0:? 'patchIn' ( patch in 3-element array of 4-component vector of float) +0:? 'patchOut' (layout( stream=0) patch out 4-component vector of float) +0:? 'scalar' ( in float) +0:? 'inbls' ( in block{ in int a}) +0:? 'inbla' ( in 17-element array of block{ in int a}) +0:? 'indexedOut' (layout( location=7 stream=0) out 4-component vector of float) +0:? 'samp1D' ( uniform sampler1D) +0:? 'samp2Ds' ( uniform sampler2DShadow) + + +Linked geometry stage: + +ERROR: Linking geometry stage: At least one shader must specify an output layout primitive + +Shader version: 400 +Requested GL_ARB_separate_shader_objects +invocations = 4 +max_vertices = 127 +input primitive = triangles +output primitive = none +ERROR: node is still EOpNull! +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:5 Sequence +0:5 EmitStreamVertex ( global void) +0:5 Constant: +0:5 1 (const int) +0:6 EndStreamPrimitive ( global void) +0:6 Constant: +0:6 0 (const int) +0:7 EmitVertex ( global void) +0:8 EndPrimitive ( global void) +0:9 Sequence +0:9 move second child to first child ( temp int) +0:9 'id' ( temp int) +0:9 'gl_InvocationID' ( in int InvocationID) +0:? Linker Objects +0:? 'bn' ( in 3-element array of block{ in int a}) +0:? 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize}) +0:? 'color' ( in 3-element array of 4-component vector of float) +0:? 'color2' ( in 3-element array of 4-component vector of float) +0:? 'colorS' ( in 3-element array of 4-component vector of float) +0:? 'colorBad' ( in 4-element array of 4-component vector of float) +0:? 'colorbad2' ( in 2-element array of 4-component vector of float) +0:? 'cva' (layout( location=4) in 3-element array of 4-component vector of float) +0:? 'cvb' (layout( location=5) in 3-element array of 4-component vector of float) +0:? 'cmc' (layout( location=2) in 3-element array of 3X3 matrix of float) +0:? 'patchIn' ( patch in 3-element array of 4-component vector of float) +0:? 'patchOut' (layout( stream=0) patch out 4-component vector of float) +0:? 'scalar' ( in float) +0:? 'inbls' ( in block{ in int a}) +0:? 'inbla' ( in 17-element array of block{ in int a}) +0:? 'indexedOut' (layout( location=7 stream=0) out 4-component vector of float) +0:? 'samp1D' ( uniform sampler1D) +0:? 'samp2Ds' ( uniform sampler2DShadow) + diff --git a/deps/glslang/Test/baseResults/400.tesc.out b/deps/glslang/Test/baseResults/400.tesc.out new file mode 100644 index 00000000..0475741f --- /dev/null +++ b/deps/glslang/Test/baseResults/400.tesc.out @@ -0,0 +1,400 @@ +400.tesc +ERROR: 0:6: 'quads' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:7: 'ccw' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:8: 'fractional_even_spacing' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:10: 'patch' : can only use on output in tessellation-control shader +ERROR: 0:39: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:41: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:46: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:51: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:54: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:61: '' : tessellation control barrier() cannot be placed after a return from main() +ERROR: 0:64: 'vertices' : can only apply to 'out' +ERROR: 0:65: 'vertices' : cannot change previously set layout value +ERROR: 0:69: '[' : array index out of range '4' +ERROR: 0:71: '' : tessellation control barrier() must be in main() +ERROR: 0:74: 'in' : type must be an array: ina +ERROR: 0:76: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized +ERROR: 0:83: 'location' : overlapping use of location 4 +ERROR: 0:87: 'location' : overlapping use of location 4 +ERROR: 0:104: '' : precise qualifier must appear first +ERROR: 0:105: '' : precise qualifier must appear first +ERROR: 0:105: '' : precise qualifier must appear first +ERROR: 0:109: 'gl_DeviceIndex' : required extension not requested: GL_EXT_device_group +ERROR: 0:110: 'gl_ViewIndex' : required extension not requested: GL_EXT_multiview +ERROR: 23 compilation errors. No code generated. + + +Shader version: 400 +Requested GL_ARB_separate_shader_objects +Requested GL_EXT_device_group +Requested GL_EXT_multiview +vertices = 4 +ERROR: node is still EOpNull! +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:15 Sequence +0:15 Barrier ( global void) +0:17 Sequence +0:17 move second child to first child ( temp int) +0:17 'a' ( temp int) +0:17 Constant: +0:17 5392 (const int) +0:23 Sequence +0:23 move second child to first child ( temp 4-component vector of float) +0:23 'p' ( temp 4-component vector of float) +0:23 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:23 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:23 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:23 Constant: +0:23 1 (const int) +0:23 Constant: +0:23 0 (const int) +0:24 Sequence +0:24 move second child to first child ( temp float) +0:24 'ps' ( temp float) +0:24 gl_PointSize: direct index for structure ( in float PointSize) +0:24 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:24 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:24 Constant: +0:24 1 (const int) +0:24 Constant: +0:24 1 (const int) +0:25 Sequence +0:25 move second child to first child ( temp float) +0:25 'cd' ( temp float) +0:25 direct index ( temp float ClipDistance) +0:25 gl_ClipDistance: direct index for structure ( in unsized 3-element array of float ClipDistance) +0:25 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:25 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:25 Constant: +0:25 1 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 2 (const int) +0:27 Sequence +0:27 move second child to first child ( temp int) +0:27 'pvi' ( temp int) +0:27 'gl_PatchVerticesIn' ( in int PatchVertices) +0:28 Sequence +0:28 move second child to first child ( temp int) +0:28 'pid' ( temp int) +0:28 'gl_PrimitiveID' ( in int PrimitiveID) +0:29 Sequence +0:29 move second child to first child ( temp int) +0:29 'iid' ( temp int) +0:29 'gl_InvocationID' ( in int InvocationID) +0:31 move second child to first child ( temp 4-component vector of float) +0:31 gl_Position: direct index for structure ( out 4-component vector of float Position) +0:31 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:31 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:31 'gl_InvocationID' ( in int InvocationID) +0:31 Constant: +0:31 0 (const int) +0:31 'p' ( temp 4-component vector of float) +0:32 move second child to first child ( temp float) +0:32 gl_PointSize: direct index for structure ( out float PointSize) +0:32 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:32 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:32 'gl_InvocationID' ( in int InvocationID) +0:32 Constant: +0:32 1 (const int) +0:32 'ps' ( temp float) +0:33 move second child to first child ( temp float) +0:33 direct index ( temp float ClipDistance) +0:33 gl_ClipDistance: direct index for structure ( out unsized 2-element array of float ClipDistance) +0:33 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_InvocationID' ( in int InvocationID) +0:33 Constant: +0:33 2 (const int) +0:33 Constant: +0:33 1 (const int) +0:33 'cd' ( temp float) +0:35 move second child to first child ( temp float) +0:35 direct index ( patch temp float TessLevelOuter) +0:35 'gl_TessLevelOuter' ( patch out 4-element array of float TessLevelOuter) +0:35 Constant: +0:35 3 (const int) +0:35 Constant: +0:35 3.200000 +0:36 move second child to first child ( temp float) +0:36 direct index ( patch temp float TessLevelInner) +0:36 'gl_TessLevelInner' ( patch out 2-element array of float TessLevelInner) +0:36 Constant: +0:36 1 (const int) +0:36 Constant: +0:36 1.300000 +0:38 Test condition and select ( temp void) +0:38 Condition +0:38 Compare Greater Than ( temp bool) +0:38 'a' ( temp int) +0:38 Constant: +0:38 10 (const int) +0:38 true case +0:39 Barrier ( global void) +0:38 false case +0:41 Barrier ( global void) +0:43 Barrier ( global void) +0:47 Loop with condition not tested first +0:47 Loop Condition +0:47 Compare Greater Than ( temp bool) +0:47 'a' ( temp int) +0:47 Constant: +0:47 10 (const int) +0:47 Loop Body +0:46 Sequence +0:46 Barrier ( global void) +0:49 switch +0:49 condition +0:49 'a' ( temp int) +0:49 body +0:49 Sequence +0:50 default: +0:? Sequence +0:51 Barrier ( global void) +0:52 Branch: Break +0:54 Test condition and select ( temp int) +0:54 Condition +0:54 Compare Less Than ( temp bool) +0:54 'a' ( temp int) +0:54 Constant: +0:54 12 (const int) +0:54 true case +0:54 'a' ( temp int) +0:54 false case +0:54 Comma ( temp int) +0:54 Barrier ( global void) +0:54 'a' ( temp int) +0:56 Sequence +0:56 Barrier ( global void) +0:59 Branch: Return +0:61 Barrier ( global void) +0:67 Function Definition: foo( ( global void) +0:67 Function Parameters: +0:69 Sequence +0:69 gl_PointSize: direct index for structure ( out float PointSize) +0:69 direct index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:69 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:69 Constant: +0:69 4 (const int) +0:69 Constant: +0:69 1 (const int) +0:71 Barrier ( global void) +0:91 Function Definition: foop( ( global void) +0:91 Function Parameters: +0:? Sequence +0:95 multiply second child into first child ( temp 3-component vector of float) +0:95 'pv3' ( noContraction temp 3-component vector of float) +0:95 'pv3' ( noContraction temp 3-component vector of float) +0:96 move second child to first child ( temp 3-component vector of float) +0:96 'pv3' ( noContraction temp 3-component vector of float) +0:96 fma ( global 3-component vector of float) +0:96 'pv3' ( noContraction temp 3-component vector of float) +0:96 'pv3' ( noContraction temp 3-component vector of float) +0:96 'pv3' ( noContraction temp 3-component vector of float) +0:97 move second child to first child ( temp double) +0:97 'd' ( noContraction temp double) +0:97 fma ( global double) +0:97 'd' ( noContraction temp double) +0:97 'd' ( noContraction temp double) +0:97 'd' ( noContraction temp double) +0:107 Function Definition: devi( ( global void) +0:107 Function Parameters: +0:109 Sequence +0:109 'gl_DeviceIndex' ( in int DeviceIndex) +0:110 'gl_ViewIndex' ( in int ViewIndex) +0:121 Function Definition: devie( ( global void) +0:121 Function Parameters: +0:123 Sequence +0:123 'gl_DeviceIndex' ( in int DeviceIndex) +0:124 'gl_ViewIndex' ( in int ViewIndex) +0:? Linker Objects +0:? 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 2-element array of float ClipDistance gl_ClipDistance}) +0:? 'outa' ( global 4-element array of int) +0:? 'patchIn' ( patch in 4-component vector of float) +0:? 'patchOut' ( patch out 4-component vector of float) +0:? 'ina' ( in 2-component vector of float) +0:? 'inb' ( in 32-element array of 2-component vector of float) +0:? 'inc' ( in 32-element array of 2-component vector of float) +0:? 'ind' ( in 32-element array of 2-component vector of float) +0:? 'ivla' (layout( location=3) in 32-element array of 4-component vector of float) +0:? 'ivlb' (layout( location=4) in 32-element array of 4-component vector of float) +0:? 'ivlc' (layout( location=4) in 32-element array of 4-component vector of float) +0:? 'ovla' (layout( location=3) out 4-element array of 4-component vector of float) +0:? 'ovlb' (layout( location=4) out 4-element array of 4-component vector of float) +0:? 'ovlc' (layout( location=4) out 4-element array of 4-component vector of float) +0:? 'pv3' ( noContraction temp 3-component vector of float) +0:? 'pinbi' ( patch out block{ out int a}) +0:? 'badOrder' ( invariant noContraction out 4-element array of 4-component vector of float) + + +Linked tessellation control stage: + + +Shader version: 400 +Requested GL_ARB_separate_shader_objects +Requested GL_EXT_device_group +Requested GL_EXT_multiview +vertices = 4 +ERROR: node is still EOpNull! +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:15 Sequence +0:15 Barrier ( global void) +0:17 Sequence +0:17 move second child to first child ( temp int) +0:17 'a' ( temp int) +0:17 Constant: +0:17 5392 (const int) +0:23 Sequence +0:23 move second child to first child ( temp 4-component vector of float) +0:23 'p' ( temp 4-component vector of float) +0:23 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:23 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:23 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:23 Constant: +0:23 1 (const int) +0:23 Constant: +0:23 0 (const int) +0:24 Sequence +0:24 move second child to first child ( temp float) +0:24 'ps' ( temp float) +0:24 gl_PointSize: direct index for structure ( in float PointSize) +0:24 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:24 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:24 Constant: +0:24 1 (const int) +0:24 Constant: +0:24 1 (const int) +0:25 Sequence +0:25 move second child to first child ( temp float) +0:25 'cd' ( temp float) +0:25 direct index ( temp float ClipDistance) +0:25 gl_ClipDistance: direct index for structure ( in 3-element array of float ClipDistance) +0:25 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:25 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:25 Constant: +0:25 1 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 2 (const int) +0:27 Sequence +0:27 move second child to first child ( temp int) +0:27 'pvi' ( temp int) +0:27 'gl_PatchVerticesIn' ( in int PatchVertices) +0:28 Sequence +0:28 move second child to first child ( temp int) +0:28 'pid' ( temp int) +0:28 'gl_PrimitiveID' ( in int PrimitiveID) +0:29 Sequence +0:29 move second child to first child ( temp int) +0:29 'iid' ( temp int) +0:29 'gl_InvocationID' ( in int InvocationID) +0:31 move second child to first child ( temp 4-component vector of float) +0:31 gl_Position: direct index for structure ( out 4-component vector of float Position) +0:31 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:31 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:31 'gl_InvocationID' ( in int InvocationID) +0:31 Constant: +0:31 0 (const int) +0:31 'p' ( temp 4-component vector of float) +0:32 move second child to first child ( temp float) +0:32 gl_PointSize: direct index for structure ( out float PointSize) +0:32 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:32 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:32 'gl_InvocationID' ( in int InvocationID) +0:32 Constant: +0:32 1 (const int) +0:32 'ps' ( temp float) +0:33 move second child to first child ( temp float) +0:33 direct index ( temp float ClipDistance) +0:33 gl_ClipDistance: direct index for structure ( out 2-element array of float ClipDistance) +0:33 indirect index ( temp block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_InvocationID' ( in int InvocationID) +0:33 Constant: +0:33 2 (const int) +0:33 Constant: +0:33 1 (const int) +0:33 'cd' ( temp float) +0:35 move second child to first child ( temp float) +0:35 direct index ( patch temp float TessLevelOuter) +0:35 'gl_TessLevelOuter' ( patch out 4-element array of float TessLevelOuter) +0:35 Constant: +0:35 3 (const int) +0:35 Constant: +0:35 3.200000 +0:36 move second child to first child ( temp float) +0:36 direct index ( patch temp float TessLevelInner) +0:36 'gl_TessLevelInner' ( patch out 2-element array of float TessLevelInner) +0:36 Constant: +0:36 1 (const int) +0:36 Constant: +0:36 1.300000 +0:38 Test condition and select ( temp void) +0:38 Condition +0:38 Compare Greater Than ( temp bool) +0:38 'a' ( temp int) +0:38 Constant: +0:38 10 (const int) +0:38 true case +0:39 Barrier ( global void) +0:38 false case +0:41 Barrier ( global void) +0:43 Barrier ( global void) +0:47 Loop with condition not tested first +0:47 Loop Condition +0:47 Compare Greater Than ( temp bool) +0:47 'a' ( temp int) +0:47 Constant: +0:47 10 (const int) +0:47 Loop Body +0:46 Sequence +0:46 Barrier ( global void) +0:49 switch +0:49 condition +0:49 'a' ( temp int) +0:49 body +0:49 Sequence +0:50 default: +0:? Sequence +0:51 Barrier ( global void) +0:52 Branch: Break +0:54 Test condition and select ( temp int) +0:54 Condition +0:54 Compare Less Than ( temp bool) +0:54 'a' ( temp int) +0:54 Constant: +0:54 12 (const int) +0:54 true case +0:54 'a' ( temp int) +0:54 false case +0:54 Comma ( temp int) +0:54 Barrier ( global void) +0:54 'a' ( temp int) +0:56 Sequence +0:56 Barrier ( global void) +0:59 Branch: Return +0:61 Barrier ( global void) +0:? Linker Objects +0:? 'gl_out' ( out 4-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:? 'outa' ( global 4-element array of int) +0:? 'patchIn' ( patch in 4-component vector of float) +0:? 'patchOut' ( patch out 4-component vector of float) +0:? 'ina' ( in 2-component vector of float) +0:? 'inb' ( in 32-element array of 2-component vector of float) +0:? 'inc' ( in 32-element array of 2-component vector of float) +0:? 'ind' ( in 32-element array of 2-component vector of float) +0:? 'ivla' (layout( location=3) in 32-element array of 4-component vector of float) +0:? 'ivlb' (layout( location=4) in 32-element array of 4-component vector of float) +0:? 'ivlc' (layout( location=4) in 32-element array of 4-component vector of float) +0:? 'ovla' (layout( location=3) out 4-element array of 4-component vector of float) +0:? 'ovlb' (layout( location=4) out 4-element array of 4-component vector of float) +0:? 'ovlc' (layout( location=4) out 4-element array of 4-component vector of float) +0:? 'pv3' ( noContraction temp 3-component vector of float) +0:? 'pinbi' ( patch out block{ out int a}) +0:? 'badOrder' ( invariant noContraction out 4-element array of 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/400.tese.out b/deps/glslang/Test/baseResults/400.tese.out new file mode 100644 index 00000000..9580e857 --- /dev/null +++ b/deps/glslang/Test/baseResults/400.tese.out @@ -0,0 +1,295 @@ +400.tese +ERROR: 0:3: 'vertices' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:5: 'triangles' : cannot change previously set input primitive +ERROR: 0:6: 'isolines' : cannot change previously set input primitive +ERROR: 0:8: 'ccw' : cannot change previously set vertex order +ERROR: 0:12: 'equal_spacing' : cannot change previously set vertex spacing +ERROR: 0:13: 'fractional_even_spacing' : cannot change previously set vertex spacing +ERROR: 0:18: 'patch' : can only use on input in tessellation-evaluation shader +ERROR: 0:22: 'barrier' : no matching overloaded function found +ERROR: 0:47: 'patch' : cannot use interpolation qualifiers with patch +ERROR: 0:48: 'patch' : cannot use interpolation qualifiers with patch +ERROR: 0:49: 'patch' : cannot use interpolation qualifiers with patch +ERROR: 0:50: '' : can only have one auxiliary qualifier (centroid, patch, and sample) +ERROR: 0:59: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use +ERROR: 0:64: 'quads' : cannot apply to 'out' +ERROR: 0:64: 'cw' : can only apply to 'in' +ERROR: 0:65: 'triangles' : cannot apply to 'out' +ERROR: 0:66: 'isolines' : cannot apply to 'out' +ERROR: 0:67: 'cw' : can only apply to 'in' +ERROR: 0:68: 'fractional_odd_spacing' : can only apply to 'in' +ERROR: 0:69: 'equal_spacing' : can only apply to 'in' +ERROR: 0:70: 'fractional_even_spacing' : can only apply to 'in' +ERROR: 0:71: 'point_mode' : can only apply to 'in' +ERROR: 0:73: 'in' : type must be an array: ina +ERROR: 0:75: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized +ERROR: 0:78: 'in' : type must be an array: bla +ERROR: 0:86: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized +ERROR: 0:96: 'location' : overlapping use of location 24 +ERROR: 0:99: 'location' : overlapping use of location 24 +ERROR: 0:101: 'gl_TessLevelOuter' : identifiers starting with "gl_" are reserved +ERROR: 0:109: 'gl_DeviceIndex' : required extension not requested: GL_EXT_device_group +ERROR: 0:110: 'gl_ViewIndex' : required extension not requested: GL_EXT_multiview +ERROR: 31 compilation errors. No code generated. + + +Shader version: 400 +Requested GL_ARB_separate_shader_objects +Requested GL_EXT_device_group +Requested GL_EXT_multiview +input primitive = quads +vertex spacing = fractional_odd_spacing +triangle order = cw +using point mode +ERROR: node is still EOpNull! +0:20 Function Definition: main( ( global void) +0:20 Function Parameters: +0:22 Sequence +0:22 Constant: +0:22 0.000000 +0:24 Sequence +0:24 move second child to first child ( temp int) +0:24 'a' ( temp int) +0:24 Constant: +0:24 1512 (const int) +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of float) +0:32 'p' ( temp 4-component vector of float) +0:32 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:32 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:32 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 0 (const int) +0:33 Sequence +0:33 move second child to first child ( temp float) +0:33 'ps' ( temp float) +0:33 gl_PointSize: direct index for structure ( in float PointSize) +0:33 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 1 (const int) +0:34 Sequence +0:34 move second child to first child ( temp float) +0:34 'cd' ( temp float) +0:34 direct index ( temp float ClipDistance) +0:34 gl_ClipDistance: direct index for structure ( in unsized 3-element array of float ClipDistance) +0:34 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:34 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:34 Constant: +0:34 1 (const int) +0:34 Constant: +0:34 2 (const int) +0:34 Constant: +0:34 2 (const int) +0:36 Sequence +0:36 move second child to first child ( temp int) +0:36 'pvi' ( temp int) +0:36 'gl_PatchVerticesIn' ( in int PatchVertices) +0:37 Sequence +0:37 move second child to first child ( temp int) +0:37 'pid' ( temp int) +0:37 'gl_PrimitiveID' ( in int PrimitiveID) +0:38 Sequence +0:38 move second child to first child ( temp 3-component vector of float) +0:38 'tc' ( temp 3-component vector of float) +0:38 'gl_TessCoord' ( in 3-component vector of float TessCoord) +0:39 Sequence +0:39 move second child to first child ( temp float) +0:39 'tlo' ( temp float) +0:39 direct index ( patch temp float TessLevelOuter) +0:39 'gl_TessLevelOuter' ( patch in 4-element array of float TessLevelOuter) +0:39 Constant: +0:39 3 (const int) +0:40 Sequence +0:40 move second child to first child ( temp float) +0:40 'tli' ( temp float) +0:40 direct index ( patch temp float TessLevelInner) +0:40 'gl_TessLevelInner' ( patch in 2-element array of float TessLevelInner) +0:40 Constant: +0:40 1 (const int) +0:42 move second child to first child ( temp 4-component vector of float) +0:42 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:42 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:42 Constant: +0:42 0 (const uint) +0:42 'p' ( temp 4-component vector of float) +0:43 move second child to first child ( temp float) +0:43 gl_PointSize: direct index for structure ( gl_PointSize float PointSize) +0:43 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:43 Constant: +0:43 1 (const uint) +0:43 'ps' ( temp float) +0:44 move second child to first child ( temp float) +0:44 direct index ( temp float ClipDistance) +0:44 gl_ClipDistance: direct index for structure ( out unsized 3-element array of float ClipDistance) +0:44 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:44 Constant: +0:44 2 (const uint) +0:44 Constant: +0:44 2 (const int) +0:44 'cd' ( temp float) +0:107 Function Definition: devi( ( global void) +0:107 Function Parameters: +0:109 Sequence +0:109 'gl_DeviceIndex' ( in int DeviceIndex) +0:110 'gl_ViewIndex' ( in int ViewIndex) +0:121 Function Definition: devie( ( global void) +0:121 Function Parameters: +0:123 Sequence +0:123 'gl_DeviceIndex' ( in int DeviceIndex) +0:124 'gl_ViewIndex' ( in int ViewIndex) +0:? Linker Objects +0:? 'patchIn' ( patch in 4-component vector of float) +0:? 'patchOut' ( patch out 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:? 'badp1' ( smooth patch in 4-component vector of float) +0:? 'badp2' ( flat patch in 4-component vector of float) +0:? 'badp3' ( noperspective patch in 4-component vector of float) +0:? 'badp4' ( patch sample in 3-component vector of float) +0:? 'gl_in' ( in 32-element array of block{ in 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'ina' ( in 2-component vector of float) +0:? 'inb' ( in 32-element array of 2-component vector of float) +0:? 'inc' ( in 32-element array of 2-component vector of float) +0:? 'ind' ( in 32-element array of 2-component vector of float) +0:? 'bla' ( in block{ in int f}) +0:? 'blb' ( in 32-element array of block{ in int f}) +0:? 'blc' ( in 32-element array of block{ in int f}) +0:? 'bld' ( in 32-element array of block{ in int f}) +0:? 'ivla' (layout( location=23) in 32-element array of 4-component vector of float) +0:? 'ivlb' (layout( location=24) in 32-element array of 4-component vector of float) +0:? 'ivlc' (layout( location=24) in 32-element array of 4-component vector of float) +0:? 'ovla' (layout( location=23) out 2-element array of 4-component vector of float) +0:? 'ovlb' (layout( location=24) out 2-element array of 4-component vector of float) +0:? 'pinbi' ( patch in block{ in int a}) + + +Linked tessellation evaluation stage: + + +Shader version: 400 +Requested GL_ARB_separate_shader_objects +Requested GL_EXT_device_group +Requested GL_EXT_multiview +input primitive = quads +vertex spacing = fractional_odd_spacing +triangle order = cw +using point mode +ERROR: node is still EOpNull! +0:20 Function Definition: main( ( global void) +0:20 Function Parameters: +0:22 Sequence +0:22 Constant: +0:22 0.000000 +0:24 Sequence +0:24 move second child to first child ( temp int) +0:24 'a' ( temp int) +0:24 Constant: +0:24 1512 (const int) +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of float) +0:32 'p' ( temp 4-component vector of float) +0:32 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:32 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:32 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 0 (const int) +0:33 Sequence +0:33 move second child to first child ( temp float) +0:33 'ps' ( temp float) +0:33 gl_PointSize: direct index for structure ( in float PointSize) +0:33 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 1 (const int) +0:34 Sequence +0:34 move second child to first child ( temp float) +0:34 'cd' ( temp float) +0:34 direct index ( temp float ClipDistance) +0:34 gl_ClipDistance: direct index for structure ( in 3-element array of float ClipDistance) +0:34 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:34 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:34 Constant: +0:34 1 (const int) +0:34 Constant: +0:34 2 (const int) +0:34 Constant: +0:34 2 (const int) +0:36 Sequence +0:36 move second child to first child ( temp int) +0:36 'pvi' ( temp int) +0:36 'gl_PatchVerticesIn' ( in int PatchVertices) +0:37 Sequence +0:37 move second child to first child ( temp int) +0:37 'pid' ( temp int) +0:37 'gl_PrimitiveID' ( in int PrimitiveID) +0:38 Sequence +0:38 move second child to first child ( temp 3-component vector of float) +0:38 'tc' ( temp 3-component vector of float) +0:38 'gl_TessCoord' ( in 3-component vector of float TessCoord) +0:39 Sequence +0:39 move second child to first child ( temp float) +0:39 'tlo' ( temp float) +0:39 direct index ( patch temp float TessLevelOuter) +0:39 'gl_TessLevelOuter' ( patch in 4-element array of float TessLevelOuter) +0:39 Constant: +0:39 3 (const int) +0:40 Sequence +0:40 move second child to first child ( temp float) +0:40 'tli' ( temp float) +0:40 direct index ( patch temp float TessLevelInner) +0:40 'gl_TessLevelInner' ( patch in 2-element array of float TessLevelInner) +0:40 Constant: +0:40 1 (const int) +0:42 move second child to first child ( temp 4-component vector of float) +0:42 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:42 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 3-element array of float ClipDistance gl_ClipDistance}) +0:42 Constant: +0:42 0 (const uint) +0:42 'p' ( temp 4-component vector of float) +0:43 move second child to first child ( temp float) +0:43 gl_PointSize: direct index for structure ( gl_PointSize float PointSize) +0:43 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 3-element array of float ClipDistance gl_ClipDistance}) +0:43 Constant: +0:43 1 (const uint) +0:43 'ps' ( temp float) +0:44 move second child to first child ( temp float) +0:44 direct index ( temp float ClipDistance) +0:44 gl_ClipDistance: direct index for structure ( out 3-element array of float ClipDistance) +0:44 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 3-element array of float ClipDistance gl_ClipDistance}) +0:44 Constant: +0:44 2 (const uint) +0:44 Constant: +0:44 2 (const int) +0:44 'cd' ( temp float) +0:? Linker Objects +0:? 'patchIn' ( patch in 4-component vector of float) +0:? 'patchOut' ( patch out 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 3-element array of float ClipDistance gl_ClipDistance}) +0:? 'badp1' ( smooth patch in 4-component vector of float) +0:? 'badp2' ( flat patch in 4-component vector of float) +0:? 'badp3' ( noperspective patch in 4-component vector of float) +0:? 'badp4' ( patch sample in 3-component vector of float) +0:? 'gl_in' ( in 32-element array of block{ in 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'ina' ( in 2-component vector of float) +0:? 'inb' ( in 32-element array of 2-component vector of float) +0:? 'inc' ( in 32-element array of 2-component vector of float) +0:? 'ind' ( in 32-element array of 2-component vector of float) +0:? 'bla' ( in block{ in int f}) +0:? 'blb' ( in 32-element array of block{ in int f}) +0:? 'blc' ( in 32-element array of block{ in int f}) +0:? 'bld' ( in 32-element array of block{ in int f}) +0:? 'ivla' (layout( location=23) in 32-element array of 4-component vector of float) +0:? 'ivlb' (layout( location=24) in 32-element array of 4-component vector of float) +0:? 'ivlc' (layout( location=24) in 32-element array of 4-component vector of float) +0:? 'ovla' (layout( location=23) out 2-element array of 4-component vector of float) +0:? 'ovlb' (layout( location=24) out 2-element array of 4-component vector of float) +0:? 'pinbi' ( patch in block{ in int a}) + diff --git a/deps/glslang/Test/baseResults/400.vert.out b/deps/glslang/Test/baseResults/400.vert.out new file mode 100644 index 00000000..05f58e2d --- /dev/null +++ b/deps/glslang/Test/baseResults/400.vert.out @@ -0,0 +1,555 @@ +400.vert +ERROR: 0:3: 'vertex-shader `double` type input' : not supported for this version or the enabled extensions +ERROR: 0:4: 'vertex-shader `double` type input' : not supported for this version or the enabled extensions +ERROR: 0:5: 'vertex-shader `double` type input' : not supported for this version or the enabled extensions +ERROR: 0:70: 'foo3' : no matching overloaded function found +ERROR: 0:76: 'foo3' : ambiguous best function under implicit type conversion +ERROR: 0:77: 'foo3' : ambiguous best function under implicit type conversion +ERROR: 0:78: 'foo3' : ambiguous best function under implicit type conversion +ERROR: 0:81: 'foo3' : ambiguous best function under implicit type conversion +ERROR: 0:82: 'foo3' : ambiguous best function under implicit type conversion +ERROR: 0:83: 'foo3' : ambiguous best function under implicit type conversion +ERROR: 0:86: 'foo3' : ambiguous best function under implicit type conversion +ERROR: 0:87: 'foo3' : ambiguous best function under implicit type conversion +ERROR: 0:88: 'foo3' : ambiguous best function under implicit type conversion +ERROR: 13 compilation errors. No code generated. + + +Shader version: 400 +ERROR: node is still EOpNull! +0:8 Function Definition: foo1(d1;u1; ( global void) +0:8 Function Parameters: +0:8 'a' ( in double) +0:8 'b' ( in uint) +0:9 Function Definition: foo1(d1;i1; ( global void) +0:9 Function Parameters: +0:9 'a' ( in double) +0:9 'b' ( in int) +0:10 Function Definition: foo1(d1;f1; ( global void) +0:10 Function Parameters: +0:10 'a' ( in double) +0:10 'b' ( in float) +0:11 Function Definition: foo1(d1;d1; ( global void) +0:11 Function Parameters: +0:11 'a' ( in double) +0:11 'b' ( in double) +0:13 Function Definition: foo2(d1;f1; ( global void) +0:13 Function Parameters: +0:13 'a' ( in double) +0:13 'b' ( in float) +0:14 Function Definition: foo2(d1;d1; ( global void) +0:14 Function Parameters: +0:14 'a' ( in double) +0:14 'b' ( in double) +0:16 Function Definition: foo3(d1;f1; ( global void) +0:16 Function Parameters: +0:16 'a' ( in double) +0:16 'b' ( in float) +0:17 Function Definition: foo3(f1;d1; ( global void) +0:17 Function Parameters: +0:17 'a' ( in float) +0:17 'b' ( in double) +0:19 Function Definition: ftd(i1;f1;d1; ( global void) +0:19 Function Parameters: +0:19 '' ( in int) +0:19 '' ( in float) +0:19 '' ( in double) +0:20 Function Definition: ftd(u1;f1;d1; ( global void) +0:20 Function Parameters: +0:20 '' ( in uint) +0:20 '' ( in float) +0:20 '' ( in double) +0:21 Function Definition: ftd(f1;d1;d1; ( global void) +0:21 Function Parameters: +0:21 '' ( in float) +0:21 '' ( in double) +0:21 '' ( in double) +0:23 Function Definition: main( ( global void) +0:23 Function Parameters: +0:? Sequence +0:30 Function Call: foo1(d1;d1; ( global void) +0:30 'd' ( temp double) +0:30 'd' ( temp double) +0:31 Function Call: foo1(d1;u1; ( global void) +0:31 'd' ( temp double) +0:31 'u' ( temp uint) +0:32 Function Call: foo1(d1;i1; ( global void) +0:32 'd' ( temp double) +0:32 'i' ( temp int) +0:33 Function Call: foo1(d1;f1; ( global void) +0:33 'd' ( temp double) +0:33 'f' ( temp float) +0:35 Function Call: foo1(d1;d1; ( global void) +0:35 Convert float to double ( temp double) +0:35 'f' ( temp float) +0:35 'd' ( temp double) +0:36 Function Call: foo1(d1;u1; ( global void) +0:36 Convert float to double ( temp double) +0:36 'f' ( temp float) +0:36 'u' ( temp uint) +0:37 Function Call: foo1(d1;i1; ( global void) +0:37 Convert float to double ( temp double) +0:37 'f' ( temp float) +0:37 'i' ( temp int) +0:38 Function Call: foo1(d1;f1; ( global void) +0:38 Convert float to double ( temp double) +0:38 'f' ( temp float) +0:38 'f' ( temp float) +0:40 Function Call: foo1(d1;d1; ( global void) +0:40 Convert uint to double ( temp double) +0:40 'u' ( temp uint) +0:40 'd' ( temp double) +0:41 Function Call: foo1(d1;u1; ( global void) +0:41 Convert uint to double ( temp double) +0:41 'u' ( temp uint) +0:41 'u' ( temp uint) +0:42 Function Call: foo1(d1;i1; ( global void) +0:42 Convert uint to double ( temp double) +0:42 'u' ( temp uint) +0:42 'i' ( temp int) +0:43 Function Call: foo1(d1;f1; ( global void) +0:43 Convert uint to double ( temp double) +0:43 'u' ( temp uint) +0:43 'f' ( temp float) +0:45 Function Call: foo1(d1;d1; ( global void) +0:45 Convert int to double ( temp double) +0:45 'i' ( temp int) +0:45 'd' ( temp double) +0:46 Function Call: foo1(d1;u1; ( global void) +0:46 Convert int to double ( temp double) +0:46 'i' ( temp int) +0:46 'u' ( temp uint) +0:47 Function Call: foo1(d1;i1; ( global void) +0:47 Convert int to double ( temp double) +0:47 'i' ( temp int) +0:47 'i' ( temp int) +0:48 Function Call: foo1(d1;f1; ( global void) +0:48 Convert int to double ( temp double) +0:48 'i' ( temp int) +0:48 'f' ( temp float) +0:50 Function Call: foo2(d1;d1; ( global void) +0:50 'd' ( temp double) +0:50 'd' ( temp double) +0:51 Function Call: foo2(d1;f1; ( global void) +0:51 'd' ( temp double) +0:51 Convert uint to float ( temp float) +0:51 'u' ( temp uint) +0:52 Function Call: foo2(d1;f1; ( global void) +0:52 'd' ( temp double) +0:52 Convert int to float ( temp float) +0:52 'i' ( temp int) +0:53 Function Call: foo2(d1;f1; ( global void) +0:53 'd' ( temp double) +0:53 'f' ( temp float) +0:55 Function Call: foo2(d1;d1; ( global void) +0:55 Convert float to double ( temp double) +0:55 'f' ( temp float) +0:55 'd' ( temp double) +0:56 Function Call: foo2(d1;f1; ( global void) +0:56 Convert float to double ( temp double) +0:56 'f' ( temp float) +0:56 Convert uint to float ( temp float) +0:56 'u' ( temp uint) +0:57 Function Call: foo2(d1;f1; ( global void) +0:57 Convert float to double ( temp double) +0:57 'f' ( temp float) +0:57 Convert int to float ( temp float) +0:57 'i' ( temp int) +0:58 Function Call: foo2(d1;f1; ( global void) +0:58 Convert float to double ( temp double) +0:58 'f' ( temp float) +0:58 'f' ( temp float) +0:60 Function Call: foo2(d1;d1; ( global void) +0:60 Convert uint to double ( temp double) +0:60 'u' ( temp uint) +0:60 'd' ( temp double) +0:61 Function Call: foo2(d1;f1; ( global void) +0:61 Convert uint to double ( temp double) +0:61 'u' ( temp uint) +0:61 Convert uint to float ( temp float) +0:61 'u' ( temp uint) +0:62 Function Call: foo2(d1;f1; ( global void) +0:62 Convert uint to double ( temp double) +0:62 'u' ( temp uint) +0:62 Convert int to float ( temp float) +0:62 'i' ( temp int) +0:63 Function Call: foo2(d1;f1; ( global void) +0:63 Convert uint to double ( temp double) +0:63 'u' ( temp uint) +0:63 'f' ( temp float) +0:65 Function Call: foo2(d1;d1; ( global void) +0:65 Convert int to double ( temp double) +0:65 'i' ( temp int) +0:65 'd' ( temp double) +0:66 Function Call: foo2(d1;f1; ( global void) +0:66 Convert int to double ( temp double) +0:66 'i' ( temp int) +0:66 Convert uint to float ( temp float) +0:66 'u' ( temp uint) +0:67 Function Call: foo2(d1;f1; ( global void) +0:67 Convert int to double ( temp double) +0:67 'i' ( temp int) +0:67 Convert int to float ( temp float) +0:67 'i' ( temp int) +0:68 Function Call: foo2(d1;f1; ( global void) +0:68 Convert int to double ( temp double) +0:68 'i' ( temp int) +0:68 'f' ( temp float) +0:70 Constant: +0:70 0.000000 +0:71 Function Call: foo3(d1;f1; ( global void) +0:71 'd' ( temp double) +0:71 Convert uint to float ( temp float) +0:71 'u' ( temp uint) +0:72 Function Call: foo3(d1;f1; ( global void) +0:72 'd' ( temp double) +0:72 Convert int to float ( temp float) +0:72 'i' ( temp int) +0:73 Function Call: foo3(d1;f1; ( global void) +0:73 'd' ( temp double) +0:73 'f' ( temp float) +0:75 Function Call: foo3(f1;d1; ( global void) +0:75 'f' ( temp float) +0:75 'd' ( temp double) +0:76 Function Call: foo3(d1;f1; ( global void) +0:76 Convert float to double ( temp double) +0:76 'f' ( temp float) +0:76 Convert uint to float ( temp float) +0:76 'u' ( temp uint) +0:77 Function Call: foo3(d1;f1; ( global void) +0:77 Convert float to double ( temp double) +0:77 'f' ( temp float) +0:77 Convert int to float ( temp float) +0:77 'i' ( temp int) +0:78 Function Call: foo3(d1;f1; ( global void) +0:78 Convert float to double ( temp double) +0:78 'f' ( temp float) +0:78 'f' ( temp float) +0:80 Function Call: foo3(f1;d1; ( global void) +0:80 Convert uint to float ( temp float) +0:80 'u' ( temp uint) +0:80 'd' ( temp double) +0:81 Function Call: foo3(d1;f1; ( global void) +0:81 Convert uint to double ( temp double) +0:81 'u' ( temp uint) +0:81 Convert uint to float ( temp float) +0:81 'u' ( temp uint) +0:82 Function Call: foo3(d1;f1; ( global void) +0:82 Convert uint to double ( temp double) +0:82 'u' ( temp uint) +0:82 Convert int to float ( temp float) +0:82 'i' ( temp int) +0:83 Function Call: foo3(d1;f1; ( global void) +0:83 Convert uint to double ( temp double) +0:83 'u' ( temp uint) +0:83 'f' ( temp float) +0:85 Function Call: foo3(f1;d1; ( global void) +0:85 Convert int to float ( temp float) +0:85 'i' ( temp int) +0:85 'd' ( temp double) +0:86 Function Call: foo3(d1;f1; ( global void) +0:86 Convert int to double ( temp double) +0:86 'i' ( temp int) +0:86 Convert uint to float ( temp float) +0:86 'u' ( temp uint) +0:87 Function Call: foo3(d1;f1; ( global void) +0:87 Convert int to double ( temp double) +0:87 'i' ( temp int) +0:87 Convert int to float ( temp float) +0:87 'i' ( temp int) +0:88 Function Call: foo3(d1;f1; ( global void) +0:88 Convert int to double ( temp double) +0:88 'i' ( temp int) +0:88 'f' ( temp float) +0:90 Function Call: ftd(i1;f1;d1; ( global void) +0:90 'i' ( temp int) +0:90 'f' ( temp float) +0:90 Convert float to double ( temp double) +0:90 'f' ( temp float) +0:91 Function Call: ftd(u1;f1;d1; ( global void) +0:91 'u' ( temp uint) +0:91 'f' ( temp float) +0:91 Convert float to double ( temp double) +0:91 'f' ( temp float) +0:97 Function Definition: tf( ( global void) +0:97 Function Parameters: +0:? Sequence +0:104 Function Call: itf(i1;f1;i1; ( global void) +0:104 'i' ( temp int) +0:104 Convert int to float ( temp float) +0:104 'i' ( temp int) +0:104 'i' ( temp int) +0:105 Function Call: itf(i1;f1;i1; ( global void) +0:105 'i' ( temp int) +0:105 Convert uint to float ( temp float) +0:105 'u' ( temp uint) +0:105 'i' ( temp int) +0:? Linker Objects +0:? 'd' ( in double) +0:? 'd3' ( in 3-component vector of double) +0:? 'dm4' ( in 4X4 matrix of double) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 400 +ERROR: node is still EOpNull! +0:8 Function Definition: foo1(d1;u1; ( global void) +0:8 Function Parameters: +0:8 'a' ( in double) +0:8 'b' ( in uint) +0:9 Function Definition: foo1(d1;i1; ( global void) +0:9 Function Parameters: +0:9 'a' ( in double) +0:9 'b' ( in int) +0:10 Function Definition: foo1(d1;f1; ( global void) +0:10 Function Parameters: +0:10 'a' ( in double) +0:10 'b' ( in float) +0:11 Function Definition: foo1(d1;d1; ( global void) +0:11 Function Parameters: +0:11 'a' ( in double) +0:11 'b' ( in double) +0:13 Function Definition: foo2(d1;f1; ( global void) +0:13 Function Parameters: +0:13 'a' ( in double) +0:13 'b' ( in float) +0:14 Function Definition: foo2(d1;d1; ( global void) +0:14 Function Parameters: +0:14 'a' ( in double) +0:14 'b' ( in double) +0:16 Function Definition: foo3(d1;f1; ( global void) +0:16 Function Parameters: +0:16 'a' ( in double) +0:16 'b' ( in float) +0:17 Function Definition: foo3(f1;d1; ( global void) +0:17 Function Parameters: +0:17 'a' ( in float) +0:17 'b' ( in double) +0:19 Function Definition: ftd(i1;f1;d1; ( global void) +0:19 Function Parameters: +0:19 '' ( in int) +0:19 '' ( in float) +0:19 '' ( in double) +0:20 Function Definition: ftd(u1;f1;d1; ( global void) +0:20 Function Parameters: +0:20 '' ( in uint) +0:20 '' ( in float) +0:20 '' ( in double) +0:23 Function Definition: main( ( global void) +0:23 Function Parameters: +0:? Sequence +0:30 Function Call: foo1(d1;d1; ( global void) +0:30 'd' ( temp double) +0:30 'd' ( temp double) +0:31 Function Call: foo1(d1;u1; ( global void) +0:31 'd' ( temp double) +0:31 'u' ( temp uint) +0:32 Function Call: foo1(d1;i1; ( global void) +0:32 'd' ( temp double) +0:32 'i' ( temp int) +0:33 Function Call: foo1(d1;f1; ( global void) +0:33 'd' ( temp double) +0:33 'f' ( temp float) +0:35 Function Call: foo1(d1;d1; ( global void) +0:35 Convert float to double ( temp double) +0:35 'f' ( temp float) +0:35 'd' ( temp double) +0:36 Function Call: foo1(d1;u1; ( global void) +0:36 Convert float to double ( temp double) +0:36 'f' ( temp float) +0:36 'u' ( temp uint) +0:37 Function Call: foo1(d1;i1; ( global void) +0:37 Convert float to double ( temp double) +0:37 'f' ( temp float) +0:37 'i' ( temp int) +0:38 Function Call: foo1(d1;f1; ( global void) +0:38 Convert float to double ( temp double) +0:38 'f' ( temp float) +0:38 'f' ( temp float) +0:40 Function Call: foo1(d1;d1; ( global void) +0:40 Convert uint to double ( temp double) +0:40 'u' ( temp uint) +0:40 'd' ( temp double) +0:41 Function Call: foo1(d1;u1; ( global void) +0:41 Convert uint to double ( temp double) +0:41 'u' ( temp uint) +0:41 'u' ( temp uint) +0:42 Function Call: foo1(d1;i1; ( global void) +0:42 Convert uint to double ( temp double) +0:42 'u' ( temp uint) +0:42 'i' ( temp int) +0:43 Function Call: foo1(d1;f1; ( global void) +0:43 Convert uint to double ( temp double) +0:43 'u' ( temp uint) +0:43 'f' ( temp float) +0:45 Function Call: foo1(d1;d1; ( global void) +0:45 Convert int to double ( temp double) +0:45 'i' ( temp int) +0:45 'd' ( temp double) +0:46 Function Call: foo1(d1;u1; ( global void) +0:46 Convert int to double ( temp double) +0:46 'i' ( temp int) +0:46 'u' ( temp uint) +0:47 Function Call: foo1(d1;i1; ( global void) +0:47 Convert int to double ( temp double) +0:47 'i' ( temp int) +0:47 'i' ( temp int) +0:48 Function Call: foo1(d1;f1; ( global void) +0:48 Convert int to double ( temp double) +0:48 'i' ( temp int) +0:48 'f' ( temp float) +0:50 Function Call: foo2(d1;d1; ( global void) +0:50 'd' ( temp double) +0:50 'd' ( temp double) +0:51 Function Call: foo2(d1;f1; ( global void) +0:51 'd' ( temp double) +0:51 Convert uint to float ( temp float) +0:51 'u' ( temp uint) +0:52 Function Call: foo2(d1;f1; ( global void) +0:52 'd' ( temp double) +0:52 Convert int to float ( temp float) +0:52 'i' ( temp int) +0:53 Function Call: foo2(d1;f1; ( global void) +0:53 'd' ( temp double) +0:53 'f' ( temp float) +0:55 Function Call: foo2(d1;d1; ( global void) +0:55 Convert float to double ( temp double) +0:55 'f' ( temp float) +0:55 'd' ( temp double) +0:56 Function Call: foo2(d1;f1; ( global void) +0:56 Convert float to double ( temp double) +0:56 'f' ( temp float) +0:56 Convert uint to float ( temp float) +0:56 'u' ( temp uint) +0:57 Function Call: foo2(d1;f1; ( global void) +0:57 Convert float to double ( temp double) +0:57 'f' ( temp float) +0:57 Convert int to float ( temp float) +0:57 'i' ( temp int) +0:58 Function Call: foo2(d1;f1; ( global void) +0:58 Convert float to double ( temp double) +0:58 'f' ( temp float) +0:58 'f' ( temp float) +0:60 Function Call: foo2(d1;d1; ( global void) +0:60 Convert uint to double ( temp double) +0:60 'u' ( temp uint) +0:60 'd' ( temp double) +0:61 Function Call: foo2(d1;f1; ( global void) +0:61 Convert uint to double ( temp double) +0:61 'u' ( temp uint) +0:61 Convert uint to float ( temp float) +0:61 'u' ( temp uint) +0:62 Function Call: foo2(d1;f1; ( global void) +0:62 Convert uint to double ( temp double) +0:62 'u' ( temp uint) +0:62 Convert int to float ( temp float) +0:62 'i' ( temp int) +0:63 Function Call: foo2(d1;f1; ( global void) +0:63 Convert uint to double ( temp double) +0:63 'u' ( temp uint) +0:63 'f' ( temp float) +0:65 Function Call: foo2(d1;d1; ( global void) +0:65 Convert int to double ( temp double) +0:65 'i' ( temp int) +0:65 'd' ( temp double) +0:66 Function Call: foo2(d1;f1; ( global void) +0:66 Convert int to double ( temp double) +0:66 'i' ( temp int) +0:66 Convert uint to float ( temp float) +0:66 'u' ( temp uint) +0:67 Function Call: foo2(d1;f1; ( global void) +0:67 Convert int to double ( temp double) +0:67 'i' ( temp int) +0:67 Convert int to float ( temp float) +0:67 'i' ( temp int) +0:68 Function Call: foo2(d1;f1; ( global void) +0:68 Convert int to double ( temp double) +0:68 'i' ( temp int) +0:68 'f' ( temp float) +0:70 Constant: +0:70 0.000000 +0:71 Function Call: foo3(d1;f1; ( global void) +0:71 'd' ( temp double) +0:71 Convert uint to float ( temp float) +0:71 'u' ( temp uint) +0:72 Function Call: foo3(d1;f1; ( global void) +0:72 'd' ( temp double) +0:72 Convert int to float ( temp float) +0:72 'i' ( temp int) +0:73 Function Call: foo3(d1;f1; ( global void) +0:73 'd' ( temp double) +0:73 'f' ( temp float) +0:75 Function Call: foo3(f1;d1; ( global void) +0:75 'f' ( temp float) +0:75 'd' ( temp double) +0:76 Function Call: foo3(d1;f1; ( global void) +0:76 Convert float to double ( temp double) +0:76 'f' ( temp float) +0:76 Convert uint to float ( temp float) +0:76 'u' ( temp uint) +0:77 Function Call: foo3(d1;f1; ( global void) +0:77 Convert float to double ( temp double) +0:77 'f' ( temp float) +0:77 Convert int to float ( temp float) +0:77 'i' ( temp int) +0:78 Function Call: foo3(d1;f1; ( global void) +0:78 Convert float to double ( temp double) +0:78 'f' ( temp float) +0:78 'f' ( temp float) +0:80 Function Call: foo3(f1;d1; ( global void) +0:80 Convert uint to float ( temp float) +0:80 'u' ( temp uint) +0:80 'd' ( temp double) +0:81 Function Call: foo3(d1;f1; ( global void) +0:81 Convert uint to double ( temp double) +0:81 'u' ( temp uint) +0:81 Convert uint to float ( temp float) +0:81 'u' ( temp uint) +0:82 Function Call: foo3(d1;f1; ( global void) +0:82 Convert uint to double ( temp double) +0:82 'u' ( temp uint) +0:82 Convert int to float ( temp float) +0:82 'i' ( temp int) +0:83 Function Call: foo3(d1;f1; ( global void) +0:83 Convert uint to double ( temp double) +0:83 'u' ( temp uint) +0:83 'f' ( temp float) +0:85 Function Call: foo3(f1;d1; ( global void) +0:85 Convert int to float ( temp float) +0:85 'i' ( temp int) +0:85 'd' ( temp double) +0:86 Function Call: foo3(d1;f1; ( global void) +0:86 Convert int to double ( temp double) +0:86 'i' ( temp int) +0:86 Convert uint to float ( temp float) +0:86 'u' ( temp uint) +0:87 Function Call: foo3(d1;f1; ( global void) +0:87 Convert int to double ( temp double) +0:87 'i' ( temp int) +0:87 Convert int to float ( temp float) +0:87 'i' ( temp int) +0:88 Function Call: foo3(d1;f1; ( global void) +0:88 Convert int to double ( temp double) +0:88 'i' ( temp int) +0:88 'f' ( temp float) +0:90 Function Call: ftd(i1;f1;d1; ( global void) +0:90 'i' ( temp int) +0:90 'f' ( temp float) +0:90 Convert float to double ( temp double) +0:90 'f' ( temp float) +0:91 Function Call: ftd(u1;f1;d1; ( global void) +0:91 'u' ( temp uint) +0:91 'f' ( temp float) +0:91 Convert float to double ( temp double) +0:91 'f' ( temp float) +0:? Linker Objects +0:? 'd' ( in double) +0:? 'd3' ( in 3-component vector of double) +0:? 'dm4' ( in 4X4 matrix of double) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/410.geom.out b/deps/glslang/Test/baseResults/410.geom.out new file mode 100644 index 00000000..ab5ad472 --- /dev/null +++ b/deps/glslang/Test/baseResults/410.geom.out @@ -0,0 +1,82 @@ +410.geom +ERROR: 0:8: 'myIn' : cannot redeclare a built-in block with a user name +ERROR: 0:12: 'gl_myIn' : no declaration found for redeclaration +ERROR: 0:20: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use +ERROR: 0:32: 'gl_Position' : no such field in structure +ERROR: 0:32: '=' : cannot convert from ' temp block{ in float PointSize gl_PointSize}' to ' temp 4-component vector of float' +ERROR: 0:33: 'gl_Position' : member of nameless block was not redeclared +ERROR: 0:33: 'assign' : cannot convert from ' const 4-component vector of float' to 'layout( stream=0) gl_Position void Position' +WARNING: 0:38: 'return' : type conversion on return values was not explicitly allowed until version 420 +ERROR: 7 compilation errors. No code generated. + + +Shader version: 410 +invocations = -1 +max_vertices = -1 +input primitive = none +output primitive = none +ERROR: node is still EOpNull! +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:5 Sequence +0:5 move second child to first child ( temp int) +0:5 'gl_ViewportIndex' (layout( stream=0) out int ViewportIndex) +0:5 Constant: +0:5 7 (const int) +0:28 Function Definition: foo( ( global void) +0:28 Function Parameters: +0:30 Sequence +0:30 Sequence +0:30 move second child to first child ( temp float) +0:30 'p' ( temp float) +0:30 gl_PointSize: direct index for structure ( in float PointSize) +0:30 direct index ( temp block{ in float PointSize gl_PointSize}) +0:30 'gl_in' ( in unsized 2-element array of block{ in float PointSize gl_PointSize}) +0:30 Constant: +0:30 1 (const int) +0:30 Constant: +0:30 0 (const int) +0:31 move second child to first child ( temp float) +0:31 gl_PointSize: direct index for structure (layout( stream=0) gl_PointSize float PointSize) +0:31 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_PointSize float PointSize gl_PointSize, }) +0:31 Constant: +0:31 1 (const uint) +0:31 'p' ( temp float) +0:33 gl_Position: direct index for structure (layout( stream=0) gl_Position void Position) +0:33 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_PointSize float PointSize gl_PointSize, }) +0:33 Constant: +0:33 0 (const uint) +0:36 Function Definition: foo5( ( global float) +0:36 Function Parameters: +0:38 Sequence +0:38 Branch: Return with expression +0:38 Constant: +0:38 4.000000 +0:? Linker Objects +0:? 'gl_in' ( in unsized 2-element array of block{ in float PointSize gl_PointSize}) +0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_PointSize float PointSize gl_PointSize, }) + + +Linked geometry stage: + +ERROR: Linking geometry stage: At least one shader must specify an input layout primitive +ERROR: Linking geometry stage: At least one shader must specify an output layout primitive +ERROR: Linking geometry stage: At least one shader must specify a layout(max_vertices = value) + +Shader version: 410 +invocations = 1 +max_vertices = -1 +input primitive = none +output primitive = none +ERROR: node is still EOpNull! +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:5 Sequence +0:5 move second child to first child ( temp int) +0:5 'gl_ViewportIndex' (layout( stream=0) out int ViewportIndex) +0:5 Constant: +0:5 7 (const int) +0:? Linker Objects +0:? 'gl_in' ( in 2-element array of block{ in float PointSize gl_PointSize}) +0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_PointSize float PointSize gl_PointSize, }) + diff --git a/deps/glslang/Test/baseResults/410.tesc.out b/deps/glslang/Test/baseResults/410.tesc.out new file mode 100644 index 00000000..0a397fdd --- /dev/null +++ b/deps/glslang/Test/baseResults/410.tesc.out @@ -0,0 +1,30 @@ +410.tesc +ERROR: 0:4: 'length' : array must first be sized by a redeclaration or layout qualifier +ERROR: 1 compilation errors. No code generated. + + +Shader version: 400 +vertices = -1 +ERROR: node is still EOpNull! +0:8 Function Definition: main( ( global void) +0:8 Function Parameters: +0:? Linker Objects +0:? 'gl_out' ( out unsized 1-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'outa' ( global 1-element array of int) +0:? 'patchOut' ( patch out 4-component vector of float) + + +Linked tessellation control stage: + +ERROR: Linking tessellation control stage: At least one shader must specify an output layout(vertices=...) + +Shader version: 400 +vertices = -1 +ERROR: node is still EOpNull! +0:8 Function Definition: main( ( global void) +0:8 Function Parameters: +0:? Linker Objects +0:? 'gl_out' ( out 1-element array of block{ out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'outa' ( global 1-element array of int) +0:? 'patchOut' ( patch out 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/410.vert.out b/deps/glslang/Test/baseResults/410.vert.out new file mode 100644 index 00000000..aacdf36c --- /dev/null +++ b/deps/glslang/Test/baseResults/410.vert.out @@ -0,0 +1,27 @@ +410.vert +Shader version: 410 +0:? Sequence +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:? Linker Objects +0:? 'd' ( in double) +0:? 'd3' ( in 3-component vector of double) +0:? 'dm4' ( in 4X4 matrix of double) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 410 +0:? Sequence +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:? Linker Objects +0:? 'd' ( in double) +0:? 'd3' ( in 3-component vector of double) +0:? 'dm4' ( in 4X4 matrix of double) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/420.comp.out b/deps/glslang/Test/baseResults/420.comp.out new file mode 100644 index 00000000..4e091acf --- /dev/null +++ b/deps/glslang/Test/baseResults/420.comp.out @@ -0,0 +1,121 @@ +420.comp +ERROR: 0:3: 'gl_WorkGroupSize' : not supported for this version or the enabled extensions +ERROR: 1 compilation errors. No code generated. + + +Shader version: 420 +Requested GL_ARB_compute_shader +local_size = (2, 4, 6) +ERROR: node is still EOpNull! +0:11 Function Definition: main( ( global void) +0:11 Function Parameters: +0:13 Sequence +0:13 move second child to first child ( temp 3-component vector of float) +0:13 'sfoo' ( shared 3-component vector of float) +0:13 Constant: +0:13 2.000000 +0:13 4.000000 +0:13 6.000000 +0:14 add second child into first child ( temp 3-component vector of float) +0:14 'sfoo' ( shared 3-component vector of float) +0:14 Convert uint to float ( temp 3-component vector of float) +0:14 add ( temp 3-component vector of uint) +0:14 add ( temp 3-component vector of uint) +0:14 add ( temp 3-component vector of uint) +0:14 add ( temp 3-component vector of uint) +0:14 Constant: +0:14 2 (const uint) +0:14 4 (const uint) +0:14 6 (const uint) +0:14 'gl_NumWorkGroups' ( in 3-component vector of uint NumWorkGroups) +0:14 'gl_WorkGroupID' ( in 3-component vector of uint WorkGroupID) +0:14 'gl_LocalInvocationID' ( in 3-component vector of uint LocalInvocationID) +0:14 'gl_GlobalInvocationID' ( in 3-component vector of uint GlobalInvocationID) +0:15 vector scale second child into first child ( temp 3-component vector of float) +0:15 'sfoo' ( shared 3-component vector of float) +0:15 Convert uint to float ( temp float) +0:15 'gl_LocalInvocationIndex' ( in uint LocalInvocationIndex) +0:16 add second child into first child ( temp 3-component vector of float) +0:16 'sfoo' ( shared 3-component vector of float) +0:16 Constant: +0:16 66559.000000 +0:16 66559.000000 +0:16 65599.000000 +0:17 vector scale second child into first child ( temp 3-component vector of float) +0:17 'sfoo' ( shared 3-component vector of float) +0:17 Constant: +0:17 1057.000000 +0:23 Barrier ( global void) +0:24 MemoryBarrier ( global void) +0:25 MemoryBarrierAtomicCounter ( global void) +0:26 MemoryBarrierBuffer ( global void) +0:27 MemoryBarrierImage ( global void) +0:28 MemoryBarrierShared ( global void) +0:29 GroupMemoryBarrier ( global void) +0:? Linker Objects +0:? 'gl_WorkGroupSize' ( const 3-component vector of uint WorkGroupSize) +0:? 2 (const uint) +0:? 4 (const uint) +0:? 6 (const uint) +0:? 'sfoo' ( shared 3-component vector of float) + + +Linked compute stage: + + +Shader version: 420 +Requested GL_ARB_compute_shader +local_size = (2, 4, 6) +ERROR: node is still EOpNull! +0:11 Function Definition: main( ( global void) +0:11 Function Parameters: +0:13 Sequence +0:13 move second child to first child ( temp 3-component vector of float) +0:13 'sfoo' ( shared 3-component vector of float) +0:13 Constant: +0:13 2.000000 +0:13 4.000000 +0:13 6.000000 +0:14 add second child into first child ( temp 3-component vector of float) +0:14 'sfoo' ( shared 3-component vector of float) +0:14 Convert uint to float ( temp 3-component vector of float) +0:14 add ( temp 3-component vector of uint) +0:14 add ( temp 3-component vector of uint) +0:14 add ( temp 3-component vector of uint) +0:14 add ( temp 3-component vector of uint) +0:14 Constant: +0:14 2 (const uint) +0:14 4 (const uint) +0:14 6 (const uint) +0:14 'gl_NumWorkGroups' ( in 3-component vector of uint NumWorkGroups) +0:14 'gl_WorkGroupID' ( in 3-component vector of uint WorkGroupID) +0:14 'gl_LocalInvocationID' ( in 3-component vector of uint LocalInvocationID) +0:14 'gl_GlobalInvocationID' ( in 3-component vector of uint GlobalInvocationID) +0:15 vector scale second child into first child ( temp 3-component vector of float) +0:15 'sfoo' ( shared 3-component vector of float) +0:15 Convert uint to float ( temp float) +0:15 'gl_LocalInvocationIndex' ( in uint LocalInvocationIndex) +0:16 add second child into first child ( temp 3-component vector of float) +0:16 'sfoo' ( shared 3-component vector of float) +0:16 Constant: +0:16 66559.000000 +0:16 66559.000000 +0:16 65599.000000 +0:17 vector scale second child into first child ( temp 3-component vector of float) +0:17 'sfoo' ( shared 3-component vector of float) +0:17 Constant: +0:17 1057.000000 +0:23 Barrier ( global void) +0:24 MemoryBarrier ( global void) +0:25 MemoryBarrierAtomicCounter ( global void) +0:26 MemoryBarrierBuffer ( global void) +0:27 MemoryBarrierImage ( global void) +0:28 MemoryBarrierShared ( global void) +0:29 GroupMemoryBarrier ( global void) +0:? Linker Objects +0:? 'gl_WorkGroupSize' ( const 3-component vector of uint WorkGroupSize) +0:? 2 (const uint) +0:? 4 (const uint) +0:? 6 (const uint) +0:? 'sfoo' ( shared 3-component vector of float) + diff --git a/deps/glslang/Test/baseResults/420.frag.out b/deps/glslang/Test/baseResults/420.frag.out new file mode 100644 index 00000000..ffb8f6d2 --- /dev/null +++ b/deps/glslang/Test/baseResults/420.frag.out @@ -0,0 +1,42 @@ +420.frag +ERROR: 0:4: 'redeclaration' : all redeclarations must use the same depth layout on gl_FragDepth +ERROR: 0:11: 'layout qualifier' : can only apply depth layout to gl_FragDepth +ERROR: 0:12: 'gl_FragDepth' : cannot redeclare after use +ERROR: 0:14: 'atomic_uint' : array must be explicitly sized +ERROR: 4 compilation errors. No code generated. + + +Shader version: 420 +using depth_any +ERROR: node is still EOpNull! +0:6 Function Definition: main( ( global void) +0:6 Function Parameters: +0:8 Sequence +0:8 move second child to first child ( temp float) +0:8 'gl_FragDepth' ( gl_FragDepth float FragDepth) +0:8 Constant: +0:8 0.300000 +0:? Linker Objects +0:? 'gl_FragDepth' ( gl_FragDepth float FragDepth) +0:? 'depth' ( smooth in float) +0:? 'a' (layout( binding=0 offset=0) uniform unsized 1-element array of atomic_uint) + + +Linked fragment stage: + + +Shader version: 420 +using depth_any +ERROR: node is still EOpNull! +0:6 Function Definition: main( ( global void) +0:6 Function Parameters: +0:8 Sequence +0:8 move second child to first child ( temp float) +0:8 'gl_FragDepth' ( gl_FragDepth float FragDepth) +0:8 Constant: +0:8 0.300000 +0:? Linker Objects +0:? 'gl_FragDepth' ( gl_FragDepth float FragDepth) +0:? 'depth' ( smooth in float) +0:? 'a' (layout( binding=0 offset=0) uniform 1-element array of atomic_uint) + diff --git a/deps/glslang/Test/baseResults/420.geom.out b/deps/glslang/Test/baseResults/420.geom.out new file mode 100644 index 00000000..6bf6eb37 --- /dev/null +++ b/deps/glslang/Test/baseResults/420.geom.out @@ -0,0 +1,152 @@ +420.geom +ERROR: 0:9: 'length' : array must first be sized by a redeclaration or layout qualifier +ERROR: 0:11: '[' : array must be sized by a redeclaration or layout qualifier before being indexed with a variable +ERROR: 0:42: 'assign' : l-value required (can't modify a const) +ERROR: 0:43: 'assign' : l-value required "v4" (can't modify a uniform) +ERROR: 0:48: 'gl_PointSize' : cannot change arrayness of redeclared block member +ERROR: 0:49: 'gl_ClipDistance' : cannot change arrayness of redeclared block member +ERROR: 6 compilation errors. No code generated. + + +Shader version: 420 +invocations = -1 +max_vertices = -1 +input primitive = triangles +output primitive = none +ERROR: node is still EOpNull! +0:7 Function Definition: foo( ( global void) +0:7 Function Parameters: +0:9 Sequence +0:9 Constant: +0:9 1 (const int) +0:10 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:10 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:10 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:10 Constant: +0:10 1 (const int) +0:10 Constant: +0:10 0 (const int) +0:11 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:11 indirect index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:11 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:11 'i' ( global int) +0:11 Constant: +0:11 0 (const int) +0:18 Function Definition: foo3( ( global void) +0:18 Function Parameters: +0:20 Sequence +0:20 Constant: +0:20 3 (const int) +0:21 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:21 indirect index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:21 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:21 'i' ( global int) +0:21 Constant: +0:21 0 (const int) +0:22 Constant: +0:22 3 (const int) +0:29 Function Definition: foo4( ( global void) +0:29 Function Parameters: +0:? Sequence +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of float) +0:40 'v' ( temp 4-component vector of float) +0:40 textureGatherOffset ( global 4-component vector of float) +0:40 's2D' ( uniform sampler2D) +0:40 direct index ( temp 2-component vector of float) +0:40 'coord' ( in 3-element array of 2-component vector of float) +0:40 Constant: +0:40 0 (const int) +0:40 vector swizzle ( temp 2-component vector of int) +0:40 indirect index ( temp 2-component vector of int) +0:40 Constant: +0:40 0 (const int) +0:40 1 (const int) +0:40 1 (const int) +0:40 -2 (const int) +0:40 0 (const int) +0:40 3 (const int) +0:40 -3 (const int) +0:40 0 (const int) +0:40 2 (const int) +0:40 1 (const int) +0:40 'i' ( global int) +0:40 Sequence +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:42 move second child to first child ( temp 2-component vector of int) +0:42 vector swizzle ( temp 2-component vector of int) +0:42 indirect index ( temp 2-component vector of int) +0:42 Constant: +0:42 0 (const int) +0:42 1 (const int) +0:42 1 (const int) +0:42 -2 (const int) +0:42 0 (const int) +0:42 3 (const int) +0:42 -3 (const int) +0:42 0 (const int) +0:42 2 (const int) +0:42 1 (const int) +0:42 'i' ( global int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 3 (const int) +0:42 3 (const int) +0:43 move second child to first child ( temp float) +0:43 direct index ( temp float) +0:43 'v4' ( uniform 4-component vector of float) +0:43 Constant: +0:43 0 (const int) +0:43 Constant: +0:43 3.200000 +0:44 vector swizzle ( temp 2-component vector of float) +0:44 'v4' ( uniform 4-component vector of float) +0:44 Sequence +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 1 (const int) +0:52 Function Definition: foo5( ( global float) +0:52 Function Parameters: +0:54 Sequence +0:54 Branch: Return with expression +0:54 Convert int to float ( temp float) +0:54 'i' ( global int) +0:? Linker Objects +0:? 'i' ( global int) +0:? 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'color3' ( in 3-element array of 4-component vector of float) +0:? 's2D' ( uniform sampler2D) +0:? 'coord' ( in 3-element array of 2-component vector of float) +0:? 'v4' ( uniform 4-component vector of float) +0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out unsized 1-element array of float ClipDistance gl_ClipDistance}) + + +Linked geometry stage: + +ERROR: Linking geometry stage: Missing entry point: Each stage requires one entry point +ERROR: Linking geometry stage: At least one shader must specify an output layout primitive +ERROR: Linking geometry stage: At least one shader must specify a layout(max_vertices = value) + +Shader version: 420 +invocations = 1 +max_vertices = -1 +input primitive = triangles +output primitive = none +ERROR: node is still EOpNull! +0:? Linker Objects +0:? 'i' ( global int) +0:? 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'color3' ( in 3-element array of 4-component vector of float) +0:? 's2D' ( uniform sampler2D) +0:? 'coord' ( in 3-element array of 2-component vector of float) +0:? 'v4' ( uniform 4-component vector of float) +0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out 1-element array of float ClipDistance gl_ClipDistance}) + diff --git a/deps/glslang/Test/baseResults/420.tesc.out b/deps/glslang/Test/baseResults/420.tesc.out new file mode 100644 index 00000000..a1f881cb --- /dev/null +++ b/deps/glslang/Test/baseResults/420.tesc.out @@ -0,0 +1,194 @@ +420.tesc +ERROR: 0:7: 'vertices' : inconsistent output number of vertices for array size of gl_out +ERROR: 0:11: 'vertices' : inconsistent output number of vertices for array size of a +ERROR: 0:12: 'vertices' : inconsistent output number of vertices for array size of outb +ERROR: 0:26: 'gl_PointSize' : no such field in structure +ERROR: 0:26: 'assign' : cannot convert from ' temp float' to ' temp block{ out 4-component vector of float Position gl_Position}' +ERROR: 0:29: 'out' : type must be an array: outf +ERROR: 0:43: 'vertices' : must be greater than 0 +ERROR: 7 compilation errors. No code generated. + + +Shader version: 420 +Requested GL_ARB_separate_shader_objects +vertices = 4 +ERROR: node is still EOpNull! +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:17 Sequence +0:17 Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:17 'p' ( temp 4-component vector of float) +0:17 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:17 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:17 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 0 (const int) +0:18 Sequence +0:18 move second child to first child ( temp float) +0:18 'ps' ( temp float) +0:18 gl_PointSize: direct index for structure ( in float PointSize) +0:18 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:18 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 1 (const int) +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'cd' ( temp float) +0:19 direct index ( temp float ClipDistance) +0:19 gl_ClipDistance: direct index for structure ( in unsized 3-element array of float ClipDistance) +0:19 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:19 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 3-element array of float ClipDistance gl_ClipDistance}) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 2 (const int) +0:21 Sequence +0:21 move second child to first child ( temp int) +0:21 'pvi' ( temp int) +0:21 'gl_PatchVerticesIn' ( in int PatchVertices) +0:22 Sequence +0:22 move second child to first child ( temp int) +0:22 'pid' ( temp int) +0:22 'gl_PrimitiveID' ( in int PrimitiveID) +0:23 Sequence +0:23 move second child to first child ( temp int) +0:23 'iid' ( temp int) +0:23 'gl_InvocationID' ( in int InvocationID) +0:25 move second child to first child ( temp 4-component vector of float) +0:25 gl_Position: direct index for structure ( out 4-component vector of float Position) +0:25 indirect index ( temp block{ out 4-component vector of float Position gl_Position}) +0:25 'gl_out' ( out 3-element array of block{ out 4-component vector of float Position gl_Position}) +0:25 'gl_InvocationID' ( in int InvocationID) +0:25 Constant: +0:25 0 (const int) +0:25 'p' ( temp 4-component vector of float) +0:26 indirect index ( temp block{ out 4-component vector of float Position gl_Position}) +0:26 'gl_out' ( out 3-element array of block{ out 4-component vector of float Position gl_Position}) +0:26 'gl_InvocationID' ( in int InvocationID) +0:34 Function Definition: foo( ( global void) +0:34 Function Parameters: +0:36 Sequence +0:36 Test condition and select ( temp void) +0:36 Condition +0:36 logical-or ( temp bool) +0:36 Compare Not Equal ( temp bool) +0:36 Constant: +0:36 -0.625000 +0:36 -0.500000 +0:36 -0.375000 +0:36 -0.250000 +0:36 -0.375000 +0:36 -0.250000 +0:36 -0.125000 +0:36 0.000000 +0:36 direct index (layout( location=0) temp 2X4 matrix of double) +0:36 'vs_tcs_first' (layout( location=0) in 32-element array of 2X4 matrix of double) +0:36 Constant: +0:36 0 (const int) +0:37 Compare Not Equal ( temp bool) +0:37 Constant: +0:37 0.375000 +0:37 0.500000 +0:37 0.625000 +0:37 0.750000 +0:37 0.625000 +0:37 0.750000 +0:37 0.875000 +0:37 -0.625000 +0:37 direct index (layout( location=12) temp 2X4 matrix of double) +0:37 'vs_tcs_last' (layout( location=12) in 32-element array of 2X4 matrix of double) +0:37 Constant: +0:37 0 (const int) +0:36 true case is null +0:? Linker Objects +0:? 'gl_out' ( out 3-element array of block{ out 4-component vector of float Position gl_Position}) +0:? 'a' ( out 3-element array of int) +0:? 'outb' ( out 5-element array of int) +0:? 'outc' ( out 4-element array of int) +0:? 'outf' ( out float) +0:? 'vs_tcs_first' (layout( location=0) in 32-element array of 2X4 matrix of double) +0:? 'vs_tcs_last' (layout( location=12) in 32-element array of 2X4 matrix of double) + + +Linked tessellation control stage: + + +Shader version: 420 +Requested GL_ARB_separate_shader_objects +vertices = 4 +ERROR: node is still EOpNull! +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:17 Sequence +0:17 Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:17 'p' ( temp 4-component vector of float) +0:17 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:17 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:17 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 0 (const int) +0:18 Sequence +0:18 move second child to first child ( temp float) +0:18 'ps' ( temp float) +0:18 gl_PointSize: direct index for structure ( in float PointSize) +0:18 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:18 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 1 (const int) +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'cd' ( temp float) +0:19 direct index ( temp float ClipDistance) +0:19 gl_ClipDistance: direct index for structure ( in 3-element array of float ClipDistance) +0:19 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:19 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 2 (const int) +0:21 Sequence +0:21 move second child to first child ( temp int) +0:21 'pvi' ( temp int) +0:21 'gl_PatchVerticesIn' ( in int PatchVertices) +0:22 Sequence +0:22 move second child to first child ( temp int) +0:22 'pid' ( temp int) +0:22 'gl_PrimitiveID' ( in int PrimitiveID) +0:23 Sequence +0:23 move second child to first child ( temp int) +0:23 'iid' ( temp int) +0:23 'gl_InvocationID' ( in int InvocationID) +0:25 move second child to first child ( temp 4-component vector of float) +0:25 gl_Position: direct index for structure ( out 4-component vector of float Position) +0:25 indirect index ( temp block{ out 4-component vector of float Position gl_Position}) +0:25 'gl_out' ( out 3-element array of block{ out 4-component vector of float Position gl_Position}) +0:25 'gl_InvocationID' ( in int InvocationID) +0:25 Constant: +0:25 0 (const int) +0:25 'p' ( temp 4-component vector of float) +0:26 indirect index ( temp block{ out 4-component vector of float Position gl_Position}) +0:26 'gl_out' ( out 3-element array of block{ out 4-component vector of float Position gl_Position}) +0:26 'gl_InvocationID' ( in int InvocationID) +0:? Linker Objects +0:? 'gl_out' ( out 3-element array of block{ out 4-component vector of float Position gl_Position}) +0:? 'a' ( out 3-element array of int) +0:? 'outb' ( out 5-element array of int) +0:? 'outc' ( out 4-element array of int) +0:? 'outf' ( out float) +0:? 'vs_tcs_first' (layout( location=0) in 32-element array of 2X4 matrix of double) +0:? 'vs_tcs_last' (layout( location=12) in 32-element array of 2X4 matrix of double) + diff --git a/deps/glslang/Test/baseResults/420.tese.out b/deps/glslang/Test/baseResults/420.tese.out new file mode 100644 index 00000000..71fca85e --- /dev/null +++ b/deps/glslang/Test/baseResults/420.tese.out @@ -0,0 +1,364 @@ +420.tese +ERROR: 0:7: '=' : cannot convert from ' const 3-element array of float' to ' global 2-element array of float' +ERROR: 0:8: 'initializer list' : wrong vector size (or rows in a matrix column): temp 2-component vector of float +ERROR: 0:9: 'initializer list' : wrong number of matrix columns: temp 3X3 matrix of float +ERROR: 0:10: 'initializer list' : wrong number of matrix columns: temp 2X2 matrix of float +ERROR: 0:25: 'initializer list' : wrong number of structure members +ERROR: 0:27: '=' : cannot convert from ' const bool' to ' global int' +ERROR: 0:28: 'constructor' : cannot convert parameter 2 from ' const float' to ' temp 4-component vector of float' +ERROR: 0:29: 'constructor' : cannot convert parameter 2 from ' const 2X2 matrix of float' to ' const 4-component vector of float' +ERROR: 0:29: ' const 2-element array of 4-component vector of float' : cannot construct with these arguments +ERROR: 0:29: '=' : cannot convert from ' const float' to ' global 2-element array of 4-component vector of float' +ERROR: 0:30: 'initializer list' : wrong number of matrix columns: temp 4X2 matrix of float +ERROR: 0:40: 'constructor' : cannot convert parameter 1 from ' const structure{ global 4-component vector of float a, global 4-component vector of float b}' to ' temp structure{ global float s, global float t}' +ERROR: 0:70: 'initializer list' : wrong number of structure members +ERROR: 13 compilation errors. No code generated. + + +Shader version: 420 +input primitive = none +vertex spacing = none +triangle order = none +ERROR: node is still EOpNull! +0:4 Sequence +0:4 move second child to first child ( temp 2X2 matrix of float) +0:4 'b' ( global 2X2 matrix of float) +0:4 Constant: +0:4 1.000000 +0:4 0.000000 +0:4 0.000000 +0:4 1.000000 +0:15 Sequence +0:15 move second child to first child ( temp structure{ global float a, global int b}) +0:15 'e' ( global structure{ global float a, global int b}) +0:15 Constant: +0:15 1.200000 +0:15 2 (const int) +0:20 Sequence +0:20 move second child to first child ( temp structure{ global float a, global int b}) +0:20 'e2' ( global structure{ global float a, global int b}) +0:20 Constant: +0:20 1.000000 +0:20 3 (const int) +0:42 Sequence +0:42 move second child to first child ( temp 5-element array of float) +0:42 'b5' ( global 5-element array of float) +0:42 Constant: +0:42 3.400000 +0:42 4.200000 +0:42 5.000000 +0:42 5.200000 +0:42 1.100000 +0:55 Sequence +0:55 move second child to first child ( temp structure{ global int f}) +0:55 'single1' ( global structure{ global int f}) +0:55 Constant: +0:55 10 (const int) +0:58 Sequence +0:58 move second child to first child ( temp structure{ global 2-component vector of uint v}) +0:58 'single2' ( global structure{ global 2-component vector of uint v}) +0:58 Constant: +0:58 1 (const uint) +0:58 2 (const uint) +0:61 Sequence +0:61 move second child to first child ( temp structure{ global structure{ global int f} s1}) +0:61 'single3' ( global structure{ global structure{ global int f} s1}) +0:61 Constant: +0:61 3 (const int) +0:64 Sequence +0:64 move second child to first child ( temp structure{ global structure{ global 2-component vector of uint v} s1}) +0:64 'single4' ( global structure{ global structure{ global 2-component vector of uint v} s1}) +0:64 Constant: +0:64 4 (const uint) +0:64 5 (const uint) +0:79 Sequence +0:79 move second child to first child ( temp 3-component vector of float) +0:79 'av3' ( global 3-component vector of float) +0:79 Construct vec3 ( global 3-component vector of float) +0:79 'vc1' ( global float) +0:79 'vc2' ( global float) +0:79 'vc3' ( global float) +0:80 Sequence +0:80 move second child to first child ( temp 3-component vector of float) +0:80 'bv3' ( global 3-component vector of float) +0:80 Construct vec3 ( temp 3-component vector of float) +0:80 'vc1' ( global float) +0:80 'vc2' ( global float) +0:80 'vc3' ( global float) +0:82 Function Definition: main( ( global void) +0:82 Function Parameters: +0:84 Sequence +0:84 MemoryBarrier ( global void) +0:86 Test condition and select ( temp void) +0:86 Condition +0:86 Compare Equal ( temp bool) +0:86 Constant: +0:86 1 (const uint) +0:86 2 (const uint) +0:86 3.000000 +0:86 4.000000 +0:86 0.000000 +0:86 0.000000 +0:86 0.000000 +0:86 4.000000 +0:86 0.000000 +0:86 5.000000 +0:86 6.000000 +0:86 0.000000 +0:86 0.000000 +0:86 0.000000 +0:86 6.000000 +0:86 0.000000 +0:86 'curlybad1' ( temp structure{ global 2-component vector of uint uv2, global 2-element array of structure{ global float f, global 2X3 matrix of float m23} s}) +0:86 true case is null +0:88 Test condition and select ( temp void) +0:88 Condition +0:88 Constant: +0:88 true (const bool) +0:88 true case is null +0:? Linker Objects +0:? 'a' ( const 2X2 matrix of float) +0:? 1.000000 +0:? 0.000000 +0:? 0.000000 +0:? 1.000000 +0:? 'b' ( global 2X2 matrix of float) +0:? 'c' ( const 2X2 matrix of float) +0:? 1.000000 +0:? 0.000000 +0:? 0.000000 +0:? 1.000000 +0:? 'a2' ( global 2-element array of float) +0:? 'b2' ( global 2-component vector of float) +0:? 'c2' ( global 3X3 matrix of float) +0:? 'd' ( global 2X2 matrix of float) +0:? 'e' ( global structure{ global float a, global int b}) +0:? 'e2' ( global structure{ global float a, global int b}) +0:? 'e3' ( global structure{ global float a, global int b}) +0:? 'a3' ( global int) +0:? 'b3' ( global 2-element array of 4-component vector of float) +0:? 'b4' ( global 2-element array of 4-component vector of float) +0:? 'c3' ( global 4X2 matrix of float) +0:? 'd2' ( global unsized 1-element array of structure{ global float s, global float t}) +0:? 'b5' ( global 5-element array of float) +0:? 'single1' ( global structure{ global int f}) +0:? 'single2' ( global structure{ global 2-component vector of uint v}) +0:? 'single3' ( global structure{ global structure{ global int f} s1}) +0:? 'single4' ( global structure{ global structure{ global 2-component vector of uint v} s1}) +0:? 'constructed' ( const structure{ global 2-component vector of uint uv2, global 2-element array of structure{ global float f, global 2X3 matrix of float m23} s}) +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3.000000 +0:? 4.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 4.000000 +0:? 0.000000 +0:? 5.000000 +0:? 6.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 6.000000 +0:? 0.000000 +0:? 'curlybad1' ( temp structure{ global 2-component vector of uint uv2, global 2-element array of structure{ global float f, global 2X3 matrix of float m23} s}) +0:? 'curlyInit' ( const structure{ global 2-component vector of uint uv2, global 2-element array of structure{ global float f, global 2X3 matrix of float m23} s}) +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3.000000 +0:? 4.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 4.000000 +0:? 0.000000 +0:? 5.000000 +0:? 6.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 6.000000 +0:? 0.000000 +0:? 'vc1' ( global float) +0:? 'vc2' ( global float) +0:? 'vc3' ( global float) +0:? 'av3' ( global 3-component vector of float) +0:? 'bv3' ( global 3-component vector of float) + + +Linked tessellation evaluation stage: + +ERROR: Linking tessellation evaluation stage: At least one shader must specify an input layout primitive + +Shader version: 420 +input primitive = none +vertex spacing = equal_spacing +triangle order = ccw +ERROR: node is still EOpNull! +0:4 Sequence +0:4 move second child to first child ( temp 2X2 matrix of float) +0:4 'b' ( global 2X2 matrix of float) +0:4 Constant: +0:4 1.000000 +0:4 0.000000 +0:4 0.000000 +0:4 1.000000 +0:15 Sequence +0:15 move second child to first child ( temp structure{ global float a, global int b}) +0:15 'e' ( global structure{ global float a, global int b}) +0:15 Constant: +0:15 1.200000 +0:15 2 (const int) +0:20 Sequence +0:20 move second child to first child ( temp structure{ global float a, global int b}) +0:20 'e2' ( global structure{ global float a, global int b}) +0:20 Constant: +0:20 1.000000 +0:20 3 (const int) +0:42 Sequence +0:42 move second child to first child ( temp 5-element array of float) +0:42 'b5' ( global 5-element array of float) +0:42 Constant: +0:42 3.400000 +0:42 4.200000 +0:42 5.000000 +0:42 5.200000 +0:42 1.100000 +0:55 Sequence +0:55 move second child to first child ( temp structure{ global int f}) +0:55 'single1' ( global structure{ global int f}) +0:55 Constant: +0:55 10 (const int) +0:58 Sequence +0:58 move second child to first child ( temp structure{ global 2-component vector of uint v}) +0:58 'single2' ( global structure{ global 2-component vector of uint v}) +0:58 Constant: +0:58 1 (const uint) +0:58 2 (const uint) +0:61 Sequence +0:61 move second child to first child ( temp structure{ global structure{ global int f} s1}) +0:61 'single3' ( global structure{ global structure{ global int f} s1}) +0:61 Constant: +0:61 3 (const int) +0:64 Sequence +0:64 move second child to first child ( temp structure{ global structure{ global 2-component vector of uint v} s1}) +0:64 'single4' ( global structure{ global structure{ global 2-component vector of uint v} s1}) +0:64 Constant: +0:64 4 (const uint) +0:64 5 (const uint) +0:79 Sequence +0:79 move second child to first child ( temp 3-component vector of float) +0:79 'av3' ( global 3-component vector of float) +0:79 Construct vec3 ( global 3-component vector of float) +0:79 'vc1' ( global float) +0:79 'vc2' ( global float) +0:79 'vc3' ( global float) +0:80 Sequence +0:80 move second child to first child ( temp 3-component vector of float) +0:80 'bv3' ( global 3-component vector of float) +0:80 Construct vec3 ( temp 3-component vector of float) +0:80 'vc1' ( global float) +0:80 'vc2' ( global float) +0:80 'vc3' ( global float) +0:82 Function Definition: main( ( global void) +0:82 Function Parameters: +0:84 Sequence +0:84 MemoryBarrier ( global void) +0:86 Test condition and select ( temp void) +0:86 Condition +0:86 Compare Equal ( temp bool) +0:86 Constant: +0:86 1 (const uint) +0:86 2 (const uint) +0:86 3.000000 +0:86 4.000000 +0:86 0.000000 +0:86 0.000000 +0:86 0.000000 +0:86 4.000000 +0:86 0.000000 +0:86 5.000000 +0:86 6.000000 +0:86 0.000000 +0:86 0.000000 +0:86 0.000000 +0:86 6.000000 +0:86 0.000000 +0:86 'curlybad1' ( temp structure{ global 2-component vector of uint uv2, global 2-element array of structure{ global float f, global 2X3 matrix of float m23} s}) +0:86 true case is null +0:88 Test condition and select ( temp void) +0:88 Condition +0:88 Constant: +0:88 true (const bool) +0:88 true case is null +0:? Linker Objects +0:? 'a' ( const 2X2 matrix of float) +0:? 1.000000 +0:? 0.000000 +0:? 0.000000 +0:? 1.000000 +0:? 'b' ( global 2X2 matrix of float) +0:? 'c' ( const 2X2 matrix of float) +0:? 1.000000 +0:? 0.000000 +0:? 0.000000 +0:? 1.000000 +0:? 'a2' ( global 2-element array of float) +0:? 'b2' ( global 2-component vector of float) +0:? 'c2' ( global 3X3 matrix of float) +0:? 'd' ( global 2X2 matrix of float) +0:? 'e' ( global structure{ global float a, global int b}) +0:? 'e2' ( global structure{ global float a, global int b}) +0:? 'e3' ( global structure{ global float a, global int b}) +0:? 'a3' ( global int) +0:? 'b3' ( global 2-element array of 4-component vector of float) +0:? 'b4' ( global 2-element array of 4-component vector of float) +0:? 'c3' ( global 4X2 matrix of float) +0:? 'd2' ( global 1-element array of structure{ global float s, global float t}) +0:? 'b5' ( global 5-element array of float) +0:? 'single1' ( global structure{ global int f}) +0:? 'single2' ( global structure{ global 2-component vector of uint v}) +0:? 'single3' ( global structure{ global structure{ global int f} s1}) +0:? 'single4' ( global structure{ global structure{ global 2-component vector of uint v} s1}) +0:? 'constructed' ( const structure{ global 2-component vector of uint uv2, global 2-element array of structure{ global float f, global 2X3 matrix of float m23} s}) +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3.000000 +0:? 4.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 4.000000 +0:? 0.000000 +0:? 5.000000 +0:? 6.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 6.000000 +0:? 0.000000 +0:? 'curlybad1' ( temp structure{ global 2-component vector of uint uv2, global 2-element array of structure{ global float f, global 2X3 matrix of float m23} s}) +0:? 'curlyInit' ( const structure{ global 2-component vector of uint uv2, global 2-element array of structure{ global float f, global 2X3 matrix of float m23} s}) +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3.000000 +0:? 4.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 4.000000 +0:? 0.000000 +0:? 5.000000 +0:? 6.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 6.000000 +0:? 0.000000 +0:? 'vc1' ( global float) +0:? 'vc2' ( global float) +0:? 'vc3' ( global float) +0:? 'av3' ( global 3-component vector of float) +0:? 'bv3' ( global 3-component vector of float) + diff --git a/deps/glslang/Test/baseResults/420.vert.out b/deps/glslang/Test/baseResults/420.vert.out new file mode 100644 index 00000000..25bce16c --- /dev/null +++ b/deps/glslang/Test/baseResults/420.vert.out @@ -0,0 +1,390 @@ +420.vert +ERROR: 0:2: '#version' : must occur first in shader +WARNING: 0:3: varying deprecated in version 130; may be removed in future release +ERROR: 0:3: 'varying' : no longer supported in core profile; removed in version 420 +ERROR: 0:7: '' : vertex input cannot be further qualified +ERROR: 0:11: '' : can only have one interpolation qualifier (flat, smooth, noperspective, __explicitInterpAMD) +ERROR: 0:12: '' : can only have one auxiliary qualifier (centroid, patch, and sample) +ERROR: 0:13: 'uniform' : too many storage qualifiers +ERROR: 0:18: '=' : global const initializers must be constant ' const int' +ERROR: 0:20: 'const' : no qualifiers allowed for function return +ERROR: 0:27: '' : array size must be a constant integer expression +ERROR: 0:38: 'j' : undeclared identifier +ERROR: 0:38: '=' : cannot convert from ' temp float' to ' temp int' +ERROR: 0:39: 'k' : undeclared identifier +ERROR: 0:39: '=' : cannot convert from ' temp float' to ' temp int' +ERROR: 0:40: 'j' : undeclared identifier +ERROR: 0:40: '=' : cannot convert from ' temp float' to ' temp int' +ERROR: 0:44: 'jj' : undeclared identifier +ERROR: 0:44: '=' : cannot convert from ' temp float' to ' temp int' +ERROR: 0:54: 'y' : vector swizzle selection out of range +ERROR: 0:62: 'xxxxx' : vector swizzle too long +ERROR: 0:63: 'xxy' : vector swizzle selection out of range +ERROR: 0:66: 'binding' : cannot declare a default, include a type or full declaration +ERROR: 0:69: 'location/component/index' : cannot declare a default, use a full declaration +ERROR: 0:70: 'input block' : not supported in this stage: vertex +ERROR: 0:70: 'binding' : requires uniform or buffer storage qualifier +ERROR: 0:71: 'binding' : binding is too large +ERROR: 0:74: 'binding' : sampler binding not less than gl_MaxCombinedTextureImageUnits +ERROR: 0:76: 'binding' : sampler binding not less than gl_MaxCombinedTextureImageUnits (using array) +ERROR: 0:85: 'patch' : not supported in this stage: vertex +ERROR: 0:85: '' : vertex input cannot be further qualified +ERROR: 0:86: 'patch' : not supported in this stage: vertex +ERROR: 0:100: '=' : global const initializers must be constant ' const int' +ERROR: 0:101: '' : array size must be a constant integer expression +ERROR: 0:107: 'image variables not declared 'writeonly' and without a format layout qualifier' : not supported for this version or the enabled extensions +ERROR: 0:114: 'imageAtomicMin' : only supported on image with format r32i or r32ui +ERROR: 0:115: 'imageAtomicMax' : no matching overloaded function found +ERROR: 0:119: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter +ERROR: 0:122: '' : memory qualifiers cannot be used on this type +ERROR: 0:123: '' : memory qualifiers cannot be used on this type +ERROR: 0:135: 'volatile' : argument cannot drop memory qualifier when passed to formal parameter +ERROR: 0:139: 'rg8i' : does not apply to unsigned integer images +ERROR: 0:140: 'rgba32i' : does not apply to floating point images +ERROR: 0:141: 'rgba32f' : does not apply to unsigned integer images +ERROR: 0:142: 'r8_snorm' : does not apply to signed integer images +ERROR: 0:143: 'rgba32ui' : does not apply to signed integer images +ERROR: 0:144: 'r8ui' : does not apply to signed integer images +ERROR: 0:147: 'offset on block member' : not supported for this version or the enabled extensions +ERROR: 0:147: 'offset/align' : can only be used with std140 or std430 layout packing +ERROR: 0:157: 'textureQueryLevels' : no matching overloaded function found +ERROR: 0:157: 'assign' : cannot convert from ' const float' to ' temp int' +ERROR: 0:158: 'textureQueryLevels' : no matching overloaded function found +ERROR: 0:158: 'assign' : cannot convert from ' const float' to ' temp int' +WARNING: 0:161: '[]' : assuming binding count of one for compile-time checking of binding numbers for unsized array +ERROR: 51 compilation errors. No code generated. + + +Shader version: 420 +ERROR: node is still EOpNull! +0:20 Function Definition: foo( ( const int) +0:20 Function Parameters: +0:? Sequence +0:23 Sequence +0:23 move second child to first child ( temp int) +0:23 'b' ( const (read only) int) +0:23 'anonconst' ( global int) +0:25 Sequence +0:25 move second child to first child ( temp int) +0:25 'd' ( const (read only) int) +0:25 'b' ( const (read only) int) +0:29 Branch: Return with expression +0:29 'b' ( const (read only) int) +0:32 Function Definition: main( ( global void) +0:32 Function Parameters: +0:? Sequence +0:35 Test condition and select ( temp void) +0:35 Condition +0:35 Compare Equal ( temp bool) +0:35 'i' ( temp int) +0:35 Constant: +0:35 3 (const int) +0:35 true case +0:36 Sequence +0:36 move second child to first child ( temp int) +0:36 'j' ( temp int) +0:36 'i' ( temp int) +0:42 Loop with condition tested first +0:42 Loop Condition +0:42 Constant: +0:42 true (const bool) +0:42 No loop body +0:50 Function Definition: bar(vf4; ( global void) +0:50 Function Parameters: +0:50 'v' ( volatile in 4-component vector of float) +0:? Sequence +0:53 's' ( temp int) +0:54 's' ( temp int) +0:55 Test condition and select ( temp void) +0:55 Condition +0:55 Compare Equal ( temp bool) +0:55 direct index ( temp float) +0:55 direct index ( temp 4-component vector of float) +0:55 'bad' ( in 10-element array of 4-component vector of float) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 4.200000 +0:55 true case is null +0:57 Test condition and select ( temp void) +0:57 Condition +0:57 Constant: +0:57 true (const bool) +0:57 true case +0:58 move second child to first child ( temp 4-component vector of float) +0:58 'badorder3' ( flat out 4-component vector of float) +0:58 direct index ( temp 4-component vector of float) +0:58 'bad' ( in 10-element array of 4-component vector of float) +0:58 Constant: +0:58 0 (const int) +0:61 Sequence +0:61 move second child to first child ( temp 3-component vector of float) +0:61 'smeared' ( temp 3-component vector of float) +0:61 Construct vec3 ( temp 3-component vector of float) +0:61 'f' ( temp float) +0:62 Construct vec4 ( temp 4-component vector of float) +0:62 'f' ( temp float) +0:63 Construct vec2 ( temp 2-component vector of float) +0:63 'f' ( temp float) +0:88 Function Definition: bar23444( ( global void) +0:88 Function Parameters: +0:? Sequence +0:91 Sequence +0:91 move second child to first child ( temp float) +0:91 'a1' ( temp float) +0:91 direct index ( temp float) +0:91 direct index ( temp 3-component vector of float) +0:91 'm43' ( temp 4X3 matrix of float) +0:91 Constant: +0:91 3 (const int) +0:91 Constant: +0:91 1 (const int) +0:93 Sequence +0:93 move second child to first child ( temp int) +0:93 'a2' ( temp int) +0:93 Constant: +0:93 4 (const int) +0:94 add second child into first child ( temp int) +0:94 'a2' ( temp int) +0:94 Constant: +0:94 3 (const int) +0:95 add second child into first child ( temp int) +0:95 'a2' ( temp int) +0:95 Constant: +0:95 3 (const int) +0:96 Sequence +0:96 move second child to first child ( temp float) +0:96 'b' ( const (read only) float) +0:96 component-wise multiply ( temp float) +0:96 Constant: +0:96 2.000000 +0:96 'a1' ( temp float) +0:97 Sequence +0:97 move second child to first child ( temp int) +0:97 'a' ( temp int) +0:97 Constant: +0:97 -1 (const int) +0:109 Function Definition: qux( ( global void) +0:109 Function Parameters: +0:111 Sequence +0:111 Sequence +0:111 move second child to first child ( temp int) +0:111 'i' ( temp int) +0:111 aoeu: direct index for structure (layout( column_major shared) uniform int) +0:111 'anon@0' (layout( binding=7 column_major shared) uniform block{layout( column_major shared) uniform int aoeu}) +0:111 Constant: +0:111 0 (const uint) +0:112 imageAtomicCompSwap ( global int) +0:112 'iimg2D' (layout( r32i) uniform iimage2D) +0:112 Construct ivec2 ( temp 2-component vector of int) +0:112 'i' ( temp int) +0:112 'i' ( temp int) +0:112 'i' ( temp int) +0:112 'i' ( temp int) +0:113 imageAtomicAdd ( global uint) +0:113 'uimg2D' (layout( r32ui) uniform uimage2D) +0:113 Construct ivec2 ( temp 2-component vector of int) +0:113 'i' ( temp int) +0:113 'i' ( temp int) +0:113 Convert int to uint ( temp uint) +0:113 'i' ( temp int) +0:114 imageAtomicMin ( global int) +0:114 'iimg2Drgba' (layout( rgba32i) uniform iimage2D) +0:114 Construct ivec2 ( temp 2-component vector of int) +0:114 'i' ( temp int) +0:114 'i' ( temp int) +0:114 'i' ( temp int) +0:115 Constant: +0:115 0.000000 +0:116 Sequence +0:116 move second child to first child ( temp 4-component vector of int) +0:116 'pos' ( temp 4-component vector of int) +0:116 imageLoad ( global 4-component vector of int) +0:116 'iimg2D' (layout( r32i) uniform iimage2D) +0:116 Construct ivec2 ( temp 2-component vector of int) +0:116 'i' ( temp int) +0:116 'i' ( temp int) +0:117 Sequence +0:117 move second child to first child ( temp 4-component vector of float) +0:117 'col' ( temp 4-component vector of float) +0:117 imageLoad ( global 4-component vector of float) +0:117 'img2DMS' ( uniform image2DMS) +0:117 Construct ivec2 ( temp 2-component vector of int) +0:117 'i' ( temp int) +0:117 'i' ( temp int) +0:117 'i' ( temp int) +0:118 imageStore ( global void) +0:118 'img2DMSWO' ( writeonly uniform image2DMS) +0:118 Construct ivec2 ( temp 2-component vector of int) +0:118 'i' ( temp int) +0:118 'i' ( temp int) +0:118 'i' ( temp int) +0:118 Constant: +0:118 0.000000 +0:118 0.000000 +0:118 0.000000 +0:118 0.000000 +0:119 imageLoad ( global 4-component vector of float) +0:119 'img2DMSWO' ( writeonly uniform image2DMS) +0:119 Construct ivec2 ( temp 2-component vector of int) +0:119 'i' ( temp int) +0:119 'i' ( temp int) +0:119 'i' ( temp int) +0:125 Function Definition: passr(iI21; ( global void) +0:125 Function Parameters: +0:125 'image' ( coherent readonly in iimage2D) +0:132 Function Definition: passrc( ( global void) +0:132 Function Parameters: +0:134 Sequence +0:134 Function Call: passr(iI21; ( global void) +0:134 'qualim1' (layout( r32i) coherent readonly uniform iimage2D) +0:135 Function Call: passr(iI21; ( global void) +0:135 'qualim2' (layout( r32i) coherent volatile readonly uniform iimage2D) +0:136 Function Call: passr(iI21; ( global void) +0:136 'iimg2D' (layout( r32i) uniform iimage2D) +0:153 Function Definition: qlod( ( global void) +0:153 Function Parameters: +0:? Sequence +0:157 'levels' ( temp int) +0:158 'levels' ( temp int) +0:? Linker Objects +0:? 'v2' ( smooth out 2-component vector of float) +0:? 'bad' ( in 10-element array of 4-component vector of float) +0:? 'badorder' ( in 4-component vector of float) +0:? 'badorder2' ( invariant smooth out 4-component vector of float) +0:? 'badorder4' ( centroid in 4-component vector of float) +0:? 'badorder3' ( flat out 4-component vector of float) +0:? 'rep' ( smooth flat out 4-component vector of float) +0:? 'rep2' ( centroid smooth sample out 4-component vector of float) +0:? 'rep3' ( in 4-component vector of float) +0:? 'anonconst' ( global int) +0:? 'aconst' ( const int) +0:? 5 (const int) +0:? 'a' ( const int) +0:? 5 (const int) +0:? 'b' ( temp int) +0:? 'cx' ( const float) +0:? 4.200000 +0:? 'dx' ( const float) +0:? 4.200000 +0:? 'boundInst' (layout( binding=3 column_major shared) uniform block{layout( column_major shared) uniform int aoeu}) +0:? 'anon@0' (layout( binding=7 column_major shared) uniform block{layout( column_major shared) uniform int aoeu}) +0:? 'anon@1' (layout( binding=1) in block{ in int aoeua}) +0:? 'anon@2' (layout( column_major shared) uniform block{layout( column_major shared) uniform int aooeu}) +0:? 'sampb1' (layout( binding=4) uniform sampler2D) +0:? 'sampb2' (layout( binding=5) uniform 10-element array of sampler2D) +0:? 'sampb3' (layout( binding=80) uniform sampler2D) +0:? 'sampb4' (layout( binding=31) uniform sampler2D) +0:? 'sampb5' (layout( binding=79) uniform 2-element array of sampler2D) +0:? 'anon@3' ( out block{ out 4-element array of float ClipDistance gl_ClipDistance, }) +0:? 'patchIn' ( patch in 4-component vector of float) +0:? 'patchOut' ( smooth patch out 4-component vector of float) +0:? 'comma0' ( temp int) +0:? 'comma1' ( global 1-element array of int) +0:? 'iimg2D' (layout( r32i) uniform iimage2D) +0:? 'iimg2Drgba' (layout( rgba32i) uniform iimage2D) +0:? 'img2Drgba' (layout( rgba32f) uniform image2D) +0:? 'uimg2D' (layout( r32ui) uniform uimage2D) +0:? 'img2DMS' ( uniform image2DMS) +0:? 'img2DMSWO' ( writeonly uniform image2DMS) +0:? 'vol' ( volatile temp float) +0:? 'vol2' ( readonly temp int) +0:? 'qualim1' (layout( r32i) coherent readonly uniform iimage2D) +0:? 'qualim2' (layout( r32i) coherent volatile readonly uniform iimage2D) +0:? 'i1bad' (layout( rg8i) uniform uimage2D) +0:? 'i2bad' (layout( rgba32i) uniform image2D) +0:? 'i3bad' (layout( rgba32f) uniform uimage2D) +0:? 'i4bad' (layout( r8_snorm) uniform iimage2D) +0:? 'i5bad' (layout( rgba32ui) uniform iimage2D) +0:? 'i6bad' (layout( r8ui) uniform iimage2D) +0:? 'offcheckI' (layout( column_major shared) uniform block{layout( column_major shared offset=16) uniform int foo}) +0:? 'samp1D' ( uniform sampler1D) +0:? 'samp1Ds' ( uniform sampler1DShadow) +0:? 'badArray' (layout( binding=0) writeonly uniform unsized 1-element array of image1D) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 420 +ERROR: node is still EOpNull! +0:32 Function Definition: main( ( global void) +0:32 Function Parameters: +0:? Sequence +0:35 Test condition and select ( temp void) +0:35 Condition +0:35 Compare Equal ( temp bool) +0:35 'i' ( temp int) +0:35 Constant: +0:35 3 (const int) +0:35 true case +0:36 Sequence +0:36 move second child to first child ( temp int) +0:36 'j' ( temp int) +0:36 'i' ( temp int) +0:42 Loop with condition tested first +0:42 Loop Condition +0:42 Constant: +0:42 true (const bool) +0:42 No loop body +0:? Linker Objects +0:? 'v2' ( smooth out 2-component vector of float) +0:? 'bad' ( in 10-element array of 4-component vector of float) +0:? 'badorder' ( in 4-component vector of float) +0:? 'badorder2' ( invariant smooth out 4-component vector of float) +0:? 'badorder4' ( centroid in 4-component vector of float) +0:? 'badorder3' ( flat out 4-component vector of float) +0:? 'rep' ( smooth flat out 4-component vector of float) +0:? 'rep2' ( centroid smooth sample out 4-component vector of float) +0:? 'rep3' ( in 4-component vector of float) +0:? 'anonconst' ( global int) +0:? 'aconst' ( const int) +0:? 5 (const int) +0:? 'a' ( const int) +0:? 5 (const int) +0:? 'b' ( temp int) +0:? 'cx' ( const float) +0:? 4.200000 +0:? 'dx' ( const float) +0:? 4.200000 +0:? 'boundInst' (layout( binding=3 column_major shared) uniform block{layout( column_major shared) uniform int aoeu}) +0:? 'anon@0' (layout( binding=7 column_major shared) uniform block{layout( column_major shared) uniform int aoeu}) +0:? 'anon@1' (layout( binding=1) in block{ in int aoeua}) +0:? 'anon@2' (layout( column_major shared) uniform block{layout( column_major shared) uniform int aooeu}) +0:? 'sampb1' (layout( binding=4) uniform sampler2D) +0:? 'sampb2' (layout( binding=5) uniform 10-element array of sampler2D) +0:? 'sampb3' (layout( binding=80) uniform sampler2D) +0:? 'sampb4' (layout( binding=31) uniform sampler2D) +0:? 'sampb5' (layout( binding=79) uniform 2-element array of sampler2D) +0:? 'anon@3' ( out block{ out 4-element array of float ClipDistance gl_ClipDistance, }) +0:? 'patchIn' ( patch in 4-component vector of float) +0:? 'patchOut' ( smooth patch out 4-component vector of float) +0:? 'comma0' ( temp int) +0:? 'comma1' ( global 1-element array of int) +0:? 'iimg2D' (layout( r32i) uniform iimage2D) +0:? 'iimg2Drgba' (layout( rgba32i) uniform iimage2D) +0:? 'img2Drgba' (layout( rgba32f) uniform image2D) +0:? 'uimg2D' (layout( r32ui) uniform uimage2D) +0:? 'img2DMS' ( uniform image2DMS) +0:? 'img2DMSWO' ( writeonly uniform image2DMS) +0:? 'vol' ( volatile temp float) +0:? 'vol2' ( readonly temp int) +0:? 'qualim1' (layout( r32i) coherent readonly uniform iimage2D) +0:? 'qualim2' (layout( r32i) coherent volatile readonly uniform iimage2D) +0:? 'i1bad' (layout( rg8i) uniform uimage2D) +0:? 'i2bad' (layout( rgba32i) uniform image2D) +0:? 'i3bad' (layout( rgba32f) uniform uimage2D) +0:? 'i4bad' (layout( r8_snorm) uniform iimage2D) +0:? 'i5bad' (layout( rgba32ui) uniform iimage2D) +0:? 'i6bad' (layout( r8ui) uniform iimage2D) +0:? 'offcheckI' (layout( column_major shared) uniform block{layout( column_major shared offset=16) uniform int foo}) +0:? 'samp1D' ( uniform sampler1D) +0:? 'samp1Ds' ( uniform sampler1DShadow) +0:? 'badArray' (layout( binding=0) writeonly uniform 1-element array of image1D) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/420_size_gl_in.geom.out b/deps/glslang/Test/baseResults/420_size_gl_in.geom.out new file mode 100644 index 00000000..9d95495b --- /dev/null +++ b/deps/glslang/Test/baseResults/420_size_gl_in.geom.out @@ -0,0 +1,56 @@ +420_size_gl_in.geom +ERROR: 0:19: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use +ERROR: 1 compilation errors. No code generated. + + +Shader version: 420 +invocations = -1 +max_vertices = -1 +input primitive = triangles +output primitive = none +ERROR: node is still EOpNull! +0:11 Function Definition: foo( ( global void) +0:11 Function Parameters: +0:13 Sequence +0:13 Constant: +0:13 3 (const int) +0:14 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:14 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:14 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:14 Constant: +0:14 1 (const int) +0:14 Constant: +0:14 0 (const int) +0:15 Constant: +0:15 3 (const int) +0:16 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:16 indirect index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:16 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:16 'i' ( global int) +0:16 Constant: +0:16 0 (const int) +0:? Linker Objects +0:? 'i' ( global int) +0:? 'colorun' ( in 3-element array of 4-component vector of float) +0:? 'color3' ( in 3-element array of 4-component vector of float) +0:? 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) + + +Linked geometry stage: + +ERROR: Linking geometry stage: Missing entry point: Each stage requires one entry point +ERROR: Linking geometry stage: At least one shader must specify an output layout primitive +ERROR: Linking geometry stage: At least one shader must specify a layout(max_vertices = value) + +Shader version: 420 +invocations = 1 +max_vertices = -1 +input primitive = triangles +output primitive = none +ERROR: node is still EOpNull! +0:? Linker Objects +0:? 'i' ( global int) +0:? 'colorun' ( in 3-element array of 4-component vector of float) +0:? 'color3' ( in 3-element array of 4-component vector of float) +0:? 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) + diff --git a/deps/glslang/Test/baseResults/430.comp.out b/deps/glslang/Test/baseResults/430.comp.out new file mode 100644 index 00000000..599cd8e3 --- /dev/null +++ b/deps/glslang/Test/baseResults/430.comp.out @@ -0,0 +1,209 @@ +430.comp +ERROR: 0:4: 'local_size' : cannot change previously set size +ERROR: 0:5: 'local_size' : too large; see gl_MaxComputeWorkGroupSize +ERROR: 0:43: 'in' : global storage input qualifier cannot be used in a compute shader +ERROR: 0:43: 'location qualifier on input' : not supported in this stage: compute +ERROR: 0:44: 'in' : global storage input qualifier cannot be used in a compute shader +ERROR: 0:45: 'out' : global storage output qualifier cannot be used in a compute shader +ERROR: 0:48: 'shared' : cannot apply layout qualifiers to a shared variable +ERROR: 0:48: 'location' : can only apply to uniform, buffer, in, or out storage qualifiers +ERROR: 0:49: 'shared' : cannot initialize this type of qualifier +ERROR: 0:51: 'local_size' : can only apply to 'in' +ERROR: 0:51: 'local_size' : can only apply to 'in' +ERROR: 0:51: 'local_size' : can only apply to 'in' +ERROR: 0:65: 'assign' : l-value required "ro" (can't modify a readonly buffer) +ERROR: 0:77: '=' : cannot convert from ' temp double' to ' temp int' +ERROR: 0:81: 'input block' : not supported in this stage: compute +ERROR: 0:85: 'output block' : not supported in this stage: compute +ERROR: 16 compilation errors. No code generated. + + +Shader version: 430 +local_size = (2, 1, 4096) +ERROR: node is still EOpNull! +0:27 Function Definition: main( ( global void) +0:27 Function Parameters: +0:29 Sequence +0:29 Barrier ( global void) +0:30 MemoryBarrier ( global void) +0:31 MemoryBarrierAtomicCounter ( global void) +0:32 MemoryBarrierBuffer ( global void) +0:33 MemoryBarrierShared ( global void) +0:34 MemoryBarrierImage ( global void) +0:35 GroupMemoryBarrier ( global void) +0:36 move second child to first child ( temp int) +0:36 value: direct index for structure (layout( column_major shared) buffer int) +0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer runtime-sized array of float values}) +0:36 Constant: +0:36 0 (const uint) +0:36 Convert float to int ( temp int) +0:36 indirect index (layout( column_major shared) temp float) +0:36 values: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer runtime-sized array of float values}) +0:36 Constant: +0:36 1 (const uint) +0:36 'gl_LocalInvocationIndex' ( in uint LocalInvocationIndex) +0:39 Test condition and select ( temp void) +0:39 Condition +0:39 Compare Greater Than ( temp bool) +0:39 'a' ( temp int) +0:39 Constant: +0:39 10 (const int) +0:39 true case +0:40 Barrier ( global void) +0:63 Function Definition: foo( ( global void) +0:63 Function Parameters: +0:65 Sequence +0:65 move second child to first child ( temp float) +0:65 direct index (layout( column_major shared) temp float) +0:65 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of float) +0:65 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer unsized 3-element array of float values}) +0:65 Constant: +0:65 1 (const int) +0:65 Constant: +0:65 2 (const int) +0:65 Constant: +0:65 4.700000 +0:66 array length ( temp int) +0:66 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of float) +0:66 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer unsized 3-element array of float values}) +0:66 Constant: +0:66 1 (const int) +0:67 Barrier ( global void) +0:72 Function Definition: fooaoeu( ( global void) +0:72 Function Parameters: +0:73 Sequence +0:73 Sequence +0:73 move second child to first child ( temp 2-component vector of int) +0:73 'storePos' ( temp 2-component vector of int) +0:73 Convert uint to int ( temp 2-component vector of int) +0:73 vector swizzle ( temp 2-component vector of uint) +0:73 'gl_GlobalInvocationID' ( in 3-component vector of uint GlobalInvocationID) +0:73 Sequence +0:73 Constant: +0:73 0 (const int) +0:73 Constant: +0:73 1 (const int) +0:74 Sequence +0:74 move second child to first child ( temp double) +0:74 'localCoef' ( temp double) +0:74 Convert float to double ( temp double) +0:74 length ( global float) +0:74 divide ( temp 2-component vector of float) +0:74 Convert int to float ( temp 2-component vector of float) +0:74 subtract ( temp 2-component vector of int) +0:74 Convert uint to int ( temp 2-component vector of int) +0:74 vector swizzle ( temp 2-component vector of uint) +0:74 'gl_LocalInvocationID' ( in 3-component vector of uint LocalInvocationID) +0:74 Sequence +0:74 Constant: +0:74 0 (const int) +0:74 Constant: +0:74 1 (const int) +0:74 Constant: +0:74 8 (const int) +0:74 Constant: +0:74 8.000000 +0:75 Sequence +0:75 move second child to first child ( temp 4-component vector of double) +0:75 'aa' ( temp 4-component vector of double) +0:75 Constant: +0:75 0.400000 +0:75 0.200000 +0:75 0.300000 +0:75 0.400000 +0:76 Sequence +0:76 move second child to first child ( temp double) +0:76 'globalCoef' ( temp double) +0:76 Constant: +0:76 1.000000 +0:78 Sequence +0:78 move second child to first child ( temp double) +0:78 'di' ( temp double) +0:78 Convert int to double ( temp double) +0:78 'i' ( temp int) +0:? Linker Objects +0:? 'gl_WorkGroupSize' ( const 3-component vector of uint WorkGroupSize) +0:? 2 (const uint) +0:? 1 (const uint) +0:? 4096 (const uint) +0:? 'total' ( const int) +0:? 66592 (const int) +0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer runtime-sized array of float values}) +0:? 'invalid' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 1-element array of float values, layout( column_major shared) buffer int value}) +0:? 'v3' (layout( location=2) in 3-component vector of float) +0:? 'f' ( in float) +0:? 'fo' ( out float) +0:? 's' ( shared 4-component vector of float) +0:? 'sl' (layout( location=2) shared 4-component vector of float) +0:? 'fs' ( shared float) +0:? 'arrX' ( global 2-element array of int) +0:? 'arrY' ( global 1-element array of int) +0:? 'arrZ' ( global 4096-element array of int) +0:? 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer unsized 3-element array of float values}) +0:? 'roll' ( uniform double) +0:? 'destTex' ( writeonly uniform image2D) +0:? 'inbi' ( in block{ in int a}) +0:? 'outbi' ( out block{ out int a}) + + +Linked compute stage: + + +Shader version: 430 +local_size = (2, 1, 4096) +ERROR: node is still EOpNull! +0:27 Function Definition: main( ( global void) +0:27 Function Parameters: +0:29 Sequence +0:29 Barrier ( global void) +0:30 MemoryBarrier ( global void) +0:31 MemoryBarrierAtomicCounter ( global void) +0:32 MemoryBarrierBuffer ( global void) +0:33 MemoryBarrierShared ( global void) +0:34 MemoryBarrierImage ( global void) +0:35 GroupMemoryBarrier ( global void) +0:36 move second child to first child ( temp int) +0:36 value: direct index for structure (layout( column_major shared) buffer int) +0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer runtime-sized array of float values}) +0:36 Constant: +0:36 0 (const uint) +0:36 Convert float to int ( temp int) +0:36 indirect index (layout( column_major shared) temp float) +0:36 values: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:36 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer runtime-sized array of float values}) +0:36 Constant: +0:36 1 (const uint) +0:36 'gl_LocalInvocationIndex' ( in uint LocalInvocationIndex) +0:39 Test condition and select ( temp void) +0:39 Condition +0:39 Compare Greater Than ( temp bool) +0:39 'a' ( temp int) +0:39 Constant: +0:39 10 (const int) +0:39 true case +0:40 Barrier ( global void) +0:? Linker Objects +0:? 'gl_WorkGroupSize' ( const 3-component vector of uint WorkGroupSize) +0:? 2 (const uint) +0:? 1 (const uint) +0:? 4096 (const uint) +0:? 'total' ( const int) +0:? 66592 (const int) +0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer runtime-sized array of float values}) +0:? 'invalid' (layout( column_major shared) buffer block{layout( column_major shared) buffer 1-element array of float values, layout( column_major shared) buffer int value}) +0:? 'v3' (layout( location=2) in 3-component vector of float) +0:? 'f' ( in float) +0:? 'fo' ( out float) +0:? 's' ( shared 4-component vector of float) +0:? 'sl' (layout( location=2) shared 4-component vector of float) +0:? 'fs' ( shared float) +0:? 'arrX' ( global 2-element array of int) +0:? 'arrY' ( global 1-element array of int) +0:? 'arrZ' ( global 4096-element array of int) +0:? 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer unsized 3-element array of float values}) +0:? 'roll' ( uniform double) +0:? 'destTex' ( writeonly uniform image2D) +0:? 'inbi' ( in block{ in int a}) +0:? 'outbi' ( out block{ out int a}) + diff --git a/deps/glslang/Test/baseResults/430.vert.out b/deps/glslang/Test/baseResults/430.vert.out new file mode 100644 index 00000000..29ffb01a --- /dev/null +++ b/deps/glslang/Test/baseResults/430.vert.out @@ -0,0 +1,340 @@ +430.vert +ERROR: 0:3: 'location' : can only apply to uniform, buffer, in, or out storage qualifiers +ERROR: 0:7: 'input block' : not supported in this stage: vertex +ERROR: 0:7: 'location qualifier on in/out block' : not supported for this version or the enabled extensions +ERROR: 0:8: 'location qualifier on in/out block' : not supported for this version or the enabled extensions +ERROR: 0:23: 'invariant' : can only apply to an output +ERROR: 0:21: 'g' : cannot use storage or interpolation qualifiers on structure members +ERROR: 0:22: 'h' : cannot use storage or interpolation qualifiers on structure members +ERROR: 0:23: 'i' : cannot use invariant qualifier on structure members +ERROR: 0:24: 'j' : cannot use memory qualifiers on structure members +ERROR: 0:25: 'm3' : cannot use layout qualifiers on structure members +ERROR: 0:28: '' : cannot use invariant qualifier on a function parameter +ERROR: 0:30: '' : cannot use layout qualifiers on a function parameter +ERROR: 0:31: '' : cannot use auxiliary or interpolation qualifiers on a function parameter +ERROR: 0:42: 'location' : overlapping use of location 53 +ERROR: 0:47: 'gl_ClipDistance array size' : must be less than or equal to gl_MaxClipDistances (8) +ERROR: 0:51: 'start' : undeclared identifier +ERROR: 0:51: '' : constant expression required +ERROR: 0:51: 'layout-id value' : scalar integer expression required +ERROR: 0:53: 'input block' : not supported in this stage: vertex +ERROR: 0:54: 'location on block member' : not supported for this version or the enabled extensions +ERROR: 0:57: 'input block' : not supported in this stage: vertex +ERROR: 0:58: 'location on block member' : not supported for this version or the enabled extensions +ERROR: 0:59: 'location on block member' : not supported for this version or the enabled extensions +ERROR: 0:62: 'uniform buffer-member align' : not supported for this version or the enabled extensions +ERROR: 0:64: 'uniform buffer-member align' : not supported for this version or the enabled extensions +ERROR: 0:65: 'uniform buffer-member align' : not supported for this version or the enabled extensions +ERROR: 0:65: 'offset on block member' : not supported for this version or the enabled extensions +ERROR: 0:66: 'offset on block member' : not supported for this version or the enabled extensions +ERROR: 0:64: 'align' : can only be used with std140 or std430 layout packing +ERROR: 0:65: 'offset/align' : can only be used with std140 or std430 layout packing +ERROR: 0:66: 'offset/align' : can only be used with std140 or std430 layout packing +ERROR: 0:71: 'offset on block member' : not supported for this version or the enabled extensions +ERROR: 0:74: 'gl_MaxTransformFeedbackBuffers' : required extension not requested: GL_ARB_enhanced_layouts +ERROR: 0:75: 'gl_MaxTransformFeedbackInterleavedComponents' : required extension not requested: GL_ARB_enhanced_layouts +ERROR: 0:78: 'transform feedback qualifier' : not supported for this version or the enabled extensions +ERROR: 0:81: 'transform feedback qualifier' : not supported for this version or the enabled extensions +ERROR: 0:81: 'transform feedback qualifier' : not supported for this version or the enabled extensions +ERROR: 0:83: 'transform feedback qualifier' : not supported for this version or the enabled extensions +ERROR: 0:83: 'transform feedback qualifier' : not supported for this version or the enabled extensions +ERROR: 0:83: 'transform feedback qualifier' : not supported for this version or the enabled extensions +ERROR: 0:84: 'transform feedback qualifier' : not supported for this version or the enabled extensions +ERROR: 0:84: 'transform feedback qualifier' : not supported for this version or the enabled extensions +ERROR: 0:86: 'transform feedback qualifier' : not supported for this version or the enabled extensions +ERROR: 0:86: 'transform feedback qualifier' : not supported for this version or the enabled extensions +ERROR: 0:86: 'transform feedback qualifier' : not supported for this version or the enabled extensions +ERROR: 0:92: 'transform feedback qualifier' : not supported for this version or the enabled extensions +ERROR: 0:93: 'transform feedback qualifier' : not supported for this version or the enabled extensions +ERROR: 0:93: 'transform feedback qualifier' : not supported for this version or the enabled extensions +ERROR: 0:93: 'transform feedback qualifier' : not supported for this version or the enabled extensions +ERROR: 0:117: 'input block' : not supported in this stage: vertex +ERROR: 0:123: 'input block' : not supported in this stage: vertex +ERROR: 0:146: 'shared' : not supported in this stage: vertex +ERROR: 0:150: 'barrier' : no matching overloaded function found +ERROR: 0:154: 'memoryBarrierShared' : no matching overloaded function found +ERROR: 0:156: 'groupMemoryBarrier' : no matching overloaded function found +ERROR: 0:159: 'buffer' : buffers can be declared only as blocks +ERROR: 0:168: 'textureSamples and imageSamples' : not supported for this version or the enabled extensions +ERROR: 0:169: 'textureSamples and imageSamples' : not supported for this version or the enabled extensions +ERROR: 0:170: 'textureSamples and imageSamples' : not supported for this version or the enabled extensions +ERROR: 0:171: 'textureSamples and imageSamples' : not supported for this version or the enabled extensions +ERROR: 0:221: 'textureQueryLevels' : no matching overloaded function found +ERROR: 0:221: 'assign' : cannot convert from ' const float' to ' temp int' +ERROR: 0:222: 'textureQueryLevels' : no matching overloaded function found +ERROR: 0:222: 'assign' : cannot convert from ' const float' to ' temp int' +ERROR: 64 compilation errors. No code generated. + + +Shader version: 430 +Requested GL_ARB_enhanced_layouts +Requested GL_ARB_shader_texture_image_samples +in xfb mode +ERROR: node is still EOpNull! +0:14 Function Definition: foo( ( global void) +0:14 Function Parameters: +0:16 Sequence +0:16 move second child to first child ( temp float) +0:16 direct index ( temp float ClipDistance) +0:16 gl_ClipDistance: direct index for structure ( out 17-element array of float ClipDistance) +0:16 'anon@0' ( out block{ out 17-element array of float ClipDistance gl_ClipDistance, }) +0:16 Constant: +0:16 2 (const uint) +0:16 Constant: +0:16 2 (const int) +0:16 Constant: +0:16 3.700000 +0:31 Function Definition: foo3(vf4;vf3;vf2;vf3; ( global void) +0:31 Function Parameters: +0:31 'v4' ( in 4-component vector of float) +0:31 'v3' ( volatile in 3-component vector of float) +0:31 'v2' ( in 2-component vector of float) +0:31 'cv3' ( in 3-component vector of float) +0:148 Function Definition: fooBarrier( ( global void) +0:148 Function Parameters: +0:150 Sequence +0:150 Constant: +0:150 0.000000 +0:151 MemoryBarrier ( global void) +0:152 MemoryBarrierAtomicCounter ( global void) +0:153 MemoryBarrierBuffer ( global void) +0:154 Constant: +0:154 0.000000 +0:155 MemoryBarrierImage ( global void) +0:156 Constant: +0:156 0.000000 +0:166 Function Definition: fooq( ( global void) +0:166 Function Parameters: +0:168 Sequence +0:168 Sequence +0:168 move second child to first child ( temp int) +0:168 's' ( temp int) +0:168 textureSamples ( global int) +0:168 's2dms' ( uniform sampler2DMS) +0:169 add second child into first child ( temp int) +0:169 's' ( temp int) +0:169 textureSamples ( global int) +0:169 'us2dmsa' ( uniform usampler2DMSArray) +0:170 add second child into first child ( temp int) +0:170 's' ( temp int) +0:170 imageQuerySamples ( global int) +0:170 'ii2dms' (layout( rgba32i) uniform iimage2DMS) +0:171 add second child into first child ( temp int) +0:171 's' ( temp int) +0:171 imageQuerySamples ( global int) +0:171 'i2dmsa' (layout( rgba32f) uniform image2DMSArray) +0:176 Function Definition: fooq2( ( global void) +0:176 Function Parameters: +0:178 Sequence +0:178 Sequence +0:178 move second child to first child ( temp int) +0:178 's' ( temp int) +0:178 textureSamples ( global int) +0:178 's2dms' ( uniform sampler2DMS) +0:179 add second child into first child ( temp int) +0:179 's' ( temp int) +0:179 textureSamples ( global int) +0:179 'us2dmsa' ( uniform usampler2DMSArray) +0:180 add second child into first child ( temp int) +0:180 's' ( temp int) +0:180 imageQuerySamples ( global int) +0:180 'ii2dms' (layout( rgba32i) uniform iimage2DMS) +0:181 add second child into first child ( temp int) +0:181 's' ( temp int) +0:181 imageQuerySamples ( global int) +0:181 'i2dmsa' (layout( rgba32f) uniform image2DMSArray) +0:202 Function Definition: qlod( ( global void) +0:202 Function Parameters: +0:? Sequence +0:206 move second child to first child ( temp int) +0:206 'levels' ( temp int) +0:206 textureQueryLevels ( global int) +0:206 'samp1D' ( uniform sampler1D) +0:207 move second child to first child ( temp int) +0:207 'levels' ( temp int) +0:207 textureQueryLevels ( global int) +0:207 'usamp2D' ( uniform usampler2D) +0:208 move second child to first child ( temp int) +0:208 'levels' ( temp int) +0:208 textureQueryLevels ( global int) +0:208 'isamp3D' ( uniform isampler3D) +0:209 move second child to first child ( temp int) +0:209 'levels' ( temp int) +0:209 textureQueryLevels ( global int) +0:209 'isampCube' ( uniform isamplerCube) +0:210 move second child to first child ( temp int) +0:210 'levels' ( temp int) +0:210 textureQueryLevels ( global int) +0:210 'isamp1DA' ( uniform isampler1DArray) +0:211 move second child to first child ( temp int) +0:211 'levels' ( temp int) +0:211 textureQueryLevels ( global int) +0:211 'samp2DA' ( uniform sampler2DArray) +0:212 move second child to first child ( temp int) +0:212 'levels' ( temp int) +0:212 textureQueryLevels ( global int) +0:212 'usampCubeA' ( uniform usamplerCubeArray) +0:214 move second child to first child ( temp int) +0:214 'levels' ( temp int) +0:214 textureQueryLevels ( global int) +0:214 'samp1Ds' ( uniform sampler1DShadow) +0:215 move second child to first child ( temp int) +0:215 'levels' ( temp int) +0:215 textureQueryLevels ( global int) +0:215 'samp2Ds' ( uniform sampler2DShadow) +0:216 move second child to first child ( temp int) +0:216 'levels' ( temp int) +0:216 textureQueryLevels ( global int) +0:216 'sampCubes' ( uniform samplerCubeShadow) +0:217 move second child to first child ( temp int) +0:217 'levels' ( temp int) +0:217 textureQueryLevels ( global int) +0:217 'samp1DAs' ( uniform sampler1DArrayShadow) +0:218 move second child to first child ( temp int) +0:218 'levels' ( temp int) +0:218 textureQueryLevels ( global int) +0:218 'samp2DAs' ( uniform sampler2DArrayShadow) +0:219 move second child to first child ( temp int) +0:219 'levels' ( temp int) +0:219 textureQueryLevels ( global int) +0:219 'sampCubeAs' ( uniform samplerCubeArrayShadow) +0:221 'levels' ( temp int) +0:222 'levels' ( temp int) +0:? Linker Objects +0:? 'v4' (layout( location=3) temp 4-component vector of float) +0:? 'uv4' (layout( location=4) uniform 4-component vector of float) +0:? 'b1' (layout( location=2) in block{ in 4-component vector of float v}) +0:? 'b2' (layout( location=2) out block{ out 4-component vector of float v}) +0:? 'anon@0' ( out block{ out 17-element array of float ClipDistance gl_ClipDistance, }) +0:? 'cs' (layout( location=10) smooth out 2-element array of structure{ global 7-element array of 3X2 matrix of float m, global float f}) +0:? 'cf' (layout( location=54) smooth out float) +0:? 'cg' (layout( location=53) smooth out float) +0:? 'alias1' (layout( location=10) in 4-component vector of float) +0:? 'alias2' (layout( location=10) in 4-component vector of float) +0:? 'v6e' (layout( location=0) in 4-component vector of float) +0:? 'ininst2e' ( in block{layout( location=25) in float f2}) +0:? 'in4e' ( in block{layout( location=50) in float f1, layout( location=51) in float f2}) +0:? 'inst4e' (layout( column_major std140 align=16) uniform block{layout( column_major std140 offset=0 align=16) uniform int a}) +0:? 'inst9e' (layout( column_major shared align=32) uniform block{layout( column_major shared offset=12 align=4) uniform float f, layout( column_major shared offset=20) uniform float g}) +0:? 'spinste' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float a, layout( column_major std140 offset=32) uniform 3-component vector of float b}) +0:? 'aconste' ( global 4-element array of int) +0:? 'bconste' ( global 64-element array of int) +0:? 'bbinst2' ( out block{layout( xfb_buffer=0 xfb_offset=64) out 4-component vector of float bbv}) +0:? 'bge' (layout( xfb_buffer=2 xfb_offset=48 xfb_stride=80) smooth out 4-component vector of float) +0:? 'bhe' (layout( xfb_buffer=3 xfb_offset=32 xfb_stride=64) smooth out 4-component vector of float) +0:? 'bbinst4e' (layout( xfb_stride=80) out block{layout( xfb_buffer=2 xfb_offset=16) out 4-component vector of float bbv1, layout( xfb_buffer=2 xfb_offset=32) out 4-component vector of float bbv2}) +0:? 'bbinst5e' ( out block{layout( xfb_buffer=3 xfb_offset=0) out 4-component vector of float bbv1, layout( xfb_buffer=3 xfb_offset=48 xfb_stride=64) out 4-component vector of float bbv2}) +0:? 'inst4' (layout( column_major std140 align=16) uniform block{layout( column_major std140 offset=0 align=16) uniform int a}) +0:? 'inst9' (layout( column_major std430 align=32) uniform block{layout( column_major std430 offset=12 align=4) uniform float f, layout( column_major std430 offset=20 align=32) uniform float g}) +0:? 'spinst' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float a, layout( column_major std140 offset=32) uniform 3-component vector of float b}) +0:? 'aconst' ( global 4-element array of int) +0:? 'bconst' ( global 64-element array of int) +0:? 'start2' ( const int) +0:? 5 (const int) +0:? 'v6' (layout( location=19) in 4-component vector of float) +0:? 'ininst2' ( in block{layout( location=28) in bool b1, layout( location=29) in float f1, layout( location=25) in float f2}) +0:? 'in4' ( in block{layout( location=50) in float f1, layout( location=51) in float f2}) +0:? 'bbinst2g' ( out block{layout( xfb_buffer=3 xfb_offset=64) out 4-component vector of float bbv}) +0:? 'bg' (layout( xfb_buffer=1 xfb_offset=48 xfb_stride=80) smooth out 4-component vector of float) +0:? 'bh' (layout( xfb_buffer=1 xfb_offset=32 xfb_stride=80) smooth out 4-component vector of float) +0:? 'bbinst4' (layout( xfb_stride=80) out block{layout( xfb_buffer=1 xfb_offset=16) out 4-component vector of float bbv1}) +0:? 'bbinst5' ( out block{layout( xfb_buffer=1 xfb_offset=0) out 4-component vector of float bbv1, layout( xfb_buffer=1 xfb_offset=64 xfb_stride=80) out 4-component vector of float bbv2}) +0:? 'sharedv' ( shared 4-component vector of float) +0:? 'v' ( buffer 4-component vector of float) +0:? 's2dms' ( uniform sampler2DMS) +0:? 'us2dmsa' ( uniform usampler2DMSArray) +0:? 'ii2dms' (layout( rgba32i) uniform iimage2DMS) +0:? 'i2dmsa' (layout( rgba32f) uniform image2DMSArray) +0:? 'samp1D' ( uniform sampler1D) +0:? 'usamp2D' ( uniform usampler2D) +0:? 'isamp3D' ( uniform isampler3D) +0:? 'isampCube' ( uniform isamplerCube) +0:? 'isamp1DA' ( uniform isampler1DArray) +0:? 'samp2DA' ( uniform sampler2DArray) +0:? 'usampCubeA' ( uniform usamplerCubeArray) +0:? 'samp1Ds' ( uniform sampler1DShadow) +0:? 'samp2Ds' ( uniform sampler2DShadow) +0:? 'sampCubes' ( uniform samplerCubeShadow) +0:? 'samp1DAs' ( uniform sampler1DArrayShadow) +0:? 'samp2DAs' ( uniform sampler2DArrayShadow) +0:? 'sampCubeAs' ( uniform samplerCubeArrayShadow) +0:? 'sampBuf' ( uniform samplerBuffer) +0:? 'sampRect' ( uniform sampler2DRect) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + +ERROR: Linking vertex stage: Missing entry point: Each stage requires one entry point +ERROR: Linking vertex stage: xfb_stride is too small to hold all buffer entries: +ERROR: xfb_buffer 3, xfb_stride 64, minimum stride needed: 80 + +Shader version: 430 +Requested GL_ARB_enhanced_layouts +Requested GL_ARB_shader_texture_image_samples +in xfb mode +ERROR: node is still EOpNull! +0:? Linker Objects +0:? 'v4' (layout( location=3) temp 4-component vector of float) +0:? 'uv4' (layout( location=4) uniform 4-component vector of float) +0:? 'b1' (layout( location=2) in block{ in 4-component vector of float v}) +0:? 'b2' (layout( location=2) out block{ out 4-component vector of float v}) +0:? 'anon@0' ( out block{ out 17-element array of float ClipDistance gl_ClipDistance, }) +0:? 'cs' (layout( location=10) smooth out 2-element array of structure{ global 7-element array of 3X2 matrix of float m, global float f}) +0:? 'cf' (layout( location=54) smooth out float) +0:? 'cg' (layout( location=53) smooth out float) +0:? 'alias1' (layout( location=10) in 4-component vector of float) +0:? 'alias2' (layout( location=10) in 4-component vector of float) +0:? 'v6e' (layout( location=0) in 4-component vector of float) +0:? 'ininst2e' ( in block{layout( location=25) in float f2}) +0:? 'in4e' ( in block{layout( location=50) in float f1, layout( location=51) in float f2}) +0:? 'inst4e' (layout( column_major std140 align=16) uniform block{layout( column_major std140 offset=0 align=16) uniform int a}) +0:? 'inst9e' (layout( column_major shared align=32) uniform block{layout( column_major shared offset=12 align=4) uniform float f, layout( column_major shared offset=20) uniform float g}) +0:? 'spinste' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float a, layout( column_major std140 offset=32) uniform 3-component vector of float b}) +0:? 'aconste' ( global 4-element array of int) +0:? 'bconste' ( global 64-element array of int) +0:? 'bbinst2' ( out block{layout( xfb_buffer=0 xfb_offset=64) out 4-component vector of float bbv}) +0:? 'bge' (layout( xfb_buffer=2 xfb_offset=48 xfb_stride=80) smooth out 4-component vector of float) +0:? 'bhe' (layout( xfb_buffer=3 xfb_offset=32 xfb_stride=64) smooth out 4-component vector of float) +0:? 'bbinst4e' (layout( xfb_stride=80) out block{layout( xfb_buffer=2 xfb_offset=16) out 4-component vector of float bbv1, layout( xfb_buffer=2 xfb_offset=32) out 4-component vector of float bbv2}) +0:? 'bbinst5e' ( out block{layout( xfb_buffer=3 xfb_offset=0) out 4-component vector of float bbv1, layout( xfb_buffer=3 xfb_offset=48 xfb_stride=64) out 4-component vector of float bbv2}) +0:? 'inst4' (layout( column_major std140 align=16) uniform block{layout( column_major std140 offset=0 align=16) uniform int a}) +0:? 'inst9' (layout( column_major std430 align=32) uniform block{layout( column_major std430 offset=12 align=4) uniform float f, layout( column_major std430 offset=20 align=32) uniform float g}) +0:? 'spinst' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float a, layout( column_major std140 offset=32) uniform 3-component vector of float b}) +0:? 'aconst' ( global 4-element array of int) +0:? 'bconst' ( global 64-element array of int) +0:? 'start2' ( const int) +0:? 5 (const int) +0:? 'v6' (layout( location=19) in 4-component vector of float) +0:? 'ininst2' ( in block{layout( location=28) in bool b1, layout( location=29) in float f1, layout( location=25) in float f2}) +0:? 'in4' ( in block{layout( location=50) in float f1, layout( location=51) in float f2}) +0:? 'bbinst2g' ( out block{layout( xfb_buffer=3 xfb_offset=64) out 4-component vector of float bbv}) +0:? 'bg' (layout( xfb_buffer=1 xfb_offset=48 xfb_stride=80) smooth out 4-component vector of float) +0:? 'bh' (layout( xfb_buffer=1 xfb_offset=32 xfb_stride=80) smooth out 4-component vector of float) +0:? 'bbinst4' (layout( xfb_stride=80) out block{layout( xfb_buffer=1 xfb_offset=16) out 4-component vector of float bbv1}) +0:? 'bbinst5' ( out block{layout( xfb_buffer=1 xfb_offset=0) out 4-component vector of float bbv1, layout( xfb_buffer=1 xfb_offset=64 xfb_stride=80) out 4-component vector of float bbv2}) +0:? 'sharedv' ( shared 4-component vector of float) +0:? 'v' ( buffer 4-component vector of float) +0:? 's2dms' ( uniform sampler2DMS) +0:? 'us2dmsa' ( uniform usampler2DMSArray) +0:? 'ii2dms' (layout( rgba32i) uniform iimage2DMS) +0:? 'i2dmsa' (layout( rgba32f) uniform image2DMSArray) +0:? 'samp1D' ( uniform sampler1D) +0:? 'usamp2D' ( uniform usampler2D) +0:? 'isamp3D' ( uniform isampler3D) +0:? 'isampCube' ( uniform isamplerCube) +0:? 'isamp1DA' ( uniform isampler1DArray) +0:? 'samp2DA' ( uniform sampler2DArray) +0:? 'usampCubeA' ( uniform usamplerCubeArray) +0:? 'samp1Ds' ( uniform sampler1DShadow) +0:? 'samp2Ds' ( uniform sampler2DShadow) +0:? 'sampCubes' ( uniform samplerCubeShadow) +0:? 'samp1DAs' ( uniform sampler1DArrayShadow) +0:? 'samp2DAs' ( uniform sampler2DArrayShadow) +0:? 'sampCubeAs' ( uniform samplerCubeArrayShadow) +0:? 'sampBuf' ( uniform samplerBuffer) +0:? 'sampRect' ( uniform sampler2DRect) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/430AofA.frag.out b/deps/glslang/Test/baseResults/430AofA.frag.out new file mode 100644 index 00000000..ac23dacb --- /dev/null +++ b/deps/glslang/Test/baseResults/430AofA.frag.out @@ -0,0 +1,774 @@ +430AofA.frag +ERROR: 0:6: '[]' : only outermost dimension of an array of arrays can be implicitly sized +ERROR: 0:14: 'constructor' : constructing non-array constituent from array argument +ERROR: 0:15: 'constructor' : array constructor argument not correct type to construct array element +ERROR: 0:28: '[' : array index out of range '4' +ERROR: 0:56: 'constructor' : cannot convert parameter 2 from ' const 3-element array of 4-component vector of float' to ' temp 2-element array of 4-component vector of float' +ERROR: 0:60: 'constructor' : cannot convert parameter 2 from ' const 2-element array of 4-component vector of float' to ' temp 3-element array of 4-component vector of float' +ERROR: 0:64: '=' : cannot convert from ' const 3-element array of 2-element array of 4-component vector of float' to ' temp 4-element array of 2-element array of 4-component vector of float' +ERROR: 0:70: 'assign' : cannot convert from ' global 4-element array of 7-element array of float' to ' global 5-element array of 7-element array of float' +ERROR: 0:71: 'assign' : cannot convert from ' global 4-element array of 7-element array of float' to ' global unsized 1-element array of 7-element array of float' +ERROR: 0:73: 'foo' : no matching overloaded function found +ERROR: 0:78: '==' : wrong operand types: no operation '==' exists that takes a left-hand operand of type ' global 4-element array of 7-element array of float' and a right operand of type ' global 5-element array of 7-element array of float' (or there is no acceptable conversion) +ERROR: 0:84: '[' : array index out of range '5' +ERROR: 0:91: 'length' : array must be declared with a size before using this method +ERROR: 0:93: 'length' : array must be declared with a size before using this method +ERROR: 0:98: 'length' : does not operate on this type: temp float +ERROR: 0:98: '' : function call, method, or subroutine call expected +ERROR: 0:98: '' : no matching overloaded function found +ERROR: 0:101: 'resize2' : redeclaration of array with a different array dimensions or sizes +ERROR: 0:104: 'resize3' : redeclaration of array with a different array dimensions or sizes +ERROR: 0:107: 'resize4' : redeclaration of array with a different element type +ERROR: 20 compilation errors. No code generated. + + +Shader version: 430 +ERROR: node is still EOpNull! +0:10 Function Definition: foo(f1[5][7]; ( global 4-element array of 7-element array of float) +0:10 Function Parameters: +0:10 'a' ( in 5-element array of 7-element array of float) +0:? Sequence +0:13 move second child to first child ( temp 7-element array of float) +0:13 'r' ( temp 7-element array of float) +0:13 direct index ( temp 7-element array of float) +0:13 'a' ( in 5-element array of 7-element array of float) +0:13 Constant: +0:13 2 (const int) +0:14 Constant: +0:14 0.000000 +0:15 Constant: +0:15 0.000000 +0:16 Branch: Return with expression +0:16 Construct float ( temp 4-element array of 7-element array of float) +0:16 direct index ( temp 7-element array of float) +0:16 'a' ( in 5-element array of 7-element array of float) +0:16 Constant: +0:16 0 (const int) +0:16 direct index ( temp 7-element array of float) +0:16 'a' ( in 5-element array of 7-element array of float) +0:16 Constant: +0:16 1 (const int) +0:16 'r' ( temp 7-element array of float) +0:16 direct index ( temp 7-element array of float) +0:16 'a' ( in 5-element array of 7-element array of float) +0:16 Constant: +0:16 3 (const int) +0:17 Branch: Return with expression +0:17 Construct float ( temp 4-element array of 7-element array of float) +0:17 direct index ( temp 7-element array of float) +0:17 'a' ( in 5-element array of 7-element array of float) +0:17 Constant: +0:17 0 (const int) +0:17 direct index ( temp 7-element array of float) +0:17 'a' ( in 5-element array of 7-element array of float) +0:17 Constant: +0:17 1 (const int) +0:17 'r' ( temp 7-element array of float) +0:17 direct index ( temp 7-element array of float) +0:17 'a' ( in 5-element array of 7-element array of float) +0:17 Constant: +0:17 3 (const int) +0:18 Branch: Return with expression +0:18 Construct float ( temp 4-element array of 7-element array of float) +0:18 direct index ( temp 7-element array of float) +0:18 'a' ( in 5-element array of 7-element array of float) +0:18 Constant: +0:18 0 (const int) +0:18 direct index ( temp 7-element array of float) +0:18 'a' ( in 5-element array of 7-element array of float) +0:18 Constant: +0:18 1 (const int) +0:18 direct index ( temp 7-element array of float) +0:18 'a' ( in 5-element array of 7-element array of float) +0:18 Constant: +0:18 2 (const int) +0:18 direct index ( temp 7-element array of float) +0:18 'a' ( in 5-element array of 7-element array of float) +0:18 Constant: +0:18 3 (const int) +0:21 Function Definition: bar(f1[5][7]; ( global void) +0:21 Function Parameters: +0:21 '' ( in 5-element array of 7-element array of float) +0:23 Function Definition: main( ( global void) +0:23 Function Parameters: +0:? Sequence +0:? Sequence +0:28 move second child to first child ( temp float) +0:28 direct index ( temp float) +0:28 direct index ( temp 2-element array of float) +0:28 direct index ( temp 4-element array of 2-element array of float) +0:28 'gu' ( temp 3-element array of 4-element array of 2-element array of float) +0:28 Constant: +0:28 2 (const int) +0:28 Constant: +0:28 4 (const int) +0:28 Constant: +0:28 1 (const int) +0:28 Constant: +0:28 4.000000 +0:30 Sequence +0:30 move second child to first child ( temp 3-element array of 2-element array of 4-component vector of float) +0:30 'ca4' ( temp 3-element array of 2-element array of 4-component vector of float) +0:32 Constant: +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:33 Sequence +0:33 move second child to first child ( temp 3-element array of 2-element array of 4-component vector of float) +0:33 'caim' ( temp 3-element array of 2-element array of 4-component vector of float) +0:35 Constant: +0:35 4.000000 +0:35 4.000000 +0:35 4.000000 +0:35 4.000000 +0:35 2.000000 +0:35 2.000000 +0:35 2.000000 +0:35 2.000000 +0:35 4.000000 +0:35 4.000000 +0:35 4.000000 +0:35 4.000000 +0:35 2.000000 +0:35 2.000000 +0:35 2.000000 +0:35 2.000000 +0:35 4.000000 +0:35 4.000000 +0:35 4.000000 +0:35 4.000000 +0:35 2.000000 +0:35 2.000000 +0:35 2.000000 +0:35 2.000000 +0:36 Sequence +0:36 move second child to first child ( temp 3-element array of 2-element array of 4-component vector of float) +0:36 'caim2' ( temp 3-element array of 2-element array of 4-component vector of float) +0:38 Constant: +0:38 4.000000 +0:38 4.000000 +0:38 4.000000 +0:38 4.000000 +0:38 2.000000 +0:38 2.000000 +0:38 2.000000 +0:38 2.000000 +0:38 4.000000 +0:38 4.000000 +0:38 4.000000 +0:38 4.000000 +0:38 2.000000 +0:38 2.000000 +0:38 2.000000 +0:38 2.000000 +0:38 4.000000 +0:38 4.000000 +0:38 4.000000 +0:38 4.000000 +0:38 2.000000 +0:38 2.000000 +0:38 2.000000 +0:38 2.000000 +0:39 Sequence +0:39 move second child to first child ( temp 3-element array of 2-element array of 4-component vector of float) +0:39 'caim3' ( temp 3-element array of 2-element array of 4-component vector of float) +0:41 Constant: +0:41 4.000000 +0:41 4.000000 +0:41 4.000000 +0:41 4.000000 +0:41 2.000000 +0:41 2.000000 +0:41 2.000000 +0:41 2.000000 +0:41 4.000000 +0:41 4.000000 +0:41 4.000000 +0:41 4.000000 +0:41 2.000000 +0:41 2.000000 +0:41 2.000000 +0:41 2.000000 +0:41 4.000000 +0:41 4.000000 +0:41 4.000000 +0:41 4.000000 +0:41 2.000000 +0:41 2.000000 +0:41 2.000000 +0:41 2.000000 +0:43 Sequence +0:43 move second child to first child ( temp 3-element array of 2-element array of 4-component vector of float) +0:43 'a4' ( temp 3-element array of 2-element array of 4-component vector of float) +0:43 Constant: +0:43 0.000000 +0:43 0.000000 +0:43 0.000000 +0:43 0.000000 +0:43 1.000000 +0:43 1.000000 +0:43 1.000000 +0:43 1.000000 +0:43 0.000000 +0:43 0.000000 +0:43 0.000000 +0:43 0.000000 +0:43 1.000000 +0:43 1.000000 +0:43 1.000000 +0:43 1.000000 +0:43 0.000000 +0:43 0.000000 +0:43 0.000000 +0:43 0.000000 +0:43 1.000000 +0:43 1.000000 +0:43 1.000000 +0:43 1.000000 +0:46 Sequence +0:46 move second child to first child ( temp 3-element array of 2-element array of 4-component vector of float) +0:46 'aim' ( temp 3-element array of 2-element array of 4-component vector of float) +0:46 Constant: +0:46 4.000000 +0:46 4.000000 +0:46 4.000000 +0:46 4.000000 +0:46 2.000000 +0:46 2.000000 +0:46 2.000000 +0:46 2.000000 +0:46 4.000000 +0:46 4.000000 +0:46 4.000000 +0:46 4.000000 +0:46 2.000000 +0:46 2.000000 +0:46 2.000000 +0:46 2.000000 +0:46 4.000000 +0:46 4.000000 +0:46 4.000000 +0:46 4.000000 +0:46 2.000000 +0:46 2.000000 +0:46 2.000000 +0:46 2.000000 +0:49 Sequence +0:49 move second child to first child ( temp 3-element array of 2-element array of 4-component vector of float) +0:49 'aim2' ( temp 3-element array of 2-element array of 4-component vector of float) +0:49 Constant: +0:49 4.000000 +0:49 4.000000 +0:49 4.000000 +0:49 4.000000 +0:49 2.000000 +0:49 2.000000 +0:49 2.000000 +0:49 2.000000 +0:49 4.000000 +0:49 4.000000 +0:49 4.000000 +0:49 4.000000 +0:49 2.000000 +0:49 2.000000 +0:49 2.000000 +0:49 2.000000 +0:49 4.000000 +0:49 4.000000 +0:49 4.000000 +0:49 4.000000 +0:49 2.000000 +0:49 2.000000 +0:49 2.000000 +0:49 2.000000 +0:52 Sequence +0:52 move second child to first child ( temp 3-element array of 2-element array of 4-component vector of float) +0:52 'aim3' ( temp 3-element array of 2-element array of 4-component vector of float) +0:52 Constant: +0:52 4.000000 +0:52 4.000000 +0:52 4.000000 +0:52 4.000000 +0:52 2.000000 +0:52 2.000000 +0:52 2.000000 +0:52 2.000000 +0:52 4.000000 +0:52 4.000000 +0:52 4.000000 +0:52 4.000000 +0:52 2.000000 +0:52 2.000000 +0:52 2.000000 +0:52 2.000000 +0:52 4.000000 +0:52 4.000000 +0:52 4.000000 +0:52 4.000000 +0:52 2.000000 +0:52 2.000000 +0:52 2.000000 +0:52 2.000000 +0:69 move second child to first child ( temp 4-element array of 7-element array of float) +0:69 'g4' ( global 4-element array of 7-element array of float) +0:69 Function Call: foo(f1[5][7]; ( global 4-element array of 7-element array of float) +0:69 'g5' ( global 5-element array of 7-element array of float) +0:70 'g5' ( global 5-element array of 7-element array of float) +0:71 'gu' ( global unsized 1-element array of 7-element array of float) +0:73 Constant: +0:73 0.000000 +0:74 Function Call: bar(f1[5][7]; ( global void) +0:74 'g5' ( global 5-element array of 7-element array of float) +0:76 Test condition and select ( temp void) +0:76 Condition +0:76 Compare Equal ( temp bool) +0:76 Function Call: foo(f1[5][7]; ( global 4-element array of 7-element array of float) +0:76 'g5' ( global 5-element array of 7-element array of float) +0:76 'g4' ( global 4-element array of 7-element array of float) +0:76 true case is null +0:78 Test condition and select ( temp void) +0:78 Condition +0:78 Constant: +0:78 false (const bool) +0:78 true case is null +0:82 move second child to first child ( temp float) +0:82 direct index ( temp float) +0:82 direct index ( temp 7-element array of float) +0:82 'u' ( temp 5-element array of 7-element array of float) +0:82 Constant: +0:82 2 (const int) +0:82 Constant: +0:82 2 (const int) +0:82 Constant: +0:82 3.000000 +0:84 move second child to first child ( temp float) +0:84 direct index ( temp float) +0:84 direct index ( temp 7-element array of float) +0:84 'u' ( temp 5-element array of 7-element array of float) +0:84 Constant: +0:84 5 (const int) +0:84 Constant: +0:84 2 (const int) +0:84 Constant: +0:84 5.000000 +0:85 Function Call: foo(f1[5][7]; ( global 4-element array of 7-element array of float) +0:85 'u' ( temp 5-element array of 7-element array of float) +0:88 Function Definition: foo3( ( global void) +0:88 Function Parameters: +0:? Sequence +0:91 Constant: +0:91 1 (const int) +0:92 move second child to first child ( temp float) +0:92 direct index ( temp float) +0:92 direct index ( temp 7-element array of float) +0:92 direct index ( temp 5-element array of 7-element array of float) +0:92 'resize1' ( temp 3-element array of 5-element array of 7-element array of float) +0:92 Constant: +0:92 1 (const int) +0:92 Constant: +0:92 4 (const int) +0:92 Constant: +0:92 5 (const int) +0:92 Constant: +0:92 2.000000 +0:93 Constant: +0:93 1 (const int) +0:95 Constant: +0:95 3 (const int) +0:96 Constant: +0:96 5 (const int) +0:97 Constant: +0:97 7 (const int) +0:98 Constant: +0:98 0.000000 +0:? Linker Objects +0:? 'many' ( global 1-element array of 2-element array of 3-element array of 4-element array of 5-element array of 6-element array of float) +0:? 'gu' ( global unsized 1-element array of 7-element array of float) +0:? 'gimp' ( global unsized 1-element array of 1-element array of float) +0:? 'g4' ( global 4-element array of 7-element array of float) +0:? 'g5' ( global 5-element array of 7-element array of float) + + +Linked fragment stage: + + +Shader version: 430 +ERROR: node is still EOpNull! +0:10 Function Definition: foo(f1[5][7]; ( global 4-element array of 7-element array of float) +0:10 Function Parameters: +0:10 'a' ( in 5-element array of 7-element array of float) +0:? Sequence +0:13 move second child to first child ( temp 7-element array of float) +0:13 'r' ( temp 7-element array of float) +0:13 direct index ( temp 7-element array of float) +0:13 'a' ( in 5-element array of 7-element array of float) +0:13 Constant: +0:13 2 (const int) +0:14 Constant: +0:14 0.000000 +0:15 Constant: +0:15 0.000000 +0:16 Branch: Return with expression +0:16 Construct float ( temp 4-element array of 7-element array of float) +0:16 direct index ( temp 7-element array of float) +0:16 'a' ( in 5-element array of 7-element array of float) +0:16 Constant: +0:16 0 (const int) +0:16 direct index ( temp 7-element array of float) +0:16 'a' ( in 5-element array of 7-element array of float) +0:16 Constant: +0:16 1 (const int) +0:16 'r' ( temp 7-element array of float) +0:16 direct index ( temp 7-element array of float) +0:16 'a' ( in 5-element array of 7-element array of float) +0:16 Constant: +0:16 3 (const int) +0:17 Branch: Return with expression +0:17 Construct float ( temp 4-element array of 7-element array of float) +0:17 direct index ( temp 7-element array of float) +0:17 'a' ( in 5-element array of 7-element array of float) +0:17 Constant: +0:17 0 (const int) +0:17 direct index ( temp 7-element array of float) +0:17 'a' ( in 5-element array of 7-element array of float) +0:17 Constant: +0:17 1 (const int) +0:17 'r' ( temp 7-element array of float) +0:17 direct index ( temp 7-element array of float) +0:17 'a' ( in 5-element array of 7-element array of float) +0:17 Constant: +0:17 3 (const int) +0:18 Branch: Return with expression +0:18 Construct float ( temp 4-element array of 7-element array of float) +0:18 direct index ( temp 7-element array of float) +0:18 'a' ( in 5-element array of 7-element array of float) +0:18 Constant: +0:18 0 (const int) +0:18 direct index ( temp 7-element array of float) +0:18 'a' ( in 5-element array of 7-element array of float) +0:18 Constant: +0:18 1 (const int) +0:18 direct index ( temp 7-element array of float) +0:18 'a' ( in 5-element array of 7-element array of float) +0:18 Constant: +0:18 2 (const int) +0:18 direct index ( temp 7-element array of float) +0:18 'a' ( in 5-element array of 7-element array of float) +0:18 Constant: +0:18 3 (const int) +0:21 Function Definition: bar(f1[5][7]; ( global void) +0:21 Function Parameters: +0:21 '' ( in 5-element array of 7-element array of float) +0:23 Function Definition: main( ( global void) +0:23 Function Parameters: +0:? Sequence +0:? Sequence +0:28 move second child to first child ( temp float) +0:28 direct index ( temp float) +0:28 direct index ( temp 2-element array of float) +0:28 direct index ( temp 4-element array of 2-element array of float) +0:28 'gu' ( temp 3-element array of 4-element array of 2-element array of float) +0:28 Constant: +0:28 2 (const int) +0:28 Constant: +0:28 4 (const int) +0:28 Constant: +0:28 1 (const int) +0:28 Constant: +0:28 4.000000 +0:30 Sequence +0:30 move second child to first child ( temp 3-element array of 2-element array of 4-component vector of float) +0:30 'ca4' ( temp 3-element array of 2-element array of 4-component vector of float) +0:32 Constant: +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:33 Sequence +0:33 move second child to first child ( temp 3-element array of 2-element array of 4-component vector of float) +0:33 'caim' ( temp 3-element array of 2-element array of 4-component vector of float) +0:35 Constant: +0:35 4.000000 +0:35 4.000000 +0:35 4.000000 +0:35 4.000000 +0:35 2.000000 +0:35 2.000000 +0:35 2.000000 +0:35 2.000000 +0:35 4.000000 +0:35 4.000000 +0:35 4.000000 +0:35 4.000000 +0:35 2.000000 +0:35 2.000000 +0:35 2.000000 +0:35 2.000000 +0:35 4.000000 +0:35 4.000000 +0:35 4.000000 +0:35 4.000000 +0:35 2.000000 +0:35 2.000000 +0:35 2.000000 +0:35 2.000000 +0:36 Sequence +0:36 move second child to first child ( temp 3-element array of 2-element array of 4-component vector of float) +0:36 'caim2' ( temp 3-element array of 2-element array of 4-component vector of float) +0:38 Constant: +0:38 4.000000 +0:38 4.000000 +0:38 4.000000 +0:38 4.000000 +0:38 2.000000 +0:38 2.000000 +0:38 2.000000 +0:38 2.000000 +0:38 4.000000 +0:38 4.000000 +0:38 4.000000 +0:38 4.000000 +0:38 2.000000 +0:38 2.000000 +0:38 2.000000 +0:38 2.000000 +0:38 4.000000 +0:38 4.000000 +0:38 4.000000 +0:38 4.000000 +0:38 2.000000 +0:38 2.000000 +0:38 2.000000 +0:38 2.000000 +0:39 Sequence +0:39 move second child to first child ( temp 3-element array of 2-element array of 4-component vector of float) +0:39 'caim3' ( temp 3-element array of 2-element array of 4-component vector of float) +0:41 Constant: +0:41 4.000000 +0:41 4.000000 +0:41 4.000000 +0:41 4.000000 +0:41 2.000000 +0:41 2.000000 +0:41 2.000000 +0:41 2.000000 +0:41 4.000000 +0:41 4.000000 +0:41 4.000000 +0:41 4.000000 +0:41 2.000000 +0:41 2.000000 +0:41 2.000000 +0:41 2.000000 +0:41 4.000000 +0:41 4.000000 +0:41 4.000000 +0:41 4.000000 +0:41 2.000000 +0:41 2.000000 +0:41 2.000000 +0:41 2.000000 +0:43 Sequence +0:43 move second child to first child ( temp 3-element array of 2-element array of 4-component vector of float) +0:43 'a4' ( temp 3-element array of 2-element array of 4-component vector of float) +0:43 Constant: +0:43 0.000000 +0:43 0.000000 +0:43 0.000000 +0:43 0.000000 +0:43 1.000000 +0:43 1.000000 +0:43 1.000000 +0:43 1.000000 +0:43 0.000000 +0:43 0.000000 +0:43 0.000000 +0:43 0.000000 +0:43 1.000000 +0:43 1.000000 +0:43 1.000000 +0:43 1.000000 +0:43 0.000000 +0:43 0.000000 +0:43 0.000000 +0:43 0.000000 +0:43 1.000000 +0:43 1.000000 +0:43 1.000000 +0:43 1.000000 +0:46 Sequence +0:46 move second child to first child ( temp 3-element array of 2-element array of 4-component vector of float) +0:46 'aim' ( temp 3-element array of 2-element array of 4-component vector of float) +0:46 Constant: +0:46 4.000000 +0:46 4.000000 +0:46 4.000000 +0:46 4.000000 +0:46 2.000000 +0:46 2.000000 +0:46 2.000000 +0:46 2.000000 +0:46 4.000000 +0:46 4.000000 +0:46 4.000000 +0:46 4.000000 +0:46 2.000000 +0:46 2.000000 +0:46 2.000000 +0:46 2.000000 +0:46 4.000000 +0:46 4.000000 +0:46 4.000000 +0:46 4.000000 +0:46 2.000000 +0:46 2.000000 +0:46 2.000000 +0:46 2.000000 +0:49 Sequence +0:49 move second child to first child ( temp 3-element array of 2-element array of 4-component vector of float) +0:49 'aim2' ( temp 3-element array of 2-element array of 4-component vector of float) +0:49 Constant: +0:49 4.000000 +0:49 4.000000 +0:49 4.000000 +0:49 4.000000 +0:49 2.000000 +0:49 2.000000 +0:49 2.000000 +0:49 2.000000 +0:49 4.000000 +0:49 4.000000 +0:49 4.000000 +0:49 4.000000 +0:49 2.000000 +0:49 2.000000 +0:49 2.000000 +0:49 2.000000 +0:49 4.000000 +0:49 4.000000 +0:49 4.000000 +0:49 4.000000 +0:49 2.000000 +0:49 2.000000 +0:49 2.000000 +0:49 2.000000 +0:52 Sequence +0:52 move second child to first child ( temp 3-element array of 2-element array of 4-component vector of float) +0:52 'aim3' ( temp 3-element array of 2-element array of 4-component vector of float) +0:52 Constant: +0:52 4.000000 +0:52 4.000000 +0:52 4.000000 +0:52 4.000000 +0:52 2.000000 +0:52 2.000000 +0:52 2.000000 +0:52 2.000000 +0:52 4.000000 +0:52 4.000000 +0:52 4.000000 +0:52 4.000000 +0:52 2.000000 +0:52 2.000000 +0:52 2.000000 +0:52 2.000000 +0:52 4.000000 +0:52 4.000000 +0:52 4.000000 +0:52 4.000000 +0:52 2.000000 +0:52 2.000000 +0:52 2.000000 +0:52 2.000000 +0:69 move second child to first child ( temp 4-element array of 7-element array of float) +0:69 'g4' ( global 4-element array of 7-element array of float) +0:69 Function Call: foo(f1[5][7]; ( global 4-element array of 7-element array of float) +0:69 'g5' ( global 5-element array of 7-element array of float) +0:70 'g5' ( global 5-element array of 7-element array of float) +0:71 'gu' ( global 1-element array of 7-element array of float) +0:73 Constant: +0:73 0.000000 +0:74 Function Call: bar(f1[5][7]; ( global void) +0:74 'g5' ( global 5-element array of 7-element array of float) +0:76 Test condition and select ( temp void) +0:76 Condition +0:76 Compare Equal ( temp bool) +0:76 Function Call: foo(f1[5][7]; ( global 4-element array of 7-element array of float) +0:76 'g5' ( global 5-element array of 7-element array of float) +0:76 'g4' ( global 4-element array of 7-element array of float) +0:76 true case is null +0:78 Test condition and select ( temp void) +0:78 Condition +0:78 Constant: +0:78 false (const bool) +0:78 true case is null +0:82 move second child to first child ( temp float) +0:82 direct index ( temp float) +0:82 direct index ( temp 7-element array of float) +0:82 'u' ( temp 5-element array of 7-element array of float) +0:82 Constant: +0:82 2 (const int) +0:82 Constant: +0:82 2 (const int) +0:82 Constant: +0:82 3.000000 +0:84 move second child to first child ( temp float) +0:84 direct index ( temp float) +0:84 direct index ( temp 7-element array of float) +0:84 'u' ( temp 5-element array of 7-element array of float) +0:84 Constant: +0:84 5 (const int) +0:84 Constant: +0:84 2 (const int) +0:84 Constant: +0:84 5.000000 +0:85 Function Call: foo(f1[5][7]; ( global 4-element array of 7-element array of float) +0:85 'u' ( temp 5-element array of 7-element array of float) +0:? Linker Objects +0:? 'many' ( global 1-element array of 2-element array of 3-element array of 4-element array of 5-element array of 6-element array of float) +0:? 'gu' ( global 1-element array of 7-element array of float) +0:? 'gimp' ( global 1-element array of 1-element array of float) +0:? 'g4' ( global 4-element array of 7-element array of float) +0:? 'g5' ( global 5-element array of 7-element array of float) + diff --git a/deps/glslang/Test/baseResults/430scope.vert.out b/deps/glslang/Test/baseResults/430scope.vert.out new file mode 100644 index 00000000..973c21aa --- /dev/null +++ b/deps/glslang/Test/baseResults/430scope.vert.out @@ -0,0 +1,230 @@ +430scope.vert +ERROR: 0:5: 'a' : redefinition +ERROR: 0:17: 'b' : function name is redeclaration of existing name +ERROR: 0:20: 'c' : redefinition +ERROR: 0:22: 'f' : redefinition +ERROR: 0:43: 'sin' : can't use function syntax on variable +ERROR: 0:57: 'z' : undeclared identifier +ERROR: 0:57: 'z' : redefinition +ERROR: 0:73: 'degrees' : can't use function syntax on variable +ERROR: 8 compilation errors. No code generated. + + +Shader version: 430 +ERROR: node is still EOpNull! +0:3 Function Definition: f(i1;i1;i1; ( global int) +0:3 Function Parameters: +0:3 'a' ( in int) +0:3 'b' ( in int) +0:3 'c' ( in int) +0:? Sequence +0:8 Sequence +0:8 Sequence +0:8 move second child to first child ( temp float) +0:8 'a' ( temp float) +0:8 add ( temp float) +0:8 Convert int to float ( temp float) +0:8 'a' ( in int) +0:8 Constant: +0:8 1.000000 +0:11 Branch: Return with expression +0:11 'a' ( in int) +0:25 Function Definition: cos(f1; ( global float) +0:25 Function Parameters: +0:25 'x' ( in float) +0:27 Sequence +0:27 Branch: Return with expression +0:27 Constant: +0:27 1.000000 +0:29 Function Definition: radians(b1; ( global bool) +0:29 Function Parameters: +0:29 'x' ( in bool) +0:31 Sequence +0:31 Branch: Return with expression +0:31 Constant: +0:31 true (const bool) +0:36 Function Definition: main( ( global void) +0:36 Function Parameters: +0:? Sequence +0:39 Function Call: g( ( temp int) +0:42 'sin' ( temp float) +0:43 Constant: +0:43 0.000000 +0:44 Function Call: f(i1;i1;i1; ( global int) +0:44 Constant: +0:44 1 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 Constant: +0:44 3 (const int) +0:47 move second child to first child ( temp float) +0:47 'f' ( temp float) +0:47 Constant: +0:47 3.000000 +0:49 move second child to first child ( temp 4-component vector of float) +0:49 gl_Position: direct index for structure ( invariant gl_Position 4-component vector of float Position) +0:49 'anon@0' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:49 Constant: +0:49 0 (const uint) +0:49 Construct vec4 ( temp 4-component vector of float) +0:49 'f' ( temp float) +0:51 Sequence +0:51 Sequence +0:51 move second child to first child ( temp int) +0:51 'f' ( temp int) +0:51 Constant: +0:51 0 (const int) +0:51 Loop with condition tested first +0:51 Loop Condition +0:51 Compare Less Than ( temp bool) +0:51 'f' ( temp int) +0:51 Constant: +0:51 10 (const int) +0:51 Loop Body +0:52 Pre-Increment ( temp int) +0:52 'f' ( temp int) +0:51 Loop Terminal Expression +0:51 Pre-Increment ( temp int) +0:51 'f' ( temp int) +0:54 Sequence +0:54 move second child to first child ( temp int) +0:54 'x' ( temp int) +0:54 Constant: +0:54 1 (const int) +0:56 Sequence +0:56 Sequence +0:56 move second child to first child ( temp float) +0:56 'x' ( temp float) +0:56 Constant: +0:56 2.000000 +0:56 move second child to first child ( temp float) +0:56 'y' ( temp float) +0:56 'x' ( temp float) +0:60 Sequence +0:60 Sequence +0:60 move second child to first child ( temp int) +0:60 'x' ( temp int) +0:60 'x' ( temp int) +0:68 Sequence +0:68 Sequence +0:68 move second child to first child ( temp structure{ temp int x}) +0:68 'S' ( temp structure{ temp int x}) +0:68 Constant: +0:68 0 (const int) +0:69 x: direct index for structure ( temp int) +0:69 'S' ( temp structure{ temp int x}) +0:69 Constant: +0:69 0 (const int) +0:73 Constant: +0:73 0.000000 +0:? Linker Objects +0:? 'b' ( global bool) +0:? 'tan' ( global float) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + +ERROR: Linking vertex stage: No function definition (body) found: + g( + +Shader version: 430 +ERROR: node is still EOpNull! +0:3 Function Definition: f(i1;i1;i1; ( global int) +0:3 Function Parameters: +0:3 'a' ( in int) +0:3 'b' ( in int) +0:3 'c' ( in int) +0:? Sequence +0:8 Sequence +0:8 Sequence +0:8 move second child to first child ( temp float) +0:8 'a' ( temp float) +0:8 add ( temp float) +0:8 Convert int to float ( temp float) +0:8 'a' ( in int) +0:8 Constant: +0:8 1.000000 +0:11 Branch: Return with expression +0:11 'a' ( in int) +0:36 Function Definition: main( ( global void) +0:36 Function Parameters: +0:? Sequence +0:39 Function Call: g( ( temp int) +0:42 'sin' ( temp float) +0:43 Constant: +0:43 0.000000 +0:44 Function Call: f(i1;i1;i1; ( global int) +0:44 Constant: +0:44 1 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 Constant: +0:44 3 (const int) +0:47 move second child to first child ( temp float) +0:47 'f' ( temp float) +0:47 Constant: +0:47 3.000000 +0:49 move second child to first child ( temp 4-component vector of float) +0:49 gl_Position: direct index for structure ( invariant gl_Position 4-component vector of float Position) +0:49 'anon@0' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:49 Constant: +0:49 0 (const uint) +0:49 Construct vec4 ( temp 4-component vector of float) +0:49 'f' ( temp float) +0:51 Sequence +0:51 Sequence +0:51 move second child to first child ( temp int) +0:51 'f' ( temp int) +0:51 Constant: +0:51 0 (const int) +0:51 Loop with condition tested first +0:51 Loop Condition +0:51 Compare Less Than ( temp bool) +0:51 'f' ( temp int) +0:51 Constant: +0:51 10 (const int) +0:51 Loop Body +0:52 Pre-Increment ( temp int) +0:52 'f' ( temp int) +0:51 Loop Terminal Expression +0:51 Pre-Increment ( temp int) +0:51 'f' ( temp int) +0:54 Sequence +0:54 move second child to first child ( temp int) +0:54 'x' ( temp int) +0:54 Constant: +0:54 1 (const int) +0:56 Sequence +0:56 Sequence +0:56 move second child to first child ( temp float) +0:56 'x' ( temp float) +0:56 Constant: +0:56 2.000000 +0:56 move second child to first child ( temp float) +0:56 'y' ( temp float) +0:56 'x' ( temp float) +0:60 Sequence +0:60 Sequence +0:60 move second child to first child ( temp int) +0:60 'x' ( temp int) +0:60 'x' ( temp int) +0:68 Sequence +0:68 Sequence +0:68 move second child to first child ( temp structure{ temp int x}) +0:68 'S' ( temp structure{ temp int x}) +0:68 Constant: +0:68 0 (const int) +0:69 x: direct index for structure ( temp int) +0:69 'S' ( temp structure{ temp int x}) +0:69 Constant: +0:69 0 (const int) +0:73 Constant: +0:73 0.000000 +0:? Linker Objects +0:? 'b' ( global bool) +0:? 'tan' ( global float) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/435.vert.out b/deps/glslang/Test/baseResults/435.vert.out new file mode 100644 index 00000000..188a0a43 --- /dev/null +++ b/deps/glslang/Test/baseResults/435.vert.out @@ -0,0 +1,25 @@ +435.vert +ERROR: version not supported +ERROR: 1 compilation errors. No code generated. + + +Shader version: 450 +ERROR: node is still EOpNull! +0:2 Function Definition: main( ( global void) +0:2 Function Parameters: +0:? Linker Objects +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 450 +ERROR: node is still EOpNull! +0:2 Function Definition: main( ( global void) +0:2 Function Parameters: +0:? Linker Objects +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/440.frag.out b/deps/glslang/Test/baseResults/440.frag.out new file mode 100644 index 00000000..18e014f9 --- /dev/null +++ b/deps/glslang/Test/baseResults/440.frag.out @@ -0,0 +1,165 @@ +440.frag +ERROR: 0:11: 'location' : overlapping use of location 4 +ERROR: 0:13: 'component' : type overflows the available 4 components +ERROR: 0:22: 'location' : fragment outputs sharing the same location must be the same basic type 30 +ERROR: 0:24: 'qualifier' : cannot use auxiliary, memory, interpolation, or precision qualifier in a default qualifier declaration (declaration with no type) +ERROR: 0:25: 'qualifier' : cannot use auxiliary, memory, interpolation, or precision qualifier in a default qualifier declaration (declaration with no type) +ERROR: 0:26: 'qualifier' : cannot use auxiliary, memory, interpolation, or precision qualifier in a default qualifier declaration (declaration with no type) +ERROR: 0:29: 'layout qualifier' : cannot use offset or align qualifiers in a default qualifier declaration (declaration with no type) +ERROR: 0:30: 'layout qualifier' : cannot use offset or align qualifiers in a default qualifier declaration (declaration with no type) +ERROR: 0:30: 'layout' : offset/align can only be used on a uniform or buffer +ERROR: 0:31: 'layout qualifier' : cannot use offset or align qualifiers in a default qualifier declaration (declaration with no type) +ERROR: 0:31: 'layout' : offset/align can only be used on a uniform or buffer +ERROR: 0:33: 'layout qualifier' : cannot use offset or align qualifiers in a default qualifier declaration (declaration with no type) +ERROR: 0:34: 'layout qualifier' : cannot use offset or align qualifiers in a default qualifier declaration (declaration with no type) +ERROR: 0:34: 'layout' : offset/align can only be used on a uniform or buffer +ERROR: 0:35: 'layout qualifier' : cannot use offset or align qualifiers in a default qualifier declaration (declaration with no type) +ERROR: 0:35: 'layout' : offset/align can only be used on a uniform or buffer +ERROR: 0:37: 'offset' : only applies to block members, not blocks +ERROR: 0:38: 'layout' : offset/align can only be used on a uniform or buffer +ERROR: 0:38: 'offset' : only applies to block members, not blocks +ERROR: 0:39: 'output block' : not supported in this stage: fragment +ERROR: 0:39: 'layout' : offset/align can only be used on a uniform or buffer +ERROR: 0:39: 'offset' : only applies to block members, not blocks +ERROR: 0:42: 'align' : can only be used with std140 or std430 layout packing +ERROR: 0:43: 'align' : can only be used with std140 or std430 layout packing +ERROR: 0:43: 'layout' : offset/align can only be used on a uniform or buffer +ERROR: 0:44: 'output block' : not supported in this stage: fragment +ERROR: 0:44: 'align' : can only be used with std140 or std430 layout packing +ERROR: 0:44: 'layout' : offset/align can only be used on a uniform or buffer +ERROR: 0:46: 'offset' : cannot specify on a variable declaration +ERROR: 0:47: 'layout' : offset/align can only be used on a uniform or buffer +ERROR: 0:48: 'layout' : offset/align can only be used on a uniform or buffer +ERROR: 0:50: 'align' : cannot specify on a variable declaration +ERROR: 0:51: 'layout' : offset/align can only be used on a uniform or buffer +ERROR: 0:52: 'layout' : offset/align can only be used on a uniform or buffer +ERROR: 0:54: 'layout' : matrix or packing qualifiers can only be used on a uniform or buffer +ERROR: 0:55: 'layout' : cannot specify packing on a variable declaration +ERROR: 0:57: 'align' : must be a power of 2 +ERROR: 0:58: 'offset/align' : can only be used with std140 or std430 layout packing +ERROR: 0:62: 'offset/align' : can only be used with std140 or std430 layout packing +ERROR: 0:63: 'offset/align' : can only be used with std140 or std430 layout packing +ERROR: 0:62: 'layout' : offset/align can only be used on a uniform or buffer +ERROR: 0:63: 'layout' : offset/align can only be used on a uniform or buffer +ERROR: 0:84: 'align' : must be a power of 2 +ERROR: 0:83: 'offset' : cannot lie in previous members +ERROR: 0:85: 'offset' : must be a multiple of the member's alignment +ERROR: 0:103: 'align' : must be a power of 2 +ERROR: 0:105: 'align' : must be a power of 2 +ERROR: 0:102: 'offset' : cannot lie in previous members +ERROR: 0:104: 'offset' : must be a multiple of the member's alignment +ERROR: 49 compilation errors. No code generated. + + +Shader version: 440 +ERROR: node is still EOpNull! +0:144 Function Definition: interp( ( global void) +0:144 Function Parameters: +0:146 Sequence +0:146 interpolateAtCentroid ( global 2-component vector of float) +0:146 vector swizzle ( temp 2-component vector of float) +0:146 direct index ( smooth sample temp 3-component vector of float) +0:146 'sampInArray' ( smooth sample in 4-element array of 3-component vector of float) +0:146 Constant: +0:146 2 (const int) +0:146 Sequence +0:146 Constant: +0:146 0 (const int) +0:146 Constant: +0:146 1 (const int) +0:147 interpolateAtSample ( global float) +0:147 direct index ( temp float) +0:147 direct index ( smooth sample temp 3-component vector of float) +0:147 'sampInArray' ( smooth sample in 4-element array of 3-component vector of float) +0:147 Constant: +0:147 2 (const int) +0:147 Constant: +0:147 0 (const int) +0:147 Constant: +0:147 2 (const int) +0:150 Function Definition: layer( ( global int) +0:150 Function Parameters: +0:152 Sequence +0:152 Branch: Return with expression +0:152 'gl_Layer' ( flat in int Layer) +0:? Linker Objects +0:? 'a' (layout( location=4 component=2) smooth in 2-component vector of float) +0:? 'b' (layout( location=4 component=1) smooth in float) +0:? 'h' (layout( location=4 component=2) smooth in 2-component vector of float) +0:? 'c' (layout( location=3 component=2) smooth in 3-component vector of float) +0:? 'e' (layout( location=20 component=0) smooth in 6-element array of 3-component vector of float) +0:? 'f' (layout( location=20 component=3) smooth in 6-element array of float) +0:? 'be' (layout( location=30 component=3) out int) +0:? 'bf' (layout( location=30 component=0) out 3-component vector of float) +0:? 'inst1' (layout( column_major shared offset=12) uniform block{layout( column_major shared) uniform int a}) +0:? 'inst2' (layout( offset=12) in block{ in int a}) +0:? 'inst3' (layout( offset=12) out block{ out int a}) +0:? 'inst4' (layout( column_major std140 align=16) uniform block{layout( column_major std140 offset=0 align=16) uniform int a}) +0:? 'inst8' (layout( column_major shared align=16) uniform block{layout( column_major shared) uniform int a}) +0:? 'inst5' (layout( align=16) in block{ in int a}) +0:? 'inst6' (layout( align=16) out block{ out int a}) +0:? 'v1' (layout( offset=12) uniform 4-component vector of float) +0:? 'v2' (layout( offset=12) smooth in 4-component vector of float) +0:? 'v3' (layout( offset=12) out 4-component vector of float) +0:? 'v4' (layout( align=16) uniform 4-component vector of float) +0:? 'v5' (layout( align=16) smooth in 4-component vector of float) +0:? 'v6' (layout( align=16) out 4-component vector of float) +0:? 'v7' (layout( std140) uniform 4-component vector of float) +0:? 'inst7' (layout( column_major shared) uniform block{layout( column_major shared offset=12 align=4) uniform float f}) +0:? 'inst10' ( in block{layout( offset=12) in float f, layout( align=4) in float g}) +0:? 'inst9' (layout( column_major std430 align=32) uniform block{layout( column_major std430 align=32) uniform float e, layout( column_major std430 offset=12 align=4) uniform float f, layout( column_major std430 offset=20 align=32) uniform float g, layout( column_major std430 align=32) uniform float h}) +0:? 'inst11' (layout( column_major std430) uniform block{layout( column_major std430 offset=12 align=4) uniform float f, layout( column_major std430) uniform float g}) +0:? 'specExampleErrors' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float a, layout( column_major std140 offset=32) uniform 3-component vector of float b, layout( column_major std140 offset=48) uniform 2-component vector of float c, layout( column_major std140 offset=56) uniform double g, layout( column_major std140 offset=72) uniform double h}) +0:? 'specExample' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float a, layout( column_major std140 offset=32) uniform 3-component vector of float b, layout( column_major std140 offset=48) uniform 2-component vector of float d, layout( column_major std140 offset=64 align=16) uniform float e, layout( column_major std140 offset=72 align=2) uniform double f, layout( column_major std140 offset=80) uniform float h, layout( column_major std140 offset=128 align=64) uniform 3-component vector of double i, layout( column_major std140 offset=168 align=8) uniform float j}) +0:? 'specExampleErrors430' (layout( column_major std430) buffer block{layout( column_major std430 offset=0) buffer 4-component vector of float a, layout( column_major std430 offset=32) buffer 3-component vector of float b, layout( column_major std430 offset=48) buffer 2-component vector of float c, layout( column_major std430 offset=56) buffer double g, layout( column_major std430 offset=72) buffer double h, layout( column_major std430 offset=80) buffer double i}) +0:? 'specExample430' (layout( column_major std430) buffer block{layout( column_major std430 offset=0) buffer 4-component vector of float a, layout( column_major std430 offset=32) buffer 3-component vector of float b, layout( column_major std430 offset=48) buffer 2-component vector of float d, layout( column_major std430 offset=64 align=16) buffer float e, layout( column_major std430 offset=72 align=2) buffer double f, layout( column_major std430 offset=80) buffer float h, layout( column_major std430 offset=128 align=64) buffer 3-component vector of double i, layout( column_major std430 offset=168 align=8) buffer float j}) +0:? 'specExample4300' (layout( column_major std430 align=128) buffer block{layout( column_major std430 offset=0 align=128) buffer 4-component vector of float a, layout( column_major std430 offset=128 align=128) buffer 3-component vector of float b, layout( column_major std430 offset=256 align=128) buffer 2-component vector of float d, layout( column_major std430 offset=384 align=128) buffer float e, layout( column_major std430 offset=512 align=128) buffer double f, layout( column_major std430 offset=640 align=128) buffer float h, layout( column_major std430 offset=768 align=128) buffer 3-component vector of double i}) +0:? 'specExample4301' (layout( column_major std430 align=128) buffer block{layout( column_major std430 offset=0 align=128) buffer 4-component vector of float a, layout( column_major std430 offset=128 align=128) buffer 3-component vector of float b, layout( column_major std430 offset=256 align=128) buffer 2-component vector of float d, layout( column_major std430 offset=512 align=128) buffer float e, layout( column_major std430 offset=520 align=8) buffer double f, layout( column_major std430 offset=640 align=128) buffer float h, layout( column_major std430 offset=768 align=128) buffer 3-component vector of double i}) +0:? 'aconst' ( global 4-element array of int) +0:? 'bconst' ( global 64-element array of int) +0:? 'sampInArray' ( smooth sample in 4-element array of 3-component vector of float) + + +Linked fragment stage: + +ERROR: Linking fragment stage: Missing entry point: Each stage requires one entry point + +Shader version: 440 +ERROR: node is still EOpNull! +0:? Linker Objects +0:? 'a' (layout( location=4 component=2) smooth in 2-component vector of float) +0:? 'b' (layout( location=4 component=1) smooth in float) +0:? 'h' (layout( location=4 component=2) smooth in 2-component vector of float) +0:? 'c' (layout( location=3 component=2) smooth in 3-component vector of float) +0:? 'e' (layout( location=20 component=0) smooth in 6-element array of 3-component vector of float) +0:? 'f' (layout( location=20 component=3) smooth in 6-element array of float) +0:? 'be' (layout( location=30 component=3) out int) +0:? 'bf' (layout( location=30 component=0) out 3-component vector of float) +0:? 'inst1' (layout( column_major shared offset=12) uniform block{layout( column_major shared) uniform int a}) +0:? 'inst2' (layout( offset=12) in block{ in int a}) +0:? 'inst3' (layout( offset=12) out block{ out int a}) +0:? 'inst4' (layout( column_major std140 align=16) uniform block{layout( column_major std140 offset=0 align=16) uniform int a}) +0:? 'inst8' (layout( column_major shared align=16) uniform block{layout( column_major shared) uniform int a}) +0:? 'inst5' (layout( align=16) in block{ in int a}) +0:? 'inst6' (layout( align=16) out block{ out int a}) +0:? 'v1' (layout( offset=12) uniform 4-component vector of float) +0:? 'v2' (layout( offset=12) smooth in 4-component vector of float) +0:? 'v3' (layout( offset=12) out 4-component vector of float) +0:? 'v4' (layout( align=16) uniform 4-component vector of float) +0:? 'v5' (layout( align=16) smooth in 4-component vector of float) +0:? 'v6' (layout( align=16) out 4-component vector of float) +0:? 'v7' (layout( std140) uniform 4-component vector of float) +0:? 'inst7' (layout( column_major shared) uniform block{layout( column_major shared offset=12 align=4) uniform float f}) +0:? 'inst10' ( in block{layout( offset=12) in float f, layout( align=4) in float g}) +0:? 'inst9' (layout( column_major std430 align=32) uniform block{layout( column_major std430 align=32) uniform float e, layout( column_major std430 offset=12 align=4) uniform float f, layout( column_major std430 offset=20 align=32) uniform float g, layout( column_major std430 align=32) uniform float h}) +0:? 'inst11' (layout( column_major std430) uniform block{layout( column_major std430 offset=12 align=4) uniform float f, layout( column_major std430) uniform float g}) +0:? 'specExampleErrors' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float a, layout( column_major std140 offset=32) uniform 3-component vector of float b, layout( column_major std140 offset=48) uniform 2-component vector of float c, layout( column_major std140 offset=56) uniform double g, layout( column_major std140 offset=72) uniform double h}) +0:? 'specExample' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float a, layout( column_major std140 offset=32) uniform 3-component vector of float b, layout( column_major std140 offset=48) uniform 2-component vector of float d, layout( column_major std140 offset=64 align=16) uniform float e, layout( column_major std140 offset=72 align=2) uniform double f, layout( column_major std140 offset=80) uniform float h, layout( column_major std140 offset=128 align=64) uniform 3-component vector of double i, layout( column_major std140 offset=168 align=8) uniform float j}) +0:? 'specExampleErrors430' (layout( column_major std430) buffer block{layout( column_major std430 offset=0) buffer 4-component vector of float a, layout( column_major std430 offset=32) buffer 3-component vector of float b, layout( column_major std430 offset=48) buffer 2-component vector of float c, layout( column_major std430 offset=56) buffer double g, layout( column_major std430 offset=72) buffer double h, layout( column_major std430 offset=80) buffer double i}) +0:? 'specExample430' (layout( column_major std430) buffer block{layout( column_major std430 offset=0) buffer 4-component vector of float a, layout( column_major std430 offset=32) buffer 3-component vector of float b, layout( column_major std430 offset=48) buffer 2-component vector of float d, layout( column_major std430 offset=64 align=16) buffer float e, layout( column_major std430 offset=72 align=2) buffer double f, layout( column_major std430 offset=80) buffer float h, layout( column_major std430 offset=128 align=64) buffer 3-component vector of double i, layout( column_major std430 offset=168 align=8) buffer float j}) +0:? 'specExample4300' (layout( column_major std430 align=128) buffer block{layout( column_major std430 offset=0 align=128) buffer 4-component vector of float a, layout( column_major std430 offset=128 align=128) buffer 3-component vector of float b, layout( column_major std430 offset=256 align=128) buffer 2-component vector of float d, layout( column_major std430 offset=384 align=128) buffer float e, layout( column_major std430 offset=512 align=128) buffer double f, layout( column_major std430 offset=640 align=128) buffer float h, layout( column_major std430 offset=768 align=128) buffer 3-component vector of double i}) +0:? 'specExample4301' (layout( column_major std430 align=128) buffer block{layout( column_major std430 offset=0 align=128) buffer 4-component vector of float a, layout( column_major std430 offset=128 align=128) buffer 3-component vector of float b, layout( column_major std430 offset=256 align=128) buffer 2-component vector of float d, layout( column_major std430 offset=512 align=128) buffer float e, layout( column_major std430 offset=520 align=8) buffer double f, layout( column_major std430 offset=640 align=128) buffer float h, layout( column_major std430 offset=768 align=128) buffer 3-component vector of double i}) +0:? 'aconst' ( global 4-element array of int) +0:? 'bconst' ( global 64-element array of int) +0:? 'sampInArray' ( smooth sample in 4-element array of 3-component vector of float) + diff --git a/deps/glslang/Test/baseResults/440.vert.out b/deps/glslang/Test/baseResults/440.vert.out new file mode 100644 index 00000000..41796cb5 --- /dev/null +++ b/deps/glslang/Test/baseResults/440.vert.out @@ -0,0 +1,245 @@ +440.vert +ERROR: 0:8: 'component' : type overflows the available 4 components +ERROR: 0:15: 'component' : component is too large +ERROR: 0:23: 'location' : overlapping use of location 4 +ERROR: 0:26: 'location' : overlapping use of location 2 +ERROR: 0:31: 'location' : overlapping use of location 15 +ERROR: 0:32: 'location' : overlapping use of location 10 +ERROR: 0:37: 'location' : overlapping use of location 20 +ERROR: 0:39: 'component' : type overflows the available 4 components +ERROR: 0:40: 'component' : type overflows the available 4 components +ERROR: 0:42: 'component' : cannot apply to a matrix, structure, or block +ERROR: 0:43: 'component' : cannot apply to a matrix, structure, or block +ERROR: 0:44: 'component' : cannot apply to a matrix, structure, or block +ERROR: 0:46: 'component' : must specify 'location' to use 'component' +ERROR: 0:52: 'location' : overlapping use of location 40 +ERROR: 0:54: 'component' : type overflows the available 4 components +ERROR: 0:55: 'component' : type overflows the available 4 components +ERROR: 0:57: 'component' : cannot apply to a matrix, structure, or block +ERROR: 0:58: 'component' : cannot apply to a matrix, structure, or block +ERROR: 0:61: 'location/component/index' : cannot declare a default, use a full declaration +ERROR: 0:66: 'component' : doubles cannot start on an odd-numbered component +ERROR: 0:67: 'component' : type overflows the available 4 components +ERROR: 0:71: 'location' : overlapping use of location 55 +ERROR: 0:75: 'location' : overlapping use of location 57 +ERROR: 0:78: 'location' : overlapping use of location 59 +ERROR: 0:95: 'xfb layout qualifier' : can only be used on an output +ERROR: 0:101: 'xfb_offset' : cannot declare a default, use a full declaration +ERROR: 0:111: 'xfb_buffer' : member cannot contradict block (or what block inherited from global) +ERROR: 0:116: 'xfb_buffer' : member cannot contradict block (or what block inherited from global) +ERROR: 0:116: 'xfb_offset' : overlapping offsets at offset 32 in buffer 3 +ERROR: 0:117: 'xfb_offset' : overlapping offsets at offset 0 in buffer 2 +ERROR: 0:119: 'xfb_offset' : overlapping offsets at offset 24 in buffer 2 +ERROR: 0:122: 'xfb_stride' : all stride settings must match for xfb buffer 15 +ERROR: 0:126: 'xfb_offset' : overlapping offsets at offset 4 in buffer 1 +ERROR: 0:128: 'xfb_stride' : all stride settings must match for xfb buffer 3 +ERROR: 0:129: 'xfb_stride' : all stride settings must match for xfb buffer 3 +ERROR: 0:133: 'xfb_stride' : all stride settings must match for xfb buffer 3 +ERROR: 0:131: 'xfb_stride' : all stride settings must match for xfb buffer 3 +ERROR: 0:152: 'xfb_offset' : overlapping offsets at offset 64 in buffer 0 +ERROR: 0:157: 'xfb_buffer' : buffer is too large: gl_MaxTransformFeedbackBuffers is 4 +ERROR: 0:158: 'xfb_offset' : must be a multiple of size of first component +ERROR: 0:159: 'xfb_offset' : type contains double; xfb_offset must be a multiple of 8 +ERROR: 0:161: 'xfb_offset' : must be a multiple of size of first component +ERROR: 0:162: 'xfb_offset' : type contains double; xfb_offset must be a multiple of 8 +ERROR: 0:166: 'xfb_buffer' : buffer is too large: gl_MaxTransformFeedbackBuffers is 4 +ERROR: 0:169: 'xfb_buffer' : buffer is too large: gl_MaxTransformFeedbackBuffers is 4 +ERROR: 0:169: 'xfb_stride' : 1/4 stride is too large: gl_MaxTransformFeedbackInterleavedComponents is 64 +ERROR: 0:171: 'xfb_buffer' : buffer is too large: gl_MaxTransformFeedbackBuffers is 4 +ERROR: 0:178: 'xfb_offset' : overlapping offsets at offset 36 in buffer 3 +ERROR: 0:179: 'xfb_buffer' : member cannot contradict block (or what block inherited from global) +ERROR: 0:178: 'xfb_offset' : overlapping offsets at offset 32 in buffer 3 +ERROR: 0:185: 'gl_BaseVertexARB' : required extension not requested: GL_ARB_shader_draw_parameters +ERROR: 0:185: 'gl_BaseInstanceARB' : required extension not requested: GL_ARB_shader_draw_parameters +ERROR: 0:185: 'gl_DrawIDARB' : required extension not requested: GL_ARB_shader_draw_parameters +ERROR: 0:193: 'assign' : l-value required "gl_BaseVertexARB" (can't modify shader input) +ERROR: 0:194: 'assign' : l-value required "gl_BaseInstanceARB" (can't modify shader input) +ERROR: 0:195: 'assign' : l-value required "gl_DrawIDARB" (can't modify shader input) +ERROR: 0:196: 'glBaseInstanceARB' : undeclared identifier +ERROR: 57 compilation errors. No code generated. + + +Shader version: 440 +Requested GL_ARB_shader_draw_parameters +in xfb mode +ERROR: node is still EOpNull! +0:183 Function Definition: drawParamsBad( ( global int) +0:183 Function Parameters: +0:185 Sequence +0:185 Branch: Return with expression +0:185 add ( temp int) +0:185 add ( temp int) +0:185 'gl_BaseVertexARB' ( in int BaseVertex) +0:185 'gl_BaseInstanceARB' ( in int BaseInstance) +0:185 'gl_DrawIDARB' ( in int DrawId) +0:190 Function Definition: drawParams( ( global int) +0:190 Function Parameters: +0:192 Sequence +0:192 Branch: Return with expression +0:192 add ( temp int) +0:192 add ( temp int) +0:192 'gl_BaseVertexARB' ( in int BaseVertex) +0:192 'gl_BaseInstanceARB' ( in int BaseInstance) +0:192 'gl_DrawIDARB' ( in int DrawId) +0:193 move second child to first child ( temp int) +0:193 'gl_BaseVertexARB' ( in int BaseVertex) +0:193 Constant: +0:193 3 (const int) +0:194 move second child to first child ( temp int) +0:194 'gl_BaseInstanceARB' ( in int BaseInstance) +0:194 Constant: +0:194 3 (const int) +0:195 move second child to first child ( temp int) +0:195 'gl_DrawIDARB' ( in int DrawId) +0:195 Constant: +0:195 3 (const int) +0:196 'glBaseInstanceARB' ( temp float) +0:? Linker Objects +0:? 'a' (layout( location=2 component=2) in 2-component vector of float) +0:? 'b' (layout( location=2 component=1) in float) +0:? 'c' (layout( location=3 component=2) in 3-component vector of float) +0:? 'd' (layout( location=0 component=3) in 4-element array of float) +0:? 'e' (layout( location=4 component=0) in 5-element array of 3-component vector of float) +0:? 'f' (layout( location=4 component=3) in 5-element array of float) +0:? 'g' (layout( location=9) in 6-element array of float) +0:? 'h' (layout( location=4 component=2) in 2-component vector of float) +0:? 'i' (layout( location=3 component=2) smooth out 2-component vector of float) +0:? 'j' (layout( location=3 component=0) smooth out 2-component vector of float) +0:? 'k' (layout( location=4 component=2) smooth out 2-component vector of float) +0:? 'm' (layout( location=4 component=2) smooth out 2-component vector of float) +0:? 'n' (layout( location=2 component=2) smooth out 2-component vector of float) +0:? 'p' (layout( location=2 component=0) smooth out 3-component vector of float) +0:? 'q' (layout( location=10 component=3) smooth out 6-element array of float) +0:? 'r' (layout( location=10 component=0) smooth out 6-element array of 3-component vector of float) +0:? 's' (layout( location=15 component=3) smooth out float) +0:? 't' (layout( location=10 component=1) smooth out float) +0:? 'u' (layout( location=20 component=2) smooth out float) +0:? 'v' (layout( location=20 component=0) smooth out float) +0:? 'w' (layout( location=20 component=3) smooth out float) +0:? 'x' (layout( location=20 component=1) smooth out 2-component vector of float) +0:? 'y' (layout( location=30 component=3) smooth out 2-component vector of float) +0:? 'z' (layout( location=31 component=1) smooth out 4-component vector of float) +0:? 'ba' (layout( location=32 component=1) smooth out 4X4 matrix of float) +0:? 'Ss' (layout( location=33 component=1) smooth out structure{ global int a}) +0:? 'bb' (layout( location=34 component=1) out block{ out int a}) +0:? 'bc' (layout( location=4095 component=1) smooth out float) +0:? 'bd' ( out block{layout( location=40 component=2) out float u, layout( location=40 component=0) out float v, layout( location=40 component=3) out float w, layout( location=40 component=1) out 2-component vector of float x, layout( location=41 component=3) out 2-component vector of float y, layout( location=42 component=1) out 4-component vector of float z, layout( location=42 component=1) out 4X4 matrix of float ba, layout( location=43 component=1) out structure{ global int a} Ss}) +0:? 'be' (layout( location=50 component=3) smooth out int) +0:? 'bf' (layout( location=50 component=0) smooth out 3-component vector of float) +0:? 'dfo' (layout( location=51 component=1) smooth out double) +0:? 'dvo' (layout( location=52 component=2) smooth out 2-component vector of double) +0:? 'dfo2' (layout( location=53) smooth out double) +0:? 'ffv2' (layout( location=53 component=2) smooth out 2-component vector of float) +0:? 'dvec4out' (layout( location=54) smooth out 4-component vector of double) +0:? 'overf' (layout( location=55) smooth out float) +0:? 'df2o' (layout( location=56 component=1) smooth out 2-component vector of float) +0:? 'sf2o' (layout( location=56 component=3) smooth out float) +0:? 'dv3o' (layout( location=57 component=2) smooth out 2-component vector of float) +0:? 'sf4o' (layout( location=57 component=3) smooth out float) +0:? 'dv3o2' (layout( location=58) flat out 3-component vector of double) +0:? 'dfo3' (layout( location=59 component=2) flat out double) +0:? 'dfo4' (layout( location=59 component=0) flat out double) +0:? 'bbinst1' ( out block{ out 4-component vector of float bbv}) +0:? 'bbinst2' ( out block{layout( xfb_buffer=0 xfb_offset=64) out 4-component vector of float bbv}) +0:? 'bbinst3' ( out block{layout( xfb_buffer=3 xfb_offset=16) out 4-component vector of float bbv}) +0:? 'ubbinst3' (layout( column_major shared) uniform block{layout( column_major shared xfb_offset=16) uniform 4-component vector of float bbv}) +0:? 'bg' (layout( xfb_buffer=2 xfb_offset=48 xfb_stride=80) smooth out 4-component vector of float) +0:? 'bh' (layout( xfb_buffer=3 xfb_offset=32 xfb_stride=64) smooth out 4-component vector of float) +0:? 'bbinst4' (layout( xfb_stride=80) out block{layout( xfb_buffer=2 xfb_offset=16) out 4-component vector of float bbv1, layout( xfb_buffer=2 xfb_offset=32) out 4-component vector of float bbv2}) +0:? 'bbinst5' ( out block{layout( xfb_buffer=3 xfb_offset=0) out 4-component vector of float bbv1, layout( xfb_buffer=3 xfb_offset=48 xfb_stride=64) out 4-component vector of float bbv2, out 4-component vector of float bbv3}) +0:? 'bbinst6' ( out block{layout( xfb_buffer=2 xfb_offset=0) out 4-component vector of float bbv1, layout( xfb_buffer=3 xfb_offset=32 xfb_stride=64) out 4-component vector of float bbv2, layout( xfb_buffer=2 xfb_offset=0) out 4-component vector of float bbv3, out 4-component vector of float bbv5, layout( xfb_buffer=2 xfb_offset=24) out float bbf6}) +0:? 'bj' (layout( xfb_buffer=1 xfb_offset=4) smooth out float) +0:? 'bk' (layout( xfb_buffer=1 xfb_offset=0) smooth out 2-component vector of int) +0:? 'bl' (layout( xfb_stride=48) smooth out float) +0:? 'bbinst7' (layout( xfb_stride=48) out block{layout( xfb_stride=64) out 4-component vector of float bbv1, layout( xfb_stride=32) out 4-component vector of float bbv2}) +0:? 'bbinst8' (layout( xfb_stride=92) out block{layout( xfb_buffer=0 xfb_offset=0) out bool b, layout( xfb_buffer=0 xfb_offset=8) out structure{ global bool b, global structure{ global int i, global double d, global float f} s, global 2-component vector of float v2} t, layout( xfb_buffer=0 xfb_offset=48) out int i, layout( xfb_buffer=0 xfb_offset=52) out 3X3 matrix of float m3, layout( xfb_buffer=0 xfb_offset=88) out float f, layout( xfb_buffer=0 xfb_offset=92) out float g}) +0:? 'bbinst9' ( out block{layout( xfb_buffer=4 xfb_offset=1) out bool b, layout( xfb_buffer=4 xfb_offset=12) out structure{ global bool b, global structure{ global int i, global double d, global float f} s, global 2-component vector of float v2} t, layout( xfb_buffer=4 xfb_offset=52) out 3X3 matrix of float m3, layout( xfb_buffer=4 xfb_offset=90) out int i, layout( xfb_buffer=4 xfb_offset=98) out double d, layout( xfb_buffer=4 xfb_offset=108) out structure{ global int a} s}) +0:? 'bm' (layout( xfb_buffer=5 xfb_offset=0) smooth out float) +0:? 'bbinst10' ( out block{layout( xfb_buffer=7 xfb_offset=0) out 4X4 matrix of double m1, layout( xfb_buffer=7 xfb_offset=128) out 4X4 matrix of double m2, layout( xfb_buffer=7 xfb_offset=256) out float f}) +0:? 'anon@0' ( out block{layout( xfb_buffer=3 xfb_offset=36) gl_Position 4-component vector of float Position gl_Position, layout( xfb_buffer=3 xfb_offset=32) gl_PointSize float PointSize gl_PointSize, }) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + +ERROR: Linking vertex stage: Missing entry point: Each stage requires one entry point +ERROR: Linking vertex stage: xfb_stride is too small to hold all buffer entries: +ERROR: xfb_buffer 0, xfb_stride 92, minimum stride needed: 96 +ERROR: Linking vertex stage: xfb_stride must be multiple of 8 for buffer holding a double: +ERROR: xfb_buffer 0, xfb_stride 92 +ERROR: Linking vertex stage: xfb_stride must be multiple of 4: +ERROR: xfb_buffer 5, xfb_stride 6 +ERROR: Linking vertex stage: xfb_stride is too large: +ERROR: xfb_buffer 7, components (1/4 stride) needed are 66, gl_MaxTransformFeedbackInterleavedComponents is 64 + +Shader version: 440 +Requested GL_ARB_shader_draw_parameters +in xfb mode +ERROR: node is still EOpNull! +0:? Linker Objects +0:? 'a' (layout( location=2 component=2) in 2-component vector of float) +0:? 'b' (layout( location=2 component=1) in float) +0:? 'c' (layout( location=3 component=2) in 3-component vector of float) +0:? 'd' (layout( location=0 component=3) in 4-element array of float) +0:? 'e' (layout( location=4 component=0) in 5-element array of 3-component vector of float) +0:? 'f' (layout( location=4 component=3) in 5-element array of float) +0:? 'g' (layout( location=9) in 6-element array of float) +0:? 'h' (layout( location=4 component=2) in 2-component vector of float) +0:? 'i' (layout( location=3 component=2) smooth out 2-component vector of float) +0:? 'j' (layout( location=3 component=0) smooth out 2-component vector of float) +0:? 'k' (layout( location=4 component=2) smooth out 2-component vector of float) +0:? 'm' (layout( location=4 component=2) smooth out 2-component vector of float) +0:? 'n' (layout( location=2 component=2) smooth out 2-component vector of float) +0:? 'p' (layout( location=2 component=0) smooth out 3-component vector of float) +0:? 'q' (layout( location=10 component=3) smooth out 6-element array of float) +0:? 'r' (layout( location=10 component=0) smooth out 6-element array of 3-component vector of float) +0:? 's' (layout( location=15 component=3) smooth out float) +0:? 't' (layout( location=10 component=1) smooth out float) +0:? 'u' (layout( location=20 component=2) smooth out float) +0:? 'v' (layout( location=20 component=0) smooth out float) +0:? 'w' (layout( location=20 component=3) smooth out float) +0:? 'x' (layout( location=20 component=1) smooth out 2-component vector of float) +0:? 'y' (layout( location=30 component=3) smooth out 2-component vector of float) +0:? 'z' (layout( location=31 component=1) smooth out 4-component vector of float) +0:? 'ba' (layout( location=32 component=1) smooth out 4X4 matrix of float) +0:? 'Ss' (layout( location=33 component=1) smooth out structure{ global int a}) +0:? 'bb' (layout( location=34 component=1) out block{ out int a}) +0:? 'bc' (layout( location=4095 component=1) smooth out float) +0:? 'bd' ( out block{layout( location=40 component=2) out float u, layout( location=40 component=0) out float v, layout( location=40 component=3) out float w, layout( location=40 component=1) out 2-component vector of float x, layout( location=41 component=3) out 2-component vector of float y, layout( location=42 component=1) out 4-component vector of float z, layout( location=42 component=1) out 4X4 matrix of float ba, layout( location=43 component=1) out structure{ global int a} Ss}) +0:? 'be' (layout( location=50 component=3) smooth out int) +0:? 'bf' (layout( location=50 component=0) smooth out 3-component vector of float) +0:? 'dfo' (layout( location=51 component=1) smooth out double) +0:? 'dvo' (layout( location=52 component=2) smooth out 2-component vector of double) +0:? 'dfo2' (layout( location=53) smooth out double) +0:? 'ffv2' (layout( location=53 component=2) smooth out 2-component vector of float) +0:? 'dvec4out' (layout( location=54) smooth out 4-component vector of double) +0:? 'overf' (layout( location=55) smooth out float) +0:? 'df2o' (layout( location=56 component=1) smooth out 2-component vector of float) +0:? 'sf2o' (layout( location=56 component=3) smooth out float) +0:? 'dv3o' (layout( location=57 component=2) smooth out 2-component vector of float) +0:? 'sf4o' (layout( location=57 component=3) smooth out float) +0:? 'dv3o2' (layout( location=58) flat out 3-component vector of double) +0:? 'dfo3' (layout( location=59 component=2) flat out double) +0:? 'dfo4' (layout( location=59 component=0) flat out double) +0:? 'bbinst1' ( out block{ out 4-component vector of float bbv}) +0:? 'bbinst2' ( out block{layout( xfb_buffer=0 xfb_offset=64) out 4-component vector of float bbv}) +0:? 'bbinst3' ( out block{layout( xfb_buffer=3 xfb_offset=16) out 4-component vector of float bbv}) +0:? 'ubbinst3' (layout( column_major shared) uniform block{layout( column_major shared xfb_offset=16) uniform 4-component vector of float bbv}) +0:? 'bg' (layout( xfb_buffer=2 xfb_offset=48 xfb_stride=80) smooth out 4-component vector of float) +0:? 'bh' (layout( xfb_buffer=3 xfb_offset=32 xfb_stride=64) smooth out 4-component vector of float) +0:? 'bbinst4' (layout( xfb_stride=80) out block{layout( xfb_buffer=2 xfb_offset=16) out 4-component vector of float bbv1, layout( xfb_buffer=2 xfb_offset=32) out 4-component vector of float bbv2}) +0:? 'bbinst5' ( out block{layout( xfb_buffer=3 xfb_offset=0) out 4-component vector of float bbv1, layout( xfb_buffer=3 xfb_offset=48 xfb_stride=64) out 4-component vector of float bbv2, out 4-component vector of float bbv3}) +0:? 'bbinst6' ( out block{layout( xfb_buffer=2 xfb_offset=0) out 4-component vector of float bbv1, layout( xfb_buffer=3 xfb_offset=32 xfb_stride=64) out 4-component vector of float bbv2, layout( xfb_buffer=2 xfb_offset=0) out 4-component vector of float bbv3, out 4-component vector of float bbv5, layout( xfb_buffer=2 xfb_offset=24) out float bbf6}) +0:? 'bj' (layout( xfb_buffer=1 xfb_offset=4) smooth out float) +0:? 'bk' (layout( xfb_buffer=1 xfb_offset=0) smooth out 2-component vector of int) +0:? 'bl' (layout( xfb_stride=48) smooth out float) +0:? 'bbinst7' (layout( xfb_stride=48) out block{layout( xfb_stride=64) out 4-component vector of float bbv1, layout( xfb_stride=32) out 4-component vector of float bbv2}) +0:? 'bbinst8' (layout( xfb_stride=92) out block{layout( xfb_buffer=0 xfb_offset=0) out bool b, layout( xfb_buffer=0 xfb_offset=8) out structure{ global bool b, global structure{ global int i, global double d, global float f} s, global 2-component vector of float v2} t, layout( xfb_buffer=0 xfb_offset=48) out int i, layout( xfb_buffer=0 xfb_offset=52) out 3X3 matrix of float m3, layout( xfb_buffer=0 xfb_offset=88) out float f, layout( xfb_buffer=0 xfb_offset=92) out float g}) +0:? 'bbinst9' ( out block{layout( xfb_buffer=4 xfb_offset=1) out bool b, layout( xfb_buffer=4 xfb_offset=12) out structure{ global bool b, global structure{ global int i, global double d, global float f} s, global 2-component vector of float v2} t, layout( xfb_buffer=4 xfb_offset=52) out 3X3 matrix of float m3, layout( xfb_buffer=4 xfb_offset=90) out int i, layout( xfb_buffer=4 xfb_offset=98) out double d, layout( xfb_buffer=4 xfb_offset=108) out structure{ global int a} s}) +0:? 'bm' (layout( xfb_buffer=5 xfb_offset=0) smooth out float) +0:? 'bbinst10' ( out block{layout( xfb_buffer=7 xfb_offset=0) out 4X4 matrix of double m1, layout( xfb_buffer=7 xfb_offset=128) out 4X4 matrix of double m2, layout( xfb_buffer=7 xfb_offset=256) out float f}) +0:? 'anon@0' ( out block{layout( xfb_buffer=3 xfb_offset=36) gl_Position 4-component vector of float Position gl_Position, layout( xfb_buffer=3 xfb_offset=32) gl_PointSize float PointSize gl_PointSize, }) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/450.comp.out b/deps/glslang/Test/baseResults/450.comp.out new file mode 100644 index 00000000..4ae77cca --- /dev/null +++ b/deps/glslang/Test/baseResults/450.comp.out @@ -0,0 +1,24 @@ +450.comp +ERROR: 0:2: 'local_size_x' : must be at least 1 +ERROR: 0:5: 'shared' : not allowed in nested scope +ERROR: 2 compilation errors. No code generated. + + +Shader version: 450 +local_size = (1, 1, 1) +ERROR: node is still EOpNull! +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:? Linker Objects + + +Linked compute stage: + + +Shader version: 450 +local_size = (1, 1, 1) +ERROR: node is still EOpNull! +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:? Linker Objects + diff --git a/deps/glslang/Test/baseResults/450.frag.out b/deps/glslang/Test/baseResults/450.frag.out new file mode 100644 index 00000000..9cbb4cbd --- /dev/null +++ b/deps/glslang/Test/baseResults/450.frag.out @@ -0,0 +1,285 @@ +450.frag +ERROR: 0:63: 'location' : cannot use in a block array where new locations are needed for each block element +ERROR: 0:68: 'early_fragment_tests' : can only apply to a standalone qualifier +ERROR: 2 compilation errors. No code generated. + + +Shader version: 450 +ERROR: node is still EOpNull! +0:8 Function Definition: main( ( global void) +0:8 Function Parameters: +0:10 Sequence +0:10 Sequence +0:10 move second child to first child ( temp 2-component vector of float) +0:10 'v2' ( temp 2-component vector of float) +0:10 dPdxFine ( global 2-component vector of float) +0:10 'in2' ( smooth in 2-component vector of float) +0:11 Sequence +0:11 move second child to first child ( temp 3-component vector of float) +0:11 'v3' ( temp 3-component vector of float) +0:11 dPdyCoarse ( global 3-component vector of float) +0:11 'in3' ( smooth in 3-component vector of float) +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:12 'v4' ( temp 4-component vector of float) +0:12 fwidth ( global 4-component vector of float) +0:12 'in4' ( smooth in 4-component vector of float) +0:13 move second child to first child ( temp 4-component vector of float) +0:13 'v4' ( temp 4-component vector of float) +0:13 dPdyFine ( global 4-component vector of float) +0:13 'in4' ( smooth in 4-component vector of float) +0:14 move second child to first child ( temp 3-component vector of float) +0:14 'v3' ( temp 3-component vector of float) +0:14 dPdyFine ( global 3-component vector of float) +0:14 'in3' ( smooth in 3-component vector of float) +0:15 Sequence +0:15 move second child to first child ( temp float) +0:15 'f' ( temp float) +0:15 add ( temp float) +0:15 add ( temp float) +0:15 dPdx ( global float) +0:15 'in1' ( smooth in float) +0:15 dPdxFine ( global float) +0:15 'in1' ( smooth in float) +0:15 dPdxCoarse ( global float) +0:15 'in1' ( smooth in float) +0:16 move second child to first child ( temp 4-component vector of float) +0:16 'v4' ( temp 4-component vector of float) +0:16 add ( temp 4-component vector of float) +0:16 fwidthCoarse ( global 4-component vector of float) +0:16 'in4' ( smooth in 4-component vector of float) +0:16 fwidthFine ( global 4-component vector of float) +0:16 'in4' ( smooth in 4-component vector of float) +0:18 Sequence +0:18 move second child to first child ( temp float) +0:18 'cull' ( temp float) +0:18 direct index ( smooth temp float CullDistance) +0:18 'gl_CullDistance' ( smooth in 6-element array of float CullDistance) +0:18 Constant: +0:18 2 (const int) +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'consts' ( temp float) +0:19 Constant: +0:19 20.000000 +0:21 Test condition and select ( temp void) +0:21 Condition +0:21 'gl_HelperInvocation' ( in bool HelperInvocation) +0:21 true case +0:22 Pre-Increment ( temp 4-component vector of float) +0:22 'v4' ( temp 4-component vector of float) +0:24 Sequence +0:24 move second child to first child ( temp int) +0:24 'sum' ( temp int) +0:24 Constant: +0:24 32 (const int) +0:32 Sequence +0:32 move second child to first child ( temp 2-component vector of bool) +0:32 'b2' ( temp 2-component vector of bool) +0:32 mix ( global 2-component vector of bool) +0:32 Construct bvec2 ( temp 2-component vector of bool) +0:32 'b1' ( temp bool) +0:32 Construct bvec2 ( temp 2-component vector of bool) +0:32 'b3' ( temp bool) +0:32 Construct bvec2 ( temp 2-component vector of bool) +0:32 'b' ( temp bool) +0:33 Sequence +0:33 move second child to first child ( temp uint) +0:33 'um' ( temp uint) +0:33 mix ( global uint) +0:33 'uin' ( temp uint) +0:33 'uin' ( temp uint) +0:33 'b' ( temp bool) +0:34 Sequence +0:34 move second child to first child ( temp 3-component vector of int) +0:34 'im3' ( temp 3-component vector of int) +0:34 mix ( global 3-component vector of int) +0:34 Construct ivec3 ( temp 3-component vector of int) +0:34 Convert uint to int ( temp int) +0:34 'uin' ( temp uint) +0:34 Construct ivec3 ( temp 3-component vector of int) +0:34 Convert uint to int ( temp int) +0:34 'uin' ( temp uint) +0:34 Construct bvec3 ( temp 3-component vector of bool) +0:34 'b' ( temp bool) +0:42 Function Definition: foo( ( global void) +0:42 Function Parameters: +0:44 Sequence +0:44 Sequence +0:44 move second child to first child ( temp int) +0:44 's' ( temp int) +0:44 textureSamples ( global int) +0:44 's2dms' ( uniform sampler2DMS) +0:45 add second child into first child ( temp int) +0:45 's' ( temp int) +0:45 textureSamples ( global int) +0:45 'us2dmsa' ( uniform usampler2DMSArray) +0:46 add second child into first child ( temp int) +0:46 's' ( temp int) +0:46 imageQuerySamples ( global int) +0:46 'ii2dms' (layout( rgba32i) uniform iimage2DMS) +0:47 add second child into first child ( temp int) +0:47 's' ( temp int) +0:47 imageQuerySamples ( global int) +0:47 'i2dmsa' (layout( rgba32f) uniform image2DMSArray) +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'f' ( temp float) +0:48 imageAtomicExchange ( global float) +0:48 'i2dmsa' (layout( rgba32f) uniform image2DMSArray) +0:48 Convert float to int ( temp 3-component vector of int) +0:48 'in3' ( smooth in 3-component vector of float) +0:48 Constant: +0:48 2 (const int) +0:48 Constant: +0:48 4.500000 +0:53 Function Definition: cull(i1; ( global float) +0:53 Function Parameters: +0:53 'i' ( in int) +0:55 Sequence +0:55 Branch: Return with expression +0:55 Test condition and select ( temp float) +0:55 Condition +0:55 Compare Greater Than or Equal ( temp bool) +0:55 'i' ( in int) +0:55 Constant: +0:55 6 (const int) +0:55 true case +0:55 direct index ( smooth temp float CullDistance) +0:55 'gl_CullDistance' ( smooth in 6-element array of float CullDistance) +0:55 Constant: +0:55 5 (const int) +0:55 false case +0:55 indirect index ( smooth temp float CullDistance) +0:55 'gl_CullDistance' ( smooth in 6-element array of float CullDistance) +0:55 'i' ( in int) +0:? Linker Objects +0:? 'in1' ( smooth in float) +0:? 'in2' ( smooth in 2-component vector of float) +0:? 'in3' ( smooth in 3-component vector of float) +0:? 'in4' ( smooth in 4-component vector of float) +0:? 'gl_CullDistance' ( smooth in 6-element array of float CullDistance) +0:? 's2dms' ( uniform sampler2DMS) +0:? 'us2dmsa' ( uniform usampler2DMSArray) +0:? 'ii2dms' (layout( rgba32i) uniform iimage2DMS) +0:? 'i2dmsa' (layout( rgba32f) uniform image2DMSArray) +0:? 'bInst1' ( in block{layout( location=6) in float f, layout( location=7) in float g, layout( location=8) in 4X4 matrix of float m}) +0:? 'bInst2' ( in 3-element array of block{layout( location=12) in float f, layout( location=13) in float g}) +0:? 'f' ( smooth in float) + + +Linked fragment stage: + + +Shader version: 450 +ERROR: node is still EOpNull! +0:8 Function Definition: main( ( global void) +0:8 Function Parameters: +0:10 Sequence +0:10 Sequence +0:10 move second child to first child ( temp 2-component vector of float) +0:10 'v2' ( temp 2-component vector of float) +0:10 dPdxFine ( global 2-component vector of float) +0:10 'in2' ( smooth in 2-component vector of float) +0:11 Sequence +0:11 move second child to first child ( temp 3-component vector of float) +0:11 'v3' ( temp 3-component vector of float) +0:11 dPdyCoarse ( global 3-component vector of float) +0:11 'in3' ( smooth in 3-component vector of float) +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:12 'v4' ( temp 4-component vector of float) +0:12 fwidth ( global 4-component vector of float) +0:12 'in4' ( smooth in 4-component vector of float) +0:13 move second child to first child ( temp 4-component vector of float) +0:13 'v4' ( temp 4-component vector of float) +0:13 dPdyFine ( global 4-component vector of float) +0:13 'in4' ( smooth in 4-component vector of float) +0:14 move second child to first child ( temp 3-component vector of float) +0:14 'v3' ( temp 3-component vector of float) +0:14 dPdyFine ( global 3-component vector of float) +0:14 'in3' ( smooth in 3-component vector of float) +0:15 Sequence +0:15 move second child to first child ( temp float) +0:15 'f' ( temp float) +0:15 add ( temp float) +0:15 add ( temp float) +0:15 dPdx ( global float) +0:15 'in1' ( smooth in float) +0:15 dPdxFine ( global float) +0:15 'in1' ( smooth in float) +0:15 dPdxCoarse ( global float) +0:15 'in1' ( smooth in float) +0:16 move second child to first child ( temp 4-component vector of float) +0:16 'v4' ( temp 4-component vector of float) +0:16 add ( temp 4-component vector of float) +0:16 fwidthCoarse ( global 4-component vector of float) +0:16 'in4' ( smooth in 4-component vector of float) +0:16 fwidthFine ( global 4-component vector of float) +0:16 'in4' ( smooth in 4-component vector of float) +0:18 Sequence +0:18 move second child to first child ( temp float) +0:18 'cull' ( temp float) +0:18 direct index ( smooth temp float CullDistance) +0:18 'gl_CullDistance' ( smooth in 6-element array of float CullDistance) +0:18 Constant: +0:18 2 (const int) +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'consts' ( temp float) +0:19 Constant: +0:19 20.000000 +0:21 Test condition and select ( temp void) +0:21 Condition +0:21 'gl_HelperInvocation' ( in bool HelperInvocation) +0:21 true case +0:22 Pre-Increment ( temp 4-component vector of float) +0:22 'v4' ( temp 4-component vector of float) +0:24 Sequence +0:24 move second child to first child ( temp int) +0:24 'sum' ( temp int) +0:24 Constant: +0:24 32 (const int) +0:32 Sequence +0:32 move second child to first child ( temp 2-component vector of bool) +0:32 'b2' ( temp 2-component vector of bool) +0:32 mix ( global 2-component vector of bool) +0:32 Construct bvec2 ( temp 2-component vector of bool) +0:32 'b1' ( temp bool) +0:32 Construct bvec2 ( temp 2-component vector of bool) +0:32 'b3' ( temp bool) +0:32 Construct bvec2 ( temp 2-component vector of bool) +0:32 'b' ( temp bool) +0:33 Sequence +0:33 move second child to first child ( temp uint) +0:33 'um' ( temp uint) +0:33 mix ( global uint) +0:33 'uin' ( temp uint) +0:33 'uin' ( temp uint) +0:33 'b' ( temp bool) +0:34 Sequence +0:34 move second child to first child ( temp 3-component vector of int) +0:34 'im3' ( temp 3-component vector of int) +0:34 mix ( global 3-component vector of int) +0:34 Construct ivec3 ( temp 3-component vector of int) +0:34 Convert uint to int ( temp int) +0:34 'uin' ( temp uint) +0:34 Construct ivec3 ( temp 3-component vector of int) +0:34 Convert uint to int ( temp int) +0:34 'uin' ( temp uint) +0:34 Construct bvec3 ( temp 3-component vector of bool) +0:34 'b' ( temp bool) +0:? Linker Objects +0:? 'in1' ( smooth in float) +0:? 'in2' ( smooth in 2-component vector of float) +0:? 'in3' ( smooth in 3-component vector of float) +0:? 'in4' ( smooth in 4-component vector of float) +0:? 'gl_CullDistance' ( smooth in 6-element array of float CullDistance) +0:? 's2dms' ( uniform sampler2DMS) +0:? 'us2dmsa' ( uniform usampler2DMSArray) +0:? 'ii2dms' (layout( rgba32i) uniform iimage2DMS) +0:? 'i2dmsa' (layout( rgba32f) uniform image2DMSArray) +0:? 'bInst1' ( in block{layout( location=6) in float f, layout( location=7) in float g, layout( location=8) in 4X4 matrix of float m}) +0:? 'bInst2' ( in 3-element array of block{layout( location=12) in float f, layout( location=13) in float g}) +0:? 'f' ( smooth in float) + diff --git a/deps/glslang/Test/baseResults/450.geom.out b/deps/glslang/Test/baseResults/450.geom.out new file mode 100644 index 00000000..e75bf939 --- /dev/null +++ b/deps/glslang/Test/baseResults/450.geom.out @@ -0,0 +1,85 @@ +450.geom +ERROR: 0:15: '[' : array index out of range '3' +ERROR: 0:15: 'gl_Position' : no such field in structure +ERROR: 0:19: 'points' : can only apply to a standalone qualifier +ERROR: 3 compilation errors. No code generated. + + +Shader version: 450 +invocations = -1 +max_vertices = -1 +input primitive = triangles +output primitive = none +ERROR: node is still EOpNull! +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:15 Sequence +0:15 direct index ( temp block{ in 3-element array of float CullDistance gl_CullDistance}) +0:15 'gl_in' ( in 3-element array of block{ in 3-element array of float CullDistance gl_CullDistance}) +0:15 Constant: +0:15 3 (const int) +0:16 move second child to first child ( temp float) +0:16 direct index (layout( stream=0) temp float CullDistance) +0:16 gl_CullDistance: direct index for structure (layout( stream=0) out 3-element array of float CullDistance) +0:16 'anon@0' (layout( stream=0) out block{layout( stream=0) out 3-element array of float CullDistance gl_CullDistance}) +0:16 Constant: +0:16 3 (const uint) +0:16 Constant: +0:16 2 (const int) +0:16 direct index ( temp float CullDistance) +0:16 gl_CullDistance: direct index for structure ( in 3-element array of float CullDistance) +0:16 direct index ( temp block{ in 3-element array of float CullDistance gl_CullDistance}) +0:16 'gl_in' ( in 3-element array of block{ in 3-element array of float CullDistance gl_CullDistance}) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 2 (const int) +0:? Linker Objects +0:? 'gl_in' ( in 3-element array of block{ in 3-element array of float CullDistance gl_CullDistance}) +0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) out 3-element array of float CullDistance gl_CullDistance}) +0:? 'f' ( in 3-element array of float) + + +Linked geometry stage: + +ERROR: Linking geometry stage: At least one shader must specify an output layout primitive +ERROR: Linking geometry stage: At least one shader must specify a layout(max_vertices = value) + +Shader version: 450 +invocations = 1 +max_vertices = -1 +input primitive = triangles +output primitive = none +ERROR: node is still EOpNull! +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:15 Sequence +0:15 direct index ( temp block{ in 3-element array of float CullDistance gl_CullDistance}) +0:15 'gl_in' ( in 3-element array of block{ in 3-element array of float CullDistance gl_CullDistance}) +0:15 Constant: +0:15 3 (const int) +0:16 move second child to first child ( temp float) +0:16 direct index (layout( stream=0) temp float CullDistance) +0:16 gl_CullDistance: direct index for structure (layout( stream=0) out 3-element array of float CullDistance) +0:16 'anon@0' (layout( stream=0) out block{layout( stream=0) out 3-element array of float CullDistance gl_CullDistance}) +0:16 Constant: +0:16 3 (const uint) +0:16 Constant: +0:16 2 (const int) +0:16 direct index ( temp float CullDistance) +0:16 gl_CullDistance: direct index for structure ( in 3-element array of float CullDistance) +0:16 direct index ( temp block{ in 3-element array of float CullDistance gl_CullDistance}) +0:16 'gl_in' ( in 3-element array of block{ in 3-element array of float CullDistance gl_CullDistance}) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 2 (const int) +0:? Linker Objects +0:? 'gl_in' ( in 3-element array of block{ in 3-element array of float CullDistance gl_CullDistance}) +0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) out 3-element array of float CullDistance gl_CullDistance}) +0:? 'f' ( in 3-element array of float) + diff --git a/deps/glslang/Test/baseResults/450.tesc.out b/deps/glslang/Test/baseResults/450.tesc.out new file mode 100644 index 00000000..b3f4e252 --- /dev/null +++ b/deps/glslang/Test/baseResults/450.tesc.out @@ -0,0 +1,74 @@ +450.tesc +ERROR: 0:20: 'location' : cannot use in a block array where new locations are needed for each block element +ERROR: 1 compilation errors. No code generated. + + +Shader version: 450 +vertices = -1 +ERROR: node is still EOpNull! +0:11 Function Definition: main( ( global void) +0:11 Function Parameters: +0:13 Sequence +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float CullDistance) +0:13 gl_CullDistance: direct index for structure ( out 3-element array of float CullDistance) +0:13 indirect index ( temp block{ out 3-element array of float CullDistance gl_CullDistance}) +0:13 'gl_out' ( out 4-element array of block{ out 3-element array of float CullDistance gl_CullDistance}) +0:13 'gl_InvocationID' ( in int InvocationID) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 2 (const int) +0:13 direct index ( temp float CullDistance) +0:13 gl_CullDistance: direct index for structure ( in 3-element array of float CullDistance) +0:13 direct index ( temp block{ in 3-element array of float CullDistance gl_CullDistance}) +0:13 'gl_in' ( in 32-element array of block{ in 3-element array of float CullDistance gl_CullDistance}) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 2 (const int) +0:? Linker Objects +0:? 'gl_in' ( in 32-element array of block{ in 3-element array of float CullDistance gl_CullDistance}) +0:? 'gl_out' ( out 4-element array of block{ out 3-element array of float CullDistance gl_CullDistance}) +0:? 'bInst1' ( out 2-element array of block{layout( location=4) out float f, layout( location=5) out float g}) +0:? 'bInst2' ( out 2-element array of 3-element array of block{layout( location=6) out float f, layout( location=7) out float g}) + + +Linked tessellation control stage: + +ERROR: Linking tessellation control stage: At least one shader must specify an output layout(vertices=...) + +Shader version: 450 +vertices = -1 +ERROR: node is still EOpNull! +0:11 Function Definition: main( ( global void) +0:11 Function Parameters: +0:13 Sequence +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float CullDistance) +0:13 gl_CullDistance: direct index for structure ( out 3-element array of float CullDistance) +0:13 indirect index ( temp block{ out 3-element array of float CullDistance gl_CullDistance}) +0:13 'gl_out' ( out 4-element array of block{ out 3-element array of float CullDistance gl_CullDistance}) +0:13 'gl_InvocationID' ( in int InvocationID) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 2 (const int) +0:13 direct index ( temp float CullDistance) +0:13 gl_CullDistance: direct index for structure ( in 3-element array of float CullDistance) +0:13 direct index ( temp block{ in 3-element array of float CullDistance gl_CullDistance}) +0:13 'gl_in' ( in 32-element array of block{ in 3-element array of float CullDistance gl_CullDistance}) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 2 (const int) +0:? Linker Objects +0:? 'gl_in' ( in 32-element array of block{ in 3-element array of float CullDistance gl_CullDistance}) +0:? 'gl_out' ( out 4-element array of block{ out 3-element array of float CullDistance gl_CullDistance}) +0:? 'bInst1' ( out 2-element array of block{layout( location=4) out float f, layout( location=5) out float g}) +0:? 'bInst2' ( out 2-element array of 3-element array of block{layout( location=6) out float f, layout( location=7) out float g}) + diff --git a/deps/glslang/Test/baseResults/450.tese.out b/deps/glslang/Test/baseResults/450.tese.out new file mode 100644 index 00000000..796d6f16 --- /dev/null +++ b/deps/glslang/Test/baseResults/450.tese.out @@ -0,0 +1,87 @@ +450.tese +ERROR: 0:16: 'equal_spacing' : can only apply to a standalone qualifier +ERROR: 0:17: 'fractional_even_spacing' : can only apply to a standalone qualifier +ERROR: 0:18: 'fractional_odd_spacing' : can only apply to a standalone qualifier +ERROR: 0:19: 'cw' : can only apply to a standalone qualifier +ERROR: 0:20: 'ccw' : can only apply to a standalone qualifier +ERROR: 0:21: 'point_mode' : can only apply to a standalone qualifier +ERROR: 6 compilation errors. No code generated. + + +Shader version: 450 +input primitive = none +vertex spacing = none +triangle order = none +ERROR: node is still EOpNull! +0:11 Function Definition: main( ( global void) +0:11 Function Parameters: +0:13 Sequence +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float CullDistance) +0:13 gl_CullDistance: direct index for structure ( out 3-element array of float CullDistance) +0:13 'anon@0' ( out block{ out 3-element array of float CullDistance gl_CullDistance}) +0:13 Constant: +0:13 3 (const uint) +0:13 Constant: +0:13 2 (const int) +0:13 direct index ( temp float CullDistance) +0:13 gl_CullDistance: direct index for structure ( in 3-element array of float CullDistance) +0:13 direct index ( temp block{ in 3-element array of float CullDistance gl_CullDistance}) +0:13 'gl_in' ( in 32-element array of block{ in 3-element array of float CullDistance gl_CullDistance}) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 2 (const int) +0:? Linker Objects +0:? 'gl_in' ( in 32-element array of block{ in 3-element array of float CullDistance gl_CullDistance}) +0:? 'anon@0' ( out block{ out 3-element array of float CullDistance gl_CullDistance}) +0:? 'f1' ( in 32-element array of float) +0:? 'f2' ( in 32-element array of float) +0:? 'f3' ( in 32-element array of float) +0:? 'f4' ( in 32-element array of float) +0:? 'f5' ( in 32-element array of float) +0:? 'f6' ( in 32-element array of float) + + +Linked tessellation evaluation stage: + +ERROR: Linking tessellation evaluation stage: At least one shader must specify an input layout primitive + +Shader version: 450 +input primitive = none +vertex spacing = equal_spacing +triangle order = ccw +ERROR: node is still EOpNull! +0:11 Function Definition: main( ( global void) +0:11 Function Parameters: +0:13 Sequence +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float CullDistance) +0:13 gl_CullDistance: direct index for structure ( out 3-element array of float CullDistance) +0:13 'anon@0' ( out block{ out 3-element array of float CullDistance gl_CullDistance}) +0:13 Constant: +0:13 3 (const uint) +0:13 Constant: +0:13 2 (const int) +0:13 direct index ( temp float CullDistance) +0:13 gl_CullDistance: direct index for structure ( in 3-element array of float CullDistance) +0:13 direct index ( temp block{ in 3-element array of float CullDistance gl_CullDistance}) +0:13 'gl_in' ( in 32-element array of block{ in 3-element array of float CullDistance gl_CullDistance}) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 2 (const int) +0:? Linker Objects +0:? 'gl_in' ( in 32-element array of block{ in 3-element array of float CullDistance gl_CullDistance}) +0:? 'anon@0' ( out block{ out 3-element array of float CullDistance gl_CullDistance}) +0:? 'f1' ( in 32-element array of float) +0:? 'f2' ( in 32-element array of float) +0:? 'f3' ( in 32-element array of float) +0:? 'f4' ( in 32-element array of float) +0:? 'f5' ( in 32-element array of float) +0:? 'f6' ( in 32-element array of float) + diff --git a/deps/glslang/Test/baseResults/450.vert.out b/deps/glslang/Test/baseResults/450.vert.out new file mode 100644 index 00000000..0f5f2313 --- /dev/null +++ b/deps/glslang/Test/baseResults/450.vert.out @@ -0,0 +1,123 @@ +450.vert +ERROR: 0:12: 'out' : cannot be bool +ERROR: 0:13: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: outo +ERROR: 0:30: '::' : not supported +ERROR: 0:31: 'atomicCounterAdd' : no matching overloaded function found +ERROR: 0:32: 'atomicCounterSubtract' : no matching overloaded function found +ERROR: 0:33: 'atomicCounterMin' : no matching overloaded function found +ERROR: 0:34: 'atomicCounterMax' : no matching overloaded function found +ERROR: 0:35: 'atomicCounterAnd' : no matching overloaded function found +ERROR: 0:36: 'atomicCounterOr' : no matching overloaded function found +ERROR: 0:37: 'atomicCounterXor' : no matching overloaded function found +ERROR: 0:38: 'atomicCounterExchange' : no matching overloaded function found +ERROR: 0:39: 'atomicCounterCompSwap' : no matching overloaded function found +ERROR: 0:41: 'gl_BaseVertex' : undeclared identifier +ERROR: 0:41: 'gl_BaseInstance' : undeclared identifier +ERROR: 0:41: 'gl_DrawID' : undeclared identifier +ERROR: 0:41: '=' : cannot convert from ' temp float' to ' temp int' +ERROR: 0:44: 'anyInvocation' : no matching overloaded function found +ERROR: 0:45: 'allInvocations' : no matching overloaded function found +ERROR: 0:46: 'allInvocationsEqual' : no matching overloaded function found +ERROR: 0:48: 'extraneous semicolon' : not supported for this version or the enabled extensions +ERROR: 0:50: 'location' : cannot apply to uniform or buffer block +ERROR: 0:54: 'location' : cannot apply to uniform or buffer block +ERROR: 22 compilation errors. No code generated. + + +Shader version: 450 +ERROR: node is still EOpNull! +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:9 Sequence +0:9 move second child to first child ( temp float) +0:9 direct index ( temp float CullDistance) +0:9 gl_CullDistance: direct index for structure ( out 3-element array of float CullDistance) +0:9 'anon@0' ( out block{ out 3-element array of float CullDistance gl_CullDistance}) +0:9 Constant: +0:9 10 (const uint) +0:9 Constant: +0:9 2 (const int) +0:9 Constant: +0:9 4.500000 +0:28 Function Definition: foo( ( global void) +0:28 Function Parameters: +0:? Sequence +0:31 Constant: +0:31 0.000000 +0:32 Constant: +0:32 0.000000 +0:33 Constant: +0:33 0.000000 +0:34 Constant: +0:34 0.000000 +0:35 Constant: +0:35 0.000000 +0:36 Constant: +0:36 0.000000 +0:37 Constant: +0:37 0.000000 +0:38 Constant: +0:38 0.000000 +0:39 Constant: +0:39 0.000000 +0:44 Constant: +0:44 0.000000 +0:45 Constant: +0:45 0.000000 +0:46 Constant: +0:46 0.000000 +0:? Linker Objects +0:? 'anon@0' ( out block{ out 3-element array of float CullDistance gl_CullDistance}) +0:? 'outb' ( smooth out bool) +0:? 'outo' ( smooth out sampler2D) +0:? 'outa' ( smooth out 4-element array of float) +0:? 'outaa' ( smooth out 4-element array of 2-element array of float) +0:? 'outs' ( smooth out structure{ global float f}) +0:? 'outasa' ( smooth out 4-element array of structure{ global float f}) +0:? 'outsa' ( smooth out 4-element array of structure{ global float f}) +0:? 'outSA' ( smooth out structure{ global 4-element array of float f}) +0:? 'outSS' ( smooth out structure{ global float f, global structure{ global float f} s}) +0:? 'aui' (layout( binding=0 offset=0) uniform atomic_uint) +0:? 'ui' ( global uint) +0:? 'anon@1' (layout( location=0 column_major shared) uniform block{layout( column_major shared) uniform int a}) +0:? 'anon@2' (layout( location=0 column_major shared) buffer block{layout( column_major shared) buffer int b}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 450 +ERROR: node is still EOpNull! +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:9 Sequence +0:9 move second child to first child ( temp float) +0:9 direct index ( temp float CullDistance) +0:9 gl_CullDistance: direct index for structure ( out 3-element array of float CullDistance) +0:9 'anon@0' ( out block{ out 3-element array of float CullDistance gl_CullDistance}) +0:9 Constant: +0:9 10 (const uint) +0:9 Constant: +0:9 2 (const int) +0:9 Constant: +0:9 4.500000 +0:? Linker Objects +0:? 'anon@0' ( out block{ out 3-element array of float CullDistance gl_CullDistance}) +0:? 'outb' ( smooth out bool) +0:? 'outo' ( smooth out sampler2D) +0:? 'outa' ( smooth out 4-element array of float) +0:? 'outaa' ( smooth out 4-element array of 2-element array of float) +0:? 'outs' ( smooth out structure{ global float f}) +0:? 'outasa' ( smooth out 4-element array of structure{ global float f}) +0:? 'outsa' ( smooth out 4-element array of structure{ global float f}) +0:? 'outSA' ( smooth out structure{ global 4-element array of float f}) +0:? 'outSS' ( smooth out structure{ global float f, global structure{ global float f} s}) +0:? 'aui' (layout( binding=0 offset=0) uniform atomic_uint) +0:? 'ui' ( global uint) +0:? 'anon@1' (layout( location=0 column_major shared) uniform block{layout( column_major shared) uniform int a}) +0:? 'anon@2' (layout( location=0 column_major shared) buffer block{layout( column_major shared) buffer int b}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/460.frag.out b/deps/glslang/Test/baseResults/460.frag.out new file mode 100644 index 00000000..90c4837e --- /dev/null +++ b/deps/glslang/Test/baseResults/460.frag.out @@ -0,0 +1,101 @@ +460.frag +ERROR: 0:22: 'attribute' : required extension not requested: GL_EXT_control_flow_attributes +ERROR: 0:23: 'attribute' : required extension not requested: GL_EXT_control_flow_attributes +ERROR: 0:30: 'dependency_length' : must be positive +ERROR: 0:31: 'dependency_length' : must be positive +ERROR: 4 compilation errors. No code generated. + + +Shader version: 460 +Requested GL_EXT_control_flow_attributes +ERROR: node is still EOpNull! +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 interpolateAtCentroid ( global 4-component vector of float) +0:12 v: direct index for structure ( global 4-component vector of float) +0:12 's' ( smooth in structure{ global float f, global 4-component vector of float v}) +0:12 Constant: +0:12 1 (const int) +0:14 move second child to first child ( temp bool) +0:14 'b1' ( temp bool) +0:14 anyInvocation ( global bool) +0:14 'b1' ( temp bool) +0:15 move second child to first child ( temp bool) +0:15 'b1' ( temp bool) +0:15 allInvocations ( global bool) +0:15 'b1' ( temp bool) +0:16 move second child to first child ( temp bool) +0:16 'b1' ( temp bool) +0:16 allInvocationsEqual ( global bool) +0:16 'b1' ( temp bool) +0:19 Function Definition: attExtBad( ( global void) +0:19 Function Parameters: +0:22 Sequence +0:22 Sequence +0:22 Sequence +0:22 move second child to first child ( temp int) +0:22 'i' ( temp int) +0:22 Constant: +0:22 0 (const int) +0:22 Loop with condition tested first: Dependency 4 +0:22 Loop Condition +0:22 Compare Less Than ( temp bool) +0:22 'i' ( temp int) +0:22 Constant: +0:22 8 (const int) +0:22 No loop body +0:22 Loop Terminal Expression +0:22 Pre-Increment ( temp int) +0:22 'i' ( temp int) +0:23 Test condition and select ( temp void): Flatten +0:23 Condition +0:23 Constant: +0:23 true (const bool) +0:23 true case is null +0:28 Function Definition: attExt( ( global void) +0:28 Function Parameters: +0:30 Sequence +0:30 Loop with condition not tested first: Dependency -3 +0:30 Loop Condition +0:30 Constant: +0:30 true (const bool) +0:30 No loop body +0:31 Loop with condition not tested first +0:31 Loop Condition +0:31 Constant: +0:31 true (const bool) +0:31 No loop body +0:? Linker Objects +0:? 's' ( smooth in structure{ global float f, global 4-component vector of float v}) + + +Linked fragment stage: + + +Shader version: 460 +Requested GL_EXT_control_flow_attributes +ERROR: node is still EOpNull! +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 interpolateAtCentroid ( global 4-component vector of float) +0:12 v: direct index for structure ( global 4-component vector of float) +0:12 's' ( smooth in structure{ global float f, global 4-component vector of float v}) +0:12 Constant: +0:12 1 (const int) +0:14 move second child to first child ( temp bool) +0:14 'b1' ( temp bool) +0:14 anyInvocation ( global bool) +0:14 'b1' ( temp bool) +0:15 move second child to first child ( temp bool) +0:15 'b1' ( temp bool) +0:15 allInvocations ( global bool) +0:15 'b1' ( temp bool) +0:16 move second child to first child ( temp bool) +0:16 'b1' ( temp bool) +0:16 allInvocationsEqual ( global bool) +0:16 'b1' ( temp bool) +0:? Linker Objects +0:? 's' ( smooth in structure{ global float f, global 4-component vector of float v}) + diff --git a/deps/glslang/Test/baseResults/460.vert.out b/deps/glslang/Test/baseResults/460.vert.out new file mode 100644 index 00000000..8fa659b3 --- /dev/null +++ b/deps/glslang/Test/baseResults/460.vert.out @@ -0,0 +1,51 @@ +460.vert +Shader version: 460 +0:? Sequence +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:? Sequence +0:10 move second child to first child ( temp bool) +0:10 'b1' ( temp bool) +0:10 anyInvocation ( global bool) +0:10 'b1' ( temp bool) +0:11 move second child to first child ( temp bool) +0:11 'b1' ( temp bool) +0:11 allInvocations ( global bool) +0:11 'b1' ( temp bool) +0:12 move second child to first child ( temp bool) +0:12 'b1' ( temp bool) +0:12 allInvocationsEqual ( global bool) +0:12 'b1' ( temp bool) +0:? Linker Objects +0:? 'i' ( global int) +0:? 'f' ( global float) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 460 +0:? Sequence +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:? Sequence +0:10 move second child to first child ( temp bool) +0:10 'b1' ( temp bool) +0:10 anyInvocation ( global bool) +0:10 'b1' ( temp bool) +0:11 move second child to first child ( temp bool) +0:11 'b1' ( temp bool) +0:11 allInvocations ( global bool) +0:11 'b1' ( temp bool) +0:12 move second child to first child ( temp bool) +0:12 'b1' ( temp bool) +0:12 allInvocationsEqual ( global bool) +0:12 'b1' ( temp bool) +0:? Linker Objects +0:? 'i' ( global int) +0:? 'f' ( global float) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/Operations.frag.out b/deps/glslang/Test/baseResults/Operations.frag.out new file mode 100644 index 00000000..680eb265 --- /dev/null +++ b/deps/glslang/Test/baseResults/Operations.frag.out @@ -0,0 +1,1151 @@ +Operations.frag +ERROR: 0:76: 'intBitsToFloat' : no matching overloaded function found +ERROR: 0:77: 'uintBitsToFloat' : no matching overloaded function found +ERROR: 0:78: 'fma' : no matching overloaded function found +ERROR: 0:79: 'frexp' : no matching overloaded function found +ERROR: 0:80: 'ldexp' : no matching overloaded function found +ERROR: 0:81: 'unpackUnorm2x16' : no matching overloaded function found +ERROR: 0:82: 'unpackUnorm4x8' : no matching overloaded function found +ERROR: 0:83: 'unpackSnorm4x8' : no matching overloaded function found +ERROR: 0:107: 'floatsBitsToInt' : no matching overloaded function found +ERROR: 0:108: 'packUnorm2x16' : no matching overloaded function found +ERROR: 0:109: 'packUnorm4x8' : no matching overloaded function found +ERROR: 0:110: 'packSnorm4x8' : no matching overloaded function found +ERROR: 0:113: 'assign' : cannot convert from ' global float' to ' temp uint' +ERROR: 0:114: 'assign' : cannot convert from ' global float' to ' temp uint' +ERROR: 0:118: 'floatsBitToInt' : no matching overloaded function found +ERROR: 0:118: 'assign' : cannot convert from ' const float' to ' temp uint' +ERROR: 0:119: 'packUnorm2x16' : no matching overloaded function found +ERROR: 0:119: 'assign' : cannot convert from ' const float' to ' temp uint' +ERROR: 0:120: 'packUnorm4x8' : no matching overloaded function found +ERROR: 0:120: 'assign' : cannot convert from ' const float' to ' temp uint' +ERROR: 0:121: '&' : wrong operand types: no operation '&' exists that takes a left-hand operand of type ' uniform uint' and a right operand of type ' temp int' (or there is no acceptable conversion) +ERROR: 0:121: 'assign' : cannot convert from ' uniform uint' to ' temp int' +ERROR: 0:122: '^' : wrong operand types: no operation '^' exists that takes a left-hand operand of type ' uniform uint' and a right operand of type ' temp int' (or there is no acceptable conversion) +ERROR: 0:122: 'assign' : cannot convert from ' uniform uint' to ' temp int' +ERROR: 0:123: '|' : wrong operand types: no operation '|' exists that takes a left-hand operand of type ' temp int' and a right operand of type ' uniform uint' (or there is no acceptable conversion) +ERROR: 25 compilation errors. No code generated. + + +Shader version: 130 +ERROR: node is still EOpNull! +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:? Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'v' ( temp 4-component vector of float) +0:27 radians ( global 4-component vector of float) +0:27 'uv4' ( uniform 4-component vector of float) +0:28 add second child into first child ( temp 4-component vector of float) +0:28 'v' ( temp 4-component vector of float) +0:28 degrees ( global 4-component vector of float) +0:28 'v' ( temp 4-component vector of float) +0:29 add second child into first child ( temp 4-component vector of float) +0:29 'v' ( temp 4-component vector of float) +0:29 Comma ( temp 4-component vector of float) +0:29 move second child to first child ( temp int) +0:29 'i' ( temp int) +0:29 component-wise multiply ( temp int) +0:29 'ui' ( uniform int) +0:29 'ui' ( uniform int) +0:29 sine ( global 4-component vector of float) +0:29 'v' ( temp 4-component vector of float) +0:30 add second child into first child ( temp 4-component vector of float) +0:30 'v' ( temp 4-component vector of float) +0:30 cosine ( global 4-component vector of float) +0:30 'v' ( temp 4-component vector of float) +0:31 add second child into first child ( temp 4-component vector of float) +0:31 'v' ( temp 4-component vector of float) +0:31 tangent ( global 4-component vector of float) +0:31 'v' ( temp 4-component vector of float) +0:32 add second child into first child ( temp 4-component vector of float) +0:32 'v' ( temp 4-component vector of float) +0:32 arc sine ( global 4-component vector of float) +0:32 'v' ( temp 4-component vector of float) +0:33 add second child into first child ( temp 4-component vector of float) +0:33 'v' ( temp 4-component vector of float) +0:33 arc cosine ( global 4-component vector of float) +0:33 'v' ( temp 4-component vector of float) +0:35 add second child into first child ( temp 4-component vector of float) +0:35 'v' ( temp 4-component vector of float) +0:35 arc tangent ( global 4-component vector of float) +0:35 'v' ( temp 4-component vector of float) +0:36 add second child into first child ( temp 4-component vector of float) +0:36 'v' ( temp 4-component vector of float) +0:36 hyp. sine ( global 4-component vector of float) +0:36 'v' ( temp 4-component vector of float) +0:37 add second child into first child ( temp 4-component vector of float) +0:37 'v' ( temp 4-component vector of float) +0:37 hyp. cosine ( global 4-component vector of float) +0:37 'v' ( temp 4-component vector of float) +0:38 add second child into first child ( temp 4-component vector of float) +0:38 'v' ( temp 4-component vector of float) +0:38 hyp. tangent ( global 4-component vector of float) +0:38 'v' ( temp 4-component vector of float) +0:39 add second child into first child ( temp 4-component vector of float) +0:39 'v' ( temp 4-component vector of float) +0:39 arc hyp. sine ( global 4-component vector of float) +0:39 'v' ( temp 4-component vector of float) +0:40 add second child into first child ( temp 4-component vector of float) +0:40 'v' ( temp 4-component vector of float) +0:40 arc hyp. cosine ( global 4-component vector of float) +0:40 'v' ( temp 4-component vector of float) +0:41 add second child into first child ( temp 4-component vector of float) +0:41 'v' ( temp 4-component vector of float) +0:41 arc hyp. tangent ( global 4-component vector of float) +0:41 'v' ( temp 4-component vector of float) +0:43 add second child into first child ( temp 4-component vector of float) +0:43 'v' ( temp 4-component vector of float) +0:43 pow ( global 4-component vector of float) +0:43 'v' ( temp 4-component vector of float) +0:43 'v' ( temp 4-component vector of float) +0:44 add second child into first child ( temp 4-component vector of float) +0:44 'v' ( temp 4-component vector of float) +0:44 exp ( global 4-component vector of float) +0:44 'v' ( temp 4-component vector of float) +0:45 add second child into first child ( temp 4-component vector of float) +0:45 'v' ( temp 4-component vector of float) +0:45 log ( global 4-component vector of float) +0:45 'v' ( temp 4-component vector of float) +0:46 add second child into first child ( temp 4-component vector of float) +0:46 'v' ( temp 4-component vector of float) +0:46 exp2 ( global 4-component vector of float) +0:46 'v' ( temp 4-component vector of float) +0:47 add second child into first child ( temp 4-component vector of float) +0:47 'v' ( temp 4-component vector of float) +0:47 log2 ( global 4-component vector of float) +0:47 'v' ( temp 4-component vector of float) +0:48 add second child into first child ( temp 4-component vector of float) +0:48 'v' ( temp 4-component vector of float) +0:48 sqrt ( global 4-component vector of float) +0:48 'v' ( temp 4-component vector of float) +0:49 add second child into first child ( temp 4-component vector of float) +0:49 'v' ( temp 4-component vector of float) +0:49 inverse sqrt ( global 4-component vector of float) +0:49 'v' ( temp 4-component vector of float) +0:50 add second child into first child ( temp 4-component vector of float) +0:50 'v' ( temp 4-component vector of float) +0:50 Absolute value ( global 4-component vector of float) +0:50 'v' ( temp 4-component vector of float) +0:51 add second child into first child ( temp 4-component vector of float) +0:51 'v' ( temp 4-component vector of float) +0:51 Sign ( global 4-component vector of float) +0:51 'v' ( temp 4-component vector of float) +0:52 add second child into first child ( temp 4-component vector of float) +0:52 'v' ( temp 4-component vector of float) +0:52 Floor ( global 4-component vector of float) +0:52 'v' ( temp 4-component vector of float) +0:55 add second child into first child ( temp 4-component vector of float) +0:55 'v' ( temp 4-component vector of float) +0:55 trunc ( global 4-component vector of float) +0:55 'v' ( temp 4-component vector of float) +0:56 add second child into first child ( temp 4-component vector of float) +0:56 'v' ( temp 4-component vector of float) +0:56 round ( global 4-component vector of float) +0:56 'v' ( temp 4-component vector of float) +0:57 add second child into first child ( temp 4-component vector of float) +0:57 'v' ( temp 4-component vector of float) +0:57 roundEven ( global 4-component vector of float) +0:57 'v' ( temp 4-component vector of float) +0:60 add second child into first child ( temp 4-component vector of float) +0:60 'v' ( temp 4-component vector of float) +0:60 Ceiling ( global 4-component vector of float) +0:60 'v' ( temp 4-component vector of float) +0:61 add second child into first child ( temp 4-component vector of float) +0:61 'v' ( temp 4-component vector of float) +0:61 Fraction ( global 4-component vector of float) +0:61 'v' ( temp 4-component vector of float) +0:62 add second child into first child ( temp 4-component vector of float) +0:62 'v' ( temp 4-component vector of float) +0:62 mod ( global 4-component vector of float) +0:62 'v' ( temp 4-component vector of float) +0:62 'v' ( temp 4-component vector of float) +0:63 add second child into first child ( temp 4-component vector of float) +0:63 'v' ( temp 4-component vector of float) +0:63 mod ( global 4-component vector of float) +0:63 'v' ( temp 4-component vector of float) +0:63 direct index ( temp float) +0:63 'v' ( temp 4-component vector of float) +0:63 Constant: +0:63 0 (const int) +0:66 add second child into first child ( temp 4-component vector of float) +0:66 'v' ( temp 4-component vector of float) +0:66 modf ( global 4-component vector of float) +0:66 'v' ( temp 4-component vector of float) +0:66 'v' ( temp 4-component vector of float) +0:69 add second child into first child ( temp 4-component vector of float) +0:69 'v' ( temp 4-component vector of float) +0:69 min ( global 4-component vector of float) +0:69 'v' ( temp 4-component vector of float) +0:69 'uv4' ( uniform 4-component vector of float) +0:70 add second child into first child ( temp 4-component vector of float) +0:70 'v' ( temp 4-component vector of float) +0:70 max ( global 4-component vector of float) +0:70 'v' ( temp 4-component vector of float) +0:70 'uv4' ( uniform 4-component vector of float) +0:71 add second child into first child ( temp 4-component vector of float) +0:71 'v' ( temp 4-component vector of float) +0:71 clamp ( global 4-component vector of float) +0:71 'v' ( temp 4-component vector of float) +0:71 'uv4' ( uniform 4-component vector of float) +0:71 'uv4' ( uniform 4-component vector of float) +0:72 add second child into first child ( temp 4-component vector of float) +0:72 'v' ( temp 4-component vector of float) +0:72 mix ( global 4-component vector of float) +0:72 'v' ( temp 4-component vector of float) +0:72 'v' ( temp 4-component vector of float) +0:72 'v' ( temp 4-component vector of float) +0:75 add second child into first child ( temp 4-component vector of float) +0:75 'v' ( temp 4-component vector of float) +0:75 mix ( global 4-component vector of float) +0:75 'v' ( temp 4-component vector of float) +0:75 'v' ( temp 4-component vector of float) +0:75 'bv4' ( temp 4-component vector of bool) +0:76 add second child into first child ( temp 4-component vector of float) +0:76 'v' ( temp 4-component vector of float) +0:76 Constant: +0:76 0.000000 +0:77 add second child into first child ( temp 4-component vector of float) +0:77 'v' ( temp 4-component vector of float) +0:77 Constant: +0:77 0.000000 +0:78 add second child into first child ( temp 4-component vector of float) +0:78 'v' ( temp 4-component vector of float) +0:78 Constant: +0:78 0.000000 +0:79 add second child into first child ( temp 4-component vector of float) +0:79 'v' ( temp 4-component vector of float) +0:79 Constant: +0:79 0.000000 +0:80 add second child into first child ( temp 4-component vector of float) +0:80 'v' ( temp 4-component vector of float) +0:80 Constant: +0:80 0.000000 +0:81 add second child into first child ( temp 4-component vector of float) +0:81 'v' ( temp 4-component vector of float) +0:81 Constant: +0:81 0.000000 +0:82 add second child into first child ( temp 4-component vector of float) +0:82 'v' ( temp 4-component vector of float) +0:82 Constant: +0:82 0.000000 +0:83 add second child into first child ( temp 4-component vector of float) +0:83 'v' ( temp 4-component vector of float) +0:83 Constant: +0:83 0.000000 +0:86 add second child into first child ( temp 4-component vector of float) +0:86 'v' ( temp 4-component vector of float) +0:86 step ( global 4-component vector of float) +0:86 'v' ( temp 4-component vector of float) +0:86 'v' ( temp 4-component vector of float) +0:87 add second child into first child ( temp 4-component vector of float) +0:87 'v' ( temp 4-component vector of float) +0:87 smoothstep ( global 4-component vector of float) +0:87 'v' ( temp 4-component vector of float) +0:87 'v' ( temp 4-component vector of float) +0:87 'v' ( temp 4-component vector of float) +0:88 add second child into first child ( temp 4-component vector of float) +0:88 'v' ( temp 4-component vector of float) +0:88 step ( global 4-component vector of float) +0:88 'uf' ( uniform float) +0:88 'v' ( temp 4-component vector of float) +0:89 add second child into first child ( temp 4-component vector of float) +0:89 'v' ( temp 4-component vector of float) +0:89 smoothstep ( global 4-component vector of float) +0:89 'uf' ( uniform float) +0:89 'uf' ( uniform float) +0:89 'v' ( temp 4-component vector of float) +0:90 add second child into first child ( temp 4-component vector of float) +0:90 'v' ( temp 4-component vector of float) +0:90 normalize ( global 4-component vector of float) +0:90 'v' ( temp 4-component vector of float) +0:91 add second child into first child ( temp 4-component vector of float) +0:91 'v' ( temp 4-component vector of float) +0:91 face-forward ( global 4-component vector of float) +0:91 'v' ( temp 4-component vector of float) +0:91 'v' ( temp 4-component vector of float) +0:91 'v' ( temp 4-component vector of float) +0:92 add second child into first child ( temp 4-component vector of float) +0:92 'v' ( temp 4-component vector of float) +0:92 reflect ( global 4-component vector of float) +0:92 'v' ( temp 4-component vector of float) +0:92 'v' ( temp 4-component vector of float) +0:93 add second child into first child ( temp 4-component vector of float) +0:93 'v' ( temp 4-component vector of float) +0:93 refract ( global 4-component vector of float) +0:93 'v' ( temp 4-component vector of float) +0:93 'v' ( temp 4-component vector of float) +0:93 'uf' ( uniform float) +0:94 add second child into first child ( temp 4-component vector of float) +0:94 'v' ( temp 4-component vector of float) +0:94 dPdx ( global 4-component vector of float) +0:94 'v' ( temp 4-component vector of float) +0:95 add second child into first child ( temp 4-component vector of float) +0:95 'v' ( temp 4-component vector of float) +0:95 dPdy ( global 4-component vector of float) +0:95 'v' ( temp 4-component vector of float) +0:96 add second child into first child ( temp 4-component vector of float) +0:96 'v' ( temp 4-component vector of float) +0:96 fwidth ( global 4-component vector of float) +0:96 'v' ( temp 4-component vector of float) +0:101 add second child into first child ( temp int) +0:101 'i' ( temp int) +0:101 Absolute value ( global int) +0:101 'ui' ( uniform int) +0:102 add second child into first child ( temp int) +0:102 'i' ( temp int) +0:102 Sign ( global int) +0:102 'i' ( temp int) +0:103 add second child into first child ( temp int) +0:103 'i' ( temp int) +0:103 min ( global int) +0:103 'i' ( temp int) +0:103 'ui' ( uniform int) +0:104 add second child into first child ( temp int) +0:104 'i' ( temp int) +0:104 max ( global int) +0:104 'i' ( temp int) +0:104 'ui' ( uniform int) +0:105 add second child into first child ( temp int) +0:105 'i' ( temp int) +0:105 clamp ( global int) +0:105 'i' ( temp int) +0:105 'ui' ( uniform int) +0:105 'ui' ( uniform int) +0:107 Constant: +0:107 0.000000 +0:108 Constant: +0:108 0.000000 +0:109 Constant: +0:109 0.000000 +0:110 Constant: +0:110 0.000000 +0:113 'u' ( temp uint) +0:114 'u' ( temp uint) +0:115 add second child into first child ( temp uint) +0:115 'u' ( temp uint) +0:115 min ( global uint) +0:115 'u' ( temp uint) +0:115 'uui' ( uniform uint) +0:116 add second child into first child ( temp uint) +0:116 'u' ( temp uint) +0:116 max ( global uint) +0:116 'u' ( temp uint) +0:116 'uui' ( uniform uint) +0:117 add second child into first child ( temp uint) +0:117 'u' ( temp uint) +0:117 clamp ( global uint) +0:117 'u' ( temp uint) +0:117 'uui' ( uniform uint) +0:117 'uui' ( uniform uint) +0:118 'u' ( temp uint) +0:119 'u' ( temp uint) +0:120 'u' ( temp uint) +0:121 'i' ( temp int) +0:122 'i' ( temp int) +0:123 add second child into first child ( temp int) +0:123 'i' ( temp int) +0:123 'i' ( temp int) +0:127 move second child to first child ( temp bool) +0:127 'b' ( temp bool) +0:127 isnan ( global bool) +0:127 'uf' ( uniform float) +0:128 move second child to first child ( temp bool) +0:128 'b' ( temp bool) +0:128 isinf ( global bool) +0:128 direct index ( temp float) +0:128 'v' ( temp 4-component vector of float) +0:128 Constant: +0:128 1 (const int) +0:130 move second child to first child ( temp bool) +0:130 'b' ( temp bool) +0:130 any ( global bool) +0:130 Compare Less Than ( global 4-component vector of bool) +0:130 'v' ( temp 4-component vector of float) +0:130 'uv4' ( uniform 4-component vector of float) +0:131 move second child to first child ( temp bool) +0:131 'b' ( temp bool) +0:131 logical-and ( temp bool) +0:131 'b' ( temp bool) +0:131 any ( global bool) +0:131 Compare Less Than or Equal ( global 4-component vector of bool) +0:131 'v' ( temp 4-component vector of float) +0:131 'uv4' ( uniform 4-component vector of float) +0:132 move second child to first child ( temp bool) +0:132 'b' ( temp bool) +0:132 logical-and ( temp bool) +0:132 'b' ( temp bool) +0:132 any ( global bool) +0:132 Compare Greater Than ( global 4-component vector of bool) +0:132 'v' ( temp 4-component vector of float) +0:132 'uv4' ( uniform 4-component vector of float) +0:133 move second child to first child ( temp bool) +0:133 'b' ( temp bool) +0:133 logical-and ( temp bool) +0:133 'b' ( temp bool) +0:133 any ( global bool) +0:133 Compare Greater Than or Equal ( global 4-component vector of bool) +0:133 'v' ( temp 4-component vector of float) +0:133 'uv4' ( uniform 4-component vector of float) +0:134 move second child to first child ( temp bool) +0:134 'b' ( temp bool) +0:134 logical-and ( temp bool) +0:134 'b' ( temp bool) +0:134 any ( global bool) +0:134 Equal ( global 4-component vector of bool) +0:134 'ub41' ( uniform 4-component vector of bool) +0:134 'ub42' ( uniform 4-component vector of bool) +0:135 move second child to first child ( temp bool) +0:135 'b' ( temp bool) +0:135 logical-and ( temp bool) +0:135 'b' ( temp bool) +0:135 any ( global bool) +0:135 NotEqual ( global 4-component vector of bool) +0:135 'ub41' ( uniform 4-component vector of bool) +0:135 'ub42' ( uniform 4-component vector of bool) +0:136 move second child to first child ( temp bool) +0:136 'b' ( temp bool) +0:136 logical-and ( temp bool) +0:136 'b' ( temp bool) +0:136 any ( global bool) +0:136 'ub41' ( uniform 4-component vector of bool) +0:137 move second child to first child ( temp bool) +0:137 'b' ( temp bool) +0:137 logical-and ( temp bool) +0:137 'b' ( temp bool) +0:137 all ( global bool) +0:137 'ub41' ( uniform 4-component vector of bool) +0:138 move second child to first child ( temp bool) +0:138 'b' ( temp bool) +0:138 logical-and ( temp bool) +0:138 'b' ( temp bool) +0:138 any ( global bool) +0:138 Negate conditional ( global 4-component vector of bool) +0:138 'ub41' ( uniform 4-component vector of bool) +0:140 move second child to first child ( temp int) +0:140 'i' ( temp int) +0:140 divide ( temp int) +0:140 subtract ( temp int) +0:140 component-wise multiply ( temp int) +0:140 add ( temp int) +0:140 'i' ( temp int) +0:140 'ui' ( uniform int) +0:140 'i' ( temp int) +0:140 'ui' ( uniform int) +0:140 'i' ( temp int) +0:141 move second child to first child ( temp int) +0:141 'i' ( temp int) +0:141 mod ( temp int) +0:141 'i' ( temp int) +0:141 'ui' ( uniform int) +0:142 Test condition and select ( temp void) +0:142 Condition +0:142 logical-or ( temp bool) +0:142 Compare Equal ( temp bool) +0:142 'i' ( temp int) +0:142 'ui' ( uniform int) +0:142 logical-xor ( temp bool) +0:142 logical-and ( temp bool) +0:142 Compare Not Equal ( temp bool) +0:142 'i' ( temp int) +0:142 'ui' ( uniform int) +0:142 Compare Equal ( temp bool) +0:142 'i' ( temp int) +0:142 'ui' ( uniform int) +0:142 Compare Not Equal ( temp bool) +0:142 'i' ( temp int) +0:142 Constant: +0:142 2 (const int) +0:142 true case +0:143 Pre-Increment ( temp int) +0:143 'i' ( temp int) +0:145 move second child to first child ( temp float) +0:145 'f' ( temp float) +0:145 divide ( temp float) +0:145 subtract ( temp float) +0:145 component-wise multiply ( temp float) +0:145 add ( temp float) +0:145 'uf' ( uniform float) +0:145 'uf' ( uniform float) +0:145 'uf' ( uniform float) +0:145 'uf' ( uniform float) +0:145 'uf' ( uniform float) +0:147 add second child into first child ( temp float) +0:147 'f' ( temp float) +0:147 length ( global float) +0:147 'v' ( temp 4-component vector of float) +0:148 add second child into first child ( temp float) +0:148 'f' ( temp float) +0:148 distance ( global float) +0:148 'v' ( temp 4-component vector of float) +0:148 'v' ( temp 4-component vector of float) +0:149 add second child into first child ( temp float) +0:149 'f' ( temp float) +0:149 dot-product ( global float) +0:149 'v' ( temp 4-component vector of float) +0:149 'v' ( temp 4-component vector of float) +0:150 add second child into first child ( temp float) +0:150 'f' ( temp float) +0:150 dot-product ( global float) +0:150 'f' ( temp float) +0:150 'uf' ( uniform float) +0:151 add second child into first child ( temp float) +0:151 'f' ( temp float) +0:151 direct index ( temp float) +0:151 cross-product ( global 3-component vector of float) +0:151 vector swizzle ( temp 3-component vector of float) +0:151 'v' ( temp 4-component vector of float) +0:151 Sequence +0:151 Constant: +0:151 0 (const int) +0:151 Constant: +0:151 1 (const int) +0:151 Constant: +0:151 2 (const int) +0:151 vector swizzle ( temp 3-component vector of float) +0:151 'v' ( temp 4-component vector of float) +0:151 Sequence +0:151 Constant: +0:151 0 (const int) +0:151 Constant: +0:151 1 (const int) +0:151 Constant: +0:151 2 (const int) +0:151 Constant: +0:151 0 (const int) +0:153 Test condition and select ( temp void) +0:153 Condition +0:153 logical-or ( temp bool) +0:153 Compare Equal ( temp bool) +0:153 'f' ( temp float) +0:153 'uf' ( uniform float) +0:153 logical-and ( temp bool) +0:153 Compare Not Equal ( temp bool) +0:153 'f' ( temp float) +0:153 'uf' ( uniform float) +0:153 Compare Not Equal ( temp bool) +0:153 'f' ( temp float) +0:153 Constant: +0:153 2.000000 +0:153 true case +0:154 Pre-Increment ( temp float) +0:154 'f' ( temp float) +0:156 and second child into first child ( temp int) +0:156 'i' ( temp int) +0:156 'ui' ( uniform int) +0:157 or second child into first child ( temp int) +0:157 'i' ( temp int) +0:157 Constant: +0:157 66 (const int) +0:158 exclusive or second child into first child ( temp int) +0:158 'i' ( temp int) +0:158 'ui' ( uniform int) +0:159 mod second child into first child ( temp int) +0:159 'i' ( temp int) +0:159 Constant: +0:159 17 (const int) +0:160 right shift second child into first child ( temp int) +0:160 'i' ( temp int) +0:160 Constant: +0:160 2 (const int) +0:161 left shift second child into first child ( temp int) +0:161 'i' ( temp int) +0:161 'ui' ( uniform int) +0:162 move second child to first child ( temp int) +0:162 'i' ( temp int) +0:162 Bitwise not ( temp int) +0:162 'i' ( temp int) +0:163 move second child to first child ( temp bool) +0:163 'b' ( temp bool) +0:163 Negate conditional ( temp bool) +0:163 'b' ( temp bool) +0:165 move second child to first child ( temp 4-component vector of float) +0:165 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:165 Test condition and select ( temp 4-component vector of float) +0:165 Condition +0:165 'b' ( temp bool) +0:165 true case +0:165 add ( temp 4-component vector of float) +0:165 add ( temp 4-component vector of float) +0:165 Construct vec4 ( temp 4-component vector of float) +0:165 Convert int to float ( temp float) +0:165 'i' ( temp int) +0:165 Construct vec4 ( temp 4-component vector of float) +0:165 'f' ( temp float) +0:165 'v' ( temp 4-component vector of float) +0:165 false case +0:165 'v' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'uiv4' ( uniform 4-component vector of int) +0:? 'uv4' ( uniform 4-component vector of float) +0:? 'ub' ( uniform bool) +0:? 'ub41' ( uniform 4-component vector of bool) +0:? 'ub42' ( uniform 4-component vector of bool) +0:? 'uf' ( uniform float) +0:? 'ui' ( uniform int) +0:? 'uuv4' ( uniform 4-component vector of uint) +0:? 'uui' ( uniform uint) + + +Linked fragment stage: + + +Shader version: 130 +ERROR: node is still EOpNull! +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:? Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'v' ( temp 4-component vector of float) +0:27 radians ( global 4-component vector of float) +0:27 'uv4' ( uniform 4-component vector of float) +0:28 add second child into first child ( temp 4-component vector of float) +0:28 'v' ( temp 4-component vector of float) +0:28 degrees ( global 4-component vector of float) +0:28 'v' ( temp 4-component vector of float) +0:29 add second child into first child ( temp 4-component vector of float) +0:29 'v' ( temp 4-component vector of float) +0:29 Comma ( temp 4-component vector of float) +0:29 move second child to first child ( temp int) +0:29 'i' ( temp int) +0:29 component-wise multiply ( temp int) +0:29 'ui' ( uniform int) +0:29 'ui' ( uniform int) +0:29 sine ( global 4-component vector of float) +0:29 'v' ( temp 4-component vector of float) +0:30 add second child into first child ( temp 4-component vector of float) +0:30 'v' ( temp 4-component vector of float) +0:30 cosine ( global 4-component vector of float) +0:30 'v' ( temp 4-component vector of float) +0:31 add second child into first child ( temp 4-component vector of float) +0:31 'v' ( temp 4-component vector of float) +0:31 tangent ( global 4-component vector of float) +0:31 'v' ( temp 4-component vector of float) +0:32 add second child into first child ( temp 4-component vector of float) +0:32 'v' ( temp 4-component vector of float) +0:32 arc sine ( global 4-component vector of float) +0:32 'v' ( temp 4-component vector of float) +0:33 add second child into first child ( temp 4-component vector of float) +0:33 'v' ( temp 4-component vector of float) +0:33 arc cosine ( global 4-component vector of float) +0:33 'v' ( temp 4-component vector of float) +0:35 add second child into first child ( temp 4-component vector of float) +0:35 'v' ( temp 4-component vector of float) +0:35 arc tangent ( global 4-component vector of float) +0:35 'v' ( temp 4-component vector of float) +0:36 add second child into first child ( temp 4-component vector of float) +0:36 'v' ( temp 4-component vector of float) +0:36 hyp. sine ( global 4-component vector of float) +0:36 'v' ( temp 4-component vector of float) +0:37 add second child into first child ( temp 4-component vector of float) +0:37 'v' ( temp 4-component vector of float) +0:37 hyp. cosine ( global 4-component vector of float) +0:37 'v' ( temp 4-component vector of float) +0:38 add second child into first child ( temp 4-component vector of float) +0:38 'v' ( temp 4-component vector of float) +0:38 hyp. tangent ( global 4-component vector of float) +0:38 'v' ( temp 4-component vector of float) +0:39 add second child into first child ( temp 4-component vector of float) +0:39 'v' ( temp 4-component vector of float) +0:39 arc hyp. sine ( global 4-component vector of float) +0:39 'v' ( temp 4-component vector of float) +0:40 add second child into first child ( temp 4-component vector of float) +0:40 'v' ( temp 4-component vector of float) +0:40 arc hyp. cosine ( global 4-component vector of float) +0:40 'v' ( temp 4-component vector of float) +0:41 add second child into first child ( temp 4-component vector of float) +0:41 'v' ( temp 4-component vector of float) +0:41 arc hyp. tangent ( global 4-component vector of float) +0:41 'v' ( temp 4-component vector of float) +0:43 add second child into first child ( temp 4-component vector of float) +0:43 'v' ( temp 4-component vector of float) +0:43 pow ( global 4-component vector of float) +0:43 'v' ( temp 4-component vector of float) +0:43 'v' ( temp 4-component vector of float) +0:44 add second child into first child ( temp 4-component vector of float) +0:44 'v' ( temp 4-component vector of float) +0:44 exp ( global 4-component vector of float) +0:44 'v' ( temp 4-component vector of float) +0:45 add second child into first child ( temp 4-component vector of float) +0:45 'v' ( temp 4-component vector of float) +0:45 log ( global 4-component vector of float) +0:45 'v' ( temp 4-component vector of float) +0:46 add second child into first child ( temp 4-component vector of float) +0:46 'v' ( temp 4-component vector of float) +0:46 exp2 ( global 4-component vector of float) +0:46 'v' ( temp 4-component vector of float) +0:47 add second child into first child ( temp 4-component vector of float) +0:47 'v' ( temp 4-component vector of float) +0:47 log2 ( global 4-component vector of float) +0:47 'v' ( temp 4-component vector of float) +0:48 add second child into first child ( temp 4-component vector of float) +0:48 'v' ( temp 4-component vector of float) +0:48 sqrt ( global 4-component vector of float) +0:48 'v' ( temp 4-component vector of float) +0:49 add second child into first child ( temp 4-component vector of float) +0:49 'v' ( temp 4-component vector of float) +0:49 inverse sqrt ( global 4-component vector of float) +0:49 'v' ( temp 4-component vector of float) +0:50 add second child into first child ( temp 4-component vector of float) +0:50 'v' ( temp 4-component vector of float) +0:50 Absolute value ( global 4-component vector of float) +0:50 'v' ( temp 4-component vector of float) +0:51 add second child into first child ( temp 4-component vector of float) +0:51 'v' ( temp 4-component vector of float) +0:51 Sign ( global 4-component vector of float) +0:51 'v' ( temp 4-component vector of float) +0:52 add second child into first child ( temp 4-component vector of float) +0:52 'v' ( temp 4-component vector of float) +0:52 Floor ( global 4-component vector of float) +0:52 'v' ( temp 4-component vector of float) +0:55 add second child into first child ( temp 4-component vector of float) +0:55 'v' ( temp 4-component vector of float) +0:55 trunc ( global 4-component vector of float) +0:55 'v' ( temp 4-component vector of float) +0:56 add second child into first child ( temp 4-component vector of float) +0:56 'v' ( temp 4-component vector of float) +0:56 round ( global 4-component vector of float) +0:56 'v' ( temp 4-component vector of float) +0:57 add second child into first child ( temp 4-component vector of float) +0:57 'v' ( temp 4-component vector of float) +0:57 roundEven ( global 4-component vector of float) +0:57 'v' ( temp 4-component vector of float) +0:60 add second child into first child ( temp 4-component vector of float) +0:60 'v' ( temp 4-component vector of float) +0:60 Ceiling ( global 4-component vector of float) +0:60 'v' ( temp 4-component vector of float) +0:61 add second child into first child ( temp 4-component vector of float) +0:61 'v' ( temp 4-component vector of float) +0:61 Fraction ( global 4-component vector of float) +0:61 'v' ( temp 4-component vector of float) +0:62 add second child into first child ( temp 4-component vector of float) +0:62 'v' ( temp 4-component vector of float) +0:62 mod ( global 4-component vector of float) +0:62 'v' ( temp 4-component vector of float) +0:62 'v' ( temp 4-component vector of float) +0:63 add second child into first child ( temp 4-component vector of float) +0:63 'v' ( temp 4-component vector of float) +0:63 mod ( global 4-component vector of float) +0:63 'v' ( temp 4-component vector of float) +0:63 direct index ( temp float) +0:63 'v' ( temp 4-component vector of float) +0:63 Constant: +0:63 0 (const int) +0:66 add second child into first child ( temp 4-component vector of float) +0:66 'v' ( temp 4-component vector of float) +0:66 modf ( global 4-component vector of float) +0:66 'v' ( temp 4-component vector of float) +0:66 'v' ( temp 4-component vector of float) +0:69 add second child into first child ( temp 4-component vector of float) +0:69 'v' ( temp 4-component vector of float) +0:69 min ( global 4-component vector of float) +0:69 'v' ( temp 4-component vector of float) +0:69 'uv4' ( uniform 4-component vector of float) +0:70 add second child into first child ( temp 4-component vector of float) +0:70 'v' ( temp 4-component vector of float) +0:70 max ( global 4-component vector of float) +0:70 'v' ( temp 4-component vector of float) +0:70 'uv4' ( uniform 4-component vector of float) +0:71 add second child into first child ( temp 4-component vector of float) +0:71 'v' ( temp 4-component vector of float) +0:71 clamp ( global 4-component vector of float) +0:71 'v' ( temp 4-component vector of float) +0:71 'uv4' ( uniform 4-component vector of float) +0:71 'uv4' ( uniform 4-component vector of float) +0:72 add second child into first child ( temp 4-component vector of float) +0:72 'v' ( temp 4-component vector of float) +0:72 mix ( global 4-component vector of float) +0:72 'v' ( temp 4-component vector of float) +0:72 'v' ( temp 4-component vector of float) +0:72 'v' ( temp 4-component vector of float) +0:75 add second child into first child ( temp 4-component vector of float) +0:75 'v' ( temp 4-component vector of float) +0:75 mix ( global 4-component vector of float) +0:75 'v' ( temp 4-component vector of float) +0:75 'v' ( temp 4-component vector of float) +0:75 'bv4' ( temp 4-component vector of bool) +0:76 add second child into first child ( temp 4-component vector of float) +0:76 'v' ( temp 4-component vector of float) +0:76 Constant: +0:76 0.000000 +0:77 add second child into first child ( temp 4-component vector of float) +0:77 'v' ( temp 4-component vector of float) +0:77 Constant: +0:77 0.000000 +0:78 add second child into first child ( temp 4-component vector of float) +0:78 'v' ( temp 4-component vector of float) +0:78 Constant: +0:78 0.000000 +0:79 add second child into first child ( temp 4-component vector of float) +0:79 'v' ( temp 4-component vector of float) +0:79 Constant: +0:79 0.000000 +0:80 add second child into first child ( temp 4-component vector of float) +0:80 'v' ( temp 4-component vector of float) +0:80 Constant: +0:80 0.000000 +0:81 add second child into first child ( temp 4-component vector of float) +0:81 'v' ( temp 4-component vector of float) +0:81 Constant: +0:81 0.000000 +0:82 add second child into first child ( temp 4-component vector of float) +0:82 'v' ( temp 4-component vector of float) +0:82 Constant: +0:82 0.000000 +0:83 add second child into first child ( temp 4-component vector of float) +0:83 'v' ( temp 4-component vector of float) +0:83 Constant: +0:83 0.000000 +0:86 add second child into first child ( temp 4-component vector of float) +0:86 'v' ( temp 4-component vector of float) +0:86 step ( global 4-component vector of float) +0:86 'v' ( temp 4-component vector of float) +0:86 'v' ( temp 4-component vector of float) +0:87 add second child into first child ( temp 4-component vector of float) +0:87 'v' ( temp 4-component vector of float) +0:87 smoothstep ( global 4-component vector of float) +0:87 'v' ( temp 4-component vector of float) +0:87 'v' ( temp 4-component vector of float) +0:87 'v' ( temp 4-component vector of float) +0:88 add second child into first child ( temp 4-component vector of float) +0:88 'v' ( temp 4-component vector of float) +0:88 step ( global 4-component vector of float) +0:88 'uf' ( uniform float) +0:88 'v' ( temp 4-component vector of float) +0:89 add second child into first child ( temp 4-component vector of float) +0:89 'v' ( temp 4-component vector of float) +0:89 smoothstep ( global 4-component vector of float) +0:89 'uf' ( uniform float) +0:89 'uf' ( uniform float) +0:89 'v' ( temp 4-component vector of float) +0:90 add second child into first child ( temp 4-component vector of float) +0:90 'v' ( temp 4-component vector of float) +0:90 normalize ( global 4-component vector of float) +0:90 'v' ( temp 4-component vector of float) +0:91 add second child into first child ( temp 4-component vector of float) +0:91 'v' ( temp 4-component vector of float) +0:91 face-forward ( global 4-component vector of float) +0:91 'v' ( temp 4-component vector of float) +0:91 'v' ( temp 4-component vector of float) +0:91 'v' ( temp 4-component vector of float) +0:92 add second child into first child ( temp 4-component vector of float) +0:92 'v' ( temp 4-component vector of float) +0:92 reflect ( global 4-component vector of float) +0:92 'v' ( temp 4-component vector of float) +0:92 'v' ( temp 4-component vector of float) +0:93 add second child into first child ( temp 4-component vector of float) +0:93 'v' ( temp 4-component vector of float) +0:93 refract ( global 4-component vector of float) +0:93 'v' ( temp 4-component vector of float) +0:93 'v' ( temp 4-component vector of float) +0:93 'uf' ( uniform float) +0:94 add second child into first child ( temp 4-component vector of float) +0:94 'v' ( temp 4-component vector of float) +0:94 dPdx ( global 4-component vector of float) +0:94 'v' ( temp 4-component vector of float) +0:95 add second child into first child ( temp 4-component vector of float) +0:95 'v' ( temp 4-component vector of float) +0:95 dPdy ( global 4-component vector of float) +0:95 'v' ( temp 4-component vector of float) +0:96 add second child into first child ( temp 4-component vector of float) +0:96 'v' ( temp 4-component vector of float) +0:96 fwidth ( global 4-component vector of float) +0:96 'v' ( temp 4-component vector of float) +0:101 add second child into first child ( temp int) +0:101 'i' ( temp int) +0:101 Absolute value ( global int) +0:101 'ui' ( uniform int) +0:102 add second child into first child ( temp int) +0:102 'i' ( temp int) +0:102 Sign ( global int) +0:102 'i' ( temp int) +0:103 add second child into first child ( temp int) +0:103 'i' ( temp int) +0:103 min ( global int) +0:103 'i' ( temp int) +0:103 'ui' ( uniform int) +0:104 add second child into first child ( temp int) +0:104 'i' ( temp int) +0:104 max ( global int) +0:104 'i' ( temp int) +0:104 'ui' ( uniform int) +0:105 add second child into first child ( temp int) +0:105 'i' ( temp int) +0:105 clamp ( global int) +0:105 'i' ( temp int) +0:105 'ui' ( uniform int) +0:105 'ui' ( uniform int) +0:107 Constant: +0:107 0.000000 +0:108 Constant: +0:108 0.000000 +0:109 Constant: +0:109 0.000000 +0:110 Constant: +0:110 0.000000 +0:113 'u' ( temp uint) +0:114 'u' ( temp uint) +0:115 add second child into first child ( temp uint) +0:115 'u' ( temp uint) +0:115 min ( global uint) +0:115 'u' ( temp uint) +0:115 'uui' ( uniform uint) +0:116 add second child into first child ( temp uint) +0:116 'u' ( temp uint) +0:116 max ( global uint) +0:116 'u' ( temp uint) +0:116 'uui' ( uniform uint) +0:117 add second child into first child ( temp uint) +0:117 'u' ( temp uint) +0:117 clamp ( global uint) +0:117 'u' ( temp uint) +0:117 'uui' ( uniform uint) +0:117 'uui' ( uniform uint) +0:118 'u' ( temp uint) +0:119 'u' ( temp uint) +0:120 'u' ( temp uint) +0:121 'i' ( temp int) +0:122 'i' ( temp int) +0:123 add second child into first child ( temp int) +0:123 'i' ( temp int) +0:123 'i' ( temp int) +0:127 move second child to first child ( temp bool) +0:127 'b' ( temp bool) +0:127 isnan ( global bool) +0:127 'uf' ( uniform float) +0:128 move second child to first child ( temp bool) +0:128 'b' ( temp bool) +0:128 isinf ( global bool) +0:128 direct index ( temp float) +0:128 'v' ( temp 4-component vector of float) +0:128 Constant: +0:128 1 (const int) +0:130 move second child to first child ( temp bool) +0:130 'b' ( temp bool) +0:130 any ( global bool) +0:130 Compare Less Than ( global 4-component vector of bool) +0:130 'v' ( temp 4-component vector of float) +0:130 'uv4' ( uniform 4-component vector of float) +0:131 move second child to first child ( temp bool) +0:131 'b' ( temp bool) +0:131 logical-and ( temp bool) +0:131 'b' ( temp bool) +0:131 any ( global bool) +0:131 Compare Less Than or Equal ( global 4-component vector of bool) +0:131 'v' ( temp 4-component vector of float) +0:131 'uv4' ( uniform 4-component vector of float) +0:132 move second child to first child ( temp bool) +0:132 'b' ( temp bool) +0:132 logical-and ( temp bool) +0:132 'b' ( temp bool) +0:132 any ( global bool) +0:132 Compare Greater Than ( global 4-component vector of bool) +0:132 'v' ( temp 4-component vector of float) +0:132 'uv4' ( uniform 4-component vector of float) +0:133 move second child to first child ( temp bool) +0:133 'b' ( temp bool) +0:133 logical-and ( temp bool) +0:133 'b' ( temp bool) +0:133 any ( global bool) +0:133 Compare Greater Than or Equal ( global 4-component vector of bool) +0:133 'v' ( temp 4-component vector of float) +0:133 'uv4' ( uniform 4-component vector of float) +0:134 move second child to first child ( temp bool) +0:134 'b' ( temp bool) +0:134 logical-and ( temp bool) +0:134 'b' ( temp bool) +0:134 any ( global bool) +0:134 Equal ( global 4-component vector of bool) +0:134 'ub41' ( uniform 4-component vector of bool) +0:134 'ub42' ( uniform 4-component vector of bool) +0:135 move second child to first child ( temp bool) +0:135 'b' ( temp bool) +0:135 logical-and ( temp bool) +0:135 'b' ( temp bool) +0:135 any ( global bool) +0:135 NotEqual ( global 4-component vector of bool) +0:135 'ub41' ( uniform 4-component vector of bool) +0:135 'ub42' ( uniform 4-component vector of bool) +0:136 move second child to first child ( temp bool) +0:136 'b' ( temp bool) +0:136 logical-and ( temp bool) +0:136 'b' ( temp bool) +0:136 any ( global bool) +0:136 'ub41' ( uniform 4-component vector of bool) +0:137 move second child to first child ( temp bool) +0:137 'b' ( temp bool) +0:137 logical-and ( temp bool) +0:137 'b' ( temp bool) +0:137 all ( global bool) +0:137 'ub41' ( uniform 4-component vector of bool) +0:138 move second child to first child ( temp bool) +0:138 'b' ( temp bool) +0:138 logical-and ( temp bool) +0:138 'b' ( temp bool) +0:138 any ( global bool) +0:138 Negate conditional ( global 4-component vector of bool) +0:138 'ub41' ( uniform 4-component vector of bool) +0:140 move second child to first child ( temp int) +0:140 'i' ( temp int) +0:140 divide ( temp int) +0:140 subtract ( temp int) +0:140 component-wise multiply ( temp int) +0:140 add ( temp int) +0:140 'i' ( temp int) +0:140 'ui' ( uniform int) +0:140 'i' ( temp int) +0:140 'ui' ( uniform int) +0:140 'i' ( temp int) +0:141 move second child to first child ( temp int) +0:141 'i' ( temp int) +0:141 mod ( temp int) +0:141 'i' ( temp int) +0:141 'ui' ( uniform int) +0:142 Test condition and select ( temp void) +0:142 Condition +0:142 logical-or ( temp bool) +0:142 Compare Equal ( temp bool) +0:142 'i' ( temp int) +0:142 'ui' ( uniform int) +0:142 logical-xor ( temp bool) +0:142 logical-and ( temp bool) +0:142 Compare Not Equal ( temp bool) +0:142 'i' ( temp int) +0:142 'ui' ( uniform int) +0:142 Compare Equal ( temp bool) +0:142 'i' ( temp int) +0:142 'ui' ( uniform int) +0:142 Compare Not Equal ( temp bool) +0:142 'i' ( temp int) +0:142 Constant: +0:142 2 (const int) +0:142 true case +0:143 Pre-Increment ( temp int) +0:143 'i' ( temp int) +0:145 move second child to first child ( temp float) +0:145 'f' ( temp float) +0:145 divide ( temp float) +0:145 subtract ( temp float) +0:145 component-wise multiply ( temp float) +0:145 add ( temp float) +0:145 'uf' ( uniform float) +0:145 'uf' ( uniform float) +0:145 'uf' ( uniform float) +0:145 'uf' ( uniform float) +0:145 'uf' ( uniform float) +0:147 add second child into first child ( temp float) +0:147 'f' ( temp float) +0:147 length ( global float) +0:147 'v' ( temp 4-component vector of float) +0:148 add second child into first child ( temp float) +0:148 'f' ( temp float) +0:148 distance ( global float) +0:148 'v' ( temp 4-component vector of float) +0:148 'v' ( temp 4-component vector of float) +0:149 add second child into first child ( temp float) +0:149 'f' ( temp float) +0:149 dot-product ( global float) +0:149 'v' ( temp 4-component vector of float) +0:149 'v' ( temp 4-component vector of float) +0:150 add second child into first child ( temp float) +0:150 'f' ( temp float) +0:150 dot-product ( global float) +0:150 'f' ( temp float) +0:150 'uf' ( uniform float) +0:151 add second child into first child ( temp float) +0:151 'f' ( temp float) +0:151 direct index ( temp float) +0:151 cross-product ( global 3-component vector of float) +0:151 vector swizzle ( temp 3-component vector of float) +0:151 'v' ( temp 4-component vector of float) +0:151 Sequence +0:151 Constant: +0:151 0 (const int) +0:151 Constant: +0:151 1 (const int) +0:151 Constant: +0:151 2 (const int) +0:151 vector swizzle ( temp 3-component vector of float) +0:151 'v' ( temp 4-component vector of float) +0:151 Sequence +0:151 Constant: +0:151 0 (const int) +0:151 Constant: +0:151 1 (const int) +0:151 Constant: +0:151 2 (const int) +0:151 Constant: +0:151 0 (const int) +0:153 Test condition and select ( temp void) +0:153 Condition +0:153 logical-or ( temp bool) +0:153 Compare Equal ( temp bool) +0:153 'f' ( temp float) +0:153 'uf' ( uniform float) +0:153 logical-and ( temp bool) +0:153 Compare Not Equal ( temp bool) +0:153 'f' ( temp float) +0:153 'uf' ( uniform float) +0:153 Compare Not Equal ( temp bool) +0:153 'f' ( temp float) +0:153 Constant: +0:153 2.000000 +0:153 true case +0:154 Pre-Increment ( temp float) +0:154 'f' ( temp float) +0:156 and second child into first child ( temp int) +0:156 'i' ( temp int) +0:156 'ui' ( uniform int) +0:157 or second child into first child ( temp int) +0:157 'i' ( temp int) +0:157 Constant: +0:157 66 (const int) +0:158 exclusive or second child into first child ( temp int) +0:158 'i' ( temp int) +0:158 'ui' ( uniform int) +0:159 mod second child into first child ( temp int) +0:159 'i' ( temp int) +0:159 Constant: +0:159 17 (const int) +0:160 right shift second child into first child ( temp int) +0:160 'i' ( temp int) +0:160 Constant: +0:160 2 (const int) +0:161 left shift second child into first child ( temp int) +0:161 'i' ( temp int) +0:161 'ui' ( uniform int) +0:162 move second child to first child ( temp int) +0:162 'i' ( temp int) +0:162 Bitwise not ( temp int) +0:162 'i' ( temp int) +0:163 move second child to first child ( temp bool) +0:163 'b' ( temp bool) +0:163 Negate conditional ( temp bool) +0:163 'b' ( temp bool) +0:165 move second child to first child ( temp 4-component vector of float) +0:165 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:165 Test condition and select ( temp 4-component vector of float) +0:165 Condition +0:165 'b' ( temp bool) +0:165 true case +0:165 add ( temp 4-component vector of float) +0:165 add ( temp 4-component vector of float) +0:165 Construct vec4 ( temp 4-component vector of float) +0:165 Convert int to float ( temp float) +0:165 'i' ( temp int) +0:165 Construct vec4 ( temp 4-component vector of float) +0:165 'f' ( temp float) +0:165 'v' ( temp 4-component vector of float) +0:165 false case +0:165 'v' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'uiv4' ( uniform 4-component vector of int) +0:? 'uv4' ( uniform 4-component vector of float) +0:? 'ub' ( uniform bool) +0:? 'ub41' ( uniform 4-component vector of bool) +0:? 'ub42' ( uniform 4-component vector of bool) +0:? 'uf' ( uniform float) +0:? 'ui' ( uniform int) +0:? 'uuv4' ( uniform 4-component vector of uint) +0:? 'uui' ( uniform uint) + diff --git a/deps/glslang/Test/baseResults/aggOps.frag.out b/deps/glslang/Test/baseResults/aggOps.frag.out new file mode 100644 index 00000000..eba1bf78 --- /dev/null +++ b/deps/glslang/Test/baseResults/aggOps.frag.out @@ -0,0 +1,298 @@ +aggOps.frag +WARNING: 0:4: varying deprecated in version 130; may be removed in future release +WARNING: 0:6: varying deprecated in version 130; may be removed in future release + +Shader version: 130 +0:? Sequence +0:23 Function Definition: main( ( global void) +0:23 Function Parameters: +0:? Sequence +0:27 move second child to first child ( temp 3-element array of structure{ global int i, global float f}) +0:27 'a' ( temp 3-element array of structure{ global int i, global float f}) +0:27 Construct structure ( temp 3-element array of structure{ global int i, global float f}) +0:27 Construct structure ( temp structure{ global int i, global float f}) +0:27 Convert float to int ( temp int) +0:27 direct index ( temp float) +0:27 'u' ( smooth in 4-component vector of float) +0:27 Constant: +0:27 0 (const int) +0:27 direct index ( temp float) +0:27 'u' ( smooth in 4-component vector of float) +0:27 Constant: +0:27 1 (const int) +0:27 Construct structure ( temp structure{ global int i, global float f}) +0:27 Convert float to int ( temp int) +0:27 direct index ( temp float) +0:27 'u' ( smooth in 4-component vector of float) +0:27 Constant: +0:27 2 (const int) +0:27 direct index ( temp float) +0:27 'u' ( smooth in 4-component vector of float) +0:27 Constant: +0:27 3 (const int) +0:27 Constant: +0:27 14 (const int) +0:27 14.000000 +0:28 move second child to first child ( temp 3-element array of structure{ global int i, global float f}) +0:28 'b' ( temp 3-element array of structure{ global int i, global float f}) +0:28 Construct structure ( temp 3-element array of structure{ global int i, global float f}) +0:28 Constant: +0:28 17 (const int) +0:28 17.000000 +0:28 Construct structure ( temp structure{ global int i, global float f}) +0:28 Convert float to int ( temp int) +0:28 direct index ( temp float) +0:28 'w' ( smooth in 4-component vector of float) +0:28 Constant: +0:28 0 (const int) +0:28 direct index ( temp float) +0:28 'w' ( smooth in 4-component vector of float) +0:28 Constant: +0:28 1 (const int) +0:28 Construct structure ( temp structure{ global int i, global float f}) +0:28 Convert float to int ( temp int) +0:28 direct index ( temp float) +0:28 'w' ( smooth in 4-component vector of float) +0:28 Constant: +0:28 2 (const int) +0:28 direct index ( temp float) +0:28 'w' ( smooth in 4-component vector of float) +0:28 Constant: +0:28 3 (const int) +0:30 Test condition and select ( temp void) +0:30 Condition +0:30 Compare Equal ( temp bool) +0:30 'foo2a' ( uniform structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:30 'foo2b' ( uniform structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:30 true case +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'v' ( temp 4-component vector of float) +0:31 texture ( global 4-component vector of float) +0:31 'sampler' ( uniform sampler2D) +0:31 'coord' ( smooth in 2-component vector of float) +0:30 false case +0:33 move second child to first child ( temp 4-component vector of float) +0:33 'v' ( temp 4-component vector of float) +0:33 texture ( global 4-component vector of float) +0:33 'sampler' ( uniform sampler2D) +0:33 vector-scale ( temp 2-component vector of float) +0:33 Constant: +0:33 2.000000 +0:33 'coord' ( smooth in 2-component vector of float) +0:35 Test condition and select ( temp void) +0:35 Condition +0:35 Compare Equal ( temp bool) +0:35 'u' ( smooth in 4-component vector of float) +0:35 'v' ( temp 4-component vector of float) +0:35 true case +0:36 vector scale second child into first child ( temp 4-component vector of float) +0:36 'v' ( temp 4-component vector of float) +0:36 Constant: +0:36 3.000000 +0:38 Test condition and select ( temp void) +0:38 Condition +0:38 Compare Not Equal ( temp bool) +0:38 'u' ( smooth in 4-component vector of float) +0:38 'v' ( temp 4-component vector of float) +0:38 true case +0:39 vector scale second child into first child ( temp 4-component vector of float) +0:39 'v' ( temp 4-component vector of float) +0:39 Constant: +0:39 4.000000 +0:41 Test condition and select ( temp void) +0:41 Condition +0:41 Compare Equal ( temp bool) +0:41 'coord' ( smooth in 2-component vector of float) +0:41 vector swizzle ( temp 2-component vector of float) +0:41 'v' ( temp 4-component vector of float) +0:41 Sequence +0:41 Constant: +0:41 1 (const int) +0:41 Constant: +0:41 3 (const int) +0:41 true case +0:42 vector scale second child into first child ( temp 4-component vector of float) +0:42 'v' ( temp 4-component vector of float) +0:42 Constant: +0:42 5.000000 +0:44 Test condition and select ( temp void) +0:44 Condition +0:44 Compare Equal ( temp bool) +0:44 'a' ( temp 3-element array of structure{ global int i, global float f}) +0:44 'b' ( temp 3-element array of structure{ global int i, global float f}) +0:44 true case +0:45 vector scale second child into first child ( temp 4-component vector of float) +0:45 'v' ( temp 4-component vector of float) +0:45 Constant: +0:45 6.000000 +0:47 Test condition and select ( temp void) +0:47 Condition +0:47 Compare Not Equal ( temp bool) +0:47 'a' ( temp 3-element array of structure{ global int i, global float f}) +0:47 'b' ( temp 3-element array of structure{ global int i, global float f}) +0:47 true case +0:48 vector scale second child into first child ( temp 4-component vector of float) +0:48 'v' ( temp 4-component vector of float) +0:48 Constant: +0:48 7.000000 +0:50 move second child to first child ( temp 4-component vector of float) +0:50 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:50 'v' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'sampler' ( uniform sampler2D) +0:? 'coord' ( smooth in 2-component vector of float) +0:? 'u' ( smooth in 4-component vector of float) +0:? 'w' ( smooth in 4-component vector of float) +0:? 'foo1' ( uniform structure{ global int i, global float f}) +0:? 'foo2a' ( uniform structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:? 'foo2b' ( uniform structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) + + +Linked fragment stage: + + +Shader version: 130 +0:? Sequence +0:23 Function Definition: main( ( global void) +0:23 Function Parameters: +0:? Sequence +0:27 move second child to first child ( temp 3-element array of structure{ global int i, global float f}) +0:27 'a' ( temp 3-element array of structure{ global int i, global float f}) +0:27 Construct structure ( temp 3-element array of structure{ global int i, global float f}) +0:27 Construct structure ( temp structure{ global int i, global float f}) +0:27 Convert float to int ( temp int) +0:27 direct index ( temp float) +0:27 'u' ( smooth in 4-component vector of float) +0:27 Constant: +0:27 0 (const int) +0:27 direct index ( temp float) +0:27 'u' ( smooth in 4-component vector of float) +0:27 Constant: +0:27 1 (const int) +0:27 Construct structure ( temp structure{ global int i, global float f}) +0:27 Convert float to int ( temp int) +0:27 direct index ( temp float) +0:27 'u' ( smooth in 4-component vector of float) +0:27 Constant: +0:27 2 (const int) +0:27 direct index ( temp float) +0:27 'u' ( smooth in 4-component vector of float) +0:27 Constant: +0:27 3 (const int) +0:27 Constant: +0:27 14 (const int) +0:27 14.000000 +0:28 move second child to first child ( temp 3-element array of structure{ global int i, global float f}) +0:28 'b' ( temp 3-element array of structure{ global int i, global float f}) +0:28 Construct structure ( temp 3-element array of structure{ global int i, global float f}) +0:28 Constant: +0:28 17 (const int) +0:28 17.000000 +0:28 Construct structure ( temp structure{ global int i, global float f}) +0:28 Convert float to int ( temp int) +0:28 direct index ( temp float) +0:28 'w' ( smooth in 4-component vector of float) +0:28 Constant: +0:28 0 (const int) +0:28 direct index ( temp float) +0:28 'w' ( smooth in 4-component vector of float) +0:28 Constant: +0:28 1 (const int) +0:28 Construct structure ( temp structure{ global int i, global float f}) +0:28 Convert float to int ( temp int) +0:28 direct index ( temp float) +0:28 'w' ( smooth in 4-component vector of float) +0:28 Constant: +0:28 2 (const int) +0:28 direct index ( temp float) +0:28 'w' ( smooth in 4-component vector of float) +0:28 Constant: +0:28 3 (const int) +0:30 Test condition and select ( temp void) +0:30 Condition +0:30 Compare Equal ( temp bool) +0:30 'foo2a' ( uniform structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:30 'foo2b' ( uniform structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:30 true case +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'v' ( temp 4-component vector of float) +0:31 texture ( global 4-component vector of float) +0:31 'sampler' ( uniform sampler2D) +0:31 'coord' ( smooth in 2-component vector of float) +0:30 false case +0:33 move second child to first child ( temp 4-component vector of float) +0:33 'v' ( temp 4-component vector of float) +0:33 texture ( global 4-component vector of float) +0:33 'sampler' ( uniform sampler2D) +0:33 vector-scale ( temp 2-component vector of float) +0:33 Constant: +0:33 2.000000 +0:33 'coord' ( smooth in 2-component vector of float) +0:35 Test condition and select ( temp void) +0:35 Condition +0:35 Compare Equal ( temp bool) +0:35 'u' ( smooth in 4-component vector of float) +0:35 'v' ( temp 4-component vector of float) +0:35 true case +0:36 vector scale second child into first child ( temp 4-component vector of float) +0:36 'v' ( temp 4-component vector of float) +0:36 Constant: +0:36 3.000000 +0:38 Test condition and select ( temp void) +0:38 Condition +0:38 Compare Not Equal ( temp bool) +0:38 'u' ( smooth in 4-component vector of float) +0:38 'v' ( temp 4-component vector of float) +0:38 true case +0:39 vector scale second child into first child ( temp 4-component vector of float) +0:39 'v' ( temp 4-component vector of float) +0:39 Constant: +0:39 4.000000 +0:41 Test condition and select ( temp void) +0:41 Condition +0:41 Compare Equal ( temp bool) +0:41 'coord' ( smooth in 2-component vector of float) +0:41 vector swizzle ( temp 2-component vector of float) +0:41 'v' ( temp 4-component vector of float) +0:41 Sequence +0:41 Constant: +0:41 1 (const int) +0:41 Constant: +0:41 3 (const int) +0:41 true case +0:42 vector scale second child into first child ( temp 4-component vector of float) +0:42 'v' ( temp 4-component vector of float) +0:42 Constant: +0:42 5.000000 +0:44 Test condition and select ( temp void) +0:44 Condition +0:44 Compare Equal ( temp bool) +0:44 'a' ( temp 3-element array of structure{ global int i, global float f}) +0:44 'b' ( temp 3-element array of structure{ global int i, global float f}) +0:44 true case +0:45 vector scale second child into first child ( temp 4-component vector of float) +0:45 'v' ( temp 4-component vector of float) +0:45 Constant: +0:45 6.000000 +0:47 Test condition and select ( temp void) +0:47 Condition +0:47 Compare Not Equal ( temp bool) +0:47 'a' ( temp 3-element array of structure{ global int i, global float f}) +0:47 'b' ( temp 3-element array of structure{ global int i, global float f}) +0:47 true case +0:48 vector scale second child into first child ( temp 4-component vector of float) +0:48 'v' ( temp 4-component vector of float) +0:48 Constant: +0:48 7.000000 +0:50 move second child to first child ( temp 4-component vector of float) +0:50 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:50 'v' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'sampler' ( uniform sampler2D) +0:? 'coord' ( smooth in 2-component vector of float) +0:? 'u' ( smooth in 4-component vector of float) +0:? 'w' ( smooth in 4-component vector of float) +0:? 'foo1' ( uniform structure{ global int i, global float f}) +0:? 'foo2a' ( uniform structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:? 'foo2b' ( uniform structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) + diff --git a/deps/glslang/Test/baseResults/always-discard.frag.out b/deps/glslang/Test/baseResults/always-discard.frag.out new file mode 100644 index 00000000..17cd443e --- /dev/null +++ b/deps/glslang/Test/baseResults/always-discard.frag.out @@ -0,0 +1,239 @@ +always-discard.frag +Shader version: 110 +0:? Sequence +0:4 Function Definition: main( ( global void) +0:4 Function Parameters: +0:6 Sequence +0:6 Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:6 'white' ( temp 4-component vector of float) +0:6 Constant: +0:6 1.000000 +0:6 1.000000 +0:6 1.000000 +0:6 1.000000 +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 'black' ( temp 4-component vector of float) +0:7 Constant: +0:7 0.200000 +0:7 0.200000 +0:7 0.200000 +0:7 0.200000 +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'color' ( temp 4-component vector of float) +0:8 'white' ( temp 4-component vector of float) +0:11 Sequence +0:11 move second child to first child ( temp float) +0:11 'x' ( temp float) +0:11 subtract ( temp float) +0:11 component-wise multiply ( temp float) +0:11 direct index ( temp float) +0:11 'tex_coord' ( smooth in 2-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 2.000000 +0:11 Constant: +0:11 1.000000 +0:12 Sequence +0:12 move second child to first child ( temp float) +0:12 'y' ( temp float) +0:12 subtract ( temp float) +0:12 component-wise multiply ( temp float) +0:12 direct index ( temp float) +0:12 'tex_coord' ( smooth in 2-component vector of float) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 2.000000 +0:12 Constant: +0:12 1.000000 +0:14 Sequence +0:14 move second child to first child ( temp float) +0:14 'radius' ( temp float) +0:14 sqrt ( global float) +0:14 add ( temp float) +0:14 component-wise multiply ( temp float) +0:14 'x' ( temp float) +0:14 'x' ( temp float) +0:14 component-wise multiply ( temp float) +0:14 'y' ( temp float) +0:14 'y' ( temp float) +0:15 Test condition and select ( temp void) +0:15 Condition +0:15 Compare Greater Than ( temp bool) +0:15 'radius' ( temp float) +0:15 Constant: +0:15 1.000000 +0:15 true case +0:16 Sequence +0:16 Test condition and select ( temp void) +0:16 Condition +0:16 Compare Greater Than ( temp bool) +0:16 'radius' ( temp float) +0:16 Constant: +0:16 1.100000 +0:16 true case +0:17 Sequence +0:17 Pre-Increment ( temp 4-component vector of float) +0:17 'color' ( temp 4-component vector of float) +0:20 move second child to first child ( temp 4-component vector of float) +0:20 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:20 'color' ( temp 4-component vector of float) +0:22 Test condition and select ( temp void) +0:22 Condition +0:22 Compare Greater Than ( temp bool) +0:22 'radius' ( temp float) +0:22 Constant: +0:22 1.200000 +0:22 true case +0:23 Sequence +0:23 Pre-Increment ( temp 4-component vector of float) +0:23 'color' ( temp 4-component vector of float) +0:28 Branch: Kill +0:31 Test condition and select ( temp void) +0:31 Condition +0:31 Compare Greater Than or Equal ( temp bool) +0:31 'radius' ( temp float) +0:31 Constant: +0:31 0.750000 +0:31 true case +0:32 subtract second child into first child ( temp 4-component vector of float) +0:32 'color' ( temp 4-component vector of float) +0:32 Absolute value ( global float) +0:32 divide ( temp float) +0:32 pow ( global float) +0:32 'radius' ( temp float) +0:32 Constant: +0:32 16.000000 +0:32 Constant: +0:32 2.000000 +0:34 move second child to first child ( temp 4-component vector of float) +0:34 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:34 'color' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'tex_coord' ( smooth in 2-component vector of float) + + +Linked fragment stage: + + +Shader version: 110 +0:? Sequence +0:4 Function Definition: main( ( global void) +0:4 Function Parameters: +0:6 Sequence +0:6 Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:6 'white' ( temp 4-component vector of float) +0:6 Constant: +0:6 1.000000 +0:6 1.000000 +0:6 1.000000 +0:6 1.000000 +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 'black' ( temp 4-component vector of float) +0:7 Constant: +0:7 0.200000 +0:7 0.200000 +0:7 0.200000 +0:7 0.200000 +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'color' ( temp 4-component vector of float) +0:8 'white' ( temp 4-component vector of float) +0:11 Sequence +0:11 move second child to first child ( temp float) +0:11 'x' ( temp float) +0:11 subtract ( temp float) +0:11 component-wise multiply ( temp float) +0:11 direct index ( temp float) +0:11 'tex_coord' ( smooth in 2-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 2.000000 +0:11 Constant: +0:11 1.000000 +0:12 Sequence +0:12 move second child to first child ( temp float) +0:12 'y' ( temp float) +0:12 subtract ( temp float) +0:12 component-wise multiply ( temp float) +0:12 direct index ( temp float) +0:12 'tex_coord' ( smooth in 2-component vector of float) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 2.000000 +0:12 Constant: +0:12 1.000000 +0:14 Sequence +0:14 move second child to first child ( temp float) +0:14 'radius' ( temp float) +0:14 sqrt ( global float) +0:14 add ( temp float) +0:14 component-wise multiply ( temp float) +0:14 'x' ( temp float) +0:14 'x' ( temp float) +0:14 component-wise multiply ( temp float) +0:14 'y' ( temp float) +0:14 'y' ( temp float) +0:15 Test condition and select ( temp void) +0:15 Condition +0:15 Compare Greater Than ( temp bool) +0:15 'radius' ( temp float) +0:15 Constant: +0:15 1.000000 +0:15 true case +0:16 Sequence +0:16 Test condition and select ( temp void) +0:16 Condition +0:16 Compare Greater Than ( temp bool) +0:16 'radius' ( temp float) +0:16 Constant: +0:16 1.100000 +0:16 true case +0:17 Sequence +0:17 Pre-Increment ( temp 4-component vector of float) +0:17 'color' ( temp 4-component vector of float) +0:20 move second child to first child ( temp 4-component vector of float) +0:20 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:20 'color' ( temp 4-component vector of float) +0:22 Test condition and select ( temp void) +0:22 Condition +0:22 Compare Greater Than ( temp bool) +0:22 'radius' ( temp float) +0:22 Constant: +0:22 1.200000 +0:22 true case +0:23 Sequence +0:23 Pre-Increment ( temp 4-component vector of float) +0:23 'color' ( temp 4-component vector of float) +0:28 Branch: Kill +0:31 Test condition and select ( temp void) +0:31 Condition +0:31 Compare Greater Than or Equal ( temp bool) +0:31 'radius' ( temp float) +0:31 Constant: +0:31 0.750000 +0:31 true case +0:32 subtract second child into first child ( temp 4-component vector of float) +0:32 'color' ( temp 4-component vector of float) +0:32 Absolute value ( global float) +0:32 divide ( temp float) +0:32 pow ( global float) +0:32 'radius' ( temp float) +0:32 Constant: +0:32 16.000000 +0:32 Constant: +0:32 2.000000 +0:34 move second child to first child ( temp 4-component vector of float) +0:34 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:34 'color' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'tex_coord' ( smooth in 2-component vector of float) + diff --git a/deps/glslang/Test/baseResults/always-discard2.frag.out b/deps/glslang/Test/baseResults/always-discard2.frag.out new file mode 100644 index 00000000..3c7c06f3 --- /dev/null +++ b/deps/glslang/Test/baseResults/always-discard2.frag.out @@ -0,0 +1,121 @@ +always-discard2.frag +Shader version: 110 +0:? Sequence +0:4 Function Definition: main( ( global void) +0:4 Function Parameters: +0:6 Sequence +0:6 Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:6 'white' ( temp 4-component vector of float) +0:6 Constant: +0:6 1.000000 +0:6 1.000000 +0:6 1.000000 +0:6 1.000000 +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 'black' ( temp 4-component vector of float) +0:7 Constant: +0:7 0.200000 +0:7 0.200000 +0:7 0.200000 +0:7 0.200000 +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'color' ( temp 4-component vector of float) +0:8 'white' ( temp 4-component vector of float) +0:11 Sequence +0:11 move second child to first child ( temp float) +0:11 'x' ( temp float) +0:11 subtract ( temp float) +0:11 component-wise multiply ( temp float) +0:11 direct index ( temp float) +0:11 'tex_coord' ( smooth in 2-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 2.000000 +0:11 Constant: +0:11 1.000000 +0:12 Sequence +0:12 move second child to first child ( temp float) +0:12 'y' ( temp float) +0:12 subtract ( temp float) +0:12 component-wise multiply ( temp float) +0:12 direct index ( temp float) +0:12 'tex_coord' ( smooth in 2-component vector of float) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 2.000000 +0:12 Constant: +0:12 1.000000 +0:14 Branch: Kill +0:17 move second child to first child ( temp 4-component vector of float) +0:17 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:17 'color' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'tex_coord' ( smooth in 2-component vector of float) + + +Linked fragment stage: + + +Shader version: 110 +0:? Sequence +0:4 Function Definition: main( ( global void) +0:4 Function Parameters: +0:6 Sequence +0:6 Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:6 'white' ( temp 4-component vector of float) +0:6 Constant: +0:6 1.000000 +0:6 1.000000 +0:6 1.000000 +0:6 1.000000 +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 'black' ( temp 4-component vector of float) +0:7 Constant: +0:7 0.200000 +0:7 0.200000 +0:7 0.200000 +0:7 0.200000 +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'color' ( temp 4-component vector of float) +0:8 'white' ( temp 4-component vector of float) +0:11 Sequence +0:11 move second child to first child ( temp float) +0:11 'x' ( temp float) +0:11 subtract ( temp float) +0:11 component-wise multiply ( temp float) +0:11 direct index ( temp float) +0:11 'tex_coord' ( smooth in 2-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 2.000000 +0:11 Constant: +0:11 1.000000 +0:12 Sequence +0:12 move second child to first child ( temp float) +0:12 'y' ( temp float) +0:12 subtract ( temp float) +0:12 component-wise multiply ( temp float) +0:12 direct index ( temp float) +0:12 'tex_coord' ( smooth in 2-component vector of float) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 2.000000 +0:12 Constant: +0:12 1.000000 +0:14 Branch: Kill +0:17 move second child to first child ( temp 4-component vector of float) +0:17 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:17 'color' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'tex_coord' ( smooth in 2-component vector of float) + diff --git a/deps/glslang/Test/baseResults/array.frag.out b/deps/glslang/Test/baseResults/array.frag.out new file mode 100644 index 00000000..2af9f27f --- /dev/null +++ b/deps/glslang/Test/baseResults/array.frag.out @@ -0,0 +1,480 @@ +array.frag +ERROR: 0:21: '[' : array index out of range '2' +ERROR: 0:27: '[' : array must be redeclared with a size before being indexed with a variable +ERROR: 0:30: 'assign' : cannot convert from ' global 4-element array of float' to ' global 5-element array of float' +ERROR: 0:31: 'assign' : cannot convert from ' global 4-element array of float' to ' global runtime-sized array of float' +ERROR: 0:33: 'foo' : no matching overloaded function found +ERROR: 0:42: '[' : array index out of range '5' +ERROR: 0:45: '[' : array index out of range '1000' +ERROR: 0:46: '[' : index out of range '-1' +ERROR: 0:52: '[' : array index out of range '2' +ERROR: 0:54: 'const' : non-matching or non-convertible constant type for const initializer +ERROR: 0:56: '=' : cannot convert from ' const 2-element array of int' to ' temp 3-element array of int' +ERROR: 0:57: '[]' : scalar integer expression required +ERROR: 0:57: '[' : index out of range '-858993459' +ERROR: 0:58: '[]' : scalar integer expression required +ERROR: 0:61: '' : array size required +ERROR: 0:62: '' : array size required +ERROR: 0:63: '' : array size required +ERROR: 0:66: '=' : cannot convert from ' temp 3-component vector of float' to ' global float' +ERROR: 0:76: 'bar' : no matching overloaded function found +ERROR: 0:79: '' : array size required +ERROR: 0:84: 'return' : type does not match, or is not convertible to, the function's return type +ERROR: 0:93: 'length' : array must be declared with a size before using this method +ERROR: 0:101: '[' : array index out of range '5' +ERROR: 0:104: 'constructor' : array constructor must have at least one argument +ERROR: 0:104: '=' : cannot convert from ' const float' to ' global unsized 1-element array of int' +ERROR: 0:106: 'constructor' : array argument must be sized +ERROR: 0:111: 'variable index' : required extension not requested: GL_EXT_nonuniform_qualifier +ERROR: 0:111: 'variable indexing sampler array' : not supported with this profile: none +ERROR: 0:112: '[]' : array initializer must be sized +ERROR: 29 compilation errors. No code generated. + + +Shader version: 130 +ERROR: node is still EOpNull! +0:9 Function Definition: foo(f1[5]; ( global 4-element array of float) +0:9 Function Parameters: +0:9 'a' ( in 5-element array of float) +0:11 Sequence +0:11 Branch: Return with expression +0:11 Construct float ( temp 4-element array of float) +0:11 direct index ( temp float) +0:11 'a' ( in 5-element array of float) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( temp float) +0:11 'a' ( in 5-element array of float) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( temp float) +0:11 'a' ( in 5-element array of float) +0:11 Constant: +0:11 2 (const int) +0:11 direct index ( temp float) +0:11 'a' ( in 5-element array of float) +0:11 Constant: +0:11 3 (const int) +0:14 Function Definition: bar(f1[5]; ( global void) +0:14 Function Parameters: +0:14 '' ( in 5-element array of float) +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:? Sequence +0:? Sequence +0:21 move second child to first child ( temp float) +0:21 direct index ( temp float) +0:21 'gu' ( temp 2-element array of float) +0:21 Constant: +0:21 2 (const int) +0:21 Constant: +0:21 4.000000 +0:24 move second child to first child ( temp float) +0:24 direct index ( temp float) +0:24 'gu' ( global runtime-sized array of float) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 4.000000 +0:26 move second child to first child ( temp float) +0:26 direct index ( temp float) +0:26 'gu' ( global runtime-sized array of float) +0:26 Constant: +0:26 3 (const int) +0:26 Constant: +0:26 3.000000 +0:27 move second child to first child ( temp float) +0:27 indirect index ( temp float) +0:27 'gu' ( global runtime-sized array of float) +0:27 'a' ( uniform int) +0:27 Constant: +0:27 5.000000 +0:29 move second child to first child ( temp 4-element array of float) +0:29 'g4' ( global 4-element array of float) +0:29 Function Call: foo(f1[5]; ( global 4-element array of float) +0:29 'g5' ( global 5-element array of float) +0:30 'g5' ( global 5-element array of float) +0:31 'gu' ( global runtime-sized array of float) +0:33 Constant: +0:33 0.000000 +0:34 Function Call: bar(f1[5]; ( global void) +0:34 'g5' ( global 5-element array of float) +0:36 Test condition and select ( temp void) +0:36 Condition +0:36 Compare Equal ( temp bool) +0:36 Constant: +0:36 1.000000 +0:36 2.000000 +0:36 3.000000 +0:36 4.000000 +0:36 'g4' ( global 4-element array of float) +0:36 true case +0:37 move second child to first child ( temp float) +0:37 direct index ( temp float) +0:37 'gu' ( global runtime-sized array of float) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 2.000000 +0:40 move second child to first child ( temp float) +0:40 direct index ( temp float) +0:40 'u' ( temp 5-element array of float) +0:40 Constant: +0:40 2 (const int) +0:40 Constant: +0:40 3.000000 +0:42 move second child to first child ( temp float) +0:42 direct index ( temp float) +0:42 'u' ( temp 5-element array of float) +0:42 Constant: +0:42 5 (const int) +0:42 Constant: +0:42 5.000000 +0:43 Function Call: foo(f1[5]; ( global 4-element array of float) +0:43 'u' ( temp 5-element array of float) +0:45 move second child to first child ( temp 4-component vector of float) +0:45 direct index ( temp 4-component vector of float FragData) +0:45 'gl_FragData' ( fragColor 32-element array of 4-component vector of float FragData) +0:45 Constant: +0:45 1000 (const int) +0:45 Constant: +0:45 1.000000 +0:45 1.000000 +0:45 1.000000 +0:45 1.000000 +0:46 move second child to first child ( temp 4-component vector of float) +0:46 direct index ( temp 4-component vector of float FragData) +0:46 'gl_FragData' ( fragColor 32-element array of 4-component vector of float FragData) +0:46 Constant: +0:46 -1 (const int) +0:46 Constant: +0:46 1.000000 +0:46 1.000000 +0:46 1.000000 +0:46 1.000000 +0:47 move second child to first child ( temp 4-component vector of float) +0:47 direct index ( temp 4-component vector of float FragData) +0:47 'gl_FragData' ( fragColor 32-element array of 4-component vector of float FragData) +0:47 Constant: +0:47 3 (const int) +0:47 Constant: +0:47 1.000000 +0:47 1.000000 +0:47 1.000000 +0:47 1.000000 +0:50 Sequence +0:50 move second child to first child ( temp int) +0:50 'sum' ( temp int) +0:50 Constant: +0:50 3 (const int) +0:51 add second child into first child ( temp int) +0:51 'sum' ( temp int) +0:51 Constant: +0:51 2 (const int) +0:52 add second child into first child ( temp int) +0:52 'sum' ( temp int) +0:52 Constant: +0:52 2 (const int) +0:55 Sequence +0:55 move second child to first child ( temp 2-element array of int) +0:55 'ica' ( temp 2-element array of int) +0:55 Constant: +0:55 3 (const int) +0:55 2 (const int) +0:57 move second child to first child ( temp int) +0:57 direct index ( temp int) +0:57 'ica' ( temp 2-element array of int) +0:57 Constant: +0:57 3.100000 +0:57 Constant: +0:57 3 (const int) +0:58 move second child to first child ( temp int) +0:58 indirect index ( temp int) +0:58 'ica' ( temp 2-element array of int) +0:58 direct index ( temp float) +0:58 'u' ( temp 5-element array of float) +0:58 Constant: +0:58 1 (const int) +0:58 Constant: +0:58 4 (const int) +0:68 Function Definition: foo( ( global void) +0:68 Function Parameters: +0:? Sequence +0:71 move second child to first child ( temp int) +0:71 direct index ( temp int) +0:71 'uns' ( temp unsized 4-element array of int) +0:71 Constant: +0:71 3 (const int) +0:71 Constant: +0:71 40 (const int) +0:72 move second child to first child ( temp int) +0:72 direct index ( temp int) +0:72 'uns' ( temp unsized 4-element array of int) +0:72 Constant: +0:72 1 (const int) +0:72 Constant: +0:72 30 (const int) +0:73 move second child to first child ( temp 3-component vector of float) +0:73 direct index ( temp 3-component vector of float) +0:73 'guns' ( global unsized 8-element array of 3-component vector of float) +0:73 Constant: +0:73 2 (const int) +0:73 Constant: +0:73 2.400000 +0:73 2.400000 +0:73 2.400000 +0:76 Constant: +0:76 0.000000 +0:79 Function Definition: foo2( ( global unsized 1-element array of float) +0:79 Function Parameters: +0:? Sequence +0:82 Branch: Return with expression +0:82 'f' ( temp unsized 1-element array of float) +0:84 Branch: Return with expression +0:84 'g' ( temp 9-element array of float) +0:89 Function Definition: foo3( ( global void) +0:89 Function Parameters: +0:? Sequence +0:92 move second child to first child ( temp float) +0:92 direct index ( temp float) +0:92 'resize1' ( temp 3-element array of float) +0:92 Constant: +0:92 2 (const int) +0:92 Constant: +0:92 4.000000 +0:93 Constant: +0:93 1 (const int) +0:95 Constant: +0:95 3 (const int) +0:98 move second child to first child ( temp float) +0:98 direct index ( temp float) +0:98 'resize2' ( temp 5-element array of float) +0:98 Constant: +0:98 5 (const int) +0:98 Constant: +0:98 4.000000 +0:100 Constant: +0:100 5 (const int) +0:101 move second child to first child ( temp float) +0:101 direct index ( temp float) +0:101 'resize2' ( temp 5-element array of float) +0:101 Constant: +0:101 5 (const int) +0:101 Constant: +0:101 4.000000 +0:106 Sequence +0:106 move second child to first child ( temp float) +0:106 'b' ( global float) +0:106 Constant: +0:106 0.000000 +0:109 Function Definition: foo4( ( global void) +0:109 Function Parameters: +0:111 Sequence +0:111 indirect index ( temp sampler2D) +0:111 's2d' ( uniform runtime-sized array of sampler2D) +0:111 'a' ( uniform int) +0:112 Sequence +0:112 move second child to first child ( temp unsized 1-element array of float) +0:112 'local' ( temp unsized 1-element array of float) +0:112 'gUnusedUnsized' ( global unsized 1-element array of float) +0:? Linker Objects +0:? 'gu' ( global runtime-sized array of float) +0:? 'g4' ( global 4-element array of float) +0:? 'g5' ( global 5-element array of float) +0:? 'a' ( uniform int) +0:? 'guns' ( global unsized 8-element array of 3-component vector of float) +0:? 'f' ( global float) +0:? 'gUnusedUnsized' ( global unsized 1-element array of float) +0:? 'i' ( global unsized 1-element array of int) +0:? 'emptyA' ( global unsized 1-element array of float) +0:? 'b' ( global float) +0:? 's2d' ( uniform runtime-sized array of sampler2D) + + +Linked fragment stage: + + +Shader version: 130 +ERROR: node is still EOpNull! +0:9 Function Definition: foo(f1[5]; ( global 4-element array of float) +0:9 Function Parameters: +0:9 'a' ( in 5-element array of float) +0:11 Sequence +0:11 Branch: Return with expression +0:11 Construct float ( temp 4-element array of float) +0:11 direct index ( temp float) +0:11 'a' ( in 5-element array of float) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( temp float) +0:11 'a' ( in 5-element array of float) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( temp float) +0:11 'a' ( in 5-element array of float) +0:11 Constant: +0:11 2 (const int) +0:11 direct index ( temp float) +0:11 'a' ( in 5-element array of float) +0:11 Constant: +0:11 3 (const int) +0:14 Function Definition: bar(f1[5]; ( global void) +0:14 Function Parameters: +0:14 '' ( in 5-element array of float) +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:? Sequence +0:? Sequence +0:21 move second child to first child ( temp float) +0:21 direct index ( temp float) +0:21 'gu' ( temp 2-element array of float) +0:21 Constant: +0:21 2 (const int) +0:21 Constant: +0:21 4.000000 +0:24 move second child to first child ( temp float) +0:24 direct index ( temp float) +0:24 'gu' ( global runtime-sized array of float) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 4.000000 +0:26 move second child to first child ( temp float) +0:26 direct index ( temp float) +0:26 'gu' ( global runtime-sized array of float) +0:26 Constant: +0:26 3 (const int) +0:26 Constant: +0:26 3.000000 +0:27 move second child to first child ( temp float) +0:27 indirect index ( temp float) +0:27 'gu' ( global runtime-sized array of float) +0:27 'a' ( uniform int) +0:27 Constant: +0:27 5.000000 +0:29 move second child to first child ( temp 4-element array of float) +0:29 'g4' ( global 4-element array of float) +0:29 Function Call: foo(f1[5]; ( global 4-element array of float) +0:29 'g5' ( global 5-element array of float) +0:30 'g5' ( global 5-element array of float) +0:31 'gu' ( global runtime-sized array of float) +0:33 Constant: +0:33 0.000000 +0:34 Function Call: bar(f1[5]; ( global void) +0:34 'g5' ( global 5-element array of float) +0:36 Test condition and select ( temp void) +0:36 Condition +0:36 Compare Equal ( temp bool) +0:36 Constant: +0:36 1.000000 +0:36 2.000000 +0:36 3.000000 +0:36 4.000000 +0:36 'g4' ( global 4-element array of float) +0:36 true case +0:37 move second child to first child ( temp float) +0:37 direct index ( temp float) +0:37 'gu' ( global runtime-sized array of float) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 2.000000 +0:40 move second child to first child ( temp float) +0:40 direct index ( temp float) +0:40 'u' ( temp 5-element array of float) +0:40 Constant: +0:40 2 (const int) +0:40 Constant: +0:40 3.000000 +0:42 move second child to first child ( temp float) +0:42 direct index ( temp float) +0:42 'u' ( temp 5-element array of float) +0:42 Constant: +0:42 5 (const int) +0:42 Constant: +0:42 5.000000 +0:43 Function Call: foo(f1[5]; ( global 4-element array of float) +0:43 'u' ( temp 5-element array of float) +0:45 move second child to first child ( temp 4-component vector of float) +0:45 direct index ( temp 4-component vector of float FragData) +0:45 'gl_FragData' ( fragColor 32-element array of 4-component vector of float FragData) +0:45 Constant: +0:45 1000 (const int) +0:45 Constant: +0:45 1.000000 +0:45 1.000000 +0:45 1.000000 +0:45 1.000000 +0:46 move second child to first child ( temp 4-component vector of float) +0:46 direct index ( temp 4-component vector of float FragData) +0:46 'gl_FragData' ( fragColor 32-element array of 4-component vector of float FragData) +0:46 Constant: +0:46 -1 (const int) +0:46 Constant: +0:46 1.000000 +0:46 1.000000 +0:46 1.000000 +0:46 1.000000 +0:47 move second child to first child ( temp 4-component vector of float) +0:47 direct index ( temp 4-component vector of float FragData) +0:47 'gl_FragData' ( fragColor 32-element array of 4-component vector of float FragData) +0:47 Constant: +0:47 3 (const int) +0:47 Constant: +0:47 1.000000 +0:47 1.000000 +0:47 1.000000 +0:47 1.000000 +0:50 Sequence +0:50 move second child to first child ( temp int) +0:50 'sum' ( temp int) +0:50 Constant: +0:50 3 (const int) +0:51 add second child into first child ( temp int) +0:51 'sum' ( temp int) +0:51 Constant: +0:51 2 (const int) +0:52 add second child into first child ( temp int) +0:52 'sum' ( temp int) +0:52 Constant: +0:52 2 (const int) +0:55 Sequence +0:55 move second child to first child ( temp 2-element array of int) +0:55 'ica' ( temp 2-element array of int) +0:55 Constant: +0:55 3 (const int) +0:55 2 (const int) +0:57 move second child to first child ( temp int) +0:57 direct index ( temp int) +0:57 'ica' ( temp 2-element array of int) +0:57 Constant: +0:57 3.100000 +0:57 Constant: +0:57 3 (const int) +0:58 move second child to first child ( temp int) +0:58 indirect index ( temp int) +0:58 'ica' ( temp 2-element array of int) +0:58 direct index ( temp float) +0:58 'u' ( temp 5-element array of float) +0:58 Constant: +0:58 1 (const int) +0:58 Constant: +0:58 4 (const int) +0:106 Sequence +0:106 move second child to first child ( temp float) +0:106 'b' ( global float) +0:106 Constant: +0:106 0.000000 +0:? Linker Objects +0:? 'gu' ( global runtime-sized array of float) +0:? 'g4' ( global 4-element array of float) +0:? 'g5' ( global 5-element array of float) +0:? 'a' ( uniform int) +0:? 'guns' ( global 8-element array of 3-component vector of float) +0:? 'f' ( global float) +0:? 'gUnusedUnsized' ( global 1-element array of float) +0:? 'i' ( global 1-element array of int) +0:? 'emptyA' ( global 1-element array of float) +0:? 'b' ( global float) +0:? 's2d' ( uniform runtime-sized array of sampler2D) + diff --git a/deps/glslang/Test/baseResults/array100.frag.out b/deps/glslang/Test/baseResults/array100.frag.out new file mode 100644 index 00000000..e6f9f8dc --- /dev/null +++ b/deps/glslang/Test/baseResults/array100.frag.out @@ -0,0 +1,273 @@ +array100.frag +ERROR: 0:3: 'float' : type requires declaration of default precision qualifier +ERROR: 0:3: '' : array size required +ERROR: 0:9: 'arrayed type' : not supported for this version or the enabled extensions +ERROR: 0:9: 'arrayed type' : not supported for this version or the enabled extensions +ERROR: 0:9: 'array in function return type' : not supported for this version or the enabled extensions +ERROR: 0:11: 'arrayed constructor' : not supported for this version or the enabled extensions +ERROR: 0:21: '[' : array index out of range '2' +ERROR: 0:24: 'array assignment' : not supported for this version or the enabled extensions +ERROR: 0:25: 'array assignment' : not supported for this version or the enabled extensions +ERROR: 0:25: 'assign' : cannot convert from ' global 4-element array of mediump float' to ' global 5-element array of mediump float' +ERROR: 0:26: 'array assignment' : not supported for this version or the enabled extensions +ERROR: 0:26: 'assign' : cannot convert from ' global 4-element array of mediump float' to ' global unsized 1-element array of mediump float' +ERROR: 0:28: 'foo' : no matching overloaded function found +ERROR: 0:31: 'arrayed constructor' : not supported for this version or the enabled extensions +ERROR: 0:31: 'array comparison' : not supported for this version or the enabled extensions +ERROR: 0:35: '[' : array index out of range '5' +ERROR: 0:38: '[' : array index out of range '1000' +ERROR: 0:39: '[' : index out of range '-1' +ERROR: 0:53: 'array in function return type' : not supported for this version or the enabled extensions +ERROR: 0:66: 'array assignment' : not supported for this version or the enabled extensions +ERROR: 0:68: 'array assignment' : not supported for this version or the enabled extensions +ERROR: 0:69: 'array initializer' : not supported for this version or the enabled extensions +ERROR: 22 compilation errors. No code generated. + + +Shader version: 100 +ERROR: node is still EOpNull! +0:9 Function Definition: foo(f1[5]; ( global 4-element array of mediump float) +0:9 Function Parameters: +0:9 'a' ( in 5-element array of mediump float) +0:11 Sequence +0:11 Branch: Return with expression +0:11 Construct float ( temp 4-element array of float) +0:11 direct index ( temp mediump float) +0:11 'a' ( in 5-element array of mediump float) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( temp mediump float) +0:11 'a' ( in 5-element array of mediump float) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( temp mediump float) +0:11 'a' ( in 5-element array of mediump float) +0:11 Constant: +0:11 2 (const int) +0:11 direct index ( temp mediump float) +0:11 'a' ( in 5-element array of mediump float) +0:11 Constant: +0:11 3 (const int) +0:14 Function Definition: bar(f1[5]; ( global void) +0:14 Function Parameters: +0:14 '' ( in 5-element array of mediump float) +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:? Sequence +0:? Sequence +0:21 move second child to first child ( temp mediump float) +0:21 direct index ( temp mediump float) +0:21 'gu' ( temp 2-element array of mediump float) +0:21 Constant: +0:21 2 (const int) +0:21 Constant: +0:21 4.000000 +0:24 move second child to first child ( temp 4-element array of mediump float) +0:24 'g4' ( global 4-element array of mediump float) +0:24 Function Call: foo(f1[5]; ( global 4-element array of mediump float) +0:24 'g5' ( global 5-element array of mediump float) +0:25 'g5' ( global 5-element array of mediump float) +0:26 'gu' ( global unsized 1-element array of mediump float) +0:28 Constant: +0:28 0.000000 +0:29 Function Call: bar(f1[5]; ( global void) +0:29 'g5' ( global 5-element array of mediump float) +0:31 Test condition and select ( temp void) +0:31 Condition +0:31 Compare Equal ( temp bool) +0:31 Constant: +0:31 1.000000 +0:31 2.000000 +0:31 3.000000 +0:31 4.000000 +0:31 'g4' ( global 4-element array of mediump float) +0:31 true case +0:32 move second child to first child ( temp mediump float) +0:32 direct index ( temp mediump float) +0:32 'gu' ( global unsized 1-element array of mediump float) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 2.000000 +0:35 move second child to first child ( temp mediump float) +0:35 direct index ( temp mediump float) +0:35 'u' ( temp 5-element array of mediump float) +0:35 Constant: +0:35 5 (const int) +0:35 Constant: +0:35 5.000000 +0:36 Function Call: foo(f1[5]; ( global 4-element array of mediump float) +0:36 'u' ( temp 5-element array of mediump float) +0:38 move second child to first child ( temp mediump 4-component vector of float) +0:38 direct index ( temp mediump 4-component vector of float FragData) +0:38 'gl_FragData' ( fragColor 32-element array of mediump 4-component vector of float FragData) +0:38 Constant: +0:38 1000 (const int) +0:38 Constant: +0:38 1.000000 +0:38 1.000000 +0:38 1.000000 +0:38 1.000000 +0:39 move second child to first child ( temp mediump 4-component vector of float) +0:39 direct index ( temp mediump 4-component vector of float FragData) +0:39 'gl_FragData' ( fragColor 32-element array of mediump 4-component vector of float FragData) +0:39 Constant: +0:39 -1 (const int) +0:39 Constant: +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:40 move second child to first child ( temp mediump 4-component vector of float) +0:40 direct index ( temp mediump 4-component vector of float FragData) +0:40 'gl_FragData' ( fragColor 32-element array of mediump 4-component vector of float FragData) +0:40 Constant: +0:40 3 (const int) +0:40 Constant: +0:40 1.000000 +0:40 1.000000 +0:40 1.000000 +0:40 1.000000 +0:53 Function Definition: bar9( ( global structure{ global mediump 4-component vector of float v4, global structure{ global mediump 3-component vector of float v3, global 4-element array of mediump 2-component vector of float v2} sa}) +0:53 Function Parameters: +0:? Sequence +0:56 Branch: Return with expression +0:56 's' ( temp structure{ global mediump 4-component vector of float v4, global structure{ global mediump 3-component vector of float v3, global 4-element array of mediump 2-component vector of float v2} sa}) +0:59 Function Definition: bar10(struct-SB-vf4-struct-SA-vf3-vf2[4]11; ( global void) +0:59 Function Parameters: +0:59 's' ( in structure{ global mediump 4-component vector of float v4, global structure{ global mediump 3-component vector of float v3, global 4-element array of mediump 2-component vector of float v2} sa}) +0:63 Function Definition: bar11( ( global void) +0:63 Function Parameters: +0:? Sequence +0:66 move second child to first child ( temp structure{ global mediump 4-component vector of float v4, global structure{ global mediump 3-component vector of float v3, global 4-element array of mediump 2-component vector of float v2} sa}) +0:66 's1' ( temp structure{ global mediump 4-component vector of float v4, global structure{ global mediump 3-component vector of float v3, global 4-element array of mediump 2-component vector of float v2} sa}) +0:66 's2' ( temp structure{ global mediump 4-component vector of float v4, global structure{ global mediump 3-component vector of float v3, global 4-element array of mediump 2-component vector of float v2} sa}) +0:67 Function Call: bar10(struct-SB-vf4-struct-SA-vf3-vf2[4]11; ( global void) +0:67 's1' ( temp structure{ global mediump 4-component vector of float v4, global structure{ global mediump 3-component vector of float v3, global 4-element array of mediump 2-component vector of float v2} sa}) +0:68 move second child to first child ( temp structure{ global mediump 4-component vector of float v4, global structure{ global mediump 3-component vector of float v3, global 4-element array of mediump 2-component vector of float v2} sa}) +0:68 's2' ( temp structure{ global mediump 4-component vector of float v4, global structure{ global mediump 3-component vector of float v3, global 4-element array of mediump 2-component vector of float v2} sa}) +0:68 Function Call: bar9( ( global structure{ global mediump 4-component vector of float v4, global structure{ global mediump 3-component vector of float v3, global 4-element array of mediump 2-component vector of float v2} sa}) +0:69 Sequence +0:69 move second child to first child ( temp structure{ global mediump 4-component vector of float v4, global structure{ global mediump 3-component vector of float v3, global 4-element array of mediump 2-component vector of float v2} sa}) +0:69 'initSb' ( temp structure{ global mediump 4-component vector of float v4, global structure{ global mediump 3-component vector of float v3, global 4-element array of mediump 2-component vector of float v2} sa}) +0:69 's1' ( temp structure{ global mediump 4-component vector of float v4, global structure{ global mediump 3-component vector of float v3, global 4-element array of mediump 2-component vector of float v2} sa}) +0:? Linker Objects +0:? 'gu' ( global unsized 1-element array of mediump float) +0:? 'g4' ( global 4-element array of mediump float) +0:? 'g5' ( global 5-element array of mediump float) +0:? 'a' ( uniform mediump int) + + +Linked fragment stage: + + +Shader version: 100 +ERROR: node is still EOpNull! +0:9 Function Definition: foo(f1[5]; ( global 4-element array of mediump float) +0:9 Function Parameters: +0:9 'a' ( in 5-element array of mediump float) +0:11 Sequence +0:11 Branch: Return with expression +0:11 Construct float ( temp 4-element array of float) +0:11 direct index ( temp mediump float) +0:11 'a' ( in 5-element array of mediump float) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( temp mediump float) +0:11 'a' ( in 5-element array of mediump float) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( temp mediump float) +0:11 'a' ( in 5-element array of mediump float) +0:11 Constant: +0:11 2 (const int) +0:11 direct index ( temp mediump float) +0:11 'a' ( in 5-element array of mediump float) +0:11 Constant: +0:11 3 (const int) +0:14 Function Definition: bar(f1[5]; ( global void) +0:14 Function Parameters: +0:14 '' ( in 5-element array of mediump float) +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:? Sequence +0:? Sequence +0:21 move second child to first child ( temp mediump float) +0:21 direct index ( temp mediump float) +0:21 'gu' ( temp 2-element array of mediump float) +0:21 Constant: +0:21 2 (const int) +0:21 Constant: +0:21 4.000000 +0:24 move second child to first child ( temp 4-element array of mediump float) +0:24 'g4' ( global 4-element array of mediump float) +0:24 Function Call: foo(f1[5]; ( global 4-element array of mediump float) +0:24 'g5' ( global 5-element array of mediump float) +0:25 'g5' ( global 5-element array of mediump float) +0:26 'gu' ( global 1-element array of mediump float) +0:28 Constant: +0:28 0.000000 +0:29 Function Call: bar(f1[5]; ( global void) +0:29 'g5' ( global 5-element array of mediump float) +0:31 Test condition and select ( temp void) +0:31 Condition +0:31 Compare Equal ( temp bool) +0:31 Constant: +0:31 1.000000 +0:31 2.000000 +0:31 3.000000 +0:31 4.000000 +0:31 'g4' ( global 4-element array of mediump float) +0:31 true case +0:32 move second child to first child ( temp mediump float) +0:32 direct index ( temp mediump float) +0:32 'gu' ( global 1-element array of mediump float) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 2.000000 +0:35 move second child to first child ( temp mediump float) +0:35 direct index ( temp mediump float) +0:35 'u' ( temp 5-element array of mediump float) +0:35 Constant: +0:35 5 (const int) +0:35 Constant: +0:35 5.000000 +0:36 Function Call: foo(f1[5]; ( global 4-element array of mediump float) +0:36 'u' ( temp 5-element array of mediump float) +0:38 move second child to first child ( temp mediump 4-component vector of float) +0:38 direct index ( temp mediump 4-component vector of float FragData) +0:38 'gl_FragData' ( fragColor 32-element array of mediump 4-component vector of float FragData) +0:38 Constant: +0:38 1000 (const int) +0:38 Constant: +0:38 1.000000 +0:38 1.000000 +0:38 1.000000 +0:38 1.000000 +0:39 move second child to first child ( temp mediump 4-component vector of float) +0:39 direct index ( temp mediump 4-component vector of float FragData) +0:39 'gl_FragData' ( fragColor 32-element array of mediump 4-component vector of float FragData) +0:39 Constant: +0:39 -1 (const int) +0:39 Constant: +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:40 move second child to first child ( temp mediump 4-component vector of float) +0:40 direct index ( temp mediump 4-component vector of float FragData) +0:40 'gl_FragData' ( fragColor 32-element array of mediump 4-component vector of float FragData) +0:40 Constant: +0:40 3 (const int) +0:40 Constant: +0:40 1.000000 +0:40 1.000000 +0:40 1.000000 +0:40 1.000000 +0:? Linker Objects +0:? 'gu' ( global 1-element array of mediump float) +0:? 'g4' ( global 4-element array of mediump float) +0:? 'g5' ( global 5-element array of mediump float) +0:? 'a' ( uniform mediump int) + diff --git a/deps/glslang/Test/baseResults/atomic_uint.frag.out b/deps/glslang/Test/baseResults/atomic_uint.frag.out new file mode 100644 index 00000000..c705a063 --- /dev/null +++ b/deps/glslang/Test/baseResults/atomic_uint.frag.out @@ -0,0 +1,107 @@ +atomic_uint.frag +ERROR: 0:10: 'atomic_uint' : samplers and atomic_uints cannot be output parameters +ERROR: 0:12: 'return' : type does not match, or is not convertible to, the function's return type +ERROR: 0:18: 'atomic_uint' : atomic_uints can only be used in uniform variables or function parameters: non_uniform_counter +ERROR: 0:23: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings +ERROR: 0:28: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( binding=0 offset=0) uniform atomic_uint' and a right operand of type 'layout( binding=0 offset=0) uniform atomic_uint' (or there is no acceptable conversion) +ERROR: 0:29: '-' : wrong operand type no operation '-' exists that takes an operand of type layout( binding=0 offset=0) uniform atomic_uint (or there is no acceptable conversion) +ERROR: 0:31: '[]' : scalar integer expression required +ERROR: 0:34: 'assign' : l-value required "counter" (can't modify a uniform) +ERROR: 0:34: 'assign' : cannot convert from ' const int' to 'layout( binding=0 offset=0) uniform atomic_uint' +ERROR: 0:37: 'atomic_uint' : atomic_uints can only be used in uniform variables or function parameters: acin +ERROR: 0:38: 'atomic_uint' : atomic_uints can only be used in uniform variables or function parameters: acg +ERROR: 0:47: 'offset' : atomic counters sharing the same offset: 12 +ERROR: 0:48: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings +ERROR: 13 compilation errors. No code generated. + + +Shader version: 420 +ERROR: node is still EOpNull! +0:5 Function Definition: func(au1; ( global uint) +0:5 Function Parameters: +0:5 'c' ( in atomic_uint) +0:7 Sequence +0:7 Branch: Return with expression +0:7 AtomicCounterIncrement ( global uint) +0:7 'c' ( in atomic_uint) +0:10 Function Definition: func2(au1; ( global uint) +0:10 Function Parameters: +0:10 'c' ( out atomic_uint) +0:12 Sequence +0:12 Branch: Return with expression +0:12 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:13 Branch: Return with expression +0:13 AtomicCounter ( global uint) +0:13 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:? Sequence +0:19 Sequence +0:19 move second child to first child ( temp uint) +0:19 'val' ( temp uint) +0:19 AtomicCounter ( global uint) +0:19 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:20 AtomicCounterDecrement ( global uint) +0:20 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:26 Function Definition: opac( ( global void) +0:26 Function Parameters: +0:28 Sequence +0:28 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:29 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:31 indirect index ( temp int) +0:31 'a' ( temp 3-element array of int) +0:31 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:32 direct index (layout( binding=1 offset=3) temp atomic_uint) +0:32 'countArr' (layout( binding=1 offset=3) uniform 4-element array of atomic_uint) +0:32 Constant: +0:32 2 (const int) +0:33 indirect index (layout( binding=1 offset=3) temp atomic_uint) +0:33 'countArr' (layout( binding=1 offset=3) uniform 4-element array of atomic_uint) +0:33 'i' ( uniform int) +0:34 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:? Linker Objects +0:? 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:? 'countArr' (layout( binding=1 offset=3) uniform 4-element array of atomic_uint) +0:? 'i' ( uniform int) +0:? 'acin' ( smooth in atomic_uint) +0:? 'acg' ( global atomic_uint) +0:? 'aNoBind' ( uniform atomic_uint) +0:? 'aOffset' (layout( binding=0 offset=32) uniform atomic_uint) +0:? 'bar3' (layout( binding=0 offset=4) uniform atomic_uint) +0:? 'ac' (layout( binding=0 offset=8) uniform 3-element array of atomic_uint) +0:? 'ad' (layout( binding=0 offset=20) uniform atomic_uint) +0:? 'bar4' (layout( offset=8) uniform atomic_uint) +0:? 'overlap' (layout( binding=0 offset=12) uniform atomic_uint) +0:? 'bigBind' (layout( binding=20) uniform atomic_uint) + + +Linked fragment stage: + + +Shader version: 420 +ERROR: node is still EOpNull! +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:? Sequence +0:19 Sequence +0:19 move second child to first child ( temp uint) +0:19 'val' ( temp uint) +0:19 AtomicCounter ( global uint) +0:19 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:20 AtomicCounterDecrement ( global uint) +0:20 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:? Linker Objects +0:? 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:? 'countArr' (layout( binding=1 offset=3) uniform 4-element array of atomic_uint) +0:? 'i' ( uniform int) +0:? 'acin' ( smooth in atomic_uint) +0:? 'acg' ( global atomic_uint) +0:? 'aNoBind' ( uniform atomic_uint) +0:? 'aOffset' (layout( binding=0 offset=32) uniform atomic_uint) +0:? 'bar3' (layout( binding=0 offset=4) uniform atomic_uint) +0:? 'ac' (layout( binding=0 offset=8) uniform 3-element array of atomic_uint) +0:? 'ad' (layout( binding=0 offset=20) uniform atomic_uint) +0:? 'bar4' (layout( offset=8) uniform atomic_uint) +0:? 'overlap' (layout( binding=0 offset=12) uniform atomic_uint) +0:? 'bigBind' (layout( binding=20) uniform atomic_uint) + diff --git a/deps/glslang/Test/baseResults/badChars.frag.out b/deps/glslang/Test/baseResults/badChars.frag.out new file mode 100644 index 00000000..e3fec617 --- /dev/null +++ b/deps/glslang/Test/baseResults/badChars.frag.out @@ -0,0 +1,27 @@ +badChars.frag +ERROR: 0:1: 'preprocessor evaluation' : bad expression +ERROR: 0:1: '#if' : unexpected tokens following directive +ERROR: 0:3: '#error' : A B +ERROR: 0:4: 'preprocessor evaluation' : bad expression +ERROR: 0:4: '#if' : unexpected tokens following directive +ERROR: 0:6: '€' : unexpected token +ERROR: 0:7: 'string' : End of line in string +ERROR: 0:7: '' : syntax error, unexpected INT, expecting COMMA or SEMICOLON +ERROR: 8 compilation errors. No code generated. + + +Shader version: 100 +ERROR: node is still EOpNull! +0:? Linker Objects +0:? 'a' ( global mediump int) + + +Linked fragment stage: + +ERROR: Linking fragment stage: Missing entry point: Each stage requires one entry point + +Shader version: 100 +ERROR: node is still EOpNull! +0:? Linker Objects +0:? 'a' ( global mediump int) + diff --git a/deps/glslang/Test/baseResults/badMacroArgs.frag.out b/deps/glslang/Test/baseResults/badMacroArgs.frag.out new file mode 100644 index 00000000..5e6233f8 --- /dev/null +++ b/deps/glslang/Test/baseResults/badMacroArgs.frag.out @@ -0,0 +1,6 @@ +badMacroArgs.frag +ERROR: 0:4: 'macro expansion' : Too few args in Macro m +ERROR: 0:4: '' : compilation terminated +ERROR: 2 compilation errors. No code generated. + + diff --git a/deps/glslang/Test/baseResults/comment.frag.out b/deps/glslang/Test/baseResults/comment.frag.out new file mode 100644 index 00000000..b1a00ff5 --- /dev/null +++ b/deps/glslang/Test/baseResults/comment.frag.out @@ -0,0 +1,22 @@ +comment.frag +WARNING: 0:10: 'line continuation' : used at end of comment; the following line is still part of the comment +WARNING: 0:12: 'line continuation' : used at end of comment; the following line is still part of the comment + +Shader version: 430 +0:? Sequence +0:17 Function Definition: main( ( global void) +0:17 Function Parameters: +0:? Linker Objects +0:? 'v' ( smooth in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 430 +0:? Sequence +0:17 Function Definition: main( ( global void) +0:17 Function Parameters: +0:? Linker Objects +0:? 'v' ( smooth in 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/compoundsuffix.frag.hlsl b/deps/glslang/Test/baseResults/compoundsuffix.frag.hlsl new file mode 100644 index 00000000..f47c97dc --- /dev/null +++ b/deps/glslang/Test/baseResults/compoundsuffix.frag.hlsl @@ -0,0 +1,45 @@ +compoundsuffix.frag.hlsl +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 22 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 20 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vf4;" + Name 10 "fragColor" + Name 15 "fragColor" + Name 16 "param" + Name 20 "fragColor" + Decorate 20(fragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 2 8(ptr) + 13: 6(float) Constant 1065353216 + 14: 7(fvec4) ConstantComposite 13 13 13 13 + 19: TypePointer Output 7(fvec4) + 20(fragColor): 19(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 15(fragColor): 8(ptr) Variable Function + 16(param): 8(ptr) Variable Function + 17: 2 FunctionCall 11(@main(vf4;) 16(param) + 18: 7(fvec4) Load 16(param) + Store 15(fragColor) 18 + 21: 7(fvec4) Load 15(fragColor) + Store 20(fragColor) 21 + Return + FunctionEnd + 11(@main(vf4;): 2 Function None 9 + 10(fragColor): 8(ptr) FunctionParameter + 12: Label + Store 10(fragColor) 14 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/compoundsuffix.vert.glsl b/deps/glslang/Test/baseResults/compoundsuffix.vert.glsl new file mode 100644 index 00000000..58354a40 --- /dev/null +++ b/deps/glslang/Test/baseResults/compoundsuffix.vert.glsl @@ -0,0 +1,15 @@ +compoundsuffix.vert.glsl +Shader version: 100 +0:? Sequence +0:1 Function Definition: main( ( global void) +0:1 Function Parameters: +0:3 Sequence +0:3 move second child to first child ( temp highp 4-component vector of float) +0:3 'gl_Position' ( gl_Position highp 4-component vector of float Position) +0:3 Constant: +0:3 1.000000 +0:3 1.000000 +0:3 1.000000 +0:3 1.000000 +0:? Linker Objects + diff --git a/deps/glslang/Test/baseResults/conditionalDiscard.frag.out b/deps/glslang/Test/baseResults/conditionalDiscard.frag.out new file mode 100644 index 00000000..255d9c4d --- /dev/null +++ b/deps/glslang/Test/baseResults/conditionalDiscard.frag.out @@ -0,0 +1,63 @@ +conditionalDiscard.frag +Shader version: 110 +0:? Sequence +0:6 Function Definition: main( ( global void) +0:6 Function Parameters: +0:8 Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'v' ( temp 4-component vector of float) +0:8 texture ( global 4-component vector of float) +0:8 'tex' ( uniform sampler2D) +0:8 'coord' ( smooth in 2-component vector of float) +0:10 Test condition and select ( temp void) +0:10 Condition +0:10 Compare Equal ( temp bool) +0:10 'v' ( temp 4-component vector of float) +0:10 Constant: +0:10 0.100000 +0:10 0.200000 +0:10 0.300000 +0:10 0.400000 +0:10 true case +0:11 Branch: Kill +0:13 move second child to first child ( temp 4-component vector of float) +0:13 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:13 'v' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'tex' ( uniform sampler2D) +0:? 'coord' ( smooth in 2-component vector of float) + + +Linked fragment stage: + + +Shader version: 110 +0:? Sequence +0:6 Function Definition: main( ( global void) +0:6 Function Parameters: +0:8 Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'v' ( temp 4-component vector of float) +0:8 texture ( global 4-component vector of float) +0:8 'tex' ( uniform sampler2D) +0:8 'coord' ( smooth in 2-component vector of float) +0:10 Test condition and select ( temp void) +0:10 Condition +0:10 Compare Equal ( temp bool) +0:10 'v' ( temp 4-component vector of float) +0:10 Constant: +0:10 0.100000 +0:10 0.200000 +0:10 0.300000 +0:10 0.400000 +0:10 true case +0:11 Branch: Kill +0:13 move second child to first child ( temp 4-component vector of float) +0:13 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:13 'v' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'tex' ( uniform sampler2D) +0:? 'coord' ( smooth in 2-component vector of float) + diff --git a/deps/glslang/Test/baseResults/constErrors.frag.out b/deps/glslang/Test/baseResults/constErrors.frag.out new file mode 100644 index 00000000..0b2dc62f --- /dev/null +++ b/deps/glslang/Test/baseResults/constErrors.frag.out @@ -0,0 +1,54 @@ +constErrors.frag +ERROR: 0:14: 'non-constant initializer' : not supported for this version or the enabled extensions +ERROR: 0:17: '' : array size must be a constant integer expression +ERROR: 0:18: '' : array size must be a constant integer expression +ERROR: 0:19: '' : array size must be a constant integer expression +ERROR: 0:27: '=' : global const initializers must be constant ' const structure{ global 3-component vector of float v3, global 2-component vector of int iv2}' +ERROR: 0:33: '=' : global const initializers must be constant ' const structure{ global 3-component vector of float v3, global 2-component vector of int iv2, global 2X4 matrix of float m}' +ERROR: 6 compilation errors. No code generated. + + +Shader version: 330 +ERROR: node is still EOpNull! +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:? Sequence +0:14 Sequence +0:14 move second child to first child ( temp int) +0:14 'a3' ( const (read only) int) +0:14 'uniformInt' ( uniform int) +0:? Linker Objects +0:? 'inVar' ( smooth in 4-component vector of float) +0:? 'outVar' ( out 4-component vector of float) +0:? 'constInt' ( const int) +0:? 3 (const int) +0:? 'uniformInt' ( uniform int) +0:? 's' ( temp structure{ global 3-component vector of float v3, global 2-component vector of int iv2}) +0:? 's2' ( temp structure{ global 3-component vector of float v3, global 2-component vector of int iv2, global 2X4 matrix of float m}) +0:? 'f' ( const float) +0:? 3.000000 + + +Linked fragment stage: + + +Shader version: 330 +ERROR: node is still EOpNull! +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:? Sequence +0:14 Sequence +0:14 move second child to first child ( temp int) +0:14 'a3' ( const (read only) int) +0:14 'uniformInt' ( uniform int) +0:? Linker Objects +0:? 'inVar' ( smooth in 4-component vector of float) +0:? 'outVar' ( out 4-component vector of float) +0:? 'constInt' ( const int) +0:? 3 (const int) +0:? 'uniformInt' ( uniform int) +0:? 's' ( temp structure{ global 3-component vector of float v3, global 2-component vector of int iv2}) +0:? 's2' ( temp structure{ global 3-component vector of float v3, global 2-component vector of int iv2, global 2X4 matrix of float m}) +0:? 'f' ( const float) +0:? 3.000000 + diff --git a/deps/glslang/Test/baseResults/constFold.frag.out b/deps/glslang/Test/baseResults/constFold.frag.out new file mode 100644 index 00000000..2a48c421 --- /dev/null +++ b/deps/glslang/Test/baseResults/constFold.frag.out @@ -0,0 +1,660 @@ +constFold.frag +ERROR: 0:109: '[' : index out of range '-1' +ERROR: 0:110: '[' : vector index out of range '4' +ERROR: 0:111: '[' : index out of range '-2' +ERROR: 0:112: '[' : index out of range '-1' +ERROR: 0:113: '[' : vector index out of range '3' +ERROR: 0:114: '[' : matrix index out of range '3' +ERROR: 6 compilation errors. No code generated. + + +Shader version: 430 +ERROR: node is still EOpNull! +0:28 Function Definition: main( ( global void) +0:28 Function Parameters: +0:30 Sequence +0:30 Sequence +0:30 move second child to first child ( temp 4-component vector of float) +0:30 'dx' ( temp 4-component vector of float) +0:30 dPdx ( global 4-component vector of float) +0:30 'inv' ( smooth in 4-component vector of float) +0:37 move second child to first child ( temp 4-component vector of float) +0:37 'FragColor' ( out 4-component vector of float) +0:37 Constant: +0:37 2.000000 +0:37 6.000000 +0:37 3.000000 +0:37 171.887339 +0:42 move second child to first child ( temp 4-component vector of float) +0:42 'FragColor' ( out 4-component vector of float) +0:42 Constant: +0:42 3.000000 +0:42 2.000000 +0:42 0.001593 +0:42 -0.999999 +0:43 move second child to first child ( temp 2-component vector of float) +0:43 'out2' ( out 2-component vector of float) +0:43 Constant: +0:43 5.600000 +0:43 5.800000 +0:44 move second child to first child ( temp 4-component vector of float) +0:44 'out3' ( out 4-component vector of float) +0:44 Constant: +0:44 20.085537 +0:44 2.302585 +0:44 16.000000 +0:44 8.000000 +0:45 move second child to first child ( temp 4-component vector of float) +0:45 'out4' ( out 4-component vector of float) +0:45 Constant: +0:45 10.000000 +0:45 0.100000 +0:45 4.700000 +0:45 10.900000 +0:46 move second child to first child ( temp 4-component vector of int) +0:46 'out5' ( out 4-component vector of int) +0:46 Constant: +0:46 8 (const int) +0:46 17 (const int) +0:46 -1 (const int) +0:46 1 (const int) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 'out6' ( out 3-component vector of float) +0:47 Constant: +0:47 -1.000000 +0:47 1.000000 +0:47 0.000000 +0:48 move second child to first child ( temp 4-component vector of float) +0:48 'out7' ( out 4-component vector of float) +0:48 Constant: +0:48 4.000000 +0:48 -4.000000 +0:48 5.000000 +0:48 -5.000000 +0:49 move second child to first child ( temp 4-component vector of float) +0:49 'out8' ( out 4-component vector of float) +0:49 Constant: +0:49 4.000000 +0:49 5.000000 +0:49 4.000000 +0:49 -6.000000 +0:50 move second child to first child ( temp 4-component vector of float) +0:50 'out9' ( out 4-component vector of float) +0:50 Constant: +0:50 8.000000 +0:50 -4.000000 +0:50 0.345000 +0:50 0.400000 +0:51 move second child to first child ( temp 4-component vector of float) +0:51 'out10' ( out 4-component vector of float) +0:51 Constant: +0:51 1.000000 +0:51 1.000000 +0:51 0.000000 +0:51 0.000000 +0:52 move second child to first child ( temp 4-component vector of float) +0:52 'out11' ( out 4-component vector of float) +0:52 Constant: +0:52 0.000000 +0:52 0.000000 +0:52 1.000000 +0:52 0.000000 +0:53 move second child to first child ( temp 4-component vector of float) +0:53 'out11' ( out 4-component vector of float) +0:53 Constant: +0:53 1.029639 +0:53 0.799690 +0:53 0.674741 +0:53 1.570696 +0:54 move second child to first child ( temp 4-component vector of float) +0:54 'out11' ( out 4-component vector of float) +0:54 Constant: +0:54 0.000000 +0:54 0.523599 +0:54 1.570796 +0:54 1.047198 +0:58 move second child to first child ( temp 4-component vector of float) +0:58 'out11' ( out 4-component vector of float) +0:58 Constant: +0:58 1.373401 +0:58 0.000000 +0:58 0.896055 +0:58 -0.380506 +0:62 move second child to first child ( temp 2-component vector of int) +0:62 'out12' ( out 2-component vector of int) +0:62 Constant: +0:62 15 (const int) +0:62 16 (const int) +0:63 move second child to first child ( temp 2-component vector of int) +0:63 'out12' ( out 2-component vector of int) +0:63 Constant: +0:63 17 (const int) +0:63 17 (const int) +0:64 move second child to first child ( temp 2-component vector of float) +0:64 'out2' ( out 2-component vector of float) +0:64 Constant: +0:64 871.421253 +0:64 4913.000000 +0:65 move second child to first child ( temp 3-component vector of uint) +0:65 'out13' ( out 3-component vector of uint) +0:65 Constant: +0:65 10 (const uint) +0:65 20 (const uint) +0:65 30 (const uint) +0:66 move second child to first child ( temp 2-component vector of float) +0:66 'out2' ( out 2-component vector of float) +0:66 Constant: +0:66 3.000000 +0:66 6.000000 +0:67 move second child to first child ( temp 2-component vector of float) +0:67 'out2' ( out 2-component vector of float) +0:67 Constant: +0:67 3.500000 +0:67 4.500000 +0:68 move second child to first child ( temp 2-component vector of float) +0:68 'out2' ( out 2-component vector of float) +0:68 Constant: +0:68 0.000000 +0:68 1.000000 +0:69 move second child to first child ( temp 4-component vector of float) +0:69 'out11' ( out 4-component vector of float) +0:69 Constant: +0:69 0.000000 +0:69 0.028000 +0:69 0.500000 +0:69 1.000000 +0:78 Function Definition: foo( ( global void) +0:78 Function Parameters: +0:? Sequence +0:81 move second child to first child ( temp float) +0:81 direct index ( temp float) +0:81 'a' ( temp 3-element array of float) +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 7.000000 +0:82 Constant: +0:82 2 (const int) +0:83 Constant: +0:83 2147483647 (const int) +0:84 Constant: +0:84 +1.#INF +0:84 Constant: +0:84 -1.#INF +0:84 Constant: +0:84 1.#IND +0:88 Constant: +0:88 2 (const uint) +0:88 3 (const uint) +0:89 Constant: +0:89 0 (const uint) +0:90 Constant: +0:90 6 (const uint) +0:90 7 (const uint) +0:103 Function Definition: foo2( ( global void) +0:103 Function Parameters: +0:105 Sequence +0:105 direct index ( temp float) +0:105 'a1' ( global 1-element array of float) +0:105 Constant: +0:105 0 (const int) +0:106 direct index ( temp float) +0:106 'a2' ( global 2-element array of float) +0:106 Constant: +0:106 0 (const int) +0:107 direct index ( temp float) +0:107 'a3' ( global 4-element array of float) +0:107 Constant: +0:107 0 (const int) +0:108 direct index ( temp float) +0:108 'a4' ( global 2-element array of float) +0:108 Constant: +0:108 0 (const int) +0:109 Constant: +0:109 1.000000 +0:110 Constant: +0:110 5.000000 +0:111 Constant: +0:111 2.000000 +0:112 Constant: +0:112 3.000000 +0:113 Constant: +0:113 0.000000 +0:114 Constant: +0:114 0.000000 +0:116 move second child to first child ( temp int) +0:116 'p' ( temp int) +0:116 Constant: +0:116 2147483647 (const int) +0:117 move second child to first child ( temp int) +0:117 'p' ( temp int) +0:117 Constant: +0:117 -2147483648 (const int) +0:118 move second child to first child ( temp int) +0:118 'p' ( temp int) +0:118 Constant: +0:118 -2147483647 (const int) +0:119 Sequence +0:119 move second child to first child ( temp float) +0:119 'f' ( temp float) +0:119 Constant: +0:119 1.444000 +0:120 move second child to first child ( temp float) +0:120 'f' ( temp float) +0:120 direct index ( temp float) +0:120 Construct vec4 ( temp 4-component vector of float) +0:120 Test condition and select ( temp float) +0:120 Condition +0:120 Compare Less Than ( temp bool) +0:120 direct index ( temp float) +0:120 'inv' ( smooth in 4-component vector of float) +0:120 Constant: +0:120 0 (const int) +0:120 Constant: +0:120 2.400000 +0:120 true case +0:120 Constant: +0:120 -1.000000 +0:120 false case +0:120 Constant: +0:120 1.000000 +0:120 Constant: +0:120 3 (const int) +0:126 Function Definition: foo3( ( global void) +0:126 Function Parameters: +0:128 Sequence +0:128 Sequence +0:128 move second child to first child ( temp 3X2 matrix of float) +0:128 'r32' ( temp 3X2 matrix of float) +0:128 Constant: +0:128 43.000000 +0:128 64.000000 +0:128 51.000000 +0:128 76.000000 +0:128 59.000000 +0:128 88.000000 +0:138 Function Definition: foo4( ( global void) +0:138 Function Parameters: +0:140 Sequence +0:140 Sequence +0:140 move second child to first child ( temp int) +0:140 'a' ( temp int) +0:140 Constant: +0:140 9 (const int) +0:? Linker Objects +0:? 'a' ( const int) +0:? 1 (const int) +0:? 'b' ( const int) +0:? 2 (const int) +0:? 'c' ( const int) +0:? 3 (const int) +0:? 'd' ( const int) +0:? 2 (const int) +0:? 'e' ( const float) +0:? 2.000000 +0:? 'f' ( const float) +0:? 6.000000 +0:? 'g' ( const float) +0:? 3.000000 +0:? 'pytho' ( const 2-component vector of float) +0:? 3.000000 +0:? 4.000000 +0:? 'inv' ( smooth in 4-component vector of float) +0:? 'FragColor' ( out 4-component vector of float) +0:? 'out2' ( out 2-component vector of float) +0:? 'out3' ( out 4-component vector of float) +0:? 'out4' ( out 4-component vector of float) +0:? 'out5' ( out 4-component vector of int) +0:? 'out6' ( out 3-component vector of float) +0:? 'out7' ( out 4-component vector of float) +0:? 'out8' ( out 4-component vector of float) +0:? 'out9' ( out 4-component vector of float) +0:? 'out10' ( out 4-component vector of float) +0:? 'out11' ( out 4-component vector of float) +0:? 'out12' ( out 2-component vector of int) +0:? 'out13' ( out 3-component vector of uint) +0:? 's' ( const structure{ global 3-component vector of float v3, global 2-component vector of int iv2, global 2X4 matrix of float m}) +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3 (const int) +0:? 3 (const int) +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 6.000000 +0:? 7.000000 +0:? 8.000000 +0:? 'm2' ( const 2X2 matrix of float) +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 'm3' ( const 3X3 matrix of float) +0:? 2.000000 +0:? 3.000000 +0:? 0.000000 +0:? 4.000000 +0:? 5.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 1.000000 +0:? 'mc' ( const int) +0:? 1 (const int) +0:? 'a1' ( global 1-element array of float) +0:? 'a2' ( global 2-element array of float) +0:? 'a3' ( global 4-element array of float) +0:? 'v2' ( const 2-component vector of float) +0:? 1.000000 +0:? 2.000000 +0:? 'v3' ( const 3-component vector of float) +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 'a4' ( global 2-element array of float) +0:? 'mm2' ( const 2X2 matrix of float) +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 'mm32' ( const 3X2 matrix of float) +0:? 10.000000 +0:? 11.000000 +0:? 12.000000 +0:? 13.000000 +0:? 14.000000 +0:? 15.000000 +0:? 'a0' ( const 3-element array of structure{ global int i, global float f, global bool b}) +0:? 3 (const int) +0:? 2.000000 +0:? true (const bool) +0:? 1 (const int) +0:? 5.000000 +0:? true (const bool) +0:? 1 (const int) +0:? 9.000000 +0:? false (const bool) +0:? 'cval1' ( const bool) +0:? true (const bool) +0:? 'cval2' ( const bool) +0:? false (const bool) +0:? 'cval3' ( const bool) +0:? false (const bool) +0:? 'cval4' ( const bool) +0:? true (const bool) +0:? 'cval5' ( const bool) +0:? false (const bool) +0:? 'cval6' ( const bool) +0:? true (const bool) + + +Linked fragment stage: + + +Shader version: 430 +ERROR: node is still EOpNull! +0:28 Function Definition: main( ( global void) +0:28 Function Parameters: +0:30 Sequence +0:30 Sequence +0:30 move second child to first child ( temp 4-component vector of float) +0:30 'dx' ( temp 4-component vector of float) +0:30 dPdx ( global 4-component vector of float) +0:30 'inv' ( smooth in 4-component vector of float) +0:37 move second child to first child ( temp 4-component vector of float) +0:37 'FragColor' ( out 4-component vector of float) +0:37 Constant: +0:37 2.000000 +0:37 6.000000 +0:37 3.000000 +0:37 171.887339 +0:42 move second child to first child ( temp 4-component vector of float) +0:42 'FragColor' ( out 4-component vector of float) +0:42 Constant: +0:42 3.000000 +0:42 2.000000 +0:42 0.001593 +0:42 -0.999999 +0:43 move second child to first child ( temp 2-component vector of float) +0:43 'out2' ( out 2-component vector of float) +0:43 Constant: +0:43 5.600000 +0:43 5.800000 +0:44 move second child to first child ( temp 4-component vector of float) +0:44 'out3' ( out 4-component vector of float) +0:44 Constant: +0:44 20.085537 +0:44 2.302585 +0:44 16.000000 +0:44 8.000000 +0:45 move second child to first child ( temp 4-component vector of float) +0:45 'out4' ( out 4-component vector of float) +0:45 Constant: +0:45 10.000000 +0:45 0.100000 +0:45 4.700000 +0:45 10.900000 +0:46 move second child to first child ( temp 4-component vector of int) +0:46 'out5' ( out 4-component vector of int) +0:46 Constant: +0:46 8 (const int) +0:46 17 (const int) +0:46 -1 (const int) +0:46 1 (const int) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 'out6' ( out 3-component vector of float) +0:47 Constant: +0:47 -1.000000 +0:47 1.000000 +0:47 0.000000 +0:48 move second child to first child ( temp 4-component vector of float) +0:48 'out7' ( out 4-component vector of float) +0:48 Constant: +0:48 4.000000 +0:48 -4.000000 +0:48 5.000000 +0:48 -5.000000 +0:49 move second child to first child ( temp 4-component vector of float) +0:49 'out8' ( out 4-component vector of float) +0:49 Constant: +0:49 4.000000 +0:49 5.000000 +0:49 4.000000 +0:49 -6.000000 +0:50 move second child to first child ( temp 4-component vector of float) +0:50 'out9' ( out 4-component vector of float) +0:50 Constant: +0:50 8.000000 +0:50 -4.000000 +0:50 0.345000 +0:50 0.400000 +0:51 move second child to first child ( temp 4-component vector of float) +0:51 'out10' ( out 4-component vector of float) +0:51 Constant: +0:51 1.000000 +0:51 1.000000 +0:51 0.000000 +0:51 0.000000 +0:52 move second child to first child ( temp 4-component vector of float) +0:52 'out11' ( out 4-component vector of float) +0:52 Constant: +0:52 0.000000 +0:52 0.000000 +0:52 1.000000 +0:52 0.000000 +0:53 move second child to first child ( temp 4-component vector of float) +0:53 'out11' ( out 4-component vector of float) +0:53 Constant: +0:53 1.029639 +0:53 0.799690 +0:53 0.674741 +0:53 1.570696 +0:54 move second child to first child ( temp 4-component vector of float) +0:54 'out11' ( out 4-component vector of float) +0:54 Constant: +0:54 0.000000 +0:54 0.523599 +0:54 1.570796 +0:54 1.047198 +0:58 move second child to first child ( temp 4-component vector of float) +0:58 'out11' ( out 4-component vector of float) +0:58 Constant: +0:58 1.373401 +0:58 0.000000 +0:58 0.896055 +0:58 -0.380506 +0:62 move second child to first child ( temp 2-component vector of int) +0:62 'out12' ( out 2-component vector of int) +0:62 Constant: +0:62 15 (const int) +0:62 16 (const int) +0:63 move second child to first child ( temp 2-component vector of int) +0:63 'out12' ( out 2-component vector of int) +0:63 Constant: +0:63 17 (const int) +0:63 17 (const int) +0:64 move second child to first child ( temp 2-component vector of float) +0:64 'out2' ( out 2-component vector of float) +0:64 Constant: +0:64 871.421253 +0:64 4913.000000 +0:65 move second child to first child ( temp 3-component vector of uint) +0:65 'out13' ( out 3-component vector of uint) +0:65 Constant: +0:65 10 (const uint) +0:65 20 (const uint) +0:65 30 (const uint) +0:66 move second child to first child ( temp 2-component vector of float) +0:66 'out2' ( out 2-component vector of float) +0:66 Constant: +0:66 3.000000 +0:66 6.000000 +0:67 move second child to first child ( temp 2-component vector of float) +0:67 'out2' ( out 2-component vector of float) +0:67 Constant: +0:67 3.500000 +0:67 4.500000 +0:68 move second child to first child ( temp 2-component vector of float) +0:68 'out2' ( out 2-component vector of float) +0:68 Constant: +0:68 0.000000 +0:68 1.000000 +0:69 move second child to first child ( temp 4-component vector of float) +0:69 'out11' ( out 4-component vector of float) +0:69 Constant: +0:69 0.000000 +0:69 0.028000 +0:69 0.500000 +0:69 1.000000 +0:? Linker Objects +0:? 'a' ( const int) +0:? 1 (const int) +0:? 'b' ( const int) +0:? 2 (const int) +0:? 'c' ( const int) +0:? 3 (const int) +0:? 'd' ( const int) +0:? 2 (const int) +0:? 'e' ( const float) +0:? 2.000000 +0:? 'f' ( const float) +0:? 6.000000 +0:? 'g' ( const float) +0:? 3.000000 +0:? 'pytho' ( const 2-component vector of float) +0:? 3.000000 +0:? 4.000000 +0:? 'inv' ( smooth in 4-component vector of float) +0:? 'FragColor' ( out 4-component vector of float) +0:? 'out2' ( out 2-component vector of float) +0:? 'out3' ( out 4-component vector of float) +0:? 'out4' ( out 4-component vector of float) +0:? 'out5' ( out 4-component vector of int) +0:? 'out6' ( out 3-component vector of float) +0:? 'out7' ( out 4-component vector of float) +0:? 'out8' ( out 4-component vector of float) +0:? 'out9' ( out 4-component vector of float) +0:? 'out10' ( out 4-component vector of float) +0:? 'out11' ( out 4-component vector of float) +0:? 'out12' ( out 2-component vector of int) +0:? 'out13' ( out 3-component vector of uint) +0:? 's' ( const structure{ global 3-component vector of float v3, global 2-component vector of int iv2, global 2X4 matrix of float m}) +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3 (const int) +0:? 3 (const int) +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 6.000000 +0:? 7.000000 +0:? 8.000000 +0:? 'm2' ( const 2X2 matrix of float) +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 'm3' ( const 3X3 matrix of float) +0:? 2.000000 +0:? 3.000000 +0:? 0.000000 +0:? 4.000000 +0:? 5.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 1.000000 +0:? 'mc' ( const int) +0:? 1 (const int) +0:? 'a1' ( global 1-element array of float) +0:? 'a2' ( global 2-element array of float) +0:? 'a3' ( global 4-element array of float) +0:? 'v2' ( const 2-component vector of float) +0:? 1.000000 +0:? 2.000000 +0:? 'v3' ( const 3-component vector of float) +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 'a4' ( global 2-element array of float) +0:? 'mm2' ( const 2X2 matrix of float) +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 'mm32' ( const 3X2 matrix of float) +0:? 10.000000 +0:? 11.000000 +0:? 12.000000 +0:? 13.000000 +0:? 14.000000 +0:? 15.000000 +0:? 'a0' ( const 3-element array of structure{ global int i, global float f, global bool b}) +0:? 3 (const int) +0:? 2.000000 +0:? true (const bool) +0:? 1 (const int) +0:? 5.000000 +0:? true (const bool) +0:? 1 (const int) +0:? 9.000000 +0:? false (const bool) +0:? 'cval1' ( const bool) +0:? true (const bool) +0:? 'cval2' ( const bool) +0:? false (const bool) +0:? 'cval3' ( const bool) +0:? false (const bool) +0:? 'cval4' ( const bool) +0:? true (const bool) +0:? 'cval5' ( const bool) +0:? false (const bool) +0:? 'cval6' ( const bool) +0:? true (const bool) + diff --git a/deps/glslang/Test/baseResults/constFoldIntMin.frag.out b/deps/glslang/Test/baseResults/constFoldIntMin.frag.out new file mode 100644 index 00000000..2c45ca80 --- /dev/null +++ b/deps/glslang/Test/baseResults/constFoldIntMin.frag.out @@ -0,0 +1,51 @@ +constFoldIntMin.frag +Shader version: 460 +Requested GL_AMD_gpu_shader_int16 +Requested GL_ARB_gpu_shader_int64 +0:? Sequence +0:5 Function Definition: a( ( global void) +0:5 Function Parameters: +0:6 Sequence +0:6 Sequence +0:6 move second child to first child ( temp int16_t) +0:6 'u' ( temp int16_t) +0:6 Constant: +0:6 -32768 (const int16_t) +0:7 Sequence +0:7 move second child to first child ( temp int) +0:7 'v' ( temp int) +0:7 Constant: +0:7 -2147483648 (const int) +0:8 Sequence +0:8 move second child to first child ( temp int64_t) +0:8 'w' ( temp int64_t) +0:8 Constant: +0:8 -9223372036854775808 (const int64_t) +0:9 Sequence +0:9 move second child to first child ( temp int16_t) +0:9 'x' ( temp int16_t) +0:9 Constant: +0:9 0 (const int8_t) +0:10 Sequence +0:10 move second child to first child ( temp int) +0:10 'y' ( temp int) +0:10 Constant: +0:10 0 (const int) +0:11 Sequence +0:11 move second child to first child ( temp int64_t) +0:11 'z' ( temp int64_t) +0:11 Constant: +0:11 0 (const int64_t) +0:? Linker Objects + + +Linked fragment stage: + +ERROR: Linking fragment stage: Missing entry point: Each stage requires one entry point + +Shader version: 460 +Requested GL_AMD_gpu_shader_int16 +Requested GL_ARB_gpu_shader_int64 +0:? Sequence +0:? Linker Objects + diff --git a/deps/glslang/Test/baseResults/conversion.frag.out b/deps/glslang/Test/baseResults/conversion.frag.out new file mode 100644 index 00000000..73875d19 --- /dev/null +++ b/deps/glslang/Test/baseResults/conversion.frag.out @@ -0,0 +1,955 @@ +conversion.frag +Shader version: 130 +0:? Sequence +0:33 Function Definition: main( ( global void) +0:33 Function Parameters: +0:35 Sequence +0:35 Sequence +0:35 move second child to first child ( temp bool) +0:35 'b' ( temp bool) +0:35 logical-xor ( temp bool) +0:35 Convert int to bool ( temp bool) +0:35 'u_i' ( uniform int) +0:35 Convert float to bool ( temp bool) +0:35 'u_f' ( uniform float) +0:36 Sequence +0:36 move second child to first child ( temp 2-component vector of bool) +0:36 'b2' ( temp 2-component vector of bool) +0:36 Construct bvec2 ( temp 2-component vector of bool) +0:36 Convert int to bool ( temp bool) +0:36 'u_i' ( uniform int) +0:36 Convert float to bool ( temp bool) +0:36 'u_f' ( uniform float) +0:37 Sequence +0:37 move second child to first child ( temp 3-component vector of bool) +0:37 'b3' ( temp 3-component vector of bool) +0:37 Construct bvec3 ( temp 3-component vector of bool) +0:37 Convert int to bool ( temp bool) +0:37 'u_i' ( uniform int) +0:37 Convert float to bool ( temp bool) +0:37 'u_f' ( uniform float) +0:37 Convert int to bool ( temp bool) +0:37 'i_i' ( flat in int) +0:38 Sequence +0:38 move second child to first child ( temp 4-component vector of bool) +0:38 'b4' ( temp 4-component vector of bool) +0:38 Construct bvec4 ( temp 4-component vector of bool) +0:38 Convert int to bool ( temp bool) +0:38 'u_i' ( uniform int) +0:38 Convert float to bool ( temp bool) +0:38 'u_f' ( uniform float) +0:38 Convert int to bool ( temp bool) +0:38 'i_i' ( flat in int) +0:38 Convert float to bool ( temp bool) +0:38 'i_f' ( smooth in float) +0:40 Sequence +0:40 move second child to first child ( temp int) +0:40 'i' ( temp int) +0:40 add ( temp int) +0:40 Convert float to int ( temp int) +0:40 'u_f' ( uniform float) +0:40 Convert bool to int ( temp int) +0:40 'b' ( temp bool) +0:41 Sequence +0:41 move second child to first child ( temp 2-component vector of int) +0:41 'i2' ( temp 2-component vector of int) +0:41 add ( temp 2-component vector of int) +0:41 Convert float to int ( temp 2-component vector of int) +0:41 'u_f2' ( uniform 2-component vector of float) +0:41 Convert bool to int ( temp 2-component vector of int) +0:41 'b2' ( temp 2-component vector of bool) +0:42 Sequence +0:42 move second child to first child ( temp 3-component vector of int) +0:42 'i3' ( temp 3-component vector of int) +0:42 add ( temp 3-component vector of int) +0:42 Convert float to int ( temp 3-component vector of int) +0:42 'u_f3' ( uniform 3-component vector of float) +0:42 Convert bool to int ( temp 3-component vector of int) +0:42 'b3' ( temp 3-component vector of bool) +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of int) +0:43 'i4' ( temp 4-component vector of int) +0:43 add ( temp 4-component vector of int) +0:43 Convert float to int ( temp 4-component vector of int) +0:43 'u_f4' ( uniform 4-component vector of float) +0:43 Convert bool to int ( temp 4-component vector of int) +0:43 'b4' ( temp 4-component vector of bool) +0:45 Sequence +0:45 move second child to first child ( temp float) +0:45 'f' ( temp float) +0:45 Convert int to float ( temp float) +0:45 'i' ( temp int) +0:46 Sequence +0:46 move second child to first child ( temp 2-component vector of float) +0:46 'f2' ( temp 2-component vector of float) +0:46 Convert int to float ( temp 2-component vector of float) +0:46 'i2' ( temp 2-component vector of int) +0:47 Sequence +0:47 move second child to first child ( temp 3-component vector of float) +0:47 'f3' ( temp 3-component vector of float) +0:47 Convert int to float ( temp 3-component vector of float) +0:47 'i3' ( temp 3-component vector of int) +0:48 Sequence +0:48 move second child to first child ( temp 4-component vector of float) +0:48 'f4' ( temp 4-component vector of float) +0:48 Convert int to float ( temp 4-component vector of float) +0:48 'i4' ( temp 4-component vector of int) +0:50 add second child into first child ( temp float) +0:50 'f' ( temp float) +0:50 add ( temp float) +0:50 Convert int to float ( temp float) +0:50 'i' ( temp int) +0:50 Convert bool to float ( temp float) +0:50 'b' ( temp bool) +0:51 subtract second child into first child ( temp 2-component vector of float) +0:51 'f2' ( temp 2-component vector of float) +0:51 add ( temp 2-component vector of float) +0:51 Convert int to float ( temp 2-component vector of float) +0:51 'i2' ( temp 2-component vector of int) +0:51 Convert bool to float ( temp 2-component vector of float) +0:51 'b2' ( temp 2-component vector of bool) +0:52 divide second child into first child ( temp 3-component vector of float) +0:52 'f3' ( temp 3-component vector of float) +0:52 add ( temp 3-component vector of float) +0:52 Convert int to float ( temp 3-component vector of float) +0:52 'i3' ( temp 3-component vector of int) +0:52 Convert bool to float ( temp 3-component vector of float) +0:52 'b3' ( temp 3-component vector of bool) +0:53 add second child into first child ( temp 4-component vector of float) +0:53 'f4' ( temp 4-component vector of float) +0:53 add ( temp 4-component vector of float) +0:53 Convert int to float ( temp 4-component vector of float) +0:53 'i4' ( temp 4-component vector of int) +0:53 Convert bool to float ( temp 4-component vector of float) +0:53 'b4' ( temp 4-component vector of bool) +0:55 add second child into first child ( temp 4-component vector of float) +0:55 'f4' ( temp 4-component vector of float) +0:55 Convert bool to float ( temp 4-component vector of float) +0:55 Convert int to bool ( temp 4-component vector of bool) +0:55 'i_i4' ( flat in 4-component vector of int) +0:56 add second child into first child ( temp 4-component vector of float) +0:56 'f4' ( temp 4-component vector of float) +0:56 Convert bool to float ( temp 4-component vector of float) +0:56 Convert float to bool ( temp 4-component vector of bool) +0:56 'u_f4' ( uniform 4-component vector of float) +0:58 add second child into first child ( temp float) +0:58 'f' ( temp float) +0:58 subtract ( temp float) +0:58 'f' ( temp float) +0:58 Convert int to float ( temp float) +0:58 'i' ( temp int) +0:59 add second child into first child ( temp 2-component vector of float) +0:59 'f2' ( temp 2-component vector of float) +0:59 add ( temp 2-component vector of float) +0:59 Construct vec2 ( temp 2-component vector of float) +0:59 'f' ( temp float) +0:59 Convert int to float ( temp float) +0:59 'i' ( temp int) +0:59 Convert int to float ( temp 2-component vector of float) +0:59 'i2' ( temp 2-component vector of int) +0:60 add second child into first child ( temp 3-component vector of float) +0:60 'f3' ( temp 3-component vector of float) +0:60 add ( temp 3-component vector of float) +0:60 Convert int to float ( temp 3-component vector of float) +0:60 'i3' ( temp 3-component vector of int) +0:60 Construct vec3 ( temp 3-component vector of float) +0:60 'f' ( temp float) +0:60 Convert int to float ( temp float) +0:60 'i' ( temp int) +0:60 'f' ( temp float) +0:61 add second child into first child ( temp 4-component vector of float) +0:61 'f4' ( temp 4-component vector of float) +0:61 add ( temp 4-component vector of float) +0:61 Construct vec4 ( temp 4-component vector of float) +0:61 Convert bool to float ( temp float) +0:61 'b' ( temp bool) +0:61 Convert int to float ( temp float) +0:61 'i' ( temp int) +0:61 'f' ( temp float) +0:61 Convert int to float ( temp float) +0:61 'i' ( temp int) +0:61 Convert int to float ( temp 4-component vector of float) +0:61 'i4' ( temp 4-component vector of int) +0:63 add second child into first child ( temp 2-component vector of float) +0:63 'f2' ( temp 2-component vector of float) +0:63 vector-scale ( temp 2-component vector of float) +0:63 Construct vec2 ( temp 2-component vector of float) +0:63 'f' ( temp float) +0:63 Convert int to float ( temp float) +0:63 'i' ( temp int) +0:63 Convert int to float ( temp float) +0:63 'i' ( temp int) +0:64 add second child into first child ( temp 3-component vector of float) +0:64 'f3' ( temp 3-component vector of float) +0:64 add ( temp 3-component vector of float) +0:64 Construct vec3 ( temp 3-component vector of float) +0:64 'f' ( temp float) +0:64 Convert int to float ( temp float) +0:64 'i' ( temp int) +0:64 'f' ( temp float) +0:64 Convert int to float ( temp float) +0:64 'i' ( temp int) +0:65 add second child into first child ( temp 4-component vector of float) +0:65 'f4' ( temp 4-component vector of float) +0:65 subtract ( temp 4-component vector of float) +0:65 Convert int to float ( temp float) +0:65 'i' ( temp int) +0:65 Construct vec4 ( temp 4-component vector of float) +0:65 Convert bool to float ( temp float) +0:65 'b' ( temp bool) +0:65 Convert int to float ( temp float) +0:65 'i' ( temp int) +0:65 'f' ( temp float) +0:65 Convert int to float ( temp float) +0:65 'i' ( temp int) +0:67 add second child into first child ( temp 2-component vector of int) +0:67 'i2' ( temp 2-component vector of int) +0:67 Construct ivec2 ( temp 2-component vector of int) +0:67 Convert float to int ( temp int) +0:67 'f' ( temp float) +0:67 'i' ( temp int) +0:68 add second child into first child ( temp 3-component vector of int) +0:68 'i3' ( temp 3-component vector of int) +0:68 Construct ivec3 ( temp 3-component vector of int) +0:68 Convert float to int ( temp int) +0:68 'f' ( temp float) +0:68 'i' ( temp int) +0:68 Convert float to int ( temp int) +0:68 'f' ( temp float) +0:69 add second child into first child ( temp 4-component vector of int) +0:69 'i4' ( temp 4-component vector of int) +0:69 Construct ivec4 ( temp 4-component vector of int) +0:69 Convert bool to int ( temp int) +0:69 'b' ( temp bool) +0:69 'i' ( temp int) +0:69 Convert float to int ( temp int) +0:69 'f' ( temp float) +0:69 'i' ( temp int) +0:71 Test condition and select ( temp void) +0:71 Condition +0:72 logical-or ( temp bool) +0:71 logical-or ( temp bool) +0:71 logical-or ( temp bool) +0:71 Compare Less Than ( temp bool) +0:71 'f' ( temp float) +0:71 Convert int to float ( temp float) +0:71 'i' ( temp int) +0:71 Compare Less Than ( temp bool) +0:71 Convert int to float ( temp float) +0:71 'i' ( temp int) +0:71 'f' ( temp float) +0:72 Compare Equal ( temp bool) +0:72 'f2' ( temp 2-component vector of float) +0:72 Convert int to float ( temp 2-component vector of float) +0:72 'i2' ( temp 2-component vector of int) +0:73 Compare Not Equal ( temp bool) +0:73 Convert int to float ( temp 3-component vector of float) +0:73 'i3' ( temp 3-component vector of int) +0:73 'f3' ( temp 3-component vector of float) +0:71 true case +0:74 move second child to first child ( temp float) +0:74 'f' ( temp float) +0:74 add ( temp float) +0:74 Test condition and select ( temp float) +0:74 Condition +0:74 'b' ( temp bool) +0:74 true case +0:74 Convert int to float ( temp float) +0:74 'i' ( temp int) +0:74 false case +0:74 direct index ( temp float) +0:74 'f2' ( temp 2-component vector of float) +0:74 Constant: +0:74 0 (const int) +0:74 Test condition and select ( temp float) +0:74 Condition +0:74 direct index ( temp bool) +0:74 'b2' ( temp 2-component vector of bool) +0:74 Constant: +0:74 0 (const int) +0:74 true case +0:74 direct index ( temp float) +0:74 'f3' ( temp 3-component vector of float) +0:74 Constant: +0:74 0 (const int) +0:74 false case +0:74 Convert int to float ( temp float) +0:74 direct index ( temp int) +0:74 'i2' ( temp 2-component vector of int) +0:74 Constant: +0:74 1 (const int) +0:76 move second child to first child ( temp 4-component vector of float) +0:76 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:86 Test condition and select ( temp 4-component vector of float) +0:86 Condition +0:85 logical-or ( temp bool) +0:84 logical-or ( temp bool) +0:83 logical-or ( temp bool) +0:82 logical-or ( temp bool) +0:81 logical-or ( temp bool) +0:80 logical-or ( temp bool) +0:79 logical-or ( temp bool) +0:78 logical-or ( temp bool) +0:77 logical-or ( temp bool) +0:77 'b' ( temp bool) +0:78 direct index ( temp bool) +0:78 'b2' ( temp 2-component vector of bool) +0:78 Constant: +0:78 0 (const int) +0:79 direct index ( temp bool) +0:79 'b2' ( temp 2-component vector of bool) +0:79 Constant: +0:79 1 (const int) +0:80 direct index ( temp bool) +0:80 'b3' ( temp 3-component vector of bool) +0:80 Constant: +0:80 0 (const int) +0:81 direct index ( temp bool) +0:81 'b3' ( temp 3-component vector of bool) +0:81 Constant: +0:81 1 (const int) +0:82 direct index ( temp bool) +0:82 'b3' ( temp 3-component vector of bool) +0:82 Constant: +0:82 2 (const int) +0:83 direct index ( temp bool) +0:83 'b4' ( temp 4-component vector of bool) +0:83 Constant: +0:83 0 (const int) +0:84 direct index ( temp bool) +0:84 'b4' ( temp 4-component vector of bool) +0:84 Constant: +0:84 1 (const int) +0:85 direct index ( temp bool) +0:85 'b4' ( temp 4-component vector of bool) +0:85 Constant: +0:85 2 (const int) +0:86 direct index ( temp bool) +0:86 'b4' ( temp 4-component vector of bool) +0:86 Constant: +0:86 3 (const int) +0:86 true case +0:105 Construct vec4 ( temp 4-component vector of float) +0:105 add ( temp float) +0:104 add ( temp float) +0:103 add ( temp float) +0:102 add ( temp float) +0:101 add ( temp float) +0:100 add ( temp float) +0:99 add ( temp float) +0:98 add ( temp float) +0:97 add ( temp float) +0:96 add ( temp float) +0:95 Convert int to float ( temp float) +0:95 add ( temp int) +0:94 add ( temp int) +0:93 add ( temp int) +0:92 add ( temp int) +0:91 add ( temp int) +0:90 add ( temp int) +0:89 add ( temp int) +0:88 add ( temp int) +0:87 add ( temp int) +0:87 'i' ( temp int) +0:88 direct index ( temp int) +0:88 'i2' ( temp 2-component vector of int) +0:88 Constant: +0:88 0 (const int) +0:89 direct index ( temp int) +0:89 'i2' ( temp 2-component vector of int) +0:89 Constant: +0:89 1 (const int) +0:90 direct index ( temp int) +0:90 'i3' ( temp 3-component vector of int) +0:90 Constant: +0:90 0 (const int) +0:91 direct index ( temp int) +0:91 'i3' ( temp 3-component vector of int) +0:91 Constant: +0:91 1 (const int) +0:92 direct index ( temp int) +0:92 'i3' ( temp 3-component vector of int) +0:92 Constant: +0:92 2 (const int) +0:93 direct index ( temp int) +0:93 'i4' ( temp 4-component vector of int) +0:93 Constant: +0:93 0 (const int) +0:94 direct index ( temp int) +0:94 'i4' ( temp 4-component vector of int) +0:94 Constant: +0:94 1 (const int) +0:95 direct index ( temp int) +0:95 'i4' ( temp 4-component vector of int) +0:95 Constant: +0:95 2 (const int) +0:96 direct index ( temp int) +0:96 'i4' ( temp 4-component vector of int) +0:96 Constant: +0:96 3 (const int) +0:97 'f' ( temp float) +0:98 direct index ( temp float) +0:98 'f2' ( temp 2-component vector of float) +0:98 Constant: +0:98 0 (const int) +0:99 direct index ( temp float) +0:99 'f2' ( temp 2-component vector of float) +0:99 Constant: +0:99 1 (const int) +0:100 direct index ( temp float) +0:100 'f3' ( temp 3-component vector of float) +0:100 Constant: +0:100 0 (const int) +0:101 direct index ( temp float) +0:101 'f3' ( temp 3-component vector of float) +0:101 Constant: +0:101 1 (const int) +0:102 direct index ( temp float) +0:102 'f3' ( temp 3-component vector of float) +0:102 Constant: +0:102 2 (const int) +0:103 direct index ( temp float) +0:103 'f4' ( temp 4-component vector of float) +0:103 Constant: +0:103 0 (const int) +0:104 direct index ( temp float) +0:104 'f4' ( temp 4-component vector of float) +0:104 Constant: +0:104 1 (const int) +0:105 direct index ( temp float) +0:105 'f4' ( temp 4-component vector of float) +0:105 Constant: +0:105 2 (const int) +0:106 direct index ( temp float) +0:106 'f4' ( temp 4-component vector of float) +0:106 Constant: +0:106 3 (const int) +0:86 false case +0:106 Constant: +0:106 1.000000 +0:106 1.000000 +0:106 1.000000 +0:106 1.000000 +0:109 Sequence +0:109 move second child to first child ( temp 4-component vector of int) +0:109 'cv2' ( temp 4-component vector of int) +0:109 Constant: +0:109 1 (const int) +0:109 1 (const int) +0:109 1 (const int) +0:109 1 (const int) +0:110 Sequence +0:110 move second child to first child ( temp 4-component vector of bool) +0:110 'cv5' ( temp 4-component vector of bool) +0:110 Convert int to bool ( temp 4-component vector of bool) +0:110 'cv2' ( temp 4-component vector of int) +0:111 add second child into first child ( temp 4-component vector of float) +0:111 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:111 Construct float ( temp float) +0:111 Convert bool to float ( temp 4-component vector of float) +0:111 'cv5' ( temp 4-component vector of bool) +0:? Linker Objects +0:? 'u_b' ( uniform bool) +0:? 'u_b2' ( uniform 2-component vector of bool) +0:? 'u_b3' ( uniform 3-component vector of bool) +0:? 'u_b4' ( uniform 4-component vector of bool) +0:? 'u_i' ( uniform int) +0:? 'u_i2' ( uniform 2-component vector of int) +0:? 'u_i3' ( uniform 3-component vector of int) +0:? 'u_i4' ( uniform 4-component vector of int) +0:? 'u_f' ( uniform float) +0:? 'u_f2' ( uniform 2-component vector of float) +0:? 'u_f3' ( uniform 3-component vector of float) +0:? 'u_f4' ( uniform 4-component vector of float) +0:? 'i_b' ( uniform bool) +0:? 'i_b2' ( uniform 2-component vector of bool) +0:? 'i_b3' ( uniform 3-component vector of bool) +0:? 'i_b4' ( uniform 4-component vector of bool) +0:? 'i_i' ( flat in int) +0:? 'i_i2' ( flat in 2-component vector of int) +0:? 'i_i3' ( flat in 3-component vector of int) +0:? 'i_i4' ( flat in 4-component vector of int) +0:? 'i_f' ( smooth in float) +0:? 'i_f2' ( smooth in 2-component vector of float) +0:? 'i_f3' ( smooth in 3-component vector of float) +0:? 'i_f4' ( smooth in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 130 +0:? Sequence +0:33 Function Definition: main( ( global void) +0:33 Function Parameters: +0:35 Sequence +0:35 Sequence +0:35 move second child to first child ( temp bool) +0:35 'b' ( temp bool) +0:35 logical-xor ( temp bool) +0:35 Convert int to bool ( temp bool) +0:35 'u_i' ( uniform int) +0:35 Convert float to bool ( temp bool) +0:35 'u_f' ( uniform float) +0:36 Sequence +0:36 move second child to first child ( temp 2-component vector of bool) +0:36 'b2' ( temp 2-component vector of bool) +0:36 Construct bvec2 ( temp 2-component vector of bool) +0:36 Convert int to bool ( temp bool) +0:36 'u_i' ( uniform int) +0:36 Convert float to bool ( temp bool) +0:36 'u_f' ( uniform float) +0:37 Sequence +0:37 move second child to first child ( temp 3-component vector of bool) +0:37 'b3' ( temp 3-component vector of bool) +0:37 Construct bvec3 ( temp 3-component vector of bool) +0:37 Convert int to bool ( temp bool) +0:37 'u_i' ( uniform int) +0:37 Convert float to bool ( temp bool) +0:37 'u_f' ( uniform float) +0:37 Convert int to bool ( temp bool) +0:37 'i_i' ( flat in int) +0:38 Sequence +0:38 move second child to first child ( temp 4-component vector of bool) +0:38 'b4' ( temp 4-component vector of bool) +0:38 Construct bvec4 ( temp 4-component vector of bool) +0:38 Convert int to bool ( temp bool) +0:38 'u_i' ( uniform int) +0:38 Convert float to bool ( temp bool) +0:38 'u_f' ( uniform float) +0:38 Convert int to bool ( temp bool) +0:38 'i_i' ( flat in int) +0:38 Convert float to bool ( temp bool) +0:38 'i_f' ( smooth in float) +0:40 Sequence +0:40 move second child to first child ( temp int) +0:40 'i' ( temp int) +0:40 add ( temp int) +0:40 Convert float to int ( temp int) +0:40 'u_f' ( uniform float) +0:40 Convert bool to int ( temp int) +0:40 'b' ( temp bool) +0:41 Sequence +0:41 move second child to first child ( temp 2-component vector of int) +0:41 'i2' ( temp 2-component vector of int) +0:41 add ( temp 2-component vector of int) +0:41 Convert float to int ( temp 2-component vector of int) +0:41 'u_f2' ( uniform 2-component vector of float) +0:41 Convert bool to int ( temp 2-component vector of int) +0:41 'b2' ( temp 2-component vector of bool) +0:42 Sequence +0:42 move second child to first child ( temp 3-component vector of int) +0:42 'i3' ( temp 3-component vector of int) +0:42 add ( temp 3-component vector of int) +0:42 Convert float to int ( temp 3-component vector of int) +0:42 'u_f3' ( uniform 3-component vector of float) +0:42 Convert bool to int ( temp 3-component vector of int) +0:42 'b3' ( temp 3-component vector of bool) +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of int) +0:43 'i4' ( temp 4-component vector of int) +0:43 add ( temp 4-component vector of int) +0:43 Convert float to int ( temp 4-component vector of int) +0:43 'u_f4' ( uniform 4-component vector of float) +0:43 Convert bool to int ( temp 4-component vector of int) +0:43 'b4' ( temp 4-component vector of bool) +0:45 Sequence +0:45 move second child to first child ( temp float) +0:45 'f' ( temp float) +0:45 Convert int to float ( temp float) +0:45 'i' ( temp int) +0:46 Sequence +0:46 move second child to first child ( temp 2-component vector of float) +0:46 'f2' ( temp 2-component vector of float) +0:46 Convert int to float ( temp 2-component vector of float) +0:46 'i2' ( temp 2-component vector of int) +0:47 Sequence +0:47 move second child to first child ( temp 3-component vector of float) +0:47 'f3' ( temp 3-component vector of float) +0:47 Convert int to float ( temp 3-component vector of float) +0:47 'i3' ( temp 3-component vector of int) +0:48 Sequence +0:48 move second child to first child ( temp 4-component vector of float) +0:48 'f4' ( temp 4-component vector of float) +0:48 Convert int to float ( temp 4-component vector of float) +0:48 'i4' ( temp 4-component vector of int) +0:50 add second child into first child ( temp float) +0:50 'f' ( temp float) +0:50 add ( temp float) +0:50 Convert int to float ( temp float) +0:50 'i' ( temp int) +0:50 Convert bool to float ( temp float) +0:50 'b' ( temp bool) +0:51 subtract second child into first child ( temp 2-component vector of float) +0:51 'f2' ( temp 2-component vector of float) +0:51 add ( temp 2-component vector of float) +0:51 Convert int to float ( temp 2-component vector of float) +0:51 'i2' ( temp 2-component vector of int) +0:51 Convert bool to float ( temp 2-component vector of float) +0:51 'b2' ( temp 2-component vector of bool) +0:52 divide second child into first child ( temp 3-component vector of float) +0:52 'f3' ( temp 3-component vector of float) +0:52 add ( temp 3-component vector of float) +0:52 Convert int to float ( temp 3-component vector of float) +0:52 'i3' ( temp 3-component vector of int) +0:52 Convert bool to float ( temp 3-component vector of float) +0:52 'b3' ( temp 3-component vector of bool) +0:53 add second child into first child ( temp 4-component vector of float) +0:53 'f4' ( temp 4-component vector of float) +0:53 add ( temp 4-component vector of float) +0:53 Convert int to float ( temp 4-component vector of float) +0:53 'i4' ( temp 4-component vector of int) +0:53 Convert bool to float ( temp 4-component vector of float) +0:53 'b4' ( temp 4-component vector of bool) +0:55 add second child into first child ( temp 4-component vector of float) +0:55 'f4' ( temp 4-component vector of float) +0:55 Convert bool to float ( temp 4-component vector of float) +0:55 Convert int to bool ( temp 4-component vector of bool) +0:55 'i_i4' ( flat in 4-component vector of int) +0:56 add second child into first child ( temp 4-component vector of float) +0:56 'f4' ( temp 4-component vector of float) +0:56 Convert bool to float ( temp 4-component vector of float) +0:56 Convert float to bool ( temp 4-component vector of bool) +0:56 'u_f4' ( uniform 4-component vector of float) +0:58 add second child into first child ( temp float) +0:58 'f' ( temp float) +0:58 subtract ( temp float) +0:58 'f' ( temp float) +0:58 Convert int to float ( temp float) +0:58 'i' ( temp int) +0:59 add second child into first child ( temp 2-component vector of float) +0:59 'f2' ( temp 2-component vector of float) +0:59 add ( temp 2-component vector of float) +0:59 Construct vec2 ( temp 2-component vector of float) +0:59 'f' ( temp float) +0:59 Convert int to float ( temp float) +0:59 'i' ( temp int) +0:59 Convert int to float ( temp 2-component vector of float) +0:59 'i2' ( temp 2-component vector of int) +0:60 add second child into first child ( temp 3-component vector of float) +0:60 'f3' ( temp 3-component vector of float) +0:60 add ( temp 3-component vector of float) +0:60 Convert int to float ( temp 3-component vector of float) +0:60 'i3' ( temp 3-component vector of int) +0:60 Construct vec3 ( temp 3-component vector of float) +0:60 'f' ( temp float) +0:60 Convert int to float ( temp float) +0:60 'i' ( temp int) +0:60 'f' ( temp float) +0:61 add second child into first child ( temp 4-component vector of float) +0:61 'f4' ( temp 4-component vector of float) +0:61 add ( temp 4-component vector of float) +0:61 Construct vec4 ( temp 4-component vector of float) +0:61 Convert bool to float ( temp float) +0:61 'b' ( temp bool) +0:61 Convert int to float ( temp float) +0:61 'i' ( temp int) +0:61 'f' ( temp float) +0:61 Convert int to float ( temp float) +0:61 'i' ( temp int) +0:61 Convert int to float ( temp 4-component vector of float) +0:61 'i4' ( temp 4-component vector of int) +0:63 add second child into first child ( temp 2-component vector of float) +0:63 'f2' ( temp 2-component vector of float) +0:63 vector-scale ( temp 2-component vector of float) +0:63 Construct vec2 ( temp 2-component vector of float) +0:63 'f' ( temp float) +0:63 Convert int to float ( temp float) +0:63 'i' ( temp int) +0:63 Convert int to float ( temp float) +0:63 'i' ( temp int) +0:64 add second child into first child ( temp 3-component vector of float) +0:64 'f3' ( temp 3-component vector of float) +0:64 add ( temp 3-component vector of float) +0:64 Construct vec3 ( temp 3-component vector of float) +0:64 'f' ( temp float) +0:64 Convert int to float ( temp float) +0:64 'i' ( temp int) +0:64 'f' ( temp float) +0:64 Convert int to float ( temp float) +0:64 'i' ( temp int) +0:65 add second child into first child ( temp 4-component vector of float) +0:65 'f4' ( temp 4-component vector of float) +0:65 subtract ( temp 4-component vector of float) +0:65 Convert int to float ( temp float) +0:65 'i' ( temp int) +0:65 Construct vec4 ( temp 4-component vector of float) +0:65 Convert bool to float ( temp float) +0:65 'b' ( temp bool) +0:65 Convert int to float ( temp float) +0:65 'i' ( temp int) +0:65 'f' ( temp float) +0:65 Convert int to float ( temp float) +0:65 'i' ( temp int) +0:67 add second child into first child ( temp 2-component vector of int) +0:67 'i2' ( temp 2-component vector of int) +0:67 Construct ivec2 ( temp 2-component vector of int) +0:67 Convert float to int ( temp int) +0:67 'f' ( temp float) +0:67 'i' ( temp int) +0:68 add second child into first child ( temp 3-component vector of int) +0:68 'i3' ( temp 3-component vector of int) +0:68 Construct ivec3 ( temp 3-component vector of int) +0:68 Convert float to int ( temp int) +0:68 'f' ( temp float) +0:68 'i' ( temp int) +0:68 Convert float to int ( temp int) +0:68 'f' ( temp float) +0:69 add second child into first child ( temp 4-component vector of int) +0:69 'i4' ( temp 4-component vector of int) +0:69 Construct ivec4 ( temp 4-component vector of int) +0:69 Convert bool to int ( temp int) +0:69 'b' ( temp bool) +0:69 'i' ( temp int) +0:69 Convert float to int ( temp int) +0:69 'f' ( temp float) +0:69 'i' ( temp int) +0:71 Test condition and select ( temp void) +0:71 Condition +0:72 logical-or ( temp bool) +0:71 logical-or ( temp bool) +0:71 logical-or ( temp bool) +0:71 Compare Less Than ( temp bool) +0:71 'f' ( temp float) +0:71 Convert int to float ( temp float) +0:71 'i' ( temp int) +0:71 Compare Less Than ( temp bool) +0:71 Convert int to float ( temp float) +0:71 'i' ( temp int) +0:71 'f' ( temp float) +0:72 Compare Equal ( temp bool) +0:72 'f2' ( temp 2-component vector of float) +0:72 Convert int to float ( temp 2-component vector of float) +0:72 'i2' ( temp 2-component vector of int) +0:73 Compare Not Equal ( temp bool) +0:73 Convert int to float ( temp 3-component vector of float) +0:73 'i3' ( temp 3-component vector of int) +0:73 'f3' ( temp 3-component vector of float) +0:71 true case +0:74 move second child to first child ( temp float) +0:74 'f' ( temp float) +0:74 add ( temp float) +0:74 Test condition and select ( temp float) +0:74 Condition +0:74 'b' ( temp bool) +0:74 true case +0:74 Convert int to float ( temp float) +0:74 'i' ( temp int) +0:74 false case +0:74 direct index ( temp float) +0:74 'f2' ( temp 2-component vector of float) +0:74 Constant: +0:74 0 (const int) +0:74 Test condition and select ( temp float) +0:74 Condition +0:74 direct index ( temp bool) +0:74 'b2' ( temp 2-component vector of bool) +0:74 Constant: +0:74 0 (const int) +0:74 true case +0:74 direct index ( temp float) +0:74 'f3' ( temp 3-component vector of float) +0:74 Constant: +0:74 0 (const int) +0:74 false case +0:74 Convert int to float ( temp float) +0:74 direct index ( temp int) +0:74 'i2' ( temp 2-component vector of int) +0:74 Constant: +0:74 1 (const int) +0:76 move second child to first child ( temp 4-component vector of float) +0:76 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:86 Test condition and select ( temp 4-component vector of float) +0:86 Condition +0:85 logical-or ( temp bool) +0:84 logical-or ( temp bool) +0:83 logical-or ( temp bool) +0:82 logical-or ( temp bool) +0:81 logical-or ( temp bool) +0:80 logical-or ( temp bool) +0:79 logical-or ( temp bool) +0:78 logical-or ( temp bool) +0:77 logical-or ( temp bool) +0:77 'b' ( temp bool) +0:78 direct index ( temp bool) +0:78 'b2' ( temp 2-component vector of bool) +0:78 Constant: +0:78 0 (const int) +0:79 direct index ( temp bool) +0:79 'b2' ( temp 2-component vector of bool) +0:79 Constant: +0:79 1 (const int) +0:80 direct index ( temp bool) +0:80 'b3' ( temp 3-component vector of bool) +0:80 Constant: +0:80 0 (const int) +0:81 direct index ( temp bool) +0:81 'b3' ( temp 3-component vector of bool) +0:81 Constant: +0:81 1 (const int) +0:82 direct index ( temp bool) +0:82 'b3' ( temp 3-component vector of bool) +0:82 Constant: +0:82 2 (const int) +0:83 direct index ( temp bool) +0:83 'b4' ( temp 4-component vector of bool) +0:83 Constant: +0:83 0 (const int) +0:84 direct index ( temp bool) +0:84 'b4' ( temp 4-component vector of bool) +0:84 Constant: +0:84 1 (const int) +0:85 direct index ( temp bool) +0:85 'b4' ( temp 4-component vector of bool) +0:85 Constant: +0:85 2 (const int) +0:86 direct index ( temp bool) +0:86 'b4' ( temp 4-component vector of bool) +0:86 Constant: +0:86 3 (const int) +0:86 true case +0:105 Construct vec4 ( temp 4-component vector of float) +0:105 add ( temp float) +0:104 add ( temp float) +0:103 add ( temp float) +0:102 add ( temp float) +0:101 add ( temp float) +0:100 add ( temp float) +0:99 add ( temp float) +0:98 add ( temp float) +0:97 add ( temp float) +0:96 add ( temp float) +0:95 Convert int to float ( temp float) +0:95 add ( temp int) +0:94 add ( temp int) +0:93 add ( temp int) +0:92 add ( temp int) +0:91 add ( temp int) +0:90 add ( temp int) +0:89 add ( temp int) +0:88 add ( temp int) +0:87 add ( temp int) +0:87 'i' ( temp int) +0:88 direct index ( temp int) +0:88 'i2' ( temp 2-component vector of int) +0:88 Constant: +0:88 0 (const int) +0:89 direct index ( temp int) +0:89 'i2' ( temp 2-component vector of int) +0:89 Constant: +0:89 1 (const int) +0:90 direct index ( temp int) +0:90 'i3' ( temp 3-component vector of int) +0:90 Constant: +0:90 0 (const int) +0:91 direct index ( temp int) +0:91 'i3' ( temp 3-component vector of int) +0:91 Constant: +0:91 1 (const int) +0:92 direct index ( temp int) +0:92 'i3' ( temp 3-component vector of int) +0:92 Constant: +0:92 2 (const int) +0:93 direct index ( temp int) +0:93 'i4' ( temp 4-component vector of int) +0:93 Constant: +0:93 0 (const int) +0:94 direct index ( temp int) +0:94 'i4' ( temp 4-component vector of int) +0:94 Constant: +0:94 1 (const int) +0:95 direct index ( temp int) +0:95 'i4' ( temp 4-component vector of int) +0:95 Constant: +0:95 2 (const int) +0:96 direct index ( temp int) +0:96 'i4' ( temp 4-component vector of int) +0:96 Constant: +0:96 3 (const int) +0:97 'f' ( temp float) +0:98 direct index ( temp float) +0:98 'f2' ( temp 2-component vector of float) +0:98 Constant: +0:98 0 (const int) +0:99 direct index ( temp float) +0:99 'f2' ( temp 2-component vector of float) +0:99 Constant: +0:99 1 (const int) +0:100 direct index ( temp float) +0:100 'f3' ( temp 3-component vector of float) +0:100 Constant: +0:100 0 (const int) +0:101 direct index ( temp float) +0:101 'f3' ( temp 3-component vector of float) +0:101 Constant: +0:101 1 (const int) +0:102 direct index ( temp float) +0:102 'f3' ( temp 3-component vector of float) +0:102 Constant: +0:102 2 (const int) +0:103 direct index ( temp float) +0:103 'f4' ( temp 4-component vector of float) +0:103 Constant: +0:103 0 (const int) +0:104 direct index ( temp float) +0:104 'f4' ( temp 4-component vector of float) +0:104 Constant: +0:104 1 (const int) +0:105 direct index ( temp float) +0:105 'f4' ( temp 4-component vector of float) +0:105 Constant: +0:105 2 (const int) +0:106 direct index ( temp float) +0:106 'f4' ( temp 4-component vector of float) +0:106 Constant: +0:106 3 (const int) +0:86 false case +0:106 Constant: +0:106 1.000000 +0:106 1.000000 +0:106 1.000000 +0:106 1.000000 +0:109 Sequence +0:109 move second child to first child ( temp 4-component vector of int) +0:109 'cv2' ( temp 4-component vector of int) +0:109 Constant: +0:109 1 (const int) +0:109 1 (const int) +0:109 1 (const int) +0:109 1 (const int) +0:110 Sequence +0:110 move second child to first child ( temp 4-component vector of bool) +0:110 'cv5' ( temp 4-component vector of bool) +0:110 Convert int to bool ( temp 4-component vector of bool) +0:110 'cv2' ( temp 4-component vector of int) +0:111 add second child into first child ( temp 4-component vector of float) +0:111 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:111 Construct float ( temp float) +0:111 Convert bool to float ( temp 4-component vector of float) +0:111 'cv5' ( temp 4-component vector of bool) +0:? Linker Objects +0:? 'u_b' ( uniform bool) +0:? 'u_b2' ( uniform 2-component vector of bool) +0:? 'u_b3' ( uniform 3-component vector of bool) +0:? 'u_b4' ( uniform 4-component vector of bool) +0:? 'u_i' ( uniform int) +0:? 'u_i2' ( uniform 2-component vector of int) +0:? 'u_i3' ( uniform 3-component vector of int) +0:? 'u_i4' ( uniform 4-component vector of int) +0:? 'u_f' ( uniform float) +0:? 'u_f2' ( uniform 2-component vector of float) +0:? 'u_f3' ( uniform 3-component vector of float) +0:? 'u_f4' ( uniform 4-component vector of float) +0:? 'i_b' ( uniform bool) +0:? 'i_b2' ( uniform 2-component vector of bool) +0:? 'i_b3' ( uniform 3-component vector of bool) +0:? 'i_b4' ( uniform 4-component vector of bool) +0:? 'i_i' ( flat in int) +0:? 'i_i2' ( flat in 2-component vector of int) +0:? 'i_i3' ( flat in 3-component vector of int) +0:? 'i_i4' ( flat in 4-component vector of int) +0:? 'i_f' ( smooth in float) +0:? 'i_f2' ( smooth in 2-component vector of float) +0:? 'i_f3' ( smooth in 3-component vector of float) +0:? 'i_f4' ( smooth in 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/cppBad.vert.out b/deps/glslang/Test/baseResults/cppBad.vert.out new file mode 100644 index 00000000..a5267ff6 --- /dev/null +++ b/deps/glslang/Test/baseResults/cppBad.vert.out @@ -0,0 +1,24 @@ +cppBad.vert +ERROR: 0:2: 'preprocessor evaluation' : bad expression +ERROR: 0:2: '#if' : unexpected tokens following directive +ERROR: 0:5: 'string' : End of line in string +ERROR: 0:5: '""' : string literals not supported +ERROR: 0:5: '' : syntax error, unexpected INT, expecting COMMA or SEMICOLON +ERROR: 5 compilation errors. No code generated. + + +Shader version: 100 +ERROR: node is still EOpNull! +0:? Linker Objects +0:? 'n' ( global highp int) + + +Linked vertex stage: + +ERROR: Linking vertex stage: Missing entry point: Each stage requires one entry point + +Shader version: 100 +ERROR: node is still EOpNull! +0:? Linker Objects +0:? 'n' ( global highp int) + diff --git a/deps/glslang/Test/baseResults/cppBad2.vert.out b/deps/glslang/Test/baseResults/cppBad2.vert.out new file mode 100644 index 00000000..af9ff386 --- /dev/null +++ b/deps/glslang/Test/baseResults/cppBad2.vert.out @@ -0,0 +1,18 @@ +cppBad2.vert +ERROR: 0:3: 'macro expansion' : End of input in macro b +ERROR: 1 compilation errors. No code generated. + + +Shader version: 100 +ERROR: node is still EOpNull! +0:? Linker Objects + + +Linked vertex stage: + +ERROR: Linking vertex stage: Missing entry point: Each stage requires one entry point + +Shader version: 100 +ERROR: node is still EOpNull! +0:? Linker Objects + diff --git a/deps/glslang/Test/baseResults/cppComplexExpr.vert.out b/deps/glslang/Test/baseResults/cppComplexExpr.vert.out new file mode 100644 index 00000000..6bfcd9cc --- /dev/null +++ b/deps/glslang/Test/baseResults/cppComplexExpr.vert.out @@ -0,0 +1,181 @@ +cppComplexExpr.vert +ERROR: 0:46: 'xyxwx' : vector swizzle too long +ERROR: 0:46: 'xyxwx' : vector swizzle too long +ERROR: 0:46: 'return' : cannot convert return value to function return type +WARNING: 0:46: 'return' : type conversion on return values was not explicitly allowed until version 420 +ERROR: 0:66: '#define' : Macro redefined; different substitutions: BIG +ERROR: 0:81: 'preprocessor evaluation' : bad expression +ERROR: 0:81: '#if' : unexpected tokens following directive +ERROR: 0:82: '#error' : good macro +ERROR: 0:87: 'macro expansion' : End of line in macro substitution: foobar +ERROR: 0:88: 'preprocessor evaluation' : can't evaluate expression +ERROR: 0:88: 'preprocessor evaluation' : bad expression +ERROR: 0:88: '#if' : unexpected tokens following directive +ERROR: 0:92: 'macro expansion' : End of line in macro substitution: foobar +ERROR: 0:93: 'preprocessor evaluation' : can't evaluate expression +ERROR: 0:93: 'preprocessor evaluation' : bad expression +ERROR: 0:93: '#if' : unexpected tokens following directive +ERROR: 0:99: 'macro expansion' : End of line in macro substitution: foobar +ERROR: 0:100: 'preprocessor evaluation' : can't evaluate expression +ERROR: 0:100: 'preprocessor evaluation' : bad expression +ERROR: 0:100: '#if' : unexpected tokens following directive +ERROR: 0:101: 'macro expansion' : End of line in macro substitution: foobar +ERROR: 0:102: 'preprocessor evaluation' : can't evaluate expression +ERROR: 0:102: 'preprocessor evaluation' : bad expression +ERROR: 0:102: '#if' : unexpected tokens following directive +ERROR: 0:108: 'preprocessor evaluation' : undefined macro in expression not allowed in es profile UNDEF +ERROR: 0:111: '#error' : good 0 +ERROR: 0:115: '#error' : good 1 +ERROR: 0:120: 'preprocessor evaluation' : undefined macro in expression not allowed in es profile UNDEF +ERROR: 0:123: 'preprocessor evaluation' : undefined macro in expression not allowed in es profile UNDEF +ERROR: 0:129: '#error' : good 1 +ERROR: 0:133: '#error' : good 3 +ERROR: 0:139: '#error' : good 4 +ERROR: 0:144: 'preprocessor evaluation' : undefined macro in expression not allowed in es profile UNDEF +ERROR: 0:153: 'preprocessor evaluation' : undefined macro in expression not allowed in es profile UNDEF +ERROR: 0:156: 'preprocessor evaluation' : undefined macro in expression not allowed in es profile UNDEF2 +ERROR: 0:159: 'preprocessor evaluation' : undefined macro in expression not allowed in es profile UNDEF2 +ERROR: 0:3000: '#error' : line of this error should be 3000 +ERROR: 0:3002: '#define' : predefined names can't be (un)defined: __LINE__ +ERROR: 0:3003: '#define' : predefined names can't be (un)defined: __FILE__ +ERROR: 0:3004: '#define' : predefined names can't be (un)defined: __VERSION__ +ERROR: 0:3005: '#define' : names beginning with "GL_" can't be (un)defined: GL_SOME_EXTENSION +ERROR: 0:3006: '#undef' : predefined names can't be (un)defined: __LINE__ +ERROR: 0:3007: '#undef' : predefined names can't be (un)defined: __FILE__ +ERROR: 0:3008: '#undef' : predefined names can't be (un)defined: __VERSION__ +ERROR: 0:3009: '#undef' : names beginning with "GL_" can't be (un)defined: GL_SOME_EXTENSION +ERROR: 0:4000: 'preprocessor evaluation' : division by 0 +ERROR: 0:0: 'preprocessor evaluation' : division by 0 +ERROR: 0:3: 'preprocessor evaluation' : bad expression +ERROR: 0:3: 'preprocessor evaluation' : division by 0 +ERROR: 0:10001: '' : missing #endif +ERROR: 49 compilation errors. No code generated. + + +Shader version: 300 +ERROR: node is still EOpNull! +0:4 Sequence +0:4 move second child to first child ( temp highp float) +0:4 'sum' ( global highp float) +0:4 Constant: +0:4 0.000000 +0:6 Function Definition: main( ( global void) +0:6 Function Parameters: +0:10 Sequence +0:10 add second child into first child ( temp highp float) +0:10 'sum' ( global highp float) +0:10 Constant: +0:10 1.000000 +0:15 add second child into first child ( temp highp float) +0:15 'sum' ( global highp float) +0:15 Constant: +0:15 20.000000 +0:30 add second child into first child ( temp highp float) +0:30 'sum' ( global highp float) +0:30 Constant: +0:30 300.000000 +0:39 move second child to first child ( temp highp 4-component vector of float) +0:39 'gl_Position' ( gl_Position highp 4-component vector of float Position) +0:39 Construct vec4 ( temp highp 4-component vector of float) +0:39 'sum' ( global highp float) +0:44 Function Definition: foo( ( global highp float) +0:44 Function Parameters: +0:46 Sequence +0:46 Branch: Return with expression +0:46 add ( temp highp 4-component vector of float) +0:46 add ( temp highp 4-component vector of float) +0:46 vector swizzle ( temp highp 4-component vector of float) +0:46 'gl_Position' ( gl_Position highp 4-component vector of float Position) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 3 (const int) +0:46 Constant: +0:46 3.000000 +0:46 add ( temp highp 4-component vector of float) +0:46 vector swizzle ( temp highp 4-component vector of float) +0:46 'gl_Position' ( gl_Position highp 4-component vector of float Position) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 3 (const int) +0:46 Constant: +0:46 3.000000 +0:47 Branch: Return with expression +0:47 add ( temp highp float) +0:47 add ( temp highp float) +0:47 direct index ( temp highp float) +0:47 'gl_Position' ( gl_Position highp 4-component vector of float Position) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 3.000000 +0:47 add ( temp highp float) +0:47 direct index ( temp highp float) +0:47 'gl_Position' ( gl_Position highp 4-component vector of float Position) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 3.000000 +0:97 Sequence +0:97 move second child to first child ( temp highp float) +0:97 'c' ( global highp float) +0:98 Constant: +0:98 3.300000 +0:? Linker Objects +0:? 'sum' ( global highp float) +0:? 'c' ( global highp float) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + + +Linked vertex stage: + + +Shader version: 300 +ERROR: node is still EOpNull! +0:4 Sequence +0:4 move second child to first child ( temp highp float) +0:4 'sum' ( global highp float) +0:4 Constant: +0:4 0.000000 +0:6 Function Definition: main( ( global void) +0:6 Function Parameters: +0:10 Sequence +0:10 add second child into first child ( temp highp float) +0:10 'sum' ( global highp float) +0:10 Constant: +0:10 1.000000 +0:15 add second child into first child ( temp highp float) +0:15 'sum' ( global highp float) +0:15 Constant: +0:15 20.000000 +0:30 add second child into first child ( temp highp float) +0:30 'sum' ( global highp float) +0:30 Constant: +0:30 300.000000 +0:39 move second child to first child ( temp highp 4-component vector of float) +0:39 'gl_Position' ( gl_Position highp 4-component vector of float Position) +0:39 Construct vec4 ( temp highp 4-component vector of float) +0:39 'sum' ( global highp float) +0:97 Sequence +0:97 move second child to first child ( temp highp float) +0:97 'c' ( global highp float) +0:98 Constant: +0:98 3.300000 +0:? Linker Objects +0:? 'sum' ( global highp float) +0:? 'c' ( global highp float) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + diff --git a/deps/glslang/Test/baseResults/cppDeepNest.frag.out b/deps/glslang/Test/baseResults/cppDeepNest.frag.out new file mode 100644 index 00000000..969a256d --- /dev/null +++ b/deps/glslang/Test/baseResults/cppDeepNest.frag.out @@ -0,0 +1,20 @@ +cppDeepNest.frag +ERROR: 0:66: '#if/#ifdef/#ifndef' : maximum nesting depth exceeded +ERROR: 0:66: '' : missing #endif +ERROR: 0:66: '' : syntax error, unexpected $end +ERROR: 3 compilation errors. No code generated. + + +Shader version: 100 +ERROR: node is still EOpNull! +0:? Linker Objects + + +Linked fragment stage: + +ERROR: Linking fragment stage: Missing entry point: Each stage requires one entry point + +Shader version: 100 +ERROR: node is still EOpNull! +0:? Linker Objects + diff --git a/deps/glslang/Test/baseResults/cppIndent.vert.out b/deps/glslang/Test/baseResults/cppIndent.vert.out new file mode 100644 index 00000000..05eb244d --- /dev/null +++ b/deps/glslang/Test/baseResults/cppIndent.vert.out @@ -0,0 +1,84 @@ +cppIndent.vert +ERROR: 0:61: 'macro expansion' : Too few args in Macro FUNC +ERROR: 0:61: '' : syntax error, unexpected COMMA +ERROR: 2 compilation errors. No code generated. + + +Shader version: 110 +ERROR: node is still EOpNull! +0:5 Sequence +0:5 move second child to first child ( temp float) +0:5 'sum' ( global float) +0:5 Constant: +0:5 0.000000 +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:12 Sequence +0:12 add second child into first child ( temp float) +0:12 'sum' ( global float) +0:12 Constant: +0:12 1.000000 +0:22 add second child into first child ( temp float) +0:22 'sum' ( global float) +0:22 Constant: +0:22 300.000000 +0:37 add second child into first child ( temp float) +0:37 'sum' ( global float) +0:37 Constant: +0:37 600000.000000 +0:47 add second child into first child ( temp float) +0:47 'sum' ( global float) +0:47 Constant: +0:47 80000000.000000 +0:52 add second child into first child ( temp float) +0:52 'sum' ( global float) +0:52 Constant: +0:52 900000000.000000 +0:56 move second child to first child ( temp 4-component vector of float) +0:56 'gl_Position' ( gl_Position 4-component vector of float Position) +0:56 Construct vec4 ( temp 4-component vector of float) +0:56 'sum' ( global float) +0:? Linker Objects +0:? 'sum' ( global float) + + +Linked vertex stage: + + +Shader version: 110 +ERROR: node is still EOpNull! +0:5 Sequence +0:5 move second child to first child ( temp float) +0:5 'sum' ( global float) +0:5 Constant: +0:5 0.000000 +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:12 Sequence +0:12 add second child into first child ( temp float) +0:12 'sum' ( global float) +0:12 Constant: +0:12 1.000000 +0:22 add second child into first child ( temp float) +0:22 'sum' ( global float) +0:22 Constant: +0:22 300.000000 +0:37 add second child into first child ( temp float) +0:37 'sum' ( global float) +0:37 Constant: +0:37 600000.000000 +0:47 add second child into first child ( temp float) +0:47 'sum' ( global float) +0:47 Constant: +0:47 80000000.000000 +0:52 add second child into first child ( temp float) +0:52 'sum' ( global float) +0:52 Constant: +0:52 900000000.000000 +0:56 move second child to first child ( temp 4-component vector of float) +0:56 'gl_Position' ( gl_Position 4-component vector of float Position) +0:56 Construct vec4 ( temp 4-component vector of float) +0:56 'sum' ( global float) +0:? Linker Objects +0:? 'sum' ( global float) + diff --git a/deps/glslang/Test/baseResults/cppIntMinOverNegativeOne.frag.out b/deps/glslang/Test/baseResults/cppIntMinOverNegativeOne.frag.out new file mode 100644 index 00000000..5dce7c3e --- /dev/null +++ b/deps/glslang/Test/baseResults/cppIntMinOverNegativeOne.frag.out @@ -0,0 +1,14 @@ +cppIntMinOverNegativeOne.frag +Shader version: 100 +0:? Sequence +0:? Linker Objects + + +Linked fragment stage: + +ERROR: Linking fragment stage: Missing entry point: Each stage requires one entry point + +Shader version: 100 +0:? Sequence +0:? Linker Objects + diff --git a/deps/glslang/Test/baseResults/cppNest.vert.out b/deps/glslang/Test/baseResults/cppNest.vert.out new file mode 100644 index 00000000..afd0370d --- /dev/null +++ b/deps/glslang/Test/baseResults/cppNest.vert.out @@ -0,0 +1,143 @@ +cppNest.vert +ERROR: 0:144: '#elif' : #elif after #else +ERROR: 0:152: '#else' : #else after #else +ERROR: 0:161: '#elif' : #elif after #else +ERROR: 0:169: '#else' : #else after #else +ERROR: 0:177: 'macro expansion' : End of input in macro FUNC +ERROR: 0:178: '' : compilation terminated +ERROR: 6 compilation errors. No code generated. + + +Shader version: 110 +ERROR: node is still EOpNull! +0:5 Sequence +0:5 move second child to first child ( temp float) +0:5 'sum' ( global float) +0:5 Constant: +0:5 0.000000 +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:12 Sequence +0:12 add second child into first child ( temp float) +0:12 'sum' ( global float) +0:12 Constant: +0:12 1.000000 +0:21 add second child into first child ( temp float) +0:21 'sum' ( global float) +0:21 Constant: +0:21 300.000000 +0:61 add second child into first child ( temp float) +0:61 'sum' ( global float) +0:61 Constant: +0:61 600000.000000 +0:65 add second child into first child ( temp float) +0:65 'sum' ( global float) +0:65 Constant: +0:65 80000000.000000 +0:69 add second child into first child ( temp float) +0:69 'sum' ( global float) +0:69 Constant: +0:69 900000000.000000 +0:76 add second child into first child ( temp float) +0:76 'sum' ( global float) +0:76 Constant: +0:76 7000000.000000 +0:86 move second child to first child ( temp 4-component vector of float) +0:86 'gl_Position' ( gl_Position 4-component vector of float Position) +0:86 Construct vec4 ( temp 4-component vector of float) +0:86 'sum' ( global float) +0:103 Sequence +0:103 move second child to first child ( temp int) +0:103 'selected4' ( global int) +0:103 Constant: +0:103 4 (const int) +0:115 Sequence +0:115 move second child to first child ( temp int) +0:115 'selected2' ( global int) +0:115 Constant: +0:115 2 (const int) +0:133 Sequence +0:133 move second child to first child ( temp int) +0:133 'selected3' ( global int) +0:133 Constant: +0:133 3 (const int) +0:175 Function Definition: foo985( ( global void) +0:175 Function Parameters: +0:175 Sequence +0:175 add ( temp int) +0:175 Constant: +0:175 2 (const int) +0:175 Comma ( temp int) +0:175 Constant: +0:175 3 (const int) +0:175 Constant: +0:175 4 (const int) +0:? Linker Objects +0:? 'sum' ( global float) +0:? 'selected4' ( global int) +0:? 'selected2' ( global int) +0:? 'selected3' ( global int) + + +Linked vertex stage: + + +Shader version: 110 +ERROR: node is still EOpNull! +0:5 Sequence +0:5 move second child to first child ( temp float) +0:5 'sum' ( global float) +0:5 Constant: +0:5 0.000000 +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:12 Sequence +0:12 add second child into first child ( temp float) +0:12 'sum' ( global float) +0:12 Constant: +0:12 1.000000 +0:21 add second child into first child ( temp float) +0:21 'sum' ( global float) +0:21 Constant: +0:21 300.000000 +0:61 add second child into first child ( temp float) +0:61 'sum' ( global float) +0:61 Constant: +0:61 600000.000000 +0:65 add second child into first child ( temp float) +0:65 'sum' ( global float) +0:65 Constant: +0:65 80000000.000000 +0:69 add second child into first child ( temp float) +0:69 'sum' ( global float) +0:69 Constant: +0:69 900000000.000000 +0:76 add second child into first child ( temp float) +0:76 'sum' ( global float) +0:76 Constant: +0:76 7000000.000000 +0:86 move second child to first child ( temp 4-component vector of float) +0:86 'gl_Position' ( gl_Position 4-component vector of float Position) +0:86 Construct vec4 ( temp 4-component vector of float) +0:86 'sum' ( global float) +0:103 Sequence +0:103 move second child to first child ( temp int) +0:103 'selected4' ( global int) +0:103 Constant: +0:103 4 (const int) +0:115 Sequence +0:115 move second child to first child ( temp int) +0:115 'selected2' ( global int) +0:115 Constant: +0:115 2 (const int) +0:133 Sequence +0:133 move second child to first child ( temp int) +0:133 'selected3' ( global int) +0:133 Constant: +0:133 3 (const int) +0:? Linker Objects +0:? 'sum' ( global float) +0:? 'selected4' ( global int) +0:? 'selected2' ( global int) +0:? 'selected3' ( global int) + diff --git a/deps/glslang/Test/baseResults/cppPassMacroName.frag.out b/deps/glslang/Test/baseResults/cppPassMacroName.frag.out new file mode 100644 index 00000000..e09b00d7 --- /dev/null +++ b/deps/glslang/Test/baseResults/cppPassMacroName.frag.out @@ -0,0 +1,77 @@ +cppPassMacroName.frag +Shader version: 100 +0:? Sequence +0:9 Function Definition: main( ( global void) +0:9 Function Parameters: +0:11 Sequence +0:11 Sequence +0:11 move second child to first child ( temp mediump int) +0:11 'f1' ( temp mediump int) +0:11 Constant: +0:11 4 (const int) +0:12 Sequence +0:12 move second child to first child ( temp mediump int) +0:12 'f2' ( temp mediump int) +0:12 'f1' ( temp mediump int) +0:13 Sequence +0:13 move second child to first child ( temp mediump int) +0:13 'f3' ( temp mediump int) +0:13 Constant: +0:13 9 (const int) +0:14 Sequence +0:14 move second child to first child ( temp mediump int) +0:14 'f4' ( temp mediump int) +0:14 Constant: +0:14 1 (const int) +0:15 Sequence +0:15 move second child to first child ( temp mediump int) +0:15 'f5' ( temp mediump int) +0:15 Constant: +0:15 5 (const int) +0:17 Sequence +0:17 move second child to first child ( temp highp float) +0:17 'fl_f5' ( temp highp float) +0:17 Constant: +0:17 0.460000 +0:? Linker Objects + + +Linked fragment stage: + + +Shader version: 100 +0:? Sequence +0:9 Function Definition: main( ( global void) +0:9 Function Parameters: +0:11 Sequence +0:11 Sequence +0:11 move second child to first child ( temp mediump int) +0:11 'f1' ( temp mediump int) +0:11 Constant: +0:11 4 (const int) +0:12 Sequence +0:12 move second child to first child ( temp mediump int) +0:12 'f2' ( temp mediump int) +0:12 'f1' ( temp mediump int) +0:13 Sequence +0:13 move second child to first child ( temp mediump int) +0:13 'f3' ( temp mediump int) +0:13 Constant: +0:13 9 (const int) +0:14 Sequence +0:14 move second child to first child ( temp mediump int) +0:14 'f4' ( temp mediump int) +0:14 Constant: +0:14 1 (const int) +0:15 Sequence +0:15 move second child to first child ( temp mediump int) +0:15 'f5' ( temp mediump int) +0:15 Constant: +0:15 5 (const int) +0:17 Sequence +0:17 move second child to first child ( temp highp float) +0:17 'fl_f5' ( temp highp float) +0:17 Constant: +0:17 0.460000 +0:? Linker Objects + diff --git a/deps/glslang/Test/baseResults/cppRelaxSkipTokensErrors.vert.out b/deps/glslang/Test/baseResults/cppRelaxSkipTokensErrors.vert.out new file mode 100644 index 00000000..e9b4b1b7 --- /dev/null +++ b/deps/glslang/Test/baseResults/cppRelaxSkipTokensErrors.vert.out @@ -0,0 +1,14 @@ +cppRelaxSkipTokensErrors.vert +Shader version: 110 +0:? Sequence +0:? Linker Objects + + +Linked vertex stage: + +ERROR: Linking vertex stage: Missing entry point: Each stage requires one entry point + +Shader version: 110 +0:? Sequence +0:? Linker Objects + diff --git a/deps/glslang/Test/baseResults/cppSimple.vert.out b/deps/glslang/Test/baseResults/cppSimple.vert.out new file mode 100644 index 00000000..85beb4eb --- /dev/null +++ b/deps/glslang/Test/baseResults/cppSimple.vert.out @@ -0,0 +1,303 @@ +cppSimple.vert +ERROR: 0:77: '#error' : good1 +ERROR: 0:81: '#error' : good2 +ERROR: 0:85: '#error' : good3 +ERROR: 0:89: '#error' : good4 +ERROR: 0:93: '#error' : good5 +ERROR: 0:97: '#error' : good6 +ERROR: 0:100: 'preprocessor evaluation' : expected ')' +ERROR: 0:101: '#error' : bad1 +ERROR: 0:104: '#if' : unexpected tokens following directive +ERROR: 0:105: '#error' : bad2 +ERROR: 0:108: 'preprocessor evaluation' : expected ')' +ERROR: 0:109: '#error' : bad3 +ERROR: 0:112: '#if' : unexpected tokens following directive +ERROR: 0:113: '#error' : bad4 +ERROR: 0:116: 'preprocessor evaluation' : expected ')' +ERROR: 0:117: '#error' : bad5 +ERROR: 0:120: '#if' : unexpected tokens following directive +ERROR: 0:121: '#error' : bad6 +ERROR: 0:122: '#endif' : unexpected tokens following directive +ERROR: 0:135: '""' : string literals not supported +ERROR: 0:136: '""' : string literals not supported +ERROR: 0:136: 'length' : no matching overloaded function found +ERROR: 0:136: '=' : cannot convert from ' const float' to ' global int' +ERROR: 0:138: ''' : character literals not supported +ERROR: 0:138: ''' : character literals not supported +ERROR: 0:141: '#define' : names beginning with "GL_" can't be (un)defined: GL_ +ERROR: 0:142: '#define' : names beginning with "GL_" can't be (un)defined: GL_Macro +WARNING: 0:143: '#define' : names containing consecutive underscores are reserved: __M +WARNING: 0:144: '#define' : names containing consecutive underscores are reserved: M__ +WARNING: 0:145: '#define' : names containing consecutive underscores are reserved: ABC__DE +ERROR: 0:148: '#else' : unexpected tokens following directive +ERROR: 0:149: '#elif' : #elif after #else +ERROR: 0:155: '#else' : unexpected tokens following directive +ERROR: 0:158: '#else' : #else after #else +ERROR: 0:160: '#endif' : unexpected tokens following directive +ERROR: 0:164: '#define' : duplicate macro parameter +ERROR: 0:173: '#define' : Macro redefined; function-like versus object-like: m4 +ERROR: 0:177: '#define' : Macro redefined; function-like versus object-like: m5 +ERROR: 0:181: '#define' : Macro redefined; different number of arguments: m6 +ERROR: 0:185: '#define' : Macro redefined; different substitutions: m7 +ERROR: 0:192: '#define' : Macro redefined; different substitutions: m8 +ERROR: 0:196: '#define' : Macro redefined; different argument names: m9 +WARNING: 0:204: '#undef' : names containing consecutive underscores are reserved: __VERSION__ +ERROR: 0:205: '#undef' : names beginning with "GL_" can't be (un)defined: GL_ARB_texture_rectangle +ERROR: 0:210: '#' : invalid directive +ERROR: 0:211: '#' : invalid directive +ERROR: 0:212: '#' : invalid directive +ERROR: 0:213: '#' : invalid directive +ERROR: 0:214: '#' : invalid directive +ERROR: 0:215: '#' : invalid directive +ERROR: 0:224: '#pragma' : optimize pragma syntax is incorrect +ERROR: 0:225: '#pragma' : optimize pragma syntax is incorrect +ERROR: 0:226: '#pragma' : debug pragma syntax is incorrect +ERROR: 0:227: '#pragma' : debug pragma syntax is incorrect +ERROR: 0:229: '#pragma' : optimize pragma syntax is incorrect +ERROR: 0:230: '#pragma' : debug pragma syntax is incorrect +ERROR: 0:233: 'line continuation' : not supported for this version or the enabled extensions +ERROR: 0:235: 'line continuation' : not supported for this version or the enabled extensions +ERROR: 0:236: '#error' : good continuation +ERROR: 0:238: '#' : invalid directive: flizbit +ERROR: 0:242: '#' : invalid directive: directive +ERROR: 0:12000: '#error' : line should be 12000 +ERROR: 7:13000: '#error' : line should be 13000 , string 7 +ERROR: 7:14013: '#error' : line should be 14013 , string 7 +ERROR: 12:14013: '#error' : line should be 14013 , string 12 +ERROR: 12:14025: '#error' : line should be 14025 , string 12 +ERROR: 12:1233: '#line' : unexpected tokens following directive +ERROR: 12:1236: '#line' : unexpected tokens following directive +ERROR: 12:20000: '#error' : line should be 20000 +ERROR: 12:20010: '#error' : line should be 20010 +ERROR: 12:20020: '#error' : line should be 20020 +ERROR: 12:20045: '#define' : Macro redefined; different substitutions: SPACE_IN_MIDDLE +ERROR: 12:20051: '#error' : good evaluation 1 +ERROR: 12:20055: '#error' : good evaluation 2 +ERROR: 12:9000: 'preprocessor evaluation' : expected ')' +ERROR: 12:9002: '#if' : unexpected tokens following directive +ERROR: 12:9014: 'FOOOM' : undeclared identifier +ERROR: 12:9014: '=' : cannot convert from ' temp float' to ' global int' +ERROR: 12:9015: 'preprocessor evaluation' : can't evaluate expression +ERROR: 12:9016: 'preprocessor evaluation' : bad expression +ERROR: 12:9500: 'preprocessor evaluation' : bad expression +ERROR: 12:9500: '#if' : unexpected tokens following directive +ERROR: 12:9502: 'preprocessor evaluation' : bad expression +ERROR: 12:9502: '#if' : unexpected tokens following directive +ERROR: 12:9504: 'preprocessor evaluation' : bad expression +ERROR: 12:9504: '#if' : unexpected tokens following directive +ERROR: 12:9506: '#error' : \ 377 +ERROR: 12:9507: '#error' : \ 376 +ERROR: 12:9508: '#error' : \ 377 +ERROR: 12:9602: 'defined' : cannot use in preprocessor expression when expanded from macros +ERROR: 12:9603: '#error' : DEF_DEFINED then +ERROR: 12:10002: '' : missing #endif +ERROR: 88 compilation errors. No code generated. + + +Shader version: 400 +ERROR: node is still EOpNull! +0:5 Sequence +0:5 move second child to first child ( temp float) +0:5 'sum' ( global float) +0:5 Constant: +0:5 0.000000 +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:12 Sequence +0:12 add second child into first child ( temp float) +0:12 'sum' ( global float) +0:12 Constant: +0:12 1.000000 +0:22 add second child into first child ( temp float) +0:22 'sum' ( global float) +0:22 Constant: +0:22 300.000000 +0:37 add second child into first child ( temp float) +0:37 'sum' ( global float) +0:37 Constant: +0:37 600000.000000 +0:48 add second child into first child ( temp float) +0:48 'sum' ( global float) +0:48 Constant: +0:48 7000000.000000 +0:53 add second child into first child ( temp float) +0:53 'sum' ( global float) +0:53 Constant: +0:53 80000000.000000 +0:58 add second child into first child ( temp float) +0:58 'sum' ( global float) +0:58 Constant: +0:58 900000000.000000 +0:65 add second child into first child ( temp float) +0:65 'sum' ( global float) +0:65 Constant: +0:65 0.050000 +0:69 move second child to first child ( temp 4-component vector of float) +0:69 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:69 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:69 Constant: +0:69 0 (const uint) +0:69 Construct vec4 ( temp 4-component vector of float) +0:69 'sum' ( global float) +0:124 Sequence +0:124 move second child to first child ( temp int) +0:124 'linenumber' ( global int) +0:124 Constant: +0:124 124 (const int) +0:125 Sequence +0:125 move second child to first child ( temp int) +0:125 'filenumber' ( global int) +0:125 Constant: +0:125 0 (const int) +0:126 Sequence +0:126 move second child to first child ( temp int) +0:126 'version' ( global int) +0:126 Constant: +0:126 400 (const int) +0:130 Sequence +0:130 move second child to first child ( temp float) +0:130 'twoPi' ( global float) +0:130 Constant: +0:130 6.280000 +0:199 Sequence +0:199 move second child to first child ( temp int) +0:199 'n' ( global int) +0:199 Constant: +0:199 15 (const int) +0:202 Sequence +0:202 move second child to first child ( temp double) +0:202 'f' ( global double) +0:202 Constant: +0:202 0.000800 +12:20031 Function Definition: foo234( ( global void) +12:20031 Function Parameters: +12:20033 Sequence +12:20033 move second child to first child ( temp 4-component vector of float) +12:20033 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +12:20033 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +12:20033 Constant: +12:20033 0 (const uint) +12:20033 Constant: +12:20033 6.000000 +12:20033 6.000000 +12:20033 6.000000 +12:20033 6.000000 +12:9011 Sequence +12:9011 move second child to first child ( temp int) +12:9011 'R1' ( global int) +12:9011 'RECURSE' ( global int) +0:? Linker Objects +0:? 'sum' ( global float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'linenumber' ( global int) +0:? 'filenumber' ( global int) +0:? 'version' ( global int) +0:? 'twoPi' ( global float) +0:? 'a' ( global int) +0:? 'n' ( global int) +0:? 'f' ( global double) +0:? 'RECURSE' ( global int) +0:? 'R1' ( global int) +0:? 'aoeua' ( global int) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 400 +ERROR: node is still EOpNull! +0:5 Sequence +0:5 move second child to first child ( temp float) +0:5 'sum' ( global float) +0:5 Constant: +0:5 0.000000 +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:12 Sequence +0:12 add second child into first child ( temp float) +0:12 'sum' ( global float) +0:12 Constant: +0:12 1.000000 +0:22 add second child into first child ( temp float) +0:22 'sum' ( global float) +0:22 Constant: +0:22 300.000000 +0:37 add second child into first child ( temp float) +0:37 'sum' ( global float) +0:37 Constant: +0:37 600000.000000 +0:48 add second child into first child ( temp float) +0:48 'sum' ( global float) +0:48 Constant: +0:48 7000000.000000 +0:53 add second child into first child ( temp float) +0:53 'sum' ( global float) +0:53 Constant: +0:53 80000000.000000 +0:58 add second child into first child ( temp float) +0:58 'sum' ( global float) +0:58 Constant: +0:58 900000000.000000 +0:65 add second child into first child ( temp float) +0:65 'sum' ( global float) +0:65 Constant: +0:65 0.050000 +0:69 move second child to first child ( temp 4-component vector of float) +0:69 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:69 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:69 Constant: +0:69 0 (const uint) +0:69 Construct vec4 ( temp 4-component vector of float) +0:69 'sum' ( global float) +0:124 Sequence +0:124 move second child to first child ( temp int) +0:124 'linenumber' ( global int) +0:124 Constant: +0:124 124 (const int) +0:125 Sequence +0:125 move second child to first child ( temp int) +0:125 'filenumber' ( global int) +0:125 Constant: +0:125 0 (const int) +0:126 Sequence +0:126 move second child to first child ( temp int) +0:126 'version' ( global int) +0:126 Constant: +0:126 400 (const int) +0:130 Sequence +0:130 move second child to first child ( temp float) +0:130 'twoPi' ( global float) +0:130 Constant: +0:130 6.280000 +0:199 Sequence +0:199 move second child to first child ( temp int) +0:199 'n' ( global int) +0:199 Constant: +0:199 15 (const int) +0:202 Sequence +0:202 move second child to first child ( temp double) +0:202 'f' ( global double) +0:202 Constant: +0:202 0.000800 +12:9011 Sequence +12:9011 move second child to first child ( temp int) +12:9011 'R1' ( global int) +12:9011 'RECURSE' ( global int) +0:? Linker Objects +0:? 'sum' ( global float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'linenumber' ( global int) +0:? 'filenumber' ( global int) +0:? 'version' ( global int) +0:? 'twoPi' ( global float) +0:? 'a' ( global int) +0:? 'n' ( global int) +0:? 'f' ( global double) +0:? 'RECURSE' ( global int) +0:? 'R1' ( global int) +0:? 'aoeua' ( global int) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/dataOut.frag.out b/deps/glslang/Test/baseResults/dataOut.frag.out new file mode 100644 index 00000000..78976169 --- /dev/null +++ b/deps/glslang/Test/baseResults/dataOut.frag.out @@ -0,0 +1,35 @@ +dataOut.frag +WARNING: 0:3: varying deprecated in version 130; may be removed in future release + +Shader version: 130 +0:? Sequence +0:5 Function Definition: main( ( global void) +0:5 Function Parameters: +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 direct index ( temp 4-component vector of float FragData) +0:7 'gl_FragData' ( fragColor 32-element array of 4-component vector of float FragData) +0:7 Constant: +0:7 1 (const int) +0:7 'Color' ( smooth in 4-component vector of float) +0:? Linker Objects +0:? 'Color' ( smooth in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 130 +0:? Sequence +0:5 Function Definition: main( ( global void) +0:5 Function Parameters: +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 direct index ( temp 4-component vector of float FragData) +0:7 'gl_FragData' ( fragColor 32-element array of 4-component vector of float FragData) +0:7 Constant: +0:7 1 (const int) +0:7 'Color' ( smooth in 4-component vector of float) +0:? Linker Objects +0:? 'Color' ( smooth in 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/dataOutIndirect.frag.out b/deps/glslang/Test/baseResults/dataOutIndirect.frag.out new file mode 100644 index 00000000..dbadb03e --- /dev/null +++ b/deps/glslang/Test/baseResults/dataOutIndirect.frag.out @@ -0,0 +1,35 @@ +dataOutIndirect.frag +WARNING: 0:3: varying deprecated in version 130; may be removed in future release + +Shader version: 130 +0:? Sequence +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:9 Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:9 indirect index ( temp 4-component vector of float FragData) +0:9 'gl_FragData' ( fragColor 32-element array of 4-component vector of float FragData) +0:9 'i' ( uniform int) +0:9 'Color' ( smooth in 4-component vector of float) +0:? Linker Objects +0:? 'Color' ( smooth in 4-component vector of float) +0:? 'i' ( uniform int) + + +Linked fragment stage: + + +Shader version: 130 +0:? Sequence +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:9 Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:9 indirect index ( temp 4-component vector of float FragData) +0:9 'gl_FragData' ( fragColor 32-element array of 4-component vector of float FragData) +0:9 'i' ( uniform int) +0:9 'Color' ( smooth in 4-component vector of float) +0:? Linker Objects +0:? 'Color' ( smooth in 4-component vector of float) +0:? 'i' ( uniform int) + diff --git a/deps/glslang/Test/baseResults/dce.frag.out b/deps/glslang/Test/baseResults/dce.frag.out new file mode 100644 index 00000000..6b02eb1c --- /dev/null +++ b/deps/glslang/Test/baseResults/dce.frag.out @@ -0,0 +1,152 @@ +dce.frag +Shader version: 400 +0:? Sequence +0:5 Sequence +0:5 move second child to first child ( temp int) +0:5 'c' ( global int) +0:5 Constant: +0:5 0 (const int) +0:7 Function Definition: bar( ( global void) +0:7 Function Parameters: +0:9 Sequence +0:9 Test condition and select ( temp void) +0:9 Condition +0:9 Constant: +0:9 false (const bool) +0:9 true case +0:10 Pre-Increment ( temp int) +0:10 'c' ( global int) +0:9 false case +0:12 Pre-Increment ( temp int) +0:12 'c' ( global int) +0:14 Test condition and select ( temp int) +0:14 Condition +0:14 Constant: +0:14 false (const bool) +0:14 true case +0:14 Pre-Increment ( temp int) +0:14 'c' ( global int) +0:14 false case +0:14 Pre-Increment ( temp int) +0:14 'c' ( global int) +0:16 switch +0:16 condition +0:16 'c' ( global int) +0:16 body +0:16 Sequence +0:17 case: with expression +0:17 Constant: +0:17 1 (const int) +0:? Sequence +0:18 Pre-Increment ( temp int) +0:18 'c' ( global int) +0:19 Branch: Break +0:20 Pre-Increment ( temp int) +0:20 'c' ( global int) +0:21 case: with expression +0:21 Constant: +0:21 2 (const int) +0:? Sequence +0:22 Branch: Break +0:23 Pre-Increment ( temp int) +0:23 'c' ( global int) +0:24 default: +0:? Sequence +0:25 Branch: Break +0:28 Sequence +0:28 Sequence +0:28 move second child to first child ( temp int) +0:28 'i' ( temp int) +0:28 Constant: +0:28 0 (const int) +0:28 Loop with condition tested first +0:28 Loop Condition +0:28 Compare Less Than ( temp bool) +0:28 'i' ( temp int) +0:28 Constant: +0:28 0 (const int) +0:28 Loop Body +0:29 Pre-Increment ( temp int) +0:29 'c' ( global int) +0:28 Loop Terminal Expression +0:28 Pre-Increment ( temp int) +0:28 'i' ( temp int) +0:31 Sequence +0:31 Sequence +0:31 move second child to first child ( temp int) +0:31 'i' ( temp int) +0:31 Constant: +0:31 0 (const int) +0:31 Loop with condition tested first +0:31 Loop Condition +0:31 Compare Less Than ( temp bool) +0:31 'i' ( temp int) +0:31 Constant: +0:31 10 (const int) +0:31 Loop Body +0:32 Sequence +0:32 Test condition and select ( temp void) +0:32 Condition +0:32 Compare Less Than ( temp bool) +0:32 'c' ( global int) +0:32 Constant: +0:32 3 (const int) +0:32 true case +0:33 Sequence +0:33 Branch: Break +0:34 Pre-Increment ( temp int) +0:34 'c' ( global int) +0:32 false case +0:36 Sequence +0:36 Branch: Continue +0:37 Pre-Increment ( temp int) +0:37 'c' ( global int) +0:31 Loop Terminal Expression +0:31 Pre-Increment ( temp int) +0:31 'i' ( temp int) +0:41 Branch: Return +0:43 Pre-Increment ( temp int) +0:43 'c' ( global int) +0:46 Function Definition: foo( ( global int) +0:46 Function Parameters: +0:48 Sequence +0:48 Test condition and select ( temp void) +0:48 Condition +0:48 Compare Greater Than ( temp bool) +0:48 'c' ( global int) +0:48 Constant: +0:48 4 (const int) +0:48 true case +0:49 Sequence +0:49 Branch: Return with expression +0:49 Constant: +0:49 4 (const int) +0:50 Pre-Increment ( temp int) +0:50 'c' ( global int) +0:53 Branch: Return with expression +0:53 Constant: +0:53 5 (const int) +0:55 Pre-Increment ( temp int) +0:55 'c' ( global int) +0:? Linker Objects +0:? 'flag' ( const bool) +0:? false (const bool) +0:? 'c' ( global int) + + +Linked fragment stage: + +ERROR: Linking fragment stage: Missing entry point: Each stage requires one entry point + +Shader version: 400 +0:? Sequence +0:5 Sequence +0:5 move second child to first child ( temp int) +0:5 'c' ( global int) +0:5 Constant: +0:5 0 (const int) +0:? Linker Objects +0:? 'flag' ( const bool) +0:? false (const bool) +0:? 'c' ( global int) + diff --git a/deps/glslang/Test/baseResults/decls.frag.out b/deps/glslang/Test/baseResults/decls.frag.out new file mode 100644 index 00000000..72ad11c4 --- /dev/null +++ b/deps/glslang/Test/baseResults/decls.frag.out @@ -0,0 +1,515 @@ +decls.frag +ERROR: 0:19: 'vi4' : illegal use of type 'void' +ERROR: 0:20: 'vj' : illegal use of type 'void' +ERROR: 0:20: 'vk5' : illegal use of type 'void' +ERROR: 0:21: 'vm2' : illegal use of type 'void' +ERROR: 0:21: 'vm3' : illegal use of type 'void' +ERROR: 0:22: 'vn8' : illegal use of type 'void' +ERROR: 0:22: 'vp' : illegal use of type 'void' +ERROR: 0:25: 'cij' : variables with qualifier 'const' must be initialized +ERROR: 0:27: 'cip' : variables with qualifier 'const' must be initialized +ERROR: 0:34: 'gl_vi4' : identifiers starting with "gl_" are reserved +ERROR: 0:35: 'gl_vj' : identifiers starting with "gl_" are reserved +ERROR: 0:35: 'gl_vk5' : identifiers starting with "gl_" are reserved +ERROR: 0:36: 'gl_vm2' : identifiers starting with "gl_" are reserved +ERROR: 0:36: 'gl_vm3' : identifiers starting with "gl_" are reserved +ERROR: 0:37: 'gl_vn8' : identifiers starting with "gl_" are reserved +ERROR: 0:37: 'gl_vp' : identifiers starting with "gl_" are reserved +ERROR: 0:42: '' : boolean expression expected +ERROR: 0:43: 'gl_cond' : identifiers starting with "gl_" are reserved +WARNING: 0:46: 'foob__vi4' : identifiers containing consecutive underscores ("__") are reserved +WARNING: 0:47: 'foob__vj' : identifiers containing consecutive underscores ("__") are reserved +WARNING: 0:47: 'foob__vk5' : identifiers containing consecutive underscores ("__") are reserved +WARNING: 0:48: '__foobvm2' : identifiers containing consecutive underscores ("__") are reserved +WARNING: 0:48: '__foobvm3' : identifiers containing consecutive underscores ("__") are reserved +WARNING: 0:49: 'foob__vn8' : identifiers containing consecutive underscores ("__") are reserved +WARNING: 0:49: 'foob__vp' : identifiers containing consecutive underscores ("__") are reserved +ERROR: 18 compilation errors. No code generated. + + +Shader version: 120 +ERROR: node is still EOpNull! +0:5 Sequence +0:5 move second child to first child ( temp int) +0:5 'd1' ( global int) +0:5 Constant: +0:5 1 (const int) +0:6 Sequence +0:6 move second child to first child ( temp int) +0:6 'e2' ( global int) +0:6 Constant: +0:6 2 (const int) +0:7 Sequence +0:7 move second child to first child ( temp int) +0:7 'h3' ( global int) +0:7 Constant: +0:7 3 (const int) +0:14 Sequence +0:14 move second child to first child ( temp 4-element array of int) +0:14 'ii4' ( global 4-element array of int) +0:14 Constant: +0:14 1 (const int) +0:14 2 (const int) +0:14 3 (const int) +0:14 4 (const int) +0:15 Sequence +0:15 move second child to first child ( temp 5-element array of int) +0:15 'ik5' ( global 5-element array of int) +0:15 Constant: +0:15 5 (const int) +0:15 6 (const int) +0:15 7 (const int) +0:15 8 (const int) +0:15 9 (const int) +0:16 Sequence +0:16 move second child to first child ( temp 2-element array of int) +0:16 'im2' ( global 2-element array of int) +0:16 Constant: +0:16 10 (const int) +0:16 11 (const int) +0:16 move second child to first child ( temp 3-element array of int) +0:16 'im3' ( global 3-element array of int) +0:16 Constant: +0:16 12 (const int) +0:16 13 (const int) +0:16 14 (const int) +0:17 Sequence +0:17 move second child to first child ( temp 4-element array of int) +0:17 'in8' ( global 4-element array of int) +0:17 Constant: +0:17 21 (const int) +0:17 22 (const int) +0:17 23 (const int) +0:17 24 (const int) +0:34 Sequence +0:34 move second child to first child ( temp 4-element array of int) +0:34 'gl_vi4' ( global 4-element array of int) +0:34 Constant: +0:34 1 (const int) +0:34 2 (const int) +0:34 3 (const int) +0:34 4 (const int) +0:35 Sequence +0:35 move second child to first child ( temp 5-element array of int) +0:35 'gl_vk5' ( global 5-element array of int) +0:35 Constant: +0:35 5 (const int) +0:35 6 (const int) +0:35 7 (const int) +0:35 8 (const int) +0:35 9 (const int) +0:36 Sequence +0:36 move second child to first child ( temp 2-element array of int) +0:36 'gl_vm2' ( global 2-element array of int) +0:36 Constant: +0:36 10 (const int) +0:36 11 (const int) +0:36 move second child to first child ( temp 3-element array of int) +0:36 'gl_vm3' ( global 3-element array of int) +0:36 Constant: +0:36 12 (const int) +0:36 13 (const int) +0:36 14 (const int) +0:37 Sequence +0:37 move second child to first child ( temp 4-element array of int) +0:37 'gl_vn8' ( global 4-element array of int) +0:37 Constant: +0:37 21 (const int) +0:37 22 (const int) +0:37 23 (const int) +0:37 24 (const int) +0:39 Function Definition: main( ( global void) +0:39 Function Parameters: +0:41 Sequence +0:41 Loop with condition tested first +0:41 Loop Condition +0:41 move second child to first child ( temp bool) +0:41 'cond' ( temp bool) +0:41 Compare Less Than ( temp bool) +0:41 'b' ( global int) +0:41 'c' ( global int) +0:41 No loop body +0:42 Loop with condition tested first +0:42 Loop Condition +0:42 move second child to first child ( temp int) +0:42 'icond' ( temp int) +0:42 'b' ( global int) +0:42 No loop body +0:43 Loop with condition tested first +0:43 Loop Condition +0:43 move second child to first child ( temp bool) +0:43 'gl_cond' ( temp bool) +0:43 Compare Less Than ( temp bool) +0:43 'b' ( global int) +0:43 'c' ( global int) +0:43 No loop body +0:46 Sequence +0:46 move second child to first child ( temp 4-element array of int) +0:46 'foob__vi4' ( global 4-element array of int) +0:46 Constant: +0:46 1 (const int) +0:46 2 (const int) +0:46 3 (const int) +0:46 4 (const int) +0:47 Sequence +0:47 move second child to first child ( temp 5-element array of int) +0:47 'foob__vk5' ( global 5-element array of int) +0:47 Constant: +0:47 5 (const int) +0:47 6 (const int) +0:47 7 (const int) +0:47 8 (const int) +0:47 9 (const int) +0:48 Sequence +0:48 move second child to first child ( temp 2-element array of int) +0:48 '__foobvm2' ( global 2-element array of int) +0:48 Constant: +0:48 10 (const int) +0:48 11 (const int) +0:48 move second child to first child ( temp 3-element array of int) +0:48 '__foobvm3' ( global 3-element array of int) +0:48 Constant: +0:48 12 (const int) +0:48 13 (const int) +0:48 14 (const int) +0:49 Sequence +0:49 move second child to first child ( temp 4-element array of int) +0:49 'foob__vn8' ( global 4-element array of int) +0:49 Constant: +0:49 21 (const int) +0:49 22 (const int) +0:49 23 (const int) +0:49 24 (const int) +0:? Linker Objects +0:? 'a' ( global int) +0:? 'b' ( global int) +0:? 'c' ( global int) +0:? 'd1' ( global int) +0:? 'e2' ( global int) +0:? 'f' ( global int) +0:? 'g' ( global int) +0:? 'h3' ( global int) +0:? 'i4' ( global 4-element array of int) +0:? 'j' ( global int) +0:? 'k5' ( global 5-element array of int) +0:? 'm6' ( global 6-element array of int) +0:? 'm7' ( global 7-element array of int) +0:? 'n8' ( global 8-element array of int) +0:? 'p' ( global int) +0:? 'ii4' ( global 4-element array of int) +0:? 'ij' ( global int) +0:? 'ik5' ( global 5-element array of int) +0:? 'im2' ( global 2-element array of int) +0:? 'im3' ( global 3-element array of int) +0:? 'in8' ( global 4-element array of int) +0:? 'ip' ( global int) +0:? 'cii4' ( const 4-element array of int) +0:? 1 (const int) +0:? 2 (const int) +0:? 3 (const int) +0:? 4 (const int) +0:? 'cij' ( temp int) +0:? 'cik5' ( const 5-element array of int) +0:? 5 (const int) +0:? 6 (const int) +0:? 7 (const int) +0:? 8 (const int) +0:? 9 (const int) +0:? 'cim2' ( const 2-element array of int) +0:? 10 (const int) +0:? 11 (const int) +0:? 'cim3' ( const 3-element array of int) +0:? 12 (const int) +0:? 13 (const int) +0:? 14 (const int) +0:? 'cin8' ( const 4-element array of int) +0:? 21 (const int) +0:? 22 (const int) +0:? 23 (const int) +0:? 24 (const int) +0:? 'cip' ( temp int) +0:? 'uii4' ( uniform 4-element array of int) +0:? 1 (const int) +0:? 2 (const int) +0:? 3 (const int) +0:? 4 (const int) +0:? 'uij' ( uniform int) +0:? 'uik5' ( uniform 5-element array of int) +0:? 5 (const int) +0:? 6 (const int) +0:? 7 (const int) +0:? 8 (const int) +0:? 9 (const int) +0:? 'uim2' ( uniform 2-element array of int) +0:? 10 (const int) +0:? 11 (const int) +0:? 'uim3' ( uniform 3-element array of int) +0:? 12 (const int) +0:? 13 (const int) +0:? 14 (const int) +0:? 'uin8' ( uniform 4-element array of int) +0:? 21 (const int) +0:? 22 (const int) +0:? 23 (const int) +0:? 24 (const int) +0:? 'uip' ( uniform int) +0:? 'gl_vi4' ( global 4-element array of int) +0:? 'gl_vj' ( global int) +0:? 'gl_vk5' ( global 5-element array of int) +0:? 'gl_vm2' ( global 2-element array of int) +0:? 'gl_vm3' ( global 3-element array of int) +0:? 'gl_vn8' ( global 4-element array of int) +0:? 'gl_vp' ( global int) +0:? 'foob__vi4' ( global 4-element array of int) +0:? 'foob__vj' ( global int) +0:? 'foob__vk5' ( global 5-element array of int) +0:? '__foobvm2' ( global 2-element array of int) +0:? '__foobvm3' ( global 3-element array of int) +0:? 'foob__vn8' ( global 4-element array of int) +0:? 'foob__vp' ( global int) + + +Linked fragment stage: + + +Shader version: 120 +ERROR: node is still EOpNull! +0:5 Sequence +0:5 move second child to first child ( temp int) +0:5 'd1' ( global int) +0:5 Constant: +0:5 1 (const int) +0:6 Sequence +0:6 move second child to first child ( temp int) +0:6 'e2' ( global int) +0:6 Constant: +0:6 2 (const int) +0:7 Sequence +0:7 move second child to first child ( temp int) +0:7 'h3' ( global int) +0:7 Constant: +0:7 3 (const int) +0:14 Sequence +0:14 move second child to first child ( temp 4-element array of int) +0:14 'ii4' ( global 4-element array of int) +0:14 Constant: +0:14 1 (const int) +0:14 2 (const int) +0:14 3 (const int) +0:14 4 (const int) +0:15 Sequence +0:15 move second child to first child ( temp 5-element array of int) +0:15 'ik5' ( global 5-element array of int) +0:15 Constant: +0:15 5 (const int) +0:15 6 (const int) +0:15 7 (const int) +0:15 8 (const int) +0:15 9 (const int) +0:16 Sequence +0:16 move second child to first child ( temp 2-element array of int) +0:16 'im2' ( global 2-element array of int) +0:16 Constant: +0:16 10 (const int) +0:16 11 (const int) +0:16 move second child to first child ( temp 3-element array of int) +0:16 'im3' ( global 3-element array of int) +0:16 Constant: +0:16 12 (const int) +0:16 13 (const int) +0:16 14 (const int) +0:17 Sequence +0:17 move second child to first child ( temp 4-element array of int) +0:17 'in8' ( global 4-element array of int) +0:17 Constant: +0:17 21 (const int) +0:17 22 (const int) +0:17 23 (const int) +0:17 24 (const int) +0:34 Sequence +0:34 move second child to first child ( temp 4-element array of int) +0:34 'gl_vi4' ( global 4-element array of int) +0:34 Constant: +0:34 1 (const int) +0:34 2 (const int) +0:34 3 (const int) +0:34 4 (const int) +0:35 Sequence +0:35 move second child to first child ( temp 5-element array of int) +0:35 'gl_vk5' ( global 5-element array of int) +0:35 Constant: +0:35 5 (const int) +0:35 6 (const int) +0:35 7 (const int) +0:35 8 (const int) +0:35 9 (const int) +0:36 Sequence +0:36 move second child to first child ( temp 2-element array of int) +0:36 'gl_vm2' ( global 2-element array of int) +0:36 Constant: +0:36 10 (const int) +0:36 11 (const int) +0:36 move second child to first child ( temp 3-element array of int) +0:36 'gl_vm3' ( global 3-element array of int) +0:36 Constant: +0:36 12 (const int) +0:36 13 (const int) +0:36 14 (const int) +0:37 Sequence +0:37 move second child to first child ( temp 4-element array of int) +0:37 'gl_vn8' ( global 4-element array of int) +0:37 Constant: +0:37 21 (const int) +0:37 22 (const int) +0:37 23 (const int) +0:37 24 (const int) +0:39 Function Definition: main( ( global void) +0:39 Function Parameters: +0:41 Sequence +0:41 Loop with condition tested first +0:41 Loop Condition +0:41 move second child to first child ( temp bool) +0:41 'cond' ( temp bool) +0:41 Compare Less Than ( temp bool) +0:41 'b' ( global int) +0:41 'c' ( global int) +0:41 No loop body +0:42 Loop with condition tested first +0:42 Loop Condition +0:42 move second child to first child ( temp int) +0:42 'icond' ( temp int) +0:42 'b' ( global int) +0:42 No loop body +0:43 Loop with condition tested first +0:43 Loop Condition +0:43 move second child to first child ( temp bool) +0:43 'gl_cond' ( temp bool) +0:43 Compare Less Than ( temp bool) +0:43 'b' ( global int) +0:43 'c' ( global int) +0:43 No loop body +0:46 Sequence +0:46 move second child to first child ( temp 4-element array of int) +0:46 'foob__vi4' ( global 4-element array of int) +0:46 Constant: +0:46 1 (const int) +0:46 2 (const int) +0:46 3 (const int) +0:46 4 (const int) +0:47 Sequence +0:47 move second child to first child ( temp 5-element array of int) +0:47 'foob__vk5' ( global 5-element array of int) +0:47 Constant: +0:47 5 (const int) +0:47 6 (const int) +0:47 7 (const int) +0:47 8 (const int) +0:47 9 (const int) +0:48 Sequence +0:48 move second child to first child ( temp 2-element array of int) +0:48 '__foobvm2' ( global 2-element array of int) +0:48 Constant: +0:48 10 (const int) +0:48 11 (const int) +0:48 move second child to first child ( temp 3-element array of int) +0:48 '__foobvm3' ( global 3-element array of int) +0:48 Constant: +0:48 12 (const int) +0:48 13 (const int) +0:48 14 (const int) +0:49 Sequence +0:49 move second child to first child ( temp 4-element array of int) +0:49 'foob__vn8' ( global 4-element array of int) +0:49 Constant: +0:49 21 (const int) +0:49 22 (const int) +0:49 23 (const int) +0:49 24 (const int) +0:? Linker Objects +0:? 'a' ( global int) +0:? 'b' ( global int) +0:? 'c' ( global int) +0:? 'd1' ( global int) +0:? 'e2' ( global int) +0:? 'f' ( global int) +0:? 'g' ( global int) +0:? 'h3' ( global int) +0:? 'i4' ( global 4-element array of int) +0:? 'j' ( global int) +0:? 'k5' ( global 5-element array of int) +0:? 'm6' ( global 6-element array of int) +0:? 'm7' ( global 7-element array of int) +0:? 'n8' ( global 8-element array of int) +0:? 'p' ( global int) +0:? 'ii4' ( global 4-element array of int) +0:? 'ij' ( global int) +0:? 'ik5' ( global 5-element array of int) +0:? 'im2' ( global 2-element array of int) +0:? 'im3' ( global 3-element array of int) +0:? 'in8' ( global 4-element array of int) +0:? 'ip' ( global int) +0:? 'cii4' ( const 4-element array of int) +0:? 1 (const int) +0:? 2 (const int) +0:? 3 (const int) +0:? 4 (const int) +0:? 'cij' ( temp int) +0:? 'cik5' ( const 5-element array of int) +0:? 5 (const int) +0:? 6 (const int) +0:? 7 (const int) +0:? 8 (const int) +0:? 9 (const int) +0:? 'cim2' ( const 2-element array of int) +0:? 10 (const int) +0:? 11 (const int) +0:? 'cim3' ( const 3-element array of int) +0:? 12 (const int) +0:? 13 (const int) +0:? 14 (const int) +0:? 'cin8' ( const 4-element array of int) +0:? 21 (const int) +0:? 22 (const int) +0:? 23 (const int) +0:? 24 (const int) +0:? 'cip' ( temp int) +0:? 'uii4' ( uniform 4-element array of int) +0:? 1 (const int) +0:? 2 (const int) +0:? 3 (const int) +0:? 4 (const int) +0:? 'uij' ( uniform int) +0:? 'uik5' ( uniform 5-element array of int) +0:? 5 (const int) +0:? 6 (const int) +0:? 7 (const int) +0:? 8 (const int) +0:? 9 (const int) +0:? 'uim2' ( uniform 2-element array of int) +0:? 10 (const int) +0:? 11 (const int) +0:? 'uim3' ( uniform 3-element array of int) +0:? 12 (const int) +0:? 13 (const int) +0:? 14 (const int) +0:? 'uin8' ( uniform 4-element array of int) +0:? 21 (const int) +0:? 22 (const int) +0:? 23 (const int) +0:? 24 (const int) +0:? 'uip' ( uniform int) +0:? 'gl_vi4' ( global 4-element array of int) +0:? 'gl_vj' ( global int) +0:? 'gl_vk5' ( global 5-element array of int) +0:? 'gl_vm2' ( global 2-element array of int) +0:? 'gl_vm3' ( global 3-element array of int) +0:? 'gl_vn8' ( global 4-element array of int) +0:? 'gl_vp' ( global int) +0:? 'foob__vi4' ( global 4-element array of int) +0:? 'foob__vj' ( global int) +0:? 'foob__vk5' ( global 5-element array of int) +0:? '__foobvm2' ( global 2-element array of int) +0:? '__foobvm3' ( global 3-element array of int) +0:? 'foob__vn8' ( global 4-element array of int) +0:? 'foob__vp' ( global int) + diff --git a/deps/glslang/Test/baseResults/deepRvalue.frag.out b/deps/glslang/Test/baseResults/deepRvalue.frag.out new file mode 100644 index 00000000..a4fdf5a8 --- /dev/null +++ b/deps/glslang/Test/baseResults/deepRvalue.frag.out @@ -0,0 +1,285 @@ +deepRvalue.frag +Shader version: 120 +0:? Sequence +0:5 Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:5 'v1' ( global 4-component vector of float) +0:5 Constant: +0:5 2.000000 +0:5 3.000000 +0:5 5.000000 +0:5 7.000000 +0:6 Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:6 'v2' ( global 4-component vector of float) +0:6 Constant: +0:6 11.000000 +0:6 13.000000 +0:6 17.000000 +0:6 19.000000 +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 'v3' ( global 4-component vector of float) +0:7 Constant: +0:7 23.000000 +0:7 29.000000 +0:7 31.000000 +0:7 37.000000 +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'v4' ( global 4-component vector of float) +0:8 Constant: +0:8 41.000000 +0:8 43.000000 +0:8 47.000000 +0:8 53.000000 +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:18 Sequence +0:18 Sequence +0:18 move second child to first child ( temp 4X4 matrix of float) +0:18 'm' ( temp 4X4 matrix of float) +0:18 Construct mat4 ( temp 4X4 matrix of float) +0:18 'v1' ( global 4-component vector of float) +0:18 'v2' ( global 4-component vector of float) +0:18 'v3' ( global 4-component vector of float) +0:18 'v4' ( global 4-component vector of float) +0:20 Sequence +0:20 move second child to first child ( temp 4X4 matrix of float) +0:20 'mm' ( temp 4X4 matrix of float) +0:20 component-wise multiply ( global 4X4 matrix of float) +0:20 'm' ( temp 4X4 matrix of float) +0:20 'm' ( temp 4X4 matrix of float) +0:21 Sequence +0:21 move second child to first child ( temp float) +0:21 'f' ( temp float) +0:21 direct index ( temp float) +0:21 direct index ( temp 4-component vector of float) +0:21 'mm' ( temp 4X4 matrix of float) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 3 (const int) +0:24 Sequence +0:24 move second child to first child ( temp float) +0:24 'g' ( temp float) +0:24 direct index ( temp float) +0:24 direct index ( temp 4-component vector of float) +0:24 component-wise multiply ( global 4X4 matrix of float) +0:24 'm' ( temp 4X4 matrix of float) +0:24 'm' ( temp 4X4 matrix of float) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 1 (const int) +0:26 Sequence +0:26 move second child to first child ( temp float) +0:26 'h' ( temp float) +0:26 Constant: +0:26 5.000000 +0:28 Sequence +0:28 move second child to first child ( temp float) +0:28 'i' ( temp float) +0:28 direct index ( temp float) +0:28 texture ( global 4-component vector of float) +0:28 'sampler' ( uniform sampler2D) +0:28 Constant: +0:28 0.500000 +0:28 0.500000 +0:28 Constant: +0:28 1 (const int) +0:30 add second child into first child ( temp float) +0:30 'i' ( temp float) +0:30 direct index ( temp float) +0:30 Test condition and select ( temp 4-component vector of float) +0:30 Condition +0:30 Compare Greater Than ( temp bool) +0:30 'i' ( temp float) +0:30 Constant: +0:30 0.100000 +0:30 true case +0:30 'v1' ( global 4-component vector of float) +0:30 false case +0:30 'v2' ( global 4-component vector of float) +0:30 Constant: +0:30 3 (const int) +0:33 add second child into first child ( temp float) +0:33 'i' ( temp float) +0:33 direct index ( temp float) +0:33 direct index ( temp 2-component vector of float) +0:33 b: direct index for structure ( global 3-element array of 2-component vector of float) +0:33 move second child to first child ( temp structure{ global int a, global 3-element array of 2-component vector of float b, global bool c}) +0:33 't' ( temp structure{ global int a, global 3-element array of 2-component vector of float b, global bool c}) +0:33 Constant: +0:33 1 (const int) +0:33 2.000000 +0:33 3.000000 +0:33 4.000000 +0:33 5.000000 +0:33 6.000000 +0:33 7.000000 +0:33 true (const bool) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 2 (const int) +0:33 Constant: +0:33 1 (const int) +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:35 Construct vec4 ( temp 4-component vector of float) +0:35 'f' ( temp float) +0:35 'g' ( temp float) +0:35 'h' ( temp float) +0:35 'i' ( temp float) +0:? Linker Objects +0:? 'sampler' ( uniform sampler2D) +0:? 'v1' ( global 4-component vector of float) +0:? 'v2' ( global 4-component vector of float) +0:? 'v3' ( global 4-component vector of float) +0:? 'v4' ( global 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 120 +0:? Sequence +0:5 Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:5 'v1' ( global 4-component vector of float) +0:5 Constant: +0:5 2.000000 +0:5 3.000000 +0:5 5.000000 +0:5 7.000000 +0:6 Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:6 'v2' ( global 4-component vector of float) +0:6 Constant: +0:6 11.000000 +0:6 13.000000 +0:6 17.000000 +0:6 19.000000 +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 'v3' ( global 4-component vector of float) +0:7 Constant: +0:7 23.000000 +0:7 29.000000 +0:7 31.000000 +0:7 37.000000 +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'v4' ( global 4-component vector of float) +0:8 Constant: +0:8 41.000000 +0:8 43.000000 +0:8 47.000000 +0:8 53.000000 +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:18 Sequence +0:18 Sequence +0:18 move second child to first child ( temp 4X4 matrix of float) +0:18 'm' ( temp 4X4 matrix of float) +0:18 Construct mat4 ( temp 4X4 matrix of float) +0:18 'v1' ( global 4-component vector of float) +0:18 'v2' ( global 4-component vector of float) +0:18 'v3' ( global 4-component vector of float) +0:18 'v4' ( global 4-component vector of float) +0:20 Sequence +0:20 move second child to first child ( temp 4X4 matrix of float) +0:20 'mm' ( temp 4X4 matrix of float) +0:20 component-wise multiply ( global 4X4 matrix of float) +0:20 'm' ( temp 4X4 matrix of float) +0:20 'm' ( temp 4X4 matrix of float) +0:21 Sequence +0:21 move second child to first child ( temp float) +0:21 'f' ( temp float) +0:21 direct index ( temp float) +0:21 direct index ( temp 4-component vector of float) +0:21 'mm' ( temp 4X4 matrix of float) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 3 (const int) +0:24 Sequence +0:24 move second child to first child ( temp float) +0:24 'g' ( temp float) +0:24 direct index ( temp float) +0:24 direct index ( temp 4-component vector of float) +0:24 component-wise multiply ( global 4X4 matrix of float) +0:24 'm' ( temp 4X4 matrix of float) +0:24 'm' ( temp 4X4 matrix of float) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 1 (const int) +0:26 Sequence +0:26 move second child to first child ( temp float) +0:26 'h' ( temp float) +0:26 Constant: +0:26 5.000000 +0:28 Sequence +0:28 move second child to first child ( temp float) +0:28 'i' ( temp float) +0:28 direct index ( temp float) +0:28 texture ( global 4-component vector of float) +0:28 'sampler' ( uniform sampler2D) +0:28 Constant: +0:28 0.500000 +0:28 0.500000 +0:28 Constant: +0:28 1 (const int) +0:30 add second child into first child ( temp float) +0:30 'i' ( temp float) +0:30 direct index ( temp float) +0:30 Test condition and select ( temp 4-component vector of float) +0:30 Condition +0:30 Compare Greater Than ( temp bool) +0:30 'i' ( temp float) +0:30 Constant: +0:30 0.100000 +0:30 true case +0:30 'v1' ( global 4-component vector of float) +0:30 false case +0:30 'v2' ( global 4-component vector of float) +0:30 Constant: +0:30 3 (const int) +0:33 add second child into first child ( temp float) +0:33 'i' ( temp float) +0:33 direct index ( temp float) +0:33 direct index ( temp 2-component vector of float) +0:33 b: direct index for structure ( global 3-element array of 2-component vector of float) +0:33 move second child to first child ( temp structure{ global int a, global 3-element array of 2-component vector of float b, global bool c}) +0:33 't' ( temp structure{ global int a, global 3-element array of 2-component vector of float b, global bool c}) +0:33 Constant: +0:33 1 (const int) +0:33 2.000000 +0:33 3.000000 +0:33 4.000000 +0:33 5.000000 +0:33 6.000000 +0:33 7.000000 +0:33 true (const bool) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 2 (const int) +0:33 Constant: +0:33 1 (const int) +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:35 Construct vec4 ( temp 4-component vector of float) +0:35 'f' ( temp float) +0:35 'g' ( temp float) +0:35 'h' ( temp float) +0:35 'i' ( temp float) +0:? Linker Objects +0:? 'sampler' ( uniform sampler2D) +0:? 'v1' ( global 4-component vector of float) +0:? 'v2' ( global 4-component vector of float) +0:? 'v3' ( global 4-component vector of float) +0:? 'v4' ( global 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/depthOut.frag.out b/deps/glslang/Test/baseResults/depthOut.frag.out new file mode 100644 index 00000000..91c1fc20 --- /dev/null +++ b/deps/glslang/Test/baseResults/depthOut.frag.out @@ -0,0 +1,38 @@ +depthOut.frag +WARNING: 0:3: varying deprecated in version 130; may be removed in future release +WARNING: 0:4: varying deprecated in version 130; may be removed in future release + +Shader version: 130 +0:? Sequence +0:6 Function Definition: main( ( global void) +0:6 Function Parameters: +0:8 Sequence +0:8 move second child to first child ( temp float) +0:8 'gl_FragDepth' ( gl_FragDepth float FragDepth) +0:8 'Depth' ( smooth in float) +0:9 move second child to first child ( temp 4-component vector of float) +0:9 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:9 'Color' ( smooth in 4-component vector of float) +0:? Linker Objects +0:? 'Color' ( smooth in 4-component vector of float) +0:? 'Depth' ( smooth in float) + + +Linked fragment stage: + + +Shader version: 130 +0:? Sequence +0:6 Function Definition: main( ( global void) +0:6 Function Parameters: +0:8 Sequence +0:8 move second child to first child ( temp float) +0:8 'gl_FragDepth' ( gl_FragDepth float FragDepth) +0:8 'Depth' ( smooth in float) +0:9 move second child to first child ( temp 4-component vector of float) +0:9 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:9 'Color' ( smooth in 4-component vector of float) +0:? Linker Objects +0:? 'Color' ( smooth in 4-component vector of float) +0:? 'Depth' ( smooth in float) + diff --git a/deps/glslang/Test/baseResults/discard-dce.frag.out b/deps/glslang/Test/baseResults/discard-dce.frag.out new file mode 100644 index 00000000..5f5e8894 --- /dev/null +++ b/deps/glslang/Test/baseResults/discard-dce.frag.out @@ -0,0 +1,239 @@ +discard-dce.frag +Shader version: 110 +0:? Sequence +0:4 Function Definition: main( ( global void) +0:4 Function Parameters: +0:6 Sequence +0:6 Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:6 'white' ( temp 4-component vector of float) +0:6 Constant: +0:6 1.000000 +0:6 1.000000 +0:6 1.000000 +0:6 1.000000 +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 'black' ( temp 4-component vector of float) +0:7 Constant: +0:7 0.200000 +0:7 0.200000 +0:7 0.200000 +0:7 0.200000 +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'color' ( temp 4-component vector of float) +0:8 'white' ( temp 4-component vector of float) +0:11 Sequence +0:11 move second child to first child ( temp float) +0:11 'x' ( temp float) +0:11 subtract ( temp float) +0:11 component-wise multiply ( temp float) +0:11 direct index ( temp float) +0:11 'tex_coord' ( smooth in 2-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 2.000000 +0:11 Constant: +0:11 1.000000 +0:12 Sequence +0:12 move second child to first child ( temp float) +0:12 'y' ( temp float) +0:12 subtract ( temp float) +0:12 component-wise multiply ( temp float) +0:12 direct index ( temp float) +0:12 'tex_coord' ( smooth in 2-component vector of float) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 2.000000 +0:12 Constant: +0:12 1.000000 +0:14 Sequence +0:14 move second child to first child ( temp float) +0:14 'radius' ( temp float) +0:14 sqrt ( global float) +0:14 add ( temp float) +0:14 component-wise multiply ( temp float) +0:14 'x' ( temp float) +0:14 'x' ( temp float) +0:14 component-wise multiply ( temp float) +0:14 'y' ( temp float) +0:14 'y' ( temp float) +0:15 Test condition and select ( temp void) +0:15 Condition +0:15 Compare Greater Than ( temp bool) +0:15 'radius' ( temp float) +0:15 Constant: +0:15 1.000000 +0:15 true case +0:16 Sequence +0:16 Test condition and select ( temp void) +0:16 Condition +0:16 Compare Greater Than ( temp bool) +0:16 'radius' ( temp float) +0:16 Constant: +0:16 1.100000 +0:16 true case +0:17 Sequence +0:17 Pre-Increment ( temp 4-component vector of float) +0:17 'color' ( temp 4-component vector of float) +0:20 move second child to first child ( temp 4-component vector of float) +0:20 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:20 'color' ( temp 4-component vector of float) +0:22 Test condition and select ( temp void) +0:22 Condition +0:22 Compare Greater Than ( temp bool) +0:22 'radius' ( temp float) +0:22 Constant: +0:22 1.200000 +0:22 true case +0:23 Sequence +0:23 Pre-Increment ( temp 4-component vector of float) +0:23 'color' ( temp 4-component vector of float) +0:26 Branch: Kill +0:30 Test condition and select ( temp void) +0:30 Condition +0:30 Compare Greater Than or Equal ( temp bool) +0:30 'radius' ( temp float) +0:30 Constant: +0:30 0.750000 +0:30 true case +0:31 subtract second child into first child ( temp 4-component vector of float) +0:31 'color' ( temp 4-component vector of float) +0:31 Absolute value ( global float) +0:31 divide ( temp float) +0:31 pow ( global float) +0:31 'radius' ( temp float) +0:31 Constant: +0:31 16.000000 +0:31 Constant: +0:31 2.000000 +0:33 move second child to first child ( temp 4-component vector of float) +0:33 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:33 'color' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'tex_coord' ( smooth in 2-component vector of float) + + +Linked fragment stage: + + +Shader version: 110 +0:? Sequence +0:4 Function Definition: main( ( global void) +0:4 Function Parameters: +0:6 Sequence +0:6 Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:6 'white' ( temp 4-component vector of float) +0:6 Constant: +0:6 1.000000 +0:6 1.000000 +0:6 1.000000 +0:6 1.000000 +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 'black' ( temp 4-component vector of float) +0:7 Constant: +0:7 0.200000 +0:7 0.200000 +0:7 0.200000 +0:7 0.200000 +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'color' ( temp 4-component vector of float) +0:8 'white' ( temp 4-component vector of float) +0:11 Sequence +0:11 move second child to first child ( temp float) +0:11 'x' ( temp float) +0:11 subtract ( temp float) +0:11 component-wise multiply ( temp float) +0:11 direct index ( temp float) +0:11 'tex_coord' ( smooth in 2-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 2.000000 +0:11 Constant: +0:11 1.000000 +0:12 Sequence +0:12 move second child to first child ( temp float) +0:12 'y' ( temp float) +0:12 subtract ( temp float) +0:12 component-wise multiply ( temp float) +0:12 direct index ( temp float) +0:12 'tex_coord' ( smooth in 2-component vector of float) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 2.000000 +0:12 Constant: +0:12 1.000000 +0:14 Sequence +0:14 move second child to first child ( temp float) +0:14 'radius' ( temp float) +0:14 sqrt ( global float) +0:14 add ( temp float) +0:14 component-wise multiply ( temp float) +0:14 'x' ( temp float) +0:14 'x' ( temp float) +0:14 component-wise multiply ( temp float) +0:14 'y' ( temp float) +0:14 'y' ( temp float) +0:15 Test condition and select ( temp void) +0:15 Condition +0:15 Compare Greater Than ( temp bool) +0:15 'radius' ( temp float) +0:15 Constant: +0:15 1.000000 +0:15 true case +0:16 Sequence +0:16 Test condition and select ( temp void) +0:16 Condition +0:16 Compare Greater Than ( temp bool) +0:16 'radius' ( temp float) +0:16 Constant: +0:16 1.100000 +0:16 true case +0:17 Sequence +0:17 Pre-Increment ( temp 4-component vector of float) +0:17 'color' ( temp 4-component vector of float) +0:20 move second child to first child ( temp 4-component vector of float) +0:20 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:20 'color' ( temp 4-component vector of float) +0:22 Test condition and select ( temp void) +0:22 Condition +0:22 Compare Greater Than ( temp bool) +0:22 'radius' ( temp float) +0:22 Constant: +0:22 1.200000 +0:22 true case +0:23 Sequence +0:23 Pre-Increment ( temp 4-component vector of float) +0:23 'color' ( temp 4-component vector of float) +0:26 Branch: Kill +0:30 Test condition and select ( temp void) +0:30 Condition +0:30 Compare Greater Than or Equal ( temp bool) +0:30 'radius' ( temp float) +0:30 Constant: +0:30 0.750000 +0:30 true case +0:31 subtract second child into first child ( temp 4-component vector of float) +0:31 'color' ( temp 4-component vector of float) +0:31 Absolute value ( global float) +0:31 divide ( temp float) +0:31 pow ( global float) +0:31 'radius' ( temp float) +0:31 Constant: +0:31 16.000000 +0:31 Constant: +0:31 2.000000 +0:33 move second child to first child ( temp 4-component vector of float) +0:33 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:33 'color' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'tex_coord' ( smooth in 2-component vector of float) + diff --git a/deps/glslang/Test/baseResults/doWhileLoop.frag.out b/deps/glslang/Test/baseResults/doWhileLoop.frag.out new file mode 100644 index 00000000..5302cb98 --- /dev/null +++ b/deps/glslang/Test/baseResults/doWhileLoop.frag.out @@ -0,0 +1,65 @@ +doWhileLoop.frag +Shader version: 110 +0:? Sequence +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:9 Sequence +0:9 Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:9 'color' ( temp 4-component vector of float) +0:9 'BaseColor' ( smooth in 4-component vector of float) +0:13 Loop with condition not tested first +0:13 Loop Condition +0:13 Compare Less Than ( temp bool) +0:13 direct index ( temp float) +0:13 'color' ( temp 4-component vector of float) +0:13 Constant: +0:13 0 (const int) +0:13 'd' ( uniform float) +0:13 Loop Body +0:12 Sequence +0:12 add second child into first child ( temp 4-component vector of float) +0:12 'color' ( temp 4-component vector of float) +0:12 'bigColor' ( uniform 4-component vector of float) +0:15 move second child to first child ( temp 4-component vector of float) +0:15 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:15 'color' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'd' ( uniform float) + + +Linked fragment stage: + + +Shader version: 110 +0:? Sequence +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:9 Sequence +0:9 Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:9 'color' ( temp 4-component vector of float) +0:9 'BaseColor' ( smooth in 4-component vector of float) +0:13 Loop with condition not tested first +0:13 Loop Condition +0:13 Compare Less Than ( temp bool) +0:13 direct index ( temp float) +0:13 'color' ( temp 4-component vector of float) +0:13 Constant: +0:13 0 (const int) +0:13 'd' ( uniform float) +0:13 Loop Body +0:12 Sequence +0:12 add second child into first child ( temp 4-component vector of float) +0:12 'color' ( temp 4-component vector of float) +0:12 'bigColor' ( uniform 4-component vector of float) +0:15 move second child to first child ( temp 4-component vector of float) +0:15 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:15 'color' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'd' ( uniform float) + diff --git a/deps/glslang/Test/baseResults/earlyReturnDiscard.frag.out b/deps/glslang/Test/baseResults/earlyReturnDiscard.frag.out new file mode 100644 index 00000000..8c9e4d97 --- /dev/null +++ b/deps/glslang/Test/baseResults/earlyReturnDiscard.frag.out @@ -0,0 +1,257 @@ +earlyReturnDiscard.frag +Shader version: 110 +0:? Sequence +0:19 Function Definition: main( ( global void) +0:19 Function Parameters: +0:21 Sequence +0:21 Sequence +0:21 move second child to first child ( temp 4-component vector of float) +0:21 'color' ( temp 4-component vector of float) +0:21 'BaseColor' ( smooth in 4-component vector of float) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 'color2' ( temp 4-component vector of float) +0:24 'otherColor' ( uniform 4-component vector of float) +0:26 Test condition and select ( temp void) +0:26 Condition +0:26 Compare Greater Than ( temp bool) +0:26 'c' ( smooth in float) +0:26 'd' ( uniform float) +0:26 true case +0:27 add second child into first child ( temp 4-component vector of float) +0:27 'color' ( temp 4-component vector of float) +0:27 'bigColor' ( uniform 4-component vector of float) +0:26 false case +0:29 add second child into first child ( temp 4-component vector of float) +0:29 'color' ( temp 4-component vector of float) +0:29 'smallColor' ( uniform 4-component vector of float) +0:31 Test condition and select ( temp void) +0:31 Condition +0:31 Compare Less Than ( temp bool) +0:31 direct index ( temp float) +0:31 'color' ( temp 4-component vector of float) +0:31 Constant: +0:31 2 (const int) +0:31 'minimum' ( uniform float) +0:31 true case +0:32 Branch: Return +0:34 Post-Increment ( temp float) +0:34 direct index ( temp float) +0:34 'color' ( temp 4-component vector of float) +0:34 Constant: +0:34 2 (const int) +0:36 Test condition and select ( temp void) +0:36 Condition +0:36 Compare Greater Than ( temp bool) +0:36 direct index ( temp float) +0:36 'color' ( temp 4-component vector of float) +0:36 Constant: +0:36 2 (const int) +0:36 'threshhold' ( uniform float) +0:36 true case +0:37 Branch: Kill +0:39 Post-Increment ( temp 4-component vector of float) +0:39 'color' ( temp 4-component vector of float) +0:42 Test condition and select ( temp void) +0:42 Condition +0:42 Compare Greater Than ( temp bool) +0:42 direct index ( temp float) +0:42 'color' ( temp 4-component vector of float) +0:42 Constant: +0:42 3 (const int) +0:42 'threshhold2' ( uniform float) +0:42 true case +0:43 Sequence +0:43 Test condition and select ( temp void) +0:43 Condition +0:43 Compare Greater Than ( temp bool) +0:43 direct index ( temp float) +0:43 'color' ( temp 4-component vector of float) +0:43 Constant: +0:43 2 (const int) +0:43 'threshhold2' ( uniform float) +0:43 true case +0:44 Branch: Return +0:43 false case +0:45 Test condition and select ( temp void) +0:45 Condition +0:45 'b' ( uniform bool) +0:45 true case +0:46 Post-Increment ( temp float) +0:46 direct index ( temp float) +0:46 'color' ( temp 4-component vector of float) +0:46 Constant: +0:46 2 (const int) +0:45 false case +0:48 Sequence +0:48 Test condition and select ( temp void) +0:48 Condition +0:48 Compare Less Than ( temp bool) +0:48 direct index ( temp float) +0:48 'color' ( temp 4-component vector of float) +0:48 Constant: +0:48 0 (const int) +0:48 'minimum' ( uniform float) +0:48 true case +0:49 Sequence +0:49 Branch: Kill +0:48 false case +0:51 Sequence +0:51 Post-Increment ( temp 4-component vector of float) +0:51 'color' ( temp 4-component vector of float) +0:42 false case +0:55 Sequence +0:55 Test condition and select ( temp void) +0:55 Condition +0:55 'b' ( uniform bool) +0:55 true case +0:56 Branch: Kill +0:55 false case +0:58 Branch: Return +0:101 move second child to first child ( temp 4-component vector of float) +0:101 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:101 component-wise multiply ( temp 4-component vector of float) +0:101 'color' ( temp 4-component vector of float) +0:101 'color2' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'd' ( uniform float) +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'smallColor' ( uniform 4-component vector of float) +0:? 'otherColor' ( uniform 4-component vector of float) +0:? 'c' ( smooth in float) +0:? 'threshhold' ( uniform float) +0:? 'threshhold2' ( uniform float) +0:? 'threshhold3' ( uniform float) +0:? 'minimum' ( uniform float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'b' ( uniform bool) + + +Linked fragment stage: + + +Shader version: 110 +0:? Sequence +0:19 Function Definition: main( ( global void) +0:19 Function Parameters: +0:21 Sequence +0:21 Sequence +0:21 move second child to first child ( temp 4-component vector of float) +0:21 'color' ( temp 4-component vector of float) +0:21 'BaseColor' ( smooth in 4-component vector of float) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 'color2' ( temp 4-component vector of float) +0:24 'otherColor' ( uniform 4-component vector of float) +0:26 Test condition and select ( temp void) +0:26 Condition +0:26 Compare Greater Than ( temp bool) +0:26 'c' ( smooth in float) +0:26 'd' ( uniform float) +0:26 true case +0:27 add second child into first child ( temp 4-component vector of float) +0:27 'color' ( temp 4-component vector of float) +0:27 'bigColor' ( uniform 4-component vector of float) +0:26 false case +0:29 add second child into first child ( temp 4-component vector of float) +0:29 'color' ( temp 4-component vector of float) +0:29 'smallColor' ( uniform 4-component vector of float) +0:31 Test condition and select ( temp void) +0:31 Condition +0:31 Compare Less Than ( temp bool) +0:31 direct index ( temp float) +0:31 'color' ( temp 4-component vector of float) +0:31 Constant: +0:31 2 (const int) +0:31 'minimum' ( uniform float) +0:31 true case +0:32 Branch: Return +0:34 Post-Increment ( temp float) +0:34 direct index ( temp float) +0:34 'color' ( temp 4-component vector of float) +0:34 Constant: +0:34 2 (const int) +0:36 Test condition and select ( temp void) +0:36 Condition +0:36 Compare Greater Than ( temp bool) +0:36 direct index ( temp float) +0:36 'color' ( temp 4-component vector of float) +0:36 Constant: +0:36 2 (const int) +0:36 'threshhold' ( uniform float) +0:36 true case +0:37 Branch: Kill +0:39 Post-Increment ( temp 4-component vector of float) +0:39 'color' ( temp 4-component vector of float) +0:42 Test condition and select ( temp void) +0:42 Condition +0:42 Compare Greater Than ( temp bool) +0:42 direct index ( temp float) +0:42 'color' ( temp 4-component vector of float) +0:42 Constant: +0:42 3 (const int) +0:42 'threshhold2' ( uniform float) +0:42 true case +0:43 Sequence +0:43 Test condition and select ( temp void) +0:43 Condition +0:43 Compare Greater Than ( temp bool) +0:43 direct index ( temp float) +0:43 'color' ( temp 4-component vector of float) +0:43 Constant: +0:43 2 (const int) +0:43 'threshhold2' ( uniform float) +0:43 true case +0:44 Branch: Return +0:43 false case +0:45 Test condition and select ( temp void) +0:45 Condition +0:45 'b' ( uniform bool) +0:45 true case +0:46 Post-Increment ( temp float) +0:46 direct index ( temp float) +0:46 'color' ( temp 4-component vector of float) +0:46 Constant: +0:46 2 (const int) +0:45 false case +0:48 Sequence +0:48 Test condition and select ( temp void) +0:48 Condition +0:48 Compare Less Than ( temp bool) +0:48 direct index ( temp float) +0:48 'color' ( temp 4-component vector of float) +0:48 Constant: +0:48 0 (const int) +0:48 'minimum' ( uniform float) +0:48 true case +0:49 Sequence +0:49 Branch: Kill +0:48 false case +0:51 Sequence +0:51 Post-Increment ( temp 4-component vector of float) +0:51 'color' ( temp 4-component vector of float) +0:42 false case +0:55 Sequence +0:55 Test condition and select ( temp void) +0:55 Condition +0:55 'b' ( uniform bool) +0:55 true case +0:56 Branch: Kill +0:55 false case +0:58 Branch: Return +0:101 move second child to first child ( temp 4-component vector of float) +0:101 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:101 component-wise multiply ( temp 4-component vector of float) +0:101 'color' ( temp 4-component vector of float) +0:101 'color2' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'd' ( uniform float) +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'smallColor' ( uniform 4-component vector of float) +0:? 'otherColor' ( uniform 4-component vector of float) +0:? 'c' ( smooth in float) +0:? 'threshhold' ( uniform float) +0:? 'threshhold2' ( uniform float) +0:? 'threshhold3' ( uniform float) +0:? 'minimum' ( uniform float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'b' ( uniform bool) + diff --git a/deps/glslang/Test/baseResults/empty.frag.out b/deps/glslang/Test/baseResults/empty.frag.out new file mode 100644 index 00000000..be186bb9 --- /dev/null +++ b/deps/glslang/Test/baseResults/empty.frag.out @@ -0,0 +1,17 @@ +empty.frag +Shader version: 100 +0:? Sequence +0:? Linker Objects + +empty2.frag +Shader version: 100 +0:? Sequence +0:? Linker Objects + +empty3.frag +Shader version: 110 +0:? Sequence +0:? Linker Objects + +ERROR: Cannot mix ES profile with non-ES profile shaders + diff --git a/deps/glslang/Test/baseResults/errors.frag.out b/deps/glslang/Test/baseResults/errors.frag.out new file mode 100644 index 00000000..7271107e --- /dev/null +++ b/deps/glslang/Test/baseResults/errors.frag.out @@ -0,0 +1,32 @@ +errors.frag +ERROR: 0:1: 'main' : function cannot take any parameter(s) +ERROR: 0:1: 'int' : entry point cannot return a value +ERROR: 2 compilation errors. No code generated. + + +Shader version: 100 +ERROR: node is still EOpNull! +0:1 Function Definition: main(i1; ( global mediump int) +0:1 Function Parameters: +0:1 'foo' ( in mediump int) +0:3 Sequence +0:3 Branch: Return with expression +0:3 Constant: +0:3 1 (const int) +0:? Linker Objects + + +Linked fragment stage: + + +Shader version: 100 +ERROR: node is still EOpNull! +0:1 Function Definition: main(i1; ( global mediump int) +0:1 Function Parameters: +0:1 'foo' ( in mediump int) +0:3 Sequence +0:3 Branch: Return with expression +0:3 Constant: +0:3 1 (const int) +0:? Linker Objects + diff --git a/deps/glslang/Test/baseResults/es-link1.frag.out b/deps/glslang/Test/baseResults/es-link1.frag.out new file mode 100644 index 00000000..8e662c3d --- /dev/null +++ b/deps/glslang/Test/baseResults/es-link1.frag.out @@ -0,0 +1,27 @@ +es-link1.frag +Shader version: 100 +0:? Sequence +0:5 Function Definition: main( ( global void) +0:5 Function Parameters: +0:7 Sequence +0:7 move second child to first child ( temp mediump 4-component vector of float) +0:7 'gl_FragColor' ( fragColor mediump 4-component vector of float FragColor) +0:7 Function Call: calculateColor( ( global mediump 4-component vector of float) +0:? Linker Objects + +es-link2.frag +Shader version: 100 +0:? Sequence +0:5 Function Definition: calculateColor( ( global mediump 4-component vector of float) +0:5 Function Parameters: +0:7 Sequence +0:7 Branch: Return with expression +0:7 vector-scale ( temp mediump 4-component vector of float) +0:7 'varyingColor' ( smooth in mediump 4-component vector of float) +0:7 Constant: +0:7 0.500000 +0:? Linker Objects +0:? 'varyingColor' ( smooth in mediump 4-component vector of float) + +ERROR: Cannot attach multiple ES shaders of the same type to a single program + diff --git a/deps/glslang/Test/baseResults/findFunction.frag.out b/deps/glslang/Test/baseResults/findFunction.frag.out new file mode 100644 index 00000000..ec4f3e46 --- /dev/null +++ b/deps/glslang/Test/baseResults/findFunction.frag.out @@ -0,0 +1,233 @@ +findFunction.frag +ERROR: 0:39: 'func' : ambiguous best function under implicit type conversion +ERROR: 0:40: 'func' : no matching overloaded function found +ERROR: 0:40: '=' : cannot convert from ' const float' to ' temp int64_t' +ERROR: 0:41: 'func' : no matching overloaded function found +ERROR: 0:41: '=' : cannot convert from ' const float' to ' temp int64_t' +ERROR: 0:44: 'func' : no matching overloaded function found +ERROR: 0:44: '=' : cannot convert from ' const float' to ' temp int64_t' +ERROR: 0:45: 'func' : ambiguous best function under implicit type conversion +ERROR: 8 compilation errors. No code generated. + + +Shader version: 450 +Requested GL_KHX_shader_explicit_arithmetic_types +ERROR: node is still EOpNull! +0:5 Function Definition: func(i81;i161;i161; ( global int64_t) +0:5 Function Parameters: +0:5 'a' ( in int8_t) +0:5 'b' ( in int16_t) +0:5 'c' ( in int16_t) +0:7 Sequence +0:7 Branch: Return with expression +0:7 Convert int16_t to int64 ( temp int64_t) +0:7 inclusive-or ( temp int16_t) +0:7 Convert int8_t to int16_t ( temp int16_t) +0:7 'a' ( in int8_t) +0:7 add ( temp int16_t) +0:7 'b' ( in int16_t) +0:7 'c' ( in int16_t) +0:10 Function Definition: func(i81;i161;i1; ( global int64_t) +0:10 Function Parameters: +0:10 'a' ( in int8_t) +0:10 'b' ( in int16_t) +0:10 'c' ( in int) +0:12 Sequence +0:12 Branch: Return with expression +0:12 Convert int to int64 ( temp int64_t) +0:12 inclusive-or ( temp int) +0:12 Convert int8_t to int ( temp int) +0:12 'a' ( in int8_t) +0:12 subtract ( temp int) +0:12 Convert int16_t to int ( temp int) +0:12 'b' ( in int16_t) +0:12 'c' ( in int) +0:15 Function Definition: func(i1;i1;i1; ( global int64_t) +0:15 Function Parameters: +0:15 'a' ( in int) +0:15 'b' ( in int) +0:15 'c' ( in int) +0:17 Sequence +0:17 Branch: Return with expression +0:17 Convert int to int64 ( temp int64_t) +0:17 add ( temp int) +0:17 divide ( temp int) +0:17 'a' ( in int) +0:17 'b' ( in int) +0:17 'c' ( in int) +0:20 Function Definition: func(f161;f161;f1; ( global int64_t) +0:20 Function Parameters: +0:20 'a' ( in float16_t) +0:20 'b' ( in float16_t) +0:20 'c' ( in float) +0:22 Sequence +0:22 Branch: Return with expression +0:22 Convert float to int64 ( temp int64_t) +0:22 subtract ( temp float) +0:22 Convert float16_t to float ( temp float) +0:22 'a' ( in float16_t) +0:22 component-wise multiply ( temp float) +0:22 Convert float16_t to float ( temp float) +0:22 'b' ( in float16_t) +0:22 'c' ( in float) +0:25 Function Definition: func(f161;i161;f1; ( global int64_t) +0:25 Function Parameters: +0:25 'a' ( in float16_t) +0:25 'b' ( in int16_t) +0:25 'c' ( in float) +0:27 Sequence +0:27 Branch: Return with expression +0:27 Convert float to int64 ( temp int64_t) +0:27 subtract ( temp float) +0:27 Convert float16_t to float ( temp float) +0:27 'a' ( in float16_t) +0:27 component-wise multiply ( temp float) +0:27 Convert int16_t to float ( temp float) +0:27 'b' ( in int16_t) +0:27 'c' ( in float) +0:30 Function Definition: main( ( global void) +0:30 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp int64_t) +0:38 'b1' ( temp int64_t) +0:38 Function Call: func(i81;i161;i1; ( global int64_t) +0:38 'x' ( temp int8_t) +0:38 'y' ( temp int16_t) +0:38 'z' ( temp int) +0:39 Sequence +0:39 move second child to first child ( temp int64_t) +0:39 'b2' ( temp int64_t) +0:39 Function Call: func(f161;i161;f1; ( global int64_t) +0:39 Convert int16_t to float16_t ( temp float16_t) +0:39 'y' ( temp int16_t) +0:39 'y' ( temp int16_t) +0:39 Convert int to float ( temp float) +0:39 'z' ( temp int) +0:42 Sequence +0:42 move second child to first child ( temp int64_t) +0:42 'b5' ( temp int64_t) +0:42 Function Call: func(f161;i161;f1; ( global int64_t) +0:42 Convert int16_t to float16_t ( temp float16_t) +0:42 'y' ( temp int16_t) +0:42 'y' ( temp int16_t) +0:42 Convert float16_t to float ( temp float) +0:42 'f16' ( temp float16_t) +0:43 Sequence +0:43 move second child to first child ( temp int64_t) +0:43 'b7' ( temp int64_t) +0:43 Function Call: func(f161;f161;f1; ( global int64_t) +0:43 'f16' ( temp float16_t) +0:43 'f16' ( temp float16_t) +0:43 Convert int16_t to float ( temp float) +0:43 'y' ( temp int16_t) +0:45 Sequence +0:45 move second child to first child ( temp int64_t) +0:45 'b9' ( temp int64_t) +0:45 Function Call: func(f161;f161;f1; ( global int64_t) +0:45 'f16' ( temp float16_t) +0:45 Convert int8_t to float16_t ( temp float16_t) +0:45 'x' ( temp int8_t) +0:45 Convert float16_t to float ( temp float) +0:45 'f16' ( temp float16_t) +0:? Linker Objects + + +Linked fragment stage: + + +Shader version: 450 +Requested GL_KHX_shader_explicit_arithmetic_types +ERROR: node is still EOpNull! +0:10 Function Definition: func(i81;i161;i1; ( global int64_t) +0:10 Function Parameters: +0:10 'a' ( in int8_t) +0:10 'b' ( in int16_t) +0:10 'c' ( in int) +0:12 Sequence +0:12 Branch: Return with expression +0:12 Convert int to int64 ( temp int64_t) +0:12 inclusive-or ( temp int) +0:12 Convert int8_t to int ( temp int) +0:12 'a' ( in int8_t) +0:12 subtract ( temp int) +0:12 Convert int16_t to int ( temp int) +0:12 'b' ( in int16_t) +0:12 'c' ( in int) +0:20 Function Definition: func(f161;f161;f1; ( global int64_t) +0:20 Function Parameters: +0:20 'a' ( in float16_t) +0:20 'b' ( in float16_t) +0:20 'c' ( in float) +0:22 Sequence +0:22 Branch: Return with expression +0:22 Convert float to int64 ( temp int64_t) +0:22 subtract ( temp float) +0:22 Convert float16_t to float ( temp float) +0:22 'a' ( in float16_t) +0:22 component-wise multiply ( temp float) +0:22 Convert float16_t to float ( temp float) +0:22 'b' ( in float16_t) +0:22 'c' ( in float) +0:25 Function Definition: func(f161;i161;f1; ( global int64_t) +0:25 Function Parameters: +0:25 'a' ( in float16_t) +0:25 'b' ( in int16_t) +0:25 'c' ( in float) +0:27 Sequence +0:27 Branch: Return with expression +0:27 Convert float to int64 ( temp int64_t) +0:27 subtract ( temp float) +0:27 Convert float16_t to float ( temp float) +0:27 'a' ( in float16_t) +0:27 component-wise multiply ( temp float) +0:27 Convert int16_t to float ( temp float) +0:27 'b' ( in int16_t) +0:27 'c' ( in float) +0:30 Function Definition: main( ( global void) +0:30 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp int64_t) +0:38 'b1' ( temp int64_t) +0:38 Function Call: func(i81;i161;i1; ( global int64_t) +0:38 'x' ( temp int8_t) +0:38 'y' ( temp int16_t) +0:38 'z' ( temp int) +0:39 Sequence +0:39 move second child to first child ( temp int64_t) +0:39 'b2' ( temp int64_t) +0:39 Function Call: func(f161;i161;f1; ( global int64_t) +0:39 Convert int16_t to float16_t ( temp float16_t) +0:39 'y' ( temp int16_t) +0:39 'y' ( temp int16_t) +0:39 Convert int to float ( temp float) +0:39 'z' ( temp int) +0:42 Sequence +0:42 move second child to first child ( temp int64_t) +0:42 'b5' ( temp int64_t) +0:42 Function Call: func(f161;i161;f1; ( global int64_t) +0:42 Convert int16_t to float16_t ( temp float16_t) +0:42 'y' ( temp int16_t) +0:42 'y' ( temp int16_t) +0:42 Convert float16_t to float ( temp float) +0:42 'f16' ( temp float16_t) +0:43 Sequence +0:43 move second child to first child ( temp int64_t) +0:43 'b7' ( temp int64_t) +0:43 Function Call: func(f161;f161;f1; ( global int64_t) +0:43 'f16' ( temp float16_t) +0:43 'f16' ( temp float16_t) +0:43 Convert int16_t to float ( temp float) +0:43 'y' ( temp int16_t) +0:45 Sequence +0:45 move second child to first child ( temp int64_t) +0:45 'b9' ( temp int64_t) +0:45 Function Call: func(f161;f161;f1; ( global int64_t) +0:45 'f16' ( temp float16_t) +0:45 Convert int8_t to float16_t ( temp float16_t) +0:45 'x' ( temp int8_t) +0:45 Convert float16_t to float ( temp float) +0:45 'f16' ( temp float16_t) +0:? Linker Objects + diff --git a/deps/glslang/Test/baseResults/flowControl.frag.out b/deps/glslang/Test/baseResults/flowControl.frag.out new file mode 100644 index 00000000..4f5fc8bc --- /dev/null +++ b/deps/glslang/Test/baseResults/flowControl.frag.out @@ -0,0 +1,81 @@ +flowControl.frag +Shader version: 120 +0:? Sequence +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:12 'color' ( temp 4-component vector of float) +0:12 'BaseColor' ( smooth in 4-component vector of float) +0:15 move second child to first child ( temp 4-component vector of float) +0:15 'color2' ( temp 4-component vector of float) +0:15 'otherColor' ( uniform 4-component vector of float) +0:17 Test condition and select ( temp void) +0:17 Condition +0:17 Compare Greater Than ( temp bool) +0:17 'c' ( smooth in float) +0:17 'd' ( uniform float) +0:17 true case +0:18 add second child into first child ( temp 4-component vector of float) +0:18 'color' ( temp 4-component vector of float) +0:18 'bigColor' ( uniform 4-component vector of float) +0:17 false case +0:20 add second child into first child ( temp 4-component vector of float) +0:20 'color' ( temp 4-component vector of float) +0:20 'smallColor' ( uniform 4-component vector of float) +0:22 move second child to first child ( temp 4-component vector of float) +0:22 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:22 component-wise multiply ( temp 4-component vector of float) +0:22 'color' ( temp 4-component vector of float) +0:22 'color2' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'd' ( uniform float) +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'smallColor' ( uniform 4-component vector of float) +0:? 'otherColor' ( uniform 4-component vector of float) +0:? 'c' ( smooth in float) +0:? 'BaseColor' ( smooth in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 120 +0:? Sequence +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:12 'color' ( temp 4-component vector of float) +0:12 'BaseColor' ( smooth in 4-component vector of float) +0:15 move second child to first child ( temp 4-component vector of float) +0:15 'color2' ( temp 4-component vector of float) +0:15 'otherColor' ( uniform 4-component vector of float) +0:17 Test condition and select ( temp void) +0:17 Condition +0:17 Compare Greater Than ( temp bool) +0:17 'c' ( smooth in float) +0:17 'd' ( uniform float) +0:17 true case +0:18 add second child into first child ( temp 4-component vector of float) +0:18 'color' ( temp 4-component vector of float) +0:18 'bigColor' ( uniform 4-component vector of float) +0:17 false case +0:20 add second child into first child ( temp 4-component vector of float) +0:20 'color' ( temp 4-component vector of float) +0:20 'smallColor' ( uniform 4-component vector of float) +0:22 move second child to first child ( temp 4-component vector of float) +0:22 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:22 component-wise multiply ( temp 4-component vector of float) +0:22 'color' ( temp 4-component vector of float) +0:22 'color2' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'd' ( uniform float) +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'smallColor' ( uniform 4-component vector of float) +0:? 'otherColor' ( uniform 4-component vector of float) +0:? 'c' ( smooth in float) +0:? 'BaseColor' ( smooth in 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/forLoop.frag.out b/deps/glslang/Test/baseResults/forLoop.frag.out new file mode 100644 index 00000000..e6a15178 --- /dev/null +++ b/deps/glslang/Test/baseResults/forLoop.frag.out @@ -0,0 +1,361 @@ +forLoop.frag +Shader version: 130 +0:? Sequence +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:12 'color' ( temp 4-component vector of float) +0:12 'BaseColor' ( smooth in 4-component vector of float) +0:14 Sequence +0:14 Sequence +0:14 move second child to first child ( temp int) +0:14 'i' ( temp int) +0:14 Constant: +0:14 0 (const int) +0:14 Loop with condition tested first +0:14 Loop Condition +0:14 Compare Less Than ( temp bool) +0:14 'i' ( temp int) +0:14 'Count' ( uniform int) +0:14 Loop Body +0:15 Sequence +0:15 add second child into first child ( temp 4-component vector of float) +0:15 'color' ( temp 4-component vector of float) +0:15 'bigColor' ( uniform 4-component vector of float) +0:14 Loop Terminal Expression +0:14 Pre-Increment ( temp int) +0:14 'i' ( temp int) +0:18 move second child to first child ( temp 4-component vector of float) +0:18 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:18 'color' ( temp 4-component vector of float) +0:20 Sequence +0:20 move second child to first child ( temp float) +0:20 'sum' ( temp float) +0:20 Constant: +0:20 0.000000 +0:21 Sequence +0:21 Sequence +0:21 move second child to first child ( temp int) +0:21 'i' ( temp int) +0:21 Constant: +0:21 0 (const int) +0:21 Loop with condition tested first +0:21 Loop Condition +0:21 Compare Less Than ( temp bool) +0:21 'i' ( temp int) +0:21 Constant: +0:21 4 (const int) +0:21 Loop Body +0:22 add second child into first child ( temp float) +0:22 'sum' ( temp float) +0:22 Convert uint to float ( temp float) +0:22 indirect index ( temp uint) +0:22 'v4' ( uniform 4-component vector of uint) +0:22 'i' ( temp int) +0:21 Loop Terminal Expression +0:21 Pre-Increment ( temp int) +0:21 'i' ( temp int) +0:26 Sequence +0:26 Sequence +0:26 move second child to first child ( temp int) +0:26 'i' ( temp int) +0:26 Constant: +0:26 0 (const int) +0:26 Loop with condition tested first +0:26 Loop Condition +0:26 Compare Less Than ( temp bool) +0:26 'i' ( temp int) +0:26 Constant: +0:26 4 (const int) +0:26 Loop Body +0:27 move second child to first child ( temp float) +0:27 indirect index ( temp float) +0:27 'tv4' ( temp 4-component vector of float) +0:27 'i' ( temp int) +0:27 Convert uint to float ( temp float) +0:27 component-wise multiply ( temp uint) +0:27 indirect index ( temp uint) +0:27 'v4' ( uniform 4-component vector of uint) +0:27 'i' ( temp int) +0:27 Constant: +0:27 4 (const uint) +0:26 Loop Terminal Expression +0:26 Pre-Increment ( temp int) +0:26 'i' ( temp int) +0:29 add second child into first child ( temp 4-component vector of float) +0:29 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:29 add ( temp 4-component vector of float) +0:29 Construct vec4 ( temp 4-component vector of float) +0:29 'sum' ( temp float) +0:29 'tv4' ( temp 4-component vector of float) +0:32 move second child to first child ( temp 3-component vector of float) +0:32 vector swizzle ( temp 3-component vector of float) +0:32 'r' ( temp 4-component vector of float) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 vector swizzle ( temp 3-component vector of float) +0:32 'BaseColor' ( smooth in 4-component vector of float) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:34 Sequence +0:34 Sequence +0:34 move second child to first child ( temp int) +0:34 'i' ( temp int) +0:34 Constant: +0:34 0 (const int) +0:34 Loop with condition tested first +0:34 Loop Condition +0:34 Compare Less Than ( temp bool) +0:34 'i' ( temp int) +0:34 'Count' ( uniform int) +0:34 Loop Body +0:35 move second child to first child ( temp float) +0:35 direct index ( temp float) +0:35 'r' ( temp 4-component vector of float) +0:35 Constant: +0:35 3 (const int) +0:35 'f' ( smooth in float) +0:34 Loop Terminal Expression +0:34 Pre-Increment ( temp int) +0:34 'i' ( temp int) +0:37 add second child into first child ( temp 3-component vector of float) +0:37 vector swizzle ( temp 3-component vector of float) +0:37 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 vector swizzle ( temp 3-component vector of float) +0:37 'r' ( temp 4-component vector of float) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:39 Sequence +0:39 Sequence +0:39 move second child to first child ( temp int) +0:39 'i' ( temp int) +0:39 Constant: +0:39 0 (const int) +0:39 Loop with condition tested first +0:39 Loop Condition +0:39 Compare Less Than ( temp bool) +0:39 'i' ( temp int) +0:39 Constant: +0:39 16 (const int) +0:39 Loop Body +0:40 vector scale second child into first child ( temp 4-component vector of float) +0:40 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:40 'f' ( smooth in float) +0:39 Loop Terminal Expression +0:39 add second child into first child ( temp int) +0:39 'i' ( temp int) +0:39 Constant: +0:39 4 (const int) +0:? Linker Objects +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'f' ( smooth in float) +0:? 'Count' ( uniform int) +0:? 'v4' ( uniform 4-component vector of uint) + + +Linked fragment stage: + + +Shader version: 130 +0:? Sequence +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:12 'color' ( temp 4-component vector of float) +0:12 'BaseColor' ( smooth in 4-component vector of float) +0:14 Sequence +0:14 Sequence +0:14 move second child to first child ( temp int) +0:14 'i' ( temp int) +0:14 Constant: +0:14 0 (const int) +0:14 Loop with condition tested first +0:14 Loop Condition +0:14 Compare Less Than ( temp bool) +0:14 'i' ( temp int) +0:14 'Count' ( uniform int) +0:14 Loop Body +0:15 Sequence +0:15 add second child into first child ( temp 4-component vector of float) +0:15 'color' ( temp 4-component vector of float) +0:15 'bigColor' ( uniform 4-component vector of float) +0:14 Loop Terminal Expression +0:14 Pre-Increment ( temp int) +0:14 'i' ( temp int) +0:18 move second child to first child ( temp 4-component vector of float) +0:18 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:18 'color' ( temp 4-component vector of float) +0:20 Sequence +0:20 move second child to first child ( temp float) +0:20 'sum' ( temp float) +0:20 Constant: +0:20 0.000000 +0:21 Sequence +0:21 Sequence +0:21 move second child to first child ( temp int) +0:21 'i' ( temp int) +0:21 Constant: +0:21 0 (const int) +0:21 Loop with condition tested first +0:21 Loop Condition +0:21 Compare Less Than ( temp bool) +0:21 'i' ( temp int) +0:21 Constant: +0:21 4 (const int) +0:21 Loop Body +0:22 add second child into first child ( temp float) +0:22 'sum' ( temp float) +0:22 Convert uint to float ( temp float) +0:22 indirect index ( temp uint) +0:22 'v4' ( uniform 4-component vector of uint) +0:22 'i' ( temp int) +0:21 Loop Terminal Expression +0:21 Pre-Increment ( temp int) +0:21 'i' ( temp int) +0:26 Sequence +0:26 Sequence +0:26 move second child to first child ( temp int) +0:26 'i' ( temp int) +0:26 Constant: +0:26 0 (const int) +0:26 Loop with condition tested first +0:26 Loop Condition +0:26 Compare Less Than ( temp bool) +0:26 'i' ( temp int) +0:26 Constant: +0:26 4 (const int) +0:26 Loop Body +0:27 move second child to first child ( temp float) +0:27 indirect index ( temp float) +0:27 'tv4' ( temp 4-component vector of float) +0:27 'i' ( temp int) +0:27 Convert uint to float ( temp float) +0:27 component-wise multiply ( temp uint) +0:27 indirect index ( temp uint) +0:27 'v4' ( uniform 4-component vector of uint) +0:27 'i' ( temp int) +0:27 Constant: +0:27 4 (const uint) +0:26 Loop Terminal Expression +0:26 Pre-Increment ( temp int) +0:26 'i' ( temp int) +0:29 add second child into first child ( temp 4-component vector of float) +0:29 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:29 add ( temp 4-component vector of float) +0:29 Construct vec4 ( temp 4-component vector of float) +0:29 'sum' ( temp float) +0:29 'tv4' ( temp 4-component vector of float) +0:32 move second child to first child ( temp 3-component vector of float) +0:32 vector swizzle ( temp 3-component vector of float) +0:32 'r' ( temp 4-component vector of float) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 vector swizzle ( temp 3-component vector of float) +0:32 'BaseColor' ( smooth in 4-component vector of float) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:34 Sequence +0:34 Sequence +0:34 move second child to first child ( temp int) +0:34 'i' ( temp int) +0:34 Constant: +0:34 0 (const int) +0:34 Loop with condition tested first +0:34 Loop Condition +0:34 Compare Less Than ( temp bool) +0:34 'i' ( temp int) +0:34 'Count' ( uniform int) +0:34 Loop Body +0:35 move second child to first child ( temp float) +0:35 direct index ( temp float) +0:35 'r' ( temp 4-component vector of float) +0:35 Constant: +0:35 3 (const int) +0:35 'f' ( smooth in float) +0:34 Loop Terminal Expression +0:34 Pre-Increment ( temp int) +0:34 'i' ( temp int) +0:37 add second child into first child ( temp 3-component vector of float) +0:37 vector swizzle ( temp 3-component vector of float) +0:37 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 vector swizzle ( temp 3-component vector of float) +0:37 'r' ( temp 4-component vector of float) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:39 Sequence +0:39 Sequence +0:39 move second child to first child ( temp int) +0:39 'i' ( temp int) +0:39 Constant: +0:39 0 (const int) +0:39 Loop with condition tested first +0:39 Loop Condition +0:39 Compare Less Than ( temp bool) +0:39 'i' ( temp int) +0:39 Constant: +0:39 16 (const int) +0:39 Loop Body +0:40 vector scale second child into first child ( temp 4-component vector of float) +0:40 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:40 'f' ( smooth in float) +0:39 Loop Terminal Expression +0:39 add second child into first child ( temp int) +0:39 'i' ( temp int) +0:39 Constant: +0:39 4 (const int) +0:? Linker Objects +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'f' ( smooth in float) +0:? 'Count' ( uniform int) +0:? 'v4' ( uniform 4-component vector of uint) + diff --git a/deps/glslang/Test/baseResults/forwardRef.frag.out b/deps/glslang/Test/baseResults/forwardRef.frag.out new file mode 100644 index 00000000..22e77c5b --- /dev/null +++ b/deps/glslang/Test/baseResults/forwardRef.frag.out @@ -0,0 +1,125 @@ +forwardRef.frag +Shader version: 110 +0:? Sequence +0:11 Function Definition: main( ( global void) +0:11 Function Parameters: +0:13 Sequence +0:13 Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 'color' ( temp 4-component vector of float) +0:13 Construct vec4 ( temp 4-component vector of float) +0:13 Function Call: foo(vf4; ( global float) +0:13 'BaseColor' ( smooth in 4-component vector of float) +0:15 Function Call: bar( ( global void) +0:16 Sequence +0:16 move second child to first child ( temp float) +0:16 'f' ( temp float) +0:16 Function Call: unreachableReturn( ( global float) +0:18 move second child to first child ( temp 4-component vector of float) +0:18 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:18 vector-scale ( temp 4-component vector of float) +0:18 'color' ( temp 4-component vector of float) +0:18 'f' ( temp float) +0:21 Function Definition: bar( ( global void) +0:21 Function Parameters: +0:25 Function Definition: unreachableReturn( ( global float) +0:25 Function Parameters: +0:27 Sequence +0:27 Function Call: bar( ( global void) +0:28 Test condition and select ( temp void) +0:28 Condition +0:28 Compare Less Than ( temp bool) +0:28 'd' ( uniform float) +0:28 Constant: +0:28 4.200000 +0:28 true case +0:29 Branch: Return with expression +0:29 Constant: +0:29 1.200000 +0:28 false case +0:31 Branch: Return with expression +0:31 Constant: +0:31 4.500000 +0:34 Function Definition: foo(vf4; ( global float) +0:34 Function Parameters: +0:34 'bar' ( in 4-component vector of float) +0:36 Sequence +0:36 Branch: Return with expression +0:36 add ( temp float) +0:36 direct index ( temp float) +0:36 'bar' ( in 4-component vector of float) +0:36 Constant: +0:36 0 (const int) +0:36 direct index ( temp float) +0:36 'bar' ( in 4-component vector of float) +0:36 Constant: +0:36 1 (const int) +0:? Linker Objects +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'd' ( uniform float) + + +Linked fragment stage: + + +Shader version: 110 +0:? Sequence +0:11 Function Definition: main( ( global void) +0:11 Function Parameters: +0:13 Sequence +0:13 Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 'color' ( temp 4-component vector of float) +0:13 Construct vec4 ( temp 4-component vector of float) +0:13 Function Call: foo(vf4; ( global float) +0:13 'BaseColor' ( smooth in 4-component vector of float) +0:15 Function Call: bar( ( global void) +0:16 Sequence +0:16 move second child to first child ( temp float) +0:16 'f' ( temp float) +0:16 Function Call: unreachableReturn( ( global float) +0:18 move second child to first child ( temp 4-component vector of float) +0:18 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:18 vector-scale ( temp 4-component vector of float) +0:18 'color' ( temp 4-component vector of float) +0:18 'f' ( temp float) +0:21 Function Definition: bar( ( global void) +0:21 Function Parameters: +0:25 Function Definition: unreachableReturn( ( global float) +0:25 Function Parameters: +0:27 Sequence +0:27 Function Call: bar( ( global void) +0:28 Test condition and select ( temp void) +0:28 Condition +0:28 Compare Less Than ( temp bool) +0:28 'd' ( uniform float) +0:28 Constant: +0:28 4.200000 +0:28 true case +0:29 Branch: Return with expression +0:29 Constant: +0:29 1.200000 +0:28 false case +0:31 Branch: Return with expression +0:31 Constant: +0:31 4.500000 +0:34 Function Definition: foo(vf4; ( global float) +0:34 Function Parameters: +0:34 'bar' ( in 4-component vector of float) +0:36 Sequence +0:36 Branch: Return with expression +0:36 add ( temp float) +0:36 direct index ( temp float) +0:36 'bar' ( in 4-component vector of float) +0:36 Constant: +0:36 0 (const int) +0:36 direct index ( temp float) +0:36 'bar' ( in 4-component vector of float) +0:36 Constant: +0:36 1 (const int) +0:? Linker Objects +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'd' ( uniform float) + diff --git a/deps/glslang/Test/baseResults/functionCall.frag.out b/deps/glslang/Test/baseResults/functionCall.frag.out new file mode 100644 index 00000000..902208ff --- /dev/null +++ b/deps/glslang/Test/baseResults/functionCall.frag.out @@ -0,0 +1,183 @@ +functionCall.frag +WARNING: 0:4: varying deprecated in version 130; may be removed in future release + +Shader version: 130 +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp float) +0:7 'h' ( global float) +0:7 Constant: +0:7 0.000000 +0:9 Function Definition: foo(vf4; ( global float) +0:9 Function Parameters: +0:9 'bar' ( in 4-component vector of float) +0:11 Sequence +0:11 Branch: Return with expression +0:11 add ( temp float) +0:11 direct index ( temp float) +0:11 'bar' ( in 4-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( temp float) +0:11 'bar' ( in 4-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:14 Function Definition: bar( ( global void) +0:14 Function Parameters: +0:18 Function Definition: unreachableReturn( ( global float) +0:18 Function Parameters: +0:20 Sequence +0:20 Test condition and select ( temp void) +0:20 Condition +0:20 Compare Less Than ( temp bool) +0:20 'd' ( uniform float) +0:20 Constant: +0:20 4.200000 +0:20 true case +0:21 Branch: Return with expression +0:21 Constant: +0:21 1.200000 +0:20 false case +0:23 Branch: Return with expression +0:23 Constant: +0:23 4.500000 +0:27 Function Definition: missingReturn( ( global float) +0:27 Function Parameters: +0:29 Sequence +0:29 Test condition and select ( temp void) +0:29 Condition +0:29 Compare Less Than ( temp bool) +0:29 'd' ( uniform float) +0:29 Constant: +0:29 4.500000 +0:29 true case +0:30 Sequence +0:30 move second child to first child ( temp float) +0:30 'h' ( global float) +0:30 'd' ( uniform float) +0:31 Branch: Return with expression +0:31 Constant: +0:31 3.900000 +0:35 Function Definition: main( ( global void) +0:35 Function Parameters: +0:37 Sequence +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of float) +0:37 'color' ( temp 4-component vector of float) +0:37 Construct vec4 ( temp 4-component vector of float) +0:37 Function Call: foo(vf4; ( global float) +0:37 'BaseColor' ( smooth in 4-component vector of float) +0:39 Function Call: bar( ( global void) +0:40 Sequence +0:40 move second child to first child ( temp float) +0:40 'f' ( temp float) +0:40 Function Call: unreachableReturn( ( global float) +0:41 Sequence +0:41 move second child to first child ( temp float) +0:41 'g' ( temp float) +0:41 Function Call: missingReturn( ( global float) +0:43 move second child to first child ( temp 4-component vector of float) +0:43 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:43 vector-scale ( temp 4-component vector of float) +0:43 vector-scale ( temp 4-component vector of float) +0:43 'color' ( temp 4-component vector of float) +0:43 'f' ( temp float) +0:43 'h' ( global float) +0:? Linker Objects +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'd' ( uniform float) +0:? 'h' ( global float) + + +Linked fragment stage: + + +Shader version: 130 +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp float) +0:7 'h' ( global float) +0:7 Constant: +0:7 0.000000 +0:9 Function Definition: foo(vf4; ( global float) +0:9 Function Parameters: +0:9 'bar' ( in 4-component vector of float) +0:11 Sequence +0:11 Branch: Return with expression +0:11 add ( temp float) +0:11 direct index ( temp float) +0:11 'bar' ( in 4-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( temp float) +0:11 'bar' ( in 4-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:14 Function Definition: bar( ( global void) +0:14 Function Parameters: +0:18 Function Definition: unreachableReturn( ( global float) +0:18 Function Parameters: +0:20 Sequence +0:20 Test condition and select ( temp void) +0:20 Condition +0:20 Compare Less Than ( temp bool) +0:20 'd' ( uniform float) +0:20 Constant: +0:20 4.200000 +0:20 true case +0:21 Branch: Return with expression +0:21 Constant: +0:21 1.200000 +0:20 false case +0:23 Branch: Return with expression +0:23 Constant: +0:23 4.500000 +0:27 Function Definition: missingReturn( ( global float) +0:27 Function Parameters: +0:29 Sequence +0:29 Test condition and select ( temp void) +0:29 Condition +0:29 Compare Less Than ( temp bool) +0:29 'd' ( uniform float) +0:29 Constant: +0:29 4.500000 +0:29 true case +0:30 Sequence +0:30 move second child to first child ( temp float) +0:30 'h' ( global float) +0:30 'd' ( uniform float) +0:31 Branch: Return with expression +0:31 Constant: +0:31 3.900000 +0:35 Function Definition: main( ( global void) +0:35 Function Parameters: +0:37 Sequence +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of float) +0:37 'color' ( temp 4-component vector of float) +0:37 Construct vec4 ( temp 4-component vector of float) +0:37 Function Call: foo(vf4; ( global float) +0:37 'BaseColor' ( smooth in 4-component vector of float) +0:39 Function Call: bar( ( global void) +0:40 Sequence +0:40 move second child to first child ( temp float) +0:40 'f' ( temp float) +0:40 Function Call: unreachableReturn( ( global float) +0:41 Sequence +0:41 move second child to first child ( temp float) +0:41 'g' ( temp float) +0:41 Function Call: missingReturn( ( global float) +0:43 move second child to first child ( temp 4-component vector of float) +0:43 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:43 vector-scale ( temp 4-component vector of float) +0:43 vector-scale ( temp 4-component vector of float) +0:43 'color' ( temp 4-component vector of float) +0:43 'f' ( temp float) +0:43 'h' ( global float) +0:? Linker Objects +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'd' ( uniform float) +0:? 'h' ( global float) + diff --git a/deps/glslang/Test/baseResults/functionSemantics.frag.out b/deps/glslang/Test/baseResults/functionSemantics.frag.out new file mode 100644 index 00000000..d04e6e7a --- /dev/null +++ b/deps/glslang/Test/baseResults/functionSemantics.frag.out @@ -0,0 +1,401 @@ +functionSemantics.frag +ERROR: 0:74: 'return' : cannot convert return value to function return type +WARNING: 0:74: 'return' : type conversion on return values was not explicitly allowed until version 420 +ERROR: 1 compilation errors. No code generated. + + +Shader version: 400 +ERROR: node is still EOpNull! +0:5 Function Definition: foo(i1;i1;i1;i1;i1;i1; ( global int) +0:5 Function Parameters: +0:5 'a' ( in int) +0:5 'b' ( const (read only) int) +0:5 'c' ( in int) +0:5 'd' ( const (read only) int) +0:5 'e' ( out int) +0:5 'f' ( inout int) +0:7 Sequence +0:7 Sequence +0:7 move second child to first child ( temp int) +0:7 'sum' ( temp int) +0:7 add ( temp int) +0:7 add ( temp int) +0:7 add ( temp int) +0:7 add ( temp int) +0:7 'a' ( in int) +0:7 'b' ( const (read only) int) +0:7 'c' ( in int) +0:7 'd' ( const (read only) int) +0:7 'f' ( inout int) +0:10 multiply second child into first child ( temp int) +0:10 'a' ( in int) +0:10 Constant: +0:10 64 (const int) +0:12 multiply second child into first child ( temp int) +0:12 'c' ( in int) +0:12 Constant: +0:12 64 (const int) +0:14 move second child to first child ( temp int) +0:14 'e' ( out int) +0:14 Constant: +0:14 1024 (const int) +0:15 multiply second child into first child ( temp int) +0:15 'f' ( inout int) +0:15 Constant: +0:15 64 (const int) +0:17 add second child into first child ( temp int) +0:17 'sum' ( temp int) +0:17 add ( temp int) +0:17 add ( temp int) +0:17 add ( temp int) +0:17 add ( temp int) +0:17 add ( temp int) +0:17 'a' ( in int) +0:17 component-wise multiply ( temp int) +0:17 Constant: +0:17 64 (const int) +0:17 'b' ( const (read only) int) +0:17 'c' ( in int) +0:17 component-wise multiply ( temp int) +0:17 Constant: +0:17 64 (const int) +0:17 'd' ( const (read only) int) +0:17 'e' ( out int) +0:17 'f' ( inout int) +0:20 Branch: Return with expression +0:20 'sum' ( temp int) +0:23 Function Definition: foo2(f1;vf3;i1; ( global int) +0:23 Function Parameters: +0:23 'a' ( in float) +0:23 'b' ( in 3-component vector of float) +0:23 'r' ( out int) +0:25 Sequence +0:25 move second child to first child ( temp int) +0:25 'r' ( out int) +0:25 Convert float to int ( temp int) +0:25 component-wise multiply ( temp float) +0:25 Constant: +0:25 3.000000 +0:25 'a' ( in float) +0:26 Branch: Return with expression +0:26 Convert float to int ( temp int) +0:26 component-wise multiply ( temp float) +0:26 Constant: +0:26 5.000000 +0:26 direct index ( temp float) +0:26 'b' ( in 3-component vector of float) +0:26 Constant: +0:26 1 (const int) +0:29 Function Definition: foo3( ( global int) +0:29 Function Parameters: +0:31 Sequence +0:31 Test condition and select ( temp void) +0:31 Condition +0:31 Compare Greater Than ( temp bool) +0:31 'u' ( uniform float) +0:31 Constant: +0:31 3.200000 +0:31 true case +0:32 Sequence +0:32 Branch: Kill +0:33 Branch: Return with expression +0:33 Constant: +0:33 1000000 (const int) +0:36 Branch: Return with expression +0:36 Constant: +0:36 2000000 (const int) +0:39 Function Definition: main( ( global void) +0:39 Function Parameters: +0:? Sequence +0:42 Sequence +0:42 move second child to first child ( temp int) +0:42 't' ( temp int) +0:42 Constant: +0:42 2 (const int) +0:46 move second child to first child ( temp int) +0:46 direct index ( temp int) +0:46 t: direct index for structure ( temp 4-component vector of int) +0:46 'f' ( temp structure{ temp 4-component vector of int t}) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 32 (const int) +0:49 Sequence +0:49 move second child to first child ( temp int) +0:49 'color' ( temp int) +0:49 Function Call: foo(i1;i1;i1;i1;i1;i1; ( global int) +0:49 Constant: +0:49 1 (const int) +0:49 Constant: +0:49 2 (const int) +0:49 add ( temp int) +0:49 't' ( temp int) +0:49 't' ( temp int) +0:49 Constant: +0:49 8 (const int) +0:49 'e' ( temp int) +0:49 direct index ( temp int) +0:49 t: direct index for structure ( temp 4-component vector of int) +0:49 'f' ( temp structure{ temp 4-component vector of int t}) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 1 (const int) +0:51 add second child into first child ( temp int) +0:51 'color' ( temp int) +0:51 component-wise multiply ( temp int) +0:51 Constant: +0:51 128 (const int) +0:51 add ( temp int) +0:51 'e' ( temp int) +0:51 direct index ( temp int) +0:51 t: direct index for structure ( temp 4-component vector of int) +0:51 'f' ( temp structure{ temp 4-component vector of int t}) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:57 move second child to first child ( temp float) +0:57 'ret' ( temp float) +0:57 Convert int to float ( temp float) +0:57 Comma ( global int) +0:57 move second child to first child ( temp int) +0:57 'tempReturn' ( global int) +0:57 Function Call: foo2(f1;vf3;i1; ( global int) +0:57 Constant: +0:57 4.000000 +0:57 Constant: +0:57 1.000000 +0:57 2.000000 +0:57 3.000000 +0:57 'tempArg' ( temp int) +0:57 move second child to first child ( temp float) +0:57 'arg' ( temp float) +0:57 Convert int to float ( temp float) +0:57 'tempArg' ( temp int) +0:57 'tempReturn' ( global int) +0:58 add second child into first child ( temp int) +0:58 'color' ( temp int) +0:58 Convert float to int ( temp int) +0:58 add ( temp float) +0:58 'ret' ( temp float) +0:58 'arg' ( temp float) +0:60 add second child into first child ( temp int) +0:60 'color' ( temp int) +0:60 Function Call: foo3( ( global int) +0:62 move second child to first child ( temp 4-component vector of float) +0:62 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:62 Construct vec4 ( temp 4-component vector of float) +0:62 Convert int to float ( temp float) +0:62 'color' ( temp int) +0:66 Function Definition: aggCall( ( global void) +0:66 Function Parameters: +0:? Sequence +0:69 Function Call: m(vf2; ( global 3-component vector of float) +0:69 Convert int to float ( temp 2-component vector of float) +0:69 Construct ivec2 ( temp 2-component vector of int) +0:69 Convert float to int ( temp int) +0:69 'F' ( temp float) +0:72 Function Definition: badConv( ( global 4-component vector of float) +0:72 Function Parameters: +0:74 Sequence +0:74 Branch: Return with expression +0:74 'u' ( uniform float) +0:? Linker Objects +0:? 'u' ( uniform float) + + +Linked fragment stage: + + +Shader version: 400 +ERROR: node is still EOpNull! +0:5 Function Definition: foo(i1;i1;i1;i1;i1;i1; ( global int) +0:5 Function Parameters: +0:5 'a' ( in int) +0:5 'b' ( const (read only) int) +0:5 'c' ( in int) +0:5 'd' ( const (read only) int) +0:5 'e' ( out int) +0:5 'f' ( inout int) +0:7 Sequence +0:7 Sequence +0:7 move second child to first child ( temp int) +0:7 'sum' ( temp int) +0:7 add ( temp int) +0:7 add ( temp int) +0:7 add ( temp int) +0:7 add ( temp int) +0:7 'a' ( in int) +0:7 'b' ( const (read only) int) +0:7 'c' ( in int) +0:7 'd' ( const (read only) int) +0:7 'f' ( inout int) +0:10 multiply second child into first child ( temp int) +0:10 'a' ( in int) +0:10 Constant: +0:10 64 (const int) +0:12 multiply second child into first child ( temp int) +0:12 'c' ( in int) +0:12 Constant: +0:12 64 (const int) +0:14 move second child to first child ( temp int) +0:14 'e' ( out int) +0:14 Constant: +0:14 1024 (const int) +0:15 multiply second child into first child ( temp int) +0:15 'f' ( inout int) +0:15 Constant: +0:15 64 (const int) +0:17 add second child into first child ( temp int) +0:17 'sum' ( temp int) +0:17 add ( temp int) +0:17 add ( temp int) +0:17 add ( temp int) +0:17 add ( temp int) +0:17 add ( temp int) +0:17 'a' ( in int) +0:17 component-wise multiply ( temp int) +0:17 Constant: +0:17 64 (const int) +0:17 'b' ( const (read only) int) +0:17 'c' ( in int) +0:17 component-wise multiply ( temp int) +0:17 Constant: +0:17 64 (const int) +0:17 'd' ( const (read only) int) +0:17 'e' ( out int) +0:17 'f' ( inout int) +0:20 Branch: Return with expression +0:20 'sum' ( temp int) +0:23 Function Definition: foo2(f1;vf3;i1; ( global int) +0:23 Function Parameters: +0:23 'a' ( in float) +0:23 'b' ( in 3-component vector of float) +0:23 'r' ( out int) +0:25 Sequence +0:25 move second child to first child ( temp int) +0:25 'r' ( out int) +0:25 Convert float to int ( temp int) +0:25 component-wise multiply ( temp float) +0:25 Constant: +0:25 3.000000 +0:25 'a' ( in float) +0:26 Branch: Return with expression +0:26 Convert float to int ( temp int) +0:26 component-wise multiply ( temp float) +0:26 Constant: +0:26 5.000000 +0:26 direct index ( temp float) +0:26 'b' ( in 3-component vector of float) +0:26 Constant: +0:26 1 (const int) +0:29 Function Definition: foo3( ( global int) +0:29 Function Parameters: +0:31 Sequence +0:31 Test condition and select ( temp void) +0:31 Condition +0:31 Compare Greater Than ( temp bool) +0:31 'u' ( uniform float) +0:31 Constant: +0:31 3.200000 +0:31 true case +0:32 Sequence +0:32 Branch: Kill +0:33 Branch: Return with expression +0:33 Constant: +0:33 1000000 (const int) +0:36 Branch: Return with expression +0:36 Constant: +0:36 2000000 (const int) +0:39 Function Definition: main( ( global void) +0:39 Function Parameters: +0:? Sequence +0:42 Sequence +0:42 move second child to first child ( temp int) +0:42 't' ( temp int) +0:42 Constant: +0:42 2 (const int) +0:46 move second child to first child ( temp int) +0:46 direct index ( temp int) +0:46 t: direct index for structure ( temp 4-component vector of int) +0:46 'f' ( temp structure{ temp 4-component vector of int t}) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 32 (const int) +0:49 Sequence +0:49 move second child to first child ( temp int) +0:49 'color' ( temp int) +0:49 Function Call: foo(i1;i1;i1;i1;i1;i1; ( global int) +0:49 Constant: +0:49 1 (const int) +0:49 Constant: +0:49 2 (const int) +0:49 add ( temp int) +0:49 't' ( temp int) +0:49 't' ( temp int) +0:49 Constant: +0:49 8 (const int) +0:49 'e' ( temp int) +0:49 direct index ( temp int) +0:49 t: direct index for structure ( temp 4-component vector of int) +0:49 'f' ( temp structure{ temp 4-component vector of int t}) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 1 (const int) +0:51 add second child into first child ( temp int) +0:51 'color' ( temp int) +0:51 component-wise multiply ( temp int) +0:51 Constant: +0:51 128 (const int) +0:51 add ( temp int) +0:51 'e' ( temp int) +0:51 direct index ( temp int) +0:51 t: direct index for structure ( temp 4-component vector of int) +0:51 'f' ( temp structure{ temp 4-component vector of int t}) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:57 move second child to first child ( temp float) +0:57 'ret' ( temp float) +0:57 Convert int to float ( temp float) +0:57 Comma ( global int) +0:57 move second child to first child ( temp int) +0:57 'tempReturn' ( global int) +0:57 Function Call: foo2(f1;vf3;i1; ( global int) +0:57 Constant: +0:57 4.000000 +0:57 Constant: +0:57 1.000000 +0:57 2.000000 +0:57 3.000000 +0:57 'tempArg' ( temp int) +0:57 move second child to first child ( temp float) +0:57 'arg' ( temp float) +0:57 Convert int to float ( temp float) +0:57 'tempArg' ( temp int) +0:57 'tempReturn' ( global int) +0:58 add second child into first child ( temp int) +0:58 'color' ( temp int) +0:58 Convert float to int ( temp int) +0:58 add ( temp float) +0:58 'ret' ( temp float) +0:58 'arg' ( temp float) +0:60 add second child into first child ( temp int) +0:60 'color' ( temp int) +0:60 Function Call: foo3( ( global int) +0:62 move second child to first child ( temp 4-component vector of float) +0:62 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:62 Construct vec4 ( temp 4-component vector of float) +0:62 Convert int to float ( temp float) +0:62 'color' ( temp int) +0:? Linker Objects +0:? 'u' ( uniform float) + diff --git a/deps/glslang/Test/baseResults/glsl.-D-U.frag.out b/deps/glslang/Test/baseResults/glsl.-D-U.frag.out new file mode 100644 index 00000000..6538e849 --- /dev/null +++ b/deps/glslang/Test/baseResults/glsl.-D-U.frag.out @@ -0,0 +1,55 @@ +glsl.-D-U.frag +Shader version: 450 +0:? Sequence +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:10 'color' (layout( location=0) out 4-component vector of float) +0:10 Constant: +0:10 1.000000 +0:10 1.000000 +0:10 1.000000 +0:10 1.000000 +0:16 Post-Increment ( temp 4-component vector of float) +0:16 'color' (layout( location=0) out 4-component vector of float) +0:24 vector scale second child into first child ( temp 4-component vector of float) +0:24 'color' (layout( location=0) out 4-component vector of float) +0:24 Constant: +0:24 3.000000 +0:28 vector scale second child into first child ( temp 4-component vector of float) +0:28 'color' (layout( location=0) out 4-component vector of float) +0:28 Constant: +0:28 400.000000 +0:? Linker Objects +0:? 'color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 450 +0:? Sequence +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:10 'color' (layout( location=0) out 4-component vector of float) +0:10 Constant: +0:10 1.000000 +0:10 1.000000 +0:10 1.000000 +0:10 1.000000 +0:16 Post-Increment ( temp 4-component vector of float) +0:16 'color' (layout( location=0) out 4-component vector of float) +0:24 vector scale second child into first child ( temp 4-component vector of float) +0:24 'color' (layout( location=0) out 4-component vector of float) +0:24 Constant: +0:24 3.000000 +0:28 vector scale second child into first child ( temp 4-component vector of float) +0:28 'color' (layout( location=0) out 4-component vector of float) +0:28 Constant: +0:28 400.000000 +0:? Linker Objects +0:? 'color' (layout( location=0) out 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/glsl.entryPointRename.vert.bad.out b/deps/glslang/Test/baseResults/glsl.entryPointRename.vert.bad.out new file mode 100644 index 00000000..c7ea97e0 --- /dev/null +++ b/deps/glslang/Test/baseResults/glsl.entryPointRename.vert.bad.out @@ -0,0 +1,45 @@ +glsl.entryPointRename.vert +ERROR: Source entry point must be "main" + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 20 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "foo" 13 + Source GLSL 460 + Name 4 "foo" + Name 11 "gl_PerVertex" + MemberName 11(gl_PerVertex) 0 "gl_Position" + MemberName 11(gl_PerVertex) 1 "gl_PointSize" + MemberName 11(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 11(gl_PerVertex) 3 "gl_CullDistance" + Name 13 "" + MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 11(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 11(gl_PerVertex) Block + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 0 + 9: 8(int) Constant 1 + 10: TypeArray 6(float) 9 +11(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 10 10 + 12: TypePointer Output 11(gl_PerVertex) + 13: 12(ptr) Variable Output + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16: 6(float) Constant 1065353216 + 17: 7(fvec4) ConstantComposite 16 16 16 16 + 18: TypePointer Output 7(fvec4) + 4(foo): 2 Function None 3 + 5: Label + 19: 18(ptr) AccessChain 13 15 + Store 19 17 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/glsl.entryPointRename.vert.out b/deps/glslang/Test/baseResults/glsl.entryPointRename.vert.out new file mode 100644 index 00000000..3dbe13ba --- /dev/null +++ b/deps/glslang/Test/baseResults/glsl.entryPointRename.vert.out @@ -0,0 +1,43 @@ +glsl.entryPointRename.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 20 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "foo" 13 + Source GLSL 460 + Name 4 "foo" + Name 11 "gl_PerVertex" + MemberName 11(gl_PerVertex) 0 "gl_Position" + MemberName 11(gl_PerVertex) 1 "gl_PointSize" + MemberName 11(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 11(gl_PerVertex) 3 "gl_CullDistance" + Name 13 "" + MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 11(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 11(gl_PerVertex) Block + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 0 + 9: 8(int) Constant 1 + 10: TypeArray 6(float) 9 +11(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 10 10 + 12: TypePointer Output 11(gl_PerVertex) + 13: 12(ptr) Variable Output + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16: 6(float) Constant 1065353216 + 17: 7(fvec4) ConstantComposite 16 16 16 16 + 18: TypePointer Output 7(fvec4) + 4(foo): 2 Function None 3 + 5: Label + 19: 18(ptr) AccessChain 13 15 + Store 19 17 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/glsl.entryPointRename2.vert.out b/deps/glslang/Test/baseResults/glsl.entryPointRename2.vert.out new file mode 100644 index 00000000..aebd86be --- /dev/null +++ b/deps/glslang/Test/baseResults/glsl.entryPointRename2.vert.out @@ -0,0 +1,4 @@ +glsl.entryPointRename2.vert +ERROR: Linking vertex stage: Missing entry point: Each stage requires one entry point + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/glspv.esversion.vert.out b/deps/glslang/Test/baseResults/glspv.esversion.vert.out new file mode 100644 index 00000000..782865ab --- /dev/null +++ b/deps/glslang/Test/baseResults/glspv.esversion.vert.out @@ -0,0 +1,6 @@ +glspv.esversion.vert +ERROR: #version: ES shaders for OpenGL SPIR-V are not supported +ERROR: 1 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/glspv.frag.out b/deps/glslang/Test/baseResults/glspv.frag.out new file mode 100644 index 00000000..db752133 --- /dev/null +++ b/deps/glslang/Test/baseResults/glspv.frag.out @@ -0,0 +1,15 @@ +glspv.frag +ERROR: 0:4: '#error' : GL_SPIRV is set ( correct , not an error ) +ERROR: 0:6: '#error' : GL_SPIR is 100 +ERROR: 0:14: 'f' : non-opaque uniform variables need a layout(location=L) +ERROR: 0:21: 'noise1' : no matching overloaded function found +ERROR: 0:22: 'noise2' : no matching overloaded function found +ERROR: 0:23: 'noise3' : no matching overloaded function found +ERROR: 0:24: 'noise4' : no matching overloaded function found +ERROR: 0:27: 'atomic_uint' : layout(binding=X) is required +ERROR: 0:28: 'input_attachment_index' : only allowed when using GLSL for Vulkan +ERROR: 0:28: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON +ERROR: 10 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/glspv.version.frag.out b/deps/glslang/Test/baseResults/glspv.version.frag.out new file mode 100644 index 00000000..4a45b5bf --- /dev/null +++ b/deps/glslang/Test/baseResults/glspv.version.frag.out @@ -0,0 +1,20 @@ +glspv.version.frag +ERROR: #version: compilation for SPIR-V does not support the compatibility profile + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 6 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginLowerLeft + Source GLSL 330 + Name 4 "main" + 2: TypeVoid + 3: TypeFunction 2 + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/glspv.version.vert.out b/deps/glslang/Test/baseResults/glspv.version.vert.out new file mode 100644 index 00000000..9683b3bd --- /dev/null +++ b/deps/glslang/Test/baseResults/glspv.version.vert.out @@ -0,0 +1,6 @@ +glspv.version.vert +ERROR: #version: Desktop shaders for OpenGL SPIR-V require version 330 or higher +ERROR: 1 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/glspv.vert.out b/deps/glslang/Test/baseResults/glspv.vert.out new file mode 100644 index 00000000..f2fe53b2 --- /dev/null +++ b/deps/glslang/Test/baseResults/glspv.vert.out @@ -0,0 +1,13 @@ +glspv.vert +ERROR: 0:3: 'push_constant' : only allowed when using GLSL for Vulkan +ERROR: 0:6: 'descriptor set' : only allowed when using GLSL for Vulkan +ERROR: 0:8: 'shared' : not allowed when generating SPIR-V +ERROR: 0:9: 'packed' : not allowed when generating SPIR-V +ERROR: 0:13: 'gl_VertexIndex' : undeclared identifier +ERROR: 0:14: 'gl_InstanceIndex' : undeclared identifier +ERROR: 0:17: 'gl_DepthRangeParameters' : undeclared identifier +ERROR: 0:20: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON +ERROR: 8 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/hlsl.-D-U.frag.out b/deps/glslang/Test/baseResults/hlsl.-D-U.frag.out new file mode 100644 index 00000000..06842e80 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.-D-U.frag.out @@ -0,0 +1,65 @@ +hlsl.-D-U.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:9 'color' ( global 4-component vector of float) +0:9 Constant: +0:9 1.000000 +0:9 1.000000 +0:9 1.000000 +0:9 1.000000 +0:15 subtract second child into first child ( temp 4-component vector of float) +0:15 'color' ( global 4-component vector of float) +0:15 Constant: +0:15 5.000000 +0:21 Post-Increment ( temp 4-component vector of float) +0:21 'color' ( global 4-component vector of float) +0:29 vector scale second child into first child ( temp 4-component vector of float) +0:29 'color' ( global 4-component vector of float) +0:29 Constant: +0:29 3.000000 +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 Function Call: @main( ( temp void) +0:? Linker Objects +0:? 'color' ( global 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:9 'color' ( global 4-component vector of float) +0:9 Constant: +0:9 1.000000 +0:9 1.000000 +0:9 1.000000 +0:9 1.000000 +0:15 subtract second child into first child ( temp 4-component vector of float) +0:15 'color' ( global 4-component vector of float) +0:15 Constant: +0:15 5.000000 +0:21 Post-Increment ( temp 4-component vector of float) +0:21 'color' ( global 4-component vector of float) +0:29 vector scale second child into first child ( temp 4-component vector of float) +0:29 'color' ( global 4-component vector of float) +0:29 Constant: +0:29 3.000000 +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 Function Call: @main( ( temp void) +0:? Linker Objects +0:? 'color' ( global 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/hlsl.PointSize.geom.out b/deps/glslang/Test/baseResults/hlsl.PointSize.geom.out new file mode 100644 index 00000000..c21008d2 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.PointSize.geom.out @@ -0,0 +1,147 @@ +hlsl.PointSize.geom +Shader version: 500 +invocations = -1 +max_vertices = 4 +input primitive = triangles +output primitive = line_strip +0:? Sequence +0:8 Function Definition: @main(u1[3];struct-S-f11; ( temp void) +0:8 Function Parameters: +0:8 'ps' ( in 3-element array of uint) +0:8 'OutputStream' ( out structure{ temp float ps}) +0:? Sequence +0:10 Sequence +0:10 Sequence +0:10 move second child to first child ( temp float) +0:? 'OutputStream.ps' ( out float PointSize) +0:10 ps: direct index for structure ( temp float) +0:10 's' ( temp structure{ temp float ps}) +0:10 Constant: +0:10 0 (const int) +0:10 EmitVertex ( temp void) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 move second child to first child ( temp 3-element array of uint) +0:? 'ps' ( temp 3-element array of uint) +0:? 'ps' ( in 3-element array of uint PointSize) +0:8 Function Call: @main(u1[3];struct-S-f11; ( temp void) +0:? 'ps' ( temp 3-element array of uint) +0:? 'OutputStream' ( temp structure{ temp float ps}) +0:? Linker Objects +0:? 'ps' ( in 3-element array of uint PointSize) +0:? 'OutputStream.ps' ( out float PointSize) + + +Linked geometry stage: + + +Shader version: 500 +invocations = 1 +max_vertices = 4 +input primitive = triangles +output primitive = line_strip +0:? Sequence +0:8 Function Definition: @main(u1[3];struct-S-f11; ( temp void) +0:8 Function Parameters: +0:8 'ps' ( in 3-element array of uint) +0:8 'OutputStream' ( out structure{ temp float ps}) +0:? Sequence +0:10 Sequence +0:10 Sequence +0:10 move second child to first child ( temp float) +0:? 'OutputStream.ps' ( out float PointSize) +0:10 ps: direct index for structure ( temp float) +0:10 's' ( temp structure{ temp float ps}) +0:10 Constant: +0:10 0 (const int) +0:10 EmitVertex ( temp void) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 move second child to first child ( temp 3-element array of uint) +0:? 'ps' ( temp 3-element array of uint) +0:? 'ps' ( in 3-element array of uint PointSize) +0:8 Function Call: @main(u1[3];struct-S-f11; ( temp void) +0:? 'ps' ( temp 3-element array of uint) +0:? 'OutputStream' ( temp structure{ temp float ps}) +0:? Linker Objects +0:? 'ps' ( in 3-element array of uint PointSize) +0:? 'OutputStream.ps' ( out float PointSize) + +error: SPIRV-Tools Validation Errors +error: According to the Vulkan spec BuiltIn PointSize variable needs to be a 32-bit float scalar. ID <28> (OpVariable) is not a float scalar. + %29 = OpLoad %_arr_uint_uint_3 %ps_1 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 36 + + Capability Geometry + Capability GeometryPointSize + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 19 28 + ExecutionMode 4 Triangles + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputLineStrip + ExecutionMode 4 OutputVertices 4 + Source HLSL 500 + Name 4 "main" + Name 11 "S" + MemberName 11(S) 0 "ps" + Name 16 "@main(u1[3];struct-S-f11;" + Name 14 "ps" + Name 15 "OutputStream" + Name 19 "OutputStream.ps" + Name 20 "s" + Name 26 "ps" + Name 28 "ps" + Name 30 "OutputStream" + Name 31 "param" + Name 33 "param" + Decorate 19(OutputStream.ps) BuiltIn PointSize + Decorate 28(ps) BuiltIn PointSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: 6(int) Constant 3 + 8: TypeArray 6(int) 7 + 9: TypePointer Function 8 + 10: TypeFloat 32 + 11(S): TypeStruct 10(float) + 12: TypePointer Function 11(S) + 13: TypeFunction 2 9(ptr) 12(ptr) + 18: TypePointer Output 10(float) +19(OutputStream.ps): 18(ptr) Variable Output + 21: TypeInt 32 1 + 22: 21(int) Constant 0 + 23: TypePointer Function 10(float) + 27: TypePointer Input 8 + 28(ps): 27(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 26(ps): 9(ptr) Variable Function +30(OutputStream): 12(ptr) Variable Function + 31(param): 9(ptr) Variable Function + 33(param): 12(ptr) Variable Function + 29: 8 Load 28(ps) + Store 26(ps) 29 + 32: 8 Load 26(ps) + Store 31(param) 32 + 34: 2 FunctionCall 16(@main(u1[3];struct-S-f11;) 31(param) 33(param) + 35: 11(S) Load 33(param) + Store 30(OutputStream) 35 + Return + FunctionEnd +16(@main(u1[3];struct-S-f11;): 2 Function None 13 + 14(ps): 9(ptr) FunctionParameter +15(OutputStream): 12(ptr) FunctionParameter + 17: Label + 20(s): 12(ptr) Variable Function + 24: 23(ptr) AccessChain 20(s) 22 + 25: 10(float) Load 24 + Store 19(OutputStream.ps) 25 + EmitVertex + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.PointSize.vert.out b/deps/glslang/Test/baseResults/hlsl.PointSize.vert.out new file mode 100644 index 00000000..bda0030e --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.PointSize.vert.out @@ -0,0 +1,69 @@ +hlsl.PointSize.vert +Shader version: 500 +0:? Sequence +0:2 Function Definition: @main( ( temp float) +0:2 Function Parameters: +0:? Sequence +0:3 Branch: Return with expression +0:3 Constant: +0:3 2.300000 +0:2 Function Definition: main( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp float) +0:? '@entryPointOutput' ( out float PointSize) +0:2 Function Call: @main( ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' ( out float PointSize) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:2 Function Definition: @main( ( temp float) +0:2 Function Parameters: +0:? Sequence +0:3 Branch: Return with expression +0:3 Constant: +0:3 2.300000 +0:2 Function Definition: main( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp float) +0:? '@entryPointOutput' ( out float PointSize) +0:2 Function Call: @main( ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' ( out float PointSize) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 16 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 14 + Source HLSL 500 + Name 4 "main" + Name 8 "@main(" + Name 14 "@entryPointOutput" + Decorate 14(@entryPointOutput) BuiltIn PointSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeFunction 6(float) + 10: 6(float) Constant 1075000115 + 13: TypePointer Output 6(float) +14(@entryPointOutput): 13(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 15: 6(float) FunctionCall 8(@main() + Store 14(@entryPointOutput) 15 + Return + FunctionEnd + 8(@main(): 6(float) Function None 7 + 9: Label + ReturnValue 10 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.aliasOpaque.frag.out b/deps/glslang/Test/baseResults/hlsl.aliasOpaque.frag.out new file mode 100644 index 00000000..9928278d --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.aliasOpaque.frag.out @@ -0,0 +1,242 @@ +hlsl.aliasOpaque.frag +WARNING: AST will form illegal SPIR-V; need to transform to legalize +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: osCall(struct-OS-p1-f1-t211; ( temp 4-component vector of float) +0:12 Function Parameters: +0:12 's' ( in structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:? Sequence +0:13 Branch: Return with expression +0:13 vector-scale ( temp 4-component vector of float) +0:13 a: direct index for structure ( temp float) +0:13 's' ( in structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:13 Constant: +0:13 1 (const int) +0:13 texture ( temp 4-component vector of float) +0:13 Construct combined texture-sampler ( temp sampler2D) +0:13 tex: direct index for structure ( temp texture2D) +0:13 's' ( in structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:13 Constant: +0:13 2 (const int) +0:13 ss: direct index for structure ( temp sampler) +0:13 's' ( in structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:13 Constant: +0:13 0 (const int) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:17 Function Definition: @main( ( temp 4-component vector of float) +0:17 Function Parameters: +0:? Sequence +0:19 move second child to first child ( temp sampler) +0:19 ss: direct index for structure ( temp sampler) +0:19 'os' ( temp structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:19 Constant: +0:19 0 (const int) +0:19 'gss2' ( uniform sampler) +0:20 move second child to first child ( temp sampler) +0:20 ss: direct index for structure ( temp sampler) +0:20 'os' ( temp structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:20 Constant: +0:20 0 (const int) +0:20 'gss' ( uniform sampler) +0:21 move second child to first child ( temp texture2D) +0:21 tex: direct index for structure ( temp texture2D) +0:21 'os' ( temp structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:21 Constant: +0:21 2 (const int) +0:21 'gtex' ( uniform texture2D) +0:22 move second child to first child ( temp float) +0:22 a: direct index for structure ( temp float) +0:22 'os' ( temp structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 3.000000 +0:28 Branch: Return with expression +0:28 Function Call: osCall(struct-OS-p1-f1-t211; ( temp 4-component vector of float) +0:28 'os' ( temp structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:17 Function Definition: main( ( temp void) +0:17 Function Parameters: +0:? Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:17 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'gss' ( uniform sampler) +0:? 'gss2' ( uniform sampler) +0:? 'gtex' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: osCall(struct-OS-p1-f1-t211; ( temp 4-component vector of float) +0:12 Function Parameters: +0:12 's' ( in structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:? Sequence +0:13 Branch: Return with expression +0:13 vector-scale ( temp 4-component vector of float) +0:13 a: direct index for structure ( temp float) +0:13 's' ( in structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:13 Constant: +0:13 1 (const int) +0:13 texture ( temp 4-component vector of float) +0:13 Construct combined texture-sampler ( temp sampler2D) +0:13 tex: direct index for structure ( temp texture2D) +0:13 's' ( in structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:13 Constant: +0:13 2 (const int) +0:13 ss: direct index for structure ( temp sampler) +0:13 's' ( in structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:13 Constant: +0:13 0 (const int) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:17 Function Definition: @main( ( temp 4-component vector of float) +0:17 Function Parameters: +0:? Sequence +0:19 move second child to first child ( temp sampler) +0:19 ss: direct index for structure ( temp sampler) +0:19 'os' ( temp structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:19 Constant: +0:19 0 (const int) +0:19 'gss2' ( uniform sampler) +0:20 move second child to first child ( temp sampler) +0:20 ss: direct index for structure ( temp sampler) +0:20 'os' ( temp structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:20 Constant: +0:20 0 (const int) +0:20 'gss' ( uniform sampler) +0:21 move second child to first child ( temp texture2D) +0:21 tex: direct index for structure ( temp texture2D) +0:21 'os' ( temp structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:21 Constant: +0:21 2 (const int) +0:21 'gtex' ( uniform texture2D) +0:22 move second child to first child ( temp float) +0:22 a: direct index for structure ( temp float) +0:22 'os' ( temp structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 3.000000 +0:28 Branch: Return with expression +0:28 Function Call: osCall(struct-OS-p1-f1-t211; ( temp 4-component vector of float) +0:28 'os' ( temp structure{ temp sampler ss, temp float a, temp texture2D tex}) +0:17 Function Definition: main( ( temp void) +0:17 Function Parameters: +0:? Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:17 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'gss' ( uniform sampler) +0:? 'gss2' ( uniform sampler) +0:? 'gtex' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 64 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 62 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "OS" + MemberName 9(OS) 0 "ss" + MemberName 9(OS) 1 "a" + MemberName 9(OS) 2 "tex" + Name 14 "osCall(struct-OS-p1-f1-t211;" + Name 13 "s" + Name 17 "@main(" + Name 42 "os" + Name 44 "gss2" + Name 47 "gss" + Name 51 "gtex" + Name 56 "param" + Name 62 "@entryPointOutput" + Decorate 44(gss2) DescriptorSet 0 + Decorate 47(gss) DescriptorSet 0 + Decorate 51(gtex) DescriptorSet 0 + Decorate 62(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeSampler + 7: TypeFloat 32 + 8: TypeImage 7(float) 2D sampled format:Unknown + 9(OS): TypeStruct 6 7(float) 8 + 10: TypePointer Function 9(OS) + 11: TypeVector 7(float) 4 + 12: TypeFunction 11(fvec4) 10(ptr) + 16: TypeFunction 11(fvec4) + 19: TypeInt 32 1 + 20: 19(int) Constant 1 + 21: TypePointer Function 7(float) + 24: 19(int) Constant 2 + 25: TypePointer Function 8 + 28: 19(int) Constant 0 + 29: TypePointer Function 6 + 32: TypeSampledImage 8 + 34: TypeVector 7(float) 2 + 35: 7(float) Constant 1045220557 + 36: 7(float) Constant 1050253722 + 37: 34(fvec2) ConstantComposite 35 36 + 43: TypePointer UniformConstant 6 + 44(gss2): 43(ptr) Variable UniformConstant + 47(gss): 43(ptr) Variable UniformConstant + 50: TypePointer UniformConstant 8 + 51(gtex): 50(ptr) Variable UniformConstant + 54: 7(float) Constant 1077936128 + 61: TypePointer Output 11(fvec4) +62(@entryPointOutput): 61(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 63: 11(fvec4) FunctionCall 17(@main() + Store 62(@entryPointOutput) 63 + Return + FunctionEnd +14(osCall(struct-OS-p1-f1-t211;): 11(fvec4) Function None 12 + 13(s): 10(ptr) FunctionParameter + 15: Label + 22: 21(ptr) AccessChain 13(s) 20 + 23: 7(float) Load 22 + 26: 25(ptr) AccessChain 13(s) 24 + 27: 8 Load 26 + 30: 29(ptr) AccessChain 13(s) 28 + 31: 6 Load 30 + 33: 32 SampledImage 27 31 + 38: 11(fvec4) ImageSampleImplicitLod 33 37 + 39: 11(fvec4) VectorTimesScalar 38 23 + ReturnValue 39 + FunctionEnd + 17(@main(): 11(fvec4) Function None 16 + 18: Label + 42(os): 10(ptr) Variable Function + 56(param): 10(ptr) Variable Function + 45: 6 Load 44(gss2) + 46: 29(ptr) AccessChain 42(os) 28 + Store 46 45 + 48: 6 Load 47(gss) + 49: 29(ptr) AccessChain 42(os) 28 + Store 49 48 + 52: 8 Load 51(gtex) + 53: 25(ptr) AccessChain 42(os) 24 + Store 53 52 + 55: 21(ptr) AccessChain 42(os) 20 + Store 55 54 + 57: 9(OS) Load 42(os) + Store 56(param) 57 + 58: 11(fvec4) FunctionCall 14(osCall(struct-OS-p1-f1-t211;) 56(param) + ReturnValue 58 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.amend.frag.out b/deps/glslang/Test/baseResults/hlsl.amend.frag.out new file mode 100644 index 00000000..fa4ad035 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.amend.frag.out @@ -0,0 +1,257 @@ +hlsl.amend.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Sequence +0:3 move second child to first child ( temp 4-component vector of float) +0:3 'm' ( global 4-component vector of float) +0:3 vector-scale ( temp 4-component vector of float) +0:3 a: direct index for structure ( uniform 4-component vector of float) +0:3 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:3 Constant: +0:3 0 (const uint) +0:3 b: direct index for structure ( uniform float) +0:3 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:3 Constant: +0:3 1 (const uint) +0:5 Function Definition: @f1( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:6 vector-scale ( temp 4-component vector of float) +0:6 a: direct index for structure ( uniform 4-component vector of float) +0:6 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:6 Constant: +0:6 0 (const uint) +0:6 b: direct index for structure ( uniform float) +0:6 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:6 Constant: +0:6 1 (const uint) +0:5 Function Definition: f1( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 Function Call: @f1( ( temp void) +0:12 Function Definition: f2( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:13 add ( temp float) +0:13 add ( temp float) +0:13 direct index ( temp float) +0:13 a: direct index for structure ( uniform 4-component vector of float) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:13 Constant: +0:13 0 (const uint) +0:13 Constant: +0:13 0 (const int) +0:13 b: direct index for structure ( uniform float) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:13 Constant: +0:13 1 (const uint) +0:13 direct index ( temp float) +0:13 c: direct index for structure ( uniform 3-component vector of float) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:13 Constant: +0:13 2 (const uint) +0:13 Constant: +0:13 0 (const int) +0:17 Function Definition: f3( ( temp void) +0:17 Function Parameters: +0:? Sequence +0:18 c: direct index for structure ( uniform 3-component vector of float) +0:18 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:18 Constant: +0:18 2 (const uint) +0:24 Function Definition: f4( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:25 vector-scale ( temp 4-component vector of float) +0:25 Convert int to float ( temp float) +0:25 d: direct index for structure ( uniform int) +0:25 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:25 Constant: +0:25 3 (const uint) +0:25 a: direct index for structure ( uniform 4-component vector of float) +0:25 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:25 Constant: +0:25 0 (const uint) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:? 'm' ( global 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Sequence +0:3 move second child to first child ( temp 4-component vector of float) +0:3 'm' ( global 4-component vector of float) +0:3 vector-scale ( temp 4-component vector of float) +0:3 a: direct index for structure ( uniform 4-component vector of float) +0:3 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:3 Constant: +0:3 0 (const uint) +0:3 b: direct index for structure ( uniform float) +0:3 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:3 Constant: +0:3 1 (const uint) +0:5 Function Definition: @f1( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:6 vector-scale ( temp 4-component vector of float) +0:6 a: direct index for structure ( uniform 4-component vector of float) +0:6 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:6 Constant: +0:6 0 (const uint) +0:6 b: direct index for structure ( uniform float) +0:6 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:6 Constant: +0:6 1 (const uint) +0:5 Function Definition: f1( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 Function Call: @f1( ( temp void) +0:12 Function Definition: f2( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:13 add ( temp float) +0:13 add ( temp float) +0:13 direct index ( temp float) +0:13 a: direct index for structure ( uniform 4-component vector of float) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:13 Constant: +0:13 0 (const uint) +0:13 Constant: +0:13 0 (const int) +0:13 b: direct index for structure ( uniform float) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:13 Constant: +0:13 1 (const uint) +0:13 direct index ( temp float) +0:13 c: direct index for structure ( uniform 3-component vector of float) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:13 Constant: +0:13 2 (const uint) +0:13 Constant: +0:13 0 (const int) +0:17 Function Definition: f3( ( temp void) +0:17 Function Parameters: +0:? Sequence +0:18 c: direct index for structure ( uniform 3-component vector of float) +0:18 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:18 Constant: +0:18 2 (const uint) +0:24 Function Definition: f4( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:25 vector-scale ( temp 4-component vector of float) +0:25 Convert int to float ( temp float) +0:25 d: direct index for structure ( uniform int) +0:25 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:25 Constant: +0:25 3 (const uint) +0:25 a: direct index for structure ( uniform 4-component vector of float) +0:25 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:25 Constant: +0:25 0 (const uint) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float a, uniform float b, uniform 3-component vector of float c, uniform int d, uniform int e}) +0:? 'm' ( global 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 57 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "f1" + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "f1" + Name 6 "@f1(" + Name 8 "f2(" + Name 10 "f3(" + Name 12 "f4(" + Name 17 "m" + Name 20 "$Global" + MemberName 20($Global) 0 "a" + MemberName 20($Global) 1 "b" + MemberName 20($Global) 2 "c" + MemberName 20($Global) 3 "d" + MemberName 20($Global) 4 "e" + Name 22 "" + MemberDecorate 20($Global) 0 Offset 0 + MemberDecorate 20($Global) 1 Offset 16 + MemberDecorate 20($Global) 2 Offset 32 + MemberDecorate 20($Global) 3 Offset 44 + MemberDecorate 20($Global) 4 Offset 48 + Decorate 20($Global) Block + Decorate 22 DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 14: TypeFloat 32 + 15: TypeVector 14(float) 4 + 16: TypePointer Private 15(fvec4) + 17(m): 16(ptr) Variable Private + 18: TypeVector 14(float) 3 + 19: TypeInt 32 1 + 20($Global): TypeStruct 15(fvec4) 14(float) 18(fvec3) 19(int) 19(int) + 21: TypePointer Uniform 20($Global) + 22: 21(ptr) Variable Uniform + 23: 19(int) Constant 0 + 24: TypePointer Uniform 15(fvec4) + 27: 19(int) Constant 1 + 28: TypePointer Uniform 14(float) + 38: TypeInt 32 0 + 39: 38(int) Constant 0 + 45: 19(int) Constant 2 + 49: 19(int) Constant 3 + 50: TypePointer Uniform 19(int) + 4(f1): 2 Function None 3 + 5: Label + 25: 24(ptr) AccessChain 22 23 + 26: 15(fvec4) Load 25 + 29: 28(ptr) AccessChain 22 27 + 30: 14(float) Load 29 + 31: 15(fvec4) VectorTimesScalar 26 30 + Store 17(m) 31 + 37: 2 FunctionCall 6(@f1() + Return + FunctionEnd + 6(@f1(): 2 Function None 3 + 7: Label + 32: 24(ptr) AccessChain 22 23 + 33: 15(fvec4) Load 32 + 34: 28(ptr) AccessChain 22 27 + 35: 14(float) Load 34 + 36: 15(fvec4) VectorTimesScalar 33 35 + Return + FunctionEnd + 8(f2(): 2 Function None 3 + 9: Label + 40: 28(ptr) AccessChain 22 23 39 + 41: 14(float) Load 40 + 42: 28(ptr) AccessChain 22 27 + 43: 14(float) Load 42 + 44: 14(float) FAdd 41 43 + 46: 28(ptr) AccessChain 22 45 39 + 47: 14(float) Load 46 + 48: 14(float) FAdd 44 47 + Return + FunctionEnd + 10(f3(): 2 Function None 3 + 11: Label + Return + FunctionEnd + 12(f4(): 2 Function None 3 + 13: Label + 51: 50(ptr) AccessChain 22 49 + 52: 19(int) Load 51 + 53: 14(float) ConvertSToF 52 + 54: 24(ptr) AccessChain 22 23 + 55: 15(fvec4) Load 54 + 56: 15(fvec4) VectorTimesScalar 55 53 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.array.flatten.frag.out b/deps/glslang/Test/baseResults/hlsl.array.flatten.frag.out new file mode 100644 index 00000000..4c8609c2 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.array.flatten.frag.out @@ -0,0 +1,592 @@ +hlsl.array.flatten.frag +WARNING: AST will form illegal SPIR-V; need to transform to legalize +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:17 Function Definition: TestFn1( ( temp 4-component vector of float) +0:17 Function Parameters: +0:? Sequence +0:18 Branch: Return with expression +0:18 texture ( temp 4-component vector of float) +0:18 Construct combined texture-sampler ( temp sampler1D) +0:? 'g_tex[1]' ( uniform texture1D) +0:? 'g_samp[1]' ( uniform sampler) +0:18 Constant: +0:18 0.200000 +0:22 Function Definition: TestFn2(t11[3];p1[3]; ( temp 4-component vector of float) +0:22 Function Parameters: +0:22 'l_tex' ( in 3-element array of texture1D) +0:22 'l_samp' ( in 3-element array of sampler) +0:? Sequence +0:23 Branch: Return with expression +0:23 texture ( temp 4-component vector of float) +0:23 Construct combined texture-sampler ( temp sampler1D) +0:23 direct index ( temp texture1D) +0:23 'l_tex' ( in 3-element array of texture1D) +0:23 Constant: +0:23 2 (const int) +0:23 direct index ( temp sampler) +0:23 'l_samp' ( in 3-element array of sampler) +0:23 Constant: +0:23 2 (const int) +0:23 Constant: +0:23 0.200000 +0:26 Sequence +0:26 move second child to first child ( temp 5-element array of int) +0:26 'not_flattened_a' ( global 5-element array of int) +0:26 Constant: +0:26 1 (const int) +0:26 2 (const int) +0:26 3 (const int) +0:26 4 (const int) +0:26 5 (const int) +0:31 Function Definition: @main(struct-PS_OUTPUT-vf41; ( temp void) +0:31 Function Parameters: +0:31 'ps_output' ( out structure{ temp 4-component vector of float color}) +0:? Sequence +0:33 Sequence +0:33 Sequence +0:33 move second child to first child ( temp sampler) +0:33 direct index ( temp sampler) +0:33 'local_sampler_array' ( temp 3-element array of sampler) +0:33 Constant: +0:33 0 (const int) +0:? 'g_samp[0]' ( uniform sampler) +0:33 move second child to first child ( temp sampler) +0:33 direct index ( temp sampler) +0:33 'local_sampler_array' ( temp 3-element array of sampler) +0:33 Constant: +0:33 1 (const int) +0:? 'g_samp[1]' ( uniform sampler) +0:33 move second child to first child ( temp sampler) +0:33 direct index ( temp sampler) +0:33 'local_sampler_array' ( temp 3-element array of sampler) +0:33 Constant: +0:33 2 (const int) +0:? 'g_samp[2]' ( uniform sampler) +0:34 Sequence +0:34 Sequence +0:34 move second child to first child ( temp texture1D) +0:34 direct index ( temp texture1D) +0:34 'local_texture_array' ( temp 3-element array of texture1D) +0:34 Constant: +0:34 0 (const int) +0:? 'g_tex[0]' ( uniform texture1D) +0:34 move second child to first child ( temp texture1D) +0:34 direct index ( temp texture1D) +0:34 'local_texture_array' ( temp 3-element array of texture1D) +0:34 Constant: +0:34 1 (const int) +0:? 'g_tex[1]' ( uniform texture1D) +0:34 move second child to first child ( temp texture1D) +0:34 direct index ( temp texture1D) +0:34 'local_texture_array' ( temp 3-element array of texture1D) +0:34 Constant: +0:34 2 (const int) +0:? 'g_tex[2]' ( uniform texture1D) +0:35 Sequence +0:35 move second child to first child ( temp 4-element array of float) +0:35 'local_float_array' ( temp 4-element array of float) +0:35 g_floats: direct index for structure ( uniform 4-element array of float) +0:35 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 3X3 matrix of float g_mats, layout( binding=10) uniform 4-element array of 3X3 matrix of float g_mats_explicit, uniform 4-element array of float g_floats}) +0:35 Constant: +0:35 2 (const uint) +0:37 move second child to first child ( temp 4-component vector of float) +0:37 color: direct index for structure ( temp 4-component vector of float) +0:37 'ps_output' ( out structure{ temp 4-component vector of float color}) +0:37 Constant: +0:37 0 (const int) +0:37 add ( temp 4-component vector of float) +0:37 Function Call: TestFn1( ( temp 4-component vector of float) +0:37 Function Call: TestFn2(t11[3];p1[3]; ( temp 4-component vector of float) +0:37 Comma ( temp 3-element array of texture1D) +0:37 Sequence +0:37 move second child to first child ( temp texture1D) +0:37 direct index ( temp texture1D) +0:37 'aggShadow' ( temp 3-element array of texture1D) +0:37 Constant: +0:37 0 (const int) +0:? 'g_tex[0]' ( uniform texture1D) +0:37 move second child to first child ( temp texture1D) +0:37 direct index ( temp texture1D) +0:37 'aggShadow' ( temp 3-element array of texture1D) +0:37 Constant: +0:37 1 (const int) +0:? 'g_tex[1]' ( uniform texture1D) +0:37 move second child to first child ( temp texture1D) +0:37 direct index ( temp texture1D) +0:37 'aggShadow' ( temp 3-element array of texture1D) +0:37 Constant: +0:37 2 (const int) +0:? 'g_tex[2]' ( uniform texture1D) +0:37 'aggShadow' ( temp 3-element array of texture1D) +0:37 Comma ( temp 3-element array of sampler) +0:37 Sequence +0:37 move second child to first child ( temp sampler) +0:37 direct index ( temp sampler) +0:37 'aggShadow' ( temp 3-element array of sampler) +0:37 Constant: +0:37 0 (const int) +0:? 'g_samp[0]' ( uniform sampler) +0:37 move second child to first child ( temp sampler) +0:37 direct index ( temp sampler) +0:37 'aggShadow' ( temp 3-element array of sampler) +0:37 Constant: +0:37 1 (const int) +0:? 'g_samp[1]' ( uniform sampler) +0:37 move second child to first child ( temp sampler) +0:37 direct index ( temp sampler) +0:37 'aggShadow' ( temp 3-element array of sampler) +0:37 Constant: +0:37 2 (const int) +0:? 'g_samp[2]' ( uniform sampler) +0:37 'aggShadow' ( temp 3-element array of sampler) +0:31 Function Definition: main( ( temp void) +0:31 Function Parameters: +0:? Sequence +0:31 Function Call: @main(struct-PS_OUTPUT-vf41; ( temp void) +0:? 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:? 'ps_output.color' (layout( location=0) out 4-component vector of float) +0:31 color: direct index for structure ( temp 4-component vector of float) +0:? 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:31 Constant: +0:31 0 (const int) +0:? Linker Objects +0:? 'g_tex[0]' ( uniform texture1D) +0:? 'g_tex[1]' ( uniform texture1D) +0:? 'g_tex[2]' ( uniform texture1D) +0:? 'g_tex_explicit[0]' (layout( binding=1) uniform texture1D) +0:? 'g_tex_explicit[1]' (layout( binding=2) uniform texture1D) +0:? 'g_tex_explicit[2]' (layout( binding=3) uniform texture1D) +0:? 'g_samp[0]' ( uniform sampler) +0:? 'g_samp[1]' ( uniform sampler) +0:? 'g_samp[2]' ( uniform sampler) +0:? 'g_samp_explicit[0]' (layout( binding=5) uniform sampler) +0:? 'g_samp_explicit[1]' (layout( binding=6) uniform sampler) +0:? 'g_samp_explicit[2]' (layout( binding=7) uniform sampler) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 3X3 matrix of float g_mats, layout( binding=10) uniform 4-element array of 3X3 matrix of float g_mats_explicit, uniform 4-element array of float g_floats}) +0:? 'not_flattened_a' ( global 5-element array of int) +0:? 'ps_output.color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:17 Function Definition: TestFn1( ( temp 4-component vector of float) +0:17 Function Parameters: +0:? Sequence +0:18 Branch: Return with expression +0:18 texture ( temp 4-component vector of float) +0:18 Construct combined texture-sampler ( temp sampler1D) +0:? 'g_tex[1]' ( uniform texture1D) +0:? 'g_samp[1]' ( uniform sampler) +0:18 Constant: +0:18 0.200000 +0:22 Function Definition: TestFn2(t11[3];p1[3]; ( temp 4-component vector of float) +0:22 Function Parameters: +0:22 'l_tex' ( in 3-element array of texture1D) +0:22 'l_samp' ( in 3-element array of sampler) +0:? Sequence +0:23 Branch: Return with expression +0:23 texture ( temp 4-component vector of float) +0:23 Construct combined texture-sampler ( temp sampler1D) +0:23 direct index ( temp texture1D) +0:23 'l_tex' ( in 3-element array of texture1D) +0:23 Constant: +0:23 2 (const int) +0:23 direct index ( temp sampler) +0:23 'l_samp' ( in 3-element array of sampler) +0:23 Constant: +0:23 2 (const int) +0:23 Constant: +0:23 0.200000 +0:26 Sequence +0:26 move second child to first child ( temp 5-element array of int) +0:26 'not_flattened_a' ( global 5-element array of int) +0:26 Constant: +0:26 1 (const int) +0:26 2 (const int) +0:26 3 (const int) +0:26 4 (const int) +0:26 5 (const int) +0:31 Function Definition: @main(struct-PS_OUTPUT-vf41; ( temp void) +0:31 Function Parameters: +0:31 'ps_output' ( out structure{ temp 4-component vector of float color}) +0:? Sequence +0:33 Sequence +0:33 Sequence +0:33 move second child to first child ( temp sampler) +0:33 direct index ( temp sampler) +0:33 'local_sampler_array' ( temp 3-element array of sampler) +0:33 Constant: +0:33 0 (const int) +0:? 'g_samp[0]' ( uniform sampler) +0:33 move second child to first child ( temp sampler) +0:33 direct index ( temp sampler) +0:33 'local_sampler_array' ( temp 3-element array of sampler) +0:33 Constant: +0:33 1 (const int) +0:? 'g_samp[1]' ( uniform sampler) +0:33 move second child to first child ( temp sampler) +0:33 direct index ( temp sampler) +0:33 'local_sampler_array' ( temp 3-element array of sampler) +0:33 Constant: +0:33 2 (const int) +0:? 'g_samp[2]' ( uniform sampler) +0:34 Sequence +0:34 Sequence +0:34 move second child to first child ( temp texture1D) +0:34 direct index ( temp texture1D) +0:34 'local_texture_array' ( temp 3-element array of texture1D) +0:34 Constant: +0:34 0 (const int) +0:? 'g_tex[0]' ( uniform texture1D) +0:34 move second child to first child ( temp texture1D) +0:34 direct index ( temp texture1D) +0:34 'local_texture_array' ( temp 3-element array of texture1D) +0:34 Constant: +0:34 1 (const int) +0:? 'g_tex[1]' ( uniform texture1D) +0:34 move second child to first child ( temp texture1D) +0:34 direct index ( temp texture1D) +0:34 'local_texture_array' ( temp 3-element array of texture1D) +0:34 Constant: +0:34 2 (const int) +0:? 'g_tex[2]' ( uniform texture1D) +0:35 Sequence +0:35 move second child to first child ( temp 4-element array of float) +0:35 'local_float_array' ( temp 4-element array of float) +0:35 g_floats: direct index for structure ( uniform 4-element array of float) +0:35 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 3X3 matrix of float g_mats, layout( binding=10) uniform 4-element array of 3X3 matrix of float g_mats_explicit, uniform 4-element array of float g_floats}) +0:35 Constant: +0:35 2 (const uint) +0:37 move second child to first child ( temp 4-component vector of float) +0:37 color: direct index for structure ( temp 4-component vector of float) +0:37 'ps_output' ( out structure{ temp 4-component vector of float color}) +0:37 Constant: +0:37 0 (const int) +0:37 add ( temp 4-component vector of float) +0:37 Function Call: TestFn1( ( temp 4-component vector of float) +0:37 Function Call: TestFn2(t11[3];p1[3]; ( temp 4-component vector of float) +0:37 Comma ( temp 3-element array of texture1D) +0:37 Sequence +0:37 move second child to first child ( temp texture1D) +0:37 direct index ( temp texture1D) +0:37 'aggShadow' ( temp 3-element array of texture1D) +0:37 Constant: +0:37 0 (const int) +0:? 'g_tex[0]' ( uniform texture1D) +0:37 move second child to first child ( temp texture1D) +0:37 direct index ( temp texture1D) +0:37 'aggShadow' ( temp 3-element array of texture1D) +0:37 Constant: +0:37 1 (const int) +0:? 'g_tex[1]' ( uniform texture1D) +0:37 move second child to first child ( temp texture1D) +0:37 direct index ( temp texture1D) +0:37 'aggShadow' ( temp 3-element array of texture1D) +0:37 Constant: +0:37 2 (const int) +0:? 'g_tex[2]' ( uniform texture1D) +0:37 'aggShadow' ( temp 3-element array of texture1D) +0:37 Comma ( temp 3-element array of sampler) +0:37 Sequence +0:37 move second child to first child ( temp sampler) +0:37 direct index ( temp sampler) +0:37 'aggShadow' ( temp 3-element array of sampler) +0:37 Constant: +0:37 0 (const int) +0:? 'g_samp[0]' ( uniform sampler) +0:37 move second child to first child ( temp sampler) +0:37 direct index ( temp sampler) +0:37 'aggShadow' ( temp 3-element array of sampler) +0:37 Constant: +0:37 1 (const int) +0:? 'g_samp[1]' ( uniform sampler) +0:37 move second child to first child ( temp sampler) +0:37 direct index ( temp sampler) +0:37 'aggShadow' ( temp 3-element array of sampler) +0:37 Constant: +0:37 2 (const int) +0:? 'g_samp[2]' ( uniform sampler) +0:37 'aggShadow' ( temp 3-element array of sampler) +0:31 Function Definition: main( ( temp void) +0:31 Function Parameters: +0:? Sequence +0:31 Function Call: @main(struct-PS_OUTPUT-vf41; ( temp void) +0:? 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:? 'ps_output.color' (layout( location=0) out 4-component vector of float) +0:31 color: direct index for structure ( temp 4-component vector of float) +0:? 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:31 Constant: +0:31 0 (const int) +0:? Linker Objects +0:? 'g_tex[0]' ( uniform texture1D) +0:? 'g_tex[1]' ( uniform texture1D) +0:? 'g_tex[2]' ( uniform texture1D) +0:? 'g_tex_explicit[0]' (layout( binding=1) uniform texture1D) +0:? 'g_tex_explicit[1]' (layout( binding=2) uniform texture1D) +0:? 'g_tex_explicit[2]' (layout( binding=3) uniform texture1D) +0:? 'g_samp[0]' ( uniform sampler) +0:? 'g_samp[1]' ( uniform sampler) +0:? 'g_samp[2]' ( uniform sampler) +0:? 'g_samp_explicit[0]' (layout( binding=5) uniform sampler) +0:? 'g_samp_explicit[1]' (layout( binding=6) uniform sampler) +0:? 'g_samp_explicit[2]' (layout( binding=7) uniform sampler) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 3X3 matrix of float g_mats, layout( binding=10) uniform 4-element array of 3X3 matrix of float g_mats_explicit, uniform 4-element array of float g_floats}) +0:? 'not_flattened_a' ( global 5-element array of int) +0:? 'ps_output.color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 143 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 134 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "TestFn1(" + Name 22 "TestFn2(t11[3];p1[3];" + Name 20 "l_tex" + Name 21 "l_samp" + Name 24 "PS_OUTPUT" + MemberName 24(PS_OUTPUT) 0 "color" + Name 28 "@main(struct-PS_OUTPUT-vf41;" + Name 27 "ps_output" + Name 34 "not_flattened_a" + Name 42 "g_tex[1]" + Name 45 "g_samp[1]" + Name 63 "local_sampler_array" + Name 65 "g_samp[0]" + Name 70 "g_samp[2]" + Name 73 "local_texture_array" + Name 74 "g_tex[0]" + Name 79 "g_tex[2]" + Name 85 "local_float_array" + Name 91 "$Global" + MemberName 91($Global) 0 "g_mats" + MemberName 91($Global) 1 "g_mats_explicit" + MemberName 91($Global) 2 "g_floats" + Name 93 "" + Name 107 "aggShadow" + Name 114 "aggShadow" + Name 121 "param" + Name 123 "param" + Name 129 "ps_output" + Name 130 "param" + Name 134 "ps_output.color" + Name 137 "g_tex_explicit[0]" + Name 138 "g_tex_explicit[1]" + Name 139 "g_tex_explicit[2]" + Name 140 "g_samp_explicit[0]" + Name 141 "g_samp_explicit[1]" + Name 142 "g_samp_explicit[2]" + Decorate 42(g_tex[1]) DescriptorSet 0 + Decorate 45(g_samp[1]) DescriptorSet 0 + Decorate 65(g_samp[0]) DescriptorSet 0 + Decorate 70(g_samp[2]) DescriptorSet 0 + Decorate 74(g_tex[0]) DescriptorSet 0 + Decorate 79(g_tex[2]) DescriptorSet 0 + Decorate 88 ArrayStride 48 + Decorate 89 ArrayStride 48 + Decorate 90 ArrayStride 16 + MemberDecorate 91($Global) 0 RowMajor + MemberDecorate 91($Global) 0 Offset 0 + MemberDecorate 91($Global) 0 MatrixStride 16 + MemberDecorate 91($Global) 1 RowMajor + MemberDecorate 91($Global) 1 Offset 192 + MemberDecorate 91($Global) 1 MatrixStride 16 + MemberDecorate 91($Global) 2 Offset 384 + Decorate 91($Global) Block + Decorate 93 DescriptorSet 0 + Decorate 134(ps_output.color) Location 0 + Decorate 137(g_tex_explicit[0]) DescriptorSet 0 + Decorate 137(g_tex_explicit[0]) Binding 1 + Decorate 138(g_tex_explicit[1]) DescriptorSet 0 + Decorate 138(g_tex_explicit[1]) Binding 2 + Decorate 139(g_tex_explicit[2]) DescriptorSet 0 + Decorate 139(g_tex_explicit[2]) Binding 3 + Decorate 140(g_samp_explicit[0]) DescriptorSet 0 + Decorate 140(g_samp_explicit[0]) Binding 5 + Decorate 141(g_samp_explicit[1]) DescriptorSet 0 + Decorate 141(g_samp_explicit[1]) Binding 6 + Decorate 142(g_samp_explicit[2]) DescriptorSet 0 + Decorate 142(g_samp_explicit[2]) Binding 7 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeImage 6(float) 1D sampled format:Unknown + 12: TypeInt 32 0 + 13: 12(int) Constant 3 + 14: TypeArray 11 13 + 15: TypePointer Function 14 + 16: TypeSampler + 17: TypeArray 16 13 + 18: TypePointer Function 17 + 19: TypeFunction 7(fvec4) 15(ptr) 18(ptr) + 24(PS_OUTPUT): TypeStruct 7(fvec4) + 25: TypePointer Function 24(PS_OUTPUT) + 26: TypeFunction 2 25(ptr) + 30: TypeInt 32 1 + 31: 12(int) Constant 5 + 32: TypeArray 30(int) 31 + 33: TypePointer Private 32 +34(not_flattened_a): 33(ptr) Variable Private + 35: 30(int) Constant 1 + 36: 30(int) Constant 2 + 37: 30(int) Constant 3 + 38: 30(int) Constant 4 + 39: 30(int) Constant 5 + 40: 32 ConstantComposite 35 36 37 38 39 + 41: TypePointer UniformConstant 11 + 42(g_tex[1]): 41(ptr) Variable UniformConstant + 44: TypePointer UniformConstant 16 + 45(g_samp[1]): 44(ptr) Variable UniformConstant + 47: TypeSampledImage 11 + 49: 6(float) Constant 1045220557 + 53: TypePointer Function 11 + 56: TypePointer Function 16 + 64: 30(int) Constant 0 + 65(g_samp[0]): 44(ptr) Variable UniformConstant + 70(g_samp[2]): 44(ptr) Variable UniformConstant + 74(g_tex[0]): 41(ptr) Variable UniformConstant + 79(g_tex[2]): 41(ptr) Variable UniformConstant + 82: 12(int) Constant 4 + 83: TypeArray 6(float) 82 + 84: TypePointer Function 83 + 86: TypeVector 6(float) 3 + 87: TypeMatrix 86(fvec3) 3 + 88: TypeArray 87 82 + 89: TypeArray 87 82 + 90: TypeArray 6(float) 82 + 91($Global): TypeStruct 88 89 90 + 92: TypePointer Uniform 91($Global) + 93: 92(ptr) Variable Uniform + 94: TypePointer Uniform 90 + 98: TypePointer Function 6(float) + 127: TypePointer Function 7(fvec4) + 133: TypePointer Output 7(fvec4) +134(ps_output.color): 133(ptr) Variable Output +137(g_tex_explicit[0]): 41(ptr) Variable UniformConstant +138(g_tex_explicit[1]): 41(ptr) Variable UniformConstant +139(g_tex_explicit[2]): 41(ptr) Variable UniformConstant +140(g_samp_explicit[0]): 44(ptr) Variable UniformConstant +141(g_samp_explicit[1]): 44(ptr) Variable UniformConstant +142(g_samp_explicit[2]): 44(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 129(ps_output): 25(ptr) Variable Function + 130(param): 25(ptr) Variable Function + Store 34(not_flattened_a) 40 + 131: 2 FunctionCall 28(@main(struct-PS_OUTPUT-vf41;) 130(param) + 132:24(PS_OUTPUT) Load 130(param) + Store 129(ps_output) 132 + 135: 127(ptr) AccessChain 129(ps_output) 64 + 136: 7(fvec4) Load 135 + Store 134(ps_output.color) 136 + Return + FunctionEnd + 9(TestFn1(): 7(fvec4) Function None 8 + 10: Label + 43: 11 Load 42(g_tex[1]) + 46: 16 Load 45(g_samp[1]) + 48: 47 SampledImage 43 46 + 50: 7(fvec4) ImageSampleImplicitLod 48 49 + ReturnValue 50 + FunctionEnd +22(TestFn2(t11[3];p1[3];): 7(fvec4) Function None 19 + 20(l_tex): 15(ptr) FunctionParameter + 21(l_samp): 18(ptr) FunctionParameter + 23: Label + 54: 53(ptr) AccessChain 20(l_tex) 36 + 55: 11 Load 54 + 57: 56(ptr) AccessChain 21(l_samp) 36 + 58: 16 Load 57 + 59: 47 SampledImage 55 58 + 60: 7(fvec4) ImageSampleImplicitLod 59 49 + ReturnValue 60 + FunctionEnd +28(@main(struct-PS_OUTPUT-vf41;): 2 Function None 26 + 27(ps_output): 25(ptr) FunctionParameter + 29: Label +63(local_sampler_array): 18(ptr) Variable Function +73(local_texture_array): 15(ptr) Variable Function +85(local_float_array): 84(ptr) Variable Function + 107(aggShadow): 15(ptr) Variable Function + 114(aggShadow): 18(ptr) Variable Function + 121(param): 15(ptr) Variable Function + 123(param): 18(ptr) Variable Function + 66: 16 Load 65(g_samp[0]) + 67: 56(ptr) AccessChain 63(local_sampler_array) 64 + Store 67 66 + 68: 16 Load 45(g_samp[1]) + 69: 56(ptr) AccessChain 63(local_sampler_array) 35 + Store 69 68 + 71: 16 Load 70(g_samp[2]) + 72: 56(ptr) AccessChain 63(local_sampler_array) 36 + Store 72 71 + 75: 11 Load 74(g_tex[0]) + 76: 53(ptr) AccessChain 73(local_texture_array) 64 + Store 76 75 + 77: 11 Load 42(g_tex[1]) + 78: 53(ptr) AccessChain 73(local_texture_array) 35 + Store 78 77 + 80: 11 Load 79(g_tex[2]) + 81: 53(ptr) AccessChain 73(local_texture_array) 36 + Store 81 80 + 95: 94(ptr) AccessChain 93 36 + 96: 90 Load 95 + 97: 6(float) CompositeExtract 96 0 + 99: 98(ptr) AccessChain 85(local_float_array) 64 + Store 99 97 + 100: 6(float) CompositeExtract 96 1 + 101: 98(ptr) AccessChain 85(local_float_array) 35 + Store 101 100 + 102: 6(float) CompositeExtract 96 2 + 103: 98(ptr) AccessChain 85(local_float_array) 36 + Store 103 102 + 104: 6(float) CompositeExtract 96 3 + 105: 98(ptr) AccessChain 85(local_float_array) 37 + Store 105 104 + 106: 7(fvec4) FunctionCall 9(TestFn1() + 108: 11 Load 74(g_tex[0]) + 109: 53(ptr) AccessChain 107(aggShadow) 64 + Store 109 108 + 110: 11 Load 42(g_tex[1]) + 111: 53(ptr) AccessChain 107(aggShadow) 35 + Store 111 110 + 112: 11 Load 79(g_tex[2]) + 113: 53(ptr) AccessChain 107(aggShadow) 36 + Store 113 112 + 115: 16 Load 65(g_samp[0]) + 116: 56(ptr) AccessChain 114(aggShadow) 64 + Store 116 115 + 117: 16 Load 45(g_samp[1]) + 118: 56(ptr) AccessChain 114(aggShadow) 35 + Store 118 117 + 119: 16 Load 70(g_samp[2]) + 120: 56(ptr) AccessChain 114(aggShadow) 36 + Store 120 119 + 122: 14 Load 107(aggShadow) + Store 121(param) 122 + 124: 17 Load 114(aggShadow) + Store 123(param) 124 + 125: 7(fvec4) FunctionCall 22(TestFn2(t11[3];p1[3];) 121(param) 123(param) + 126: 7(fvec4) FAdd 106 125 + 128: 127(ptr) AccessChain 27(ps_output) 64 + Store 128 126 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.array.frag.out b/deps/glslang/Test/baseResults/hlsl.array.frag.out new file mode 100644 index 00000000..0f68e7cd --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.array.frag.out @@ -0,0 +1,475 @@ +hlsl.array.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 'C' ( global 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:11 Sequence +0:11 move second child to first child ( temp 2-element array of 4-component vector of float) +0:11 'c2' ( global 2-element array of 4-component vector of float) +0:11 Construct vec4 ( temp 2-element array of 4-component vector of float) +0:11 'C' ( global 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:14 Function Definition: @PixelShaderFunction(i1;vf4[3]; ( temp 4-component vector of float) +0:14 Function Parameters: +0:14 'i' ( in int) +0:14 'input' ( in 3-element array of 4-component vector of float) +0:? Sequence +0:15 Sequence +0:15 move second child to first child ( temp 10-element array of 4-component vector of float) +0:15 'b' ( temp 10-element array of 4-component vector of float) +0:15 Construct vec4 ( temp 10-element array of 4-component vector of float) +0:15 'C' ( global 4-component vector of float) +0:15 'C' ( global 4-component vector of float) +0:15 'C' ( global 4-component vector of float) +0:15 'C' ( global 4-component vector of float) +0:15 'C' ( global 4-component vector of float) +0:15 'C' ( global 4-component vector of float) +0:15 'C' ( global 4-component vector of float) +0:15 'C' ( global 4-component vector of float) +0:15 'C' ( global 4-component vector of float) +0:15 'C' ( global 4-component vector of float) +0:16 Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:16 'tmp' ( temp 4-component vector of float) +0:16 add ( temp 4-component vector of float) +0:16 add ( temp 4-component vector of float) +0:16 add ( temp 4-component vector of float) +0:16 add ( temp 4-component vector of float) +0:16 'C' ( global 4-component vector of float) +0:16 direct index ( temp 4-component vector of float) +0:16 a1: direct index for structure ( uniform 1-element array of 4-component vector of float) +0:16 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2}) +0:16 Constant: +0:16 2 (const uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1.000000 +0:16 2.000000 +0:16 3.000000 +0:16 4.000000 +0:16 indirect index ( temp 4-component vector of float) +0:16 a2: direct index for structure ( uniform 2-element array of 4-component vector of float) +0:16 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2}) +0:16 Constant: +0:16 3 (const uint) +0:16 'i' ( in int) +0:16 indirect index ( temp 4-component vector of float) +0:16 'c2' ( global 2-element array of 4-component vector of float) +0:16 'i' ( in int) +0:17 Branch: Return with expression +0:17 add ( temp 4-component vector of float) +0:17 add ( temp 4-component vector of float) +0:17 add ( temp 4-component vector of float) +0:17 add ( temp 4-component vector of float) +0:17 add ( temp 4-component vector of float) +0:17 add ( temp 4-component vector of float) +0:17 add ( temp 4-component vector of float) +0:17 direct index ( temp 4-component vector of float) +0:17 a: direct index for structure ( uniform 4-element array of 4-component vector of float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2}) +0:17 Constant: +0:17 0 (const uint) +0:17 Constant: +0:17 1 (const int) +0:17 indirect index ( temp 4-component vector of float) +0:17 a: direct index for structure ( uniform 4-element array of 4-component vector of float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2}) +0:17 Constant: +0:17 0 (const uint) +0:17 'i' ( in int) +0:17 direct index ( temp 4-component vector of float) +0:17 'input' ( in 3-element array of 4-component vector of float) +0:17 Constant: +0:17 2 (const int) +0:17 indirect index ( temp 4-component vector of float) +0:17 'input' ( in 3-element array of 4-component vector of float) +0:17 'i' ( in int) +0:17 direct index ( temp 4-component vector of float) +0:17 'b' ( temp 10-element array of 4-component vector of float) +0:17 Constant: +0:17 5 (const int) +0:17 indirect index ( temp 4-component vector of float) +0:17 'b' ( temp 10-element array of 4-component vector of float) +0:17 'i' ( in int) +0:17 indirect index ( temp 4-component vector of float) +0:17 m: direct index for structure ( temp 7-element array of 4-component vector of float) +0:17 indirect index ( temp structure{ temp 7-element array of 4-component vector of float m}) +0:17 s: direct index for structure ( uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m}) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2}) +0:17 Constant: +0:17 1 (const uint) +0:17 'i' ( in int) +0:17 Constant: +0:17 0 (const int) +0:17 'i' ( in int) +0:17 'tmp' ( temp 4-component vector of float) +0:14 Function Definition: PixelShaderFunction( ( temp void) +0:14 Function Parameters: +0:? Sequence +0:14 move second child to first child ( temp int) +0:? 'i' ( temp int) +0:? 'i' (layout( location=0) flat in int) +0:14 move second child to first child ( temp 3-element array of 4-component vector of float) +0:? 'input' ( temp 3-element array of 4-component vector of float) +0:? 'input' (layout( location=1) in 3-element array of 4-component vector of float) +0:14 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:14 Function Call: @PixelShaderFunction(i1;vf4[3]; ( temp 4-component vector of float) +0:? 'i' ( temp int) +0:? 'input' ( temp 3-element array of 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2}) +0:? 'C' ( global 4-component vector of float) +0:? 'c1' ( const 1-element array of 4-component vector of float) +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 'c2' ( global 2-element array of 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'i' (layout( location=0) flat in int) +0:? 'input' (layout( location=1) in 3-element array of 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 'C' ( global 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:11 Sequence +0:11 move second child to first child ( temp 2-element array of 4-component vector of float) +0:11 'c2' ( global 2-element array of 4-component vector of float) +0:11 Construct vec4 ( temp 2-element array of 4-component vector of float) +0:11 'C' ( global 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:14 Function Definition: @PixelShaderFunction(i1;vf4[3]; ( temp 4-component vector of float) +0:14 Function Parameters: +0:14 'i' ( in int) +0:14 'input' ( in 3-element array of 4-component vector of float) +0:? Sequence +0:15 Sequence +0:15 move second child to first child ( temp 10-element array of 4-component vector of float) +0:15 'b' ( temp 10-element array of 4-component vector of float) +0:15 Construct vec4 ( temp 10-element array of 4-component vector of float) +0:15 'C' ( global 4-component vector of float) +0:15 'C' ( global 4-component vector of float) +0:15 'C' ( global 4-component vector of float) +0:15 'C' ( global 4-component vector of float) +0:15 'C' ( global 4-component vector of float) +0:15 'C' ( global 4-component vector of float) +0:15 'C' ( global 4-component vector of float) +0:15 'C' ( global 4-component vector of float) +0:15 'C' ( global 4-component vector of float) +0:15 'C' ( global 4-component vector of float) +0:16 Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:16 'tmp' ( temp 4-component vector of float) +0:16 add ( temp 4-component vector of float) +0:16 add ( temp 4-component vector of float) +0:16 add ( temp 4-component vector of float) +0:16 add ( temp 4-component vector of float) +0:16 'C' ( global 4-component vector of float) +0:16 direct index ( temp 4-component vector of float) +0:16 a1: direct index for structure ( uniform 1-element array of 4-component vector of float) +0:16 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2}) +0:16 Constant: +0:16 2 (const uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1.000000 +0:16 2.000000 +0:16 3.000000 +0:16 4.000000 +0:16 indirect index ( temp 4-component vector of float) +0:16 a2: direct index for structure ( uniform 2-element array of 4-component vector of float) +0:16 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2}) +0:16 Constant: +0:16 3 (const uint) +0:16 'i' ( in int) +0:16 indirect index ( temp 4-component vector of float) +0:16 'c2' ( global 2-element array of 4-component vector of float) +0:16 'i' ( in int) +0:17 Branch: Return with expression +0:17 add ( temp 4-component vector of float) +0:17 add ( temp 4-component vector of float) +0:17 add ( temp 4-component vector of float) +0:17 add ( temp 4-component vector of float) +0:17 add ( temp 4-component vector of float) +0:17 add ( temp 4-component vector of float) +0:17 add ( temp 4-component vector of float) +0:17 direct index ( temp 4-component vector of float) +0:17 a: direct index for structure ( uniform 4-element array of 4-component vector of float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2}) +0:17 Constant: +0:17 0 (const uint) +0:17 Constant: +0:17 1 (const int) +0:17 indirect index ( temp 4-component vector of float) +0:17 a: direct index for structure ( uniform 4-element array of 4-component vector of float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2}) +0:17 Constant: +0:17 0 (const uint) +0:17 'i' ( in int) +0:17 direct index ( temp 4-component vector of float) +0:17 'input' ( in 3-element array of 4-component vector of float) +0:17 Constant: +0:17 2 (const int) +0:17 indirect index ( temp 4-component vector of float) +0:17 'input' ( in 3-element array of 4-component vector of float) +0:17 'i' ( in int) +0:17 direct index ( temp 4-component vector of float) +0:17 'b' ( temp 10-element array of 4-component vector of float) +0:17 Constant: +0:17 5 (const int) +0:17 indirect index ( temp 4-component vector of float) +0:17 'b' ( temp 10-element array of 4-component vector of float) +0:17 'i' ( in int) +0:17 indirect index ( temp 4-component vector of float) +0:17 m: direct index for structure ( temp 7-element array of 4-component vector of float) +0:17 indirect index ( temp structure{ temp 7-element array of 4-component vector of float m}) +0:17 s: direct index for structure ( uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m}) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2}) +0:17 Constant: +0:17 1 (const uint) +0:17 'i' ( in int) +0:17 Constant: +0:17 0 (const int) +0:17 'i' ( in int) +0:17 'tmp' ( temp 4-component vector of float) +0:14 Function Definition: PixelShaderFunction( ( temp void) +0:14 Function Parameters: +0:? Sequence +0:14 move second child to first child ( temp int) +0:? 'i' ( temp int) +0:? 'i' (layout( location=0) flat in int) +0:14 move second child to first child ( temp 3-element array of 4-component vector of float) +0:? 'input' ( temp 3-element array of 4-component vector of float) +0:? 'input' (layout( location=1) in 3-element array of 4-component vector of float) +0:14 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:14 Function Call: @PixelShaderFunction(i1;vf4[3]; ( temp 4-component vector of float) +0:? 'i' ( temp int) +0:? 'input' ( temp 3-element array of 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2}) +0:? 'C' ( global 4-component vector of float) +0:? 'c1' ( const 1-element array of 4-component vector of float) +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 'c2' ( global 2-element array of 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'i' (layout( location=0) flat in int) +0:? 'input' (layout( location=1) in 3-element array of 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 126 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 112 116 119 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 17 "@PixelShaderFunction(i1;vf4[3];" + Name 15 "i" + Name 16 "input" + Name 20 "C" + Name 29 "c2" + Name 35 "b" + Name 48 "tmp" + Name 54 "" + MemberName 54 0 "m" + Name 60 "$Global" + MemberName 60($Global) 0 "a" + MemberName 60($Global) 1 "s" + MemberName 60($Global) 2 "a1" + MemberName 60($Global) 3 "a2" + Name 62 "" + Name 110 "i" + Name 112 "i" + Name 114 "input" + Name 116 "input" + Name 119 "@entryPointOutput" + Name 120 "param" + Name 122 "param" + Decorate 51 ArrayStride 16 + Decorate 53 ArrayStride 16 + MemberDecorate 54 0 Offset 0 + Decorate 56 ArrayStride 112 + Decorate 58 ArrayStride 16 + Decorate 59 ArrayStride 16 + MemberDecorate 60($Global) 0 Offset 0 + MemberDecorate 60($Global) 1 Offset 64 + MemberDecorate 60($Global) 2 Offset 1296 + MemberDecorate 60($Global) 3 Offset 1312 + Decorate 60($Global) Block + Decorate 62 DescriptorSet 0 + Decorate 112(i) Flat + Decorate 112(i) Location 0 + Decorate 116(input) Location 1 + Decorate 119(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeInt 32 0 + 11: 10(int) Constant 3 + 12: TypeArray 9(fvec4) 11 + 13: TypePointer Function 12 + 14: TypeFunction 9(fvec4) 7(ptr) 13(ptr) + 19: TypePointer Private 9(fvec4) + 20(C): 19(ptr) Variable Private + 21: 8(float) Constant 1065353216 + 22: 8(float) Constant 1073741824 + 23: 8(float) Constant 1077936128 + 24: 8(float) Constant 1082130432 + 25: 9(fvec4) ConstantComposite 21 22 23 24 + 26: 10(int) Constant 2 + 27: TypeArray 9(fvec4) 26 + 28: TypePointer Private 27 + 29(c2): 28(ptr) Variable Private + 32: 10(int) Constant 10 + 33: TypeArray 9(fvec4) 32 + 34: TypePointer Function 33 + 47: TypePointer Function 9(fvec4) + 50: 10(int) Constant 4 + 51: TypeArray 9(fvec4) 50 + 52: 10(int) Constant 7 + 53: TypeArray 9(fvec4) 52 + 54: TypeStruct 53 + 55: 10(int) Constant 11 + 56: TypeArray 54(struct) 55 + 57: 10(int) Constant 1 + 58: TypeArray 9(fvec4) 57 + 59: TypeArray 9(fvec4) 26 + 60($Global): TypeStruct 51 56 58 59 + 61: TypePointer Uniform 60($Global) + 62: 61(ptr) Variable Uniform + 63: 6(int) Constant 2 + 64: 6(int) Constant 0 + 65: TypePointer Uniform 9(fvec4) + 70: 6(int) Constant 3 + 79: 6(int) Constant 1 + 93: 6(int) Constant 5 + 111: TypePointer Input 6(int) + 112(i): 111(ptr) Variable Input + 115: TypePointer Input 12 + 116(input): 115(ptr) Variable Input + 118: TypePointer Output 9(fvec4) +119(@entryPointOutput): 118(ptr) Variable Output + 125: 58 ConstantComposite 25 +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 110(i): 7(ptr) Variable Function + 114(input): 13(ptr) Variable Function + 120(param): 7(ptr) Variable Function + 122(param): 13(ptr) Variable Function + Store 20(C) 25 + 30: 9(fvec4) Load 20(C) + 31: 27 CompositeConstruct 30 25 + Store 29(c2) 31 + 113: 6(int) Load 112(i) + Store 110(i) 113 + 117: 12 Load 116(input) + Store 114(input) 117 + 121: 6(int) Load 110(i) + Store 120(param) 121 + 123: 12 Load 114(input) + Store 122(param) 123 + 124: 9(fvec4) FunctionCall 17(@PixelShaderFunction(i1;vf4[3];) 120(param) 122(param) + Store 119(@entryPointOutput) 124 + Return + FunctionEnd +17(@PixelShaderFunction(i1;vf4[3];): 9(fvec4) Function None 14 + 15(i): 7(ptr) FunctionParameter + 16(input): 13(ptr) FunctionParameter + 18: Label + 35(b): 34(ptr) Variable Function + 48(tmp): 47(ptr) Variable Function + 36: 9(fvec4) Load 20(C) + 37: 9(fvec4) Load 20(C) + 38: 9(fvec4) Load 20(C) + 39: 9(fvec4) Load 20(C) + 40: 9(fvec4) Load 20(C) + 41: 9(fvec4) Load 20(C) + 42: 9(fvec4) Load 20(C) + 43: 9(fvec4) Load 20(C) + 44: 9(fvec4) Load 20(C) + 45: 9(fvec4) Load 20(C) + 46: 33 CompositeConstruct 36 37 38 39 40 41 42 43 44 45 + Store 35(b) 46 + 49: 9(fvec4) Load 20(C) + 66: 65(ptr) AccessChain 62 63 64 + 67: 9(fvec4) Load 66 + 68: 9(fvec4) FAdd 49 67 + 69: 9(fvec4) FAdd 68 25 + 71: 6(int) Load 15(i) + 72: 65(ptr) AccessChain 62 70 71 + 73: 9(fvec4) Load 72 + 74: 9(fvec4) FAdd 69 73 + 75: 6(int) Load 15(i) + 76: 19(ptr) AccessChain 29(c2) 75 + 77: 9(fvec4) Load 76 + 78: 9(fvec4) FAdd 74 77 + Store 48(tmp) 78 + 80: 65(ptr) AccessChain 62 64 79 + 81: 9(fvec4) Load 80 + 82: 6(int) Load 15(i) + 83: 65(ptr) AccessChain 62 64 82 + 84: 9(fvec4) Load 83 + 85: 9(fvec4) FAdd 81 84 + 86: 47(ptr) AccessChain 16(input) 63 + 87: 9(fvec4) Load 86 + 88: 9(fvec4) FAdd 85 87 + 89: 6(int) Load 15(i) + 90: 47(ptr) AccessChain 16(input) 89 + 91: 9(fvec4) Load 90 + 92: 9(fvec4) FAdd 88 91 + 94: 47(ptr) AccessChain 35(b) 93 + 95: 9(fvec4) Load 94 + 96: 9(fvec4) FAdd 92 95 + 97: 6(int) Load 15(i) + 98: 47(ptr) AccessChain 35(b) 97 + 99: 9(fvec4) Load 98 + 100: 9(fvec4) FAdd 96 99 + 101: 6(int) Load 15(i) + 102: 6(int) Load 15(i) + 103: 65(ptr) AccessChain 62 79 101 64 102 + 104: 9(fvec4) Load 103 + 105: 9(fvec4) FAdd 100 104 + 106: 9(fvec4) Load 48(tmp) + 107: 9(fvec4) FAdd 105 106 + ReturnValue 107 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.array.implicit-size.frag.out b/deps/glslang/Test/baseResults/hlsl.array.implicit-size.frag.out new file mode 100644 index 00000000..9af6fed2 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.array.implicit-size.frag.out @@ -0,0 +1,266 @@ +hlsl.array.implicit-size.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Sequence +0:3 move second child to first child ( temp 5-element array of float) +0:3 'g_array' ( global 5-element array of float) +0:3 Constant: +0:3 1.000000 +0:3 2.000000 +0:3 3.000000 +0:3 4.000000 +0:3 5.000000 +0:6 Sequence +0:6 move second child to first child ( temp 7-element array of float) +0:6 'g_array_unused' ( global 7-element array of float) +0:6 Constant: +0:6 1.000000 +0:6 2.000000 +0:6 3.000000 +0:6 4.000000 +0:6 5.000000 +0:6 6.000000 +0:6 7.000000 +0:12 Sequence +0:12 move second child to first child ( temp 2-element array of structure{ temp int i, temp float f}) +0:12 'g_mystruct' ( global 2-element array of structure{ temp int i, temp float f}) +0:12 Constant: +0:12 1 (const int) +0:12 2.000000 +0:12 3 (const int) +0:12 4.000000 +0:26 Function Definition: main(struct-PS_OUTPUT-vf41; ( temp void) +0:26 Function Parameters: +0:26 'ps_output' ( out structure{ temp 4-component vector of float color}) +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp 3-element array of float) +0:28 'l_array' ( temp 3-element array of float) +0:28 Constant: +0:28 1.000000 +0:28 2.000000 +0:28 3.000000 +0:31 move second child to first child ( temp 4-component vector of float) +0:31 color: direct index for structure ( temp 4-component vector of float) +0:31 'ps_output' ( out structure{ temp 4-component vector of float color}) +0:31 Constant: +0:31 0 (const int) +0:31 Construct vec4 ( temp 4-component vector of float) +0:31 add ( temp float) +0:31 add ( temp float) +0:31 add ( temp float) +0:31 add ( temp float) +0:31 direct index ( temp float) +0:31 'g_array' ( global 5-element array of float) +0:31 Constant: +0:31 0 (const int) +0:31 direct index ( temp float) +0:31 'g_array' ( global 5-element array of float) +0:31 Constant: +0:31 4 (const int) +0:31 direct index ( temp float) +0:31 'l_array' ( temp 3-element array of float) +0:31 Constant: +0:31 1 (const int) +0:31 f: direct index for structure ( temp float) +0:31 direct index ( temp structure{ temp int i, temp float f}) +0:31 'g_mystruct' ( global 2-element array of structure{ temp int i, temp float f}) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 indirect index ( temp float) +0:31 'g_array' ( global 5-element array of float) +0:31 'idx' ( temp int) +0:? Linker Objects +0:? 'g_array' ( global 5-element array of float) +0:? 'g_array_unused' ( global 7-element array of float) +0:? 'g_mystruct' ( global 2-element array of structure{ temp int i, temp float f}) + + +Linked fragment stage: + +WARNING: Linking fragment stage: Entry point not found + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Sequence +0:3 move second child to first child ( temp 5-element array of float) +0:3 'g_array' ( global 5-element array of float) +0:3 Constant: +0:3 1.000000 +0:3 2.000000 +0:3 3.000000 +0:3 4.000000 +0:3 5.000000 +0:6 Sequence +0:6 move second child to first child ( temp 7-element array of float) +0:6 'g_array_unused' ( global 7-element array of float) +0:6 Constant: +0:6 1.000000 +0:6 2.000000 +0:6 3.000000 +0:6 4.000000 +0:6 5.000000 +0:6 6.000000 +0:6 7.000000 +0:12 Sequence +0:12 move second child to first child ( temp 2-element array of structure{ temp int i, temp float f}) +0:12 'g_mystruct' ( global 2-element array of structure{ temp int i, temp float f}) +0:12 Constant: +0:12 1 (const int) +0:12 2.000000 +0:12 3 (const int) +0:12 4.000000 +0:26 Function Definition: main(struct-PS_OUTPUT-vf41; ( temp void) +0:26 Function Parameters: +0:26 'ps_output' ( out structure{ temp 4-component vector of float color}) +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp 3-element array of float) +0:28 'l_array' ( temp 3-element array of float) +0:28 Constant: +0:28 1.000000 +0:28 2.000000 +0:28 3.000000 +0:31 move second child to first child ( temp 4-component vector of float) +0:31 color: direct index for structure ( temp 4-component vector of float) +0:31 'ps_output' ( out structure{ temp 4-component vector of float color}) +0:31 Constant: +0:31 0 (const int) +0:31 Construct vec4 ( temp 4-component vector of float) +0:31 add ( temp float) +0:31 add ( temp float) +0:31 add ( temp float) +0:31 add ( temp float) +0:31 direct index ( temp float) +0:31 'g_array' ( global 5-element array of float) +0:31 Constant: +0:31 0 (const int) +0:31 direct index ( temp float) +0:31 'g_array' ( global 5-element array of float) +0:31 Constant: +0:31 4 (const int) +0:31 direct index ( temp float) +0:31 'l_array' ( temp 3-element array of float) +0:31 Constant: +0:31 1 (const int) +0:31 f: direct index for structure ( temp float) +0:31 direct index ( temp structure{ temp int i, temp float f}) +0:31 'g_mystruct' ( global 2-element array of structure{ temp int i, temp float f}) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 indirect index ( temp float) +0:31 'g_array' ( global 5-element array of float) +0:31 'idx' ( temp int) +0:? Linker Objects +0:? 'g_array' ( global 5-element array of float) +0:? 'g_array_unused' ( global 7-element array of float) +0:? 'g_mystruct' ( global 2-element array of structure{ temp int i, temp float f}) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 72 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "color" + Name 12 "main(struct-PS_OUTPUT-vf41;" + Name 11 "ps_output" + Name 18 "g_array" + Name 28 "g_array_unused" + Name 33 "mystruct" + MemberName 33(mystruct) 0 "i" + MemberName 33(mystruct) 1 "f" + Name 37 "g_mystruct" + Name 46 "l_array" + Name 64 "idx" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypePointer Function 8(PS_OUTPUT) + 10: TypeFunction 2 9(ptr) + 14: TypeInt 32 0 + 15: 14(int) Constant 5 + 16: TypeArray 6(float) 15 + 17: TypePointer Private 16 + 18(g_array): 17(ptr) Variable Private + 19: 6(float) Constant 1065353216 + 20: 6(float) Constant 1073741824 + 21: 6(float) Constant 1077936128 + 22: 6(float) Constant 1082130432 + 23: 6(float) Constant 1084227584 + 24: 16 ConstantComposite 19 20 21 22 23 + 25: 14(int) Constant 7 + 26: TypeArray 6(float) 25 + 27: TypePointer Private 26 +28(g_array_unused): 27(ptr) Variable Private + 29: 6(float) Constant 1086324736 + 30: 6(float) Constant 1088421888 + 31: 26 ConstantComposite 19 20 21 22 23 29 30 + 32: TypeInt 32 1 + 33(mystruct): TypeStruct 32(int) 6(float) + 34: 14(int) Constant 2 + 35: TypeArray 33(mystruct) 34 + 36: TypePointer Private 35 + 37(g_mystruct): 36(ptr) Variable Private + 38: 32(int) Constant 1 + 39:33(mystruct) ConstantComposite 38 20 + 40: 32(int) Constant 3 + 41:33(mystruct) ConstantComposite 40 22 + 42: 35 ConstantComposite 39 41 + 43: 14(int) Constant 3 + 44: TypeArray 6(float) 43 + 45: TypePointer Function 44 + 47: 44 ConstantComposite 19 20 21 + 48: 32(int) Constant 0 + 49: TypePointer Private 6(float) + 52: 32(int) Constant 4 + 56: TypePointer Function 6(float) + 63: TypePointer Function 32(int) + 70: TypePointer Function 7(fvec4) +4(PixelShaderFunction): 2 Function None 3 + 5: Label + Store 18(g_array) 24 + Store 28(g_array_unused) 31 + Store 37(g_mystruct) 42 + Return + FunctionEnd +12(main(struct-PS_OUTPUT-vf41;): 2 Function None 10 + 11(ps_output): 9(ptr) FunctionParameter + 13: Label + 46(l_array): 45(ptr) Variable Function + 64(idx): 63(ptr) Variable Function + Store 46(l_array) 47 + 50: 49(ptr) AccessChain 18(g_array) 48 + 51: 6(float) Load 50 + 53: 49(ptr) AccessChain 18(g_array) 52 + 54: 6(float) Load 53 + 55: 6(float) FAdd 51 54 + 57: 56(ptr) AccessChain 46(l_array) 38 + 58: 6(float) Load 57 + 59: 6(float) FAdd 55 58 + 60: 49(ptr) AccessChain 37(g_mystruct) 48 38 + 61: 6(float) Load 60 + 62: 6(float) FAdd 59 61 + 65: 32(int) Load 64(idx) + 66: 49(ptr) AccessChain 18(g_array) 65 + 67: 6(float) Load 66 + 68: 6(float) FAdd 62 67 + 69: 7(fvec4) CompositeConstruct 68 68 68 68 + 71: 70(ptr) AccessChain 11(ps_output) 48 + Store 71 69 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.array.multidim.frag.out b/deps/glslang/Test/baseResults/hlsl.array.multidim.frag.out new file mode 100644 index 00000000..59f64c0e --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.array.multidim.frag.out @@ -0,0 +1,224 @@ +hlsl.array.multidim.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:10 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:10 Function Parameters: +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 direct index ( temp 4-component vector of float) +0:14 direct index ( temp 3-element array of 4-component vector of float) +0:14 'float4_array_1' ( temp 2-element array of 3-element array of 4-component vector of float) +0:14 Constant: +0:14 1 (const int) +0:14 Constant: +0:14 2 (const int) +0:14 Construct vec4 ( temp 4-component vector of float) +0:14 direct index ( temp float) +0:14 direct index ( temp 3-element array of float) +0:14 direct index ( temp 4-element array of 3-element array of float) +0:14 float_array: direct index for structure ( uniform 5-element array of 4-element array of 3-element array of float) +0:14 'anon@0' (layout( row_major std140) uniform block{ uniform 5-element array of 4-element array of 3-element array of float float_array}) +0:14 Constant: +0:14 0 (const uint) +0:14 Constant: +0:14 2 (const int) +0:14 Constant: +0:14 3 (const int) +0:14 Constant: +0:14 1 (const int) +0:15 move second child to first child ( temp 3-element array of 4-component vector of float) +0:15 direct index ( temp 3-element array of 4-component vector of float) +0:15 'float4_array_2' ( temp 5-element array of 3-element array of 4-component vector of float) +0:15 Constant: +0:15 1 (const int) +0:15 direct index ( temp 3-element array of 4-component vector of float) +0:15 'float4_array_1' ( temp 2-element array of 3-element array of 4-component vector of float) +0:15 Constant: +0:15 0 (const int) +0:18 move second child to first child ( temp 4-component vector of float) +0:18 Color: direct index for structure ( temp 4-component vector of float) +0:18 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:18 Constant: +0:18 0 (const int) +0:18 direct index ( temp 4-component vector of float) +0:18 direct index ( temp 3-element array of 4-component vector of float) +0:18 'float4_array_1' ( temp 2-element array of 3-element array of 4-component vector of float) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 2 (const int) +0:19 Branch: Return with expression +0:19 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:10 Function Definition: main( ( temp void) +0:10 Function Parameters: +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:10 Color: direct index for structure ( temp 4-component vector of float) +0:10 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:10 Constant: +0:10 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 5-element array of 4-element array of 3-element array of float float_array}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:10 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:10 Function Parameters: +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 direct index ( temp 4-component vector of float) +0:14 direct index ( temp 3-element array of 4-component vector of float) +0:14 'float4_array_1' ( temp 2-element array of 3-element array of 4-component vector of float) +0:14 Constant: +0:14 1 (const int) +0:14 Constant: +0:14 2 (const int) +0:14 Construct vec4 ( temp 4-component vector of float) +0:14 direct index ( temp float) +0:14 direct index ( temp 3-element array of float) +0:14 direct index ( temp 4-element array of 3-element array of float) +0:14 float_array: direct index for structure ( uniform 5-element array of 4-element array of 3-element array of float) +0:14 'anon@0' (layout( row_major std140) uniform block{ uniform 5-element array of 4-element array of 3-element array of float float_array}) +0:14 Constant: +0:14 0 (const uint) +0:14 Constant: +0:14 2 (const int) +0:14 Constant: +0:14 3 (const int) +0:14 Constant: +0:14 1 (const int) +0:15 move second child to first child ( temp 3-element array of 4-component vector of float) +0:15 direct index ( temp 3-element array of 4-component vector of float) +0:15 'float4_array_2' ( temp 5-element array of 3-element array of 4-component vector of float) +0:15 Constant: +0:15 1 (const int) +0:15 direct index ( temp 3-element array of 4-component vector of float) +0:15 'float4_array_1' ( temp 2-element array of 3-element array of 4-component vector of float) +0:15 Constant: +0:15 0 (const int) +0:18 move second child to first child ( temp 4-component vector of float) +0:18 Color: direct index for structure ( temp 4-component vector of float) +0:18 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:18 Constant: +0:18 0 (const int) +0:18 direct index ( temp 4-component vector of float) +0:18 direct index ( temp 3-element array of 4-component vector of float) +0:18 'float4_array_1' ( temp 2-element array of 3-element array of 4-component vector of float) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 2 (const int) +0:19 Branch: Return with expression +0:19 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:10 Function Definition: main( ( temp void) +0:10 Function Parameters: +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:10 Color: direct index for structure ( temp 4-component vector of float) +0:10 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:10 Constant: +0:10 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 5-element array of 4-element array of 3-element array of float float_array}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 57 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 54 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + Name 10 "@main(" + Name 18 "float4_array_1" + Name 27 "$Global" + MemberName 27($Global) 0 "float_array" + Name 29 "" + Name 40 "float4_array_2" + Name 46 "psout" + Name 54 "@entryPointOutput.Color" + Decorate 22 ArrayStride 16 + Decorate 24 ArrayStride 48 + Decorate 26 ArrayStride 192 + MemberDecorate 27($Global) 0 Offset 0 + Decorate 27($Global) Block + Decorate 29 DescriptorSet 0 + Decorate 54(@entryPointOutput.Color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeInt 32 0 + 13: 12(int) Constant 3 + 14: TypeArray 7(fvec4) 13 + 15: 12(int) Constant 2 + 16: TypeArray 14 15 + 17: TypePointer Function 16 + 19: TypeInt 32 1 + 20: 19(int) Constant 1 + 21: 19(int) Constant 2 + 22: TypeArray 6(float) 13 + 23: 12(int) Constant 4 + 24: TypeArray 22 23 + 25: 12(int) Constant 5 + 26: TypeArray 24 25 + 27($Global): TypeStruct 26 + 28: TypePointer Uniform 27($Global) + 29: 28(ptr) Variable Uniform + 30: 19(int) Constant 0 + 31: 19(int) Constant 3 + 32: TypePointer Uniform 6(float) + 36: TypePointer Function 7(fvec4) + 38: TypeArray 14 25 + 39: TypePointer Function 38 + 41: TypePointer Function 14 + 45: TypePointer Function 8(PS_OUTPUT) + 53: TypePointer Output 7(fvec4) +54(@entryPointOutput.Color): 53(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 55:8(PS_OUTPUT) FunctionCall 10(@main() + 56: 7(fvec4) CompositeExtract 55 0 + Store 54(@entryPointOutput.Color) 56 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label +18(float4_array_1): 17(ptr) Variable Function +40(float4_array_2): 39(ptr) Variable Function + 46(psout): 45(ptr) Variable Function + 33: 32(ptr) AccessChain 29 30 21 31 20 + 34: 6(float) Load 33 + 35: 7(fvec4) CompositeConstruct 34 34 34 34 + 37: 36(ptr) AccessChain 18(float4_array_1) 20 21 + Store 37 35 + 42: 41(ptr) AccessChain 18(float4_array_1) 30 + 43: 14 Load 42 + 44: 41(ptr) AccessChain 40(float4_array_2) 20 + Store 44 43 + 47: 36(ptr) AccessChain 18(float4_array_1) 20 21 + 48: 7(fvec4) Load 47 + 49: 36(ptr) AccessChain 46(psout) 30 + Store 49 48 + 50:8(PS_OUTPUT) Load 46(psout) + ReturnValue 50 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.assoc.frag.out b/deps/glslang/Test/baseResults/hlsl.assoc.frag.out new file mode 100644 index 00000000..562a8633 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.assoc.frag.out @@ -0,0 +1,245 @@ +hlsl.assoc.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: @PixelShaderFunction(vf4;vf4;vf4;vf4;vf4; ( temp 4-component vector of float) +0:8 Function Parameters: +0:8 'a1' ( in 4-component vector of float) +0:8 'a2' ( in 4-component vector of float) +0:8 'a3' ( in 4-component vector of float) +0:8 'a4' ( in 4-component vector of float) +0:8 'a5' ( in 4-component vector of float) +0:? Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:9 'a1' ( in 4-component vector of float) +0:9 move second child to first child ( temp 4-component vector of float) +0:9 'a2' ( in 4-component vector of float) +0:9 move second child to first child ( temp 4-component vector of float) +0:9 'a3' ( in 4-component vector of float) +0:9 move second child to first child ( temp 4-component vector of float) +0:9 'a4' ( in 4-component vector of float) +0:9 'a5' ( in 4-component vector of float) +0:10 Branch: Return with expression +0:10 add ( temp 4-component vector of float) +0:10 add ( temp 4-component vector of float) +0:10 add ( temp 4-component vector of float) +0:10 add ( temp 4-component vector of float) +0:10 'a1' ( in 4-component vector of float) +0:10 'a2' ( in 4-component vector of float) +0:10 'a3' ( in 4-component vector of float) +0:10 'a4' ( in 4-component vector of float) +0:10 'a5' ( in 4-component vector of float) +0:8 Function Definition: PixelShaderFunction( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:? 'a1' ( temp 4-component vector of float) +0:? 'a1' (layout( location=0) in 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:? 'a2' ( temp 4-component vector of float) +0:? 'a2' (layout( location=1) in 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:? 'a3' ( temp 4-component vector of float) +0:? 'a3' (layout( location=2) in 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:? 'a4' ( temp 4-component vector of float) +0:? 'a4' (layout( location=3) in 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:? 'a5' ( temp 4-component vector of float) +0:? 'a5' (layout( location=4) in 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:8 Function Call: @PixelShaderFunction(vf4;vf4;vf4;vf4;vf4; ( temp 4-component vector of float) +0:? 'a1' ( temp 4-component vector of float) +0:? 'a2' ( temp 4-component vector of float) +0:? 'a3' ( temp 4-component vector of float) +0:? 'a4' ( temp 4-component vector of float) +0:? 'a5' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'a1' (layout( location=0) in 4-component vector of float) +0:? 'a2' (layout( location=1) in 4-component vector of float) +0:? 'a3' (layout( location=2) in 4-component vector of float) +0:? 'a4' (layout( location=3) in 4-component vector of float) +0:? 'a5' (layout( location=4) in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: @PixelShaderFunction(vf4;vf4;vf4;vf4;vf4; ( temp 4-component vector of float) +0:8 Function Parameters: +0:8 'a1' ( in 4-component vector of float) +0:8 'a2' ( in 4-component vector of float) +0:8 'a3' ( in 4-component vector of float) +0:8 'a4' ( in 4-component vector of float) +0:8 'a5' ( in 4-component vector of float) +0:? Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:9 'a1' ( in 4-component vector of float) +0:9 move second child to first child ( temp 4-component vector of float) +0:9 'a2' ( in 4-component vector of float) +0:9 move second child to first child ( temp 4-component vector of float) +0:9 'a3' ( in 4-component vector of float) +0:9 move second child to first child ( temp 4-component vector of float) +0:9 'a4' ( in 4-component vector of float) +0:9 'a5' ( in 4-component vector of float) +0:10 Branch: Return with expression +0:10 add ( temp 4-component vector of float) +0:10 add ( temp 4-component vector of float) +0:10 add ( temp 4-component vector of float) +0:10 add ( temp 4-component vector of float) +0:10 'a1' ( in 4-component vector of float) +0:10 'a2' ( in 4-component vector of float) +0:10 'a3' ( in 4-component vector of float) +0:10 'a4' ( in 4-component vector of float) +0:10 'a5' ( in 4-component vector of float) +0:8 Function Definition: PixelShaderFunction( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:? 'a1' ( temp 4-component vector of float) +0:? 'a1' (layout( location=0) in 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:? 'a2' ( temp 4-component vector of float) +0:? 'a2' (layout( location=1) in 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:? 'a3' ( temp 4-component vector of float) +0:? 'a3' (layout( location=2) in 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:? 'a4' ( temp 4-component vector of float) +0:? 'a4' (layout( location=3) in 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:? 'a5' ( temp 4-component vector of float) +0:? 'a5' (layout( location=4) in 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:8 Function Call: @PixelShaderFunction(vf4;vf4;vf4;vf4;vf4; ( temp 4-component vector of float) +0:? 'a1' ( temp 4-component vector of float) +0:? 'a2' ( temp 4-component vector of float) +0:? 'a3' ( temp 4-component vector of float) +0:? 'a4' ( temp 4-component vector of float) +0:? 'a5' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'a1' (layout( location=0) in 4-component vector of float) +0:? 'a2' (layout( location=1) in 4-component vector of float) +0:? 'a3' (layout( location=2) in 4-component vector of float) +0:? 'a4' (layout( location=3) in 4-component vector of float) +0:? 'a5' (layout( location=4) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 58 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 31 34 37 40 43 46 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 15 "@PixelShaderFunction(vf4;vf4;vf4;vf4;vf4;" + Name 10 "a1" + Name 11 "a2" + Name 12 "a3" + Name 13 "a4" + Name 14 "a5" + Name 29 "a1" + Name 31 "a1" + Name 33 "a2" + Name 34 "a2" + Name 36 "a3" + Name 37 "a3" + Name 39 "a4" + Name 40 "a4" + Name 42 "a5" + Name 43 "a5" + Name 46 "@entryPointOutput" + Name 47 "param" + Name 49 "param" + Name 51 "param" + Name 53 "param" + Name 55 "param" + Decorate 31(a1) Location 0 + Decorate 34(a2) Location 1 + Decorate 37(a3) Location 2 + Decorate 40(a4) Location 3 + Decorate 43(a5) Location 4 + Decorate 46(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) 8(ptr) 8(ptr) 8(ptr) 8(ptr) + 30: TypePointer Input 7(fvec4) + 31(a1): 30(ptr) Variable Input + 34(a2): 30(ptr) Variable Input + 37(a3): 30(ptr) Variable Input + 40(a4): 30(ptr) Variable Input + 43(a5): 30(ptr) Variable Input + 45: TypePointer Output 7(fvec4) +46(@entryPointOutput): 45(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 29(a1): 8(ptr) Variable Function + 33(a2): 8(ptr) Variable Function + 36(a3): 8(ptr) Variable Function + 39(a4): 8(ptr) Variable Function + 42(a5): 8(ptr) Variable Function + 47(param): 8(ptr) Variable Function + 49(param): 8(ptr) Variable Function + 51(param): 8(ptr) Variable Function + 53(param): 8(ptr) Variable Function + 55(param): 8(ptr) Variable Function + 32: 7(fvec4) Load 31(a1) + Store 29(a1) 32 + 35: 7(fvec4) Load 34(a2) + Store 33(a2) 35 + 38: 7(fvec4) Load 37(a3) + Store 36(a3) 38 + 41: 7(fvec4) Load 40(a4) + Store 39(a4) 41 + 44: 7(fvec4) Load 43(a5) + Store 42(a5) 44 + 48: 7(fvec4) Load 29(a1) + Store 47(param) 48 + 50: 7(fvec4) Load 33(a2) + Store 49(param) 50 + 52: 7(fvec4) Load 36(a3) + Store 51(param) 52 + 54: 7(fvec4) Load 39(a4) + Store 53(param) 54 + 56: 7(fvec4) Load 42(a5) + Store 55(param) 56 + 57: 7(fvec4) FunctionCall 15(@PixelShaderFunction(vf4;vf4;vf4;vf4;vf4;) 47(param) 49(param) 51(param) 53(param) 55(param) + Store 46(@entryPointOutput) 57 + Return + FunctionEnd +15(@PixelShaderFunction(vf4;vf4;vf4;vf4;vf4;): 7(fvec4) Function None 9 + 10(a1): 8(ptr) FunctionParameter + 11(a2): 8(ptr) FunctionParameter + 12(a3): 8(ptr) FunctionParameter + 13(a4): 8(ptr) FunctionParameter + 14(a5): 8(ptr) FunctionParameter + 16: Label + 17: 7(fvec4) Load 14(a5) + Store 13(a4) 17 + Store 12(a3) 17 + Store 11(a2) 17 + Store 10(a1) 17 + 18: 7(fvec4) Load 10(a1) + 19: 7(fvec4) Load 11(a2) + 20: 7(fvec4) FAdd 18 19 + 21: 7(fvec4) Load 12(a3) + 22: 7(fvec4) FAdd 20 21 + 23: 7(fvec4) Load 13(a4) + 24: 7(fvec4) FAdd 22 23 + 25: 7(fvec4) Load 14(a5) + 26: 7(fvec4) FAdd 24 25 + ReturnValue 26 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.attribute.expression.comp.out b/deps/glslang/Test/baseResults/hlsl.attribute.expression.comp.out new file mode 100644 index 00000000..4bef5e76 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.attribute.expression.comp.out @@ -0,0 +1,152 @@ +hlsl.attribute.expression.comp +Shader version: 500 +local_size = (4, 6, 8) +0:? Sequence +0:9 Function Definition: @main( ( temp 4-component vector of float) +0:9 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp int) +0:11 'x' ( temp int) +0:11 Constant: +0:11 0 (const int) +0:11 Loop with condition tested first: Unroll +0:11 Loop Condition +0:11 Compare Less Than ( temp bool) +0:11 'x' ( temp int) +0:11 bound: direct index for structure ( uniform int) +0:11 'anon@0' (layout( row_major std140) uniform block{ uniform int bound}) +0:11 Constant: +0:11 0 (const uint) +0:11 No loop body +0:11 Loop Terminal Expression +0:11 Pre-Increment ( temp int) +0:11 'x' ( temp int) +0:14 Branch: Return with expression +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:9 Function Definition: main( ( temp void) +0:9 Function Parameters: +0:? Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:9 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int bound}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked compute stage: + + +Shader version: 500 +local_size = (4, 6, 8) +0:? Sequence +0:9 Function Definition: @main( ( temp 4-component vector of float) +0:9 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp int) +0:11 'x' ( temp int) +0:11 Constant: +0:11 0 (const int) +0:11 Loop with condition tested first: Unroll +0:11 Loop Condition +0:11 Compare Less Than ( temp bool) +0:11 'x' ( temp int) +0:11 bound: direct index for structure ( uniform int) +0:11 'anon@0' (layout( row_major std140) uniform block{ uniform int bound}) +0:11 Constant: +0:11 0 (const uint) +0:11 No loop body +0:11 Loop Terminal Expression +0:11 Pre-Increment ( temp int) +0:11 'x' ( temp int) +0:14 Branch: Return with expression +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:9 Function Definition: main( ( temp void) +0:9 Function Parameters: +0:? Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:9 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int bound}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 39 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 37 + ExecutionMode 4 LocalSize 4 6 8 + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 13 "x" + Name 21 "$Global" + MemberName 21($Global) 0 "bound" + Name 23 "" + Name 37 "@entryPointOutput" + MemberDecorate 21($Global) 0 Offset 0 + Decorate 21($Global) Block + Decorate 23 DescriptorSet 0 + Decorate 37(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeInt 32 1 + 12: TypePointer Function 11(int) + 14: 11(int) Constant 0 + 21($Global): TypeStruct 11(int) + 22: TypePointer Uniform 21($Global) + 23: 22(ptr) Variable Uniform + 24: TypePointer Uniform 11(int) + 27: TypeBool + 30: 11(int) Constant 1 + 32: 6(float) Constant 0 + 33: 7(fvec4) ConstantComposite 32 32 32 32 + 36: TypePointer Output 7(fvec4) +37(@entryPointOutput): 36(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 38: 7(fvec4) FunctionCall 9(@main() + Store 37(@entryPointOutput) 38 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 13(x): 12(ptr) Variable Function + Store 13(x) 14 + Branch 15 + 15: Label + LoopMerge 17 18 Unroll + Branch 19 + 19: Label + 20: 11(int) Load 13(x) + 25: 24(ptr) AccessChain 23 14 + 26: 11(int) Load 25 + 28: 27(bool) SLessThan 20 26 + BranchConditional 28 16 17 + 16: Label + Branch 18 + 18: Label + 29: 11(int) Load 13(x) + 31: 11(int) IAdd 29 30 + Store 13(x) 31 + Branch 15 + 17: Label + ReturnValue 33 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.attribute.frag.out b/deps/glslang/Test/baseResults/hlsl.attribute.frag.out new file mode 100644 index 00000000..44e963e0 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.attribute.frag.out @@ -0,0 +1,99 @@ +hlsl.attribute.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(vf4; ( temp void) +0:2 Function Parameters: +0:2 'input' ( in 4-component vector of float) +0:? Sequence +0:11 Test condition and select ( temp void): DontFlatten +0:11 Condition +0:11 Constant: +0:11 false (const bool) +0:11 true case is null +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:2 Function Call: @PixelShaderFunction(vf4; ( temp void) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'input' (layout( location=0) in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(vf4; ( temp void) +0:2 Function Parameters: +0:2 'input' ( in 4-component vector of float) +0:? Sequence +0:11 Test condition and select ( temp void): DontFlatten +0:11 Condition +0:11 Constant: +0:11 false (const bool) +0:11 true case is null +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:2 Function Call: @PixelShaderFunction(vf4; ( temp void) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'input' (layout( location=0) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 24 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 19 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 11 "@PixelShaderFunction(vf4;" + Name 10 "input" + Name 17 "input" + Name 19 "input" + Name 21 "param" + Decorate 19(input) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 2 8(ptr) + 13: TypeBool + 14: 13(bool) ConstantFalse + 18: TypePointer Input 7(fvec4) + 19(input): 18(ptr) Variable Input +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 17(input): 8(ptr) Variable Function + 21(param): 8(ptr) Variable Function + 20: 7(fvec4) Load 19(input) + Store 17(input) 20 + 22: 7(fvec4) Load 17(input) + Store 21(param) 22 + 23: 2 FunctionCall 11(@PixelShaderFunction(vf4;) 21(param) + Return + FunctionEnd +11(@PixelShaderFunction(vf4;): 2 Function None 9 + 10(input): 8(ptr) FunctionParameter + 12: Label + SelectionMerge 16 DontFlatten + BranchConditional 14 15 16 + 15: Label + Branch 16 + 16: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.attributeC11.frag.out b/deps/glslang/Test/baseResults/hlsl.attributeC11.frag.out new file mode 100644 index 00000000..afc74669 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.attributeC11.frag.out @@ -0,0 +1,197 @@ +hlsl.attributeC11.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:20 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:20 Function Parameters: +0:20 'input' ( in 4-component vector of float) +0:? Sequence +0:21 Branch: Return with expression +0:21 add ( temp 4-component vector of float) +0:21 'input' ( in 4-component vector of float) +0:21 textureFetch ( temp 4-component vector of float) +0:21 'attach' ( uniform texture2D) +0:21 vector swizzle ( temp int) +0:21 Constant: +0:21 0 (const int) +0:21 0 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 direct index ( temp int) +0:21 Constant: +0:21 0 (const int) +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=8) in 4-component vector of float) +0:20 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=7) out 4-component vector of float) +0:20 Function Call: @main(vf4; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'buffer1' (layout( set=0 binding=1 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 2-component vector of float f} @data}) +0:? 'buffer3' (layout( set=2 binding=3 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 2-component vector of float f} @data}) +0:? 'attach' ( uniform texture2D) +0:? 'ci' ( specialization-constant const int) +0:? 11 (const int) +0:? 'anon@0' (layout( row_major std430 push_constant) uniform block{layout( row_major std430 offset=0) uniform int a}) +0:? '@entryPointOutput' (layout( location=7) out 4-component vector of float) +0:? 'input' (layout( location=8) in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:20 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:20 Function Parameters: +0:20 'input' ( in 4-component vector of float) +0:? Sequence +0:21 Branch: Return with expression +0:21 add ( temp 4-component vector of float) +0:21 'input' ( in 4-component vector of float) +0:21 textureFetch ( temp 4-component vector of float) +0:21 'attach' ( uniform texture2D) +0:21 vector swizzle ( temp int) +0:21 Constant: +0:21 0 (const int) +0:21 0 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 direct index ( temp int) +0:21 Constant: +0:21 0 (const int) +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=8) in 4-component vector of float) +0:20 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=7) out 4-component vector of float) +0:20 Function Call: @main(vf4; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'buffer1' (layout( set=0 binding=1 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 2-component vector of float f} @data}) +0:? 'buffer3' (layout( set=2 binding=3 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 2-component vector of float f} @data}) +0:? 'attach' ( uniform texture2D) +0:? 'ci' ( specialization-constant const int) +0:? 11 (const int) +0:? 'anon@0' (layout( row_major std430 push_constant) uniform block{layout( row_major std430 offset=0) uniform int a}) +0:? '@entryPointOutput' (layout( location=7) out 4-component vector of float) +0:? 'input' (layout( location=8) in 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: Operand 2 of Decorate requires one of these capabilities: InputAttachment + OpDecorate %attach InputAttachmentIndex 4 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 51 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 33 36 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vf4;" + Name 10 "input" + Name 16 "attach" + Name 31 "input" + Name 33 "input" + Name 36 "@entryPointOutput" + Name 37 "param" + Name 41 "S" + MemberName 41(S) 0 "f" + Name 43 "buffer1" + MemberName 43(buffer1) 0 "@data" + Name 45 "buffer1" + Name 46 "buffer3" + Name 47 "ci" + Name 48 "pcBuf" + MemberName 48(pcBuf) 0 "a" + Name 50 "" + Decorate 16(attach) DescriptorSet 0 + Decorate 16(attach) InputAttachmentIndex 4 + Decorate 33(input) Location 8 + Decorate 36(@entryPointOutput) Location 7 + MemberDecorate 41(S) 0 Offset 0 + Decorate 42 ArrayStride 8 + MemberDecorate 43(buffer1) 0 NonWritable + MemberDecorate 43(buffer1) 0 Offset 0 + Decorate 43(buffer1) BufferBlock + Decorate 45(buffer1) DescriptorSet 0 + Decorate 45(buffer1) Binding 1 + Decorate 46(buffer3) DescriptorSet 2 + Decorate 46(buffer3) Binding 3 + Decorate 47(ci) SpecId 13 + MemberDecorate 48(pcBuf) 0 Offset 0 + Decorate 48(pcBuf) Block + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) + 14: TypeImage 6(float) 2D sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(attach): 15(ptr) Variable UniformConstant + 18: TypeInt 32 1 + 19: TypeVector 18(int) 2 + 20: 18(int) Constant 0 + 21: 19(ivec2) ConstantComposite 20 20 + 22: TypeInt 32 0 + 23: 22(int) Constant 0 + 25: 22(int) Constant 1 + 32: TypePointer Input 7(fvec4) + 33(input): 32(ptr) Variable Input + 35: TypePointer Output 7(fvec4) +36(@entryPointOutput): 35(ptr) Variable Output + 40: TypeVector 6(float) 2 + 41(S): TypeStruct 40(fvec2) + 42: TypeRuntimeArray 41(S) + 43(buffer1): TypeStruct 42 + 44: TypePointer Uniform 43(buffer1) + 45(buffer1): 44(ptr) Variable Uniform + 46(buffer3): 44(ptr) Variable Uniform + 47(ci): 18(int) SpecConstant 11 + 48(pcBuf): TypeStruct 18(int) + 49: TypePointer PushConstant 48(pcBuf) + 50: 49(ptr) Variable PushConstant + 4(main): 2 Function None 3 + 5: Label + 31(input): 8(ptr) Variable Function + 37(param): 8(ptr) Variable Function + 34: 7(fvec4) Load 33(input) + Store 31(input) 34 + 38: 7(fvec4) Load 31(input) + Store 37(param) 38 + 39: 7(fvec4) FunctionCall 11(@main(vf4;) 37(param) + Store 36(@entryPointOutput) 39 + Return + FunctionEnd + 11(@main(vf4;): 7(fvec4) Function None 9 + 10(input): 8(ptr) FunctionParameter + 12: Label + 13: 7(fvec4) Load 10(input) + 17: 14 Load 16(attach) + 24: 18(int) CompositeExtract 21 0 + 26: 18(int) CompositeExtract 21 1 + 27: 7(fvec4) ImageFetch 17 24 Lod 26 + 28: 7(fvec4) FAdd 13 27 + ReturnValue 28 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.attributeGlobalBuffer.frag.out b/deps/glslang/Test/baseResults/hlsl.attributeGlobalBuffer.frag.out new file mode 100644 index 00000000..e3784473 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.attributeGlobalBuffer.frag.out @@ -0,0 +1,109 @@ +hlsl.attributeGlobalBuffer.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:6 Function Definition: @main( ( temp 4-component vector of float) +0:6 Function Parameters: +0:? Sequence +0:7 Branch: Return with expression +0:7 add ( temp 4-component vector of float) +0:7 u1: direct index for structure ( uniform 4-component vector of float) +0:7 'anon@0' (layout( set=2 binding=5 row_major std140) uniform block{ uniform 4-component vector of float u1, uniform 4-component vector of float u2}) +0:7 Constant: +0:7 0 (const uint) +0:7 u2: direct index for structure ( uniform 4-component vector of float) +0:7 'anon@0' (layout( set=2 binding=5 row_major std140) uniform block{ uniform 4-component vector of float u1, uniform 4-component vector of float u2}) +0:7 Constant: +0:7 1 (const uint) +0:6 Function Definition: main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:6 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( set=2 binding=5 row_major std140) uniform block{ uniform 4-component vector of float u1, uniform 4-component vector of float u2}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:6 Function Definition: @main( ( temp 4-component vector of float) +0:6 Function Parameters: +0:? Sequence +0:7 Branch: Return with expression +0:7 add ( temp 4-component vector of float) +0:7 u1: direct index for structure ( uniform 4-component vector of float) +0:7 'anon@0' (layout( set=2 binding=5 row_major std140) uniform block{ uniform 4-component vector of float u1, uniform 4-component vector of float u2}) +0:7 Constant: +0:7 0 (const uint) +0:7 u2: direct index for structure ( uniform 4-component vector of float) +0:7 'anon@0' (layout( set=2 binding=5 row_major std140) uniform block{ uniform 4-component vector of float u1, uniform 4-component vector of float u2}) +0:7 Constant: +0:7 1 (const uint) +0:6 Function Definition: main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:6 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( set=2 binding=5 row_major std140) uniform block{ uniform 4-component vector of float u1, uniform 4-component vector of float u2}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 28 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 26 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 11 "$Global" + MemberName 11($Global) 0 "u1" + MemberName 11($Global) 1 "u2" + Name 13 "" + Name 26 "@entryPointOutput" + MemberDecorate 11($Global) 0 Offset 0 + MemberDecorate 11($Global) 1 Offset 16 + Decorate 11($Global) Block + Decorate 13 DescriptorSet 2 + Decorate 13 Binding 5 + Decorate 26(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11($Global): TypeStruct 7(fvec4) 7(fvec4) + 12: TypePointer Uniform 11($Global) + 13: 12(ptr) Variable Uniform + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16: TypePointer Uniform 7(fvec4) + 19: 14(int) Constant 1 + 25: TypePointer Output 7(fvec4) +26(@entryPointOutput): 25(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 27: 7(fvec4) FunctionCall 9(@main() + Store 26(@entryPointOutput) 27 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 17: 16(ptr) AccessChain 13 15 + 18: 7(fvec4) Load 17 + 20: 16(ptr) AccessChain 13 19 + 21: 7(fvec4) Load 20 + 22: 7(fvec4) FAdd 18 21 + ReturnValue 22 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.automap.frag.out b/deps/glslang/Test/baseResults/hlsl.automap.frag.out new file mode 100644 index 00000000..b9ab49cd --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.automap.frag.out @@ -0,0 +1,29 @@ +hlsl.automap.frag +Uniform reflection: +t1: offset -1, type 8b5d, size 1, index -1, binding 11, stages 16 +t2: offset -1, type 8b5e, size 1, index -1, binding 12, stages 16 +t3: offset -1, type 8b5f, size 1, index -1, binding 13, stages 16 +t4.@data: offset 0, type 8b52, size 1, index 0, binding -1, stages 16 +t5.@data: offset 0, type 1405, size 0, index 1, binding -1, stages 16 +t6: offset -1, type 8dc2, size 1, index -1, binding 16, stages 16 +s1: offset -1, type 0, size 1, index -1, binding 31, stages 16 +s2: offset -1, type 0, size 1, index -1, binding 32, stages 16 +u1: offset -1, type 904c, size 1, index -1, binding 41, stages 16 +u2: offset -1, type 904d, size 1, index -1, binding 42, stages 16 +u3: offset -1, type 904e, size 1, index -1, binding 43, stages 16 +u4: offset -1, type 9051, size 1, index -1, binding 44, stages 16 +u5.@data: offset 0, type 1405, size 0, index 2, binding -1, stages 16 +u6.@data: offset 0, type 1406, size 1, index 3, binding -1, stages 16 +cb1: offset 0, type 1404, size 1, index 4, binding -1, stages 16 +tb1: offset 0, type 1404, size 1, index 5, binding -1, stages 16 + +Uniform block reflection: +t4: offset -1, type ffffffff, size 0, index -1, binding 14, stages 0 +t5: offset -1, type ffffffff, size 0, index -1, binding 15, stages 0 +u5: offset -1, type ffffffff, size 0, index -1, binding 45, stages 0 +u6: offset -1, type ffffffff, size 0, index -1, binding 46, stages 0 +cb: offset -1, type ffffffff, size 4, index -1, binding 51, stages 0 +tb: offset -1, type ffffffff, size 4, index -1, binding 17, stages 0 + +Vertex attribute reflection: + diff --git a/deps/glslang/Test/baseResults/hlsl.basic.comp.out b/deps/glslang/Test/baseResults/hlsl.basic.comp.out new file mode 100644 index 00000000..d84642e9 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.basic.comp.out @@ -0,0 +1,132 @@ +hlsl.basic.comp +Shader version: 500 +local_size = (1, 1, 1) +0:? Sequence +0:4 Function Definition: @main(i1;i1; ( temp void) +0:4 Function Parameters: +0:4 'dti' ( in int) +0:4 'gti' ( in int) +0:? Sequence +0:5 subtract ( temp int) +0:5 'dti' ( in int) +0:5 'gti' ( in int) +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 move second child to first child ( temp int) +0:? 'dti' ( temp int) +0:? Construct int ( temp int) +0:? 'dti' ( in 3-component vector of int GlobalInvocationID) +0:4 move second child to first child ( temp int) +0:? 'gti' ( temp int) +0:? Construct int ( temp int) +0:? 'gti' ( in 3-component vector of int LocalInvocationID) +0:4 Function Call: @main(i1;i1; ( temp void) +0:? 'dti' ( temp int) +0:? 'gti' ( temp int) +0:? Linker Objects +0:? 'a' ( shared 100-element array of 4-component vector of float) +0:? 'dti' ( in 3-component vector of int GlobalInvocationID) +0:? 'gti' ( in 3-component vector of int LocalInvocationID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (1, 1, 1) +0:? Sequence +0:4 Function Definition: @main(i1;i1; ( temp void) +0:4 Function Parameters: +0:4 'dti' ( in int) +0:4 'gti' ( in int) +0:? Sequence +0:5 subtract ( temp int) +0:5 'dti' ( in int) +0:5 'gti' ( in int) +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 move second child to first child ( temp int) +0:? 'dti' ( temp int) +0:? Construct int ( temp int) +0:? 'dti' ( in 3-component vector of int GlobalInvocationID) +0:4 move second child to first child ( temp int) +0:? 'gti' ( temp int) +0:? Construct int ( temp int) +0:? 'gti' ( in 3-component vector of int LocalInvocationID) +0:4 Function Call: @main(i1;i1; ( temp void) +0:? 'dti' ( temp int) +0:? 'gti' ( temp int) +0:? Linker Objects +0:? 'a' ( shared 100-element array of 4-component vector of float) +0:? 'dti' ( in 3-component vector of int GlobalInvocationID) +0:? 'gti' ( in 3-component vector of int LocalInvocationID) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 38 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 19 23 + ExecutionMode 4 LocalSize 1 1 1 + Source HLSL 500 + Name 4 "main" + Name 11 "@main(i1;i1;" + Name 9 "dti" + Name 10 "gti" + Name 16 "dti" + Name 19 "dti" + Name 22 "gti" + Name 23 "gti" + Name 26 "param" + Name 28 "param" + Name 37 "a" + Decorate 19(dti) BuiltIn GlobalInvocationId + Decorate 23(gti) BuiltIn LocalInvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 8: TypeFunction 2 7(ptr) 7(ptr) + 17: TypeVector 6(int) 3 + 18: TypePointer Input 17(ivec3) + 19(dti): 18(ptr) Variable Input + 23(gti): 18(ptr) Variable Input + 31: TypeFloat 32 + 32: TypeVector 31(float) 4 + 33: TypeInt 32 0 + 34: 33(int) Constant 100 + 35: TypeArray 32(fvec4) 34 + 36: TypePointer Workgroup 35 + 37(a): 36(ptr) Variable Workgroup + 4(main): 2 Function None 3 + 5: Label + 16(dti): 7(ptr) Variable Function + 22(gti): 7(ptr) Variable Function + 26(param): 7(ptr) Variable Function + 28(param): 7(ptr) Variable Function + 20: 17(ivec3) Load 19(dti) + 21: 6(int) CompositeExtract 20 0 + Store 16(dti) 21 + 24: 17(ivec3) Load 23(gti) + 25: 6(int) CompositeExtract 24 0 + Store 22(gti) 25 + 27: 6(int) Load 16(dti) + Store 26(param) 27 + 29: 6(int) Load 22(gti) + Store 28(param) 29 + 30: 2 FunctionCall 11(@main(i1;i1;) 26(param) 28(param) + Return + FunctionEnd +11(@main(i1;i1;): 2 Function None 8 + 9(dti): 7(ptr) FunctionParameter + 10(gti): 7(ptr) FunctionParameter + 12: Label + 13: 6(int) Load 9(dti) + 14: 6(int) Load 10(gti) + 15: 6(int) ISub 13 14 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.basic.geom.out b/deps/glslang/Test/baseResults/hlsl.basic.geom.out new file mode 100644 index 00000000..f4116d4e --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.basic.geom.out @@ -0,0 +1,309 @@ +hlsl.basic.geom +Shader version: 500 +invocations = -1 +max_vertices = 4 +input primitive = triangles +output primitive = line_strip +0:? Sequence +0:16 Function Definition: @main(u1[3];u1[3];struct-PSInput-f1-i11; ( temp void) +0:16 Function Parameters: +0:16 'VertexID' ( in 3-element array of uint) +0:16 'test' ( in 3-element array of uint) +0:16 'OutputStream' ( out structure{ temp float myfloat, temp int something}) +0:? Sequence +0:19 move second child to first child ( temp float) +0:19 myfloat: direct index for structure ( temp float) +0:19 'Vert' ( temp structure{ temp float myfloat, temp int something}) +0:19 Constant: +0:19 0 (const int) +0:19 Convert uint to float ( temp float) +0:19 add ( temp uint) +0:19 add ( temp uint) +0:19 direct index ( temp uint) +0:19 'test' ( in 3-element array of uint) +0:19 Constant: +0:19 0 (const int) +0:19 direct index ( temp uint) +0:19 'test' ( in 3-element array of uint) +0:19 Constant: +0:19 1 (const int) +0:19 direct index ( temp uint) +0:19 'test' ( in 3-element array of uint) +0:19 Constant: +0:19 2 (const int) +0:20 move second child to first child ( temp int) +0:20 something: direct index for structure ( temp int) +0:20 'Vert' ( temp structure{ temp float myfloat, temp int something}) +0:20 Constant: +0:20 1 (const int) +0:20 Convert uint to int ( temp int) +0:20 direct index ( temp uint) +0:20 'VertexID' ( in 3-element array of uint) +0:20 Constant: +0:20 0 (const int) +0:22 Sequence +0:22 Sequence +0:22 move second child to first child ( temp float) +0:? 'OutputStream.myfloat' (layout( location=0) out float) +0:22 myfloat: direct index for structure ( temp float) +0:22 'Vert' ( temp structure{ temp float myfloat, temp int something}) +0:22 Constant: +0:22 0 (const int) +0:22 move second child to first child ( temp int) +0:? 'OutputStream.something' (layout( location=1) out int) +0:22 something: direct index for structure ( temp int) +0:22 'Vert' ( temp structure{ temp float myfloat, temp int something}) +0:22 Constant: +0:22 1 (const int) +0:22 EmitVertex ( temp void) +0:23 Sequence +0:23 Sequence +0:23 move second child to first child ( temp float) +0:? 'OutputStream.myfloat' (layout( location=0) out float) +0:23 myfloat: direct index for structure ( temp float) +0:23 'Vert' ( temp structure{ temp float myfloat, temp int something}) +0:23 Constant: +0:23 0 (const int) +0:23 move second child to first child ( temp int) +0:? 'OutputStream.something' (layout( location=1) out int) +0:23 something: direct index for structure ( temp int) +0:23 'Vert' ( temp structure{ temp float myfloat, temp int something}) +0:23 Constant: +0:23 1 (const int) +0:23 EmitVertex ( temp void) +0:24 EndPrimitive ( temp void) +0:16 Function Definition: main( ( temp void) +0:16 Function Parameters: +0:? Sequence +0:16 move second child to first child ( temp 3-element array of uint) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:16 move second child to first child ( temp 3-element array of uint) +0:? 'test' ( temp 3-element array of uint) +0:? 'test' (layout( location=1) in 3-element array of uint) +0:16 Function Call: @main(u1[3];u1[3];struct-PSInput-f1-i11; ( temp void) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'test' ( temp 3-element array of uint) +0:? 'OutputStream' ( temp structure{ temp float myfloat, temp int something}) +0:? Linker Objects +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? 'test' (layout( location=1) in 3-element array of uint) +0:? 'OutputStream.myfloat' (layout( location=0) out float) +0:? 'OutputStream.something' (layout( location=1) out int) + + +Linked geometry stage: + + +Shader version: 500 +invocations = 1 +max_vertices = 4 +input primitive = triangles +output primitive = line_strip +0:? Sequence +0:16 Function Definition: @main(u1[3];u1[3];struct-PSInput-f1-i11; ( temp void) +0:16 Function Parameters: +0:16 'VertexID' ( in 3-element array of uint) +0:16 'test' ( in 3-element array of uint) +0:16 'OutputStream' ( out structure{ temp float myfloat, temp int something}) +0:? Sequence +0:19 move second child to first child ( temp float) +0:19 myfloat: direct index for structure ( temp float) +0:19 'Vert' ( temp structure{ temp float myfloat, temp int something}) +0:19 Constant: +0:19 0 (const int) +0:19 Convert uint to float ( temp float) +0:19 add ( temp uint) +0:19 add ( temp uint) +0:19 direct index ( temp uint) +0:19 'test' ( in 3-element array of uint) +0:19 Constant: +0:19 0 (const int) +0:19 direct index ( temp uint) +0:19 'test' ( in 3-element array of uint) +0:19 Constant: +0:19 1 (const int) +0:19 direct index ( temp uint) +0:19 'test' ( in 3-element array of uint) +0:19 Constant: +0:19 2 (const int) +0:20 move second child to first child ( temp int) +0:20 something: direct index for structure ( temp int) +0:20 'Vert' ( temp structure{ temp float myfloat, temp int something}) +0:20 Constant: +0:20 1 (const int) +0:20 Convert uint to int ( temp int) +0:20 direct index ( temp uint) +0:20 'VertexID' ( in 3-element array of uint) +0:20 Constant: +0:20 0 (const int) +0:22 Sequence +0:22 Sequence +0:22 move second child to first child ( temp float) +0:? 'OutputStream.myfloat' (layout( location=0) out float) +0:22 myfloat: direct index for structure ( temp float) +0:22 'Vert' ( temp structure{ temp float myfloat, temp int something}) +0:22 Constant: +0:22 0 (const int) +0:22 move second child to first child ( temp int) +0:? 'OutputStream.something' (layout( location=1) out int) +0:22 something: direct index for structure ( temp int) +0:22 'Vert' ( temp structure{ temp float myfloat, temp int something}) +0:22 Constant: +0:22 1 (const int) +0:22 EmitVertex ( temp void) +0:23 Sequence +0:23 Sequence +0:23 move second child to first child ( temp float) +0:? 'OutputStream.myfloat' (layout( location=0) out float) +0:23 myfloat: direct index for structure ( temp float) +0:23 'Vert' ( temp structure{ temp float myfloat, temp int something}) +0:23 Constant: +0:23 0 (const int) +0:23 move second child to first child ( temp int) +0:? 'OutputStream.something' (layout( location=1) out int) +0:23 something: direct index for structure ( temp int) +0:23 'Vert' ( temp structure{ temp float myfloat, temp int something}) +0:23 Constant: +0:23 1 (const int) +0:23 EmitVertex ( temp void) +0:24 EndPrimitive ( temp void) +0:16 Function Definition: main( ( temp void) +0:16 Function Parameters: +0:? Sequence +0:16 move second child to first child ( temp 3-element array of uint) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:16 move second child to first child ( temp 3-element array of uint) +0:? 'test' ( temp 3-element array of uint) +0:? 'test' (layout( location=1) in 3-element array of uint) +0:16 Function Call: @main(u1[3];u1[3];struct-PSInput-f1-i11; ( temp void) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'test' ( temp 3-element array of uint) +0:? 'OutputStream' ( temp structure{ temp float myfloat, temp int something}) +0:? Linker Objects +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? 'test' (layout( location=1) in 3-element array of uint) +0:? 'OutputStream.myfloat' (layout( location=0) out float) +0:? 'OutputStream.something' (layout( location=1) out int) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 68 + + Capability Geometry + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 42 46 55 58 + ExecutionMode 4 Triangles + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputLineStrip + ExecutionMode 4 OutputVertices 4 + Source HLSL 500 + Name 4 "main" + Name 12 "PSInput" + MemberName 12(PSInput) 0 "myfloat" + MemberName 12(PSInput) 1 "something" + Name 18 "@main(u1[3];u1[3];struct-PSInput-f1-i11;" + Name 15 "VertexID" + Name 16 "test" + Name 17 "OutputStream" + Name 20 "Vert" + Name 42 "OutputStream.myfloat" + Name 46 "OutputStream.something" + Name 53 "VertexID" + Name 55 "VertexID" + Name 57 "test" + Name 58 "test" + Name 60 "OutputStream" + Name 61 "param" + Name 63 "param" + Name 65 "param" + Decorate 42(OutputStream.myfloat) Location 0 + Decorate 46(OutputStream.something) Location 1 + Decorate 55(VertexID) Location 0 + Decorate 58(test) Location 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: 6(int) Constant 3 + 8: TypeArray 6(int) 7 + 9: TypePointer Function 8 + 10: TypeFloat 32 + 11: TypeInt 32 1 + 12(PSInput): TypeStruct 10(float) 11(int) + 13: TypePointer Function 12(PSInput) + 14: TypeFunction 2 9(ptr) 9(ptr) 13(ptr) + 21: 11(int) Constant 0 + 22: TypePointer Function 6(int) + 25: 11(int) Constant 1 + 29: 11(int) Constant 2 + 34: TypePointer Function 10(float) + 39: TypePointer Function 11(int) + 41: TypePointer Output 10(float) +42(OutputStream.myfloat): 41(ptr) Variable Output + 45: TypePointer Output 11(int) +46(OutputStream.something): 45(ptr) Variable Output + 54: TypePointer Input 8 + 55(VertexID): 54(ptr) Variable Input + 58(test): 54(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 53(VertexID): 9(ptr) Variable Function + 57(test): 9(ptr) Variable Function +60(OutputStream): 13(ptr) Variable Function + 61(param): 9(ptr) Variable Function + 63(param): 9(ptr) Variable Function + 65(param): 13(ptr) Variable Function + 56: 8 Load 55(VertexID) + Store 53(VertexID) 56 + 59: 8 Load 58(test) + Store 57(test) 59 + 62: 8 Load 53(VertexID) + Store 61(param) 62 + 64: 8 Load 57(test) + Store 63(param) 64 + 66: 2 FunctionCall 18(@main(u1[3];u1[3];struct-PSInput-f1-i11;) 61(param) 63(param) 65(param) + 67: 12(PSInput) Load 65(param) + Store 60(OutputStream) 67 + Return + FunctionEnd +18(@main(u1[3];u1[3];struct-PSInput-f1-i11;): 2 Function None 14 + 15(VertexID): 9(ptr) FunctionParameter + 16(test): 9(ptr) FunctionParameter +17(OutputStream): 13(ptr) FunctionParameter + 19: Label + 20(Vert): 13(ptr) Variable Function + 23: 22(ptr) AccessChain 16(test) 21 + 24: 6(int) Load 23 + 26: 22(ptr) AccessChain 16(test) 25 + 27: 6(int) Load 26 + 28: 6(int) IAdd 24 27 + 30: 22(ptr) AccessChain 16(test) 29 + 31: 6(int) Load 30 + 32: 6(int) IAdd 28 31 + 33: 10(float) ConvertUToF 32 + 35: 34(ptr) AccessChain 20(Vert) 21 + Store 35 33 + 36: 22(ptr) AccessChain 15(VertexID) 21 + 37: 6(int) Load 36 + 38: 11(int) Bitcast 37 + 40: 39(ptr) AccessChain 20(Vert) 25 + Store 40 38 + 43: 34(ptr) AccessChain 20(Vert) 21 + 44: 10(float) Load 43 + Store 42(OutputStream.myfloat) 44 + 47: 39(ptr) AccessChain 20(Vert) 25 + 48: 11(int) Load 47 + Store 46(OutputStream.something) 48 + EmitVertex + 49: 34(ptr) AccessChain 20(Vert) 21 + 50: 10(float) Load 49 + Store 42(OutputStream.myfloat) 50 + 51: 39(ptr) AccessChain 20(Vert) 25 + 52: 11(int) Load 51 + Store 46(OutputStream.something) 52 + EmitVertex + EndPrimitive + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.boolConv.vert.out b/deps/glslang/Test/baseResults/hlsl.boolConv.vert.out new file mode 100644 index 00000000..d88955fa --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.boolConv.vert.out @@ -0,0 +1,333 @@ +hlsl.boolConv.vert +Shader version: 500 +0:? Sequence +0:1 Sequence +0:1 move second child to first child ( temp bool) +0:1 'b' ( global bool) +0:1 Constant: +0:1 true (const bool) +0:3 Function Definition: @main( ( temp 4-component vector of float) +0:3 Function Parameters: +0:? Sequence +0:4 Sequence +0:4 move second child to first child ( temp int) +0:4 'r' ( temp int) +0:4 Constant: +0:4 0 (const int) +0:6 add second child into first child ( temp int) +0:6 'r' ( temp int) +0:6 add ( temp int) +0:6 Convert bool to int ( temp int) +0:6 'a' ( global bool) +0:6 Convert bool to int ( temp int) +0:6 'b' ( global bool) +0:7 add second child into first child ( temp int) +0:7 'r' ( temp int) +0:7 subtract ( temp int) +0:7 Convert bool to int ( temp int) +0:7 'a' ( global bool) +0:7 Convert bool to int ( temp int) +0:7 'b' ( global bool) +0:8 add second child into first child ( temp int) +0:8 'r' ( temp int) +0:8 component-wise multiply ( temp int) +0:8 Convert bool to int ( temp int) +0:8 'a' ( global bool) +0:8 Convert bool to int ( temp int) +0:8 'b' ( global bool) +0:9 add second child into first child ( temp int) +0:9 'r' ( temp int) +0:9 divide ( temp int) +0:9 Convert bool to int ( temp int) +0:9 'a' ( global bool) +0:9 Convert bool to int ( temp int) +0:9 'b' ( global bool) +0:10 add second child into first child ( temp int) +0:10 'r' ( temp int) +0:10 mod ( temp int) +0:10 Convert bool to int ( temp int) +0:10 'a' ( global bool) +0:10 Convert bool to int ( temp int) +0:10 'b' ( global bool) +0:12 add second child into first child ( temp int) +0:12 'r' ( temp int) +0:12 bitwise and ( temp int) +0:12 Convert bool to int ( temp int) +0:12 'a' ( global bool) +0:12 Convert bool to int ( temp int) +0:12 'b' ( global bool) +0:13 add second child into first child ( temp int) +0:13 'r' ( temp int) +0:13 inclusive-or ( temp int) +0:13 Convert bool to int ( temp int) +0:13 'a' ( global bool) +0:13 Convert bool to int ( temp int) +0:13 'b' ( global bool) +0:14 add second child into first child ( temp int) +0:14 'r' ( temp int) +0:14 exclusive-or ( temp int) +0:14 Convert bool to int ( temp int) +0:14 'a' ( global bool) +0:14 Convert bool to int ( temp int) +0:14 'b' ( global bool) +0:16 add second child into first child ( temp int) +0:16 'r' ( temp int) +0:16 left-shift ( temp int) +0:16 Convert bool to int ( temp int) +0:16 'a' ( global bool) +0:16 Convert bool to int ( temp int) +0:16 'b' ( global bool) +0:17 add second child into first child ( temp int) +0:17 'r' ( temp int) +0:17 right-shift ( temp int) +0:17 Convert bool to int ( temp int) +0:17 'a' ( global bool) +0:17 Convert bool to int ( temp int) +0:17 'b' ( global bool) +0:19 Branch: Return with expression +0:19 Construct vec4 ( temp 4-component vector of float) +0:19 Convert int to float ( temp float) +0:19 'r' ( temp int) +0:3 Function Definition: main( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:3 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:3 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'a' ( global bool) +0:? 'b' ( global bool) +0:? '@entryPointOutput' ( out 4-component vector of float Position) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:1 Sequence +0:1 move second child to first child ( temp bool) +0:1 'b' ( global bool) +0:1 Constant: +0:1 true (const bool) +0:3 Function Definition: @main( ( temp 4-component vector of float) +0:3 Function Parameters: +0:? Sequence +0:4 Sequence +0:4 move second child to first child ( temp int) +0:4 'r' ( temp int) +0:4 Constant: +0:4 0 (const int) +0:6 add second child into first child ( temp int) +0:6 'r' ( temp int) +0:6 add ( temp int) +0:6 Convert bool to int ( temp int) +0:6 'a' ( global bool) +0:6 Convert bool to int ( temp int) +0:6 'b' ( global bool) +0:7 add second child into first child ( temp int) +0:7 'r' ( temp int) +0:7 subtract ( temp int) +0:7 Convert bool to int ( temp int) +0:7 'a' ( global bool) +0:7 Convert bool to int ( temp int) +0:7 'b' ( global bool) +0:8 add second child into first child ( temp int) +0:8 'r' ( temp int) +0:8 component-wise multiply ( temp int) +0:8 Convert bool to int ( temp int) +0:8 'a' ( global bool) +0:8 Convert bool to int ( temp int) +0:8 'b' ( global bool) +0:9 add second child into first child ( temp int) +0:9 'r' ( temp int) +0:9 divide ( temp int) +0:9 Convert bool to int ( temp int) +0:9 'a' ( global bool) +0:9 Convert bool to int ( temp int) +0:9 'b' ( global bool) +0:10 add second child into first child ( temp int) +0:10 'r' ( temp int) +0:10 mod ( temp int) +0:10 Convert bool to int ( temp int) +0:10 'a' ( global bool) +0:10 Convert bool to int ( temp int) +0:10 'b' ( global bool) +0:12 add second child into first child ( temp int) +0:12 'r' ( temp int) +0:12 bitwise and ( temp int) +0:12 Convert bool to int ( temp int) +0:12 'a' ( global bool) +0:12 Convert bool to int ( temp int) +0:12 'b' ( global bool) +0:13 add second child into first child ( temp int) +0:13 'r' ( temp int) +0:13 inclusive-or ( temp int) +0:13 Convert bool to int ( temp int) +0:13 'a' ( global bool) +0:13 Convert bool to int ( temp int) +0:13 'b' ( global bool) +0:14 add second child into first child ( temp int) +0:14 'r' ( temp int) +0:14 exclusive-or ( temp int) +0:14 Convert bool to int ( temp int) +0:14 'a' ( global bool) +0:14 Convert bool to int ( temp int) +0:14 'b' ( global bool) +0:16 add second child into first child ( temp int) +0:16 'r' ( temp int) +0:16 left-shift ( temp int) +0:16 Convert bool to int ( temp int) +0:16 'a' ( global bool) +0:16 Convert bool to int ( temp int) +0:16 'b' ( global bool) +0:17 add second child into first child ( temp int) +0:17 'r' ( temp int) +0:17 right-shift ( temp int) +0:17 Convert bool to int ( temp int) +0:17 'a' ( global bool) +0:17 Convert bool to int ( temp int) +0:17 'b' ( global bool) +0:19 Branch: Return with expression +0:19 Construct vec4 ( temp 4-component vector of float) +0:19 Convert int to float ( temp float) +0:19 'r' ( temp int) +0:3 Function Definition: main( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:3 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:3 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'a' ( global bool) +0:? 'b' ( global bool) +0:? '@entryPointOutput' ( out 4-component vector of float Position) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 99 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 97 + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 13 "b" + Name 17 "r" + Name 19 "a" + Name 97 "@entryPointOutput" + Decorate 97(@entryPointOutput) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeBool + 12: TypePointer Private 11(bool) + 13(b): 12(ptr) Variable Private + 14: 11(bool) ConstantTrue + 15: TypeInt 32 1 + 16: TypePointer Function 15(int) + 18: 15(int) Constant 0 + 19(a): 12(ptr) Variable Private + 21: 15(int) Constant 1 + 96: TypePointer Output 7(fvec4) +97(@entryPointOutput): 96(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + Store 13(b) 14 + 98: 7(fvec4) FunctionCall 9(@main() + Store 97(@entryPointOutput) 98 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 17(r): 16(ptr) Variable Function + Store 17(r) 18 + 20: 11(bool) Load 19(a) + 22: 15(int) Select 20 21 18 + 23: 11(bool) Load 13(b) + 24: 15(int) Select 23 21 18 + 25: 15(int) IAdd 22 24 + 26: 15(int) Load 17(r) + 27: 15(int) IAdd 26 25 + Store 17(r) 27 + 28: 11(bool) Load 19(a) + 29: 15(int) Select 28 21 18 + 30: 11(bool) Load 13(b) + 31: 15(int) Select 30 21 18 + 32: 15(int) ISub 29 31 + 33: 15(int) Load 17(r) + 34: 15(int) IAdd 33 32 + Store 17(r) 34 + 35: 11(bool) Load 19(a) + 36: 15(int) Select 35 21 18 + 37: 11(bool) Load 13(b) + 38: 15(int) Select 37 21 18 + 39: 15(int) IMul 36 38 + 40: 15(int) Load 17(r) + 41: 15(int) IAdd 40 39 + Store 17(r) 41 + 42: 11(bool) Load 19(a) + 43: 15(int) Select 42 21 18 + 44: 11(bool) Load 13(b) + 45: 15(int) Select 44 21 18 + 46: 15(int) SDiv 43 45 + 47: 15(int) Load 17(r) + 48: 15(int) IAdd 47 46 + Store 17(r) 48 + 49: 11(bool) Load 19(a) + 50: 15(int) Select 49 21 18 + 51: 11(bool) Load 13(b) + 52: 15(int) Select 51 21 18 + 53: 15(int) SMod 50 52 + 54: 15(int) Load 17(r) + 55: 15(int) IAdd 54 53 + Store 17(r) 55 + 56: 11(bool) Load 19(a) + 57: 15(int) Select 56 21 18 + 58: 11(bool) Load 13(b) + 59: 15(int) Select 58 21 18 + 60: 15(int) BitwiseAnd 57 59 + 61: 15(int) Load 17(r) + 62: 15(int) IAdd 61 60 + Store 17(r) 62 + 63: 11(bool) Load 19(a) + 64: 15(int) Select 63 21 18 + 65: 11(bool) Load 13(b) + 66: 15(int) Select 65 21 18 + 67: 15(int) BitwiseOr 64 66 + 68: 15(int) Load 17(r) + 69: 15(int) IAdd 68 67 + Store 17(r) 69 + 70: 11(bool) Load 19(a) + 71: 15(int) Select 70 21 18 + 72: 11(bool) Load 13(b) + 73: 15(int) Select 72 21 18 + 74: 15(int) BitwiseXor 71 73 + 75: 15(int) Load 17(r) + 76: 15(int) IAdd 75 74 + Store 17(r) 76 + 77: 11(bool) Load 19(a) + 78: 15(int) Select 77 21 18 + 79: 11(bool) Load 13(b) + 80: 15(int) Select 79 21 18 + 81: 15(int) ShiftLeftLogical 78 80 + 82: 15(int) Load 17(r) + 83: 15(int) IAdd 82 81 + Store 17(r) 83 + 84: 11(bool) Load 19(a) + 85: 15(int) Select 84 21 18 + 86: 11(bool) Load 13(b) + 87: 15(int) Select 86 21 18 + 88: 15(int) ShiftRightArithmetic 85 87 + 89: 15(int) Load 17(r) + 90: 15(int) IAdd 89 88 + Store 17(r) 90 + 91: 15(int) Load 17(r) + 92: 6(float) ConvertSToF 91 + 93: 7(fvec4) CompositeConstruct 92 92 92 92 + ReturnValue 93 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.buffer.frag.out b/deps/glslang/Test/baseResults/hlsl.buffer.frag.out new file mode 100644 index 00000000..4528d98b --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.buffer.frag.out @@ -0,0 +1,327 @@ +hlsl.buffer.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:30 Function Definition: foo( ( temp float) +0:30 Function Parameters: +0:? Sequence +0:31 Branch: Return with expression +0:31 Constant: +0:31 1.000000 +0:43 Function Definition: @PixelShaderFunction(vf4; ( temp structure{ temp 4-component vector of float a}) +0:43 Function Parameters: +0:43 'input' ( in 4-component vector of float) +0:? Sequence +0:45 move second child to first child ( temp 4-component vector of float) +0:45 a: direct index for structure ( temp 4-component vector of float) +0:45 'ret' ( temp structure{ temp 4-component vector of float a}) +0:45 Constant: +0:45 0 (const int) +0:45 add ( temp 4-component vector of float) +0:45 v24: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:45 'anon@4' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v24}) +0:45 Constant: +0:45 0 (const uint) +0:45 vector-scale ( temp 4-component vector of float) +0:45 add ( temp 4-component vector of float) +0:45 add ( temp 4-component vector of float) +0:45 add ( temp 4-component vector of float) +0:45 add ( temp 4-component vector of float) +0:45 'input' ( in 4-component vector of float) +0:45 v1: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:45 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v1}) +0:45 Constant: +0:45 0 (const uint) +0:45 v2: direct index for structure (layout( row_major std430) buffer 4-component vector of float) +0:45 'anon@1' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float v2}) +0:45 Constant: +0:45 0 (const uint) +0:45 v3: direct index for structure (layout( row_major std140 offset=0) uniform 4-component vector of float) +0:45 'anon@2' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3}) +0:45 Constant: +0:45 0 (const uint) +0:45 v4: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float) +0:45 'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430 offset=128) buffer float f7, layout( row_major std430 offset=112) buffer 3X4 matrix of float m1, layout( column_major std430 offset=176) buffer 3X4 matrix of float m2, layout( row_major std430 offset=240) buffer 3X4 matrix of float m3, layout( row_major std430 offset=304) buffer 3X4 matrix of float m4}) +0:45 Constant: +0:45 0 (const uint) +0:45 Function Call: foo( ( temp float) +0:46 Branch: Return with expression +0:46 'ret' ( temp structure{ temp 4-component vector of float a}) +0:43 Function Definition: PixelShaderFunction( ( temp void) +0:43 Function Parameters: +0:? Sequence +0:43 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' ( in 4-component vector of float FragCoord) +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.a' (layout( location=0) out 4-component vector of float) +0:43 a: direct index for structure ( temp 4-component vector of float) +0:43 Function Call: @PixelShaderFunction(vf4; ( temp structure{ temp 4-component vector of float a}) +0:? 'input' ( temp 4-component vector of float) +0:43 Constant: +0:43 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v1}) +0:? 'anon@1' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float v2}) +0:? 'anon@2' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3}) +0:? 'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430 offset=128) buffer float f7, layout( row_major std430 offset=112) buffer 3X4 matrix of float m1, layout( column_major std430 offset=176) buffer 3X4 matrix of float m2, layout( row_major std430 offset=240) buffer 3X4 matrix of float m3, layout( row_major std430 offset=304) buffer 3X4 matrix of float m4}) +0:? 'anon@4' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v24}) +0:? '@entryPointOutput.a' (layout( location=0) out 4-component vector of float) +0:? 'input' ( in 4-component vector of float FragCoord) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:30 Function Definition: foo( ( temp float) +0:30 Function Parameters: +0:? Sequence +0:31 Branch: Return with expression +0:31 Constant: +0:31 1.000000 +0:43 Function Definition: @PixelShaderFunction(vf4; ( temp structure{ temp 4-component vector of float a}) +0:43 Function Parameters: +0:43 'input' ( in 4-component vector of float) +0:? Sequence +0:45 move second child to first child ( temp 4-component vector of float) +0:45 a: direct index for structure ( temp 4-component vector of float) +0:45 'ret' ( temp structure{ temp 4-component vector of float a}) +0:45 Constant: +0:45 0 (const int) +0:45 add ( temp 4-component vector of float) +0:45 v24: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:45 'anon@4' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v24}) +0:45 Constant: +0:45 0 (const uint) +0:45 vector-scale ( temp 4-component vector of float) +0:45 add ( temp 4-component vector of float) +0:45 add ( temp 4-component vector of float) +0:45 add ( temp 4-component vector of float) +0:45 add ( temp 4-component vector of float) +0:45 'input' ( in 4-component vector of float) +0:45 v1: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:45 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v1}) +0:45 Constant: +0:45 0 (const uint) +0:45 v2: direct index for structure (layout( row_major std430) buffer 4-component vector of float) +0:45 'anon@1' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float v2}) +0:45 Constant: +0:45 0 (const uint) +0:45 v3: direct index for structure (layout( row_major std140 offset=0) uniform 4-component vector of float) +0:45 'anon@2' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3}) +0:45 Constant: +0:45 0 (const uint) +0:45 v4: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float) +0:45 'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430 offset=128) buffer float f7, layout( row_major std430 offset=112) buffer 3X4 matrix of float m1, layout( column_major std430 offset=176) buffer 3X4 matrix of float m2, layout( row_major std430 offset=240) buffer 3X4 matrix of float m3, layout( row_major std430 offset=304) buffer 3X4 matrix of float m4}) +0:45 Constant: +0:45 0 (const uint) +0:45 Function Call: foo( ( temp float) +0:46 Branch: Return with expression +0:46 'ret' ( temp structure{ temp 4-component vector of float a}) +0:43 Function Definition: PixelShaderFunction( ( temp void) +0:43 Function Parameters: +0:? Sequence +0:43 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' ( in 4-component vector of float FragCoord) +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.a' (layout( location=0) out 4-component vector of float) +0:43 a: direct index for structure ( temp 4-component vector of float) +0:43 Function Call: @PixelShaderFunction(vf4; ( temp structure{ temp 4-component vector of float a}) +0:? 'input' ( temp 4-component vector of float) +0:43 Constant: +0:43 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v1}) +0:? 'anon@1' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float v2}) +0:? 'anon@2' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3}) +0:? 'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430 offset=128) buffer float f7, layout( row_major std430 offset=112) buffer 3X4 matrix of float m1, layout( column_major std430 offset=176) buffer 3X4 matrix of float m2, layout( row_major std430 offset=240) buffer 3X4 matrix of float m3, layout( row_major std430 offset=304) buffer 3X4 matrix of float m4}) +0:? 'anon@4' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v24}) +0:? '@entryPointOutput.a' (layout( location=0) out 4-component vector of float) +0:? 'input' ( in 4-component vector of float FragCoord) + +error: SPIRV-Tools Validation Errors +error: Structure id 50 decorated as BufferBlock for variable in Uniform storage class must follow standard storage buffer layout rules: member 7 at offset 128 overlaps previous member ending at offset 171 + %tbufName = OpTypeStruct %v4float %int %float %float %float %float %float %float %mat3v4float %mat3v4float %mat3v4float %mat3v4float + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 73 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 65 68 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 8 "foo(" + Name 12 "id" + MemberName 12(id) 0 "a" + Name 15 "@PixelShaderFunction(vf4;" + Name 14 "input" + Name 21 "ret" + Name 24 "cbufName2" + MemberName 24(cbufName2) 0 "v24" + Name 26 "" + Name 31 "buf1" + MemberName 31(buf1) 0 "v1" + Name 33 "" + Name 37 "buf2" + MemberName 37(buf2) 0 "v2" + Name 39 "" + Name 43 "cbufName" + MemberName 43(cbufName) 0 "v3" + MemberName 43(cbufName) 1 "i3" + Name 45 "" + Name 50 "tbufName" + MemberName 50(tbufName) 0 "v4" + MemberName 50(tbufName) 1 "i4" + MemberName 50(tbufName) 2 "f1" + MemberName 50(tbufName) 3 "f3" + MemberName 50(tbufName) 4 "f4" + MemberName 50(tbufName) 5 "f5" + MemberName 50(tbufName) 6 "f6" + MemberName 50(tbufName) 7 "f7" + MemberName 50(tbufName) 8 "m1" + MemberName 50(tbufName) 9 "m2" + MemberName 50(tbufName) 10 "m3" + MemberName 50(tbufName) 11 "m4" + Name 52 "" + Name 63 "input" + Name 65 "input" + Name 68 "@entryPointOutput.a" + Name 69 "param" + MemberDecorate 24(cbufName2) 0 Offset 0 + Decorate 24(cbufName2) Block + Decorate 26 DescriptorSet 0 + MemberDecorate 31(buf1) 0 Offset 0 + Decorate 31(buf1) Block + Decorate 33 DescriptorSet 0 + MemberDecorate 37(buf2) 0 NonWritable + MemberDecorate 37(buf2) 0 Offset 0 + Decorate 37(buf2) BufferBlock + Decorate 39 DescriptorSet 0 + MemberDecorate 43(cbufName) 0 Offset 0 + MemberDecorate 43(cbufName) 1 Offset 20 + Decorate 43(cbufName) Block + Decorate 45 DescriptorSet 0 + MemberDecorate 50(tbufName) 0 NonWritable + MemberDecorate 50(tbufName) 0 Offset 16 + MemberDecorate 50(tbufName) 1 NonWritable + MemberDecorate 50(tbufName) 1 Offset 48 + MemberDecorate 50(tbufName) 2 NonWritable + MemberDecorate 50(tbufName) 2 Offset 60 + MemberDecorate 50(tbufName) 3 NonWritable + MemberDecorate 50(tbufName) 3 Offset 64 + MemberDecorate 50(tbufName) 4 NonWritable + MemberDecorate 50(tbufName) 4 Offset 68 + MemberDecorate 50(tbufName) 5 NonWritable + MemberDecorate 50(tbufName) 5 Offset 72 + MemberDecorate 50(tbufName) 6 NonWritable + MemberDecorate 50(tbufName) 6 Offset 76 + MemberDecorate 50(tbufName) 7 NonWritable + MemberDecorate 50(tbufName) 7 Offset 128 + MemberDecorate 50(tbufName) 8 RowMajor + MemberDecorate 50(tbufName) 8 NonWritable + MemberDecorate 50(tbufName) 8 Offset 112 + MemberDecorate 50(tbufName) 8 MatrixStride 16 + MemberDecorate 50(tbufName) 9 ColMajor + MemberDecorate 50(tbufName) 9 NonWritable + MemberDecorate 50(tbufName) 9 Offset 176 + MemberDecorate 50(tbufName) 9 MatrixStride 16 + MemberDecorate 50(tbufName) 10 RowMajor + MemberDecorate 50(tbufName) 10 NonWritable + MemberDecorate 50(tbufName) 10 Offset 240 + MemberDecorate 50(tbufName) 10 MatrixStride 16 + MemberDecorate 50(tbufName) 11 RowMajor + MemberDecorate 50(tbufName) 11 NonWritable + MemberDecorate 50(tbufName) 11 Offset 304 + MemberDecorate 50(tbufName) 11 MatrixStride 16 + Decorate 50(tbufName) BufferBlock + Decorate 52 DescriptorSet 0 + Decorate 52 Binding 8 + Decorate 65(input) BuiltIn FragCoord + Decorate 68(@entryPointOutput.a) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeFunction 6(float) + 10: TypeVector 6(float) 4 + 11: TypePointer Function 10(fvec4) + 12(id): TypeStruct 10(fvec4) + 13: TypeFunction 12(id) 11(ptr) + 17: 6(float) Constant 1065353216 + 20: TypePointer Function 12(id) + 22: TypeInt 32 1 + 23: 22(int) Constant 0 + 24(cbufName2): TypeStruct 10(fvec4) + 25: TypePointer Uniform 24(cbufName2) + 26: 25(ptr) Variable Uniform + 27: TypePointer Uniform 10(fvec4) + 31(buf1): TypeStruct 10(fvec4) + 32: TypePointer Uniform 31(buf1) + 33: 32(ptr) Variable Uniform + 37(buf2): TypeStruct 10(fvec4) + 38: TypePointer Uniform 37(buf2) + 39: 38(ptr) Variable Uniform + 43(cbufName): TypeStruct 10(fvec4) 22(int) + 44: TypePointer Uniform 43(cbufName) + 45: 44(ptr) Variable Uniform + 49: TypeMatrix 10(fvec4) 3 + 50(tbufName): TypeStruct 10(fvec4) 22(int) 6(float) 6(float) 6(float) 6(float) 6(float) 6(float) 49 49 49 49 + 51: TypePointer Uniform 50(tbufName) + 52: 51(ptr) Variable Uniform + 64: TypePointer Input 10(fvec4) + 65(input): 64(ptr) Variable Input + 67: TypePointer Output 10(fvec4) +68(@entryPointOutput.a): 67(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 63(input): 11(ptr) Variable Function + 69(param): 11(ptr) Variable Function + 66: 10(fvec4) Load 65(input) + Store 63(input) 66 + 70: 10(fvec4) Load 63(input) + Store 69(param) 70 + 71: 12(id) FunctionCall 15(@PixelShaderFunction(vf4;) 69(param) + 72: 10(fvec4) CompositeExtract 71 0 + Store 68(@entryPointOutput.a) 72 + Return + FunctionEnd + 8(foo(): 6(float) Function None 7 + 9: Label + ReturnValue 17 + FunctionEnd +15(@PixelShaderFunction(vf4;): 12(id) Function None 13 + 14(input): 11(ptr) FunctionParameter + 16: Label + 21(ret): 20(ptr) Variable Function + 28: 27(ptr) AccessChain 26 23 + 29: 10(fvec4) Load 28 + 30: 10(fvec4) Load 14(input) + 34: 27(ptr) AccessChain 33 23 + 35: 10(fvec4) Load 34 + 36: 10(fvec4) FAdd 30 35 + 40: 27(ptr) AccessChain 39 23 + 41: 10(fvec4) Load 40 + 42: 10(fvec4) FAdd 36 41 + 46: 27(ptr) AccessChain 45 23 + 47: 10(fvec4) Load 46 + 48: 10(fvec4) FAdd 42 47 + 53: 27(ptr) AccessChain 52 23 + 54: 10(fvec4) Load 53 + 55: 10(fvec4) FAdd 48 54 + 56: 6(float) FunctionCall 8(foo() + 57: 10(fvec4) VectorTimesScalar 55 56 + 58: 10(fvec4) FAdd 29 57 + 59: 11(ptr) AccessChain 21(ret) 23 + Store 59 58 + 60: 12(id) Load 21(ret) + ReturnValue 60 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.calculatelod.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.calculatelod.dx10.frag.out new file mode 100644 index 00000000..46b4eea5 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.calculatelod.dx10.frag.out @@ -0,0 +1,580 @@ +hlsl.calculatelod.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp float) +0:28 'txval10' ( temp float) +0:28 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:28 Construct combined texture-sampler ( temp sampler1DArray) +0:28 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:28 'g_sSamp' (layout( binding=0) uniform sampler) +0:28 Constant: +0:28 0.100000 +0:28 Constant: +0:28 0 (const int) +0:29 Sequence +0:29 move second child to first child ( temp float) +0:29 'txval11' ( temp float) +0:29 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:29 Construct combined texture-sampler ( temp isampler1DArray) +0:29 'g_tTex1di4a' ( uniform itexture1DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:29 Constant: +0:29 0.200000 +0:29 Constant: +0:29 0 (const int) +0:30 Sequence +0:30 move second child to first child ( temp float) +0:30 'txval12' ( temp float) +0:30 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:30 Construct combined texture-sampler ( temp usampler1DArray) +0:30 'g_tTex1du4a' ( uniform utexture1DArray) +0:30 'g_sSamp' (layout( binding=0) uniform sampler) +0:30 Constant: +0:30 0.300000 +0:30 Constant: +0:30 0 (const int) +0:32 Sequence +0:32 move second child to first child ( temp float) +0:32 'txval20' ( temp float) +0:32 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:32 Construct combined texture-sampler ( temp sampler2DArray) +0:32 'g_tTex2df4a' ( uniform texture2DArray) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:32 Constant: +0:32 0 (const int) +0:33 Sequence +0:33 move second child to first child ( temp float) +0:33 'txval21' ( temp float) +0:33 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:33 Construct combined texture-sampler ( temp isampler2DArray) +0:33 'g_tTex2di4a' ( uniform itexture2DArray) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:33 Constant: +0:33 0 (const int) +0:34 Sequence +0:34 move second child to first child ( temp float) +0:34 'txval22' ( temp float) +0:34 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:34 Construct combined texture-sampler ( temp usampler2DArray) +0:34 'g_tTex2du4a' ( uniform utexture2DArray) +0:34 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:34 Constant: +0:34 0 (const int) +0:36 Sequence +0:36 move second child to first child ( temp float) +0:36 'txval40' ( temp float) +0:36 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:36 Construct combined texture-sampler ( temp samplerCubeArray) +0:36 'g_tTexcdf4a' ( uniform textureCubeArray) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:36 Constant: +0:36 0 (const int) +0:37 Sequence +0:37 move second child to first child ( temp float) +0:37 'txval41' ( temp float) +0:37 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:37 Construct combined texture-sampler ( temp isamplerCubeArray) +0:37 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:37 Constant: +0:37 0 (const int) +0:38 Sequence +0:38 move second child to first child ( temp float) +0:38 'txval42' ( temp float) +0:38 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:38 Construct combined texture-sampler ( temp usamplerCubeArray) +0:38 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:38 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:38 Constant: +0:38 0 (const int) +0:40 move second child to first child ( temp 4-component vector of float) +0:40 Color: direct index for structure ( temp 4-component vector of float) +0:40 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1.000000 +0:40 1.000000 +0:40 1.000000 +0:40 1.000000 +0:41 move second child to first child ( temp float) +0:41 Depth: direct index for structure ( temp float) +0:41 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:41 Constant: +0:41 1 (const int) +0:41 Constant: +0:41 1.000000 +0:43 Branch: Return with expression +0:43 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:24 Color: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:24 Depth: direct index for structure ( temp float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp float) +0:28 'txval10' ( temp float) +0:28 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:28 Construct combined texture-sampler ( temp sampler1DArray) +0:28 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:28 'g_sSamp' (layout( binding=0) uniform sampler) +0:28 Constant: +0:28 0.100000 +0:28 Constant: +0:28 0 (const int) +0:29 Sequence +0:29 move second child to first child ( temp float) +0:29 'txval11' ( temp float) +0:29 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:29 Construct combined texture-sampler ( temp isampler1DArray) +0:29 'g_tTex1di4a' ( uniform itexture1DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:29 Constant: +0:29 0.200000 +0:29 Constant: +0:29 0 (const int) +0:30 Sequence +0:30 move second child to first child ( temp float) +0:30 'txval12' ( temp float) +0:30 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:30 Construct combined texture-sampler ( temp usampler1DArray) +0:30 'g_tTex1du4a' ( uniform utexture1DArray) +0:30 'g_sSamp' (layout( binding=0) uniform sampler) +0:30 Constant: +0:30 0.300000 +0:30 Constant: +0:30 0 (const int) +0:32 Sequence +0:32 move second child to first child ( temp float) +0:32 'txval20' ( temp float) +0:32 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:32 Construct combined texture-sampler ( temp sampler2DArray) +0:32 'g_tTex2df4a' ( uniform texture2DArray) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:32 Constant: +0:32 0 (const int) +0:33 Sequence +0:33 move second child to first child ( temp float) +0:33 'txval21' ( temp float) +0:33 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:33 Construct combined texture-sampler ( temp isampler2DArray) +0:33 'g_tTex2di4a' ( uniform itexture2DArray) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:33 Constant: +0:33 0 (const int) +0:34 Sequence +0:34 move second child to first child ( temp float) +0:34 'txval22' ( temp float) +0:34 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:34 Construct combined texture-sampler ( temp usampler2DArray) +0:34 'g_tTex2du4a' ( uniform utexture2DArray) +0:34 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:34 Constant: +0:34 0 (const int) +0:36 Sequence +0:36 move second child to first child ( temp float) +0:36 'txval40' ( temp float) +0:36 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:36 Construct combined texture-sampler ( temp samplerCubeArray) +0:36 'g_tTexcdf4a' ( uniform textureCubeArray) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:36 Constant: +0:36 0 (const int) +0:37 Sequence +0:37 move second child to first child ( temp float) +0:37 'txval41' ( temp float) +0:37 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:37 Construct combined texture-sampler ( temp isamplerCubeArray) +0:37 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:37 Constant: +0:37 0 (const int) +0:38 Sequence +0:38 move second child to first child ( temp float) +0:38 'txval42' ( temp float) +0:38 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:38 Construct combined texture-sampler ( temp usamplerCubeArray) +0:38 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:38 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:38 Constant: +0:38 0 (const int) +0:40 move second child to first child ( temp 4-component vector of float) +0:40 Color: direct index for structure ( temp 4-component vector of float) +0:40 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1.000000 +0:40 1.000000 +0:40 1.000000 +0:40 1.000000 +0:41 move second child to first child ( temp float) +0:41 Depth: direct index for structure ( temp float) +0:41 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:41 Constant: +0:41 1 (const int) +0:41 Constant: +0:41 1.000000 +0:43 Branch: Return with expression +0:43 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:24 Color: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:24 Depth: direct index for structure ( temp float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 148 + + Capability Shader + Capability Sampled1D + Capability SampledCubeArray + Capability ImageQuery + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 140 144 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval10" + Name 16 "g_tTex1df4a" + Name 20 "g_sSamp" + Name 30 "txval11" + Name 33 "g_tTex1di4a" + Name 41 "txval12" + Name 45 "g_tTex1du4a" + Name 53 "txval20" + Name 56 "g_tTex2df4a" + Name 64 "txval21" + Name 67 "g_tTex2di4a" + Name 76 "txval22" + Name 79 "g_tTex2du4a" + Name 89 "txval40" + Name 92 "g_tTexcdf4a" + Name 101 "txval41" + Name 104 "g_tTexcdi4a" + Name 112 "txval42" + Name 115 "g_tTexcdu4a" + Name 127 "psout" + Name 137 "flattenTemp" + Name 140 "@entryPointOutput.Color" + Name 144 "@entryPointOutput.Depth" + Name 147 "g_tTex1df4" + Decorate 16(g_tTex1df4a) DescriptorSet 0 + Decorate 16(g_tTex1df4a) Binding 1 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 33(g_tTex1di4a) DescriptorSet 0 + Decorate 45(g_tTex1du4a) DescriptorSet 0 + Decorate 56(g_tTex2df4a) DescriptorSet 0 + Decorate 67(g_tTex2di4a) DescriptorSet 0 + Decorate 79(g_tTex2du4a) DescriptorSet 0 + Decorate 92(g_tTexcdf4a) DescriptorSet 0 + Decorate 104(g_tTexcdi4a) DescriptorSet 0 + Decorate 115(g_tTexcdu4a) DescriptorSet 0 + Decorate 140(@entryPointOutput.Color) Location 0 + Decorate 144(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 147(g_tTex1df4) DescriptorSet 0 + Decorate 147(g_tTex1df4) Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 6(float) + 14: TypeImage 6(float) 1D array sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4a): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: 6(float) Constant 1036831949 + 25: TypeVector 6(float) 2 + 27: TypeInt 32 1 + 28: 27(int) Constant 0 + 31: TypeImage 27(int) 1D array sampled format:Unknown + 32: TypePointer UniformConstant 31 + 33(g_tTex1di4a): 32(ptr) Variable UniformConstant + 36: TypeSampledImage 31 + 38: 6(float) Constant 1045220557 + 42: TypeInt 32 0 + 43: TypeImage 42(int) 1D array sampled format:Unknown + 44: TypePointer UniformConstant 43 + 45(g_tTex1du4a): 44(ptr) Variable UniformConstant + 48: TypeSampledImage 43 + 50: 6(float) Constant 1050253722 + 54: TypeImage 6(float) 2D array sampled format:Unknown + 55: TypePointer UniformConstant 54 + 56(g_tTex2df4a): 55(ptr) Variable UniformConstant + 59: TypeSampledImage 54 + 61: 25(fvec2) ConstantComposite 24 38 + 65: TypeImage 27(int) 2D array sampled format:Unknown + 66: TypePointer UniformConstant 65 + 67(g_tTex2di4a): 66(ptr) Variable UniformConstant + 70: TypeSampledImage 65 + 72: 6(float) Constant 1053609165 + 73: 25(fvec2) ConstantComposite 50 72 + 77: TypeImage 42(int) 2D array sampled format:Unknown + 78: TypePointer UniformConstant 77 + 79(g_tTex2du4a): 78(ptr) Variable UniformConstant + 82: TypeSampledImage 77 + 84: 6(float) Constant 1056964608 + 85: 6(float) Constant 1058642330 + 86: 25(fvec2) ConstantComposite 84 85 + 90: TypeImage 6(float) Cube array sampled format:Unknown + 91: TypePointer UniformConstant 90 + 92(g_tTexcdf4a): 91(ptr) Variable UniformConstant + 95: TypeSampledImage 90 + 97: TypeVector 6(float) 3 + 98: 97(fvec3) ConstantComposite 24 38 50 + 102: TypeImage 27(int) Cube array sampled format:Unknown + 103: TypePointer UniformConstant 102 +104(g_tTexcdi4a): 103(ptr) Variable UniformConstant + 107: TypeSampledImage 102 + 109: 97(fvec3) ConstantComposite 72 84 85 + 113: TypeImage 42(int) Cube array sampled format:Unknown + 114: TypePointer UniformConstant 113 +115(g_tTexcdu4a): 114(ptr) Variable UniformConstant + 118: TypeSampledImage 113 + 120: 6(float) Constant 1060320051 + 121: 6(float) Constant 1061997773 + 122: 6(float) Constant 1063675494 + 123: 97(fvec3) ConstantComposite 120 121 122 + 126: TypePointer Function 8(PS_OUTPUT) + 128: 6(float) Constant 1065353216 + 129: 7(fvec4) ConstantComposite 128 128 128 128 + 130: TypePointer Function 7(fvec4) + 132: 27(int) Constant 1 + 139: TypePointer Output 7(fvec4) +140(@entryPointOutput.Color): 139(ptr) Variable Output + 143: TypePointer Output 6(float) +144(@entryPointOutput.Depth): 143(ptr) Variable Output + 147(g_tTex1df4): 15(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +137(flattenTemp): 126(ptr) Variable Function + 138:8(PS_OUTPUT) FunctionCall 10(@main() + Store 137(flattenTemp) 138 + 141: 130(ptr) AccessChain 137(flattenTemp) 28 + 142: 7(fvec4) Load 141 + Store 140(@entryPointOutput.Color) 142 + 145: 12(ptr) AccessChain 137(flattenTemp) 132 + 146: 6(float) Load 145 + Store 144(@entryPointOutput.Depth) 146 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval10): 12(ptr) Variable Function + 30(txval11): 12(ptr) Variable Function + 41(txval12): 12(ptr) Variable Function + 53(txval20): 12(ptr) Variable Function + 64(txval21): 12(ptr) Variable Function + 76(txval22): 12(ptr) Variable Function + 89(txval40): 12(ptr) Variable Function + 101(txval41): 12(ptr) Variable Function + 112(txval42): 12(ptr) Variable Function + 127(psout): 126(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4a) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 26: 25(fvec2) ImageQueryLod 23 24 + 29: 6(float) CompositeExtract 26 0 + Store 13(txval10) 29 + 34: 31 Load 33(g_tTex1di4a) + 35: 18 Load 20(g_sSamp) + 37: 36 SampledImage 34 35 + 39: 25(fvec2) ImageQueryLod 37 38 + 40: 6(float) CompositeExtract 39 0 + Store 30(txval11) 40 + 46: 43 Load 45(g_tTex1du4a) + 47: 18 Load 20(g_sSamp) + 49: 48 SampledImage 46 47 + 51: 25(fvec2) ImageQueryLod 49 50 + 52: 6(float) CompositeExtract 51 0 + Store 41(txval12) 52 + 57: 54 Load 56(g_tTex2df4a) + 58: 18 Load 20(g_sSamp) + 60: 59 SampledImage 57 58 + 62: 25(fvec2) ImageQueryLod 60 61 + 63: 6(float) CompositeExtract 62 0 + Store 53(txval20) 63 + 68: 65 Load 67(g_tTex2di4a) + 69: 18 Load 20(g_sSamp) + 71: 70 SampledImage 68 69 + 74: 25(fvec2) ImageQueryLod 71 73 + 75: 6(float) CompositeExtract 74 0 + Store 64(txval21) 75 + 80: 77 Load 79(g_tTex2du4a) + 81: 18 Load 20(g_sSamp) + 83: 82 SampledImage 80 81 + 87: 25(fvec2) ImageQueryLod 83 86 + 88: 6(float) CompositeExtract 87 0 + Store 76(txval22) 88 + 93: 90 Load 92(g_tTexcdf4a) + 94: 18 Load 20(g_sSamp) + 96: 95 SampledImage 93 94 + 99: 25(fvec2) ImageQueryLod 96 98 + 100: 6(float) CompositeExtract 99 0 + Store 89(txval40) 100 + 105: 102 Load 104(g_tTexcdi4a) + 106: 18 Load 20(g_sSamp) + 108: 107 SampledImage 105 106 + 110: 25(fvec2) ImageQueryLod 108 109 + 111: 6(float) CompositeExtract 110 0 + Store 101(txval41) 111 + 116: 113 Load 115(g_tTexcdu4a) + 117: 18 Load 20(g_sSamp) + 119: 118 SampledImage 116 117 + 124: 25(fvec2) ImageQueryLod 119 123 + 125: 6(float) CompositeExtract 124 0 + Store 112(txval42) 125 + 131: 130(ptr) AccessChain 127(psout) 28 + Store 131 129 + 133: 12(ptr) AccessChain 127(psout) 132 + Store 133 128 + 134:8(PS_OUTPUT) Load 127(psout) + ReturnValue 134 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.calculatelodunclamped.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.calculatelodunclamped.dx10.frag.out new file mode 100644 index 00000000..ef5aabe5 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.calculatelodunclamped.dx10.frag.out @@ -0,0 +1,580 @@ +hlsl.calculatelodunclamped.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp float) +0:28 'txval10' ( temp float) +0:28 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:28 Construct combined texture-sampler ( temp sampler1DArray) +0:28 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:28 'g_sSamp' (layout( binding=0) uniform sampler) +0:28 Constant: +0:28 0.100000 +0:28 Constant: +0:28 1 (const int) +0:29 Sequence +0:29 move second child to first child ( temp float) +0:29 'txval11' ( temp float) +0:29 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:29 Construct combined texture-sampler ( temp isampler1DArray) +0:29 'g_tTex1di4a' ( uniform itexture1DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:29 Constant: +0:29 0.200000 +0:29 Constant: +0:29 1 (const int) +0:30 Sequence +0:30 move second child to first child ( temp float) +0:30 'txval12' ( temp float) +0:30 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:30 Construct combined texture-sampler ( temp usampler1DArray) +0:30 'g_tTex1du4a' ( uniform utexture1DArray) +0:30 'g_sSamp' (layout( binding=0) uniform sampler) +0:30 Constant: +0:30 0.300000 +0:30 Constant: +0:30 1 (const int) +0:32 Sequence +0:32 move second child to first child ( temp float) +0:32 'txval20' ( temp float) +0:32 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:32 Construct combined texture-sampler ( temp sampler2DArray) +0:32 'g_tTex2df4a' ( uniform texture2DArray) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:32 Constant: +0:32 1 (const int) +0:33 Sequence +0:33 move second child to first child ( temp float) +0:33 'txval21' ( temp float) +0:33 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:33 Construct combined texture-sampler ( temp isampler2DArray) +0:33 'g_tTex2di4a' ( uniform itexture2DArray) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:33 Constant: +0:33 1 (const int) +0:34 Sequence +0:34 move second child to first child ( temp float) +0:34 'txval22' ( temp float) +0:34 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:34 Construct combined texture-sampler ( temp usampler2DArray) +0:34 'g_tTex2du4a' ( uniform utexture2DArray) +0:34 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:34 Constant: +0:34 1 (const int) +0:36 Sequence +0:36 move second child to first child ( temp float) +0:36 'txval40' ( temp float) +0:36 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:36 Construct combined texture-sampler ( temp samplerCubeArray) +0:36 'g_tTexcdf4a' ( uniform textureCubeArray) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:36 Constant: +0:36 1 (const int) +0:37 Sequence +0:37 move second child to first child ( temp float) +0:37 'txval41' ( temp float) +0:37 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:37 Construct combined texture-sampler ( temp isamplerCubeArray) +0:37 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:37 Constant: +0:37 1 (const int) +0:38 Sequence +0:38 move second child to first child ( temp float) +0:38 'txval42' ( temp float) +0:38 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:38 Construct combined texture-sampler ( temp usamplerCubeArray) +0:38 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:38 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:38 Constant: +0:38 1 (const int) +0:40 move second child to first child ( temp 4-component vector of float) +0:40 Color: direct index for structure ( temp 4-component vector of float) +0:40 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1.000000 +0:40 1.000000 +0:40 1.000000 +0:40 1.000000 +0:41 move second child to first child ( temp float) +0:41 Depth: direct index for structure ( temp float) +0:41 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:41 Constant: +0:41 1 (const int) +0:41 Constant: +0:41 1.000000 +0:43 Branch: Return with expression +0:43 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:24 Color: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:24 Depth: direct index for structure ( temp float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp float) +0:28 'txval10' ( temp float) +0:28 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:28 Construct combined texture-sampler ( temp sampler1DArray) +0:28 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:28 'g_sSamp' (layout( binding=0) uniform sampler) +0:28 Constant: +0:28 0.100000 +0:28 Constant: +0:28 1 (const int) +0:29 Sequence +0:29 move second child to first child ( temp float) +0:29 'txval11' ( temp float) +0:29 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:29 Construct combined texture-sampler ( temp isampler1DArray) +0:29 'g_tTex1di4a' ( uniform itexture1DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:29 Constant: +0:29 0.200000 +0:29 Constant: +0:29 1 (const int) +0:30 Sequence +0:30 move second child to first child ( temp float) +0:30 'txval12' ( temp float) +0:30 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:30 Construct combined texture-sampler ( temp usampler1DArray) +0:30 'g_tTex1du4a' ( uniform utexture1DArray) +0:30 'g_sSamp' (layout( binding=0) uniform sampler) +0:30 Constant: +0:30 0.300000 +0:30 Constant: +0:30 1 (const int) +0:32 Sequence +0:32 move second child to first child ( temp float) +0:32 'txval20' ( temp float) +0:32 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:32 Construct combined texture-sampler ( temp sampler2DArray) +0:32 'g_tTex2df4a' ( uniform texture2DArray) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:32 Constant: +0:32 1 (const int) +0:33 Sequence +0:33 move second child to first child ( temp float) +0:33 'txval21' ( temp float) +0:33 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:33 Construct combined texture-sampler ( temp isampler2DArray) +0:33 'g_tTex2di4a' ( uniform itexture2DArray) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:33 Constant: +0:33 1 (const int) +0:34 Sequence +0:34 move second child to first child ( temp float) +0:34 'txval22' ( temp float) +0:34 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:34 Construct combined texture-sampler ( temp usampler2DArray) +0:34 'g_tTex2du4a' ( uniform utexture2DArray) +0:34 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:34 Constant: +0:34 1 (const int) +0:36 Sequence +0:36 move second child to first child ( temp float) +0:36 'txval40' ( temp float) +0:36 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:36 Construct combined texture-sampler ( temp samplerCubeArray) +0:36 'g_tTexcdf4a' ( uniform textureCubeArray) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:36 Constant: +0:36 1 (const int) +0:37 Sequence +0:37 move second child to first child ( temp float) +0:37 'txval41' ( temp float) +0:37 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:37 Construct combined texture-sampler ( temp isamplerCubeArray) +0:37 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:37 Constant: +0:37 1 (const int) +0:38 Sequence +0:38 move second child to first child ( temp float) +0:38 'txval42' ( temp float) +0:38 direct index ( temp float) +0:? textureQueryLod ( temp float) +0:38 Construct combined texture-sampler ( temp usamplerCubeArray) +0:38 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:38 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:38 Constant: +0:38 1 (const int) +0:40 move second child to first child ( temp 4-component vector of float) +0:40 Color: direct index for structure ( temp 4-component vector of float) +0:40 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1.000000 +0:40 1.000000 +0:40 1.000000 +0:40 1.000000 +0:41 move second child to first child ( temp float) +0:41 Depth: direct index for structure ( temp float) +0:41 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:41 Constant: +0:41 1 (const int) +0:41 Constant: +0:41 1.000000 +0:43 Branch: Return with expression +0:43 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:24 Color: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:24 Depth: direct index for structure ( temp float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 148 + + Capability Shader + Capability Sampled1D + Capability SampledCubeArray + Capability ImageQuery + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 140 144 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval10" + Name 16 "g_tTex1df4a" + Name 20 "g_sSamp" + Name 30 "txval11" + Name 33 "g_tTex1di4a" + Name 41 "txval12" + Name 45 "g_tTex1du4a" + Name 53 "txval20" + Name 56 "g_tTex2df4a" + Name 64 "txval21" + Name 67 "g_tTex2di4a" + Name 76 "txval22" + Name 79 "g_tTex2du4a" + Name 89 "txval40" + Name 92 "g_tTexcdf4a" + Name 101 "txval41" + Name 104 "g_tTexcdi4a" + Name 112 "txval42" + Name 115 "g_tTexcdu4a" + Name 127 "psout" + Name 137 "flattenTemp" + Name 140 "@entryPointOutput.Color" + Name 144 "@entryPointOutput.Depth" + Name 147 "g_tTex1df4" + Decorate 16(g_tTex1df4a) DescriptorSet 0 + Decorate 16(g_tTex1df4a) Binding 1 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 33(g_tTex1di4a) DescriptorSet 0 + Decorate 45(g_tTex1du4a) DescriptorSet 0 + Decorate 56(g_tTex2df4a) DescriptorSet 0 + Decorate 67(g_tTex2di4a) DescriptorSet 0 + Decorate 79(g_tTex2du4a) DescriptorSet 0 + Decorate 92(g_tTexcdf4a) DescriptorSet 0 + Decorate 104(g_tTexcdi4a) DescriptorSet 0 + Decorate 115(g_tTexcdu4a) DescriptorSet 0 + Decorate 140(@entryPointOutput.Color) Location 0 + Decorate 144(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 147(g_tTex1df4) DescriptorSet 0 + Decorate 147(g_tTex1df4) Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 6(float) + 14: TypeImage 6(float) 1D array sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4a): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: 6(float) Constant 1036831949 + 25: TypeVector 6(float) 2 + 27: TypeInt 32 1 + 28: 27(int) Constant 1 + 31: TypeImage 27(int) 1D array sampled format:Unknown + 32: TypePointer UniformConstant 31 + 33(g_tTex1di4a): 32(ptr) Variable UniformConstant + 36: TypeSampledImage 31 + 38: 6(float) Constant 1045220557 + 42: TypeInt 32 0 + 43: TypeImage 42(int) 1D array sampled format:Unknown + 44: TypePointer UniformConstant 43 + 45(g_tTex1du4a): 44(ptr) Variable UniformConstant + 48: TypeSampledImage 43 + 50: 6(float) Constant 1050253722 + 54: TypeImage 6(float) 2D array sampled format:Unknown + 55: TypePointer UniformConstant 54 + 56(g_tTex2df4a): 55(ptr) Variable UniformConstant + 59: TypeSampledImage 54 + 61: 25(fvec2) ConstantComposite 24 38 + 65: TypeImage 27(int) 2D array sampled format:Unknown + 66: TypePointer UniformConstant 65 + 67(g_tTex2di4a): 66(ptr) Variable UniformConstant + 70: TypeSampledImage 65 + 72: 6(float) Constant 1053609165 + 73: 25(fvec2) ConstantComposite 50 72 + 77: TypeImage 42(int) 2D array sampled format:Unknown + 78: TypePointer UniformConstant 77 + 79(g_tTex2du4a): 78(ptr) Variable UniformConstant + 82: TypeSampledImage 77 + 84: 6(float) Constant 1056964608 + 85: 6(float) Constant 1058642330 + 86: 25(fvec2) ConstantComposite 84 85 + 90: TypeImage 6(float) Cube array sampled format:Unknown + 91: TypePointer UniformConstant 90 + 92(g_tTexcdf4a): 91(ptr) Variable UniformConstant + 95: TypeSampledImage 90 + 97: TypeVector 6(float) 3 + 98: 97(fvec3) ConstantComposite 24 38 50 + 102: TypeImage 27(int) Cube array sampled format:Unknown + 103: TypePointer UniformConstant 102 +104(g_tTexcdi4a): 103(ptr) Variable UniformConstant + 107: TypeSampledImage 102 + 109: 97(fvec3) ConstantComposite 72 84 85 + 113: TypeImage 42(int) Cube array sampled format:Unknown + 114: TypePointer UniformConstant 113 +115(g_tTexcdu4a): 114(ptr) Variable UniformConstant + 118: TypeSampledImage 113 + 120: 6(float) Constant 1060320051 + 121: 6(float) Constant 1061997773 + 122: 6(float) Constant 1063675494 + 123: 97(fvec3) ConstantComposite 120 121 122 + 126: TypePointer Function 8(PS_OUTPUT) + 128: 27(int) Constant 0 + 129: 6(float) Constant 1065353216 + 130: 7(fvec4) ConstantComposite 129 129 129 129 + 131: TypePointer Function 7(fvec4) + 139: TypePointer Output 7(fvec4) +140(@entryPointOutput.Color): 139(ptr) Variable Output + 143: TypePointer Output 6(float) +144(@entryPointOutput.Depth): 143(ptr) Variable Output + 147(g_tTex1df4): 15(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +137(flattenTemp): 126(ptr) Variable Function + 138:8(PS_OUTPUT) FunctionCall 10(@main() + Store 137(flattenTemp) 138 + 141: 131(ptr) AccessChain 137(flattenTemp) 128 + 142: 7(fvec4) Load 141 + Store 140(@entryPointOutput.Color) 142 + 145: 12(ptr) AccessChain 137(flattenTemp) 28 + 146: 6(float) Load 145 + Store 144(@entryPointOutput.Depth) 146 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval10): 12(ptr) Variable Function + 30(txval11): 12(ptr) Variable Function + 41(txval12): 12(ptr) Variable Function + 53(txval20): 12(ptr) Variable Function + 64(txval21): 12(ptr) Variable Function + 76(txval22): 12(ptr) Variable Function + 89(txval40): 12(ptr) Variable Function + 101(txval41): 12(ptr) Variable Function + 112(txval42): 12(ptr) Variable Function + 127(psout): 126(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4a) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 26: 25(fvec2) ImageQueryLod 23 24 + 29: 6(float) CompositeExtract 26 1 + Store 13(txval10) 29 + 34: 31 Load 33(g_tTex1di4a) + 35: 18 Load 20(g_sSamp) + 37: 36 SampledImage 34 35 + 39: 25(fvec2) ImageQueryLod 37 38 + 40: 6(float) CompositeExtract 39 1 + Store 30(txval11) 40 + 46: 43 Load 45(g_tTex1du4a) + 47: 18 Load 20(g_sSamp) + 49: 48 SampledImage 46 47 + 51: 25(fvec2) ImageQueryLod 49 50 + 52: 6(float) CompositeExtract 51 1 + Store 41(txval12) 52 + 57: 54 Load 56(g_tTex2df4a) + 58: 18 Load 20(g_sSamp) + 60: 59 SampledImage 57 58 + 62: 25(fvec2) ImageQueryLod 60 61 + 63: 6(float) CompositeExtract 62 1 + Store 53(txval20) 63 + 68: 65 Load 67(g_tTex2di4a) + 69: 18 Load 20(g_sSamp) + 71: 70 SampledImage 68 69 + 74: 25(fvec2) ImageQueryLod 71 73 + 75: 6(float) CompositeExtract 74 1 + Store 64(txval21) 75 + 80: 77 Load 79(g_tTex2du4a) + 81: 18 Load 20(g_sSamp) + 83: 82 SampledImage 80 81 + 87: 25(fvec2) ImageQueryLod 83 86 + 88: 6(float) CompositeExtract 87 1 + Store 76(txval22) 88 + 93: 90 Load 92(g_tTexcdf4a) + 94: 18 Load 20(g_sSamp) + 96: 95 SampledImage 93 94 + 99: 25(fvec2) ImageQueryLod 96 98 + 100: 6(float) CompositeExtract 99 1 + Store 89(txval40) 100 + 105: 102 Load 104(g_tTexcdi4a) + 106: 18 Load 20(g_sSamp) + 108: 107 SampledImage 105 106 + 110: 25(fvec2) ImageQueryLod 108 109 + 111: 6(float) CompositeExtract 110 1 + Store 101(txval41) 111 + 116: 113 Load 115(g_tTexcdu4a) + 117: 18 Load 20(g_sSamp) + 119: 118 SampledImage 116 117 + 124: 25(fvec2) ImageQueryLod 119 123 + 125: 6(float) CompositeExtract 124 1 + Store 112(txval42) 125 + 132: 131(ptr) AccessChain 127(psout) 128 + Store 132 130 + 133: 12(ptr) AccessChain 127(psout) 28 + Store 133 129 + 134:8(PS_OUTPUT) Load 127(psout) + ReturnValue 134 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.cast.frag.out b/deps/glslang/Test/baseResults/hlsl.cast.frag.out new file mode 100644 index 00000000..0aa11bea --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.cast.frag.out @@ -0,0 +1,127 @@ +hlsl.cast.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' ( in 4-component vector of float) +0:? Sequence +0:3 Branch: Return with expression +0:3 add ( temp 4-component vector of float) +0:3 add ( temp 4-component vector of float) +0:3 'input' ( in 4-component vector of float) +0:3 Convert int to float ( temp 4-component vector of float) +0:3 Convert float to int ( temp 4-component vector of int) +0:3 'input' ( in 4-component vector of float) +0:3 Constant: +0:3 1.198000 +0:3 1.198000 +0:3 1.198000 +0:3 1.198000 +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' ( in 4-component vector of float) +0:? Sequence +0:3 Branch: Return with expression +0:3 add ( temp 4-component vector of float) +0:3 add ( temp 4-component vector of float) +0:3 'input' ( in 4-component vector of float) +0:3 Convert int to float ( temp 4-component vector of float) +0:3 Convert float to int ( temp 4-component vector of int) +0:3 'input' ( in 4-component vector of float) +0:3 Constant: +0:3 1.198000 +0:3 1.198000 +0:3 1.198000 +0:3 1.198000 +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 34 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 27 30 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 11 "@PixelShaderFunction(vf4;" + Name 10 "input" + Name 25 "input" + Name 27 "input" + Name 30 "@entryPointOutput" + Name 31 "param" + Decorate 27(input) Location 0 + Decorate 30(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) + 15: TypeInt 32 1 + 16: TypeVector 15(int) 4 + 20: 6(float) Constant 1067014160 + 21: 7(fvec4) ConstantComposite 20 20 20 20 + 26: TypePointer Input 7(fvec4) + 27(input): 26(ptr) Variable Input + 29: TypePointer Output 7(fvec4) +30(@entryPointOutput): 29(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 25(input): 8(ptr) Variable Function + 31(param): 8(ptr) Variable Function + 28: 7(fvec4) Load 27(input) + Store 25(input) 28 + 32: 7(fvec4) Load 25(input) + Store 31(param) 32 + 33: 7(fvec4) FunctionCall 11(@PixelShaderFunction(vf4;) 31(param) + Store 30(@entryPointOutput) 33 + Return + FunctionEnd +11(@PixelShaderFunction(vf4;): 7(fvec4) Function None 9 + 10(input): 8(ptr) FunctionParameter + 12: Label + 13: 7(fvec4) Load 10(input) + 14: 7(fvec4) Load 10(input) + 17: 16(ivec4) ConvertFToS 14 + 18: 7(fvec4) ConvertSToF 17 + 19: 7(fvec4) FAdd 13 18 + 22: 7(fvec4) FAdd 19 21 + ReturnValue 22 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.cbuffer-identifier.vert.out b/deps/glslang/Test/baseResults/hlsl.cbuffer-identifier.vert.out new file mode 100644 index 00000000..f7225f84 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.cbuffer-identifier.vert.out @@ -0,0 +1,404 @@ +hlsl.cbuffer-identifier.vert +WARNING: 0:29: '' : mul() matrix size mismatch + +Shader version: 500 +0:? Sequence +0:22 Function Definition: @main(struct-VS_INPUT-vf4-vf31; ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Function Parameters: +0:22 'input' ( in structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:? Sequence +0:23 Sequence +0:23 move second child to first child ( temp int) +0:23 'ConstantBuffer' ( temp int) +0:23 Constant: +0:23 42 (const int) +0:25 Sequence +0:25 move second child to first child ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:25 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:25 Constant: +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:26 move second child to first child ( temp 4-component vector of float) +0:26 Pos: direct index for structure ( temp 4-component vector of float) +0:26 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:26 Constant: +0:26 0 (const int) +0:26 matrix-times-vector ( temp 4-component vector of float) +0:26 World: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:26 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float World, layout( row_major std140) uniform 4X4 matrix of float View, layout( row_major std140) uniform 4X4 matrix of float Projection}) +0:26 Constant: +0:26 0 (const uint) +0:26 Pos: direct index for structure ( temp 4-component vector of float) +0:26 'input' ( in structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:26 Constant: +0:26 0 (const int) +0:27 move second child to first child ( temp 4-component vector of float) +0:27 Pos: direct index for structure ( temp 4-component vector of float) +0:27 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:27 Constant: +0:27 0 (const int) +0:27 matrix-times-vector ( temp 4-component vector of float) +0:27 View: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:27 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float World, layout( row_major std140) uniform 4X4 matrix of float View, layout( row_major std140) uniform 4X4 matrix of float Projection}) +0:27 Constant: +0:27 1 (const uint) +0:27 Pos: direct index for structure ( temp 4-component vector of float) +0:27 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:27 Constant: +0:27 0 (const int) +0:28 move second child to first child ( temp 4-component vector of float) +0:28 Pos: direct index for structure ( temp 4-component vector of float) +0:28 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:28 Constant: +0:28 0 (const int) +0:28 matrix-times-vector ( temp 4-component vector of float) +0:28 Projection: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:28 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float World, layout( row_major std140) uniform 4X4 matrix of float View, layout( row_major std140) uniform 4X4 matrix of float Projection}) +0:28 Constant: +0:28 2 (const uint) +0:28 Pos: direct index for structure ( temp 4-component vector of float) +0:28 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:28 Constant: +0:28 0 (const int) +0:29 move second child to first child ( temp 3-component vector of float) +0:29 Norm: direct index for structure ( temp 3-component vector of float) +0:29 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:29 Constant: +0:29 1 (const int) +0:29 Construct vec3 ( temp 3-component vector of float) +0:29 matrix-times-vector ( temp 4-component vector of float) +0:29 Construct mat3x4 ( uniform 3X4 matrix of float) +0:29 World: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:29 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float World, layout( row_major std140) uniform 4X4 matrix of float View, layout( row_major std140) uniform 4X4 matrix of float Projection}) +0:29 Constant: +0:29 0 (const uint) +0:29 Norm: direct index for structure ( temp 3-component vector of float) +0:29 'input' ( in structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:29 Constant: +0:29 1 (const int) +0:31 Branch: Return with expression +0:31 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Function Definition: main( ( temp void) +0:22 Function Parameters: +0:? Sequence +0:22 Sequence +0:22 move second child to first child ( temp 4-component vector of float) +0:22 Pos: direct index for structure ( temp 4-component vector of float) +0:? 'input' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Constant: +0:22 0 (const int) +0:? 'input.Pos' (layout( location=0) in 4-component vector of float) +0:22 move second child to first child ( temp 3-component vector of float) +0:22 Norm: direct index for structure ( temp 3-component vector of float) +0:? 'input' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Constant: +0:22 1 (const int) +0:? 'input.Norm' (layout( location=1) in 3-component vector of float) +0:22 Sequence +0:22 move second child to first child ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 'flattenTemp' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Function Call: @main(struct-VS_INPUT-vf4-vf31; ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:? 'input' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:22 Pos: direct index for structure ( temp 4-component vector of float) +0:22 'flattenTemp' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Constant: +0:22 0 (const int) +0:22 move second child to first child ( temp 3-component vector of float) +0:? '@entryPointOutput.Norm' (layout( location=0) out 3-component vector of float) +0:22 Norm: direct index for structure ( temp 3-component vector of float) +0:22 'flattenTemp' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Constant: +0:22 1 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float World, layout( row_major std140) uniform 4X4 matrix of float View, layout( row_major std140) uniform 4X4 matrix of float Projection}) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:? '@entryPointOutput.Norm' (layout( location=0) out 3-component vector of float) +0:? 'input.Pos' (layout( location=0) in 4-component vector of float) +0:? 'input.Norm' (layout( location=1) in 3-component vector of float) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:22 Function Definition: @main(struct-VS_INPUT-vf4-vf31; ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Function Parameters: +0:22 'input' ( in structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:? Sequence +0:23 Sequence +0:23 move second child to first child ( temp int) +0:23 'ConstantBuffer' ( temp int) +0:23 Constant: +0:23 42 (const int) +0:25 Sequence +0:25 move second child to first child ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:25 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:25 Constant: +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:26 move second child to first child ( temp 4-component vector of float) +0:26 Pos: direct index for structure ( temp 4-component vector of float) +0:26 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:26 Constant: +0:26 0 (const int) +0:26 matrix-times-vector ( temp 4-component vector of float) +0:26 World: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:26 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float World, layout( row_major std140) uniform 4X4 matrix of float View, layout( row_major std140) uniform 4X4 matrix of float Projection}) +0:26 Constant: +0:26 0 (const uint) +0:26 Pos: direct index for structure ( temp 4-component vector of float) +0:26 'input' ( in structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:26 Constant: +0:26 0 (const int) +0:27 move second child to first child ( temp 4-component vector of float) +0:27 Pos: direct index for structure ( temp 4-component vector of float) +0:27 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:27 Constant: +0:27 0 (const int) +0:27 matrix-times-vector ( temp 4-component vector of float) +0:27 View: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:27 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float World, layout( row_major std140) uniform 4X4 matrix of float View, layout( row_major std140) uniform 4X4 matrix of float Projection}) +0:27 Constant: +0:27 1 (const uint) +0:27 Pos: direct index for structure ( temp 4-component vector of float) +0:27 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:27 Constant: +0:27 0 (const int) +0:28 move second child to first child ( temp 4-component vector of float) +0:28 Pos: direct index for structure ( temp 4-component vector of float) +0:28 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:28 Constant: +0:28 0 (const int) +0:28 matrix-times-vector ( temp 4-component vector of float) +0:28 Projection: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:28 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float World, layout( row_major std140) uniform 4X4 matrix of float View, layout( row_major std140) uniform 4X4 matrix of float Projection}) +0:28 Constant: +0:28 2 (const uint) +0:28 Pos: direct index for structure ( temp 4-component vector of float) +0:28 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:28 Constant: +0:28 0 (const int) +0:29 move second child to first child ( temp 3-component vector of float) +0:29 Norm: direct index for structure ( temp 3-component vector of float) +0:29 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:29 Constant: +0:29 1 (const int) +0:29 Construct vec3 ( temp 3-component vector of float) +0:29 matrix-times-vector ( temp 4-component vector of float) +0:29 Construct mat3x4 ( uniform 3X4 matrix of float) +0:29 World: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:29 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float World, layout( row_major std140) uniform 4X4 matrix of float View, layout( row_major std140) uniform 4X4 matrix of float Projection}) +0:29 Constant: +0:29 0 (const uint) +0:29 Norm: direct index for structure ( temp 3-component vector of float) +0:29 'input' ( in structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:29 Constant: +0:29 1 (const int) +0:31 Branch: Return with expression +0:31 'output' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Function Definition: main( ( temp void) +0:22 Function Parameters: +0:? Sequence +0:22 Sequence +0:22 move second child to first child ( temp 4-component vector of float) +0:22 Pos: direct index for structure ( temp 4-component vector of float) +0:? 'input' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Constant: +0:22 0 (const int) +0:? 'input.Pos' (layout( location=0) in 4-component vector of float) +0:22 move second child to first child ( temp 3-component vector of float) +0:22 Norm: direct index for structure ( temp 3-component vector of float) +0:? 'input' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Constant: +0:22 1 (const int) +0:? 'input.Norm' (layout( location=1) in 3-component vector of float) +0:22 Sequence +0:22 move second child to first child ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 'flattenTemp' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Function Call: @main(struct-VS_INPUT-vf4-vf31; ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:? 'input' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:22 Pos: direct index for structure ( temp 4-component vector of float) +0:22 'flattenTemp' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Constant: +0:22 0 (const int) +0:22 move second child to first child ( temp 3-component vector of float) +0:? '@entryPointOutput.Norm' (layout( location=0) out 3-component vector of float) +0:22 Norm: direct index for structure ( temp 3-component vector of float) +0:22 'flattenTemp' ( temp structure{ temp 4-component vector of float Pos, temp 3-component vector of float Norm}) +0:22 Constant: +0:22 1 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float World, layout( row_major std140) uniform 4X4 matrix of float View, layout( row_major std140) uniform 4X4 matrix of float Projection}) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:? '@entryPointOutput.Norm' (layout( location=0) out 3-component vector of float) +0:? 'input.Pos' (layout( location=0) in 4-component vector of float) +0:? 'input.Norm' (layout( location=1) in 3-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 93 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 74 78 86 90 + Source HLSL 500 + Name 4 "main" + Name 9 "VS_INPUT" + MemberName 9(VS_INPUT) 0 "Pos" + MemberName 9(VS_INPUT) 1 "Norm" + Name 11 "PS_INPUT" + MemberName 11(PS_INPUT) 0 "Pos" + MemberName 11(PS_INPUT) 1 "Norm" + Name 14 "@main(struct-VS_INPUT-vf4-vf31;" + Name 13 "input" + Name 18 "ConstantBuffer" + Name 21 "output" + Name 28 "C" + MemberName 28(C) 0 "World" + MemberName 28(C) 1 "View" + MemberName 28(C) 2 "Projection" + Name 30 "" + Name 72 "input" + Name 74 "input.Pos" + Name 78 "input.Norm" + Name 81 "flattenTemp" + Name 82 "param" + Name 86 "@entryPointOutput.Pos" + Name 90 "@entryPointOutput.Norm" + MemberDecorate 28(C) 0 RowMajor + MemberDecorate 28(C) 0 Offset 0 + MemberDecorate 28(C) 0 MatrixStride 16 + MemberDecorate 28(C) 1 RowMajor + MemberDecorate 28(C) 1 Offset 64 + MemberDecorate 28(C) 1 MatrixStride 16 + MemberDecorate 28(C) 2 RowMajor + MemberDecorate 28(C) 2 Offset 128 + MemberDecorate 28(C) 2 MatrixStride 16 + Decorate 28(C) Block + Decorate 30 DescriptorSet 0 + Decorate 30 Binding 0 + Decorate 74(input.Pos) Location 0 + Decorate 78(input.Norm) Location 1 + Decorate 86(@entryPointOutput.Pos) BuiltIn Position + Decorate 90(@entryPointOutput.Norm) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeVector 6(float) 3 + 9(VS_INPUT): TypeStruct 7(fvec4) 8(fvec3) + 10: TypePointer Function 9(VS_INPUT) + 11(PS_INPUT): TypeStruct 7(fvec4) 8(fvec3) + 12: TypeFunction 11(PS_INPUT) 10(ptr) + 16: TypeInt 32 1 + 17: TypePointer Function 16(int) + 19: 16(int) Constant 42 + 20: TypePointer Function 11(PS_INPUT) + 22: 6(float) Constant 0 + 23: 7(fvec4) ConstantComposite 22 22 22 22 + 24: 8(fvec3) ConstantComposite 22 22 22 + 25:11(PS_INPUT) ConstantComposite 23 24 + 26: 16(int) Constant 0 + 27: TypeMatrix 7(fvec4) 4 + 28(C): TypeStruct 27 27 27 + 29: TypePointer Uniform 28(C) + 30: 29(ptr) Variable Uniform + 31: TypePointer Uniform 27 + 34: TypePointer Function 7(fvec4) + 39: 16(int) Constant 1 + 46: 16(int) Constant 2 + 55: TypeMatrix 7(fvec4) 3 + 60: TypePointer Function 8(fvec3) + 73: TypePointer Input 7(fvec4) + 74(input.Pos): 73(ptr) Variable Input + 77: TypePointer Input 8(fvec3) + 78(input.Norm): 77(ptr) Variable Input + 85: TypePointer Output 7(fvec4) +86(@entryPointOutput.Pos): 85(ptr) Variable Output + 89: TypePointer Output 8(fvec3) +90(@entryPointOutput.Norm): 89(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 72(input): 10(ptr) Variable Function + 81(flattenTemp): 20(ptr) Variable Function + 82(param): 10(ptr) Variable Function + 75: 7(fvec4) Load 74(input.Pos) + 76: 34(ptr) AccessChain 72(input) 26 + Store 76 75 + 79: 8(fvec3) Load 78(input.Norm) + 80: 60(ptr) AccessChain 72(input) 39 + Store 80 79 + 83: 9(VS_INPUT) Load 72(input) + Store 82(param) 83 + 84:11(PS_INPUT) FunctionCall 14(@main(struct-VS_INPUT-vf4-vf31;) 82(param) + Store 81(flattenTemp) 84 + 87: 34(ptr) AccessChain 81(flattenTemp) 26 + 88: 7(fvec4) Load 87 + Store 86(@entryPointOutput.Pos) 88 + 91: 60(ptr) AccessChain 81(flattenTemp) 39 + 92: 8(fvec3) Load 91 + Store 90(@entryPointOutput.Norm) 92 + Return + FunctionEnd +14(@main(struct-VS_INPUT-vf4-vf31;):11(PS_INPUT) Function None 12 + 13(input): 10(ptr) FunctionParameter + 15: Label +18(ConstantBuffer): 17(ptr) Variable Function + 21(output): 20(ptr) Variable Function + Store 18(ConstantBuffer) 19 + Store 21(output) 25 + 32: 31(ptr) AccessChain 30 26 + 33: 27 Load 32 + 35: 34(ptr) AccessChain 13(input) 26 + 36: 7(fvec4) Load 35 + 37: 7(fvec4) MatrixTimesVector 33 36 + 38: 34(ptr) AccessChain 21(output) 26 + Store 38 37 + 40: 31(ptr) AccessChain 30 39 + 41: 27 Load 40 + 42: 34(ptr) AccessChain 21(output) 26 + 43: 7(fvec4) Load 42 + 44: 7(fvec4) MatrixTimesVector 41 43 + 45: 34(ptr) AccessChain 21(output) 26 + Store 45 44 + 47: 31(ptr) AccessChain 30 46 + 48: 27 Load 47 + 49: 34(ptr) AccessChain 21(output) 26 + 50: 7(fvec4) Load 49 + 51: 7(fvec4) MatrixTimesVector 48 50 + 52: 34(ptr) AccessChain 21(output) 26 + Store 52 51 + 53: 31(ptr) AccessChain 30 26 + 54: 27 Load 53 + 56: 7(fvec4) CompositeExtract 54 0 + 57: 7(fvec4) CompositeExtract 54 1 + 58: 7(fvec4) CompositeExtract 54 2 + 59: 55 CompositeConstruct 56 57 58 + 61: 60(ptr) AccessChain 13(input) 39 + 62: 8(fvec3) Load 61 + 63: 7(fvec4) MatrixTimesVector 59 62 + 64: 6(float) CompositeExtract 63 0 + 65: 6(float) CompositeExtract 63 1 + 66: 6(float) CompositeExtract 63 2 + 67: 8(fvec3) CompositeConstruct 64 65 66 + 68: 60(ptr) AccessChain 21(output) 39 + Store 68 67 + 69:11(PS_INPUT) Load 21(output) + ReturnValue 69 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.charLit.vert.out b/deps/glslang/Test/baseResults/hlsl.charLit.vert.out new file mode 100644 index 00000000..b09fc81f --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.charLit.vert.out @@ -0,0 +1,233 @@ +hlsl.charLit.vert +Shader version: 500 +0:? Sequence +0:2 Function Definition: @main( ( temp 4-component vector of float) +0:2 Function Parameters: +0:? Sequence +0:3 Sequence +0:3 move second child to first child ( temp uint) +0:3 'a1' ( temp uint) +0:3 Constant: +0:3 65 (const uint) +0:4 Sequence +0:4 move second child to first child ( temp int) +0:4 'a2' ( temp int) +0:4 Constant: +0:4 48 (const int) +0:6 Sequence +0:6 move second child to first child ( temp int) +0:6 'a3' ( temp int) +0:6 Constant: +0:6 7 (const int) +0:7 add second child into first child ( temp int) +0:7 'a3' ( temp int) +0:7 Constant: +0:7 8 (const int) +0:8 add second child into first child ( temp int) +0:8 'a3' ( temp int) +0:8 Constant: +0:8 9 (const int) +0:9 add second child into first child ( temp int) +0:9 'a3' ( temp int) +0:9 Constant: +0:9 10 (const int) +0:10 add second child into first child ( temp int) +0:10 'a3' ( temp int) +0:10 Constant: +0:10 11 (const int) +0:11 add second child into first child ( temp int) +0:11 'a3' ( temp int) +0:11 Constant: +0:11 12 (const int) +0:12 add second child into first child ( temp int) +0:12 'a3' ( temp int) +0:12 Constant: +0:12 13 (const int) +0:14 Sequence +0:14 move second child to first child ( temp int) +0:14 'a10' ( temp int) +0:14 Constant: +0:14 99 (const int) +0:16 Branch: Return with expression +0:16 Construct vec4 ( temp 4-component vector of float) +0:16 Convert uint to float ( temp float) +0:16 add ( temp uint) +0:16 add ( temp uint) +0:16 add ( temp uint) +0:16 'a1' ( temp uint) +0:16 Convert int to uint ( temp uint) +0:16 'a2' ( temp int) +0:16 Convert int to uint ( temp uint) +0:16 'a3' ( temp int) +0:16 Convert int to uint ( temp uint) +0:16 'a10' ( temp int) +0:2 Function Definition: main( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:2 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' ( out 4-component vector of float Position) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:2 Function Definition: @main( ( temp 4-component vector of float) +0:2 Function Parameters: +0:? Sequence +0:3 Sequence +0:3 move second child to first child ( temp uint) +0:3 'a1' ( temp uint) +0:3 Constant: +0:3 65 (const uint) +0:4 Sequence +0:4 move second child to first child ( temp int) +0:4 'a2' ( temp int) +0:4 Constant: +0:4 48 (const int) +0:6 Sequence +0:6 move second child to first child ( temp int) +0:6 'a3' ( temp int) +0:6 Constant: +0:6 7 (const int) +0:7 add second child into first child ( temp int) +0:7 'a3' ( temp int) +0:7 Constant: +0:7 8 (const int) +0:8 add second child into first child ( temp int) +0:8 'a3' ( temp int) +0:8 Constant: +0:8 9 (const int) +0:9 add second child into first child ( temp int) +0:9 'a3' ( temp int) +0:9 Constant: +0:9 10 (const int) +0:10 add second child into first child ( temp int) +0:10 'a3' ( temp int) +0:10 Constant: +0:10 11 (const int) +0:11 add second child into first child ( temp int) +0:11 'a3' ( temp int) +0:11 Constant: +0:11 12 (const int) +0:12 add second child into first child ( temp int) +0:12 'a3' ( temp int) +0:12 Constant: +0:12 13 (const int) +0:14 Sequence +0:14 move second child to first child ( temp int) +0:14 'a10' ( temp int) +0:14 Constant: +0:14 99 (const int) +0:16 Branch: Return with expression +0:16 Construct vec4 ( temp 4-component vector of float) +0:16 Convert uint to float ( temp float) +0:16 add ( temp uint) +0:16 add ( temp uint) +0:16 add ( temp uint) +0:16 'a1' ( temp uint) +0:16 Convert int to uint ( temp uint) +0:16 'a2' ( temp int) +0:16 Convert int to uint ( temp uint) +0:16 'a3' ( temp int) +0:16 Convert int to uint ( temp uint) +0:16 'a10' ( temp int) +0:2 Function Definition: main( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:2 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' ( out 4-component vector of float Position) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 58 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 56 + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 13 "a1" + Name 17 "a2" + Name 19 "a3" + Name 39 "a10" + Name 56 "@entryPointOutput" + Decorate 56(@entryPointOutput) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeInt 32 0 + 12: TypePointer Function 11(int) + 14: 11(int) Constant 65 + 15: TypeInt 32 1 + 16: TypePointer Function 15(int) + 18: 15(int) Constant 48 + 20: 15(int) Constant 7 + 21: 15(int) Constant 8 + 24: 15(int) Constant 9 + 27: 15(int) Constant 10 + 30: 15(int) Constant 11 + 33: 15(int) Constant 12 + 36: 15(int) Constant 13 + 40: 15(int) Constant 99 + 55: TypePointer Output 7(fvec4) +56(@entryPointOutput): 55(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 57: 7(fvec4) FunctionCall 9(@main() + Store 56(@entryPointOutput) 57 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 13(a1): 12(ptr) Variable Function + 17(a2): 16(ptr) Variable Function + 19(a3): 16(ptr) Variable Function + 39(a10): 16(ptr) Variable Function + Store 13(a1) 14 + Store 17(a2) 18 + Store 19(a3) 20 + 22: 15(int) Load 19(a3) + 23: 15(int) IAdd 22 21 + Store 19(a3) 23 + 25: 15(int) Load 19(a3) + 26: 15(int) IAdd 25 24 + Store 19(a3) 26 + 28: 15(int) Load 19(a3) + 29: 15(int) IAdd 28 27 + Store 19(a3) 29 + 31: 15(int) Load 19(a3) + 32: 15(int) IAdd 31 30 + Store 19(a3) 32 + 34: 15(int) Load 19(a3) + 35: 15(int) IAdd 34 33 + Store 19(a3) 35 + 37: 15(int) Load 19(a3) + 38: 15(int) IAdd 37 36 + Store 19(a3) 38 + Store 39(a10) 40 + 41: 11(int) Load 13(a1) + 42: 15(int) Load 17(a2) + 43: 11(int) Bitcast 42 + 44: 11(int) IAdd 41 43 + 45: 15(int) Load 19(a3) + 46: 11(int) Bitcast 45 + 47: 11(int) IAdd 44 46 + 48: 15(int) Load 39(a10) + 49: 11(int) Bitcast 48 + 50: 11(int) IAdd 47 49 + 51: 6(float) ConvertUToF 50 + 52: 7(fvec4) CompositeConstruct 51 51 51 51 + ReturnValue 52 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clip.frag.out b/deps/glslang/Test/baseResults/hlsl.clip.frag.out new file mode 100644 index 00000000..dbf99bf5 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clip.frag.out @@ -0,0 +1,123 @@ +hlsl.clip.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: GetEntitySelectClip( ( temp float) +0:3 Function Parameters: +0:? Sequence +0:4 Branch: Return with expression +0:4 Constant: +0:4 1.000000 +0:8 Function Definition: @main( ( temp 4-component vector of float) +0:8 Function Parameters: +0:? Sequence +0:9 Test condition and select ( temp void) +0:9 Condition +0:9 Compare Less Than ( temp bool) +0:9 Function Call: GetEntitySelectClip( ( temp float) +0:9 Constant: +0:9 0.000000 +0:9 true case +0:9 Branch: Kill +0:11 Branch: Return with expression +0:11 Constant: +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:8 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: GetEntitySelectClip( ( temp float) +0:3 Function Parameters: +0:? Sequence +0:4 Branch: Return with expression +0:4 Constant: +0:4 1.000000 +0:8 Function Definition: @main( ( temp 4-component vector of float) +0:8 Function Parameters: +0:? Sequence +0:9 Test condition and select ( temp void) +0:9 Condition +0:9 Compare Less Than ( temp bool) +0:9 Function Call: GetEntitySelectClip( ( temp float) +0:9 Constant: +0:9 0.000000 +0:9 true case +0:9 Branch: Kill +0:11 Branch: Return with expression +0:11 Constant: +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:8 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 30 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 28 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "GetEntitySelectClip(" + Name 12 "@main(" + Name 28 "@entryPointOutput" + Decorate 28(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeFunction 6(float) + 10: TypeVector 6(float) 4 + 11: TypeFunction 10(fvec4) + 14: 6(float) Constant 1065353216 + 18: 6(float) Constant 0 + 19: TypeBool + 24: 10(fvec4) ConstantComposite 18 18 18 18 + 27: TypePointer Output 10(fvec4) +28(@entryPointOutput): 27(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 29: 10(fvec4) FunctionCall 12(@main() + Store 28(@entryPointOutput) 29 + Return + FunctionEnd +8(GetEntitySelectClip(): 6(float) Function None 7 + 9: Label + ReturnValue 14 + FunctionEnd + 12(@main(): 10(fvec4) Function None 11 + 13: Label + 17: 6(float) FunctionCall 8(GetEntitySelectClip() + 20: 19(bool) FOrdLessThan 17 18 + SelectionMerge 22 None + BranchConditional 20 21 22 + 21: Label + Kill + 22: Label + ReturnValue 24 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-1.frag.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-1.frag.out new file mode 100644 index 00000000..f223ddc4 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-1.frag.out @@ -0,0 +1,190 @@ +hlsl.clipdistance-1.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: @main(vf4;f1;f1; ( temp 4-component vector of float) +0:4 Function Parameters: +0:4 'pos' ( in 4-component vector of float) +0:4 'clip' ( in float) +0:4 'cull' ( in float) +0:? Sequence +0:5 Branch: Return with expression +0:5 add ( temp 4-component vector of float) +0:5 add ( temp 4-component vector of float) +0:5 'pos' ( in 4-component vector of float) +0:5 'clip' ( in float) +0:5 'cull' ( in float) +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:? Sequence +0:4 move second child to first child ( temp float) +0:? 'clip' ( temp float) +0:4 direct index ( in float ClipDistance) +0:? 'clip' ( in 1-element array of float ClipDistance) +0:4 Constant: +0:4 0 (const int) +0:? Sequence +0:4 move second child to first child ( temp float) +0:? 'cull' ( temp float) +0:4 direct index ( in float CullDistance) +0:? 'cull' ( in 1-element array of float CullDistance) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:4 Function Call: @main(vf4;f1;f1; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'clip' ( temp float) +0:? 'cull' ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:? 'clip' ( in 1-element array of float ClipDistance) +0:? 'cull' ( in 1-element array of float CullDistance) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: @main(vf4;f1;f1; ( temp 4-component vector of float) +0:4 Function Parameters: +0:4 'pos' ( in 4-component vector of float) +0:4 'clip' ( in float) +0:4 'cull' ( in float) +0:? Sequence +0:5 Branch: Return with expression +0:5 add ( temp 4-component vector of float) +0:5 add ( temp 4-component vector of float) +0:5 'pos' ( in 4-component vector of float) +0:5 'clip' ( in float) +0:5 'cull' ( in float) +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:? Sequence +0:4 move second child to first child ( temp float) +0:? 'clip' ( temp float) +0:4 direct index ( in float ClipDistance) +0:? 'clip' ( in 1-element array of float ClipDistance) +0:4 Constant: +0:4 0 (const int) +0:? Sequence +0:4 move second child to first child ( temp float) +0:? 'cull' ( temp float) +0:4 direct index ( in float CullDistance) +0:? 'cull' ( in 1-element array of float CullDistance) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:4 Function Call: @main(vf4;f1;f1; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'clip' ( temp float) +0:? 'cull' ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:? 'clip' ( in 1-element array of float ClipDistance) +0:? 'cull' ( in 1-element array of float CullDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 53 + + Capability Shader + Capability ClipDistance + Capability CullDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 27 34 41 45 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 14 "@main(vf4;f1;f1;" + Name 11 "pos" + Name 12 "clip" + Name 13 "cull" + Name 25 "pos" + Name 27 "pos" + Name 29 "clip" + Name 34 "clip" + Name 40 "cull" + Name 41 "cull" + Name 45 "@entryPointOutput" + Name 46 "param" + Name 48 "param" + Name 50 "param" + Decorate 27(pos) BuiltIn FragCoord + Decorate 34(clip) BuiltIn ClipDistance + Decorate 41(cull) BuiltIn CullDistance + Decorate 45(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypePointer Function 6(float) + 10: TypeFunction 7(fvec4) 8(ptr) 9(ptr) 9(ptr) + 26: TypePointer Input 7(fvec4) + 27(pos): 26(ptr) Variable Input + 30: TypeInt 32 0 + 31: 30(int) Constant 1 + 32: TypeArray 6(float) 31 + 33: TypePointer Input 32 + 34(clip): 33(ptr) Variable Input + 35: TypeInt 32 1 + 36: 35(int) Constant 0 + 37: TypePointer Input 6(float) + 41(cull): 33(ptr) Variable Input + 44: TypePointer Output 7(fvec4) +45(@entryPointOutput): 44(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 25(pos): 8(ptr) Variable Function + 29(clip): 9(ptr) Variable Function + 40(cull): 9(ptr) Variable Function + 46(param): 8(ptr) Variable Function + 48(param): 9(ptr) Variable Function + 50(param): 9(ptr) Variable Function + 28: 7(fvec4) Load 27(pos) + Store 25(pos) 28 + 38: 37(ptr) AccessChain 34(clip) 36 + 39: 6(float) Load 38 + Store 29(clip) 39 + 42: 37(ptr) AccessChain 41(cull) 36 + 43: 6(float) Load 42 + Store 40(cull) 43 + 47: 7(fvec4) Load 25(pos) + Store 46(param) 47 + 49: 6(float) Load 29(clip) + Store 48(param) 49 + 51: 6(float) Load 40(cull) + Store 50(param) 51 + 52: 7(fvec4) FunctionCall 14(@main(vf4;f1;f1;) 46(param) 48(param) 50(param) + Store 45(@entryPointOutput) 52 + Return + FunctionEnd +14(@main(vf4;f1;f1;): 7(fvec4) Function None 10 + 11(pos): 8(ptr) FunctionParameter + 12(clip): 9(ptr) FunctionParameter + 13(cull): 9(ptr) FunctionParameter + 15: Label + 16: 7(fvec4) Load 11(pos) + 17: 6(float) Load 12(clip) + 18: 7(fvec4) CompositeConstruct 17 17 17 17 + 19: 7(fvec4) FAdd 16 18 + 20: 6(float) Load 13(cull) + 21: 7(fvec4) CompositeConstruct 20 20 20 20 + 22: 7(fvec4) FAdd 19 21 + ReturnValue 22 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-1.geom.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-1.geom.out new file mode 100644 index 00000000..144b8775 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-1.geom.out @@ -0,0 +1,737 @@ +hlsl.clipdistance-1.geom +Shader version: 500 +invocations = -1 +max_vertices = 3 +input primitive = triangles +output primitive = line_strip +0:? Sequence +0:11 Function Definition: @main(vf4[3];u1[3];struct-S-vf4-vf21;vf4[3]; ( temp void) +0:11 Function Parameters: +0:11 'pos' ( in 3-element array of 4-component vector of float) +0:11 'VertexID' ( in 3-element array of uint) +0:11 'OutputStream' ( out structure{ temp 4-component vector of float pos, temp 2-component vector of float clip}) +0:11 'clip' ( in 3-element array of 4-component vector of float) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 pos: direct index for structure ( temp 4-component vector of float) +0:14 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip}) +0:14 Constant: +0:14 0 (const int) +0:14 direct index ( temp 4-component vector of float) +0:14 'pos' ( in 3-element array of 4-component vector of float) +0:14 Constant: +0:14 0 (const int) +0:15 move second child to first child ( temp 2-component vector of float) +0:15 clip: direct index for structure ( temp 2-component vector of float) +0:15 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip}) +0:15 Constant: +0:15 1 (const int) +0:15 vector swizzle ( temp 2-component vector of float) +0:15 direct index ( temp 4-component vector of float) +0:15 'clip' ( in 3-element array of 4-component vector of float) +0:15 Constant: +0:15 0 (const int) +0:15 Sequence +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 1 (const int) +0:17 Sequence +0:17 Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) +0:17 pos: direct index for structure ( temp 4-component vector of float) +0:17 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip}) +0:17 Constant: +0:17 0 (const int) +0:? Sequence +0:17 move second child to first child ( temp float) +0:17 direct index ( out float ClipDistance) +0:? 'OutputStream.clip' ( out 2-element array of float ClipDistance) +0:17 Constant: +0:17 0 (const int) +0:17 direct index ( temp float) +0:17 clip: direct index for structure ( temp 2-component vector of float) +0:17 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip}) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 move second child to first child ( temp float) +0:17 direct index ( out float ClipDistance) +0:? 'OutputStream.clip' ( out 2-element array of float ClipDistance) +0:17 Constant: +0:17 1 (const int) +0:17 direct index ( temp float) +0:17 clip: direct index for structure ( temp 2-component vector of float) +0:17 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip}) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 EmitVertex ( temp void) +0:11 Function Definition: main( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 move second child to first child ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:11 move second child to first child ( temp 3-element array of uint) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? Sequence +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 3 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 3 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 3 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 3 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 3 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 3 (const int) +0:11 Function Call: @main(vf4[3];u1[3];struct-S-vf4-vf21;vf4[3]; ( temp void) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'OutputStream' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip}) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:? Linker Objects +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:? 'OutputStream.clip' ( out 2-element array of float ClipDistance) + + +Linked geometry stage: + + +Shader version: 500 +invocations = 1 +max_vertices = 3 +input primitive = triangles +output primitive = line_strip +0:? Sequence +0:11 Function Definition: @main(vf4[3];u1[3];struct-S-vf4-vf21;vf4[3]; ( temp void) +0:11 Function Parameters: +0:11 'pos' ( in 3-element array of 4-component vector of float) +0:11 'VertexID' ( in 3-element array of uint) +0:11 'OutputStream' ( out structure{ temp 4-component vector of float pos, temp 2-component vector of float clip}) +0:11 'clip' ( in 3-element array of 4-component vector of float) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 pos: direct index for structure ( temp 4-component vector of float) +0:14 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip}) +0:14 Constant: +0:14 0 (const int) +0:14 direct index ( temp 4-component vector of float) +0:14 'pos' ( in 3-element array of 4-component vector of float) +0:14 Constant: +0:14 0 (const int) +0:15 move second child to first child ( temp 2-component vector of float) +0:15 clip: direct index for structure ( temp 2-component vector of float) +0:15 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip}) +0:15 Constant: +0:15 1 (const int) +0:15 vector swizzle ( temp 2-component vector of float) +0:15 direct index ( temp 4-component vector of float) +0:15 'clip' ( in 3-element array of 4-component vector of float) +0:15 Constant: +0:15 0 (const int) +0:15 Sequence +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 1 (const int) +0:17 Sequence +0:17 Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) +0:17 pos: direct index for structure ( temp 4-component vector of float) +0:17 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip}) +0:17 Constant: +0:17 0 (const int) +0:? Sequence +0:17 move second child to first child ( temp float) +0:17 direct index ( out float ClipDistance) +0:? 'OutputStream.clip' ( out 2-element array of float ClipDistance) +0:17 Constant: +0:17 0 (const int) +0:17 direct index ( temp float) +0:17 clip: direct index for structure ( temp 2-component vector of float) +0:17 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip}) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 move second child to first child ( temp float) +0:17 direct index ( out float ClipDistance) +0:? 'OutputStream.clip' ( out 2-element array of float ClipDistance) +0:17 Constant: +0:17 1 (const int) +0:17 direct index ( temp float) +0:17 clip: direct index for structure ( temp 2-component vector of float) +0:17 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip}) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 EmitVertex ( temp void) +0:11 Function Definition: main( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 move second child to first child ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:11 move second child to first child ( temp 3-element array of uint) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? Sequence +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 3 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 3 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 3 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 3 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 3 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 3 (const int) +0:11 Function Call: @main(vf4[3];u1[3];struct-S-vf4-vf21;vf4[3]; ( temp void) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'OutputStream' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip}) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:? Linker Objects +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:? 'OutputStream.clip' ( out 2-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 118 + + Capability Geometry + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 38 44 57 61 68 + ExecutionMode 4 Triangles + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputLineStrip + ExecutionMode 4 OutputVertices 3 + Source HLSL 500 + Name 4 "main" + Name 15 "S" + MemberName 15(S) 0 "pos" + MemberName 15(S) 1 "clip" + Name 22 "@main(vf4[3];u1[3];struct-S-vf4-vf21;vf4[3];" + Name 18 "pos" + Name 19 "VertexID" + Name 20 "OutputStream" + Name 21 "clip" + Name 24 "s" + Name 38 "OutputStream.pos" + Name 44 "OutputStream.clip" + Name 55 "pos" + Name 57 "pos" + Name 59 "VertexID" + Name 61 "VertexID" + Name 63 "clip" + Name 68 "clip" + Name 108 "OutputStream" + Name 109 "param" + Name 111 "param" + Name 113 "param" + Name 114 "param" + Decorate 38(OutputStream.pos) BuiltIn Position + Decorate 44(OutputStream.clip) BuiltIn ClipDistance + Decorate 57(pos) BuiltIn Position + Decorate 61(VertexID) Location 0 + Decorate 68(clip) BuiltIn ClipDistance + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 0 + 9: 8(int) Constant 3 + 10: TypeArray 7(fvec4) 9 + 11: TypePointer Function 10 + 12: TypeArray 8(int) 9 + 13: TypePointer Function 12 + 14: TypeVector 6(float) 2 + 15(S): TypeStruct 7(fvec4) 14(fvec2) + 16: TypePointer Function 15(S) + 17: TypeFunction 2 11(ptr) 13(ptr) 16(ptr) 11(ptr) + 25: TypeInt 32 1 + 26: 25(int) Constant 0 + 27: TypePointer Function 7(fvec4) + 31: 25(int) Constant 1 + 35: TypePointer Function 14(fvec2) + 37: TypePointer Output 7(fvec4) +38(OutputStream.pos): 37(ptr) Variable Output + 41: 8(int) Constant 2 + 42: TypeArray 6(float) 41 + 43: TypePointer Output 42 +44(OutputStream.clip): 43(ptr) Variable Output + 45: 8(int) Constant 0 + 46: TypePointer Function 6(float) + 49: TypePointer Output 6(float) + 51: 8(int) Constant 1 + 56: TypePointer Input 10 + 57(pos): 56(ptr) Variable Input + 60: TypePointer Input 12 + 61(VertexID): 60(ptr) Variable Input + 64: 8(int) Constant 4 + 65: TypeArray 6(float) 64 + 66: TypeArray 65 9 + 67: TypePointer Input 66 + 68(clip): 67(ptr) Variable Input + 69: TypePointer Input 6(float) + 76: 25(int) Constant 2 + 80: 25(int) Constant 3 + 4(main): 2 Function None 3 + 5: Label + 55(pos): 11(ptr) Variable Function + 59(VertexID): 13(ptr) Variable Function + 63(clip): 11(ptr) Variable Function +108(OutputStream): 16(ptr) Variable Function + 109(param): 11(ptr) Variable Function + 111(param): 13(ptr) Variable Function + 113(param): 16(ptr) Variable Function + 114(param): 11(ptr) Variable Function + 58: 10 Load 57(pos) + Store 55(pos) 58 + 62: 12 Load 61(VertexID) + Store 59(VertexID) 62 + 70: 69(ptr) AccessChain 68(clip) 26 26 + 71: 6(float) Load 70 + 72: 46(ptr) AccessChain 63(clip) 26 45 + Store 72 71 + 73: 69(ptr) AccessChain 68(clip) 26 31 + 74: 6(float) Load 73 + 75: 46(ptr) AccessChain 63(clip) 26 51 + Store 75 74 + 77: 69(ptr) AccessChain 68(clip) 26 76 + 78: 6(float) Load 77 + 79: 46(ptr) AccessChain 63(clip) 26 41 + Store 79 78 + 81: 69(ptr) AccessChain 68(clip) 26 80 + 82: 6(float) Load 81 + 83: 46(ptr) AccessChain 63(clip) 26 9 + Store 83 82 + 84: 69(ptr) AccessChain 68(clip) 31 26 + 85: 6(float) Load 84 + 86: 46(ptr) AccessChain 63(clip) 31 45 + Store 86 85 + 87: 69(ptr) AccessChain 68(clip) 31 31 + 88: 6(float) Load 87 + 89: 46(ptr) AccessChain 63(clip) 31 51 + Store 89 88 + 90: 69(ptr) AccessChain 68(clip) 31 76 + 91: 6(float) Load 90 + 92: 46(ptr) AccessChain 63(clip) 31 41 + Store 92 91 + 93: 69(ptr) AccessChain 68(clip) 31 80 + 94: 6(float) Load 93 + 95: 46(ptr) AccessChain 63(clip) 31 9 + Store 95 94 + 96: 69(ptr) AccessChain 68(clip) 76 26 + 97: 6(float) Load 96 + 98: 46(ptr) AccessChain 63(clip) 76 45 + Store 98 97 + 99: 69(ptr) AccessChain 68(clip) 76 31 + 100: 6(float) Load 99 + 101: 46(ptr) AccessChain 63(clip) 76 51 + Store 101 100 + 102: 69(ptr) AccessChain 68(clip) 76 76 + 103: 6(float) Load 102 + 104: 46(ptr) AccessChain 63(clip) 76 41 + Store 104 103 + 105: 69(ptr) AccessChain 68(clip) 76 80 + 106: 6(float) Load 105 + 107: 46(ptr) AccessChain 63(clip) 76 9 + Store 107 106 + 110: 10 Load 55(pos) + Store 109(param) 110 + 112: 12 Load 59(VertexID) + Store 111(param) 112 + 115: 10 Load 63(clip) + Store 114(param) 115 + 116: 2 FunctionCall 22(@main(vf4[3];u1[3];struct-S-vf4-vf21;vf4[3];) 109(param) 111(param) 113(param) 114(param) + 117: 15(S) Load 113(param) + Store 108(OutputStream) 117 + Return + FunctionEnd +22(@main(vf4[3];u1[3];struct-S-vf4-vf21;vf4[3];): 2 Function None 17 + 18(pos): 11(ptr) FunctionParameter + 19(VertexID): 13(ptr) FunctionParameter +20(OutputStream): 16(ptr) FunctionParameter + 21(clip): 11(ptr) FunctionParameter + 23: Label + 24(s): 16(ptr) Variable Function + 28: 27(ptr) AccessChain 18(pos) 26 + 29: 7(fvec4) Load 28 + 30: 27(ptr) AccessChain 24(s) 26 + Store 30 29 + 32: 27(ptr) AccessChain 21(clip) 26 + 33: 7(fvec4) Load 32 + 34: 14(fvec2) VectorShuffle 33 33 0 1 + 36: 35(ptr) AccessChain 24(s) 31 + Store 36 34 + 39: 27(ptr) AccessChain 24(s) 26 + 40: 7(fvec4) Load 39 + Store 38(OutputStream.pos) 40 + 47: 46(ptr) AccessChain 24(s) 31 45 + 48: 6(float) Load 47 + 50: 49(ptr) AccessChain 44(OutputStream.clip) 26 + Store 50 48 + 52: 46(ptr) AccessChain 24(s) 31 51 + 53: 6(float) Load 52 + 54: 49(ptr) AccessChain 44(OutputStream.clip) 31 + Store 54 53 + EmitVertex + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-1.vert.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-1.vert.out new file mode 100644 index 00000000..d1d1370a --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-1.vert.out @@ -0,0 +1,194 @@ +hlsl.clipdistance-1.vert +Shader version: 500 +0:? Sequence +0:4 Function Definition: @main(vf4;f1;f1; ( temp void) +0:4 Function Parameters: +0:4 'pos' ( out 4-component vector of float) +0:4 'clip' ( out float) +0:4 'cull' ( out float) +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:5 'pos' ( out 4-component vector of float) +0:5 Constant: +0:5 1.000000 +0:5 1.000000 +0:5 1.000000 +0:5 1.000000 +0:6 move second child to first child ( temp float) +0:6 'clip' ( out float) +0:6 Constant: +0:6 0.500000 +0:7 move second child to first child ( temp float) +0:7 'cull' ( out float) +0:7 Constant: +0:7 0.510000 +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 Function Call: @main(vf4;f1;f1; ( temp void) +0:? 'pos' ( temp 4-component vector of float) +0:? 'clip' ( temp float) +0:? 'cull' ( temp float) +0:4 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( out 4-component vector of float Position) +0:? 'pos' ( temp 4-component vector of float) +0:? Sequence +0:4 move second child to first child ( temp float) +0:4 direct index ( out float ClipDistance) +0:? 'clip' ( out 1-element array of float ClipDistance) +0:4 Constant: +0:4 0 (const int) +0:? 'clip' ( temp float) +0:? Sequence +0:4 move second child to first child ( temp float) +0:4 direct index ( out float CullDistance) +0:? 'cull' ( out 1-element array of float CullDistance) +0:4 Constant: +0:4 0 (const int) +0:? 'cull' ( temp float) +0:? Linker Objects +0:? 'pos' ( out 4-component vector of float Position) +0:? 'clip' ( out 1-element array of float ClipDistance) +0:? 'cull' ( out 1-element array of float CullDistance) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:4 Function Definition: @main(vf4;f1;f1; ( temp void) +0:4 Function Parameters: +0:4 'pos' ( out 4-component vector of float) +0:4 'clip' ( out float) +0:4 'cull' ( out float) +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:5 'pos' ( out 4-component vector of float) +0:5 Constant: +0:5 1.000000 +0:5 1.000000 +0:5 1.000000 +0:5 1.000000 +0:6 move second child to first child ( temp float) +0:6 'clip' ( out float) +0:6 Constant: +0:6 0.500000 +0:7 move second child to first child ( temp float) +0:7 'cull' ( out float) +0:7 Constant: +0:7 0.510000 +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 Function Call: @main(vf4;f1;f1; ( temp void) +0:? 'pos' ( temp 4-component vector of float) +0:? 'clip' ( temp float) +0:? 'cull' ( temp float) +0:4 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( out 4-component vector of float Position) +0:? 'pos' ( temp 4-component vector of float) +0:? Sequence +0:4 move second child to first child ( temp float) +0:4 direct index ( out float ClipDistance) +0:? 'clip' ( out 1-element array of float ClipDistance) +0:4 Constant: +0:4 0 (const int) +0:? 'clip' ( temp float) +0:? Sequence +0:4 move second child to first child ( temp float) +0:4 direct index ( out float CullDistance) +0:? 'cull' ( out 1-element array of float CullDistance) +0:4 Constant: +0:4 0 (const int) +0:? 'cull' ( temp float) +0:? Linker Objects +0:? 'pos' ( out 4-component vector of float Position) +0:? 'clip' ( out 1-element array of float ClipDistance) +0:? 'cull' ( out 1-element array of float CullDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 46 + + Capability Shader + Capability ClipDistance + Capability CullDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 31 37 43 + Source HLSL 500 + Name 4 "main" + Name 14 "@main(vf4;f1;f1;" + Name 11 "pos" + Name 12 "clip" + Name 13 "cull" + Name 20 "pos" + Name 21 "clip" + Name 22 "cull" + Name 23 "param" + Name 24 "param" + Name 25 "param" + Name 31 "pos" + Name 37 "clip" + Name 43 "cull" + Decorate 31(pos) BuiltIn Position + Decorate 37(clip) BuiltIn ClipDistance + Decorate 43(cull) BuiltIn CullDistance + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypePointer Function 6(float) + 10: TypeFunction 2 8(ptr) 9(ptr) 9(ptr) + 16: 6(float) Constant 1065353216 + 17: 7(fvec4) ConstantComposite 16 16 16 16 + 18: 6(float) Constant 1056964608 + 19: 6(float) Constant 1057132380 + 30: TypePointer Output 7(fvec4) + 31(pos): 30(ptr) Variable Output + 33: TypeInt 32 0 + 34: 33(int) Constant 1 + 35: TypeArray 6(float) 34 + 36: TypePointer Output 35 + 37(clip): 36(ptr) Variable Output + 38: TypeInt 32 1 + 39: 38(int) Constant 0 + 41: TypePointer Output 6(float) + 43(cull): 36(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 20(pos): 8(ptr) Variable Function + 21(clip): 9(ptr) Variable Function + 22(cull): 9(ptr) Variable Function + 23(param): 8(ptr) Variable Function + 24(param): 9(ptr) Variable Function + 25(param): 9(ptr) Variable Function + 26: 2 FunctionCall 14(@main(vf4;f1;f1;) 23(param) 24(param) 25(param) + 27: 7(fvec4) Load 23(param) + Store 20(pos) 27 + 28: 6(float) Load 24(param) + Store 21(clip) 28 + 29: 6(float) Load 25(param) + Store 22(cull) 29 + 32: 7(fvec4) Load 20(pos) + Store 31(pos) 32 + 40: 6(float) Load 21(clip) + 42: 41(ptr) AccessChain 37(clip) 39 + Store 42 40 + 44: 6(float) Load 22(cull) + 45: 41(ptr) AccessChain 43(cull) 39 + Store 45 44 + Return + FunctionEnd +14(@main(vf4;f1;f1;): 2 Function None 10 + 11(pos): 8(ptr) FunctionParameter + 12(clip): 9(ptr) FunctionParameter + 13(cull): 9(ptr) FunctionParameter + 15: Label + Store 11(pos) 17 + Store 12(clip) 18 + Store 13(cull) 19 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-2.frag.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-2.frag.out new file mode 100644 index 00000000..64604ebb --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-2.frag.out @@ -0,0 +1,419 @@ +hlsl.clipdistance-2.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: @main(vf4;vf2[2];vf2[2]; ( temp 4-component vector of float) +0:4 Function Parameters: +0:4 'pos' ( in 4-component vector of float) +0:4 'clip' ( in 2-element array of 2-component vector of float) +0:4 'cull' ( in 2-element array of 2-component vector of float) +0:? Sequence +0:6 Branch: Return with expression +0:6 add ( temp 4-component vector of float) +0:6 add ( temp 4-component vector of float) +0:6 'pos' ( in 4-component vector of float) +0:6 direct index ( temp float) +0:6 direct index ( temp 2-component vector of float) +0:6 'clip' ( in 2-element array of 2-component vector of float) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0 (const int) +0:6 direct index ( temp float) +0:6 direct index ( temp 2-component vector of float) +0:6 'cull' ( in 2-element array of 2-component vector of float) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0 (const int) +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:? Sequence +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 direct index ( in float ClipDistance) +0:? 'clip' ( in 4-element array of float ClipDistance) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 1 (const int) +0:4 direct index ( in float ClipDistance) +0:? 'clip' ( in 4-element array of float ClipDistance) +0:4 Constant: +0:4 1 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 direct index ( in float ClipDistance) +0:? 'clip' ( in 4-element array of float ClipDistance) +0:4 Constant: +0:4 2 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 1 (const int) +0:4 direct index ( in float ClipDistance) +0:? 'clip' ( in 4-element array of float ClipDistance) +0:4 Constant: +0:4 3 (const int) +0:? Sequence +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 direct index ( in float CullDistance) +0:? 'cull' ( in 4-element array of float CullDistance) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 1 (const int) +0:4 direct index ( in float CullDistance) +0:? 'cull' ( in 4-element array of float CullDistance) +0:4 Constant: +0:4 1 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 direct index ( in float CullDistance) +0:? 'cull' ( in 4-element array of float CullDistance) +0:4 Constant: +0:4 2 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 1 (const int) +0:4 direct index ( in float CullDistance) +0:? 'cull' ( in 4-element array of float CullDistance) +0:4 Constant: +0:4 3 (const int) +0:4 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:4 Function Call: @main(vf4;vf2[2];vf2[2]; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:? 'clip' ( in 4-element array of float ClipDistance) +0:? 'cull' ( in 4-element array of float CullDistance) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: @main(vf4;vf2[2];vf2[2]; ( temp 4-component vector of float) +0:4 Function Parameters: +0:4 'pos' ( in 4-component vector of float) +0:4 'clip' ( in 2-element array of 2-component vector of float) +0:4 'cull' ( in 2-element array of 2-component vector of float) +0:? Sequence +0:6 Branch: Return with expression +0:6 add ( temp 4-component vector of float) +0:6 add ( temp 4-component vector of float) +0:6 'pos' ( in 4-component vector of float) +0:6 direct index ( temp float) +0:6 direct index ( temp 2-component vector of float) +0:6 'clip' ( in 2-element array of 2-component vector of float) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0 (const int) +0:6 direct index ( temp float) +0:6 direct index ( temp 2-component vector of float) +0:6 'cull' ( in 2-element array of 2-component vector of float) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0 (const int) +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:? Sequence +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 direct index ( in float ClipDistance) +0:? 'clip' ( in 4-element array of float ClipDistance) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 1 (const int) +0:4 direct index ( in float ClipDistance) +0:? 'clip' ( in 4-element array of float ClipDistance) +0:4 Constant: +0:4 1 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 direct index ( in float ClipDistance) +0:? 'clip' ( in 4-element array of float ClipDistance) +0:4 Constant: +0:4 2 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 1 (const int) +0:4 direct index ( in float ClipDistance) +0:? 'clip' ( in 4-element array of float ClipDistance) +0:4 Constant: +0:4 3 (const int) +0:? Sequence +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 direct index ( in float CullDistance) +0:? 'cull' ( in 4-element array of float CullDistance) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 1 (const int) +0:4 direct index ( in float CullDistance) +0:? 'cull' ( in 4-element array of float CullDistance) +0:4 Constant: +0:4 1 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 direct index ( in float CullDistance) +0:? 'cull' ( in 4-element array of float CullDistance) +0:4 Constant: +0:4 2 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 1 (const int) +0:4 direct index ( in float CullDistance) +0:? 'cull' ( in 4-element array of float CullDistance) +0:4 Constant: +0:4 3 (const int) +0:4 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:4 Function Call: @main(vf4;vf2[2];vf2[2]; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:? 'clip' ( in 4-element array of float ClipDistance) +0:? 'cull' ( in 4-element array of float CullDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 84 + + Capability Shader + Capability ClipDistance + Capability CullDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 37 43 62 76 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 18 "@main(vf4;vf2[2];vf2[2];" + Name 15 "pos" + Name 16 "clip" + Name 17 "cull" + Name 35 "pos" + Name 37 "pos" + Name 39 "clip" + Name 43 "clip" + Name 61 "cull" + Name 62 "cull" + Name 76 "@entryPointOutput" + Name 77 "param" + Name 79 "param" + Name 81 "param" + Decorate 37(pos) BuiltIn FragCoord + Decorate 43(clip) BuiltIn ClipDistance + Decorate 62(cull) BuiltIn CullDistance + Decorate 76(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeVector 6(float) 2 + 10: TypeInt 32 0 + 11: 10(int) Constant 2 + 12: TypeArray 9(fvec2) 11 + 13: TypePointer Function 12 + 14: TypeFunction 7(fvec4) 8(ptr) 13(ptr) 13(ptr) + 21: TypeInt 32 1 + 22: 21(int) Constant 0 + 23: 10(int) Constant 0 + 24: TypePointer Function 6(float) + 36: TypePointer Input 7(fvec4) + 37(pos): 36(ptr) Variable Input + 40: 10(int) Constant 4 + 41: TypeArray 6(float) 40 + 42: TypePointer Input 41 + 43(clip): 42(ptr) Variable Input + 44: TypePointer Input 6(float) + 48: 21(int) Constant 1 + 51: 10(int) Constant 1 + 53: 21(int) Constant 2 + 57: 21(int) Constant 3 + 62(cull): 42(ptr) Variable Input + 75: TypePointer Output 7(fvec4) +76(@entryPointOutput): 75(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 35(pos): 8(ptr) Variable Function + 39(clip): 13(ptr) Variable Function + 61(cull): 13(ptr) Variable Function + 77(param): 8(ptr) Variable Function + 79(param): 13(ptr) Variable Function + 81(param): 13(ptr) Variable Function + 38: 7(fvec4) Load 37(pos) + Store 35(pos) 38 + 45: 44(ptr) AccessChain 43(clip) 22 + 46: 6(float) Load 45 + 47: 24(ptr) AccessChain 39(clip) 22 23 + Store 47 46 + 49: 44(ptr) AccessChain 43(clip) 48 + 50: 6(float) Load 49 + 52: 24(ptr) AccessChain 39(clip) 22 51 + Store 52 50 + 54: 44(ptr) AccessChain 43(clip) 53 + 55: 6(float) Load 54 + 56: 24(ptr) AccessChain 39(clip) 48 23 + Store 56 55 + 58: 44(ptr) AccessChain 43(clip) 57 + 59: 6(float) Load 58 + 60: 24(ptr) AccessChain 39(clip) 48 51 + Store 60 59 + 63: 44(ptr) AccessChain 62(cull) 22 + 64: 6(float) Load 63 + 65: 24(ptr) AccessChain 61(cull) 22 23 + Store 65 64 + 66: 44(ptr) AccessChain 62(cull) 48 + 67: 6(float) Load 66 + 68: 24(ptr) AccessChain 61(cull) 22 51 + Store 68 67 + 69: 44(ptr) AccessChain 62(cull) 53 + 70: 6(float) Load 69 + 71: 24(ptr) AccessChain 61(cull) 48 23 + Store 71 70 + 72: 44(ptr) AccessChain 62(cull) 57 + 73: 6(float) Load 72 + 74: 24(ptr) AccessChain 61(cull) 48 51 + Store 74 73 + 78: 7(fvec4) Load 35(pos) + Store 77(param) 78 + 80: 12 Load 39(clip) + Store 79(param) 80 + 82: 12 Load 61(cull) + Store 81(param) 82 + 83: 7(fvec4) FunctionCall 18(@main(vf4;vf2[2];vf2[2];) 77(param) 79(param) 81(param) + Store 76(@entryPointOutput) 83 + Return + FunctionEnd +18(@main(vf4;vf2[2];vf2[2];): 7(fvec4) Function None 14 + 15(pos): 8(ptr) FunctionParameter + 16(clip): 13(ptr) FunctionParameter + 17(cull): 13(ptr) FunctionParameter + 19: Label + 20: 7(fvec4) Load 15(pos) + 25: 24(ptr) AccessChain 16(clip) 22 23 + 26: 6(float) Load 25 + 27: 7(fvec4) CompositeConstruct 26 26 26 26 + 28: 7(fvec4) FAdd 20 27 + 29: 24(ptr) AccessChain 17(cull) 22 23 + 30: 6(float) Load 29 + 31: 7(fvec4) CompositeConstruct 30 30 30 30 + 32: 7(fvec4) FAdd 28 31 + ReturnValue 32 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-2.geom.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-2.geom.out new file mode 100644 index 00000000..a8abd02f --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-2.geom.out @@ -0,0 +1,924 @@ +hlsl.clipdistance-2.geom +Shader version: 500 +invocations = -1 +max_vertices = 3 +input primitive = triangles +output primitive = line_strip +0:? Sequence +0:11 Function Definition: @main(vf4[3];u1[3];struct-S-vf4-vf2[2]1;vf2[3][2]; ( temp void) +0:11 Function Parameters: +0:11 'pos' ( in 3-element array of 4-component vector of float) +0:11 'VertexID' ( in 3-element array of uint) +0:11 'OutputStream' ( out structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:11 'clip' ( in 3-element array of 2-element array of 2-component vector of float) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 pos: direct index for structure ( temp 4-component vector of float) +0:14 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:14 Constant: +0:14 0 (const int) +0:14 direct index ( temp 4-component vector of float) +0:14 'pos' ( in 3-element array of 4-component vector of float) +0:14 Constant: +0:14 0 (const int) +0:15 move second child to first child ( temp 2-component vector of float) +0:15 direct index ( temp 2-component vector of float) +0:15 clip: direct index for structure ( temp 2-element array of 2-component vector of float) +0:15 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:15 Constant: +0:15 1 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 direct index ( temp 2-component vector of float) +0:15 direct index ( temp 2-element array of 2-component vector of float) +0:15 'clip' ( in 3-element array of 2-element array of 2-component vector of float) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:16 move second child to first child ( temp 2-component vector of float) +0:16 direct index ( temp 2-component vector of float) +0:16 clip: direct index for structure ( temp 2-element array of 2-component vector of float) +0:16 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 direct index ( temp 2-component vector of float) +0:16 direct index ( temp 2-element array of 2-component vector of float) +0:16 'clip' ( in 3-element array of 2-element array of 2-component vector of float) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:18 Sequence +0:18 Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) +0:18 pos: direct index for structure ( temp 4-component vector of float) +0:18 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:18 Constant: +0:18 0 (const int) +0:? Sequence +0:18 move second child to first child ( temp float) +0:18 direct index ( out float ClipDistance) +0:? 'OutputStream.clip' ( out 4-element array of float ClipDistance) +0:18 Constant: +0:18 0 (const int) +0:18 direct index ( temp float) +0:18 direct index ( temp 2-component vector of float) +0:18 clip: direct index for structure ( temp 2-element array of 2-component vector of float) +0:18 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 0 (const int) +0:18 Constant: +0:18 0 (const int) +0:18 move second child to first child ( temp float) +0:18 direct index ( out float ClipDistance) +0:? 'OutputStream.clip' ( out 4-element array of float ClipDistance) +0:18 Constant: +0:18 1 (const int) +0:18 direct index ( temp float) +0:18 direct index ( temp 2-component vector of float) +0:18 clip: direct index for structure ( temp 2-element array of 2-component vector of float) +0:18 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 0 (const int) +0:18 Constant: +0:18 1 (const int) +0:18 move second child to first child ( temp float) +0:18 direct index ( out float ClipDistance) +0:? 'OutputStream.clip' ( out 4-element array of float ClipDistance) +0:18 Constant: +0:18 2 (const int) +0:18 direct index ( temp float) +0:18 direct index ( temp 2-component vector of float) +0:18 clip: direct index for structure ( temp 2-element array of 2-component vector of float) +0:18 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 0 (const int) +0:18 move second child to first child ( temp float) +0:18 direct index ( out float ClipDistance) +0:? 'OutputStream.clip' ( out 4-element array of float ClipDistance) +0:18 Constant: +0:18 3 (const int) +0:18 direct index ( temp float) +0:18 direct index ( temp 2-component vector of float) +0:18 clip: direct index for structure ( temp 2-element array of 2-component vector of float) +0:18 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 1 (const int) +0:18 EmitVertex ( temp void) +0:11 Function Definition: main( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 move second child to first child ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:11 move second child to first child ( temp 3-element array of uint) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? Sequence +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 3 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 3 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 3 (const int) +0:11 Function Call: @main(vf4[3];u1[3];struct-S-vf4-vf2[2]1;vf2[3][2]; ( temp void) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'OutputStream' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:? Linker Objects +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:? 'OutputStream.clip' ( out 4-element array of float ClipDistance) + + +Linked geometry stage: + + +Shader version: 500 +invocations = 1 +max_vertices = 3 +input primitive = triangles +output primitive = line_strip +0:? Sequence +0:11 Function Definition: @main(vf4[3];u1[3];struct-S-vf4-vf2[2]1;vf2[3][2]; ( temp void) +0:11 Function Parameters: +0:11 'pos' ( in 3-element array of 4-component vector of float) +0:11 'VertexID' ( in 3-element array of uint) +0:11 'OutputStream' ( out structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:11 'clip' ( in 3-element array of 2-element array of 2-component vector of float) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 pos: direct index for structure ( temp 4-component vector of float) +0:14 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:14 Constant: +0:14 0 (const int) +0:14 direct index ( temp 4-component vector of float) +0:14 'pos' ( in 3-element array of 4-component vector of float) +0:14 Constant: +0:14 0 (const int) +0:15 move second child to first child ( temp 2-component vector of float) +0:15 direct index ( temp 2-component vector of float) +0:15 clip: direct index for structure ( temp 2-element array of 2-component vector of float) +0:15 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:15 Constant: +0:15 1 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 direct index ( temp 2-component vector of float) +0:15 direct index ( temp 2-element array of 2-component vector of float) +0:15 'clip' ( in 3-element array of 2-element array of 2-component vector of float) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:16 move second child to first child ( temp 2-component vector of float) +0:16 direct index ( temp 2-component vector of float) +0:16 clip: direct index for structure ( temp 2-element array of 2-component vector of float) +0:16 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 direct index ( temp 2-component vector of float) +0:16 direct index ( temp 2-element array of 2-component vector of float) +0:16 'clip' ( in 3-element array of 2-element array of 2-component vector of float) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:18 Sequence +0:18 Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) +0:18 pos: direct index for structure ( temp 4-component vector of float) +0:18 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:18 Constant: +0:18 0 (const int) +0:? Sequence +0:18 move second child to first child ( temp float) +0:18 direct index ( out float ClipDistance) +0:? 'OutputStream.clip' ( out 4-element array of float ClipDistance) +0:18 Constant: +0:18 0 (const int) +0:18 direct index ( temp float) +0:18 direct index ( temp 2-component vector of float) +0:18 clip: direct index for structure ( temp 2-element array of 2-component vector of float) +0:18 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 0 (const int) +0:18 Constant: +0:18 0 (const int) +0:18 move second child to first child ( temp float) +0:18 direct index ( out float ClipDistance) +0:? 'OutputStream.clip' ( out 4-element array of float ClipDistance) +0:18 Constant: +0:18 1 (const int) +0:18 direct index ( temp float) +0:18 direct index ( temp 2-component vector of float) +0:18 clip: direct index for structure ( temp 2-element array of 2-component vector of float) +0:18 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 0 (const int) +0:18 Constant: +0:18 1 (const int) +0:18 move second child to first child ( temp float) +0:18 direct index ( out float ClipDistance) +0:? 'OutputStream.clip' ( out 4-element array of float ClipDistance) +0:18 Constant: +0:18 2 (const int) +0:18 direct index ( temp float) +0:18 direct index ( temp 2-component vector of float) +0:18 clip: direct index for structure ( temp 2-element array of 2-component vector of float) +0:18 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 0 (const int) +0:18 move second child to first child ( temp float) +0:18 direct index ( out float ClipDistance) +0:? 'OutputStream.clip' ( out 4-element array of float ClipDistance) +0:18 Constant: +0:18 3 (const int) +0:18 direct index ( temp float) +0:18 direct index ( temp 2-component vector of float) +0:18 clip: direct index for structure ( temp 2-element array of 2-component vector of float) +0:18 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 1 (const int) +0:18 EmitVertex ( temp void) +0:11 Function Definition: main( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 move second child to first child ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:11 move second child to first child ( temp 3-element array of uint) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? Sequence +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 3 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 3 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 direct index ( temp 2-element array of 2-component vector of float) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( in float ClipDistance) +0:11 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 3 (const int) +0:11 Function Call: @main(vf4[3];u1[3];struct-S-vf4-vf2[2]1;vf2[3][2]; ( temp void) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'OutputStream' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:? Linker Objects +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:? 'OutputStream.clip' ( out 4-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 128 + + Capability Geometry + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 44 50 71 75 80 + ExecutionMode 4 Triangles + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputLineStrip + ExecutionMode 4 OutputVertices 3 + Source HLSL 500 + Name 4 "main" + Name 17 "S" + MemberName 17(S) 0 "pos" + MemberName 17(S) 1 "clip" + Name 26 "@main(vf4[3];u1[3];struct-S-vf4-vf2[2]1;vf2[3][2];" + Name 22 "pos" + Name 23 "VertexID" + Name 24 "OutputStream" + Name 25 "clip" + Name 28 "s" + Name 44 "OutputStream.pos" + Name 50 "OutputStream.clip" + Name 69 "pos" + Name 71 "pos" + Name 73 "VertexID" + Name 75 "VertexID" + Name 77 "clip" + Name 80 "clip" + Name 118 "OutputStream" + Name 119 "param" + Name 121 "param" + Name 123 "param" + Name 124 "param" + Decorate 44(OutputStream.pos) BuiltIn Position + Decorate 50(OutputStream.clip) BuiltIn ClipDistance + Decorate 71(pos) BuiltIn Position + Decorate 75(VertexID) Location 0 + Decorate 80(clip) BuiltIn ClipDistance + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 0 + 9: 8(int) Constant 3 + 10: TypeArray 7(fvec4) 9 + 11: TypePointer Function 10 + 12: TypeArray 8(int) 9 + 13: TypePointer Function 12 + 14: TypeVector 6(float) 2 + 15: 8(int) Constant 2 + 16: TypeArray 14(fvec2) 15 + 17(S): TypeStruct 7(fvec4) 16 + 18: TypePointer Function 17(S) + 19: TypeArray 16 9 + 20: TypePointer Function 19 + 21: TypeFunction 2 11(ptr) 13(ptr) 18(ptr) 20(ptr) + 29: TypeInt 32 1 + 30: 29(int) Constant 0 + 31: TypePointer Function 7(fvec4) + 35: 29(int) Constant 1 + 36: TypePointer Function 14(fvec2) + 43: TypePointer Output 7(fvec4) +44(OutputStream.pos): 43(ptr) Variable Output + 47: 8(int) Constant 4 + 48: TypeArray 6(float) 47 + 49: TypePointer Output 48 +50(OutputStream.clip): 49(ptr) Variable Output + 51: 8(int) Constant 0 + 52: TypePointer Function 6(float) + 55: TypePointer Output 6(float) + 57: 8(int) Constant 1 + 61: 29(int) Constant 2 + 65: 29(int) Constant 3 + 70: TypePointer Input 10 + 71(pos): 70(ptr) Variable Input + 74: TypePointer Input 12 + 75(VertexID): 74(ptr) Variable Input + 78: TypeArray 48 9 + 79: TypePointer Input 78 + 80(clip): 79(ptr) Variable Input + 81: TypePointer Input 6(float) + 4(main): 2 Function None 3 + 5: Label + 69(pos): 11(ptr) Variable Function + 73(VertexID): 13(ptr) Variable Function + 77(clip): 20(ptr) Variable Function +118(OutputStream): 18(ptr) Variable Function + 119(param): 11(ptr) Variable Function + 121(param): 13(ptr) Variable Function + 123(param): 18(ptr) Variable Function + 124(param): 20(ptr) Variable Function + 72: 10 Load 71(pos) + Store 69(pos) 72 + 76: 12 Load 75(VertexID) + Store 73(VertexID) 76 + 82: 81(ptr) AccessChain 80(clip) 30 30 + 83: 6(float) Load 82 + 84: 52(ptr) AccessChain 77(clip) 30 30 51 + Store 84 83 + 85: 81(ptr) AccessChain 80(clip) 30 35 + 86: 6(float) Load 85 + 87: 52(ptr) AccessChain 77(clip) 30 30 57 + Store 87 86 + 88: 81(ptr) AccessChain 80(clip) 30 61 + 89: 6(float) Load 88 + 90: 52(ptr) AccessChain 77(clip) 30 35 51 + Store 90 89 + 91: 81(ptr) AccessChain 80(clip) 30 65 + 92: 6(float) Load 91 + 93: 52(ptr) AccessChain 77(clip) 30 35 57 + Store 93 92 + 94: 81(ptr) AccessChain 80(clip) 35 30 + 95: 6(float) Load 94 + 96: 52(ptr) AccessChain 77(clip) 35 30 51 + Store 96 95 + 97: 81(ptr) AccessChain 80(clip) 35 35 + 98: 6(float) Load 97 + 99: 52(ptr) AccessChain 77(clip) 35 30 57 + Store 99 98 + 100: 81(ptr) AccessChain 80(clip) 35 61 + 101: 6(float) Load 100 + 102: 52(ptr) AccessChain 77(clip) 35 35 51 + Store 102 101 + 103: 81(ptr) AccessChain 80(clip) 35 65 + 104: 6(float) Load 103 + 105: 52(ptr) AccessChain 77(clip) 35 35 57 + Store 105 104 + 106: 81(ptr) AccessChain 80(clip) 61 30 + 107: 6(float) Load 106 + 108: 52(ptr) AccessChain 77(clip) 61 30 51 + Store 108 107 + 109: 81(ptr) AccessChain 80(clip) 61 35 + 110: 6(float) Load 109 + 111: 52(ptr) AccessChain 77(clip) 61 30 57 + Store 111 110 + 112: 81(ptr) AccessChain 80(clip) 61 61 + 113: 6(float) Load 112 + 114: 52(ptr) AccessChain 77(clip) 61 35 51 + Store 114 113 + 115: 81(ptr) AccessChain 80(clip) 61 65 + 116: 6(float) Load 115 + 117: 52(ptr) AccessChain 77(clip) 61 35 57 + Store 117 116 + 120: 10 Load 69(pos) + Store 119(param) 120 + 122: 12 Load 73(VertexID) + Store 121(param) 122 + 125: 19 Load 77(clip) + Store 124(param) 125 + 126: 2 FunctionCall 26(@main(vf4[3];u1[3];struct-S-vf4-vf2[2]1;vf2[3][2];) 119(param) 121(param) 123(param) 124(param) + 127: 17(S) Load 123(param) + Store 118(OutputStream) 127 + Return + FunctionEnd +26(@main(vf4[3];u1[3];struct-S-vf4-vf2[2]1;vf2[3][2];): 2 Function None 21 + 22(pos): 11(ptr) FunctionParameter + 23(VertexID): 13(ptr) FunctionParameter +24(OutputStream): 18(ptr) FunctionParameter + 25(clip): 20(ptr) FunctionParameter + 27: Label + 28(s): 18(ptr) Variable Function + 32: 31(ptr) AccessChain 22(pos) 30 + 33: 7(fvec4) Load 32 + 34: 31(ptr) AccessChain 28(s) 30 + Store 34 33 + 37: 36(ptr) AccessChain 25(clip) 30 30 + 38: 14(fvec2) Load 37 + 39: 36(ptr) AccessChain 28(s) 35 30 + Store 39 38 + 40: 36(ptr) AccessChain 25(clip) 30 35 + 41: 14(fvec2) Load 40 + 42: 36(ptr) AccessChain 28(s) 35 35 + Store 42 41 + 45: 31(ptr) AccessChain 28(s) 30 + 46: 7(fvec4) Load 45 + Store 44(OutputStream.pos) 46 + 53: 52(ptr) AccessChain 28(s) 35 30 51 + 54: 6(float) Load 53 + 56: 55(ptr) AccessChain 50(OutputStream.clip) 30 + Store 56 54 + 58: 52(ptr) AccessChain 28(s) 35 30 57 + 59: 6(float) Load 58 + 60: 55(ptr) AccessChain 50(OutputStream.clip) 35 + Store 60 59 + 62: 52(ptr) AccessChain 28(s) 35 35 51 + 63: 6(float) Load 62 + 64: 55(ptr) AccessChain 50(OutputStream.clip) 61 + Store 64 63 + 66: 52(ptr) AccessChain 28(s) 35 35 57 + 67: 6(float) Load 66 + 68: 55(ptr) AccessChain 50(OutputStream.clip) 65 + Store 68 67 + EmitVertex + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-2.vert.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-2.vert.out new file mode 100644 index 00000000..397a25d7 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-2.vert.out @@ -0,0 +1,561 @@ +hlsl.clipdistance-2.vert +Shader version: 500 +0:? Sequence +0:4 Function Definition: @main(vf4;vf2[2];vf2[2]; ( temp void) +0:4 Function Parameters: +0:4 'pos' ( out 4-component vector of float) +0:4 'clip' ( out 2-element array of 2-component vector of float) +0:4 'cull' ( out 2-element array of 2-component vector of float) +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:5 'pos' ( out 4-component vector of float) +0:5 Constant: +0:5 1.000000 +0:5 1.000000 +0:5 1.000000 +0:5 1.000000 +0:6 move second child to first child ( temp float) +0:6 direct index ( temp float) +0:6 direct index ( temp 2-component vector of float) +0:6 'clip' ( out 2-element array of 2-component vector of float) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0.500000 +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 direct index ( temp 2-component vector of float) +0:7 'clip' ( out 2-element array of 2-component vector of float) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0.600000 +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 direct index ( temp 2-component vector of float) +0:8 'clip' ( out 2-element array of 2-component vector of float) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 0.700000 +0:9 move second child to first child ( temp float) +0:9 direct index ( temp float) +0:9 direct index ( temp 2-component vector of float) +0:9 'clip' ( out 2-element array of 2-component vector of float) +0:9 Constant: +0:9 1 (const int) +0:9 Constant: +0:9 1 (const int) +0:9 Constant: +0:9 0.800000 +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 'cull' ( out 2-element array of 2-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0.525000 +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 2-component vector of float) +0:12 'cull' ( out 2-element array of 2-component vector of float) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 0.625000 +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:13 'cull' ( out 2-element array of 2-component vector of float) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0.725000 +0:14 move second child to first child ( temp float) +0:14 direct index ( temp float) +0:14 direct index ( temp 2-component vector of float) +0:14 'cull' ( out 2-element array of 2-component vector of float) +0:14 Constant: +0:14 1 (const int) +0:14 Constant: +0:14 1 (const int) +0:14 Constant: +0:14 0.825000 +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 Function Call: @main(vf4;vf2[2];vf2[2]; ( temp void) +0:? 'pos' ( temp 4-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( out 4-component vector of float Position) +0:? 'pos' ( temp 4-component vector of float) +0:? Sequence +0:4 move second child to first child ( temp float) +0:4 direct index ( out float ClipDistance) +0:? 'clip' ( out 4-element array of float ClipDistance) +0:4 Constant: +0:4 0 (const int) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( out float ClipDistance) +0:? 'clip' ( out 4-element array of float ClipDistance) +0:4 Constant: +0:4 1 (const int) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 1 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( out float ClipDistance) +0:? 'clip' ( out 4-element array of float ClipDistance) +0:4 Constant: +0:4 2 (const int) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( out float ClipDistance) +0:? 'clip' ( out 4-element array of float ClipDistance) +0:4 Constant: +0:4 3 (const int) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 1 (const int) +0:? Sequence +0:4 move second child to first child ( temp float) +0:4 direct index ( out float CullDistance) +0:? 'cull' ( out 4-element array of float CullDistance) +0:4 Constant: +0:4 0 (const int) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( out float CullDistance) +0:? 'cull' ( out 4-element array of float CullDistance) +0:4 Constant: +0:4 1 (const int) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 1 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( out float CullDistance) +0:? 'cull' ( out 4-element array of float CullDistance) +0:4 Constant: +0:4 2 (const int) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( out float CullDistance) +0:? 'cull' ( out 4-element array of float CullDistance) +0:4 Constant: +0:4 3 (const int) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 1 (const int) +0:? Linker Objects +0:? 'pos' ( out 4-component vector of float Position) +0:? 'clip' ( out 4-element array of float ClipDistance) +0:? 'cull' ( out 4-element array of float CullDistance) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:4 Function Definition: @main(vf4;vf2[2];vf2[2]; ( temp void) +0:4 Function Parameters: +0:4 'pos' ( out 4-component vector of float) +0:4 'clip' ( out 2-element array of 2-component vector of float) +0:4 'cull' ( out 2-element array of 2-component vector of float) +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:5 'pos' ( out 4-component vector of float) +0:5 Constant: +0:5 1.000000 +0:5 1.000000 +0:5 1.000000 +0:5 1.000000 +0:6 move second child to first child ( temp float) +0:6 direct index ( temp float) +0:6 direct index ( temp 2-component vector of float) +0:6 'clip' ( out 2-element array of 2-component vector of float) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0.500000 +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 direct index ( temp 2-component vector of float) +0:7 'clip' ( out 2-element array of 2-component vector of float) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0.600000 +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 direct index ( temp 2-component vector of float) +0:8 'clip' ( out 2-element array of 2-component vector of float) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 0.700000 +0:9 move second child to first child ( temp float) +0:9 direct index ( temp float) +0:9 direct index ( temp 2-component vector of float) +0:9 'clip' ( out 2-element array of 2-component vector of float) +0:9 Constant: +0:9 1 (const int) +0:9 Constant: +0:9 1 (const int) +0:9 Constant: +0:9 0.800000 +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 'cull' ( out 2-element array of 2-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0.525000 +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 2-component vector of float) +0:12 'cull' ( out 2-element array of 2-component vector of float) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 0.625000 +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:13 'cull' ( out 2-element array of 2-component vector of float) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0.725000 +0:14 move second child to first child ( temp float) +0:14 direct index ( temp float) +0:14 direct index ( temp 2-component vector of float) +0:14 'cull' ( out 2-element array of 2-component vector of float) +0:14 Constant: +0:14 1 (const int) +0:14 Constant: +0:14 1 (const int) +0:14 Constant: +0:14 0.825000 +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 Function Call: @main(vf4;vf2[2];vf2[2]; ( temp void) +0:? 'pos' ( temp 4-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( out 4-component vector of float Position) +0:? 'pos' ( temp 4-component vector of float) +0:? Sequence +0:4 move second child to first child ( temp float) +0:4 direct index ( out float ClipDistance) +0:? 'clip' ( out 4-element array of float ClipDistance) +0:4 Constant: +0:4 0 (const int) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( out float ClipDistance) +0:? 'clip' ( out 4-element array of float ClipDistance) +0:4 Constant: +0:4 1 (const int) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 1 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( out float ClipDistance) +0:? 'clip' ( out 4-element array of float ClipDistance) +0:4 Constant: +0:4 2 (const int) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( out float ClipDistance) +0:? 'clip' ( out 4-element array of float ClipDistance) +0:4 Constant: +0:4 3 (const int) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 1 (const int) +0:? Sequence +0:4 move second child to first child ( temp float) +0:4 direct index ( out float CullDistance) +0:? 'cull' ( out 4-element array of float CullDistance) +0:4 Constant: +0:4 0 (const int) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( out float CullDistance) +0:? 'cull' ( out 4-element array of float CullDistance) +0:4 Constant: +0:4 1 (const int) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 1 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( out float CullDistance) +0:? 'cull' ( out 4-element array of float CullDistance) +0:4 Constant: +0:4 2 (const int) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( out float CullDistance) +0:? 'cull' ( out 4-element array of float CullDistance) +0:4 Constant: +0:4 3 (const int) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 1 (const int) +0:? Linker Objects +0:? 'pos' ( out 4-component vector of float Position) +0:? 'clip' ( out 4-element array of float ClipDistance) +0:? 'cull' ( out 4-element array of float CullDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 89 + + Capability Shader + Capability ClipDistance + Capability CullDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 55 60 76 + Source HLSL 500 + Name 4 "main" + Name 18 "@main(vf4;vf2[2];vf2[2];" + Name 15 "pos" + Name 16 "clip" + Name 17 "cull" + Name 44 "pos" + Name 45 "clip" + Name 46 "cull" + Name 47 "param" + Name 48 "param" + Name 49 "param" + Name 55 "pos" + Name 60 "clip" + Name 76 "cull" + Decorate 55(pos) BuiltIn Position + Decorate 60(clip) BuiltIn ClipDistance + Decorate 76(cull) BuiltIn CullDistance + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeVector 6(float) 2 + 10: TypeInt 32 0 + 11: 10(int) Constant 2 + 12: TypeArray 9(fvec2) 11 + 13: TypePointer Function 12 + 14: TypeFunction 2 8(ptr) 13(ptr) 13(ptr) + 20: 6(float) Constant 1065353216 + 21: 7(fvec4) ConstantComposite 20 20 20 20 + 22: TypeInt 32 1 + 23: 22(int) Constant 0 + 24: 6(float) Constant 1056964608 + 25: 10(int) Constant 0 + 26: TypePointer Function 6(float) + 28: 6(float) Constant 1058642330 + 29: 10(int) Constant 1 + 31: 22(int) Constant 1 + 32: 6(float) Constant 1060320051 + 34: 6(float) Constant 1061997773 + 36: 6(float) Constant 1057384038 + 38: 6(float) Constant 1059061760 + 40: 6(float) Constant 1060739482 + 42: 6(float) Constant 1062417203 + 54: TypePointer Output 7(fvec4) + 55(pos): 54(ptr) Variable Output + 57: 10(int) Constant 4 + 58: TypeArray 6(float) 57 + 59: TypePointer Output 58 + 60(clip): 59(ptr) Variable Output + 63: TypePointer Output 6(float) + 68: 22(int) Constant 2 + 72: 22(int) Constant 3 + 76(cull): 59(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 44(pos): 8(ptr) Variable Function + 45(clip): 13(ptr) Variable Function + 46(cull): 13(ptr) Variable Function + 47(param): 8(ptr) Variable Function + 48(param): 13(ptr) Variable Function + 49(param): 13(ptr) Variable Function + 50: 2 FunctionCall 18(@main(vf4;vf2[2];vf2[2];) 47(param) 48(param) 49(param) + 51: 7(fvec4) Load 47(param) + Store 44(pos) 51 + 52: 12 Load 48(param) + Store 45(clip) 52 + 53: 12 Load 49(param) + Store 46(cull) 53 + 56: 7(fvec4) Load 44(pos) + Store 55(pos) 56 + 61: 26(ptr) AccessChain 45(clip) 23 25 + 62: 6(float) Load 61 + 64: 63(ptr) AccessChain 60(clip) 23 + Store 64 62 + 65: 26(ptr) AccessChain 45(clip) 23 29 + 66: 6(float) Load 65 + 67: 63(ptr) AccessChain 60(clip) 31 + Store 67 66 + 69: 26(ptr) AccessChain 45(clip) 31 25 + 70: 6(float) Load 69 + 71: 63(ptr) AccessChain 60(clip) 68 + Store 71 70 + 73: 26(ptr) AccessChain 45(clip) 31 29 + 74: 6(float) Load 73 + 75: 63(ptr) AccessChain 60(clip) 72 + Store 75 74 + 77: 26(ptr) AccessChain 46(cull) 23 25 + 78: 6(float) Load 77 + 79: 63(ptr) AccessChain 76(cull) 23 + Store 79 78 + 80: 26(ptr) AccessChain 46(cull) 23 29 + 81: 6(float) Load 80 + 82: 63(ptr) AccessChain 76(cull) 31 + Store 82 81 + 83: 26(ptr) AccessChain 46(cull) 31 25 + 84: 6(float) Load 83 + 85: 63(ptr) AccessChain 76(cull) 68 + Store 85 84 + 86: 26(ptr) AccessChain 46(cull) 31 29 + 87: 6(float) Load 86 + 88: 63(ptr) AccessChain 76(cull) 72 + Store 88 87 + Return + FunctionEnd +18(@main(vf4;vf2[2];vf2[2];): 2 Function None 14 + 15(pos): 8(ptr) FunctionParameter + 16(clip): 13(ptr) FunctionParameter + 17(cull): 13(ptr) FunctionParameter + 19: Label + Store 15(pos) 21 + 27: 26(ptr) AccessChain 16(clip) 23 25 + Store 27 24 + 30: 26(ptr) AccessChain 16(clip) 23 29 + Store 30 28 + 33: 26(ptr) AccessChain 16(clip) 31 25 + Store 33 32 + 35: 26(ptr) AccessChain 16(clip) 31 29 + Store 35 34 + 37: 26(ptr) AccessChain 17(cull) 23 25 + Store 37 36 + 39: 26(ptr) AccessChain 17(cull) 23 29 + Store 39 38 + 41: 26(ptr) AccessChain 17(cull) 31 25 + Store 41 40 + 43: 26(ptr) AccessChain 17(cull) 31 29 + Store 43 42 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-3.frag.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-3.frag.out new file mode 100644 index 00000000..3b5082e8 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-3.frag.out @@ -0,0 +1,190 @@ +hlsl.clipdistance-3.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: @main(vf4;f1[2];f1[2]; ( temp 4-component vector of float) +0:4 Function Parameters: +0:4 'pos' ( in 4-component vector of float) +0:4 'clip' ( in 2-element array of float) +0:4 'cull' ( in 2-element array of float) +0:? Sequence +0:5 Branch: Return with expression +0:5 add ( temp 4-component vector of float) +0:5 add ( temp 4-component vector of float) +0:5 'pos' ( in 4-component vector of float) +0:5 direct index ( temp float) +0:5 'clip' ( in 2-element array of float) +0:5 Constant: +0:5 0 (const int) +0:5 direct index ( temp float) +0:5 'cull' ( in 2-element array of float) +0:5 Constant: +0:5 0 (const int) +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:? Sequence +0:4 move second child to first child ( temp 2-element array of float) +0:? 'clip' ( temp 2-element array of float) +0:? 'clip' ( in 2-element array of float ClipDistance) +0:? Sequence +0:4 move second child to first child ( temp 2-element array of float) +0:? 'cull' ( temp 2-element array of float) +0:? 'cull' ( in 2-element array of float CullDistance) +0:4 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:4 Function Call: @main(vf4;f1[2];f1[2]; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'clip' ( temp 2-element array of float) +0:? 'cull' ( temp 2-element array of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:? 'clip' ( in 2-element array of float ClipDistance) +0:? 'cull' ( in 2-element array of float CullDistance) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: @main(vf4;f1[2];f1[2]; ( temp 4-component vector of float) +0:4 Function Parameters: +0:4 'pos' ( in 4-component vector of float) +0:4 'clip' ( in 2-element array of float) +0:4 'cull' ( in 2-element array of float) +0:? Sequence +0:5 Branch: Return with expression +0:5 add ( temp 4-component vector of float) +0:5 add ( temp 4-component vector of float) +0:5 'pos' ( in 4-component vector of float) +0:5 direct index ( temp float) +0:5 'clip' ( in 2-element array of float) +0:5 Constant: +0:5 0 (const int) +0:5 direct index ( temp float) +0:5 'cull' ( in 2-element array of float) +0:5 Constant: +0:5 0 (const int) +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:? Sequence +0:4 move second child to first child ( temp 2-element array of float) +0:? 'clip' ( temp 2-element array of float) +0:? 'clip' ( in 2-element array of float ClipDistance) +0:? Sequence +0:4 move second child to first child ( temp 2-element array of float) +0:? 'cull' ( temp 2-element array of float) +0:? 'cull' ( in 2-element array of float CullDistance) +0:4 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:4 Function Call: @main(vf4;f1[2];f1[2]; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'clip' ( temp 2-element array of float) +0:? 'cull' ( temp 2-element array of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:? 'clip' ( in 2-element array of float ClipDistance) +0:? 'cull' ( in 2-element array of float CullDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 53 + + Capability Shader + Capability ClipDistance + Capability CullDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 35 39 42 45 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 17 "@main(vf4;f1[2];f1[2];" + Name 14 "pos" + Name 15 "clip" + Name 16 "cull" + Name 33 "pos" + Name 35 "pos" + Name 37 "clip" + Name 39 "clip" + Name 41 "cull" + Name 42 "cull" + Name 45 "@entryPointOutput" + Name 46 "param" + Name 48 "param" + Name 50 "param" + Decorate 35(pos) BuiltIn FragCoord + Decorate 39(clip) BuiltIn ClipDistance + Decorate 42(cull) BuiltIn CullDistance + Decorate 45(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeInt 32 0 + 10: 9(int) Constant 2 + 11: TypeArray 6(float) 10 + 12: TypePointer Function 11 + 13: TypeFunction 7(fvec4) 8(ptr) 12(ptr) 12(ptr) + 20: TypeInt 32 1 + 21: 20(int) Constant 0 + 22: TypePointer Function 6(float) + 34: TypePointer Input 7(fvec4) + 35(pos): 34(ptr) Variable Input + 38: TypePointer Input 11 + 39(clip): 38(ptr) Variable Input + 42(cull): 38(ptr) Variable Input + 44: TypePointer Output 7(fvec4) +45(@entryPointOutput): 44(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 33(pos): 8(ptr) Variable Function + 37(clip): 12(ptr) Variable Function + 41(cull): 12(ptr) Variable Function + 46(param): 8(ptr) Variable Function + 48(param): 12(ptr) Variable Function + 50(param): 12(ptr) Variable Function + 36: 7(fvec4) Load 35(pos) + Store 33(pos) 36 + 40: 11 Load 39(clip) + Store 37(clip) 40 + 43: 11 Load 42(cull) + Store 41(cull) 43 + 47: 7(fvec4) Load 33(pos) + Store 46(param) 47 + 49: 11 Load 37(clip) + Store 48(param) 49 + 51: 11 Load 41(cull) + Store 50(param) 51 + 52: 7(fvec4) FunctionCall 17(@main(vf4;f1[2];f1[2];) 46(param) 48(param) 50(param) + Store 45(@entryPointOutput) 52 + Return + FunctionEnd +17(@main(vf4;f1[2];f1[2];): 7(fvec4) Function None 13 + 14(pos): 8(ptr) FunctionParameter + 15(clip): 12(ptr) FunctionParameter + 16(cull): 12(ptr) FunctionParameter + 18: Label + 19: 7(fvec4) Load 14(pos) + 23: 22(ptr) AccessChain 15(clip) 21 + 24: 6(float) Load 23 + 25: 7(fvec4) CompositeConstruct 24 24 24 24 + 26: 7(fvec4) FAdd 19 25 + 27: 22(ptr) AccessChain 16(cull) 21 + 28: 6(float) Load 27 + 29: 7(fvec4) CompositeConstruct 28 28 28 28 + 30: 7(fvec4) FAdd 26 29 + ReturnValue 30 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-3.geom.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-3.geom.out new file mode 100644 index 00000000..f8ba5c6d --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-3.geom.out @@ -0,0 +1,830 @@ +hlsl.clipdistance-3.geom +Shader version: 500 +invocations = -1 +max_vertices = 3 +input primitive = triangles +output primitive = line_strip +0:? Sequence +0:12 Function Definition: @main(vf4[3];u1[3];struct-S-vf4-vf2-vf21;vf4[3]; ( temp void) +0:12 Function Parameters: +0:12 'pos' ( in 3-element array of 4-component vector of float) +0:12 'VertexID' ( in 3-element array of uint) +0:12 'OutputStream' ( out structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:12 'clip' ( in 3-element array of 4-component vector of float) +0:? Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:15 pos: direct index for structure ( temp 4-component vector of float) +0:15 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:15 Constant: +0:15 0 (const int) +0:15 direct index ( temp 4-component vector of float) +0:15 'pos' ( in 3-element array of 4-component vector of float) +0:15 Constant: +0:15 0 (const int) +0:16 move second child to first child ( temp 2-component vector of float) +0:16 clip0: direct index for structure ( temp 2-component vector of float) +0:16 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:16 Constant: +0:16 1 (const int) +0:16 vector swizzle ( temp 2-component vector of float) +0:16 direct index ( temp 4-component vector of float) +0:16 'clip' ( in 3-element array of 4-component vector of float) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:17 move second child to first child ( temp 2-component vector of float) +0:17 clip1: direct index for structure ( temp 2-component vector of float) +0:17 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:17 Constant: +0:17 2 (const int) +0:17 vector swizzle ( temp 2-component vector of float) +0:17 direct index ( temp 4-component vector of float) +0:17 'clip' ( in 3-element array of 4-component vector of float) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 3 (const int) +0:19 Sequence +0:19 Sequence +0:19 move second child to first child ( temp 4-component vector of float) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) +0:19 pos: direct index for structure ( temp 4-component vector of float) +0:19 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:19 Constant: +0:19 0 (const int) +0:? Sequence +0:19 move second child to first child ( temp float) +0:19 direct index ( out float ClipDistance) +0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) +0:19 Constant: +0:19 0 (const int) +0:19 direct index ( temp float) +0:19 clip0: direct index for structure ( temp 2-component vector of float) +0:19 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 0 (const int) +0:19 move second child to first child ( temp float) +0:19 direct index ( out float ClipDistance) +0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) +0:19 Constant: +0:19 1 (const int) +0:19 direct index ( temp float) +0:19 clip0: direct index for structure ( temp 2-component vector of float) +0:19 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 1 (const int) +0:? Sequence +0:19 move second child to first child ( temp float) +0:19 direct index ( out float ClipDistance) +0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) +0:19 Constant: +0:19 2 (const int) +0:19 direct index ( temp float) +0:19 clip1: direct index for structure ( temp 2-component vector of float) +0:19 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 0 (const int) +0:19 move second child to first child ( temp float) +0:19 direct index ( out float ClipDistance) +0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) +0:19 Constant: +0:19 3 (const int) +0:19 direct index ( temp float) +0:19 clip1: direct index for structure ( temp 2-component vector of float) +0:19 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 EmitVertex ( temp void) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:12 move second child to first child ( temp 3-element array of uint) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? Sequence +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 2 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 2 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 3 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 3 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 2 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 2 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 3 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 3 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 2 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 2 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 3 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 3 (const int) +0:12 Function Call: @main(vf4[3];u1[3];struct-S-vf4-vf2-vf21;vf4[3]; ( temp void) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'OutputStream' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:? Linker Objects +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) + + +Linked geometry stage: + + +Shader version: 500 +invocations = 1 +max_vertices = 3 +input primitive = triangles +output primitive = line_strip +0:? Sequence +0:12 Function Definition: @main(vf4[3];u1[3];struct-S-vf4-vf2-vf21;vf4[3]; ( temp void) +0:12 Function Parameters: +0:12 'pos' ( in 3-element array of 4-component vector of float) +0:12 'VertexID' ( in 3-element array of uint) +0:12 'OutputStream' ( out structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:12 'clip' ( in 3-element array of 4-component vector of float) +0:? Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:15 pos: direct index for structure ( temp 4-component vector of float) +0:15 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:15 Constant: +0:15 0 (const int) +0:15 direct index ( temp 4-component vector of float) +0:15 'pos' ( in 3-element array of 4-component vector of float) +0:15 Constant: +0:15 0 (const int) +0:16 move second child to first child ( temp 2-component vector of float) +0:16 clip0: direct index for structure ( temp 2-component vector of float) +0:16 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:16 Constant: +0:16 1 (const int) +0:16 vector swizzle ( temp 2-component vector of float) +0:16 direct index ( temp 4-component vector of float) +0:16 'clip' ( in 3-element array of 4-component vector of float) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:17 move second child to first child ( temp 2-component vector of float) +0:17 clip1: direct index for structure ( temp 2-component vector of float) +0:17 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:17 Constant: +0:17 2 (const int) +0:17 vector swizzle ( temp 2-component vector of float) +0:17 direct index ( temp 4-component vector of float) +0:17 'clip' ( in 3-element array of 4-component vector of float) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 3 (const int) +0:19 Sequence +0:19 Sequence +0:19 move second child to first child ( temp 4-component vector of float) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) +0:19 pos: direct index for structure ( temp 4-component vector of float) +0:19 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:19 Constant: +0:19 0 (const int) +0:? Sequence +0:19 move second child to first child ( temp float) +0:19 direct index ( out float ClipDistance) +0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) +0:19 Constant: +0:19 0 (const int) +0:19 direct index ( temp float) +0:19 clip0: direct index for structure ( temp 2-component vector of float) +0:19 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 0 (const int) +0:19 move second child to first child ( temp float) +0:19 direct index ( out float ClipDistance) +0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) +0:19 Constant: +0:19 1 (const int) +0:19 direct index ( temp float) +0:19 clip0: direct index for structure ( temp 2-component vector of float) +0:19 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 1 (const int) +0:? Sequence +0:19 move second child to first child ( temp float) +0:19 direct index ( out float ClipDistance) +0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) +0:19 Constant: +0:19 2 (const int) +0:19 direct index ( temp float) +0:19 clip1: direct index for structure ( temp 2-component vector of float) +0:19 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 0 (const int) +0:19 move second child to first child ( temp float) +0:19 direct index ( out float ClipDistance) +0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) +0:19 Constant: +0:19 3 (const int) +0:19 direct index ( temp float) +0:19 clip1: direct index for structure ( temp 2-component vector of float) +0:19 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 EmitVertex ( temp void) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:12 move second child to first child ( temp 3-element array of uint) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? Sequence +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 2 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 2 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 3 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 3 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 2 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 2 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 3 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 3 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 2 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 2 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 direct index ( temp 4-component vector of float) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 3 (const int) +0:12 direct index ( in float ClipDistance) +0:12 direct index ( in 4-element array of float ClipDistance) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 3 (const int) +0:12 Function Call: @main(vf4[3];u1[3];struct-S-vf4-vf2-vf21;vf4[3]; ( temp void) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'OutputStream' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:? 'clip' ( temp 3-element array of 4-component vector of float) +0:? Linker Objects +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) +0:? 'clip' ( in 3-element array of 4-element array of float ClipDistance) +0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 127 + + Capability Geometry + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 43 49 69 73 78 + ExecutionMode 4 Triangles + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputLineStrip + ExecutionMode 4 OutputVertices 3 + Source HLSL 500 + Name 4 "main" + Name 15 "S" + MemberName 15(S) 0 "pos" + MemberName 15(S) 1 "clip0" + MemberName 15(S) 2 "clip1" + Name 22 "@main(vf4[3];u1[3];struct-S-vf4-vf2-vf21;vf4[3];" + Name 18 "pos" + Name 19 "VertexID" + Name 20 "OutputStream" + Name 21 "clip" + Name 24 "s" + Name 43 "OutputStream.pos" + Name 49 "OutputStream.clip1" + Name 67 "pos" + Name 69 "pos" + Name 71 "VertexID" + Name 73 "VertexID" + Name 75 "clip" + Name 78 "clip" + Name 117 "OutputStream" + Name 118 "param" + Name 120 "param" + Name 122 "param" + Name 123 "param" + Decorate 43(OutputStream.pos) BuiltIn Position + Decorate 49(OutputStream.clip1) BuiltIn ClipDistance + Decorate 69(pos) BuiltIn Position + Decorate 73(VertexID) Location 0 + Decorate 78(clip) BuiltIn ClipDistance + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 0 + 9: 8(int) Constant 3 + 10: TypeArray 7(fvec4) 9 + 11: TypePointer Function 10 + 12: TypeArray 8(int) 9 + 13: TypePointer Function 12 + 14: TypeVector 6(float) 2 + 15(S): TypeStruct 7(fvec4) 14(fvec2) 14(fvec2) + 16: TypePointer Function 15(S) + 17: TypeFunction 2 11(ptr) 13(ptr) 16(ptr) 11(ptr) + 25: TypeInt 32 1 + 26: 25(int) Constant 0 + 27: TypePointer Function 7(fvec4) + 31: 25(int) Constant 1 + 35: TypePointer Function 14(fvec2) + 37: 25(int) Constant 2 + 42: TypePointer Output 7(fvec4) +43(OutputStream.pos): 42(ptr) Variable Output + 46: 8(int) Constant 4 + 47: TypeArray 6(float) 46 + 48: TypePointer Output 47 +49(OutputStream.clip1): 48(ptr) Variable Output + 50: 8(int) Constant 0 + 51: TypePointer Function 6(float) + 54: TypePointer Output 6(float) + 56: 8(int) Constant 1 + 63: 25(int) Constant 3 + 68: TypePointer Input 10 + 69(pos): 68(ptr) Variable Input + 72: TypePointer Input 12 + 73(VertexID): 72(ptr) Variable Input + 76: TypeArray 47 9 + 77: TypePointer Input 76 + 78(clip): 77(ptr) Variable Input + 79: TypePointer Input 6(float) + 88: 8(int) Constant 2 + 4(main): 2 Function None 3 + 5: Label + 67(pos): 11(ptr) Variable Function + 71(VertexID): 13(ptr) Variable Function + 75(clip): 11(ptr) Variable Function +117(OutputStream): 16(ptr) Variable Function + 118(param): 11(ptr) Variable Function + 120(param): 13(ptr) Variable Function + 122(param): 16(ptr) Variable Function + 123(param): 11(ptr) Variable Function + 70: 10 Load 69(pos) + Store 67(pos) 70 + 74: 12 Load 73(VertexID) + Store 71(VertexID) 74 + 80: 79(ptr) AccessChain 78(clip) 26 26 + 81: 6(float) Load 80 + 82: 51(ptr) AccessChain 75(clip) 26 50 + Store 82 81 + 83: 79(ptr) AccessChain 78(clip) 26 31 + 84: 6(float) Load 83 + 85: 51(ptr) AccessChain 75(clip) 26 56 + Store 85 84 + 86: 79(ptr) AccessChain 78(clip) 26 37 + 87: 6(float) Load 86 + 89: 51(ptr) AccessChain 75(clip) 26 88 + Store 89 87 + 90: 79(ptr) AccessChain 78(clip) 26 63 + 91: 6(float) Load 90 + 92: 51(ptr) AccessChain 75(clip) 26 9 + Store 92 91 + 93: 79(ptr) AccessChain 78(clip) 31 26 + 94: 6(float) Load 93 + 95: 51(ptr) AccessChain 75(clip) 31 50 + Store 95 94 + 96: 79(ptr) AccessChain 78(clip) 31 31 + 97: 6(float) Load 96 + 98: 51(ptr) AccessChain 75(clip) 31 56 + Store 98 97 + 99: 79(ptr) AccessChain 78(clip) 31 37 + 100: 6(float) Load 99 + 101: 51(ptr) AccessChain 75(clip) 31 88 + Store 101 100 + 102: 79(ptr) AccessChain 78(clip) 31 63 + 103: 6(float) Load 102 + 104: 51(ptr) AccessChain 75(clip) 31 9 + Store 104 103 + 105: 79(ptr) AccessChain 78(clip) 37 26 + 106: 6(float) Load 105 + 107: 51(ptr) AccessChain 75(clip) 37 50 + Store 107 106 + 108: 79(ptr) AccessChain 78(clip) 37 31 + 109: 6(float) Load 108 + 110: 51(ptr) AccessChain 75(clip) 37 56 + Store 110 109 + 111: 79(ptr) AccessChain 78(clip) 37 37 + 112: 6(float) Load 111 + 113: 51(ptr) AccessChain 75(clip) 37 88 + Store 113 112 + 114: 79(ptr) AccessChain 78(clip) 37 63 + 115: 6(float) Load 114 + 116: 51(ptr) AccessChain 75(clip) 37 9 + Store 116 115 + 119: 10 Load 67(pos) + Store 118(param) 119 + 121: 12 Load 71(VertexID) + Store 120(param) 121 + 124: 10 Load 75(clip) + Store 123(param) 124 + 125: 2 FunctionCall 22(@main(vf4[3];u1[3];struct-S-vf4-vf2-vf21;vf4[3];) 118(param) 120(param) 122(param) 123(param) + 126: 15(S) Load 122(param) + Store 117(OutputStream) 126 + Return + FunctionEnd +22(@main(vf4[3];u1[3];struct-S-vf4-vf2-vf21;vf4[3];): 2 Function None 17 + 18(pos): 11(ptr) FunctionParameter + 19(VertexID): 13(ptr) FunctionParameter +20(OutputStream): 16(ptr) FunctionParameter + 21(clip): 11(ptr) FunctionParameter + 23: Label + 24(s): 16(ptr) Variable Function + 28: 27(ptr) AccessChain 18(pos) 26 + 29: 7(fvec4) Load 28 + 30: 27(ptr) AccessChain 24(s) 26 + Store 30 29 + 32: 27(ptr) AccessChain 21(clip) 26 + 33: 7(fvec4) Load 32 + 34: 14(fvec2) VectorShuffle 33 33 0 1 + 36: 35(ptr) AccessChain 24(s) 31 + Store 36 34 + 38: 27(ptr) AccessChain 21(clip) 26 + 39: 7(fvec4) Load 38 + 40: 14(fvec2) VectorShuffle 39 39 2 3 + 41: 35(ptr) AccessChain 24(s) 37 + Store 41 40 + 44: 27(ptr) AccessChain 24(s) 26 + 45: 7(fvec4) Load 44 + Store 43(OutputStream.pos) 45 + 52: 51(ptr) AccessChain 24(s) 31 50 + 53: 6(float) Load 52 + 55: 54(ptr) AccessChain 49(OutputStream.clip1) 26 + Store 55 53 + 57: 51(ptr) AccessChain 24(s) 31 56 + 58: 6(float) Load 57 + 59: 54(ptr) AccessChain 49(OutputStream.clip1) 31 + Store 59 58 + 60: 51(ptr) AccessChain 24(s) 37 50 + 61: 6(float) Load 60 + 62: 54(ptr) AccessChain 49(OutputStream.clip1) 37 + Store 62 61 + 64: 51(ptr) AccessChain 24(s) 37 56 + 65: 6(float) Load 64 + 66: 54(ptr) AccessChain 49(OutputStream.clip1) 63 + Store 66 65 + EmitVertex + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-3.vert.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-3.vert.out new file mode 100644 index 00000000..01afd179 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-3.vert.out @@ -0,0 +1,229 @@ +hlsl.clipdistance-3.vert +Shader version: 500 +0:? Sequence +0:4 Function Definition: @main(vf4;f1[2];f1[2]; ( temp void) +0:4 Function Parameters: +0:4 'pos' ( out 4-component vector of float) +0:4 'clip' ( out 2-element array of float) +0:4 'cull' ( out 2-element array of float) +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:5 'pos' ( out 4-component vector of float) +0:5 Constant: +0:5 1.000000 +0:5 1.000000 +0:5 1.000000 +0:5 1.000000 +0:6 move second child to first child ( temp float) +0:6 direct index ( temp float) +0:6 'clip' ( out 2-element array of float) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0.500000 +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 'clip' ( out 2-element array of float) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0.600000 +0:9 move second child to first child ( temp float) +0:9 direct index ( temp float) +0:9 'cull' ( out 2-element array of float) +0:9 Constant: +0:9 0 (const int) +0:9 Constant: +0:9 0.525000 +0:10 move second child to first child ( temp float) +0:10 direct index ( temp float) +0:10 'cull' ( out 2-element array of float) +0:10 Constant: +0:10 1 (const int) +0:10 Constant: +0:10 0.625000 +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 Function Call: @main(vf4;f1[2];f1[2]; ( temp void) +0:? 'pos' ( temp 4-component vector of float) +0:? 'clip' ( temp 2-element array of float) +0:? 'cull' ( temp 2-element array of float) +0:4 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( out 4-component vector of float Position) +0:? 'pos' ( temp 4-component vector of float) +0:? Sequence +0:4 move second child to first child ( temp 2-element array of float) +0:? 'clip' ( out 2-element array of float ClipDistance) +0:? 'clip' ( temp 2-element array of float) +0:? Sequence +0:4 move second child to first child ( temp 2-element array of float) +0:? 'cull' ( out 2-element array of float CullDistance) +0:? 'cull' ( temp 2-element array of float) +0:? Linker Objects +0:? 'pos' ( out 4-component vector of float Position) +0:? 'clip' ( out 2-element array of float ClipDistance) +0:? 'cull' ( out 2-element array of float CullDistance) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:4 Function Definition: @main(vf4;f1[2];f1[2]; ( temp void) +0:4 Function Parameters: +0:4 'pos' ( out 4-component vector of float) +0:4 'clip' ( out 2-element array of float) +0:4 'cull' ( out 2-element array of float) +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:5 'pos' ( out 4-component vector of float) +0:5 Constant: +0:5 1.000000 +0:5 1.000000 +0:5 1.000000 +0:5 1.000000 +0:6 move second child to first child ( temp float) +0:6 direct index ( temp float) +0:6 'clip' ( out 2-element array of float) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0.500000 +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 'clip' ( out 2-element array of float) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0.600000 +0:9 move second child to first child ( temp float) +0:9 direct index ( temp float) +0:9 'cull' ( out 2-element array of float) +0:9 Constant: +0:9 0 (const int) +0:9 Constant: +0:9 0.525000 +0:10 move second child to first child ( temp float) +0:10 direct index ( temp float) +0:10 'cull' ( out 2-element array of float) +0:10 Constant: +0:10 1 (const int) +0:10 Constant: +0:10 0.625000 +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 Function Call: @main(vf4;f1[2];f1[2]; ( temp void) +0:? 'pos' ( temp 4-component vector of float) +0:? 'clip' ( temp 2-element array of float) +0:? 'cull' ( temp 2-element array of float) +0:4 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( out 4-component vector of float Position) +0:? 'pos' ( temp 4-component vector of float) +0:? Sequence +0:4 move second child to first child ( temp 2-element array of float) +0:? 'clip' ( out 2-element array of float ClipDistance) +0:? 'clip' ( temp 2-element array of float) +0:? Sequence +0:4 move second child to first child ( temp 2-element array of float) +0:? 'cull' ( out 2-element array of float CullDistance) +0:? 'cull' ( temp 2-element array of float) +0:? Linker Objects +0:? 'pos' ( out 4-component vector of float Position) +0:? 'clip' ( out 2-element array of float ClipDistance) +0:? 'cull' ( out 2-element array of float CullDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 51 + + Capability Shader + Capability ClipDistance + Capability CullDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 44 47 49 + Source HLSL 500 + Name 4 "main" + Name 17 "@main(vf4;f1[2];f1[2];" + Name 14 "pos" + Name 15 "clip" + Name 16 "cull" + Name 33 "pos" + Name 34 "clip" + Name 35 "cull" + Name 36 "param" + Name 37 "param" + Name 38 "param" + Name 44 "pos" + Name 47 "clip" + Name 49 "cull" + Decorate 44(pos) BuiltIn Position + Decorate 47(clip) BuiltIn ClipDistance + Decorate 49(cull) BuiltIn CullDistance + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeInt 32 0 + 10: 9(int) Constant 2 + 11: TypeArray 6(float) 10 + 12: TypePointer Function 11 + 13: TypeFunction 2 8(ptr) 12(ptr) 12(ptr) + 19: 6(float) Constant 1065353216 + 20: 7(fvec4) ConstantComposite 19 19 19 19 + 21: TypeInt 32 1 + 22: 21(int) Constant 0 + 23: 6(float) Constant 1056964608 + 24: TypePointer Function 6(float) + 26: 21(int) Constant 1 + 27: 6(float) Constant 1058642330 + 29: 6(float) Constant 1057384038 + 31: 6(float) Constant 1059061760 + 43: TypePointer Output 7(fvec4) + 44(pos): 43(ptr) Variable Output + 46: TypePointer Output 11 + 47(clip): 46(ptr) Variable Output + 49(cull): 46(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 33(pos): 8(ptr) Variable Function + 34(clip): 12(ptr) Variable Function + 35(cull): 12(ptr) Variable Function + 36(param): 8(ptr) Variable Function + 37(param): 12(ptr) Variable Function + 38(param): 12(ptr) Variable Function + 39: 2 FunctionCall 17(@main(vf4;f1[2];f1[2];) 36(param) 37(param) 38(param) + 40: 7(fvec4) Load 36(param) + Store 33(pos) 40 + 41: 11 Load 37(param) + Store 34(clip) 41 + 42: 11 Load 38(param) + Store 35(cull) 42 + 45: 7(fvec4) Load 33(pos) + Store 44(pos) 45 + 48: 11 Load 34(clip) + Store 47(clip) 48 + 50: 11 Load 35(cull) + Store 49(cull) 50 + Return + FunctionEnd +17(@main(vf4;f1[2];f1[2];): 2 Function None 13 + 14(pos): 8(ptr) FunctionParameter + 15(clip): 12(ptr) FunctionParameter + 16(cull): 12(ptr) FunctionParameter + 18: Label + Store 14(pos) 20 + 25: 24(ptr) AccessChain 15(clip) 22 + Store 25 23 + 28: 24(ptr) AccessChain 15(clip) 26 + Store 28 27 + 30: 24(ptr) AccessChain 16(cull) 22 + Store 30 29 + 32: 24(ptr) AccessChain 16(cull) 26 + Store 32 31 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-4.frag.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-4.frag.out new file mode 100644 index 00000000..95f81c95 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-4.frag.out @@ -0,0 +1,262 @@ +hlsl.clipdistance-4.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main(struct-VS_OUTPUT-vf4-vf41; ( temp 4-component vector of float) +0:7 Function Parameters: +0:7 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:? Sequence +0:8 Branch: Return with expression +0:8 add ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:8 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:8 Constant: +0:8 0 (const int) +0:8 ClipRect: direct index for structure ( temp 4-component vector of float) +0:8 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:8 Constant: +0:8 1 (const int) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:7 Constant: +0:7 0 (const int) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 ClipRect: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 direct index ( in float ClipDistance) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 0 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 ClipRect: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 direct index ( in float ClipDistance) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 1 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 ClipRect: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 2 (const int) +0:7 direct index ( in float ClipDistance) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 2 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 ClipRect: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 3 (const int) +0:7 direct index ( in float ClipDistance) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 3 (const int) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main(struct-VS_OUTPUT-vf4-vf41; ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main(struct-VS_OUTPUT-vf4-vf41; ( temp 4-component vector of float) +0:7 Function Parameters: +0:7 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:? Sequence +0:8 Branch: Return with expression +0:8 add ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:8 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:8 Constant: +0:8 0 (const int) +0:8 ClipRect: direct index for structure ( temp 4-component vector of float) +0:8 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:8 Constant: +0:8 1 (const int) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:7 Constant: +0:7 0 (const int) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 ClipRect: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 direct index ( in float ClipDistance) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 0 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 ClipRect: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 direct index ( in float ClipDistance) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 1 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 ClipRect: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 2 (const int) +0:7 direct index ( in float ClipDistance) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 2 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 ClipRect: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 3 (const int) +0:7 direct index ( in float ClipDistance) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 3 (const int) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main(struct-VS_OUTPUT-vf4-vf41; ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 57 + + Capability Shader + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 24 32 54 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "VS_OUTPUT" + MemberName 8(VS_OUTPUT) 0 "Position" + MemberName 8(VS_OUTPUT) 1 "ClipRect" + Name 11 "@main(struct-VS_OUTPUT-vf4-vf41;" + Name 10 "v" + Name 22 "v" + Name 24 "v.Position" + Name 32 "v.ClipRect" + Name 54 "@entryPointOutput" + Decorate 24(v.Position) BuiltIn FragCoord + Decorate 32(v.ClipRect) BuiltIn ClipDistance + Decorate 54(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(VS_OUTPUT): TypeStruct 7(fvec4) 7(fvec4) + 9: TypeFunction 7(fvec4) 8(VS_OUTPUT) + 13: TypeInt 32 1 + 14: 13(int) Constant 0 + 16: 13(int) Constant 1 + 21: TypePointer Function 8(VS_OUTPUT) + 23: TypePointer Input 7(fvec4) + 24(v.Position): 23(ptr) Variable Input + 26: TypePointer Function 7(fvec4) + 28: TypeInt 32 0 + 29: 28(int) Constant 4 + 30: TypeArray 6(float) 29 + 31: TypePointer Input 30 + 32(v.ClipRect): 31(ptr) Variable Input + 33: TypePointer Input 6(float) + 36: 28(int) Constant 0 + 37: TypePointer Function 6(float) + 41: 28(int) Constant 1 + 43: 13(int) Constant 2 + 46: 28(int) Constant 2 + 48: 13(int) Constant 3 + 51: 28(int) Constant 3 + 53: TypePointer Output 7(fvec4) +54(@entryPointOutput): 53(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 22(v): 21(ptr) Variable Function + 25: 7(fvec4) Load 24(v.Position) + 27: 26(ptr) AccessChain 22(v) 14 + Store 27 25 + 34: 33(ptr) AccessChain 32(v.ClipRect) 14 + 35: 6(float) Load 34 + 38: 37(ptr) AccessChain 22(v) 16 36 + Store 38 35 + 39: 33(ptr) AccessChain 32(v.ClipRect) 16 + 40: 6(float) Load 39 + 42: 37(ptr) AccessChain 22(v) 16 41 + Store 42 40 + 44: 33(ptr) AccessChain 32(v.ClipRect) 43 + 45: 6(float) Load 44 + 47: 37(ptr) AccessChain 22(v) 16 46 + Store 47 45 + 49: 33(ptr) AccessChain 32(v.ClipRect) 48 + 50: 6(float) Load 49 + 52: 37(ptr) AccessChain 22(v) 16 51 + Store 52 50 + 55:8(VS_OUTPUT) Load 22(v) + 56: 7(fvec4) FunctionCall 11(@main(struct-VS_OUTPUT-vf4-vf41;) 55 + Store 54(@entryPointOutput) 56 + Return + FunctionEnd +11(@main(struct-VS_OUTPUT-vf4-vf41;): 7(fvec4) Function None 9 + 10(v):8(VS_OUTPUT) FunctionParameter + 12: Label + 15: 7(fvec4) CompositeExtract 10(v) 0 + 17: 7(fvec4) CompositeExtract 10(v) 1 + 18: 7(fvec4) FAdd 15 17 + ReturnValue 18 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-4.geom.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-4.geom.out new file mode 100644 index 00000000..1096e02c --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-4.geom.out @@ -0,0 +1,819 @@ +hlsl.clipdistance-4.geom +Shader version: 500 +invocations = -1 +max_vertices = 3 +input primitive = triangles +output primitive = line_strip +0:? Sequence +0:13 Function Definition: @main(vf4[3];u1[3];struct-S-vf4-vf2-vf21;vf2[3];vf2[3]; ( temp void) +0:13 Function Parameters: +0:13 'pos' ( in 3-element array of 4-component vector of float) +0:13 'VertexID' ( in 3-element array of uint) +0:13 'OutputStream' ( out structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:13 'clip0' ( in 3-element array of 2-component vector of float) +0:13 'clip1' ( in 3-element array of 2-component vector of float) +0:? Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:16 pos: direct index for structure ( temp 4-component vector of float) +0:16 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:16 Constant: +0:16 0 (const int) +0:16 direct index ( temp 4-component vector of float) +0:16 'pos' ( in 3-element array of 4-component vector of float) +0:16 Constant: +0:16 0 (const int) +0:17 move second child to first child ( temp 2-component vector of float) +0:17 clip0: direct index for structure ( temp 2-component vector of float) +0:17 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:17 Constant: +0:17 1 (const int) +0:17 direct index ( temp 2-component vector of float) +0:17 'clip0' ( in 3-element array of 2-component vector of float) +0:17 Constant: +0:17 0 (const int) +0:18 move second child to first child ( temp 2-component vector of float) +0:18 clip1: direct index for structure ( temp 2-component vector of float) +0:18 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:18 Constant: +0:18 2 (const int) +0:18 direct index ( temp 2-component vector of float) +0:18 'clip1' ( in 3-element array of 2-component vector of float) +0:18 Constant: +0:18 0 (const int) +0:20 Sequence +0:20 Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) +0:20 pos: direct index for structure ( temp 4-component vector of float) +0:20 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:20 Constant: +0:20 0 (const int) +0:? Sequence +0:20 move second child to first child ( temp float) +0:20 direct index ( out float ClipDistance) +0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) +0:20 Constant: +0:20 0 (const int) +0:20 direct index ( temp float) +0:20 clip0: direct index for structure ( temp 2-component vector of float) +0:20 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 move second child to first child ( temp float) +0:20 direct index ( out float ClipDistance) +0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) +0:20 Constant: +0:20 1 (const int) +0:20 direct index ( temp float) +0:20 clip0: direct index for structure ( temp 2-component vector of float) +0:20 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 1 (const int) +0:? Sequence +0:20 move second child to first child ( temp float) +0:20 direct index ( out float ClipDistance) +0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) +0:20 Constant: +0:20 2 (const int) +0:20 direct index ( temp float) +0:20 clip1: direct index for structure ( temp 2-component vector of float) +0:20 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:20 Constant: +0:20 2 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 move second child to first child ( temp float) +0:20 direct index ( out float ClipDistance) +0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) +0:20 Constant: +0:20 3 (const int) +0:20 direct index ( temp float) +0:20 clip1: direct index for structure ( temp 2-component vector of float) +0:20 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:20 Constant: +0:20 2 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 EmitVertex ( temp void) +0:13 Function Definition: main( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:13 move second child to first child ( temp 3-element array of uint) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? Sequence +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip0' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip0' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip0' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 2 (const int) +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip0' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 3 (const int) +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip0' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 2 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip0' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 2 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 1 (const int) +0:? Sequence +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip1' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 2 (const int) +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip1' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 3 (const int) +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip1' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 2 (const int) +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip1' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 3 (const int) +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip1' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 2 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 2 (const int) +0:13 Constant: +0:13 2 (const int) +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip1' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 2 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 2 (const int) +0:13 Constant: +0:13 3 (const int) +0:13 Function Call: @main(vf4[3];u1[3];struct-S-vf4-vf2-vf21;vf2[3];vf2[3]; ( temp void) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'OutputStream' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:? 'clip0' ( temp 3-element array of 2-component vector of float) +0:? 'clip1' ( temp 3-element array of 2-component vector of float) +0:? Linker Objects +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) + + +Linked geometry stage: + + +Shader version: 500 +invocations = 1 +max_vertices = 3 +input primitive = triangles +output primitive = line_strip +0:? Sequence +0:13 Function Definition: @main(vf4[3];u1[3];struct-S-vf4-vf2-vf21;vf2[3];vf2[3]; ( temp void) +0:13 Function Parameters: +0:13 'pos' ( in 3-element array of 4-component vector of float) +0:13 'VertexID' ( in 3-element array of uint) +0:13 'OutputStream' ( out structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:13 'clip0' ( in 3-element array of 2-component vector of float) +0:13 'clip1' ( in 3-element array of 2-component vector of float) +0:? Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:16 pos: direct index for structure ( temp 4-component vector of float) +0:16 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:16 Constant: +0:16 0 (const int) +0:16 direct index ( temp 4-component vector of float) +0:16 'pos' ( in 3-element array of 4-component vector of float) +0:16 Constant: +0:16 0 (const int) +0:17 move second child to first child ( temp 2-component vector of float) +0:17 clip0: direct index for structure ( temp 2-component vector of float) +0:17 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:17 Constant: +0:17 1 (const int) +0:17 direct index ( temp 2-component vector of float) +0:17 'clip0' ( in 3-element array of 2-component vector of float) +0:17 Constant: +0:17 0 (const int) +0:18 move second child to first child ( temp 2-component vector of float) +0:18 clip1: direct index for structure ( temp 2-component vector of float) +0:18 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:18 Constant: +0:18 2 (const int) +0:18 direct index ( temp 2-component vector of float) +0:18 'clip1' ( in 3-element array of 2-component vector of float) +0:18 Constant: +0:18 0 (const int) +0:20 Sequence +0:20 Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) +0:20 pos: direct index for structure ( temp 4-component vector of float) +0:20 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:20 Constant: +0:20 0 (const int) +0:? Sequence +0:20 move second child to first child ( temp float) +0:20 direct index ( out float ClipDistance) +0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) +0:20 Constant: +0:20 0 (const int) +0:20 direct index ( temp float) +0:20 clip0: direct index for structure ( temp 2-component vector of float) +0:20 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 move second child to first child ( temp float) +0:20 direct index ( out float ClipDistance) +0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) +0:20 Constant: +0:20 1 (const int) +0:20 direct index ( temp float) +0:20 clip0: direct index for structure ( temp 2-component vector of float) +0:20 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 1 (const int) +0:? Sequence +0:20 move second child to first child ( temp float) +0:20 direct index ( out float ClipDistance) +0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) +0:20 Constant: +0:20 2 (const int) +0:20 direct index ( temp float) +0:20 clip1: direct index for structure ( temp 2-component vector of float) +0:20 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:20 Constant: +0:20 2 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 move second child to first child ( temp float) +0:20 direct index ( out float ClipDistance) +0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) +0:20 Constant: +0:20 3 (const int) +0:20 direct index ( temp float) +0:20 clip1: direct index for structure ( temp 2-component vector of float) +0:20 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:20 Constant: +0:20 2 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 EmitVertex ( temp void) +0:13 Function Definition: main( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:13 move second child to first child ( temp 3-element array of uint) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? Sequence +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip0' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip0' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip0' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 2 (const int) +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip0' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 3 (const int) +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip0' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 2 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip0' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 2 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 1 (const int) +0:? Sequence +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip1' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 2 (const int) +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip1' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 3 (const int) +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip1' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 2 (const int) +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip1' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 3 (const int) +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip1' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 2 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 2 (const int) +0:13 Constant: +0:13 2 (const int) +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 direct index ( temp 2-component vector of float) +0:? 'clip1' ( temp 3-element array of 2-component vector of float) +0:13 Constant: +0:13 2 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 direct index ( in float ClipDistance) +0:13 direct index ( in 4-element array of float ClipDistance) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:13 Constant: +0:13 2 (const int) +0:13 Constant: +0:13 3 (const int) +0:13 Function Call: @main(vf4[3];u1[3];struct-S-vf4-vf2-vf21;vf2[3];vf2[3]; ( temp void) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'OutputStream' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float clip0, temp 2-component vector of float clip1}) +0:? 'clip0' ( temp 3-element array of 2-component vector of float) +0:? 'clip1' ( temp 3-element array of 2-component vector of float) +0:? Linker Objects +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) +0:? 'clip0' ( in 3-element array of 4-element array of float ClipDistance) +0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 130 + + Capability Geometry + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 44 50 70 74 79 + ExecutionMode 4 Triangles + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputLineStrip + ExecutionMode 4 OutputVertices 3 + Source HLSL 500 + Name 4 "main" + Name 15 "S" + MemberName 15(S) 0 "pos" + MemberName 15(S) 1 "clip0" + MemberName 15(S) 2 "clip1" + Name 25 "@main(vf4[3];u1[3];struct-S-vf4-vf2-vf21;vf2[3];vf2[3];" + Name 20 "pos" + Name 21 "VertexID" + Name 22 "OutputStream" + Name 23 "clip0" + Name 24 "clip1" + Name 27 "s" + Name 44 "OutputStream.pos" + Name 50 "OutputStream.clip1" + Name 68 "pos" + Name 70 "pos" + Name 72 "VertexID" + Name 74 "VertexID" + Name 76 "clip0" + Name 79 "clip0" + Name 99 "clip1" + Name 118 "OutputStream" + Name 119 "param" + Name 121 "param" + Name 123 "param" + Name 124 "param" + Name 126 "param" + Decorate 44(OutputStream.pos) BuiltIn Position + Decorate 50(OutputStream.clip1) BuiltIn ClipDistance + Decorate 70(pos) BuiltIn Position + Decorate 74(VertexID) Location 0 + Decorate 79(clip0) BuiltIn ClipDistance + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 0 + 9: 8(int) Constant 3 + 10: TypeArray 7(fvec4) 9 + 11: TypePointer Function 10 + 12: TypeArray 8(int) 9 + 13: TypePointer Function 12 + 14: TypeVector 6(float) 2 + 15(S): TypeStruct 7(fvec4) 14(fvec2) 14(fvec2) + 16: TypePointer Function 15(S) + 17: TypeArray 14(fvec2) 9 + 18: TypePointer Function 17 + 19: TypeFunction 2 11(ptr) 13(ptr) 16(ptr) 18(ptr) 18(ptr) + 28: TypeInt 32 1 + 29: 28(int) Constant 0 + 30: TypePointer Function 7(fvec4) + 34: 28(int) Constant 1 + 35: TypePointer Function 14(fvec2) + 39: 28(int) Constant 2 + 43: TypePointer Output 7(fvec4) +44(OutputStream.pos): 43(ptr) Variable Output + 47: 8(int) Constant 4 + 48: TypeArray 6(float) 47 + 49: TypePointer Output 48 +50(OutputStream.clip1): 49(ptr) Variable Output + 51: 8(int) Constant 0 + 52: TypePointer Function 6(float) + 55: TypePointer Output 6(float) + 57: 8(int) Constant 1 + 64: 28(int) Constant 3 + 69: TypePointer Input 10 + 70(pos): 69(ptr) Variable Input + 73: TypePointer Input 12 + 74(VertexID): 73(ptr) Variable Input + 77: TypeArray 48 9 + 78: TypePointer Input 77 + 79(clip0): 78(ptr) Variable Input + 80: TypePointer Input 6(float) + 4(main): 2 Function None 3 + 5: Label + 68(pos): 11(ptr) Variable Function + 72(VertexID): 13(ptr) Variable Function + 76(clip0): 18(ptr) Variable Function + 99(clip1): 18(ptr) Variable Function +118(OutputStream): 16(ptr) Variable Function + 119(param): 11(ptr) Variable Function + 121(param): 13(ptr) Variable Function + 123(param): 16(ptr) Variable Function + 124(param): 18(ptr) Variable Function + 126(param): 18(ptr) Variable Function + 71: 10 Load 70(pos) + Store 68(pos) 71 + 75: 12 Load 74(VertexID) + Store 72(VertexID) 75 + 81: 80(ptr) AccessChain 79(clip0) 29 29 + 82: 6(float) Load 81 + 83: 52(ptr) AccessChain 76(clip0) 29 51 + Store 83 82 + 84: 80(ptr) AccessChain 79(clip0) 29 34 + 85: 6(float) Load 84 + 86: 52(ptr) AccessChain 76(clip0) 29 57 + Store 86 85 + 87: 80(ptr) AccessChain 79(clip0) 29 39 + 88: 6(float) Load 87 + 89: 52(ptr) AccessChain 76(clip0) 34 51 + Store 89 88 + 90: 80(ptr) AccessChain 79(clip0) 29 64 + 91: 6(float) Load 90 + 92: 52(ptr) AccessChain 76(clip0) 34 57 + Store 92 91 + 93: 80(ptr) AccessChain 79(clip0) 34 29 + 94: 6(float) Load 93 + 95: 52(ptr) AccessChain 76(clip0) 39 51 + Store 95 94 + 96: 80(ptr) AccessChain 79(clip0) 34 34 + 97: 6(float) Load 96 + 98: 52(ptr) AccessChain 76(clip0) 39 57 + Store 98 97 + 100: 80(ptr) AccessChain 79(clip0) 29 39 + 101: 6(float) Load 100 + 102: 52(ptr) AccessChain 99(clip1) 29 51 + Store 102 101 + 103: 80(ptr) AccessChain 79(clip0) 29 64 + 104: 6(float) Load 103 + 105: 52(ptr) AccessChain 99(clip1) 29 57 + Store 105 104 + 106: 80(ptr) AccessChain 79(clip0) 34 39 + 107: 6(float) Load 106 + 108: 52(ptr) AccessChain 99(clip1) 34 51 + Store 108 107 + 109: 80(ptr) AccessChain 79(clip0) 34 64 + 110: 6(float) Load 109 + 111: 52(ptr) AccessChain 99(clip1) 34 57 + Store 111 110 + 112: 80(ptr) AccessChain 79(clip0) 39 39 + 113: 6(float) Load 112 + 114: 52(ptr) AccessChain 99(clip1) 39 51 + Store 114 113 + 115: 80(ptr) AccessChain 79(clip0) 39 64 + 116: 6(float) Load 115 + 117: 52(ptr) AccessChain 99(clip1) 39 57 + Store 117 116 + 120: 10 Load 68(pos) + Store 119(param) 120 + 122: 12 Load 72(VertexID) + Store 121(param) 122 + 125: 17 Load 76(clip0) + Store 124(param) 125 + 127: 17 Load 99(clip1) + Store 126(param) 127 + 128: 2 FunctionCall 25(@main(vf4[3];u1[3];struct-S-vf4-vf2-vf21;vf2[3];vf2[3];) 119(param) 121(param) 123(param) 124(param) 126(param) + 129: 15(S) Load 123(param) + Store 118(OutputStream) 129 + Return + FunctionEnd +25(@main(vf4[3];u1[3];struct-S-vf4-vf2-vf21;vf2[3];vf2[3];): 2 Function None 19 + 20(pos): 11(ptr) FunctionParameter + 21(VertexID): 13(ptr) FunctionParameter +22(OutputStream): 16(ptr) FunctionParameter + 23(clip0): 18(ptr) FunctionParameter + 24(clip1): 18(ptr) FunctionParameter + 26: Label + 27(s): 16(ptr) Variable Function + 31: 30(ptr) AccessChain 20(pos) 29 + 32: 7(fvec4) Load 31 + 33: 30(ptr) AccessChain 27(s) 29 + Store 33 32 + 36: 35(ptr) AccessChain 23(clip0) 29 + 37: 14(fvec2) Load 36 + 38: 35(ptr) AccessChain 27(s) 34 + Store 38 37 + 40: 35(ptr) AccessChain 24(clip1) 29 + 41: 14(fvec2) Load 40 + 42: 35(ptr) AccessChain 27(s) 39 + Store 42 41 + 45: 30(ptr) AccessChain 27(s) 29 + 46: 7(fvec4) Load 45 + Store 44(OutputStream.pos) 46 + 53: 52(ptr) AccessChain 27(s) 34 51 + 54: 6(float) Load 53 + 56: 55(ptr) AccessChain 50(OutputStream.clip1) 29 + Store 56 54 + 58: 52(ptr) AccessChain 27(s) 34 57 + 59: 6(float) Load 58 + 60: 55(ptr) AccessChain 50(OutputStream.clip1) 34 + Store 60 59 + 61: 52(ptr) AccessChain 27(s) 39 51 + 62: 6(float) Load 61 + 63: 55(ptr) AccessChain 50(OutputStream.clip1) 39 + Store 63 62 + 65: 52(ptr) AccessChain 27(s) 39 57 + 66: 6(float) Load 65 + 67: 55(ptr) AccessChain 50(OutputStream.clip1) 64 + Store 67 66 + EmitVertex + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-4.vert.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-4.vert.out new file mode 100644 index 00000000..d05fae41 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-4.vert.out @@ -0,0 +1,382 @@ +hlsl.clipdistance-4.vert +Shader version: 500 +0:? Sequence +0:11 Function Definition: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:11 Function Parameters: +0:11 'v' ( const (read only) structure{ temp 4-component vector of float Position}) +0:? Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 Position: direct index for structure ( temp 4-component vector of float) +0:13 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:15 move second child to first child ( temp float) +0:15 direct index ( temp float) +0:15 ClipRect: direct index for structure ( temp 4-component vector of float) +0:15 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:15 Constant: +0:15 1 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 1.000000 +0:16 move second child to first child ( temp float) +0:16 direct index ( temp float) +0:16 ClipRect: direct index for structure ( temp 4-component vector of float) +0:16 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 2.000000 +0:17 move second child to first child ( temp float) +0:17 direct index ( temp float) +0:17 ClipRect: direct index for structure ( temp 4-component vector of float) +0:17 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 3.000000 +0:18 move second child to first child ( temp float) +0:18 direct index ( temp float) +0:18 ClipRect: direct index for structure ( temp 4-component vector of float) +0:18 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 3 (const int) +0:18 Constant: +0:18 4.000000 +0:20 Branch: Return with expression +0:20 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:11 Function Definition: main( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:11 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position}) +0:11 Constant: +0:11 0 (const int) +0:? 'v.Position' (layout( location=0) in 4-component vector of float) +0:11 Sequence +0:11 move second child to first child ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:11 Function Call: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:? 'v' ( temp structure{ temp 4-component vector of float Position}) +0:11 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:11 Position: direct index for structure ( temp 4-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:11 Constant: +0:11 0 (const int) +0:? Sequence +0:11 move second child to first child ( temp float) +0:11 direct index ( out float ClipDistance) +0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( temp float) +0:11 ClipRect: direct index for structure ( temp 4-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( out float ClipDistance) +0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( temp float) +0:11 ClipRect: direct index for structure ( temp 4-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( out float ClipDistance) +0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) +0:11 Constant: +0:11 2 (const int) +0:11 direct index ( temp float) +0:11 ClipRect: direct index for structure ( temp 4-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( out float ClipDistance) +0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) +0:11 Constant: +0:11 3 (const int) +0:11 direct index ( temp float) +0:11 ClipRect: direct index for structure ( temp 4-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 3 (const int) +0:? Linker Objects +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:? 'v.Position' (layout( location=0) in 4-component vector of float) +0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:11 Function Definition: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:11 Function Parameters: +0:11 'v' ( const (read only) structure{ temp 4-component vector of float Position}) +0:? Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 Position: direct index for structure ( temp 4-component vector of float) +0:13 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:15 move second child to first child ( temp float) +0:15 direct index ( temp float) +0:15 ClipRect: direct index for structure ( temp 4-component vector of float) +0:15 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:15 Constant: +0:15 1 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 1.000000 +0:16 move second child to first child ( temp float) +0:16 direct index ( temp float) +0:16 ClipRect: direct index for structure ( temp 4-component vector of float) +0:16 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 2.000000 +0:17 move second child to first child ( temp float) +0:17 direct index ( temp float) +0:17 ClipRect: direct index for structure ( temp 4-component vector of float) +0:17 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 3.000000 +0:18 move second child to first child ( temp float) +0:18 direct index ( temp float) +0:18 ClipRect: direct index for structure ( temp 4-component vector of float) +0:18 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 3 (const int) +0:18 Constant: +0:18 4.000000 +0:20 Branch: Return with expression +0:20 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:11 Function Definition: main( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:11 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position}) +0:11 Constant: +0:11 0 (const int) +0:? 'v.Position' (layout( location=0) in 4-component vector of float) +0:11 Sequence +0:11 move second child to first child ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:11 Function Call: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:? 'v' ( temp structure{ temp 4-component vector of float Position}) +0:11 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:11 Position: direct index for structure ( temp 4-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:11 Constant: +0:11 0 (const int) +0:? Sequence +0:11 move second child to first child ( temp float) +0:11 direct index ( out float ClipDistance) +0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( temp float) +0:11 ClipRect: direct index for structure ( temp 4-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( out float ClipDistance) +0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( temp float) +0:11 ClipRect: direct index for structure ( temp 4-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( out float ClipDistance) +0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) +0:11 Constant: +0:11 2 (const int) +0:11 direct index ( temp float) +0:11 ClipRect: direct index for structure ( temp 4-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( out float ClipDistance) +0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) +0:11 Constant: +0:11 3 (const int) +0:11 direct index ( temp float) +0:11 ClipRect: direct index for structure ( temp 4-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 3 (const int) +0:? Linker Objects +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:? 'v.Position' (layout( location=0) in 4-component vector of float) +0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 72 + + Capability Shader + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 43 50 56 + Source HLSL 500 + Name 4 "main" + Name 8 "VS_INPUT" + MemberName 8(VS_INPUT) 0 "Position" + Name 9 "VS_OUTPUT" + MemberName 9(VS_OUTPUT) 0 "Position" + MemberName 9(VS_OUTPUT) 1 "ClipRect" + Name 12 "@main(struct-VS_INPUT-vf41;" + Name 11 "v" + Name 15 "Output" + Name 41 "v" + Name 43 "v.Position" + Name 46 "flattenTemp" + Name 50 "@entryPointOutput.Position" + Name 56 "@entryPointOutput.ClipRect" + Decorate 43(v.Position) Location 0 + Decorate 50(@entryPointOutput.Position) BuiltIn Position + Decorate 56(@entryPointOutput.ClipRect) BuiltIn ClipDistance + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(VS_INPUT): TypeStruct 7(fvec4) + 9(VS_OUTPUT): TypeStruct 7(fvec4) 7(fvec4) + 10: TypeFunction 9(VS_OUTPUT) 8(VS_INPUT) + 14: TypePointer Function 9(VS_OUTPUT) + 16: TypeInt 32 1 + 17: 16(int) Constant 0 + 18: 6(float) Constant 0 + 19: 7(fvec4) ConstantComposite 18 18 18 18 + 20: TypePointer Function 7(fvec4) + 22: 16(int) Constant 1 + 23: 6(float) Constant 1065353216 + 24: TypeInt 32 0 + 25: 24(int) Constant 0 + 26: TypePointer Function 6(float) + 28: 6(float) Constant 1073741824 + 29: 24(int) Constant 1 + 31: 6(float) Constant 1077936128 + 32: 24(int) Constant 2 + 34: 6(float) Constant 1082130432 + 35: 24(int) Constant 3 + 40: TypePointer Function 8(VS_INPUT) + 42: TypePointer Input 7(fvec4) + 43(v.Position): 42(ptr) Variable Input + 49: TypePointer Output 7(fvec4) +50(@entryPointOutput.Position): 49(ptr) Variable Output + 53: 24(int) Constant 4 + 54: TypeArray 6(float) 53 + 55: TypePointer Output 54 +56(@entryPointOutput.ClipRect): 55(ptr) Variable Output + 59: TypePointer Output 6(float) + 64: 16(int) Constant 2 + 68: 16(int) Constant 3 + 4(main): 2 Function None 3 + 5: Label + 41(v): 40(ptr) Variable Function + 46(flattenTemp): 14(ptr) Variable Function + 44: 7(fvec4) Load 43(v.Position) + 45: 20(ptr) AccessChain 41(v) 17 + Store 45 44 + 47: 8(VS_INPUT) Load 41(v) + 48:9(VS_OUTPUT) FunctionCall 12(@main(struct-VS_INPUT-vf41;) 47 + Store 46(flattenTemp) 48 + 51: 20(ptr) AccessChain 46(flattenTemp) 17 + 52: 7(fvec4) Load 51 + Store 50(@entryPointOutput.Position) 52 + 57: 26(ptr) AccessChain 46(flattenTemp) 22 25 + 58: 6(float) Load 57 + 60: 59(ptr) AccessChain 56(@entryPointOutput.ClipRect) 17 + Store 60 58 + 61: 26(ptr) AccessChain 46(flattenTemp) 22 29 + 62: 6(float) Load 61 + 63: 59(ptr) AccessChain 56(@entryPointOutput.ClipRect) 22 + Store 63 62 + 65: 26(ptr) AccessChain 46(flattenTemp) 22 32 + 66: 6(float) Load 65 + 67: 59(ptr) AccessChain 56(@entryPointOutput.ClipRect) 64 + Store 67 66 + 69: 26(ptr) AccessChain 46(flattenTemp) 22 35 + 70: 6(float) Load 69 + 71: 59(ptr) AccessChain 56(@entryPointOutput.ClipRect) 68 + Store 71 70 + Return + FunctionEnd +12(@main(struct-VS_INPUT-vf41;):9(VS_OUTPUT) Function None 10 + 11(v): 8(VS_INPUT) FunctionParameter + 13: Label + 15(Output): 14(ptr) Variable Function + 21: 20(ptr) AccessChain 15(Output) 17 + Store 21 19 + 27: 26(ptr) AccessChain 15(Output) 22 25 + Store 27 23 + 30: 26(ptr) AccessChain 15(Output) 22 29 + Store 30 28 + 33: 26(ptr) AccessChain 15(Output) 22 32 + Store 33 31 + 36: 26(ptr) AccessChain 15(Output) 22 35 + Store 36 34 + 37:9(VS_OUTPUT) Load 15(Output) + ReturnValue 37 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-5.frag.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-5.frag.out new file mode 100644 index 00000000..afdd4c4d --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-5.frag.out @@ -0,0 +1,325 @@ +hlsl.clipdistance-5.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main(struct-VS_OUTPUT-vf4-vf2[2]1; ( temp 4-component vector of float) +0:7 Function Parameters: +0:7 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:? Sequence +0:8 Branch: Return with expression +0:8 add ( temp 4-component vector of float) +0:8 add ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:8 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:8 direct index ( temp 2-component vector of float) +0:8 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:8 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:8 direct index ( temp 2-component vector of float) +0:8 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:8 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:7 Constant: +0:7 0 (const int) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 direct index ( temp 2-component vector of float) +0:7 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 direct index ( in float ClipDistance) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 0 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 direct index ( temp 2-component vector of float) +0:7 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 direct index ( in float ClipDistance) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 1 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 direct index ( temp 2-component vector of float) +0:7 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 direct index ( in float ClipDistance) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 2 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 direct index ( temp 2-component vector of float) +0:7 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 direct index ( in float ClipDistance) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 3 (const int) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main(struct-VS_OUTPUT-vf4-vf2[2]1; ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main(struct-VS_OUTPUT-vf4-vf2[2]1; ( temp 4-component vector of float) +0:7 Function Parameters: +0:7 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:? Sequence +0:8 Branch: Return with expression +0:8 add ( temp 4-component vector of float) +0:8 add ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:8 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:8 direct index ( temp 2-component vector of float) +0:8 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:8 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:8 direct index ( temp 2-component vector of float) +0:8 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:8 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:7 Constant: +0:7 0 (const int) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 direct index ( temp 2-component vector of float) +0:7 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 direct index ( in float ClipDistance) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 0 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 direct index ( temp 2-component vector of float) +0:7 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 direct index ( in float ClipDistance) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 1 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 direct index ( temp 2-component vector of float) +0:7 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 direct index ( in float ClipDistance) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 2 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 direct index ( temp 2-component vector of float) +0:7 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 direct index ( in float ClipDistance) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 3 (const int) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main(struct-VS_OUTPUT-vf4-vf2[2]1; ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 62 + + Capability Shader + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 33 40 59 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 12 "VS_OUTPUT" + MemberName 12(VS_OUTPUT) 0 "Position" + MemberName 12(VS_OUTPUT) 1 "ClipRect" + Name 15 "@main(struct-VS_OUTPUT-vf4-vf2[2]1;" + Name 14 "v" + Name 31 "v" + Name 33 "v.Position" + Name 40 "v.ClipRect" + Name 59 "@entryPointOutput" + Decorate 33(v.Position) BuiltIn FragCoord + Decorate 40(v.ClipRect) BuiltIn ClipDistance + Decorate 59(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeVector 6(float) 2 + 9: TypeInt 32 0 + 10: 9(int) Constant 2 + 11: TypeArray 8(fvec2) 10 + 12(VS_OUTPUT): TypeStruct 7(fvec4) 11 + 13: TypeFunction 7(fvec4) 12(VS_OUTPUT) + 17: TypeInt 32 1 + 18: 17(int) Constant 0 + 20: 17(int) Constant 1 + 21: 9(int) Constant 0 + 30: TypePointer Function 12(VS_OUTPUT) + 32: TypePointer Input 7(fvec4) + 33(v.Position): 32(ptr) Variable Input + 35: TypePointer Function 7(fvec4) + 37: 9(int) Constant 4 + 38: TypeArray 6(float) 37 + 39: TypePointer Input 38 + 40(v.ClipRect): 39(ptr) Variable Input + 41: TypePointer Input 6(float) + 44: TypePointer Function 6(float) + 48: 9(int) Constant 1 + 50: 17(int) Constant 2 + 54: 17(int) Constant 3 + 58: TypePointer Output 7(fvec4) +59(@entryPointOutput): 58(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 31(v): 30(ptr) Variable Function + 34: 7(fvec4) Load 33(v.Position) + 36: 35(ptr) AccessChain 31(v) 18 + Store 36 34 + 42: 41(ptr) AccessChain 40(v.ClipRect) 18 + 43: 6(float) Load 42 + 45: 44(ptr) AccessChain 31(v) 20 18 21 + Store 45 43 + 46: 41(ptr) AccessChain 40(v.ClipRect) 20 + 47: 6(float) Load 46 + 49: 44(ptr) AccessChain 31(v) 20 18 48 + Store 49 47 + 51: 41(ptr) AccessChain 40(v.ClipRect) 50 + 52: 6(float) Load 51 + 53: 44(ptr) AccessChain 31(v) 20 20 21 + Store 53 52 + 55: 41(ptr) AccessChain 40(v.ClipRect) 54 + 56: 6(float) Load 55 + 57: 44(ptr) AccessChain 31(v) 20 20 48 + Store 57 56 + 60:12(VS_OUTPUT) Load 31(v) + 61: 7(fvec4) FunctionCall 15(@main(struct-VS_OUTPUT-vf4-vf2[2]1;) 60 + Store 59(@entryPointOutput) 61 + Return + FunctionEnd +15(@main(struct-VS_OUTPUT-vf4-vf2[2]1;): 7(fvec4) Function None 13 + 14(v):12(VS_OUTPUT) FunctionParameter + 16: Label + 19: 7(fvec4) CompositeExtract 14(v) 0 + 22: 6(float) CompositeExtract 14(v) 1 0 0 + 23: 7(fvec4) CompositeConstruct 22 22 22 22 + 24: 7(fvec4) FAdd 19 23 + 25: 6(float) CompositeExtract 14(v) 1 1 0 + 26: 7(fvec4) CompositeConstruct 25 25 25 25 + 27: 7(fvec4) FAdd 24 26 + ReturnValue 27 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-5.vert.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-5.vert.out new file mode 100644 index 00000000..3e8f1fe7 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-5.vert.out @@ -0,0 +1,431 @@ +hlsl.clipdistance-5.vert +Shader version: 500 +0:? Sequence +0:11 Function Definition: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:11 Function Parameters: +0:11 'v' ( const (read only) structure{ temp 4-component vector of float Position}) +0:? Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 Position: direct index for structure ( temp 4-component vector of float) +0:13 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:15 move second child to first child ( temp float) +0:15 direct index ( temp float) +0:15 direct index ( temp 2-component vector of float) +0:15 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:15 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:15 Constant: +0:15 1 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 1.000000 +0:16 move second child to first child ( temp float) +0:16 direct index ( temp float) +0:16 direct index ( temp 2-component vector of float) +0:16 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:16 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 2.000000 +0:17 move second child to first child ( temp float) +0:17 direct index ( temp float) +0:17 direct index ( temp 2-component vector of float) +0:17 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:17 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 3.000000 +0:18 move second child to first child ( temp float) +0:18 direct index ( temp float) +0:18 direct index ( temp 2-component vector of float) +0:18 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:18 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 4.000000 +0:20 Branch: Return with expression +0:20 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:11 Function Definition: main( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:11 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position}) +0:11 Constant: +0:11 0 (const int) +0:? 'v.Position' (layout( location=0) in 4-component vector of float) +0:11 Sequence +0:11 move second child to first child ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:11 Function Call: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:? 'v' ( temp structure{ temp 4-component vector of float Position}) +0:11 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:11 Position: direct index for structure ( temp 4-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:11 Constant: +0:11 0 (const int) +0:? Sequence +0:11 move second child to first child ( temp float) +0:11 direct index ( out float ClipDistance) +0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( out float ClipDistance) +0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( out float ClipDistance) +0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) +0:11 Constant: +0:11 2 (const int) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( out float ClipDistance) +0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) +0:11 Constant: +0:11 3 (const int) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:? Linker Objects +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:? 'v.Position' (layout( location=0) in 4-component vector of float) +0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:11 Function Definition: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:11 Function Parameters: +0:11 'v' ( const (read only) structure{ temp 4-component vector of float Position}) +0:? Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 Position: direct index for structure ( temp 4-component vector of float) +0:13 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:15 move second child to first child ( temp float) +0:15 direct index ( temp float) +0:15 direct index ( temp 2-component vector of float) +0:15 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:15 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:15 Constant: +0:15 1 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 1.000000 +0:16 move second child to first child ( temp float) +0:16 direct index ( temp float) +0:16 direct index ( temp 2-component vector of float) +0:16 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:16 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 2.000000 +0:17 move second child to first child ( temp float) +0:17 direct index ( temp float) +0:17 direct index ( temp 2-component vector of float) +0:17 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:17 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 3.000000 +0:18 move second child to first child ( temp float) +0:18 direct index ( temp float) +0:18 direct index ( temp 2-component vector of float) +0:18 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:18 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 4.000000 +0:20 Branch: Return with expression +0:20 'Output' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:11 Function Definition: main( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:11 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position}) +0:11 Constant: +0:11 0 (const int) +0:? 'v.Position' (layout( location=0) in 4-component vector of float) +0:11 Sequence +0:11 move second child to first child ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:11 Function Call: @main(struct-VS_INPUT-vf41; ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:? 'v' ( temp structure{ temp 4-component vector of float Position}) +0:11 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:11 Position: direct index for structure ( temp 4-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:11 Constant: +0:11 0 (const int) +0:? Sequence +0:11 move second child to first child ( temp float) +0:11 direct index ( out float ClipDistance) +0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) +0:11 Constant: +0:11 0 (const int) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( out float ClipDistance) +0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( out float ClipDistance) +0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) +0:11 Constant: +0:11 2 (const int) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( out float ClipDistance) +0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) +0:11 Constant: +0:11 3 (const int) +0:11 direct index ( temp float) +0:11 direct index ( temp 2-component vector of float) +0:11 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:? Linker Objects +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:? 'v.Position' (layout( location=0) in 4-component vector of float) +0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 73 + + Capability Shader + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 44 51 57 + Source HLSL 500 + Name 4 "main" + Name 8 "VS_INPUT" + MemberName 8(VS_INPUT) 0 "Position" + Name 13 "VS_OUTPUT" + MemberName 13(VS_OUTPUT) 0 "Position" + MemberName 13(VS_OUTPUT) 1 "ClipRect" + Name 16 "@main(struct-VS_INPUT-vf41;" + Name 15 "v" + Name 19 "Output" + Name 42 "v" + Name 44 "v.Position" + Name 47 "flattenTemp" + Name 51 "@entryPointOutput.Position" + Name 57 "@entryPointOutput.ClipRect" + Decorate 44(v.Position) Location 0 + Decorate 51(@entryPointOutput.Position) BuiltIn Position + Decorate 57(@entryPointOutput.ClipRect) BuiltIn ClipDistance + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(VS_INPUT): TypeStruct 7(fvec4) + 9: TypeVector 6(float) 2 + 10: TypeInt 32 0 + 11: 10(int) Constant 2 + 12: TypeArray 9(fvec2) 11 + 13(VS_OUTPUT): TypeStruct 7(fvec4) 12 + 14: TypeFunction 13(VS_OUTPUT) 8(VS_INPUT) + 18: TypePointer Function 13(VS_OUTPUT) + 20: TypeInt 32 1 + 21: 20(int) Constant 0 + 22: 6(float) Constant 0 + 23: 7(fvec4) ConstantComposite 22 22 22 22 + 24: TypePointer Function 7(fvec4) + 26: 20(int) Constant 1 + 27: 6(float) Constant 1065353216 + 28: 10(int) Constant 0 + 29: TypePointer Function 6(float) + 31: 6(float) Constant 1073741824 + 32: 10(int) Constant 1 + 34: 6(float) Constant 1077936128 + 36: 6(float) Constant 1082130432 + 41: TypePointer Function 8(VS_INPUT) + 43: TypePointer Input 7(fvec4) + 44(v.Position): 43(ptr) Variable Input + 50: TypePointer Output 7(fvec4) +51(@entryPointOutput.Position): 50(ptr) Variable Output + 54: 10(int) Constant 4 + 55: TypeArray 6(float) 54 + 56: TypePointer Output 55 +57(@entryPointOutput.ClipRect): 56(ptr) Variable Output + 60: TypePointer Output 6(float) + 65: 20(int) Constant 2 + 69: 20(int) Constant 3 + 4(main): 2 Function None 3 + 5: Label + 42(v): 41(ptr) Variable Function + 47(flattenTemp): 18(ptr) Variable Function + 45: 7(fvec4) Load 44(v.Position) + 46: 24(ptr) AccessChain 42(v) 21 + Store 46 45 + 48: 8(VS_INPUT) Load 42(v) + 49:13(VS_OUTPUT) FunctionCall 16(@main(struct-VS_INPUT-vf41;) 48 + Store 47(flattenTemp) 49 + 52: 24(ptr) AccessChain 47(flattenTemp) 21 + 53: 7(fvec4) Load 52 + Store 51(@entryPointOutput.Position) 53 + 58: 29(ptr) AccessChain 47(flattenTemp) 26 21 28 + 59: 6(float) Load 58 + 61: 60(ptr) AccessChain 57(@entryPointOutput.ClipRect) 21 + Store 61 59 + 62: 29(ptr) AccessChain 47(flattenTemp) 26 21 32 + 63: 6(float) Load 62 + 64: 60(ptr) AccessChain 57(@entryPointOutput.ClipRect) 26 + Store 64 63 + 66: 29(ptr) AccessChain 47(flattenTemp) 26 26 28 + 67: 6(float) Load 66 + 68: 60(ptr) AccessChain 57(@entryPointOutput.ClipRect) 65 + Store 68 67 + 70: 29(ptr) AccessChain 47(flattenTemp) 26 26 32 + 71: 6(float) Load 70 + 72: 60(ptr) AccessChain 57(@entryPointOutput.ClipRect) 69 + Store 72 71 + Return + FunctionEnd +16(@main(struct-VS_INPUT-vf41;):13(VS_OUTPUT) Function None 14 + 15(v): 8(VS_INPUT) FunctionParameter + 17: Label + 19(Output): 18(ptr) Variable Function + 25: 24(ptr) AccessChain 19(Output) 21 + Store 25 23 + 30: 29(ptr) AccessChain 19(Output) 26 21 28 + Store 30 27 + 33: 29(ptr) AccessChain 19(Output) 26 21 32 + Store 33 31 + 35: 29(ptr) AccessChain 19(Output) 26 26 28 + Store 35 34 + 37: 29(ptr) AccessChain 19(Output) 26 26 32 + Store 37 36 + 38:13(VS_OUTPUT) Load 19(Output) + ReturnValue 38 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-6.frag.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-6.frag.out new file mode 100644 index 00000000..3ee8065a --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-6.frag.out @@ -0,0 +1,399 @@ +hlsl.clipdistance-6.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: @main(struct-VS_OUTPUT-vf4-vf4-vf41; ( temp 4-component vector of float) +0:8 Function Parameters: +0:8 'v' ( in structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:? Sequence +0:9 Branch: Return with expression +0:9 add ( temp 4-component vector of float) +0:9 add ( temp 4-component vector of float) +0:9 Position: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 0 (const int) +0:9 clip0: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 1 (const int) +0:9 clip1: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 2 (const int) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 0 (const int) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 2 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 3 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 3 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 4 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 5 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 6 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 3 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 7 (const int) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:8 Function Call: @main(struct-VS_OUTPUT-vf4-vf4-vf41; ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: @main(struct-VS_OUTPUT-vf4-vf4-vf41; ( temp 4-component vector of float) +0:8 Function Parameters: +0:8 'v' ( in structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:? Sequence +0:9 Branch: Return with expression +0:9 add ( temp 4-component vector of float) +0:9 add ( temp 4-component vector of float) +0:9 Position: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 0 (const int) +0:9 clip0: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 1 (const int) +0:9 clip1: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 2 (const int) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 0 (const int) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 2 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 3 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 3 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 4 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 5 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 6 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 3 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 7 (const int) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:8 Function Call: @main(struct-VS_OUTPUT-vf4-vf4-vf41; ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 79 + + Capability Shader + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 31 38 75 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "VS_OUTPUT" + MemberName 8(VS_OUTPUT) 0 "Position" + MemberName 8(VS_OUTPUT) 1 "clip0" + MemberName 8(VS_OUTPUT) 2 "clip1" + Name 12 "@main(struct-VS_OUTPUT-vf4-vf4-vf41;" + Name 11 "v" + Name 29 "v" + Name 31 "v.Position" + Name 38 "v.clip1" + Name 75 "@entryPointOutput" + Name 76 "param" + Decorate 31(v.Position) BuiltIn FragCoord + Decorate 38(v.clip1) BuiltIn ClipDistance + Decorate 75(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(VS_OUTPUT): TypeStruct 7(fvec4) 7(fvec4) 7(fvec4) + 9: TypePointer Function 8(VS_OUTPUT) + 10: TypeFunction 7(fvec4) 9(ptr) + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16: TypePointer Function 7(fvec4) + 19: 14(int) Constant 1 + 23: 14(int) Constant 2 + 30: TypePointer Input 7(fvec4) + 31(v.Position): 30(ptr) Variable Input + 34: TypeInt 32 0 + 35: 34(int) Constant 8 + 36: TypeArray 6(float) 35 + 37: TypePointer Input 36 + 38(v.clip1): 37(ptr) Variable Input + 39: TypePointer Input 6(float) + 42: 34(int) Constant 0 + 43: TypePointer Function 6(float) + 47: 34(int) Constant 1 + 51: 34(int) Constant 2 + 53: 14(int) Constant 3 + 56: 34(int) Constant 3 + 58: 14(int) Constant 4 + 62: 14(int) Constant 5 + 66: 14(int) Constant 6 + 70: 14(int) Constant 7 + 74: TypePointer Output 7(fvec4) +75(@entryPointOutput): 74(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 29(v): 9(ptr) Variable Function + 76(param): 9(ptr) Variable Function + 32: 7(fvec4) Load 31(v.Position) + 33: 16(ptr) AccessChain 29(v) 15 + Store 33 32 + 40: 39(ptr) AccessChain 38(v.clip1) 15 + 41: 6(float) Load 40 + 44: 43(ptr) AccessChain 29(v) 19 42 + Store 44 41 + 45: 39(ptr) AccessChain 38(v.clip1) 19 + 46: 6(float) Load 45 + 48: 43(ptr) AccessChain 29(v) 19 47 + Store 48 46 + 49: 39(ptr) AccessChain 38(v.clip1) 23 + 50: 6(float) Load 49 + 52: 43(ptr) AccessChain 29(v) 19 51 + Store 52 50 + 54: 39(ptr) AccessChain 38(v.clip1) 53 + 55: 6(float) Load 54 + 57: 43(ptr) AccessChain 29(v) 19 56 + Store 57 55 + 59: 39(ptr) AccessChain 38(v.clip1) 58 + 60: 6(float) Load 59 + 61: 43(ptr) AccessChain 29(v) 23 42 + Store 61 60 + 63: 39(ptr) AccessChain 38(v.clip1) 62 + 64: 6(float) Load 63 + 65: 43(ptr) AccessChain 29(v) 23 47 + Store 65 64 + 67: 39(ptr) AccessChain 38(v.clip1) 66 + 68: 6(float) Load 67 + 69: 43(ptr) AccessChain 29(v) 23 51 + Store 69 68 + 71: 39(ptr) AccessChain 38(v.clip1) 70 + 72: 6(float) Load 71 + 73: 43(ptr) AccessChain 29(v) 23 56 + Store 73 72 + 77:8(VS_OUTPUT) Load 29(v) + Store 76(param) 77 + 78: 7(fvec4) FunctionCall 12(@main(struct-VS_OUTPUT-vf4-vf4-vf41;) 76(param) + Store 75(@entryPointOutput) 78 + Return + FunctionEnd +12(@main(struct-VS_OUTPUT-vf4-vf4-vf41;): 7(fvec4) Function None 10 + 11(v): 9(ptr) FunctionParameter + 13: Label + 17: 16(ptr) AccessChain 11(v) 15 + 18: 7(fvec4) Load 17 + 20: 16(ptr) AccessChain 11(v) 19 + 21: 7(fvec4) Load 20 + 22: 7(fvec4) FAdd 18 21 + 24: 16(ptr) AccessChain 11(v) 23 + 25: 7(fvec4) Load 24 + 26: 7(fvec4) FAdd 22 25 + ReturnValue 26 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-6.vert.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-6.vert.out new file mode 100644 index 00000000..a386d0ac --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-6.vert.out @@ -0,0 +1,556 @@ +hlsl.clipdistance-6.vert +Shader version: 500 +0:? Sequence +0:8 Function Definition: @main( ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Function Parameters: +0:? Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:10 Position: direct index for structure ( temp 4-component vector of float) +0:10 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:10 Constant: +0:10 0 (const int) +0:10 Constant: +0:10 0.000000 +0:10 0.000000 +0:10 0.000000 +0:10 0.000000 +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 clip0: direct index for structure ( temp 4-component vector of float) +0:12 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 0.000000 +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 clip0: direct index for structure ( temp 4-component vector of float) +0:13 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 1.000000 +0:14 move second child to first child ( temp float) +0:14 direct index ( temp float) +0:14 clip0: direct index for structure ( temp 4-component vector of float) +0:14 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:14 Constant: +0:14 1 (const int) +0:14 Constant: +0:14 2 (const int) +0:14 Constant: +0:14 2.000000 +0:15 move second child to first child ( temp float) +0:15 direct index ( temp float) +0:15 clip0: direct index for structure ( temp 4-component vector of float) +0:15 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:15 Constant: +0:15 1 (const int) +0:15 Constant: +0:15 3 (const int) +0:15 Constant: +0:15 3.000000 +0:17 move second child to first child ( temp float) +0:17 direct index ( temp float) +0:17 clip1: direct index for structure ( temp 4-component vector of float) +0:17 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 4.000000 +0:18 move second child to first child ( temp float) +0:18 direct index ( temp float) +0:18 clip1: direct index for structure ( temp 4-component vector of float) +0:18 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:18 Constant: +0:18 2 (const int) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 5.000000 +0:19 move second child to first child ( temp float) +0:19 direct index ( temp float) +0:19 clip1: direct index for structure ( temp 4-component vector of float) +0:19 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 6.000000 +0:20 move second child to first child ( temp float) +0:20 direct index ( temp float) +0:20 clip1: direct index for structure ( temp 4-component vector of float) +0:20 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:20 Constant: +0:20 2 (const int) +0:20 Constant: +0:20 3 (const int) +0:20 Constant: +0:20 7.000000 +0:22 Branch: Return with expression +0:22 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Function Call: @main( ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 0 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 3 (const int) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 3 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 4 (const int) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 5 (const int) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 6 (const int) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 7 (const int) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 3 (const int) +0:? Linker Objects +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:8 Function Definition: @main( ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Function Parameters: +0:? Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:10 Position: direct index for structure ( temp 4-component vector of float) +0:10 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:10 Constant: +0:10 0 (const int) +0:10 Constant: +0:10 0.000000 +0:10 0.000000 +0:10 0.000000 +0:10 0.000000 +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 clip0: direct index for structure ( temp 4-component vector of float) +0:12 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 0.000000 +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 clip0: direct index for structure ( temp 4-component vector of float) +0:13 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 1.000000 +0:14 move second child to first child ( temp float) +0:14 direct index ( temp float) +0:14 clip0: direct index for structure ( temp 4-component vector of float) +0:14 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:14 Constant: +0:14 1 (const int) +0:14 Constant: +0:14 2 (const int) +0:14 Constant: +0:14 2.000000 +0:15 move second child to first child ( temp float) +0:15 direct index ( temp float) +0:15 clip0: direct index for structure ( temp 4-component vector of float) +0:15 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:15 Constant: +0:15 1 (const int) +0:15 Constant: +0:15 3 (const int) +0:15 Constant: +0:15 3.000000 +0:17 move second child to first child ( temp float) +0:17 direct index ( temp float) +0:17 clip1: direct index for structure ( temp 4-component vector of float) +0:17 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 4.000000 +0:18 move second child to first child ( temp float) +0:18 direct index ( temp float) +0:18 clip1: direct index for structure ( temp 4-component vector of float) +0:18 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:18 Constant: +0:18 2 (const int) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 5.000000 +0:19 move second child to first child ( temp float) +0:19 direct index ( temp float) +0:19 clip1: direct index for structure ( temp 4-component vector of float) +0:19 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 6.000000 +0:20 move second child to first child ( temp float) +0:20 direct index ( temp float) +0:20 clip1: direct index for structure ( temp 4-component vector of float) +0:20 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:20 Constant: +0:20 2 (const int) +0:20 Constant: +0:20 3 (const int) +0:20 Constant: +0:20 7.000000 +0:22 Branch: Return with expression +0:22 'Output' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Function Call: @main( ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 0 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 3 (const int) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 3 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 4 (const int) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 5 (const int) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 6 (const int) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 7 (const int) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 3 (const int) +0:? Linker Objects +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 86 + + Capability Shader + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 49 55 + Source HLSL 500 + Name 4 "main" + Name 8 "VS_OUTPUT" + MemberName 8(VS_OUTPUT) 0 "Position" + MemberName 8(VS_OUTPUT) 1 "clip0" + MemberName 8(VS_OUTPUT) 2 "clip1" + Name 10 "@main(" + Name 13 "Output" + Name 46 "flattenTemp" + Name 49 "@entryPointOutput.Position" + Name 55 "@entryPointOutput.clip1" + Decorate 49(@entryPointOutput.Position) BuiltIn Position + Decorate 55(@entryPointOutput.clip1) BuiltIn ClipDistance + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(VS_OUTPUT): TypeStruct 7(fvec4) 7(fvec4) 7(fvec4) + 9: TypeFunction 8(VS_OUTPUT) + 12: TypePointer Function 8(VS_OUTPUT) + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16: 6(float) Constant 0 + 17: 7(fvec4) ConstantComposite 16 16 16 16 + 18: TypePointer Function 7(fvec4) + 20: 14(int) Constant 1 + 21: TypeInt 32 0 + 22: 21(int) Constant 0 + 23: TypePointer Function 6(float) + 25: 6(float) Constant 1065353216 + 26: 21(int) Constant 1 + 28: 6(float) Constant 1073741824 + 29: 21(int) Constant 2 + 31: 6(float) Constant 1077936128 + 32: 21(int) Constant 3 + 34: 14(int) Constant 2 + 35: 6(float) Constant 1082130432 + 37: 6(float) Constant 1084227584 + 39: 6(float) Constant 1086324736 + 41: 6(float) Constant 1088421888 + 48: TypePointer Output 7(fvec4) +49(@entryPointOutput.Position): 48(ptr) Variable Output + 52: 21(int) Constant 8 + 53: TypeArray 6(float) 52 + 54: TypePointer Output 53 +55(@entryPointOutput.clip1): 54(ptr) Variable Output + 58: TypePointer Output 6(float) + 66: 14(int) Constant 3 + 70: 14(int) Constant 4 + 74: 14(int) Constant 5 + 78: 14(int) Constant 6 + 82: 14(int) Constant 7 + 4(main): 2 Function None 3 + 5: Label + 46(flattenTemp): 12(ptr) Variable Function + 47:8(VS_OUTPUT) FunctionCall 10(@main() + Store 46(flattenTemp) 47 + 50: 18(ptr) AccessChain 46(flattenTemp) 15 + 51: 7(fvec4) Load 50 + Store 49(@entryPointOutput.Position) 51 + 56: 23(ptr) AccessChain 46(flattenTemp) 20 22 + 57: 6(float) Load 56 + 59: 58(ptr) AccessChain 55(@entryPointOutput.clip1) 15 + Store 59 57 + 60: 23(ptr) AccessChain 46(flattenTemp) 20 26 + 61: 6(float) Load 60 + 62: 58(ptr) AccessChain 55(@entryPointOutput.clip1) 20 + Store 62 61 + 63: 23(ptr) AccessChain 46(flattenTemp) 20 29 + 64: 6(float) Load 63 + 65: 58(ptr) AccessChain 55(@entryPointOutput.clip1) 34 + Store 65 64 + 67: 23(ptr) AccessChain 46(flattenTemp) 20 32 + 68: 6(float) Load 67 + 69: 58(ptr) AccessChain 55(@entryPointOutput.clip1) 66 + Store 69 68 + 71: 23(ptr) AccessChain 46(flattenTemp) 34 22 + 72: 6(float) Load 71 + 73: 58(ptr) AccessChain 55(@entryPointOutput.clip1) 70 + Store 73 72 + 75: 23(ptr) AccessChain 46(flattenTemp) 34 26 + 76: 6(float) Load 75 + 77: 58(ptr) AccessChain 55(@entryPointOutput.clip1) 74 + Store 77 76 + 79: 23(ptr) AccessChain 46(flattenTemp) 34 29 + 80: 6(float) Load 79 + 81: 58(ptr) AccessChain 55(@entryPointOutput.clip1) 78 + Store 81 80 + 83: 23(ptr) AccessChain 46(flattenTemp) 34 32 + 84: 6(float) Load 83 + 85: 58(ptr) AccessChain 55(@entryPointOutput.clip1) 82 + Store 85 84 + Return + FunctionEnd + 10(@main():8(VS_OUTPUT) Function None 9 + 11: Label + 13(Output): 12(ptr) Variable Function + 19: 18(ptr) AccessChain 13(Output) 15 + Store 19 17 + 24: 23(ptr) AccessChain 13(Output) 20 22 + Store 24 16 + 27: 23(ptr) AccessChain 13(Output) 20 26 + Store 27 25 + 30: 23(ptr) AccessChain 13(Output) 20 29 + Store 30 28 + 33: 23(ptr) AccessChain 13(Output) 20 32 + Store 33 31 + 36: 23(ptr) AccessChain 13(Output) 34 22 + Store 36 35 + 38: 23(ptr) AccessChain 13(Output) 34 26 + Store 38 37 + 40: 23(ptr) AccessChain 13(Output) 34 29 + Store 40 39 + 42: 23(ptr) AccessChain 13(Output) 34 32 + Store 42 41 + 43:8(VS_OUTPUT) Load 13(Output) + ReturnValue 43 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-7.frag.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-7.frag.out new file mode 100644 index 00000000..94b6a791 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-7.frag.out @@ -0,0 +1,385 @@ +hlsl.clipdistance-7.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: @main(struct-VS_OUTPUT-vf4-vf3-vf41; ( temp 4-component vector of float) +0:8 Function Parameters: +0:8 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:? Sequence +0:9 Branch: Return with expression +0:9 add ( temp 4-component vector of float) +0:9 add ( temp 4-component vector of float) +0:9 Position: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 0 (const int) +0:9 direct index ( temp float) +0:9 clip0: direct index for structure ( temp 3-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 1 (const int) +0:9 Constant: +0:9 0 (const int) +0:9 direct index ( temp float) +0:9 clip1: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 2 (const int) +0:9 Constant: +0:9 0 (const int) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 0 (const int) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 2 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 4 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 5 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 6 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 3 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 7 (const int) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:8 Function Call: @main(struct-VS_OUTPUT-vf4-vf3-vf41; ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: @main(struct-VS_OUTPUT-vf4-vf3-vf41; ( temp 4-component vector of float) +0:8 Function Parameters: +0:8 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:? Sequence +0:9 Branch: Return with expression +0:9 add ( temp 4-component vector of float) +0:9 add ( temp 4-component vector of float) +0:9 Position: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 0 (const int) +0:9 direct index ( temp float) +0:9 clip0: direct index for structure ( temp 3-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 1 (const int) +0:9 Constant: +0:9 0 (const int) +0:9 direct index ( temp float) +0:9 clip1: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 2 (const int) +0:9 Constant: +0:9 0 (const int) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 0 (const int) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 2 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 4 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 5 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 6 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 3 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 7 (const int) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:8 Function Call: @main(struct-VS_OUTPUT-vf4-vf3-vf41; ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 78 + + Capability Shader + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 37 43 74 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "VS_OUTPUT" + MemberName 9(VS_OUTPUT) 0 "Position" + MemberName 9(VS_OUTPUT) 1 "clip0" + MemberName 9(VS_OUTPUT) 2 "clip1" + Name 13 "@main(struct-VS_OUTPUT-vf4-vf3-vf41;" + Name 12 "v" + Name 35 "v" + Name 37 "v.Position" + Name 43 "v.clip1" + Name 74 "@entryPointOutput" + Name 75 "param" + Decorate 37(v.Position) BuiltIn FragCoord + Decorate 43(v.clip1) BuiltIn ClipDistance + Decorate 74(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeVector 6(float) 3 + 9(VS_OUTPUT): TypeStruct 7(fvec4) 8(fvec3) 7(fvec4) + 10: TypePointer Function 9(VS_OUTPUT) + 11: TypeFunction 7(fvec4) 10(ptr) + 15: TypeInt 32 1 + 16: 15(int) Constant 0 + 17: TypePointer Function 7(fvec4) + 20: 15(int) Constant 1 + 21: TypeInt 32 0 + 22: 21(int) Constant 0 + 23: TypePointer Function 6(float) + 28: 15(int) Constant 2 + 36: TypePointer Input 7(fvec4) + 37(v.Position): 36(ptr) Variable Input + 40: 21(int) Constant 8 + 41: TypeArray 6(float) 40 + 42: TypePointer Input 41 + 43(v.clip1): 42(ptr) Variable Input + 44: TypePointer Input 6(float) + 50: 21(int) Constant 1 + 54: 21(int) Constant 2 + 56: 15(int) Constant 4 + 60: 15(int) Constant 5 + 64: 15(int) Constant 6 + 68: 15(int) Constant 7 + 71: 21(int) Constant 3 + 73: TypePointer Output 7(fvec4) +74(@entryPointOutput): 73(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 35(v): 10(ptr) Variable Function + 75(param): 10(ptr) Variable Function + 38: 7(fvec4) Load 37(v.Position) + 39: 17(ptr) AccessChain 35(v) 16 + Store 39 38 + 45: 44(ptr) AccessChain 43(v.clip1) 16 + 46: 6(float) Load 45 + 47: 23(ptr) AccessChain 35(v) 20 22 + Store 47 46 + 48: 44(ptr) AccessChain 43(v.clip1) 20 + 49: 6(float) Load 48 + 51: 23(ptr) AccessChain 35(v) 20 50 + Store 51 49 + 52: 44(ptr) AccessChain 43(v.clip1) 28 + 53: 6(float) Load 52 + 55: 23(ptr) AccessChain 35(v) 20 54 + Store 55 53 + 57: 44(ptr) AccessChain 43(v.clip1) 56 + 58: 6(float) Load 57 + 59: 23(ptr) AccessChain 35(v) 28 22 + Store 59 58 + 61: 44(ptr) AccessChain 43(v.clip1) 60 + 62: 6(float) Load 61 + 63: 23(ptr) AccessChain 35(v) 28 50 + Store 63 62 + 65: 44(ptr) AccessChain 43(v.clip1) 64 + 66: 6(float) Load 65 + 67: 23(ptr) AccessChain 35(v) 28 54 + Store 67 66 + 69: 44(ptr) AccessChain 43(v.clip1) 68 + 70: 6(float) Load 69 + 72: 23(ptr) AccessChain 35(v) 28 71 + Store 72 70 + 76:9(VS_OUTPUT) Load 35(v) + Store 75(param) 76 + 77: 7(fvec4) FunctionCall 13(@main(struct-VS_OUTPUT-vf4-vf3-vf41;) 75(param) + Store 74(@entryPointOutput) 77 + Return + FunctionEnd +13(@main(struct-VS_OUTPUT-vf4-vf3-vf41;): 7(fvec4) Function None 11 + 12(v): 10(ptr) FunctionParameter + 14: Label + 18: 17(ptr) AccessChain 12(v) 16 + 19: 7(fvec4) Load 18 + 24: 23(ptr) AccessChain 12(v) 20 22 + 25: 6(float) Load 24 + 26: 7(fvec4) CompositeConstruct 25 25 25 25 + 27: 7(fvec4) FAdd 19 26 + 29: 23(ptr) AccessChain 12(v) 28 22 + 30: 6(float) Load 29 + 31: 7(fvec4) CompositeConstruct 30 30 30 30 + 32: 7(fvec4) FAdd 27 31 + ReturnValue 32 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-7.vert.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-7.vert.out new file mode 100644 index 00000000..87e34bd8 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-7.vert.out @@ -0,0 +1,505 @@ +hlsl.clipdistance-7.vert +Shader version: 500 +0:? Sequence +0:8 Function Definition: @main( ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Function Parameters: +0:? Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:10 Position: direct index for structure ( temp 4-component vector of float) +0:10 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:10 Constant: +0:10 0 (const int) +0:10 Constant: +0:10 0.000000 +0:10 0.000000 +0:10 0.000000 +0:10 0.000000 +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 clip0: direct index for structure ( temp 3-component vector of float) +0:12 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 0.000000 +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 clip0: direct index for structure ( temp 3-component vector of float) +0:13 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 1.000000 +0:14 move second child to first child ( temp float) +0:14 direct index ( temp float) +0:14 clip0: direct index for structure ( temp 3-component vector of float) +0:14 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:14 Constant: +0:14 1 (const int) +0:14 Constant: +0:14 2 (const int) +0:14 Constant: +0:14 2.000000 +0:17 move second child to first child ( temp float) +0:17 direct index ( temp float) +0:17 clip1: direct index for structure ( temp 4-component vector of float) +0:17 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 4.000000 +0:18 move second child to first child ( temp float) +0:18 direct index ( temp float) +0:18 clip1: direct index for structure ( temp 4-component vector of float) +0:18 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:18 Constant: +0:18 2 (const int) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 5.000000 +0:19 move second child to first child ( temp float) +0:19 direct index ( temp float) +0:19 clip1: direct index for structure ( temp 4-component vector of float) +0:19 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 6.000000 +0:20 move second child to first child ( temp float) +0:20 direct index ( temp float) +0:20 clip1: direct index for structure ( temp 4-component vector of float) +0:20 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:20 Constant: +0:20 2 (const int) +0:20 Constant: +0:20 3 (const int) +0:20 Constant: +0:20 7.000000 +0:22 Branch: Return with expression +0:22 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Function Call: @main( ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 0 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 4 (const int) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 5 (const int) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 6 (const int) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 7 (const int) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 3 (const int) +0:? Linker Objects +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:8 Function Definition: @main( ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Function Parameters: +0:? Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:10 Position: direct index for structure ( temp 4-component vector of float) +0:10 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:10 Constant: +0:10 0 (const int) +0:10 Constant: +0:10 0.000000 +0:10 0.000000 +0:10 0.000000 +0:10 0.000000 +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 clip0: direct index for structure ( temp 3-component vector of float) +0:12 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 0.000000 +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 clip0: direct index for structure ( temp 3-component vector of float) +0:13 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 1.000000 +0:14 move second child to first child ( temp float) +0:14 direct index ( temp float) +0:14 clip0: direct index for structure ( temp 3-component vector of float) +0:14 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:14 Constant: +0:14 1 (const int) +0:14 Constant: +0:14 2 (const int) +0:14 Constant: +0:14 2.000000 +0:17 move second child to first child ( temp float) +0:17 direct index ( temp float) +0:17 clip1: direct index for structure ( temp 4-component vector of float) +0:17 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 4.000000 +0:18 move second child to first child ( temp float) +0:18 direct index ( temp float) +0:18 clip1: direct index for structure ( temp 4-component vector of float) +0:18 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:18 Constant: +0:18 2 (const int) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 5.000000 +0:19 move second child to first child ( temp float) +0:19 direct index ( temp float) +0:19 clip1: direct index for structure ( temp 4-component vector of float) +0:19 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 6.000000 +0:20 move second child to first child ( temp float) +0:20 direct index ( temp float) +0:20 clip1: direct index for structure ( temp 4-component vector of float) +0:20 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:20 Constant: +0:20 2 (const int) +0:20 Constant: +0:20 3 (const int) +0:20 Constant: +0:20 7.000000 +0:22 Branch: Return with expression +0:22 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Function Call: @main( ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 0 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 4 (const int) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 5 (const int) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 6 (const int) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) +0:8 Constant: +0:8 7 (const int) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 3 (const int) +0:? Linker Objects +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 81 + + Capability Shader + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 48 54 + Source HLSL 500 + Name 4 "main" + Name 9 "VS_OUTPUT" + MemberName 9(VS_OUTPUT) 0 "Position" + MemberName 9(VS_OUTPUT) 1 "clip0" + MemberName 9(VS_OUTPUT) 2 "clip1" + Name 11 "@main(" + Name 14 "Output" + Name 45 "flattenTemp" + Name 48 "@entryPointOutput.Position" + Name 54 "@entryPointOutput.clip1" + Decorate 48(@entryPointOutput.Position) BuiltIn Position + Decorate 54(@entryPointOutput.clip1) BuiltIn ClipDistance + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeVector 6(float) 3 + 9(VS_OUTPUT): TypeStruct 7(fvec4) 8(fvec3) 7(fvec4) + 10: TypeFunction 9(VS_OUTPUT) + 13: TypePointer Function 9(VS_OUTPUT) + 15: TypeInt 32 1 + 16: 15(int) Constant 0 + 17: 6(float) Constant 0 + 18: 7(fvec4) ConstantComposite 17 17 17 17 + 19: TypePointer Function 7(fvec4) + 21: 15(int) Constant 1 + 22: TypeInt 32 0 + 23: 22(int) Constant 0 + 24: TypePointer Function 6(float) + 26: 6(float) Constant 1065353216 + 27: 22(int) Constant 1 + 29: 6(float) Constant 1073741824 + 30: 22(int) Constant 2 + 32: 15(int) Constant 2 + 33: 6(float) Constant 1082130432 + 35: 6(float) Constant 1084227584 + 37: 6(float) Constant 1086324736 + 39: 6(float) Constant 1088421888 + 40: 22(int) Constant 3 + 47: TypePointer Output 7(fvec4) +48(@entryPointOutput.Position): 47(ptr) Variable Output + 51: 22(int) Constant 8 + 52: TypeArray 6(float) 51 + 53: TypePointer Output 52 +54(@entryPointOutput.clip1): 53(ptr) Variable Output + 57: TypePointer Output 6(float) + 65: 15(int) Constant 4 + 69: 15(int) Constant 5 + 73: 15(int) Constant 6 + 77: 15(int) Constant 7 + 4(main): 2 Function None 3 + 5: Label + 45(flattenTemp): 13(ptr) Variable Function + 46:9(VS_OUTPUT) FunctionCall 11(@main() + Store 45(flattenTemp) 46 + 49: 19(ptr) AccessChain 45(flattenTemp) 16 + 50: 7(fvec4) Load 49 + Store 48(@entryPointOutput.Position) 50 + 55: 24(ptr) AccessChain 45(flattenTemp) 21 23 + 56: 6(float) Load 55 + 58: 57(ptr) AccessChain 54(@entryPointOutput.clip1) 16 + Store 58 56 + 59: 24(ptr) AccessChain 45(flattenTemp) 21 27 + 60: 6(float) Load 59 + 61: 57(ptr) AccessChain 54(@entryPointOutput.clip1) 21 + Store 61 60 + 62: 24(ptr) AccessChain 45(flattenTemp) 21 30 + 63: 6(float) Load 62 + 64: 57(ptr) AccessChain 54(@entryPointOutput.clip1) 32 + Store 64 63 + 66: 24(ptr) AccessChain 45(flattenTemp) 32 23 + 67: 6(float) Load 66 + 68: 57(ptr) AccessChain 54(@entryPointOutput.clip1) 65 + Store 68 67 + 70: 24(ptr) AccessChain 45(flattenTemp) 32 27 + 71: 6(float) Load 70 + 72: 57(ptr) AccessChain 54(@entryPointOutput.clip1) 69 + Store 72 71 + 74: 24(ptr) AccessChain 45(flattenTemp) 32 30 + 75: 6(float) Load 74 + 76: 57(ptr) AccessChain 54(@entryPointOutput.clip1) 73 + Store 76 75 + 78: 24(ptr) AccessChain 45(flattenTemp) 32 40 + 79: 6(float) Load 78 + 80: 57(ptr) AccessChain 54(@entryPointOutput.clip1) 77 + Store 80 79 + Return + FunctionEnd + 11(@main():9(VS_OUTPUT) Function None 10 + 12: Label + 14(Output): 13(ptr) Variable Function + 20: 19(ptr) AccessChain 14(Output) 16 + Store 20 18 + 25: 24(ptr) AccessChain 14(Output) 21 23 + Store 25 17 + 28: 24(ptr) AccessChain 14(Output) 21 27 + Store 28 26 + 31: 24(ptr) AccessChain 14(Output) 21 30 + Store 31 29 + 34: 24(ptr) AccessChain 14(Output) 32 23 + Store 34 33 + 36: 24(ptr) AccessChain 14(Output) 32 27 + Store 36 35 + 38: 24(ptr) AccessChain 14(Output) 32 30 + Store 38 37 + 41: 24(ptr) AccessChain 14(Output) 32 40 + Store 41 39 + 42:9(VS_OUTPUT) Load 14(Output) + ReturnValue 42 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-8.frag.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-8.frag.out new file mode 100644 index 00000000..98c9505c --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-8.frag.out @@ -0,0 +1,285 @@ +hlsl.clipdistance-8.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: @main(struct-VS_OUTPUT-vf4-vf3-f11; ( temp 4-component vector of float) +0:8 Function Parameters: +0:8 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:? Sequence +0:9 Branch: Return with expression +0:9 add ( temp 4-component vector of float) +0:9 add ( temp 4-component vector of float) +0:9 Position: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:9 Constant: +0:9 0 (const int) +0:9 direct index ( temp float) +0:9 clip0: direct index for structure ( temp 3-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:9 Constant: +0:9 1 (const int) +0:9 Constant: +0:9 0 (const int) +0:9 clip1: direct index for structure ( temp float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:9 Constant: +0:9 2 (const int) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 0 (const int) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 4-element array of float ClipDistance) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 4-element array of float ClipDistance) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 4-element array of float ClipDistance) +0:8 Constant: +0:8 2 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 clip1: direct index for structure ( temp float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 4-element array of float ClipDistance) +0:8 Constant: +0:8 3 (const int) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:8 Function Call: @main(struct-VS_OUTPUT-vf4-vf3-f11; ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? 'v.clip1' ( in 4-element array of float ClipDistance) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: @main(struct-VS_OUTPUT-vf4-vf3-f11; ( temp 4-component vector of float) +0:8 Function Parameters: +0:8 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:? Sequence +0:9 Branch: Return with expression +0:9 add ( temp 4-component vector of float) +0:9 add ( temp 4-component vector of float) +0:9 Position: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:9 Constant: +0:9 0 (const int) +0:9 direct index ( temp float) +0:9 clip0: direct index for structure ( temp 3-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:9 Constant: +0:9 1 (const int) +0:9 Constant: +0:9 0 (const int) +0:9 clip1: direct index for structure ( temp float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:9 Constant: +0:9 2 (const int) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 0 (const int) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 4-element array of float ClipDistance) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 4-element array of float ClipDistance) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 4-element array of float ClipDistance) +0:8 Constant: +0:8 2 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 clip1: direct index for structure ( temp float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( in float ClipDistance) +0:? 'v.clip1' ( in 4-element array of float ClipDistance) +0:8 Constant: +0:8 3 (const int) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:8 Function Call: @main(struct-VS_OUTPUT-vf4-vf3-f11; ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? 'v.clip1' ( in 4-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 65 + + Capability Shader + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 37 43 61 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "VS_OUTPUT" + MemberName 9(VS_OUTPUT) 0 "Position" + MemberName 9(VS_OUTPUT) 1 "clip0" + MemberName 9(VS_OUTPUT) 2 "clip1" + Name 13 "@main(struct-VS_OUTPUT-vf4-vf3-f11;" + Name 12 "v" + Name 35 "v" + Name 37 "v.Position" + Name 43 "v.clip1" + Name 61 "@entryPointOutput" + Name 62 "param" + Decorate 37(v.Position) BuiltIn FragCoord + Decorate 43(v.clip1) BuiltIn ClipDistance + Decorate 61(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeVector 6(float) 3 + 9(VS_OUTPUT): TypeStruct 7(fvec4) 8(fvec3) 6(float) + 10: TypePointer Function 9(VS_OUTPUT) + 11: TypeFunction 7(fvec4) 10(ptr) + 15: TypeInt 32 1 + 16: 15(int) Constant 0 + 17: TypePointer Function 7(fvec4) + 20: 15(int) Constant 1 + 21: TypeInt 32 0 + 22: 21(int) Constant 0 + 23: TypePointer Function 6(float) + 28: 15(int) Constant 2 + 36: TypePointer Input 7(fvec4) + 37(v.Position): 36(ptr) Variable Input + 40: 21(int) Constant 4 + 41: TypeArray 6(float) 40 + 42: TypePointer Input 41 + 43(v.clip1): 42(ptr) Variable Input + 44: TypePointer Input 6(float) + 50: 21(int) Constant 1 + 54: 21(int) Constant 2 + 56: 15(int) Constant 3 + 60: TypePointer Output 7(fvec4) +61(@entryPointOutput): 60(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 35(v): 10(ptr) Variable Function + 62(param): 10(ptr) Variable Function + 38: 7(fvec4) Load 37(v.Position) + 39: 17(ptr) AccessChain 35(v) 16 + Store 39 38 + 45: 44(ptr) AccessChain 43(v.clip1) 16 + 46: 6(float) Load 45 + 47: 23(ptr) AccessChain 35(v) 20 22 + Store 47 46 + 48: 44(ptr) AccessChain 43(v.clip1) 20 + 49: 6(float) Load 48 + 51: 23(ptr) AccessChain 35(v) 20 50 + Store 51 49 + 52: 44(ptr) AccessChain 43(v.clip1) 28 + 53: 6(float) Load 52 + 55: 23(ptr) AccessChain 35(v) 20 54 + Store 55 53 + 57: 44(ptr) AccessChain 43(v.clip1) 56 + 58: 6(float) Load 57 + 59: 23(ptr) AccessChain 35(v) 28 + Store 59 58 + 63:9(VS_OUTPUT) Load 35(v) + Store 62(param) 63 + 64: 7(fvec4) FunctionCall 13(@main(struct-VS_OUTPUT-vf4-vf3-f11;) 62(param) + Store 61(@entryPointOutput) 64 + Return + FunctionEnd +13(@main(struct-VS_OUTPUT-vf4-vf3-f11;): 7(fvec4) Function None 11 + 12(v): 10(ptr) FunctionParameter + 14: Label + 18: 17(ptr) AccessChain 12(v) 16 + 19: 7(fvec4) Load 18 + 24: 23(ptr) AccessChain 12(v) 20 22 + 25: 6(float) Load 24 + 26: 7(fvec4) CompositeConstruct 25 25 25 25 + 27: 7(fvec4) FAdd 19 26 + 29: 23(ptr) AccessChain 12(v) 28 + 30: 6(float) Load 29 + 31: 7(fvec4) CompositeConstruct 30 30 30 30 + 32: 7(fvec4) FAdd 27 31 + ReturnValue 32 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-8.vert.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-8.vert.out new file mode 100644 index 00000000..88800e3c --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-8.vert.out @@ -0,0 +1,336 @@ +hlsl.clipdistance-8.vert +Shader version: 500 +0:? Sequence +0:8 Function Definition: @main( ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Function Parameters: +0:? Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:10 Position: direct index for structure ( temp 4-component vector of float) +0:10 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:10 Constant: +0:10 0 (const int) +0:10 Constant: +0:10 0.000000 +0:10 0.000000 +0:10 0.000000 +0:10 0.000000 +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 clip0: direct index for structure ( temp 3-component vector of float) +0:12 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 0.000000 +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 clip0: direct index for structure ( temp 3-component vector of float) +0:13 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 1.000000 +0:14 move second child to first child ( temp float) +0:14 direct index ( temp float) +0:14 clip0: direct index for structure ( temp 3-component vector of float) +0:14 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:14 Constant: +0:14 1 (const int) +0:14 Constant: +0:14 2 (const int) +0:14 Constant: +0:14 2.000000 +0:17 move second child to first child ( temp float) +0:17 clip1: direct index for structure ( temp float) +0:17 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 3.000000 +0:19 Branch: Return with expression +0:19 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Function Call: @main( ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 0 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 4-element array of float ClipDistance) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 4-element array of float ClipDistance) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 4-element array of float ClipDistance) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 4-element array of float ClipDistance) +0:8 Constant: +0:8 3 (const int) +0:8 clip1: direct index for structure ( temp float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 2 (const int) +0:? Linker Objects +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:? '@entryPointOutput.clip1' ( out 4-element array of float ClipDistance) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:8 Function Definition: @main( ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Function Parameters: +0:? Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:10 Position: direct index for structure ( temp 4-component vector of float) +0:10 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:10 Constant: +0:10 0 (const int) +0:10 Constant: +0:10 0.000000 +0:10 0.000000 +0:10 0.000000 +0:10 0.000000 +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 clip0: direct index for structure ( temp 3-component vector of float) +0:12 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 0.000000 +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 clip0: direct index for structure ( temp 3-component vector of float) +0:13 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 1.000000 +0:14 move second child to first child ( temp float) +0:14 direct index ( temp float) +0:14 clip0: direct index for structure ( temp 3-component vector of float) +0:14 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:14 Constant: +0:14 1 (const int) +0:14 Constant: +0:14 2 (const int) +0:14 Constant: +0:14 2.000000 +0:17 move second child to first child ( temp float) +0:17 clip1: direct index for structure ( temp float) +0:17 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 3.000000 +0:19 Branch: Return with expression +0:19 'Output' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Function Call: @main( ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 0 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 4-element array of float ClipDistance) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 4-element array of float ClipDistance) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 4-element array of float ClipDistance) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 4-element array of float ClipDistance) +0:8 Constant: +0:8 3 (const int) +0:8 clip1: direct index for structure ( temp float) +0:8 'flattenTemp' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 2 (const int) +0:? Linker Objects +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:? '@entryPointOutput.clip1' ( out 4-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 62 + + Capability Shader + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 41 47 + Source HLSL 500 + Name 4 "main" + Name 9 "VS_OUTPUT" + MemberName 9(VS_OUTPUT) 0 "Position" + MemberName 9(VS_OUTPUT) 1 "clip0" + MemberName 9(VS_OUTPUT) 2 "clip1" + Name 11 "@main(" + Name 14 "Output" + Name 38 "flattenTemp" + Name 41 "@entryPointOutput.Position" + Name 47 "@entryPointOutput.clip1" + Decorate 41(@entryPointOutput.Position) BuiltIn Position + Decorate 47(@entryPointOutput.clip1) BuiltIn ClipDistance + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeVector 6(float) 3 + 9(VS_OUTPUT): TypeStruct 7(fvec4) 8(fvec3) 6(float) + 10: TypeFunction 9(VS_OUTPUT) + 13: TypePointer Function 9(VS_OUTPUT) + 15: TypeInt 32 1 + 16: 15(int) Constant 0 + 17: 6(float) Constant 0 + 18: 7(fvec4) ConstantComposite 17 17 17 17 + 19: TypePointer Function 7(fvec4) + 21: 15(int) Constant 1 + 22: TypeInt 32 0 + 23: 22(int) Constant 0 + 24: TypePointer Function 6(float) + 26: 6(float) Constant 1065353216 + 27: 22(int) Constant 1 + 29: 6(float) Constant 1073741824 + 30: 22(int) Constant 2 + 32: 15(int) Constant 2 + 33: 6(float) Constant 1077936128 + 40: TypePointer Output 7(fvec4) +41(@entryPointOutput.Position): 40(ptr) Variable Output + 44: 22(int) Constant 4 + 45: TypeArray 6(float) 44 + 46: TypePointer Output 45 +47(@entryPointOutput.clip1): 46(ptr) Variable Output + 50: TypePointer Output 6(float) + 58: 15(int) Constant 3 + 4(main): 2 Function None 3 + 5: Label + 38(flattenTemp): 13(ptr) Variable Function + 39:9(VS_OUTPUT) FunctionCall 11(@main() + Store 38(flattenTemp) 39 + 42: 19(ptr) AccessChain 38(flattenTemp) 16 + 43: 7(fvec4) Load 42 + Store 41(@entryPointOutput.Position) 43 + 48: 24(ptr) AccessChain 38(flattenTemp) 21 23 + 49: 6(float) Load 48 + 51: 50(ptr) AccessChain 47(@entryPointOutput.clip1) 16 + Store 51 49 + 52: 24(ptr) AccessChain 38(flattenTemp) 21 27 + 53: 6(float) Load 52 + 54: 50(ptr) AccessChain 47(@entryPointOutput.clip1) 21 + Store 54 53 + 55: 24(ptr) AccessChain 38(flattenTemp) 21 30 + 56: 6(float) Load 55 + 57: 50(ptr) AccessChain 47(@entryPointOutput.clip1) 32 + Store 57 56 + 59: 24(ptr) AccessChain 38(flattenTemp) 32 + 60: 6(float) Load 59 + 61: 50(ptr) AccessChain 47(@entryPointOutput.clip1) 58 + Store 61 60 + Return + FunctionEnd + 11(@main():9(VS_OUTPUT) Function None 10 + 12: Label + 14(Output): 13(ptr) Variable Function + 20: 19(ptr) AccessChain 14(Output) 16 + Store 20 18 + 25: 24(ptr) AccessChain 14(Output) 21 23 + Store 25 17 + 28: 24(ptr) AccessChain 14(Output) 21 27 + Store 28 26 + 31: 24(ptr) AccessChain 14(Output) 21 30 + Store 31 29 + 34: 24(ptr) AccessChain 14(Output) 32 + Store 34 33 + 35:9(VS_OUTPUT) Load 14(Output) + ReturnValue 35 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-9.frag.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-9.frag.out new file mode 100644 index 00000000..ff7f2619 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-9.frag.out @@ -0,0 +1,250 @@ +hlsl.clipdistance-9.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:6 Function Definition: @main(vf4;vf3;f1; ( temp 4-component vector of float) +0:6 Function Parameters: +0:6 'Position' ( in 4-component vector of float) +0:6 'clip0' ( in 3-component vector of float) +0:6 'clip1' ( in float) +0:? Sequence +0:7 Branch: Return with expression +0:7 add ( temp 4-component vector of float) +0:7 add ( temp 4-component vector of float) +0:7 'Position' ( in 4-component vector of float) +0:7 direct index ( temp float) +0:7 'clip0' ( in 3-component vector of float) +0:7 Constant: +0:7 0 (const int) +0:7 'clip1' ( in float) +0:6 Function Definition: main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:? 'Position' ( temp 4-component vector of float) +0:? 'Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:6 move second child to first child ( temp float) +0:6 direct index ( temp float) +0:? 'clip0' ( temp 3-component vector of float) +0:6 Constant: +0:6 0 (const int) +0:6 direct index ( in float ClipDistance) +0:? 'clip0' ( in 4-element array of float ClipDistance) +0:6 Constant: +0:6 0 (const int) +0:6 move second child to first child ( temp float) +0:6 direct index ( temp float) +0:? 'clip0' ( temp 3-component vector of float) +0:6 Constant: +0:6 1 (const int) +0:6 direct index ( in float ClipDistance) +0:? 'clip0' ( in 4-element array of float ClipDistance) +0:6 Constant: +0:6 1 (const int) +0:6 move second child to first child ( temp float) +0:6 direct index ( temp float) +0:? 'clip0' ( temp 3-component vector of float) +0:6 Constant: +0:6 2 (const int) +0:6 direct index ( in float ClipDistance) +0:? 'clip0' ( in 4-element array of float ClipDistance) +0:6 Constant: +0:6 2 (const int) +0:? Sequence +0:6 move second child to first child ( temp float) +0:? 'clip1' ( temp float) +0:6 direct index ( in float ClipDistance) +0:? 'clip0' ( in 4-element array of float ClipDistance) +0:6 Constant: +0:6 3 (const int) +0:6 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:6 Function Call: @main(vf4;vf3;f1; ( temp 4-component vector of float) +0:? 'Position' ( temp 4-component vector of float) +0:? 'clip0' ( temp 3-component vector of float) +0:? 'clip1' ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'Position' ( in 4-component vector of float FragCoord) +0:? 'clip0' ( in 4-element array of float ClipDistance) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:6 Function Definition: @main(vf4;vf3;f1; ( temp 4-component vector of float) +0:6 Function Parameters: +0:6 'Position' ( in 4-component vector of float) +0:6 'clip0' ( in 3-component vector of float) +0:6 'clip1' ( in float) +0:? Sequence +0:7 Branch: Return with expression +0:7 add ( temp 4-component vector of float) +0:7 add ( temp 4-component vector of float) +0:7 'Position' ( in 4-component vector of float) +0:7 direct index ( temp float) +0:7 'clip0' ( in 3-component vector of float) +0:7 Constant: +0:7 0 (const int) +0:7 'clip1' ( in float) +0:6 Function Definition: main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:? 'Position' ( temp 4-component vector of float) +0:? 'Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:6 move second child to first child ( temp float) +0:6 direct index ( temp float) +0:? 'clip0' ( temp 3-component vector of float) +0:6 Constant: +0:6 0 (const int) +0:6 direct index ( in float ClipDistance) +0:? 'clip0' ( in 4-element array of float ClipDistance) +0:6 Constant: +0:6 0 (const int) +0:6 move second child to first child ( temp float) +0:6 direct index ( temp float) +0:? 'clip0' ( temp 3-component vector of float) +0:6 Constant: +0:6 1 (const int) +0:6 direct index ( in float ClipDistance) +0:? 'clip0' ( in 4-element array of float ClipDistance) +0:6 Constant: +0:6 1 (const int) +0:6 move second child to first child ( temp float) +0:6 direct index ( temp float) +0:? 'clip0' ( temp 3-component vector of float) +0:6 Constant: +0:6 2 (const int) +0:6 direct index ( in float ClipDistance) +0:? 'clip0' ( in 4-element array of float ClipDistance) +0:6 Constant: +0:6 2 (const int) +0:? Sequence +0:6 move second child to first child ( temp float) +0:? 'clip1' ( temp float) +0:6 direct index ( in float ClipDistance) +0:? 'clip0' ( in 4-element array of float ClipDistance) +0:6 Constant: +0:6 3 (const int) +0:6 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:6 Function Call: @main(vf4;vf3;f1; ( temp 4-component vector of float) +0:? 'Position' ( temp 4-component vector of float) +0:? 'clip0' ( temp 3-component vector of float) +0:? 'clip1' ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'Position' ( in 4-component vector of float FragCoord) +0:? 'clip0' ( in 4-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 68 + + Capability Shader + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 32 38 60 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 16 "@main(vf4;vf3;f1;" + Name 13 "Position" + Name 14 "clip0" + Name 15 "clip1" + Name 30 "Position" + Name 32 "Position" + Name 34 "clip0" + Name 38 "clip0" + Name 55 "clip1" + Name 60 "@entryPointOutput" + Name 61 "param" + Name 63 "param" + Name 65 "param" + Decorate 32(Position) BuiltIn FragCoord + Decorate 38(clip0) BuiltIn ClipDistance + Decorate 60(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeVector 6(float) 3 + 10: TypePointer Function 9(fvec3) + 11: TypePointer Function 6(float) + 12: TypeFunction 7(fvec4) 8(ptr) 10(ptr) 11(ptr) + 19: TypeInt 32 0 + 20: 19(int) Constant 0 + 31: TypePointer Input 7(fvec4) + 32(Position): 31(ptr) Variable Input + 35: 19(int) Constant 4 + 36: TypeArray 6(float) 35 + 37: TypePointer Input 36 + 38(clip0): 37(ptr) Variable Input + 39: TypeInt 32 1 + 40: 39(int) Constant 0 + 41: TypePointer Input 6(float) + 45: 39(int) Constant 1 + 48: 19(int) Constant 1 + 50: 39(int) Constant 2 + 53: 19(int) Constant 2 + 56: 39(int) Constant 3 + 59: TypePointer Output 7(fvec4) +60(@entryPointOutput): 59(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 30(Position): 8(ptr) Variable Function + 34(clip0): 10(ptr) Variable Function + 55(clip1): 11(ptr) Variable Function + 61(param): 8(ptr) Variable Function + 63(param): 10(ptr) Variable Function + 65(param): 11(ptr) Variable Function + 33: 7(fvec4) Load 32(Position) + Store 30(Position) 33 + 42: 41(ptr) AccessChain 38(clip0) 40 + 43: 6(float) Load 42 + 44: 11(ptr) AccessChain 34(clip0) 20 + Store 44 43 + 46: 41(ptr) AccessChain 38(clip0) 45 + 47: 6(float) Load 46 + 49: 11(ptr) AccessChain 34(clip0) 48 + Store 49 47 + 51: 41(ptr) AccessChain 38(clip0) 50 + 52: 6(float) Load 51 + 54: 11(ptr) AccessChain 34(clip0) 53 + Store 54 52 + 57: 41(ptr) AccessChain 38(clip0) 56 + 58: 6(float) Load 57 + Store 55(clip1) 58 + 62: 7(fvec4) Load 30(Position) + Store 61(param) 62 + 64: 9(fvec3) Load 34(clip0) + Store 63(param) 64 + 66: 6(float) Load 55(clip1) + Store 65(param) 66 + 67: 7(fvec4) FunctionCall 16(@main(vf4;vf3;f1;) 61(param) 63(param) 65(param) + Store 60(@entryPointOutput) 67 + Return + FunctionEnd +16(@main(vf4;vf3;f1;): 7(fvec4) Function None 12 + 13(Position): 8(ptr) FunctionParameter + 14(clip0): 10(ptr) FunctionParameter + 15(clip1): 11(ptr) FunctionParameter + 17: Label + 18: 7(fvec4) Load 13(Position) + 21: 11(ptr) AccessChain 14(clip0) 20 + 22: 6(float) Load 21 + 23: 7(fvec4) CompositeConstruct 22 22 22 22 + 24: 7(fvec4) FAdd 18 23 + 25: 6(float) Load 15(clip1) + 26: 7(fvec4) CompositeConstruct 25 25 25 25 + 27: 7(fvec4) FAdd 24 26 + ReturnValue 27 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.clipdistance-9.vert.out b/deps/glslang/Test/baseResults/hlsl.clipdistance-9.vert.out new file mode 100644 index 00000000..2d0c9b02 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.clipdistance-9.vert.out @@ -0,0 +1,299 @@ +hlsl.clipdistance-9.vert +Shader version: 500 +0:? Sequence +0:7 Function Definition: @main(vf3;f1; ( temp structure{ temp 4-component vector of float Position}) +0:7 Function Parameters: +0:7 'clip0' ( out 3-component vector of float) +0:7 'clip1' ( out float) +0:? Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:9 Position: direct index for structure ( temp 4-component vector of float) +0:9 'Output' ( temp structure{ temp 4-component vector of float Position}) +0:9 Constant: +0:9 0 (const int) +0:9 Constant: +0:9 0.000000 +0:9 0.000000 +0:9 0.000000 +0:9 0.000000 +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 'clip0' ( out 3-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0.000000 +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 'clip0' ( out 3-component vector of float) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 1.000000 +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 'clip0' ( out 3-component vector of float) +0:13 Constant: +0:13 2 (const int) +0:13 Constant: +0:13 2.000000 +0:16 move second child to first child ( temp float) +0:16 'clip1' ( out float) +0:16 Constant: +0:16 3.000000 +0:18 Branch: Return with expression +0:18 'Output' ( temp structure{ temp 4-component vector of float Position}) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:7 Position: direct index for structure ( temp 4-component vector of float) +0:7 Function Call: @main(vf3;f1; ( temp structure{ temp 4-component vector of float Position}) +0:? 'clip0' ( temp 3-component vector of float) +0:? 'clip1' ( temp float) +0:7 Constant: +0:7 0 (const int) +0:? Sequence +0:7 move second child to first child ( temp float) +0:7 direct index ( out float ClipDistance) +0:? 'clip0' ( out 4-element array of float ClipDistance) +0:7 Constant: +0:7 0 (const int) +0:7 direct index ( temp float) +0:? 'clip0' ( temp 3-component vector of float) +0:7 Constant: +0:7 0 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( out float ClipDistance) +0:? 'clip0' ( out 4-element array of float ClipDistance) +0:7 Constant: +0:7 1 (const int) +0:7 direct index ( temp float) +0:? 'clip0' ( temp 3-component vector of float) +0:7 Constant: +0:7 1 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( out float ClipDistance) +0:? 'clip0' ( out 4-element array of float ClipDistance) +0:7 Constant: +0:7 2 (const int) +0:7 direct index ( temp float) +0:? 'clip0' ( temp 3-component vector of float) +0:7 Constant: +0:7 2 (const int) +0:? Sequence +0:7 move second child to first child ( temp float) +0:7 direct index ( out float ClipDistance) +0:? 'clip0' ( out 4-element array of float ClipDistance) +0:7 Constant: +0:7 3 (const int) +0:? 'clip1' ( temp float) +0:? Linker Objects +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:? 'clip0' ( out 4-element array of float ClipDistance) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:7 Function Definition: @main(vf3;f1; ( temp structure{ temp 4-component vector of float Position}) +0:7 Function Parameters: +0:7 'clip0' ( out 3-component vector of float) +0:7 'clip1' ( out float) +0:? Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:9 Position: direct index for structure ( temp 4-component vector of float) +0:9 'Output' ( temp structure{ temp 4-component vector of float Position}) +0:9 Constant: +0:9 0 (const int) +0:9 Constant: +0:9 0.000000 +0:9 0.000000 +0:9 0.000000 +0:9 0.000000 +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 'clip0' ( out 3-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0.000000 +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 'clip0' ( out 3-component vector of float) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 1.000000 +0:13 move second child to first child ( temp float) +0:13 direct index ( temp float) +0:13 'clip0' ( out 3-component vector of float) +0:13 Constant: +0:13 2 (const int) +0:13 Constant: +0:13 2.000000 +0:16 move second child to first child ( temp float) +0:16 'clip1' ( out float) +0:16 Constant: +0:16 3.000000 +0:18 Branch: Return with expression +0:18 'Output' ( temp structure{ temp 4-component vector of float Position}) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:7 Position: direct index for structure ( temp 4-component vector of float) +0:7 Function Call: @main(vf3;f1; ( temp structure{ temp 4-component vector of float Position}) +0:? 'clip0' ( temp 3-component vector of float) +0:? 'clip1' ( temp float) +0:7 Constant: +0:7 0 (const int) +0:? Sequence +0:7 move second child to first child ( temp float) +0:7 direct index ( out float ClipDistance) +0:? 'clip0' ( out 4-element array of float ClipDistance) +0:7 Constant: +0:7 0 (const int) +0:7 direct index ( temp float) +0:? 'clip0' ( temp 3-component vector of float) +0:7 Constant: +0:7 0 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( out float ClipDistance) +0:? 'clip0' ( out 4-element array of float ClipDistance) +0:7 Constant: +0:7 1 (const int) +0:7 direct index ( temp float) +0:? 'clip0' ( temp 3-component vector of float) +0:7 Constant: +0:7 1 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( out float ClipDistance) +0:? 'clip0' ( out 4-element array of float ClipDistance) +0:7 Constant: +0:7 2 (const int) +0:7 direct index ( temp float) +0:? 'clip0' ( temp 3-component vector of float) +0:7 Constant: +0:7 2 (const int) +0:? Sequence +0:7 move second child to first child ( temp float) +0:7 direct index ( out float ClipDistance) +0:? 'clip0' ( out 4-element array of float ClipDistance) +0:7 Constant: +0:7 3 (const int) +0:? 'clip1' ( temp float) +0:? Linker Objects +0:? '@entryPointOutput.Position' ( out 4-component vector of float Position) +0:? 'clip0' ( out 4-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 67 + + Capability Shader + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 39 51 + Source HLSL 500 + Name 4 "main" + Name 11 "VS_OUTPUT" + MemberName 11(VS_OUTPUT) 0 "Position" + Name 15 "@main(vf3;f1;" + Name 13 "clip0" + Name 14 "clip1" + Name 18 "Output" + Name 39 "@entryPointOutput.Position" + Name 40 "clip0" + Name 41 "clip1" + Name 42 "param" + Name 43 "param" + Name 51 "clip0" + Decorate 39(@entryPointOutput.Position) BuiltIn Position + Decorate 51(clip0) BuiltIn ClipDistance + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8: TypePointer Function 7(fvec3) + 9: TypePointer Function 6(float) + 10: TypeVector 6(float) 4 + 11(VS_OUTPUT): TypeStruct 10(fvec4) + 12: TypeFunction 11(VS_OUTPUT) 8(ptr) 9(ptr) + 17: TypePointer Function 11(VS_OUTPUT) + 19: TypeInt 32 1 + 20: 19(int) Constant 0 + 21: 6(float) Constant 0 + 22: 10(fvec4) ConstantComposite 21 21 21 21 + 23: TypePointer Function 10(fvec4) + 25: TypeInt 32 0 + 26: 25(int) Constant 0 + 28: 6(float) Constant 1065353216 + 29: 25(int) Constant 1 + 31: 6(float) Constant 1073741824 + 32: 25(int) Constant 2 + 34: 6(float) Constant 1077936128 + 38: TypePointer Output 10(fvec4) +39(@entryPointOutput.Position): 38(ptr) Variable Output + 48: 25(int) Constant 4 + 49: TypeArray 6(float) 48 + 50: TypePointer Output 49 + 51(clip0): 50(ptr) Variable Output + 54: TypePointer Output 6(float) + 56: 19(int) Constant 1 + 60: 19(int) Constant 2 + 64: 19(int) Constant 3 + 4(main): 2 Function None 3 + 5: Label + 40(clip0): 8(ptr) Variable Function + 41(clip1): 9(ptr) Variable Function + 42(param): 8(ptr) Variable Function + 43(param): 9(ptr) Variable Function + 44:11(VS_OUTPUT) FunctionCall 15(@main(vf3;f1;) 42(param) 43(param) + 45: 7(fvec3) Load 42(param) + Store 40(clip0) 45 + 46: 6(float) Load 43(param) + Store 41(clip1) 46 + 47: 10(fvec4) CompositeExtract 44 0 + Store 39(@entryPointOutput.Position) 47 + 52: 9(ptr) AccessChain 40(clip0) 26 + 53: 6(float) Load 52 + 55: 54(ptr) AccessChain 51(clip0) 20 + Store 55 53 + 57: 9(ptr) AccessChain 40(clip0) 29 + 58: 6(float) Load 57 + 59: 54(ptr) AccessChain 51(clip0) 56 + Store 59 58 + 61: 9(ptr) AccessChain 40(clip0) 32 + 62: 6(float) Load 61 + 63: 54(ptr) AccessChain 51(clip0) 60 + Store 63 62 + 65: 6(float) Load 41(clip1) + 66: 54(ptr) AccessChain 51(clip0) 64 + Store 66 65 + Return + FunctionEnd +15(@main(vf3;f1;):11(VS_OUTPUT) Function None 12 + 13(clip0): 8(ptr) FunctionParameter + 14(clip1): 9(ptr) FunctionParameter + 16: Label + 18(Output): 17(ptr) Variable Function + 24: 23(ptr) AccessChain 18(Output) 20 + Store 24 22 + 27: 9(ptr) AccessChain 13(clip0) 26 + Store 27 21 + 30: 9(ptr) AccessChain 13(clip0) 29 + Store 30 28 + 33: 9(ptr) AccessChain 13(clip0) 32 + Store 33 31 + Store 14(clip1) 34 + 35:11(VS_OUTPUT) Load 18(Output) + ReturnValue 35 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.color.hull.tesc.out b/deps/glslang/Test/baseResults/hlsl.color.hull.tesc.out new file mode 100644 index 00000000..72e0b7e7 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.color.hull.tesc.out @@ -0,0 +1,572 @@ +hlsl.color.hull.tesc +Shader version: 500 +vertices = 3 +vertex spacing = equal_spacing +triangle order = cw +0:? Sequence +0:37 Function Definition: ColorPatchConstantFunction(struct-HullInputType-vf3-vf41[3];u1; ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:37 Function Parameters: +0:37 'inputPatch' ( in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:37 'patchId' ( in uint) +0:? Sequence +0:42 move second child to first child ( temp float) +0:42 direct index ( temp float) +0:42 edges: direct index for structure ( temp 3-element array of float) +0:42 'output' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 0 (const int) +0:42 tessellationAmount: direct index for structure (layout( row_major std140) uniform float) +0:42 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform float tessellationAmount, layout( row_major std140) uniform 3-component vector of float padding}) +0:42 Constant: +0:42 0 (const uint) +0:43 move second child to first child ( temp float) +0:43 direct index ( temp float) +0:43 edges: direct index for structure ( temp 3-element array of float) +0:43 'output' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:43 Constant: +0:43 0 (const int) +0:43 Constant: +0:43 1 (const int) +0:43 tessellationAmount: direct index for structure (layout( row_major std140) uniform float) +0:43 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform float tessellationAmount, layout( row_major std140) uniform 3-component vector of float padding}) +0:43 Constant: +0:43 0 (const uint) +0:44 move second child to first child ( temp float) +0:44 direct index ( temp float) +0:44 edges: direct index for structure ( temp 3-element array of float) +0:44 'output' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 tessellationAmount: direct index for structure (layout( row_major std140) uniform float) +0:44 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform float tessellationAmount, layout( row_major std140) uniform 3-component vector of float padding}) +0:44 Constant: +0:44 0 (const uint) +0:47 move second child to first child ( temp float) +0:47 inside: direct index for structure ( temp float) +0:47 'output' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:47 Constant: +0:47 1 (const int) +0:47 tessellationAmount: direct index for structure (layout( row_major std140) uniform float) +0:47 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform float tessellationAmount, layout( row_major std140) uniform 3-component vector of float padding}) +0:47 Constant: +0:47 0 (const uint) +0:49 Branch: Return with expression +0:49 'output' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:63 Function Definition: @main(struct-HullInputType-vf3-vf41[3];u1;u1; ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:63 Function Parameters: +0:63 'patch' ( in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:63 'pointId' ( in uint) +0:63 'patchId' ( in uint) +0:? Sequence +0:67 move second child to first child ( temp 3-component vector of float) +0:67 position: direct index for structure ( temp 3-component vector of float) +0:67 'output' ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:67 Constant: +0:67 0 (const int) +0:67 position: direct index for structure ( temp 3-component vector of float) +0:67 indirect index ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:67 'patch' ( in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:67 'pointId' ( in uint) +0:67 Constant: +0:67 0 (const int) +0:70 move second child to first child ( temp 4-component vector of float) +0:70 color: direct index for structure ( temp 4-component vector of float) +0:70 'output' ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:70 Constant: +0:70 1 (const int) +0:70 color: direct index for structure ( temp 4-component vector of float) +0:70 indirect index ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:70 'patch' ( in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:70 'pointId' ( in uint) +0:70 Constant: +0:70 1 (const int) +0:72 Branch: Return with expression +0:72 'output' ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:63 Function Definition: main( ( temp void) +0:63 Function Parameters: +0:? Sequence +0:63 move second child to first child ( temp 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'patch' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:63 move second child to first child ( temp uint) +0:? 'pointId' ( temp uint) +0:? 'pointId' ( in uint InvocationID) +0:63 move second child to first child ( temp uint) +0:? 'patchId' ( temp uint) +0:? 'patchId' ( in uint PrimitiveID) +0:63 move second child to first child ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:63 indirect index (layout( location=0) out structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'pointId' ( in uint InvocationID) +0:63 Function Call: @main(struct-HullInputType-vf3-vf41[3];u1;u1; ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'pointId' ( temp uint) +0:? 'patchId' ( temp uint) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'pointId' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? Function Call: ColorPatchConstantFunction(struct-HullInputType-vf3-vf41[3];u1; ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'patchId' ( in uint PrimitiveID) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 2 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 2 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelInner) +0:? '@patchConstantOutput.inside' ( patch out 2-element array of float TessLevelInner) +0:? Constant: +0:? 0 (const int) +0:? inside: direct index for structure ( temp float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? Constant: +0:? 1 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform float tessellationAmount, layout( row_major std140) uniform 3-component vector of float padding}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'patch' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'pointId' ( in uint InvocationID) +0:? 'patchId' ( in uint PrimitiveID) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? '@patchConstantOutput.inside' ( patch out 2-element array of float TessLevelInner) + + +Linked tessellation control stage: + + +Shader version: 500 +vertices = 3 +vertex spacing = equal_spacing +triangle order = cw +0:? Sequence +0:37 Function Definition: ColorPatchConstantFunction(struct-HullInputType-vf3-vf41[3];u1; ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:37 Function Parameters: +0:37 'inputPatch' ( in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:37 'patchId' ( in uint) +0:? Sequence +0:42 move second child to first child ( temp float) +0:42 direct index ( temp float) +0:42 edges: direct index for structure ( temp 3-element array of float) +0:42 'output' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 0 (const int) +0:42 tessellationAmount: direct index for structure (layout( row_major std140) uniform float) +0:42 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform float tessellationAmount, layout( row_major std140) uniform 3-component vector of float padding}) +0:42 Constant: +0:42 0 (const uint) +0:43 move second child to first child ( temp float) +0:43 direct index ( temp float) +0:43 edges: direct index for structure ( temp 3-element array of float) +0:43 'output' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:43 Constant: +0:43 0 (const int) +0:43 Constant: +0:43 1 (const int) +0:43 tessellationAmount: direct index for structure (layout( row_major std140) uniform float) +0:43 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform float tessellationAmount, layout( row_major std140) uniform 3-component vector of float padding}) +0:43 Constant: +0:43 0 (const uint) +0:44 move second child to first child ( temp float) +0:44 direct index ( temp float) +0:44 edges: direct index for structure ( temp 3-element array of float) +0:44 'output' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 tessellationAmount: direct index for structure (layout( row_major std140) uniform float) +0:44 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform float tessellationAmount, layout( row_major std140) uniform 3-component vector of float padding}) +0:44 Constant: +0:44 0 (const uint) +0:47 move second child to first child ( temp float) +0:47 inside: direct index for structure ( temp float) +0:47 'output' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:47 Constant: +0:47 1 (const int) +0:47 tessellationAmount: direct index for structure (layout( row_major std140) uniform float) +0:47 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform float tessellationAmount, layout( row_major std140) uniform 3-component vector of float padding}) +0:47 Constant: +0:47 0 (const uint) +0:49 Branch: Return with expression +0:49 'output' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:63 Function Definition: @main(struct-HullInputType-vf3-vf41[3];u1;u1; ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:63 Function Parameters: +0:63 'patch' ( in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:63 'pointId' ( in uint) +0:63 'patchId' ( in uint) +0:? Sequence +0:67 move second child to first child ( temp 3-component vector of float) +0:67 position: direct index for structure ( temp 3-component vector of float) +0:67 'output' ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:67 Constant: +0:67 0 (const int) +0:67 position: direct index for structure ( temp 3-component vector of float) +0:67 indirect index ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:67 'patch' ( in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:67 'pointId' ( in uint) +0:67 Constant: +0:67 0 (const int) +0:70 move second child to first child ( temp 4-component vector of float) +0:70 color: direct index for structure ( temp 4-component vector of float) +0:70 'output' ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:70 Constant: +0:70 1 (const int) +0:70 color: direct index for structure ( temp 4-component vector of float) +0:70 indirect index ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:70 'patch' ( in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:70 'pointId' ( in uint) +0:70 Constant: +0:70 1 (const int) +0:72 Branch: Return with expression +0:72 'output' ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:63 Function Definition: main( ( temp void) +0:63 Function Parameters: +0:? Sequence +0:63 move second child to first child ( temp 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'patch' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:63 move second child to first child ( temp uint) +0:? 'pointId' ( temp uint) +0:? 'pointId' ( in uint InvocationID) +0:63 move second child to first child ( temp uint) +0:? 'patchId' ( temp uint) +0:? 'patchId' ( in uint PrimitiveID) +0:63 move second child to first child ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:63 indirect index (layout( location=0) out structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'pointId' ( in uint InvocationID) +0:63 Function Call: @main(struct-HullInputType-vf3-vf41[3];u1;u1; ( temp structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'pointId' ( temp uint) +0:? 'patchId' ( temp uint) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'pointId' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? Function Call: ColorPatchConstantFunction(struct-HullInputType-vf3-vf41[3];u1; ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'patchId' ( in uint PrimitiveID) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 2 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 2 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelInner) +0:? '@patchConstantOutput.inside' ( patch out 2-element array of float TessLevelInner) +0:? Constant: +0:? 0 (const int) +0:? inside: direct index for structure ( temp float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float edges, temp float inside}) +0:? Constant: +0:? 1 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform float tessellationAmount, layout( row_major std140) uniform 3-component vector of float padding}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'patch' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float position, temp 4-component vector of float color}) +0:? 'pointId' ( in uint InvocationID) +0:? 'patchId' ( in uint PrimitiveID) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? '@patchConstantOutput.inside' ( patch out 2-element array of float TessLevelInner) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 127 + + Capability Tessellation + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "main" 72 76 79 83 110 123 + ExecutionMode 4 OutputVertices 3 + ExecutionMode 4 Triangles + ExecutionMode 4 SpacingEqual + ExecutionMode 4 VertexOrderCw + Source HLSL 500 + Name 4 "main" + Name 9 "HullInputType" + MemberName 9(HullInputType) 0 "position" + MemberName 9(HullInputType) 1 "color" + Name 16 "ConstantOutputType" + MemberName 16(ConstantOutputType) 0 "edges" + MemberName 16(ConstantOutputType) 1 "inside" + Name 20 "ColorPatchConstantFunction(struct-HullInputType-vf3-vf41[3];u1;" + Name 18 "inputPatch" + Name 19 "patchId" + Name 22 "HullOutputType" + MemberName 22(HullOutputType) 0 "position" + MemberName 22(HullOutputType) 1 "color" + Name 27 "@main(struct-HullInputType-vf3-vf41[3];u1;u1;" + Name 24 "patch" + Name 25 "pointId" + Name 26 "patchId" + Name 30 "output" + Name 33 "TessellationBuffer" + MemberName 33(TessellationBuffer) 0 "tessellationAmount" + MemberName 33(TessellationBuffer) 1 "padding" + Name 35 "" + Name 56 "output" + Name 70 "patch" + Name 72 "patch" + Name 74 "pointId" + Name 76 "pointId" + Name 78 "patchId" + Name 79 "patchId" + Name 83 "@entryPointOutput" + Name 85 "param" + Name 87 "param" + Name 89 "param" + Name 102 "@patchConstantResult" + Name 103 "param" + Name 105 "param" + Name 110 "@patchConstantOutput.edges" + Name 123 "@patchConstantOutput.inside" + MemberDecorate 33(TessellationBuffer) 0 Offset 0 + MemberDecorate 33(TessellationBuffer) 1 Offset 4 + Decorate 33(TessellationBuffer) Block + Decorate 35 DescriptorSet 0 + Decorate 35 Binding 0 + Decorate 72(patch) Location 0 + Decorate 76(pointId) BuiltIn InvocationId + Decorate 79(patchId) BuiltIn PrimitiveId + Decorate 83(@entryPointOutput) Location 0 + Decorate 110(@patchConstantOutput.edges) Patch + Decorate 110(@patchConstantOutput.edges) BuiltIn TessLevelOuter + Decorate 123(@patchConstantOutput.inside) Patch + Decorate 123(@patchConstantOutput.inside) BuiltIn TessLevelInner + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8: TypeVector 6(float) 4 +9(HullInputType): TypeStruct 7(fvec3) 8(fvec4) + 10: TypeInt 32 0 + 11: 10(int) Constant 3 + 12: TypeArray 9(HullInputType) 11 + 13: TypePointer Function 12 + 14: TypePointer Function 10(int) + 15: TypeArray 6(float) 11 +16(ConstantOutputType): TypeStruct 15 6(float) + 17: TypeFunction 16(ConstantOutputType) 13(ptr) 14(ptr) +22(HullOutputType): TypeStruct 7(fvec3) 8(fvec4) + 23: TypeFunction 22(HullOutputType) 13(ptr) 14(ptr) 14(ptr) + 29: TypePointer Function 16(ConstantOutputType) + 31: TypeInt 32 1 + 32: 31(int) Constant 0 +33(TessellationBuffer): TypeStruct 6(float) 7(fvec3) + 34: TypePointer Uniform 33(TessellationBuffer) + 35: 34(ptr) Variable Uniform + 36: TypePointer Uniform 6(float) + 39: TypePointer Function 6(float) + 41: 31(int) Constant 1 + 45: 31(int) Constant 2 + 55: TypePointer Function 22(HullOutputType) + 58: TypePointer Function 7(fvec3) + 63: TypePointer Function 8(fvec4) + 71: TypePointer Input 12 + 72(patch): 71(ptr) Variable Input + 75: TypePointer Input 10(int) + 76(pointId): 75(ptr) Variable Input + 79(patchId): 75(ptr) Variable Input + 81: TypeArray 22(HullOutputType) 11 + 82: TypePointer Output 81 +83(@entryPointOutput): 82(ptr) Variable Output + 92: TypePointer Output 22(HullOutputType) + 94: 10(int) Constant 2 + 95: 10(int) Constant 4 + 96: 10(int) Constant 0 + 98: TypeBool + 108: TypeArray 6(float) 95 + 109: TypePointer Output 108 +110(@patchConstantOutput.edges): 109(ptr) Variable Output + 113: TypePointer Output 6(float) + 121: TypeArray 6(float) 94 + 122: TypePointer Output 121 +123(@patchConstantOutput.inside): 122(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 70(patch): 13(ptr) Variable Function + 74(pointId): 14(ptr) Variable Function + 78(patchId): 14(ptr) Variable Function + 85(param): 13(ptr) Variable Function + 87(param): 14(ptr) Variable Function + 89(param): 14(ptr) Variable Function +102(@patchConstantResult): 29(ptr) Variable Function + 103(param): 13(ptr) Variable Function + 105(param): 14(ptr) Variable Function + 73: 12 Load 72(patch) + Store 70(patch) 73 + 77: 10(int) Load 76(pointId) + Store 74(pointId) 77 + 80: 10(int) Load 79(patchId) + Store 78(patchId) 80 + 84: 10(int) Load 76(pointId) + 86: 12 Load 70(patch) + Store 85(param) 86 + 88: 10(int) Load 74(pointId) + Store 87(param) 88 + 90: 10(int) Load 78(patchId) + Store 89(param) 90 + 91:22(HullOutputType) FunctionCall 27(@main(struct-HullInputType-vf3-vf41[3];u1;u1;) 85(param) 87(param) 89(param) + 93: 92(ptr) AccessChain 83(@entryPointOutput) 84 + Store 93 91 + ControlBarrier 94 95 96 + 97: 10(int) Load 76(pointId) + 99: 98(bool) IEqual 97 32 + SelectionMerge 101 None + BranchConditional 99 100 101 + 100: Label + 104: 12 Load 70(patch) + Store 103(param) 104 + 106: 10(int) Load 79(patchId) + Store 105(param) 106 + 107:16(ConstantOutputType) FunctionCall 20(ColorPatchConstantFunction(struct-HullInputType-vf3-vf41[3];u1;) 103(param) 105(param) + Store 102(@patchConstantResult) 107 + 111: 39(ptr) AccessChain 102(@patchConstantResult) 32 32 + 112: 6(float) Load 111 + 114: 113(ptr) AccessChain 110(@patchConstantOutput.edges) 32 + Store 114 112 + 115: 39(ptr) AccessChain 102(@patchConstantResult) 32 41 + 116: 6(float) Load 115 + 117: 113(ptr) AccessChain 110(@patchConstantOutput.edges) 41 + Store 117 116 + 118: 39(ptr) AccessChain 102(@patchConstantResult) 32 45 + 119: 6(float) Load 118 + 120: 113(ptr) AccessChain 110(@patchConstantOutput.edges) 45 + Store 120 119 + 124: 39(ptr) AccessChain 102(@patchConstantResult) 41 + 125: 6(float) Load 124 + 126: 113(ptr) AccessChain 123(@patchConstantOutput.inside) 32 + Store 126 125 + Branch 101 + 101: Label + Return + FunctionEnd +20(ColorPatchConstantFunction(struct-HullInputType-vf3-vf41[3];u1;):16(ConstantOutputType) Function None 17 + 18(inputPatch): 13(ptr) FunctionParameter + 19(patchId): 14(ptr) FunctionParameter + 21: Label + 30(output): 29(ptr) Variable Function + 37: 36(ptr) AccessChain 35 32 + 38: 6(float) Load 37 + 40: 39(ptr) AccessChain 30(output) 32 32 + Store 40 38 + 42: 36(ptr) AccessChain 35 32 + 43: 6(float) Load 42 + 44: 39(ptr) AccessChain 30(output) 32 41 + Store 44 43 + 46: 36(ptr) AccessChain 35 32 + 47: 6(float) Load 46 + 48: 39(ptr) AccessChain 30(output) 32 45 + Store 48 47 + 49: 36(ptr) AccessChain 35 32 + 50: 6(float) Load 49 + 51: 39(ptr) AccessChain 30(output) 41 + Store 51 50 + 52:16(ConstantOutputType) Load 30(output) + ReturnValue 52 + FunctionEnd +27(@main(struct-HullInputType-vf3-vf41[3];u1;u1;):22(HullOutputType) Function None 23 + 24(patch): 13(ptr) FunctionParameter + 25(pointId): 14(ptr) FunctionParameter + 26(patchId): 14(ptr) FunctionParameter + 28: Label + 56(output): 55(ptr) Variable Function + 57: 10(int) Load 25(pointId) + 59: 58(ptr) AccessChain 24(patch) 57 32 + 60: 7(fvec3) Load 59 + 61: 58(ptr) AccessChain 56(output) 32 + Store 61 60 + 62: 10(int) Load 25(pointId) + 64: 63(ptr) AccessChain 24(patch) 62 41 + 65: 8(fvec4) Load 64 + 66: 63(ptr) AccessChain 56(output) 41 + Store 66 65 + 67:22(HullOutputType) Load 56(output) + ReturnValue 67 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.comparison.vec.frag.out b/deps/glslang/Test/baseResults/hlsl.comparison.vec.frag.out new file mode 100644 index 00000000..c7e4ed52 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.comparison.vec.frag.out @@ -0,0 +1,416 @@ +hlsl.comparison.vec.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: Bug1(vf4; ( temp void) +0:4 Function Parameters: +0:4 'a' ( in 4-component vector of float) +0:? Sequence +0:5 Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:5 'v04' ( temp 4-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:6 Sequence +0:6 move second child to first child ( temp float) +0:6 'v01' ( temp float) +0:6 Constant: +0:6 0.000000 +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of bool) +0:8 'r00' ( temp 4-component vector of bool) +0:8 Equal ( temp 4-component vector of bool) +0:8 'a' ( in 4-component vector of float) +0:8 'v04' ( temp 4-component vector of float) +0:9 Sequence +0:9 move second child to first child ( temp 4-component vector of bool) +0:9 'r01' ( temp 4-component vector of bool) +0:9 NotEqual ( temp 4-component vector of bool) +0:9 'a' ( in 4-component vector of float) +0:9 'v04' ( temp 4-component vector of float) +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of bool) +0:10 'r02' ( temp 4-component vector of bool) +0:10 Compare Less Than ( temp 4-component vector of bool) +0:10 'a' ( in 4-component vector of float) +0:10 'v04' ( temp 4-component vector of float) +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of bool) +0:11 'r03' ( temp 4-component vector of bool) +0:11 Compare Greater Than ( temp 4-component vector of bool) +0:11 'a' ( in 4-component vector of float) +0:11 'v04' ( temp 4-component vector of float) +0:13 Sequence +0:13 move second child to first child ( temp 4-component vector of bool) +0:13 'r10' ( temp 4-component vector of bool) +0:13 Equal ( temp 4-component vector of bool) +0:13 'a' ( in 4-component vector of float) +0:13 Construct vec4 ( in 4-component vector of float) +0:13 'v01' ( temp float) +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of bool) +0:14 'r11' ( temp 4-component vector of bool) +0:14 NotEqual ( temp 4-component vector of bool) +0:14 'a' ( in 4-component vector of float) +0:14 Construct vec4 ( in 4-component vector of float) +0:14 'v01' ( temp float) +0:15 Sequence +0:15 move second child to first child ( temp 4-component vector of bool) +0:15 'r12' ( temp 4-component vector of bool) +0:15 Compare Less Than ( temp 4-component vector of bool) +0:15 'a' ( in 4-component vector of float) +0:15 Construct vec4 ( in 4-component vector of float) +0:15 'v01' ( temp float) +0:16 Sequence +0:16 move second child to first child ( temp 4-component vector of bool) +0:16 'r13' ( temp 4-component vector of bool) +0:16 Compare Greater Than ( temp 4-component vector of bool) +0:16 'a' ( in 4-component vector of float) +0:16 Construct vec4 ( in 4-component vector of float) +0:16 'v01' ( temp float) +0:18 Sequence +0:18 move second child to first child ( temp 4-component vector of bool) +0:18 'r20' ( temp 4-component vector of bool) +0:18 Equal ( temp 4-component vector of bool) +0:18 Construct vec4 ( in 4-component vector of float) +0:18 'v01' ( temp float) +0:18 'a' ( in 4-component vector of float) +0:19 Sequence +0:19 move second child to first child ( temp 4-component vector of bool) +0:19 'r21' ( temp 4-component vector of bool) +0:19 NotEqual ( temp 4-component vector of bool) +0:19 Construct vec4 ( in 4-component vector of float) +0:19 'v01' ( temp float) +0:19 'a' ( in 4-component vector of float) +0:20 Sequence +0:20 move second child to first child ( temp 4-component vector of bool) +0:20 'r22' ( temp 4-component vector of bool) +0:20 Compare Less Than ( temp 4-component vector of bool) +0:20 Construct vec4 ( in 4-component vector of float) +0:20 'v01' ( temp float) +0:20 'a' ( in 4-component vector of float) +0:21 Sequence +0:21 move second child to first child ( temp 4-component vector of bool) +0:21 'r23' ( temp 4-component vector of bool) +0:21 Compare Greater Than ( temp 4-component vector of bool) +0:21 Construct vec4 ( in 4-component vector of float) +0:21 'v01' ( temp float) +0:21 'a' ( in 4-component vector of float) +0:30 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:30 Function Parameters: +0:? Sequence +0:32 move second child to first child ( temp 4-component vector of float) +0:32 Color: direct index for structure ( temp 4-component vector of float) +0:32 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:33 Branch: Return with expression +0:33 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:30 Function Definition: main( ( temp void) +0:30 Function Parameters: +0:? Sequence +0:30 Sequence +0:30 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:30 Color: direct index for structure ( temp 4-component vector of float) +0:30 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:30 Constant: +0:30 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float uf4}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: Bug1(vf4; ( temp void) +0:4 Function Parameters: +0:4 'a' ( in 4-component vector of float) +0:? Sequence +0:5 Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:5 'v04' ( temp 4-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:6 Sequence +0:6 move second child to first child ( temp float) +0:6 'v01' ( temp float) +0:6 Constant: +0:6 0.000000 +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of bool) +0:8 'r00' ( temp 4-component vector of bool) +0:8 Equal ( temp 4-component vector of bool) +0:8 'a' ( in 4-component vector of float) +0:8 'v04' ( temp 4-component vector of float) +0:9 Sequence +0:9 move second child to first child ( temp 4-component vector of bool) +0:9 'r01' ( temp 4-component vector of bool) +0:9 NotEqual ( temp 4-component vector of bool) +0:9 'a' ( in 4-component vector of float) +0:9 'v04' ( temp 4-component vector of float) +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of bool) +0:10 'r02' ( temp 4-component vector of bool) +0:10 Compare Less Than ( temp 4-component vector of bool) +0:10 'a' ( in 4-component vector of float) +0:10 'v04' ( temp 4-component vector of float) +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of bool) +0:11 'r03' ( temp 4-component vector of bool) +0:11 Compare Greater Than ( temp 4-component vector of bool) +0:11 'a' ( in 4-component vector of float) +0:11 'v04' ( temp 4-component vector of float) +0:13 Sequence +0:13 move second child to first child ( temp 4-component vector of bool) +0:13 'r10' ( temp 4-component vector of bool) +0:13 Equal ( temp 4-component vector of bool) +0:13 'a' ( in 4-component vector of float) +0:13 Construct vec4 ( in 4-component vector of float) +0:13 'v01' ( temp float) +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of bool) +0:14 'r11' ( temp 4-component vector of bool) +0:14 NotEqual ( temp 4-component vector of bool) +0:14 'a' ( in 4-component vector of float) +0:14 Construct vec4 ( in 4-component vector of float) +0:14 'v01' ( temp float) +0:15 Sequence +0:15 move second child to first child ( temp 4-component vector of bool) +0:15 'r12' ( temp 4-component vector of bool) +0:15 Compare Less Than ( temp 4-component vector of bool) +0:15 'a' ( in 4-component vector of float) +0:15 Construct vec4 ( in 4-component vector of float) +0:15 'v01' ( temp float) +0:16 Sequence +0:16 move second child to first child ( temp 4-component vector of bool) +0:16 'r13' ( temp 4-component vector of bool) +0:16 Compare Greater Than ( temp 4-component vector of bool) +0:16 'a' ( in 4-component vector of float) +0:16 Construct vec4 ( in 4-component vector of float) +0:16 'v01' ( temp float) +0:18 Sequence +0:18 move second child to first child ( temp 4-component vector of bool) +0:18 'r20' ( temp 4-component vector of bool) +0:18 Equal ( temp 4-component vector of bool) +0:18 Construct vec4 ( in 4-component vector of float) +0:18 'v01' ( temp float) +0:18 'a' ( in 4-component vector of float) +0:19 Sequence +0:19 move second child to first child ( temp 4-component vector of bool) +0:19 'r21' ( temp 4-component vector of bool) +0:19 NotEqual ( temp 4-component vector of bool) +0:19 Construct vec4 ( in 4-component vector of float) +0:19 'v01' ( temp float) +0:19 'a' ( in 4-component vector of float) +0:20 Sequence +0:20 move second child to first child ( temp 4-component vector of bool) +0:20 'r22' ( temp 4-component vector of bool) +0:20 Compare Less Than ( temp 4-component vector of bool) +0:20 Construct vec4 ( in 4-component vector of float) +0:20 'v01' ( temp float) +0:20 'a' ( in 4-component vector of float) +0:21 Sequence +0:21 move second child to first child ( temp 4-component vector of bool) +0:21 'r23' ( temp 4-component vector of bool) +0:21 Compare Greater Than ( temp 4-component vector of bool) +0:21 Construct vec4 ( in 4-component vector of float) +0:21 'v01' ( temp float) +0:21 'a' ( in 4-component vector of float) +0:30 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:30 Function Parameters: +0:? Sequence +0:32 move second child to first child ( temp 4-component vector of float) +0:32 Color: direct index for structure ( temp 4-component vector of float) +0:32 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:33 Branch: Return with expression +0:33 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:30 Function Definition: main( ( temp void) +0:30 Function Parameters: +0:? Sequence +0:30 Sequence +0:30 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:30 Color: direct index for structure ( temp 4-component vector of float) +0:30 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:30 Constant: +0:30 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float uf4}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 96 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 90 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "Bug1(vf4;" + Name 10 "a" + Name 13 "PS_OUTPUT" + MemberName 13(PS_OUTPUT) 0 "Color" + Name 15 "@main(" + Name 17 "v04" + Name 21 "v01" + Name 25 "r00" + Name 29 "r01" + Name 33 "r02" + Name 37 "r03" + Name 41 "r10" + Name 46 "r11" + Name 51 "r12" + Name 56 "r13" + Name 61 "r20" + Name 66 "r21" + Name 71 "r22" + Name 76 "r23" + Name 82 "psout" + Name 90 "@entryPointOutput.Color" + Name 93 "$Global" + MemberName 93($Global) 0 "uf4" + Name 95 "" + Decorate 90(@entryPointOutput.Color) Location 0 + MemberDecorate 93($Global) 0 Offset 0 + Decorate 93($Global) Block + Decorate 95 DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 2 8(ptr) + 13(PS_OUTPUT): TypeStruct 7(fvec4) + 14: TypeFunction 13(PS_OUTPUT) + 18: 6(float) Constant 0 + 19: 7(fvec4) ConstantComposite 18 18 18 18 + 20: TypePointer Function 6(float) + 22: TypeBool + 23: TypeVector 22(bool) 4 + 24: TypePointer Function 23(bvec4) + 81: TypePointer Function 13(PS_OUTPUT) + 83: TypeInt 32 1 + 84: 83(int) Constant 0 + 89: TypePointer Output 7(fvec4) +90(@entryPointOutput.Color): 89(ptr) Variable Output + 93($Global): TypeStruct 7(fvec4) + 94: TypePointer Uniform 93($Global) + 95: 94(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + 91:13(PS_OUTPUT) FunctionCall 15(@main() + 92: 7(fvec4) CompositeExtract 91 0 + Store 90(@entryPointOutput.Color) 92 + Return + FunctionEnd + 11(Bug1(vf4;): 2 Function None 9 + 10(a): 8(ptr) FunctionParameter + 12: Label + 17(v04): 8(ptr) Variable Function + 21(v01): 20(ptr) Variable Function + 25(r00): 24(ptr) Variable Function + 29(r01): 24(ptr) Variable Function + 33(r02): 24(ptr) Variable Function + 37(r03): 24(ptr) Variable Function + 41(r10): 24(ptr) Variable Function + 46(r11): 24(ptr) Variable Function + 51(r12): 24(ptr) Variable Function + 56(r13): 24(ptr) Variable Function + 61(r20): 24(ptr) Variable Function + 66(r21): 24(ptr) Variable Function + 71(r22): 24(ptr) Variable Function + 76(r23): 24(ptr) Variable Function + Store 17(v04) 19 + Store 21(v01) 18 + 26: 7(fvec4) Load 10(a) + 27: 7(fvec4) Load 17(v04) + 28: 23(bvec4) FOrdEqual 26 27 + Store 25(r00) 28 + 30: 7(fvec4) Load 10(a) + 31: 7(fvec4) Load 17(v04) + 32: 23(bvec4) FOrdNotEqual 30 31 + Store 29(r01) 32 + 34: 7(fvec4) Load 10(a) + 35: 7(fvec4) Load 17(v04) + 36: 23(bvec4) FOrdLessThan 34 35 + Store 33(r02) 36 + 38: 7(fvec4) Load 10(a) + 39: 7(fvec4) Load 17(v04) + 40: 23(bvec4) FOrdGreaterThan 38 39 + Store 37(r03) 40 + 42: 7(fvec4) Load 10(a) + 43: 6(float) Load 21(v01) + 44: 7(fvec4) CompositeConstruct 43 43 43 43 + 45: 23(bvec4) FOrdEqual 42 44 + Store 41(r10) 45 + 47: 7(fvec4) Load 10(a) + 48: 6(float) Load 21(v01) + 49: 7(fvec4) CompositeConstruct 48 48 48 48 + 50: 23(bvec4) FOrdNotEqual 47 49 + Store 46(r11) 50 + 52: 7(fvec4) Load 10(a) + 53: 6(float) Load 21(v01) + 54: 7(fvec4) CompositeConstruct 53 53 53 53 + 55: 23(bvec4) FOrdLessThan 52 54 + Store 51(r12) 55 + 57: 7(fvec4) Load 10(a) + 58: 6(float) Load 21(v01) + 59: 7(fvec4) CompositeConstruct 58 58 58 58 + 60: 23(bvec4) FOrdGreaterThan 57 59 + Store 56(r13) 60 + 62: 6(float) Load 21(v01) + 63: 7(fvec4) CompositeConstruct 62 62 62 62 + 64: 7(fvec4) Load 10(a) + 65: 23(bvec4) FOrdEqual 63 64 + Store 61(r20) 65 + 67: 6(float) Load 21(v01) + 68: 7(fvec4) CompositeConstruct 67 67 67 67 + 69: 7(fvec4) Load 10(a) + 70: 23(bvec4) FOrdNotEqual 68 69 + Store 66(r21) 70 + 72: 6(float) Load 21(v01) + 73: 7(fvec4) CompositeConstruct 72 72 72 72 + 74: 7(fvec4) Load 10(a) + 75: 23(bvec4) FOrdLessThan 73 74 + Store 71(r22) 75 + 77: 6(float) Load 21(v01) + 78: 7(fvec4) CompositeConstruct 77 77 77 77 + 79: 7(fvec4) Load 10(a) + 80: 23(bvec4) FOrdGreaterThan 78 79 + Store 76(r23) 80 + Return + FunctionEnd + 15(@main():13(PS_OUTPUT) Function None 14 + 16: Label + 82(psout): 81(ptr) Variable Function + 85: 8(ptr) AccessChain 82(psout) 84 + Store 85 19 + 86:13(PS_OUTPUT) Load 82(psout) + ReturnValue 86 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.conditional.frag.out b/deps/glslang/Test/baseResults/hlsl.conditional.frag.out new file mode 100644 index 00000000..90d9f79b --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.conditional.frag.out @@ -0,0 +1,797 @@ +hlsl.conditional.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: vectorCond( ( temp 4-component vector of float) +0:8 Function Parameters: +0:? Sequence +0:12 Branch: Return with expression +0:11 add ( temp 4-component vector of float) +0:10 add ( temp 4-component vector of float) +0:9 add ( temp 4-component vector of float) +0:9 mix ( temp 4-component vector of float) +0:9 f4: direct index for structure ( uniform 4-component vector of float) +0:9 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:9 Constant: +0:9 2 (const uint) +0:9 t4: direct index for structure ( uniform 4-component vector of float) +0:9 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:9 Constant: +0:9 1 (const uint) +0:9 Convert float to bool ( temp 4-component vector of bool) +0:9 c4: direct index for structure ( uniform 4-component vector of float) +0:9 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:9 Constant: +0:9 0 (const uint) +0:10 mix ( temp 4-component vector of float) +0:10 Construct vec4 ( temp 4-component vector of float) +0:10 f: direct index for structure ( uniform float) +0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:10 Constant: +0:10 4 (const uint) +0:10 Construct vec4 ( temp 4-component vector of float) +0:10 t: direct index for structure ( uniform float) +0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:10 Constant: +0:10 3 (const uint) +0:10 Convert float to bool ( temp 4-component vector of bool) +0:10 c4: direct index for structure ( uniform 4-component vector of float) +0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:10 Constant: +0:10 0 (const uint) +0:11 mix ( temp 4-component vector of float) +0:11 f4: direct index for structure ( uniform 4-component vector of float) +0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:11 Constant: +0:11 2 (const uint) +0:11 t4: direct index for structure ( uniform 4-component vector of float) +0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:11 Constant: +0:11 1 (const uint) +0:11 Compare Less Than ( temp 4-component vector of bool) +0:11 t4: direct index for structure ( uniform 4-component vector of float) +0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:11 Constant: +0:11 1 (const uint) +0:11 f4: direct index for structure ( uniform 4-component vector of float) +0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:11 Constant: +0:11 2 (const uint) +0:12 mix ( temp 4-component vector of float) +0:12 f4: direct index for structure ( uniform 4-component vector of float) +0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:12 Constant: +0:12 2 (const uint) +0:12 Construct vec4 ( temp 4-component vector of float) +0:12 t: direct index for structure ( uniform float) +0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:12 Constant: +0:12 3 (const uint) +0:12 Convert float to bool ( temp 4-component vector of bool) +0:12 c4: direct index for structure ( uniform 4-component vector of float) +0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:12 Constant: +0:12 0 (const uint) +0:16 Function Definition: scalarCond( ( temp 4-component vector of float) +0:16 Function Parameters: +0:? Sequence +0:17 Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:17 'ret' ( temp 4-component vector of float) +0:17 Test condition and select ( temp 4-component vector of float): no shortcircuit +0:17 Condition +0:17 Compare Not Equal ( temp bool) +0:17 t: direct index for structure ( uniform float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:17 Constant: +0:17 3 (const uint) +0:17 f: direct index for structure ( uniform float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:17 Constant: +0:17 4 (const uint) +0:17 true case +0:17 vector-scale ( temp 4-component vector of float) +0:17 t: direct index for structure ( uniform float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:17 Constant: +0:17 3 (const uint) +0:17 f4: direct index for structure ( uniform 4-component vector of float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:17 Constant: +0:17 2 (const uint) +0:17 false case +0:17 Constant: +0:17 1.000000 +0:17 1.000000 +0:17 1.000000 +0:17 1.000000 +0:18 Branch: Return with expression +0:18 'ret' ( temp 4-component vector of float) +0:22 Function Definition: fbSelect(vb2;vf2;vf2; ( temp 2-component vector of float) +0:22 Function Parameters: +0:22 'cnd' ( in 2-component vector of bool) +0:22 'src0' ( in 2-component vector of float) +0:22 'src1' ( in 2-component vector of float) +0:? Sequence +0:23 Branch: Return with expression +0:23 mix ( temp 2-component vector of float) +0:23 'src1' ( in 2-component vector of float) +0:23 'src0' ( in 2-component vector of float) +0:23 'cnd' ( in 2-component vector of bool) +0:27 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:27 Function Parameters: +0:27 'input' ( in 4-component vector of float) +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp int) +0:28 'a' ( temp int) +0:28 Constant: +0:28 5 (const int) +0:29 Sequence +0:29 move second child to first child ( temp int) +0:29 'b' ( temp int) +0:29 Constant: +0:29 6 (const int) +0:30 Sequence +0:30 move second child to first child ( temp int) +0:30 'c' ( temp int) +0:30 Constant: +0:30 7 (const int) +0:31 Sequence +0:31 move second child to first child ( temp int) +0:31 'd' ( temp int) +0:31 Constant: +0:31 7 (const int) +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of float) +0:32 'ret' ( temp 4-component vector of float) +0:34 add ( temp 4-component vector of float) +0:33 add ( temp 4-component vector of float) +0:32 add ( temp 4-component vector of float) +0:32 vector-scale ( temp 4-component vector of float) +0:32 Convert int to float ( temp float) +0:32 'a' ( temp int) +0:32 'input' ( in 4-component vector of float) +0:33 vector-scale ( temp 4-component vector of float) +0:33 Convert int to float ( temp float) +0:33 'b' ( temp int) +0:33 'input' ( in 4-component vector of float) +0:34 vector-scale ( temp 4-component vector of float) +0:34 Convert int to float ( temp float) +0:34 'c' ( temp int) +0:34 'input' ( in 4-component vector of float) +0:35 vector-scale ( temp 4-component vector of float) +0:35 Convert int to float ( temp float) +0:35 'd' ( temp int) +0:35 'input' ( in 4-component vector of float) +0:37 Comma ( temp int) +0:37 move second child to first child ( temp int) +0:37 'e' ( temp int) +0:37 move second child to first child ( temp int) +0:37 'a' ( temp int) +0:37 Test condition and select ( temp int): no shortcircuit +0:37 Condition +0:37 Convert int to bool ( temp bool) +0:37 'b' ( temp int) +0:37 true case +0:37 move second child to first child ( temp int) +0:37 'c' ( temp int) +0:37 'd' ( temp int) +0:37 false case +0:37 Constant: +0:37 10 (const int) +0:37 move second child to first child ( temp int) +0:37 'b' ( temp int) +0:37 Test condition and select ( temp int): no shortcircuit +0:37 Condition +0:37 Convert int to bool ( temp bool) +0:37 'a' ( temp int) +0:37 true case +0:37 move second child to first child ( temp int) +0:37 'd' ( temp int) +0:37 'c' ( temp int) +0:37 false case +0:37 Constant: +0:37 11 (const int) +0:39 move second child to first child ( temp 4-component vector of float) +0:39 'f' ( temp 4-component vector of float) +0:39 Test condition and select ( temp 4-component vector of float): no shortcircuit +0:39 Condition +0:39 Compare Less Than ( temp bool) +0:39 direct index ( temp float) +0:39 'ret' ( temp 4-component vector of float) +0:39 Constant: +0:39 0 (const int) +0:39 direct index ( temp float) +0:39 'input' ( in 4-component vector of float) +0:39 Constant: +0:39 1 (const int) +0:39 true case +0:39 vector-scale ( temp 4-component vector of float) +0:39 Convert int to float ( temp float) +0:39 'c' ( temp int) +0:39 'input' ( in 4-component vector of float) +0:39 false case +0:39 vector-scale ( temp 4-component vector of float) +0:39 Convert int to float ( temp float) +0:39 'd' ( temp int) +0:39 'input' ( in 4-component vector of float) +0:41 Branch: Return with expression +0:40 add ( temp 4-component vector of float) +0:40 add ( temp 4-component vector of float) +0:40 add ( temp 4-component vector of float) +0:40 add ( temp 4-component vector of float) +0:40 vector-scale ( temp 4-component vector of float) +0:40 Convert int to float ( temp float) +0:40 'e' ( temp int) +0:40 'ret' ( temp 4-component vector of float) +0:40 'f' ( temp 4-component vector of float) +0:40 Function Call: vectorCond( ( temp 4-component vector of float) +0:40 Function Call: scalarCond( ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:41 Function Call: fbSelect(vb2;vf2;vf2; ( temp 2-component vector of float) +0:? Constant: +0:? true (const bool) +0:? false (const bool) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? Constant: +0:? 3.000000 +0:? 4.000000 +0:41 Constant: +0:41 10.000000 +0:41 Constant: +0:41 10.000000 +0:27 Function Definition: PixelShaderFunction( ( temp void) +0:27 Function Parameters: +0:? Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:27 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:27 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: vectorCond( ( temp 4-component vector of float) +0:8 Function Parameters: +0:? Sequence +0:12 Branch: Return with expression +0:11 add ( temp 4-component vector of float) +0:10 add ( temp 4-component vector of float) +0:9 add ( temp 4-component vector of float) +0:9 mix ( temp 4-component vector of float) +0:9 f4: direct index for structure ( uniform 4-component vector of float) +0:9 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:9 Constant: +0:9 2 (const uint) +0:9 t4: direct index for structure ( uniform 4-component vector of float) +0:9 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:9 Constant: +0:9 1 (const uint) +0:9 Convert float to bool ( temp 4-component vector of bool) +0:9 c4: direct index for structure ( uniform 4-component vector of float) +0:9 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:9 Constant: +0:9 0 (const uint) +0:10 mix ( temp 4-component vector of float) +0:10 Construct vec4 ( temp 4-component vector of float) +0:10 f: direct index for structure ( uniform float) +0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:10 Constant: +0:10 4 (const uint) +0:10 Construct vec4 ( temp 4-component vector of float) +0:10 t: direct index for structure ( uniform float) +0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:10 Constant: +0:10 3 (const uint) +0:10 Convert float to bool ( temp 4-component vector of bool) +0:10 c4: direct index for structure ( uniform 4-component vector of float) +0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:10 Constant: +0:10 0 (const uint) +0:11 mix ( temp 4-component vector of float) +0:11 f4: direct index for structure ( uniform 4-component vector of float) +0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:11 Constant: +0:11 2 (const uint) +0:11 t4: direct index for structure ( uniform 4-component vector of float) +0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:11 Constant: +0:11 1 (const uint) +0:11 Compare Less Than ( temp 4-component vector of bool) +0:11 t4: direct index for structure ( uniform 4-component vector of float) +0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:11 Constant: +0:11 1 (const uint) +0:11 f4: direct index for structure ( uniform 4-component vector of float) +0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:11 Constant: +0:11 2 (const uint) +0:12 mix ( temp 4-component vector of float) +0:12 f4: direct index for structure ( uniform 4-component vector of float) +0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:12 Constant: +0:12 2 (const uint) +0:12 Construct vec4 ( temp 4-component vector of float) +0:12 t: direct index for structure ( uniform float) +0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:12 Constant: +0:12 3 (const uint) +0:12 Convert float to bool ( temp 4-component vector of bool) +0:12 c4: direct index for structure ( uniform 4-component vector of float) +0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:12 Constant: +0:12 0 (const uint) +0:16 Function Definition: scalarCond( ( temp 4-component vector of float) +0:16 Function Parameters: +0:? Sequence +0:17 Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:17 'ret' ( temp 4-component vector of float) +0:17 Test condition and select ( temp 4-component vector of float): no shortcircuit +0:17 Condition +0:17 Compare Not Equal ( temp bool) +0:17 t: direct index for structure ( uniform float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:17 Constant: +0:17 3 (const uint) +0:17 f: direct index for structure ( uniform float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:17 Constant: +0:17 4 (const uint) +0:17 true case +0:17 vector-scale ( temp 4-component vector of float) +0:17 t: direct index for structure ( uniform float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:17 Constant: +0:17 3 (const uint) +0:17 f4: direct index for structure ( uniform 4-component vector of float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:17 Constant: +0:17 2 (const uint) +0:17 false case +0:17 Constant: +0:17 1.000000 +0:17 1.000000 +0:17 1.000000 +0:17 1.000000 +0:18 Branch: Return with expression +0:18 'ret' ( temp 4-component vector of float) +0:22 Function Definition: fbSelect(vb2;vf2;vf2; ( temp 2-component vector of float) +0:22 Function Parameters: +0:22 'cnd' ( in 2-component vector of bool) +0:22 'src0' ( in 2-component vector of float) +0:22 'src1' ( in 2-component vector of float) +0:? Sequence +0:23 Branch: Return with expression +0:23 mix ( temp 2-component vector of float) +0:23 'src1' ( in 2-component vector of float) +0:23 'src0' ( in 2-component vector of float) +0:23 'cnd' ( in 2-component vector of bool) +0:27 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:27 Function Parameters: +0:27 'input' ( in 4-component vector of float) +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp int) +0:28 'a' ( temp int) +0:28 Constant: +0:28 5 (const int) +0:29 Sequence +0:29 move second child to first child ( temp int) +0:29 'b' ( temp int) +0:29 Constant: +0:29 6 (const int) +0:30 Sequence +0:30 move second child to first child ( temp int) +0:30 'c' ( temp int) +0:30 Constant: +0:30 7 (const int) +0:31 Sequence +0:31 move second child to first child ( temp int) +0:31 'd' ( temp int) +0:31 Constant: +0:31 7 (const int) +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of float) +0:32 'ret' ( temp 4-component vector of float) +0:34 add ( temp 4-component vector of float) +0:33 add ( temp 4-component vector of float) +0:32 add ( temp 4-component vector of float) +0:32 vector-scale ( temp 4-component vector of float) +0:32 Convert int to float ( temp float) +0:32 'a' ( temp int) +0:32 'input' ( in 4-component vector of float) +0:33 vector-scale ( temp 4-component vector of float) +0:33 Convert int to float ( temp float) +0:33 'b' ( temp int) +0:33 'input' ( in 4-component vector of float) +0:34 vector-scale ( temp 4-component vector of float) +0:34 Convert int to float ( temp float) +0:34 'c' ( temp int) +0:34 'input' ( in 4-component vector of float) +0:35 vector-scale ( temp 4-component vector of float) +0:35 Convert int to float ( temp float) +0:35 'd' ( temp int) +0:35 'input' ( in 4-component vector of float) +0:37 Comma ( temp int) +0:37 move second child to first child ( temp int) +0:37 'e' ( temp int) +0:37 move second child to first child ( temp int) +0:37 'a' ( temp int) +0:37 Test condition and select ( temp int): no shortcircuit +0:37 Condition +0:37 Convert int to bool ( temp bool) +0:37 'b' ( temp int) +0:37 true case +0:37 move second child to first child ( temp int) +0:37 'c' ( temp int) +0:37 'd' ( temp int) +0:37 false case +0:37 Constant: +0:37 10 (const int) +0:37 move second child to first child ( temp int) +0:37 'b' ( temp int) +0:37 Test condition and select ( temp int): no shortcircuit +0:37 Condition +0:37 Convert int to bool ( temp bool) +0:37 'a' ( temp int) +0:37 true case +0:37 move second child to first child ( temp int) +0:37 'd' ( temp int) +0:37 'c' ( temp int) +0:37 false case +0:37 Constant: +0:37 11 (const int) +0:39 move second child to first child ( temp 4-component vector of float) +0:39 'f' ( temp 4-component vector of float) +0:39 Test condition and select ( temp 4-component vector of float): no shortcircuit +0:39 Condition +0:39 Compare Less Than ( temp bool) +0:39 direct index ( temp float) +0:39 'ret' ( temp 4-component vector of float) +0:39 Constant: +0:39 0 (const int) +0:39 direct index ( temp float) +0:39 'input' ( in 4-component vector of float) +0:39 Constant: +0:39 1 (const int) +0:39 true case +0:39 vector-scale ( temp 4-component vector of float) +0:39 Convert int to float ( temp float) +0:39 'c' ( temp int) +0:39 'input' ( in 4-component vector of float) +0:39 false case +0:39 vector-scale ( temp 4-component vector of float) +0:39 Convert int to float ( temp float) +0:39 'd' ( temp int) +0:39 'input' ( in 4-component vector of float) +0:41 Branch: Return with expression +0:40 add ( temp 4-component vector of float) +0:40 add ( temp 4-component vector of float) +0:40 add ( temp 4-component vector of float) +0:40 add ( temp 4-component vector of float) +0:40 vector-scale ( temp 4-component vector of float) +0:40 Convert int to float ( temp float) +0:40 'e' ( temp int) +0:40 'ret' ( temp 4-component vector of float) +0:40 'f' ( temp 4-component vector of float) +0:40 Function Call: vectorCond( ( temp 4-component vector of float) +0:40 Function Call: scalarCond( ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:41 Function Call: fbSelect(vb2;vf2;vf2; ( temp 2-component vector of float) +0:? Constant: +0:? true (const bool) +0:? false (const bool) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? Constant: +0:? 3.000000 +0:? 4.000000 +0:41 Constant: +0:41 10.000000 +0:41 Constant: +0:41 10.000000 +0:27 Function Definition: PixelShaderFunction( ( temp void) +0:27 Function Parameters: +0:? Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:27 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:27 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 206 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 199 202 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 9 "vectorCond(" + Name 11 "scalarCond(" + Name 22 "fbSelect(vb2;vf2;vf2;" + Name 19 "cnd" + Name 20 "src0" + Name 21 "src1" + Name 27 "@PixelShaderFunction(vf4;" + Name 26 "input" + Name 29 "$Global" + MemberName 29($Global) 0 "c4" + MemberName 29($Global) 1 "t4" + MemberName 29($Global) 2 "f4" + MemberName 29($Global) 3 "t" + MemberName 29($Global) 4 "f" + Name 31 "" + Name 85 "ret" + Name 110 "a" + Name 112 "b" + Name 114 "c" + Name 116 "d" + Name 117 "ret" + Name 137 "e" + Name 150 "f" + Name 186 "param" + Name 187 "param" + Name 188 "param" + Name 197 "input" + Name 199 "input" + Name 202 "@entryPointOutput" + Name 203 "param" + MemberDecorate 29($Global) 0 Offset 0 + MemberDecorate 29($Global) 1 Offset 16 + MemberDecorate 29($Global) 2 Offset 32 + MemberDecorate 29($Global) 3 Offset 48 + MemberDecorate 29($Global) 4 Offset 52 + Decorate 29($Global) Block + Decorate 31 DescriptorSet 0 + Decorate 199(input) Location 0 + Decorate 202(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 13: TypeBool + 14: TypeVector 13(bool) 2 + 15: TypePointer Function 14(bvec2) + 16: TypeVector 6(float) 2 + 17: TypePointer Function 16(fvec2) + 18: TypeFunction 16(fvec2) 15(ptr) 17(ptr) 17(ptr) + 24: TypePointer Function 7(fvec4) + 25: TypeFunction 7(fvec4) 24(ptr) + 29($Global): TypeStruct 7(fvec4) 7(fvec4) 7(fvec4) 6(float) 6(float) + 30: TypePointer Uniform 29($Global) + 31: 30(ptr) Variable Uniform + 32: TypeInt 32 1 + 33: 32(int) Constant 2 + 34: TypePointer Uniform 7(fvec4) + 37: 32(int) Constant 1 + 40: 32(int) Constant 0 + 43: TypeVector 13(bool) 4 + 44: 6(float) Constant 0 + 45: 7(fvec4) ConstantComposite 44 44 44 44 + 48: 32(int) Constant 4 + 49: TypePointer Uniform 6(float) + 53: 32(int) Constant 3 + 96: 6(float) Constant 1065353216 + 97: 7(fvec4) ConstantComposite 96 96 96 96 + 109: TypePointer Function 32(int) + 111: 32(int) Constant 5 + 113: 32(int) Constant 6 + 115: 32(int) Constant 7 + 139: TypeInt 32 0 + 140: 139(int) Constant 0 + 143: 32(int) Constant 10 + 148: 32(int) Constant 11 + 151: TypePointer Function 6(float) + 154: 139(int) Constant 1 + 178: 13(bool) ConstantTrue + 179: 13(bool) ConstantFalse + 180: 14(bvec2) ConstantComposite 178 179 + 181: 6(float) Constant 1073741824 + 182: 16(fvec2) ConstantComposite 96 181 + 183: 6(float) Constant 1077936128 + 184: 6(float) Constant 1082130432 + 185: 16(fvec2) ConstantComposite 183 184 + 190: 6(float) Constant 1092616192 + 198: TypePointer Input 7(fvec4) + 199(input): 198(ptr) Variable Input + 201: TypePointer Output 7(fvec4) +202(@entryPointOutput): 201(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 197(input): 24(ptr) Variable Function + 203(param): 24(ptr) Variable Function + 200: 7(fvec4) Load 199(input) + Store 197(input) 200 + 204: 7(fvec4) Load 197(input) + Store 203(param) 204 + 205: 7(fvec4) FunctionCall 27(@PixelShaderFunction(vf4;) 203(param) + Store 202(@entryPointOutput) 205 + Return + FunctionEnd + 9(vectorCond(): 7(fvec4) Function None 8 + 10: Label + 35: 34(ptr) AccessChain 31 33 + 36: 7(fvec4) Load 35 + 38: 34(ptr) AccessChain 31 37 + 39: 7(fvec4) Load 38 + 41: 34(ptr) AccessChain 31 40 + 42: 7(fvec4) Load 41 + 46: 43(bvec4) FOrdNotEqual 42 45 + 47: 7(fvec4) Select 46 39 36 + 50: 49(ptr) AccessChain 31 48 + 51: 6(float) Load 50 + 52: 7(fvec4) CompositeConstruct 51 51 51 51 + 54: 49(ptr) AccessChain 31 53 + 55: 6(float) Load 54 + 56: 7(fvec4) CompositeConstruct 55 55 55 55 + 57: 34(ptr) AccessChain 31 40 + 58: 7(fvec4) Load 57 + 59: 43(bvec4) FOrdNotEqual 58 45 + 60: 7(fvec4) Select 59 56 52 + 61: 7(fvec4) FAdd 47 60 + 62: 34(ptr) AccessChain 31 33 + 63: 7(fvec4) Load 62 + 64: 34(ptr) AccessChain 31 37 + 65: 7(fvec4) Load 64 + 66: 34(ptr) AccessChain 31 37 + 67: 7(fvec4) Load 66 + 68: 34(ptr) AccessChain 31 33 + 69: 7(fvec4) Load 68 + 70: 43(bvec4) FOrdLessThan 67 69 + 71: 7(fvec4) Select 70 65 63 + 72: 7(fvec4) FAdd 61 71 + 73: 34(ptr) AccessChain 31 33 + 74: 7(fvec4) Load 73 + 75: 49(ptr) AccessChain 31 53 + 76: 6(float) Load 75 + 77: 7(fvec4) CompositeConstruct 76 76 76 76 + 78: 34(ptr) AccessChain 31 40 + 79: 7(fvec4) Load 78 + 80: 43(bvec4) FOrdNotEqual 79 45 + 81: 7(fvec4) Select 80 77 74 + 82: 7(fvec4) FAdd 72 81 + ReturnValue 82 + FunctionEnd + 11(scalarCond(): 7(fvec4) Function None 8 + 12: Label + 85(ret): 24(ptr) Variable Function + 86: 49(ptr) AccessChain 31 53 + 87: 6(float) Load 86 + 88: 49(ptr) AccessChain 31 48 + 89: 6(float) Load 88 + 90: 13(bool) FOrdNotEqual 87 89 + 91: 49(ptr) AccessChain 31 53 + 92: 6(float) Load 91 + 93: 34(ptr) AccessChain 31 33 + 94: 7(fvec4) Load 93 + 95: 7(fvec4) VectorTimesScalar 94 92 + 98: 43(bvec4) CompositeConstruct 90 90 90 90 + 99: 7(fvec4) Select 98 95 97 + Store 85(ret) 99 + 100: 7(fvec4) Load 85(ret) + ReturnValue 100 + FunctionEnd +22(fbSelect(vb2;vf2;vf2;): 16(fvec2) Function None 18 + 19(cnd): 15(ptr) FunctionParameter + 20(src0): 17(ptr) FunctionParameter + 21(src1): 17(ptr) FunctionParameter + 23: Label + 103: 16(fvec2) Load 21(src1) + 104: 16(fvec2) Load 20(src0) + 105: 14(bvec2) Load 19(cnd) + 106: 16(fvec2) Select 105 104 103 + ReturnValue 106 + FunctionEnd +27(@PixelShaderFunction(vf4;): 7(fvec4) Function None 25 + 26(input): 24(ptr) FunctionParameter + 28: Label + 110(a): 109(ptr) Variable Function + 112(b): 109(ptr) Variable Function + 114(c): 109(ptr) Variable Function + 116(d): 109(ptr) Variable Function + 117(ret): 24(ptr) Variable Function + 137(e): 109(ptr) Variable Function + 150(f): 24(ptr) Variable Function + 186(param): 15(ptr) Variable Function + 187(param): 17(ptr) Variable Function + 188(param): 17(ptr) Variable Function + Store 110(a) 111 + Store 112(b) 113 + Store 114(c) 115 + Store 116(d) 115 + 118: 32(int) Load 110(a) + 119: 6(float) ConvertSToF 118 + 120: 7(fvec4) Load 26(input) + 121: 7(fvec4) VectorTimesScalar 120 119 + 122: 32(int) Load 112(b) + 123: 6(float) ConvertSToF 122 + 124: 7(fvec4) Load 26(input) + 125: 7(fvec4) VectorTimesScalar 124 123 + 126: 7(fvec4) FAdd 121 125 + 127: 32(int) Load 114(c) + 128: 6(float) ConvertSToF 127 + 129: 7(fvec4) Load 26(input) + 130: 7(fvec4) VectorTimesScalar 129 128 + 131: 7(fvec4) FAdd 126 130 + 132: 32(int) Load 116(d) + 133: 6(float) ConvertSToF 132 + 134: 7(fvec4) Load 26(input) + 135: 7(fvec4) VectorTimesScalar 134 133 + 136: 7(fvec4) FAdd 131 135 + Store 117(ret) 136 + 138: 32(int) Load 112(b) + 141: 13(bool) INotEqual 138 140 + 142: 32(int) Load 116(d) + Store 114(c) 142 + 144: 32(int) Select 141 142 143 + Store 110(a) 144 + Store 137(e) 144 + 145: 32(int) Load 110(a) + 146: 13(bool) INotEqual 145 140 + 147: 32(int) Load 114(c) + Store 116(d) 147 + 149: 32(int) Select 146 147 148 + Store 112(b) 149 + 152: 151(ptr) AccessChain 117(ret) 140 + 153: 6(float) Load 152 + 155: 151(ptr) AccessChain 26(input) 154 + 156: 6(float) Load 155 + 157: 13(bool) FOrdLessThan 153 156 + 158: 32(int) Load 114(c) + 159: 6(float) ConvertSToF 158 + 160: 7(fvec4) Load 26(input) + 161: 7(fvec4) VectorTimesScalar 160 159 + 162: 32(int) Load 116(d) + 163: 6(float) ConvertSToF 162 + 164: 7(fvec4) Load 26(input) + 165: 7(fvec4) VectorTimesScalar 164 163 + 166: 43(bvec4) CompositeConstruct 157 157 157 157 + 167: 7(fvec4) Select 166 161 165 + Store 150(f) 167 + 168: 32(int) Load 137(e) + 169: 6(float) ConvertSToF 168 + 170: 7(fvec4) Load 117(ret) + 171: 7(fvec4) VectorTimesScalar 170 169 + 172: 7(fvec4) Load 150(f) + 173: 7(fvec4) FAdd 171 172 + 174: 7(fvec4) FunctionCall 9(vectorCond() + 175: 7(fvec4) FAdd 173 174 + 176: 7(fvec4) FunctionCall 11(scalarCond() + 177: 7(fvec4) FAdd 175 176 + Store 186(param) 180 + Store 187(param) 182 + Store 188(param) 185 + 189: 16(fvec2) FunctionCall 22(fbSelect(vb2;vf2;vf2;) 186(param) 187(param) 188(param) + 191: 6(float) CompositeExtract 189 0 + 192: 6(float) CompositeExtract 189 1 + 193: 7(fvec4) CompositeConstruct 191 192 190 190 + 194: 7(fvec4) FAdd 177 193 + ReturnValue 194 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.constantbuffer.frag.out b/deps/glslang/Test/baseResults/hlsl.constantbuffer.frag.out new file mode 100644 index 00000000..4185ea95 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.constantbuffer.frag.out @@ -0,0 +1,245 @@ +hlsl.constantbuffer.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:20 Function Definition: @main( ( temp 4-component vector of float) +0:20 Function Parameters: +0:? Sequence +0:21 Test condition and select ( temp void) +0:21 Condition +0:21 x: direct index for structure (layout( row_major std140) uniform bool) +0:21 direct index (layout( row_major std140) temp block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y}) +0:21 direct index (layout( row_major std140) temp 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y}) +0:21 'cb3' (layout( row_major std140) uniform 2-element array of 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y}) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 2 (const int) +0:21 Constant: +0:21 0 (const int) +0:21 true case +0:22 Branch: Return with expression +0:22 add ( temp 4-component vector of float) +0:22 add ( temp 4-component vector of float) +0:22 x: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:22 'cb1' (layout( binding=12 row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float x}) +0:22 Constant: +0:22 0 (const int) +0:22 y: direct index for structure (layout( row_major std140) uniform float) +0:22 direct index (layout( row_major std140) temp block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y}) +0:22 'cb2' (layout( row_major std140) uniform 3-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y}) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Convert int to float ( temp float) +0:22 c1: direct index for structure (layout( row_major std140) uniform int) +0:22 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform int c1}) +0:22 Constant: +0:22 0 (const uint) +0:21 false case +0:24 Branch: Return with expression +0:24 Construct vec4 ( temp 4-component vector of float) +0:24 y: direct index for structure (layout( row_major std140) uniform float) +0:24 direct index (layout( row_major std140) temp block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y}) +0:24 direct index (layout( row_major std140) temp 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y}) +0:24 'cb3' (layout( row_major std140) uniform 2-element array of 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y}) +0:24 Constant: +0:24 1 (const int) +0:24 Constant: +0:24 3 (const int) +0:24 Constant: +0:24 1 (const int) +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:20 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'cb1' (layout( binding=12 row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float x}) +0:? 'cb2' (layout( row_major std140) uniform 3-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y}) +0:? 'cb3' (layout( row_major std140) uniform 2-element array of 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y}) +0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform int c1}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:20 Function Definition: @main( ( temp 4-component vector of float) +0:20 Function Parameters: +0:? Sequence +0:21 Test condition and select ( temp void) +0:21 Condition +0:21 x: direct index for structure (layout( row_major std140) uniform bool) +0:21 direct index (layout( row_major std140) temp block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y}) +0:21 direct index (layout( row_major std140) temp 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y}) +0:21 'cb3' (layout( row_major std140) uniform 2-element array of 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y}) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 2 (const int) +0:21 Constant: +0:21 0 (const int) +0:21 true case +0:22 Branch: Return with expression +0:22 add ( temp 4-component vector of float) +0:22 add ( temp 4-component vector of float) +0:22 x: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:22 'cb1' (layout( binding=12 row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float x}) +0:22 Constant: +0:22 0 (const int) +0:22 y: direct index for structure (layout( row_major std140) uniform float) +0:22 direct index (layout( row_major std140) temp block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y}) +0:22 'cb2' (layout( row_major std140) uniform 3-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y}) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Convert int to float ( temp float) +0:22 c1: direct index for structure (layout( row_major std140) uniform int) +0:22 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform int c1}) +0:22 Constant: +0:22 0 (const uint) +0:21 false case +0:24 Branch: Return with expression +0:24 Construct vec4 ( temp 4-component vector of float) +0:24 y: direct index for structure (layout( row_major std140) uniform float) +0:24 direct index (layout( row_major std140) temp block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y}) +0:24 direct index (layout( row_major std140) temp 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y}) +0:24 'cb3' (layout( row_major std140) uniform 2-element array of 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y}) +0:24 Constant: +0:24 1 (const int) +0:24 Constant: +0:24 3 (const int) +0:24 Constant: +0:24 1 (const int) +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:20 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'cb1' (layout( binding=12 row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float x}) +0:? 'cb2' (layout( row_major std140) uniform 3-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y}) +0:? 'cb3' (layout( row_major std140) uniform 2-element array of 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y}) +0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform int c1}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: Only a single level of array is allowed for descriptor set variables + %cb3_0 = OpVariable %_ptr_Uniform__arr__arr_cb3_uint_4_uint_2 Uniform + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 66 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 64 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 12 "cb3" + MemberName 12(cb3) 0 "x" + MemberName 12(cb3) 1 "y" + Name 18 "cb3" + Name 31 "cb1" + MemberName 31(cb1) 0 "x" + Name 33 "cb1" + Name 40 "cb2" + Name 46 "cbuff" + MemberName 46(cbuff) 0 "c1" + Name 48 "" + Name 64 "@entryPointOutput" + MemberDecorate 12(cb3) 0 Offset 0 + MemberDecorate 12(cb3) 1 Offset 4 + Decorate 12(cb3) Block + Decorate 18(cb3) DescriptorSet 0 + MemberDecorate 31(cb1) 0 Offset 0 + Decorate 31(cb1) Block + Decorate 33(cb1) DescriptorSet 0 + Decorate 33(cb1) Binding 12 + Decorate 40(cb2) DescriptorSet 0 + MemberDecorate 46(cbuff) 0 Offset 0 + Decorate 46(cbuff) Block + Decorate 48 DescriptorSet 0 + Decorate 64(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeInt 32 0 + 12(cb3): TypeStruct 11(int) 6(float) + 13: 11(int) Constant 4 + 14: TypeArray 12(cb3) 13 + 15: 11(int) Constant 2 + 16: TypeArray 14 15 + 17: TypePointer Uniform 16 + 18(cb3): 17(ptr) Variable Uniform + 19: TypeInt 32 1 + 20: 19(int) Constant 1 + 21: 19(int) Constant 2 + 22: 19(int) Constant 0 + 23: TypePointer Uniform 11(int) + 26: TypeBool + 27: 11(int) Constant 0 + 31(cb1): TypeStruct 7(fvec4) + 32: TypePointer Uniform 31(cb1) + 33(cb1): 32(ptr) Variable Uniform + 34: TypePointer Uniform 7(fvec4) + 37: 11(int) Constant 3 + 38: TypeArray 12(cb3) 37 + 39: TypePointer Uniform 38 + 40(cb2): 39(ptr) Variable Uniform + 41: TypePointer Uniform 6(float) + 46(cbuff): TypeStruct 19(int) + 47: TypePointer Uniform 46(cbuff) + 48: 47(ptr) Variable Uniform + 49: TypePointer Uniform 19(int) + 57: 19(int) Constant 3 + 63: TypePointer Output 7(fvec4) +64(@entryPointOutput): 63(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 65: 7(fvec4) FunctionCall 9(@main() + Store 64(@entryPointOutput) 65 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 24: 23(ptr) AccessChain 18(cb3) 20 21 22 + 25: 11(int) Load 24 + 28: 26(bool) INotEqual 25 27 + SelectionMerge 30 None + BranchConditional 28 29 56 + 29: Label + 35: 34(ptr) AccessChain 33(cb1) 22 + 36: 7(fvec4) Load 35 + 42: 41(ptr) AccessChain 40(cb2) 20 20 + 43: 6(float) Load 42 + 44: 7(fvec4) CompositeConstruct 43 43 43 43 + 45: 7(fvec4) FAdd 36 44 + 50: 49(ptr) AccessChain 48 22 + 51: 19(int) Load 50 + 52: 6(float) ConvertSToF 51 + 53: 7(fvec4) CompositeConstruct 52 52 52 52 + 54: 7(fvec4) FAdd 45 53 + ReturnValue 54 + 56: Label + 58: 41(ptr) AccessChain 18(cb3) 20 57 20 + 59: 6(float) Load 58 + 60: 7(fvec4) CompositeConstruct 59 59 59 59 + ReturnValue 60 + 30: Label + 62: 7(fvec4) Undef + ReturnValue 62 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.constructArray.vert.out b/deps/glslang/Test/baseResults/hlsl.constructArray.vert.out new file mode 100644 index 00000000..6e18ad97 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.constructArray.vert.out @@ -0,0 +1,381 @@ +hlsl.constructArray.vert +Shader version: 500 +0:? Sequence +0:2 Function Definition: @main( ( temp 4-component vector of float) +0:2 Function Parameters: +0:? Sequence +0:4 Sequence +0:4 move second child to first child ( temp 2-element array of 4-component vector of float) +0:4 'float4_array_times' ( temp 2-element array of 4-component vector of float) +0:4 Construct structure ( temp 2-element array of 4-component vector of float) +0:4 Convert int to float ( temp 4-component vector of float) +0:4 direct index ( temp 4-component vector of int) +0:4 'int4_array' ( temp 3-element array of 4-component vector of int) +0:4 Constant: +0:4 0 (const int) +0:4 Convert int to float ( temp 4-component vector of float) +0:4 direct index ( temp 4-component vector of int) +0:4 'int4_array' ( temp 3-element array of 4-component vector of int) +0:4 Constant: +0:4 1 (const int) +0:5 Sequence +0:5 move second child to first child ( temp 4-element array of 2-component vector of float) +0:5 'float2_array_times2' ( temp 4-element array of 2-component vector of float) +0:5 Construct structure ( temp 4-element array of 2-component vector of float) +0:5 Convert int to float ( temp 2-component vector of float) +0:5 Construct ivec2 ( temp 2-component vector of int) +0:5 direct index ( temp int) +0:5 direct index ( temp 4-component vector of int) +0:5 'int4_array' ( temp 3-element array of 4-component vector of int) +0:5 Constant: +0:5 0 (const int) +0:5 Constant: +0:5 0 (const int) +0:5 direct index ( temp int) +0:5 direct index ( temp 4-component vector of int) +0:5 'int4_array' ( temp 3-element array of 4-component vector of int) +0:5 Constant: +0:5 0 (const int) +0:5 Constant: +0:5 1 (const int) +0:5 Convert int to float ( temp 2-component vector of float) +0:5 Construct ivec2 ( temp 2-component vector of int) +0:5 direct index ( temp int) +0:5 direct index ( temp 4-component vector of int) +0:5 'int4_array' ( temp 3-element array of 4-component vector of int) +0:5 Constant: +0:5 0 (const int) +0:5 Constant: +0:5 2 (const int) +0:5 direct index ( temp int) +0:5 direct index ( temp 4-component vector of int) +0:5 'int4_array' ( temp 3-element array of 4-component vector of int) +0:5 Constant: +0:5 0 (const int) +0:5 Constant: +0:5 3 (const int) +0:5 Convert int to float ( temp 2-component vector of float) +0:5 Construct ivec2 ( temp 2-component vector of int) +0:5 direct index ( temp int) +0:5 direct index ( temp 4-component vector of int) +0:5 'int4_array' ( temp 3-element array of 4-component vector of int) +0:5 Constant: +0:5 1 (const int) +0:5 Constant: +0:5 0 (const int) +0:5 direct index ( temp int) +0:5 direct index ( temp 4-component vector of int) +0:5 'int4_array' ( temp 3-element array of 4-component vector of int) +0:5 Constant: +0:5 1 (const int) +0:5 Constant: +0:5 1 (const int) +0:5 Convert int to float ( temp 2-component vector of float) +0:5 Construct ivec2 ( temp 2-component vector of int) +0:5 direct index ( temp int) +0:5 direct index ( temp 4-component vector of int) +0:5 'int4_array' ( temp 3-element array of 4-component vector of int) +0:5 Constant: +0:5 1 (const int) +0:5 Constant: +0:5 2 (const int) +0:5 direct index ( temp int) +0:5 direct index ( temp 4-component vector of int) +0:5 'int4_array' ( temp 3-element array of 4-component vector of int) +0:5 Constant: +0:5 1 (const int) +0:5 Constant: +0:5 3 (const int) +0:6 Sequence +0:6 move second child to first child ( temp 2-element array of 4-component vector of int) +0:6 'int4_array2' ( temp 2-element array of 4-component vector of int) +0:6 Construct structure ( temp 2-element array of 4-component vector of int) +0:6 direct index ( temp 4-component vector of int) +0:6 'int4_array' ( temp 3-element array of 4-component vector of int) +0:6 Constant: +0:6 0 (const int) +0:6 direct index ( temp 4-component vector of int) +0:6 'int4_array' ( temp 3-element array of 4-component vector of int) +0:6 Constant: +0:6 1 (const int) +0:7 Sequence +0:7 move second child to first child ( temp 2-element array of int) +0:7 'int1_array' ( temp 2-element array of int) +0:7 Construct structure ( temp 2-element array of int) +0:7 direct index ( temp int) +0:7 direct index ( temp 4-component vector of int) +0:7 'int4_array' ( temp 3-element array of 4-component vector of int) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 direct index ( temp int) +0:7 direct index ( temp 4-component vector of int) +0:7 'int4_array' ( temp 3-element array of 4-component vector of int) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 1 (const int) +0:9 Branch: Return with expression +0:9 Constant: +0:9 0.000000 +0:9 0.000000 +0:9 0.000000 +0:9 0.000000 +0:2 Function Definition: main( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:2 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' ( out 4-component vector of float Position) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:2 Function Definition: @main( ( temp 4-component vector of float) +0:2 Function Parameters: +0:? Sequence +0:4 Sequence +0:4 move second child to first child ( temp 2-element array of 4-component vector of float) +0:4 'float4_array_times' ( temp 2-element array of 4-component vector of float) +0:4 Construct structure ( temp 2-element array of 4-component vector of float) +0:4 Convert int to float ( temp 4-component vector of float) +0:4 direct index ( temp 4-component vector of int) +0:4 'int4_array' ( temp 3-element array of 4-component vector of int) +0:4 Constant: +0:4 0 (const int) +0:4 Convert int to float ( temp 4-component vector of float) +0:4 direct index ( temp 4-component vector of int) +0:4 'int4_array' ( temp 3-element array of 4-component vector of int) +0:4 Constant: +0:4 1 (const int) +0:5 Sequence +0:5 move second child to first child ( temp 4-element array of 2-component vector of float) +0:5 'float2_array_times2' ( temp 4-element array of 2-component vector of float) +0:5 Construct structure ( temp 4-element array of 2-component vector of float) +0:5 Convert int to float ( temp 2-component vector of float) +0:5 Construct ivec2 ( temp 2-component vector of int) +0:5 direct index ( temp int) +0:5 direct index ( temp 4-component vector of int) +0:5 'int4_array' ( temp 3-element array of 4-component vector of int) +0:5 Constant: +0:5 0 (const int) +0:5 Constant: +0:5 0 (const int) +0:5 direct index ( temp int) +0:5 direct index ( temp 4-component vector of int) +0:5 'int4_array' ( temp 3-element array of 4-component vector of int) +0:5 Constant: +0:5 0 (const int) +0:5 Constant: +0:5 1 (const int) +0:5 Convert int to float ( temp 2-component vector of float) +0:5 Construct ivec2 ( temp 2-component vector of int) +0:5 direct index ( temp int) +0:5 direct index ( temp 4-component vector of int) +0:5 'int4_array' ( temp 3-element array of 4-component vector of int) +0:5 Constant: +0:5 0 (const int) +0:5 Constant: +0:5 2 (const int) +0:5 direct index ( temp int) +0:5 direct index ( temp 4-component vector of int) +0:5 'int4_array' ( temp 3-element array of 4-component vector of int) +0:5 Constant: +0:5 0 (const int) +0:5 Constant: +0:5 3 (const int) +0:5 Convert int to float ( temp 2-component vector of float) +0:5 Construct ivec2 ( temp 2-component vector of int) +0:5 direct index ( temp int) +0:5 direct index ( temp 4-component vector of int) +0:5 'int4_array' ( temp 3-element array of 4-component vector of int) +0:5 Constant: +0:5 1 (const int) +0:5 Constant: +0:5 0 (const int) +0:5 direct index ( temp int) +0:5 direct index ( temp 4-component vector of int) +0:5 'int4_array' ( temp 3-element array of 4-component vector of int) +0:5 Constant: +0:5 1 (const int) +0:5 Constant: +0:5 1 (const int) +0:5 Convert int to float ( temp 2-component vector of float) +0:5 Construct ivec2 ( temp 2-component vector of int) +0:5 direct index ( temp int) +0:5 direct index ( temp 4-component vector of int) +0:5 'int4_array' ( temp 3-element array of 4-component vector of int) +0:5 Constant: +0:5 1 (const int) +0:5 Constant: +0:5 2 (const int) +0:5 direct index ( temp int) +0:5 direct index ( temp 4-component vector of int) +0:5 'int4_array' ( temp 3-element array of 4-component vector of int) +0:5 Constant: +0:5 1 (const int) +0:5 Constant: +0:5 3 (const int) +0:6 Sequence +0:6 move second child to first child ( temp 2-element array of 4-component vector of int) +0:6 'int4_array2' ( temp 2-element array of 4-component vector of int) +0:6 Construct structure ( temp 2-element array of 4-component vector of int) +0:6 direct index ( temp 4-component vector of int) +0:6 'int4_array' ( temp 3-element array of 4-component vector of int) +0:6 Constant: +0:6 0 (const int) +0:6 direct index ( temp 4-component vector of int) +0:6 'int4_array' ( temp 3-element array of 4-component vector of int) +0:6 Constant: +0:6 1 (const int) +0:7 Sequence +0:7 move second child to first child ( temp 2-element array of int) +0:7 'int1_array' ( temp 2-element array of int) +0:7 Construct structure ( temp 2-element array of int) +0:7 direct index ( temp int) +0:7 direct index ( temp 4-component vector of int) +0:7 'int4_array' ( temp 3-element array of 4-component vector of int) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 direct index ( temp int) +0:7 direct index ( temp 4-component vector of int) +0:7 'int4_array' ( temp 3-element array of 4-component vector of int) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 1 (const int) +0:9 Branch: Return with expression +0:9 Constant: +0:9 0.000000 +0:9 0.000000 +0:9 0.000000 +0:9 0.000000 +0:2 Function Definition: main( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:2 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' ( out 4-component vector of float Position) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 89 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 87 + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 15 "float4_array_times" + Name 21 "int4_array" + Name 36 "float2_array_times2" + Name 68 "int4_array2" + Name 76 "int1_array" + Name 87 "@entryPointOutput" + Decorate 87(@entryPointOutput) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeInt 32 0 + 12: 11(int) Constant 2 + 13: TypeArray 7(fvec4) 12 + 14: TypePointer Function 13 + 16: TypeInt 32 1 + 17: TypeVector 16(int) 4 + 18: 11(int) Constant 3 + 19: TypeArray 17(ivec4) 18 + 20: TypePointer Function 19 + 22: 16(int) Constant 0 + 23: TypePointer Function 17(ivec4) + 27: 16(int) Constant 1 + 32: TypeVector 6(float) 2 + 33: 11(int) Constant 4 + 34: TypeArray 32(fvec2) 33 + 35: TypePointer Function 34 + 37: 11(int) Constant 0 + 38: TypePointer Function 16(int) + 41: 11(int) Constant 1 + 44: TypeVector 16(int) 2 + 66: TypeArray 17(ivec4) 12 + 67: TypePointer Function 66 + 74: TypeArray 16(int) 12 + 75: TypePointer Function 74 + 82: 6(float) Constant 0 + 83: 7(fvec4) ConstantComposite 82 82 82 82 + 86: TypePointer Output 7(fvec4) +87(@entryPointOutput): 86(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 88: 7(fvec4) FunctionCall 9(@main() + Store 87(@entryPointOutput) 88 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label +15(float4_array_times): 14(ptr) Variable Function + 21(int4_array): 20(ptr) Variable Function +36(float2_array_times2): 35(ptr) Variable Function + 68(int4_array2): 67(ptr) Variable Function + 76(int1_array): 75(ptr) Variable Function + 24: 23(ptr) AccessChain 21(int4_array) 22 + 25: 17(ivec4) Load 24 + 26: 7(fvec4) ConvertSToF 25 + 28: 23(ptr) AccessChain 21(int4_array) 27 + 29: 17(ivec4) Load 28 + 30: 7(fvec4) ConvertSToF 29 + 31: 13 CompositeConstruct 26 30 + Store 15(float4_array_times) 31 + 39: 38(ptr) AccessChain 21(int4_array) 22 37 + 40: 16(int) Load 39 + 42: 38(ptr) AccessChain 21(int4_array) 22 41 + 43: 16(int) Load 42 + 45: 44(ivec2) CompositeConstruct 40 43 + 46: 32(fvec2) ConvertSToF 45 + 47: 38(ptr) AccessChain 21(int4_array) 22 12 + 48: 16(int) Load 47 + 49: 38(ptr) AccessChain 21(int4_array) 22 18 + 50: 16(int) Load 49 + 51: 44(ivec2) CompositeConstruct 48 50 + 52: 32(fvec2) ConvertSToF 51 + 53: 38(ptr) AccessChain 21(int4_array) 27 37 + 54: 16(int) Load 53 + 55: 38(ptr) AccessChain 21(int4_array) 27 41 + 56: 16(int) Load 55 + 57: 44(ivec2) CompositeConstruct 54 56 + 58: 32(fvec2) ConvertSToF 57 + 59: 38(ptr) AccessChain 21(int4_array) 27 12 + 60: 16(int) Load 59 + 61: 38(ptr) AccessChain 21(int4_array) 27 18 + 62: 16(int) Load 61 + 63: 44(ivec2) CompositeConstruct 60 62 + 64: 32(fvec2) ConvertSToF 63 + 65: 34 CompositeConstruct 46 52 58 64 + Store 36(float2_array_times2) 65 + 69: 23(ptr) AccessChain 21(int4_array) 22 + 70: 17(ivec4) Load 69 + 71: 23(ptr) AccessChain 21(int4_array) 27 + 72: 17(ivec4) Load 71 + 73: 66 CompositeConstruct 70 72 + Store 68(int4_array2) 73 + 77: 38(ptr) AccessChain 21(int4_array) 22 37 + 78: 16(int) Load 77 + 79: 38(ptr) AccessChain 21(int4_array) 22 41 + 80: 16(int) Load 79 + 81: 74 CompositeConstruct 78 80 + Store 76(int1_array) 81 + ReturnValue 83 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.constructexpr.frag.out b/deps/glslang/Test/baseResults/hlsl.constructexpr.frag.out new file mode 100644 index 00000000..227c7e17 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.constructexpr.frag.out @@ -0,0 +1,164 @@ +hlsl.constructexpr.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:4 Function Parameters: +0:? Sequence +0:6 Constant: +0:6 3 (const int) +0:7 Constant: +0:7 4 (const int) +0:8 Constant: +0:8 5 (const int) +0:9 Constant: +0:9 6 (const int) +0:10 Constant: +0:10 7 (const int) +0:11 Constant: +0:11 8 (const int) +0:12 Comma ( temp 2-component vector of float) +0:? Constant: +0:? 9.000000 +0:? 10.000000 +0:? Constant: +0:? 11.000000 +0:? 12.000000 +0:15 move second child to first child ( temp 4-component vector of float) +0:15 color: direct index for structure ( temp 4-component vector of float) +0:15 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 1.000000 +0:15 1.000000 +0:15 1.000000 +0:15 1.000000 +0:16 Branch: Return with expression +0:16 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 Sequence +0:4 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:4 color: direct index for structure ( temp 4-component vector of float) +0:4 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:4 Constant: +0:4 0 (const int) +0:? Linker Objects +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:4 Function Parameters: +0:? Sequence +0:6 Constant: +0:6 3 (const int) +0:7 Constant: +0:7 4 (const int) +0:8 Constant: +0:8 5 (const int) +0:9 Constant: +0:9 6 (const int) +0:10 Constant: +0:10 7 (const int) +0:11 Constant: +0:11 8 (const int) +0:12 Comma ( temp 2-component vector of float) +0:? Constant: +0:? 9.000000 +0:? 10.000000 +0:? Constant: +0:? 11.000000 +0:? 12.000000 +0:15 move second child to first child ( temp 4-component vector of float) +0:15 color: direct index for structure ( temp 4-component vector of float) +0:15 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 1.000000 +0:15 1.000000 +0:15 1.000000 +0:15 1.000000 +0:16 Branch: Return with expression +0:16 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 Sequence +0:4 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:4 color: direct index for structure ( temp 4-component vector of float) +0:4 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:4 Constant: +0:4 0 (const int) +0:? Linker Objects +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 40 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 37 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "color" + Name 10 "@main(" + Name 27 "ps_output" + Name 37 "@entryPointOutput.color" + Decorate 37(@entryPointOutput.color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeInt 32 1 + 13: 12(int) Constant 3 + 14: 12(int) Constant 4 + 15: 12(int) Constant 5 + 16: 12(int) Constant 6 + 17: 12(int) Constant 7 + 18: 12(int) Constant 8 + 19: TypeVector 6(float) 2 + 20: 6(float) Constant 1091567616 + 21: 6(float) Constant 1092616192 + 22: 19(fvec2) ConstantComposite 20 21 + 23: 6(float) Constant 1093664768 + 24: 6(float) Constant 1094713344 + 25: 19(fvec2) ConstantComposite 23 24 + 26: TypePointer Function 8(PS_OUTPUT) + 28: 12(int) Constant 0 + 29: 6(float) Constant 1065353216 + 30: 7(fvec4) ConstantComposite 29 29 29 29 + 31: TypePointer Function 7(fvec4) + 36: TypePointer Output 7(fvec4) +37(@entryPointOutput.color): 36(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 38:8(PS_OUTPUT) FunctionCall 10(@main() + 39: 7(fvec4) CompositeExtract 38 0 + Store 37(@entryPointOutput.color) 39 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 27(ps_output): 26(ptr) Variable Function + 32: 31(ptr) AccessChain 27(ps_output) 28 + Store 32 30 + 33:8(PS_OUTPUT) Load 27(ps_output) + ReturnValue 33 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.constructimat.frag.out b/deps/glslang/Test/baseResults/hlsl.constructimat.frag.out new file mode 100644 index 00000000..e88c3d8f --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.constructimat.frag.out @@ -0,0 +1,698 @@ +hlsl.constructimat.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @main( ( temp int) +0:2 Function Parameters: +0:? Sequence +0:6 Sequence +0:6 move second child to first child ( temp 4X4 matrix of int) +0:6 'var443' ( temp 4X4 matrix of int) +0:6 Constant: +0:6 0 (const int) +0:6 1 (const int) +0:6 0 (const int) +0:6 0 (const int) +0:6 1 (const int) +0:6 1 (const int) +0:6 0 (const int) +0:6 0 (const int) +0:6 1 (const int) +0:6 0 (const int) +0:6 0 (const int) +0:6 0 (const int) +0:6 0 (const int) +0:6 0 (const int) +0:6 0 (const int) +0:6 0 (const int) +0:7 Sequence +0:7 move second child to first child ( temp 4X4 matrix of int) +0:7 'var444' ( temp 4X4 matrix of int) +0:? Constant: +0:? 0 (const int) +0:? 1 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 1 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:11 Sequence +0:11 move second child to first child ( temp 4X2 matrix of int) +0:11 'var423' ( temp 4X2 matrix of int) +0:11 Constant: +0:11 0 (const int) +0:11 1 (const int) +0:11 1 (const int) +0:11 1 (const int) +0:11 1 (const int) +0:11 0 (const int) +0:11 0 (const int) +0:11 0 (const int) +0:12 Sequence +0:12 move second child to first child ( temp 4X2 matrix of int) +0:12 'var424' ( temp 4X2 matrix of int) +0:? Constant: +0:? 0 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:16 Sequence +0:16 move second child to first child ( temp 3X2 matrix of int) +0:16 'var323' ( temp 3X2 matrix of int) +0:16 Constant: +0:16 0 (const int) +0:16 1 (const int) +0:16 1 (const int) +0:16 1 (const int) +0:16 1 (const int) +0:16 0 (const int) +0:17 Sequence +0:17 move second child to first child ( temp 3X2 matrix of int) +0:17 'var234' ( temp 3X2 matrix of int) +0:? Constant: +0:? 0 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:? 0 (const int) +0:22 Sequence +0:22 move second child to first child ( temp 4X4 matrix of uint) +0:22 'uvar443' ( temp 4X4 matrix of uint) +0:22 Constant: +0:22 0 (const uint) +0:22 1 (const uint) +0:22 0 (const uint) +0:22 0 (const uint) +0:22 1 (const uint) +0:22 1 (const uint) +0:22 0 (const uint) +0:22 0 (const uint) +0:22 1 (const uint) +0:22 0 (const uint) +0:22 0 (const uint) +0:22 0 (const uint) +0:22 0 (const uint) +0:22 0 (const uint) +0:22 0 (const uint) +0:22 0 (const uint) +0:23 Sequence +0:23 move second child to first child ( temp 4X4 matrix of uint) +0:23 'uvar444' ( temp 4X4 matrix of uint) +0:? Constant: +0:? 0 (const uint) +0:? 1 (const uint) +0:? 0 (const uint) +0:? 0 (const uint) +0:? 1 (const uint) +0:? 1 (const uint) +0:? 0 (const uint) +0:? 0 (const uint) +0:? 1 (const uint) +0:? 0 (const uint) +0:? 0 (const uint) +0:? 0 (const uint) +0:? 0 (const uint) +0:? 0 (const uint) +0:? 0 (const uint) +0:? 0 (const uint) +0:27 Sequence +0:27 move second child to first child ( temp 4X2 matrix of uint) +0:27 'uvar423' ( temp 4X2 matrix of uint) +0:27 Constant: +0:27 0 (const uint) +0:27 1 (const uint) +0:27 1 (const uint) +0:27 1 (const uint) +0:27 1 (const uint) +0:27 0 (const uint) +0:27 0 (const uint) +0:27 0 (const uint) +0:28 Sequence +0:28 move second child to first child ( temp 4X2 matrix of uint) +0:28 'uvar424' ( temp 4X2 matrix of uint) +0:? Constant: +0:? 0 (const uint) +0:? 1 (const uint) +0:? 1 (const uint) +0:? 1 (const uint) +0:? 1 (const uint) +0:? 0 (const uint) +0:? 0 (const uint) +0:? 0 (const uint) +0:32 Sequence +0:32 move second child to first child ( temp 3X2 matrix of uint) +0:32 'uvar323' ( temp 3X2 matrix of uint) +0:32 Constant: +0:32 0 (const uint) +0:32 1 (const uint) +0:32 1 (const uint) +0:32 1 (const uint) +0:32 1 (const uint) +0:32 0 (const uint) +0:33 Sequence +0:33 move second child to first child ( temp 3X2 matrix of uint) +0:33 'uvar234' ( temp 3X2 matrix of uint) +0:? Constant: +0:? 0 (const uint) +0:? 1 (const uint) +0:? 1 (const uint) +0:? 1 (const uint) +0:? 1 (const uint) +0:? 0 (const uint) +0:38 Sequence +0:38 move second child to first child ( temp 4X4 matrix of bool) +0:38 'bvar443' ( temp 4X4 matrix of bool) +0:38 Constant: +0:38 false (const bool) +0:38 true (const bool) +0:38 false (const bool) +0:38 false (const bool) +0:38 true (const bool) +0:38 true (const bool) +0:38 false (const bool) +0:38 false (const bool) +0:38 true (const bool) +0:38 false (const bool) +0:38 false (const bool) +0:38 false (const bool) +0:38 false (const bool) +0:38 false (const bool) +0:38 false (const bool) +0:38 false (const bool) +0:39 Sequence +0:39 move second child to first child ( temp 4X4 matrix of bool) +0:39 'bvar444' ( temp 4X4 matrix of bool) +0:? Constant: +0:? false (const bool) +0:? true (const bool) +0:? false (const bool) +0:? false (const bool) +0:? true (const bool) +0:? true (const bool) +0:? false (const bool) +0:? false (const bool) +0:? true (const bool) +0:? false (const bool) +0:? false (const bool) +0:? false (const bool) +0:? false (const bool) +0:? false (const bool) +0:? false (const bool) +0:? false (const bool) +0:43 Sequence +0:43 move second child to first child ( temp 4X2 matrix of bool) +0:43 'bvar423' ( temp 4X2 matrix of bool) +0:43 Constant: +0:43 false (const bool) +0:43 true (const bool) +0:43 true (const bool) +0:43 true (const bool) +0:43 true (const bool) +0:43 false (const bool) +0:43 false (const bool) +0:43 false (const bool) +0:44 Sequence +0:44 move second child to first child ( temp 4X2 matrix of bool) +0:44 'bvar424' ( temp 4X2 matrix of bool) +0:? Constant: +0:? false (const bool) +0:? true (const bool) +0:? true (const bool) +0:? true (const bool) +0:? true (const bool) +0:? false (const bool) +0:? false (const bool) +0:? false (const bool) +0:48 Sequence +0:48 move second child to first child ( temp 3X2 matrix of bool) +0:48 'bvar323' ( temp 3X2 matrix of bool) +0:48 Constant: +0:48 false (const bool) +0:48 true (const bool) +0:48 true (const bool) +0:48 true (const bool) +0:48 true (const bool) +0:48 false (const bool) +0:49 Sequence +0:49 move second child to first child ( temp 3X2 matrix of bool) +0:49 'bvar234' ( temp 3X2 matrix of bool) +0:? Constant: +0:? false (const bool) +0:? true (const bool) +0:? true (const bool) +0:? true (const bool) +0:? true (const bool) +0:? false (const bool) +0:51 Branch: Return with expression +0:51 Constant: +0:51 0 (const int) +0:2 Function Definition: main( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp int) +0:? '@entryPointOutput' (layout( location=0) out int) +0:2 Function Call: @main( ( temp int) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out int) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @main( ( temp int) +0:2 Function Parameters: +0:? Sequence +0:6 Sequence +0:6 move second child to first child ( temp 4X4 matrix of int) +0:6 'var443' ( temp 4X4 matrix of int) +0:6 Constant: +0:6 0 (const int) +0:6 1 (const int) +0:6 0 (const int) +0:6 0 (const int) +0:6 1 (const int) +0:6 1 (const int) +0:6 0 (const int) +0:6 0 (const int) +0:6 1 (const int) +0:6 0 (const int) +0:6 0 (const int) +0:6 0 (const int) +0:6 0 (const int) +0:6 0 (const int) +0:6 0 (const int) +0:6 0 (const int) +0:7 Sequence +0:7 move second child to first child ( temp 4X4 matrix of int) +0:7 'var444' ( temp 4X4 matrix of int) +0:? Constant: +0:? 0 (const int) +0:? 1 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 1 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:11 Sequence +0:11 move second child to first child ( temp 4X2 matrix of int) +0:11 'var423' ( temp 4X2 matrix of int) +0:11 Constant: +0:11 0 (const int) +0:11 1 (const int) +0:11 1 (const int) +0:11 1 (const int) +0:11 1 (const int) +0:11 0 (const int) +0:11 0 (const int) +0:11 0 (const int) +0:12 Sequence +0:12 move second child to first child ( temp 4X2 matrix of int) +0:12 'var424' ( temp 4X2 matrix of int) +0:? Constant: +0:? 0 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:? 0 (const int) +0:16 Sequence +0:16 move second child to first child ( temp 3X2 matrix of int) +0:16 'var323' ( temp 3X2 matrix of int) +0:16 Constant: +0:16 0 (const int) +0:16 1 (const int) +0:16 1 (const int) +0:16 1 (const int) +0:16 1 (const int) +0:16 0 (const int) +0:17 Sequence +0:17 move second child to first child ( temp 3X2 matrix of int) +0:17 'var234' ( temp 3X2 matrix of int) +0:? Constant: +0:? 0 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:? 0 (const int) +0:22 Sequence +0:22 move second child to first child ( temp 4X4 matrix of uint) +0:22 'uvar443' ( temp 4X4 matrix of uint) +0:22 Constant: +0:22 0 (const uint) +0:22 1 (const uint) +0:22 0 (const uint) +0:22 0 (const uint) +0:22 1 (const uint) +0:22 1 (const uint) +0:22 0 (const uint) +0:22 0 (const uint) +0:22 1 (const uint) +0:22 0 (const uint) +0:22 0 (const uint) +0:22 0 (const uint) +0:22 0 (const uint) +0:22 0 (const uint) +0:22 0 (const uint) +0:22 0 (const uint) +0:23 Sequence +0:23 move second child to first child ( temp 4X4 matrix of uint) +0:23 'uvar444' ( temp 4X4 matrix of uint) +0:? Constant: +0:? 0 (const uint) +0:? 1 (const uint) +0:? 0 (const uint) +0:? 0 (const uint) +0:? 1 (const uint) +0:? 1 (const uint) +0:? 0 (const uint) +0:? 0 (const uint) +0:? 1 (const uint) +0:? 0 (const uint) +0:? 0 (const uint) +0:? 0 (const uint) +0:? 0 (const uint) +0:? 0 (const uint) +0:? 0 (const uint) +0:? 0 (const uint) +0:27 Sequence +0:27 move second child to first child ( temp 4X2 matrix of uint) +0:27 'uvar423' ( temp 4X2 matrix of uint) +0:27 Constant: +0:27 0 (const uint) +0:27 1 (const uint) +0:27 1 (const uint) +0:27 1 (const uint) +0:27 1 (const uint) +0:27 0 (const uint) +0:27 0 (const uint) +0:27 0 (const uint) +0:28 Sequence +0:28 move second child to first child ( temp 4X2 matrix of uint) +0:28 'uvar424' ( temp 4X2 matrix of uint) +0:? Constant: +0:? 0 (const uint) +0:? 1 (const uint) +0:? 1 (const uint) +0:? 1 (const uint) +0:? 1 (const uint) +0:? 0 (const uint) +0:? 0 (const uint) +0:? 0 (const uint) +0:32 Sequence +0:32 move second child to first child ( temp 3X2 matrix of uint) +0:32 'uvar323' ( temp 3X2 matrix of uint) +0:32 Constant: +0:32 0 (const uint) +0:32 1 (const uint) +0:32 1 (const uint) +0:32 1 (const uint) +0:32 1 (const uint) +0:32 0 (const uint) +0:33 Sequence +0:33 move second child to first child ( temp 3X2 matrix of uint) +0:33 'uvar234' ( temp 3X2 matrix of uint) +0:? Constant: +0:? 0 (const uint) +0:? 1 (const uint) +0:? 1 (const uint) +0:? 1 (const uint) +0:? 1 (const uint) +0:? 0 (const uint) +0:38 Sequence +0:38 move second child to first child ( temp 4X4 matrix of bool) +0:38 'bvar443' ( temp 4X4 matrix of bool) +0:38 Constant: +0:38 false (const bool) +0:38 true (const bool) +0:38 false (const bool) +0:38 false (const bool) +0:38 true (const bool) +0:38 true (const bool) +0:38 false (const bool) +0:38 false (const bool) +0:38 true (const bool) +0:38 false (const bool) +0:38 false (const bool) +0:38 false (const bool) +0:38 false (const bool) +0:38 false (const bool) +0:38 false (const bool) +0:38 false (const bool) +0:39 Sequence +0:39 move second child to first child ( temp 4X4 matrix of bool) +0:39 'bvar444' ( temp 4X4 matrix of bool) +0:? Constant: +0:? false (const bool) +0:? true (const bool) +0:? false (const bool) +0:? false (const bool) +0:? true (const bool) +0:? true (const bool) +0:? false (const bool) +0:? false (const bool) +0:? true (const bool) +0:? false (const bool) +0:? false (const bool) +0:? false (const bool) +0:? false (const bool) +0:? false (const bool) +0:? false (const bool) +0:? false (const bool) +0:43 Sequence +0:43 move second child to first child ( temp 4X2 matrix of bool) +0:43 'bvar423' ( temp 4X2 matrix of bool) +0:43 Constant: +0:43 false (const bool) +0:43 true (const bool) +0:43 true (const bool) +0:43 true (const bool) +0:43 true (const bool) +0:43 false (const bool) +0:43 false (const bool) +0:43 false (const bool) +0:44 Sequence +0:44 move second child to first child ( temp 4X2 matrix of bool) +0:44 'bvar424' ( temp 4X2 matrix of bool) +0:? Constant: +0:? false (const bool) +0:? true (const bool) +0:? true (const bool) +0:? true (const bool) +0:? true (const bool) +0:? false (const bool) +0:? false (const bool) +0:? false (const bool) +0:48 Sequence +0:48 move second child to first child ( temp 3X2 matrix of bool) +0:48 'bvar323' ( temp 3X2 matrix of bool) +0:48 Constant: +0:48 false (const bool) +0:48 true (const bool) +0:48 true (const bool) +0:48 true (const bool) +0:48 true (const bool) +0:48 false (const bool) +0:49 Sequence +0:49 move second child to first child ( temp 3X2 matrix of bool) +0:49 'bvar234' ( temp 3X2 matrix of bool) +0:? Constant: +0:? false (const bool) +0:? true (const bool) +0:? true (const bool) +0:? true (const bool) +0:? true (const bool) +0:? false (const bool) +0:51 Branch: Return with expression +0:51 Constant: +0:51 0 (const int) +0:2 Function Definition: main( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp int) +0:? '@entryPointOutput' (layout( location=0) out int) +0:2 Function Call: @main( ( temp int) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out int) + +error: SPIRV-Tools Validation Errors +error: Matrix types can only be parameterized with floating-point types. + %mat4v4int = OpTypeMatrix %v4int 4 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 98 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 96 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "@main(" + Name 13 "var443" + Name 21 "var444" + Name 25 "var423" + Name 31 "var424" + Name 34 "var323" + Name 36 "var234" + Name 41 "uvar443" + Name 49 "uvar444" + Name 53 "uvar423" + Name 59 "uvar424" + Name 62 "uvar323" + Name 64 "uvar234" + Name 69 "bvar443" + Name 77 "bvar444" + Name 81 "bvar423" + Name 87 "bvar424" + Name 90 "bvar323" + Name 92 "bvar234" + Name 96 "@entryPointOutput" + Decorate 96(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeFunction 6(int) + 10: TypeVector 6(int) 4 + 11: TypeMatrix 10(ivec4) 4 + 12: TypePointer Function 11 + 14: 6(int) Constant 0 + 15: 6(int) Constant 1 + 16: 10(ivec4) ConstantComposite 14 15 14 14 + 17: 10(ivec4) ConstantComposite 15 15 14 14 + 18: 10(ivec4) ConstantComposite 15 14 14 14 + 19: 10(ivec4) ConstantComposite 14 14 14 14 + 20: 11 ConstantComposite 16 17 18 19 + 22: TypeVector 6(int) 2 + 23: TypeMatrix 22(ivec2) 4 + 24: TypePointer Function 23 + 26: 22(ivec2) ConstantComposite 14 15 + 27: 22(ivec2) ConstantComposite 15 15 + 28: 22(ivec2) ConstantComposite 15 14 + 29: 22(ivec2) ConstantComposite 14 14 + 30: 23 ConstantComposite 26 27 28 29 + 32: TypeMatrix 22(ivec2) 3 + 33: TypePointer Function 32 + 35: 32 ConstantComposite 26 27 28 + 37: TypeInt 32 0 + 38: TypeVector 37(int) 4 + 39: TypeMatrix 38(ivec4) 4 + 40: TypePointer Function 39 + 42: 37(int) Constant 0 + 43: 37(int) Constant 1 + 44: 38(ivec4) ConstantComposite 42 43 42 42 + 45: 38(ivec4) ConstantComposite 43 43 42 42 + 46: 38(ivec4) ConstantComposite 43 42 42 42 + 47: 38(ivec4) ConstantComposite 42 42 42 42 + 48: 39 ConstantComposite 44 45 46 47 + 50: TypeVector 37(int) 2 + 51: TypeMatrix 50(ivec2) 4 + 52: TypePointer Function 51 + 54: 50(ivec2) ConstantComposite 42 43 + 55: 50(ivec2) ConstantComposite 43 43 + 56: 50(ivec2) ConstantComposite 43 42 + 57: 50(ivec2) ConstantComposite 42 42 + 58: 51 ConstantComposite 54 55 56 57 + 60: TypeMatrix 50(ivec2) 3 + 61: TypePointer Function 60 + 63: 60 ConstantComposite 54 55 56 + 65: TypeBool + 66: TypeVector 65(bool) 4 + 67: TypeMatrix 66(bvec4) 4 + 68: TypePointer Function 67 + 70: 65(bool) ConstantFalse + 71: 65(bool) ConstantTrue + 72: 66(bvec4) ConstantComposite 70 71 70 70 + 73: 66(bvec4) ConstantComposite 71 71 70 70 + 74: 66(bvec4) ConstantComposite 71 70 70 70 + 75: 66(bvec4) ConstantComposite 70 70 70 70 + 76: 67 ConstantComposite 72 73 74 75 + 78: TypeVector 65(bool) 2 + 79: TypeMatrix 78(bvec2) 4 + 80: TypePointer Function 79 + 82: 78(bvec2) ConstantComposite 70 71 + 83: 78(bvec2) ConstantComposite 71 71 + 84: 78(bvec2) ConstantComposite 71 70 + 85: 78(bvec2) ConstantComposite 70 70 + 86: 79 ConstantComposite 82 83 84 85 + 88: TypeMatrix 78(bvec2) 3 + 89: TypePointer Function 88 + 91: 88 ConstantComposite 82 83 84 + 95: TypePointer Output 6(int) +96(@entryPointOutput): 95(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 97: 6(int) FunctionCall 8(@main() + Store 96(@entryPointOutput) 97 + Return + FunctionEnd + 8(@main(): 6(int) Function None 7 + 9: Label + 13(var443): 12(ptr) Variable Function + 21(var444): 12(ptr) Variable Function + 25(var423): 24(ptr) Variable Function + 31(var424): 24(ptr) Variable Function + 34(var323): 33(ptr) Variable Function + 36(var234): 33(ptr) Variable Function + 41(uvar443): 40(ptr) Variable Function + 49(uvar444): 40(ptr) Variable Function + 53(uvar423): 52(ptr) Variable Function + 59(uvar424): 52(ptr) Variable Function + 62(uvar323): 61(ptr) Variable Function + 64(uvar234): 61(ptr) Variable Function + 69(bvar443): 68(ptr) Variable Function + 77(bvar444): 68(ptr) Variable Function + 81(bvar423): 80(ptr) Variable Function + 87(bvar424): 80(ptr) Variable Function + 90(bvar323): 89(ptr) Variable Function + 92(bvar234): 89(ptr) Variable Function + Store 13(var443) 20 + Store 21(var444) 20 + Store 25(var423) 30 + Store 31(var424) 30 + Store 34(var323) 35 + Store 36(var234) 35 + Store 41(uvar443) 48 + Store 49(uvar444) 48 + Store 53(uvar423) 58 + Store 59(uvar424) 58 + Store 62(uvar323) 63 + Store 64(uvar234) 63 + Store 69(bvar443) 76 + Store 77(bvar444) 76 + Store 81(bvar423) 86 + Store 87(bvar424) 86 + Store 90(bvar323) 91 + Store 92(bvar234) 91 + ReturnValue 14 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.coverage.frag.out b/deps/glslang/Test/baseResults/hlsl.coverage.frag.out new file mode 100644 index 00000000..bea2fc0e --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.coverage.frag.out @@ -0,0 +1,208 @@ +hlsl.coverage.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:15 Function Definition: @main(struct-PS_INPUT1; ( temp structure{ temp 4-component vector of float vColor, temp uint nCoverageMask}) +0:15 Function Parameters: +0:15 'i' ( in structure{}) +0:? Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:17 vColor: direct index for structure ( temp 4-component vector of float) +0:17 'o' ( temp structure{ temp 4-component vector of float vColor, temp uint nCoverageMask}) +0:17 Constant: +0:17 0 (const int) +0:? Constant: +0:? 1.000000 +0:? 0.000000 +0:? 0.000000 +0:? 1.000000 +0:18 move second child to first child ( temp uint) +0:18 nCoverageMask: direct index for structure ( temp uint) +0:18 'o' ( temp structure{ temp 4-component vector of float vColor, temp uint nCoverageMask}) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 0 (const uint) +0:19 Branch: Return with expression +0:19 'o' ( temp structure{ temp 4-component vector of float vColor, temp uint nCoverageMask}) +0:15 Function Definition: main( ( temp void) +0:15 Function Parameters: +0:? Sequence +0:15 Sequence +0:15 move second child to first child ( temp structure{}) +0:? 'i' ( temp structure{}) +0:? 'i' ( in structure{}) +0:15 Sequence +0:15 move second child to first child ( temp structure{ temp 4-component vector of float vColor, temp uint nCoverageMask}) +0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float vColor, temp uint nCoverageMask}) +0:15 Function Call: @main(struct-PS_INPUT1; ( temp structure{ temp 4-component vector of float vColor, temp uint nCoverageMask}) +0:? 'i' ( temp structure{}) +0:15 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.vColor' (layout( location=0) out 4-component vector of float) +0:15 vColor: direct index for structure ( temp 4-component vector of float) +0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float vColor, temp uint nCoverageMask}) +0:15 Constant: +0:15 0 (const int) +0:15 move second child to first child ( temp uint) +0:15 direct index ( out uint SampleMaskIn) +0:? '@entryPointOutput.nCoverageMask' ( out 1-element array of uint SampleMaskIn) +0:15 Constant: +0:15 0 (const int) +0:15 nCoverageMask: direct index for structure ( temp uint) +0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float vColor, temp uint nCoverageMask}) +0:15 Constant: +0:15 1 (const int) +0:? Linker Objects +0:? '@entryPointOutput.nCoverageMask' ( out 1-element array of uint SampleMaskIn) +0:? '@entryPointOutput.vColor' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:15 Function Definition: @main(struct-PS_INPUT1; ( temp structure{ temp 4-component vector of float vColor, temp uint nCoverageMask}) +0:15 Function Parameters: +0:15 'i' ( in structure{}) +0:? Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:17 vColor: direct index for structure ( temp 4-component vector of float) +0:17 'o' ( temp structure{ temp 4-component vector of float vColor, temp uint nCoverageMask}) +0:17 Constant: +0:17 0 (const int) +0:? Constant: +0:? 1.000000 +0:? 0.000000 +0:? 0.000000 +0:? 1.000000 +0:18 move second child to first child ( temp uint) +0:18 nCoverageMask: direct index for structure ( temp uint) +0:18 'o' ( temp structure{ temp 4-component vector of float vColor, temp uint nCoverageMask}) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 0 (const uint) +0:19 Branch: Return with expression +0:19 'o' ( temp structure{ temp 4-component vector of float vColor, temp uint nCoverageMask}) +0:15 Function Definition: main( ( temp void) +0:15 Function Parameters: +0:? Sequence +0:15 Sequence +0:15 move second child to first child ( temp structure{}) +0:? 'i' ( temp structure{}) +0:? 'i' ( in structure{}) +0:15 Sequence +0:15 move second child to first child ( temp structure{ temp 4-component vector of float vColor, temp uint nCoverageMask}) +0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float vColor, temp uint nCoverageMask}) +0:15 Function Call: @main(struct-PS_INPUT1; ( temp structure{ temp 4-component vector of float vColor, temp uint nCoverageMask}) +0:? 'i' ( temp structure{}) +0:15 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.vColor' (layout( location=0) out 4-component vector of float) +0:15 vColor: direct index for structure ( temp 4-component vector of float) +0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float vColor, temp uint nCoverageMask}) +0:15 Constant: +0:15 0 (const int) +0:15 move second child to first child ( temp uint) +0:15 direct index ( out uint SampleMaskIn) +0:? '@entryPointOutput.nCoverageMask' ( out 1-element array of uint SampleMaskIn) +0:15 Constant: +0:15 0 (const int) +0:15 nCoverageMask: direct index for structure ( temp uint) +0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float vColor, temp uint nCoverageMask}) +0:15 Constant: +0:15 1 (const int) +0:? Linker Objects +0:? '@entryPointOutput.nCoverageMask' ( out 1-element array of uint SampleMaskIn) +0:? '@entryPointOutput.vColor' (layout( location=0) out 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: Input variable id <34> is used by entry point 'main' id <4>, but is not listed as an interface + %i_1 = OpVariable %_ptr_Input_PS_INPUT Input + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 52 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 41 47 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 6 "PS_INPUT" + Name 11 "PS_OUTPUT" + MemberName 11(PS_OUTPUT) 0 "vColor" + MemberName 11(PS_OUTPUT) 1 "nCoverageMask" + Name 14 "@main(struct-PS_INPUT1;" + Name 13 "i" + Name 17 "o" + Name 32 "i" + Name 34 "i" + Name 36 "flattenTemp" + Name 37 "param" + Name 41 "@entryPointOutput.vColor" + Name 47 "@entryPointOutput.nCoverageMask" + Decorate 41(@entryPointOutput.vColor) Location 0 + Decorate 47(@entryPointOutput.nCoverageMask) BuiltIn SampleMask + 2: TypeVoid + 3: TypeFunction 2 + 6(PS_INPUT): TypeStruct + 7: TypePointer Function 6(PS_INPUT) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeInt 32 0 + 11(PS_OUTPUT): TypeStruct 9(fvec4) 10(int) + 12: TypeFunction 11(PS_OUTPUT) 7(ptr) + 16: TypePointer Function 11(PS_OUTPUT) + 18: TypeInt 32 1 + 19: 18(int) Constant 0 + 20: 8(float) Constant 1065353216 + 21: 8(float) Constant 0 + 22: 9(fvec4) ConstantComposite 20 21 21 20 + 23: TypePointer Function 9(fvec4) + 25: 18(int) Constant 1 + 26: 10(int) Constant 0 + 27: TypePointer Function 10(int) + 33: TypePointer Input 6(PS_INPUT) + 34(i): 33(ptr) Variable Input + 40: TypePointer Output 9(fvec4) +41(@entryPointOutput.vColor): 40(ptr) Variable Output + 44: 10(int) Constant 1 + 45: TypeArray 10(int) 44 + 46: TypePointer Output 45 +47(@entryPointOutput.nCoverageMask): 46(ptr) Variable Output + 50: TypePointer Output 10(int) + 4(main): 2 Function None 3 + 5: Label + 32(i): 7(ptr) Variable Function + 36(flattenTemp): 16(ptr) Variable Function + 37(param): 7(ptr) Variable Function + 35: 6(PS_INPUT) Load 34(i) + Store 32(i) 35 + 38: 6(PS_INPUT) Load 32(i) + Store 37(param) 38 + 39:11(PS_OUTPUT) FunctionCall 14(@main(struct-PS_INPUT1;) 37(param) + Store 36(flattenTemp) 39 + 42: 23(ptr) AccessChain 36(flattenTemp) 19 + 43: 9(fvec4) Load 42 + Store 41(@entryPointOutput.vColor) 43 + 48: 27(ptr) AccessChain 36(flattenTemp) 25 + 49: 10(int) Load 48 + 51: 50(ptr) AccessChain 47(@entryPointOutput.nCoverageMask) 19 + Store 51 49 + Return + FunctionEnd +14(@main(struct-PS_INPUT1;):11(PS_OUTPUT) Function None 12 + 13(i): 7(ptr) FunctionParameter + 15: Label + 17(o): 16(ptr) Variable Function + 24: 23(ptr) AccessChain 17(o) 19 + Store 24 22 + 28: 27(ptr) AccessChain 17(o) 25 + Store 28 26 + 29:11(PS_OUTPUT) Load 17(o) + ReturnValue 29 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.dashI.vert.out b/deps/glslang/Test/baseResults/hlsl.dashI.vert.out new file mode 100644 index 00000000..400502be --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.dashI.vert.out @@ -0,0 +1,69 @@ +hlsl.dashI.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 40 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 38 + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 11 "$Global" + MemberName 11($Global) 0 "i1" + MemberName 11($Global) 1 "p1" + MemberName 11($Global) 2 "p2" + MemberName 11($Global) 3 "p3" + MemberName 11($Global) 4 "i4" + Name 13 "" + Name 38 "@entryPointOutput" + MemberDecorate 11($Global) 0 Offset 0 + MemberDecorate 11($Global) 1 Offset 16 + MemberDecorate 11($Global) 2 Offset 32 + MemberDecorate 11($Global) 3 Offset 48 + MemberDecorate 11($Global) 4 Offset 64 + Decorate 11($Global) Block + Decorate 13 DescriptorSet 0 + Decorate 38(@entryPointOutput) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11($Global): TypeStruct 7(fvec4) 7(fvec4) 7(fvec4) 7(fvec4) 7(fvec4) + 12: TypePointer Uniform 11($Global) + 13: 12(ptr) Variable Uniform + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16: TypePointer Uniform 7(fvec4) + 19: 14(int) Constant 4 + 23: 14(int) Constant 1 + 27: 14(int) Constant 2 + 31: 14(int) Constant 3 + 37: TypePointer Output 7(fvec4) +38(@entryPointOutput): 37(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 39: 7(fvec4) FunctionCall 9(@main() + Store 38(@entryPointOutput) 39 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 17: 16(ptr) AccessChain 13 15 + 18: 7(fvec4) Load 17 + 20: 16(ptr) AccessChain 13 19 + 21: 7(fvec4) Load 20 + 22: 7(fvec4) FAdd 18 21 + 24: 16(ptr) AccessChain 13 23 + 25: 7(fvec4) Load 24 + 26: 7(fvec4) FAdd 22 25 + 28: 16(ptr) AccessChain 13 27 + 29: 7(fvec4) Load 28 + 30: 7(fvec4) FAdd 26 29 + 32: 16(ptr) AccessChain 13 31 + 33: 7(fvec4) Load 32 + 34: 7(fvec4) FAdd 30 33 + ReturnValue 34 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.deadFunctionMissingBody.vert.out b/deps/glslang/Test/baseResults/hlsl.deadFunctionMissingBody.vert.out new file mode 100644 index 00000000..2bc08dab --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.deadFunctionMissingBody.vert.out @@ -0,0 +1,33 @@ +hlsl.deadFunctionMissingBody.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 18 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 16 + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 16 "@entryPointOutput" + Decorate 16(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: 6(float) Constant 0 + 12: 7(fvec4) ConstantComposite 11 11 11 11 + 15: TypePointer Output 7(fvec4) +16(@entryPointOutput): 15(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 17: 7(fvec4) FunctionCall 9(@main() + Store 16(@entryPointOutput) 17 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + ReturnValue 12 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.depthGreater.frag.out b/deps/glslang/Test/baseResults/hlsl.depthGreater.frag.out new file mode 100644 index 00000000..9749371a --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.depthGreater.frag.out @@ -0,0 +1,95 @@ +hlsl.depthGreater.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_greater +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(f1; ( temp void) +0:2 Function Parameters: +0:2 'depth' ( out float) +0:? Sequence +0:3 move second child to first child ( temp float) +0:3 'depth' ( out float) +0:3 Constant: +0:3 0.200000 +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 Function Call: @PixelShaderFunction(f1; ( temp void) +0:? 'depth' ( temp float) +0:2 move second child to first child ( temp float) +0:? 'depth' ( out float FragDepth) +0:? 'depth' ( temp float) +0:? Linker Objects +0:? 'depth' ( out float FragDepth) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_greater +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(f1; ( temp void) +0:2 Function Parameters: +0:2 'depth' ( out float) +0:? Sequence +0:3 move second child to first child ( temp float) +0:3 'depth' ( out float) +0:3 Constant: +0:3 0.200000 +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 Function Call: @PixelShaderFunction(f1; ( temp void) +0:? 'depth' ( temp float) +0:2 move second child to first child ( temp float) +0:? 'depth' ( out float FragDepth) +0:? 'depth' ( temp float) +0:? Linker Objects +0:? 'depth' ( out float FragDepth) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 20 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 18 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthGreater + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 10 "@PixelShaderFunction(f1;" + Name 9 "depth" + Name 13 "depth" + Name 14 "param" + Name 18 "depth" + Decorate 18(depth) BuiltIn FragDepth + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeFunction 2 7(ptr) + 12: 6(float) Constant 1045220557 + 17: TypePointer Output 6(float) + 18(depth): 17(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 13(depth): 7(ptr) Variable Function + 14(param): 7(ptr) Variable Function + 15: 2 FunctionCall 10(@PixelShaderFunction(f1;) 14(param) + 16: 6(float) Load 14(param) + Store 13(depth) 16 + 19: 6(float) Load 13(depth) + Store 18(depth) 19 + Return + FunctionEnd +10(@PixelShaderFunction(f1;): 2 Function None 8 + 9(depth): 7(ptr) FunctionParameter + 11: Label + Store 9(depth) 12 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.depthLess.frag.out b/deps/glslang/Test/baseResults/hlsl.depthLess.frag.out new file mode 100644 index 00000000..c3af8eea --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.depthLess.frag.out @@ -0,0 +1,76 @@ +hlsl.depthLess.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_less +0:? Sequence +0:2 Function Definition: @PixelShaderFunction( ( temp float) +0:2 Function Parameters: +0:? Sequence +0:3 Branch: Return with expression +0:3 Constant: +0:3 0.200000 +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp float) +0:? '@entryPointOutput' ( out float FragDepth) +0:2 Function Call: @PixelShaderFunction( ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' ( out float FragDepth) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_less +0:? Sequence +0:2 Function Definition: @PixelShaderFunction( ( temp float) +0:2 Function Parameters: +0:? Sequence +0:3 Branch: Return with expression +0:3 Constant: +0:3 0.200000 +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp float) +0:? '@entryPointOutput' ( out float FragDepth) +0:2 Function Call: @PixelShaderFunction( ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' ( out float FragDepth) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 16 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 14 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthLess + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 8 "@PixelShaderFunction(" + Name 14 "@entryPointOutput" + Decorate 14(@entryPointOutput) BuiltIn FragDepth + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeFunction 6(float) + 10: 6(float) Constant 1045220557 + 13: TypePointer Output 6(float) +14(@entryPointOutput): 13(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 15: 6(float) FunctionCall 8(@PixelShaderFunction() + Store 14(@entryPointOutput) 15 + Return + FunctionEnd +8(@PixelShaderFunction(): 6(float) Function None 7 + 9: Label + ReturnValue 10 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.discard.frag.out b/deps/glslang/Test/baseResults/hlsl.discard.frag.out new file mode 100644 index 00000000..cc7c8666 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.discard.frag.out @@ -0,0 +1,191 @@ +hlsl.discard.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: foo(f1; ( temp void) +0:2 Function Parameters: +0:2 'f' ( in float) +0:? Sequence +0:3 Test condition and select ( temp void) +0:3 Condition +0:3 Compare Less Than ( temp bool) +0:3 'f' ( in float) +0:3 Constant: +0:3 1.000000 +0:3 true case +0:4 Branch: Kill +0:8 Function Definition: @PixelShaderFunction(vf4; ( temp void) +0:8 Function Parameters: +0:8 'input' ( in 4-component vector of float) +0:? Sequence +0:9 Function Call: foo(f1; ( temp void) +0:9 direct index ( temp float) +0:9 'input' ( in 4-component vector of float) +0:9 Constant: +0:9 2 (const int) +0:10 Test condition and select ( temp void) +0:10 Condition +0:10 Convert float to bool ( temp bool) +0:10 direct index ( temp float) +0:10 'input' ( in 4-component vector of float) +0:10 Constant: +0:10 0 (const int) +0:10 true case +0:11 Branch: Kill +0:12 Sequence +0:12 move second child to first child ( temp float) +0:12 'f' ( temp float) +0:12 direct index ( temp float) +0:12 'input' ( in 4-component vector of float) +0:12 Constant: +0:12 0 (const int) +0:13 Branch: Kill +0:8 Function Definition: PixelShaderFunction( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:8 Function Call: @PixelShaderFunction(vf4; ( temp void) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'input' (layout( location=0) in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: foo(f1; ( temp void) +0:2 Function Parameters: +0:2 'f' ( in float) +0:? Sequence +0:3 Test condition and select ( temp void) +0:3 Condition +0:3 Compare Less Than ( temp bool) +0:3 'f' ( in float) +0:3 Constant: +0:3 1.000000 +0:3 true case +0:4 Branch: Kill +0:8 Function Definition: @PixelShaderFunction(vf4; ( temp void) +0:8 Function Parameters: +0:8 'input' ( in 4-component vector of float) +0:? Sequence +0:9 Function Call: foo(f1; ( temp void) +0:9 direct index ( temp float) +0:9 'input' ( in 4-component vector of float) +0:9 Constant: +0:9 2 (const int) +0:10 Test condition and select ( temp void) +0:10 Condition +0:10 Convert float to bool ( temp bool) +0:10 direct index ( temp float) +0:10 'input' ( in 4-component vector of float) +0:10 Constant: +0:10 0 (const int) +0:10 true case +0:11 Branch: Kill +0:12 Sequence +0:12 move second child to first child ( temp float) +0:12 'f' ( temp float) +0:12 direct index ( temp float) +0:12 'input' ( in 4-component vector of float) +0:12 Constant: +0:12 0 (const int) +0:13 Branch: Kill +0:8 Function Definition: PixelShaderFunction( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:8 Function Call: @PixelShaderFunction(vf4; ( temp void) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'input' (layout( location=0) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 50 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 45 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 10 "foo(f1;" + Name 9 "f" + Name 16 "@PixelShaderFunction(vf4;" + Name 15 "input" + Name 25 "param" + Name 39 "f" + Name 43 "input" + Name 45 "input" + Name 47 "param" + Decorate 45(input) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeFunction 2 7(ptr) + 12: TypeVector 6(float) 4 + 13: TypePointer Function 12(fvec4) + 14: TypeFunction 2 13(ptr) + 19: 6(float) Constant 1065353216 + 20: TypeBool + 26: TypeInt 32 0 + 27: 26(int) Constant 2 + 31: 26(int) Constant 0 + 34: 6(float) Constant 0 + 44: TypePointer Input 12(fvec4) + 45(input): 44(ptr) Variable Input +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 43(input): 13(ptr) Variable Function + 47(param): 13(ptr) Variable Function + 46: 12(fvec4) Load 45(input) + Store 43(input) 46 + 48: 12(fvec4) Load 43(input) + Store 47(param) 48 + 49: 2 FunctionCall 16(@PixelShaderFunction(vf4;) 47(param) + Return + FunctionEnd + 10(foo(f1;): 2 Function None 8 + 9(f): 7(ptr) FunctionParameter + 11: Label + 18: 6(float) Load 9(f) + 21: 20(bool) FOrdLessThan 18 19 + SelectionMerge 23 None + BranchConditional 21 22 23 + 22: Label + Kill + 23: Label + Return + FunctionEnd +16(@PixelShaderFunction(vf4;): 2 Function None 14 + 15(input): 13(ptr) FunctionParameter + 17: Label + 25(param): 7(ptr) Variable Function + 39(f): 7(ptr) Variable Function + 28: 7(ptr) AccessChain 15(input) 27 + 29: 6(float) Load 28 + Store 25(param) 29 + 30: 2 FunctionCall 10(foo(f1;) 25(param) + 32: 7(ptr) AccessChain 15(input) 31 + 33: 6(float) Load 32 + 35: 20(bool) FOrdNotEqual 33 34 + SelectionMerge 37 None + BranchConditional 35 36 37 + 36: Label + Kill + 37: Label + 40: 7(ptr) AccessChain 15(input) 31 + 41: 6(float) Load 40 + Store 39(f) 41 + Kill + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.doLoop.frag.out b/deps/glslang/Test/baseResults/hlsl.doLoop.frag.out new file mode 100644 index 00000000..bb564658 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.doLoop.frag.out @@ -0,0 +1,271 @@ +hlsl.doLoop.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(f1; ( temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' ( in float) +0:? Sequence +0:3 Loop with condition not tested first: Unroll +0:3 Loop Condition +0:3 Constant: +0:3 false (const bool) +0:3 No loop body +0:4 Loop with condition not tested first: Unroll +0:4 Loop Condition +0:4 Constant: +0:4 false (const bool) +0:4 No loop body +0:5 Loop with condition not tested first +0:5 Loop Condition +0:5 Compare Greater Than ( temp bool) +0:5 'input' ( in float) +0:5 Constant: +0:5 2.000000 +0:5 Loop Body +0:? Sequence +0:5 Branch: Return with expression +0:5 Construct vec4 ( temp 4-component vector of float) +0:5 'input' ( in float) +0:6 Loop with condition not tested first +0:6 Loop Condition +0:6 Compare Less Than ( temp bool) +0:6 'input' ( in float) +0:6 Constant: +0:6 10.000000 +0:6 Loop Body +0:6 Pre-Increment ( temp float) +0:6 'input' ( in float) +0:7 Loop with condition not tested first +0:7 Loop Condition +0:7 Compare Less Than ( temp bool) +0:7 Pre-Increment ( temp float) +0:7 'input' ( in float) +0:7 Constant: +0:7 10.000000 +0:7 Loop Body +0:7 Loop with condition tested first +0:7 Loop Condition +0:7 Compare Less Than ( temp bool) +0:7 Pre-Increment ( temp float) +0:7 'input' ( in float) +0:7 Constant: +0:7 10.000000 +0:7 No loop body +0:8 Branch: Return with expression +0:8 Construct vec4 ( temp 4-component vector of float) +0:8 'input' ( in float) +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp float) +0:? 'input' ( temp float) +0:? 'input' (layout( location=0) in float) +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @PixelShaderFunction(f1; ( temp 4-component vector of float) +0:? 'input' ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(f1; ( temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' ( in float) +0:? Sequence +0:3 Loop with condition not tested first: Unroll +0:3 Loop Condition +0:3 Constant: +0:3 false (const bool) +0:3 No loop body +0:4 Loop with condition not tested first: Unroll +0:4 Loop Condition +0:4 Constant: +0:4 false (const bool) +0:4 No loop body +0:5 Loop with condition not tested first +0:5 Loop Condition +0:5 Compare Greater Than ( temp bool) +0:5 'input' ( in float) +0:5 Constant: +0:5 2.000000 +0:5 Loop Body +0:? Sequence +0:5 Branch: Return with expression +0:5 Construct vec4 ( temp 4-component vector of float) +0:5 'input' ( in float) +0:6 Loop with condition not tested first +0:6 Loop Condition +0:6 Compare Less Than ( temp bool) +0:6 'input' ( in float) +0:6 Constant: +0:6 10.000000 +0:6 Loop Body +0:6 Pre-Increment ( temp float) +0:6 'input' ( in float) +0:7 Loop with condition not tested first +0:7 Loop Condition +0:7 Compare Less Than ( temp bool) +0:7 Pre-Increment ( temp float) +0:7 'input' ( in float) +0:7 Constant: +0:7 10.000000 +0:7 Loop Body +0:7 Loop with condition tested first +0:7 Loop Condition +0:7 Compare Less Than ( temp bool) +0:7 Pre-Increment ( temp float) +0:7 'input' ( in float) +0:7 Constant: +0:7 10.000000 +0:7 No loop body +0:8 Branch: Return with expression +0:8 Construct vec4 ( temp 4-component vector of float) +0:8 'input' ( in float) +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp float) +0:? 'input' ( temp float) +0:? 'input' (layout( location=0) in float) +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @PixelShaderFunction(f1; ( temp 4-component vector of float) +0:? 'input' ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 71 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 64 67 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 11 "@PixelShaderFunction(f1;" + Name 10 "input" + Name 62 "input" + Name 64 "input" + Name 67 "@entryPointOutput" + Name 68 "param" + Decorate 64(input) Location 0 + Decorate 67(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeVector 6(float) 4 + 9: TypeFunction 8(fvec4) 7(ptr) + 17: TypeBool + 18: 17(bool) ConstantFalse + 31: 6(float) Constant 1073741824 + 38: 6(float) Constant 1065353216 + 41: 6(float) Constant 1092616192 + 63: TypePointer Input 6(float) + 64(input): 63(ptr) Variable Input + 66: TypePointer Output 8(fvec4) +67(@entryPointOutput): 66(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 62(input): 7(ptr) Variable Function + 68(param): 7(ptr) Variable Function + 65: 6(float) Load 64(input) + Store 62(input) 65 + 69: 6(float) Load 62(input) + Store 68(param) 69 + 70: 8(fvec4) FunctionCall 11(@PixelShaderFunction(f1;) 68(param) + Store 67(@entryPointOutput) 70 + Return + FunctionEnd +11(@PixelShaderFunction(f1;): 8(fvec4) Function None 9 + 10(input): 7(ptr) FunctionParameter + 12: Label + Branch 13 + 13: Label + LoopMerge 15 16 Unroll + Branch 14 + 14: Label + Branch 16 + 16: Label + BranchConditional 18 13 15 + 15: Label + Branch 19 + 19: Label + LoopMerge 21 22 Unroll + Branch 20 + 20: Label + Branch 22 + 22: Label + BranchConditional 18 19 21 + 21: Label + Branch 23 + 23: Label + LoopMerge 25 26 None + Branch 24 + 24: Label + 27: 6(float) Load 10(input) + 28: 8(fvec4) CompositeConstruct 27 27 27 27 + ReturnValue 28 + 26: Label + 30: 6(float) Load 10(input) + 32: 17(bool) FOrdGreaterThan 30 31 + BranchConditional 32 23 25 + 25: Label + Branch 33 + 33: Label + LoopMerge 35 36 None + Branch 34 + 34: Label + 37: 6(float) Load 10(input) + 39: 6(float) FAdd 37 38 + Store 10(input) 39 + Branch 36 + 36: Label + 40: 6(float) Load 10(input) + 42: 17(bool) FOrdLessThan 40 41 + BranchConditional 42 33 35 + 35: Label + Branch 43 + 43: Label + LoopMerge 45 46 None + Branch 44 + 44: Label + Branch 47 + 47: Label + LoopMerge 49 50 None + Branch 51 + 51: Label + 52: 6(float) Load 10(input) + 53: 6(float) FAdd 52 38 + Store 10(input) 53 + 54: 17(bool) FOrdLessThan 53 41 + BranchConditional 54 48 49 + 48: Label + Branch 50 + 50: Label + Branch 47 + 49: Label + Branch 46 + 46: Label + 55: 6(float) Load 10(input) + 56: 6(float) FAdd 55 38 + Store 10(input) 56 + 57: 17(bool) FOrdLessThan 56 41 + BranchConditional 57 43 45 + 45: Label + 58: 6(float) Load 10(input) + 59: 8(fvec4) CompositeConstruct 58 58 58 58 + ReturnValue 59 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.domain.1.tese.out b/deps/glslang/Test/baseResults/hlsl.domain.1.tese.out new file mode 100644 index 00000000..4bc8bac5 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.domain.1.tese.out @@ -0,0 +1,457 @@ +hlsl.domain.1.tese +Shader version: 500 +input primitive = triangles +vertex spacing = none +triangle order = none +0:? Sequence +0:22 Function Definition: @main(struct-ds_in_t-vf4-vf31[3];f1;vf3;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 Function Parameters: +0:22 'i' ( const (read only) 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 'f' ( in float) +0:22 'tesscoord' ( in 3-component vector of float) +0:22 'pcf_data' ( in structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:? Sequence +0:25 move second child to first child ( temp 4-component vector of float) +0:25 pos: direct index for structure ( temp 4-component vector of float) +0:25 'o' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 Constant: +0:25 0 (const int) +0:25 add ( temp 4-component vector of float) +0:25 pos: direct index for structure ( temp 4-component vector of float) +0:25 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 'i' ( const (read only) 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 component-wise multiply ( temp float) +0:25 direct index ( temp float) +0:25 'tesscoord' ( in 3-component vector of float) +0:25 Constant: +0:25 0 (const int) +0:25 'f' ( in float) +0:26 move second child to first child ( temp 3-component vector of float) +0:26 norm: direct index for structure ( temp 3-component vector of float) +0:26 'o' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:26 Constant: +0:26 1 (const int) +0:26 add ( temp 3-component vector of float) +0:26 norm: direct index for structure ( temp 3-component vector of float) +0:26 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:26 'i' ( const (read only) 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 direct index ( temp float) +0:26 'tesscoord' ( in 3-component vector of float) +0:26 Constant: +0:26 1 (const int) +0:28 direct index ( temp float) +0:28 'tesscoord' ( in 3-component vector of float) +0:28 Constant: +0:28 2 (const int) +0:30 Branch: Return with expression +0:30 'o' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 Function Definition: main( ( temp void) +0:22 Function Parameters: +0:? Sequence +0:22 move second child to first child ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 move second child to first child ( temp float) +0:? 'f' ( temp float) +0:? 'f' (layout( location=2) patch in float) +0:22 move second child to first child ( temp 3-component vector of float) +0:? 'tesscoord' ( temp 3-component vector of float) +0:? 'tesscoord' ( patch in 3-component vector of float TessCoord) +0:22 Sequence +0:22 move second child to first child ( temp float) +0:22 direct index ( temp float) +0:22 flTessFactor: direct index for structure ( temp 3-element array of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 0 (const int) +0:22 direct index ( patch in float TessLevelOuter) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:22 Constant: +0:22 0 (const int) +0:22 move second child to first child ( temp float) +0:22 direct index ( temp float) +0:22 flTessFactor: direct index for structure ( temp 3-element array of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 direct index ( patch in float TessLevelOuter) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:22 Constant: +0:22 1 (const int) +0:22 move second child to first child ( temp float) +0:22 direct index ( temp float) +0:22 flTessFactor: direct index for structure ( temp 3-element array of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 direct index ( patch in float TessLevelOuter) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:22 Constant: +0:22 2 (const int) +0:22 move second child to first child ( temp float) +0:22 flInsideTessFactor: direct index for structure ( temp float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:22 Constant: +0:22 1 (const int) +0:22 direct index ( patch in float TessLevelInner) +0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner) +0:22 Constant: +0:22 0 (const int) +0:22 Sequence +0:22 move second child to first child ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 Function Call: @main(struct-ds_in_t-vf4-vf31[3];f1;vf3;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'f' ( temp float) +0:? 'tesscoord' ( temp 3-component vector of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:22 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.pos' (layout( location=0) out 4-component vector of float) +0:22 pos: direct index for structure ( temp 4-component vector of float) +0:22 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 Constant: +0:22 0 (const int) +0:22 move second child to first child ( temp 3-component vector of float) +0:? '@entryPointOutput.norm' (layout( location=1) out 3-component vector of float) +0:22 norm: direct index for structure ( temp 3-component vector of float) +0:22 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 Constant: +0:22 1 (const int) +0:? Linker Objects +0:? '@entryPointOutput.pos' (layout( location=0) out 4-component vector of float) +0:? '@entryPointOutput.norm' (layout( location=1) out 3-component vector of float) +0:? 'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'f' (layout( location=2) patch in float) +0:? 'tesscoord' ( patch in 3-component vector of float TessCoord) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner) + + +Linked tessellation evaluation stage: + + +Shader version: 500 +input primitive = triangles +vertex spacing = none +triangle order = none +0:? Sequence +0:22 Function Definition: @main(struct-ds_in_t-vf4-vf31[3];f1;vf3;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 Function Parameters: +0:22 'i' ( const (read only) 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 'f' ( in float) +0:22 'tesscoord' ( in 3-component vector of float) +0:22 'pcf_data' ( in structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:? Sequence +0:25 move second child to first child ( temp 4-component vector of float) +0:25 pos: direct index for structure ( temp 4-component vector of float) +0:25 'o' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 Constant: +0:25 0 (const int) +0:25 add ( temp 4-component vector of float) +0:25 pos: direct index for structure ( temp 4-component vector of float) +0:25 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 'i' ( const (read only) 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 component-wise multiply ( temp float) +0:25 direct index ( temp float) +0:25 'tesscoord' ( in 3-component vector of float) +0:25 Constant: +0:25 0 (const int) +0:25 'f' ( in float) +0:26 move second child to first child ( temp 3-component vector of float) +0:26 norm: direct index for structure ( temp 3-component vector of float) +0:26 'o' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:26 Constant: +0:26 1 (const int) +0:26 add ( temp 3-component vector of float) +0:26 norm: direct index for structure ( temp 3-component vector of float) +0:26 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:26 'i' ( const (read only) 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 direct index ( temp float) +0:26 'tesscoord' ( in 3-component vector of float) +0:26 Constant: +0:26 1 (const int) +0:28 direct index ( temp float) +0:28 'tesscoord' ( in 3-component vector of float) +0:28 Constant: +0:28 2 (const int) +0:30 Branch: Return with expression +0:30 'o' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 Function Definition: main( ( temp void) +0:22 Function Parameters: +0:? Sequence +0:22 move second child to first child ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 move second child to first child ( temp float) +0:? 'f' ( temp float) +0:? 'f' (layout( location=2) patch in float) +0:22 move second child to first child ( temp 3-component vector of float) +0:? 'tesscoord' ( temp 3-component vector of float) +0:? 'tesscoord' ( patch in 3-component vector of float TessCoord) +0:22 Sequence +0:22 move second child to first child ( temp float) +0:22 direct index ( temp float) +0:22 flTessFactor: direct index for structure ( temp 3-element array of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 0 (const int) +0:22 direct index ( patch in float TessLevelOuter) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:22 Constant: +0:22 0 (const int) +0:22 move second child to first child ( temp float) +0:22 direct index ( temp float) +0:22 flTessFactor: direct index for structure ( temp 3-element array of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 direct index ( patch in float TessLevelOuter) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:22 Constant: +0:22 1 (const int) +0:22 move second child to first child ( temp float) +0:22 direct index ( temp float) +0:22 flTessFactor: direct index for structure ( temp 3-element array of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 direct index ( patch in float TessLevelOuter) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:22 Constant: +0:22 2 (const int) +0:22 move second child to first child ( temp float) +0:22 flInsideTessFactor: direct index for structure ( temp float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:22 Constant: +0:22 1 (const int) +0:22 direct index ( patch in float TessLevelInner) +0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner) +0:22 Constant: +0:22 0 (const int) +0:22 Sequence +0:22 move second child to first child ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 Function Call: @main(struct-ds_in_t-vf4-vf31[3];f1;vf3;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'f' ( temp float) +0:? 'tesscoord' ( temp 3-component vector of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:22 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.pos' (layout( location=0) out 4-component vector of float) +0:22 pos: direct index for structure ( temp 4-component vector of float) +0:22 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 Constant: +0:22 0 (const int) +0:22 move second child to first child ( temp 3-component vector of float) +0:? '@entryPointOutput.norm' (layout( location=1) out 3-component vector of float) +0:22 norm: direct index for structure ( temp 3-component vector of float) +0:22 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 Constant: +0:22 1 (const int) +0:? Linker Objects +0:? '@entryPointOutput.pos' (layout( location=0) out 4-component vector of float) +0:? '@entryPointOutput.norm' (layout( location=1) out 3-component vector of float) +0:? 'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'f' (layout( location=2) patch in float) +0:? 'tesscoord' ( patch in 3-component vector of float TessCoord) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 103 + + Capability Tessellation + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationEvaluation 4 "main" 54 58 62 68 82 96 100 + ExecutionMode 4 Triangles + Source HLSL 500 + Name 4 "main" + Name 9 "ds_in_t" + MemberName 9(ds_in_t) 0 "pos" + MemberName 9(ds_in_t) 1 "norm" + Name 16 "pcf_in_t" + MemberName 16(pcf_in_t) 0 "flTessFactor" + MemberName 16(pcf_in_t) 1 "flInsideTessFactor" + Name 18 "gs_in_t" + MemberName 18(gs_in_t) 0 "pos" + MemberName 18(gs_in_t) 1 "norm" + Name 24 "@main(struct-ds_in_t-vf4-vf31[3];f1;vf3;struct-pcf_in_t-f1[3]-f11;" + Name 20 "i" + Name 21 "f" + Name 22 "tesscoord" + Name 23 "pcf_data" + Name 27 "o" + Name 52 "i" + Name 54 "i" + Name 56 "f" + Name 58 "f" + Name 60 "tesscoord" + Name 62 "tesscoord" + Name 64 "pcf_data" + Name 68 "pcf_data.flTessFactor" + Name 82 "pcf_data.flInsideTessFactor" + Name 86 "flattenTemp" + Name 88 "param" + Name 90 "param" + Name 92 "param" + Name 96 "@entryPointOutput.pos" + Name 100 "@entryPointOutput.norm" + Decorate 54(i) Location 0 + Decorate 58(f) Patch + Decorate 58(f) Location 2 + Decorate 62(tesscoord) Patch + Decorate 62(tesscoord) BuiltIn TessCoord + Decorate 68(pcf_data.flTessFactor) Patch + Decorate 68(pcf_data.flTessFactor) BuiltIn TessLevelOuter + Decorate 82(pcf_data.flInsideTessFactor) Patch + Decorate 82(pcf_data.flInsideTessFactor) BuiltIn TessLevelInner + Decorate 96(@entryPointOutput.pos) Location 0 + Decorate 100(@entryPointOutput.norm) Location 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeVector 6(float) 3 + 9(ds_in_t): TypeStruct 7(fvec4) 8(fvec3) + 10: TypeInt 32 0 + 11: 10(int) Constant 3 + 12: TypeArray 9(ds_in_t) 11 + 13: TypePointer Function 6(float) + 14: TypePointer Function 8(fvec3) + 15: TypeArray 6(float) 11 + 16(pcf_in_t): TypeStruct 15 6(float) + 17: TypePointer Function 16(pcf_in_t) + 18(gs_in_t): TypeStruct 7(fvec4) 8(fvec3) + 19: TypeFunction 18(gs_in_t) 12 13(ptr) 14(ptr) 17(ptr) + 26: TypePointer Function 18(gs_in_t) + 28: TypeInt 32 1 + 29: 28(int) Constant 0 + 31: 10(int) Constant 0 + 38: TypePointer Function 7(fvec4) + 40: 28(int) Constant 1 + 42: 10(int) Constant 1 + 51: TypePointer Function 12 + 53: TypePointer Input 12 + 54(i): 53(ptr) Variable Input + 57: TypePointer Input 6(float) + 58(f): 57(ptr) Variable Input + 61: TypePointer Input 8(fvec3) + 62(tesscoord): 61(ptr) Variable Input + 65: 10(int) Constant 4 + 66: TypeArray 6(float) 65 + 67: TypePointer Input 66 +68(pcf_data.flTessFactor): 67(ptr) Variable Input + 75: 28(int) Constant 2 + 79: 10(int) Constant 2 + 80: TypeArray 6(float) 79 + 81: TypePointer Input 80 +82(pcf_data.flInsideTessFactor): 81(ptr) Variable Input + 95: TypePointer Output 7(fvec4) +96(@entryPointOutput.pos): 95(ptr) Variable Output + 99: TypePointer Output 8(fvec3) +100(@entryPointOutput.norm): 99(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 52(i): 51(ptr) Variable Function + 56(f): 13(ptr) Variable Function + 60(tesscoord): 14(ptr) Variable Function + 64(pcf_data): 17(ptr) Variable Function + 86(flattenTemp): 26(ptr) Variable Function + 88(param): 13(ptr) Variable Function + 90(param): 14(ptr) Variable Function + 92(param): 17(ptr) Variable Function + 55: 12 Load 54(i) + Store 52(i) 55 + 59: 6(float) Load 58(f) + Store 56(f) 59 + 63: 8(fvec3) Load 62(tesscoord) + Store 60(tesscoord) 63 + 69: 57(ptr) AccessChain 68(pcf_data.flTessFactor) 29 + 70: 6(float) Load 69 + 71: 13(ptr) AccessChain 64(pcf_data) 29 29 + Store 71 70 + 72: 57(ptr) AccessChain 68(pcf_data.flTessFactor) 40 + 73: 6(float) Load 72 + 74: 13(ptr) AccessChain 64(pcf_data) 29 40 + Store 74 73 + 76: 57(ptr) AccessChain 68(pcf_data.flTessFactor) 75 + 77: 6(float) Load 76 + 78: 13(ptr) AccessChain 64(pcf_data) 29 75 + Store 78 77 + 83: 57(ptr) AccessChain 82(pcf_data.flInsideTessFactor) 29 + 84: 6(float) Load 83 + 85: 13(ptr) AccessChain 64(pcf_data) 40 + Store 85 84 + 87: 12 Load 52(i) + 89: 6(float) Load 56(f) + Store 88(param) 89 + 91: 8(fvec3) Load 60(tesscoord) + Store 90(param) 91 + 93:16(pcf_in_t) Load 64(pcf_data) + Store 92(param) 93 + 94: 18(gs_in_t) FunctionCall 24(@main(struct-ds_in_t-vf4-vf31[3];f1;vf3;struct-pcf_in_t-f1[3]-f11;) 87 88(param) 90(param) 92(param) + Store 86(flattenTemp) 94 + 97: 38(ptr) AccessChain 86(flattenTemp) 29 + 98: 7(fvec4) Load 97 + Store 96(@entryPointOutput.pos) 98 + 101: 14(ptr) AccessChain 86(flattenTemp) 40 + 102: 8(fvec3) Load 101 + Store 100(@entryPointOutput.norm) 102 + Return + FunctionEnd +24(@main(struct-ds_in_t-vf4-vf31[3];f1;vf3;struct-pcf_in_t-f1[3]-f11;): 18(gs_in_t) Function None 19 + 20(i): 12 FunctionParameter + 21(f): 13(ptr) FunctionParameter + 22(tesscoord): 14(ptr) FunctionParameter + 23(pcf_data): 17(ptr) FunctionParameter + 25: Label + 27(o): 26(ptr) Variable Function + 30: 7(fvec4) CompositeExtract 20(i) 0 0 + 32: 13(ptr) AccessChain 22(tesscoord) 31 + 33: 6(float) Load 32 + 34: 6(float) Load 21(f) + 35: 6(float) FMul 33 34 + 36: 7(fvec4) CompositeConstruct 35 35 35 35 + 37: 7(fvec4) FAdd 30 36 + 39: 38(ptr) AccessChain 27(o) 29 + Store 39 37 + 41: 8(fvec3) CompositeExtract 20(i) 0 1 + 43: 13(ptr) AccessChain 22(tesscoord) 42 + 44: 6(float) Load 43 + 45: 8(fvec3) CompositeConstruct 44 44 44 + 46: 8(fvec3) FAdd 41 45 + 47: 14(ptr) AccessChain 27(o) 40 + Store 47 46 + 48: 18(gs_in_t) Load 27(o) + ReturnValue 48 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.domain.2.tese.out b/deps/glslang/Test/baseResults/hlsl.domain.2.tese.out new file mode 100644 index 00000000..827f80f7 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.domain.2.tese.out @@ -0,0 +1,447 @@ +hlsl.domain.2.tese +Shader version: 500 +input primitive = triangles +vertex spacing = none +triangle order = none +0:? Sequence +0:25 Function Definition: @main(struct-pcf_in_t-f1[3]-f1-f11;struct-ds_in_t-vf4-vf31[3];vf3; ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 Function Parameters: +0:25 'pcf_data' ( in structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor, temp float foo}) +0:25 'i' ( const (read only) 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 'tesscoord' ( in 3-component vector of float) +0:? Sequence +0:28 move second child to first child ( temp 4-component vector of float) +0:28 pos: direct index for structure ( temp 4-component vector of float) +0:28 'o' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:28 Constant: +0:28 0 (const int) +0:28 add ( temp 4-component vector of float) +0:28 pos: direct index for structure ( temp 4-component vector of float) +0:28 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:28 'i' ( const (read only) 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 0 (const int) +0:28 direct index ( temp float) +0:28 'tesscoord' ( in 3-component vector of float) +0:28 Constant: +0:28 0 (const int) +0:29 move second child to first child ( temp 3-component vector of float) +0:29 norm: direct index for structure ( temp 3-component vector of float) +0:29 'o' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:29 Constant: +0:29 1 (const int) +0:29 add ( temp 3-component vector of float) +0:29 norm: direct index for structure ( temp 3-component vector of float) +0:29 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:29 'i' ( const (read only) 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 1 (const int) +0:29 direct index ( temp float) +0:29 'tesscoord' ( in 3-component vector of float) +0:29 Constant: +0:29 1 (const int) +0:31 direct index ( temp float) +0:31 'tesscoord' ( in 3-component vector of float) +0:31 Constant: +0:31 2 (const int) +0:33 Branch: Return with expression +0:33 'o' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 Function Definition: main( ( temp void) +0:25 Function Parameters: +0:? Sequence +0:25 Sequence +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 flTessFactor: direct index for structure ( temp 3-element array of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor, temp float foo}) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 direct index ( patch in float TessLevelOuter) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:25 Constant: +0:25 0 (const int) +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 flTessFactor: direct index for structure ( temp 3-element array of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor, temp float foo}) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 1 (const int) +0:25 direct index ( patch in float TessLevelOuter) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:25 Constant: +0:25 1 (const int) +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 flTessFactor: direct index for structure ( temp 3-element array of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor, temp float foo}) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 direct index ( patch in float TessLevelOuter) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:25 Constant: +0:25 2 (const int) +0:25 move second child to first child ( temp float) +0:25 flInsideTessFactor: direct index for structure ( temp float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor, temp float foo}) +0:25 Constant: +0:25 1 (const int) +0:25 direct index ( patch in float TessLevelInner) +0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner) +0:25 Constant: +0:25 0 (const int) +0:25 move second child to first child ( temp float) +0:25 foo: direct index for structure ( temp float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor, temp float foo}) +0:25 Constant: +0:25 2 (const int) +0:? 'pcf_data.foo' (layout( location=2) patch in float) +0:25 move second child to first child ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 move second child to first child ( temp 3-component vector of float) +0:? 'tesscoord' ( temp 3-component vector of float) +0:? 'tesscoord' ( patch in 3-component vector of float TessCoord) +0:25 Sequence +0:25 move second child to first child ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 Function Call: @main(struct-pcf_in_t-f1[3]-f1-f11;struct-ds_in_t-vf4-vf31[3];vf3; ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor, temp float foo}) +0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'tesscoord' ( temp 3-component vector of float) +0:25 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.pos' (layout( location=0) out 4-component vector of float) +0:25 pos: direct index for structure ( temp 4-component vector of float) +0:25 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 Constant: +0:25 0 (const int) +0:25 move second child to first child ( temp 3-component vector of float) +0:? '@entryPointOutput.norm' (layout( location=1) out 3-component vector of float) +0:25 norm: direct index for structure ( temp 3-component vector of float) +0:25 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 Constant: +0:25 1 (const int) +0:? Linker Objects +0:? '@entryPointOutput.pos' (layout( location=0) out 4-component vector of float) +0:? '@entryPointOutput.norm' (layout( location=1) out 3-component vector of float) +0:? 'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'tesscoord' ( patch in 3-component vector of float TessCoord) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner) +0:? 'pcf_data.foo' (layout( location=2) patch in float) + + +Linked tessellation evaluation stage: + + +Shader version: 500 +input primitive = triangles +vertex spacing = none +triangle order = none +0:? Sequence +0:25 Function Definition: @main(struct-pcf_in_t-f1[3]-f1-f11;struct-ds_in_t-vf4-vf31[3];vf3; ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 Function Parameters: +0:25 'pcf_data' ( in structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor, temp float foo}) +0:25 'i' ( const (read only) 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 'tesscoord' ( in 3-component vector of float) +0:? Sequence +0:28 move second child to first child ( temp 4-component vector of float) +0:28 pos: direct index for structure ( temp 4-component vector of float) +0:28 'o' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:28 Constant: +0:28 0 (const int) +0:28 add ( temp 4-component vector of float) +0:28 pos: direct index for structure ( temp 4-component vector of float) +0:28 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:28 'i' ( const (read only) 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 0 (const int) +0:28 direct index ( temp float) +0:28 'tesscoord' ( in 3-component vector of float) +0:28 Constant: +0:28 0 (const int) +0:29 move second child to first child ( temp 3-component vector of float) +0:29 norm: direct index for structure ( temp 3-component vector of float) +0:29 'o' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:29 Constant: +0:29 1 (const int) +0:29 add ( temp 3-component vector of float) +0:29 norm: direct index for structure ( temp 3-component vector of float) +0:29 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:29 'i' ( const (read only) 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 1 (const int) +0:29 direct index ( temp float) +0:29 'tesscoord' ( in 3-component vector of float) +0:29 Constant: +0:29 1 (const int) +0:31 direct index ( temp float) +0:31 'tesscoord' ( in 3-component vector of float) +0:31 Constant: +0:31 2 (const int) +0:33 Branch: Return with expression +0:33 'o' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 Function Definition: main( ( temp void) +0:25 Function Parameters: +0:? Sequence +0:25 Sequence +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 flTessFactor: direct index for structure ( temp 3-element array of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor, temp float foo}) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 direct index ( patch in float TessLevelOuter) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:25 Constant: +0:25 0 (const int) +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 flTessFactor: direct index for structure ( temp 3-element array of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor, temp float foo}) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 1 (const int) +0:25 direct index ( patch in float TessLevelOuter) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:25 Constant: +0:25 1 (const int) +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 flTessFactor: direct index for structure ( temp 3-element array of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor, temp float foo}) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 direct index ( patch in float TessLevelOuter) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:25 Constant: +0:25 2 (const int) +0:25 move second child to first child ( temp float) +0:25 flInsideTessFactor: direct index for structure ( temp float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor, temp float foo}) +0:25 Constant: +0:25 1 (const int) +0:25 direct index ( patch in float TessLevelInner) +0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner) +0:25 Constant: +0:25 0 (const int) +0:25 move second child to first child ( temp float) +0:25 foo: direct index for structure ( temp float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor, temp float foo}) +0:25 Constant: +0:25 2 (const int) +0:? 'pcf_data.foo' (layout( location=2) patch in float) +0:25 move second child to first child ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 move second child to first child ( temp 3-component vector of float) +0:? 'tesscoord' ( temp 3-component vector of float) +0:? 'tesscoord' ( patch in 3-component vector of float TessCoord) +0:25 Sequence +0:25 move second child to first child ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 Function Call: @main(struct-pcf_in_t-f1[3]-f1-f11;struct-ds_in_t-vf4-vf31[3];vf3; ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor, temp float foo}) +0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'tesscoord' ( temp 3-component vector of float) +0:25 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.pos' (layout( location=0) out 4-component vector of float) +0:25 pos: direct index for structure ( temp 4-component vector of float) +0:25 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 Constant: +0:25 0 (const int) +0:25 move second child to first child ( temp 3-component vector of float) +0:? '@entryPointOutput.norm' (layout( location=1) out 3-component vector of float) +0:25 norm: direct index for structure ( temp 3-component vector of float) +0:25 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:25 Constant: +0:25 1 (const int) +0:? Linker Objects +0:? '@entryPointOutput.pos' (layout( location=0) out 4-component vector of float) +0:? '@entryPointOutput.norm' (layout( location=1) out 3-component vector of float) +0:? 'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'tesscoord' ( patch in 3-component vector of float TessCoord) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner) +0:? 'pcf_data.foo' (layout( location=2) patch in float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 98 + + Capability Tessellation + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationEvaluation 4 "main" 52 67 71 77 81 91 95 + ExecutionMode 4 Triangles + Source HLSL 500 + Name 4 "main" + Name 10 "pcf_in_t" + MemberName 10(pcf_in_t) 0 "flTessFactor" + MemberName 10(pcf_in_t) 1 "flInsideTessFactor" + MemberName 10(pcf_in_t) 2 "foo" + Name 14 "ds_in_t" + MemberName 14(ds_in_t) 0 "pos" + MemberName 14(ds_in_t) 1 "norm" + Name 17 "gs_in_t" + MemberName 17(gs_in_t) 0 "pos" + MemberName 17(gs_in_t) 1 "norm" + Name 22 "@main(struct-pcf_in_t-f1[3]-f1-f11;struct-ds_in_t-vf4-vf31[3];vf3;" + Name 19 "pcf_data" + Name 20 "i" + Name 21 "tesscoord" + Name 25 "o" + Name 48 "pcf_data" + Name 52 "pcf_data.flTessFactor" + Name 67 "pcf_data.flInsideTessFactor" + Name 71 "pcf_data.foo" + Name 75 "i" + Name 77 "i" + Name 79 "tesscoord" + Name 81 "tesscoord" + Name 83 "flattenTemp" + Name 85 "param" + Name 87 "param" + Name 91 "@entryPointOutput.pos" + Name 95 "@entryPointOutput.norm" + Decorate 52(pcf_data.flTessFactor) Patch + Decorate 52(pcf_data.flTessFactor) BuiltIn TessLevelOuter + Decorate 67(pcf_data.flInsideTessFactor) Patch + Decorate 67(pcf_data.flInsideTessFactor) BuiltIn TessLevelInner + Decorate 71(pcf_data.foo) Patch + Decorate 71(pcf_data.foo) Location 2 + Decorate 77(i) Location 0 + Decorate 81(tesscoord) Patch + Decorate 81(tesscoord) BuiltIn TessCoord + Decorate 91(@entryPointOutput.pos) Location 0 + Decorate 95(@entryPointOutput.norm) Location 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeInt 32 0 + 8: 7(int) Constant 3 + 9: TypeArray 6(float) 8 + 10(pcf_in_t): TypeStruct 9 6(float) 6(float) + 11: TypePointer Function 10(pcf_in_t) + 12: TypeVector 6(float) 4 + 13: TypeVector 6(float) 3 + 14(ds_in_t): TypeStruct 12(fvec4) 13(fvec3) + 15: TypeArray 14(ds_in_t) 8 + 16: TypePointer Function 13(fvec3) + 17(gs_in_t): TypeStruct 12(fvec4) 13(fvec3) + 18: TypeFunction 17(gs_in_t) 11(ptr) 15 16(ptr) + 24: TypePointer Function 17(gs_in_t) + 26: TypeInt 32 1 + 27: 26(int) Constant 0 + 29: 7(int) Constant 0 + 30: TypePointer Function 6(float) + 35: TypePointer Function 12(fvec4) + 37: 26(int) Constant 1 + 39: 7(int) Constant 1 + 49: 7(int) Constant 4 + 50: TypeArray 6(float) 49 + 51: TypePointer Input 50 +52(pcf_data.flTessFactor): 51(ptr) Variable Input + 53: TypePointer Input 6(float) + 60: 26(int) Constant 2 + 64: 7(int) Constant 2 + 65: TypeArray 6(float) 64 + 66: TypePointer Input 65 +67(pcf_data.flInsideTessFactor): 66(ptr) Variable Input +71(pcf_data.foo): 53(ptr) Variable Input + 74: TypePointer Function 15 + 76: TypePointer Input 15 + 77(i): 76(ptr) Variable Input + 80: TypePointer Input 13(fvec3) + 81(tesscoord): 80(ptr) Variable Input + 90: TypePointer Output 12(fvec4) +91(@entryPointOutput.pos): 90(ptr) Variable Output + 94: TypePointer Output 13(fvec3) +95(@entryPointOutput.norm): 94(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 48(pcf_data): 11(ptr) Variable Function + 75(i): 74(ptr) Variable Function + 79(tesscoord): 16(ptr) Variable Function + 83(flattenTemp): 24(ptr) Variable Function + 85(param): 11(ptr) Variable Function + 87(param): 16(ptr) Variable Function + 54: 53(ptr) AccessChain 52(pcf_data.flTessFactor) 27 + 55: 6(float) Load 54 + 56: 30(ptr) AccessChain 48(pcf_data) 27 27 + Store 56 55 + 57: 53(ptr) AccessChain 52(pcf_data.flTessFactor) 37 + 58: 6(float) Load 57 + 59: 30(ptr) AccessChain 48(pcf_data) 27 37 + Store 59 58 + 61: 53(ptr) AccessChain 52(pcf_data.flTessFactor) 60 + 62: 6(float) Load 61 + 63: 30(ptr) AccessChain 48(pcf_data) 27 60 + Store 63 62 + 68: 53(ptr) AccessChain 67(pcf_data.flInsideTessFactor) 27 + 69: 6(float) Load 68 + 70: 30(ptr) AccessChain 48(pcf_data) 37 + Store 70 69 + 72: 6(float) Load 71(pcf_data.foo) + 73: 30(ptr) AccessChain 48(pcf_data) 60 + Store 73 72 + 78: 15 Load 77(i) + Store 75(i) 78 + 82: 13(fvec3) Load 81(tesscoord) + Store 79(tesscoord) 82 + 84: 15 Load 75(i) + 86:10(pcf_in_t) Load 48(pcf_data) + Store 85(param) 86 + 88: 13(fvec3) Load 79(tesscoord) + Store 87(param) 88 + 89: 17(gs_in_t) FunctionCall 22(@main(struct-pcf_in_t-f1[3]-f1-f11;struct-ds_in_t-vf4-vf31[3];vf3;) 85(param) 84 87(param) + Store 83(flattenTemp) 89 + 92: 35(ptr) AccessChain 83(flattenTemp) 27 + 93: 12(fvec4) Load 92 + Store 91(@entryPointOutput.pos) 93 + 96: 16(ptr) AccessChain 83(flattenTemp) 37 + 97: 13(fvec3) Load 96 + Store 95(@entryPointOutput.norm) 97 + Return + FunctionEnd +22(@main(struct-pcf_in_t-f1[3]-f1-f11;struct-ds_in_t-vf4-vf31[3];vf3;): 17(gs_in_t) Function None 18 + 19(pcf_data): 11(ptr) FunctionParameter + 20(i): 15 FunctionParameter + 21(tesscoord): 16(ptr) FunctionParameter + 23: Label + 25(o): 24(ptr) Variable Function + 28: 12(fvec4) CompositeExtract 20(i) 0 0 + 31: 30(ptr) AccessChain 21(tesscoord) 29 + 32: 6(float) Load 31 + 33: 12(fvec4) CompositeConstruct 32 32 32 32 + 34: 12(fvec4) FAdd 28 33 + 36: 35(ptr) AccessChain 25(o) 27 + Store 36 34 + 38: 13(fvec3) CompositeExtract 20(i) 0 1 + 40: 30(ptr) AccessChain 21(tesscoord) 39 + 41: 6(float) Load 40 + 42: 13(fvec3) CompositeConstruct 41 41 41 + 43: 13(fvec3) FAdd 38 42 + 44: 16(ptr) AccessChain 25(o) 37 + Store 44 43 + 45: 17(gs_in_t) Load 25(o) + ReturnValue 45 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.domain.3.tese.out b/deps/glslang/Test/baseResults/hlsl.domain.3.tese.out new file mode 100644 index 00000000..dd3d502a --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.domain.3.tese.out @@ -0,0 +1,424 @@ +hlsl.domain.3.tese +Shader version: 500 +input primitive = isolines +vertex spacing = none +triangle order = none +0:? Sequence +0:24 Function Definition: @main(struct-ds_in_t-vf4-vf31[2];vf2;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:24 Function Parameters: +0:24 'i' ( const (read only) 2-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:24 'tesscoord' ( in 2-component vector of float) +0:24 'pcf_data' ( in structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:? Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 pos: direct index for structure ( temp 4-component vector of float) +0:27 'o' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:27 Constant: +0:27 0 (const int) +0:27 add ( temp 4-component vector of float) +0:27 pos: direct index for structure ( temp 4-component vector of float) +0:27 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:27 'i' ( const (read only) 2-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 0 (const int) +0:27 direct index ( temp float) +0:27 'tesscoord' ( in 2-component vector of float) +0:27 Constant: +0:27 0 (const int) +0:28 move second child to first child ( temp 3-component vector of float) +0:28 norm: direct index for structure ( temp 3-component vector of float) +0:28 'o' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:28 Constant: +0:28 1 (const int) +0:28 add ( temp 3-component vector of float) +0:28 norm: direct index for structure ( temp 3-component vector of float) +0:28 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:28 'i' ( const (read only) 2-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 1 (const int) +0:28 direct index ( temp float) +0:28 'tesscoord' ( in 2-component vector of float) +0:28 Constant: +0:28 1 (const int) +0:30 Branch: Return with expression +0:30 'o' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 move second child to first child ( temp 2-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'i' ( temp 2-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'i' (layout( location=0) in 2-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:24 move second child to first child ( temp 2-component vector of float) +0:? 'tesscoord' ( temp 2-component vector of float) +0:? Construct vec2 ( temp 2-component vector of float) +0:? 'tesscoord' ( patch in 3-component vector of float TessCoord) +0:24 Sequence +0:24 move second child to first child ( temp float) +0:24 direct index ( temp float) +0:24 flTessFactor: direct index for structure ( temp 3-element array of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 0 (const int) +0:24 direct index ( patch in float TessLevelOuter) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:24 direct index ( temp float) +0:24 flTessFactor: direct index for structure ( temp 3-element array of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 1 (const int) +0:24 direct index ( patch in float TessLevelOuter) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:24 Constant: +0:24 1 (const int) +0:24 move second child to first child ( temp float) +0:24 direct index ( temp float) +0:24 flTessFactor: direct index for structure ( temp 3-element array of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 direct index ( patch in float TessLevelOuter) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:24 Constant: +0:24 2 (const int) +0:24 move second child to first child ( temp float) +0:24 flInsideTessFactor: direct index for structure ( temp float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:24 Constant: +0:24 1 (const int) +0:24 direct index ( patch in float TessLevelInner) +0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner) +0:24 Constant: +0:24 0 (const int) +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:24 Function Call: @main(struct-ds_in_t-vf4-vf31[2];vf2;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'i' ( temp 2-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'tesscoord' ( temp 2-component vector of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.pos' (layout( location=0) out 4-component vector of float) +0:24 pos: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp 3-component vector of float) +0:? '@entryPointOutput.norm' (layout( location=1) out 3-component vector of float) +0:24 norm: direct index for structure ( temp 3-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? '@entryPointOutput.pos' (layout( location=0) out 4-component vector of float) +0:? '@entryPointOutput.norm' (layout( location=1) out 3-component vector of float) +0:? 'i' (layout( location=0) in 2-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'tesscoord' ( patch in 3-component vector of float TessCoord) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner) + + +Linked tessellation evaluation stage: + + +Shader version: 500 +input primitive = isolines +vertex spacing = none +triangle order = none +0:? Sequence +0:24 Function Definition: @main(struct-ds_in_t-vf4-vf31[2];vf2;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:24 Function Parameters: +0:24 'i' ( const (read only) 2-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:24 'tesscoord' ( in 2-component vector of float) +0:24 'pcf_data' ( in structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:? Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 pos: direct index for structure ( temp 4-component vector of float) +0:27 'o' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:27 Constant: +0:27 0 (const int) +0:27 add ( temp 4-component vector of float) +0:27 pos: direct index for structure ( temp 4-component vector of float) +0:27 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:27 'i' ( const (read only) 2-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 0 (const int) +0:27 direct index ( temp float) +0:27 'tesscoord' ( in 2-component vector of float) +0:27 Constant: +0:27 0 (const int) +0:28 move second child to first child ( temp 3-component vector of float) +0:28 norm: direct index for structure ( temp 3-component vector of float) +0:28 'o' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:28 Constant: +0:28 1 (const int) +0:28 add ( temp 3-component vector of float) +0:28 norm: direct index for structure ( temp 3-component vector of float) +0:28 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:28 'i' ( const (read only) 2-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 1 (const int) +0:28 direct index ( temp float) +0:28 'tesscoord' ( in 2-component vector of float) +0:28 Constant: +0:28 1 (const int) +0:30 Branch: Return with expression +0:30 'o' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 move second child to first child ( temp 2-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'i' ( temp 2-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'i' (layout( location=0) in 2-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:24 move second child to first child ( temp 2-component vector of float) +0:? 'tesscoord' ( temp 2-component vector of float) +0:? Construct vec2 ( temp 2-component vector of float) +0:? 'tesscoord' ( patch in 3-component vector of float TessCoord) +0:24 Sequence +0:24 move second child to first child ( temp float) +0:24 direct index ( temp float) +0:24 flTessFactor: direct index for structure ( temp 3-element array of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 0 (const int) +0:24 direct index ( patch in float TessLevelOuter) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:24 direct index ( temp float) +0:24 flTessFactor: direct index for structure ( temp 3-element array of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 1 (const int) +0:24 direct index ( patch in float TessLevelOuter) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:24 Constant: +0:24 1 (const int) +0:24 move second child to first child ( temp float) +0:24 direct index ( temp float) +0:24 flTessFactor: direct index for structure ( temp 3-element array of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 direct index ( patch in float TessLevelOuter) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:24 Constant: +0:24 2 (const int) +0:24 move second child to first child ( temp float) +0:24 flInsideTessFactor: direct index for structure ( temp float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:24 Constant: +0:24 1 (const int) +0:24 direct index ( patch in float TessLevelInner) +0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner) +0:24 Constant: +0:24 0 (const int) +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:24 Function Call: @main(struct-ds_in_t-vf4-vf31[2];vf2;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'i' ( temp 2-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'tesscoord' ( temp 2-component vector of float) +0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.pos' (layout( location=0) out 4-component vector of float) +0:24 pos: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp 3-component vector of float) +0:? '@entryPointOutput.norm' (layout( location=1) out 3-component vector of float) +0:24 norm: direct index for structure ( temp 3-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? '@entryPointOutput.pos' (layout( location=0) out 4-component vector of float) +0:? '@entryPointOutput.norm' (layout( location=1) out 3-component vector of float) +0:? 'i' (layout( location=0) in 2-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'tesscoord' ( patch in 3-component vector of float TessCoord) +0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) +0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 100 + + Capability Tessellation + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationEvaluation 4 "main" 54 58 67 81 93 97 + ExecutionMode 4 Isolines + Source HLSL 500 + Name 4 "main" + Name 9 "ds_in_t" + MemberName 9(ds_in_t) 0 "pos" + MemberName 9(ds_in_t) 1 "norm" + Name 17 "pcf_in_t" + MemberName 17(pcf_in_t) 0 "flTessFactor" + MemberName 17(pcf_in_t) 1 "flInsideTessFactor" + Name 19 "gs_in_t" + MemberName 19(gs_in_t) 0 "pos" + MemberName 19(gs_in_t) 1 "norm" + Name 24 "@main(struct-ds_in_t-vf4-vf31[2];vf2;struct-pcf_in_t-f1[3]-f11;" + Name 21 "i" + Name 22 "tesscoord" + Name 23 "pcf_data" + Name 27 "o" + Name 52 "i" + Name 54 "i" + Name 56 "tesscoord" + Name 58 "tesscoord" + Name 63 "pcf_data" + Name 67 "pcf_data.flTessFactor" + Name 81 "pcf_data.flInsideTessFactor" + Name 85 "flattenTemp" + Name 87 "param" + Name 89 "param" + Name 93 "@entryPointOutput.pos" + Name 97 "@entryPointOutput.norm" + Decorate 54(i) Location 0 + Decorate 58(tesscoord) Patch + Decorate 58(tesscoord) BuiltIn TessCoord + Decorate 67(pcf_data.flTessFactor) Patch + Decorate 67(pcf_data.flTessFactor) BuiltIn TessLevelOuter + Decorate 81(pcf_data.flInsideTessFactor) Patch + Decorate 81(pcf_data.flInsideTessFactor) BuiltIn TessLevelInner + Decorate 93(@entryPointOutput.pos) Location 0 + Decorate 97(@entryPointOutput.norm) Location 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeVector 6(float) 3 + 9(ds_in_t): TypeStruct 7(fvec4) 8(fvec3) + 10: TypeInt 32 0 + 11: 10(int) Constant 2 + 12: TypeArray 9(ds_in_t) 11 + 13: TypeVector 6(float) 2 + 14: TypePointer Function 13(fvec2) + 15: 10(int) Constant 3 + 16: TypeArray 6(float) 15 + 17(pcf_in_t): TypeStruct 16 6(float) + 18: TypePointer Function 17(pcf_in_t) + 19(gs_in_t): TypeStruct 7(fvec4) 8(fvec3) + 20: TypeFunction 19(gs_in_t) 12 14(ptr) 18(ptr) + 26: TypePointer Function 19(gs_in_t) + 28: TypeInt 32 1 + 29: 28(int) Constant 0 + 31: 10(int) Constant 0 + 32: TypePointer Function 6(float) + 37: TypePointer Function 7(fvec4) + 39: 28(int) Constant 1 + 41: 10(int) Constant 1 + 46: TypePointer Function 8(fvec3) + 51: TypePointer Function 12 + 53: TypePointer Input 12 + 54(i): 53(ptr) Variable Input + 57: TypePointer Input 8(fvec3) + 58(tesscoord): 57(ptr) Variable Input + 64: 10(int) Constant 4 + 65: TypeArray 6(float) 64 + 66: TypePointer Input 65 +67(pcf_data.flTessFactor): 66(ptr) Variable Input + 68: TypePointer Input 6(float) + 75: 28(int) Constant 2 + 79: TypeArray 6(float) 11 + 80: TypePointer Input 79 +81(pcf_data.flInsideTessFactor): 80(ptr) Variable Input + 92: TypePointer Output 7(fvec4) +93(@entryPointOutput.pos): 92(ptr) Variable Output + 96: TypePointer Output 8(fvec3) +97(@entryPointOutput.norm): 96(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 52(i): 51(ptr) Variable Function + 56(tesscoord): 14(ptr) Variable Function + 63(pcf_data): 18(ptr) Variable Function + 85(flattenTemp): 26(ptr) Variable Function + 87(param): 14(ptr) Variable Function + 89(param): 18(ptr) Variable Function + 55: 12 Load 54(i) + Store 52(i) 55 + 59: 8(fvec3) Load 58(tesscoord) + 60: 6(float) CompositeExtract 59 0 + 61: 6(float) CompositeExtract 59 1 + 62: 13(fvec2) CompositeConstruct 60 61 + Store 56(tesscoord) 62 + 69: 68(ptr) AccessChain 67(pcf_data.flTessFactor) 29 + 70: 6(float) Load 69 + 71: 32(ptr) AccessChain 63(pcf_data) 29 29 + Store 71 70 + 72: 68(ptr) AccessChain 67(pcf_data.flTessFactor) 39 + 73: 6(float) Load 72 + 74: 32(ptr) AccessChain 63(pcf_data) 29 39 + Store 74 73 + 76: 68(ptr) AccessChain 67(pcf_data.flTessFactor) 75 + 77: 6(float) Load 76 + 78: 32(ptr) AccessChain 63(pcf_data) 29 75 + Store 78 77 + 82: 68(ptr) AccessChain 81(pcf_data.flInsideTessFactor) 29 + 83: 6(float) Load 82 + 84: 32(ptr) AccessChain 63(pcf_data) 39 + Store 84 83 + 86: 12 Load 52(i) + 88: 13(fvec2) Load 56(tesscoord) + Store 87(param) 88 + 90:17(pcf_in_t) Load 63(pcf_data) + Store 89(param) 90 + 91: 19(gs_in_t) FunctionCall 24(@main(struct-ds_in_t-vf4-vf31[2];vf2;struct-pcf_in_t-f1[3]-f11;) 86 87(param) 89(param) + Store 85(flattenTemp) 91 + 94: 37(ptr) AccessChain 85(flattenTemp) 29 + 95: 7(fvec4) Load 94 + Store 93(@entryPointOutput.pos) 95 + 98: 46(ptr) AccessChain 85(flattenTemp) 39 + 99: 8(fvec3) Load 98 + Store 97(@entryPointOutput.norm) 99 + Return + FunctionEnd +24(@main(struct-ds_in_t-vf4-vf31[2];vf2;struct-pcf_in_t-f1[3]-f11;): 19(gs_in_t) Function None 20 + 21(i): 12 FunctionParameter + 22(tesscoord): 14(ptr) FunctionParameter + 23(pcf_data): 18(ptr) FunctionParameter + 25: Label + 27(o): 26(ptr) Variable Function + 30: 7(fvec4) CompositeExtract 21(i) 0 0 + 33: 32(ptr) AccessChain 22(tesscoord) 31 + 34: 6(float) Load 33 + 35: 7(fvec4) CompositeConstruct 34 34 34 34 + 36: 7(fvec4) FAdd 30 35 + 38: 37(ptr) AccessChain 27(o) 29 + Store 38 36 + 40: 8(fvec3) CompositeExtract 21(i) 0 1 + 42: 32(ptr) AccessChain 22(tesscoord) 41 + 43: 6(float) Load 42 + 44: 8(fvec3) CompositeConstruct 43 43 43 + 45: 8(fvec3) FAdd 40 44 + 47: 46(ptr) AccessChain 27(o) 39 + Store 47 45 + 48: 19(gs_in_t) Load 27(o) + ReturnValue 48 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.emptystruct.init.vert.out b/deps/glslang/Test/baseResults/hlsl.emptystruct.init.vert.out new file mode 100644 index 00000000..410915cf --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.emptystruct.init.vert.out @@ -0,0 +1,112 @@ +hlsl.emptystruct.init.vert +WARNING: 0:3: 'Test_Empty' : variable with qualifier 'const' not initialized; zero initializing + +Shader version: 500 +0:? Sequence +0:6 Function Definition: @main(u1; ( temp 4-component vector of float) +0:6 Function Parameters: +0:6 'vertexIndex' ( in uint) +0:? Sequence +0:7 Branch: Return with expression +0:7 Constant: +0:7 0.000000 +0:7 0.000000 +0:7 0.000000 +0:7 0.000000 +0:6 Function Definition: main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:6 move second child to first child ( temp uint) +0:? 'vertexIndex' ( temp uint) +0:? 'vertexIndex' (layout( location=0) in uint) +0:6 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:6 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'vertexIndex' ( temp uint) +0:? Linker Objects +0:? 'Test_Empty' ( const structure{}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'vertexIndex' (layout( location=0) in uint) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:6 Function Definition: @main(u1; ( temp 4-component vector of float) +0:6 Function Parameters: +0:6 'vertexIndex' ( in uint) +0:? Sequence +0:7 Branch: Return with expression +0:7 Constant: +0:7 0.000000 +0:7 0.000000 +0:7 0.000000 +0:7 0.000000 +0:6 Function Definition: main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:6 move second child to first child ( temp uint) +0:? 'vertexIndex' ( temp uint) +0:? 'vertexIndex' (layout( location=0) in uint) +0:6 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:6 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'vertexIndex' ( temp uint) +0:? Linker Objects +0:? 'Test_Empty' ( const structure{}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'vertexIndex' (layout( location=0) in uint) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 29 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 20 23 + Source HLSL 500 + Name 4 "main" + Name 12 "@main(u1;" + Name 11 "vertexIndex" + Name 18 "vertexIndex" + Name 20 "vertexIndex" + Name 23 "@entryPointOutput" + Name 24 "param" + Name 27 "Test" + Decorate 20(vertexIndex) Location 0 + Decorate 23(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeFunction 9(fvec4) 7(ptr) + 14: 8(float) Constant 0 + 15: 9(fvec4) ConstantComposite 14 14 14 14 + 19: TypePointer Input 6(int) + 20(vertexIndex): 19(ptr) Variable Input + 22: TypePointer Output 9(fvec4) +23(@entryPointOutput): 22(ptr) Variable Output + 27(Test): TypeStruct + 28: 27(Test) ConstantComposite + 4(main): 2 Function None 3 + 5: Label + 18(vertexIndex): 7(ptr) Variable Function + 24(param): 7(ptr) Variable Function + 21: 6(int) Load 20(vertexIndex) + Store 18(vertexIndex) 21 + 25: 6(int) Load 18(vertexIndex) + Store 24(param) 25 + 26: 9(fvec4) FunctionCall 12(@main(u1;) 24(param) + Store 23(@entryPointOutput) 26 + Return + FunctionEnd + 12(@main(u1;): 9(fvec4) Function None 10 + 11(vertexIndex): 7(ptr) FunctionParameter + 13: Label + ReturnValue 15 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.emptystructreturn.frag.out b/deps/glslang/Test/baseResults/hlsl.emptystructreturn.frag.out new file mode 100644 index 00000000..34a635c7 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.emptystructreturn.frag.out @@ -0,0 +1,105 @@ +hlsl.emptystructreturn.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:10 Function Definition: @main(struct-ps_in1; ( temp structure{}) +0:10 Function Parameters: +0:10 'i' ( in structure{}) +0:? Sequence +0:12 Branch: Return with expression +0:12 'o' ( temp structure{}) +0:10 Function Definition: main( ( temp void) +0:10 Function Parameters: +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp structure{}) +0:? 'i' ( temp structure{}) +0:? 'i' ( in structure{}) +0:10 Sequence +0:10 move second child to first child ( temp structure{}) +0:? '@entryPointOutput' ( out structure{}) +0:10 Function Call: @main(struct-ps_in1; ( temp structure{}) +0:? 'i' ( temp structure{}) +0:? Linker Objects + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:10 Function Definition: @main(struct-ps_in1; ( temp structure{}) +0:10 Function Parameters: +0:10 'i' ( in structure{}) +0:? Sequence +0:12 Branch: Return with expression +0:12 'o' ( temp structure{}) +0:10 Function Definition: main( ( temp void) +0:10 Function Parameters: +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp structure{}) +0:? 'i' ( temp structure{}) +0:? 'i' ( in structure{}) +0:10 Sequence +0:10 move second child to first child ( temp structure{}) +0:? '@entryPointOutput' ( out structure{}) +0:10 Function Call: @main(struct-ps_in1; ( temp structure{}) +0:? 'i' ( temp structure{}) +0:? Linker Objects + +error: SPIRV-Tools Validation Errors +error: Input variable id <20> is used by entry point 'main' id <4>, but is not listed as an interface + %i_1 = OpVariable %_ptr_Input_ps_in Input + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 27 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 6 "ps_in" + Name 8 "ps_out" + Name 11 "@main(struct-ps_in1;" + Name 10 "i" + Name 14 "o" + Name 18 "i" + Name 20 "i" + Name 23 "@entryPointOutput" + Name 24 "param" + 2: TypeVoid + 3: TypeFunction 2 + 6(ps_in): TypeStruct + 7: TypePointer Function 6(ps_in) + 8(ps_out): TypeStruct + 9: TypeFunction 8(ps_out) 7(ptr) + 13: TypePointer Function 8(ps_out) + 19: TypePointer Input 6(ps_in) + 20(i): 19(ptr) Variable Input + 22: TypePointer Output 8(ps_out) +23(@entryPointOutput): 22(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 18(i): 7(ptr) Variable Function + 24(param): 7(ptr) Variable Function + 21: 6(ps_in) Load 20(i) + Store 18(i) 21 + 25: 6(ps_in) Load 18(i) + Store 24(param) 25 + 26: 8(ps_out) FunctionCall 11(@main(struct-ps_in1;) 24(param) + Store 23(@entryPointOutput) 26 + Return + FunctionEnd +11(@main(struct-ps_in1;): 8(ps_out) Function None 9 + 10(i): 7(ptr) FunctionParameter + 12: Label + 14(o): 13(ptr) Variable Function + 15: 8(ps_out) Load 14(o) + ReturnValue 15 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.emptystructreturn.vert.out b/deps/glslang/Test/baseResults/hlsl.emptystructreturn.vert.out new file mode 100644 index 00000000..61704586 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.emptystructreturn.vert.out @@ -0,0 +1,102 @@ +hlsl.emptystructreturn.vert +Shader version: 500 +0:? Sequence +0:10 Function Definition: @main(struct-vs_in1; ( temp structure{}) +0:10 Function Parameters: +0:10 'i' ( in structure{}) +0:? Sequence +0:12 Branch: Return with expression +0:12 'o' ( temp structure{}) +0:10 Function Definition: main( ( temp void) +0:10 Function Parameters: +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp structure{}) +0:? 'i' ( temp structure{}) +0:? 'i' ( in structure{}) +0:10 Sequence +0:10 move second child to first child ( temp structure{}) +0:? '@entryPointOutput' ( out structure{}) +0:10 Function Call: @main(struct-vs_in1; ( temp structure{}) +0:? 'i' ( temp structure{}) +0:? Linker Objects + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:10 Function Definition: @main(struct-vs_in1; ( temp structure{}) +0:10 Function Parameters: +0:10 'i' ( in structure{}) +0:? Sequence +0:12 Branch: Return with expression +0:12 'o' ( temp structure{}) +0:10 Function Definition: main( ( temp void) +0:10 Function Parameters: +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp structure{}) +0:? 'i' ( temp structure{}) +0:? 'i' ( in structure{}) +0:10 Sequence +0:10 move second child to first child ( temp structure{}) +0:? '@entryPointOutput' ( out structure{}) +0:10 Function Call: @main(struct-vs_in1; ( temp structure{}) +0:? 'i' ( temp structure{}) +0:? Linker Objects + +error: SPIRV-Tools Validation Errors +error: Input variable id <20> is used by entry point 'main' id <4>, but is not listed as an interface + %i_1 = OpVariable %_ptr_Input_vs_in Input + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 27 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" + Source HLSL 500 + Name 4 "main" + Name 6 "vs_in" + Name 8 "vs_out" + Name 11 "@main(struct-vs_in1;" + Name 10 "i" + Name 14 "o" + Name 18 "i" + Name 20 "i" + Name 23 "@entryPointOutput" + Name 24 "param" + 2: TypeVoid + 3: TypeFunction 2 + 6(vs_in): TypeStruct + 7: TypePointer Function 6(vs_in) + 8(vs_out): TypeStruct + 9: TypeFunction 8(vs_out) 7(ptr) + 13: TypePointer Function 8(vs_out) + 19: TypePointer Input 6(vs_in) + 20(i): 19(ptr) Variable Input + 22: TypePointer Output 8(vs_out) +23(@entryPointOutput): 22(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 18(i): 7(ptr) Variable Function + 24(param): 7(ptr) Variable Function + 21: 6(vs_in) Load 20(i) + Store 18(i) 21 + 25: 6(vs_in) Load 18(i) + Store 24(param) 25 + 26: 8(vs_out) FunctionCall 11(@main(struct-vs_in1;) 24(param) + Store 23(@entryPointOutput) 26 + Return + FunctionEnd +11(@main(struct-vs_in1;): 8(vs_out) Function None 9 + 10(i): 7(ptr) FunctionParameter + 12: Label + 14(o): 13(ptr) Variable Function + 15: 8(vs_out) Load 14(o) + ReturnValue 15 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.entry-in.frag.out b/deps/glslang/Test/baseResults/hlsl.entry-in.frag.out new file mode 100644 index 00000000..dc9eea4a --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.entry-in.frag.out @@ -0,0 +1,286 @@ +hlsl.entry-in.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: fun(struct-InParam-vf2-vf4-vi21; ( temp float) +0:8 Function Parameters: +0:8 'p' ( in structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:? Sequence +0:9 Branch: Return with expression +0:9 add ( temp float) +0:9 direct index ( temp float) +0:9 v: direct index for structure ( temp 2-component vector of float) +0:9 'p' ( in structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:9 Constant: +0:9 0 (const int) +0:9 Constant: +0:9 1 (const int) +0:9 direct index ( temp float) +0:9 fragCoord: direct index for structure ( temp 4-component vector of float) +0:9 'p' ( in structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:9 Constant: +0:9 1 (const int) +0:9 Constant: +0:9 0 (const int) +0:13 Function Definition: @PixelShaderFunction(struct-InParam-vf2-vf4-vi21; ( temp 4-component vector of float) +0:13 Function Parameters: +0:13 'i' ( in structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:? Sequence +0:15 move second child to first child ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:15 'local' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:15 'i' ( in structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:16 Sequence +0:16 move second child to first child ( temp float) +0:16 'ret1' ( temp float) +0:16 Function Call: fun(struct-InParam-vf2-vf4-vi21; ( temp float) +0:16 'local' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:17 Sequence +0:17 move second child to first child ( temp float) +0:17 'ret2' ( temp float) +0:17 Function Call: fun(struct-InParam-vf2-vf4-vi21; ( temp float) +0:17 'i' ( in structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:19 Branch: Return with expression +0:19 vector-scale ( temp 4-component vector of float) +0:19 vector-scale ( temp 4-component vector of float) +0:19 fragCoord: direct index for structure ( temp 4-component vector of float) +0:19 'local' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:19 Constant: +0:19 1 (const int) +0:19 'ret1' ( temp float) +0:19 'ret2' ( temp float) +0:13 Function Definition: PixelShaderFunction( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp 2-component vector of float) +0:13 v: direct index for structure ( temp 2-component vector of float) +0:? 'i' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:13 Constant: +0:13 0 (const int) +0:? 'i.v' (layout( location=0) in 2-component vector of float) +0:13 move second child to first child ( temp 4-component vector of float) +0:13 fragCoord: direct index for structure ( temp 4-component vector of float) +0:? 'i' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:13 Constant: +0:13 1 (const int) +0:? 'i.fragCoord' ( in 4-component vector of float FragCoord) +0:13 move second child to first child ( temp 2-component vector of int) +0:13 i2: direct index for structure ( temp 2-component vector of int) +0:? 'i' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:13 Constant: +0:13 2 (const int) +0:? 'i.i2' (layout( location=1) flat in 2-component vector of int) +0:13 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:13 Function Call: @PixelShaderFunction(struct-InParam-vf2-vf4-vi21; ( temp 4-component vector of float) +0:? 'i' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'i.fragCoord' ( in 4-component vector of float FragCoord) +0:? 'i.v' (layout( location=0) in 2-component vector of float) +0:? 'i.i2' (layout( location=1) flat in 2-component vector of int) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: fun(struct-InParam-vf2-vf4-vi21; ( temp float) +0:8 Function Parameters: +0:8 'p' ( in structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:? Sequence +0:9 Branch: Return with expression +0:9 add ( temp float) +0:9 direct index ( temp float) +0:9 v: direct index for structure ( temp 2-component vector of float) +0:9 'p' ( in structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:9 Constant: +0:9 0 (const int) +0:9 Constant: +0:9 1 (const int) +0:9 direct index ( temp float) +0:9 fragCoord: direct index for structure ( temp 4-component vector of float) +0:9 'p' ( in structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:9 Constant: +0:9 1 (const int) +0:9 Constant: +0:9 0 (const int) +0:13 Function Definition: @PixelShaderFunction(struct-InParam-vf2-vf4-vi21; ( temp 4-component vector of float) +0:13 Function Parameters: +0:13 'i' ( in structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:? Sequence +0:15 move second child to first child ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:15 'local' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:15 'i' ( in structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:16 Sequence +0:16 move second child to first child ( temp float) +0:16 'ret1' ( temp float) +0:16 Function Call: fun(struct-InParam-vf2-vf4-vi21; ( temp float) +0:16 'local' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:17 Sequence +0:17 move second child to first child ( temp float) +0:17 'ret2' ( temp float) +0:17 Function Call: fun(struct-InParam-vf2-vf4-vi21; ( temp float) +0:17 'i' ( in structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:19 Branch: Return with expression +0:19 vector-scale ( temp 4-component vector of float) +0:19 vector-scale ( temp 4-component vector of float) +0:19 fragCoord: direct index for structure ( temp 4-component vector of float) +0:19 'local' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:19 Constant: +0:19 1 (const int) +0:19 'ret1' ( temp float) +0:19 'ret2' ( temp float) +0:13 Function Definition: PixelShaderFunction( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp 2-component vector of float) +0:13 v: direct index for structure ( temp 2-component vector of float) +0:? 'i' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:13 Constant: +0:13 0 (const int) +0:? 'i.v' (layout( location=0) in 2-component vector of float) +0:13 move second child to first child ( temp 4-component vector of float) +0:13 fragCoord: direct index for structure ( temp 4-component vector of float) +0:? 'i' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:13 Constant: +0:13 1 (const int) +0:? 'i.fragCoord' ( in 4-component vector of float FragCoord) +0:13 move second child to first child ( temp 2-component vector of int) +0:13 i2: direct index for structure ( temp 2-component vector of int) +0:? 'i' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:13 Constant: +0:13 2 (const int) +0:? 'i.i2' (layout( location=1) flat in 2-component vector of int) +0:13 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:13 Function Call: @PixelShaderFunction(struct-InParam-vf2-vf4-vi21; ( temp 4-component vector of float) +0:? 'i' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'i.fragCoord' ( in 4-component vector of float FragCoord) +0:? 'i.v' (layout( location=0) in 2-component vector of float) +0:? 'i.i2' (layout( location=1) flat in 2-component vector of int) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 74 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 55 60 65 70 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 11 "InParam" + MemberName 11(InParam) 0 "v" + MemberName 11(InParam) 1 "fragCoord" + MemberName 11(InParam) 2 "i2" + Name 15 "fun(struct-InParam-vf2-vf4-vi21;" + Name 14 "p" + Name 19 "@PixelShaderFunction(struct-InParam-vf2-vf4-vi21;" + Name 18 "i" + Name 34 "local" + Name 36 "ret1" + Name 37 "param" + Name 40 "ret2" + Name 41 "param" + Name 53 "i" + Name 55 "i.v" + Name 60 "i.fragCoord" + Name 65 "i.i2" + Name 70 "@entryPointOutput" + Name 71 "param" + Decorate 55(i.v) Location 0 + Decorate 60(i.fragCoord) BuiltIn FragCoord + Decorate 65(i.i2) Flat + Decorate 65(i.i2) Location 1 + Decorate 70(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypeVector 6(float) 4 + 9: TypeInt 32 1 + 10: TypeVector 9(int) 2 + 11(InParam): TypeStruct 7(fvec2) 8(fvec4) 10(ivec2) + 12: TypePointer Function 11(InParam) + 13: TypeFunction 6(float) 12(ptr) + 17: TypeFunction 8(fvec4) 12(ptr) + 21: 9(int) Constant 0 + 22: TypeInt 32 0 + 23: 22(int) Constant 1 + 24: TypePointer Function 6(float) + 27: 9(int) Constant 1 + 28: 22(int) Constant 0 + 44: TypePointer Function 8(fvec4) + 54: TypePointer Input 7(fvec2) + 55(i.v): 54(ptr) Variable Input + 57: TypePointer Function 7(fvec2) + 59: TypePointer Input 8(fvec4) + 60(i.fragCoord): 59(ptr) Variable Input + 63: 9(int) Constant 2 + 64: TypePointer Input 10(ivec2) + 65(i.i2): 64(ptr) Variable Input + 67: TypePointer Function 10(ivec2) + 69: TypePointer Output 8(fvec4) +70(@entryPointOutput): 69(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 53(i): 12(ptr) Variable Function + 71(param): 12(ptr) Variable Function + 56: 7(fvec2) Load 55(i.v) + 58: 57(ptr) AccessChain 53(i) 21 + Store 58 56 + 61: 8(fvec4) Load 60(i.fragCoord) + 62: 44(ptr) AccessChain 53(i) 27 + Store 62 61 + 66: 10(ivec2) Load 65(i.i2) + 68: 67(ptr) AccessChain 53(i) 63 + Store 68 66 + 72: 11(InParam) Load 53(i) + Store 71(param) 72 + 73: 8(fvec4) FunctionCall 19(@PixelShaderFunction(struct-InParam-vf2-vf4-vi21;) 71(param) + Store 70(@entryPointOutput) 73 + Return + FunctionEnd +15(fun(struct-InParam-vf2-vf4-vi21;): 6(float) Function None 13 + 14(p): 12(ptr) FunctionParameter + 16: Label + 25: 24(ptr) AccessChain 14(p) 21 23 + 26: 6(float) Load 25 + 29: 24(ptr) AccessChain 14(p) 27 28 + 30: 6(float) Load 29 + 31: 6(float) FAdd 26 30 + ReturnValue 31 + FunctionEnd +19(@PixelShaderFunction(struct-InParam-vf2-vf4-vi21;): 8(fvec4) Function None 17 + 18(i): 12(ptr) FunctionParameter + 20: Label + 34(local): 12(ptr) Variable Function + 36(ret1): 24(ptr) Variable Function + 37(param): 12(ptr) Variable Function + 40(ret2): 24(ptr) Variable Function + 41(param): 12(ptr) Variable Function + 35: 11(InParam) Load 18(i) + Store 34(local) 35 + 38: 11(InParam) Load 34(local) + Store 37(param) 38 + 39: 6(float) FunctionCall 15(fun(struct-InParam-vf2-vf4-vi21;) 37(param) + Store 36(ret1) 39 + 42: 11(InParam) Load 18(i) + Store 41(param) 42 + 43: 6(float) FunctionCall 15(fun(struct-InParam-vf2-vf4-vi21;) 41(param) + Store 40(ret2) 43 + 45: 44(ptr) AccessChain 34(local) 27 + 46: 8(fvec4) Load 45 + 47: 6(float) Load 36(ret1) + 48: 8(fvec4) VectorTimesScalar 46 47 + 49: 6(float) Load 40(ret2) + 50: 8(fvec4) VectorTimesScalar 48 49 + ReturnValue 50 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.entry-out.frag.out b/deps/glslang/Test/baseResults/hlsl.entry-out.frag.out new file mode 100644 index 00000000..6ca3011b --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.entry-out.frag.out @@ -0,0 +1,400 @@ +hlsl.entry-out.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: fun(struct-OutParam-vf2-vi21; ( temp void) +0:7 Function Parameters: +0:7 'op' ( out structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:? Sequence +0:8 move second child to first child ( temp 2-component vector of float) +0:8 v: direct index for structure ( temp 2-component vector of float) +0:8 'op' ( out structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 0.400000 +0:8 0.400000 +0:9 move second child to first child ( temp 2-component vector of int) +0:9 i: direct index for structure ( temp 2-component vector of int) +0:9 'op' ( out structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:9 Constant: +0:9 1 (const int) +0:9 Constant: +0:9 7 (const int) +0:9 7 (const int) +0:13 Function Definition: @PixelShaderFunction(vf4;vf4;struct-OutParam-vf2-vi21;struct-OutParam-vf2-vi21; ( temp 4-component vector of float) +0:13 Function Parameters: +0:13 'input' ( in 4-component vector of float) +0:13 'out1' ( out 4-component vector of float) +0:13 'out2' ( out structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:13 'out3' ( out structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 'out1' ( out 4-component vector of float) +0:14 'input' ( in 4-component vector of float) +0:15 move second child to first child ( temp 2-component vector of float) +0:15 v: direct index for structure ( temp 2-component vector of float) +0:15 'out2' ( out structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 2.000000 +0:15 2.000000 +0:16 move second child to first child ( temp 2-component vector of int) +0:16 i: direct index for structure ( temp 2-component vector of int) +0:16 'out2' ( out structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 3 (const int) +0:16 3 (const int) +0:18 move second child to first child ( temp 2-component vector of float) +0:18 v: direct index for structure ( temp 2-component vector of float) +0:18 'local' ( temp structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:18 Constant: +0:18 0 (const int) +0:18 Constant: +0:18 12.000000 +0:18 12.000000 +0:19 move second child to first child ( temp 2-component vector of int) +0:19 i: direct index for structure ( temp 2-component vector of int) +0:19 'local' ( temp structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 13 (const int) +0:19 13 (const int) +0:20 Function Call: fun(struct-OutParam-vf2-vi21; ( temp void) +0:20 'out3' ( out structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:22 Branch: Return with expression +0:22 'out1' ( out 4-component vector of float) +0:13 Function Definition: PixelShaderFunction( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:13 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:13 Function Call: @PixelShaderFunction(vf4;vf4;struct-OutParam-vf2-vi21;struct-OutParam-vf2-vi21; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'out1' ( temp 4-component vector of float) +0:? 'out2' ( temp structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:? 'out3' ( temp structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:13 move second child to first child ( temp 4-component vector of float) +0:? 'out1' (layout( location=1) out 4-component vector of float) +0:? 'out1' ( temp 4-component vector of float) +0:13 Sequence +0:13 move second child to first child ( temp 2-component vector of float) +0:? 'out2.v' (layout( location=2) out 2-component vector of float) +0:13 v: direct index for structure ( temp 2-component vector of float) +0:? 'out2' ( temp structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:13 Constant: +0:13 0 (const int) +0:13 move second child to first child ( temp 2-component vector of int) +0:? 'out2.i' (layout( location=3) out 2-component vector of int) +0:13 i: direct index for structure ( temp 2-component vector of int) +0:? 'out2' ( temp structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:13 Constant: +0:13 1 (const int) +0:13 Sequence +0:13 move second child to first child ( temp 2-component vector of float) +0:? 'out3.v' (layout( location=4) out 2-component vector of float) +0:13 v: direct index for structure ( temp 2-component vector of float) +0:? 'out3' ( temp structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:13 Constant: +0:13 0 (const int) +0:13 move second child to first child ( temp 2-component vector of int) +0:? 'out3.i' (layout( location=5) out 2-component vector of int) +0:13 i: direct index for structure ( temp 2-component vector of int) +0:? 'out3' ( temp structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:13 Constant: +0:13 1 (const int) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:? 'out1' (layout( location=1) out 4-component vector of float) +0:? 'out2.v' (layout( location=2) out 2-component vector of float) +0:? 'out2.i' (layout( location=3) out 2-component vector of int) +0:? 'out3.v' (layout( location=4) out 2-component vector of float) +0:? 'out3.i' (layout( location=5) out 2-component vector of int) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: fun(struct-OutParam-vf2-vi21; ( temp void) +0:7 Function Parameters: +0:7 'op' ( out structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:? Sequence +0:8 move second child to first child ( temp 2-component vector of float) +0:8 v: direct index for structure ( temp 2-component vector of float) +0:8 'op' ( out structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 0.400000 +0:8 0.400000 +0:9 move second child to first child ( temp 2-component vector of int) +0:9 i: direct index for structure ( temp 2-component vector of int) +0:9 'op' ( out structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:9 Constant: +0:9 1 (const int) +0:9 Constant: +0:9 7 (const int) +0:9 7 (const int) +0:13 Function Definition: @PixelShaderFunction(vf4;vf4;struct-OutParam-vf2-vi21;struct-OutParam-vf2-vi21; ( temp 4-component vector of float) +0:13 Function Parameters: +0:13 'input' ( in 4-component vector of float) +0:13 'out1' ( out 4-component vector of float) +0:13 'out2' ( out structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:13 'out3' ( out structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 'out1' ( out 4-component vector of float) +0:14 'input' ( in 4-component vector of float) +0:15 move second child to first child ( temp 2-component vector of float) +0:15 v: direct index for structure ( temp 2-component vector of float) +0:15 'out2' ( out structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 2.000000 +0:15 2.000000 +0:16 move second child to first child ( temp 2-component vector of int) +0:16 i: direct index for structure ( temp 2-component vector of int) +0:16 'out2' ( out structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 3 (const int) +0:16 3 (const int) +0:18 move second child to first child ( temp 2-component vector of float) +0:18 v: direct index for structure ( temp 2-component vector of float) +0:18 'local' ( temp structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:18 Constant: +0:18 0 (const int) +0:18 Constant: +0:18 12.000000 +0:18 12.000000 +0:19 move second child to first child ( temp 2-component vector of int) +0:19 i: direct index for structure ( temp 2-component vector of int) +0:19 'local' ( temp structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 13 (const int) +0:19 13 (const int) +0:20 Function Call: fun(struct-OutParam-vf2-vi21; ( temp void) +0:20 'out3' ( out structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:22 Branch: Return with expression +0:22 'out1' ( out 4-component vector of float) +0:13 Function Definition: PixelShaderFunction( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:13 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:13 Function Call: @PixelShaderFunction(vf4;vf4;struct-OutParam-vf2-vi21;struct-OutParam-vf2-vi21; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'out1' ( temp 4-component vector of float) +0:? 'out2' ( temp structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:? 'out3' ( temp structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:13 move second child to first child ( temp 4-component vector of float) +0:? 'out1' (layout( location=1) out 4-component vector of float) +0:? 'out1' ( temp 4-component vector of float) +0:13 Sequence +0:13 move second child to first child ( temp 2-component vector of float) +0:? 'out2.v' (layout( location=2) out 2-component vector of float) +0:13 v: direct index for structure ( temp 2-component vector of float) +0:? 'out2' ( temp structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:13 Constant: +0:13 0 (const int) +0:13 move second child to first child ( temp 2-component vector of int) +0:? 'out2.i' (layout( location=3) out 2-component vector of int) +0:13 i: direct index for structure ( temp 2-component vector of int) +0:? 'out2' ( temp structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:13 Constant: +0:13 1 (const int) +0:13 Sequence +0:13 move second child to first child ( temp 2-component vector of float) +0:? 'out3.v' (layout( location=4) out 2-component vector of float) +0:13 v: direct index for structure ( temp 2-component vector of float) +0:? 'out3' ( temp structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:13 Constant: +0:13 0 (const int) +0:13 move second child to first child ( temp 2-component vector of int) +0:? 'out3.i' (layout( location=5) out 2-component vector of int) +0:13 i: direct index for structure ( temp 2-component vector of int) +0:? 'out3' ( temp structure{ temp 2-component vector of float v, temp 2-component vector of int i}) +0:13 Constant: +0:13 1 (const int) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:? 'out1' (layout( location=1) out 4-component vector of float) +0:? 'out2.v' (layout( location=2) out 2-component vector of float) +0:? 'out2.i' (layout( location=3) out 2-component vector of int) +0:? 'out3.v' (layout( location=4) out 2-component vector of float) +0:? 'out3.i' (layout( location=5) out 2-component vector of int) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 89 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 57 60 73 76 80 83 86 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 10 "OutParam" + MemberName 10(OutParam) 0 "v" + MemberName 10(OutParam) 1 "i" + Name 14 "fun(struct-OutParam-vf2-vi21;" + Name 13 "op" + Name 23 "@PixelShaderFunction(vf4;vf4;struct-OutParam-vf2-vi21;struct-OutParam-vf2-vi21;" + Name 19 "input" + Name 20 "out1" + Name 21 "out2" + Name 22 "out3" + Name 42 "local" + Name 49 "param" + Name 55 "input" + Name 57 "input" + Name 60 "@entryPointOutput" + Name 61 "out1" + Name 62 "out2" + Name 63 "out3" + Name 64 "param" + Name 66 "param" + Name 67 "param" + Name 68 "param" + Name 73 "out1" + Name 76 "out2.v" + Name 80 "out2.i" + Name 83 "out3.v" + Name 86 "out3.i" + Decorate 57(input) Location 0 + Decorate 60(@entryPointOutput) Location 0 + Decorate 73(out1) Location 1 + Decorate 76(out2.v) Location 2 + Decorate 80(out2.i) Location 3 + Decorate 83(out3.v) Location 4 + Decorate 86(out3.i) Location 5 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypeInt 32 1 + 9: TypeVector 8(int) 2 + 10(OutParam): TypeStruct 7(fvec2) 9(ivec2) + 11: TypePointer Function 10(OutParam) + 12: TypeFunction 2 11(ptr) + 16: TypeVector 6(float) 4 + 17: TypePointer Function 16(fvec4) + 18: TypeFunction 16(fvec4) 17(ptr) 17(ptr) 11(ptr) 11(ptr) + 25: 8(int) Constant 0 + 26: 6(float) Constant 1053609165 + 27: 7(fvec2) ConstantComposite 26 26 + 28: TypePointer Function 7(fvec2) + 30: 8(int) Constant 1 + 31: 8(int) Constant 7 + 32: 9(ivec2) ConstantComposite 31 31 + 33: TypePointer Function 9(ivec2) + 36: 6(float) Constant 1073741824 + 37: 7(fvec2) ConstantComposite 36 36 + 39: 8(int) Constant 3 + 40: 9(ivec2) ConstantComposite 39 39 + 43: 6(float) Constant 1094713344 + 44: 7(fvec2) ConstantComposite 43 43 + 46: 8(int) Constant 13 + 47: 9(ivec2) ConstantComposite 46 46 + 56: TypePointer Input 16(fvec4) + 57(input): 56(ptr) Variable Input + 59: TypePointer Output 16(fvec4) +60(@entryPointOutput): 59(ptr) Variable Output + 73(out1): 59(ptr) Variable Output + 75: TypePointer Output 7(fvec2) + 76(out2.v): 75(ptr) Variable Output + 79: TypePointer Output 9(ivec2) + 80(out2.i): 79(ptr) Variable Output + 83(out3.v): 75(ptr) Variable Output + 86(out3.i): 79(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 55(input): 17(ptr) Variable Function + 61(out1): 17(ptr) Variable Function + 62(out2): 11(ptr) Variable Function + 63(out3): 11(ptr) Variable Function + 64(param): 17(ptr) Variable Function + 66(param): 17(ptr) Variable Function + 67(param): 11(ptr) Variable Function + 68(param): 11(ptr) Variable Function + 58: 16(fvec4) Load 57(input) + Store 55(input) 58 + 65: 16(fvec4) Load 55(input) + Store 64(param) 65 + 69: 16(fvec4) FunctionCall 23(@PixelShaderFunction(vf4;vf4;struct-OutParam-vf2-vi21;struct-OutParam-vf2-vi21;) 64(param) 66(param) 67(param) 68(param) + 70: 16(fvec4) Load 66(param) + Store 61(out1) 70 + 71:10(OutParam) Load 67(param) + Store 62(out2) 71 + 72:10(OutParam) Load 68(param) + Store 63(out3) 72 + Store 60(@entryPointOutput) 69 + 74: 16(fvec4) Load 61(out1) + Store 73(out1) 74 + 77: 28(ptr) AccessChain 62(out2) 25 + 78: 7(fvec2) Load 77 + Store 76(out2.v) 78 + 81: 33(ptr) AccessChain 62(out2) 30 + 82: 9(ivec2) Load 81 + Store 80(out2.i) 82 + 84: 28(ptr) AccessChain 63(out3) 25 + 85: 7(fvec2) Load 84 + Store 83(out3.v) 85 + 87: 33(ptr) AccessChain 63(out3) 30 + 88: 9(ivec2) Load 87 + Store 86(out3.i) 88 + Return + FunctionEnd +14(fun(struct-OutParam-vf2-vi21;): 2 Function None 12 + 13(op): 11(ptr) FunctionParameter + 15: Label + 29: 28(ptr) AccessChain 13(op) 25 + Store 29 27 + 34: 33(ptr) AccessChain 13(op) 30 + Store 34 32 + Return + FunctionEnd +23(@PixelShaderFunction(vf4;vf4;struct-OutParam-vf2-vi21;struct-OutParam-vf2-vi21;): 16(fvec4) Function None 18 + 19(input): 17(ptr) FunctionParameter + 20(out1): 17(ptr) FunctionParameter + 21(out2): 11(ptr) FunctionParameter + 22(out3): 11(ptr) FunctionParameter + 24: Label + 42(local): 11(ptr) Variable Function + 49(param): 11(ptr) Variable Function + 35: 16(fvec4) Load 19(input) + Store 20(out1) 35 + 38: 28(ptr) AccessChain 21(out2) 25 + Store 38 37 + 41: 33(ptr) AccessChain 21(out2) 30 + Store 41 40 + 45: 28(ptr) AccessChain 42(local) 25 + Store 45 44 + 48: 33(ptr) AccessChain 42(local) 30 + Store 48 47 + 50: 2 FunctionCall 14(fun(struct-OutParam-vf2-vi21;) 49(param) + 51:10(OutParam) Load 49(param) + Store 22(out3) 51 + 52: 16(fvec4) Load 20(out1) + ReturnValue 52 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.entry.rename.frag.out b/deps/glslang/Test/baseResults/hlsl.entry.rename.frag.out new file mode 100644 index 00000000..898eb4bd --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.entry.rename.frag.out @@ -0,0 +1,133 @@ +hlsl.entry.rename.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: not_the_entry_point( ( temp void) +0:7 Function Parameters: +0:11 Function Definition: @main_in_spv( ( temp structure{ temp 4-component vector of float Color}) +0:11 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 Color: direct index for structure ( temp 4-component vector of float) +0:13 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:14 Branch: Return with expression +0:14 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:11 Function Definition: main_in_spv( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:11 Color: direct index for structure ( temp 4-component vector of float) +0:11 Function Call: @main_in_spv( ( temp structure{ temp 4-component vector of float Color}) +0:11 Constant: +0:11 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int also_not_the_entry_point}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: not_the_entry_point( ( temp void) +0:7 Function Parameters: +0:11 Function Definition: @main_in_spv( ( temp structure{ temp 4-component vector of float Color}) +0:11 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 Color: direct index for structure ( temp 4-component vector of float) +0:13 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:14 Branch: Return with expression +0:14 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:11 Function Definition: main_in_spv( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:11 Color: direct index for structure ( temp 4-component vector of float) +0:11 Function Call: @main_in_spv( ( temp structure{ temp 4-component vector of float Color}) +0:11 Constant: +0:11 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int also_not_the_entry_point}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 32 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main_in_spv" 26 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main_in_spv" + Name 6 "not_the_entry_point(" + Name 10 "PS_OUTPUT" + MemberName 10(PS_OUTPUT) 0 "Color" + Name 12 "@main_in_spv(" + Name 15 "psout" + Name 26 "@entryPointOutput.Color" + Name 29 "$Global" + MemberName 29($Global) 0 "also_not_the_entry_point" + Name 31 "" + Decorate 26(@entryPointOutput.Color) Location 0 + MemberDecorate 29($Global) 0 Offset 0 + Decorate 29($Global) Block + Decorate 31 DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10(PS_OUTPUT): TypeStruct 9(fvec4) + 11: TypeFunction 10(PS_OUTPUT) + 14: TypePointer Function 10(PS_OUTPUT) + 16: TypeInt 32 1 + 17: 16(int) Constant 0 + 18: 8(float) Constant 0 + 19: 9(fvec4) ConstantComposite 18 18 18 18 + 20: TypePointer Function 9(fvec4) + 25: TypePointer Output 9(fvec4) +26(@entryPointOutput.Color): 25(ptr) Variable Output + 29($Global): TypeStruct 16(int) + 30: TypePointer Uniform 29($Global) + 31: 30(ptr) Variable Uniform + 4(main_in_spv): 2 Function None 3 + 5: Label + 27:10(PS_OUTPUT) FunctionCall 12(@main_in_spv() + 28: 9(fvec4) CompositeExtract 27 0 + Store 26(@entryPointOutput.Color) 28 + Return + FunctionEnd +6(not_the_entry_point(): 2 Function None 3 + 7: Label + Return + FunctionEnd +12(@main_in_spv():10(PS_OUTPUT) Function None 11 + 13: Label + 15(psout): 14(ptr) Variable Function + 21: 20(ptr) AccessChain 15(psout) 17 + Store 21 19 + 22:10(PS_OUTPUT) Load 15(psout) + ReturnValue 22 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out b/deps/glslang/Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out new file mode 100644 index 00000000..b5f34405 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out @@ -0,0 +1,66 @@ +hlsl.explicitDescriptorSet.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 31 + + Capability Shader + Capability Sampled1D + Capability SampledBuffer + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 19 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 13 "g_sSamp2_amb" + Name 19 "@entryPointOutput" + Name 21 "g_sSamp" + Name 24 "g_tTex1df4" + Name 25 "$Global" + MemberName 25($Global) 0 "floatval_amb" + Name 27 "" + Name 30 "floatbuff" + Decorate 13(g_sSamp2_amb) DescriptorSet 3 + Decorate 13(g_sSamp2_amb) Binding 10 + Decorate 19(@entryPointOutput) Location 0 + Decorate 21(g_sSamp) DescriptorSet 3 + Decorate 21(g_sSamp) Binding 11 + Decorate 24(g_tTex1df4) DescriptorSet 3 + Decorate 24(g_tTex1df4) Binding 20 + MemberDecorate 25($Global) 0 Offset 0 + Decorate 25($Global) Block + Decorate 27 DescriptorSet 3 + Decorate 30(floatbuff) DescriptorSet 3 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeSampler + 12: TypePointer UniformConstant 11 +13(g_sSamp2_amb): 12(ptr) Variable UniformConstant + 14: 6(float) Constant 0 + 15: 7(fvec4) ConstantComposite 14 14 14 14 + 18: TypePointer Output 7(fvec4) +19(@entryPointOutput): 18(ptr) Variable Output + 21(g_sSamp): 12(ptr) Variable UniformConstant + 22: TypeImage 6(float) 1D sampled format:Unknown + 23: TypePointer UniformConstant 22 + 24(g_tTex1df4): 23(ptr) Variable UniformConstant + 25($Global): TypeStruct 6(float) + 26: TypePointer Uniform 25($Global) + 27: 26(ptr) Variable Uniform + 28: TypeImage 6(float) Buffer sampled format:R32f + 29: TypePointer UniformConstant 28 + 30(floatbuff): 29(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 20: 7(fvec4) FunctionCall 9(@main() + Store 19(@entryPointOutput) 20 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + ReturnValue 15 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.explicitDescriptorSet.frag.out b/deps/glslang/Test/baseResults/hlsl.explicitDescriptorSet.frag.out new file mode 100644 index 00000000..8ab296fe --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.explicitDescriptorSet.frag.out @@ -0,0 +1,66 @@ +hlsl.explicitDescriptorSet.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 31 + + Capability Shader + Capability Sampled1D + Capability SampledBuffer + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 19 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 13 "g_sSamp2_amb" + Name 19 "@entryPointOutput" + Name 21 "g_sSamp" + Name 24 "g_tTex1df4" + Name 25 "$Global" + MemberName 25($Global) 0 "floatval_amb" + Name 27 "" + Name 30 "floatbuff" + Decorate 13(g_sSamp2_amb) DescriptorSet 4 + Decorate 13(g_sSamp2_amb) Binding 10 + Decorate 19(@entryPointOutput) Location 0 + Decorate 21(g_sSamp) DescriptorSet 4 + Decorate 21(g_sSamp) Binding 11 + Decorate 24(g_tTex1df4) DescriptorSet 4 + Decorate 24(g_tTex1df4) Binding 20 + MemberDecorate 25($Global) 0 Offset 0 + Decorate 25($Global) Block + Decorate 27 DescriptorSet 4 + Decorate 30(floatbuff) DescriptorSet 4 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeSampler + 12: TypePointer UniformConstant 11 +13(g_sSamp2_amb): 12(ptr) Variable UniformConstant + 14: 6(float) Constant 0 + 15: 7(fvec4) ConstantComposite 14 14 14 14 + 18: TypePointer Output 7(fvec4) +19(@entryPointOutput): 18(ptr) Variable Output + 21(g_sSamp): 12(ptr) Variable UniformConstant + 22: TypeImage 6(float) 1D sampled format:Unknown + 23: TypePointer UniformConstant 22 + 24(g_tTex1df4): 23(ptr) Variable UniformConstant + 25($Global): TypeStruct 6(float) + 26: TypePointer Uniform 25($Global) + 27: 26(ptr) Variable Uniform + 28: TypeImage 6(float) Buffer sampled format:R32f + 29: TypePointer UniformConstant 28 + 30(floatbuff): 29(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 20: 7(fvec4) FunctionCall 9(@main() + Store 19(@entryPointOutput) 20 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + ReturnValue 15 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.flatten.return.frag.out b/deps/glslang/Test/baseResults/hlsl.flatten.return.frag.out new file mode 100644 index 00000000..e47fe3eb --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.flatten.return.frag.out @@ -0,0 +1,200 @@ +hlsl.flatten.return.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:11 Function Definition: Func1( ( temp structure{ temp 4-component vector of float color, temp float other_struct_member1, temp float other_struct_member2, temp float other_struct_member3}) +0:11 Function Parameters: +0:? Sequence +0:12 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 1.000000 +0:? 1.000000 +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:16 Function Definition: @main( ( temp structure{ temp 4-component vector of float color, temp float other_struct_member1, temp float other_struct_member2, temp float other_struct_member3}) +0:16 Function Parameters: +0:? Sequence +0:17 Branch: Return with expression +0:17 Function Call: Func1( ( temp structure{ temp 4-component vector of float color, temp float other_struct_member1, temp float other_struct_member2, temp float other_struct_member3}) +0:16 Function Definition: main( ( temp void) +0:16 Function Parameters: +0:? Sequence +0:16 Sequence +0:16 move second child to first child ( temp structure{ temp 4-component vector of float color, temp float other_struct_member1, temp float other_struct_member2, temp float other_struct_member3}) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float color, temp float other_struct_member1, temp float other_struct_member2, temp float other_struct_member3}) +0:16 Function Call: @main( ( temp structure{ temp 4-component vector of float color, temp float other_struct_member1, temp float other_struct_member2, temp float other_struct_member3}) +0:16 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:16 color: direct index for structure ( temp 4-component vector of float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float color, temp float other_struct_member1, temp float other_struct_member2, temp float other_struct_member3}) +0:16 Constant: +0:16 0 (const int) +0:16 move second child to first child ( temp float) +0:? '@entryPointOutput.other_struct_member1' (layout( location=1) out float) +0:16 other_struct_member1: direct index for structure ( temp float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float color, temp float other_struct_member1, temp float other_struct_member2, temp float other_struct_member3}) +0:16 Constant: +0:16 1 (const int) +0:16 move second child to first child ( temp float) +0:? '@entryPointOutput.other_struct_member2' (layout( location=2) out float) +0:16 other_struct_member2: direct index for structure ( temp float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float color, temp float other_struct_member1, temp float other_struct_member2, temp float other_struct_member3}) +0:16 Constant: +0:16 2 (const int) +0:16 move second child to first child ( temp float) +0:? '@entryPointOutput.other_struct_member3' (layout( location=3) out float) +0:16 other_struct_member3: direct index for structure ( temp float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float color, temp float other_struct_member1, temp float other_struct_member2, temp float other_struct_member3}) +0:16 Constant: +0:16 3 (const int) +0:? Linker Objects +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:? '@entryPointOutput.other_struct_member1' (layout( location=1) out float) +0:? '@entryPointOutput.other_struct_member2' (layout( location=2) out float) +0:? '@entryPointOutput.other_struct_member3' (layout( location=3) out float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:11 Function Definition: Func1( ( temp structure{ temp 4-component vector of float color, temp float other_struct_member1, temp float other_struct_member2, temp float other_struct_member3}) +0:11 Function Parameters: +0:? Sequence +0:12 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 1.000000 +0:? 1.000000 +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:16 Function Definition: @main( ( temp structure{ temp 4-component vector of float color, temp float other_struct_member1, temp float other_struct_member2, temp float other_struct_member3}) +0:16 Function Parameters: +0:? Sequence +0:17 Branch: Return with expression +0:17 Function Call: Func1( ( temp structure{ temp 4-component vector of float color, temp float other_struct_member1, temp float other_struct_member2, temp float other_struct_member3}) +0:16 Function Definition: main( ( temp void) +0:16 Function Parameters: +0:? Sequence +0:16 Sequence +0:16 move second child to first child ( temp structure{ temp 4-component vector of float color, temp float other_struct_member1, temp float other_struct_member2, temp float other_struct_member3}) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float color, temp float other_struct_member1, temp float other_struct_member2, temp float other_struct_member3}) +0:16 Function Call: @main( ( temp structure{ temp 4-component vector of float color, temp float other_struct_member1, temp float other_struct_member2, temp float other_struct_member3}) +0:16 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:16 color: direct index for structure ( temp 4-component vector of float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float color, temp float other_struct_member1, temp float other_struct_member2, temp float other_struct_member3}) +0:16 Constant: +0:16 0 (const int) +0:16 move second child to first child ( temp float) +0:? '@entryPointOutput.other_struct_member1' (layout( location=1) out float) +0:16 other_struct_member1: direct index for structure ( temp float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float color, temp float other_struct_member1, temp float other_struct_member2, temp float other_struct_member3}) +0:16 Constant: +0:16 1 (const int) +0:16 move second child to first child ( temp float) +0:? '@entryPointOutput.other_struct_member2' (layout( location=2) out float) +0:16 other_struct_member2: direct index for structure ( temp float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float color, temp float other_struct_member1, temp float other_struct_member2, temp float other_struct_member3}) +0:16 Constant: +0:16 2 (const int) +0:16 move second child to first child ( temp float) +0:? '@entryPointOutput.other_struct_member3' (layout( location=3) out float) +0:16 other_struct_member3: direct index for structure ( temp float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float color, temp float other_struct_member1, temp float other_struct_member2, temp float other_struct_member3}) +0:16 Constant: +0:16 3 (const int) +0:? Linker Objects +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:? '@entryPointOutput.other_struct_member1' (layout( location=1) out float) +0:? '@entryPointOutput.other_struct_member2' (layout( location=2) out float) +0:? '@entryPointOutput.other_struct_member3' (layout( location=3) out float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 49 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 29 36 41 45 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "color" + MemberName 8(PS_OUTPUT) 1 "other_struct_member1" + MemberName 8(PS_OUTPUT) 2 "other_struct_member2" + MemberName 8(PS_OUTPUT) 3 "other_struct_member3" + Name 10 "Func1(" + Name 12 "@main(" + Name 26 "flattenTemp" + Name 29 "@entryPointOutput.color" + Name 36 "@entryPointOutput.other_struct_member1" + Name 41 "@entryPointOutput.other_struct_member2" + Name 45 "@entryPointOutput.other_struct_member3" + Decorate 29(@entryPointOutput.color) Location 0 + Decorate 36(@entryPointOutput.other_struct_member1) Location 1 + Decorate 41(@entryPointOutput.other_struct_member2) Location 2 + Decorate 45(@entryPointOutput.other_struct_member3) Location 3 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) 6(float) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 14: 6(float) Constant 1065353216 + 15: 7(fvec4) ConstantComposite 14 14 14 14 + 16: 6(float) Constant 1073741824 + 17: 6(float) Constant 1077936128 + 18: 6(float) Constant 1082130432 + 19:8(PS_OUTPUT) ConstantComposite 15 16 17 18 + 25: TypePointer Function 8(PS_OUTPUT) + 28: TypePointer Output 7(fvec4) +29(@entryPointOutput.color): 28(ptr) Variable Output + 30: TypeInt 32 1 + 31: 30(int) Constant 0 + 32: TypePointer Function 7(fvec4) + 35: TypePointer Output 6(float) +36(@entryPointOutput.other_struct_member1): 35(ptr) Variable Output + 37: 30(int) Constant 1 + 38: TypePointer Function 6(float) +41(@entryPointOutput.other_struct_member2): 35(ptr) Variable Output + 42: 30(int) Constant 2 +45(@entryPointOutput.other_struct_member3): 35(ptr) Variable Output + 46: 30(int) Constant 3 + 4(main): 2 Function None 3 + 5: Label + 26(flattenTemp): 25(ptr) Variable Function + 27:8(PS_OUTPUT) FunctionCall 12(@main() + Store 26(flattenTemp) 27 + 33: 32(ptr) AccessChain 26(flattenTemp) 31 + 34: 7(fvec4) Load 33 + Store 29(@entryPointOutput.color) 34 + 39: 38(ptr) AccessChain 26(flattenTemp) 37 + 40: 6(float) Load 39 + Store 36(@entryPointOutput.other_struct_member1) 40 + 43: 38(ptr) AccessChain 26(flattenTemp) 42 + 44: 6(float) Load 43 + Store 41(@entryPointOutput.other_struct_member2) 44 + 47: 38(ptr) AccessChain 26(flattenTemp) 46 + 48: 6(float) Load 47 + Store 45(@entryPointOutput.other_struct_member3) 48 + Return + FunctionEnd + 10(Func1():8(PS_OUTPUT) Function None 9 + 11: Label + ReturnValue 19 + FunctionEnd + 12(@main():8(PS_OUTPUT) Function None 9 + 13: Label + 22:8(PS_OUTPUT) FunctionCall 10(Func1() + ReturnValue 22 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.flattenOpaque.frag.out b/deps/glslang/Test/baseResults/hlsl.flattenOpaque.frag.out new file mode 100644 index 00000000..eb47c3f8 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.flattenOpaque.frag.out @@ -0,0 +1,478 @@ +hlsl.flattenOpaque.frag +WARNING: AST will form illegal SPIR-V; need to transform to legalize +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:15 Function Definition: osCall1(struct-os-p11; ( temp 4-component vector of float) +0:15 Function Parameters: +0:15 's' ( in structure{ temp sampler s2D}) +0:? Sequence +0:16 Branch: Return with expression +0:16 texture ( temp 4-component vector of float) +0:16 Construct combined texture-sampler ( temp sampler2D) +0:16 'tex' ( uniform texture2D) +0:16 s2D: direct index for structure ( temp sampler) +0:16 's' ( in structure{ temp sampler s2D}) +0:16 Constant: +0:16 0 (const int) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:20 Function Definition: osCall2(struct-os-p11;vf2; ( temp 4-component vector of float) +0:20 Function Parameters: +0:20 's' ( in structure{ temp sampler s2D}) +0:20 'f2' ( in 2-component vector of float) +0:? Sequence +0:21 Branch: Return with expression +0:21 texture ( temp 4-component vector of float) +0:21 Construct combined texture-sampler ( temp sampler2D) +0:21 'tex' ( uniform texture2D) +0:21 s2D: direct index for structure ( temp sampler) +0:21 's' ( in structure{ temp sampler s2D}) +0:21 Constant: +0:21 0 (const int) +0:21 'f2' ( in 2-component vector of float) +0:25 Function Definition: os2Call1(struct-os2-p1-t211; ( temp 4-component vector of float) +0:25 Function Parameters: +0:25 's' ( in structure{ temp sampler s2D, temp texture2D tex}) +0:? Sequence +0:26 Branch: Return with expression +0:26 texture ( temp 4-component vector of float) +0:26 Construct combined texture-sampler ( temp sampler2D) +0:26 tex: direct index for structure ( temp texture2D) +0:26 's' ( in structure{ temp sampler s2D, temp texture2D tex}) +0:26 Constant: +0:26 1 (const int) +0:26 s2D: direct index for structure ( temp sampler) +0:26 's' ( in structure{ temp sampler s2D, temp texture2D tex}) +0:26 Constant: +0:26 0 (const int) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:30 Function Definition: os2Call2(struct-os2-p1-t211;vf2; ( temp 4-component vector of float) +0:30 Function Parameters: +0:30 's' ( in structure{ temp sampler s2D, temp texture2D tex}) +0:30 'f2' ( in 2-component vector of float) +0:? Sequence +0:31 Branch: Return with expression +0:31 texture ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler2D) +0:31 tex: direct index for structure ( temp texture2D) +0:31 's' ( in structure{ temp sampler s2D, temp texture2D tex}) +0:31 Constant: +0:31 1 (const int) +0:31 s2D: direct index for structure ( temp sampler) +0:31 's' ( in structure{ temp sampler s2D, temp texture2D tex}) +0:31 Constant: +0:31 0 (const int) +0:31 'f2' ( in 2-component vector of float) +0:35 Function Definition: @main( ( temp 4-component vector of float) +0:35 Function Parameters: +0:? Sequence +0:39 Branch: Return with expression +0:38 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:36 add ( temp 4-component vector of float) +0:36 Function Call: osCall1(struct-os-p11; ( temp 4-component vector of float) +0:36 Comma ( temp structure{ temp sampler s2D}) +0:36 Sequence +0:36 move second child to first child ( temp sampler) +0:36 s2D: direct index for structure ( temp sampler) +0:36 'aggShadow' ( temp structure{ temp sampler s2D}) +0:36 Constant: +0:36 0 (const int) +0:? 's.s2D' ( uniform sampler) +0:36 'aggShadow' ( temp structure{ temp sampler s2D}) +0:37 Function Call: osCall2(struct-os-p11;vf2; ( temp 4-component vector of float) +0:37 Comma ( temp structure{ temp sampler s2D}) +0:37 Sequence +0:37 move second child to first child ( temp sampler) +0:37 s2D: direct index for structure ( temp sampler) +0:37 'aggShadow' ( temp structure{ temp sampler s2D}) +0:37 Constant: +0:37 0 (const int) +0:? 's.s2D' ( uniform sampler) +0:37 'aggShadow' ( temp structure{ temp sampler s2D}) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:38 Function Call: os2Call1(struct-os2-p1-t211; ( temp 4-component vector of float) +0:38 Comma ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:38 Sequence +0:38 move second child to first child ( temp sampler) +0:38 s2D: direct index for structure ( temp sampler) +0:38 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:38 Constant: +0:38 0 (const int) +0:? 's2.s2D' ( uniform sampler) +0:38 move second child to first child ( temp texture2D) +0:38 tex: direct index for structure ( temp texture2D) +0:38 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:38 Constant: +0:38 1 (const int) +0:? 's2.tex' ( uniform texture2D) +0:38 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:39 Function Call: os2Call2(struct-os2-p1-t211;vf2; ( temp 4-component vector of float) +0:39 Comma ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:39 Sequence +0:39 move second child to first child ( temp sampler) +0:39 s2D: direct index for structure ( temp sampler) +0:39 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:39 Constant: +0:39 0 (const int) +0:? 's2.s2D' ( uniform sampler) +0:39 move second child to first child ( temp texture2D) +0:39 tex: direct index for structure ( temp texture2D) +0:39 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:39 Constant: +0:39 1 (const int) +0:? 's2.tex' ( uniform texture2D) +0:39 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:35 Function Definition: main( ( temp void) +0:35 Function Parameters: +0:? Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:35 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'tex' ( uniform texture2D) +0:? 's.s2D' ( uniform sampler) +0:? 's2.s2D' ( uniform sampler) +0:? 's2.tex' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:15 Function Definition: osCall1(struct-os-p11; ( temp 4-component vector of float) +0:15 Function Parameters: +0:15 's' ( in structure{ temp sampler s2D}) +0:? Sequence +0:16 Branch: Return with expression +0:16 texture ( temp 4-component vector of float) +0:16 Construct combined texture-sampler ( temp sampler2D) +0:16 'tex' ( uniform texture2D) +0:16 s2D: direct index for structure ( temp sampler) +0:16 's' ( in structure{ temp sampler s2D}) +0:16 Constant: +0:16 0 (const int) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:20 Function Definition: osCall2(struct-os-p11;vf2; ( temp 4-component vector of float) +0:20 Function Parameters: +0:20 's' ( in structure{ temp sampler s2D}) +0:20 'f2' ( in 2-component vector of float) +0:? Sequence +0:21 Branch: Return with expression +0:21 texture ( temp 4-component vector of float) +0:21 Construct combined texture-sampler ( temp sampler2D) +0:21 'tex' ( uniform texture2D) +0:21 s2D: direct index for structure ( temp sampler) +0:21 's' ( in structure{ temp sampler s2D}) +0:21 Constant: +0:21 0 (const int) +0:21 'f2' ( in 2-component vector of float) +0:25 Function Definition: os2Call1(struct-os2-p1-t211; ( temp 4-component vector of float) +0:25 Function Parameters: +0:25 's' ( in structure{ temp sampler s2D, temp texture2D tex}) +0:? Sequence +0:26 Branch: Return with expression +0:26 texture ( temp 4-component vector of float) +0:26 Construct combined texture-sampler ( temp sampler2D) +0:26 tex: direct index for structure ( temp texture2D) +0:26 's' ( in structure{ temp sampler s2D, temp texture2D tex}) +0:26 Constant: +0:26 1 (const int) +0:26 s2D: direct index for structure ( temp sampler) +0:26 's' ( in structure{ temp sampler s2D, temp texture2D tex}) +0:26 Constant: +0:26 0 (const int) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:30 Function Definition: os2Call2(struct-os2-p1-t211;vf2; ( temp 4-component vector of float) +0:30 Function Parameters: +0:30 's' ( in structure{ temp sampler s2D, temp texture2D tex}) +0:30 'f2' ( in 2-component vector of float) +0:? Sequence +0:31 Branch: Return with expression +0:31 texture ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler2D) +0:31 tex: direct index for structure ( temp texture2D) +0:31 's' ( in structure{ temp sampler s2D, temp texture2D tex}) +0:31 Constant: +0:31 1 (const int) +0:31 s2D: direct index for structure ( temp sampler) +0:31 's' ( in structure{ temp sampler s2D, temp texture2D tex}) +0:31 Constant: +0:31 0 (const int) +0:31 'f2' ( in 2-component vector of float) +0:35 Function Definition: @main( ( temp 4-component vector of float) +0:35 Function Parameters: +0:? Sequence +0:39 Branch: Return with expression +0:38 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:36 add ( temp 4-component vector of float) +0:36 Function Call: osCall1(struct-os-p11; ( temp 4-component vector of float) +0:36 Comma ( temp structure{ temp sampler s2D}) +0:36 Sequence +0:36 move second child to first child ( temp sampler) +0:36 s2D: direct index for structure ( temp sampler) +0:36 'aggShadow' ( temp structure{ temp sampler s2D}) +0:36 Constant: +0:36 0 (const int) +0:? 's.s2D' ( uniform sampler) +0:36 'aggShadow' ( temp structure{ temp sampler s2D}) +0:37 Function Call: osCall2(struct-os-p11;vf2; ( temp 4-component vector of float) +0:37 Comma ( temp structure{ temp sampler s2D}) +0:37 Sequence +0:37 move second child to first child ( temp sampler) +0:37 s2D: direct index for structure ( temp sampler) +0:37 'aggShadow' ( temp structure{ temp sampler s2D}) +0:37 Constant: +0:37 0 (const int) +0:? 's.s2D' ( uniform sampler) +0:37 'aggShadow' ( temp structure{ temp sampler s2D}) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:38 Function Call: os2Call1(struct-os2-p1-t211; ( temp 4-component vector of float) +0:38 Comma ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:38 Sequence +0:38 move second child to first child ( temp sampler) +0:38 s2D: direct index for structure ( temp sampler) +0:38 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:38 Constant: +0:38 0 (const int) +0:? 's2.s2D' ( uniform sampler) +0:38 move second child to first child ( temp texture2D) +0:38 tex: direct index for structure ( temp texture2D) +0:38 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:38 Constant: +0:38 1 (const int) +0:? 's2.tex' ( uniform texture2D) +0:38 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:39 Function Call: os2Call2(struct-os2-p1-t211;vf2; ( temp 4-component vector of float) +0:39 Comma ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:39 Sequence +0:39 move second child to first child ( temp sampler) +0:39 s2D: direct index for structure ( temp sampler) +0:39 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:39 Constant: +0:39 0 (const int) +0:? 's2.s2D' ( uniform sampler) +0:39 move second child to first child ( temp texture2D) +0:39 tex: direct index for structure ( temp texture2D) +0:39 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:39 Constant: +0:39 1 (const int) +0:? 's2.tex' ( uniform texture2D) +0:39 'aggShadow' ( temp structure{ temp sampler s2D, temp texture2D tex}) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:35 Function Definition: main( ( temp void) +0:35 Function Parameters: +0:? Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:35 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'tex' ( uniform texture2D) +0:? 's.s2D' ( uniform sampler) +0:? 's2.s2D' ( uniform sampler) +0:? 's2.tex' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 122 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 120 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 7 "os" + MemberName 7(os) 0 "s2D" + Name 13 "osCall1(struct-os-p11;" + Name 12 "s" + Name 20 "osCall2(struct-os-p11;vf2;" + Name 18 "s" + Name 19 "f2" + Name 23 "os2" + MemberName 23(os2) 0 "s2D" + MemberName 23(os2) 1 "tex" + Name 27 "os2Call1(struct-os2-p1-t211;" + Name 26 "s" + Name 32 "os2Call2(struct-os2-p1-t211;vf2;" + Name 30 "s" + Name 31 "f2" + Name 35 "@main(" + Name 38 "tex" + Name 80 "aggShadow" + Name 82 "s.s2D" + Name 85 "param" + Name 88 "aggShadow" + Name 91 "param" + Name 93 "param" + Name 96 "aggShadow" + Name 97 "s2.s2D" + Name 100 "s2.tex" + Name 103 "param" + Name 107 "aggShadow" + Name 112 "param" + Name 114 "param" + Name 120 "@entryPointOutput" + Decorate 38(tex) DescriptorSet 0 + Decorate 82(s.s2D) DescriptorSet 0 + Decorate 97(s2.s2D) DescriptorSet 0 + Decorate 100(s2.tex) DescriptorSet 0 + Decorate 120(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeSampler + 7(os): TypeStruct 6 + 8: TypePointer Function 7(os) + 9: TypeFloat 32 + 10: TypeVector 9(float) 4 + 11: TypeFunction 10(fvec4) 8(ptr) + 15: TypeVector 9(float) 2 + 16: TypePointer Function 15(fvec2) + 17: TypeFunction 10(fvec4) 8(ptr) 16(ptr) + 22: TypeImage 9(float) 2D sampled format:Unknown + 23(os2): TypeStruct 6 22 + 24: TypePointer Function 23(os2) + 25: TypeFunction 10(fvec4) 24(ptr) + 29: TypeFunction 10(fvec4) 24(ptr) 16(ptr) + 34: TypeFunction 10(fvec4) + 37: TypePointer UniformConstant 22 + 38(tex): 37(ptr) Variable UniformConstant + 40: TypeInt 32 1 + 41: 40(int) Constant 0 + 42: TypePointer Function 6 + 45: TypeSampledImage 22 + 47: 9(float) Constant 1045220557 + 48: 9(float) Constant 1050253722 + 49: 15(fvec2) ConstantComposite 47 48 + 61: 40(int) Constant 1 + 62: TypePointer Function 22 + 81: TypePointer UniformConstant 6 + 82(s.s2D): 81(ptr) Variable UniformConstant + 97(s2.s2D): 81(ptr) Variable UniformConstant + 100(s2.tex): 37(ptr) Variable UniformConstant + 119: TypePointer Output 10(fvec4) +120(@entryPointOutput): 119(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 121: 10(fvec4) FunctionCall 35(@main() + Store 120(@entryPointOutput) 121 + Return + FunctionEnd +13(osCall1(struct-os-p11;): 10(fvec4) Function None 11 + 12(s): 8(ptr) FunctionParameter + 14: Label + 39: 22 Load 38(tex) + 43: 42(ptr) AccessChain 12(s) 41 + 44: 6 Load 43 + 46: 45 SampledImage 39 44 + 50: 10(fvec4) ImageSampleImplicitLod 46 49 + ReturnValue 50 + FunctionEnd +20(osCall2(struct-os-p11;vf2;): 10(fvec4) Function None 17 + 18(s): 8(ptr) FunctionParameter + 19(f2): 16(ptr) FunctionParameter + 21: Label + 53: 22 Load 38(tex) + 54: 42(ptr) AccessChain 18(s) 41 + 55: 6 Load 54 + 56: 45 SampledImage 53 55 + 57: 15(fvec2) Load 19(f2) + 58: 10(fvec4) ImageSampleImplicitLod 56 57 + ReturnValue 58 + FunctionEnd +27(os2Call1(struct-os2-p1-t211;): 10(fvec4) Function None 25 + 26(s): 24(ptr) FunctionParameter + 28: Label + 63: 62(ptr) AccessChain 26(s) 61 + 64: 22 Load 63 + 65: 42(ptr) AccessChain 26(s) 41 + 66: 6 Load 65 + 67: 45 SampledImage 64 66 + 68: 10(fvec4) ImageSampleImplicitLod 67 49 + ReturnValue 68 + FunctionEnd +32(os2Call2(struct-os2-p1-t211;vf2;): 10(fvec4) Function None 29 + 30(s): 24(ptr) FunctionParameter + 31(f2): 16(ptr) FunctionParameter + 33: Label + 71: 62(ptr) AccessChain 30(s) 61 + 72: 22 Load 71 + 73: 42(ptr) AccessChain 30(s) 41 + 74: 6 Load 73 + 75: 45 SampledImage 72 74 + 76: 15(fvec2) Load 31(f2) + 77: 10(fvec4) ImageSampleImplicitLod 75 76 + ReturnValue 77 + FunctionEnd + 35(@main(): 10(fvec4) Function None 34 + 36: Label + 80(aggShadow): 8(ptr) Variable Function + 85(param): 8(ptr) Variable Function + 88(aggShadow): 8(ptr) Variable Function + 91(param): 8(ptr) Variable Function + 93(param): 16(ptr) Variable Function + 96(aggShadow): 24(ptr) Variable Function + 103(param): 24(ptr) Variable Function + 107(aggShadow): 24(ptr) Variable Function + 112(param): 24(ptr) Variable Function + 114(param): 16(ptr) Variable Function + 83: 6 Load 82(s.s2D) + 84: 42(ptr) AccessChain 80(aggShadow) 41 + Store 84 83 + 86: 7(os) Load 80(aggShadow) + Store 85(param) 86 + 87: 10(fvec4) FunctionCall 13(osCall1(struct-os-p11;) 85(param) + 89: 6 Load 82(s.s2D) + 90: 42(ptr) AccessChain 88(aggShadow) 41 + Store 90 89 + 92: 7(os) Load 88(aggShadow) + Store 91(param) 92 + Store 93(param) 49 + 94: 10(fvec4) FunctionCall 20(osCall2(struct-os-p11;vf2;) 91(param) 93(param) + 95: 10(fvec4) FAdd 87 94 + 98: 6 Load 97(s2.s2D) + 99: 42(ptr) AccessChain 96(aggShadow) 41 + Store 99 98 + 101: 22 Load 100(s2.tex) + 102: 62(ptr) AccessChain 96(aggShadow) 61 + Store 102 101 + 104: 23(os2) Load 96(aggShadow) + Store 103(param) 104 + 105: 10(fvec4) FunctionCall 27(os2Call1(struct-os2-p1-t211;) 103(param) + 106: 10(fvec4) FAdd 95 105 + 108: 6 Load 97(s2.s2D) + 109: 42(ptr) AccessChain 107(aggShadow) 41 + Store 109 108 + 110: 22 Load 100(s2.tex) + 111: 62(ptr) AccessChain 107(aggShadow) 61 + Store 111 110 + 113: 23(os2) Load 107(aggShadow) + Store 112(param) 113 + Store 114(param) 49 + 115: 10(fvec4) FunctionCall 32(os2Call2(struct-os2-p1-t211;vf2;) 112(param) 114(param) + 116: 10(fvec4) FAdd 106 115 + ReturnValue 116 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.flattenOpaqueInit.vert.out b/deps/glslang/Test/baseResults/hlsl.flattenOpaqueInit.vert.out new file mode 100644 index 00000000..29da8446 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.flattenOpaqueInit.vert.out @@ -0,0 +1,291 @@ +hlsl.flattenOpaqueInit.vert +WARNING: AST will form illegal SPIR-V; need to transform to legalize +Shader version: 500 +0:? Sequence +0:5 Function Definition: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) +0:5 Function Parameters: +0:5 'tex' ( in structure{ temp sampler smpl, temp texture2D tex}) +0:? Sequence +0:6 Branch: Return with expression +0:6 texture ( temp 4-component vector of float) +0:6 Construct combined texture-sampler ( temp sampler2D) +0:6 tex: direct index for structure ( temp texture2D) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex}) +0:6 Constant: +0:6 1 (const int) +0:6 smpl: direct index for structure ( temp sampler) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex}) +0:6 Constant: +0:6 0 (const int) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:10 Function Definition: fillOpaque( ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:10 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp sampler) +0:12 smpl: direct index for structure ( temp sampler) +0:12 't' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:12 Constant: +0:12 0 (const int) +0:12 'g_tInputTexture_sampler' ( uniform sampler) +0:13 move second child to first child ( temp texture2D) +0:13 tex: direct index for structure ( temp texture2D) +0:13 't' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:13 Constant: +0:13 1 (const int) +0:13 'g_tInputTexture' ( uniform texture2D) +0:14 Branch: Return with expression +0:14 't' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:18 Function Definition: @main( ( temp 4-component vector of float) +0:18 Function Parameters: +0:? Sequence +0:19 Sequence +0:19 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:19 'tex1' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:19 Construct structure ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:19 'g_tInputTexture_sampler' ( uniform sampler) +0:19 'g_tInputTexture' ( uniform texture2D) +0:20 Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:20 'res' ( temp 4-component vector of float) +0:20 Function Call: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) +0:20 'tex1' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:21 Sequence +0:21 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:21 'tex2' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:21 Function Call: fillOpaque( ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:22 add second child into first child ( temp 4-component vector of float) +0:22 'res' ( temp 4-component vector of float) +0:22 Function Call: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) +0:22 'tex2' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:23 Sequence +0:23 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:23 'tex3' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:23 'tex1' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:24 add second child into first child ( temp 4-component vector of float) +0:24 'res' ( temp 4-component vector of float) +0:24 Function Call: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) +0:24 'tex3' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:26 Branch: Return with expression +0:26 'res' ( temp 4-component vector of float) +0:18 Function Definition: main( ( temp void) +0:18 Function Parameters: +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:18 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_tInputTexture_sampler' ( uniform sampler) +0:? 'g_tInputTexture' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:5 Function Definition: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) +0:5 Function Parameters: +0:5 'tex' ( in structure{ temp sampler smpl, temp texture2D tex}) +0:? Sequence +0:6 Branch: Return with expression +0:6 texture ( temp 4-component vector of float) +0:6 Construct combined texture-sampler ( temp sampler2D) +0:6 tex: direct index for structure ( temp texture2D) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex}) +0:6 Constant: +0:6 1 (const int) +0:6 smpl: direct index for structure ( temp sampler) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex}) +0:6 Constant: +0:6 0 (const int) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:10 Function Definition: fillOpaque( ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:10 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp sampler) +0:12 smpl: direct index for structure ( temp sampler) +0:12 't' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:12 Constant: +0:12 0 (const int) +0:12 'g_tInputTexture_sampler' ( uniform sampler) +0:13 move second child to first child ( temp texture2D) +0:13 tex: direct index for structure ( temp texture2D) +0:13 't' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:13 Constant: +0:13 1 (const int) +0:13 'g_tInputTexture' ( uniform texture2D) +0:14 Branch: Return with expression +0:14 't' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:18 Function Definition: @main( ( temp 4-component vector of float) +0:18 Function Parameters: +0:? Sequence +0:19 Sequence +0:19 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:19 'tex1' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:19 Construct structure ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:19 'g_tInputTexture_sampler' ( uniform sampler) +0:19 'g_tInputTexture' ( uniform texture2D) +0:20 Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:20 'res' ( temp 4-component vector of float) +0:20 Function Call: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) +0:20 'tex1' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:21 Sequence +0:21 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:21 'tex2' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:21 Function Call: fillOpaque( ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:22 add second child into first child ( temp 4-component vector of float) +0:22 'res' ( temp 4-component vector of float) +0:22 Function Call: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) +0:22 'tex2' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:23 Sequence +0:23 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:23 'tex3' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:23 'tex1' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:24 add second child into first child ( temp 4-component vector of float) +0:24 'res' ( temp 4-component vector of float) +0:24 Function Call: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) +0:24 'tex3' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:26 Branch: Return with expression +0:26 'res' ( temp 4-component vector of float) +0:18 Function Definition: main( ( temp void) +0:18 Function Parameters: +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:18 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_tInputTexture_sampler' ( uniform sampler) +0:? 'g_tInputTexture' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 82 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 80 + Source HLSL 500 + Name 4 "main" + Name 9 "FxaaTex" + MemberName 9(FxaaTex) 0 "smpl" + MemberName 9(FxaaTex) 1 "tex" + Name 14 "lookUp(struct-FxaaTex-p1-t211;" + Name 13 "tex" + Name 17 "fillOpaque(" + Name 20 "@main(" + Name 41 "t" + Name 43 "g_tInputTexture_sampler" + Name 47 "g_tInputTexture" + Name 53 "tex1" + Name 58 "res" + Name 59 "param" + Name 62 "tex2" + Name 64 "param" + Name 69 "tex3" + Name 71 "param" + Name 80 "@entryPointOutput" + Decorate 43(g_tInputTexture_sampler) DescriptorSet 0 + Decorate 47(g_tInputTexture) DescriptorSet 0 + Decorate 80(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeSampler + 7: TypeFloat 32 + 8: TypeImage 7(float) 2D sampled format:Unknown + 9(FxaaTex): TypeStruct 6 8 + 10: TypePointer Function 9(FxaaTex) + 11: TypeVector 7(float) 4 + 12: TypeFunction 11(fvec4) 10(ptr) + 16: TypeFunction 9(FxaaTex) + 19: TypeFunction 11(fvec4) + 22: TypeInt 32 1 + 23: 22(int) Constant 1 + 24: TypePointer Function 8 + 27: 22(int) Constant 0 + 28: TypePointer Function 6 + 31: TypeSampledImage 8 + 33: TypeVector 7(float) 2 + 34: 7(float) Constant 1050253722 + 35: 7(float) Constant 1053609165 + 36: 33(fvec2) ConstantComposite 34 35 + 37: 7(float) Constant 0 + 42: TypePointer UniformConstant 6 +43(g_tInputTexture_sampler): 42(ptr) Variable UniformConstant + 46: TypePointer UniformConstant 8 +47(g_tInputTexture): 46(ptr) Variable UniformConstant + 57: TypePointer Function 11(fvec4) + 79: TypePointer Output 11(fvec4) +80(@entryPointOutput): 79(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 81: 11(fvec4) FunctionCall 20(@main() + Store 80(@entryPointOutput) 81 + Return + FunctionEnd +14(lookUp(struct-FxaaTex-p1-t211;): 11(fvec4) Function None 12 + 13(tex): 10(ptr) FunctionParameter + 15: Label + 25: 24(ptr) AccessChain 13(tex) 23 + 26: 8 Load 25 + 29: 28(ptr) AccessChain 13(tex) 27 + 30: 6 Load 29 + 32: 31 SampledImage 26 30 + 38: 11(fvec4) ImageSampleExplicitLod 32 36 Lod 37 + ReturnValue 38 + FunctionEnd + 17(fillOpaque(): 9(FxaaTex) Function None 16 + 18: Label + 41(t): 10(ptr) Variable Function + 44: 6 Load 43(g_tInputTexture_sampler) + 45: 28(ptr) AccessChain 41(t) 27 + Store 45 44 + 48: 8 Load 47(g_tInputTexture) + 49: 24(ptr) AccessChain 41(t) 23 + Store 49 48 + 50: 9(FxaaTex) Load 41(t) + ReturnValue 50 + FunctionEnd + 20(@main(): 11(fvec4) Function None 19 + 21: Label + 53(tex1): 10(ptr) Variable Function + 58(res): 57(ptr) Variable Function + 59(param): 10(ptr) Variable Function + 62(tex2): 10(ptr) Variable Function + 64(param): 10(ptr) Variable Function + 69(tex3): 10(ptr) Variable Function + 71(param): 10(ptr) Variable Function + 54: 6 Load 43(g_tInputTexture_sampler) + 55: 8 Load 47(g_tInputTexture) + 56: 9(FxaaTex) CompositeConstruct 54 55 + Store 53(tex1) 56 + 60: 9(FxaaTex) Load 53(tex1) + Store 59(param) 60 + 61: 11(fvec4) FunctionCall 14(lookUp(struct-FxaaTex-p1-t211;) 59(param) + Store 58(res) 61 + 63: 9(FxaaTex) FunctionCall 17(fillOpaque() + Store 62(tex2) 63 + 65: 9(FxaaTex) Load 62(tex2) + Store 64(param) 65 + 66: 11(fvec4) FunctionCall 14(lookUp(struct-FxaaTex-p1-t211;) 64(param) + 67: 11(fvec4) Load 58(res) + 68: 11(fvec4) FAdd 67 66 + Store 58(res) 68 + 70: 9(FxaaTex) Load 53(tex1) + Store 69(tex3) 70 + 72: 9(FxaaTex) Load 69(tex3) + Store 71(param) 72 + 73: 11(fvec4) FunctionCall 14(lookUp(struct-FxaaTex-p1-t211;) 71(param) + 74: 11(fvec4) Load 58(res) + 75: 11(fvec4) FAdd 74 73 + Store 58(res) 75 + 76: 11(fvec4) Load 58(res) + ReturnValue 76 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out b/deps/glslang/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out new file mode 100644 index 00000000..bf959804 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out @@ -0,0 +1,195 @@ +hlsl.flattenOpaqueInitMix.vert +WARNING: AST will form illegal SPIR-V; need to transform to legalize +Shader version: 500 +0:? Sequence +0:5 Function Definition: lookUp(struct-FxaaTex-p1-t21-f11; ( temp 4-component vector of float) +0:5 Function Parameters: +0:5 'tex' ( in structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:? Sequence +0:6 Branch: Return with expression +0:6 texture ( temp 4-component vector of float) +0:6 Construct combined texture-sampler ( temp sampler2D) +0:6 tex: direct index for structure ( temp texture2D) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:6 Constant: +0:6 1 (const int) +0:6 smpl: direct index for structure ( temp sampler) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:6 Constant: +0:6 0 (const int) +0:? Construct vec2 ( temp 2-component vector of float) +0:6 f: direct index for structure ( temp float) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:6 Constant: +0:6 2 (const int) +0:6 f: direct index for structure ( temp float) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:6 Constant: +0:6 2 (const int) +0:10 Function Definition: @main( ( temp 4-component vector of float) +0:10 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:11 'tex' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:11 Construct structure ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:11 'g_tInputTexture_sampler' ( uniform sampler) +0:11 'g_tInputTexture' ( uniform texture2D) +0:11 Constant: +0:11 0.500000 +0:12 Branch: Return with expression +0:12 Function Call: lookUp(struct-FxaaTex-p1-t21-f11; ( temp 4-component vector of float) +0:12 'tex' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:10 Function Definition: main( ( temp void) +0:10 Function Parameters: +0:? Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:10 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_tInputTexture_sampler' ( uniform sampler) +0:? 'g_tInputTexture' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:5 Function Definition: lookUp(struct-FxaaTex-p1-t21-f11; ( temp 4-component vector of float) +0:5 Function Parameters: +0:5 'tex' ( in structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:? Sequence +0:6 Branch: Return with expression +0:6 texture ( temp 4-component vector of float) +0:6 Construct combined texture-sampler ( temp sampler2D) +0:6 tex: direct index for structure ( temp texture2D) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:6 Constant: +0:6 1 (const int) +0:6 smpl: direct index for structure ( temp sampler) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:6 Constant: +0:6 0 (const int) +0:? Construct vec2 ( temp 2-component vector of float) +0:6 f: direct index for structure ( temp float) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:6 Constant: +0:6 2 (const int) +0:6 f: direct index for structure ( temp float) +0:6 'tex' ( in structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:6 Constant: +0:6 2 (const int) +0:10 Function Definition: @main( ( temp 4-component vector of float) +0:10 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:11 'tex' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:11 Construct structure ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:11 'g_tInputTexture_sampler' ( uniform sampler) +0:11 'g_tInputTexture' ( uniform texture2D) +0:11 Constant: +0:11 0.500000 +0:12 Branch: Return with expression +0:12 Function Call: lookUp(struct-FxaaTex-p1-t21-f11; ( temp 4-component vector of float) +0:12 'tex' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f}) +0:10 Function Definition: main( ( temp void) +0:10 Function Parameters: +0:? Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:10 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_tInputTexture_sampler' ( uniform sampler) +0:? 'g_tInputTexture' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 59 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 57 + Source HLSL 500 + Name 4 "main" + Name 9 "FxaaTex" + MemberName 9(FxaaTex) 0 "smpl" + MemberName 9(FxaaTex) 1 "tex" + MemberName 9(FxaaTex) 2 "f" + Name 14 "lookUp(struct-FxaaTex-p1-t21-f11;" + Name 13 "tex" + Name 17 "@main(" + Name 42 "tex" + Name 44 "g_tInputTexture_sampler" + Name 47 "g_tInputTexture" + Name 51 "param" + Name 57 "@entryPointOutput" + Decorate 44(g_tInputTexture_sampler) DescriptorSet 0 + Decorate 47(g_tInputTexture) DescriptorSet 0 + Decorate 57(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeSampler + 7: TypeFloat 32 + 8: TypeImage 7(float) 2D sampled format:Unknown + 9(FxaaTex): TypeStruct 6 8 7(float) + 10: TypePointer Function 9(FxaaTex) + 11: TypeVector 7(float) 4 + 12: TypeFunction 11(fvec4) 10(ptr) + 16: TypeFunction 11(fvec4) + 19: TypeInt 32 1 + 20: 19(int) Constant 1 + 21: TypePointer Function 8 + 24: 19(int) Constant 0 + 25: TypePointer Function 6 + 28: TypeSampledImage 8 + 30: 19(int) Constant 2 + 31: TypePointer Function 7(float) + 36: TypeVector 7(float) 2 + 38: 7(float) Constant 0 + 43: TypePointer UniformConstant 6 +44(g_tInputTexture_sampler): 43(ptr) Variable UniformConstant + 46: TypePointer UniformConstant 8 +47(g_tInputTexture): 46(ptr) Variable UniformConstant + 49: 7(float) Constant 1056964608 + 56: TypePointer Output 11(fvec4) +57(@entryPointOutput): 56(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 58: 11(fvec4) FunctionCall 17(@main() + Store 57(@entryPointOutput) 58 + Return + FunctionEnd +14(lookUp(struct-FxaaTex-p1-t21-f11;): 11(fvec4) Function None 12 + 13(tex): 10(ptr) FunctionParameter + 15: Label + 22: 21(ptr) AccessChain 13(tex) 20 + 23: 8 Load 22 + 26: 25(ptr) AccessChain 13(tex) 24 + 27: 6 Load 26 + 29: 28 SampledImage 23 27 + 32: 31(ptr) AccessChain 13(tex) 30 + 33: 7(float) Load 32 + 34: 31(ptr) AccessChain 13(tex) 30 + 35: 7(float) Load 34 + 37: 36(fvec2) CompositeConstruct 33 35 + 39: 11(fvec4) ImageSampleExplicitLod 29 37 Lod 38 + ReturnValue 39 + FunctionEnd + 17(@main(): 11(fvec4) Function None 16 + 18: Label + 42(tex): 10(ptr) Variable Function + 51(param): 10(ptr) Variable Function + 45: 6 Load 44(g_tInputTexture_sampler) + 48: 8 Load 47(g_tInputTexture) + 50: 9(FxaaTex) CompositeConstruct 45 48 49 + Store 42(tex) 50 + 52: 9(FxaaTex) Load 42(tex) + Store 51(param) 52 + 53: 11(fvec4) FunctionCall 14(lookUp(struct-FxaaTex-p1-t21-f11;) 51(param) + ReturnValue 53 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.flattenSubset.frag.out b/deps/glslang/Test/baseResults/hlsl.flattenSubset.frag.out new file mode 100644 index 00000000..92e2a969 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.flattenSubset.frag.out @@ -0,0 +1,216 @@ +hlsl.flattenSubset.frag +WARNING: AST will form illegal SPIR-V; need to transform to legalize +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:30 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:30 Function Parameters: +0:30 'vpos' ( in 4-component vector of float) +0:? Sequence +0:33 move second child to first child ( temp sampler) +0:33 ss: direct index for structure ( temp sampler) +0:33 s0: direct index for structure ( temp structure{ temp int x, temp int y, temp sampler ss}) +0:33 's1' ( temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a}) +0:33 Constant: +0:33 2 (const int) +0:33 Constant: +0:33 2 (const int) +0:33 'samp' ( uniform sampler) +0:34 move second child to first child ( temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a}) +0:34 resources: direct index for structure ( temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a}) +0:34 's2' ( temp structure{ temp int a1, temp int a2, temp int a3, temp int a4, temp int a5, temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a} resources}) +0:34 Constant: +0:34 5 (const int) +0:34 's1' ( temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a}) +0:35 Branch: Return with expression +0:35 texture ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp sampler2D) +0:35 'tex' ( uniform texture2D) +0:35 ss: direct index for structure ( temp sampler) +0:35 s0: direct index for structure ( temp structure{ temp int x, temp int y, temp sampler ss}) +0:35 resources: direct index for structure ( temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a}) +0:35 's2' ( temp structure{ temp int a1, temp int a2, temp int a3, temp int a4, temp int a5, temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a} resources}) +0:35 Constant: +0:35 5 (const int) +0:35 Constant: +0:35 2 (const int) +0:35 Constant: +0:35 2 (const int) +0:35 Constant: +0:35 0.500000 +0:35 0.500000 +0:30 Function Definition: main( ( temp void) +0:30 Function Parameters: +0:? Sequence +0:30 move second child to first child ( temp 4-component vector of float) +0:? 'vpos' ( temp 4-component vector of float) +0:? 'vpos' (layout( location=0) in 4-component vector of float) +0:30 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:30 Function Call: @main(vf4; ( temp 4-component vector of float) +0:? 'vpos' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'samp' ( uniform sampler) +0:? 'tex' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'vpos' (layout( location=0) in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:30 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:30 Function Parameters: +0:30 'vpos' ( in 4-component vector of float) +0:? Sequence +0:33 move second child to first child ( temp sampler) +0:33 ss: direct index for structure ( temp sampler) +0:33 s0: direct index for structure ( temp structure{ temp int x, temp int y, temp sampler ss}) +0:33 's1' ( temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a}) +0:33 Constant: +0:33 2 (const int) +0:33 Constant: +0:33 2 (const int) +0:33 'samp' ( uniform sampler) +0:34 move second child to first child ( temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a}) +0:34 resources: direct index for structure ( temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a}) +0:34 's2' ( temp structure{ temp int a1, temp int a2, temp int a3, temp int a4, temp int a5, temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a} resources}) +0:34 Constant: +0:34 5 (const int) +0:34 's1' ( temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a}) +0:35 Branch: Return with expression +0:35 texture ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp sampler2D) +0:35 'tex' ( uniform texture2D) +0:35 ss: direct index for structure ( temp sampler) +0:35 s0: direct index for structure ( temp structure{ temp int x, temp int y, temp sampler ss}) +0:35 resources: direct index for structure ( temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a}) +0:35 's2' ( temp structure{ temp int a1, temp int a2, temp int a3, temp int a4, temp int a5, temp structure{ temp float b, temp sampler samplerState, temp structure{ temp int x, temp int y, temp sampler ss} s0, temp int a} resources}) +0:35 Constant: +0:35 5 (const int) +0:35 Constant: +0:35 2 (const int) +0:35 Constant: +0:35 2 (const int) +0:35 Constant: +0:35 0.500000 +0:35 0.500000 +0:30 Function Definition: main( ( temp void) +0:30 Function Parameters: +0:? Sequence +0:30 move second child to first child ( temp 4-component vector of float) +0:? 'vpos' ( temp 4-component vector of float) +0:? 'vpos' (layout( location=0) in 4-component vector of float) +0:30 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:30 Function Call: @main(vf4; ( temp 4-component vector of float) +0:? 'vpos' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'samp' ( uniform sampler) +0:? 'tex' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'vpos' (layout( location=0) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 54 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 47 50 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vf4;" + Name 10 "vpos" + Name 15 "S0" + MemberName 15(S0) 0 "x" + MemberName 15(S0) 1 "y" + MemberName 15(S0) 2 "ss" + Name 16 "S1" + MemberName 16(S1) 0 "b" + MemberName 16(S1) 1 "samplerState" + MemberName 16(S1) 2 "s0" + MemberName 16(S1) 3 "a" + Name 18 "s1" + Name 21 "samp" + Name 25 "S2" + MemberName 25(S2) 0 "a1" + MemberName 25(S2) 1 "a2" + MemberName 25(S2) 2 "a3" + MemberName 25(S2) 3 "a4" + MemberName 25(S2) 4 "a5" + MemberName 25(S2) 5 "resources" + Name 27 "s2" + Name 33 "tex" + Name 45 "vpos" + Name 47 "vpos" + Name 50 "@entryPointOutput" + Name 51 "param" + Decorate 21(samp) DescriptorSet 0 + Decorate 33(tex) DescriptorSet 0 + Decorate 47(vpos) Location 0 + Decorate 50(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) + 13: TypeSampler + 14: TypeInt 32 1 + 15(S0): TypeStruct 14(int) 14(int) 13 + 16(S1): TypeStruct 6(float) 13 15(S0) 14(int) + 17: TypePointer Function 16(S1) + 19: 14(int) Constant 2 + 20: TypePointer UniformConstant 13 + 21(samp): 20(ptr) Variable UniformConstant + 23: TypePointer Function 13 + 25(S2): TypeStruct 14(int) 14(int) 14(int) 14(int) 14(int) 16(S1) + 26: TypePointer Function 25(S2) + 28: 14(int) Constant 5 + 31: TypeImage 6(float) 2D sampled format:Unknown + 32: TypePointer UniformConstant 31 + 33(tex): 32(ptr) Variable UniformConstant + 37: TypeSampledImage 31 + 39: TypeVector 6(float) 2 + 40: 6(float) Constant 1056964608 + 41: 39(fvec2) ConstantComposite 40 40 + 46: TypePointer Input 7(fvec4) + 47(vpos): 46(ptr) Variable Input + 49: TypePointer Output 7(fvec4) +50(@entryPointOutput): 49(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 45(vpos): 8(ptr) Variable Function + 51(param): 8(ptr) Variable Function + 48: 7(fvec4) Load 47(vpos) + Store 45(vpos) 48 + 52: 7(fvec4) Load 45(vpos) + Store 51(param) 52 + 53: 7(fvec4) FunctionCall 11(@main(vf4;) 51(param) + Store 50(@entryPointOutput) 53 + Return + FunctionEnd + 11(@main(vf4;): 7(fvec4) Function None 9 + 10(vpos): 8(ptr) FunctionParameter + 12: Label + 18(s1): 17(ptr) Variable Function + 27(s2): 26(ptr) Variable Function + 22: 13 Load 21(samp) + 24: 23(ptr) AccessChain 18(s1) 19 19 + Store 24 22 + 29: 16(S1) Load 18(s1) + 30: 17(ptr) AccessChain 27(s2) 28 + Store 30 29 + 34: 31 Load 33(tex) + 35: 23(ptr) AccessChain 27(s2) 28 19 19 + 36: 13 Load 35 + 38: 37 SampledImage 34 36 + 42: 7(fvec4) ImageSampleImplicitLod 38 41 + ReturnValue 42 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.flattenSubset2.frag.out b/deps/glslang/Test/baseResults/hlsl.flattenSubset2.frag.out new file mode 100644 index 00000000..b22734a8 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.flattenSubset2.frag.out @@ -0,0 +1,248 @@ +hlsl.flattenSubset2.frag +WARNING: AST will form illegal SPIR-V; need to transform to legalize +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:8 Function Parameters: +0:8 'vpos' ( in 4-component vector of float) +0:? Sequence +0:13 move second child to first child ( temp structure{ temp float y, temp texture2D texNested}) +0:13 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:13 'a1' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp float x}) +0:13 Constant: +0:13 0 (const int) +0:13 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:13 'a2' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp float x}) +0:13 Constant: +0:13 0 (const int) +0:14 move second child to first child ( temp structure{ temp float y, temp texture2D texNested}) +0:14 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:14 'b' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp texture2D tex}) +0:14 Constant: +0:14 0 (const int) +0:14 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:14 'a1' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp float x}) +0:14 Constant: +0:14 0 (const int) +0:17 Sequence +0:17 move second child to first child ( temp structure{ temp float y, temp texture2D texNested}) +0:17 'n' ( temp structure{ temp float y, temp texture2D texNested}) +0:17 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:17 'b' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp texture2D tex}) +0:17 Constant: +0:17 0 (const int) +0:20 move second child to first child ( temp texture2D) +0:20 texNested: direct index for structure ( temp texture2D) +0:20 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:20 'a2' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp float x}) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 'someTex' ( uniform texture2D) +0:21 move second child to first child ( temp float) +0:21 y: direct index for structure ( temp float) +0:21 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:21 'a1' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp float x}) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1.000000 +0:23 Branch: Return with expression +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:? 'vpos' ( temp 4-component vector of float) +0:? 'vpos' (layout( location=0) in 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:8 Function Call: @main(vf4; ( temp 4-component vector of float) +0:? 'vpos' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'someTex' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'vpos' (layout( location=0) in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:8 Function Parameters: +0:8 'vpos' ( in 4-component vector of float) +0:? Sequence +0:13 move second child to first child ( temp structure{ temp float y, temp texture2D texNested}) +0:13 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:13 'a1' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp float x}) +0:13 Constant: +0:13 0 (const int) +0:13 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:13 'a2' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp float x}) +0:13 Constant: +0:13 0 (const int) +0:14 move second child to first child ( temp structure{ temp float y, temp texture2D texNested}) +0:14 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:14 'b' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp texture2D tex}) +0:14 Constant: +0:14 0 (const int) +0:14 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:14 'a1' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp float x}) +0:14 Constant: +0:14 0 (const int) +0:17 Sequence +0:17 move second child to first child ( temp structure{ temp float y, temp texture2D texNested}) +0:17 'n' ( temp structure{ temp float y, temp texture2D texNested}) +0:17 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:17 'b' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp texture2D tex}) +0:17 Constant: +0:17 0 (const int) +0:20 move second child to first child ( temp texture2D) +0:20 texNested: direct index for structure ( temp texture2D) +0:20 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:20 'a2' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp float x}) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 'someTex' ( uniform texture2D) +0:21 move second child to first child ( temp float) +0:21 y: direct index for structure ( temp float) +0:21 n: direct index for structure ( temp structure{ temp float y, temp texture2D texNested}) +0:21 'a1' ( temp structure{ temp structure{ temp float y, temp texture2D texNested} n, temp float x}) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1.000000 +0:23 Branch: Return with expression +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:? 'vpos' ( temp 4-component vector of float) +0:? 'vpos' (layout( location=0) in 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:8 Function Call: @main(vf4; ( temp 4-component vector of float) +0:? 'vpos' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'someTex' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'vpos' (layout( location=0) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 56 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 49 52 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vf4;" + Name 10 "vpos" + Name 14 "Nested" + MemberName 14(Nested) 0 "y" + MemberName 14(Nested) 1 "texNested" + Name 15 "A" + MemberName 15(A) 0 "n" + MemberName 15(A) 1 "x" + Name 17 "a1" + Name 20 "a2" + Name 25 "B" + MemberName 25(B) 0 "n" + MemberName 25(B) 1 "tex" + Name 27 "b" + Name 31 "n" + Name 36 "someTex" + Name 47 "vpos" + Name 49 "vpos" + Name 52 "@entryPointOutput" + Name 53 "param" + Decorate 36(someTex) DescriptorSet 0 + Decorate 49(vpos) Location 0 + Decorate 52(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) + 13: TypeImage 6(float) 2D sampled format:Unknown + 14(Nested): TypeStruct 6(float) 13 + 15(A): TypeStruct 14(Nested) 6(float) + 16: TypePointer Function 15(A) + 18: TypeInt 32 1 + 19: 18(int) Constant 0 + 21: TypePointer Function 14(Nested) + 25(B): TypeStruct 14(Nested) 13 + 26: TypePointer Function 25(B) + 34: 18(int) Constant 1 + 35: TypePointer UniformConstant 13 + 36(someTex): 35(ptr) Variable UniformConstant + 38: TypePointer Function 13 + 40: 6(float) Constant 1065353216 + 41: TypePointer Function 6(float) + 43: 6(float) Constant 0 + 44: 7(fvec4) ConstantComposite 43 43 43 43 + 48: TypePointer Input 7(fvec4) + 49(vpos): 48(ptr) Variable Input + 51: TypePointer Output 7(fvec4) +52(@entryPointOutput): 51(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 47(vpos): 8(ptr) Variable Function + 53(param): 8(ptr) Variable Function + 50: 7(fvec4) Load 49(vpos) + Store 47(vpos) 50 + 54: 7(fvec4) Load 47(vpos) + Store 53(param) 54 + 55: 7(fvec4) FunctionCall 11(@main(vf4;) 53(param) + Store 52(@entryPointOutput) 55 + Return + FunctionEnd + 11(@main(vf4;): 7(fvec4) Function None 9 + 10(vpos): 8(ptr) FunctionParameter + 12: Label + 17(a1): 16(ptr) Variable Function + 20(a2): 16(ptr) Variable Function + 27(b): 26(ptr) Variable Function + 31(n): 21(ptr) Variable Function + 22: 21(ptr) AccessChain 20(a2) 19 + 23: 14(Nested) Load 22 + 24: 21(ptr) AccessChain 17(a1) 19 + Store 24 23 + 28: 21(ptr) AccessChain 17(a1) 19 + 29: 14(Nested) Load 28 + 30: 21(ptr) AccessChain 27(b) 19 + Store 30 29 + 32: 21(ptr) AccessChain 27(b) 19 + 33: 14(Nested) Load 32 + Store 31(n) 33 + 37: 13 Load 36(someTex) + 39: 38(ptr) AccessChain 20(a2) 19 34 + Store 39 37 + 42: 41(ptr) AccessChain 17(a1) 19 19 + Store 42 40 + ReturnValue 44 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.float1.frag.out b/deps/glslang/Test/baseResults/hlsl.float1.frag.out new file mode 100644 index 00000000..49827dcf --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.float1.frag.out @@ -0,0 +1,111 @@ +hlsl.float1.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:1 Sequence +0:1 move second child to first child ( temp 1-component vector of float) +0:1 'f1' ( global 1-component vector of float) +0:1 Constant: +0:1 1.000000 +0:2 Sequence +0:2 move second child to first child ( temp float) +0:2 'scalar' ( global float) +0:2 Constant: +0:2 2.000000 +0:5 Function Definition: ShaderFunction(vf1;f1; ( temp 1-component vector of float) +0:5 Function Parameters: +0:5 'inFloat1' ( in 1-component vector of float) +0:5 'inScalar' ( in float) +0:? Sequence +0:6 Branch: Return with expression +0:6 add ( temp 1-component vector of float) +0:6 vector-scale ( temp 1-component vector of float) +0:6 'f1' ( global 1-component vector of float) +0:6 'scalar' ( global float) +0:6 vector-scale ( temp 1-component vector of float) +0:6 'inFloat1' ( in 1-component vector of float) +0:6 'inScalar' ( in float) +0:? Linker Objects +0:? 'f1' ( global 1-component vector of float) +0:? 'scalar' ( global float) + + +Linked fragment stage: + +WARNING: Linking fragment stage: Entry point not found + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:1 Sequence +0:1 move second child to first child ( temp 1-component vector of float) +0:1 'f1' ( global 1-component vector of float) +0:1 Constant: +0:1 1.000000 +0:2 Sequence +0:2 move second child to first child ( temp float) +0:2 'scalar' ( global float) +0:2 Constant: +0:2 2.000000 +0:5 Function Definition: ShaderFunction(vf1;f1; ( temp 1-component vector of float) +0:5 Function Parameters: +0:5 'inFloat1' ( in 1-component vector of float) +0:5 'inScalar' ( in float) +0:? Sequence +0:6 Branch: Return with expression +0:6 add ( temp 1-component vector of float) +0:6 vector-scale ( temp 1-component vector of float) +0:6 'f1' ( global 1-component vector of float) +0:6 'scalar' ( global float) +0:6 vector-scale ( temp 1-component vector of float) +0:6 'inFloat1' ( in 1-component vector of float) +0:6 'inScalar' ( in float) +0:? Linker Objects +0:? 'f1' ( global 1-component vector of float) +0:? 'scalar' ( global float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 27 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 11 "ShaderFunction(vf1;f1;" + Name 9 "inFloat1" + Name 10 "inScalar" + Name 14 "f1" + Name 16 "scalar" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeFunction 6(float) 7(ptr) 7(ptr) + 13: TypePointer Private 6(float) + 14(f1): 13(ptr) Variable Private + 15: 6(float) Constant 1065353216 + 16(scalar): 13(ptr) Variable Private + 17: 6(float) Constant 1073741824 +4(PixelShaderFunction): 2 Function None 3 + 5: Label + Store 14(f1) 15 + Store 16(scalar) 17 + Return + FunctionEnd +11(ShaderFunction(vf1;f1;): 6(float) Function None 8 + 9(inFloat1): 7(ptr) FunctionParameter + 10(inScalar): 7(ptr) FunctionParameter + 12: Label + 18: 6(float) Load 14(f1) + 19: 6(float) Load 16(scalar) + 20: 6(float) FMul 18 19 + 21: 6(float) Load 9(inFloat1) + 22: 6(float) Load 10(inScalar) + 23: 6(float) FMul 21 22 + 24: 6(float) FAdd 20 23 + ReturnValue 24 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.float4.frag.out b/deps/glslang/Test/baseResults/hlsl.float4.frag.out new file mode 100644 index 00000000..cd741ed0 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.float4.frag.out @@ -0,0 +1,96 @@ +hlsl.float4.frag +WARNING: 0:5: 'register' : ignoring shader_profile +WARNING: 0:6: 'register' : ignoring shader_profile + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:9 Function Definition: ShaderFunction(vf4; ( temp 4-component vector of float) +0:9 Function Parameters: +0:9 'input' ( in 4-component vector of float) +0:? Sequence +0:10 Branch: Return with expression +0:10 component-wise multiply ( temp 4-component vector of float) +0:10 'input' ( in 4-component vector of float) +0:10 AmbientColor: direct index for structure ( uniform 4-component vector of float) +0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float AmbientColor, uniform bool ff1, layout( offset=20) uniform float ff2, layout( binding=0 offset=32) uniform 4-component vector of float ff3, layout( binding=1 offset=48) uniform 4-component vector of float ff4}) +0:10 Constant: +0:10 0 (const uint) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float AmbientColor, uniform bool ff1, layout( offset=20) uniform float ff2, layout( binding=0 offset=32) uniform 4-component vector of float ff3, layout( binding=1 offset=48) uniform 4-component vector of float ff4}) + + +Linked fragment stage: + +WARNING: Linking fragment stage: Entry point not found + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:9 Function Definition: ShaderFunction(vf4; ( temp 4-component vector of float) +0:9 Function Parameters: +0:9 'input' ( in 4-component vector of float) +0:? Sequence +0:10 Branch: Return with expression +0:10 component-wise multiply ( temp 4-component vector of float) +0:10 'input' ( in 4-component vector of float) +0:10 AmbientColor: direct index for structure ( uniform 4-component vector of float) +0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float AmbientColor, uniform bool ff1, layout( offset=20) uniform float ff2, layout( binding=0 offset=32) uniform 4-component vector of float ff3, layout( binding=1 offset=48) uniform 4-component vector of float ff4}) +0:10 Constant: +0:10 0 (const uint) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float AmbientColor, uniform bool ff1, layout( offset=20) uniform float ff2, layout( binding=0 offset=32) uniform 4-component vector of float ff3, layout( binding=1 offset=48) uniform 4-component vector of float ff4}) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 26 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 11 "ShaderFunction(vf4;" + Name 10 "input" + Name 15 "$Global" + MemberName 15($Global) 0 "AmbientColor" + MemberName 15($Global) 1 "ff1" + MemberName 15($Global) 2 "ff2" + MemberName 15($Global) 3 "ff3" + MemberName 15($Global) 4 "ff4" + Name 17 "" + MemberDecorate 15($Global) 0 Offset 0 + MemberDecorate 15($Global) 1 Offset 16 + MemberDecorate 15($Global) 2 Offset 20 + MemberDecorate 15($Global) 3 Offset 32 + MemberDecorate 15($Global) 4 Offset 48 + Decorate 15($Global) Block + Decorate 17 DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) + 14: TypeInt 32 0 + 15($Global): TypeStruct 7(fvec4) 14(int) 6(float) 7(fvec4) 7(fvec4) + 16: TypePointer Uniform 15($Global) + 17: 16(ptr) Variable Uniform + 18: TypeInt 32 1 + 19: 18(int) Constant 0 + 20: TypePointer Uniform 7(fvec4) +4(PixelShaderFunction): 2 Function None 3 + 5: Label + Return + FunctionEnd +11(ShaderFunction(vf4;): 7(fvec4) Function None 9 + 10(input): 8(ptr) FunctionParameter + 12: Label + 13: 7(fvec4) Load 10(input) + 21: 20(ptr) AccessChain 17 19 + 22: 7(fvec4) Load 21 + 23: 7(fvec4) FMul 13 22 + ReturnValue 23 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.forLoop.frag.out b/deps/glslang/Test/baseResults/hlsl.forLoop.frag.out new file mode 100644 index 00000000..3e835f80 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.forLoop.frag.out @@ -0,0 +1,705 @@ +hlsl.forLoop.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' ( in 4-component vector of float) +0:? Sequence +0:? Sequence +0:3 Loop with condition tested first +0:3 No loop condition +0:3 No loop body +0:4 Sequence +0:4 Pre-Increment ( temp 4-component vector of float) +0:4 'input' ( in 4-component vector of float) +0:4 Loop with condition tested first +0:4 No loop condition +0:4 No loop body +0:? Sequence +0:5 Loop with condition tested first: Unroll +0:5 Loop Condition +0:5 any ( temp bool) +0:5 NotEqual ( temp 4-component vector of bool) +0:5 'input' ( in 4-component vector of float) +0:5 'input' ( in 4-component vector of float) +0:5 No loop body +0:? Sequence +0:6 Loop with condition tested first +0:6 Loop Condition +0:6 any ( temp bool) +0:6 NotEqual ( temp 4-component vector of bool) +0:6 'input' ( in 4-component vector of float) +0:6 'input' ( in 4-component vector of float) +0:6 Loop Body +0:? Sequence +0:6 Branch: Return with expression +0:6 Negate value ( temp 4-component vector of float) +0:6 'input' ( in 4-component vector of float) +0:7 Sequence +0:7 Pre-Decrement ( temp 4-component vector of float) +0:7 'input' ( in 4-component vector of float) +0:7 Loop with condition tested first +0:7 Loop Condition +0:7 any ( temp bool) +0:7 NotEqual ( temp 4-component vector of bool) +0:7 'input' ( in 4-component vector of float) +0:7 'input' ( in 4-component vector of float) +0:7 Loop Body +0:? Sequence +0:7 Branch: Return with expression +0:7 Negate value ( temp 4-component vector of float) +0:7 'input' ( in 4-component vector of float) +0:7 Loop Terminal Expression +0:7 add second child into first child ( temp 4-component vector of float) +0:7 'input' ( in 4-component vector of float) +0:7 Constant: +0:7 2.000000 +0:? Sequence +0:8 Loop with condition tested first +0:8 No loop condition +0:8 Loop Body +0:8 Test condition and select ( temp void) +0:8 Condition +0:8 Compare Greater Than ( temp bool) +0:8 direct index ( temp float) +0:8 'input' ( in 4-component vector of float) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 2.000000 +0:8 true case +0:8 Branch: Break +0:? Sequence +0:9 Loop with condition tested first +0:9 No loop condition +0:9 Loop Body +0:9 Test condition and select ( temp void) +0:9 Condition +0:9 Compare Greater Than ( temp bool) +0:9 direct index ( temp float) +0:9 'input' ( in 4-component vector of float) +0:9 Constant: +0:9 0 (const int) +0:9 Constant: +0:9 2.000000 +0:9 true case +0:9 Branch: Continue +0:11 Sequence +0:11 move second child to first child ( temp int) +0:11 'ii' ( temp int) +0:11 Constant: +0:11 -1 (const int) +0:11 Loop with condition tested first +0:11 Loop Condition +0:11 Compare Less Than ( temp bool) +0:11 'ii' ( temp int) +0:11 Constant: +0:11 3 (const int) +0:11 Loop Body +0:11 Test condition and select ( temp void) +0:11 Condition +0:11 Compare Equal ( temp bool) +0:11 'ii' ( temp int) +0:11 Constant: +0:11 2 (const int) +0:11 true case +0:11 Branch: Continue +0:11 Loop Terminal Expression +0:11 Pre-Increment ( temp int) +0:11 'ii' ( temp int) +0:12 Pre-Decrement ( temp float) +0:12 'ii' ( temp float) +0:13 Sequence +0:13 move second child to first child ( temp int) +0:13 'first' ( temp int) +0:13 Constant: +0:13 0 (const int) +0:13 move second child to first child ( temp int) +0:13 'second' ( temp int) +0:13 Constant: +0:13 1 (const int) +0:13 Loop with condition tested first +0:13 No loop condition +0:13 Loop Body +0:13 add ( temp int) +0:13 'first' ( temp int) +0:13 'second' ( temp int) +0:14 Sequence +0:14 move second child to first child ( temp int) +0:14 'i' ( temp int) +0:14 Constant: +0:14 0 (const int) +0:14 move second child to first child ( temp int) +0:14 'count' ( temp int) +0:14 Convert float to int ( temp int) +0:14 'ii' ( temp float) +0:14 Loop with condition tested first +0:14 Loop Condition +0:14 Compare Less Than ( temp bool) +0:14 'i' ( temp int) +0:14 'count' ( temp int) +0:14 No loop body +0:14 Loop Terminal Expression +0:14 Post-Increment ( temp int) +0:14 'i' ( temp int) +0:15 Sequence +0:15 move second child to first child ( temp float) +0:15 'first' ( temp float) +0:15 Constant: +0:15 0.000000 +0:15 Loop with condition tested first +0:15 Loop Condition +0:15 Compare Less Than ( temp bool) +0:15 'first' ( temp float) +0:15 direct index ( temp float) +0:15 'second' ( temp 2-element array of float) +0:15 Constant: +0:15 0 (const int) +0:15 Loop Body +0:15 add ( temp float) +0:15 add ( temp float) +0:15 'first' ( temp float) +0:15 direct index ( temp float) +0:15 'second' ( temp 2-element array of float) +0:15 Constant: +0:15 1 (const int) +0:15 'third' ( temp float) +0:15 Loop Terminal Expression +0:15 Pre-Increment ( temp float) +0:15 direct index ( temp float) +0:15 'second' ( temp 2-element array of float) +0:15 Constant: +0:15 1 (const int) +0:? Sequence +0:16 Comma ( temp float) +0:16 Comma ( temp float) +0:16 Pre-Decrement ( temp float) +0:16 'ii' ( temp float) +0:16 Pre-Decrement ( temp float) +0:16 'ii' ( temp float) +0:16 Pre-Decrement ( temp float) +0:16 'ii' ( temp float) +0:16 Loop with condition tested first +0:16 No loop condition +0:16 Loop Body +0:16 'ii' ( temp float) +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' ( in 4-component vector of float) +0:? Sequence +0:? Sequence +0:3 Loop with condition tested first +0:3 No loop condition +0:3 No loop body +0:4 Sequence +0:4 Pre-Increment ( temp 4-component vector of float) +0:4 'input' ( in 4-component vector of float) +0:4 Loop with condition tested first +0:4 No loop condition +0:4 No loop body +0:? Sequence +0:5 Loop with condition tested first: Unroll +0:5 Loop Condition +0:5 any ( temp bool) +0:5 NotEqual ( temp 4-component vector of bool) +0:5 'input' ( in 4-component vector of float) +0:5 'input' ( in 4-component vector of float) +0:5 No loop body +0:? Sequence +0:6 Loop with condition tested first +0:6 Loop Condition +0:6 any ( temp bool) +0:6 NotEqual ( temp 4-component vector of bool) +0:6 'input' ( in 4-component vector of float) +0:6 'input' ( in 4-component vector of float) +0:6 Loop Body +0:? Sequence +0:6 Branch: Return with expression +0:6 Negate value ( temp 4-component vector of float) +0:6 'input' ( in 4-component vector of float) +0:7 Sequence +0:7 Pre-Decrement ( temp 4-component vector of float) +0:7 'input' ( in 4-component vector of float) +0:7 Loop with condition tested first +0:7 Loop Condition +0:7 any ( temp bool) +0:7 NotEqual ( temp 4-component vector of bool) +0:7 'input' ( in 4-component vector of float) +0:7 'input' ( in 4-component vector of float) +0:7 Loop Body +0:? Sequence +0:7 Branch: Return with expression +0:7 Negate value ( temp 4-component vector of float) +0:7 'input' ( in 4-component vector of float) +0:7 Loop Terminal Expression +0:7 add second child into first child ( temp 4-component vector of float) +0:7 'input' ( in 4-component vector of float) +0:7 Constant: +0:7 2.000000 +0:? Sequence +0:8 Loop with condition tested first +0:8 No loop condition +0:8 Loop Body +0:8 Test condition and select ( temp void) +0:8 Condition +0:8 Compare Greater Than ( temp bool) +0:8 direct index ( temp float) +0:8 'input' ( in 4-component vector of float) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 2.000000 +0:8 true case +0:8 Branch: Break +0:? Sequence +0:9 Loop with condition tested first +0:9 No loop condition +0:9 Loop Body +0:9 Test condition and select ( temp void) +0:9 Condition +0:9 Compare Greater Than ( temp bool) +0:9 direct index ( temp float) +0:9 'input' ( in 4-component vector of float) +0:9 Constant: +0:9 0 (const int) +0:9 Constant: +0:9 2.000000 +0:9 true case +0:9 Branch: Continue +0:11 Sequence +0:11 move second child to first child ( temp int) +0:11 'ii' ( temp int) +0:11 Constant: +0:11 -1 (const int) +0:11 Loop with condition tested first +0:11 Loop Condition +0:11 Compare Less Than ( temp bool) +0:11 'ii' ( temp int) +0:11 Constant: +0:11 3 (const int) +0:11 Loop Body +0:11 Test condition and select ( temp void) +0:11 Condition +0:11 Compare Equal ( temp bool) +0:11 'ii' ( temp int) +0:11 Constant: +0:11 2 (const int) +0:11 true case +0:11 Branch: Continue +0:11 Loop Terminal Expression +0:11 Pre-Increment ( temp int) +0:11 'ii' ( temp int) +0:12 Pre-Decrement ( temp float) +0:12 'ii' ( temp float) +0:13 Sequence +0:13 move second child to first child ( temp int) +0:13 'first' ( temp int) +0:13 Constant: +0:13 0 (const int) +0:13 move second child to first child ( temp int) +0:13 'second' ( temp int) +0:13 Constant: +0:13 1 (const int) +0:13 Loop with condition tested first +0:13 No loop condition +0:13 Loop Body +0:13 add ( temp int) +0:13 'first' ( temp int) +0:13 'second' ( temp int) +0:14 Sequence +0:14 move second child to first child ( temp int) +0:14 'i' ( temp int) +0:14 Constant: +0:14 0 (const int) +0:14 move second child to first child ( temp int) +0:14 'count' ( temp int) +0:14 Convert float to int ( temp int) +0:14 'ii' ( temp float) +0:14 Loop with condition tested first +0:14 Loop Condition +0:14 Compare Less Than ( temp bool) +0:14 'i' ( temp int) +0:14 'count' ( temp int) +0:14 No loop body +0:14 Loop Terminal Expression +0:14 Post-Increment ( temp int) +0:14 'i' ( temp int) +0:15 Sequence +0:15 move second child to first child ( temp float) +0:15 'first' ( temp float) +0:15 Constant: +0:15 0.000000 +0:15 Loop with condition tested first +0:15 Loop Condition +0:15 Compare Less Than ( temp bool) +0:15 'first' ( temp float) +0:15 direct index ( temp float) +0:15 'second' ( temp 2-element array of float) +0:15 Constant: +0:15 0 (const int) +0:15 Loop Body +0:15 add ( temp float) +0:15 add ( temp float) +0:15 'first' ( temp float) +0:15 direct index ( temp float) +0:15 'second' ( temp 2-element array of float) +0:15 Constant: +0:15 1 (const int) +0:15 'third' ( temp float) +0:15 Loop Terminal Expression +0:15 Pre-Increment ( temp float) +0:15 direct index ( temp float) +0:15 'second' ( temp 2-element array of float) +0:15 Constant: +0:15 1 (const int) +0:? Sequence +0:16 Comma ( temp float) +0:16 Comma ( temp float) +0:16 Pre-Decrement ( temp float) +0:16 'ii' ( temp float) +0:16 Pre-Decrement ( temp float) +0:16 'ii' ( temp float) +0:16 Pre-Decrement ( temp float) +0:16 'ii' ( temp float) +0:16 Loop with condition tested first +0:16 No loop condition +0:16 Loop Body +0:16 'ii' ( temp float) +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 183 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 176 179 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 11 "@PixelShaderFunction(vf4;" + Name 10 "input" + Name 92 "ii" + Name 111 "ii" + Name 114 "first" + Name 116 "second" + Name 124 "i" + Name 125 "count" + Name 138 "first" + Name 149 "second" + Name 157 "third" + Name 174 "input" + Name 176 "input" + Name 179 "@entryPointOutput" + Name 180 "param" + Decorate 176(input) Location 0 + Decorate 179(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) + 18: 6(float) Constant 1065353216 + 32: TypeBool + 33: TypeVector 32(bool) 4 + 63: 6(float) Constant 1073741824 + 71: TypeInt 32 0 + 72: 71(int) Constant 0 + 73: TypePointer Function 6(float) + 90: TypeInt 32 1 + 91: TypePointer Function 90(int) + 93: 90(int) Constant 4294967295 + 100: 90(int) Constant 3 + 103: 90(int) Constant 2 + 109: 90(int) Constant 1 + 115: 90(int) Constant 0 + 139: 6(float) Constant 0 + 146: 71(int) Constant 2 + 147: TypeArray 6(float) 146 + 148: TypePointer Function 147 + 175: TypePointer Input 7(fvec4) + 176(input): 175(ptr) Variable Input + 178: TypePointer Output 7(fvec4) +179(@entryPointOutput): 178(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 174(input): 8(ptr) Variable Function + 180(param): 8(ptr) Variable Function + 177: 7(fvec4) Load 176(input) + Store 174(input) 177 + 181: 7(fvec4) Load 174(input) + Store 180(param) 181 + 182: 7(fvec4) FunctionCall 11(@PixelShaderFunction(vf4;) 180(param) + Store 179(@entryPointOutput) 182 + Return + FunctionEnd +11(@PixelShaderFunction(vf4;): 7(fvec4) Function None 9 + 10(input): 8(ptr) FunctionParameter + 12: Label + 92(ii): 91(ptr) Variable Function + 111(ii): 73(ptr) Variable Function + 114(first): 91(ptr) Variable Function + 116(second): 91(ptr) Variable Function + 124(i): 91(ptr) Variable Function + 125(count): 91(ptr) Variable Function + 138(first): 73(ptr) Variable Function + 149(second): 148(ptr) Variable Function + 157(third): 73(ptr) Variable Function + Branch 13 + 13: Label + LoopMerge 15 16 None + Branch 14 + 14: Label + Branch 16 + 16: Label + Branch 13 + 15: Label + 17: 7(fvec4) Load 10(input) + 19: 7(fvec4) CompositeConstruct 18 18 18 18 + 20: 7(fvec4) FAdd 17 19 + Store 10(input) 20 + Branch 21 + 21: Label + LoopMerge 23 24 None + Branch 22 + 22: Label + Branch 24 + 24: Label + Branch 21 + 23: Label + Branch 25 + 25: Label + LoopMerge 27 28 Unroll + Branch 29 + 29: Label + 30: 7(fvec4) Load 10(input) + 31: 7(fvec4) Load 10(input) + 34: 33(bvec4) FOrdNotEqual 30 31 + 35: 32(bool) Any 34 + BranchConditional 35 26 27 + 26: Label + Branch 28 + 28: Label + Branch 25 + 27: Label + Branch 36 + 36: Label + LoopMerge 38 39 None + Branch 40 + 40: Label + 41: 7(fvec4) Load 10(input) + 42: 7(fvec4) Load 10(input) + 43: 33(bvec4) FOrdNotEqual 41 42 + 44: 32(bool) Any 43 + BranchConditional 44 37 38 + 37: Label + 45: 7(fvec4) Load 10(input) + 46: 7(fvec4) FNegate 45 + ReturnValue 46 + 39: Label + Branch 36 + 38: Label + 48: 7(fvec4) Load 10(input) + 49: 7(fvec4) CompositeConstruct 18 18 18 18 + 50: 7(fvec4) FSub 48 49 + Store 10(input) 50 + Branch 51 + 51: Label + LoopMerge 53 54 None + Branch 55 + 55: Label + 56: 7(fvec4) Load 10(input) + 57: 7(fvec4) Load 10(input) + 58: 33(bvec4) FOrdNotEqual 56 57 + 59: 32(bool) Any 58 + BranchConditional 59 52 53 + 52: Label + 60: 7(fvec4) Load 10(input) + 61: 7(fvec4) FNegate 60 + ReturnValue 61 + 54: Label + 64: 7(fvec4) Load 10(input) + 65: 7(fvec4) CompositeConstruct 63 63 63 63 + 66: 7(fvec4) FAdd 64 65 + Store 10(input) 66 + Branch 51 + 53: Label + Branch 67 + 67: Label + LoopMerge 69 70 None + Branch 68 + 68: Label + 74: 73(ptr) AccessChain 10(input) 72 + 75: 6(float) Load 74 + 76: 32(bool) FOrdGreaterThan 75 63 + SelectionMerge 78 None + BranchConditional 76 77 78 + 77: Label + Branch 69 + 78: Label + Branch 70 + 70: Label + Branch 67 + 69: Label + Branch 80 + 80: Label + LoopMerge 82 83 None + Branch 81 + 81: Label + 84: 73(ptr) AccessChain 10(input) 72 + 85: 6(float) Load 84 + 86: 32(bool) FOrdGreaterThan 85 63 + SelectionMerge 88 None + BranchConditional 86 87 88 + 87: Label + Branch 83 + 88: Label + Branch 83 + 83: Label + Branch 80 + 82: Label + Store 92(ii) 93 + Branch 94 + 94: Label + LoopMerge 96 97 None + Branch 98 + 98: Label + 99: 90(int) Load 92(ii) + 101: 32(bool) SLessThan 99 100 + BranchConditional 101 95 96 + 95: Label + 102: 90(int) Load 92(ii) + 104: 32(bool) IEqual 102 103 + SelectionMerge 106 None + BranchConditional 104 105 106 + 105: Label + Branch 97 + 106: Label + Branch 97 + 97: Label + 108: 90(int) Load 92(ii) + 110: 90(int) IAdd 108 109 + Store 92(ii) 110 + Branch 94 + 96: Label + 112: 6(float) Load 111(ii) + 113: 6(float) FSub 112 18 + Store 111(ii) 113 + Store 114(first) 115 + Store 116(second) 109 + Branch 117 + 117: Label + LoopMerge 119 120 None + Branch 118 + 118: Label + 121: 90(int) Load 114(first) + 122: 90(int) Load 116(second) + 123: 90(int) IAdd 121 122 + Branch 120 + 120: Label + Branch 117 + 119: Label + Store 124(i) 115 + 126: 6(float) Load 111(ii) + 127: 90(int) ConvertFToS 126 + Store 125(count) 127 + Branch 128 + 128: Label + LoopMerge 130 131 None + Branch 132 + 132: Label + 133: 90(int) Load 124(i) + 134: 90(int) Load 125(count) + 135: 32(bool) SLessThan 133 134 + BranchConditional 135 129 130 + 129: Label + Branch 131 + 131: Label + 136: 90(int) Load 124(i) + 137: 90(int) IAdd 136 109 + Store 124(i) 137 + Branch 128 + 130: Label + Store 138(first) 139 + Branch 140 + 140: Label + LoopMerge 142 143 None + Branch 144 + 144: Label + 145: 6(float) Load 138(first) + 150: 73(ptr) AccessChain 149(second) 115 + 151: 6(float) Load 150 + 152: 32(bool) FOrdLessThan 145 151 + BranchConditional 152 141 142 + 141: Label + 153: 6(float) Load 138(first) + 154: 73(ptr) AccessChain 149(second) 109 + 155: 6(float) Load 154 + 156: 6(float) FAdd 153 155 + 158: 6(float) Load 157(third) + 159: 6(float) FAdd 156 158 + Branch 143 + 143: Label + 160: 73(ptr) AccessChain 149(second) 109 + 161: 6(float) Load 160 + 162: 6(float) FAdd 161 18 + Store 160 162 + Branch 140 + 142: Label + 163: 6(float) Load 111(ii) + 164: 6(float) FSub 163 18 + Store 111(ii) 164 + 165: 6(float) Load 111(ii) + 166: 6(float) FSub 165 18 + Store 111(ii) 166 + 167: 6(float) Load 111(ii) + 168: 6(float) FSub 167 18 + Store 111(ii) 168 + Branch 169 + 169: Label + LoopMerge 171 172 None + Branch 170 + 170: Label + Branch 172 + 172: Label + Branch 169 + 171: Label + 173: 7(fvec4) Undef + ReturnValue 173 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.frag.out b/deps/glslang/Test/baseResults/hlsl.frag.out new file mode 100644 index 00000000..b0e6e4df --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.frag.out @@ -0,0 +1,161 @@ +hlsl.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:1 move second child to first child (temp 4-component vector of float) +0:1 'AmbientColor' (temp 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 0.500000 +0:? 0.000000 +0:? 1.000000 +0:2 move second child to first child (temp float) +0:2 'AmbientIntensity' (temp float) +0:2 Constant: +0:2 0.100000 +0:13 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) +0:5 Function Parameters: +0:5 'input' (in 4-component vector of float) +0:? Sequence +0:6 Branch: Return with expression +0:6 add (temp 4-component vector of float) +0:6 vector-scale (temp 4-component vector of float) +0:6 'input' (in 4-component vector of float) +0:6 'AmbientIntensity' (temp float) +0:6 'AmbientColor' (temp 4-component vector of float) +0:7 Branch: Return with expression +0:7 add (temp 4-component vector of float) +0:7 component-wise multiply (temp 4-component vector of float) +0:7 'input' (in 4-component vector of float) +0:7 'input' (in 4-component vector of float) +0:7 component-wise multiply (temp 4-component vector of float) +0:7 'input' (in 4-component vector of float) +0:7 'input' (in 4-component vector of float) +0:8 Branch: Return with expression +0:8 add (temp 4-component vector of float) +0:8 add (temp 4-component vector of float) +0:8 'input' (in 4-component vector of float) +0:8 component-wise multiply (temp 4-component vector of float) +0:8 'input' (in 4-component vector of float) +0:8 'input' (in 4-component vector of float) +0:8 'input' (in 4-component vector of float) +0:9 Branch: Return with expression +0:9 component-wise multiply (temp 4-component vector of float) +0:9 Pre-Increment (temp 4-component vector of float) +0:9 'input' (in 4-component vector of float) +0:9 Negate value (temp 4-component vector of float) +0:9 Negate value (temp 4-component vector of float) +0:9 Pre-Decrement (temp 4-component vector of float) +0:9 'input' (in 4-component vector of float) +0:10 Branch: Return with expression +0:10 add (temp 4-component vector of float) +0:10 Post-Increment (temp 4-component vector of float) +0:10 'input' (in 4-component vector of float) +0:10 Pre-Increment (temp 4-component vector of float) +0:10 'input' (in 4-component vector of float) +0:11 Branch: Return with expression +0:11 sine (global 4-component vector of float) +0:11 'input' (in 4-component vector of float) +0:? Linker Objects +0:? 'AmbientColor' (temp 4-component vector of float) +0:? 'AmbientIntensity' (temp float) + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:1 move second child to first child (temp 4-component vector of float) +0:1 'AmbientColor' (temp 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 0.500000 +0:? 0.000000 +0:? 1.000000 +0:2 move second child to first child (temp float) +0:2 'AmbientIntensity' (temp float) +0:2 Constant: +0:2 0.100000 +0:13 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) +0:5 Function Parameters: +0:5 'input' (in 4-component vector of float) +0:? Sequence +0:6 Branch: Return with expression +0:6 add (temp 4-component vector of float) +0:6 vector-scale (temp 4-component vector of float) +0:6 'input' (in 4-component vector of float) +0:6 'AmbientIntensity' (temp float) +0:6 'AmbientColor' (temp 4-component vector of float) +0:7 Branch: Return with expression +0:7 add (temp 4-component vector of float) +0:7 component-wise multiply (temp 4-component vector of float) +0:7 'input' (in 4-component vector of float) +0:7 'input' (in 4-component vector of float) +0:7 component-wise multiply (temp 4-component vector of float) +0:7 'input' (in 4-component vector of float) +0:7 'input' (in 4-component vector of float) +0:8 Branch: Return with expression +0:8 add (temp 4-component vector of float) +0:8 add (temp 4-component vector of float) +0:8 'input' (in 4-component vector of float) +0:8 component-wise multiply (temp 4-component vector of float) +0:8 'input' (in 4-component vector of float) +0:8 'input' (in 4-component vector of float) +0:8 'input' (in 4-component vector of float) +0:9 Branch: Return with expression +0:9 component-wise multiply (temp 4-component vector of float) +0:9 Pre-Increment (temp 4-component vector of float) +0:9 'input' (in 4-component vector of float) +0:9 Negate value (temp 4-component vector of float) +0:9 Negate value (temp 4-component vector of float) +0:9 Pre-Decrement (temp 4-component vector of float) +0:9 'input' (in 4-component vector of float) +0:10 Branch: Return with expression +0:10 add (temp 4-component vector of float) +0:10 Post-Increment (temp 4-component vector of float) +0:10 'input' (in 4-component vector of float) +0:10 Pre-Increment (temp 4-component vector of float) +0:10 'input' (in 4-component vector of float) +0:11 Branch: Return with expression +0:11 sine (global 4-component vector of float) +0:11 'input' (in 4-component vector of float) +0:? Linker Objects +0:? 'AmbientColor' (temp 4-component vector of float) +0:? 'AmbientIntensity' (temp float) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 58 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 9 + ExecutionMode 4 OriginUpperLeft + Source HLSL 450 + Name 4 "PixelShaderFunction" + Name 9 "input" + Name 12 "AmbientIntensity" + Name 16 "AmbientColor" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Input 7(fvec4) + 9(input): 8(ptr) Variable Input + 11: TypePointer Function 6(float) + 15: TypePointer Function 7(fvec4) + 37: 6(float) Constant 1065353216 +4(PixelShaderFunction): 2 Function None 3 + 5: Label +12(AmbientIntensity): 11(ptr) Variable Function +16(AmbientColor): 15(ptr) Variable Function + 10: 7(fvec4) Load 9(input) + 13: 6(float) Load 12(AmbientIntensity) + 14: 7(fvec4) VectorTimesScalar 10 13 + 17: 7(fvec4) Load 16(AmbientColor) + 18: 7(fvec4) FAdd 14 17 + ReturnValue 18 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.fraggeom.frag.out b/deps/glslang/Test/baseResults/hlsl.fraggeom.frag.out new file mode 100644 index 00000000..af3564d1 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.fraggeom.frag.out @@ -0,0 +1,112 @@ +hlsl.fraggeom.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:9 Function Definition: GS_Draw(struct-myVertex-vf41;struct-myVertex-vf41; ( temp void) +0:9 Function Parameters: +0:9 'IN' ( in structure{ temp 4-component vector of float pos}) +0:9 'OutputStream' ( out structure{ temp 4-component vector of float pos}) +0:? Sequence +0:10 Constant: +0:10 0.000000 +0:11 Constant: +0:11 0.000000 +0:15 Function Definition: @main( ( temp 4-component vector of float) +0:15 Function Parameters: +0:? Sequence +0:16 Branch: Return with expression +0:16 Constant: +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:15 Function Definition: main( ( temp void) +0:15 Function Parameters: +0:? Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:15 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:9 Function Definition: GS_Draw(struct-myVertex-vf41;struct-myVertex-vf41; ( temp void) +0:9 Function Parameters: +0:9 'IN' ( in structure{ temp 4-component vector of float pos}) +0:9 'OutputStream' ( out structure{ temp 4-component vector of float pos}) +0:? Sequence +0:10 Constant: +0:10 0.000000 +0:11 Constant: +0:11 0.000000 +0:15 Function Definition: @main( ( temp 4-component vector of float) +0:15 Function Parameters: +0:? Sequence +0:16 Branch: Return with expression +0:16 Constant: +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:15 Function Definition: main( ( temp void) +0:15 Function Parameters: +0:? Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:15 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 25 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 23 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "myVertex" + MemberName 8(myVertex) 0 "pos" + Name 13 "GS_Draw(struct-myVertex-vf41;struct-myVertex-vf41;" + Name 11 "IN" + Name 12 "OutputStream" + Name 16 "@main(" + Name 23 "@entryPointOutput" + Decorate 23(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(myVertex): TypeStruct 7(fvec4) + 9: TypePointer Function 8(myVertex) + 10: TypeFunction 2 9(ptr) 9(ptr) + 15: TypeFunction 7(fvec4) + 18: 6(float) Constant 0 + 19: 7(fvec4) ConstantComposite 18 18 18 18 + 22: TypePointer Output 7(fvec4) +23(@entryPointOutput): 22(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 24: 7(fvec4) FunctionCall 16(@main() + Store 23(@entryPointOutput) 24 + Return + FunctionEnd +13(GS_Draw(struct-myVertex-vf41;struct-myVertex-vf41;): 2 Function None 10 + 11(IN): 9(ptr) FunctionParameter +12(OutputStream): 9(ptr) FunctionParameter + 14: Label + Return + FunctionEnd + 16(@main(): 7(fvec4) Function None 15 + 17: Label + ReturnValue 19 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.function.frag.out b/deps/glslang/Test/baseResults/hlsl.function.frag.out new file mode 100644 index 00000000..00b882d8 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.function.frag.out @@ -0,0 +1,119 @@ +hlsl.function.frag +ERROR: 0:24: 'fun1' : unknown variable +ERROR: 0:24: 'return' : type does not match, or is not convertible to, the function's return type +ERROR: 2 compilation errors. No code generated. + + +Shader version: 500 +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:2 Function Definition: fun0( ( temp 4-component vector of float) +0:2 Function Parameters: +0:? Sequence +0:3 Branch: Return with expression +0:3 Constant: +0:3 1.000000 +0:3 1.000000 +0:3 1.000000 +0:3 1.000000 +0:7 Function Definition: fun2(vf4; ( temp uint) +0:7 Function Parameters: +0:7 'col' ( in 4-component vector of float) +0:? Sequence +0:8 Branch: Return with expression +0:8 Constant: +0:8 7 (const uint) +0:12 Function Definition: fun4(u1;u1; ( temp 4-component vector of float) +0:12 Function Parameters: +0:12 'id1' ( in uint) +0:12 'id2' ( in uint) +0:? Sequence +0:13 Branch: Return with expression +0:13 Construct vec4 ( temp 4-component vector of float) +0:13 Convert uint to float ( temp float) +0:13 component-wise multiply ( temp uint) +0:13 'id1' ( in uint) +0:13 'id2' ( in uint) +0:17 Function Definition: fun1(i1; ( temp 4-component vector of float) +0:17 Function Parameters: +0:17 'index' ( in int) +0:? Sequence +0:18 Sequence +0:18 move second child to first child ( temp uint) +0:18 'entityId' ( temp uint) +0:18 Function Call: fun2(vf4; ( temp uint) +0:18 Function Call: fun0( ( temp 4-component vector of float) +0:19 Branch: Return with expression +0:19 Function Call: fun4(u1;u1; ( temp 4-component vector of float) +0:19 'entityId' ( temp uint) +0:19 'entityId' ( temp uint) +0:23 Function Definition: @main( ( temp int) +0:23 Function Parameters: +0:23 Function Definition: main( ( temp void) +0:23 Function Parameters: +0:? Sequence +0:23 move second child to first child ( temp int) +0:? '@entryPointOutput' (layout( location=0) out int) +0:23 Function Call: @main( ( temp int) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out int) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:2 Function Definition: fun0( ( temp 4-component vector of float) +0:2 Function Parameters: +0:? Sequence +0:3 Branch: Return with expression +0:3 Constant: +0:3 1.000000 +0:3 1.000000 +0:3 1.000000 +0:3 1.000000 +0:7 Function Definition: fun2(vf4; ( temp uint) +0:7 Function Parameters: +0:7 'col' ( in 4-component vector of float) +0:? Sequence +0:8 Branch: Return with expression +0:8 Constant: +0:8 7 (const uint) +0:12 Function Definition: fun4(u1;u1; ( temp 4-component vector of float) +0:12 Function Parameters: +0:12 'id1' ( in uint) +0:12 'id2' ( in uint) +0:? Sequence +0:13 Branch: Return with expression +0:13 Construct vec4 ( temp 4-component vector of float) +0:13 Convert uint to float ( temp float) +0:13 component-wise multiply ( temp uint) +0:13 'id1' ( in uint) +0:13 'id2' ( in uint) +0:17 Function Definition: fun1(i1; ( temp 4-component vector of float) +0:17 Function Parameters: +0:17 'index' ( in int) +0:? Sequence +0:18 Sequence +0:18 move second child to first child ( temp uint) +0:18 'entityId' ( temp uint) +0:18 Function Call: fun2(vf4; ( temp uint) +0:18 Function Call: fun0( ( temp 4-component vector of float) +0:19 Branch: Return with expression +0:19 Function Call: fun4(u1;u1; ( temp 4-component vector of float) +0:19 'entityId' ( temp uint) +0:19 'entityId' ( temp uint) +0:23 Function Definition: @main( ( temp int) +0:23 Function Parameters: +0:23 Function Definition: main( ( temp void) +0:23 Function Parameters: +0:? Sequence +0:23 move second child to first child ( temp int) +0:? '@entryPointOutput' (layout( location=0) out int) +0:23 Function Call: @main( ( temp int) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out int) + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/hlsl.gather.array.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.gather.array.dx10.frag.out new file mode 100644 index 00000000..be4606a2 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.gather.array.dx10.frag.out @@ -0,0 +1,453 @@ +hlsl.gather.array.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Parameters: +0:? Sequence +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of float) +0:29 'txval20' ( temp 4-component vector of float) +0:29 textureGather ( temp 4-component vector of float) +0:29 Construct combined texture-sampler ( temp sampler2DArray) +0:29 'g_tTex2df4a' ( uniform texture2DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:30 Sequence +0:30 move second child to first child ( temp 4-component vector of int) +0:30 'txval21' ( temp 4-component vector of int) +0:30 textureGather ( temp 4-component vector of int) +0:30 Construct combined texture-sampler ( temp isampler2DArray) +0:30 'g_tTex2di4a' ( uniform itexture2DArray) +0:30 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? 0.500000 +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of uint) +0:31 'txval22' ( temp 4-component vector of uint) +0:31 textureGather ( temp 4-component vector of uint) +0:31 Construct combined texture-sampler ( temp usampler2DArray) +0:31 'g_tTex2du4a' ( uniform utexture2DArray) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval40' ( temp 4-component vector of float) +0:35 textureGather ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp samplerCubeArray) +0:35 'g_tTexcdf4a' ( uniform textureCubeArray) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval41' ( temp 4-component vector of int) +0:36 textureGather ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isamplerCubeArray) +0:36 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval42' ( temp 4-component vector of uint) +0:37 textureGather ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usamplerCubeArray) +0:37 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:? 1.000000 +0:39 move second child to first child ( temp 4-component vector of float) +0:39 Color: direct index for structure ( temp 4-component vector of float) +0:39 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:40 move second child to first child ( temp float) +0:40 Depth: direct index for structure ( temp float) +0:40 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 1.000000 +0:42 Branch: Return with expression +0:42 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:24 Color: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:24 Depth: direct index for structure ( temp float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Parameters: +0:? Sequence +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of float) +0:29 'txval20' ( temp 4-component vector of float) +0:29 textureGather ( temp 4-component vector of float) +0:29 Construct combined texture-sampler ( temp sampler2DArray) +0:29 'g_tTex2df4a' ( uniform texture2DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:30 Sequence +0:30 move second child to first child ( temp 4-component vector of int) +0:30 'txval21' ( temp 4-component vector of int) +0:30 textureGather ( temp 4-component vector of int) +0:30 Construct combined texture-sampler ( temp isampler2DArray) +0:30 'g_tTex2di4a' ( uniform itexture2DArray) +0:30 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? 0.500000 +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of uint) +0:31 'txval22' ( temp 4-component vector of uint) +0:31 textureGather ( temp 4-component vector of uint) +0:31 Construct combined texture-sampler ( temp usampler2DArray) +0:31 'g_tTex2du4a' ( uniform utexture2DArray) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval40' ( temp 4-component vector of float) +0:35 textureGather ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp samplerCubeArray) +0:35 'g_tTexcdf4a' ( uniform textureCubeArray) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval41' ( temp 4-component vector of int) +0:36 textureGather ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isamplerCubeArray) +0:36 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval42' ( temp 4-component vector of uint) +0:37 textureGather ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usamplerCubeArray) +0:37 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:? 1.000000 +0:39 move second child to first child ( temp 4-component vector of float) +0:39 Color: direct index for structure ( temp 4-component vector of float) +0:39 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:40 move second child to first child ( temp float) +0:40 Depth: direct index for structure ( temp float) +0:40 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 1.000000 +0:42 Branch: Return with expression +0:42 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:24 Color: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:24 Depth: direct index for structure ( temp float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 124 + + Capability Shader + Capability Sampled1D + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 107 111 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval20" + Name 16 "g_tTex2df4a" + Name 20 "g_sSamp" + Name 34 "txval21" + Name 37 "g_tTex2di4a" + Name 49 "txval22" + Name 52 "g_tTex2du4a" + Name 61 "txval40" + Name 64 "g_tTexcdf4a" + Name 71 "txval41" + Name 74 "g_tTexcdi4a" + Name 81 "txval42" + Name 84 "g_tTexcdu4a" + Name 95 "psout" + Name 104 "flattenTemp" + Name 107 "@entryPointOutput.Color" + Name 111 "@entryPointOutput.Depth" + Name 116 "g_tTex1df4a" + Name 117 "g_tTex1df4" + Name 120 "g_tTex1di4a" + Name 123 "g_tTex1du4a" + Decorate 16(g_tTex2df4a) DescriptorSet 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 37(g_tTex2di4a) DescriptorSet 0 + Decorate 52(g_tTex2du4a) DescriptorSet 0 + Decorate 64(g_tTexcdf4a) DescriptorSet 0 + Decorate 74(g_tTexcdi4a) DescriptorSet 0 + Decorate 84(g_tTexcdu4a) DescriptorSet 0 + Decorate 107(@entryPointOutput.Color) Location 0 + Decorate 111(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 116(g_tTex1df4a) DescriptorSet 0 + Decorate 116(g_tTex1df4a) Binding 1 + Decorate 117(g_tTex1df4) DescriptorSet 0 + Decorate 117(g_tTex1df4) Binding 0 + Decorate 120(g_tTex1di4a) DescriptorSet 0 + Decorate 123(g_tTex1du4a) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 2D array sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex2df4a): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 3 + 25: 6(float) Constant 1036831949 + 26: 6(float) Constant 1045220557 + 27: 6(float) Constant 1050253722 + 28: 24(fvec3) ConstantComposite 25 26 27 + 29: TypeInt 32 1 + 30: 29(int) Constant 0 + 32: TypeVector 29(int) 4 + 33: TypePointer Function 32(ivec4) + 35: TypeImage 29(int) 2D array sampled format:Unknown + 36: TypePointer UniformConstant 35 + 37(g_tTex2di4a): 36(ptr) Variable UniformConstant + 40: TypeSampledImage 35 + 42: 6(float) Constant 1053609165 + 43: 6(float) Constant 1056964608 + 44: 24(fvec3) ConstantComposite 27 42 43 + 46: TypeInt 32 0 + 47: TypeVector 46(int) 4 + 48: TypePointer Function 47(ivec4) + 50: TypeImage 46(int) 2D array sampled format:Unknown + 51: TypePointer UniformConstant 50 + 52(g_tTex2du4a): 51(ptr) Variable UniformConstant + 55: TypeSampledImage 50 + 57: 6(float) Constant 1058642330 + 58: 6(float) Constant 1060320051 + 59: 24(fvec3) ConstantComposite 43 57 58 + 62: TypeImage 6(float) Cube array sampled format:Unknown + 63: TypePointer UniformConstant 62 + 64(g_tTexcdf4a): 63(ptr) Variable UniformConstant + 67: TypeSampledImage 62 + 69: 7(fvec4) ConstantComposite 25 26 27 42 + 72: TypeImage 29(int) Cube array sampled format:Unknown + 73: TypePointer UniformConstant 72 + 74(g_tTexcdi4a): 73(ptr) Variable UniformConstant + 77: TypeSampledImage 72 + 79: 7(fvec4) ConstantComposite 42 43 57 58 + 82: TypeImage 46(int) Cube array sampled format:Unknown + 83: TypePointer UniformConstant 82 + 84(g_tTexcdu4a): 83(ptr) Variable UniformConstant + 87: TypeSampledImage 82 + 89: 6(float) Constant 1061997773 + 90: 6(float) Constant 1063675494 + 91: 6(float) Constant 1065353216 + 92: 7(fvec4) ConstantComposite 58 89 90 91 + 94: TypePointer Function 8(PS_OUTPUT) + 96: 7(fvec4) ConstantComposite 91 91 91 91 + 98: 29(int) Constant 1 + 99: TypePointer Function 6(float) + 106: TypePointer Output 7(fvec4) +107(@entryPointOutput.Color): 106(ptr) Variable Output + 110: TypePointer Output 6(float) +111(@entryPointOutput.Depth): 110(ptr) Variable Output + 114: TypeImage 6(float) 1D array sampled format:Unknown + 115: TypePointer UniformConstant 114 +116(g_tTex1df4a): 115(ptr) Variable UniformConstant + 117(g_tTex1df4): 115(ptr) Variable UniformConstant + 118: TypeImage 29(int) 1D array sampled format:Unknown + 119: TypePointer UniformConstant 118 +120(g_tTex1di4a): 119(ptr) Variable UniformConstant + 121: TypeImage 46(int) 1D array sampled format:Unknown + 122: TypePointer UniformConstant 121 +123(g_tTex1du4a): 122(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +104(flattenTemp): 94(ptr) Variable Function + 105:8(PS_OUTPUT) FunctionCall 10(@main() + Store 104(flattenTemp) 105 + 108: 12(ptr) AccessChain 104(flattenTemp) 30 + 109: 7(fvec4) Load 108 + Store 107(@entryPointOutput.Color) 109 + 112: 99(ptr) AccessChain 104(flattenTemp) 98 + 113: 6(float) Load 112 + Store 111(@entryPointOutput.Depth) 113 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval20): 12(ptr) Variable Function + 34(txval21): 33(ptr) Variable Function + 49(txval22): 48(ptr) Variable Function + 61(txval40): 12(ptr) Variable Function + 71(txval41): 33(ptr) Variable Function + 81(txval42): 48(ptr) Variable Function + 95(psout): 94(ptr) Variable Function + 17: 14 Load 16(g_tTex2df4a) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 31: 7(fvec4) ImageGather 23 28 30 + Store 13(txval20) 31 + 38: 35 Load 37(g_tTex2di4a) + 39: 18 Load 20(g_sSamp) + 41: 40 SampledImage 38 39 + 45: 32(ivec4) ImageGather 41 44 30 + Store 34(txval21) 45 + 53: 50 Load 52(g_tTex2du4a) + 54: 18 Load 20(g_sSamp) + 56: 55 SampledImage 53 54 + 60: 47(ivec4) ImageGather 56 59 30 + Store 49(txval22) 60 + 65: 62 Load 64(g_tTexcdf4a) + 66: 18 Load 20(g_sSamp) + 68: 67 SampledImage 65 66 + 70: 7(fvec4) ImageGather 68 69 30 + Store 61(txval40) 70 + 75: 72 Load 74(g_tTexcdi4a) + 76: 18 Load 20(g_sSamp) + 78: 77 SampledImage 75 76 + 80: 32(ivec4) ImageGather 78 79 30 + Store 71(txval41) 80 + 85: 82 Load 84(g_tTexcdu4a) + 86: 18 Load 20(g_sSamp) + 88: 87 SampledImage 85 86 + 93: 47(ivec4) ImageGather 88 92 30 + Store 81(txval42) 93 + 97: 12(ptr) AccessChain 95(psout) 30 + Store 97 96 + 100: 99(ptr) AccessChain 95(psout) 98 + Store 100 91 + 101:8(PS_OUTPUT) Load 95(psout) + ReturnValue 101 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.gather.basic.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.gather.basic.dx10.frag.out new file mode 100644 index 00000000..8182ddeb --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.gather.basic.dx10.frag.out @@ -0,0 +1,467 @@ +hlsl.gather.basic.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:29 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 Function Parameters: +0:? Sequence +0:34 Sequence +0:34 move second child to first child ( temp 4-component vector of float) +0:34 'txval20' ( temp 4-component vector of float) +0:34 textureGather ( temp 4-component vector of float) +0:34 Construct combined texture-sampler ( temp sampler2D) +0:34 'g_tTex2df4' ( uniform texture2D) +0:34 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of int) +0:35 'txval21' ( temp 4-component vector of int) +0:35 textureGather ( temp 4-component vector of int) +0:35 Construct combined texture-sampler ( temp isampler2D) +0:35 'g_tTex2di4' ( uniform itexture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of uint) +0:36 'txval22' ( temp 4-component vector of uint) +0:36 textureGather ( temp 4-component vector of uint) +0:36 Construct combined texture-sampler ( temp usampler2D) +0:36 'g_tTex2du4' ( uniform utexture2D) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of float) +0:40 'txval40' ( temp 4-component vector of float) +0:40 textureGather ( temp 4-component vector of float) +0:40 Construct combined texture-sampler ( temp samplerCube) +0:40 'g_tTexcdf4' ( uniform textureCube) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of int) +0:41 'txval41' ( temp 4-component vector of int) +0:41 textureGather ( temp 4-component vector of int) +0:41 Construct combined texture-sampler ( temp isamplerCube) +0:41 'g_tTexcdi4' ( uniform itextureCube) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:42 Sequence +0:42 move second child to first child ( temp 4-component vector of uint) +0:42 'txval42' ( temp 4-component vector of uint) +0:42 textureGather ( temp 4-component vector of uint) +0:42 Construct combined texture-sampler ( temp usamplerCube) +0:42 'g_tTexcdu4' ( uniform utextureCube) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:44 move second child to first child ( temp 4-component vector of float) +0:44 Color: direct index for structure ( temp 4-component vector of float) +0:44 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 1.000000 +0:44 1.000000 +0:44 1.000000 +0:44 1.000000 +0:45 move second child to first child ( temp float) +0:45 Depth: direct index for structure ( temp float) +0:45 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:45 Constant: +0:45 1 (const int) +0:45 Constant: +0:45 1.000000 +0:47 Branch: Return with expression +0:47 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 Function Definition: main( ( temp void) +0:29 Function Parameters: +0:? Sequence +0:29 Sequence +0:29 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:29 Color: direct index for structure ( temp 4-component vector of float) +0:29 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 Constant: +0:29 0 (const int) +0:29 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:29 Depth: direct index for structure ( temp float) +0:29 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 Constant: +0:29 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_sSamp2d' ( uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:29 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 Function Parameters: +0:? Sequence +0:34 Sequence +0:34 move second child to first child ( temp 4-component vector of float) +0:34 'txval20' ( temp 4-component vector of float) +0:34 textureGather ( temp 4-component vector of float) +0:34 Construct combined texture-sampler ( temp sampler2D) +0:34 'g_tTex2df4' ( uniform texture2D) +0:34 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of int) +0:35 'txval21' ( temp 4-component vector of int) +0:35 textureGather ( temp 4-component vector of int) +0:35 Construct combined texture-sampler ( temp isampler2D) +0:35 'g_tTex2di4' ( uniform itexture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of uint) +0:36 'txval22' ( temp 4-component vector of uint) +0:36 textureGather ( temp 4-component vector of uint) +0:36 Construct combined texture-sampler ( temp usampler2D) +0:36 'g_tTex2du4' ( uniform utexture2D) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of float) +0:40 'txval40' ( temp 4-component vector of float) +0:40 textureGather ( temp 4-component vector of float) +0:40 Construct combined texture-sampler ( temp samplerCube) +0:40 'g_tTexcdf4' ( uniform textureCube) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of int) +0:41 'txval41' ( temp 4-component vector of int) +0:41 textureGather ( temp 4-component vector of int) +0:41 Construct combined texture-sampler ( temp isamplerCube) +0:41 'g_tTexcdi4' ( uniform itextureCube) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:42 Sequence +0:42 move second child to first child ( temp 4-component vector of uint) +0:42 'txval42' ( temp 4-component vector of uint) +0:42 textureGather ( temp 4-component vector of uint) +0:42 Construct combined texture-sampler ( temp usamplerCube) +0:42 'g_tTexcdu4' ( uniform utextureCube) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:44 move second child to first child ( temp 4-component vector of float) +0:44 Color: direct index for structure ( temp 4-component vector of float) +0:44 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 1.000000 +0:44 1.000000 +0:44 1.000000 +0:44 1.000000 +0:45 move second child to first child ( temp float) +0:45 Depth: direct index for structure ( temp float) +0:45 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:45 Constant: +0:45 1 (const int) +0:45 Constant: +0:45 1.000000 +0:47 Branch: Return with expression +0:47 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 Function Definition: main( ( temp void) +0:29 Function Parameters: +0:? Sequence +0:29 Sequence +0:29 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:29 Color: direct index for structure ( temp 4-component vector of float) +0:29 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 Constant: +0:29 0 (const int) +0:29 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:29 Depth: direct index for structure ( temp float) +0:29 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 Constant: +0:29 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_sSamp2d' ( uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 135 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 108 112 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval20" + Name 16 "g_tTex2df4" + Name 20 "g_sSamp" + Name 33 "txval21" + Name 36 "g_tTex2di4" + Name 48 "txval22" + Name 51 "g_tTex2du4" + Name 60 "txval40" + Name 63 "g_tTexcdf4" + Name 71 "txval41" + Name 74 "g_tTexcdi4" + Name 81 "txval42" + Name 84 "g_tTexcdu4" + Name 95 "psout" + Name 105 "flattenTemp" + Name 108 "@entryPointOutput.Color" + Name 112 "@entryPointOutput.Depth" + Name 115 "g_sSamp2d" + Name 118 "g_tTex1df4a" + Name 119 "g_tTex1df4" + Name 122 "g_tTex1di4" + Name 125 "g_tTex1du4" + Name 128 "g_tTex3df4" + Name 131 "g_tTex3di4" + Name 134 "g_tTex3du4" + Decorate 16(g_tTex2df4) DescriptorSet 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 36(g_tTex2di4) DescriptorSet 0 + Decorate 51(g_tTex2du4) DescriptorSet 0 + Decorate 63(g_tTexcdf4) DescriptorSet 0 + Decorate 74(g_tTexcdi4) DescriptorSet 0 + Decorate 84(g_tTexcdu4) DescriptorSet 0 + Decorate 108(@entryPointOutput.Color) Location 0 + Decorate 112(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 115(g_sSamp2d) DescriptorSet 0 + Decorate 118(g_tTex1df4a) DescriptorSet 0 + Decorate 118(g_tTex1df4a) Binding 1 + Decorate 119(g_tTex1df4) DescriptorSet 0 + Decorate 119(g_tTex1df4) Binding 0 + Decorate 122(g_tTex1di4) DescriptorSet 0 + Decorate 125(g_tTex1du4) DescriptorSet 0 + Decorate 128(g_tTex3df4) DescriptorSet 0 + Decorate 131(g_tTex3di4) DescriptorSet 0 + Decorate 134(g_tTex3du4) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 2D sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex2df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 2 + 25: 6(float) Constant 1036831949 + 26: 6(float) Constant 1045220557 + 27: 24(fvec2) ConstantComposite 25 26 + 28: TypeInt 32 1 + 29: 28(int) Constant 0 + 31: TypeVector 28(int) 4 + 32: TypePointer Function 31(ivec4) + 34: TypeImage 28(int) 2D sampled format:Unknown + 35: TypePointer UniformConstant 34 + 36(g_tTex2di4): 35(ptr) Variable UniformConstant + 39: TypeSampledImage 34 + 41: 6(float) Constant 1050253722 + 42: 6(float) Constant 1053609165 + 43: 24(fvec2) ConstantComposite 41 42 + 45: TypeInt 32 0 + 46: TypeVector 45(int) 4 + 47: TypePointer Function 46(ivec4) + 49: TypeImage 45(int) 2D sampled format:Unknown + 50: TypePointer UniformConstant 49 + 51(g_tTex2du4): 50(ptr) Variable UniformConstant + 54: TypeSampledImage 49 + 56: 6(float) Constant 1056964608 + 57: 6(float) Constant 1058642330 + 58: 24(fvec2) ConstantComposite 56 57 + 61: TypeImage 6(float) Cube sampled format:Unknown + 62: TypePointer UniformConstant 61 + 63(g_tTexcdf4): 62(ptr) Variable UniformConstant + 66: TypeSampledImage 61 + 68: TypeVector 6(float) 3 + 69: 68(fvec3) ConstantComposite 25 26 41 + 72: TypeImage 28(int) Cube sampled format:Unknown + 73: TypePointer UniformConstant 72 + 74(g_tTexcdi4): 73(ptr) Variable UniformConstant + 77: TypeSampledImage 72 + 79: 68(fvec3) ConstantComposite 42 56 57 + 82: TypeImage 45(int) Cube sampled format:Unknown + 83: TypePointer UniformConstant 82 + 84(g_tTexcdu4): 83(ptr) Variable UniformConstant + 87: TypeSampledImage 82 + 89: 6(float) Constant 1060320051 + 90: 6(float) Constant 1061997773 + 91: 6(float) Constant 1063675494 + 92: 68(fvec3) ConstantComposite 89 90 91 + 94: TypePointer Function 8(PS_OUTPUT) + 96: 6(float) Constant 1065353216 + 97: 7(fvec4) ConstantComposite 96 96 96 96 + 99: 28(int) Constant 1 + 100: TypePointer Function 6(float) + 107: TypePointer Output 7(fvec4) +108(@entryPointOutput.Color): 107(ptr) Variable Output + 111: TypePointer Output 6(float) +112(@entryPointOutput.Depth): 111(ptr) Variable Output + 115(g_sSamp2d): 19(ptr) Variable UniformConstant + 116: TypeImage 6(float) 1D sampled format:Unknown + 117: TypePointer UniformConstant 116 +118(g_tTex1df4a): 117(ptr) Variable UniformConstant + 119(g_tTex1df4): 117(ptr) Variable UniformConstant + 120: TypeImage 28(int) 1D sampled format:Unknown + 121: TypePointer UniformConstant 120 + 122(g_tTex1di4): 121(ptr) Variable UniformConstant + 123: TypeImage 45(int) 1D sampled format:Unknown + 124: TypePointer UniformConstant 123 + 125(g_tTex1du4): 124(ptr) Variable UniformConstant + 126: TypeImage 6(float) 3D sampled format:Unknown + 127: TypePointer UniformConstant 126 + 128(g_tTex3df4): 127(ptr) Variable UniformConstant + 129: TypeImage 28(int) 3D sampled format:Unknown + 130: TypePointer UniformConstant 129 + 131(g_tTex3di4): 130(ptr) Variable UniformConstant + 132: TypeImage 45(int) 3D sampled format:Unknown + 133: TypePointer UniformConstant 132 + 134(g_tTex3du4): 133(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +105(flattenTemp): 94(ptr) Variable Function + 106:8(PS_OUTPUT) FunctionCall 10(@main() + Store 105(flattenTemp) 106 + 109: 12(ptr) AccessChain 105(flattenTemp) 29 + 110: 7(fvec4) Load 109 + Store 108(@entryPointOutput.Color) 110 + 113: 100(ptr) AccessChain 105(flattenTemp) 99 + 114: 6(float) Load 113 + Store 112(@entryPointOutput.Depth) 114 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval20): 12(ptr) Variable Function + 33(txval21): 32(ptr) Variable Function + 48(txval22): 47(ptr) Variable Function + 60(txval40): 12(ptr) Variable Function + 71(txval41): 32(ptr) Variable Function + 81(txval42): 47(ptr) Variable Function + 95(psout): 94(ptr) Variable Function + 17: 14 Load 16(g_tTex2df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 30: 7(fvec4) ImageGather 23 27 29 + Store 13(txval20) 30 + 37: 34 Load 36(g_tTex2di4) + 38: 18 Load 20(g_sSamp) + 40: 39 SampledImage 37 38 + 44: 31(ivec4) ImageGather 40 43 29 + Store 33(txval21) 44 + 52: 49 Load 51(g_tTex2du4) + 53: 18 Load 20(g_sSamp) + 55: 54 SampledImage 52 53 + 59: 46(ivec4) ImageGather 55 58 29 + Store 48(txval22) 59 + 64: 61 Load 63(g_tTexcdf4) + 65: 18 Load 20(g_sSamp) + 67: 66 SampledImage 64 65 + 70: 7(fvec4) ImageGather 67 69 29 + Store 60(txval40) 70 + 75: 72 Load 74(g_tTexcdi4) + 76: 18 Load 20(g_sSamp) + 78: 77 SampledImage 75 76 + 80: 31(ivec4) ImageGather 78 79 29 + Store 71(txval41) 80 + 85: 82 Load 84(g_tTexcdu4) + 86: 18 Load 20(g_sSamp) + 88: 87 SampledImage 85 86 + 93: 46(ivec4) ImageGather 88 92 29 + Store 81(txval42) 93 + 98: 12(ptr) AccessChain 95(psout) 29 + Store 98 97 + 101: 100(ptr) AccessChain 95(psout) 99 + Store 101 96 + 102:8(PS_OUTPUT) Load 95(psout) + ReturnValue 102 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.gather.basic.dx10.vert.out b/deps/glslang/Test/baseResults/hlsl.gather.basic.dx10.vert.out new file mode 100644 index 00000000..fe561149 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.gather.basic.dx10.vert.out @@ -0,0 +1,411 @@ +hlsl.gather.basic.dx10.vert +Shader version: 500 +0:? Sequence +0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:28 Function Parameters: +0:? Sequence +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of float) +0:33 'txval20' ( temp 4-component vector of float) +0:33 textureGather ( temp 4-component vector of float) +0:33 Construct combined texture-sampler ( temp sampler2D) +0:33 'g_tTex2df4' ( uniform texture2D) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:34 Sequence +0:34 move second child to first child ( temp 4-component vector of int) +0:34 'txval21' ( temp 4-component vector of int) +0:34 textureGather ( temp 4-component vector of int) +0:34 Construct combined texture-sampler ( temp isampler2D) +0:34 'g_tTex2di4' ( uniform itexture2D) +0:34 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of uint) +0:35 'txval22' ( temp 4-component vector of uint) +0:35 textureGather ( temp 4-component vector of uint) +0:35 Construct combined texture-sampler ( temp usampler2D) +0:35 'g_tTex2du4' ( uniform utexture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 'txval40' ( temp 4-component vector of float) +0:39 textureGather ( temp 4-component vector of float) +0:39 Construct combined texture-sampler ( temp samplerCube) +0:39 'g_tTexcdf4' ( uniform textureCube) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of int) +0:40 'txval41' ( temp 4-component vector of int) +0:40 textureGather ( temp 4-component vector of int) +0:40 Construct combined texture-sampler ( temp isamplerCube) +0:40 'g_tTexcdi4' ( uniform itextureCube) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of uint) +0:41 'txval42' ( temp 4-component vector of uint) +0:41 textureGather ( temp 4-component vector of uint) +0:41 Construct combined texture-sampler ( temp usamplerCube) +0:41 'g_tTexcdu4' ( uniform utextureCube) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:43 move second child to first child ( temp 4-component vector of float) +0:43 Pos: direct index for structure ( temp 4-component vector of float) +0:43 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:43 Constant: +0:43 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:45 Branch: Return with expression +0:45 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:28 Pos: direct index for structure ( temp 4-component vector of float) +0:28 Function Call: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:28 Constant: +0:28 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_sSamp2d' ( uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:28 Function Parameters: +0:? Sequence +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of float) +0:33 'txval20' ( temp 4-component vector of float) +0:33 textureGather ( temp 4-component vector of float) +0:33 Construct combined texture-sampler ( temp sampler2D) +0:33 'g_tTex2df4' ( uniform texture2D) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:34 Sequence +0:34 move second child to first child ( temp 4-component vector of int) +0:34 'txval21' ( temp 4-component vector of int) +0:34 textureGather ( temp 4-component vector of int) +0:34 Construct combined texture-sampler ( temp isampler2D) +0:34 'g_tTex2di4' ( uniform itexture2D) +0:34 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of uint) +0:35 'txval22' ( temp 4-component vector of uint) +0:35 textureGather ( temp 4-component vector of uint) +0:35 Construct combined texture-sampler ( temp usampler2D) +0:35 'g_tTex2du4' ( uniform utexture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 'txval40' ( temp 4-component vector of float) +0:39 textureGather ( temp 4-component vector of float) +0:39 Construct combined texture-sampler ( temp samplerCube) +0:39 'g_tTexcdf4' ( uniform textureCube) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of int) +0:40 'txval41' ( temp 4-component vector of int) +0:40 textureGather ( temp 4-component vector of int) +0:40 Construct combined texture-sampler ( temp isamplerCube) +0:40 'g_tTexcdi4' ( uniform itextureCube) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of uint) +0:41 'txval42' ( temp 4-component vector of uint) +0:41 textureGather ( temp 4-component vector of uint) +0:41 Construct combined texture-sampler ( temp usamplerCube) +0:41 'g_tTexcdu4' ( uniform utextureCube) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:43 move second child to first child ( temp 4-component vector of float) +0:43 Pos: direct index for structure ( temp 4-component vector of float) +0:43 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:43 Constant: +0:43 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:45 Branch: Return with expression +0:45 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:28 Pos: direct index for structure ( temp 4-component vector of float) +0:28 Function Call: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:28 Constant: +0:28 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_sSamp2d' ( uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 126 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 103 + Source HLSL 500 + Name 4 "main" + Name 8 "VS_OUTPUT" + MemberName 8(VS_OUTPUT) 0 "Pos" + Name 10 "@main(" + Name 13 "txval20" + Name 16 "g_tTex2df4" + Name 20 "g_sSamp" + Name 33 "txval21" + Name 36 "g_tTex2di4" + Name 48 "txval22" + Name 51 "g_tTex2du4" + Name 60 "txval40" + Name 63 "g_tTexcdf4" + Name 71 "txval41" + Name 74 "g_tTexcdi4" + Name 81 "txval42" + Name 84 "g_tTexcdu4" + Name 95 "vsout" + Name 103 "@entryPointOutput.Pos" + Name 106 "g_sSamp2d" + Name 109 "g_tTex1df4a" + Name 110 "g_tTex1df4" + Name 113 "g_tTex1di4" + Name 116 "g_tTex1du4" + Name 119 "g_tTex3df4" + Name 122 "g_tTex3di4" + Name 125 "g_tTex3du4" + Decorate 16(g_tTex2df4) DescriptorSet 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 36(g_tTex2di4) DescriptorSet 0 + Decorate 51(g_tTex2du4) DescriptorSet 0 + Decorate 63(g_tTexcdf4) DescriptorSet 0 + Decorate 74(g_tTexcdi4) DescriptorSet 0 + Decorate 84(g_tTexcdu4) DescriptorSet 0 + Decorate 103(@entryPointOutput.Pos) BuiltIn Position + Decorate 106(g_sSamp2d) DescriptorSet 0 + Decorate 109(g_tTex1df4a) DescriptorSet 0 + Decorate 109(g_tTex1df4a) Binding 1 + Decorate 110(g_tTex1df4) DescriptorSet 0 + Decorate 110(g_tTex1df4) Binding 0 + Decorate 113(g_tTex1di4) DescriptorSet 0 + Decorate 116(g_tTex1du4) DescriptorSet 0 + Decorate 119(g_tTex3df4) DescriptorSet 0 + Decorate 122(g_tTex3di4) DescriptorSet 0 + Decorate 125(g_tTex3du4) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(VS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(VS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 2D sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex2df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 2 + 25: 6(float) Constant 1036831949 + 26: 6(float) Constant 1045220557 + 27: 24(fvec2) ConstantComposite 25 26 + 28: TypeInt 32 1 + 29: 28(int) Constant 0 + 31: TypeVector 28(int) 4 + 32: TypePointer Function 31(ivec4) + 34: TypeImage 28(int) 2D sampled format:Unknown + 35: TypePointer UniformConstant 34 + 36(g_tTex2di4): 35(ptr) Variable UniformConstant + 39: TypeSampledImage 34 + 41: 6(float) Constant 1050253722 + 42: 6(float) Constant 1053609165 + 43: 24(fvec2) ConstantComposite 41 42 + 45: TypeInt 32 0 + 46: TypeVector 45(int) 4 + 47: TypePointer Function 46(ivec4) + 49: TypeImage 45(int) 2D sampled format:Unknown + 50: TypePointer UniformConstant 49 + 51(g_tTex2du4): 50(ptr) Variable UniformConstant + 54: TypeSampledImage 49 + 56: 6(float) Constant 1056964608 + 57: 6(float) Constant 1058642330 + 58: 24(fvec2) ConstantComposite 56 57 + 61: TypeImage 6(float) Cube sampled format:Unknown + 62: TypePointer UniformConstant 61 + 63(g_tTexcdf4): 62(ptr) Variable UniformConstant + 66: TypeSampledImage 61 + 68: TypeVector 6(float) 3 + 69: 68(fvec3) ConstantComposite 25 26 41 + 72: TypeImage 28(int) Cube sampled format:Unknown + 73: TypePointer UniformConstant 72 + 74(g_tTexcdi4): 73(ptr) Variable UniformConstant + 77: TypeSampledImage 72 + 79: 68(fvec3) ConstantComposite 42 56 57 + 82: TypeImage 45(int) Cube sampled format:Unknown + 83: TypePointer UniformConstant 82 + 84(g_tTexcdu4): 83(ptr) Variable UniformConstant + 87: TypeSampledImage 82 + 89: 6(float) Constant 1060320051 + 90: 6(float) Constant 1061997773 + 91: 6(float) Constant 1063675494 + 92: 68(fvec3) ConstantComposite 89 90 91 + 94: TypePointer Function 8(VS_OUTPUT) + 96: 6(float) Constant 0 + 97: 7(fvec4) ConstantComposite 96 96 96 96 + 102: TypePointer Output 7(fvec4) +103(@entryPointOutput.Pos): 102(ptr) Variable Output + 106(g_sSamp2d): 19(ptr) Variable UniformConstant + 107: TypeImage 6(float) 1D sampled format:Unknown + 108: TypePointer UniformConstant 107 +109(g_tTex1df4a): 108(ptr) Variable UniformConstant + 110(g_tTex1df4): 108(ptr) Variable UniformConstant + 111: TypeImage 28(int) 1D sampled format:Unknown + 112: TypePointer UniformConstant 111 + 113(g_tTex1di4): 112(ptr) Variable UniformConstant + 114: TypeImage 45(int) 1D sampled format:Unknown + 115: TypePointer UniformConstant 114 + 116(g_tTex1du4): 115(ptr) Variable UniformConstant + 117: TypeImage 6(float) 3D sampled format:Unknown + 118: TypePointer UniformConstant 117 + 119(g_tTex3df4): 118(ptr) Variable UniformConstant + 120: TypeImage 28(int) 3D sampled format:Unknown + 121: TypePointer UniformConstant 120 + 122(g_tTex3di4): 121(ptr) Variable UniformConstant + 123: TypeImage 45(int) 3D sampled format:Unknown + 124: TypePointer UniformConstant 123 + 125(g_tTex3du4): 124(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 104:8(VS_OUTPUT) FunctionCall 10(@main() + 105: 7(fvec4) CompositeExtract 104 0 + Store 103(@entryPointOutput.Pos) 105 + Return + FunctionEnd + 10(@main():8(VS_OUTPUT) Function None 9 + 11: Label + 13(txval20): 12(ptr) Variable Function + 33(txval21): 32(ptr) Variable Function + 48(txval22): 47(ptr) Variable Function + 60(txval40): 12(ptr) Variable Function + 71(txval41): 32(ptr) Variable Function + 81(txval42): 47(ptr) Variable Function + 95(vsout): 94(ptr) Variable Function + 17: 14 Load 16(g_tTex2df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 30: 7(fvec4) ImageGather 23 27 29 + Store 13(txval20) 30 + 37: 34 Load 36(g_tTex2di4) + 38: 18 Load 20(g_sSamp) + 40: 39 SampledImage 37 38 + 44: 31(ivec4) ImageGather 40 43 29 + Store 33(txval21) 44 + 52: 49 Load 51(g_tTex2du4) + 53: 18 Load 20(g_sSamp) + 55: 54 SampledImage 52 53 + 59: 46(ivec4) ImageGather 55 58 29 + Store 48(txval22) 59 + 64: 61 Load 63(g_tTexcdf4) + 65: 18 Load 20(g_sSamp) + 67: 66 SampledImage 64 65 + 70: 7(fvec4) ImageGather 67 69 29 + Store 60(txval40) 70 + 75: 72 Load 74(g_tTexcdi4) + 76: 18 Load 20(g_sSamp) + 78: 77 SampledImage 75 76 + 80: 31(ivec4) ImageGather 78 79 29 + Store 71(txval41) 80 + 85: 82 Load 84(g_tTexcdu4) + 86: 18 Load 20(g_sSamp) + 88: 87 SampledImage 85 86 + 93: 46(ivec4) ImageGather 88 92 29 + Store 81(txval42) 93 + 98: 12(ptr) AccessChain 95(vsout) 29 + Store 98 97 + 99:8(VS_OUTPUT) Load 95(vsout) + ReturnValue 99 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.gather.offset.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.gather.offset.dx10.frag.out new file mode 100644 index 00000000..ae816ddd --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.gather.offset.dx10.frag.out @@ -0,0 +1,388 @@ +hlsl.gather.offset.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Parameters: +0:? Sequence +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of float) +0:33 'txval20' ( temp 4-component vector of float) +0:33 textureGatherOffset ( temp 4-component vector of float) +0:33 Construct combined texture-sampler ( temp sampler2D) +0:33 'g_tTex2df4' ( uniform texture2D) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:34 Sequence +0:34 move second child to first child ( temp 4-component vector of int) +0:34 'txval21' ( temp 4-component vector of int) +0:34 textureGatherOffset ( temp 4-component vector of int) +0:34 Construct combined texture-sampler ( temp isampler2D) +0:34 'g_tTex2di4' ( uniform itexture2D) +0:34 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of uint) +0:35 'txval22' ( temp 4-component vector of uint) +0:35 textureGatherOffset ( temp 4-component vector of uint) +0:35 Construct combined texture-sampler ( temp usampler2D) +0:35 'g_tTex2du4' ( uniform utexture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 1 (const int) +0:? -1 (const int) +0:40 move second child to first child ( temp 4-component vector of float) +0:40 Color: direct index for structure ( temp 4-component vector of float) +0:40 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1.000000 +0:40 1.000000 +0:40 1.000000 +0:40 1.000000 +0:41 move second child to first child ( temp float) +0:41 Depth: direct index for structure ( temp float) +0:41 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:41 Constant: +0:41 1 (const int) +0:41 Constant: +0:41 1.000000 +0:43 Branch: Return with expression +0:43 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:28 Color: direct index for structure ( temp 4-component vector of float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 0 (const int) +0:28 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:28 Depth: direct index for structure ( temp float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Parameters: +0:? Sequence +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of float) +0:33 'txval20' ( temp 4-component vector of float) +0:33 textureGatherOffset ( temp 4-component vector of float) +0:33 Construct combined texture-sampler ( temp sampler2D) +0:33 'g_tTex2df4' ( uniform texture2D) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:34 Sequence +0:34 move second child to first child ( temp 4-component vector of int) +0:34 'txval21' ( temp 4-component vector of int) +0:34 textureGatherOffset ( temp 4-component vector of int) +0:34 Construct combined texture-sampler ( temp isampler2D) +0:34 'g_tTex2di4' ( uniform itexture2D) +0:34 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of uint) +0:35 'txval22' ( temp 4-component vector of uint) +0:35 textureGatherOffset ( temp 4-component vector of uint) +0:35 Construct combined texture-sampler ( temp usampler2D) +0:35 'g_tTex2du4' ( uniform utexture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 1 (const int) +0:? -1 (const int) +0:40 move second child to first child ( temp 4-component vector of float) +0:40 Color: direct index for structure ( temp 4-component vector of float) +0:40 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1.000000 +0:40 1.000000 +0:40 1.000000 +0:40 1.000000 +0:41 move second child to first child ( temp float) +0:41 Depth: direct index for structure ( temp float) +0:41 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:41 Constant: +0:41 1 (const int) +0:41 Constant: +0:41 1.000000 +0:43 Branch: Return with expression +0:43 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:28 Color: direct index for structure ( temp 4-component vector of float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 0 (const int) +0:28 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:28 Depth: direct index for structure ( temp float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 114 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 79 83 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval20" + Name 16 "g_tTex2df4" + Name 20 "g_sSamp" + Name 36 "txval21" + Name 39 "g_tTex2di4" + Name 52 "txval22" + Name 55 "g_tTex2du4" + Name 67 "psout" + Name 76 "flattenTemp" + Name 79 "@entryPointOutput.Color" + Name 83 "@entryPointOutput.Depth" + Name 88 "g_tTex1df4a" + Name 89 "g_tTex1df4" + Name 92 "g_tTex1di4" + Name 95 "g_tTex1du4" + Name 98 "g_tTex3df4" + Name 101 "g_tTex3di4" + Name 104 "g_tTex3du4" + Name 107 "g_tTexcdf4" + Name 110 "g_tTexcdi4" + Name 113 "g_tTexcdu4" + Decorate 16(g_tTex2df4) DescriptorSet 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 39(g_tTex2di4) DescriptorSet 0 + Decorate 55(g_tTex2du4) DescriptorSet 0 + Decorate 79(@entryPointOutput.Color) Location 0 + Decorate 83(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 88(g_tTex1df4a) DescriptorSet 0 + Decorate 88(g_tTex1df4a) Binding 1 + Decorate 89(g_tTex1df4) DescriptorSet 0 + Decorate 89(g_tTex1df4) Binding 0 + Decorate 92(g_tTex1di4) DescriptorSet 0 + Decorate 95(g_tTex1du4) DescriptorSet 0 + Decorate 98(g_tTex3df4) DescriptorSet 0 + Decorate 101(g_tTex3di4) DescriptorSet 0 + Decorate 104(g_tTex3du4) DescriptorSet 0 + Decorate 107(g_tTexcdf4) DescriptorSet 0 + Decorate 110(g_tTexcdi4) DescriptorSet 0 + Decorate 113(g_tTexcdu4) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 2D sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex2df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 2 + 25: 6(float) Constant 1036831949 + 26: 6(float) Constant 1045220557 + 27: 24(fvec2) ConstantComposite 25 26 + 28: TypeInt 32 1 + 29: TypeVector 28(int) 2 + 30: 28(int) Constant 1 + 31: 28(int) Constant 0 + 32: 29(ivec2) ConstantComposite 30 31 + 34: TypeVector 28(int) 4 + 35: TypePointer Function 34(ivec4) + 37: TypeImage 28(int) 2D sampled format:Unknown + 38: TypePointer UniformConstant 37 + 39(g_tTex2di4): 38(ptr) Variable UniformConstant + 42: TypeSampledImage 37 + 44: 6(float) Constant 1050253722 + 45: 6(float) Constant 1053609165 + 46: 24(fvec2) ConstantComposite 44 45 + 47: 29(ivec2) ConstantComposite 30 30 + 49: TypeInt 32 0 + 50: TypeVector 49(int) 4 + 51: TypePointer Function 50(ivec4) + 53: TypeImage 49(int) 2D sampled format:Unknown + 54: TypePointer UniformConstant 53 + 55(g_tTex2du4): 54(ptr) Variable UniformConstant + 58: TypeSampledImage 53 + 60: 6(float) Constant 1056964608 + 61: 6(float) Constant 1058642330 + 62: 24(fvec2) ConstantComposite 60 61 + 63: 28(int) Constant 4294967295 + 64: 29(ivec2) ConstantComposite 30 63 + 66: TypePointer Function 8(PS_OUTPUT) + 68: 6(float) Constant 1065353216 + 69: 7(fvec4) ConstantComposite 68 68 68 68 + 71: TypePointer Function 6(float) + 78: TypePointer Output 7(fvec4) +79(@entryPointOutput.Color): 78(ptr) Variable Output + 82: TypePointer Output 6(float) +83(@entryPointOutput.Depth): 82(ptr) Variable Output + 86: TypeImage 6(float) 1D sampled format:Unknown + 87: TypePointer UniformConstant 86 + 88(g_tTex1df4a): 87(ptr) Variable UniformConstant + 89(g_tTex1df4): 87(ptr) Variable UniformConstant + 90: TypeImage 28(int) 1D sampled format:Unknown + 91: TypePointer UniformConstant 90 + 92(g_tTex1di4): 91(ptr) Variable UniformConstant + 93: TypeImage 49(int) 1D sampled format:Unknown + 94: TypePointer UniformConstant 93 + 95(g_tTex1du4): 94(ptr) Variable UniformConstant + 96: TypeImage 6(float) 3D sampled format:Unknown + 97: TypePointer UniformConstant 96 + 98(g_tTex3df4): 97(ptr) Variable UniformConstant + 99: TypeImage 28(int) 3D sampled format:Unknown + 100: TypePointer UniformConstant 99 + 101(g_tTex3di4): 100(ptr) Variable UniformConstant + 102: TypeImage 49(int) 3D sampled format:Unknown + 103: TypePointer UniformConstant 102 + 104(g_tTex3du4): 103(ptr) Variable UniformConstant + 105: TypeImage 6(float) Cube sampled format:Unknown + 106: TypePointer UniformConstant 105 + 107(g_tTexcdf4): 106(ptr) Variable UniformConstant + 108: TypeImage 28(int) Cube sampled format:Unknown + 109: TypePointer UniformConstant 108 + 110(g_tTexcdi4): 109(ptr) Variable UniformConstant + 111: TypeImage 49(int) Cube sampled format:Unknown + 112: TypePointer UniformConstant 111 + 113(g_tTexcdu4): 112(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 76(flattenTemp): 66(ptr) Variable Function + 77:8(PS_OUTPUT) FunctionCall 10(@main() + Store 76(flattenTemp) 77 + 80: 12(ptr) AccessChain 76(flattenTemp) 31 + 81: 7(fvec4) Load 80 + Store 79(@entryPointOutput.Color) 81 + 84: 71(ptr) AccessChain 76(flattenTemp) 30 + 85: 6(float) Load 84 + Store 83(@entryPointOutput.Depth) 85 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval20): 12(ptr) Variable Function + 36(txval21): 35(ptr) Variable Function + 52(txval22): 51(ptr) Variable Function + 67(psout): 66(ptr) Variable Function + 17: 14 Load 16(g_tTex2df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 33: 7(fvec4) ImageGather 23 27 31 ConstOffset 32 + Store 13(txval20) 33 + 40: 37 Load 39(g_tTex2di4) + 41: 18 Load 20(g_sSamp) + 43: 42 SampledImage 40 41 + 48: 34(ivec4) ImageGather 43 46 31 ConstOffset 47 + Store 36(txval21) 48 + 56: 53 Load 55(g_tTex2du4) + 57: 18 Load 20(g_sSamp) + 59: 58 SampledImage 56 57 + 65: 50(ivec4) ImageGather 59 62 31 ConstOffset 64 + Store 52(txval22) 65 + 70: 12(ptr) AccessChain 67(psout) 31 + Store 70 69 + 72: 71(ptr) AccessChain 67(psout) 30 + Store 72 68 + 73:8(PS_OUTPUT) Load 67(psout) + ReturnValue 73 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.gather.offsetarray.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.gather.offsetarray.dx10.frag.out new file mode 100644 index 00000000..88052321 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.gather.offsetarray.dx10.frag.out @@ -0,0 +1,353 @@ +hlsl.gather.offsetarray.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:20 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Parameters: +0:? Sequence +0:25 Sequence +0:25 move second child to first child ( temp 4-component vector of float) +0:25 'txval20' ( temp 4-component vector of float) +0:25 textureGatherOffset ( temp 4-component vector of float) +0:25 Construct combined texture-sampler ( temp sampler2DArray) +0:25 'g_tTex2df4' ( uniform texture2DArray) +0:25 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:26 Sequence +0:26 move second child to first child ( temp 4-component vector of int) +0:26 'txval21' ( temp 4-component vector of int) +0:26 textureGatherOffset ( temp 4-component vector of int) +0:26 Construct combined texture-sampler ( temp isampler2DArray) +0:26 'g_tTex2di4' ( uniform itexture2DArray) +0:26 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? 0.400000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of uint) +0:27 'txval22' ( temp 4-component vector of uint) +0:27 textureGatherOffset ( temp 4-component vector of uint) +0:27 Construct combined texture-sampler ( temp usampler2DArray) +0:27 'g_tTex2du4' ( uniform utexture2DArray) +0:27 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:? Constant: +0:? 1 (const int) +0:? -1 (const int) +0:32 move second child to first child ( temp 4-component vector of float) +0:32 Color: direct index for structure ( temp 4-component vector of float) +0:32 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:33 move second child to first child ( temp float) +0:33 Depth: direct index for structure ( temp float) +0:33 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 1.000000 +0:35 Branch: Return with expression +0:35 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 Sequence +0:20 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:20 Color: direct index for structure ( temp 4-component vector of float) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Constant: +0:20 0 (const int) +0:20 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:20 Depth: direct index for structure ( temp float) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Constant: +0:20 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4' ( uniform itexture1DArray) +0:? 'g_tTex1du4' ( uniform utexture1DArray) +0:? 'g_tTex2df4' ( uniform texture2DArray) +0:? 'g_tTex2di4' ( uniform itexture2DArray) +0:? 'g_tTex2du4' ( uniform utexture2DArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:20 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Parameters: +0:? Sequence +0:25 Sequence +0:25 move second child to first child ( temp 4-component vector of float) +0:25 'txval20' ( temp 4-component vector of float) +0:25 textureGatherOffset ( temp 4-component vector of float) +0:25 Construct combined texture-sampler ( temp sampler2DArray) +0:25 'g_tTex2df4' ( uniform texture2DArray) +0:25 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:26 Sequence +0:26 move second child to first child ( temp 4-component vector of int) +0:26 'txval21' ( temp 4-component vector of int) +0:26 textureGatherOffset ( temp 4-component vector of int) +0:26 Construct combined texture-sampler ( temp isampler2DArray) +0:26 'g_tTex2di4' ( uniform itexture2DArray) +0:26 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? 0.400000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of uint) +0:27 'txval22' ( temp 4-component vector of uint) +0:27 textureGatherOffset ( temp 4-component vector of uint) +0:27 Construct combined texture-sampler ( temp usampler2DArray) +0:27 'g_tTex2du4' ( uniform utexture2DArray) +0:27 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:? Constant: +0:? 1 (const int) +0:? -1 (const int) +0:32 move second child to first child ( temp 4-component vector of float) +0:32 Color: direct index for structure ( temp 4-component vector of float) +0:32 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:33 move second child to first child ( temp float) +0:33 Depth: direct index for structure ( temp float) +0:33 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 1.000000 +0:35 Branch: Return with expression +0:35 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 Sequence +0:20 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:20 Color: direct index for structure ( temp 4-component vector of float) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Constant: +0:20 0 (const int) +0:20 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:20 Depth: direct index for structure ( temp float) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Constant: +0:20 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4' ( uniform itexture1DArray) +0:? 'g_tTex1du4' ( uniform utexture1DArray) +0:? 'g_tTex2df4' ( uniform texture2DArray) +0:? 'g_tTex2di4' ( uniform itexture2DArray) +0:? 'g_tTex2du4' ( uniform utexture2DArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 97 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 80 84 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval20" + Name 16 "g_tTex2df4" + Name 20 "g_sSamp" + Name 37 "txval21" + Name 40 "g_tTex2di4" + Name 52 "txval22" + Name 55 "g_tTex2du4" + Name 68 "psout" + Name 77 "flattenTemp" + Name 80 "@entryPointOutput.Color" + Name 84 "@entryPointOutput.Depth" + Name 89 "g_tTex1df4a" + Name 90 "g_tTex1df4" + Name 93 "g_tTex1di4" + Name 96 "g_tTex1du4" + Decorate 16(g_tTex2df4) DescriptorSet 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 40(g_tTex2di4) DescriptorSet 0 + Decorate 55(g_tTex2du4) DescriptorSet 0 + Decorate 80(@entryPointOutput.Color) Location 0 + Decorate 84(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 89(g_tTex1df4a) DescriptorSet 0 + Decorate 89(g_tTex1df4a) Binding 1 + Decorate 90(g_tTex1df4) DescriptorSet 0 + Decorate 90(g_tTex1df4) Binding 0 + Decorate 93(g_tTex1di4) DescriptorSet 0 + Decorate 96(g_tTex1du4) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 2D array sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex2df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 3 + 25: 6(float) Constant 1036831949 + 26: 6(float) Constant 1045220557 + 27: 6(float) Constant 1050253722 + 28: 24(fvec3) ConstantComposite 25 26 27 + 29: TypeInt 32 1 + 30: TypeVector 29(int) 2 + 31: 29(int) Constant 1 + 32: 29(int) Constant 0 + 33: 30(ivec2) ConstantComposite 31 32 + 35: TypeVector 29(int) 4 + 36: TypePointer Function 35(ivec4) + 38: TypeImage 29(int) 2D array sampled format:Unknown + 39: TypePointer UniformConstant 38 + 40(g_tTex2di4): 39(ptr) Variable UniformConstant + 43: TypeSampledImage 38 + 45: 6(float) Constant 1053609165 + 46: 24(fvec3) ConstantComposite 27 45 45 + 47: 30(ivec2) ConstantComposite 31 31 + 49: TypeInt 32 0 + 50: TypeVector 49(int) 4 + 51: TypePointer Function 50(ivec4) + 53: TypeImage 49(int) 2D array sampled format:Unknown + 54: TypePointer UniformConstant 53 + 55(g_tTex2du4): 54(ptr) Variable UniformConstant + 58: TypeSampledImage 53 + 60: 6(float) Constant 1056964608 + 61: 6(float) Constant 1058642330 + 62: 6(float) Constant 1060320051 + 63: 24(fvec3) ConstantComposite 60 61 62 + 64: 29(int) Constant 4294967295 + 65: 30(ivec2) ConstantComposite 31 64 + 67: TypePointer Function 8(PS_OUTPUT) + 69: 6(float) Constant 1065353216 + 70: 7(fvec4) ConstantComposite 69 69 69 69 + 72: TypePointer Function 6(float) + 79: TypePointer Output 7(fvec4) +80(@entryPointOutput.Color): 79(ptr) Variable Output + 83: TypePointer Output 6(float) +84(@entryPointOutput.Depth): 83(ptr) Variable Output + 87: TypeImage 6(float) 1D array sampled format:Unknown + 88: TypePointer UniformConstant 87 + 89(g_tTex1df4a): 88(ptr) Variable UniformConstant + 90(g_tTex1df4): 88(ptr) Variable UniformConstant + 91: TypeImage 29(int) 1D array sampled format:Unknown + 92: TypePointer UniformConstant 91 + 93(g_tTex1di4): 92(ptr) Variable UniformConstant + 94: TypeImage 49(int) 1D array sampled format:Unknown + 95: TypePointer UniformConstant 94 + 96(g_tTex1du4): 95(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 77(flattenTemp): 67(ptr) Variable Function + 78:8(PS_OUTPUT) FunctionCall 10(@main() + Store 77(flattenTemp) 78 + 81: 12(ptr) AccessChain 77(flattenTemp) 32 + 82: 7(fvec4) Load 81 + Store 80(@entryPointOutput.Color) 82 + 85: 72(ptr) AccessChain 77(flattenTemp) 31 + 86: 6(float) Load 85 + Store 84(@entryPointOutput.Depth) 86 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval20): 12(ptr) Variable Function + 37(txval21): 36(ptr) Variable Function + 52(txval22): 51(ptr) Variable Function + 68(psout): 67(ptr) Variable Function + 17: 14 Load 16(g_tTex2df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 34: 7(fvec4) ImageGather 23 28 32 ConstOffset 33 + Store 13(txval20) 34 + 41: 38 Load 40(g_tTex2di4) + 42: 18 Load 20(g_sSamp) + 44: 43 SampledImage 41 42 + 48: 35(ivec4) ImageGather 44 46 32 ConstOffset 47 + Store 37(txval21) 48 + 56: 53 Load 55(g_tTex2du4) + 57: 18 Load 20(g_sSamp) + 59: 58 SampledImage 56 57 + 66: 50(ivec4) ImageGather 59 63 32 ConstOffset 65 + Store 52(txval22) 66 + 71: 12(ptr) AccessChain 68(psout) 32 + Store 71 70 + 73: 72(ptr) AccessChain 68(psout) 31 + Store 73 69 + 74:8(PS_OUTPUT) Load 68(psout) + ReturnValue 74 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out new file mode 100644 index 00000000..35b0a003 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out @@ -0,0 +1,1119 @@ +hlsl.gatherRGBA.array.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Parameters: +0:? Sequence +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of float) +0:33 'txval00' ( temp 4-component vector of float) +0:33 textureGather ( temp 4-component vector of float) +0:33 Construct combined texture-sampler ( temp sampler2DArray) +0:33 'g_tTex2df4a' ( uniform texture2DArray) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:33 c3: direct index for structure ( uniform 3-component vector of float) +0:33 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:33 Constant: +0:33 2 (const uint) +0:33 Constant: +0:33 0 (const int) +0:34 Sequence +0:34 move second child to first child ( temp 4-component vector of int) +0:34 'txval01' ( temp 4-component vector of int) +0:34 textureGather ( temp 4-component vector of int) +0:34 Construct combined texture-sampler ( temp isampler2DArray) +0:34 'g_tTex2di4a' ( uniform itexture2DArray) +0:34 'g_sSamp' (layout( binding=0) uniform sampler) +0:34 c3: direct index for structure ( uniform 3-component vector of float) +0:34 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:34 Constant: +0:34 2 (const uint) +0:34 Constant: +0:34 0 (const int) +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of uint) +0:35 'txval02' ( temp 4-component vector of uint) +0:35 textureGather ( temp 4-component vector of uint) +0:35 Construct combined texture-sampler ( temp usampler2DArray) +0:35 'g_tTex2du4a' ( uniform utexture2DArray) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:35 c3: direct index for structure ( uniform 3-component vector of float) +0:35 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:35 Constant: +0:35 2 (const uint) +0:35 Constant: +0:35 0 (const int) +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of float) +0:37 'txval10' ( temp 4-component vector of float) +0:37 textureGather ( temp 4-component vector of float) +0:37 Construct combined texture-sampler ( temp sampler2DArray) +0:37 'g_tTex2df4a' ( uniform texture2DArray) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:37 c3: direct index for structure ( uniform 3-component vector of float) +0:37 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:37 Constant: +0:37 2 (const uint) +0:37 Constant: +0:37 1 (const int) +0:38 Sequence +0:38 move second child to first child ( temp 4-component vector of int) +0:38 'txval11' ( temp 4-component vector of int) +0:38 textureGather ( temp 4-component vector of int) +0:38 Construct combined texture-sampler ( temp isampler2DArray) +0:38 'g_tTex2di4a' ( uniform itexture2DArray) +0:38 'g_sSamp' (layout( binding=0) uniform sampler) +0:38 c3: direct index for structure ( uniform 3-component vector of float) +0:38 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:38 Constant: +0:38 2 (const uint) +0:38 Constant: +0:38 1 (const int) +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of uint) +0:39 'txval12' ( temp 4-component vector of uint) +0:39 textureGather ( temp 4-component vector of uint) +0:39 Construct combined texture-sampler ( temp usampler2DArray) +0:39 'g_tTex2du4a' ( uniform utexture2DArray) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:39 c3: direct index for structure ( uniform 3-component vector of float) +0:39 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:39 Constant: +0:39 2 (const uint) +0:39 Constant: +0:39 1 (const int) +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of float) +0:41 'txval20' ( temp 4-component vector of float) +0:41 textureGather ( temp 4-component vector of float) +0:41 Construct combined texture-sampler ( temp sampler2DArray) +0:41 'g_tTex2df4a' ( uniform texture2DArray) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:41 c3: direct index for structure ( uniform 3-component vector of float) +0:41 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:41 Constant: +0:41 2 (const uint) +0:41 Constant: +0:41 2 (const int) +0:42 Sequence +0:42 move second child to first child ( temp 4-component vector of int) +0:42 'txval21' ( temp 4-component vector of int) +0:42 textureGather ( temp 4-component vector of int) +0:42 Construct combined texture-sampler ( temp isampler2DArray) +0:42 'g_tTex2di4a' ( uniform itexture2DArray) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:42 c3: direct index for structure ( uniform 3-component vector of float) +0:42 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:42 Constant: +0:42 2 (const uint) +0:42 Constant: +0:42 2 (const int) +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of uint) +0:43 'txval22' ( temp 4-component vector of uint) +0:43 textureGather ( temp 4-component vector of uint) +0:43 Construct combined texture-sampler ( temp usampler2DArray) +0:43 'g_tTex2du4a' ( uniform utexture2DArray) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:43 c3: direct index for structure ( uniform 3-component vector of float) +0:43 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:43 Constant: +0:43 2 (const uint) +0:43 Constant: +0:43 2 (const int) +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of float) +0:45 'txval30' ( temp 4-component vector of float) +0:45 textureGather ( temp 4-component vector of float) +0:45 Construct combined texture-sampler ( temp sampler2DArray) +0:45 'g_tTex2df4a' ( uniform texture2DArray) +0:45 'g_sSamp' (layout( binding=0) uniform sampler) +0:45 c3: direct index for structure ( uniform 3-component vector of float) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:45 Constant: +0:45 2 (const uint) +0:45 Constant: +0:45 3 (const int) +0:46 Sequence +0:46 move second child to first child ( temp 4-component vector of int) +0:46 'txval31' ( temp 4-component vector of int) +0:46 textureGather ( temp 4-component vector of int) +0:46 Construct combined texture-sampler ( temp isampler2DArray) +0:46 'g_tTex2di4a' ( uniform itexture2DArray) +0:46 'g_sSamp' (layout( binding=0) uniform sampler) +0:46 c3: direct index for structure ( uniform 3-component vector of float) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:46 Constant: +0:46 2 (const uint) +0:46 Constant: +0:46 3 (const int) +0:47 Sequence +0:47 move second child to first child ( temp 4-component vector of uint) +0:47 'txval32' ( temp 4-component vector of uint) +0:47 textureGather ( temp 4-component vector of uint) +0:47 Construct combined texture-sampler ( temp usampler2DArray) +0:47 'g_tTex2du4a' ( uniform utexture2DArray) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 c3: direct index for structure ( uniform 3-component vector of float) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:47 Constant: +0:47 2 (const uint) +0:47 Constant: +0:47 3 (const int) +0:51 Sequence +0:51 move second child to first child ( temp 4-component vector of float) +0:51 'txval40' ( temp 4-component vector of float) +0:51 textureGather ( temp 4-component vector of float) +0:51 Construct combined texture-sampler ( temp samplerCubeArray) +0:51 'g_tTexcdf4a' ( uniform textureCubeArray) +0:51 'g_sSamp' (layout( binding=0) uniform sampler) +0:51 c4: direct index for structure ( uniform 4-component vector of float) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:51 Constant: +0:51 3 (const uint) +0:51 Constant: +0:51 0 (const int) +0:52 Sequence +0:52 move second child to first child ( temp 4-component vector of int) +0:52 'txval41' ( temp 4-component vector of int) +0:52 textureGather ( temp 4-component vector of int) +0:52 Construct combined texture-sampler ( temp isamplerCubeArray) +0:52 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:52 'g_sSamp' (layout( binding=0) uniform sampler) +0:52 c4: direct index for structure ( uniform 4-component vector of float) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:52 Constant: +0:52 3 (const uint) +0:52 Constant: +0:52 0 (const int) +0:53 Sequence +0:53 move second child to first child ( temp 4-component vector of uint) +0:53 'txval42' ( temp 4-component vector of uint) +0:53 textureGather ( temp 4-component vector of uint) +0:53 Construct combined texture-sampler ( temp usamplerCubeArray) +0:53 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:53 'g_sSamp' (layout( binding=0) uniform sampler) +0:53 c4: direct index for structure ( uniform 4-component vector of float) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:53 Constant: +0:53 3 (const uint) +0:53 Constant: +0:53 0 (const int) +0:55 Sequence +0:55 move second child to first child ( temp 4-component vector of float) +0:55 'txval50' ( temp 4-component vector of float) +0:55 textureGather ( temp 4-component vector of float) +0:55 Construct combined texture-sampler ( temp samplerCubeArray) +0:55 'g_tTexcdf4a' ( uniform textureCubeArray) +0:55 'g_sSamp' (layout( binding=0) uniform sampler) +0:55 c4: direct index for structure ( uniform 4-component vector of float) +0:55 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:55 Constant: +0:55 3 (const uint) +0:55 Constant: +0:55 1 (const int) +0:56 Sequence +0:56 move second child to first child ( temp 4-component vector of int) +0:56 'txval51' ( temp 4-component vector of int) +0:56 textureGather ( temp 4-component vector of int) +0:56 Construct combined texture-sampler ( temp isamplerCubeArray) +0:56 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:56 'g_sSamp' (layout( binding=0) uniform sampler) +0:56 c4: direct index for structure ( uniform 4-component vector of float) +0:56 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:56 Constant: +0:56 3 (const uint) +0:56 Constant: +0:56 1 (const int) +0:57 Sequence +0:57 move second child to first child ( temp 4-component vector of uint) +0:57 'txval52' ( temp 4-component vector of uint) +0:57 textureGather ( temp 4-component vector of uint) +0:57 Construct combined texture-sampler ( temp usamplerCubeArray) +0:57 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:57 'g_sSamp' (layout( binding=0) uniform sampler) +0:57 c4: direct index for structure ( uniform 4-component vector of float) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:57 Constant: +0:57 3 (const uint) +0:57 Constant: +0:57 1 (const int) +0:59 Sequence +0:59 move second child to first child ( temp 4-component vector of float) +0:59 'txval60' ( temp 4-component vector of float) +0:59 textureGather ( temp 4-component vector of float) +0:59 Construct combined texture-sampler ( temp samplerCubeArray) +0:59 'g_tTexcdf4a' ( uniform textureCubeArray) +0:59 'g_sSamp' (layout( binding=0) uniform sampler) +0:59 c4: direct index for structure ( uniform 4-component vector of float) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:59 Constant: +0:59 3 (const uint) +0:59 Constant: +0:59 2 (const int) +0:60 Sequence +0:60 move second child to first child ( temp 4-component vector of int) +0:60 'txval61' ( temp 4-component vector of int) +0:60 textureGather ( temp 4-component vector of int) +0:60 Construct combined texture-sampler ( temp isamplerCubeArray) +0:60 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:60 'g_sSamp' (layout( binding=0) uniform sampler) +0:60 c4: direct index for structure ( uniform 4-component vector of float) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:60 Constant: +0:60 3 (const uint) +0:60 Constant: +0:60 2 (const int) +0:61 Sequence +0:61 move second child to first child ( temp 4-component vector of uint) +0:61 'txval62' ( temp 4-component vector of uint) +0:61 textureGather ( temp 4-component vector of uint) +0:61 Construct combined texture-sampler ( temp usamplerCubeArray) +0:61 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:61 'g_sSamp' (layout( binding=0) uniform sampler) +0:61 c4: direct index for structure ( uniform 4-component vector of float) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:61 Constant: +0:61 3 (const uint) +0:61 Constant: +0:61 2 (const int) +0:63 Sequence +0:63 move second child to first child ( temp 4-component vector of float) +0:63 'txval70' ( temp 4-component vector of float) +0:63 textureGather ( temp 4-component vector of float) +0:63 Construct combined texture-sampler ( temp samplerCubeArray) +0:63 'g_tTexcdf4a' ( uniform textureCubeArray) +0:63 'g_sSamp' (layout( binding=0) uniform sampler) +0:63 c4: direct index for structure ( uniform 4-component vector of float) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:63 Constant: +0:63 3 (const uint) +0:63 Constant: +0:63 3 (const int) +0:64 Sequence +0:64 move second child to first child ( temp 4-component vector of int) +0:64 'txval71' ( temp 4-component vector of int) +0:64 textureGather ( temp 4-component vector of int) +0:64 Construct combined texture-sampler ( temp isamplerCubeArray) +0:64 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:64 'g_sSamp' (layout( binding=0) uniform sampler) +0:64 c4: direct index for structure ( uniform 4-component vector of float) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:64 Constant: +0:64 3 (const uint) +0:64 Constant: +0:64 3 (const int) +0:65 Sequence +0:65 move second child to first child ( temp 4-component vector of uint) +0:65 'txval72' ( temp 4-component vector of uint) +0:65 textureGather ( temp 4-component vector of uint) +0:65 Construct combined texture-sampler ( temp usamplerCubeArray) +0:65 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:65 'g_sSamp' (layout( binding=0) uniform sampler) +0:65 c4: direct index for structure ( uniform 4-component vector of float) +0:65 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:65 Constant: +0:65 3 (const uint) +0:65 Constant: +0:65 3 (const int) +0:67 move second child to first child ( temp 4-component vector of float) +0:67 Color: direct index for structure ( temp 4-component vector of float) +0:67 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 1.000000 +0:67 1.000000 +0:67 1.000000 +0:67 1.000000 +0:68 move second child to first child ( temp float) +0:68 Depth: direct index for structure ( temp float) +0:68 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:68 Constant: +0:68 1 (const int) +0:68 Constant: +0:68 1.000000 +0:70 Branch: Return with expression +0:70 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:28 Color: direct index for structure ( temp 4-component vector of float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 0 (const int) +0:28 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:28 Depth: direct index for structure ( temp float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_sSamp2d' ( uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Parameters: +0:? Sequence +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of float) +0:33 'txval00' ( temp 4-component vector of float) +0:33 textureGather ( temp 4-component vector of float) +0:33 Construct combined texture-sampler ( temp sampler2DArray) +0:33 'g_tTex2df4a' ( uniform texture2DArray) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:33 c3: direct index for structure ( uniform 3-component vector of float) +0:33 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:33 Constant: +0:33 2 (const uint) +0:33 Constant: +0:33 0 (const int) +0:34 Sequence +0:34 move second child to first child ( temp 4-component vector of int) +0:34 'txval01' ( temp 4-component vector of int) +0:34 textureGather ( temp 4-component vector of int) +0:34 Construct combined texture-sampler ( temp isampler2DArray) +0:34 'g_tTex2di4a' ( uniform itexture2DArray) +0:34 'g_sSamp' (layout( binding=0) uniform sampler) +0:34 c3: direct index for structure ( uniform 3-component vector of float) +0:34 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:34 Constant: +0:34 2 (const uint) +0:34 Constant: +0:34 0 (const int) +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of uint) +0:35 'txval02' ( temp 4-component vector of uint) +0:35 textureGather ( temp 4-component vector of uint) +0:35 Construct combined texture-sampler ( temp usampler2DArray) +0:35 'g_tTex2du4a' ( uniform utexture2DArray) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:35 c3: direct index for structure ( uniform 3-component vector of float) +0:35 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:35 Constant: +0:35 2 (const uint) +0:35 Constant: +0:35 0 (const int) +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of float) +0:37 'txval10' ( temp 4-component vector of float) +0:37 textureGather ( temp 4-component vector of float) +0:37 Construct combined texture-sampler ( temp sampler2DArray) +0:37 'g_tTex2df4a' ( uniform texture2DArray) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:37 c3: direct index for structure ( uniform 3-component vector of float) +0:37 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:37 Constant: +0:37 2 (const uint) +0:37 Constant: +0:37 1 (const int) +0:38 Sequence +0:38 move second child to first child ( temp 4-component vector of int) +0:38 'txval11' ( temp 4-component vector of int) +0:38 textureGather ( temp 4-component vector of int) +0:38 Construct combined texture-sampler ( temp isampler2DArray) +0:38 'g_tTex2di4a' ( uniform itexture2DArray) +0:38 'g_sSamp' (layout( binding=0) uniform sampler) +0:38 c3: direct index for structure ( uniform 3-component vector of float) +0:38 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:38 Constant: +0:38 2 (const uint) +0:38 Constant: +0:38 1 (const int) +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of uint) +0:39 'txval12' ( temp 4-component vector of uint) +0:39 textureGather ( temp 4-component vector of uint) +0:39 Construct combined texture-sampler ( temp usampler2DArray) +0:39 'g_tTex2du4a' ( uniform utexture2DArray) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:39 c3: direct index for structure ( uniform 3-component vector of float) +0:39 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:39 Constant: +0:39 2 (const uint) +0:39 Constant: +0:39 1 (const int) +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of float) +0:41 'txval20' ( temp 4-component vector of float) +0:41 textureGather ( temp 4-component vector of float) +0:41 Construct combined texture-sampler ( temp sampler2DArray) +0:41 'g_tTex2df4a' ( uniform texture2DArray) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:41 c3: direct index for structure ( uniform 3-component vector of float) +0:41 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:41 Constant: +0:41 2 (const uint) +0:41 Constant: +0:41 2 (const int) +0:42 Sequence +0:42 move second child to first child ( temp 4-component vector of int) +0:42 'txval21' ( temp 4-component vector of int) +0:42 textureGather ( temp 4-component vector of int) +0:42 Construct combined texture-sampler ( temp isampler2DArray) +0:42 'g_tTex2di4a' ( uniform itexture2DArray) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:42 c3: direct index for structure ( uniform 3-component vector of float) +0:42 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:42 Constant: +0:42 2 (const uint) +0:42 Constant: +0:42 2 (const int) +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of uint) +0:43 'txval22' ( temp 4-component vector of uint) +0:43 textureGather ( temp 4-component vector of uint) +0:43 Construct combined texture-sampler ( temp usampler2DArray) +0:43 'g_tTex2du4a' ( uniform utexture2DArray) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:43 c3: direct index for structure ( uniform 3-component vector of float) +0:43 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:43 Constant: +0:43 2 (const uint) +0:43 Constant: +0:43 2 (const int) +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of float) +0:45 'txval30' ( temp 4-component vector of float) +0:45 textureGather ( temp 4-component vector of float) +0:45 Construct combined texture-sampler ( temp sampler2DArray) +0:45 'g_tTex2df4a' ( uniform texture2DArray) +0:45 'g_sSamp' (layout( binding=0) uniform sampler) +0:45 c3: direct index for structure ( uniform 3-component vector of float) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:45 Constant: +0:45 2 (const uint) +0:45 Constant: +0:45 3 (const int) +0:46 Sequence +0:46 move second child to first child ( temp 4-component vector of int) +0:46 'txval31' ( temp 4-component vector of int) +0:46 textureGather ( temp 4-component vector of int) +0:46 Construct combined texture-sampler ( temp isampler2DArray) +0:46 'g_tTex2di4a' ( uniform itexture2DArray) +0:46 'g_sSamp' (layout( binding=0) uniform sampler) +0:46 c3: direct index for structure ( uniform 3-component vector of float) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:46 Constant: +0:46 2 (const uint) +0:46 Constant: +0:46 3 (const int) +0:47 Sequence +0:47 move second child to first child ( temp 4-component vector of uint) +0:47 'txval32' ( temp 4-component vector of uint) +0:47 textureGather ( temp 4-component vector of uint) +0:47 Construct combined texture-sampler ( temp usampler2DArray) +0:47 'g_tTex2du4a' ( uniform utexture2DArray) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 c3: direct index for structure ( uniform 3-component vector of float) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:47 Constant: +0:47 2 (const uint) +0:47 Constant: +0:47 3 (const int) +0:51 Sequence +0:51 move second child to first child ( temp 4-component vector of float) +0:51 'txval40' ( temp 4-component vector of float) +0:51 textureGather ( temp 4-component vector of float) +0:51 Construct combined texture-sampler ( temp samplerCubeArray) +0:51 'g_tTexcdf4a' ( uniform textureCubeArray) +0:51 'g_sSamp' (layout( binding=0) uniform sampler) +0:51 c4: direct index for structure ( uniform 4-component vector of float) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:51 Constant: +0:51 3 (const uint) +0:51 Constant: +0:51 0 (const int) +0:52 Sequence +0:52 move second child to first child ( temp 4-component vector of int) +0:52 'txval41' ( temp 4-component vector of int) +0:52 textureGather ( temp 4-component vector of int) +0:52 Construct combined texture-sampler ( temp isamplerCubeArray) +0:52 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:52 'g_sSamp' (layout( binding=0) uniform sampler) +0:52 c4: direct index for structure ( uniform 4-component vector of float) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:52 Constant: +0:52 3 (const uint) +0:52 Constant: +0:52 0 (const int) +0:53 Sequence +0:53 move second child to first child ( temp 4-component vector of uint) +0:53 'txval42' ( temp 4-component vector of uint) +0:53 textureGather ( temp 4-component vector of uint) +0:53 Construct combined texture-sampler ( temp usamplerCubeArray) +0:53 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:53 'g_sSamp' (layout( binding=0) uniform sampler) +0:53 c4: direct index for structure ( uniform 4-component vector of float) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:53 Constant: +0:53 3 (const uint) +0:53 Constant: +0:53 0 (const int) +0:55 Sequence +0:55 move second child to first child ( temp 4-component vector of float) +0:55 'txval50' ( temp 4-component vector of float) +0:55 textureGather ( temp 4-component vector of float) +0:55 Construct combined texture-sampler ( temp samplerCubeArray) +0:55 'g_tTexcdf4a' ( uniform textureCubeArray) +0:55 'g_sSamp' (layout( binding=0) uniform sampler) +0:55 c4: direct index for structure ( uniform 4-component vector of float) +0:55 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:55 Constant: +0:55 3 (const uint) +0:55 Constant: +0:55 1 (const int) +0:56 Sequence +0:56 move second child to first child ( temp 4-component vector of int) +0:56 'txval51' ( temp 4-component vector of int) +0:56 textureGather ( temp 4-component vector of int) +0:56 Construct combined texture-sampler ( temp isamplerCubeArray) +0:56 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:56 'g_sSamp' (layout( binding=0) uniform sampler) +0:56 c4: direct index for structure ( uniform 4-component vector of float) +0:56 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:56 Constant: +0:56 3 (const uint) +0:56 Constant: +0:56 1 (const int) +0:57 Sequence +0:57 move second child to first child ( temp 4-component vector of uint) +0:57 'txval52' ( temp 4-component vector of uint) +0:57 textureGather ( temp 4-component vector of uint) +0:57 Construct combined texture-sampler ( temp usamplerCubeArray) +0:57 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:57 'g_sSamp' (layout( binding=0) uniform sampler) +0:57 c4: direct index for structure ( uniform 4-component vector of float) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:57 Constant: +0:57 3 (const uint) +0:57 Constant: +0:57 1 (const int) +0:59 Sequence +0:59 move second child to first child ( temp 4-component vector of float) +0:59 'txval60' ( temp 4-component vector of float) +0:59 textureGather ( temp 4-component vector of float) +0:59 Construct combined texture-sampler ( temp samplerCubeArray) +0:59 'g_tTexcdf4a' ( uniform textureCubeArray) +0:59 'g_sSamp' (layout( binding=0) uniform sampler) +0:59 c4: direct index for structure ( uniform 4-component vector of float) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:59 Constant: +0:59 3 (const uint) +0:59 Constant: +0:59 2 (const int) +0:60 Sequence +0:60 move second child to first child ( temp 4-component vector of int) +0:60 'txval61' ( temp 4-component vector of int) +0:60 textureGather ( temp 4-component vector of int) +0:60 Construct combined texture-sampler ( temp isamplerCubeArray) +0:60 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:60 'g_sSamp' (layout( binding=0) uniform sampler) +0:60 c4: direct index for structure ( uniform 4-component vector of float) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:60 Constant: +0:60 3 (const uint) +0:60 Constant: +0:60 2 (const int) +0:61 Sequence +0:61 move second child to first child ( temp 4-component vector of uint) +0:61 'txval62' ( temp 4-component vector of uint) +0:61 textureGather ( temp 4-component vector of uint) +0:61 Construct combined texture-sampler ( temp usamplerCubeArray) +0:61 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:61 'g_sSamp' (layout( binding=0) uniform sampler) +0:61 c4: direct index for structure ( uniform 4-component vector of float) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:61 Constant: +0:61 3 (const uint) +0:61 Constant: +0:61 2 (const int) +0:63 Sequence +0:63 move second child to first child ( temp 4-component vector of float) +0:63 'txval70' ( temp 4-component vector of float) +0:63 textureGather ( temp 4-component vector of float) +0:63 Construct combined texture-sampler ( temp samplerCubeArray) +0:63 'g_tTexcdf4a' ( uniform textureCubeArray) +0:63 'g_sSamp' (layout( binding=0) uniform sampler) +0:63 c4: direct index for structure ( uniform 4-component vector of float) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:63 Constant: +0:63 3 (const uint) +0:63 Constant: +0:63 3 (const int) +0:64 Sequence +0:64 move second child to first child ( temp 4-component vector of int) +0:64 'txval71' ( temp 4-component vector of int) +0:64 textureGather ( temp 4-component vector of int) +0:64 Construct combined texture-sampler ( temp isamplerCubeArray) +0:64 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:64 'g_sSamp' (layout( binding=0) uniform sampler) +0:64 c4: direct index for structure ( uniform 4-component vector of float) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:64 Constant: +0:64 3 (const uint) +0:64 Constant: +0:64 3 (const int) +0:65 Sequence +0:65 move second child to first child ( temp 4-component vector of uint) +0:65 'txval72' ( temp 4-component vector of uint) +0:65 textureGather ( temp 4-component vector of uint) +0:65 Construct combined texture-sampler ( temp usamplerCubeArray) +0:65 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:65 'g_sSamp' (layout( binding=0) uniform sampler) +0:65 c4: direct index for structure ( uniform 4-component vector of float) +0:65 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:65 Constant: +0:65 3 (const uint) +0:65 Constant: +0:65 3 (const int) +0:67 move second child to first child ( temp 4-component vector of float) +0:67 Color: direct index for structure ( temp 4-component vector of float) +0:67 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 1.000000 +0:67 1.000000 +0:67 1.000000 +0:67 1.000000 +0:68 move second child to first child ( temp float) +0:68 Depth: direct index for structure ( temp float) +0:68 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:68 Constant: +0:68 1 (const int) +0:68 Constant: +0:68 1.000000 +0:70 Branch: Return with expression +0:70 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:28 Color: direct index for structure ( temp 4-component vector of float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 0 (const int) +0:28 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:28 Depth: direct index for structure ( temp float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_sSamp2d' ( uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 255 + + Capability Shader + Capability Sampled1D + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 238 242 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval00" + Name 16 "g_tTex2df4a" + Name 20 "g_sSamp" + Name 26 "$Global" + MemberName 26($Global) 0 "c1" + MemberName 26($Global) 1 "c2" + MemberName 26($Global) 2 "c3" + MemberName 26($Global) 3 "c4" + Name 28 "" + Name 38 "txval01" + Name 41 "g_tTex2di4a" + Name 52 "txval02" + Name 55 "g_tTex2du4a" + Name 63 "txval10" + Name 71 "txval11" + Name 78 "txval12" + Name 85 "txval20" + Name 92 "txval21" + Name 99 "txval22" + Name 106 "txval30" + Name 114 "txval31" + Name 121 "txval32" + Name 128 "txval40" + Name 131 "g_tTexcdf4a" + Name 140 "txval41" + Name 143 "g_tTexcdi4a" + Name 151 "txval42" + Name 154 "g_tTexcdu4a" + Name 162 "txval50" + Name 169 "txval51" + Name 176 "txval52" + Name 183 "txval60" + Name 190 "txval61" + Name 197 "txval62" + Name 204 "txval70" + Name 211 "txval71" + Name 218 "txval72" + Name 226 "psout" + Name 235 "flattenTemp" + Name 238 "@entryPointOutput.Color" + Name 242 "@entryPointOutput.Depth" + Name 245 "g_sSamp2d" + Name 248 "g_tTex1df4a" + Name 251 "g_tTex1di4a" + Name 254 "g_tTex1du4a" + Decorate 16(g_tTex2df4a) DescriptorSet 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + MemberDecorate 26($Global) 0 Offset 0 + MemberDecorate 26($Global) 1 Offset 8 + MemberDecorate 26($Global) 2 Offset 16 + MemberDecorate 26($Global) 3 Offset 32 + Decorate 26($Global) Block + Decorate 28 DescriptorSet 0 + Decorate 41(g_tTex2di4a) DescriptorSet 0 + Decorate 55(g_tTex2du4a) DescriptorSet 0 + Decorate 131(g_tTexcdf4a) DescriptorSet 0 + Decorate 143(g_tTexcdi4a) DescriptorSet 0 + Decorate 154(g_tTexcdu4a) DescriptorSet 0 + Decorate 238(@entryPointOutput.Color) Location 0 + Decorate 242(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 245(g_sSamp2d) DescriptorSet 0 + Decorate 248(g_tTex1df4a) DescriptorSet 0 + Decorate 248(g_tTex1df4a) Binding 0 + Decorate 251(g_tTex1di4a) DescriptorSet 0 + Decorate 254(g_tTex1du4a) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 2D array sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex2df4a): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 2 + 25: TypeVector 6(float) 3 + 26($Global): TypeStruct 6(float) 24(fvec2) 25(fvec3) 7(fvec4) + 27: TypePointer Uniform 26($Global) + 28: 27(ptr) Variable Uniform + 29: TypeInt 32 1 + 30: 29(int) Constant 2 + 31: TypePointer Uniform 25(fvec3) + 34: 29(int) Constant 0 + 36: TypeVector 29(int) 4 + 37: TypePointer Function 36(ivec4) + 39: TypeImage 29(int) 2D array sampled format:Unknown + 40: TypePointer UniformConstant 39 + 41(g_tTex2di4a): 40(ptr) Variable UniformConstant + 44: TypeSampledImage 39 + 49: TypeInt 32 0 + 50: TypeVector 49(int) 4 + 51: TypePointer Function 50(ivec4) + 53: TypeImage 49(int) 2D array sampled format:Unknown + 54: TypePointer UniformConstant 53 + 55(g_tTex2du4a): 54(ptr) Variable UniformConstant + 58: TypeSampledImage 53 + 69: 29(int) Constant 1 + 112: 29(int) Constant 3 + 129: TypeImage 6(float) Cube array sampled format:Unknown + 130: TypePointer UniformConstant 129 +131(g_tTexcdf4a): 130(ptr) Variable UniformConstant + 134: TypeSampledImage 129 + 136: TypePointer Uniform 7(fvec4) + 141: TypeImage 29(int) Cube array sampled format:Unknown + 142: TypePointer UniformConstant 141 +143(g_tTexcdi4a): 142(ptr) Variable UniformConstant + 146: TypeSampledImage 141 + 152: TypeImage 49(int) Cube array sampled format:Unknown + 153: TypePointer UniformConstant 152 +154(g_tTexcdu4a): 153(ptr) Variable UniformConstant + 157: TypeSampledImage 152 + 225: TypePointer Function 8(PS_OUTPUT) + 227: 6(float) Constant 1065353216 + 228: 7(fvec4) ConstantComposite 227 227 227 227 + 230: TypePointer Function 6(float) + 237: TypePointer Output 7(fvec4) +238(@entryPointOutput.Color): 237(ptr) Variable Output + 241: TypePointer Output 6(float) +242(@entryPointOutput.Depth): 241(ptr) Variable Output + 245(g_sSamp2d): 19(ptr) Variable UniformConstant + 246: TypeImage 6(float) 1D array sampled format:Unknown + 247: TypePointer UniformConstant 246 +248(g_tTex1df4a): 247(ptr) Variable UniformConstant + 249: TypeImage 29(int) 1D array sampled format:Unknown + 250: TypePointer UniformConstant 249 +251(g_tTex1di4a): 250(ptr) Variable UniformConstant + 252: TypeImage 49(int) 1D array sampled format:Unknown + 253: TypePointer UniformConstant 252 +254(g_tTex1du4a): 253(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +235(flattenTemp): 225(ptr) Variable Function + 236:8(PS_OUTPUT) FunctionCall 10(@main() + Store 235(flattenTemp) 236 + 239: 12(ptr) AccessChain 235(flattenTemp) 34 + 240: 7(fvec4) Load 239 + Store 238(@entryPointOutput.Color) 240 + 243: 230(ptr) AccessChain 235(flattenTemp) 69 + 244: 6(float) Load 243 + Store 242(@entryPointOutput.Depth) 244 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval00): 12(ptr) Variable Function + 38(txval01): 37(ptr) Variable Function + 52(txval02): 51(ptr) Variable Function + 63(txval10): 12(ptr) Variable Function + 71(txval11): 37(ptr) Variable Function + 78(txval12): 51(ptr) Variable Function + 85(txval20): 12(ptr) Variable Function + 92(txval21): 37(ptr) Variable Function + 99(txval22): 51(ptr) Variable Function + 106(txval30): 12(ptr) Variable Function + 114(txval31): 37(ptr) Variable Function + 121(txval32): 51(ptr) Variable Function + 128(txval40): 12(ptr) Variable Function + 140(txval41): 37(ptr) Variable Function + 151(txval42): 51(ptr) Variable Function + 162(txval50): 12(ptr) Variable Function + 169(txval51): 37(ptr) Variable Function + 176(txval52): 51(ptr) Variable Function + 183(txval60): 12(ptr) Variable Function + 190(txval61): 37(ptr) Variable Function + 197(txval62): 51(ptr) Variable Function + 204(txval70): 12(ptr) Variable Function + 211(txval71): 37(ptr) Variable Function + 218(txval72): 51(ptr) Variable Function + 226(psout): 225(ptr) Variable Function + 17: 14 Load 16(g_tTex2df4a) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 32: 31(ptr) AccessChain 28 30 + 33: 25(fvec3) Load 32 + 35: 7(fvec4) ImageGather 23 33 34 + Store 13(txval00) 35 + 42: 39 Load 41(g_tTex2di4a) + 43: 18 Load 20(g_sSamp) + 45: 44 SampledImage 42 43 + 46: 31(ptr) AccessChain 28 30 + 47: 25(fvec3) Load 46 + 48: 36(ivec4) ImageGather 45 47 34 + Store 38(txval01) 48 + 56: 53 Load 55(g_tTex2du4a) + 57: 18 Load 20(g_sSamp) + 59: 58 SampledImage 56 57 + 60: 31(ptr) AccessChain 28 30 + 61: 25(fvec3) Load 60 + 62: 50(ivec4) ImageGather 59 61 34 + Store 52(txval02) 62 + 64: 14 Load 16(g_tTex2df4a) + 65: 18 Load 20(g_sSamp) + 66: 22 SampledImage 64 65 + 67: 31(ptr) AccessChain 28 30 + 68: 25(fvec3) Load 67 + 70: 7(fvec4) ImageGather 66 68 69 + Store 63(txval10) 70 + 72: 39 Load 41(g_tTex2di4a) + 73: 18 Load 20(g_sSamp) + 74: 44 SampledImage 72 73 + 75: 31(ptr) AccessChain 28 30 + 76: 25(fvec3) Load 75 + 77: 36(ivec4) ImageGather 74 76 69 + Store 71(txval11) 77 + 79: 53 Load 55(g_tTex2du4a) + 80: 18 Load 20(g_sSamp) + 81: 58 SampledImage 79 80 + 82: 31(ptr) AccessChain 28 30 + 83: 25(fvec3) Load 82 + 84: 50(ivec4) ImageGather 81 83 69 + Store 78(txval12) 84 + 86: 14 Load 16(g_tTex2df4a) + 87: 18 Load 20(g_sSamp) + 88: 22 SampledImage 86 87 + 89: 31(ptr) AccessChain 28 30 + 90: 25(fvec3) Load 89 + 91: 7(fvec4) ImageGather 88 90 30 + Store 85(txval20) 91 + 93: 39 Load 41(g_tTex2di4a) + 94: 18 Load 20(g_sSamp) + 95: 44 SampledImage 93 94 + 96: 31(ptr) AccessChain 28 30 + 97: 25(fvec3) Load 96 + 98: 36(ivec4) ImageGather 95 97 30 + Store 92(txval21) 98 + 100: 53 Load 55(g_tTex2du4a) + 101: 18 Load 20(g_sSamp) + 102: 58 SampledImage 100 101 + 103: 31(ptr) AccessChain 28 30 + 104: 25(fvec3) Load 103 + 105: 50(ivec4) ImageGather 102 104 30 + Store 99(txval22) 105 + 107: 14 Load 16(g_tTex2df4a) + 108: 18 Load 20(g_sSamp) + 109: 22 SampledImage 107 108 + 110: 31(ptr) AccessChain 28 30 + 111: 25(fvec3) Load 110 + 113: 7(fvec4) ImageGather 109 111 112 + Store 106(txval30) 113 + 115: 39 Load 41(g_tTex2di4a) + 116: 18 Load 20(g_sSamp) + 117: 44 SampledImage 115 116 + 118: 31(ptr) AccessChain 28 30 + 119: 25(fvec3) Load 118 + 120: 36(ivec4) ImageGather 117 119 112 + Store 114(txval31) 120 + 122: 53 Load 55(g_tTex2du4a) + 123: 18 Load 20(g_sSamp) + 124: 58 SampledImage 122 123 + 125: 31(ptr) AccessChain 28 30 + 126: 25(fvec3) Load 125 + 127: 50(ivec4) ImageGather 124 126 112 + Store 121(txval32) 127 + 132: 129 Load 131(g_tTexcdf4a) + 133: 18 Load 20(g_sSamp) + 135: 134 SampledImage 132 133 + 137: 136(ptr) AccessChain 28 112 + 138: 7(fvec4) Load 137 + 139: 7(fvec4) ImageGather 135 138 34 + Store 128(txval40) 139 + 144: 141 Load 143(g_tTexcdi4a) + 145: 18 Load 20(g_sSamp) + 147: 146 SampledImage 144 145 + 148: 136(ptr) AccessChain 28 112 + 149: 7(fvec4) Load 148 + 150: 36(ivec4) ImageGather 147 149 34 + Store 140(txval41) 150 + 155: 152 Load 154(g_tTexcdu4a) + 156: 18 Load 20(g_sSamp) + 158: 157 SampledImage 155 156 + 159: 136(ptr) AccessChain 28 112 + 160: 7(fvec4) Load 159 + 161: 50(ivec4) ImageGather 158 160 34 + Store 151(txval42) 161 + 163: 129 Load 131(g_tTexcdf4a) + 164: 18 Load 20(g_sSamp) + 165: 134 SampledImage 163 164 + 166: 136(ptr) AccessChain 28 112 + 167: 7(fvec4) Load 166 + 168: 7(fvec4) ImageGather 165 167 69 + Store 162(txval50) 168 + 170: 141 Load 143(g_tTexcdi4a) + 171: 18 Load 20(g_sSamp) + 172: 146 SampledImage 170 171 + 173: 136(ptr) AccessChain 28 112 + 174: 7(fvec4) Load 173 + 175: 36(ivec4) ImageGather 172 174 69 + Store 169(txval51) 175 + 177: 152 Load 154(g_tTexcdu4a) + 178: 18 Load 20(g_sSamp) + 179: 157 SampledImage 177 178 + 180: 136(ptr) AccessChain 28 112 + 181: 7(fvec4) Load 180 + 182: 50(ivec4) ImageGather 179 181 69 + Store 176(txval52) 182 + 184: 129 Load 131(g_tTexcdf4a) + 185: 18 Load 20(g_sSamp) + 186: 134 SampledImage 184 185 + 187: 136(ptr) AccessChain 28 112 + 188: 7(fvec4) Load 187 + 189: 7(fvec4) ImageGather 186 188 30 + Store 183(txval60) 189 + 191: 141 Load 143(g_tTexcdi4a) + 192: 18 Load 20(g_sSamp) + 193: 146 SampledImage 191 192 + 194: 136(ptr) AccessChain 28 112 + 195: 7(fvec4) Load 194 + 196: 36(ivec4) ImageGather 193 195 30 + Store 190(txval61) 196 + 198: 152 Load 154(g_tTexcdu4a) + 199: 18 Load 20(g_sSamp) + 200: 157 SampledImage 198 199 + 201: 136(ptr) AccessChain 28 112 + 202: 7(fvec4) Load 201 + 203: 50(ivec4) ImageGather 200 202 30 + Store 197(txval62) 203 + 205: 129 Load 131(g_tTexcdf4a) + 206: 18 Load 20(g_sSamp) + 207: 134 SampledImage 205 206 + 208: 136(ptr) AccessChain 28 112 + 209: 7(fvec4) Load 208 + 210: 7(fvec4) ImageGather 207 209 112 + Store 204(txval70) 210 + 212: 141 Load 143(g_tTexcdi4a) + 213: 18 Load 20(g_sSamp) + 214: 146 SampledImage 212 213 + 215: 136(ptr) AccessChain 28 112 + 216: 7(fvec4) Load 215 + 217: 36(ivec4) ImageGather 214 216 112 + Store 211(txval71) 217 + 219: 152 Load 154(g_tTexcdu4a) + 220: 18 Load 20(g_sSamp) + 221: 157 SampledImage 219 220 + 222: 136(ptr) AccessChain 28 112 + 223: 7(fvec4) Load 222 + 224: 50(ivec4) ImageGather 221 223 112 + Store 218(txval72) 224 + 229: 12(ptr) AccessChain 226(psout) 34 + Store 229 228 + 231: 230(ptr) AccessChain 226(psout) 69 + Store 231 227 + 232:8(PS_OUTPUT) Load 226(psout) + ReturnValue 232 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out new file mode 100644 index 00000000..d0be6d5a --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out @@ -0,0 +1,1145 @@ +hlsl.gatherRGBA.basic.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:34 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 Function Parameters: +0:? Sequence +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 'txval00' ( temp 4-component vector of float) +0:39 textureGather ( temp 4-component vector of float) +0:39 Construct combined texture-sampler ( temp sampler2D) +0:39 'g_tTex2df4' ( uniform texture2D) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:39 c2: direct index for structure ( uniform 2-component vector of float) +0:39 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:39 Constant: +0:39 1 (const uint) +0:39 Constant: +0:39 0 (const int) +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of int) +0:40 'txval01' ( temp 4-component vector of int) +0:40 textureGather ( temp 4-component vector of int) +0:40 Construct combined texture-sampler ( temp isampler2D) +0:40 'g_tTex2di4' ( uniform itexture2D) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:40 c2: direct index for structure ( uniform 2-component vector of float) +0:40 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:40 Constant: +0:40 1 (const uint) +0:40 Constant: +0:40 0 (const int) +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of uint) +0:41 'txval02' ( temp 4-component vector of uint) +0:41 textureGather ( temp 4-component vector of uint) +0:41 Construct combined texture-sampler ( temp usampler2D) +0:41 'g_tTex2du4' ( uniform utexture2D) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:41 c2: direct index for structure ( uniform 2-component vector of float) +0:41 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:41 Constant: +0:41 1 (const uint) +0:41 Constant: +0:41 0 (const int) +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of float) +0:43 'txval10' ( temp 4-component vector of float) +0:43 textureGather ( temp 4-component vector of float) +0:43 Construct combined texture-sampler ( temp sampler2D) +0:43 'g_tTex2df4' ( uniform texture2D) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:43 c2: direct index for structure ( uniform 2-component vector of float) +0:43 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:43 Constant: +0:43 1 (const uint) +0:43 Constant: +0:43 1 (const int) +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of int) +0:44 'txval11' ( temp 4-component vector of int) +0:44 textureGather ( temp 4-component vector of int) +0:44 Construct combined texture-sampler ( temp isampler2D) +0:44 'g_tTex2di4' ( uniform itexture2D) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:44 c2: direct index for structure ( uniform 2-component vector of float) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:44 Constant: +0:44 1 (const uint) +0:44 Constant: +0:44 1 (const int) +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of uint) +0:45 'txval12' ( temp 4-component vector of uint) +0:45 textureGather ( temp 4-component vector of uint) +0:45 Construct combined texture-sampler ( temp usampler2D) +0:45 'g_tTex2du4' ( uniform utexture2D) +0:45 'g_sSamp' (layout( binding=0) uniform sampler) +0:45 c2: direct index for structure ( uniform 2-component vector of float) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:45 Constant: +0:45 1 (const uint) +0:45 Constant: +0:45 1 (const int) +0:47 Sequence +0:47 move second child to first child ( temp 4-component vector of float) +0:47 'txval20' ( temp 4-component vector of float) +0:47 textureGather ( temp 4-component vector of float) +0:47 Construct combined texture-sampler ( temp sampler2D) +0:47 'g_tTex2df4' ( uniform texture2D) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 c2: direct index for structure ( uniform 2-component vector of float) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:47 Constant: +0:47 1 (const uint) +0:47 Constant: +0:47 2 (const int) +0:48 Sequence +0:48 move second child to first child ( temp 4-component vector of int) +0:48 'txval21' ( temp 4-component vector of int) +0:48 textureGather ( temp 4-component vector of int) +0:48 Construct combined texture-sampler ( temp isampler2D) +0:48 'g_tTex2di4' ( uniform itexture2D) +0:48 'g_sSamp' (layout( binding=0) uniform sampler) +0:48 c2: direct index for structure ( uniform 2-component vector of float) +0:48 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:48 Constant: +0:48 1 (const uint) +0:48 Constant: +0:48 2 (const int) +0:49 Sequence +0:49 move second child to first child ( temp 4-component vector of uint) +0:49 'txval22' ( temp 4-component vector of uint) +0:49 textureGather ( temp 4-component vector of uint) +0:49 Construct combined texture-sampler ( temp usampler2D) +0:49 'g_tTex2du4' ( uniform utexture2D) +0:49 'g_sSamp' (layout( binding=0) uniform sampler) +0:49 c2: direct index for structure ( uniform 2-component vector of float) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:49 Constant: +0:49 1 (const uint) +0:49 Constant: +0:49 2 (const int) +0:51 Sequence +0:51 move second child to first child ( temp 4-component vector of float) +0:51 'txval30' ( temp 4-component vector of float) +0:51 textureGather ( temp 4-component vector of float) +0:51 Construct combined texture-sampler ( temp sampler2D) +0:51 'g_tTex2df4' ( uniform texture2D) +0:51 'g_sSamp' (layout( binding=0) uniform sampler) +0:51 c2: direct index for structure ( uniform 2-component vector of float) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:51 Constant: +0:51 1 (const uint) +0:51 Constant: +0:51 3 (const int) +0:52 Sequence +0:52 move second child to first child ( temp 4-component vector of int) +0:52 'txval31' ( temp 4-component vector of int) +0:52 textureGather ( temp 4-component vector of int) +0:52 Construct combined texture-sampler ( temp isampler2D) +0:52 'g_tTex2di4' ( uniform itexture2D) +0:52 'g_sSamp' (layout( binding=0) uniform sampler) +0:52 c2: direct index for structure ( uniform 2-component vector of float) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:52 Constant: +0:52 1 (const uint) +0:52 Constant: +0:52 3 (const int) +0:53 Sequence +0:53 move second child to first child ( temp 4-component vector of uint) +0:53 'txval32' ( temp 4-component vector of uint) +0:53 textureGather ( temp 4-component vector of uint) +0:53 Construct combined texture-sampler ( temp usampler2D) +0:53 'g_tTex2du4' ( uniform utexture2D) +0:53 'g_sSamp' (layout( binding=0) uniform sampler) +0:53 c2: direct index for structure ( uniform 2-component vector of float) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:53 Constant: +0:53 1 (const uint) +0:53 Constant: +0:53 3 (const int) +0:57 Sequence +0:57 move second child to first child ( temp 4-component vector of float) +0:57 'txval40' ( temp 4-component vector of float) +0:57 textureGather ( temp 4-component vector of float) +0:57 Construct combined texture-sampler ( temp samplerCube) +0:57 'g_tTexcdf4' ( uniform textureCube) +0:57 'g_sSamp' (layout( binding=0) uniform sampler) +0:57 c3: direct index for structure ( uniform 3-component vector of float) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:57 Constant: +0:57 2 (const uint) +0:57 Constant: +0:57 0 (const int) +0:58 Sequence +0:58 move second child to first child ( temp 4-component vector of int) +0:58 'txval41' ( temp 4-component vector of int) +0:58 textureGather ( temp 4-component vector of int) +0:58 Construct combined texture-sampler ( temp isamplerCube) +0:58 'g_tTexcdi4' ( uniform itextureCube) +0:58 'g_sSamp' (layout( binding=0) uniform sampler) +0:58 c3: direct index for structure ( uniform 3-component vector of float) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:58 Constant: +0:58 2 (const uint) +0:58 Constant: +0:58 0 (const int) +0:59 Sequence +0:59 move second child to first child ( temp 4-component vector of uint) +0:59 'txval42' ( temp 4-component vector of uint) +0:59 textureGather ( temp 4-component vector of uint) +0:59 Construct combined texture-sampler ( temp usamplerCube) +0:59 'g_tTexcdu4' ( uniform utextureCube) +0:59 'g_sSamp' (layout( binding=0) uniform sampler) +0:59 c3: direct index for structure ( uniform 3-component vector of float) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:59 Constant: +0:59 2 (const uint) +0:59 Constant: +0:59 0 (const int) +0:61 Sequence +0:61 move second child to first child ( temp 4-component vector of float) +0:61 'txval50' ( temp 4-component vector of float) +0:61 textureGather ( temp 4-component vector of float) +0:61 Construct combined texture-sampler ( temp samplerCube) +0:61 'g_tTexcdf4' ( uniform textureCube) +0:61 'g_sSamp' (layout( binding=0) uniform sampler) +0:61 c3: direct index for structure ( uniform 3-component vector of float) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:61 Constant: +0:61 2 (const uint) +0:61 Constant: +0:61 1 (const int) +0:62 Sequence +0:62 move second child to first child ( temp 4-component vector of int) +0:62 'txval51' ( temp 4-component vector of int) +0:62 textureGather ( temp 4-component vector of int) +0:62 Construct combined texture-sampler ( temp isamplerCube) +0:62 'g_tTexcdi4' ( uniform itextureCube) +0:62 'g_sSamp' (layout( binding=0) uniform sampler) +0:62 c3: direct index for structure ( uniform 3-component vector of float) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:62 Constant: +0:62 2 (const uint) +0:62 Constant: +0:62 1 (const int) +0:63 Sequence +0:63 move second child to first child ( temp 4-component vector of uint) +0:63 'txval52' ( temp 4-component vector of uint) +0:63 textureGather ( temp 4-component vector of uint) +0:63 Construct combined texture-sampler ( temp usamplerCube) +0:63 'g_tTexcdu4' ( uniform utextureCube) +0:63 'g_sSamp' (layout( binding=0) uniform sampler) +0:63 c3: direct index for structure ( uniform 3-component vector of float) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:63 Constant: +0:63 2 (const uint) +0:63 Constant: +0:63 1 (const int) +0:65 Sequence +0:65 move second child to first child ( temp 4-component vector of float) +0:65 'txval60' ( temp 4-component vector of float) +0:65 textureGather ( temp 4-component vector of float) +0:65 Construct combined texture-sampler ( temp samplerCube) +0:65 'g_tTexcdf4' ( uniform textureCube) +0:65 'g_sSamp' (layout( binding=0) uniform sampler) +0:65 c3: direct index for structure ( uniform 3-component vector of float) +0:65 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:65 Constant: +0:65 2 (const uint) +0:65 Constant: +0:65 2 (const int) +0:66 Sequence +0:66 move second child to first child ( temp 4-component vector of int) +0:66 'txval61' ( temp 4-component vector of int) +0:66 textureGather ( temp 4-component vector of int) +0:66 Construct combined texture-sampler ( temp isamplerCube) +0:66 'g_tTexcdi4' ( uniform itextureCube) +0:66 'g_sSamp' (layout( binding=0) uniform sampler) +0:66 c3: direct index for structure ( uniform 3-component vector of float) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:66 Constant: +0:66 2 (const uint) +0:66 Constant: +0:66 2 (const int) +0:67 Sequence +0:67 move second child to first child ( temp 4-component vector of uint) +0:67 'txval62' ( temp 4-component vector of uint) +0:67 textureGather ( temp 4-component vector of uint) +0:67 Construct combined texture-sampler ( temp usamplerCube) +0:67 'g_tTexcdu4' ( uniform utextureCube) +0:67 'g_sSamp' (layout( binding=0) uniform sampler) +0:67 c3: direct index for structure ( uniform 3-component vector of float) +0:67 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:67 Constant: +0:67 2 (const uint) +0:67 Constant: +0:67 2 (const int) +0:69 Sequence +0:69 move second child to first child ( temp 4-component vector of float) +0:69 'txval70' ( temp 4-component vector of float) +0:69 textureGather ( temp 4-component vector of float) +0:69 Construct combined texture-sampler ( temp samplerCube) +0:69 'g_tTexcdf4' ( uniform textureCube) +0:69 'g_sSamp' (layout( binding=0) uniform sampler) +0:69 c3: direct index for structure ( uniform 3-component vector of float) +0:69 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:69 Constant: +0:69 2 (const uint) +0:69 Constant: +0:69 3 (const int) +0:70 Sequence +0:70 move second child to first child ( temp 4-component vector of int) +0:70 'txval71' ( temp 4-component vector of int) +0:70 textureGather ( temp 4-component vector of int) +0:70 Construct combined texture-sampler ( temp isamplerCube) +0:70 'g_tTexcdi4' ( uniform itextureCube) +0:70 'g_sSamp' (layout( binding=0) uniform sampler) +0:70 c3: direct index for structure ( uniform 3-component vector of float) +0:70 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:70 Constant: +0:70 2 (const uint) +0:70 Constant: +0:70 3 (const int) +0:71 Sequence +0:71 move second child to first child ( temp 4-component vector of uint) +0:71 'txval72' ( temp 4-component vector of uint) +0:71 textureGather ( temp 4-component vector of uint) +0:71 Construct combined texture-sampler ( temp usamplerCube) +0:71 'g_tTexcdu4' ( uniform utextureCube) +0:71 'g_sSamp' (layout( binding=0) uniform sampler) +0:71 c3: direct index for structure ( uniform 3-component vector of float) +0:71 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:71 Constant: +0:71 2 (const uint) +0:71 Constant: +0:71 3 (const int) +0:73 move second child to first child ( temp 4-component vector of float) +0:73 Color: direct index for structure ( temp 4-component vector of float) +0:73 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:73 Constant: +0:73 0 (const int) +0:73 Constant: +0:73 1.000000 +0:73 1.000000 +0:73 1.000000 +0:73 1.000000 +0:74 move second child to first child ( temp float) +0:74 Depth: direct index for structure ( temp float) +0:74 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:74 Constant: +0:74 1 (const int) +0:74 Constant: +0:74 1.000000 +0:76 Branch: Return with expression +0:76 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 Function Definition: main( ( temp void) +0:34 Function Parameters: +0:? Sequence +0:34 Sequence +0:34 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:34 Color: direct index for structure ( temp 4-component vector of float) +0:34 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 Constant: +0:34 0 (const int) +0:34 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:34 Depth: direct index for structure ( temp float) +0:34 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 Constant: +0:34 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_sSamp2d' ( uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:34 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 Function Parameters: +0:? Sequence +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 'txval00' ( temp 4-component vector of float) +0:39 textureGather ( temp 4-component vector of float) +0:39 Construct combined texture-sampler ( temp sampler2D) +0:39 'g_tTex2df4' ( uniform texture2D) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:39 c2: direct index for structure ( uniform 2-component vector of float) +0:39 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:39 Constant: +0:39 1 (const uint) +0:39 Constant: +0:39 0 (const int) +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of int) +0:40 'txval01' ( temp 4-component vector of int) +0:40 textureGather ( temp 4-component vector of int) +0:40 Construct combined texture-sampler ( temp isampler2D) +0:40 'g_tTex2di4' ( uniform itexture2D) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:40 c2: direct index for structure ( uniform 2-component vector of float) +0:40 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:40 Constant: +0:40 1 (const uint) +0:40 Constant: +0:40 0 (const int) +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of uint) +0:41 'txval02' ( temp 4-component vector of uint) +0:41 textureGather ( temp 4-component vector of uint) +0:41 Construct combined texture-sampler ( temp usampler2D) +0:41 'g_tTex2du4' ( uniform utexture2D) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:41 c2: direct index for structure ( uniform 2-component vector of float) +0:41 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:41 Constant: +0:41 1 (const uint) +0:41 Constant: +0:41 0 (const int) +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of float) +0:43 'txval10' ( temp 4-component vector of float) +0:43 textureGather ( temp 4-component vector of float) +0:43 Construct combined texture-sampler ( temp sampler2D) +0:43 'g_tTex2df4' ( uniform texture2D) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:43 c2: direct index for structure ( uniform 2-component vector of float) +0:43 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:43 Constant: +0:43 1 (const uint) +0:43 Constant: +0:43 1 (const int) +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of int) +0:44 'txval11' ( temp 4-component vector of int) +0:44 textureGather ( temp 4-component vector of int) +0:44 Construct combined texture-sampler ( temp isampler2D) +0:44 'g_tTex2di4' ( uniform itexture2D) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:44 c2: direct index for structure ( uniform 2-component vector of float) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:44 Constant: +0:44 1 (const uint) +0:44 Constant: +0:44 1 (const int) +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of uint) +0:45 'txval12' ( temp 4-component vector of uint) +0:45 textureGather ( temp 4-component vector of uint) +0:45 Construct combined texture-sampler ( temp usampler2D) +0:45 'g_tTex2du4' ( uniform utexture2D) +0:45 'g_sSamp' (layout( binding=0) uniform sampler) +0:45 c2: direct index for structure ( uniform 2-component vector of float) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:45 Constant: +0:45 1 (const uint) +0:45 Constant: +0:45 1 (const int) +0:47 Sequence +0:47 move second child to first child ( temp 4-component vector of float) +0:47 'txval20' ( temp 4-component vector of float) +0:47 textureGather ( temp 4-component vector of float) +0:47 Construct combined texture-sampler ( temp sampler2D) +0:47 'g_tTex2df4' ( uniform texture2D) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 c2: direct index for structure ( uniform 2-component vector of float) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:47 Constant: +0:47 1 (const uint) +0:47 Constant: +0:47 2 (const int) +0:48 Sequence +0:48 move second child to first child ( temp 4-component vector of int) +0:48 'txval21' ( temp 4-component vector of int) +0:48 textureGather ( temp 4-component vector of int) +0:48 Construct combined texture-sampler ( temp isampler2D) +0:48 'g_tTex2di4' ( uniform itexture2D) +0:48 'g_sSamp' (layout( binding=0) uniform sampler) +0:48 c2: direct index for structure ( uniform 2-component vector of float) +0:48 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:48 Constant: +0:48 1 (const uint) +0:48 Constant: +0:48 2 (const int) +0:49 Sequence +0:49 move second child to first child ( temp 4-component vector of uint) +0:49 'txval22' ( temp 4-component vector of uint) +0:49 textureGather ( temp 4-component vector of uint) +0:49 Construct combined texture-sampler ( temp usampler2D) +0:49 'g_tTex2du4' ( uniform utexture2D) +0:49 'g_sSamp' (layout( binding=0) uniform sampler) +0:49 c2: direct index for structure ( uniform 2-component vector of float) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:49 Constant: +0:49 1 (const uint) +0:49 Constant: +0:49 2 (const int) +0:51 Sequence +0:51 move second child to first child ( temp 4-component vector of float) +0:51 'txval30' ( temp 4-component vector of float) +0:51 textureGather ( temp 4-component vector of float) +0:51 Construct combined texture-sampler ( temp sampler2D) +0:51 'g_tTex2df4' ( uniform texture2D) +0:51 'g_sSamp' (layout( binding=0) uniform sampler) +0:51 c2: direct index for structure ( uniform 2-component vector of float) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:51 Constant: +0:51 1 (const uint) +0:51 Constant: +0:51 3 (const int) +0:52 Sequence +0:52 move second child to first child ( temp 4-component vector of int) +0:52 'txval31' ( temp 4-component vector of int) +0:52 textureGather ( temp 4-component vector of int) +0:52 Construct combined texture-sampler ( temp isampler2D) +0:52 'g_tTex2di4' ( uniform itexture2D) +0:52 'g_sSamp' (layout( binding=0) uniform sampler) +0:52 c2: direct index for structure ( uniform 2-component vector of float) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:52 Constant: +0:52 1 (const uint) +0:52 Constant: +0:52 3 (const int) +0:53 Sequence +0:53 move second child to first child ( temp 4-component vector of uint) +0:53 'txval32' ( temp 4-component vector of uint) +0:53 textureGather ( temp 4-component vector of uint) +0:53 Construct combined texture-sampler ( temp usampler2D) +0:53 'g_tTex2du4' ( uniform utexture2D) +0:53 'g_sSamp' (layout( binding=0) uniform sampler) +0:53 c2: direct index for structure ( uniform 2-component vector of float) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:53 Constant: +0:53 1 (const uint) +0:53 Constant: +0:53 3 (const int) +0:57 Sequence +0:57 move second child to first child ( temp 4-component vector of float) +0:57 'txval40' ( temp 4-component vector of float) +0:57 textureGather ( temp 4-component vector of float) +0:57 Construct combined texture-sampler ( temp samplerCube) +0:57 'g_tTexcdf4' ( uniform textureCube) +0:57 'g_sSamp' (layout( binding=0) uniform sampler) +0:57 c3: direct index for structure ( uniform 3-component vector of float) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:57 Constant: +0:57 2 (const uint) +0:57 Constant: +0:57 0 (const int) +0:58 Sequence +0:58 move second child to first child ( temp 4-component vector of int) +0:58 'txval41' ( temp 4-component vector of int) +0:58 textureGather ( temp 4-component vector of int) +0:58 Construct combined texture-sampler ( temp isamplerCube) +0:58 'g_tTexcdi4' ( uniform itextureCube) +0:58 'g_sSamp' (layout( binding=0) uniform sampler) +0:58 c3: direct index for structure ( uniform 3-component vector of float) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:58 Constant: +0:58 2 (const uint) +0:58 Constant: +0:58 0 (const int) +0:59 Sequence +0:59 move second child to first child ( temp 4-component vector of uint) +0:59 'txval42' ( temp 4-component vector of uint) +0:59 textureGather ( temp 4-component vector of uint) +0:59 Construct combined texture-sampler ( temp usamplerCube) +0:59 'g_tTexcdu4' ( uniform utextureCube) +0:59 'g_sSamp' (layout( binding=0) uniform sampler) +0:59 c3: direct index for structure ( uniform 3-component vector of float) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:59 Constant: +0:59 2 (const uint) +0:59 Constant: +0:59 0 (const int) +0:61 Sequence +0:61 move second child to first child ( temp 4-component vector of float) +0:61 'txval50' ( temp 4-component vector of float) +0:61 textureGather ( temp 4-component vector of float) +0:61 Construct combined texture-sampler ( temp samplerCube) +0:61 'g_tTexcdf4' ( uniform textureCube) +0:61 'g_sSamp' (layout( binding=0) uniform sampler) +0:61 c3: direct index for structure ( uniform 3-component vector of float) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:61 Constant: +0:61 2 (const uint) +0:61 Constant: +0:61 1 (const int) +0:62 Sequence +0:62 move second child to first child ( temp 4-component vector of int) +0:62 'txval51' ( temp 4-component vector of int) +0:62 textureGather ( temp 4-component vector of int) +0:62 Construct combined texture-sampler ( temp isamplerCube) +0:62 'g_tTexcdi4' ( uniform itextureCube) +0:62 'g_sSamp' (layout( binding=0) uniform sampler) +0:62 c3: direct index for structure ( uniform 3-component vector of float) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:62 Constant: +0:62 2 (const uint) +0:62 Constant: +0:62 1 (const int) +0:63 Sequence +0:63 move second child to first child ( temp 4-component vector of uint) +0:63 'txval52' ( temp 4-component vector of uint) +0:63 textureGather ( temp 4-component vector of uint) +0:63 Construct combined texture-sampler ( temp usamplerCube) +0:63 'g_tTexcdu4' ( uniform utextureCube) +0:63 'g_sSamp' (layout( binding=0) uniform sampler) +0:63 c3: direct index for structure ( uniform 3-component vector of float) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:63 Constant: +0:63 2 (const uint) +0:63 Constant: +0:63 1 (const int) +0:65 Sequence +0:65 move second child to first child ( temp 4-component vector of float) +0:65 'txval60' ( temp 4-component vector of float) +0:65 textureGather ( temp 4-component vector of float) +0:65 Construct combined texture-sampler ( temp samplerCube) +0:65 'g_tTexcdf4' ( uniform textureCube) +0:65 'g_sSamp' (layout( binding=0) uniform sampler) +0:65 c3: direct index for structure ( uniform 3-component vector of float) +0:65 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:65 Constant: +0:65 2 (const uint) +0:65 Constant: +0:65 2 (const int) +0:66 Sequence +0:66 move second child to first child ( temp 4-component vector of int) +0:66 'txval61' ( temp 4-component vector of int) +0:66 textureGather ( temp 4-component vector of int) +0:66 Construct combined texture-sampler ( temp isamplerCube) +0:66 'g_tTexcdi4' ( uniform itextureCube) +0:66 'g_sSamp' (layout( binding=0) uniform sampler) +0:66 c3: direct index for structure ( uniform 3-component vector of float) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:66 Constant: +0:66 2 (const uint) +0:66 Constant: +0:66 2 (const int) +0:67 Sequence +0:67 move second child to first child ( temp 4-component vector of uint) +0:67 'txval62' ( temp 4-component vector of uint) +0:67 textureGather ( temp 4-component vector of uint) +0:67 Construct combined texture-sampler ( temp usamplerCube) +0:67 'g_tTexcdu4' ( uniform utextureCube) +0:67 'g_sSamp' (layout( binding=0) uniform sampler) +0:67 c3: direct index for structure ( uniform 3-component vector of float) +0:67 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:67 Constant: +0:67 2 (const uint) +0:67 Constant: +0:67 2 (const int) +0:69 Sequence +0:69 move second child to first child ( temp 4-component vector of float) +0:69 'txval70' ( temp 4-component vector of float) +0:69 textureGather ( temp 4-component vector of float) +0:69 Construct combined texture-sampler ( temp samplerCube) +0:69 'g_tTexcdf4' ( uniform textureCube) +0:69 'g_sSamp' (layout( binding=0) uniform sampler) +0:69 c3: direct index for structure ( uniform 3-component vector of float) +0:69 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:69 Constant: +0:69 2 (const uint) +0:69 Constant: +0:69 3 (const int) +0:70 Sequence +0:70 move second child to first child ( temp 4-component vector of int) +0:70 'txval71' ( temp 4-component vector of int) +0:70 textureGather ( temp 4-component vector of int) +0:70 Construct combined texture-sampler ( temp isamplerCube) +0:70 'g_tTexcdi4' ( uniform itextureCube) +0:70 'g_sSamp' (layout( binding=0) uniform sampler) +0:70 c3: direct index for structure ( uniform 3-component vector of float) +0:70 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:70 Constant: +0:70 2 (const uint) +0:70 Constant: +0:70 3 (const int) +0:71 Sequence +0:71 move second child to first child ( temp 4-component vector of uint) +0:71 'txval72' ( temp 4-component vector of uint) +0:71 textureGather ( temp 4-component vector of uint) +0:71 Construct combined texture-sampler ( temp usamplerCube) +0:71 'g_tTexcdu4' ( uniform utextureCube) +0:71 'g_sSamp' (layout( binding=0) uniform sampler) +0:71 c3: direct index for structure ( uniform 3-component vector of float) +0:71 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:71 Constant: +0:71 2 (const uint) +0:71 Constant: +0:71 3 (const int) +0:73 move second child to first child ( temp 4-component vector of float) +0:73 Color: direct index for structure ( temp 4-component vector of float) +0:73 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:73 Constant: +0:73 0 (const int) +0:73 Constant: +0:73 1.000000 +0:73 1.000000 +0:73 1.000000 +0:73 1.000000 +0:74 move second child to first child ( temp float) +0:74 Depth: direct index for structure ( temp float) +0:74 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:74 Constant: +0:74 1 (const int) +0:74 Constant: +0:74 1.000000 +0:76 Branch: Return with expression +0:76 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 Function Definition: main( ( temp void) +0:34 Function Parameters: +0:? Sequence +0:34 Sequence +0:34 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:34 Color: direct index for structure ( temp 4-component vector of float) +0:34 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 Constant: +0:34 0 (const int) +0:34 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:34 Depth: direct index for structure ( temp float) +0:34 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 Constant: +0:34 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_sSamp2d' ( uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 265 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 238 242 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval00" + Name 16 "g_tTex2df4" + Name 20 "g_sSamp" + Name 26 "$Global" + MemberName 26($Global) 0 "c1" + MemberName 26($Global) 1 "c2" + MemberName 26($Global) 2 "c3" + MemberName 26($Global) 3 "c4" + Name 28 "" + Name 38 "txval01" + Name 41 "g_tTex2di4" + Name 52 "txval02" + Name 55 "g_tTex2du4" + Name 63 "txval10" + Name 70 "txval11" + Name 77 "txval12" + Name 84 "txval20" + Name 92 "txval21" + Name 99 "txval22" + Name 106 "txval30" + Name 114 "txval31" + Name 121 "txval32" + Name 128 "txval40" + Name 131 "g_tTexcdf4" + Name 140 "txval41" + Name 143 "g_tTexcdi4" + Name 151 "txval42" + Name 154 "g_tTexcdu4" + Name 162 "txval50" + Name 169 "txval51" + Name 176 "txval52" + Name 183 "txval60" + Name 190 "txval61" + Name 197 "txval62" + Name 204 "txval70" + Name 211 "txval71" + Name 218 "txval72" + Name 226 "psout" + Name 235 "flattenTemp" + Name 238 "@entryPointOutput.Color" + Name 242 "@entryPointOutput.Depth" + Name 245 "g_sSamp2d" + Name 248 "g_tTex1df4a" + Name 249 "g_tTex1df4" + Name 252 "g_tTex1di4" + Name 255 "g_tTex1du4" + Name 258 "g_tTex3df4" + Name 261 "g_tTex3di4" + Name 264 "g_tTex3du4" + Decorate 16(g_tTex2df4) DescriptorSet 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + MemberDecorate 26($Global) 0 Offset 0 + MemberDecorate 26($Global) 1 Offset 8 + MemberDecorate 26($Global) 2 Offset 16 + MemberDecorate 26($Global) 3 Offset 32 + Decorate 26($Global) Block + Decorate 28 DescriptorSet 0 + Decorate 41(g_tTex2di4) DescriptorSet 0 + Decorate 55(g_tTex2du4) DescriptorSet 0 + Decorate 131(g_tTexcdf4) DescriptorSet 0 + Decorate 143(g_tTexcdi4) DescriptorSet 0 + Decorate 154(g_tTexcdu4) DescriptorSet 0 + Decorate 238(@entryPointOutput.Color) Location 0 + Decorate 242(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 245(g_sSamp2d) DescriptorSet 0 + Decorate 248(g_tTex1df4a) DescriptorSet 0 + Decorate 248(g_tTex1df4a) Binding 1 + Decorate 249(g_tTex1df4) DescriptorSet 0 + Decorate 249(g_tTex1df4) Binding 0 + Decorate 252(g_tTex1di4) DescriptorSet 0 + Decorate 255(g_tTex1du4) DescriptorSet 0 + Decorate 258(g_tTex3df4) DescriptorSet 0 + Decorate 261(g_tTex3di4) DescriptorSet 0 + Decorate 264(g_tTex3du4) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 2D sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex2df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 2 + 25: TypeVector 6(float) 3 + 26($Global): TypeStruct 6(float) 24(fvec2) 25(fvec3) 7(fvec4) + 27: TypePointer Uniform 26($Global) + 28: 27(ptr) Variable Uniform + 29: TypeInt 32 1 + 30: 29(int) Constant 1 + 31: TypePointer Uniform 24(fvec2) + 34: 29(int) Constant 0 + 36: TypeVector 29(int) 4 + 37: TypePointer Function 36(ivec4) + 39: TypeImage 29(int) 2D sampled format:Unknown + 40: TypePointer UniformConstant 39 + 41(g_tTex2di4): 40(ptr) Variable UniformConstant + 44: TypeSampledImage 39 + 49: TypeInt 32 0 + 50: TypeVector 49(int) 4 + 51: TypePointer Function 50(ivec4) + 53: TypeImage 49(int) 2D sampled format:Unknown + 54: TypePointer UniformConstant 53 + 55(g_tTex2du4): 54(ptr) Variable UniformConstant + 58: TypeSampledImage 53 + 90: 29(int) Constant 2 + 112: 29(int) Constant 3 + 129: TypeImage 6(float) Cube sampled format:Unknown + 130: TypePointer UniformConstant 129 + 131(g_tTexcdf4): 130(ptr) Variable UniformConstant + 134: TypeSampledImage 129 + 136: TypePointer Uniform 25(fvec3) + 141: TypeImage 29(int) Cube sampled format:Unknown + 142: TypePointer UniformConstant 141 + 143(g_tTexcdi4): 142(ptr) Variable UniformConstant + 146: TypeSampledImage 141 + 152: TypeImage 49(int) Cube sampled format:Unknown + 153: TypePointer UniformConstant 152 + 154(g_tTexcdu4): 153(ptr) Variable UniformConstant + 157: TypeSampledImage 152 + 225: TypePointer Function 8(PS_OUTPUT) + 227: 6(float) Constant 1065353216 + 228: 7(fvec4) ConstantComposite 227 227 227 227 + 230: TypePointer Function 6(float) + 237: TypePointer Output 7(fvec4) +238(@entryPointOutput.Color): 237(ptr) Variable Output + 241: TypePointer Output 6(float) +242(@entryPointOutput.Depth): 241(ptr) Variable Output + 245(g_sSamp2d): 19(ptr) Variable UniformConstant + 246: TypeImage 6(float) 1D sampled format:Unknown + 247: TypePointer UniformConstant 246 +248(g_tTex1df4a): 247(ptr) Variable UniformConstant + 249(g_tTex1df4): 247(ptr) Variable UniformConstant + 250: TypeImage 29(int) 1D sampled format:Unknown + 251: TypePointer UniformConstant 250 + 252(g_tTex1di4): 251(ptr) Variable UniformConstant + 253: TypeImage 49(int) 1D sampled format:Unknown + 254: TypePointer UniformConstant 253 + 255(g_tTex1du4): 254(ptr) Variable UniformConstant + 256: TypeImage 6(float) 3D sampled format:Unknown + 257: TypePointer UniformConstant 256 + 258(g_tTex3df4): 257(ptr) Variable UniformConstant + 259: TypeImage 29(int) 3D sampled format:Unknown + 260: TypePointer UniformConstant 259 + 261(g_tTex3di4): 260(ptr) Variable UniformConstant + 262: TypeImage 49(int) 3D sampled format:Unknown + 263: TypePointer UniformConstant 262 + 264(g_tTex3du4): 263(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +235(flattenTemp): 225(ptr) Variable Function + 236:8(PS_OUTPUT) FunctionCall 10(@main() + Store 235(flattenTemp) 236 + 239: 12(ptr) AccessChain 235(flattenTemp) 34 + 240: 7(fvec4) Load 239 + Store 238(@entryPointOutput.Color) 240 + 243: 230(ptr) AccessChain 235(flattenTemp) 30 + 244: 6(float) Load 243 + Store 242(@entryPointOutput.Depth) 244 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval00): 12(ptr) Variable Function + 38(txval01): 37(ptr) Variable Function + 52(txval02): 51(ptr) Variable Function + 63(txval10): 12(ptr) Variable Function + 70(txval11): 37(ptr) Variable Function + 77(txval12): 51(ptr) Variable Function + 84(txval20): 12(ptr) Variable Function + 92(txval21): 37(ptr) Variable Function + 99(txval22): 51(ptr) Variable Function + 106(txval30): 12(ptr) Variable Function + 114(txval31): 37(ptr) Variable Function + 121(txval32): 51(ptr) Variable Function + 128(txval40): 12(ptr) Variable Function + 140(txval41): 37(ptr) Variable Function + 151(txval42): 51(ptr) Variable Function + 162(txval50): 12(ptr) Variable Function + 169(txval51): 37(ptr) Variable Function + 176(txval52): 51(ptr) Variable Function + 183(txval60): 12(ptr) Variable Function + 190(txval61): 37(ptr) Variable Function + 197(txval62): 51(ptr) Variable Function + 204(txval70): 12(ptr) Variable Function + 211(txval71): 37(ptr) Variable Function + 218(txval72): 51(ptr) Variable Function + 226(psout): 225(ptr) Variable Function + 17: 14 Load 16(g_tTex2df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 32: 31(ptr) AccessChain 28 30 + 33: 24(fvec2) Load 32 + 35: 7(fvec4) ImageGather 23 33 34 + Store 13(txval00) 35 + 42: 39 Load 41(g_tTex2di4) + 43: 18 Load 20(g_sSamp) + 45: 44 SampledImage 42 43 + 46: 31(ptr) AccessChain 28 30 + 47: 24(fvec2) Load 46 + 48: 36(ivec4) ImageGather 45 47 34 + Store 38(txval01) 48 + 56: 53 Load 55(g_tTex2du4) + 57: 18 Load 20(g_sSamp) + 59: 58 SampledImage 56 57 + 60: 31(ptr) AccessChain 28 30 + 61: 24(fvec2) Load 60 + 62: 50(ivec4) ImageGather 59 61 34 + Store 52(txval02) 62 + 64: 14 Load 16(g_tTex2df4) + 65: 18 Load 20(g_sSamp) + 66: 22 SampledImage 64 65 + 67: 31(ptr) AccessChain 28 30 + 68: 24(fvec2) Load 67 + 69: 7(fvec4) ImageGather 66 68 30 + Store 63(txval10) 69 + 71: 39 Load 41(g_tTex2di4) + 72: 18 Load 20(g_sSamp) + 73: 44 SampledImage 71 72 + 74: 31(ptr) AccessChain 28 30 + 75: 24(fvec2) Load 74 + 76: 36(ivec4) ImageGather 73 75 30 + Store 70(txval11) 76 + 78: 53 Load 55(g_tTex2du4) + 79: 18 Load 20(g_sSamp) + 80: 58 SampledImage 78 79 + 81: 31(ptr) AccessChain 28 30 + 82: 24(fvec2) Load 81 + 83: 50(ivec4) ImageGather 80 82 30 + Store 77(txval12) 83 + 85: 14 Load 16(g_tTex2df4) + 86: 18 Load 20(g_sSamp) + 87: 22 SampledImage 85 86 + 88: 31(ptr) AccessChain 28 30 + 89: 24(fvec2) Load 88 + 91: 7(fvec4) ImageGather 87 89 90 + Store 84(txval20) 91 + 93: 39 Load 41(g_tTex2di4) + 94: 18 Load 20(g_sSamp) + 95: 44 SampledImage 93 94 + 96: 31(ptr) AccessChain 28 30 + 97: 24(fvec2) Load 96 + 98: 36(ivec4) ImageGather 95 97 90 + Store 92(txval21) 98 + 100: 53 Load 55(g_tTex2du4) + 101: 18 Load 20(g_sSamp) + 102: 58 SampledImage 100 101 + 103: 31(ptr) AccessChain 28 30 + 104: 24(fvec2) Load 103 + 105: 50(ivec4) ImageGather 102 104 90 + Store 99(txval22) 105 + 107: 14 Load 16(g_tTex2df4) + 108: 18 Load 20(g_sSamp) + 109: 22 SampledImage 107 108 + 110: 31(ptr) AccessChain 28 30 + 111: 24(fvec2) Load 110 + 113: 7(fvec4) ImageGather 109 111 112 + Store 106(txval30) 113 + 115: 39 Load 41(g_tTex2di4) + 116: 18 Load 20(g_sSamp) + 117: 44 SampledImage 115 116 + 118: 31(ptr) AccessChain 28 30 + 119: 24(fvec2) Load 118 + 120: 36(ivec4) ImageGather 117 119 112 + Store 114(txval31) 120 + 122: 53 Load 55(g_tTex2du4) + 123: 18 Load 20(g_sSamp) + 124: 58 SampledImage 122 123 + 125: 31(ptr) AccessChain 28 30 + 126: 24(fvec2) Load 125 + 127: 50(ivec4) ImageGather 124 126 112 + Store 121(txval32) 127 + 132: 129 Load 131(g_tTexcdf4) + 133: 18 Load 20(g_sSamp) + 135: 134 SampledImage 132 133 + 137: 136(ptr) AccessChain 28 90 + 138: 25(fvec3) Load 137 + 139: 7(fvec4) ImageGather 135 138 34 + Store 128(txval40) 139 + 144: 141 Load 143(g_tTexcdi4) + 145: 18 Load 20(g_sSamp) + 147: 146 SampledImage 144 145 + 148: 136(ptr) AccessChain 28 90 + 149: 25(fvec3) Load 148 + 150: 36(ivec4) ImageGather 147 149 34 + Store 140(txval41) 150 + 155: 152 Load 154(g_tTexcdu4) + 156: 18 Load 20(g_sSamp) + 158: 157 SampledImage 155 156 + 159: 136(ptr) AccessChain 28 90 + 160: 25(fvec3) Load 159 + 161: 50(ivec4) ImageGather 158 160 34 + Store 151(txval42) 161 + 163: 129 Load 131(g_tTexcdf4) + 164: 18 Load 20(g_sSamp) + 165: 134 SampledImage 163 164 + 166: 136(ptr) AccessChain 28 90 + 167: 25(fvec3) Load 166 + 168: 7(fvec4) ImageGather 165 167 30 + Store 162(txval50) 168 + 170: 141 Load 143(g_tTexcdi4) + 171: 18 Load 20(g_sSamp) + 172: 146 SampledImage 170 171 + 173: 136(ptr) AccessChain 28 90 + 174: 25(fvec3) Load 173 + 175: 36(ivec4) ImageGather 172 174 30 + Store 169(txval51) 175 + 177: 152 Load 154(g_tTexcdu4) + 178: 18 Load 20(g_sSamp) + 179: 157 SampledImage 177 178 + 180: 136(ptr) AccessChain 28 90 + 181: 25(fvec3) Load 180 + 182: 50(ivec4) ImageGather 179 181 30 + Store 176(txval52) 182 + 184: 129 Load 131(g_tTexcdf4) + 185: 18 Load 20(g_sSamp) + 186: 134 SampledImage 184 185 + 187: 136(ptr) AccessChain 28 90 + 188: 25(fvec3) Load 187 + 189: 7(fvec4) ImageGather 186 188 90 + Store 183(txval60) 189 + 191: 141 Load 143(g_tTexcdi4) + 192: 18 Load 20(g_sSamp) + 193: 146 SampledImage 191 192 + 194: 136(ptr) AccessChain 28 90 + 195: 25(fvec3) Load 194 + 196: 36(ivec4) ImageGather 193 195 90 + Store 190(txval61) 196 + 198: 152 Load 154(g_tTexcdu4) + 199: 18 Load 20(g_sSamp) + 200: 157 SampledImage 198 199 + 201: 136(ptr) AccessChain 28 90 + 202: 25(fvec3) Load 201 + 203: 50(ivec4) ImageGather 200 202 90 + Store 197(txval62) 203 + 205: 129 Load 131(g_tTexcdf4) + 206: 18 Load 20(g_sSamp) + 207: 134 SampledImage 205 206 + 208: 136(ptr) AccessChain 28 90 + 209: 25(fvec3) Load 208 + 210: 7(fvec4) ImageGather 207 209 112 + Store 204(txval70) 210 + 212: 141 Load 143(g_tTexcdi4) + 213: 18 Load 20(g_sSamp) + 214: 146 SampledImage 212 213 + 215: 136(ptr) AccessChain 28 90 + 216: 25(fvec3) Load 215 + 217: 36(ivec4) ImageGather 214 216 112 + Store 211(txval71) 217 + 219: 152 Load 154(g_tTexcdu4) + 220: 18 Load 20(g_sSamp) + 221: 157 SampledImage 219 220 + 222: 136(ptr) AccessChain 28 90 + 223: 25(fvec3) Load 222 + 224: 50(ivec4) ImageGather 221 223 112 + Store 218(txval72) 224 + 229: 12(ptr) AccessChain 226(psout) 34 + Store 229 228 + 231: 230(ptr) AccessChain 226(psout) 30 + Store 231 227 + 232:8(PS_OUTPUT) Load 226(psout) + ReturnValue 232 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out new file mode 100644 index 00000000..33c9af43 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out @@ -0,0 +1,1796 @@ +hlsl.gatherRGBA.offset.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:39 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 Function Parameters: +0:? Sequence +0:46 Sequence +0:46 move second child to first child ( temp 4-component vector of float) +0:46 'txval001' ( temp 4-component vector of float) +0:46 textureGatherOffset ( temp 4-component vector of float) +0:46 Construct combined texture-sampler ( temp sampler2D) +0:46 'g_tTex2df4' ( uniform texture2D) +0:46 'g_sSamp' (layout( binding=0) uniform sampler) +0:46 c2: direct index for structure ( uniform 2-component vector of float) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:46 Constant: +0:46 1 (const uint) +0:46 o2: direct index for structure ( uniform 2-component vector of int) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:46 Constant: +0:46 5 (const uint) +0:46 Constant: +0:46 0 (const int) +0:47 Sequence +0:47 move second child to first child ( temp 4-component vector of int) +0:47 'txval011' ( temp 4-component vector of int) +0:47 textureGatherOffset ( temp 4-component vector of int) +0:47 Construct combined texture-sampler ( temp isampler2D) +0:47 'g_tTex2di4' ( uniform itexture2D) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 c2: direct index for structure ( uniform 2-component vector of float) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:47 Constant: +0:47 1 (const uint) +0:47 o2: direct index for structure ( uniform 2-component vector of int) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:47 Constant: +0:47 5 (const uint) +0:47 Constant: +0:47 0 (const int) +0:48 Sequence +0:48 move second child to first child ( temp 4-component vector of uint) +0:48 'txval021' ( temp 4-component vector of uint) +0:48 textureGatherOffset ( temp 4-component vector of uint) +0:48 Construct combined texture-sampler ( temp usampler2D) +0:48 'g_tTex2du4' ( uniform utexture2D) +0:48 'g_sSamp' (layout( binding=0) uniform sampler) +0:48 c2: direct index for structure ( uniform 2-component vector of float) +0:48 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:48 Constant: +0:48 1 (const uint) +0:48 o2: direct index for structure ( uniform 2-component vector of int) +0:48 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:48 Constant: +0:48 5 (const uint) +0:48 Constant: +0:48 0 (const int) +0:50 Sequence +0:50 move second child to first child ( temp 4-component vector of float) +0:50 'txval004' ( temp 4-component vector of float) +0:50 textureGatherOffsets ( temp 4-component vector of float) +0:50 Construct combined texture-sampler ( temp sampler2D) +0:50 'g_tTex2df4' ( uniform texture2D) +0:50 'g_sSamp' (layout( binding=0) uniform sampler) +0:50 c2: direct index for structure ( uniform 2-component vector of float) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:50 Constant: +0:50 1 (const uint) +0:50 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:50 o2: direct index for structure ( uniform 2-component vector of int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:50 Constant: +0:50 5 (const uint) +0:50 o2: direct index for structure ( uniform 2-component vector of int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:50 Constant: +0:50 5 (const uint) +0:50 o2: direct index for structure ( uniform 2-component vector of int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:50 Constant: +0:50 5 (const uint) +0:50 o2: direct index for structure ( uniform 2-component vector of int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:50 Constant: +0:50 5 (const uint) +0:50 Constant: +0:50 0 (const int) +0:51 Sequence +0:51 move second child to first child ( temp 4-component vector of int) +0:51 'txval014' ( temp 4-component vector of int) +0:51 textureGatherOffsets ( temp 4-component vector of int) +0:51 Construct combined texture-sampler ( temp isampler2D) +0:51 'g_tTex2di4' ( uniform itexture2D) +0:51 'g_sSamp' (layout( binding=0) uniform sampler) +0:51 c2: direct index for structure ( uniform 2-component vector of float) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:51 Constant: +0:51 1 (const uint) +0:51 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:51 o2: direct index for structure ( uniform 2-component vector of int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:51 Constant: +0:51 5 (const uint) +0:51 o2: direct index for structure ( uniform 2-component vector of int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:51 Constant: +0:51 5 (const uint) +0:51 o2: direct index for structure ( uniform 2-component vector of int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:51 Constant: +0:51 5 (const uint) +0:51 o2: direct index for structure ( uniform 2-component vector of int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:51 Constant: +0:51 5 (const uint) +0:51 Constant: +0:51 0 (const int) +0:52 Sequence +0:52 move second child to first child ( temp 4-component vector of uint) +0:52 'txval024' ( temp 4-component vector of uint) +0:52 textureGatherOffsets ( temp 4-component vector of uint) +0:52 Construct combined texture-sampler ( temp usampler2D) +0:52 'g_tTex2du4' ( uniform utexture2D) +0:52 'g_sSamp' (layout( binding=0) uniform sampler) +0:52 c2: direct index for structure ( uniform 2-component vector of float) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 1 (const uint) +0:52 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:52 o2: direct index for structure ( uniform 2-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 5 (const uint) +0:52 o2: direct index for structure ( uniform 2-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 5 (const uint) +0:52 o2: direct index for structure ( uniform 2-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 5 (const uint) +0:52 o2: direct index for structure ( uniform 2-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 5 (const uint) +0:52 Constant: +0:52 0 (const int) +0:62 Sequence +0:62 move second child to first child ( temp 4-component vector of float) +0:62 'txval101' ( temp 4-component vector of float) +0:62 textureGatherOffset ( temp 4-component vector of float) +0:62 Construct combined texture-sampler ( temp sampler2D) +0:62 'g_tTex2df4' ( uniform texture2D) +0:62 'g_sSamp' (layout( binding=0) uniform sampler) +0:62 c2: direct index for structure ( uniform 2-component vector of float) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 1 (const uint) +0:62 o2: direct index for structure ( uniform 2-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 5 (const uint) +0:62 Constant: +0:62 1 (const int) +0:63 Sequence +0:63 move second child to first child ( temp 4-component vector of int) +0:63 'txval111' ( temp 4-component vector of int) +0:63 textureGatherOffset ( temp 4-component vector of int) +0:63 Construct combined texture-sampler ( temp isampler2D) +0:63 'g_tTex2di4' ( uniform itexture2D) +0:63 'g_sSamp' (layout( binding=0) uniform sampler) +0:63 c2: direct index for structure ( uniform 2-component vector of float) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:63 Constant: +0:63 1 (const uint) +0:63 o2: direct index for structure ( uniform 2-component vector of int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:63 Constant: +0:63 5 (const uint) +0:63 Constant: +0:63 1 (const int) +0:64 Sequence +0:64 move second child to first child ( temp 4-component vector of uint) +0:64 'txval121' ( temp 4-component vector of uint) +0:64 textureGatherOffset ( temp 4-component vector of uint) +0:64 Construct combined texture-sampler ( temp usampler2D) +0:64 'g_tTex2du4' ( uniform utexture2D) +0:64 'g_sSamp' (layout( binding=0) uniform sampler) +0:64 c2: direct index for structure ( uniform 2-component vector of float) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:64 Constant: +0:64 1 (const uint) +0:64 o2: direct index for structure ( uniform 2-component vector of int) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:64 Constant: +0:64 5 (const uint) +0:64 Constant: +0:64 1 (const int) +0:66 Sequence +0:66 move second child to first child ( temp 4-component vector of float) +0:66 'txval104' ( temp 4-component vector of float) +0:66 textureGatherOffsets ( temp 4-component vector of float) +0:66 Construct combined texture-sampler ( temp sampler2D) +0:66 'g_tTex2df4' ( uniform texture2D) +0:66 'g_sSamp' (layout( binding=0) uniform sampler) +0:66 c2: direct index for structure ( uniform 2-component vector of float) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:66 Constant: +0:66 1 (const uint) +0:66 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:66 o2: direct index for structure ( uniform 2-component vector of int) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:66 Constant: +0:66 5 (const uint) +0:66 o2: direct index for structure ( uniform 2-component vector of int) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:66 Constant: +0:66 5 (const uint) +0:66 o2: direct index for structure ( uniform 2-component vector of int) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:66 Constant: +0:66 5 (const uint) +0:66 o2: direct index for structure ( uniform 2-component vector of int) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:66 Constant: +0:66 5 (const uint) +0:66 Constant: +0:66 1 (const int) +0:67 Sequence +0:67 move second child to first child ( temp 4-component vector of int) +0:67 'txval114' ( temp 4-component vector of int) +0:67 textureGatherOffsets ( temp 4-component vector of int) +0:67 Construct combined texture-sampler ( temp isampler2D) +0:67 'g_tTex2di4' ( uniform itexture2D) +0:67 'g_sSamp' (layout( binding=0) uniform sampler) +0:67 c2: direct index for structure ( uniform 2-component vector of float) +0:67 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:67 Constant: +0:67 1 (const uint) +0:67 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:67 o2: direct index for structure ( uniform 2-component vector of int) +0:67 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:67 Constant: +0:67 5 (const uint) +0:67 o2: direct index for structure ( uniform 2-component vector of int) +0:67 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:67 Constant: +0:67 5 (const uint) +0:67 o2: direct index for structure ( uniform 2-component vector of int) +0:67 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:67 Constant: +0:67 5 (const uint) +0:67 o2: direct index for structure ( uniform 2-component vector of int) +0:67 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:67 Constant: +0:67 5 (const uint) +0:67 Constant: +0:67 1 (const int) +0:68 Sequence +0:68 move second child to first child ( temp 4-component vector of uint) +0:68 'txval124' ( temp 4-component vector of uint) +0:68 textureGatherOffsets ( temp 4-component vector of uint) +0:68 Construct combined texture-sampler ( temp usampler2D) +0:68 'g_tTex2du4' ( uniform utexture2D) +0:68 'g_sSamp' (layout( binding=0) uniform sampler) +0:68 c2: direct index for structure ( uniform 2-component vector of float) +0:68 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:68 Constant: +0:68 1 (const uint) +0:68 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:68 o2: direct index for structure ( uniform 2-component vector of int) +0:68 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:68 Constant: +0:68 5 (const uint) +0:68 o2: direct index for structure ( uniform 2-component vector of int) +0:68 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:68 Constant: +0:68 5 (const uint) +0:68 o2: direct index for structure ( uniform 2-component vector of int) +0:68 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:68 Constant: +0:68 5 (const uint) +0:68 o2: direct index for structure ( uniform 2-component vector of int) +0:68 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:68 Constant: +0:68 5 (const uint) +0:68 Constant: +0:68 1 (const int) +0:78 Sequence +0:78 move second child to first child ( temp 4-component vector of float) +0:78 'txval201' ( temp 4-component vector of float) +0:78 textureGatherOffset ( temp 4-component vector of float) +0:78 Construct combined texture-sampler ( temp sampler2D) +0:78 'g_tTex2df4' ( uniform texture2D) +0:78 'g_sSamp' (layout( binding=0) uniform sampler) +0:78 c2: direct index for structure ( uniform 2-component vector of float) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:78 Constant: +0:78 1 (const uint) +0:78 o2: direct index for structure ( uniform 2-component vector of int) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:78 Constant: +0:78 5 (const uint) +0:78 Constant: +0:78 2 (const int) +0:79 Sequence +0:79 move second child to first child ( temp 4-component vector of int) +0:79 'txval211' ( temp 4-component vector of int) +0:79 textureGatherOffset ( temp 4-component vector of int) +0:79 Construct combined texture-sampler ( temp isampler2D) +0:79 'g_tTex2di4' ( uniform itexture2D) +0:79 'g_sSamp' (layout( binding=0) uniform sampler) +0:79 c2: direct index for structure ( uniform 2-component vector of float) +0:79 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:79 Constant: +0:79 1 (const uint) +0:79 o2: direct index for structure ( uniform 2-component vector of int) +0:79 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:79 Constant: +0:79 5 (const uint) +0:79 Constant: +0:79 2 (const int) +0:80 Sequence +0:80 move second child to first child ( temp 4-component vector of uint) +0:80 'txval221' ( temp 4-component vector of uint) +0:80 textureGatherOffset ( temp 4-component vector of uint) +0:80 Construct combined texture-sampler ( temp usampler2D) +0:80 'g_tTex2du4' ( uniform utexture2D) +0:80 'g_sSamp' (layout( binding=0) uniform sampler) +0:80 c2: direct index for structure ( uniform 2-component vector of float) +0:80 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:80 Constant: +0:80 1 (const uint) +0:80 o2: direct index for structure ( uniform 2-component vector of int) +0:80 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:80 Constant: +0:80 5 (const uint) +0:80 Constant: +0:80 2 (const int) +0:82 Sequence +0:82 move second child to first child ( temp 4-component vector of float) +0:82 'txval204' ( temp 4-component vector of float) +0:82 textureGatherOffsets ( temp 4-component vector of float) +0:82 Construct combined texture-sampler ( temp sampler2D) +0:82 'g_tTex2df4' ( uniform texture2D) +0:82 'g_sSamp' (layout( binding=0) uniform sampler) +0:82 c2: direct index for structure ( uniform 2-component vector of float) +0:82 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:82 Constant: +0:82 1 (const uint) +0:82 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:82 o2: direct index for structure ( uniform 2-component vector of int) +0:82 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:82 Constant: +0:82 5 (const uint) +0:82 o2: direct index for structure ( uniform 2-component vector of int) +0:82 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:82 Constant: +0:82 5 (const uint) +0:82 o2: direct index for structure ( uniform 2-component vector of int) +0:82 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:82 Constant: +0:82 5 (const uint) +0:82 o2: direct index for structure ( uniform 2-component vector of int) +0:82 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:82 Constant: +0:82 5 (const uint) +0:82 Constant: +0:82 2 (const int) +0:83 Sequence +0:83 move second child to first child ( temp 4-component vector of int) +0:83 'txval214' ( temp 4-component vector of int) +0:83 textureGatherOffsets ( temp 4-component vector of int) +0:83 Construct combined texture-sampler ( temp isampler2D) +0:83 'g_tTex2di4' ( uniform itexture2D) +0:83 'g_sSamp' (layout( binding=0) uniform sampler) +0:83 c2: direct index for structure ( uniform 2-component vector of float) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:83 Constant: +0:83 1 (const uint) +0:83 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:83 o2: direct index for structure ( uniform 2-component vector of int) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:83 Constant: +0:83 5 (const uint) +0:83 o2: direct index for structure ( uniform 2-component vector of int) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:83 Constant: +0:83 5 (const uint) +0:83 o2: direct index for structure ( uniform 2-component vector of int) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:83 Constant: +0:83 5 (const uint) +0:83 o2: direct index for structure ( uniform 2-component vector of int) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:83 Constant: +0:83 5 (const uint) +0:83 Constant: +0:83 2 (const int) +0:84 Sequence +0:84 move second child to first child ( temp 4-component vector of uint) +0:84 'txval224' ( temp 4-component vector of uint) +0:84 textureGatherOffsets ( temp 4-component vector of uint) +0:84 Construct combined texture-sampler ( temp usampler2D) +0:84 'g_tTex2du4' ( uniform utexture2D) +0:84 'g_sSamp' (layout( binding=0) uniform sampler) +0:84 c2: direct index for structure ( uniform 2-component vector of float) +0:84 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:84 Constant: +0:84 1 (const uint) +0:84 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:84 o2: direct index for structure ( uniform 2-component vector of int) +0:84 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:84 Constant: +0:84 5 (const uint) +0:84 o2: direct index for structure ( uniform 2-component vector of int) +0:84 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:84 Constant: +0:84 5 (const uint) +0:84 o2: direct index for structure ( uniform 2-component vector of int) +0:84 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:84 Constant: +0:84 5 (const uint) +0:84 o2: direct index for structure ( uniform 2-component vector of int) +0:84 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:84 Constant: +0:84 5 (const uint) +0:84 Constant: +0:84 2 (const int) +0:94 Sequence +0:94 move second child to first child ( temp 4-component vector of float) +0:94 'txval301' ( temp 4-component vector of float) +0:94 textureGatherOffset ( temp 4-component vector of float) +0:94 Construct combined texture-sampler ( temp sampler2D) +0:94 'g_tTex2df4' ( uniform texture2D) +0:94 'g_sSamp' (layout( binding=0) uniform sampler) +0:94 c2: direct index for structure ( uniform 2-component vector of float) +0:94 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:94 Constant: +0:94 1 (const uint) +0:94 o2: direct index for structure ( uniform 2-component vector of int) +0:94 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:94 Constant: +0:94 5 (const uint) +0:94 Constant: +0:94 3 (const int) +0:95 Sequence +0:95 move second child to first child ( temp 4-component vector of int) +0:95 'txval311' ( temp 4-component vector of int) +0:95 textureGatherOffset ( temp 4-component vector of int) +0:95 Construct combined texture-sampler ( temp isampler2D) +0:95 'g_tTex2di4' ( uniform itexture2D) +0:95 'g_sSamp' (layout( binding=0) uniform sampler) +0:95 c2: direct index for structure ( uniform 2-component vector of float) +0:95 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:95 Constant: +0:95 1 (const uint) +0:95 o2: direct index for structure ( uniform 2-component vector of int) +0:95 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:95 Constant: +0:95 5 (const uint) +0:95 Constant: +0:95 3 (const int) +0:96 Sequence +0:96 move second child to first child ( temp 4-component vector of uint) +0:96 'txval321' ( temp 4-component vector of uint) +0:96 textureGatherOffset ( temp 4-component vector of uint) +0:96 Construct combined texture-sampler ( temp usampler2D) +0:96 'g_tTex2du4' ( uniform utexture2D) +0:96 'g_sSamp' (layout( binding=0) uniform sampler) +0:96 c2: direct index for structure ( uniform 2-component vector of float) +0:96 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:96 Constant: +0:96 1 (const uint) +0:96 o2: direct index for structure ( uniform 2-component vector of int) +0:96 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:96 Constant: +0:96 5 (const uint) +0:96 Constant: +0:96 3 (const int) +0:98 Sequence +0:98 move second child to first child ( temp 4-component vector of float) +0:98 'txval304' ( temp 4-component vector of float) +0:98 textureGatherOffsets ( temp 4-component vector of float) +0:98 Construct combined texture-sampler ( temp sampler2D) +0:98 'g_tTex2df4' ( uniform texture2D) +0:98 'g_sSamp' (layout( binding=0) uniform sampler) +0:98 c2: direct index for structure ( uniform 2-component vector of float) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:98 Constant: +0:98 1 (const uint) +0:98 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:98 o2: direct index for structure ( uniform 2-component vector of int) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:98 Constant: +0:98 5 (const uint) +0:98 o2: direct index for structure ( uniform 2-component vector of int) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:98 Constant: +0:98 5 (const uint) +0:98 o2: direct index for structure ( uniform 2-component vector of int) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:98 Constant: +0:98 5 (const uint) +0:98 o2: direct index for structure ( uniform 2-component vector of int) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:98 Constant: +0:98 5 (const uint) +0:98 Constant: +0:98 3 (const int) +0:99 Sequence +0:99 move second child to first child ( temp 4-component vector of int) +0:99 'txval314' ( temp 4-component vector of int) +0:99 textureGatherOffsets ( temp 4-component vector of int) +0:99 Construct combined texture-sampler ( temp isampler2D) +0:99 'g_tTex2di4' ( uniform itexture2D) +0:99 'g_sSamp' (layout( binding=0) uniform sampler) +0:99 c2: direct index for structure ( uniform 2-component vector of float) +0:99 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:99 Constant: +0:99 1 (const uint) +0:99 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:99 o2: direct index for structure ( uniform 2-component vector of int) +0:99 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:99 Constant: +0:99 5 (const uint) +0:99 o2: direct index for structure ( uniform 2-component vector of int) +0:99 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:99 Constant: +0:99 5 (const uint) +0:99 o2: direct index for structure ( uniform 2-component vector of int) +0:99 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:99 Constant: +0:99 5 (const uint) +0:99 o2: direct index for structure ( uniform 2-component vector of int) +0:99 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:99 Constant: +0:99 5 (const uint) +0:99 Constant: +0:99 3 (const int) +0:100 Sequence +0:100 move second child to first child ( temp 4-component vector of uint) +0:100 'txval324' ( temp 4-component vector of uint) +0:100 textureGatherOffsets ( temp 4-component vector of uint) +0:100 Construct combined texture-sampler ( temp usampler2D) +0:100 'g_tTex2du4' ( uniform utexture2D) +0:100 'g_sSamp' (layout( binding=0) uniform sampler) +0:100 c2: direct index for structure ( uniform 2-component vector of float) +0:100 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:100 Constant: +0:100 1 (const uint) +0:100 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:100 o2: direct index for structure ( uniform 2-component vector of int) +0:100 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:100 Constant: +0:100 5 (const uint) +0:100 o2: direct index for structure ( uniform 2-component vector of int) +0:100 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:100 Constant: +0:100 5 (const uint) +0:100 o2: direct index for structure ( uniform 2-component vector of int) +0:100 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:100 Constant: +0:100 5 (const uint) +0:100 o2: direct index for structure ( uniform 2-component vector of int) +0:100 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:100 Constant: +0:100 5 (const uint) +0:100 Constant: +0:100 3 (const int) +0:112 move second child to first child ( temp 4-component vector of float) +0:112 Color: direct index for structure ( temp 4-component vector of float) +0:112 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1.000000 +0:112 1.000000 +0:112 1.000000 +0:112 1.000000 +0:113 move second child to first child ( temp float) +0:113 Depth: direct index for structure ( temp float) +0:113 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:113 Constant: +0:113 1 (const int) +0:113 Constant: +0:113 1.000000 +0:115 Branch: Return with expression +0:115 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 Function Definition: main( ( temp void) +0:39 Function Parameters: +0:? Sequence +0:39 Sequence +0:39 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:39 Color: direct index for structure ( temp 4-component vector of float) +0:39 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 Constant: +0:39 0 (const int) +0:39 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:39 Depth: direct index for structure ( temp float) +0:39 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 Constant: +0:39 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_sSamp2d' ( uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:39 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 Function Parameters: +0:? Sequence +0:46 Sequence +0:46 move second child to first child ( temp 4-component vector of float) +0:46 'txval001' ( temp 4-component vector of float) +0:46 textureGatherOffset ( temp 4-component vector of float) +0:46 Construct combined texture-sampler ( temp sampler2D) +0:46 'g_tTex2df4' ( uniform texture2D) +0:46 'g_sSamp' (layout( binding=0) uniform sampler) +0:46 c2: direct index for structure ( uniform 2-component vector of float) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:46 Constant: +0:46 1 (const uint) +0:46 o2: direct index for structure ( uniform 2-component vector of int) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:46 Constant: +0:46 5 (const uint) +0:46 Constant: +0:46 0 (const int) +0:47 Sequence +0:47 move second child to first child ( temp 4-component vector of int) +0:47 'txval011' ( temp 4-component vector of int) +0:47 textureGatherOffset ( temp 4-component vector of int) +0:47 Construct combined texture-sampler ( temp isampler2D) +0:47 'g_tTex2di4' ( uniform itexture2D) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 c2: direct index for structure ( uniform 2-component vector of float) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:47 Constant: +0:47 1 (const uint) +0:47 o2: direct index for structure ( uniform 2-component vector of int) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:47 Constant: +0:47 5 (const uint) +0:47 Constant: +0:47 0 (const int) +0:48 Sequence +0:48 move second child to first child ( temp 4-component vector of uint) +0:48 'txval021' ( temp 4-component vector of uint) +0:48 textureGatherOffset ( temp 4-component vector of uint) +0:48 Construct combined texture-sampler ( temp usampler2D) +0:48 'g_tTex2du4' ( uniform utexture2D) +0:48 'g_sSamp' (layout( binding=0) uniform sampler) +0:48 c2: direct index for structure ( uniform 2-component vector of float) +0:48 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:48 Constant: +0:48 1 (const uint) +0:48 o2: direct index for structure ( uniform 2-component vector of int) +0:48 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:48 Constant: +0:48 5 (const uint) +0:48 Constant: +0:48 0 (const int) +0:50 Sequence +0:50 move second child to first child ( temp 4-component vector of float) +0:50 'txval004' ( temp 4-component vector of float) +0:50 textureGatherOffsets ( temp 4-component vector of float) +0:50 Construct combined texture-sampler ( temp sampler2D) +0:50 'g_tTex2df4' ( uniform texture2D) +0:50 'g_sSamp' (layout( binding=0) uniform sampler) +0:50 c2: direct index for structure ( uniform 2-component vector of float) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:50 Constant: +0:50 1 (const uint) +0:50 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:50 o2: direct index for structure ( uniform 2-component vector of int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:50 Constant: +0:50 5 (const uint) +0:50 o2: direct index for structure ( uniform 2-component vector of int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:50 Constant: +0:50 5 (const uint) +0:50 o2: direct index for structure ( uniform 2-component vector of int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:50 Constant: +0:50 5 (const uint) +0:50 o2: direct index for structure ( uniform 2-component vector of int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:50 Constant: +0:50 5 (const uint) +0:50 Constant: +0:50 0 (const int) +0:51 Sequence +0:51 move second child to first child ( temp 4-component vector of int) +0:51 'txval014' ( temp 4-component vector of int) +0:51 textureGatherOffsets ( temp 4-component vector of int) +0:51 Construct combined texture-sampler ( temp isampler2D) +0:51 'g_tTex2di4' ( uniform itexture2D) +0:51 'g_sSamp' (layout( binding=0) uniform sampler) +0:51 c2: direct index for structure ( uniform 2-component vector of float) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:51 Constant: +0:51 1 (const uint) +0:51 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:51 o2: direct index for structure ( uniform 2-component vector of int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:51 Constant: +0:51 5 (const uint) +0:51 o2: direct index for structure ( uniform 2-component vector of int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:51 Constant: +0:51 5 (const uint) +0:51 o2: direct index for structure ( uniform 2-component vector of int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:51 Constant: +0:51 5 (const uint) +0:51 o2: direct index for structure ( uniform 2-component vector of int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:51 Constant: +0:51 5 (const uint) +0:51 Constant: +0:51 0 (const int) +0:52 Sequence +0:52 move second child to first child ( temp 4-component vector of uint) +0:52 'txval024' ( temp 4-component vector of uint) +0:52 textureGatherOffsets ( temp 4-component vector of uint) +0:52 Construct combined texture-sampler ( temp usampler2D) +0:52 'g_tTex2du4' ( uniform utexture2D) +0:52 'g_sSamp' (layout( binding=0) uniform sampler) +0:52 c2: direct index for structure ( uniform 2-component vector of float) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 1 (const uint) +0:52 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:52 o2: direct index for structure ( uniform 2-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 5 (const uint) +0:52 o2: direct index for structure ( uniform 2-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 5 (const uint) +0:52 o2: direct index for structure ( uniform 2-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 5 (const uint) +0:52 o2: direct index for structure ( uniform 2-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 5 (const uint) +0:52 Constant: +0:52 0 (const int) +0:62 Sequence +0:62 move second child to first child ( temp 4-component vector of float) +0:62 'txval101' ( temp 4-component vector of float) +0:62 textureGatherOffset ( temp 4-component vector of float) +0:62 Construct combined texture-sampler ( temp sampler2D) +0:62 'g_tTex2df4' ( uniform texture2D) +0:62 'g_sSamp' (layout( binding=0) uniform sampler) +0:62 c2: direct index for structure ( uniform 2-component vector of float) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 1 (const uint) +0:62 o2: direct index for structure ( uniform 2-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 5 (const uint) +0:62 Constant: +0:62 1 (const int) +0:63 Sequence +0:63 move second child to first child ( temp 4-component vector of int) +0:63 'txval111' ( temp 4-component vector of int) +0:63 textureGatherOffset ( temp 4-component vector of int) +0:63 Construct combined texture-sampler ( temp isampler2D) +0:63 'g_tTex2di4' ( uniform itexture2D) +0:63 'g_sSamp' (layout( binding=0) uniform sampler) +0:63 c2: direct index for structure ( uniform 2-component vector of float) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:63 Constant: +0:63 1 (const uint) +0:63 o2: direct index for structure ( uniform 2-component vector of int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:63 Constant: +0:63 5 (const uint) +0:63 Constant: +0:63 1 (const int) +0:64 Sequence +0:64 move second child to first child ( temp 4-component vector of uint) +0:64 'txval121' ( temp 4-component vector of uint) +0:64 textureGatherOffset ( temp 4-component vector of uint) +0:64 Construct combined texture-sampler ( temp usampler2D) +0:64 'g_tTex2du4' ( uniform utexture2D) +0:64 'g_sSamp' (layout( binding=0) uniform sampler) +0:64 c2: direct index for structure ( uniform 2-component vector of float) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:64 Constant: +0:64 1 (const uint) +0:64 o2: direct index for structure ( uniform 2-component vector of int) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:64 Constant: +0:64 5 (const uint) +0:64 Constant: +0:64 1 (const int) +0:66 Sequence +0:66 move second child to first child ( temp 4-component vector of float) +0:66 'txval104' ( temp 4-component vector of float) +0:66 textureGatherOffsets ( temp 4-component vector of float) +0:66 Construct combined texture-sampler ( temp sampler2D) +0:66 'g_tTex2df4' ( uniform texture2D) +0:66 'g_sSamp' (layout( binding=0) uniform sampler) +0:66 c2: direct index for structure ( uniform 2-component vector of float) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:66 Constant: +0:66 1 (const uint) +0:66 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:66 o2: direct index for structure ( uniform 2-component vector of int) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:66 Constant: +0:66 5 (const uint) +0:66 o2: direct index for structure ( uniform 2-component vector of int) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:66 Constant: +0:66 5 (const uint) +0:66 o2: direct index for structure ( uniform 2-component vector of int) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:66 Constant: +0:66 5 (const uint) +0:66 o2: direct index for structure ( uniform 2-component vector of int) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:66 Constant: +0:66 5 (const uint) +0:66 Constant: +0:66 1 (const int) +0:67 Sequence +0:67 move second child to first child ( temp 4-component vector of int) +0:67 'txval114' ( temp 4-component vector of int) +0:67 textureGatherOffsets ( temp 4-component vector of int) +0:67 Construct combined texture-sampler ( temp isampler2D) +0:67 'g_tTex2di4' ( uniform itexture2D) +0:67 'g_sSamp' (layout( binding=0) uniform sampler) +0:67 c2: direct index for structure ( uniform 2-component vector of float) +0:67 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:67 Constant: +0:67 1 (const uint) +0:67 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:67 o2: direct index for structure ( uniform 2-component vector of int) +0:67 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:67 Constant: +0:67 5 (const uint) +0:67 o2: direct index for structure ( uniform 2-component vector of int) +0:67 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:67 Constant: +0:67 5 (const uint) +0:67 o2: direct index for structure ( uniform 2-component vector of int) +0:67 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:67 Constant: +0:67 5 (const uint) +0:67 o2: direct index for structure ( uniform 2-component vector of int) +0:67 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:67 Constant: +0:67 5 (const uint) +0:67 Constant: +0:67 1 (const int) +0:68 Sequence +0:68 move second child to first child ( temp 4-component vector of uint) +0:68 'txval124' ( temp 4-component vector of uint) +0:68 textureGatherOffsets ( temp 4-component vector of uint) +0:68 Construct combined texture-sampler ( temp usampler2D) +0:68 'g_tTex2du4' ( uniform utexture2D) +0:68 'g_sSamp' (layout( binding=0) uniform sampler) +0:68 c2: direct index for structure ( uniform 2-component vector of float) +0:68 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:68 Constant: +0:68 1 (const uint) +0:68 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:68 o2: direct index for structure ( uniform 2-component vector of int) +0:68 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:68 Constant: +0:68 5 (const uint) +0:68 o2: direct index for structure ( uniform 2-component vector of int) +0:68 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:68 Constant: +0:68 5 (const uint) +0:68 o2: direct index for structure ( uniform 2-component vector of int) +0:68 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:68 Constant: +0:68 5 (const uint) +0:68 o2: direct index for structure ( uniform 2-component vector of int) +0:68 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:68 Constant: +0:68 5 (const uint) +0:68 Constant: +0:68 1 (const int) +0:78 Sequence +0:78 move second child to first child ( temp 4-component vector of float) +0:78 'txval201' ( temp 4-component vector of float) +0:78 textureGatherOffset ( temp 4-component vector of float) +0:78 Construct combined texture-sampler ( temp sampler2D) +0:78 'g_tTex2df4' ( uniform texture2D) +0:78 'g_sSamp' (layout( binding=0) uniform sampler) +0:78 c2: direct index for structure ( uniform 2-component vector of float) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:78 Constant: +0:78 1 (const uint) +0:78 o2: direct index for structure ( uniform 2-component vector of int) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:78 Constant: +0:78 5 (const uint) +0:78 Constant: +0:78 2 (const int) +0:79 Sequence +0:79 move second child to first child ( temp 4-component vector of int) +0:79 'txval211' ( temp 4-component vector of int) +0:79 textureGatherOffset ( temp 4-component vector of int) +0:79 Construct combined texture-sampler ( temp isampler2D) +0:79 'g_tTex2di4' ( uniform itexture2D) +0:79 'g_sSamp' (layout( binding=0) uniform sampler) +0:79 c2: direct index for structure ( uniform 2-component vector of float) +0:79 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:79 Constant: +0:79 1 (const uint) +0:79 o2: direct index for structure ( uniform 2-component vector of int) +0:79 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:79 Constant: +0:79 5 (const uint) +0:79 Constant: +0:79 2 (const int) +0:80 Sequence +0:80 move second child to first child ( temp 4-component vector of uint) +0:80 'txval221' ( temp 4-component vector of uint) +0:80 textureGatherOffset ( temp 4-component vector of uint) +0:80 Construct combined texture-sampler ( temp usampler2D) +0:80 'g_tTex2du4' ( uniform utexture2D) +0:80 'g_sSamp' (layout( binding=0) uniform sampler) +0:80 c2: direct index for structure ( uniform 2-component vector of float) +0:80 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:80 Constant: +0:80 1 (const uint) +0:80 o2: direct index for structure ( uniform 2-component vector of int) +0:80 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:80 Constant: +0:80 5 (const uint) +0:80 Constant: +0:80 2 (const int) +0:82 Sequence +0:82 move second child to first child ( temp 4-component vector of float) +0:82 'txval204' ( temp 4-component vector of float) +0:82 textureGatherOffsets ( temp 4-component vector of float) +0:82 Construct combined texture-sampler ( temp sampler2D) +0:82 'g_tTex2df4' ( uniform texture2D) +0:82 'g_sSamp' (layout( binding=0) uniform sampler) +0:82 c2: direct index for structure ( uniform 2-component vector of float) +0:82 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:82 Constant: +0:82 1 (const uint) +0:82 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:82 o2: direct index for structure ( uniform 2-component vector of int) +0:82 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:82 Constant: +0:82 5 (const uint) +0:82 o2: direct index for structure ( uniform 2-component vector of int) +0:82 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:82 Constant: +0:82 5 (const uint) +0:82 o2: direct index for structure ( uniform 2-component vector of int) +0:82 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:82 Constant: +0:82 5 (const uint) +0:82 o2: direct index for structure ( uniform 2-component vector of int) +0:82 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:82 Constant: +0:82 5 (const uint) +0:82 Constant: +0:82 2 (const int) +0:83 Sequence +0:83 move second child to first child ( temp 4-component vector of int) +0:83 'txval214' ( temp 4-component vector of int) +0:83 textureGatherOffsets ( temp 4-component vector of int) +0:83 Construct combined texture-sampler ( temp isampler2D) +0:83 'g_tTex2di4' ( uniform itexture2D) +0:83 'g_sSamp' (layout( binding=0) uniform sampler) +0:83 c2: direct index for structure ( uniform 2-component vector of float) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:83 Constant: +0:83 1 (const uint) +0:83 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:83 o2: direct index for structure ( uniform 2-component vector of int) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:83 Constant: +0:83 5 (const uint) +0:83 o2: direct index for structure ( uniform 2-component vector of int) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:83 Constant: +0:83 5 (const uint) +0:83 o2: direct index for structure ( uniform 2-component vector of int) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:83 Constant: +0:83 5 (const uint) +0:83 o2: direct index for structure ( uniform 2-component vector of int) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:83 Constant: +0:83 5 (const uint) +0:83 Constant: +0:83 2 (const int) +0:84 Sequence +0:84 move second child to first child ( temp 4-component vector of uint) +0:84 'txval224' ( temp 4-component vector of uint) +0:84 textureGatherOffsets ( temp 4-component vector of uint) +0:84 Construct combined texture-sampler ( temp usampler2D) +0:84 'g_tTex2du4' ( uniform utexture2D) +0:84 'g_sSamp' (layout( binding=0) uniform sampler) +0:84 c2: direct index for structure ( uniform 2-component vector of float) +0:84 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:84 Constant: +0:84 1 (const uint) +0:84 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:84 o2: direct index for structure ( uniform 2-component vector of int) +0:84 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:84 Constant: +0:84 5 (const uint) +0:84 o2: direct index for structure ( uniform 2-component vector of int) +0:84 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:84 Constant: +0:84 5 (const uint) +0:84 o2: direct index for structure ( uniform 2-component vector of int) +0:84 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:84 Constant: +0:84 5 (const uint) +0:84 o2: direct index for structure ( uniform 2-component vector of int) +0:84 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:84 Constant: +0:84 5 (const uint) +0:84 Constant: +0:84 2 (const int) +0:94 Sequence +0:94 move second child to first child ( temp 4-component vector of float) +0:94 'txval301' ( temp 4-component vector of float) +0:94 textureGatherOffset ( temp 4-component vector of float) +0:94 Construct combined texture-sampler ( temp sampler2D) +0:94 'g_tTex2df4' ( uniform texture2D) +0:94 'g_sSamp' (layout( binding=0) uniform sampler) +0:94 c2: direct index for structure ( uniform 2-component vector of float) +0:94 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:94 Constant: +0:94 1 (const uint) +0:94 o2: direct index for structure ( uniform 2-component vector of int) +0:94 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:94 Constant: +0:94 5 (const uint) +0:94 Constant: +0:94 3 (const int) +0:95 Sequence +0:95 move second child to first child ( temp 4-component vector of int) +0:95 'txval311' ( temp 4-component vector of int) +0:95 textureGatherOffset ( temp 4-component vector of int) +0:95 Construct combined texture-sampler ( temp isampler2D) +0:95 'g_tTex2di4' ( uniform itexture2D) +0:95 'g_sSamp' (layout( binding=0) uniform sampler) +0:95 c2: direct index for structure ( uniform 2-component vector of float) +0:95 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:95 Constant: +0:95 1 (const uint) +0:95 o2: direct index for structure ( uniform 2-component vector of int) +0:95 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:95 Constant: +0:95 5 (const uint) +0:95 Constant: +0:95 3 (const int) +0:96 Sequence +0:96 move second child to first child ( temp 4-component vector of uint) +0:96 'txval321' ( temp 4-component vector of uint) +0:96 textureGatherOffset ( temp 4-component vector of uint) +0:96 Construct combined texture-sampler ( temp usampler2D) +0:96 'g_tTex2du4' ( uniform utexture2D) +0:96 'g_sSamp' (layout( binding=0) uniform sampler) +0:96 c2: direct index for structure ( uniform 2-component vector of float) +0:96 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:96 Constant: +0:96 1 (const uint) +0:96 o2: direct index for structure ( uniform 2-component vector of int) +0:96 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:96 Constant: +0:96 5 (const uint) +0:96 Constant: +0:96 3 (const int) +0:98 Sequence +0:98 move second child to first child ( temp 4-component vector of float) +0:98 'txval304' ( temp 4-component vector of float) +0:98 textureGatherOffsets ( temp 4-component vector of float) +0:98 Construct combined texture-sampler ( temp sampler2D) +0:98 'g_tTex2df4' ( uniform texture2D) +0:98 'g_sSamp' (layout( binding=0) uniform sampler) +0:98 c2: direct index for structure ( uniform 2-component vector of float) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:98 Constant: +0:98 1 (const uint) +0:98 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:98 o2: direct index for structure ( uniform 2-component vector of int) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:98 Constant: +0:98 5 (const uint) +0:98 o2: direct index for structure ( uniform 2-component vector of int) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:98 Constant: +0:98 5 (const uint) +0:98 o2: direct index for structure ( uniform 2-component vector of int) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:98 Constant: +0:98 5 (const uint) +0:98 o2: direct index for structure ( uniform 2-component vector of int) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:98 Constant: +0:98 5 (const uint) +0:98 Constant: +0:98 3 (const int) +0:99 Sequence +0:99 move second child to first child ( temp 4-component vector of int) +0:99 'txval314' ( temp 4-component vector of int) +0:99 textureGatherOffsets ( temp 4-component vector of int) +0:99 Construct combined texture-sampler ( temp isampler2D) +0:99 'g_tTex2di4' ( uniform itexture2D) +0:99 'g_sSamp' (layout( binding=0) uniform sampler) +0:99 c2: direct index for structure ( uniform 2-component vector of float) +0:99 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:99 Constant: +0:99 1 (const uint) +0:99 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:99 o2: direct index for structure ( uniform 2-component vector of int) +0:99 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:99 Constant: +0:99 5 (const uint) +0:99 o2: direct index for structure ( uniform 2-component vector of int) +0:99 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:99 Constant: +0:99 5 (const uint) +0:99 o2: direct index for structure ( uniform 2-component vector of int) +0:99 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:99 Constant: +0:99 5 (const uint) +0:99 o2: direct index for structure ( uniform 2-component vector of int) +0:99 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:99 Constant: +0:99 5 (const uint) +0:99 Constant: +0:99 3 (const int) +0:100 Sequence +0:100 move second child to first child ( temp 4-component vector of uint) +0:100 'txval324' ( temp 4-component vector of uint) +0:100 textureGatherOffsets ( temp 4-component vector of uint) +0:100 Construct combined texture-sampler ( temp usampler2D) +0:100 'g_tTex2du4' ( uniform utexture2D) +0:100 'g_sSamp' (layout( binding=0) uniform sampler) +0:100 c2: direct index for structure ( uniform 2-component vector of float) +0:100 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:100 Constant: +0:100 1 (const uint) +0:100 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:100 o2: direct index for structure ( uniform 2-component vector of int) +0:100 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:100 Constant: +0:100 5 (const uint) +0:100 o2: direct index for structure ( uniform 2-component vector of int) +0:100 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:100 Constant: +0:100 5 (const uint) +0:100 o2: direct index for structure ( uniform 2-component vector of int) +0:100 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:100 Constant: +0:100 5 (const uint) +0:100 o2: direct index for structure ( uniform 2-component vector of int) +0:100 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:100 Constant: +0:100 5 (const uint) +0:100 Constant: +0:100 3 (const int) +0:112 move second child to first child ( temp 4-component vector of float) +0:112 Color: direct index for structure ( temp 4-component vector of float) +0:112 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1.000000 +0:112 1.000000 +0:112 1.000000 +0:112 1.000000 +0:113 move second child to first child ( temp float) +0:113 Depth: direct index for structure ( temp float) +0:113 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:113 Constant: +0:113 1 (const int) +0:113 Constant: +0:113 1.000000 +0:115 Branch: Return with expression +0:115 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 Function Definition: main( ( temp void) +0:39 Function Parameters: +0:? Sequence +0:39 Sequence +0:39 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:39 Color: direct index for structure ( temp 4-component vector of float) +0:39 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 Constant: +0:39 0 (const int) +0:39 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:39 Depth: direct index for structure ( temp float) +0:39 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 Constant: +0:39 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_sSamp2d' ( uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: Expected Image Operand ConstOffsets to be a const object + %90 = OpImageGather %v4float %76 %78 %int_0 ConstOffsets %89 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 399 + + Capability Shader + Capability ImageGatherExtended + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 363 367 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval001" + Name 16 "g_tTex2df4" + Name 20 "g_sSamp" + Name 30 "$Global" + MemberName 30($Global) 0 "c1" + MemberName 30($Global) 1 "c2" + MemberName 30($Global) 2 "c3" + MemberName 30($Global) 3 "c4" + MemberName 30($Global) 4 "o1" + MemberName 30($Global) 5 "o2" + MemberName 30($Global) 6 "o3" + MemberName 30($Global) 7 "o4" + Name 32 "" + Name 44 "txval011" + Name 47 "g_tTex2di4" + Name 60 "txval021" + Name 63 "g_tTex2du4" + Name 73 "txval004" + Name 91 "txval014" + Name 107 "txval024" + Name 123 "txval101" + Name 132 "txval111" + Name 141 "txval121" + Name 150 "txval104" + Name 166 "txval114" + Name 182 "txval124" + Name 198 "txval201" + Name 208 "txval211" + Name 217 "txval221" + Name 226 "txval204" + Name 242 "txval214" + Name 258 "txval224" + Name 274 "txval301" + Name 284 "txval311" + Name 293 "txval321" + Name 302 "txval304" + Name 318 "txval314" + Name 334 "txval324" + Name 351 "psout" + Name 360 "flattenTemp" + Name 363 "@entryPointOutput.Color" + Name 367 "@entryPointOutput.Depth" + Name 370 "g_sSamp2d" + Name 373 "g_tTex1df4a" + Name 374 "g_tTex1df4" + Name 377 "g_tTex1di4" + Name 380 "g_tTex1du4" + Name 383 "g_tTex3df4" + Name 386 "g_tTex3di4" + Name 389 "g_tTex3du4" + Name 392 "g_tTexcdf4" + Name 395 "g_tTexcdi4" + Name 398 "g_tTexcdu4" + Decorate 16(g_tTex2df4) DescriptorSet 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + MemberDecorate 30($Global) 0 Offset 0 + MemberDecorate 30($Global) 1 Offset 8 + MemberDecorate 30($Global) 2 Offset 16 + MemberDecorate 30($Global) 3 Offset 32 + MemberDecorate 30($Global) 4 Offset 48 + MemberDecorate 30($Global) 5 Offset 56 + MemberDecorate 30($Global) 6 Offset 64 + MemberDecorate 30($Global) 7 Offset 80 + Decorate 30($Global) Block + Decorate 32 DescriptorSet 0 + Decorate 47(g_tTex2di4) DescriptorSet 0 + Decorate 63(g_tTex2du4) DescriptorSet 0 + Decorate 363(@entryPointOutput.Color) Location 0 + Decorate 367(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 370(g_sSamp2d) DescriptorSet 0 + Decorate 373(g_tTex1df4a) DescriptorSet 0 + Decorate 373(g_tTex1df4a) Binding 1 + Decorate 374(g_tTex1df4) DescriptorSet 0 + Decorate 374(g_tTex1df4) Binding 0 + Decorate 377(g_tTex1di4) DescriptorSet 0 + Decorate 380(g_tTex1du4) DescriptorSet 0 + Decorate 383(g_tTex3df4) DescriptorSet 0 + Decorate 386(g_tTex3di4) DescriptorSet 0 + Decorate 389(g_tTex3du4) DescriptorSet 0 + Decorate 392(g_tTexcdf4) DescriptorSet 0 + Decorate 395(g_tTexcdi4) DescriptorSet 0 + Decorate 398(g_tTexcdu4) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 2D sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex2df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 2 + 25: TypeVector 6(float) 3 + 26: TypeInt 32 1 + 27: TypeVector 26(int) 2 + 28: TypeVector 26(int) 3 + 29: TypeVector 26(int) 4 + 30($Global): TypeStruct 6(float) 24(fvec2) 25(fvec3) 7(fvec4) 26(int) 27(ivec2) 28(ivec3) 29(ivec4) + 31: TypePointer Uniform 30($Global) + 32: 31(ptr) Variable Uniform + 33: 26(int) Constant 1 + 34: TypePointer Uniform 24(fvec2) + 37: 26(int) Constant 5 + 38: TypePointer Uniform 27(ivec2) + 41: 26(int) Constant 0 + 43: TypePointer Function 29(ivec4) + 45: TypeImage 26(int) 2D sampled format:Unknown + 46: TypePointer UniformConstant 45 + 47(g_tTex2di4): 46(ptr) Variable UniformConstant + 50: TypeSampledImage 45 + 57: TypeInt 32 0 + 58: TypeVector 57(int) 4 + 59: TypePointer Function 58(ivec4) + 61: TypeImage 57(int) 2D sampled format:Unknown + 62: TypePointer UniformConstant 61 + 63(g_tTex2du4): 62(ptr) Variable UniformConstant + 66: TypeSampledImage 61 + 87: 57(int) Constant 4 + 88: TypeArray 27(ivec2) 87 + 206: 26(int) Constant 2 + 282: 26(int) Constant 3 + 350: TypePointer Function 8(PS_OUTPUT) + 352: 6(float) Constant 1065353216 + 353: 7(fvec4) ConstantComposite 352 352 352 352 + 355: TypePointer Function 6(float) + 362: TypePointer Output 7(fvec4) +363(@entryPointOutput.Color): 362(ptr) Variable Output + 366: TypePointer Output 6(float) +367(@entryPointOutput.Depth): 366(ptr) Variable Output + 370(g_sSamp2d): 19(ptr) Variable UniformConstant + 371: TypeImage 6(float) 1D sampled format:Unknown + 372: TypePointer UniformConstant 371 +373(g_tTex1df4a): 372(ptr) Variable UniformConstant + 374(g_tTex1df4): 372(ptr) Variable UniformConstant + 375: TypeImage 26(int) 1D sampled format:Unknown + 376: TypePointer UniformConstant 375 + 377(g_tTex1di4): 376(ptr) Variable UniformConstant + 378: TypeImage 57(int) 1D sampled format:Unknown + 379: TypePointer UniformConstant 378 + 380(g_tTex1du4): 379(ptr) Variable UniformConstant + 381: TypeImage 6(float) 3D sampled format:Unknown + 382: TypePointer UniformConstant 381 + 383(g_tTex3df4): 382(ptr) Variable UniformConstant + 384: TypeImage 26(int) 3D sampled format:Unknown + 385: TypePointer UniformConstant 384 + 386(g_tTex3di4): 385(ptr) Variable UniformConstant + 387: TypeImage 57(int) 3D sampled format:Unknown + 388: TypePointer UniformConstant 387 + 389(g_tTex3du4): 388(ptr) Variable UniformConstant + 390: TypeImage 6(float) Cube sampled format:Unknown + 391: TypePointer UniformConstant 390 + 392(g_tTexcdf4): 391(ptr) Variable UniformConstant + 393: TypeImage 26(int) Cube sampled format:Unknown + 394: TypePointer UniformConstant 393 + 395(g_tTexcdi4): 394(ptr) Variable UniformConstant + 396: TypeImage 57(int) Cube sampled format:Unknown + 397: TypePointer UniformConstant 396 + 398(g_tTexcdu4): 397(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +360(flattenTemp): 350(ptr) Variable Function + 361:8(PS_OUTPUT) FunctionCall 10(@main() + Store 360(flattenTemp) 361 + 364: 12(ptr) AccessChain 360(flattenTemp) 41 + 365: 7(fvec4) Load 364 + Store 363(@entryPointOutput.Color) 365 + 368: 355(ptr) AccessChain 360(flattenTemp) 33 + 369: 6(float) Load 368 + Store 367(@entryPointOutput.Depth) 369 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval001): 12(ptr) Variable Function + 44(txval011): 43(ptr) Variable Function + 60(txval021): 59(ptr) Variable Function + 73(txval004): 12(ptr) Variable Function + 91(txval014): 43(ptr) Variable Function + 107(txval024): 59(ptr) Variable Function + 123(txval101): 12(ptr) Variable Function + 132(txval111): 43(ptr) Variable Function + 141(txval121): 59(ptr) Variable Function + 150(txval104): 12(ptr) Variable Function + 166(txval114): 43(ptr) Variable Function + 182(txval124): 59(ptr) Variable Function + 198(txval201): 12(ptr) Variable Function + 208(txval211): 43(ptr) Variable Function + 217(txval221): 59(ptr) Variable Function + 226(txval204): 12(ptr) Variable Function + 242(txval214): 43(ptr) Variable Function + 258(txval224): 59(ptr) Variable Function + 274(txval301): 12(ptr) Variable Function + 284(txval311): 43(ptr) Variable Function + 293(txval321): 59(ptr) Variable Function + 302(txval304): 12(ptr) Variable Function + 318(txval314): 43(ptr) Variable Function + 334(txval324): 59(ptr) Variable Function + 351(psout): 350(ptr) Variable Function + 17: 14 Load 16(g_tTex2df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 35: 34(ptr) AccessChain 32 33 + 36: 24(fvec2) Load 35 + 39: 38(ptr) AccessChain 32 37 + 40: 27(ivec2) Load 39 + 42: 7(fvec4) ImageGather 23 36 41 Offset 40 + Store 13(txval001) 42 + 48: 45 Load 47(g_tTex2di4) + 49: 18 Load 20(g_sSamp) + 51: 50 SampledImage 48 49 + 52: 34(ptr) AccessChain 32 33 + 53: 24(fvec2) Load 52 + 54: 38(ptr) AccessChain 32 37 + 55: 27(ivec2) Load 54 + 56: 29(ivec4) ImageGather 51 53 41 Offset 55 + Store 44(txval011) 56 + 64: 61 Load 63(g_tTex2du4) + 65: 18 Load 20(g_sSamp) + 67: 66 SampledImage 64 65 + 68: 34(ptr) AccessChain 32 33 + 69: 24(fvec2) Load 68 + 70: 38(ptr) AccessChain 32 37 + 71: 27(ivec2) Load 70 + 72: 58(ivec4) ImageGather 67 69 41 Offset 71 + Store 60(txval021) 72 + 74: 14 Load 16(g_tTex2df4) + 75: 18 Load 20(g_sSamp) + 76: 22 SampledImage 74 75 + 77: 34(ptr) AccessChain 32 33 + 78: 24(fvec2) Load 77 + 79: 38(ptr) AccessChain 32 37 + 80: 27(ivec2) Load 79 + 81: 38(ptr) AccessChain 32 37 + 82: 27(ivec2) Load 81 + 83: 38(ptr) AccessChain 32 37 + 84: 27(ivec2) Load 83 + 85: 38(ptr) AccessChain 32 37 + 86: 27(ivec2) Load 85 + 89: 88 CompositeConstruct 80 82 84 86 + 90: 7(fvec4) ImageGather 76 78 41 ConstOffsets 89 + Store 73(txval004) 90 + 92: 45 Load 47(g_tTex2di4) + 93: 18 Load 20(g_sSamp) + 94: 50 SampledImage 92 93 + 95: 34(ptr) AccessChain 32 33 + 96: 24(fvec2) Load 95 + 97: 38(ptr) AccessChain 32 37 + 98: 27(ivec2) Load 97 + 99: 38(ptr) AccessChain 32 37 + 100: 27(ivec2) Load 99 + 101: 38(ptr) AccessChain 32 37 + 102: 27(ivec2) Load 101 + 103: 38(ptr) AccessChain 32 37 + 104: 27(ivec2) Load 103 + 105: 88 CompositeConstruct 98 100 102 104 + 106: 29(ivec4) ImageGather 94 96 41 ConstOffsets 105 + Store 91(txval014) 106 + 108: 61 Load 63(g_tTex2du4) + 109: 18 Load 20(g_sSamp) + 110: 66 SampledImage 108 109 + 111: 34(ptr) AccessChain 32 33 + 112: 24(fvec2) Load 111 + 113: 38(ptr) AccessChain 32 37 + 114: 27(ivec2) Load 113 + 115: 38(ptr) AccessChain 32 37 + 116: 27(ivec2) Load 115 + 117: 38(ptr) AccessChain 32 37 + 118: 27(ivec2) Load 117 + 119: 38(ptr) AccessChain 32 37 + 120: 27(ivec2) Load 119 + 121: 88 CompositeConstruct 114 116 118 120 + 122: 58(ivec4) ImageGather 110 112 41 ConstOffsets 121 + Store 107(txval024) 122 + 124: 14 Load 16(g_tTex2df4) + 125: 18 Load 20(g_sSamp) + 126: 22 SampledImage 124 125 + 127: 34(ptr) AccessChain 32 33 + 128: 24(fvec2) Load 127 + 129: 38(ptr) AccessChain 32 37 + 130: 27(ivec2) Load 129 + 131: 7(fvec4) ImageGather 126 128 33 Offset 130 + Store 123(txval101) 131 + 133: 45 Load 47(g_tTex2di4) + 134: 18 Load 20(g_sSamp) + 135: 50 SampledImage 133 134 + 136: 34(ptr) AccessChain 32 33 + 137: 24(fvec2) Load 136 + 138: 38(ptr) AccessChain 32 37 + 139: 27(ivec2) Load 138 + 140: 29(ivec4) ImageGather 135 137 33 Offset 139 + Store 132(txval111) 140 + 142: 61 Load 63(g_tTex2du4) + 143: 18 Load 20(g_sSamp) + 144: 66 SampledImage 142 143 + 145: 34(ptr) AccessChain 32 33 + 146: 24(fvec2) Load 145 + 147: 38(ptr) AccessChain 32 37 + 148: 27(ivec2) Load 147 + 149: 58(ivec4) ImageGather 144 146 33 Offset 148 + Store 141(txval121) 149 + 151: 14 Load 16(g_tTex2df4) + 152: 18 Load 20(g_sSamp) + 153: 22 SampledImage 151 152 + 154: 34(ptr) AccessChain 32 33 + 155: 24(fvec2) Load 154 + 156: 38(ptr) AccessChain 32 37 + 157: 27(ivec2) Load 156 + 158: 38(ptr) AccessChain 32 37 + 159: 27(ivec2) Load 158 + 160: 38(ptr) AccessChain 32 37 + 161: 27(ivec2) Load 160 + 162: 38(ptr) AccessChain 32 37 + 163: 27(ivec2) Load 162 + 164: 88 CompositeConstruct 157 159 161 163 + 165: 7(fvec4) ImageGather 153 155 33 ConstOffsets 164 + Store 150(txval104) 165 + 167: 45 Load 47(g_tTex2di4) + 168: 18 Load 20(g_sSamp) + 169: 50 SampledImage 167 168 + 170: 34(ptr) AccessChain 32 33 + 171: 24(fvec2) Load 170 + 172: 38(ptr) AccessChain 32 37 + 173: 27(ivec2) Load 172 + 174: 38(ptr) AccessChain 32 37 + 175: 27(ivec2) Load 174 + 176: 38(ptr) AccessChain 32 37 + 177: 27(ivec2) Load 176 + 178: 38(ptr) AccessChain 32 37 + 179: 27(ivec2) Load 178 + 180: 88 CompositeConstruct 173 175 177 179 + 181: 29(ivec4) ImageGather 169 171 33 ConstOffsets 180 + Store 166(txval114) 181 + 183: 61 Load 63(g_tTex2du4) + 184: 18 Load 20(g_sSamp) + 185: 66 SampledImage 183 184 + 186: 34(ptr) AccessChain 32 33 + 187: 24(fvec2) Load 186 + 188: 38(ptr) AccessChain 32 37 + 189: 27(ivec2) Load 188 + 190: 38(ptr) AccessChain 32 37 + 191: 27(ivec2) Load 190 + 192: 38(ptr) AccessChain 32 37 + 193: 27(ivec2) Load 192 + 194: 38(ptr) AccessChain 32 37 + 195: 27(ivec2) Load 194 + 196: 88 CompositeConstruct 189 191 193 195 + 197: 58(ivec4) ImageGather 185 187 33 ConstOffsets 196 + Store 182(txval124) 197 + 199: 14 Load 16(g_tTex2df4) + 200: 18 Load 20(g_sSamp) + 201: 22 SampledImage 199 200 + 202: 34(ptr) AccessChain 32 33 + 203: 24(fvec2) Load 202 + 204: 38(ptr) AccessChain 32 37 + 205: 27(ivec2) Load 204 + 207: 7(fvec4) ImageGather 201 203 206 Offset 205 + Store 198(txval201) 207 + 209: 45 Load 47(g_tTex2di4) + 210: 18 Load 20(g_sSamp) + 211: 50 SampledImage 209 210 + 212: 34(ptr) AccessChain 32 33 + 213: 24(fvec2) Load 212 + 214: 38(ptr) AccessChain 32 37 + 215: 27(ivec2) Load 214 + 216: 29(ivec4) ImageGather 211 213 206 Offset 215 + Store 208(txval211) 216 + 218: 61 Load 63(g_tTex2du4) + 219: 18 Load 20(g_sSamp) + 220: 66 SampledImage 218 219 + 221: 34(ptr) AccessChain 32 33 + 222: 24(fvec2) Load 221 + 223: 38(ptr) AccessChain 32 37 + 224: 27(ivec2) Load 223 + 225: 58(ivec4) ImageGather 220 222 206 Offset 224 + Store 217(txval221) 225 + 227: 14 Load 16(g_tTex2df4) + 228: 18 Load 20(g_sSamp) + 229: 22 SampledImage 227 228 + 230: 34(ptr) AccessChain 32 33 + 231: 24(fvec2) Load 230 + 232: 38(ptr) AccessChain 32 37 + 233: 27(ivec2) Load 232 + 234: 38(ptr) AccessChain 32 37 + 235: 27(ivec2) Load 234 + 236: 38(ptr) AccessChain 32 37 + 237: 27(ivec2) Load 236 + 238: 38(ptr) AccessChain 32 37 + 239: 27(ivec2) Load 238 + 240: 88 CompositeConstruct 233 235 237 239 + 241: 7(fvec4) ImageGather 229 231 206 ConstOffsets 240 + Store 226(txval204) 241 + 243: 45 Load 47(g_tTex2di4) + 244: 18 Load 20(g_sSamp) + 245: 50 SampledImage 243 244 + 246: 34(ptr) AccessChain 32 33 + 247: 24(fvec2) Load 246 + 248: 38(ptr) AccessChain 32 37 + 249: 27(ivec2) Load 248 + 250: 38(ptr) AccessChain 32 37 + 251: 27(ivec2) Load 250 + 252: 38(ptr) AccessChain 32 37 + 253: 27(ivec2) Load 252 + 254: 38(ptr) AccessChain 32 37 + 255: 27(ivec2) Load 254 + 256: 88 CompositeConstruct 249 251 253 255 + 257: 29(ivec4) ImageGather 245 247 206 ConstOffsets 256 + Store 242(txval214) 257 + 259: 61 Load 63(g_tTex2du4) + 260: 18 Load 20(g_sSamp) + 261: 66 SampledImage 259 260 + 262: 34(ptr) AccessChain 32 33 + 263: 24(fvec2) Load 262 + 264: 38(ptr) AccessChain 32 37 + 265: 27(ivec2) Load 264 + 266: 38(ptr) AccessChain 32 37 + 267: 27(ivec2) Load 266 + 268: 38(ptr) AccessChain 32 37 + 269: 27(ivec2) Load 268 + 270: 38(ptr) AccessChain 32 37 + 271: 27(ivec2) Load 270 + 272: 88 CompositeConstruct 265 267 269 271 + 273: 58(ivec4) ImageGather 261 263 206 ConstOffsets 272 + Store 258(txval224) 273 + 275: 14 Load 16(g_tTex2df4) + 276: 18 Load 20(g_sSamp) + 277: 22 SampledImage 275 276 + 278: 34(ptr) AccessChain 32 33 + 279: 24(fvec2) Load 278 + 280: 38(ptr) AccessChain 32 37 + 281: 27(ivec2) Load 280 + 283: 7(fvec4) ImageGather 277 279 282 Offset 281 + Store 274(txval301) 283 + 285: 45 Load 47(g_tTex2di4) + 286: 18 Load 20(g_sSamp) + 287: 50 SampledImage 285 286 + 288: 34(ptr) AccessChain 32 33 + 289: 24(fvec2) Load 288 + 290: 38(ptr) AccessChain 32 37 + 291: 27(ivec2) Load 290 + 292: 29(ivec4) ImageGather 287 289 282 Offset 291 + Store 284(txval311) 292 + 294: 61 Load 63(g_tTex2du4) + 295: 18 Load 20(g_sSamp) + 296: 66 SampledImage 294 295 + 297: 34(ptr) AccessChain 32 33 + 298: 24(fvec2) Load 297 + 299: 38(ptr) AccessChain 32 37 + 300: 27(ivec2) Load 299 + 301: 58(ivec4) ImageGather 296 298 282 Offset 300 + Store 293(txval321) 301 + 303: 14 Load 16(g_tTex2df4) + 304: 18 Load 20(g_sSamp) + 305: 22 SampledImage 303 304 + 306: 34(ptr) AccessChain 32 33 + 307: 24(fvec2) Load 306 + 308: 38(ptr) AccessChain 32 37 + 309: 27(ivec2) Load 308 + 310: 38(ptr) AccessChain 32 37 + 311: 27(ivec2) Load 310 + 312: 38(ptr) AccessChain 32 37 + 313: 27(ivec2) Load 312 + 314: 38(ptr) AccessChain 32 37 + 315: 27(ivec2) Load 314 + 316: 88 CompositeConstruct 309 311 313 315 + 317: 7(fvec4) ImageGather 305 307 282 ConstOffsets 316 + Store 302(txval304) 317 + 319: 45 Load 47(g_tTex2di4) + 320: 18 Load 20(g_sSamp) + 321: 50 SampledImage 319 320 + 322: 34(ptr) AccessChain 32 33 + 323: 24(fvec2) Load 322 + 324: 38(ptr) AccessChain 32 37 + 325: 27(ivec2) Load 324 + 326: 38(ptr) AccessChain 32 37 + 327: 27(ivec2) Load 326 + 328: 38(ptr) AccessChain 32 37 + 329: 27(ivec2) Load 328 + 330: 38(ptr) AccessChain 32 37 + 331: 27(ivec2) Load 330 + 332: 88 CompositeConstruct 325 327 329 331 + 333: 29(ivec4) ImageGather 321 323 282 ConstOffsets 332 + Store 318(txval314) 333 + 335: 61 Load 63(g_tTex2du4) + 336: 18 Load 20(g_sSamp) + 337: 66 SampledImage 335 336 + 338: 34(ptr) AccessChain 32 33 + 339: 24(fvec2) Load 338 + 340: 38(ptr) AccessChain 32 37 + 341: 27(ivec2) Load 340 + 342: 38(ptr) AccessChain 32 37 + 343: 27(ivec2) Load 342 + 344: 38(ptr) AccessChain 32 37 + 345: 27(ivec2) Load 344 + 346: 38(ptr) AccessChain 32 37 + 347: 27(ivec2) Load 346 + 348: 88 CompositeConstruct 341 343 345 347 + 349: 58(ivec4) ImageGather 337 339 282 ConstOffsets 348 + Store 334(txval324) 349 + 354: 12(ptr) AccessChain 351(psout) 41 + Store 354 353 + 356: 355(ptr) AccessChain 351(psout) 33 + Store 356 352 + 357:8(PS_OUTPUT) Load 351(psout) + ReturnValue 357 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out new file mode 100644 index 00000000..22b02e7f --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out @@ -0,0 +1,1770 @@ +hlsl.gatherRGBA.offsetarray.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:33 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 Function Parameters: +0:? Sequence +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of float) +0:40 'txval001' ( temp 4-component vector of float) +0:40 textureGatherOffset ( temp 4-component vector of float) +0:40 Construct combined texture-sampler ( temp sampler2DArray) +0:40 'g_tTex2df4a' ( uniform texture2DArray) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:40 c3: direct index for structure ( uniform 3-component vector of float) +0:40 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:40 Constant: +0:40 2 (const uint) +0:40 o2: direct index for structure ( uniform 2-component vector of int) +0:40 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:40 Constant: +0:40 5 (const uint) +0:40 Constant: +0:40 0 (const int) +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of int) +0:41 'txval011' ( temp 4-component vector of int) +0:41 textureGatherOffset ( temp 4-component vector of int) +0:41 Construct combined texture-sampler ( temp isampler2DArray) +0:41 'g_tTex2di4a' ( uniform itexture2DArray) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:41 c3: direct index for structure ( uniform 3-component vector of float) +0:41 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:41 Constant: +0:41 2 (const uint) +0:41 o2: direct index for structure ( uniform 2-component vector of int) +0:41 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:41 Constant: +0:41 5 (const uint) +0:41 Constant: +0:41 0 (const int) +0:42 Sequence +0:42 move second child to first child ( temp 4-component vector of uint) +0:42 'txval021' ( temp 4-component vector of uint) +0:42 textureGatherOffset ( temp 4-component vector of uint) +0:42 Construct combined texture-sampler ( temp usampler2DArray) +0:42 'g_tTex2du4a' ( uniform utexture2DArray) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:42 c3: direct index for structure ( uniform 3-component vector of float) +0:42 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:42 Constant: +0:42 2 (const uint) +0:42 o2: direct index for structure ( uniform 2-component vector of int) +0:42 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:42 Constant: +0:42 5 (const uint) +0:42 Constant: +0:42 0 (const int) +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of float) +0:44 'txval004' ( temp 4-component vector of float) +0:44 textureGatherOffsets ( temp 4-component vector of float) +0:44 Construct combined texture-sampler ( temp sampler2DArray) +0:44 'g_tTex2df4a' ( uniform texture2DArray) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:44 c3: direct index for structure ( uniform 3-component vector of float) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:44 Constant: +0:44 2 (const uint) +0:44 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:44 o2: direct index for structure ( uniform 2-component vector of int) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:44 Constant: +0:44 5 (const uint) +0:44 o2: direct index for structure ( uniform 2-component vector of int) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:44 Constant: +0:44 5 (const uint) +0:44 o2: direct index for structure ( uniform 2-component vector of int) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:44 Constant: +0:44 5 (const uint) +0:44 o2: direct index for structure ( uniform 2-component vector of int) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:44 Constant: +0:44 5 (const uint) +0:44 Constant: +0:44 0 (const int) +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of int) +0:45 'txval014' ( temp 4-component vector of int) +0:45 textureGatherOffsets ( temp 4-component vector of int) +0:45 Construct combined texture-sampler ( temp isampler2DArray) +0:45 'g_tTex2di4a' ( uniform itexture2DArray) +0:45 'g_sSamp' (layout( binding=0) uniform sampler) +0:45 c3: direct index for structure ( uniform 3-component vector of float) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:45 Constant: +0:45 2 (const uint) +0:45 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:45 o2: direct index for structure ( uniform 2-component vector of int) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:45 Constant: +0:45 5 (const uint) +0:45 o2: direct index for structure ( uniform 2-component vector of int) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:45 Constant: +0:45 5 (const uint) +0:45 o2: direct index for structure ( uniform 2-component vector of int) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:45 Constant: +0:45 5 (const uint) +0:45 o2: direct index for structure ( uniform 2-component vector of int) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:45 Constant: +0:45 5 (const uint) +0:45 Constant: +0:45 0 (const int) +0:46 Sequence +0:46 move second child to first child ( temp 4-component vector of uint) +0:46 'txval024' ( temp 4-component vector of uint) +0:46 textureGatherOffsets ( temp 4-component vector of uint) +0:46 Construct combined texture-sampler ( temp usampler2DArray) +0:46 'g_tTex2du4a' ( uniform utexture2DArray) +0:46 'g_sSamp' (layout( binding=0) uniform sampler) +0:46 c3: direct index for structure ( uniform 3-component vector of float) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:46 Constant: +0:46 2 (const uint) +0:46 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:46 o2: direct index for structure ( uniform 2-component vector of int) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:46 Constant: +0:46 5 (const uint) +0:46 o2: direct index for structure ( uniform 2-component vector of int) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:46 Constant: +0:46 5 (const uint) +0:46 o2: direct index for structure ( uniform 2-component vector of int) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:46 Constant: +0:46 5 (const uint) +0:46 o2: direct index for structure ( uniform 2-component vector of int) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:46 Constant: +0:46 5 (const uint) +0:46 Constant: +0:46 0 (const int) +0:56 Sequence +0:56 move second child to first child ( temp 4-component vector of float) +0:56 'txval101' ( temp 4-component vector of float) +0:56 textureGatherOffset ( temp 4-component vector of float) +0:56 Construct combined texture-sampler ( temp sampler2DArray) +0:56 'g_tTex2df4a' ( uniform texture2DArray) +0:56 'g_sSamp' (layout( binding=0) uniform sampler) +0:56 c3: direct index for structure ( uniform 3-component vector of float) +0:56 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:56 Constant: +0:56 2 (const uint) +0:56 o2: direct index for structure ( uniform 2-component vector of int) +0:56 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:56 Constant: +0:56 5 (const uint) +0:56 Constant: +0:56 1 (const int) +0:57 Sequence +0:57 move second child to first child ( temp 4-component vector of int) +0:57 'txval111' ( temp 4-component vector of int) +0:57 textureGatherOffset ( temp 4-component vector of int) +0:57 Construct combined texture-sampler ( temp isampler2DArray) +0:57 'g_tTex2di4a' ( uniform itexture2DArray) +0:57 'g_sSamp' (layout( binding=0) uniform sampler) +0:57 c3: direct index for structure ( uniform 3-component vector of float) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 2 (const uint) +0:57 o2: direct index for structure ( uniform 2-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 5 (const uint) +0:57 Constant: +0:57 1 (const int) +0:58 Sequence +0:58 move second child to first child ( temp 4-component vector of uint) +0:58 'txval121' ( temp 4-component vector of uint) +0:58 textureGatherOffset ( temp 4-component vector of uint) +0:58 Construct combined texture-sampler ( temp usampler2DArray) +0:58 'g_tTex2du4a' ( uniform utexture2DArray) +0:58 'g_sSamp' (layout( binding=0) uniform sampler) +0:58 c3: direct index for structure ( uniform 3-component vector of float) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 2 (const uint) +0:58 o2: direct index for structure ( uniform 2-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 5 (const uint) +0:58 Constant: +0:58 1 (const int) +0:60 Sequence +0:60 move second child to first child ( temp 4-component vector of float) +0:60 'txval104' ( temp 4-component vector of float) +0:60 textureGatherOffsets ( temp 4-component vector of float) +0:60 Construct combined texture-sampler ( temp sampler2DArray) +0:60 'g_tTex2df4a' ( uniform texture2DArray) +0:60 'g_sSamp' (layout( binding=0) uniform sampler) +0:60 c3: direct index for structure ( uniform 3-component vector of float) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:60 Constant: +0:60 2 (const uint) +0:60 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:60 o2: direct index for structure ( uniform 2-component vector of int) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:60 Constant: +0:60 5 (const uint) +0:60 o2: direct index for structure ( uniform 2-component vector of int) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:60 Constant: +0:60 5 (const uint) +0:60 o2: direct index for structure ( uniform 2-component vector of int) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:60 Constant: +0:60 5 (const uint) +0:60 o2: direct index for structure ( uniform 2-component vector of int) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:60 Constant: +0:60 5 (const uint) +0:60 Constant: +0:60 1 (const int) +0:61 Sequence +0:61 move second child to first child ( temp 4-component vector of int) +0:61 'txval114' ( temp 4-component vector of int) +0:61 textureGatherOffsets ( temp 4-component vector of int) +0:61 Construct combined texture-sampler ( temp isampler2DArray) +0:61 'g_tTex2di4a' ( uniform itexture2DArray) +0:61 'g_sSamp' (layout( binding=0) uniform sampler) +0:61 c3: direct index for structure ( uniform 3-component vector of float) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:61 Constant: +0:61 2 (const uint) +0:61 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:61 o2: direct index for structure ( uniform 2-component vector of int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:61 Constant: +0:61 5 (const uint) +0:61 o2: direct index for structure ( uniform 2-component vector of int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:61 Constant: +0:61 5 (const uint) +0:61 o2: direct index for structure ( uniform 2-component vector of int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:61 Constant: +0:61 5 (const uint) +0:61 o2: direct index for structure ( uniform 2-component vector of int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:61 Constant: +0:61 5 (const uint) +0:61 Constant: +0:61 1 (const int) +0:62 Sequence +0:62 move second child to first child ( temp 4-component vector of uint) +0:62 'txval124' ( temp 4-component vector of uint) +0:62 textureGatherOffsets ( temp 4-component vector of uint) +0:62 Construct combined texture-sampler ( temp usampler2DArray) +0:62 'g_tTex2du4a' ( uniform utexture2DArray) +0:62 'g_sSamp' (layout( binding=0) uniform sampler) +0:62 c3: direct index for structure ( uniform 3-component vector of float) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 2 (const uint) +0:62 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:62 o2: direct index for structure ( uniform 2-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 5 (const uint) +0:62 o2: direct index for structure ( uniform 2-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 5 (const uint) +0:62 o2: direct index for structure ( uniform 2-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 5 (const uint) +0:62 o2: direct index for structure ( uniform 2-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 5 (const uint) +0:62 Constant: +0:62 1 (const int) +0:72 Sequence +0:72 move second child to first child ( temp 4-component vector of float) +0:72 'txval201' ( temp 4-component vector of float) +0:72 textureGatherOffset ( temp 4-component vector of float) +0:72 Construct combined texture-sampler ( temp sampler2DArray) +0:72 'g_tTex2df4a' ( uniform texture2DArray) +0:72 'g_sSamp' (layout( binding=0) uniform sampler) +0:72 c3: direct index for structure ( uniform 3-component vector of float) +0:72 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:72 Constant: +0:72 2 (const uint) +0:72 o2: direct index for structure ( uniform 2-component vector of int) +0:72 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:72 Constant: +0:72 5 (const uint) +0:72 Constant: +0:72 2 (const int) +0:73 Sequence +0:73 move second child to first child ( temp 4-component vector of int) +0:73 'txval211' ( temp 4-component vector of int) +0:73 textureGatherOffset ( temp 4-component vector of int) +0:73 Construct combined texture-sampler ( temp isampler2DArray) +0:73 'g_tTex2di4a' ( uniform itexture2DArray) +0:73 'g_sSamp' (layout( binding=0) uniform sampler) +0:73 c3: direct index for structure ( uniform 3-component vector of float) +0:73 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:73 Constant: +0:73 2 (const uint) +0:73 o2: direct index for structure ( uniform 2-component vector of int) +0:73 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:73 Constant: +0:73 5 (const uint) +0:73 Constant: +0:73 2 (const int) +0:74 Sequence +0:74 move second child to first child ( temp 4-component vector of uint) +0:74 'txval221' ( temp 4-component vector of uint) +0:74 textureGatherOffset ( temp 4-component vector of uint) +0:74 Construct combined texture-sampler ( temp usampler2DArray) +0:74 'g_tTex2du4a' ( uniform utexture2DArray) +0:74 'g_sSamp' (layout( binding=0) uniform sampler) +0:74 c3: direct index for structure ( uniform 3-component vector of float) +0:74 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:74 Constant: +0:74 2 (const uint) +0:74 o2: direct index for structure ( uniform 2-component vector of int) +0:74 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:74 Constant: +0:74 5 (const uint) +0:74 Constant: +0:74 2 (const int) +0:76 Sequence +0:76 move second child to first child ( temp 4-component vector of float) +0:76 'txval204' ( temp 4-component vector of float) +0:76 textureGatherOffsets ( temp 4-component vector of float) +0:76 Construct combined texture-sampler ( temp sampler2DArray) +0:76 'g_tTex2df4a' ( uniform texture2DArray) +0:76 'g_sSamp' (layout( binding=0) uniform sampler) +0:76 c3: direct index for structure ( uniform 3-component vector of float) +0:76 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:76 Constant: +0:76 2 (const uint) +0:76 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:76 o2: direct index for structure ( uniform 2-component vector of int) +0:76 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:76 Constant: +0:76 5 (const uint) +0:76 o2: direct index for structure ( uniform 2-component vector of int) +0:76 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:76 Constant: +0:76 5 (const uint) +0:76 o2: direct index for structure ( uniform 2-component vector of int) +0:76 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:76 Constant: +0:76 5 (const uint) +0:76 o2: direct index for structure ( uniform 2-component vector of int) +0:76 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:76 Constant: +0:76 5 (const uint) +0:76 Constant: +0:76 2 (const int) +0:77 Sequence +0:77 move second child to first child ( temp 4-component vector of int) +0:77 'txval214' ( temp 4-component vector of int) +0:77 textureGatherOffsets ( temp 4-component vector of int) +0:77 Construct combined texture-sampler ( temp isampler2DArray) +0:77 'g_tTex2di4a' ( uniform itexture2DArray) +0:77 'g_sSamp' (layout( binding=0) uniform sampler) +0:77 c3: direct index for structure ( uniform 3-component vector of float) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:77 Constant: +0:77 2 (const uint) +0:77 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:77 o2: direct index for structure ( uniform 2-component vector of int) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:77 Constant: +0:77 5 (const uint) +0:77 o2: direct index for structure ( uniform 2-component vector of int) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:77 Constant: +0:77 5 (const uint) +0:77 o2: direct index for structure ( uniform 2-component vector of int) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:77 Constant: +0:77 5 (const uint) +0:77 o2: direct index for structure ( uniform 2-component vector of int) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:77 Constant: +0:77 5 (const uint) +0:77 Constant: +0:77 2 (const int) +0:78 Sequence +0:78 move second child to first child ( temp 4-component vector of uint) +0:78 'txval224' ( temp 4-component vector of uint) +0:78 textureGatherOffsets ( temp 4-component vector of uint) +0:78 Construct combined texture-sampler ( temp usampler2DArray) +0:78 'g_tTex2du4a' ( uniform utexture2DArray) +0:78 'g_sSamp' (layout( binding=0) uniform sampler) +0:78 c3: direct index for structure ( uniform 3-component vector of float) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:78 Constant: +0:78 2 (const uint) +0:78 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:78 o2: direct index for structure ( uniform 2-component vector of int) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:78 Constant: +0:78 5 (const uint) +0:78 o2: direct index for structure ( uniform 2-component vector of int) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:78 Constant: +0:78 5 (const uint) +0:78 o2: direct index for structure ( uniform 2-component vector of int) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:78 Constant: +0:78 5 (const uint) +0:78 o2: direct index for structure ( uniform 2-component vector of int) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:78 Constant: +0:78 5 (const uint) +0:78 Constant: +0:78 2 (const int) +0:88 Sequence +0:88 move second child to first child ( temp 4-component vector of float) +0:88 'txval301' ( temp 4-component vector of float) +0:88 textureGatherOffset ( temp 4-component vector of float) +0:88 Construct combined texture-sampler ( temp sampler2DArray) +0:88 'g_tTex2df4a' ( uniform texture2DArray) +0:88 'g_sSamp' (layout( binding=0) uniform sampler) +0:88 c3: direct index for structure ( uniform 3-component vector of float) +0:88 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:88 Constant: +0:88 2 (const uint) +0:88 o2: direct index for structure ( uniform 2-component vector of int) +0:88 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:88 Constant: +0:88 5 (const uint) +0:88 Constant: +0:88 3 (const int) +0:89 Sequence +0:89 move second child to first child ( temp 4-component vector of int) +0:89 'txval311' ( temp 4-component vector of int) +0:89 textureGatherOffset ( temp 4-component vector of int) +0:89 Construct combined texture-sampler ( temp isampler2DArray) +0:89 'g_tTex2di4a' ( uniform itexture2DArray) +0:89 'g_sSamp' (layout( binding=0) uniform sampler) +0:89 c3: direct index for structure ( uniform 3-component vector of float) +0:89 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:89 Constant: +0:89 2 (const uint) +0:89 o2: direct index for structure ( uniform 2-component vector of int) +0:89 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:89 Constant: +0:89 5 (const uint) +0:89 Constant: +0:89 3 (const int) +0:90 Sequence +0:90 move second child to first child ( temp 4-component vector of uint) +0:90 'txval321' ( temp 4-component vector of uint) +0:90 textureGatherOffset ( temp 4-component vector of uint) +0:90 Construct combined texture-sampler ( temp usampler2DArray) +0:90 'g_tTex2du4a' ( uniform utexture2DArray) +0:90 'g_sSamp' (layout( binding=0) uniform sampler) +0:90 c3: direct index for structure ( uniform 3-component vector of float) +0:90 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:90 Constant: +0:90 2 (const uint) +0:90 o2: direct index for structure ( uniform 2-component vector of int) +0:90 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:90 Constant: +0:90 5 (const uint) +0:90 Constant: +0:90 3 (const int) +0:92 Sequence +0:92 move second child to first child ( temp 4-component vector of float) +0:92 'txval304' ( temp 4-component vector of float) +0:92 textureGatherOffsets ( temp 4-component vector of float) +0:92 Construct combined texture-sampler ( temp sampler2DArray) +0:92 'g_tTex2df4a' ( uniform texture2DArray) +0:92 'g_sSamp' (layout( binding=0) uniform sampler) +0:92 c3: direct index for structure ( uniform 3-component vector of float) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:92 Constant: +0:92 2 (const uint) +0:92 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:92 o2: direct index for structure ( uniform 2-component vector of int) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:92 Constant: +0:92 5 (const uint) +0:92 o2: direct index for structure ( uniform 2-component vector of int) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:92 Constant: +0:92 5 (const uint) +0:92 o2: direct index for structure ( uniform 2-component vector of int) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:92 Constant: +0:92 5 (const uint) +0:92 o2: direct index for structure ( uniform 2-component vector of int) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:92 Constant: +0:92 5 (const uint) +0:92 Constant: +0:92 3 (const int) +0:93 Sequence +0:93 move second child to first child ( temp 4-component vector of int) +0:93 'txval314' ( temp 4-component vector of int) +0:93 textureGatherOffsets ( temp 4-component vector of int) +0:93 Construct combined texture-sampler ( temp isampler2DArray) +0:93 'g_tTex2di4a' ( uniform itexture2DArray) +0:93 'g_sSamp' (layout( binding=0) uniform sampler) +0:93 c3: direct index for structure ( uniform 3-component vector of float) +0:93 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:93 Constant: +0:93 2 (const uint) +0:93 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:93 o2: direct index for structure ( uniform 2-component vector of int) +0:93 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:93 Constant: +0:93 5 (const uint) +0:93 o2: direct index for structure ( uniform 2-component vector of int) +0:93 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:93 Constant: +0:93 5 (const uint) +0:93 o2: direct index for structure ( uniform 2-component vector of int) +0:93 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:93 Constant: +0:93 5 (const uint) +0:93 o2: direct index for structure ( uniform 2-component vector of int) +0:93 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:93 Constant: +0:93 5 (const uint) +0:93 Constant: +0:93 3 (const int) +0:94 Sequence +0:94 move second child to first child ( temp 4-component vector of uint) +0:94 'txval324' ( temp 4-component vector of uint) +0:94 textureGatherOffsets ( temp 4-component vector of uint) +0:94 Construct combined texture-sampler ( temp usampler2DArray) +0:94 'g_tTex2du4a' ( uniform utexture2DArray) +0:94 'g_sSamp' (layout( binding=0) uniform sampler) +0:94 c3: direct index for structure ( uniform 3-component vector of float) +0:94 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:94 Constant: +0:94 2 (const uint) +0:94 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:94 o2: direct index for structure ( uniform 2-component vector of int) +0:94 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:94 Constant: +0:94 5 (const uint) +0:94 o2: direct index for structure ( uniform 2-component vector of int) +0:94 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:94 Constant: +0:94 5 (const uint) +0:94 o2: direct index for structure ( uniform 2-component vector of int) +0:94 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:94 Constant: +0:94 5 (const uint) +0:94 o2: direct index for structure ( uniform 2-component vector of int) +0:94 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:94 Constant: +0:94 5 (const uint) +0:94 Constant: +0:94 3 (const int) +0:106 move second child to first child ( temp 4-component vector of float) +0:106 Color: direct index for structure ( temp 4-component vector of float) +0:106 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 1.000000 +0:106 1.000000 +0:106 1.000000 +0:106 1.000000 +0:107 move second child to first child ( temp float) +0:107 Depth: direct index for structure ( temp float) +0:107 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:107 Constant: +0:107 1 (const int) +0:107 Constant: +0:107 1.000000 +0:109 Branch: Return with expression +0:109 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 Function Definition: main( ( temp void) +0:33 Function Parameters: +0:? Sequence +0:33 Sequence +0:33 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:33 Color: direct index for structure ( temp 4-component vector of float) +0:33 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 Constant: +0:33 0 (const int) +0:33 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:33 Depth: direct index for structure ( temp float) +0:33 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 Constant: +0:33 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_sSamp2d' ( uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:33 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 Function Parameters: +0:? Sequence +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of float) +0:40 'txval001' ( temp 4-component vector of float) +0:40 textureGatherOffset ( temp 4-component vector of float) +0:40 Construct combined texture-sampler ( temp sampler2DArray) +0:40 'g_tTex2df4a' ( uniform texture2DArray) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:40 c3: direct index for structure ( uniform 3-component vector of float) +0:40 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:40 Constant: +0:40 2 (const uint) +0:40 o2: direct index for structure ( uniform 2-component vector of int) +0:40 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:40 Constant: +0:40 5 (const uint) +0:40 Constant: +0:40 0 (const int) +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of int) +0:41 'txval011' ( temp 4-component vector of int) +0:41 textureGatherOffset ( temp 4-component vector of int) +0:41 Construct combined texture-sampler ( temp isampler2DArray) +0:41 'g_tTex2di4a' ( uniform itexture2DArray) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:41 c3: direct index for structure ( uniform 3-component vector of float) +0:41 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:41 Constant: +0:41 2 (const uint) +0:41 o2: direct index for structure ( uniform 2-component vector of int) +0:41 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:41 Constant: +0:41 5 (const uint) +0:41 Constant: +0:41 0 (const int) +0:42 Sequence +0:42 move second child to first child ( temp 4-component vector of uint) +0:42 'txval021' ( temp 4-component vector of uint) +0:42 textureGatherOffset ( temp 4-component vector of uint) +0:42 Construct combined texture-sampler ( temp usampler2DArray) +0:42 'g_tTex2du4a' ( uniform utexture2DArray) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:42 c3: direct index for structure ( uniform 3-component vector of float) +0:42 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:42 Constant: +0:42 2 (const uint) +0:42 o2: direct index for structure ( uniform 2-component vector of int) +0:42 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:42 Constant: +0:42 5 (const uint) +0:42 Constant: +0:42 0 (const int) +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of float) +0:44 'txval004' ( temp 4-component vector of float) +0:44 textureGatherOffsets ( temp 4-component vector of float) +0:44 Construct combined texture-sampler ( temp sampler2DArray) +0:44 'g_tTex2df4a' ( uniform texture2DArray) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:44 c3: direct index for structure ( uniform 3-component vector of float) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:44 Constant: +0:44 2 (const uint) +0:44 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:44 o2: direct index for structure ( uniform 2-component vector of int) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:44 Constant: +0:44 5 (const uint) +0:44 o2: direct index for structure ( uniform 2-component vector of int) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:44 Constant: +0:44 5 (const uint) +0:44 o2: direct index for structure ( uniform 2-component vector of int) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:44 Constant: +0:44 5 (const uint) +0:44 o2: direct index for structure ( uniform 2-component vector of int) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:44 Constant: +0:44 5 (const uint) +0:44 Constant: +0:44 0 (const int) +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of int) +0:45 'txval014' ( temp 4-component vector of int) +0:45 textureGatherOffsets ( temp 4-component vector of int) +0:45 Construct combined texture-sampler ( temp isampler2DArray) +0:45 'g_tTex2di4a' ( uniform itexture2DArray) +0:45 'g_sSamp' (layout( binding=0) uniform sampler) +0:45 c3: direct index for structure ( uniform 3-component vector of float) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:45 Constant: +0:45 2 (const uint) +0:45 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:45 o2: direct index for structure ( uniform 2-component vector of int) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:45 Constant: +0:45 5 (const uint) +0:45 o2: direct index for structure ( uniform 2-component vector of int) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:45 Constant: +0:45 5 (const uint) +0:45 o2: direct index for structure ( uniform 2-component vector of int) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:45 Constant: +0:45 5 (const uint) +0:45 o2: direct index for structure ( uniform 2-component vector of int) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:45 Constant: +0:45 5 (const uint) +0:45 Constant: +0:45 0 (const int) +0:46 Sequence +0:46 move second child to first child ( temp 4-component vector of uint) +0:46 'txval024' ( temp 4-component vector of uint) +0:46 textureGatherOffsets ( temp 4-component vector of uint) +0:46 Construct combined texture-sampler ( temp usampler2DArray) +0:46 'g_tTex2du4a' ( uniform utexture2DArray) +0:46 'g_sSamp' (layout( binding=0) uniform sampler) +0:46 c3: direct index for structure ( uniform 3-component vector of float) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:46 Constant: +0:46 2 (const uint) +0:46 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:46 o2: direct index for structure ( uniform 2-component vector of int) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:46 Constant: +0:46 5 (const uint) +0:46 o2: direct index for structure ( uniform 2-component vector of int) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:46 Constant: +0:46 5 (const uint) +0:46 o2: direct index for structure ( uniform 2-component vector of int) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:46 Constant: +0:46 5 (const uint) +0:46 o2: direct index for structure ( uniform 2-component vector of int) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:46 Constant: +0:46 5 (const uint) +0:46 Constant: +0:46 0 (const int) +0:56 Sequence +0:56 move second child to first child ( temp 4-component vector of float) +0:56 'txval101' ( temp 4-component vector of float) +0:56 textureGatherOffset ( temp 4-component vector of float) +0:56 Construct combined texture-sampler ( temp sampler2DArray) +0:56 'g_tTex2df4a' ( uniform texture2DArray) +0:56 'g_sSamp' (layout( binding=0) uniform sampler) +0:56 c3: direct index for structure ( uniform 3-component vector of float) +0:56 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:56 Constant: +0:56 2 (const uint) +0:56 o2: direct index for structure ( uniform 2-component vector of int) +0:56 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:56 Constant: +0:56 5 (const uint) +0:56 Constant: +0:56 1 (const int) +0:57 Sequence +0:57 move second child to first child ( temp 4-component vector of int) +0:57 'txval111' ( temp 4-component vector of int) +0:57 textureGatherOffset ( temp 4-component vector of int) +0:57 Construct combined texture-sampler ( temp isampler2DArray) +0:57 'g_tTex2di4a' ( uniform itexture2DArray) +0:57 'g_sSamp' (layout( binding=0) uniform sampler) +0:57 c3: direct index for structure ( uniform 3-component vector of float) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 2 (const uint) +0:57 o2: direct index for structure ( uniform 2-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 5 (const uint) +0:57 Constant: +0:57 1 (const int) +0:58 Sequence +0:58 move second child to first child ( temp 4-component vector of uint) +0:58 'txval121' ( temp 4-component vector of uint) +0:58 textureGatherOffset ( temp 4-component vector of uint) +0:58 Construct combined texture-sampler ( temp usampler2DArray) +0:58 'g_tTex2du4a' ( uniform utexture2DArray) +0:58 'g_sSamp' (layout( binding=0) uniform sampler) +0:58 c3: direct index for structure ( uniform 3-component vector of float) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 2 (const uint) +0:58 o2: direct index for structure ( uniform 2-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 5 (const uint) +0:58 Constant: +0:58 1 (const int) +0:60 Sequence +0:60 move second child to first child ( temp 4-component vector of float) +0:60 'txval104' ( temp 4-component vector of float) +0:60 textureGatherOffsets ( temp 4-component vector of float) +0:60 Construct combined texture-sampler ( temp sampler2DArray) +0:60 'g_tTex2df4a' ( uniform texture2DArray) +0:60 'g_sSamp' (layout( binding=0) uniform sampler) +0:60 c3: direct index for structure ( uniform 3-component vector of float) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:60 Constant: +0:60 2 (const uint) +0:60 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:60 o2: direct index for structure ( uniform 2-component vector of int) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:60 Constant: +0:60 5 (const uint) +0:60 o2: direct index for structure ( uniform 2-component vector of int) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:60 Constant: +0:60 5 (const uint) +0:60 o2: direct index for structure ( uniform 2-component vector of int) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:60 Constant: +0:60 5 (const uint) +0:60 o2: direct index for structure ( uniform 2-component vector of int) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:60 Constant: +0:60 5 (const uint) +0:60 Constant: +0:60 1 (const int) +0:61 Sequence +0:61 move second child to first child ( temp 4-component vector of int) +0:61 'txval114' ( temp 4-component vector of int) +0:61 textureGatherOffsets ( temp 4-component vector of int) +0:61 Construct combined texture-sampler ( temp isampler2DArray) +0:61 'g_tTex2di4a' ( uniform itexture2DArray) +0:61 'g_sSamp' (layout( binding=0) uniform sampler) +0:61 c3: direct index for structure ( uniform 3-component vector of float) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:61 Constant: +0:61 2 (const uint) +0:61 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:61 o2: direct index for structure ( uniform 2-component vector of int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:61 Constant: +0:61 5 (const uint) +0:61 o2: direct index for structure ( uniform 2-component vector of int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:61 Constant: +0:61 5 (const uint) +0:61 o2: direct index for structure ( uniform 2-component vector of int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:61 Constant: +0:61 5 (const uint) +0:61 o2: direct index for structure ( uniform 2-component vector of int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:61 Constant: +0:61 5 (const uint) +0:61 Constant: +0:61 1 (const int) +0:62 Sequence +0:62 move second child to first child ( temp 4-component vector of uint) +0:62 'txval124' ( temp 4-component vector of uint) +0:62 textureGatherOffsets ( temp 4-component vector of uint) +0:62 Construct combined texture-sampler ( temp usampler2DArray) +0:62 'g_tTex2du4a' ( uniform utexture2DArray) +0:62 'g_sSamp' (layout( binding=0) uniform sampler) +0:62 c3: direct index for structure ( uniform 3-component vector of float) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 2 (const uint) +0:62 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:62 o2: direct index for structure ( uniform 2-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 5 (const uint) +0:62 o2: direct index for structure ( uniform 2-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 5 (const uint) +0:62 o2: direct index for structure ( uniform 2-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 5 (const uint) +0:62 o2: direct index for structure ( uniform 2-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 5 (const uint) +0:62 Constant: +0:62 1 (const int) +0:72 Sequence +0:72 move second child to first child ( temp 4-component vector of float) +0:72 'txval201' ( temp 4-component vector of float) +0:72 textureGatherOffset ( temp 4-component vector of float) +0:72 Construct combined texture-sampler ( temp sampler2DArray) +0:72 'g_tTex2df4a' ( uniform texture2DArray) +0:72 'g_sSamp' (layout( binding=0) uniform sampler) +0:72 c3: direct index for structure ( uniform 3-component vector of float) +0:72 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:72 Constant: +0:72 2 (const uint) +0:72 o2: direct index for structure ( uniform 2-component vector of int) +0:72 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:72 Constant: +0:72 5 (const uint) +0:72 Constant: +0:72 2 (const int) +0:73 Sequence +0:73 move second child to first child ( temp 4-component vector of int) +0:73 'txval211' ( temp 4-component vector of int) +0:73 textureGatherOffset ( temp 4-component vector of int) +0:73 Construct combined texture-sampler ( temp isampler2DArray) +0:73 'g_tTex2di4a' ( uniform itexture2DArray) +0:73 'g_sSamp' (layout( binding=0) uniform sampler) +0:73 c3: direct index for structure ( uniform 3-component vector of float) +0:73 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:73 Constant: +0:73 2 (const uint) +0:73 o2: direct index for structure ( uniform 2-component vector of int) +0:73 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:73 Constant: +0:73 5 (const uint) +0:73 Constant: +0:73 2 (const int) +0:74 Sequence +0:74 move second child to first child ( temp 4-component vector of uint) +0:74 'txval221' ( temp 4-component vector of uint) +0:74 textureGatherOffset ( temp 4-component vector of uint) +0:74 Construct combined texture-sampler ( temp usampler2DArray) +0:74 'g_tTex2du4a' ( uniform utexture2DArray) +0:74 'g_sSamp' (layout( binding=0) uniform sampler) +0:74 c3: direct index for structure ( uniform 3-component vector of float) +0:74 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:74 Constant: +0:74 2 (const uint) +0:74 o2: direct index for structure ( uniform 2-component vector of int) +0:74 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:74 Constant: +0:74 5 (const uint) +0:74 Constant: +0:74 2 (const int) +0:76 Sequence +0:76 move second child to first child ( temp 4-component vector of float) +0:76 'txval204' ( temp 4-component vector of float) +0:76 textureGatherOffsets ( temp 4-component vector of float) +0:76 Construct combined texture-sampler ( temp sampler2DArray) +0:76 'g_tTex2df4a' ( uniform texture2DArray) +0:76 'g_sSamp' (layout( binding=0) uniform sampler) +0:76 c3: direct index for structure ( uniform 3-component vector of float) +0:76 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:76 Constant: +0:76 2 (const uint) +0:76 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:76 o2: direct index for structure ( uniform 2-component vector of int) +0:76 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:76 Constant: +0:76 5 (const uint) +0:76 o2: direct index for structure ( uniform 2-component vector of int) +0:76 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:76 Constant: +0:76 5 (const uint) +0:76 o2: direct index for structure ( uniform 2-component vector of int) +0:76 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:76 Constant: +0:76 5 (const uint) +0:76 o2: direct index for structure ( uniform 2-component vector of int) +0:76 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:76 Constant: +0:76 5 (const uint) +0:76 Constant: +0:76 2 (const int) +0:77 Sequence +0:77 move second child to first child ( temp 4-component vector of int) +0:77 'txval214' ( temp 4-component vector of int) +0:77 textureGatherOffsets ( temp 4-component vector of int) +0:77 Construct combined texture-sampler ( temp isampler2DArray) +0:77 'g_tTex2di4a' ( uniform itexture2DArray) +0:77 'g_sSamp' (layout( binding=0) uniform sampler) +0:77 c3: direct index for structure ( uniform 3-component vector of float) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:77 Constant: +0:77 2 (const uint) +0:77 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:77 o2: direct index for structure ( uniform 2-component vector of int) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:77 Constant: +0:77 5 (const uint) +0:77 o2: direct index for structure ( uniform 2-component vector of int) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:77 Constant: +0:77 5 (const uint) +0:77 o2: direct index for structure ( uniform 2-component vector of int) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:77 Constant: +0:77 5 (const uint) +0:77 o2: direct index for structure ( uniform 2-component vector of int) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:77 Constant: +0:77 5 (const uint) +0:77 Constant: +0:77 2 (const int) +0:78 Sequence +0:78 move second child to first child ( temp 4-component vector of uint) +0:78 'txval224' ( temp 4-component vector of uint) +0:78 textureGatherOffsets ( temp 4-component vector of uint) +0:78 Construct combined texture-sampler ( temp usampler2DArray) +0:78 'g_tTex2du4a' ( uniform utexture2DArray) +0:78 'g_sSamp' (layout( binding=0) uniform sampler) +0:78 c3: direct index for structure ( uniform 3-component vector of float) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:78 Constant: +0:78 2 (const uint) +0:78 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:78 o2: direct index for structure ( uniform 2-component vector of int) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:78 Constant: +0:78 5 (const uint) +0:78 o2: direct index for structure ( uniform 2-component vector of int) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:78 Constant: +0:78 5 (const uint) +0:78 o2: direct index for structure ( uniform 2-component vector of int) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:78 Constant: +0:78 5 (const uint) +0:78 o2: direct index for structure ( uniform 2-component vector of int) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:78 Constant: +0:78 5 (const uint) +0:78 Constant: +0:78 2 (const int) +0:88 Sequence +0:88 move second child to first child ( temp 4-component vector of float) +0:88 'txval301' ( temp 4-component vector of float) +0:88 textureGatherOffset ( temp 4-component vector of float) +0:88 Construct combined texture-sampler ( temp sampler2DArray) +0:88 'g_tTex2df4a' ( uniform texture2DArray) +0:88 'g_sSamp' (layout( binding=0) uniform sampler) +0:88 c3: direct index for structure ( uniform 3-component vector of float) +0:88 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:88 Constant: +0:88 2 (const uint) +0:88 o2: direct index for structure ( uniform 2-component vector of int) +0:88 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:88 Constant: +0:88 5 (const uint) +0:88 Constant: +0:88 3 (const int) +0:89 Sequence +0:89 move second child to first child ( temp 4-component vector of int) +0:89 'txval311' ( temp 4-component vector of int) +0:89 textureGatherOffset ( temp 4-component vector of int) +0:89 Construct combined texture-sampler ( temp isampler2DArray) +0:89 'g_tTex2di4a' ( uniform itexture2DArray) +0:89 'g_sSamp' (layout( binding=0) uniform sampler) +0:89 c3: direct index for structure ( uniform 3-component vector of float) +0:89 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:89 Constant: +0:89 2 (const uint) +0:89 o2: direct index for structure ( uniform 2-component vector of int) +0:89 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:89 Constant: +0:89 5 (const uint) +0:89 Constant: +0:89 3 (const int) +0:90 Sequence +0:90 move second child to first child ( temp 4-component vector of uint) +0:90 'txval321' ( temp 4-component vector of uint) +0:90 textureGatherOffset ( temp 4-component vector of uint) +0:90 Construct combined texture-sampler ( temp usampler2DArray) +0:90 'g_tTex2du4a' ( uniform utexture2DArray) +0:90 'g_sSamp' (layout( binding=0) uniform sampler) +0:90 c3: direct index for structure ( uniform 3-component vector of float) +0:90 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:90 Constant: +0:90 2 (const uint) +0:90 o2: direct index for structure ( uniform 2-component vector of int) +0:90 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:90 Constant: +0:90 5 (const uint) +0:90 Constant: +0:90 3 (const int) +0:92 Sequence +0:92 move second child to first child ( temp 4-component vector of float) +0:92 'txval304' ( temp 4-component vector of float) +0:92 textureGatherOffsets ( temp 4-component vector of float) +0:92 Construct combined texture-sampler ( temp sampler2DArray) +0:92 'g_tTex2df4a' ( uniform texture2DArray) +0:92 'g_sSamp' (layout( binding=0) uniform sampler) +0:92 c3: direct index for structure ( uniform 3-component vector of float) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:92 Constant: +0:92 2 (const uint) +0:92 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:92 o2: direct index for structure ( uniform 2-component vector of int) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:92 Constant: +0:92 5 (const uint) +0:92 o2: direct index for structure ( uniform 2-component vector of int) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:92 Constant: +0:92 5 (const uint) +0:92 o2: direct index for structure ( uniform 2-component vector of int) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:92 Constant: +0:92 5 (const uint) +0:92 o2: direct index for structure ( uniform 2-component vector of int) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:92 Constant: +0:92 5 (const uint) +0:92 Constant: +0:92 3 (const int) +0:93 Sequence +0:93 move second child to first child ( temp 4-component vector of int) +0:93 'txval314' ( temp 4-component vector of int) +0:93 textureGatherOffsets ( temp 4-component vector of int) +0:93 Construct combined texture-sampler ( temp isampler2DArray) +0:93 'g_tTex2di4a' ( uniform itexture2DArray) +0:93 'g_sSamp' (layout( binding=0) uniform sampler) +0:93 c3: direct index for structure ( uniform 3-component vector of float) +0:93 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:93 Constant: +0:93 2 (const uint) +0:93 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:93 o2: direct index for structure ( uniform 2-component vector of int) +0:93 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:93 Constant: +0:93 5 (const uint) +0:93 o2: direct index for structure ( uniform 2-component vector of int) +0:93 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:93 Constant: +0:93 5 (const uint) +0:93 o2: direct index for structure ( uniform 2-component vector of int) +0:93 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:93 Constant: +0:93 5 (const uint) +0:93 o2: direct index for structure ( uniform 2-component vector of int) +0:93 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:93 Constant: +0:93 5 (const uint) +0:93 Constant: +0:93 3 (const int) +0:94 Sequence +0:94 move second child to first child ( temp 4-component vector of uint) +0:94 'txval324' ( temp 4-component vector of uint) +0:94 textureGatherOffsets ( temp 4-component vector of uint) +0:94 Construct combined texture-sampler ( temp usampler2DArray) +0:94 'g_tTex2du4a' ( uniform utexture2DArray) +0:94 'g_sSamp' (layout( binding=0) uniform sampler) +0:94 c3: direct index for structure ( uniform 3-component vector of float) +0:94 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:94 Constant: +0:94 2 (const uint) +0:94 Construct ivec2 ( temp 4-element array of 2-component vector of int) +0:94 o2: direct index for structure ( uniform 2-component vector of int) +0:94 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:94 Constant: +0:94 5 (const uint) +0:94 o2: direct index for structure ( uniform 2-component vector of int) +0:94 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:94 Constant: +0:94 5 (const uint) +0:94 o2: direct index for structure ( uniform 2-component vector of int) +0:94 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:94 Constant: +0:94 5 (const uint) +0:94 o2: direct index for structure ( uniform 2-component vector of int) +0:94 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:94 Constant: +0:94 5 (const uint) +0:94 Constant: +0:94 3 (const int) +0:106 move second child to first child ( temp 4-component vector of float) +0:106 Color: direct index for structure ( temp 4-component vector of float) +0:106 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 1.000000 +0:106 1.000000 +0:106 1.000000 +0:106 1.000000 +0:107 move second child to first child ( temp float) +0:107 Depth: direct index for structure ( temp float) +0:107 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:107 Constant: +0:107 1 (const int) +0:107 Constant: +0:107 1.000000 +0:109 Branch: Return with expression +0:109 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 Function Definition: main( ( temp void) +0:33 Function Parameters: +0:? Sequence +0:33 Sequence +0:33 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:33 Color: direct index for structure ( temp 4-component vector of float) +0:33 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 Constant: +0:33 0 (const int) +0:33 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:33 Depth: direct index for structure ( temp float) +0:33 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 Constant: +0:33 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_sSamp2d' ( uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: Expected Image Operand ConstOffsets to be a const object + %90 = OpImageGather %v4float %76 %78 %int_0 ConstOffsets %89 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 389 + + Capability Shader + Capability ImageGatherExtended + Capability Sampled1D + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 363 367 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval001" + Name 16 "g_tTex2df4a" + Name 20 "g_sSamp" + Name 30 "$Global" + MemberName 30($Global) 0 "c1" + MemberName 30($Global) 1 "c2" + MemberName 30($Global) 2 "c3" + MemberName 30($Global) 3 "c4" + MemberName 30($Global) 4 "o1" + MemberName 30($Global) 5 "o2" + MemberName 30($Global) 6 "o3" + MemberName 30($Global) 7 "o4" + Name 32 "" + Name 44 "txval011" + Name 47 "g_tTex2di4a" + Name 60 "txval021" + Name 63 "g_tTex2du4a" + Name 73 "txval004" + Name 91 "txval014" + Name 107 "txval024" + Name 123 "txval101" + Name 133 "txval111" + Name 142 "txval121" + Name 151 "txval104" + Name 167 "txval114" + Name 183 "txval124" + Name 199 "txval201" + Name 208 "txval211" + Name 217 "txval221" + Name 226 "txval204" + Name 242 "txval214" + Name 258 "txval224" + Name 274 "txval301" + Name 284 "txval311" + Name 293 "txval321" + Name 302 "txval304" + Name 318 "txval314" + Name 334 "txval324" + Name 351 "psout" + Name 360 "flattenTemp" + Name 363 "@entryPointOutput.Color" + Name 367 "@entryPointOutput.Depth" + Name 370 "g_sSamp2d" + Name 373 "g_tTex1df4a" + Name 376 "g_tTex1di4a" + Name 379 "g_tTex1du4a" + Name 382 "g_tTexcdf4a" + Name 385 "g_tTexcdi4a" + Name 388 "g_tTexcdu4a" + Decorate 16(g_tTex2df4a) DescriptorSet 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + MemberDecorate 30($Global) 0 Offset 0 + MemberDecorate 30($Global) 1 Offset 8 + MemberDecorate 30($Global) 2 Offset 16 + MemberDecorate 30($Global) 3 Offset 32 + MemberDecorate 30($Global) 4 Offset 48 + MemberDecorate 30($Global) 5 Offset 56 + MemberDecorate 30($Global) 6 Offset 64 + MemberDecorate 30($Global) 7 Offset 80 + Decorate 30($Global) Block + Decorate 32 DescriptorSet 0 + Decorate 47(g_tTex2di4a) DescriptorSet 0 + Decorate 63(g_tTex2du4a) DescriptorSet 0 + Decorate 363(@entryPointOutput.Color) Location 0 + Decorate 367(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 370(g_sSamp2d) DescriptorSet 0 + Decorate 373(g_tTex1df4a) DescriptorSet 0 + Decorate 373(g_tTex1df4a) Binding 0 + Decorate 376(g_tTex1di4a) DescriptorSet 0 + Decorate 379(g_tTex1du4a) DescriptorSet 0 + Decorate 382(g_tTexcdf4a) DescriptorSet 0 + Decorate 385(g_tTexcdi4a) DescriptorSet 0 + Decorate 388(g_tTexcdu4a) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 2D array sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex2df4a): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 2 + 25: TypeVector 6(float) 3 + 26: TypeInt 32 1 + 27: TypeVector 26(int) 2 + 28: TypeVector 26(int) 3 + 29: TypeVector 26(int) 4 + 30($Global): TypeStruct 6(float) 24(fvec2) 25(fvec3) 7(fvec4) 26(int) 27(ivec2) 28(ivec3) 29(ivec4) + 31: TypePointer Uniform 30($Global) + 32: 31(ptr) Variable Uniform + 33: 26(int) Constant 2 + 34: TypePointer Uniform 25(fvec3) + 37: 26(int) Constant 5 + 38: TypePointer Uniform 27(ivec2) + 41: 26(int) Constant 0 + 43: TypePointer Function 29(ivec4) + 45: TypeImage 26(int) 2D array sampled format:Unknown + 46: TypePointer UniformConstant 45 + 47(g_tTex2di4a): 46(ptr) Variable UniformConstant + 50: TypeSampledImage 45 + 57: TypeInt 32 0 + 58: TypeVector 57(int) 4 + 59: TypePointer Function 58(ivec4) + 61: TypeImage 57(int) 2D array sampled format:Unknown + 62: TypePointer UniformConstant 61 + 63(g_tTex2du4a): 62(ptr) Variable UniformConstant + 66: TypeSampledImage 61 + 87: 57(int) Constant 4 + 88: TypeArray 27(ivec2) 87 + 131: 26(int) Constant 1 + 282: 26(int) Constant 3 + 350: TypePointer Function 8(PS_OUTPUT) + 352: 6(float) Constant 1065353216 + 353: 7(fvec4) ConstantComposite 352 352 352 352 + 355: TypePointer Function 6(float) + 362: TypePointer Output 7(fvec4) +363(@entryPointOutput.Color): 362(ptr) Variable Output + 366: TypePointer Output 6(float) +367(@entryPointOutput.Depth): 366(ptr) Variable Output + 370(g_sSamp2d): 19(ptr) Variable UniformConstant + 371: TypeImage 6(float) 1D array sampled format:Unknown + 372: TypePointer UniformConstant 371 +373(g_tTex1df4a): 372(ptr) Variable UniformConstant + 374: TypeImage 26(int) 1D array sampled format:Unknown + 375: TypePointer UniformConstant 374 +376(g_tTex1di4a): 375(ptr) Variable UniformConstant + 377: TypeImage 57(int) 1D array sampled format:Unknown + 378: TypePointer UniformConstant 377 +379(g_tTex1du4a): 378(ptr) Variable UniformConstant + 380: TypeImage 6(float) Cube array sampled format:Unknown + 381: TypePointer UniformConstant 380 +382(g_tTexcdf4a): 381(ptr) Variable UniformConstant + 383: TypeImage 26(int) Cube array sampled format:Unknown + 384: TypePointer UniformConstant 383 +385(g_tTexcdi4a): 384(ptr) Variable UniformConstant + 386: TypeImage 57(int) Cube array sampled format:Unknown + 387: TypePointer UniformConstant 386 +388(g_tTexcdu4a): 387(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +360(flattenTemp): 350(ptr) Variable Function + 361:8(PS_OUTPUT) FunctionCall 10(@main() + Store 360(flattenTemp) 361 + 364: 12(ptr) AccessChain 360(flattenTemp) 41 + 365: 7(fvec4) Load 364 + Store 363(@entryPointOutput.Color) 365 + 368: 355(ptr) AccessChain 360(flattenTemp) 131 + 369: 6(float) Load 368 + Store 367(@entryPointOutput.Depth) 369 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval001): 12(ptr) Variable Function + 44(txval011): 43(ptr) Variable Function + 60(txval021): 59(ptr) Variable Function + 73(txval004): 12(ptr) Variable Function + 91(txval014): 43(ptr) Variable Function + 107(txval024): 59(ptr) Variable Function + 123(txval101): 12(ptr) Variable Function + 133(txval111): 43(ptr) Variable Function + 142(txval121): 59(ptr) Variable Function + 151(txval104): 12(ptr) Variable Function + 167(txval114): 43(ptr) Variable Function + 183(txval124): 59(ptr) Variable Function + 199(txval201): 12(ptr) Variable Function + 208(txval211): 43(ptr) Variable Function + 217(txval221): 59(ptr) Variable Function + 226(txval204): 12(ptr) Variable Function + 242(txval214): 43(ptr) Variable Function + 258(txval224): 59(ptr) Variable Function + 274(txval301): 12(ptr) Variable Function + 284(txval311): 43(ptr) Variable Function + 293(txval321): 59(ptr) Variable Function + 302(txval304): 12(ptr) Variable Function + 318(txval314): 43(ptr) Variable Function + 334(txval324): 59(ptr) Variable Function + 351(psout): 350(ptr) Variable Function + 17: 14 Load 16(g_tTex2df4a) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 35: 34(ptr) AccessChain 32 33 + 36: 25(fvec3) Load 35 + 39: 38(ptr) AccessChain 32 37 + 40: 27(ivec2) Load 39 + 42: 7(fvec4) ImageGather 23 36 41 Offset 40 + Store 13(txval001) 42 + 48: 45 Load 47(g_tTex2di4a) + 49: 18 Load 20(g_sSamp) + 51: 50 SampledImage 48 49 + 52: 34(ptr) AccessChain 32 33 + 53: 25(fvec3) Load 52 + 54: 38(ptr) AccessChain 32 37 + 55: 27(ivec2) Load 54 + 56: 29(ivec4) ImageGather 51 53 41 Offset 55 + Store 44(txval011) 56 + 64: 61 Load 63(g_tTex2du4a) + 65: 18 Load 20(g_sSamp) + 67: 66 SampledImage 64 65 + 68: 34(ptr) AccessChain 32 33 + 69: 25(fvec3) Load 68 + 70: 38(ptr) AccessChain 32 37 + 71: 27(ivec2) Load 70 + 72: 58(ivec4) ImageGather 67 69 41 Offset 71 + Store 60(txval021) 72 + 74: 14 Load 16(g_tTex2df4a) + 75: 18 Load 20(g_sSamp) + 76: 22 SampledImage 74 75 + 77: 34(ptr) AccessChain 32 33 + 78: 25(fvec3) Load 77 + 79: 38(ptr) AccessChain 32 37 + 80: 27(ivec2) Load 79 + 81: 38(ptr) AccessChain 32 37 + 82: 27(ivec2) Load 81 + 83: 38(ptr) AccessChain 32 37 + 84: 27(ivec2) Load 83 + 85: 38(ptr) AccessChain 32 37 + 86: 27(ivec2) Load 85 + 89: 88 CompositeConstruct 80 82 84 86 + 90: 7(fvec4) ImageGather 76 78 41 ConstOffsets 89 + Store 73(txval004) 90 + 92: 45 Load 47(g_tTex2di4a) + 93: 18 Load 20(g_sSamp) + 94: 50 SampledImage 92 93 + 95: 34(ptr) AccessChain 32 33 + 96: 25(fvec3) Load 95 + 97: 38(ptr) AccessChain 32 37 + 98: 27(ivec2) Load 97 + 99: 38(ptr) AccessChain 32 37 + 100: 27(ivec2) Load 99 + 101: 38(ptr) AccessChain 32 37 + 102: 27(ivec2) Load 101 + 103: 38(ptr) AccessChain 32 37 + 104: 27(ivec2) Load 103 + 105: 88 CompositeConstruct 98 100 102 104 + 106: 29(ivec4) ImageGather 94 96 41 ConstOffsets 105 + Store 91(txval014) 106 + 108: 61 Load 63(g_tTex2du4a) + 109: 18 Load 20(g_sSamp) + 110: 66 SampledImage 108 109 + 111: 34(ptr) AccessChain 32 33 + 112: 25(fvec3) Load 111 + 113: 38(ptr) AccessChain 32 37 + 114: 27(ivec2) Load 113 + 115: 38(ptr) AccessChain 32 37 + 116: 27(ivec2) Load 115 + 117: 38(ptr) AccessChain 32 37 + 118: 27(ivec2) Load 117 + 119: 38(ptr) AccessChain 32 37 + 120: 27(ivec2) Load 119 + 121: 88 CompositeConstruct 114 116 118 120 + 122: 58(ivec4) ImageGather 110 112 41 ConstOffsets 121 + Store 107(txval024) 122 + 124: 14 Load 16(g_tTex2df4a) + 125: 18 Load 20(g_sSamp) + 126: 22 SampledImage 124 125 + 127: 34(ptr) AccessChain 32 33 + 128: 25(fvec3) Load 127 + 129: 38(ptr) AccessChain 32 37 + 130: 27(ivec2) Load 129 + 132: 7(fvec4) ImageGather 126 128 131 Offset 130 + Store 123(txval101) 132 + 134: 45 Load 47(g_tTex2di4a) + 135: 18 Load 20(g_sSamp) + 136: 50 SampledImage 134 135 + 137: 34(ptr) AccessChain 32 33 + 138: 25(fvec3) Load 137 + 139: 38(ptr) AccessChain 32 37 + 140: 27(ivec2) Load 139 + 141: 29(ivec4) ImageGather 136 138 131 Offset 140 + Store 133(txval111) 141 + 143: 61 Load 63(g_tTex2du4a) + 144: 18 Load 20(g_sSamp) + 145: 66 SampledImage 143 144 + 146: 34(ptr) AccessChain 32 33 + 147: 25(fvec3) Load 146 + 148: 38(ptr) AccessChain 32 37 + 149: 27(ivec2) Load 148 + 150: 58(ivec4) ImageGather 145 147 131 Offset 149 + Store 142(txval121) 150 + 152: 14 Load 16(g_tTex2df4a) + 153: 18 Load 20(g_sSamp) + 154: 22 SampledImage 152 153 + 155: 34(ptr) AccessChain 32 33 + 156: 25(fvec3) Load 155 + 157: 38(ptr) AccessChain 32 37 + 158: 27(ivec2) Load 157 + 159: 38(ptr) AccessChain 32 37 + 160: 27(ivec2) Load 159 + 161: 38(ptr) AccessChain 32 37 + 162: 27(ivec2) Load 161 + 163: 38(ptr) AccessChain 32 37 + 164: 27(ivec2) Load 163 + 165: 88 CompositeConstruct 158 160 162 164 + 166: 7(fvec4) ImageGather 154 156 131 ConstOffsets 165 + Store 151(txval104) 166 + 168: 45 Load 47(g_tTex2di4a) + 169: 18 Load 20(g_sSamp) + 170: 50 SampledImage 168 169 + 171: 34(ptr) AccessChain 32 33 + 172: 25(fvec3) Load 171 + 173: 38(ptr) AccessChain 32 37 + 174: 27(ivec2) Load 173 + 175: 38(ptr) AccessChain 32 37 + 176: 27(ivec2) Load 175 + 177: 38(ptr) AccessChain 32 37 + 178: 27(ivec2) Load 177 + 179: 38(ptr) AccessChain 32 37 + 180: 27(ivec2) Load 179 + 181: 88 CompositeConstruct 174 176 178 180 + 182: 29(ivec4) ImageGather 170 172 131 ConstOffsets 181 + Store 167(txval114) 182 + 184: 61 Load 63(g_tTex2du4a) + 185: 18 Load 20(g_sSamp) + 186: 66 SampledImage 184 185 + 187: 34(ptr) AccessChain 32 33 + 188: 25(fvec3) Load 187 + 189: 38(ptr) AccessChain 32 37 + 190: 27(ivec2) Load 189 + 191: 38(ptr) AccessChain 32 37 + 192: 27(ivec2) Load 191 + 193: 38(ptr) AccessChain 32 37 + 194: 27(ivec2) Load 193 + 195: 38(ptr) AccessChain 32 37 + 196: 27(ivec2) Load 195 + 197: 88 CompositeConstruct 190 192 194 196 + 198: 58(ivec4) ImageGather 186 188 131 ConstOffsets 197 + Store 183(txval124) 198 + 200: 14 Load 16(g_tTex2df4a) + 201: 18 Load 20(g_sSamp) + 202: 22 SampledImage 200 201 + 203: 34(ptr) AccessChain 32 33 + 204: 25(fvec3) Load 203 + 205: 38(ptr) AccessChain 32 37 + 206: 27(ivec2) Load 205 + 207: 7(fvec4) ImageGather 202 204 33 Offset 206 + Store 199(txval201) 207 + 209: 45 Load 47(g_tTex2di4a) + 210: 18 Load 20(g_sSamp) + 211: 50 SampledImage 209 210 + 212: 34(ptr) AccessChain 32 33 + 213: 25(fvec3) Load 212 + 214: 38(ptr) AccessChain 32 37 + 215: 27(ivec2) Load 214 + 216: 29(ivec4) ImageGather 211 213 33 Offset 215 + Store 208(txval211) 216 + 218: 61 Load 63(g_tTex2du4a) + 219: 18 Load 20(g_sSamp) + 220: 66 SampledImage 218 219 + 221: 34(ptr) AccessChain 32 33 + 222: 25(fvec3) Load 221 + 223: 38(ptr) AccessChain 32 37 + 224: 27(ivec2) Load 223 + 225: 58(ivec4) ImageGather 220 222 33 Offset 224 + Store 217(txval221) 225 + 227: 14 Load 16(g_tTex2df4a) + 228: 18 Load 20(g_sSamp) + 229: 22 SampledImage 227 228 + 230: 34(ptr) AccessChain 32 33 + 231: 25(fvec3) Load 230 + 232: 38(ptr) AccessChain 32 37 + 233: 27(ivec2) Load 232 + 234: 38(ptr) AccessChain 32 37 + 235: 27(ivec2) Load 234 + 236: 38(ptr) AccessChain 32 37 + 237: 27(ivec2) Load 236 + 238: 38(ptr) AccessChain 32 37 + 239: 27(ivec2) Load 238 + 240: 88 CompositeConstruct 233 235 237 239 + 241: 7(fvec4) ImageGather 229 231 33 ConstOffsets 240 + Store 226(txval204) 241 + 243: 45 Load 47(g_tTex2di4a) + 244: 18 Load 20(g_sSamp) + 245: 50 SampledImage 243 244 + 246: 34(ptr) AccessChain 32 33 + 247: 25(fvec3) Load 246 + 248: 38(ptr) AccessChain 32 37 + 249: 27(ivec2) Load 248 + 250: 38(ptr) AccessChain 32 37 + 251: 27(ivec2) Load 250 + 252: 38(ptr) AccessChain 32 37 + 253: 27(ivec2) Load 252 + 254: 38(ptr) AccessChain 32 37 + 255: 27(ivec2) Load 254 + 256: 88 CompositeConstruct 249 251 253 255 + 257: 29(ivec4) ImageGather 245 247 33 ConstOffsets 256 + Store 242(txval214) 257 + 259: 61 Load 63(g_tTex2du4a) + 260: 18 Load 20(g_sSamp) + 261: 66 SampledImage 259 260 + 262: 34(ptr) AccessChain 32 33 + 263: 25(fvec3) Load 262 + 264: 38(ptr) AccessChain 32 37 + 265: 27(ivec2) Load 264 + 266: 38(ptr) AccessChain 32 37 + 267: 27(ivec2) Load 266 + 268: 38(ptr) AccessChain 32 37 + 269: 27(ivec2) Load 268 + 270: 38(ptr) AccessChain 32 37 + 271: 27(ivec2) Load 270 + 272: 88 CompositeConstruct 265 267 269 271 + 273: 58(ivec4) ImageGather 261 263 33 ConstOffsets 272 + Store 258(txval224) 273 + 275: 14 Load 16(g_tTex2df4a) + 276: 18 Load 20(g_sSamp) + 277: 22 SampledImage 275 276 + 278: 34(ptr) AccessChain 32 33 + 279: 25(fvec3) Load 278 + 280: 38(ptr) AccessChain 32 37 + 281: 27(ivec2) Load 280 + 283: 7(fvec4) ImageGather 277 279 282 Offset 281 + Store 274(txval301) 283 + 285: 45 Load 47(g_tTex2di4a) + 286: 18 Load 20(g_sSamp) + 287: 50 SampledImage 285 286 + 288: 34(ptr) AccessChain 32 33 + 289: 25(fvec3) Load 288 + 290: 38(ptr) AccessChain 32 37 + 291: 27(ivec2) Load 290 + 292: 29(ivec4) ImageGather 287 289 282 Offset 291 + Store 284(txval311) 292 + 294: 61 Load 63(g_tTex2du4a) + 295: 18 Load 20(g_sSamp) + 296: 66 SampledImage 294 295 + 297: 34(ptr) AccessChain 32 33 + 298: 25(fvec3) Load 297 + 299: 38(ptr) AccessChain 32 37 + 300: 27(ivec2) Load 299 + 301: 58(ivec4) ImageGather 296 298 282 Offset 300 + Store 293(txval321) 301 + 303: 14 Load 16(g_tTex2df4a) + 304: 18 Load 20(g_sSamp) + 305: 22 SampledImage 303 304 + 306: 34(ptr) AccessChain 32 33 + 307: 25(fvec3) Load 306 + 308: 38(ptr) AccessChain 32 37 + 309: 27(ivec2) Load 308 + 310: 38(ptr) AccessChain 32 37 + 311: 27(ivec2) Load 310 + 312: 38(ptr) AccessChain 32 37 + 313: 27(ivec2) Load 312 + 314: 38(ptr) AccessChain 32 37 + 315: 27(ivec2) Load 314 + 316: 88 CompositeConstruct 309 311 313 315 + 317: 7(fvec4) ImageGather 305 307 282 ConstOffsets 316 + Store 302(txval304) 317 + 319: 45 Load 47(g_tTex2di4a) + 320: 18 Load 20(g_sSamp) + 321: 50 SampledImage 319 320 + 322: 34(ptr) AccessChain 32 33 + 323: 25(fvec3) Load 322 + 324: 38(ptr) AccessChain 32 37 + 325: 27(ivec2) Load 324 + 326: 38(ptr) AccessChain 32 37 + 327: 27(ivec2) Load 326 + 328: 38(ptr) AccessChain 32 37 + 329: 27(ivec2) Load 328 + 330: 38(ptr) AccessChain 32 37 + 331: 27(ivec2) Load 330 + 332: 88 CompositeConstruct 325 327 329 331 + 333: 29(ivec4) ImageGather 321 323 282 ConstOffsets 332 + Store 318(txval314) 333 + 335: 61 Load 63(g_tTex2du4a) + 336: 18 Load 20(g_sSamp) + 337: 66 SampledImage 335 336 + 338: 34(ptr) AccessChain 32 33 + 339: 25(fvec3) Load 338 + 340: 38(ptr) AccessChain 32 37 + 341: 27(ivec2) Load 340 + 342: 38(ptr) AccessChain 32 37 + 343: 27(ivec2) Load 342 + 344: 38(ptr) AccessChain 32 37 + 345: 27(ivec2) Load 344 + 346: 38(ptr) AccessChain 32 37 + 347: 27(ivec2) Load 346 + 348: 88 CompositeConstruct 341 343 345 347 + 349: 58(ivec4) ImageGather 337 339 282 ConstOffsets 348 + Store 334(txval324) 349 + 354: 12(ptr) AccessChain 351(psout) 41 + Store 354 353 + 356: 355(ptr) AccessChain 351(psout) 131 + Store 356 352 + 357:8(PS_OUTPUT) Load 351(psout) + ReturnValue 357 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out new file mode 100644 index 00000000..fe99df52 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out @@ -0,0 +1,711 @@ +hlsl.gathercmpRGBA.offset.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Parameters: +0:? Sequence +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of float) +0:45 'txval001' ( temp 4-component vector of float) +0:45 textureGatherOffset ( temp 4-component vector of float) +0:45 Construct combined texture-sampler ( temp sampler2DShadow) +0:45 'g_tTex2df4' ( uniform texture2DShadow) +0:45 'g_sSampCmp' (layout( binding=0) uniform sampler) +0:45 c2: direct index for structure ( uniform 2-component vector of float) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:45 Constant: +0:45 1 (const uint) +0:45 Constant: +0:45 0.750000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:46 Sequence +0:46 move second child to first child ( temp 4-component vector of int) +0:46 'txval011' ( temp 4-component vector of int) +0:46 textureGatherOffset ( temp 4-component vector of int) +0:46 Construct combined texture-sampler ( temp isampler2DShadow) +0:46 'g_tTex2di4' ( uniform itexture2DShadow) +0:46 'g_sSampCmp' (layout( binding=0) uniform sampler) +0:46 c2: direct index for structure ( uniform 2-component vector of float) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:46 Constant: +0:46 1 (const uint) +0:46 Constant: +0:46 0.750000 +0:? Constant: +0:? 1 (const int) +0:? -1 (const int) +0:47 Sequence +0:47 move second child to first child ( temp 4-component vector of uint) +0:47 'txval021' ( temp 4-component vector of uint) +0:47 textureGatherOffset ( temp 4-component vector of uint) +0:47 Construct combined texture-sampler ( temp usampler2DShadow) +0:47 'g_tTex2du4' ( uniform utexture2DShadow) +0:47 'g_sSampCmp' (layout( binding=0) uniform sampler) +0:47 c2: direct index for structure ( uniform 2-component vector of float) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:47 Constant: +0:47 1 (const uint) +0:47 Constant: +0:47 0.750000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:49 Sequence +0:49 move second child to first child ( temp 4-component vector of float) +0:49 'txval004' ( temp 4-component vector of float) +0:49 textureGatherOffsets ( temp 4-component vector of float) +0:49 Construct combined texture-sampler ( temp sampler2DShadow) +0:49 'g_tTex2df4' ( uniform texture2DShadow) +0:49 'g_sSampCmp' (layout( binding=0) uniform sampler) +0:49 c2: direct index for structure ( uniform 2-component vector of float) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:49 Constant: +0:49 1 (const uint) +0:49 Constant: +0:49 0.750000 +0:49 Constant: +0:49 1 (const int) +0:49 0 (const int) +0:49 1 (const int) +0:49 0 (const int) +0:49 1 (const int) +0:49 0 (const int) +0:49 1 (const int) +0:49 0 (const int) +0:50 Sequence +0:50 move second child to first child ( temp 4-component vector of int) +0:50 'txval014' ( temp 4-component vector of int) +0:50 textureGatherOffsets ( temp 4-component vector of int) +0:50 Construct combined texture-sampler ( temp isampler2DShadow) +0:50 'g_tTex2di4' ( uniform itexture2DShadow) +0:50 'g_sSampCmp' (layout( binding=0) uniform sampler) +0:50 c2: direct index for structure ( uniform 2-component vector of float) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:50 Constant: +0:50 1 (const uint) +0:50 Constant: +0:50 0.750000 +0:50 Constant: +0:50 1 (const int) +0:50 -1 (const int) +0:50 1 (const int) +0:50 -1 (const int) +0:50 1 (const int) +0:50 -1 (const int) +0:50 1 (const int) +0:50 -1 (const int) +0:51 Sequence +0:51 move second child to first child ( temp 4-component vector of uint) +0:51 'txval024' ( temp 4-component vector of uint) +0:51 textureGatherOffsets ( temp 4-component vector of uint) +0:51 Construct combined texture-sampler ( temp usampler2DShadow) +0:51 'g_tTex2du4' ( uniform utexture2DShadow) +0:51 'g_sSampCmp' (layout( binding=0) uniform sampler) +0:51 c2: direct index for structure ( uniform 2-component vector of float) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:51 Constant: +0:51 1 (const uint) +0:51 Constant: +0:51 0.750000 +0:51 Constant: +0:51 1 (const int) +0:51 1 (const int) +0:51 1 (const int) +0:51 1 (const int) +0:51 1 (const int) +0:51 1 (const int) +0:51 1 (const int) +0:51 1 (const int) +0:53 Sequence +0:53 move second child to first child ( temp 4-component vector of float) +0:53 'txval401' ( temp 4-component vector of float) +0:53 textureGatherOffset ( temp 4-component vector of float) +0:53 Construct combined texture-sampler ( temp sampler2DShadow) +0:53 'g_tTex2df4' ( uniform texture2DShadow) +0:53 'g_sSampCmp' (layout( binding=0) uniform sampler) +0:53 c2: direct index for structure ( uniform 2-component vector of float) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:53 Constant: +0:53 1 (const uint) +0:53 Constant: +0:53 0.750000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:54 Sequence +0:54 move second child to first child ( temp 4-component vector of int) +0:54 'txval411' ( temp 4-component vector of int) +0:54 textureGatherOffset ( temp 4-component vector of int) +0:54 Construct combined texture-sampler ( temp isampler2DShadow) +0:54 'g_tTex2di4' ( uniform itexture2DShadow) +0:54 'g_sSampCmp' (layout( binding=0) uniform sampler) +0:54 c2: direct index for structure ( uniform 2-component vector of float) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:54 Constant: +0:54 1 (const uint) +0:54 Constant: +0:54 0.750000 +0:? Constant: +0:? 1 (const int) +0:? -1 (const int) +0:55 Sequence +0:55 move second child to first child ( temp 4-component vector of uint) +0:55 'txval421' ( temp 4-component vector of uint) +0:55 textureGatherOffset ( temp 4-component vector of uint) +0:55 Construct combined texture-sampler ( temp usampler2DShadow) +0:55 'g_tTex2du4' ( uniform utexture2DShadow) +0:55 'g_sSampCmp' (layout( binding=0) uniform sampler) +0:55 c2: direct index for structure ( uniform 2-component vector of float) +0:55 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:55 Constant: +0:55 1 (const uint) +0:55 Constant: +0:55 0.750000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:110 move second child to first child ( temp 4-component vector of float) +0:110 Color: direct index for structure ( temp 4-component vector of float) +0:110 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:110 Constant: +0:110 0 (const int) +0:110 Constant: +0:110 1.000000 +0:110 1.000000 +0:110 1.000000 +0:110 1.000000 +0:111 move second child to first child ( temp float) +0:111 Depth: direct index for structure ( temp float) +0:111 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:111 Constant: +0:111 1 (const int) +0:111 Constant: +0:111 1.000000 +0:113 Branch: Return with expression +0:113 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Definition: main( ( temp void) +0:38 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:38 Color: direct index for structure ( temp 4-component vector of float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 0 (const int) +0:38 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:38 Depth: direct index for structure ( temp float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 1 (const int) +0:? Linker Objects +0:? 'g_sSampCmp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2DShadow) +0:? 'g_tTex2di4' ( uniform itexture2DShadow) +0:? 'g_tTex2du4' ( uniform utexture2DShadow) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Parameters: +0:? Sequence +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of float) +0:45 'txval001' ( temp 4-component vector of float) +0:45 textureGatherOffset ( temp 4-component vector of float) +0:45 Construct combined texture-sampler ( temp sampler2DShadow) +0:45 'g_tTex2df4' ( uniform texture2DShadow) +0:45 'g_sSampCmp' (layout( binding=0) uniform sampler) +0:45 c2: direct index for structure ( uniform 2-component vector of float) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:45 Constant: +0:45 1 (const uint) +0:45 Constant: +0:45 0.750000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:46 Sequence +0:46 move second child to first child ( temp 4-component vector of int) +0:46 'txval011' ( temp 4-component vector of int) +0:46 textureGatherOffset ( temp 4-component vector of int) +0:46 Construct combined texture-sampler ( temp isampler2DShadow) +0:46 'g_tTex2di4' ( uniform itexture2DShadow) +0:46 'g_sSampCmp' (layout( binding=0) uniform sampler) +0:46 c2: direct index for structure ( uniform 2-component vector of float) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:46 Constant: +0:46 1 (const uint) +0:46 Constant: +0:46 0.750000 +0:? Constant: +0:? 1 (const int) +0:? -1 (const int) +0:47 Sequence +0:47 move second child to first child ( temp 4-component vector of uint) +0:47 'txval021' ( temp 4-component vector of uint) +0:47 textureGatherOffset ( temp 4-component vector of uint) +0:47 Construct combined texture-sampler ( temp usampler2DShadow) +0:47 'g_tTex2du4' ( uniform utexture2DShadow) +0:47 'g_sSampCmp' (layout( binding=0) uniform sampler) +0:47 c2: direct index for structure ( uniform 2-component vector of float) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:47 Constant: +0:47 1 (const uint) +0:47 Constant: +0:47 0.750000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:49 Sequence +0:49 move second child to first child ( temp 4-component vector of float) +0:49 'txval004' ( temp 4-component vector of float) +0:49 textureGatherOffsets ( temp 4-component vector of float) +0:49 Construct combined texture-sampler ( temp sampler2DShadow) +0:49 'g_tTex2df4' ( uniform texture2DShadow) +0:49 'g_sSampCmp' (layout( binding=0) uniform sampler) +0:49 c2: direct index for structure ( uniform 2-component vector of float) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:49 Constant: +0:49 1 (const uint) +0:49 Constant: +0:49 0.750000 +0:49 Constant: +0:49 1 (const int) +0:49 0 (const int) +0:49 1 (const int) +0:49 0 (const int) +0:49 1 (const int) +0:49 0 (const int) +0:49 1 (const int) +0:49 0 (const int) +0:50 Sequence +0:50 move second child to first child ( temp 4-component vector of int) +0:50 'txval014' ( temp 4-component vector of int) +0:50 textureGatherOffsets ( temp 4-component vector of int) +0:50 Construct combined texture-sampler ( temp isampler2DShadow) +0:50 'g_tTex2di4' ( uniform itexture2DShadow) +0:50 'g_sSampCmp' (layout( binding=0) uniform sampler) +0:50 c2: direct index for structure ( uniform 2-component vector of float) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:50 Constant: +0:50 1 (const uint) +0:50 Constant: +0:50 0.750000 +0:50 Constant: +0:50 1 (const int) +0:50 -1 (const int) +0:50 1 (const int) +0:50 -1 (const int) +0:50 1 (const int) +0:50 -1 (const int) +0:50 1 (const int) +0:50 -1 (const int) +0:51 Sequence +0:51 move second child to first child ( temp 4-component vector of uint) +0:51 'txval024' ( temp 4-component vector of uint) +0:51 textureGatherOffsets ( temp 4-component vector of uint) +0:51 Construct combined texture-sampler ( temp usampler2DShadow) +0:51 'g_tTex2du4' ( uniform utexture2DShadow) +0:51 'g_sSampCmp' (layout( binding=0) uniform sampler) +0:51 c2: direct index for structure ( uniform 2-component vector of float) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:51 Constant: +0:51 1 (const uint) +0:51 Constant: +0:51 0.750000 +0:51 Constant: +0:51 1 (const int) +0:51 1 (const int) +0:51 1 (const int) +0:51 1 (const int) +0:51 1 (const int) +0:51 1 (const int) +0:51 1 (const int) +0:51 1 (const int) +0:53 Sequence +0:53 move second child to first child ( temp 4-component vector of float) +0:53 'txval401' ( temp 4-component vector of float) +0:53 textureGatherOffset ( temp 4-component vector of float) +0:53 Construct combined texture-sampler ( temp sampler2DShadow) +0:53 'g_tTex2df4' ( uniform texture2DShadow) +0:53 'g_sSampCmp' (layout( binding=0) uniform sampler) +0:53 c2: direct index for structure ( uniform 2-component vector of float) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:53 Constant: +0:53 1 (const uint) +0:53 Constant: +0:53 0.750000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:54 Sequence +0:54 move second child to first child ( temp 4-component vector of int) +0:54 'txval411' ( temp 4-component vector of int) +0:54 textureGatherOffset ( temp 4-component vector of int) +0:54 Construct combined texture-sampler ( temp isampler2DShadow) +0:54 'g_tTex2di4' ( uniform itexture2DShadow) +0:54 'g_sSampCmp' (layout( binding=0) uniform sampler) +0:54 c2: direct index for structure ( uniform 2-component vector of float) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:54 Constant: +0:54 1 (const uint) +0:54 Constant: +0:54 0.750000 +0:? Constant: +0:? 1 (const int) +0:? -1 (const int) +0:55 Sequence +0:55 move second child to first child ( temp 4-component vector of uint) +0:55 'txval421' ( temp 4-component vector of uint) +0:55 textureGatherOffset ( temp 4-component vector of uint) +0:55 Construct combined texture-sampler ( temp usampler2DShadow) +0:55 'g_tTex2du4' ( uniform utexture2DShadow) +0:55 'g_sSampCmp' (layout( binding=0) uniform sampler) +0:55 c2: direct index for structure ( uniform 2-component vector of float) +0:55 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:55 Constant: +0:55 1 (const uint) +0:55 Constant: +0:55 0.750000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:110 move second child to first child ( temp 4-component vector of float) +0:110 Color: direct index for structure ( temp 4-component vector of float) +0:110 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:110 Constant: +0:110 0 (const int) +0:110 Constant: +0:110 1.000000 +0:110 1.000000 +0:110 1.000000 +0:110 1.000000 +0:111 move second child to first child ( temp float) +0:111 Depth: direct index for structure ( temp float) +0:111 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:111 Constant: +0:111 1 (const int) +0:111 Constant: +0:111 1.000000 +0:113 Branch: Return with expression +0:113 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Definition: main( ( temp void) +0:38 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:38 Color: direct index for structure ( temp 4-component vector of float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 0 (const int) +0:38 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:38 Depth: direct index for structure ( temp float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 1 (const int) +0:? Linker Objects +0:? 'g_sSampCmp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2DShadow) +0:? 'g_tTex2di4' ( uniform itexture2DShadow) +0:? 'g_tTex2du4' ( uniform utexture2DShadow) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform float c1, uniform 2-component vector of float c2, uniform 3-component vector of float c3, uniform 4-component vector of float c4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 164 + + Capability Shader + Capability ImageGatherExtended + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 129 133 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval001" + Name 16 "g_tTex2df4" + Name 20 "g_sSampCmp" + Name 26 "$Global" + MemberName 26($Global) 0 "c1" + MemberName 26($Global) 1 "c2" + MemberName 26($Global) 2 "c3" + MemberName 26($Global) 3 "c4" + Name 28 "" + Name 41 "txval011" + Name 44 "g_tTex2di4" + Name 57 "txval021" + Name 60 "g_tTex2du4" + Name 69 "txval004" + Name 79 "txval014" + Name 87 "txval024" + Name 95 "txval401" + Name 102 "txval411" + Name 109 "txval421" + Name 117 "psout" + Name 126 "flattenTemp" + Name 129 "@entryPointOutput.Color" + Name 133 "@entryPointOutput.Depth" + Name 138 "g_tTex1df4a" + Name 139 "g_tTex1df4" + Name 142 "g_tTex1di4" + Name 145 "g_tTex1du4" + Name 148 "g_tTex3df4" + Name 151 "g_tTex3di4" + Name 154 "g_tTex3du4" + Name 157 "g_tTexcdf4" + Name 160 "g_tTexcdi4" + Name 163 "g_tTexcdu4" + Decorate 16(g_tTex2df4) DescriptorSet 0 + Decorate 20(g_sSampCmp) DescriptorSet 0 + Decorate 20(g_sSampCmp) Binding 0 + MemberDecorate 26($Global) 0 Offset 0 + MemberDecorate 26($Global) 1 Offset 8 + MemberDecorate 26($Global) 2 Offset 16 + MemberDecorate 26($Global) 3 Offset 32 + Decorate 26($Global) Block + Decorate 28 DescriptorSet 0 + Decorate 44(g_tTex2di4) DescriptorSet 0 + Decorate 60(g_tTex2du4) DescriptorSet 0 + Decorate 129(@entryPointOutput.Color) Location 0 + Decorate 133(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 138(g_tTex1df4a) DescriptorSet 0 + Decorate 138(g_tTex1df4a) Binding 1 + Decorate 139(g_tTex1df4) DescriptorSet 0 + Decorate 139(g_tTex1df4) Binding 0 + Decorate 142(g_tTex1di4) DescriptorSet 0 + Decorate 145(g_tTex1du4) DescriptorSet 0 + Decorate 148(g_tTex3df4) DescriptorSet 0 + Decorate 151(g_tTex3di4) DescriptorSet 0 + Decorate 154(g_tTex3du4) DescriptorSet 0 + Decorate 157(g_tTexcdf4) DescriptorSet 0 + Decorate 160(g_tTexcdi4) DescriptorSet 0 + Decorate 163(g_tTexcdu4) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 2D depth sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex2df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSampCmp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 2 + 25: TypeVector 6(float) 3 + 26($Global): TypeStruct 6(float) 24(fvec2) 25(fvec3) 7(fvec4) + 27: TypePointer Uniform 26($Global) + 28: 27(ptr) Variable Uniform + 29: TypeInt 32 1 + 30: 29(int) Constant 1 + 31: TypePointer Uniform 24(fvec2) + 34: 6(float) Constant 1061158912 + 35: TypeVector 29(int) 2 + 36: 29(int) Constant 0 + 37: 35(ivec2) ConstantComposite 30 36 + 39: TypeVector 29(int) 4 + 40: TypePointer Function 39(ivec4) + 42: TypeImage 29(int) 2D depth sampled format:Unknown + 43: TypePointer UniformConstant 42 + 44(g_tTex2di4): 43(ptr) Variable UniformConstant + 47: TypeSampledImage 42 + 51: 29(int) Constant 4294967295 + 52: 35(ivec2) ConstantComposite 30 51 + 54: TypeInt 32 0 + 55: TypeVector 54(int) 4 + 56: TypePointer Function 55(ivec4) + 58: TypeImage 54(int) 2D depth sampled format:Unknown + 59: TypePointer UniformConstant 58 + 60(g_tTex2du4): 59(ptr) Variable UniformConstant + 63: TypeSampledImage 58 + 67: 35(ivec2) ConstantComposite 30 30 + 75: 54(int) Constant 4 + 76: TypeArray 35(ivec2) 75 + 77: 76 ConstantComposite 37 37 37 37 + 85: 76 ConstantComposite 52 52 52 52 + 93: 76 ConstantComposite 67 67 67 67 + 116: TypePointer Function 8(PS_OUTPUT) + 118: 6(float) Constant 1065353216 + 119: 7(fvec4) ConstantComposite 118 118 118 118 + 121: TypePointer Function 6(float) + 128: TypePointer Output 7(fvec4) +129(@entryPointOutput.Color): 128(ptr) Variable Output + 132: TypePointer Output 6(float) +133(@entryPointOutput.Depth): 132(ptr) Variable Output + 136: TypeImage 6(float) 1D sampled format:Unknown + 137: TypePointer UniformConstant 136 +138(g_tTex1df4a): 137(ptr) Variable UniformConstant + 139(g_tTex1df4): 137(ptr) Variable UniformConstant + 140: TypeImage 29(int) 1D sampled format:Unknown + 141: TypePointer UniformConstant 140 + 142(g_tTex1di4): 141(ptr) Variable UniformConstant + 143: TypeImage 54(int) 1D sampled format:Unknown + 144: TypePointer UniformConstant 143 + 145(g_tTex1du4): 144(ptr) Variable UniformConstant + 146: TypeImage 6(float) 3D sampled format:Unknown + 147: TypePointer UniformConstant 146 + 148(g_tTex3df4): 147(ptr) Variable UniformConstant + 149: TypeImage 29(int) 3D sampled format:Unknown + 150: TypePointer UniformConstant 149 + 151(g_tTex3di4): 150(ptr) Variable UniformConstant + 152: TypeImage 54(int) 3D sampled format:Unknown + 153: TypePointer UniformConstant 152 + 154(g_tTex3du4): 153(ptr) Variable UniformConstant + 155: TypeImage 6(float) Cube sampled format:Unknown + 156: TypePointer UniformConstant 155 + 157(g_tTexcdf4): 156(ptr) Variable UniformConstant + 158: TypeImage 29(int) Cube sampled format:Unknown + 159: TypePointer UniformConstant 158 + 160(g_tTexcdi4): 159(ptr) Variable UniformConstant + 161: TypeImage 54(int) Cube sampled format:Unknown + 162: TypePointer UniformConstant 161 + 163(g_tTexcdu4): 162(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +126(flattenTemp): 116(ptr) Variable Function + 127:8(PS_OUTPUT) FunctionCall 10(@main() + Store 126(flattenTemp) 127 + 130: 12(ptr) AccessChain 126(flattenTemp) 36 + 131: 7(fvec4) Load 130 + Store 129(@entryPointOutput.Color) 131 + 134: 121(ptr) AccessChain 126(flattenTemp) 30 + 135: 6(float) Load 134 + Store 133(@entryPointOutput.Depth) 135 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval001): 12(ptr) Variable Function + 41(txval011): 40(ptr) Variable Function + 57(txval021): 56(ptr) Variable Function + 69(txval004): 12(ptr) Variable Function + 79(txval014): 40(ptr) Variable Function + 87(txval024): 56(ptr) Variable Function + 95(txval401): 12(ptr) Variable Function + 102(txval411): 40(ptr) Variable Function + 109(txval421): 56(ptr) Variable Function + 117(psout): 116(ptr) Variable Function + 17: 14 Load 16(g_tTex2df4) + 21: 18 Load 20(g_sSampCmp) + 23: 22 SampledImage 17 21 + 32: 31(ptr) AccessChain 28 30 + 33: 24(fvec2) Load 32 + 38: 7(fvec4) ImageDrefGather 23 33 34 ConstOffset 37 + Store 13(txval001) 38 + 45: 42 Load 44(g_tTex2di4) + 46: 18 Load 20(g_sSampCmp) + 48: 47 SampledImage 45 46 + 49: 31(ptr) AccessChain 28 30 + 50: 24(fvec2) Load 49 + 53: 39(ivec4) ImageDrefGather 48 50 34 ConstOffset 52 + Store 41(txval011) 53 + 61: 58 Load 60(g_tTex2du4) + 62: 18 Load 20(g_sSampCmp) + 64: 63 SampledImage 61 62 + 65: 31(ptr) AccessChain 28 30 + 66: 24(fvec2) Load 65 + 68: 55(ivec4) ImageDrefGather 64 66 34 ConstOffset 67 + Store 57(txval021) 68 + 70: 14 Load 16(g_tTex2df4) + 71: 18 Load 20(g_sSampCmp) + 72: 22 SampledImage 70 71 + 73: 31(ptr) AccessChain 28 30 + 74: 24(fvec2) Load 73 + 78: 7(fvec4) ImageDrefGather 72 74 34 ConstOffsets 77 + Store 69(txval004) 78 + 80: 42 Load 44(g_tTex2di4) + 81: 18 Load 20(g_sSampCmp) + 82: 47 SampledImage 80 81 + 83: 31(ptr) AccessChain 28 30 + 84: 24(fvec2) Load 83 + 86: 39(ivec4) ImageDrefGather 82 84 34 ConstOffsets 85 + Store 79(txval014) 86 + 88: 58 Load 60(g_tTex2du4) + 89: 18 Load 20(g_sSampCmp) + 90: 63 SampledImage 88 89 + 91: 31(ptr) AccessChain 28 30 + 92: 24(fvec2) Load 91 + 94: 55(ivec4) ImageDrefGather 90 92 34 ConstOffsets 93 + Store 87(txval024) 94 + 96: 14 Load 16(g_tTex2df4) + 97: 18 Load 20(g_sSampCmp) + 98: 22 SampledImage 96 97 + 99: 31(ptr) AccessChain 28 30 + 100: 24(fvec2) Load 99 + 101: 7(fvec4) ImageDrefGather 98 100 34 ConstOffset 37 + Store 95(txval401) 101 + 103: 42 Load 44(g_tTex2di4) + 104: 18 Load 20(g_sSampCmp) + 105: 47 SampledImage 103 104 + 106: 31(ptr) AccessChain 28 30 + 107: 24(fvec2) Load 106 + 108: 39(ivec4) ImageDrefGather 105 107 34 ConstOffset 52 + Store 102(txval411) 108 + 110: 58 Load 60(g_tTex2du4) + 111: 18 Load 20(g_sSampCmp) + 112: 63 SampledImage 110 111 + 113: 31(ptr) AccessChain 28 30 + 114: 24(fvec2) Load 113 + 115: 55(ivec4) ImageDrefGather 112 114 34 ConstOffset 67 + Store 109(txval421) 115 + 120: 12(ptr) AccessChain 117(psout) 36 + Store 120 119 + 122: 121(ptr) AccessChain 117(psout) 30 + Store 122 118 + 123:8(PS_OUTPUT) Load 117(psout) + ReturnValue 123 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out new file mode 100644 index 00000000..599c6591 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out @@ -0,0 +1,3197 @@ +hlsl.getdimensions.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:46 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 Function Parameters: +0:? Sequence +0:65 Sequence +0:65 move second child to first child ( temp uint) +0:65 'sizeQueryTemp' ( temp uint) +0:65 textureSize ( temp uint) +0:65 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:65 Constant: +0:65 0 (const int) +0:65 move second child to first child ( temp uint) +0:65 'WidthU' ( temp uint) +0:65 'sizeQueryTemp' ( temp uint) +0:66 Sequence +0:66 move second child to first child ( temp uint) +0:66 'sizeQueryTemp' ( temp uint) +0:66 textureSize ( temp uint) +0:66 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:66 Constant: +0:66 6 (const uint) +0:66 move second child to first child ( temp uint) +0:66 'WidthU' ( temp uint) +0:66 'sizeQueryTemp' ( temp uint) +0:66 move second child to first child ( temp uint) +0:66 'NumberOfLevelsU' ( temp uint) +0:66 textureQueryLevels ( temp uint) +0:66 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:69 Sequence +0:69 move second child to first child ( temp uint) +0:69 'sizeQueryTemp' ( temp uint) +0:69 textureSize ( temp uint) +0:69 'g_tTex1di4' ( uniform itexture1D) +0:69 Constant: +0:69 0 (const int) +0:69 move second child to first child ( temp uint) +0:69 'WidthU' ( temp uint) +0:69 'sizeQueryTemp' ( temp uint) +0:70 Sequence +0:70 move second child to first child ( temp uint) +0:70 'sizeQueryTemp' ( temp uint) +0:70 textureSize ( temp uint) +0:70 'g_tTex1di4' ( uniform itexture1D) +0:70 Constant: +0:70 6 (const uint) +0:70 move second child to first child ( temp uint) +0:70 'WidthU' ( temp uint) +0:70 'sizeQueryTemp' ( temp uint) +0:70 move second child to first child ( temp uint) +0:70 'NumberOfLevelsU' ( temp uint) +0:70 textureQueryLevels ( temp uint) +0:70 'g_tTex1di4' ( uniform itexture1D) +0:73 Sequence +0:73 move second child to first child ( temp uint) +0:73 'sizeQueryTemp' ( temp uint) +0:73 textureSize ( temp uint) +0:73 'g_tTex1du4' ( uniform utexture1D) +0:73 Constant: +0:73 0 (const int) +0:73 move second child to first child ( temp uint) +0:73 'WidthU' ( temp uint) +0:73 'sizeQueryTemp' ( temp uint) +0:74 Sequence +0:74 move second child to first child ( temp uint) +0:74 'sizeQueryTemp' ( temp uint) +0:74 textureSize ( temp uint) +0:74 'g_tTex1du4' ( uniform utexture1D) +0:74 Constant: +0:74 6 (const uint) +0:74 move second child to first child ( temp uint) +0:74 'WidthU' ( temp uint) +0:74 'sizeQueryTemp' ( temp uint) +0:74 move second child to first child ( temp uint) +0:74 'NumberOfLevelsU' ( temp uint) +0:74 textureQueryLevels ( temp uint) +0:74 'g_tTex1du4' ( uniform utexture1D) +0:77 Sequence +0:77 move second child to first child ( temp 2-component vector of uint) +0:77 'sizeQueryTemp' ( temp 2-component vector of uint) +0:77 textureSize ( temp 2-component vector of uint) +0:77 'g_tTex1df4a' ( uniform texture1DArray) +0:77 Constant: +0:77 0 (const int) +0:77 move second child to first child ( temp uint) +0:77 'WidthU' ( temp uint) +0:77 direct index ( temp uint) +0:77 'sizeQueryTemp' ( temp 2-component vector of uint) +0:77 Constant: +0:77 0 (const int) +0:77 move second child to first child ( temp uint) +0:77 'ElementsU' ( temp uint) +0:77 direct index ( temp uint) +0:77 'sizeQueryTemp' ( temp 2-component vector of uint) +0:77 Constant: +0:77 1 (const int) +0:78 Sequence +0:78 move second child to first child ( temp 2-component vector of uint) +0:78 'sizeQueryTemp' ( temp 2-component vector of uint) +0:78 textureSize ( temp 2-component vector of uint) +0:78 'g_tTex1df4a' ( uniform texture1DArray) +0:78 Constant: +0:78 6 (const uint) +0:78 move second child to first child ( temp uint) +0:78 'WidthU' ( temp uint) +0:78 direct index ( temp uint) +0:78 'sizeQueryTemp' ( temp 2-component vector of uint) +0:78 Constant: +0:78 0 (const int) +0:78 move second child to first child ( temp uint) +0:78 'ElementsU' ( temp uint) +0:78 direct index ( temp uint) +0:78 'sizeQueryTemp' ( temp 2-component vector of uint) +0:78 Constant: +0:78 1 (const int) +0:78 move second child to first child ( temp uint) +0:78 'NumberOfLevelsU' ( temp uint) +0:78 textureQueryLevels ( temp uint) +0:78 'g_tTex1df4a' ( uniform texture1DArray) +0:81 Sequence +0:81 move second child to first child ( temp 2-component vector of uint) +0:81 'sizeQueryTemp' ( temp 2-component vector of uint) +0:81 textureSize ( temp 2-component vector of uint) +0:81 'g_tTex1di4a' ( uniform itexture1DArray) +0:81 Constant: +0:81 0 (const int) +0:81 move second child to first child ( temp uint) +0:81 'WidthU' ( temp uint) +0:81 direct index ( temp uint) +0:81 'sizeQueryTemp' ( temp 2-component vector of uint) +0:81 Constant: +0:81 0 (const int) +0:81 move second child to first child ( temp uint) +0:81 'ElementsU' ( temp uint) +0:81 direct index ( temp uint) +0:81 'sizeQueryTemp' ( temp 2-component vector of uint) +0:81 Constant: +0:81 1 (const int) +0:82 Sequence +0:82 move second child to first child ( temp 2-component vector of uint) +0:82 'sizeQueryTemp' ( temp 2-component vector of uint) +0:82 textureSize ( temp 2-component vector of uint) +0:82 'g_tTex1di4a' ( uniform itexture1DArray) +0:82 Constant: +0:82 6 (const uint) +0:82 move second child to first child ( temp uint) +0:82 'WidthU' ( temp uint) +0:82 direct index ( temp uint) +0:82 'sizeQueryTemp' ( temp 2-component vector of uint) +0:82 Constant: +0:82 0 (const int) +0:82 move second child to first child ( temp uint) +0:82 'ElementsU' ( temp uint) +0:82 direct index ( temp uint) +0:82 'sizeQueryTemp' ( temp 2-component vector of uint) +0:82 Constant: +0:82 1 (const int) +0:82 move second child to first child ( temp uint) +0:82 'NumberOfLevelsU' ( temp uint) +0:82 textureQueryLevels ( temp uint) +0:82 'g_tTex1di4a' ( uniform itexture1DArray) +0:85 Sequence +0:85 move second child to first child ( temp 2-component vector of uint) +0:85 'sizeQueryTemp' ( temp 2-component vector of uint) +0:85 textureSize ( temp 2-component vector of uint) +0:85 'g_tTex1du4a' ( uniform utexture1DArray) +0:85 Constant: +0:85 0 (const int) +0:85 move second child to first child ( temp uint) +0:85 'WidthU' ( temp uint) +0:85 direct index ( temp uint) +0:85 'sizeQueryTemp' ( temp 2-component vector of uint) +0:85 Constant: +0:85 0 (const int) +0:85 move second child to first child ( temp uint) +0:85 'ElementsU' ( temp uint) +0:85 direct index ( temp uint) +0:85 'sizeQueryTemp' ( temp 2-component vector of uint) +0:85 Constant: +0:85 1 (const int) +0:86 Sequence +0:86 move second child to first child ( temp 2-component vector of uint) +0:86 'sizeQueryTemp' ( temp 2-component vector of uint) +0:86 textureSize ( temp 2-component vector of uint) +0:86 'g_tTex1du4a' ( uniform utexture1DArray) +0:86 Constant: +0:86 6 (const uint) +0:86 move second child to first child ( temp uint) +0:86 'WidthU' ( temp uint) +0:86 direct index ( temp uint) +0:86 'sizeQueryTemp' ( temp 2-component vector of uint) +0:86 Constant: +0:86 0 (const int) +0:86 move second child to first child ( temp uint) +0:86 'ElementsU' ( temp uint) +0:86 direct index ( temp uint) +0:86 'sizeQueryTemp' ( temp 2-component vector of uint) +0:86 Constant: +0:86 1 (const int) +0:86 move second child to first child ( temp uint) +0:86 'NumberOfLevelsU' ( temp uint) +0:86 textureQueryLevels ( temp uint) +0:86 'g_tTex1du4a' ( uniform utexture1DArray) +0:89 Sequence +0:89 move second child to first child ( temp 2-component vector of uint) +0:89 'sizeQueryTemp' ( temp 2-component vector of uint) +0:89 textureSize ( temp 2-component vector of uint) +0:89 'g_tTex2df4' ( uniform texture2D) +0:89 Constant: +0:89 0 (const int) +0:89 move second child to first child ( temp uint) +0:89 'WidthU' ( temp uint) +0:89 direct index ( temp uint) +0:89 'sizeQueryTemp' ( temp 2-component vector of uint) +0:89 Constant: +0:89 0 (const int) +0:89 move second child to first child ( temp uint) +0:89 'HeightU' ( temp uint) +0:89 direct index ( temp uint) +0:89 'sizeQueryTemp' ( temp 2-component vector of uint) +0:89 Constant: +0:89 1 (const int) +0:90 Sequence +0:90 move second child to first child ( temp 2-component vector of uint) +0:90 'sizeQueryTemp' ( temp 2-component vector of uint) +0:90 textureSize ( temp 2-component vector of uint) +0:90 'g_tTex2df4' ( uniform texture2D) +0:90 Constant: +0:90 6 (const uint) +0:90 move second child to first child ( temp uint) +0:90 'WidthU' ( temp uint) +0:90 direct index ( temp uint) +0:90 'sizeQueryTemp' ( temp 2-component vector of uint) +0:90 Constant: +0:90 0 (const int) +0:90 move second child to first child ( temp uint) +0:90 'HeightU' ( temp uint) +0:90 direct index ( temp uint) +0:90 'sizeQueryTemp' ( temp 2-component vector of uint) +0:90 Constant: +0:90 1 (const int) +0:90 move second child to first child ( temp uint) +0:90 'NumberOfLevelsU' ( temp uint) +0:90 textureQueryLevels ( temp uint) +0:90 'g_tTex2df4' ( uniform texture2D) +0:93 Sequence +0:93 move second child to first child ( temp 2-component vector of uint) +0:93 'sizeQueryTemp' ( temp 2-component vector of uint) +0:93 textureSize ( temp 2-component vector of uint) +0:93 'g_tTex2di4' ( uniform itexture2D) +0:93 Constant: +0:93 0 (const int) +0:93 move second child to first child ( temp uint) +0:93 'WidthU' ( temp uint) +0:93 direct index ( temp uint) +0:93 'sizeQueryTemp' ( temp 2-component vector of uint) +0:93 Constant: +0:93 0 (const int) +0:93 move second child to first child ( temp uint) +0:93 'HeightU' ( temp uint) +0:93 direct index ( temp uint) +0:93 'sizeQueryTemp' ( temp 2-component vector of uint) +0:93 Constant: +0:93 1 (const int) +0:94 Sequence +0:94 move second child to first child ( temp 2-component vector of uint) +0:94 'sizeQueryTemp' ( temp 2-component vector of uint) +0:94 textureSize ( temp 2-component vector of uint) +0:94 'g_tTex2di4' ( uniform itexture2D) +0:94 Constant: +0:94 6 (const uint) +0:94 move second child to first child ( temp uint) +0:94 'WidthU' ( temp uint) +0:94 direct index ( temp uint) +0:94 'sizeQueryTemp' ( temp 2-component vector of uint) +0:94 Constant: +0:94 0 (const int) +0:94 move second child to first child ( temp uint) +0:94 'HeightU' ( temp uint) +0:94 direct index ( temp uint) +0:94 'sizeQueryTemp' ( temp 2-component vector of uint) +0:94 Constant: +0:94 1 (const int) +0:94 move second child to first child ( temp uint) +0:94 'NumberOfLevelsU' ( temp uint) +0:94 textureQueryLevels ( temp uint) +0:94 'g_tTex2di4' ( uniform itexture2D) +0:97 Sequence +0:97 move second child to first child ( temp 2-component vector of uint) +0:97 'sizeQueryTemp' ( temp 2-component vector of uint) +0:97 textureSize ( temp 2-component vector of uint) +0:97 'g_tTex2du4' ( uniform utexture2D) +0:97 Constant: +0:97 0 (const int) +0:97 move second child to first child ( temp uint) +0:97 'WidthU' ( temp uint) +0:97 direct index ( temp uint) +0:97 'sizeQueryTemp' ( temp 2-component vector of uint) +0:97 Constant: +0:97 0 (const int) +0:97 move second child to first child ( temp uint) +0:97 'HeightU' ( temp uint) +0:97 direct index ( temp uint) +0:97 'sizeQueryTemp' ( temp 2-component vector of uint) +0:97 Constant: +0:97 1 (const int) +0:98 Sequence +0:98 move second child to first child ( temp 2-component vector of uint) +0:98 'sizeQueryTemp' ( temp 2-component vector of uint) +0:98 textureSize ( temp 2-component vector of uint) +0:98 'g_tTex2du4' ( uniform utexture2D) +0:98 Constant: +0:98 6 (const uint) +0:98 move second child to first child ( temp uint) +0:98 'WidthU' ( temp uint) +0:98 direct index ( temp uint) +0:98 'sizeQueryTemp' ( temp 2-component vector of uint) +0:98 Constant: +0:98 0 (const int) +0:98 move second child to first child ( temp uint) +0:98 'HeightU' ( temp uint) +0:98 direct index ( temp uint) +0:98 'sizeQueryTemp' ( temp 2-component vector of uint) +0:98 Constant: +0:98 1 (const int) +0:98 move second child to first child ( temp uint) +0:98 'NumberOfLevelsU' ( temp uint) +0:98 textureQueryLevels ( temp uint) +0:98 'g_tTex2du4' ( uniform utexture2D) +0:101 Sequence +0:101 move second child to first child ( temp 3-component vector of uint) +0:101 'sizeQueryTemp' ( temp 3-component vector of uint) +0:101 textureSize ( temp 3-component vector of uint) +0:101 'g_tTex2df4a' ( uniform texture2DArray) +0:101 Constant: +0:101 0 (const int) +0:101 move second child to first child ( temp uint) +0:101 'WidthU' ( temp uint) +0:101 direct index ( temp uint) +0:101 'sizeQueryTemp' ( temp 3-component vector of uint) +0:101 Constant: +0:101 0 (const int) +0:101 move second child to first child ( temp uint) +0:101 'HeightU' ( temp uint) +0:101 direct index ( temp uint) +0:101 'sizeQueryTemp' ( temp 3-component vector of uint) +0:101 Constant: +0:101 1 (const int) +0:101 move second child to first child ( temp uint) +0:101 'ElementsU' ( temp uint) +0:101 direct index ( temp uint) +0:101 'sizeQueryTemp' ( temp 3-component vector of uint) +0:101 Constant: +0:101 2 (const int) +0:102 Sequence +0:102 move second child to first child ( temp 3-component vector of uint) +0:102 'sizeQueryTemp' ( temp 3-component vector of uint) +0:102 textureSize ( temp 3-component vector of uint) +0:102 'g_tTex2df4a' ( uniform texture2DArray) +0:102 Constant: +0:102 6 (const uint) +0:102 move second child to first child ( temp uint) +0:102 'WidthU' ( temp uint) +0:102 direct index ( temp uint) +0:102 'sizeQueryTemp' ( temp 3-component vector of uint) +0:102 Constant: +0:102 0 (const int) +0:102 move second child to first child ( temp uint) +0:102 'HeightU' ( temp uint) +0:102 direct index ( temp uint) +0:102 'sizeQueryTemp' ( temp 3-component vector of uint) +0:102 Constant: +0:102 1 (const int) +0:102 move second child to first child ( temp uint) +0:102 'ElementsU' ( temp uint) +0:102 direct index ( temp uint) +0:102 'sizeQueryTemp' ( temp 3-component vector of uint) +0:102 Constant: +0:102 2 (const int) +0:102 move second child to first child ( temp uint) +0:102 'NumberOfLevelsU' ( temp uint) +0:102 textureQueryLevels ( temp uint) +0:102 'g_tTex2df4a' ( uniform texture2DArray) +0:105 Sequence +0:105 move second child to first child ( temp 3-component vector of uint) +0:105 'sizeQueryTemp' ( temp 3-component vector of uint) +0:105 textureSize ( temp 3-component vector of uint) +0:105 'g_tTex2di4a' ( uniform itexture2DArray) +0:105 Constant: +0:105 0 (const int) +0:105 move second child to first child ( temp uint) +0:105 'WidthU' ( temp uint) +0:105 direct index ( temp uint) +0:105 'sizeQueryTemp' ( temp 3-component vector of uint) +0:105 Constant: +0:105 0 (const int) +0:105 move second child to first child ( temp uint) +0:105 'HeightU' ( temp uint) +0:105 direct index ( temp uint) +0:105 'sizeQueryTemp' ( temp 3-component vector of uint) +0:105 Constant: +0:105 1 (const int) +0:105 move second child to first child ( temp uint) +0:105 'ElementsU' ( temp uint) +0:105 direct index ( temp uint) +0:105 'sizeQueryTemp' ( temp 3-component vector of uint) +0:105 Constant: +0:105 2 (const int) +0:106 Sequence +0:106 move second child to first child ( temp 3-component vector of uint) +0:106 'sizeQueryTemp' ( temp 3-component vector of uint) +0:106 textureSize ( temp 3-component vector of uint) +0:106 'g_tTex2di4a' ( uniform itexture2DArray) +0:106 Constant: +0:106 6 (const uint) +0:106 move second child to first child ( temp uint) +0:106 'WidthU' ( temp uint) +0:106 direct index ( temp uint) +0:106 'sizeQueryTemp' ( temp 3-component vector of uint) +0:106 Constant: +0:106 0 (const int) +0:106 move second child to first child ( temp uint) +0:106 'HeightU' ( temp uint) +0:106 direct index ( temp uint) +0:106 'sizeQueryTemp' ( temp 3-component vector of uint) +0:106 Constant: +0:106 1 (const int) +0:106 move second child to first child ( temp uint) +0:106 'ElementsU' ( temp uint) +0:106 direct index ( temp uint) +0:106 'sizeQueryTemp' ( temp 3-component vector of uint) +0:106 Constant: +0:106 2 (const int) +0:106 move second child to first child ( temp uint) +0:106 'NumberOfLevelsU' ( temp uint) +0:106 textureQueryLevels ( temp uint) +0:106 'g_tTex2di4a' ( uniform itexture2DArray) +0:109 Sequence +0:109 move second child to first child ( temp 3-component vector of uint) +0:109 'sizeQueryTemp' ( temp 3-component vector of uint) +0:109 textureSize ( temp 3-component vector of uint) +0:109 'g_tTex2du4a' ( uniform utexture2DArray) +0:109 Constant: +0:109 0 (const int) +0:109 move second child to first child ( temp uint) +0:109 'WidthU' ( temp uint) +0:109 direct index ( temp uint) +0:109 'sizeQueryTemp' ( temp 3-component vector of uint) +0:109 Constant: +0:109 0 (const int) +0:109 move second child to first child ( temp uint) +0:109 'HeightU' ( temp uint) +0:109 direct index ( temp uint) +0:109 'sizeQueryTemp' ( temp 3-component vector of uint) +0:109 Constant: +0:109 1 (const int) +0:109 move second child to first child ( temp uint) +0:109 'ElementsU' ( temp uint) +0:109 direct index ( temp uint) +0:109 'sizeQueryTemp' ( temp 3-component vector of uint) +0:109 Constant: +0:109 2 (const int) +0:110 Sequence +0:110 move second child to first child ( temp 3-component vector of uint) +0:110 'sizeQueryTemp' ( temp 3-component vector of uint) +0:110 textureSize ( temp 3-component vector of uint) +0:110 'g_tTex2du4a' ( uniform utexture2DArray) +0:110 Constant: +0:110 6 (const uint) +0:110 move second child to first child ( temp uint) +0:110 'WidthU' ( temp uint) +0:110 direct index ( temp uint) +0:110 'sizeQueryTemp' ( temp 3-component vector of uint) +0:110 Constant: +0:110 0 (const int) +0:110 move second child to first child ( temp uint) +0:110 'HeightU' ( temp uint) +0:110 direct index ( temp uint) +0:110 'sizeQueryTemp' ( temp 3-component vector of uint) +0:110 Constant: +0:110 1 (const int) +0:110 move second child to first child ( temp uint) +0:110 'ElementsU' ( temp uint) +0:110 direct index ( temp uint) +0:110 'sizeQueryTemp' ( temp 3-component vector of uint) +0:110 Constant: +0:110 2 (const int) +0:110 move second child to first child ( temp uint) +0:110 'NumberOfLevelsU' ( temp uint) +0:110 textureQueryLevels ( temp uint) +0:110 'g_tTex2du4a' ( uniform utexture2DArray) +0:113 Sequence +0:113 move second child to first child ( temp 3-component vector of uint) +0:113 'sizeQueryTemp' ( temp 3-component vector of uint) +0:113 textureSize ( temp 3-component vector of uint) +0:113 'g_tTex3df4' ( uniform texture3D) +0:113 Constant: +0:113 0 (const int) +0:113 move second child to first child ( temp uint) +0:113 'WidthU' ( temp uint) +0:113 direct index ( temp uint) +0:113 'sizeQueryTemp' ( temp 3-component vector of uint) +0:113 Constant: +0:113 0 (const int) +0:113 move second child to first child ( temp uint) +0:113 'HeightU' ( temp uint) +0:113 direct index ( temp uint) +0:113 'sizeQueryTemp' ( temp 3-component vector of uint) +0:113 Constant: +0:113 1 (const int) +0:113 move second child to first child ( temp uint) +0:113 'DepthU' ( temp uint) +0:113 direct index ( temp uint) +0:113 'sizeQueryTemp' ( temp 3-component vector of uint) +0:113 Constant: +0:113 2 (const int) +0:114 Sequence +0:114 move second child to first child ( temp 3-component vector of uint) +0:114 'sizeQueryTemp' ( temp 3-component vector of uint) +0:114 textureSize ( temp 3-component vector of uint) +0:114 'g_tTex3df4' ( uniform texture3D) +0:114 Constant: +0:114 6 (const uint) +0:114 move second child to first child ( temp uint) +0:114 'WidthU' ( temp uint) +0:114 direct index ( temp uint) +0:114 'sizeQueryTemp' ( temp 3-component vector of uint) +0:114 Constant: +0:114 0 (const int) +0:114 move second child to first child ( temp uint) +0:114 'HeightU' ( temp uint) +0:114 direct index ( temp uint) +0:114 'sizeQueryTemp' ( temp 3-component vector of uint) +0:114 Constant: +0:114 1 (const int) +0:114 move second child to first child ( temp uint) +0:114 'DepthU' ( temp uint) +0:114 direct index ( temp uint) +0:114 'sizeQueryTemp' ( temp 3-component vector of uint) +0:114 Constant: +0:114 2 (const int) +0:114 move second child to first child ( temp uint) +0:114 'NumberOfLevelsU' ( temp uint) +0:114 textureQueryLevels ( temp uint) +0:114 'g_tTex3df4' ( uniform texture3D) +0:117 Sequence +0:117 move second child to first child ( temp 3-component vector of uint) +0:117 'sizeQueryTemp' ( temp 3-component vector of uint) +0:117 textureSize ( temp 3-component vector of uint) +0:117 'g_tTex3di4' ( uniform itexture3D) +0:117 Constant: +0:117 0 (const int) +0:117 move second child to first child ( temp uint) +0:117 'WidthU' ( temp uint) +0:117 direct index ( temp uint) +0:117 'sizeQueryTemp' ( temp 3-component vector of uint) +0:117 Constant: +0:117 0 (const int) +0:117 move second child to first child ( temp uint) +0:117 'HeightU' ( temp uint) +0:117 direct index ( temp uint) +0:117 'sizeQueryTemp' ( temp 3-component vector of uint) +0:117 Constant: +0:117 1 (const int) +0:117 move second child to first child ( temp uint) +0:117 'DepthU' ( temp uint) +0:117 direct index ( temp uint) +0:117 'sizeQueryTemp' ( temp 3-component vector of uint) +0:117 Constant: +0:117 2 (const int) +0:118 Sequence +0:118 move second child to first child ( temp 3-component vector of uint) +0:118 'sizeQueryTemp' ( temp 3-component vector of uint) +0:118 textureSize ( temp 3-component vector of uint) +0:118 'g_tTex3di4' ( uniform itexture3D) +0:118 Constant: +0:118 6 (const uint) +0:118 move second child to first child ( temp uint) +0:118 'WidthU' ( temp uint) +0:118 direct index ( temp uint) +0:118 'sizeQueryTemp' ( temp 3-component vector of uint) +0:118 Constant: +0:118 0 (const int) +0:118 move second child to first child ( temp uint) +0:118 'HeightU' ( temp uint) +0:118 direct index ( temp uint) +0:118 'sizeQueryTemp' ( temp 3-component vector of uint) +0:118 Constant: +0:118 1 (const int) +0:118 move second child to first child ( temp uint) +0:118 'DepthU' ( temp uint) +0:118 direct index ( temp uint) +0:118 'sizeQueryTemp' ( temp 3-component vector of uint) +0:118 Constant: +0:118 2 (const int) +0:118 move second child to first child ( temp uint) +0:118 'NumberOfLevelsU' ( temp uint) +0:118 textureQueryLevels ( temp uint) +0:118 'g_tTex3di4' ( uniform itexture3D) +0:121 Sequence +0:121 move second child to first child ( temp 3-component vector of uint) +0:121 'sizeQueryTemp' ( temp 3-component vector of uint) +0:121 textureSize ( temp 3-component vector of uint) +0:121 'g_tTex3du4' ( uniform utexture3D) +0:121 Constant: +0:121 0 (const int) +0:121 move second child to first child ( temp uint) +0:121 'WidthU' ( temp uint) +0:121 direct index ( temp uint) +0:121 'sizeQueryTemp' ( temp 3-component vector of uint) +0:121 Constant: +0:121 0 (const int) +0:121 move second child to first child ( temp uint) +0:121 'HeightU' ( temp uint) +0:121 direct index ( temp uint) +0:121 'sizeQueryTemp' ( temp 3-component vector of uint) +0:121 Constant: +0:121 1 (const int) +0:121 move second child to first child ( temp uint) +0:121 'DepthU' ( temp uint) +0:121 direct index ( temp uint) +0:121 'sizeQueryTemp' ( temp 3-component vector of uint) +0:121 Constant: +0:121 2 (const int) +0:122 Sequence +0:122 move second child to first child ( temp 3-component vector of uint) +0:122 'sizeQueryTemp' ( temp 3-component vector of uint) +0:122 textureSize ( temp 3-component vector of uint) +0:122 'g_tTex3du4' ( uniform utexture3D) +0:122 Constant: +0:122 6 (const uint) +0:122 move second child to first child ( temp uint) +0:122 'WidthU' ( temp uint) +0:122 direct index ( temp uint) +0:122 'sizeQueryTemp' ( temp 3-component vector of uint) +0:122 Constant: +0:122 0 (const int) +0:122 move second child to first child ( temp uint) +0:122 'HeightU' ( temp uint) +0:122 direct index ( temp uint) +0:122 'sizeQueryTemp' ( temp 3-component vector of uint) +0:122 Constant: +0:122 1 (const int) +0:122 move second child to first child ( temp uint) +0:122 'DepthU' ( temp uint) +0:122 direct index ( temp uint) +0:122 'sizeQueryTemp' ( temp 3-component vector of uint) +0:122 Constant: +0:122 2 (const int) +0:122 move second child to first child ( temp uint) +0:122 'NumberOfLevelsU' ( temp uint) +0:122 textureQueryLevels ( temp uint) +0:122 'g_tTex3du4' ( uniform utexture3D) +0:125 Sequence +0:125 move second child to first child ( temp 2-component vector of uint) +0:125 'sizeQueryTemp' ( temp 2-component vector of uint) +0:125 textureSize ( temp 2-component vector of uint) +0:125 'g_tTexcdf4' ( uniform textureCube) +0:125 Constant: +0:125 0 (const int) +0:125 move second child to first child ( temp uint) +0:125 'WidthU' ( temp uint) +0:125 direct index ( temp uint) +0:125 'sizeQueryTemp' ( temp 2-component vector of uint) +0:125 Constant: +0:125 0 (const int) +0:125 move second child to first child ( temp uint) +0:125 'HeightU' ( temp uint) +0:125 direct index ( temp uint) +0:125 'sizeQueryTemp' ( temp 2-component vector of uint) +0:125 Constant: +0:125 1 (const int) +0:126 Sequence +0:126 move second child to first child ( temp 2-component vector of uint) +0:126 'sizeQueryTemp' ( temp 2-component vector of uint) +0:126 textureSize ( temp 2-component vector of uint) +0:126 'g_tTexcdf4' ( uniform textureCube) +0:126 Constant: +0:126 6 (const uint) +0:126 move second child to first child ( temp uint) +0:126 'WidthU' ( temp uint) +0:126 direct index ( temp uint) +0:126 'sizeQueryTemp' ( temp 2-component vector of uint) +0:126 Constant: +0:126 0 (const int) +0:126 move second child to first child ( temp uint) +0:126 'HeightU' ( temp uint) +0:126 direct index ( temp uint) +0:126 'sizeQueryTemp' ( temp 2-component vector of uint) +0:126 Constant: +0:126 1 (const int) +0:126 move second child to first child ( temp uint) +0:126 'NumberOfLevelsU' ( temp uint) +0:126 textureQueryLevels ( temp uint) +0:126 'g_tTexcdf4' ( uniform textureCube) +0:129 Sequence +0:129 move second child to first child ( temp 2-component vector of uint) +0:129 'sizeQueryTemp' ( temp 2-component vector of uint) +0:129 textureSize ( temp 2-component vector of uint) +0:129 'g_tTexcdi4' ( uniform itextureCube) +0:129 Constant: +0:129 0 (const int) +0:129 move second child to first child ( temp uint) +0:129 'WidthU' ( temp uint) +0:129 direct index ( temp uint) +0:129 'sizeQueryTemp' ( temp 2-component vector of uint) +0:129 Constant: +0:129 0 (const int) +0:129 move second child to first child ( temp uint) +0:129 'HeightU' ( temp uint) +0:129 direct index ( temp uint) +0:129 'sizeQueryTemp' ( temp 2-component vector of uint) +0:129 Constant: +0:129 1 (const int) +0:130 Sequence +0:130 move second child to first child ( temp 2-component vector of uint) +0:130 'sizeQueryTemp' ( temp 2-component vector of uint) +0:130 textureSize ( temp 2-component vector of uint) +0:130 'g_tTexcdi4' ( uniform itextureCube) +0:130 Constant: +0:130 6 (const uint) +0:130 move second child to first child ( temp uint) +0:130 'WidthU' ( temp uint) +0:130 direct index ( temp uint) +0:130 'sizeQueryTemp' ( temp 2-component vector of uint) +0:130 Constant: +0:130 0 (const int) +0:130 move second child to first child ( temp uint) +0:130 'HeightU' ( temp uint) +0:130 direct index ( temp uint) +0:130 'sizeQueryTemp' ( temp 2-component vector of uint) +0:130 Constant: +0:130 1 (const int) +0:130 move second child to first child ( temp uint) +0:130 'NumberOfLevelsU' ( temp uint) +0:130 textureQueryLevels ( temp uint) +0:130 'g_tTexcdi4' ( uniform itextureCube) +0:133 Sequence +0:133 move second child to first child ( temp 2-component vector of uint) +0:133 'sizeQueryTemp' ( temp 2-component vector of uint) +0:133 textureSize ( temp 2-component vector of uint) +0:133 'g_tTexcdu4' ( uniform utextureCube) +0:133 Constant: +0:133 0 (const int) +0:133 move second child to first child ( temp uint) +0:133 'WidthU' ( temp uint) +0:133 direct index ( temp uint) +0:133 'sizeQueryTemp' ( temp 2-component vector of uint) +0:133 Constant: +0:133 0 (const int) +0:133 move second child to first child ( temp uint) +0:133 'HeightU' ( temp uint) +0:133 direct index ( temp uint) +0:133 'sizeQueryTemp' ( temp 2-component vector of uint) +0:133 Constant: +0:133 1 (const int) +0:134 Sequence +0:134 move second child to first child ( temp 2-component vector of uint) +0:134 'sizeQueryTemp' ( temp 2-component vector of uint) +0:134 textureSize ( temp 2-component vector of uint) +0:134 'g_tTexcdu4' ( uniform utextureCube) +0:134 Constant: +0:134 6 (const uint) +0:134 move second child to first child ( temp uint) +0:134 'WidthU' ( temp uint) +0:134 direct index ( temp uint) +0:134 'sizeQueryTemp' ( temp 2-component vector of uint) +0:134 Constant: +0:134 0 (const int) +0:134 move second child to first child ( temp uint) +0:134 'HeightU' ( temp uint) +0:134 direct index ( temp uint) +0:134 'sizeQueryTemp' ( temp 2-component vector of uint) +0:134 Constant: +0:134 1 (const int) +0:134 move second child to first child ( temp uint) +0:134 'NumberOfLevelsU' ( temp uint) +0:134 textureQueryLevels ( temp uint) +0:134 'g_tTexcdu4' ( uniform utextureCube) +0:137 Sequence +0:137 move second child to first child ( temp 3-component vector of uint) +0:137 'sizeQueryTemp' ( temp 3-component vector of uint) +0:137 textureSize ( temp 3-component vector of uint) +0:137 'g_tTexcdf4a' ( uniform textureCubeArray) +0:137 Constant: +0:137 0 (const int) +0:137 move second child to first child ( temp uint) +0:137 'WidthU' ( temp uint) +0:137 direct index ( temp uint) +0:137 'sizeQueryTemp' ( temp 3-component vector of uint) +0:137 Constant: +0:137 0 (const int) +0:137 move second child to first child ( temp uint) +0:137 'HeightU' ( temp uint) +0:137 direct index ( temp uint) +0:137 'sizeQueryTemp' ( temp 3-component vector of uint) +0:137 Constant: +0:137 1 (const int) +0:137 move second child to first child ( temp uint) +0:137 'ElementsU' ( temp uint) +0:137 direct index ( temp uint) +0:137 'sizeQueryTemp' ( temp 3-component vector of uint) +0:137 Constant: +0:137 2 (const int) +0:138 Sequence +0:138 move second child to first child ( temp 3-component vector of uint) +0:138 'sizeQueryTemp' ( temp 3-component vector of uint) +0:138 textureSize ( temp 3-component vector of uint) +0:138 'g_tTexcdf4a' ( uniform textureCubeArray) +0:138 Constant: +0:138 6 (const uint) +0:138 move second child to first child ( temp uint) +0:138 'WidthU' ( temp uint) +0:138 direct index ( temp uint) +0:138 'sizeQueryTemp' ( temp 3-component vector of uint) +0:138 Constant: +0:138 0 (const int) +0:138 move second child to first child ( temp uint) +0:138 'HeightU' ( temp uint) +0:138 direct index ( temp uint) +0:138 'sizeQueryTemp' ( temp 3-component vector of uint) +0:138 Constant: +0:138 1 (const int) +0:138 move second child to first child ( temp uint) +0:138 'ElementsU' ( temp uint) +0:138 direct index ( temp uint) +0:138 'sizeQueryTemp' ( temp 3-component vector of uint) +0:138 Constant: +0:138 2 (const int) +0:138 move second child to first child ( temp uint) +0:138 'NumberOfLevelsU' ( temp uint) +0:138 textureQueryLevels ( temp uint) +0:138 'g_tTexcdf4a' ( uniform textureCubeArray) +0:141 Sequence +0:141 move second child to first child ( temp 3-component vector of uint) +0:141 'sizeQueryTemp' ( temp 3-component vector of uint) +0:141 textureSize ( temp 3-component vector of uint) +0:141 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:141 Constant: +0:141 0 (const int) +0:141 move second child to first child ( temp uint) +0:141 'WidthU' ( temp uint) +0:141 direct index ( temp uint) +0:141 'sizeQueryTemp' ( temp 3-component vector of uint) +0:141 Constant: +0:141 0 (const int) +0:141 move second child to first child ( temp uint) +0:141 'HeightU' ( temp uint) +0:141 direct index ( temp uint) +0:141 'sizeQueryTemp' ( temp 3-component vector of uint) +0:141 Constant: +0:141 1 (const int) +0:141 move second child to first child ( temp uint) +0:141 'ElementsU' ( temp uint) +0:141 direct index ( temp uint) +0:141 'sizeQueryTemp' ( temp 3-component vector of uint) +0:141 Constant: +0:141 2 (const int) +0:142 Sequence +0:142 move second child to first child ( temp 3-component vector of uint) +0:142 'sizeQueryTemp' ( temp 3-component vector of uint) +0:142 textureSize ( temp 3-component vector of uint) +0:142 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:142 Constant: +0:142 6 (const uint) +0:142 move second child to first child ( temp uint) +0:142 'WidthU' ( temp uint) +0:142 direct index ( temp uint) +0:142 'sizeQueryTemp' ( temp 3-component vector of uint) +0:142 Constant: +0:142 0 (const int) +0:142 move second child to first child ( temp uint) +0:142 'HeightU' ( temp uint) +0:142 direct index ( temp uint) +0:142 'sizeQueryTemp' ( temp 3-component vector of uint) +0:142 Constant: +0:142 1 (const int) +0:142 move second child to first child ( temp uint) +0:142 'ElementsU' ( temp uint) +0:142 direct index ( temp uint) +0:142 'sizeQueryTemp' ( temp 3-component vector of uint) +0:142 Constant: +0:142 2 (const int) +0:142 move second child to first child ( temp uint) +0:142 'NumberOfLevelsU' ( temp uint) +0:142 textureQueryLevels ( temp uint) +0:142 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:145 Sequence +0:145 move second child to first child ( temp 3-component vector of uint) +0:145 'sizeQueryTemp' ( temp 3-component vector of uint) +0:145 textureSize ( temp 3-component vector of uint) +0:145 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:145 Constant: +0:145 0 (const int) +0:145 move second child to first child ( temp uint) +0:145 'WidthU' ( temp uint) +0:145 direct index ( temp uint) +0:145 'sizeQueryTemp' ( temp 3-component vector of uint) +0:145 Constant: +0:145 0 (const int) +0:145 move second child to first child ( temp uint) +0:145 'HeightU' ( temp uint) +0:145 direct index ( temp uint) +0:145 'sizeQueryTemp' ( temp 3-component vector of uint) +0:145 Constant: +0:145 1 (const int) +0:145 move second child to first child ( temp uint) +0:145 'ElementsU' ( temp uint) +0:145 direct index ( temp uint) +0:145 'sizeQueryTemp' ( temp 3-component vector of uint) +0:145 Constant: +0:145 2 (const int) +0:146 Sequence +0:146 move second child to first child ( temp 3-component vector of uint) +0:146 'sizeQueryTemp' ( temp 3-component vector of uint) +0:146 textureSize ( temp 3-component vector of uint) +0:146 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:146 Constant: +0:146 6 (const uint) +0:146 move second child to first child ( temp uint) +0:146 'WidthU' ( temp uint) +0:146 direct index ( temp uint) +0:146 'sizeQueryTemp' ( temp 3-component vector of uint) +0:146 Constant: +0:146 0 (const int) +0:146 move second child to first child ( temp uint) +0:146 'HeightU' ( temp uint) +0:146 direct index ( temp uint) +0:146 'sizeQueryTemp' ( temp 3-component vector of uint) +0:146 Constant: +0:146 1 (const int) +0:146 move second child to first child ( temp uint) +0:146 'ElementsU' ( temp uint) +0:146 direct index ( temp uint) +0:146 'sizeQueryTemp' ( temp 3-component vector of uint) +0:146 Constant: +0:146 2 (const int) +0:146 move second child to first child ( temp uint) +0:146 'NumberOfLevelsU' ( temp uint) +0:146 textureQueryLevels ( temp uint) +0:146 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:149 Sequence +0:149 move second child to first child ( temp 2-component vector of uint) +0:149 'sizeQueryTemp' ( temp 2-component vector of uint) +0:149 textureSize ( temp 2-component vector of uint) +0:149 'g_tTex2dmsf4' ( uniform texture2DMS) +0:149 move second child to first child ( temp uint) +0:149 'WidthU' ( temp uint) +0:149 direct index ( temp uint) +0:149 'sizeQueryTemp' ( temp 2-component vector of uint) +0:149 Constant: +0:149 0 (const int) +0:149 move second child to first child ( temp uint) +0:149 'HeightU' ( temp uint) +0:149 direct index ( temp uint) +0:149 'sizeQueryTemp' ( temp 2-component vector of uint) +0:149 Constant: +0:149 1 (const int) +0:149 move second child to first child ( temp uint) +0:149 'NumberOfSamplesU' ( temp uint) +0:149 imageQuerySamples ( temp uint) +0:149 'g_tTex2dmsf4' ( uniform texture2DMS) +0:152 Sequence +0:152 move second child to first child ( temp 2-component vector of uint) +0:152 'sizeQueryTemp' ( temp 2-component vector of uint) +0:152 textureSize ( temp 2-component vector of uint) +0:152 'g_tTex2dmsi4' ( uniform itexture2DMS) +0:152 move second child to first child ( temp uint) +0:152 'WidthU' ( temp uint) +0:152 direct index ( temp uint) +0:152 'sizeQueryTemp' ( temp 2-component vector of uint) +0:152 Constant: +0:152 0 (const int) +0:152 move second child to first child ( temp uint) +0:152 'HeightU' ( temp uint) +0:152 direct index ( temp uint) +0:152 'sizeQueryTemp' ( temp 2-component vector of uint) +0:152 Constant: +0:152 1 (const int) +0:152 move second child to first child ( temp uint) +0:152 'NumberOfSamplesU' ( temp uint) +0:152 imageQuerySamples ( temp uint) +0:152 'g_tTex2dmsi4' ( uniform itexture2DMS) +0:155 Sequence +0:155 move second child to first child ( temp 2-component vector of uint) +0:155 'sizeQueryTemp' ( temp 2-component vector of uint) +0:155 textureSize ( temp 2-component vector of uint) +0:155 'g_tTex2dmsu4' ( uniform utexture2DMS) +0:155 move second child to first child ( temp uint) +0:155 'WidthU' ( temp uint) +0:155 direct index ( temp uint) +0:155 'sizeQueryTemp' ( temp 2-component vector of uint) +0:155 Constant: +0:155 0 (const int) +0:155 move second child to first child ( temp uint) +0:155 'HeightU' ( temp uint) +0:155 direct index ( temp uint) +0:155 'sizeQueryTemp' ( temp 2-component vector of uint) +0:155 Constant: +0:155 1 (const int) +0:155 move second child to first child ( temp uint) +0:155 'NumberOfSamplesU' ( temp uint) +0:155 imageQuerySamples ( temp uint) +0:155 'g_tTex2dmsu4' ( uniform utexture2DMS) +0:158 Sequence +0:158 move second child to first child ( temp 3-component vector of uint) +0:158 'sizeQueryTemp' ( temp 3-component vector of uint) +0:158 textureSize ( temp 3-component vector of uint) +0:158 'g_tTex2dmsf4a' ( uniform texture2DMSArray) +0:158 move second child to first child ( temp uint) +0:158 'WidthU' ( temp uint) +0:158 direct index ( temp uint) +0:158 'sizeQueryTemp' ( temp 3-component vector of uint) +0:158 Constant: +0:158 0 (const int) +0:158 move second child to first child ( temp uint) +0:158 'HeightU' ( temp uint) +0:158 direct index ( temp uint) +0:158 'sizeQueryTemp' ( temp 3-component vector of uint) +0:158 Constant: +0:158 1 (const int) +0:158 move second child to first child ( temp uint) +0:158 'ElementsU' ( temp uint) +0:158 direct index ( temp uint) +0:158 'sizeQueryTemp' ( temp 3-component vector of uint) +0:158 Constant: +0:158 2 (const int) +0:158 move second child to first child ( temp uint) +0:158 'NumberOfSamplesU' ( temp uint) +0:158 imageQuerySamples ( temp uint) +0:158 'g_tTex2dmsf4a' ( uniform texture2DMSArray) +0:161 Sequence +0:161 move second child to first child ( temp 3-component vector of uint) +0:161 'sizeQueryTemp' ( temp 3-component vector of uint) +0:161 textureSize ( temp 3-component vector of uint) +0:161 'g_tTex2dmsi4a' ( uniform itexture2DMSArray) +0:161 move second child to first child ( temp uint) +0:161 'WidthU' ( temp uint) +0:161 direct index ( temp uint) +0:161 'sizeQueryTemp' ( temp 3-component vector of uint) +0:161 Constant: +0:161 0 (const int) +0:161 move second child to first child ( temp uint) +0:161 'HeightU' ( temp uint) +0:161 direct index ( temp uint) +0:161 'sizeQueryTemp' ( temp 3-component vector of uint) +0:161 Constant: +0:161 1 (const int) +0:161 move second child to first child ( temp uint) +0:161 'ElementsU' ( temp uint) +0:161 direct index ( temp uint) +0:161 'sizeQueryTemp' ( temp 3-component vector of uint) +0:161 Constant: +0:161 2 (const int) +0:161 move second child to first child ( temp uint) +0:161 'NumberOfSamplesU' ( temp uint) +0:161 imageQuerySamples ( temp uint) +0:161 'g_tTex2dmsi4a' ( uniform itexture2DMSArray) +0:164 Sequence +0:164 move second child to first child ( temp 3-component vector of uint) +0:164 'sizeQueryTemp' ( temp 3-component vector of uint) +0:164 textureSize ( temp 3-component vector of uint) +0:164 'g_tTex2dmsu4a' ( uniform utexture2DMSArray) +0:164 move second child to first child ( temp uint) +0:164 'WidthU' ( temp uint) +0:164 direct index ( temp uint) +0:164 'sizeQueryTemp' ( temp 3-component vector of uint) +0:164 Constant: +0:164 0 (const int) +0:164 move second child to first child ( temp uint) +0:164 'HeightU' ( temp uint) +0:164 direct index ( temp uint) +0:164 'sizeQueryTemp' ( temp 3-component vector of uint) +0:164 Constant: +0:164 1 (const int) +0:164 move second child to first child ( temp uint) +0:164 'ElementsU' ( temp uint) +0:164 direct index ( temp uint) +0:164 'sizeQueryTemp' ( temp 3-component vector of uint) +0:164 Constant: +0:164 2 (const int) +0:164 move second child to first child ( temp uint) +0:164 'NumberOfSamplesU' ( temp uint) +0:164 imageQuerySamples ( temp uint) +0:164 'g_tTex2dmsu4a' ( uniform utexture2DMSArray) +0:276 move second child to first child ( temp 4-component vector of float) +0:276 Color: direct index for structure ( temp 4-component vector of float) +0:276 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:276 Constant: +0:276 0 (const int) +0:276 Constant: +0:276 1.000000 +0:276 1.000000 +0:276 1.000000 +0:276 1.000000 +0:277 move second child to first child ( temp float) +0:277 Depth: direct index for structure ( temp float) +0:277 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:277 Constant: +0:277 1 (const int) +0:277 Constant: +0:277 1.000000 +0:279 Branch: Return with expression +0:279 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 Function Definition: main( ( temp void) +0:46 Function Parameters: +0:? Sequence +0:46 Sequence +0:46 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:46 Color: direct index for structure ( temp 4-component vector of float) +0:46 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 Constant: +0:46 0 (const int) +0:46 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:46 Depth: direct index for structure ( temp float) +0:46 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 Constant: +0:46 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? 'g_tTex2dmsf4' ( uniform texture2DMS) +0:? 'g_tTex2dmsi4' ( uniform itexture2DMS) +0:? 'g_tTex2dmsu4' ( uniform utexture2DMS) +0:? 'g_tTex2dmsf4a' ( uniform texture2DMSArray) +0:? 'g_tTex2dmsi4a' ( uniform itexture2DMSArray) +0:? 'g_tTex2dmsu4a' ( uniform utexture2DMSArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:46 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 Function Parameters: +0:? Sequence +0:65 Sequence +0:65 move second child to first child ( temp uint) +0:65 'sizeQueryTemp' ( temp uint) +0:65 textureSize ( temp uint) +0:65 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:65 Constant: +0:65 0 (const int) +0:65 move second child to first child ( temp uint) +0:65 'WidthU' ( temp uint) +0:65 'sizeQueryTemp' ( temp uint) +0:66 Sequence +0:66 move second child to first child ( temp uint) +0:66 'sizeQueryTemp' ( temp uint) +0:66 textureSize ( temp uint) +0:66 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:66 Constant: +0:66 6 (const uint) +0:66 move second child to first child ( temp uint) +0:66 'WidthU' ( temp uint) +0:66 'sizeQueryTemp' ( temp uint) +0:66 move second child to first child ( temp uint) +0:66 'NumberOfLevelsU' ( temp uint) +0:66 textureQueryLevels ( temp uint) +0:66 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:69 Sequence +0:69 move second child to first child ( temp uint) +0:69 'sizeQueryTemp' ( temp uint) +0:69 textureSize ( temp uint) +0:69 'g_tTex1di4' ( uniform itexture1D) +0:69 Constant: +0:69 0 (const int) +0:69 move second child to first child ( temp uint) +0:69 'WidthU' ( temp uint) +0:69 'sizeQueryTemp' ( temp uint) +0:70 Sequence +0:70 move second child to first child ( temp uint) +0:70 'sizeQueryTemp' ( temp uint) +0:70 textureSize ( temp uint) +0:70 'g_tTex1di4' ( uniform itexture1D) +0:70 Constant: +0:70 6 (const uint) +0:70 move second child to first child ( temp uint) +0:70 'WidthU' ( temp uint) +0:70 'sizeQueryTemp' ( temp uint) +0:70 move second child to first child ( temp uint) +0:70 'NumberOfLevelsU' ( temp uint) +0:70 textureQueryLevels ( temp uint) +0:70 'g_tTex1di4' ( uniform itexture1D) +0:73 Sequence +0:73 move second child to first child ( temp uint) +0:73 'sizeQueryTemp' ( temp uint) +0:73 textureSize ( temp uint) +0:73 'g_tTex1du4' ( uniform utexture1D) +0:73 Constant: +0:73 0 (const int) +0:73 move second child to first child ( temp uint) +0:73 'WidthU' ( temp uint) +0:73 'sizeQueryTemp' ( temp uint) +0:74 Sequence +0:74 move second child to first child ( temp uint) +0:74 'sizeQueryTemp' ( temp uint) +0:74 textureSize ( temp uint) +0:74 'g_tTex1du4' ( uniform utexture1D) +0:74 Constant: +0:74 6 (const uint) +0:74 move second child to first child ( temp uint) +0:74 'WidthU' ( temp uint) +0:74 'sizeQueryTemp' ( temp uint) +0:74 move second child to first child ( temp uint) +0:74 'NumberOfLevelsU' ( temp uint) +0:74 textureQueryLevels ( temp uint) +0:74 'g_tTex1du4' ( uniform utexture1D) +0:77 Sequence +0:77 move second child to first child ( temp 2-component vector of uint) +0:77 'sizeQueryTemp' ( temp 2-component vector of uint) +0:77 textureSize ( temp 2-component vector of uint) +0:77 'g_tTex1df4a' ( uniform texture1DArray) +0:77 Constant: +0:77 0 (const int) +0:77 move second child to first child ( temp uint) +0:77 'WidthU' ( temp uint) +0:77 direct index ( temp uint) +0:77 'sizeQueryTemp' ( temp 2-component vector of uint) +0:77 Constant: +0:77 0 (const int) +0:77 move second child to first child ( temp uint) +0:77 'ElementsU' ( temp uint) +0:77 direct index ( temp uint) +0:77 'sizeQueryTemp' ( temp 2-component vector of uint) +0:77 Constant: +0:77 1 (const int) +0:78 Sequence +0:78 move second child to first child ( temp 2-component vector of uint) +0:78 'sizeQueryTemp' ( temp 2-component vector of uint) +0:78 textureSize ( temp 2-component vector of uint) +0:78 'g_tTex1df4a' ( uniform texture1DArray) +0:78 Constant: +0:78 6 (const uint) +0:78 move second child to first child ( temp uint) +0:78 'WidthU' ( temp uint) +0:78 direct index ( temp uint) +0:78 'sizeQueryTemp' ( temp 2-component vector of uint) +0:78 Constant: +0:78 0 (const int) +0:78 move second child to first child ( temp uint) +0:78 'ElementsU' ( temp uint) +0:78 direct index ( temp uint) +0:78 'sizeQueryTemp' ( temp 2-component vector of uint) +0:78 Constant: +0:78 1 (const int) +0:78 move second child to first child ( temp uint) +0:78 'NumberOfLevelsU' ( temp uint) +0:78 textureQueryLevels ( temp uint) +0:78 'g_tTex1df4a' ( uniform texture1DArray) +0:81 Sequence +0:81 move second child to first child ( temp 2-component vector of uint) +0:81 'sizeQueryTemp' ( temp 2-component vector of uint) +0:81 textureSize ( temp 2-component vector of uint) +0:81 'g_tTex1di4a' ( uniform itexture1DArray) +0:81 Constant: +0:81 0 (const int) +0:81 move second child to first child ( temp uint) +0:81 'WidthU' ( temp uint) +0:81 direct index ( temp uint) +0:81 'sizeQueryTemp' ( temp 2-component vector of uint) +0:81 Constant: +0:81 0 (const int) +0:81 move second child to first child ( temp uint) +0:81 'ElementsU' ( temp uint) +0:81 direct index ( temp uint) +0:81 'sizeQueryTemp' ( temp 2-component vector of uint) +0:81 Constant: +0:81 1 (const int) +0:82 Sequence +0:82 move second child to first child ( temp 2-component vector of uint) +0:82 'sizeQueryTemp' ( temp 2-component vector of uint) +0:82 textureSize ( temp 2-component vector of uint) +0:82 'g_tTex1di4a' ( uniform itexture1DArray) +0:82 Constant: +0:82 6 (const uint) +0:82 move second child to first child ( temp uint) +0:82 'WidthU' ( temp uint) +0:82 direct index ( temp uint) +0:82 'sizeQueryTemp' ( temp 2-component vector of uint) +0:82 Constant: +0:82 0 (const int) +0:82 move second child to first child ( temp uint) +0:82 'ElementsU' ( temp uint) +0:82 direct index ( temp uint) +0:82 'sizeQueryTemp' ( temp 2-component vector of uint) +0:82 Constant: +0:82 1 (const int) +0:82 move second child to first child ( temp uint) +0:82 'NumberOfLevelsU' ( temp uint) +0:82 textureQueryLevels ( temp uint) +0:82 'g_tTex1di4a' ( uniform itexture1DArray) +0:85 Sequence +0:85 move second child to first child ( temp 2-component vector of uint) +0:85 'sizeQueryTemp' ( temp 2-component vector of uint) +0:85 textureSize ( temp 2-component vector of uint) +0:85 'g_tTex1du4a' ( uniform utexture1DArray) +0:85 Constant: +0:85 0 (const int) +0:85 move second child to first child ( temp uint) +0:85 'WidthU' ( temp uint) +0:85 direct index ( temp uint) +0:85 'sizeQueryTemp' ( temp 2-component vector of uint) +0:85 Constant: +0:85 0 (const int) +0:85 move second child to first child ( temp uint) +0:85 'ElementsU' ( temp uint) +0:85 direct index ( temp uint) +0:85 'sizeQueryTemp' ( temp 2-component vector of uint) +0:85 Constant: +0:85 1 (const int) +0:86 Sequence +0:86 move second child to first child ( temp 2-component vector of uint) +0:86 'sizeQueryTemp' ( temp 2-component vector of uint) +0:86 textureSize ( temp 2-component vector of uint) +0:86 'g_tTex1du4a' ( uniform utexture1DArray) +0:86 Constant: +0:86 6 (const uint) +0:86 move second child to first child ( temp uint) +0:86 'WidthU' ( temp uint) +0:86 direct index ( temp uint) +0:86 'sizeQueryTemp' ( temp 2-component vector of uint) +0:86 Constant: +0:86 0 (const int) +0:86 move second child to first child ( temp uint) +0:86 'ElementsU' ( temp uint) +0:86 direct index ( temp uint) +0:86 'sizeQueryTemp' ( temp 2-component vector of uint) +0:86 Constant: +0:86 1 (const int) +0:86 move second child to first child ( temp uint) +0:86 'NumberOfLevelsU' ( temp uint) +0:86 textureQueryLevels ( temp uint) +0:86 'g_tTex1du4a' ( uniform utexture1DArray) +0:89 Sequence +0:89 move second child to first child ( temp 2-component vector of uint) +0:89 'sizeQueryTemp' ( temp 2-component vector of uint) +0:89 textureSize ( temp 2-component vector of uint) +0:89 'g_tTex2df4' ( uniform texture2D) +0:89 Constant: +0:89 0 (const int) +0:89 move second child to first child ( temp uint) +0:89 'WidthU' ( temp uint) +0:89 direct index ( temp uint) +0:89 'sizeQueryTemp' ( temp 2-component vector of uint) +0:89 Constant: +0:89 0 (const int) +0:89 move second child to first child ( temp uint) +0:89 'HeightU' ( temp uint) +0:89 direct index ( temp uint) +0:89 'sizeQueryTemp' ( temp 2-component vector of uint) +0:89 Constant: +0:89 1 (const int) +0:90 Sequence +0:90 move second child to first child ( temp 2-component vector of uint) +0:90 'sizeQueryTemp' ( temp 2-component vector of uint) +0:90 textureSize ( temp 2-component vector of uint) +0:90 'g_tTex2df4' ( uniform texture2D) +0:90 Constant: +0:90 6 (const uint) +0:90 move second child to first child ( temp uint) +0:90 'WidthU' ( temp uint) +0:90 direct index ( temp uint) +0:90 'sizeQueryTemp' ( temp 2-component vector of uint) +0:90 Constant: +0:90 0 (const int) +0:90 move second child to first child ( temp uint) +0:90 'HeightU' ( temp uint) +0:90 direct index ( temp uint) +0:90 'sizeQueryTemp' ( temp 2-component vector of uint) +0:90 Constant: +0:90 1 (const int) +0:90 move second child to first child ( temp uint) +0:90 'NumberOfLevelsU' ( temp uint) +0:90 textureQueryLevels ( temp uint) +0:90 'g_tTex2df4' ( uniform texture2D) +0:93 Sequence +0:93 move second child to first child ( temp 2-component vector of uint) +0:93 'sizeQueryTemp' ( temp 2-component vector of uint) +0:93 textureSize ( temp 2-component vector of uint) +0:93 'g_tTex2di4' ( uniform itexture2D) +0:93 Constant: +0:93 0 (const int) +0:93 move second child to first child ( temp uint) +0:93 'WidthU' ( temp uint) +0:93 direct index ( temp uint) +0:93 'sizeQueryTemp' ( temp 2-component vector of uint) +0:93 Constant: +0:93 0 (const int) +0:93 move second child to first child ( temp uint) +0:93 'HeightU' ( temp uint) +0:93 direct index ( temp uint) +0:93 'sizeQueryTemp' ( temp 2-component vector of uint) +0:93 Constant: +0:93 1 (const int) +0:94 Sequence +0:94 move second child to first child ( temp 2-component vector of uint) +0:94 'sizeQueryTemp' ( temp 2-component vector of uint) +0:94 textureSize ( temp 2-component vector of uint) +0:94 'g_tTex2di4' ( uniform itexture2D) +0:94 Constant: +0:94 6 (const uint) +0:94 move second child to first child ( temp uint) +0:94 'WidthU' ( temp uint) +0:94 direct index ( temp uint) +0:94 'sizeQueryTemp' ( temp 2-component vector of uint) +0:94 Constant: +0:94 0 (const int) +0:94 move second child to first child ( temp uint) +0:94 'HeightU' ( temp uint) +0:94 direct index ( temp uint) +0:94 'sizeQueryTemp' ( temp 2-component vector of uint) +0:94 Constant: +0:94 1 (const int) +0:94 move second child to first child ( temp uint) +0:94 'NumberOfLevelsU' ( temp uint) +0:94 textureQueryLevels ( temp uint) +0:94 'g_tTex2di4' ( uniform itexture2D) +0:97 Sequence +0:97 move second child to first child ( temp 2-component vector of uint) +0:97 'sizeQueryTemp' ( temp 2-component vector of uint) +0:97 textureSize ( temp 2-component vector of uint) +0:97 'g_tTex2du4' ( uniform utexture2D) +0:97 Constant: +0:97 0 (const int) +0:97 move second child to first child ( temp uint) +0:97 'WidthU' ( temp uint) +0:97 direct index ( temp uint) +0:97 'sizeQueryTemp' ( temp 2-component vector of uint) +0:97 Constant: +0:97 0 (const int) +0:97 move second child to first child ( temp uint) +0:97 'HeightU' ( temp uint) +0:97 direct index ( temp uint) +0:97 'sizeQueryTemp' ( temp 2-component vector of uint) +0:97 Constant: +0:97 1 (const int) +0:98 Sequence +0:98 move second child to first child ( temp 2-component vector of uint) +0:98 'sizeQueryTemp' ( temp 2-component vector of uint) +0:98 textureSize ( temp 2-component vector of uint) +0:98 'g_tTex2du4' ( uniform utexture2D) +0:98 Constant: +0:98 6 (const uint) +0:98 move second child to first child ( temp uint) +0:98 'WidthU' ( temp uint) +0:98 direct index ( temp uint) +0:98 'sizeQueryTemp' ( temp 2-component vector of uint) +0:98 Constant: +0:98 0 (const int) +0:98 move second child to first child ( temp uint) +0:98 'HeightU' ( temp uint) +0:98 direct index ( temp uint) +0:98 'sizeQueryTemp' ( temp 2-component vector of uint) +0:98 Constant: +0:98 1 (const int) +0:98 move second child to first child ( temp uint) +0:98 'NumberOfLevelsU' ( temp uint) +0:98 textureQueryLevels ( temp uint) +0:98 'g_tTex2du4' ( uniform utexture2D) +0:101 Sequence +0:101 move second child to first child ( temp 3-component vector of uint) +0:101 'sizeQueryTemp' ( temp 3-component vector of uint) +0:101 textureSize ( temp 3-component vector of uint) +0:101 'g_tTex2df4a' ( uniform texture2DArray) +0:101 Constant: +0:101 0 (const int) +0:101 move second child to first child ( temp uint) +0:101 'WidthU' ( temp uint) +0:101 direct index ( temp uint) +0:101 'sizeQueryTemp' ( temp 3-component vector of uint) +0:101 Constant: +0:101 0 (const int) +0:101 move second child to first child ( temp uint) +0:101 'HeightU' ( temp uint) +0:101 direct index ( temp uint) +0:101 'sizeQueryTemp' ( temp 3-component vector of uint) +0:101 Constant: +0:101 1 (const int) +0:101 move second child to first child ( temp uint) +0:101 'ElementsU' ( temp uint) +0:101 direct index ( temp uint) +0:101 'sizeQueryTemp' ( temp 3-component vector of uint) +0:101 Constant: +0:101 2 (const int) +0:102 Sequence +0:102 move second child to first child ( temp 3-component vector of uint) +0:102 'sizeQueryTemp' ( temp 3-component vector of uint) +0:102 textureSize ( temp 3-component vector of uint) +0:102 'g_tTex2df4a' ( uniform texture2DArray) +0:102 Constant: +0:102 6 (const uint) +0:102 move second child to first child ( temp uint) +0:102 'WidthU' ( temp uint) +0:102 direct index ( temp uint) +0:102 'sizeQueryTemp' ( temp 3-component vector of uint) +0:102 Constant: +0:102 0 (const int) +0:102 move second child to first child ( temp uint) +0:102 'HeightU' ( temp uint) +0:102 direct index ( temp uint) +0:102 'sizeQueryTemp' ( temp 3-component vector of uint) +0:102 Constant: +0:102 1 (const int) +0:102 move second child to first child ( temp uint) +0:102 'ElementsU' ( temp uint) +0:102 direct index ( temp uint) +0:102 'sizeQueryTemp' ( temp 3-component vector of uint) +0:102 Constant: +0:102 2 (const int) +0:102 move second child to first child ( temp uint) +0:102 'NumberOfLevelsU' ( temp uint) +0:102 textureQueryLevels ( temp uint) +0:102 'g_tTex2df4a' ( uniform texture2DArray) +0:105 Sequence +0:105 move second child to first child ( temp 3-component vector of uint) +0:105 'sizeQueryTemp' ( temp 3-component vector of uint) +0:105 textureSize ( temp 3-component vector of uint) +0:105 'g_tTex2di4a' ( uniform itexture2DArray) +0:105 Constant: +0:105 0 (const int) +0:105 move second child to first child ( temp uint) +0:105 'WidthU' ( temp uint) +0:105 direct index ( temp uint) +0:105 'sizeQueryTemp' ( temp 3-component vector of uint) +0:105 Constant: +0:105 0 (const int) +0:105 move second child to first child ( temp uint) +0:105 'HeightU' ( temp uint) +0:105 direct index ( temp uint) +0:105 'sizeQueryTemp' ( temp 3-component vector of uint) +0:105 Constant: +0:105 1 (const int) +0:105 move second child to first child ( temp uint) +0:105 'ElementsU' ( temp uint) +0:105 direct index ( temp uint) +0:105 'sizeQueryTemp' ( temp 3-component vector of uint) +0:105 Constant: +0:105 2 (const int) +0:106 Sequence +0:106 move second child to first child ( temp 3-component vector of uint) +0:106 'sizeQueryTemp' ( temp 3-component vector of uint) +0:106 textureSize ( temp 3-component vector of uint) +0:106 'g_tTex2di4a' ( uniform itexture2DArray) +0:106 Constant: +0:106 6 (const uint) +0:106 move second child to first child ( temp uint) +0:106 'WidthU' ( temp uint) +0:106 direct index ( temp uint) +0:106 'sizeQueryTemp' ( temp 3-component vector of uint) +0:106 Constant: +0:106 0 (const int) +0:106 move second child to first child ( temp uint) +0:106 'HeightU' ( temp uint) +0:106 direct index ( temp uint) +0:106 'sizeQueryTemp' ( temp 3-component vector of uint) +0:106 Constant: +0:106 1 (const int) +0:106 move second child to first child ( temp uint) +0:106 'ElementsU' ( temp uint) +0:106 direct index ( temp uint) +0:106 'sizeQueryTemp' ( temp 3-component vector of uint) +0:106 Constant: +0:106 2 (const int) +0:106 move second child to first child ( temp uint) +0:106 'NumberOfLevelsU' ( temp uint) +0:106 textureQueryLevels ( temp uint) +0:106 'g_tTex2di4a' ( uniform itexture2DArray) +0:109 Sequence +0:109 move second child to first child ( temp 3-component vector of uint) +0:109 'sizeQueryTemp' ( temp 3-component vector of uint) +0:109 textureSize ( temp 3-component vector of uint) +0:109 'g_tTex2du4a' ( uniform utexture2DArray) +0:109 Constant: +0:109 0 (const int) +0:109 move second child to first child ( temp uint) +0:109 'WidthU' ( temp uint) +0:109 direct index ( temp uint) +0:109 'sizeQueryTemp' ( temp 3-component vector of uint) +0:109 Constant: +0:109 0 (const int) +0:109 move second child to first child ( temp uint) +0:109 'HeightU' ( temp uint) +0:109 direct index ( temp uint) +0:109 'sizeQueryTemp' ( temp 3-component vector of uint) +0:109 Constant: +0:109 1 (const int) +0:109 move second child to first child ( temp uint) +0:109 'ElementsU' ( temp uint) +0:109 direct index ( temp uint) +0:109 'sizeQueryTemp' ( temp 3-component vector of uint) +0:109 Constant: +0:109 2 (const int) +0:110 Sequence +0:110 move second child to first child ( temp 3-component vector of uint) +0:110 'sizeQueryTemp' ( temp 3-component vector of uint) +0:110 textureSize ( temp 3-component vector of uint) +0:110 'g_tTex2du4a' ( uniform utexture2DArray) +0:110 Constant: +0:110 6 (const uint) +0:110 move second child to first child ( temp uint) +0:110 'WidthU' ( temp uint) +0:110 direct index ( temp uint) +0:110 'sizeQueryTemp' ( temp 3-component vector of uint) +0:110 Constant: +0:110 0 (const int) +0:110 move second child to first child ( temp uint) +0:110 'HeightU' ( temp uint) +0:110 direct index ( temp uint) +0:110 'sizeQueryTemp' ( temp 3-component vector of uint) +0:110 Constant: +0:110 1 (const int) +0:110 move second child to first child ( temp uint) +0:110 'ElementsU' ( temp uint) +0:110 direct index ( temp uint) +0:110 'sizeQueryTemp' ( temp 3-component vector of uint) +0:110 Constant: +0:110 2 (const int) +0:110 move second child to first child ( temp uint) +0:110 'NumberOfLevelsU' ( temp uint) +0:110 textureQueryLevels ( temp uint) +0:110 'g_tTex2du4a' ( uniform utexture2DArray) +0:113 Sequence +0:113 move second child to first child ( temp 3-component vector of uint) +0:113 'sizeQueryTemp' ( temp 3-component vector of uint) +0:113 textureSize ( temp 3-component vector of uint) +0:113 'g_tTex3df4' ( uniform texture3D) +0:113 Constant: +0:113 0 (const int) +0:113 move second child to first child ( temp uint) +0:113 'WidthU' ( temp uint) +0:113 direct index ( temp uint) +0:113 'sizeQueryTemp' ( temp 3-component vector of uint) +0:113 Constant: +0:113 0 (const int) +0:113 move second child to first child ( temp uint) +0:113 'HeightU' ( temp uint) +0:113 direct index ( temp uint) +0:113 'sizeQueryTemp' ( temp 3-component vector of uint) +0:113 Constant: +0:113 1 (const int) +0:113 move second child to first child ( temp uint) +0:113 'DepthU' ( temp uint) +0:113 direct index ( temp uint) +0:113 'sizeQueryTemp' ( temp 3-component vector of uint) +0:113 Constant: +0:113 2 (const int) +0:114 Sequence +0:114 move second child to first child ( temp 3-component vector of uint) +0:114 'sizeQueryTemp' ( temp 3-component vector of uint) +0:114 textureSize ( temp 3-component vector of uint) +0:114 'g_tTex3df4' ( uniform texture3D) +0:114 Constant: +0:114 6 (const uint) +0:114 move second child to first child ( temp uint) +0:114 'WidthU' ( temp uint) +0:114 direct index ( temp uint) +0:114 'sizeQueryTemp' ( temp 3-component vector of uint) +0:114 Constant: +0:114 0 (const int) +0:114 move second child to first child ( temp uint) +0:114 'HeightU' ( temp uint) +0:114 direct index ( temp uint) +0:114 'sizeQueryTemp' ( temp 3-component vector of uint) +0:114 Constant: +0:114 1 (const int) +0:114 move second child to first child ( temp uint) +0:114 'DepthU' ( temp uint) +0:114 direct index ( temp uint) +0:114 'sizeQueryTemp' ( temp 3-component vector of uint) +0:114 Constant: +0:114 2 (const int) +0:114 move second child to first child ( temp uint) +0:114 'NumberOfLevelsU' ( temp uint) +0:114 textureQueryLevels ( temp uint) +0:114 'g_tTex3df4' ( uniform texture3D) +0:117 Sequence +0:117 move second child to first child ( temp 3-component vector of uint) +0:117 'sizeQueryTemp' ( temp 3-component vector of uint) +0:117 textureSize ( temp 3-component vector of uint) +0:117 'g_tTex3di4' ( uniform itexture3D) +0:117 Constant: +0:117 0 (const int) +0:117 move second child to first child ( temp uint) +0:117 'WidthU' ( temp uint) +0:117 direct index ( temp uint) +0:117 'sizeQueryTemp' ( temp 3-component vector of uint) +0:117 Constant: +0:117 0 (const int) +0:117 move second child to first child ( temp uint) +0:117 'HeightU' ( temp uint) +0:117 direct index ( temp uint) +0:117 'sizeQueryTemp' ( temp 3-component vector of uint) +0:117 Constant: +0:117 1 (const int) +0:117 move second child to first child ( temp uint) +0:117 'DepthU' ( temp uint) +0:117 direct index ( temp uint) +0:117 'sizeQueryTemp' ( temp 3-component vector of uint) +0:117 Constant: +0:117 2 (const int) +0:118 Sequence +0:118 move second child to first child ( temp 3-component vector of uint) +0:118 'sizeQueryTemp' ( temp 3-component vector of uint) +0:118 textureSize ( temp 3-component vector of uint) +0:118 'g_tTex3di4' ( uniform itexture3D) +0:118 Constant: +0:118 6 (const uint) +0:118 move second child to first child ( temp uint) +0:118 'WidthU' ( temp uint) +0:118 direct index ( temp uint) +0:118 'sizeQueryTemp' ( temp 3-component vector of uint) +0:118 Constant: +0:118 0 (const int) +0:118 move second child to first child ( temp uint) +0:118 'HeightU' ( temp uint) +0:118 direct index ( temp uint) +0:118 'sizeQueryTemp' ( temp 3-component vector of uint) +0:118 Constant: +0:118 1 (const int) +0:118 move second child to first child ( temp uint) +0:118 'DepthU' ( temp uint) +0:118 direct index ( temp uint) +0:118 'sizeQueryTemp' ( temp 3-component vector of uint) +0:118 Constant: +0:118 2 (const int) +0:118 move second child to first child ( temp uint) +0:118 'NumberOfLevelsU' ( temp uint) +0:118 textureQueryLevels ( temp uint) +0:118 'g_tTex3di4' ( uniform itexture3D) +0:121 Sequence +0:121 move second child to first child ( temp 3-component vector of uint) +0:121 'sizeQueryTemp' ( temp 3-component vector of uint) +0:121 textureSize ( temp 3-component vector of uint) +0:121 'g_tTex3du4' ( uniform utexture3D) +0:121 Constant: +0:121 0 (const int) +0:121 move second child to first child ( temp uint) +0:121 'WidthU' ( temp uint) +0:121 direct index ( temp uint) +0:121 'sizeQueryTemp' ( temp 3-component vector of uint) +0:121 Constant: +0:121 0 (const int) +0:121 move second child to first child ( temp uint) +0:121 'HeightU' ( temp uint) +0:121 direct index ( temp uint) +0:121 'sizeQueryTemp' ( temp 3-component vector of uint) +0:121 Constant: +0:121 1 (const int) +0:121 move second child to first child ( temp uint) +0:121 'DepthU' ( temp uint) +0:121 direct index ( temp uint) +0:121 'sizeQueryTemp' ( temp 3-component vector of uint) +0:121 Constant: +0:121 2 (const int) +0:122 Sequence +0:122 move second child to first child ( temp 3-component vector of uint) +0:122 'sizeQueryTemp' ( temp 3-component vector of uint) +0:122 textureSize ( temp 3-component vector of uint) +0:122 'g_tTex3du4' ( uniform utexture3D) +0:122 Constant: +0:122 6 (const uint) +0:122 move second child to first child ( temp uint) +0:122 'WidthU' ( temp uint) +0:122 direct index ( temp uint) +0:122 'sizeQueryTemp' ( temp 3-component vector of uint) +0:122 Constant: +0:122 0 (const int) +0:122 move second child to first child ( temp uint) +0:122 'HeightU' ( temp uint) +0:122 direct index ( temp uint) +0:122 'sizeQueryTemp' ( temp 3-component vector of uint) +0:122 Constant: +0:122 1 (const int) +0:122 move second child to first child ( temp uint) +0:122 'DepthU' ( temp uint) +0:122 direct index ( temp uint) +0:122 'sizeQueryTemp' ( temp 3-component vector of uint) +0:122 Constant: +0:122 2 (const int) +0:122 move second child to first child ( temp uint) +0:122 'NumberOfLevelsU' ( temp uint) +0:122 textureQueryLevels ( temp uint) +0:122 'g_tTex3du4' ( uniform utexture3D) +0:125 Sequence +0:125 move second child to first child ( temp 2-component vector of uint) +0:125 'sizeQueryTemp' ( temp 2-component vector of uint) +0:125 textureSize ( temp 2-component vector of uint) +0:125 'g_tTexcdf4' ( uniform textureCube) +0:125 Constant: +0:125 0 (const int) +0:125 move second child to first child ( temp uint) +0:125 'WidthU' ( temp uint) +0:125 direct index ( temp uint) +0:125 'sizeQueryTemp' ( temp 2-component vector of uint) +0:125 Constant: +0:125 0 (const int) +0:125 move second child to first child ( temp uint) +0:125 'HeightU' ( temp uint) +0:125 direct index ( temp uint) +0:125 'sizeQueryTemp' ( temp 2-component vector of uint) +0:125 Constant: +0:125 1 (const int) +0:126 Sequence +0:126 move second child to first child ( temp 2-component vector of uint) +0:126 'sizeQueryTemp' ( temp 2-component vector of uint) +0:126 textureSize ( temp 2-component vector of uint) +0:126 'g_tTexcdf4' ( uniform textureCube) +0:126 Constant: +0:126 6 (const uint) +0:126 move second child to first child ( temp uint) +0:126 'WidthU' ( temp uint) +0:126 direct index ( temp uint) +0:126 'sizeQueryTemp' ( temp 2-component vector of uint) +0:126 Constant: +0:126 0 (const int) +0:126 move second child to first child ( temp uint) +0:126 'HeightU' ( temp uint) +0:126 direct index ( temp uint) +0:126 'sizeQueryTemp' ( temp 2-component vector of uint) +0:126 Constant: +0:126 1 (const int) +0:126 move second child to first child ( temp uint) +0:126 'NumberOfLevelsU' ( temp uint) +0:126 textureQueryLevels ( temp uint) +0:126 'g_tTexcdf4' ( uniform textureCube) +0:129 Sequence +0:129 move second child to first child ( temp 2-component vector of uint) +0:129 'sizeQueryTemp' ( temp 2-component vector of uint) +0:129 textureSize ( temp 2-component vector of uint) +0:129 'g_tTexcdi4' ( uniform itextureCube) +0:129 Constant: +0:129 0 (const int) +0:129 move second child to first child ( temp uint) +0:129 'WidthU' ( temp uint) +0:129 direct index ( temp uint) +0:129 'sizeQueryTemp' ( temp 2-component vector of uint) +0:129 Constant: +0:129 0 (const int) +0:129 move second child to first child ( temp uint) +0:129 'HeightU' ( temp uint) +0:129 direct index ( temp uint) +0:129 'sizeQueryTemp' ( temp 2-component vector of uint) +0:129 Constant: +0:129 1 (const int) +0:130 Sequence +0:130 move second child to first child ( temp 2-component vector of uint) +0:130 'sizeQueryTemp' ( temp 2-component vector of uint) +0:130 textureSize ( temp 2-component vector of uint) +0:130 'g_tTexcdi4' ( uniform itextureCube) +0:130 Constant: +0:130 6 (const uint) +0:130 move second child to first child ( temp uint) +0:130 'WidthU' ( temp uint) +0:130 direct index ( temp uint) +0:130 'sizeQueryTemp' ( temp 2-component vector of uint) +0:130 Constant: +0:130 0 (const int) +0:130 move second child to first child ( temp uint) +0:130 'HeightU' ( temp uint) +0:130 direct index ( temp uint) +0:130 'sizeQueryTemp' ( temp 2-component vector of uint) +0:130 Constant: +0:130 1 (const int) +0:130 move second child to first child ( temp uint) +0:130 'NumberOfLevelsU' ( temp uint) +0:130 textureQueryLevels ( temp uint) +0:130 'g_tTexcdi4' ( uniform itextureCube) +0:133 Sequence +0:133 move second child to first child ( temp 2-component vector of uint) +0:133 'sizeQueryTemp' ( temp 2-component vector of uint) +0:133 textureSize ( temp 2-component vector of uint) +0:133 'g_tTexcdu4' ( uniform utextureCube) +0:133 Constant: +0:133 0 (const int) +0:133 move second child to first child ( temp uint) +0:133 'WidthU' ( temp uint) +0:133 direct index ( temp uint) +0:133 'sizeQueryTemp' ( temp 2-component vector of uint) +0:133 Constant: +0:133 0 (const int) +0:133 move second child to first child ( temp uint) +0:133 'HeightU' ( temp uint) +0:133 direct index ( temp uint) +0:133 'sizeQueryTemp' ( temp 2-component vector of uint) +0:133 Constant: +0:133 1 (const int) +0:134 Sequence +0:134 move second child to first child ( temp 2-component vector of uint) +0:134 'sizeQueryTemp' ( temp 2-component vector of uint) +0:134 textureSize ( temp 2-component vector of uint) +0:134 'g_tTexcdu4' ( uniform utextureCube) +0:134 Constant: +0:134 6 (const uint) +0:134 move second child to first child ( temp uint) +0:134 'WidthU' ( temp uint) +0:134 direct index ( temp uint) +0:134 'sizeQueryTemp' ( temp 2-component vector of uint) +0:134 Constant: +0:134 0 (const int) +0:134 move second child to first child ( temp uint) +0:134 'HeightU' ( temp uint) +0:134 direct index ( temp uint) +0:134 'sizeQueryTemp' ( temp 2-component vector of uint) +0:134 Constant: +0:134 1 (const int) +0:134 move second child to first child ( temp uint) +0:134 'NumberOfLevelsU' ( temp uint) +0:134 textureQueryLevels ( temp uint) +0:134 'g_tTexcdu4' ( uniform utextureCube) +0:137 Sequence +0:137 move second child to first child ( temp 3-component vector of uint) +0:137 'sizeQueryTemp' ( temp 3-component vector of uint) +0:137 textureSize ( temp 3-component vector of uint) +0:137 'g_tTexcdf4a' ( uniform textureCubeArray) +0:137 Constant: +0:137 0 (const int) +0:137 move second child to first child ( temp uint) +0:137 'WidthU' ( temp uint) +0:137 direct index ( temp uint) +0:137 'sizeQueryTemp' ( temp 3-component vector of uint) +0:137 Constant: +0:137 0 (const int) +0:137 move second child to first child ( temp uint) +0:137 'HeightU' ( temp uint) +0:137 direct index ( temp uint) +0:137 'sizeQueryTemp' ( temp 3-component vector of uint) +0:137 Constant: +0:137 1 (const int) +0:137 move second child to first child ( temp uint) +0:137 'ElementsU' ( temp uint) +0:137 direct index ( temp uint) +0:137 'sizeQueryTemp' ( temp 3-component vector of uint) +0:137 Constant: +0:137 2 (const int) +0:138 Sequence +0:138 move second child to first child ( temp 3-component vector of uint) +0:138 'sizeQueryTemp' ( temp 3-component vector of uint) +0:138 textureSize ( temp 3-component vector of uint) +0:138 'g_tTexcdf4a' ( uniform textureCubeArray) +0:138 Constant: +0:138 6 (const uint) +0:138 move second child to first child ( temp uint) +0:138 'WidthU' ( temp uint) +0:138 direct index ( temp uint) +0:138 'sizeQueryTemp' ( temp 3-component vector of uint) +0:138 Constant: +0:138 0 (const int) +0:138 move second child to first child ( temp uint) +0:138 'HeightU' ( temp uint) +0:138 direct index ( temp uint) +0:138 'sizeQueryTemp' ( temp 3-component vector of uint) +0:138 Constant: +0:138 1 (const int) +0:138 move second child to first child ( temp uint) +0:138 'ElementsU' ( temp uint) +0:138 direct index ( temp uint) +0:138 'sizeQueryTemp' ( temp 3-component vector of uint) +0:138 Constant: +0:138 2 (const int) +0:138 move second child to first child ( temp uint) +0:138 'NumberOfLevelsU' ( temp uint) +0:138 textureQueryLevels ( temp uint) +0:138 'g_tTexcdf4a' ( uniform textureCubeArray) +0:141 Sequence +0:141 move second child to first child ( temp 3-component vector of uint) +0:141 'sizeQueryTemp' ( temp 3-component vector of uint) +0:141 textureSize ( temp 3-component vector of uint) +0:141 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:141 Constant: +0:141 0 (const int) +0:141 move second child to first child ( temp uint) +0:141 'WidthU' ( temp uint) +0:141 direct index ( temp uint) +0:141 'sizeQueryTemp' ( temp 3-component vector of uint) +0:141 Constant: +0:141 0 (const int) +0:141 move second child to first child ( temp uint) +0:141 'HeightU' ( temp uint) +0:141 direct index ( temp uint) +0:141 'sizeQueryTemp' ( temp 3-component vector of uint) +0:141 Constant: +0:141 1 (const int) +0:141 move second child to first child ( temp uint) +0:141 'ElementsU' ( temp uint) +0:141 direct index ( temp uint) +0:141 'sizeQueryTemp' ( temp 3-component vector of uint) +0:141 Constant: +0:141 2 (const int) +0:142 Sequence +0:142 move second child to first child ( temp 3-component vector of uint) +0:142 'sizeQueryTemp' ( temp 3-component vector of uint) +0:142 textureSize ( temp 3-component vector of uint) +0:142 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:142 Constant: +0:142 6 (const uint) +0:142 move second child to first child ( temp uint) +0:142 'WidthU' ( temp uint) +0:142 direct index ( temp uint) +0:142 'sizeQueryTemp' ( temp 3-component vector of uint) +0:142 Constant: +0:142 0 (const int) +0:142 move second child to first child ( temp uint) +0:142 'HeightU' ( temp uint) +0:142 direct index ( temp uint) +0:142 'sizeQueryTemp' ( temp 3-component vector of uint) +0:142 Constant: +0:142 1 (const int) +0:142 move second child to first child ( temp uint) +0:142 'ElementsU' ( temp uint) +0:142 direct index ( temp uint) +0:142 'sizeQueryTemp' ( temp 3-component vector of uint) +0:142 Constant: +0:142 2 (const int) +0:142 move second child to first child ( temp uint) +0:142 'NumberOfLevelsU' ( temp uint) +0:142 textureQueryLevels ( temp uint) +0:142 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:145 Sequence +0:145 move second child to first child ( temp 3-component vector of uint) +0:145 'sizeQueryTemp' ( temp 3-component vector of uint) +0:145 textureSize ( temp 3-component vector of uint) +0:145 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:145 Constant: +0:145 0 (const int) +0:145 move second child to first child ( temp uint) +0:145 'WidthU' ( temp uint) +0:145 direct index ( temp uint) +0:145 'sizeQueryTemp' ( temp 3-component vector of uint) +0:145 Constant: +0:145 0 (const int) +0:145 move second child to first child ( temp uint) +0:145 'HeightU' ( temp uint) +0:145 direct index ( temp uint) +0:145 'sizeQueryTemp' ( temp 3-component vector of uint) +0:145 Constant: +0:145 1 (const int) +0:145 move second child to first child ( temp uint) +0:145 'ElementsU' ( temp uint) +0:145 direct index ( temp uint) +0:145 'sizeQueryTemp' ( temp 3-component vector of uint) +0:145 Constant: +0:145 2 (const int) +0:146 Sequence +0:146 move second child to first child ( temp 3-component vector of uint) +0:146 'sizeQueryTemp' ( temp 3-component vector of uint) +0:146 textureSize ( temp 3-component vector of uint) +0:146 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:146 Constant: +0:146 6 (const uint) +0:146 move second child to first child ( temp uint) +0:146 'WidthU' ( temp uint) +0:146 direct index ( temp uint) +0:146 'sizeQueryTemp' ( temp 3-component vector of uint) +0:146 Constant: +0:146 0 (const int) +0:146 move second child to first child ( temp uint) +0:146 'HeightU' ( temp uint) +0:146 direct index ( temp uint) +0:146 'sizeQueryTemp' ( temp 3-component vector of uint) +0:146 Constant: +0:146 1 (const int) +0:146 move second child to first child ( temp uint) +0:146 'ElementsU' ( temp uint) +0:146 direct index ( temp uint) +0:146 'sizeQueryTemp' ( temp 3-component vector of uint) +0:146 Constant: +0:146 2 (const int) +0:146 move second child to first child ( temp uint) +0:146 'NumberOfLevelsU' ( temp uint) +0:146 textureQueryLevels ( temp uint) +0:146 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:149 Sequence +0:149 move second child to first child ( temp 2-component vector of uint) +0:149 'sizeQueryTemp' ( temp 2-component vector of uint) +0:149 textureSize ( temp 2-component vector of uint) +0:149 'g_tTex2dmsf4' ( uniform texture2DMS) +0:149 move second child to first child ( temp uint) +0:149 'WidthU' ( temp uint) +0:149 direct index ( temp uint) +0:149 'sizeQueryTemp' ( temp 2-component vector of uint) +0:149 Constant: +0:149 0 (const int) +0:149 move second child to first child ( temp uint) +0:149 'HeightU' ( temp uint) +0:149 direct index ( temp uint) +0:149 'sizeQueryTemp' ( temp 2-component vector of uint) +0:149 Constant: +0:149 1 (const int) +0:149 move second child to first child ( temp uint) +0:149 'NumberOfSamplesU' ( temp uint) +0:149 imageQuerySamples ( temp uint) +0:149 'g_tTex2dmsf4' ( uniform texture2DMS) +0:152 Sequence +0:152 move second child to first child ( temp 2-component vector of uint) +0:152 'sizeQueryTemp' ( temp 2-component vector of uint) +0:152 textureSize ( temp 2-component vector of uint) +0:152 'g_tTex2dmsi4' ( uniform itexture2DMS) +0:152 move second child to first child ( temp uint) +0:152 'WidthU' ( temp uint) +0:152 direct index ( temp uint) +0:152 'sizeQueryTemp' ( temp 2-component vector of uint) +0:152 Constant: +0:152 0 (const int) +0:152 move second child to first child ( temp uint) +0:152 'HeightU' ( temp uint) +0:152 direct index ( temp uint) +0:152 'sizeQueryTemp' ( temp 2-component vector of uint) +0:152 Constant: +0:152 1 (const int) +0:152 move second child to first child ( temp uint) +0:152 'NumberOfSamplesU' ( temp uint) +0:152 imageQuerySamples ( temp uint) +0:152 'g_tTex2dmsi4' ( uniform itexture2DMS) +0:155 Sequence +0:155 move second child to first child ( temp 2-component vector of uint) +0:155 'sizeQueryTemp' ( temp 2-component vector of uint) +0:155 textureSize ( temp 2-component vector of uint) +0:155 'g_tTex2dmsu4' ( uniform utexture2DMS) +0:155 move second child to first child ( temp uint) +0:155 'WidthU' ( temp uint) +0:155 direct index ( temp uint) +0:155 'sizeQueryTemp' ( temp 2-component vector of uint) +0:155 Constant: +0:155 0 (const int) +0:155 move second child to first child ( temp uint) +0:155 'HeightU' ( temp uint) +0:155 direct index ( temp uint) +0:155 'sizeQueryTemp' ( temp 2-component vector of uint) +0:155 Constant: +0:155 1 (const int) +0:155 move second child to first child ( temp uint) +0:155 'NumberOfSamplesU' ( temp uint) +0:155 imageQuerySamples ( temp uint) +0:155 'g_tTex2dmsu4' ( uniform utexture2DMS) +0:158 Sequence +0:158 move second child to first child ( temp 3-component vector of uint) +0:158 'sizeQueryTemp' ( temp 3-component vector of uint) +0:158 textureSize ( temp 3-component vector of uint) +0:158 'g_tTex2dmsf4a' ( uniform texture2DMSArray) +0:158 move second child to first child ( temp uint) +0:158 'WidthU' ( temp uint) +0:158 direct index ( temp uint) +0:158 'sizeQueryTemp' ( temp 3-component vector of uint) +0:158 Constant: +0:158 0 (const int) +0:158 move second child to first child ( temp uint) +0:158 'HeightU' ( temp uint) +0:158 direct index ( temp uint) +0:158 'sizeQueryTemp' ( temp 3-component vector of uint) +0:158 Constant: +0:158 1 (const int) +0:158 move second child to first child ( temp uint) +0:158 'ElementsU' ( temp uint) +0:158 direct index ( temp uint) +0:158 'sizeQueryTemp' ( temp 3-component vector of uint) +0:158 Constant: +0:158 2 (const int) +0:158 move second child to first child ( temp uint) +0:158 'NumberOfSamplesU' ( temp uint) +0:158 imageQuerySamples ( temp uint) +0:158 'g_tTex2dmsf4a' ( uniform texture2DMSArray) +0:161 Sequence +0:161 move second child to first child ( temp 3-component vector of uint) +0:161 'sizeQueryTemp' ( temp 3-component vector of uint) +0:161 textureSize ( temp 3-component vector of uint) +0:161 'g_tTex2dmsi4a' ( uniform itexture2DMSArray) +0:161 move second child to first child ( temp uint) +0:161 'WidthU' ( temp uint) +0:161 direct index ( temp uint) +0:161 'sizeQueryTemp' ( temp 3-component vector of uint) +0:161 Constant: +0:161 0 (const int) +0:161 move second child to first child ( temp uint) +0:161 'HeightU' ( temp uint) +0:161 direct index ( temp uint) +0:161 'sizeQueryTemp' ( temp 3-component vector of uint) +0:161 Constant: +0:161 1 (const int) +0:161 move second child to first child ( temp uint) +0:161 'ElementsU' ( temp uint) +0:161 direct index ( temp uint) +0:161 'sizeQueryTemp' ( temp 3-component vector of uint) +0:161 Constant: +0:161 2 (const int) +0:161 move second child to first child ( temp uint) +0:161 'NumberOfSamplesU' ( temp uint) +0:161 imageQuerySamples ( temp uint) +0:161 'g_tTex2dmsi4a' ( uniform itexture2DMSArray) +0:164 Sequence +0:164 move second child to first child ( temp 3-component vector of uint) +0:164 'sizeQueryTemp' ( temp 3-component vector of uint) +0:164 textureSize ( temp 3-component vector of uint) +0:164 'g_tTex2dmsu4a' ( uniform utexture2DMSArray) +0:164 move second child to first child ( temp uint) +0:164 'WidthU' ( temp uint) +0:164 direct index ( temp uint) +0:164 'sizeQueryTemp' ( temp 3-component vector of uint) +0:164 Constant: +0:164 0 (const int) +0:164 move second child to first child ( temp uint) +0:164 'HeightU' ( temp uint) +0:164 direct index ( temp uint) +0:164 'sizeQueryTemp' ( temp 3-component vector of uint) +0:164 Constant: +0:164 1 (const int) +0:164 move second child to first child ( temp uint) +0:164 'ElementsU' ( temp uint) +0:164 direct index ( temp uint) +0:164 'sizeQueryTemp' ( temp 3-component vector of uint) +0:164 Constant: +0:164 2 (const int) +0:164 move second child to first child ( temp uint) +0:164 'NumberOfSamplesU' ( temp uint) +0:164 imageQuerySamples ( temp uint) +0:164 'g_tTex2dmsu4a' ( uniform utexture2DMSArray) +0:276 move second child to first child ( temp 4-component vector of float) +0:276 Color: direct index for structure ( temp 4-component vector of float) +0:276 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:276 Constant: +0:276 0 (const int) +0:276 Constant: +0:276 1.000000 +0:276 1.000000 +0:276 1.000000 +0:276 1.000000 +0:277 move second child to first child ( temp float) +0:277 Depth: direct index for structure ( temp float) +0:277 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:277 Constant: +0:277 1 (const int) +0:277 Constant: +0:277 1.000000 +0:279 Branch: Return with expression +0:279 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 Function Definition: main( ( temp void) +0:46 Function Parameters: +0:? Sequence +0:46 Sequence +0:46 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:46 Color: direct index for structure ( temp 4-component vector of float) +0:46 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 Constant: +0:46 0 (const int) +0:46 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:46 Depth: direct index for structure ( temp float) +0:46 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 Constant: +0:46 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? 'g_tTex2dmsf4' ( uniform texture2DMS) +0:? 'g_tTex2dmsi4' ( uniform itexture2DMS) +0:? 'g_tTex2dmsu4' ( uniform utexture2DMS) +0:? 'g_tTex2dmsf4a' ( uniform texture2DMSArray) +0:? 'g_tTex2dmsi4a' ( uniform itexture2DMSArray) +0:? 'g_tTex2dmsu4a' ( uniform utexture2DMSArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 550 + + Capability Shader + Capability Sampled1D + Capability SampledCubeArray + Capability ImageQuery + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 540 544 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 14 "sizeQueryTemp" + Name 17 "g_tTex1df4" + Name 22 "WidthU" + Name 24 "sizeQueryTemp" + Name 29 "NumberOfLevelsU" + Name 32 "sizeQueryTemp" + Name 35 "g_tTex1di4" + Name 39 "sizeQueryTemp" + Name 45 "sizeQueryTemp" + Name 48 "g_tTex1du4" + Name 52 "sizeQueryTemp" + Name 60 "sizeQueryTemp" + Name 63 "g_tTex1df4a" + Name 69 "ElementsU" + Name 73 "sizeQueryTemp" + Name 82 "sizeQueryTemp" + Name 85 "g_tTex1di4a" + Name 92 "sizeQueryTemp" + Name 101 "sizeQueryTemp" + Name 104 "g_tTex1du4a" + Name 111 "sizeQueryTemp" + Name 120 "sizeQueryTemp" + Name 123 "g_tTex2df4" + Name 128 "HeightU" + Name 131 "sizeQueryTemp" + Name 140 "sizeQueryTemp" + Name 143 "g_tTex2di4" + Name 150 "sizeQueryTemp" + Name 159 "sizeQueryTemp" + Name 162 "g_tTex2du4" + Name 169 "sizeQueryTemp" + Name 180 "sizeQueryTemp" + Name 183 "g_tTex2df4a" + Name 193 "sizeQueryTemp" + Name 204 "sizeQueryTemp" + Name 207 "g_tTex2di4a" + Name 216 "sizeQueryTemp" + Name 227 "sizeQueryTemp" + Name 230 "g_tTex2du4a" + Name 239 "sizeQueryTemp" + Name 250 "sizeQueryTemp" + Name 253 "g_tTex3df4" + Name 260 "DepthU" + Name 263 "sizeQueryTemp" + Name 274 "sizeQueryTemp" + Name 277 "g_tTex3di4" + Name 286 "sizeQueryTemp" + Name 297 "sizeQueryTemp" + Name 300 "g_tTex3du4" + Name 309 "sizeQueryTemp" + Name 320 "sizeQueryTemp" + Name 323 "g_tTexcdf4" + Name 330 "sizeQueryTemp" + Name 339 "sizeQueryTemp" + Name 342 "g_tTexcdi4" + Name 349 "sizeQueryTemp" + Name 358 "sizeQueryTemp" + Name 361 "g_tTexcdu4" + Name 368 "sizeQueryTemp" + Name 377 "sizeQueryTemp" + Name 380 "g_tTexcdf4a" + Name 389 "sizeQueryTemp" + Name 400 "sizeQueryTemp" + Name 403 "g_tTexcdi4a" + Name 412 "sizeQueryTemp" + Name 423 "sizeQueryTemp" + Name 426 "g_tTexcdu4a" + Name 435 "sizeQueryTemp" + Name 446 "sizeQueryTemp" + Name 449 "g_tTex2dmsf4" + Name 456 "NumberOfSamplesU" + Name 459 "sizeQueryTemp" + Name 462 "g_tTex2dmsi4" + Name 471 "sizeQueryTemp" + Name 474 "g_tTex2dmsu4" + Name 483 "sizeQueryTemp" + Name 486 "g_tTex2dmsf4a" + Name 497 "sizeQueryTemp" + Name 500 "g_tTex2dmsi4a" + Name 511 "sizeQueryTemp" + Name 514 "g_tTex2dmsu4a" + Name 526 "psout" + Name 537 "flattenTemp" + Name 540 "@entryPointOutput.Color" + Name 544 "@entryPointOutput.Depth" + Name 549 "g_sSamp" + Decorate 17(g_tTex1df4) DescriptorSet 0 + Decorate 17(g_tTex1df4) Binding 0 + Decorate 35(g_tTex1di4) DescriptorSet 0 + Decorate 48(g_tTex1du4) DescriptorSet 0 + Decorate 63(g_tTex1df4a) DescriptorSet 0 + Decorate 85(g_tTex1di4a) DescriptorSet 0 + Decorate 104(g_tTex1du4a) DescriptorSet 0 + Decorate 123(g_tTex2df4) DescriptorSet 0 + Decorate 143(g_tTex2di4) DescriptorSet 0 + Decorate 162(g_tTex2du4) DescriptorSet 0 + Decorate 183(g_tTex2df4a) DescriptorSet 0 + Decorate 207(g_tTex2di4a) DescriptorSet 0 + Decorate 230(g_tTex2du4a) DescriptorSet 0 + Decorate 253(g_tTex3df4) DescriptorSet 0 + Decorate 277(g_tTex3di4) DescriptorSet 0 + Decorate 300(g_tTex3du4) DescriptorSet 0 + Decorate 323(g_tTexcdf4) DescriptorSet 0 + Decorate 342(g_tTexcdi4) DescriptorSet 0 + Decorate 361(g_tTexcdu4) DescriptorSet 0 + Decorate 380(g_tTexcdf4a) DescriptorSet 0 + Decorate 403(g_tTexcdi4a) DescriptorSet 0 + Decorate 426(g_tTexcdu4a) DescriptorSet 0 + Decorate 449(g_tTex2dmsf4) DescriptorSet 0 + Decorate 462(g_tTex2dmsi4) DescriptorSet 0 + Decorate 474(g_tTex2dmsu4) DescriptorSet 0 + Decorate 486(g_tTex2dmsf4a) DescriptorSet 0 + Decorate 500(g_tTex2dmsi4a) DescriptorSet 0 + Decorate 514(g_tTex2dmsu4a) DescriptorSet 0 + Decorate 540(@entryPointOutput.Color) Location 0 + Decorate 544(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 549(g_sSamp) DescriptorSet 0 + Decorate 549(g_sSamp) Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeInt 32 0 + 13: TypePointer Function 12(int) + 15: TypeImage 6(float) 1D sampled format:Unknown + 16: TypePointer UniformConstant 15 + 17(g_tTex1df4): 16(ptr) Variable UniformConstant + 19: TypeInt 32 1 + 20: 19(int) Constant 0 + 26: 12(int) Constant 6 + 33: TypeImage 19(int) 1D sampled format:Unknown + 34: TypePointer UniformConstant 33 + 35(g_tTex1di4): 34(ptr) Variable UniformConstant + 46: TypeImage 12(int) 1D sampled format:Unknown + 47: TypePointer UniformConstant 46 + 48(g_tTex1du4): 47(ptr) Variable UniformConstant + 58: TypeVector 12(int) 2 + 59: TypePointer Function 58(ivec2) + 61: TypeImage 6(float) 1D array sampled format:Unknown + 62: TypePointer UniformConstant 61 + 63(g_tTex1df4a): 62(ptr) Variable UniformConstant + 66: 12(int) Constant 0 + 70: 12(int) Constant 1 + 83: TypeImage 19(int) 1D array sampled format:Unknown + 84: TypePointer UniformConstant 83 + 85(g_tTex1di4a): 84(ptr) Variable UniformConstant + 102: TypeImage 12(int) 1D array sampled format:Unknown + 103: TypePointer UniformConstant 102 +104(g_tTex1du4a): 103(ptr) Variable UniformConstant + 121: TypeImage 6(float) 2D sampled format:Unknown + 122: TypePointer UniformConstant 121 + 123(g_tTex2df4): 122(ptr) Variable UniformConstant + 141: TypeImage 19(int) 2D sampled format:Unknown + 142: TypePointer UniformConstant 141 + 143(g_tTex2di4): 142(ptr) Variable UniformConstant + 160: TypeImage 12(int) 2D sampled format:Unknown + 161: TypePointer UniformConstant 160 + 162(g_tTex2du4): 161(ptr) Variable UniformConstant + 178: TypeVector 12(int) 3 + 179: TypePointer Function 178(ivec3) + 181: TypeImage 6(float) 2D array sampled format:Unknown + 182: TypePointer UniformConstant 181 +183(g_tTex2df4a): 182(ptr) Variable UniformConstant + 190: 12(int) Constant 2 + 205: TypeImage 19(int) 2D array sampled format:Unknown + 206: TypePointer UniformConstant 205 +207(g_tTex2di4a): 206(ptr) Variable UniformConstant + 228: TypeImage 12(int) 2D array sampled format:Unknown + 229: TypePointer UniformConstant 228 +230(g_tTex2du4a): 229(ptr) Variable UniformConstant + 251: TypeImage 6(float) 3D sampled format:Unknown + 252: TypePointer UniformConstant 251 + 253(g_tTex3df4): 252(ptr) Variable UniformConstant + 275: TypeImage 19(int) 3D sampled format:Unknown + 276: TypePointer UniformConstant 275 + 277(g_tTex3di4): 276(ptr) Variable UniformConstant + 298: TypeImage 12(int) 3D sampled format:Unknown + 299: TypePointer UniformConstant 298 + 300(g_tTex3du4): 299(ptr) Variable UniformConstant + 321: TypeImage 6(float) Cube sampled format:Unknown + 322: TypePointer UniformConstant 321 + 323(g_tTexcdf4): 322(ptr) Variable UniformConstant + 340: TypeImage 19(int) Cube sampled format:Unknown + 341: TypePointer UniformConstant 340 + 342(g_tTexcdi4): 341(ptr) Variable UniformConstant + 359: TypeImage 12(int) Cube sampled format:Unknown + 360: TypePointer UniformConstant 359 + 361(g_tTexcdu4): 360(ptr) Variable UniformConstant + 378: TypeImage 6(float) Cube array sampled format:Unknown + 379: TypePointer UniformConstant 378 +380(g_tTexcdf4a): 379(ptr) Variable UniformConstant + 401: TypeImage 19(int) Cube array sampled format:Unknown + 402: TypePointer UniformConstant 401 +403(g_tTexcdi4a): 402(ptr) Variable UniformConstant + 424: TypeImage 12(int) Cube array sampled format:Unknown + 425: TypePointer UniformConstant 424 +426(g_tTexcdu4a): 425(ptr) Variable UniformConstant + 447: TypeImage 6(float) 2D multi-sampled sampled format:Unknown + 448: TypePointer UniformConstant 447 +449(g_tTex2dmsf4): 448(ptr) Variable UniformConstant + 460: TypeImage 19(int) 2D multi-sampled sampled format:Unknown + 461: TypePointer UniformConstant 460 +462(g_tTex2dmsi4): 461(ptr) Variable UniformConstant + 472: TypeImage 12(int) 2D multi-sampled sampled format:Unknown + 473: TypePointer UniformConstant 472 +474(g_tTex2dmsu4): 473(ptr) Variable UniformConstant + 484: TypeImage 6(float) 2D array multi-sampled sampled format:Unknown + 485: TypePointer UniformConstant 484 +486(g_tTex2dmsf4a): 485(ptr) Variable UniformConstant + 498: TypeImage 19(int) 2D array multi-sampled sampled format:Unknown + 499: TypePointer UniformConstant 498 +500(g_tTex2dmsi4a): 499(ptr) Variable UniformConstant + 512: TypeImage 12(int) 2D array multi-sampled sampled format:Unknown + 513: TypePointer UniformConstant 512 +514(g_tTex2dmsu4a): 513(ptr) Variable UniformConstant + 525: TypePointer Function 8(PS_OUTPUT) + 527: 6(float) Constant 1065353216 + 528: 7(fvec4) ConstantComposite 527 527 527 527 + 529: TypePointer Function 7(fvec4) + 531: 19(int) Constant 1 + 532: TypePointer Function 6(float) + 539: TypePointer Output 7(fvec4) +540(@entryPointOutput.Color): 539(ptr) Variable Output + 543: TypePointer Output 6(float) +544(@entryPointOutput.Depth): 543(ptr) Variable Output + 547: TypeSampler + 548: TypePointer UniformConstant 547 + 549(g_sSamp): 548(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +537(flattenTemp): 525(ptr) Variable Function + 538:8(PS_OUTPUT) FunctionCall 10(@main() + Store 537(flattenTemp) 538 + 541: 529(ptr) AccessChain 537(flattenTemp) 20 + 542: 7(fvec4) Load 541 + Store 540(@entryPointOutput.Color) 542 + 545: 532(ptr) AccessChain 537(flattenTemp) 531 + 546: 6(float) Load 545 + Store 544(@entryPointOutput.Depth) 546 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label +14(sizeQueryTemp): 13(ptr) Variable Function + 22(WidthU): 13(ptr) Variable Function +24(sizeQueryTemp): 13(ptr) Variable Function +29(NumberOfLevelsU): 13(ptr) Variable Function +32(sizeQueryTemp): 13(ptr) Variable Function +39(sizeQueryTemp): 13(ptr) Variable Function +45(sizeQueryTemp): 13(ptr) Variable Function +52(sizeQueryTemp): 13(ptr) Variable Function +60(sizeQueryTemp): 59(ptr) Variable Function + 69(ElementsU): 13(ptr) Variable Function +73(sizeQueryTemp): 59(ptr) Variable Function +82(sizeQueryTemp): 59(ptr) Variable Function +92(sizeQueryTemp): 59(ptr) Variable Function +101(sizeQueryTemp): 59(ptr) Variable Function +111(sizeQueryTemp): 59(ptr) Variable Function +120(sizeQueryTemp): 59(ptr) Variable Function + 128(HeightU): 13(ptr) Variable Function +131(sizeQueryTemp): 59(ptr) Variable Function +140(sizeQueryTemp): 59(ptr) Variable Function +150(sizeQueryTemp): 59(ptr) Variable Function +159(sizeQueryTemp): 59(ptr) Variable Function +169(sizeQueryTemp): 59(ptr) Variable Function +180(sizeQueryTemp): 179(ptr) Variable Function +193(sizeQueryTemp): 179(ptr) Variable Function +204(sizeQueryTemp): 179(ptr) Variable Function +216(sizeQueryTemp): 179(ptr) Variable Function +227(sizeQueryTemp): 179(ptr) Variable Function +239(sizeQueryTemp): 179(ptr) Variable Function +250(sizeQueryTemp): 179(ptr) Variable Function + 260(DepthU): 13(ptr) Variable Function +263(sizeQueryTemp): 179(ptr) Variable Function +274(sizeQueryTemp): 179(ptr) Variable Function +286(sizeQueryTemp): 179(ptr) Variable Function +297(sizeQueryTemp): 179(ptr) Variable Function +309(sizeQueryTemp): 179(ptr) Variable Function +320(sizeQueryTemp): 59(ptr) Variable Function +330(sizeQueryTemp): 59(ptr) Variable Function +339(sizeQueryTemp): 59(ptr) Variable Function +349(sizeQueryTemp): 59(ptr) Variable Function +358(sizeQueryTemp): 59(ptr) Variable Function +368(sizeQueryTemp): 59(ptr) Variable Function +377(sizeQueryTemp): 179(ptr) Variable Function +389(sizeQueryTemp): 179(ptr) Variable Function +400(sizeQueryTemp): 179(ptr) Variable Function +412(sizeQueryTemp): 179(ptr) Variable Function +423(sizeQueryTemp): 179(ptr) Variable Function +435(sizeQueryTemp): 179(ptr) Variable Function +446(sizeQueryTemp): 59(ptr) Variable Function +456(NumberOfSamplesU): 13(ptr) Variable Function +459(sizeQueryTemp): 59(ptr) Variable Function +471(sizeQueryTemp): 59(ptr) Variable Function +483(sizeQueryTemp): 179(ptr) Variable Function +497(sizeQueryTemp): 179(ptr) Variable Function +511(sizeQueryTemp): 179(ptr) Variable Function + 526(psout): 525(ptr) Variable Function + 18: 15 Load 17(g_tTex1df4) + 21: 12(int) ImageQuerySizeLod 18 20 + Store 14(sizeQueryTemp) 21 + 23: 12(int) Load 14(sizeQueryTemp) + Store 22(WidthU) 23 + 25: 15 Load 17(g_tTex1df4) + 27: 12(int) ImageQuerySizeLod 25 26 + Store 24(sizeQueryTemp) 27 + 28: 12(int) Load 24(sizeQueryTemp) + Store 22(WidthU) 28 + 30: 15 Load 17(g_tTex1df4) + 31: 12(int) ImageQueryLevels 30 + Store 29(NumberOfLevelsU) 31 + 36: 33 Load 35(g_tTex1di4) + 37: 12(int) ImageQuerySizeLod 36 20 + Store 32(sizeQueryTemp) 37 + 38: 12(int) Load 32(sizeQueryTemp) + Store 22(WidthU) 38 + 40: 33 Load 35(g_tTex1di4) + 41: 12(int) ImageQuerySizeLod 40 26 + Store 39(sizeQueryTemp) 41 + 42: 12(int) Load 39(sizeQueryTemp) + Store 22(WidthU) 42 + 43: 33 Load 35(g_tTex1di4) + 44: 12(int) ImageQueryLevels 43 + Store 29(NumberOfLevelsU) 44 + 49: 46 Load 48(g_tTex1du4) + 50: 12(int) ImageQuerySizeLod 49 20 + Store 45(sizeQueryTemp) 50 + 51: 12(int) Load 45(sizeQueryTemp) + Store 22(WidthU) 51 + 53: 46 Load 48(g_tTex1du4) + 54: 12(int) ImageQuerySizeLod 53 26 + Store 52(sizeQueryTemp) 54 + 55: 12(int) Load 52(sizeQueryTemp) + Store 22(WidthU) 55 + 56: 46 Load 48(g_tTex1du4) + 57: 12(int) ImageQueryLevels 56 + Store 29(NumberOfLevelsU) 57 + 64: 61 Load 63(g_tTex1df4a) + 65: 58(ivec2) ImageQuerySizeLod 64 20 + Store 60(sizeQueryTemp) 65 + 67: 13(ptr) AccessChain 60(sizeQueryTemp) 66 + 68: 12(int) Load 67 + Store 22(WidthU) 68 + 71: 13(ptr) AccessChain 60(sizeQueryTemp) 70 + 72: 12(int) Load 71 + Store 69(ElementsU) 72 + 74: 61 Load 63(g_tTex1df4a) + 75: 58(ivec2) ImageQuerySizeLod 74 26 + Store 73(sizeQueryTemp) 75 + 76: 13(ptr) AccessChain 73(sizeQueryTemp) 66 + 77: 12(int) Load 76 + Store 22(WidthU) 77 + 78: 13(ptr) AccessChain 73(sizeQueryTemp) 70 + 79: 12(int) Load 78 + Store 69(ElementsU) 79 + 80: 61 Load 63(g_tTex1df4a) + 81: 12(int) ImageQueryLevels 80 + Store 29(NumberOfLevelsU) 81 + 86: 83 Load 85(g_tTex1di4a) + 87: 58(ivec2) ImageQuerySizeLod 86 20 + Store 82(sizeQueryTemp) 87 + 88: 13(ptr) AccessChain 82(sizeQueryTemp) 66 + 89: 12(int) Load 88 + Store 22(WidthU) 89 + 90: 13(ptr) AccessChain 82(sizeQueryTemp) 70 + 91: 12(int) Load 90 + Store 69(ElementsU) 91 + 93: 83 Load 85(g_tTex1di4a) + 94: 58(ivec2) ImageQuerySizeLod 93 26 + Store 92(sizeQueryTemp) 94 + 95: 13(ptr) AccessChain 92(sizeQueryTemp) 66 + 96: 12(int) Load 95 + Store 22(WidthU) 96 + 97: 13(ptr) AccessChain 92(sizeQueryTemp) 70 + 98: 12(int) Load 97 + Store 69(ElementsU) 98 + 99: 83 Load 85(g_tTex1di4a) + 100: 12(int) ImageQueryLevels 99 + Store 29(NumberOfLevelsU) 100 + 105: 102 Load 104(g_tTex1du4a) + 106: 58(ivec2) ImageQuerySizeLod 105 20 + Store 101(sizeQueryTemp) 106 + 107: 13(ptr) AccessChain 101(sizeQueryTemp) 66 + 108: 12(int) Load 107 + Store 22(WidthU) 108 + 109: 13(ptr) AccessChain 101(sizeQueryTemp) 70 + 110: 12(int) Load 109 + Store 69(ElementsU) 110 + 112: 102 Load 104(g_tTex1du4a) + 113: 58(ivec2) ImageQuerySizeLod 112 26 + Store 111(sizeQueryTemp) 113 + 114: 13(ptr) AccessChain 111(sizeQueryTemp) 66 + 115: 12(int) Load 114 + Store 22(WidthU) 115 + 116: 13(ptr) AccessChain 111(sizeQueryTemp) 70 + 117: 12(int) Load 116 + Store 69(ElementsU) 117 + 118: 102 Load 104(g_tTex1du4a) + 119: 12(int) ImageQueryLevels 118 + Store 29(NumberOfLevelsU) 119 + 124: 121 Load 123(g_tTex2df4) + 125: 58(ivec2) ImageQuerySizeLod 124 20 + Store 120(sizeQueryTemp) 125 + 126: 13(ptr) AccessChain 120(sizeQueryTemp) 66 + 127: 12(int) Load 126 + Store 22(WidthU) 127 + 129: 13(ptr) AccessChain 120(sizeQueryTemp) 70 + 130: 12(int) Load 129 + Store 128(HeightU) 130 + 132: 121 Load 123(g_tTex2df4) + 133: 58(ivec2) ImageQuerySizeLod 132 26 + Store 131(sizeQueryTemp) 133 + 134: 13(ptr) AccessChain 131(sizeQueryTemp) 66 + 135: 12(int) Load 134 + Store 22(WidthU) 135 + 136: 13(ptr) AccessChain 131(sizeQueryTemp) 70 + 137: 12(int) Load 136 + Store 128(HeightU) 137 + 138: 121 Load 123(g_tTex2df4) + 139: 12(int) ImageQueryLevels 138 + Store 29(NumberOfLevelsU) 139 + 144: 141 Load 143(g_tTex2di4) + 145: 58(ivec2) ImageQuerySizeLod 144 20 + Store 140(sizeQueryTemp) 145 + 146: 13(ptr) AccessChain 140(sizeQueryTemp) 66 + 147: 12(int) Load 146 + Store 22(WidthU) 147 + 148: 13(ptr) AccessChain 140(sizeQueryTemp) 70 + 149: 12(int) Load 148 + Store 128(HeightU) 149 + 151: 141 Load 143(g_tTex2di4) + 152: 58(ivec2) ImageQuerySizeLod 151 26 + Store 150(sizeQueryTemp) 152 + 153: 13(ptr) AccessChain 150(sizeQueryTemp) 66 + 154: 12(int) Load 153 + Store 22(WidthU) 154 + 155: 13(ptr) AccessChain 150(sizeQueryTemp) 70 + 156: 12(int) Load 155 + Store 128(HeightU) 156 + 157: 141 Load 143(g_tTex2di4) + 158: 12(int) ImageQueryLevels 157 + Store 29(NumberOfLevelsU) 158 + 163: 160 Load 162(g_tTex2du4) + 164: 58(ivec2) ImageQuerySizeLod 163 20 + Store 159(sizeQueryTemp) 164 + 165: 13(ptr) AccessChain 159(sizeQueryTemp) 66 + 166: 12(int) Load 165 + Store 22(WidthU) 166 + 167: 13(ptr) AccessChain 159(sizeQueryTemp) 70 + 168: 12(int) Load 167 + Store 128(HeightU) 168 + 170: 160 Load 162(g_tTex2du4) + 171: 58(ivec2) ImageQuerySizeLod 170 26 + Store 169(sizeQueryTemp) 171 + 172: 13(ptr) AccessChain 169(sizeQueryTemp) 66 + 173: 12(int) Load 172 + Store 22(WidthU) 173 + 174: 13(ptr) AccessChain 169(sizeQueryTemp) 70 + 175: 12(int) Load 174 + Store 128(HeightU) 175 + 176: 160 Load 162(g_tTex2du4) + 177: 12(int) ImageQueryLevels 176 + Store 29(NumberOfLevelsU) 177 + 184: 181 Load 183(g_tTex2df4a) + 185: 178(ivec3) ImageQuerySizeLod 184 20 + Store 180(sizeQueryTemp) 185 + 186: 13(ptr) AccessChain 180(sizeQueryTemp) 66 + 187: 12(int) Load 186 + Store 22(WidthU) 187 + 188: 13(ptr) AccessChain 180(sizeQueryTemp) 70 + 189: 12(int) Load 188 + Store 128(HeightU) 189 + 191: 13(ptr) AccessChain 180(sizeQueryTemp) 190 + 192: 12(int) Load 191 + Store 69(ElementsU) 192 + 194: 181 Load 183(g_tTex2df4a) + 195: 178(ivec3) ImageQuerySizeLod 194 26 + Store 193(sizeQueryTemp) 195 + 196: 13(ptr) AccessChain 193(sizeQueryTemp) 66 + 197: 12(int) Load 196 + Store 22(WidthU) 197 + 198: 13(ptr) AccessChain 193(sizeQueryTemp) 70 + 199: 12(int) Load 198 + Store 128(HeightU) 199 + 200: 13(ptr) AccessChain 193(sizeQueryTemp) 190 + 201: 12(int) Load 200 + Store 69(ElementsU) 201 + 202: 181 Load 183(g_tTex2df4a) + 203: 12(int) ImageQueryLevels 202 + Store 29(NumberOfLevelsU) 203 + 208: 205 Load 207(g_tTex2di4a) + 209: 178(ivec3) ImageQuerySizeLod 208 20 + Store 204(sizeQueryTemp) 209 + 210: 13(ptr) AccessChain 204(sizeQueryTemp) 66 + 211: 12(int) Load 210 + Store 22(WidthU) 211 + 212: 13(ptr) AccessChain 204(sizeQueryTemp) 70 + 213: 12(int) Load 212 + Store 128(HeightU) 213 + 214: 13(ptr) AccessChain 204(sizeQueryTemp) 190 + 215: 12(int) Load 214 + Store 69(ElementsU) 215 + 217: 205 Load 207(g_tTex2di4a) + 218: 178(ivec3) ImageQuerySizeLod 217 26 + Store 216(sizeQueryTemp) 218 + 219: 13(ptr) AccessChain 216(sizeQueryTemp) 66 + 220: 12(int) Load 219 + Store 22(WidthU) 220 + 221: 13(ptr) AccessChain 216(sizeQueryTemp) 70 + 222: 12(int) Load 221 + Store 128(HeightU) 222 + 223: 13(ptr) AccessChain 216(sizeQueryTemp) 190 + 224: 12(int) Load 223 + Store 69(ElementsU) 224 + 225: 205 Load 207(g_tTex2di4a) + 226: 12(int) ImageQueryLevels 225 + Store 29(NumberOfLevelsU) 226 + 231: 228 Load 230(g_tTex2du4a) + 232: 178(ivec3) ImageQuerySizeLod 231 20 + Store 227(sizeQueryTemp) 232 + 233: 13(ptr) AccessChain 227(sizeQueryTemp) 66 + 234: 12(int) Load 233 + Store 22(WidthU) 234 + 235: 13(ptr) AccessChain 227(sizeQueryTemp) 70 + 236: 12(int) Load 235 + Store 128(HeightU) 236 + 237: 13(ptr) AccessChain 227(sizeQueryTemp) 190 + 238: 12(int) Load 237 + Store 69(ElementsU) 238 + 240: 228 Load 230(g_tTex2du4a) + 241: 178(ivec3) ImageQuerySizeLod 240 26 + Store 239(sizeQueryTemp) 241 + 242: 13(ptr) AccessChain 239(sizeQueryTemp) 66 + 243: 12(int) Load 242 + Store 22(WidthU) 243 + 244: 13(ptr) AccessChain 239(sizeQueryTemp) 70 + 245: 12(int) Load 244 + Store 128(HeightU) 245 + 246: 13(ptr) AccessChain 239(sizeQueryTemp) 190 + 247: 12(int) Load 246 + Store 69(ElementsU) 247 + 248: 228 Load 230(g_tTex2du4a) + 249: 12(int) ImageQueryLevels 248 + Store 29(NumberOfLevelsU) 249 + 254: 251 Load 253(g_tTex3df4) + 255: 178(ivec3) ImageQuerySizeLod 254 20 + Store 250(sizeQueryTemp) 255 + 256: 13(ptr) AccessChain 250(sizeQueryTemp) 66 + 257: 12(int) Load 256 + Store 22(WidthU) 257 + 258: 13(ptr) AccessChain 250(sizeQueryTemp) 70 + 259: 12(int) Load 258 + Store 128(HeightU) 259 + 261: 13(ptr) AccessChain 250(sizeQueryTemp) 190 + 262: 12(int) Load 261 + Store 260(DepthU) 262 + 264: 251 Load 253(g_tTex3df4) + 265: 178(ivec3) ImageQuerySizeLod 264 26 + Store 263(sizeQueryTemp) 265 + 266: 13(ptr) AccessChain 263(sizeQueryTemp) 66 + 267: 12(int) Load 266 + Store 22(WidthU) 267 + 268: 13(ptr) AccessChain 263(sizeQueryTemp) 70 + 269: 12(int) Load 268 + Store 128(HeightU) 269 + 270: 13(ptr) AccessChain 263(sizeQueryTemp) 190 + 271: 12(int) Load 270 + Store 260(DepthU) 271 + 272: 251 Load 253(g_tTex3df4) + 273: 12(int) ImageQueryLevels 272 + Store 29(NumberOfLevelsU) 273 + 278: 275 Load 277(g_tTex3di4) + 279: 178(ivec3) ImageQuerySizeLod 278 20 + Store 274(sizeQueryTemp) 279 + 280: 13(ptr) AccessChain 274(sizeQueryTemp) 66 + 281: 12(int) Load 280 + Store 22(WidthU) 281 + 282: 13(ptr) AccessChain 274(sizeQueryTemp) 70 + 283: 12(int) Load 282 + Store 128(HeightU) 283 + 284: 13(ptr) AccessChain 274(sizeQueryTemp) 190 + 285: 12(int) Load 284 + Store 260(DepthU) 285 + 287: 275 Load 277(g_tTex3di4) + 288: 178(ivec3) ImageQuerySizeLod 287 26 + Store 286(sizeQueryTemp) 288 + 289: 13(ptr) AccessChain 286(sizeQueryTemp) 66 + 290: 12(int) Load 289 + Store 22(WidthU) 290 + 291: 13(ptr) AccessChain 286(sizeQueryTemp) 70 + 292: 12(int) Load 291 + Store 128(HeightU) 292 + 293: 13(ptr) AccessChain 286(sizeQueryTemp) 190 + 294: 12(int) Load 293 + Store 260(DepthU) 294 + 295: 275 Load 277(g_tTex3di4) + 296: 12(int) ImageQueryLevels 295 + Store 29(NumberOfLevelsU) 296 + 301: 298 Load 300(g_tTex3du4) + 302: 178(ivec3) ImageQuerySizeLod 301 20 + Store 297(sizeQueryTemp) 302 + 303: 13(ptr) AccessChain 297(sizeQueryTemp) 66 + 304: 12(int) Load 303 + Store 22(WidthU) 304 + 305: 13(ptr) AccessChain 297(sizeQueryTemp) 70 + 306: 12(int) Load 305 + Store 128(HeightU) 306 + 307: 13(ptr) AccessChain 297(sizeQueryTemp) 190 + 308: 12(int) Load 307 + Store 260(DepthU) 308 + 310: 298 Load 300(g_tTex3du4) + 311: 178(ivec3) ImageQuerySizeLod 310 26 + Store 309(sizeQueryTemp) 311 + 312: 13(ptr) AccessChain 309(sizeQueryTemp) 66 + 313: 12(int) Load 312 + Store 22(WidthU) 313 + 314: 13(ptr) AccessChain 309(sizeQueryTemp) 70 + 315: 12(int) Load 314 + Store 128(HeightU) 315 + 316: 13(ptr) AccessChain 309(sizeQueryTemp) 190 + 317: 12(int) Load 316 + Store 260(DepthU) 317 + 318: 298 Load 300(g_tTex3du4) + 319: 12(int) ImageQueryLevels 318 + Store 29(NumberOfLevelsU) 319 + 324: 321 Load 323(g_tTexcdf4) + 325: 58(ivec2) ImageQuerySizeLod 324 20 + Store 320(sizeQueryTemp) 325 + 326: 13(ptr) AccessChain 320(sizeQueryTemp) 66 + 327: 12(int) Load 326 + Store 22(WidthU) 327 + 328: 13(ptr) AccessChain 320(sizeQueryTemp) 70 + 329: 12(int) Load 328 + Store 128(HeightU) 329 + 331: 321 Load 323(g_tTexcdf4) + 332: 58(ivec2) ImageQuerySizeLod 331 26 + Store 330(sizeQueryTemp) 332 + 333: 13(ptr) AccessChain 330(sizeQueryTemp) 66 + 334: 12(int) Load 333 + Store 22(WidthU) 334 + 335: 13(ptr) AccessChain 330(sizeQueryTemp) 70 + 336: 12(int) Load 335 + Store 128(HeightU) 336 + 337: 321 Load 323(g_tTexcdf4) + 338: 12(int) ImageQueryLevels 337 + Store 29(NumberOfLevelsU) 338 + 343: 340 Load 342(g_tTexcdi4) + 344: 58(ivec2) ImageQuerySizeLod 343 20 + Store 339(sizeQueryTemp) 344 + 345: 13(ptr) AccessChain 339(sizeQueryTemp) 66 + 346: 12(int) Load 345 + Store 22(WidthU) 346 + 347: 13(ptr) AccessChain 339(sizeQueryTemp) 70 + 348: 12(int) Load 347 + Store 128(HeightU) 348 + 350: 340 Load 342(g_tTexcdi4) + 351: 58(ivec2) ImageQuerySizeLod 350 26 + Store 349(sizeQueryTemp) 351 + 352: 13(ptr) AccessChain 349(sizeQueryTemp) 66 + 353: 12(int) Load 352 + Store 22(WidthU) 353 + 354: 13(ptr) AccessChain 349(sizeQueryTemp) 70 + 355: 12(int) Load 354 + Store 128(HeightU) 355 + 356: 340 Load 342(g_tTexcdi4) + 357: 12(int) ImageQueryLevels 356 + Store 29(NumberOfLevelsU) 357 + 362: 359 Load 361(g_tTexcdu4) + 363: 58(ivec2) ImageQuerySizeLod 362 20 + Store 358(sizeQueryTemp) 363 + 364: 13(ptr) AccessChain 358(sizeQueryTemp) 66 + 365: 12(int) Load 364 + Store 22(WidthU) 365 + 366: 13(ptr) AccessChain 358(sizeQueryTemp) 70 + 367: 12(int) Load 366 + Store 128(HeightU) 367 + 369: 359 Load 361(g_tTexcdu4) + 370: 58(ivec2) ImageQuerySizeLod 369 26 + Store 368(sizeQueryTemp) 370 + 371: 13(ptr) AccessChain 368(sizeQueryTemp) 66 + 372: 12(int) Load 371 + Store 22(WidthU) 372 + 373: 13(ptr) AccessChain 368(sizeQueryTemp) 70 + 374: 12(int) Load 373 + Store 128(HeightU) 374 + 375: 359 Load 361(g_tTexcdu4) + 376: 12(int) ImageQueryLevels 375 + Store 29(NumberOfLevelsU) 376 + 381: 378 Load 380(g_tTexcdf4a) + 382: 178(ivec3) ImageQuerySizeLod 381 20 + Store 377(sizeQueryTemp) 382 + 383: 13(ptr) AccessChain 377(sizeQueryTemp) 66 + 384: 12(int) Load 383 + Store 22(WidthU) 384 + 385: 13(ptr) AccessChain 377(sizeQueryTemp) 70 + 386: 12(int) Load 385 + Store 128(HeightU) 386 + 387: 13(ptr) AccessChain 377(sizeQueryTemp) 190 + 388: 12(int) Load 387 + Store 69(ElementsU) 388 + 390: 378 Load 380(g_tTexcdf4a) + 391: 178(ivec3) ImageQuerySizeLod 390 26 + Store 389(sizeQueryTemp) 391 + 392: 13(ptr) AccessChain 389(sizeQueryTemp) 66 + 393: 12(int) Load 392 + Store 22(WidthU) 393 + 394: 13(ptr) AccessChain 389(sizeQueryTemp) 70 + 395: 12(int) Load 394 + Store 128(HeightU) 395 + 396: 13(ptr) AccessChain 389(sizeQueryTemp) 190 + 397: 12(int) Load 396 + Store 69(ElementsU) 397 + 398: 378 Load 380(g_tTexcdf4a) + 399: 12(int) ImageQueryLevels 398 + Store 29(NumberOfLevelsU) 399 + 404: 401 Load 403(g_tTexcdi4a) + 405: 178(ivec3) ImageQuerySizeLod 404 20 + Store 400(sizeQueryTemp) 405 + 406: 13(ptr) AccessChain 400(sizeQueryTemp) 66 + 407: 12(int) Load 406 + Store 22(WidthU) 407 + 408: 13(ptr) AccessChain 400(sizeQueryTemp) 70 + 409: 12(int) Load 408 + Store 128(HeightU) 409 + 410: 13(ptr) AccessChain 400(sizeQueryTemp) 190 + 411: 12(int) Load 410 + Store 69(ElementsU) 411 + 413: 401 Load 403(g_tTexcdi4a) + 414: 178(ivec3) ImageQuerySizeLod 413 26 + Store 412(sizeQueryTemp) 414 + 415: 13(ptr) AccessChain 412(sizeQueryTemp) 66 + 416: 12(int) Load 415 + Store 22(WidthU) 416 + 417: 13(ptr) AccessChain 412(sizeQueryTemp) 70 + 418: 12(int) Load 417 + Store 128(HeightU) 418 + 419: 13(ptr) AccessChain 412(sizeQueryTemp) 190 + 420: 12(int) Load 419 + Store 69(ElementsU) 420 + 421: 401 Load 403(g_tTexcdi4a) + 422: 12(int) ImageQueryLevels 421 + Store 29(NumberOfLevelsU) 422 + 427: 424 Load 426(g_tTexcdu4a) + 428: 178(ivec3) ImageQuerySizeLod 427 20 + Store 423(sizeQueryTemp) 428 + 429: 13(ptr) AccessChain 423(sizeQueryTemp) 66 + 430: 12(int) Load 429 + Store 22(WidthU) 430 + 431: 13(ptr) AccessChain 423(sizeQueryTemp) 70 + 432: 12(int) Load 431 + Store 128(HeightU) 432 + 433: 13(ptr) AccessChain 423(sizeQueryTemp) 190 + 434: 12(int) Load 433 + Store 69(ElementsU) 434 + 436: 424 Load 426(g_tTexcdu4a) + 437: 178(ivec3) ImageQuerySizeLod 436 26 + Store 435(sizeQueryTemp) 437 + 438: 13(ptr) AccessChain 435(sizeQueryTemp) 66 + 439: 12(int) Load 438 + Store 22(WidthU) 439 + 440: 13(ptr) AccessChain 435(sizeQueryTemp) 70 + 441: 12(int) Load 440 + Store 128(HeightU) 441 + 442: 13(ptr) AccessChain 435(sizeQueryTemp) 190 + 443: 12(int) Load 442 + Store 69(ElementsU) 443 + 444: 424 Load 426(g_tTexcdu4a) + 445: 12(int) ImageQueryLevels 444 + Store 29(NumberOfLevelsU) 445 + 450: 447 Load 449(g_tTex2dmsf4) + 451: 58(ivec2) ImageQuerySize 450 + Store 446(sizeQueryTemp) 451 + 452: 13(ptr) AccessChain 446(sizeQueryTemp) 66 + 453: 12(int) Load 452 + Store 22(WidthU) 453 + 454: 13(ptr) AccessChain 446(sizeQueryTemp) 70 + 455: 12(int) Load 454 + Store 128(HeightU) 455 + 457: 447 Load 449(g_tTex2dmsf4) + 458: 12(int) ImageQuerySamples 457 + Store 456(NumberOfSamplesU) 458 + 463: 460 Load 462(g_tTex2dmsi4) + 464: 58(ivec2) ImageQuerySize 463 + Store 459(sizeQueryTemp) 464 + 465: 13(ptr) AccessChain 459(sizeQueryTemp) 66 + 466: 12(int) Load 465 + Store 22(WidthU) 466 + 467: 13(ptr) AccessChain 459(sizeQueryTemp) 70 + 468: 12(int) Load 467 + Store 128(HeightU) 468 + 469: 460 Load 462(g_tTex2dmsi4) + 470: 12(int) ImageQuerySamples 469 + Store 456(NumberOfSamplesU) 470 + 475: 472 Load 474(g_tTex2dmsu4) + 476: 58(ivec2) ImageQuerySize 475 + Store 471(sizeQueryTemp) 476 + 477: 13(ptr) AccessChain 471(sizeQueryTemp) 66 + 478: 12(int) Load 477 + Store 22(WidthU) 478 + 479: 13(ptr) AccessChain 471(sizeQueryTemp) 70 + 480: 12(int) Load 479 + Store 128(HeightU) 480 + 481: 472 Load 474(g_tTex2dmsu4) + 482: 12(int) ImageQuerySamples 481 + Store 456(NumberOfSamplesU) 482 + 487: 484 Load 486(g_tTex2dmsf4a) + 488: 178(ivec3) ImageQuerySize 487 + Store 483(sizeQueryTemp) 488 + 489: 13(ptr) AccessChain 483(sizeQueryTemp) 66 + 490: 12(int) Load 489 + Store 22(WidthU) 490 + 491: 13(ptr) AccessChain 483(sizeQueryTemp) 70 + 492: 12(int) Load 491 + Store 128(HeightU) 492 + 493: 13(ptr) AccessChain 483(sizeQueryTemp) 190 + 494: 12(int) Load 493 + Store 69(ElementsU) 494 + 495: 484 Load 486(g_tTex2dmsf4a) + 496: 12(int) ImageQuerySamples 495 + Store 456(NumberOfSamplesU) 496 + 501: 498 Load 500(g_tTex2dmsi4a) + 502: 178(ivec3) ImageQuerySize 501 + Store 497(sizeQueryTemp) 502 + 503: 13(ptr) AccessChain 497(sizeQueryTemp) 66 + 504: 12(int) Load 503 + Store 22(WidthU) 504 + 505: 13(ptr) AccessChain 497(sizeQueryTemp) 70 + 506: 12(int) Load 505 + Store 128(HeightU) 506 + 507: 13(ptr) AccessChain 497(sizeQueryTemp) 190 + 508: 12(int) Load 507 + Store 69(ElementsU) 508 + 509: 498 Load 500(g_tTex2dmsi4a) + 510: 12(int) ImageQuerySamples 509 + Store 456(NumberOfSamplesU) 510 + 515: 512 Load 514(g_tTex2dmsu4a) + 516: 178(ivec3) ImageQuerySize 515 + Store 511(sizeQueryTemp) 516 + 517: 13(ptr) AccessChain 511(sizeQueryTemp) 66 + 518: 12(int) Load 517 + Store 22(WidthU) 518 + 519: 13(ptr) AccessChain 511(sizeQueryTemp) 70 + 520: 12(int) Load 519 + Store 128(HeightU) 520 + 521: 13(ptr) AccessChain 511(sizeQueryTemp) 190 + 522: 12(int) Load 521 + Store 69(ElementsU) 522 + 523: 512 Load 514(g_tTex2dmsu4a) + 524: 12(int) ImageQuerySamples 523 + Store 456(NumberOfSamplesU) 524 + 530: 529(ptr) AccessChain 526(psout) 20 + Store 530 528 + 533: 532(ptr) AccessChain 526(psout) 531 + Store 533 527 + 534:8(PS_OUTPUT) Load 526(psout) + ReturnValue 534 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.getdimensions.dx10.vert.out b/deps/glslang/Test/baseResults/hlsl.getdimensions.dx10.vert.out new file mode 100644 index 00000000..cccdfeb2 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.getdimensions.dx10.vert.out @@ -0,0 +1,200 @@ +hlsl.getdimensions.dx10.vert +Shader version: 500 +0:? Sequence +0:11 Function Definition: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:11 Function Parameters: +0:? Sequence +0:21 Sequence +0:21 move second child to first child ( temp uint) +0:21 'sizeQueryTemp' ( temp uint) +0:21 textureSize ( temp uint) +0:21 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:21 Constant: +0:21 0 (const int) +0:21 move second child to first child ( temp uint) +0:21 'WidthU' ( temp uint) +0:21 'sizeQueryTemp' ( temp uint) +0:22 Sequence +0:22 move second child to first child ( temp uint) +0:22 'sizeQueryTemp' ( temp uint) +0:22 textureSize ( temp uint) +0:22 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:22 Constant: +0:22 6 (const uint) +0:22 move second child to first child ( temp uint) +0:22 'WidthU' ( temp uint) +0:22 'sizeQueryTemp' ( temp uint) +0:22 move second child to first child ( temp uint) +0:22 'NumberOfLevelsU' ( temp uint) +0:22 textureQueryLevels ( temp uint) +0:22 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 Pos: direct index for structure ( temp 4-component vector of float) +0:24 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:24 Constant: +0:24 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:26 Branch: Return with expression +0:26 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:11 Function Definition: main( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:11 Pos: direct index for structure ( temp 4-component vector of float) +0:11 Function Call: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:11 Constant: +0:11 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:11 Function Definition: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:11 Function Parameters: +0:? Sequence +0:21 Sequence +0:21 move second child to first child ( temp uint) +0:21 'sizeQueryTemp' ( temp uint) +0:21 textureSize ( temp uint) +0:21 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:21 Constant: +0:21 0 (const int) +0:21 move second child to first child ( temp uint) +0:21 'WidthU' ( temp uint) +0:21 'sizeQueryTemp' ( temp uint) +0:22 Sequence +0:22 move second child to first child ( temp uint) +0:22 'sizeQueryTemp' ( temp uint) +0:22 textureSize ( temp uint) +0:22 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:22 Constant: +0:22 6 (const uint) +0:22 move second child to first child ( temp uint) +0:22 'WidthU' ( temp uint) +0:22 'sizeQueryTemp' ( temp uint) +0:22 move second child to first child ( temp uint) +0:22 'NumberOfLevelsU' ( temp uint) +0:22 textureQueryLevels ( temp uint) +0:22 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 Pos: direct index for structure ( temp 4-component vector of float) +0:24 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:24 Constant: +0:24 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:26 Branch: Return with expression +0:26 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:11 Function Definition: main( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:11 Pos: direct index for structure ( temp 4-component vector of float) +0:11 Function Call: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:11 Constant: +0:11 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 48 + + Capability Shader + Capability Sampled1D + Capability ImageQuery + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 42 + Source HLSL 500 + Name 4 "main" + Name 8 "VS_OUTPUT" + MemberName 8(VS_OUTPUT) 0 "Pos" + Name 10 "@main(" + Name 14 "sizeQueryTemp" + Name 17 "g_tTex1df4" + Name 22 "WidthU" + Name 24 "sizeQueryTemp" + Name 29 "NumberOfLevelsU" + Name 33 "vsout" + Name 42 "@entryPointOutput.Pos" + Name 47 "g_sSamp" + Decorate 17(g_tTex1df4) DescriptorSet 0 + Decorate 17(g_tTex1df4) Binding 0 + Decorate 42(@entryPointOutput.Pos) BuiltIn Position + Decorate 47(g_sSamp) DescriptorSet 0 + Decorate 47(g_sSamp) Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(VS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(VS_OUTPUT) + 12: TypeInt 32 0 + 13: TypePointer Function 12(int) + 15: TypeImage 6(float) 1D sampled format:Unknown + 16: TypePointer UniformConstant 15 + 17(g_tTex1df4): 16(ptr) Variable UniformConstant + 19: TypeInt 32 1 + 20: 19(int) Constant 0 + 26: 12(int) Constant 6 + 32: TypePointer Function 8(VS_OUTPUT) + 34: 6(float) Constant 0 + 35: 7(fvec4) ConstantComposite 34 34 34 34 + 36: TypePointer Function 7(fvec4) + 41: TypePointer Output 7(fvec4) +42(@entryPointOutput.Pos): 41(ptr) Variable Output + 45: TypeSampler + 46: TypePointer UniformConstant 45 + 47(g_sSamp): 46(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 43:8(VS_OUTPUT) FunctionCall 10(@main() + 44: 7(fvec4) CompositeExtract 43 0 + Store 42(@entryPointOutput.Pos) 44 + Return + FunctionEnd + 10(@main():8(VS_OUTPUT) Function None 9 + 11: Label +14(sizeQueryTemp): 13(ptr) Variable Function + 22(WidthU): 13(ptr) Variable Function +24(sizeQueryTemp): 13(ptr) Variable Function +29(NumberOfLevelsU): 13(ptr) Variable Function + 33(vsout): 32(ptr) Variable Function + 18: 15 Load 17(g_tTex1df4) + 21: 12(int) ImageQuerySizeLod 18 20 + Store 14(sizeQueryTemp) 21 + 23: 12(int) Load 14(sizeQueryTemp) + Store 22(WidthU) 23 + 25: 15 Load 17(g_tTex1df4) + 27: 12(int) ImageQuerySizeLod 25 26 + Store 24(sizeQueryTemp) 27 + 28: 12(int) Load 24(sizeQueryTemp) + Store 22(WidthU) 28 + 30: 15 Load 17(g_tTex1df4) + 31: 12(int) ImageQueryLevels 30 + Store 29(NumberOfLevelsU) 31 + 37: 36(ptr) AccessChain 33(vsout) 20 + Store 37 35 + 38:8(VS_OUTPUT) Load 33(vsout) + ReturnValue 38 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out new file mode 100644 index 00000000..0b9a6740 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out @@ -0,0 +1,1117 @@ +hlsl.getdimensions.rw.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:44 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:44 Function Parameters: +0:? Sequence +0:63 Sequence +0:63 move second child to first child ( temp uint) +0:63 'sizeQueryTemp' ( temp uint) +0:63 imageQuerySize ( temp uint) +0:63 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:63 move second child to first child ( temp uint) +0:63 'WidthU' ( temp uint) +0:63 'sizeQueryTemp' ( temp uint) +0:64 Sequence +0:64 move second child to first child ( temp uint) +0:64 'sizeQueryTemp' ( temp uint) +0:64 imageQuerySize ( temp uint) +0:64 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:64 move second child to first child ( temp uint) +0:64 'WidthU' ( temp uint) +0:64 'sizeQueryTemp' ( temp uint) +0:65 Sequence +0:65 move second child to first child ( temp uint) +0:65 'sizeQueryTemp' ( temp uint) +0:65 imageQuerySize ( temp uint) +0:65 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:65 move second child to first child ( temp uint) +0:65 'WidthU' ( temp uint) +0:65 'sizeQueryTemp' ( temp uint) +0:68 Sequence +0:68 move second child to first child ( temp uint) +0:68 'sizeQueryTemp' ( temp uint) +0:68 imageQuerySize ( temp uint) +0:68 'g_tBuffF' (layout( rgba32f) uniform imageBuffer) +0:68 move second child to first child ( temp uint) +0:68 'WidthU' ( temp uint) +0:68 'sizeQueryTemp' ( temp uint) +0:69 Sequence +0:69 move second child to first child ( temp uint) +0:69 'sizeQueryTemp' ( temp uint) +0:69 imageQuerySize ( temp uint) +0:69 'g_tBuffI' (layout( rgba32i) uniform iimageBuffer) +0:69 move second child to first child ( temp uint) +0:69 'WidthU' ( temp uint) +0:69 'sizeQueryTemp' ( temp uint) +0:70 Sequence +0:70 move second child to first child ( temp uint) +0:70 'sizeQueryTemp' ( temp uint) +0:70 imageQuerySize ( temp uint) +0:70 'g_tBuffU' (layout( rgba32ui) uniform uimageBuffer) +0:70 move second child to first child ( temp uint) +0:70 'WidthU' ( temp uint) +0:70 'sizeQueryTemp' ( temp uint) +0:73 Sequence +0:73 move second child to first child ( temp 2-component vector of uint) +0:73 'sizeQueryTemp' ( temp 2-component vector of uint) +0:73 imageQuerySize ( temp 2-component vector of uint) +0:73 'g_tTex1df4a' (layout( rgba32f) uniform image1DArray) +0:73 move second child to first child ( temp uint) +0:73 'WidthU' ( temp uint) +0:73 direct index ( temp uint) +0:73 'sizeQueryTemp' ( temp 2-component vector of uint) +0:73 Constant: +0:73 0 (const int) +0:73 move second child to first child ( temp uint) +0:73 'ElementsU' ( temp uint) +0:73 direct index ( temp uint) +0:73 'sizeQueryTemp' ( temp 2-component vector of uint) +0:73 Constant: +0:73 1 (const int) +0:74 Sequence +0:74 move second child to first child ( temp 2-component vector of uint) +0:74 'sizeQueryTemp' ( temp 2-component vector of uint) +0:74 imageQuerySize ( temp 2-component vector of uint) +0:74 'g_tTex1di4a' (layout( rgba32i) uniform iimage1DArray) +0:74 move second child to first child ( temp uint) +0:74 'WidthU' ( temp uint) +0:74 direct index ( temp uint) +0:74 'sizeQueryTemp' ( temp 2-component vector of uint) +0:74 Constant: +0:74 0 (const int) +0:74 move second child to first child ( temp uint) +0:74 'ElementsU' ( temp uint) +0:74 direct index ( temp uint) +0:74 'sizeQueryTemp' ( temp 2-component vector of uint) +0:74 Constant: +0:74 1 (const int) +0:75 Sequence +0:75 move second child to first child ( temp 2-component vector of uint) +0:75 'sizeQueryTemp' ( temp 2-component vector of uint) +0:75 imageQuerySize ( temp 2-component vector of uint) +0:75 'g_tTex1du4a' (layout( rgba32ui) uniform uimage1DArray) +0:75 move second child to first child ( temp uint) +0:75 'WidthU' ( temp uint) +0:75 direct index ( temp uint) +0:75 'sizeQueryTemp' ( temp 2-component vector of uint) +0:75 Constant: +0:75 0 (const int) +0:75 move second child to first child ( temp uint) +0:75 'ElementsU' ( temp uint) +0:75 direct index ( temp uint) +0:75 'sizeQueryTemp' ( temp 2-component vector of uint) +0:75 Constant: +0:75 1 (const int) +0:78 Sequence +0:78 move second child to first child ( temp 2-component vector of uint) +0:78 'sizeQueryTemp' ( temp 2-component vector of uint) +0:78 imageQuerySize ( temp 2-component vector of uint) +0:78 'g_tTex2df4' (layout( rgba32f) uniform image2D) +0:78 move second child to first child ( temp uint) +0:78 'WidthU' ( temp uint) +0:78 direct index ( temp uint) +0:78 'sizeQueryTemp' ( temp 2-component vector of uint) +0:78 Constant: +0:78 0 (const int) +0:78 move second child to first child ( temp uint) +0:78 'HeightU' ( temp uint) +0:78 direct index ( temp uint) +0:78 'sizeQueryTemp' ( temp 2-component vector of uint) +0:78 Constant: +0:78 1 (const int) +0:79 Sequence +0:79 move second child to first child ( temp 2-component vector of uint) +0:79 'sizeQueryTemp' ( temp 2-component vector of uint) +0:79 imageQuerySize ( temp 2-component vector of uint) +0:79 'g_tTex2di4' (layout( rgba32i) uniform iimage2D) +0:79 move second child to first child ( temp uint) +0:79 'WidthU' ( temp uint) +0:79 direct index ( temp uint) +0:79 'sizeQueryTemp' ( temp 2-component vector of uint) +0:79 Constant: +0:79 0 (const int) +0:79 move second child to first child ( temp uint) +0:79 'HeightU' ( temp uint) +0:79 direct index ( temp uint) +0:79 'sizeQueryTemp' ( temp 2-component vector of uint) +0:79 Constant: +0:79 1 (const int) +0:80 Sequence +0:80 move second child to first child ( temp 2-component vector of uint) +0:80 'sizeQueryTemp' ( temp 2-component vector of uint) +0:80 imageQuerySize ( temp 2-component vector of uint) +0:80 'g_tTex2du4' (layout( rgba32ui) uniform uimage2D) +0:80 move second child to first child ( temp uint) +0:80 'WidthU' ( temp uint) +0:80 direct index ( temp uint) +0:80 'sizeQueryTemp' ( temp 2-component vector of uint) +0:80 Constant: +0:80 0 (const int) +0:80 move second child to first child ( temp uint) +0:80 'HeightU' ( temp uint) +0:80 direct index ( temp uint) +0:80 'sizeQueryTemp' ( temp 2-component vector of uint) +0:80 Constant: +0:80 1 (const int) +0:83 Sequence +0:83 move second child to first child ( temp 3-component vector of uint) +0:83 'sizeQueryTemp' ( temp 3-component vector of uint) +0:83 imageQuerySize ( temp 3-component vector of uint) +0:83 'g_tTex2df4a' (layout( rgba32f) uniform image2DArray) +0:83 move second child to first child ( temp uint) +0:83 'WidthU' ( temp uint) +0:83 direct index ( temp uint) +0:83 'sizeQueryTemp' ( temp 3-component vector of uint) +0:83 Constant: +0:83 0 (const int) +0:83 move second child to first child ( temp uint) +0:83 'HeightU' ( temp uint) +0:83 direct index ( temp uint) +0:83 'sizeQueryTemp' ( temp 3-component vector of uint) +0:83 Constant: +0:83 1 (const int) +0:83 move second child to first child ( temp uint) +0:83 'ElementsU' ( temp uint) +0:83 direct index ( temp uint) +0:83 'sizeQueryTemp' ( temp 3-component vector of uint) +0:83 Constant: +0:83 2 (const int) +0:84 Sequence +0:84 move second child to first child ( temp 3-component vector of uint) +0:84 'sizeQueryTemp' ( temp 3-component vector of uint) +0:84 imageQuerySize ( temp 3-component vector of uint) +0:84 'g_tTex2di4a' (layout( rgba32i) uniform iimage2DArray) +0:84 move second child to first child ( temp uint) +0:84 'WidthU' ( temp uint) +0:84 direct index ( temp uint) +0:84 'sizeQueryTemp' ( temp 3-component vector of uint) +0:84 Constant: +0:84 0 (const int) +0:84 move second child to first child ( temp uint) +0:84 'HeightU' ( temp uint) +0:84 direct index ( temp uint) +0:84 'sizeQueryTemp' ( temp 3-component vector of uint) +0:84 Constant: +0:84 1 (const int) +0:84 move second child to first child ( temp uint) +0:84 'ElementsU' ( temp uint) +0:84 direct index ( temp uint) +0:84 'sizeQueryTemp' ( temp 3-component vector of uint) +0:84 Constant: +0:84 2 (const int) +0:85 Sequence +0:85 move second child to first child ( temp 3-component vector of uint) +0:85 'sizeQueryTemp' ( temp 3-component vector of uint) +0:85 imageQuerySize ( temp 3-component vector of uint) +0:85 'g_tTex2du4a' (layout( rgba32ui) uniform uimage2DArray) +0:85 move second child to first child ( temp uint) +0:85 'WidthU' ( temp uint) +0:85 direct index ( temp uint) +0:85 'sizeQueryTemp' ( temp 3-component vector of uint) +0:85 Constant: +0:85 0 (const int) +0:85 move second child to first child ( temp uint) +0:85 'HeightU' ( temp uint) +0:85 direct index ( temp uint) +0:85 'sizeQueryTemp' ( temp 3-component vector of uint) +0:85 Constant: +0:85 1 (const int) +0:85 move second child to first child ( temp uint) +0:85 'ElementsU' ( temp uint) +0:85 direct index ( temp uint) +0:85 'sizeQueryTemp' ( temp 3-component vector of uint) +0:85 Constant: +0:85 2 (const int) +0:88 Sequence +0:88 move second child to first child ( temp 3-component vector of uint) +0:88 'sizeQueryTemp' ( temp 3-component vector of uint) +0:88 imageQuerySize ( temp 3-component vector of uint) +0:88 'g_tTex3df4' (layout( rgba32f) uniform image3D) +0:88 move second child to first child ( temp uint) +0:88 'WidthU' ( temp uint) +0:88 direct index ( temp uint) +0:88 'sizeQueryTemp' ( temp 3-component vector of uint) +0:88 Constant: +0:88 0 (const int) +0:88 move second child to first child ( temp uint) +0:88 'HeightU' ( temp uint) +0:88 direct index ( temp uint) +0:88 'sizeQueryTemp' ( temp 3-component vector of uint) +0:88 Constant: +0:88 1 (const int) +0:88 move second child to first child ( temp uint) +0:88 'DepthU' ( temp uint) +0:88 direct index ( temp uint) +0:88 'sizeQueryTemp' ( temp 3-component vector of uint) +0:88 Constant: +0:88 2 (const int) +0:89 Sequence +0:89 move second child to first child ( temp 3-component vector of uint) +0:89 'sizeQueryTemp' ( temp 3-component vector of uint) +0:89 imageQuerySize ( temp 3-component vector of uint) +0:89 'g_tTex3di4' (layout( rgba32i) uniform iimage3D) +0:89 move second child to first child ( temp uint) +0:89 'WidthU' ( temp uint) +0:89 direct index ( temp uint) +0:89 'sizeQueryTemp' ( temp 3-component vector of uint) +0:89 Constant: +0:89 0 (const int) +0:89 move second child to first child ( temp uint) +0:89 'HeightU' ( temp uint) +0:89 direct index ( temp uint) +0:89 'sizeQueryTemp' ( temp 3-component vector of uint) +0:89 Constant: +0:89 1 (const int) +0:89 move second child to first child ( temp uint) +0:89 'DepthU' ( temp uint) +0:89 direct index ( temp uint) +0:89 'sizeQueryTemp' ( temp 3-component vector of uint) +0:89 Constant: +0:89 2 (const int) +0:90 Sequence +0:90 move second child to first child ( temp 3-component vector of uint) +0:90 'sizeQueryTemp' ( temp 3-component vector of uint) +0:90 imageQuerySize ( temp 3-component vector of uint) +0:90 'g_tTex3du4' (layout( rgba32ui) uniform uimage3D) +0:90 move second child to first child ( temp uint) +0:90 'WidthU' ( temp uint) +0:90 direct index ( temp uint) +0:90 'sizeQueryTemp' ( temp 3-component vector of uint) +0:90 Constant: +0:90 0 (const int) +0:90 move second child to first child ( temp uint) +0:90 'HeightU' ( temp uint) +0:90 direct index ( temp uint) +0:90 'sizeQueryTemp' ( temp 3-component vector of uint) +0:90 Constant: +0:90 1 (const int) +0:90 move second child to first child ( temp uint) +0:90 'DepthU' ( temp uint) +0:90 direct index ( temp uint) +0:90 'sizeQueryTemp' ( temp 3-component vector of uint) +0:90 Constant: +0:90 2 (const int) +0:92 move second child to first child ( temp 4-component vector of float) +0:92 Color: direct index for structure ( temp 4-component vector of float) +0:92 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 1.000000 +0:92 1.000000 +0:92 1.000000 +0:92 1.000000 +0:93 move second child to first child ( temp float) +0:93 Depth: direct index for structure ( temp float) +0:93 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:93 Constant: +0:93 1 (const int) +0:93 Constant: +0:93 1.000000 +0:95 Branch: Return with expression +0:95 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:44 Function Definition: main( ( temp void) +0:44 Function Parameters: +0:? Sequence +0:44 Sequence +0:44 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:44 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:44 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:44 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:44 Color: direct index for structure ( temp 4-component vector of float) +0:44 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:44 Constant: +0:44 0 (const int) +0:44 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:44 Depth: direct index for structure ( temp float) +0:44 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:44 Constant: +0:44 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:? 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:? 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:? 'g_tTex2df4' (layout( rgba32f) uniform image2D) +0:? 'g_tTex2di4' (layout( rgba32i) uniform iimage2D) +0:? 'g_tTex2du4' (layout( rgba32ui) uniform uimage2D) +0:? 'g_tTex3df4' (layout( rgba32f) uniform image3D) +0:? 'g_tTex3di4' (layout( rgba32i) uniform iimage3D) +0:? 'g_tTex3du4' (layout( rgba32ui) uniform uimage3D) +0:? 'g_tTex1df4a' (layout( rgba32f) uniform image1DArray) +0:? 'g_tTex1di4a' (layout( rgba32i) uniform iimage1DArray) +0:? 'g_tTex1du4a' (layout( rgba32ui) uniform uimage1DArray) +0:? 'g_tTex2df4a' (layout( rgba32f) uniform image2DArray) +0:? 'g_tTex2di4a' (layout( rgba32i) uniform iimage2DArray) +0:? 'g_tTex2du4a' (layout( rgba32ui) uniform uimage2DArray) +0:? 'g_tBuffF' (layout( rgba32f) uniform imageBuffer) +0:? 'g_tBuffI' (layout( rgba32i) uniform iimageBuffer) +0:? 'g_tBuffU' (layout( rgba32ui) uniform uimageBuffer) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:44 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:44 Function Parameters: +0:? Sequence +0:63 Sequence +0:63 move second child to first child ( temp uint) +0:63 'sizeQueryTemp' ( temp uint) +0:63 imageQuerySize ( temp uint) +0:63 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:63 move second child to first child ( temp uint) +0:63 'WidthU' ( temp uint) +0:63 'sizeQueryTemp' ( temp uint) +0:64 Sequence +0:64 move second child to first child ( temp uint) +0:64 'sizeQueryTemp' ( temp uint) +0:64 imageQuerySize ( temp uint) +0:64 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:64 move second child to first child ( temp uint) +0:64 'WidthU' ( temp uint) +0:64 'sizeQueryTemp' ( temp uint) +0:65 Sequence +0:65 move second child to first child ( temp uint) +0:65 'sizeQueryTemp' ( temp uint) +0:65 imageQuerySize ( temp uint) +0:65 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:65 move second child to first child ( temp uint) +0:65 'WidthU' ( temp uint) +0:65 'sizeQueryTemp' ( temp uint) +0:68 Sequence +0:68 move second child to first child ( temp uint) +0:68 'sizeQueryTemp' ( temp uint) +0:68 imageQuerySize ( temp uint) +0:68 'g_tBuffF' (layout( rgba32f) uniform imageBuffer) +0:68 move second child to first child ( temp uint) +0:68 'WidthU' ( temp uint) +0:68 'sizeQueryTemp' ( temp uint) +0:69 Sequence +0:69 move second child to first child ( temp uint) +0:69 'sizeQueryTemp' ( temp uint) +0:69 imageQuerySize ( temp uint) +0:69 'g_tBuffI' (layout( rgba32i) uniform iimageBuffer) +0:69 move second child to first child ( temp uint) +0:69 'WidthU' ( temp uint) +0:69 'sizeQueryTemp' ( temp uint) +0:70 Sequence +0:70 move second child to first child ( temp uint) +0:70 'sizeQueryTemp' ( temp uint) +0:70 imageQuerySize ( temp uint) +0:70 'g_tBuffU' (layout( rgba32ui) uniform uimageBuffer) +0:70 move second child to first child ( temp uint) +0:70 'WidthU' ( temp uint) +0:70 'sizeQueryTemp' ( temp uint) +0:73 Sequence +0:73 move second child to first child ( temp 2-component vector of uint) +0:73 'sizeQueryTemp' ( temp 2-component vector of uint) +0:73 imageQuerySize ( temp 2-component vector of uint) +0:73 'g_tTex1df4a' (layout( rgba32f) uniform image1DArray) +0:73 move second child to first child ( temp uint) +0:73 'WidthU' ( temp uint) +0:73 direct index ( temp uint) +0:73 'sizeQueryTemp' ( temp 2-component vector of uint) +0:73 Constant: +0:73 0 (const int) +0:73 move second child to first child ( temp uint) +0:73 'ElementsU' ( temp uint) +0:73 direct index ( temp uint) +0:73 'sizeQueryTemp' ( temp 2-component vector of uint) +0:73 Constant: +0:73 1 (const int) +0:74 Sequence +0:74 move second child to first child ( temp 2-component vector of uint) +0:74 'sizeQueryTemp' ( temp 2-component vector of uint) +0:74 imageQuerySize ( temp 2-component vector of uint) +0:74 'g_tTex1di4a' (layout( rgba32i) uniform iimage1DArray) +0:74 move second child to first child ( temp uint) +0:74 'WidthU' ( temp uint) +0:74 direct index ( temp uint) +0:74 'sizeQueryTemp' ( temp 2-component vector of uint) +0:74 Constant: +0:74 0 (const int) +0:74 move second child to first child ( temp uint) +0:74 'ElementsU' ( temp uint) +0:74 direct index ( temp uint) +0:74 'sizeQueryTemp' ( temp 2-component vector of uint) +0:74 Constant: +0:74 1 (const int) +0:75 Sequence +0:75 move second child to first child ( temp 2-component vector of uint) +0:75 'sizeQueryTemp' ( temp 2-component vector of uint) +0:75 imageQuerySize ( temp 2-component vector of uint) +0:75 'g_tTex1du4a' (layout( rgba32ui) uniform uimage1DArray) +0:75 move second child to first child ( temp uint) +0:75 'WidthU' ( temp uint) +0:75 direct index ( temp uint) +0:75 'sizeQueryTemp' ( temp 2-component vector of uint) +0:75 Constant: +0:75 0 (const int) +0:75 move second child to first child ( temp uint) +0:75 'ElementsU' ( temp uint) +0:75 direct index ( temp uint) +0:75 'sizeQueryTemp' ( temp 2-component vector of uint) +0:75 Constant: +0:75 1 (const int) +0:78 Sequence +0:78 move second child to first child ( temp 2-component vector of uint) +0:78 'sizeQueryTemp' ( temp 2-component vector of uint) +0:78 imageQuerySize ( temp 2-component vector of uint) +0:78 'g_tTex2df4' (layout( rgba32f) uniform image2D) +0:78 move second child to first child ( temp uint) +0:78 'WidthU' ( temp uint) +0:78 direct index ( temp uint) +0:78 'sizeQueryTemp' ( temp 2-component vector of uint) +0:78 Constant: +0:78 0 (const int) +0:78 move second child to first child ( temp uint) +0:78 'HeightU' ( temp uint) +0:78 direct index ( temp uint) +0:78 'sizeQueryTemp' ( temp 2-component vector of uint) +0:78 Constant: +0:78 1 (const int) +0:79 Sequence +0:79 move second child to first child ( temp 2-component vector of uint) +0:79 'sizeQueryTemp' ( temp 2-component vector of uint) +0:79 imageQuerySize ( temp 2-component vector of uint) +0:79 'g_tTex2di4' (layout( rgba32i) uniform iimage2D) +0:79 move second child to first child ( temp uint) +0:79 'WidthU' ( temp uint) +0:79 direct index ( temp uint) +0:79 'sizeQueryTemp' ( temp 2-component vector of uint) +0:79 Constant: +0:79 0 (const int) +0:79 move second child to first child ( temp uint) +0:79 'HeightU' ( temp uint) +0:79 direct index ( temp uint) +0:79 'sizeQueryTemp' ( temp 2-component vector of uint) +0:79 Constant: +0:79 1 (const int) +0:80 Sequence +0:80 move second child to first child ( temp 2-component vector of uint) +0:80 'sizeQueryTemp' ( temp 2-component vector of uint) +0:80 imageQuerySize ( temp 2-component vector of uint) +0:80 'g_tTex2du4' (layout( rgba32ui) uniform uimage2D) +0:80 move second child to first child ( temp uint) +0:80 'WidthU' ( temp uint) +0:80 direct index ( temp uint) +0:80 'sizeQueryTemp' ( temp 2-component vector of uint) +0:80 Constant: +0:80 0 (const int) +0:80 move second child to first child ( temp uint) +0:80 'HeightU' ( temp uint) +0:80 direct index ( temp uint) +0:80 'sizeQueryTemp' ( temp 2-component vector of uint) +0:80 Constant: +0:80 1 (const int) +0:83 Sequence +0:83 move second child to first child ( temp 3-component vector of uint) +0:83 'sizeQueryTemp' ( temp 3-component vector of uint) +0:83 imageQuerySize ( temp 3-component vector of uint) +0:83 'g_tTex2df4a' (layout( rgba32f) uniform image2DArray) +0:83 move second child to first child ( temp uint) +0:83 'WidthU' ( temp uint) +0:83 direct index ( temp uint) +0:83 'sizeQueryTemp' ( temp 3-component vector of uint) +0:83 Constant: +0:83 0 (const int) +0:83 move second child to first child ( temp uint) +0:83 'HeightU' ( temp uint) +0:83 direct index ( temp uint) +0:83 'sizeQueryTemp' ( temp 3-component vector of uint) +0:83 Constant: +0:83 1 (const int) +0:83 move second child to first child ( temp uint) +0:83 'ElementsU' ( temp uint) +0:83 direct index ( temp uint) +0:83 'sizeQueryTemp' ( temp 3-component vector of uint) +0:83 Constant: +0:83 2 (const int) +0:84 Sequence +0:84 move second child to first child ( temp 3-component vector of uint) +0:84 'sizeQueryTemp' ( temp 3-component vector of uint) +0:84 imageQuerySize ( temp 3-component vector of uint) +0:84 'g_tTex2di4a' (layout( rgba32i) uniform iimage2DArray) +0:84 move second child to first child ( temp uint) +0:84 'WidthU' ( temp uint) +0:84 direct index ( temp uint) +0:84 'sizeQueryTemp' ( temp 3-component vector of uint) +0:84 Constant: +0:84 0 (const int) +0:84 move second child to first child ( temp uint) +0:84 'HeightU' ( temp uint) +0:84 direct index ( temp uint) +0:84 'sizeQueryTemp' ( temp 3-component vector of uint) +0:84 Constant: +0:84 1 (const int) +0:84 move second child to first child ( temp uint) +0:84 'ElementsU' ( temp uint) +0:84 direct index ( temp uint) +0:84 'sizeQueryTemp' ( temp 3-component vector of uint) +0:84 Constant: +0:84 2 (const int) +0:85 Sequence +0:85 move second child to first child ( temp 3-component vector of uint) +0:85 'sizeQueryTemp' ( temp 3-component vector of uint) +0:85 imageQuerySize ( temp 3-component vector of uint) +0:85 'g_tTex2du4a' (layout( rgba32ui) uniform uimage2DArray) +0:85 move second child to first child ( temp uint) +0:85 'WidthU' ( temp uint) +0:85 direct index ( temp uint) +0:85 'sizeQueryTemp' ( temp 3-component vector of uint) +0:85 Constant: +0:85 0 (const int) +0:85 move second child to first child ( temp uint) +0:85 'HeightU' ( temp uint) +0:85 direct index ( temp uint) +0:85 'sizeQueryTemp' ( temp 3-component vector of uint) +0:85 Constant: +0:85 1 (const int) +0:85 move second child to first child ( temp uint) +0:85 'ElementsU' ( temp uint) +0:85 direct index ( temp uint) +0:85 'sizeQueryTemp' ( temp 3-component vector of uint) +0:85 Constant: +0:85 2 (const int) +0:88 Sequence +0:88 move second child to first child ( temp 3-component vector of uint) +0:88 'sizeQueryTemp' ( temp 3-component vector of uint) +0:88 imageQuerySize ( temp 3-component vector of uint) +0:88 'g_tTex3df4' (layout( rgba32f) uniform image3D) +0:88 move second child to first child ( temp uint) +0:88 'WidthU' ( temp uint) +0:88 direct index ( temp uint) +0:88 'sizeQueryTemp' ( temp 3-component vector of uint) +0:88 Constant: +0:88 0 (const int) +0:88 move second child to first child ( temp uint) +0:88 'HeightU' ( temp uint) +0:88 direct index ( temp uint) +0:88 'sizeQueryTemp' ( temp 3-component vector of uint) +0:88 Constant: +0:88 1 (const int) +0:88 move second child to first child ( temp uint) +0:88 'DepthU' ( temp uint) +0:88 direct index ( temp uint) +0:88 'sizeQueryTemp' ( temp 3-component vector of uint) +0:88 Constant: +0:88 2 (const int) +0:89 Sequence +0:89 move second child to first child ( temp 3-component vector of uint) +0:89 'sizeQueryTemp' ( temp 3-component vector of uint) +0:89 imageQuerySize ( temp 3-component vector of uint) +0:89 'g_tTex3di4' (layout( rgba32i) uniform iimage3D) +0:89 move second child to first child ( temp uint) +0:89 'WidthU' ( temp uint) +0:89 direct index ( temp uint) +0:89 'sizeQueryTemp' ( temp 3-component vector of uint) +0:89 Constant: +0:89 0 (const int) +0:89 move second child to first child ( temp uint) +0:89 'HeightU' ( temp uint) +0:89 direct index ( temp uint) +0:89 'sizeQueryTemp' ( temp 3-component vector of uint) +0:89 Constant: +0:89 1 (const int) +0:89 move second child to first child ( temp uint) +0:89 'DepthU' ( temp uint) +0:89 direct index ( temp uint) +0:89 'sizeQueryTemp' ( temp 3-component vector of uint) +0:89 Constant: +0:89 2 (const int) +0:90 Sequence +0:90 move second child to first child ( temp 3-component vector of uint) +0:90 'sizeQueryTemp' ( temp 3-component vector of uint) +0:90 imageQuerySize ( temp 3-component vector of uint) +0:90 'g_tTex3du4' (layout( rgba32ui) uniform uimage3D) +0:90 move second child to first child ( temp uint) +0:90 'WidthU' ( temp uint) +0:90 direct index ( temp uint) +0:90 'sizeQueryTemp' ( temp 3-component vector of uint) +0:90 Constant: +0:90 0 (const int) +0:90 move second child to first child ( temp uint) +0:90 'HeightU' ( temp uint) +0:90 direct index ( temp uint) +0:90 'sizeQueryTemp' ( temp 3-component vector of uint) +0:90 Constant: +0:90 1 (const int) +0:90 move second child to first child ( temp uint) +0:90 'DepthU' ( temp uint) +0:90 direct index ( temp uint) +0:90 'sizeQueryTemp' ( temp 3-component vector of uint) +0:90 Constant: +0:90 2 (const int) +0:92 move second child to first child ( temp 4-component vector of float) +0:92 Color: direct index for structure ( temp 4-component vector of float) +0:92 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 1.000000 +0:92 1.000000 +0:92 1.000000 +0:92 1.000000 +0:93 move second child to first child ( temp float) +0:93 Depth: direct index for structure ( temp float) +0:93 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:93 Constant: +0:93 1 (const int) +0:93 Constant: +0:93 1.000000 +0:95 Branch: Return with expression +0:95 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:44 Function Definition: main( ( temp void) +0:44 Function Parameters: +0:? Sequence +0:44 Sequence +0:44 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:44 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:44 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:44 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:44 Color: direct index for structure ( temp 4-component vector of float) +0:44 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:44 Constant: +0:44 0 (const int) +0:44 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:44 Depth: direct index for structure ( temp float) +0:44 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:44 Constant: +0:44 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:? 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:? 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:? 'g_tTex2df4' (layout( rgba32f) uniform image2D) +0:? 'g_tTex2di4' (layout( rgba32i) uniform iimage2D) +0:? 'g_tTex2du4' (layout( rgba32ui) uniform uimage2D) +0:? 'g_tTex3df4' (layout( rgba32f) uniform image3D) +0:? 'g_tTex3di4' (layout( rgba32i) uniform iimage3D) +0:? 'g_tTex3du4' (layout( rgba32ui) uniform uimage3D) +0:? 'g_tTex1df4a' (layout( rgba32f) uniform image1DArray) +0:? 'g_tTex1di4a' (layout( rgba32i) uniform iimage1DArray) +0:? 'g_tTex1du4a' (layout( rgba32ui) uniform uimage1DArray) +0:? 'g_tTex2df4a' (layout( rgba32f) uniform image2DArray) +0:? 'g_tTex2di4a' (layout( rgba32i) uniform iimage2DArray) +0:? 'g_tTex2du4a' (layout( rgba32ui) uniform uimage2DArray) +0:? 'g_tBuffF' (layout( rgba32f) uniform imageBuffer) +0:? 'g_tBuffI' (layout( rgba32i) uniform iimageBuffer) +0:? 'g_tBuffU' (layout( rgba32ui) uniform uimageBuffer) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 232 + + Capability Shader + Capability Image1D + Capability ImageBuffer + Capability ImageQuery + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 216 220 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 14 "sizeQueryTemp" + Name 17 "g_tTex1df4" + Name 20 "WidthU" + Name 22 "sizeQueryTemp" + Name 26 "g_tTex1di4" + Name 30 "sizeQueryTemp" + Name 33 "g_tTex1du4" + Name 37 "sizeQueryTemp" + Name 40 "g_tBuffF" + Name 44 "sizeQueryTemp" + Name 47 "g_tBuffI" + Name 51 "sizeQueryTemp" + Name 54 "g_tBuffU" + Name 60 "sizeQueryTemp" + Name 63 "g_tTex1df4a" + Name 69 "ElementsU" + Name 73 "sizeQueryTemp" + Name 76 "g_tTex1di4a" + Name 83 "sizeQueryTemp" + Name 86 "g_tTex1du4a" + Name 93 "sizeQueryTemp" + Name 96 "g_tTex2df4" + Name 101 "HeightU" + Name 104 "sizeQueryTemp" + Name 107 "g_tTex2di4" + Name 114 "sizeQueryTemp" + Name 117 "g_tTex2du4" + Name 126 "sizeQueryTemp" + Name 129 "g_tTex2df4a" + Name 139 "sizeQueryTemp" + Name 142 "g_tTex2di4a" + Name 151 "sizeQueryTemp" + Name 154 "g_tTex2du4a" + Name 163 "sizeQueryTemp" + Name 166 "g_tTex3df4" + Name 173 "DepthU" + Name 176 "sizeQueryTemp" + Name 179 "g_tTex3di4" + Name 188 "sizeQueryTemp" + Name 191 "g_tTex3du4" + Name 201 "psout" + Name 213 "flattenTemp" + Name 216 "@entryPointOutput.Color" + Name 220 "@entryPointOutput.Depth" + Name 225 "g_sSamp" + Name 229 "$Global" + MemberName 229($Global) 0 "c1" + MemberName 229($Global) 1 "c2" + MemberName 229($Global) 2 "c3" + MemberName 229($Global) 3 "c4" + MemberName 229($Global) 4 "o1" + MemberName 229($Global) 5 "o2" + MemberName 229($Global) 6 "o3" + MemberName 229($Global) 7 "o4" + Name 231 "" + Decorate 17(g_tTex1df4) DescriptorSet 0 + Decorate 17(g_tTex1df4) Binding 0 + Decorate 26(g_tTex1di4) DescriptorSet 0 + Decorate 33(g_tTex1du4) DescriptorSet 0 + Decorate 40(g_tBuffF) DescriptorSet 0 + Decorate 47(g_tBuffI) DescriptorSet 0 + Decorate 54(g_tBuffU) DescriptorSet 0 + Decorate 63(g_tTex1df4a) DescriptorSet 0 + Decorate 76(g_tTex1di4a) DescriptorSet 0 + Decorate 86(g_tTex1du4a) DescriptorSet 0 + Decorate 96(g_tTex2df4) DescriptorSet 0 + Decorate 107(g_tTex2di4) DescriptorSet 0 + Decorate 117(g_tTex2du4) DescriptorSet 0 + Decorate 129(g_tTex2df4a) DescriptorSet 0 + Decorate 142(g_tTex2di4a) DescriptorSet 0 + Decorate 154(g_tTex2du4a) DescriptorSet 0 + Decorate 166(g_tTex3df4) DescriptorSet 0 + Decorate 179(g_tTex3di4) DescriptorSet 0 + Decorate 191(g_tTex3du4) DescriptorSet 0 + Decorate 216(@entryPointOutput.Color) Location 0 + Decorate 220(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 225(g_sSamp) DescriptorSet 0 + Decorate 225(g_sSamp) Binding 0 + MemberDecorate 229($Global) 0 Offset 0 + MemberDecorate 229($Global) 1 Offset 8 + MemberDecorate 229($Global) 2 Offset 16 + MemberDecorate 229($Global) 3 Offset 32 + MemberDecorate 229($Global) 4 Offset 48 + MemberDecorate 229($Global) 5 Offset 56 + MemberDecorate 229($Global) 6 Offset 64 + MemberDecorate 229($Global) 7 Offset 80 + Decorate 229($Global) Block + Decorate 231 DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeInt 32 0 + 13: TypePointer Function 12(int) + 15: TypeImage 6(float) 1D nonsampled format:Rgba32f + 16: TypePointer UniformConstant 15 + 17(g_tTex1df4): 16(ptr) Variable UniformConstant + 23: TypeInt 32 1 + 24: TypeImage 23(int) 1D nonsampled format:Rgba32i + 25: TypePointer UniformConstant 24 + 26(g_tTex1di4): 25(ptr) Variable UniformConstant + 31: TypeImage 12(int) 1D nonsampled format:Rgba32ui + 32: TypePointer UniformConstant 31 + 33(g_tTex1du4): 32(ptr) Variable UniformConstant + 38: TypeImage 6(float) Buffer nonsampled format:Rgba32f + 39: TypePointer UniformConstant 38 + 40(g_tBuffF): 39(ptr) Variable UniformConstant + 45: TypeImage 23(int) Buffer nonsampled format:Rgba32i + 46: TypePointer UniformConstant 45 + 47(g_tBuffI): 46(ptr) Variable UniformConstant + 52: TypeImage 12(int) Buffer nonsampled format:Rgba32ui + 53: TypePointer UniformConstant 52 + 54(g_tBuffU): 53(ptr) Variable UniformConstant + 58: TypeVector 12(int) 2 + 59: TypePointer Function 58(ivec2) + 61: TypeImage 6(float) 1D array nonsampled format:Rgba32f + 62: TypePointer UniformConstant 61 + 63(g_tTex1df4a): 62(ptr) Variable UniformConstant + 66: 12(int) Constant 0 + 70: 12(int) Constant 1 + 74: TypeImage 23(int) 1D array nonsampled format:Rgba32i + 75: TypePointer UniformConstant 74 + 76(g_tTex1di4a): 75(ptr) Variable UniformConstant + 84: TypeImage 12(int) 1D array nonsampled format:Rgba32ui + 85: TypePointer UniformConstant 84 + 86(g_tTex1du4a): 85(ptr) Variable UniformConstant + 94: TypeImage 6(float) 2D nonsampled format:Rgba32f + 95: TypePointer UniformConstant 94 + 96(g_tTex2df4): 95(ptr) Variable UniformConstant + 105: TypeImage 23(int) 2D nonsampled format:Rgba32i + 106: TypePointer UniformConstant 105 + 107(g_tTex2di4): 106(ptr) Variable UniformConstant + 115: TypeImage 12(int) 2D nonsampled format:Rgba32ui + 116: TypePointer UniformConstant 115 + 117(g_tTex2du4): 116(ptr) Variable UniformConstant + 124: TypeVector 12(int) 3 + 125: TypePointer Function 124(ivec3) + 127: TypeImage 6(float) 2D array nonsampled format:Rgba32f + 128: TypePointer UniformConstant 127 +129(g_tTex2df4a): 128(ptr) Variable UniformConstant + 136: 12(int) Constant 2 + 140: TypeImage 23(int) 2D array nonsampled format:Rgba32i + 141: TypePointer UniformConstant 140 +142(g_tTex2di4a): 141(ptr) Variable UniformConstant + 152: TypeImage 12(int) 2D array nonsampled format:Rgba32ui + 153: TypePointer UniformConstant 152 +154(g_tTex2du4a): 153(ptr) Variable UniformConstant + 164: TypeImage 6(float) 3D nonsampled format:Rgba32f + 165: TypePointer UniformConstant 164 + 166(g_tTex3df4): 165(ptr) Variable UniformConstant + 177: TypeImage 23(int) 3D nonsampled format:Rgba32i + 178: TypePointer UniformConstant 177 + 179(g_tTex3di4): 178(ptr) Variable UniformConstant + 189: TypeImage 12(int) 3D nonsampled format:Rgba32ui + 190: TypePointer UniformConstant 189 + 191(g_tTex3du4): 190(ptr) Variable UniformConstant + 200: TypePointer Function 8(PS_OUTPUT) + 202: 23(int) Constant 0 + 203: 6(float) Constant 1065353216 + 204: 7(fvec4) ConstantComposite 203 203 203 203 + 205: TypePointer Function 7(fvec4) + 207: 23(int) Constant 1 + 208: TypePointer Function 6(float) + 215: TypePointer Output 7(fvec4) +216(@entryPointOutput.Color): 215(ptr) Variable Output + 219: TypePointer Output 6(float) +220(@entryPointOutput.Depth): 219(ptr) Variable Output + 223: TypeSampler + 224: TypePointer UniformConstant 223 + 225(g_sSamp): 224(ptr) Variable UniformConstant + 226: TypeVector 23(int) 2 + 227: TypeVector 23(int) 3 + 228: TypeVector 23(int) 4 + 229($Global): TypeStruct 23(int) 226(ivec2) 227(ivec3) 228(ivec4) 23(int) 226(ivec2) 227(ivec3) 228(ivec4) + 230: TypePointer Uniform 229($Global) + 231: 230(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label +213(flattenTemp): 200(ptr) Variable Function + 214:8(PS_OUTPUT) FunctionCall 10(@main() + Store 213(flattenTemp) 214 + 217: 205(ptr) AccessChain 213(flattenTemp) 202 + 218: 7(fvec4) Load 217 + Store 216(@entryPointOutput.Color) 218 + 221: 208(ptr) AccessChain 213(flattenTemp) 207 + 222: 6(float) Load 221 + Store 220(@entryPointOutput.Depth) 222 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label +14(sizeQueryTemp): 13(ptr) Variable Function + 20(WidthU): 13(ptr) Variable Function +22(sizeQueryTemp): 13(ptr) Variable Function +30(sizeQueryTemp): 13(ptr) Variable Function +37(sizeQueryTemp): 13(ptr) Variable Function +44(sizeQueryTemp): 13(ptr) Variable Function +51(sizeQueryTemp): 13(ptr) Variable Function +60(sizeQueryTemp): 59(ptr) Variable Function + 69(ElementsU): 13(ptr) Variable Function +73(sizeQueryTemp): 59(ptr) Variable Function +83(sizeQueryTemp): 59(ptr) Variable Function +93(sizeQueryTemp): 59(ptr) Variable Function + 101(HeightU): 13(ptr) Variable Function +104(sizeQueryTemp): 59(ptr) Variable Function +114(sizeQueryTemp): 59(ptr) Variable Function +126(sizeQueryTemp): 125(ptr) Variable Function +139(sizeQueryTemp): 125(ptr) Variable Function +151(sizeQueryTemp): 125(ptr) Variable Function +163(sizeQueryTemp): 125(ptr) Variable Function + 173(DepthU): 13(ptr) Variable Function +176(sizeQueryTemp): 125(ptr) Variable Function +188(sizeQueryTemp): 125(ptr) Variable Function + 201(psout): 200(ptr) Variable Function + 18: 15 Load 17(g_tTex1df4) + 19: 12(int) ImageQuerySize 18 + Store 14(sizeQueryTemp) 19 + 21: 12(int) Load 14(sizeQueryTemp) + Store 20(WidthU) 21 + 27: 24 Load 26(g_tTex1di4) + 28: 12(int) ImageQuerySize 27 + Store 22(sizeQueryTemp) 28 + 29: 12(int) Load 22(sizeQueryTemp) + Store 20(WidthU) 29 + 34: 31 Load 33(g_tTex1du4) + 35: 12(int) ImageQuerySize 34 + Store 30(sizeQueryTemp) 35 + 36: 12(int) Load 30(sizeQueryTemp) + Store 20(WidthU) 36 + 41: 38 Load 40(g_tBuffF) + 42: 12(int) ImageQuerySize 41 + Store 37(sizeQueryTemp) 42 + 43: 12(int) Load 37(sizeQueryTemp) + Store 20(WidthU) 43 + 48: 45 Load 47(g_tBuffI) + 49: 12(int) ImageQuerySize 48 + Store 44(sizeQueryTemp) 49 + 50: 12(int) Load 44(sizeQueryTemp) + Store 20(WidthU) 50 + 55: 52 Load 54(g_tBuffU) + 56: 12(int) ImageQuerySize 55 + Store 51(sizeQueryTemp) 56 + 57: 12(int) Load 51(sizeQueryTemp) + Store 20(WidthU) 57 + 64: 61 Load 63(g_tTex1df4a) + 65: 58(ivec2) ImageQuerySize 64 + Store 60(sizeQueryTemp) 65 + 67: 13(ptr) AccessChain 60(sizeQueryTemp) 66 + 68: 12(int) Load 67 + Store 20(WidthU) 68 + 71: 13(ptr) AccessChain 60(sizeQueryTemp) 70 + 72: 12(int) Load 71 + Store 69(ElementsU) 72 + 77: 74 Load 76(g_tTex1di4a) + 78: 58(ivec2) ImageQuerySize 77 + Store 73(sizeQueryTemp) 78 + 79: 13(ptr) AccessChain 73(sizeQueryTemp) 66 + 80: 12(int) Load 79 + Store 20(WidthU) 80 + 81: 13(ptr) AccessChain 73(sizeQueryTemp) 70 + 82: 12(int) Load 81 + Store 69(ElementsU) 82 + 87: 84 Load 86(g_tTex1du4a) + 88: 58(ivec2) ImageQuerySize 87 + Store 83(sizeQueryTemp) 88 + 89: 13(ptr) AccessChain 83(sizeQueryTemp) 66 + 90: 12(int) Load 89 + Store 20(WidthU) 90 + 91: 13(ptr) AccessChain 83(sizeQueryTemp) 70 + 92: 12(int) Load 91 + Store 69(ElementsU) 92 + 97: 94 Load 96(g_tTex2df4) + 98: 58(ivec2) ImageQuerySize 97 + Store 93(sizeQueryTemp) 98 + 99: 13(ptr) AccessChain 93(sizeQueryTemp) 66 + 100: 12(int) Load 99 + Store 20(WidthU) 100 + 102: 13(ptr) AccessChain 93(sizeQueryTemp) 70 + 103: 12(int) Load 102 + Store 101(HeightU) 103 + 108: 105 Load 107(g_tTex2di4) + 109: 58(ivec2) ImageQuerySize 108 + Store 104(sizeQueryTemp) 109 + 110: 13(ptr) AccessChain 104(sizeQueryTemp) 66 + 111: 12(int) Load 110 + Store 20(WidthU) 111 + 112: 13(ptr) AccessChain 104(sizeQueryTemp) 70 + 113: 12(int) Load 112 + Store 101(HeightU) 113 + 118: 115 Load 117(g_tTex2du4) + 119: 58(ivec2) ImageQuerySize 118 + Store 114(sizeQueryTemp) 119 + 120: 13(ptr) AccessChain 114(sizeQueryTemp) 66 + 121: 12(int) Load 120 + Store 20(WidthU) 121 + 122: 13(ptr) AccessChain 114(sizeQueryTemp) 70 + 123: 12(int) Load 122 + Store 101(HeightU) 123 + 130: 127 Load 129(g_tTex2df4a) + 131: 124(ivec3) ImageQuerySize 130 + Store 126(sizeQueryTemp) 131 + 132: 13(ptr) AccessChain 126(sizeQueryTemp) 66 + 133: 12(int) Load 132 + Store 20(WidthU) 133 + 134: 13(ptr) AccessChain 126(sizeQueryTemp) 70 + 135: 12(int) Load 134 + Store 101(HeightU) 135 + 137: 13(ptr) AccessChain 126(sizeQueryTemp) 136 + 138: 12(int) Load 137 + Store 69(ElementsU) 138 + 143: 140 Load 142(g_tTex2di4a) + 144: 124(ivec3) ImageQuerySize 143 + Store 139(sizeQueryTemp) 144 + 145: 13(ptr) AccessChain 139(sizeQueryTemp) 66 + 146: 12(int) Load 145 + Store 20(WidthU) 146 + 147: 13(ptr) AccessChain 139(sizeQueryTemp) 70 + 148: 12(int) Load 147 + Store 101(HeightU) 148 + 149: 13(ptr) AccessChain 139(sizeQueryTemp) 136 + 150: 12(int) Load 149 + Store 69(ElementsU) 150 + 155: 152 Load 154(g_tTex2du4a) + 156: 124(ivec3) ImageQuerySize 155 + Store 151(sizeQueryTemp) 156 + 157: 13(ptr) AccessChain 151(sizeQueryTemp) 66 + 158: 12(int) Load 157 + Store 20(WidthU) 158 + 159: 13(ptr) AccessChain 151(sizeQueryTemp) 70 + 160: 12(int) Load 159 + Store 101(HeightU) 160 + 161: 13(ptr) AccessChain 151(sizeQueryTemp) 136 + 162: 12(int) Load 161 + Store 69(ElementsU) 162 + 167: 164 Load 166(g_tTex3df4) + 168: 124(ivec3) ImageQuerySize 167 + Store 163(sizeQueryTemp) 168 + 169: 13(ptr) AccessChain 163(sizeQueryTemp) 66 + 170: 12(int) Load 169 + Store 20(WidthU) 170 + 171: 13(ptr) AccessChain 163(sizeQueryTemp) 70 + 172: 12(int) Load 171 + Store 101(HeightU) 172 + 174: 13(ptr) AccessChain 163(sizeQueryTemp) 136 + 175: 12(int) Load 174 + Store 173(DepthU) 175 + 180: 177 Load 179(g_tTex3di4) + 181: 124(ivec3) ImageQuerySize 180 + Store 176(sizeQueryTemp) 181 + 182: 13(ptr) AccessChain 176(sizeQueryTemp) 66 + 183: 12(int) Load 182 + Store 20(WidthU) 183 + 184: 13(ptr) AccessChain 176(sizeQueryTemp) 70 + 185: 12(int) Load 184 + Store 101(HeightU) 185 + 186: 13(ptr) AccessChain 176(sizeQueryTemp) 136 + 187: 12(int) Load 186 + Store 173(DepthU) 187 + 192: 189 Load 191(g_tTex3du4) + 193: 124(ivec3) ImageQuerySize 192 + Store 188(sizeQueryTemp) 193 + 194: 13(ptr) AccessChain 188(sizeQueryTemp) 66 + 195: 12(int) Load 194 + Store 20(WidthU) 195 + 196: 13(ptr) AccessChain 188(sizeQueryTemp) 70 + 197: 12(int) Load 196 + Store 101(HeightU) 197 + 198: 13(ptr) AccessChain 188(sizeQueryTemp) 136 + 199: 12(int) Load 198 + Store 173(DepthU) 199 + 206: 205(ptr) AccessChain 201(psout) 202 + Store 206 204 + 209: 208(ptr) AccessChain 201(psout) 207 + Store 209 203 + 210:8(PS_OUTPUT) Load 201(psout) + ReturnValue 210 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out new file mode 100644 index 00000000..51bd0769 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out @@ -0,0 +1,846 @@ +hlsl.getsampleposition.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:13 Function Definition: @main(i1; ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:13 Function Parameters: +0:13 'sample' ( in int) +0:? Sequence +0:16 Sequence +0:16 move second child to first child ( temp 2-component vector of float) +0:16 'r00' ( temp 2-component vector of float) +0:16 Sequence +0:16 move second child to first child ( temp uint) +0:16 '@sampleCount' ( temp uint) +0:16 imageQuerySamples ( temp uint) +0:16 'g_tTex2dmsf4' ( uniform texture2DMS) +0:16 Test condition and select ( temp 2-component vector of float): no shortcircuit +0:16 Condition +0:16 Compare Equal ( temp bool) +0:16 '@sampleCount' ( temp uint) +0:16 Constant: +0:16 2 (const int) +0:16 true case +0:16 indirect index ( temp 2-component vector of float) +0:? Constant: +0:? 0.250000 +0:? 0.250000 +0:? -0.250000 +0:? -0.250000 +0:16 'sample' ( in int) +0:16 false case +0:16 Test condition and select ( temp 2-component vector of float): no shortcircuit +0:16 Condition +0:16 Compare Equal ( temp bool) +0:16 '@sampleCount' ( temp uint) +0:16 Constant: +0:16 4 (const int) +0:16 true case +0:16 indirect index ( temp 2-component vector of float) +0:? Constant: +0:? -0.125000 +0:? -0.375000 +0:? 0.375000 +0:? -0.125000 +0:? -0.375000 +0:? 0.125000 +0:? 0.125000 +0:? 0.375000 +0:16 'sample' ( in int) +0:16 false case +0:16 Test condition and select ( temp 2-component vector of float): no shortcircuit +0:16 Condition +0:16 Compare Equal ( temp bool) +0:16 '@sampleCount' ( temp uint) +0:16 Constant: +0:16 8 (const int) +0:16 true case +0:16 indirect index ( temp 2-component vector of float) +0:? Constant: +0:? 0.062500 +0:? -0.187500 +0:? -0.062500 +0:? 0.187500 +0:? 0.312500 +0:? 0.062500 +0:? -0.187500 +0:? -0.312500 +0:? -0.312500 +0:? 0.312500 +0:? -0.437500 +0:? -0.062500 +0:? 0.187500 +0:? 0.437500 +0:? 0.437500 +0:? -0.437500 +0:16 'sample' ( in int) +0:16 false case +0:16 Test condition and select ( temp 2-component vector of float): no shortcircuit +0:16 Condition +0:16 Compare Equal ( temp bool) +0:16 '@sampleCount' ( temp uint) +0:16 Constant: +0:16 16 (const int) +0:16 true case +0:16 indirect index ( temp 2-component vector of float) +0:? Constant: +0:? 0.062500 +0:? 0.062500 +0:? -0.062500 +0:? -0.187500 +0:? -0.187500 +0:? 0.125000 +0:? 0.250000 +0:? -0.062500 +0:? -0.312500 +0:? -0.125000 +0:? 0.125000 +0:? 0.312500 +0:? 0.312500 +0:? 0.187500 +0:? 0.187500 +0:? -0.312500 +0:? -0.125000 +0:? 0.375000 +0:? 0.000000 +0:? -0.437500 +0:? -0.250000 +0:? -0.375000 +0:? -0.375000 +0:? 0.250000 +0:? -0.500000 +0:? 0.000000 +0:? 0.437500 +0:? -0.250000 +0:? 0.375000 +0:? 0.437500 +0:? -0.437500 +0:? -0.500000 +0:16 'sample' ( in int) +0:16 false case +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:17 Sequence +0:17 move second child to first child ( temp 2-component vector of float) +0:17 'r01' ( temp 2-component vector of float) +0:17 Sequence +0:17 move second child to first child ( temp uint) +0:17 '@sampleCount' ( temp uint) +0:17 imageQuerySamples ( temp uint) +0:17 'g_tTex2dmsf4a' ( uniform texture2DMSArray) +0:17 Test condition and select ( temp 2-component vector of float): no shortcircuit +0:17 Condition +0:17 Compare Equal ( temp bool) +0:17 '@sampleCount' ( temp uint) +0:17 Constant: +0:17 2 (const int) +0:17 true case +0:17 indirect index ( temp 2-component vector of float) +0:? Constant: +0:? 0.250000 +0:? 0.250000 +0:? -0.250000 +0:? -0.250000 +0:17 'sample' ( in int) +0:17 false case +0:17 Test condition and select ( temp 2-component vector of float): no shortcircuit +0:17 Condition +0:17 Compare Equal ( temp bool) +0:17 '@sampleCount' ( temp uint) +0:17 Constant: +0:17 4 (const int) +0:17 true case +0:17 indirect index ( temp 2-component vector of float) +0:? Constant: +0:? -0.125000 +0:? -0.375000 +0:? 0.375000 +0:? -0.125000 +0:? -0.375000 +0:? 0.125000 +0:? 0.125000 +0:? 0.375000 +0:17 'sample' ( in int) +0:17 false case +0:17 Test condition and select ( temp 2-component vector of float): no shortcircuit +0:17 Condition +0:17 Compare Equal ( temp bool) +0:17 '@sampleCount' ( temp uint) +0:17 Constant: +0:17 8 (const int) +0:17 true case +0:17 indirect index ( temp 2-component vector of float) +0:? Constant: +0:? 0.062500 +0:? -0.187500 +0:? -0.062500 +0:? 0.187500 +0:? 0.312500 +0:? 0.062500 +0:? -0.187500 +0:? -0.312500 +0:? -0.312500 +0:? 0.312500 +0:? -0.437500 +0:? -0.062500 +0:? 0.187500 +0:? 0.437500 +0:? 0.437500 +0:? -0.437500 +0:17 'sample' ( in int) +0:17 false case +0:17 Test condition and select ( temp 2-component vector of float): no shortcircuit +0:17 Condition +0:17 Compare Equal ( temp bool) +0:17 '@sampleCount' ( temp uint) +0:17 Constant: +0:17 16 (const int) +0:17 true case +0:17 indirect index ( temp 2-component vector of float) +0:? Constant: +0:? 0.062500 +0:? 0.062500 +0:? -0.062500 +0:? -0.187500 +0:? -0.187500 +0:? 0.125000 +0:? 0.250000 +0:? -0.062500 +0:? -0.312500 +0:? -0.125000 +0:? 0.125000 +0:? 0.312500 +0:? 0.312500 +0:? 0.187500 +0:? 0.187500 +0:? -0.312500 +0:? -0.125000 +0:? 0.375000 +0:? 0.000000 +0:? -0.437500 +0:? -0.250000 +0:? -0.375000 +0:? -0.375000 +0:? 0.250000 +0:? -0.500000 +0:? 0.000000 +0:? 0.437500 +0:? -0.250000 +0:? 0.375000 +0:? 0.437500 +0:? -0.437500 +0:? -0.500000 +0:17 'sample' ( in int) +0:17 false case +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:19 move second child to first child ( temp 4-component vector of float) +0:19 Color: direct index for structure ( temp 4-component vector of float) +0:19 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1.000000 +0:19 1.000000 +0:19 1.000000 +0:19 1.000000 +0:20 move second child to first child ( temp float) +0:20 Depth: direct index for structure ( temp float) +0:20 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 1.000000 +0:22 Branch: Return with expression +0:22 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:13 Function Definition: main( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp int) +0:? 'sample' ( temp int) +0:? 'sample' (layout( location=0) flat in int) +0:13 Sequence +0:13 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:13 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:13 Function Call: @main(i1; ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:? 'sample' ( temp int) +0:13 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:13 Color: direct index for structure ( temp 4-component vector of float) +0:13 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:13 Constant: +0:13 0 (const int) +0:13 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:13 Depth: direct index for structure ( temp float) +0:13 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:13 Constant: +0:13 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex2dmsf4' ( uniform texture2DMS) +0:? 'g_tTex2dmsf4a' ( uniform texture2DMSArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:? 'sample' (layout( location=0) flat in int) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:13 Function Definition: @main(i1; ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:13 Function Parameters: +0:13 'sample' ( in int) +0:? Sequence +0:16 Sequence +0:16 move second child to first child ( temp 2-component vector of float) +0:16 'r00' ( temp 2-component vector of float) +0:16 Sequence +0:16 move second child to first child ( temp uint) +0:16 '@sampleCount' ( temp uint) +0:16 imageQuerySamples ( temp uint) +0:16 'g_tTex2dmsf4' ( uniform texture2DMS) +0:16 Test condition and select ( temp 2-component vector of float): no shortcircuit +0:16 Condition +0:16 Compare Equal ( temp bool) +0:16 '@sampleCount' ( temp uint) +0:16 Constant: +0:16 2 (const int) +0:16 true case +0:16 indirect index ( temp 2-component vector of float) +0:? Constant: +0:? 0.250000 +0:? 0.250000 +0:? -0.250000 +0:? -0.250000 +0:16 'sample' ( in int) +0:16 false case +0:16 Test condition and select ( temp 2-component vector of float): no shortcircuit +0:16 Condition +0:16 Compare Equal ( temp bool) +0:16 '@sampleCount' ( temp uint) +0:16 Constant: +0:16 4 (const int) +0:16 true case +0:16 indirect index ( temp 2-component vector of float) +0:? Constant: +0:? -0.125000 +0:? -0.375000 +0:? 0.375000 +0:? -0.125000 +0:? -0.375000 +0:? 0.125000 +0:? 0.125000 +0:? 0.375000 +0:16 'sample' ( in int) +0:16 false case +0:16 Test condition and select ( temp 2-component vector of float): no shortcircuit +0:16 Condition +0:16 Compare Equal ( temp bool) +0:16 '@sampleCount' ( temp uint) +0:16 Constant: +0:16 8 (const int) +0:16 true case +0:16 indirect index ( temp 2-component vector of float) +0:? Constant: +0:? 0.062500 +0:? -0.187500 +0:? -0.062500 +0:? 0.187500 +0:? 0.312500 +0:? 0.062500 +0:? -0.187500 +0:? -0.312500 +0:? -0.312500 +0:? 0.312500 +0:? -0.437500 +0:? -0.062500 +0:? 0.187500 +0:? 0.437500 +0:? 0.437500 +0:? -0.437500 +0:16 'sample' ( in int) +0:16 false case +0:16 Test condition and select ( temp 2-component vector of float): no shortcircuit +0:16 Condition +0:16 Compare Equal ( temp bool) +0:16 '@sampleCount' ( temp uint) +0:16 Constant: +0:16 16 (const int) +0:16 true case +0:16 indirect index ( temp 2-component vector of float) +0:? Constant: +0:? 0.062500 +0:? 0.062500 +0:? -0.062500 +0:? -0.187500 +0:? -0.187500 +0:? 0.125000 +0:? 0.250000 +0:? -0.062500 +0:? -0.312500 +0:? -0.125000 +0:? 0.125000 +0:? 0.312500 +0:? 0.312500 +0:? 0.187500 +0:? 0.187500 +0:? -0.312500 +0:? -0.125000 +0:? 0.375000 +0:? 0.000000 +0:? -0.437500 +0:? -0.250000 +0:? -0.375000 +0:? -0.375000 +0:? 0.250000 +0:? -0.500000 +0:? 0.000000 +0:? 0.437500 +0:? -0.250000 +0:? 0.375000 +0:? 0.437500 +0:? -0.437500 +0:? -0.500000 +0:16 'sample' ( in int) +0:16 false case +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:17 Sequence +0:17 move second child to first child ( temp 2-component vector of float) +0:17 'r01' ( temp 2-component vector of float) +0:17 Sequence +0:17 move second child to first child ( temp uint) +0:17 '@sampleCount' ( temp uint) +0:17 imageQuerySamples ( temp uint) +0:17 'g_tTex2dmsf4a' ( uniform texture2DMSArray) +0:17 Test condition and select ( temp 2-component vector of float): no shortcircuit +0:17 Condition +0:17 Compare Equal ( temp bool) +0:17 '@sampleCount' ( temp uint) +0:17 Constant: +0:17 2 (const int) +0:17 true case +0:17 indirect index ( temp 2-component vector of float) +0:? Constant: +0:? 0.250000 +0:? 0.250000 +0:? -0.250000 +0:? -0.250000 +0:17 'sample' ( in int) +0:17 false case +0:17 Test condition and select ( temp 2-component vector of float): no shortcircuit +0:17 Condition +0:17 Compare Equal ( temp bool) +0:17 '@sampleCount' ( temp uint) +0:17 Constant: +0:17 4 (const int) +0:17 true case +0:17 indirect index ( temp 2-component vector of float) +0:? Constant: +0:? -0.125000 +0:? -0.375000 +0:? 0.375000 +0:? -0.125000 +0:? -0.375000 +0:? 0.125000 +0:? 0.125000 +0:? 0.375000 +0:17 'sample' ( in int) +0:17 false case +0:17 Test condition and select ( temp 2-component vector of float): no shortcircuit +0:17 Condition +0:17 Compare Equal ( temp bool) +0:17 '@sampleCount' ( temp uint) +0:17 Constant: +0:17 8 (const int) +0:17 true case +0:17 indirect index ( temp 2-component vector of float) +0:? Constant: +0:? 0.062500 +0:? -0.187500 +0:? -0.062500 +0:? 0.187500 +0:? 0.312500 +0:? 0.062500 +0:? -0.187500 +0:? -0.312500 +0:? -0.312500 +0:? 0.312500 +0:? -0.437500 +0:? -0.062500 +0:? 0.187500 +0:? 0.437500 +0:? 0.437500 +0:? -0.437500 +0:17 'sample' ( in int) +0:17 false case +0:17 Test condition and select ( temp 2-component vector of float): no shortcircuit +0:17 Condition +0:17 Compare Equal ( temp bool) +0:17 '@sampleCount' ( temp uint) +0:17 Constant: +0:17 16 (const int) +0:17 true case +0:17 indirect index ( temp 2-component vector of float) +0:? Constant: +0:? 0.062500 +0:? 0.062500 +0:? -0.062500 +0:? -0.187500 +0:? -0.187500 +0:? 0.125000 +0:? 0.250000 +0:? -0.062500 +0:? -0.312500 +0:? -0.125000 +0:? 0.125000 +0:? 0.312500 +0:? 0.312500 +0:? 0.187500 +0:? 0.187500 +0:? -0.312500 +0:? -0.125000 +0:? 0.375000 +0:? 0.000000 +0:? -0.437500 +0:? -0.250000 +0:? -0.375000 +0:? -0.375000 +0:? 0.250000 +0:? -0.500000 +0:? 0.000000 +0:? 0.437500 +0:? -0.250000 +0:? 0.375000 +0:? 0.437500 +0:? -0.437500 +0:? -0.500000 +0:17 'sample' ( in int) +0:17 false case +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:19 move second child to first child ( temp 4-component vector of float) +0:19 Color: direct index for structure ( temp 4-component vector of float) +0:19 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1.000000 +0:19 1.000000 +0:19 1.000000 +0:19 1.000000 +0:20 move second child to first child ( temp float) +0:20 Depth: direct index for structure ( temp float) +0:20 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 1.000000 +0:22 Branch: Return with expression +0:22 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:13 Function Definition: main( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp int) +0:? 'sample' ( temp int) +0:? 'sample' (layout( location=0) flat in int) +0:13 Sequence +0:13 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:13 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:13 Function Call: @main(i1; ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:? 'sample' ( temp int) +0:13 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:13 Color: direct index for structure ( temp 4-component vector of float) +0:13 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:13 Constant: +0:13 0 (const int) +0:13 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:13 Depth: direct index for structure ( temp float) +0:13 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:13 Constant: +0:13 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex2dmsf4' ( uniform texture2DMS) +0:? 'g_tTex2dmsf4a' ( uniform texture2DMSArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:? 'sample' (layout( location=0) flat in int) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 198 + + Capability Shader + Capability ImageQuery + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 181 188 192 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 10 "PS_OUTPUT" + MemberName 10(PS_OUTPUT) 0 "Color" + MemberName 10(PS_OUTPUT) 1 "Depth" + Name 13 "@main(i1;" + Name 12 "sample" + Name 17 "r00" + Name 20 "@sampleCount" + Name 23 "g_tTex2dmsf4" + Name 39 "indexable" + Name 58 "indexable" + Name 85 "indexable" + Name 114 "indexable" + Name 127 "r01" + Name 128 "@sampleCount" + Name 131 "g_tTex2dmsf4a" + Name 137 "indexable" + Name 143 "indexable" + Name 149 "indexable" + Name 155 "indexable" + Name 167 "psout" + Name 179 "sample" + Name 181 "sample" + Name 183 "flattenTemp" + Name 184 "param" + Name 188 "@entryPointOutput.Color" + Name 192 "@entryPointOutput.Depth" + Name 197 "g_sSamp" + Decorate 23(g_tTex2dmsf4) DescriptorSet 0 + Decorate 131(g_tTex2dmsf4a) DescriptorSet 0 + Decorate 181(sample) Flat + Decorate 181(sample) Location 0 + Decorate 188(@entryPointOutput.Color) Location 0 + Decorate 192(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 197(g_sSamp) DescriptorSet 0 + Decorate 197(g_sSamp) Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10(PS_OUTPUT): TypeStruct 9(fvec4) 8(float) + 11: TypeFunction 10(PS_OUTPUT) 7(ptr) + 15: TypeVector 8(float) 2 + 16: TypePointer Function 15(fvec2) + 18: TypeInt 32 0 + 19: TypePointer Function 18(int) + 21: TypeImage 8(float) 2D multi-sampled sampled format:Unknown + 22: TypePointer UniformConstant 21 +23(g_tTex2dmsf4): 22(ptr) Variable UniformConstant + 27: 6(int) Constant 2 + 28: TypeBool + 30: 18(int) Constant 2 + 31: TypeArray 15(fvec2) 30 + 32: 8(float) Constant 1048576000 + 33: 15(fvec2) ConstantComposite 32 32 + 34: 8(float) Constant 3196059648 + 35: 15(fvec2) ConstantComposite 34 34 + 36: 31 ConstantComposite 33 35 + 38: TypePointer Function 31 + 43: 6(int) Constant 4 + 45: 18(int) Constant 4 + 46: TypeArray 15(fvec2) 45 + 47: 8(float) Constant 3187671040 + 48: 8(float) Constant 3200253952 + 49: 15(fvec2) ConstantComposite 47 48 + 50: 8(float) Constant 1052770304 + 51: 15(fvec2) ConstantComposite 50 47 + 52: 8(float) Constant 1040187392 + 53: 15(fvec2) ConstantComposite 48 52 + 54: 15(fvec2) ConstantComposite 52 50 + 55: 46 ConstantComposite 49 51 53 54 + 57: TypePointer Function 46 + 62: 6(int) Constant 8 + 64: 18(int) Constant 8 + 65: TypeArray 15(fvec2) 64 + 66: 8(float) Constant 1031798784 + 67: 8(float) Constant 3191865344 + 68: 15(fvec2) ConstantComposite 66 67 + 69: 8(float) Constant 3179282432 + 70: 8(float) Constant 1044381696 + 71: 15(fvec2) ConstantComposite 69 70 + 72: 8(float) Constant 1050673152 + 73: 15(fvec2) ConstantComposite 72 66 + 74: 8(float) Constant 3198156800 + 75: 15(fvec2) ConstantComposite 67 74 + 76: 15(fvec2) ConstantComposite 74 72 + 77: 8(float) Constant 3202351104 + 78: 15(fvec2) ConstantComposite 77 69 + 79: 8(float) Constant 1054867456 + 80: 15(fvec2) ConstantComposite 70 79 + 81: 15(fvec2) ConstantComposite 79 77 + 82: 65 ConstantComposite 68 71 73 75 76 78 80 81 + 84: TypePointer Function 65 + 89: 6(int) Constant 16 + 91: 18(int) Constant 16 + 92: TypeArray 15(fvec2) 91 + 93: 15(fvec2) ConstantComposite 66 66 + 94: 15(fvec2) ConstantComposite 69 67 + 95: 15(fvec2) ConstantComposite 67 52 + 96: 15(fvec2) ConstantComposite 32 69 + 97: 15(fvec2) ConstantComposite 74 47 + 98: 15(fvec2) ConstantComposite 52 72 + 99: 15(fvec2) ConstantComposite 72 70 + 100: 15(fvec2) ConstantComposite 70 74 + 101: 15(fvec2) ConstantComposite 47 50 + 102: 8(float) Constant 0 + 103: 15(fvec2) ConstantComposite 102 77 + 104: 15(fvec2) ConstantComposite 34 48 + 105: 15(fvec2) ConstantComposite 48 32 + 106: 8(float) Constant 3204448256 + 107: 15(fvec2) ConstantComposite 106 102 + 108: 15(fvec2) ConstantComposite 79 34 + 109: 15(fvec2) ConstantComposite 50 79 + 110: 15(fvec2) ConstantComposite 77 106 + 111: 92 ConstantComposite 93 94 95 96 97 98 99 100 101 103 104 105 107 108 109 110 + 113: TypePointer Function 92 + 117: 15(fvec2) ConstantComposite 102 102 + 118: TypeVector 28(bool) 2 + 129: TypeImage 8(float) 2D array multi-sampled sampled format:Unknown + 130: TypePointer UniformConstant 129 +131(g_tTex2dmsf4a): 130(ptr) Variable UniformConstant + 166: TypePointer Function 10(PS_OUTPUT) + 168: 6(int) Constant 0 + 169: 8(float) Constant 1065353216 + 170: 9(fvec4) ConstantComposite 169 169 169 169 + 171: TypePointer Function 9(fvec4) + 173: 6(int) Constant 1 + 174: TypePointer Function 8(float) + 180: TypePointer Input 6(int) + 181(sample): 180(ptr) Variable Input + 187: TypePointer Output 9(fvec4) +188(@entryPointOutput.Color): 187(ptr) Variable Output + 191: TypePointer Output 8(float) +192(@entryPointOutput.Depth): 191(ptr) Variable Output + 195: TypeSampler + 196: TypePointer UniformConstant 195 + 197(g_sSamp): 196(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 179(sample): 7(ptr) Variable Function +183(flattenTemp): 166(ptr) Variable Function + 184(param): 7(ptr) Variable Function + 182: 6(int) Load 181(sample) + Store 179(sample) 182 + 185: 6(int) Load 179(sample) + Store 184(param) 185 + 186:10(PS_OUTPUT) FunctionCall 13(@main(i1;) 184(param) + Store 183(flattenTemp) 186 + 189: 171(ptr) AccessChain 183(flattenTemp) 168 + 190: 9(fvec4) Load 189 + Store 188(@entryPointOutput.Color) 190 + 193: 174(ptr) AccessChain 183(flattenTemp) 173 + 194: 8(float) Load 193 + Store 192(@entryPointOutput.Depth) 194 + Return + FunctionEnd + 13(@main(i1;):10(PS_OUTPUT) Function None 11 + 12(sample): 7(ptr) FunctionParameter + 14: Label + 17(r00): 16(ptr) Variable Function +20(@sampleCount): 19(ptr) Variable Function + 39(indexable): 38(ptr) Variable Function + 58(indexable): 57(ptr) Variable Function + 85(indexable): 84(ptr) Variable Function + 114(indexable): 113(ptr) Variable Function + 127(r01): 16(ptr) Variable Function +128(@sampleCount): 19(ptr) Variable Function + 137(indexable): 38(ptr) Variable Function + 143(indexable): 57(ptr) Variable Function + 149(indexable): 84(ptr) Variable Function + 155(indexable): 113(ptr) Variable Function + 167(psout): 166(ptr) Variable Function + 24: 21 Load 23(g_tTex2dmsf4) + 25: 18(int) ImageQuerySamples 24 + Store 20(@sampleCount) 25 + 26: 18(int) Load 20(@sampleCount) + 29: 28(bool) IEqual 26 27 + 37: 6(int) Load 12(sample) + Store 39(indexable) 36 + 40: 16(ptr) AccessChain 39(indexable) 37 + 41: 15(fvec2) Load 40 + 42: 18(int) Load 20(@sampleCount) + 44: 28(bool) IEqual 42 43 + 56: 6(int) Load 12(sample) + Store 58(indexable) 55 + 59: 16(ptr) AccessChain 58(indexable) 56 + 60: 15(fvec2) Load 59 + 61: 18(int) Load 20(@sampleCount) + 63: 28(bool) IEqual 61 62 + 83: 6(int) Load 12(sample) + Store 85(indexable) 82 + 86: 16(ptr) AccessChain 85(indexable) 83 + 87: 15(fvec2) Load 86 + 88: 18(int) Load 20(@sampleCount) + 90: 28(bool) IEqual 88 89 + 112: 6(int) Load 12(sample) + Store 114(indexable) 111 + 115: 16(ptr) AccessChain 114(indexable) 112 + 116: 15(fvec2) Load 115 + 119: 118(bvec2) CompositeConstruct 90 90 + 120: 15(fvec2) Select 119 116 117 + 121: 118(bvec2) CompositeConstruct 63 63 + 122: 15(fvec2) Select 121 87 120 + 123: 118(bvec2) CompositeConstruct 44 44 + 124: 15(fvec2) Select 123 60 122 + 125: 118(bvec2) CompositeConstruct 29 29 + 126: 15(fvec2) Select 125 41 124 + Store 17(r00) 126 + 132: 129 Load 131(g_tTex2dmsf4a) + 133: 18(int) ImageQuerySamples 132 + Store 128(@sampleCount) 133 + 134: 18(int) Load 128(@sampleCount) + 135: 28(bool) IEqual 134 27 + 136: 6(int) Load 12(sample) + Store 137(indexable) 36 + 138: 16(ptr) AccessChain 137(indexable) 136 + 139: 15(fvec2) Load 138 + 140: 18(int) Load 128(@sampleCount) + 141: 28(bool) IEqual 140 43 + 142: 6(int) Load 12(sample) + Store 143(indexable) 55 + 144: 16(ptr) AccessChain 143(indexable) 142 + 145: 15(fvec2) Load 144 + 146: 18(int) Load 128(@sampleCount) + 147: 28(bool) IEqual 146 62 + 148: 6(int) Load 12(sample) + Store 149(indexable) 82 + 150: 16(ptr) AccessChain 149(indexable) 148 + 151: 15(fvec2) Load 150 + 152: 18(int) Load 128(@sampleCount) + 153: 28(bool) IEqual 152 89 + 154: 6(int) Load 12(sample) + Store 155(indexable) 111 + 156: 16(ptr) AccessChain 155(indexable) 154 + 157: 15(fvec2) Load 156 + 158: 118(bvec2) CompositeConstruct 153 153 + 159: 15(fvec2) Select 158 157 117 + 160: 118(bvec2) CompositeConstruct 147 147 + 161: 15(fvec2) Select 160 151 159 + 162: 118(bvec2) CompositeConstruct 141 141 + 163: 15(fvec2) Select 162 145 161 + 164: 118(bvec2) CompositeConstruct 135 135 + 165: 15(fvec2) Select 164 139 163 + Store 127(r01) 165 + 172: 171(ptr) AccessChain 167(psout) 168 + Store 172 170 + 175: 174(ptr) AccessChain 167(psout) 173 + Store 175 169 + 176:10(PS_OUTPUT) Load 167(psout) + ReturnValue 176 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.global-const-init.frag.out b/deps/glslang/Test/baseResults/hlsl.global-const-init.frag.out new file mode 100644 index 00000000..940f3be8 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.global-const-init.frag.out @@ -0,0 +1,178 @@ +hlsl.global-const-init.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:6 Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:6 'bar' ( global 4-component vector of float) +0:6 foo: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:6 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float foo}) +0:6 Constant: +0:6 0 (const uint) +0:8 Sequence +0:8 move second child to first child ( temp 2-element array of 2-component vector of float) +0:8 'a1' ( global 2-element array of 2-component vector of float) +0:8 Construct vec2 ( temp 2-element array of 2-component vector of float) +0:8 Constant: +0:8 1.000000 +0:8 2.000000 +0:8 Construct vec2 ( temp 2-component vector of float) +0:8 direct index ( temp float) +0:8 foo: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:8 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float foo}) +0:8 Constant: +0:8 0 (const uint) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 4.000000 +0:12 Function Definition: @main( ( temp 4-component vector of float) +0:12 Function Parameters: +0:? Sequence +0:13 Branch: Return with expression +0:13 'bar' ( global 4-component vector of float) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:12 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float foo}) +0:? 'bar' ( global 4-component vector of float) +0:? 'a1' ( global 2-element array of 2-component vector of float) +0:? 'a2' ( const 2-element array of 2-component vector of float) +0:? 5.000000 +0:? 6.000000 +0:? 7.000000 +0:? 8.000000 +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:6 Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:6 'bar' ( global 4-component vector of float) +0:6 foo: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:6 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float foo}) +0:6 Constant: +0:6 0 (const uint) +0:8 Sequence +0:8 move second child to first child ( temp 2-element array of 2-component vector of float) +0:8 'a1' ( global 2-element array of 2-component vector of float) +0:8 Construct vec2 ( temp 2-element array of 2-component vector of float) +0:8 Constant: +0:8 1.000000 +0:8 2.000000 +0:8 Construct vec2 ( temp 2-component vector of float) +0:8 direct index ( temp float) +0:8 foo: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:8 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float foo}) +0:8 Constant: +0:8 0 (const uint) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 4.000000 +0:12 Function Definition: @main( ( temp 4-component vector of float) +0:12 Function Parameters: +0:? Sequence +0:13 Branch: Return with expression +0:13 'bar' ( global 4-component vector of float) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:12 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float foo}) +0:? 'bar' ( global 4-component vector of float) +0:? 'a1' ( global 2-element array of 2-component vector of float) +0:? 'a2' ( const 2-element array of 2-component vector of float) +0:? 5.000000 +0:? 6.000000 +0:? 7.000000 +0:? 8.000000 +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 50 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 41 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 12 "bar" + Name 13 "CB" + MemberName 13(CB) 0 "foo" + Name 15 "" + Name 26 "a1" + Name 41 "@entryPointOutput" + MemberDecorate 13(CB) 0 Offset 0 + Decorate 13(CB) Block + Decorate 15 DescriptorSet 0 + Decorate 41(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypePointer Private 7(fvec4) + 12(bar): 11(ptr) Variable Private + 13(CB): TypeStruct 7(fvec4) + 14: TypePointer Uniform 13(CB) + 15: 14(ptr) Variable Uniform + 16: TypeInt 32 1 + 17: 16(int) Constant 0 + 18: TypePointer Uniform 7(fvec4) + 21: TypeVector 6(float) 2 + 22: TypeInt 32 0 + 23: 22(int) Constant 2 + 24: TypeArray 21(fvec2) 23 + 25: TypePointer Private 24 + 26(a1): 25(ptr) Variable Private + 27: 6(float) Constant 1065353216 + 28: 6(float) Constant 1073741824 + 29: 21(fvec2) ConstantComposite 27 28 + 30: 22(int) Constant 0 + 31: TypePointer Uniform 6(float) + 34: 6(float) Constant 1082130432 + 40: TypePointer Output 7(fvec4) +41(@entryPointOutput): 40(ptr) Variable Output + 43: 6(float) Constant 1084227584 + 44: 6(float) Constant 1086324736 + 45: 21(fvec2) ConstantComposite 43 44 + 46: 6(float) Constant 1088421888 + 47: 6(float) Constant 1090519040 + 48: 21(fvec2) ConstantComposite 46 47 + 49: 24 ConstantComposite 45 48 + 4(main): 2 Function None 3 + 5: Label + 19: 18(ptr) AccessChain 15 17 + 20: 7(fvec4) Load 19 + Store 12(bar) 20 + 32: 31(ptr) AccessChain 15 17 30 + 33: 6(float) Load 32 + 35: 21(fvec2) CompositeConstruct 33 34 + 36: 24 CompositeConstruct 29 35 + Store 26(a1) 36 + 42: 7(fvec4) FunctionCall 9(@main() + Store 41(@entryPointOutput) 42 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 37: 7(fvec4) Load 12(bar) + ReturnValue 37 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.groupid.comp.out b/deps/glslang/Test/baseResults/hlsl.groupid.comp.out new file mode 100644 index 00000000..386a3e97 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.groupid.comp.out @@ -0,0 +1,146 @@ +hlsl.groupid.comp +Shader version: 500 +local_size = (8, 8, 1) +0:? Sequence +0:7 Function Definition: @main(vu2; ( temp void) +0:7 Function Parameters: +0:7 'vGroupId' ( in 2-component vector of uint) +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'storeTemp' ( temp 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 0.000000 +0:? 0.000000 +0:? 1.000000 +0:8 imageStore ( temp void) +0:8 'OutputTexture' (layout( rgba32f) uniform image2D) +0:8 vector swizzle ( temp 2-component vector of uint) +0:8 'vGroupId' ( in 2-component vector of uint) +0:8 Sequence +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 'storeTemp' ( temp 4-component vector of float) +0:8 'storeTemp' ( temp 4-component vector of float) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp 2-component vector of uint) +0:? 'vGroupId' ( temp 2-component vector of uint) +0:? Construct uvec2 ( temp 2-component vector of uint) +0:? 'vGroupId' ( in 3-component vector of uint WorkGroupID) +0:7 Function Call: @main(vu2; ( temp void) +0:? 'vGroupId' ( temp 2-component vector of uint) +0:? Linker Objects +0:? 'OutputTexture' (layout( rgba32f) uniform image2D) +0:? 'vGroupId' ( in 3-component vector of uint WorkGroupID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (8, 8, 1) +0:? Sequence +0:7 Function Definition: @main(vu2; ( temp void) +0:7 Function Parameters: +0:7 'vGroupId' ( in 2-component vector of uint) +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'storeTemp' ( temp 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 0.000000 +0:? 0.000000 +0:? 1.000000 +0:8 imageStore ( temp void) +0:8 'OutputTexture' (layout( rgba32f) uniform image2D) +0:8 vector swizzle ( temp 2-component vector of uint) +0:8 'vGroupId' ( in 2-component vector of uint) +0:8 Sequence +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 'storeTemp' ( temp 4-component vector of float) +0:8 'storeTemp' ( temp 4-component vector of float) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp 2-component vector of uint) +0:? 'vGroupId' ( temp 2-component vector of uint) +0:? Construct uvec2 ( temp 2-component vector of uint) +0:? 'vGroupId' ( in 3-component vector of uint WorkGroupID) +0:7 Function Call: @main(vu2; ( temp void) +0:? 'vGroupId' ( temp 2-component vector of uint) +0:? Linker Objects +0:? 'OutputTexture' (layout( rgba32f) uniform image2D) +0:? 'vGroupId' ( in 3-component vector of uint WorkGroupID) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 37 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 29 + ExecutionMode 4 LocalSize 8 8 1 + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vu2;" + Name 10 "vGroupId" + Name 16 "storeTemp" + Name 22 "OutputTexture" + Name 26 "vGroupId" + Name 29 "vGroupId" + Name 34 "param" + Decorate 22(OutputTexture) DescriptorSet 0 + Decorate 29(vGroupId) BuiltIn WorkgroupId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 2 + 8: TypePointer Function 7(ivec2) + 9: TypeFunction 2 8(ptr) + 13: TypeFloat 32 + 14: TypeVector 13(float) 4 + 15: TypePointer Function 14(fvec4) + 17: 13(float) Constant 1065353216 + 18: 13(float) Constant 0 + 19: 14(fvec4) ConstantComposite 17 18 18 17 + 20: TypeImage 13(float) 2D nonsampled format:Rgba32f + 21: TypePointer UniformConstant 20 +22(OutputTexture): 21(ptr) Variable UniformConstant + 27: TypeVector 6(int) 3 + 28: TypePointer Input 27(ivec3) + 29(vGroupId): 28(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 26(vGroupId): 8(ptr) Variable Function + 34(param): 8(ptr) Variable Function + 30: 27(ivec3) Load 29(vGroupId) + 31: 6(int) CompositeExtract 30 0 + 32: 6(int) CompositeExtract 30 1 + 33: 7(ivec2) CompositeConstruct 31 32 + Store 26(vGroupId) 33 + 35: 7(ivec2) Load 26(vGroupId) + Store 34(param) 35 + 36: 2 FunctionCall 11(@main(vu2;) 34(param) + Return + FunctionEnd + 11(@main(vu2;): 2 Function None 9 + 10(vGroupId): 8(ptr) FunctionParameter + 12: Label + 16(storeTemp): 15(ptr) Variable Function + Store 16(storeTemp) 19 + 23: 20 Load 22(OutputTexture) + 24: 7(ivec2) Load 10(vGroupId) + 25: 14(fvec4) Load 16(storeTemp) + ImageWrite 23 24 25 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.gs-hs-mix.tesc.out b/deps/glslang/Test/baseResults/hlsl.gs-hs-mix.tesc.out new file mode 100644 index 00000000..4971371a --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.gs-hs-mix.tesc.out @@ -0,0 +1,1158 @@ +hlsl.gs-hs-mix.tesc +Shader version: 500 +vertices = 3 +input primitive = triangles +vertex spacing = fractional_odd_spacing +triangle order = ccw +0:? Sequence +0:31 Function Definition: HSPatchConstant(struct-HSInput-vf3-vf31[3]; ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:31 Function Parameters: +0:31 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? Sequence +0:32 Sequence +0:32 move second child to first child ( temp 3-component vector of float) +0:32 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:32 tess_factor: direct index for structure (layout( row_major std140) uniform 3-component vector of float) +0:32 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:32 Constant: +0:32 6 (const uint) +0:33 Sequence +0:33 move second child to first child ( temp float) +0:33 'roundedInsideTessFactor' ( temp float) +0:33 Constant: +0:33 3.000000 +0:34 Sequence +0:34 move second child to first child ( temp float) +0:34 'insideTessFactor' ( temp float) +0:34 Constant: +0:34 1.000000 +0:39 move second child to first child ( temp float) +0:39 direct index ( temp float) +0:39 EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:39 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 0 (const int) +0:39 direct index ( temp float) +0:39 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:39 Constant: +0:39 0 (const int) +0:40 move second child to first child ( temp float) +0:40 direct index ( temp float) +0:40 EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:40 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 direct index ( temp float) +0:40 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:40 Constant: +0:40 1 (const int) +0:41 move second child to first child ( temp float) +0:41 direct index ( temp float) +0:41 EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:41 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 2 (const int) +0:41 direct index ( temp float) +0:41 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:41 Constant: +0:41 2 (const int) +0:42 move second child to first child ( temp float) +0:42 InsideTessFactor: direct index for structure ( temp float) +0:42 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:42 Constant: +0:42 1 (const int) +0:42 'roundedInsideTessFactor' ( temp float) +0:45 move second child to first child ( temp 3-component vector of float) +0:45 direct index ( temp 3-component vector of float) +0:45 NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:45 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 NormalWS: direct index for structure ( temp 3-component vector of float) +0:45 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:45 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 1 (const int) +0:46 move second child to first child ( temp 3-component vector of float) +0:46 direct index ( temp 3-component vector of float) +0:46 NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:46 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:46 Constant: +0:46 2 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 NormalWS: direct index for structure ( temp 3-component vector of float) +0:46 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:46 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 1 (const int) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 direct index ( temp 3-component vector of float) +0:47 NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:47 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:47 Constant: +0:47 2 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 NormalWS: direct index for structure ( temp 3-component vector of float) +0:47 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:47 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:47 Constant: +0:47 2 (const int) +0:47 Constant: +0:47 1 (const int) +0:49 Branch: Return with expression +0:49 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:61 Function Definition: @HSMain(struct-HSInput-vf3-vf31[3];u1; ( temp structure{ temp 3-component vector of float PositionWS}) +0:61 Function Parameters: +0:61 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:61 'id' ( in uint) +0:? Sequence +0:63 move second child to first child ( temp 3-component vector of float) +0:63 PositionWS: direct index for structure ( temp 3-component vector of float) +0:63 'output' ( temp structure{ temp 3-component vector of float PositionWS}) +0:63 Constant: +0:63 0 (const int) +0:63 PositionWS: direct index for structure ( temp 3-component vector of float) +0:63 indirect index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:63 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:63 'id' ( in uint) +0:63 Constant: +0:63 0 (const int) +0:64 Branch: Return with expression +0:64 'output' ( temp structure{ temp 3-component vector of float PositionWS}) +0:61 Function Definition: HSMain( ( temp void) +0:61 Function Parameters: +0:? Sequence +0:61 move second child to first child ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'patch' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:61 move second child to first child ( temp uint) +0:? 'id' ( temp uint) +0:? 'id' ( in uint InvocationID) +0:61 move second child to first child ( temp structure{ temp 3-component vector of float PositionWS}) +0:61 indirect index (layout( location=0) out structure{ temp 3-component vector of float PositionWS}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float PositionWS}) +0:? 'id' ( in uint InvocationID) +0:61 Function Call: @HSMain(struct-HSInput-vf3-vf31[3];u1; ( temp structure{ temp 3-component vector of float PositionWS}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'id' ( temp uint) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'id' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Function Call: HSPatchConstant(struct-HSInput-vf3-vf31[3]; ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 2 (const int) +0:? direct index ( temp float) +0:? EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 2 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelInner) +0:? '@patchConstantOutput.InsideTessFactor' ( patch out 2-element array of float TessLevelInner) +0:? Constant: +0:? 0 (const int) +0:? InsideTessFactor: direct index for structure ( temp float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp 3-element array of 3-component vector of float) +0:? NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:? '@patchConstantOutput' (layout( location=1) patch out structure{ temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 2 (const int) +0:84 Function Definition: GSMain(struct-GSVertexInput-vf3-vf31[3];struct-GSVertexOutput-vf41; ( temp void) +0:84 Function Parameters: +0:84 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:84 'output' ( out structure{ temp 4-component vector of float PositionCS}) +0:? Sequence +0:86 Sequence +0:86 move second child to first child ( temp 3-component vector of float) +0:86 'P0' ( temp 3-component vector of float) +0:86 vector swizzle ( temp 3-component vector of float) +0:86 PositionWS: direct index for structure ( temp 3-component vector of float) +0:86 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:86 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 0 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:86 Constant: +0:86 2 (const int) +0:87 Sequence +0:87 move second child to first child ( temp 3-component vector of float) +0:87 'P1' ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 PositionWS: direct index for structure ( temp 3-component vector of float) +0:87 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:87 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 0 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:88 Sequence +0:88 move second child to first child ( temp 3-component vector of float) +0:88 'P2' ( temp 3-component vector of float) +0:88 vector swizzle ( temp 3-component vector of float) +0:88 PositionWS: direct index for structure ( temp 3-component vector of float) +0:88 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:88 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:88 Constant: +0:88 2 (const int) +0:88 Constant: +0:88 0 (const int) +0:88 Sequence +0:88 Constant: +0:88 0 (const int) +0:88 Constant: +0:88 1 (const int) +0:88 Constant: +0:88 2 (const int) +0:92 add second child into first child ( temp float) +0:92 direct index ( temp float) +0:92 'P0' ( temp 3-component vector of float) +0:92 Constant: +0:92 2 (const int) +0:92 Constant: +0:92 0.001000 +0:93 add second child into first child ( temp float) +0:93 direct index ( temp float) +0:93 'P1' ( temp 3-component vector of float) +0:93 Constant: +0:93 2 (const int) +0:93 Constant: +0:93 0.001000 +0:94 add second child into first child ( temp float) +0:94 direct index ( temp float) +0:94 'P2' ( temp 3-component vector of float) +0:94 Constant: +0:94 2 (const int) +0:94 Constant: +0:94 0.001000 +0:95 Sequence +0:95 move second child to first child ( temp 4-component vector of float) +0:95 'Q0' ( temp 4-component vector of float) +0:95 vector-times-matrix ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:95 'P0' ( temp 3-component vector of float) +0:95 Constant: +0:95 1.000000 +0:95 proj_matrix: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:95 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:95 Constant: +0:95 1 (const uint) +0:96 Sequence +0:96 move second child to first child ( temp 4-component vector of float) +0:96 'Q1' ( temp 4-component vector of float) +0:96 vector-times-matrix ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:96 'P1' ( temp 3-component vector of float) +0:96 Constant: +0:96 1.000000 +0:96 proj_matrix: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:96 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:96 Constant: +0:96 1 (const uint) +0:97 Sequence +0:97 move second child to first child ( temp 4-component vector of float) +0:97 'Q2' ( temp 4-component vector of float) +0:97 vector-times-matrix ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:97 'P2' ( temp 3-component vector of float) +0:97 Constant: +0:97 1.000000 +0:97 proj_matrix: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:97 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:97 Constant: +0:97 1 (const uint) +0:100 move second child to first child ( temp 4-component vector of float) +0:100 PositionCS: direct index for structure ( temp 4-component vector of float) +0:100 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:100 Constant: +0:100 0 (const int) +0:100 'Q0' ( temp 4-component vector of float) +0:101 Constant: +0:101 0.000000 +0:102 move second child to first child ( temp 4-component vector of float) +0:102 PositionCS: direct index for structure ( temp 4-component vector of float) +0:102 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:102 Constant: +0:102 0 (const int) +0:102 'Q1' ( temp 4-component vector of float) +0:103 Constant: +0:103 0.000000 +0:104 Constant: +0:104 0.000000 +0:107 move second child to first child ( temp 4-component vector of float) +0:107 PositionCS: direct index for structure ( temp 4-component vector of float) +0:107 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:107 Constant: +0:107 0 (const int) +0:107 'Q1' ( temp 4-component vector of float) +0:108 Constant: +0:108 0.000000 +0:109 move second child to first child ( temp 4-component vector of float) +0:109 PositionCS: direct index for structure ( temp 4-component vector of float) +0:109 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:109 Constant: +0:109 0 (const int) +0:109 'Q2' ( temp 4-component vector of float) +0:110 Constant: +0:110 0.000000 +0:111 Constant: +0:111 0.000000 +0:114 move second child to first child ( temp 4-component vector of float) +0:114 PositionCS: direct index for structure ( temp 4-component vector of float) +0:114 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:114 Constant: +0:114 0 (const int) +0:114 'Q2' ( temp 4-component vector of float) +0:115 Constant: +0:115 0.000000 +0:116 move second child to first child ( temp 4-component vector of float) +0:116 PositionCS: direct index for structure ( temp 4-component vector of float) +0:116 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:116 Constant: +0:116 0 (const int) +0:116 'Q0' ( temp 4-component vector of float) +0:117 Constant: +0:117 0.000000 +0:118 Constant: +0:118 0.000000 +0:? Linker Objects +0:? 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float PositionWS}) +0:? 'patch' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'id' ( in uint InvocationID) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? '@patchConstantOutput.InsideTessFactor' ( patch out 2-element array of float TessLevelInner) +0:? '@patchConstantOutput' (layout( location=1) patch out structure{ temp 3-element array of 3-component vector of float NormalWS}) + + +Linked tessellation control stage: + + +Shader version: 500 +vertices = 3 +input primitive = triangles +vertex spacing = fractional_odd_spacing +triangle order = ccw +0:? Sequence +0:31 Function Definition: HSPatchConstant(struct-HSInput-vf3-vf31[3]; ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:31 Function Parameters: +0:31 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? Sequence +0:32 Sequence +0:32 move second child to first child ( temp 3-component vector of float) +0:32 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:32 tess_factor: direct index for structure (layout( row_major std140) uniform 3-component vector of float) +0:32 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:32 Constant: +0:32 6 (const uint) +0:33 Sequence +0:33 move second child to first child ( temp float) +0:33 'roundedInsideTessFactor' ( temp float) +0:33 Constant: +0:33 3.000000 +0:34 Sequence +0:34 move second child to first child ( temp float) +0:34 'insideTessFactor' ( temp float) +0:34 Constant: +0:34 1.000000 +0:39 move second child to first child ( temp float) +0:39 direct index ( temp float) +0:39 EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:39 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 0 (const int) +0:39 direct index ( temp float) +0:39 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:39 Constant: +0:39 0 (const int) +0:40 move second child to first child ( temp float) +0:40 direct index ( temp float) +0:40 EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:40 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 direct index ( temp float) +0:40 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:40 Constant: +0:40 1 (const int) +0:41 move second child to first child ( temp float) +0:41 direct index ( temp float) +0:41 EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:41 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 2 (const int) +0:41 direct index ( temp float) +0:41 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:41 Constant: +0:41 2 (const int) +0:42 move second child to first child ( temp float) +0:42 InsideTessFactor: direct index for structure ( temp float) +0:42 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:42 Constant: +0:42 1 (const int) +0:42 'roundedInsideTessFactor' ( temp float) +0:45 move second child to first child ( temp 3-component vector of float) +0:45 direct index ( temp 3-component vector of float) +0:45 NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:45 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 NormalWS: direct index for structure ( temp 3-component vector of float) +0:45 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:45 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 1 (const int) +0:46 move second child to first child ( temp 3-component vector of float) +0:46 direct index ( temp 3-component vector of float) +0:46 NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:46 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:46 Constant: +0:46 2 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 NormalWS: direct index for structure ( temp 3-component vector of float) +0:46 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:46 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 1 (const int) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 direct index ( temp 3-component vector of float) +0:47 NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:47 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:47 Constant: +0:47 2 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 NormalWS: direct index for structure ( temp 3-component vector of float) +0:47 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:47 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:47 Constant: +0:47 2 (const int) +0:47 Constant: +0:47 1 (const int) +0:49 Branch: Return with expression +0:49 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:61 Function Definition: @HSMain(struct-HSInput-vf3-vf31[3];u1; ( temp structure{ temp 3-component vector of float PositionWS}) +0:61 Function Parameters: +0:61 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:61 'id' ( in uint) +0:? Sequence +0:63 move second child to first child ( temp 3-component vector of float) +0:63 PositionWS: direct index for structure ( temp 3-component vector of float) +0:63 'output' ( temp structure{ temp 3-component vector of float PositionWS}) +0:63 Constant: +0:63 0 (const int) +0:63 PositionWS: direct index for structure ( temp 3-component vector of float) +0:63 indirect index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:63 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:63 'id' ( in uint) +0:63 Constant: +0:63 0 (const int) +0:64 Branch: Return with expression +0:64 'output' ( temp structure{ temp 3-component vector of float PositionWS}) +0:61 Function Definition: HSMain( ( temp void) +0:61 Function Parameters: +0:? Sequence +0:61 move second child to first child ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'patch' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:61 move second child to first child ( temp uint) +0:? 'id' ( temp uint) +0:? 'id' ( in uint InvocationID) +0:61 move second child to first child ( temp structure{ temp 3-component vector of float PositionWS}) +0:61 indirect index (layout( location=0) out structure{ temp 3-component vector of float PositionWS}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float PositionWS}) +0:? 'id' ( in uint InvocationID) +0:61 Function Call: @HSMain(struct-HSInput-vf3-vf31[3];u1; ( temp structure{ temp 3-component vector of float PositionWS}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'id' ( temp uint) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'id' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Function Call: HSPatchConstant(struct-HSInput-vf3-vf31[3]; ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 2 (const int) +0:? direct index ( temp float) +0:? EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 2 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelInner) +0:? '@patchConstantOutput.InsideTessFactor' ( patch out 2-element array of float TessLevelInner) +0:? Constant: +0:? 0 (const int) +0:? InsideTessFactor: direct index for structure ( temp float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp 3-element array of 3-component vector of float) +0:? NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:? '@patchConstantOutput' (layout( location=1) patch out structure{ temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 2 (const int) +0:84 Function Definition: GSMain(struct-GSVertexInput-vf3-vf31[3];struct-GSVertexOutput-vf41; ( temp void) +0:84 Function Parameters: +0:84 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:84 'output' ( out structure{ temp 4-component vector of float PositionCS}) +0:? Sequence +0:86 Sequence +0:86 move second child to first child ( temp 3-component vector of float) +0:86 'P0' ( temp 3-component vector of float) +0:86 vector swizzle ( temp 3-component vector of float) +0:86 PositionWS: direct index for structure ( temp 3-component vector of float) +0:86 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:86 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 0 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:86 Constant: +0:86 2 (const int) +0:87 Sequence +0:87 move second child to first child ( temp 3-component vector of float) +0:87 'P1' ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 PositionWS: direct index for structure ( temp 3-component vector of float) +0:87 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:87 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 0 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:88 Sequence +0:88 move second child to first child ( temp 3-component vector of float) +0:88 'P2' ( temp 3-component vector of float) +0:88 vector swizzle ( temp 3-component vector of float) +0:88 PositionWS: direct index for structure ( temp 3-component vector of float) +0:88 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:88 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:88 Constant: +0:88 2 (const int) +0:88 Constant: +0:88 0 (const int) +0:88 Sequence +0:88 Constant: +0:88 0 (const int) +0:88 Constant: +0:88 1 (const int) +0:88 Constant: +0:88 2 (const int) +0:92 add second child into first child ( temp float) +0:92 direct index ( temp float) +0:92 'P0' ( temp 3-component vector of float) +0:92 Constant: +0:92 2 (const int) +0:92 Constant: +0:92 0.001000 +0:93 add second child into first child ( temp float) +0:93 direct index ( temp float) +0:93 'P1' ( temp 3-component vector of float) +0:93 Constant: +0:93 2 (const int) +0:93 Constant: +0:93 0.001000 +0:94 add second child into first child ( temp float) +0:94 direct index ( temp float) +0:94 'P2' ( temp 3-component vector of float) +0:94 Constant: +0:94 2 (const int) +0:94 Constant: +0:94 0.001000 +0:95 Sequence +0:95 move second child to first child ( temp 4-component vector of float) +0:95 'Q0' ( temp 4-component vector of float) +0:95 vector-times-matrix ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:95 'P0' ( temp 3-component vector of float) +0:95 Constant: +0:95 1.000000 +0:95 proj_matrix: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:95 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:95 Constant: +0:95 1 (const uint) +0:96 Sequence +0:96 move second child to first child ( temp 4-component vector of float) +0:96 'Q1' ( temp 4-component vector of float) +0:96 vector-times-matrix ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:96 'P1' ( temp 3-component vector of float) +0:96 Constant: +0:96 1.000000 +0:96 proj_matrix: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:96 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:96 Constant: +0:96 1 (const uint) +0:97 Sequence +0:97 move second child to first child ( temp 4-component vector of float) +0:97 'Q2' ( temp 4-component vector of float) +0:97 vector-times-matrix ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:97 'P2' ( temp 3-component vector of float) +0:97 Constant: +0:97 1.000000 +0:97 proj_matrix: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:97 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:97 Constant: +0:97 1 (const uint) +0:100 move second child to first child ( temp 4-component vector of float) +0:100 PositionCS: direct index for structure ( temp 4-component vector of float) +0:100 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:100 Constant: +0:100 0 (const int) +0:100 'Q0' ( temp 4-component vector of float) +0:101 Constant: +0:101 0.000000 +0:102 move second child to first child ( temp 4-component vector of float) +0:102 PositionCS: direct index for structure ( temp 4-component vector of float) +0:102 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:102 Constant: +0:102 0 (const int) +0:102 'Q1' ( temp 4-component vector of float) +0:103 Constant: +0:103 0.000000 +0:104 Constant: +0:104 0.000000 +0:107 move second child to first child ( temp 4-component vector of float) +0:107 PositionCS: direct index for structure ( temp 4-component vector of float) +0:107 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:107 Constant: +0:107 0 (const int) +0:107 'Q1' ( temp 4-component vector of float) +0:108 Constant: +0:108 0.000000 +0:109 move second child to first child ( temp 4-component vector of float) +0:109 PositionCS: direct index for structure ( temp 4-component vector of float) +0:109 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:109 Constant: +0:109 0 (const int) +0:109 'Q2' ( temp 4-component vector of float) +0:110 Constant: +0:110 0.000000 +0:111 Constant: +0:111 0.000000 +0:114 move second child to first child ( temp 4-component vector of float) +0:114 PositionCS: direct index for structure ( temp 4-component vector of float) +0:114 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:114 Constant: +0:114 0 (const int) +0:114 'Q2' ( temp 4-component vector of float) +0:115 Constant: +0:115 0.000000 +0:116 move second child to first child ( temp 4-component vector of float) +0:116 PositionCS: direct index for structure ( temp 4-component vector of float) +0:116 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:116 Constant: +0:116 0 (const int) +0:116 'Q0' ( temp 4-component vector of float) +0:117 Constant: +0:117 0.000000 +0:118 Constant: +0:118 0.000000 +0:? Linker Objects +0:? 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float PositionWS}) +0:? 'patch' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'id' ( in uint InvocationID) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? '@patchConstantOutput.InsideTessFactor' ( patch out 2-element array of float TessLevelInner) +0:? '@patchConstantOutput' (layout( location=1) patch out structure{ temp 3-element array of 3-component vector of float NormalWS}) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 216 + + Capability Tessellation + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "HSMain" 97 101 105 126 139 145 + ExecutionMode 4 OutputVertices 3 + ExecutionMode 4 Triangles + ExecutionMode 4 SpacingFractionalOdd + ExecutionMode 4 VertexOrderCcw + Source HLSL 500 + Name 4 "HSMain" + Name 8 "HSInput" + MemberName 8(HSInput) 0 "PositionWS" + MemberName 8(HSInput) 1 "NormalWS" + Name 15 "HSTrianglePatchConstant" + MemberName 15(HSTrianglePatchConstant) 0 "EdgeTessFactor" + MemberName 15(HSTrianglePatchConstant) 1 "InsideTessFactor" + MemberName 15(HSTrianglePatchConstant) 2 "NormalWS" + Name 18 "HSPatchConstant(struct-HSInput-vf3-vf31[3];" + Name 17 "patch" + Name 21 "HSOutput" + MemberName 21(HSOutput) 0 "PositionWS" + Name 25 "@HSMain(struct-HSInput-vf3-vf31[3];u1;" + Name 23 "patch" + Name 24 "id" + Name 27 "GSVertexInput" + MemberName 27(GSVertexInput) 0 "PositionWS" + MemberName 27(GSVertexInput) 1 "NormalWS" + Name 31 "GSVertexOutput" + MemberName 31(GSVertexOutput) 0 "PositionCS" + Name 36 "GSMain(struct-GSVertexInput-vf3-vf31[3];struct-GSVertexOutput-vf41;" + Name 34 "input" + Name 35 "output" + Name 39 "roundedEdgeTessFactor" + Name 42 "UniformBlock0" + MemberName 42(UniformBlock0) 0 "model_view_matrix" + MemberName 42(UniformBlock0) 1 "proj_matrix" + MemberName 42(UniformBlock0) 2 "model_view_proj_matrix" + MemberName 42(UniformBlock0) 3 "normal_matrix" + MemberName 42(UniformBlock0) 4 "color" + MemberName 42(UniformBlock0) 5 "view_dir" + MemberName 42(UniformBlock0) 6 "tess_factor" + Name 44 "" + Name 51 "roundedInsideTessFactor" + Name 53 "insideTessFactor" + Name 56 "result" + Name 87 "output" + Name 95 "patch" + Name 97 "patch" + Name 99 "id" + Name 101 "id" + Name 105 "@entryPointOutput" + Name 107 "param" + Name 109 "param" + Name 120 "@patchConstantResult" + Name 121 "param" + Name 126 "@patchConstantOutput.EdgeTessFactor" + Name 139 "@patchConstantOutput.InsideTessFactor" + Name 143 "HSTrianglePatchConstant" + MemberName 143(HSTrianglePatchConstant) 0 "NormalWS" + Name 145 "@patchConstantOutput" + Name 151 "P0" + Name 154 "P1" + Name 157 "P2" + Name 174 "Q0" + Name 184 "Q1" + Name 193 "Q2" + Name 202 "vertex" + MemberDecorate 42(UniformBlock0) 0 RowMajor + MemberDecorate 42(UniformBlock0) 0 Offset 0 + MemberDecorate 42(UniformBlock0) 0 MatrixStride 16 + MemberDecorate 42(UniformBlock0) 1 RowMajor + MemberDecorate 42(UniformBlock0) 1 Offset 64 + MemberDecorate 42(UniformBlock0) 1 MatrixStride 16 + MemberDecorate 42(UniformBlock0) 2 RowMajor + MemberDecorate 42(UniformBlock0) 2 Offset 128 + MemberDecorate 42(UniformBlock0) 2 MatrixStride 16 + MemberDecorate 42(UniformBlock0) 3 RowMajor + MemberDecorate 42(UniformBlock0) 3 Offset 192 + MemberDecorate 42(UniformBlock0) 3 MatrixStride 16 + MemberDecorate 42(UniformBlock0) 4 Offset 240 + MemberDecorate 42(UniformBlock0) 5 Offset 256 + MemberDecorate 42(UniformBlock0) 6 Offset 272 + Decorate 42(UniformBlock0) Block + Decorate 44 DescriptorSet 0 + Decorate 44 Binding 0 + Decorate 97(patch) Location 0 + Decorate 101(id) BuiltIn InvocationId + Decorate 105(@entryPointOutput) Location 0 + Decorate 126(@patchConstantOutput.EdgeTessFactor) Patch + Decorate 126(@patchConstantOutput.EdgeTessFactor) BuiltIn TessLevelOuter + Decorate 139(@patchConstantOutput.InsideTessFactor) Patch + Decorate 139(@patchConstantOutput.InsideTessFactor) BuiltIn TessLevelInner + MemberDecorate 143(HSTrianglePatchConstant) 0 Patch + Decorate 145(@patchConstantOutput) Patch + Decorate 145(@patchConstantOutput) Location 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8(HSInput): TypeStruct 7(fvec3) 7(fvec3) + 9: TypeInt 32 0 + 10: 9(int) Constant 3 + 11: TypeArray 8(HSInput) 10 + 12: TypePointer Function 11 + 13: TypeArray 6(float) 10 + 14: TypeArray 7(fvec3) 10 +15(HSTrianglePatchConstant): TypeStruct 13 6(float) 14 + 16: TypeFunction 15(HSTrianglePatchConstant) 12(ptr) + 20: TypePointer Function 9(int) + 21(HSOutput): TypeStruct 7(fvec3) + 22: TypeFunction 21(HSOutput) 12(ptr) 20(ptr) +27(GSVertexInput): TypeStruct 7(fvec3) 7(fvec3) + 28: TypeArray 27(GSVertexInput) 10 + 29: TypePointer Function 28 + 30: TypeVector 6(float) 4 +31(GSVertexOutput): TypeStruct 30(fvec4) + 32: TypePointer Function 31(GSVertexOutput) + 33: TypeFunction 2 29(ptr) 32(ptr) + 38: TypePointer Function 7(fvec3) + 40: TypeMatrix 30(fvec4) 4 + 41: TypeMatrix 7(fvec3) 3 +42(UniformBlock0): TypeStruct 40 40 40 41 7(fvec3) 7(fvec3) 7(fvec3) + 43: TypePointer Uniform 42(UniformBlock0) + 44: 43(ptr) Variable Uniform + 45: TypeInt 32 1 + 46: 45(int) Constant 6 + 47: TypePointer Uniform 7(fvec3) + 50: TypePointer Function 6(float) + 52: 6(float) Constant 1077936128 + 54: 6(float) Constant 1065353216 + 55: TypePointer Function 15(HSTrianglePatchConstant) + 57: 45(int) Constant 0 + 58: 9(int) Constant 0 + 62: 45(int) Constant 1 + 63: 9(int) Constant 1 + 67: 45(int) Constant 2 + 68: 9(int) Constant 2 + 86: TypePointer Function 21(HSOutput) + 96: TypePointer Input 11 + 97(patch): 96(ptr) Variable Input + 100: TypePointer Input 9(int) + 101(id): 100(ptr) Variable Input + 103: TypeArray 21(HSOutput) 10 + 104: TypePointer Output 103 +105(@entryPointOutput): 104(ptr) Variable Output + 112: TypePointer Output 21(HSOutput) + 114: 9(int) Constant 4 + 116: TypeBool + 124: TypeArray 6(float) 114 + 125: TypePointer Output 124 +126(@patchConstantOutput.EdgeTessFactor): 125(ptr) Variable Output + 129: TypePointer Output 6(float) + 137: TypeArray 6(float) 68 + 138: TypePointer Output 137 +139(@patchConstantOutput.InsideTessFactor): 138(ptr) Variable Output +143(HSTrianglePatchConstant): TypeStruct 14 + 144: TypePointer Output 143(HSTrianglePatchConstant) +145(@patchConstantOutput): 144(ptr) Variable Output + 146: TypePointer Function 14 + 149: TypePointer Output 14 + 160: 6(float) Constant 981668463 + 173: TypePointer Function 30(fvec4) + 180: TypePointer Uniform 40 + 205: 6(float) Constant 0 + 4(HSMain): 2 Function None 3 + 5: Label + 95(patch): 12(ptr) Variable Function + 99(id): 20(ptr) Variable Function + 107(param): 12(ptr) Variable Function + 109(param): 20(ptr) Variable Function +120(@patchConstantResult): 55(ptr) Variable Function + 121(param): 12(ptr) Variable Function + 98: 11 Load 97(patch) + Store 95(patch) 98 + 102: 9(int) Load 101(id) + Store 99(id) 102 + 106: 9(int) Load 101(id) + 108: 11 Load 95(patch) + Store 107(param) 108 + 110: 9(int) Load 99(id) + Store 109(param) 110 + 111:21(HSOutput) FunctionCall 25(@HSMain(struct-HSInput-vf3-vf31[3];u1;) 107(param) 109(param) + 113: 112(ptr) AccessChain 105(@entryPointOutput) 106 + Store 113 111 + ControlBarrier 68 114 58 + 115: 9(int) Load 101(id) + 117: 116(bool) IEqual 115 57 + SelectionMerge 119 None + BranchConditional 117 118 119 + 118: Label + 122: 11 Load 95(patch) + Store 121(param) 122 + 123:15(HSTrianglePatchConstant) FunctionCall 18(HSPatchConstant(struct-HSInput-vf3-vf31[3];) 121(param) + Store 120(@patchConstantResult) 123 + 127: 50(ptr) AccessChain 120(@patchConstantResult) 57 57 + 128: 6(float) Load 127 + 130: 129(ptr) AccessChain 126(@patchConstantOutput.EdgeTessFactor) 57 + Store 130 128 + 131: 50(ptr) AccessChain 120(@patchConstantResult) 57 62 + 132: 6(float) Load 131 + 133: 129(ptr) AccessChain 126(@patchConstantOutput.EdgeTessFactor) 62 + Store 133 132 + 134: 50(ptr) AccessChain 120(@patchConstantResult) 57 67 + 135: 6(float) Load 134 + 136: 129(ptr) AccessChain 126(@patchConstantOutput.EdgeTessFactor) 67 + Store 136 135 + 140: 50(ptr) AccessChain 120(@patchConstantResult) 62 + 141: 6(float) Load 140 + 142: 129(ptr) AccessChain 139(@patchConstantOutput.InsideTessFactor) 57 + Store 142 141 + 147: 146(ptr) AccessChain 120(@patchConstantResult) 67 + 148: 14 Load 147 + 150: 149(ptr) AccessChain 145(@patchConstantOutput) 57 + Store 150 148 + Branch 119 + 119: Label + Return + FunctionEnd +18(HSPatchConstant(struct-HSInput-vf3-vf31[3];):15(HSTrianglePatchConstant) Function None 16 + 17(patch): 12(ptr) FunctionParameter + 19: Label +39(roundedEdgeTessFactor): 38(ptr) Variable Function +51(roundedInsideTessFactor): 50(ptr) Variable Function +53(insideTessFactor): 50(ptr) Variable Function + 56(result): 55(ptr) Variable Function + 48: 47(ptr) AccessChain 44 46 + 49: 7(fvec3) Load 48 + Store 39(roundedEdgeTessFactor) 49 + Store 51(roundedInsideTessFactor) 52 + Store 53(insideTessFactor) 54 + 59: 50(ptr) AccessChain 39(roundedEdgeTessFactor) 58 + 60: 6(float) Load 59 + 61: 50(ptr) AccessChain 56(result) 57 57 + Store 61 60 + 64: 50(ptr) AccessChain 39(roundedEdgeTessFactor) 63 + 65: 6(float) Load 64 + 66: 50(ptr) AccessChain 56(result) 57 62 + Store 66 65 + 69: 50(ptr) AccessChain 39(roundedEdgeTessFactor) 68 + 70: 6(float) Load 69 + 71: 50(ptr) AccessChain 56(result) 57 67 + Store 71 70 + 72: 6(float) Load 51(roundedInsideTessFactor) + 73: 50(ptr) AccessChain 56(result) 62 + Store 73 72 + 74: 38(ptr) AccessChain 17(patch) 57 62 + 75: 7(fvec3) Load 74 + 76: 38(ptr) AccessChain 56(result) 67 57 + Store 76 75 + 77: 38(ptr) AccessChain 17(patch) 62 62 + 78: 7(fvec3) Load 77 + 79: 38(ptr) AccessChain 56(result) 67 62 + Store 79 78 + 80: 38(ptr) AccessChain 17(patch) 67 62 + 81: 7(fvec3) Load 80 + 82: 38(ptr) AccessChain 56(result) 67 67 + Store 82 81 + 83:15(HSTrianglePatchConstant) Load 56(result) + ReturnValue 83 + FunctionEnd +25(@HSMain(struct-HSInput-vf3-vf31[3];u1;):21(HSOutput) Function None 22 + 23(patch): 12(ptr) FunctionParameter + 24(id): 20(ptr) FunctionParameter + 26: Label + 87(output): 86(ptr) Variable Function + 88: 9(int) Load 24(id) + 89: 38(ptr) AccessChain 23(patch) 88 57 + 90: 7(fvec3) Load 89 + 91: 38(ptr) AccessChain 87(output) 57 + Store 91 90 + 92:21(HSOutput) Load 87(output) + ReturnValue 92 + FunctionEnd +36(GSMain(struct-GSVertexInput-vf3-vf31[3];struct-GSVertexOutput-vf41;): 2 Function None 33 + 34(input): 29(ptr) FunctionParameter + 35(output): 32(ptr) FunctionParameter + 37: Label + 151(P0): 38(ptr) Variable Function + 154(P1): 38(ptr) Variable Function + 157(P2): 38(ptr) Variable Function + 174(Q0): 173(ptr) Variable Function + 184(Q1): 173(ptr) Variable Function + 193(Q2): 173(ptr) Variable Function + 202(vertex): 32(ptr) Variable Function + 152: 38(ptr) AccessChain 34(input) 57 57 + 153: 7(fvec3) Load 152 + Store 151(P0) 153 + 155: 38(ptr) AccessChain 34(input) 62 57 + 156: 7(fvec3) Load 155 + Store 154(P1) 156 + 158: 38(ptr) AccessChain 34(input) 67 57 + 159: 7(fvec3) Load 158 + Store 157(P2) 159 + 161: 50(ptr) AccessChain 151(P0) 68 + 162: 6(float) Load 161 + 163: 6(float) FAdd 162 160 + 164: 50(ptr) AccessChain 151(P0) 68 + Store 164 163 + 165: 50(ptr) AccessChain 154(P1) 68 + 166: 6(float) Load 165 + 167: 6(float) FAdd 166 160 + 168: 50(ptr) AccessChain 154(P1) 68 + Store 168 167 + 169: 50(ptr) AccessChain 157(P2) 68 + 170: 6(float) Load 169 + 171: 6(float) FAdd 170 160 + 172: 50(ptr) AccessChain 157(P2) 68 + Store 172 171 + 175: 7(fvec3) Load 151(P0) + 176: 6(float) CompositeExtract 175 0 + 177: 6(float) CompositeExtract 175 1 + 178: 6(float) CompositeExtract 175 2 + 179: 30(fvec4) CompositeConstruct 176 177 178 54 + 181: 180(ptr) AccessChain 44 62 + 182: 40 Load 181 + 183: 30(fvec4) VectorTimesMatrix 179 182 + Store 174(Q0) 183 + 185: 7(fvec3) Load 154(P1) + 186: 6(float) CompositeExtract 185 0 + 187: 6(float) CompositeExtract 185 1 + 188: 6(float) CompositeExtract 185 2 + 189: 30(fvec4) CompositeConstruct 186 187 188 54 + 190: 180(ptr) AccessChain 44 62 + 191: 40 Load 190 + 192: 30(fvec4) VectorTimesMatrix 189 191 + Store 184(Q1) 192 + 194: 7(fvec3) Load 157(P2) + 195: 6(float) CompositeExtract 194 0 + 196: 6(float) CompositeExtract 194 1 + 197: 6(float) CompositeExtract 194 2 + 198: 30(fvec4) CompositeConstruct 195 196 197 54 + 199: 180(ptr) AccessChain 44 62 + 200: 40 Load 199 + 201: 30(fvec4) VectorTimesMatrix 198 200 + Store 193(Q2) 201 + 203: 30(fvec4) Load 174(Q0) + 204: 173(ptr) AccessChain 202(vertex) 57 + Store 204 203 + 206: 30(fvec4) Load 184(Q1) + 207: 173(ptr) AccessChain 202(vertex) 57 + Store 207 206 + 208: 30(fvec4) Load 184(Q1) + 209: 173(ptr) AccessChain 202(vertex) 57 + Store 209 208 + 210: 30(fvec4) Load 193(Q2) + 211: 173(ptr) AccessChain 202(vertex) 57 + Store 211 210 + 212: 30(fvec4) Load 193(Q2) + 213: 173(ptr) AccessChain 202(vertex) 57 + Store 213 212 + 214: 30(fvec4) Load 174(Q0) + 215: 173(ptr) AccessChain 202(vertex) 57 + Store 215 214 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.hlslOffset.vert.out b/deps/glslang/Test/baseResults/hlsl.hlslOffset.vert.out new file mode 100644 index 00000000..8393d837 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.hlslOffset.vert.out @@ -0,0 +1,85 @@ +hlsl.hlslOffset.vert +Shader version: 500 +0:? Sequence +0:20 Function Definition: @main( ( temp void) +0:20 Function Parameters: +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 Function Call: @main( ( temp void) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform float m0, layout( row_major std140) uniform 3-component vector of float m4, layout( row_major std140) uniform float m16, layout( row_major std140 offset=20) uniform 3-component vector of float m20, layout( row_major std140 offset=36) uniform 3-component vector of float m36, layout( row_major std140 offset=56) uniform 2-component vector of float m56, layout( row_major std140) uniform float m64, layout( row_major std140) uniform 2-component vector of float m68, layout( row_major std140) uniform float m76, layout( row_major std140) uniform float m80, layout( row_major std140) uniform 1-element array of 2-component vector of float m96}) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:20 Function Definition: @main( ( temp void) +0:20 Function Parameters: +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 Function Call: @main( ( temp void) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform float m0, layout( row_major std140) uniform 3-component vector of float m4, layout( row_major std140) uniform float m16, layout( row_major std140 offset=20) uniform 3-component vector of float m20, layout( row_major std140 offset=36) uniform 3-component vector of float m36, layout( row_major std140 offset=56) uniform 2-component vector of float m56, layout( row_major std140) uniform float m64, layout( row_major std140) uniform 2-component vector of float m68, layout( row_major std140) uniform float m76, layout( row_major std140) uniform float m80, layout( row_major std140) uniform 1-element array of 2-component vector of float m96}) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 18 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" + Source HLSL 500 + Name 4 "main" + Name 6 "@main(" + Name 15 "b" + MemberName 15(b) 0 "m0" + MemberName 15(b) 1 "m4" + MemberName 15(b) 2 "m16" + MemberName 15(b) 3 "m20" + MemberName 15(b) 4 "m36" + MemberName 15(b) 5 "m56" + MemberName 15(b) 6 "m64" + MemberName 15(b) 7 "m68" + MemberName 15(b) 8 "m76" + MemberName 15(b) 9 "m80" + MemberName 15(b) 10 "m96" + Name 17 "" + Decorate 14 ArrayStride 16 + MemberDecorate 15(b) 0 Offset 0 + MemberDecorate 15(b) 1 Offset 4 + MemberDecorate 15(b) 2 Offset 16 + MemberDecorate 15(b) 3 Offset 20 + MemberDecorate 15(b) 4 Offset 36 + MemberDecorate 15(b) 5 Offset 56 + MemberDecorate 15(b) 6 Offset 64 + MemberDecorate 15(b) 7 Offset 68 + MemberDecorate 15(b) 8 Offset 76 + MemberDecorate 15(b) 9 Offset 80 + MemberDecorate 15(b) 10 Offset 96 + Decorate 15(b) Block + Decorate 17 DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 9: TypeFloat 32 + 10: TypeVector 9(float) 3 + 11: TypeVector 9(float) 2 + 12: TypeInt 32 0 + 13: 12(int) Constant 1 + 14: TypeArray 11(fvec2) 13 + 15(b): TypeStruct 9(float) 10(fvec3) 9(float) 10(fvec3) 10(fvec3) 11(fvec2) 9(float) 11(fvec2) 9(float) 9(float) 14 + 16: TypePointer Uniform 15(b) + 17: 16(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + 8: 2 FunctionCall 6(@main() + Return + FunctionEnd + 6(@main(): 2 Function None 3 + 7: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.hull.1.tesc.out b/deps/glslang/Test/baseResults/hlsl.hull.1.tesc.out new file mode 100644 index 00000000..1be14987 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.hull.1.tesc.out @@ -0,0 +1,373 @@ +hlsl.hull.1.tesc +Shader version: 500 +vertices = 4 +vertex spacing = equal_spacing +0:? Sequence +0:26 Function Definition: @main(struct-VS_OUT-vf31[4];u1; ( temp structure{ temp 3-component vector of float cpoint}) +0:26 Function Parameters: +0:26 'ip' ( in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:26 'm_cpid' ( in uint) +0:? Sequence +0:28 move second child to first child ( temp 3-component vector of float) +0:28 cpoint: direct index for structure ( temp 3-component vector of float) +0:28 'output' ( temp structure{ temp 3-component vector of float cpoint}) +0:28 Constant: +0:28 0 (const int) +0:28 cpoint: direct index for structure ( temp 3-component vector of float) +0:28 direct index ( temp structure{ temp 3-component vector of float cpoint}) +0:28 'ip' ( in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 0 (const int) +0:29 Branch: Return with expression +0:29 'output' ( temp structure{ temp 3-component vector of float cpoint}) +0:26 Function Definition: main( ( temp void) +0:26 Function Parameters: +0:? Sequence +0:26 move second child to first child ( temp 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:26 move second child to first child ( temp uint) +0:? 'm_cpid' ( temp uint) +0:? 'm_cpid' ( in uint InvocationID) +0:26 move second child to first child ( temp structure{ temp 3-component vector of float cpoint}) +0:26 indirect index (layout( location=0) out structure{ temp 3-component vector of float cpoint}) +0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'm_cpid' ( in uint InvocationID) +0:26 Function Call: @main(struct-VS_OUT-vf31[4];u1; ( temp structure{ temp 3-component vector of float cpoint}) +0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'm_cpid' ( temp uint) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'm_cpid' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 2-element array of float edges}) +0:? '@patchConstantResult' ( temp structure{ temp 2-element array of float edges}) +0:? Function Call: PCF(u1; ( temp structure{ temp 2-element array of float edges}) +0:? 'pid' ( in uint PrimitiveID) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 2-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 2-element array of float edges}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 2-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 2-element array of float edges}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:33 Function Definition: PCF(u1; ( temp structure{ temp 2-element array of float edges}) +0:33 Function Parameters: +0:33 'pid' ( in uint) +0:? Sequence +0:36 move second child to first child ( temp float) +0:36 direct index ( temp float) +0:36 edges: direct index for structure ( temp 2-element array of float) +0:36 'output' ( temp structure{ temp 2-element array of float edges}) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 2.000000 +0:37 move second child to first child ( temp float) +0:37 direct index ( temp float) +0:37 edges: direct index for structure ( temp 2-element array of float) +0:37 'output' ( temp structure{ temp 2-element array of float edges}) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 8.000000 +0:38 Branch: Return with expression +0:38 'output' ( temp structure{ temp 2-element array of float edges}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'm_cpid' ( in uint InvocationID) +0:? 'pid' ( in uint PrimitiveID) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) + + +Linked tessellation control stage: + + +Shader version: 500 +vertices = 4 +vertex spacing = equal_spacing +0:? Sequence +0:26 Function Definition: @main(struct-VS_OUT-vf31[4];u1; ( temp structure{ temp 3-component vector of float cpoint}) +0:26 Function Parameters: +0:26 'ip' ( in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:26 'm_cpid' ( in uint) +0:? Sequence +0:28 move second child to first child ( temp 3-component vector of float) +0:28 cpoint: direct index for structure ( temp 3-component vector of float) +0:28 'output' ( temp structure{ temp 3-component vector of float cpoint}) +0:28 Constant: +0:28 0 (const int) +0:28 cpoint: direct index for structure ( temp 3-component vector of float) +0:28 direct index ( temp structure{ temp 3-component vector of float cpoint}) +0:28 'ip' ( in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 0 (const int) +0:29 Branch: Return with expression +0:29 'output' ( temp structure{ temp 3-component vector of float cpoint}) +0:26 Function Definition: main( ( temp void) +0:26 Function Parameters: +0:? Sequence +0:26 move second child to first child ( temp 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:26 move second child to first child ( temp uint) +0:? 'm_cpid' ( temp uint) +0:? 'm_cpid' ( in uint InvocationID) +0:26 move second child to first child ( temp structure{ temp 3-component vector of float cpoint}) +0:26 indirect index (layout( location=0) out structure{ temp 3-component vector of float cpoint}) +0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'm_cpid' ( in uint InvocationID) +0:26 Function Call: @main(struct-VS_OUT-vf31[4];u1; ( temp structure{ temp 3-component vector of float cpoint}) +0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'm_cpid' ( temp uint) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'm_cpid' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 2-element array of float edges}) +0:? '@patchConstantResult' ( temp structure{ temp 2-element array of float edges}) +0:? Function Call: PCF(u1; ( temp structure{ temp 2-element array of float edges}) +0:? 'pid' ( in uint PrimitiveID) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 2-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 2-element array of float edges}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 2-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 2-element array of float edges}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:33 Function Definition: PCF(u1; ( temp structure{ temp 2-element array of float edges}) +0:33 Function Parameters: +0:33 'pid' ( in uint) +0:? Sequence +0:36 move second child to first child ( temp float) +0:36 direct index ( temp float) +0:36 edges: direct index for structure ( temp 2-element array of float) +0:36 'output' ( temp structure{ temp 2-element array of float edges}) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 2.000000 +0:37 move second child to first child ( temp float) +0:37 direct index ( temp float) +0:37 edges: direct index for structure ( temp 2-element array of float) +0:37 'output' ( temp structure{ temp 2-element array of float edges}) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 8.000000 +0:38 Branch: Return with expression +0:38 'output' ( temp structure{ temp 2-element array of float edges}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'm_cpid' ( in uint InvocationID) +0:? 'pid' ( in uint PrimitiveID) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 89 + + Capability Tessellation + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "main" 40 44 48 65 71 + ExecutionMode 4 OutputVertices 4 + ExecutionMode 4 Isolines + ExecutionMode 4 SpacingEqual + Source HLSL 500 + Name 4 "main" + Name 8 "VS_OUT" + MemberName 8(VS_OUT) 0 "cpoint" + Name 14 "HS_OUT" + MemberName 14(HS_OUT) 0 "cpoint" + Name 18 "@main(struct-VS_OUT-vf31[4];u1;" + Name 16 "ip" + Name 17 "m_cpid" + Name 22 "HS_CONSTANT_OUT" + MemberName 22(HS_CONSTANT_OUT) 0 "edges" + Name 25 "PCF(u1;" + Name 24 "pid" + Name 28 "output" + Name 38 "ip" + Name 40 "ip" + Name 42 "m_cpid" + Name 44 "m_cpid" + Name 48 "@entryPointOutput" + Name 50 "param" + Name 52 "param" + Name 64 "@patchConstantResult" + Name 65 "pid" + Name 66 "param" + Name 71 "@patchConstantOutput.edges" + Name 81 "output" + Decorate 40(ip) Location 0 + Decorate 44(m_cpid) BuiltIn InvocationId + Decorate 48(@entryPointOutput) Location 0 + Decorate 65(pid) BuiltIn PrimitiveId + Decorate 71(@patchConstantOutput.edges) Patch + Decorate 71(@patchConstantOutput.edges) BuiltIn TessLevelOuter + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8(VS_OUT): TypeStruct 7(fvec3) + 9: TypeInt 32 0 + 10: 9(int) Constant 4 + 11: TypeArray 8(VS_OUT) 10 + 12: TypePointer Function 11 + 13: TypePointer Function 9(int) + 14(HS_OUT): TypeStruct 7(fvec3) + 15: TypeFunction 14(HS_OUT) 12(ptr) 13(ptr) + 20: 9(int) Constant 2 + 21: TypeArray 6(float) 20 +22(HS_CONSTANT_OUT): TypeStruct 21 + 23: TypeFunction 22(HS_CONSTANT_OUT) 13(ptr) + 27: TypePointer Function 14(HS_OUT) + 29: TypeInt 32 1 + 30: 29(int) Constant 0 + 31: TypePointer Function 7(fvec3) + 39: TypePointer Input 11 + 40(ip): 39(ptr) Variable Input + 43: TypePointer Input 9(int) + 44(m_cpid): 43(ptr) Variable Input + 46: TypeArray 14(HS_OUT) 10 + 47: TypePointer Output 46 +48(@entryPointOutput): 47(ptr) Variable Output + 55: TypePointer Output 14(HS_OUT) + 57: 9(int) Constant 0 + 59: TypeBool + 63: TypePointer Function 22(HS_CONSTANT_OUT) + 65(pid): 43(ptr) Variable Input + 69: TypeArray 6(float) 10 + 70: TypePointer Output 69 +71(@patchConstantOutput.edges): 70(ptr) Variable Output + 72: TypePointer Function 6(float) + 75: TypePointer Output 6(float) + 77: 29(int) Constant 1 + 82: 6(float) Constant 1073741824 + 84: 6(float) Constant 1090519040 + 4(main): 2 Function None 3 + 5: Label + 38(ip): 12(ptr) Variable Function + 42(m_cpid): 13(ptr) Variable Function + 50(param): 12(ptr) Variable Function + 52(param): 13(ptr) Variable Function +64(@patchConstantResult): 63(ptr) Variable Function + 66(param): 13(ptr) Variable Function + 41: 11 Load 40(ip) + Store 38(ip) 41 + 45: 9(int) Load 44(m_cpid) + Store 42(m_cpid) 45 + 49: 9(int) Load 44(m_cpid) + 51: 11 Load 38(ip) + Store 50(param) 51 + 53: 9(int) Load 42(m_cpid) + Store 52(param) 53 + 54: 14(HS_OUT) FunctionCall 18(@main(struct-VS_OUT-vf31[4];u1;) 50(param) 52(param) + 56: 55(ptr) AccessChain 48(@entryPointOutput) 49 + Store 56 54 + ControlBarrier 20 10 57 + 58: 9(int) Load 44(m_cpid) + 60: 59(bool) IEqual 58 30 + SelectionMerge 62 None + BranchConditional 60 61 62 + 61: Label + 67: 9(int) Load 65(pid) + Store 66(param) 67 + 68:22(HS_CONSTANT_OUT) FunctionCall 25(PCF(u1;) 66(param) + Store 64(@patchConstantResult) 68 + 73: 72(ptr) AccessChain 64(@patchConstantResult) 30 30 + 74: 6(float) Load 73 + 76: 75(ptr) AccessChain 71(@patchConstantOutput.edges) 30 + Store 76 74 + 78: 72(ptr) AccessChain 64(@patchConstantResult) 30 77 + 79: 6(float) Load 78 + 80: 75(ptr) AccessChain 71(@patchConstantOutput.edges) 77 + Store 80 79 + Branch 62 + 62: Label + Return + FunctionEnd +18(@main(struct-VS_OUT-vf31[4];u1;): 14(HS_OUT) Function None 15 + 16(ip): 12(ptr) FunctionParameter + 17(m_cpid): 13(ptr) FunctionParameter + 19: Label + 28(output): 27(ptr) Variable Function + 32: 31(ptr) AccessChain 16(ip) 30 30 + 33: 7(fvec3) Load 32 + 34: 31(ptr) AccessChain 28(output) 30 + Store 34 33 + 35: 14(HS_OUT) Load 28(output) + ReturnValue 35 + FunctionEnd + 25(PCF(u1;):22(HS_CONSTANT_OUT) Function None 23 + 24(pid): 13(ptr) FunctionParameter + 26: Label + 81(output): 63(ptr) Variable Function + 83: 72(ptr) AccessChain 81(output) 30 30 + Store 83 82 + 85: 72(ptr) AccessChain 81(output) 30 77 + Store 85 84 + 86:22(HS_CONSTANT_OUT) Load 81(output) + ReturnValue 86 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.hull.2.tesc.out b/deps/glslang/Test/baseResults/hlsl.hull.2.tesc.out new file mode 100644 index 00000000..c8218d23 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.hull.2.tesc.out @@ -0,0 +1,371 @@ +hlsl.hull.2.tesc +Shader version: 500 +vertices = 4 +vertex spacing = equal_spacing +0:? Sequence +0:26 Function Definition: @main(struct-VS_OUT-vf31[4]; ( temp structure{ temp 3-component vector of float cpoint}) +0:26 Function Parameters: +0:26 'ip' ( in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? Sequence +0:28 move second child to first child ( temp 3-component vector of float) +0:28 cpoint: direct index for structure ( temp 3-component vector of float) +0:28 'output' ( temp structure{ temp 3-component vector of float cpoint}) +0:28 Constant: +0:28 0 (const int) +0:28 cpoint: direct index for structure ( temp 3-component vector of float) +0:28 direct index ( temp structure{ temp 3-component vector of float cpoint}) +0:28 'ip' ( in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 0 (const int) +0:29 Branch: Return with expression +0:29 'output' ( temp structure{ temp 3-component vector of float cpoint}) +0:26 Function Definition: main( ( temp void) +0:26 Function Parameters: +0:? Sequence +0:26 move second child to first child ( temp 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:26 move second child to first child ( temp structure{ temp 3-component vector of float cpoint}) +0:26 indirect index (layout( location=0) out structure{ temp 3-component vector of float cpoint}) +0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'InvocationId' ( in uint InvocationID) +0:26 Function Call: @main(struct-VS_OUT-vf31[4]; ( temp structure{ temp 3-component vector of float cpoint}) +0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'InvocationId' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 2-element array of float edges}) +0:? '@patchConstantResult' ( temp structure{ temp 2-element array of float edges}) +0:? Function Call: PCF(u1;vf4; ( temp structure{ temp 2-element array of float edges}) +0:? 'pid' ( in uint PrimitiveID) +0:? 'pos' ( in 4-component vector of float Position) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 2-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 2-element array of float edges}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 2-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 2-element array of float edges}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:33 Function Definition: PCF(u1;vf4; ( temp structure{ temp 2-element array of float edges}) +0:33 Function Parameters: +0:33 'pid' ( in uint) +0:33 'pos' ( in 4-component vector of float) +0:? Sequence +0:36 move second child to first child ( temp float) +0:36 direct index ( temp float) +0:36 edges: direct index for structure ( temp 2-element array of float) +0:36 'output' ( temp structure{ temp 2-element array of float edges}) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 2.000000 +0:37 move second child to first child ( temp float) +0:37 direct index ( temp float) +0:37 edges: direct index for structure ( temp 2-element array of float) +0:37 'output' ( temp structure{ temp 2-element array of float edges}) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 8.000000 +0:38 Branch: Return with expression +0:38 'output' ( temp structure{ temp 2-element array of float edges}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'InvocationId' ( in uint InvocationID) +0:? 'pid' ( in uint PrimitiveID) +0:? 'pos' ( in 4-component vector of float Position) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) + + +Linked tessellation control stage: + + +Shader version: 500 +vertices = 4 +vertex spacing = equal_spacing +0:? Sequence +0:26 Function Definition: @main(struct-VS_OUT-vf31[4]; ( temp structure{ temp 3-component vector of float cpoint}) +0:26 Function Parameters: +0:26 'ip' ( in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? Sequence +0:28 move second child to first child ( temp 3-component vector of float) +0:28 cpoint: direct index for structure ( temp 3-component vector of float) +0:28 'output' ( temp structure{ temp 3-component vector of float cpoint}) +0:28 Constant: +0:28 0 (const int) +0:28 cpoint: direct index for structure ( temp 3-component vector of float) +0:28 direct index ( temp structure{ temp 3-component vector of float cpoint}) +0:28 'ip' ( in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 0 (const int) +0:29 Branch: Return with expression +0:29 'output' ( temp structure{ temp 3-component vector of float cpoint}) +0:26 Function Definition: main( ( temp void) +0:26 Function Parameters: +0:? Sequence +0:26 move second child to first child ( temp 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:26 move second child to first child ( temp structure{ temp 3-component vector of float cpoint}) +0:26 indirect index (layout( location=0) out structure{ temp 3-component vector of float cpoint}) +0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'InvocationId' ( in uint InvocationID) +0:26 Function Call: @main(struct-VS_OUT-vf31[4]; ( temp structure{ temp 3-component vector of float cpoint}) +0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'InvocationId' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 2-element array of float edges}) +0:? '@patchConstantResult' ( temp structure{ temp 2-element array of float edges}) +0:? Function Call: PCF(u1;vf4; ( temp structure{ temp 2-element array of float edges}) +0:? 'pid' ( in uint PrimitiveID) +0:? 'pos' ( in 4-component vector of float Position) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 2-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 2-element array of float edges}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 2-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 2-element array of float edges}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:33 Function Definition: PCF(u1;vf4; ( temp structure{ temp 2-element array of float edges}) +0:33 Function Parameters: +0:33 'pid' ( in uint) +0:33 'pos' ( in 4-component vector of float) +0:? Sequence +0:36 move second child to first child ( temp float) +0:36 direct index ( temp float) +0:36 edges: direct index for structure ( temp 2-element array of float) +0:36 'output' ( temp structure{ temp 2-element array of float edges}) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 2.000000 +0:37 move second child to first child ( temp float) +0:37 direct index ( temp float) +0:37 edges: direct index for structure ( temp 2-element array of float) +0:37 'output' ( temp structure{ temp 2-element array of float edges}) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 8.000000 +0:38 Branch: Return with expression +0:38 'output' ( temp structure{ temp 2-element array of float edges}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'InvocationId' ( in uint InvocationID) +0:? 'pid' ( in uint PrimitiveID) +0:? 'pos' ( in 4-component vector of float Position) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 91 + + Capability Tessellation + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "main" 42 46 48 63 65 73 + ExecutionMode 4 OutputVertices 4 + ExecutionMode 4 Isolines + ExecutionMode 4 SpacingEqual + Source HLSL 500 + Name 4 "main" + Name 8 "VS_OUT" + MemberName 8(VS_OUT) 0 "cpoint" + Name 13 "HS_OUT" + MemberName 13(HS_OUT) 0 "cpoint" + Name 16 "@main(struct-VS_OUT-vf31[4];" + Name 15 "ip" + Name 23 "HS_CONSTANT_OUT" + MemberName 23(HS_CONSTANT_OUT) 0 "edges" + Name 27 "PCF(u1;vf4;" + Name 25 "pid" + Name 26 "pos" + Name 30 "output" + Name 40 "ip" + Name 42 "ip" + Name 46 "@entryPointOutput" + Name 48 "InvocationId" + Name 50 "param" + Name 62 "@patchConstantResult" + Name 63 "pid" + Name 65 "pos" + Name 66 "param" + Name 68 "param" + Name 73 "@patchConstantOutput.edges" + Name 83 "output" + Decorate 42(ip) Location 0 + Decorate 46(@entryPointOutput) Location 0 + Decorate 48(InvocationId) BuiltIn InvocationId + Decorate 63(pid) BuiltIn PrimitiveId + Decorate 65(pos) BuiltIn Position + Decorate 73(@patchConstantOutput.edges) Patch + Decorate 73(@patchConstantOutput.edges) BuiltIn TessLevelOuter + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8(VS_OUT): TypeStruct 7(fvec3) + 9: TypeInt 32 0 + 10: 9(int) Constant 4 + 11: TypeArray 8(VS_OUT) 10 + 12: TypePointer Function 11 + 13(HS_OUT): TypeStruct 7(fvec3) + 14: TypeFunction 13(HS_OUT) 12(ptr) + 18: TypePointer Function 9(int) + 19: TypeVector 6(float) 4 + 20: TypePointer Function 19(fvec4) + 21: 9(int) Constant 2 + 22: TypeArray 6(float) 21 +23(HS_CONSTANT_OUT): TypeStruct 22 + 24: TypeFunction 23(HS_CONSTANT_OUT) 18(ptr) 20(ptr) + 29: TypePointer Function 13(HS_OUT) + 31: TypeInt 32 1 + 32: 31(int) Constant 0 + 33: TypePointer Function 7(fvec3) + 41: TypePointer Input 11 + 42(ip): 41(ptr) Variable Input + 44: TypeArray 13(HS_OUT) 10 + 45: TypePointer Output 44 +46(@entryPointOutput): 45(ptr) Variable Output + 47: TypePointer Input 9(int) +48(InvocationId): 47(ptr) Variable Input + 53: TypePointer Output 13(HS_OUT) + 55: 9(int) Constant 0 + 57: TypeBool + 61: TypePointer Function 23(HS_CONSTANT_OUT) + 63(pid): 47(ptr) Variable Input + 64: TypePointer Input 19(fvec4) + 65(pos): 64(ptr) Variable Input + 71: TypeArray 6(float) 10 + 72: TypePointer Output 71 +73(@patchConstantOutput.edges): 72(ptr) Variable Output + 74: TypePointer Function 6(float) + 77: TypePointer Output 6(float) + 79: 31(int) Constant 1 + 84: 6(float) Constant 1073741824 + 86: 6(float) Constant 1090519040 + 4(main): 2 Function None 3 + 5: Label + 40(ip): 12(ptr) Variable Function + 50(param): 12(ptr) Variable Function +62(@patchConstantResult): 61(ptr) Variable Function + 66(param): 18(ptr) Variable Function + 68(param): 20(ptr) Variable Function + 43: 11 Load 42(ip) + Store 40(ip) 43 + 49: 9(int) Load 48(InvocationId) + 51: 11 Load 40(ip) + Store 50(param) 51 + 52: 13(HS_OUT) FunctionCall 16(@main(struct-VS_OUT-vf31[4];) 50(param) + 54: 53(ptr) AccessChain 46(@entryPointOutput) 49 + Store 54 52 + ControlBarrier 21 10 55 + 56: 9(int) Load 48(InvocationId) + 58: 57(bool) IEqual 56 32 + SelectionMerge 60 None + BranchConditional 58 59 60 + 59: Label + 67: 9(int) Load 63(pid) + Store 66(param) 67 + 69: 19(fvec4) Load 65(pos) + Store 68(param) 69 + 70:23(HS_CONSTANT_OUT) FunctionCall 27(PCF(u1;vf4;) 66(param) 68(param) + Store 62(@patchConstantResult) 70 + 75: 74(ptr) AccessChain 62(@patchConstantResult) 32 32 + 76: 6(float) Load 75 + 78: 77(ptr) AccessChain 73(@patchConstantOutput.edges) 32 + Store 78 76 + 80: 74(ptr) AccessChain 62(@patchConstantResult) 32 79 + 81: 6(float) Load 80 + 82: 77(ptr) AccessChain 73(@patchConstantOutput.edges) 79 + Store 82 81 + Branch 60 + 60: Label + Return + FunctionEnd +16(@main(struct-VS_OUT-vf31[4];): 13(HS_OUT) Function None 14 + 15(ip): 12(ptr) FunctionParameter + 17: Label + 30(output): 29(ptr) Variable Function + 34: 33(ptr) AccessChain 15(ip) 32 32 + 35: 7(fvec3) Load 34 + 36: 33(ptr) AccessChain 30(output) 32 + Store 36 35 + 37: 13(HS_OUT) Load 30(output) + ReturnValue 37 + FunctionEnd + 27(PCF(u1;vf4;):23(HS_CONSTANT_OUT) Function None 24 + 25(pid): 18(ptr) FunctionParameter + 26(pos): 20(ptr) FunctionParameter + 28: Label + 83(output): 61(ptr) Variable Function + 85: 74(ptr) AccessChain 83(output) 32 32 + Store 85 84 + 87: 74(ptr) AccessChain 83(output) 32 79 + Store 87 86 + 88:23(HS_CONSTANT_OUT) Load 83(output) + ReturnValue 88 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.hull.3.tesc.out b/deps/glslang/Test/baseResults/hlsl.hull.3.tesc.out new file mode 100644 index 00000000..4ff01985 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.hull.3.tesc.out @@ -0,0 +1,372 @@ +hlsl.hull.3.tesc +Shader version: 500 +vertices = 4 +vertex spacing = equal_spacing +0:? Sequence +0:26 Function Definition: @main(struct-VS_OUT-vf31[4]; ( temp structure{ temp 3-component vector of float cpoint}) +0:26 Function Parameters: +0:26 'ip' ( in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? Sequence +0:28 move second child to first child ( temp 3-component vector of float) +0:28 cpoint: direct index for structure ( temp 3-component vector of float) +0:28 'output' ( temp structure{ temp 3-component vector of float cpoint}) +0:28 Constant: +0:28 0 (const int) +0:28 cpoint: direct index for structure ( temp 3-component vector of float) +0:28 direct index ( temp structure{ temp 3-component vector of float cpoint}) +0:28 'ip' ( in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 0 (const int) +0:29 Branch: Return with expression +0:29 'output' ( temp structure{ temp 3-component vector of float cpoint}) +0:26 Function Definition: main( ( temp void) +0:26 Function Parameters: +0:? Sequence +0:26 move second child to first child ( temp 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:26 move second child to first child ( temp structure{ temp 3-component vector of float cpoint}) +0:26 indirect index (layout( location=0) out structure{ temp 3-component vector of float cpoint}) +0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'InvocationId' ( in uint InvocationID) +0:26 Function Call: @main(struct-VS_OUT-vf31[4]; ( temp structure{ temp 3-component vector of float cpoint}) +0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'InvocationId' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 2-element array of float edges}) +0:? '@patchConstantResult' ( temp structure{ temp 2-element array of float edges}) +0:? Function Call: PCF(u1;vf4; ( temp structure{ temp 2-element array of float edges}) +0:? 'pid' ( in uint PrimitiveID) +0:? 'pos' ( in 4-component vector of float Position) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 2-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 2-element array of float edges}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 2-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 2-element array of float edges}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:33 Function Definition: PCF(u1;vf4; ( temp structure{ temp 2-element array of float edges}) +0:33 Function Parameters: +0:33 'pid' ( in uint) +0:33 'pos' ( in 4-component vector of float) +0:? Sequence +0:36 move second child to first child ( temp float) +0:36 direct index ( temp float) +0:36 edges: direct index for structure ( temp 2-element array of float) +0:36 'output' ( temp structure{ temp 2-element array of float edges}) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 2.000000 +0:37 move second child to first child ( temp float) +0:37 direct index ( temp float) +0:37 edges: direct index for structure ( temp 2-element array of float) +0:37 'output' ( temp structure{ temp 2-element array of float edges}) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 8.000000 +0:38 Branch: Return with expression +0:38 'output' ( temp structure{ temp 2-element array of float edges}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'InvocationId' ( in uint InvocationID) +0:? 'pid' ( in uint PrimitiveID) +0:? 'pos' ( in 4-component vector of float Position) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) + + +Linked tessellation control stage: + + +Shader version: 500 +vertices = 4 +vertex spacing = equal_spacing +0:? Sequence +0:26 Function Definition: @main(struct-VS_OUT-vf31[4]; ( temp structure{ temp 3-component vector of float cpoint}) +0:26 Function Parameters: +0:26 'ip' ( in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? Sequence +0:28 move second child to first child ( temp 3-component vector of float) +0:28 cpoint: direct index for structure ( temp 3-component vector of float) +0:28 'output' ( temp structure{ temp 3-component vector of float cpoint}) +0:28 Constant: +0:28 0 (const int) +0:28 cpoint: direct index for structure ( temp 3-component vector of float) +0:28 direct index ( temp structure{ temp 3-component vector of float cpoint}) +0:28 'ip' ( in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 0 (const int) +0:29 Branch: Return with expression +0:29 'output' ( temp structure{ temp 3-component vector of float cpoint}) +0:26 Function Definition: main( ( temp void) +0:26 Function Parameters: +0:? Sequence +0:26 move second child to first child ( temp 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:26 move second child to first child ( temp structure{ temp 3-component vector of float cpoint}) +0:26 indirect index (layout( location=0) out structure{ temp 3-component vector of float cpoint}) +0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'InvocationId' ( in uint InvocationID) +0:26 Function Call: @main(struct-VS_OUT-vf31[4]; ( temp structure{ temp 3-component vector of float cpoint}) +0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'InvocationId' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 2-element array of float edges}) +0:? '@patchConstantResult' ( temp structure{ temp 2-element array of float edges}) +0:? Function Call: PCF(u1;vf4; ( temp structure{ temp 2-element array of float edges}) +0:? 'pid' ( in uint PrimitiveID) +0:? 'pos' ( in 4-component vector of float Position) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 2-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 2-element array of float edges}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? edges: direct index for structure ( temp 2-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 2-element array of float edges}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:33 Function Definition: PCF(u1;vf4; ( temp structure{ temp 2-element array of float edges}) +0:33 Function Parameters: +0:33 'pid' ( in uint) +0:33 'pos' ( in 4-component vector of float) +0:? Sequence +0:36 move second child to first child ( temp float) +0:36 direct index ( temp float) +0:36 edges: direct index for structure ( temp 2-element array of float) +0:36 'output' ( temp structure{ temp 2-element array of float edges}) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 2.000000 +0:37 move second child to first child ( temp float) +0:37 direct index ( temp float) +0:37 edges: direct index for structure ( temp 2-element array of float) +0:37 'output' ( temp structure{ temp 2-element array of float edges}) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 8.000000 +0:38 Branch: Return with expression +0:38 'output' ( temp structure{ temp 2-element array of float edges}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'InvocationId' ( in uint InvocationID) +0:? 'pid' ( in uint PrimitiveID) +0:? 'pos' ( in 4-component vector of float Position) +0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 91 + + Capability Tessellation + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "main" 42 46 48 63 65 73 + ExecutionMode 4 OutputVertices 4 + ExecutionMode 4 Triangles + ExecutionMode 4 SpacingEqual + ExecutionMode 4 PointMode + Source HLSL 500 + Name 4 "main" + Name 8 "VS_OUT" + MemberName 8(VS_OUT) 0 "cpoint" + Name 13 "HS_OUT" + MemberName 13(HS_OUT) 0 "cpoint" + Name 16 "@main(struct-VS_OUT-vf31[4];" + Name 15 "ip" + Name 23 "HS_CONSTANT_OUT" + MemberName 23(HS_CONSTANT_OUT) 0 "edges" + Name 27 "PCF(u1;vf4;" + Name 25 "pid" + Name 26 "pos" + Name 30 "output" + Name 40 "ip" + Name 42 "ip" + Name 46 "@entryPointOutput" + Name 48 "InvocationId" + Name 50 "param" + Name 62 "@patchConstantResult" + Name 63 "pid" + Name 65 "pos" + Name 66 "param" + Name 68 "param" + Name 73 "@patchConstantOutput.edges" + Name 83 "output" + Decorate 42(ip) Location 0 + Decorate 46(@entryPointOutput) Location 0 + Decorate 48(InvocationId) BuiltIn InvocationId + Decorate 63(pid) BuiltIn PrimitiveId + Decorate 65(pos) BuiltIn Position + Decorate 73(@patchConstantOutput.edges) Patch + Decorate 73(@patchConstantOutput.edges) BuiltIn TessLevelOuter + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8(VS_OUT): TypeStruct 7(fvec3) + 9: TypeInt 32 0 + 10: 9(int) Constant 4 + 11: TypeArray 8(VS_OUT) 10 + 12: TypePointer Function 11 + 13(HS_OUT): TypeStruct 7(fvec3) + 14: TypeFunction 13(HS_OUT) 12(ptr) + 18: TypePointer Function 9(int) + 19: TypeVector 6(float) 4 + 20: TypePointer Function 19(fvec4) + 21: 9(int) Constant 2 + 22: TypeArray 6(float) 21 +23(HS_CONSTANT_OUT): TypeStruct 22 + 24: TypeFunction 23(HS_CONSTANT_OUT) 18(ptr) 20(ptr) + 29: TypePointer Function 13(HS_OUT) + 31: TypeInt 32 1 + 32: 31(int) Constant 0 + 33: TypePointer Function 7(fvec3) + 41: TypePointer Input 11 + 42(ip): 41(ptr) Variable Input + 44: TypeArray 13(HS_OUT) 10 + 45: TypePointer Output 44 +46(@entryPointOutput): 45(ptr) Variable Output + 47: TypePointer Input 9(int) +48(InvocationId): 47(ptr) Variable Input + 53: TypePointer Output 13(HS_OUT) + 55: 9(int) Constant 0 + 57: TypeBool + 61: TypePointer Function 23(HS_CONSTANT_OUT) + 63(pid): 47(ptr) Variable Input + 64: TypePointer Input 19(fvec4) + 65(pos): 64(ptr) Variable Input + 71: TypeArray 6(float) 10 + 72: TypePointer Output 71 +73(@patchConstantOutput.edges): 72(ptr) Variable Output + 74: TypePointer Function 6(float) + 77: TypePointer Output 6(float) + 79: 31(int) Constant 1 + 84: 6(float) Constant 1073741824 + 86: 6(float) Constant 1090519040 + 4(main): 2 Function None 3 + 5: Label + 40(ip): 12(ptr) Variable Function + 50(param): 12(ptr) Variable Function +62(@patchConstantResult): 61(ptr) Variable Function + 66(param): 18(ptr) Variable Function + 68(param): 20(ptr) Variable Function + 43: 11 Load 42(ip) + Store 40(ip) 43 + 49: 9(int) Load 48(InvocationId) + 51: 11 Load 40(ip) + Store 50(param) 51 + 52: 13(HS_OUT) FunctionCall 16(@main(struct-VS_OUT-vf31[4];) 50(param) + 54: 53(ptr) AccessChain 46(@entryPointOutput) 49 + Store 54 52 + ControlBarrier 21 10 55 + 56: 9(int) Load 48(InvocationId) + 58: 57(bool) IEqual 56 32 + SelectionMerge 60 None + BranchConditional 58 59 60 + 59: Label + 67: 9(int) Load 63(pid) + Store 66(param) 67 + 69: 19(fvec4) Load 65(pos) + Store 68(param) 69 + 70:23(HS_CONSTANT_OUT) FunctionCall 27(PCF(u1;vf4;) 66(param) 68(param) + Store 62(@patchConstantResult) 70 + 75: 74(ptr) AccessChain 62(@patchConstantResult) 32 32 + 76: 6(float) Load 75 + 78: 77(ptr) AccessChain 73(@patchConstantOutput.edges) 32 + Store 78 76 + 80: 74(ptr) AccessChain 62(@patchConstantResult) 32 79 + 81: 6(float) Load 80 + 82: 77(ptr) AccessChain 73(@patchConstantOutput.edges) 79 + Store 82 81 + Branch 60 + 60: Label + Return + FunctionEnd +16(@main(struct-VS_OUT-vf31[4];): 13(HS_OUT) Function None 14 + 15(ip): 12(ptr) FunctionParameter + 17: Label + 30(output): 29(ptr) Variable Function + 34: 33(ptr) AccessChain 15(ip) 32 32 + 35: 7(fvec3) Load 34 + 36: 33(ptr) AccessChain 30(output) 32 + Store 36 35 + 37: 13(HS_OUT) Load 30(output) + ReturnValue 37 + FunctionEnd + 27(PCF(u1;vf4;):23(HS_CONSTANT_OUT) Function None 24 + 25(pid): 18(ptr) FunctionParameter + 26(pos): 20(ptr) FunctionParameter + 28: Label + 83(output): 61(ptr) Variable Function + 85: 74(ptr) AccessChain 83(output) 32 32 + Store 85 84 + 87: 74(ptr) AccessChain 83(output) 32 79 + Store 87 86 + 88:23(HS_CONSTANT_OUT) Load 83(output) + ReturnValue 88 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.hull.4.tesc.out b/deps/glslang/Test/baseResults/hlsl.hull.4.tesc.out new file mode 100644 index 00000000..a99730d0 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.hull.4.tesc.out @@ -0,0 +1,679 @@ +hlsl.hull.4.tesc +Shader version: 500 +vertices = 3 +vertex spacing = fractional_odd_spacing +triangle order = cw +0:? Sequence +0:25 Function Definition: HS_ConstFunc(struct-HS_Input-vf4-vf41[3]; ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:25 Function Parameters: +0:25 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:? Sequence +0:26 Sequence +0:26 move second child to first child ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:26 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:26 Constant: +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:28 move second child to first child ( temp float) +0:28 fInsideTessFactor: direct index for structure ( temp float) +0:28 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:28 Constant: +0:28 1 (const int) +0:28 add ( temp float) +0:28 direct index ( temp float) +0:28 m_Position: direct index for structure ( temp 4-component vector of float) +0:28 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:28 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 3 (const int) +0:28 direct index ( temp float) +0:28 m_Normal: direct index for structure ( temp 4-component vector of float) +0:28 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:28 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 1 (const int) +0:28 Constant: +0:28 3 (const int) +0:30 Branch: Return with expression +0:30 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:39 Function Definition: @main(struct-HS_Input-vf4-vf41[3];u1; ( temp structure{ temp 4-component vector of float m_Position}) +0:39 Function Parameters: +0:39 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:39 'cpid' ( in uint) +0:? Sequence +0:40 Sequence +0:40 move second child to first child ( temp structure{ temp 4-component vector of float m_Position}) +0:40 'output' ( temp structure{ temp 4-component vector of float m_Position}) +0:40 Constant: +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:41 move second child to first child ( temp 4-component vector of float) +0:41 m_Position: direct index for structure ( temp 4-component vector of float) +0:41 'output' ( temp structure{ temp 4-component vector of float m_Position}) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 0.000000 +0:41 0.000000 +0:41 0.000000 +0:41 0.000000 +0:42 Branch: Return with expression +0:42 'output' ( temp structure{ temp 4-component vector of float m_Position}) +0:39 Function Definition: main( ( temp void) +0:39 Function Parameters: +0:? Sequence +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 m_Position: direct index for structure ( temp 4-component vector of float) +0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 0 (const int) +0:39 direct index ( in 4-component vector of float Position) +0:? 'I.m_Position' ( in 3-element array of 4-component vector of float Position) +0:39 Constant: +0:39 0 (const int) +0:39 move second child to first child ( temp 4-component vector of float) +0:39 m_Normal: direct index for structure ( temp 4-component vector of float) +0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 m_Normal: direct index for structure ( temp 4-component vector of float) +0:39 direct index (layout( location=0) in structure{ temp 4-component vector of float m_Normal}) +0:39 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 0 (const int) +0:39 move second child to first child ( temp 4-component vector of float) +0:39 m_Position: direct index for structure ( temp 4-component vector of float) +0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:39 Constant: +0:39 1 (const int) +0:39 Constant: +0:39 0 (const int) +0:39 direct index ( in 4-component vector of float Position) +0:? 'I.m_Position' ( in 3-element array of 4-component vector of float Position) +0:39 Constant: +0:39 1 (const int) +0:39 move second child to first child ( temp 4-component vector of float) +0:39 m_Normal: direct index for structure ( temp 4-component vector of float) +0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:39 Constant: +0:39 1 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 m_Normal: direct index for structure ( temp 4-component vector of float) +0:39 direct index (layout( location=0) in structure{ temp 4-component vector of float m_Normal}) +0:39 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal}) +0:39 Constant: +0:39 1 (const int) +0:39 Constant: +0:39 0 (const int) +0:39 move second child to first child ( temp 4-component vector of float) +0:39 m_Position: direct index for structure ( temp 4-component vector of float) +0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:39 Constant: +0:39 2 (const int) +0:39 Constant: +0:39 0 (const int) +0:39 direct index ( in 4-component vector of float Position) +0:? 'I.m_Position' ( in 3-element array of 4-component vector of float Position) +0:39 Constant: +0:39 2 (const int) +0:39 move second child to first child ( temp 4-component vector of float) +0:39 m_Normal: direct index for structure ( temp 4-component vector of float) +0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:39 Constant: +0:39 2 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 m_Normal: direct index for structure ( temp 4-component vector of float) +0:39 direct index (layout( location=0) in structure{ temp 4-component vector of float m_Normal}) +0:39 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal}) +0:39 Constant: +0:39 2 (const int) +0:39 Constant: +0:39 0 (const int) +0:39 move second child to first child ( temp uint) +0:? 'cpid' ( temp uint) +0:? 'cpid' ( in uint InvocationID) +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 indirect index ( out 4-component vector of float Position) +0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position) +0:? 'cpid' ( in uint InvocationID) +0:39 m_Position: direct index for structure ( temp 4-component vector of float) +0:39 Function Call: @main(struct-HS_Input-vf4-vf41[3];u1; ( temp structure{ temp 4-component vector of float m_Position}) +0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:? 'cpid' ( temp uint) +0:39 Constant: +0:39 0 (const int) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'cpid' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:? Function Call: HS_ConstFunc(struct-HS_Input-vf4-vf41[3]; ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.fTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? fTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.fTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? fTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.fTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 2 (const int) +0:? direct index ( temp float) +0:? fTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 2 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelInner) +0:? '@patchConstantOutput.fInsideTessFactor' ( patch out 2-element array of float TessLevelInner) +0:? Constant: +0:? 0 (const int) +0:? fInsideTessFactor: direct index for structure ( temp float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:? Constant: +0:? 1 (const int) +0:? Linker Objects +0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position) +0:? 'I.m_Position' ( in 3-element array of 4-component vector of float Position) +0:? 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal}) +0:? 'cpid' ( in uint InvocationID) +0:? '@patchConstantOutput.fTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? '@patchConstantOutput.fInsideTessFactor' ( patch out 2-element array of float TessLevelInner) + + +Linked tessellation control stage: + + +Shader version: 500 +vertices = 3 +vertex spacing = fractional_odd_spacing +triangle order = cw +0:? Sequence +0:25 Function Definition: HS_ConstFunc(struct-HS_Input-vf4-vf41[3]; ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:25 Function Parameters: +0:25 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:? Sequence +0:26 Sequence +0:26 move second child to first child ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:26 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:26 Constant: +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:28 move second child to first child ( temp float) +0:28 fInsideTessFactor: direct index for structure ( temp float) +0:28 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:28 Constant: +0:28 1 (const int) +0:28 add ( temp float) +0:28 direct index ( temp float) +0:28 m_Position: direct index for structure ( temp 4-component vector of float) +0:28 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:28 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 3 (const int) +0:28 direct index ( temp float) +0:28 m_Normal: direct index for structure ( temp 4-component vector of float) +0:28 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:28 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 1 (const int) +0:28 Constant: +0:28 3 (const int) +0:30 Branch: Return with expression +0:30 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:39 Function Definition: @main(struct-HS_Input-vf4-vf41[3];u1; ( temp structure{ temp 4-component vector of float m_Position}) +0:39 Function Parameters: +0:39 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:39 'cpid' ( in uint) +0:? Sequence +0:40 Sequence +0:40 move second child to first child ( temp structure{ temp 4-component vector of float m_Position}) +0:40 'output' ( temp structure{ temp 4-component vector of float m_Position}) +0:40 Constant: +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:41 move second child to first child ( temp 4-component vector of float) +0:41 m_Position: direct index for structure ( temp 4-component vector of float) +0:41 'output' ( temp structure{ temp 4-component vector of float m_Position}) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 0.000000 +0:41 0.000000 +0:41 0.000000 +0:41 0.000000 +0:42 Branch: Return with expression +0:42 'output' ( temp structure{ temp 4-component vector of float m_Position}) +0:39 Function Definition: main( ( temp void) +0:39 Function Parameters: +0:? Sequence +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 m_Position: direct index for structure ( temp 4-component vector of float) +0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 0 (const int) +0:39 direct index ( in 4-component vector of float Position) +0:? 'I.m_Position' ( in 3-element array of 4-component vector of float Position) +0:39 Constant: +0:39 0 (const int) +0:39 move second child to first child ( temp 4-component vector of float) +0:39 m_Normal: direct index for structure ( temp 4-component vector of float) +0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 m_Normal: direct index for structure ( temp 4-component vector of float) +0:39 direct index (layout( location=0) in structure{ temp 4-component vector of float m_Normal}) +0:39 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 0 (const int) +0:39 move second child to first child ( temp 4-component vector of float) +0:39 m_Position: direct index for structure ( temp 4-component vector of float) +0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:39 Constant: +0:39 1 (const int) +0:39 Constant: +0:39 0 (const int) +0:39 direct index ( in 4-component vector of float Position) +0:? 'I.m_Position' ( in 3-element array of 4-component vector of float Position) +0:39 Constant: +0:39 1 (const int) +0:39 move second child to first child ( temp 4-component vector of float) +0:39 m_Normal: direct index for structure ( temp 4-component vector of float) +0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:39 Constant: +0:39 1 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 m_Normal: direct index for structure ( temp 4-component vector of float) +0:39 direct index (layout( location=0) in structure{ temp 4-component vector of float m_Normal}) +0:39 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal}) +0:39 Constant: +0:39 1 (const int) +0:39 Constant: +0:39 0 (const int) +0:39 move second child to first child ( temp 4-component vector of float) +0:39 m_Position: direct index for structure ( temp 4-component vector of float) +0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:39 Constant: +0:39 2 (const int) +0:39 Constant: +0:39 0 (const int) +0:39 direct index ( in 4-component vector of float Position) +0:? 'I.m_Position' ( in 3-element array of 4-component vector of float Position) +0:39 Constant: +0:39 2 (const int) +0:39 move second child to first child ( temp 4-component vector of float) +0:39 m_Normal: direct index for structure ( temp 4-component vector of float) +0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:39 Constant: +0:39 2 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 m_Normal: direct index for structure ( temp 4-component vector of float) +0:39 direct index (layout( location=0) in structure{ temp 4-component vector of float m_Normal}) +0:39 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal}) +0:39 Constant: +0:39 2 (const int) +0:39 Constant: +0:39 0 (const int) +0:39 move second child to first child ( temp uint) +0:? 'cpid' ( temp uint) +0:? 'cpid' ( in uint InvocationID) +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 indirect index ( out 4-component vector of float Position) +0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position) +0:? 'cpid' ( in uint InvocationID) +0:39 m_Position: direct index for structure ( temp 4-component vector of float) +0:39 Function Call: @main(struct-HS_Input-vf4-vf41[3];u1; ( temp structure{ temp 4-component vector of float m_Position}) +0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:? 'cpid' ( temp uint) +0:39 Constant: +0:39 0 (const int) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'cpid' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:? Function Call: HS_ConstFunc(struct-HS_Input-vf4-vf41[3]; ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.fTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? fTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.fTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? fTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.fTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 2 (const int) +0:? direct index ( temp float) +0:? fTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 2 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelInner) +0:? '@patchConstantOutput.fInsideTessFactor' ( patch out 2-element array of float TessLevelInner) +0:? Constant: +0:? 0 (const int) +0:? fInsideTessFactor: direct index for structure ( temp float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:? Constant: +0:? 1 (const int) +0:? Linker Objects +0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position) +0:? 'I.m_Position' ( in 3-element array of 4-component vector of float Position) +0:? 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal}) +0:? 'cpid' ( in uint InvocationID) +0:? '@patchConstantOutput.fTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? '@patchConstantOutput.fInsideTessFactor' ( patch out 2-element array of float TessLevelInner) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 127 + + Capability Tessellation + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "main" 56 64 83 86 110 123 + ExecutionMode 4 OutputVertices 3 + ExecutionMode 4 Triangles + ExecutionMode 4 SpacingFractionalOdd + ExecutionMode 4 VertexOrderCw + Source HLSL 500 + Name 4 "main" + Name 8 "HS_Input" + MemberName 8(HS_Input) 0 "m_Position" + MemberName 8(HS_Input) 1 "m_Normal" + Name 14 "HS_Output" + MemberName 14(HS_Output) 0 "fTessFactor" + MemberName 14(HS_Output) 1 "fInsideTessFactor" + Name 17 "HS_ConstFunc(struct-HS_Input-vf4-vf41[3];" + Name 16 "I" + Name 20 "HS_Main_Output" + MemberName 20(HS_Main_Output) 0 "m_Position" + Name 24 "@main(struct-HS_Input-vf4-vf41[3];u1;" + Name 22 "I" + Name 23 "cpid" + Name 27 "O" + Name 45 "output" + Name 53 "I" + Name 56 "I.m_Position" + Name 61 "HS_Input" + MemberName 61(HS_Input) 0 "m_Normal" + Name 64 "I" + Name 81 "cpid" + Name 83 "cpid" + Name 86 "@entryPointOutput.m_Position" + Name 88 "param" + Name 90 "param" + Name 104 "@patchConstantResult" + Name 105 "param" + Name 110 "@patchConstantOutput.fTessFactor" + Name 123 "@patchConstantOutput.fInsideTessFactor" + Decorate 56(I.m_Position) BuiltIn Position + Decorate 64(I) Location 0 + Decorate 83(cpid) BuiltIn InvocationId + Decorate 86(@entryPointOutput.m_Position) BuiltIn Position + Decorate 110(@patchConstantOutput.fTessFactor) Patch + Decorate 110(@patchConstantOutput.fTessFactor) BuiltIn TessLevelOuter + Decorate 123(@patchConstantOutput.fInsideTessFactor) Patch + Decorate 123(@patchConstantOutput.fInsideTessFactor) BuiltIn TessLevelInner + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(HS_Input): TypeStruct 7(fvec4) 7(fvec4) + 9: TypeInt 32 0 + 10: 9(int) Constant 3 + 11: TypeArray 8(HS_Input) 10 + 12: TypePointer Function 11 + 13: TypeArray 6(float) 10 + 14(HS_Output): TypeStruct 13 6(float) + 15: TypeFunction 14(HS_Output) 12(ptr) + 19: TypePointer Function 9(int) +20(HS_Main_Output): TypeStruct 7(fvec4) + 21: TypeFunction 20(HS_Main_Output) 12(ptr) 19(ptr) + 26: TypePointer Function 14(HS_Output) + 28: 6(float) Constant 0 + 29: 13 ConstantComposite 28 28 28 + 30:14(HS_Output) ConstantComposite 29 28 + 31: TypeInt 32 1 + 32: 31(int) Constant 1 + 33: 31(int) Constant 0 + 34: TypePointer Function 6(float) + 44: TypePointer Function 20(HS_Main_Output) + 46: 7(fvec4) ConstantComposite 28 28 28 28 + 47:20(HS_Main_Output) ConstantComposite 46 + 48: TypePointer Function 7(fvec4) + 54: TypeArray 7(fvec4) 10 + 55: TypePointer Input 54 +56(I.m_Position): 55(ptr) Variable Input + 57: TypePointer Input 7(fvec4) + 61(HS_Input): TypeStruct 7(fvec4) + 62: TypeArray 61(HS_Input) 10 + 63: TypePointer Input 62 + 64(I): 63(ptr) Variable Input + 74: 31(int) Constant 2 + 82: TypePointer Input 9(int) + 83(cpid): 82(ptr) Variable Input + 85: TypePointer Output 54 +86(@entryPointOutput.m_Position): 85(ptr) Variable Output + 94: TypePointer Output 7(fvec4) + 96: 9(int) Constant 2 + 97: 9(int) Constant 4 + 98: 9(int) Constant 0 + 100: TypeBool + 108: TypeArray 6(float) 97 + 109: TypePointer Output 108 +110(@patchConstantOutput.fTessFactor): 109(ptr) Variable Output + 113: TypePointer Output 6(float) + 121: TypeArray 6(float) 96 + 122: TypePointer Output 121 +123(@patchConstantOutput.fInsideTessFactor): 122(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 53(I): 12(ptr) Variable Function + 81(cpid): 19(ptr) Variable Function + 88(param): 12(ptr) Variable Function + 90(param): 19(ptr) Variable Function +104(@patchConstantResult): 26(ptr) Variable Function + 105(param): 12(ptr) Variable Function + 58: 57(ptr) AccessChain 56(I.m_Position) 33 + 59: 7(fvec4) Load 58 + 60: 48(ptr) AccessChain 53(I) 33 33 + Store 60 59 + 65: 57(ptr) AccessChain 64(I) 33 33 + 66: 7(fvec4) Load 65 + 67: 48(ptr) AccessChain 53(I) 33 32 + Store 67 66 + 68: 57(ptr) AccessChain 56(I.m_Position) 32 + 69: 7(fvec4) Load 68 + 70: 48(ptr) AccessChain 53(I) 32 33 + Store 70 69 + 71: 57(ptr) AccessChain 64(I) 32 33 + 72: 7(fvec4) Load 71 + 73: 48(ptr) AccessChain 53(I) 32 32 + Store 73 72 + 75: 57(ptr) AccessChain 56(I.m_Position) 74 + 76: 7(fvec4) Load 75 + 77: 48(ptr) AccessChain 53(I) 74 33 + Store 77 76 + 78: 57(ptr) AccessChain 64(I) 74 33 + 79: 7(fvec4) Load 78 + 80: 48(ptr) AccessChain 53(I) 74 32 + Store 80 79 + 84: 9(int) Load 83(cpid) + Store 81(cpid) 84 + 87: 9(int) Load 83(cpid) + 89: 11 Load 53(I) + Store 88(param) 89 + 91: 9(int) Load 81(cpid) + Store 90(param) 91 + 92:20(HS_Main_Output) FunctionCall 24(@main(struct-HS_Input-vf4-vf41[3];u1;) 88(param) 90(param) + 93: 7(fvec4) CompositeExtract 92 0 + 95: 94(ptr) AccessChain 86(@entryPointOutput.m_Position) 87 + Store 95 93 + ControlBarrier 96 97 98 + 99: 9(int) Load 83(cpid) + 101: 100(bool) IEqual 99 33 + SelectionMerge 103 None + BranchConditional 101 102 103 + 102: Label + 106: 11 Load 53(I) + Store 105(param) 106 + 107:14(HS_Output) FunctionCall 17(HS_ConstFunc(struct-HS_Input-vf4-vf41[3];) 105(param) + Store 104(@patchConstantResult) 107 + 111: 34(ptr) AccessChain 104(@patchConstantResult) 33 33 + 112: 6(float) Load 111 + 114: 113(ptr) AccessChain 110(@patchConstantOutput.fTessFactor) 33 + Store 114 112 + 115: 34(ptr) AccessChain 104(@patchConstantResult) 33 32 + 116: 6(float) Load 115 + 117: 113(ptr) AccessChain 110(@patchConstantOutput.fTessFactor) 32 + Store 117 116 + 118: 34(ptr) AccessChain 104(@patchConstantResult) 33 74 + 119: 6(float) Load 118 + 120: 113(ptr) AccessChain 110(@patchConstantOutput.fTessFactor) 74 + Store 120 119 + 124: 34(ptr) AccessChain 104(@patchConstantResult) 32 + 125: 6(float) Load 124 + 126: 113(ptr) AccessChain 123(@patchConstantOutput.fInsideTessFactor) 33 + Store 126 125 + Branch 103 + 103: Label + Return + FunctionEnd +17(HS_ConstFunc(struct-HS_Input-vf4-vf41[3];):14(HS_Output) Function None 15 + 16(I): 12(ptr) FunctionParameter + 18: Label + 27(O): 26(ptr) Variable Function + Store 27(O) 30 + 35: 34(ptr) AccessChain 16(I) 33 33 10 + 36: 6(float) Load 35 + 37: 34(ptr) AccessChain 16(I) 33 32 10 + 38: 6(float) Load 37 + 39: 6(float) FAdd 36 38 + 40: 34(ptr) AccessChain 27(O) 32 + Store 40 39 + 41:14(HS_Output) Load 27(O) + ReturnValue 41 + FunctionEnd +24(@main(struct-HS_Input-vf4-vf41[3];u1;):20(HS_Main_Output) Function None 21 + 22(I): 12(ptr) FunctionParameter + 23(cpid): 19(ptr) FunctionParameter + 25: Label + 45(output): 44(ptr) Variable Function + Store 45(output) 47 + 49: 48(ptr) AccessChain 45(output) 33 + Store 49 46 + 50:20(HS_Main_Output) Load 45(output) + ReturnValue 50 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.hull.5.tesc.out b/deps/glslang/Test/baseResults/hlsl.hull.5.tesc.out new file mode 100644 index 00000000..656427b6 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.hull.5.tesc.out @@ -0,0 +1,188 @@ +hlsl.hull.5.tesc +ERROR: 0:0: '' : unimplemented: PCF input patch without entry point input patch parameter +ERROR: 1 compilation errors. No code generated. + + +Shader version: 500 +vertices = 3 +vertex spacing = fractional_odd_spacing +triangle order = cw +ERROR: node is still EOpNull! +0:25 Function Definition: HS_ConstFunc(struct-HS_Input-vf4-vf41[3]; ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:25 Function Parameters: +0:25 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:? Sequence +0:26 Sequence +0:26 move second child to first child ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:26 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:26 Constant: +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:28 move second child to first child ( temp float) +0:28 fInsideTessFactor: direct index for structure ( temp float) +0:28 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:28 Constant: +0:28 1 (const int) +0:28 add ( temp float) +0:28 direct index ( temp float) +0:28 m_Position: direct index for structure ( temp 4-component vector of float) +0:28 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:28 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 3 (const int) +0:28 direct index ( temp float) +0:28 m_Normal: direct index for structure ( temp 4-component vector of float) +0:28 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:28 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 1 (const int) +0:28 Constant: +0:28 3 (const int) +0:30 Branch: Return with expression +0:30 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:39 Function Definition: @main(u1; ( temp structure{ temp 4-component vector of float m_Position}) +0:39 Function Parameters: +0:39 'cpid' ( in uint) +0:? Sequence +0:40 Sequence +0:40 move second child to first child ( temp structure{ temp 4-component vector of float m_Position}) +0:40 'output' ( temp structure{ temp 4-component vector of float m_Position}) +0:40 Constant: +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:41 move second child to first child ( temp 4-component vector of float) +0:41 m_Position: direct index for structure ( temp 4-component vector of float) +0:41 'output' ( temp structure{ temp 4-component vector of float m_Position}) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 0.000000 +0:41 0.000000 +0:41 0.000000 +0:41 0.000000 +0:42 Branch: Return with expression +0:42 'output' ( temp structure{ temp 4-component vector of float m_Position}) +0:39 Function Definition: main( ( temp void) +0:39 Function Parameters: +0:? Sequence +0:39 move second child to first child ( temp uint) +0:? 'cpid' ( temp uint) +0:? 'cpid' ( in uint InvocationID) +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 indirect index ( out 4-component vector of float Position) +0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position) +0:? 'cpid' ( in uint InvocationID) +0:39 m_Position: direct index for structure ( temp 4-component vector of float) +0:39 Function Call: @main(u1; ( temp structure{ temp 4-component vector of float m_Position}) +0:? 'cpid' ( temp uint) +0:39 Constant: +0:39 0 (const int) +0:? Linker Objects +0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position) +0:? 'cpid' ( in uint InvocationID) + + +Linked tessellation control stage: + + +Shader version: 500 +vertices = 3 +vertex spacing = fractional_odd_spacing +triangle order = cw +ERROR: node is still EOpNull! +0:25 Function Definition: HS_ConstFunc(struct-HS_Input-vf4-vf41[3]; ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:25 Function Parameters: +0:25 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:? Sequence +0:26 Sequence +0:26 move second child to first child ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:26 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:26 Constant: +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:28 move second child to first child ( temp float) +0:28 fInsideTessFactor: direct index for structure ( temp float) +0:28 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:28 Constant: +0:28 1 (const int) +0:28 add ( temp float) +0:28 direct index ( temp float) +0:28 m_Position: direct index for structure ( temp 4-component vector of float) +0:28 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:28 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 3 (const int) +0:28 direct index ( temp float) +0:28 m_Normal: direct index for structure ( temp 4-component vector of float) +0:28 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:28 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 1 (const int) +0:28 Constant: +0:28 3 (const int) +0:30 Branch: Return with expression +0:30 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor}) +0:39 Function Definition: @main(u1; ( temp structure{ temp 4-component vector of float m_Position}) +0:39 Function Parameters: +0:39 'cpid' ( in uint) +0:? Sequence +0:40 Sequence +0:40 move second child to first child ( temp structure{ temp 4-component vector of float m_Position}) +0:40 'output' ( temp structure{ temp 4-component vector of float m_Position}) +0:40 Constant: +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:41 move second child to first child ( temp 4-component vector of float) +0:41 m_Position: direct index for structure ( temp 4-component vector of float) +0:41 'output' ( temp structure{ temp 4-component vector of float m_Position}) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 0.000000 +0:41 0.000000 +0:41 0.000000 +0:41 0.000000 +0:42 Branch: Return with expression +0:42 'output' ( temp structure{ temp 4-component vector of float m_Position}) +0:39 Function Definition: main( ( temp void) +0:39 Function Parameters: +0:? Sequence +0:39 move second child to first child ( temp uint) +0:? 'cpid' ( temp uint) +0:? 'cpid' ( in uint InvocationID) +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 indirect index ( out 4-component vector of float Position) +0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position) +0:? 'cpid' ( in uint InvocationID) +0:39 m_Position: direct index for structure ( temp 4-component vector of float) +0:39 Function Call: @main(u1; ( temp structure{ temp 4-component vector of float m_Position}) +0:? 'cpid' ( temp uint) +0:39 Constant: +0:39 0 (const int) +0:? Linker Objects +0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position) +0:? 'cpid' ( in uint InvocationID) + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/hlsl.hull.ctrlpt-1.tesc.out b/deps/glslang/Test/baseResults/hlsl.hull.ctrlpt-1.tesc.out new file mode 100644 index 00000000..41f3c0a4 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.hull.ctrlpt-1.tesc.out @@ -0,0 +1,604 @@ +hlsl.hull.ctrlpt-1.tesc +Shader version: 500 +vertices = 3 +vertex spacing = fractional_odd_spacing +triangle order = cw +0:? Sequence +0:27 Function Definition: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val}) +0:27 Function Parameters: +0:27 'i' ( in 3-element array of structure{ temp 3-component vector of float val}) +0:27 'cpid' ( in uint) +0:? Sequence +0:29 move second child to first child ( temp 3-component vector of float) +0:29 val: direct index for structure ( temp 3-component vector of float) +0:29 'o' ( temp structure{ temp 3-component vector of float val}) +0:29 Constant: +0:29 0 (const int) +0:29 Construct vec3 ( temp 3-component vector of float) +0:29 Convert uint to float ( temp float) +0:29 'cpid' ( in uint) +0:30 Branch: Return with expression +0:30 'o' ( temp structure{ temp 3-component vector of float val}) +0:27 Function Definition: main( ( temp void) +0:27 Function Parameters: +0:? Sequence +0:27 move second child to first child ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? 'i' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float val}) +0:27 move second child to first child ( temp uint) +0:? 'cpid' ( temp uint) +0:? 'cpid' ( in uint InvocationID) +0:27 move second child to first child ( temp structure{ temp 3-component vector of float val}) +0:27 indirect index (layout( location=0) out structure{ temp 3-component vector of float val}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float val}) +0:? 'cpid' ( in uint InvocationID) +0:27 Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? 'cpid' ( temp uint) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'cpid' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 3-component vector of float val}) +0:? direct index ( temp structure{ temp 3-component vector of float val}) +0:? 'pcf_out' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 0 (const int) +0:? Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 0 (const uint) +0:? move second child to first child ( temp structure{ temp 3-component vector of float val}) +0:? direct index ( temp structure{ temp 3-component vector of float val}) +0:? 'pcf_out' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 1 (const int) +0:? Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 1 (const uint) +0:? move second child to first child ( temp structure{ temp 3-component vector of float val}) +0:? direct index ( temp structure{ temp 3-component vector of float val}) +0:? 'pcf_out' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 2 (const int) +0:? Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 2 (const uint) +0:? move second child to first child ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Function Call: PCF(struct-hs_out_t-vf31[3]; ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? 'pcf_out' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.tfactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? tfactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.tfactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? tfactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.tfactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 2 (const int) +0:? direct index ( temp float) +0:? tfactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 2 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelInner) +0:? '@patchConstantOutput.flInFactor' ( patch out 2-element array of float TessLevelInner) +0:? Constant: +0:? 0 (const int) +0:? flInFactor: direct index for structure ( temp float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Constant: +0:? 1 (const int) +0:34 Function Definition: PCF(struct-hs_out_t-vf31[3]; ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:34 Function Parameters: +0:34 'pcf_out' ( const (read only) 3-element array of structure{ temp 3-component vector of float val}) +0:? Sequence +0:37 move second child to first child ( temp float) +0:37 direct index ( temp float) +0:37 tfactor: direct index for structure ( temp 3-element array of float) +0:37 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 direct index ( temp float) +0:37 val: direct index for structure ( temp 3-component vector of float) +0:37 direct index ( temp structure{ temp 3-component vector of float val}) +0:37 'pcf_out' ( const (read only) 3-element array of structure{ temp 3-component vector of float val}) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:38 move second child to first child ( temp float) +0:38 direct index ( temp float) +0:38 tfactor: direct index for structure ( temp 3-element array of float) +0:38 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:38 Constant: +0:38 0 (const int) +0:38 Constant: +0:38 1 (const int) +0:38 direct index ( temp float) +0:38 val: direct index for structure ( temp 3-component vector of float) +0:38 direct index ( temp structure{ temp 3-component vector of float val}) +0:38 'pcf_out' ( const (read only) 3-element array of structure{ temp 3-component vector of float val}) +0:38 Constant: +0:38 1 (const int) +0:38 Constant: +0:38 0 (const int) +0:38 Constant: +0:38 0 (const int) +0:39 move second child to first child ( temp float) +0:39 direct index ( temp float) +0:39 tfactor: direct index for structure ( temp 3-element array of float) +0:39 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 2 (const int) +0:39 direct index ( temp float) +0:39 val: direct index for structure ( temp 3-component vector of float) +0:39 direct index ( temp structure{ temp 3-component vector of float val}) +0:39 'pcf_out' ( const (read only) 3-element array of structure{ temp 3-component vector of float val}) +0:39 Constant: +0:39 2 (const int) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 0 (const int) +0:40 move second child to first child ( temp float) +0:40 flInFactor: direct index for structure ( temp float) +0:40 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 4.000000 +0:42 Branch: Return with expression +0:42 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float val}) +0:? 'i' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float val}) +0:? 'cpid' ( in uint InvocationID) +0:? '@patchConstantOutput.tfactor' ( patch out 4-element array of float TessLevelOuter) +0:? '@patchConstantOutput.flInFactor' ( patch out 2-element array of float TessLevelInner) + + +Linked tessellation control stage: + + +Shader version: 500 +vertices = 3 +vertex spacing = fractional_odd_spacing +triangle order = cw +0:? Sequence +0:27 Function Definition: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val}) +0:27 Function Parameters: +0:27 'i' ( in 3-element array of structure{ temp 3-component vector of float val}) +0:27 'cpid' ( in uint) +0:? Sequence +0:29 move second child to first child ( temp 3-component vector of float) +0:29 val: direct index for structure ( temp 3-component vector of float) +0:29 'o' ( temp structure{ temp 3-component vector of float val}) +0:29 Constant: +0:29 0 (const int) +0:29 Construct vec3 ( temp 3-component vector of float) +0:29 Convert uint to float ( temp float) +0:29 'cpid' ( in uint) +0:30 Branch: Return with expression +0:30 'o' ( temp structure{ temp 3-component vector of float val}) +0:27 Function Definition: main( ( temp void) +0:27 Function Parameters: +0:? Sequence +0:27 move second child to first child ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? 'i' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float val}) +0:27 move second child to first child ( temp uint) +0:? 'cpid' ( temp uint) +0:? 'cpid' ( in uint InvocationID) +0:27 move second child to first child ( temp structure{ temp 3-component vector of float val}) +0:27 indirect index (layout( location=0) out structure{ temp 3-component vector of float val}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float val}) +0:? 'cpid' ( in uint InvocationID) +0:27 Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? 'cpid' ( temp uint) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'cpid' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 3-component vector of float val}) +0:? direct index ( temp structure{ temp 3-component vector of float val}) +0:? 'pcf_out' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 0 (const int) +0:? Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 0 (const uint) +0:? move second child to first child ( temp structure{ temp 3-component vector of float val}) +0:? direct index ( temp structure{ temp 3-component vector of float val}) +0:? 'pcf_out' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 1 (const int) +0:? Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 1 (const uint) +0:? move second child to first child ( temp structure{ temp 3-component vector of float val}) +0:? direct index ( temp structure{ temp 3-component vector of float val}) +0:? 'pcf_out' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 2 (const int) +0:? Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 2 (const uint) +0:? move second child to first child ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Function Call: PCF(struct-hs_out_t-vf31[3]; ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? 'pcf_out' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.tfactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? tfactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.tfactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? tfactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.tfactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 2 (const int) +0:? direct index ( temp float) +0:? tfactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 2 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelInner) +0:? '@patchConstantOutput.flInFactor' ( patch out 2-element array of float TessLevelInner) +0:? Constant: +0:? 0 (const int) +0:? flInFactor: direct index for structure ( temp float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Constant: +0:? 1 (const int) +0:34 Function Definition: PCF(struct-hs_out_t-vf31[3]; ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:34 Function Parameters: +0:34 'pcf_out' ( const (read only) 3-element array of structure{ temp 3-component vector of float val}) +0:? Sequence +0:37 move second child to first child ( temp float) +0:37 direct index ( temp float) +0:37 tfactor: direct index for structure ( temp 3-element array of float) +0:37 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 direct index ( temp float) +0:37 val: direct index for structure ( temp 3-component vector of float) +0:37 direct index ( temp structure{ temp 3-component vector of float val}) +0:37 'pcf_out' ( const (read only) 3-element array of structure{ temp 3-component vector of float val}) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:38 move second child to first child ( temp float) +0:38 direct index ( temp float) +0:38 tfactor: direct index for structure ( temp 3-element array of float) +0:38 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:38 Constant: +0:38 0 (const int) +0:38 Constant: +0:38 1 (const int) +0:38 direct index ( temp float) +0:38 val: direct index for structure ( temp 3-component vector of float) +0:38 direct index ( temp structure{ temp 3-component vector of float val}) +0:38 'pcf_out' ( const (read only) 3-element array of structure{ temp 3-component vector of float val}) +0:38 Constant: +0:38 1 (const int) +0:38 Constant: +0:38 0 (const int) +0:38 Constant: +0:38 0 (const int) +0:39 move second child to first child ( temp float) +0:39 direct index ( temp float) +0:39 tfactor: direct index for structure ( temp 3-element array of float) +0:39 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 2 (const int) +0:39 direct index ( temp float) +0:39 val: direct index for structure ( temp 3-component vector of float) +0:39 direct index ( temp structure{ temp 3-component vector of float val}) +0:39 'pcf_out' ( const (read only) 3-element array of structure{ temp 3-component vector of float val}) +0:39 Constant: +0:39 2 (const int) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 0 (const int) +0:40 move second child to first child ( temp float) +0:40 flInFactor: direct index for structure ( temp float) +0:40 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 4.000000 +0:42 Branch: Return with expression +0:42 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float val}) +0:? 'i' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float val}) +0:? 'cpid' ( in uint InvocationID) +0:? '@patchConstantOutput.tfactor' ( patch out 4-element array of float TessLevelOuter) +0:? '@patchConstantOutput.flInFactor' ( patch out 2-element array of float TessLevelInner) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 124 + + Capability Tessellation + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "main" 41 45 48 94 108 + ExecutionMode 4 OutputVertices 3 + ExecutionMode 4 Triangles + ExecutionMode 4 SpacingFractionalOdd + ExecutionMode 4 VertexOrderCw + Source HLSL 500 + Name 4 "main" + Name 8 "hs_in_t" + MemberName 8(hs_in_t) 0 "val" + Name 14 "hs_out_t" + MemberName 14(hs_out_t) 0 "val" + Name 18 "@main(struct-hs_in_t-vf31[3];u1;" + Name 16 "i" + Name 17 "cpid" + Name 22 "hs_pcf_t" + MemberName 22(hs_pcf_t) 0 "tfactor" + MemberName 22(hs_pcf_t) 1 "flInFactor" + Name 25 "PCF(struct-hs_out_t-vf31[3];" + Name 24 "pcf_out" + Name 28 "o" + Name 39 "i" + Name 41 "i" + Name 43 "cpid" + Name 45 "cpid" + Name 48 "@entryPointOutput" + Name 50 "param" + Name 52 "param" + Name 66 "pcf_out" + Name 67 "i" + Name 68 "param" + Name 70 "param" + Name 74 "i" + Name 76 "param" + Name 78 "param" + Name 82 "i" + Name 83 "param" + Name 85 "param" + Name 89 "@patchConstantResult" + Name 94 "@patchConstantOutput.tfactor" + Name 108 "@patchConstantOutput.flInFactor" + Name 112 "o" + Decorate 41(i) Location 0 + Decorate 45(cpid) BuiltIn InvocationId + Decorate 48(@entryPointOutput) Location 0 + Decorate 94(@patchConstantOutput.tfactor) Patch + Decorate 94(@patchConstantOutput.tfactor) BuiltIn TessLevelOuter + Decorate 108(@patchConstantOutput.flInFactor) Patch + Decorate 108(@patchConstantOutput.flInFactor) BuiltIn TessLevelInner + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8(hs_in_t): TypeStruct 7(fvec3) + 9: TypeInt 32 0 + 10: 9(int) Constant 3 + 11: TypeArray 8(hs_in_t) 10 + 12: TypePointer Function 11 + 13: TypePointer Function 9(int) + 14(hs_out_t): TypeStruct 7(fvec3) + 15: TypeFunction 14(hs_out_t) 12(ptr) 13(ptr) + 20: TypeArray 14(hs_out_t) 10 + 21: TypeArray 6(float) 10 + 22(hs_pcf_t): TypeStruct 21 6(float) + 23: TypeFunction 22(hs_pcf_t) 20 + 27: TypePointer Function 14(hs_out_t) + 29: TypeInt 32 1 + 30: 29(int) Constant 0 + 34: TypePointer Function 7(fvec3) + 40: TypePointer Input 11 + 41(i): 40(ptr) Variable Input + 44: TypePointer Input 9(int) + 45(cpid): 44(ptr) Variable Input + 47: TypePointer Output 20 +48(@entryPointOutput): 47(ptr) Variable Output + 55: TypePointer Output 14(hs_out_t) + 57: 9(int) Constant 2 + 58: 9(int) Constant 4 + 59: 9(int) Constant 0 + 61: TypeBool + 65: TypePointer Function 20 + 73: 29(int) Constant 1 + 75: 9(int) Constant 1 + 81: 29(int) Constant 2 + 88: TypePointer Function 22(hs_pcf_t) + 92: TypeArray 6(float) 58 + 93: TypePointer Output 92 +94(@patchConstantOutput.tfactor): 93(ptr) Variable Output + 95: TypePointer Function 6(float) + 98: TypePointer Output 6(float) + 106: TypeArray 6(float) 57 + 107: TypePointer Output 106 +108(@patchConstantOutput.flInFactor): 107(ptr) Variable Output + 119: 6(float) Constant 1082130432 + 4(main): 2 Function None 3 + 5: Label + 39(i): 12(ptr) Variable Function + 43(cpid): 13(ptr) Variable Function + 50(param): 12(ptr) Variable Function + 52(param): 13(ptr) Variable Function + 66(pcf_out): 65(ptr) Variable Function + 67(i): 12(ptr) Variable Function + 68(param): 12(ptr) Variable Function + 70(param): 13(ptr) Variable Function + 74(i): 12(ptr) Variable Function + 76(param): 12(ptr) Variable Function + 78(param): 13(ptr) Variable Function + 82(i): 12(ptr) Variable Function + 83(param): 12(ptr) Variable Function + 85(param): 13(ptr) Variable Function +89(@patchConstantResult): 88(ptr) Variable Function + 42: 11 Load 41(i) + Store 39(i) 42 + 46: 9(int) Load 45(cpid) + Store 43(cpid) 46 + 49: 9(int) Load 45(cpid) + 51: 11 Load 39(i) + Store 50(param) 51 + 53: 9(int) Load 43(cpid) + Store 52(param) 53 + 54:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 50(param) 52(param) + 56: 55(ptr) AccessChain 48(@entryPointOutput) 49 + Store 56 54 + ControlBarrier 57 58 59 + 60: 9(int) Load 45(cpid) + 62: 61(bool) IEqual 60 30 + SelectionMerge 64 None + BranchConditional 62 63 64 + 63: Label + 69: 11 Load 67(i) + Store 68(param) 69 + Store 70(param) 59 + 71:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 68(param) 70(param) + 72: 27(ptr) AccessChain 66(pcf_out) 30 + Store 72 71 + 77: 11 Load 74(i) + Store 76(param) 77 + Store 78(param) 75 + 79:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 76(param) 78(param) + 80: 27(ptr) AccessChain 66(pcf_out) 73 + Store 80 79 + 84: 11 Load 82(i) + Store 83(param) 84 + Store 85(param) 57 + 86:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 83(param) 85(param) + 87: 27(ptr) AccessChain 66(pcf_out) 81 + Store 87 86 + 90: 20 Load 66(pcf_out) + 91:22(hs_pcf_t) FunctionCall 25(PCF(struct-hs_out_t-vf31[3];) 90 + Store 89(@patchConstantResult) 91 + 96: 95(ptr) AccessChain 89(@patchConstantResult) 30 30 + 97: 6(float) Load 96 + 99: 98(ptr) AccessChain 94(@patchConstantOutput.tfactor) 30 + Store 99 97 + 100: 95(ptr) AccessChain 89(@patchConstantResult) 30 73 + 101: 6(float) Load 100 + 102: 98(ptr) AccessChain 94(@patchConstantOutput.tfactor) 73 + Store 102 101 + 103: 95(ptr) AccessChain 89(@patchConstantResult) 30 81 + 104: 6(float) Load 103 + 105: 98(ptr) AccessChain 94(@patchConstantOutput.tfactor) 81 + Store 105 104 + 109: 95(ptr) AccessChain 89(@patchConstantResult) 73 + 110: 6(float) Load 109 + 111: 98(ptr) AccessChain 108(@patchConstantOutput.flInFactor) 30 + Store 111 110 + Branch 64 + 64: Label + Return + FunctionEnd +18(@main(struct-hs_in_t-vf31[3];u1;):14(hs_out_t) Function None 15 + 16(i): 12(ptr) FunctionParameter + 17(cpid): 13(ptr) FunctionParameter + 19: Label + 28(o): 27(ptr) Variable Function + 31: 9(int) Load 17(cpid) + 32: 6(float) ConvertUToF 31 + 33: 7(fvec3) CompositeConstruct 32 32 32 + 35: 34(ptr) AccessChain 28(o) 30 + Store 35 33 + 36:14(hs_out_t) Load 28(o) + ReturnValue 36 + FunctionEnd +25(PCF(struct-hs_out_t-vf31[3];):22(hs_pcf_t) Function None 23 + 24(pcf_out): 20 FunctionParameter + 26: Label + 112(o): 88(ptr) Variable Function + 113: 6(float) CompositeExtract 24(pcf_out) 0 0 0 + 114: 95(ptr) AccessChain 112(o) 30 30 + Store 114 113 + 115: 6(float) CompositeExtract 24(pcf_out) 1 0 0 + 116: 95(ptr) AccessChain 112(o) 30 73 + Store 116 115 + 117: 6(float) CompositeExtract 24(pcf_out) 2 0 0 + 118: 95(ptr) AccessChain 112(o) 30 81 + Store 118 117 + 120: 95(ptr) AccessChain 112(o) 73 + Store 120 119 + 121:22(hs_pcf_t) Load 112(o) + ReturnValue 121 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.hull.ctrlpt-2.tesc.out b/deps/glslang/Test/baseResults/hlsl.hull.ctrlpt-2.tesc.out new file mode 100644 index 00000000..986e1102 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.hull.ctrlpt-2.tesc.out @@ -0,0 +1,625 @@ +hlsl.hull.ctrlpt-2.tesc +Shader version: 500 +vertices = 3 +vertex spacing = fractional_odd_spacing +triangle order = cw +0:? Sequence +0:28 Function Definition: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val}) +0:28 Function Parameters: +0:28 'i' ( in 3-element array of structure{ temp 3-component vector of float val}) +0:28 'cpid' ( in uint) +0:? Sequence +0:29 val: direct index for structure ( temp 3-component vector of float) +0:29 direct index ( temp structure{ temp 3-component vector of float val}) +0:29 'i' ( in 3-element array of structure{ temp 3-component vector of float val}) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 0 (const int) +0:32 move second child to first child ( temp 3-component vector of float) +0:32 val: direct index for structure ( temp 3-component vector of float) +0:32 'o' ( temp structure{ temp 3-component vector of float val}) +0:32 Constant: +0:32 0 (const int) +0:32 Construct vec3 ( temp 3-component vector of float) +0:32 Convert uint to float ( temp float) +0:32 'cpid' ( in uint) +0:33 Branch: Return with expression +0:33 'o' ( temp structure{ temp 3-component vector of float val}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 move second child to first child ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? 'i' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float val}) +0:28 move second child to first child ( temp uint) +0:? 'cpid' ( temp uint) +0:? 'cpid' ( in uint InvocationID) +0:28 move second child to first child ( temp structure{ temp 3-component vector of float val}) +0:28 indirect index (layout( location=0) out structure{ temp 3-component vector of float val}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float val}) +0:? 'cpid' ( in uint InvocationID) +0:28 Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? 'cpid' ( temp uint) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'cpid' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 3-component vector of float val}) +0:? direct index ( temp structure{ temp 3-component vector of float val}) +0:? 'pcf_out' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 0 (const int) +0:? Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 0 (const uint) +0:? move second child to first child ( temp structure{ temp 3-component vector of float val}) +0:? direct index ( temp structure{ temp 3-component vector of float val}) +0:? 'pcf_out' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 1 (const int) +0:? Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 1 (const uint) +0:? move second child to first child ( temp structure{ temp 3-component vector of float val}) +0:? direct index ( temp structure{ temp 3-component vector of float val}) +0:? 'pcf_out' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 2 (const int) +0:? Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 2 (const uint) +0:? move second child to first child ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Function Call: PCF(struct-hs_out_t-vf31[3];struct-hs_in_t-vf31[3]; ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? 'pcf_out' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.tfactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? tfactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.tfactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? tfactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.tfactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 2 (const int) +0:? direct index ( temp float) +0:? tfactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 2 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelInner) +0:? '@patchConstantOutput.flInFactor' ( patch out 2-element array of float TessLevelInner) +0:? Constant: +0:? 0 (const int) +0:? flInFactor: direct index for structure ( temp float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Constant: +0:? 1 (const int) +0:38 Function Definition: PCF(struct-hs_out_t-vf31[3];struct-hs_in_t-vf31[3]; ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:38 Function Parameters: +0:38 'pcf_out' ( const (read only) 3-element array of structure{ temp 3-component vector of float val}) +0:38 'pcf_in' ( const (read only) 3-element array of structure{ temp 3-component vector of float val}) +0:? Sequence +0:41 move second child to first child ( temp float) +0:41 direct index ( temp float) +0:41 tfactor: direct index for structure ( temp 3-element array of float) +0:41 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 0 (const int) +0:41 direct index ( temp float) +0:41 val: direct index for structure ( temp 3-component vector of float) +0:41 direct index ( temp structure{ temp 3-component vector of float val}) +0:41 'pcf_out' ( const (read only) 3-element array of structure{ temp 3-component vector of float val}) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 0 (const int) +0:42 move second child to first child ( temp float) +0:42 direct index ( temp float) +0:42 tfactor: direct index for structure ( temp 3-element array of float) +0:42 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 direct index ( temp float) +0:42 val: direct index for structure ( temp 3-component vector of float) +0:42 direct index ( temp structure{ temp 3-component vector of float val}) +0:42 'pcf_out' ( const (read only) 3-element array of structure{ temp 3-component vector of float val}) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 0 (const int) +0:43 move second child to first child ( temp float) +0:43 direct index ( temp float) +0:43 tfactor: direct index for structure ( temp 3-element array of float) +0:43 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:43 Constant: +0:43 0 (const int) +0:43 Constant: +0:43 2 (const int) +0:43 direct index ( temp float) +0:43 val: direct index for structure ( temp 3-component vector of float) +0:43 direct index ( temp structure{ temp 3-component vector of float val}) +0:43 'pcf_out' ( const (read only) 3-element array of structure{ temp 3-component vector of float val}) +0:43 Constant: +0:43 2 (const int) +0:43 Constant: +0:43 0 (const int) +0:43 Constant: +0:43 0 (const int) +0:44 move second child to first child ( temp float) +0:44 flInFactor: direct index for structure ( temp float) +0:44 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:44 Constant: +0:44 1 (const int) +0:44 Constant: +0:44 4.000000 +0:46 Branch: Return with expression +0:46 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float val}) +0:? 'i' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float val}) +0:? 'cpid' ( in uint InvocationID) +0:? '@patchConstantOutput.tfactor' ( patch out 4-element array of float TessLevelOuter) +0:? '@patchConstantOutput.flInFactor' ( patch out 2-element array of float TessLevelInner) + + +Linked tessellation control stage: + + +Shader version: 500 +vertices = 3 +vertex spacing = fractional_odd_spacing +triangle order = cw +0:? Sequence +0:28 Function Definition: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val}) +0:28 Function Parameters: +0:28 'i' ( in 3-element array of structure{ temp 3-component vector of float val}) +0:28 'cpid' ( in uint) +0:? Sequence +0:29 val: direct index for structure ( temp 3-component vector of float) +0:29 direct index ( temp structure{ temp 3-component vector of float val}) +0:29 'i' ( in 3-element array of structure{ temp 3-component vector of float val}) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 0 (const int) +0:32 move second child to first child ( temp 3-component vector of float) +0:32 val: direct index for structure ( temp 3-component vector of float) +0:32 'o' ( temp structure{ temp 3-component vector of float val}) +0:32 Constant: +0:32 0 (const int) +0:32 Construct vec3 ( temp 3-component vector of float) +0:32 Convert uint to float ( temp float) +0:32 'cpid' ( in uint) +0:33 Branch: Return with expression +0:33 'o' ( temp structure{ temp 3-component vector of float val}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 move second child to first child ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? 'i' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float val}) +0:28 move second child to first child ( temp uint) +0:? 'cpid' ( temp uint) +0:? 'cpid' ( in uint InvocationID) +0:28 move second child to first child ( temp structure{ temp 3-component vector of float val}) +0:28 indirect index (layout( location=0) out structure{ temp 3-component vector of float val}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float val}) +0:? 'cpid' ( in uint InvocationID) +0:28 Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? 'cpid' ( temp uint) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'cpid' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 3-component vector of float val}) +0:? direct index ( temp structure{ temp 3-component vector of float val}) +0:? 'pcf_out' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 0 (const int) +0:? Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 0 (const uint) +0:? move second child to first child ( temp structure{ temp 3-component vector of float val}) +0:? direct index ( temp structure{ temp 3-component vector of float val}) +0:? 'pcf_out' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 1 (const int) +0:? Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 1 (const uint) +0:? move second child to first child ( temp structure{ temp 3-component vector of float val}) +0:? direct index ( temp structure{ temp 3-component vector of float val}) +0:? 'pcf_out' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 2 (const int) +0:? Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Constant: +0:? 2 (const uint) +0:? move second child to first child ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Function Call: PCF(struct-hs_out_t-vf31[3];struct-hs_in_t-vf31[3]; ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? 'pcf_out' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val}) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.tfactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? tfactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.tfactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? tfactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.tfactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 2 (const int) +0:? direct index ( temp float) +0:? tfactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 2 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelInner) +0:? '@patchConstantOutput.flInFactor' ( patch out 2-element array of float TessLevelInner) +0:? Constant: +0:? 0 (const int) +0:? flInFactor: direct index for structure ( temp float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Constant: +0:? 1 (const int) +0:38 Function Definition: PCF(struct-hs_out_t-vf31[3];struct-hs_in_t-vf31[3]; ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:38 Function Parameters: +0:38 'pcf_out' ( const (read only) 3-element array of structure{ temp 3-component vector of float val}) +0:38 'pcf_in' ( const (read only) 3-element array of structure{ temp 3-component vector of float val}) +0:? Sequence +0:41 move second child to first child ( temp float) +0:41 direct index ( temp float) +0:41 tfactor: direct index for structure ( temp 3-element array of float) +0:41 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 0 (const int) +0:41 direct index ( temp float) +0:41 val: direct index for structure ( temp 3-component vector of float) +0:41 direct index ( temp structure{ temp 3-component vector of float val}) +0:41 'pcf_out' ( const (read only) 3-element array of structure{ temp 3-component vector of float val}) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 0 (const int) +0:42 move second child to first child ( temp float) +0:42 direct index ( temp float) +0:42 tfactor: direct index for structure ( temp 3-element array of float) +0:42 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 direct index ( temp float) +0:42 val: direct index for structure ( temp 3-component vector of float) +0:42 direct index ( temp structure{ temp 3-component vector of float val}) +0:42 'pcf_out' ( const (read only) 3-element array of structure{ temp 3-component vector of float val}) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 0 (const int) +0:43 move second child to first child ( temp float) +0:43 direct index ( temp float) +0:43 tfactor: direct index for structure ( temp 3-element array of float) +0:43 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:43 Constant: +0:43 0 (const int) +0:43 Constant: +0:43 2 (const int) +0:43 direct index ( temp float) +0:43 val: direct index for structure ( temp 3-component vector of float) +0:43 direct index ( temp structure{ temp 3-component vector of float val}) +0:43 'pcf_out' ( const (read only) 3-element array of structure{ temp 3-component vector of float val}) +0:43 Constant: +0:43 2 (const int) +0:43 Constant: +0:43 0 (const int) +0:43 Constant: +0:43 0 (const int) +0:44 move second child to first child ( temp float) +0:44 flInFactor: direct index for structure ( temp float) +0:44 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:44 Constant: +0:44 1 (const int) +0:44 Constant: +0:44 4.000000 +0:46 Branch: Return with expression +0:46 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float val}) +0:? 'i' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float val}) +0:? 'cpid' ( in uint InvocationID) +0:? '@patchConstantOutput.tfactor' ( patch out 4-element array of float TessLevelOuter) +0:? '@patchConstantOutput.flInFactor' ( patch out 2-element array of float TessLevelInner) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 126 + + Capability Tessellation + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "main" 42 46 49 96 110 + ExecutionMode 4 OutputVertices 3 + ExecutionMode 4 Triangles + ExecutionMode 4 SpacingFractionalOdd + ExecutionMode 4 VertexOrderCw + Source HLSL 500 + Name 4 "main" + Name 8 "hs_in_t" + MemberName 8(hs_in_t) 0 "val" + Name 14 "hs_out_t" + MemberName 14(hs_out_t) 0 "val" + Name 18 "@main(struct-hs_in_t-vf31[3];u1;" + Name 16 "i" + Name 17 "cpid" + Name 22 "hs_pcf_t" + MemberName 22(hs_pcf_t) 0 "tfactor" + MemberName 22(hs_pcf_t) 1 "flInFactor" + Name 26 "PCF(struct-hs_out_t-vf31[3];struct-hs_in_t-vf31[3];" + Name 24 "pcf_out" + Name 25 "pcf_in" + Name 31 "o" + Name 40 "i" + Name 42 "i" + Name 44 "cpid" + Name 46 "cpid" + Name 49 "@entryPointOutput" + Name 51 "param" + Name 53 "param" + Name 67 "pcf_out" + Name 68 "i" + Name 69 "param" + Name 71 "param" + Name 75 "i" + Name 77 "param" + Name 79 "param" + Name 83 "i" + Name 84 "param" + Name 86 "param" + Name 90 "@patchConstantResult" + Name 96 "@patchConstantOutput.tfactor" + Name 110 "@patchConstantOutput.flInFactor" + Name 114 "o" + Decorate 42(i) Location 0 + Decorate 46(cpid) BuiltIn InvocationId + Decorate 49(@entryPointOutput) Location 0 + Decorate 96(@patchConstantOutput.tfactor) Patch + Decorate 96(@patchConstantOutput.tfactor) BuiltIn TessLevelOuter + Decorate 110(@patchConstantOutput.flInFactor) Patch + Decorate 110(@patchConstantOutput.flInFactor) BuiltIn TessLevelInner + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8(hs_in_t): TypeStruct 7(fvec3) + 9: TypeInt 32 0 + 10: 9(int) Constant 3 + 11: TypeArray 8(hs_in_t) 10 + 12: TypePointer Function 11 + 13: TypePointer Function 9(int) + 14(hs_out_t): TypeStruct 7(fvec3) + 15: TypeFunction 14(hs_out_t) 12(ptr) 13(ptr) + 20: TypeArray 14(hs_out_t) 10 + 21: TypeArray 6(float) 10 + 22(hs_pcf_t): TypeStruct 21 6(float) + 23: TypeFunction 22(hs_pcf_t) 20 11 + 28: TypeInt 32 1 + 29: 28(int) Constant 0 + 30: TypePointer Function 14(hs_out_t) + 35: TypePointer Function 7(fvec3) + 41: TypePointer Input 11 + 42(i): 41(ptr) Variable Input + 45: TypePointer Input 9(int) + 46(cpid): 45(ptr) Variable Input + 48: TypePointer Output 20 +49(@entryPointOutput): 48(ptr) Variable Output + 56: TypePointer Output 14(hs_out_t) + 58: 9(int) Constant 2 + 59: 9(int) Constant 4 + 60: 9(int) Constant 0 + 62: TypeBool + 66: TypePointer Function 20 + 74: 28(int) Constant 1 + 76: 9(int) Constant 1 + 82: 28(int) Constant 2 + 89: TypePointer Function 22(hs_pcf_t) + 94: TypeArray 6(float) 59 + 95: TypePointer Output 94 +96(@patchConstantOutput.tfactor): 95(ptr) Variable Output + 97: TypePointer Function 6(float) + 100: TypePointer Output 6(float) + 108: TypeArray 6(float) 58 + 109: TypePointer Output 108 +110(@patchConstantOutput.flInFactor): 109(ptr) Variable Output + 121: 6(float) Constant 1082130432 + 4(main): 2 Function None 3 + 5: Label + 40(i): 12(ptr) Variable Function + 44(cpid): 13(ptr) Variable Function + 51(param): 12(ptr) Variable Function + 53(param): 13(ptr) Variable Function + 67(pcf_out): 66(ptr) Variable Function + 68(i): 12(ptr) Variable Function + 69(param): 12(ptr) Variable Function + 71(param): 13(ptr) Variable Function + 75(i): 12(ptr) Variable Function + 77(param): 12(ptr) Variable Function + 79(param): 13(ptr) Variable Function + 83(i): 12(ptr) Variable Function + 84(param): 12(ptr) Variable Function + 86(param): 13(ptr) Variable Function +90(@patchConstantResult): 89(ptr) Variable Function + 43: 11 Load 42(i) + Store 40(i) 43 + 47: 9(int) Load 46(cpid) + Store 44(cpid) 47 + 50: 9(int) Load 46(cpid) + 52: 11 Load 40(i) + Store 51(param) 52 + 54: 9(int) Load 44(cpid) + Store 53(param) 54 + 55:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 51(param) 53(param) + 57: 56(ptr) AccessChain 49(@entryPointOutput) 50 + Store 57 55 + ControlBarrier 58 59 60 + 61: 9(int) Load 46(cpid) + 63: 62(bool) IEqual 61 29 + SelectionMerge 65 None + BranchConditional 63 64 65 + 64: Label + 70: 11 Load 68(i) + Store 69(param) 70 + Store 71(param) 60 + 72:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 69(param) 71(param) + 73: 30(ptr) AccessChain 67(pcf_out) 29 + Store 73 72 + 78: 11 Load 75(i) + Store 77(param) 78 + Store 79(param) 76 + 80:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 77(param) 79(param) + 81: 30(ptr) AccessChain 67(pcf_out) 74 + Store 81 80 + 85: 11 Load 83(i) + Store 84(param) 85 + Store 86(param) 58 + 87:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 84(param) 86(param) + 88: 30(ptr) AccessChain 67(pcf_out) 82 + Store 88 87 + 91: 20 Load 67(pcf_out) + 92: 11 Load 40(i) + 93:22(hs_pcf_t) FunctionCall 26(PCF(struct-hs_out_t-vf31[3];struct-hs_in_t-vf31[3];) 91 92 + Store 90(@patchConstantResult) 93 + 98: 97(ptr) AccessChain 90(@patchConstantResult) 29 29 + 99: 6(float) Load 98 + 101: 100(ptr) AccessChain 96(@patchConstantOutput.tfactor) 29 + Store 101 99 + 102: 97(ptr) AccessChain 90(@patchConstantResult) 29 74 + 103: 6(float) Load 102 + 104: 100(ptr) AccessChain 96(@patchConstantOutput.tfactor) 74 + Store 104 103 + 105: 97(ptr) AccessChain 90(@patchConstantResult) 29 82 + 106: 6(float) Load 105 + 107: 100(ptr) AccessChain 96(@patchConstantOutput.tfactor) 82 + Store 107 106 + 111: 97(ptr) AccessChain 90(@patchConstantResult) 74 + 112: 6(float) Load 111 + 113: 100(ptr) AccessChain 110(@patchConstantOutput.flInFactor) 29 + Store 113 112 + Branch 65 + 65: Label + Return + FunctionEnd +18(@main(struct-hs_in_t-vf31[3];u1;):14(hs_out_t) Function None 15 + 16(i): 12(ptr) FunctionParameter + 17(cpid): 13(ptr) FunctionParameter + 19: Label + 31(o): 30(ptr) Variable Function + 32: 9(int) Load 17(cpid) + 33: 6(float) ConvertUToF 32 + 34: 7(fvec3) CompositeConstruct 33 33 33 + 36: 35(ptr) AccessChain 31(o) 29 + Store 36 34 + 37:14(hs_out_t) Load 31(o) + ReturnValue 37 + FunctionEnd +26(PCF(struct-hs_out_t-vf31[3];struct-hs_in_t-vf31[3];):22(hs_pcf_t) Function None 23 + 24(pcf_out): 20 FunctionParameter + 25(pcf_in): 11 FunctionParameter + 27: Label + 114(o): 89(ptr) Variable Function + 115: 6(float) CompositeExtract 24(pcf_out) 0 0 0 + 116: 97(ptr) AccessChain 114(o) 29 29 + Store 116 115 + 117: 6(float) CompositeExtract 24(pcf_out) 1 0 0 + 118: 97(ptr) AccessChain 114(o) 29 74 + Store 118 117 + 119: 6(float) CompositeExtract 24(pcf_out) 2 0 0 + 120: 97(ptr) AccessChain 114(o) 29 82 + Store 120 119 + 122: 97(ptr) AccessChain 114(o) 74 + Store 122 121 + 123:22(hs_pcf_t) Load 114(o) + ReturnValue 123 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.hull.void.tesc.out b/deps/glslang/Test/baseResults/hlsl.hull.void.tesc.out new file mode 100644 index 00000000..c44c7e4d --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.hull.void.tesc.out @@ -0,0 +1,204 @@ +hlsl.hull.void.tesc +Shader version: 500 +vertices = 3 +vertex spacing = fractional_even_spacing +triangle order = ccw +0:? Sequence +0:26 Function Definition: @main(struct-VS_OUT-vf31[3]; ( temp structure{ temp 3-component vector of float cpoint}) +0:26 Function Parameters: +0:26 'ip' ( in 3-element array of structure{ temp 3-component vector of float cpoint}) +0:? Sequence +0:28 move second child to first child ( temp 3-component vector of float) +0:28 cpoint: direct index for structure ( temp 3-component vector of float) +0:28 'output' ( temp structure{ temp 3-component vector of float cpoint}) +0:28 Constant: +0:28 0 (const int) +0:28 cpoint: direct index for structure ( temp 3-component vector of float) +0:28 direct index ( temp structure{ temp 3-component vector of float cpoint}) +0:28 'ip' ( in 3-element array of structure{ temp 3-component vector of float cpoint}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 0 (const int) +0:29 Branch: Return with expression +0:29 'output' ( temp structure{ temp 3-component vector of float cpoint}) +0:26 Function Definition: main( ( temp void) +0:26 Function Parameters: +0:? Sequence +0:26 move second child to first child ( temp 3-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' ( temp 3-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float cpoint}) +0:26 move second child to first child ( temp structure{ temp 3-component vector of float cpoint}) +0:26 indirect index (layout( location=0) out structure{ temp 3-component vector of float cpoint}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'InvocationId' ( in uint InvocationID) +0:26 Function Call: @main(struct-VS_OUT-vf31[3]; ( temp structure{ temp 3-component vector of float cpoint}) +0:? 'ip' ( temp 3-element array of structure{ temp 3-component vector of float cpoint}) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'InvocationId' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? Function Call: PCF( ( temp void) +0:33 Function Definition: PCF( ( temp void) +0:33 Function Parameters: +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'InvocationId' ( in uint InvocationID) + + +Linked tessellation control stage: + + +Shader version: 500 +vertices = 3 +vertex spacing = fractional_even_spacing +triangle order = ccw +0:? Sequence +0:26 Function Definition: @main(struct-VS_OUT-vf31[3]; ( temp structure{ temp 3-component vector of float cpoint}) +0:26 Function Parameters: +0:26 'ip' ( in 3-element array of structure{ temp 3-component vector of float cpoint}) +0:? Sequence +0:28 move second child to first child ( temp 3-component vector of float) +0:28 cpoint: direct index for structure ( temp 3-component vector of float) +0:28 'output' ( temp structure{ temp 3-component vector of float cpoint}) +0:28 Constant: +0:28 0 (const int) +0:28 cpoint: direct index for structure ( temp 3-component vector of float) +0:28 direct index ( temp structure{ temp 3-component vector of float cpoint}) +0:28 'ip' ( in 3-element array of structure{ temp 3-component vector of float cpoint}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 0 (const int) +0:29 Branch: Return with expression +0:29 'output' ( temp structure{ temp 3-component vector of float cpoint}) +0:26 Function Definition: main( ( temp void) +0:26 Function Parameters: +0:? Sequence +0:26 move second child to first child ( temp 3-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' ( temp 3-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float cpoint}) +0:26 move second child to first child ( temp structure{ temp 3-component vector of float cpoint}) +0:26 indirect index (layout( location=0) out structure{ temp 3-component vector of float cpoint}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'InvocationId' ( in uint InvocationID) +0:26 Function Call: @main(struct-VS_OUT-vf31[3]; ( temp structure{ temp 3-component vector of float cpoint}) +0:? 'ip' ( temp 3-element array of structure{ temp 3-component vector of float cpoint}) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'InvocationId' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? Function Call: PCF( ( temp void) +0:33 Function Definition: PCF( ( temp void) +0:33 Function Parameters: +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'ip' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float cpoint}) +0:? 'InvocationId' ( in uint InvocationID) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 55 + + Capability Tessellation + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "main" 33 37 39 + ExecutionMode 4 OutputVertices 3 + ExecutionMode 4 Triangles + ExecutionMode 4 SpacingFractionalEven + ExecutionMode 4 VertexOrderCcw + Source HLSL 500 + Name 4 "main" + Name 8 "VS_OUT" + MemberName 8(VS_OUT) 0 "cpoint" + Name 13 "HS_OUT" + MemberName 13(HS_OUT) 0 "cpoint" + Name 16 "@main(struct-VS_OUT-vf31[3];" + Name 15 "ip" + Name 18 "PCF(" + Name 21 "output" + Name 31 "ip" + Name 33 "ip" + Name 37 "@entryPointOutput" + Name 39 "InvocationId" + Name 41 "param" + Decorate 33(ip) Location 0 + Decorate 37(@entryPointOutput) Location 0 + Decorate 39(InvocationId) BuiltIn InvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8(VS_OUT): TypeStruct 7(fvec3) + 9: TypeInt 32 0 + 10: 9(int) Constant 3 + 11: TypeArray 8(VS_OUT) 10 + 12: TypePointer Function 11 + 13(HS_OUT): TypeStruct 7(fvec3) + 14: TypeFunction 13(HS_OUT) 12(ptr) + 20: TypePointer Function 13(HS_OUT) + 22: TypeInt 32 1 + 23: 22(int) Constant 0 + 24: TypePointer Function 7(fvec3) + 32: TypePointer Input 11 + 33(ip): 32(ptr) Variable Input + 35: TypeArray 13(HS_OUT) 10 + 36: TypePointer Output 35 +37(@entryPointOutput): 36(ptr) Variable Output + 38: TypePointer Input 9(int) +39(InvocationId): 38(ptr) Variable Input + 44: TypePointer Output 13(HS_OUT) + 46: 9(int) Constant 2 + 47: 9(int) Constant 4 + 48: 9(int) Constant 0 + 50: TypeBool + 4(main): 2 Function None 3 + 5: Label + 31(ip): 12(ptr) Variable Function + 41(param): 12(ptr) Variable Function + 34: 11 Load 33(ip) + Store 31(ip) 34 + 40: 9(int) Load 39(InvocationId) + 42: 11 Load 31(ip) + Store 41(param) 42 + 43: 13(HS_OUT) FunctionCall 16(@main(struct-VS_OUT-vf31[3];) 41(param) + 45: 44(ptr) AccessChain 37(@entryPointOutput) 40 + Store 45 43 + ControlBarrier 46 47 48 + 49: 9(int) Load 39(InvocationId) + 51: 50(bool) IEqual 49 23 + SelectionMerge 53 None + BranchConditional 51 52 53 + 52: Label + 54: 2 FunctionCall 18(PCF() + Branch 53 + 53: Label + Return + FunctionEnd +16(@main(struct-VS_OUT-vf31[3];): 13(HS_OUT) Function None 14 + 15(ip): 12(ptr) FunctionParameter + 17: Label + 21(output): 20(ptr) Variable Function + 25: 24(ptr) AccessChain 15(ip) 23 23 + 26: 7(fvec3) Load 25 + 27: 24(ptr) AccessChain 21(output) 23 + Store 27 26 + 28: 13(HS_OUT) Load 21(output) + ReturnValue 28 + FunctionEnd + 18(PCF(): 2 Function None 3 + 19: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.identifier.sample.frag.out b/deps/glslang/Test/baseResults/hlsl.identifier.sample.frag.out new file mode 100644 index 00000000..a23451ec --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.identifier.sample.frag.out @@ -0,0 +1,139 @@ +hlsl.identifier.sample.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:9 Function Definition: sample(i1; ( temp int) +0:9 Function Parameters: +0:9 'x' ( in int) +0:? Sequence +0:9 Branch: Return with expression +0:9 'x' ( in int) +0:12 Function Definition: @main( ( temp 4-component vector of float) +0:12 Function Parameters: +0:? Sequence +0:15 Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:15 'sample' ( temp 4-component vector of float) +0:? Constant: +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 6.000000 +0:17 Branch: Return with expression +0:17 vector swizzle ( temp 4-component vector of float) +0:17 'sample' ( temp 4-component vector of float) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 3 (const int) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:12 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:9 Function Definition: sample(i1; ( temp int) +0:9 Function Parameters: +0:9 'x' ( in int) +0:? Sequence +0:9 Branch: Return with expression +0:9 'x' ( in int) +0:12 Function Definition: @main( ( temp 4-component vector of float) +0:12 Function Parameters: +0:? Sequence +0:15 Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:15 'sample' ( temp 4-component vector of float) +0:? Constant: +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 6.000000 +0:17 Branch: Return with expression +0:17 vector swizzle ( temp 4-component vector of float) +0:17 'sample' ( temp 4-component vector of float) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 3 (const int) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:12 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 33 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 31 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 10 "sample(i1;" + Name 9 "x" + Name 15 "@main(" + Name 21 "sample" + Name 31 "@entryPointOutput" + Decorate 31(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 8: TypeFunction 6(int) 7(ptr) + 12: TypeFloat 32 + 13: TypeVector 12(float) 4 + 14: TypeFunction 13(fvec4) + 20: TypePointer Function 13(fvec4) + 22: 12(float) Constant 1077936128 + 23: 12(float) Constant 1082130432 + 24: 12(float) Constant 1084227584 + 25: 12(float) Constant 1086324736 + 26: 13(fvec4) ConstantComposite 22 23 24 25 + 30: TypePointer Output 13(fvec4) +31(@entryPointOutput): 30(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 32: 13(fvec4) FunctionCall 15(@main() + Store 31(@entryPointOutput) 32 + Return + FunctionEnd + 10(sample(i1;): 6(int) Function None 8 + 9(x): 7(ptr) FunctionParameter + 11: Label + 17: 6(int) Load 9(x) + ReturnValue 17 + FunctionEnd + 15(@main(): 13(fvec4) Function None 14 + 16: Label + 21(sample): 20(ptr) Variable Function + Store 21(sample) 26 + 27: 13(fvec4) Load 21(sample) + ReturnValue 27 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.if.frag.out b/deps/glslang/Test/baseResults/hlsl.if.frag.out new file mode 100644 index 00000000..056b672e --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.if.frag.out @@ -0,0 +1,370 @@ +hlsl.if.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' ( in 4-component vector of float) +0:? Sequence +0:3 Test condition and select ( temp void) +0:3 Condition +0:3 all ( temp bool) +0:3 Equal ( temp 4-component vector of bool) +0:3 'input' ( in 4-component vector of float) +0:3 'input' ( in 4-component vector of float) +0:3 true case +0:4 Branch: Return with expression +0:4 'input' ( in 4-component vector of float) +0:6 Test condition and select ( temp void) +0:6 Condition +0:6 all ( temp bool) +0:6 Equal ( temp 4-component vector of bool) +0:6 'input' ( in 4-component vector of float) +0:6 'input' ( in 4-component vector of float) +0:6 true case +0:7 Branch: Return with expression +0:7 'input' ( in 4-component vector of float) +0:6 false case +0:9 Branch: Return with expression +0:9 Negate value ( temp 4-component vector of float) +0:9 'input' ( in 4-component vector of float) +0:11 Test condition and select ( temp void) +0:11 Condition +0:11 all ( temp bool) +0:11 Equal ( temp 4-component vector of bool) +0:11 'input' ( in 4-component vector of float) +0:11 'input' ( in 4-component vector of float) +0:11 true case is null +0:14 Test condition and select ( temp void) +0:14 Condition +0:14 all ( temp bool) +0:14 Equal ( temp 4-component vector of bool) +0:14 'input' ( in 4-component vector of float) +0:14 'input' ( in 4-component vector of float) +0:14 true case is null +0:19 Test condition and select ( temp void): Flatten +0:19 Condition +0:19 all ( temp bool) +0:19 Equal ( temp 4-component vector of bool) +0:19 'input' ( in 4-component vector of float) +0:19 'input' ( in 4-component vector of float) +0:19 true case +0:? Sequence +0:20 Branch: Return with expression +0:20 'input' ( in 4-component vector of float) +0:23 Test condition and select ( temp void) +0:23 Condition +0:23 all ( temp bool) +0:23 Equal ( temp 4-component vector of bool) +0:23 'input' ( in 4-component vector of float) +0:23 'input' ( in 4-component vector of float) +0:23 true case +0:? Sequence +0:24 Branch: Return with expression +0:24 'input' ( in 4-component vector of float) +0:23 false case +0:? Sequence +0:26 Branch: Return with expression +0:26 Negate value ( temp 4-component vector of float) +0:26 'input' ( in 4-component vector of float) +0:30 Test condition and select ( temp void) +0:30 Condition +0:30 Convert float to bool ( temp bool) +0:30 move second child to first child ( temp float) +0:30 'ii' ( temp float) +0:30 direct index ( temp float) +0:30 'input' ( in 4-component vector of float) +0:30 Constant: +0:30 2 (const int) +0:30 true case +0:31 Pre-Increment ( temp float) +0:31 'ii' ( temp float) +0:32 Pre-Increment ( temp int) +0:32 'ii' ( temp int) +0:33 Test condition and select ( temp void) +0:33 Condition +0:33 Compare Equal ( temp bool) +0:33 Convert int to float ( temp float) +0:33 'ii' ( temp int) +0:33 Constant: +0:33 1.000000 +0:33 true case +0:34 Pre-Increment ( temp int) +0:34 'ii' ( temp int) +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' ( in 4-component vector of float) +0:? Sequence +0:3 Test condition and select ( temp void) +0:3 Condition +0:3 all ( temp bool) +0:3 Equal ( temp 4-component vector of bool) +0:3 'input' ( in 4-component vector of float) +0:3 'input' ( in 4-component vector of float) +0:3 true case +0:4 Branch: Return with expression +0:4 'input' ( in 4-component vector of float) +0:6 Test condition and select ( temp void) +0:6 Condition +0:6 all ( temp bool) +0:6 Equal ( temp 4-component vector of bool) +0:6 'input' ( in 4-component vector of float) +0:6 'input' ( in 4-component vector of float) +0:6 true case +0:7 Branch: Return with expression +0:7 'input' ( in 4-component vector of float) +0:6 false case +0:9 Branch: Return with expression +0:9 Negate value ( temp 4-component vector of float) +0:9 'input' ( in 4-component vector of float) +0:11 Test condition and select ( temp void) +0:11 Condition +0:11 all ( temp bool) +0:11 Equal ( temp 4-component vector of bool) +0:11 'input' ( in 4-component vector of float) +0:11 'input' ( in 4-component vector of float) +0:11 true case is null +0:14 Test condition and select ( temp void) +0:14 Condition +0:14 all ( temp bool) +0:14 Equal ( temp 4-component vector of bool) +0:14 'input' ( in 4-component vector of float) +0:14 'input' ( in 4-component vector of float) +0:14 true case is null +0:19 Test condition and select ( temp void): Flatten +0:19 Condition +0:19 all ( temp bool) +0:19 Equal ( temp 4-component vector of bool) +0:19 'input' ( in 4-component vector of float) +0:19 'input' ( in 4-component vector of float) +0:19 true case +0:? Sequence +0:20 Branch: Return with expression +0:20 'input' ( in 4-component vector of float) +0:23 Test condition and select ( temp void) +0:23 Condition +0:23 all ( temp bool) +0:23 Equal ( temp 4-component vector of bool) +0:23 'input' ( in 4-component vector of float) +0:23 'input' ( in 4-component vector of float) +0:23 true case +0:? Sequence +0:24 Branch: Return with expression +0:24 'input' ( in 4-component vector of float) +0:23 false case +0:? Sequence +0:26 Branch: Return with expression +0:26 Negate value ( temp 4-component vector of float) +0:26 'input' ( in 4-component vector of float) +0:30 Test condition and select ( temp void) +0:30 Condition +0:30 Convert float to bool ( temp bool) +0:30 move second child to first child ( temp float) +0:30 'ii' ( temp float) +0:30 direct index ( temp float) +0:30 'input' ( in 4-component vector of float) +0:30 Constant: +0:30 2 (const int) +0:30 true case +0:31 Pre-Increment ( temp float) +0:31 'ii' ( temp float) +0:32 Pre-Increment ( temp int) +0:32 'ii' ( temp int) +0:33 Test condition and select ( temp void) +0:33 Condition +0:33 Compare Equal ( temp bool) +0:33 Convert int to float ( temp float) +0:33 'ii' ( temp int) +0:33 Constant: +0:33 1.000000 +0:33 true case +0:34 Pre-Increment ( temp int) +0:34 'ii' ( temp int) +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 103 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 96 99 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 11 "@PixelShaderFunction(vf4;" + Name 10 "input" + Name 68 "ii" + Name 82 "ii" + Name 94 "input" + Name 96 "input" + Name 99 "@entryPointOutput" + Name 100 "param" + Decorate 96(input) Location 0 + Decorate 99(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) + 15: TypeBool + 16: TypeVector 15(bool) 4 + 67: TypePointer Function 6(float) + 69: TypeInt 32 0 + 70: 69(int) Constant 2 + 73: 6(float) Constant 0 + 78: 6(float) Constant 1065353216 + 80: TypeInt 32 1 + 81: TypePointer Function 80(int) + 84: 80(int) Constant 1 + 95: TypePointer Input 7(fvec4) + 96(input): 95(ptr) Variable Input + 98: TypePointer Output 7(fvec4) +99(@entryPointOutput): 98(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 94(input): 8(ptr) Variable Function + 100(param): 8(ptr) Variable Function + 97: 7(fvec4) Load 96(input) + Store 94(input) 97 + 101: 7(fvec4) Load 94(input) + Store 100(param) 101 + 102: 7(fvec4) FunctionCall 11(@PixelShaderFunction(vf4;) 100(param) + Store 99(@entryPointOutput) 102 + Return + FunctionEnd +11(@PixelShaderFunction(vf4;): 7(fvec4) Function None 9 + 10(input): 8(ptr) FunctionParameter + 12: Label + 68(ii): 67(ptr) Variable Function + 82(ii): 81(ptr) Variable Function + 13: 7(fvec4) Load 10(input) + 14: 7(fvec4) Load 10(input) + 17: 16(bvec4) FOrdEqual 13 14 + 18: 15(bool) All 17 + SelectionMerge 20 None + BranchConditional 18 19 20 + 19: Label + 21: 7(fvec4) Load 10(input) + ReturnValue 21 + 20: Label + 23: 7(fvec4) Load 10(input) + 24: 7(fvec4) Load 10(input) + 25: 16(bvec4) FOrdEqual 23 24 + 26: 15(bool) All 25 + SelectionMerge 28 None + BranchConditional 26 27 31 + 27: Label + 29: 7(fvec4) Load 10(input) + ReturnValue 29 + 31: Label + 32: 7(fvec4) Load 10(input) + 33: 7(fvec4) FNegate 32 + ReturnValue 33 + 28: Label + 35: 7(fvec4) Load 10(input) + 36: 7(fvec4) Load 10(input) + 37: 16(bvec4) FOrdEqual 35 36 + 38: 15(bool) All 37 + SelectionMerge 40 None + BranchConditional 38 39 40 + 39: Label + Branch 40 + 40: Label + 41: 7(fvec4) Load 10(input) + 42: 7(fvec4) Load 10(input) + 43: 16(bvec4) FOrdEqual 41 42 + 44: 15(bool) All 43 + SelectionMerge 46 None + BranchConditional 44 45 46 + 45: Label + Branch 46 + 46: Label + 47: 7(fvec4) Load 10(input) + 48: 7(fvec4) Load 10(input) + 49: 16(bvec4) FOrdEqual 47 48 + 50: 15(bool) All 49 + SelectionMerge 52 Flatten + BranchConditional 50 51 52 + 51: Label + 53: 7(fvec4) Load 10(input) + ReturnValue 53 + 52: Label + 55: 7(fvec4) Load 10(input) + 56: 7(fvec4) Load 10(input) + 57: 16(bvec4) FOrdEqual 55 56 + 58: 15(bool) All 57 + SelectionMerge 60 None + BranchConditional 58 59 63 + 59: Label + 61: 7(fvec4) Load 10(input) + ReturnValue 61 + 63: Label + 64: 7(fvec4) Load 10(input) + 65: 7(fvec4) FNegate 64 + ReturnValue 65 + 60: Label + 71: 67(ptr) AccessChain 10(input) 70 + 72: 6(float) Load 71 + Store 68(ii) 72 + 74: 15(bool) FOrdNotEqual 72 73 + SelectionMerge 76 None + BranchConditional 74 75 76 + 75: Label + 77: 6(float) Load 68(ii) + 79: 6(float) FAdd 77 78 + Store 68(ii) 79 + Branch 76 + 76: Label + 83: 80(int) Load 82(ii) + 85: 80(int) IAdd 83 84 + Store 82(ii) 85 + 86: 80(int) Load 82(ii) + 87: 6(float) ConvertSToF 86 + 88: 15(bool) FOrdEqual 87 78 + SelectionMerge 90 None + BranchConditional 88 89 90 + 89: Label + 91: 80(int) Load 82(ii) + 92: 80(int) IAdd 91 84 + Store 82(ii) 92 + Branch 90 + 90: Label + 93: 7(fvec4) Undef + ReturnValue 93 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.imagefetch-subvec4.comp.out b/deps/glslang/Test/baseResults/hlsl.imagefetch-subvec4.comp.out new file mode 100644 index 00000000..721aeead --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.imagefetch-subvec4.comp.out @@ -0,0 +1,142 @@ +hlsl.imagefetch-subvec4.comp +Shader version: 500 +local_size = (8, 8, 8) +0:? Sequence +0:6 Function Definition: @main(vu3; ( temp void) +0:6 Function Parameters: +0:6 'tid' ( in 3-component vector of uint) +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp uint) +0:7 'storeTemp' ( temp uint) +0:7 Convert int to uint ( temp uint) +0:7 textureFetch ( temp int) +0:7 'IN' (layout( binding=0) uniform itexture3D) +0:7 'tid' ( in 3-component vector of uint) +0:7 Constant: +0:7 0 (const int) +0:7 imageStore ( temp void) +0:7 'OUT' (layout( binding=1 r32ui) uniform uimage3D) +0:7 'tid' ( in 3-component vector of uint) +0:7 'storeTemp' ( temp uint) +0:7 'storeTemp' ( temp uint) +0:6 Function Definition: main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:6 move second child to first child ( temp 3-component vector of uint) +0:? 'tid' ( temp 3-component vector of uint) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) +0:6 Function Call: @main(vu3; ( temp void) +0:? 'tid' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'IN' (layout( binding=0) uniform itexture3D) +0:? 'OUT' (layout( binding=1 r32ui) uniform uimage3D) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (8, 8, 8) +0:? Sequence +0:6 Function Definition: @main(vu3; ( temp void) +0:6 Function Parameters: +0:6 'tid' ( in 3-component vector of uint) +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp uint) +0:7 'storeTemp' ( temp uint) +0:7 Convert int to uint ( temp uint) +0:7 textureFetch ( temp int) +0:7 'IN' (layout( binding=0) uniform itexture3D) +0:7 'tid' ( in 3-component vector of uint) +0:7 Constant: +0:7 0 (const int) +0:7 imageStore ( temp void) +0:7 'OUT' (layout( binding=1 r32ui) uniform uimage3D) +0:7 'tid' ( in 3-component vector of uint) +0:7 'storeTemp' ( temp uint) +0:7 'storeTemp' ( temp uint) +0:6 Function Definition: main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:6 move second child to first child ( temp 3-component vector of uint) +0:? 'tid' ( temp 3-component vector of uint) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) +0:6 Function Call: @main(vu3; ( temp void) +0:? 'tid' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'IN' (layout( binding=0) uniform itexture3D) +0:? 'OUT' (layout( binding=1 r32ui) uniform uimage3D) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 39 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 34 + ExecutionMode 4 LocalSize 8 8 8 + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vu3;" + Name 10 "tid" + Name 14 "storeTemp" + Name 18 "IN" + Name 28 "OUT" + Name 32 "tid" + Name 34 "tid" + Name 36 "param" + Decorate 18(IN) DescriptorSet 0 + Decorate 18(IN) Binding 0 + Decorate 28(OUT) DescriptorSet 0 + Decorate 28(OUT) Binding 1 + Decorate 34(tid) BuiltIn GlobalInvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 9: TypeFunction 2 8(ptr) + 13: TypePointer Function 6(int) + 15: TypeInt 32 1 + 16: TypeImage 15(int) 3D sampled format:Unknown + 17: TypePointer UniformConstant 16 + 18(IN): 17(ptr) Variable UniformConstant + 21: 15(int) Constant 0 + 22: TypeVector 15(int) 4 + 26: TypeImage 6(int) 3D nonsampled format:R32ui + 27: TypePointer UniformConstant 26 + 28(OUT): 27(ptr) Variable UniformConstant + 33: TypePointer Input 7(ivec3) + 34(tid): 33(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 32(tid): 8(ptr) Variable Function + 36(param): 8(ptr) Variable Function + 35: 7(ivec3) Load 34(tid) + Store 32(tid) 35 + 37: 7(ivec3) Load 32(tid) + Store 36(param) 37 + 38: 2 FunctionCall 11(@main(vu3;) 36(param) + Return + FunctionEnd + 11(@main(vu3;): 2 Function None 9 + 10(tid): 8(ptr) FunctionParameter + 12: Label + 14(storeTemp): 13(ptr) Variable Function + 19: 16 Load 18(IN) + 20: 7(ivec3) Load 10(tid) + 23: 22(ivec4) ImageFetch 19 20 Lod 21 + 24: 15(int) CompositeExtract 23 0 + 25: 6(int) Bitcast 24 + Store 14(storeTemp) 25 + 29: 26 Load 28(OUT) + 30: 7(ivec3) Load 10(tid) + 31: 6(int) Load 14(storeTemp) + ImageWrite 29 30 31 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.implicitBool.frag.out b/deps/glslang/Test/baseResults/hlsl.implicitBool.frag.out new file mode 100644 index 00000000..72894f23 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.implicitBool.frag.out @@ -0,0 +1,538 @@ +hlsl.implicitBool.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main( ( temp 4-component vector of float) +0:7 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'a' ( temp 4-component vector of float) +0:? Constant: +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:9 Test condition and select ( temp void) +0:9 Condition +0:9 Convert int to bool ( temp bool) +0:9 condi: direct index for structure ( uniform int) +0:9 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:9 Constant: +0:9 1 (const uint) +0:9 true case +0:10 Branch: Return with expression +0:10 add ( temp 4-component vector of float) +0:10 'a' ( temp 4-component vector of float) +0:10 Constant: +0:10 1.000000 +0:11 Test condition and select ( temp void) +0:11 Condition +0:11 Convert float to bool ( temp bool) +0:11 condf: direct index for structure ( uniform float) +0:11 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:11 Constant: +0:11 0 (const uint) +0:11 true case +0:12 Branch: Return with expression +0:12 add ( temp 4-component vector of float) +0:12 'a' ( temp 4-component vector of float) +0:12 Constant: +0:12 2.000000 +0:13 Test condition and select ( temp void) +0:13 Condition +0:13 Convert float to bool ( temp bool) +0:13 condf1: direct index for structure ( uniform 1-component vector of float) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:13 Constant: +0:13 2 (const uint) +0:13 true case +0:14 Branch: Return with expression +0:14 add ( temp 4-component vector of float) +0:14 'a' ( temp 4-component vector of float) +0:14 Constant: +0:14 3.000000 +0:15 Test condition and select ( temp void) +0:15 Condition +0:15 Convert int to bool ( temp bool) +0:15 condi1: direct index for structure ( uniform 1-component vector of int) +0:15 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:15 Constant: +0:15 3 (const uint) +0:15 true case +0:16 Branch: Return with expression +0:16 add ( temp 4-component vector of float) +0:16 'a' ( temp 4-component vector of float) +0:16 Constant: +0:16 4.000000 +0:17 Test condition and select ( temp void) +0:17 Condition +0:17 logical-or ( temp bool) +0:17 logical-and ( temp bool) +0:17 Convert int to bool ( temp bool) +0:17 condi: direct index for structure ( uniform int) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:17 Constant: +0:17 1 (const uint) +0:17 Convert float to bool ( temp bool) +0:17 condf: direct index for structure ( uniform float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:17 Constant: +0:17 0 (const uint) +0:17 Convert float to bool ( temp bool) +0:17 condf1: direct index for structure ( uniform 1-component vector of float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:17 Constant: +0:17 2 (const uint) +0:17 true case +0:18 Branch: Return with expression +0:18 add ( temp 4-component vector of float) +0:18 'a' ( temp 4-component vector of float) +0:18 Constant: +0:18 5.000000 +0:20 Sequence +0:20 move second child to first child ( temp float) +0:20 'f' ( temp float) +0:20 condf: direct index for structure ( uniform float) +0:20 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:20 Constant: +0:20 0 (const uint) +0:21 Loop with condition tested first +0:21 Loop Condition +0:21 Convert float to bool ( temp bool) +0:21 'f' ( temp float) +0:21 Loop Body +0:? Sequence +0:21 Pre-Decrement ( temp float) +0:21 'f' ( temp float) +0:23 Sequence +0:23 move second child to first child ( temp int) +0:23 'i' ( temp int) +0:23 condi: direct index for structure ( uniform int) +0:23 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:23 Constant: +0:23 1 (const uint) +0:24 Loop with condition not tested first +0:24 Loop Condition +0:24 Convert int to bool ( temp bool) +0:24 'i' ( temp int) +0:24 Loop Body +0:? Sequence +0:24 Pre-Decrement ( temp int) +0:24 'i' ( temp int) +0:? Sequence +0:26 Loop with condition tested first +0:26 Loop Condition +0:26 Convert int to bool ( temp bool) +0:26 'i' ( temp int) +0:26 Loop Body +0:? Sequence +0:26 Pre-Decrement ( temp int) +0:26 'i' ( temp int) +0:28 Sequence +0:28 move second child to first child ( temp float) +0:28 'g' ( temp float) +0:28 Test condition and select ( temp float): no shortcircuit +0:28 Condition +0:28 Convert float to bool ( temp bool) +0:28 condf: direct index for structure ( uniform float) +0:28 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:28 Constant: +0:28 0 (const uint) +0:28 true case +0:28 Constant: +0:28 7.000000 +0:28 false case +0:28 Constant: +0:28 8.000000 +0:29 add second child into first child ( temp 4-component vector of float) +0:29 'a' ( temp 4-component vector of float) +0:29 'g' ( temp float) +0:31 Branch: Return with expression +0:31 subtract ( temp 4-component vector of float) +0:31 'a' ( temp 4-component vector of float) +0:31 Constant: +0:31 1.000000 +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main( ( temp 4-component vector of float) +0:7 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'a' ( temp 4-component vector of float) +0:? Constant: +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:9 Test condition and select ( temp void) +0:9 Condition +0:9 Convert int to bool ( temp bool) +0:9 condi: direct index for structure ( uniform int) +0:9 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:9 Constant: +0:9 1 (const uint) +0:9 true case +0:10 Branch: Return with expression +0:10 add ( temp 4-component vector of float) +0:10 'a' ( temp 4-component vector of float) +0:10 Constant: +0:10 1.000000 +0:11 Test condition and select ( temp void) +0:11 Condition +0:11 Convert float to bool ( temp bool) +0:11 condf: direct index for structure ( uniform float) +0:11 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:11 Constant: +0:11 0 (const uint) +0:11 true case +0:12 Branch: Return with expression +0:12 add ( temp 4-component vector of float) +0:12 'a' ( temp 4-component vector of float) +0:12 Constant: +0:12 2.000000 +0:13 Test condition and select ( temp void) +0:13 Condition +0:13 Convert float to bool ( temp bool) +0:13 condf1: direct index for structure ( uniform 1-component vector of float) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:13 Constant: +0:13 2 (const uint) +0:13 true case +0:14 Branch: Return with expression +0:14 add ( temp 4-component vector of float) +0:14 'a' ( temp 4-component vector of float) +0:14 Constant: +0:14 3.000000 +0:15 Test condition and select ( temp void) +0:15 Condition +0:15 Convert int to bool ( temp bool) +0:15 condi1: direct index for structure ( uniform 1-component vector of int) +0:15 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:15 Constant: +0:15 3 (const uint) +0:15 true case +0:16 Branch: Return with expression +0:16 add ( temp 4-component vector of float) +0:16 'a' ( temp 4-component vector of float) +0:16 Constant: +0:16 4.000000 +0:17 Test condition and select ( temp void) +0:17 Condition +0:17 logical-or ( temp bool) +0:17 logical-and ( temp bool) +0:17 Convert int to bool ( temp bool) +0:17 condi: direct index for structure ( uniform int) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:17 Constant: +0:17 1 (const uint) +0:17 Convert float to bool ( temp bool) +0:17 condf: direct index for structure ( uniform float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:17 Constant: +0:17 0 (const uint) +0:17 Convert float to bool ( temp bool) +0:17 condf1: direct index for structure ( uniform 1-component vector of float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:17 Constant: +0:17 2 (const uint) +0:17 true case +0:18 Branch: Return with expression +0:18 add ( temp 4-component vector of float) +0:18 'a' ( temp 4-component vector of float) +0:18 Constant: +0:18 5.000000 +0:20 Sequence +0:20 move second child to first child ( temp float) +0:20 'f' ( temp float) +0:20 condf: direct index for structure ( uniform float) +0:20 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:20 Constant: +0:20 0 (const uint) +0:21 Loop with condition tested first +0:21 Loop Condition +0:21 Convert float to bool ( temp bool) +0:21 'f' ( temp float) +0:21 Loop Body +0:? Sequence +0:21 Pre-Decrement ( temp float) +0:21 'f' ( temp float) +0:23 Sequence +0:23 move second child to first child ( temp int) +0:23 'i' ( temp int) +0:23 condi: direct index for structure ( uniform int) +0:23 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:23 Constant: +0:23 1 (const uint) +0:24 Loop with condition not tested first +0:24 Loop Condition +0:24 Convert int to bool ( temp bool) +0:24 'i' ( temp int) +0:24 Loop Body +0:? Sequence +0:24 Pre-Decrement ( temp int) +0:24 'i' ( temp int) +0:? Sequence +0:26 Loop with condition tested first +0:26 Loop Condition +0:26 Convert int to bool ( temp bool) +0:26 'i' ( temp int) +0:26 Loop Body +0:? Sequence +0:26 Pre-Decrement ( temp int) +0:26 'i' ( temp int) +0:28 Sequence +0:28 move second child to first child ( temp float) +0:28 'g' ( temp float) +0:28 Test condition and select ( temp float): no shortcircuit +0:28 Condition +0:28 Convert float to bool ( temp bool) +0:28 condf: direct index for structure ( uniform float) +0:28 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:28 Constant: +0:28 0 (const uint) +0:28 true case +0:28 Constant: +0:28 7.000000 +0:28 false case +0:28 Constant: +0:28 8.000000 +0:29 add second child into first child ( temp 4-component vector of float) +0:29 'a' ( temp 4-component vector of float) +0:29 'g' ( temp float) +0:31 Branch: Return with expression +0:31 subtract ( temp 4-component vector of float) +0:31 'a' ( temp 4-component vector of float) +0:31 Constant: +0:31 1.000000 +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 139 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 137 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 12 "a" + Name 16 "$Global" + MemberName 16($Global) 0 "condf" + MemberName 16($Global) 1 "condi" + MemberName 16($Global) 2 "condf1" + MemberName 16($Global) 3 "condi1" + Name 18 "" + Name 87 "f" + Name 100 "i" + Name 120 "g" + Name 137 "@entryPointOutput" + MemberDecorate 16($Global) 0 Offset 0 + MemberDecorate 16($Global) 1 Offset 4 + MemberDecorate 16($Global) 2 Offset 8 + MemberDecorate 16($Global) 3 Offset 12 + Decorate 16($Global) Block + Decorate 18 DescriptorSet 0 + Decorate 137(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypePointer Function 7(fvec4) + 13: 6(float) Constant 1073741824 + 14: 7(fvec4) ConstantComposite 13 13 13 13 + 15: TypeInt 32 1 + 16($Global): TypeStruct 6(float) 15(int) 6(float) 15(int) + 17: TypePointer Uniform 16($Global) + 18: 17(ptr) Variable Uniform + 19: 15(int) Constant 1 + 20: TypePointer Uniform 15(int) + 23: TypeBool + 24: TypeInt 32 0 + 25: 24(int) Constant 0 + 30: 6(float) Constant 1065353216 + 34: 15(int) Constant 0 + 35: TypePointer Uniform 6(float) + 38: 6(float) Constant 0 + 46: 15(int) Constant 2 + 53: 6(float) Constant 1077936128 + 57: 15(int) Constant 3 + 64: 6(float) Constant 1082130432 + 82: 6(float) Constant 1084227584 + 86: TypePointer Function 6(float) + 99: TypePointer Function 15(int) + 124: 6(float) Constant 1088421888 + 125: 6(float) Constant 1090519040 + 136: TypePointer Output 7(fvec4) +137(@entryPointOutput): 136(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 138: 7(fvec4) FunctionCall 9(@main() + Store 137(@entryPointOutput) 138 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 12(a): 11(ptr) Variable Function + 87(f): 86(ptr) Variable Function + 100(i): 99(ptr) Variable Function + 120(g): 86(ptr) Variable Function + Store 12(a) 14 + 21: 20(ptr) AccessChain 18 19 + 22: 15(int) Load 21 + 26: 23(bool) INotEqual 22 25 + SelectionMerge 28 None + BranchConditional 26 27 28 + 27: Label + 29: 7(fvec4) Load 12(a) + 31: 7(fvec4) CompositeConstruct 30 30 30 30 + 32: 7(fvec4) FAdd 29 31 + ReturnValue 32 + 28: Label + 36: 35(ptr) AccessChain 18 34 + 37: 6(float) Load 36 + 39: 23(bool) FOrdNotEqual 37 38 + SelectionMerge 41 None + BranchConditional 39 40 41 + 40: Label + 42: 7(fvec4) Load 12(a) + 43: 7(fvec4) CompositeConstruct 13 13 13 13 + 44: 7(fvec4) FAdd 42 43 + ReturnValue 44 + 41: Label + 47: 35(ptr) AccessChain 18 46 + 48: 6(float) Load 47 + 49: 23(bool) FOrdNotEqual 48 38 + SelectionMerge 51 None + BranchConditional 49 50 51 + 50: Label + 52: 7(fvec4) Load 12(a) + 54: 7(fvec4) CompositeConstruct 53 53 53 53 + 55: 7(fvec4) FAdd 52 54 + ReturnValue 55 + 51: Label + 58: 20(ptr) AccessChain 18 57 + 59: 15(int) Load 58 + 60: 23(bool) INotEqual 59 25 + SelectionMerge 62 None + BranchConditional 60 61 62 + 61: Label + 63: 7(fvec4) Load 12(a) + 65: 7(fvec4) CompositeConstruct 64 64 64 64 + 66: 7(fvec4) FAdd 63 65 + ReturnValue 66 + 62: Label + 68: 20(ptr) AccessChain 18 19 + 69: 15(int) Load 68 + 70: 23(bool) INotEqual 69 25 + 71: 35(ptr) AccessChain 18 34 + 72: 6(float) Load 71 + 73: 23(bool) FOrdNotEqual 72 38 + 74: 23(bool) LogicalAnd 70 73 + 75: 35(ptr) AccessChain 18 46 + 76: 6(float) Load 75 + 77: 23(bool) FOrdNotEqual 76 38 + 78: 23(bool) LogicalOr 74 77 + SelectionMerge 80 None + BranchConditional 78 79 80 + 79: Label + 81: 7(fvec4) Load 12(a) + 83: 7(fvec4) CompositeConstruct 82 82 82 82 + 84: 7(fvec4) FAdd 81 83 + ReturnValue 84 + 80: Label + 88: 35(ptr) AccessChain 18 34 + 89: 6(float) Load 88 + Store 87(f) 89 + Branch 90 + 90: Label + LoopMerge 92 93 None + Branch 94 + 94: Label + 95: 6(float) Load 87(f) + 96: 23(bool) FOrdNotEqual 95 38 + BranchConditional 96 91 92 + 91: Label + 97: 6(float) Load 87(f) + 98: 6(float) FSub 97 30 + Store 87(f) 98 + Branch 93 + 93: Label + Branch 90 + 92: Label + 101: 20(ptr) AccessChain 18 19 + 102: 15(int) Load 101 + Store 100(i) 102 + Branch 103 + 103: Label + LoopMerge 105 106 None + Branch 104 + 104: Label + 107: 15(int) Load 100(i) + 108: 15(int) ISub 107 19 + Store 100(i) 108 + Branch 106 + 106: Label + 109: 15(int) Load 100(i) + 110: 23(bool) INotEqual 109 25 + BranchConditional 110 103 105 + 105: Label + Branch 111 + 111: Label + LoopMerge 113 114 None + Branch 115 + 115: Label + 116: 15(int) Load 100(i) + 117: 23(bool) INotEqual 116 25 + BranchConditional 117 112 113 + 112: Label + 118: 15(int) Load 100(i) + 119: 15(int) ISub 118 19 + Store 100(i) 119 + Branch 114 + 114: Label + Branch 111 + 113: Label + 121: 35(ptr) AccessChain 18 34 + 122: 6(float) Load 121 + 123: 23(bool) FOrdNotEqual 122 38 + 126: 6(float) Select 123 124 125 + Store 120(g) 126 + 127: 6(float) Load 120(g) + 128: 7(fvec4) Load 12(a) + 129: 7(fvec4) CompositeConstruct 127 127 127 127 + 130: 7(fvec4) FAdd 128 129 + Store 12(a) 130 + 131: 7(fvec4) Load 12(a) + 132: 7(fvec4) CompositeConstruct 30 30 30 30 + 133: 7(fvec4) FSub 131 132 + ReturnValue 133 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.include.vert.out b/deps/glslang/Test/baseResults/hlsl.include.vert.out new file mode 100644 index 00000000..020879d1 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.include.vert.out @@ -0,0 +1,75 @@ +../Test/hlsl.include.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 44 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 42 + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 11 "$Global" + MemberName 11($Global) 0 "i1" + MemberName 11($Global) 1 "i2" + MemberName 11($Global) 2 "i4" + MemberName 11($Global) 3 "i3" + MemberName 11($Global) 4 "i6" + MemberName 11($Global) 5 "i5" + Name 13 "" + Name 42 "@entryPointOutput" + MemberDecorate 11($Global) 0 Offset 0 + MemberDecorate 11($Global) 1 Offset 16 + MemberDecorate 11($Global) 2 Offset 32 + MemberDecorate 11($Global) 3 Offset 48 + MemberDecorate 11($Global) 4 Offset 64 + MemberDecorate 11($Global) 5 Offset 80 + Decorate 11($Global) Block + Decorate 13 DescriptorSet 0 + Decorate 42(@entryPointOutput) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11($Global): TypeStruct 7(fvec4) 7(fvec4) 7(fvec4) 7(fvec4) 7(fvec4) 7(fvec4) + 12: TypePointer Uniform 11($Global) + 13: 12(ptr) Variable Uniform + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16: TypePointer Uniform 7(fvec4) + 19: 14(int) Constant 1 + 23: 14(int) Constant 3 + 27: 14(int) Constant 2 + 31: 14(int) Constant 5 + 35: 14(int) Constant 4 + 41: TypePointer Output 7(fvec4) +42(@entryPointOutput): 41(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 43: 7(fvec4) FunctionCall 9(@main() + Store 42(@entryPointOutput) 43 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 17: 16(ptr) AccessChain 13 15 + 18: 7(fvec4) Load 17 + 20: 16(ptr) AccessChain 13 19 + 21: 7(fvec4) Load 20 + 22: 7(fvec4) FAdd 18 21 + 24: 16(ptr) AccessChain 13 23 + 25: 7(fvec4) Load 24 + 26: 7(fvec4) FAdd 22 25 + 28: 16(ptr) AccessChain 13 27 + 29: 7(fvec4) Load 28 + 30: 7(fvec4) FAdd 26 29 + 32: 16(ptr) AccessChain 13 31 + 33: 7(fvec4) Load 32 + 34: 7(fvec4) FAdd 30 33 + 36: 16(ptr) AccessChain 13 35 + 37: 7(fvec4) Load 36 + 38: 7(fvec4) FAdd 34 37 + ReturnValue 38 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.includeNegative.vert.out b/deps/glslang/Test/baseResults/hlsl.includeNegative.vert.out new file mode 100644 index 00000000..5faa383f --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.includeNegative.vert.out @@ -0,0 +1,10 @@ +hlsl.includeNegative.vert +ERROR: ./foo.h:1: '#error' : should not be included +ERROR: ./inc2/../foo.h:1: '#error' : should not be included +ERROR: ./parentBad:3: '#error' : bad parent +ERROR: hlsl.includeNegative.vert:7: '#error' : in main +hlsl.includeNegative.vert(8): error at column 0, HLSL parsing failed. +ERROR: 5 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/hlsl.inf.vert.out b/deps/glslang/Test/baseResults/hlsl.inf.vert.out new file mode 100644 index 00000000..1cedc55f --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.inf.vert.out @@ -0,0 +1,172 @@ +hlsl.inf.vert +Shader version: 500 +0:? Sequence +0:2 Function Definition: @main( ( temp 4-component vector of float) +0:2 Function Parameters: +0:? Sequence +0:3 Sequence +0:3 move second child to first child ( temp float) +0:3 'f1' ( temp float) +0:3 Constant: +0:3 -1.#INF +0:4 Sequence +0:4 move second child to first child ( temp float) +0:4 'f2' ( temp float) +0:4 Constant: +0:4 +1.#INF +0:5 Sequence +0:5 move second child to first child ( temp float) +0:5 'f3' ( temp float) +0:5 Constant: +0:5 +1.#INF +0:6 Sequence +0:6 move second child to first child ( temp float) +0:6 'f4' ( temp float) +0:6 add ( temp float) +0:6 component-wise multiply ( temp float) +0:6 'f2' ( temp float) +0:6 Constant: +0:6 +1.#INF +0:6 Constant: +0:6 +1.#INF +0:10 Branch: Return with expression +0:10 Construct vec4 ( temp 4-component vector of float) +0:10 add ( temp float) +0:10 add ( temp float) +0:10 add ( temp float) +0:10 add ( temp float) +0:10 add ( temp float) +0:10 'f1' ( temp float) +0:10 'f2' ( temp float) +0:10 'f3' ( temp float) +0:10 'f4' ( temp float) +0:10 Constant: +0:10 -1.#INF +0:10 Constant: +0:10 1.#IND +0:2 Function Definition: main( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:2 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' ( out 4-component vector of float Position) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:2 Function Definition: @main( ( temp 4-component vector of float) +0:2 Function Parameters: +0:? Sequence +0:3 Sequence +0:3 move second child to first child ( temp float) +0:3 'f1' ( temp float) +0:3 Constant: +0:3 -1.#INF +0:4 Sequence +0:4 move second child to first child ( temp float) +0:4 'f2' ( temp float) +0:4 Constant: +0:4 +1.#INF +0:5 Sequence +0:5 move second child to first child ( temp float) +0:5 'f3' ( temp float) +0:5 Constant: +0:5 +1.#INF +0:6 Sequence +0:6 move second child to first child ( temp float) +0:6 'f4' ( temp float) +0:6 add ( temp float) +0:6 component-wise multiply ( temp float) +0:6 'f2' ( temp float) +0:6 Constant: +0:6 +1.#INF +0:6 Constant: +0:6 +1.#INF +0:10 Branch: Return with expression +0:10 Construct vec4 ( temp 4-component vector of float) +0:10 add ( temp float) +0:10 add ( temp float) +0:10 add ( temp float) +0:10 add ( temp float) +0:10 add ( temp float) +0:10 'f1' ( temp float) +0:10 'f2' ( temp float) +0:10 'f3' ( temp float) +0:10 'f4' ( temp float) +0:10 Constant: +0:10 -1.#INF +0:10 Constant: +0:10 1.#IND +0:2 Function Definition: main( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:2 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' ( out 4-component vector of float Position) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 37 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 35 + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 12 "f1" + Name 14 "f2" + Name 16 "f3" + Name 17 "f4" + Name 35 "@entryPointOutput" + Decorate 35(@entryPointOutput) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypePointer Function 6(float) + 13: 6(float) Constant 4286578688 + 15: 6(float) Constant 2139095040 + 29: 6(float) Constant 4290772992 + 34: TypePointer Output 7(fvec4) +35(@entryPointOutput): 34(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 36: 7(fvec4) FunctionCall 9(@main() + Store 35(@entryPointOutput) 36 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 12(f1): 11(ptr) Variable Function + 14(f2): 11(ptr) Variable Function + 16(f3): 11(ptr) Variable Function + 17(f4): 11(ptr) Variable Function + Store 12(f1) 13 + Store 14(f2) 15 + Store 16(f3) 15 + 18: 6(float) Load 14(f2) + 19: 6(float) FMul 18 15 + 20: 6(float) FAdd 19 15 + Store 17(f4) 20 + 21: 6(float) Load 12(f1) + 22: 6(float) Load 14(f2) + 23: 6(float) FAdd 21 22 + 24: 6(float) Load 16(f3) + 25: 6(float) FAdd 23 24 + 26: 6(float) Load 17(f4) + 27: 6(float) FAdd 25 26 + 28: 6(float) FAdd 27 13 + 30: 6(float) FAdd 28 29 + 31: 7(fvec4) CompositeConstruct 30 30 30 30 + ReturnValue 31 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.init.frag.out b/deps/glslang/Test/baseResults/hlsl.init.frag.out new file mode 100644 index 00000000..9fc816ce --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.init.frag.out @@ -0,0 +1,530 @@ +hlsl.init.frag +WARNING: 0:40: 'typedef' : struct-member initializers ignored +WARNING: 0:40: 'typedef' : struct-member initializers ignored + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:1 Sequence +0:1 move second child to first child ( temp 4-component vector of float) +0:1 'a1' ( global 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 0.500000 +0:? 0.000000 +0:? 1.000000 +0:1 move second child to first child ( temp 4-component vector of float) +0:1 'b1' ( global 4-component vector of float) +0:? Constant: +0:? 2.000000 +0:? 2.500000 +0:? 2.100000 +0:? 2.200000 +0:2 Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:2 'a1i' ( global 4-component vector of float) +0:2 Constant: +0:2 1.000000 +0:2 0.500000 +0:2 0.000000 +0:2 1.000000 +0:2 move second child to first child ( temp 4-component vector of float) +0:2 'b1i' ( global 4-component vector of float) +0:2 Constant: +0:2 2.000000 +0:2 2.500000 +0:2 2.100000 +0:2 2.200000 +0:3 Sequence +0:3 move second child to first child ( temp float) +0:3 'a2' ( global float) +0:3 Constant: +0:3 0.200000 +0:4 Sequence +0:4 move second child to first child ( temp float) +0:4 'b3' ( global float) +0:4 Constant: +0:4 0.300000 +0:5 Sequence +0:5 move second child to first child ( temp float) +0:5 'b4' ( global float) +0:5 Constant: +0:5 0.400000 +0:6 Sequence +0:6 move second child to first child ( temp float) +0:6 'a5' ( global float) +0:6 Constant: +0:6 0.500000 +0:6 move second child to first child ( temp float) +0:6 'c5' ( global float) +0:6 Constant: +0:6 1.500000 +0:9 Sequence +0:9 move second child to first child ( temp structure{ temp int f}) +0:9 'single1' ( global structure{ temp int f}) +0:9 Constant: +0:9 10 (const int) +0:12 Sequence +0:12 move second child to first child ( temp structure{ temp 2-component vector of uint v}) +0:12 'single2' ( global structure{ temp 2-component vector of uint v}) +0:12 Constant: +0:12 1 (const uint) +0:12 2 (const uint) +0:15 Sequence +0:15 move second child to first child ( temp structure{ temp structure{ temp int f} s1}) +0:15 'single3' ( global structure{ temp structure{ temp int f} s1}) +0:15 Constant: +0:15 3 (const int) +0:18 Sequence +0:18 move second child to first child ( temp structure{ temp structure{ temp 2-component vector of uint v} s1}) +0:18 'single4' ( global structure{ temp structure{ temp 2-component vector of uint v} s1}) +0:18 Constant: +0:18 4 (const uint) +0:18 5 (const uint) +0:21 Function Definition: @ShaderFunction(vf4; ( temp 4-component vector of float) +0:21 Function Parameters: +0:21 'input' ( in 4-component vector of float) +0:? Sequence +0:22 Sequence +0:22 move second child to first child ( temp 4-component vector of float) +0:22 'a2' ( temp 4-component vector of float) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:? 0.500000 +0:32 Sequence +0:32 move second child to first child ( temp structure{ temp int j, temp float g, temp structure{ temp float f, temp int i} s1}) +0:32 's2i' ( temp structure{ temp int j, temp float g, temp structure{ temp float f, temp int i} s1}) +0:32 Construct structure ( temp structure{ temp int j, temp float g, temp structure{ temp float f, temp int i} s1}) +0:32 Constant: +0:32 9 (const int) +0:32 'a5' ( global float) +0:32 Construct structure ( temp structure{ temp float f, temp int i}) +0:32 Comma ( temp float) +0:32 'a3' ( global float) +0:32 'a4' ( global float) +0:32 Constant: +0:32 12 (const int) +0:32 move second child to first child ( temp structure{ temp int j, temp float g, temp structure{ temp float f, temp int i} s1}) +0:32 's2' ( temp structure{ temp int j, temp float g, temp structure{ temp float f, temp int i} s1}) +0:? Construct structure ( temp structure{ temp int j, temp float g, temp structure{ temp float f, temp int i} s1}) +0:32 Constant: +0:32 9 (const int) +0:32 'a5' ( global float) +0:? Construct structure ( temp structure{ temp float f, temp int i}) +0:32 Comma ( temp float) +0:32 'a3' ( global float) +0:32 'a4' ( global float) +0:32 Constant: +0:32 12 (const int) +0:33 Sequence +0:33 move second child to first child ( temp float) +0:33 'a8' ( temp float) +0:33 Comma ( temp float) +0:33 'a2' ( temp 4-component vector of float) +0:33 'b2' ( global float) +0:33 move second child to first child ( temp float) +0:33 'a9' ( temp float) +0:33 'a5' ( global float) +0:35 Branch: Return with expression +0:35 component-wise multiply ( temp 4-component vector of float) +0:35 'input' ( in 4-component vector of float) +0:35 'a1' ( global 4-component vector of float) +0:21 Function Definition: ShaderFunction( ( temp void) +0:21 Function Parameters: +0:? Sequence +0:21 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:21 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:21 Function Call: @ShaderFunction(vf4; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'a1' ( global 4-component vector of float) +0:? 'b1' ( global 4-component vector of float) +0:? 'a1i' ( global 4-component vector of float) +0:? 'b1i' ( global 4-component vector of float) +0:? 'a2' ( global float) +0:? 'b2' ( global float) +0:? 'a3' ( global float) +0:? 'b3' ( global float) +0:? 'a4' ( global float) +0:? 'b4' ( global float) +0:? 'c4' ( global float) +0:? 'a5' ( global float) +0:? 'b5' ( global float) +0:? 'c5' ( global float) +0:? 'single1' ( global structure{ temp int f}) +0:? 'single2' ( global structure{ temp 2-component vector of uint v}) +0:? 'single3' ( global structure{ temp structure{ temp int f} s1}) +0:? 'single4' ( global structure{ temp structure{ temp 2-component vector of uint v} s1}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform float a, layout( row_major std140) uniform float b, layout( row_major std140) uniform float c}) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:1 Sequence +0:1 move second child to first child ( temp 4-component vector of float) +0:1 'a1' ( global 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 0.500000 +0:? 0.000000 +0:? 1.000000 +0:1 move second child to first child ( temp 4-component vector of float) +0:1 'b1' ( global 4-component vector of float) +0:? Constant: +0:? 2.000000 +0:? 2.500000 +0:? 2.100000 +0:? 2.200000 +0:2 Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:2 'a1i' ( global 4-component vector of float) +0:2 Constant: +0:2 1.000000 +0:2 0.500000 +0:2 0.000000 +0:2 1.000000 +0:2 move second child to first child ( temp 4-component vector of float) +0:2 'b1i' ( global 4-component vector of float) +0:2 Constant: +0:2 2.000000 +0:2 2.500000 +0:2 2.100000 +0:2 2.200000 +0:3 Sequence +0:3 move second child to first child ( temp float) +0:3 'a2' ( global float) +0:3 Constant: +0:3 0.200000 +0:4 Sequence +0:4 move second child to first child ( temp float) +0:4 'b3' ( global float) +0:4 Constant: +0:4 0.300000 +0:5 Sequence +0:5 move second child to first child ( temp float) +0:5 'b4' ( global float) +0:5 Constant: +0:5 0.400000 +0:6 Sequence +0:6 move second child to first child ( temp float) +0:6 'a5' ( global float) +0:6 Constant: +0:6 0.500000 +0:6 move second child to first child ( temp float) +0:6 'c5' ( global float) +0:6 Constant: +0:6 1.500000 +0:9 Sequence +0:9 move second child to first child ( temp structure{ temp int f}) +0:9 'single1' ( global structure{ temp int f}) +0:9 Constant: +0:9 10 (const int) +0:12 Sequence +0:12 move second child to first child ( temp structure{ temp 2-component vector of uint v}) +0:12 'single2' ( global structure{ temp 2-component vector of uint v}) +0:12 Constant: +0:12 1 (const uint) +0:12 2 (const uint) +0:15 Sequence +0:15 move second child to first child ( temp structure{ temp structure{ temp int f} s1}) +0:15 'single3' ( global structure{ temp structure{ temp int f} s1}) +0:15 Constant: +0:15 3 (const int) +0:18 Sequence +0:18 move second child to first child ( temp structure{ temp structure{ temp 2-component vector of uint v} s1}) +0:18 'single4' ( global structure{ temp structure{ temp 2-component vector of uint v} s1}) +0:18 Constant: +0:18 4 (const uint) +0:18 5 (const uint) +0:21 Function Definition: @ShaderFunction(vf4; ( temp 4-component vector of float) +0:21 Function Parameters: +0:21 'input' ( in 4-component vector of float) +0:? Sequence +0:22 Sequence +0:22 move second child to first child ( temp 4-component vector of float) +0:22 'a2' ( temp 4-component vector of float) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:? 0.500000 +0:32 Sequence +0:32 move second child to first child ( temp structure{ temp int j, temp float g, temp structure{ temp float f, temp int i} s1}) +0:32 's2i' ( temp structure{ temp int j, temp float g, temp structure{ temp float f, temp int i} s1}) +0:32 Construct structure ( temp structure{ temp int j, temp float g, temp structure{ temp float f, temp int i} s1}) +0:32 Constant: +0:32 9 (const int) +0:32 'a5' ( global float) +0:32 Construct structure ( temp structure{ temp float f, temp int i}) +0:32 Comma ( temp float) +0:32 'a3' ( global float) +0:32 'a4' ( global float) +0:32 Constant: +0:32 12 (const int) +0:32 move second child to first child ( temp structure{ temp int j, temp float g, temp structure{ temp float f, temp int i} s1}) +0:32 's2' ( temp structure{ temp int j, temp float g, temp structure{ temp float f, temp int i} s1}) +0:? Construct structure ( temp structure{ temp int j, temp float g, temp structure{ temp float f, temp int i} s1}) +0:32 Constant: +0:32 9 (const int) +0:32 'a5' ( global float) +0:? Construct structure ( temp structure{ temp float f, temp int i}) +0:32 Comma ( temp float) +0:32 'a3' ( global float) +0:32 'a4' ( global float) +0:32 Constant: +0:32 12 (const int) +0:33 Sequence +0:33 move second child to first child ( temp float) +0:33 'a8' ( temp float) +0:33 Comma ( temp float) +0:33 'a2' ( temp 4-component vector of float) +0:33 'b2' ( global float) +0:33 move second child to first child ( temp float) +0:33 'a9' ( temp float) +0:33 'a5' ( global float) +0:35 Branch: Return with expression +0:35 component-wise multiply ( temp 4-component vector of float) +0:35 'input' ( in 4-component vector of float) +0:35 'a1' ( global 4-component vector of float) +0:21 Function Definition: ShaderFunction( ( temp void) +0:21 Function Parameters: +0:? Sequence +0:21 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:21 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:21 Function Call: @ShaderFunction(vf4; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'a1' ( global 4-component vector of float) +0:? 'b1' ( global 4-component vector of float) +0:? 'a1i' ( global 4-component vector of float) +0:? 'b1i' ( global 4-component vector of float) +0:? 'a2' ( global float) +0:? 'b2' ( global float) +0:? 'a3' ( global float) +0:? 'b3' ( global float) +0:? 'a4' ( global float) +0:? 'b4' ( global float) +0:? 'c4' ( global float) +0:? 'a5' ( global float) +0:? 'b5' ( global float) +0:? 'c5' ( global float) +0:? 'single1' ( global structure{ temp int f}) +0:? 'single2' ( global structure{ temp 2-component vector of uint v}) +0:? 'single3' ( global structure{ temp structure{ temp int f} s1}) +0:? 'single4' ( global structure{ temp structure{ temp 2-component vector of uint v} s1}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform float a, layout( row_major std140) uniform float b, layout( row_major std140) uniform float c}) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 110 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "ShaderFunction" 98 101 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "ShaderFunction" + Name 11 "@ShaderFunction(vf4;" + Name 10 "input" + Name 14 "a1" + Name 19 "b1" + Name 25 "a1i" + Name 26 "b1i" + Name 28 "a2" + Name 30 "b3" + Name 32 "b4" + Name 34 "a5" + Name 35 "c5" + Name 38 "Single1" + MemberName 38(Single1) 0 "f" + Name 40 "single1" + Name 45 "Single2" + MemberName 45(Single2) 0 "v" + Name 47 "single2" + Name 52 "Single3" + MemberName 52(Single3) 0 "s1" + Name 54 "single3" + Name 58 "Single4" + MemberName 58(Single4) 0 "s1" + Name 60 "single4" + Name 66 "a2" + Name 68 "S1" + MemberName 68(S1) 0 "f" + MemberName 68(S1) 1 "i" + Name 69 "S2" + MemberName 69(S2) 0 "j" + MemberName 69(S2) 1 "g" + MemberName 69(S2) 2 "s1" + Name 71 "s2i" + Name 74 "a3" + Name 75 "a4" + Name 80 "s2" + Name 86 "a8" + Name 87 "b2" + Name 89 "a9" + Name 96 "input" + Name 98 "input" + Name 101 "@entryPointOutput" + Name 102 "param" + Name 105 "c4" + Name 106 "b5" + Name 107 "Constants" + MemberName 107(Constants) 0 "a" + MemberName 107(Constants) 1 "b" + MemberName 107(Constants) 2 "c" + Name 109 "" + Decorate 98(input) Location 0 + Decorate 101(@entryPointOutput) Location 0 + MemberDecorate 107(Constants) 0 Offset 0 + MemberDecorate 107(Constants) 1 Offset 4 + MemberDecorate 107(Constants) 2 Offset 8 + Decorate 107(Constants) Block + Decorate 109 DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) + 13: TypePointer Private 7(fvec4) + 14(a1): 13(ptr) Variable Private + 15: 6(float) Constant 1065353216 + 16: 6(float) Constant 1056964608 + 17: 6(float) Constant 0 + 18: 7(fvec4) ConstantComposite 15 16 17 15 + 19(b1): 13(ptr) Variable Private + 20: 6(float) Constant 1073741824 + 21: 6(float) Constant 1075838976 + 22: 6(float) Constant 1074161254 + 23: 6(float) Constant 1074580685 + 24: 7(fvec4) ConstantComposite 20 21 22 23 + 25(a1i): 13(ptr) Variable Private + 26(b1i): 13(ptr) Variable Private + 27: TypePointer Private 6(float) + 28(a2): 27(ptr) Variable Private + 29: 6(float) Constant 1045220557 + 30(b3): 27(ptr) Variable Private + 31: 6(float) Constant 1050253722 + 32(b4): 27(ptr) Variable Private + 33: 6(float) Constant 1053609165 + 34(a5): 27(ptr) Variable Private + 35(c5): 27(ptr) Variable Private + 36: 6(float) Constant 1069547520 + 37: TypeInt 32 1 + 38(Single1): TypeStruct 37(int) + 39: TypePointer Private 38(Single1) + 40(single1): 39(ptr) Variable Private + 41: 37(int) Constant 10 + 42: 38(Single1) ConstantComposite 41 + 43: TypeInt 32 0 + 44: TypeVector 43(int) 2 + 45(Single2): TypeStruct 44(ivec2) + 46: TypePointer Private 45(Single2) + 47(single2): 46(ptr) Variable Private + 48: 43(int) Constant 1 + 49: 43(int) Constant 2 + 50: 44(ivec2) ConstantComposite 48 49 + 51: 45(Single2) ConstantComposite 50 + 52(Single3): TypeStruct 38(Single1) + 53: TypePointer Private 52(Single3) + 54(single3): 53(ptr) Variable Private + 55: 37(int) Constant 3 + 56: 38(Single1) ConstantComposite 55 + 57: 52(Single3) ConstantComposite 56 + 58(Single4): TypeStruct 45(Single2) + 59: TypePointer Private 58(Single4) + 60(single4): 59(ptr) Variable Private + 61: 43(int) Constant 4 + 62: 43(int) Constant 5 + 63: 44(ivec2) ConstantComposite 61 62 + 64: 45(Single2) ConstantComposite 63 + 65: 58(Single4) ConstantComposite 64 + 67: 7(fvec4) ConstantComposite 29 31 33 16 + 68(S1): TypeStruct 6(float) 37(int) + 69(S2): TypeStruct 37(int) 6(float) 68(S1) + 70: TypePointer Function 69(S2) + 72: 37(int) Constant 9 + 74(a3): 27(ptr) Variable Private + 75(a4): 27(ptr) Variable Private + 77: 37(int) Constant 12 + 85: TypePointer Function 6(float) + 87(b2): 27(ptr) Variable Private + 97: TypePointer Input 7(fvec4) + 98(input): 97(ptr) Variable Input + 100: TypePointer Output 7(fvec4) +101(@entryPointOutput): 100(ptr) Variable Output + 105(c4): 27(ptr) Variable Private + 106(b5): 27(ptr) Variable Private + 107(Constants): TypeStruct 6(float) 6(float) 6(float) + 108: TypePointer Uniform 107(Constants) + 109: 108(ptr) Variable Uniform +4(ShaderFunction): 2 Function None 3 + 5: Label + 96(input): 8(ptr) Variable Function + 102(param): 8(ptr) Variable Function + Store 14(a1) 18 + Store 19(b1) 24 + Store 25(a1i) 18 + Store 26(b1i) 24 + Store 28(a2) 29 + Store 30(b3) 31 + Store 32(b4) 33 + Store 34(a5) 16 + Store 35(c5) 36 + Store 40(single1) 42 + Store 47(single2) 51 + Store 54(single3) 57 + Store 60(single4) 65 + 99: 7(fvec4) Load 98(input) + Store 96(input) 99 + 103: 7(fvec4) Load 96(input) + Store 102(param) 103 + 104: 7(fvec4) FunctionCall 11(@ShaderFunction(vf4;) 102(param) + Store 101(@entryPointOutput) 104 + Return + FunctionEnd +11(@ShaderFunction(vf4;): 7(fvec4) Function None 9 + 10(input): 8(ptr) FunctionParameter + 12: Label + 66(a2): 8(ptr) Variable Function + 71(s2i): 70(ptr) Variable Function + 80(s2): 70(ptr) Variable Function + 86(a8): 85(ptr) Variable Function + 89(a9): 85(ptr) Variable Function + Store 66(a2) 67 + 73: 6(float) Load 34(a5) + 76: 6(float) Load 75(a4) + 78: 68(S1) CompositeConstruct 76 77 + 79: 69(S2) CompositeConstruct 72 73 78 + Store 71(s2i) 79 + 81: 6(float) Load 34(a5) + 82: 6(float) Load 75(a4) + 83: 68(S1) CompositeConstruct 82 77 + 84: 69(S2) CompositeConstruct 72 81 83 + Store 80(s2) 84 + 88: 6(float) Load 87(b2) + Store 86(a8) 88 + 90: 6(float) Load 34(a5) + Store 89(a9) 90 + 91: 7(fvec4) Load 10(input) + 92: 7(fvec4) Load 14(a1) + 93: 7(fvec4) FMul 91 92 + ReturnValue 93 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.init2.frag.out b/deps/glslang/Test/baseResults/hlsl.init2.frag.out new file mode 100644 index 00000000..9e03de3a --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.init2.frag.out @@ -0,0 +1,531 @@ +hlsl.init2.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: Test1( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:5 Sequence +0:5 move second child to first child ( temp structure{ temp 2-component vector of float a}) +0:5 'test1' ( temp structure{ temp 2-component vector of float a}) +0:5 Constant: +0:5 1.000000 +0:5 2.000000 +0:9 Sequence +0:9 move second child to first child ( temp structure{ temp 2-component vector of float a}) +0:9 'test2' ( temp structure{ temp 2-component vector of float a}) +0:9 Constant: +0:9 3.000000 +0:9 4.000000 +0:17 Sequence +0:17 move second child to first child ( temp float) +0:17 'test4' ( temp float) +0:17 Constant: +0:17 7.000000 +0:20 Sequence +0:20 move second child to first child ( temp structure{ temp float a, temp float b, temp float c}) +0:20 'test5' ( temp structure{ temp float a, temp float b, temp float c}) +0:20 Constant: +0:20 8.000000 +0:20 9.000000 +0:20 10.000000 +0:22 Constant: +0:22 10.000000 +0:25 Sequence +0:25 move second child to first child ( temp float) +0:25 'n' ( temp float) +0:25 Constant: +0:25 0.000000 +0:26 Sequence +0:26 move second child to first child ( temp 8-element array of 3-component vector of float) +0:26 'a' ( const (read only) 8-element array of 3-component vector of float) +0:26 Construct vec3 ( temp 8-element array of 3-component vector of float) +0:27 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? 0.577350 +0:? 0.577350 +0:? 0.577350 +0:27 add second child into first child ( temp float) +0:27 'n' ( temp float) +0:27 Constant: +0:27 1.000000 +0:28 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? -0.577350 +0:? -0.577350 +0:28 add second child into first child ( temp float) +0:28 'n' ( temp float) +0:28 Constant: +0:28 1.000000 +0:29 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? -0.577350 +0:? 0.577350 +0:29 add second child into first child ( temp float) +0:29 'n' ( temp float) +0:29 Constant: +0:29 1.000000 +0:30 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? 0.577350 +0:? -0.577350 +0:30 add second child into first child ( temp float) +0:30 'n' ( temp float) +0:30 Constant: +0:30 1.000000 +0:31 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? 0.577350 +0:? 0.577350 +0:31 add second child into first child ( temp float) +0:31 'n' ( temp float) +0:31 Constant: +0:31 1.000000 +0:32 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? 0.577350 +0:? -0.577350 +0:? -0.577350 +0:32 add second child into first child ( temp float) +0:32 'n' ( temp float) +0:32 Constant: +0:32 1.000000 +0:33 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? 0.577350 +0:? -0.577350 +0:? 0.577350 +0:33 add second child into first child ( temp float) +0:33 'n' ( temp float) +0:33 Constant: +0:33 1.000000 +0:34 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? 0.577350 +0:? 0.577350 +0:? -0.577350 +0:34 add second child into first child ( temp float) +0:34 'n' ( temp float) +0:34 Constant: +0:34 1.000000 +0:36 Sequence +0:36 move second child to first child ( temp structure{ temp 3-component vector of float a}) +0:36 'oneNonConst' ( const (read only) structure{ temp 3-component vector of float a}) +0:36 Construct structure ( temp structure{ temp 3-component vector of float a}) +0:36 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? 0.577350 +0:? 0.577350 +0:36 add second child into first child ( temp float) +0:36 'n' ( temp float) +0:36 Constant: +0:36 1.000000 +0:38 Sequence +0:38 move second child to first child ( temp structure{ temp 3-component vector of float a, temp 3-component vector of float b}) +0:38 'twoNonConst' ( const (read only) structure{ temp 3-component vector of float a, temp 3-component vector of float b}) +0:38 Construct structure ( temp structure{ temp 3-component vector of float a, temp 3-component vector of float b}) +0:38 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? 0.577350 +0:? 0.577350 +0:38 add second child into first child ( temp float) +0:38 'n' ( temp float) +0:38 Constant: +0:38 1.000000 +0:39 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? 0.577350 +0:? 0.577350 +0:39 add second child into first child ( temp float) +0:39 'n' ( temp float) +0:39 Constant: +0:39 1.000000 +0:45 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:45 Function Parameters: +0:? Sequence +0:46 Function Call: Test1( ( temp void) +0:49 move second child to first child ( temp 4-component vector of float) +0:49 color: direct index for structure ( temp 4-component vector of float) +0:49 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 1.000000 +0:49 1.000000 +0:49 1.000000 +0:49 1.000000 +0:50 Branch: Return with expression +0:50 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:45 Function Definition: main( ( temp void) +0:45 Function Parameters: +0:? Sequence +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:45 color: direct index for structure ( temp 4-component vector of float) +0:45 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:45 Constant: +0:45 0 (const int) +0:? Linker Objects +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: Test1( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:5 Sequence +0:5 move second child to first child ( temp structure{ temp 2-component vector of float a}) +0:5 'test1' ( temp structure{ temp 2-component vector of float a}) +0:5 Constant: +0:5 1.000000 +0:5 2.000000 +0:9 Sequence +0:9 move second child to first child ( temp structure{ temp 2-component vector of float a}) +0:9 'test2' ( temp structure{ temp 2-component vector of float a}) +0:9 Constant: +0:9 3.000000 +0:9 4.000000 +0:17 Sequence +0:17 move second child to first child ( temp float) +0:17 'test4' ( temp float) +0:17 Constant: +0:17 7.000000 +0:20 Sequence +0:20 move second child to first child ( temp structure{ temp float a, temp float b, temp float c}) +0:20 'test5' ( temp structure{ temp float a, temp float b, temp float c}) +0:20 Constant: +0:20 8.000000 +0:20 9.000000 +0:20 10.000000 +0:22 Constant: +0:22 10.000000 +0:25 Sequence +0:25 move second child to first child ( temp float) +0:25 'n' ( temp float) +0:25 Constant: +0:25 0.000000 +0:26 Sequence +0:26 move second child to first child ( temp 8-element array of 3-component vector of float) +0:26 'a' ( const (read only) 8-element array of 3-component vector of float) +0:26 Construct vec3 ( temp 8-element array of 3-component vector of float) +0:27 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? 0.577350 +0:? 0.577350 +0:? 0.577350 +0:27 add second child into first child ( temp float) +0:27 'n' ( temp float) +0:27 Constant: +0:27 1.000000 +0:28 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? -0.577350 +0:? -0.577350 +0:28 add second child into first child ( temp float) +0:28 'n' ( temp float) +0:28 Constant: +0:28 1.000000 +0:29 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? -0.577350 +0:? 0.577350 +0:29 add second child into first child ( temp float) +0:29 'n' ( temp float) +0:29 Constant: +0:29 1.000000 +0:30 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? 0.577350 +0:? -0.577350 +0:30 add second child into first child ( temp float) +0:30 'n' ( temp float) +0:30 Constant: +0:30 1.000000 +0:31 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? 0.577350 +0:? 0.577350 +0:31 add second child into first child ( temp float) +0:31 'n' ( temp float) +0:31 Constant: +0:31 1.000000 +0:32 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? 0.577350 +0:? -0.577350 +0:? -0.577350 +0:32 add second child into first child ( temp float) +0:32 'n' ( temp float) +0:32 Constant: +0:32 1.000000 +0:33 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? 0.577350 +0:? -0.577350 +0:? 0.577350 +0:33 add second child into first child ( temp float) +0:33 'n' ( temp float) +0:33 Constant: +0:33 1.000000 +0:34 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? 0.577350 +0:? 0.577350 +0:? -0.577350 +0:34 add second child into first child ( temp float) +0:34 'n' ( temp float) +0:34 Constant: +0:34 1.000000 +0:36 Sequence +0:36 move second child to first child ( temp structure{ temp 3-component vector of float a}) +0:36 'oneNonConst' ( const (read only) structure{ temp 3-component vector of float a}) +0:36 Construct structure ( temp structure{ temp 3-component vector of float a}) +0:36 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? 0.577350 +0:? 0.577350 +0:36 add second child into first child ( temp float) +0:36 'n' ( temp float) +0:36 Constant: +0:36 1.000000 +0:38 Sequence +0:38 move second child to first child ( temp structure{ temp 3-component vector of float a, temp 3-component vector of float b}) +0:38 'twoNonConst' ( const (read only) structure{ temp 3-component vector of float a, temp 3-component vector of float b}) +0:38 Construct structure ( temp structure{ temp 3-component vector of float a, temp 3-component vector of float b}) +0:38 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? 0.577350 +0:? 0.577350 +0:38 add second child into first child ( temp float) +0:38 'n' ( temp float) +0:38 Constant: +0:38 1.000000 +0:39 vector-scale ( temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? 0.577350 +0:? 0.577350 +0:39 add second child into first child ( temp float) +0:39 'n' ( temp float) +0:39 Constant: +0:39 1.000000 +0:45 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:45 Function Parameters: +0:? Sequence +0:46 Function Call: Test1( ( temp void) +0:49 move second child to first child ( temp 4-component vector of float) +0:49 color: direct index for structure ( temp 4-component vector of float) +0:49 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 1.000000 +0:49 1.000000 +0:49 1.000000 +0:49 1.000000 +0:50 Branch: Return with expression +0:50 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:45 Function Definition: main( ( temp void) +0:45 Function Parameters: +0:? Sequence +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:45 color: direct index for structure ( temp 4-component vector of float) +0:45 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:45 Constant: +0:45 0 (const int) +0:? Linker Objects +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 112 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 109 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 6 "Test1(" + Name 10 "PS_OUTPUT" + MemberName 10(PS_OUTPUT) 0 "color" + Name 12 "@main(" + Name 15 "mystruct" + MemberName 15(mystruct) 0 "a" + Name 17 "test1" + Name 22 "test2" + Name 28 "test4" + Name 30 "mystruct2" + MemberName 30(mystruct2) 0 "a" + MemberName 30(mystruct2) 1 "b" + MemberName 30(mystruct2) 2 "c" + Name 32 "test5" + Name 37 "n" + Name 44 "a" + Name 80 "one" + MemberName 80(one) 0 "a" + Name 82 "oneNonConst" + Name 87 "two" + MemberName 87(two) 0 "a" + MemberName 87(two) 1 "b" + Name 89 "twoNonConst" + Name 99 "ps_output" + Name 109 "@entryPointOutput.color" + Decorate 109(@entryPointOutput.color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10(PS_OUTPUT): TypeStruct 9(fvec4) + 11: TypeFunction 10(PS_OUTPUT) + 14: TypeVector 8(float) 2 + 15(mystruct): TypeStruct 14(fvec2) + 16: TypePointer Function 15(mystruct) + 18: 8(float) Constant 1065353216 + 19: 8(float) Constant 1073741824 + 20: 14(fvec2) ConstantComposite 18 19 + 21:15(mystruct) ConstantComposite 20 + 23: 8(float) Constant 1077936128 + 24: 8(float) Constant 1082130432 + 25: 14(fvec2) ConstantComposite 23 24 + 26:15(mystruct) ConstantComposite 25 + 27: TypePointer Function 8(float) + 29: 8(float) Constant 1088421888 + 30(mystruct2): TypeStruct 8(float) 8(float) 8(float) + 31: TypePointer Function 30(mystruct2) + 33: 8(float) Constant 1090519040 + 34: 8(float) Constant 1091567616 + 35: 8(float) Constant 1092616192 + 36:30(mystruct2) ConstantComposite 33 34 35 + 38: 8(float) Constant 0 + 39: TypeVector 8(float) 3 + 40: TypeInt 32 0 + 41: 40(int) Constant 8 + 42: TypeArray 39(fvec3) 41 + 43: TypePointer Function 42 + 45: 8(float) Constant 1058262330 + 46: 39(fvec3) ConstantComposite 45 45 45 + 50: 8(float) Constant 3205745978 + 51: 39(fvec3) ConstantComposite 50 50 50 + 55: 39(fvec3) ConstantComposite 50 50 45 + 59: 39(fvec3) ConstantComposite 50 45 50 + 63: 39(fvec3) ConstantComposite 50 45 45 + 67: 39(fvec3) ConstantComposite 45 50 50 + 71: 39(fvec3) ConstantComposite 45 50 45 + 75: 39(fvec3) ConstantComposite 45 45 50 + 80(one): TypeStruct 39(fvec3) + 81: TypePointer Function 80(one) + 87(two): TypeStruct 39(fvec3) 39(fvec3) + 88: TypePointer Function 87(two) + 98: TypePointer Function 10(PS_OUTPUT) + 100: TypeInt 32 1 + 101: 100(int) Constant 0 + 102: 9(fvec4) ConstantComposite 18 18 18 18 + 103: TypePointer Function 9(fvec4) + 108: TypePointer Output 9(fvec4) +109(@entryPointOutput.color): 108(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 110:10(PS_OUTPUT) FunctionCall 12(@main() + 111: 9(fvec4) CompositeExtract 110 0 + Store 109(@entryPointOutput.color) 111 + Return + FunctionEnd + 6(Test1(): 2 Function None 3 + 7: Label + 17(test1): 16(ptr) Variable Function + 22(test2): 16(ptr) Variable Function + 28(test4): 27(ptr) Variable Function + 32(test5): 31(ptr) Variable Function + 37(n): 27(ptr) Variable Function + 44(a): 43(ptr) Variable Function + 82(oneNonConst): 81(ptr) Variable Function + 89(twoNonConst): 88(ptr) Variable Function + Store 17(test1) 21 + Store 22(test2) 26 + Store 28(test4) 29 + Store 32(test5) 36 + Store 37(n) 38 + 47: 8(float) Load 37(n) + 48: 8(float) FAdd 47 18 + Store 37(n) 48 + 49: 39(fvec3) VectorTimesScalar 46 48 + 52: 8(float) Load 37(n) + 53: 8(float) FAdd 52 18 + Store 37(n) 53 + 54: 39(fvec3) VectorTimesScalar 51 53 + 56: 8(float) Load 37(n) + 57: 8(float) FAdd 56 18 + Store 37(n) 57 + 58: 39(fvec3) VectorTimesScalar 55 57 + 60: 8(float) Load 37(n) + 61: 8(float) FAdd 60 18 + Store 37(n) 61 + 62: 39(fvec3) VectorTimesScalar 59 61 + 64: 8(float) Load 37(n) + 65: 8(float) FAdd 64 18 + Store 37(n) 65 + 66: 39(fvec3) VectorTimesScalar 63 65 + 68: 8(float) Load 37(n) + 69: 8(float) FAdd 68 18 + Store 37(n) 69 + 70: 39(fvec3) VectorTimesScalar 67 69 + 72: 8(float) Load 37(n) + 73: 8(float) FAdd 72 18 + Store 37(n) 73 + 74: 39(fvec3) VectorTimesScalar 71 73 + 76: 8(float) Load 37(n) + 77: 8(float) FAdd 76 18 + Store 37(n) 77 + 78: 39(fvec3) VectorTimesScalar 75 77 + 79: 42 CompositeConstruct 49 54 58 62 66 70 74 78 + Store 44(a) 79 + 83: 8(float) Load 37(n) + 84: 8(float) FAdd 83 18 + Store 37(n) 84 + 85: 39(fvec3) VectorTimesScalar 63 84 + 86: 80(one) CompositeConstruct 85 + Store 82(oneNonConst) 86 + 90: 8(float) Load 37(n) + 91: 8(float) FAdd 90 18 + Store 37(n) 91 + 92: 39(fvec3) VectorTimesScalar 63 91 + 93: 8(float) Load 37(n) + 94: 8(float) FAdd 93 18 + Store 37(n) 94 + 95: 39(fvec3) VectorTimesScalar 63 94 + 96: 87(two) CompositeConstruct 92 95 + Store 89(twoNonConst) 96 + Return + FunctionEnd + 12(@main():10(PS_OUTPUT) Function None 11 + 13: Label + 99(ps_output): 98(ptr) Variable Function + 97: 2 FunctionCall 6(Test1() + 104: 103(ptr) AccessChain 99(ps_output) 101 + Store 104 102 + 105:10(PS_OUTPUT) Load 99(ps_output) + ReturnValue 105 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.inoutquals.frag.out b/deps/glslang/Test/baseResults/hlsl.inoutquals.frag.out new file mode 100644 index 00000000..42adb1a8 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.inoutquals.frag.out @@ -0,0 +1,375 @@ +hlsl.inoutquals.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:8 Function Definition: MyFunc(f1;f1;f1;f1; ( temp void) +0:8 Function Parameters: +0:8 'x' ( in float) +0:8 'y' ( out float) +0:8 'z' ( inout float) +0:8 'w' ( inout float) +0:? Sequence +0:9 move second child to first child ( temp float) +0:9 'y' ( out float) +0:9 'x' ( in float) +0:10 move second child to first child ( temp float) +0:10 'z' ( inout float) +0:10 'y' ( out float) +0:11 move second child to first child ( temp float) +0:11 'x' ( in float) +0:11 Constant: +0:11 -1.000000 +0:12 multiply second child into first child ( temp float) +0:12 'w' ( inout float) +0:12 Constant: +0:12 1.000000 +0:16 Function Definition: @main(vf4;i1; ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:16 Function Parameters: +0:16 'inpos' ( in 4-component vector of float) +0:16 'sampleMask' ( out int) +0:? Sequence +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'x' ( temp float) +0:19 Constant: +0:19 7.000000 +0:19 move second child to first child ( temp float) +0:19 'z' ( temp float) +0:19 Constant: +0:19 3.000000 +0:20 Function Call: MyFunc(f1;f1;f1;f1; ( temp void) +0:20 'x' ( temp float) +0:20 'y' ( temp float) +0:20 'z' ( temp float) +0:20 direct index ( temp float) +0:20 'inpos' ( in 4-component vector of float) +0:20 Constant: +0:20 3 (const int) +0:22 move second child to first child ( temp 4-component vector of float) +0:22 Color: direct index for structure ( temp 4-component vector of float) +0:22 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:22 Constant: +0:22 0 (const int) +0:? Construct vec4 ( temp 4-component vector of float) +0:22 'x' ( temp float) +0:22 'y' ( temp float) +0:22 'z' ( temp float) +0:22 Constant: +0:22 1.000000 +0:23 move second child to first child ( temp float) +0:23 Depth: direct index for structure ( temp float) +0:23 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:23 Constant: +0:23 1 (const int) +0:23 direct index ( temp float) +0:23 'inpos' ( in 4-component vector of float) +0:23 Constant: +0:23 3 (const int) +0:25 Branch: Return with expression +0:25 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:16 Function Definition: main( ( temp void) +0:16 Function Parameters: +0:? Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:? 'inpos' ( temp 4-component vector of float) +0:? 'inpos' ( noperspective in 4-component vector of float FragCoord) +0:16 Sequence +0:16 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:16 Function Call: @main(vf4;i1; ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:? 'inpos' ( temp 4-component vector of float) +0:? 'sampleMask' ( temp int) +0:16 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:16 Color: direct index for structure ( temp 4-component vector of float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:16 Constant: +0:16 0 (const int) +0:16 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:16 Depth: direct index for structure ( temp float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:16 Constant: +0:16 1 (const int) +0:16 move second child to first child ( temp int) +0:16 direct index ( out int SampleMaskIn) +0:? 'sampleMask' ( out 1-element array of int SampleMaskIn) +0:16 Constant: +0:16 0 (const int) +0:? 'sampleMask' ( temp int) +0:? Linker Objects +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:? 'inpos' ( noperspective in 4-component vector of float FragCoord) +0:? 'sampleMask' ( out 1-element array of int SampleMaskIn) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:8 Function Definition: MyFunc(f1;f1;f1;f1; ( temp void) +0:8 Function Parameters: +0:8 'x' ( in float) +0:8 'y' ( out float) +0:8 'z' ( inout float) +0:8 'w' ( inout float) +0:? Sequence +0:9 move second child to first child ( temp float) +0:9 'y' ( out float) +0:9 'x' ( in float) +0:10 move second child to first child ( temp float) +0:10 'z' ( inout float) +0:10 'y' ( out float) +0:11 move second child to first child ( temp float) +0:11 'x' ( in float) +0:11 Constant: +0:11 -1.000000 +0:12 multiply second child into first child ( temp float) +0:12 'w' ( inout float) +0:12 Constant: +0:12 1.000000 +0:16 Function Definition: @main(vf4;i1; ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:16 Function Parameters: +0:16 'inpos' ( in 4-component vector of float) +0:16 'sampleMask' ( out int) +0:? Sequence +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'x' ( temp float) +0:19 Constant: +0:19 7.000000 +0:19 move second child to first child ( temp float) +0:19 'z' ( temp float) +0:19 Constant: +0:19 3.000000 +0:20 Function Call: MyFunc(f1;f1;f1;f1; ( temp void) +0:20 'x' ( temp float) +0:20 'y' ( temp float) +0:20 'z' ( temp float) +0:20 direct index ( temp float) +0:20 'inpos' ( in 4-component vector of float) +0:20 Constant: +0:20 3 (const int) +0:22 move second child to first child ( temp 4-component vector of float) +0:22 Color: direct index for structure ( temp 4-component vector of float) +0:22 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:22 Constant: +0:22 0 (const int) +0:? Construct vec4 ( temp 4-component vector of float) +0:22 'x' ( temp float) +0:22 'y' ( temp float) +0:22 'z' ( temp float) +0:22 Constant: +0:22 1.000000 +0:23 move second child to first child ( temp float) +0:23 Depth: direct index for structure ( temp float) +0:23 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:23 Constant: +0:23 1 (const int) +0:23 direct index ( temp float) +0:23 'inpos' ( in 4-component vector of float) +0:23 Constant: +0:23 3 (const int) +0:25 Branch: Return with expression +0:25 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:16 Function Definition: main( ( temp void) +0:16 Function Parameters: +0:? Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:? 'inpos' ( temp 4-component vector of float) +0:? 'inpos' ( noperspective in 4-component vector of float FragCoord) +0:16 Sequence +0:16 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:16 Function Call: @main(vf4;i1; ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:? 'inpos' ( temp 4-component vector of float) +0:? 'sampleMask' ( temp int) +0:16 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:16 Color: direct index for structure ( temp 4-component vector of float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:16 Constant: +0:16 0 (const int) +0:16 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:16 Depth: direct index for structure ( temp float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:16 Constant: +0:16 1 (const int) +0:16 move second child to first child ( temp int) +0:16 direct index ( out int SampleMaskIn) +0:? 'sampleMask' ( out 1-element array of int SampleMaskIn) +0:16 Constant: +0:16 0 (const int) +0:? 'sampleMask' ( temp int) +0:? Linker Objects +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:? 'inpos' ( noperspective in 4-component vector of float FragCoord) +0:? 'sampleMask' ( out 1-element array of int SampleMaskIn) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 92 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 68 78 82 88 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 13 "MyFunc(f1;f1;f1;f1;" + Name 9 "x" + Name 10 "y" + Name 11 "z" + Name 12 "w" + Name 19 "PS_OUTPUT" + MemberName 19(PS_OUTPUT) 0 "Color" + MemberName 19(PS_OUTPUT) 1 "Depth" + Name 23 "@main(vf4;i1;" + Name 21 "inpos" + Name 22 "sampleMask" + Name 31 "x" + Name 33 "z" + Name 35 "y" + Name 36 "param" + Name 38 "param" + Name 39 "param" + Name 41 "param" + Name 52 "psout" + Name 66 "inpos" + Name 68 "inpos" + Name 70 "flattenTemp" + Name 71 "sampleMask" + Name 72 "param" + Name 74 "param" + Name 78 "@entryPointOutput.Color" + Name 82 "@entryPointOutput.Depth" + Name 88 "sampleMask" + Decorate 68(inpos) NoPerspective + Decorate 68(inpos) BuiltIn FragCoord + Decorate 78(@entryPointOutput.Color) Location 0 + Decorate 82(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 88(sampleMask) BuiltIn SampleMask + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeFunction 2 7(ptr) 7(ptr) 7(ptr) 7(ptr) + 15: TypeVector 6(float) 4 + 16: TypePointer Function 15(fvec4) + 17: TypeInt 32 1 + 18: TypePointer Function 17(int) + 19(PS_OUTPUT): TypeStruct 15(fvec4) 6(float) + 20: TypeFunction 19(PS_OUTPUT) 16(ptr) 18(ptr) + 27: 6(float) Constant 3212836864 + 28: 6(float) Constant 1065353216 + 32: 6(float) Constant 1088421888 + 34: 6(float) Constant 1077936128 + 42: TypeInt 32 0 + 43: 42(int) Constant 3 + 51: TypePointer Function 19(PS_OUTPUT) + 53: 17(int) Constant 0 + 59: 17(int) Constant 1 + 67: TypePointer Input 15(fvec4) + 68(inpos): 67(ptr) Variable Input + 77: TypePointer Output 15(fvec4) +78(@entryPointOutput.Color): 77(ptr) Variable Output + 81: TypePointer Output 6(float) +82(@entryPointOutput.Depth): 81(ptr) Variable Output + 85: 42(int) Constant 1 + 86: TypeArray 17(int) 85 + 87: TypePointer Output 86 + 88(sampleMask): 87(ptr) Variable Output + 90: TypePointer Output 17(int) + 4(main): 2 Function None 3 + 5: Label + 66(inpos): 16(ptr) Variable Function + 70(flattenTemp): 51(ptr) Variable Function + 71(sampleMask): 18(ptr) Variable Function + 72(param): 16(ptr) Variable Function + 74(param): 18(ptr) Variable Function + 69: 15(fvec4) Load 68(inpos) + Store 66(inpos) 69 + 73: 15(fvec4) Load 66(inpos) + Store 72(param) 73 + 75:19(PS_OUTPUT) FunctionCall 23(@main(vf4;i1;) 72(param) 74(param) + 76: 17(int) Load 74(param) + Store 71(sampleMask) 76 + Store 70(flattenTemp) 75 + 79: 16(ptr) AccessChain 70(flattenTemp) 53 + 80: 15(fvec4) Load 79 + Store 78(@entryPointOutput.Color) 80 + 83: 7(ptr) AccessChain 70(flattenTemp) 59 + 84: 6(float) Load 83 + Store 82(@entryPointOutput.Depth) 84 + 89: 17(int) Load 71(sampleMask) + 91: 90(ptr) AccessChain 88(sampleMask) 53 + Store 91 89 + Return + FunctionEnd +13(MyFunc(f1;f1;f1;f1;): 2 Function None 8 + 9(x): 7(ptr) FunctionParameter + 10(y): 7(ptr) FunctionParameter + 11(z): 7(ptr) FunctionParameter + 12(w): 7(ptr) FunctionParameter + 14: Label + 25: 6(float) Load 9(x) + Store 10(y) 25 + 26: 6(float) Load 10(y) + Store 11(z) 26 + Store 9(x) 27 + 29: 6(float) Load 12(w) + 30: 6(float) FMul 29 28 + Store 12(w) 30 + Return + FunctionEnd +23(@main(vf4;i1;):19(PS_OUTPUT) Function None 20 + 21(inpos): 16(ptr) FunctionParameter + 22(sampleMask): 18(ptr) FunctionParameter + 24: Label + 31(x): 7(ptr) Variable Function + 33(z): 7(ptr) Variable Function + 35(y): 7(ptr) Variable Function + 36(param): 7(ptr) Variable Function + 38(param): 7(ptr) Variable Function + 39(param): 7(ptr) Variable Function + 41(param): 7(ptr) Variable Function + 52(psout): 51(ptr) Variable Function + Store 31(x) 32 + Store 33(z) 34 + 37: 6(float) Load 31(x) + Store 36(param) 37 + 40: 6(float) Load 33(z) + Store 39(param) 40 + 44: 7(ptr) AccessChain 21(inpos) 43 + 45: 6(float) Load 44 + Store 41(param) 45 + 46: 2 FunctionCall 13(MyFunc(f1;f1;f1;f1;) 36(param) 38(param) 39(param) 41(param) + 47: 6(float) Load 38(param) + Store 35(y) 47 + 48: 6(float) Load 39(param) + Store 33(z) 48 + 49: 6(float) Load 41(param) + 50: 7(ptr) AccessChain 21(inpos) 43 + Store 50 49 + 54: 6(float) Load 31(x) + 55: 6(float) Load 35(y) + 56: 6(float) Load 33(z) + 57: 15(fvec4) CompositeConstruct 54 55 56 28 + 58: 16(ptr) AccessChain 52(psout) 53 + Store 58 57 + 60: 7(ptr) AccessChain 21(inpos) 43 + 61: 6(float) Load 60 + 62: 7(ptr) AccessChain 52(psout) 59 + Store 62 61 + 63:19(PS_OUTPUT) Load 52(psout) + ReturnValue 63 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsic.frexp.frag.out b/deps/glslang/Test/baseResults/hlsl.intrinsic.frexp.frag.out new file mode 100644 index 00000000..3a9d6fd5 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.intrinsic.frexp.frag.out @@ -0,0 +1,336 @@ +hlsl.intrinsic.frexp.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: PixelShaderFunctionS(f1;f1; ( temp float) +0:3 Function Parameters: +0:3 'inF0' ( in float) +0:3 'inF1' ( in float) +0:? Sequence +0:4 Sequence +0:4 move second child to first child ( temp float) +0:4 'r000' ( temp float) +0:4 frexp ( temp float) +0:4 'inF0' ( in float) +0:4 'inF1' ( in float) +0:5 Branch: Return with expression +0:5 Constant: +0:5 0.000000 +0:9 Function Definition: PixelShaderFunction2(vf2;vf2; ( temp 2-component vector of float) +0:9 Function Parameters: +0:9 'inF0' ( in 2-component vector of float) +0:9 'inF1' ( in 2-component vector of float) +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp 2-component vector of float) +0:10 'r000' ( temp 2-component vector of float) +0:10 frexp ( temp 2-component vector of float) +0:10 'inF0' ( in 2-component vector of float) +0:10 'inF1' ( in 2-component vector of float) +0:11 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:15 Function Definition: PixelShaderFunction3(vf3;vf3; ( temp 3-component vector of float) +0:15 Function Parameters: +0:15 'inF0' ( in 3-component vector of float) +0:15 'inF1' ( in 3-component vector of float) +0:? Sequence +0:16 Sequence +0:16 move second child to first child ( temp 3-component vector of float) +0:16 'r000' ( temp 3-component vector of float) +0:16 frexp ( temp 3-component vector of float) +0:16 'inF0' ( in 3-component vector of float) +0:16 'inF1' ( in 3-component vector of float) +0:17 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:21 Function Definition: PixelShaderFunction(vf4;vf4; ( temp 4-component vector of float) +0:21 Function Parameters: +0:21 'inF0' ( in 4-component vector of float) +0:21 'inF1' ( in 4-component vector of float) +0:? Sequence +0:22 Sequence +0:22 move second child to first child ( temp 4-component vector of float) +0:22 'r000' ( temp 4-component vector of float) +0:22 frexp ( temp 4-component vector of float) +0:22 'inF0' ( in 4-component vector of float) +0:22 'inF1' ( in 4-component vector of float) +0:23 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:33 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:33 Function Parameters: +0:? Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 color: direct index for structure ( temp 4-component vector of float) +0:35 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 1.000000 +0:35 1.000000 +0:35 1.000000 +0:35 1.000000 +0:36 Branch: Return with expression +0:36 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:33 Function Definition: main( ( temp void) +0:33 Function Parameters: +0:? Sequence +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:33 color: direct index for structure ( temp 4-component vector of float) +0:33 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:33 Constant: +0:33 0 (const int) +0:? Linker Objects +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: PixelShaderFunctionS(f1;f1; ( temp float) +0:3 Function Parameters: +0:3 'inF0' ( in float) +0:3 'inF1' ( in float) +0:? Sequence +0:4 Sequence +0:4 move second child to first child ( temp float) +0:4 'r000' ( temp float) +0:4 frexp ( temp float) +0:4 'inF0' ( in float) +0:4 'inF1' ( in float) +0:5 Branch: Return with expression +0:5 Constant: +0:5 0.000000 +0:9 Function Definition: PixelShaderFunction2(vf2;vf2; ( temp 2-component vector of float) +0:9 Function Parameters: +0:9 'inF0' ( in 2-component vector of float) +0:9 'inF1' ( in 2-component vector of float) +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp 2-component vector of float) +0:10 'r000' ( temp 2-component vector of float) +0:10 frexp ( temp 2-component vector of float) +0:10 'inF0' ( in 2-component vector of float) +0:10 'inF1' ( in 2-component vector of float) +0:11 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:15 Function Definition: PixelShaderFunction3(vf3;vf3; ( temp 3-component vector of float) +0:15 Function Parameters: +0:15 'inF0' ( in 3-component vector of float) +0:15 'inF1' ( in 3-component vector of float) +0:? Sequence +0:16 Sequence +0:16 move second child to first child ( temp 3-component vector of float) +0:16 'r000' ( temp 3-component vector of float) +0:16 frexp ( temp 3-component vector of float) +0:16 'inF0' ( in 3-component vector of float) +0:16 'inF1' ( in 3-component vector of float) +0:17 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:21 Function Definition: PixelShaderFunction(vf4;vf4; ( temp 4-component vector of float) +0:21 Function Parameters: +0:21 'inF0' ( in 4-component vector of float) +0:21 'inF1' ( in 4-component vector of float) +0:? Sequence +0:22 Sequence +0:22 move second child to first child ( temp 4-component vector of float) +0:22 'r000' ( temp 4-component vector of float) +0:22 frexp ( temp 4-component vector of float) +0:22 'inF0' ( in 4-component vector of float) +0:22 'inF1' ( in 4-component vector of float) +0:23 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:33 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:33 Function Parameters: +0:? Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 color: direct index for structure ( temp 4-component vector of float) +0:35 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 1.000000 +0:35 1.000000 +0:35 1.000000 +0:35 1.000000 +0:36 Branch: Return with expression +0:36 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:33 Function Definition: main( ( temp void) +0:33 Function Parameters: +0:? Sequence +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:33 color: direct index for structure ( temp 4-component vector of float) +0:33 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:33 Constant: +0:33 0 (const int) +0:? Linker Objects +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 98 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 95 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "PixelShaderFunctionS(f1;f1;" + Name 9 "inF0" + Name 10 "inF1" + Name 18 "PixelShaderFunction2(vf2;vf2;" + Name 16 "inF0" + Name 17 "inF1" + Name 25 "PixelShaderFunction3(vf3;vf3;" + Name 23 "inF0" + Name 24 "inF1" + Name 32 "PixelShaderFunction(vf4;vf4;" + Name 30 "inF0" + Name 31 "inF1" + Name 34 "PS_OUTPUT" + MemberName 34(PS_OUTPUT) 0 "color" + Name 36 "@main(" + Name 38 "r000" + Name 41 "ResType" + Name 49 "r000" + Name 52 "ResType" + Name 62 "r000" + Name 65 "ResType" + Name 74 "r000" + Name 77 "ResType" + Name 87 "ps_output" + Name 95 "@entryPointOutput.color" + Decorate 95(@entryPointOutput.color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeFunction 6(float) 7(ptr) 7(ptr) + 13: TypeVector 6(float) 2 + 14: TypePointer Function 13(fvec2) + 15: TypeFunction 13(fvec2) 14(ptr) 14(ptr) + 20: TypeVector 6(float) 3 + 21: TypePointer Function 20(fvec3) + 22: TypeFunction 20(fvec3) 21(ptr) 21(ptr) + 27: TypeVector 6(float) 4 + 28: TypePointer Function 27(fvec4) + 29: TypeFunction 27(fvec4) 28(ptr) 28(ptr) + 34(PS_OUTPUT): TypeStruct 27(fvec4) + 35: TypeFunction 34(PS_OUTPUT) + 40: TypeInt 32 1 + 41(ResType): TypeStruct 6(float) 40(int) + 46: 6(float) Constant 0 + 51: TypeVector 40(int) 2 + 52(ResType): TypeStruct 13(fvec2) 51(ivec2) + 57: 6(float) Constant 1065353216 + 58: 6(float) Constant 1073741824 + 59: 13(fvec2) ConstantComposite 57 58 + 64: TypeVector 40(int) 3 + 65(ResType): TypeStruct 20(fvec3) 64(ivec3) + 70: 6(float) Constant 1077936128 + 71: 20(fvec3) ConstantComposite 57 58 70 + 76: TypeVector 40(int) 4 + 77(ResType): TypeStruct 27(fvec4) 76(ivec4) + 82: 6(float) Constant 1082130432 + 83: 27(fvec4) ConstantComposite 57 58 70 82 + 86: TypePointer Function 34(PS_OUTPUT) + 88: 40(int) Constant 0 + 89: 27(fvec4) ConstantComposite 57 57 57 57 + 94: TypePointer Output 27(fvec4) +95(@entryPointOutput.color): 94(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 96:34(PS_OUTPUT) FunctionCall 36(@main() + 97: 27(fvec4) CompositeExtract 96 0 + Store 95(@entryPointOutput.color) 97 + Return + FunctionEnd +11(PixelShaderFunctionS(f1;f1;): 6(float) Function None 8 + 9(inF0): 7(ptr) FunctionParameter + 10(inF1): 7(ptr) FunctionParameter + 12: Label + 38(r000): 7(ptr) Variable Function + 39: 6(float) Load 9(inF0) + 42: 41(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 39 + 43: 40(int) CompositeExtract 42 1 + 44: 6(float) ConvertSToF 43 + Store 10(inF1) 44 + 45: 6(float) CompositeExtract 42 0 + Store 38(r000) 45 + ReturnValue 46 + FunctionEnd +18(PixelShaderFunction2(vf2;vf2;): 13(fvec2) Function None 15 + 16(inF0): 14(ptr) FunctionParameter + 17(inF1): 14(ptr) FunctionParameter + 19: Label + 49(r000): 14(ptr) Variable Function + 50: 13(fvec2) Load 16(inF0) + 53: 52(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 50 + 54: 51(ivec2) CompositeExtract 53 1 + 55: 13(fvec2) ConvertSToF 54 + Store 17(inF1) 55 + 56: 13(fvec2) CompositeExtract 53 0 + Store 49(r000) 56 + ReturnValue 59 + FunctionEnd +25(PixelShaderFunction3(vf3;vf3;): 20(fvec3) Function None 22 + 23(inF0): 21(ptr) FunctionParameter + 24(inF1): 21(ptr) FunctionParameter + 26: Label + 62(r000): 21(ptr) Variable Function + 63: 20(fvec3) Load 23(inF0) + 66: 65(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 63 + 67: 64(ivec3) CompositeExtract 66 1 + 68: 20(fvec3) ConvertSToF 67 + Store 24(inF1) 68 + 69: 20(fvec3) CompositeExtract 66 0 + Store 62(r000) 69 + ReturnValue 71 + FunctionEnd +32(PixelShaderFunction(vf4;vf4;): 27(fvec4) Function None 29 + 30(inF0): 28(ptr) FunctionParameter + 31(inF1): 28(ptr) FunctionParameter + 33: Label + 74(r000): 28(ptr) Variable Function + 75: 27(fvec4) Load 30(inF0) + 78: 77(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 75 + 79: 76(ivec4) CompositeExtract 78 1 + 80: 27(fvec4) ConvertSToF 79 + Store 31(inF1) 80 + 81: 27(fvec4) CompositeExtract 78 0 + Store 74(r000) 81 + ReturnValue 83 + FunctionEnd + 36(@main():34(PS_OUTPUT) Function None 35 + 37: Label + 87(ps_output): 86(ptr) Variable Function + 90: 28(ptr) AccessChain 87(ps_output) 88 + Store 90 89 + 91:34(PS_OUTPUT) Load 87(ps_output) + ReturnValue 91 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsic.frexp.vert.out b/deps/glslang/Test/baseResults/hlsl.intrinsic.frexp.vert.out new file mode 100644 index 00000000..92bd7ef0 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.intrinsic.frexp.vert.out @@ -0,0 +1,222 @@ +hlsl.intrinsic.frexp.vert +Shader version: 500 +0:? Sequence +0:2 Function Definition: VertexShaderFunctionS(f1;f1; ( temp float) +0:2 Function Parameters: +0:2 'inF0' ( in float) +0:2 'inF1' ( in float) +0:? Sequence +0:3 frexp ( temp float) +0:3 'inF0' ( in float) +0:3 'inF1' ( in float) +0:4 Branch: Return with expression +0:4 Constant: +0:4 0.000000 +0:8 Function Definition: VertexShaderFunction2(vf2;vf2; ( temp 2-component vector of float) +0:8 Function Parameters: +0:8 'inF0' ( in 2-component vector of float) +0:8 'inF1' ( in 2-component vector of float) +0:? Sequence +0:9 frexp ( temp 2-component vector of float) +0:9 'inF0' ( in 2-component vector of float) +0:9 'inF1' ( in 2-component vector of float) +0:10 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:14 Function Definition: VertexShaderFunction3(vf3;vf3; ( temp 3-component vector of float) +0:14 Function Parameters: +0:14 'inF0' ( in 3-component vector of float) +0:14 'inF1' ( in 3-component vector of float) +0:? Sequence +0:15 frexp ( temp 3-component vector of float) +0:15 'inF0' ( in 3-component vector of float) +0:15 'inF1' ( in 3-component vector of float) +0:16 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:20 Function Definition: VertexShaderFunction4(vf4;vf4; ( temp 4-component vector of float) +0:20 Function Parameters: +0:20 'inF0' ( in 4-component vector of float) +0:20 'inF1' ( in 4-component vector of float) +0:? Sequence +0:21 frexp ( temp 4-component vector of float) +0:21 'inF0' ( in 4-component vector of float) +0:21 'inF1' ( in 4-component vector of float) +0:22 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? Linker Objects + + +Linked vertex stage: + +WARNING: Linking vertex stage: Entry point not found + +Shader version: 500 +0:? Sequence +0:2 Function Definition: VertexShaderFunctionS(f1;f1; ( temp float) +0:2 Function Parameters: +0:2 'inF0' ( in float) +0:2 'inF1' ( in float) +0:? Sequence +0:3 frexp ( temp float) +0:3 'inF0' ( in float) +0:3 'inF1' ( in float) +0:4 Branch: Return with expression +0:4 Constant: +0:4 0.000000 +0:8 Function Definition: VertexShaderFunction2(vf2;vf2; ( temp 2-component vector of float) +0:8 Function Parameters: +0:8 'inF0' ( in 2-component vector of float) +0:8 'inF1' ( in 2-component vector of float) +0:? Sequence +0:9 frexp ( temp 2-component vector of float) +0:9 'inF0' ( in 2-component vector of float) +0:9 'inF1' ( in 2-component vector of float) +0:10 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:14 Function Definition: VertexShaderFunction3(vf3;vf3; ( temp 3-component vector of float) +0:14 Function Parameters: +0:14 'inF0' ( in 3-component vector of float) +0:14 'inF1' ( in 3-component vector of float) +0:? Sequence +0:15 frexp ( temp 3-component vector of float) +0:15 'inF0' ( in 3-component vector of float) +0:15 'inF1' ( in 3-component vector of float) +0:16 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:20 Function Definition: VertexShaderFunction4(vf4;vf4; ( temp 4-component vector of float) +0:20 Function Parameters: +0:20 'inF0' ( in 4-component vector of float) +0:20 'inF1' ( in 4-component vector of float) +0:? Sequence +0:21 frexp ( temp 4-component vector of float) +0:21 'inF0' ( in 4-component vector of float) +0:21 'inF1' ( in 4-component vector of float) +0:22 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? Linker Objects + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 78 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "VertexShaderFunction" + Source HLSL 500 + Name 4 "VertexShaderFunction" + Name 11 "VertexShaderFunctionS(f1;f1;" + Name 9 "inF0" + Name 10 "inF1" + Name 18 "VertexShaderFunction2(vf2;vf2;" + Name 16 "inF0" + Name 17 "inF1" + Name 25 "VertexShaderFunction3(vf3;vf3;" + Name 23 "inF0" + Name 24 "inF1" + Name 32 "VertexShaderFunction4(vf4;vf4;" + Name 30 "inF0" + Name 31 "inF1" + Name 36 "ResType" + Name 46 "ResType" + Name 58 "ResType" + Name 69 "ResType" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeFunction 6(float) 7(ptr) 7(ptr) + 13: TypeVector 6(float) 2 + 14: TypePointer Function 13(fvec2) + 15: TypeFunction 13(fvec2) 14(ptr) 14(ptr) + 20: TypeVector 6(float) 3 + 21: TypePointer Function 20(fvec3) + 22: TypeFunction 20(fvec3) 21(ptr) 21(ptr) + 27: TypeVector 6(float) 4 + 28: TypePointer Function 27(fvec4) + 29: TypeFunction 27(fvec4) 28(ptr) 28(ptr) + 35: TypeInt 32 1 + 36(ResType): TypeStruct 6(float) 35(int) + 41: 6(float) Constant 0 + 45: TypeVector 35(int) 2 + 46(ResType): TypeStruct 13(fvec2) 45(ivec2) + 51: 6(float) Constant 1065353216 + 52: 6(float) Constant 1073741824 + 53: 13(fvec2) ConstantComposite 51 52 + 57: TypeVector 35(int) 3 + 58(ResType): TypeStruct 20(fvec3) 57(ivec3) + 63: 6(float) Constant 1077936128 + 64: 20(fvec3) ConstantComposite 51 52 63 + 68: TypeVector 35(int) 4 + 69(ResType): TypeStruct 27(fvec4) 68(ivec4) + 74: 6(float) Constant 1082130432 + 75: 27(fvec4) ConstantComposite 51 52 63 74 +4(VertexShaderFunction): 2 Function None 3 + 5: Label + Return + FunctionEnd +11(VertexShaderFunctionS(f1;f1;): 6(float) Function None 8 + 9(inF0): 7(ptr) FunctionParameter + 10(inF1): 7(ptr) FunctionParameter + 12: Label + 34: 6(float) Load 9(inF0) + 37: 36(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 34 + 38: 35(int) CompositeExtract 37 1 + 39: 6(float) ConvertSToF 38 + Store 10(inF1) 39 + 40: 6(float) CompositeExtract 37 0 + ReturnValue 41 + FunctionEnd +18(VertexShaderFunction2(vf2;vf2;): 13(fvec2) Function None 15 + 16(inF0): 14(ptr) FunctionParameter + 17(inF1): 14(ptr) FunctionParameter + 19: Label + 44: 13(fvec2) Load 16(inF0) + 47: 46(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 44 + 48: 45(ivec2) CompositeExtract 47 1 + 49: 13(fvec2) ConvertSToF 48 + Store 17(inF1) 49 + 50: 13(fvec2) CompositeExtract 47 0 + ReturnValue 53 + FunctionEnd +25(VertexShaderFunction3(vf3;vf3;): 20(fvec3) Function None 22 + 23(inF0): 21(ptr) FunctionParameter + 24(inF1): 21(ptr) FunctionParameter + 26: Label + 56: 20(fvec3) Load 23(inF0) + 59: 58(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 56 + 60: 57(ivec3) CompositeExtract 59 1 + 61: 20(fvec3) ConvertSToF 60 + Store 24(inF1) 61 + 62: 20(fvec3) CompositeExtract 59 0 + ReturnValue 64 + FunctionEnd +32(VertexShaderFunction4(vf4;vf4;): 27(fvec4) Function None 29 + 30(inF0): 28(ptr) FunctionParameter + 31(inF1): 28(ptr) FunctionParameter + 33: Label + 67: 27(fvec4) Load 30(inF0) + 70: 69(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 67 + 71: 68(ivec4) CompositeExtract 70 1 + 72: 27(fvec4) ConvertSToF 71 + Store 31(inF1) 72 + 73: 27(fvec4) CompositeExtract 70 0 + ReturnValue 75 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.barriers.comp.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.barriers.comp.out new file mode 100644 index 00000000..13fe5780 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.barriers.comp.out @@ -0,0 +1,96 @@ +hlsl.intrinsics.barriers.comp +Shader version: 500 +local_size = (1, 1, 1) +0:? Sequence +0:3 Function Definition: @ComputeShaderFunction( ( temp float) +0:3 Function Parameters: +0:? Sequence +0:4 MemoryBarrier ( temp void) +0:5 AllMemoryBarrierWithGroupSync ( temp void) +0:6 DeviceMemoryBarrier ( temp void) +0:7 DeviceMemoryBarrierWithGroupSync ( temp void) +0:8 WorkgroupMemoryBarrier ( temp void) +0:9 WorkgroupMemoryBarrierWithGroupSync ( temp void) +0:11 Branch: Return with expression +0:11 Constant: +0:11 0.000000 +0:3 Function Definition: ComputeShaderFunction( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:3 move second child to first child ( temp float) +0:? '@entryPointOutput' (layout( location=0) out float) +0:3 Function Call: @ComputeShaderFunction( ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out float) + + +Linked compute stage: + + +Shader version: 500 +local_size = (1, 1, 1) +0:? Sequence +0:3 Function Definition: @ComputeShaderFunction( ( temp float) +0:3 Function Parameters: +0:? Sequence +0:4 MemoryBarrier ( temp void) +0:5 AllMemoryBarrierWithGroupSync ( temp void) +0:6 DeviceMemoryBarrier ( temp void) +0:7 DeviceMemoryBarrierWithGroupSync ( temp void) +0:8 WorkgroupMemoryBarrier ( temp void) +0:9 WorkgroupMemoryBarrierWithGroupSync ( temp void) +0:11 Branch: Return with expression +0:11 Constant: +0:11 0.000000 +0:3 Function Definition: ComputeShaderFunction( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:3 move second child to first child ( temp float) +0:? '@entryPointOutput' (layout( location=0) out float) +0:3 Function Call: @ComputeShaderFunction( ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 22 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "ComputeShaderFunction" 20 + ExecutionMode 4 LocalSize 1 1 1 + Source HLSL 500 + Name 4 "ComputeShaderFunction" + Name 8 "@ComputeShaderFunction(" + Name 20 "@entryPointOutput" + Decorate 20(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeFunction 6(float) + 10: TypeInt 32 0 + 11: 10(int) Constant 1 + 12: 10(int) Constant 3400 + 13: 10(int) Constant 2 + 14: 10(int) Constant 2120 + 15: 10(int) Constant 264 + 16: 6(float) Constant 0 + 19: TypePointer Output 6(float) +20(@entryPointOutput): 19(ptr) Variable Output +4(ComputeShaderFunction): 2 Function None 3 + 5: Label + 21: 6(float) FunctionCall 8(@ComputeShaderFunction() + Store 20(@entryPointOutput) 21 + Return + FunctionEnd +8(@ComputeShaderFunction(): 6(float) Function None 7 + 9: Label + MemoryBarrier 11 12 + ControlBarrier 13 11 12 + MemoryBarrier 11 14 + ControlBarrier 13 11 14 + MemoryBarrier 13 15 + ControlBarrier 13 13 15 + ReturnValue 16 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.comp.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.comp.out new file mode 100644 index 00000000..5058f236 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.comp.out @@ -0,0 +1,1106 @@ +hlsl.intrinsics.comp +Shader version: 500 +local_size = (1, 1, 1) +0:? Sequence +0:17 Function Definition: ComputeShaderFunctionS(f1;f1;f1;u1;u1; ( temp float) +0:17 Function Parameters: +0:17 'inF0' ( in float) +0:17 'inF1' ( in float) +0:17 'inF2' ( in float) +0:17 'inU0' ( in uint) +0:17 'inU1' ( in uint) +0:? Sequence +0:21 all ( temp bool) +0:21 Convert float to bool ( temp bool) +0:21 'inF0' ( in float) +0:24 AtomicAdd ( temp uint) +0:24 'gs_ua' ( shared uint) +0:24 'gs_ub' ( shared uint) +0:25 move second child to first child ( temp uint) +0:25 'out_u1' ( temp uint) +0:25 AtomicAdd ( temp uint) +0:25 'gs_ua' ( shared uint) +0:25 'gs_ub' ( shared uint) +0:26 AtomicAnd ( temp uint) +0:26 'gs_ua' ( shared uint) +0:26 'gs_ub' ( shared uint) +0:27 move second child to first child ( temp uint) +0:27 'out_u1' ( temp uint) +0:27 AtomicAnd ( temp uint) +0:27 'gs_ua' ( shared uint) +0:27 'gs_ub' ( shared uint) +0:28 move second child to first child ( temp uint) +0:28 'out_u1' ( temp uint) +0:28 AtomicCompSwap ( temp uint) +0:28 'gs_ua' ( shared uint) +0:28 'gs_ub' ( shared uint) +0:28 'gs_uc' ( shared uint) +0:29 move second child to first child ( temp uint) +0:29 'out_u1' ( temp uint) +0:29 AtomicExchange ( temp uint) +0:29 'gs_ua' ( shared uint) +0:29 'gs_ub' ( shared uint) +0:30 AtomicMax ( temp uint) +0:30 'gs_ua' ( shared uint) +0:30 'gs_ub' ( shared uint) +0:31 move second child to first child ( temp uint) +0:31 'out_u1' ( temp uint) +0:31 AtomicMax ( temp uint) +0:31 'gs_ua' ( shared uint) +0:31 'gs_ub' ( shared uint) +0:32 AtomicMin ( temp uint) +0:32 'gs_ua' ( shared uint) +0:32 'gs_ub' ( shared uint) +0:33 move second child to first child ( temp uint) +0:33 'out_u1' ( temp uint) +0:33 AtomicMin ( temp uint) +0:33 'gs_ua' ( shared uint) +0:33 'gs_ub' ( shared uint) +0:34 AtomicOr ( temp uint) +0:34 'gs_ua' ( shared uint) +0:34 'gs_ub' ( shared uint) +0:35 move second child to first child ( temp uint) +0:35 'out_u1' ( temp uint) +0:35 AtomicOr ( temp uint) +0:35 'gs_ua' ( shared uint) +0:35 'gs_ub' ( shared uint) +0:36 AtomicXor ( temp uint) +0:36 'gs_ua' ( shared uint) +0:36 'gs_ub' ( shared uint) +0:37 move second child to first child ( temp uint) +0:37 'out_u1' ( temp uint) +0:37 AtomicXor ( temp uint) +0:37 'gs_ua' ( shared uint) +0:37 'gs_ub' ( shared uint) +0:41 Branch: Return with expression +0:41 Constant: +0:41 0.000000 +0:45 Function Definition: ComputeShaderFunction1(vf1;vf1;vf1; ( temp 1-component vector of float) +0:45 Function Parameters: +0:45 'inF0' ( in 1-component vector of float) +0:45 'inF1' ( in 1-component vector of float) +0:45 'inF2' ( in 1-component vector of float) +0:? Sequence +0:47 Branch: Return with expression +0:47 Constant: +0:47 0.000000 +0:51 Function Definition: ComputeShaderFunction2(vf2;vf2;vf2;vu2;vu2; ( temp 2-component vector of float) +0:51 Function Parameters: +0:51 'inF0' ( in 2-component vector of float) +0:51 'inF1' ( in 2-component vector of float) +0:51 'inF2' ( in 2-component vector of float) +0:51 'inU0' ( in 2-component vector of uint) +0:51 'inU1' ( in 2-component vector of uint) +0:? Sequence +0:55 all ( temp bool) +0:55 Convert float to bool ( temp 2-component vector of bool) +0:55 'inF0' ( in 2-component vector of float) +0:58 AtomicAdd ( temp 2-component vector of uint) +0:58 'gs_ua2' ( shared 2-component vector of uint) +0:58 'gs_ub2' ( shared 2-component vector of uint) +0:59 move second child to first child ( temp 2-component vector of uint) +0:59 'out_u2' ( temp 2-component vector of uint) +0:59 AtomicAdd ( temp 2-component vector of uint) +0:59 'gs_ua2' ( shared 2-component vector of uint) +0:59 'gs_ub2' ( shared 2-component vector of uint) +0:60 AtomicAnd ( temp 2-component vector of uint) +0:60 'gs_ua2' ( shared 2-component vector of uint) +0:60 'gs_ub2' ( shared 2-component vector of uint) +0:61 move second child to first child ( temp 2-component vector of uint) +0:61 'out_u2' ( temp 2-component vector of uint) +0:61 AtomicAnd ( temp 2-component vector of uint) +0:61 'gs_ua2' ( shared 2-component vector of uint) +0:61 'gs_ub2' ( shared 2-component vector of uint) +0:62 move second child to first child ( temp 2-component vector of uint) +0:62 'out_u2' ( temp 2-component vector of uint) +0:62 AtomicCompSwap ( temp 2-component vector of uint) +0:62 'gs_ua2' ( shared 2-component vector of uint) +0:62 'gs_ub2' ( shared 2-component vector of uint) +0:62 'gs_uc2' ( shared 2-component vector of uint) +0:63 move second child to first child ( temp 2-component vector of uint) +0:63 'out_u2' ( temp 2-component vector of uint) +0:63 AtomicExchange ( temp 2-component vector of uint) +0:63 'gs_ua2' ( shared 2-component vector of uint) +0:63 'gs_ub2' ( shared 2-component vector of uint) +0:64 AtomicMax ( temp 2-component vector of uint) +0:64 'gs_ua2' ( shared 2-component vector of uint) +0:64 'gs_ub2' ( shared 2-component vector of uint) +0:65 move second child to first child ( temp 2-component vector of uint) +0:65 'out_u2' ( temp 2-component vector of uint) +0:65 AtomicMax ( temp 2-component vector of uint) +0:65 'gs_ua2' ( shared 2-component vector of uint) +0:65 'gs_ub2' ( shared 2-component vector of uint) +0:66 AtomicMin ( temp 2-component vector of uint) +0:66 'gs_ua2' ( shared 2-component vector of uint) +0:66 'gs_ub2' ( shared 2-component vector of uint) +0:67 move second child to first child ( temp 2-component vector of uint) +0:67 'out_u2' ( temp 2-component vector of uint) +0:67 AtomicMin ( temp 2-component vector of uint) +0:67 'gs_ua2' ( shared 2-component vector of uint) +0:67 'gs_ub2' ( shared 2-component vector of uint) +0:68 AtomicOr ( temp 2-component vector of uint) +0:68 'gs_ua2' ( shared 2-component vector of uint) +0:68 'gs_ub2' ( shared 2-component vector of uint) +0:69 move second child to first child ( temp 2-component vector of uint) +0:69 'out_u2' ( temp 2-component vector of uint) +0:69 AtomicOr ( temp 2-component vector of uint) +0:69 'gs_ua2' ( shared 2-component vector of uint) +0:69 'gs_ub2' ( shared 2-component vector of uint) +0:70 AtomicXor ( temp 2-component vector of uint) +0:70 'gs_ua2' ( shared 2-component vector of uint) +0:70 'gs_ub2' ( shared 2-component vector of uint) +0:71 move second child to first child ( temp 2-component vector of uint) +0:71 'out_u2' ( temp 2-component vector of uint) +0:71 AtomicXor ( temp 2-component vector of uint) +0:71 'gs_ua2' ( shared 2-component vector of uint) +0:71 'gs_ub2' ( shared 2-component vector of uint) +0:74 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:78 Function Definition: ComputeShaderFunction3(vf3;vf3;vf3;vu3;vu3; ( temp 3-component vector of float) +0:78 Function Parameters: +0:78 'inF0' ( in 3-component vector of float) +0:78 'inF1' ( in 3-component vector of float) +0:78 'inF2' ( in 3-component vector of float) +0:78 'inU0' ( in 3-component vector of uint) +0:78 'inU1' ( in 3-component vector of uint) +0:? Sequence +0:82 all ( temp bool) +0:82 Convert float to bool ( temp 3-component vector of bool) +0:82 'inF0' ( in 3-component vector of float) +0:85 AtomicAdd ( temp 3-component vector of uint) +0:85 'gs_ua3' ( shared 3-component vector of uint) +0:85 'gs_ub3' ( shared 3-component vector of uint) +0:86 move second child to first child ( temp 3-component vector of uint) +0:86 'out_u3' ( temp 3-component vector of uint) +0:86 AtomicAdd ( temp 3-component vector of uint) +0:86 'gs_ua3' ( shared 3-component vector of uint) +0:86 'gs_ub3' ( shared 3-component vector of uint) +0:87 AtomicAnd ( temp 3-component vector of uint) +0:87 'gs_ua3' ( shared 3-component vector of uint) +0:87 'gs_ub3' ( shared 3-component vector of uint) +0:88 move second child to first child ( temp 3-component vector of uint) +0:88 'out_u3' ( temp 3-component vector of uint) +0:88 AtomicAnd ( temp 3-component vector of uint) +0:88 'gs_ua3' ( shared 3-component vector of uint) +0:88 'gs_ub3' ( shared 3-component vector of uint) +0:89 move second child to first child ( temp 3-component vector of uint) +0:89 'out_u3' ( temp 3-component vector of uint) +0:89 AtomicCompSwap ( temp 3-component vector of uint) +0:89 'gs_ua3' ( shared 3-component vector of uint) +0:89 'gs_ub3' ( shared 3-component vector of uint) +0:89 'gs_uc3' ( shared 3-component vector of uint) +0:90 move second child to first child ( temp 3-component vector of uint) +0:90 'out_u3' ( temp 3-component vector of uint) +0:90 AtomicExchange ( temp 3-component vector of uint) +0:90 'gs_ua3' ( shared 3-component vector of uint) +0:90 'gs_ub3' ( shared 3-component vector of uint) +0:91 AtomicMax ( temp 3-component vector of uint) +0:91 'gs_ua3' ( shared 3-component vector of uint) +0:91 'gs_ub3' ( shared 3-component vector of uint) +0:92 move second child to first child ( temp 3-component vector of uint) +0:92 'out_u3' ( temp 3-component vector of uint) +0:92 AtomicMax ( temp 3-component vector of uint) +0:92 'gs_ua3' ( shared 3-component vector of uint) +0:92 'gs_ub3' ( shared 3-component vector of uint) +0:93 AtomicMin ( temp 3-component vector of uint) +0:93 'gs_ua3' ( shared 3-component vector of uint) +0:93 'gs_ub3' ( shared 3-component vector of uint) +0:94 move second child to first child ( temp 3-component vector of uint) +0:94 'out_u3' ( temp 3-component vector of uint) +0:94 AtomicMin ( temp 3-component vector of uint) +0:94 'gs_ua3' ( shared 3-component vector of uint) +0:94 'gs_ub3' ( shared 3-component vector of uint) +0:95 AtomicOr ( temp 3-component vector of uint) +0:95 'gs_ua3' ( shared 3-component vector of uint) +0:95 'gs_ub3' ( shared 3-component vector of uint) +0:96 move second child to first child ( temp 3-component vector of uint) +0:96 'out_u3' ( temp 3-component vector of uint) +0:96 AtomicOr ( temp 3-component vector of uint) +0:96 'gs_ua3' ( shared 3-component vector of uint) +0:96 'gs_ub3' ( shared 3-component vector of uint) +0:97 AtomicXor ( temp 3-component vector of uint) +0:97 'gs_ua3' ( shared 3-component vector of uint) +0:97 'gs_ub3' ( shared 3-component vector of uint) +0:98 move second child to first child ( temp 3-component vector of uint) +0:98 'out_u3' ( temp 3-component vector of uint) +0:98 AtomicXor ( temp 3-component vector of uint) +0:98 'gs_ua3' ( shared 3-component vector of uint) +0:98 'gs_ub3' ( shared 3-component vector of uint) +0:101 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:105 Function Definition: @ComputeShaderFunction(vf4;vf4;vf4;vu4;vu4; ( temp 4-component vector of float) +0:105 Function Parameters: +0:105 'inF0' ( in 4-component vector of float) +0:105 'inF1' ( in 4-component vector of float) +0:105 'inF2' ( in 4-component vector of float) +0:105 'inU0' ( in 4-component vector of uint) +0:105 'inU1' ( in 4-component vector of uint) +0:? Sequence +0:109 all ( temp bool) +0:109 Convert float to bool ( temp 4-component vector of bool) +0:109 'inF0' ( in 4-component vector of float) +0:112 AtomicAdd ( temp 4-component vector of uint) +0:112 'gs_ua4' ( shared 4-component vector of uint) +0:112 'gs_ub4' ( shared 4-component vector of uint) +0:113 move second child to first child ( temp 4-component vector of uint) +0:113 'out_u4' ( temp 4-component vector of uint) +0:113 AtomicAdd ( temp 4-component vector of uint) +0:113 'gs_ua4' ( shared 4-component vector of uint) +0:113 'gs_ub4' ( shared 4-component vector of uint) +0:114 AtomicAnd ( temp 4-component vector of uint) +0:114 'gs_ua4' ( shared 4-component vector of uint) +0:114 'gs_ub4' ( shared 4-component vector of uint) +0:115 move second child to first child ( temp 4-component vector of uint) +0:115 'out_u4' ( temp 4-component vector of uint) +0:115 AtomicAnd ( temp 4-component vector of uint) +0:115 'gs_ua4' ( shared 4-component vector of uint) +0:115 'gs_ub4' ( shared 4-component vector of uint) +0:116 move second child to first child ( temp 4-component vector of uint) +0:116 'out_u4' ( temp 4-component vector of uint) +0:116 AtomicCompSwap ( temp 4-component vector of uint) +0:116 'gs_ua4' ( shared 4-component vector of uint) +0:116 'gs_ub4' ( shared 4-component vector of uint) +0:116 'gs_uc4' ( shared 4-component vector of uint) +0:117 move second child to first child ( temp 4-component vector of uint) +0:117 'out_u4' ( temp 4-component vector of uint) +0:117 AtomicExchange ( temp 4-component vector of uint) +0:117 'gs_ua4' ( shared 4-component vector of uint) +0:117 'gs_ub4' ( shared 4-component vector of uint) +0:118 AtomicMax ( temp 4-component vector of uint) +0:118 'gs_ua4' ( shared 4-component vector of uint) +0:118 'gs_ub4' ( shared 4-component vector of uint) +0:119 move second child to first child ( temp 4-component vector of uint) +0:119 'out_u4' ( temp 4-component vector of uint) +0:119 AtomicMax ( temp 4-component vector of uint) +0:119 'gs_ua4' ( shared 4-component vector of uint) +0:119 'gs_ub4' ( shared 4-component vector of uint) +0:120 AtomicMin ( temp 4-component vector of uint) +0:120 'gs_ua4' ( shared 4-component vector of uint) +0:120 'gs_ub4' ( shared 4-component vector of uint) +0:121 move second child to first child ( temp 4-component vector of uint) +0:121 'out_u4' ( temp 4-component vector of uint) +0:121 AtomicMin ( temp 4-component vector of uint) +0:121 'gs_ua4' ( shared 4-component vector of uint) +0:121 'gs_ub4' ( shared 4-component vector of uint) +0:122 AtomicOr ( temp 4-component vector of uint) +0:122 'gs_ua4' ( shared 4-component vector of uint) +0:122 'gs_ub4' ( shared 4-component vector of uint) +0:123 move second child to first child ( temp 4-component vector of uint) +0:123 'out_u4' ( temp 4-component vector of uint) +0:123 AtomicOr ( temp 4-component vector of uint) +0:123 'gs_ua4' ( shared 4-component vector of uint) +0:123 'gs_ub4' ( shared 4-component vector of uint) +0:124 AtomicXor ( temp 4-component vector of uint) +0:124 'gs_ua4' ( shared 4-component vector of uint) +0:124 'gs_ub4' ( shared 4-component vector of uint) +0:125 move second child to first child ( temp 4-component vector of uint) +0:125 'out_u4' ( temp 4-component vector of uint) +0:125 AtomicXor ( temp 4-component vector of uint) +0:125 'gs_ua4' ( shared 4-component vector of uint) +0:125 'gs_ub4' ( shared 4-component vector of uint) +0:128 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:105 Function Definition: ComputeShaderFunction( ( temp void) +0:105 Function Parameters: +0:? Sequence +0:105 move second child to first child ( temp 4-component vector of float) +0:? 'inF0' ( temp 4-component vector of float) +0:? 'inF0' (layout( location=0) in 4-component vector of float) +0:105 move second child to first child ( temp 4-component vector of float) +0:? 'inF1' ( temp 4-component vector of float) +0:? 'inF1' (layout( location=1) in 4-component vector of float) +0:105 move second child to first child ( temp 4-component vector of float) +0:? 'inF2' ( temp 4-component vector of float) +0:? 'inF2' (layout( location=2) in 4-component vector of float) +0:105 move second child to first child ( temp 4-component vector of uint) +0:? 'inU0' ( temp 4-component vector of uint) +0:? 'inU0' (layout( location=3) in 4-component vector of uint) +0:105 move second child to first child ( temp 4-component vector of uint) +0:? 'inU1' ( temp 4-component vector of uint) +0:? 'inU1' (layout( location=4) in 4-component vector of uint) +0:105 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:105 Function Call: @ComputeShaderFunction(vf4;vf4;vf4;vu4;vu4; ( temp 4-component vector of float) +0:? 'inF0' ( temp 4-component vector of float) +0:? 'inF1' ( temp 4-component vector of float) +0:? 'inF2' ( temp 4-component vector of float) +0:? 'inU0' ( temp 4-component vector of uint) +0:? 'inU1' ( temp 4-component vector of uint) +0:? Linker Objects +0:? 'gs_ua' ( shared uint) +0:? 'gs_ub' ( shared uint) +0:? 'gs_uc' ( shared uint) +0:? 'gs_ua2' ( shared 2-component vector of uint) +0:? 'gs_ub2' ( shared 2-component vector of uint) +0:? 'gs_uc2' ( shared 2-component vector of uint) +0:? 'gs_ua3' ( shared 3-component vector of uint) +0:? 'gs_ub3' ( shared 3-component vector of uint) +0:? 'gs_uc3' ( shared 3-component vector of uint) +0:? 'gs_ua4' ( shared 4-component vector of uint) +0:? 'gs_ub4' ( shared 4-component vector of uint) +0:? 'gs_uc4' ( shared 4-component vector of uint) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'inF0' (layout( location=0) in 4-component vector of float) +0:? 'inF1' (layout( location=1) in 4-component vector of float) +0:? 'inF2' (layout( location=2) in 4-component vector of float) +0:? 'inU0' (layout( location=3) in 4-component vector of uint) +0:? 'inU1' (layout( location=4) in 4-component vector of uint) + + +Linked compute stage: + + +Shader version: 500 +local_size = (1, 1, 1) +0:? Sequence +0:17 Function Definition: ComputeShaderFunctionS(f1;f1;f1;u1;u1; ( temp float) +0:17 Function Parameters: +0:17 'inF0' ( in float) +0:17 'inF1' ( in float) +0:17 'inF2' ( in float) +0:17 'inU0' ( in uint) +0:17 'inU1' ( in uint) +0:? Sequence +0:21 all ( temp bool) +0:21 Convert float to bool ( temp bool) +0:21 'inF0' ( in float) +0:24 AtomicAdd ( temp uint) +0:24 'gs_ua' ( shared uint) +0:24 'gs_ub' ( shared uint) +0:25 move second child to first child ( temp uint) +0:25 'out_u1' ( temp uint) +0:25 AtomicAdd ( temp uint) +0:25 'gs_ua' ( shared uint) +0:25 'gs_ub' ( shared uint) +0:26 AtomicAnd ( temp uint) +0:26 'gs_ua' ( shared uint) +0:26 'gs_ub' ( shared uint) +0:27 move second child to first child ( temp uint) +0:27 'out_u1' ( temp uint) +0:27 AtomicAnd ( temp uint) +0:27 'gs_ua' ( shared uint) +0:27 'gs_ub' ( shared uint) +0:28 move second child to first child ( temp uint) +0:28 'out_u1' ( temp uint) +0:28 AtomicCompSwap ( temp uint) +0:28 'gs_ua' ( shared uint) +0:28 'gs_ub' ( shared uint) +0:28 'gs_uc' ( shared uint) +0:29 move second child to first child ( temp uint) +0:29 'out_u1' ( temp uint) +0:29 AtomicExchange ( temp uint) +0:29 'gs_ua' ( shared uint) +0:29 'gs_ub' ( shared uint) +0:30 AtomicMax ( temp uint) +0:30 'gs_ua' ( shared uint) +0:30 'gs_ub' ( shared uint) +0:31 move second child to first child ( temp uint) +0:31 'out_u1' ( temp uint) +0:31 AtomicMax ( temp uint) +0:31 'gs_ua' ( shared uint) +0:31 'gs_ub' ( shared uint) +0:32 AtomicMin ( temp uint) +0:32 'gs_ua' ( shared uint) +0:32 'gs_ub' ( shared uint) +0:33 move second child to first child ( temp uint) +0:33 'out_u1' ( temp uint) +0:33 AtomicMin ( temp uint) +0:33 'gs_ua' ( shared uint) +0:33 'gs_ub' ( shared uint) +0:34 AtomicOr ( temp uint) +0:34 'gs_ua' ( shared uint) +0:34 'gs_ub' ( shared uint) +0:35 move second child to first child ( temp uint) +0:35 'out_u1' ( temp uint) +0:35 AtomicOr ( temp uint) +0:35 'gs_ua' ( shared uint) +0:35 'gs_ub' ( shared uint) +0:36 AtomicXor ( temp uint) +0:36 'gs_ua' ( shared uint) +0:36 'gs_ub' ( shared uint) +0:37 move second child to first child ( temp uint) +0:37 'out_u1' ( temp uint) +0:37 AtomicXor ( temp uint) +0:37 'gs_ua' ( shared uint) +0:37 'gs_ub' ( shared uint) +0:41 Branch: Return with expression +0:41 Constant: +0:41 0.000000 +0:45 Function Definition: ComputeShaderFunction1(vf1;vf1;vf1; ( temp 1-component vector of float) +0:45 Function Parameters: +0:45 'inF0' ( in 1-component vector of float) +0:45 'inF1' ( in 1-component vector of float) +0:45 'inF2' ( in 1-component vector of float) +0:? Sequence +0:47 Branch: Return with expression +0:47 Constant: +0:47 0.000000 +0:51 Function Definition: ComputeShaderFunction2(vf2;vf2;vf2;vu2;vu2; ( temp 2-component vector of float) +0:51 Function Parameters: +0:51 'inF0' ( in 2-component vector of float) +0:51 'inF1' ( in 2-component vector of float) +0:51 'inF2' ( in 2-component vector of float) +0:51 'inU0' ( in 2-component vector of uint) +0:51 'inU1' ( in 2-component vector of uint) +0:? Sequence +0:55 all ( temp bool) +0:55 Convert float to bool ( temp 2-component vector of bool) +0:55 'inF0' ( in 2-component vector of float) +0:58 AtomicAdd ( temp 2-component vector of uint) +0:58 'gs_ua2' ( shared 2-component vector of uint) +0:58 'gs_ub2' ( shared 2-component vector of uint) +0:59 move second child to first child ( temp 2-component vector of uint) +0:59 'out_u2' ( temp 2-component vector of uint) +0:59 AtomicAdd ( temp 2-component vector of uint) +0:59 'gs_ua2' ( shared 2-component vector of uint) +0:59 'gs_ub2' ( shared 2-component vector of uint) +0:60 AtomicAnd ( temp 2-component vector of uint) +0:60 'gs_ua2' ( shared 2-component vector of uint) +0:60 'gs_ub2' ( shared 2-component vector of uint) +0:61 move second child to first child ( temp 2-component vector of uint) +0:61 'out_u2' ( temp 2-component vector of uint) +0:61 AtomicAnd ( temp 2-component vector of uint) +0:61 'gs_ua2' ( shared 2-component vector of uint) +0:61 'gs_ub2' ( shared 2-component vector of uint) +0:62 move second child to first child ( temp 2-component vector of uint) +0:62 'out_u2' ( temp 2-component vector of uint) +0:62 AtomicCompSwap ( temp 2-component vector of uint) +0:62 'gs_ua2' ( shared 2-component vector of uint) +0:62 'gs_ub2' ( shared 2-component vector of uint) +0:62 'gs_uc2' ( shared 2-component vector of uint) +0:63 move second child to first child ( temp 2-component vector of uint) +0:63 'out_u2' ( temp 2-component vector of uint) +0:63 AtomicExchange ( temp 2-component vector of uint) +0:63 'gs_ua2' ( shared 2-component vector of uint) +0:63 'gs_ub2' ( shared 2-component vector of uint) +0:64 AtomicMax ( temp 2-component vector of uint) +0:64 'gs_ua2' ( shared 2-component vector of uint) +0:64 'gs_ub2' ( shared 2-component vector of uint) +0:65 move second child to first child ( temp 2-component vector of uint) +0:65 'out_u2' ( temp 2-component vector of uint) +0:65 AtomicMax ( temp 2-component vector of uint) +0:65 'gs_ua2' ( shared 2-component vector of uint) +0:65 'gs_ub2' ( shared 2-component vector of uint) +0:66 AtomicMin ( temp 2-component vector of uint) +0:66 'gs_ua2' ( shared 2-component vector of uint) +0:66 'gs_ub2' ( shared 2-component vector of uint) +0:67 move second child to first child ( temp 2-component vector of uint) +0:67 'out_u2' ( temp 2-component vector of uint) +0:67 AtomicMin ( temp 2-component vector of uint) +0:67 'gs_ua2' ( shared 2-component vector of uint) +0:67 'gs_ub2' ( shared 2-component vector of uint) +0:68 AtomicOr ( temp 2-component vector of uint) +0:68 'gs_ua2' ( shared 2-component vector of uint) +0:68 'gs_ub2' ( shared 2-component vector of uint) +0:69 move second child to first child ( temp 2-component vector of uint) +0:69 'out_u2' ( temp 2-component vector of uint) +0:69 AtomicOr ( temp 2-component vector of uint) +0:69 'gs_ua2' ( shared 2-component vector of uint) +0:69 'gs_ub2' ( shared 2-component vector of uint) +0:70 AtomicXor ( temp 2-component vector of uint) +0:70 'gs_ua2' ( shared 2-component vector of uint) +0:70 'gs_ub2' ( shared 2-component vector of uint) +0:71 move second child to first child ( temp 2-component vector of uint) +0:71 'out_u2' ( temp 2-component vector of uint) +0:71 AtomicXor ( temp 2-component vector of uint) +0:71 'gs_ua2' ( shared 2-component vector of uint) +0:71 'gs_ub2' ( shared 2-component vector of uint) +0:74 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:78 Function Definition: ComputeShaderFunction3(vf3;vf3;vf3;vu3;vu3; ( temp 3-component vector of float) +0:78 Function Parameters: +0:78 'inF0' ( in 3-component vector of float) +0:78 'inF1' ( in 3-component vector of float) +0:78 'inF2' ( in 3-component vector of float) +0:78 'inU0' ( in 3-component vector of uint) +0:78 'inU1' ( in 3-component vector of uint) +0:? Sequence +0:82 all ( temp bool) +0:82 Convert float to bool ( temp 3-component vector of bool) +0:82 'inF0' ( in 3-component vector of float) +0:85 AtomicAdd ( temp 3-component vector of uint) +0:85 'gs_ua3' ( shared 3-component vector of uint) +0:85 'gs_ub3' ( shared 3-component vector of uint) +0:86 move second child to first child ( temp 3-component vector of uint) +0:86 'out_u3' ( temp 3-component vector of uint) +0:86 AtomicAdd ( temp 3-component vector of uint) +0:86 'gs_ua3' ( shared 3-component vector of uint) +0:86 'gs_ub3' ( shared 3-component vector of uint) +0:87 AtomicAnd ( temp 3-component vector of uint) +0:87 'gs_ua3' ( shared 3-component vector of uint) +0:87 'gs_ub3' ( shared 3-component vector of uint) +0:88 move second child to first child ( temp 3-component vector of uint) +0:88 'out_u3' ( temp 3-component vector of uint) +0:88 AtomicAnd ( temp 3-component vector of uint) +0:88 'gs_ua3' ( shared 3-component vector of uint) +0:88 'gs_ub3' ( shared 3-component vector of uint) +0:89 move second child to first child ( temp 3-component vector of uint) +0:89 'out_u3' ( temp 3-component vector of uint) +0:89 AtomicCompSwap ( temp 3-component vector of uint) +0:89 'gs_ua3' ( shared 3-component vector of uint) +0:89 'gs_ub3' ( shared 3-component vector of uint) +0:89 'gs_uc3' ( shared 3-component vector of uint) +0:90 move second child to first child ( temp 3-component vector of uint) +0:90 'out_u3' ( temp 3-component vector of uint) +0:90 AtomicExchange ( temp 3-component vector of uint) +0:90 'gs_ua3' ( shared 3-component vector of uint) +0:90 'gs_ub3' ( shared 3-component vector of uint) +0:91 AtomicMax ( temp 3-component vector of uint) +0:91 'gs_ua3' ( shared 3-component vector of uint) +0:91 'gs_ub3' ( shared 3-component vector of uint) +0:92 move second child to first child ( temp 3-component vector of uint) +0:92 'out_u3' ( temp 3-component vector of uint) +0:92 AtomicMax ( temp 3-component vector of uint) +0:92 'gs_ua3' ( shared 3-component vector of uint) +0:92 'gs_ub3' ( shared 3-component vector of uint) +0:93 AtomicMin ( temp 3-component vector of uint) +0:93 'gs_ua3' ( shared 3-component vector of uint) +0:93 'gs_ub3' ( shared 3-component vector of uint) +0:94 move second child to first child ( temp 3-component vector of uint) +0:94 'out_u3' ( temp 3-component vector of uint) +0:94 AtomicMin ( temp 3-component vector of uint) +0:94 'gs_ua3' ( shared 3-component vector of uint) +0:94 'gs_ub3' ( shared 3-component vector of uint) +0:95 AtomicOr ( temp 3-component vector of uint) +0:95 'gs_ua3' ( shared 3-component vector of uint) +0:95 'gs_ub3' ( shared 3-component vector of uint) +0:96 move second child to first child ( temp 3-component vector of uint) +0:96 'out_u3' ( temp 3-component vector of uint) +0:96 AtomicOr ( temp 3-component vector of uint) +0:96 'gs_ua3' ( shared 3-component vector of uint) +0:96 'gs_ub3' ( shared 3-component vector of uint) +0:97 AtomicXor ( temp 3-component vector of uint) +0:97 'gs_ua3' ( shared 3-component vector of uint) +0:97 'gs_ub3' ( shared 3-component vector of uint) +0:98 move second child to first child ( temp 3-component vector of uint) +0:98 'out_u3' ( temp 3-component vector of uint) +0:98 AtomicXor ( temp 3-component vector of uint) +0:98 'gs_ua3' ( shared 3-component vector of uint) +0:98 'gs_ub3' ( shared 3-component vector of uint) +0:101 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:105 Function Definition: @ComputeShaderFunction(vf4;vf4;vf4;vu4;vu4; ( temp 4-component vector of float) +0:105 Function Parameters: +0:105 'inF0' ( in 4-component vector of float) +0:105 'inF1' ( in 4-component vector of float) +0:105 'inF2' ( in 4-component vector of float) +0:105 'inU0' ( in 4-component vector of uint) +0:105 'inU1' ( in 4-component vector of uint) +0:? Sequence +0:109 all ( temp bool) +0:109 Convert float to bool ( temp 4-component vector of bool) +0:109 'inF0' ( in 4-component vector of float) +0:112 AtomicAdd ( temp 4-component vector of uint) +0:112 'gs_ua4' ( shared 4-component vector of uint) +0:112 'gs_ub4' ( shared 4-component vector of uint) +0:113 move second child to first child ( temp 4-component vector of uint) +0:113 'out_u4' ( temp 4-component vector of uint) +0:113 AtomicAdd ( temp 4-component vector of uint) +0:113 'gs_ua4' ( shared 4-component vector of uint) +0:113 'gs_ub4' ( shared 4-component vector of uint) +0:114 AtomicAnd ( temp 4-component vector of uint) +0:114 'gs_ua4' ( shared 4-component vector of uint) +0:114 'gs_ub4' ( shared 4-component vector of uint) +0:115 move second child to first child ( temp 4-component vector of uint) +0:115 'out_u4' ( temp 4-component vector of uint) +0:115 AtomicAnd ( temp 4-component vector of uint) +0:115 'gs_ua4' ( shared 4-component vector of uint) +0:115 'gs_ub4' ( shared 4-component vector of uint) +0:116 move second child to first child ( temp 4-component vector of uint) +0:116 'out_u4' ( temp 4-component vector of uint) +0:116 AtomicCompSwap ( temp 4-component vector of uint) +0:116 'gs_ua4' ( shared 4-component vector of uint) +0:116 'gs_ub4' ( shared 4-component vector of uint) +0:116 'gs_uc4' ( shared 4-component vector of uint) +0:117 move second child to first child ( temp 4-component vector of uint) +0:117 'out_u4' ( temp 4-component vector of uint) +0:117 AtomicExchange ( temp 4-component vector of uint) +0:117 'gs_ua4' ( shared 4-component vector of uint) +0:117 'gs_ub4' ( shared 4-component vector of uint) +0:118 AtomicMax ( temp 4-component vector of uint) +0:118 'gs_ua4' ( shared 4-component vector of uint) +0:118 'gs_ub4' ( shared 4-component vector of uint) +0:119 move second child to first child ( temp 4-component vector of uint) +0:119 'out_u4' ( temp 4-component vector of uint) +0:119 AtomicMax ( temp 4-component vector of uint) +0:119 'gs_ua4' ( shared 4-component vector of uint) +0:119 'gs_ub4' ( shared 4-component vector of uint) +0:120 AtomicMin ( temp 4-component vector of uint) +0:120 'gs_ua4' ( shared 4-component vector of uint) +0:120 'gs_ub4' ( shared 4-component vector of uint) +0:121 move second child to first child ( temp 4-component vector of uint) +0:121 'out_u4' ( temp 4-component vector of uint) +0:121 AtomicMin ( temp 4-component vector of uint) +0:121 'gs_ua4' ( shared 4-component vector of uint) +0:121 'gs_ub4' ( shared 4-component vector of uint) +0:122 AtomicOr ( temp 4-component vector of uint) +0:122 'gs_ua4' ( shared 4-component vector of uint) +0:122 'gs_ub4' ( shared 4-component vector of uint) +0:123 move second child to first child ( temp 4-component vector of uint) +0:123 'out_u4' ( temp 4-component vector of uint) +0:123 AtomicOr ( temp 4-component vector of uint) +0:123 'gs_ua4' ( shared 4-component vector of uint) +0:123 'gs_ub4' ( shared 4-component vector of uint) +0:124 AtomicXor ( temp 4-component vector of uint) +0:124 'gs_ua4' ( shared 4-component vector of uint) +0:124 'gs_ub4' ( shared 4-component vector of uint) +0:125 move second child to first child ( temp 4-component vector of uint) +0:125 'out_u4' ( temp 4-component vector of uint) +0:125 AtomicXor ( temp 4-component vector of uint) +0:125 'gs_ua4' ( shared 4-component vector of uint) +0:125 'gs_ub4' ( shared 4-component vector of uint) +0:128 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:105 Function Definition: ComputeShaderFunction( ( temp void) +0:105 Function Parameters: +0:? Sequence +0:105 move second child to first child ( temp 4-component vector of float) +0:? 'inF0' ( temp 4-component vector of float) +0:? 'inF0' (layout( location=0) in 4-component vector of float) +0:105 move second child to first child ( temp 4-component vector of float) +0:? 'inF1' ( temp 4-component vector of float) +0:? 'inF1' (layout( location=1) in 4-component vector of float) +0:105 move second child to first child ( temp 4-component vector of float) +0:? 'inF2' ( temp 4-component vector of float) +0:? 'inF2' (layout( location=2) in 4-component vector of float) +0:105 move second child to first child ( temp 4-component vector of uint) +0:? 'inU0' ( temp 4-component vector of uint) +0:? 'inU0' (layout( location=3) in 4-component vector of uint) +0:105 move second child to first child ( temp 4-component vector of uint) +0:? 'inU1' ( temp 4-component vector of uint) +0:? 'inU1' (layout( location=4) in 4-component vector of uint) +0:105 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:105 Function Call: @ComputeShaderFunction(vf4;vf4;vf4;vu4;vu4; ( temp 4-component vector of float) +0:? 'inF0' ( temp 4-component vector of float) +0:? 'inF1' ( temp 4-component vector of float) +0:? 'inF2' ( temp 4-component vector of float) +0:? 'inU0' ( temp 4-component vector of uint) +0:? 'inU1' ( temp 4-component vector of uint) +0:? Linker Objects +0:? 'gs_ua' ( shared uint) +0:? 'gs_ub' ( shared uint) +0:? 'gs_uc' ( shared uint) +0:? 'gs_ua2' ( shared 2-component vector of uint) +0:? 'gs_ub2' ( shared 2-component vector of uint) +0:? 'gs_uc2' ( shared 2-component vector of uint) +0:? 'gs_ua3' ( shared 3-component vector of uint) +0:? 'gs_ub3' ( shared 3-component vector of uint) +0:? 'gs_uc3' ( shared 3-component vector of uint) +0:? 'gs_ua4' ( shared 4-component vector of uint) +0:? 'gs_ub4' ( shared 4-component vector of uint) +0:? 'gs_uc4' ( shared 4-component vector of uint) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'inF0' (layout( location=0) in 4-component vector of float) +0:? 'inF1' (layout( location=1) in 4-component vector of float) +0:? 'inF2' (layout( location=2) in 4-component vector of float) +0:? 'inU0' (layout( location=3) in 4-component vector of uint) +0:? 'inU1' (layout( location=4) in 4-component vector of uint) + +error: SPIRV-Tools Validation Errors +error: Expected operand to be vector bool: All + %64 = OpAll %bool %63 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 265 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "ComputeShaderFunction" 237 240 243 247 250 253 + ExecutionMode 4 LocalSize 1 1 1 + Source HLSL 500 + Name 4 "ComputeShaderFunction" + Name 16 "ComputeShaderFunctionS(f1;f1;f1;u1;u1;" + Name 11 "inF0" + Name 12 "inF1" + Name 13 "inF2" + Name 14 "inU0" + Name 15 "inU1" + Name 22 "ComputeShaderFunction1(vf1;vf1;vf1;" + Name 19 "inF0" + Name 20 "inF1" + Name 21 "inF2" + Name 34 "ComputeShaderFunction2(vf2;vf2;vf2;vu2;vu2;" + Name 29 "inF0" + Name 30 "inF1" + Name 31 "inF2" + Name 32 "inU0" + Name 33 "inU1" + Name 46 "ComputeShaderFunction3(vf3;vf3;vf3;vu3;vu3;" + Name 41 "inF0" + Name 42 "inF1" + Name 43 "inF2" + Name 44 "inU0" + Name 45 "inU1" + Name 58 "@ComputeShaderFunction(vf4;vf4;vf4;vu4;vu4;" + Name 53 "inF0" + Name 54 "inF1" + Name 55 "inF2" + Name 56 "inU0" + Name 57 "inU1" + Name 66 "gs_ua" + Name 67 "gs_ub" + Name 72 "out_u1" + Name 80 "gs_uc" + Name 111 "gs_ua2" + Name 112 "gs_ub2" + Name 115 "out_u2" + Name 123 "gs_uc2" + Name 155 "gs_ua3" + Name 156 "gs_ub3" + Name 159 "out_u3" + Name 167 "gs_uc3" + Name 198 "gs_ua4" + Name 199 "gs_ub4" + Name 202 "out_u4" + Name 210 "gs_uc4" + Name 235 "inF0" + Name 237 "inF0" + Name 239 "inF1" + Name 240 "inF1" + Name 242 "inF2" + Name 243 "inF2" + Name 245 "inU0" + Name 247 "inU0" + Name 249 "inU1" + Name 250 "inU1" + Name 253 "@entryPointOutput" + Name 254 "param" + Name 256 "param" + Name 258 "param" + Name 260 "param" + Name 262 "param" + Decorate 237(inF0) Location 0 + Decorate 240(inF1) Location 1 + Decorate 243(inF2) Location 2 + Decorate 247(inU0) Location 3 + Decorate 250(inU1) Location 4 + Decorate 253(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeInt 32 0 + 9: TypePointer Function 8(int) + 10: TypeFunction 6(float) 7(ptr) 7(ptr) 7(ptr) 9(ptr) 9(ptr) + 18: TypeFunction 6(float) 7(ptr) 7(ptr) 7(ptr) + 24: TypeVector 6(float) 2 + 25: TypePointer Function 24(fvec2) + 26: TypeVector 8(int) 2 + 27: TypePointer Function 26(ivec2) + 28: TypeFunction 24(fvec2) 25(ptr) 25(ptr) 25(ptr) 27(ptr) 27(ptr) + 36: TypeVector 6(float) 3 + 37: TypePointer Function 36(fvec3) + 38: TypeVector 8(int) 3 + 39: TypePointer Function 38(ivec3) + 40: TypeFunction 36(fvec3) 37(ptr) 37(ptr) 37(ptr) 39(ptr) 39(ptr) + 48: TypeVector 6(float) 4 + 49: TypePointer Function 48(fvec4) + 50: TypeVector 8(int) 4 + 51: TypePointer Function 50(ivec4) + 52: TypeFunction 48(fvec4) 49(ptr) 49(ptr) 49(ptr) 51(ptr) 51(ptr) + 61: TypeBool + 62: 6(float) Constant 0 + 65: TypePointer Workgroup 8(int) + 66(gs_ua): 65(ptr) Variable Workgroup + 67(gs_ub): 65(ptr) Variable Workgroup + 69: 8(int) Constant 1 + 70: 8(int) Constant 0 + 80(gs_uc): 65(ptr) Variable Workgroup + 106: TypeVector 61(bool) 2 + 107: 24(fvec2) ConstantComposite 62 62 + 110: TypePointer Workgroup 26(ivec2) + 111(gs_ua2): 110(ptr) Variable Workgroup + 112(gs_ub2): 110(ptr) Variable Workgroup + 123(gs_uc2): 110(ptr) Variable Workgroup + 144: 6(float) Constant 1065353216 + 145: 6(float) Constant 1073741824 + 146: 24(fvec2) ConstantComposite 144 145 + 150: TypeVector 61(bool) 3 + 151: 36(fvec3) ConstantComposite 62 62 62 + 154: TypePointer Workgroup 38(ivec3) + 155(gs_ua3): 154(ptr) Variable Workgroup + 156(gs_ub3): 154(ptr) Variable Workgroup + 167(gs_uc3): 154(ptr) Variable Workgroup + 188: 6(float) Constant 1077936128 + 189: 36(fvec3) ConstantComposite 144 145 188 + 193: TypeVector 61(bool) 4 + 194: 48(fvec4) ConstantComposite 62 62 62 62 + 197: TypePointer Workgroup 50(ivec4) + 198(gs_ua4): 197(ptr) Variable Workgroup + 199(gs_ub4): 197(ptr) Variable Workgroup + 210(gs_uc4): 197(ptr) Variable Workgroup + 231: 6(float) Constant 1082130432 + 232: 48(fvec4) ConstantComposite 144 145 188 231 + 236: TypePointer Input 48(fvec4) + 237(inF0): 236(ptr) Variable Input + 240(inF1): 236(ptr) Variable Input + 243(inF2): 236(ptr) Variable Input + 246: TypePointer Input 50(ivec4) + 247(inU0): 246(ptr) Variable Input + 250(inU1): 246(ptr) Variable Input + 252: TypePointer Output 48(fvec4) +253(@entryPointOutput): 252(ptr) Variable Output +4(ComputeShaderFunction): 2 Function None 3 + 5: Label + 235(inF0): 49(ptr) Variable Function + 239(inF1): 49(ptr) Variable Function + 242(inF2): 49(ptr) Variable Function + 245(inU0): 51(ptr) Variable Function + 249(inU1): 51(ptr) Variable Function + 254(param): 49(ptr) Variable Function + 256(param): 49(ptr) Variable Function + 258(param): 49(ptr) Variable Function + 260(param): 51(ptr) Variable Function + 262(param): 51(ptr) Variable Function + 238: 48(fvec4) Load 237(inF0) + Store 235(inF0) 238 + 241: 48(fvec4) Load 240(inF1) + Store 239(inF1) 241 + 244: 48(fvec4) Load 243(inF2) + Store 242(inF2) 244 + 248: 50(ivec4) Load 247(inU0) + Store 245(inU0) 248 + 251: 50(ivec4) Load 250(inU1) + Store 249(inU1) 251 + 255: 48(fvec4) Load 235(inF0) + Store 254(param) 255 + 257: 48(fvec4) Load 239(inF1) + Store 256(param) 257 + 259: 48(fvec4) Load 242(inF2) + Store 258(param) 259 + 261: 50(ivec4) Load 245(inU0) + Store 260(param) 261 + 263: 50(ivec4) Load 249(inU1) + Store 262(param) 263 + 264: 48(fvec4) FunctionCall 58(@ComputeShaderFunction(vf4;vf4;vf4;vu4;vu4;) 254(param) 256(param) 258(param) 260(param) 262(param) + Store 253(@entryPointOutput) 264 + Return + FunctionEnd +16(ComputeShaderFunctionS(f1;f1;f1;u1;u1;): 6(float) Function None 10 + 11(inF0): 7(ptr) FunctionParameter + 12(inF1): 7(ptr) FunctionParameter + 13(inF2): 7(ptr) FunctionParameter + 14(inU0): 9(ptr) FunctionParameter + 15(inU1): 9(ptr) FunctionParameter + 17: Label + 72(out_u1): 9(ptr) Variable Function + 60: 6(float) Load 11(inF0) + 63: 61(bool) FOrdNotEqual 60 62 + 64: 61(bool) All 63 + 68: 8(int) Load 67(gs_ub) + 71: 8(int) AtomicIAdd 66(gs_ua) 69 70 68 + 73: 8(int) Load 67(gs_ub) + 74: 8(int) AtomicIAdd 66(gs_ua) 69 70 73 + Store 72(out_u1) 74 + 75: 8(int) Load 67(gs_ub) + 76: 8(int) AtomicAnd 66(gs_ua) 69 70 75 + 77: 8(int) Load 67(gs_ub) + 78: 8(int) AtomicAnd 66(gs_ua) 69 70 77 + Store 72(out_u1) 78 + 79: 8(int) Load 67(gs_ub) + 81: 8(int) Load 80(gs_uc) + 82: 8(int) AtomicCompareExchange 66(gs_ua) 69 70 70 81 79 + Store 72(out_u1) 82 + 83: 8(int) Load 67(gs_ub) + 84: 8(int) AtomicExchange 66(gs_ua) 69 70 83 + Store 72(out_u1) 84 + 85: 8(int) Load 67(gs_ub) + 86: 8(int) AtomicUMax 66(gs_ua) 69 70 85 + 87: 8(int) Load 67(gs_ub) + 88: 8(int) AtomicUMax 66(gs_ua) 69 70 87 + Store 72(out_u1) 88 + 89: 8(int) Load 67(gs_ub) + 90: 8(int) AtomicUMin 66(gs_ua) 69 70 89 + 91: 8(int) Load 67(gs_ub) + 92: 8(int) AtomicUMin 66(gs_ua) 69 70 91 + Store 72(out_u1) 92 + 93: 8(int) Load 67(gs_ub) + 94: 8(int) AtomicOr 66(gs_ua) 69 70 93 + 95: 8(int) Load 67(gs_ub) + 96: 8(int) AtomicOr 66(gs_ua) 69 70 95 + Store 72(out_u1) 96 + 97: 8(int) Load 67(gs_ub) + 98: 8(int) AtomicXor 66(gs_ua) 69 70 97 + 99: 8(int) Load 67(gs_ub) + 100: 8(int) AtomicXor 66(gs_ua) 69 70 99 + Store 72(out_u1) 100 + ReturnValue 62 + FunctionEnd +22(ComputeShaderFunction1(vf1;vf1;vf1;): 6(float) Function None 18 + 19(inF0): 7(ptr) FunctionParameter + 20(inF1): 7(ptr) FunctionParameter + 21(inF2): 7(ptr) FunctionParameter + 23: Label + ReturnValue 62 + FunctionEnd +34(ComputeShaderFunction2(vf2;vf2;vf2;vu2;vu2;): 24(fvec2) Function None 28 + 29(inF0): 25(ptr) FunctionParameter + 30(inF1): 25(ptr) FunctionParameter + 31(inF2): 25(ptr) FunctionParameter + 32(inU0): 27(ptr) FunctionParameter + 33(inU1): 27(ptr) FunctionParameter + 35: Label + 115(out_u2): 27(ptr) Variable Function + 105: 24(fvec2) Load 29(inF0) + 108: 106(bvec2) FOrdNotEqual 105 107 + 109: 61(bool) All 108 + 113: 26(ivec2) Load 112(gs_ub2) + 114: 26(ivec2) AtomicIAdd 111(gs_ua2) 69 70 113 + 116: 26(ivec2) Load 112(gs_ub2) + 117: 26(ivec2) AtomicIAdd 111(gs_ua2) 69 70 116 + Store 115(out_u2) 117 + 118: 26(ivec2) Load 112(gs_ub2) + 119: 26(ivec2) AtomicAnd 111(gs_ua2) 69 70 118 + 120: 26(ivec2) Load 112(gs_ub2) + 121: 26(ivec2) AtomicAnd 111(gs_ua2) 69 70 120 + Store 115(out_u2) 121 + 122: 26(ivec2) Load 112(gs_ub2) + 124: 26(ivec2) Load 123(gs_uc2) + 125: 26(ivec2) AtomicCompareExchange 111(gs_ua2) 69 70 70 124 122 + Store 115(out_u2) 125 + 126: 26(ivec2) Load 112(gs_ub2) + 127: 26(ivec2) AtomicExchange 111(gs_ua2) 69 70 126 + Store 115(out_u2) 127 + 128: 26(ivec2) Load 112(gs_ub2) + 129: 26(ivec2) AtomicUMax 111(gs_ua2) 69 70 128 + 130: 26(ivec2) Load 112(gs_ub2) + 131: 26(ivec2) AtomicUMax 111(gs_ua2) 69 70 130 + Store 115(out_u2) 131 + 132: 26(ivec2) Load 112(gs_ub2) + 133: 26(ivec2) AtomicUMin 111(gs_ua2) 69 70 132 + 134: 26(ivec2) Load 112(gs_ub2) + 135: 26(ivec2) AtomicUMin 111(gs_ua2) 69 70 134 + Store 115(out_u2) 135 + 136: 26(ivec2) Load 112(gs_ub2) + 137: 26(ivec2) AtomicOr 111(gs_ua2) 69 70 136 + 138: 26(ivec2) Load 112(gs_ub2) + 139: 26(ivec2) AtomicOr 111(gs_ua2) 69 70 138 + Store 115(out_u2) 139 + 140: 26(ivec2) Load 112(gs_ub2) + 141: 26(ivec2) AtomicXor 111(gs_ua2) 69 70 140 + 142: 26(ivec2) Load 112(gs_ub2) + 143: 26(ivec2) AtomicXor 111(gs_ua2) 69 70 142 + Store 115(out_u2) 143 + ReturnValue 146 + FunctionEnd +46(ComputeShaderFunction3(vf3;vf3;vf3;vu3;vu3;): 36(fvec3) Function None 40 + 41(inF0): 37(ptr) FunctionParameter + 42(inF1): 37(ptr) FunctionParameter + 43(inF2): 37(ptr) FunctionParameter + 44(inU0): 39(ptr) FunctionParameter + 45(inU1): 39(ptr) FunctionParameter + 47: Label + 159(out_u3): 39(ptr) Variable Function + 149: 36(fvec3) Load 41(inF0) + 152: 150(bvec3) FOrdNotEqual 149 151 + 153: 61(bool) All 152 + 157: 38(ivec3) Load 156(gs_ub3) + 158: 38(ivec3) AtomicIAdd 155(gs_ua3) 69 70 157 + 160: 38(ivec3) Load 156(gs_ub3) + 161: 38(ivec3) AtomicIAdd 155(gs_ua3) 69 70 160 + Store 159(out_u3) 161 + 162: 38(ivec3) Load 156(gs_ub3) + 163: 38(ivec3) AtomicAnd 155(gs_ua3) 69 70 162 + 164: 38(ivec3) Load 156(gs_ub3) + 165: 38(ivec3) AtomicAnd 155(gs_ua3) 69 70 164 + Store 159(out_u3) 165 + 166: 38(ivec3) Load 156(gs_ub3) + 168: 38(ivec3) Load 167(gs_uc3) + 169: 38(ivec3) AtomicCompareExchange 155(gs_ua3) 69 70 70 168 166 + Store 159(out_u3) 169 + 170: 38(ivec3) Load 156(gs_ub3) + 171: 38(ivec3) AtomicExchange 155(gs_ua3) 69 70 170 + Store 159(out_u3) 171 + 172: 38(ivec3) Load 156(gs_ub3) + 173: 38(ivec3) AtomicUMax 155(gs_ua3) 69 70 172 + 174: 38(ivec3) Load 156(gs_ub3) + 175: 38(ivec3) AtomicUMax 155(gs_ua3) 69 70 174 + Store 159(out_u3) 175 + 176: 38(ivec3) Load 156(gs_ub3) + 177: 38(ivec3) AtomicUMin 155(gs_ua3) 69 70 176 + 178: 38(ivec3) Load 156(gs_ub3) + 179: 38(ivec3) AtomicUMin 155(gs_ua3) 69 70 178 + Store 159(out_u3) 179 + 180: 38(ivec3) Load 156(gs_ub3) + 181: 38(ivec3) AtomicOr 155(gs_ua3) 69 70 180 + 182: 38(ivec3) Load 156(gs_ub3) + 183: 38(ivec3) AtomicOr 155(gs_ua3) 69 70 182 + Store 159(out_u3) 183 + 184: 38(ivec3) Load 156(gs_ub3) + 185: 38(ivec3) AtomicXor 155(gs_ua3) 69 70 184 + 186: 38(ivec3) Load 156(gs_ub3) + 187: 38(ivec3) AtomicXor 155(gs_ua3) 69 70 186 + Store 159(out_u3) 187 + ReturnValue 189 + FunctionEnd +58(@ComputeShaderFunction(vf4;vf4;vf4;vu4;vu4;): 48(fvec4) Function None 52 + 53(inF0): 49(ptr) FunctionParameter + 54(inF1): 49(ptr) FunctionParameter + 55(inF2): 49(ptr) FunctionParameter + 56(inU0): 51(ptr) FunctionParameter + 57(inU1): 51(ptr) FunctionParameter + 59: Label + 202(out_u4): 51(ptr) Variable Function + 192: 48(fvec4) Load 53(inF0) + 195: 193(bvec4) FOrdNotEqual 192 194 + 196: 61(bool) All 195 + 200: 50(ivec4) Load 199(gs_ub4) + 201: 50(ivec4) AtomicIAdd 198(gs_ua4) 69 70 200 + 203: 50(ivec4) Load 199(gs_ub4) + 204: 50(ivec4) AtomicIAdd 198(gs_ua4) 69 70 203 + Store 202(out_u4) 204 + 205: 50(ivec4) Load 199(gs_ub4) + 206: 50(ivec4) AtomicAnd 198(gs_ua4) 69 70 205 + 207: 50(ivec4) Load 199(gs_ub4) + 208: 50(ivec4) AtomicAnd 198(gs_ua4) 69 70 207 + Store 202(out_u4) 208 + 209: 50(ivec4) Load 199(gs_ub4) + 211: 50(ivec4) Load 210(gs_uc4) + 212: 50(ivec4) AtomicCompareExchange 198(gs_ua4) 69 70 70 211 209 + Store 202(out_u4) 212 + 213: 50(ivec4) Load 199(gs_ub4) + 214: 50(ivec4) AtomicExchange 198(gs_ua4) 69 70 213 + Store 202(out_u4) 214 + 215: 50(ivec4) Load 199(gs_ub4) + 216: 50(ivec4) AtomicUMax 198(gs_ua4) 69 70 215 + 217: 50(ivec4) Load 199(gs_ub4) + 218: 50(ivec4) AtomicUMax 198(gs_ua4) 69 70 217 + Store 202(out_u4) 218 + 219: 50(ivec4) Load 199(gs_ub4) + 220: 50(ivec4) AtomicUMin 198(gs_ua4) 69 70 219 + 221: 50(ivec4) Load 199(gs_ub4) + 222: 50(ivec4) AtomicUMin 198(gs_ua4) 69 70 221 + Store 202(out_u4) 222 + 223: 50(ivec4) Load 199(gs_ub4) + 224: 50(ivec4) AtomicOr 198(gs_ua4) 69 70 223 + 225: 50(ivec4) Load 199(gs_ub4) + 226: 50(ivec4) AtomicOr 198(gs_ua4) 69 70 225 + Store 202(out_u4) 226 + 227: 50(ivec4) Load 199(gs_ub4) + 228: 50(ivec4) AtomicXor 198(gs_ua4) 69 70 227 + 229: 50(ivec4) Load 199(gs_ub4) + 230: 50(ivec4) AtomicXor 198(gs_ua4) 69 70 229 + Store 202(out_u4) 230 + ReturnValue 232 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.d3dcolortoubyte4.frag.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.d3dcolortoubyte4.frag.out new file mode 100644 index 00000000..970691c5 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.d3dcolortoubyte4.frag.out @@ -0,0 +1,125 @@ +hlsl.intrinsics.d3dcolortoubyte4.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main( ( temp 4-component vector of int) +0:5 Function Parameters: +0:? Sequence +0:6 Branch: Return with expression +0:6 Convert float to int ( temp 4-component vector of int) +0:6 vector-scale ( temp 4-component vector of float) +0:6 Constant: +0:6 255.001953 +0:6 vector swizzle ( temp 4-component vector of float) +0:6 col4: direct index for structure ( uniform 4-component vector of float) +0:6 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float col4}) +0:6 Constant: +0:6 0 (const uint) +0:6 Sequence +0:6 Constant: +0:6 2 (const int) +0:6 Constant: +0:6 1 (const int) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 3 (const int) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of int) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of int) +0:5 Function Call: @main( ( temp 4-component vector of int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float col4}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of int) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main( ( temp 4-component vector of int) +0:5 Function Parameters: +0:? Sequence +0:6 Branch: Return with expression +0:6 Convert float to int ( temp 4-component vector of int) +0:6 vector-scale ( temp 4-component vector of float) +0:6 Constant: +0:6 255.001953 +0:6 vector swizzle ( temp 4-component vector of float) +0:6 col4: direct index for structure ( uniform 4-component vector of float) +0:6 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float col4}) +0:6 Constant: +0:6 0 (const uint) +0:6 Sequence +0:6 Constant: +0:6 2 (const int) +0:6 Constant: +0:6 1 (const int) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 3 (const int) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of int) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of int) +0:5 Function Call: @main( ( temp 4-component vector of int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float col4}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of int) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 29 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 27 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 14 "$Global" + MemberName 14($Global) 0 "col4" + Name 16 "" + Name 27 "@entryPointOutput" + MemberDecorate 14($Global) 0 Offset 0 + Decorate 14($Global) Block + Decorate 16 DescriptorSet 0 + Decorate 27(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeVector 6(int) 4 + 8: TypeFunction 7(ivec4) + 11: TypeFloat 32 + 12: 11(float) Constant 1132396672 + 13: TypeVector 11(float) 4 + 14($Global): TypeStruct 13(fvec4) + 15: TypePointer Uniform 14($Global) + 16: 15(ptr) Variable Uniform + 17: 6(int) Constant 0 + 18: TypePointer Uniform 13(fvec4) + 26: TypePointer Output 7(ivec4) +27(@entryPointOutput): 26(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 28: 7(ivec4) FunctionCall 9(@main() + Store 27(@entryPointOutput) 28 + Return + FunctionEnd + 9(@main(): 7(ivec4) Function None 8 + 10: Label + 19: 18(ptr) AccessChain 16 17 + 20: 13(fvec4) Load 19 + 21: 13(fvec4) VectorShuffle 20 20 2 1 0 3 + 22: 13(fvec4) VectorTimesScalar 21 12 + 23: 7(ivec4) ConvertFToS 22 + ReturnValue 23 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.double.frag.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.double.frag.out new file mode 100644 index 00000000..55a102f5 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.double.frag.out @@ -0,0 +1,339 @@ +hlsl.intrinsics.double.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @PixelShaderFunction(d1;d1;d1;vd2;vd3;vd4;u1;u1; ( temp float) +0:5 Function Parameters: +0:5 'inDV1a' ( in double) +0:5 'inDV1b' ( in double) +0:5 'inDV1c' ( in double) +0:5 'inDV2' ( in 2-component vector of double) +0:5 'inDV3' ( in 3-component vector of double) +0:5 'inDV4' ( in 4-component vector of double) +0:5 'inU1a' ( in uint) +0:5 'inU1b' ( in uint) +0:? Sequence +0:6 Sequence +0:6 move second child to first child ( temp double) +0:6 'r00' ( temp double) +0:6 fma ( temp double) +0:6 'inDV1a' ( in double) +0:6 'inDV1b' ( in double) +0:6 'inDV1c' ( in double) +0:7 Sequence +0:7 move second child to first child ( temp double) +0:7 'r01' ( temp double) +0:7 uint64BitsToDouble ( temp double) +0:7 Construct uvec2 ( temp 2-component vector of uint) +0:7 'inU1a' ( in uint) +0:7 'inU1b' ( in uint) +0:9 Branch: Return with expression +0:9 Constant: +0:9 0.000000 +0:5 Function Definition: PixelShaderFunction( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp double) +0:? 'inDV1a' ( temp double) +0:? 'inDV1a' (layout( location=0) flat in double) +0:5 move second child to first child ( temp double) +0:? 'inDV1b' ( temp double) +0:? 'inDV1b' (layout( location=1) flat in double) +0:5 move second child to first child ( temp double) +0:? 'inDV1c' ( temp double) +0:? 'inDV1c' (layout( location=2) flat in double) +0:5 move second child to first child ( temp 2-component vector of double) +0:? 'inDV2' ( temp 2-component vector of double) +0:? 'inDV2' (layout( location=3) flat in 2-component vector of double) +0:5 move second child to first child ( temp 3-component vector of double) +0:? 'inDV3' ( temp 3-component vector of double) +0:? 'inDV3' (layout( location=4) flat in 3-component vector of double) +0:5 move second child to first child ( temp 4-component vector of double) +0:? 'inDV4' ( temp 4-component vector of double) +0:? 'inDV4' (layout( location=6) flat in 4-component vector of double) +0:5 move second child to first child ( temp uint) +0:? 'inU1a' ( temp uint) +0:? 'inU1a' (layout( location=8) flat in uint) +0:5 move second child to first child ( temp uint) +0:? 'inU1b' ( temp uint) +0:? 'inU1b' (layout( location=9) flat in uint) +0:5 move second child to first child ( temp float) +0:? '@entryPointOutput' (layout( location=0) out float) +0:5 Function Call: @PixelShaderFunction(d1;d1;d1;vd2;vd3;vd4;u1;u1; ( temp float) +0:? 'inDV1a' ( temp double) +0:? 'inDV1b' ( temp double) +0:? 'inDV1c' ( temp double) +0:? 'inDV2' ( temp 2-component vector of double) +0:? 'inDV3' ( temp 3-component vector of double) +0:? 'inDV4' ( temp 4-component vector of double) +0:? 'inU1a' ( temp uint) +0:? 'inU1b' ( temp uint) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out float) +0:? 'inDV1a' (layout( location=0) flat in double) +0:? 'inDV1b' (layout( location=1) flat in double) +0:? 'inDV1c' (layout( location=2) flat in double) +0:? 'inDV2' (layout( location=3) flat in 2-component vector of double) +0:? 'inDV3' (layout( location=4) flat in 3-component vector of double) +0:? 'inDV4' (layout( location=6) flat in 4-component vector of double) +0:? 'inU1a' (layout( location=8) flat in uint) +0:? 'inU1b' (layout( location=9) flat in uint) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @PixelShaderFunction(d1;d1;d1;vd2;vd3;vd4;u1;u1; ( temp float) +0:5 Function Parameters: +0:5 'inDV1a' ( in double) +0:5 'inDV1b' ( in double) +0:5 'inDV1c' ( in double) +0:5 'inDV2' ( in 2-component vector of double) +0:5 'inDV3' ( in 3-component vector of double) +0:5 'inDV4' ( in 4-component vector of double) +0:5 'inU1a' ( in uint) +0:5 'inU1b' ( in uint) +0:? Sequence +0:6 Sequence +0:6 move second child to first child ( temp double) +0:6 'r00' ( temp double) +0:6 fma ( temp double) +0:6 'inDV1a' ( in double) +0:6 'inDV1b' ( in double) +0:6 'inDV1c' ( in double) +0:7 Sequence +0:7 move second child to first child ( temp double) +0:7 'r01' ( temp double) +0:7 uint64BitsToDouble ( temp double) +0:7 Construct uvec2 ( temp 2-component vector of uint) +0:7 'inU1a' ( in uint) +0:7 'inU1b' ( in uint) +0:9 Branch: Return with expression +0:9 Constant: +0:9 0.000000 +0:5 Function Definition: PixelShaderFunction( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp double) +0:? 'inDV1a' ( temp double) +0:? 'inDV1a' (layout( location=0) flat in double) +0:5 move second child to first child ( temp double) +0:? 'inDV1b' ( temp double) +0:? 'inDV1b' (layout( location=1) flat in double) +0:5 move second child to first child ( temp double) +0:? 'inDV1c' ( temp double) +0:? 'inDV1c' (layout( location=2) flat in double) +0:5 move second child to first child ( temp 2-component vector of double) +0:? 'inDV2' ( temp 2-component vector of double) +0:? 'inDV2' (layout( location=3) flat in 2-component vector of double) +0:5 move second child to first child ( temp 3-component vector of double) +0:? 'inDV3' ( temp 3-component vector of double) +0:? 'inDV3' (layout( location=4) flat in 3-component vector of double) +0:5 move second child to first child ( temp 4-component vector of double) +0:? 'inDV4' ( temp 4-component vector of double) +0:? 'inDV4' (layout( location=6) flat in 4-component vector of double) +0:5 move second child to first child ( temp uint) +0:? 'inU1a' ( temp uint) +0:? 'inU1a' (layout( location=8) flat in uint) +0:5 move second child to first child ( temp uint) +0:? 'inU1b' ( temp uint) +0:? 'inU1b' (layout( location=9) flat in uint) +0:5 move second child to first child ( temp float) +0:? '@entryPointOutput' (layout( location=0) out float) +0:5 Function Call: @PixelShaderFunction(d1;d1;d1;vd2;vd3;vd4;u1;u1; ( temp float) +0:? 'inDV1a' ( temp double) +0:? 'inDV1b' ( temp double) +0:? 'inDV1c' ( temp double) +0:? 'inDV2' ( temp 2-component vector of double) +0:? 'inDV3' ( temp 3-component vector of double) +0:? 'inDV4' ( temp 4-component vector of double) +0:? 'inU1a' ( temp uint) +0:? 'inU1b' ( temp uint) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out float) +0:? 'inDV1a' (layout( location=0) flat in double) +0:? 'inDV1b' (layout( location=1) flat in double) +0:? 'inDV1c' (layout( location=2) flat in double) +0:? 'inDV2' (layout( location=3) flat in 2-component vector of double) +0:? 'inDV3' (layout( location=4) flat in 3-component vector of double) +0:? 'inDV4' (layout( location=6) flat in 4-component vector of double) +0:? 'inU1a' (layout( location=8) flat in uint) +0:? 'inU1b' (layout( location=9) flat in uint) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 90 + + Capability Shader + Capability Float64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 44 47 50 54 58 62 66 69 72 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 26 "@PixelShaderFunction(d1;d1;d1;vd2;vd3;vd4;u1;u1;" + Name 18 "inDV1a" + Name 19 "inDV1b" + Name 20 "inDV1c" + Name 21 "inDV2" + Name 22 "inDV3" + Name 23 "inDV4" + Name 24 "inU1a" + Name 25 "inU1b" + Name 28 "r00" + Name 33 "r01" + Name 42 "inDV1a" + Name 44 "inDV1a" + Name 46 "inDV1b" + Name 47 "inDV1b" + Name 49 "inDV1c" + Name 50 "inDV1c" + Name 52 "inDV2" + Name 54 "inDV2" + Name 56 "inDV3" + Name 58 "inDV3" + Name 60 "inDV4" + Name 62 "inDV4" + Name 64 "inU1a" + Name 66 "inU1a" + Name 68 "inU1b" + Name 69 "inU1b" + Name 72 "@entryPointOutput" + Name 73 "param" + Name 75 "param" + Name 77 "param" + Name 79 "param" + Name 81 "param" + Name 83 "param" + Name 85 "param" + Name 87 "param" + Decorate 44(inDV1a) Flat + Decorate 44(inDV1a) Location 0 + Decorate 47(inDV1b) Flat + Decorate 47(inDV1b) Location 1 + Decorate 50(inDV1c) Flat + Decorate 50(inDV1c) Location 2 + Decorate 54(inDV2) Flat + Decorate 54(inDV2) Location 3 + Decorate 58(inDV3) Flat + Decorate 58(inDV3) Location 4 + Decorate 62(inDV4) Flat + Decorate 62(inDV4) Location 6 + Decorate 66(inU1a) Flat + Decorate 66(inU1a) Location 8 + Decorate 69(inU1b) Flat + Decorate 69(inU1b) Location 9 + Decorate 72(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 64 + 7: TypePointer Function 6(float64_t) + 8: TypeVector 6(float64_t) 2 + 9: TypePointer Function 8(f64vec2) + 10: TypeVector 6(float64_t) 3 + 11: TypePointer Function 10(f64vec3) + 12: TypeVector 6(float64_t) 4 + 13: TypePointer Function 12(f64vec4) + 14: TypeInt 32 0 + 15: TypePointer Function 14(int) + 16: TypeFloat 32 + 17: TypeFunction 16(float) 7(ptr) 7(ptr) 7(ptr) 9(ptr) 11(ptr) 13(ptr) 15(ptr) 15(ptr) + 36: TypeVector 14(int) 2 + 39: 16(float) Constant 0 + 43: TypePointer Input 6(float64_t) + 44(inDV1a): 43(ptr) Variable Input + 47(inDV1b): 43(ptr) Variable Input + 50(inDV1c): 43(ptr) Variable Input + 53: TypePointer Input 8(f64vec2) + 54(inDV2): 53(ptr) Variable Input + 57: TypePointer Input 10(f64vec3) + 58(inDV3): 57(ptr) Variable Input + 61: TypePointer Input 12(f64vec4) + 62(inDV4): 61(ptr) Variable Input + 65: TypePointer Input 14(int) + 66(inU1a): 65(ptr) Variable Input + 69(inU1b): 65(ptr) Variable Input + 71: TypePointer Output 16(float) +72(@entryPointOutput): 71(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 42(inDV1a): 7(ptr) Variable Function + 46(inDV1b): 7(ptr) Variable Function + 49(inDV1c): 7(ptr) Variable Function + 52(inDV2): 9(ptr) Variable Function + 56(inDV3): 11(ptr) Variable Function + 60(inDV4): 13(ptr) Variable Function + 64(inU1a): 15(ptr) Variable Function + 68(inU1b): 15(ptr) Variable Function + 73(param): 7(ptr) Variable Function + 75(param): 7(ptr) Variable Function + 77(param): 7(ptr) Variable Function + 79(param): 9(ptr) Variable Function + 81(param): 11(ptr) Variable Function + 83(param): 13(ptr) Variable Function + 85(param): 15(ptr) Variable Function + 87(param): 15(ptr) Variable Function + 45:6(float64_t) Load 44(inDV1a) + Store 42(inDV1a) 45 + 48:6(float64_t) Load 47(inDV1b) + Store 46(inDV1b) 48 + 51:6(float64_t) Load 50(inDV1c) + Store 49(inDV1c) 51 + 55: 8(f64vec2) Load 54(inDV2) + Store 52(inDV2) 55 + 59: 10(f64vec3) Load 58(inDV3) + Store 56(inDV3) 59 + 63: 12(f64vec4) Load 62(inDV4) + Store 60(inDV4) 63 + 67: 14(int) Load 66(inU1a) + Store 64(inU1a) 67 + 70: 14(int) Load 69(inU1b) + Store 68(inU1b) 70 + 74:6(float64_t) Load 42(inDV1a) + Store 73(param) 74 + 76:6(float64_t) Load 46(inDV1b) + Store 75(param) 76 + 78:6(float64_t) Load 49(inDV1c) + Store 77(param) 78 + 80: 8(f64vec2) Load 52(inDV2) + Store 79(param) 80 + 82: 10(f64vec3) Load 56(inDV3) + Store 81(param) 82 + 84: 12(f64vec4) Load 60(inDV4) + Store 83(param) 84 + 86: 14(int) Load 64(inU1a) + Store 85(param) 86 + 88: 14(int) Load 68(inU1b) + Store 87(param) 88 + 89: 16(float) FunctionCall 26(@PixelShaderFunction(d1;d1;d1;vd2;vd3;vd4;u1;u1;) 73(param) 75(param) 77(param) 79(param) 81(param) 83(param) 85(param) 87(param) + Store 72(@entryPointOutput) 89 + Return + FunctionEnd +26(@PixelShaderFunction(d1;d1;d1;vd2;vd3;vd4;u1;u1;): 16(float) Function None 17 + 18(inDV1a): 7(ptr) FunctionParameter + 19(inDV1b): 7(ptr) FunctionParameter + 20(inDV1c): 7(ptr) FunctionParameter + 21(inDV2): 9(ptr) FunctionParameter + 22(inDV3): 11(ptr) FunctionParameter + 23(inDV4): 13(ptr) FunctionParameter + 24(inU1a): 15(ptr) FunctionParameter + 25(inU1b): 15(ptr) FunctionParameter + 27: Label + 28(r00): 7(ptr) Variable Function + 33(r01): 7(ptr) Variable Function + 29:6(float64_t) Load 18(inDV1a) + 30:6(float64_t) Load 19(inDV1b) + 31:6(float64_t) Load 20(inDV1c) + 32:6(float64_t) ExtInst 1(GLSL.std.450) 50(Fma) 29 30 31 + Store 28(r00) 32 + 34: 14(int) Load 24(inU1a) + 35: 14(int) Load 25(inU1b) + 37: 36(ivec2) CompositeConstruct 34 35 + 38:6(float64_t) Bitcast 37 + Store 33(r01) 38 + ReturnValue 39 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.evalfns.frag.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.evalfns.frag.out new file mode 100644 index 00000000..4fd1e7b3 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.evalfns.frag.out @@ -0,0 +1,290 @@ +hlsl.intrinsics.evalfns.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: @main(f1;vf2;vf3;vf4;vi2; ( temp void) +0:3 Function Parameters: +0:3 'inF1' ( in float) +0:3 'inF2' ( in 2-component vector of float) +0:3 'inF3' ( in 3-component vector of float) +0:3 'inF4' ( in 4-component vector of float) +0:3 'inI2' ( in 2-component vector of int) +0:? Sequence +0:4 interpolateAtOffset ( temp float) +0:4 'inF1' ( in float) +0:? Constant: +0:? -0.500000 +0:? -0.062500 +0:5 interpolateAtOffset ( temp 2-component vector of float) +0:5 'inF2' ( in 2-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.062500 +0:6 interpolateAtOffset ( temp 3-component vector of float) +0:6 'inF3' ( in 3-component vector of float) +0:? Constant: +0:? 0.187500 +0:? -0.375000 +0:7 interpolateAtOffset ( temp 4-component vector of float) +0:7 'inF4' ( in 4-component vector of float) +0:? Constant: +0:? 0.437500 +0:? -0.500000 +0:9 interpolateAtOffset ( temp float) +0:9 'inF1' ( in float) +0:9 vector-scale ( temp 2-component vector of float) +0:9 Convert int to float ( temp 2-component vector of float) +0:9 right-shift ( temp 2-component vector of int) +0:9 left-shift ( temp 2-component vector of int) +0:9 'inI2' ( in 2-component vector of int) +0:9 Constant: +0:9 28 (const int) +0:9 Constant: +0:9 28 (const int) +0:9 Constant: +0:9 0.062500 +0:3 Function Definition: main( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:3 move second child to first child ( temp float) +0:? 'inF1' ( temp float) +0:? 'inF1' (layout( location=0) in float) +0:3 move second child to first child ( temp 2-component vector of float) +0:? 'inF2' ( temp 2-component vector of float) +0:? 'inF2' (layout( location=1) in 2-component vector of float) +0:3 move second child to first child ( temp 3-component vector of float) +0:? 'inF3' ( temp 3-component vector of float) +0:? 'inF3' (layout( location=2) in 3-component vector of float) +0:3 move second child to first child ( temp 4-component vector of float) +0:? 'inF4' ( temp 4-component vector of float) +0:? 'inF4' (layout( location=3) in 4-component vector of float) +0:3 move second child to first child ( temp 2-component vector of int) +0:? 'inI2' ( temp 2-component vector of int) +0:? 'inI2' (layout( location=4) flat in 2-component vector of int) +0:3 Function Call: @main(f1;vf2;vf3;vf4;vi2; ( temp void) +0:? 'inF1' ( temp float) +0:? 'inF2' ( temp 2-component vector of float) +0:? 'inF3' ( temp 3-component vector of float) +0:? 'inF4' ( temp 4-component vector of float) +0:? 'inI2' ( temp 2-component vector of int) +0:? Linker Objects +0:? 'inF1' (layout( location=0) in float) +0:? 'inF2' (layout( location=1) in 2-component vector of float) +0:? 'inF3' (layout( location=2) in 3-component vector of float) +0:? 'inF4' (layout( location=3) in 4-component vector of float) +0:? 'inI2' (layout( location=4) flat in 2-component vector of int) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: @main(f1;vf2;vf3;vf4;vi2; ( temp void) +0:3 Function Parameters: +0:3 'inF1' ( in float) +0:3 'inF2' ( in 2-component vector of float) +0:3 'inF3' ( in 3-component vector of float) +0:3 'inF4' ( in 4-component vector of float) +0:3 'inI2' ( in 2-component vector of int) +0:? Sequence +0:4 interpolateAtOffset ( temp float) +0:4 'inF1' ( in float) +0:? Constant: +0:? -0.500000 +0:? -0.062500 +0:5 interpolateAtOffset ( temp 2-component vector of float) +0:5 'inF2' ( in 2-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.062500 +0:6 interpolateAtOffset ( temp 3-component vector of float) +0:6 'inF3' ( in 3-component vector of float) +0:? Constant: +0:? 0.187500 +0:? -0.375000 +0:7 interpolateAtOffset ( temp 4-component vector of float) +0:7 'inF4' ( in 4-component vector of float) +0:? Constant: +0:? 0.437500 +0:? -0.500000 +0:9 interpolateAtOffset ( temp float) +0:9 'inF1' ( in float) +0:9 vector-scale ( temp 2-component vector of float) +0:9 Convert int to float ( temp 2-component vector of float) +0:9 right-shift ( temp 2-component vector of int) +0:9 left-shift ( temp 2-component vector of int) +0:9 'inI2' ( in 2-component vector of int) +0:9 Constant: +0:9 28 (const int) +0:9 Constant: +0:9 28 (const int) +0:9 Constant: +0:9 0.062500 +0:3 Function Definition: main( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:3 move second child to first child ( temp float) +0:? 'inF1' ( temp float) +0:? 'inF1' (layout( location=0) in float) +0:3 move second child to first child ( temp 2-component vector of float) +0:? 'inF2' ( temp 2-component vector of float) +0:? 'inF2' (layout( location=1) in 2-component vector of float) +0:3 move second child to first child ( temp 3-component vector of float) +0:? 'inF3' ( temp 3-component vector of float) +0:? 'inF3' (layout( location=2) in 3-component vector of float) +0:3 move second child to first child ( temp 4-component vector of float) +0:? 'inF4' ( temp 4-component vector of float) +0:? 'inF4' (layout( location=3) in 4-component vector of float) +0:3 move second child to first child ( temp 2-component vector of int) +0:? 'inI2' ( temp 2-component vector of int) +0:? 'inI2' (layout( location=4) flat in 2-component vector of int) +0:3 Function Call: @main(f1;vf2;vf3;vf4;vi2; ( temp void) +0:? 'inF1' ( temp float) +0:? 'inF2' ( temp 2-component vector of float) +0:? 'inF3' ( temp 3-component vector of float) +0:? 'inF4' ( temp 4-component vector of float) +0:? 'inI2' ( temp 2-component vector of int) +0:? Linker Objects +0:? 'inF1' (layout( location=0) in float) +0:? 'inF2' (layout( location=1) in 2-component vector of float) +0:? 'inF3' (layout( location=2) in 3-component vector of float) +0:? 'inF4' (layout( location=3) in 4-component vector of float) +0:? 'inI2' (layout( location=4) flat in 2-component vector of int) + +error: SPIRV-Tools Validation Errors +error: GLSL.std.450 InterpolateAtOffset: expected Interpolant storage class to be Input + %28 = OpExtInst %float %1 InterpolateAtOffset %inF1 %27 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 80 + + Capability Shader + Capability InterpolationFunction + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 51 55 59 63 67 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 23 "@main(f1;vf2;vf3;vf4;vi2;" + Name 18 "inF1" + Name 19 "inF2" + Name 20 "inF3" + Name 21 "inF4" + Name 22 "inI2" + Name 49 "inF1" + Name 51 "inF1" + Name 53 "inF2" + Name 55 "inF2" + Name 57 "inF3" + Name 59 "inF3" + Name 61 "inF4" + Name 63 "inF4" + Name 65 "inI2" + Name 67 "inI2" + Name 69 "param" + Name 71 "param" + Name 73 "param" + Name 75 "param" + Name 77 "param" + Decorate 51(inF1) Location 0 + Decorate 55(inF2) Location 1 + Decorate 59(inF3) Location 2 + Decorate 63(inF4) Location 3 + Decorate 67(inI2) Flat + Decorate 67(inI2) Location 4 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeVector 6(float) 2 + 9: TypePointer Function 8(fvec2) + 10: TypeVector 6(float) 3 + 11: TypePointer Function 10(fvec3) + 12: TypeVector 6(float) 4 + 13: TypePointer Function 12(fvec4) + 14: TypeInt 32 1 + 15: TypeVector 14(int) 2 + 16: TypePointer Function 15(ivec2) + 17: TypeFunction 2 7(ptr) 9(ptr) 11(ptr) 13(ptr) 16(ptr) + 25: 6(float) Constant 3204448256 + 26: 6(float) Constant 3179282432 + 27: 8(fvec2) ConstantComposite 25 26 + 29: 6(float) Constant 0 + 30: 6(float) Constant 1031798784 + 31: 8(fvec2) ConstantComposite 29 30 + 33: 6(float) Constant 1044381696 + 34: 6(float) Constant 3200253952 + 35: 8(fvec2) ConstantComposite 33 34 + 37: 6(float) Constant 1054867456 + 38: 8(fvec2) ConstantComposite 37 25 + 41: 14(int) Constant 28 + 50: TypePointer Input 6(float) + 51(inF1): 50(ptr) Variable Input + 54: TypePointer Input 8(fvec2) + 55(inF2): 54(ptr) Variable Input + 58: TypePointer Input 10(fvec3) + 59(inF3): 58(ptr) Variable Input + 62: TypePointer Input 12(fvec4) + 63(inF4): 62(ptr) Variable Input + 66: TypePointer Input 15(ivec2) + 67(inI2): 66(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 49(inF1): 7(ptr) Variable Function + 53(inF2): 9(ptr) Variable Function + 57(inF3): 11(ptr) Variable Function + 61(inF4): 13(ptr) Variable Function + 65(inI2): 16(ptr) Variable Function + 69(param): 7(ptr) Variable Function + 71(param): 9(ptr) Variable Function + 73(param): 11(ptr) Variable Function + 75(param): 13(ptr) Variable Function + 77(param): 16(ptr) Variable Function + 52: 6(float) Load 51(inF1) + Store 49(inF1) 52 + 56: 8(fvec2) Load 55(inF2) + Store 53(inF2) 56 + 60: 10(fvec3) Load 59(inF3) + Store 57(inF3) 60 + 64: 12(fvec4) Load 63(inF4) + Store 61(inF4) 64 + 68: 15(ivec2) Load 67(inI2) + Store 65(inI2) 68 + 70: 6(float) Load 49(inF1) + Store 69(param) 70 + 72: 8(fvec2) Load 53(inF2) + Store 71(param) 72 + 74: 10(fvec3) Load 57(inF3) + Store 73(param) 74 + 76: 12(fvec4) Load 61(inF4) + Store 75(param) 76 + 78: 15(ivec2) Load 65(inI2) + Store 77(param) 78 + 79: 2 FunctionCall 23(@main(f1;vf2;vf3;vf4;vi2;) 69(param) 71(param) 73(param) 75(param) 77(param) + Return + FunctionEnd +23(@main(f1;vf2;vf3;vf4;vi2;): 2 Function None 17 + 18(inF1): 7(ptr) FunctionParameter + 19(inF2): 9(ptr) FunctionParameter + 20(inF3): 11(ptr) FunctionParameter + 21(inF4): 13(ptr) FunctionParameter + 22(inI2): 16(ptr) FunctionParameter + 24: Label + 28: 6(float) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 18(inF1) 27 + 32: 8(fvec2) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 19(inF2) 31 + 36: 10(fvec3) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 20(inF3) 35 + 39: 12(fvec4) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 21(inF4) 38 + 40: 15(ivec2) Load 22(inI2) + 42: 15(ivec2) CompositeConstruct 41 41 + 43: 15(ivec2) ShiftLeftLogical 40 42 + 44: 15(ivec2) CompositeConstruct 41 41 + 45: 15(ivec2) ShiftRightArithmetic 43 44 + 46: 8(fvec2) ConvertSToF 45 + 47: 8(fvec2) VectorTimesScalar 46 30 + 48: 6(float) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 18(inF1) 47 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.f1632.frag.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.f1632.frag.out new file mode 100644 index 00000000..c5619efa --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.f1632.frag.out @@ -0,0 +1,389 @@ +hlsl.intrinsics.f1632.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: PixelShaderFunctionS(u1; ( temp float) +0:2 Function Parameters: +0:2 'inF0' ( in uint) +0:? Sequence +0:3 Branch: Return with expression +0:3 direct index ( temp float) +0:3 unpackHalf2x16 ( temp 2-component vector of float) +0:3 'inF0' ( in uint) +0:3 Constant: +0:3 0 (const int) +0:7 Function Definition: PixelShaderFunction1(vu1; ( temp 1-component vector of float) +0:7 Function Parameters: +0:7 'inF0' ( in 1-component vector of uint) +0:? Sequence +0:8 Branch: Return with expression +0:8 Constant: +0:8 0.000000 +0:12 Function Definition: PixelShaderFunction2(vu2; ( temp 2-component vector of float) +0:12 Function Parameters: +0:12 'inF0' ( in 2-component vector of uint) +0:? Sequence +0:13 Branch: Return with expression +0:13 Construct vec2 ( temp 2-component vector of float) +0:13 direct index ( temp float) +0:13 unpackHalf2x16 ( temp 2-component vector of float) +0:13 direct index ( temp uint) +0:13 'inF0' ( in 2-component vector of uint) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 direct index ( temp float) +0:13 unpackHalf2x16 ( temp 2-component vector of float) +0:13 direct index ( temp uint) +0:13 'inF0' ( in 2-component vector of uint) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:17 Function Definition: PixelShaderFunction3(vu3; ( temp 3-component vector of float) +0:17 Function Parameters: +0:17 'inF0' ( in 3-component vector of uint) +0:? Sequence +0:18 Branch: Return with expression +0:18 Construct vec3 ( temp 3-component vector of float) +0:18 direct index ( temp float) +0:18 unpackHalf2x16 ( temp 2-component vector of float) +0:18 direct index ( temp uint) +0:18 'inF0' ( in 3-component vector of uint) +0:18 Constant: +0:18 0 (const int) +0:18 Constant: +0:18 0 (const int) +0:18 direct index ( temp float) +0:18 unpackHalf2x16 ( temp 2-component vector of float) +0:18 direct index ( temp uint) +0:18 'inF0' ( in 3-component vector of uint) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 0 (const int) +0:18 direct index ( temp float) +0:18 unpackHalf2x16 ( temp 2-component vector of float) +0:18 direct index ( temp uint) +0:18 'inF0' ( in 3-component vector of uint) +0:18 Constant: +0:18 2 (const int) +0:18 Constant: +0:18 0 (const int) +0:22 Function Definition: PixelShaderFunction(vu4; ( temp 4-component vector of float) +0:22 Function Parameters: +0:22 'inF0' ( in 4-component vector of uint) +0:? Sequence +0:23 Branch: Return with expression +0:23 Construct vec4 ( temp 4-component vector of float) +0:23 direct index ( temp float) +0:23 unpackHalf2x16 ( temp 2-component vector of float) +0:23 direct index ( temp uint) +0:23 'inF0' ( in 4-component vector of uint) +0:23 Constant: +0:23 0 (const int) +0:23 Constant: +0:23 0 (const int) +0:23 direct index ( temp float) +0:23 unpackHalf2x16 ( temp 2-component vector of float) +0:23 direct index ( temp uint) +0:23 'inF0' ( in 4-component vector of uint) +0:23 Constant: +0:23 1 (const int) +0:23 Constant: +0:23 0 (const int) +0:23 direct index ( temp float) +0:23 unpackHalf2x16 ( temp 2-component vector of float) +0:23 direct index ( temp uint) +0:23 'inF0' ( in 4-component vector of uint) +0:23 Constant: +0:23 2 (const int) +0:23 Constant: +0:23 0 (const int) +0:23 direct index ( temp float) +0:23 unpackHalf2x16 ( temp 2-component vector of float) +0:23 direct index ( temp uint) +0:23 'inF0' ( in 4-component vector of uint) +0:23 Constant: +0:23 3 (const int) +0:23 Constant: +0:23 0 (const int) +0:27 Function Definition: @main( ( temp 4-component vector of float) +0:27 Function Parameters: +0:? Sequence +0:28 Branch: Return with expression +0:28 Constant: +0:28 0.000000 +0:28 0.000000 +0:28 0.000000 +0:28 0.000000 +0:27 Function Definition: main( ( temp void) +0:27 Function Parameters: +0:? Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:27 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: PixelShaderFunctionS(u1; ( temp float) +0:2 Function Parameters: +0:2 'inF0' ( in uint) +0:? Sequence +0:3 Branch: Return with expression +0:3 direct index ( temp float) +0:3 unpackHalf2x16 ( temp 2-component vector of float) +0:3 'inF0' ( in uint) +0:3 Constant: +0:3 0 (const int) +0:7 Function Definition: PixelShaderFunction1(vu1; ( temp 1-component vector of float) +0:7 Function Parameters: +0:7 'inF0' ( in 1-component vector of uint) +0:? Sequence +0:8 Branch: Return with expression +0:8 Constant: +0:8 0.000000 +0:12 Function Definition: PixelShaderFunction2(vu2; ( temp 2-component vector of float) +0:12 Function Parameters: +0:12 'inF0' ( in 2-component vector of uint) +0:? Sequence +0:13 Branch: Return with expression +0:13 Construct vec2 ( temp 2-component vector of float) +0:13 direct index ( temp float) +0:13 unpackHalf2x16 ( temp 2-component vector of float) +0:13 direct index ( temp uint) +0:13 'inF0' ( in 2-component vector of uint) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 direct index ( temp float) +0:13 unpackHalf2x16 ( temp 2-component vector of float) +0:13 direct index ( temp uint) +0:13 'inF0' ( in 2-component vector of uint) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:17 Function Definition: PixelShaderFunction3(vu3; ( temp 3-component vector of float) +0:17 Function Parameters: +0:17 'inF0' ( in 3-component vector of uint) +0:? Sequence +0:18 Branch: Return with expression +0:18 Construct vec3 ( temp 3-component vector of float) +0:18 direct index ( temp float) +0:18 unpackHalf2x16 ( temp 2-component vector of float) +0:18 direct index ( temp uint) +0:18 'inF0' ( in 3-component vector of uint) +0:18 Constant: +0:18 0 (const int) +0:18 Constant: +0:18 0 (const int) +0:18 direct index ( temp float) +0:18 unpackHalf2x16 ( temp 2-component vector of float) +0:18 direct index ( temp uint) +0:18 'inF0' ( in 3-component vector of uint) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 0 (const int) +0:18 direct index ( temp float) +0:18 unpackHalf2x16 ( temp 2-component vector of float) +0:18 direct index ( temp uint) +0:18 'inF0' ( in 3-component vector of uint) +0:18 Constant: +0:18 2 (const int) +0:18 Constant: +0:18 0 (const int) +0:22 Function Definition: PixelShaderFunction(vu4; ( temp 4-component vector of float) +0:22 Function Parameters: +0:22 'inF0' ( in 4-component vector of uint) +0:? Sequence +0:23 Branch: Return with expression +0:23 Construct vec4 ( temp 4-component vector of float) +0:23 direct index ( temp float) +0:23 unpackHalf2x16 ( temp 2-component vector of float) +0:23 direct index ( temp uint) +0:23 'inF0' ( in 4-component vector of uint) +0:23 Constant: +0:23 0 (const int) +0:23 Constant: +0:23 0 (const int) +0:23 direct index ( temp float) +0:23 unpackHalf2x16 ( temp 2-component vector of float) +0:23 direct index ( temp uint) +0:23 'inF0' ( in 4-component vector of uint) +0:23 Constant: +0:23 1 (const int) +0:23 Constant: +0:23 0 (const int) +0:23 direct index ( temp float) +0:23 unpackHalf2x16 ( temp 2-component vector of float) +0:23 direct index ( temp uint) +0:23 'inF0' ( in 4-component vector of uint) +0:23 Constant: +0:23 2 (const int) +0:23 Constant: +0:23 0 (const int) +0:23 direct index ( temp float) +0:23 unpackHalf2x16 ( temp 2-component vector of float) +0:23 direct index ( temp uint) +0:23 'inF0' ( in 4-component vector of uint) +0:23 Constant: +0:23 3 (const int) +0:23 Constant: +0:23 0 (const int) +0:27 Function Definition: @main( ( temp 4-component vector of float) +0:27 Function Parameters: +0:? Sequence +0:28 Branch: Return with expression +0:28 Constant: +0:28 0.000000 +0:28 0.000000 +0:28 0.000000 +0:28 0.000000 +0:27 Function Definition: main( ( temp void) +0:27 Function Parameters: +0:? Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:27 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 103 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 101 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "PixelShaderFunctionS(u1;" + Name 10 "inF0" + Name 14 "PixelShaderFunction1(vu1;" + Name 13 "inF0" + Name 21 "PixelShaderFunction2(vu2;" + Name 20 "inF0" + Name 28 "PixelShaderFunction3(vu3;" + Name 27 "inF0" + Name 35 "PixelShaderFunction(vu4;" + Name 34 "inF0" + Name 38 "@main(" + Name 101 "@entryPointOutput" + Decorate 101(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeFunction 8(float) 7(ptr) + 16: TypeVector 6(int) 2 + 17: TypePointer Function 16(ivec2) + 18: TypeVector 8(float) 2 + 19: TypeFunction 18(fvec2) 17(ptr) + 23: TypeVector 6(int) 3 + 24: TypePointer Function 23(ivec3) + 25: TypeVector 8(float) 3 + 26: TypeFunction 25(fvec3) 24(ptr) + 30: TypeVector 6(int) 4 + 31: TypePointer Function 30(ivec4) + 32: TypeVector 8(float) 4 + 33: TypeFunction 32(fvec4) 31(ptr) + 37: TypeFunction 32(fvec4) + 42: 6(int) Constant 0 + 46: 8(float) Constant 0 + 53: 6(int) Constant 1 + 69: 6(int) Constant 2 + 89: 6(int) Constant 3 + 97: 32(fvec4) ConstantComposite 46 46 46 46 + 100: TypePointer Output 32(fvec4) +101(@entryPointOutput): 100(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 102: 32(fvec4) FunctionCall 38(@main() + Store 101(@entryPointOutput) 102 + Return + FunctionEnd +11(PixelShaderFunctionS(u1;): 8(float) Function None 9 + 10(inF0): 7(ptr) FunctionParameter + 12: Label + 40: 6(int) Load 10(inF0) + 41: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 40 + 43: 8(float) CompositeExtract 41 0 + ReturnValue 43 + FunctionEnd +14(PixelShaderFunction1(vu1;): 8(float) Function None 9 + 13(inF0): 7(ptr) FunctionParameter + 15: Label + ReturnValue 46 + FunctionEnd +21(PixelShaderFunction2(vu2;): 18(fvec2) Function None 19 + 20(inF0): 17(ptr) FunctionParameter + 22: Label + 49: 7(ptr) AccessChain 20(inF0) 42 + 50: 6(int) Load 49 + 51: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 50 + 52: 8(float) CompositeExtract 51 0 + 54: 7(ptr) AccessChain 20(inF0) 53 + 55: 6(int) Load 54 + 56: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 55 + 57: 8(float) CompositeExtract 56 0 + 58: 18(fvec2) CompositeConstruct 52 57 + ReturnValue 58 + FunctionEnd +28(PixelShaderFunction3(vu3;): 25(fvec3) Function None 26 + 27(inF0): 24(ptr) FunctionParameter + 29: Label + 61: 7(ptr) AccessChain 27(inF0) 42 + 62: 6(int) Load 61 + 63: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 62 + 64: 8(float) CompositeExtract 63 0 + 65: 7(ptr) AccessChain 27(inF0) 53 + 66: 6(int) Load 65 + 67: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 66 + 68: 8(float) CompositeExtract 67 0 + 70: 7(ptr) AccessChain 27(inF0) 69 + 71: 6(int) Load 70 + 72: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 71 + 73: 8(float) CompositeExtract 72 0 + 74: 25(fvec3) CompositeConstruct 64 68 73 + ReturnValue 74 + FunctionEnd +35(PixelShaderFunction(vu4;): 32(fvec4) Function None 33 + 34(inF0): 31(ptr) FunctionParameter + 36: Label + 77: 7(ptr) AccessChain 34(inF0) 42 + 78: 6(int) Load 77 + 79: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 78 + 80: 8(float) CompositeExtract 79 0 + 81: 7(ptr) AccessChain 34(inF0) 53 + 82: 6(int) Load 81 + 83: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 82 + 84: 8(float) CompositeExtract 83 0 + 85: 7(ptr) AccessChain 34(inF0) 69 + 86: 6(int) Load 85 + 87: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 86 + 88: 8(float) CompositeExtract 87 0 + 90: 7(ptr) AccessChain 34(inF0) 89 + 91: 6(int) Load 90 + 92: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 91 + 93: 8(float) CompositeExtract 92 0 + 94: 32(fvec4) CompositeConstruct 80 84 88 93 + ReturnValue 94 + FunctionEnd + 38(@main(): 32(fvec4) Function None 37 + 39: Label + ReturnValue 97 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.f3216.frag.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.f3216.frag.out new file mode 100644 index 00000000..c447efc4 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.f3216.frag.out @@ -0,0 +1,402 @@ +hlsl.intrinsics.f3216.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: PixelShaderFunctionS(f1; ( temp uint) +0:2 Function Parameters: +0:2 'inF0' ( in float) +0:? Sequence +0:3 Branch: Return with expression +0:3 packHalf2x16 ( temp uint) +0:3 Construct vec2 ( temp 2-component vector of float) +0:3 'inF0' ( in float) +0:3 Constant: +0:3 0.000000 +0:7 Function Definition: PixelShaderFunction1(vf1; ( temp 1-component vector of uint) +0:7 Function Parameters: +0:7 'inF0' ( in 1-component vector of float) +0:? Sequence +0:8 Branch: Return with expression +0:8 Construct uint ( temp 1-component vector of uint) +0:8 packHalf2x16 ( temp uint) +0:8 Construct vec2 ( temp 2-component vector of float) +0:8 Construct float ( in float) +0:8 'inF0' ( in 1-component vector of float) +0:8 Constant: +0:8 0.000000 +0:12 Function Definition: PixelShaderFunction2(vf2; ( temp 2-component vector of uint) +0:12 Function Parameters: +0:12 'inF0' ( in 2-component vector of float) +0:? Sequence +0:13 Branch: Return with expression +0:13 Construct uvec2 ( temp 2-component vector of uint) +0:13 packHalf2x16 ( temp uint) +0:13 Construct vec2 ( temp 2-component vector of float) +0:13 direct index ( temp float) +0:13 'inF0' ( in 2-component vector of float) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0.000000 +0:13 packHalf2x16 ( temp uint) +0:13 Construct vec2 ( temp 2-component vector of float) +0:13 direct index ( temp float) +0:13 'inF0' ( in 2-component vector of float) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0.000000 +0:17 Function Definition: PixelShaderFunction3(vf3; ( temp 3-component vector of uint) +0:17 Function Parameters: +0:17 'inF0' ( in 3-component vector of float) +0:? Sequence +0:18 Branch: Return with expression +0:18 Construct uvec3 ( temp 3-component vector of uint) +0:18 packHalf2x16 ( temp uint) +0:18 Construct vec2 ( temp 2-component vector of float) +0:18 direct index ( temp float) +0:18 'inF0' ( in 3-component vector of float) +0:18 Constant: +0:18 0 (const int) +0:18 Constant: +0:18 0.000000 +0:18 packHalf2x16 ( temp uint) +0:18 Construct vec2 ( temp 2-component vector of float) +0:18 direct index ( temp float) +0:18 'inF0' ( in 3-component vector of float) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 0.000000 +0:18 packHalf2x16 ( temp uint) +0:18 Construct vec2 ( temp 2-component vector of float) +0:18 direct index ( temp float) +0:18 'inF0' ( in 3-component vector of float) +0:18 Constant: +0:18 2 (const int) +0:18 Constant: +0:18 0.000000 +0:22 Function Definition: PixelShaderFunction(vf4; ( temp 4-component vector of uint) +0:22 Function Parameters: +0:22 'inF0' ( in 4-component vector of float) +0:? Sequence +0:23 Branch: Return with expression +0:23 Construct uvec4 ( temp 4-component vector of uint) +0:23 packHalf2x16 ( temp uint) +0:23 Construct vec2 ( temp 2-component vector of float) +0:23 direct index ( temp float) +0:23 'inF0' ( in 4-component vector of float) +0:23 Constant: +0:23 0 (const int) +0:23 Constant: +0:23 0.000000 +0:23 packHalf2x16 ( temp uint) +0:23 Construct vec2 ( temp 2-component vector of float) +0:23 direct index ( temp float) +0:23 'inF0' ( in 4-component vector of float) +0:23 Constant: +0:23 1 (const int) +0:23 Constant: +0:23 0.000000 +0:23 packHalf2x16 ( temp uint) +0:23 Construct vec2 ( temp 2-component vector of float) +0:23 direct index ( temp float) +0:23 'inF0' ( in 4-component vector of float) +0:23 Constant: +0:23 2 (const int) +0:23 Constant: +0:23 0.000000 +0:23 packHalf2x16 ( temp uint) +0:23 Construct vec2 ( temp 2-component vector of float) +0:23 direct index ( temp float) +0:23 'inF0' ( in 4-component vector of float) +0:23 Constant: +0:23 3 (const int) +0:23 Constant: +0:23 0.000000 +0:27 Function Definition: @main( ( temp 4-component vector of float) +0:27 Function Parameters: +0:? Sequence +0:28 Branch: Return with expression +0:28 Constant: +0:28 0.000000 +0:28 0.000000 +0:28 0.000000 +0:28 0.000000 +0:27 Function Definition: main( ( temp void) +0:27 Function Parameters: +0:? Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:27 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: PixelShaderFunctionS(f1; ( temp uint) +0:2 Function Parameters: +0:2 'inF0' ( in float) +0:? Sequence +0:3 Branch: Return with expression +0:3 packHalf2x16 ( temp uint) +0:3 Construct vec2 ( temp 2-component vector of float) +0:3 'inF0' ( in float) +0:3 Constant: +0:3 0.000000 +0:7 Function Definition: PixelShaderFunction1(vf1; ( temp 1-component vector of uint) +0:7 Function Parameters: +0:7 'inF0' ( in 1-component vector of float) +0:? Sequence +0:8 Branch: Return with expression +0:8 Construct uint ( temp 1-component vector of uint) +0:8 packHalf2x16 ( temp uint) +0:8 Construct vec2 ( temp 2-component vector of float) +0:8 Construct float ( in float) +0:8 'inF0' ( in 1-component vector of float) +0:8 Constant: +0:8 0.000000 +0:12 Function Definition: PixelShaderFunction2(vf2; ( temp 2-component vector of uint) +0:12 Function Parameters: +0:12 'inF0' ( in 2-component vector of float) +0:? Sequence +0:13 Branch: Return with expression +0:13 Construct uvec2 ( temp 2-component vector of uint) +0:13 packHalf2x16 ( temp uint) +0:13 Construct vec2 ( temp 2-component vector of float) +0:13 direct index ( temp float) +0:13 'inF0' ( in 2-component vector of float) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0.000000 +0:13 packHalf2x16 ( temp uint) +0:13 Construct vec2 ( temp 2-component vector of float) +0:13 direct index ( temp float) +0:13 'inF0' ( in 2-component vector of float) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0.000000 +0:17 Function Definition: PixelShaderFunction3(vf3; ( temp 3-component vector of uint) +0:17 Function Parameters: +0:17 'inF0' ( in 3-component vector of float) +0:? Sequence +0:18 Branch: Return with expression +0:18 Construct uvec3 ( temp 3-component vector of uint) +0:18 packHalf2x16 ( temp uint) +0:18 Construct vec2 ( temp 2-component vector of float) +0:18 direct index ( temp float) +0:18 'inF0' ( in 3-component vector of float) +0:18 Constant: +0:18 0 (const int) +0:18 Constant: +0:18 0.000000 +0:18 packHalf2x16 ( temp uint) +0:18 Construct vec2 ( temp 2-component vector of float) +0:18 direct index ( temp float) +0:18 'inF0' ( in 3-component vector of float) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 0.000000 +0:18 packHalf2x16 ( temp uint) +0:18 Construct vec2 ( temp 2-component vector of float) +0:18 direct index ( temp float) +0:18 'inF0' ( in 3-component vector of float) +0:18 Constant: +0:18 2 (const int) +0:18 Constant: +0:18 0.000000 +0:22 Function Definition: PixelShaderFunction(vf4; ( temp 4-component vector of uint) +0:22 Function Parameters: +0:22 'inF0' ( in 4-component vector of float) +0:? Sequence +0:23 Branch: Return with expression +0:23 Construct uvec4 ( temp 4-component vector of uint) +0:23 packHalf2x16 ( temp uint) +0:23 Construct vec2 ( temp 2-component vector of float) +0:23 direct index ( temp float) +0:23 'inF0' ( in 4-component vector of float) +0:23 Constant: +0:23 0 (const int) +0:23 Constant: +0:23 0.000000 +0:23 packHalf2x16 ( temp uint) +0:23 Construct vec2 ( temp 2-component vector of float) +0:23 direct index ( temp float) +0:23 'inF0' ( in 4-component vector of float) +0:23 Constant: +0:23 1 (const int) +0:23 Constant: +0:23 0.000000 +0:23 packHalf2x16 ( temp uint) +0:23 Construct vec2 ( temp 2-component vector of float) +0:23 direct index ( temp float) +0:23 'inF0' ( in 4-component vector of float) +0:23 Constant: +0:23 2 (const int) +0:23 Constant: +0:23 0.000000 +0:23 packHalf2x16 ( temp uint) +0:23 Construct vec2 ( temp 2-component vector of float) +0:23 direct index ( temp float) +0:23 'inF0' ( in 4-component vector of float) +0:23 Constant: +0:23 3 (const int) +0:23 Constant: +0:23 0.000000 +0:27 Function Definition: @main( ( temp 4-component vector of float) +0:27 Function Parameters: +0:? Sequence +0:28 Branch: Return with expression +0:28 Constant: +0:28 0.000000 +0:28 0.000000 +0:28 0.000000 +0:28 0.000000 +0:27 Function Definition: main( ( temp void) +0:27 Function Parameters: +0:? Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:27 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 106 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 104 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "PixelShaderFunctionS(f1;" + Name 10 "inF0" + Name 14 "PixelShaderFunction1(vf1;" + Name 13 "inF0" + Name 21 "PixelShaderFunction2(vf2;" + Name 20 "inF0" + Name 28 "PixelShaderFunction3(vf3;" + Name 27 "inF0" + Name 35 "PixelShaderFunction(vf4;" + Name 34 "inF0" + Name 38 "@main(" + Name 104 "@entryPointOutput" + Decorate 104(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeInt 32 0 + 9: TypeFunction 8(int) 7(ptr) + 16: TypeVector 6(float) 2 + 17: TypePointer Function 16(fvec2) + 18: TypeVector 8(int) 2 + 19: TypeFunction 18(ivec2) 17(ptr) + 23: TypeVector 6(float) 3 + 24: TypePointer Function 23(fvec3) + 25: TypeVector 8(int) 3 + 26: TypeFunction 25(ivec3) 24(ptr) + 30: TypeVector 6(float) 4 + 31: TypePointer Function 30(fvec4) + 32: TypeVector 8(int) 4 + 33: TypeFunction 32(ivec4) 31(ptr) + 37: TypeFunction 30(fvec4) + 41: 6(float) Constant 0 + 51: 8(int) Constant 0 + 56: 8(int) Constant 1 + 72: 8(int) Constant 2 + 92: 8(int) Constant 3 + 100: 30(fvec4) ConstantComposite 41 41 41 41 + 103: TypePointer Output 30(fvec4) +104(@entryPointOutput): 103(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 105: 30(fvec4) FunctionCall 38(@main() + Store 104(@entryPointOutput) 105 + Return + FunctionEnd +11(PixelShaderFunctionS(f1;): 8(int) Function None 9 + 10(inF0): 7(ptr) FunctionParameter + 12: Label + 40: 6(float) Load 10(inF0) + 42: 16(fvec2) CompositeConstruct 40 41 + 43: 8(int) ExtInst 1(GLSL.std.450) 58(PackHalf2x16) 42 + ReturnValue 43 + FunctionEnd +14(PixelShaderFunction1(vf1;): 8(int) Function None 9 + 13(inF0): 7(ptr) FunctionParameter + 15: Label + 46: 6(float) Load 13(inF0) + 47: 16(fvec2) CompositeConstruct 46 41 + 48: 8(int) ExtInst 1(GLSL.std.450) 58(PackHalf2x16) 47 + ReturnValue 48 + FunctionEnd +21(PixelShaderFunction2(vf2;): 18(ivec2) Function None 19 + 20(inF0): 17(ptr) FunctionParameter + 22: Label + 52: 7(ptr) AccessChain 20(inF0) 51 + 53: 6(float) Load 52 + 54: 16(fvec2) CompositeConstruct 53 41 + 55: 8(int) ExtInst 1(GLSL.std.450) 58(PackHalf2x16) 54 + 57: 7(ptr) AccessChain 20(inF0) 56 + 58: 6(float) Load 57 + 59: 16(fvec2) CompositeConstruct 58 41 + 60: 8(int) ExtInst 1(GLSL.std.450) 58(PackHalf2x16) 59 + 61: 18(ivec2) CompositeConstruct 55 60 + ReturnValue 61 + FunctionEnd +28(PixelShaderFunction3(vf3;): 25(ivec3) Function None 26 + 27(inF0): 24(ptr) FunctionParameter + 29: Label + 64: 7(ptr) AccessChain 27(inF0) 51 + 65: 6(float) Load 64 + 66: 16(fvec2) CompositeConstruct 65 41 + 67: 8(int) ExtInst 1(GLSL.std.450) 58(PackHalf2x16) 66 + 68: 7(ptr) AccessChain 27(inF0) 56 + 69: 6(float) Load 68 + 70: 16(fvec2) CompositeConstruct 69 41 + 71: 8(int) ExtInst 1(GLSL.std.450) 58(PackHalf2x16) 70 + 73: 7(ptr) AccessChain 27(inF0) 72 + 74: 6(float) Load 73 + 75: 16(fvec2) CompositeConstruct 74 41 + 76: 8(int) ExtInst 1(GLSL.std.450) 58(PackHalf2x16) 75 + 77: 25(ivec3) CompositeConstruct 67 71 76 + ReturnValue 77 + FunctionEnd +35(PixelShaderFunction(vf4;): 32(ivec4) Function None 33 + 34(inF0): 31(ptr) FunctionParameter + 36: Label + 80: 7(ptr) AccessChain 34(inF0) 51 + 81: 6(float) Load 80 + 82: 16(fvec2) CompositeConstruct 81 41 + 83: 8(int) ExtInst 1(GLSL.std.450) 58(PackHalf2x16) 82 + 84: 7(ptr) AccessChain 34(inF0) 56 + 85: 6(float) Load 84 + 86: 16(fvec2) CompositeConstruct 85 41 + 87: 8(int) ExtInst 1(GLSL.std.450) 58(PackHalf2x16) 86 + 88: 7(ptr) AccessChain 34(inF0) 72 + 89: 6(float) Load 88 + 90: 16(fvec2) CompositeConstruct 89 41 + 91: 8(int) ExtInst 1(GLSL.std.450) 58(PackHalf2x16) 90 + 93: 7(ptr) AccessChain 34(inF0) 92 + 94: 6(float) Load 93 + 95: 16(fvec2) CompositeConstruct 94 41 + 96: 8(int) ExtInst 1(GLSL.std.450) 58(PackHalf2x16) 95 + 97: 32(ivec4) CompositeConstruct 83 87 91 96 + ReturnValue 97 + FunctionEnd + 38(@main(): 30(fvec4) Function None 37 + 39: Label + ReturnValue 100 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.frag.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.frag.out new file mode 100644 index 00000000..20d2bb04 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.frag.out @@ -0,0 +1,8480 @@ +hlsl.intrinsics.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:17 Function Definition: PixelShaderFunctionS(f1;f1;f1;u1;i1; ( temp float) +0:17 Function Parameters: +0:17 'inF0' ( in float) +0:17 'inF1' ( in float) +0:17 'inF2' ( in float) +0:17 'inU0' ( in uint) +0:17 'inU1' ( in int) +0:? Sequence +0:20 Sequence +0:20 move second child to first child ( temp bool) +0:20 'r000' ( temp bool) +0:20 all ( temp bool) +0:20 Convert float to bool ( temp bool) +0:20 'inF0' ( in float) +0:21 Sequence +0:21 move second child to first child ( temp float) +0:21 'r001' ( temp float) +0:21 Absolute value ( temp float) +0:21 'inF0' ( in float) +0:22 Sequence +0:22 move second child to first child ( temp float) +0:22 'r002' ( temp float) +0:22 arc cosine ( temp float) +0:22 'inF0' ( in float) +0:23 Sequence +0:23 move second child to first child ( temp bool) +0:23 'r003' ( temp bool) +0:23 any ( temp bool) +0:23 Convert float to bool ( temp bool) +0:23 'inF0' ( in float) +0:24 Sequence +0:24 move second child to first child ( temp float) +0:24 'r004' ( temp float) +0:24 arc sine ( temp float) +0:24 'inF0' ( in float) +0:25 Sequence +0:25 move second child to first child ( temp int) +0:25 'r005' ( temp int) +0:25 floatBitsToInt ( temp int) +0:25 'inF0' ( in float) +0:26 Sequence +0:26 move second child to first child ( temp uint) +0:26 'r006' ( temp uint) +0:26 floatBitsToUint ( temp uint) +0:26 'inU1' ( in int) +0:27 Sequence +0:27 move second child to first child ( temp float) +0:27 'r007' ( temp float) +0:27 intBitsToFloat ( temp float) +0:27 'inU0' ( in uint) +0:29 Sequence +0:29 move second child to first child ( temp float) +0:29 'r009' ( temp float) +0:29 arc tangent ( temp float) +0:29 'inF0' ( in float) +0:30 Sequence +0:30 move second child to first child ( temp float) +0:30 'r010' ( temp float) +0:30 arc tangent ( temp float) +0:30 'inF0' ( in float) +0:30 'inF1' ( in float) +0:31 Sequence +0:31 move second child to first child ( temp float) +0:31 'r011' ( temp float) +0:31 Ceiling ( temp float) +0:31 'inF0' ( in float) +0:32 Sequence +0:32 move second child to first child ( temp float) +0:32 'r012' ( temp float) +0:32 clamp ( temp float) +0:32 'inF0' ( in float) +0:32 'inF1' ( in float) +0:32 'inF2' ( in float) +0:33 Test condition and select ( temp void) +0:33 Condition +0:33 Compare Less Than ( temp bool) +0:33 'inF0' ( in float) +0:33 Constant: +0:33 0.000000 +0:33 true case +0:33 Branch: Kill +0:34 Test condition and select ( temp void) +0:34 Condition +0:34 Compare Less Than ( temp bool) +0:34 'r005' ( temp int) +0:34 Constant: +0:34 0 (const int) +0:34 true case +0:34 Branch: Kill +0:35 Sequence +0:35 move second child to first child ( temp float) +0:35 'r014' ( temp float) +0:35 cosine ( temp float) +0:35 'inF0' ( in float) +0:36 Sequence +0:36 move second child to first child ( temp float) +0:36 'r015' ( temp float) +0:36 hyp. cosine ( temp float) +0:36 'inF0' ( in float) +0:37 Sequence +0:37 move second child to first child ( temp int) +0:37 'r016' ( temp int) +0:37 bitCount ( temp int) +0:37 Constant: +0:37 7 (const int) +0:38 Sequence +0:38 move second child to first child ( temp float) +0:38 'r017' ( temp float) +0:38 dPdx ( temp float) +0:38 'inF0' ( in float) +0:39 Sequence +0:39 move second child to first child ( temp float) +0:39 'r018' ( temp float) +0:39 dPdxCoarse ( temp float) +0:39 'inF0' ( in float) +0:40 Sequence +0:40 move second child to first child ( temp float) +0:40 'r019' ( temp float) +0:40 dPdxFine ( temp float) +0:40 'inF0' ( in float) +0:41 Sequence +0:41 move second child to first child ( temp float) +0:41 'r020' ( temp float) +0:41 dPdy ( temp float) +0:41 'inF0' ( in float) +0:42 Sequence +0:42 move second child to first child ( temp float) +0:42 'r021' ( temp float) +0:42 dPdyCoarse ( temp float) +0:42 'inF0' ( in float) +0:43 Sequence +0:43 move second child to first child ( temp float) +0:43 'r022' ( temp float) +0:43 dPdyFine ( temp float) +0:43 'inF0' ( in float) +0:44 Sequence +0:44 move second child to first child ( temp float) +0:44 'r023' ( temp float) +0:44 degrees ( temp float) +0:44 'inF0' ( in float) +0:45 Sequence +0:45 move second child to first child ( temp float) +0:45 'r024' ( temp float) +0:45 distance ( temp float) +0:45 'inF0' ( in float) +0:45 'inF1' ( in float) +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'r027' ( temp float) +0:49 exp ( temp float) +0:49 'inF0' ( in float) +0:50 Sequence +0:50 move second child to first child ( temp float) +0:50 'r028' ( temp float) +0:50 exp2 ( temp float) +0:50 'inF0' ( in float) +0:51 Sequence +0:51 move second child to first child ( temp uint) +0:51 'r029' ( temp uint) +0:51 Convert int to uint ( temp uint) +0:51 findMSB ( temp int) +0:51 Constant: +0:51 7 (const int) +0:52 Sequence +0:52 move second child to first child ( temp uint) +0:52 'r030' ( temp uint) +0:52 Convert int to uint ( temp uint) +0:52 findLSB ( temp int) +0:52 Constant: +0:52 7 (const int) +0:53 Sequence +0:53 move second child to first child ( temp float) +0:53 'r031' ( temp float) +0:53 Floor ( temp float) +0:53 'inF0' ( in float) +0:55 Sequence +0:55 move second child to first child ( temp float) +0:55 'r033' ( temp float) +0:55 mod ( temp float) +0:55 'inF0' ( in float) +0:55 'inF1' ( in float) +0:56 Sequence +0:56 move second child to first child ( temp float) +0:56 'r034' ( temp float) +0:56 Fraction ( temp float) +0:56 'inF0' ( in float) +0:57 Sequence +0:57 move second child to first child ( temp float) +0:57 'r036' ( temp float) +0:57 fwidth ( temp float) +0:57 'inF0' ( in float) +0:58 Sequence +0:58 move second child to first child ( temp bool) +0:58 'r037' ( temp bool) +0:58 isinf ( temp bool) +0:58 'inF0' ( in float) +0:59 Sequence +0:59 move second child to first child ( temp bool) +0:59 'r038' ( temp bool) +0:59 isnan ( temp bool) +0:59 'inF0' ( in float) +0:60 Sequence +0:60 move second child to first child ( temp float) +0:60 'r039' ( temp float) +0:60 ldexp ( temp float) +0:60 'inF0' ( in float) +0:60 'inF1' ( in float) +0:61 Sequence +0:61 move second child to first child ( temp float) +0:61 'r039a' ( temp float) +0:61 mix ( temp float) +0:61 'inF0' ( in float) +0:61 'inF1' ( in float) +0:61 'inF2' ( in float) +0:62 Sequence +0:62 move second child to first child ( temp float) +0:62 'r040' ( temp float) +0:62 log ( temp float) +0:62 'inF0' ( in float) +0:63 Sequence +0:63 move second child to first child ( temp float) +0:63 'r041' ( temp float) +0:63 component-wise multiply ( temp float) +0:63 log2 ( temp float) +0:63 'inF0' ( in float) +0:63 Constant: +0:63 0.301030 +0:64 Sequence +0:64 move second child to first child ( temp float) +0:64 'r042' ( temp float) +0:64 log2 ( temp float) +0:64 'inF0' ( in float) +0:65 Sequence +0:65 move second child to first child ( temp float) +0:65 'r043' ( temp float) +0:65 max ( temp float) +0:65 'inF0' ( in float) +0:65 'inF1' ( in float) +0:66 Sequence +0:66 move second child to first child ( temp float) +0:66 'r044' ( temp float) +0:66 min ( temp float) +0:66 'inF0' ( in float) +0:66 'inF1' ( in float) +0:67 Sequence +0:67 move second child to first child ( temp float) +0:67 'r045' ( temp float) +0:67 pow ( temp float) +0:67 'inF0' ( in float) +0:67 'inF1' ( in float) +0:68 Sequence +0:68 move second child to first child ( temp float) +0:68 'r046' ( temp float) +0:68 radians ( temp float) +0:68 'inF0' ( in float) +0:69 Sequence +0:69 move second child to first child ( temp float) +0:69 'r047' ( temp float) +0:69 divide ( temp float) +0:69 Constant: +0:69 1.000000 +0:69 'inF0' ( in float) +0:70 Sequence +0:70 move second child to first child ( temp uint) +0:70 'r048' ( temp uint) +0:70 Convert int to uint ( temp uint) +0:70 bitFieldReverse ( temp int) +0:70 Constant: +0:70 2 (const int) +0:71 Sequence +0:71 move second child to first child ( temp float) +0:71 'r049' ( temp float) +0:71 roundEven ( temp float) +0:71 'inF0' ( in float) +0:72 Sequence +0:72 move second child to first child ( temp float) +0:72 'r050' ( temp float) +0:72 inverse sqrt ( temp float) +0:72 'inF0' ( in float) +0:73 Sequence +0:73 move second child to first child ( temp float) +0:73 'r051' ( temp float) +0:73 clamp ( temp float) +0:73 'inF0' ( in float) +0:73 Constant: +0:73 0.000000 +0:73 Constant: +0:73 1.000000 +0:74 Sequence +0:74 move second child to first child ( temp float) +0:74 'r052' ( temp float) +0:74 Sign ( temp float) +0:74 'inF0' ( in float) +0:75 Sequence +0:75 move second child to first child ( temp float) +0:75 'r053' ( temp float) +0:75 sine ( temp float) +0:75 'inF0' ( in float) +0:76 Sequence +0:76 move second child to first child ( temp float) +0:76 'inF1' ( in float) +0:76 sine ( temp float) +0:76 'inF0' ( in float) +0:76 move second child to first child ( temp float) +0:76 'inF2' ( in float) +0:76 cosine ( temp float) +0:76 'inF0' ( in float) +0:77 Sequence +0:77 move second child to first child ( temp float) +0:77 'r055' ( temp float) +0:77 hyp. sine ( temp float) +0:77 'inF0' ( in float) +0:78 Sequence +0:78 move second child to first child ( temp float) +0:78 'r056' ( temp float) +0:78 smoothstep ( temp float) +0:78 'inF0' ( in float) +0:78 'inF1' ( in float) +0:78 'inF2' ( in float) +0:79 Sequence +0:79 move second child to first child ( temp float) +0:79 'r057' ( temp float) +0:79 sqrt ( temp float) +0:79 'inF0' ( in float) +0:80 Sequence +0:80 move second child to first child ( temp float) +0:80 'r058' ( temp float) +0:80 step ( temp float) +0:80 'inF0' ( in float) +0:80 'inF1' ( in float) +0:81 Sequence +0:81 move second child to first child ( temp float) +0:81 'r059' ( temp float) +0:81 tangent ( temp float) +0:81 'inF0' ( in float) +0:82 Sequence +0:82 move second child to first child ( temp float) +0:82 'r060' ( temp float) +0:82 hyp. tangent ( temp float) +0:82 'inF0' ( in float) +0:84 Sequence +0:84 move second child to first child ( temp float) +0:84 'r061' ( temp float) +0:84 trunc ( temp float) +0:84 'inF0' ( in float) +0:86 Branch: Return with expression +0:86 Constant: +0:86 0.000000 +0:90 Function Definition: PixelShaderFunction1(vf1;vf1;vf1; ( temp 1-component vector of float) +0:90 Function Parameters: +0:90 'inF0' ( in 1-component vector of float) +0:90 'inF1' ( in 1-component vector of float) +0:90 'inF2' ( in 1-component vector of float) +0:? Sequence +0:92 Branch: Return with expression +0:92 Constant: +0:92 0.000000 +0:96 Function Definition: PixelShaderFunction2(vf2;vf2;vf2;vu2;vu2; ( temp 2-component vector of float) +0:96 Function Parameters: +0:96 'inF0' ( in 2-component vector of float) +0:96 'inF1' ( in 2-component vector of float) +0:96 'inF2' ( in 2-component vector of float) +0:96 'inU0' ( in 2-component vector of uint) +0:96 'inU1' ( in 2-component vector of uint) +0:? Sequence +0:99 Sequence +0:99 move second child to first child ( temp bool) +0:99 'r000' ( temp bool) +0:99 all ( temp bool) +0:99 Convert float to bool ( temp 2-component vector of bool) +0:99 'inF0' ( in 2-component vector of float) +0:100 Sequence +0:100 move second child to first child ( temp 2-component vector of float) +0:100 'r001' ( temp 2-component vector of float) +0:100 Absolute value ( temp 2-component vector of float) +0:100 'inF0' ( in 2-component vector of float) +0:101 Sequence +0:101 move second child to first child ( temp 2-component vector of float) +0:101 'r002' ( temp 2-component vector of float) +0:101 arc cosine ( temp 2-component vector of float) +0:101 'inF0' ( in 2-component vector of float) +0:102 Sequence +0:102 move second child to first child ( temp bool) +0:102 'r003' ( temp bool) +0:102 any ( temp bool) +0:102 Convert float to bool ( temp 2-component vector of bool) +0:102 'inF0' ( in 2-component vector of float) +0:103 Sequence +0:103 move second child to first child ( temp 2-component vector of float) +0:103 'r004' ( temp 2-component vector of float) +0:103 arc sine ( temp 2-component vector of float) +0:103 'inF0' ( in 2-component vector of float) +0:104 Sequence +0:104 move second child to first child ( temp 2-component vector of int) +0:104 'r005' ( temp 2-component vector of int) +0:104 floatBitsToInt ( temp 2-component vector of int) +0:104 'inF0' ( in 2-component vector of float) +0:105 Sequence +0:105 move second child to first child ( temp 2-component vector of uint) +0:105 'r006' ( temp 2-component vector of uint) +0:105 floatBitsToUint ( temp 2-component vector of uint) +0:105 'inF0' ( in 2-component vector of float) +0:106 Sequence +0:106 move second child to first child ( temp 2-component vector of float) +0:106 'r007' ( temp 2-component vector of float) +0:106 intBitsToFloat ( temp 2-component vector of float) +0:106 'inU0' ( in 2-component vector of uint) +0:108 Sequence +0:108 move second child to first child ( temp 2-component vector of float) +0:108 'r009' ( temp 2-component vector of float) +0:108 arc tangent ( temp 2-component vector of float) +0:108 'inF0' ( in 2-component vector of float) +0:109 Sequence +0:109 move second child to first child ( temp 2-component vector of float) +0:109 'r010' ( temp 2-component vector of float) +0:109 arc tangent ( temp 2-component vector of float) +0:109 'inF0' ( in 2-component vector of float) +0:109 'inF1' ( in 2-component vector of float) +0:110 Sequence +0:110 move second child to first child ( temp 2-component vector of float) +0:110 'r011' ( temp 2-component vector of float) +0:110 Ceiling ( temp 2-component vector of float) +0:110 'inF0' ( in 2-component vector of float) +0:111 Sequence +0:111 move second child to first child ( temp 2-component vector of float) +0:111 'r012' ( temp 2-component vector of float) +0:111 clamp ( temp 2-component vector of float) +0:111 'inF0' ( in 2-component vector of float) +0:111 'inF1' ( in 2-component vector of float) +0:111 'inF2' ( in 2-component vector of float) +0:112 Test condition and select ( temp void) +0:112 Condition +0:112 any ( temp bool) +0:112 Compare Less Than ( temp 2-component vector of bool) +0:112 'inF0' ( in 2-component vector of float) +0:112 Constant: +0:112 0.000000 +0:112 0.000000 +0:112 true case +0:112 Branch: Kill +0:113 Test condition and select ( temp void) +0:113 Condition +0:113 any ( temp bool) +0:113 Compare Less Than ( temp 2-component vector of bool) +0:113 'inU0' ( in 2-component vector of uint) +0:113 Constant: +0:113 0.000000 +0:113 0.000000 +0:113 true case +0:113 Branch: Kill +0:114 Sequence +0:114 move second child to first child ( temp 2-component vector of float) +0:114 'r013' ( temp 2-component vector of float) +0:114 cosine ( temp 2-component vector of float) +0:114 'inF0' ( in 2-component vector of float) +0:115 Sequence +0:115 move second child to first child ( temp 2-component vector of float) +0:115 'r015' ( temp 2-component vector of float) +0:115 hyp. cosine ( temp 2-component vector of float) +0:115 'inF0' ( in 2-component vector of float) +0:116 Sequence +0:116 move second child to first child ( temp 2-component vector of int) +0:116 'r016' ( temp 2-component vector of int) +0:? bitCount ( temp 2-component vector of int) +0:? Constant: +0:? 7 (const int) +0:? 3 (const int) +0:117 Sequence +0:117 move second child to first child ( temp 2-component vector of float) +0:117 'r017' ( temp 2-component vector of float) +0:117 dPdx ( temp 2-component vector of float) +0:117 'inF0' ( in 2-component vector of float) +0:118 Sequence +0:118 move second child to first child ( temp 2-component vector of float) +0:118 'r018' ( temp 2-component vector of float) +0:118 dPdxCoarse ( temp 2-component vector of float) +0:118 'inF0' ( in 2-component vector of float) +0:119 Sequence +0:119 move second child to first child ( temp 2-component vector of float) +0:119 'r019' ( temp 2-component vector of float) +0:119 dPdxFine ( temp 2-component vector of float) +0:119 'inF0' ( in 2-component vector of float) +0:120 Sequence +0:120 move second child to first child ( temp 2-component vector of float) +0:120 'r020' ( temp 2-component vector of float) +0:120 dPdy ( temp 2-component vector of float) +0:120 'inF0' ( in 2-component vector of float) +0:121 Sequence +0:121 move second child to first child ( temp 2-component vector of float) +0:121 'r021' ( temp 2-component vector of float) +0:121 dPdyCoarse ( temp 2-component vector of float) +0:121 'inF0' ( in 2-component vector of float) +0:122 Sequence +0:122 move second child to first child ( temp 2-component vector of float) +0:122 'r022' ( temp 2-component vector of float) +0:122 dPdyFine ( temp 2-component vector of float) +0:122 'inF0' ( in 2-component vector of float) +0:123 Sequence +0:123 move second child to first child ( temp 2-component vector of float) +0:123 'r023' ( temp 2-component vector of float) +0:123 degrees ( temp 2-component vector of float) +0:123 'inF0' ( in 2-component vector of float) +0:127 Sequence +0:127 move second child to first child ( temp float) +0:127 'r026' ( temp float) +0:127 distance ( temp float) +0:127 'inF0' ( in 2-component vector of float) +0:127 'inF1' ( in 2-component vector of float) +0:128 Sequence +0:128 move second child to first child ( temp float) +0:128 'r027' ( temp float) +0:128 dot-product ( temp float) +0:128 'inF0' ( in 2-component vector of float) +0:128 'inF1' ( in 2-component vector of float) +0:132 Sequence +0:132 move second child to first child ( temp 2-component vector of float) +0:132 'r028' ( temp 2-component vector of float) +0:132 exp ( temp 2-component vector of float) +0:132 'inF0' ( in 2-component vector of float) +0:133 Sequence +0:133 move second child to first child ( temp 2-component vector of float) +0:133 'r029' ( temp 2-component vector of float) +0:133 exp2 ( temp 2-component vector of float) +0:133 'inF0' ( in 2-component vector of float) +0:134 Sequence +0:134 move second child to first child ( temp 2-component vector of float) +0:134 'r030' ( temp 2-component vector of float) +0:134 face-forward ( temp 2-component vector of float) +0:134 'inF0' ( in 2-component vector of float) +0:134 'inF1' ( in 2-component vector of float) +0:134 'inF2' ( in 2-component vector of float) +0:135 Sequence +0:135 move second child to first child ( temp 2-component vector of uint) +0:135 'r031' ( temp 2-component vector of uint) +0:? findMSB ( temp 2-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 8 (const uint) +0:136 Sequence +0:136 move second child to first child ( temp 2-component vector of uint) +0:136 'r032' ( temp 2-component vector of uint) +0:? findLSB ( temp 2-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 8 (const uint) +0:137 Sequence +0:137 move second child to first child ( temp 2-component vector of float) +0:137 'r033' ( temp 2-component vector of float) +0:137 Floor ( temp 2-component vector of float) +0:137 'inF0' ( in 2-component vector of float) +0:139 Sequence +0:139 move second child to first child ( temp 2-component vector of float) +0:139 'r035' ( temp 2-component vector of float) +0:139 mod ( temp 2-component vector of float) +0:139 'inF0' ( in 2-component vector of float) +0:139 'inF1' ( in 2-component vector of float) +0:140 Sequence +0:140 move second child to first child ( temp 2-component vector of float) +0:140 'r036' ( temp 2-component vector of float) +0:140 Fraction ( temp 2-component vector of float) +0:140 'inF0' ( in 2-component vector of float) +0:141 Sequence +0:141 move second child to first child ( temp 2-component vector of float) +0:141 'r038' ( temp 2-component vector of float) +0:141 fwidth ( temp 2-component vector of float) +0:141 'inF0' ( in 2-component vector of float) +0:142 Sequence +0:142 move second child to first child ( temp 2-component vector of bool) +0:142 'r039' ( temp 2-component vector of bool) +0:142 isinf ( temp 2-component vector of bool) +0:142 'inF0' ( in 2-component vector of float) +0:143 Sequence +0:143 move second child to first child ( temp 2-component vector of bool) +0:143 'r040' ( temp 2-component vector of bool) +0:143 isnan ( temp 2-component vector of bool) +0:143 'inF0' ( in 2-component vector of float) +0:144 Sequence +0:144 move second child to first child ( temp 2-component vector of float) +0:144 'r041' ( temp 2-component vector of float) +0:144 ldexp ( temp 2-component vector of float) +0:144 'inF0' ( in 2-component vector of float) +0:144 'inF1' ( in 2-component vector of float) +0:145 Sequence +0:145 move second child to first child ( temp 2-component vector of float) +0:145 'r039a' ( temp 2-component vector of float) +0:145 mix ( temp 2-component vector of float) +0:145 'inF0' ( in 2-component vector of float) +0:145 'inF1' ( in 2-component vector of float) +0:145 'inF2' ( in 2-component vector of float) +0:146 Sequence +0:146 move second child to first child ( temp float) +0:146 'r042' ( temp float) +0:146 length ( temp float) +0:146 'inF0' ( in 2-component vector of float) +0:147 Sequence +0:147 move second child to first child ( temp 2-component vector of float) +0:147 'r043' ( temp 2-component vector of float) +0:147 log ( temp 2-component vector of float) +0:147 'inF0' ( in 2-component vector of float) +0:148 Sequence +0:148 move second child to first child ( temp 2-component vector of float) +0:148 'r044' ( temp 2-component vector of float) +0:148 vector-scale ( temp 2-component vector of float) +0:148 log2 ( temp 2-component vector of float) +0:148 'inF0' ( in 2-component vector of float) +0:148 Constant: +0:148 0.301030 +0:149 Sequence +0:149 move second child to first child ( temp 2-component vector of float) +0:149 'r045' ( temp 2-component vector of float) +0:149 log2 ( temp 2-component vector of float) +0:149 'inF0' ( in 2-component vector of float) +0:150 Sequence +0:150 move second child to first child ( temp 2-component vector of float) +0:150 'r046' ( temp 2-component vector of float) +0:150 max ( temp 2-component vector of float) +0:150 'inF0' ( in 2-component vector of float) +0:150 'inF1' ( in 2-component vector of float) +0:151 Sequence +0:151 move second child to first child ( temp 2-component vector of float) +0:151 'r047' ( temp 2-component vector of float) +0:151 min ( temp 2-component vector of float) +0:151 'inF0' ( in 2-component vector of float) +0:151 'inF1' ( in 2-component vector of float) +0:152 Sequence +0:152 move second child to first child ( temp 2-component vector of float) +0:152 'r048' ( temp 2-component vector of float) +0:152 normalize ( temp 2-component vector of float) +0:152 'inF0' ( in 2-component vector of float) +0:153 Sequence +0:153 move second child to first child ( temp 2-component vector of float) +0:153 'r049' ( temp 2-component vector of float) +0:153 pow ( temp 2-component vector of float) +0:153 'inF0' ( in 2-component vector of float) +0:153 'inF1' ( in 2-component vector of float) +0:154 Sequence +0:154 move second child to first child ( temp 2-component vector of float) +0:154 'r050' ( temp 2-component vector of float) +0:154 radians ( temp 2-component vector of float) +0:154 'inF0' ( in 2-component vector of float) +0:155 Sequence +0:155 move second child to first child ( temp 2-component vector of float) +0:155 'r051' ( temp 2-component vector of float) +0:155 divide ( temp 2-component vector of float) +0:155 Constant: +0:155 1.000000 +0:155 'inF0' ( in 2-component vector of float) +0:156 Sequence +0:156 move second child to first child ( temp 2-component vector of float) +0:156 'r052' ( temp 2-component vector of float) +0:156 reflect ( temp 2-component vector of float) +0:156 'inF0' ( in 2-component vector of float) +0:156 'inF1' ( in 2-component vector of float) +0:157 Sequence +0:157 move second child to first child ( temp 2-component vector of float) +0:157 'r053' ( temp 2-component vector of float) +0:157 refract ( temp 2-component vector of float) +0:157 'inF0' ( in 2-component vector of float) +0:157 'inF1' ( in 2-component vector of float) +0:157 Constant: +0:157 2.000000 +0:158 Sequence +0:158 move second child to first child ( temp 2-component vector of uint) +0:158 'r054' ( temp 2-component vector of uint) +0:? bitFieldReverse ( temp 2-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:159 Sequence +0:159 move second child to first child ( temp 2-component vector of float) +0:159 'r055' ( temp 2-component vector of float) +0:159 roundEven ( temp 2-component vector of float) +0:159 'inF0' ( in 2-component vector of float) +0:160 Sequence +0:160 move second child to first child ( temp 2-component vector of float) +0:160 'r056' ( temp 2-component vector of float) +0:160 inverse sqrt ( temp 2-component vector of float) +0:160 'inF0' ( in 2-component vector of float) +0:161 Sequence +0:161 move second child to first child ( temp 2-component vector of float) +0:161 'r057' ( temp 2-component vector of float) +0:161 clamp ( temp 2-component vector of float) +0:161 'inF0' ( in 2-component vector of float) +0:161 Constant: +0:161 0.000000 +0:161 Constant: +0:161 1.000000 +0:162 Sequence +0:162 move second child to first child ( temp 2-component vector of float) +0:162 'r058' ( temp 2-component vector of float) +0:162 Sign ( temp 2-component vector of float) +0:162 'inF0' ( in 2-component vector of float) +0:163 Sequence +0:163 move second child to first child ( temp 2-component vector of float) +0:163 'r059' ( temp 2-component vector of float) +0:163 sine ( temp 2-component vector of float) +0:163 'inF0' ( in 2-component vector of float) +0:164 Sequence +0:164 move second child to first child ( temp 2-component vector of float) +0:164 'inF1' ( in 2-component vector of float) +0:164 sine ( temp 2-component vector of float) +0:164 'inF0' ( in 2-component vector of float) +0:164 move second child to first child ( temp 2-component vector of float) +0:164 'inF2' ( in 2-component vector of float) +0:164 cosine ( temp 2-component vector of float) +0:164 'inF0' ( in 2-component vector of float) +0:165 Sequence +0:165 move second child to first child ( temp 2-component vector of float) +0:165 'r060' ( temp 2-component vector of float) +0:165 hyp. sine ( temp 2-component vector of float) +0:165 'inF0' ( in 2-component vector of float) +0:166 Sequence +0:166 move second child to first child ( temp 2-component vector of float) +0:166 'r061' ( temp 2-component vector of float) +0:166 smoothstep ( temp 2-component vector of float) +0:166 'inF0' ( in 2-component vector of float) +0:166 'inF1' ( in 2-component vector of float) +0:166 'inF2' ( in 2-component vector of float) +0:167 Sequence +0:167 move second child to first child ( temp 2-component vector of float) +0:167 'r062' ( temp 2-component vector of float) +0:167 sqrt ( temp 2-component vector of float) +0:167 'inF0' ( in 2-component vector of float) +0:168 Sequence +0:168 move second child to first child ( temp 2-component vector of float) +0:168 'r063' ( temp 2-component vector of float) +0:168 step ( temp 2-component vector of float) +0:168 'inF0' ( in 2-component vector of float) +0:168 'inF1' ( in 2-component vector of float) +0:169 Sequence +0:169 move second child to first child ( temp 2-component vector of float) +0:169 'r064' ( temp 2-component vector of float) +0:169 tangent ( temp 2-component vector of float) +0:169 'inF0' ( in 2-component vector of float) +0:170 Sequence +0:170 move second child to first child ( temp 2-component vector of float) +0:170 'r065' ( temp 2-component vector of float) +0:170 hyp. tangent ( temp 2-component vector of float) +0:170 'inF0' ( in 2-component vector of float) +0:172 Sequence +0:172 move second child to first child ( temp 2-component vector of float) +0:172 'r066' ( temp 2-component vector of float) +0:172 trunc ( temp 2-component vector of float) +0:172 'inF0' ( in 2-component vector of float) +0:175 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:179 Function Definition: PixelShaderFunction3(vf3;vf3;vf3;vu3;vu3; ( temp 3-component vector of float) +0:179 Function Parameters: +0:179 'inF0' ( in 3-component vector of float) +0:179 'inF1' ( in 3-component vector of float) +0:179 'inF2' ( in 3-component vector of float) +0:179 'inU0' ( in 3-component vector of uint) +0:179 'inU1' ( in 3-component vector of uint) +0:? Sequence +0:182 Sequence +0:182 move second child to first child ( temp bool) +0:182 'r000' ( temp bool) +0:182 all ( temp bool) +0:182 Convert float to bool ( temp 3-component vector of bool) +0:182 'inF0' ( in 3-component vector of float) +0:183 Sequence +0:183 move second child to first child ( temp 3-component vector of float) +0:183 'r001' ( temp 3-component vector of float) +0:183 Absolute value ( temp 3-component vector of float) +0:183 'inF0' ( in 3-component vector of float) +0:184 Sequence +0:184 move second child to first child ( temp 3-component vector of float) +0:184 'r002' ( temp 3-component vector of float) +0:184 arc cosine ( temp 3-component vector of float) +0:184 'inF0' ( in 3-component vector of float) +0:185 Sequence +0:185 move second child to first child ( temp bool) +0:185 'r003' ( temp bool) +0:185 any ( temp bool) +0:185 Convert float to bool ( temp 3-component vector of bool) +0:185 'inF0' ( in 3-component vector of float) +0:186 Sequence +0:186 move second child to first child ( temp 3-component vector of float) +0:186 'r004' ( temp 3-component vector of float) +0:186 arc sine ( temp 3-component vector of float) +0:186 'inF0' ( in 3-component vector of float) +0:187 Sequence +0:187 move second child to first child ( temp 3-component vector of int) +0:187 'r005' ( temp 3-component vector of int) +0:187 floatBitsToInt ( temp 3-component vector of int) +0:187 'inF0' ( in 3-component vector of float) +0:188 Sequence +0:188 move second child to first child ( temp 3-component vector of uint) +0:188 'r006' ( temp 3-component vector of uint) +0:188 floatBitsToUint ( temp 3-component vector of uint) +0:188 'inF0' ( in 3-component vector of float) +0:189 Sequence +0:189 move second child to first child ( temp 3-component vector of float) +0:189 'r007' ( temp 3-component vector of float) +0:189 intBitsToFloat ( temp 3-component vector of float) +0:189 'inU0' ( in 3-component vector of uint) +0:191 Sequence +0:191 move second child to first child ( temp 3-component vector of float) +0:191 'r009' ( temp 3-component vector of float) +0:191 arc tangent ( temp 3-component vector of float) +0:191 'inF0' ( in 3-component vector of float) +0:192 Sequence +0:192 move second child to first child ( temp 3-component vector of float) +0:192 'r010' ( temp 3-component vector of float) +0:192 arc tangent ( temp 3-component vector of float) +0:192 'inF0' ( in 3-component vector of float) +0:192 'inF1' ( in 3-component vector of float) +0:193 Sequence +0:193 move second child to first child ( temp 3-component vector of float) +0:193 'r011' ( temp 3-component vector of float) +0:193 Ceiling ( temp 3-component vector of float) +0:193 'inF0' ( in 3-component vector of float) +0:194 Sequence +0:194 move second child to first child ( temp 3-component vector of float) +0:194 'r012' ( temp 3-component vector of float) +0:194 clamp ( temp 3-component vector of float) +0:194 'inF0' ( in 3-component vector of float) +0:194 'inF1' ( in 3-component vector of float) +0:194 'inF2' ( in 3-component vector of float) +0:195 Test condition and select ( temp void) +0:195 Condition +0:195 any ( temp bool) +0:195 Compare Less Than ( temp 3-component vector of bool) +0:195 'inF0' ( in 3-component vector of float) +0:195 Constant: +0:195 0.000000 +0:195 0.000000 +0:195 0.000000 +0:195 true case +0:195 Branch: Kill +0:196 Test condition and select ( temp void) +0:196 Condition +0:196 any ( temp bool) +0:196 Compare Less Than ( temp 3-component vector of bool) +0:196 'inU0' ( in 3-component vector of uint) +0:196 Constant: +0:196 0.000000 +0:196 0.000000 +0:196 0.000000 +0:196 true case +0:196 Branch: Kill +0:197 Sequence +0:197 move second child to first child ( temp 3-component vector of float) +0:197 'r013' ( temp 3-component vector of float) +0:197 cosine ( temp 3-component vector of float) +0:197 'inF0' ( in 3-component vector of float) +0:198 Sequence +0:198 move second child to first child ( temp 3-component vector of float) +0:198 'r014' ( temp 3-component vector of float) +0:198 hyp. cosine ( temp 3-component vector of float) +0:198 'inF0' ( in 3-component vector of float) +0:199 Sequence +0:199 move second child to first child ( temp 3-component vector of uint) +0:199 'r015' ( temp 3-component vector of uint) +0:? bitCount ( temp 3-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 3 (const uint) +0:? 5 (const uint) +0:200 Sequence +0:200 move second child to first child ( temp 3-component vector of float) +0:200 'r016' ( temp 3-component vector of float) +0:200 cross-product ( temp 3-component vector of float) +0:200 'inF0' ( in 3-component vector of float) +0:200 'inF1' ( in 3-component vector of float) +0:201 Sequence +0:201 move second child to first child ( temp 3-component vector of float) +0:201 'r017' ( temp 3-component vector of float) +0:201 dPdx ( temp 3-component vector of float) +0:201 'inF0' ( in 3-component vector of float) +0:202 Sequence +0:202 move second child to first child ( temp 3-component vector of float) +0:202 'r018' ( temp 3-component vector of float) +0:202 dPdxCoarse ( temp 3-component vector of float) +0:202 'inF0' ( in 3-component vector of float) +0:203 Sequence +0:203 move second child to first child ( temp 3-component vector of float) +0:203 'r019' ( temp 3-component vector of float) +0:203 dPdxFine ( temp 3-component vector of float) +0:203 'inF0' ( in 3-component vector of float) +0:204 Sequence +0:204 move second child to first child ( temp 3-component vector of float) +0:204 'r020' ( temp 3-component vector of float) +0:204 dPdy ( temp 3-component vector of float) +0:204 'inF0' ( in 3-component vector of float) +0:205 Sequence +0:205 move second child to first child ( temp 3-component vector of float) +0:205 'r021' ( temp 3-component vector of float) +0:205 dPdyCoarse ( temp 3-component vector of float) +0:205 'inF0' ( in 3-component vector of float) +0:206 Sequence +0:206 move second child to first child ( temp 3-component vector of float) +0:206 'r022' ( temp 3-component vector of float) +0:206 dPdyFine ( temp 3-component vector of float) +0:206 'inF0' ( in 3-component vector of float) +0:207 Sequence +0:207 move second child to first child ( temp 3-component vector of float) +0:207 'r023' ( temp 3-component vector of float) +0:207 degrees ( temp 3-component vector of float) +0:207 'inF0' ( in 3-component vector of float) +0:208 Sequence +0:208 move second child to first child ( temp float) +0:208 'r024' ( temp float) +0:208 distance ( temp float) +0:208 'inF0' ( in 3-component vector of float) +0:208 'inF1' ( in 3-component vector of float) +0:209 Sequence +0:209 move second child to first child ( temp float) +0:209 'r025' ( temp float) +0:209 dot-product ( temp float) +0:209 'inF0' ( in 3-component vector of float) +0:209 'inF1' ( in 3-component vector of float) +0:213 Sequence +0:213 move second child to first child ( temp 3-component vector of float) +0:213 'r029' ( temp 3-component vector of float) +0:213 exp ( temp 3-component vector of float) +0:213 'inF0' ( in 3-component vector of float) +0:214 Sequence +0:214 move second child to first child ( temp 3-component vector of float) +0:214 'r030' ( temp 3-component vector of float) +0:214 exp2 ( temp 3-component vector of float) +0:214 'inF0' ( in 3-component vector of float) +0:215 Sequence +0:215 move second child to first child ( temp 3-component vector of float) +0:215 'r031' ( temp 3-component vector of float) +0:215 face-forward ( temp 3-component vector of float) +0:215 'inF0' ( in 3-component vector of float) +0:215 'inF1' ( in 3-component vector of float) +0:215 'inF2' ( in 3-component vector of float) +0:216 Sequence +0:216 move second child to first child ( temp 3-component vector of uint) +0:216 'r032' ( temp 3-component vector of uint) +0:? findMSB ( temp 3-component vector of uint) +0:? Constant: +0:? 2 (const uint) +0:? 3 (const uint) +0:? 4 (const uint) +0:217 Sequence +0:217 move second child to first child ( temp 3-component vector of uint) +0:217 'r033' ( temp 3-component vector of uint) +0:? findLSB ( temp 3-component vector of uint) +0:? Constant: +0:? 2 (const uint) +0:? 3 (const uint) +0:? 4 (const uint) +0:218 Sequence +0:218 move second child to first child ( temp 3-component vector of float) +0:218 'r034' ( temp 3-component vector of float) +0:218 Floor ( temp 3-component vector of float) +0:218 'inF0' ( in 3-component vector of float) +0:220 Sequence +0:220 move second child to first child ( temp 3-component vector of float) +0:220 'r036' ( temp 3-component vector of float) +0:220 mod ( temp 3-component vector of float) +0:220 'inF0' ( in 3-component vector of float) +0:220 'inF1' ( in 3-component vector of float) +0:221 Sequence +0:221 move second child to first child ( temp 3-component vector of float) +0:221 'r037' ( temp 3-component vector of float) +0:221 Fraction ( temp 3-component vector of float) +0:221 'inF0' ( in 3-component vector of float) +0:222 Sequence +0:222 move second child to first child ( temp 3-component vector of float) +0:222 'r039' ( temp 3-component vector of float) +0:222 fwidth ( temp 3-component vector of float) +0:222 'inF0' ( in 3-component vector of float) +0:223 Sequence +0:223 move second child to first child ( temp 3-component vector of bool) +0:223 'r040' ( temp 3-component vector of bool) +0:223 isinf ( temp 3-component vector of bool) +0:223 'inF0' ( in 3-component vector of float) +0:224 Sequence +0:224 move second child to first child ( temp 3-component vector of bool) +0:224 'r041' ( temp 3-component vector of bool) +0:224 isnan ( temp 3-component vector of bool) +0:224 'inF0' ( in 3-component vector of float) +0:225 Sequence +0:225 move second child to first child ( temp 3-component vector of float) +0:225 'r042' ( temp 3-component vector of float) +0:225 ldexp ( temp 3-component vector of float) +0:225 'inF0' ( in 3-component vector of float) +0:225 'inF1' ( in 3-component vector of float) +0:226 Sequence +0:226 move second child to first child ( temp 3-component vector of float) +0:226 'r039a' ( temp 3-component vector of float) +0:226 mix ( temp 3-component vector of float) +0:226 'inF0' ( in 3-component vector of float) +0:226 'inF1' ( in 3-component vector of float) +0:226 'inF2' ( in 3-component vector of float) +0:227 Sequence +0:227 move second child to first child ( temp 3-component vector of float) +0:227 'r039b' ( temp 3-component vector of float) +0:227 mix ( temp 3-component vector of float) +0:227 'inF0' ( in 3-component vector of float) +0:227 'inF1' ( in 3-component vector of float) +0:227 Constant: +0:227 0.300000 +0:228 Sequence +0:228 move second child to first child ( temp float) +0:228 'r043' ( temp float) +0:228 length ( temp float) +0:228 'inF0' ( in 3-component vector of float) +0:229 Sequence +0:229 move second child to first child ( temp 3-component vector of float) +0:229 'r044' ( temp 3-component vector of float) +0:229 log ( temp 3-component vector of float) +0:229 'inF0' ( in 3-component vector of float) +0:230 Sequence +0:230 move second child to first child ( temp 3-component vector of float) +0:230 'r045' ( temp 3-component vector of float) +0:230 vector-scale ( temp 3-component vector of float) +0:230 log2 ( temp 3-component vector of float) +0:230 'inF0' ( in 3-component vector of float) +0:230 Constant: +0:230 0.301030 +0:231 Sequence +0:231 move second child to first child ( temp 3-component vector of float) +0:231 'r046' ( temp 3-component vector of float) +0:231 log2 ( temp 3-component vector of float) +0:231 'inF0' ( in 3-component vector of float) +0:232 Sequence +0:232 move second child to first child ( temp 3-component vector of float) +0:232 'r047' ( temp 3-component vector of float) +0:232 max ( temp 3-component vector of float) +0:232 'inF0' ( in 3-component vector of float) +0:232 'inF1' ( in 3-component vector of float) +0:233 Sequence +0:233 move second child to first child ( temp 3-component vector of float) +0:233 'r048' ( temp 3-component vector of float) +0:233 min ( temp 3-component vector of float) +0:233 'inF0' ( in 3-component vector of float) +0:233 'inF1' ( in 3-component vector of float) +0:234 Sequence +0:234 move second child to first child ( temp 3-component vector of float) +0:234 'r049' ( temp 3-component vector of float) +0:234 normalize ( temp 3-component vector of float) +0:234 'inF0' ( in 3-component vector of float) +0:235 Sequence +0:235 move second child to first child ( temp 3-component vector of float) +0:235 'r050' ( temp 3-component vector of float) +0:235 pow ( temp 3-component vector of float) +0:235 'inF0' ( in 3-component vector of float) +0:235 'inF1' ( in 3-component vector of float) +0:236 Sequence +0:236 move second child to first child ( temp 3-component vector of float) +0:236 'r051' ( temp 3-component vector of float) +0:236 radians ( temp 3-component vector of float) +0:236 'inF0' ( in 3-component vector of float) +0:237 Sequence +0:237 move second child to first child ( temp 3-component vector of float) +0:237 'r052' ( temp 3-component vector of float) +0:237 divide ( temp 3-component vector of float) +0:237 Constant: +0:237 1.000000 +0:237 'inF0' ( in 3-component vector of float) +0:238 Sequence +0:238 move second child to first child ( temp 3-component vector of float) +0:238 'r053' ( temp 3-component vector of float) +0:238 reflect ( temp 3-component vector of float) +0:238 'inF0' ( in 3-component vector of float) +0:238 'inF1' ( in 3-component vector of float) +0:239 Sequence +0:239 move second child to first child ( temp 3-component vector of float) +0:239 'r054' ( temp 3-component vector of float) +0:239 refract ( temp 3-component vector of float) +0:239 'inF0' ( in 3-component vector of float) +0:239 'inF1' ( in 3-component vector of float) +0:239 Constant: +0:239 2.000000 +0:240 Sequence +0:240 move second child to first child ( temp 3-component vector of uint) +0:240 'r055' ( temp 3-component vector of uint) +0:? bitFieldReverse ( temp 3-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:241 Sequence +0:241 move second child to first child ( temp 3-component vector of float) +0:241 'r056' ( temp 3-component vector of float) +0:241 roundEven ( temp 3-component vector of float) +0:241 'inF0' ( in 3-component vector of float) +0:242 Sequence +0:242 move second child to first child ( temp 3-component vector of float) +0:242 'r057' ( temp 3-component vector of float) +0:242 inverse sqrt ( temp 3-component vector of float) +0:242 'inF0' ( in 3-component vector of float) +0:243 Sequence +0:243 move second child to first child ( temp 3-component vector of float) +0:243 'r058' ( temp 3-component vector of float) +0:243 clamp ( temp 3-component vector of float) +0:243 'inF0' ( in 3-component vector of float) +0:243 Constant: +0:243 0.000000 +0:243 Constant: +0:243 1.000000 +0:244 Sequence +0:244 move second child to first child ( temp 3-component vector of float) +0:244 'r059' ( temp 3-component vector of float) +0:244 Sign ( temp 3-component vector of float) +0:244 'inF0' ( in 3-component vector of float) +0:245 Sequence +0:245 move second child to first child ( temp 3-component vector of float) +0:245 'r060' ( temp 3-component vector of float) +0:245 sine ( temp 3-component vector of float) +0:245 'inF0' ( in 3-component vector of float) +0:246 Sequence +0:246 move second child to first child ( temp 3-component vector of float) +0:246 'inF1' ( in 3-component vector of float) +0:246 sine ( temp 3-component vector of float) +0:246 'inF0' ( in 3-component vector of float) +0:246 move second child to first child ( temp 3-component vector of float) +0:246 'inF2' ( in 3-component vector of float) +0:246 cosine ( temp 3-component vector of float) +0:246 'inF0' ( in 3-component vector of float) +0:247 Sequence +0:247 move second child to first child ( temp 3-component vector of float) +0:247 'r061' ( temp 3-component vector of float) +0:247 hyp. sine ( temp 3-component vector of float) +0:247 'inF0' ( in 3-component vector of float) +0:248 Sequence +0:248 move second child to first child ( temp 3-component vector of float) +0:248 'r062' ( temp 3-component vector of float) +0:248 smoothstep ( temp 3-component vector of float) +0:248 'inF0' ( in 3-component vector of float) +0:248 'inF1' ( in 3-component vector of float) +0:248 'inF2' ( in 3-component vector of float) +0:249 Sequence +0:249 move second child to first child ( temp 3-component vector of float) +0:249 'r063' ( temp 3-component vector of float) +0:249 sqrt ( temp 3-component vector of float) +0:249 'inF0' ( in 3-component vector of float) +0:250 Sequence +0:250 move second child to first child ( temp 3-component vector of float) +0:250 'r064' ( temp 3-component vector of float) +0:250 step ( temp 3-component vector of float) +0:250 'inF0' ( in 3-component vector of float) +0:250 'inF1' ( in 3-component vector of float) +0:251 Sequence +0:251 move second child to first child ( temp 3-component vector of float) +0:251 'r065' ( temp 3-component vector of float) +0:251 tangent ( temp 3-component vector of float) +0:251 'inF0' ( in 3-component vector of float) +0:252 Sequence +0:252 move second child to first child ( temp 3-component vector of float) +0:252 'r066' ( temp 3-component vector of float) +0:252 hyp. tangent ( temp 3-component vector of float) +0:252 'inF0' ( in 3-component vector of float) +0:254 Sequence +0:254 move second child to first child ( temp 3-component vector of float) +0:254 'r067' ( temp 3-component vector of float) +0:254 trunc ( temp 3-component vector of float) +0:254 'inF0' ( in 3-component vector of float) +0:257 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:261 Function Definition: PixelShaderFunction(vf4;vf4;vf4;vu4;vu4; ( temp 4-component vector of float) +0:261 Function Parameters: +0:261 'inF0' ( in 4-component vector of float) +0:261 'inF1' ( in 4-component vector of float) +0:261 'inF2' ( in 4-component vector of float) +0:261 'inU0' ( in 4-component vector of uint) +0:261 'inU1' ( in 4-component vector of uint) +0:? Sequence +0:264 Sequence +0:264 move second child to first child ( temp bool) +0:264 'r000' ( temp bool) +0:264 all ( temp bool) +0:264 Convert float to bool ( temp 4-component vector of bool) +0:264 'inF0' ( in 4-component vector of float) +0:265 Sequence +0:265 move second child to first child ( temp 4-component vector of float) +0:265 'r001' ( temp 4-component vector of float) +0:265 Absolute value ( temp 4-component vector of float) +0:265 'inF0' ( in 4-component vector of float) +0:266 Sequence +0:266 move second child to first child ( temp 4-component vector of float) +0:266 'r002' ( temp 4-component vector of float) +0:266 arc cosine ( temp 4-component vector of float) +0:266 'inF0' ( in 4-component vector of float) +0:267 Sequence +0:267 move second child to first child ( temp bool) +0:267 'r003' ( temp bool) +0:267 any ( temp bool) +0:267 Convert float to bool ( temp 4-component vector of bool) +0:267 'inF0' ( in 4-component vector of float) +0:268 Sequence +0:268 move second child to first child ( temp 4-component vector of float) +0:268 'r004' ( temp 4-component vector of float) +0:268 arc sine ( temp 4-component vector of float) +0:268 'inF0' ( in 4-component vector of float) +0:269 Sequence +0:269 move second child to first child ( temp 4-component vector of int) +0:269 'r005' ( temp 4-component vector of int) +0:269 floatBitsToInt ( temp 4-component vector of int) +0:269 'inF0' ( in 4-component vector of float) +0:270 Sequence +0:270 move second child to first child ( temp 4-component vector of uint) +0:270 'r006' ( temp 4-component vector of uint) +0:270 floatBitsToUint ( temp 4-component vector of uint) +0:270 'inF0' ( in 4-component vector of float) +0:271 Sequence +0:271 move second child to first child ( temp 4-component vector of float) +0:271 'r007' ( temp 4-component vector of float) +0:271 intBitsToFloat ( temp 4-component vector of float) +0:271 'inU0' ( in 4-component vector of uint) +0:273 Sequence +0:273 move second child to first child ( temp 4-component vector of float) +0:273 'r009' ( temp 4-component vector of float) +0:273 arc tangent ( temp 4-component vector of float) +0:273 'inF0' ( in 4-component vector of float) +0:274 Sequence +0:274 move second child to first child ( temp 4-component vector of float) +0:274 'r010' ( temp 4-component vector of float) +0:274 arc tangent ( temp 4-component vector of float) +0:274 'inF0' ( in 4-component vector of float) +0:274 'inF1' ( in 4-component vector of float) +0:275 Sequence +0:275 move second child to first child ( temp 4-component vector of float) +0:275 'r011' ( temp 4-component vector of float) +0:275 Ceiling ( temp 4-component vector of float) +0:275 'inF0' ( in 4-component vector of float) +0:276 Sequence +0:276 move second child to first child ( temp 4-component vector of float) +0:276 'r012' ( temp 4-component vector of float) +0:276 clamp ( temp 4-component vector of float) +0:276 'inF0' ( in 4-component vector of float) +0:276 'inF1' ( in 4-component vector of float) +0:276 'inF2' ( in 4-component vector of float) +0:277 Test condition and select ( temp void) +0:277 Condition +0:277 any ( temp bool) +0:277 Compare Less Than ( temp 4-component vector of bool) +0:277 'inF0' ( in 4-component vector of float) +0:277 Constant: +0:277 0.000000 +0:277 0.000000 +0:277 0.000000 +0:277 0.000000 +0:277 true case +0:277 Branch: Kill +0:278 Test condition and select ( temp void) +0:278 Condition +0:278 any ( temp bool) +0:278 Compare Less Than ( temp 4-component vector of bool) +0:278 'inU0' ( in 4-component vector of uint) +0:278 Constant: +0:278 0.000000 +0:278 0.000000 +0:278 0.000000 +0:278 0.000000 +0:278 true case +0:278 Branch: Kill +0:279 Sequence +0:279 move second child to first child ( temp 4-component vector of float) +0:279 'r013' ( temp 4-component vector of float) +0:279 cosine ( temp 4-component vector of float) +0:279 'inF0' ( in 4-component vector of float) +0:280 Sequence +0:280 move second child to first child ( temp 4-component vector of float) +0:280 'r014' ( temp 4-component vector of float) +0:280 hyp. cosine ( temp 4-component vector of float) +0:280 'inF0' ( in 4-component vector of float) +0:281 Sequence +0:281 move second child to first child ( temp 4-component vector of uint) +0:281 'r015' ( temp 4-component vector of uint) +0:? bitCount ( temp 4-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 3 (const uint) +0:? 5 (const uint) +0:? 2 (const uint) +0:282 Sequence +0:282 move second child to first child ( temp 4-component vector of float) +0:282 'r016' ( temp 4-component vector of float) +0:282 dPdx ( temp 4-component vector of float) +0:282 'inF0' ( in 4-component vector of float) +0:283 Sequence +0:283 move second child to first child ( temp 4-component vector of float) +0:283 'r017' ( temp 4-component vector of float) +0:283 dPdxCoarse ( temp 4-component vector of float) +0:283 'inF0' ( in 4-component vector of float) +0:284 Sequence +0:284 move second child to first child ( temp 4-component vector of float) +0:284 'r018' ( temp 4-component vector of float) +0:284 dPdxFine ( temp 4-component vector of float) +0:284 'inF0' ( in 4-component vector of float) +0:285 Sequence +0:285 move second child to first child ( temp 4-component vector of float) +0:285 'r019' ( temp 4-component vector of float) +0:285 dPdy ( temp 4-component vector of float) +0:285 'inF0' ( in 4-component vector of float) +0:286 Sequence +0:286 move second child to first child ( temp 4-component vector of float) +0:286 'r020' ( temp 4-component vector of float) +0:286 dPdyCoarse ( temp 4-component vector of float) +0:286 'inF0' ( in 4-component vector of float) +0:287 Sequence +0:287 move second child to first child ( temp 4-component vector of float) +0:287 'r021' ( temp 4-component vector of float) +0:287 dPdyFine ( temp 4-component vector of float) +0:287 'inF0' ( in 4-component vector of float) +0:288 Sequence +0:288 move second child to first child ( temp 4-component vector of float) +0:288 'r022' ( temp 4-component vector of float) +0:288 degrees ( temp 4-component vector of float) +0:288 'inF0' ( in 4-component vector of float) +0:289 Sequence +0:289 move second child to first child ( temp float) +0:289 'r023' ( temp float) +0:289 distance ( temp float) +0:289 'inF0' ( in 4-component vector of float) +0:289 'inF1' ( in 4-component vector of float) +0:290 Sequence +0:290 move second child to first child ( temp float) +0:290 'r024' ( temp float) +0:290 dot-product ( temp float) +0:290 'inF0' ( in 4-component vector of float) +0:290 'inF1' ( in 4-component vector of float) +0:291 Sequence +0:291 move second child to first child ( temp 4-component vector of float) +0:291 'r025' ( temp 4-component vector of float) +0:291 Construct vec4 ( temp 4-component vector of float) +0:291 Constant: +0:291 1.000000 +0:291 component-wise multiply ( temp float) +0:291 direct index ( temp float) +0:291 'inF0' ( in 4-component vector of float) +0:291 Constant: +0:291 1 (const int) +0:291 direct index ( temp float) +0:291 'inF1' ( in 4-component vector of float) +0:291 Constant: +0:291 1 (const int) +0:291 direct index ( temp float) +0:291 'inF0' ( in 4-component vector of float) +0:291 Constant: +0:291 2 (const int) +0:291 direct index ( temp float) +0:291 'inF1' ( in 4-component vector of float) +0:291 Constant: +0:291 3 (const int) +0:295 Sequence +0:295 move second child to first child ( temp 4-component vector of float) +0:295 'r029' ( temp 4-component vector of float) +0:295 exp ( temp 4-component vector of float) +0:295 'inF0' ( in 4-component vector of float) +0:296 Sequence +0:296 move second child to first child ( temp 4-component vector of float) +0:296 'r030' ( temp 4-component vector of float) +0:296 exp2 ( temp 4-component vector of float) +0:296 'inF0' ( in 4-component vector of float) +0:297 Sequence +0:297 move second child to first child ( temp 4-component vector of float) +0:297 'r031' ( temp 4-component vector of float) +0:297 face-forward ( temp 4-component vector of float) +0:297 'inF0' ( in 4-component vector of float) +0:297 'inF1' ( in 4-component vector of float) +0:297 'inF2' ( in 4-component vector of float) +0:298 Sequence +0:298 move second child to first child ( temp 4-component vector of uint) +0:298 'r032' ( temp 4-component vector of uint) +0:? findMSB ( temp 4-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 8 (const uint) +0:? 9 (const uint) +0:? 10 (const uint) +0:299 Sequence +0:299 move second child to first child ( temp 4-component vector of uint) +0:299 'r033' ( temp 4-component vector of uint) +0:? findLSB ( temp 4-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 8 (const uint) +0:? 9 (const uint) +0:? 10 (const uint) +0:300 Sequence +0:300 move second child to first child ( temp 4-component vector of float) +0:300 'r034' ( temp 4-component vector of float) +0:300 Floor ( temp 4-component vector of float) +0:300 'inF0' ( in 4-component vector of float) +0:302 Sequence +0:302 move second child to first child ( temp 4-component vector of float) +0:302 'r036' ( temp 4-component vector of float) +0:302 mod ( temp 4-component vector of float) +0:302 'inF0' ( in 4-component vector of float) +0:302 'inF1' ( in 4-component vector of float) +0:303 Sequence +0:303 move second child to first child ( temp 4-component vector of float) +0:303 'r037' ( temp 4-component vector of float) +0:303 Fraction ( temp 4-component vector of float) +0:303 'inF0' ( in 4-component vector of float) +0:304 Sequence +0:304 move second child to first child ( temp 4-component vector of float) +0:304 'r039' ( temp 4-component vector of float) +0:304 fwidth ( temp 4-component vector of float) +0:304 'inF0' ( in 4-component vector of float) +0:305 Sequence +0:305 move second child to first child ( temp 4-component vector of bool) +0:305 'r040' ( temp 4-component vector of bool) +0:305 isinf ( temp 4-component vector of bool) +0:305 'inF0' ( in 4-component vector of float) +0:306 Sequence +0:306 move second child to first child ( temp 4-component vector of bool) +0:306 'r041' ( temp 4-component vector of bool) +0:306 isnan ( temp 4-component vector of bool) +0:306 'inF0' ( in 4-component vector of float) +0:307 Sequence +0:307 move second child to first child ( temp 4-component vector of float) +0:307 'r042' ( temp 4-component vector of float) +0:307 ldexp ( temp 4-component vector of float) +0:307 'inF0' ( in 4-component vector of float) +0:307 'inF1' ( in 4-component vector of float) +0:308 Sequence +0:308 move second child to first child ( temp 4-component vector of float) +0:308 'r039a' ( temp 4-component vector of float) +0:308 mix ( temp 4-component vector of float) +0:308 'inF0' ( in 4-component vector of float) +0:308 'inF1' ( in 4-component vector of float) +0:308 'inF2' ( in 4-component vector of float) +0:309 Sequence +0:309 move second child to first child ( temp float) +0:309 'r043' ( temp float) +0:309 length ( temp float) +0:309 'inF0' ( in 4-component vector of float) +0:310 Sequence +0:310 move second child to first child ( temp 4-component vector of float) +0:310 'r044' ( temp 4-component vector of float) +0:310 log ( temp 4-component vector of float) +0:310 'inF0' ( in 4-component vector of float) +0:311 Sequence +0:311 move second child to first child ( temp 4-component vector of float) +0:311 'r045' ( temp 4-component vector of float) +0:311 vector-scale ( temp 4-component vector of float) +0:311 log2 ( temp 4-component vector of float) +0:311 'inF0' ( in 4-component vector of float) +0:311 Constant: +0:311 0.301030 +0:312 Sequence +0:312 move second child to first child ( temp 4-component vector of float) +0:312 'r046' ( temp 4-component vector of float) +0:312 log2 ( temp 4-component vector of float) +0:312 'inF0' ( in 4-component vector of float) +0:313 Sequence +0:313 move second child to first child ( temp 4-component vector of float) +0:313 'r047' ( temp 4-component vector of float) +0:313 max ( temp 4-component vector of float) +0:313 'inF0' ( in 4-component vector of float) +0:313 'inF1' ( in 4-component vector of float) +0:314 Sequence +0:314 move second child to first child ( temp 4-component vector of float) +0:314 'r048' ( temp 4-component vector of float) +0:314 min ( temp 4-component vector of float) +0:314 'inF0' ( in 4-component vector of float) +0:314 'inF1' ( in 4-component vector of float) +0:315 Sequence +0:315 move second child to first child ( temp 4-component vector of float) +0:315 'r049' ( temp 4-component vector of float) +0:315 normalize ( temp 4-component vector of float) +0:315 'inF0' ( in 4-component vector of float) +0:316 Sequence +0:316 move second child to first child ( temp 4-component vector of float) +0:316 'r050' ( temp 4-component vector of float) +0:316 pow ( temp 4-component vector of float) +0:316 'inF0' ( in 4-component vector of float) +0:316 'inF1' ( in 4-component vector of float) +0:317 Sequence +0:317 move second child to first child ( temp 4-component vector of float) +0:317 'r051' ( temp 4-component vector of float) +0:317 radians ( temp 4-component vector of float) +0:317 'inF0' ( in 4-component vector of float) +0:318 Sequence +0:318 move second child to first child ( temp 4-component vector of float) +0:318 'r052' ( temp 4-component vector of float) +0:318 divide ( temp 4-component vector of float) +0:318 Constant: +0:318 1.000000 +0:318 'inF0' ( in 4-component vector of float) +0:319 Sequence +0:319 move second child to first child ( temp 4-component vector of float) +0:319 'r053' ( temp 4-component vector of float) +0:319 reflect ( temp 4-component vector of float) +0:319 'inF0' ( in 4-component vector of float) +0:319 'inF1' ( in 4-component vector of float) +0:320 Sequence +0:320 move second child to first child ( temp 4-component vector of float) +0:320 'r054' ( temp 4-component vector of float) +0:320 refract ( temp 4-component vector of float) +0:320 'inF0' ( in 4-component vector of float) +0:320 'inF1' ( in 4-component vector of float) +0:320 Constant: +0:320 2.000000 +0:321 Sequence +0:321 move second child to first child ( temp 4-component vector of uint) +0:321 'r055' ( temp 4-component vector of uint) +0:? bitFieldReverse ( temp 4-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:? 4 (const uint) +0:322 Sequence +0:322 move second child to first child ( temp 4-component vector of float) +0:322 'r056' ( temp 4-component vector of float) +0:322 roundEven ( temp 4-component vector of float) +0:322 'inF0' ( in 4-component vector of float) +0:323 Sequence +0:323 move second child to first child ( temp 4-component vector of float) +0:323 'r057' ( temp 4-component vector of float) +0:323 inverse sqrt ( temp 4-component vector of float) +0:323 'inF0' ( in 4-component vector of float) +0:324 Sequence +0:324 move second child to first child ( temp 4-component vector of float) +0:324 'r058' ( temp 4-component vector of float) +0:324 clamp ( temp 4-component vector of float) +0:324 'inF0' ( in 4-component vector of float) +0:324 Constant: +0:324 0.000000 +0:324 Constant: +0:324 1.000000 +0:325 Sequence +0:325 move second child to first child ( temp 4-component vector of float) +0:325 'r059' ( temp 4-component vector of float) +0:325 Sign ( temp 4-component vector of float) +0:325 'inF0' ( in 4-component vector of float) +0:326 Sequence +0:326 move second child to first child ( temp 4-component vector of float) +0:326 'r060' ( temp 4-component vector of float) +0:326 sine ( temp 4-component vector of float) +0:326 'inF0' ( in 4-component vector of float) +0:327 Sequence +0:327 move second child to first child ( temp 4-component vector of float) +0:327 'inF1' ( in 4-component vector of float) +0:327 sine ( temp 4-component vector of float) +0:327 'inF0' ( in 4-component vector of float) +0:327 move second child to first child ( temp 4-component vector of float) +0:327 'inF2' ( in 4-component vector of float) +0:327 cosine ( temp 4-component vector of float) +0:327 'inF0' ( in 4-component vector of float) +0:328 Sequence +0:328 move second child to first child ( temp 4-component vector of float) +0:328 'r061' ( temp 4-component vector of float) +0:328 hyp. sine ( temp 4-component vector of float) +0:328 'inF0' ( in 4-component vector of float) +0:329 Sequence +0:329 move second child to first child ( temp 4-component vector of float) +0:329 'r062' ( temp 4-component vector of float) +0:329 smoothstep ( temp 4-component vector of float) +0:329 'inF0' ( in 4-component vector of float) +0:329 'inF1' ( in 4-component vector of float) +0:329 'inF2' ( in 4-component vector of float) +0:330 Sequence +0:330 move second child to first child ( temp 4-component vector of float) +0:330 'r063' ( temp 4-component vector of float) +0:330 sqrt ( temp 4-component vector of float) +0:330 'inF0' ( in 4-component vector of float) +0:331 Sequence +0:331 move second child to first child ( temp 4-component vector of float) +0:331 'r064' ( temp 4-component vector of float) +0:331 step ( temp 4-component vector of float) +0:331 'inF0' ( in 4-component vector of float) +0:331 'inF1' ( in 4-component vector of float) +0:332 Sequence +0:332 move second child to first child ( temp 4-component vector of float) +0:332 'r065' ( temp 4-component vector of float) +0:332 tangent ( temp 4-component vector of float) +0:332 'inF0' ( in 4-component vector of float) +0:333 Sequence +0:333 move second child to first child ( temp 4-component vector of float) +0:333 'r066' ( temp 4-component vector of float) +0:333 hyp. tangent ( temp 4-component vector of float) +0:333 'inF0' ( in 4-component vector of float) +0:335 Sequence +0:335 move second child to first child ( temp 4-component vector of float) +0:335 'r067' ( temp 4-component vector of float) +0:335 trunc ( temp 4-component vector of float) +0:335 'inF0' ( in 4-component vector of float) +0:338 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:401 Function Definition: PixelShaderFunction2x2(mf22;mf22;mf22; ( temp 2X2 matrix of float) +0:401 Function Parameters: +0:401 'inF0' ( in 2X2 matrix of float) +0:401 'inF1' ( in 2X2 matrix of float) +0:401 'inF2' ( in 2X2 matrix of float) +0:? Sequence +0:403 Sequence +0:403 move second child to first child ( temp bool) +0:403 'r000' ( temp bool) +0:403 all ( temp bool) +0:403 Convert float to bool ( temp 2X2 matrix of bool) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r001' ( temp 2X2 matrix of float) +0:403 Absolute value ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 arc cosine ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp bool) +0:403 'r003' ( temp bool) +0:403 any ( temp bool) +0:403 Convert float to bool ( temp 2X2 matrix of bool) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r004' ( temp 2X2 matrix of float) +0:403 arc sine ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r005' ( temp 2X2 matrix of float) +0:403 arc tangent ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r006' ( temp 2X2 matrix of float) +0:403 arc tangent ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r007' ( temp 2X2 matrix of float) +0:403 Ceiling ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Test condition and select ( temp void) +0:403 Condition +0:403 any ( temp bool) +0:403 Compare Less Than ( temp 2X2 matrix of bool) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Constant: +0:403 0.000000 +0:403 0.000000 +0:403 0.000000 +0:403 0.000000 +0:403 true case +0:403 Branch: Kill +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r008' ( temp 2X2 matrix of float) +0:403 clamp ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 'inF2' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r009' ( temp 2X2 matrix of float) +0:403 cosine ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r010' ( temp 2X2 matrix of float) +0:403 hyp. cosine ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r011' ( temp 2X2 matrix of float) +0:403 dPdx ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r012' ( temp 2X2 matrix of float) +0:403 dPdxCoarse ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r013' ( temp 2X2 matrix of float) +0:403 dPdxFine ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r014' ( temp 2X2 matrix of float) +0:403 dPdy ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r015' ( temp 2X2 matrix of float) +0:403 dPdyCoarse ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r016' ( temp 2X2 matrix of float) +0:403 dPdyFine ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r017' ( temp 2X2 matrix of float) +0:403 degrees ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp float) +0:403 'r018' ( temp float) +0:403 determinant ( temp float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r019' ( temp 2X2 matrix of float) +0:403 exp ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'R020' ( temp 2X2 matrix of float) +0:403 exp2 ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r021' ( temp 2X2 matrix of float) +0:403 Floor ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r022' ( temp 2X2 matrix of float) +0:403 mod ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r023' ( temp 2X2 matrix of float) +0:403 Fraction ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r025' ( temp 2X2 matrix of float) +0:403 fwidth ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r026' ( temp 2X2 matrix of float) +0:403 ldexp ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r026a' ( temp 2X2 matrix of float) +0:403 mix ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 'inF2' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r027' ( temp 2X2 matrix of float) +0:403 log ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r028' ( temp 2X2 matrix of float) +0:403 matrix-scale ( temp 2X2 matrix of float) +0:403 log2 ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Constant: +0:403 0.301030 +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r029' ( temp 2X2 matrix of float) +0:403 log2 ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r030' ( temp 2X2 matrix of float) +0:403 max ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r031' ( temp 2X2 matrix of float) +0:403 min ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r032' ( temp 2X2 matrix of float) +0:403 pow ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r033' ( temp 2X2 matrix of float) +0:403 radians ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r034' ( temp 2X2 matrix of float) +0:403 roundEven ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r035' ( temp 2X2 matrix of float) +0:403 inverse sqrt ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r036' ( temp 2X2 matrix of float) +0:403 clamp ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Constant: +0:403 0.000000 +0:403 Constant: +0:403 1.000000 +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r037' ( temp 2X2 matrix of float) +0:403 Sign ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r038' ( temp 2X2 matrix of float) +0:403 sine ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 sine ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'inF2' ( in 2X2 matrix of float) +0:403 cosine ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r039' ( temp 2X2 matrix of float) +0:403 hyp. sine ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r049' ( temp 2X2 matrix of float) +0:403 smoothstep ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 'inF2' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r041' ( temp 2X2 matrix of float) +0:403 sqrt ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r042' ( temp 2X2 matrix of float) +0:403 step ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r043' ( temp 2X2 matrix of float) +0:403 tangent ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r044' ( temp 2X2 matrix of float) +0:403 hyp. tangent ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 transpose ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r046' ( temp 2X2 matrix of float) +0:403 trunc ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:406 Branch: Return with expression +0:? Constant: +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:410 Function Definition: PixelShaderFunction3x3(mf33;mf33;mf33; ( temp 3X3 matrix of float) +0:410 Function Parameters: +0:410 'inF0' ( in 3X3 matrix of float) +0:410 'inF1' ( in 3X3 matrix of float) +0:410 'inF2' ( in 3X3 matrix of float) +0:? Sequence +0:412 Sequence +0:412 move second child to first child ( temp bool) +0:412 'r000' ( temp bool) +0:412 all ( temp bool) +0:412 Convert float to bool ( temp 3X3 matrix of bool) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r001' ( temp 3X3 matrix of float) +0:412 Absolute value ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 arc cosine ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp bool) +0:412 'r003' ( temp bool) +0:412 any ( temp bool) +0:412 Convert float to bool ( temp 3X3 matrix of bool) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r004' ( temp 3X3 matrix of float) +0:412 arc sine ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r005' ( temp 3X3 matrix of float) +0:412 arc tangent ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r006' ( temp 3X3 matrix of float) +0:412 arc tangent ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r007' ( temp 3X3 matrix of float) +0:412 Ceiling ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Test condition and select ( temp void) +0:412 Condition +0:412 any ( temp bool) +0:412 Compare Less Than ( temp 3X3 matrix of bool) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Constant: +0:412 0.000000 +0:412 0.000000 +0:412 0.000000 +0:412 0.000000 +0:412 0.000000 +0:412 0.000000 +0:412 0.000000 +0:412 0.000000 +0:412 0.000000 +0:412 true case +0:412 Branch: Kill +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r008' ( temp 3X3 matrix of float) +0:412 clamp ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 'inF2' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r009' ( temp 3X3 matrix of float) +0:412 cosine ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r010' ( temp 3X3 matrix of float) +0:412 hyp. cosine ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r011' ( temp 3X3 matrix of float) +0:412 dPdx ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r012' ( temp 3X3 matrix of float) +0:412 dPdxCoarse ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r013' ( temp 3X3 matrix of float) +0:412 dPdxFine ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r014' ( temp 3X3 matrix of float) +0:412 dPdy ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r015' ( temp 3X3 matrix of float) +0:412 dPdyCoarse ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r016' ( temp 3X3 matrix of float) +0:412 dPdyFine ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r017' ( temp 3X3 matrix of float) +0:412 degrees ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp float) +0:412 'r018' ( temp float) +0:412 determinant ( temp float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r019' ( temp 3X3 matrix of float) +0:412 exp ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'R020' ( temp 3X3 matrix of float) +0:412 exp2 ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r021' ( temp 3X3 matrix of float) +0:412 Floor ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r022' ( temp 3X3 matrix of float) +0:412 mod ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r023' ( temp 3X3 matrix of float) +0:412 Fraction ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r025' ( temp 3X3 matrix of float) +0:412 fwidth ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r026' ( temp 3X3 matrix of float) +0:412 ldexp ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r026a' ( temp 3X3 matrix of float) +0:412 mix ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 'inF2' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r027' ( temp 3X3 matrix of float) +0:412 log ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r028' ( temp 3X3 matrix of float) +0:412 matrix-scale ( temp 3X3 matrix of float) +0:412 log2 ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Constant: +0:412 0.301030 +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r029' ( temp 3X3 matrix of float) +0:412 log2 ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r030' ( temp 3X3 matrix of float) +0:412 max ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r031' ( temp 3X3 matrix of float) +0:412 min ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r032' ( temp 3X3 matrix of float) +0:412 pow ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r033' ( temp 3X3 matrix of float) +0:412 radians ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r034' ( temp 3X3 matrix of float) +0:412 roundEven ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r035' ( temp 3X3 matrix of float) +0:412 inverse sqrt ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r036' ( temp 3X3 matrix of float) +0:412 clamp ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Constant: +0:412 0.000000 +0:412 Constant: +0:412 1.000000 +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r037' ( temp 3X3 matrix of float) +0:412 Sign ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r038' ( temp 3X3 matrix of float) +0:412 sine ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 sine ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'inF2' ( in 3X3 matrix of float) +0:412 cosine ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r039' ( temp 3X3 matrix of float) +0:412 hyp. sine ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r049' ( temp 3X3 matrix of float) +0:412 smoothstep ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 'inF2' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r041' ( temp 3X3 matrix of float) +0:412 sqrt ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r042' ( temp 3X3 matrix of float) +0:412 step ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r043' ( temp 3X3 matrix of float) +0:412 tangent ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r044' ( temp 3X3 matrix of float) +0:412 hyp. tangent ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 transpose ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r046' ( temp 3X3 matrix of float) +0:412 trunc ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:415 Branch: Return with expression +0:? Constant: +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:419 Function Definition: PixelShaderFunction4x4(mf44;mf44;mf44; ( temp 4X4 matrix of float) +0:419 Function Parameters: +0:419 'inF0' ( in 4X4 matrix of float) +0:419 'inF1' ( in 4X4 matrix of float) +0:419 'inF2' ( in 4X4 matrix of float) +0:? Sequence +0:421 Sequence +0:421 move second child to first child ( temp bool) +0:421 'r000' ( temp bool) +0:421 all ( temp bool) +0:421 Convert float to bool ( temp 4X4 matrix of bool) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r001' ( temp 4X4 matrix of float) +0:421 Absolute value ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 arc cosine ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp bool) +0:421 'r003' ( temp bool) +0:421 any ( temp bool) +0:421 Convert float to bool ( temp 4X4 matrix of bool) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r004' ( temp 4X4 matrix of float) +0:421 arc sine ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r005' ( temp 4X4 matrix of float) +0:421 arc tangent ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r006' ( temp 4X4 matrix of float) +0:421 arc tangent ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r007' ( temp 4X4 matrix of float) +0:421 Ceiling ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Test condition and select ( temp void) +0:421 Condition +0:421 any ( temp bool) +0:421 Compare Less Than ( temp 4X4 matrix of bool) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Constant: +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 true case +0:421 Branch: Kill +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r008' ( temp 4X4 matrix of float) +0:421 clamp ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 'inF2' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r009' ( temp 4X4 matrix of float) +0:421 cosine ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r010' ( temp 4X4 matrix of float) +0:421 hyp. cosine ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r011' ( temp 4X4 matrix of float) +0:421 dPdx ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r012' ( temp 4X4 matrix of float) +0:421 dPdxCoarse ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r013' ( temp 4X4 matrix of float) +0:421 dPdxFine ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r014' ( temp 4X4 matrix of float) +0:421 dPdy ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r015' ( temp 4X4 matrix of float) +0:421 dPdyCoarse ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r016' ( temp 4X4 matrix of float) +0:421 dPdyFine ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r017' ( temp 4X4 matrix of float) +0:421 degrees ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp float) +0:421 'r018' ( temp float) +0:421 determinant ( temp float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r019' ( temp 4X4 matrix of float) +0:421 exp ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'R020' ( temp 4X4 matrix of float) +0:421 exp2 ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r021' ( temp 4X4 matrix of float) +0:421 Floor ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r022' ( temp 4X4 matrix of float) +0:421 mod ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r023' ( temp 4X4 matrix of float) +0:421 Fraction ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r025' ( temp 4X4 matrix of float) +0:421 fwidth ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r026' ( temp 4X4 matrix of float) +0:421 ldexp ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r026a' ( temp 4X4 matrix of float) +0:421 mix ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 'inF2' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r027' ( temp 4X4 matrix of float) +0:421 log ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r028' ( temp 4X4 matrix of float) +0:421 matrix-scale ( temp 4X4 matrix of float) +0:421 log2 ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Constant: +0:421 0.301030 +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r029' ( temp 4X4 matrix of float) +0:421 log2 ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r030' ( temp 4X4 matrix of float) +0:421 max ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r031' ( temp 4X4 matrix of float) +0:421 min ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r032' ( temp 4X4 matrix of float) +0:421 pow ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r033' ( temp 4X4 matrix of float) +0:421 radians ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r034' ( temp 4X4 matrix of float) +0:421 roundEven ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r035' ( temp 4X4 matrix of float) +0:421 inverse sqrt ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r036' ( temp 4X4 matrix of float) +0:421 clamp ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Constant: +0:421 0.000000 +0:421 Constant: +0:421 1.000000 +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r037' ( temp 4X4 matrix of float) +0:421 Sign ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r038' ( temp 4X4 matrix of float) +0:421 sine ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 sine ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'inF2' ( in 4X4 matrix of float) +0:421 cosine ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r039' ( temp 4X4 matrix of float) +0:421 hyp. sine ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r049' ( temp 4X4 matrix of float) +0:421 smoothstep ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 'inF2' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r041' ( temp 4X4 matrix of float) +0:421 sqrt ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r042' ( temp 4X4 matrix of float) +0:421 step ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r043' ( temp 4X4 matrix of float) +0:421 tangent ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r044' ( temp 4X4 matrix of float) +0:421 hyp. tangent ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 transpose ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r046' ( temp 4X4 matrix of float) +0:421 trunc ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:424 Branch: Return with expression +0:? Constant: +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:442 Function Definition: TestGenMul2(f1;f1;vf2;vf2;mf22;mf22; ( temp void) +0:442 Function Parameters: +0:442 'inF0' ( in float) +0:442 'inF1' ( in float) +0:442 'inFV0' ( in 2-component vector of float) +0:442 'inFV1' ( in 2-component vector of float) +0:442 'inFM0' ( in 2X2 matrix of float) +0:442 'inFM1' ( in 2X2 matrix of float) +0:? Sequence +0:443 Sequence +0:443 move second child to first child ( temp float) +0:443 'r0' ( temp float) +0:443 component-wise multiply ( temp float) +0:443 'inF1' ( in float) +0:443 'inF0' ( in float) +0:443 Sequence +0:443 move second child to first child ( temp 2-component vector of float) +0:443 'r1' ( temp 2-component vector of float) +0:443 vector-scale ( temp 2-component vector of float) +0:443 'inF0' ( in float) +0:443 'inFV0' ( in 2-component vector of float) +0:443 Sequence +0:443 move second child to first child ( temp 2-component vector of float) +0:443 'r2' ( temp 2-component vector of float) +0:443 vector-scale ( temp 2-component vector of float) +0:443 'inFV0' ( in 2-component vector of float) +0:443 'inF0' ( in float) +0:443 Sequence +0:443 move second child to first child ( temp float) +0:443 'r3' ( temp float) +0:443 dot-product ( temp float) +0:443 'inFV0' ( in 2-component vector of float) +0:443 'inFV1' ( in 2-component vector of float) +0:443 Sequence +0:443 move second child to first child ( temp 2-component vector of float) +0:443 'r4' ( temp 2-component vector of float) +0:443 vector-times-matrix ( temp 2-component vector of float) +0:443 'inFV0' ( in 2-component vector of float) +0:443 'inFM0' ( in 2X2 matrix of float) +0:443 Sequence +0:443 move second child to first child ( temp 2-component vector of float) +0:443 'r5' ( temp 2-component vector of float) +0:443 matrix-times-vector ( temp 2-component vector of float) +0:443 'inFM0' ( in 2X2 matrix of float) +0:443 'inFV0' ( in 2-component vector of float) +0:443 Sequence +0:443 move second child to first child ( temp 2X2 matrix of float) +0:443 'r6' ( temp 2X2 matrix of float) +0:443 matrix-scale ( temp 2X2 matrix of float) +0:443 'inF0' ( in float) +0:443 'inFM0' ( in 2X2 matrix of float) +0:443 Sequence +0:443 move second child to first child ( temp 2X2 matrix of float) +0:443 'r7' ( temp 2X2 matrix of float) +0:443 matrix-scale ( temp 2X2 matrix of float) +0:443 'inFM0' ( in 2X2 matrix of float) +0:443 'inF0' ( in float) +0:443 Sequence +0:443 move second child to first child ( temp 2X2 matrix of float) +0:443 'r8' ( temp 2X2 matrix of float) +0:443 matrix-multiply ( temp 2X2 matrix of float) +0:443 'inFM1' ( in 2X2 matrix of float) +0:443 'inFM0' ( in 2X2 matrix of float) +0:449 Function Definition: TestGenMul3(f1;f1;vf3;vf3;mf33;mf33; ( temp void) +0:449 Function Parameters: +0:449 'inF0' ( in float) +0:449 'inF1' ( in float) +0:449 'inFV0' ( in 3-component vector of float) +0:449 'inFV1' ( in 3-component vector of float) +0:449 'inFM0' ( in 3X3 matrix of float) +0:449 'inFM1' ( in 3X3 matrix of float) +0:? Sequence +0:450 Sequence +0:450 move second child to first child ( temp float) +0:450 'r0' ( temp float) +0:450 component-wise multiply ( temp float) +0:450 'inF1' ( in float) +0:450 'inF0' ( in float) +0:450 Sequence +0:450 move second child to first child ( temp 3-component vector of float) +0:450 'r1' ( temp 3-component vector of float) +0:450 vector-scale ( temp 3-component vector of float) +0:450 'inF0' ( in float) +0:450 'inFV0' ( in 3-component vector of float) +0:450 Sequence +0:450 move second child to first child ( temp 3-component vector of float) +0:450 'r2' ( temp 3-component vector of float) +0:450 vector-scale ( temp 3-component vector of float) +0:450 'inFV0' ( in 3-component vector of float) +0:450 'inF0' ( in float) +0:450 Sequence +0:450 move second child to first child ( temp float) +0:450 'r3' ( temp float) +0:450 dot-product ( temp float) +0:450 'inFV0' ( in 3-component vector of float) +0:450 'inFV1' ( in 3-component vector of float) +0:450 Sequence +0:450 move second child to first child ( temp 3-component vector of float) +0:450 'r4' ( temp 3-component vector of float) +0:450 vector-times-matrix ( temp 3-component vector of float) +0:450 'inFV0' ( in 3-component vector of float) +0:450 'inFM0' ( in 3X3 matrix of float) +0:450 Sequence +0:450 move second child to first child ( temp 3-component vector of float) +0:450 'r5' ( temp 3-component vector of float) +0:450 matrix-times-vector ( temp 3-component vector of float) +0:450 'inFM0' ( in 3X3 matrix of float) +0:450 'inFV0' ( in 3-component vector of float) +0:450 Sequence +0:450 move second child to first child ( temp 3X3 matrix of float) +0:450 'r6' ( temp 3X3 matrix of float) +0:450 matrix-scale ( temp 3X3 matrix of float) +0:450 'inF0' ( in float) +0:450 'inFM0' ( in 3X3 matrix of float) +0:450 Sequence +0:450 move second child to first child ( temp 3X3 matrix of float) +0:450 'r7' ( temp 3X3 matrix of float) +0:450 matrix-scale ( temp 3X3 matrix of float) +0:450 'inFM0' ( in 3X3 matrix of float) +0:450 'inF0' ( in float) +0:450 Sequence +0:450 move second child to first child ( temp 3X3 matrix of float) +0:450 'r8' ( temp 3X3 matrix of float) +0:450 matrix-multiply ( temp 3X3 matrix of float) +0:450 'inFM1' ( in 3X3 matrix of float) +0:450 'inFM0' ( in 3X3 matrix of float) +0:456 Function Definition: TestGenMul4(f1;f1;vf4;vf4;mf44;mf44; ( temp void) +0:456 Function Parameters: +0:456 'inF0' ( in float) +0:456 'inF1' ( in float) +0:456 'inFV0' ( in 4-component vector of float) +0:456 'inFV1' ( in 4-component vector of float) +0:456 'inFM0' ( in 4X4 matrix of float) +0:456 'inFM1' ( in 4X4 matrix of float) +0:? Sequence +0:457 Sequence +0:457 move second child to first child ( temp float) +0:457 'r0' ( temp float) +0:457 component-wise multiply ( temp float) +0:457 'inF1' ( in float) +0:457 'inF0' ( in float) +0:457 Sequence +0:457 move second child to first child ( temp 4-component vector of float) +0:457 'r1' ( temp 4-component vector of float) +0:457 vector-scale ( temp 4-component vector of float) +0:457 'inF0' ( in float) +0:457 'inFV0' ( in 4-component vector of float) +0:457 Sequence +0:457 move second child to first child ( temp 4-component vector of float) +0:457 'r2' ( temp 4-component vector of float) +0:457 vector-scale ( temp 4-component vector of float) +0:457 'inFV0' ( in 4-component vector of float) +0:457 'inF0' ( in float) +0:457 Sequence +0:457 move second child to first child ( temp float) +0:457 'r3' ( temp float) +0:457 dot-product ( temp float) +0:457 'inFV0' ( in 4-component vector of float) +0:457 'inFV1' ( in 4-component vector of float) +0:457 Sequence +0:457 move second child to first child ( temp 4-component vector of float) +0:457 'r4' ( temp 4-component vector of float) +0:457 vector-times-matrix ( temp 4-component vector of float) +0:457 'inFV0' ( in 4-component vector of float) +0:457 'inFM0' ( in 4X4 matrix of float) +0:457 Sequence +0:457 move second child to first child ( temp 4-component vector of float) +0:457 'r5' ( temp 4-component vector of float) +0:457 matrix-times-vector ( temp 4-component vector of float) +0:457 'inFM0' ( in 4X4 matrix of float) +0:457 'inFV0' ( in 4-component vector of float) +0:457 Sequence +0:457 move second child to first child ( temp 4X4 matrix of float) +0:457 'r6' ( temp 4X4 matrix of float) +0:457 matrix-scale ( temp 4X4 matrix of float) +0:457 'inF0' ( in float) +0:457 'inFM0' ( in 4X4 matrix of float) +0:457 Sequence +0:457 move second child to first child ( temp 4X4 matrix of float) +0:457 'r7' ( temp 4X4 matrix of float) +0:457 matrix-scale ( temp 4X4 matrix of float) +0:457 'inFM0' ( in 4X4 matrix of float) +0:457 'inF0' ( in float) +0:457 Sequence +0:457 move second child to first child ( temp 4X4 matrix of float) +0:457 'r8' ( temp 4X4 matrix of float) +0:457 matrix-multiply ( temp 4X4 matrix of float) +0:457 'inFM1' ( in 4X4 matrix of float) +0:457 'inFM0' ( in 4X4 matrix of float) +0:466 Function Definition: TestGenMulNxM(f1;f1;vf2;vf3;mf23;mf32;mf33;mf34;mf24; ( temp void) +0:466 Function Parameters: +0:466 'inF0' ( in float) +0:466 'inF1' ( in float) +0:466 'inFV2' ( in 2-component vector of float) +0:466 'inFV3' ( in 3-component vector of float) +0:466 'inFM2x3' ( in 2X3 matrix of float) +0:466 'inFM3x2' ( in 3X2 matrix of float) +0:466 'inFM3x3' ( in 3X3 matrix of float) +0:466 'inFM3x4' ( in 3X4 matrix of float) +0:466 'inFM2x4' ( in 2X4 matrix of float) +0:? Sequence +0:467 Sequence +0:467 move second child to first child ( temp float) +0:467 'r00' ( temp float) +0:467 component-wise multiply ( temp float) +0:467 'inF1' ( in float) +0:467 'inF0' ( in float) +0:468 Sequence +0:468 move second child to first child ( temp 2-component vector of float) +0:468 'r01' ( temp 2-component vector of float) +0:468 vector-scale ( temp 2-component vector of float) +0:468 'inF0' ( in float) +0:468 'inFV2' ( in 2-component vector of float) +0:469 Sequence +0:469 move second child to first child ( temp 3-component vector of float) +0:469 'r02' ( temp 3-component vector of float) +0:469 vector-scale ( temp 3-component vector of float) +0:469 'inF0' ( in float) +0:469 'inFV3' ( in 3-component vector of float) +0:470 Sequence +0:470 move second child to first child ( temp 2-component vector of float) +0:470 'r03' ( temp 2-component vector of float) +0:470 vector-scale ( temp 2-component vector of float) +0:470 'inFV2' ( in 2-component vector of float) +0:470 'inF0' ( in float) +0:471 Sequence +0:471 move second child to first child ( temp 3-component vector of float) +0:471 'r04' ( temp 3-component vector of float) +0:471 vector-scale ( temp 3-component vector of float) +0:471 'inFV3' ( in 3-component vector of float) +0:471 'inF0' ( in float) +0:472 Sequence +0:472 move second child to first child ( temp float) +0:472 'r05' ( temp float) +0:472 dot-product ( temp float) +0:472 'inFV2' ( in 2-component vector of float) +0:472 'inFV2' ( in 2-component vector of float) +0:473 Sequence +0:473 move second child to first child ( temp float) +0:473 'r06' ( temp float) +0:473 dot-product ( temp float) +0:473 'inFV3' ( in 3-component vector of float) +0:473 'inFV3' ( in 3-component vector of float) +0:474 Sequence +0:474 move second child to first child ( temp 3-component vector of float) +0:474 'r07' ( temp 3-component vector of float) +0:474 matrix-times-vector ( temp 3-component vector of float) +0:474 'inFM2x3' ( in 2X3 matrix of float) +0:474 'inFV2' ( in 2-component vector of float) +0:475 Sequence +0:475 move second child to first child ( temp 2-component vector of float) +0:475 'r08' ( temp 2-component vector of float) +0:475 matrix-times-vector ( temp 2-component vector of float) +0:475 'inFM3x2' ( in 3X2 matrix of float) +0:475 'inFV3' ( in 3-component vector of float) +0:476 Sequence +0:476 move second child to first child ( temp 2-component vector of float) +0:476 'r09' ( temp 2-component vector of float) +0:476 vector-times-matrix ( temp 2-component vector of float) +0:476 'inFV3' ( in 3-component vector of float) +0:476 'inFM2x3' ( in 2X3 matrix of float) +0:477 Sequence +0:477 move second child to first child ( temp 3-component vector of float) +0:477 'r10' ( temp 3-component vector of float) +0:477 vector-times-matrix ( temp 3-component vector of float) +0:477 'inFV2' ( in 2-component vector of float) +0:477 'inFM3x2' ( in 3X2 matrix of float) +0:478 Sequence +0:478 move second child to first child ( temp 2X3 matrix of float) +0:478 'r11' ( temp 2X3 matrix of float) +0:478 matrix-scale ( temp 2X3 matrix of float) +0:478 'inF0' ( in float) +0:478 'inFM2x3' ( in 2X3 matrix of float) +0:479 Sequence +0:479 move second child to first child ( temp 3X2 matrix of float) +0:479 'r12' ( temp 3X2 matrix of float) +0:479 matrix-scale ( temp 3X2 matrix of float) +0:479 'inF0' ( in float) +0:479 'inFM3x2' ( in 3X2 matrix of float) +0:480 Sequence +0:480 move second child to first child ( temp 2X2 matrix of float) +0:480 'r13' ( temp 2X2 matrix of float) +0:480 matrix-multiply ( temp 2X2 matrix of float) +0:480 'inFM3x2' ( in 3X2 matrix of float) +0:480 'inFM2x3' ( in 2X3 matrix of float) +0:481 Sequence +0:481 move second child to first child ( temp 2X3 matrix of float) +0:481 'r14' ( temp 2X3 matrix of float) +0:481 matrix-multiply ( temp 2X3 matrix of float) +0:481 'inFM3x3' ( in 3X3 matrix of float) +0:481 'inFM2x3' ( in 2X3 matrix of float) +0:482 Sequence +0:482 move second child to first child ( temp 2X4 matrix of float) +0:482 'r15' ( temp 2X4 matrix of float) +0:482 matrix-multiply ( temp 2X4 matrix of float) +0:482 'inFM3x4' ( in 3X4 matrix of float) +0:482 'inFM2x3' ( in 2X3 matrix of float) +0:483 Sequence +0:483 move second child to first child ( temp 3X4 matrix of float) +0:483 'r16' ( temp 3X4 matrix of float) +0:483 matrix-multiply ( temp 3X4 matrix of float) +0:483 'inFM2x4' ( in 2X4 matrix of float) +0:483 'inFM3x2' ( in 3X2 matrix of float) +0:489 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:489 Function Parameters: +0:? Sequence +0:491 move second child to first child ( temp 4-component vector of float) +0:491 color: direct index for structure ( temp 4-component vector of float) +0:491 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:491 Constant: +0:491 0 (const int) +0:491 Constant: +0:491 1.000000 +0:491 1.000000 +0:491 1.000000 +0:491 1.000000 +0:492 Branch: Return with expression +0:492 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:489 Function Definition: main( ( temp void) +0:489 Function Parameters: +0:? Sequence +0:489 Sequence +0:489 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:489 color: direct index for structure ( temp 4-component vector of float) +0:489 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:489 Constant: +0:489 0 (const int) +0:? Linker Objects +0:? 'gs_ua' ( shared uint) +0:? 'gs_ub' ( shared uint) +0:? 'gs_uc' ( shared uint) +0:? 'gs_ua2' ( shared 2-component vector of uint) +0:? 'gs_ub2' ( shared 2-component vector of uint) +0:? 'gs_uc2' ( shared 2-component vector of uint) +0:? 'gs_ua3' ( shared 3-component vector of uint) +0:? 'gs_ub3' ( shared 3-component vector of uint) +0:? 'gs_uc3' ( shared 3-component vector of uint) +0:? 'gs_ua4' ( shared 4-component vector of uint) +0:? 'gs_ub4' ( shared 4-component vector of uint) +0:? 'gs_uc4' ( shared 4-component vector of uint) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:17 Function Definition: PixelShaderFunctionS(f1;f1;f1;u1;i1; ( temp float) +0:17 Function Parameters: +0:17 'inF0' ( in float) +0:17 'inF1' ( in float) +0:17 'inF2' ( in float) +0:17 'inU0' ( in uint) +0:17 'inU1' ( in int) +0:? Sequence +0:20 Sequence +0:20 move second child to first child ( temp bool) +0:20 'r000' ( temp bool) +0:20 all ( temp bool) +0:20 Convert float to bool ( temp bool) +0:20 'inF0' ( in float) +0:21 Sequence +0:21 move second child to first child ( temp float) +0:21 'r001' ( temp float) +0:21 Absolute value ( temp float) +0:21 'inF0' ( in float) +0:22 Sequence +0:22 move second child to first child ( temp float) +0:22 'r002' ( temp float) +0:22 arc cosine ( temp float) +0:22 'inF0' ( in float) +0:23 Sequence +0:23 move second child to first child ( temp bool) +0:23 'r003' ( temp bool) +0:23 any ( temp bool) +0:23 Convert float to bool ( temp bool) +0:23 'inF0' ( in float) +0:24 Sequence +0:24 move second child to first child ( temp float) +0:24 'r004' ( temp float) +0:24 arc sine ( temp float) +0:24 'inF0' ( in float) +0:25 Sequence +0:25 move second child to first child ( temp int) +0:25 'r005' ( temp int) +0:25 floatBitsToInt ( temp int) +0:25 'inF0' ( in float) +0:26 Sequence +0:26 move second child to first child ( temp uint) +0:26 'r006' ( temp uint) +0:26 floatBitsToUint ( temp uint) +0:26 'inU1' ( in int) +0:27 Sequence +0:27 move second child to first child ( temp float) +0:27 'r007' ( temp float) +0:27 intBitsToFloat ( temp float) +0:27 'inU0' ( in uint) +0:29 Sequence +0:29 move second child to first child ( temp float) +0:29 'r009' ( temp float) +0:29 arc tangent ( temp float) +0:29 'inF0' ( in float) +0:30 Sequence +0:30 move second child to first child ( temp float) +0:30 'r010' ( temp float) +0:30 arc tangent ( temp float) +0:30 'inF0' ( in float) +0:30 'inF1' ( in float) +0:31 Sequence +0:31 move second child to first child ( temp float) +0:31 'r011' ( temp float) +0:31 Ceiling ( temp float) +0:31 'inF0' ( in float) +0:32 Sequence +0:32 move second child to first child ( temp float) +0:32 'r012' ( temp float) +0:32 clamp ( temp float) +0:32 'inF0' ( in float) +0:32 'inF1' ( in float) +0:32 'inF2' ( in float) +0:33 Test condition and select ( temp void) +0:33 Condition +0:33 Compare Less Than ( temp bool) +0:33 'inF0' ( in float) +0:33 Constant: +0:33 0.000000 +0:33 true case +0:33 Branch: Kill +0:34 Test condition and select ( temp void) +0:34 Condition +0:34 Compare Less Than ( temp bool) +0:34 'r005' ( temp int) +0:34 Constant: +0:34 0 (const int) +0:34 true case +0:34 Branch: Kill +0:35 Sequence +0:35 move second child to first child ( temp float) +0:35 'r014' ( temp float) +0:35 cosine ( temp float) +0:35 'inF0' ( in float) +0:36 Sequence +0:36 move second child to first child ( temp float) +0:36 'r015' ( temp float) +0:36 hyp. cosine ( temp float) +0:36 'inF0' ( in float) +0:37 Sequence +0:37 move second child to first child ( temp int) +0:37 'r016' ( temp int) +0:37 bitCount ( temp int) +0:37 Constant: +0:37 7 (const int) +0:38 Sequence +0:38 move second child to first child ( temp float) +0:38 'r017' ( temp float) +0:38 dPdx ( temp float) +0:38 'inF0' ( in float) +0:39 Sequence +0:39 move second child to first child ( temp float) +0:39 'r018' ( temp float) +0:39 dPdxCoarse ( temp float) +0:39 'inF0' ( in float) +0:40 Sequence +0:40 move second child to first child ( temp float) +0:40 'r019' ( temp float) +0:40 dPdxFine ( temp float) +0:40 'inF0' ( in float) +0:41 Sequence +0:41 move second child to first child ( temp float) +0:41 'r020' ( temp float) +0:41 dPdy ( temp float) +0:41 'inF0' ( in float) +0:42 Sequence +0:42 move second child to first child ( temp float) +0:42 'r021' ( temp float) +0:42 dPdyCoarse ( temp float) +0:42 'inF0' ( in float) +0:43 Sequence +0:43 move second child to first child ( temp float) +0:43 'r022' ( temp float) +0:43 dPdyFine ( temp float) +0:43 'inF0' ( in float) +0:44 Sequence +0:44 move second child to first child ( temp float) +0:44 'r023' ( temp float) +0:44 degrees ( temp float) +0:44 'inF0' ( in float) +0:45 Sequence +0:45 move second child to first child ( temp float) +0:45 'r024' ( temp float) +0:45 distance ( temp float) +0:45 'inF0' ( in float) +0:45 'inF1' ( in float) +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'r027' ( temp float) +0:49 exp ( temp float) +0:49 'inF0' ( in float) +0:50 Sequence +0:50 move second child to first child ( temp float) +0:50 'r028' ( temp float) +0:50 exp2 ( temp float) +0:50 'inF0' ( in float) +0:51 Sequence +0:51 move second child to first child ( temp uint) +0:51 'r029' ( temp uint) +0:51 Convert int to uint ( temp uint) +0:51 findMSB ( temp int) +0:51 Constant: +0:51 7 (const int) +0:52 Sequence +0:52 move second child to first child ( temp uint) +0:52 'r030' ( temp uint) +0:52 Convert int to uint ( temp uint) +0:52 findLSB ( temp int) +0:52 Constant: +0:52 7 (const int) +0:53 Sequence +0:53 move second child to first child ( temp float) +0:53 'r031' ( temp float) +0:53 Floor ( temp float) +0:53 'inF0' ( in float) +0:55 Sequence +0:55 move second child to first child ( temp float) +0:55 'r033' ( temp float) +0:55 mod ( temp float) +0:55 'inF0' ( in float) +0:55 'inF1' ( in float) +0:56 Sequence +0:56 move second child to first child ( temp float) +0:56 'r034' ( temp float) +0:56 Fraction ( temp float) +0:56 'inF0' ( in float) +0:57 Sequence +0:57 move second child to first child ( temp float) +0:57 'r036' ( temp float) +0:57 fwidth ( temp float) +0:57 'inF0' ( in float) +0:58 Sequence +0:58 move second child to first child ( temp bool) +0:58 'r037' ( temp bool) +0:58 isinf ( temp bool) +0:58 'inF0' ( in float) +0:59 Sequence +0:59 move second child to first child ( temp bool) +0:59 'r038' ( temp bool) +0:59 isnan ( temp bool) +0:59 'inF0' ( in float) +0:60 Sequence +0:60 move second child to first child ( temp float) +0:60 'r039' ( temp float) +0:60 ldexp ( temp float) +0:60 'inF0' ( in float) +0:60 'inF1' ( in float) +0:61 Sequence +0:61 move second child to first child ( temp float) +0:61 'r039a' ( temp float) +0:61 mix ( temp float) +0:61 'inF0' ( in float) +0:61 'inF1' ( in float) +0:61 'inF2' ( in float) +0:62 Sequence +0:62 move second child to first child ( temp float) +0:62 'r040' ( temp float) +0:62 log ( temp float) +0:62 'inF0' ( in float) +0:63 Sequence +0:63 move second child to first child ( temp float) +0:63 'r041' ( temp float) +0:63 component-wise multiply ( temp float) +0:63 log2 ( temp float) +0:63 'inF0' ( in float) +0:63 Constant: +0:63 0.301030 +0:64 Sequence +0:64 move second child to first child ( temp float) +0:64 'r042' ( temp float) +0:64 log2 ( temp float) +0:64 'inF0' ( in float) +0:65 Sequence +0:65 move second child to first child ( temp float) +0:65 'r043' ( temp float) +0:65 max ( temp float) +0:65 'inF0' ( in float) +0:65 'inF1' ( in float) +0:66 Sequence +0:66 move second child to first child ( temp float) +0:66 'r044' ( temp float) +0:66 min ( temp float) +0:66 'inF0' ( in float) +0:66 'inF1' ( in float) +0:67 Sequence +0:67 move second child to first child ( temp float) +0:67 'r045' ( temp float) +0:67 pow ( temp float) +0:67 'inF0' ( in float) +0:67 'inF1' ( in float) +0:68 Sequence +0:68 move second child to first child ( temp float) +0:68 'r046' ( temp float) +0:68 radians ( temp float) +0:68 'inF0' ( in float) +0:69 Sequence +0:69 move second child to first child ( temp float) +0:69 'r047' ( temp float) +0:69 divide ( temp float) +0:69 Constant: +0:69 1.000000 +0:69 'inF0' ( in float) +0:70 Sequence +0:70 move second child to first child ( temp uint) +0:70 'r048' ( temp uint) +0:70 Convert int to uint ( temp uint) +0:70 bitFieldReverse ( temp int) +0:70 Constant: +0:70 2 (const int) +0:71 Sequence +0:71 move second child to first child ( temp float) +0:71 'r049' ( temp float) +0:71 roundEven ( temp float) +0:71 'inF0' ( in float) +0:72 Sequence +0:72 move second child to first child ( temp float) +0:72 'r050' ( temp float) +0:72 inverse sqrt ( temp float) +0:72 'inF0' ( in float) +0:73 Sequence +0:73 move second child to first child ( temp float) +0:73 'r051' ( temp float) +0:73 clamp ( temp float) +0:73 'inF0' ( in float) +0:73 Constant: +0:73 0.000000 +0:73 Constant: +0:73 1.000000 +0:74 Sequence +0:74 move second child to first child ( temp float) +0:74 'r052' ( temp float) +0:74 Sign ( temp float) +0:74 'inF0' ( in float) +0:75 Sequence +0:75 move second child to first child ( temp float) +0:75 'r053' ( temp float) +0:75 sine ( temp float) +0:75 'inF0' ( in float) +0:76 Sequence +0:76 move second child to first child ( temp float) +0:76 'inF1' ( in float) +0:76 sine ( temp float) +0:76 'inF0' ( in float) +0:76 move second child to first child ( temp float) +0:76 'inF2' ( in float) +0:76 cosine ( temp float) +0:76 'inF0' ( in float) +0:77 Sequence +0:77 move second child to first child ( temp float) +0:77 'r055' ( temp float) +0:77 hyp. sine ( temp float) +0:77 'inF0' ( in float) +0:78 Sequence +0:78 move second child to first child ( temp float) +0:78 'r056' ( temp float) +0:78 smoothstep ( temp float) +0:78 'inF0' ( in float) +0:78 'inF1' ( in float) +0:78 'inF2' ( in float) +0:79 Sequence +0:79 move second child to first child ( temp float) +0:79 'r057' ( temp float) +0:79 sqrt ( temp float) +0:79 'inF0' ( in float) +0:80 Sequence +0:80 move second child to first child ( temp float) +0:80 'r058' ( temp float) +0:80 step ( temp float) +0:80 'inF0' ( in float) +0:80 'inF1' ( in float) +0:81 Sequence +0:81 move second child to first child ( temp float) +0:81 'r059' ( temp float) +0:81 tangent ( temp float) +0:81 'inF0' ( in float) +0:82 Sequence +0:82 move second child to first child ( temp float) +0:82 'r060' ( temp float) +0:82 hyp. tangent ( temp float) +0:82 'inF0' ( in float) +0:84 Sequence +0:84 move second child to first child ( temp float) +0:84 'r061' ( temp float) +0:84 trunc ( temp float) +0:84 'inF0' ( in float) +0:86 Branch: Return with expression +0:86 Constant: +0:86 0.000000 +0:90 Function Definition: PixelShaderFunction1(vf1;vf1;vf1; ( temp 1-component vector of float) +0:90 Function Parameters: +0:90 'inF0' ( in 1-component vector of float) +0:90 'inF1' ( in 1-component vector of float) +0:90 'inF2' ( in 1-component vector of float) +0:? Sequence +0:92 Branch: Return with expression +0:92 Constant: +0:92 0.000000 +0:96 Function Definition: PixelShaderFunction2(vf2;vf2;vf2;vu2;vu2; ( temp 2-component vector of float) +0:96 Function Parameters: +0:96 'inF0' ( in 2-component vector of float) +0:96 'inF1' ( in 2-component vector of float) +0:96 'inF2' ( in 2-component vector of float) +0:96 'inU0' ( in 2-component vector of uint) +0:96 'inU1' ( in 2-component vector of uint) +0:? Sequence +0:99 Sequence +0:99 move second child to first child ( temp bool) +0:99 'r000' ( temp bool) +0:99 all ( temp bool) +0:99 Convert float to bool ( temp 2-component vector of bool) +0:99 'inF0' ( in 2-component vector of float) +0:100 Sequence +0:100 move second child to first child ( temp 2-component vector of float) +0:100 'r001' ( temp 2-component vector of float) +0:100 Absolute value ( temp 2-component vector of float) +0:100 'inF0' ( in 2-component vector of float) +0:101 Sequence +0:101 move second child to first child ( temp 2-component vector of float) +0:101 'r002' ( temp 2-component vector of float) +0:101 arc cosine ( temp 2-component vector of float) +0:101 'inF0' ( in 2-component vector of float) +0:102 Sequence +0:102 move second child to first child ( temp bool) +0:102 'r003' ( temp bool) +0:102 any ( temp bool) +0:102 Convert float to bool ( temp 2-component vector of bool) +0:102 'inF0' ( in 2-component vector of float) +0:103 Sequence +0:103 move second child to first child ( temp 2-component vector of float) +0:103 'r004' ( temp 2-component vector of float) +0:103 arc sine ( temp 2-component vector of float) +0:103 'inF0' ( in 2-component vector of float) +0:104 Sequence +0:104 move second child to first child ( temp 2-component vector of int) +0:104 'r005' ( temp 2-component vector of int) +0:104 floatBitsToInt ( temp 2-component vector of int) +0:104 'inF0' ( in 2-component vector of float) +0:105 Sequence +0:105 move second child to first child ( temp 2-component vector of uint) +0:105 'r006' ( temp 2-component vector of uint) +0:105 floatBitsToUint ( temp 2-component vector of uint) +0:105 'inF0' ( in 2-component vector of float) +0:106 Sequence +0:106 move second child to first child ( temp 2-component vector of float) +0:106 'r007' ( temp 2-component vector of float) +0:106 intBitsToFloat ( temp 2-component vector of float) +0:106 'inU0' ( in 2-component vector of uint) +0:108 Sequence +0:108 move second child to first child ( temp 2-component vector of float) +0:108 'r009' ( temp 2-component vector of float) +0:108 arc tangent ( temp 2-component vector of float) +0:108 'inF0' ( in 2-component vector of float) +0:109 Sequence +0:109 move second child to first child ( temp 2-component vector of float) +0:109 'r010' ( temp 2-component vector of float) +0:109 arc tangent ( temp 2-component vector of float) +0:109 'inF0' ( in 2-component vector of float) +0:109 'inF1' ( in 2-component vector of float) +0:110 Sequence +0:110 move second child to first child ( temp 2-component vector of float) +0:110 'r011' ( temp 2-component vector of float) +0:110 Ceiling ( temp 2-component vector of float) +0:110 'inF0' ( in 2-component vector of float) +0:111 Sequence +0:111 move second child to first child ( temp 2-component vector of float) +0:111 'r012' ( temp 2-component vector of float) +0:111 clamp ( temp 2-component vector of float) +0:111 'inF0' ( in 2-component vector of float) +0:111 'inF1' ( in 2-component vector of float) +0:111 'inF2' ( in 2-component vector of float) +0:112 Test condition and select ( temp void) +0:112 Condition +0:112 any ( temp bool) +0:112 Compare Less Than ( temp 2-component vector of bool) +0:112 'inF0' ( in 2-component vector of float) +0:112 Constant: +0:112 0.000000 +0:112 0.000000 +0:112 true case +0:112 Branch: Kill +0:113 Test condition and select ( temp void) +0:113 Condition +0:113 any ( temp bool) +0:113 Compare Less Than ( temp 2-component vector of bool) +0:113 'inU0' ( in 2-component vector of uint) +0:113 Constant: +0:113 0.000000 +0:113 0.000000 +0:113 true case +0:113 Branch: Kill +0:114 Sequence +0:114 move second child to first child ( temp 2-component vector of float) +0:114 'r013' ( temp 2-component vector of float) +0:114 cosine ( temp 2-component vector of float) +0:114 'inF0' ( in 2-component vector of float) +0:115 Sequence +0:115 move second child to first child ( temp 2-component vector of float) +0:115 'r015' ( temp 2-component vector of float) +0:115 hyp. cosine ( temp 2-component vector of float) +0:115 'inF0' ( in 2-component vector of float) +0:116 Sequence +0:116 move second child to first child ( temp 2-component vector of int) +0:116 'r016' ( temp 2-component vector of int) +0:? bitCount ( temp 2-component vector of int) +0:? Constant: +0:? 7 (const int) +0:? 3 (const int) +0:117 Sequence +0:117 move second child to first child ( temp 2-component vector of float) +0:117 'r017' ( temp 2-component vector of float) +0:117 dPdx ( temp 2-component vector of float) +0:117 'inF0' ( in 2-component vector of float) +0:118 Sequence +0:118 move second child to first child ( temp 2-component vector of float) +0:118 'r018' ( temp 2-component vector of float) +0:118 dPdxCoarse ( temp 2-component vector of float) +0:118 'inF0' ( in 2-component vector of float) +0:119 Sequence +0:119 move second child to first child ( temp 2-component vector of float) +0:119 'r019' ( temp 2-component vector of float) +0:119 dPdxFine ( temp 2-component vector of float) +0:119 'inF0' ( in 2-component vector of float) +0:120 Sequence +0:120 move second child to first child ( temp 2-component vector of float) +0:120 'r020' ( temp 2-component vector of float) +0:120 dPdy ( temp 2-component vector of float) +0:120 'inF0' ( in 2-component vector of float) +0:121 Sequence +0:121 move second child to first child ( temp 2-component vector of float) +0:121 'r021' ( temp 2-component vector of float) +0:121 dPdyCoarse ( temp 2-component vector of float) +0:121 'inF0' ( in 2-component vector of float) +0:122 Sequence +0:122 move second child to first child ( temp 2-component vector of float) +0:122 'r022' ( temp 2-component vector of float) +0:122 dPdyFine ( temp 2-component vector of float) +0:122 'inF0' ( in 2-component vector of float) +0:123 Sequence +0:123 move second child to first child ( temp 2-component vector of float) +0:123 'r023' ( temp 2-component vector of float) +0:123 degrees ( temp 2-component vector of float) +0:123 'inF0' ( in 2-component vector of float) +0:127 Sequence +0:127 move second child to first child ( temp float) +0:127 'r026' ( temp float) +0:127 distance ( temp float) +0:127 'inF0' ( in 2-component vector of float) +0:127 'inF1' ( in 2-component vector of float) +0:128 Sequence +0:128 move second child to first child ( temp float) +0:128 'r027' ( temp float) +0:128 dot-product ( temp float) +0:128 'inF0' ( in 2-component vector of float) +0:128 'inF1' ( in 2-component vector of float) +0:132 Sequence +0:132 move second child to first child ( temp 2-component vector of float) +0:132 'r028' ( temp 2-component vector of float) +0:132 exp ( temp 2-component vector of float) +0:132 'inF0' ( in 2-component vector of float) +0:133 Sequence +0:133 move second child to first child ( temp 2-component vector of float) +0:133 'r029' ( temp 2-component vector of float) +0:133 exp2 ( temp 2-component vector of float) +0:133 'inF0' ( in 2-component vector of float) +0:134 Sequence +0:134 move second child to first child ( temp 2-component vector of float) +0:134 'r030' ( temp 2-component vector of float) +0:134 face-forward ( temp 2-component vector of float) +0:134 'inF0' ( in 2-component vector of float) +0:134 'inF1' ( in 2-component vector of float) +0:134 'inF2' ( in 2-component vector of float) +0:135 Sequence +0:135 move second child to first child ( temp 2-component vector of uint) +0:135 'r031' ( temp 2-component vector of uint) +0:? findMSB ( temp 2-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 8 (const uint) +0:136 Sequence +0:136 move second child to first child ( temp 2-component vector of uint) +0:136 'r032' ( temp 2-component vector of uint) +0:? findLSB ( temp 2-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 8 (const uint) +0:137 Sequence +0:137 move second child to first child ( temp 2-component vector of float) +0:137 'r033' ( temp 2-component vector of float) +0:137 Floor ( temp 2-component vector of float) +0:137 'inF0' ( in 2-component vector of float) +0:139 Sequence +0:139 move second child to first child ( temp 2-component vector of float) +0:139 'r035' ( temp 2-component vector of float) +0:139 mod ( temp 2-component vector of float) +0:139 'inF0' ( in 2-component vector of float) +0:139 'inF1' ( in 2-component vector of float) +0:140 Sequence +0:140 move second child to first child ( temp 2-component vector of float) +0:140 'r036' ( temp 2-component vector of float) +0:140 Fraction ( temp 2-component vector of float) +0:140 'inF0' ( in 2-component vector of float) +0:141 Sequence +0:141 move second child to first child ( temp 2-component vector of float) +0:141 'r038' ( temp 2-component vector of float) +0:141 fwidth ( temp 2-component vector of float) +0:141 'inF0' ( in 2-component vector of float) +0:142 Sequence +0:142 move second child to first child ( temp 2-component vector of bool) +0:142 'r039' ( temp 2-component vector of bool) +0:142 isinf ( temp 2-component vector of bool) +0:142 'inF0' ( in 2-component vector of float) +0:143 Sequence +0:143 move second child to first child ( temp 2-component vector of bool) +0:143 'r040' ( temp 2-component vector of bool) +0:143 isnan ( temp 2-component vector of bool) +0:143 'inF0' ( in 2-component vector of float) +0:144 Sequence +0:144 move second child to first child ( temp 2-component vector of float) +0:144 'r041' ( temp 2-component vector of float) +0:144 ldexp ( temp 2-component vector of float) +0:144 'inF0' ( in 2-component vector of float) +0:144 'inF1' ( in 2-component vector of float) +0:145 Sequence +0:145 move second child to first child ( temp 2-component vector of float) +0:145 'r039a' ( temp 2-component vector of float) +0:145 mix ( temp 2-component vector of float) +0:145 'inF0' ( in 2-component vector of float) +0:145 'inF1' ( in 2-component vector of float) +0:145 'inF2' ( in 2-component vector of float) +0:146 Sequence +0:146 move second child to first child ( temp float) +0:146 'r042' ( temp float) +0:146 length ( temp float) +0:146 'inF0' ( in 2-component vector of float) +0:147 Sequence +0:147 move second child to first child ( temp 2-component vector of float) +0:147 'r043' ( temp 2-component vector of float) +0:147 log ( temp 2-component vector of float) +0:147 'inF0' ( in 2-component vector of float) +0:148 Sequence +0:148 move second child to first child ( temp 2-component vector of float) +0:148 'r044' ( temp 2-component vector of float) +0:148 vector-scale ( temp 2-component vector of float) +0:148 log2 ( temp 2-component vector of float) +0:148 'inF0' ( in 2-component vector of float) +0:148 Constant: +0:148 0.301030 +0:149 Sequence +0:149 move second child to first child ( temp 2-component vector of float) +0:149 'r045' ( temp 2-component vector of float) +0:149 log2 ( temp 2-component vector of float) +0:149 'inF0' ( in 2-component vector of float) +0:150 Sequence +0:150 move second child to first child ( temp 2-component vector of float) +0:150 'r046' ( temp 2-component vector of float) +0:150 max ( temp 2-component vector of float) +0:150 'inF0' ( in 2-component vector of float) +0:150 'inF1' ( in 2-component vector of float) +0:151 Sequence +0:151 move second child to first child ( temp 2-component vector of float) +0:151 'r047' ( temp 2-component vector of float) +0:151 min ( temp 2-component vector of float) +0:151 'inF0' ( in 2-component vector of float) +0:151 'inF1' ( in 2-component vector of float) +0:152 Sequence +0:152 move second child to first child ( temp 2-component vector of float) +0:152 'r048' ( temp 2-component vector of float) +0:152 normalize ( temp 2-component vector of float) +0:152 'inF0' ( in 2-component vector of float) +0:153 Sequence +0:153 move second child to first child ( temp 2-component vector of float) +0:153 'r049' ( temp 2-component vector of float) +0:153 pow ( temp 2-component vector of float) +0:153 'inF0' ( in 2-component vector of float) +0:153 'inF1' ( in 2-component vector of float) +0:154 Sequence +0:154 move second child to first child ( temp 2-component vector of float) +0:154 'r050' ( temp 2-component vector of float) +0:154 radians ( temp 2-component vector of float) +0:154 'inF0' ( in 2-component vector of float) +0:155 Sequence +0:155 move second child to first child ( temp 2-component vector of float) +0:155 'r051' ( temp 2-component vector of float) +0:155 divide ( temp 2-component vector of float) +0:155 Constant: +0:155 1.000000 +0:155 'inF0' ( in 2-component vector of float) +0:156 Sequence +0:156 move second child to first child ( temp 2-component vector of float) +0:156 'r052' ( temp 2-component vector of float) +0:156 reflect ( temp 2-component vector of float) +0:156 'inF0' ( in 2-component vector of float) +0:156 'inF1' ( in 2-component vector of float) +0:157 Sequence +0:157 move second child to first child ( temp 2-component vector of float) +0:157 'r053' ( temp 2-component vector of float) +0:157 refract ( temp 2-component vector of float) +0:157 'inF0' ( in 2-component vector of float) +0:157 'inF1' ( in 2-component vector of float) +0:157 Constant: +0:157 2.000000 +0:158 Sequence +0:158 move second child to first child ( temp 2-component vector of uint) +0:158 'r054' ( temp 2-component vector of uint) +0:? bitFieldReverse ( temp 2-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:159 Sequence +0:159 move second child to first child ( temp 2-component vector of float) +0:159 'r055' ( temp 2-component vector of float) +0:159 roundEven ( temp 2-component vector of float) +0:159 'inF0' ( in 2-component vector of float) +0:160 Sequence +0:160 move second child to first child ( temp 2-component vector of float) +0:160 'r056' ( temp 2-component vector of float) +0:160 inverse sqrt ( temp 2-component vector of float) +0:160 'inF0' ( in 2-component vector of float) +0:161 Sequence +0:161 move second child to first child ( temp 2-component vector of float) +0:161 'r057' ( temp 2-component vector of float) +0:161 clamp ( temp 2-component vector of float) +0:161 'inF0' ( in 2-component vector of float) +0:161 Constant: +0:161 0.000000 +0:161 Constant: +0:161 1.000000 +0:162 Sequence +0:162 move second child to first child ( temp 2-component vector of float) +0:162 'r058' ( temp 2-component vector of float) +0:162 Sign ( temp 2-component vector of float) +0:162 'inF0' ( in 2-component vector of float) +0:163 Sequence +0:163 move second child to first child ( temp 2-component vector of float) +0:163 'r059' ( temp 2-component vector of float) +0:163 sine ( temp 2-component vector of float) +0:163 'inF0' ( in 2-component vector of float) +0:164 Sequence +0:164 move second child to first child ( temp 2-component vector of float) +0:164 'inF1' ( in 2-component vector of float) +0:164 sine ( temp 2-component vector of float) +0:164 'inF0' ( in 2-component vector of float) +0:164 move second child to first child ( temp 2-component vector of float) +0:164 'inF2' ( in 2-component vector of float) +0:164 cosine ( temp 2-component vector of float) +0:164 'inF0' ( in 2-component vector of float) +0:165 Sequence +0:165 move second child to first child ( temp 2-component vector of float) +0:165 'r060' ( temp 2-component vector of float) +0:165 hyp. sine ( temp 2-component vector of float) +0:165 'inF0' ( in 2-component vector of float) +0:166 Sequence +0:166 move second child to first child ( temp 2-component vector of float) +0:166 'r061' ( temp 2-component vector of float) +0:166 smoothstep ( temp 2-component vector of float) +0:166 'inF0' ( in 2-component vector of float) +0:166 'inF1' ( in 2-component vector of float) +0:166 'inF2' ( in 2-component vector of float) +0:167 Sequence +0:167 move second child to first child ( temp 2-component vector of float) +0:167 'r062' ( temp 2-component vector of float) +0:167 sqrt ( temp 2-component vector of float) +0:167 'inF0' ( in 2-component vector of float) +0:168 Sequence +0:168 move second child to first child ( temp 2-component vector of float) +0:168 'r063' ( temp 2-component vector of float) +0:168 step ( temp 2-component vector of float) +0:168 'inF0' ( in 2-component vector of float) +0:168 'inF1' ( in 2-component vector of float) +0:169 Sequence +0:169 move second child to first child ( temp 2-component vector of float) +0:169 'r064' ( temp 2-component vector of float) +0:169 tangent ( temp 2-component vector of float) +0:169 'inF0' ( in 2-component vector of float) +0:170 Sequence +0:170 move second child to first child ( temp 2-component vector of float) +0:170 'r065' ( temp 2-component vector of float) +0:170 hyp. tangent ( temp 2-component vector of float) +0:170 'inF0' ( in 2-component vector of float) +0:172 Sequence +0:172 move second child to first child ( temp 2-component vector of float) +0:172 'r066' ( temp 2-component vector of float) +0:172 trunc ( temp 2-component vector of float) +0:172 'inF0' ( in 2-component vector of float) +0:175 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:179 Function Definition: PixelShaderFunction3(vf3;vf3;vf3;vu3;vu3; ( temp 3-component vector of float) +0:179 Function Parameters: +0:179 'inF0' ( in 3-component vector of float) +0:179 'inF1' ( in 3-component vector of float) +0:179 'inF2' ( in 3-component vector of float) +0:179 'inU0' ( in 3-component vector of uint) +0:179 'inU1' ( in 3-component vector of uint) +0:? Sequence +0:182 Sequence +0:182 move second child to first child ( temp bool) +0:182 'r000' ( temp bool) +0:182 all ( temp bool) +0:182 Convert float to bool ( temp 3-component vector of bool) +0:182 'inF0' ( in 3-component vector of float) +0:183 Sequence +0:183 move second child to first child ( temp 3-component vector of float) +0:183 'r001' ( temp 3-component vector of float) +0:183 Absolute value ( temp 3-component vector of float) +0:183 'inF0' ( in 3-component vector of float) +0:184 Sequence +0:184 move second child to first child ( temp 3-component vector of float) +0:184 'r002' ( temp 3-component vector of float) +0:184 arc cosine ( temp 3-component vector of float) +0:184 'inF0' ( in 3-component vector of float) +0:185 Sequence +0:185 move second child to first child ( temp bool) +0:185 'r003' ( temp bool) +0:185 any ( temp bool) +0:185 Convert float to bool ( temp 3-component vector of bool) +0:185 'inF0' ( in 3-component vector of float) +0:186 Sequence +0:186 move second child to first child ( temp 3-component vector of float) +0:186 'r004' ( temp 3-component vector of float) +0:186 arc sine ( temp 3-component vector of float) +0:186 'inF0' ( in 3-component vector of float) +0:187 Sequence +0:187 move second child to first child ( temp 3-component vector of int) +0:187 'r005' ( temp 3-component vector of int) +0:187 floatBitsToInt ( temp 3-component vector of int) +0:187 'inF0' ( in 3-component vector of float) +0:188 Sequence +0:188 move second child to first child ( temp 3-component vector of uint) +0:188 'r006' ( temp 3-component vector of uint) +0:188 floatBitsToUint ( temp 3-component vector of uint) +0:188 'inF0' ( in 3-component vector of float) +0:189 Sequence +0:189 move second child to first child ( temp 3-component vector of float) +0:189 'r007' ( temp 3-component vector of float) +0:189 intBitsToFloat ( temp 3-component vector of float) +0:189 'inU0' ( in 3-component vector of uint) +0:191 Sequence +0:191 move second child to first child ( temp 3-component vector of float) +0:191 'r009' ( temp 3-component vector of float) +0:191 arc tangent ( temp 3-component vector of float) +0:191 'inF0' ( in 3-component vector of float) +0:192 Sequence +0:192 move second child to first child ( temp 3-component vector of float) +0:192 'r010' ( temp 3-component vector of float) +0:192 arc tangent ( temp 3-component vector of float) +0:192 'inF0' ( in 3-component vector of float) +0:192 'inF1' ( in 3-component vector of float) +0:193 Sequence +0:193 move second child to first child ( temp 3-component vector of float) +0:193 'r011' ( temp 3-component vector of float) +0:193 Ceiling ( temp 3-component vector of float) +0:193 'inF0' ( in 3-component vector of float) +0:194 Sequence +0:194 move second child to first child ( temp 3-component vector of float) +0:194 'r012' ( temp 3-component vector of float) +0:194 clamp ( temp 3-component vector of float) +0:194 'inF0' ( in 3-component vector of float) +0:194 'inF1' ( in 3-component vector of float) +0:194 'inF2' ( in 3-component vector of float) +0:195 Test condition and select ( temp void) +0:195 Condition +0:195 any ( temp bool) +0:195 Compare Less Than ( temp 3-component vector of bool) +0:195 'inF0' ( in 3-component vector of float) +0:195 Constant: +0:195 0.000000 +0:195 0.000000 +0:195 0.000000 +0:195 true case +0:195 Branch: Kill +0:196 Test condition and select ( temp void) +0:196 Condition +0:196 any ( temp bool) +0:196 Compare Less Than ( temp 3-component vector of bool) +0:196 'inU0' ( in 3-component vector of uint) +0:196 Constant: +0:196 0.000000 +0:196 0.000000 +0:196 0.000000 +0:196 true case +0:196 Branch: Kill +0:197 Sequence +0:197 move second child to first child ( temp 3-component vector of float) +0:197 'r013' ( temp 3-component vector of float) +0:197 cosine ( temp 3-component vector of float) +0:197 'inF0' ( in 3-component vector of float) +0:198 Sequence +0:198 move second child to first child ( temp 3-component vector of float) +0:198 'r014' ( temp 3-component vector of float) +0:198 hyp. cosine ( temp 3-component vector of float) +0:198 'inF0' ( in 3-component vector of float) +0:199 Sequence +0:199 move second child to first child ( temp 3-component vector of uint) +0:199 'r015' ( temp 3-component vector of uint) +0:? bitCount ( temp 3-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 3 (const uint) +0:? 5 (const uint) +0:200 Sequence +0:200 move second child to first child ( temp 3-component vector of float) +0:200 'r016' ( temp 3-component vector of float) +0:200 cross-product ( temp 3-component vector of float) +0:200 'inF0' ( in 3-component vector of float) +0:200 'inF1' ( in 3-component vector of float) +0:201 Sequence +0:201 move second child to first child ( temp 3-component vector of float) +0:201 'r017' ( temp 3-component vector of float) +0:201 dPdx ( temp 3-component vector of float) +0:201 'inF0' ( in 3-component vector of float) +0:202 Sequence +0:202 move second child to first child ( temp 3-component vector of float) +0:202 'r018' ( temp 3-component vector of float) +0:202 dPdxCoarse ( temp 3-component vector of float) +0:202 'inF0' ( in 3-component vector of float) +0:203 Sequence +0:203 move second child to first child ( temp 3-component vector of float) +0:203 'r019' ( temp 3-component vector of float) +0:203 dPdxFine ( temp 3-component vector of float) +0:203 'inF0' ( in 3-component vector of float) +0:204 Sequence +0:204 move second child to first child ( temp 3-component vector of float) +0:204 'r020' ( temp 3-component vector of float) +0:204 dPdy ( temp 3-component vector of float) +0:204 'inF0' ( in 3-component vector of float) +0:205 Sequence +0:205 move second child to first child ( temp 3-component vector of float) +0:205 'r021' ( temp 3-component vector of float) +0:205 dPdyCoarse ( temp 3-component vector of float) +0:205 'inF0' ( in 3-component vector of float) +0:206 Sequence +0:206 move second child to first child ( temp 3-component vector of float) +0:206 'r022' ( temp 3-component vector of float) +0:206 dPdyFine ( temp 3-component vector of float) +0:206 'inF0' ( in 3-component vector of float) +0:207 Sequence +0:207 move second child to first child ( temp 3-component vector of float) +0:207 'r023' ( temp 3-component vector of float) +0:207 degrees ( temp 3-component vector of float) +0:207 'inF0' ( in 3-component vector of float) +0:208 Sequence +0:208 move second child to first child ( temp float) +0:208 'r024' ( temp float) +0:208 distance ( temp float) +0:208 'inF0' ( in 3-component vector of float) +0:208 'inF1' ( in 3-component vector of float) +0:209 Sequence +0:209 move second child to first child ( temp float) +0:209 'r025' ( temp float) +0:209 dot-product ( temp float) +0:209 'inF0' ( in 3-component vector of float) +0:209 'inF1' ( in 3-component vector of float) +0:213 Sequence +0:213 move second child to first child ( temp 3-component vector of float) +0:213 'r029' ( temp 3-component vector of float) +0:213 exp ( temp 3-component vector of float) +0:213 'inF0' ( in 3-component vector of float) +0:214 Sequence +0:214 move second child to first child ( temp 3-component vector of float) +0:214 'r030' ( temp 3-component vector of float) +0:214 exp2 ( temp 3-component vector of float) +0:214 'inF0' ( in 3-component vector of float) +0:215 Sequence +0:215 move second child to first child ( temp 3-component vector of float) +0:215 'r031' ( temp 3-component vector of float) +0:215 face-forward ( temp 3-component vector of float) +0:215 'inF0' ( in 3-component vector of float) +0:215 'inF1' ( in 3-component vector of float) +0:215 'inF2' ( in 3-component vector of float) +0:216 Sequence +0:216 move second child to first child ( temp 3-component vector of uint) +0:216 'r032' ( temp 3-component vector of uint) +0:? findMSB ( temp 3-component vector of uint) +0:? Constant: +0:? 2 (const uint) +0:? 3 (const uint) +0:? 4 (const uint) +0:217 Sequence +0:217 move second child to first child ( temp 3-component vector of uint) +0:217 'r033' ( temp 3-component vector of uint) +0:? findLSB ( temp 3-component vector of uint) +0:? Constant: +0:? 2 (const uint) +0:? 3 (const uint) +0:? 4 (const uint) +0:218 Sequence +0:218 move second child to first child ( temp 3-component vector of float) +0:218 'r034' ( temp 3-component vector of float) +0:218 Floor ( temp 3-component vector of float) +0:218 'inF0' ( in 3-component vector of float) +0:220 Sequence +0:220 move second child to first child ( temp 3-component vector of float) +0:220 'r036' ( temp 3-component vector of float) +0:220 mod ( temp 3-component vector of float) +0:220 'inF0' ( in 3-component vector of float) +0:220 'inF1' ( in 3-component vector of float) +0:221 Sequence +0:221 move second child to first child ( temp 3-component vector of float) +0:221 'r037' ( temp 3-component vector of float) +0:221 Fraction ( temp 3-component vector of float) +0:221 'inF0' ( in 3-component vector of float) +0:222 Sequence +0:222 move second child to first child ( temp 3-component vector of float) +0:222 'r039' ( temp 3-component vector of float) +0:222 fwidth ( temp 3-component vector of float) +0:222 'inF0' ( in 3-component vector of float) +0:223 Sequence +0:223 move second child to first child ( temp 3-component vector of bool) +0:223 'r040' ( temp 3-component vector of bool) +0:223 isinf ( temp 3-component vector of bool) +0:223 'inF0' ( in 3-component vector of float) +0:224 Sequence +0:224 move second child to first child ( temp 3-component vector of bool) +0:224 'r041' ( temp 3-component vector of bool) +0:224 isnan ( temp 3-component vector of bool) +0:224 'inF0' ( in 3-component vector of float) +0:225 Sequence +0:225 move second child to first child ( temp 3-component vector of float) +0:225 'r042' ( temp 3-component vector of float) +0:225 ldexp ( temp 3-component vector of float) +0:225 'inF0' ( in 3-component vector of float) +0:225 'inF1' ( in 3-component vector of float) +0:226 Sequence +0:226 move second child to first child ( temp 3-component vector of float) +0:226 'r039a' ( temp 3-component vector of float) +0:226 mix ( temp 3-component vector of float) +0:226 'inF0' ( in 3-component vector of float) +0:226 'inF1' ( in 3-component vector of float) +0:226 'inF2' ( in 3-component vector of float) +0:227 Sequence +0:227 move second child to first child ( temp 3-component vector of float) +0:227 'r039b' ( temp 3-component vector of float) +0:227 mix ( temp 3-component vector of float) +0:227 'inF0' ( in 3-component vector of float) +0:227 'inF1' ( in 3-component vector of float) +0:227 Constant: +0:227 0.300000 +0:228 Sequence +0:228 move second child to first child ( temp float) +0:228 'r043' ( temp float) +0:228 length ( temp float) +0:228 'inF0' ( in 3-component vector of float) +0:229 Sequence +0:229 move second child to first child ( temp 3-component vector of float) +0:229 'r044' ( temp 3-component vector of float) +0:229 log ( temp 3-component vector of float) +0:229 'inF0' ( in 3-component vector of float) +0:230 Sequence +0:230 move second child to first child ( temp 3-component vector of float) +0:230 'r045' ( temp 3-component vector of float) +0:230 vector-scale ( temp 3-component vector of float) +0:230 log2 ( temp 3-component vector of float) +0:230 'inF0' ( in 3-component vector of float) +0:230 Constant: +0:230 0.301030 +0:231 Sequence +0:231 move second child to first child ( temp 3-component vector of float) +0:231 'r046' ( temp 3-component vector of float) +0:231 log2 ( temp 3-component vector of float) +0:231 'inF0' ( in 3-component vector of float) +0:232 Sequence +0:232 move second child to first child ( temp 3-component vector of float) +0:232 'r047' ( temp 3-component vector of float) +0:232 max ( temp 3-component vector of float) +0:232 'inF0' ( in 3-component vector of float) +0:232 'inF1' ( in 3-component vector of float) +0:233 Sequence +0:233 move second child to first child ( temp 3-component vector of float) +0:233 'r048' ( temp 3-component vector of float) +0:233 min ( temp 3-component vector of float) +0:233 'inF0' ( in 3-component vector of float) +0:233 'inF1' ( in 3-component vector of float) +0:234 Sequence +0:234 move second child to first child ( temp 3-component vector of float) +0:234 'r049' ( temp 3-component vector of float) +0:234 normalize ( temp 3-component vector of float) +0:234 'inF0' ( in 3-component vector of float) +0:235 Sequence +0:235 move second child to first child ( temp 3-component vector of float) +0:235 'r050' ( temp 3-component vector of float) +0:235 pow ( temp 3-component vector of float) +0:235 'inF0' ( in 3-component vector of float) +0:235 'inF1' ( in 3-component vector of float) +0:236 Sequence +0:236 move second child to first child ( temp 3-component vector of float) +0:236 'r051' ( temp 3-component vector of float) +0:236 radians ( temp 3-component vector of float) +0:236 'inF0' ( in 3-component vector of float) +0:237 Sequence +0:237 move second child to first child ( temp 3-component vector of float) +0:237 'r052' ( temp 3-component vector of float) +0:237 divide ( temp 3-component vector of float) +0:237 Constant: +0:237 1.000000 +0:237 'inF0' ( in 3-component vector of float) +0:238 Sequence +0:238 move second child to first child ( temp 3-component vector of float) +0:238 'r053' ( temp 3-component vector of float) +0:238 reflect ( temp 3-component vector of float) +0:238 'inF0' ( in 3-component vector of float) +0:238 'inF1' ( in 3-component vector of float) +0:239 Sequence +0:239 move second child to first child ( temp 3-component vector of float) +0:239 'r054' ( temp 3-component vector of float) +0:239 refract ( temp 3-component vector of float) +0:239 'inF0' ( in 3-component vector of float) +0:239 'inF1' ( in 3-component vector of float) +0:239 Constant: +0:239 2.000000 +0:240 Sequence +0:240 move second child to first child ( temp 3-component vector of uint) +0:240 'r055' ( temp 3-component vector of uint) +0:? bitFieldReverse ( temp 3-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:241 Sequence +0:241 move second child to first child ( temp 3-component vector of float) +0:241 'r056' ( temp 3-component vector of float) +0:241 roundEven ( temp 3-component vector of float) +0:241 'inF0' ( in 3-component vector of float) +0:242 Sequence +0:242 move second child to first child ( temp 3-component vector of float) +0:242 'r057' ( temp 3-component vector of float) +0:242 inverse sqrt ( temp 3-component vector of float) +0:242 'inF0' ( in 3-component vector of float) +0:243 Sequence +0:243 move second child to first child ( temp 3-component vector of float) +0:243 'r058' ( temp 3-component vector of float) +0:243 clamp ( temp 3-component vector of float) +0:243 'inF0' ( in 3-component vector of float) +0:243 Constant: +0:243 0.000000 +0:243 Constant: +0:243 1.000000 +0:244 Sequence +0:244 move second child to first child ( temp 3-component vector of float) +0:244 'r059' ( temp 3-component vector of float) +0:244 Sign ( temp 3-component vector of float) +0:244 'inF0' ( in 3-component vector of float) +0:245 Sequence +0:245 move second child to first child ( temp 3-component vector of float) +0:245 'r060' ( temp 3-component vector of float) +0:245 sine ( temp 3-component vector of float) +0:245 'inF0' ( in 3-component vector of float) +0:246 Sequence +0:246 move second child to first child ( temp 3-component vector of float) +0:246 'inF1' ( in 3-component vector of float) +0:246 sine ( temp 3-component vector of float) +0:246 'inF0' ( in 3-component vector of float) +0:246 move second child to first child ( temp 3-component vector of float) +0:246 'inF2' ( in 3-component vector of float) +0:246 cosine ( temp 3-component vector of float) +0:246 'inF0' ( in 3-component vector of float) +0:247 Sequence +0:247 move second child to first child ( temp 3-component vector of float) +0:247 'r061' ( temp 3-component vector of float) +0:247 hyp. sine ( temp 3-component vector of float) +0:247 'inF0' ( in 3-component vector of float) +0:248 Sequence +0:248 move second child to first child ( temp 3-component vector of float) +0:248 'r062' ( temp 3-component vector of float) +0:248 smoothstep ( temp 3-component vector of float) +0:248 'inF0' ( in 3-component vector of float) +0:248 'inF1' ( in 3-component vector of float) +0:248 'inF2' ( in 3-component vector of float) +0:249 Sequence +0:249 move second child to first child ( temp 3-component vector of float) +0:249 'r063' ( temp 3-component vector of float) +0:249 sqrt ( temp 3-component vector of float) +0:249 'inF0' ( in 3-component vector of float) +0:250 Sequence +0:250 move second child to first child ( temp 3-component vector of float) +0:250 'r064' ( temp 3-component vector of float) +0:250 step ( temp 3-component vector of float) +0:250 'inF0' ( in 3-component vector of float) +0:250 'inF1' ( in 3-component vector of float) +0:251 Sequence +0:251 move second child to first child ( temp 3-component vector of float) +0:251 'r065' ( temp 3-component vector of float) +0:251 tangent ( temp 3-component vector of float) +0:251 'inF0' ( in 3-component vector of float) +0:252 Sequence +0:252 move second child to first child ( temp 3-component vector of float) +0:252 'r066' ( temp 3-component vector of float) +0:252 hyp. tangent ( temp 3-component vector of float) +0:252 'inF0' ( in 3-component vector of float) +0:254 Sequence +0:254 move second child to first child ( temp 3-component vector of float) +0:254 'r067' ( temp 3-component vector of float) +0:254 trunc ( temp 3-component vector of float) +0:254 'inF0' ( in 3-component vector of float) +0:257 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:261 Function Definition: PixelShaderFunction(vf4;vf4;vf4;vu4;vu4; ( temp 4-component vector of float) +0:261 Function Parameters: +0:261 'inF0' ( in 4-component vector of float) +0:261 'inF1' ( in 4-component vector of float) +0:261 'inF2' ( in 4-component vector of float) +0:261 'inU0' ( in 4-component vector of uint) +0:261 'inU1' ( in 4-component vector of uint) +0:? Sequence +0:264 Sequence +0:264 move second child to first child ( temp bool) +0:264 'r000' ( temp bool) +0:264 all ( temp bool) +0:264 Convert float to bool ( temp 4-component vector of bool) +0:264 'inF0' ( in 4-component vector of float) +0:265 Sequence +0:265 move second child to first child ( temp 4-component vector of float) +0:265 'r001' ( temp 4-component vector of float) +0:265 Absolute value ( temp 4-component vector of float) +0:265 'inF0' ( in 4-component vector of float) +0:266 Sequence +0:266 move second child to first child ( temp 4-component vector of float) +0:266 'r002' ( temp 4-component vector of float) +0:266 arc cosine ( temp 4-component vector of float) +0:266 'inF0' ( in 4-component vector of float) +0:267 Sequence +0:267 move second child to first child ( temp bool) +0:267 'r003' ( temp bool) +0:267 any ( temp bool) +0:267 Convert float to bool ( temp 4-component vector of bool) +0:267 'inF0' ( in 4-component vector of float) +0:268 Sequence +0:268 move second child to first child ( temp 4-component vector of float) +0:268 'r004' ( temp 4-component vector of float) +0:268 arc sine ( temp 4-component vector of float) +0:268 'inF0' ( in 4-component vector of float) +0:269 Sequence +0:269 move second child to first child ( temp 4-component vector of int) +0:269 'r005' ( temp 4-component vector of int) +0:269 floatBitsToInt ( temp 4-component vector of int) +0:269 'inF0' ( in 4-component vector of float) +0:270 Sequence +0:270 move second child to first child ( temp 4-component vector of uint) +0:270 'r006' ( temp 4-component vector of uint) +0:270 floatBitsToUint ( temp 4-component vector of uint) +0:270 'inF0' ( in 4-component vector of float) +0:271 Sequence +0:271 move second child to first child ( temp 4-component vector of float) +0:271 'r007' ( temp 4-component vector of float) +0:271 intBitsToFloat ( temp 4-component vector of float) +0:271 'inU0' ( in 4-component vector of uint) +0:273 Sequence +0:273 move second child to first child ( temp 4-component vector of float) +0:273 'r009' ( temp 4-component vector of float) +0:273 arc tangent ( temp 4-component vector of float) +0:273 'inF0' ( in 4-component vector of float) +0:274 Sequence +0:274 move second child to first child ( temp 4-component vector of float) +0:274 'r010' ( temp 4-component vector of float) +0:274 arc tangent ( temp 4-component vector of float) +0:274 'inF0' ( in 4-component vector of float) +0:274 'inF1' ( in 4-component vector of float) +0:275 Sequence +0:275 move second child to first child ( temp 4-component vector of float) +0:275 'r011' ( temp 4-component vector of float) +0:275 Ceiling ( temp 4-component vector of float) +0:275 'inF0' ( in 4-component vector of float) +0:276 Sequence +0:276 move second child to first child ( temp 4-component vector of float) +0:276 'r012' ( temp 4-component vector of float) +0:276 clamp ( temp 4-component vector of float) +0:276 'inF0' ( in 4-component vector of float) +0:276 'inF1' ( in 4-component vector of float) +0:276 'inF2' ( in 4-component vector of float) +0:277 Test condition and select ( temp void) +0:277 Condition +0:277 any ( temp bool) +0:277 Compare Less Than ( temp 4-component vector of bool) +0:277 'inF0' ( in 4-component vector of float) +0:277 Constant: +0:277 0.000000 +0:277 0.000000 +0:277 0.000000 +0:277 0.000000 +0:277 true case +0:277 Branch: Kill +0:278 Test condition and select ( temp void) +0:278 Condition +0:278 any ( temp bool) +0:278 Compare Less Than ( temp 4-component vector of bool) +0:278 'inU0' ( in 4-component vector of uint) +0:278 Constant: +0:278 0.000000 +0:278 0.000000 +0:278 0.000000 +0:278 0.000000 +0:278 true case +0:278 Branch: Kill +0:279 Sequence +0:279 move second child to first child ( temp 4-component vector of float) +0:279 'r013' ( temp 4-component vector of float) +0:279 cosine ( temp 4-component vector of float) +0:279 'inF0' ( in 4-component vector of float) +0:280 Sequence +0:280 move second child to first child ( temp 4-component vector of float) +0:280 'r014' ( temp 4-component vector of float) +0:280 hyp. cosine ( temp 4-component vector of float) +0:280 'inF0' ( in 4-component vector of float) +0:281 Sequence +0:281 move second child to first child ( temp 4-component vector of uint) +0:281 'r015' ( temp 4-component vector of uint) +0:? bitCount ( temp 4-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 3 (const uint) +0:? 5 (const uint) +0:? 2 (const uint) +0:282 Sequence +0:282 move second child to first child ( temp 4-component vector of float) +0:282 'r016' ( temp 4-component vector of float) +0:282 dPdx ( temp 4-component vector of float) +0:282 'inF0' ( in 4-component vector of float) +0:283 Sequence +0:283 move second child to first child ( temp 4-component vector of float) +0:283 'r017' ( temp 4-component vector of float) +0:283 dPdxCoarse ( temp 4-component vector of float) +0:283 'inF0' ( in 4-component vector of float) +0:284 Sequence +0:284 move second child to first child ( temp 4-component vector of float) +0:284 'r018' ( temp 4-component vector of float) +0:284 dPdxFine ( temp 4-component vector of float) +0:284 'inF0' ( in 4-component vector of float) +0:285 Sequence +0:285 move second child to first child ( temp 4-component vector of float) +0:285 'r019' ( temp 4-component vector of float) +0:285 dPdy ( temp 4-component vector of float) +0:285 'inF0' ( in 4-component vector of float) +0:286 Sequence +0:286 move second child to first child ( temp 4-component vector of float) +0:286 'r020' ( temp 4-component vector of float) +0:286 dPdyCoarse ( temp 4-component vector of float) +0:286 'inF0' ( in 4-component vector of float) +0:287 Sequence +0:287 move second child to first child ( temp 4-component vector of float) +0:287 'r021' ( temp 4-component vector of float) +0:287 dPdyFine ( temp 4-component vector of float) +0:287 'inF0' ( in 4-component vector of float) +0:288 Sequence +0:288 move second child to first child ( temp 4-component vector of float) +0:288 'r022' ( temp 4-component vector of float) +0:288 degrees ( temp 4-component vector of float) +0:288 'inF0' ( in 4-component vector of float) +0:289 Sequence +0:289 move second child to first child ( temp float) +0:289 'r023' ( temp float) +0:289 distance ( temp float) +0:289 'inF0' ( in 4-component vector of float) +0:289 'inF1' ( in 4-component vector of float) +0:290 Sequence +0:290 move second child to first child ( temp float) +0:290 'r024' ( temp float) +0:290 dot-product ( temp float) +0:290 'inF0' ( in 4-component vector of float) +0:290 'inF1' ( in 4-component vector of float) +0:291 Sequence +0:291 move second child to first child ( temp 4-component vector of float) +0:291 'r025' ( temp 4-component vector of float) +0:291 Construct vec4 ( temp 4-component vector of float) +0:291 Constant: +0:291 1.000000 +0:291 component-wise multiply ( temp float) +0:291 direct index ( temp float) +0:291 'inF0' ( in 4-component vector of float) +0:291 Constant: +0:291 1 (const int) +0:291 direct index ( temp float) +0:291 'inF1' ( in 4-component vector of float) +0:291 Constant: +0:291 1 (const int) +0:291 direct index ( temp float) +0:291 'inF0' ( in 4-component vector of float) +0:291 Constant: +0:291 2 (const int) +0:291 direct index ( temp float) +0:291 'inF1' ( in 4-component vector of float) +0:291 Constant: +0:291 3 (const int) +0:295 Sequence +0:295 move second child to first child ( temp 4-component vector of float) +0:295 'r029' ( temp 4-component vector of float) +0:295 exp ( temp 4-component vector of float) +0:295 'inF0' ( in 4-component vector of float) +0:296 Sequence +0:296 move second child to first child ( temp 4-component vector of float) +0:296 'r030' ( temp 4-component vector of float) +0:296 exp2 ( temp 4-component vector of float) +0:296 'inF0' ( in 4-component vector of float) +0:297 Sequence +0:297 move second child to first child ( temp 4-component vector of float) +0:297 'r031' ( temp 4-component vector of float) +0:297 face-forward ( temp 4-component vector of float) +0:297 'inF0' ( in 4-component vector of float) +0:297 'inF1' ( in 4-component vector of float) +0:297 'inF2' ( in 4-component vector of float) +0:298 Sequence +0:298 move second child to first child ( temp 4-component vector of uint) +0:298 'r032' ( temp 4-component vector of uint) +0:? findMSB ( temp 4-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 8 (const uint) +0:? 9 (const uint) +0:? 10 (const uint) +0:299 Sequence +0:299 move second child to first child ( temp 4-component vector of uint) +0:299 'r033' ( temp 4-component vector of uint) +0:? findLSB ( temp 4-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 8 (const uint) +0:? 9 (const uint) +0:? 10 (const uint) +0:300 Sequence +0:300 move second child to first child ( temp 4-component vector of float) +0:300 'r034' ( temp 4-component vector of float) +0:300 Floor ( temp 4-component vector of float) +0:300 'inF0' ( in 4-component vector of float) +0:302 Sequence +0:302 move second child to first child ( temp 4-component vector of float) +0:302 'r036' ( temp 4-component vector of float) +0:302 mod ( temp 4-component vector of float) +0:302 'inF0' ( in 4-component vector of float) +0:302 'inF1' ( in 4-component vector of float) +0:303 Sequence +0:303 move second child to first child ( temp 4-component vector of float) +0:303 'r037' ( temp 4-component vector of float) +0:303 Fraction ( temp 4-component vector of float) +0:303 'inF0' ( in 4-component vector of float) +0:304 Sequence +0:304 move second child to first child ( temp 4-component vector of float) +0:304 'r039' ( temp 4-component vector of float) +0:304 fwidth ( temp 4-component vector of float) +0:304 'inF0' ( in 4-component vector of float) +0:305 Sequence +0:305 move second child to first child ( temp 4-component vector of bool) +0:305 'r040' ( temp 4-component vector of bool) +0:305 isinf ( temp 4-component vector of bool) +0:305 'inF0' ( in 4-component vector of float) +0:306 Sequence +0:306 move second child to first child ( temp 4-component vector of bool) +0:306 'r041' ( temp 4-component vector of bool) +0:306 isnan ( temp 4-component vector of bool) +0:306 'inF0' ( in 4-component vector of float) +0:307 Sequence +0:307 move second child to first child ( temp 4-component vector of float) +0:307 'r042' ( temp 4-component vector of float) +0:307 ldexp ( temp 4-component vector of float) +0:307 'inF0' ( in 4-component vector of float) +0:307 'inF1' ( in 4-component vector of float) +0:308 Sequence +0:308 move second child to first child ( temp 4-component vector of float) +0:308 'r039a' ( temp 4-component vector of float) +0:308 mix ( temp 4-component vector of float) +0:308 'inF0' ( in 4-component vector of float) +0:308 'inF1' ( in 4-component vector of float) +0:308 'inF2' ( in 4-component vector of float) +0:309 Sequence +0:309 move second child to first child ( temp float) +0:309 'r043' ( temp float) +0:309 length ( temp float) +0:309 'inF0' ( in 4-component vector of float) +0:310 Sequence +0:310 move second child to first child ( temp 4-component vector of float) +0:310 'r044' ( temp 4-component vector of float) +0:310 log ( temp 4-component vector of float) +0:310 'inF0' ( in 4-component vector of float) +0:311 Sequence +0:311 move second child to first child ( temp 4-component vector of float) +0:311 'r045' ( temp 4-component vector of float) +0:311 vector-scale ( temp 4-component vector of float) +0:311 log2 ( temp 4-component vector of float) +0:311 'inF0' ( in 4-component vector of float) +0:311 Constant: +0:311 0.301030 +0:312 Sequence +0:312 move second child to first child ( temp 4-component vector of float) +0:312 'r046' ( temp 4-component vector of float) +0:312 log2 ( temp 4-component vector of float) +0:312 'inF0' ( in 4-component vector of float) +0:313 Sequence +0:313 move second child to first child ( temp 4-component vector of float) +0:313 'r047' ( temp 4-component vector of float) +0:313 max ( temp 4-component vector of float) +0:313 'inF0' ( in 4-component vector of float) +0:313 'inF1' ( in 4-component vector of float) +0:314 Sequence +0:314 move second child to first child ( temp 4-component vector of float) +0:314 'r048' ( temp 4-component vector of float) +0:314 min ( temp 4-component vector of float) +0:314 'inF0' ( in 4-component vector of float) +0:314 'inF1' ( in 4-component vector of float) +0:315 Sequence +0:315 move second child to first child ( temp 4-component vector of float) +0:315 'r049' ( temp 4-component vector of float) +0:315 normalize ( temp 4-component vector of float) +0:315 'inF0' ( in 4-component vector of float) +0:316 Sequence +0:316 move second child to first child ( temp 4-component vector of float) +0:316 'r050' ( temp 4-component vector of float) +0:316 pow ( temp 4-component vector of float) +0:316 'inF0' ( in 4-component vector of float) +0:316 'inF1' ( in 4-component vector of float) +0:317 Sequence +0:317 move second child to first child ( temp 4-component vector of float) +0:317 'r051' ( temp 4-component vector of float) +0:317 radians ( temp 4-component vector of float) +0:317 'inF0' ( in 4-component vector of float) +0:318 Sequence +0:318 move second child to first child ( temp 4-component vector of float) +0:318 'r052' ( temp 4-component vector of float) +0:318 divide ( temp 4-component vector of float) +0:318 Constant: +0:318 1.000000 +0:318 'inF0' ( in 4-component vector of float) +0:319 Sequence +0:319 move second child to first child ( temp 4-component vector of float) +0:319 'r053' ( temp 4-component vector of float) +0:319 reflect ( temp 4-component vector of float) +0:319 'inF0' ( in 4-component vector of float) +0:319 'inF1' ( in 4-component vector of float) +0:320 Sequence +0:320 move second child to first child ( temp 4-component vector of float) +0:320 'r054' ( temp 4-component vector of float) +0:320 refract ( temp 4-component vector of float) +0:320 'inF0' ( in 4-component vector of float) +0:320 'inF1' ( in 4-component vector of float) +0:320 Constant: +0:320 2.000000 +0:321 Sequence +0:321 move second child to first child ( temp 4-component vector of uint) +0:321 'r055' ( temp 4-component vector of uint) +0:? bitFieldReverse ( temp 4-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:? 4 (const uint) +0:322 Sequence +0:322 move second child to first child ( temp 4-component vector of float) +0:322 'r056' ( temp 4-component vector of float) +0:322 roundEven ( temp 4-component vector of float) +0:322 'inF0' ( in 4-component vector of float) +0:323 Sequence +0:323 move second child to first child ( temp 4-component vector of float) +0:323 'r057' ( temp 4-component vector of float) +0:323 inverse sqrt ( temp 4-component vector of float) +0:323 'inF0' ( in 4-component vector of float) +0:324 Sequence +0:324 move second child to first child ( temp 4-component vector of float) +0:324 'r058' ( temp 4-component vector of float) +0:324 clamp ( temp 4-component vector of float) +0:324 'inF0' ( in 4-component vector of float) +0:324 Constant: +0:324 0.000000 +0:324 Constant: +0:324 1.000000 +0:325 Sequence +0:325 move second child to first child ( temp 4-component vector of float) +0:325 'r059' ( temp 4-component vector of float) +0:325 Sign ( temp 4-component vector of float) +0:325 'inF0' ( in 4-component vector of float) +0:326 Sequence +0:326 move second child to first child ( temp 4-component vector of float) +0:326 'r060' ( temp 4-component vector of float) +0:326 sine ( temp 4-component vector of float) +0:326 'inF0' ( in 4-component vector of float) +0:327 Sequence +0:327 move second child to first child ( temp 4-component vector of float) +0:327 'inF1' ( in 4-component vector of float) +0:327 sine ( temp 4-component vector of float) +0:327 'inF0' ( in 4-component vector of float) +0:327 move second child to first child ( temp 4-component vector of float) +0:327 'inF2' ( in 4-component vector of float) +0:327 cosine ( temp 4-component vector of float) +0:327 'inF0' ( in 4-component vector of float) +0:328 Sequence +0:328 move second child to first child ( temp 4-component vector of float) +0:328 'r061' ( temp 4-component vector of float) +0:328 hyp. sine ( temp 4-component vector of float) +0:328 'inF0' ( in 4-component vector of float) +0:329 Sequence +0:329 move second child to first child ( temp 4-component vector of float) +0:329 'r062' ( temp 4-component vector of float) +0:329 smoothstep ( temp 4-component vector of float) +0:329 'inF0' ( in 4-component vector of float) +0:329 'inF1' ( in 4-component vector of float) +0:329 'inF2' ( in 4-component vector of float) +0:330 Sequence +0:330 move second child to first child ( temp 4-component vector of float) +0:330 'r063' ( temp 4-component vector of float) +0:330 sqrt ( temp 4-component vector of float) +0:330 'inF0' ( in 4-component vector of float) +0:331 Sequence +0:331 move second child to first child ( temp 4-component vector of float) +0:331 'r064' ( temp 4-component vector of float) +0:331 step ( temp 4-component vector of float) +0:331 'inF0' ( in 4-component vector of float) +0:331 'inF1' ( in 4-component vector of float) +0:332 Sequence +0:332 move second child to first child ( temp 4-component vector of float) +0:332 'r065' ( temp 4-component vector of float) +0:332 tangent ( temp 4-component vector of float) +0:332 'inF0' ( in 4-component vector of float) +0:333 Sequence +0:333 move second child to first child ( temp 4-component vector of float) +0:333 'r066' ( temp 4-component vector of float) +0:333 hyp. tangent ( temp 4-component vector of float) +0:333 'inF0' ( in 4-component vector of float) +0:335 Sequence +0:335 move second child to first child ( temp 4-component vector of float) +0:335 'r067' ( temp 4-component vector of float) +0:335 trunc ( temp 4-component vector of float) +0:335 'inF0' ( in 4-component vector of float) +0:338 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:401 Function Definition: PixelShaderFunction2x2(mf22;mf22;mf22; ( temp 2X2 matrix of float) +0:401 Function Parameters: +0:401 'inF0' ( in 2X2 matrix of float) +0:401 'inF1' ( in 2X2 matrix of float) +0:401 'inF2' ( in 2X2 matrix of float) +0:? Sequence +0:403 Sequence +0:403 move second child to first child ( temp bool) +0:403 'r000' ( temp bool) +0:403 all ( temp bool) +0:403 Convert float to bool ( temp 2X2 matrix of bool) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r001' ( temp 2X2 matrix of float) +0:403 Absolute value ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 arc cosine ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp bool) +0:403 'r003' ( temp bool) +0:403 any ( temp bool) +0:403 Convert float to bool ( temp 2X2 matrix of bool) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r004' ( temp 2X2 matrix of float) +0:403 arc sine ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r005' ( temp 2X2 matrix of float) +0:403 arc tangent ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r006' ( temp 2X2 matrix of float) +0:403 arc tangent ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r007' ( temp 2X2 matrix of float) +0:403 Ceiling ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Test condition and select ( temp void) +0:403 Condition +0:403 any ( temp bool) +0:403 Compare Less Than ( temp 2X2 matrix of bool) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Constant: +0:403 0.000000 +0:403 0.000000 +0:403 0.000000 +0:403 0.000000 +0:403 true case +0:403 Branch: Kill +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r008' ( temp 2X2 matrix of float) +0:403 clamp ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 'inF2' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r009' ( temp 2X2 matrix of float) +0:403 cosine ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r010' ( temp 2X2 matrix of float) +0:403 hyp. cosine ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r011' ( temp 2X2 matrix of float) +0:403 dPdx ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r012' ( temp 2X2 matrix of float) +0:403 dPdxCoarse ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r013' ( temp 2X2 matrix of float) +0:403 dPdxFine ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r014' ( temp 2X2 matrix of float) +0:403 dPdy ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r015' ( temp 2X2 matrix of float) +0:403 dPdyCoarse ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r016' ( temp 2X2 matrix of float) +0:403 dPdyFine ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r017' ( temp 2X2 matrix of float) +0:403 degrees ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp float) +0:403 'r018' ( temp float) +0:403 determinant ( temp float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r019' ( temp 2X2 matrix of float) +0:403 exp ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'R020' ( temp 2X2 matrix of float) +0:403 exp2 ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r021' ( temp 2X2 matrix of float) +0:403 Floor ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r022' ( temp 2X2 matrix of float) +0:403 mod ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r023' ( temp 2X2 matrix of float) +0:403 Fraction ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r025' ( temp 2X2 matrix of float) +0:403 fwidth ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r026' ( temp 2X2 matrix of float) +0:403 ldexp ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r026a' ( temp 2X2 matrix of float) +0:403 mix ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 'inF2' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r027' ( temp 2X2 matrix of float) +0:403 log ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r028' ( temp 2X2 matrix of float) +0:403 matrix-scale ( temp 2X2 matrix of float) +0:403 log2 ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Constant: +0:403 0.301030 +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r029' ( temp 2X2 matrix of float) +0:403 log2 ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r030' ( temp 2X2 matrix of float) +0:403 max ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r031' ( temp 2X2 matrix of float) +0:403 min ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r032' ( temp 2X2 matrix of float) +0:403 pow ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r033' ( temp 2X2 matrix of float) +0:403 radians ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r034' ( temp 2X2 matrix of float) +0:403 roundEven ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r035' ( temp 2X2 matrix of float) +0:403 inverse sqrt ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r036' ( temp 2X2 matrix of float) +0:403 clamp ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Constant: +0:403 0.000000 +0:403 Constant: +0:403 1.000000 +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r037' ( temp 2X2 matrix of float) +0:403 Sign ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r038' ( temp 2X2 matrix of float) +0:403 sine ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 sine ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'inF2' ( in 2X2 matrix of float) +0:403 cosine ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r039' ( temp 2X2 matrix of float) +0:403 hyp. sine ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r049' ( temp 2X2 matrix of float) +0:403 smoothstep ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 'inF2' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r041' ( temp 2X2 matrix of float) +0:403 sqrt ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r042' ( temp 2X2 matrix of float) +0:403 step ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 'inF1' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r043' ( temp 2X2 matrix of float) +0:403 tangent ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r044' ( temp 2X2 matrix of float) +0:403 hyp. tangent ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 transpose ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:403 Sequence +0:403 move second child to first child ( temp 2X2 matrix of float) +0:403 'r046' ( temp 2X2 matrix of float) +0:403 trunc ( temp 2X2 matrix of float) +0:403 'inF0' ( in 2X2 matrix of float) +0:406 Branch: Return with expression +0:? Constant: +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:410 Function Definition: PixelShaderFunction3x3(mf33;mf33;mf33; ( temp 3X3 matrix of float) +0:410 Function Parameters: +0:410 'inF0' ( in 3X3 matrix of float) +0:410 'inF1' ( in 3X3 matrix of float) +0:410 'inF2' ( in 3X3 matrix of float) +0:? Sequence +0:412 Sequence +0:412 move second child to first child ( temp bool) +0:412 'r000' ( temp bool) +0:412 all ( temp bool) +0:412 Convert float to bool ( temp 3X3 matrix of bool) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r001' ( temp 3X3 matrix of float) +0:412 Absolute value ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 arc cosine ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp bool) +0:412 'r003' ( temp bool) +0:412 any ( temp bool) +0:412 Convert float to bool ( temp 3X3 matrix of bool) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r004' ( temp 3X3 matrix of float) +0:412 arc sine ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r005' ( temp 3X3 matrix of float) +0:412 arc tangent ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r006' ( temp 3X3 matrix of float) +0:412 arc tangent ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r007' ( temp 3X3 matrix of float) +0:412 Ceiling ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Test condition and select ( temp void) +0:412 Condition +0:412 any ( temp bool) +0:412 Compare Less Than ( temp 3X3 matrix of bool) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Constant: +0:412 0.000000 +0:412 0.000000 +0:412 0.000000 +0:412 0.000000 +0:412 0.000000 +0:412 0.000000 +0:412 0.000000 +0:412 0.000000 +0:412 0.000000 +0:412 true case +0:412 Branch: Kill +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r008' ( temp 3X3 matrix of float) +0:412 clamp ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 'inF2' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r009' ( temp 3X3 matrix of float) +0:412 cosine ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r010' ( temp 3X3 matrix of float) +0:412 hyp. cosine ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r011' ( temp 3X3 matrix of float) +0:412 dPdx ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r012' ( temp 3X3 matrix of float) +0:412 dPdxCoarse ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r013' ( temp 3X3 matrix of float) +0:412 dPdxFine ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r014' ( temp 3X3 matrix of float) +0:412 dPdy ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r015' ( temp 3X3 matrix of float) +0:412 dPdyCoarse ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r016' ( temp 3X3 matrix of float) +0:412 dPdyFine ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r017' ( temp 3X3 matrix of float) +0:412 degrees ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp float) +0:412 'r018' ( temp float) +0:412 determinant ( temp float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r019' ( temp 3X3 matrix of float) +0:412 exp ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'R020' ( temp 3X3 matrix of float) +0:412 exp2 ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r021' ( temp 3X3 matrix of float) +0:412 Floor ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r022' ( temp 3X3 matrix of float) +0:412 mod ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r023' ( temp 3X3 matrix of float) +0:412 Fraction ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r025' ( temp 3X3 matrix of float) +0:412 fwidth ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r026' ( temp 3X3 matrix of float) +0:412 ldexp ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r026a' ( temp 3X3 matrix of float) +0:412 mix ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 'inF2' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r027' ( temp 3X3 matrix of float) +0:412 log ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r028' ( temp 3X3 matrix of float) +0:412 matrix-scale ( temp 3X3 matrix of float) +0:412 log2 ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Constant: +0:412 0.301030 +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r029' ( temp 3X3 matrix of float) +0:412 log2 ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r030' ( temp 3X3 matrix of float) +0:412 max ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r031' ( temp 3X3 matrix of float) +0:412 min ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r032' ( temp 3X3 matrix of float) +0:412 pow ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r033' ( temp 3X3 matrix of float) +0:412 radians ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r034' ( temp 3X3 matrix of float) +0:412 roundEven ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r035' ( temp 3X3 matrix of float) +0:412 inverse sqrt ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r036' ( temp 3X3 matrix of float) +0:412 clamp ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Constant: +0:412 0.000000 +0:412 Constant: +0:412 1.000000 +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r037' ( temp 3X3 matrix of float) +0:412 Sign ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r038' ( temp 3X3 matrix of float) +0:412 sine ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 sine ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'inF2' ( in 3X3 matrix of float) +0:412 cosine ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r039' ( temp 3X3 matrix of float) +0:412 hyp. sine ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r049' ( temp 3X3 matrix of float) +0:412 smoothstep ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 'inF2' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r041' ( temp 3X3 matrix of float) +0:412 sqrt ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r042' ( temp 3X3 matrix of float) +0:412 step ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 'inF1' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r043' ( temp 3X3 matrix of float) +0:412 tangent ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r044' ( temp 3X3 matrix of float) +0:412 hyp. tangent ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 transpose ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 3X3 matrix of float) +0:412 'r046' ( temp 3X3 matrix of float) +0:412 trunc ( temp 3X3 matrix of float) +0:412 'inF0' ( in 3X3 matrix of float) +0:415 Branch: Return with expression +0:? Constant: +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:419 Function Definition: PixelShaderFunction4x4(mf44;mf44;mf44; ( temp 4X4 matrix of float) +0:419 Function Parameters: +0:419 'inF0' ( in 4X4 matrix of float) +0:419 'inF1' ( in 4X4 matrix of float) +0:419 'inF2' ( in 4X4 matrix of float) +0:? Sequence +0:421 Sequence +0:421 move second child to first child ( temp bool) +0:421 'r000' ( temp bool) +0:421 all ( temp bool) +0:421 Convert float to bool ( temp 4X4 matrix of bool) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r001' ( temp 4X4 matrix of float) +0:421 Absolute value ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 arc cosine ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp bool) +0:421 'r003' ( temp bool) +0:421 any ( temp bool) +0:421 Convert float to bool ( temp 4X4 matrix of bool) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r004' ( temp 4X4 matrix of float) +0:421 arc sine ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r005' ( temp 4X4 matrix of float) +0:421 arc tangent ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r006' ( temp 4X4 matrix of float) +0:421 arc tangent ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r007' ( temp 4X4 matrix of float) +0:421 Ceiling ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Test condition and select ( temp void) +0:421 Condition +0:421 any ( temp bool) +0:421 Compare Less Than ( temp 4X4 matrix of bool) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Constant: +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 0.000000 +0:421 true case +0:421 Branch: Kill +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r008' ( temp 4X4 matrix of float) +0:421 clamp ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 'inF2' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r009' ( temp 4X4 matrix of float) +0:421 cosine ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r010' ( temp 4X4 matrix of float) +0:421 hyp. cosine ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r011' ( temp 4X4 matrix of float) +0:421 dPdx ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r012' ( temp 4X4 matrix of float) +0:421 dPdxCoarse ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r013' ( temp 4X4 matrix of float) +0:421 dPdxFine ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r014' ( temp 4X4 matrix of float) +0:421 dPdy ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r015' ( temp 4X4 matrix of float) +0:421 dPdyCoarse ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r016' ( temp 4X4 matrix of float) +0:421 dPdyFine ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r017' ( temp 4X4 matrix of float) +0:421 degrees ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp float) +0:421 'r018' ( temp float) +0:421 determinant ( temp float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r019' ( temp 4X4 matrix of float) +0:421 exp ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'R020' ( temp 4X4 matrix of float) +0:421 exp2 ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r021' ( temp 4X4 matrix of float) +0:421 Floor ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r022' ( temp 4X4 matrix of float) +0:421 mod ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r023' ( temp 4X4 matrix of float) +0:421 Fraction ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r025' ( temp 4X4 matrix of float) +0:421 fwidth ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r026' ( temp 4X4 matrix of float) +0:421 ldexp ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r026a' ( temp 4X4 matrix of float) +0:421 mix ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 'inF2' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r027' ( temp 4X4 matrix of float) +0:421 log ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r028' ( temp 4X4 matrix of float) +0:421 matrix-scale ( temp 4X4 matrix of float) +0:421 log2 ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Constant: +0:421 0.301030 +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r029' ( temp 4X4 matrix of float) +0:421 log2 ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r030' ( temp 4X4 matrix of float) +0:421 max ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r031' ( temp 4X4 matrix of float) +0:421 min ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r032' ( temp 4X4 matrix of float) +0:421 pow ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r033' ( temp 4X4 matrix of float) +0:421 radians ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r034' ( temp 4X4 matrix of float) +0:421 roundEven ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r035' ( temp 4X4 matrix of float) +0:421 inverse sqrt ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r036' ( temp 4X4 matrix of float) +0:421 clamp ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Constant: +0:421 0.000000 +0:421 Constant: +0:421 1.000000 +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r037' ( temp 4X4 matrix of float) +0:421 Sign ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r038' ( temp 4X4 matrix of float) +0:421 sine ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 sine ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'inF2' ( in 4X4 matrix of float) +0:421 cosine ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r039' ( temp 4X4 matrix of float) +0:421 hyp. sine ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r049' ( temp 4X4 matrix of float) +0:421 smoothstep ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 'inF2' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r041' ( temp 4X4 matrix of float) +0:421 sqrt ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r042' ( temp 4X4 matrix of float) +0:421 step ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 'inF1' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r043' ( temp 4X4 matrix of float) +0:421 tangent ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r044' ( temp 4X4 matrix of float) +0:421 hyp. tangent ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 transpose ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:421 Sequence +0:421 move second child to first child ( temp 4X4 matrix of float) +0:421 'r046' ( temp 4X4 matrix of float) +0:421 trunc ( temp 4X4 matrix of float) +0:421 'inF0' ( in 4X4 matrix of float) +0:424 Branch: Return with expression +0:? Constant: +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:442 Function Definition: TestGenMul2(f1;f1;vf2;vf2;mf22;mf22; ( temp void) +0:442 Function Parameters: +0:442 'inF0' ( in float) +0:442 'inF1' ( in float) +0:442 'inFV0' ( in 2-component vector of float) +0:442 'inFV1' ( in 2-component vector of float) +0:442 'inFM0' ( in 2X2 matrix of float) +0:442 'inFM1' ( in 2X2 matrix of float) +0:? Sequence +0:443 Sequence +0:443 move second child to first child ( temp float) +0:443 'r0' ( temp float) +0:443 component-wise multiply ( temp float) +0:443 'inF1' ( in float) +0:443 'inF0' ( in float) +0:443 Sequence +0:443 move second child to first child ( temp 2-component vector of float) +0:443 'r1' ( temp 2-component vector of float) +0:443 vector-scale ( temp 2-component vector of float) +0:443 'inF0' ( in float) +0:443 'inFV0' ( in 2-component vector of float) +0:443 Sequence +0:443 move second child to first child ( temp 2-component vector of float) +0:443 'r2' ( temp 2-component vector of float) +0:443 vector-scale ( temp 2-component vector of float) +0:443 'inFV0' ( in 2-component vector of float) +0:443 'inF0' ( in float) +0:443 Sequence +0:443 move second child to first child ( temp float) +0:443 'r3' ( temp float) +0:443 dot-product ( temp float) +0:443 'inFV0' ( in 2-component vector of float) +0:443 'inFV1' ( in 2-component vector of float) +0:443 Sequence +0:443 move second child to first child ( temp 2-component vector of float) +0:443 'r4' ( temp 2-component vector of float) +0:443 vector-times-matrix ( temp 2-component vector of float) +0:443 'inFV0' ( in 2-component vector of float) +0:443 'inFM0' ( in 2X2 matrix of float) +0:443 Sequence +0:443 move second child to first child ( temp 2-component vector of float) +0:443 'r5' ( temp 2-component vector of float) +0:443 matrix-times-vector ( temp 2-component vector of float) +0:443 'inFM0' ( in 2X2 matrix of float) +0:443 'inFV0' ( in 2-component vector of float) +0:443 Sequence +0:443 move second child to first child ( temp 2X2 matrix of float) +0:443 'r6' ( temp 2X2 matrix of float) +0:443 matrix-scale ( temp 2X2 matrix of float) +0:443 'inF0' ( in float) +0:443 'inFM0' ( in 2X2 matrix of float) +0:443 Sequence +0:443 move second child to first child ( temp 2X2 matrix of float) +0:443 'r7' ( temp 2X2 matrix of float) +0:443 matrix-scale ( temp 2X2 matrix of float) +0:443 'inFM0' ( in 2X2 matrix of float) +0:443 'inF0' ( in float) +0:443 Sequence +0:443 move second child to first child ( temp 2X2 matrix of float) +0:443 'r8' ( temp 2X2 matrix of float) +0:443 matrix-multiply ( temp 2X2 matrix of float) +0:443 'inFM1' ( in 2X2 matrix of float) +0:443 'inFM0' ( in 2X2 matrix of float) +0:449 Function Definition: TestGenMul3(f1;f1;vf3;vf3;mf33;mf33; ( temp void) +0:449 Function Parameters: +0:449 'inF0' ( in float) +0:449 'inF1' ( in float) +0:449 'inFV0' ( in 3-component vector of float) +0:449 'inFV1' ( in 3-component vector of float) +0:449 'inFM0' ( in 3X3 matrix of float) +0:449 'inFM1' ( in 3X3 matrix of float) +0:? Sequence +0:450 Sequence +0:450 move second child to first child ( temp float) +0:450 'r0' ( temp float) +0:450 component-wise multiply ( temp float) +0:450 'inF1' ( in float) +0:450 'inF0' ( in float) +0:450 Sequence +0:450 move second child to first child ( temp 3-component vector of float) +0:450 'r1' ( temp 3-component vector of float) +0:450 vector-scale ( temp 3-component vector of float) +0:450 'inF0' ( in float) +0:450 'inFV0' ( in 3-component vector of float) +0:450 Sequence +0:450 move second child to first child ( temp 3-component vector of float) +0:450 'r2' ( temp 3-component vector of float) +0:450 vector-scale ( temp 3-component vector of float) +0:450 'inFV0' ( in 3-component vector of float) +0:450 'inF0' ( in float) +0:450 Sequence +0:450 move second child to first child ( temp float) +0:450 'r3' ( temp float) +0:450 dot-product ( temp float) +0:450 'inFV0' ( in 3-component vector of float) +0:450 'inFV1' ( in 3-component vector of float) +0:450 Sequence +0:450 move second child to first child ( temp 3-component vector of float) +0:450 'r4' ( temp 3-component vector of float) +0:450 vector-times-matrix ( temp 3-component vector of float) +0:450 'inFV0' ( in 3-component vector of float) +0:450 'inFM0' ( in 3X3 matrix of float) +0:450 Sequence +0:450 move second child to first child ( temp 3-component vector of float) +0:450 'r5' ( temp 3-component vector of float) +0:450 matrix-times-vector ( temp 3-component vector of float) +0:450 'inFM0' ( in 3X3 matrix of float) +0:450 'inFV0' ( in 3-component vector of float) +0:450 Sequence +0:450 move second child to first child ( temp 3X3 matrix of float) +0:450 'r6' ( temp 3X3 matrix of float) +0:450 matrix-scale ( temp 3X3 matrix of float) +0:450 'inF0' ( in float) +0:450 'inFM0' ( in 3X3 matrix of float) +0:450 Sequence +0:450 move second child to first child ( temp 3X3 matrix of float) +0:450 'r7' ( temp 3X3 matrix of float) +0:450 matrix-scale ( temp 3X3 matrix of float) +0:450 'inFM0' ( in 3X3 matrix of float) +0:450 'inF0' ( in float) +0:450 Sequence +0:450 move second child to first child ( temp 3X3 matrix of float) +0:450 'r8' ( temp 3X3 matrix of float) +0:450 matrix-multiply ( temp 3X3 matrix of float) +0:450 'inFM1' ( in 3X3 matrix of float) +0:450 'inFM0' ( in 3X3 matrix of float) +0:456 Function Definition: TestGenMul4(f1;f1;vf4;vf4;mf44;mf44; ( temp void) +0:456 Function Parameters: +0:456 'inF0' ( in float) +0:456 'inF1' ( in float) +0:456 'inFV0' ( in 4-component vector of float) +0:456 'inFV1' ( in 4-component vector of float) +0:456 'inFM0' ( in 4X4 matrix of float) +0:456 'inFM1' ( in 4X4 matrix of float) +0:? Sequence +0:457 Sequence +0:457 move second child to first child ( temp float) +0:457 'r0' ( temp float) +0:457 component-wise multiply ( temp float) +0:457 'inF1' ( in float) +0:457 'inF0' ( in float) +0:457 Sequence +0:457 move second child to first child ( temp 4-component vector of float) +0:457 'r1' ( temp 4-component vector of float) +0:457 vector-scale ( temp 4-component vector of float) +0:457 'inF0' ( in float) +0:457 'inFV0' ( in 4-component vector of float) +0:457 Sequence +0:457 move second child to first child ( temp 4-component vector of float) +0:457 'r2' ( temp 4-component vector of float) +0:457 vector-scale ( temp 4-component vector of float) +0:457 'inFV0' ( in 4-component vector of float) +0:457 'inF0' ( in float) +0:457 Sequence +0:457 move second child to first child ( temp float) +0:457 'r3' ( temp float) +0:457 dot-product ( temp float) +0:457 'inFV0' ( in 4-component vector of float) +0:457 'inFV1' ( in 4-component vector of float) +0:457 Sequence +0:457 move second child to first child ( temp 4-component vector of float) +0:457 'r4' ( temp 4-component vector of float) +0:457 vector-times-matrix ( temp 4-component vector of float) +0:457 'inFV0' ( in 4-component vector of float) +0:457 'inFM0' ( in 4X4 matrix of float) +0:457 Sequence +0:457 move second child to first child ( temp 4-component vector of float) +0:457 'r5' ( temp 4-component vector of float) +0:457 matrix-times-vector ( temp 4-component vector of float) +0:457 'inFM0' ( in 4X4 matrix of float) +0:457 'inFV0' ( in 4-component vector of float) +0:457 Sequence +0:457 move second child to first child ( temp 4X4 matrix of float) +0:457 'r6' ( temp 4X4 matrix of float) +0:457 matrix-scale ( temp 4X4 matrix of float) +0:457 'inF0' ( in float) +0:457 'inFM0' ( in 4X4 matrix of float) +0:457 Sequence +0:457 move second child to first child ( temp 4X4 matrix of float) +0:457 'r7' ( temp 4X4 matrix of float) +0:457 matrix-scale ( temp 4X4 matrix of float) +0:457 'inFM0' ( in 4X4 matrix of float) +0:457 'inF0' ( in float) +0:457 Sequence +0:457 move second child to first child ( temp 4X4 matrix of float) +0:457 'r8' ( temp 4X4 matrix of float) +0:457 matrix-multiply ( temp 4X4 matrix of float) +0:457 'inFM1' ( in 4X4 matrix of float) +0:457 'inFM0' ( in 4X4 matrix of float) +0:466 Function Definition: TestGenMulNxM(f1;f1;vf2;vf3;mf23;mf32;mf33;mf34;mf24; ( temp void) +0:466 Function Parameters: +0:466 'inF0' ( in float) +0:466 'inF1' ( in float) +0:466 'inFV2' ( in 2-component vector of float) +0:466 'inFV3' ( in 3-component vector of float) +0:466 'inFM2x3' ( in 2X3 matrix of float) +0:466 'inFM3x2' ( in 3X2 matrix of float) +0:466 'inFM3x3' ( in 3X3 matrix of float) +0:466 'inFM3x4' ( in 3X4 matrix of float) +0:466 'inFM2x4' ( in 2X4 matrix of float) +0:? Sequence +0:467 Sequence +0:467 move second child to first child ( temp float) +0:467 'r00' ( temp float) +0:467 component-wise multiply ( temp float) +0:467 'inF1' ( in float) +0:467 'inF0' ( in float) +0:468 Sequence +0:468 move second child to first child ( temp 2-component vector of float) +0:468 'r01' ( temp 2-component vector of float) +0:468 vector-scale ( temp 2-component vector of float) +0:468 'inF0' ( in float) +0:468 'inFV2' ( in 2-component vector of float) +0:469 Sequence +0:469 move second child to first child ( temp 3-component vector of float) +0:469 'r02' ( temp 3-component vector of float) +0:469 vector-scale ( temp 3-component vector of float) +0:469 'inF0' ( in float) +0:469 'inFV3' ( in 3-component vector of float) +0:470 Sequence +0:470 move second child to first child ( temp 2-component vector of float) +0:470 'r03' ( temp 2-component vector of float) +0:470 vector-scale ( temp 2-component vector of float) +0:470 'inFV2' ( in 2-component vector of float) +0:470 'inF0' ( in float) +0:471 Sequence +0:471 move second child to first child ( temp 3-component vector of float) +0:471 'r04' ( temp 3-component vector of float) +0:471 vector-scale ( temp 3-component vector of float) +0:471 'inFV3' ( in 3-component vector of float) +0:471 'inF0' ( in float) +0:472 Sequence +0:472 move second child to first child ( temp float) +0:472 'r05' ( temp float) +0:472 dot-product ( temp float) +0:472 'inFV2' ( in 2-component vector of float) +0:472 'inFV2' ( in 2-component vector of float) +0:473 Sequence +0:473 move second child to first child ( temp float) +0:473 'r06' ( temp float) +0:473 dot-product ( temp float) +0:473 'inFV3' ( in 3-component vector of float) +0:473 'inFV3' ( in 3-component vector of float) +0:474 Sequence +0:474 move second child to first child ( temp 3-component vector of float) +0:474 'r07' ( temp 3-component vector of float) +0:474 matrix-times-vector ( temp 3-component vector of float) +0:474 'inFM2x3' ( in 2X3 matrix of float) +0:474 'inFV2' ( in 2-component vector of float) +0:475 Sequence +0:475 move second child to first child ( temp 2-component vector of float) +0:475 'r08' ( temp 2-component vector of float) +0:475 matrix-times-vector ( temp 2-component vector of float) +0:475 'inFM3x2' ( in 3X2 matrix of float) +0:475 'inFV3' ( in 3-component vector of float) +0:476 Sequence +0:476 move second child to first child ( temp 2-component vector of float) +0:476 'r09' ( temp 2-component vector of float) +0:476 vector-times-matrix ( temp 2-component vector of float) +0:476 'inFV3' ( in 3-component vector of float) +0:476 'inFM2x3' ( in 2X3 matrix of float) +0:477 Sequence +0:477 move second child to first child ( temp 3-component vector of float) +0:477 'r10' ( temp 3-component vector of float) +0:477 vector-times-matrix ( temp 3-component vector of float) +0:477 'inFV2' ( in 2-component vector of float) +0:477 'inFM3x2' ( in 3X2 matrix of float) +0:478 Sequence +0:478 move second child to first child ( temp 2X3 matrix of float) +0:478 'r11' ( temp 2X3 matrix of float) +0:478 matrix-scale ( temp 2X3 matrix of float) +0:478 'inF0' ( in float) +0:478 'inFM2x3' ( in 2X3 matrix of float) +0:479 Sequence +0:479 move second child to first child ( temp 3X2 matrix of float) +0:479 'r12' ( temp 3X2 matrix of float) +0:479 matrix-scale ( temp 3X2 matrix of float) +0:479 'inF0' ( in float) +0:479 'inFM3x2' ( in 3X2 matrix of float) +0:480 Sequence +0:480 move second child to first child ( temp 2X2 matrix of float) +0:480 'r13' ( temp 2X2 matrix of float) +0:480 matrix-multiply ( temp 2X2 matrix of float) +0:480 'inFM3x2' ( in 3X2 matrix of float) +0:480 'inFM2x3' ( in 2X3 matrix of float) +0:481 Sequence +0:481 move second child to first child ( temp 2X3 matrix of float) +0:481 'r14' ( temp 2X3 matrix of float) +0:481 matrix-multiply ( temp 2X3 matrix of float) +0:481 'inFM3x3' ( in 3X3 matrix of float) +0:481 'inFM2x3' ( in 2X3 matrix of float) +0:482 Sequence +0:482 move second child to first child ( temp 2X4 matrix of float) +0:482 'r15' ( temp 2X4 matrix of float) +0:482 matrix-multiply ( temp 2X4 matrix of float) +0:482 'inFM3x4' ( in 3X4 matrix of float) +0:482 'inFM2x3' ( in 2X3 matrix of float) +0:483 Sequence +0:483 move second child to first child ( temp 3X4 matrix of float) +0:483 'r16' ( temp 3X4 matrix of float) +0:483 matrix-multiply ( temp 3X4 matrix of float) +0:483 'inFM2x4' ( in 2X4 matrix of float) +0:483 'inFM3x2' ( in 3X2 matrix of float) +0:489 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:489 Function Parameters: +0:? Sequence +0:491 move second child to first child ( temp 4-component vector of float) +0:491 color: direct index for structure ( temp 4-component vector of float) +0:491 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:491 Constant: +0:491 0 (const int) +0:491 Constant: +0:491 1.000000 +0:491 1.000000 +0:491 1.000000 +0:491 1.000000 +0:492 Branch: Return with expression +0:492 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:489 Function Definition: main( ( temp void) +0:489 Function Parameters: +0:? Sequence +0:489 Sequence +0:489 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:489 color: direct index for structure ( temp 4-component vector of float) +0:489 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:489 Constant: +0:489 0 (const int) +0:? Linker Objects +0:? 'gs_ua' ( shared uint) +0:? 'gs_ub' ( shared uint) +0:? 'gs_uc' ( shared uint) +0:? 'gs_ua2' ( shared 2-component vector of uint) +0:? 'gs_ub2' ( shared 2-component vector of uint) +0:? 'gs_uc2' ( shared 2-component vector of uint) +0:? 'gs_ua3' ( shared 3-component vector of uint) +0:? 'gs_ub3' ( shared 3-component vector of uint) +0:? 'gs_uc3' ( shared 3-component vector of uint) +0:? 'gs_ua4' ( shared 4-component vector of uint) +0:? 'gs_ub4' ( shared 4-component vector of uint) +0:? 'gs_uc4' ( shared 4-component vector of uint) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: Matrix types can only be parameterized with floating-point types. + %mat2v2bool = OpTypeMatrix %v2bool 2 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 1836 + + Capability Shader + Capability DerivativeControl + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 1817 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 18 "PixelShaderFunctionS(f1;f1;f1;u1;i1;" + Name 13 "inF0" + Name 14 "inF1" + Name 15 "inF2" + Name 16 "inU0" + Name 17 "inU1" + Name 24 "PixelShaderFunction1(vf1;vf1;vf1;" + Name 21 "inF0" + Name 22 "inF1" + Name 23 "inF2" + Name 36 "PixelShaderFunction2(vf2;vf2;vf2;vu2;vu2;" + Name 31 "inF0" + Name 32 "inF1" + Name 33 "inF2" + Name 34 "inU0" + Name 35 "inU1" + Name 48 "PixelShaderFunction3(vf3;vf3;vf3;vu3;vu3;" + Name 43 "inF0" + Name 44 "inF1" + Name 45 "inF2" + Name 46 "inU0" + Name 47 "inU1" + Name 60 "PixelShaderFunction(vf4;vf4;vf4;vu4;vu4;" + Name 55 "inF0" + Name 56 "inF1" + Name 57 "inF2" + Name 58 "inU0" + Name 59 "inU1" + Name 68 "PixelShaderFunction2x2(mf22;mf22;mf22;" + Name 65 "inF0" + Name 66 "inF1" + Name 67 "inF2" + Name 76 "PixelShaderFunction3x3(mf33;mf33;mf33;" + Name 73 "inF0" + Name 74 "inF1" + Name 75 "inF2" + Name 84 "PixelShaderFunction4x4(mf44;mf44;mf44;" + Name 81 "inF0" + Name 82 "inF1" + Name 83 "inF2" + Name 93 "TestGenMul2(f1;f1;vf2;vf2;mf22;mf22;" + Name 87 "inF0" + Name 88 "inF1" + Name 89 "inFV0" + Name 90 "inFV1" + Name 91 "inFM0" + Name 92 "inFM1" + Name 102 "TestGenMul3(f1;f1;vf3;vf3;mf33;mf33;" + Name 96 "inF0" + Name 97 "inF1" + Name 98 "inFV0" + Name 99 "inFV1" + Name 100 "inFM0" + Name 101 "inFM1" + Name 111 "TestGenMul4(f1;f1;vf4;vf4;mf44;mf44;" + Name 105 "inF0" + Name 106 "inF1" + Name 107 "inFV0" + Name 108 "inFV1" + Name 109 "inFM0" + Name 110 "inFM1" + Name 131 "TestGenMulNxM(f1;f1;vf2;vf3;mf23;mf32;mf33;mf34;mf24;" + Name 122 "inF0" + Name 123 "inF1" + Name 124 "inFV2" + Name 125 "inFV3" + Name 126 "inFM2x3" + Name 127 "inFM3x2" + Name 128 "inFM3x3" + Name 129 "inFM3x4" + Name 130 "inFM2x4" + Name 133 "PS_OUTPUT" + MemberName 133(PS_OUTPUT) 0 "color" + Name 135 "@main(" + Name 139 "r000" + Name 144 "r001" + Name 147 "r002" + Name 150 "r003" + Name 154 "r004" + Name 157 "r005" + Name 160 "r006" + Name 163 "r007" + Name 166 "r009" + Name 169 "r010" + Name 173 "r011" + Name 176 "r012" + Name 192 "r014" + Name 195 "r015" + Name 198 "r016" + Name 201 "r017" + Name 204 "r018" + Name 207 "r019" + Name 210 "r020" + Name 213 "r021" + Name 216 "r022" + Name 219 "r023" + Name 222 "r024" + Name 226 "r027" + Name 229 "r028" + Name 232 "r029" + Name 235 "r030" + Name 238 "r031" + Name 241 "r033" + Name 245 "r034" + Name 248 "r036" + Name 251 "r037" + Name 254 "r038" + Name 257 "r039" + Name 261 "r039a" + Name 266 "r040" + Name 269 "r041" + Name 274 "r042" + Name 277 "r043" + Name 281 "r044" + Name 285 "r045" + Name 289 "r046" + Name 292 "r047" + Name 296 "r048" + Name 300 "r049" + Name 303 "r050" + Name 306 "r051" + Name 309 "r052" + Name 312 "r053" + Name 319 "r055" + Name 322 "r056" + Name 327 "r057" + Name 330 "r058" + Name 334 "r059" + Name 337 "r060" + Name 340 "r061" + Name 347 "r000" + Name 353 "r001" + Name 356 "r002" + Name 359 "r003" + Name 363 "r004" + Name 368 "r005" + Name 371 "r006" + Name 374 "r007" + Name 377 "r009" + Name 380 "r010" + Name 384 "r011" + Name 387 "r012" + Name 406 "r013" + Name 409 "r015" + Name 412 "r016" + Name 416 "r017" + Name 419 "r018" + Name 422 "r019" + Name 425 "r020" + Name 428 "r021" + Name 431 "r022" + Name 434 "r023" + Name 437 "r026" + Name 441 "r027" + Name 445 "r028" + Name 448 "r029" + Name 451 "r030" + Name 456 "r031" + Name 461 "r032" + Name 463 "r033" + Name 466 "r035" + Name 470 "r036" + Name 473 "r038" + Name 477 "r039" + Name 480 "r040" + Name 483 "r041" + Name 487 "r039a" + Name 492 "r042" + Name 495 "r043" + Name 498 "r044" + Name 502 "r045" + Name 505 "r046" + Name 509 "r047" + Name 513 "r048" + Name 516 "r049" + Name 520 "r050" + Name 523 "r051" + Name 527 "r052" + Name 531 "r053" + Name 536 "r054" + Name 541 "r055" + Name 544 "r056" + Name 547 "r057" + Name 552 "r058" + Name 555 "r059" + Name 562 "r060" + Name 565 "r061" + Name 570 "r062" + Name 573 "r063" + Name 577 "r064" + Name 580 "r065" + Name 583 "r066" + Name 589 "r000" + Name 595 "r001" + Name 598 "r002" + Name 601 "r003" + Name 605 "r004" + Name 610 "r005" + Name 613 "r006" + Name 616 "r007" + Name 619 "r009" + Name 622 "r010" + Name 626 "r011" + Name 629 "r012" + Name 647 "r013" + Name 650 "r014" + Name 653 "r015" + Name 658 "r016" + Name 662 "r017" + Name 665 "r018" + Name 668 "r019" + Name 671 "r020" + Name 674 "r021" + Name 677 "r022" + Name 680 "r023" + Name 683 "r024" + Name 687 "r025" + Name 691 "r029" + Name 694 "r030" + Name 697 "r031" + Name 702 "r032" + Name 706 "r033" + Name 708 "r034" + Name 711 "r036" + Name 715 "r037" + Name 718 "r039" + Name 722 "r040" + Name 725 "r041" + Name 728 "r042" + Name 732 "r039a" + Name 737 "r039b" + Name 743 "r043" + Name 746 "r044" + Name 749 "r045" + Name 753 "r046" + Name 756 "r047" + Name 760 "r048" + Name 764 "r049" + Name 767 "r050" + Name 771 "r051" + Name 774 "r052" + Name 778 "r053" + Name 782 "r054" + Name 786 "r055" + Name 789 "r056" + Name 792 "r057" + Name 795 "r058" + Name 800 "r059" + Name 803 "r060" + Name 810 "r061" + Name 813 "r062" + Name 818 "r063" + Name 821 "r064" + Name 825 "r065" + Name 828 "r066" + Name 831 "r067" + Name 838 "r000" + Name 844 "r001" + Name 847 "r002" + Name 850 "r003" + Name 854 "r004" + Name 859 "r005" + Name 862 "r006" + Name 865 "r007" + Name 868 "r009" + Name 871 "r010" + Name 875 "r011" + Name 878 "r012" + Name 896 "r013" + Name 899 "r014" + Name 902 "r015" + Name 905 "r016" + Name 908 "r017" + Name 911 "r018" + Name 914 "r019" + Name 917 "r020" + Name 920 "r021" + Name 923 "r022" + Name 926 "r023" + Name 930 "r024" + Name 934 "r025" + Name 945 "r029" + Name 948 "r030" + Name 951 "r031" + Name 956 "r032" + Name 961 "r033" + Name 963 "r034" + Name 966 "r036" + Name 970 "r037" + Name 973 "r039" + Name 977 "r040" + Name 980 "r041" + Name 983 "r042" + Name 987 "r039a" + Name 992 "r043" + Name 995 "r044" + Name 998 "r045" + Name 1002 "r046" + Name 1005 "r047" + Name 1009 "r048" + Name 1013 "r049" + Name 1016 "r050" + Name 1020 "r051" + Name 1023 "r052" + Name 1027 "r053" + Name 1031 "r054" + Name 1035 "r055" + Name 1038 "r056" + Name 1041 "r057" + Name 1044 "r058" + Name 1049 "r059" + Name 1052 "r060" + Name 1059 "r061" + Name 1062 "r062" + Name 1067 "r063" + Name 1070 "r064" + Name 1074 "r065" + Name 1077 "r066" + Name 1080 "r067" + Name 1087 "r000" + Name 1092 "r001" + Name 1097 "r003" + Name 1101 "r004" + Name 1104 "r005" + Name 1107 "r006" + Name 1111 "r007" + Name 1121 "r008" + Name 1126 "r009" + Name 1129 "r010" + Name 1132 "r011" + Name 1135 "r012" + Name 1138 "r013" + Name 1141 "r014" + Name 1144 "r015" + Name 1147 "r016" + Name 1150 "r017" + Name 1153 "r018" + Name 1156 "r019" + Name 1159 "R020" + Name 1162 "r021" + Name 1165 "r022" + Name 1175 "r023" + Name 1178 "r025" + Name 1181 "r026" + Name 1185 "r026a" + Name 1190 "r027" + Name 1193 "r028" + Name 1197 "r029" + Name 1200 "r030" + Name 1204 "r031" + Name 1208 "r032" + Name 1212 "r033" + Name 1215 "r034" + Name 1218 "r035" + Name 1221 "r036" + Name 1226 "r037" + Name 1229 "r038" + Name 1236 "r039" + Name 1239 "r049" + Name 1244 "r041" + Name 1247 "r042" + Name 1251 "r043" + Name 1254 "r044" + Name 1259 "r046" + Name 1266 "r000" + Name 1271 "r001" + Name 1276 "r003" + Name 1280 "r004" + Name 1283 "r005" + Name 1286 "r006" + Name 1290 "r007" + Name 1300 "r008" + Name 1305 "r009" + Name 1308 "r010" + Name 1311 "r011" + Name 1314 "r012" + Name 1317 "r013" + Name 1320 "r014" + Name 1323 "r015" + Name 1326 "r016" + Name 1329 "r017" + Name 1332 "r018" + Name 1335 "r019" + Name 1338 "R020" + Name 1341 "r021" + Name 1344 "r022" + Name 1357 "r023" + Name 1360 "r025" + Name 1363 "r026" + Name 1367 "r026a" + Name 1372 "r027" + Name 1375 "r028" + Name 1379 "r029" + Name 1382 "r030" + Name 1386 "r031" + Name 1390 "r032" + Name 1394 "r033" + Name 1397 "r034" + Name 1400 "r035" + Name 1403 "r036" + Name 1408 "r037" + Name 1411 "r038" + Name 1418 "r039" + Name 1421 "r049" + Name 1426 "r041" + Name 1429 "r042" + Name 1433 "r043" + Name 1436 "r044" + Name 1441 "r046" + Name 1448 "r000" + Name 1453 "r001" + Name 1458 "r003" + Name 1462 "r004" + Name 1465 "r005" + Name 1468 "r006" + Name 1472 "r007" + Name 1482 "r008" + Name 1487 "r009" + Name 1490 "r010" + Name 1493 "r011" + Name 1496 "r012" + Name 1499 "r013" + Name 1502 "r014" + Name 1505 "r015" + Name 1508 "r016" + Name 1511 "r017" + Name 1514 "r018" + Name 1517 "r019" + Name 1520 "R020" + Name 1523 "r021" + Name 1526 "r022" + Name 1542 "r023" + Name 1545 "r025" + Name 1548 "r026" + Name 1552 "r026a" + Name 1557 "r027" + Name 1560 "r028" + Name 1564 "r029" + Name 1567 "r030" + Name 1571 "r031" + Name 1575 "r032" + Name 1579 "r033" + Name 1582 "r034" + Name 1585 "r035" + Name 1588 "r036" + Name 1593 "r037" + Name 1596 "r038" + Name 1603 "r039" + Name 1606 "r049" + Name 1611 "r041" + Name 1614 "r042" + Name 1618 "r043" + Name 1621 "r044" + Name 1626 "r046" + Name 1633 "r0" + Name 1637 "r1" + Name 1641 "r2" + Name 1645 "r3" + Name 1649 "r4" + Name 1653 "r5" + Name 1657 "r6" + Name 1661 "r7" + Name 1665 "r8" + Name 1669 "r0" + Name 1673 "r1" + Name 1677 "r2" + Name 1681 "r3" + Name 1685 "r4" + Name 1689 "r5" + Name 1693 "r6" + Name 1697 "r7" + Name 1701 "r8" + Name 1705 "r0" + Name 1709 "r1" + Name 1713 "r2" + Name 1717 "r3" + Name 1721 "r4" + Name 1725 "r5" + Name 1729 "r6" + Name 1733 "r7" + Name 1737 "r8" + Name 1741 "r00" + Name 1745 "r01" + Name 1749 "r02" + Name 1753 "r03" + Name 1757 "r04" + Name 1761 "r05" + Name 1765 "r06" + Name 1769 "r07" + Name 1773 "r08" + Name 1777 "r09" + Name 1781 "r10" + Name 1785 "r11" + Name 1789 "r12" + Name 1793 "r13" + Name 1797 "r14" + Name 1801 "r15" + Name 1805 "r16" + Name 1810 "ps_output" + Name 1817 "@entryPointOutput.color" + Name 1821 "gs_ua" + Name 1822 "gs_ub" + Name 1823 "gs_uc" + Name 1825 "gs_ua2" + Name 1826 "gs_ub2" + Name 1827 "gs_uc2" + Name 1829 "gs_ua3" + Name 1830 "gs_ub3" + Name 1831 "gs_uc3" + Name 1833 "gs_ua4" + Name 1834 "gs_ub4" + Name 1835 "gs_uc4" + Decorate 1817(@entryPointOutput.color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeInt 32 0 + 9: TypePointer Function 8(int) + 10: TypeInt 32 1 + 11: TypePointer Function 10(int) + 12: TypeFunction 6(float) 7(ptr) 7(ptr) 7(ptr) 9(ptr) 11(ptr) + 20: TypeFunction 6(float) 7(ptr) 7(ptr) 7(ptr) + 26: TypeVector 6(float) 2 + 27: TypePointer Function 26(fvec2) + 28: TypeVector 8(int) 2 + 29: TypePointer Function 28(ivec2) + 30: TypeFunction 26(fvec2) 27(ptr) 27(ptr) 27(ptr) 29(ptr) 29(ptr) + 38: TypeVector 6(float) 3 + 39: TypePointer Function 38(fvec3) + 40: TypeVector 8(int) 3 + 41: TypePointer Function 40(ivec3) + 42: TypeFunction 38(fvec3) 39(ptr) 39(ptr) 39(ptr) 41(ptr) 41(ptr) + 50: TypeVector 6(float) 4 + 51: TypePointer Function 50(fvec4) + 52: TypeVector 8(int) 4 + 53: TypePointer Function 52(ivec4) + 54: TypeFunction 50(fvec4) 51(ptr) 51(ptr) 51(ptr) 53(ptr) 53(ptr) + 62: TypeMatrix 26(fvec2) 2 + 63: TypePointer Function 62 + 64: TypeFunction 62 63(ptr) 63(ptr) 63(ptr) + 70: TypeMatrix 38(fvec3) 3 + 71: TypePointer Function 70 + 72: TypeFunction 70 71(ptr) 71(ptr) 71(ptr) + 78: TypeMatrix 50(fvec4) 4 + 79: TypePointer Function 78 + 80: TypeFunction 78 79(ptr) 79(ptr) 79(ptr) + 86: TypeFunction 2 7(ptr) 7(ptr) 27(ptr) 27(ptr) 63(ptr) 63(ptr) + 95: TypeFunction 2 7(ptr) 7(ptr) 39(ptr) 39(ptr) 71(ptr) 71(ptr) + 104: TypeFunction 2 7(ptr) 7(ptr) 51(ptr) 51(ptr) 79(ptr) 79(ptr) + 113: TypeMatrix 38(fvec3) 2 + 114: TypePointer Function 113 + 115: TypeMatrix 26(fvec2) 3 + 116: TypePointer Function 115 + 117: TypeMatrix 50(fvec4) 3 + 118: TypePointer Function 117 + 119: TypeMatrix 50(fvec4) 2 + 120: TypePointer Function 119 + 121: TypeFunction 2 7(ptr) 7(ptr) 27(ptr) 39(ptr) 114(ptr) 116(ptr) 71(ptr) 118(ptr) 120(ptr) + 133(PS_OUTPUT): TypeStruct 50(fvec4) + 134: TypeFunction 133(PS_OUTPUT) + 137: TypeBool + 138: TypePointer Function 137(bool) + 141: 6(float) Constant 0 + 187: 10(int) Constant 0 + 199: 10(int) Constant 7 + 272: 6(float) Constant 1050288283 + 293: 6(float) Constant 1065353216 + 297: 10(int) Constant 2 + 349: TypeVector 137(bool) 2 + 350: 26(fvec2) ConstantComposite 141 141 + 366: TypeVector 10(int) 2 + 367: TypePointer Function 366(ivec2) + 399: 8(int) Constant 0 + 400: 28(ivec2) ConstantComposite 399 399 + 413: 10(int) Constant 3 + 414: 366(ivec2) ConstantComposite 199 413 + 457: 8(int) Constant 7 + 458: 8(int) Constant 8 + 459: 28(ivec2) ConstantComposite 457 458 + 476: TypePointer Function 349(bvec2) + 534: 6(float) Constant 1073741824 + 537: 8(int) Constant 1 + 538: 8(int) Constant 2 + 539: 28(ivec2) ConstantComposite 537 538 + 586: 26(fvec2) ConstantComposite 293 534 + 591: TypeVector 137(bool) 3 + 592: 38(fvec3) ConstantComposite 141 141 141 + 608: TypeVector 10(int) 3 + 609: TypePointer Function 608(ivec3) + 641: 40(ivec3) ConstantComposite 399 399 399 + 654: 8(int) Constant 3 + 655: 8(int) Constant 5 + 656: 40(ivec3) ConstantComposite 457 654 655 + 703: 8(int) Constant 4 + 704: 40(ivec3) ConstantComposite 538 654 703 + 721: TypePointer Function 591(bvec3) + 740: 6(float) Constant 1050253722 + 787: 40(ivec3) ConstantComposite 537 538 654 + 834: 6(float) Constant 1077936128 + 835: 38(fvec3) ConstantComposite 293 534 834 + 840: TypeVector 137(bool) 4 + 841: 50(fvec4) ConstantComposite 141 141 141 141 + 857: TypeVector 10(int) 4 + 858: TypePointer Function 857(ivec4) + 890: 52(ivec4) ConstantComposite 399 399 399 399 + 903: 52(ivec4) ConstantComposite 457 654 655 538 + 957: 8(int) Constant 9 + 958: 8(int) Constant 10 + 959: 52(ivec4) ConstantComposite 457 458 957 958 + 976: TypePointer Function 840(bvec4) + 1036: 52(ivec4) ConstantComposite 537 538 654 703 + 1083: 6(float) Constant 1082130432 + 1084: 50(fvec4) ConstantComposite 293 534 834 1083 + 1089: TypeMatrix 349(bvec2) 2 + 1115: 62 ConstantComposite 350 350 + 1262: 26(fvec2) ConstantComposite 534 534 + 1263: 62 ConstantComposite 1262 1262 + 1268: TypeMatrix 591(bvec3) 3 + 1294: 70 ConstantComposite 592 592 592 + 1444: 38(fvec3) ConstantComposite 834 834 834 + 1445: 70 ConstantComposite 1444 1444 1444 + 1450: TypeMatrix 840(bvec4) 4 + 1476: 78 ConstantComposite 841 841 841 841 + 1629: 50(fvec4) ConstantComposite 1083 1083 1083 1083 + 1630: 78 ConstantComposite 1629 1629 1629 1629 + 1809: TypePointer Function 133(PS_OUTPUT) + 1811: 50(fvec4) ConstantComposite 293 293 293 293 + 1816: TypePointer Output 50(fvec4) +1817(@entryPointOutput.color): 1816(ptr) Variable Output + 1820: TypePointer Workgroup 8(int) + 1821(gs_ua): 1820(ptr) Variable Workgroup + 1822(gs_ub): 1820(ptr) Variable Workgroup + 1823(gs_uc): 1820(ptr) Variable Workgroup + 1824: TypePointer Workgroup 28(ivec2) + 1825(gs_ua2): 1824(ptr) Variable Workgroup + 1826(gs_ub2): 1824(ptr) Variable Workgroup + 1827(gs_uc2): 1824(ptr) Variable Workgroup + 1828: TypePointer Workgroup 40(ivec3) + 1829(gs_ua3): 1828(ptr) Variable Workgroup + 1830(gs_ub3): 1828(ptr) Variable Workgroup + 1831(gs_uc3): 1828(ptr) Variable Workgroup + 1832: TypePointer Workgroup 52(ivec4) + 1833(gs_ua4): 1832(ptr) Variable Workgroup + 1834(gs_ub4): 1832(ptr) Variable Workgroup + 1835(gs_uc4): 1832(ptr) Variable Workgroup + 4(main): 2 Function None 3 + 5: Label + 1818:133(PS_OUTPUT) FunctionCall 135(@main() + 1819: 50(fvec4) CompositeExtract 1818 0 + Store 1817(@entryPointOutput.color) 1819 + Return + FunctionEnd +18(PixelShaderFunctionS(f1;f1;f1;u1;i1;): 6(float) Function None 12 + 13(inF0): 7(ptr) FunctionParameter + 14(inF1): 7(ptr) FunctionParameter + 15(inF2): 7(ptr) FunctionParameter + 16(inU0): 9(ptr) FunctionParameter + 17(inU1): 11(ptr) FunctionParameter + 19: Label + 139(r000): 138(ptr) Variable Function + 144(r001): 7(ptr) Variable Function + 147(r002): 7(ptr) Variable Function + 150(r003): 138(ptr) Variable Function + 154(r004): 7(ptr) Variable Function + 157(r005): 11(ptr) Variable Function + 160(r006): 9(ptr) Variable Function + 163(r007): 7(ptr) Variable Function + 166(r009): 7(ptr) Variable Function + 169(r010): 7(ptr) Variable Function + 173(r011): 7(ptr) Variable Function + 176(r012): 7(ptr) Variable Function + 192(r014): 7(ptr) Variable Function + 195(r015): 7(ptr) Variable Function + 198(r016): 11(ptr) Variable Function + 201(r017): 7(ptr) Variable Function + 204(r018): 7(ptr) Variable Function + 207(r019): 7(ptr) Variable Function + 210(r020): 7(ptr) Variable Function + 213(r021): 7(ptr) Variable Function + 216(r022): 7(ptr) Variable Function + 219(r023): 7(ptr) Variable Function + 222(r024): 7(ptr) Variable Function + 226(r027): 7(ptr) Variable Function + 229(r028): 7(ptr) Variable Function + 232(r029): 9(ptr) Variable Function + 235(r030): 9(ptr) Variable Function + 238(r031): 7(ptr) Variable Function + 241(r033): 7(ptr) Variable Function + 245(r034): 7(ptr) Variable Function + 248(r036): 7(ptr) Variable Function + 251(r037): 138(ptr) Variable Function + 254(r038): 138(ptr) Variable Function + 257(r039): 7(ptr) Variable Function + 261(r039a): 7(ptr) Variable Function + 266(r040): 7(ptr) Variable Function + 269(r041): 7(ptr) Variable Function + 274(r042): 7(ptr) Variable Function + 277(r043): 7(ptr) Variable Function + 281(r044): 7(ptr) Variable Function + 285(r045): 7(ptr) Variable Function + 289(r046): 7(ptr) Variable Function + 292(r047): 7(ptr) Variable Function + 296(r048): 9(ptr) Variable Function + 300(r049): 7(ptr) Variable Function + 303(r050): 7(ptr) Variable Function + 306(r051): 7(ptr) Variable Function + 309(r052): 7(ptr) Variable Function + 312(r053): 7(ptr) Variable Function + 319(r055): 7(ptr) Variable Function + 322(r056): 7(ptr) Variable Function + 327(r057): 7(ptr) Variable Function + 330(r058): 7(ptr) Variable Function + 334(r059): 7(ptr) Variable Function + 337(r060): 7(ptr) Variable Function + 340(r061): 7(ptr) Variable Function + 140: 6(float) Load 13(inF0) + 142: 137(bool) FOrdNotEqual 140 141 + 143: 137(bool) All 142 + Store 139(r000) 143 + 145: 6(float) Load 13(inF0) + 146: 6(float) ExtInst 1(GLSL.std.450) 4(FAbs) 145 + Store 144(r001) 146 + 148: 6(float) Load 13(inF0) + 149: 6(float) ExtInst 1(GLSL.std.450) 17(Acos) 148 + Store 147(r002) 149 + 151: 6(float) Load 13(inF0) + 152: 137(bool) FOrdNotEqual 151 141 + 153: 137(bool) Any 152 + Store 150(r003) 153 + 155: 6(float) Load 13(inF0) + 156: 6(float) ExtInst 1(GLSL.std.450) 16(Asin) 155 + Store 154(r004) 156 + 158: 6(float) Load 13(inF0) + 159: 10(int) Bitcast 158 + Store 157(r005) 159 + 161: 10(int) Load 17(inU1) + 162: 8(int) Bitcast 161 + Store 160(r006) 162 + 164: 8(int) Load 16(inU0) + 165: 6(float) Bitcast 164 + Store 163(r007) 165 + 167: 6(float) Load 13(inF0) + 168: 6(float) ExtInst 1(GLSL.std.450) 18(Atan) 167 + Store 166(r009) 168 + 170: 6(float) Load 13(inF0) + 171: 6(float) Load 14(inF1) + 172: 6(float) ExtInst 1(GLSL.std.450) 25(Atan2) 170 171 + Store 169(r010) 172 + 174: 6(float) Load 13(inF0) + 175: 6(float) ExtInst 1(GLSL.std.450) 9(Ceil) 174 + Store 173(r011) 175 + 177: 6(float) Load 13(inF0) + 178: 6(float) Load 14(inF1) + 179: 6(float) Load 15(inF2) + 180: 6(float) ExtInst 1(GLSL.std.450) 43(FClamp) 177 178 179 + Store 176(r012) 180 + 181: 6(float) Load 13(inF0) + 182: 137(bool) FOrdLessThan 181 141 + SelectionMerge 184 None + BranchConditional 182 183 184 + 183: Label + Kill + 184: Label + 186: 10(int) Load 157(r005) + 188: 137(bool) SLessThan 186 187 + SelectionMerge 190 None + BranchConditional 188 189 190 + 189: Label + Kill + 190: Label + 193: 6(float) Load 13(inF0) + 194: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 193 + Store 192(r014) 194 + 196: 6(float) Load 13(inF0) + 197: 6(float) ExtInst 1(GLSL.std.450) 20(Cosh) 196 + Store 195(r015) 197 + 200: 10(int) BitCount 199 + Store 198(r016) 200 + 202: 6(float) Load 13(inF0) + 203: 6(float) DPdx 202 + Store 201(r017) 203 + 205: 6(float) Load 13(inF0) + 206: 6(float) DPdxCoarse 205 + Store 204(r018) 206 + 208: 6(float) Load 13(inF0) + 209: 6(float) DPdxFine 208 + Store 207(r019) 209 + 211: 6(float) Load 13(inF0) + 212: 6(float) DPdy 211 + Store 210(r020) 212 + 214: 6(float) Load 13(inF0) + 215: 6(float) DPdyCoarse 214 + Store 213(r021) 215 + 217: 6(float) Load 13(inF0) + 218: 6(float) DPdyFine 217 + Store 216(r022) 218 + 220: 6(float) Load 13(inF0) + 221: 6(float) ExtInst 1(GLSL.std.450) 12(Degrees) 220 + Store 219(r023) 221 + 223: 6(float) Load 13(inF0) + 224: 6(float) Load 14(inF1) + 225: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 223 224 + Store 222(r024) 225 + 227: 6(float) Load 13(inF0) + 228: 6(float) ExtInst 1(GLSL.std.450) 27(Exp) 227 + Store 226(r027) 228 + 230: 6(float) Load 13(inF0) + 231: 6(float) ExtInst 1(GLSL.std.450) 29(Exp2) 230 + Store 229(r028) 231 + 233: 10(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 199 + 234: 8(int) Bitcast 233 + Store 232(r029) 234 + 236: 10(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 199 + 237: 8(int) Bitcast 236 + Store 235(r030) 237 + 239: 6(float) Load 13(inF0) + 240: 6(float) ExtInst 1(GLSL.std.450) 8(Floor) 239 + Store 238(r031) 240 + 242: 6(float) Load 13(inF0) + 243: 6(float) Load 14(inF1) + 244: 6(float) FMod 242 243 + Store 241(r033) 244 + 246: 6(float) Load 13(inF0) + 247: 6(float) ExtInst 1(GLSL.std.450) 10(Fract) 246 + Store 245(r034) 247 + 249: 6(float) Load 13(inF0) + 250: 6(float) Fwidth 249 + Store 248(r036) 250 + 252: 6(float) Load 13(inF0) + 253: 137(bool) IsInf 252 + Store 251(r037) 253 + 255: 6(float) Load 13(inF0) + 256: 137(bool) IsNan 255 + Store 254(r038) 256 + 258: 6(float) Load 13(inF0) + 259: 6(float) Load 14(inF1) + 260: 6(float) ExtInst 1(GLSL.std.450) 53(Ldexp) 258 259 + Store 257(r039) 260 + 262: 6(float) Load 13(inF0) + 263: 6(float) Load 14(inF1) + 264: 6(float) Load 15(inF2) + 265: 6(float) ExtInst 1(GLSL.std.450) 46(FMix) 262 263 264 + Store 261(r039a) 265 + 267: 6(float) Load 13(inF0) + 268: 6(float) ExtInst 1(GLSL.std.450) 28(Log) 267 + Store 266(r040) 268 + 270: 6(float) Load 13(inF0) + 271: 6(float) ExtInst 1(GLSL.std.450) 30(Log2) 270 + 273: 6(float) FMul 271 272 + Store 269(r041) 273 + 275: 6(float) Load 13(inF0) + 276: 6(float) ExtInst 1(GLSL.std.450) 30(Log2) 275 + Store 274(r042) 276 + 278: 6(float) Load 13(inF0) + 279: 6(float) Load 14(inF1) + 280: 6(float) ExtInst 1(GLSL.std.450) 40(FMax) 278 279 + Store 277(r043) 280 + 282: 6(float) Load 13(inF0) + 283: 6(float) Load 14(inF1) + 284: 6(float) ExtInst 1(GLSL.std.450) 37(FMin) 282 283 + Store 281(r044) 284 + 286: 6(float) Load 13(inF0) + 287: 6(float) Load 14(inF1) + 288: 6(float) ExtInst 1(GLSL.std.450) 26(Pow) 286 287 + Store 285(r045) 288 + 290: 6(float) Load 13(inF0) + 291: 6(float) ExtInst 1(GLSL.std.450) 11(Radians) 290 + Store 289(r046) 291 + 294: 6(float) Load 13(inF0) + 295: 6(float) FDiv 293 294 + Store 292(r047) 295 + 298: 10(int) BitReverse 297 + 299: 8(int) Bitcast 298 + Store 296(r048) 299 + 301: 6(float) Load 13(inF0) + 302: 6(float) ExtInst 1(GLSL.std.450) 2(RoundEven) 301 + Store 300(r049) 302 + 304: 6(float) Load 13(inF0) + 305: 6(float) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 304 + Store 303(r050) 305 + 307: 6(float) Load 13(inF0) + 308: 6(float) ExtInst 1(GLSL.std.450) 43(FClamp) 307 141 293 + Store 306(r051) 308 + 310: 6(float) Load 13(inF0) + 311: 6(float) ExtInst 1(GLSL.std.450) 6(FSign) 310 + Store 309(r052) 311 + 313: 6(float) Load 13(inF0) + 314: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 313 + Store 312(r053) 314 + 315: 6(float) Load 13(inF0) + 316: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 315 + Store 14(inF1) 316 + 317: 6(float) Load 13(inF0) + 318: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 317 + Store 15(inF2) 318 + 320: 6(float) Load 13(inF0) + 321: 6(float) ExtInst 1(GLSL.std.450) 19(Sinh) 320 + Store 319(r055) 321 + 323: 6(float) Load 13(inF0) + 324: 6(float) Load 14(inF1) + 325: 6(float) Load 15(inF2) + 326: 6(float) ExtInst 1(GLSL.std.450) 49(SmoothStep) 323 324 325 + Store 322(r056) 326 + 328: 6(float) Load 13(inF0) + 329: 6(float) ExtInst 1(GLSL.std.450) 31(Sqrt) 328 + Store 327(r057) 329 + 331: 6(float) Load 13(inF0) + 332: 6(float) Load 14(inF1) + 333: 6(float) ExtInst 1(GLSL.std.450) 48(Step) 331 332 + Store 330(r058) 333 + 335: 6(float) Load 13(inF0) + 336: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 335 + Store 334(r059) 336 + 338: 6(float) Load 13(inF0) + 339: 6(float) ExtInst 1(GLSL.std.450) 21(Tanh) 338 + Store 337(r060) 339 + 341: 6(float) Load 13(inF0) + 342: 6(float) ExtInst 1(GLSL.std.450) 3(Trunc) 341 + Store 340(r061) 342 + ReturnValue 141 + FunctionEnd +24(PixelShaderFunction1(vf1;vf1;vf1;): 6(float) Function None 20 + 21(inF0): 7(ptr) FunctionParameter + 22(inF1): 7(ptr) FunctionParameter + 23(inF2): 7(ptr) FunctionParameter + 25: Label + ReturnValue 141 + FunctionEnd +36(PixelShaderFunction2(vf2;vf2;vf2;vu2;vu2;): 26(fvec2) Function None 30 + 31(inF0): 27(ptr) FunctionParameter + 32(inF1): 27(ptr) FunctionParameter + 33(inF2): 27(ptr) FunctionParameter + 34(inU0): 29(ptr) FunctionParameter + 35(inU1): 29(ptr) FunctionParameter + 37: Label + 347(r000): 138(ptr) Variable Function + 353(r001): 27(ptr) Variable Function + 356(r002): 27(ptr) Variable Function + 359(r003): 138(ptr) Variable Function + 363(r004): 27(ptr) Variable Function + 368(r005): 367(ptr) Variable Function + 371(r006): 29(ptr) Variable Function + 374(r007): 27(ptr) Variable Function + 377(r009): 27(ptr) Variable Function + 380(r010): 27(ptr) Variable Function + 384(r011): 27(ptr) Variable Function + 387(r012): 27(ptr) Variable Function + 406(r013): 27(ptr) Variable Function + 409(r015): 27(ptr) Variable Function + 412(r016): 367(ptr) Variable Function + 416(r017): 27(ptr) Variable Function + 419(r018): 27(ptr) Variable Function + 422(r019): 27(ptr) Variable Function + 425(r020): 27(ptr) Variable Function + 428(r021): 27(ptr) Variable Function + 431(r022): 27(ptr) Variable Function + 434(r023): 27(ptr) Variable Function + 437(r026): 7(ptr) Variable Function + 441(r027): 7(ptr) Variable Function + 445(r028): 27(ptr) Variable Function + 448(r029): 27(ptr) Variable Function + 451(r030): 27(ptr) Variable Function + 456(r031): 29(ptr) Variable Function + 461(r032): 29(ptr) Variable Function + 463(r033): 27(ptr) Variable Function + 466(r035): 27(ptr) Variable Function + 470(r036): 27(ptr) Variable Function + 473(r038): 27(ptr) Variable Function + 477(r039): 476(ptr) Variable Function + 480(r040): 476(ptr) Variable Function + 483(r041): 27(ptr) Variable Function + 487(r039a): 27(ptr) Variable Function + 492(r042): 7(ptr) Variable Function + 495(r043): 27(ptr) Variable Function + 498(r044): 27(ptr) Variable Function + 502(r045): 27(ptr) Variable Function + 505(r046): 27(ptr) Variable Function + 509(r047): 27(ptr) Variable Function + 513(r048): 27(ptr) Variable Function + 516(r049): 27(ptr) Variable Function + 520(r050): 27(ptr) Variable Function + 523(r051): 27(ptr) Variable Function + 527(r052): 27(ptr) Variable Function + 531(r053): 27(ptr) Variable Function + 536(r054): 29(ptr) Variable Function + 541(r055): 27(ptr) Variable Function + 544(r056): 27(ptr) Variable Function + 547(r057): 27(ptr) Variable Function + 552(r058): 27(ptr) Variable Function + 555(r059): 27(ptr) Variable Function + 562(r060): 27(ptr) Variable Function + 565(r061): 27(ptr) Variable Function + 570(r062): 27(ptr) Variable Function + 573(r063): 27(ptr) Variable Function + 577(r064): 27(ptr) Variable Function + 580(r065): 27(ptr) Variable Function + 583(r066): 27(ptr) Variable Function + 348: 26(fvec2) Load 31(inF0) + 351: 349(bvec2) FOrdNotEqual 348 350 + 352: 137(bool) All 351 + Store 347(r000) 352 + 354: 26(fvec2) Load 31(inF0) + 355: 26(fvec2) ExtInst 1(GLSL.std.450) 4(FAbs) 354 + Store 353(r001) 355 + 357: 26(fvec2) Load 31(inF0) + 358: 26(fvec2) ExtInst 1(GLSL.std.450) 17(Acos) 357 + Store 356(r002) 358 + 360: 26(fvec2) Load 31(inF0) + 361: 349(bvec2) FOrdNotEqual 360 350 + 362: 137(bool) Any 361 + Store 359(r003) 362 + 364: 26(fvec2) Load 31(inF0) + 365: 26(fvec2) ExtInst 1(GLSL.std.450) 16(Asin) 364 + Store 363(r004) 365 + 369: 26(fvec2) Load 31(inF0) + 370: 366(ivec2) Bitcast 369 + Store 368(r005) 370 + 372: 26(fvec2) Load 31(inF0) + 373: 28(ivec2) Bitcast 372 + Store 371(r006) 373 + 375: 28(ivec2) Load 34(inU0) + 376: 26(fvec2) Bitcast 375 + Store 374(r007) 376 + 378: 26(fvec2) Load 31(inF0) + 379: 26(fvec2) ExtInst 1(GLSL.std.450) 18(Atan) 378 + Store 377(r009) 379 + 381: 26(fvec2) Load 31(inF0) + 382: 26(fvec2) Load 32(inF1) + 383: 26(fvec2) ExtInst 1(GLSL.std.450) 25(Atan2) 381 382 + Store 380(r010) 383 + 385: 26(fvec2) Load 31(inF0) + 386: 26(fvec2) ExtInst 1(GLSL.std.450) 9(Ceil) 385 + Store 384(r011) 386 + 388: 26(fvec2) Load 31(inF0) + 389: 26(fvec2) Load 32(inF1) + 390: 26(fvec2) Load 33(inF2) + 391: 26(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 388 389 390 + Store 387(r012) 391 + 392: 26(fvec2) Load 31(inF0) + 393: 349(bvec2) FOrdLessThan 392 350 + 394: 137(bool) Any 393 + SelectionMerge 396 None + BranchConditional 394 395 396 + 395: Label + Kill + 396: Label + 398: 28(ivec2) Load 34(inU0) + 401: 349(bvec2) ULessThan 398 400 + 402: 137(bool) Any 401 + SelectionMerge 404 None + BranchConditional 402 403 404 + 403: Label + Kill + 404: Label + 407: 26(fvec2) Load 31(inF0) + 408: 26(fvec2) ExtInst 1(GLSL.std.450) 14(Cos) 407 + Store 406(r013) 408 + 410: 26(fvec2) Load 31(inF0) + 411: 26(fvec2) ExtInst 1(GLSL.std.450) 20(Cosh) 410 + Store 409(r015) 411 + 415: 366(ivec2) BitCount 414 + Store 412(r016) 415 + 417: 26(fvec2) Load 31(inF0) + 418: 26(fvec2) DPdx 417 + Store 416(r017) 418 + 420: 26(fvec2) Load 31(inF0) + 421: 26(fvec2) DPdxCoarse 420 + Store 419(r018) 421 + 423: 26(fvec2) Load 31(inF0) + 424: 26(fvec2) DPdxFine 423 + Store 422(r019) 424 + 426: 26(fvec2) Load 31(inF0) + 427: 26(fvec2) DPdy 426 + Store 425(r020) 427 + 429: 26(fvec2) Load 31(inF0) + 430: 26(fvec2) DPdyCoarse 429 + Store 428(r021) 430 + 432: 26(fvec2) Load 31(inF0) + 433: 26(fvec2) DPdyFine 432 + Store 431(r022) 433 + 435: 26(fvec2) Load 31(inF0) + 436: 26(fvec2) ExtInst 1(GLSL.std.450) 12(Degrees) 435 + Store 434(r023) 436 + 438: 26(fvec2) Load 31(inF0) + 439: 26(fvec2) Load 32(inF1) + 440: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 438 439 + Store 437(r026) 440 + 442: 26(fvec2) Load 31(inF0) + 443: 26(fvec2) Load 32(inF1) + 444: 6(float) Dot 442 443 + Store 441(r027) 444 + 446: 26(fvec2) Load 31(inF0) + 447: 26(fvec2) ExtInst 1(GLSL.std.450) 27(Exp) 446 + Store 445(r028) 447 + 449: 26(fvec2) Load 31(inF0) + 450: 26(fvec2) ExtInst 1(GLSL.std.450) 29(Exp2) 449 + Store 448(r029) 450 + 452: 26(fvec2) Load 31(inF0) + 453: 26(fvec2) Load 32(inF1) + 454: 26(fvec2) Load 33(inF2) + 455: 26(fvec2) ExtInst 1(GLSL.std.450) 70(FaceForward) 452 453 454 + Store 451(r030) 455 + 460: 28(ivec2) ExtInst 1(GLSL.std.450) 75(FindUMsb) 459 + Store 456(r031) 460 + 462: 28(ivec2) ExtInst 1(GLSL.std.450) 73(FindILsb) 459 + Store 461(r032) 462 + 464: 26(fvec2) Load 31(inF0) + 465: 26(fvec2) ExtInst 1(GLSL.std.450) 8(Floor) 464 + Store 463(r033) 465 + 467: 26(fvec2) Load 31(inF0) + 468: 26(fvec2) Load 32(inF1) + 469: 26(fvec2) FMod 467 468 + Store 466(r035) 469 + 471: 26(fvec2) Load 31(inF0) + 472: 26(fvec2) ExtInst 1(GLSL.std.450) 10(Fract) 471 + Store 470(r036) 472 + 474: 26(fvec2) Load 31(inF0) + 475: 26(fvec2) Fwidth 474 + Store 473(r038) 475 + 478: 26(fvec2) Load 31(inF0) + 479: 349(bvec2) IsInf 478 + Store 477(r039) 479 + 481: 26(fvec2) Load 31(inF0) + 482: 349(bvec2) IsNan 481 + Store 480(r040) 482 + 484: 26(fvec2) Load 31(inF0) + 485: 26(fvec2) Load 32(inF1) + 486: 26(fvec2) ExtInst 1(GLSL.std.450) 53(Ldexp) 484 485 + Store 483(r041) 486 + 488: 26(fvec2) Load 31(inF0) + 489: 26(fvec2) Load 32(inF1) + 490: 26(fvec2) Load 33(inF2) + 491: 26(fvec2) ExtInst 1(GLSL.std.450) 46(FMix) 488 489 490 + Store 487(r039a) 491 + 493: 26(fvec2) Load 31(inF0) + 494: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 493 + Store 492(r042) 494 + 496: 26(fvec2) Load 31(inF0) + 497: 26(fvec2) ExtInst 1(GLSL.std.450) 28(Log) 496 + Store 495(r043) 497 + 499: 26(fvec2) Load 31(inF0) + 500: 26(fvec2) ExtInst 1(GLSL.std.450) 30(Log2) 499 + 501: 26(fvec2) VectorTimesScalar 500 272 + Store 498(r044) 501 + 503: 26(fvec2) Load 31(inF0) + 504: 26(fvec2) ExtInst 1(GLSL.std.450) 30(Log2) 503 + Store 502(r045) 504 + 506: 26(fvec2) Load 31(inF0) + 507: 26(fvec2) Load 32(inF1) + 508: 26(fvec2) ExtInst 1(GLSL.std.450) 40(FMax) 506 507 + Store 505(r046) 508 + 510: 26(fvec2) Load 31(inF0) + 511: 26(fvec2) Load 32(inF1) + 512: 26(fvec2) ExtInst 1(GLSL.std.450) 37(FMin) 510 511 + Store 509(r047) 512 + 514: 26(fvec2) Load 31(inF0) + 515: 26(fvec2) ExtInst 1(GLSL.std.450) 69(Normalize) 514 + Store 513(r048) 515 + 517: 26(fvec2) Load 31(inF0) + 518: 26(fvec2) Load 32(inF1) + 519: 26(fvec2) ExtInst 1(GLSL.std.450) 26(Pow) 517 518 + Store 516(r049) 519 + 521: 26(fvec2) Load 31(inF0) + 522: 26(fvec2) ExtInst 1(GLSL.std.450) 11(Radians) 521 + Store 520(r050) 522 + 524: 26(fvec2) Load 31(inF0) + 525: 26(fvec2) CompositeConstruct 293 293 + 526: 26(fvec2) FDiv 525 524 + Store 523(r051) 526 + 528: 26(fvec2) Load 31(inF0) + 529: 26(fvec2) Load 32(inF1) + 530: 26(fvec2) ExtInst 1(GLSL.std.450) 71(Reflect) 528 529 + Store 527(r052) 530 + 532: 26(fvec2) Load 31(inF0) + 533: 26(fvec2) Load 32(inF1) + 535: 26(fvec2) ExtInst 1(GLSL.std.450) 72(Refract) 532 533 534 + Store 531(r053) 535 + 540: 28(ivec2) BitReverse 539 + Store 536(r054) 540 + 542: 26(fvec2) Load 31(inF0) + 543: 26(fvec2) ExtInst 1(GLSL.std.450) 2(RoundEven) 542 + Store 541(r055) 543 + 545: 26(fvec2) Load 31(inF0) + 546: 26(fvec2) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 545 + Store 544(r056) 546 + 548: 26(fvec2) Load 31(inF0) + 549: 26(fvec2) CompositeConstruct 141 141 + 550: 26(fvec2) CompositeConstruct 293 293 + 551: 26(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 548 549 550 + Store 547(r057) 551 + 553: 26(fvec2) Load 31(inF0) + 554: 26(fvec2) ExtInst 1(GLSL.std.450) 6(FSign) 553 + Store 552(r058) 554 + 556: 26(fvec2) Load 31(inF0) + 557: 26(fvec2) ExtInst 1(GLSL.std.450) 13(Sin) 556 + Store 555(r059) 557 + 558: 26(fvec2) Load 31(inF0) + 559: 26(fvec2) ExtInst 1(GLSL.std.450) 13(Sin) 558 + Store 32(inF1) 559 + 560: 26(fvec2) Load 31(inF0) + 561: 26(fvec2) ExtInst 1(GLSL.std.450) 14(Cos) 560 + Store 33(inF2) 561 + 563: 26(fvec2) Load 31(inF0) + 564: 26(fvec2) ExtInst 1(GLSL.std.450) 19(Sinh) 563 + Store 562(r060) 564 + 566: 26(fvec2) Load 31(inF0) + 567: 26(fvec2) Load 32(inF1) + 568: 26(fvec2) Load 33(inF2) + 569: 26(fvec2) ExtInst 1(GLSL.std.450) 49(SmoothStep) 566 567 568 + Store 565(r061) 569 + 571: 26(fvec2) Load 31(inF0) + 572: 26(fvec2) ExtInst 1(GLSL.std.450) 31(Sqrt) 571 + Store 570(r062) 572 + 574: 26(fvec2) Load 31(inF0) + 575: 26(fvec2) Load 32(inF1) + 576: 26(fvec2) ExtInst 1(GLSL.std.450) 48(Step) 574 575 + Store 573(r063) 576 + 578: 26(fvec2) Load 31(inF0) + 579: 26(fvec2) ExtInst 1(GLSL.std.450) 15(Tan) 578 + Store 577(r064) 579 + 581: 26(fvec2) Load 31(inF0) + 582: 26(fvec2) ExtInst 1(GLSL.std.450) 21(Tanh) 581 + Store 580(r065) 582 + 584: 26(fvec2) Load 31(inF0) + 585: 26(fvec2) ExtInst 1(GLSL.std.450) 3(Trunc) 584 + Store 583(r066) 585 + ReturnValue 586 + FunctionEnd +48(PixelShaderFunction3(vf3;vf3;vf3;vu3;vu3;): 38(fvec3) Function None 42 + 43(inF0): 39(ptr) FunctionParameter + 44(inF1): 39(ptr) FunctionParameter + 45(inF2): 39(ptr) FunctionParameter + 46(inU0): 41(ptr) FunctionParameter + 47(inU1): 41(ptr) FunctionParameter + 49: Label + 589(r000): 138(ptr) Variable Function + 595(r001): 39(ptr) Variable Function + 598(r002): 39(ptr) Variable Function + 601(r003): 138(ptr) Variable Function + 605(r004): 39(ptr) Variable Function + 610(r005): 609(ptr) Variable Function + 613(r006): 41(ptr) Variable Function + 616(r007): 39(ptr) Variable Function + 619(r009): 39(ptr) Variable Function + 622(r010): 39(ptr) Variable Function + 626(r011): 39(ptr) Variable Function + 629(r012): 39(ptr) Variable Function + 647(r013): 39(ptr) Variable Function + 650(r014): 39(ptr) Variable Function + 653(r015): 41(ptr) Variable Function + 658(r016): 39(ptr) Variable Function + 662(r017): 39(ptr) Variable Function + 665(r018): 39(ptr) Variable Function + 668(r019): 39(ptr) Variable Function + 671(r020): 39(ptr) Variable Function + 674(r021): 39(ptr) Variable Function + 677(r022): 39(ptr) Variable Function + 680(r023): 39(ptr) Variable Function + 683(r024): 7(ptr) Variable Function + 687(r025): 7(ptr) Variable Function + 691(r029): 39(ptr) Variable Function + 694(r030): 39(ptr) Variable Function + 697(r031): 39(ptr) Variable Function + 702(r032): 41(ptr) Variable Function + 706(r033): 41(ptr) Variable Function + 708(r034): 39(ptr) Variable Function + 711(r036): 39(ptr) Variable Function + 715(r037): 39(ptr) Variable Function + 718(r039): 39(ptr) Variable Function + 722(r040): 721(ptr) Variable Function + 725(r041): 721(ptr) Variable Function + 728(r042): 39(ptr) Variable Function + 732(r039a): 39(ptr) Variable Function + 737(r039b): 39(ptr) Variable Function + 743(r043): 7(ptr) Variable Function + 746(r044): 39(ptr) Variable Function + 749(r045): 39(ptr) Variable Function + 753(r046): 39(ptr) Variable Function + 756(r047): 39(ptr) Variable Function + 760(r048): 39(ptr) Variable Function + 764(r049): 39(ptr) Variable Function + 767(r050): 39(ptr) Variable Function + 771(r051): 39(ptr) Variable Function + 774(r052): 39(ptr) Variable Function + 778(r053): 39(ptr) Variable Function + 782(r054): 39(ptr) Variable Function + 786(r055): 41(ptr) Variable Function + 789(r056): 39(ptr) Variable Function + 792(r057): 39(ptr) Variable Function + 795(r058): 39(ptr) Variable Function + 800(r059): 39(ptr) Variable Function + 803(r060): 39(ptr) Variable Function + 810(r061): 39(ptr) Variable Function + 813(r062): 39(ptr) Variable Function + 818(r063): 39(ptr) Variable Function + 821(r064): 39(ptr) Variable Function + 825(r065): 39(ptr) Variable Function + 828(r066): 39(ptr) Variable Function + 831(r067): 39(ptr) Variable Function + 590: 38(fvec3) Load 43(inF0) + 593: 591(bvec3) FOrdNotEqual 590 592 + 594: 137(bool) All 593 + Store 589(r000) 594 + 596: 38(fvec3) Load 43(inF0) + 597: 38(fvec3) ExtInst 1(GLSL.std.450) 4(FAbs) 596 + Store 595(r001) 597 + 599: 38(fvec3) Load 43(inF0) + 600: 38(fvec3) ExtInst 1(GLSL.std.450) 17(Acos) 599 + Store 598(r002) 600 + 602: 38(fvec3) Load 43(inF0) + 603: 591(bvec3) FOrdNotEqual 602 592 + 604: 137(bool) Any 603 + Store 601(r003) 604 + 606: 38(fvec3) Load 43(inF0) + 607: 38(fvec3) ExtInst 1(GLSL.std.450) 16(Asin) 606 + Store 605(r004) 607 + 611: 38(fvec3) Load 43(inF0) + 612: 608(ivec3) Bitcast 611 + Store 610(r005) 612 + 614: 38(fvec3) Load 43(inF0) + 615: 40(ivec3) Bitcast 614 + Store 613(r006) 615 + 617: 40(ivec3) Load 46(inU0) + 618: 38(fvec3) Bitcast 617 + Store 616(r007) 618 + 620: 38(fvec3) Load 43(inF0) + 621: 38(fvec3) ExtInst 1(GLSL.std.450) 18(Atan) 620 + Store 619(r009) 621 + 623: 38(fvec3) Load 43(inF0) + 624: 38(fvec3) Load 44(inF1) + 625: 38(fvec3) ExtInst 1(GLSL.std.450) 25(Atan2) 623 624 + Store 622(r010) 625 + 627: 38(fvec3) Load 43(inF0) + 628: 38(fvec3) ExtInst 1(GLSL.std.450) 9(Ceil) 627 + Store 626(r011) 628 + 630: 38(fvec3) Load 43(inF0) + 631: 38(fvec3) Load 44(inF1) + 632: 38(fvec3) Load 45(inF2) + 633: 38(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 630 631 632 + Store 629(r012) 633 + 634: 38(fvec3) Load 43(inF0) + 635: 591(bvec3) FOrdLessThan 634 592 + 636: 137(bool) Any 635 + SelectionMerge 638 None + BranchConditional 636 637 638 + 637: Label + Kill + 638: Label + 640: 40(ivec3) Load 46(inU0) + 642: 591(bvec3) ULessThan 640 641 + 643: 137(bool) Any 642 + SelectionMerge 645 None + BranchConditional 643 644 645 + 644: Label + Kill + 645: Label + 648: 38(fvec3) Load 43(inF0) + 649: 38(fvec3) ExtInst 1(GLSL.std.450) 14(Cos) 648 + Store 647(r013) 649 + 651: 38(fvec3) Load 43(inF0) + 652: 38(fvec3) ExtInst 1(GLSL.std.450) 20(Cosh) 651 + Store 650(r014) 652 + 657: 40(ivec3) BitCount 656 + Store 653(r015) 657 + 659: 38(fvec3) Load 43(inF0) + 660: 38(fvec3) Load 44(inF1) + 661: 38(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 659 660 + Store 658(r016) 661 + 663: 38(fvec3) Load 43(inF0) + 664: 38(fvec3) DPdx 663 + Store 662(r017) 664 + 666: 38(fvec3) Load 43(inF0) + 667: 38(fvec3) DPdxCoarse 666 + Store 665(r018) 667 + 669: 38(fvec3) Load 43(inF0) + 670: 38(fvec3) DPdxFine 669 + Store 668(r019) 670 + 672: 38(fvec3) Load 43(inF0) + 673: 38(fvec3) DPdy 672 + Store 671(r020) 673 + 675: 38(fvec3) Load 43(inF0) + 676: 38(fvec3) DPdyCoarse 675 + Store 674(r021) 676 + 678: 38(fvec3) Load 43(inF0) + 679: 38(fvec3) DPdyFine 678 + Store 677(r022) 679 + 681: 38(fvec3) Load 43(inF0) + 682: 38(fvec3) ExtInst 1(GLSL.std.450) 12(Degrees) 681 + Store 680(r023) 682 + 684: 38(fvec3) Load 43(inF0) + 685: 38(fvec3) Load 44(inF1) + 686: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 684 685 + Store 683(r024) 686 + 688: 38(fvec3) Load 43(inF0) + 689: 38(fvec3) Load 44(inF1) + 690: 6(float) Dot 688 689 + Store 687(r025) 690 + 692: 38(fvec3) Load 43(inF0) + 693: 38(fvec3) ExtInst 1(GLSL.std.450) 27(Exp) 692 + Store 691(r029) 693 + 695: 38(fvec3) Load 43(inF0) + 696: 38(fvec3) ExtInst 1(GLSL.std.450) 29(Exp2) 695 + Store 694(r030) 696 + 698: 38(fvec3) Load 43(inF0) + 699: 38(fvec3) Load 44(inF1) + 700: 38(fvec3) Load 45(inF2) + 701: 38(fvec3) ExtInst 1(GLSL.std.450) 70(FaceForward) 698 699 700 + Store 697(r031) 701 + 705: 40(ivec3) ExtInst 1(GLSL.std.450) 75(FindUMsb) 704 + Store 702(r032) 705 + 707: 40(ivec3) ExtInst 1(GLSL.std.450) 73(FindILsb) 704 + Store 706(r033) 707 + 709: 38(fvec3) Load 43(inF0) + 710: 38(fvec3) ExtInst 1(GLSL.std.450) 8(Floor) 709 + Store 708(r034) 710 + 712: 38(fvec3) Load 43(inF0) + 713: 38(fvec3) Load 44(inF1) + 714: 38(fvec3) FMod 712 713 + Store 711(r036) 714 + 716: 38(fvec3) Load 43(inF0) + 717: 38(fvec3) ExtInst 1(GLSL.std.450) 10(Fract) 716 + Store 715(r037) 717 + 719: 38(fvec3) Load 43(inF0) + 720: 38(fvec3) Fwidth 719 + Store 718(r039) 720 + 723: 38(fvec3) Load 43(inF0) + 724: 591(bvec3) IsInf 723 + Store 722(r040) 724 + 726: 38(fvec3) Load 43(inF0) + 727: 591(bvec3) IsNan 726 + Store 725(r041) 727 + 729: 38(fvec3) Load 43(inF0) + 730: 38(fvec3) Load 44(inF1) + 731: 38(fvec3) ExtInst 1(GLSL.std.450) 53(Ldexp) 729 730 + Store 728(r042) 731 + 733: 38(fvec3) Load 43(inF0) + 734: 38(fvec3) Load 44(inF1) + 735: 38(fvec3) Load 45(inF2) + 736: 38(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 733 734 735 + Store 732(r039a) 736 + 738: 38(fvec3) Load 43(inF0) + 739: 38(fvec3) Load 44(inF1) + 741: 38(fvec3) CompositeConstruct 740 740 740 + 742: 38(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 738 739 741 + Store 737(r039b) 742 + 744: 38(fvec3) Load 43(inF0) + 745: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 744 + Store 743(r043) 745 + 747: 38(fvec3) Load 43(inF0) + 748: 38(fvec3) ExtInst 1(GLSL.std.450) 28(Log) 747 + Store 746(r044) 748 + 750: 38(fvec3) Load 43(inF0) + 751: 38(fvec3) ExtInst 1(GLSL.std.450) 30(Log2) 750 + 752: 38(fvec3) VectorTimesScalar 751 272 + Store 749(r045) 752 + 754: 38(fvec3) Load 43(inF0) + 755: 38(fvec3) ExtInst 1(GLSL.std.450) 30(Log2) 754 + Store 753(r046) 755 + 757: 38(fvec3) Load 43(inF0) + 758: 38(fvec3) Load 44(inF1) + 759: 38(fvec3) ExtInst 1(GLSL.std.450) 40(FMax) 757 758 + Store 756(r047) 759 + 761: 38(fvec3) Load 43(inF0) + 762: 38(fvec3) Load 44(inF1) + 763: 38(fvec3) ExtInst 1(GLSL.std.450) 37(FMin) 761 762 + Store 760(r048) 763 + 765: 38(fvec3) Load 43(inF0) + 766: 38(fvec3) ExtInst 1(GLSL.std.450) 69(Normalize) 765 + Store 764(r049) 766 + 768: 38(fvec3) Load 43(inF0) + 769: 38(fvec3) Load 44(inF1) + 770: 38(fvec3) ExtInst 1(GLSL.std.450) 26(Pow) 768 769 + Store 767(r050) 770 + 772: 38(fvec3) Load 43(inF0) + 773: 38(fvec3) ExtInst 1(GLSL.std.450) 11(Radians) 772 + Store 771(r051) 773 + 775: 38(fvec3) Load 43(inF0) + 776: 38(fvec3) CompositeConstruct 293 293 293 + 777: 38(fvec3) FDiv 776 775 + Store 774(r052) 777 + 779: 38(fvec3) Load 43(inF0) + 780: 38(fvec3) Load 44(inF1) + 781: 38(fvec3) ExtInst 1(GLSL.std.450) 71(Reflect) 779 780 + Store 778(r053) 781 + 783: 38(fvec3) Load 43(inF0) + 784: 38(fvec3) Load 44(inF1) + 785: 38(fvec3) ExtInst 1(GLSL.std.450) 72(Refract) 783 784 534 + Store 782(r054) 785 + 788: 40(ivec3) BitReverse 787 + Store 786(r055) 788 + 790: 38(fvec3) Load 43(inF0) + 791: 38(fvec3) ExtInst 1(GLSL.std.450) 2(RoundEven) 790 + Store 789(r056) 791 + 793: 38(fvec3) Load 43(inF0) + 794: 38(fvec3) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 793 + Store 792(r057) 794 + 796: 38(fvec3) Load 43(inF0) + 797: 38(fvec3) CompositeConstruct 141 141 141 + 798: 38(fvec3) CompositeConstruct 293 293 293 + 799: 38(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 796 797 798 + Store 795(r058) 799 + 801: 38(fvec3) Load 43(inF0) + 802: 38(fvec3) ExtInst 1(GLSL.std.450) 6(FSign) 801 + Store 800(r059) 802 + 804: 38(fvec3) Load 43(inF0) + 805: 38(fvec3) ExtInst 1(GLSL.std.450) 13(Sin) 804 + Store 803(r060) 805 + 806: 38(fvec3) Load 43(inF0) + 807: 38(fvec3) ExtInst 1(GLSL.std.450) 13(Sin) 806 + Store 44(inF1) 807 + 808: 38(fvec3) Load 43(inF0) + 809: 38(fvec3) ExtInst 1(GLSL.std.450) 14(Cos) 808 + Store 45(inF2) 809 + 811: 38(fvec3) Load 43(inF0) + 812: 38(fvec3) ExtInst 1(GLSL.std.450) 19(Sinh) 811 + Store 810(r061) 812 + 814: 38(fvec3) Load 43(inF0) + 815: 38(fvec3) Load 44(inF1) + 816: 38(fvec3) Load 45(inF2) + 817: 38(fvec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 814 815 816 + Store 813(r062) 817 + 819: 38(fvec3) Load 43(inF0) + 820: 38(fvec3) ExtInst 1(GLSL.std.450) 31(Sqrt) 819 + Store 818(r063) 820 + 822: 38(fvec3) Load 43(inF0) + 823: 38(fvec3) Load 44(inF1) + 824: 38(fvec3) ExtInst 1(GLSL.std.450) 48(Step) 822 823 + Store 821(r064) 824 + 826: 38(fvec3) Load 43(inF0) + 827: 38(fvec3) ExtInst 1(GLSL.std.450) 15(Tan) 826 + Store 825(r065) 827 + 829: 38(fvec3) Load 43(inF0) + 830: 38(fvec3) ExtInst 1(GLSL.std.450) 21(Tanh) 829 + Store 828(r066) 830 + 832: 38(fvec3) Load 43(inF0) + 833: 38(fvec3) ExtInst 1(GLSL.std.450) 3(Trunc) 832 + Store 831(r067) 833 + ReturnValue 835 + FunctionEnd +60(PixelShaderFunction(vf4;vf4;vf4;vu4;vu4;): 50(fvec4) Function None 54 + 55(inF0): 51(ptr) FunctionParameter + 56(inF1): 51(ptr) FunctionParameter + 57(inF2): 51(ptr) FunctionParameter + 58(inU0): 53(ptr) FunctionParameter + 59(inU1): 53(ptr) FunctionParameter + 61: Label + 838(r000): 138(ptr) Variable Function + 844(r001): 51(ptr) Variable Function + 847(r002): 51(ptr) Variable Function + 850(r003): 138(ptr) Variable Function + 854(r004): 51(ptr) Variable Function + 859(r005): 858(ptr) Variable Function + 862(r006): 53(ptr) Variable Function + 865(r007): 51(ptr) Variable Function + 868(r009): 51(ptr) Variable Function + 871(r010): 51(ptr) Variable Function + 875(r011): 51(ptr) Variable Function + 878(r012): 51(ptr) Variable Function + 896(r013): 51(ptr) Variable Function + 899(r014): 51(ptr) Variable Function + 902(r015): 53(ptr) Variable Function + 905(r016): 51(ptr) Variable Function + 908(r017): 51(ptr) Variable Function + 911(r018): 51(ptr) Variable Function + 914(r019): 51(ptr) Variable Function + 917(r020): 51(ptr) Variable Function + 920(r021): 51(ptr) Variable Function + 923(r022): 51(ptr) Variable Function + 926(r023): 7(ptr) Variable Function + 930(r024): 7(ptr) Variable Function + 934(r025): 51(ptr) Variable Function + 945(r029): 51(ptr) Variable Function + 948(r030): 51(ptr) Variable Function + 951(r031): 51(ptr) Variable Function + 956(r032): 53(ptr) Variable Function + 961(r033): 53(ptr) Variable Function + 963(r034): 51(ptr) Variable Function + 966(r036): 51(ptr) Variable Function + 970(r037): 51(ptr) Variable Function + 973(r039): 51(ptr) Variable Function + 977(r040): 976(ptr) Variable Function + 980(r041): 976(ptr) Variable Function + 983(r042): 51(ptr) Variable Function + 987(r039a): 51(ptr) Variable Function + 992(r043): 7(ptr) Variable Function + 995(r044): 51(ptr) Variable Function + 998(r045): 51(ptr) Variable Function + 1002(r046): 51(ptr) Variable Function + 1005(r047): 51(ptr) Variable Function + 1009(r048): 51(ptr) Variable Function + 1013(r049): 51(ptr) Variable Function + 1016(r050): 51(ptr) Variable Function + 1020(r051): 51(ptr) Variable Function + 1023(r052): 51(ptr) Variable Function + 1027(r053): 51(ptr) Variable Function + 1031(r054): 51(ptr) Variable Function + 1035(r055): 53(ptr) Variable Function + 1038(r056): 51(ptr) Variable Function + 1041(r057): 51(ptr) Variable Function + 1044(r058): 51(ptr) Variable Function + 1049(r059): 51(ptr) Variable Function + 1052(r060): 51(ptr) Variable Function + 1059(r061): 51(ptr) Variable Function + 1062(r062): 51(ptr) Variable Function + 1067(r063): 51(ptr) Variable Function + 1070(r064): 51(ptr) Variable Function + 1074(r065): 51(ptr) Variable Function + 1077(r066): 51(ptr) Variable Function + 1080(r067): 51(ptr) Variable Function + 839: 50(fvec4) Load 55(inF0) + 842: 840(bvec4) FOrdNotEqual 839 841 + 843: 137(bool) All 842 + Store 838(r000) 843 + 845: 50(fvec4) Load 55(inF0) + 846: 50(fvec4) ExtInst 1(GLSL.std.450) 4(FAbs) 845 + Store 844(r001) 846 + 848: 50(fvec4) Load 55(inF0) + 849: 50(fvec4) ExtInst 1(GLSL.std.450) 17(Acos) 848 + Store 847(r002) 849 + 851: 50(fvec4) Load 55(inF0) + 852: 840(bvec4) FOrdNotEqual 851 841 + 853: 137(bool) Any 852 + Store 850(r003) 853 + 855: 50(fvec4) Load 55(inF0) + 856: 50(fvec4) ExtInst 1(GLSL.std.450) 16(Asin) 855 + Store 854(r004) 856 + 860: 50(fvec4) Load 55(inF0) + 861: 857(ivec4) Bitcast 860 + Store 859(r005) 861 + 863: 50(fvec4) Load 55(inF0) + 864: 52(ivec4) Bitcast 863 + Store 862(r006) 864 + 866: 52(ivec4) Load 58(inU0) + 867: 50(fvec4) Bitcast 866 + Store 865(r007) 867 + 869: 50(fvec4) Load 55(inF0) + 870: 50(fvec4) ExtInst 1(GLSL.std.450) 18(Atan) 869 + Store 868(r009) 870 + 872: 50(fvec4) Load 55(inF0) + 873: 50(fvec4) Load 56(inF1) + 874: 50(fvec4) ExtInst 1(GLSL.std.450) 25(Atan2) 872 873 + Store 871(r010) 874 + 876: 50(fvec4) Load 55(inF0) + 877: 50(fvec4) ExtInst 1(GLSL.std.450) 9(Ceil) 876 + Store 875(r011) 877 + 879: 50(fvec4) Load 55(inF0) + 880: 50(fvec4) Load 56(inF1) + 881: 50(fvec4) Load 57(inF2) + 882: 50(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 879 880 881 + Store 878(r012) 882 + 883: 50(fvec4) Load 55(inF0) + 884: 840(bvec4) FOrdLessThan 883 841 + 885: 137(bool) Any 884 + SelectionMerge 887 None + BranchConditional 885 886 887 + 886: Label + Kill + 887: Label + 889: 52(ivec4) Load 58(inU0) + 891: 840(bvec4) ULessThan 889 890 + 892: 137(bool) Any 891 + SelectionMerge 894 None + BranchConditional 892 893 894 + 893: Label + Kill + 894: Label + 897: 50(fvec4) Load 55(inF0) + 898: 50(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 897 + Store 896(r013) 898 + 900: 50(fvec4) Load 55(inF0) + 901: 50(fvec4) ExtInst 1(GLSL.std.450) 20(Cosh) 900 + Store 899(r014) 901 + 904: 52(ivec4) BitCount 903 + Store 902(r015) 904 + 906: 50(fvec4) Load 55(inF0) + 907: 50(fvec4) DPdx 906 + Store 905(r016) 907 + 909: 50(fvec4) Load 55(inF0) + 910: 50(fvec4) DPdxCoarse 909 + Store 908(r017) 910 + 912: 50(fvec4) Load 55(inF0) + 913: 50(fvec4) DPdxFine 912 + Store 911(r018) 913 + 915: 50(fvec4) Load 55(inF0) + 916: 50(fvec4) DPdy 915 + Store 914(r019) 916 + 918: 50(fvec4) Load 55(inF0) + 919: 50(fvec4) DPdyCoarse 918 + Store 917(r020) 919 + 921: 50(fvec4) Load 55(inF0) + 922: 50(fvec4) DPdyFine 921 + Store 920(r021) 922 + 924: 50(fvec4) Load 55(inF0) + 925: 50(fvec4) ExtInst 1(GLSL.std.450) 12(Degrees) 924 + Store 923(r022) 925 + 927: 50(fvec4) Load 55(inF0) + 928: 50(fvec4) Load 56(inF1) + 929: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 927 928 + Store 926(r023) 929 + 931: 50(fvec4) Load 55(inF0) + 932: 50(fvec4) Load 56(inF1) + 933: 6(float) Dot 931 932 + Store 930(r024) 933 + 935: 7(ptr) AccessChain 55(inF0) 537 + 936: 6(float) Load 935 + 937: 7(ptr) AccessChain 56(inF1) 537 + 938: 6(float) Load 937 + 939: 6(float) FMul 936 938 + 940: 7(ptr) AccessChain 55(inF0) 538 + 941: 6(float) Load 940 + 942: 7(ptr) AccessChain 56(inF1) 654 + 943: 6(float) Load 942 + 944: 50(fvec4) CompositeConstruct 293 939 941 943 + Store 934(r025) 944 + 946: 50(fvec4) Load 55(inF0) + 947: 50(fvec4) ExtInst 1(GLSL.std.450) 27(Exp) 946 + Store 945(r029) 947 + 949: 50(fvec4) Load 55(inF0) + 950: 50(fvec4) ExtInst 1(GLSL.std.450) 29(Exp2) 949 + Store 948(r030) 950 + 952: 50(fvec4) Load 55(inF0) + 953: 50(fvec4) Load 56(inF1) + 954: 50(fvec4) Load 57(inF2) + 955: 50(fvec4) ExtInst 1(GLSL.std.450) 70(FaceForward) 952 953 954 + Store 951(r031) 955 + 960: 52(ivec4) ExtInst 1(GLSL.std.450) 75(FindUMsb) 959 + Store 956(r032) 960 + 962: 52(ivec4) ExtInst 1(GLSL.std.450) 73(FindILsb) 959 + Store 961(r033) 962 + 964: 50(fvec4) Load 55(inF0) + 965: 50(fvec4) ExtInst 1(GLSL.std.450) 8(Floor) 964 + Store 963(r034) 965 + 967: 50(fvec4) Load 55(inF0) + 968: 50(fvec4) Load 56(inF1) + 969: 50(fvec4) FMod 967 968 + Store 966(r036) 969 + 971: 50(fvec4) Load 55(inF0) + 972: 50(fvec4) ExtInst 1(GLSL.std.450) 10(Fract) 971 + Store 970(r037) 972 + 974: 50(fvec4) Load 55(inF0) + 975: 50(fvec4) Fwidth 974 + Store 973(r039) 975 + 978: 50(fvec4) Load 55(inF0) + 979: 840(bvec4) IsInf 978 + Store 977(r040) 979 + 981: 50(fvec4) Load 55(inF0) + 982: 840(bvec4) IsNan 981 + Store 980(r041) 982 + 984: 50(fvec4) Load 55(inF0) + 985: 50(fvec4) Load 56(inF1) + 986: 50(fvec4) ExtInst 1(GLSL.std.450) 53(Ldexp) 984 985 + Store 983(r042) 986 + 988: 50(fvec4) Load 55(inF0) + 989: 50(fvec4) Load 56(inF1) + 990: 50(fvec4) Load 57(inF2) + 991: 50(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 988 989 990 + Store 987(r039a) 991 + 993: 50(fvec4) Load 55(inF0) + 994: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 993 + Store 992(r043) 994 + 996: 50(fvec4) Load 55(inF0) + 997: 50(fvec4) ExtInst 1(GLSL.std.450) 28(Log) 996 + Store 995(r044) 997 + 999: 50(fvec4) Load 55(inF0) + 1000: 50(fvec4) ExtInst 1(GLSL.std.450) 30(Log2) 999 + 1001: 50(fvec4) VectorTimesScalar 1000 272 + Store 998(r045) 1001 + 1003: 50(fvec4) Load 55(inF0) + 1004: 50(fvec4) ExtInst 1(GLSL.std.450) 30(Log2) 1003 + Store 1002(r046) 1004 + 1006: 50(fvec4) Load 55(inF0) + 1007: 50(fvec4) Load 56(inF1) + 1008: 50(fvec4) ExtInst 1(GLSL.std.450) 40(FMax) 1006 1007 + Store 1005(r047) 1008 + 1010: 50(fvec4) Load 55(inF0) + 1011: 50(fvec4) Load 56(inF1) + 1012: 50(fvec4) ExtInst 1(GLSL.std.450) 37(FMin) 1010 1011 + Store 1009(r048) 1012 + 1014: 50(fvec4) Load 55(inF0) + 1015: 50(fvec4) ExtInst 1(GLSL.std.450) 69(Normalize) 1014 + Store 1013(r049) 1015 + 1017: 50(fvec4) Load 55(inF0) + 1018: 50(fvec4) Load 56(inF1) + 1019: 50(fvec4) ExtInst 1(GLSL.std.450) 26(Pow) 1017 1018 + Store 1016(r050) 1019 + 1021: 50(fvec4) Load 55(inF0) + 1022: 50(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 1021 + Store 1020(r051) 1022 + 1024: 50(fvec4) Load 55(inF0) + 1025: 50(fvec4) CompositeConstruct 293 293 293 293 + 1026: 50(fvec4) FDiv 1025 1024 + Store 1023(r052) 1026 + 1028: 50(fvec4) Load 55(inF0) + 1029: 50(fvec4) Load 56(inF1) + 1030: 50(fvec4) ExtInst 1(GLSL.std.450) 71(Reflect) 1028 1029 + Store 1027(r053) 1030 + 1032: 50(fvec4) Load 55(inF0) + 1033: 50(fvec4) Load 56(inF1) + 1034: 50(fvec4) ExtInst 1(GLSL.std.450) 72(Refract) 1032 1033 534 + Store 1031(r054) 1034 + 1037: 52(ivec4) BitReverse 1036 + Store 1035(r055) 1037 + 1039: 50(fvec4) Load 55(inF0) + 1040: 50(fvec4) ExtInst 1(GLSL.std.450) 2(RoundEven) 1039 + Store 1038(r056) 1040 + 1042: 50(fvec4) Load 55(inF0) + 1043: 50(fvec4) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1042 + Store 1041(r057) 1043 + 1045: 50(fvec4) Load 55(inF0) + 1046: 50(fvec4) CompositeConstruct 141 141 141 141 + 1047: 50(fvec4) CompositeConstruct 293 293 293 293 + 1048: 50(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 1045 1046 1047 + Store 1044(r058) 1048 + 1050: 50(fvec4) Load 55(inF0) + 1051: 50(fvec4) ExtInst 1(GLSL.std.450) 6(FSign) 1050 + Store 1049(r059) 1051 + 1053: 50(fvec4) Load 55(inF0) + 1054: 50(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 1053 + Store 1052(r060) 1054 + 1055: 50(fvec4) Load 55(inF0) + 1056: 50(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 1055 + Store 56(inF1) 1056 + 1057: 50(fvec4) Load 55(inF0) + 1058: 50(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 1057 + Store 57(inF2) 1058 + 1060: 50(fvec4) Load 55(inF0) + 1061: 50(fvec4) ExtInst 1(GLSL.std.450) 19(Sinh) 1060 + Store 1059(r061) 1061 + 1063: 50(fvec4) Load 55(inF0) + 1064: 50(fvec4) Load 56(inF1) + 1065: 50(fvec4) Load 57(inF2) + 1066: 50(fvec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 1063 1064 1065 + Store 1062(r062) 1066 + 1068: 50(fvec4) Load 55(inF0) + 1069: 50(fvec4) ExtInst 1(GLSL.std.450) 31(Sqrt) 1068 + Store 1067(r063) 1069 + 1071: 50(fvec4) Load 55(inF0) + 1072: 50(fvec4) Load 56(inF1) + 1073: 50(fvec4) ExtInst 1(GLSL.std.450) 48(Step) 1071 1072 + Store 1070(r064) 1073 + 1075: 50(fvec4) Load 55(inF0) + 1076: 50(fvec4) ExtInst 1(GLSL.std.450) 15(Tan) 1075 + Store 1074(r065) 1076 + 1078: 50(fvec4) Load 55(inF0) + 1079: 50(fvec4) ExtInst 1(GLSL.std.450) 21(Tanh) 1078 + Store 1077(r066) 1079 + 1081: 50(fvec4) Load 55(inF0) + 1082: 50(fvec4) ExtInst 1(GLSL.std.450) 3(Trunc) 1081 + Store 1080(r067) 1082 + ReturnValue 1084 + FunctionEnd +68(PixelShaderFunction2x2(mf22;mf22;mf22;): 62 Function None 64 + 65(inF0): 63(ptr) FunctionParameter + 66(inF1): 63(ptr) FunctionParameter + 67(inF2): 63(ptr) FunctionParameter + 69: Label + 1087(r000): 138(ptr) Variable Function + 1092(r001): 63(ptr) Variable Function + 1097(r003): 138(ptr) Variable Function + 1101(r004): 63(ptr) Variable Function + 1104(r005): 63(ptr) Variable Function + 1107(r006): 63(ptr) Variable Function + 1111(r007): 63(ptr) Variable Function + 1121(r008): 63(ptr) Variable Function + 1126(r009): 63(ptr) Variable Function + 1129(r010): 63(ptr) Variable Function + 1132(r011): 63(ptr) Variable Function + 1135(r012): 63(ptr) Variable Function + 1138(r013): 63(ptr) Variable Function + 1141(r014): 63(ptr) Variable Function + 1144(r015): 63(ptr) Variable Function + 1147(r016): 63(ptr) Variable Function + 1150(r017): 63(ptr) Variable Function + 1153(r018): 7(ptr) Variable Function + 1156(r019): 63(ptr) Variable Function + 1159(R020): 63(ptr) Variable Function + 1162(r021): 63(ptr) Variable Function + 1165(r022): 63(ptr) Variable Function + 1175(r023): 63(ptr) Variable Function + 1178(r025): 63(ptr) Variable Function + 1181(r026): 63(ptr) Variable Function + 1185(r026a): 63(ptr) Variable Function + 1190(r027): 63(ptr) Variable Function + 1193(r028): 63(ptr) Variable Function + 1197(r029): 63(ptr) Variable Function + 1200(r030): 63(ptr) Variable Function + 1204(r031): 63(ptr) Variable Function + 1208(r032): 63(ptr) Variable Function + 1212(r033): 63(ptr) Variable Function + 1215(r034): 63(ptr) Variable Function + 1218(r035): 63(ptr) Variable Function + 1221(r036): 63(ptr) Variable Function + 1226(r037): 63(ptr) Variable Function + 1229(r038): 63(ptr) Variable Function + 1236(r039): 63(ptr) Variable Function + 1239(r049): 63(ptr) Variable Function + 1244(r041): 63(ptr) Variable Function + 1247(r042): 63(ptr) Variable Function + 1251(r043): 63(ptr) Variable Function + 1254(r044): 63(ptr) Variable Function + 1259(r046): 63(ptr) Variable Function + 1088: 62 Load 65(inF0) + 1090: 1089 FOrdNotEqual 1088 141 + 1091: 137(bool) All 1090 + Store 1087(r000) 1091 + 1093: 62 Load 65(inF0) + 1094: 62 ExtInst 1(GLSL.std.450) 4(FAbs) 1093 + Store 1092(r001) 1094 + 1095: 62 Load 65(inF0) + 1096: 62 ExtInst 1(GLSL.std.450) 17(Acos) 1095 + 1098: 62 Load 65(inF0) + 1099: 1089 FOrdNotEqual 1098 141 + 1100: 137(bool) Any 1099 + Store 1097(r003) 1100 + 1102: 62 Load 65(inF0) + 1103: 62 ExtInst 1(GLSL.std.450) 16(Asin) 1102 + Store 1101(r004) 1103 + 1105: 62 Load 65(inF0) + 1106: 62 ExtInst 1(GLSL.std.450) 18(Atan) 1105 + Store 1104(r005) 1106 + 1108: 62 Load 65(inF0) + 1109: 62 Load 66(inF1) + 1110: 62 ExtInst 1(GLSL.std.450) 25(Atan2) 1108 1109 + Store 1107(r006) 1110 + 1112: 62 Load 65(inF0) + 1113: 62 ExtInst 1(GLSL.std.450) 9(Ceil) 1112 + Store 1111(r007) 1113 + 1114: 62 Load 65(inF0) + 1116: 1089 FOrdLessThan 1114 1115 + 1117: 137(bool) Any 1116 + SelectionMerge 1119 None + BranchConditional 1117 1118 1119 + 1118: Label + Kill + 1119: Label + 1122: 62 Load 65(inF0) + 1123: 62 Load 66(inF1) + 1124: 62 Load 67(inF2) + 1125: 62 ExtInst 1(GLSL.std.450) 43(FClamp) 1122 1123 1124 + Store 1121(r008) 1125 + 1127: 62 Load 65(inF0) + 1128: 62 ExtInst 1(GLSL.std.450) 14(Cos) 1127 + Store 1126(r009) 1128 + 1130: 62 Load 65(inF0) + 1131: 62 ExtInst 1(GLSL.std.450) 20(Cosh) 1130 + Store 1129(r010) 1131 + 1133: 62 Load 65(inF0) + 1134: 62 DPdx 1133 + Store 1132(r011) 1134 + 1136: 62 Load 65(inF0) + 1137: 62 DPdxCoarse 1136 + Store 1135(r012) 1137 + 1139: 62 Load 65(inF0) + 1140: 62 DPdxFine 1139 + Store 1138(r013) 1140 + 1142: 62 Load 65(inF0) + 1143: 62 DPdy 1142 + Store 1141(r014) 1143 + 1145: 62 Load 65(inF0) + 1146: 62 DPdyCoarse 1145 + Store 1144(r015) 1146 + 1148: 62 Load 65(inF0) + 1149: 62 DPdyFine 1148 + Store 1147(r016) 1149 + 1151: 62 Load 65(inF0) + 1152: 62 ExtInst 1(GLSL.std.450) 12(Degrees) 1151 + Store 1150(r017) 1152 + 1154: 62 Load 65(inF0) + 1155: 6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 1154 + Store 1153(r018) 1155 + 1157: 62 Load 65(inF0) + 1158: 62 ExtInst 1(GLSL.std.450) 27(Exp) 1157 + Store 1156(r019) 1158 + 1160: 62 Load 65(inF0) + 1161: 62 ExtInst 1(GLSL.std.450) 29(Exp2) 1160 + Store 1159(R020) 1161 + 1163: 62 Load 65(inF0) + 1164: 62 ExtInst 1(GLSL.std.450) 8(Floor) 1163 + Store 1162(r021) 1164 + 1166: 62 Load 65(inF0) + 1167: 62 Load 66(inF1) + 1168: 26(fvec2) CompositeExtract 1166 0 + 1169: 26(fvec2) CompositeExtract 1167 0 + 1170: 26(fvec2) FMod 1168 1169 + 1171: 26(fvec2) CompositeExtract 1166 1 + 1172: 26(fvec2) CompositeExtract 1167 1 + 1173: 26(fvec2) FMod 1171 1172 + 1174: 62 CompositeConstruct 1170 1173 + Store 1165(r022) 1174 + 1176: 62 Load 65(inF0) + 1177: 62 ExtInst 1(GLSL.std.450) 10(Fract) 1176 + Store 1175(r023) 1177 + 1179: 62 Load 65(inF0) + 1180: 62 Fwidth 1179 + Store 1178(r025) 1180 + 1182: 62 Load 65(inF0) + 1183: 62 Load 66(inF1) + 1184: 62 ExtInst 1(GLSL.std.450) 53(Ldexp) 1182 1183 + Store 1181(r026) 1184 + 1186: 62 Load 65(inF0) + 1187: 62 Load 66(inF1) + 1188: 62 Load 67(inF2) + 1189: 62 ExtInst 1(GLSL.std.450) 46(FMix) 1186 1187 1188 + Store 1185(r026a) 1189 + 1191: 62 Load 65(inF0) + 1192: 62 ExtInst 1(GLSL.std.450) 28(Log) 1191 + Store 1190(r027) 1192 + 1194: 62 Load 65(inF0) + 1195: 62 ExtInst 1(GLSL.std.450) 30(Log2) 1194 + 1196: 62 MatrixTimesScalar 1195 272 + Store 1193(r028) 1196 + 1198: 62 Load 65(inF0) + 1199: 62 ExtInst 1(GLSL.std.450) 30(Log2) 1198 + Store 1197(r029) 1199 + 1201: 62 Load 65(inF0) + 1202: 62 Load 66(inF1) + 1203: 62 ExtInst 1(GLSL.std.450) 40(FMax) 1201 1202 + Store 1200(r030) 1203 + 1205: 62 Load 65(inF0) + 1206: 62 Load 66(inF1) + 1207: 62 ExtInst 1(GLSL.std.450) 37(FMin) 1205 1206 + Store 1204(r031) 1207 + 1209: 62 Load 65(inF0) + 1210: 62 Load 66(inF1) + 1211: 62 ExtInst 1(GLSL.std.450) 26(Pow) 1209 1210 + Store 1208(r032) 1211 + 1213: 62 Load 65(inF0) + 1214: 62 ExtInst 1(GLSL.std.450) 11(Radians) 1213 + Store 1212(r033) 1214 + 1216: 62 Load 65(inF0) + 1217: 62 ExtInst 1(GLSL.std.450) 2(RoundEven) 1216 + Store 1215(r034) 1217 + 1219: 62 Load 65(inF0) + 1220: 62 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1219 + Store 1218(r035) 1220 + 1222: 62 Load 65(inF0) + 1223: 26(fvec2) CompositeConstruct 141 141 + 1224: 26(fvec2) CompositeConstruct 293 293 + 1225: 62 ExtInst 1(GLSL.std.450) 43(FClamp) 1222 1223 1224 + Store 1221(r036) 1225 + 1227: 62 Load 65(inF0) + 1228: 62 ExtInst 1(GLSL.std.450) 6(FSign) 1227 + Store 1226(r037) 1228 + 1230: 62 Load 65(inF0) + 1231: 62 ExtInst 1(GLSL.std.450) 13(Sin) 1230 + Store 1229(r038) 1231 + 1232: 62 Load 65(inF0) + 1233: 62 ExtInst 1(GLSL.std.450) 13(Sin) 1232 + Store 66(inF1) 1233 + 1234: 62 Load 65(inF0) + 1235: 62 ExtInst 1(GLSL.std.450) 14(Cos) 1234 + Store 67(inF2) 1235 + 1237: 62 Load 65(inF0) + 1238: 62 ExtInst 1(GLSL.std.450) 19(Sinh) 1237 + Store 1236(r039) 1238 + 1240: 62 Load 65(inF0) + 1241: 62 Load 66(inF1) + 1242: 62 Load 67(inF2) + 1243: 62 ExtInst 1(GLSL.std.450) 49(SmoothStep) 1240 1241 1242 + Store 1239(r049) 1243 + 1245: 62 Load 65(inF0) + 1246: 62 ExtInst 1(GLSL.std.450) 31(Sqrt) 1245 + Store 1244(r041) 1246 + 1248: 62 Load 65(inF0) + 1249: 62 Load 66(inF1) + 1250: 62 ExtInst 1(GLSL.std.450) 48(Step) 1248 1249 + Store 1247(r042) 1250 + 1252: 62 Load 65(inF0) + 1253: 62 ExtInst 1(GLSL.std.450) 15(Tan) 1252 + Store 1251(r043) 1253 + 1255: 62 Load 65(inF0) + 1256: 62 ExtInst 1(GLSL.std.450) 21(Tanh) 1255 + Store 1254(r044) 1256 + 1257: 62 Load 65(inF0) + 1258: 62 Transpose 1257 + 1260: 62 Load 65(inF0) + 1261: 62 ExtInst 1(GLSL.std.450) 3(Trunc) 1260 + Store 1259(r046) 1261 + ReturnValue 1263 + FunctionEnd +76(PixelShaderFunction3x3(mf33;mf33;mf33;): 70 Function None 72 + 73(inF0): 71(ptr) FunctionParameter + 74(inF1): 71(ptr) FunctionParameter + 75(inF2): 71(ptr) FunctionParameter + 77: Label + 1266(r000): 138(ptr) Variable Function + 1271(r001): 71(ptr) Variable Function + 1276(r003): 138(ptr) Variable Function + 1280(r004): 71(ptr) Variable Function + 1283(r005): 71(ptr) Variable Function + 1286(r006): 71(ptr) Variable Function + 1290(r007): 71(ptr) Variable Function + 1300(r008): 71(ptr) Variable Function + 1305(r009): 71(ptr) Variable Function + 1308(r010): 71(ptr) Variable Function + 1311(r011): 71(ptr) Variable Function + 1314(r012): 71(ptr) Variable Function + 1317(r013): 71(ptr) Variable Function + 1320(r014): 71(ptr) Variable Function + 1323(r015): 71(ptr) Variable Function + 1326(r016): 71(ptr) Variable Function + 1329(r017): 71(ptr) Variable Function + 1332(r018): 7(ptr) Variable Function + 1335(r019): 71(ptr) Variable Function + 1338(R020): 71(ptr) Variable Function + 1341(r021): 71(ptr) Variable Function + 1344(r022): 71(ptr) Variable Function + 1357(r023): 71(ptr) Variable Function + 1360(r025): 71(ptr) Variable Function + 1363(r026): 71(ptr) Variable Function + 1367(r026a): 71(ptr) Variable Function + 1372(r027): 71(ptr) Variable Function + 1375(r028): 71(ptr) Variable Function + 1379(r029): 71(ptr) Variable Function + 1382(r030): 71(ptr) Variable Function + 1386(r031): 71(ptr) Variable Function + 1390(r032): 71(ptr) Variable Function + 1394(r033): 71(ptr) Variable Function + 1397(r034): 71(ptr) Variable Function + 1400(r035): 71(ptr) Variable Function + 1403(r036): 71(ptr) Variable Function + 1408(r037): 71(ptr) Variable Function + 1411(r038): 71(ptr) Variable Function + 1418(r039): 71(ptr) Variable Function + 1421(r049): 71(ptr) Variable Function + 1426(r041): 71(ptr) Variable Function + 1429(r042): 71(ptr) Variable Function + 1433(r043): 71(ptr) Variable Function + 1436(r044): 71(ptr) Variable Function + 1441(r046): 71(ptr) Variable Function + 1267: 70 Load 73(inF0) + 1269: 1268 FOrdNotEqual 1267 141 + 1270: 137(bool) All 1269 + Store 1266(r000) 1270 + 1272: 70 Load 73(inF0) + 1273: 70 ExtInst 1(GLSL.std.450) 4(FAbs) 1272 + Store 1271(r001) 1273 + 1274: 70 Load 73(inF0) + 1275: 70 ExtInst 1(GLSL.std.450) 17(Acos) 1274 + 1277: 70 Load 73(inF0) + 1278: 1268 FOrdNotEqual 1277 141 + 1279: 137(bool) Any 1278 + Store 1276(r003) 1279 + 1281: 70 Load 73(inF0) + 1282: 70 ExtInst 1(GLSL.std.450) 16(Asin) 1281 + Store 1280(r004) 1282 + 1284: 70 Load 73(inF0) + 1285: 70 ExtInst 1(GLSL.std.450) 18(Atan) 1284 + Store 1283(r005) 1285 + 1287: 70 Load 73(inF0) + 1288: 70 Load 74(inF1) + 1289: 70 ExtInst 1(GLSL.std.450) 25(Atan2) 1287 1288 + Store 1286(r006) 1289 + 1291: 70 Load 73(inF0) + 1292: 70 ExtInst 1(GLSL.std.450) 9(Ceil) 1291 + Store 1290(r007) 1292 + 1293: 70 Load 73(inF0) + 1295: 1268 FOrdLessThan 1293 1294 + 1296: 137(bool) Any 1295 + SelectionMerge 1298 None + BranchConditional 1296 1297 1298 + 1297: Label + Kill + 1298: Label + 1301: 70 Load 73(inF0) + 1302: 70 Load 74(inF1) + 1303: 70 Load 75(inF2) + 1304: 70 ExtInst 1(GLSL.std.450) 43(FClamp) 1301 1302 1303 + Store 1300(r008) 1304 + 1306: 70 Load 73(inF0) + 1307: 70 ExtInst 1(GLSL.std.450) 14(Cos) 1306 + Store 1305(r009) 1307 + 1309: 70 Load 73(inF0) + 1310: 70 ExtInst 1(GLSL.std.450) 20(Cosh) 1309 + Store 1308(r010) 1310 + 1312: 70 Load 73(inF0) + 1313: 70 DPdx 1312 + Store 1311(r011) 1313 + 1315: 70 Load 73(inF0) + 1316: 70 DPdxCoarse 1315 + Store 1314(r012) 1316 + 1318: 70 Load 73(inF0) + 1319: 70 DPdxFine 1318 + Store 1317(r013) 1319 + 1321: 70 Load 73(inF0) + 1322: 70 DPdy 1321 + Store 1320(r014) 1322 + 1324: 70 Load 73(inF0) + 1325: 70 DPdyCoarse 1324 + Store 1323(r015) 1325 + 1327: 70 Load 73(inF0) + 1328: 70 DPdyFine 1327 + Store 1326(r016) 1328 + 1330: 70 Load 73(inF0) + 1331: 70 ExtInst 1(GLSL.std.450) 12(Degrees) 1330 + Store 1329(r017) 1331 + 1333: 70 Load 73(inF0) + 1334: 6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 1333 + Store 1332(r018) 1334 + 1336: 70 Load 73(inF0) + 1337: 70 ExtInst 1(GLSL.std.450) 27(Exp) 1336 + Store 1335(r019) 1337 + 1339: 70 Load 73(inF0) + 1340: 70 ExtInst 1(GLSL.std.450) 29(Exp2) 1339 + Store 1338(R020) 1340 + 1342: 70 Load 73(inF0) + 1343: 70 ExtInst 1(GLSL.std.450) 8(Floor) 1342 + Store 1341(r021) 1343 + 1345: 70 Load 73(inF0) + 1346: 70 Load 74(inF1) + 1347: 38(fvec3) CompositeExtract 1345 0 + 1348: 38(fvec3) CompositeExtract 1346 0 + 1349: 38(fvec3) FMod 1347 1348 + 1350: 38(fvec3) CompositeExtract 1345 1 + 1351: 38(fvec3) CompositeExtract 1346 1 + 1352: 38(fvec3) FMod 1350 1351 + 1353: 38(fvec3) CompositeExtract 1345 2 + 1354: 38(fvec3) CompositeExtract 1346 2 + 1355: 38(fvec3) FMod 1353 1354 + 1356: 70 CompositeConstruct 1349 1352 1355 + Store 1344(r022) 1356 + 1358: 70 Load 73(inF0) + 1359: 70 ExtInst 1(GLSL.std.450) 10(Fract) 1358 + Store 1357(r023) 1359 + 1361: 70 Load 73(inF0) + 1362: 70 Fwidth 1361 + Store 1360(r025) 1362 + 1364: 70 Load 73(inF0) + 1365: 70 Load 74(inF1) + 1366: 70 ExtInst 1(GLSL.std.450) 53(Ldexp) 1364 1365 + Store 1363(r026) 1366 + 1368: 70 Load 73(inF0) + 1369: 70 Load 74(inF1) + 1370: 70 Load 75(inF2) + 1371: 70 ExtInst 1(GLSL.std.450) 46(FMix) 1368 1369 1370 + Store 1367(r026a) 1371 + 1373: 70 Load 73(inF0) + 1374: 70 ExtInst 1(GLSL.std.450) 28(Log) 1373 + Store 1372(r027) 1374 + 1376: 70 Load 73(inF0) + 1377: 70 ExtInst 1(GLSL.std.450) 30(Log2) 1376 + 1378: 70 MatrixTimesScalar 1377 272 + Store 1375(r028) 1378 + 1380: 70 Load 73(inF0) + 1381: 70 ExtInst 1(GLSL.std.450) 30(Log2) 1380 + Store 1379(r029) 1381 + 1383: 70 Load 73(inF0) + 1384: 70 Load 74(inF1) + 1385: 70 ExtInst 1(GLSL.std.450) 40(FMax) 1383 1384 + Store 1382(r030) 1385 + 1387: 70 Load 73(inF0) + 1388: 70 Load 74(inF1) + 1389: 70 ExtInst 1(GLSL.std.450) 37(FMin) 1387 1388 + Store 1386(r031) 1389 + 1391: 70 Load 73(inF0) + 1392: 70 Load 74(inF1) + 1393: 70 ExtInst 1(GLSL.std.450) 26(Pow) 1391 1392 + Store 1390(r032) 1393 + 1395: 70 Load 73(inF0) + 1396: 70 ExtInst 1(GLSL.std.450) 11(Radians) 1395 + Store 1394(r033) 1396 + 1398: 70 Load 73(inF0) + 1399: 70 ExtInst 1(GLSL.std.450) 2(RoundEven) 1398 + Store 1397(r034) 1399 + 1401: 70 Load 73(inF0) + 1402: 70 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1401 + Store 1400(r035) 1402 + 1404: 70 Load 73(inF0) + 1405: 38(fvec3) CompositeConstruct 141 141 141 + 1406: 38(fvec3) CompositeConstruct 293 293 293 + 1407: 70 ExtInst 1(GLSL.std.450) 43(FClamp) 1404 1405 1406 + Store 1403(r036) 1407 + 1409: 70 Load 73(inF0) + 1410: 70 ExtInst 1(GLSL.std.450) 6(FSign) 1409 + Store 1408(r037) 1410 + 1412: 70 Load 73(inF0) + 1413: 70 ExtInst 1(GLSL.std.450) 13(Sin) 1412 + Store 1411(r038) 1413 + 1414: 70 Load 73(inF0) + 1415: 70 ExtInst 1(GLSL.std.450) 13(Sin) 1414 + Store 74(inF1) 1415 + 1416: 70 Load 73(inF0) + 1417: 70 ExtInst 1(GLSL.std.450) 14(Cos) 1416 + Store 75(inF2) 1417 + 1419: 70 Load 73(inF0) + 1420: 70 ExtInst 1(GLSL.std.450) 19(Sinh) 1419 + Store 1418(r039) 1420 + 1422: 70 Load 73(inF0) + 1423: 70 Load 74(inF1) + 1424: 70 Load 75(inF2) + 1425: 70 ExtInst 1(GLSL.std.450) 49(SmoothStep) 1422 1423 1424 + Store 1421(r049) 1425 + 1427: 70 Load 73(inF0) + 1428: 70 ExtInst 1(GLSL.std.450) 31(Sqrt) 1427 + Store 1426(r041) 1428 + 1430: 70 Load 73(inF0) + 1431: 70 Load 74(inF1) + 1432: 70 ExtInst 1(GLSL.std.450) 48(Step) 1430 1431 + Store 1429(r042) 1432 + 1434: 70 Load 73(inF0) + 1435: 70 ExtInst 1(GLSL.std.450) 15(Tan) 1434 + Store 1433(r043) 1435 + 1437: 70 Load 73(inF0) + 1438: 70 ExtInst 1(GLSL.std.450) 21(Tanh) 1437 + Store 1436(r044) 1438 + 1439: 70 Load 73(inF0) + 1440: 70 Transpose 1439 + 1442: 70 Load 73(inF0) + 1443: 70 ExtInst 1(GLSL.std.450) 3(Trunc) 1442 + Store 1441(r046) 1443 + ReturnValue 1445 + FunctionEnd +84(PixelShaderFunction4x4(mf44;mf44;mf44;): 78 Function None 80 + 81(inF0): 79(ptr) FunctionParameter + 82(inF1): 79(ptr) FunctionParameter + 83(inF2): 79(ptr) FunctionParameter + 85: Label + 1448(r000): 138(ptr) Variable Function + 1453(r001): 79(ptr) Variable Function + 1458(r003): 138(ptr) Variable Function + 1462(r004): 79(ptr) Variable Function + 1465(r005): 79(ptr) Variable Function + 1468(r006): 79(ptr) Variable Function + 1472(r007): 79(ptr) Variable Function + 1482(r008): 79(ptr) Variable Function + 1487(r009): 79(ptr) Variable Function + 1490(r010): 79(ptr) Variable Function + 1493(r011): 79(ptr) Variable Function + 1496(r012): 79(ptr) Variable Function + 1499(r013): 79(ptr) Variable Function + 1502(r014): 79(ptr) Variable Function + 1505(r015): 79(ptr) Variable Function + 1508(r016): 79(ptr) Variable Function + 1511(r017): 79(ptr) Variable Function + 1514(r018): 7(ptr) Variable Function + 1517(r019): 79(ptr) Variable Function + 1520(R020): 79(ptr) Variable Function + 1523(r021): 79(ptr) Variable Function + 1526(r022): 79(ptr) Variable Function + 1542(r023): 79(ptr) Variable Function + 1545(r025): 79(ptr) Variable Function + 1548(r026): 79(ptr) Variable Function + 1552(r026a): 79(ptr) Variable Function + 1557(r027): 79(ptr) Variable Function + 1560(r028): 79(ptr) Variable Function + 1564(r029): 79(ptr) Variable Function + 1567(r030): 79(ptr) Variable Function + 1571(r031): 79(ptr) Variable Function + 1575(r032): 79(ptr) Variable Function + 1579(r033): 79(ptr) Variable Function + 1582(r034): 79(ptr) Variable Function + 1585(r035): 79(ptr) Variable Function + 1588(r036): 79(ptr) Variable Function + 1593(r037): 79(ptr) Variable Function + 1596(r038): 79(ptr) Variable Function + 1603(r039): 79(ptr) Variable Function + 1606(r049): 79(ptr) Variable Function + 1611(r041): 79(ptr) Variable Function + 1614(r042): 79(ptr) Variable Function + 1618(r043): 79(ptr) Variable Function + 1621(r044): 79(ptr) Variable Function + 1626(r046): 79(ptr) Variable Function + 1449: 78 Load 81(inF0) + 1451: 1450 FOrdNotEqual 1449 141 + 1452: 137(bool) All 1451 + Store 1448(r000) 1452 + 1454: 78 Load 81(inF0) + 1455: 78 ExtInst 1(GLSL.std.450) 4(FAbs) 1454 + Store 1453(r001) 1455 + 1456: 78 Load 81(inF0) + 1457: 78 ExtInst 1(GLSL.std.450) 17(Acos) 1456 + 1459: 78 Load 81(inF0) + 1460: 1450 FOrdNotEqual 1459 141 + 1461: 137(bool) Any 1460 + Store 1458(r003) 1461 + 1463: 78 Load 81(inF0) + 1464: 78 ExtInst 1(GLSL.std.450) 16(Asin) 1463 + Store 1462(r004) 1464 + 1466: 78 Load 81(inF0) + 1467: 78 ExtInst 1(GLSL.std.450) 18(Atan) 1466 + Store 1465(r005) 1467 + 1469: 78 Load 81(inF0) + 1470: 78 Load 82(inF1) + 1471: 78 ExtInst 1(GLSL.std.450) 25(Atan2) 1469 1470 + Store 1468(r006) 1471 + 1473: 78 Load 81(inF0) + 1474: 78 ExtInst 1(GLSL.std.450) 9(Ceil) 1473 + Store 1472(r007) 1474 + 1475: 78 Load 81(inF0) + 1477: 1450 FOrdLessThan 1475 1476 + 1478: 137(bool) Any 1477 + SelectionMerge 1480 None + BranchConditional 1478 1479 1480 + 1479: Label + Kill + 1480: Label + 1483: 78 Load 81(inF0) + 1484: 78 Load 82(inF1) + 1485: 78 Load 83(inF2) + 1486: 78 ExtInst 1(GLSL.std.450) 43(FClamp) 1483 1484 1485 + Store 1482(r008) 1486 + 1488: 78 Load 81(inF0) + 1489: 78 ExtInst 1(GLSL.std.450) 14(Cos) 1488 + Store 1487(r009) 1489 + 1491: 78 Load 81(inF0) + 1492: 78 ExtInst 1(GLSL.std.450) 20(Cosh) 1491 + Store 1490(r010) 1492 + 1494: 78 Load 81(inF0) + 1495: 78 DPdx 1494 + Store 1493(r011) 1495 + 1497: 78 Load 81(inF0) + 1498: 78 DPdxCoarse 1497 + Store 1496(r012) 1498 + 1500: 78 Load 81(inF0) + 1501: 78 DPdxFine 1500 + Store 1499(r013) 1501 + 1503: 78 Load 81(inF0) + 1504: 78 DPdy 1503 + Store 1502(r014) 1504 + 1506: 78 Load 81(inF0) + 1507: 78 DPdyCoarse 1506 + Store 1505(r015) 1507 + 1509: 78 Load 81(inF0) + 1510: 78 DPdyFine 1509 + Store 1508(r016) 1510 + 1512: 78 Load 81(inF0) + 1513: 78 ExtInst 1(GLSL.std.450) 12(Degrees) 1512 + Store 1511(r017) 1513 + 1515: 78 Load 81(inF0) + 1516: 6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 1515 + Store 1514(r018) 1516 + 1518: 78 Load 81(inF0) + 1519: 78 ExtInst 1(GLSL.std.450) 27(Exp) 1518 + Store 1517(r019) 1519 + 1521: 78 Load 81(inF0) + 1522: 78 ExtInst 1(GLSL.std.450) 29(Exp2) 1521 + Store 1520(R020) 1522 + 1524: 78 Load 81(inF0) + 1525: 78 ExtInst 1(GLSL.std.450) 8(Floor) 1524 + Store 1523(r021) 1525 + 1527: 78 Load 81(inF0) + 1528: 78 Load 82(inF1) + 1529: 50(fvec4) CompositeExtract 1527 0 + 1530: 50(fvec4) CompositeExtract 1528 0 + 1531: 50(fvec4) FMod 1529 1530 + 1532: 50(fvec4) CompositeExtract 1527 1 + 1533: 50(fvec4) CompositeExtract 1528 1 + 1534: 50(fvec4) FMod 1532 1533 + 1535: 50(fvec4) CompositeExtract 1527 2 + 1536: 50(fvec4) CompositeExtract 1528 2 + 1537: 50(fvec4) FMod 1535 1536 + 1538: 50(fvec4) CompositeExtract 1527 3 + 1539: 50(fvec4) CompositeExtract 1528 3 + 1540: 50(fvec4) FMod 1538 1539 + 1541: 78 CompositeConstruct 1531 1534 1537 1540 + Store 1526(r022) 1541 + 1543: 78 Load 81(inF0) + 1544: 78 ExtInst 1(GLSL.std.450) 10(Fract) 1543 + Store 1542(r023) 1544 + 1546: 78 Load 81(inF0) + 1547: 78 Fwidth 1546 + Store 1545(r025) 1547 + 1549: 78 Load 81(inF0) + 1550: 78 Load 82(inF1) + 1551: 78 ExtInst 1(GLSL.std.450) 53(Ldexp) 1549 1550 + Store 1548(r026) 1551 + 1553: 78 Load 81(inF0) + 1554: 78 Load 82(inF1) + 1555: 78 Load 83(inF2) + 1556: 78 ExtInst 1(GLSL.std.450) 46(FMix) 1553 1554 1555 + Store 1552(r026a) 1556 + 1558: 78 Load 81(inF0) + 1559: 78 ExtInst 1(GLSL.std.450) 28(Log) 1558 + Store 1557(r027) 1559 + 1561: 78 Load 81(inF0) + 1562: 78 ExtInst 1(GLSL.std.450) 30(Log2) 1561 + 1563: 78 MatrixTimesScalar 1562 272 + Store 1560(r028) 1563 + 1565: 78 Load 81(inF0) + 1566: 78 ExtInst 1(GLSL.std.450) 30(Log2) 1565 + Store 1564(r029) 1566 + 1568: 78 Load 81(inF0) + 1569: 78 Load 82(inF1) + 1570: 78 ExtInst 1(GLSL.std.450) 40(FMax) 1568 1569 + Store 1567(r030) 1570 + 1572: 78 Load 81(inF0) + 1573: 78 Load 82(inF1) + 1574: 78 ExtInst 1(GLSL.std.450) 37(FMin) 1572 1573 + Store 1571(r031) 1574 + 1576: 78 Load 81(inF0) + 1577: 78 Load 82(inF1) + 1578: 78 ExtInst 1(GLSL.std.450) 26(Pow) 1576 1577 + Store 1575(r032) 1578 + 1580: 78 Load 81(inF0) + 1581: 78 ExtInst 1(GLSL.std.450) 11(Radians) 1580 + Store 1579(r033) 1581 + 1583: 78 Load 81(inF0) + 1584: 78 ExtInst 1(GLSL.std.450) 2(RoundEven) 1583 + Store 1582(r034) 1584 + 1586: 78 Load 81(inF0) + 1587: 78 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1586 + Store 1585(r035) 1587 + 1589: 78 Load 81(inF0) + 1590: 50(fvec4) CompositeConstruct 141 141 141 141 + 1591: 50(fvec4) CompositeConstruct 293 293 293 293 + 1592: 78 ExtInst 1(GLSL.std.450) 43(FClamp) 1589 1590 1591 + Store 1588(r036) 1592 + 1594: 78 Load 81(inF0) + 1595: 78 ExtInst 1(GLSL.std.450) 6(FSign) 1594 + Store 1593(r037) 1595 + 1597: 78 Load 81(inF0) + 1598: 78 ExtInst 1(GLSL.std.450) 13(Sin) 1597 + Store 1596(r038) 1598 + 1599: 78 Load 81(inF0) + 1600: 78 ExtInst 1(GLSL.std.450) 13(Sin) 1599 + Store 82(inF1) 1600 + 1601: 78 Load 81(inF0) + 1602: 78 ExtInst 1(GLSL.std.450) 14(Cos) 1601 + Store 83(inF2) 1602 + 1604: 78 Load 81(inF0) + 1605: 78 ExtInst 1(GLSL.std.450) 19(Sinh) 1604 + Store 1603(r039) 1605 + 1607: 78 Load 81(inF0) + 1608: 78 Load 82(inF1) + 1609: 78 Load 83(inF2) + 1610: 78 ExtInst 1(GLSL.std.450) 49(SmoothStep) 1607 1608 1609 + Store 1606(r049) 1610 + 1612: 78 Load 81(inF0) + 1613: 78 ExtInst 1(GLSL.std.450) 31(Sqrt) 1612 + Store 1611(r041) 1613 + 1615: 78 Load 81(inF0) + 1616: 78 Load 82(inF1) + 1617: 78 ExtInst 1(GLSL.std.450) 48(Step) 1615 1616 + Store 1614(r042) 1617 + 1619: 78 Load 81(inF0) + 1620: 78 ExtInst 1(GLSL.std.450) 15(Tan) 1619 + Store 1618(r043) 1620 + 1622: 78 Load 81(inF0) + 1623: 78 ExtInst 1(GLSL.std.450) 21(Tanh) 1622 + Store 1621(r044) 1623 + 1624: 78 Load 81(inF0) + 1625: 78 Transpose 1624 + 1627: 78 Load 81(inF0) + 1628: 78 ExtInst 1(GLSL.std.450) 3(Trunc) 1627 + Store 1626(r046) 1628 + ReturnValue 1630 + FunctionEnd +93(TestGenMul2(f1;f1;vf2;vf2;mf22;mf22;): 2 Function None 86 + 87(inF0): 7(ptr) FunctionParameter + 88(inF1): 7(ptr) FunctionParameter + 89(inFV0): 27(ptr) FunctionParameter + 90(inFV1): 27(ptr) FunctionParameter + 91(inFM0): 63(ptr) FunctionParameter + 92(inFM1): 63(ptr) FunctionParameter + 94: Label + 1633(r0): 7(ptr) Variable Function + 1637(r1): 27(ptr) Variable Function + 1641(r2): 27(ptr) Variable Function + 1645(r3): 7(ptr) Variable Function + 1649(r4): 27(ptr) Variable Function + 1653(r5): 27(ptr) Variable Function + 1657(r6): 63(ptr) Variable Function + 1661(r7): 63(ptr) Variable Function + 1665(r8): 63(ptr) Variable Function + 1634: 6(float) Load 88(inF1) + 1635: 6(float) Load 87(inF0) + 1636: 6(float) FMul 1634 1635 + Store 1633(r0) 1636 + 1638: 6(float) Load 87(inF0) + 1639: 26(fvec2) Load 89(inFV0) + 1640: 26(fvec2) VectorTimesScalar 1639 1638 + Store 1637(r1) 1640 + 1642: 26(fvec2) Load 89(inFV0) + 1643: 6(float) Load 87(inF0) + 1644: 26(fvec2) VectorTimesScalar 1642 1643 + Store 1641(r2) 1644 + 1646: 26(fvec2) Load 89(inFV0) + 1647: 26(fvec2) Load 90(inFV1) + 1648: 6(float) Dot 1646 1647 + Store 1645(r3) 1648 + 1650: 26(fvec2) Load 89(inFV0) + 1651: 62 Load 91(inFM0) + 1652: 26(fvec2) VectorTimesMatrix 1650 1651 + Store 1649(r4) 1652 + 1654: 62 Load 91(inFM0) + 1655: 26(fvec2) Load 89(inFV0) + 1656: 26(fvec2) MatrixTimesVector 1654 1655 + Store 1653(r5) 1656 + 1658: 6(float) Load 87(inF0) + 1659: 62 Load 91(inFM0) + 1660: 62 MatrixTimesScalar 1659 1658 + Store 1657(r6) 1660 + 1662: 62 Load 91(inFM0) + 1663: 6(float) Load 87(inF0) + 1664: 62 MatrixTimesScalar 1662 1663 + Store 1661(r7) 1664 + 1666: 62 Load 92(inFM1) + 1667: 62 Load 91(inFM0) + 1668: 62 MatrixTimesMatrix 1666 1667 + Store 1665(r8) 1668 + Return + FunctionEnd +102(TestGenMul3(f1;f1;vf3;vf3;mf33;mf33;): 2 Function None 95 + 96(inF0): 7(ptr) FunctionParameter + 97(inF1): 7(ptr) FunctionParameter + 98(inFV0): 39(ptr) FunctionParameter + 99(inFV1): 39(ptr) FunctionParameter + 100(inFM0): 71(ptr) FunctionParameter + 101(inFM1): 71(ptr) FunctionParameter + 103: Label + 1669(r0): 7(ptr) Variable Function + 1673(r1): 39(ptr) Variable Function + 1677(r2): 39(ptr) Variable Function + 1681(r3): 7(ptr) Variable Function + 1685(r4): 39(ptr) Variable Function + 1689(r5): 39(ptr) Variable Function + 1693(r6): 71(ptr) Variable Function + 1697(r7): 71(ptr) Variable Function + 1701(r8): 71(ptr) Variable Function + 1670: 6(float) Load 97(inF1) + 1671: 6(float) Load 96(inF0) + 1672: 6(float) FMul 1670 1671 + Store 1669(r0) 1672 + 1674: 6(float) Load 96(inF0) + 1675: 38(fvec3) Load 98(inFV0) + 1676: 38(fvec3) VectorTimesScalar 1675 1674 + Store 1673(r1) 1676 + 1678: 38(fvec3) Load 98(inFV0) + 1679: 6(float) Load 96(inF0) + 1680: 38(fvec3) VectorTimesScalar 1678 1679 + Store 1677(r2) 1680 + 1682: 38(fvec3) Load 98(inFV0) + 1683: 38(fvec3) Load 99(inFV1) + 1684: 6(float) Dot 1682 1683 + Store 1681(r3) 1684 + 1686: 38(fvec3) Load 98(inFV0) + 1687: 70 Load 100(inFM0) + 1688: 38(fvec3) VectorTimesMatrix 1686 1687 + Store 1685(r4) 1688 + 1690: 70 Load 100(inFM0) + 1691: 38(fvec3) Load 98(inFV0) + 1692: 38(fvec3) MatrixTimesVector 1690 1691 + Store 1689(r5) 1692 + 1694: 6(float) Load 96(inF0) + 1695: 70 Load 100(inFM0) + 1696: 70 MatrixTimesScalar 1695 1694 + Store 1693(r6) 1696 + 1698: 70 Load 100(inFM0) + 1699: 6(float) Load 96(inF0) + 1700: 70 MatrixTimesScalar 1698 1699 + Store 1697(r7) 1700 + 1702: 70 Load 101(inFM1) + 1703: 70 Load 100(inFM0) + 1704: 70 MatrixTimesMatrix 1702 1703 + Store 1701(r8) 1704 + Return + FunctionEnd +111(TestGenMul4(f1;f1;vf4;vf4;mf44;mf44;): 2 Function None 104 + 105(inF0): 7(ptr) FunctionParameter + 106(inF1): 7(ptr) FunctionParameter + 107(inFV0): 51(ptr) FunctionParameter + 108(inFV1): 51(ptr) FunctionParameter + 109(inFM0): 79(ptr) FunctionParameter + 110(inFM1): 79(ptr) FunctionParameter + 112: Label + 1705(r0): 7(ptr) Variable Function + 1709(r1): 51(ptr) Variable Function + 1713(r2): 51(ptr) Variable Function + 1717(r3): 7(ptr) Variable Function + 1721(r4): 51(ptr) Variable Function + 1725(r5): 51(ptr) Variable Function + 1729(r6): 79(ptr) Variable Function + 1733(r7): 79(ptr) Variable Function + 1737(r8): 79(ptr) Variable Function + 1706: 6(float) Load 106(inF1) + 1707: 6(float) Load 105(inF0) + 1708: 6(float) FMul 1706 1707 + Store 1705(r0) 1708 + 1710: 6(float) Load 105(inF0) + 1711: 50(fvec4) Load 107(inFV0) + 1712: 50(fvec4) VectorTimesScalar 1711 1710 + Store 1709(r1) 1712 + 1714: 50(fvec4) Load 107(inFV0) + 1715: 6(float) Load 105(inF0) + 1716: 50(fvec4) VectorTimesScalar 1714 1715 + Store 1713(r2) 1716 + 1718: 50(fvec4) Load 107(inFV0) + 1719: 50(fvec4) Load 108(inFV1) + 1720: 6(float) Dot 1718 1719 + Store 1717(r3) 1720 + 1722: 50(fvec4) Load 107(inFV0) + 1723: 78 Load 109(inFM0) + 1724: 50(fvec4) VectorTimesMatrix 1722 1723 + Store 1721(r4) 1724 + 1726: 78 Load 109(inFM0) + 1727: 50(fvec4) Load 107(inFV0) + 1728: 50(fvec4) MatrixTimesVector 1726 1727 + Store 1725(r5) 1728 + 1730: 6(float) Load 105(inF0) + 1731: 78 Load 109(inFM0) + 1732: 78 MatrixTimesScalar 1731 1730 + Store 1729(r6) 1732 + 1734: 78 Load 109(inFM0) + 1735: 6(float) Load 105(inF0) + 1736: 78 MatrixTimesScalar 1734 1735 + Store 1733(r7) 1736 + 1738: 78 Load 110(inFM1) + 1739: 78 Load 109(inFM0) + 1740: 78 MatrixTimesMatrix 1738 1739 + Store 1737(r8) 1740 + Return + FunctionEnd +131(TestGenMulNxM(f1;f1;vf2;vf3;mf23;mf32;mf33;mf34;mf24;): 2 Function None 121 + 122(inF0): 7(ptr) FunctionParameter + 123(inF1): 7(ptr) FunctionParameter + 124(inFV2): 27(ptr) FunctionParameter + 125(inFV3): 39(ptr) FunctionParameter + 126(inFM2x3): 114(ptr) FunctionParameter + 127(inFM3x2): 116(ptr) FunctionParameter + 128(inFM3x3): 71(ptr) FunctionParameter + 129(inFM3x4): 118(ptr) FunctionParameter + 130(inFM2x4): 120(ptr) FunctionParameter + 132: Label + 1741(r00): 7(ptr) Variable Function + 1745(r01): 27(ptr) Variable Function + 1749(r02): 39(ptr) Variable Function + 1753(r03): 27(ptr) Variable Function + 1757(r04): 39(ptr) Variable Function + 1761(r05): 7(ptr) Variable Function + 1765(r06): 7(ptr) Variable Function + 1769(r07): 39(ptr) Variable Function + 1773(r08): 27(ptr) Variable Function + 1777(r09): 27(ptr) Variable Function + 1781(r10): 39(ptr) Variable Function + 1785(r11): 114(ptr) Variable Function + 1789(r12): 116(ptr) Variable Function + 1793(r13): 63(ptr) Variable Function + 1797(r14): 114(ptr) Variable Function + 1801(r15): 120(ptr) Variable Function + 1805(r16): 118(ptr) Variable Function + 1742: 6(float) Load 123(inF1) + 1743: 6(float) Load 122(inF0) + 1744: 6(float) FMul 1742 1743 + Store 1741(r00) 1744 + 1746: 6(float) Load 122(inF0) + 1747: 26(fvec2) Load 124(inFV2) + 1748: 26(fvec2) VectorTimesScalar 1747 1746 + Store 1745(r01) 1748 + 1750: 6(float) Load 122(inF0) + 1751: 38(fvec3) Load 125(inFV3) + 1752: 38(fvec3) VectorTimesScalar 1751 1750 + Store 1749(r02) 1752 + 1754: 26(fvec2) Load 124(inFV2) + 1755: 6(float) Load 122(inF0) + 1756: 26(fvec2) VectorTimesScalar 1754 1755 + Store 1753(r03) 1756 + 1758: 38(fvec3) Load 125(inFV3) + 1759: 6(float) Load 122(inF0) + 1760: 38(fvec3) VectorTimesScalar 1758 1759 + Store 1757(r04) 1760 + 1762: 26(fvec2) Load 124(inFV2) + 1763: 26(fvec2) Load 124(inFV2) + 1764: 6(float) Dot 1762 1763 + Store 1761(r05) 1764 + 1766: 38(fvec3) Load 125(inFV3) + 1767: 38(fvec3) Load 125(inFV3) + 1768: 6(float) Dot 1766 1767 + Store 1765(r06) 1768 + 1770: 113 Load 126(inFM2x3) + 1771: 26(fvec2) Load 124(inFV2) + 1772: 38(fvec3) MatrixTimesVector 1770 1771 + Store 1769(r07) 1772 + 1774: 115 Load 127(inFM3x2) + 1775: 38(fvec3) Load 125(inFV3) + 1776: 26(fvec2) MatrixTimesVector 1774 1775 + Store 1773(r08) 1776 + 1778: 38(fvec3) Load 125(inFV3) + 1779: 113 Load 126(inFM2x3) + 1780: 26(fvec2) VectorTimesMatrix 1778 1779 + Store 1777(r09) 1780 + 1782: 26(fvec2) Load 124(inFV2) + 1783: 115 Load 127(inFM3x2) + 1784: 38(fvec3) VectorTimesMatrix 1782 1783 + Store 1781(r10) 1784 + 1786: 6(float) Load 122(inF0) + 1787: 113 Load 126(inFM2x3) + 1788: 113 MatrixTimesScalar 1787 1786 + Store 1785(r11) 1788 + 1790: 6(float) Load 122(inF0) + 1791: 115 Load 127(inFM3x2) + 1792: 115 MatrixTimesScalar 1791 1790 + Store 1789(r12) 1792 + 1794: 115 Load 127(inFM3x2) + 1795: 113 Load 126(inFM2x3) + 1796: 62 MatrixTimesMatrix 1794 1795 + Store 1793(r13) 1796 + 1798: 70 Load 128(inFM3x3) + 1799: 113 Load 126(inFM2x3) + 1800: 113 MatrixTimesMatrix 1798 1799 + Store 1797(r14) 1800 + 1802: 117 Load 129(inFM3x4) + 1803: 113 Load 126(inFM2x3) + 1804: 119 MatrixTimesMatrix 1802 1803 + Store 1801(r15) 1804 + 1806: 119 Load 130(inFM2x4) + 1807: 115 Load 127(inFM3x2) + 1808: 117 MatrixTimesMatrix 1806 1807 + Store 1805(r16) 1808 + Return + FunctionEnd + 135(@main():133(PS_OUTPUT) Function None 134 + 136: Label + 1810(ps_output): 1809(ptr) Variable Function + 1812: 51(ptr) AccessChain 1810(ps_output) 187 + Store 1812 1811 + 1813:133(PS_OUTPUT) Load 1810(ps_output) + ReturnValue 1813 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.lit.frag.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.lit.frag.out new file mode 100644 index 00000000..8b1454b8 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.lit.frag.out @@ -0,0 +1,204 @@ +hlsl.intrinsics.lit.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(f1;f1;f1; ( temp void) +0:2 Function Parameters: +0:2 'n_dot_l' ( in float) +0:2 'n_dot_h' ( in float) +0:2 'm' ( in float) +0:? Sequence +0:3 Sequence +0:3 move second child to first child ( temp 4-component vector of float) +0:3 'r0' ( temp 4-component vector of float) +0:3 Construct vec4 ( temp 4-component vector of float) +0:3 Constant: +0:3 1.000000 +0:3 max ( temp float) +0:3 'n_dot_l' ( in float) +0:3 Constant: +0:3 0.000000 +0:3 Test condition and select ( temp float): no shortcircuit +0:3 Condition +0:3 Compare Less Than ( temp bool) +0:3 min ( temp float) +0:3 'n_dot_l' ( in float) +0:3 'n_dot_h' ( in float) +0:3 Constant: +0:3 0.000000 +0:3 true case +0:3 Constant: +0:3 0.000000 +0:3 false case +0:3 component-wise multiply ( temp float) +0:3 'n_dot_h' ( in float) +0:3 'm' ( in float) +0:3 Constant: +0:3 1.000000 +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp float) +0:? 'n_dot_l' ( temp float) +0:? 'n_dot_l' (layout( location=0) in float) +0:2 move second child to first child ( temp float) +0:? 'n_dot_h' ( temp float) +0:? 'n_dot_h' (layout( location=1) in float) +0:2 move second child to first child ( temp float) +0:? 'm' ( temp float) +0:? 'm' (layout( location=2) in float) +0:2 Function Call: @PixelShaderFunction(f1;f1;f1; ( temp void) +0:? 'n_dot_l' ( temp float) +0:? 'n_dot_h' ( temp float) +0:? 'm' ( temp float) +0:? Linker Objects +0:? 'n_dot_l' (layout( location=0) in float) +0:? 'n_dot_h' (layout( location=1) in float) +0:? 'm' (layout( location=2) in float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(f1;f1;f1; ( temp void) +0:2 Function Parameters: +0:2 'n_dot_l' ( in float) +0:2 'n_dot_h' ( in float) +0:2 'm' ( in float) +0:? Sequence +0:3 Sequence +0:3 move second child to first child ( temp 4-component vector of float) +0:3 'r0' ( temp 4-component vector of float) +0:3 Construct vec4 ( temp 4-component vector of float) +0:3 Constant: +0:3 1.000000 +0:3 max ( temp float) +0:3 'n_dot_l' ( in float) +0:3 Constant: +0:3 0.000000 +0:3 Test condition and select ( temp float): no shortcircuit +0:3 Condition +0:3 Compare Less Than ( temp bool) +0:3 min ( temp float) +0:3 'n_dot_l' ( in float) +0:3 'n_dot_h' ( in float) +0:3 Constant: +0:3 0.000000 +0:3 true case +0:3 Constant: +0:3 0.000000 +0:3 false case +0:3 component-wise multiply ( temp float) +0:3 'n_dot_h' ( in float) +0:3 'm' ( in float) +0:3 Constant: +0:3 1.000000 +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp float) +0:? 'n_dot_l' ( temp float) +0:? 'n_dot_l' (layout( location=0) in float) +0:2 move second child to first child ( temp float) +0:? 'n_dot_h' ( temp float) +0:? 'n_dot_h' (layout( location=1) in float) +0:2 move second child to first child ( temp float) +0:? 'm' ( temp float) +0:? 'm' (layout( location=2) in float) +0:2 Function Call: @PixelShaderFunction(f1;f1;f1; ( temp void) +0:? 'n_dot_l' ( temp float) +0:? 'n_dot_h' ( temp float) +0:? 'm' ( temp float) +0:? Linker Objects +0:? 'n_dot_l' (layout( location=0) in float) +0:? 'n_dot_h' (layout( location=1) in float) +0:? 'm' (layout( location=2) in float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 48 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 33 36 39 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 12 "@PixelShaderFunction(f1;f1;f1;" + Name 9 "n_dot_l" + Name 10 "n_dot_h" + Name 11 "m" + Name 16 "r0" + Name 31 "n_dot_l" + Name 33 "n_dot_l" + Name 35 "n_dot_h" + Name 36 "n_dot_h" + Name 38 "m" + Name 39 "m" + Name 41 "param" + Name 43 "param" + Name 45 "param" + Decorate 33(n_dot_l) Location 0 + Decorate 36(n_dot_h) Location 1 + Decorate 39(m) Location 2 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeFunction 2 7(ptr) 7(ptr) 7(ptr) + 14: TypeVector 6(float) 4 + 15: TypePointer Function 14(fvec4) + 17: 6(float) Constant 1065353216 + 19: 6(float) Constant 0 + 24: TypeBool + 32: TypePointer Input 6(float) + 33(n_dot_l): 32(ptr) Variable Input + 36(n_dot_h): 32(ptr) Variable Input + 39(m): 32(ptr) Variable Input +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 31(n_dot_l): 7(ptr) Variable Function + 35(n_dot_h): 7(ptr) Variable Function + 38(m): 7(ptr) Variable Function + 41(param): 7(ptr) Variable Function + 43(param): 7(ptr) Variable Function + 45(param): 7(ptr) Variable Function + 34: 6(float) Load 33(n_dot_l) + Store 31(n_dot_l) 34 + 37: 6(float) Load 36(n_dot_h) + Store 35(n_dot_h) 37 + 40: 6(float) Load 39(m) + Store 38(m) 40 + 42: 6(float) Load 31(n_dot_l) + Store 41(param) 42 + 44: 6(float) Load 35(n_dot_h) + Store 43(param) 44 + 46: 6(float) Load 38(m) + Store 45(param) 46 + 47: 2 FunctionCall 12(@PixelShaderFunction(f1;f1;f1;) 41(param) 43(param) 45(param) + Return + FunctionEnd +12(@PixelShaderFunction(f1;f1;f1;): 2 Function None 8 + 9(n_dot_l): 7(ptr) FunctionParameter + 10(n_dot_h): 7(ptr) FunctionParameter + 11(m): 7(ptr) FunctionParameter + 13: Label + 16(r0): 15(ptr) Variable Function + 18: 6(float) Load 9(n_dot_l) + 20: 6(float) ExtInst 1(GLSL.std.450) 40(FMax) 18 19 + 21: 6(float) Load 9(n_dot_l) + 22: 6(float) Load 10(n_dot_h) + 23: 6(float) ExtInst 1(GLSL.std.450) 37(FMin) 21 22 + 25: 24(bool) FOrdLessThan 23 19 + 26: 6(float) Load 10(n_dot_h) + 27: 6(float) Load 11(m) + 28: 6(float) FMul 26 27 + 29: 6(float) Select 25 19 28 + 30: 14(fvec4) CompositeConstruct 17 20 29 17 + Store 16(r0) 30 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.negative.comp.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.negative.comp.out new file mode 100644 index 00000000..97d67198 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.negative.comp.out @@ -0,0 +1,343 @@ +hlsl.intrinsics.negative.comp +Shader version: 500 +local_size = (1, 1, 1) +0:? Sequence +0:2 Function Definition: ComputeShaderFunctionS(f1;f1;f1;i1; ( temp float) +0:2 Function Parameters: +0:2 'inF0' ( in float) +0:2 'inF1' ( in float) +0:2 'inF2' ( in float) +0:2 'inI0' ( in int) +0:? Sequence +0:53 Branch: Return with expression +0:53 Constant: +0:53 0.000000 +0:57 Function Definition: ComputeShaderFunction1(vf1;vf1;vf1;vi1; ( temp 1-component vector of float) +0:57 Function Parameters: +0:57 'inF0' ( in 1-component vector of float) +0:57 'inF1' ( in 1-component vector of float) +0:57 'inF2' ( in 1-component vector of float) +0:57 'inI0' ( in 1-component vector of int) +0:? Sequence +0:62 Branch: Return with expression +0:62 Constant: +0:62 0.000000 +0:66 Function Definition: ComputeShaderFunction2(vf2;vf2;vf2;vi2; ( temp 2-component vector of float) +0:66 Function Parameters: +0:66 'inF0' ( in 2-component vector of float) +0:66 'inF1' ( in 2-component vector of float) +0:66 'inF2' ( in 2-component vector of float) +0:66 'inI0' ( in 2-component vector of int) +0:? Sequence +0:109 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:113 Function Definition: ComputeShaderFunction3(vf3;vf3;vf3;vi3; ( temp 3-component vector of float) +0:113 Function Parameters: +0:113 'inF0' ( in 3-component vector of float) +0:113 'inF1' ( in 3-component vector of float) +0:113 'inF2' ( in 3-component vector of float) +0:113 'inI0' ( in 3-component vector of int) +0:? Sequence +0:154 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:158 Function Definition: @ComputeShaderFunction(vf4;vf4;vf4;vi4; ( temp 4-component vector of float) +0:158 Function Parameters: +0:158 'inF0' ( in 4-component vector of float) +0:158 'inF1' ( in 4-component vector of float) +0:158 'inF2' ( in 4-component vector of float) +0:158 'inI0' ( in 4-component vector of int) +0:? Sequence +0:199 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:158 Function Definition: ComputeShaderFunction( ( temp void) +0:158 Function Parameters: +0:? Sequence +0:158 move second child to first child ( temp 4-component vector of float) +0:? 'inF0' ( temp 4-component vector of float) +0:? 'inF0' (layout( location=0) in 4-component vector of float) +0:158 move second child to first child ( temp 4-component vector of float) +0:? 'inF1' ( temp 4-component vector of float) +0:? 'inF1' (layout( location=1) in 4-component vector of float) +0:158 move second child to first child ( temp 4-component vector of float) +0:? 'inF2' ( temp 4-component vector of float) +0:? 'inF2' (layout( location=2) in 4-component vector of float) +0:158 move second child to first child ( temp 4-component vector of int) +0:? 'inI0' ( temp 4-component vector of int) +0:? 'inI0' (layout( location=3) in 4-component vector of int) +0:158 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:158 Function Call: @ComputeShaderFunction(vf4;vf4;vf4;vi4; ( temp 4-component vector of float) +0:? 'inF0' ( temp 4-component vector of float) +0:? 'inF1' ( temp 4-component vector of float) +0:? 'inF2' ( temp 4-component vector of float) +0:? 'inI0' ( temp 4-component vector of int) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'inF0' (layout( location=0) in 4-component vector of float) +0:? 'inF1' (layout( location=1) in 4-component vector of float) +0:? 'inF2' (layout( location=2) in 4-component vector of float) +0:? 'inI0' (layout( location=3) in 4-component vector of int) + + +Linked compute stage: + + +Shader version: 500 +local_size = (1, 1, 1) +0:? Sequence +0:2 Function Definition: ComputeShaderFunctionS(f1;f1;f1;i1; ( temp float) +0:2 Function Parameters: +0:2 'inF0' ( in float) +0:2 'inF1' ( in float) +0:2 'inF2' ( in float) +0:2 'inI0' ( in int) +0:? Sequence +0:53 Branch: Return with expression +0:53 Constant: +0:53 0.000000 +0:57 Function Definition: ComputeShaderFunction1(vf1;vf1;vf1;vi1; ( temp 1-component vector of float) +0:57 Function Parameters: +0:57 'inF0' ( in 1-component vector of float) +0:57 'inF1' ( in 1-component vector of float) +0:57 'inF2' ( in 1-component vector of float) +0:57 'inI0' ( in 1-component vector of int) +0:? Sequence +0:62 Branch: Return with expression +0:62 Constant: +0:62 0.000000 +0:66 Function Definition: ComputeShaderFunction2(vf2;vf2;vf2;vi2; ( temp 2-component vector of float) +0:66 Function Parameters: +0:66 'inF0' ( in 2-component vector of float) +0:66 'inF1' ( in 2-component vector of float) +0:66 'inF2' ( in 2-component vector of float) +0:66 'inI0' ( in 2-component vector of int) +0:? Sequence +0:109 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:113 Function Definition: ComputeShaderFunction3(vf3;vf3;vf3;vi3; ( temp 3-component vector of float) +0:113 Function Parameters: +0:113 'inF0' ( in 3-component vector of float) +0:113 'inF1' ( in 3-component vector of float) +0:113 'inF2' ( in 3-component vector of float) +0:113 'inI0' ( in 3-component vector of int) +0:? Sequence +0:154 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:158 Function Definition: @ComputeShaderFunction(vf4;vf4;vf4;vi4; ( temp 4-component vector of float) +0:158 Function Parameters: +0:158 'inF0' ( in 4-component vector of float) +0:158 'inF1' ( in 4-component vector of float) +0:158 'inF2' ( in 4-component vector of float) +0:158 'inI0' ( in 4-component vector of int) +0:? Sequence +0:199 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:158 Function Definition: ComputeShaderFunction( ( temp void) +0:158 Function Parameters: +0:? Sequence +0:158 move second child to first child ( temp 4-component vector of float) +0:? 'inF0' ( temp 4-component vector of float) +0:? 'inF0' (layout( location=0) in 4-component vector of float) +0:158 move second child to first child ( temp 4-component vector of float) +0:? 'inF1' ( temp 4-component vector of float) +0:? 'inF1' (layout( location=1) in 4-component vector of float) +0:158 move second child to first child ( temp 4-component vector of float) +0:? 'inF2' ( temp 4-component vector of float) +0:? 'inF2' (layout( location=2) in 4-component vector of float) +0:158 move second child to first child ( temp 4-component vector of int) +0:? 'inI0' ( temp 4-component vector of int) +0:? 'inI0' (layout( location=3) in 4-component vector of int) +0:158 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:158 Function Call: @ComputeShaderFunction(vf4;vf4;vf4;vi4; ( temp 4-component vector of float) +0:? 'inF0' ( temp 4-component vector of float) +0:? 'inF1' ( temp 4-component vector of float) +0:? 'inF2' ( temp 4-component vector of float) +0:? 'inI0' ( temp 4-component vector of int) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'inF0' (layout( location=0) in 4-component vector of float) +0:? 'inF1' (layout( location=1) in 4-component vector of float) +0:? 'inF2' (layout( location=2) in 4-component vector of float) +0:? 'inI0' (layout( location=3) in 4-component vector of int) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 99 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "ComputeShaderFunction" 76 79 82 86 89 + ExecutionMode 4 LocalSize 1 1 1 + Source HLSL 500 + Name 4 "ComputeShaderFunction" + Name 15 "ComputeShaderFunctionS(f1;f1;f1;i1;" + Name 11 "inF0" + Name 12 "inF1" + Name 13 "inF2" + Name 14 "inI0" + Name 21 "ComputeShaderFunction1(vf1;vf1;vf1;vi1;" + Name 17 "inF0" + Name 18 "inF1" + Name 19 "inF2" + Name 20 "inI0" + Name 32 "ComputeShaderFunction2(vf2;vf2;vf2;vi2;" + Name 28 "inF0" + Name 29 "inF1" + Name 30 "inF2" + Name 31 "inI0" + Name 43 "ComputeShaderFunction3(vf3;vf3;vf3;vi3;" + Name 39 "inF0" + Name 40 "inF1" + Name 41 "inF2" + Name 42 "inI0" + Name 54 "@ComputeShaderFunction(vf4;vf4;vf4;vi4;" + Name 50 "inF0" + Name 51 "inF1" + Name 52 "inF2" + Name 53 "inI0" + Name 74 "inF0" + Name 76 "inF0" + Name 78 "inF1" + Name 79 "inF1" + Name 81 "inF2" + Name 82 "inF2" + Name 84 "inI0" + Name 86 "inI0" + Name 89 "@entryPointOutput" + Name 90 "param" + Name 92 "param" + Name 94 "param" + Name 96 "param" + Decorate 76(inF0) Location 0 + Decorate 79(inF1) Location 1 + Decorate 82(inF2) Location 2 + Decorate 86(inI0) Location 3 + Decorate 89(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeInt 32 1 + 9: TypePointer Function 8(int) + 10: TypeFunction 6(float) 7(ptr) 7(ptr) 7(ptr) 9(ptr) + 23: TypeVector 6(float) 2 + 24: TypePointer Function 23(fvec2) + 25: TypeVector 8(int) 2 + 26: TypePointer Function 25(ivec2) + 27: TypeFunction 23(fvec2) 24(ptr) 24(ptr) 24(ptr) 26(ptr) + 34: TypeVector 6(float) 3 + 35: TypePointer Function 34(fvec3) + 36: TypeVector 8(int) 3 + 37: TypePointer Function 36(ivec3) + 38: TypeFunction 34(fvec3) 35(ptr) 35(ptr) 35(ptr) 37(ptr) + 45: TypeVector 6(float) 4 + 46: TypePointer Function 45(fvec4) + 47: TypeVector 8(int) 4 + 48: TypePointer Function 47(ivec4) + 49: TypeFunction 45(fvec4) 46(ptr) 46(ptr) 46(ptr) 48(ptr) + 56: 6(float) Constant 0 + 61: 6(float) Constant 1065353216 + 62: 6(float) Constant 1073741824 + 63: 23(fvec2) ConstantComposite 61 62 + 66: 6(float) Constant 1077936128 + 67: 34(fvec3) ConstantComposite 61 62 66 + 70: 6(float) Constant 1082130432 + 71: 45(fvec4) ConstantComposite 61 62 66 70 + 75: TypePointer Input 45(fvec4) + 76(inF0): 75(ptr) Variable Input + 79(inF1): 75(ptr) Variable Input + 82(inF2): 75(ptr) Variable Input + 85: TypePointer Input 47(ivec4) + 86(inI0): 85(ptr) Variable Input + 88: TypePointer Output 45(fvec4) +89(@entryPointOutput): 88(ptr) Variable Output +4(ComputeShaderFunction): 2 Function None 3 + 5: Label + 74(inF0): 46(ptr) Variable Function + 78(inF1): 46(ptr) Variable Function + 81(inF2): 46(ptr) Variable Function + 84(inI0): 48(ptr) Variable Function + 90(param): 46(ptr) Variable Function + 92(param): 46(ptr) Variable Function + 94(param): 46(ptr) Variable Function + 96(param): 48(ptr) Variable Function + 77: 45(fvec4) Load 76(inF0) + Store 74(inF0) 77 + 80: 45(fvec4) Load 79(inF1) + Store 78(inF1) 80 + 83: 45(fvec4) Load 82(inF2) + Store 81(inF2) 83 + 87: 47(ivec4) Load 86(inI0) + Store 84(inI0) 87 + 91: 45(fvec4) Load 74(inF0) + Store 90(param) 91 + 93: 45(fvec4) Load 78(inF1) + Store 92(param) 93 + 95: 45(fvec4) Load 81(inF2) + Store 94(param) 95 + 97: 47(ivec4) Load 84(inI0) + Store 96(param) 97 + 98: 45(fvec4) FunctionCall 54(@ComputeShaderFunction(vf4;vf4;vf4;vi4;) 90(param) 92(param) 94(param) 96(param) + Store 89(@entryPointOutput) 98 + Return + FunctionEnd +15(ComputeShaderFunctionS(f1;f1;f1;i1;): 6(float) Function None 10 + 11(inF0): 7(ptr) FunctionParameter + 12(inF1): 7(ptr) FunctionParameter + 13(inF2): 7(ptr) FunctionParameter + 14(inI0): 9(ptr) FunctionParameter + 16: Label + ReturnValue 56 + FunctionEnd +21(ComputeShaderFunction1(vf1;vf1;vf1;vi1;): 6(float) Function None 10 + 17(inF0): 7(ptr) FunctionParameter + 18(inF1): 7(ptr) FunctionParameter + 19(inF2): 7(ptr) FunctionParameter + 20(inI0): 9(ptr) FunctionParameter + 22: Label + ReturnValue 56 + FunctionEnd +32(ComputeShaderFunction2(vf2;vf2;vf2;vi2;): 23(fvec2) Function None 27 + 28(inF0): 24(ptr) FunctionParameter + 29(inF1): 24(ptr) FunctionParameter + 30(inF2): 24(ptr) FunctionParameter + 31(inI0): 26(ptr) FunctionParameter + 33: Label + ReturnValue 63 + FunctionEnd +43(ComputeShaderFunction3(vf3;vf3;vf3;vi3;): 34(fvec3) Function None 38 + 39(inF0): 35(ptr) FunctionParameter + 40(inF1): 35(ptr) FunctionParameter + 41(inF2): 35(ptr) FunctionParameter + 42(inI0): 37(ptr) FunctionParameter + 44: Label + ReturnValue 67 + FunctionEnd +54(@ComputeShaderFunction(vf4;vf4;vf4;vi4;): 45(fvec4) Function None 49 + 50(inF0): 46(ptr) FunctionParameter + 51(inF1): 46(ptr) FunctionParameter + 52(inF2): 46(ptr) FunctionParameter + 53(inI0): 48(ptr) FunctionParameter + 55: Label + ReturnValue 71 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.negative.frag.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.negative.frag.out new file mode 100644 index 00000000..980cc96d --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.negative.frag.out @@ -0,0 +1,986 @@ +hlsl.intrinsics.negative.frag +ERROR: 0:10: 'determinant' : ambiguous best function under implicit type conversion +ERROR: 0:25: 'normalize' : ambiguous best function under implicit type conversion +ERROR: 0:26: 'reflect' : ambiguous best function under implicit type conversion +ERROR: 0:27: 'refract' : ambiguous best function under implicit type conversion +ERROR: 0:28: 'refract' : no matching overloaded function found +ERROR: 0:30: 'transpose' : ambiguous best function under implicit type conversion +ERROR: 0:39: 'GetRenderTargetSamplePosition' : no matching overloaded function found +ERROR: 0:46: 'asdouble' : double2 conversion not implemented +ERROR: 0:47: 'CheckAccessFullyMapped' : no matching overloaded function found +ERROR: 0:49: 'cross' : no matching overloaded function found +ERROR: 0:50: 'D3DCOLORtoUBYTE4' : no matching overloaded function found +ERROR: 0:51: 'determinant' : no matching overloaded function found +ERROR: 0:57: 'transpose' : no matching overloaded function found +ERROR: 0:64: 'CheckAccessFullyMapped' : no matching overloaded function found +ERROR: 0:66: 'D3DCOLORtoUBYTE4' : no matching overloaded function found +ERROR: 0:67: 'determinant' : no matching overloaded function found +ERROR: 0:73: 'transpose' : no matching overloaded function found +ERROR: 0:81: 'CheckAccessFullyMapped' : no matching overloaded function found +ERROR: 0:84: 'determinant' : no matching overloaded function found +ERROR: 0:90: 'transpose' : no matching overloaded function found +ERROR: 0:117: 'countbits' : no matching overloaded function found +ERROR: 0:117: 'D3DCOLORtoUBYTE4' : no matching overloaded function found +ERROR: 0:117: 'cross' : no matching overloaded function found +ERROR: 0:117: 'f16tof32' : no matching overloaded function found +ERROR: 0:117: 'firstbithigh' : no matching overloaded function found +ERROR: 0:117: 'firstbitlow' : no matching overloaded function found +ERROR: 0:117: 'reversebits' : no matching overloaded function found +ERROR: 0:117: 'length' : no matching overloaded function found +ERROR: 0:117: 'noise' : no matching overloaded function found +ERROR: 0:117: 'normalize' : no matching overloaded function found +ERROR: 0:117: 'reflect' : no matching overloaded function found +ERROR: 0:117: 'refract' : no matching overloaded function found +ERROR: 0:117: 'reversebits' : no matching overloaded function found +ERROR: 0:125: 'countbits' : no matching overloaded function found +ERROR: 0:125: 'D3DCOLORtoUBYTE4' : no matching overloaded function found +ERROR: 0:125: 'cross' : no matching overloaded function found +ERROR: 0:125: 'f16tof32' : no matching overloaded function found +ERROR: 0:125: 'firstbithigh' : no matching overloaded function found +ERROR: 0:125: 'firstbitlow' : no matching overloaded function found +ERROR: 0:125: 'reversebits' : no matching overloaded function found +ERROR: 0:125: 'length' : no matching overloaded function found +ERROR: 0:125: 'noise' : no matching overloaded function found +ERROR: 0:125: 'normalize' : no matching overloaded function found +ERROR: 0:125: 'reflect' : no matching overloaded function found +ERROR: 0:125: 'refract' : no matching overloaded function found +ERROR: 0:125: 'reversebits' : no matching overloaded function found +ERROR: 0:133: 'countbits' : no matching overloaded function found +ERROR: 0:133: 'D3DCOLORtoUBYTE4' : no matching overloaded function found +ERROR: 0:133: 'cross' : no matching overloaded function found +ERROR: 0:133: 'f16tof32' : no matching overloaded function found +ERROR: 0:133: 'firstbithigh' : no matching overloaded function found +ERROR: 0:133: 'firstbitlow' : no matching overloaded function found +ERROR: 0:133: 'reversebits' : no matching overloaded function found +ERROR: 0:133: 'length' : no matching overloaded function found +ERROR: 0:133: 'noise' : no matching overloaded function found +ERROR: 0:133: 'normalize' : no matching overloaded function found +ERROR: 0:133: 'reflect' : no matching overloaded function found +ERROR: 0:133: 'refract' : no matching overloaded function found +ERROR: 0:133: 'reversebits' : no matching overloaded function found +ERROR: 59 compilation errors. No code generated. + + +Shader version: 500 +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:2 Function Definition: PixelShaderFunctionS(f1;f1;f1;i1; ( temp float) +0:2 Function Parameters: +0:2 'inF0' ( in float) +0:2 'inF1' ( in float) +0:2 'inF2' ( in float) +0:2 'inI0' ( in int) +0:? Sequence +0:5 uint64BitsToDouble ( temp double) +0:5 Construct uvec2 ( temp 2-component vector of uint) +0:5 Convert float to uint ( temp uint) +0:5 'inF0' ( in float) +0:5 Convert float to uint ( temp uint) +0:5 'inF1' ( in float) +0:6 Function Call: CheckAccessFullyMapped(u1; ( temp bool) +0:6 Constant: +0:6 3 (const uint) +0:7 bitCount ( temp uint) +0:7 Convert float to uint ( temp uint) +0:7 'inF0' ( in float) +0:8 cross-product ( temp 3-component vector of float) +0:8 Construct vec3 ( in 3-component vector of float) +0:8 'inF0' ( in float) +0:8 Construct vec3 ( in 3-component vector of float) +0:8 'inF1' ( in float) +0:9 Convert float to int ( temp 4-component vector of int) +0:9 vector-scale ( temp 4-component vector of float) +0:9 Constant: +0:9 255.001953 +0:9 vector swizzle ( temp 4-component vector of float) +0:9 Construct vec4 ( in 4-component vector of float) +0:9 'inF0' ( in float) +0:9 Sequence +0:9 Constant: +0:9 2 (const int) +0:9 Constant: +0:9 1 (const int) +0:9 Constant: +0:9 0 (const int) +0:9 Constant: +0:9 3 (const int) +0:10 determinant ( temp float) +ERROR: node is still EOpNull! +0:10 'inF0' ( in float) +0:12 direct index ( temp float) +0:12 unpackHalf2x16 ( temp 2-component vector of float) +0:12 Convert float to uint ( temp uint) +0:12 'inF0' ( in float) +0:12 Constant: +0:12 0 (const int) +0:13 findMSB ( temp uint) +0:13 Convert float to uint ( temp uint) +0:13 'inF0' ( in float) +0:14 findLSB ( temp uint) +0:14 Convert float to uint ( temp uint) +0:14 'inF0' ( in float) +0:23 length ( temp float) +0:23 'inF0' ( in float) +0:24 Function Call: msad4(u1;vu2;vu4; ( temp 4-component vector of uint) +0:24 Convert float to uint ( temp uint) +0:24 'inF0' ( in float) +0:24 Constant: +0:24 0 (const uint) +0:24 0 (const uint) +0:24 Constant: +0:24 0 (const uint) +0:24 0 (const uint) +0:24 0 (const uint) +0:24 0 (const uint) +0:25 normalize ( temp 2-component vector of float) +0:25 Construct vec2 ( in 2-component vector of float) +0:25 'inF0' ( in float) +0:26 reflect ( temp 2-component vector of float) +0:26 Construct vec2 ( in 2-component vector of float) +0:26 'inF0' ( in float) +0:26 Construct vec2 ( in 2-component vector of float) +0:26 'inF1' ( in float) +0:27 refract ( temp 2-component vector of float) +0:27 Construct vec2 ( in 2-component vector of float) +0:27 'inF0' ( in float) +0:27 Construct vec2 ( in 2-component vector of float) +0:27 'inF1' ( in float) +0:27 'inF2' ( in float) +0:28 Constant: +0:28 0.000000 +0:29 bitFieldReverse ( temp uint) +0:29 Convert float to uint ( temp uint) +0:29 'inF0' ( in float) +0:30 transpose ( temp 1X1 matrix of float) +ERROR: node is still EOpNull! +0:30 'inF0' ( in float) +0:32 Branch: Return with expression +0:32 Constant: +0:32 0.000000 +0:36 Function Definition: PixelShaderFunction1(vf1;vf1;vf1;vi1; ( temp 1-component vector of float) +0:36 Function Parameters: +0:36 'inF0' ( in 1-component vector of float) +0:36 'inF1' ( in 1-component vector of float) +0:36 'inF2' ( in 1-component vector of float) +0:36 'inI0' ( in 1-component vector of int) +0:? Sequence +0:39 Constant: +0:39 0.000000 +0:41 Branch: Return with expression +0:41 Constant: +0:41 0.000000 +0:45 Function Definition: PixelShaderFunction2(vf2;vf2;vf2;vi2; ( temp 2-component vector of float) +0:45 Function Parameters: +0:45 'inF0' ( in 2-component vector of float) +0:45 'inF1' ( in 2-component vector of float) +0:45 'inF2' ( in 2-component vector of float) +0:45 'inI0' ( in 2-component vector of int) +0:? Sequence +0:46 ERROR: Bad aggregation op + ( temp 2-component vector of double) +0:46 Convert float to uint ( temp 2-component vector of uint) +0:46 'inF0' ( in 2-component vector of float) +0:46 Convert float to uint ( temp 2-component vector of uint) +0:46 'inF1' ( in 2-component vector of float) +0:47 Constant: +0:47 0.000000 +0:48 bitCount ( temp 2-component vector of uint) +0:48 Convert float to uint ( temp 2-component vector of uint) +0:48 'inF0' ( in 2-component vector of float) +0:49 Constant: +0:49 0.000000 +0:50 Constant: +0:50 0.000000 +0:51 Constant: +0:51 0.000000 +0:52 Construct vec2 ( temp 2-component vector of float) +0:52 direct index ( temp float) +0:52 unpackHalf2x16 ( temp 2-component vector of float) +0:52 direct index ( temp uint) +0:52 Convert float to uint ( temp 2-component vector of uint) +0:52 'inF0' ( in 2-component vector of float) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 0 (const int) +0:52 direct index ( temp float) +0:52 unpackHalf2x16 ( temp 2-component vector of float) +0:52 direct index ( temp uint) +0:52 Convert float to uint ( temp 2-component vector of uint) +0:52 'inF0' ( in 2-component vector of float) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 0 (const int) +0:53 findMSB ( temp 2-component vector of uint) +0:53 Convert float to uint ( temp 2-component vector of uint) +0:53 'inF0' ( in 2-component vector of float) +0:54 findLSB ( temp 2-component vector of uint) +0:54 Convert float to uint ( temp 2-component vector of uint) +0:54 'inF0' ( in 2-component vector of float) +0:56 bitFieldReverse ( temp 2-component vector of uint) +0:56 Convert float to uint ( temp 2-component vector of uint) +0:56 'inF0' ( in 2-component vector of float) +0:57 Constant: +0:57 0.000000 +0:59 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:63 Function Definition: PixelShaderFunction3(vf3;vf3;vf3;vi3; ( temp 3-component vector of float) +0:63 Function Parameters: +0:63 'inF0' ( in 3-component vector of float) +0:63 'inF1' ( in 3-component vector of float) +0:63 'inF2' ( in 3-component vector of float) +0:63 'inI0' ( in 3-component vector of int) +0:? Sequence +0:64 Constant: +0:64 0.000000 +0:65 bitCount ( temp 3-component vector of uint) +0:65 Convert float to uint ( temp 3-component vector of uint) +0:65 'inF0' ( in 3-component vector of float) +0:66 Constant: +0:66 0.000000 +0:67 Constant: +0:67 0.000000 +0:68 Construct vec3 ( temp 3-component vector of float) +0:68 direct index ( temp float) +0:68 unpackHalf2x16 ( temp 2-component vector of float) +0:68 direct index ( temp uint) +0:68 Convert float to uint ( temp 3-component vector of uint) +0:68 'inF0' ( in 3-component vector of float) +0:68 Constant: +0:68 0 (const int) +0:68 Constant: +0:68 0 (const int) +0:68 direct index ( temp float) +0:68 unpackHalf2x16 ( temp 2-component vector of float) +0:68 direct index ( temp uint) +0:68 Convert float to uint ( temp 3-component vector of uint) +0:68 'inF0' ( in 3-component vector of float) +0:68 Constant: +0:68 1 (const int) +0:68 Constant: +0:68 0 (const int) +0:68 direct index ( temp float) +0:68 unpackHalf2x16 ( temp 2-component vector of float) +0:68 direct index ( temp uint) +0:68 Convert float to uint ( temp 3-component vector of uint) +0:68 'inF0' ( in 3-component vector of float) +0:68 Constant: +0:68 2 (const int) +0:68 Constant: +0:68 0 (const int) +0:69 findMSB ( temp 3-component vector of uint) +0:69 Convert float to uint ( temp 3-component vector of uint) +0:69 'inF0' ( in 3-component vector of float) +0:70 findLSB ( temp 3-component vector of uint) +0:70 Convert float to uint ( temp 3-component vector of uint) +0:70 'inF0' ( in 3-component vector of float) +0:72 bitFieldReverse ( temp 3-component vector of uint) +0:72 Convert float to uint ( temp 3-component vector of uint) +0:72 'inF0' ( in 3-component vector of float) +0:73 Constant: +0:73 0.000000 +0:76 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:80 Function Definition: @PixelShaderFunction(vf4;vf4;vf4;vi4; ( temp 4-component vector of float) +0:80 Function Parameters: +0:80 'inF0' ( in 4-component vector of float) +0:80 'inF1' ( in 4-component vector of float) +0:80 'inF2' ( in 4-component vector of float) +0:80 'inI0' ( in 4-component vector of int) +0:? Sequence +0:81 Constant: +0:81 0.000000 +0:82 bitCount ( temp 4-component vector of uint) +0:82 Convert float to uint ( temp 4-component vector of uint) +0:82 'inF0' ( in 4-component vector of float) +0:83 cross-product ( temp 3-component vector of float) +0:83 Construct vec3 ( in 3-component vector of float) +0:83 'inF0' ( in 4-component vector of float) +0:83 Construct vec3 ( in 3-component vector of float) +0:83 'inF1' ( in 4-component vector of float) +0:84 Constant: +0:84 0.000000 +0:85 Construct vec4 ( temp 4-component vector of float) +0:85 direct index ( temp float) +0:85 unpackHalf2x16 ( temp 2-component vector of float) +0:85 direct index ( temp uint) +0:85 Convert float to uint ( temp 4-component vector of uint) +0:85 'inF0' ( in 4-component vector of float) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 0 (const int) +0:85 direct index ( temp float) +0:85 unpackHalf2x16 ( temp 2-component vector of float) +0:85 direct index ( temp uint) +0:85 Convert float to uint ( temp 4-component vector of uint) +0:85 'inF0' ( in 4-component vector of float) +0:85 Constant: +0:85 1 (const int) +0:85 Constant: +0:85 0 (const int) +0:85 direct index ( temp float) +0:85 unpackHalf2x16 ( temp 2-component vector of float) +0:85 direct index ( temp uint) +0:85 Convert float to uint ( temp 4-component vector of uint) +0:85 'inF0' ( in 4-component vector of float) +0:85 Constant: +0:85 2 (const int) +0:85 Constant: +0:85 0 (const int) +0:85 direct index ( temp float) +0:85 unpackHalf2x16 ( temp 2-component vector of float) +0:85 direct index ( temp uint) +0:85 Convert float to uint ( temp 4-component vector of uint) +0:85 'inF0' ( in 4-component vector of float) +0:85 Constant: +0:85 3 (const int) +0:85 Constant: +0:85 0 (const int) +0:86 findMSB ( temp 4-component vector of uint) +0:86 Convert float to uint ( temp 4-component vector of uint) +0:86 'inF0' ( in 4-component vector of float) +0:87 findLSB ( temp 4-component vector of uint) +0:87 Convert float to uint ( temp 4-component vector of uint) +0:87 'inF0' ( in 4-component vector of float) +0:89 bitFieldReverse ( temp 4-component vector of uint) +0:89 Convert float to uint ( temp 4-component vector of uint) +0:89 'inF0' ( in 4-component vector of float) +0:90 Constant: +0:90 0.000000 +0:92 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:80 Function Definition: PixelShaderFunction( ( temp void) +0:80 Function Parameters: +0:? Sequence +0:80 move second child to first child ( temp 4-component vector of float) +0:? 'inF0' ( temp 4-component vector of float) +0:? 'inF0' (layout( location=0) in 4-component vector of float) +0:80 move second child to first child ( temp 4-component vector of float) +0:? 'inF1' ( temp 4-component vector of float) +0:? 'inF1' (layout( location=1) in 4-component vector of float) +0:80 move second child to first child ( temp 4-component vector of float) +0:? 'inF2' ( temp 4-component vector of float) +0:? 'inF2' (layout( location=2) in 4-component vector of float) +0:80 move second child to first child ( temp 4-component vector of int) +0:? 'inI0' ( temp 4-component vector of int) +0:? 'inI0' (layout( location=3) flat in 4-component vector of int) +0:80 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:80 Function Call: @PixelShaderFunction(vf4;vf4;vf4;vi4; ( temp 4-component vector of float) +0:? 'inF0' ( temp 4-component vector of float) +0:? 'inF1' ( temp 4-component vector of float) +0:? 'inF2' ( temp 4-component vector of float) +0:? 'inI0' ( temp 4-component vector of int) +0:115 Function Definition: PixelShaderFunction2x2(mf22;mf22;mf22; ( temp 2X2 matrix of float) +0:115 Function Parameters: +0:115 'inF0' ( in 2X2 matrix of float) +0:115 'inF1' ( in 2X2 matrix of float) +0:115 'inF2' ( in 2X2 matrix of float) +0:? Sequence +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:119 Branch: Return with expression +0:? Constant: +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:123 Function Definition: PixelShaderFunction3x3(mf33;mf33;mf33; ( temp 3X3 matrix of float) +0:123 Function Parameters: +0:123 'inF0' ( in 3X3 matrix of float) +0:123 'inF1' ( in 3X3 matrix of float) +0:123 'inF2' ( in 3X3 matrix of float) +0:? Sequence +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:127 Branch: Return with expression +0:? Constant: +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:131 Function Definition: PixelShaderFunction4x4(mf44;mf44;mf44; ( temp 4X4 matrix of float) +0:131 Function Parameters: +0:131 'inF0' ( in 4X4 matrix of float) +0:131 'inF1' ( in 4X4 matrix of float) +0:131 'inF2' ( in 4X4 matrix of float) +0:? Sequence +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:135 Branch: Return with expression +0:? Constant: +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'inF0' (layout( location=0) in 4-component vector of float) +0:? 'inF1' (layout( location=1) in 4-component vector of float) +0:? 'inF2' (layout( location=2) in 4-component vector of float) +0:? 'inI0' (layout( location=3) flat in 4-component vector of int) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:2 Function Definition: PixelShaderFunctionS(f1;f1;f1;i1; ( temp float) +0:2 Function Parameters: +0:2 'inF0' ( in float) +0:2 'inF1' ( in float) +0:2 'inF2' ( in float) +0:2 'inI0' ( in int) +0:? Sequence +0:5 uint64BitsToDouble ( temp double) +0:5 Construct uvec2 ( temp 2-component vector of uint) +0:5 Convert float to uint ( temp uint) +0:5 'inF0' ( in float) +0:5 Convert float to uint ( temp uint) +0:5 'inF1' ( in float) +0:6 Function Call: CheckAccessFullyMapped(u1; ( temp bool) +0:6 Constant: +0:6 3 (const uint) +0:7 bitCount ( temp uint) +0:7 Convert float to uint ( temp uint) +0:7 'inF0' ( in float) +0:8 cross-product ( temp 3-component vector of float) +0:8 Construct vec3 ( in 3-component vector of float) +0:8 'inF0' ( in float) +0:8 Construct vec3 ( in 3-component vector of float) +0:8 'inF1' ( in float) +0:9 Convert float to int ( temp 4-component vector of int) +0:9 vector-scale ( temp 4-component vector of float) +0:9 Constant: +0:9 255.001953 +0:9 vector swizzle ( temp 4-component vector of float) +0:9 Construct vec4 ( in 4-component vector of float) +0:9 'inF0' ( in float) +0:9 Sequence +0:9 Constant: +0:9 2 (const int) +0:9 Constant: +0:9 1 (const int) +0:9 Constant: +0:9 0 (const int) +0:9 Constant: +0:9 3 (const int) +0:10 determinant ( temp float) +ERROR: node is still EOpNull! +0:10 'inF0' ( in float) +0:12 direct index ( temp float) +0:12 unpackHalf2x16 ( temp 2-component vector of float) +0:12 Convert float to uint ( temp uint) +0:12 'inF0' ( in float) +0:12 Constant: +0:12 0 (const int) +0:13 findMSB ( temp uint) +0:13 Convert float to uint ( temp uint) +0:13 'inF0' ( in float) +0:14 findLSB ( temp uint) +0:14 Convert float to uint ( temp uint) +0:14 'inF0' ( in float) +0:23 length ( temp float) +0:23 'inF0' ( in float) +0:24 Function Call: msad4(u1;vu2;vu4; ( temp 4-component vector of uint) +0:24 Convert float to uint ( temp uint) +0:24 'inF0' ( in float) +0:24 Constant: +0:24 0 (const uint) +0:24 0 (const uint) +0:24 Constant: +0:24 0 (const uint) +0:24 0 (const uint) +0:24 0 (const uint) +0:24 0 (const uint) +0:25 normalize ( temp 2-component vector of float) +0:25 Construct vec2 ( in 2-component vector of float) +0:25 'inF0' ( in float) +0:26 reflect ( temp 2-component vector of float) +0:26 Construct vec2 ( in 2-component vector of float) +0:26 'inF0' ( in float) +0:26 Construct vec2 ( in 2-component vector of float) +0:26 'inF1' ( in float) +0:27 refract ( temp 2-component vector of float) +0:27 Construct vec2 ( in 2-component vector of float) +0:27 'inF0' ( in float) +0:27 Construct vec2 ( in 2-component vector of float) +0:27 'inF1' ( in float) +0:27 'inF2' ( in float) +0:28 Constant: +0:28 0.000000 +0:29 bitFieldReverse ( temp uint) +0:29 Convert float to uint ( temp uint) +0:29 'inF0' ( in float) +0:30 transpose ( temp 1X1 matrix of float) +ERROR: node is still EOpNull! +0:30 'inF0' ( in float) +0:32 Branch: Return with expression +0:32 Constant: +0:32 0.000000 +0:36 Function Definition: PixelShaderFunction1(vf1;vf1;vf1;vi1; ( temp 1-component vector of float) +0:36 Function Parameters: +0:36 'inF0' ( in 1-component vector of float) +0:36 'inF1' ( in 1-component vector of float) +0:36 'inF2' ( in 1-component vector of float) +0:36 'inI0' ( in 1-component vector of int) +0:? Sequence +0:39 Constant: +0:39 0.000000 +0:41 Branch: Return with expression +0:41 Constant: +0:41 0.000000 +0:45 Function Definition: PixelShaderFunction2(vf2;vf2;vf2;vi2; ( temp 2-component vector of float) +0:45 Function Parameters: +0:45 'inF0' ( in 2-component vector of float) +0:45 'inF1' ( in 2-component vector of float) +0:45 'inF2' ( in 2-component vector of float) +0:45 'inI0' ( in 2-component vector of int) +0:? Sequence +0:46 ERROR: Bad aggregation op + ( temp 2-component vector of double) +0:46 Convert float to uint ( temp 2-component vector of uint) +0:46 'inF0' ( in 2-component vector of float) +0:46 Convert float to uint ( temp 2-component vector of uint) +0:46 'inF1' ( in 2-component vector of float) +0:47 Constant: +0:47 0.000000 +0:48 bitCount ( temp 2-component vector of uint) +0:48 Convert float to uint ( temp 2-component vector of uint) +0:48 'inF0' ( in 2-component vector of float) +0:49 Constant: +0:49 0.000000 +0:50 Constant: +0:50 0.000000 +0:51 Constant: +0:51 0.000000 +0:52 Construct vec2 ( temp 2-component vector of float) +0:52 direct index ( temp float) +0:52 unpackHalf2x16 ( temp 2-component vector of float) +0:52 direct index ( temp uint) +0:52 Convert float to uint ( temp 2-component vector of uint) +0:52 'inF0' ( in 2-component vector of float) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 0 (const int) +0:52 direct index ( temp float) +0:52 unpackHalf2x16 ( temp 2-component vector of float) +0:52 direct index ( temp uint) +0:52 Convert float to uint ( temp 2-component vector of uint) +0:52 'inF0' ( in 2-component vector of float) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 0 (const int) +0:53 findMSB ( temp 2-component vector of uint) +0:53 Convert float to uint ( temp 2-component vector of uint) +0:53 'inF0' ( in 2-component vector of float) +0:54 findLSB ( temp 2-component vector of uint) +0:54 Convert float to uint ( temp 2-component vector of uint) +0:54 'inF0' ( in 2-component vector of float) +0:56 bitFieldReverse ( temp 2-component vector of uint) +0:56 Convert float to uint ( temp 2-component vector of uint) +0:56 'inF0' ( in 2-component vector of float) +0:57 Constant: +0:57 0.000000 +0:59 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:63 Function Definition: PixelShaderFunction3(vf3;vf3;vf3;vi3; ( temp 3-component vector of float) +0:63 Function Parameters: +0:63 'inF0' ( in 3-component vector of float) +0:63 'inF1' ( in 3-component vector of float) +0:63 'inF2' ( in 3-component vector of float) +0:63 'inI0' ( in 3-component vector of int) +0:? Sequence +0:64 Constant: +0:64 0.000000 +0:65 bitCount ( temp 3-component vector of uint) +0:65 Convert float to uint ( temp 3-component vector of uint) +0:65 'inF0' ( in 3-component vector of float) +0:66 Constant: +0:66 0.000000 +0:67 Constant: +0:67 0.000000 +0:68 Construct vec3 ( temp 3-component vector of float) +0:68 direct index ( temp float) +0:68 unpackHalf2x16 ( temp 2-component vector of float) +0:68 direct index ( temp uint) +0:68 Convert float to uint ( temp 3-component vector of uint) +0:68 'inF0' ( in 3-component vector of float) +0:68 Constant: +0:68 0 (const int) +0:68 Constant: +0:68 0 (const int) +0:68 direct index ( temp float) +0:68 unpackHalf2x16 ( temp 2-component vector of float) +0:68 direct index ( temp uint) +0:68 Convert float to uint ( temp 3-component vector of uint) +0:68 'inF0' ( in 3-component vector of float) +0:68 Constant: +0:68 1 (const int) +0:68 Constant: +0:68 0 (const int) +0:68 direct index ( temp float) +0:68 unpackHalf2x16 ( temp 2-component vector of float) +0:68 direct index ( temp uint) +0:68 Convert float to uint ( temp 3-component vector of uint) +0:68 'inF0' ( in 3-component vector of float) +0:68 Constant: +0:68 2 (const int) +0:68 Constant: +0:68 0 (const int) +0:69 findMSB ( temp 3-component vector of uint) +0:69 Convert float to uint ( temp 3-component vector of uint) +0:69 'inF0' ( in 3-component vector of float) +0:70 findLSB ( temp 3-component vector of uint) +0:70 Convert float to uint ( temp 3-component vector of uint) +0:70 'inF0' ( in 3-component vector of float) +0:72 bitFieldReverse ( temp 3-component vector of uint) +0:72 Convert float to uint ( temp 3-component vector of uint) +0:72 'inF0' ( in 3-component vector of float) +0:73 Constant: +0:73 0.000000 +0:76 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:80 Function Definition: @PixelShaderFunction(vf4;vf4;vf4;vi4; ( temp 4-component vector of float) +0:80 Function Parameters: +0:80 'inF0' ( in 4-component vector of float) +0:80 'inF1' ( in 4-component vector of float) +0:80 'inF2' ( in 4-component vector of float) +0:80 'inI0' ( in 4-component vector of int) +0:? Sequence +0:81 Constant: +0:81 0.000000 +0:82 bitCount ( temp 4-component vector of uint) +0:82 Convert float to uint ( temp 4-component vector of uint) +0:82 'inF0' ( in 4-component vector of float) +0:83 cross-product ( temp 3-component vector of float) +0:83 Construct vec3 ( in 3-component vector of float) +0:83 'inF0' ( in 4-component vector of float) +0:83 Construct vec3 ( in 3-component vector of float) +0:83 'inF1' ( in 4-component vector of float) +0:84 Constant: +0:84 0.000000 +0:85 Construct vec4 ( temp 4-component vector of float) +0:85 direct index ( temp float) +0:85 unpackHalf2x16 ( temp 2-component vector of float) +0:85 direct index ( temp uint) +0:85 Convert float to uint ( temp 4-component vector of uint) +0:85 'inF0' ( in 4-component vector of float) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 0 (const int) +0:85 direct index ( temp float) +0:85 unpackHalf2x16 ( temp 2-component vector of float) +0:85 direct index ( temp uint) +0:85 Convert float to uint ( temp 4-component vector of uint) +0:85 'inF0' ( in 4-component vector of float) +0:85 Constant: +0:85 1 (const int) +0:85 Constant: +0:85 0 (const int) +0:85 direct index ( temp float) +0:85 unpackHalf2x16 ( temp 2-component vector of float) +0:85 direct index ( temp uint) +0:85 Convert float to uint ( temp 4-component vector of uint) +0:85 'inF0' ( in 4-component vector of float) +0:85 Constant: +0:85 2 (const int) +0:85 Constant: +0:85 0 (const int) +0:85 direct index ( temp float) +0:85 unpackHalf2x16 ( temp 2-component vector of float) +0:85 direct index ( temp uint) +0:85 Convert float to uint ( temp 4-component vector of uint) +0:85 'inF0' ( in 4-component vector of float) +0:85 Constant: +0:85 3 (const int) +0:85 Constant: +0:85 0 (const int) +0:86 findMSB ( temp 4-component vector of uint) +0:86 Convert float to uint ( temp 4-component vector of uint) +0:86 'inF0' ( in 4-component vector of float) +0:87 findLSB ( temp 4-component vector of uint) +0:87 Convert float to uint ( temp 4-component vector of uint) +0:87 'inF0' ( in 4-component vector of float) +0:89 bitFieldReverse ( temp 4-component vector of uint) +0:89 Convert float to uint ( temp 4-component vector of uint) +0:89 'inF0' ( in 4-component vector of float) +0:90 Constant: +0:90 0.000000 +0:92 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:80 Function Definition: PixelShaderFunction( ( temp void) +0:80 Function Parameters: +0:? Sequence +0:80 move second child to first child ( temp 4-component vector of float) +0:? 'inF0' ( temp 4-component vector of float) +0:? 'inF0' (layout( location=0) in 4-component vector of float) +0:80 move second child to first child ( temp 4-component vector of float) +0:? 'inF1' ( temp 4-component vector of float) +0:? 'inF1' (layout( location=1) in 4-component vector of float) +0:80 move second child to first child ( temp 4-component vector of float) +0:? 'inF2' ( temp 4-component vector of float) +0:? 'inF2' (layout( location=2) in 4-component vector of float) +0:80 move second child to first child ( temp 4-component vector of int) +0:? 'inI0' ( temp 4-component vector of int) +0:? 'inI0' (layout( location=3) flat in 4-component vector of int) +0:80 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:80 Function Call: @PixelShaderFunction(vf4;vf4;vf4;vi4; ( temp 4-component vector of float) +0:? 'inF0' ( temp 4-component vector of float) +0:? 'inF1' ( temp 4-component vector of float) +0:? 'inF2' ( temp 4-component vector of float) +0:? 'inI0' ( temp 4-component vector of int) +0:115 Function Definition: PixelShaderFunction2x2(mf22;mf22;mf22; ( temp 2X2 matrix of float) +0:115 Function Parameters: +0:115 'inF0' ( in 2X2 matrix of float) +0:115 'inF1' ( in 2X2 matrix of float) +0:115 'inF2' ( in 2X2 matrix of float) +0:? Sequence +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:117 Constant: +0:117 0.000000 +0:119 Branch: Return with expression +0:? Constant: +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:123 Function Definition: PixelShaderFunction3x3(mf33;mf33;mf33; ( temp 3X3 matrix of float) +0:123 Function Parameters: +0:123 'inF0' ( in 3X3 matrix of float) +0:123 'inF1' ( in 3X3 matrix of float) +0:123 'inF2' ( in 3X3 matrix of float) +0:? Sequence +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:125 Constant: +0:125 0.000000 +0:127 Branch: Return with expression +0:? Constant: +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:131 Function Definition: PixelShaderFunction4x4(mf44;mf44;mf44; ( temp 4X4 matrix of float) +0:131 Function Parameters: +0:131 'inF0' ( in 4X4 matrix of float) +0:131 'inF1' ( in 4X4 matrix of float) +0:131 'inF2' ( in 4X4 matrix of float) +0:? Sequence +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:133 Constant: +0:133 0.000000 +0:135 Branch: Return with expression +0:? Constant: +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'inF0' (layout( location=0) in 4-component vector of float) +0:? 'inF1' (layout( location=1) in 4-component vector of float) +0:? 'inF2' (layout( location=2) in 4-component vector of float) +0:? 'inI0' (layout( location=3) flat in 4-component vector of int) + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.negative.vert.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.negative.vert.out new file mode 100644 index 00000000..c2711c65 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.negative.vert.out @@ -0,0 +1,550 @@ +hlsl.intrinsics.negative.vert +Shader version: 500 +0:? Sequence +0:15 Function Definition: VertexShaderFunctionS(f1;f1;f1;i1; ( temp float) +0:15 Function Parameters: +0:15 'inF0' ( in float) +0:15 'inF1' ( in float) +0:15 'inF2' ( in float) +0:15 'inI0' ( in int) +0:? Sequence +0:71 Branch: Return with expression +0:71 Constant: +0:71 0.000000 +0:75 Function Definition: VertexShaderFunction1(vf1;vf1;vf1;vi1; ( temp 1-component vector of float) +0:75 Function Parameters: +0:75 'inF0' ( in 1-component vector of float) +0:75 'inF1' ( in 1-component vector of float) +0:75 'inF2' ( in 1-component vector of float) +0:75 'inI0' ( in 1-component vector of int) +0:? Sequence +0:80 Branch: Return with expression +0:80 Constant: +0:80 0.000000 +0:84 Function Definition: VertexShaderFunction2(vf2;vf2;vf2;vi2; ( temp 2-component vector of float) +0:84 Function Parameters: +0:84 'inF0' ( in 2-component vector of float) +0:84 'inF1' ( in 2-component vector of float) +0:84 'inF2' ( in 2-component vector of float) +0:84 'inI0' ( in 2-component vector of int) +0:? Sequence +0:127 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:131 Function Definition: VertexShaderFunction3(vf3;vf3;vf3;vi3; ( temp 3-component vector of float) +0:131 Function Parameters: +0:131 'inF0' ( in 3-component vector of float) +0:131 'inF1' ( in 3-component vector of float) +0:131 'inF2' ( in 3-component vector of float) +0:131 'inI0' ( in 3-component vector of int) +0:? Sequence +0:172 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:176 Function Definition: @VertexShaderFunction(vf4;vf4;vf4;vi4; ( temp 4-component vector of float) +0:176 Function Parameters: +0:176 'inF0' ( in 4-component vector of float) +0:176 'inF1' ( in 4-component vector of float) +0:176 'inF2' ( in 4-component vector of float) +0:176 'inI0' ( in 4-component vector of int) +0:? Sequence +0:217 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:176 Function Definition: VertexShaderFunction( ( temp void) +0:176 Function Parameters: +0:? Sequence +0:176 move second child to first child ( temp 4-component vector of float) +0:? 'inF0' ( temp 4-component vector of float) +0:? 'inF0' (layout( location=0) in 4-component vector of float) +0:176 move second child to first child ( temp 4-component vector of float) +0:? 'inF1' ( temp 4-component vector of float) +0:? 'inF1' (layout( location=1) in 4-component vector of float) +0:176 move second child to first child ( temp 4-component vector of float) +0:? 'inF2' ( temp 4-component vector of float) +0:? 'inF2' (layout( location=2) in 4-component vector of float) +0:176 move second child to first child ( temp 4-component vector of int) +0:? 'inI0' ( temp 4-component vector of int) +0:? 'inI0' (layout( location=3) in 4-component vector of int) +0:176 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:176 Function Call: @VertexShaderFunction(vf4;vf4;vf4;vi4; ( temp 4-component vector of float) +0:? 'inF0' ( temp 4-component vector of float) +0:? 'inF1' ( temp 4-component vector of float) +0:? 'inF2' ( temp 4-component vector of float) +0:? 'inI0' ( temp 4-component vector of int) +0:226 Function Definition: VertexShaderFunction2x2(mf22;mf22;mf22; ( temp 2X2 matrix of float) +0:226 Function Parameters: +0:226 'inF0' ( in 2X2 matrix of float) +0:226 'inF1' ( in 2X2 matrix of float) +0:226 'inF2' ( in 2X2 matrix of float) +0:? Sequence +0:230 Branch: Return with expression +0:? Constant: +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:234 Function Definition: VertexShaderFunction3x3(mf33;mf33;mf33; ( temp 3X3 matrix of float) +0:234 Function Parameters: +0:234 'inF0' ( in 3X3 matrix of float) +0:234 'inF1' ( in 3X3 matrix of float) +0:234 'inF2' ( in 3X3 matrix of float) +0:? Sequence +0:238 Branch: Return with expression +0:? Constant: +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:242 Function Definition: VertexShaderFunction4x4(mf44;mf44;mf44; ( temp 4X4 matrix of float) +0:242 Function Parameters: +0:242 'inF0' ( in 4X4 matrix of float) +0:242 'inF1' ( in 4X4 matrix of float) +0:242 'inF2' ( in 4X4 matrix of float) +0:? Sequence +0:246 Branch: Return with expression +0:? Constant: +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? Linker Objects +0:? 'gs_ua' ( global uint) +0:? 'gs_ub' ( global uint) +0:? 'gs_uc' ( global uint) +0:? 'gs_ua2' ( global 2-component vector of uint) +0:? 'gs_ub2' ( global 2-component vector of uint) +0:? 'gs_uc2' ( global 2-component vector of uint) +0:? 'gs_ua3' ( global 3-component vector of uint) +0:? 'gs_ub3' ( global 3-component vector of uint) +0:? 'gs_uc3' ( global 3-component vector of uint) +0:? 'gs_ua4' ( global 4-component vector of uint) +0:? 'gs_ub4' ( global 4-component vector of uint) +0:? 'gs_uc4' ( global 4-component vector of uint) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'inF0' (layout( location=0) in 4-component vector of float) +0:? 'inF1' (layout( location=1) in 4-component vector of float) +0:? 'inF2' (layout( location=2) in 4-component vector of float) +0:? 'inI0' (layout( location=3) in 4-component vector of int) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:15 Function Definition: VertexShaderFunctionS(f1;f1;f1;i1; ( temp float) +0:15 Function Parameters: +0:15 'inF0' ( in float) +0:15 'inF1' ( in float) +0:15 'inF2' ( in float) +0:15 'inI0' ( in int) +0:? Sequence +0:71 Branch: Return with expression +0:71 Constant: +0:71 0.000000 +0:75 Function Definition: VertexShaderFunction1(vf1;vf1;vf1;vi1; ( temp 1-component vector of float) +0:75 Function Parameters: +0:75 'inF0' ( in 1-component vector of float) +0:75 'inF1' ( in 1-component vector of float) +0:75 'inF2' ( in 1-component vector of float) +0:75 'inI0' ( in 1-component vector of int) +0:? Sequence +0:80 Branch: Return with expression +0:80 Constant: +0:80 0.000000 +0:84 Function Definition: VertexShaderFunction2(vf2;vf2;vf2;vi2; ( temp 2-component vector of float) +0:84 Function Parameters: +0:84 'inF0' ( in 2-component vector of float) +0:84 'inF1' ( in 2-component vector of float) +0:84 'inF2' ( in 2-component vector of float) +0:84 'inI0' ( in 2-component vector of int) +0:? Sequence +0:127 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:131 Function Definition: VertexShaderFunction3(vf3;vf3;vf3;vi3; ( temp 3-component vector of float) +0:131 Function Parameters: +0:131 'inF0' ( in 3-component vector of float) +0:131 'inF1' ( in 3-component vector of float) +0:131 'inF2' ( in 3-component vector of float) +0:131 'inI0' ( in 3-component vector of int) +0:? Sequence +0:172 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:176 Function Definition: @VertexShaderFunction(vf4;vf4;vf4;vi4; ( temp 4-component vector of float) +0:176 Function Parameters: +0:176 'inF0' ( in 4-component vector of float) +0:176 'inF1' ( in 4-component vector of float) +0:176 'inF2' ( in 4-component vector of float) +0:176 'inI0' ( in 4-component vector of int) +0:? Sequence +0:217 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:176 Function Definition: VertexShaderFunction( ( temp void) +0:176 Function Parameters: +0:? Sequence +0:176 move second child to first child ( temp 4-component vector of float) +0:? 'inF0' ( temp 4-component vector of float) +0:? 'inF0' (layout( location=0) in 4-component vector of float) +0:176 move second child to first child ( temp 4-component vector of float) +0:? 'inF1' ( temp 4-component vector of float) +0:? 'inF1' (layout( location=1) in 4-component vector of float) +0:176 move second child to first child ( temp 4-component vector of float) +0:? 'inF2' ( temp 4-component vector of float) +0:? 'inF2' (layout( location=2) in 4-component vector of float) +0:176 move second child to first child ( temp 4-component vector of int) +0:? 'inI0' ( temp 4-component vector of int) +0:? 'inI0' (layout( location=3) in 4-component vector of int) +0:176 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:176 Function Call: @VertexShaderFunction(vf4;vf4;vf4;vi4; ( temp 4-component vector of float) +0:? 'inF0' ( temp 4-component vector of float) +0:? 'inF1' ( temp 4-component vector of float) +0:? 'inF2' ( temp 4-component vector of float) +0:? 'inI0' ( temp 4-component vector of int) +0:226 Function Definition: VertexShaderFunction2x2(mf22;mf22;mf22; ( temp 2X2 matrix of float) +0:226 Function Parameters: +0:226 'inF0' ( in 2X2 matrix of float) +0:226 'inF1' ( in 2X2 matrix of float) +0:226 'inF2' ( in 2X2 matrix of float) +0:? Sequence +0:230 Branch: Return with expression +0:? Constant: +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:234 Function Definition: VertexShaderFunction3x3(mf33;mf33;mf33; ( temp 3X3 matrix of float) +0:234 Function Parameters: +0:234 'inF0' ( in 3X3 matrix of float) +0:234 'inF1' ( in 3X3 matrix of float) +0:234 'inF2' ( in 3X3 matrix of float) +0:? Sequence +0:238 Branch: Return with expression +0:? Constant: +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:242 Function Definition: VertexShaderFunction4x4(mf44;mf44;mf44; ( temp 4X4 matrix of float) +0:242 Function Parameters: +0:242 'inF0' ( in 4X4 matrix of float) +0:242 'inF1' ( in 4X4 matrix of float) +0:242 'inF2' ( in 4X4 matrix of float) +0:? Sequence +0:246 Branch: Return with expression +0:? Constant: +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? Linker Objects +0:? 'gs_ua' ( global uint) +0:? 'gs_ub' ( global uint) +0:? 'gs_uc' ( global uint) +0:? 'gs_ua2' ( global 2-component vector of uint) +0:? 'gs_ub2' ( global 2-component vector of uint) +0:? 'gs_uc2' ( global 2-component vector of uint) +0:? 'gs_ua3' ( global 3-component vector of uint) +0:? 'gs_ub3' ( global 3-component vector of uint) +0:? 'gs_uc3' ( global 3-component vector of uint) +0:? 'gs_ua4' ( global 4-component vector of uint) +0:? 'gs_ub4' ( global 4-component vector of uint) +0:? 'gs_uc4' ( global 4-component vector of uint) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'inF0' (layout( location=0) in 4-component vector of float) +0:? 'inF1' (layout( location=1) in 4-component vector of float) +0:? 'inF2' (layout( location=2) in 4-component vector of float) +0:? 'inI0' (layout( location=3) in 4-component vector of int) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 155 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "VertexShaderFunction" 100 103 106 110 113 + Source HLSL 500 + Name 4 "VertexShaderFunction" + Name 15 "VertexShaderFunctionS(f1;f1;f1;i1;" + Name 11 "inF0" + Name 12 "inF1" + Name 13 "inF2" + Name 14 "inI0" + Name 21 "VertexShaderFunction1(vf1;vf1;vf1;vi1;" + Name 17 "inF0" + Name 18 "inF1" + Name 19 "inF2" + Name 20 "inI0" + Name 32 "VertexShaderFunction2(vf2;vf2;vf2;vi2;" + Name 28 "inF0" + Name 29 "inF1" + Name 30 "inF2" + Name 31 "inI0" + Name 43 "VertexShaderFunction3(vf3;vf3;vf3;vi3;" + Name 39 "inF0" + Name 40 "inF1" + Name 41 "inF2" + Name 42 "inI0" + Name 54 "@VertexShaderFunction(vf4;vf4;vf4;vi4;" + Name 50 "inF0" + Name 51 "inF1" + Name 52 "inF2" + Name 53 "inI0" + Name 62 "VertexShaderFunction2x2(mf22;mf22;mf22;" + Name 59 "inF0" + Name 60 "inF1" + Name 61 "inF2" + Name 70 "VertexShaderFunction3x3(mf33;mf33;mf33;" + Name 67 "inF0" + Name 68 "inF1" + Name 69 "inF2" + Name 78 "VertexShaderFunction4x4(mf44;mf44;mf44;" + Name 75 "inF0" + Name 76 "inF1" + Name 77 "inF2" + Name 98 "inF0" + Name 100 "inF0" + Name 102 "inF1" + Name 103 "inF1" + Name 105 "inF2" + Name 106 "inF2" + Name 108 "inI0" + Name 110 "inI0" + Name 113 "@entryPointOutput" + Name 114 "param" + Name 116 "param" + Name 118 "param" + Name 120 "param" + Name 137 "gs_ua" + Name 138 "gs_ub" + Name 139 "gs_uc" + Name 142 "gs_ua2" + Name 143 "gs_ub2" + Name 144 "gs_uc2" + Name 147 "gs_ua3" + Name 148 "gs_ub3" + Name 149 "gs_uc3" + Name 152 "gs_ua4" + Name 153 "gs_ub4" + Name 154 "gs_uc4" + Decorate 100(inF0) Location 0 + Decorate 103(inF1) Location 1 + Decorate 106(inF2) Location 2 + Decorate 110(inI0) Location 3 + Decorate 113(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeInt 32 1 + 9: TypePointer Function 8(int) + 10: TypeFunction 6(float) 7(ptr) 7(ptr) 7(ptr) 9(ptr) + 23: TypeVector 6(float) 2 + 24: TypePointer Function 23(fvec2) + 25: TypeVector 8(int) 2 + 26: TypePointer Function 25(ivec2) + 27: TypeFunction 23(fvec2) 24(ptr) 24(ptr) 24(ptr) 26(ptr) + 34: TypeVector 6(float) 3 + 35: TypePointer Function 34(fvec3) + 36: TypeVector 8(int) 3 + 37: TypePointer Function 36(ivec3) + 38: TypeFunction 34(fvec3) 35(ptr) 35(ptr) 35(ptr) 37(ptr) + 45: TypeVector 6(float) 4 + 46: TypePointer Function 45(fvec4) + 47: TypeVector 8(int) 4 + 48: TypePointer Function 47(ivec4) + 49: TypeFunction 45(fvec4) 46(ptr) 46(ptr) 46(ptr) 48(ptr) + 56: TypeMatrix 23(fvec2) 2 + 57: TypePointer Function 56 + 58: TypeFunction 56 57(ptr) 57(ptr) 57(ptr) + 64: TypeMatrix 34(fvec3) 3 + 65: TypePointer Function 64 + 66: TypeFunction 64 65(ptr) 65(ptr) 65(ptr) + 72: TypeMatrix 45(fvec4) 4 + 73: TypePointer Function 72 + 74: TypeFunction 72 73(ptr) 73(ptr) 73(ptr) + 80: 6(float) Constant 0 + 85: 6(float) Constant 1065353216 + 86: 6(float) Constant 1073741824 + 87: 23(fvec2) ConstantComposite 85 86 + 90: 6(float) Constant 1077936128 + 91: 34(fvec3) ConstantComposite 85 86 90 + 94: 6(float) Constant 1082130432 + 95: 45(fvec4) ConstantComposite 85 86 90 94 + 99: TypePointer Input 45(fvec4) + 100(inF0): 99(ptr) Variable Input + 103(inF1): 99(ptr) Variable Input + 106(inF2): 99(ptr) Variable Input + 109: TypePointer Input 47(ivec4) + 110(inI0): 109(ptr) Variable Input + 112: TypePointer Output 45(fvec4) +113(@entryPointOutput): 112(ptr) Variable Output + 123: 23(fvec2) ConstantComposite 86 86 + 124: 56 ConstantComposite 123 123 + 127: 34(fvec3) ConstantComposite 90 90 90 + 128: 64 ConstantComposite 127 127 127 + 131: 45(fvec4) ConstantComposite 94 94 94 94 + 132: 72 ConstantComposite 131 131 131 131 + 135: TypeInt 32 0 + 136: TypePointer Private 135(int) + 137(gs_ua): 136(ptr) Variable Private + 138(gs_ub): 136(ptr) Variable Private + 139(gs_uc): 136(ptr) Variable Private + 140: TypeVector 135(int) 2 + 141: TypePointer Private 140(ivec2) + 142(gs_ua2): 141(ptr) Variable Private + 143(gs_ub2): 141(ptr) Variable Private + 144(gs_uc2): 141(ptr) Variable Private + 145: TypeVector 135(int) 3 + 146: TypePointer Private 145(ivec3) + 147(gs_ua3): 146(ptr) Variable Private + 148(gs_ub3): 146(ptr) Variable Private + 149(gs_uc3): 146(ptr) Variable Private + 150: TypeVector 135(int) 4 + 151: TypePointer Private 150(ivec4) + 152(gs_ua4): 151(ptr) Variable Private + 153(gs_ub4): 151(ptr) Variable Private + 154(gs_uc4): 151(ptr) Variable Private +4(VertexShaderFunction): 2 Function None 3 + 5: Label + 98(inF0): 46(ptr) Variable Function + 102(inF1): 46(ptr) Variable Function + 105(inF2): 46(ptr) Variable Function + 108(inI0): 48(ptr) Variable Function + 114(param): 46(ptr) Variable Function + 116(param): 46(ptr) Variable Function + 118(param): 46(ptr) Variable Function + 120(param): 48(ptr) Variable Function + 101: 45(fvec4) Load 100(inF0) + Store 98(inF0) 101 + 104: 45(fvec4) Load 103(inF1) + Store 102(inF1) 104 + 107: 45(fvec4) Load 106(inF2) + Store 105(inF2) 107 + 111: 47(ivec4) Load 110(inI0) + Store 108(inI0) 111 + 115: 45(fvec4) Load 98(inF0) + Store 114(param) 115 + 117: 45(fvec4) Load 102(inF1) + Store 116(param) 117 + 119: 45(fvec4) Load 105(inF2) + Store 118(param) 119 + 121: 47(ivec4) Load 108(inI0) + Store 120(param) 121 + 122: 45(fvec4) FunctionCall 54(@VertexShaderFunction(vf4;vf4;vf4;vi4;) 114(param) 116(param) 118(param) 120(param) + Store 113(@entryPointOutput) 122 + Return + FunctionEnd +15(VertexShaderFunctionS(f1;f1;f1;i1;): 6(float) Function None 10 + 11(inF0): 7(ptr) FunctionParameter + 12(inF1): 7(ptr) FunctionParameter + 13(inF2): 7(ptr) FunctionParameter + 14(inI0): 9(ptr) FunctionParameter + 16: Label + ReturnValue 80 + FunctionEnd +21(VertexShaderFunction1(vf1;vf1;vf1;vi1;): 6(float) Function None 10 + 17(inF0): 7(ptr) FunctionParameter + 18(inF1): 7(ptr) FunctionParameter + 19(inF2): 7(ptr) FunctionParameter + 20(inI0): 9(ptr) FunctionParameter + 22: Label + ReturnValue 80 + FunctionEnd +32(VertexShaderFunction2(vf2;vf2;vf2;vi2;): 23(fvec2) Function None 27 + 28(inF0): 24(ptr) FunctionParameter + 29(inF1): 24(ptr) FunctionParameter + 30(inF2): 24(ptr) FunctionParameter + 31(inI0): 26(ptr) FunctionParameter + 33: Label + ReturnValue 87 + FunctionEnd +43(VertexShaderFunction3(vf3;vf3;vf3;vi3;): 34(fvec3) Function None 38 + 39(inF0): 35(ptr) FunctionParameter + 40(inF1): 35(ptr) FunctionParameter + 41(inF2): 35(ptr) FunctionParameter + 42(inI0): 37(ptr) FunctionParameter + 44: Label + ReturnValue 91 + FunctionEnd +54(@VertexShaderFunction(vf4;vf4;vf4;vi4;): 45(fvec4) Function None 49 + 50(inF0): 46(ptr) FunctionParameter + 51(inF1): 46(ptr) FunctionParameter + 52(inF2): 46(ptr) FunctionParameter + 53(inI0): 48(ptr) FunctionParameter + 55: Label + ReturnValue 95 + FunctionEnd +62(VertexShaderFunction2x2(mf22;mf22;mf22;): 56 Function None 58 + 59(inF0): 57(ptr) FunctionParameter + 60(inF1): 57(ptr) FunctionParameter + 61(inF2): 57(ptr) FunctionParameter + 63: Label + ReturnValue 124 + FunctionEnd +70(VertexShaderFunction3x3(mf33;mf33;mf33;): 64 Function None 66 + 67(inF0): 65(ptr) FunctionParameter + 68(inF1): 65(ptr) FunctionParameter + 69(inF2): 65(ptr) FunctionParameter + 71: Label + ReturnValue 128 + FunctionEnd +78(VertexShaderFunction4x4(mf44;mf44;mf44;): 72 Function None 74 + 75(inF0): 73(ptr) FunctionParameter + 76(inF1): 73(ptr) FunctionParameter + 77(inF2): 73(ptr) FunctionParameter + 79: Label + ReturnValue 132 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.promote.down.frag.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.promote.down.frag.out new file mode 100644 index 00000000..a561dfe9 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.promote.down.frag.out @@ -0,0 +1,198 @@ +hlsl.intrinsics.promote.down.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:15 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:15 Function Parameters: +0:? Sequence +0:16 Sequence +0:16 move second child to first child ( temp uint) +0:16 'r00' ( temp uint) +0:16 bitCount ( temp uint) +0:16 Convert float to uint ( temp uint) +0:16 f: direct index for structure ( uniform float) +0:16 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2}) +0:16 Constant: +0:16 2 (const uint) +0:17 Sequence +0:17 move second child to first child ( temp 2-component vector of uint) +0:17 'r01' ( temp 2-component vector of uint) +0:17 bitFieldReverse ( temp 2-component vector of uint) +0:17 Convert float to uint ( temp 2-component vector of uint) +0:17 f2: direct index for structure ( uniform 2-component vector of float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2}) +0:17 Constant: +0:17 6 (const uint) +0:20 move second child to first child ( temp 4-component vector of float) +0:20 color: direct index for structure ( temp 4-component vector of float) +0:20 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:20 Constant: +0:20 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:21 Branch: Return with expression +0:21 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:15 Function Definition: main( ( temp void) +0:15 Function Parameters: +0:? Sequence +0:15 Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:15 color: direct index for structure ( temp 4-component vector of float) +0:15 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:15 Constant: +0:15 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2}) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:15 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:15 Function Parameters: +0:? Sequence +0:16 Sequence +0:16 move second child to first child ( temp uint) +0:16 'r00' ( temp uint) +0:16 bitCount ( temp uint) +0:16 Convert float to uint ( temp uint) +0:16 f: direct index for structure ( uniform float) +0:16 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2}) +0:16 Constant: +0:16 2 (const uint) +0:17 Sequence +0:17 move second child to first child ( temp 2-component vector of uint) +0:17 'r01' ( temp 2-component vector of uint) +0:17 bitFieldReverse ( temp 2-component vector of uint) +0:17 Convert float to uint ( temp 2-component vector of uint) +0:17 f2: direct index for structure ( uniform 2-component vector of float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2}) +0:17 Constant: +0:17 6 (const uint) +0:20 move second child to first child ( temp 4-component vector of float) +0:20 color: direct index for structure ( temp 4-component vector of float) +0:20 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:20 Constant: +0:20 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:21 Branch: Return with expression +0:21 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:15 Function Definition: main( ( temp void) +0:15 Function Parameters: +0:? Sequence +0:15 Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:15 color: direct index for structure ( temp 4-component vector of float) +0:15 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:15 Constant: +0:15 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2}) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 50 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 47 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "color" + Name 10 "@main(" + Name 14 "r00" + Name 19 "$Global" + MemberName 19($Global) 0 "i" + MemberName 19($Global) 1 "u" + MemberName 19($Global) 2 "f" + MemberName 19($Global) 3 "b" + MemberName 19($Global) 4 "i2" + MemberName 19($Global) 5 "u2" + MemberName 19($Global) 6 "f2" + MemberName 19($Global) 7 "b2" + Name 21 "" + Name 29 "r01" + Name 37 "ps_output" + Name 47 "@entryPointOutput.color" + MemberDecorate 19($Global) 0 Offset 0 + MemberDecorate 19($Global) 1 Offset 4 + MemberDecorate 19($Global) 2 Offset 8 + MemberDecorate 19($Global) 3 Offset 12 + MemberDecorate 19($Global) 4 Offset 16 + MemberDecorate 19($Global) 5 Offset 24 + MemberDecorate 19($Global) 6 Offset 32 + MemberDecorate 19($Global) 7 Offset 40 + Decorate 19($Global) Block + Decorate 21 DescriptorSet 0 + Decorate 47(@entryPointOutput.color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeInt 32 0 + 13: TypePointer Function 12(int) + 15: TypeInt 32 1 + 16: TypeVector 15(int) 2 + 17: TypeVector 12(int) 2 + 18: TypeVector 6(float) 2 + 19($Global): TypeStruct 15(int) 12(int) 6(float) 12(int) 16(ivec2) 17(ivec2) 18(fvec2) 17(ivec2) + 20: TypePointer Uniform 19($Global) + 21: 20(ptr) Variable Uniform + 22: 15(int) Constant 2 + 23: TypePointer Uniform 6(float) + 28: TypePointer Function 17(ivec2) + 30: 15(int) Constant 6 + 31: TypePointer Uniform 18(fvec2) + 36: TypePointer Function 8(PS_OUTPUT) + 38: 15(int) Constant 0 + 39: 6(float) Constant 0 + 40: 7(fvec4) ConstantComposite 39 39 39 39 + 41: TypePointer Function 7(fvec4) + 46: TypePointer Output 7(fvec4) +47(@entryPointOutput.color): 46(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 48:8(PS_OUTPUT) FunctionCall 10(@main() + 49: 7(fvec4) CompositeExtract 48 0 + Store 47(@entryPointOutput.color) 49 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 14(r00): 13(ptr) Variable Function + 29(r01): 28(ptr) Variable Function + 37(ps_output): 36(ptr) Variable Function + 24: 23(ptr) AccessChain 21 22 + 25: 6(float) Load 24 + 26: 12(int) ConvertFToU 25 + 27: 12(int) BitCount 26 + Store 14(r00) 27 + 32: 31(ptr) AccessChain 21 30 + 33: 18(fvec2) Load 32 + 34: 17(ivec2) ConvertFToU 33 + 35: 17(ivec2) BitReverse 34 + Store 29(r01) 35 + 42: 41(ptr) AccessChain 37(ps_output) 38 + Store 42 40 + 43:8(PS_OUTPUT) Load 37(ps_output) + ReturnValue 43 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.promote.frag.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.promote.frag.out new file mode 100644 index 00000000..b064295a --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.promote.frag.out @@ -0,0 +1,1328 @@ +hlsl.intrinsics.promote.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:20 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:20 Function Parameters: +0:? Sequence +0:23 Sequence +0:23 move second child to first child ( temp float) +0:23 'r00' ( temp float) +0:23 max ( temp float) +0:23 Convert bool to float ( temp float) +0:23 b: direct index for structure ( uniform bool) +0:23 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:23 Constant: +0:23 3 (const uint) +0:23 f: direct index for structure ( uniform float) +0:23 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:23 Constant: +0:23 2 (const uint) +0:24 Sequence +0:24 move second child to first child ( temp uint) +0:24 'r01' ( temp uint) +0:24 max ( temp uint) +0:24 Convert bool to uint ( temp uint) +0:24 b: direct index for structure ( uniform bool) +0:24 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:24 Constant: +0:24 3 (const uint) +0:24 u: direct index for structure ( uniform uint) +0:24 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:24 Constant: +0:24 1 (const uint) +0:25 Sequence +0:25 move second child to first child ( temp int) +0:25 'r02' ( temp int) +0:25 max ( temp int) +0:25 Convert bool to int ( temp int) +0:25 b: direct index for structure ( uniform bool) +0:25 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:25 Constant: +0:25 3 (const uint) +0:25 i: direct index for structure ( uniform int) +0:25 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:25 Constant: +0:25 0 (const uint) +0:26 Sequence +0:26 move second child to first child ( temp float) +0:26 'r03' ( temp float) +0:26 max ( temp float) +0:26 Convert int to float ( temp float) +0:26 i: direct index for structure ( uniform int) +0:26 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:26 Constant: +0:26 0 (const uint) +0:26 f: direct index for structure ( uniform float) +0:26 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:26 Constant: +0:26 2 (const uint) +0:27 Sequence +0:27 move second child to first child ( temp float) +0:27 'r04' ( temp float) +0:27 max ( temp float) +0:27 Convert uint to float ( temp float) +0:27 u: direct index for structure ( uniform uint) +0:27 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:27 Constant: +0:27 1 (const uint) +0:27 f: direct index for structure ( uniform float) +0:27 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:27 Constant: +0:27 2 (const uint) +0:29 Sequence +0:29 move second child to first child ( temp 2-component vector of float) +0:29 'r10' ( temp 2-component vector of float) +0:29 max ( temp 2-component vector of float) +0:29 Convert bool to float ( temp 2-component vector of float) +0:29 b2: direct index for structure ( uniform 2-component vector of bool) +0:29 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:29 Constant: +0:29 7 (const uint) +0:29 f2: direct index for structure ( uniform 2-component vector of float) +0:29 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:29 Constant: +0:29 6 (const uint) +0:30 Sequence +0:30 move second child to first child ( temp 2-component vector of uint) +0:30 'r11' ( temp 2-component vector of uint) +0:30 max ( temp 2-component vector of uint) +0:30 Convert bool to uint ( temp 2-component vector of uint) +0:30 b2: direct index for structure ( uniform 2-component vector of bool) +0:30 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:30 Constant: +0:30 7 (const uint) +0:30 u2: direct index for structure ( uniform 2-component vector of uint) +0:30 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:30 Constant: +0:30 5 (const uint) +0:31 Sequence +0:31 move second child to first child ( temp 2-component vector of int) +0:31 'r12' ( temp 2-component vector of int) +0:31 max ( temp 2-component vector of int) +0:31 Convert bool to int ( temp 2-component vector of int) +0:31 b2: direct index for structure ( uniform 2-component vector of bool) +0:31 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:31 Constant: +0:31 7 (const uint) +0:31 i2: direct index for structure ( uniform 2-component vector of int) +0:31 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:31 Constant: +0:31 4 (const uint) +0:32 Sequence +0:32 move second child to first child ( temp 2-component vector of float) +0:32 'r13' ( temp 2-component vector of float) +0:32 max ( temp 2-component vector of float) +0:32 Convert int to float ( temp 2-component vector of float) +0:32 i2: direct index for structure ( uniform 2-component vector of int) +0:32 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:32 Constant: +0:32 4 (const uint) +0:32 f2: direct index for structure ( uniform 2-component vector of float) +0:32 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:32 Constant: +0:32 6 (const uint) +0:33 Sequence +0:33 move second child to first child ( temp 2-component vector of float) +0:33 'r14' ( temp 2-component vector of float) +0:33 max ( temp 2-component vector of float) +0:33 Convert uint to float ( temp 2-component vector of float) +0:33 u2: direct index for structure ( uniform 2-component vector of uint) +0:33 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:33 Constant: +0:33 5 (const uint) +0:33 f2: direct index for structure ( uniform 2-component vector of float) +0:33 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:33 Constant: +0:33 6 (const uint) +0:35 Sequence +0:35 move second child to first child ( temp 2-component vector of float) +0:35 'r20' ( temp 2-component vector of float) +0:35 clamp ( temp 2-component vector of float) +0:35 Convert int to float ( temp 2-component vector of float) +0:35 i2: direct index for structure ( uniform 2-component vector of int) +0:35 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:35 Constant: +0:35 4 (const uint) +0:35 Convert uint to float ( temp 2-component vector of float) +0:35 u2: direct index for structure ( uniform 2-component vector of uint) +0:35 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:35 Constant: +0:35 5 (const uint) +0:35 f2: direct index for structure ( uniform 2-component vector of float) +0:35 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:35 Constant: +0:35 6 (const uint) +0:36 Sequence +0:36 move second child to first child ( temp 2-component vector of uint) +0:36 'r21' ( temp 2-component vector of uint) +0:36 clamp ( temp 2-component vector of uint) +0:36 Convert bool to uint ( temp 2-component vector of uint) +0:36 b2: direct index for structure ( uniform 2-component vector of bool) +0:36 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:36 Constant: +0:36 7 (const uint) +0:36 u2: direct index for structure ( uniform 2-component vector of uint) +0:36 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:36 Constant: +0:36 5 (const uint) +0:36 Convert bool to uint ( temp 2-component vector of uint) +0:36 b2: direct index for structure ( uniform 2-component vector of bool) +0:36 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:36 Constant: +0:36 7 (const uint) +0:37 Sequence +0:37 move second child to first child ( temp 2-component vector of float) +0:37 'r22' ( temp 2-component vector of float) +0:37 clamp ( temp 2-component vector of float) +0:37 Convert bool to float ( temp 2-component vector of float) +0:37 b2: direct index for structure ( uniform 2-component vector of bool) +0:37 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:37 Constant: +0:37 7 (const uint) +0:37 f2: direct index for structure ( uniform 2-component vector of float) +0:37 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:37 Constant: +0:37 6 (const uint) +0:37 Convert bool to float ( temp 2-component vector of float) +0:37 b2: direct index for structure ( uniform 2-component vector of bool) +0:37 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:37 Constant: +0:37 7 (const uint) +0:40 Sequence +0:40 move second child to first child ( temp 2-component vector of float) +0:40 'r30' ( temp 2-component vector of float) +0:40 max ( temp 2-component vector of float) +0:40 Construct vec2 ( in 2-component vector of float) +0:40 Convert bool to float ( temp float) +0:40 b: direct index for structure ( uniform bool) +0:40 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:40 Constant: +0:40 3 (const uint) +0:40 f2: direct index for structure ( uniform 2-component vector of float) +0:40 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:40 Constant: +0:40 6 (const uint) +0:41 Sequence +0:41 move second child to first child ( temp 2-component vector of uint) +0:41 'r31' ( temp 2-component vector of uint) +0:41 max ( temp 2-component vector of uint) +0:41 Construct uvec2 ( in 2-component vector of uint) +0:41 Convert bool to uint ( temp uint) +0:41 b: direct index for structure ( uniform bool) +0:41 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:41 Constant: +0:41 3 (const uint) +0:41 u2: direct index for structure ( uniform 2-component vector of uint) +0:41 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:41 Constant: +0:41 5 (const uint) +0:42 Sequence +0:42 move second child to first child ( temp 2-component vector of int) +0:42 'r32' ( temp 2-component vector of int) +0:42 max ( temp 2-component vector of int) +0:42 Construct ivec2 ( in 2-component vector of int) +0:42 Convert bool to int ( temp int) +0:42 b: direct index for structure ( uniform bool) +0:42 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:42 Constant: +0:42 3 (const uint) +0:42 i2: direct index for structure ( uniform 2-component vector of int) +0:42 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:42 Constant: +0:42 4 (const uint) +0:43 Sequence +0:43 move second child to first child ( temp 2-component vector of float) +0:43 'r33' ( temp 2-component vector of float) +0:43 max ( temp 2-component vector of float) +0:43 Construct vec2 ( in 2-component vector of float) +0:43 Convert int to float ( temp float) +0:43 i: direct index for structure ( uniform int) +0:43 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:43 Constant: +0:43 0 (const uint) +0:43 f2: direct index for structure ( uniform 2-component vector of float) +0:43 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:43 Constant: +0:43 6 (const uint) +0:44 Sequence +0:44 move second child to first child ( temp 2-component vector of float) +0:44 'r34' ( temp 2-component vector of float) +0:44 max ( temp 2-component vector of float) +0:44 Construct vec2 ( in 2-component vector of float) +0:44 Convert uint to float ( temp float) +0:44 u: direct index for structure ( uniform uint) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:44 Constant: +0:44 1 (const uint) +0:44 f2: direct index for structure ( uniform 2-component vector of float) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:44 Constant: +0:44 6 (const uint) +0:46 Sequence +0:46 move second child to first child ( temp 2-component vector of float) +0:46 'r40' ( temp 2-component vector of float) +0:46 clamp ( temp 2-component vector of float) +0:46 Construct vec2 ( in 2-component vector of float) +0:46 Convert int to float ( temp float) +0:46 i: direct index for structure ( uniform int) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:46 Constant: +0:46 0 (const uint) +0:46 Convert uint to float ( temp 2-component vector of float) +0:46 u2: direct index for structure ( uniform 2-component vector of uint) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:46 Constant: +0:46 5 (const uint) +0:46 f2: direct index for structure ( uniform 2-component vector of float) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:46 Constant: +0:46 6 (const uint) +0:47 Sequence +0:47 move second child to first child ( temp 2-component vector of uint) +0:47 'r41' ( temp 2-component vector of uint) +0:47 clamp ( temp 2-component vector of uint) +0:47 Convert bool to uint ( temp 2-component vector of uint) +0:47 b2: direct index for structure ( uniform 2-component vector of bool) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:47 Constant: +0:47 7 (const uint) +0:47 Construct uvec2 ( in 2-component vector of uint) +0:47 u: direct index for structure ( uniform uint) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:47 Constant: +0:47 1 (const uint) +0:47 Convert bool to uint ( temp 2-component vector of uint) +0:47 b2: direct index for structure ( uniform 2-component vector of bool) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:47 Constant: +0:47 7 (const uint) +0:48 Sequence +0:48 move second child to first child ( temp 2-component vector of float) +0:48 'r42' ( temp 2-component vector of float) +0:48 clamp ( temp 2-component vector of float) +0:48 Convert bool to float ( temp 2-component vector of float) +0:48 b2: direct index for structure ( uniform 2-component vector of bool) +0:48 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:48 Constant: +0:48 7 (const uint) +0:48 Construct vec2 ( in 2-component vector of float) +0:48 f: direct index for structure ( uniform float) +0:48 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:48 Constant: +0:48 2 (const uint) +0:48 Construct vec2 ( in 2-component vector of float) +0:48 Convert bool to float ( temp float) +0:48 b: direct index for structure ( uniform bool) +0:48 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:48 Constant: +0:48 3 (const uint) +0:49 Sequence +0:49 move second child to first child ( temp 2-component vector of int) +0:49 'r43' ( temp 2-component vector of int) +0:49 Convert uint to int ( temp 2-component vector of int) +0:49 clamp ( temp 2-component vector of uint) +0:49 Construct uvec2 ( in 2-component vector of uint) +0:49 Convert int to uint ( temp uint) +0:49 i: direct index for structure ( uniform int) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:49 Constant: +0:49 0 (const uint) +0:49 Convert int to uint ( temp 2-component vector of uint) +0:49 i2: direct index for structure ( uniform 2-component vector of int) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:49 Constant: +0:49 4 (const uint) +0:49 u2: direct index for structure ( uniform 2-component vector of uint) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:49 Constant: +0:49 5 (const uint) +0:51 Sequence +0:51 move second child to first child ( temp float) +0:51 'r50' ( temp float) +0:51 Construct float ( temp float) +0:? textureFetch ( temp 4-component vector of float) +0:51 'g_tTexbfs' (layout( r32f) uniform textureBuffer) +0:51 Convert uint to int ( temp int) +0:51 upos: direct index for structure ( uniform uint) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:51 Constant: +0:51 8 (const uint) +0:52 Sequence +0:52 move second child to first child ( temp float) +0:52 'r51' ( temp float) +0:52 Construct float ( temp float) +0:? textureFetch ( temp 4-component vector of float) +0:52 'g_tTexbfs' (layout( r32f) uniform textureBuffer) +0:52 Convert float to int ( temp int) +0:52 fpos: direct index for structure ( uniform float) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:52 Constant: +0:52 9 (const uint) +0:70 Sequence +0:70 move second child to first child ( temp uint) +0:70 'sizeQueryTemp' ( temp uint) +0:70 textureSize ( temp uint) +0:70 'g_tTex1df4' ( uniform texture1D) +0:70 Constant: +0:70 0 (const int) +0:70 move second child to first child ( temp int) +0:70 'WidthI' ( temp int) +0:70 Convert uint to int ( temp int) +0:70 'sizeQueryTemp' ( temp uint) +0:71 Sequence +0:71 move second child to first child ( temp uint) +0:71 'sizeQueryTemp' ( temp uint) +0:71 textureSize ( temp uint) +0:71 'g_tTex1df4' ( uniform texture1D) +0:71 Constant: +0:71 6 (const uint) +0:71 move second child to first child ( temp int) +0:71 'WidthI' ( temp int) +0:71 Convert uint to int ( temp int) +0:71 'sizeQueryTemp' ( temp uint) +0:71 move second child to first child ( temp uint) +0:71 'NumberOfLevelsU' ( temp uint) +0:71 textureQueryLevels ( temp uint) +0:71 'g_tTex1df4' ( uniform texture1D) +0:72 Sequence +0:72 move second child to first child ( temp uint) +0:72 'sizeQueryTemp' ( temp uint) +0:72 textureSize ( temp uint) +0:72 'g_tTex1df4' ( uniform texture1D) +0:72 Constant: +0:72 6 (const uint) +0:72 move second child to first child ( temp uint) +0:72 'WidthU' ( temp uint) +0:72 'sizeQueryTemp' ( temp uint) +0:72 move second child to first child ( temp int) +0:72 'NumberOfLevelsI' ( temp int) +0:72 Convert uint to int ( temp int) +0:72 textureQueryLevels ( temp uint) +0:72 'g_tTex1df4' ( uniform texture1D) +0:73 Sequence +0:73 move second child to first child ( temp uint) +0:73 'sizeQueryTemp' ( temp uint) +0:73 textureSize ( temp uint) +0:73 'g_tTex1df4' ( uniform texture1D) +0:73 Constant: +0:73 6 (const uint) +0:73 move second child to first child ( temp int) +0:73 'WidthI' ( temp int) +0:73 Convert uint to int ( temp int) +0:73 'sizeQueryTemp' ( temp uint) +0:73 move second child to first child ( temp int) +0:73 'NumberOfLevelsI' ( temp int) +0:73 Convert uint to int ( temp int) +0:73 textureQueryLevels ( temp uint) +0:73 'g_tTex1df4' ( uniform texture1D) +0:77 move second child to first child ( temp 4-component vector of float) +0:77 color: direct index for structure ( temp 4-component vector of float) +0:77 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:77 Constant: +0:77 0 (const int) +0:77 Construct vec4 ( temp 4-component vector of float) +0:77 'r00' ( temp float) +0:78 Branch: Return with expression +0:78 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:20 color: direct index for structure ( temp 4-component vector of float) +0:20 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:20 Constant: +0:20 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:? 'g_tTexbfs' (layout( r32f) uniform textureBuffer) +0:? 'g_tTex1df4' ( uniform texture1D) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:20 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:20 Function Parameters: +0:? Sequence +0:23 Sequence +0:23 move second child to first child ( temp float) +0:23 'r00' ( temp float) +0:23 max ( temp float) +0:23 Convert bool to float ( temp float) +0:23 b: direct index for structure ( uniform bool) +0:23 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:23 Constant: +0:23 3 (const uint) +0:23 f: direct index for structure ( uniform float) +0:23 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:23 Constant: +0:23 2 (const uint) +0:24 Sequence +0:24 move second child to first child ( temp uint) +0:24 'r01' ( temp uint) +0:24 max ( temp uint) +0:24 Convert bool to uint ( temp uint) +0:24 b: direct index for structure ( uniform bool) +0:24 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:24 Constant: +0:24 3 (const uint) +0:24 u: direct index for structure ( uniform uint) +0:24 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:24 Constant: +0:24 1 (const uint) +0:25 Sequence +0:25 move second child to first child ( temp int) +0:25 'r02' ( temp int) +0:25 max ( temp int) +0:25 Convert bool to int ( temp int) +0:25 b: direct index for structure ( uniform bool) +0:25 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:25 Constant: +0:25 3 (const uint) +0:25 i: direct index for structure ( uniform int) +0:25 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:25 Constant: +0:25 0 (const uint) +0:26 Sequence +0:26 move second child to first child ( temp float) +0:26 'r03' ( temp float) +0:26 max ( temp float) +0:26 Convert int to float ( temp float) +0:26 i: direct index for structure ( uniform int) +0:26 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:26 Constant: +0:26 0 (const uint) +0:26 f: direct index for structure ( uniform float) +0:26 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:26 Constant: +0:26 2 (const uint) +0:27 Sequence +0:27 move second child to first child ( temp float) +0:27 'r04' ( temp float) +0:27 max ( temp float) +0:27 Convert uint to float ( temp float) +0:27 u: direct index for structure ( uniform uint) +0:27 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:27 Constant: +0:27 1 (const uint) +0:27 f: direct index for structure ( uniform float) +0:27 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:27 Constant: +0:27 2 (const uint) +0:29 Sequence +0:29 move second child to first child ( temp 2-component vector of float) +0:29 'r10' ( temp 2-component vector of float) +0:29 max ( temp 2-component vector of float) +0:29 Convert bool to float ( temp 2-component vector of float) +0:29 b2: direct index for structure ( uniform 2-component vector of bool) +0:29 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:29 Constant: +0:29 7 (const uint) +0:29 f2: direct index for structure ( uniform 2-component vector of float) +0:29 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:29 Constant: +0:29 6 (const uint) +0:30 Sequence +0:30 move second child to first child ( temp 2-component vector of uint) +0:30 'r11' ( temp 2-component vector of uint) +0:30 max ( temp 2-component vector of uint) +0:30 Convert bool to uint ( temp 2-component vector of uint) +0:30 b2: direct index for structure ( uniform 2-component vector of bool) +0:30 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:30 Constant: +0:30 7 (const uint) +0:30 u2: direct index for structure ( uniform 2-component vector of uint) +0:30 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:30 Constant: +0:30 5 (const uint) +0:31 Sequence +0:31 move second child to first child ( temp 2-component vector of int) +0:31 'r12' ( temp 2-component vector of int) +0:31 max ( temp 2-component vector of int) +0:31 Convert bool to int ( temp 2-component vector of int) +0:31 b2: direct index for structure ( uniform 2-component vector of bool) +0:31 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:31 Constant: +0:31 7 (const uint) +0:31 i2: direct index for structure ( uniform 2-component vector of int) +0:31 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:31 Constant: +0:31 4 (const uint) +0:32 Sequence +0:32 move second child to first child ( temp 2-component vector of float) +0:32 'r13' ( temp 2-component vector of float) +0:32 max ( temp 2-component vector of float) +0:32 Convert int to float ( temp 2-component vector of float) +0:32 i2: direct index for structure ( uniform 2-component vector of int) +0:32 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:32 Constant: +0:32 4 (const uint) +0:32 f2: direct index for structure ( uniform 2-component vector of float) +0:32 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:32 Constant: +0:32 6 (const uint) +0:33 Sequence +0:33 move second child to first child ( temp 2-component vector of float) +0:33 'r14' ( temp 2-component vector of float) +0:33 max ( temp 2-component vector of float) +0:33 Convert uint to float ( temp 2-component vector of float) +0:33 u2: direct index for structure ( uniform 2-component vector of uint) +0:33 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:33 Constant: +0:33 5 (const uint) +0:33 f2: direct index for structure ( uniform 2-component vector of float) +0:33 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:33 Constant: +0:33 6 (const uint) +0:35 Sequence +0:35 move second child to first child ( temp 2-component vector of float) +0:35 'r20' ( temp 2-component vector of float) +0:35 clamp ( temp 2-component vector of float) +0:35 Convert int to float ( temp 2-component vector of float) +0:35 i2: direct index for structure ( uniform 2-component vector of int) +0:35 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:35 Constant: +0:35 4 (const uint) +0:35 Convert uint to float ( temp 2-component vector of float) +0:35 u2: direct index for structure ( uniform 2-component vector of uint) +0:35 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:35 Constant: +0:35 5 (const uint) +0:35 f2: direct index for structure ( uniform 2-component vector of float) +0:35 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:35 Constant: +0:35 6 (const uint) +0:36 Sequence +0:36 move second child to first child ( temp 2-component vector of uint) +0:36 'r21' ( temp 2-component vector of uint) +0:36 clamp ( temp 2-component vector of uint) +0:36 Convert bool to uint ( temp 2-component vector of uint) +0:36 b2: direct index for structure ( uniform 2-component vector of bool) +0:36 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:36 Constant: +0:36 7 (const uint) +0:36 u2: direct index for structure ( uniform 2-component vector of uint) +0:36 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:36 Constant: +0:36 5 (const uint) +0:36 Convert bool to uint ( temp 2-component vector of uint) +0:36 b2: direct index for structure ( uniform 2-component vector of bool) +0:36 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:36 Constant: +0:36 7 (const uint) +0:37 Sequence +0:37 move second child to first child ( temp 2-component vector of float) +0:37 'r22' ( temp 2-component vector of float) +0:37 clamp ( temp 2-component vector of float) +0:37 Convert bool to float ( temp 2-component vector of float) +0:37 b2: direct index for structure ( uniform 2-component vector of bool) +0:37 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:37 Constant: +0:37 7 (const uint) +0:37 f2: direct index for structure ( uniform 2-component vector of float) +0:37 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:37 Constant: +0:37 6 (const uint) +0:37 Convert bool to float ( temp 2-component vector of float) +0:37 b2: direct index for structure ( uniform 2-component vector of bool) +0:37 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:37 Constant: +0:37 7 (const uint) +0:40 Sequence +0:40 move second child to first child ( temp 2-component vector of float) +0:40 'r30' ( temp 2-component vector of float) +0:40 max ( temp 2-component vector of float) +0:40 Construct vec2 ( in 2-component vector of float) +0:40 Convert bool to float ( temp float) +0:40 b: direct index for structure ( uniform bool) +0:40 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:40 Constant: +0:40 3 (const uint) +0:40 f2: direct index for structure ( uniform 2-component vector of float) +0:40 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:40 Constant: +0:40 6 (const uint) +0:41 Sequence +0:41 move second child to first child ( temp 2-component vector of uint) +0:41 'r31' ( temp 2-component vector of uint) +0:41 max ( temp 2-component vector of uint) +0:41 Construct uvec2 ( in 2-component vector of uint) +0:41 Convert bool to uint ( temp uint) +0:41 b: direct index for structure ( uniform bool) +0:41 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:41 Constant: +0:41 3 (const uint) +0:41 u2: direct index for structure ( uniform 2-component vector of uint) +0:41 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:41 Constant: +0:41 5 (const uint) +0:42 Sequence +0:42 move second child to first child ( temp 2-component vector of int) +0:42 'r32' ( temp 2-component vector of int) +0:42 max ( temp 2-component vector of int) +0:42 Construct ivec2 ( in 2-component vector of int) +0:42 Convert bool to int ( temp int) +0:42 b: direct index for structure ( uniform bool) +0:42 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:42 Constant: +0:42 3 (const uint) +0:42 i2: direct index for structure ( uniform 2-component vector of int) +0:42 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:42 Constant: +0:42 4 (const uint) +0:43 Sequence +0:43 move second child to first child ( temp 2-component vector of float) +0:43 'r33' ( temp 2-component vector of float) +0:43 max ( temp 2-component vector of float) +0:43 Construct vec2 ( in 2-component vector of float) +0:43 Convert int to float ( temp float) +0:43 i: direct index for structure ( uniform int) +0:43 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:43 Constant: +0:43 0 (const uint) +0:43 f2: direct index for structure ( uniform 2-component vector of float) +0:43 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:43 Constant: +0:43 6 (const uint) +0:44 Sequence +0:44 move second child to first child ( temp 2-component vector of float) +0:44 'r34' ( temp 2-component vector of float) +0:44 max ( temp 2-component vector of float) +0:44 Construct vec2 ( in 2-component vector of float) +0:44 Convert uint to float ( temp float) +0:44 u: direct index for structure ( uniform uint) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:44 Constant: +0:44 1 (const uint) +0:44 f2: direct index for structure ( uniform 2-component vector of float) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:44 Constant: +0:44 6 (const uint) +0:46 Sequence +0:46 move second child to first child ( temp 2-component vector of float) +0:46 'r40' ( temp 2-component vector of float) +0:46 clamp ( temp 2-component vector of float) +0:46 Construct vec2 ( in 2-component vector of float) +0:46 Convert int to float ( temp float) +0:46 i: direct index for structure ( uniform int) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:46 Constant: +0:46 0 (const uint) +0:46 Convert uint to float ( temp 2-component vector of float) +0:46 u2: direct index for structure ( uniform 2-component vector of uint) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:46 Constant: +0:46 5 (const uint) +0:46 f2: direct index for structure ( uniform 2-component vector of float) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:46 Constant: +0:46 6 (const uint) +0:47 Sequence +0:47 move second child to first child ( temp 2-component vector of uint) +0:47 'r41' ( temp 2-component vector of uint) +0:47 clamp ( temp 2-component vector of uint) +0:47 Convert bool to uint ( temp 2-component vector of uint) +0:47 b2: direct index for structure ( uniform 2-component vector of bool) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:47 Constant: +0:47 7 (const uint) +0:47 Construct uvec2 ( in 2-component vector of uint) +0:47 u: direct index for structure ( uniform uint) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:47 Constant: +0:47 1 (const uint) +0:47 Convert bool to uint ( temp 2-component vector of uint) +0:47 b2: direct index for structure ( uniform 2-component vector of bool) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:47 Constant: +0:47 7 (const uint) +0:48 Sequence +0:48 move second child to first child ( temp 2-component vector of float) +0:48 'r42' ( temp 2-component vector of float) +0:48 clamp ( temp 2-component vector of float) +0:48 Convert bool to float ( temp 2-component vector of float) +0:48 b2: direct index for structure ( uniform 2-component vector of bool) +0:48 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:48 Constant: +0:48 7 (const uint) +0:48 Construct vec2 ( in 2-component vector of float) +0:48 f: direct index for structure ( uniform float) +0:48 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:48 Constant: +0:48 2 (const uint) +0:48 Construct vec2 ( in 2-component vector of float) +0:48 Convert bool to float ( temp float) +0:48 b: direct index for structure ( uniform bool) +0:48 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:48 Constant: +0:48 3 (const uint) +0:49 Sequence +0:49 move second child to first child ( temp 2-component vector of int) +0:49 'r43' ( temp 2-component vector of int) +0:49 Convert uint to int ( temp 2-component vector of int) +0:49 clamp ( temp 2-component vector of uint) +0:49 Construct uvec2 ( in 2-component vector of uint) +0:49 Convert int to uint ( temp uint) +0:49 i: direct index for structure ( uniform int) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:49 Constant: +0:49 0 (const uint) +0:49 Convert int to uint ( temp 2-component vector of uint) +0:49 i2: direct index for structure ( uniform 2-component vector of int) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:49 Constant: +0:49 4 (const uint) +0:49 u2: direct index for structure ( uniform 2-component vector of uint) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:49 Constant: +0:49 5 (const uint) +0:51 Sequence +0:51 move second child to first child ( temp float) +0:51 'r50' ( temp float) +0:51 Construct float ( temp float) +0:? textureFetch ( temp 4-component vector of float) +0:51 'g_tTexbfs' (layout( r32f) uniform textureBuffer) +0:51 Convert uint to int ( temp int) +0:51 upos: direct index for structure ( uniform uint) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:51 Constant: +0:51 8 (const uint) +0:52 Sequence +0:52 move second child to first child ( temp float) +0:52 'r51' ( temp float) +0:52 Construct float ( temp float) +0:? textureFetch ( temp 4-component vector of float) +0:52 'g_tTexbfs' (layout( r32f) uniform textureBuffer) +0:52 Convert float to int ( temp int) +0:52 fpos: direct index for structure ( uniform float) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:52 Constant: +0:52 9 (const uint) +0:70 Sequence +0:70 move second child to first child ( temp uint) +0:70 'sizeQueryTemp' ( temp uint) +0:70 textureSize ( temp uint) +0:70 'g_tTex1df4' ( uniform texture1D) +0:70 Constant: +0:70 0 (const int) +0:70 move second child to first child ( temp int) +0:70 'WidthI' ( temp int) +0:70 Convert uint to int ( temp int) +0:70 'sizeQueryTemp' ( temp uint) +0:71 Sequence +0:71 move second child to first child ( temp uint) +0:71 'sizeQueryTemp' ( temp uint) +0:71 textureSize ( temp uint) +0:71 'g_tTex1df4' ( uniform texture1D) +0:71 Constant: +0:71 6 (const uint) +0:71 move second child to first child ( temp int) +0:71 'WidthI' ( temp int) +0:71 Convert uint to int ( temp int) +0:71 'sizeQueryTemp' ( temp uint) +0:71 move second child to first child ( temp uint) +0:71 'NumberOfLevelsU' ( temp uint) +0:71 textureQueryLevels ( temp uint) +0:71 'g_tTex1df4' ( uniform texture1D) +0:72 Sequence +0:72 move second child to first child ( temp uint) +0:72 'sizeQueryTemp' ( temp uint) +0:72 textureSize ( temp uint) +0:72 'g_tTex1df4' ( uniform texture1D) +0:72 Constant: +0:72 6 (const uint) +0:72 move second child to first child ( temp uint) +0:72 'WidthU' ( temp uint) +0:72 'sizeQueryTemp' ( temp uint) +0:72 move second child to first child ( temp int) +0:72 'NumberOfLevelsI' ( temp int) +0:72 Convert uint to int ( temp int) +0:72 textureQueryLevels ( temp uint) +0:72 'g_tTex1df4' ( uniform texture1D) +0:73 Sequence +0:73 move second child to first child ( temp uint) +0:73 'sizeQueryTemp' ( temp uint) +0:73 textureSize ( temp uint) +0:73 'g_tTex1df4' ( uniform texture1D) +0:73 Constant: +0:73 6 (const uint) +0:73 move second child to first child ( temp int) +0:73 'WidthI' ( temp int) +0:73 Convert uint to int ( temp int) +0:73 'sizeQueryTemp' ( temp uint) +0:73 move second child to first child ( temp int) +0:73 'NumberOfLevelsI' ( temp int) +0:73 Convert uint to int ( temp int) +0:73 textureQueryLevels ( temp uint) +0:73 'g_tTex1df4' ( uniform texture1D) +0:77 move second child to first child ( temp 4-component vector of float) +0:77 color: direct index for structure ( temp 4-component vector of float) +0:77 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:77 Constant: +0:77 0 (const int) +0:77 Construct vec4 ( temp 4-component vector of float) +0:77 'r00' ( temp float) +0:78 Branch: Return with expression +0:78 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:20 color: direct index for structure ( temp 4-component vector of float) +0:20 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:20 Constant: +0:20 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:? 'g_tTexbfs' (layout( r32f) uniform textureBuffer) +0:? 'g_tTex1df4' ( uniform texture1D) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 322 + + Capability Shader + Capability Sampled1D + Capability SampledBuffer + Capability ImageQuery + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 319 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "color" + Name 10 "@main(" + Name 13 "r00" + Name 19 "$Global" + MemberName 19($Global) 0 "i" + MemberName 19($Global) 1 "u" + MemberName 19($Global) 2 "f" + MemberName 19($Global) 3 "b" + MemberName 19($Global) 4 "i2" + MemberName 19($Global) 5 "u2" + MemberName 19($Global) 6 "f2" + MemberName 19($Global) 7 "b2" + MemberName 19($Global) 8 "upos" + MemberName 19($Global) 9 "fpos" + Name 21 "" + Name 38 "r01" + Name 49 "r02" + Name 59 "r03" + Name 66 "r04" + Name 74 "r10" + Name 91 "r11" + Name 102 "r12" + Name 114 "r13" + Name 121 "r14" + Name 128 "r20" + Name 138 "r21" + Name 150 "r22" + Name 162 "r30" + Name 171 "r31" + Name 180 "r32" + Name 189 "r33" + Name 197 "r34" + Name 205 "r40" + Name 216 "r41" + Name 229 "r42" + Name 243 "r43" + Name 255 "r50" + Name 258 "g_tTexbfs" + Name 266 "r51" + Name 274 "sizeQueryTemp" + Name 277 "g_tTex1df4" + Name 280 "WidthI" + Name 283 "sizeQueryTemp" + Name 289 "NumberOfLevelsU" + Name 292 "sizeQueryTemp" + Name 295 "WidthU" + Name 297 "NumberOfLevelsI" + Name 301 "sizeQueryTemp" + Name 310 "ps_output" + Name 319 "@entryPointOutput.color" + MemberDecorate 19($Global) 0 Offset 0 + MemberDecorate 19($Global) 1 Offset 4 + MemberDecorate 19($Global) 2 Offset 8 + MemberDecorate 19($Global) 3 Offset 12 + MemberDecorate 19($Global) 4 Offset 16 + MemberDecorate 19($Global) 5 Offset 24 + MemberDecorate 19($Global) 6 Offset 32 + MemberDecorate 19($Global) 7 Offset 40 + MemberDecorate 19($Global) 8 Offset 48 + MemberDecorate 19($Global) 9 Offset 52 + Decorate 19($Global) Block + Decorate 21 DescriptorSet 0 + Decorate 258(g_tTexbfs) DescriptorSet 0 + Decorate 277(g_tTex1df4) DescriptorSet 0 + Decorate 319(@entryPointOutput.color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 6(float) + 14: TypeInt 32 1 + 15: TypeInt 32 0 + 16: TypeVector 14(int) 2 + 17: TypeVector 15(int) 2 + 18: TypeVector 6(float) 2 + 19($Global): TypeStruct 14(int) 15(int) 6(float) 15(int) 16(ivec2) 17(ivec2) 18(fvec2) 17(ivec2) 15(int) 6(float) + 20: TypePointer Uniform 19($Global) + 21: 20(ptr) Variable Uniform + 22: 14(int) Constant 3 + 23: TypePointer Uniform 15(int) + 26: TypeBool + 27: 15(int) Constant 0 + 29: 6(float) Constant 0 + 30: 6(float) Constant 1065353216 + 32: 14(int) Constant 2 + 33: TypePointer Uniform 6(float) + 37: TypePointer Function 15(int) + 42: 15(int) Constant 1 + 44: 14(int) Constant 1 + 48: TypePointer Function 14(int) + 53: 14(int) Constant 0 + 55: TypePointer Uniform 14(int) + 73: TypePointer Function 18(fvec2) + 75: 14(int) Constant 7 + 76: TypePointer Uniform 17(ivec2) + 79: TypeVector 26(bool) 2 + 80: 17(ivec2) ConstantComposite 27 27 + 82: 18(fvec2) ConstantComposite 29 29 + 83: 18(fvec2) ConstantComposite 30 30 + 85: 14(int) Constant 6 + 86: TypePointer Uniform 18(fvec2) + 90: TypePointer Function 17(ivec2) + 95: 17(ivec2) ConstantComposite 42 42 + 97: 14(int) Constant 5 + 101: TypePointer Function 16(ivec2) + 106: 16(ivec2) ConstantComposite 53 53 + 107: 16(ivec2) ConstantComposite 44 44 + 109: 14(int) Constant 4 + 110: TypePointer Uniform 16(ivec2) + 256: TypeImage 6(float) Buffer sampled format:R32f + 257: TypePointer UniformConstant 256 + 258(g_tTexbfs): 257(ptr) Variable UniformConstant + 260: 14(int) Constant 8 + 268: 14(int) Constant 9 + 275: TypeImage 6(float) 1D sampled format:Unknown + 276: TypePointer UniformConstant 275 + 277(g_tTex1df4): 276(ptr) Variable UniformConstant + 285: 15(int) Constant 6 + 309: TypePointer Function 8(PS_OUTPUT) + 313: TypePointer Function 7(fvec4) + 318: TypePointer Output 7(fvec4) +319(@entryPointOutput.color): 318(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 320:8(PS_OUTPUT) FunctionCall 10(@main() + 321: 7(fvec4) CompositeExtract 320 0 + Store 319(@entryPointOutput.color) 321 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(r00): 12(ptr) Variable Function + 38(r01): 37(ptr) Variable Function + 49(r02): 48(ptr) Variable Function + 59(r03): 12(ptr) Variable Function + 66(r04): 12(ptr) Variable Function + 74(r10): 73(ptr) Variable Function + 91(r11): 90(ptr) Variable Function + 102(r12): 101(ptr) Variable Function + 114(r13): 73(ptr) Variable Function + 121(r14): 73(ptr) Variable Function + 128(r20): 73(ptr) Variable Function + 138(r21): 90(ptr) Variable Function + 150(r22): 73(ptr) Variable Function + 162(r30): 73(ptr) Variable Function + 171(r31): 90(ptr) Variable Function + 180(r32): 101(ptr) Variable Function + 189(r33): 73(ptr) Variable Function + 197(r34): 73(ptr) Variable Function + 205(r40): 73(ptr) Variable Function + 216(r41): 90(ptr) Variable Function + 229(r42): 73(ptr) Variable Function + 243(r43): 101(ptr) Variable Function + 255(r50): 12(ptr) Variable Function + 266(r51): 12(ptr) Variable Function +274(sizeQueryTemp): 37(ptr) Variable Function + 280(WidthI): 48(ptr) Variable Function +283(sizeQueryTemp): 37(ptr) Variable Function +289(NumberOfLevelsU): 37(ptr) Variable Function +292(sizeQueryTemp): 37(ptr) Variable Function + 295(WidthU): 37(ptr) Variable Function +297(NumberOfLevelsI): 48(ptr) Variable Function +301(sizeQueryTemp): 37(ptr) Variable Function + 310(ps_output): 309(ptr) Variable Function + 24: 23(ptr) AccessChain 21 22 + 25: 15(int) Load 24 + 28: 26(bool) INotEqual 25 27 + 31: 6(float) Select 28 30 29 + 34: 33(ptr) AccessChain 21 32 + 35: 6(float) Load 34 + 36: 6(float) ExtInst 1(GLSL.std.450) 40(FMax) 31 35 + Store 13(r00) 36 + 39: 23(ptr) AccessChain 21 22 + 40: 15(int) Load 39 + 41: 26(bool) INotEqual 40 27 + 43: 15(int) Select 41 42 27 + 45: 23(ptr) AccessChain 21 44 + 46: 15(int) Load 45 + 47: 15(int) ExtInst 1(GLSL.std.450) 41(UMax) 43 46 + Store 38(r01) 47 + 50: 23(ptr) AccessChain 21 22 + 51: 15(int) Load 50 + 52: 26(bool) INotEqual 51 27 + 54: 14(int) Select 52 44 53 + 56: 55(ptr) AccessChain 21 53 + 57: 14(int) Load 56 + 58: 14(int) ExtInst 1(GLSL.std.450) 42(SMax) 54 57 + Store 49(r02) 58 + 60: 55(ptr) AccessChain 21 53 + 61: 14(int) Load 60 + 62: 6(float) ConvertSToF 61 + 63: 33(ptr) AccessChain 21 32 + 64: 6(float) Load 63 + 65: 6(float) ExtInst 1(GLSL.std.450) 40(FMax) 62 64 + Store 59(r03) 65 + 67: 23(ptr) AccessChain 21 44 + 68: 15(int) Load 67 + 69: 6(float) ConvertUToF 68 + 70: 33(ptr) AccessChain 21 32 + 71: 6(float) Load 70 + 72: 6(float) ExtInst 1(GLSL.std.450) 40(FMax) 69 71 + Store 66(r04) 72 + 77: 76(ptr) AccessChain 21 75 + 78: 17(ivec2) Load 77 + 81: 79(bvec2) INotEqual 78 80 + 84: 18(fvec2) Select 81 83 82 + 87: 86(ptr) AccessChain 21 85 + 88: 18(fvec2) Load 87 + 89: 18(fvec2) ExtInst 1(GLSL.std.450) 40(FMax) 84 88 + Store 74(r10) 89 + 92: 76(ptr) AccessChain 21 75 + 93: 17(ivec2) Load 92 + 94: 79(bvec2) INotEqual 93 80 + 96: 17(ivec2) Select 94 95 80 + 98: 76(ptr) AccessChain 21 97 + 99: 17(ivec2) Load 98 + 100: 17(ivec2) ExtInst 1(GLSL.std.450) 41(UMax) 96 99 + Store 91(r11) 100 + 103: 76(ptr) AccessChain 21 75 + 104: 17(ivec2) Load 103 + 105: 79(bvec2) INotEqual 104 80 + 108: 16(ivec2) Select 105 107 106 + 111: 110(ptr) AccessChain 21 109 + 112: 16(ivec2) Load 111 + 113: 16(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 108 112 + Store 102(r12) 113 + 115: 110(ptr) AccessChain 21 109 + 116: 16(ivec2) Load 115 + 117: 18(fvec2) ConvertSToF 116 + 118: 86(ptr) AccessChain 21 85 + 119: 18(fvec2) Load 118 + 120: 18(fvec2) ExtInst 1(GLSL.std.450) 40(FMax) 117 119 + Store 114(r13) 120 + 122: 76(ptr) AccessChain 21 97 + 123: 17(ivec2) Load 122 + 124: 18(fvec2) ConvertUToF 123 + 125: 86(ptr) AccessChain 21 85 + 126: 18(fvec2) Load 125 + 127: 18(fvec2) ExtInst 1(GLSL.std.450) 40(FMax) 124 126 + Store 121(r14) 127 + 129: 110(ptr) AccessChain 21 109 + 130: 16(ivec2) Load 129 + 131: 18(fvec2) ConvertSToF 130 + 132: 76(ptr) AccessChain 21 97 + 133: 17(ivec2) Load 132 + 134: 18(fvec2) ConvertUToF 133 + 135: 86(ptr) AccessChain 21 85 + 136: 18(fvec2) Load 135 + 137: 18(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 131 134 136 + Store 128(r20) 137 + 139: 76(ptr) AccessChain 21 75 + 140: 17(ivec2) Load 139 + 141: 79(bvec2) INotEqual 140 80 + 142: 17(ivec2) Select 141 95 80 + 143: 76(ptr) AccessChain 21 97 + 144: 17(ivec2) Load 143 + 145: 76(ptr) AccessChain 21 75 + 146: 17(ivec2) Load 145 + 147: 79(bvec2) INotEqual 146 80 + 148: 17(ivec2) Select 147 95 80 + 149: 17(ivec2) ExtInst 1(GLSL.std.450) 44(UClamp) 142 144 148 + Store 138(r21) 149 + 151: 76(ptr) AccessChain 21 75 + 152: 17(ivec2) Load 151 + 153: 79(bvec2) INotEqual 152 80 + 154: 18(fvec2) Select 153 83 82 + 155: 86(ptr) AccessChain 21 85 + 156: 18(fvec2) Load 155 + 157: 76(ptr) AccessChain 21 75 + 158: 17(ivec2) Load 157 + 159: 79(bvec2) INotEqual 158 80 + 160: 18(fvec2) Select 159 83 82 + 161: 18(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 154 156 160 + Store 150(r22) 161 + 163: 23(ptr) AccessChain 21 22 + 164: 15(int) Load 163 + 165: 26(bool) INotEqual 164 27 + 166: 6(float) Select 165 30 29 + 167: 18(fvec2) CompositeConstruct 166 166 + 168: 86(ptr) AccessChain 21 85 + 169: 18(fvec2) Load 168 + 170: 18(fvec2) ExtInst 1(GLSL.std.450) 40(FMax) 167 169 + Store 162(r30) 170 + 172: 23(ptr) AccessChain 21 22 + 173: 15(int) Load 172 + 174: 26(bool) INotEqual 173 27 + 175: 15(int) Select 174 42 27 + 176: 17(ivec2) CompositeConstruct 175 175 + 177: 76(ptr) AccessChain 21 97 + 178: 17(ivec2) Load 177 + 179: 17(ivec2) ExtInst 1(GLSL.std.450) 41(UMax) 176 178 + Store 171(r31) 179 + 181: 23(ptr) AccessChain 21 22 + 182: 15(int) Load 181 + 183: 26(bool) INotEqual 182 27 + 184: 14(int) Select 183 44 53 + 185: 16(ivec2) CompositeConstruct 184 184 + 186: 110(ptr) AccessChain 21 109 + 187: 16(ivec2) Load 186 + 188: 16(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 185 187 + Store 180(r32) 188 + 190: 55(ptr) AccessChain 21 53 + 191: 14(int) Load 190 + 192: 6(float) ConvertSToF 191 + 193: 18(fvec2) CompositeConstruct 192 192 + 194: 86(ptr) AccessChain 21 85 + 195: 18(fvec2) Load 194 + 196: 18(fvec2) ExtInst 1(GLSL.std.450) 40(FMax) 193 195 + Store 189(r33) 196 + 198: 23(ptr) AccessChain 21 44 + 199: 15(int) Load 198 + 200: 6(float) ConvertUToF 199 + 201: 18(fvec2) CompositeConstruct 200 200 + 202: 86(ptr) AccessChain 21 85 + 203: 18(fvec2) Load 202 + 204: 18(fvec2) ExtInst 1(GLSL.std.450) 40(FMax) 201 203 + Store 197(r34) 204 + 206: 55(ptr) AccessChain 21 53 + 207: 14(int) Load 206 + 208: 6(float) ConvertSToF 207 + 209: 18(fvec2) CompositeConstruct 208 208 + 210: 76(ptr) AccessChain 21 97 + 211: 17(ivec2) Load 210 + 212: 18(fvec2) ConvertUToF 211 + 213: 86(ptr) AccessChain 21 85 + 214: 18(fvec2) Load 213 + 215: 18(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 209 212 214 + Store 205(r40) 215 + 217: 76(ptr) AccessChain 21 75 + 218: 17(ivec2) Load 217 + 219: 79(bvec2) INotEqual 218 80 + 220: 17(ivec2) Select 219 95 80 + 221: 23(ptr) AccessChain 21 44 + 222: 15(int) Load 221 + 223: 17(ivec2) CompositeConstruct 222 222 + 224: 76(ptr) AccessChain 21 75 + 225: 17(ivec2) Load 224 + 226: 79(bvec2) INotEqual 225 80 + 227: 17(ivec2) Select 226 95 80 + 228: 17(ivec2) ExtInst 1(GLSL.std.450) 44(UClamp) 220 223 227 + Store 216(r41) 228 + 230: 76(ptr) AccessChain 21 75 + 231: 17(ivec2) Load 230 + 232: 79(bvec2) INotEqual 231 80 + 233: 18(fvec2) Select 232 83 82 + 234: 33(ptr) AccessChain 21 32 + 235: 6(float) Load 234 + 236: 18(fvec2) CompositeConstruct 235 235 + 237: 23(ptr) AccessChain 21 22 + 238: 15(int) Load 237 + 239: 26(bool) INotEqual 238 27 + 240: 6(float) Select 239 30 29 + 241: 18(fvec2) CompositeConstruct 240 240 + 242: 18(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 233 236 241 + Store 229(r42) 242 + 244: 55(ptr) AccessChain 21 53 + 245: 14(int) Load 244 + 246: 15(int) Bitcast 245 + 247: 17(ivec2) CompositeConstruct 246 246 + 248: 110(ptr) AccessChain 21 109 + 249: 16(ivec2) Load 248 + 250: 17(ivec2) Bitcast 249 + 251: 76(ptr) AccessChain 21 97 + 252: 17(ivec2) Load 251 + 253: 17(ivec2) ExtInst 1(GLSL.std.450) 44(UClamp) 247 250 252 + 254: 16(ivec2) Bitcast 253 + Store 243(r43) 254 + 259: 256 Load 258(g_tTexbfs) + 261: 23(ptr) AccessChain 21 260 + 262: 15(int) Load 261 + 263: 14(int) Bitcast 262 + 264: 7(fvec4) ImageFetch 259 263 + 265: 6(float) CompositeExtract 264 0 + Store 255(r50) 265 + 267: 256 Load 258(g_tTexbfs) + 269: 33(ptr) AccessChain 21 268 + 270: 6(float) Load 269 + 271: 14(int) ConvertFToS 270 + 272: 7(fvec4) ImageFetch 267 271 + 273: 6(float) CompositeExtract 272 0 + Store 266(r51) 273 + 278: 275 Load 277(g_tTex1df4) + 279: 15(int) ImageQuerySizeLod 278 53 + Store 274(sizeQueryTemp) 279 + 281: 15(int) Load 274(sizeQueryTemp) + 282: 14(int) Bitcast 281 + Store 280(WidthI) 282 + 284: 275 Load 277(g_tTex1df4) + 286: 15(int) ImageQuerySizeLod 284 285 + Store 283(sizeQueryTemp) 286 + 287: 15(int) Load 283(sizeQueryTemp) + 288: 14(int) Bitcast 287 + Store 280(WidthI) 288 + 290: 275 Load 277(g_tTex1df4) + 291: 15(int) ImageQueryLevels 290 + Store 289(NumberOfLevelsU) 291 + 293: 275 Load 277(g_tTex1df4) + 294: 15(int) ImageQuerySizeLod 293 285 + Store 292(sizeQueryTemp) 294 + 296: 15(int) Load 292(sizeQueryTemp) + Store 295(WidthU) 296 + 298: 275 Load 277(g_tTex1df4) + 299: 15(int) ImageQueryLevels 298 + 300: 14(int) Bitcast 299 + Store 297(NumberOfLevelsI) 300 + 302: 275 Load 277(g_tTex1df4) + 303: 15(int) ImageQuerySizeLod 302 285 + Store 301(sizeQueryTemp) 303 + 304: 15(int) Load 301(sizeQueryTemp) + 305: 14(int) Bitcast 304 + Store 280(WidthI) 305 + 306: 275 Load 277(g_tTex1df4) + 307: 15(int) ImageQueryLevels 306 + 308: 14(int) Bitcast 307 + Store 297(NumberOfLevelsI) 308 + 311: 6(float) Load 13(r00) + 312: 7(fvec4) CompositeConstruct 311 311 311 311 + 314: 313(ptr) AccessChain 310(ps_output) 53 + Store 314 312 + 315:8(PS_OUTPUT) Load 310(ps_output) + ReturnValue 315 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.promote.outputs.frag.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.promote.outputs.frag.out new file mode 100644 index 00000000..57dfafc4 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.promote.outputs.frag.out @@ -0,0 +1,354 @@ +hlsl.intrinsics.promote.outputs.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:20 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:20 Function Parameters: +0:? Sequence +0:37 clamp ( temp float) +0:37 fpos: direct index for structure ( uniform float) +0:37 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:37 Constant: +0:37 9 (const uint) +0:37 Constant: +0:37 0.000000 +0:37 Constant: +0:37 1.000000 +0:40 Sequence +0:40 move second child to first child ( temp uint) +0:40 'sizeQueryTemp' ( temp uint) +0:40 textureSize ( temp uint) +0:40 'g_tTex1df4' ( uniform texture1D) +0:40 Constant: +0:40 0 (const int) +0:40 move second child to first child ( temp int) +0:40 'WidthI' ( temp int) +0:40 Convert uint to int ( temp int) +0:40 'sizeQueryTemp' ( temp uint) +0:41 Sequence +0:41 move second child to first child ( temp uint) +0:41 'sizeQueryTemp' ( temp uint) +0:41 textureSize ( temp uint) +0:41 'g_tTex1df4' ( uniform texture1D) +0:41 Constant: +0:41 6 (const uint) +0:41 move second child to first child ( temp int) +0:41 'WidthI' ( temp int) +0:41 Convert uint to int ( temp int) +0:41 'sizeQueryTemp' ( temp uint) +0:41 move second child to first child ( temp uint) +0:41 'NumberOfLevelsU' ( temp uint) +0:41 textureQueryLevels ( temp uint) +0:41 'g_tTex1df4' ( uniform texture1D) +0:42 Sequence +0:42 move second child to first child ( temp uint) +0:42 'sizeQueryTemp' ( temp uint) +0:42 textureSize ( temp uint) +0:42 'g_tTex1df4' ( uniform texture1D) +0:42 Constant: +0:42 6 (const uint) +0:42 move second child to first child ( temp uint) +0:42 'WidthU' ( temp uint) +0:42 'sizeQueryTemp' ( temp uint) +0:42 move second child to first child ( temp int) +0:42 'NumberOfLevelsI' ( temp int) +0:42 Convert uint to int ( temp int) +0:42 textureQueryLevels ( temp uint) +0:42 'g_tTex1df4' ( uniform texture1D) +0:43 Sequence +0:43 move second child to first child ( temp uint) +0:43 'sizeQueryTemp' ( temp uint) +0:43 textureSize ( temp uint) +0:43 'g_tTex1df4' ( uniform texture1D) +0:43 Constant: +0:43 6 (const uint) +0:43 move second child to first child ( temp int) +0:43 'WidthI' ( temp int) +0:43 Convert uint to int ( temp int) +0:43 'sizeQueryTemp' ( temp uint) +0:43 move second child to first child ( temp int) +0:43 'NumberOfLevelsI' ( temp int) +0:43 Convert uint to int ( temp int) +0:43 textureQueryLevels ( temp uint) +0:43 'g_tTex1df4' ( uniform texture1D) +0:47 move second child to first child ( temp 4-component vector of float) +0:47 color: direct index for structure ( temp 4-component vector of float) +0:47 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 0.000000 +0:47 0.000000 +0:47 0.000000 +0:47 0.000000 +0:48 Branch: Return with expression +0:48 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:20 color: direct index for structure ( temp 4-component vector of float) +0:20 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:20 Constant: +0:20 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:? 'g_tTexbfs' (layout( r32f) uniform textureBuffer) +0:? 'g_tTex1df4' ( uniform texture1D) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:20 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:20 Function Parameters: +0:? Sequence +0:37 clamp ( temp float) +0:37 fpos: direct index for structure ( uniform float) +0:37 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:37 Constant: +0:37 9 (const uint) +0:37 Constant: +0:37 0.000000 +0:37 Constant: +0:37 1.000000 +0:40 Sequence +0:40 move second child to first child ( temp uint) +0:40 'sizeQueryTemp' ( temp uint) +0:40 textureSize ( temp uint) +0:40 'g_tTex1df4' ( uniform texture1D) +0:40 Constant: +0:40 0 (const int) +0:40 move second child to first child ( temp int) +0:40 'WidthI' ( temp int) +0:40 Convert uint to int ( temp int) +0:40 'sizeQueryTemp' ( temp uint) +0:41 Sequence +0:41 move second child to first child ( temp uint) +0:41 'sizeQueryTemp' ( temp uint) +0:41 textureSize ( temp uint) +0:41 'g_tTex1df4' ( uniform texture1D) +0:41 Constant: +0:41 6 (const uint) +0:41 move second child to first child ( temp int) +0:41 'WidthI' ( temp int) +0:41 Convert uint to int ( temp int) +0:41 'sizeQueryTemp' ( temp uint) +0:41 move second child to first child ( temp uint) +0:41 'NumberOfLevelsU' ( temp uint) +0:41 textureQueryLevels ( temp uint) +0:41 'g_tTex1df4' ( uniform texture1D) +0:42 Sequence +0:42 move second child to first child ( temp uint) +0:42 'sizeQueryTemp' ( temp uint) +0:42 textureSize ( temp uint) +0:42 'g_tTex1df4' ( uniform texture1D) +0:42 Constant: +0:42 6 (const uint) +0:42 move second child to first child ( temp uint) +0:42 'WidthU' ( temp uint) +0:42 'sizeQueryTemp' ( temp uint) +0:42 move second child to first child ( temp int) +0:42 'NumberOfLevelsI' ( temp int) +0:42 Convert uint to int ( temp int) +0:42 textureQueryLevels ( temp uint) +0:42 'g_tTex1df4' ( uniform texture1D) +0:43 Sequence +0:43 move second child to first child ( temp uint) +0:43 'sizeQueryTemp' ( temp uint) +0:43 textureSize ( temp uint) +0:43 'g_tTex1df4' ( uniform texture1D) +0:43 Constant: +0:43 6 (const uint) +0:43 move second child to first child ( temp int) +0:43 'WidthI' ( temp int) +0:43 Convert uint to int ( temp int) +0:43 'sizeQueryTemp' ( temp uint) +0:43 move second child to first child ( temp int) +0:43 'NumberOfLevelsI' ( temp int) +0:43 Convert uint to int ( temp int) +0:43 textureQueryLevels ( temp uint) +0:43 'g_tTex1df4' ( uniform texture1D) +0:47 move second child to first child ( temp 4-component vector of float) +0:47 color: direct index for structure ( temp 4-component vector of float) +0:47 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 0.000000 +0:47 0.000000 +0:47 0.000000 +0:47 0.000000 +0:48 Branch: Return with expression +0:48 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:20 color: direct index for structure ( temp 4-component vector of float) +0:20 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:20 Constant: +0:20 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int i, uniform uint u, uniform float f, uniform bool b, uniform 2-component vector of int i2, uniform 2-component vector of uint u2, uniform 2-component vector of float f2, uniform 2-component vector of bool b2, uniform uint upos, uniform float fpos}) +0:? 'g_tTexbfs' (layout( r32f) uniform textureBuffer) +0:? 'g_tTex1df4' ( uniform texture1D) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 80 + + Capability Shader + Capability Sampled1D + Capability SampledBuffer + Capability ImageQuery + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 74 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "color" + Name 10 "@main(" + Name 17 "$Global" + MemberName 17($Global) 0 "i" + MemberName 17($Global) 1 "u" + MemberName 17($Global) 2 "f" + MemberName 17($Global) 3 "b" + MemberName 17($Global) 4 "i2" + MemberName 17($Global) 5 "u2" + MemberName 17($Global) 6 "f2" + MemberName 17($Global) 7 "b2" + MemberName 17($Global) 8 "upos" + MemberName 17($Global) 9 "fpos" + Name 19 "" + Name 28 "sizeQueryTemp" + Name 31 "g_tTex1df4" + Name 36 "WidthI" + Name 39 "sizeQueryTemp" + Name 45 "NumberOfLevelsU" + Name 48 "sizeQueryTemp" + Name 51 "WidthU" + Name 53 "NumberOfLevelsI" + Name 57 "sizeQueryTemp" + Name 66 "ps_output" + Name 74 "@entryPointOutput.color" + Name 79 "g_tTexbfs" + MemberDecorate 17($Global) 0 Offset 0 + MemberDecorate 17($Global) 1 Offset 4 + MemberDecorate 17($Global) 2 Offset 8 + MemberDecorate 17($Global) 3 Offset 12 + MemberDecorate 17($Global) 4 Offset 16 + MemberDecorate 17($Global) 5 Offset 24 + MemberDecorate 17($Global) 6 Offset 32 + MemberDecorate 17($Global) 7 Offset 40 + MemberDecorate 17($Global) 8 Offset 48 + MemberDecorate 17($Global) 9 Offset 52 + Decorate 17($Global) Block + Decorate 19 DescriptorSet 0 + Decorate 31(g_tTex1df4) DescriptorSet 0 + Decorate 74(@entryPointOutput.color) Location 0 + Decorate 79(g_tTexbfs) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeInt 32 1 + 13: TypeInt 32 0 + 14: TypeVector 12(int) 2 + 15: TypeVector 13(int) 2 + 16: TypeVector 6(float) 2 + 17($Global): TypeStruct 12(int) 13(int) 6(float) 13(int) 14(ivec2) 15(ivec2) 16(fvec2) 15(ivec2) 13(int) 6(float) + 18: TypePointer Uniform 17($Global) + 19: 18(ptr) Variable Uniform + 20: 12(int) Constant 9 + 21: TypePointer Uniform 6(float) + 24: 6(float) Constant 0 + 25: 6(float) Constant 1065353216 + 27: TypePointer Function 13(int) + 29: TypeImage 6(float) 1D sampled format:Unknown + 30: TypePointer UniformConstant 29 + 31(g_tTex1df4): 30(ptr) Variable UniformConstant + 33: 12(int) Constant 0 + 35: TypePointer Function 12(int) + 41: 13(int) Constant 6 + 65: TypePointer Function 8(PS_OUTPUT) + 67: 7(fvec4) ConstantComposite 24 24 24 24 + 68: TypePointer Function 7(fvec4) + 73: TypePointer Output 7(fvec4) +74(@entryPointOutput.color): 73(ptr) Variable Output + 77: TypeImage 6(float) Buffer sampled format:R32f + 78: TypePointer UniformConstant 77 + 79(g_tTexbfs): 78(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 75:8(PS_OUTPUT) FunctionCall 10(@main() + 76: 7(fvec4) CompositeExtract 75 0 + Store 74(@entryPointOutput.color) 76 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label +28(sizeQueryTemp): 27(ptr) Variable Function + 36(WidthI): 35(ptr) Variable Function +39(sizeQueryTemp): 27(ptr) Variable Function +45(NumberOfLevelsU): 27(ptr) Variable Function +48(sizeQueryTemp): 27(ptr) Variable Function + 51(WidthU): 27(ptr) Variable Function +53(NumberOfLevelsI): 35(ptr) Variable Function +57(sizeQueryTemp): 27(ptr) Variable Function + 66(ps_output): 65(ptr) Variable Function + 22: 21(ptr) AccessChain 19 20 + 23: 6(float) Load 22 + 26: 6(float) ExtInst 1(GLSL.std.450) 43(FClamp) 23 24 25 + 32: 29 Load 31(g_tTex1df4) + 34: 13(int) ImageQuerySizeLod 32 33 + Store 28(sizeQueryTemp) 34 + 37: 13(int) Load 28(sizeQueryTemp) + 38: 12(int) Bitcast 37 + Store 36(WidthI) 38 + 40: 29 Load 31(g_tTex1df4) + 42: 13(int) ImageQuerySizeLod 40 41 + Store 39(sizeQueryTemp) 42 + 43: 13(int) Load 39(sizeQueryTemp) + 44: 12(int) Bitcast 43 + Store 36(WidthI) 44 + 46: 29 Load 31(g_tTex1df4) + 47: 13(int) ImageQueryLevels 46 + Store 45(NumberOfLevelsU) 47 + 49: 29 Load 31(g_tTex1df4) + 50: 13(int) ImageQuerySizeLod 49 41 + Store 48(sizeQueryTemp) 50 + 52: 13(int) Load 48(sizeQueryTemp) + Store 51(WidthU) 52 + 54: 29 Load 31(g_tTex1df4) + 55: 13(int) ImageQueryLevels 54 + 56: 12(int) Bitcast 55 + Store 53(NumberOfLevelsI) 56 + 58: 29 Load 31(g_tTex1df4) + 59: 13(int) ImageQuerySizeLod 58 41 + Store 57(sizeQueryTemp) 59 + 60: 13(int) Load 57(sizeQueryTemp) + 61: 12(int) Bitcast 60 + Store 36(WidthI) 61 + 62: 29 Load 31(g_tTex1df4) + 63: 13(int) ImageQueryLevels 62 + 64: 12(int) Bitcast 63 + Store 53(NumberOfLevelsI) 64 + 69: 68(ptr) AccessChain 66(ps_output) 33 + Store 69 67 + 70:8(PS_OUTPUT) Load 66(ps_output) + ReturnValue 70 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.vert.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.vert.out new file mode 100644 index 00000000..195e11d6 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.vert.out @@ -0,0 +1,4200 @@ +hlsl.intrinsics.vert +Shader version: 500 +0:? Sequence +0:2 Function Definition: VertexShaderFunctionS(f1;f1;f1;u1;u1; ( temp float) +0:2 Function Parameters: +0:2 'inF0' ( in float) +0:2 'inF1' ( in float) +0:2 'inF2' ( in float) +0:2 'inU0' ( in uint) +0:2 'inU1' ( in uint) +0:? Sequence +0:3 all ( temp bool) +0:3 Convert float to bool ( temp bool) +0:3 'inF0' ( in float) +0:4 Absolute value ( temp float) +0:4 'inF0' ( in float) +0:5 arc cosine ( temp float) +0:5 'inF0' ( in float) +0:6 any ( temp bool) +0:6 Convert float to bool ( temp bool) +0:6 'inF0' ( in float) +0:7 arc sine ( temp float) +0:7 'inF0' ( in float) +0:8 floatBitsToInt ( temp int) +0:8 'inF0' ( in float) +0:9 floatBitsToUint ( temp uint) +0:9 'inF0' ( in float) +0:10 intBitsToFloat ( temp float) +0:10 'inU0' ( in uint) +0:12 arc tangent ( temp float) +0:12 'inF0' ( in float) +0:13 arc tangent ( temp float) +0:13 'inF0' ( in float) +0:13 'inF1' ( in float) +0:14 Ceiling ( temp float) +0:14 'inF0' ( in float) +0:15 clamp ( temp float) +0:15 'inF0' ( in float) +0:15 'inF1' ( in float) +0:15 'inF2' ( in float) +0:16 cosine ( temp float) +0:16 'inF0' ( in float) +0:17 hyp. cosine ( temp float) +0:17 'inF0' ( in float) +0:18 bitCount ( temp int) +0:18 Constant: +0:18 7 (const int) +0:19 degrees ( temp float) +0:19 'inF0' ( in float) +0:23 exp ( temp float) +0:23 'inF0' ( in float) +0:24 exp2 ( temp float) +0:24 'inF0' ( in float) +0:25 findMSB ( temp int) +0:25 Constant: +0:25 7 (const int) +0:26 findLSB ( temp int) +0:26 Constant: +0:26 7 (const int) +0:27 Floor ( temp float) +0:27 'inF0' ( in float) +0:29 mod ( temp float) +0:29 'inF0' ( in float) +0:29 'inF1' ( in float) +0:30 Fraction ( temp float) +0:30 'inF0' ( in float) +0:31 isinf ( temp bool) +0:31 'inF0' ( in float) +0:32 isnan ( temp bool) +0:32 'inF0' ( in float) +0:33 ldexp ( temp float) +0:33 'inF0' ( in float) +0:33 'inF1' ( in float) +0:34 mix ( temp float) +0:34 'inF0' ( in float) +0:34 'inF1' ( in float) +0:34 'inF2' ( in float) +0:35 log ( temp float) +0:35 'inF0' ( in float) +0:36 component-wise multiply ( temp float) +0:36 log2 ( temp float) +0:36 'inF0' ( in float) +0:36 Constant: +0:36 0.301030 +0:37 log2 ( temp float) +0:37 'inF0' ( in float) +0:38 max ( temp float) +0:38 'inF0' ( in float) +0:38 'inF1' ( in float) +0:39 min ( temp float) +0:39 'inF0' ( in float) +0:39 'inF1' ( in float) +0:41 pow ( temp float) +0:41 'inF0' ( in float) +0:41 'inF1' ( in float) +0:42 radians ( temp float) +0:42 'inF0' ( in float) +0:43 bitFieldReverse ( temp int) +0:43 Constant: +0:43 2 (const int) +0:44 roundEven ( temp float) +0:44 'inF0' ( in float) +0:45 inverse sqrt ( temp float) +0:45 'inF0' ( in float) +0:46 clamp ( temp float) +0:46 'inF0' ( in float) +0:46 Constant: +0:46 0.000000 +0:46 Constant: +0:46 1.000000 +0:47 Sign ( temp float) +0:47 'inF0' ( in float) +0:48 sine ( temp float) +0:48 'inF0' ( in float) +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'inF1' ( in float) +0:49 sine ( temp float) +0:49 'inF0' ( in float) +0:49 move second child to first child ( temp float) +0:49 'inF2' ( in float) +0:49 cosine ( temp float) +0:49 'inF0' ( in float) +0:50 hyp. sine ( temp float) +0:50 'inF0' ( in float) +0:51 smoothstep ( temp float) +0:51 'inF0' ( in float) +0:51 'inF1' ( in float) +0:51 'inF2' ( in float) +0:52 sqrt ( temp float) +0:52 'inF0' ( in float) +0:53 step ( temp float) +0:53 'inF0' ( in float) +0:53 'inF1' ( in float) +0:54 tangent ( temp float) +0:54 'inF0' ( in float) +0:55 hyp. tangent ( temp float) +0:55 'inF0' ( in float) +0:57 trunc ( temp float) +0:57 'inF0' ( in float) +0:59 Branch: Return with expression +0:59 Constant: +0:59 0.000000 +0:63 Function Definition: VertexShaderFunction1(vf1;vf1;vf1; ( temp 1-component vector of float) +0:63 Function Parameters: +0:63 'inF0' ( in 1-component vector of float) +0:63 'inF1' ( in 1-component vector of float) +0:63 'inF2' ( in 1-component vector of float) +0:? Sequence +0:65 Branch: Return with expression +0:65 Constant: +0:65 0.000000 +0:69 Function Definition: VertexShaderFunction2(vf2;vf2;vf2;vu2;vu2; ( temp 2-component vector of float) +0:69 Function Parameters: +0:69 'inF0' ( in 2-component vector of float) +0:69 'inF1' ( in 2-component vector of float) +0:69 'inF2' ( in 2-component vector of float) +0:69 'inU0' ( in 2-component vector of uint) +0:69 'inU1' ( in 2-component vector of uint) +0:? Sequence +0:70 all ( temp bool) +0:70 Convert float to bool ( temp 2-component vector of bool) +0:70 'inF0' ( in 2-component vector of float) +0:71 Absolute value ( temp 2-component vector of float) +0:71 'inF0' ( in 2-component vector of float) +0:72 arc cosine ( temp 2-component vector of float) +0:72 'inF0' ( in 2-component vector of float) +0:73 any ( temp bool) +0:73 Convert float to bool ( temp 2-component vector of bool) +0:73 'inF0' ( in 2-component vector of float) +0:74 arc sine ( temp 2-component vector of float) +0:74 'inF0' ( in 2-component vector of float) +0:75 floatBitsToInt ( temp 2-component vector of int) +0:75 'inF0' ( in 2-component vector of float) +0:76 floatBitsToUint ( temp 2-component vector of uint) +0:76 'inF0' ( in 2-component vector of float) +0:77 intBitsToFloat ( temp 2-component vector of float) +0:77 'inU0' ( in 2-component vector of uint) +0:79 arc tangent ( temp 2-component vector of float) +0:79 'inF0' ( in 2-component vector of float) +0:80 arc tangent ( temp 2-component vector of float) +0:80 'inF0' ( in 2-component vector of float) +0:80 'inF1' ( in 2-component vector of float) +0:81 Ceiling ( temp 2-component vector of float) +0:81 'inF0' ( in 2-component vector of float) +0:82 clamp ( temp 2-component vector of float) +0:82 'inF0' ( in 2-component vector of float) +0:82 'inF1' ( in 2-component vector of float) +0:82 'inF2' ( in 2-component vector of float) +0:83 cosine ( temp 2-component vector of float) +0:83 'inF0' ( in 2-component vector of float) +0:84 hyp. cosine ( temp 2-component vector of float) +0:84 'inF0' ( in 2-component vector of float) +0:? bitCount ( temp 2-component vector of int) +0:? Constant: +0:? 7 (const int) +0:? 3 (const int) +0:86 degrees ( temp 2-component vector of float) +0:86 'inF0' ( in 2-component vector of float) +0:87 distance ( temp float) +0:87 'inF0' ( in 2-component vector of float) +0:87 'inF1' ( in 2-component vector of float) +0:88 dot-product ( temp float) +0:88 'inF0' ( in 2-component vector of float) +0:88 'inF1' ( in 2-component vector of float) +0:92 exp ( temp 2-component vector of float) +0:92 'inF0' ( in 2-component vector of float) +0:93 exp2 ( temp 2-component vector of float) +0:93 'inF0' ( in 2-component vector of float) +0:94 face-forward ( temp 2-component vector of float) +0:94 'inF0' ( in 2-component vector of float) +0:94 'inF1' ( in 2-component vector of float) +0:94 'inF2' ( in 2-component vector of float) +0:95 findMSB ( temp int) +0:95 Constant: +0:95 7 (const int) +0:96 findLSB ( temp int) +0:96 Constant: +0:96 7 (const int) +0:97 Floor ( temp 2-component vector of float) +0:97 'inF0' ( in 2-component vector of float) +0:99 mod ( temp 2-component vector of float) +0:99 'inF0' ( in 2-component vector of float) +0:99 'inF1' ( in 2-component vector of float) +0:100 Fraction ( temp 2-component vector of float) +0:100 'inF0' ( in 2-component vector of float) +0:101 isinf ( temp 2-component vector of bool) +0:101 'inF0' ( in 2-component vector of float) +0:102 isnan ( temp 2-component vector of bool) +0:102 'inF0' ( in 2-component vector of float) +0:103 ldexp ( temp 2-component vector of float) +0:103 'inF0' ( in 2-component vector of float) +0:103 'inF1' ( in 2-component vector of float) +0:104 mix ( temp 2-component vector of float) +0:104 'inF0' ( in 2-component vector of float) +0:104 'inF1' ( in 2-component vector of float) +0:104 'inF2' ( in 2-component vector of float) +0:105 length ( temp float) +0:105 'inF0' ( in 2-component vector of float) +0:106 log ( temp 2-component vector of float) +0:106 'inF0' ( in 2-component vector of float) +0:107 vector-scale ( temp 2-component vector of float) +0:107 log2 ( temp 2-component vector of float) +0:107 'inF0' ( in 2-component vector of float) +0:107 Constant: +0:107 0.301030 +0:108 log2 ( temp 2-component vector of float) +0:108 'inF0' ( in 2-component vector of float) +0:109 max ( temp 2-component vector of float) +0:109 'inF0' ( in 2-component vector of float) +0:109 'inF1' ( in 2-component vector of float) +0:110 min ( temp 2-component vector of float) +0:110 'inF0' ( in 2-component vector of float) +0:110 'inF1' ( in 2-component vector of float) +0:112 normalize ( temp 2-component vector of float) +0:112 'inF0' ( in 2-component vector of float) +0:113 pow ( temp 2-component vector of float) +0:113 'inF0' ( in 2-component vector of float) +0:113 'inF1' ( in 2-component vector of float) +0:114 radians ( temp 2-component vector of float) +0:114 'inF0' ( in 2-component vector of float) +0:115 reflect ( temp 2-component vector of float) +0:115 'inF0' ( in 2-component vector of float) +0:115 'inF1' ( in 2-component vector of float) +0:116 refract ( temp 2-component vector of float) +0:116 'inF0' ( in 2-component vector of float) +0:116 'inF1' ( in 2-component vector of float) +0:116 Constant: +0:116 2.000000 +0:? bitFieldReverse ( temp 2-component vector of int) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:118 roundEven ( temp 2-component vector of float) +0:118 'inF0' ( in 2-component vector of float) +0:119 inverse sqrt ( temp 2-component vector of float) +0:119 'inF0' ( in 2-component vector of float) +0:120 clamp ( temp 2-component vector of float) +0:120 'inF0' ( in 2-component vector of float) +0:120 Constant: +0:120 0.000000 +0:120 Constant: +0:120 1.000000 +0:121 Sign ( temp 2-component vector of float) +0:121 'inF0' ( in 2-component vector of float) +0:122 sine ( temp 2-component vector of float) +0:122 'inF0' ( in 2-component vector of float) +0:123 Sequence +0:123 move second child to first child ( temp 2-component vector of float) +0:123 'inF1' ( in 2-component vector of float) +0:123 sine ( temp 2-component vector of float) +0:123 'inF0' ( in 2-component vector of float) +0:123 move second child to first child ( temp 2-component vector of float) +0:123 'inF2' ( in 2-component vector of float) +0:123 cosine ( temp 2-component vector of float) +0:123 'inF0' ( in 2-component vector of float) +0:124 hyp. sine ( temp 2-component vector of float) +0:124 'inF0' ( in 2-component vector of float) +0:125 smoothstep ( temp 2-component vector of float) +0:125 'inF0' ( in 2-component vector of float) +0:125 'inF1' ( in 2-component vector of float) +0:125 'inF2' ( in 2-component vector of float) +0:126 sqrt ( temp 2-component vector of float) +0:126 'inF0' ( in 2-component vector of float) +0:127 step ( temp 2-component vector of float) +0:127 'inF0' ( in 2-component vector of float) +0:127 'inF1' ( in 2-component vector of float) +0:128 tangent ( temp 2-component vector of float) +0:128 'inF0' ( in 2-component vector of float) +0:129 hyp. tangent ( temp 2-component vector of float) +0:129 'inF0' ( in 2-component vector of float) +0:131 trunc ( temp 2-component vector of float) +0:131 'inF0' ( in 2-component vector of float) +0:134 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:138 Function Definition: VertexShaderFunction3(vf3;vf3;vf3;vu3;vu3; ( temp 3-component vector of float) +0:138 Function Parameters: +0:138 'inF0' ( in 3-component vector of float) +0:138 'inF1' ( in 3-component vector of float) +0:138 'inF2' ( in 3-component vector of float) +0:138 'inU0' ( in 3-component vector of uint) +0:138 'inU1' ( in 3-component vector of uint) +0:? Sequence +0:139 all ( temp bool) +0:139 Convert float to bool ( temp 3-component vector of bool) +0:139 'inF0' ( in 3-component vector of float) +0:140 Absolute value ( temp 3-component vector of float) +0:140 'inF0' ( in 3-component vector of float) +0:141 arc cosine ( temp 3-component vector of float) +0:141 'inF0' ( in 3-component vector of float) +0:142 any ( temp bool) +0:142 Convert float to bool ( temp 3-component vector of bool) +0:142 'inF0' ( in 3-component vector of float) +0:143 arc sine ( temp 3-component vector of float) +0:143 'inF0' ( in 3-component vector of float) +0:144 floatBitsToInt ( temp 3-component vector of int) +0:144 'inF0' ( in 3-component vector of float) +0:145 floatBitsToUint ( temp 3-component vector of uint) +0:145 'inF0' ( in 3-component vector of float) +0:146 intBitsToFloat ( temp 3-component vector of float) +0:146 'inU0' ( in 3-component vector of uint) +0:148 arc tangent ( temp 3-component vector of float) +0:148 'inF0' ( in 3-component vector of float) +0:149 arc tangent ( temp 3-component vector of float) +0:149 'inF0' ( in 3-component vector of float) +0:149 'inF1' ( in 3-component vector of float) +0:150 Ceiling ( temp 3-component vector of float) +0:150 'inF0' ( in 3-component vector of float) +0:151 clamp ( temp 3-component vector of float) +0:151 'inF0' ( in 3-component vector of float) +0:151 'inF1' ( in 3-component vector of float) +0:151 'inF2' ( in 3-component vector of float) +0:152 cosine ( temp 3-component vector of float) +0:152 'inF0' ( in 3-component vector of float) +0:153 hyp. cosine ( temp 3-component vector of float) +0:153 'inF0' ( in 3-component vector of float) +0:? bitCount ( temp 3-component vector of int) +0:? Constant: +0:? 7 (const int) +0:? 3 (const int) +0:? 5 (const int) +0:155 cross-product ( temp 3-component vector of float) +0:155 'inF0' ( in 3-component vector of float) +0:155 'inF1' ( in 3-component vector of float) +0:156 degrees ( temp 3-component vector of float) +0:156 'inF0' ( in 3-component vector of float) +0:157 distance ( temp float) +0:157 'inF0' ( in 3-component vector of float) +0:157 'inF1' ( in 3-component vector of float) +0:158 dot-product ( temp float) +0:158 'inF0' ( in 3-component vector of float) +0:158 'inF1' ( in 3-component vector of float) +0:162 exp ( temp 3-component vector of float) +0:162 'inF0' ( in 3-component vector of float) +0:163 exp2 ( temp 3-component vector of float) +0:163 'inF0' ( in 3-component vector of float) +0:164 face-forward ( temp 3-component vector of float) +0:164 'inF0' ( in 3-component vector of float) +0:164 'inF1' ( in 3-component vector of float) +0:164 'inF2' ( in 3-component vector of float) +0:165 findMSB ( temp int) +0:165 Constant: +0:165 7 (const int) +0:166 findLSB ( temp int) +0:166 Constant: +0:166 7 (const int) +0:167 Floor ( temp 3-component vector of float) +0:167 'inF0' ( in 3-component vector of float) +0:169 mod ( temp 3-component vector of float) +0:169 'inF0' ( in 3-component vector of float) +0:169 'inF1' ( in 3-component vector of float) +0:170 Fraction ( temp 3-component vector of float) +0:170 'inF0' ( in 3-component vector of float) +0:171 isinf ( temp 3-component vector of bool) +0:171 'inF0' ( in 3-component vector of float) +0:172 isnan ( temp 3-component vector of bool) +0:172 'inF0' ( in 3-component vector of float) +0:173 ldexp ( temp 3-component vector of float) +0:173 'inF0' ( in 3-component vector of float) +0:173 'inF1' ( in 3-component vector of float) +0:174 mix ( temp 3-component vector of float) +0:174 'inF0' ( in 3-component vector of float) +0:174 'inF1' ( in 3-component vector of float) +0:174 'inF2' ( in 3-component vector of float) +0:175 length ( temp float) +0:175 'inF0' ( in 3-component vector of float) +0:176 log ( temp 3-component vector of float) +0:176 'inF0' ( in 3-component vector of float) +0:177 vector-scale ( temp 3-component vector of float) +0:177 log2 ( temp 3-component vector of float) +0:177 'inF0' ( in 3-component vector of float) +0:177 Constant: +0:177 0.301030 +0:178 log2 ( temp 3-component vector of float) +0:178 'inF0' ( in 3-component vector of float) +0:179 max ( temp 3-component vector of float) +0:179 'inF0' ( in 3-component vector of float) +0:179 'inF1' ( in 3-component vector of float) +0:180 min ( temp 3-component vector of float) +0:180 'inF0' ( in 3-component vector of float) +0:180 'inF1' ( in 3-component vector of float) +0:182 normalize ( temp 3-component vector of float) +0:182 'inF0' ( in 3-component vector of float) +0:183 pow ( temp 3-component vector of float) +0:183 'inF0' ( in 3-component vector of float) +0:183 'inF1' ( in 3-component vector of float) +0:184 radians ( temp 3-component vector of float) +0:184 'inF0' ( in 3-component vector of float) +0:185 reflect ( temp 3-component vector of float) +0:185 'inF0' ( in 3-component vector of float) +0:185 'inF1' ( in 3-component vector of float) +0:186 refract ( temp 3-component vector of float) +0:186 'inF0' ( in 3-component vector of float) +0:186 'inF1' ( in 3-component vector of float) +0:186 Constant: +0:186 2.000000 +0:? bitFieldReverse ( temp 3-component vector of int) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:? 3 (const int) +0:188 roundEven ( temp 3-component vector of float) +0:188 'inF0' ( in 3-component vector of float) +0:189 inverse sqrt ( temp 3-component vector of float) +0:189 'inF0' ( in 3-component vector of float) +0:190 clamp ( temp 3-component vector of float) +0:190 'inF0' ( in 3-component vector of float) +0:190 Constant: +0:190 0.000000 +0:190 Constant: +0:190 1.000000 +0:191 Sign ( temp 3-component vector of float) +0:191 'inF0' ( in 3-component vector of float) +0:192 sine ( temp 3-component vector of float) +0:192 'inF0' ( in 3-component vector of float) +0:193 Sequence +0:193 move second child to first child ( temp 3-component vector of float) +0:193 'inF1' ( in 3-component vector of float) +0:193 sine ( temp 3-component vector of float) +0:193 'inF0' ( in 3-component vector of float) +0:193 move second child to first child ( temp 3-component vector of float) +0:193 'inF2' ( in 3-component vector of float) +0:193 cosine ( temp 3-component vector of float) +0:193 'inF0' ( in 3-component vector of float) +0:194 hyp. sine ( temp 3-component vector of float) +0:194 'inF0' ( in 3-component vector of float) +0:195 smoothstep ( temp 3-component vector of float) +0:195 'inF0' ( in 3-component vector of float) +0:195 'inF1' ( in 3-component vector of float) +0:195 'inF2' ( in 3-component vector of float) +0:196 sqrt ( temp 3-component vector of float) +0:196 'inF0' ( in 3-component vector of float) +0:197 step ( temp 3-component vector of float) +0:197 'inF0' ( in 3-component vector of float) +0:197 'inF1' ( in 3-component vector of float) +0:198 tangent ( temp 3-component vector of float) +0:198 'inF0' ( in 3-component vector of float) +0:199 hyp. tangent ( temp 3-component vector of float) +0:199 'inF0' ( in 3-component vector of float) +0:201 trunc ( temp 3-component vector of float) +0:201 'inF0' ( in 3-component vector of float) +0:204 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:208 Function Definition: VertexShaderFunction4(vf4;vf4;vf4;vu4;vu4; ( temp 4-component vector of float) +0:208 Function Parameters: +0:208 'inF0' ( in 4-component vector of float) +0:208 'inF1' ( in 4-component vector of float) +0:208 'inF2' ( in 4-component vector of float) +0:208 'inU0' ( in 4-component vector of uint) +0:208 'inU1' ( in 4-component vector of uint) +0:? Sequence +0:209 all ( temp bool) +0:209 Convert float to bool ( temp 4-component vector of bool) +0:209 'inF0' ( in 4-component vector of float) +0:210 Absolute value ( temp 4-component vector of float) +0:210 'inF0' ( in 4-component vector of float) +0:211 arc cosine ( temp 4-component vector of float) +0:211 'inF0' ( in 4-component vector of float) +0:212 any ( temp bool) +0:212 Convert float to bool ( temp 4-component vector of bool) +0:212 'inF0' ( in 4-component vector of float) +0:213 arc sine ( temp 4-component vector of float) +0:213 'inF0' ( in 4-component vector of float) +0:214 floatBitsToInt ( temp 4-component vector of int) +0:214 'inF0' ( in 4-component vector of float) +0:215 floatBitsToUint ( temp 4-component vector of uint) +0:215 'inF0' ( in 4-component vector of float) +0:216 intBitsToFloat ( temp 4-component vector of float) +0:216 'inU0' ( in 4-component vector of uint) +0:218 arc tangent ( temp 4-component vector of float) +0:218 'inF0' ( in 4-component vector of float) +0:219 arc tangent ( temp 4-component vector of float) +0:219 'inF0' ( in 4-component vector of float) +0:219 'inF1' ( in 4-component vector of float) +0:220 Ceiling ( temp 4-component vector of float) +0:220 'inF0' ( in 4-component vector of float) +0:221 clamp ( temp 4-component vector of float) +0:221 'inF0' ( in 4-component vector of float) +0:221 'inF1' ( in 4-component vector of float) +0:221 'inF2' ( in 4-component vector of float) +0:222 cosine ( temp 4-component vector of float) +0:222 'inF0' ( in 4-component vector of float) +0:223 hyp. cosine ( temp 4-component vector of float) +0:223 'inF0' ( in 4-component vector of float) +0:? bitCount ( temp 4-component vector of int) +0:? Constant: +0:? 7 (const int) +0:? 3 (const int) +0:? 5 (const int) +0:? 2 (const int) +0:225 degrees ( temp 4-component vector of float) +0:225 'inF0' ( in 4-component vector of float) +0:226 distance ( temp float) +0:226 'inF0' ( in 4-component vector of float) +0:226 'inF1' ( in 4-component vector of float) +0:227 dot-product ( temp float) +0:227 'inF0' ( in 4-component vector of float) +0:227 'inF1' ( in 4-component vector of float) +0:228 Construct vec4 ( temp 4-component vector of float) +0:228 Constant: +0:228 1.000000 +0:228 component-wise multiply ( temp float) +0:228 direct index ( temp float) +0:228 'inF0' ( in 4-component vector of float) +0:228 Constant: +0:228 1 (const int) +0:228 direct index ( temp float) +0:228 'inF1' ( in 4-component vector of float) +0:228 Constant: +0:228 1 (const int) +0:228 direct index ( temp float) +0:228 'inF0' ( in 4-component vector of float) +0:228 Constant: +0:228 2 (const int) +0:228 direct index ( temp float) +0:228 'inF1' ( in 4-component vector of float) +0:228 Constant: +0:228 3 (const int) +0:232 exp ( temp 4-component vector of float) +0:232 'inF0' ( in 4-component vector of float) +0:233 exp2 ( temp 4-component vector of float) +0:233 'inF0' ( in 4-component vector of float) +0:234 face-forward ( temp 4-component vector of float) +0:234 'inF0' ( in 4-component vector of float) +0:234 'inF1' ( in 4-component vector of float) +0:234 'inF2' ( in 4-component vector of float) +0:235 findMSB ( temp int) +0:235 Constant: +0:235 7 (const int) +0:236 findLSB ( temp int) +0:236 Constant: +0:236 7 (const int) +0:237 Floor ( temp 4-component vector of float) +0:237 'inF0' ( in 4-component vector of float) +0:239 mod ( temp 4-component vector of float) +0:239 'inF0' ( in 4-component vector of float) +0:239 'inF1' ( in 4-component vector of float) +0:240 Fraction ( temp 4-component vector of float) +0:240 'inF0' ( in 4-component vector of float) +0:241 isinf ( temp 4-component vector of bool) +0:241 'inF0' ( in 4-component vector of float) +0:242 isnan ( temp 4-component vector of bool) +0:242 'inF0' ( in 4-component vector of float) +0:243 ldexp ( temp 4-component vector of float) +0:243 'inF0' ( in 4-component vector of float) +0:243 'inF1' ( in 4-component vector of float) +0:244 mix ( temp 4-component vector of float) +0:244 'inF0' ( in 4-component vector of float) +0:244 'inF1' ( in 4-component vector of float) +0:244 'inF2' ( in 4-component vector of float) +0:245 length ( temp float) +0:245 'inF0' ( in 4-component vector of float) +0:246 log ( temp 4-component vector of float) +0:246 'inF0' ( in 4-component vector of float) +0:247 vector-scale ( temp 4-component vector of float) +0:247 log2 ( temp 4-component vector of float) +0:247 'inF0' ( in 4-component vector of float) +0:247 Constant: +0:247 0.301030 +0:248 log2 ( temp 4-component vector of float) +0:248 'inF0' ( in 4-component vector of float) +0:249 max ( temp 4-component vector of float) +0:249 'inF0' ( in 4-component vector of float) +0:249 'inF1' ( in 4-component vector of float) +0:250 min ( temp 4-component vector of float) +0:250 'inF0' ( in 4-component vector of float) +0:250 'inF1' ( in 4-component vector of float) +0:252 normalize ( temp 4-component vector of float) +0:252 'inF0' ( in 4-component vector of float) +0:253 pow ( temp 4-component vector of float) +0:253 'inF0' ( in 4-component vector of float) +0:253 'inF1' ( in 4-component vector of float) +0:254 radians ( temp 4-component vector of float) +0:254 'inF0' ( in 4-component vector of float) +0:255 reflect ( temp 4-component vector of float) +0:255 'inF0' ( in 4-component vector of float) +0:255 'inF1' ( in 4-component vector of float) +0:256 refract ( temp 4-component vector of float) +0:256 'inF0' ( in 4-component vector of float) +0:256 'inF1' ( in 4-component vector of float) +0:256 Constant: +0:256 2.000000 +0:? bitFieldReverse ( temp 4-component vector of int) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:? 3 (const int) +0:? 4 (const int) +0:258 roundEven ( temp 4-component vector of float) +0:258 'inF0' ( in 4-component vector of float) +0:259 inverse sqrt ( temp 4-component vector of float) +0:259 'inF0' ( in 4-component vector of float) +0:260 clamp ( temp 4-component vector of float) +0:260 'inF0' ( in 4-component vector of float) +0:260 Constant: +0:260 0.000000 +0:260 Constant: +0:260 1.000000 +0:261 Sign ( temp 4-component vector of float) +0:261 'inF0' ( in 4-component vector of float) +0:262 sine ( temp 4-component vector of float) +0:262 'inF0' ( in 4-component vector of float) +0:263 Sequence +0:263 move second child to first child ( temp 4-component vector of float) +0:263 'inF1' ( in 4-component vector of float) +0:263 sine ( temp 4-component vector of float) +0:263 'inF0' ( in 4-component vector of float) +0:263 move second child to first child ( temp 4-component vector of float) +0:263 'inF2' ( in 4-component vector of float) +0:263 cosine ( temp 4-component vector of float) +0:263 'inF0' ( in 4-component vector of float) +0:264 hyp. sine ( temp 4-component vector of float) +0:264 'inF0' ( in 4-component vector of float) +0:265 smoothstep ( temp 4-component vector of float) +0:265 'inF0' ( in 4-component vector of float) +0:265 'inF1' ( in 4-component vector of float) +0:265 'inF2' ( in 4-component vector of float) +0:266 sqrt ( temp 4-component vector of float) +0:266 'inF0' ( in 4-component vector of float) +0:267 step ( temp 4-component vector of float) +0:267 'inF0' ( in 4-component vector of float) +0:267 'inF1' ( in 4-component vector of float) +0:268 tangent ( temp 4-component vector of float) +0:268 'inF0' ( in 4-component vector of float) +0:269 hyp. tangent ( temp 4-component vector of float) +0:269 'inF0' ( in 4-component vector of float) +0:271 trunc ( temp 4-component vector of float) +0:271 'inF0' ( in 4-component vector of float) +0:274 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:331 Function Definition: VertexShaderFunction2x2(mf22;mf22;mf22; ( temp 2X2 matrix of float) +0:331 Function Parameters: +0:331 'inF0' ( in 2X2 matrix of float) +0:331 'inF1' ( in 2X2 matrix of float) +0:331 'inF2' ( in 2X2 matrix of float) +0:? Sequence +0:333 all ( temp bool) +0:333 Convert float to bool ( temp 2X2 matrix of bool) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 Absolute value ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 arc cosine ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 any ( temp bool) +0:333 Convert float to bool ( temp 2X2 matrix of bool) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 arc sine ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 arc tangent ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 arc tangent ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 Ceiling ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 clamp ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 'inF2' ( in 2X2 matrix of float) +0:333 cosine ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 hyp. cosine ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 degrees ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 determinant ( temp float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 exp ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 exp2 ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 findMSB ( temp int) +0:333 Constant: +0:333 7 (const int) +0:333 findLSB ( temp int) +0:333 Constant: +0:333 7 (const int) +0:333 Floor ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 mod ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 Fraction ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 ldexp ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 mix ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 'inF2' ( in 2X2 matrix of float) +0:333 log ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 matrix-scale ( temp 2X2 matrix of float) +0:333 log2 ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 Constant: +0:333 0.301030 +0:333 log2 ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 max ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 min ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 pow ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 radians ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 roundEven ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 inverse sqrt ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 clamp ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 Constant: +0:333 0.000000 +0:333 Constant: +0:333 1.000000 +0:333 Sign ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 sine ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 Sequence +0:333 move second child to first child ( temp 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 sine ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 move second child to first child ( temp 2X2 matrix of float) +0:333 'inF2' ( in 2X2 matrix of float) +0:333 cosine ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 hyp. sine ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 smoothstep ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 'inF2' ( in 2X2 matrix of float) +0:333 sqrt ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 step ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 tangent ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 hyp. tangent ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 transpose ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 trunc ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:336 Branch: Return with expression +0:? Constant: +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:340 Function Definition: VertexShaderFunction3x3(mf33;mf33;mf33; ( temp 3X3 matrix of float) +0:340 Function Parameters: +0:340 'inF0' ( in 3X3 matrix of float) +0:340 'inF1' ( in 3X3 matrix of float) +0:340 'inF2' ( in 3X3 matrix of float) +0:? Sequence +0:342 all ( temp bool) +0:342 Convert float to bool ( temp 3X3 matrix of bool) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 Absolute value ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 arc cosine ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 any ( temp bool) +0:342 Convert float to bool ( temp 3X3 matrix of bool) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 arc sine ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 arc tangent ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 arc tangent ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 Ceiling ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 clamp ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 'inF2' ( in 3X3 matrix of float) +0:342 cosine ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 hyp. cosine ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 degrees ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 determinant ( temp float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 exp ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 exp2 ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 findMSB ( temp int) +0:342 Constant: +0:342 7 (const int) +0:342 findLSB ( temp int) +0:342 Constant: +0:342 7 (const int) +0:342 Floor ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 mod ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 Fraction ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 ldexp ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 mix ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 'inF2' ( in 3X3 matrix of float) +0:342 log ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 matrix-scale ( temp 3X3 matrix of float) +0:342 log2 ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 Constant: +0:342 0.301030 +0:342 log2 ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 max ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 min ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 pow ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 radians ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 roundEven ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 inverse sqrt ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 clamp ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 Constant: +0:342 0.000000 +0:342 Constant: +0:342 1.000000 +0:342 Sign ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 sine ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 Sequence +0:342 move second child to first child ( temp 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 sine ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 move second child to first child ( temp 3X3 matrix of float) +0:342 'inF2' ( in 3X3 matrix of float) +0:342 cosine ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 hyp. sine ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 smoothstep ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 'inF2' ( in 3X3 matrix of float) +0:342 sqrt ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 step ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 tangent ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 hyp. tangent ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 transpose ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 trunc ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:345 Branch: Return with expression +0:? Constant: +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:349 Function Definition: VertexShaderFunction4x4(mf44;mf44;mf44; ( temp 4X4 matrix of float) +0:349 Function Parameters: +0:349 'inF0' ( in 4X4 matrix of float) +0:349 'inF1' ( in 4X4 matrix of float) +0:349 'inF2' ( in 4X4 matrix of float) +0:? Sequence +0:351 all ( temp bool) +0:351 Convert float to bool ( temp 4X4 matrix of bool) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 Absolute value ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 arc cosine ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 any ( temp bool) +0:351 Convert float to bool ( temp 4X4 matrix of bool) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 arc sine ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 arc tangent ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 arc tangent ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 Ceiling ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 clamp ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 'inF2' ( in 4X4 matrix of float) +0:351 cosine ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 hyp. cosine ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 degrees ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 determinant ( temp float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 exp ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 exp2 ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 findMSB ( temp int) +0:351 Constant: +0:351 7 (const int) +0:351 findLSB ( temp int) +0:351 Constant: +0:351 7 (const int) +0:351 Floor ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 mod ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 Fraction ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 ldexp ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 mix ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 'inF2' ( in 4X4 matrix of float) +0:351 log ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 matrix-scale ( temp 4X4 matrix of float) +0:351 log2 ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 Constant: +0:351 0.301030 +0:351 log2 ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 max ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 min ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 pow ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 radians ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 roundEven ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 inverse sqrt ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 clamp ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 Constant: +0:351 0.000000 +0:351 Constant: +0:351 1.000000 +0:351 Sign ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 sine ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 Sequence +0:351 move second child to first child ( temp 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 sine ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 move second child to first child ( temp 4X4 matrix of float) +0:351 'inF2' ( in 4X4 matrix of float) +0:351 cosine ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 hyp. sine ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 smoothstep ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 'inF2' ( in 4X4 matrix of float) +0:351 sqrt ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 step ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 tangent ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 hyp. tangent ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 transpose ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 trunc ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:354 Branch: Return with expression +0:? Constant: +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:372 Function Definition: TestGenMul2(f1;f1;vf2;vf2;mf22;mf22; ( temp void) +0:372 Function Parameters: +0:372 'inF0' ( in float) +0:372 'inF1' ( in float) +0:372 'inFV0' ( in 2-component vector of float) +0:372 'inFV1' ( in 2-component vector of float) +0:372 'inFM0' ( in 2X2 matrix of float) +0:372 'inFM1' ( in 2X2 matrix of float) +0:? Sequence +0:373 Sequence +0:373 move second child to first child ( temp float) +0:373 'r0' ( temp float) +0:373 component-wise multiply ( temp float) +0:373 'inF1' ( in float) +0:373 'inF0' ( in float) +0:373 Sequence +0:373 move second child to first child ( temp 2-component vector of float) +0:373 'r1' ( temp 2-component vector of float) +0:373 vector-scale ( temp 2-component vector of float) +0:373 'inF0' ( in float) +0:373 'inFV0' ( in 2-component vector of float) +0:373 Sequence +0:373 move second child to first child ( temp 2-component vector of float) +0:373 'r2' ( temp 2-component vector of float) +0:373 vector-scale ( temp 2-component vector of float) +0:373 'inFV0' ( in 2-component vector of float) +0:373 'inF0' ( in float) +0:373 Sequence +0:373 move second child to first child ( temp float) +0:373 'r3' ( temp float) +0:373 dot-product ( temp float) +0:373 'inFV0' ( in 2-component vector of float) +0:373 'inFV1' ( in 2-component vector of float) +0:373 Sequence +0:373 move second child to first child ( temp 2-component vector of float) +0:373 'r4' ( temp 2-component vector of float) +0:373 vector-times-matrix ( temp 2-component vector of float) +0:373 'inFV0' ( in 2-component vector of float) +0:373 'inFM0' ( in 2X2 matrix of float) +0:373 Sequence +0:373 move second child to first child ( temp 2-component vector of float) +0:373 'r5' ( temp 2-component vector of float) +0:373 matrix-times-vector ( temp 2-component vector of float) +0:373 'inFM0' ( in 2X2 matrix of float) +0:373 'inFV0' ( in 2-component vector of float) +0:373 Sequence +0:373 move second child to first child ( temp 2X2 matrix of float) +0:373 'r6' ( temp 2X2 matrix of float) +0:373 matrix-scale ( temp 2X2 matrix of float) +0:373 'inF0' ( in float) +0:373 'inFM0' ( in 2X2 matrix of float) +0:373 Sequence +0:373 move second child to first child ( temp 2X2 matrix of float) +0:373 'r7' ( temp 2X2 matrix of float) +0:373 matrix-scale ( temp 2X2 matrix of float) +0:373 'inFM0' ( in 2X2 matrix of float) +0:373 'inF0' ( in float) +0:373 Sequence +0:373 move second child to first child ( temp 2X2 matrix of float) +0:373 'r8' ( temp 2X2 matrix of float) +0:373 matrix-multiply ( temp 2X2 matrix of float) +0:373 'inFM1' ( in 2X2 matrix of float) +0:373 'inFM0' ( in 2X2 matrix of float) +0:379 Function Definition: TestGenMul3(f1;f1;vf3;vf3;mf33;mf33; ( temp void) +0:379 Function Parameters: +0:379 'inF0' ( in float) +0:379 'inF1' ( in float) +0:379 'inFV0' ( in 3-component vector of float) +0:379 'inFV1' ( in 3-component vector of float) +0:379 'inFM0' ( in 3X3 matrix of float) +0:379 'inFM1' ( in 3X3 matrix of float) +0:? Sequence +0:380 Sequence +0:380 move second child to first child ( temp float) +0:380 'r0' ( temp float) +0:380 component-wise multiply ( temp float) +0:380 'inF1' ( in float) +0:380 'inF0' ( in float) +0:380 Sequence +0:380 move second child to first child ( temp 3-component vector of float) +0:380 'r1' ( temp 3-component vector of float) +0:380 vector-scale ( temp 3-component vector of float) +0:380 'inF0' ( in float) +0:380 'inFV0' ( in 3-component vector of float) +0:380 Sequence +0:380 move second child to first child ( temp 3-component vector of float) +0:380 'r2' ( temp 3-component vector of float) +0:380 vector-scale ( temp 3-component vector of float) +0:380 'inFV0' ( in 3-component vector of float) +0:380 'inF0' ( in float) +0:380 Sequence +0:380 move second child to first child ( temp float) +0:380 'r3' ( temp float) +0:380 dot-product ( temp float) +0:380 'inFV0' ( in 3-component vector of float) +0:380 'inFV1' ( in 3-component vector of float) +0:380 Sequence +0:380 move second child to first child ( temp 3-component vector of float) +0:380 'r4' ( temp 3-component vector of float) +0:380 vector-times-matrix ( temp 3-component vector of float) +0:380 'inFV0' ( in 3-component vector of float) +0:380 'inFM0' ( in 3X3 matrix of float) +0:380 Sequence +0:380 move second child to first child ( temp 3-component vector of float) +0:380 'r5' ( temp 3-component vector of float) +0:380 matrix-times-vector ( temp 3-component vector of float) +0:380 'inFM0' ( in 3X3 matrix of float) +0:380 'inFV0' ( in 3-component vector of float) +0:380 Sequence +0:380 move second child to first child ( temp 3X3 matrix of float) +0:380 'r6' ( temp 3X3 matrix of float) +0:380 matrix-scale ( temp 3X3 matrix of float) +0:380 'inF0' ( in float) +0:380 'inFM0' ( in 3X3 matrix of float) +0:380 Sequence +0:380 move second child to first child ( temp 3X3 matrix of float) +0:380 'r7' ( temp 3X3 matrix of float) +0:380 matrix-scale ( temp 3X3 matrix of float) +0:380 'inFM0' ( in 3X3 matrix of float) +0:380 'inF0' ( in float) +0:380 Sequence +0:380 move second child to first child ( temp 3X3 matrix of float) +0:380 'r8' ( temp 3X3 matrix of float) +0:380 matrix-multiply ( temp 3X3 matrix of float) +0:380 'inFM1' ( in 3X3 matrix of float) +0:380 'inFM0' ( in 3X3 matrix of float) +0:386 Function Definition: TestGenMul4(f1;f1;vf4;vf4;mf44;mf44; ( temp void) +0:386 Function Parameters: +0:386 'inF0' ( in float) +0:386 'inF1' ( in float) +0:386 'inFV0' ( in 4-component vector of float) +0:386 'inFV1' ( in 4-component vector of float) +0:386 'inFM0' ( in 4X4 matrix of float) +0:386 'inFM1' ( in 4X4 matrix of float) +0:? Sequence +0:387 Sequence +0:387 move second child to first child ( temp float) +0:387 'r0' ( temp float) +0:387 component-wise multiply ( temp float) +0:387 'inF1' ( in float) +0:387 'inF0' ( in float) +0:387 Sequence +0:387 move second child to first child ( temp 4-component vector of float) +0:387 'r1' ( temp 4-component vector of float) +0:387 vector-scale ( temp 4-component vector of float) +0:387 'inF0' ( in float) +0:387 'inFV0' ( in 4-component vector of float) +0:387 Sequence +0:387 move second child to first child ( temp 4-component vector of float) +0:387 'r2' ( temp 4-component vector of float) +0:387 vector-scale ( temp 4-component vector of float) +0:387 'inFV0' ( in 4-component vector of float) +0:387 'inF0' ( in float) +0:387 Sequence +0:387 move second child to first child ( temp float) +0:387 'r3' ( temp float) +0:387 dot-product ( temp float) +0:387 'inFV0' ( in 4-component vector of float) +0:387 'inFV1' ( in 4-component vector of float) +0:387 Sequence +0:387 move second child to first child ( temp 4-component vector of float) +0:387 'r4' ( temp 4-component vector of float) +0:387 vector-times-matrix ( temp 4-component vector of float) +0:387 'inFV0' ( in 4-component vector of float) +0:387 'inFM0' ( in 4X4 matrix of float) +0:387 Sequence +0:387 move second child to first child ( temp 4-component vector of float) +0:387 'r5' ( temp 4-component vector of float) +0:387 matrix-times-vector ( temp 4-component vector of float) +0:387 'inFM0' ( in 4X4 matrix of float) +0:387 'inFV0' ( in 4-component vector of float) +0:387 Sequence +0:387 move second child to first child ( temp 4X4 matrix of float) +0:387 'r6' ( temp 4X4 matrix of float) +0:387 matrix-scale ( temp 4X4 matrix of float) +0:387 'inF0' ( in float) +0:387 'inFM0' ( in 4X4 matrix of float) +0:387 Sequence +0:387 move second child to first child ( temp 4X4 matrix of float) +0:387 'r7' ( temp 4X4 matrix of float) +0:387 matrix-scale ( temp 4X4 matrix of float) +0:387 'inFM0' ( in 4X4 matrix of float) +0:387 'inF0' ( in float) +0:387 Sequence +0:387 move second child to first child ( temp 4X4 matrix of float) +0:387 'r8' ( temp 4X4 matrix of float) +0:387 matrix-multiply ( temp 4X4 matrix of float) +0:387 'inFM1' ( in 4X4 matrix of float) +0:387 'inFM0' ( in 4X4 matrix of float) +0:396 Function Definition: TestGenMulNxM(f1;f1;vf2;vf3;mf23;mf32;mf33;mf34;mf24; ( temp void) +0:396 Function Parameters: +0:396 'inF0' ( in float) +0:396 'inF1' ( in float) +0:396 'inFV2' ( in 2-component vector of float) +0:396 'inFV3' ( in 3-component vector of float) +0:396 'inFM2x3' ( in 2X3 matrix of float) +0:396 'inFM3x2' ( in 3X2 matrix of float) +0:396 'inFM3x3' ( in 3X3 matrix of float) +0:396 'inFM3x4' ( in 3X4 matrix of float) +0:396 'inFM2x4' ( in 2X4 matrix of float) +0:? Sequence +0:397 Sequence +0:397 move second child to first child ( temp float) +0:397 'r00' ( temp float) +0:397 component-wise multiply ( temp float) +0:397 'inF1' ( in float) +0:397 'inF0' ( in float) +0:398 Sequence +0:398 move second child to first child ( temp 2-component vector of float) +0:398 'r01' ( temp 2-component vector of float) +0:398 vector-scale ( temp 2-component vector of float) +0:398 'inF0' ( in float) +0:398 'inFV2' ( in 2-component vector of float) +0:399 Sequence +0:399 move second child to first child ( temp 3-component vector of float) +0:399 'r02' ( temp 3-component vector of float) +0:399 vector-scale ( temp 3-component vector of float) +0:399 'inF0' ( in float) +0:399 'inFV3' ( in 3-component vector of float) +0:400 Sequence +0:400 move second child to first child ( temp 2-component vector of float) +0:400 'r03' ( temp 2-component vector of float) +0:400 vector-scale ( temp 2-component vector of float) +0:400 'inFV2' ( in 2-component vector of float) +0:400 'inF0' ( in float) +0:401 Sequence +0:401 move second child to first child ( temp 3-component vector of float) +0:401 'r04' ( temp 3-component vector of float) +0:401 vector-scale ( temp 3-component vector of float) +0:401 'inFV3' ( in 3-component vector of float) +0:401 'inF0' ( in float) +0:402 Sequence +0:402 move second child to first child ( temp float) +0:402 'r05' ( temp float) +0:402 dot-product ( temp float) +0:402 'inFV2' ( in 2-component vector of float) +0:402 'inFV2' ( in 2-component vector of float) +0:403 Sequence +0:403 move second child to first child ( temp float) +0:403 'r06' ( temp float) +0:403 dot-product ( temp float) +0:403 'inFV3' ( in 3-component vector of float) +0:403 'inFV3' ( in 3-component vector of float) +0:404 Sequence +0:404 move second child to first child ( temp 3-component vector of float) +0:404 'r07' ( temp 3-component vector of float) +0:404 matrix-times-vector ( temp 3-component vector of float) +0:404 'inFM2x3' ( in 2X3 matrix of float) +0:404 'inFV2' ( in 2-component vector of float) +0:405 Sequence +0:405 move second child to first child ( temp 2-component vector of float) +0:405 'r08' ( temp 2-component vector of float) +0:405 matrix-times-vector ( temp 2-component vector of float) +0:405 'inFM3x2' ( in 3X2 matrix of float) +0:405 'inFV3' ( in 3-component vector of float) +0:406 Sequence +0:406 move second child to first child ( temp 2-component vector of float) +0:406 'r09' ( temp 2-component vector of float) +0:406 vector-times-matrix ( temp 2-component vector of float) +0:406 'inFV3' ( in 3-component vector of float) +0:406 'inFM2x3' ( in 2X3 matrix of float) +0:407 Sequence +0:407 move second child to first child ( temp 3-component vector of float) +0:407 'r10' ( temp 3-component vector of float) +0:407 vector-times-matrix ( temp 3-component vector of float) +0:407 'inFV2' ( in 2-component vector of float) +0:407 'inFM3x2' ( in 3X2 matrix of float) +0:408 Sequence +0:408 move second child to first child ( temp 2X3 matrix of float) +0:408 'r11' ( temp 2X3 matrix of float) +0:408 matrix-scale ( temp 2X3 matrix of float) +0:408 'inF0' ( in float) +0:408 'inFM2x3' ( in 2X3 matrix of float) +0:409 Sequence +0:409 move second child to first child ( temp 3X2 matrix of float) +0:409 'r12' ( temp 3X2 matrix of float) +0:409 matrix-scale ( temp 3X2 matrix of float) +0:409 'inF0' ( in float) +0:409 'inFM3x2' ( in 3X2 matrix of float) +0:410 Sequence +0:410 move second child to first child ( temp 2X2 matrix of float) +0:410 'r13' ( temp 2X2 matrix of float) +0:410 matrix-multiply ( temp 2X2 matrix of float) +0:410 'inFM3x2' ( in 3X2 matrix of float) +0:410 'inFM2x3' ( in 2X3 matrix of float) +0:411 Sequence +0:411 move second child to first child ( temp 2X3 matrix of float) +0:411 'r14' ( temp 2X3 matrix of float) +0:411 matrix-multiply ( temp 2X3 matrix of float) +0:411 'inFM3x3' ( in 3X3 matrix of float) +0:411 'inFM2x3' ( in 2X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 2X4 matrix of float) +0:412 'r15' ( temp 2X4 matrix of float) +0:412 matrix-multiply ( temp 2X4 matrix of float) +0:412 'inFM3x4' ( in 3X4 matrix of float) +0:412 'inFM2x3' ( in 2X3 matrix of float) +0:413 Sequence +0:413 move second child to first child ( temp 3X4 matrix of float) +0:413 'r16' ( temp 3X4 matrix of float) +0:413 matrix-multiply ( temp 3X4 matrix of float) +0:413 'inFM2x4' ( in 2X4 matrix of float) +0:413 'inFM3x2' ( in 3X2 matrix of float) +0:? Linker Objects + + +Linked vertex stage: + +WARNING: Linking vertex stage: Entry point not found + +Shader version: 500 +0:? Sequence +0:2 Function Definition: VertexShaderFunctionS(f1;f1;f1;u1;u1; ( temp float) +0:2 Function Parameters: +0:2 'inF0' ( in float) +0:2 'inF1' ( in float) +0:2 'inF2' ( in float) +0:2 'inU0' ( in uint) +0:2 'inU1' ( in uint) +0:? Sequence +0:3 all ( temp bool) +0:3 Convert float to bool ( temp bool) +0:3 'inF0' ( in float) +0:4 Absolute value ( temp float) +0:4 'inF0' ( in float) +0:5 arc cosine ( temp float) +0:5 'inF0' ( in float) +0:6 any ( temp bool) +0:6 Convert float to bool ( temp bool) +0:6 'inF0' ( in float) +0:7 arc sine ( temp float) +0:7 'inF0' ( in float) +0:8 floatBitsToInt ( temp int) +0:8 'inF0' ( in float) +0:9 floatBitsToUint ( temp uint) +0:9 'inF0' ( in float) +0:10 intBitsToFloat ( temp float) +0:10 'inU0' ( in uint) +0:12 arc tangent ( temp float) +0:12 'inF0' ( in float) +0:13 arc tangent ( temp float) +0:13 'inF0' ( in float) +0:13 'inF1' ( in float) +0:14 Ceiling ( temp float) +0:14 'inF0' ( in float) +0:15 clamp ( temp float) +0:15 'inF0' ( in float) +0:15 'inF1' ( in float) +0:15 'inF2' ( in float) +0:16 cosine ( temp float) +0:16 'inF0' ( in float) +0:17 hyp. cosine ( temp float) +0:17 'inF0' ( in float) +0:18 bitCount ( temp int) +0:18 Constant: +0:18 7 (const int) +0:19 degrees ( temp float) +0:19 'inF0' ( in float) +0:23 exp ( temp float) +0:23 'inF0' ( in float) +0:24 exp2 ( temp float) +0:24 'inF0' ( in float) +0:25 findMSB ( temp int) +0:25 Constant: +0:25 7 (const int) +0:26 findLSB ( temp int) +0:26 Constant: +0:26 7 (const int) +0:27 Floor ( temp float) +0:27 'inF0' ( in float) +0:29 mod ( temp float) +0:29 'inF0' ( in float) +0:29 'inF1' ( in float) +0:30 Fraction ( temp float) +0:30 'inF0' ( in float) +0:31 isinf ( temp bool) +0:31 'inF0' ( in float) +0:32 isnan ( temp bool) +0:32 'inF0' ( in float) +0:33 ldexp ( temp float) +0:33 'inF0' ( in float) +0:33 'inF1' ( in float) +0:34 mix ( temp float) +0:34 'inF0' ( in float) +0:34 'inF1' ( in float) +0:34 'inF2' ( in float) +0:35 log ( temp float) +0:35 'inF0' ( in float) +0:36 component-wise multiply ( temp float) +0:36 log2 ( temp float) +0:36 'inF0' ( in float) +0:36 Constant: +0:36 0.301030 +0:37 log2 ( temp float) +0:37 'inF0' ( in float) +0:38 max ( temp float) +0:38 'inF0' ( in float) +0:38 'inF1' ( in float) +0:39 min ( temp float) +0:39 'inF0' ( in float) +0:39 'inF1' ( in float) +0:41 pow ( temp float) +0:41 'inF0' ( in float) +0:41 'inF1' ( in float) +0:42 radians ( temp float) +0:42 'inF0' ( in float) +0:43 bitFieldReverse ( temp int) +0:43 Constant: +0:43 2 (const int) +0:44 roundEven ( temp float) +0:44 'inF0' ( in float) +0:45 inverse sqrt ( temp float) +0:45 'inF0' ( in float) +0:46 clamp ( temp float) +0:46 'inF0' ( in float) +0:46 Constant: +0:46 0.000000 +0:46 Constant: +0:46 1.000000 +0:47 Sign ( temp float) +0:47 'inF0' ( in float) +0:48 sine ( temp float) +0:48 'inF0' ( in float) +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'inF1' ( in float) +0:49 sine ( temp float) +0:49 'inF0' ( in float) +0:49 move second child to first child ( temp float) +0:49 'inF2' ( in float) +0:49 cosine ( temp float) +0:49 'inF0' ( in float) +0:50 hyp. sine ( temp float) +0:50 'inF0' ( in float) +0:51 smoothstep ( temp float) +0:51 'inF0' ( in float) +0:51 'inF1' ( in float) +0:51 'inF2' ( in float) +0:52 sqrt ( temp float) +0:52 'inF0' ( in float) +0:53 step ( temp float) +0:53 'inF0' ( in float) +0:53 'inF1' ( in float) +0:54 tangent ( temp float) +0:54 'inF0' ( in float) +0:55 hyp. tangent ( temp float) +0:55 'inF0' ( in float) +0:57 trunc ( temp float) +0:57 'inF0' ( in float) +0:59 Branch: Return with expression +0:59 Constant: +0:59 0.000000 +0:63 Function Definition: VertexShaderFunction1(vf1;vf1;vf1; ( temp 1-component vector of float) +0:63 Function Parameters: +0:63 'inF0' ( in 1-component vector of float) +0:63 'inF1' ( in 1-component vector of float) +0:63 'inF2' ( in 1-component vector of float) +0:? Sequence +0:65 Branch: Return with expression +0:65 Constant: +0:65 0.000000 +0:69 Function Definition: VertexShaderFunction2(vf2;vf2;vf2;vu2;vu2; ( temp 2-component vector of float) +0:69 Function Parameters: +0:69 'inF0' ( in 2-component vector of float) +0:69 'inF1' ( in 2-component vector of float) +0:69 'inF2' ( in 2-component vector of float) +0:69 'inU0' ( in 2-component vector of uint) +0:69 'inU1' ( in 2-component vector of uint) +0:? Sequence +0:70 all ( temp bool) +0:70 Convert float to bool ( temp 2-component vector of bool) +0:70 'inF0' ( in 2-component vector of float) +0:71 Absolute value ( temp 2-component vector of float) +0:71 'inF0' ( in 2-component vector of float) +0:72 arc cosine ( temp 2-component vector of float) +0:72 'inF0' ( in 2-component vector of float) +0:73 any ( temp bool) +0:73 Convert float to bool ( temp 2-component vector of bool) +0:73 'inF0' ( in 2-component vector of float) +0:74 arc sine ( temp 2-component vector of float) +0:74 'inF0' ( in 2-component vector of float) +0:75 floatBitsToInt ( temp 2-component vector of int) +0:75 'inF0' ( in 2-component vector of float) +0:76 floatBitsToUint ( temp 2-component vector of uint) +0:76 'inF0' ( in 2-component vector of float) +0:77 intBitsToFloat ( temp 2-component vector of float) +0:77 'inU0' ( in 2-component vector of uint) +0:79 arc tangent ( temp 2-component vector of float) +0:79 'inF0' ( in 2-component vector of float) +0:80 arc tangent ( temp 2-component vector of float) +0:80 'inF0' ( in 2-component vector of float) +0:80 'inF1' ( in 2-component vector of float) +0:81 Ceiling ( temp 2-component vector of float) +0:81 'inF0' ( in 2-component vector of float) +0:82 clamp ( temp 2-component vector of float) +0:82 'inF0' ( in 2-component vector of float) +0:82 'inF1' ( in 2-component vector of float) +0:82 'inF2' ( in 2-component vector of float) +0:83 cosine ( temp 2-component vector of float) +0:83 'inF0' ( in 2-component vector of float) +0:84 hyp. cosine ( temp 2-component vector of float) +0:84 'inF0' ( in 2-component vector of float) +0:? bitCount ( temp 2-component vector of int) +0:? Constant: +0:? 7 (const int) +0:? 3 (const int) +0:86 degrees ( temp 2-component vector of float) +0:86 'inF0' ( in 2-component vector of float) +0:87 distance ( temp float) +0:87 'inF0' ( in 2-component vector of float) +0:87 'inF1' ( in 2-component vector of float) +0:88 dot-product ( temp float) +0:88 'inF0' ( in 2-component vector of float) +0:88 'inF1' ( in 2-component vector of float) +0:92 exp ( temp 2-component vector of float) +0:92 'inF0' ( in 2-component vector of float) +0:93 exp2 ( temp 2-component vector of float) +0:93 'inF0' ( in 2-component vector of float) +0:94 face-forward ( temp 2-component vector of float) +0:94 'inF0' ( in 2-component vector of float) +0:94 'inF1' ( in 2-component vector of float) +0:94 'inF2' ( in 2-component vector of float) +0:95 findMSB ( temp int) +0:95 Constant: +0:95 7 (const int) +0:96 findLSB ( temp int) +0:96 Constant: +0:96 7 (const int) +0:97 Floor ( temp 2-component vector of float) +0:97 'inF0' ( in 2-component vector of float) +0:99 mod ( temp 2-component vector of float) +0:99 'inF0' ( in 2-component vector of float) +0:99 'inF1' ( in 2-component vector of float) +0:100 Fraction ( temp 2-component vector of float) +0:100 'inF0' ( in 2-component vector of float) +0:101 isinf ( temp 2-component vector of bool) +0:101 'inF0' ( in 2-component vector of float) +0:102 isnan ( temp 2-component vector of bool) +0:102 'inF0' ( in 2-component vector of float) +0:103 ldexp ( temp 2-component vector of float) +0:103 'inF0' ( in 2-component vector of float) +0:103 'inF1' ( in 2-component vector of float) +0:104 mix ( temp 2-component vector of float) +0:104 'inF0' ( in 2-component vector of float) +0:104 'inF1' ( in 2-component vector of float) +0:104 'inF2' ( in 2-component vector of float) +0:105 length ( temp float) +0:105 'inF0' ( in 2-component vector of float) +0:106 log ( temp 2-component vector of float) +0:106 'inF0' ( in 2-component vector of float) +0:107 vector-scale ( temp 2-component vector of float) +0:107 log2 ( temp 2-component vector of float) +0:107 'inF0' ( in 2-component vector of float) +0:107 Constant: +0:107 0.301030 +0:108 log2 ( temp 2-component vector of float) +0:108 'inF0' ( in 2-component vector of float) +0:109 max ( temp 2-component vector of float) +0:109 'inF0' ( in 2-component vector of float) +0:109 'inF1' ( in 2-component vector of float) +0:110 min ( temp 2-component vector of float) +0:110 'inF0' ( in 2-component vector of float) +0:110 'inF1' ( in 2-component vector of float) +0:112 normalize ( temp 2-component vector of float) +0:112 'inF0' ( in 2-component vector of float) +0:113 pow ( temp 2-component vector of float) +0:113 'inF0' ( in 2-component vector of float) +0:113 'inF1' ( in 2-component vector of float) +0:114 radians ( temp 2-component vector of float) +0:114 'inF0' ( in 2-component vector of float) +0:115 reflect ( temp 2-component vector of float) +0:115 'inF0' ( in 2-component vector of float) +0:115 'inF1' ( in 2-component vector of float) +0:116 refract ( temp 2-component vector of float) +0:116 'inF0' ( in 2-component vector of float) +0:116 'inF1' ( in 2-component vector of float) +0:116 Constant: +0:116 2.000000 +0:? bitFieldReverse ( temp 2-component vector of int) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:118 roundEven ( temp 2-component vector of float) +0:118 'inF0' ( in 2-component vector of float) +0:119 inverse sqrt ( temp 2-component vector of float) +0:119 'inF0' ( in 2-component vector of float) +0:120 clamp ( temp 2-component vector of float) +0:120 'inF0' ( in 2-component vector of float) +0:120 Constant: +0:120 0.000000 +0:120 Constant: +0:120 1.000000 +0:121 Sign ( temp 2-component vector of float) +0:121 'inF0' ( in 2-component vector of float) +0:122 sine ( temp 2-component vector of float) +0:122 'inF0' ( in 2-component vector of float) +0:123 Sequence +0:123 move second child to first child ( temp 2-component vector of float) +0:123 'inF1' ( in 2-component vector of float) +0:123 sine ( temp 2-component vector of float) +0:123 'inF0' ( in 2-component vector of float) +0:123 move second child to first child ( temp 2-component vector of float) +0:123 'inF2' ( in 2-component vector of float) +0:123 cosine ( temp 2-component vector of float) +0:123 'inF0' ( in 2-component vector of float) +0:124 hyp. sine ( temp 2-component vector of float) +0:124 'inF0' ( in 2-component vector of float) +0:125 smoothstep ( temp 2-component vector of float) +0:125 'inF0' ( in 2-component vector of float) +0:125 'inF1' ( in 2-component vector of float) +0:125 'inF2' ( in 2-component vector of float) +0:126 sqrt ( temp 2-component vector of float) +0:126 'inF0' ( in 2-component vector of float) +0:127 step ( temp 2-component vector of float) +0:127 'inF0' ( in 2-component vector of float) +0:127 'inF1' ( in 2-component vector of float) +0:128 tangent ( temp 2-component vector of float) +0:128 'inF0' ( in 2-component vector of float) +0:129 hyp. tangent ( temp 2-component vector of float) +0:129 'inF0' ( in 2-component vector of float) +0:131 trunc ( temp 2-component vector of float) +0:131 'inF0' ( in 2-component vector of float) +0:134 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:138 Function Definition: VertexShaderFunction3(vf3;vf3;vf3;vu3;vu3; ( temp 3-component vector of float) +0:138 Function Parameters: +0:138 'inF0' ( in 3-component vector of float) +0:138 'inF1' ( in 3-component vector of float) +0:138 'inF2' ( in 3-component vector of float) +0:138 'inU0' ( in 3-component vector of uint) +0:138 'inU1' ( in 3-component vector of uint) +0:? Sequence +0:139 all ( temp bool) +0:139 Convert float to bool ( temp 3-component vector of bool) +0:139 'inF0' ( in 3-component vector of float) +0:140 Absolute value ( temp 3-component vector of float) +0:140 'inF0' ( in 3-component vector of float) +0:141 arc cosine ( temp 3-component vector of float) +0:141 'inF0' ( in 3-component vector of float) +0:142 any ( temp bool) +0:142 Convert float to bool ( temp 3-component vector of bool) +0:142 'inF0' ( in 3-component vector of float) +0:143 arc sine ( temp 3-component vector of float) +0:143 'inF0' ( in 3-component vector of float) +0:144 floatBitsToInt ( temp 3-component vector of int) +0:144 'inF0' ( in 3-component vector of float) +0:145 floatBitsToUint ( temp 3-component vector of uint) +0:145 'inF0' ( in 3-component vector of float) +0:146 intBitsToFloat ( temp 3-component vector of float) +0:146 'inU0' ( in 3-component vector of uint) +0:148 arc tangent ( temp 3-component vector of float) +0:148 'inF0' ( in 3-component vector of float) +0:149 arc tangent ( temp 3-component vector of float) +0:149 'inF0' ( in 3-component vector of float) +0:149 'inF1' ( in 3-component vector of float) +0:150 Ceiling ( temp 3-component vector of float) +0:150 'inF0' ( in 3-component vector of float) +0:151 clamp ( temp 3-component vector of float) +0:151 'inF0' ( in 3-component vector of float) +0:151 'inF1' ( in 3-component vector of float) +0:151 'inF2' ( in 3-component vector of float) +0:152 cosine ( temp 3-component vector of float) +0:152 'inF0' ( in 3-component vector of float) +0:153 hyp. cosine ( temp 3-component vector of float) +0:153 'inF0' ( in 3-component vector of float) +0:? bitCount ( temp 3-component vector of int) +0:? Constant: +0:? 7 (const int) +0:? 3 (const int) +0:? 5 (const int) +0:155 cross-product ( temp 3-component vector of float) +0:155 'inF0' ( in 3-component vector of float) +0:155 'inF1' ( in 3-component vector of float) +0:156 degrees ( temp 3-component vector of float) +0:156 'inF0' ( in 3-component vector of float) +0:157 distance ( temp float) +0:157 'inF0' ( in 3-component vector of float) +0:157 'inF1' ( in 3-component vector of float) +0:158 dot-product ( temp float) +0:158 'inF0' ( in 3-component vector of float) +0:158 'inF1' ( in 3-component vector of float) +0:162 exp ( temp 3-component vector of float) +0:162 'inF0' ( in 3-component vector of float) +0:163 exp2 ( temp 3-component vector of float) +0:163 'inF0' ( in 3-component vector of float) +0:164 face-forward ( temp 3-component vector of float) +0:164 'inF0' ( in 3-component vector of float) +0:164 'inF1' ( in 3-component vector of float) +0:164 'inF2' ( in 3-component vector of float) +0:165 findMSB ( temp int) +0:165 Constant: +0:165 7 (const int) +0:166 findLSB ( temp int) +0:166 Constant: +0:166 7 (const int) +0:167 Floor ( temp 3-component vector of float) +0:167 'inF0' ( in 3-component vector of float) +0:169 mod ( temp 3-component vector of float) +0:169 'inF0' ( in 3-component vector of float) +0:169 'inF1' ( in 3-component vector of float) +0:170 Fraction ( temp 3-component vector of float) +0:170 'inF0' ( in 3-component vector of float) +0:171 isinf ( temp 3-component vector of bool) +0:171 'inF0' ( in 3-component vector of float) +0:172 isnan ( temp 3-component vector of bool) +0:172 'inF0' ( in 3-component vector of float) +0:173 ldexp ( temp 3-component vector of float) +0:173 'inF0' ( in 3-component vector of float) +0:173 'inF1' ( in 3-component vector of float) +0:174 mix ( temp 3-component vector of float) +0:174 'inF0' ( in 3-component vector of float) +0:174 'inF1' ( in 3-component vector of float) +0:174 'inF2' ( in 3-component vector of float) +0:175 length ( temp float) +0:175 'inF0' ( in 3-component vector of float) +0:176 log ( temp 3-component vector of float) +0:176 'inF0' ( in 3-component vector of float) +0:177 vector-scale ( temp 3-component vector of float) +0:177 log2 ( temp 3-component vector of float) +0:177 'inF0' ( in 3-component vector of float) +0:177 Constant: +0:177 0.301030 +0:178 log2 ( temp 3-component vector of float) +0:178 'inF0' ( in 3-component vector of float) +0:179 max ( temp 3-component vector of float) +0:179 'inF0' ( in 3-component vector of float) +0:179 'inF1' ( in 3-component vector of float) +0:180 min ( temp 3-component vector of float) +0:180 'inF0' ( in 3-component vector of float) +0:180 'inF1' ( in 3-component vector of float) +0:182 normalize ( temp 3-component vector of float) +0:182 'inF0' ( in 3-component vector of float) +0:183 pow ( temp 3-component vector of float) +0:183 'inF0' ( in 3-component vector of float) +0:183 'inF1' ( in 3-component vector of float) +0:184 radians ( temp 3-component vector of float) +0:184 'inF0' ( in 3-component vector of float) +0:185 reflect ( temp 3-component vector of float) +0:185 'inF0' ( in 3-component vector of float) +0:185 'inF1' ( in 3-component vector of float) +0:186 refract ( temp 3-component vector of float) +0:186 'inF0' ( in 3-component vector of float) +0:186 'inF1' ( in 3-component vector of float) +0:186 Constant: +0:186 2.000000 +0:? bitFieldReverse ( temp 3-component vector of int) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:? 3 (const int) +0:188 roundEven ( temp 3-component vector of float) +0:188 'inF0' ( in 3-component vector of float) +0:189 inverse sqrt ( temp 3-component vector of float) +0:189 'inF0' ( in 3-component vector of float) +0:190 clamp ( temp 3-component vector of float) +0:190 'inF0' ( in 3-component vector of float) +0:190 Constant: +0:190 0.000000 +0:190 Constant: +0:190 1.000000 +0:191 Sign ( temp 3-component vector of float) +0:191 'inF0' ( in 3-component vector of float) +0:192 sine ( temp 3-component vector of float) +0:192 'inF0' ( in 3-component vector of float) +0:193 Sequence +0:193 move second child to first child ( temp 3-component vector of float) +0:193 'inF1' ( in 3-component vector of float) +0:193 sine ( temp 3-component vector of float) +0:193 'inF0' ( in 3-component vector of float) +0:193 move second child to first child ( temp 3-component vector of float) +0:193 'inF2' ( in 3-component vector of float) +0:193 cosine ( temp 3-component vector of float) +0:193 'inF0' ( in 3-component vector of float) +0:194 hyp. sine ( temp 3-component vector of float) +0:194 'inF0' ( in 3-component vector of float) +0:195 smoothstep ( temp 3-component vector of float) +0:195 'inF0' ( in 3-component vector of float) +0:195 'inF1' ( in 3-component vector of float) +0:195 'inF2' ( in 3-component vector of float) +0:196 sqrt ( temp 3-component vector of float) +0:196 'inF0' ( in 3-component vector of float) +0:197 step ( temp 3-component vector of float) +0:197 'inF0' ( in 3-component vector of float) +0:197 'inF1' ( in 3-component vector of float) +0:198 tangent ( temp 3-component vector of float) +0:198 'inF0' ( in 3-component vector of float) +0:199 hyp. tangent ( temp 3-component vector of float) +0:199 'inF0' ( in 3-component vector of float) +0:201 trunc ( temp 3-component vector of float) +0:201 'inF0' ( in 3-component vector of float) +0:204 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:208 Function Definition: VertexShaderFunction4(vf4;vf4;vf4;vu4;vu4; ( temp 4-component vector of float) +0:208 Function Parameters: +0:208 'inF0' ( in 4-component vector of float) +0:208 'inF1' ( in 4-component vector of float) +0:208 'inF2' ( in 4-component vector of float) +0:208 'inU0' ( in 4-component vector of uint) +0:208 'inU1' ( in 4-component vector of uint) +0:? Sequence +0:209 all ( temp bool) +0:209 Convert float to bool ( temp 4-component vector of bool) +0:209 'inF0' ( in 4-component vector of float) +0:210 Absolute value ( temp 4-component vector of float) +0:210 'inF0' ( in 4-component vector of float) +0:211 arc cosine ( temp 4-component vector of float) +0:211 'inF0' ( in 4-component vector of float) +0:212 any ( temp bool) +0:212 Convert float to bool ( temp 4-component vector of bool) +0:212 'inF0' ( in 4-component vector of float) +0:213 arc sine ( temp 4-component vector of float) +0:213 'inF0' ( in 4-component vector of float) +0:214 floatBitsToInt ( temp 4-component vector of int) +0:214 'inF0' ( in 4-component vector of float) +0:215 floatBitsToUint ( temp 4-component vector of uint) +0:215 'inF0' ( in 4-component vector of float) +0:216 intBitsToFloat ( temp 4-component vector of float) +0:216 'inU0' ( in 4-component vector of uint) +0:218 arc tangent ( temp 4-component vector of float) +0:218 'inF0' ( in 4-component vector of float) +0:219 arc tangent ( temp 4-component vector of float) +0:219 'inF0' ( in 4-component vector of float) +0:219 'inF1' ( in 4-component vector of float) +0:220 Ceiling ( temp 4-component vector of float) +0:220 'inF0' ( in 4-component vector of float) +0:221 clamp ( temp 4-component vector of float) +0:221 'inF0' ( in 4-component vector of float) +0:221 'inF1' ( in 4-component vector of float) +0:221 'inF2' ( in 4-component vector of float) +0:222 cosine ( temp 4-component vector of float) +0:222 'inF0' ( in 4-component vector of float) +0:223 hyp. cosine ( temp 4-component vector of float) +0:223 'inF0' ( in 4-component vector of float) +0:? bitCount ( temp 4-component vector of int) +0:? Constant: +0:? 7 (const int) +0:? 3 (const int) +0:? 5 (const int) +0:? 2 (const int) +0:225 degrees ( temp 4-component vector of float) +0:225 'inF0' ( in 4-component vector of float) +0:226 distance ( temp float) +0:226 'inF0' ( in 4-component vector of float) +0:226 'inF1' ( in 4-component vector of float) +0:227 dot-product ( temp float) +0:227 'inF0' ( in 4-component vector of float) +0:227 'inF1' ( in 4-component vector of float) +0:228 Construct vec4 ( temp 4-component vector of float) +0:228 Constant: +0:228 1.000000 +0:228 component-wise multiply ( temp float) +0:228 direct index ( temp float) +0:228 'inF0' ( in 4-component vector of float) +0:228 Constant: +0:228 1 (const int) +0:228 direct index ( temp float) +0:228 'inF1' ( in 4-component vector of float) +0:228 Constant: +0:228 1 (const int) +0:228 direct index ( temp float) +0:228 'inF0' ( in 4-component vector of float) +0:228 Constant: +0:228 2 (const int) +0:228 direct index ( temp float) +0:228 'inF1' ( in 4-component vector of float) +0:228 Constant: +0:228 3 (const int) +0:232 exp ( temp 4-component vector of float) +0:232 'inF0' ( in 4-component vector of float) +0:233 exp2 ( temp 4-component vector of float) +0:233 'inF0' ( in 4-component vector of float) +0:234 face-forward ( temp 4-component vector of float) +0:234 'inF0' ( in 4-component vector of float) +0:234 'inF1' ( in 4-component vector of float) +0:234 'inF2' ( in 4-component vector of float) +0:235 findMSB ( temp int) +0:235 Constant: +0:235 7 (const int) +0:236 findLSB ( temp int) +0:236 Constant: +0:236 7 (const int) +0:237 Floor ( temp 4-component vector of float) +0:237 'inF0' ( in 4-component vector of float) +0:239 mod ( temp 4-component vector of float) +0:239 'inF0' ( in 4-component vector of float) +0:239 'inF1' ( in 4-component vector of float) +0:240 Fraction ( temp 4-component vector of float) +0:240 'inF0' ( in 4-component vector of float) +0:241 isinf ( temp 4-component vector of bool) +0:241 'inF0' ( in 4-component vector of float) +0:242 isnan ( temp 4-component vector of bool) +0:242 'inF0' ( in 4-component vector of float) +0:243 ldexp ( temp 4-component vector of float) +0:243 'inF0' ( in 4-component vector of float) +0:243 'inF1' ( in 4-component vector of float) +0:244 mix ( temp 4-component vector of float) +0:244 'inF0' ( in 4-component vector of float) +0:244 'inF1' ( in 4-component vector of float) +0:244 'inF2' ( in 4-component vector of float) +0:245 length ( temp float) +0:245 'inF0' ( in 4-component vector of float) +0:246 log ( temp 4-component vector of float) +0:246 'inF0' ( in 4-component vector of float) +0:247 vector-scale ( temp 4-component vector of float) +0:247 log2 ( temp 4-component vector of float) +0:247 'inF0' ( in 4-component vector of float) +0:247 Constant: +0:247 0.301030 +0:248 log2 ( temp 4-component vector of float) +0:248 'inF0' ( in 4-component vector of float) +0:249 max ( temp 4-component vector of float) +0:249 'inF0' ( in 4-component vector of float) +0:249 'inF1' ( in 4-component vector of float) +0:250 min ( temp 4-component vector of float) +0:250 'inF0' ( in 4-component vector of float) +0:250 'inF1' ( in 4-component vector of float) +0:252 normalize ( temp 4-component vector of float) +0:252 'inF0' ( in 4-component vector of float) +0:253 pow ( temp 4-component vector of float) +0:253 'inF0' ( in 4-component vector of float) +0:253 'inF1' ( in 4-component vector of float) +0:254 radians ( temp 4-component vector of float) +0:254 'inF0' ( in 4-component vector of float) +0:255 reflect ( temp 4-component vector of float) +0:255 'inF0' ( in 4-component vector of float) +0:255 'inF1' ( in 4-component vector of float) +0:256 refract ( temp 4-component vector of float) +0:256 'inF0' ( in 4-component vector of float) +0:256 'inF1' ( in 4-component vector of float) +0:256 Constant: +0:256 2.000000 +0:? bitFieldReverse ( temp 4-component vector of int) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:? 3 (const int) +0:? 4 (const int) +0:258 roundEven ( temp 4-component vector of float) +0:258 'inF0' ( in 4-component vector of float) +0:259 inverse sqrt ( temp 4-component vector of float) +0:259 'inF0' ( in 4-component vector of float) +0:260 clamp ( temp 4-component vector of float) +0:260 'inF0' ( in 4-component vector of float) +0:260 Constant: +0:260 0.000000 +0:260 Constant: +0:260 1.000000 +0:261 Sign ( temp 4-component vector of float) +0:261 'inF0' ( in 4-component vector of float) +0:262 sine ( temp 4-component vector of float) +0:262 'inF0' ( in 4-component vector of float) +0:263 Sequence +0:263 move second child to first child ( temp 4-component vector of float) +0:263 'inF1' ( in 4-component vector of float) +0:263 sine ( temp 4-component vector of float) +0:263 'inF0' ( in 4-component vector of float) +0:263 move second child to first child ( temp 4-component vector of float) +0:263 'inF2' ( in 4-component vector of float) +0:263 cosine ( temp 4-component vector of float) +0:263 'inF0' ( in 4-component vector of float) +0:264 hyp. sine ( temp 4-component vector of float) +0:264 'inF0' ( in 4-component vector of float) +0:265 smoothstep ( temp 4-component vector of float) +0:265 'inF0' ( in 4-component vector of float) +0:265 'inF1' ( in 4-component vector of float) +0:265 'inF2' ( in 4-component vector of float) +0:266 sqrt ( temp 4-component vector of float) +0:266 'inF0' ( in 4-component vector of float) +0:267 step ( temp 4-component vector of float) +0:267 'inF0' ( in 4-component vector of float) +0:267 'inF1' ( in 4-component vector of float) +0:268 tangent ( temp 4-component vector of float) +0:268 'inF0' ( in 4-component vector of float) +0:269 hyp. tangent ( temp 4-component vector of float) +0:269 'inF0' ( in 4-component vector of float) +0:271 trunc ( temp 4-component vector of float) +0:271 'inF0' ( in 4-component vector of float) +0:274 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:331 Function Definition: VertexShaderFunction2x2(mf22;mf22;mf22; ( temp 2X2 matrix of float) +0:331 Function Parameters: +0:331 'inF0' ( in 2X2 matrix of float) +0:331 'inF1' ( in 2X2 matrix of float) +0:331 'inF2' ( in 2X2 matrix of float) +0:? Sequence +0:333 all ( temp bool) +0:333 Convert float to bool ( temp 2X2 matrix of bool) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 Absolute value ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 arc cosine ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 any ( temp bool) +0:333 Convert float to bool ( temp 2X2 matrix of bool) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 arc sine ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 arc tangent ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 arc tangent ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 Ceiling ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 clamp ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 'inF2' ( in 2X2 matrix of float) +0:333 cosine ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 hyp. cosine ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 degrees ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 determinant ( temp float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 exp ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 exp2 ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 findMSB ( temp int) +0:333 Constant: +0:333 7 (const int) +0:333 findLSB ( temp int) +0:333 Constant: +0:333 7 (const int) +0:333 Floor ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 mod ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 Fraction ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 ldexp ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 mix ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 'inF2' ( in 2X2 matrix of float) +0:333 log ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 matrix-scale ( temp 2X2 matrix of float) +0:333 log2 ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 Constant: +0:333 0.301030 +0:333 log2 ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 max ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 min ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 pow ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 radians ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 roundEven ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 inverse sqrt ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 clamp ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 Constant: +0:333 0.000000 +0:333 Constant: +0:333 1.000000 +0:333 Sign ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 sine ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 Sequence +0:333 move second child to first child ( temp 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 sine ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 move second child to first child ( temp 2X2 matrix of float) +0:333 'inF2' ( in 2X2 matrix of float) +0:333 cosine ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 hyp. sine ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 smoothstep ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 'inF2' ( in 2X2 matrix of float) +0:333 sqrt ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 step ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 'inF1' ( in 2X2 matrix of float) +0:333 tangent ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 hyp. tangent ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 transpose ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:333 trunc ( temp 2X2 matrix of float) +0:333 'inF0' ( in 2X2 matrix of float) +0:336 Branch: Return with expression +0:? Constant: +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:340 Function Definition: VertexShaderFunction3x3(mf33;mf33;mf33; ( temp 3X3 matrix of float) +0:340 Function Parameters: +0:340 'inF0' ( in 3X3 matrix of float) +0:340 'inF1' ( in 3X3 matrix of float) +0:340 'inF2' ( in 3X3 matrix of float) +0:? Sequence +0:342 all ( temp bool) +0:342 Convert float to bool ( temp 3X3 matrix of bool) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 Absolute value ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 arc cosine ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 any ( temp bool) +0:342 Convert float to bool ( temp 3X3 matrix of bool) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 arc sine ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 arc tangent ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 arc tangent ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 Ceiling ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 clamp ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 'inF2' ( in 3X3 matrix of float) +0:342 cosine ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 hyp. cosine ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 degrees ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 determinant ( temp float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 exp ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 exp2 ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 findMSB ( temp int) +0:342 Constant: +0:342 7 (const int) +0:342 findLSB ( temp int) +0:342 Constant: +0:342 7 (const int) +0:342 Floor ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 mod ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 Fraction ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 ldexp ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 mix ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 'inF2' ( in 3X3 matrix of float) +0:342 log ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 matrix-scale ( temp 3X3 matrix of float) +0:342 log2 ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 Constant: +0:342 0.301030 +0:342 log2 ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 max ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 min ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 pow ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 radians ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 roundEven ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 inverse sqrt ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 clamp ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 Constant: +0:342 0.000000 +0:342 Constant: +0:342 1.000000 +0:342 Sign ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 sine ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 Sequence +0:342 move second child to first child ( temp 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 sine ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 move second child to first child ( temp 3X3 matrix of float) +0:342 'inF2' ( in 3X3 matrix of float) +0:342 cosine ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 hyp. sine ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 smoothstep ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 'inF2' ( in 3X3 matrix of float) +0:342 sqrt ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 step ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 'inF1' ( in 3X3 matrix of float) +0:342 tangent ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 hyp. tangent ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 transpose ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:342 trunc ( temp 3X3 matrix of float) +0:342 'inF0' ( in 3X3 matrix of float) +0:345 Branch: Return with expression +0:? Constant: +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:349 Function Definition: VertexShaderFunction4x4(mf44;mf44;mf44; ( temp 4X4 matrix of float) +0:349 Function Parameters: +0:349 'inF0' ( in 4X4 matrix of float) +0:349 'inF1' ( in 4X4 matrix of float) +0:349 'inF2' ( in 4X4 matrix of float) +0:? Sequence +0:351 all ( temp bool) +0:351 Convert float to bool ( temp 4X4 matrix of bool) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 Absolute value ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 arc cosine ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 any ( temp bool) +0:351 Convert float to bool ( temp 4X4 matrix of bool) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 arc sine ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 arc tangent ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 arc tangent ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 Ceiling ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 clamp ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 'inF2' ( in 4X4 matrix of float) +0:351 cosine ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 hyp. cosine ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 degrees ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 determinant ( temp float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 exp ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 exp2 ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 findMSB ( temp int) +0:351 Constant: +0:351 7 (const int) +0:351 findLSB ( temp int) +0:351 Constant: +0:351 7 (const int) +0:351 Floor ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 mod ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 Fraction ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 ldexp ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 mix ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 'inF2' ( in 4X4 matrix of float) +0:351 log ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 matrix-scale ( temp 4X4 matrix of float) +0:351 log2 ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 Constant: +0:351 0.301030 +0:351 log2 ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 max ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 min ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 pow ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 radians ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 roundEven ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 inverse sqrt ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 clamp ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 Constant: +0:351 0.000000 +0:351 Constant: +0:351 1.000000 +0:351 Sign ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 sine ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 Sequence +0:351 move second child to first child ( temp 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 sine ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 move second child to first child ( temp 4X4 matrix of float) +0:351 'inF2' ( in 4X4 matrix of float) +0:351 cosine ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 hyp. sine ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 smoothstep ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 'inF2' ( in 4X4 matrix of float) +0:351 sqrt ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 step ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 'inF1' ( in 4X4 matrix of float) +0:351 tangent ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 hyp. tangent ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 transpose ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:351 trunc ( temp 4X4 matrix of float) +0:351 'inF0' ( in 4X4 matrix of float) +0:354 Branch: Return with expression +0:? Constant: +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:372 Function Definition: TestGenMul2(f1;f1;vf2;vf2;mf22;mf22; ( temp void) +0:372 Function Parameters: +0:372 'inF0' ( in float) +0:372 'inF1' ( in float) +0:372 'inFV0' ( in 2-component vector of float) +0:372 'inFV1' ( in 2-component vector of float) +0:372 'inFM0' ( in 2X2 matrix of float) +0:372 'inFM1' ( in 2X2 matrix of float) +0:? Sequence +0:373 Sequence +0:373 move second child to first child ( temp float) +0:373 'r0' ( temp float) +0:373 component-wise multiply ( temp float) +0:373 'inF1' ( in float) +0:373 'inF0' ( in float) +0:373 Sequence +0:373 move second child to first child ( temp 2-component vector of float) +0:373 'r1' ( temp 2-component vector of float) +0:373 vector-scale ( temp 2-component vector of float) +0:373 'inF0' ( in float) +0:373 'inFV0' ( in 2-component vector of float) +0:373 Sequence +0:373 move second child to first child ( temp 2-component vector of float) +0:373 'r2' ( temp 2-component vector of float) +0:373 vector-scale ( temp 2-component vector of float) +0:373 'inFV0' ( in 2-component vector of float) +0:373 'inF0' ( in float) +0:373 Sequence +0:373 move second child to first child ( temp float) +0:373 'r3' ( temp float) +0:373 dot-product ( temp float) +0:373 'inFV0' ( in 2-component vector of float) +0:373 'inFV1' ( in 2-component vector of float) +0:373 Sequence +0:373 move second child to first child ( temp 2-component vector of float) +0:373 'r4' ( temp 2-component vector of float) +0:373 vector-times-matrix ( temp 2-component vector of float) +0:373 'inFV0' ( in 2-component vector of float) +0:373 'inFM0' ( in 2X2 matrix of float) +0:373 Sequence +0:373 move second child to first child ( temp 2-component vector of float) +0:373 'r5' ( temp 2-component vector of float) +0:373 matrix-times-vector ( temp 2-component vector of float) +0:373 'inFM0' ( in 2X2 matrix of float) +0:373 'inFV0' ( in 2-component vector of float) +0:373 Sequence +0:373 move second child to first child ( temp 2X2 matrix of float) +0:373 'r6' ( temp 2X2 matrix of float) +0:373 matrix-scale ( temp 2X2 matrix of float) +0:373 'inF0' ( in float) +0:373 'inFM0' ( in 2X2 matrix of float) +0:373 Sequence +0:373 move second child to first child ( temp 2X2 matrix of float) +0:373 'r7' ( temp 2X2 matrix of float) +0:373 matrix-scale ( temp 2X2 matrix of float) +0:373 'inFM0' ( in 2X2 matrix of float) +0:373 'inF0' ( in float) +0:373 Sequence +0:373 move second child to first child ( temp 2X2 matrix of float) +0:373 'r8' ( temp 2X2 matrix of float) +0:373 matrix-multiply ( temp 2X2 matrix of float) +0:373 'inFM1' ( in 2X2 matrix of float) +0:373 'inFM0' ( in 2X2 matrix of float) +0:379 Function Definition: TestGenMul3(f1;f1;vf3;vf3;mf33;mf33; ( temp void) +0:379 Function Parameters: +0:379 'inF0' ( in float) +0:379 'inF1' ( in float) +0:379 'inFV0' ( in 3-component vector of float) +0:379 'inFV1' ( in 3-component vector of float) +0:379 'inFM0' ( in 3X3 matrix of float) +0:379 'inFM1' ( in 3X3 matrix of float) +0:? Sequence +0:380 Sequence +0:380 move second child to first child ( temp float) +0:380 'r0' ( temp float) +0:380 component-wise multiply ( temp float) +0:380 'inF1' ( in float) +0:380 'inF0' ( in float) +0:380 Sequence +0:380 move second child to first child ( temp 3-component vector of float) +0:380 'r1' ( temp 3-component vector of float) +0:380 vector-scale ( temp 3-component vector of float) +0:380 'inF0' ( in float) +0:380 'inFV0' ( in 3-component vector of float) +0:380 Sequence +0:380 move second child to first child ( temp 3-component vector of float) +0:380 'r2' ( temp 3-component vector of float) +0:380 vector-scale ( temp 3-component vector of float) +0:380 'inFV0' ( in 3-component vector of float) +0:380 'inF0' ( in float) +0:380 Sequence +0:380 move second child to first child ( temp float) +0:380 'r3' ( temp float) +0:380 dot-product ( temp float) +0:380 'inFV0' ( in 3-component vector of float) +0:380 'inFV1' ( in 3-component vector of float) +0:380 Sequence +0:380 move second child to first child ( temp 3-component vector of float) +0:380 'r4' ( temp 3-component vector of float) +0:380 vector-times-matrix ( temp 3-component vector of float) +0:380 'inFV0' ( in 3-component vector of float) +0:380 'inFM0' ( in 3X3 matrix of float) +0:380 Sequence +0:380 move second child to first child ( temp 3-component vector of float) +0:380 'r5' ( temp 3-component vector of float) +0:380 matrix-times-vector ( temp 3-component vector of float) +0:380 'inFM0' ( in 3X3 matrix of float) +0:380 'inFV0' ( in 3-component vector of float) +0:380 Sequence +0:380 move second child to first child ( temp 3X3 matrix of float) +0:380 'r6' ( temp 3X3 matrix of float) +0:380 matrix-scale ( temp 3X3 matrix of float) +0:380 'inF0' ( in float) +0:380 'inFM0' ( in 3X3 matrix of float) +0:380 Sequence +0:380 move second child to first child ( temp 3X3 matrix of float) +0:380 'r7' ( temp 3X3 matrix of float) +0:380 matrix-scale ( temp 3X3 matrix of float) +0:380 'inFM0' ( in 3X3 matrix of float) +0:380 'inF0' ( in float) +0:380 Sequence +0:380 move second child to first child ( temp 3X3 matrix of float) +0:380 'r8' ( temp 3X3 matrix of float) +0:380 matrix-multiply ( temp 3X3 matrix of float) +0:380 'inFM1' ( in 3X3 matrix of float) +0:380 'inFM0' ( in 3X3 matrix of float) +0:386 Function Definition: TestGenMul4(f1;f1;vf4;vf4;mf44;mf44; ( temp void) +0:386 Function Parameters: +0:386 'inF0' ( in float) +0:386 'inF1' ( in float) +0:386 'inFV0' ( in 4-component vector of float) +0:386 'inFV1' ( in 4-component vector of float) +0:386 'inFM0' ( in 4X4 matrix of float) +0:386 'inFM1' ( in 4X4 matrix of float) +0:? Sequence +0:387 Sequence +0:387 move second child to first child ( temp float) +0:387 'r0' ( temp float) +0:387 component-wise multiply ( temp float) +0:387 'inF1' ( in float) +0:387 'inF0' ( in float) +0:387 Sequence +0:387 move second child to first child ( temp 4-component vector of float) +0:387 'r1' ( temp 4-component vector of float) +0:387 vector-scale ( temp 4-component vector of float) +0:387 'inF0' ( in float) +0:387 'inFV0' ( in 4-component vector of float) +0:387 Sequence +0:387 move second child to first child ( temp 4-component vector of float) +0:387 'r2' ( temp 4-component vector of float) +0:387 vector-scale ( temp 4-component vector of float) +0:387 'inFV0' ( in 4-component vector of float) +0:387 'inF0' ( in float) +0:387 Sequence +0:387 move second child to first child ( temp float) +0:387 'r3' ( temp float) +0:387 dot-product ( temp float) +0:387 'inFV0' ( in 4-component vector of float) +0:387 'inFV1' ( in 4-component vector of float) +0:387 Sequence +0:387 move second child to first child ( temp 4-component vector of float) +0:387 'r4' ( temp 4-component vector of float) +0:387 vector-times-matrix ( temp 4-component vector of float) +0:387 'inFV0' ( in 4-component vector of float) +0:387 'inFM0' ( in 4X4 matrix of float) +0:387 Sequence +0:387 move second child to first child ( temp 4-component vector of float) +0:387 'r5' ( temp 4-component vector of float) +0:387 matrix-times-vector ( temp 4-component vector of float) +0:387 'inFM0' ( in 4X4 matrix of float) +0:387 'inFV0' ( in 4-component vector of float) +0:387 Sequence +0:387 move second child to first child ( temp 4X4 matrix of float) +0:387 'r6' ( temp 4X4 matrix of float) +0:387 matrix-scale ( temp 4X4 matrix of float) +0:387 'inF0' ( in float) +0:387 'inFM0' ( in 4X4 matrix of float) +0:387 Sequence +0:387 move second child to first child ( temp 4X4 matrix of float) +0:387 'r7' ( temp 4X4 matrix of float) +0:387 matrix-scale ( temp 4X4 matrix of float) +0:387 'inFM0' ( in 4X4 matrix of float) +0:387 'inF0' ( in float) +0:387 Sequence +0:387 move second child to first child ( temp 4X4 matrix of float) +0:387 'r8' ( temp 4X4 matrix of float) +0:387 matrix-multiply ( temp 4X4 matrix of float) +0:387 'inFM1' ( in 4X4 matrix of float) +0:387 'inFM0' ( in 4X4 matrix of float) +0:396 Function Definition: TestGenMulNxM(f1;f1;vf2;vf3;mf23;mf32;mf33;mf34;mf24; ( temp void) +0:396 Function Parameters: +0:396 'inF0' ( in float) +0:396 'inF1' ( in float) +0:396 'inFV2' ( in 2-component vector of float) +0:396 'inFV3' ( in 3-component vector of float) +0:396 'inFM2x3' ( in 2X3 matrix of float) +0:396 'inFM3x2' ( in 3X2 matrix of float) +0:396 'inFM3x3' ( in 3X3 matrix of float) +0:396 'inFM3x4' ( in 3X4 matrix of float) +0:396 'inFM2x4' ( in 2X4 matrix of float) +0:? Sequence +0:397 Sequence +0:397 move second child to first child ( temp float) +0:397 'r00' ( temp float) +0:397 component-wise multiply ( temp float) +0:397 'inF1' ( in float) +0:397 'inF0' ( in float) +0:398 Sequence +0:398 move second child to first child ( temp 2-component vector of float) +0:398 'r01' ( temp 2-component vector of float) +0:398 vector-scale ( temp 2-component vector of float) +0:398 'inF0' ( in float) +0:398 'inFV2' ( in 2-component vector of float) +0:399 Sequence +0:399 move second child to first child ( temp 3-component vector of float) +0:399 'r02' ( temp 3-component vector of float) +0:399 vector-scale ( temp 3-component vector of float) +0:399 'inF0' ( in float) +0:399 'inFV3' ( in 3-component vector of float) +0:400 Sequence +0:400 move second child to first child ( temp 2-component vector of float) +0:400 'r03' ( temp 2-component vector of float) +0:400 vector-scale ( temp 2-component vector of float) +0:400 'inFV2' ( in 2-component vector of float) +0:400 'inF0' ( in float) +0:401 Sequence +0:401 move second child to first child ( temp 3-component vector of float) +0:401 'r04' ( temp 3-component vector of float) +0:401 vector-scale ( temp 3-component vector of float) +0:401 'inFV3' ( in 3-component vector of float) +0:401 'inF0' ( in float) +0:402 Sequence +0:402 move second child to first child ( temp float) +0:402 'r05' ( temp float) +0:402 dot-product ( temp float) +0:402 'inFV2' ( in 2-component vector of float) +0:402 'inFV2' ( in 2-component vector of float) +0:403 Sequence +0:403 move second child to first child ( temp float) +0:403 'r06' ( temp float) +0:403 dot-product ( temp float) +0:403 'inFV3' ( in 3-component vector of float) +0:403 'inFV3' ( in 3-component vector of float) +0:404 Sequence +0:404 move second child to first child ( temp 3-component vector of float) +0:404 'r07' ( temp 3-component vector of float) +0:404 matrix-times-vector ( temp 3-component vector of float) +0:404 'inFM2x3' ( in 2X3 matrix of float) +0:404 'inFV2' ( in 2-component vector of float) +0:405 Sequence +0:405 move second child to first child ( temp 2-component vector of float) +0:405 'r08' ( temp 2-component vector of float) +0:405 matrix-times-vector ( temp 2-component vector of float) +0:405 'inFM3x2' ( in 3X2 matrix of float) +0:405 'inFV3' ( in 3-component vector of float) +0:406 Sequence +0:406 move second child to first child ( temp 2-component vector of float) +0:406 'r09' ( temp 2-component vector of float) +0:406 vector-times-matrix ( temp 2-component vector of float) +0:406 'inFV3' ( in 3-component vector of float) +0:406 'inFM2x3' ( in 2X3 matrix of float) +0:407 Sequence +0:407 move second child to first child ( temp 3-component vector of float) +0:407 'r10' ( temp 3-component vector of float) +0:407 vector-times-matrix ( temp 3-component vector of float) +0:407 'inFV2' ( in 2-component vector of float) +0:407 'inFM3x2' ( in 3X2 matrix of float) +0:408 Sequence +0:408 move second child to first child ( temp 2X3 matrix of float) +0:408 'r11' ( temp 2X3 matrix of float) +0:408 matrix-scale ( temp 2X3 matrix of float) +0:408 'inF0' ( in float) +0:408 'inFM2x3' ( in 2X3 matrix of float) +0:409 Sequence +0:409 move second child to first child ( temp 3X2 matrix of float) +0:409 'r12' ( temp 3X2 matrix of float) +0:409 matrix-scale ( temp 3X2 matrix of float) +0:409 'inF0' ( in float) +0:409 'inFM3x2' ( in 3X2 matrix of float) +0:410 Sequence +0:410 move second child to first child ( temp 2X2 matrix of float) +0:410 'r13' ( temp 2X2 matrix of float) +0:410 matrix-multiply ( temp 2X2 matrix of float) +0:410 'inFM3x2' ( in 3X2 matrix of float) +0:410 'inFM2x3' ( in 2X3 matrix of float) +0:411 Sequence +0:411 move second child to first child ( temp 2X3 matrix of float) +0:411 'r14' ( temp 2X3 matrix of float) +0:411 matrix-multiply ( temp 2X3 matrix of float) +0:411 'inFM3x3' ( in 3X3 matrix of float) +0:411 'inFM2x3' ( in 2X3 matrix of float) +0:412 Sequence +0:412 move second child to first child ( temp 2X4 matrix of float) +0:412 'r15' ( temp 2X4 matrix of float) +0:412 matrix-multiply ( temp 2X4 matrix of float) +0:412 'inFM3x4' ( in 3X4 matrix of float) +0:412 'inFM2x3' ( in 2X3 matrix of float) +0:413 Sequence +0:413 move second child to first child ( temp 3X4 matrix of float) +0:413 'r16' ( temp 3X4 matrix of float) +0:413 matrix-multiply ( temp 3X4 matrix of float) +0:413 'inFM2x4' ( in 2X4 matrix of float) +0:413 'inFM3x2' ( in 3X2 matrix of float) +0:? Linker Objects + +error: SPIRV-Tools Validation Errors +error: Matrix types can only be parameterized with floating-point types. + %mat2v2bool = OpTypeMatrix %v2bool 2 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 1225 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "VertexShaderFunction" + Source HLSL 500 + Name 4 "VertexShaderFunction" + Name 16 "VertexShaderFunctionS(f1;f1;f1;u1;u1;" + Name 11 "inF0" + Name 12 "inF1" + Name 13 "inF2" + Name 14 "inU0" + Name 15 "inU1" + Name 22 "VertexShaderFunction1(vf1;vf1;vf1;" + Name 19 "inF0" + Name 20 "inF1" + Name 21 "inF2" + Name 34 "VertexShaderFunction2(vf2;vf2;vf2;vu2;vu2;" + Name 29 "inF0" + Name 30 "inF1" + Name 31 "inF2" + Name 32 "inU0" + Name 33 "inU1" + Name 46 "VertexShaderFunction3(vf3;vf3;vf3;vu3;vu3;" + Name 41 "inF0" + Name 42 "inF1" + Name 43 "inF2" + Name 44 "inU0" + Name 45 "inU1" + Name 58 "VertexShaderFunction4(vf4;vf4;vf4;vu4;vu4;" + Name 53 "inF0" + Name 54 "inF1" + Name 55 "inF2" + Name 56 "inU0" + Name 57 "inU1" + Name 66 "VertexShaderFunction2x2(mf22;mf22;mf22;" + Name 63 "inF0" + Name 64 "inF1" + Name 65 "inF2" + Name 74 "VertexShaderFunction3x3(mf33;mf33;mf33;" + Name 71 "inF0" + Name 72 "inF1" + Name 73 "inF2" + Name 82 "VertexShaderFunction4x4(mf44;mf44;mf44;" + Name 79 "inF0" + Name 80 "inF1" + Name 81 "inF2" + Name 91 "TestGenMul2(f1;f1;vf2;vf2;mf22;mf22;" + Name 85 "inF0" + Name 86 "inF1" + Name 87 "inFV0" + Name 88 "inFV1" + Name 89 "inFM0" + Name 90 "inFM1" + Name 100 "TestGenMul3(f1;f1;vf3;vf3;mf33;mf33;" + Name 94 "inF0" + Name 95 "inF1" + Name 96 "inFV0" + Name 97 "inFV1" + Name 98 "inFM0" + Name 99 "inFM1" + Name 109 "TestGenMul4(f1;f1;vf4;vf4;mf44;mf44;" + Name 103 "inF0" + Name 104 "inF1" + Name 105 "inFV0" + Name 106 "inFV1" + Name 107 "inFM0" + Name 108 "inFM1" + Name 129 "TestGenMulNxM(f1;f1;vf2;vf3;mf23;mf32;mf33;mf34;mf24;" + Name 120 "inF0" + Name 121 "inF1" + Name 122 "inFV2" + Name 123 "inFV3" + Name 124 "inFM2x3" + Name 125 "inFM3x2" + Name 126 "inFM3x3" + Name 127 "inFM3x4" + Name 128 "inFM2x4" + Name 1049 "r0" + Name 1053 "r1" + Name 1057 "r2" + Name 1061 "r3" + Name 1065 "r4" + Name 1069 "r5" + Name 1073 "r6" + Name 1077 "r7" + Name 1081 "r8" + Name 1085 "r0" + Name 1089 "r1" + Name 1093 "r2" + Name 1097 "r3" + Name 1101 "r4" + Name 1105 "r5" + Name 1109 "r6" + Name 1113 "r7" + Name 1117 "r8" + Name 1121 "r0" + Name 1125 "r1" + Name 1129 "r2" + Name 1133 "r3" + Name 1137 "r4" + Name 1141 "r5" + Name 1145 "r6" + Name 1149 "r7" + Name 1153 "r8" + Name 1157 "r00" + Name 1161 "r01" + Name 1165 "r02" + Name 1169 "r03" + Name 1173 "r04" + Name 1177 "r05" + Name 1181 "r06" + Name 1185 "r07" + Name 1189 "r08" + Name 1193 "r09" + Name 1197 "r10" + Name 1201 "r11" + Name 1205 "r12" + Name 1209 "r13" + Name 1213 "r14" + Name 1217 "r15" + Name 1221 "r16" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeInt 32 0 + 9: TypePointer Function 8(int) + 10: TypeFunction 6(float) 7(ptr) 7(ptr) 7(ptr) 9(ptr) 9(ptr) + 18: TypeFunction 6(float) 7(ptr) 7(ptr) 7(ptr) + 24: TypeVector 6(float) 2 + 25: TypePointer Function 24(fvec2) + 26: TypeVector 8(int) 2 + 27: TypePointer Function 26(ivec2) + 28: TypeFunction 24(fvec2) 25(ptr) 25(ptr) 25(ptr) 27(ptr) 27(ptr) + 36: TypeVector 6(float) 3 + 37: TypePointer Function 36(fvec3) + 38: TypeVector 8(int) 3 + 39: TypePointer Function 38(ivec3) + 40: TypeFunction 36(fvec3) 37(ptr) 37(ptr) 37(ptr) 39(ptr) 39(ptr) + 48: TypeVector 6(float) 4 + 49: TypePointer Function 48(fvec4) + 50: TypeVector 8(int) 4 + 51: TypePointer Function 50(ivec4) + 52: TypeFunction 48(fvec4) 49(ptr) 49(ptr) 49(ptr) 51(ptr) 51(ptr) + 60: TypeMatrix 24(fvec2) 2 + 61: TypePointer Function 60 + 62: TypeFunction 60 61(ptr) 61(ptr) 61(ptr) + 68: TypeMatrix 36(fvec3) 3 + 69: TypePointer Function 68 + 70: TypeFunction 68 69(ptr) 69(ptr) 69(ptr) + 76: TypeMatrix 48(fvec4) 4 + 77: TypePointer Function 76 + 78: TypeFunction 76 77(ptr) 77(ptr) 77(ptr) + 84: TypeFunction 2 7(ptr) 7(ptr) 25(ptr) 25(ptr) 61(ptr) 61(ptr) + 93: TypeFunction 2 7(ptr) 7(ptr) 37(ptr) 37(ptr) 69(ptr) 69(ptr) + 102: TypeFunction 2 7(ptr) 7(ptr) 49(ptr) 49(ptr) 77(ptr) 77(ptr) + 111: TypeMatrix 36(fvec3) 2 + 112: TypePointer Function 111 + 113: TypeMatrix 24(fvec2) 3 + 114: TypePointer Function 113 + 115: TypeMatrix 48(fvec4) 3 + 116: TypePointer Function 115 + 117: TypeMatrix 48(fvec4) 2 + 118: TypePointer Function 117 + 119: TypeFunction 2 7(ptr) 7(ptr) 25(ptr) 37(ptr) 112(ptr) 114(ptr) 69(ptr) 116(ptr) 118(ptr) + 132: TypeBool + 133: 6(float) Constant 0 + 146: TypeInt 32 1 + 167: 146(int) Constant 7 + 199: 6(float) Constant 1050288283 + 214: 146(int) Constant 2 + 221: 6(float) Constant 1065353216 + 253: TypeVector 132(bool) 2 + 254: 24(fvec2) ConstantComposite 133 133 + 267: TypeVector 146(int) 2 + 288: 146(int) Constant 3 + 289: 267(ivec2) ConstantComposite 167 288 + 354: 6(float) Constant 1073741824 + 356: 146(int) Constant 1 + 357: 267(ivec2) ConstantComposite 356 214 + 392: 24(fvec2) ConstantComposite 221 354 + 396: TypeVector 132(bool) 3 + 397: 36(fvec3) ConstantComposite 133 133 133 + 410: TypeVector 146(int) 3 + 431: 146(int) Constant 5 + 432: 410(ivec3) ConstantComposite 167 288 431 + 501: 410(ivec3) ConstantComposite 356 214 288 + 536: 6(float) Constant 1077936128 + 537: 36(fvec3) ConstantComposite 221 354 536 + 541: TypeVector 132(bool) 4 + 542: 48(fvec4) ConstantComposite 133 133 133 133 + 555: TypeVector 146(int) 4 + 576: 555(ivec4) ConstantComposite 167 288 431 214 + 586: 8(int) Constant 1 + 592: 8(int) Constant 2 + 595: 8(int) Constant 3 + 655: 146(int) Constant 4 + 656: 555(ivec4) ConstantComposite 356 214 288 655 + 691: 6(float) Constant 1082130432 + 692: 48(fvec4) ConstantComposite 221 354 536 691 + 696: TypeMatrix 253(bvec2) 2 + 806: 24(fvec2) ConstantComposite 354 354 + 807: 60 ConstantComposite 806 806 + 811: TypeMatrix 396(bvec3) 3 + 924: 36(fvec3) ConstantComposite 536 536 536 + 925: 68 ConstantComposite 924 924 924 + 929: TypeMatrix 541(bvec4) 4 + 1045: 48(fvec4) ConstantComposite 691 691 691 691 + 1046: 76 ConstantComposite 1045 1045 1045 1045 +4(VertexShaderFunction): 2 Function None 3 + 5: Label + Return + FunctionEnd +16(VertexShaderFunctionS(f1;f1;f1;u1;u1;): 6(float) Function None 10 + 11(inF0): 7(ptr) FunctionParameter + 12(inF1): 7(ptr) FunctionParameter + 13(inF2): 7(ptr) FunctionParameter + 14(inU0): 9(ptr) FunctionParameter + 15(inU1): 9(ptr) FunctionParameter + 17: Label + 131: 6(float) Load 11(inF0) + 134: 132(bool) FOrdNotEqual 131 133 + 135: 132(bool) All 134 + 136: 6(float) Load 11(inF0) + 137: 6(float) ExtInst 1(GLSL.std.450) 4(FAbs) 136 + 138: 6(float) Load 11(inF0) + 139: 6(float) ExtInst 1(GLSL.std.450) 17(Acos) 138 + 140: 6(float) Load 11(inF0) + 141: 132(bool) FOrdNotEqual 140 133 + 142: 132(bool) Any 141 + 143: 6(float) Load 11(inF0) + 144: 6(float) ExtInst 1(GLSL.std.450) 16(Asin) 143 + 145: 6(float) Load 11(inF0) + 147: 146(int) Bitcast 145 + 148: 6(float) Load 11(inF0) + 149: 8(int) Bitcast 148 + 150: 8(int) Load 14(inU0) + 151: 6(float) Bitcast 150 + 152: 6(float) Load 11(inF0) + 153: 6(float) ExtInst 1(GLSL.std.450) 18(Atan) 152 + 154: 6(float) Load 11(inF0) + 155: 6(float) Load 12(inF1) + 156: 6(float) ExtInst 1(GLSL.std.450) 25(Atan2) 154 155 + 157: 6(float) Load 11(inF0) + 158: 6(float) ExtInst 1(GLSL.std.450) 9(Ceil) 157 + 159: 6(float) Load 11(inF0) + 160: 6(float) Load 12(inF1) + 161: 6(float) Load 13(inF2) + 162: 6(float) ExtInst 1(GLSL.std.450) 43(FClamp) 159 160 161 + 163: 6(float) Load 11(inF0) + 164: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 163 + 165: 6(float) Load 11(inF0) + 166: 6(float) ExtInst 1(GLSL.std.450) 20(Cosh) 165 + 168: 146(int) BitCount 167 + 169: 6(float) Load 11(inF0) + 170: 6(float) ExtInst 1(GLSL.std.450) 12(Degrees) 169 + 171: 6(float) Load 11(inF0) + 172: 6(float) ExtInst 1(GLSL.std.450) 27(Exp) 171 + 173: 6(float) Load 11(inF0) + 174: 6(float) ExtInst 1(GLSL.std.450) 29(Exp2) 173 + 175: 146(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 167 + 176: 146(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 167 + 177: 6(float) Load 11(inF0) + 178: 6(float) ExtInst 1(GLSL.std.450) 8(Floor) 177 + 179: 6(float) Load 11(inF0) + 180: 6(float) Load 12(inF1) + 181: 6(float) FMod 179 180 + 182: 6(float) Load 11(inF0) + 183: 6(float) ExtInst 1(GLSL.std.450) 10(Fract) 182 + 184: 6(float) Load 11(inF0) + 185: 132(bool) IsInf 184 + 186: 6(float) Load 11(inF0) + 187: 132(bool) IsNan 186 + 188: 6(float) Load 11(inF0) + 189: 6(float) Load 12(inF1) + 190: 6(float) ExtInst 1(GLSL.std.450) 53(Ldexp) 188 189 + 191: 6(float) Load 11(inF0) + 192: 6(float) Load 12(inF1) + 193: 6(float) Load 13(inF2) + 194: 6(float) ExtInst 1(GLSL.std.450) 46(FMix) 191 192 193 + 195: 6(float) Load 11(inF0) + 196: 6(float) ExtInst 1(GLSL.std.450) 28(Log) 195 + 197: 6(float) Load 11(inF0) + 198: 6(float) ExtInst 1(GLSL.std.450) 30(Log2) 197 + 200: 6(float) FMul 198 199 + 201: 6(float) Load 11(inF0) + 202: 6(float) ExtInst 1(GLSL.std.450) 30(Log2) 201 + 203: 6(float) Load 11(inF0) + 204: 6(float) Load 12(inF1) + 205: 6(float) ExtInst 1(GLSL.std.450) 40(FMax) 203 204 + 206: 6(float) Load 11(inF0) + 207: 6(float) Load 12(inF1) + 208: 6(float) ExtInst 1(GLSL.std.450) 37(FMin) 206 207 + 209: 6(float) Load 11(inF0) + 210: 6(float) Load 12(inF1) + 211: 6(float) ExtInst 1(GLSL.std.450) 26(Pow) 209 210 + 212: 6(float) Load 11(inF0) + 213: 6(float) ExtInst 1(GLSL.std.450) 11(Radians) 212 + 215: 146(int) BitReverse 214 + 216: 6(float) Load 11(inF0) + 217: 6(float) ExtInst 1(GLSL.std.450) 2(RoundEven) 216 + 218: 6(float) Load 11(inF0) + 219: 6(float) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 218 + 220: 6(float) Load 11(inF0) + 222: 6(float) ExtInst 1(GLSL.std.450) 43(FClamp) 220 133 221 + 223: 6(float) Load 11(inF0) + 224: 6(float) ExtInst 1(GLSL.std.450) 6(FSign) 223 + 225: 6(float) Load 11(inF0) + 226: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 225 + 227: 6(float) Load 11(inF0) + 228: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 227 + Store 12(inF1) 228 + 229: 6(float) Load 11(inF0) + 230: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 229 + Store 13(inF2) 230 + 231: 6(float) Load 11(inF0) + 232: 6(float) ExtInst 1(GLSL.std.450) 19(Sinh) 231 + 233: 6(float) Load 11(inF0) + 234: 6(float) Load 12(inF1) + 235: 6(float) Load 13(inF2) + 236: 6(float) ExtInst 1(GLSL.std.450) 49(SmoothStep) 233 234 235 + 237: 6(float) Load 11(inF0) + 238: 6(float) ExtInst 1(GLSL.std.450) 31(Sqrt) 237 + 239: 6(float) Load 11(inF0) + 240: 6(float) Load 12(inF1) + 241: 6(float) ExtInst 1(GLSL.std.450) 48(Step) 239 240 + 242: 6(float) Load 11(inF0) + 243: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 242 + 244: 6(float) Load 11(inF0) + 245: 6(float) ExtInst 1(GLSL.std.450) 21(Tanh) 244 + 246: 6(float) Load 11(inF0) + 247: 6(float) ExtInst 1(GLSL.std.450) 3(Trunc) 246 + ReturnValue 133 + FunctionEnd +22(VertexShaderFunction1(vf1;vf1;vf1;): 6(float) Function None 18 + 19(inF0): 7(ptr) FunctionParameter + 20(inF1): 7(ptr) FunctionParameter + 21(inF2): 7(ptr) FunctionParameter + 23: Label + ReturnValue 133 + FunctionEnd +34(VertexShaderFunction2(vf2;vf2;vf2;vu2;vu2;): 24(fvec2) Function None 28 + 29(inF0): 25(ptr) FunctionParameter + 30(inF1): 25(ptr) FunctionParameter + 31(inF2): 25(ptr) FunctionParameter + 32(inU0): 27(ptr) FunctionParameter + 33(inU1): 27(ptr) FunctionParameter + 35: Label + 252: 24(fvec2) Load 29(inF0) + 255: 253(bvec2) FOrdNotEqual 252 254 + 256: 132(bool) All 255 + 257: 24(fvec2) Load 29(inF0) + 258: 24(fvec2) ExtInst 1(GLSL.std.450) 4(FAbs) 257 + 259: 24(fvec2) Load 29(inF0) + 260: 24(fvec2) ExtInst 1(GLSL.std.450) 17(Acos) 259 + 261: 24(fvec2) Load 29(inF0) + 262: 253(bvec2) FOrdNotEqual 261 254 + 263: 132(bool) Any 262 + 264: 24(fvec2) Load 29(inF0) + 265: 24(fvec2) ExtInst 1(GLSL.std.450) 16(Asin) 264 + 266: 24(fvec2) Load 29(inF0) + 268: 267(ivec2) Bitcast 266 + 269: 24(fvec2) Load 29(inF0) + 270: 26(ivec2) Bitcast 269 + 271: 26(ivec2) Load 32(inU0) + 272: 24(fvec2) Bitcast 271 + 273: 24(fvec2) Load 29(inF0) + 274: 24(fvec2) ExtInst 1(GLSL.std.450) 18(Atan) 273 + 275: 24(fvec2) Load 29(inF0) + 276: 24(fvec2) Load 30(inF1) + 277: 24(fvec2) ExtInst 1(GLSL.std.450) 25(Atan2) 275 276 + 278: 24(fvec2) Load 29(inF0) + 279: 24(fvec2) ExtInst 1(GLSL.std.450) 9(Ceil) 278 + 280: 24(fvec2) Load 29(inF0) + 281: 24(fvec2) Load 30(inF1) + 282: 24(fvec2) Load 31(inF2) + 283: 24(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 280 281 282 + 284: 24(fvec2) Load 29(inF0) + 285: 24(fvec2) ExtInst 1(GLSL.std.450) 14(Cos) 284 + 286: 24(fvec2) Load 29(inF0) + 287: 24(fvec2) ExtInst 1(GLSL.std.450) 20(Cosh) 286 + 290: 267(ivec2) BitCount 289 + 291: 24(fvec2) Load 29(inF0) + 292: 24(fvec2) ExtInst 1(GLSL.std.450) 12(Degrees) 291 + 293: 24(fvec2) Load 29(inF0) + 294: 24(fvec2) Load 30(inF1) + 295: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 293 294 + 296: 24(fvec2) Load 29(inF0) + 297: 24(fvec2) Load 30(inF1) + 298: 6(float) Dot 296 297 + 299: 24(fvec2) Load 29(inF0) + 300: 24(fvec2) ExtInst 1(GLSL.std.450) 27(Exp) 299 + 301: 24(fvec2) Load 29(inF0) + 302: 24(fvec2) ExtInst 1(GLSL.std.450) 29(Exp2) 301 + 303: 24(fvec2) Load 29(inF0) + 304: 24(fvec2) Load 30(inF1) + 305: 24(fvec2) Load 31(inF2) + 306: 24(fvec2) ExtInst 1(GLSL.std.450) 70(FaceForward) 303 304 305 + 307: 146(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 167 + 308: 146(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 167 + 309: 24(fvec2) Load 29(inF0) + 310: 24(fvec2) ExtInst 1(GLSL.std.450) 8(Floor) 309 + 311: 24(fvec2) Load 29(inF0) + 312: 24(fvec2) Load 30(inF1) + 313: 24(fvec2) FMod 311 312 + 314: 24(fvec2) Load 29(inF0) + 315: 24(fvec2) ExtInst 1(GLSL.std.450) 10(Fract) 314 + 316: 24(fvec2) Load 29(inF0) + 317: 253(bvec2) IsInf 316 + 318: 24(fvec2) Load 29(inF0) + 319: 253(bvec2) IsNan 318 + 320: 24(fvec2) Load 29(inF0) + 321: 24(fvec2) Load 30(inF1) + 322: 24(fvec2) ExtInst 1(GLSL.std.450) 53(Ldexp) 320 321 + 323: 24(fvec2) Load 29(inF0) + 324: 24(fvec2) Load 30(inF1) + 325: 24(fvec2) Load 31(inF2) + 326: 24(fvec2) ExtInst 1(GLSL.std.450) 46(FMix) 323 324 325 + 327: 24(fvec2) Load 29(inF0) + 328: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 327 + 329: 24(fvec2) Load 29(inF0) + 330: 24(fvec2) ExtInst 1(GLSL.std.450) 28(Log) 329 + 331: 24(fvec2) Load 29(inF0) + 332: 24(fvec2) ExtInst 1(GLSL.std.450) 30(Log2) 331 + 333: 24(fvec2) VectorTimesScalar 332 199 + 334: 24(fvec2) Load 29(inF0) + 335: 24(fvec2) ExtInst 1(GLSL.std.450) 30(Log2) 334 + 336: 24(fvec2) Load 29(inF0) + 337: 24(fvec2) Load 30(inF1) + 338: 24(fvec2) ExtInst 1(GLSL.std.450) 40(FMax) 336 337 + 339: 24(fvec2) Load 29(inF0) + 340: 24(fvec2) Load 30(inF1) + 341: 24(fvec2) ExtInst 1(GLSL.std.450) 37(FMin) 339 340 + 342: 24(fvec2) Load 29(inF0) + 343: 24(fvec2) ExtInst 1(GLSL.std.450) 69(Normalize) 342 + 344: 24(fvec2) Load 29(inF0) + 345: 24(fvec2) Load 30(inF1) + 346: 24(fvec2) ExtInst 1(GLSL.std.450) 26(Pow) 344 345 + 347: 24(fvec2) Load 29(inF0) + 348: 24(fvec2) ExtInst 1(GLSL.std.450) 11(Radians) 347 + 349: 24(fvec2) Load 29(inF0) + 350: 24(fvec2) Load 30(inF1) + 351: 24(fvec2) ExtInst 1(GLSL.std.450) 71(Reflect) 349 350 + 352: 24(fvec2) Load 29(inF0) + 353: 24(fvec2) Load 30(inF1) + 355: 24(fvec2) ExtInst 1(GLSL.std.450) 72(Refract) 352 353 354 + 358: 267(ivec2) BitReverse 357 + 359: 24(fvec2) Load 29(inF0) + 360: 24(fvec2) ExtInst 1(GLSL.std.450) 2(RoundEven) 359 + 361: 24(fvec2) Load 29(inF0) + 362: 24(fvec2) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 361 + 363: 24(fvec2) Load 29(inF0) + 364: 24(fvec2) CompositeConstruct 133 133 + 365: 24(fvec2) CompositeConstruct 221 221 + 366: 24(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 363 364 365 + 367: 24(fvec2) Load 29(inF0) + 368: 24(fvec2) ExtInst 1(GLSL.std.450) 6(FSign) 367 + 369: 24(fvec2) Load 29(inF0) + 370: 24(fvec2) ExtInst 1(GLSL.std.450) 13(Sin) 369 + 371: 24(fvec2) Load 29(inF0) + 372: 24(fvec2) ExtInst 1(GLSL.std.450) 13(Sin) 371 + Store 30(inF1) 372 + 373: 24(fvec2) Load 29(inF0) + 374: 24(fvec2) ExtInst 1(GLSL.std.450) 14(Cos) 373 + Store 31(inF2) 374 + 375: 24(fvec2) Load 29(inF0) + 376: 24(fvec2) ExtInst 1(GLSL.std.450) 19(Sinh) 375 + 377: 24(fvec2) Load 29(inF0) + 378: 24(fvec2) Load 30(inF1) + 379: 24(fvec2) Load 31(inF2) + 380: 24(fvec2) ExtInst 1(GLSL.std.450) 49(SmoothStep) 377 378 379 + 381: 24(fvec2) Load 29(inF0) + 382: 24(fvec2) ExtInst 1(GLSL.std.450) 31(Sqrt) 381 + 383: 24(fvec2) Load 29(inF0) + 384: 24(fvec2) Load 30(inF1) + 385: 24(fvec2) ExtInst 1(GLSL.std.450) 48(Step) 383 384 + 386: 24(fvec2) Load 29(inF0) + 387: 24(fvec2) ExtInst 1(GLSL.std.450) 15(Tan) 386 + 388: 24(fvec2) Load 29(inF0) + 389: 24(fvec2) ExtInst 1(GLSL.std.450) 21(Tanh) 388 + 390: 24(fvec2) Load 29(inF0) + 391: 24(fvec2) ExtInst 1(GLSL.std.450) 3(Trunc) 390 + ReturnValue 392 + FunctionEnd +46(VertexShaderFunction3(vf3;vf3;vf3;vu3;vu3;): 36(fvec3) Function None 40 + 41(inF0): 37(ptr) FunctionParameter + 42(inF1): 37(ptr) FunctionParameter + 43(inF2): 37(ptr) FunctionParameter + 44(inU0): 39(ptr) FunctionParameter + 45(inU1): 39(ptr) FunctionParameter + 47: Label + 395: 36(fvec3) Load 41(inF0) + 398: 396(bvec3) FOrdNotEqual 395 397 + 399: 132(bool) All 398 + 400: 36(fvec3) Load 41(inF0) + 401: 36(fvec3) ExtInst 1(GLSL.std.450) 4(FAbs) 400 + 402: 36(fvec3) Load 41(inF0) + 403: 36(fvec3) ExtInst 1(GLSL.std.450) 17(Acos) 402 + 404: 36(fvec3) Load 41(inF0) + 405: 396(bvec3) FOrdNotEqual 404 397 + 406: 132(bool) Any 405 + 407: 36(fvec3) Load 41(inF0) + 408: 36(fvec3) ExtInst 1(GLSL.std.450) 16(Asin) 407 + 409: 36(fvec3) Load 41(inF0) + 411: 410(ivec3) Bitcast 409 + 412: 36(fvec3) Load 41(inF0) + 413: 38(ivec3) Bitcast 412 + 414: 38(ivec3) Load 44(inU0) + 415: 36(fvec3) Bitcast 414 + 416: 36(fvec3) Load 41(inF0) + 417: 36(fvec3) ExtInst 1(GLSL.std.450) 18(Atan) 416 + 418: 36(fvec3) Load 41(inF0) + 419: 36(fvec3) Load 42(inF1) + 420: 36(fvec3) ExtInst 1(GLSL.std.450) 25(Atan2) 418 419 + 421: 36(fvec3) Load 41(inF0) + 422: 36(fvec3) ExtInst 1(GLSL.std.450) 9(Ceil) 421 + 423: 36(fvec3) Load 41(inF0) + 424: 36(fvec3) Load 42(inF1) + 425: 36(fvec3) Load 43(inF2) + 426: 36(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 423 424 425 + 427: 36(fvec3) Load 41(inF0) + 428: 36(fvec3) ExtInst 1(GLSL.std.450) 14(Cos) 427 + 429: 36(fvec3) Load 41(inF0) + 430: 36(fvec3) ExtInst 1(GLSL.std.450) 20(Cosh) 429 + 433: 410(ivec3) BitCount 432 + 434: 36(fvec3) Load 41(inF0) + 435: 36(fvec3) Load 42(inF1) + 436: 36(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 434 435 + 437: 36(fvec3) Load 41(inF0) + 438: 36(fvec3) ExtInst 1(GLSL.std.450) 12(Degrees) 437 + 439: 36(fvec3) Load 41(inF0) + 440: 36(fvec3) Load 42(inF1) + 441: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 439 440 + 442: 36(fvec3) Load 41(inF0) + 443: 36(fvec3) Load 42(inF1) + 444: 6(float) Dot 442 443 + 445: 36(fvec3) Load 41(inF0) + 446: 36(fvec3) ExtInst 1(GLSL.std.450) 27(Exp) 445 + 447: 36(fvec3) Load 41(inF0) + 448: 36(fvec3) ExtInst 1(GLSL.std.450) 29(Exp2) 447 + 449: 36(fvec3) Load 41(inF0) + 450: 36(fvec3) Load 42(inF1) + 451: 36(fvec3) Load 43(inF2) + 452: 36(fvec3) ExtInst 1(GLSL.std.450) 70(FaceForward) 449 450 451 + 453: 146(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 167 + 454: 146(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 167 + 455: 36(fvec3) Load 41(inF0) + 456: 36(fvec3) ExtInst 1(GLSL.std.450) 8(Floor) 455 + 457: 36(fvec3) Load 41(inF0) + 458: 36(fvec3) Load 42(inF1) + 459: 36(fvec3) FMod 457 458 + 460: 36(fvec3) Load 41(inF0) + 461: 36(fvec3) ExtInst 1(GLSL.std.450) 10(Fract) 460 + 462: 36(fvec3) Load 41(inF0) + 463: 396(bvec3) IsInf 462 + 464: 36(fvec3) Load 41(inF0) + 465: 396(bvec3) IsNan 464 + 466: 36(fvec3) Load 41(inF0) + 467: 36(fvec3) Load 42(inF1) + 468: 36(fvec3) ExtInst 1(GLSL.std.450) 53(Ldexp) 466 467 + 469: 36(fvec3) Load 41(inF0) + 470: 36(fvec3) Load 42(inF1) + 471: 36(fvec3) Load 43(inF2) + 472: 36(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 469 470 471 + 473: 36(fvec3) Load 41(inF0) + 474: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 473 + 475: 36(fvec3) Load 41(inF0) + 476: 36(fvec3) ExtInst 1(GLSL.std.450) 28(Log) 475 + 477: 36(fvec3) Load 41(inF0) + 478: 36(fvec3) ExtInst 1(GLSL.std.450) 30(Log2) 477 + 479: 36(fvec3) VectorTimesScalar 478 199 + 480: 36(fvec3) Load 41(inF0) + 481: 36(fvec3) ExtInst 1(GLSL.std.450) 30(Log2) 480 + 482: 36(fvec3) Load 41(inF0) + 483: 36(fvec3) Load 42(inF1) + 484: 36(fvec3) ExtInst 1(GLSL.std.450) 40(FMax) 482 483 + 485: 36(fvec3) Load 41(inF0) + 486: 36(fvec3) Load 42(inF1) + 487: 36(fvec3) ExtInst 1(GLSL.std.450) 37(FMin) 485 486 + 488: 36(fvec3) Load 41(inF0) + 489: 36(fvec3) ExtInst 1(GLSL.std.450) 69(Normalize) 488 + 490: 36(fvec3) Load 41(inF0) + 491: 36(fvec3) Load 42(inF1) + 492: 36(fvec3) ExtInst 1(GLSL.std.450) 26(Pow) 490 491 + 493: 36(fvec3) Load 41(inF0) + 494: 36(fvec3) ExtInst 1(GLSL.std.450) 11(Radians) 493 + 495: 36(fvec3) Load 41(inF0) + 496: 36(fvec3) Load 42(inF1) + 497: 36(fvec3) ExtInst 1(GLSL.std.450) 71(Reflect) 495 496 + 498: 36(fvec3) Load 41(inF0) + 499: 36(fvec3) Load 42(inF1) + 500: 36(fvec3) ExtInst 1(GLSL.std.450) 72(Refract) 498 499 354 + 502: 410(ivec3) BitReverse 501 + 503: 36(fvec3) Load 41(inF0) + 504: 36(fvec3) ExtInst 1(GLSL.std.450) 2(RoundEven) 503 + 505: 36(fvec3) Load 41(inF0) + 506: 36(fvec3) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 505 + 507: 36(fvec3) Load 41(inF0) + 508: 36(fvec3) CompositeConstruct 133 133 133 + 509: 36(fvec3) CompositeConstruct 221 221 221 + 510: 36(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 507 508 509 + 511: 36(fvec3) Load 41(inF0) + 512: 36(fvec3) ExtInst 1(GLSL.std.450) 6(FSign) 511 + 513: 36(fvec3) Load 41(inF0) + 514: 36(fvec3) ExtInst 1(GLSL.std.450) 13(Sin) 513 + 515: 36(fvec3) Load 41(inF0) + 516: 36(fvec3) ExtInst 1(GLSL.std.450) 13(Sin) 515 + Store 42(inF1) 516 + 517: 36(fvec3) Load 41(inF0) + 518: 36(fvec3) ExtInst 1(GLSL.std.450) 14(Cos) 517 + Store 43(inF2) 518 + 519: 36(fvec3) Load 41(inF0) + 520: 36(fvec3) ExtInst 1(GLSL.std.450) 19(Sinh) 519 + 521: 36(fvec3) Load 41(inF0) + 522: 36(fvec3) Load 42(inF1) + 523: 36(fvec3) Load 43(inF2) + 524: 36(fvec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 521 522 523 + 525: 36(fvec3) Load 41(inF0) + 526: 36(fvec3) ExtInst 1(GLSL.std.450) 31(Sqrt) 525 + 527: 36(fvec3) Load 41(inF0) + 528: 36(fvec3) Load 42(inF1) + 529: 36(fvec3) ExtInst 1(GLSL.std.450) 48(Step) 527 528 + 530: 36(fvec3) Load 41(inF0) + 531: 36(fvec3) ExtInst 1(GLSL.std.450) 15(Tan) 530 + 532: 36(fvec3) Load 41(inF0) + 533: 36(fvec3) ExtInst 1(GLSL.std.450) 21(Tanh) 532 + 534: 36(fvec3) Load 41(inF0) + 535: 36(fvec3) ExtInst 1(GLSL.std.450) 3(Trunc) 534 + ReturnValue 537 + FunctionEnd +58(VertexShaderFunction4(vf4;vf4;vf4;vu4;vu4;): 48(fvec4) Function None 52 + 53(inF0): 49(ptr) FunctionParameter + 54(inF1): 49(ptr) FunctionParameter + 55(inF2): 49(ptr) FunctionParameter + 56(inU0): 51(ptr) FunctionParameter + 57(inU1): 51(ptr) FunctionParameter + 59: Label + 540: 48(fvec4) Load 53(inF0) + 543: 541(bvec4) FOrdNotEqual 540 542 + 544: 132(bool) All 543 + 545: 48(fvec4) Load 53(inF0) + 546: 48(fvec4) ExtInst 1(GLSL.std.450) 4(FAbs) 545 + 547: 48(fvec4) Load 53(inF0) + 548: 48(fvec4) ExtInst 1(GLSL.std.450) 17(Acos) 547 + 549: 48(fvec4) Load 53(inF0) + 550: 541(bvec4) FOrdNotEqual 549 542 + 551: 132(bool) Any 550 + 552: 48(fvec4) Load 53(inF0) + 553: 48(fvec4) ExtInst 1(GLSL.std.450) 16(Asin) 552 + 554: 48(fvec4) Load 53(inF0) + 556: 555(ivec4) Bitcast 554 + 557: 48(fvec4) Load 53(inF0) + 558: 50(ivec4) Bitcast 557 + 559: 50(ivec4) Load 56(inU0) + 560: 48(fvec4) Bitcast 559 + 561: 48(fvec4) Load 53(inF0) + 562: 48(fvec4) ExtInst 1(GLSL.std.450) 18(Atan) 561 + 563: 48(fvec4) Load 53(inF0) + 564: 48(fvec4) Load 54(inF1) + 565: 48(fvec4) ExtInst 1(GLSL.std.450) 25(Atan2) 563 564 + 566: 48(fvec4) Load 53(inF0) + 567: 48(fvec4) ExtInst 1(GLSL.std.450) 9(Ceil) 566 + 568: 48(fvec4) Load 53(inF0) + 569: 48(fvec4) Load 54(inF1) + 570: 48(fvec4) Load 55(inF2) + 571: 48(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 568 569 570 + 572: 48(fvec4) Load 53(inF0) + 573: 48(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 572 + 574: 48(fvec4) Load 53(inF0) + 575: 48(fvec4) ExtInst 1(GLSL.std.450) 20(Cosh) 574 + 577: 555(ivec4) BitCount 576 + 578: 48(fvec4) Load 53(inF0) + 579: 48(fvec4) ExtInst 1(GLSL.std.450) 12(Degrees) 578 + 580: 48(fvec4) Load 53(inF0) + 581: 48(fvec4) Load 54(inF1) + 582: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 580 581 + 583: 48(fvec4) Load 53(inF0) + 584: 48(fvec4) Load 54(inF1) + 585: 6(float) Dot 583 584 + 587: 7(ptr) AccessChain 53(inF0) 586 + 588: 6(float) Load 587 + 589: 7(ptr) AccessChain 54(inF1) 586 + 590: 6(float) Load 589 + 591: 6(float) FMul 588 590 + 593: 7(ptr) AccessChain 53(inF0) 592 + 594: 6(float) Load 593 + 596: 7(ptr) AccessChain 54(inF1) 595 + 597: 6(float) Load 596 + 598: 48(fvec4) CompositeConstruct 221 591 594 597 + 599: 48(fvec4) Load 53(inF0) + 600: 48(fvec4) ExtInst 1(GLSL.std.450) 27(Exp) 599 + 601: 48(fvec4) Load 53(inF0) + 602: 48(fvec4) ExtInst 1(GLSL.std.450) 29(Exp2) 601 + 603: 48(fvec4) Load 53(inF0) + 604: 48(fvec4) Load 54(inF1) + 605: 48(fvec4) Load 55(inF2) + 606: 48(fvec4) ExtInst 1(GLSL.std.450) 70(FaceForward) 603 604 605 + 607: 146(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 167 + 608: 146(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 167 + 609: 48(fvec4) Load 53(inF0) + 610: 48(fvec4) ExtInst 1(GLSL.std.450) 8(Floor) 609 + 611: 48(fvec4) Load 53(inF0) + 612: 48(fvec4) Load 54(inF1) + 613: 48(fvec4) FMod 611 612 + 614: 48(fvec4) Load 53(inF0) + 615: 48(fvec4) ExtInst 1(GLSL.std.450) 10(Fract) 614 + 616: 48(fvec4) Load 53(inF0) + 617: 541(bvec4) IsInf 616 + 618: 48(fvec4) Load 53(inF0) + 619: 541(bvec4) IsNan 618 + 620: 48(fvec4) Load 53(inF0) + 621: 48(fvec4) Load 54(inF1) + 622: 48(fvec4) ExtInst 1(GLSL.std.450) 53(Ldexp) 620 621 + 623: 48(fvec4) Load 53(inF0) + 624: 48(fvec4) Load 54(inF1) + 625: 48(fvec4) Load 55(inF2) + 626: 48(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 623 624 625 + 627: 48(fvec4) Load 53(inF0) + 628: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 627 + 629: 48(fvec4) Load 53(inF0) + 630: 48(fvec4) ExtInst 1(GLSL.std.450) 28(Log) 629 + 631: 48(fvec4) Load 53(inF0) + 632: 48(fvec4) ExtInst 1(GLSL.std.450) 30(Log2) 631 + 633: 48(fvec4) VectorTimesScalar 632 199 + 634: 48(fvec4) Load 53(inF0) + 635: 48(fvec4) ExtInst 1(GLSL.std.450) 30(Log2) 634 + 636: 48(fvec4) Load 53(inF0) + 637: 48(fvec4) Load 54(inF1) + 638: 48(fvec4) ExtInst 1(GLSL.std.450) 40(FMax) 636 637 + 639: 48(fvec4) Load 53(inF0) + 640: 48(fvec4) Load 54(inF1) + 641: 48(fvec4) ExtInst 1(GLSL.std.450) 37(FMin) 639 640 + 642: 48(fvec4) Load 53(inF0) + 643: 48(fvec4) ExtInst 1(GLSL.std.450) 69(Normalize) 642 + 644: 48(fvec4) Load 53(inF0) + 645: 48(fvec4) Load 54(inF1) + 646: 48(fvec4) ExtInst 1(GLSL.std.450) 26(Pow) 644 645 + 647: 48(fvec4) Load 53(inF0) + 648: 48(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 647 + 649: 48(fvec4) Load 53(inF0) + 650: 48(fvec4) Load 54(inF1) + 651: 48(fvec4) ExtInst 1(GLSL.std.450) 71(Reflect) 649 650 + 652: 48(fvec4) Load 53(inF0) + 653: 48(fvec4) Load 54(inF1) + 654: 48(fvec4) ExtInst 1(GLSL.std.450) 72(Refract) 652 653 354 + 657: 555(ivec4) BitReverse 656 + 658: 48(fvec4) Load 53(inF0) + 659: 48(fvec4) ExtInst 1(GLSL.std.450) 2(RoundEven) 658 + 660: 48(fvec4) Load 53(inF0) + 661: 48(fvec4) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 660 + 662: 48(fvec4) Load 53(inF0) + 663: 48(fvec4) CompositeConstruct 133 133 133 133 + 664: 48(fvec4) CompositeConstruct 221 221 221 221 + 665: 48(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 662 663 664 + 666: 48(fvec4) Load 53(inF0) + 667: 48(fvec4) ExtInst 1(GLSL.std.450) 6(FSign) 666 + 668: 48(fvec4) Load 53(inF0) + 669: 48(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 668 + 670: 48(fvec4) Load 53(inF0) + 671: 48(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 670 + Store 54(inF1) 671 + 672: 48(fvec4) Load 53(inF0) + 673: 48(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 672 + Store 55(inF2) 673 + 674: 48(fvec4) Load 53(inF0) + 675: 48(fvec4) ExtInst 1(GLSL.std.450) 19(Sinh) 674 + 676: 48(fvec4) Load 53(inF0) + 677: 48(fvec4) Load 54(inF1) + 678: 48(fvec4) Load 55(inF2) + 679: 48(fvec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 676 677 678 + 680: 48(fvec4) Load 53(inF0) + 681: 48(fvec4) ExtInst 1(GLSL.std.450) 31(Sqrt) 680 + 682: 48(fvec4) Load 53(inF0) + 683: 48(fvec4) Load 54(inF1) + 684: 48(fvec4) ExtInst 1(GLSL.std.450) 48(Step) 682 683 + 685: 48(fvec4) Load 53(inF0) + 686: 48(fvec4) ExtInst 1(GLSL.std.450) 15(Tan) 685 + 687: 48(fvec4) Load 53(inF0) + 688: 48(fvec4) ExtInst 1(GLSL.std.450) 21(Tanh) 687 + 689: 48(fvec4) Load 53(inF0) + 690: 48(fvec4) ExtInst 1(GLSL.std.450) 3(Trunc) 689 + ReturnValue 692 + FunctionEnd +66(VertexShaderFunction2x2(mf22;mf22;mf22;): 60 Function None 62 + 63(inF0): 61(ptr) FunctionParameter + 64(inF1): 61(ptr) FunctionParameter + 65(inF2): 61(ptr) FunctionParameter + 67: Label + 695: 60 Load 63(inF0) + 697: 696 FOrdNotEqual 695 133 + 698: 132(bool) All 697 + 699: 60 Load 63(inF0) + 700: 60 ExtInst 1(GLSL.std.450) 4(FAbs) 699 + 701: 60 Load 63(inF0) + 702: 60 ExtInst 1(GLSL.std.450) 17(Acos) 701 + 703: 60 Load 63(inF0) + 704: 696 FOrdNotEqual 703 133 + 705: 132(bool) Any 704 + 706: 60 Load 63(inF0) + 707: 60 ExtInst 1(GLSL.std.450) 16(Asin) 706 + 708: 60 Load 63(inF0) + 709: 60 ExtInst 1(GLSL.std.450) 18(Atan) 708 + 710: 60 Load 63(inF0) + 711: 60 Load 64(inF1) + 712: 60 ExtInst 1(GLSL.std.450) 25(Atan2) 710 711 + 713: 60 Load 63(inF0) + 714: 60 ExtInst 1(GLSL.std.450) 9(Ceil) 713 + 715: 60 Load 63(inF0) + 716: 60 Load 64(inF1) + 717: 60 Load 65(inF2) + 718: 60 ExtInst 1(GLSL.std.450) 43(FClamp) 715 716 717 + 719: 60 Load 63(inF0) + 720: 60 ExtInst 1(GLSL.std.450) 14(Cos) 719 + 721: 60 Load 63(inF0) + 722: 60 ExtInst 1(GLSL.std.450) 20(Cosh) 721 + 723: 60 Load 63(inF0) + 724: 60 ExtInst 1(GLSL.std.450) 12(Degrees) 723 + 725: 60 Load 63(inF0) + 726: 6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 725 + 727: 60 Load 63(inF0) + 728: 60 ExtInst 1(GLSL.std.450) 27(Exp) 727 + 729: 60 Load 63(inF0) + 730: 60 ExtInst 1(GLSL.std.450) 29(Exp2) 729 + 731: 146(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 167 + 732: 146(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 167 + 733: 60 Load 63(inF0) + 734: 60 ExtInst 1(GLSL.std.450) 8(Floor) 733 + 735: 60 Load 63(inF0) + 736: 60 Load 64(inF1) + 737: 24(fvec2) CompositeExtract 735 0 + 738: 24(fvec2) CompositeExtract 736 0 + 739: 24(fvec2) FMod 737 738 + 740: 24(fvec2) CompositeExtract 735 1 + 741: 24(fvec2) CompositeExtract 736 1 + 742: 24(fvec2) FMod 740 741 + 743: 60 CompositeConstruct 739 742 + 744: 60 Load 63(inF0) + 745: 60 ExtInst 1(GLSL.std.450) 10(Fract) 744 + 746: 60 Load 63(inF0) + 747: 60 Load 64(inF1) + 748: 60 ExtInst 1(GLSL.std.450) 53(Ldexp) 746 747 + 749: 60 Load 63(inF0) + 750: 60 Load 64(inF1) + 751: 60 Load 65(inF2) + 752: 60 ExtInst 1(GLSL.std.450) 46(FMix) 749 750 751 + 753: 60 Load 63(inF0) + 754: 60 ExtInst 1(GLSL.std.450) 28(Log) 753 + 755: 60 Load 63(inF0) + 756: 60 ExtInst 1(GLSL.std.450) 30(Log2) 755 + 757: 60 MatrixTimesScalar 756 199 + 758: 60 Load 63(inF0) + 759: 60 ExtInst 1(GLSL.std.450) 30(Log2) 758 + 760: 60 Load 63(inF0) + 761: 60 Load 64(inF1) + 762: 60 ExtInst 1(GLSL.std.450) 40(FMax) 760 761 + 763: 60 Load 63(inF0) + 764: 60 Load 64(inF1) + 765: 60 ExtInst 1(GLSL.std.450) 37(FMin) 763 764 + 766: 60 Load 63(inF0) + 767: 60 Load 64(inF1) + 768: 60 ExtInst 1(GLSL.std.450) 26(Pow) 766 767 + 769: 60 Load 63(inF0) + 770: 60 ExtInst 1(GLSL.std.450) 11(Radians) 769 + 771: 60 Load 63(inF0) + 772: 60 ExtInst 1(GLSL.std.450) 2(RoundEven) 771 + 773: 60 Load 63(inF0) + 774: 60 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 773 + 775: 60 Load 63(inF0) + 776: 24(fvec2) CompositeConstruct 133 133 + 777: 24(fvec2) CompositeConstruct 221 221 + 778: 60 ExtInst 1(GLSL.std.450) 43(FClamp) 775 776 777 + 779: 60 Load 63(inF0) + 780: 60 ExtInst 1(GLSL.std.450) 6(FSign) 779 + 781: 60 Load 63(inF0) + 782: 60 ExtInst 1(GLSL.std.450) 13(Sin) 781 + 783: 60 Load 63(inF0) + 784: 60 ExtInst 1(GLSL.std.450) 13(Sin) 783 + Store 64(inF1) 784 + 785: 60 Load 63(inF0) + 786: 60 ExtInst 1(GLSL.std.450) 14(Cos) 785 + Store 65(inF2) 786 + 787: 60 Load 63(inF0) + 788: 60 ExtInst 1(GLSL.std.450) 19(Sinh) 787 + 789: 60 Load 63(inF0) + 790: 60 Load 64(inF1) + 791: 60 Load 65(inF2) + 792: 60 ExtInst 1(GLSL.std.450) 49(SmoothStep) 789 790 791 + 793: 60 Load 63(inF0) + 794: 60 ExtInst 1(GLSL.std.450) 31(Sqrt) 793 + 795: 60 Load 63(inF0) + 796: 60 Load 64(inF1) + 797: 60 ExtInst 1(GLSL.std.450) 48(Step) 795 796 + 798: 60 Load 63(inF0) + 799: 60 ExtInst 1(GLSL.std.450) 15(Tan) 798 + 800: 60 Load 63(inF0) + 801: 60 ExtInst 1(GLSL.std.450) 21(Tanh) 800 + 802: 60 Load 63(inF0) + 803: 60 Transpose 802 + 804: 60 Load 63(inF0) + 805: 60 ExtInst 1(GLSL.std.450) 3(Trunc) 804 + ReturnValue 807 + FunctionEnd +74(VertexShaderFunction3x3(mf33;mf33;mf33;): 68 Function None 70 + 71(inF0): 69(ptr) FunctionParameter + 72(inF1): 69(ptr) FunctionParameter + 73(inF2): 69(ptr) FunctionParameter + 75: Label + 810: 68 Load 71(inF0) + 812: 811 FOrdNotEqual 810 133 + 813: 132(bool) All 812 + 814: 68 Load 71(inF0) + 815: 68 ExtInst 1(GLSL.std.450) 4(FAbs) 814 + 816: 68 Load 71(inF0) + 817: 68 ExtInst 1(GLSL.std.450) 17(Acos) 816 + 818: 68 Load 71(inF0) + 819: 811 FOrdNotEqual 818 133 + 820: 132(bool) Any 819 + 821: 68 Load 71(inF0) + 822: 68 ExtInst 1(GLSL.std.450) 16(Asin) 821 + 823: 68 Load 71(inF0) + 824: 68 ExtInst 1(GLSL.std.450) 18(Atan) 823 + 825: 68 Load 71(inF0) + 826: 68 Load 72(inF1) + 827: 68 ExtInst 1(GLSL.std.450) 25(Atan2) 825 826 + 828: 68 Load 71(inF0) + 829: 68 ExtInst 1(GLSL.std.450) 9(Ceil) 828 + 830: 68 Load 71(inF0) + 831: 68 Load 72(inF1) + 832: 68 Load 73(inF2) + 833: 68 ExtInst 1(GLSL.std.450) 43(FClamp) 830 831 832 + 834: 68 Load 71(inF0) + 835: 68 ExtInst 1(GLSL.std.450) 14(Cos) 834 + 836: 68 Load 71(inF0) + 837: 68 ExtInst 1(GLSL.std.450) 20(Cosh) 836 + 838: 68 Load 71(inF0) + 839: 68 ExtInst 1(GLSL.std.450) 12(Degrees) 838 + 840: 68 Load 71(inF0) + 841: 6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 840 + 842: 68 Load 71(inF0) + 843: 68 ExtInst 1(GLSL.std.450) 27(Exp) 842 + 844: 68 Load 71(inF0) + 845: 68 ExtInst 1(GLSL.std.450) 29(Exp2) 844 + 846: 146(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 167 + 847: 146(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 167 + 848: 68 Load 71(inF0) + 849: 68 ExtInst 1(GLSL.std.450) 8(Floor) 848 + 850: 68 Load 71(inF0) + 851: 68 Load 72(inF1) + 852: 36(fvec3) CompositeExtract 850 0 + 853: 36(fvec3) CompositeExtract 851 0 + 854: 36(fvec3) FMod 852 853 + 855: 36(fvec3) CompositeExtract 850 1 + 856: 36(fvec3) CompositeExtract 851 1 + 857: 36(fvec3) FMod 855 856 + 858: 36(fvec3) CompositeExtract 850 2 + 859: 36(fvec3) CompositeExtract 851 2 + 860: 36(fvec3) FMod 858 859 + 861: 68 CompositeConstruct 854 857 860 + 862: 68 Load 71(inF0) + 863: 68 ExtInst 1(GLSL.std.450) 10(Fract) 862 + 864: 68 Load 71(inF0) + 865: 68 Load 72(inF1) + 866: 68 ExtInst 1(GLSL.std.450) 53(Ldexp) 864 865 + 867: 68 Load 71(inF0) + 868: 68 Load 72(inF1) + 869: 68 Load 73(inF2) + 870: 68 ExtInst 1(GLSL.std.450) 46(FMix) 867 868 869 + 871: 68 Load 71(inF0) + 872: 68 ExtInst 1(GLSL.std.450) 28(Log) 871 + 873: 68 Load 71(inF0) + 874: 68 ExtInst 1(GLSL.std.450) 30(Log2) 873 + 875: 68 MatrixTimesScalar 874 199 + 876: 68 Load 71(inF0) + 877: 68 ExtInst 1(GLSL.std.450) 30(Log2) 876 + 878: 68 Load 71(inF0) + 879: 68 Load 72(inF1) + 880: 68 ExtInst 1(GLSL.std.450) 40(FMax) 878 879 + 881: 68 Load 71(inF0) + 882: 68 Load 72(inF1) + 883: 68 ExtInst 1(GLSL.std.450) 37(FMin) 881 882 + 884: 68 Load 71(inF0) + 885: 68 Load 72(inF1) + 886: 68 ExtInst 1(GLSL.std.450) 26(Pow) 884 885 + 887: 68 Load 71(inF0) + 888: 68 ExtInst 1(GLSL.std.450) 11(Radians) 887 + 889: 68 Load 71(inF0) + 890: 68 ExtInst 1(GLSL.std.450) 2(RoundEven) 889 + 891: 68 Load 71(inF0) + 892: 68 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 891 + 893: 68 Load 71(inF0) + 894: 36(fvec3) CompositeConstruct 133 133 133 + 895: 36(fvec3) CompositeConstruct 221 221 221 + 896: 68 ExtInst 1(GLSL.std.450) 43(FClamp) 893 894 895 + 897: 68 Load 71(inF0) + 898: 68 ExtInst 1(GLSL.std.450) 6(FSign) 897 + 899: 68 Load 71(inF0) + 900: 68 ExtInst 1(GLSL.std.450) 13(Sin) 899 + 901: 68 Load 71(inF0) + 902: 68 ExtInst 1(GLSL.std.450) 13(Sin) 901 + Store 72(inF1) 902 + 903: 68 Load 71(inF0) + 904: 68 ExtInst 1(GLSL.std.450) 14(Cos) 903 + Store 73(inF2) 904 + 905: 68 Load 71(inF0) + 906: 68 ExtInst 1(GLSL.std.450) 19(Sinh) 905 + 907: 68 Load 71(inF0) + 908: 68 Load 72(inF1) + 909: 68 Load 73(inF2) + 910: 68 ExtInst 1(GLSL.std.450) 49(SmoothStep) 907 908 909 + 911: 68 Load 71(inF0) + 912: 68 ExtInst 1(GLSL.std.450) 31(Sqrt) 911 + 913: 68 Load 71(inF0) + 914: 68 Load 72(inF1) + 915: 68 ExtInst 1(GLSL.std.450) 48(Step) 913 914 + 916: 68 Load 71(inF0) + 917: 68 ExtInst 1(GLSL.std.450) 15(Tan) 916 + 918: 68 Load 71(inF0) + 919: 68 ExtInst 1(GLSL.std.450) 21(Tanh) 918 + 920: 68 Load 71(inF0) + 921: 68 Transpose 920 + 922: 68 Load 71(inF0) + 923: 68 ExtInst 1(GLSL.std.450) 3(Trunc) 922 + ReturnValue 925 + FunctionEnd +82(VertexShaderFunction4x4(mf44;mf44;mf44;): 76 Function None 78 + 79(inF0): 77(ptr) FunctionParameter + 80(inF1): 77(ptr) FunctionParameter + 81(inF2): 77(ptr) FunctionParameter + 83: Label + 928: 76 Load 79(inF0) + 930: 929 FOrdNotEqual 928 133 + 931: 132(bool) All 930 + 932: 76 Load 79(inF0) + 933: 76 ExtInst 1(GLSL.std.450) 4(FAbs) 932 + 934: 76 Load 79(inF0) + 935: 76 ExtInst 1(GLSL.std.450) 17(Acos) 934 + 936: 76 Load 79(inF0) + 937: 929 FOrdNotEqual 936 133 + 938: 132(bool) Any 937 + 939: 76 Load 79(inF0) + 940: 76 ExtInst 1(GLSL.std.450) 16(Asin) 939 + 941: 76 Load 79(inF0) + 942: 76 ExtInst 1(GLSL.std.450) 18(Atan) 941 + 943: 76 Load 79(inF0) + 944: 76 Load 80(inF1) + 945: 76 ExtInst 1(GLSL.std.450) 25(Atan2) 943 944 + 946: 76 Load 79(inF0) + 947: 76 ExtInst 1(GLSL.std.450) 9(Ceil) 946 + 948: 76 Load 79(inF0) + 949: 76 Load 80(inF1) + 950: 76 Load 81(inF2) + 951: 76 ExtInst 1(GLSL.std.450) 43(FClamp) 948 949 950 + 952: 76 Load 79(inF0) + 953: 76 ExtInst 1(GLSL.std.450) 14(Cos) 952 + 954: 76 Load 79(inF0) + 955: 76 ExtInst 1(GLSL.std.450) 20(Cosh) 954 + 956: 76 Load 79(inF0) + 957: 76 ExtInst 1(GLSL.std.450) 12(Degrees) 956 + 958: 76 Load 79(inF0) + 959: 6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 958 + 960: 76 Load 79(inF0) + 961: 76 ExtInst 1(GLSL.std.450) 27(Exp) 960 + 962: 76 Load 79(inF0) + 963: 76 ExtInst 1(GLSL.std.450) 29(Exp2) 962 + 964: 146(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 167 + 965: 146(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 167 + 966: 76 Load 79(inF0) + 967: 76 ExtInst 1(GLSL.std.450) 8(Floor) 966 + 968: 76 Load 79(inF0) + 969: 76 Load 80(inF1) + 970: 48(fvec4) CompositeExtract 968 0 + 971: 48(fvec4) CompositeExtract 969 0 + 972: 48(fvec4) FMod 970 971 + 973: 48(fvec4) CompositeExtract 968 1 + 974: 48(fvec4) CompositeExtract 969 1 + 975: 48(fvec4) FMod 973 974 + 976: 48(fvec4) CompositeExtract 968 2 + 977: 48(fvec4) CompositeExtract 969 2 + 978: 48(fvec4) FMod 976 977 + 979: 48(fvec4) CompositeExtract 968 3 + 980: 48(fvec4) CompositeExtract 969 3 + 981: 48(fvec4) FMod 979 980 + 982: 76 CompositeConstruct 972 975 978 981 + 983: 76 Load 79(inF0) + 984: 76 ExtInst 1(GLSL.std.450) 10(Fract) 983 + 985: 76 Load 79(inF0) + 986: 76 Load 80(inF1) + 987: 76 ExtInst 1(GLSL.std.450) 53(Ldexp) 985 986 + 988: 76 Load 79(inF0) + 989: 76 Load 80(inF1) + 990: 76 Load 81(inF2) + 991: 76 ExtInst 1(GLSL.std.450) 46(FMix) 988 989 990 + 992: 76 Load 79(inF0) + 993: 76 ExtInst 1(GLSL.std.450) 28(Log) 992 + 994: 76 Load 79(inF0) + 995: 76 ExtInst 1(GLSL.std.450) 30(Log2) 994 + 996: 76 MatrixTimesScalar 995 199 + 997: 76 Load 79(inF0) + 998: 76 ExtInst 1(GLSL.std.450) 30(Log2) 997 + 999: 76 Load 79(inF0) + 1000: 76 Load 80(inF1) + 1001: 76 ExtInst 1(GLSL.std.450) 40(FMax) 999 1000 + 1002: 76 Load 79(inF0) + 1003: 76 Load 80(inF1) + 1004: 76 ExtInst 1(GLSL.std.450) 37(FMin) 1002 1003 + 1005: 76 Load 79(inF0) + 1006: 76 Load 80(inF1) + 1007: 76 ExtInst 1(GLSL.std.450) 26(Pow) 1005 1006 + 1008: 76 Load 79(inF0) + 1009: 76 ExtInst 1(GLSL.std.450) 11(Radians) 1008 + 1010: 76 Load 79(inF0) + 1011: 76 ExtInst 1(GLSL.std.450) 2(RoundEven) 1010 + 1012: 76 Load 79(inF0) + 1013: 76 ExtInst 1(GLSL.std.450) 32(InverseSqrt) 1012 + 1014: 76 Load 79(inF0) + 1015: 48(fvec4) CompositeConstruct 133 133 133 133 + 1016: 48(fvec4) CompositeConstruct 221 221 221 221 + 1017: 76 ExtInst 1(GLSL.std.450) 43(FClamp) 1014 1015 1016 + 1018: 76 Load 79(inF0) + 1019: 76 ExtInst 1(GLSL.std.450) 6(FSign) 1018 + 1020: 76 Load 79(inF0) + 1021: 76 ExtInst 1(GLSL.std.450) 13(Sin) 1020 + 1022: 76 Load 79(inF0) + 1023: 76 ExtInst 1(GLSL.std.450) 13(Sin) 1022 + Store 80(inF1) 1023 + 1024: 76 Load 79(inF0) + 1025: 76 ExtInst 1(GLSL.std.450) 14(Cos) 1024 + Store 81(inF2) 1025 + 1026: 76 Load 79(inF0) + 1027: 76 ExtInst 1(GLSL.std.450) 19(Sinh) 1026 + 1028: 76 Load 79(inF0) + 1029: 76 Load 80(inF1) + 1030: 76 Load 81(inF2) + 1031: 76 ExtInst 1(GLSL.std.450) 49(SmoothStep) 1028 1029 1030 + 1032: 76 Load 79(inF0) + 1033: 76 ExtInst 1(GLSL.std.450) 31(Sqrt) 1032 + 1034: 76 Load 79(inF0) + 1035: 76 Load 80(inF1) + 1036: 76 ExtInst 1(GLSL.std.450) 48(Step) 1034 1035 + 1037: 76 Load 79(inF0) + 1038: 76 ExtInst 1(GLSL.std.450) 15(Tan) 1037 + 1039: 76 Load 79(inF0) + 1040: 76 ExtInst 1(GLSL.std.450) 21(Tanh) 1039 + 1041: 76 Load 79(inF0) + 1042: 76 Transpose 1041 + 1043: 76 Load 79(inF0) + 1044: 76 ExtInst 1(GLSL.std.450) 3(Trunc) 1043 + ReturnValue 1046 + FunctionEnd +91(TestGenMul2(f1;f1;vf2;vf2;mf22;mf22;): 2 Function None 84 + 85(inF0): 7(ptr) FunctionParameter + 86(inF1): 7(ptr) FunctionParameter + 87(inFV0): 25(ptr) FunctionParameter + 88(inFV1): 25(ptr) FunctionParameter + 89(inFM0): 61(ptr) FunctionParameter + 90(inFM1): 61(ptr) FunctionParameter + 92: Label + 1049(r0): 7(ptr) Variable Function + 1053(r1): 25(ptr) Variable Function + 1057(r2): 25(ptr) Variable Function + 1061(r3): 7(ptr) Variable Function + 1065(r4): 25(ptr) Variable Function + 1069(r5): 25(ptr) Variable Function + 1073(r6): 61(ptr) Variable Function + 1077(r7): 61(ptr) Variable Function + 1081(r8): 61(ptr) Variable Function + 1050: 6(float) Load 86(inF1) + 1051: 6(float) Load 85(inF0) + 1052: 6(float) FMul 1050 1051 + Store 1049(r0) 1052 + 1054: 6(float) Load 85(inF0) + 1055: 24(fvec2) Load 87(inFV0) + 1056: 24(fvec2) VectorTimesScalar 1055 1054 + Store 1053(r1) 1056 + 1058: 24(fvec2) Load 87(inFV0) + 1059: 6(float) Load 85(inF0) + 1060: 24(fvec2) VectorTimesScalar 1058 1059 + Store 1057(r2) 1060 + 1062: 24(fvec2) Load 87(inFV0) + 1063: 24(fvec2) Load 88(inFV1) + 1064: 6(float) Dot 1062 1063 + Store 1061(r3) 1064 + 1066: 24(fvec2) Load 87(inFV0) + 1067: 60 Load 89(inFM0) + 1068: 24(fvec2) VectorTimesMatrix 1066 1067 + Store 1065(r4) 1068 + 1070: 60 Load 89(inFM0) + 1071: 24(fvec2) Load 87(inFV0) + 1072: 24(fvec2) MatrixTimesVector 1070 1071 + Store 1069(r5) 1072 + 1074: 6(float) Load 85(inF0) + 1075: 60 Load 89(inFM0) + 1076: 60 MatrixTimesScalar 1075 1074 + Store 1073(r6) 1076 + 1078: 60 Load 89(inFM0) + 1079: 6(float) Load 85(inF0) + 1080: 60 MatrixTimesScalar 1078 1079 + Store 1077(r7) 1080 + 1082: 60 Load 90(inFM1) + 1083: 60 Load 89(inFM0) + 1084: 60 MatrixTimesMatrix 1082 1083 + Store 1081(r8) 1084 + Return + FunctionEnd +100(TestGenMul3(f1;f1;vf3;vf3;mf33;mf33;): 2 Function None 93 + 94(inF0): 7(ptr) FunctionParameter + 95(inF1): 7(ptr) FunctionParameter + 96(inFV0): 37(ptr) FunctionParameter + 97(inFV1): 37(ptr) FunctionParameter + 98(inFM0): 69(ptr) FunctionParameter + 99(inFM1): 69(ptr) FunctionParameter + 101: Label + 1085(r0): 7(ptr) Variable Function + 1089(r1): 37(ptr) Variable Function + 1093(r2): 37(ptr) Variable Function + 1097(r3): 7(ptr) Variable Function + 1101(r4): 37(ptr) Variable Function + 1105(r5): 37(ptr) Variable Function + 1109(r6): 69(ptr) Variable Function + 1113(r7): 69(ptr) Variable Function + 1117(r8): 69(ptr) Variable Function + 1086: 6(float) Load 95(inF1) + 1087: 6(float) Load 94(inF0) + 1088: 6(float) FMul 1086 1087 + Store 1085(r0) 1088 + 1090: 6(float) Load 94(inF0) + 1091: 36(fvec3) Load 96(inFV0) + 1092: 36(fvec3) VectorTimesScalar 1091 1090 + Store 1089(r1) 1092 + 1094: 36(fvec3) Load 96(inFV0) + 1095: 6(float) Load 94(inF0) + 1096: 36(fvec3) VectorTimesScalar 1094 1095 + Store 1093(r2) 1096 + 1098: 36(fvec3) Load 96(inFV0) + 1099: 36(fvec3) Load 97(inFV1) + 1100: 6(float) Dot 1098 1099 + Store 1097(r3) 1100 + 1102: 36(fvec3) Load 96(inFV0) + 1103: 68 Load 98(inFM0) + 1104: 36(fvec3) VectorTimesMatrix 1102 1103 + Store 1101(r4) 1104 + 1106: 68 Load 98(inFM0) + 1107: 36(fvec3) Load 96(inFV0) + 1108: 36(fvec3) MatrixTimesVector 1106 1107 + Store 1105(r5) 1108 + 1110: 6(float) Load 94(inF0) + 1111: 68 Load 98(inFM0) + 1112: 68 MatrixTimesScalar 1111 1110 + Store 1109(r6) 1112 + 1114: 68 Load 98(inFM0) + 1115: 6(float) Load 94(inF0) + 1116: 68 MatrixTimesScalar 1114 1115 + Store 1113(r7) 1116 + 1118: 68 Load 99(inFM1) + 1119: 68 Load 98(inFM0) + 1120: 68 MatrixTimesMatrix 1118 1119 + Store 1117(r8) 1120 + Return + FunctionEnd +109(TestGenMul4(f1;f1;vf4;vf4;mf44;mf44;): 2 Function None 102 + 103(inF0): 7(ptr) FunctionParameter + 104(inF1): 7(ptr) FunctionParameter + 105(inFV0): 49(ptr) FunctionParameter + 106(inFV1): 49(ptr) FunctionParameter + 107(inFM0): 77(ptr) FunctionParameter + 108(inFM1): 77(ptr) FunctionParameter + 110: Label + 1121(r0): 7(ptr) Variable Function + 1125(r1): 49(ptr) Variable Function + 1129(r2): 49(ptr) Variable Function + 1133(r3): 7(ptr) Variable Function + 1137(r4): 49(ptr) Variable Function + 1141(r5): 49(ptr) Variable Function + 1145(r6): 77(ptr) Variable Function + 1149(r7): 77(ptr) Variable Function + 1153(r8): 77(ptr) Variable Function + 1122: 6(float) Load 104(inF1) + 1123: 6(float) Load 103(inF0) + 1124: 6(float) FMul 1122 1123 + Store 1121(r0) 1124 + 1126: 6(float) Load 103(inF0) + 1127: 48(fvec4) Load 105(inFV0) + 1128: 48(fvec4) VectorTimesScalar 1127 1126 + Store 1125(r1) 1128 + 1130: 48(fvec4) Load 105(inFV0) + 1131: 6(float) Load 103(inF0) + 1132: 48(fvec4) VectorTimesScalar 1130 1131 + Store 1129(r2) 1132 + 1134: 48(fvec4) Load 105(inFV0) + 1135: 48(fvec4) Load 106(inFV1) + 1136: 6(float) Dot 1134 1135 + Store 1133(r3) 1136 + 1138: 48(fvec4) Load 105(inFV0) + 1139: 76 Load 107(inFM0) + 1140: 48(fvec4) VectorTimesMatrix 1138 1139 + Store 1137(r4) 1140 + 1142: 76 Load 107(inFM0) + 1143: 48(fvec4) Load 105(inFV0) + 1144: 48(fvec4) MatrixTimesVector 1142 1143 + Store 1141(r5) 1144 + 1146: 6(float) Load 103(inF0) + 1147: 76 Load 107(inFM0) + 1148: 76 MatrixTimesScalar 1147 1146 + Store 1145(r6) 1148 + 1150: 76 Load 107(inFM0) + 1151: 6(float) Load 103(inF0) + 1152: 76 MatrixTimesScalar 1150 1151 + Store 1149(r7) 1152 + 1154: 76 Load 108(inFM1) + 1155: 76 Load 107(inFM0) + 1156: 76 MatrixTimesMatrix 1154 1155 + Store 1153(r8) 1156 + Return + FunctionEnd +129(TestGenMulNxM(f1;f1;vf2;vf3;mf23;mf32;mf33;mf34;mf24;): 2 Function None 119 + 120(inF0): 7(ptr) FunctionParameter + 121(inF1): 7(ptr) FunctionParameter + 122(inFV2): 25(ptr) FunctionParameter + 123(inFV3): 37(ptr) FunctionParameter + 124(inFM2x3): 112(ptr) FunctionParameter + 125(inFM3x2): 114(ptr) FunctionParameter + 126(inFM3x3): 69(ptr) FunctionParameter + 127(inFM3x4): 116(ptr) FunctionParameter + 128(inFM2x4): 118(ptr) FunctionParameter + 130: Label + 1157(r00): 7(ptr) Variable Function + 1161(r01): 25(ptr) Variable Function + 1165(r02): 37(ptr) Variable Function + 1169(r03): 25(ptr) Variable Function + 1173(r04): 37(ptr) Variable Function + 1177(r05): 7(ptr) Variable Function + 1181(r06): 7(ptr) Variable Function + 1185(r07): 37(ptr) Variable Function + 1189(r08): 25(ptr) Variable Function + 1193(r09): 25(ptr) Variable Function + 1197(r10): 37(ptr) Variable Function + 1201(r11): 112(ptr) Variable Function + 1205(r12): 114(ptr) Variable Function + 1209(r13): 61(ptr) Variable Function + 1213(r14): 112(ptr) Variable Function + 1217(r15): 118(ptr) Variable Function + 1221(r16): 116(ptr) Variable Function + 1158: 6(float) Load 121(inF1) + 1159: 6(float) Load 120(inF0) + 1160: 6(float) FMul 1158 1159 + Store 1157(r00) 1160 + 1162: 6(float) Load 120(inF0) + 1163: 24(fvec2) Load 122(inFV2) + 1164: 24(fvec2) VectorTimesScalar 1163 1162 + Store 1161(r01) 1164 + 1166: 6(float) Load 120(inF0) + 1167: 36(fvec3) Load 123(inFV3) + 1168: 36(fvec3) VectorTimesScalar 1167 1166 + Store 1165(r02) 1168 + 1170: 24(fvec2) Load 122(inFV2) + 1171: 6(float) Load 120(inF0) + 1172: 24(fvec2) VectorTimesScalar 1170 1171 + Store 1169(r03) 1172 + 1174: 36(fvec3) Load 123(inFV3) + 1175: 6(float) Load 120(inF0) + 1176: 36(fvec3) VectorTimesScalar 1174 1175 + Store 1173(r04) 1176 + 1178: 24(fvec2) Load 122(inFV2) + 1179: 24(fvec2) Load 122(inFV2) + 1180: 6(float) Dot 1178 1179 + Store 1177(r05) 1180 + 1182: 36(fvec3) Load 123(inFV3) + 1183: 36(fvec3) Load 123(inFV3) + 1184: 6(float) Dot 1182 1183 + Store 1181(r06) 1184 + 1186: 111 Load 124(inFM2x3) + 1187: 24(fvec2) Load 122(inFV2) + 1188: 36(fvec3) MatrixTimesVector 1186 1187 + Store 1185(r07) 1188 + 1190: 113 Load 125(inFM3x2) + 1191: 36(fvec3) Load 123(inFV3) + 1192: 24(fvec2) MatrixTimesVector 1190 1191 + Store 1189(r08) 1192 + 1194: 36(fvec3) Load 123(inFV3) + 1195: 111 Load 124(inFM2x3) + 1196: 24(fvec2) VectorTimesMatrix 1194 1195 + Store 1193(r09) 1196 + 1198: 24(fvec2) Load 122(inFV2) + 1199: 113 Load 125(inFM3x2) + 1200: 36(fvec3) VectorTimesMatrix 1198 1199 + Store 1197(r10) 1200 + 1202: 6(float) Load 120(inF0) + 1203: 111 Load 124(inFM2x3) + 1204: 111 MatrixTimesScalar 1203 1202 + Store 1201(r11) 1204 + 1206: 6(float) Load 120(inF0) + 1207: 113 Load 125(inFM3x2) + 1208: 113 MatrixTimesScalar 1207 1206 + Store 1205(r12) 1208 + 1210: 113 Load 125(inFM3x2) + 1211: 111 Load 124(inFM2x3) + 1212: 60 MatrixTimesMatrix 1210 1211 + Store 1209(r13) 1212 + 1214: 68 Load 126(inFM3x3) + 1215: 111 Load 124(inFM2x3) + 1216: 111 MatrixTimesMatrix 1214 1215 + Store 1213(r14) 1216 + 1218: 115 Load 127(inFM3x4) + 1219: 111 Load 124(inFM2x3) + 1220: 117 MatrixTimesMatrix 1218 1219 + Store 1217(r15) 1220 + 1222: 117 Load 128(inFM2x4) + 1223: 113 Load 125(inFM3x2) + 1224: 115 MatrixTimesMatrix 1222 1223 + Store 1221(r16) 1224 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.isfinite.frag.out b/deps/glslang/Test/baseResults/hlsl.isfinite.frag.out new file mode 100644 index 00000000..6fee9512 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.isfinite.frag.out @@ -0,0 +1,293 @@ +hlsl.isfinite.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: test1(f1; ( temp bool) +0:7 Function Parameters: +0:7 'v' ( in float) +0:? Sequence +0:8 Branch: Return with expression +0:8 logical-and ( temp bool) +0:8 Negate conditional ( temp bool) +0:8 isnan ( temp bool) +0:8 'v' ( in float) +0:8 Sequence +0:8 move second child to first child ( temp float) +0:8 '@finitetmp' ( temp float) +0:8 'v' ( in float) +0:8 logical-and ( temp bool) +0:8 Negate conditional ( temp bool) +0:8 isnan ( temp bool) +0:8 '@finitetmp' ( temp float) +0:8 Negate conditional ( temp bool) +0:8 isinf ( temp bool) +0:8 '@finitetmp' ( temp float) +0:12 Function Definition: @main( ( temp 4-component vector of float) +0:12 Function Parameters: +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp float) +0:13 '@finitetmp' ( temp float) +0:13 f: direct index for structure ( uniform float) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform float f, uniform 2-component vector of float f2, uniform 3-component vector of float f3}) +0:13 Constant: +0:13 0 (const uint) +0:13 logical-and ( temp bool) +0:13 Negate conditional ( temp bool) +0:13 isnan ( temp bool) +0:13 '@finitetmp' ( temp float) +0:13 Negate conditional ( temp bool) +0:13 isinf ( temp bool) +0:13 '@finitetmp' ( temp float) +0:14 Sequence +0:14 move second child to first child ( temp 2-component vector of float) +0:14 '@finitetmp' ( temp 2-component vector of float) +0:14 f2: direct index for structure ( uniform 2-component vector of float) +0:14 'anon@0' (layout( row_major std140) uniform block{ uniform float f, uniform 2-component vector of float f2, uniform 3-component vector of float f3}) +0:14 Constant: +0:14 1 (const uint) +0:14 logical-and ( temp 2-component vector of bool) +0:14 Negate conditional ( temp 2-component vector of bool) +0:14 isnan ( temp 2-component vector of bool) +0:14 '@finitetmp' ( temp 2-component vector of float) +0:14 Negate conditional ( temp 2-component vector of bool) +0:14 isinf ( temp 2-component vector of bool) +0:14 '@finitetmp' ( temp 2-component vector of float) +0:15 Sequence +0:15 move second child to first child ( temp 3-component vector of float) +0:15 '@finitetmp' ( temp 3-component vector of float) +0:15 f3: direct index for structure ( uniform 3-component vector of float) +0:15 'anon@0' (layout( row_major std140) uniform block{ uniform float f, uniform 2-component vector of float f2, uniform 3-component vector of float f3}) +0:15 Constant: +0:15 2 (const uint) +0:15 logical-and ( temp 3-component vector of bool) +0:15 Negate conditional ( temp 3-component vector of bool) +0:15 isnan ( temp 3-component vector of bool) +0:15 '@finitetmp' ( temp 3-component vector of float) +0:15 Negate conditional ( temp 3-component vector of bool) +0:15 isinf ( temp 3-component vector of bool) +0:15 '@finitetmp' ( temp 3-component vector of float) +0:17 Branch: Return with expression +0:17 Constant: +0:17 0.000000 +0:17 0.000000 +0:17 0.000000 +0:17 0.000000 +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:12 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform float f, uniform 2-component vector of float f2, uniform 3-component vector of float f3}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: test1(f1; ( temp bool) +0:7 Function Parameters: +0:7 'v' ( in float) +0:? Sequence +0:8 Branch: Return with expression +0:8 logical-and ( temp bool) +0:8 Negate conditional ( temp bool) +0:8 isnan ( temp bool) +0:8 'v' ( in float) +0:8 Sequence +0:8 move second child to first child ( temp float) +0:8 '@finitetmp' ( temp float) +0:8 'v' ( in float) +0:8 logical-and ( temp bool) +0:8 Negate conditional ( temp bool) +0:8 isnan ( temp bool) +0:8 '@finitetmp' ( temp float) +0:8 Negate conditional ( temp bool) +0:8 isinf ( temp bool) +0:8 '@finitetmp' ( temp float) +0:12 Function Definition: @main( ( temp 4-component vector of float) +0:12 Function Parameters: +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp float) +0:13 '@finitetmp' ( temp float) +0:13 f: direct index for structure ( uniform float) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform float f, uniform 2-component vector of float f2, uniform 3-component vector of float f3}) +0:13 Constant: +0:13 0 (const uint) +0:13 logical-and ( temp bool) +0:13 Negate conditional ( temp bool) +0:13 isnan ( temp bool) +0:13 '@finitetmp' ( temp float) +0:13 Negate conditional ( temp bool) +0:13 isinf ( temp bool) +0:13 '@finitetmp' ( temp float) +0:14 Sequence +0:14 move second child to first child ( temp 2-component vector of float) +0:14 '@finitetmp' ( temp 2-component vector of float) +0:14 f2: direct index for structure ( uniform 2-component vector of float) +0:14 'anon@0' (layout( row_major std140) uniform block{ uniform float f, uniform 2-component vector of float f2, uniform 3-component vector of float f3}) +0:14 Constant: +0:14 1 (const uint) +0:14 logical-and ( temp 2-component vector of bool) +0:14 Negate conditional ( temp 2-component vector of bool) +0:14 isnan ( temp 2-component vector of bool) +0:14 '@finitetmp' ( temp 2-component vector of float) +0:14 Negate conditional ( temp 2-component vector of bool) +0:14 isinf ( temp 2-component vector of bool) +0:14 '@finitetmp' ( temp 2-component vector of float) +0:15 Sequence +0:15 move second child to first child ( temp 3-component vector of float) +0:15 '@finitetmp' ( temp 3-component vector of float) +0:15 f3: direct index for structure ( uniform 3-component vector of float) +0:15 'anon@0' (layout( row_major std140) uniform block{ uniform float f, uniform 2-component vector of float f2, uniform 3-component vector of float f3}) +0:15 Constant: +0:15 2 (const uint) +0:15 logical-and ( temp 3-component vector of bool) +0:15 Negate conditional ( temp 3-component vector of bool) +0:15 isnan ( temp 3-component vector of bool) +0:15 '@finitetmp' ( temp 3-component vector of float) +0:15 Negate conditional ( temp 3-component vector of bool) +0:15 isinf ( temp 3-component vector of bool) +0:15 '@finitetmp' ( temp 3-component vector of float) +0:17 Branch: Return with expression +0:17 Constant: +0:17 0.000000 +0:17 0.000000 +0:17 0.000000 +0:17 0.000000 +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:12 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform float f, uniform 2-component vector of float f2, uniform 3-component vector of float f3}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 85 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 83 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "test1(f1;" + Name 10 "v" + Name 15 "@main(" + Name 20 "@finitetmp" + Name 32 "@finitetmp" + Name 35 "$Global" + MemberName 35($Global) 0 "f" + MemberName 35($Global) 1 "f2" + MemberName 35($Global) 2 "f3" + Name 37 "" + Name 51 "@finitetmp" + Name 65 "@finitetmp" + Name 83 "@entryPointOutput" + MemberDecorate 35($Global) 0 Offset 0 + MemberDecorate 35($Global) 1 Offset 8 + MemberDecorate 35($Global) 2 Offset 16 + Decorate 35($Global) Block + Decorate 37 DescriptorSet 0 + Decorate 83(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeBool + 9: TypeFunction 8(bool) 7(ptr) + 13: TypeVector 6(float) 4 + 14: TypeFunction 13(fvec4) + 33: TypeVector 6(float) 2 + 34: TypeVector 6(float) 3 + 35($Global): TypeStruct 6(float) 33(fvec2) 34(fvec3) + 36: TypePointer Uniform 35($Global) + 37: 36(ptr) Variable Uniform + 38: TypeInt 32 1 + 39: 38(int) Constant 0 + 40: TypePointer Uniform 6(float) + 50: TypePointer Function 33(fvec2) + 52: 38(int) Constant 1 + 53: TypePointer Uniform 33(fvec2) + 57: TypeVector 8(bool) 2 + 64: TypePointer Function 34(fvec3) + 66: 38(int) Constant 2 + 67: TypePointer Uniform 34(fvec3) + 71: TypeVector 8(bool) 3 + 78: 6(float) Constant 0 + 79: 13(fvec4) ConstantComposite 78 78 78 78 + 82: TypePointer Output 13(fvec4) +83(@entryPointOutput): 82(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 84: 13(fvec4) FunctionCall 15(@main() + Store 83(@entryPointOutput) 84 + Return + FunctionEnd + 11(test1(f1;): 8(bool) Function None 9 + 10(v): 7(ptr) FunctionParameter + 12: Label + 20(@finitetmp): 7(ptr) Variable Function + 17: 6(float) Load 10(v) + 18: 8(bool) IsNan 17 + 19: 8(bool) LogicalNot 18 + 21: 6(float) Load 10(v) + Store 20(@finitetmp) 21 + 22: 6(float) Load 20(@finitetmp) + 23: 8(bool) IsNan 22 + 24: 8(bool) LogicalNot 23 + 25: 6(float) Load 20(@finitetmp) + 26: 8(bool) IsInf 25 + 27: 8(bool) LogicalNot 26 + 28: 8(bool) LogicalAnd 24 27 + 29: 8(bool) LogicalAnd 19 28 + ReturnValue 29 + FunctionEnd + 15(@main(): 13(fvec4) Function None 14 + 16: Label + 32(@finitetmp): 7(ptr) Variable Function + 51(@finitetmp): 50(ptr) Variable Function + 65(@finitetmp): 64(ptr) Variable Function + 41: 40(ptr) AccessChain 37 39 + 42: 6(float) Load 41 + Store 32(@finitetmp) 42 + 43: 6(float) Load 32(@finitetmp) + 44: 8(bool) IsNan 43 + 45: 8(bool) LogicalNot 44 + 46: 6(float) Load 32(@finitetmp) + 47: 8(bool) IsInf 46 + 48: 8(bool) LogicalNot 47 + 49: 8(bool) LogicalAnd 45 48 + 54: 53(ptr) AccessChain 37 52 + 55: 33(fvec2) Load 54 + Store 51(@finitetmp) 55 + 56: 33(fvec2) Load 51(@finitetmp) + 58: 57(bvec2) IsNan 56 + 59: 57(bvec2) LogicalNot 58 + 60: 33(fvec2) Load 51(@finitetmp) + 61: 57(bvec2) IsInf 60 + 62: 57(bvec2) LogicalNot 61 + 63: 57(bvec2) LogicalAnd 59 62 + 68: 67(ptr) AccessChain 37 66 + 69: 34(fvec3) Load 68 + Store 65(@finitetmp) 69 + 70: 34(fvec3) Load 65(@finitetmp) + 72: 71(bvec3) IsNan 70 + 73: 71(bvec3) LogicalNot 72 + 74: 34(fvec3) Load 65(@finitetmp) + 75: 71(bvec3) IsInf 74 + 76: 71(bvec3) LogicalNot 75 + 77: 71(bvec3) LogicalAnd 73 76 + ReturnValue 79 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.layout.frag.out b/deps/glslang/Test/baseResults/hlsl.layout.frag.out new file mode 100644 index 00000000..010c2ecd --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.layout.frag.out @@ -0,0 +1,171 @@ +hlsl.layout.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:16 Function Definition: PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:16 Function Parameters: +0:16 'input' ( in 4-component vector of float) +0:? Sequence +0:17 Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:17 'layout' ( temp 4-component vector of float) +0:17 Constant: +0:17 2.000000 +0:17 2.000000 +0:17 2.000000 +0:17 2.000000 +0:18 Branch: Return with expression +0:18 add ( temp 4-component vector of float) +0:18 add ( temp 4-component vector of float) +0:18 add ( temp 4-component vector of float) +0:18 'input' ( in 4-component vector of float) +0:18 v1: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float) +0:18 'anon@0' (layout( set=3 binding=5 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1}) +0:18 Constant: +0:18 0 (const uint) +0:18 v5: direct index for structure (layout( row_major std430 offset=0) buffer 4-component vector of float) +0:18 'anon@1' (layout( row_major std430 push_constant) readonly buffer block{layout( row_major std430 offset=0) buffer 4-component vector of float v5}) +0:18 Constant: +0:18 0 (const uint) +0:18 component-wise multiply ( temp 4-component vector of float) +0:18 v1PostLayout: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float) +0:18 'anon@2' (layout( set=4 binding=7 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1PostLayout}) +0:18 Constant: +0:18 0 (const uint) +0:18 'layout' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( set=3 binding=5 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1}) +0:? 'anon@1' (layout( row_major std430 push_constant) readonly buffer block{layout( row_major std430 offset=0) buffer 4-component vector of float v5}) +0:? 'specConst' ( specialization-constant const int) +0:? 10 (const int) +0:? 'anon@2' (layout( set=4 binding=7 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1PostLayout}) + + +Linked fragment stage: + +WARNING: Linking fragment stage: Entry point not found + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:16 Function Definition: PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:16 Function Parameters: +0:16 'input' ( in 4-component vector of float) +0:? Sequence +0:17 Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:17 'layout' ( temp 4-component vector of float) +0:17 Constant: +0:17 2.000000 +0:17 2.000000 +0:17 2.000000 +0:17 2.000000 +0:18 Branch: Return with expression +0:18 add ( temp 4-component vector of float) +0:18 add ( temp 4-component vector of float) +0:18 add ( temp 4-component vector of float) +0:18 'input' ( in 4-component vector of float) +0:18 v1: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float) +0:18 'anon@0' (layout( set=3 binding=5 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1}) +0:18 Constant: +0:18 0 (const uint) +0:18 v5: direct index for structure (layout( row_major std430 offset=0) buffer 4-component vector of float) +0:18 'anon@1' (layout( row_major std430 push_constant) readonly buffer block{layout( row_major std430 offset=0) buffer 4-component vector of float v5}) +0:18 Constant: +0:18 0 (const uint) +0:18 component-wise multiply ( temp 4-component vector of float) +0:18 v1PostLayout: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float) +0:18 'anon@2' (layout( set=4 binding=7 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1PostLayout}) +0:18 Constant: +0:18 0 (const uint) +0:18 'layout' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( set=3 binding=5 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1}) +0:? 'anon@1' (layout( row_major std430 push_constant) readonly buffer block{layout( row_major std430 offset=0) buffer 4-component vector of float v5}) +0:? 'specConst' ( specialization-constant const int) +0:? 10 (const int) +0:? 'anon@2' (layout( set=4 binding=7 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1PostLayout}) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 44 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "PixelShaderFunction(vf4;" + Name 10 "input" + Name 13 "layout" + Name 17 "tbufName" + MemberName 17(tbufName) 0 "v1" + Name 19 "" + Name 26 "tbufName2" + MemberName 26(tbufName2) 0 "v5" + Name 28 "" + Name 33 "tbufName2" + MemberName 33(tbufName2) 0 "v1PostLayout" + Name 35 "" + Name 43 "specConst" + MemberDecorate 17(tbufName) 0 NonWritable + MemberDecorate 17(tbufName) 0 Offset 16 + Decorate 17(tbufName) BufferBlock + Decorate 19 DescriptorSet 3 + Decorate 19 Binding 5 + MemberDecorate 26(tbufName2) 0 NonWritable + MemberDecorate 26(tbufName2) 0 Offset 0 + Decorate 26(tbufName2) BufferBlock + MemberDecorate 33(tbufName2) 0 NonWritable + MemberDecorate 33(tbufName2) 0 Offset 16 + Decorate 33(tbufName2) BufferBlock + Decorate 35 DescriptorSet 4 + Decorate 35 Binding 7 + Decorate 43(specConst) SpecId 17 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) + 14: 6(float) Constant 1073741824 + 15: 7(fvec4) ConstantComposite 14 14 14 14 + 17(tbufName): TypeStruct 7(fvec4) + 18: TypePointer Uniform 17(tbufName) + 19: 18(ptr) Variable Uniform + 20: TypeInt 32 1 + 21: 20(int) Constant 0 + 22: TypePointer Uniform 7(fvec4) + 26(tbufName2): TypeStruct 7(fvec4) + 27: TypePointer PushConstant 26(tbufName2) + 28: 27(ptr) Variable PushConstant + 29: TypePointer PushConstant 7(fvec4) + 33(tbufName2): TypeStruct 7(fvec4) + 34: TypePointer Uniform 33(tbufName2) + 35: 34(ptr) Variable Uniform + 43(specConst): 20(int) SpecConstant 10 + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd +11(PixelShaderFunction(vf4;): 7(fvec4) Function None 9 + 10(input): 8(ptr) FunctionParameter + 12: Label + 13(layout): 8(ptr) Variable Function + Store 13(layout) 15 + 16: 7(fvec4) Load 10(input) + 23: 22(ptr) AccessChain 19 21 + 24: 7(fvec4) Load 23 + 25: 7(fvec4) FAdd 16 24 + 30: 29(ptr) AccessChain 28 21 + 31: 7(fvec4) Load 30 + 32: 7(fvec4) FAdd 25 31 + 36: 22(ptr) AccessChain 35 21 + 37: 7(fvec4) Load 36 + 38: 7(fvec4) Load 13(layout) + 39: 7(fvec4) FMul 37 38 + 40: 7(fvec4) FAdd 32 39 + ReturnValue 40 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.layoutOverride.vert.out b/deps/glslang/Test/baseResults/hlsl.layoutOverride.vert.out new file mode 100644 index 00000000..0db20112 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.layoutOverride.vert.out @@ -0,0 +1,104 @@ +hlsl.layoutOverride.vert +Shader version: 500 +0:? Sequence +0:5 Function Definition: @main( ( temp 4-component vector of float) +0:5 Function Parameters: +0:? Sequence +0:6 Branch: Return with expression +0:6 texture ( temp 4-component vector of float) +0:6 Construct combined texture-sampler ( temp sampler2D) +0:6 'tex' (layout( set=2 binding=0) uniform texture2D) +0:6 'samp' ( uniform sampler) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:5 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'tex' (layout( set=2 binding=0) uniform texture2D) +0:? 'samp' ( uniform sampler) +0:? '@entryPointOutput' ( out 4-component vector of float Position) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:5 Function Definition: @main( ( temp 4-component vector of float) +0:5 Function Parameters: +0:? Sequence +0:6 Branch: Return with expression +0:6 texture ( temp 4-component vector of float) +0:6 Construct combined texture-sampler ( temp sampler2D) +0:6 'tex' (layout( set=2 binding=0) uniform texture2D) +0:6 'samp' ( uniform sampler) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:5 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'tex' (layout( set=2 binding=0) uniform texture2D) +0:? 'samp' ( uniform sampler) +0:? '@entryPointOutput' ( out 4-component vector of float Position) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 32 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 30 + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 13 "tex" + Name 17 "samp" + Name 30 "@entryPointOutput" + Decorate 13(tex) DescriptorSet 2 + Decorate 13(tex) Binding 0 + Decorate 17(samp) DescriptorSet 0 + Decorate 30(@entryPointOutput) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeImage 6(float) 2D sampled format:Unknown + 12: TypePointer UniformConstant 11 + 13(tex): 12(ptr) Variable UniformConstant + 15: TypeSampler + 16: TypePointer UniformConstant 15 + 17(samp): 16(ptr) Variable UniformConstant + 19: TypeSampledImage 11 + 21: TypeVector 6(float) 2 + 22: 6(float) Constant 1045220557 + 23: 6(float) Constant 1050253722 + 24: 21(fvec2) ConstantComposite 22 23 + 25: 6(float) Constant 0 + 29: TypePointer Output 7(fvec4) +30(@entryPointOutput): 29(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 31: 7(fvec4) FunctionCall 9(@main() + Store 30(@entryPointOutput) 31 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 14: 11 Load 13(tex) + 18: 15 Load 17(samp) + 20: 19 SampledImage 14 18 + 26: 7(fvec4) ImageSampleExplicitLod 20 24 Lod 25 + ReturnValue 26 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out new file mode 100644 index 00000000..2acf3d47 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out @@ -0,0 +1,552 @@ +hlsl.load.2dms.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Parameters: +0:? Sequence +0:32 textureFetch ( temp 4-component vector of float) +0:32 'g_tTex2dmsf4' ( uniform texture2DMS) +0:32 c2: direct index for structure ( uniform 2-component vector of int) +0:32 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:32 Constant: +0:32 1 (const uint) +0:32 Constant: +0:32 3 (const int) +0:33 textureFetch ( temp 4-component vector of int) +0:33 'g_tTex2dmsi4' ( uniform itexture2DMS) +0:33 c2: direct index for structure ( uniform 2-component vector of int) +0:33 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:33 Constant: +0:33 1 (const uint) +0:33 Constant: +0:33 3 (const int) +0:34 textureFetch ( temp 4-component vector of uint) +0:34 'g_tTex2dmsu4' ( uniform utexture2DMS) +0:34 c2: direct index for structure ( uniform 2-component vector of int) +0:34 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:34 Constant: +0:34 1 (const uint) +0:34 Constant: +0:34 3 (const int) +0:37 textureFetchOffset ( temp 4-component vector of float) +0:37 'g_tTex2dmsf4' ( uniform texture2DMS) +0:37 c2: direct index for structure ( uniform 2-component vector of int) +0:37 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:37 Constant: +0:37 1 (const uint) +0:37 Constant: +0:37 3 (const int) +0:37 o2: direct index for structure ( uniform 2-component vector of int) +0:37 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:37 Constant: +0:37 5 (const uint) +0:38 textureFetchOffset ( temp 4-component vector of int) +0:38 'g_tTex2dmsi4' ( uniform itexture2DMS) +0:38 c2: direct index for structure ( uniform 2-component vector of int) +0:38 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:38 Constant: +0:38 1 (const uint) +0:38 Constant: +0:38 3 (const int) +0:38 o2: direct index for structure ( uniform 2-component vector of int) +0:38 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:38 Constant: +0:38 5 (const uint) +0:39 textureFetchOffset ( temp 4-component vector of uint) +0:39 'g_tTex2dmsu4' ( uniform utexture2DMS) +0:39 c2: direct index for structure ( uniform 2-component vector of int) +0:39 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:39 Constant: +0:39 1 (const uint) +0:39 Constant: +0:39 3 (const int) +0:39 o2: direct index for structure ( uniform 2-component vector of int) +0:39 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:39 Constant: +0:39 5 (const uint) +0:42 textureFetch ( temp 4-component vector of float) +0:42 'g_tTex2dmsf4a' ( uniform texture2DMSArray) +0:42 c3: direct index for structure ( uniform 3-component vector of int) +0:42 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:42 Constant: +0:42 2 (const uint) +0:42 Constant: +0:42 3 (const int) +0:43 textureFetch ( temp 4-component vector of int) +0:43 'g_tTex2dmsi4a' ( uniform itexture2DMSArray) +0:43 c3: direct index for structure ( uniform 3-component vector of int) +0:43 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:43 Constant: +0:43 2 (const uint) +0:43 Constant: +0:43 3 (const int) +0:44 textureFetch ( temp 4-component vector of uint) +0:44 'g_tTex2dmsu4a' ( uniform utexture2DMSArray) +0:44 c3: direct index for structure ( uniform 3-component vector of int) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:44 Constant: +0:44 2 (const uint) +0:44 Constant: +0:44 3 (const int) +0:47 textureFetchOffset ( temp 4-component vector of float) +0:47 'g_tTex2dmsf4a' ( uniform texture2DMSArray) +0:47 c3: direct index for structure ( uniform 3-component vector of int) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:47 Constant: +0:47 2 (const uint) +0:47 Constant: +0:47 3 (const int) +0:47 o2: direct index for structure ( uniform 2-component vector of int) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:47 Constant: +0:47 5 (const uint) +0:48 textureFetchOffset ( temp 4-component vector of int) +0:48 'g_tTex2dmsi4a' ( uniform itexture2DMSArray) +0:48 c3: direct index for structure ( uniform 3-component vector of int) +0:48 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:48 Constant: +0:48 2 (const uint) +0:48 Constant: +0:48 3 (const int) +0:48 o2: direct index for structure ( uniform 2-component vector of int) +0:48 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:48 Constant: +0:48 5 (const uint) +0:49 textureFetchOffset ( temp 4-component vector of uint) +0:49 'g_tTex2dmsu4a' ( uniform utexture2DMSArray) +0:49 c3: direct index for structure ( uniform 3-component vector of int) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:49 Constant: +0:49 2 (const uint) +0:49 Constant: +0:49 3 (const int) +0:49 o2: direct index for structure ( uniform 2-component vector of int) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:49 Constant: +0:49 5 (const uint) +0:51 move second child to first child ( temp 4-component vector of float) +0:51 Color: direct index for structure ( temp 4-component vector of float) +0:51 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1.000000 +0:51 1.000000 +0:51 1.000000 +0:51 1.000000 +0:52 move second child to first child ( temp float) +0:52 Depth: direct index for structure ( temp float) +0:52 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 1.000000 +0:54 Branch: Return with expression +0:54 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:28 Color: direct index for structure ( temp 4-component vector of float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 0 (const int) +0:28 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:28 Depth: direct index for structure ( temp float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex2dmsf4' ( uniform texture2DMS) +0:? 'g_tTex2dmsi4' ( uniform itexture2DMS) +0:? 'g_tTex2dmsu4' ( uniform utexture2DMS) +0:? 'g_tTex2dmsf4a' ( uniform texture2DMSArray) +0:? 'g_tTex2dmsi4a' ( uniform itexture2DMSArray) +0:? 'g_tTex2dmsu4a' ( uniform utexture2DMSArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Parameters: +0:? Sequence +0:32 textureFetch ( temp 4-component vector of float) +0:32 'g_tTex2dmsf4' ( uniform texture2DMS) +0:32 c2: direct index for structure ( uniform 2-component vector of int) +0:32 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:32 Constant: +0:32 1 (const uint) +0:32 Constant: +0:32 3 (const int) +0:33 textureFetch ( temp 4-component vector of int) +0:33 'g_tTex2dmsi4' ( uniform itexture2DMS) +0:33 c2: direct index for structure ( uniform 2-component vector of int) +0:33 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:33 Constant: +0:33 1 (const uint) +0:33 Constant: +0:33 3 (const int) +0:34 textureFetch ( temp 4-component vector of uint) +0:34 'g_tTex2dmsu4' ( uniform utexture2DMS) +0:34 c2: direct index for structure ( uniform 2-component vector of int) +0:34 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:34 Constant: +0:34 1 (const uint) +0:34 Constant: +0:34 3 (const int) +0:37 textureFetchOffset ( temp 4-component vector of float) +0:37 'g_tTex2dmsf4' ( uniform texture2DMS) +0:37 c2: direct index for structure ( uniform 2-component vector of int) +0:37 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:37 Constant: +0:37 1 (const uint) +0:37 Constant: +0:37 3 (const int) +0:37 o2: direct index for structure ( uniform 2-component vector of int) +0:37 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:37 Constant: +0:37 5 (const uint) +0:38 textureFetchOffset ( temp 4-component vector of int) +0:38 'g_tTex2dmsi4' ( uniform itexture2DMS) +0:38 c2: direct index for structure ( uniform 2-component vector of int) +0:38 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:38 Constant: +0:38 1 (const uint) +0:38 Constant: +0:38 3 (const int) +0:38 o2: direct index for structure ( uniform 2-component vector of int) +0:38 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:38 Constant: +0:38 5 (const uint) +0:39 textureFetchOffset ( temp 4-component vector of uint) +0:39 'g_tTex2dmsu4' ( uniform utexture2DMS) +0:39 c2: direct index for structure ( uniform 2-component vector of int) +0:39 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:39 Constant: +0:39 1 (const uint) +0:39 Constant: +0:39 3 (const int) +0:39 o2: direct index for structure ( uniform 2-component vector of int) +0:39 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:39 Constant: +0:39 5 (const uint) +0:42 textureFetch ( temp 4-component vector of float) +0:42 'g_tTex2dmsf4a' ( uniform texture2DMSArray) +0:42 c3: direct index for structure ( uniform 3-component vector of int) +0:42 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:42 Constant: +0:42 2 (const uint) +0:42 Constant: +0:42 3 (const int) +0:43 textureFetch ( temp 4-component vector of int) +0:43 'g_tTex2dmsi4a' ( uniform itexture2DMSArray) +0:43 c3: direct index for structure ( uniform 3-component vector of int) +0:43 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:43 Constant: +0:43 2 (const uint) +0:43 Constant: +0:43 3 (const int) +0:44 textureFetch ( temp 4-component vector of uint) +0:44 'g_tTex2dmsu4a' ( uniform utexture2DMSArray) +0:44 c3: direct index for structure ( uniform 3-component vector of int) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:44 Constant: +0:44 2 (const uint) +0:44 Constant: +0:44 3 (const int) +0:47 textureFetchOffset ( temp 4-component vector of float) +0:47 'g_tTex2dmsf4a' ( uniform texture2DMSArray) +0:47 c3: direct index for structure ( uniform 3-component vector of int) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:47 Constant: +0:47 2 (const uint) +0:47 Constant: +0:47 3 (const int) +0:47 o2: direct index for structure ( uniform 2-component vector of int) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:47 Constant: +0:47 5 (const uint) +0:48 textureFetchOffset ( temp 4-component vector of int) +0:48 'g_tTex2dmsi4a' ( uniform itexture2DMSArray) +0:48 c3: direct index for structure ( uniform 3-component vector of int) +0:48 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:48 Constant: +0:48 2 (const uint) +0:48 Constant: +0:48 3 (const int) +0:48 o2: direct index for structure ( uniform 2-component vector of int) +0:48 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:48 Constant: +0:48 5 (const uint) +0:49 textureFetchOffset ( temp 4-component vector of uint) +0:49 'g_tTex2dmsu4a' ( uniform utexture2DMSArray) +0:49 c3: direct index for structure ( uniform 3-component vector of int) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:49 Constant: +0:49 2 (const uint) +0:49 Constant: +0:49 3 (const int) +0:49 o2: direct index for structure ( uniform 2-component vector of int) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:49 Constant: +0:49 5 (const uint) +0:51 move second child to first child ( temp 4-component vector of float) +0:51 Color: direct index for structure ( temp 4-component vector of float) +0:51 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1.000000 +0:51 1.000000 +0:51 1.000000 +0:51 1.000000 +0:52 move second child to first child ( temp float) +0:52 Depth: direct index for structure ( temp float) +0:52 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 1.000000 +0:54 Branch: Return with expression +0:54 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:28 Color: direct index for structure ( temp 4-component vector of float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 0 (const int) +0:28 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:28 Depth: direct index for structure ( temp float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex2dmsf4' ( uniform texture2DMS) +0:? 'g_tTex2dmsi4' ( uniform itexture2DMS) +0:? 'g_tTex2dmsu4' ( uniform utexture2DMS) +0:? 'g_tTex2dmsf4a' ( uniform texture2DMSArray) +0:? 'g_tTex2dmsi4a' ( uniform itexture2DMSArray) +0:? 'g_tTex2dmsu4a' ( uniform utexture2DMSArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 130 + + Capability Shader + Capability ImageGatherExtended + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 120 124 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 14 "g_tTex2dmsf4" + Name 20 "$Global" + MemberName 20($Global) 0 "c1" + MemberName 20($Global) 1 "c2" + MemberName 20($Global) 2 "c3" + MemberName 20($Global) 3 "c4" + MemberName 20($Global) 4 "o1" + MemberName 20($Global) 5 "o2" + MemberName 20($Global) 6 "o3" + MemberName 20($Global) 7 "o4" + Name 22 "" + Name 31 "g_tTex2dmsi4" + Name 39 "g_tTex2dmsu4" + Name 66 "g_tTex2dmsf4a" + Name 75 "g_tTex2dmsi4a" + Name 82 "g_tTex2dmsu4a" + Name 106 "psout" + Name 117 "flattenTemp" + Name 120 "@entryPointOutput.Color" + Name 124 "@entryPointOutput.Depth" + Name 129 "g_sSamp" + Decorate 14(g_tTex2dmsf4) DescriptorSet 0 + MemberDecorate 20($Global) 0 Offset 0 + MemberDecorate 20($Global) 1 Offset 8 + MemberDecorate 20($Global) 2 Offset 16 + MemberDecorate 20($Global) 3 Offset 32 + MemberDecorate 20($Global) 4 Offset 48 + MemberDecorate 20($Global) 5 Offset 56 + MemberDecorate 20($Global) 6 Offset 64 + MemberDecorate 20($Global) 7 Offset 80 + Decorate 20($Global) Block + Decorate 22 DescriptorSet 0 + Decorate 31(g_tTex2dmsi4) DescriptorSet 0 + Decorate 39(g_tTex2dmsu4) DescriptorSet 0 + Decorate 66(g_tTex2dmsf4a) DescriptorSet 0 + Decorate 75(g_tTex2dmsi4a) DescriptorSet 0 + Decorate 82(g_tTex2dmsu4a) DescriptorSet 0 + Decorate 120(@entryPointOutput.Color) Location 0 + Decorate 124(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 129(g_sSamp) DescriptorSet 0 + Decorate 129(g_sSamp) Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeImage 6(float) 2D multi-sampled sampled format:Unknown + 13: TypePointer UniformConstant 12 +14(g_tTex2dmsf4): 13(ptr) Variable UniformConstant + 16: TypeInt 32 1 + 17: TypeVector 16(int) 2 + 18: TypeVector 16(int) 3 + 19: TypeVector 16(int) 4 + 20($Global): TypeStruct 16(int) 17(ivec2) 18(ivec3) 19(ivec4) 16(int) 17(ivec2) 18(ivec3) 19(ivec4) + 21: TypePointer Uniform 20($Global) + 22: 21(ptr) Variable Uniform + 23: 16(int) Constant 1 + 24: TypePointer Uniform 17(ivec2) + 27: 16(int) Constant 3 + 29: TypeImage 16(int) 2D multi-sampled sampled format:Unknown + 30: TypePointer UniformConstant 29 +31(g_tTex2dmsi4): 30(ptr) Variable UniformConstant + 36: TypeInt 32 0 + 37: TypeImage 36(int) 2D multi-sampled sampled format:Unknown + 38: TypePointer UniformConstant 37 +39(g_tTex2dmsu4): 38(ptr) Variable UniformConstant + 43: TypeVector 36(int) 4 + 48: 16(int) Constant 5 + 64: TypeImage 6(float) 2D array multi-sampled sampled format:Unknown + 65: TypePointer UniformConstant 64 +66(g_tTex2dmsf4a): 65(ptr) Variable UniformConstant + 68: 16(int) Constant 2 + 69: TypePointer Uniform 18(ivec3) + 73: TypeImage 16(int) 2D array multi-sampled sampled format:Unknown + 74: TypePointer UniformConstant 73 +75(g_tTex2dmsi4a): 74(ptr) Variable UniformConstant + 80: TypeImage 36(int) 2D array multi-sampled sampled format:Unknown + 81: TypePointer UniformConstant 80 +82(g_tTex2dmsu4a): 81(ptr) Variable UniformConstant + 105: TypePointer Function 8(PS_OUTPUT) + 107: 16(int) Constant 0 + 108: 6(float) Constant 1065353216 + 109: 7(fvec4) ConstantComposite 108 108 108 108 + 110: TypePointer Function 7(fvec4) + 112: TypePointer Function 6(float) + 119: TypePointer Output 7(fvec4) +120(@entryPointOutput.Color): 119(ptr) Variable Output + 123: TypePointer Output 6(float) +124(@entryPointOutput.Depth): 123(ptr) Variable Output + 127: TypeSampler + 128: TypePointer UniformConstant 127 + 129(g_sSamp): 128(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +117(flattenTemp): 105(ptr) Variable Function + 118:8(PS_OUTPUT) FunctionCall 10(@main() + Store 117(flattenTemp) 118 + 121: 110(ptr) AccessChain 117(flattenTemp) 107 + 122: 7(fvec4) Load 121 + Store 120(@entryPointOutput.Color) 122 + 125: 112(ptr) AccessChain 117(flattenTemp) 23 + 126: 6(float) Load 125 + Store 124(@entryPointOutput.Depth) 126 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 106(psout): 105(ptr) Variable Function + 15: 12 Load 14(g_tTex2dmsf4) + 25: 24(ptr) AccessChain 22 23 + 26: 17(ivec2) Load 25 + 28: 7(fvec4) ImageFetch 15 26 Sample 27 + 32: 29 Load 31(g_tTex2dmsi4) + 33: 24(ptr) AccessChain 22 23 + 34: 17(ivec2) Load 33 + 35: 19(ivec4) ImageFetch 32 34 Sample 27 + 40: 37 Load 39(g_tTex2dmsu4) + 41: 24(ptr) AccessChain 22 23 + 42: 17(ivec2) Load 41 + 44: 43(ivec4) ImageFetch 40 42 Sample 27 + 45: 12 Load 14(g_tTex2dmsf4) + 46: 24(ptr) AccessChain 22 23 + 47: 17(ivec2) Load 46 + 49: 24(ptr) AccessChain 22 48 + 50: 17(ivec2) Load 49 + 51: 7(fvec4) ImageFetch 45 47 Offset Sample 50 27 + 52: 29 Load 31(g_tTex2dmsi4) + 53: 24(ptr) AccessChain 22 23 + 54: 17(ivec2) Load 53 + 55: 24(ptr) AccessChain 22 48 + 56: 17(ivec2) Load 55 + 57: 19(ivec4) ImageFetch 52 54 Offset Sample 56 27 + 58: 37 Load 39(g_tTex2dmsu4) + 59: 24(ptr) AccessChain 22 23 + 60: 17(ivec2) Load 59 + 61: 24(ptr) AccessChain 22 48 + 62: 17(ivec2) Load 61 + 63: 43(ivec4) ImageFetch 58 60 Offset Sample 62 27 + 67: 64 Load 66(g_tTex2dmsf4a) + 70: 69(ptr) AccessChain 22 68 + 71: 18(ivec3) Load 70 + 72: 7(fvec4) ImageFetch 67 71 Sample 27 + 76: 73 Load 75(g_tTex2dmsi4a) + 77: 69(ptr) AccessChain 22 68 + 78: 18(ivec3) Load 77 + 79: 19(ivec4) ImageFetch 76 78 Sample 27 + 83: 80 Load 82(g_tTex2dmsu4a) + 84: 69(ptr) AccessChain 22 68 + 85: 18(ivec3) Load 84 + 86: 43(ivec4) ImageFetch 83 85 Sample 27 + 87: 64 Load 66(g_tTex2dmsf4a) + 88: 69(ptr) AccessChain 22 68 + 89: 18(ivec3) Load 88 + 90: 24(ptr) AccessChain 22 48 + 91: 17(ivec2) Load 90 + 92: 7(fvec4) ImageFetch 87 89 Offset Sample 91 27 + 93: 73 Load 75(g_tTex2dmsi4a) + 94: 69(ptr) AccessChain 22 68 + 95: 18(ivec3) Load 94 + 96: 24(ptr) AccessChain 22 48 + 97: 17(ivec2) Load 96 + 98: 19(ivec4) ImageFetch 93 95 Offset Sample 97 27 + 99: 80 Load 82(g_tTex2dmsu4a) + 100: 69(ptr) AccessChain 22 68 + 101: 18(ivec3) Load 100 + 102: 24(ptr) AccessChain 22 48 + 103: 17(ivec2) Load 102 + 104: 43(ivec4) ImageFetch 99 101 Offset Sample 103 27 + 111: 110(ptr) AccessChain 106(psout) 107 + Store 111 109 + 113: 112(ptr) AccessChain 106(psout) 23 + Store 113 108 + 114:8(PS_OUTPUT) Load 106(psout) + ReturnValue 114 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.load.array.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.load.array.dx10.frag.out new file mode 100644 index 00000000..dd665edf --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.load.array.dx10.frag.out @@ -0,0 +1,643 @@ +hlsl.load.array.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:48 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Parameters: +0:? Sequence +0:52 textureFetch ( temp 4-component vector of float) +0:52 'g_tTex1df4a' ( uniform texture1DArray) +0:52 vector swizzle ( temp 2-component vector of int) +0:52 c3: direct index for structure ( uniform 3-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 2 (const uint) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 direct index ( temp int) +0:52 c3: direct index for structure ( uniform 3-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 2 (const uint) +0:52 Constant: +0:52 2 (const int) +0:53 textureFetch ( temp 4-component vector of int) +0:53 'g_tTex1di4a' ( uniform itexture1DArray) +0:53 vector swizzle ( temp 2-component vector of int) +0:53 c3: direct index for structure ( uniform 3-component vector of int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 2 (const uint) +0:53 Sequence +0:53 Constant: +0:53 0 (const int) +0:53 Constant: +0:53 1 (const int) +0:53 direct index ( temp int) +0:53 c3: direct index for structure ( uniform 3-component vector of int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 2 (const uint) +0:53 Constant: +0:53 2 (const int) +0:54 textureFetch ( temp 4-component vector of uint) +0:54 'g_tTex1du4a' ( uniform utexture1DArray) +0:54 vector swizzle ( temp 2-component vector of int) +0:54 c3: direct index for structure ( uniform 3-component vector of int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 2 (const uint) +0:54 Sequence +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 1 (const int) +0:54 direct index ( temp int) +0:54 c3: direct index for structure ( uniform 3-component vector of int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 2 (const uint) +0:54 Constant: +0:54 2 (const int) +0:57 textureFetch ( temp 4-component vector of float) +0:57 'g_tTex2df4a' ( uniform texture2DArray) +0:57 vector swizzle ( temp 3-component vector of int) +0:57 c4: direct index for structure ( uniform 4-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 3 (const uint) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 2 (const int) +0:57 direct index ( temp int) +0:57 c4: direct index for structure ( uniform 4-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 3 (const uint) +0:57 Constant: +0:57 3 (const int) +0:58 textureFetch ( temp 4-component vector of int) +0:58 'g_tTex2di4a' ( uniform itexture2DArray) +0:58 vector swizzle ( temp 3-component vector of int) +0:58 c4: direct index for structure ( uniform 4-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 3 (const uint) +0:58 Sequence +0:58 Constant: +0:58 0 (const int) +0:58 Constant: +0:58 1 (const int) +0:58 Constant: +0:58 2 (const int) +0:58 direct index ( temp int) +0:58 c4: direct index for structure ( uniform 4-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 3 (const uint) +0:58 Constant: +0:58 3 (const int) +0:59 textureFetch ( temp 4-component vector of uint) +0:59 'g_tTex2du4a' ( uniform utexture2DArray) +0:59 vector swizzle ( temp 3-component vector of int) +0:59 c4: direct index for structure ( uniform 4-component vector of int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:59 Constant: +0:59 3 (const uint) +0:59 Sequence +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:59 Constant: +0:59 2 (const int) +0:59 direct index ( temp int) +0:59 c4: direct index for structure ( uniform 4-component vector of int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:59 Constant: +0:59 3 (const uint) +0:59 Constant: +0:59 3 (const int) +0:67 move second child to first child ( temp 4-component vector of float) +0:67 Color: direct index for structure ( temp 4-component vector of float) +0:67 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 1.000000 +0:67 1.000000 +0:67 1.000000 +0:67 1.000000 +0:68 move second child to first child ( temp float) +0:68 Depth: direct index for structure ( temp float) +0:68 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:68 Constant: +0:68 1 (const int) +0:68 Constant: +0:68 1.000000 +0:70 Branch: Return with expression +0:70 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Definition: main( ( temp void) +0:48 Function Parameters: +0:? Sequence +0:48 Sequence +0:48 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:48 Color: direct index for structure ( temp 4-component vector of float) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 0 (const int) +0:48 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:48 Depth: direct index for structure ( temp float) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:48 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Parameters: +0:? Sequence +0:52 textureFetch ( temp 4-component vector of float) +0:52 'g_tTex1df4a' ( uniform texture1DArray) +0:52 vector swizzle ( temp 2-component vector of int) +0:52 c3: direct index for structure ( uniform 3-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 2 (const uint) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 direct index ( temp int) +0:52 c3: direct index for structure ( uniform 3-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 2 (const uint) +0:52 Constant: +0:52 2 (const int) +0:53 textureFetch ( temp 4-component vector of int) +0:53 'g_tTex1di4a' ( uniform itexture1DArray) +0:53 vector swizzle ( temp 2-component vector of int) +0:53 c3: direct index for structure ( uniform 3-component vector of int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 2 (const uint) +0:53 Sequence +0:53 Constant: +0:53 0 (const int) +0:53 Constant: +0:53 1 (const int) +0:53 direct index ( temp int) +0:53 c3: direct index for structure ( uniform 3-component vector of int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 2 (const uint) +0:53 Constant: +0:53 2 (const int) +0:54 textureFetch ( temp 4-component vector of uint) +0:54 'g_tTex1du4a' ( uniform utexture1DArray) +0:54 vector swizzle ( temp 2-component vector of int) +0:54 c3: direct index for structure ( uniform 3-component vector of int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 2 (const uint) +0:54 Sequence +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 1 (const int) +0:54 direct index ( temp int) +0:54 c3: direct index for structure ( uniform 3-component vector of int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 2 (const uint) +0:54 Constant: +0:54 2 (const int) +0:57 textureFetch ( temp 4-component vector of float) +0:57 'g_tTex2df4a' ( uniform texture2DArray) +0:57 vector swizzle ( temp 3-component vector of int) +0:57 c4: direct index for structure ( uniform 4-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 3 (const uint) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 2 (const int) +0:57 direct index ( temp int) +0:57 c4: direct index for structure ( uniform 4-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 3 (const uint) +0:57 Constant: +0:57 3 (const int) +0:58 textureFetch ( temp 4-component vector of int) +0:58 'g_tTex2di4a' ( uniform itexture2DArray) +0:58 vector swizzle ( temp 3-component vector of int) +0:58 c4: direct index for structure ( uniform 4-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 3 (const uint) +0:58 Sequence +0:58 Constant: +0:58 0 (const int) +0:58 Constant: +0:58 1 (const int) +0:58 Constant: +0:58 2 (const int) +0:58 direct index ( temp int) +0:58 c4: direct index for structure ( uniform 4-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 3 (const uint) +0:58 Constant: +0:58 3 (const int) +0:59 textureFetch ( temp 4-component vector of uint) +0:59 'g_tTex2du4a' ( uniform utexture2DArray) +0:59 vector swizzle ( temp 3-component vector of int) +0:59 c4: direct index for structure ( uniform 4-component vector of int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:59 Constant: +0:59 3 (const uint) +0:59 Sequence +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:59 Constant: +0:59 2 (const int) +0:59 direct index ( temp int) +0:59 c4: direct index for structure ( uniform 4-component vector of int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:59 Constant: +0:59 3 (const uint) +0:59 Constant: +0:59 3 (const int) +0:67 move second child to first child ( temp 4-component vector of float) +0:67 Color: direct index for structure ( temp 4-component vector of float) +0:67 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 1.000000 +0:67 1.000000 +0:67 1.000000 +0:67 1.000000 +0:68 move second child to first child ( temp float) +0:68 Depth: direct index for structure ( temp float) +0:68 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:68 Constant: +0:68 1 (const int) +0:68 Constant: +0:68 1.000000 +0:70 Branch: Return with expression +0:70 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Definition: main( ( temp void) +0:48 Function Parameters: +0:? Sequence +0:48 Sequence +0:48 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:48 Color: direct index for structure ( temp 4-component vector of float) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 0 (const int) +0:48 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:48 Depth: direct index for structure ( temp float) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 159 + + Capability Shader + Capability Sampled1D + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 104 108 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 14 "g_tTex1df4a" + Name 20 "$Global" + MemberName 20($Global) 0 "c1" + MemberName 20($Global) 1 "c2" + MemberName 20($Global) 2 "c3" + MemberName 20($Global) 3 "c4" + MemberName 20($Global) 4 "o1" + MemberName 20($Global) 5 "o2" + MemberName 20($Global) 6 "o3" + MemberName 20($Global) 7 "o4" + Name 22 "" + Name 36 "g_tTex1di4a" + Name 46 "g_tTex1du4a" + Name 57 "g_tTex2df4a" + Name 70 "g_tTex2di4a" + Name 80 "g_tTex2du4a" + Name 89 "psout" + Name 101 "flattenTemp" + Name 104 "@entryPointOutput.Color" + Name 108 "@entryPointOutput.Depth" + Name 113 "g_sSamp" + Name 116 "g_tTex1df4" + Name 119 "g_tTex1di4" + Name 122 "g_tTex1du4" + Name 125 "g_tTex2df4" + Name 128 "g_tTex2di4" + Name 131 "g_tTex2du4" + Name 134 "g_tTex3df4" + Name 137 "g_tTex3di4" + Name 140 "g_tTex3du4" + Name 143 "g_tTexcdf4" + Name 146 "g_tTexcdi4" + Name 149 "g_tTexcdu4" + Name 152 "g_tTexcdf4a" + Name 155 "g_tTexcdi4a" + Name 158 "g_tTexcdu4a" + Decorate 14(g_tTex1df4a) DescriptorSet 0 + MemberDecorate 20($Global) 0 Offset 0 + MemberDecorate 20($Global) 1 Offset 8 + MemberDecorate 20($Global) 2 Offset 16 + MemberDecorate 20($Global) 3 Offset 32 + MemberDecorate 20($Global) 4 Offset 48 + MemberDecorate 20($Global) 5 Offset 56 + MemberDecorate 20($Global) 6 Offset 64 + MemberDecorate 20($Global) 7 Offset 80 + Decorate 20($Global) Block + Decorate 22 DescriptorSet 0 + Decorate 36(g_tTex1di4a) DescriptorSet 0 + Decorate 46(g_tTex1du4a) DescriptorSet 0 + Decorate 57(g_tTex2df4a) DescriptorSet 0 + Decorate 70(g_tTex2di4a) DescriptorSet 0 + Decorate 80(g_tTex2du4a) DescriptorSet 0 + Decorate 104(@entryPointOutput.Color) Location 0 + Decorate 108(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 113(g_sSamp) DescriptorSet 0 + Decorate 113(g_sSamp) Binding 0 + Decorate 116(g_tTex1df4) DescriptorSet 0 + Decorate 116(g_tTex1df4) Binding 0 + Decorate 119(g_tTex1di4) DescriptorSet 0 + Decorate 122(g_tTex1du4) DescriptorSet 0 + Decorate 125(g_tTex2df4) DescriptorSet 0 + Decorate 128(g_tTex2di4) DescriptorSet 0 + Decorate 131(g_tTex2du4) DescriptorSet 0 + Decorate 134(g_tTex3df4) DescriptorSet 0 + Decorate 137(g_tTex3di4) DescriptorSet 0 + Decorate 140(g_tTex3du4) DescriptorSet 0 + Decorate 143(g_tTexcdf4) DescriptorSet 0 + Decorate 146(g_tTexcdi4) DescriptorSet 0 + Decorate 149(g_tTexcdu4) DescriptorSet 0 + Decorate 152(g_tTexcdf4a) DescriptorSet 0 + Decorate 155(g_tTexcdi4a) DescriptorSet 0 + Decorate 158(g_tTexcdu4a) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeImage 6(float) 1D array sampled format:Unknown + 13: TypePointer UniformConstant 12 + 14(g_tTex1df4a): 13(ptr) Variable UniformConstant + 16: TypeInt 32 1 + 17: TypeVector 16(int) 2 + 18: TypeVector 16(int) 3 + 19: TypeVector 16(int) 4 + 20($Global): TypeStruct 16(int) 17(ivec2) 18(ivec3) 19(ivec4) 16(int) 17(ivec2) 18(ivec3) 19(ivec4) + 21: TypePointer Uniform 20($Global) + 22: 21(ptr) Variable Uniform + 23: 16(int) Constant 2 + 24: TypePointer Uniform 18(ivec3) + 28: TypeInt 32 0 + 29: 28(int) Constant 2 + 30: TypePointer Uniform 16(int) + 34: TypeImage 16(int) 1D array sampled format:Unknown + 35: TypePointer UniformConstant 34 + 36(g_tTex1di4a): 35(ptr) Variable UniformConstant + 44: TypeImage 28(int) 1D array sampled format:Unknown + 45: TypePointer UniformConstant 44 + 46(g_tTex1du4a): 45(ptr) Variable UniformConstant + 53: TypeVector 28(int) 4 + 55: TypeImage 6(float) 2D array sampled format:Unknown + 56: TypePointer UniformConstant 55 + 57(g_tTex2df4a): 56(ptr) Variable UniformConstant + 59: 16(int) Constant 3 + 60: TypePointer Uniform 19(ivec4) + 64: 28(int) Constant 3 + 68: TypeImage 16(int) 2D array sampled format:Unknown + 69: TypePointer UniformConstant 68 + 70(g_tTex2di4a): 69(ptr) Variable UniformConstant + 78: TypeImage 28(int) 2D array sampled format:Unknown + 79: TypePointer UniformConstant 78 + 80(g_tTex2du4a): 79(ptr) Variable UniformConstant + 88: TypePointer Function 8(PS_OUTPUT) + 90: 16(int) Constant 0 + 91: 6(float) Constant 1065353216 + 92: 7(fvec4) ConstantComposite 91 91 91 91 + 93: TypePointer Function 7(fvec4) + 95: 16(int) Constant 1 + 96: TypePointer Function 6(float) + 103: TypePointer Output 7(fvec4) +104(@entryPointOutput.Color): 103(ptr) Variable Output + 107: TypePointer Output 6(float) +108(@entryPointOutput.Depth): 107(ptr) Variable Output + 111: TypeSampler + 112: TypePointer UniformConstant 111 + 113(g_sSamp): 112(ptr) Variable UniformConstant + 114: TypeImage 6(float) 1D sampled format:Unknown + 115: TypePointer UniformConstant 114 + 116(g_tTex1df4): 115(ptr) Variable UniformConstant + 117: TypeImage 16(int) 1D sampled format:Unknown + 118: TypePointer UniformConstant 117 + 119(g_tTex1di4): 118(ptr) Variable UniformConstant + 120: TypeImage 28(int) 1D sampled format:Unknown + 121: TypePointer UniformConstant 120 + 122(g_tTex1du4): 121(ptr) Variable UniformConstant + 123: TypeImage 6(float) 2D sampled format:Unknown + 124: TypePointer UniformConstant 123 + 125(g_tTex2df4): 124(ptr) Variable UniformConstant + 126: TypeImage 16(int) 2D sampled format:Unknown + 127: TypePointer UniformConstant 126 + 128(g_tTex2di4): 127(ptr) Variable UniformConstant + 129: TypeImage 28(int) 2D sampled format:Unknown + 130: TypePointer UniformConstant 129 + 131(g_tTex2du4): 130(ptr) Variable UniformConstant + 132: TypeImage 6(float) 3D sampled format:Unknown + 133: TypePointer UniformConstant 132 + 134(g_tTex3df4): 133(ptr) Variable UniformConstant + 135: TypeImage 16(int) 3D sampled format:Unknown + 136: TypePointer UniformConstant 135 + 137(g_tTex3di4): 136(ptr) Variable UniformConstant + 138: TypeImage 28(int) 3D sampled format:Unknown + 139: TypePointer UniformConstant 138 + 140(g_tTex3du4): 139(ptr) Variable UniformConstant + 141: TypeImage 6(float) Cube sampled format:Unknown + 142: TypePointer UniformConstant 141 + 143(g_tTexcdf4): 142(ptr) Variable UniformConstant + 144: TypeImage 16(int) Cube sampled format:Unknown + 145: TypePointer UniformConstant 144 + 146(g_tTexcdi4): 145(ptr) Variable UniformConstant + 147: TypeImage 28(int) Cube sampled format:Unknown + 148: TypePointer UniformConstant 147 + 149(g_tTexcdu4): 148(ptr) Variable UniformConstant + 150: TypeImage 6(float) Cube array sampled format:Unknown + 151: TypePointer UniformConstant 150 +152(g_tTexcdf4a): 151(ptr) Variable UniformConstant + 153: TypeImage 16(int) Cube array sampled format:Unknown + 154: TypePointer UniformConstant 153 +155(g_tTexcdi4a): 154(ptr) Variable UniformConstant + 156: TypeImage 28(int) Cube array sampled format:Unknown + 157: TypePointer UniformConstant 156 +158(g_tTexcdu4a): 157(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +101(flattenTemp): 88(ptr) Variable Function + 102:8(PS_OUTPUT) FunctionCall 10(@main() + Store 101(flattenTemp) 102 + 105: 93(ptr) AccessChain 101(flattenTemp) 90 + 106: 7(fvec4) Load 105 + Store 104(@entryPointOutput.Color) 106 + 109: 96(ptr) AccessChain 101(flattenTemp) 95 + 110: 6(float) Load 109 + Store 108(@entryPointOutput.Depth) 110 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 89(psout): 88(ptr) Variable Function + 15: 12 Load 14(g_tTex1df4a) + 25: 24(ptr) AccessChain 22 23 + 26: 18(ivec3) Load 25 + 27: 17(ivec2) VectorShuffle 26 26 0 1 + 31: 30(ptr) AccessChain 22 23 29 + 32: 16(int) Load 31 + 33: 7(fvec4) ImageFetch 15 27 Lod 32 + 37: 34 Load 36(g_tTex1di4a) + 38: 24(ptr) AccessChain 22 23 + 39: 18(ivec3) Load 38 + 40: 17(ivec2) VectorShuffle 39 39 0 1 + 41: 30(ptr) AccessChain 22 23 29 + 42: 16(int) Load 41 + 43: 19(ivec4) ImageFetch 37 40 Lod 42 + 47: 44 Load 46(g_tTex1du4a) + 48: 24(ptr) AccessChain 22 23 + 49: 18(ivec3) Load 48 + 50: 17(ivec2) VectorShuffle 49 49 0 1 + 51: 30(ptr) AccessChain 22 23 29 + 52: 16(int) Load 51 + 54: 53(ivec4) ImageFetch 47 50 Lod 52 + 58: 55 Load 57(g_tTex2df4a) + 61: 60(ptr) AccessChain 22 59 + 62: 19(ivec4) Load 61 + 63: 18(ivec3) VectorShuffle 62 62 0 1 2 + 65: 30(ptr) AccessChain 22 59 64 + 66: 16(int) Load 65 + 67: 7(fvec4) ImageFetch 58 63 Lod 66 + 71: 68 Load 70(g_tTex2di4a) + 72: 60(ptr) AccessChain 22 59 + 73: 19(ivec4) Load 72 + 74: 18(ivec3) VectorShuffle 73 73 0 1 2 + 75: 30(ptr) AccessChain 22 59 64 + 76: 16(int) Load 75 + 77: 19(ivec4) ImageFetch 71 74 Lod 76 + 81: 78 Load 80(g_tTex2du4a) + 82: 60(ptr) AccessChain 22 59 + 83: 19(ivec4) Load 82 + 84: 18(ivec3) VectorShuffle 83 83 0 1 2 + 85: 30(ptr) AccessChain 22 59 64 + 86: 16(int) Load 85 + 87: 53(ivec4) ImageFetch 81 84 Lod 86 + 94: 93(ptr) AccessChain 89(psout) 90 + Store 94 92 + 97: 96(ptr) AccessChain 89(psout) 95 + Store 97 91 + 98:8(PS_OUTPUT) Load 89(psout) + ReturnValue 98 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.load.basic.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.load.basic.dx10.frag.out new file mode 100644 index 00000000..bcfb977b --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.load.basic.dx10.frag.out @@ -0,0 +1,765 @@ +hlsl.load.basic.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:48 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Parameters: +0:? Sequence +0:52 textureFetch ( temp 4-component vector of float) +0:52 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:52 vector swizzle ( temp int) +0:52 c2: direct index for structure ( uniform 2-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 1 (const uint) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 direct index ( temp int) +0:52 c2: direct index for structure ( uniform 2-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 1 (const uint) +0:52 Constant: +0:52 1 (const int) +0:53 textureFetch ( temp 4-component vector of int) +0:53 'g_tTex1di4' ( uniform itexture1D) +0:53 vector swizzle ( temp int) +0:53 c2: direct index for structure ( uniform 2-component vector of int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 1 (const uint) +0:53 Sequence +0:53 Constant: +0:53 0 (const int) +0:53 direct index ( temp int) +0:53 c2: direct index for structure ( uniform 2-component vector of int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 1 (const uint) +0:53 Constant: +0:53 1 (const int) +0:54 textureFetch ( temp 4-component vector of uint) +0:54 'g_tTex1du4' ( uniform utexture1D) +0:54 vector swizzle ( temp int) +0:54 c2: direct index for structure ( uniform 2-component vector of int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 1 (const uint) +0:54 Sequence +0:54 Constant: +0:54 0 (const int) +0:54 direct index ( temp int) +0:54 c2: direct index for structure ( uniform 2-component vector of int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 1 (const uint) +0:54 Constant: +0:54 1 (const int) +0:57 textureFetch ( temp 4-component vector of float) +0:57 'g_tTex2df4' ( uniform texture2D) +0:57 vector swizzle ( temp 2-component vector of int) +0:57 c3: direct index for structure ( uniform 3-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 2 (const uint) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 direct index ( temp int) +0:57 c3: direct index for structure ( uniform 3-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 2 (const uint) +0:57 Constant: +0:57 2 (const int) +0:58 textureFetch ( temp 4-component vector of int) +0:58 'g_tTex2di4' ( uniform itexture2D) +0:58 vector swizzle ( temp 2-component vector of int) +0:58 c3: direct index for structure ( uniform 3-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 2 (const uint) +0:58 Sequence +0:58 Constant: +0:58 0 (const int) +0:58 Constant: +0:58 1 (const int) +0:58 direct index ( temp int) +0:58 c3: direct index for structure ( uniform 3-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 2 (const uint) +0:58 Constant: +0:58 2 (const int) +0:59 textureFetch ( temp 4-component vector of uint) +0:59 'g_tTex2du4' ( uniform utexture2D) +0:59 vector swizzle ( temp 2-component vector of int) +0:59 c3: direct index for structure ( uniform 3-component vector of int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:59 Constant: +0:59 2 (const uint) +0:59 Sequence +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:59 direct index ( temp int) +0:59 c3: direct index for structure ( uniform 3-component vector of int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:59 Constant: +0:59 2 (const uint) +0:59 Constant: +0:59 2 (const int) +0:62 textureFetch ( temp 4-component vector of float) +0:62 'g_tTex3df4' ( uniform texture3D) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 c4: direct index for structure ( uniform 4-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 3 (const uint) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:62 direct index ( temp int) +0:62 c4: direct index for structure ( uniform 4-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 3 (const uint) +0:62 Constant: +0:62 3 (const int) +0:63 textureFetch ( temp 4-component vector of int) +0:63 'g_tTex3di4' ( uniform itexture3D) +0:63 vector swizzle ( temp 3-component vector of int) +0:63 c4: direct index for structure ( uniform 4-component vector of int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:63 Constant: +0:63 3 (const uint) +0:63 Sequence +0:63 Constant: +0:63 0 (const int) +0:63 Constant: +0:63 1 (const int) +0:63 Constant: +0:63 2 (const int) +0:63 direct index ( temp int) +0:63 c4: direct index for structure ( uniform 4-component vector of int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:63 Constant: +0:63 3 (const uint) +0:63 Constant: +0:63 3 (const int) +0:64 textureFetch ( temp 4-component vector of uint) +0:64 'g_tTex3du4' ( uniform utexture3D) +0:64 vector swizzle ( temp 3-component vector of int) +0:64 c4: direct index for structure ( uniform 4-component vector of int) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:64 Constant: +0:64 3 (const uint) +0:64 Sequence +0:64 Constant: +0:64 0 (const int) +0:64 Constant: +0:64 1 (const int) +0:64 Constant: +0:64 2 (const int) +0:64 direct index ( temp int) +0:64 c4: direct index for structure ( uniform 4-component vector of int) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:64 Constant: +0:64 3 (const uint) +0:64 Constant: +0:64 3 (const int) +0:72 move second child to first child ( temp 4-component vector of float) +0:72 Color: direct index for structure ( temp 4-component vector of float) +0:72 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 1.000000 +0:72 1.000000 +0:72 1.000000 +0:72 1.000000 +0:73 move second child to first child ( temp float) +0:73 Depth: direct index for structure ( temp float) +0:73 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:73 Constant: +0:73 1 (const int) +0:73 Constant: +0:73 1.000000 +0:75 Branch: Return with expression +0:75 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Definition: main( ( temp void) +0:48 Function Parameters: +0:? Sequence +0:48 Sequence +0:48 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:48 Color: direct index for structure ( temp 4-component vector of float) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 0 (const int) +0:48 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:48 Depth: direct index for structure ( temp float) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:48 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Parameters: +0:? Sequence +0:52 textureFetch ( temp 4-component vector of float) +0:52 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:52 vector swizzle ( temp int) +0:52 c2: direct index for structure ( uniform 2-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 1 (const uint) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 direct index ( temp int) +0:52 c2: direct index for structure ( uniform 2-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 1 (const uint) +0:52 Constant: +0:52 1 (const int) +0:53 textureFetch ( temp 4-component vector of int) +0:53 'g_tTex1di4' ( uniform itexture1D) +0:53 vector swizzle ( temp int) +0:53 c2: direct index for structure ( uniform 2-component vector of int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 1 (const uint) +0:53 Sequence +0:53 Constant: +0:53 0 (const int) +0:53 direct index ( temp int) +0:53 c2: direct index for structure ( uniform 2-component vector of int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 1 (const uint) +0:53 Constant: +0:53 1 (const int) +0:54 textureFetch ( temp 4-component vector of uint) +0:54 'g_tTex1du4' ( uniform utexture1D) +0:54 vector swizzle ( temp int) +0:54 c2: direct index for structure ( uniform 2-component vector of int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 1 (const uint) +0:54 Sequence +0:54 Constant: +0:54 0 (const int) +0:54 direct index ( temp int) +0:54 c2: direct index for structure ( uniform 2-component vector of int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 1 (const uint) +0:54 Constant: +0:54 1 (const int) +0:57 textureFetch ( temp 4-component vector of float) +0:57 'g_tTex2df4' ( uniform texture2D) +0:57 vector swizzle ( temp 2-component vector of int) +0:57 c3: direct index for structure ( uniform 3-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 2 (const uint) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 direct index ( temp int) +0:57 c3: direct index for structure ( uniform 3-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 2 (const uint) +0:57 Constant: +0:57 2 (const int) +0:58 textureFetch ( temp 4-component vector of int) +0:58 'g_tTex2di4' ( uniform itexture2D) +0:58 vector swizzle ( temp 2-component vector of int) +0:58 c3: direct index for structure ( uniform 3-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 2 (const uint) +0:58 Sequence +0:58 Constant: +0:58 0 (const int) +0:58 Constant: +0:58 1 (const int) +0:58 direct index ( temp int) +0:58 c3: direct index for structure ( uniform 3-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 2 (const uint) +0:58 Constant: +0:58 2 (const int) +0:59 textureFetch ( temp 4-component vector of uint) +0:59 'g_tTex2du4' ( uniform utexture2D) +0:59 vector swizzle ( temp 2-component vector of int) +0:59 c3: direct index for structure ( uniform 3-component vector of int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:59 Constant: +0:59 2 (const uint) +0:59 Sequence +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:59 direct index ( temp int) +0:59 c3: direct index for structure ( uniform 3-component vector of int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:59 Constant: +0:59 2 (const uint) +0:59 Constant: +0:59 2 (const int) +0:62 textureFetch ( temp 4-component vector of float) +0:62 'g_tTex3df4' ( uniform texture3D) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 c4: direct index for structure ( uniform 4-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 3 (const uint) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:62 direct index ( temp int) +0:62 c4: direct index for structure ( uniform 4-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 3 (const uint) +0:62 Constant: +0:62 3 (const int) +0:63 textureFetch ( temp 4-component vector of int) +0:63 'g_tTex3di4' ( uniform itexture3D) +0:63 vector swizzle ( temp 3-component vector of int) +0:63 c4: direct index for structure ( uniform 4-component vector of int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:63 Constant: +0:63 3 (const uint) +0:63 Sequence +0:63 Constant: +0:63 0 (const int) +0:63 Constant: +0:63 1 (const int) +0:63 Constant: +0:63 2 (const int) +0:63 direct index ( temp int) +0:63 c4: direct index for structure ( uniform 4-component vector of int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:63 Constant: +0:63 3 (const uint) +0:63 Constant: +0:63 3 (const int) +0:64 textureFetch ( temp 4-component vector of uint) +0:64 'g_tTex3du4' ( uniform utexture3D) +0:64 vector swizzle ( temp 3-component vector of int) +0:64 c4: direct index for structure ( uniform 4-component vector of int) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:64 Constant: +0:64 3 (const uint) +0:64 Sequence +0:64 Constant: +0:64 0 (const int) +0:64 Constant: +0:64 1 (const int) +0:64 Constant: +0:64 2 (const int) +0:64 direct index ( temp int) +0:64 c4: direct index for structure ( uniform 4-component vector of int) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:64 Constant: +0:64 3 (const uint) +0:64 Constant: +0:64 3 (const int) +0:72 move second child to first child ( temp 4-component vector of float) +0:72 Color: direct index for structure ( temp 4-component vector of float) +0:72 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 1.000000 +0:72 1.000000 +0:72 1.000000 +0:72 1.000000 +0:73 move second child to first child ( temp float) +0:73 Depth: direct index for structure ( temp float) +0:73 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:73 Constant: +0:73 1 (const int) +0:73 Constant: +0:73 1.000000 +0:75 Branch: Return with expression +0:75 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Definition: main( ( temp void) +0:48 Function Parameters: +0:? Sequence +0:48 Sequence +0:48 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:48 Color: direct index for structure ( temp 4-component vector of float) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 0 (const int) +0:48 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:48 Depth: direct index for structure ( temp float) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 179 + + Capability Shader + Capability Sampled1D + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 133 137 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 14 "g_tTex1df4" + Name 20 "$Global" + MemberName 20($Global) 0 "c1" + MemberName 20($Global) 1 "c2" + MemberName 20($Global) 2 "c3" + MemberName 20($Global) 3 "c4" + MemberName 20($Global) 4 "o1" + MemberName 20($Global) 5 "o2" + MemberName 20($Global) 6 "o3" + MemberName 20($Global) 7 "o4" + Name 22 "" + Name 35 "g_tTex1di4" + Name 44 "g_tTex1du4" + Name 54 "g_tTex2df4" + Name 67 "g_tTex2di4" + Name 77 "g_tTex2du4" + Name 87 "g_tTex3df4" + Name 100 "g_tTex3di4" + Name 110 "g_tTex3du4" + Name 119 "psout" + Name 130 "flattenTemp" + Name 133 "@entryPointOutput.Color" + Name 137 "@entryPointOutput.Depth" + Name 142 "g_sSamp" + Name 145 "g_tTexcdf4" + Name 148 "g_tTexcdi4" + Name 151 "g_tTexcdu4" + Name 154 "g_tTex1df4a" + Name 157 "g_tTex1di4a" + Name 160 "g_tTex1du4a" + Name 163 "g_tTex2df4a" + Name 166 "g_tTex2di4a" + Name 169 "g_tTex2du4a" + Name 172 "g_tTexcdf4a" + Name 175 "g_tTexcdi4a" + Name 178 "g_tTexcdu4a" + Decorate 14(g_tTex1df4) DescriptorSet 0 + Decorate 14(g_tTex1df4) Binding 0 + MemberDecorate 20($Global) 0 Offset 0 + MemberDecorate 20($Global) 1 Offset 8 + MemberDecorate 20($Global) 2 Offset 16 + MemberDecorate 20($Global) 3 Offset 32 + MemberDecorate 20($Global) 4 Offset 48 + MemberDecorate 20($Global) 5 Offset 56 + MemberDecorate 20($Global) 6 Offset 64 + MemberDecorate 20($Global) 7 Offset 80 + Decorate 20($Global) Block + Decorate 22 DescriptorSet 0 + Decorate 35(g_tTex1di4) DescriptorSet 0 + Decorate 44(g_tTex1du4) DescriptorSet 0 + Decorate 54(g_tTex2df4) DescriptorSet 0 + Decorate 67(g_tTex2di4) DescriptorSet 0 + Decorate 77(g_tTex2du4) DescriptorSet 0 + Decorate 87(g_tTex3df4) DescriptorSet 0 + Decorate 100(g_tTex3di4) DescriptorSet 0 + Decorate 110(g_tTex3du4) DescriptorSet 0 + Decorate 133(@entryPointOutput.Color) Location 0 + Decorate 137(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 142(g_sSamp) DescriptorSet 0 + Decorate 142(g_sSamp) Binding 0 + Decorate 145(g_tTexcdf4) DescriptorSet 0 + Decorate 148(g_tTexcdi4) DescriptorSet 0 + Decorate 151(g_tTexcdu4) DescriptorSet 0 + Decorate 154(g_tTex1df4a) DescriptorSet 0 + Decorate 157(g_tTex1di4a) DescriptorSet 0 + Decorate 160(g_tTex1du4a) DescriptorSet 0 + Decorate 163(g_tTex2df4a) DescriptorSet 0 + Decorate 166(g_tTex2di4a) DescriptorSet 0 + Decorate 169(g_tTex2du4a) DescriptorSet 0 + Decorate 172(g_tTexcdf4a) DescriptorSet 0 + Decorate 175(g_tTexcdi4a) DescriptorSet 0 + Decorate 178(g_tTexcdu4a) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeImage 6(float) 1D sampled format:Unknown + 13: TypePointer UniformConstant 12 + 14(g_tTex1df4): 13(ptr) Variable UniformConstant + 16: TypeInt 32 1 + 17: TypeVector 16(int) 2 + 18: TypeVector 16(int) 3 + 19: TypeVector 16(int) 4 + 20($Global): TypeStruct 16(int) 17(ivec2) 18(ivec3) 19(ivec4) 16(int) 17(ivec2) 18(ivec3) 19(ivec4) + 21: TypePointer Uniform 20($Global) + 22: 21(ptr) Variable Uniform + 23: 16(int) Constant 1 + 24: TypeInt 32 0 + 25: 24(int) Constant 0 + 26: TypePointer Uniform 16(int) + 29: 24(int) Constant 1 + 33: TypeImage 16(int) 1D sampled format:Unknown + 34: TypePointer UniformConstant 33 + 35(g_tTex1di4): 34(ptr) Variable UniformConstant + 42: TypeImage 24(int) 1D sampled format:Unknown + 43: TypePointer UniformConstant 42 + 44(g_tTex1du4): 43(ptr) Variable UniformConstant + 50: TypeVector 24(int) 4 + 52: TypeImage 6(float) 2D sampled format:Unknown + 53: TypePointer UniformConstant 52 + 54(g_tTex2df4): 53(ptr) Variable UniformConstant + 56: 16(int) Constant 2 + 57: TypePointer Uniform 18(ivec3) + 61: 24(int) Constant 2 + 65: TypeImage 16(int) 2D sampled format:Unknown + 66: TypePointer UniformConstant 65 + 67(g_tTex2di4): 66(ptr) Variable UniformConstant + 75: TypeImage 24(int) 2D sampled format:Unknown + 76: TypePointer UniformConstant 75 + 77(g_tTex2du4): 76(ptr) Variable UniformConstant + 85: TypeImage 6(float) 3D sampled format:Unknown + 86: TypePointer UniformConstant 85 + 87(g_tTex3df4): 86(ptr) Variable UniformConstant + 89: 16(int) Constant 3 + 90: TypePointer Uniform 19(ivec4) + 94: 24(int) Constant 3 + 98: TypeImage 16(int) 3D sampled format:Unknown + 99: TypePointer UniformConstant 98 + 100(g_tTex3di4): 99(ptr) Variable UniformConstant + 108: TypeImage 24(int) 3D sampled format:Unknown + 109: TypePointer UniformConstant 108 + 110(g_tTex3du4): 109(ptr) Variable UniformConstant + 118: TypePointer Function 8(PS_OUTPUT) + 120: 16(int) Constant 0 + 121: 6(float) Constant 1065353216 + 122: 7(fvec4) ConstantComposite 121 121 121 121 + 123: TypePointer Function 7(fvec4) + 125: TypePointer Function 6(float) + 132: TypePointer Output 7(fvec4) +133(@entryPointOutput.Color): 132(ptr) Variable Output + 136: TypePointer Output 6(float) +137(@entryPointOutput.Depth): 136(ptr) Variable Output + 140: TypeSampler + 141: TypePointer UniformConstant 140 + 142(g_sSamp): 141(ptr) Variable UniformConstant + 143: TypeImage 6(float) Cube sampled format:Unknown + 144: TypePointer UniformConstant 143 + 145(g_tTexcdf4): 144(ptr) Variable UniformConstant + 146: TypeImage 16(int) Cube sampled format:Unknown + 147: TypePointer UniformConstant 146 + 148(g_tTexcdi4): 147(ptr) Variable UniformConstant + 149: TypeImage 24(int) Cube sampled format:Unknown + 150: TypePointer UniformConstant 149 + 151(g_tTexcdu4): 150(ptr) Variable UniformConstant + 152: TypeImage 6(float) 1D array sampled format:Unknown + 153: TypePointer UniformConstant 152 +154(g_tTex1df4a): 153(ptr) Variable UniformConstant + 155: TypeImage 16(int) 1D array sampled format:Unknown + 156: TypePointer UniformConstant 155 +157(g_tTex1di4a): 156(ptr) Variable UniformConstant + 158: TypeImage 24(int) 1D array sampled format:Unknown + 159: TypePointer UniformConstant 158 +160(g_tTex1du4a): 159(ptr) Variable UniformConstant + 161: TypeImage 6(float) 2D array sampled format:Unknown + 162: TypePointer UniformConstant 161 +163(g_tTex2df4a): 162(ptr) Variable UniformConstant + 164: TypeImage 16(int) 2D array sampled format:Unknown + 165: TypePointer UniformConstant 164 +166(g_tTex2di4a): 165(ptr) Variable UniformConstant + 167: TypeImage 24(int) 2D array sampled format:Unknown + 168: TypePointer UniformConstant 167 +169(g_tTex2du4a): 168(ptr) Variable UniformConstant + 170: TypeImage 6(float) Cube array sampled format:Unknown + 171: TypePointer UniformConstant 170 +172(g_tTexcdf4a): 171(ptr) Variable UniformConstant + 173: TypeImage 16(int) Cube array sampled format:Unknown + 174: TypePointer UniformConstant 173 +175(g_tTexcdi4a): 174(ptr) Variable UniformConstant + 176: TypeImage 24(int) Cube array sampled format:Unknown + 177: TypePointer UniformConstant 176 +178(g_tTexcdu4a): 177(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +130(flattenTemp): 118(ptr) Variable Function + 131:8(PS_OUTPUT) FunctionCall 10(@main() + Store 130(flattenTemp) 131 + 134: 123(ptr) AccessChain 130(flattenTemp) 120 + 135: 7(fvec4) Load 134 + Store 133(@entryPointOutput.Color) 135 + 138: 125(ptr) AccessChain 130(flattenTemp) 23 + 139: 6(float) Load 138 + Store 137(@entryPointOutput.Depth) 139 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 119(psout): 118(ptr) Variable Function + 15: 12 Load 14(g_tTex1df4) + 27: 26(ptr) AccessChain 22 23 25 + 28: 16(int) Load 27 + 30: 26(ptr) AccessChain 22 23 29 + 31: 16(int) Load 30 + 32: 7(fvec4) ImageFetch 15 28 Lod 31 + 36: 33 Load 35(g_tTex1di4) + 37: 26(ptr) AccessChain 22 23 25 + 38: 16(int) Load 37 + 39: 26(ptr) AccessChain 22 23 29 + 40: 16(int) Load 39 + 41: 19(ivec4) ImageFetch 36 38 Lod 40 + 45: 42 Load 44(g_tTex1du4) + 46: 26(ptr) AccessChain 22 23 25 + 47: 16(int) Load 46 + 48: 26(ptr) AccessChain 22 23 29 + 49: 16(int) Load 48 + 51: 50(ivec4) ImageFetch 45 47 Lod 49 + 55: 52 Load 54(g_tTex2df4) + 58: 57(ptr) AccessChain 22 56 + 59: 18(ivec3) Load 58 + 60: 17(ivec2) VectorShuffle 59 59 0 1 + 62: 26(ptr) AccessChain 22 56 61 + 63: 16(int) Load 62 + 64: 7(fvec4) ImageFetch 55 60 Lod 63 + 68: 65 Load 67(g_tTex2di4) + 69: 57(ptr) AccessChain 22 56 + 70: 18(ivec3) Load 69 + 71: 17(ivec2) VectorShuffle 70 70 0 1 + 72: 26(ptr) AccessChain 22 56 61 + 73: 16(int) Load 72 + 74: 19(ivec4) ImageFetch 68 71 Lod 73 + 78: 75 Load 77(g_tTex2du4) + 79: 57(ptr) AccessChain 22 56 + 80: 18(ivec3) Load 79 + 81: 17(ivec2) VectorShuffle 80 80 0 1 + 82: 26(ptr) AccessChain 22 56 61 + 83: 16(int) Load 82 + 84: 50(ivec4) ImageFetch 78 81 Lod 83 + 88: 85 Load 87(g_tTex3df4) + 91: 90(ptr) AccessChain 22 89 + 92: 19(ivec4) Load 91 + 93: 18(ivec3) VectorShuffle 92 92 0 1 2 + 95: 26(ptr) AccessChain 22 89 94 + 96: 16(int) Load 95 + 97: 7(fvec4) ImageFetch 88 93 Lod 96 + 101: 98 Load 100(g_tTex3di4) + 102: 90(ptr) AccessChain 22 89 + 103: 19(ivec4) Load 102 + 104: 18(ivec3) VectorShuffle 103 103 0 1 2 + 105: 26(ptr) AccessChain 22 89 94 + 106: 16(int) Load 105 + 107: 19(ivec4) ImageFetch 101 104 Lod 106 + 111: 108 Load 110(g_tTex3du4) + 112: 90(ptr) AccessChain 22 89 + 113: 19(ivec4) Load 112 + 114: 18(ivec3) VectorShuffle 113 113 0 1 2 + 115: 26(ptr) AccessChain 22 89 94 + 116: 16(int) Load 115 + 117: 50(ivec4) ImageFetch 111 114 Lod 116 + 124: 123(ptr) AccessChain 119(psout) 120 + Store 124 122 + 126: 125(ptr) AccessChain 119(psout) 23 + Store 126 121 + 127:8(PS_OUTPUT) Load 119(psout) + ReturnValue 127 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.load.basic.dx10.vert.out b/deps/glslang/Test/baseResults/hlsl.load.basic.dx10.vert.out new file mode 100644 index 00000000..16389916 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.load.basic.dx10.vert.out @@ -0,0 +1,710 @@ +hlsl.load.basic.dx10.vert +Shader version: 500 +0:? Sequence +0:47 Function Definition: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:47 Function Parameters: +0:? Sequence +0:51 textureFetch ( temp 4-component vector of float) +0:51 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:51 vector swizzle ( temp int) +0:51 c2: direct index for structure ( uniform 2-component vector of int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:51 Constant: +0:51 1 (const uint) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 direct index ( temp int) +0:51 c2: direct index for structure ( uniform 2-component vector of int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:51 Constant: +0:51 1 (const uint) +0:51 Constant: +0:51 1 (const int) +0:52 textureFetch ( temp 4-component vector of int) +0:52 'g_tTex1di4' ( uniform itexture1D) +0:52 vector swizzle ( temp int) +0:52 c2: direct index for structure ( uniform 2-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 1 (const uint) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 direct index ( temp int) +0:52 c2: direct index for structure ( uniform 2-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 1 (const uint) +0:52 Constant: +0:52 1 (const int) +0:53 textureFetch ( temp 4-component vector of uint) +0:53 'g_tTex1du4' ( uniform utexture1D) +0:53 vector swizzle ( temp int) +0:53 c2: direct index for structure ( uniform 2-component vector of int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 1 (const uint) +0:53 Sequence +0:53 Constant: +0:53 0 (const int) +0:53 direct index ( temp int) +0:53 c2: direct index for structure ( uniform 2-component vector of int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 1 (const uint) +0:53 Constant: +0:53 1 (const int) +0:56 textureFetch ( temp 4-component vector of float) +0:56 'g_tTex2df4' ( uniform texture2D) +0:56 vector swizzle ( temp 2-component vector of int) +0:56 c3: direct index for structure ( uniform 3-component vector of int) +0:56 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:56 Constant: +0:56 2 (const uint) +0:56 Sequence +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1 (const int) +0:56 direct index ( temp int) +0:56 c3: direct index for structure ( uniform 3-component vector of int) +0:56 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:56 Constant: +0:56 2 (const uint) +0:56 Constant: +0:56 2 (const int) +0:57 textureFetch ( temp 4-component vector of int) +0:57 'g_tTex2di4' ( uniform itexture2D) +0:57 vector swizzle ( temp 2-component vector of int) +0:57 c3: direct index for structure ( uniform 3-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 2 (const uint) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 direct index ( temp int) +0:57 c3: direct index for structure ( uniform 3-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 2 (const uint) +0:57 Constant: +0:57 2 (const int) +0:58 textureFetch ( temp 4-component vector of uint) +0:58 'g_tTex2du4' ( uniform utexture2D) +0:58 vector swizzle ( temp 2-component vector of int) +0:58 c3: direct index for structure ( uniform 3-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 2 (const uint) +0:58 Sequence +0:58 Constant: +0:58 0 (const int) +0:58 Constant: +0:58 1 (const int) +0:58 direct index ( temp int) +0:58 c3: direct index for structure ( uniform 3-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 2 (const uint) +0:58 Constant: +0:58 2 (const int) +0:61 textureFetch ( temp 4-component vector of float) +0:61 'g_tTex3df4' ( uniform texture3D) +0:61 vector swizzle ( temp 3-component vector of int) +0:61 c4: direct index for structure ( uniform 4-component vector of int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:61 Constant: +0:61 3 (const uint) +0:61 Sequence +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Constant: +0:61 2 (const int) +0:61 direct index ( temp int) +0:61 c4: direct index for structure ( uniform 4-component vector of int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:61 Constant: +0:61 3 (const uint) +0:61 Constant: +0:61 3 (const int) +0:62 textureFetch ( temp 4-component vector of int) +0:62 'g_tTex3di4' ( uniform itexture3D) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 c4: direct index for structure ( uniform 4-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 3 (const uint) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:62 direct index ( temp int) +0:62 c4: direct index for structure ( uniform 4-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 3 (const uint) +0:62 Constant: +0:62 3 (const int) +0:63 textureFetch ( temp 4-component vector of uint) +0:63 'g_tTex3du4' ( uniform utexture3D) +0:63 vector swizzle ( temp 3-component vector of int) +0:63 c4: direct index for structure ( uniform 4-component vector of int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:63 Constant: +0:63 3 (const uint) +0:63 Sequence +0:63 Constant: +0:63 0 (const int) +0:63 Constant: +0:63 1 (const int) +0:63 Constant: +0:63 2 (const int) +0:63 direct index ( temp int) +0:63 c4: direct index for structure ( uniform 4-component vector of int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:63 Constant: +0:63 3 (const uint) +0:63 Constant: +0:63 3 (const int) +0:67 move second child to first child ( temp 4-component vector of float) +0:67 Pos: direct index for structure ( temp 4-component vector of float) +0:67 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:67 Constant: +0:67 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:69 Branch: Return with expression +0:69 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:47 Function Definition: main( ( temp void) +0:47 Function Parameters: +0:? Sequence +0:47 Sequence +0:47 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:47 Pos: direct index for structure ( temp 4-component vector of float) +0:47 Function Call: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:47 Constant: +0:47 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:47 Function Definition: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:47 Function Parameters: +0:? Sequence +0:51 textureFetch ( temp 4-component vector of float) +0:51 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:51 vector swizzle ( temp int) +0:51 c2: direct index for structure ( uniform 2-component vector of int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:51 Constant: +0:51 1 (const uint) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 direct index ( temp int) +0:51 c2: direct index for structure ( uniform 2-component vector of int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:51 Constant: +0:51 1 (const uint) +0:51 Constant: +0:51 1 (const int) +0:52 textureFetch ( temp 4-component vector of int) +0:52 'g_tTex1di4' ( uniform itexture1D) +0:52 vector swizzle ( temp int) +0:52 c2: direct index for structure ( uniform 2-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 1 (const uint) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 direct index ( temp int) +0:52 c2: direct index for structure ( uniform 2-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 1 (const uint) +0:52 Constant: +0:52 1 (const int) +0:53 textureFetch ( temp 4-component vector of uint) +0:53 'g_tTex1du4' ( uniform utexture1D) +0:53 vector swizzle ( temp int) +0:53 c2: direct index for structure ( uniform 2-component vector of int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 1 (const uint) +0:53 Sequence +0:53 Constant: +0:53 0 (const int) +0:53 direct index ( temp int) +0:53 c2: direct index for structure ( uniform 2-component vector of int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 1 (const uint) +0:53 Constant: +0:53 1 (const int) +0:56 textureFetch ( temp 4-component vector of float) +0:56 'g_tTex2df4' ( uniform texture2D) +0:56 vector swizzle ( temp 2-component vector of int) +0:56 c3: direct index for structure ( uniform 3-component vector of int) +0:56 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:56 Constant: +0:56 2 (const uint) +0:56 Sequence +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1 (const int) +0:56 direct index ( temp int) +0:56 c3: direct index for structure ( uniform 3-component vector of int) +0:56 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:56 Constant: +0:56 2 (const uint) +0:56 Constant: +0:56 2 (const int) +0:57 textureFetch ( temp 4-component vector of int) +0:57 'g_tTex2di4' ( uniform itexture2D) +0:57 vector swizzle ( temp 2-component vector of int) +0:57 c3: direct index for structure ( uniform 3-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 2 (const uint) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 direct index ( temp int) +0:57 c3: direct index for structure ( uniform 3-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 2 (const uint) +0:57 Constant: +0:57 2 (const int) +0:58 textureFetch ( temp 4-component vector of uint) +0:58 'g_tTex2du4' ( uniform utexture2D) +0:58 vector swizzle ( temp 2-component vector of int) +0:58 c3: direct index for structure ( uniform 3-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 2 (const uint) +0:58 Sequence +0:58 Constant: +0:58 0 (const int) +0:58 Constant: +0:58 1 (const int) +0:58 direct index ( temp int) +0:58 c3: direct index for structure ( uniform 3-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 2 (const uint) +0:58 Constant: +0:58 2 (const int) +0:61 textureFetch ( temp 4-component vector of float) +0:61 'g_tTex3df4' ( uniform texture3D) +0:61 vector swizzle ( temp 3-component vector of int) +0:61 c4: direct index for structure ( uniform 4-component vector of int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:61 Constant: +0:61 3 (const uint) +0:61 Sequence +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Constant: +0:61 2 (const int) +0:61 direct index ( temp int) +0:61 c4: direct index for structure ( uniform 4-component vector of int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:61 Constant: +0:61 3 (const uint) +0:61 Constant: +0:61 3 (const int) +0:62 textureFetch ( temp 4-component vector of int) +0:62 'g_tTex3di4' ( uniform itexture3D) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 c4: direct index for structure ( uniform 4-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 3 (const uint) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:62 direct index ( temp int) +0:62 c4: direct index for structure ( uniform 4-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 3 (const uint) +0:62 Constant: +0:62 3 (const int) +0:63 textureFetch ( temp 4-component vector of uint) +0:63 'g_tTex3du4' ( uniform utexture3D) +0:63 vector swizzle ( temp 3-component vector of int) +0:63 c4: direct index for structure ( uniform 4-component vector of int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:63 Constant: +0:63 3 (const uint) +0:63 Sequence +0:63 Constant: +0:63 0 (const int) +0:63 Constant: +0:63 1 (const int) +0:63 Constant: +0:63 2 (const int) +0:63 direct index ( temp int) +0:63 c4: direct index for structure ( uniform 4-component vector of int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:63 Constant: +0:63 3 (const uint) +0:63 Constant: +0:63 3 (const int) +0:67 move second child to first child ( temp 4-component vector of float) +0:67 Pos: direct index for structure ( temp 4-component vector of float) +0:67 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:67 Constant: +0:67 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:69 Branch: Return with expression +0:69 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:47 Function Definition: main( ( temp void) +0:47 Function Parameters: +0:? Sequence +0:47 Sequence +0:47 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:47 Pos: direct index for structure ( temp 4-component vector of float) +0:47 Function Call: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:47 Constant: +0:47 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 171 + + Capability Shader + Capability Sampled1D + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 129 + Source HLSL 500 + Name 4 "main" + Name 8 "VS_OUTPUT" + MemberName 8(VS_OUTPUT) 0 "Pos" + Name 10 "@main(" + Name 14 "g_tTex1df4" + Name 20 "$Global" + MemberName 20($Global) 0 "c1" + MemberName 20($Global) 1 "c2" + MemberName 20($Global) 2 "c3" + MemberName 20($Global) 3 "c4" + MemberName 20($Global) 4 "o1" + MemberName 20($Global) 5 "o2" + MemberName 20($Global) 6 "o3" + MemberName 20($Global) 7 "o4" + Name 22 "" + Name 35 "g_tTex1di4" + Name 44 "g_tTex1du4" + Name 54 "g_tTex2df4" + Name 67 "g_tTex2di4" + Name 77 "g_tTex2du4" + Name 87 "g_tTex3df4" + Name 100 "g_tTex3di4" + Name 110 "g_tTex3du4" + Name 119 "vsout" + Name 129 "@entryPointOutput.Pos" + Name 134 "g_sSamp" + Name 137 "g_tTexcdf4" + Name 140 "g_tTexcdi4" + Name 143 "g_tTexcdu4" + Name 146 "g_tTex1df4a" + Name 149 "g_tTex1di4a" + Name 152 "g_tTex1du4a" + Name 155 "g_tTex2df4a" + Name 158 "g_tTex2di4a" + Name 161 "g_tTex2du4a" + Name 164 "g_tTexcdf4a" + Name 167 "g_tTexcdi4a" + Name 170 "g_tTexcdu4a" + Decorate 14(g_tTex1df4) DescriptorSet 0 + Decorate 14(g_tTex1df4) Binding 0 + MemberDecorate 20($Global) 0 Offset 0 + MemberDecorate 20($Global) 1 Offset 8 + MemberDecorate 20($Global) 2 Offset 16 + MemberDecorate 20($Global) 3 Offset 32 + MemberDecorate 20($Global) 4 Offset 48 + MemberDecorate 20($Global) 5 Offset 56 + MemberDecorate 20($Global) 6 Offset 64 + MemberDecorate 20($Global) 7 Offset 80 + Decorate 20($Global) Block + Decorate 22 DescriptorSet 0 + Decorate 35(g_tTex1di4) DescriptorSet 0 + Decorate 44(g_tTex1du4) DescriptorSet 0 + Decorate 54(g_tTex2df4) DescriptorSet 0 + Decorate 67(g_tTex2di4) DescriptorSet 0 + Decorate 77(g_tTex2du4) DescriptorSet 0 + Decorate 87(g_tTex3df4) DescriptorSet 0 + Decorate 100(g_tTex3di4) DescriptorSet 0 + Decorate 110(g_tTex3du4) DescriptorSet 0 + Decorate 129(@entryPointOutput.Pos) BuiltIn Position + Decorate 134(g_sSamp) DescriptorSet 0 + Decorate 134(g_sSamp) Binding 0 + Decorate 137(g_tTexcdf4) DescriptorSet 0 + Decorate 140(g_tTexcdi4) DescriptorSet 0 + Decorate 143(g_tTexcdu4) DescriptorSet 0 + Decorate 146(g_tTex1df4a) DescriptorSet 0 + Decorate 149(g_tTex1di4a) DescriptorSet 0 + Decorate 152(g_tTex1du4a) DescriptorSet 0 + Decorate 155(g_tTex2df4a) DescriptorSet 0 + Decorate 158(g_tTex2di4a) DescriptorSet 0 + Decorate 161(g_tTex2du4a) DescriptorSet 0 + Decorate 164(g_tTexcdf4a) DescriptorSet 0 + Decorate 167(g_tTexcdi4a) DescriptorSet 0 + Decorate 170(g_tTexcdu4a) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(VS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(VS_OUTPUT) + 12: TypeImage 6(float) 1D sampled format:Unknown + 13: TypePointer UniformConstant 12 + 14(g_tTex1df4): 13(ptr) Variable UniformConstant + 16: TypeInt 32 1 + 17: TypeVector 16(int) 2 + 18: TypeVector 16(int) 3 + 19: TypeVector 16(int) 4 + 20($Global): TypeStruct 16(int) 17(ivec2) 18(ivec3) 19(ivec4) 16(int) 17(ivec2) 18(ivec3) 19(ivec4) + 21: TypePointer Uniform 20($Global) + 22: 21(ptr) Variable Uniform + 23: 16(int) Constant 1 + 24: TypeInt 32 0 + 25: 24(int) Constant 0 + 26: TypePointer Uniform 16(int) + 29: 24(int) Constant 1 + 33: TypeImage 16(int) 1D sampled format:Unknown + 34: TypePointer UniformConstant 33 + 35(g_tTex1di4): 34(ptr) Variable UniformConstant + 42: TypeImage 24(int) 1D sampled format:Unknown + 43: TypePointer UniformConstant 42 + 44(g_tTex1du4): 43(ptr) Variable UniformConstant + 50: TypeVector 24(int) 4 + 52: TypeImage 6(float) 2D sampled format:Unknown + 53: TypePointer UniformConstant 52 + 54(g_tTex2df4): 53(ptr) Variable UniformConstant + 56: 16(int) Constant 2 + 57: TypePointer Uniform 18(ivec3) + 61: 24(int) Constant 2 + 65: TypeImage 16(int) 2D sampled format:Unknown + 66: TypePointer UniformConstant 65 + 67(g_tTex2di4): 66(ptr) Variable UniformConstant + 75: TypeImage 24(int) 2D sampled format:Unknown + 76: TypePointer UniformConstant 75 + 77(g_tTex2du4): 76(ptr) Variable UniformConstant + 85: TypeImage 6(float) 3D sampled format:Unknown + 86: TypePointer UniformConstant 85 + 87(g_tTex3df4): 86(ptr) Variable UniformConstant + 89: 16(int) Constant 3 + 90: TypePointer Uniform 19(ivec4) + 94: 24(int) Constant 3 + 98: TypeImage 16(int) 3D sampled format:Unknown + 99: TypePointer UniformConstant 98 + 100(g_tTex3di4): 99(ptr) Variable UniformConstant + 108: TypeImage 24(int) 3D sampled format:Unknown + 109: TypePointer UniformConstant 108 + 110(g_tTex3du4): 109(ptr) Variable UniformConstant + 118: TypePointer Function 8(VS_OUTPUT) + 120: 16(int) Constant 0 + 121: 6(float) Constant 0 + 122: 7(fvec4) ConstantComposite 121 121 121 121 + 123: TypePointer Function 7(fvec4) + 128: TypePointer Output 7(fvec4) +129(@entryPointOutput.Pos): 128(ptr) Variable Output + 132: TypeSampler + 133: TypePointer UniformConstant 132 + 134(g_sSamp): 133(ptr) Variable UniformConstant + 135: TypeImage 6(float) Cube sampled format:Unknown + 136: TypePointer UniformConstant 135 + 137(g_tTexcdf4): 136(ptr) Variable UniformConstant + 138: TypeImage 16(int) Cube sampled format:Unknown + 139: TypePointer UniformConstant 138 + 140(g_tTexcdi4): 139(ptr) Variable UniformConstant + 141: TypeImage 24(int) Cube sampled format:Unknown + 142: TypePointer UniformConstant 141 + 143(g_tTexcdu4): 142(ptr) Variable UniformConstant + 144: TypeImage 6(float) 1D array sampled format:Unknown + 145: TypePointer UniformConstant 144 +146(g_tTex1df4a): 145(ptr) Variable UniformConstant + 147: TypeImage 16(int) 1D array sampled format:Unknown + 148: TypePointer UniformConstant 147 +149(g_tTex1di4a): 148(ptr) Variable UniformConstant + 150: TypeImage 24(int) 1D array sampled format:Unknown + 151: TypePointer UniformConstant 150 +152(g_tTex1du4a): 151(ptr) Variable UniformConstant + 153: TypeImage 6(float) 2D array sampled format:Unknown + 154: TypePointer UniformConstant 153 +155(g_tTex2df4a): 154(ptr) Variable UniformConstant + 156: TypeImage 16(int) 2D array sampled format:Unknown + 157: TypePointer UniformConstant 156 +158(g_tTex2di4a): 157(ptr) Variable UniformConstant + 159: TypeImage 24(int) 2D array sampled format:Unknown + 160: TypePointer UniformConstant 159 +161(g_tTex2du4a): 160(ptr) Variable UniformConstant + 162: TypeImage 6(float) Cube array sampled format:Unknown + 163: TypePointer UniformConstant 162 +164(g_tTexcdf4a): 163(ptr) Variable UniformConstant + 165: TypeImage 16(int) Cube array sampled format:Unknown + 166: TypePointer UniformConstant 165 +167(g_tTexcdi4a): 166(ptr) Variable UniformConstant + 168: TypeImage 24(int) Cube array sampled format:Unknown + 169: TypePointer UniformConstant 168 +170(g_tTexcdu4a): 169(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 130:8(VS_OUTPUT) FunctionCall 10(@main() + 131: 7(fvec4) CompositeExtract 130 0 + Store 129(@entryPointOutput.Pos) 131 + Return + FunctionEnd + 10(@main():8(VS_OUTPUT) Function None 9 + 11: Label + 119(vsout): 118(ptr) Variable Function + 15: 12 Load 14(g_tTex1df4) + 27: 26(ptr) AccessChain 22 23 25 + 28: 16(int) Load 27 + 30: 26(ptr) AccessChain 22 23 29 + 31: 16(int) Load 30 + 32: 7(fvec4) ImageFetch 15 28 Lod 31 + 36: 33 Load 35(g_tTex1di4) + 37: 26(ptr) AccessChain 22 23 25 + 38: 16(int) Load 37 + 39: 26(ptr) AccessChain 22 23 29 + 40: 16(int) Load 39 + 41: 19(ivec4) ImageFetch 36 38 Lod 40 + 45: 42 Load 44(g_tTex1du4) + 46: 26(ptr) AccessChain 22 23 25 + 47: 16(int) Load 46 + 48: 26(ptr) AccessChain 22 23 29 + 49: 16(int) Load 48 + 51: 50(ivec4) ImageFetch 45 47 Lod 49 + 55: 52 Load 54(g_tTex2df4) + 58: 57(ptr) AccessChain 22 56 + 59: 18(ivec3) Load 58 + 60: 17(ivec2) VectorShuffle 59 59 0 1 + 62: 26(ptr) AccessChain 22 56 61 + 63: 16(int) Load 62 + 64: 7(fvec4) ImageFetch 55 60 Lod 63 + 68: 65 Load 67(g_tTex2di4) + 69: 57(ptr) AccessChain 22 56 + 70: 18(ivec3) Load 69 + 71: 17(ivec2) VectorShuffle 70 70 0 1 + 72: 26(ptr) AccessChain 22 56 61 + 73: 16(int) Load 72 + 74: 19(ivec4) ImageFetch 68 71 Lod 73 + 78: 75 Load 77(g_tTex2du4) + 79: 57(ptr) AccessChain 22 56 + 80: 18(ivec3) Load 79 + 81: 17(ivec2) VectorShuffle 80 80 0 1 + 82: 26(ptr) AccessChain 22 56 61 + 83: 16(int) Load 82 + 84: 50(ivec4) ImageFetch 78 81 Lod 83 + 88: 85 Load 87(g_tTex3df4) + 91: 90(ptr) AccessChain 22 89 + 92: 19(ivec4) Load 91 + 93: 18(ivec3) VectorShuffle 92 92 0 1 2 + 95: 26(ptr) AccessChain 22 89 94 + 96: 16(int) Load 95 + 97: 7(fvec4) ImageFetch 88 93 Lod 96 + 101: 98 Load 100(g_tTex3di4) + 102: 90(ptr) AccessChain 22 89 + 103: 19(ivec4) Load 102 + 104: 18(ivec3) VectorShuffle 103 103 0 1 2 + 105: 26(ptr) AccessChain 22 89 94 + 106: 16(int) Load 105 + 107: 19(ivec4) ImageFetch 101 104 Lod 106 + 111: 108 Load 110(g_tTex3du4) + 112: 90(ptr) AccessChain 22 89 + 113: 19(ivec4) Load 112 + 114: 18(ivec3) VectorShuffle 113 113 0 1 2 + 115: 26(ptr) AccessChain 22 89 94 + 116: 16(int) Load 115 + 117: 50(ivec4) ImageFetch 111 114 Lod 116 + 124: 123(ptr) AccessChain 119(vsout) 120 + Store 124 122 + 125:8(VS_OUTPUT) Load 119(vsout) + ReturnValue 125 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.load.buffer.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.load.buffer.dx10.frag.out new file mode 100644 index 00000000..21e5d304 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.load.buffer.dx10.frag.out @@ -0,0 +1,302 @@ +hlsl.load.buffer.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of float) +0:28 'r00' ( temp 4-component vector of float) +0:28 textureFetch ( temp 4-component vector of float) +0:28 'g_tTexbf4' (layout( rgba32f) uniform textureBuffer) +0:28 c1: direct index for structure ( uniform int) +0:28 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:28 Constant: +0:28 0 (const uint) +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of int) +0:29 'r01' ( temp 4-component vector of int) +0:29 textureFetch ( temp 4-component vector of int) +0:29 'g_tTexbi4' (layout( rgba32i) uniform itextureBuffer) +0:29 c1: direct index for structure ( uniform int) +0:29 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:29 Constant: +0:29 0 (const uint) +0:30 Sequence +0:30 move second child to first child ( temp 4-component vector of uint) +0:30 'r02' ( temp 4-component vector of uint) +0:30 textureFetch ( temp 4-component vector of uint) +0:30 'g_tTexbu4' (layout( rgba32ui) uniform utextureBuffer) +0:30 c1: direct index for structure ( uniform int) +0:30 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:30 Constant: +0:30 0 (const uint) +0:34 move second child to first child ( temp 4-component vector of float) +0:34 Color: direct index for structure ( temp 4-component vector of float) +0:34 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 1.000000 +0:34 1.000000 +0:34 1.000000 +0:34 1.000000 +0:35 move second child to first child ( temp float) +0:35 Depth: direct index for structure ( temp float) +0:35 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:35 Constant: +0:35 1 (const int) +0:35 Constant: +0:35 1.000000 +0:37 Branch: Return with expression +0:37 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:24 Color: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:24 Depth: direct index for structure ( temp float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? 'g_tTexbf4_test' (layout( binding=0 rgba32f) uniform textureBuffer) +0:? 'g_tTexbf4' (layout( rgba32f) uniform textureBuffer) +0:? 'g_tTexbi4' (layout( rgba32i) uniform itextureBuffer) +0:? 'g_tTexbu4' (layout( rgba32ui) uniform utextureBuffer) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of float) +0:28 'r00' ( temp 4-component vector of float) +0:28 textureFetch ( temp 4-component vector of float) +0:28 'g_tTexbf4' (layout( rgba32f) uniform textureBuffer) +0:28 c1: direct index for structure ( uniform int) +0:28 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:28 Constant: +0:28 0 (const uint) +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of int) +0:29 'r01' ( temp 4-component vector of int) +0:29 textureFetch ( temp 4-component vector of int) +0:29 'g_tTexbi4' (layout( rgba32i) uniform itextureBuffer) +0:29 c1: direct index for structure ( uniform int) +0:29 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:29 Constant: +0:29 0 (const uint) +0:30 Sequence +0:30 move second child to first child ( temp 4-component vector of uint) +0:30 'r02' ( temp 4-component vector of uint) +0:30 textureFetch ( temp 4-component vector of uint) +0:30 'g_tTexbu4' (layout( rgba32ui) uniform utextureBuffer) +0:30 c1: direct index for structure ( uniform int) +0:30 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:30 Constant: +0:30 0 (const uint) +0:34 move second child to first child ( temp 4-component vector of float) +0:34 Color: direct index for structure ( temp 4-component vector of float) +0:34 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 1.000000 +0:34 1.000000 +0:34 1.000000 +0:34 1.000000 +0:35 move second child to first child ( temp float) +0:35 Depth: direct index for structure ( temp float) +0:35 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:35 Constant: +0:35 1 (const int) +0:35 Constant: +0:35 1.000000 +0:37 Branch: Return with expression +0:37 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:24 Color: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:24 Depth: direct index for structure ( temp float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? 'g_tTexbf4_test' (layout( binding=0 rgba32f) uniform textureBuffer) +0:? 'g_tTexbf4' (layout( rgba32f) uniform textureBuffer) +0:? 'g_tTexbi4' (layout( rgba32i) uniform itextureBuffer) +0:? 'g_tTexbu4' (layout( rgba32ui) uniform utextureBuffer) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 72 + + Capability Shader + Capability SampledBuffer + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 64 68 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "r00" + Name 16 "g_tTexbf4" + Name 22 "$Global" + MemberName 22($Global) 0 "c1" + MemberName 22($Global) 1 "c2" + MemberName 22($Global) 2 "c3" + MemberName 22($Global) 3 "c4" + MemberName 22($Global) 4 "o1" + MemberName 22($Global) 5 "o2" + MemberName 22($Global) 6 "o3" + MemberName 22($Global) 7 "o4" + Name 24 "" + Name 31 "r01" + Name 34 "g_tTexbi4" + Name 42 "r02" + Name 45 "g_tTexbu4" + Name 51 "psout" + Name 61 "flattenTemp" + Name 64 "@entryPointOutput.Color" + Name 68 "@entryPointOutput.Depth" + Name 71 "g_tTexbf4_test" + Decorate 16(g_tTexbf4) DescriptorSet 0 + MemberDecorate 22($Global) 0 Offset 0 + MemberDecorate 22($Global) 1 Offset 8 + MemberDecorate 22($Global) 2 Offset 16 + MemberDecorate 22($Global) 3 Offset 32 + MemberDecorate 22($Global) 4 Offset 48 + MemberDecorate 22($Global) 5 Offset 56 + MemberDecorate 22($Global) 6 Offset 64 + MemberDecorate 22($Global) 7 Offset 80 + Decorate 22($Global) Block + Decorate 24 DescriptorSet 0 + Decorate 34(g_tTexbi4) DescriptorSet 0 + Decorate 45(g_tTexbu4) DescriptorSet 0 + Decorate 64(@entryPointOutput.Color) Location 0 + Decorate 68(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 71(g_tTexbf4_test) DescriptorSet 0 + Decorate 71(g_tTexbf4_test) Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) Buffer sampled format:Rgba32f + 15: TypePointer UniformConstant 14 + 16(g_tTexbf4): 15(ptr) Variable UniformConstant + 18: TypeInt 32 1 + 19: TypeVector 18(int) 2 + 20: TypeVector 18(int) 3 + 21: TypeVector 18(int) 4 + 22($Global): TypeStruct 18(int) 19(ivec2) 20(ivec3) 21(ivec4) 18(int) 19(ivec2) 20(ivec3) 21(ivec4) + 23: TypePointer Uniform 22($Global) + 24: 23(ptr) Variable Uniform + 25: 18(int) Constant 0 + 26: TypePointer Uniform 18(int) + 30: TypePointer Function 21(ivec4) + 32: TypeImage 18(int) Buffer sampled format:Rgba32i + 33: TypePointer UniformConstant 32 + 34(g_tTexbi4): 33(ptr) Variable UniformConstant + 39: TypeInt 32 0 + 40: TypeVector 39(int) 4 + 41: TypePointer Function 40(ivec4) + 43: TypeImage 39(int) Buffer sampled format:Rgba32ui + 44: TypePointer UniformConstant 43 + 45(g_tTexbu4): 44(ptr) Variable UniformConstant + 50: TypePointer Function 8(PS_OUTPUT) + 52: 6(float) Constant 1065353216 + 53: 7(fvec4) ConstantComposite 52 52 52 52 + 55: 18(int) Constant 1 + 56: TypePointer Function 6(float) + 63: TypePointer Output 7(fvec4) +64(@entryPointOutput.Color): 63(ptr) Variable Output + 67: TypePointer Output 6(float) +68(@entryPointOutput.Depth): 67(ptr) Variable Output +71(g_tTexbf4_test): 15(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 61(flattenTemp): 50(ptr) Variable Function + 62:8(PS_OUTPUT) FunctionCall 10(@main() + Store 61(flattenTemp) 62 + 65: 12(ptr) AccessChain 61(flattenTemp) 25 + 66: 7(fvec4) Load 65 + Store 64(@entryPointOutput.Color) 66 + 69: 56(ptr) AccessChain 61(flattenTemp) 55 + 70: 6(float) Load 69 + Store 68(@entryPointOutput.Depth) 70 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(r00): 12(ptr) Variable Function + 31(r01): 30(ptr) Variable Function + 42(r02): 41(ptr) Variable Function + 51(psout): 50(ptr) Variable Function + 17: 14 Load 16(g_tTexbf4) + 27: 26(ptr) AccessChain 24 25 + 28: 18(int) Load 27 + 29: 7(fvec4) ImageFetch 17 28 + Store 13(r00) 29 + 35: 32 Load 34(g_tTexbi4) + 36: 26(ptr) AccessChain 24 25 + 37: 18(int) Load 36 + 38: 21(ivec4) ImageFetch 35 37 + Store 31(r01) 38 + 46: 43 Load 45(g_tTexbu4) + 47: 26(ptr) AccessChain 24 25 + 48: 18(int) Load 47 + 49: 40(ivec4) ImageFetch 46 48 + Store 42(r02) 49 + 54: 12(ptr) AccessChain 51(psout) 25 + Store 54 53 + 57: 56(ptr) AccessChain 51(psout) 55 + Store 57 52 + 58:8(PS_OUTPUT) Load 51(psout) + ReturnValue 58 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out new file mode 100644 index 00000000..d951d093 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out @@ -0,0 +1,311 @@ +hlsl.load.buffer.float.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp float) +0:28 'r00' ( temp float) +0:28 Construct float ( temp float) +0:? textureFetch ( temp 4-component vector of float) +0:28 'g_tTexbfs' (layout( r32f) uniform textureBuffer) +0:28 c1: direct index for structure ( uniform int) +0:28 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:28 Constant: +0:28 0 (const uint) +0:29 Sequence +0:29 move second child to first child ( temp int) +0:29 'r01' ( temp int) +0:29 Construct int ( temp int) +0:? textureFetch ( temp 4-component vector of int) +0:29 'g_tTexbis' (layout( r32i) uniform itextureBuffer) +0:29 c1: direct index for structure ( uniform int) +0:29 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:29 Constant: +0:29 0 (const uint) +0:30 Sequence +0:30 move second child to first child ( temp uint) +0:30 'r02' ( temp uint) +0:30 Construct uint ( temp uint) +0:? textureFetch ( temp 4-component vector of uint) +0:30 'g_tTexbus' (layout( r32ui) uniform utextureBuffer) +0:30 c1: direct index for structure ( uniform int) +0:30 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:30 Constant: +0:30 0 (const uint) +0:34 move second child to first child ( temp 4-component vector of float) +0:34 Color: direct index for structure ( temp 4-component vector of float) +0:34 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 1.000000 +0:34 1.000000 +0:34 1.000000 +0:34 1.000000 +0:35 move second child to first child ( temp float) +0:35 Depth: direct index for structure ( temp float) +0:35 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:35 Constant: +0:35 1 (const int) +0:35 Constant: +0:35 1.000000 +0:37 Branch: Return with expression +0:37 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:24 Color: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:24 Depth: direct index for structure ( temp float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? 'g_tTexbfs_test' (layout( binding=0 r32f) uniform textureBuffer) +0:? 'g_tTexbfs' (layout( r32f) uniform textureBuffer) +0:? 'g_tTexbis' (layout( r32i) uniform itextureBuffer) +0:? 'g_tTexbus' (layout( r32ui) uniform utextureBuffer) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp float) +0:28 'r00' ( temp float) +0:28 Construct float ( temp float) +0:? textureFetch ( temp 4-component vector of float) +0:28 'g_tTexbfs' (layout( r32f) uniform textureBuffer) +0:28 c1: direct index for structure ( uniform int) +0:28 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:28 Constant: +0:28 0 (const uint) +0:29 Sequence +0:29 move second child to first child ( temp int) +0:29 'r01' ( temp int) +0:29 Construct int ( temp int) +0:? textureFetch ( temp 4-component vector of int) +0:29 'g_tTexbis' (layout( r32i) uniform itextureBuffer) +0:29 c1: direct index for structure ( uniform int) +0:29 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:29 Constant: +0:29 0 (const uint) +0:30 Sequence +0:30 move second child to first child ( temp uint) +0:30 'r02' ( temp uint) +0:30 Construct uint ( temp uint) +0:? textureFetch ( temp 4-component vector of uint) +0:30 'g_tTexbus' (layout( r32ui) uniform utextureBuffer) +0:30 c1: direct index for structure ( uniform int) +0:30 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:30 Constant: +0:30 0 (const uint) +0:34 move second child to first child ( temp 4-component vector of float) +0:34 Color: direct index for structure ( temp 4-component vector of float) +0:34 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 1.000000 +0:34 1.000000 +0:34 1.000000 +0:34 1.000000 +0:35 move second child to first child ( temp float) +0:35 Depth: direct index for structure ( temp float) +0:35 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:35 Constant: +0:35 1 (const int) +0:35 Constant: +0:35 1.000000 +0:37 Branch: Return with expression +0:37 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:24 Color: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:24 Depth: direct index for structure ( temp float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? 'g_tTexbfs_test' (layout( binding=0 r32f) uniform textureBuffer) +0:? 'g_tTexbfs' (layout( r32f) uniform textureBuffer) +0:? 'g_tTexbis' (layout( r32i) uniform itextureBuffer) +0:? 'g_tTexbus' (layout( r32ui) uniform utextureBuffer) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 75 + + Capability Shader + Capability SampledBuffer + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 67 71 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "r00" + Name 16 "g_tTexbfs" + Name 22 "$Global" + MemberName 22($Global) 0 "c1" + MemberName 22($Global) 1 "c2" + MemberName 22($Global) 2 "c3" + MemberName 22($Global) 3 "c4" + MemberName 22($Global) 4 "o1" + MemberName 22($Global) 5 "o2" + MemberName 22($Global) 6 "o3" + MemberName 22($Global) 7 "o4" + Name 24 "" + Name 32 "r01" + Name 35 "g_tTexbis" + Name 43 "r02" + Name 46 "g_tTexbus" + Name 54 "psout" + Name 64 "flattenTemp" + Name 67 "@entryPointOutput.Color" + Name 71 "@entryPointOutput.Depth" + Name 74 "g_tTexbfs_test" + Decorate 16(g_tTexbfs) DescriptorSet 0 + MemberDecorate 22($Global) 0 Offset 0 + MemberDecorate 22($Global) 1 Offset 8 + MemberDecorate 22($Global) 2 Offset 16 + MemberDecorate 22($Global) 3 Offset 32 + MemberDecorate 22($Global) 4 Offset 48 + MemberDecorate 22($Global) 5 Offset 56 + MemberDecorate 22($Global) 6 Offset 64 + MemberDecorate 22($Global) 7 Offset 80 + Decorate 22($Global) Block + Decorate 24 DescriptorSet 0 + Decorate 35(g_tTexbis) DescriptorSet 0 + Decorate 46(g_tTexbus) DescriptorSet 0 + Decorate 67(@entryPointOutput.Color) Location 0 + Decorate 71(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 74(g_tTexbfs_test) DescriptorSet 0 + Decorate 74(g_tTexbfs_test) Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 6(float) + 14: TypeImage 6(float) Buffer sampled format:R32f + 15: TypePointer UniformConstant 14 + 16(g_tTexbfs): 15(ptr) Variable UniformConstant + 18: TypeInt 32 1 + 19: TypeVector 18(int) 2 + 20: TypeVector 18(int) 3 + 21: TypeVector 18(int) 4 + 22($Global): TypeStruct 18(int) 19(ivec2) 20(ivec3) 21(ivec4) 18(int) 19(ivec2) 20(ivec3) 21(ivec4) + 23: TypePointer Uniform 22($Global) + 24: 23(ptr) Variable Uniform + 25: 18(int) Constant 0 + 26: TypePointer Uniform 18(int) + 31: TypePointer Function 18(int) + 33: TypeImage 18(int) Buffer sampled format:R32i + 34: TypePointer UniformConstant 33 + 35(g_tTexbis): 34(ptr) Variable UniformConstant + 41: TypeInt 32 0 + 42: TypePointer Function 41(int) + 44: TypeImage 41(int) Buffer sampled format:R32ui + 45: TypePointer UniformConstant 44 + 46(g_tTexbus): 45(ptr) Variable UniformConstant + 50: TypeVector 41(int) 4 + 53: TypePointer Function 8(PS_OUTPUT) + 55: 6(float) Constant 1065353216 + 56: 7(fvec4) ConstantComposite 55 55 55 55 + 57: TypePointer Function 7(fvec4) + 59: 18(int) Constant 1 + 66: TypePointer Output 7(fvec4) +67(@entryPointOutput.Color): 66(ptr) Variable Output + 70: TypePointer Output 6(float) +71(@entryPointOutput.Depth): 70(ptr) Variable Output +74(g_tTexbfs_test): 15(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 64(flattenTemp): 53(ptr) Variable Function + 65:8(PS_OUTPUT) FunctionCall 10(@main() + Store 64(flattenTemp) 65 + 68: 57(ptr) AccessChain 64(flattenTemp) 25 + 69: 7(fvec4) Load 68 + Store 67(@entryPointOutput.Color) 69 + 72: 12(ptr) AccessChain 64(flattenTemp) 59 + 73: 6(float) Load 72 + Store 71(@entryPointOutput.Depth) 73 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(r00): 12(ptr) Variable Function + 32(r01): 31(ptr) Variable Function + 43(r02): 42(ptr) Variable Function + 54(psout): 53(ptr) Variable Function + 17: 14 Load 16(g_tTexbfs) + 27: 26(ptr) AccessChain 24 25 + 28: 18(int) Load 27 + 29: 7(fvec4) ImageFetch 17 28 + 30: 6(float) CompositeExtract 29 0 + Store 13(r00) 30 + 36: 33 Load 35(g_tTexbis) + 37: 26(ptr) AccessChain 24 25 + 38: 18(int) Load 37 + 39: 21(ivec4) ImageFetch 36 38 + 40: 18(int) CompositeExtract 39 0 + Store 32(r01) 40 + 47: 44 Load 46(g_tTexbus) + 48: 26(ptr) AccessChain 24 25 + 49: 18(int) Load 48 + 51: 50(ivec4) ImageFetch 47 49 + 52: 41(int) CompositeExtract 51 0 + Store 43(r02) 52 + 58: 57(ptr) AccessChain 54(psout) 25 + Store 58 56 + 60: 12(ptr) AccessChain 54(psout) 59 + Store 60 55 + 61:8(PS_OUTPUT) Load 54(psout) + ReturnValue 61 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.load.offset.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.load.offset.dx10.frag.out new file mode 100644 index 00000000..d59ff6ff --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.load.offset.dx10.frag.out @@ -0,0 +1,860 @@ +hlsl.load.offset.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:48 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Parameters: +0:? Sequence +0:52 textureFetchOffset ( temp 4-component vector of float) +0:52 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:52 vector swizzle ( temp int) +0:52 c2: direct index for structure ( uniform 2-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 1 (const uint) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 direct index ( temp int) +0:52 c2: direct index for structure ( uniform 2-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 1 (const uint) +0:52 Constant: +0:52 1 (const int) +0:52 o1: direct index for structure ( uniform int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 4 (const uint) +0:53 textureFetchOffset ( temp 4-component vector of int) +0:53 'g_tTex1di4' ( uniform itexture1D) +0:53 vector swizzle ( temp int) +0:53 c2: direct index for structure ( uniform 2-component vector of int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 1 (const uint) +0:53 Sequence +0:53 Constant: +0:53 0 (const int) +0:53 direct index ( temp int) +0:53 c2: direct index for structure ( uniform 2-component vector of int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 1 (const uint) +0:53 Constant: +0:53 1 (const int) +0:53 o1: direct index for structure ( uniform int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 4 (const uint) +0:54 textureFetchOffset ( temp 4-component vector of uint) +0:54 'g_tTex1du4' ( uniform utexture1D) +0:54 vector swizzle ( temp int) +0:54 c2: direct index for structure ( uniform 2-component vector of int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 1 (const uint) +0:54 Sequence +0:54 Constant: +0:54 0 (const int) +0:54 direct index ( temp int) +0:54 c2: direct index for structure ( uniform 2-component vector of int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 1 (const uint) +0:54 Constant: +0:54 1 (const int) +0:54 o1: direct index for structure ( uniform int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 4 (const uint) +0:57 textureFetchOffset ( temp 4-component vector of float) +0:57 'g_tTex2df4' ( uniform texture2D) +0:57 vector swizzle ( temp 2-component vector of int) +0:57 c3: direct index for structure ( uniform 3-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 2 (const uint) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 direct index ( temp int) +0:57 c3: direct index for structure ( uniform 3-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 2 (const uint) +0:57 Constant: +0:57 2 (const int) +0:57 o2: direct index for structure ( uniform 2-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 5 (const uint) +0:58 textureFetchOffset ( temp 4-component vector of int) +0:58 'g_tTex2di4' ( uniform itexture2D) +0:58 vector swizzle ( temp 2-component vector of int) +0:58 c3: direct index for structure ( uniform 3-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 2 (const uint) +0:58 Sequence +0:58 Constant: +0:58 0 (const int) +0:58 Constant: +0:58 1 (const int) +0:58 direct index ( temp int) +0:58 c3: direct index for structure ( uniform 3-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 2 (const uint) +0:58 Constant: +0:58 2 (const int) +0:58 o2: direct index for structure ( uniform 2-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 5 (const uint) +0:59 textureFetchOffset ( temp 4-component vector of uint) +0:59 'g_tTex2du4' ( uniform utexture2D) +0:59 vector swizzle ( temp 2-component vector of int) +0:59 c3: direct index for structure ( uniform 3-component vector of int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:59 Constant: +0:59 2 (const uint) +0:59 Sequence +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:59 direct index ( temp int) +0:59 c3: direct index for structure ( uniform 3-component vector of int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:59 Constant: +0:59 2 (const uint) +0:59 Constant: +0:59 2 (const int) +0:59 o2: direct index for structure ( uniform 2-component vector of int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:59 Constant: +0:59 5 (const uint) +0:62 textureFetchOffset ( temp 4-component vector of float) +0:62 'g_tTex3df4' ( uniform texture3D) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 c4: direct index for structure ( uniform 4-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 3 (const uint) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:62 direct index ( temp int) +0:62 c4: direct index for structure ( uniform 4-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 3 (const uint) +0:62 Constant: +0:62 3 (const int) +0:62 o3: direct index for structure ( uniform 3-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 6 (const uint) +0:63 textureFetchOffset ( temp 4-component vector of int) +0:63 'g_tTex3di4' ( uniform itexture3D) +0:63 vector swizzle ( temp 3-component vector of int) +0:63 c4: direct index for structure ( uniform 4-component vector of int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:63 Constant: +0:63 3 (const uint) +0:63 Sequence +0:63 Constant: +0:63 0 (const int) +0:63 Constant: +0:63 1 (const int) +0:63 Constant: +0:63 2 (const int) +0:63 direct index ( temp int) +0:63 c4: direct index for structure ( uniform 4-component vector of int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:63 Constant: +0:63 3 (const uint) +0:63 Constant: +0:63 3 (const int) +0:63 o3: direct index for structure ( uniform 3-component vector of int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:63 Constant: +0:63 6 (const uint) +0:64 textureFetchOffset ( temp 4-component vector of uint) +0:64 'g_tTex3du4' ( uniform utexture3D) +0:64 vector swizzle ( temp 3-component vector of int) +0:64 c4: direct index for structure ( uniform 4-component vector of int) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:64 Constant: +0:64 3 (const uint) +0:64 Sequence +0:64 Constant: +0:64 0 (const int) +0:64 Constant: +0:64 1 (const int) +0:64 Constant: +0:64 2 (const int) +0:64 direct index ( temp int) +0:64 c4: direct index for structure ( uniform 4-component vector of int) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:64 Constant: +0:64 3 (const uint) +0:64 Constant: +0:64 3 (const int) +0:64 o3: direct index for structure ( uniform 3-component vector of int) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:64 Constant: +0:64 6 (const uint) +0:72 move second child to first child ( temp 4-component vector of float) +0:72 Color: direct index for structure ( temp 4-component vector of float) +0:72 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 1.000000 +0:72 1.000000 +0:72 1.000000 +0:72 1.000000 +0:73 move second child to first child ( temp float) +0:73 Depth: direct index for structure ( temp float) +0:73 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:73 Constant: +0:73 1 (const int) +0:73 Constant: +0:73 1.000000 +0:75 Branch: Return with expression +0:75 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Definition: main( ( temp void) +0:48 Function Parameters: +0:? Sequence +0:48 Sequence +0:48 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:48 Color: direct index for structure ( temp 4-component vector of float) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 0 (const int) +0:48 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:48 Depth: direct index for structure ( temp float) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:48 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Parameters: +0:? Sequence +0:52 textureFetchOffset ( temp 4-component vector of float) +0:52 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:52 vector swizzle ( temp int) +0:52 c2: direct index for structure ( uniform 2-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 1 (const uint) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 direct index ( temp int) +0:52 c2: direct index for structure ( uniform 2-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 1 (const uint) +0:52 Constant: +0:52 1 (const int) +0:52 o1: direct index for structure ( uniform int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 4 (const uint) +0:53 textureFetchOffset ( temp 4-component vector of int) +0:53 'g_tTex1di4' ( uniform itexture1D) +0:53 vector swizzle ( temp int) +0:53 c2: direct index for structure ( uniform 2-component vector of int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 1 (const uint) +0:53 Sequence +0:53 Constant: +0:53 0 (const int) +0:53 direct index ( temp int) +0:53 c2: direct index for structure ( uniform 2-component vector of int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 1 (const uint) +0:53 Constant: +0:53 1 (const int) +0:53 o1: direct index for structure ( uniform int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 4 (const uint) +0:54 textureFetchOffset ( temp 4-component vector of uint) +0:54 'g_tTex1du4' ( uniform utexture1D) +0:54 vector swizzle ( temp int) +0:54 c2: direct index for structure ( uniform 2-component vector of int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 1 (const uint) +0:54 Sequence +0:54 Constant: +0:54 0 (const int) +0:54 direct index ( temp int) +0:54 c2: direct index for structure ( uniform 2-component vector of int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 1 (const uint) +0:54 Constant: +0:54 1 (const int) +0:54 o1: direct index for structure ( uniform int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 4 (const uint) +0:57 textureFetchOffset ( temp 4-component vector of float) +0:57 'g_tTex2df4' ( uniform texture2D) +0:57 vector swizzle ( temp 2-component vector of int) +0:57 c3: direct index for structure ( uniform 3-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 2 (const uint) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 direct index ( temp int) +0:57 c3: direct index for structure ( uniform 3-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 2 (const uint) +0:57 Constant: +0:57 2 (const int) +0:57 o2: direct index for structure ( uniform 2-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 5 (const uint) +0:58 textureFetchOffset ( temp 4-component vector of int) +0:58 'g_tTex2di4' ( uniform itexture2D) +0:58 vector swizzle ( temp 2-component vector of int) +0:58 c3: direct index for structure ( uniform 3-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 2 (const uint) +0:58 Sequence +0:58 Constant: +0:58 0 (const int) +0:58 Constant: +0:58 1 (const int) +0:58 direct index ( temp int) +0:58 c3: direct index for structure ( uniform 3-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 2 (const uint) +0:58 Constant: +0:58 2 (const int) +0:58 o2: direct index for structure ( uniform 2-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 5 (const uint) +0:59 textureFetchOffset ( temp 4-component vector of uint) +0:59 'g_tTex2du4' ( uniform utexture2D) +0:59 vector swizzle ( temp 2-component vector of int) +0:59 c3: direct index for structure ( uniform 3-component vector of int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:59 Constant: +0:59 2 (const uint) +0:59 Sequence +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:59 direct index ( temp int) +0:59 c3: direct index for structure ( uniform 3-component vector of int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:59 Constant: +0:59 2 (const uint) +0:59 Constant: +0:59 2 (const int) +0:59 o2: direct index for structure ( uniform 2-component vector of int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:59 Constant: +0:59 5 (const uint) +0:62 textureFetchOffset ( temp 4-component vector of float) +0:62 'g_tTex3df4' ( uniform texture3D) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 c4: direct index for structure ( uniform 4-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 3 (const uint) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:62 direct index ( temp int) +0:62 c4: direct index for structure ( uniform 4-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 3 (const uint) +0:62 Constant: +0:62 3 (const int) +0:62 o3: direct index for structure ( uniform 3-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 6 (const uint) +0:63 textureFetchOffset ( temp 4-component vector of int) +0:63 'g_tTex3di4' ( uniform itexture3D) +0:63 vector swizzle ( temp 3-component vector of int) +0:63 c4: direct index for structure ( uniform 4-component vector of int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:63 Constant: +0:63 3 (const uint) +0:63 Sequence +0:63 Constant: +0:63 0 (const int) +0:63 Constant: +0:63 1 (const int) +0:63 Constant: +0:63 2 (const int) +0:63 direct index ( temp int) +0:63 c4: direct index for structure ( uniform 4-component vector of int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:63 Constant: +0:63 3 (const uint) +0:63 Constant: +0:63 3 (const int) +0:63 o3: direct index for structure ( uniform 3-component vector of int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:63 Constant: +0:63 6 (const uint) +0:64 textureFetchOffset ( temp 4-component vector of uint) +0:64 'g_tTex3du4' ( uniform utexture3D) +0:64 vector swizzle ( temp 3-component vector of int) +0:64 c4: direct index for structure ( uniform 4-component vector of int) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:64 Constant: +0:64 3 (const uint) +0:64 Sequence +0:64 Constant: +0:64 0 (const int) +0:64 Constant: +0:64 1 (const int) +0:64 Constant: +0:64 2 (const int) +0:64 direct index ( temp int) +0:64 c4: direct index for structure ( uniform 4-component vector of int) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:64 Constant: +0:64 3 (const uint) +0:64 Constant: +0:64 3 (const int) +0:64 o3: direct index for structure ( uniform 3-component vector of int) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:64 Constant: +0:64 6 (const uint) +0:72 move second child to first child ( temp 4-component vector of float) +0:72 Color: direct index for structure ( temp 4-component vector of float) +0:72 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 1.000000 +0:72 1.000000 +0:72 1.000000 +0:72 1.000000 +0:73 move second child to first child ( temp float) +0:73 Depth: direct index for structure ( temp float) +0:73 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:73 Constant: +0:73 1 (const int) +0:73 Constant: +0:73 1.000000 +0:75 Branch: Return with expression +0:75 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Definition: main( ( temp void) +0:48 Function Parameters: +0:? Sequence +0:48 Sequence +0:48 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:48 Color: direct index for structure ( temp 4-component vector of float) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 0 (const int) +0:48 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:48 Depth: direct index for structure ( temp float) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 201 + + Capability Shader + Capability ImageGatherExtended + Capability Sampled1D + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 155 159 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 14 "g_tTex1df4" + Name 20 "$Global" + MemberName 20($Global) 0 "c1" + MemberName 20($Global) 1 "c2" + MemberName 20($Global) 2 "c3" + MemberName 20($Global) 3 "c4" + MemberName 20($Global) 4 "o1" + MemberName 20($Global) 5 "o2" + MemberName 20($Global) 6 "o3" + MemberName 20($Global) 7 "o4" + Name 22 "" + Name 38 "g_tTex1di4" + Name 49 "g_tTex1du4" + Name 61 "g_tTex2df4" + Name 78 "g_tTex2di4" + Name 90 "g_tTex2du4" + Name 102 "g_tTex3df4" + Name 118 "g_tTex3di4" + Name 130 "g_tTex3du4" + Name 141 "psout" + Name 152 "flattenTemp" + Name 155 "@entryPointOutput.Color" + Name 159 "@entryPointOutput.Depth" + Name 164 "g_sSamp" + Name 167 "g_tTexcdf4" + Name 170 "g_tTexcdi4" + Name 173 "g_tTexcdu4" + Name 176 "g_tTex1df4a" + Name 179 "g_tTex1di4a" + Name 182 "g_tTex1du4a" + Name 185 "g_tTex2df4a" + Name 188 "g_tTex2di4a" + Name 191 "g_tTex2du4a" + Name 194 "g_tTexcdf4a" + Name 197 "g_tTexcdi4a" + Name 200 "g_tTexcdu4a" + Decorate 14(g_tTex1df4) DescriptorSet 0 + Decorate 14(g_tTex1df4) Binding 0 + MemberDecorate 20($Global) 0 Offset 0 + MemberDecorate 20($Global) 1 Offset 8 + MemberDecorate 20($Global) 2 Offset 16 + MemberDecorate 20($Global) 3 Offset 32 + MemberDecorate 20($Global) 4 Offset 48 + MemberDecorate 20($Global) 5 Offset 56 + MemberDecorate 20($Global) 6 Offset 64 + MemberDecorate 20($Global) 7 Offset 80 + Decorate 20($Global) Block + Decorate 22 DescriptorSet 0 + Decorate 38(g_tTex1di4) DescriptorSet 0 + Decorate 49(g_tTex1du4) DescriptorSet 0 + Decorate 61(g_tTex2df4) DescriptorSet 0 + Decorate 78(g_tTex2di4) DescriptorSet 0 + Decorate 90(g_tTex2du4) DescriptorSet 0 + Decorate 102(g_tTex3df4) DescriptorSet 0 + Decorate 118(g_tTex3di4) DescriptorSet 0 + Decorate 130(g_tTex3du4) DescriptorSet 0 + Decorate 155(@entryPointOutput.Color) Location 0 + Decorate 159(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 164(g_sSamp) DescriptorSet 0 + Decorate 164(g_sSamp) Binding 0 + Decorate 167(g_tTexcdf4) DescriptorSet 0 + Decorate 170(g_tTexcdi4) DescriptorSet 0 + Decorate 173(g_tTexcdu4) DescriptorSet 0 + Decorate 176(g_tTex1df4a) DescriptorSet 0 + Decorate 179(g_tTex1di4a) DescriptorSet 0 + Decorate 182(g_tTex1du4a) DescriptorSet 0 + Decorate 185(g_tTex2df4a) DescriptorSet 0 + Decorate 188(g_tTex2di4a) DescriptorSet 0 + Decorate 191(g_tTex2du4a) DescriptorSet 0 + Decorate 194(g_tTexcdf4a) DescriptorSet 0 + Decorate 197(g_tTexcdi4a) DescriptorSet 0 + Decorate 200(g_tTexcdu4a) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeImage 6(float) 1D sampled format:Unknown + 13: TypePointer UniformConstant 12 + 14(g_tTex1df4): 13(ptr) Variable UniformConstant + 16: TypeInt 32 1 + 17: TypeVector 16(int) 2 + 18: TypeVector 16(int) 3 + 19: TypeVector 16(int) 4 + 20($Global): TypeStruct 16(int) 17(ivec2) 18(ivec3) 19(ivec4) 16(int) 17(ivec2) 18(ivec3) 19(ivec4) + 21: TypePointer Uniform 20($Global) + 22: 21(ptr) Variable Uniform + 23: 16(int) Constant 1 + 24: TypeInt 32 0 + 25: 24(int) Constant 0 + 26: TypePointer Uniform 16(int) + 29: 24(int) Constant 1 + 32: 16(int) Constant 4 + 36: TypeImage 16(int) 1D sampled format:Unknown + 37: TypePointer UniformConstant 36 + 38(g_tTex1di4): 37(ptr) Variable UniformConstant + 47: TypeImage 24(int) 1D sampled format:Unknown + 48: TypePointer UniformConstant 47 + 49(g_tTex1du4): 48(ptr) Variable UniformConstant + 57: TypeVector 24(int) 4 + 59: TypeImage 6(float) 2D sampled format:Unknown + 60: TypePointer UniformConstant 59 + 61(g_tTex2df4): 60(ptr) Variable UniformConstant + 63: 16(int) Constant 2 + 64: TypePointer Uniform 18(ivec3) + 68: 24(int) Constant 2 + 71: 16(int) Constant 5 + 72: TypePointer Uniform 17(ivec2) + 76: TypeImage 16(int) 2D sampled format:Unknown + 77: TypePointer UniformConstant 76 + 78(g_tTex2di4): 77(ptr) Variable UniformConstant + 88: TypeImage 24(int) 2D sampled format:Unknown + 89: TypePointer UniformConstant 88 + 90(g_tTex2du4): 89(ptr) Variable UniformConstant + 100: TypeImage 6(float) 3D sampled format:Unknown + 101: TypePointer UniformConstant 100 + 102(g_tTex3df4): 101(ptr) Variable UniformConstant + 104: 16(int) Constant 3 + 105: TypePointer Uniform 19(ivec4) + 109: 24(int) Constant 3 + 112: 16(int) Constant 6 + 116: TypeImage 16(int) 3D sampled format:Unknown + 117: TypePointer UniformConstant 116 + 118(g_tTex3di4): 117(ptr) Variable UniformConstant + 128: TypeImage 24(int) 3D sampled format:Unknown + 129: TypePointer UniformConstant 128 + 130(g_tTex3du4): 129(ptr) Variable UniformConstant + 140: TypePointer Function 8(PS_OUTPUT) + 142: 16(int) Constant 0 + 143: 6(float) Constant 1065353216 + 144: 7(fvec4) ConstantComposite 143 143 143 143 + 145: TypePointer Function 7(fvec4) + 147: TypePointer Function 6(float) + 154: TypePointer Output 7(fvec4) +155(@entryPointOutput.Color): 154(ptr) Variable Output + 158: TypePointer Output 6(float) +159(@entryPointOutput.Depth): 158(ptr) Variable Output + 162: TypeSampler + 163: TypePointer UniformConstant 162 + 164(g_sSamp): 163(ptr) Variable UniformConstant + 165: TypeImage 6(float) Cube sampled format:Unknown + 166: TypePointer UniformConstant 165 + 167(g_tTexcdf4): 166(ptr) Variable UniformConstant + 168: TypeImage 16(int) Cube sampled format:Unknown + 169: TypePointer UniformConstant 168 + 170(g_tTexcdi4): 169(ptr) Variable UniformConstant + 171: TypeImage 24(int) Cube sampled format:Unknown + 172: TypePointer UniformConstant 171 + 173(g_tTexcdu4): 172(ptr) Variable UniformConstant + 174: TypeImage 6(float) 1D array sampled format:Unknown + 175: TypePointer UniformConstant 174 +176(g_tTex1df4a): 175(ptr) Variable UniformConstant + 177: TypeImage 16(int) 1D array sampled format:Unknown + 178: TypePointer UniformConstant 177 +179(g_tTex1di4a): 178(ptr) Variable UniformConstant + 180: TypeImage 24(int) 1D array sampled format:Unknown + 181: TypePointer UniformConstant 180 +182(g_tTex1du4a): 181(ptr) Variable UniformConstant + 183: TypeImage 6(float) 2D array sampled format:Unknown + 184: TypePointer UniformConstant 183 +185(g_tTex2df4a): 184(ptr) Variable UniformConstant + 186: TypeImage 16(int) 2D array sampled format:Unknown + 187: TypePointer UniformConstant 186 +188(g_tTex2di4a): 187(ptr) Variable UniformConstant + 189: TypeImage 24(int) 2D array sampled format:Unknown + 190: TypePointer UniformConstant 189 +191(g_tTex2du4a): 190(ptr) Variable UniformConstant + 192: TypeImage 6(float) Cube array sampled format:Unknown + 193: TypePointer UniformConstant 192 +194(g_tTexcdf4a): 193(ptr) Variable UniformConstant + 195: TypeImage 16(int) Cube array sampled format:Unknown + 196: TypePointer UniformConstant 195 +197(g_tTexcdi4a): 196(ptr) Variable UniformConstant + 198: TypeImage 24(int) Cube array sampled format:Unknown + 199: TypePointer UniformConstant 198 +200(g_tTexcdu4a): 199(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +152(flattenTemp): 140(ptr) Variable Function + 153:8(PS_OUTPUT) FunctionCall 10(@main() + Store 152(flattenTemp) 153 + 156: 145(ptr) AccessChain 152(flattenTemp) 142 + 157: 7(fvec4) Load 156 + Store 155(@entryPointOutput.Color) 157 + 160: 147(ptr) AccessChain 152(flattenTemp) 23 + 161: 6(float) Load 160 + Store 159(@entryPointOutput.Depth) 161 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 141(psout): 140(ptr) Variable Function + 15: 12 Load 14(g_tTex1df4) + 27: 26(ptr) AccessChain 22 23 25 + 28: 16(int) Load 27 + 30: 26(ptr) AccessChain 22 23 29 + 31: 16(int) Load 30 + 33: 26(ptr) AccessChain 22 32 + 34: 16(int) Load 33 + 35: 7(fvec4) ImageFetch 15 28 Lod Offset 31 34 + 39: 36 Load 38(g_tTex1di4) + 40: 26(ptr) AccessChain 22 23 25 + 41: 16(int) Load 40 + 42: 26(ptr) AccessChain 22 23 29 + 43: 16(int) Load 42 + 44: 26(ptr) AccessChain 22 32 + 45: 16(int) Load 44 + 46: 19(ivec4) ImageFetch 39 41 Lod Offset 43 45 + 50: 47 Load 49(g_tTex1du4) + 51: 26(ptr) AccessChain 22 23 25 + 52: 16(int) Load 51 + 53: 26(ptr) AccessChain 22 23 29 + 54: 16(int) Load 53 + 55: 26(ptr) AccessChain 22 32 + 56: 16(int) Load 55 + 58: 57(ivec4) ImageFetch 50 52 Lod Offset 54 56 + 62: 59 Load 61(g_tTex2df4) + 65: 64(ptr) AccessChain 22 63 + 66: 18(ivec3) Load 65 + 67: 17(ivec2) VectorShuffle 66 66 0 1 + 69: 26(ptr) AccessChain 22 63 68 + 70: 16(int) Load 69 + 73: 72(ptr) AccessChain 22 71 + 74: 17(ivec2) Load 73 + 75: 7(fvec4) ImageFetch 62 67 Lod Offset 70 74 + 79: 76 Load 78(g_tTex2di4) + 80: 64(ptr) AccessChain 22 63 + 81: 18(ivec3) Load 80 + 82: 17(ivec2) VectorShuffle 81 81 0 1 + 83: 26(ptr) AccessChain 22 63 68 + 84: 16(int) Load 83 + 85: 72(ptr) AccessChain 22 71 + 86: 17(ivec2) Load 85 + 87: 19(ivec4) ImageFetch 79 82 Lod Offset 84 86 + 91: 88 Load 90(g_tTex2du4) + 92: 64(ptr) AccessChain 22 63 + 93: 18(ivec3) Load 92 + 94: 17(ivec2) VectorShuffle 93 93 0 1 + 95: 26(ptr) AccessChain 22 63 68 + 96: 16(int) Load 95 + 97: 72(ptr) AccessChain 22 71 + 98: 17(ivec2) Load 97 + 99: 57(ivec4) ImageFetch 91 94 Lod Offset 96 98 + 103: 100 Load 102(g_tTex3df4) + 106: 105(ptr) AccessChain 22 104 + 107: 19(ivec4) Load 106 + 108: 18(ivec3) VectorShuffle 107 107 0 1 2 + 110: 26(ptr) AccessChain 22 104 109 + 111: 16(int) Load 110 + 113: 64(ptr) AccessChain 22 112 + 114: 18(ivec3) Load 113 + 115: 7(fvec4) ImageFetch 103 108 Lod Offset 111 114 + 119: 116 Load 118(g_tTex3di4) + 120: 105(ptr) AccessChain 22 104 + 121: 19(ivec4) Load 120 + 122: 18(ivec3) VectorShuffle 121 121 0 1 2 + 123: 26(ptr) AccessChain 22 104 109 + 124: 16(int) Load 123 + 125: 64(ptr) AccessChain 22 112 + 126: 18(ivec3) Load 125 + 127: 19(ivec4) ImageFetch 119 122 Lod Offset 124 126 + 131: 128 Load 130(g_tTex3du4) + 132: 105(ptr) AccessChain 22 104 + 133: 19(ivec4) Load 132 + 134: 18(ivec3) VectorShuffle 133 133 0 1 2 + 135: 26(ptr) AccessChain 22 104 109 + 136: 16(int) Load 135 + 137: 64(ptr) AccessChain 22 112 + 138: 18(ivec3) Load 137 + 139: 57(ivec4) ImageFetch 131 134 Lod Offset 136 138 + 146: 145(ptr) AccessChain 141(psout) 142 + Store 146 144 + 148: 147(ptr) AccessChain 141(psout) 23 + Store 148 143 + 149:8(PS_OUTPUT) Load 141(psout) + ReturnValue 149 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out new file mode 100644 index 00000000..b472462a --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out @@ -0,0 +1,707 @@ +hlsl.load.offsetarray.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:48 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Parameters: +0:? Sequence +0:52 textureFetchOffset ( temp 4-component vector of float) +0:52 'g_tTex1df4a' ( uniform texture1DArray) +0:52 vector swizzle ( temp 2-component vector of int) +0:52 c3: direct index for structure ( uniform 3-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 2 (const uint) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 direct index ( temp int) +0:52 c3: direct index for structure ( uniform 3-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 2 (const uint) +0:52 Constant: +0:52 2 (const int) +0:52 o1: direct index for structure ( uniform int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 4 (const uint) +0:53 textureFetchOffset ( temp 4-component vector of int) +0:53 'g_tTex1di4a' ( uniform itexture1DArray) +0:53 vector swizzle ( temp 2-component vector of int) +0:53 c3: direct index for structure ( uniform 3-component vector of int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 2 (const uint) +0:53 Sequence +0:53 Constant: +0:53 0 (const int) +0:53 Constant: +0:53 1 (const int) +0:53 direct index ( temp int) +0:53 c3: direct index for structure ( uniform 3-component vector of int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 2 (const uint) +0:53 Constant: +0:53 2 (const int) +0:53 o1: direct index for structure ( uniform int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 4 (const uint) +0:54 textureFetchOffset ( temp 4-component vector of uint) +0:54 'g_tTex1du4a' ( uniform utexture1DArray) +0:54 vector swizzle ( temp 2-component vector of int) +0:54 c3: direct index for structure ( uniform 3-component vector of int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 2 (const uint) +0:54 Sequence +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 1 (const int) +0:54 direct index ( temp int) +0:54 c3: direct index for structure ( uniform 3-component vector of int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 2 (const uint) +0:54 Constant: +0:54 2 (const int) +0:54 o1: direct index for structure ( uniform int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 4 (const uint) +0:57 textureFetchOffset ( temp 4-component vector of float) +0:57 'g_tTex2df4a' ( uniform texture2DArray) +0:57 vector swizzle ( temp 3-component vector of int) +0:57 c4: direct index for structure ( uniform 4-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 3 (const uint) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 2 (const int) +0:57 direct index ( temp int) +0:57 c4: direct index for structure ( uniform 4-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 3 (const uint) +0:57 Constant: +0:57 3 (const int) +0:57 o2: direct index for structure ( uniform 2-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 5 (const uint) +0:58 textureFetchOffset ( temp 4-component vector of int) +0:58 'g_tTex2di4a' ( uniform itexture2DArray) +0:58 vector swizzle ( temp 3-component vector of int) +0:58 c4: direct index for structure ( uniform 4-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 3 (const uint) +0:58 Sequence +0:58 Constant: +0:58 0 (const int) +0:58 Constant: +0:58 1 (const int) +0:58 Constant: +0:58 2 (const int) +0:58 direct index ( temp int) +0:58 c4: direct index for structure ( uniform 4-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 3 (const uint) +0:58 Constant: +0:58 3 (const int) +0:58 o2: direct index for structure ( uniform 2-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 5 (const uint) +0:59 textureFetchOffset ( temp 4-component vector of uint) +0:59 'g_tTex2du4a' ( uniform utexture2DArray) +0:59 vector swizzle ( temp 3-component vector of int) +0:59 c4: direct index for structure ( uniform 4-component vector of int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:59 Constant: +0:59 3 (const uint) +0:59 Sequence +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:59 Constant: +0:59 2 (const int) +0:59 direct index ( temp int) +0:59 c4: direct index for structure ( uniform 4-component vector of int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:59 Constant: +0:59 3 (const uint) +0:59 Constant: +0:59 3 (const int) +0:59 o2: direct index for structure ( uniform 2-component vector of int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:59 Constant: +0:59 5 (const uint) +0:65 move second child to first child ( temp 4-component vector of float) +0:65 Color: direct index for structure ( temp 4-component vector of float) +0:65 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 1.000000 +0:65 1.000000 +0:65 1.000000 +0:65 1.000000 +0:66 move second child to first child ( temp float) +0:66 Depth: direct index for structure ( temp float) +0:66 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:66 Constant: +0:66 1 (const int) +0:66 Constant: +0:66 1.000000 +0:68 Branch: Return with expression +0:68 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Definition: main( ( temp void) +0:48 Function Parameters: +0:? Sequence +0:48 Sequence +0:48 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:48 Color: direct index for structure ( temp 4-component vector of float) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 0 (const int) +0:48 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:48 Depth: direct index for structure ( temp float) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:48 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Parameters: +0:? Sequence +0:52 textureFetchOffset ( temp 4-component vector of float) +0:52 'g_tTex1df4a' ( uniform texture1DArray) +0:52 vector swizzle ( temp 2-component vector of int) +0:52 c3: direct index for structure ( uniform 3-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 2 (const uint) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 direct index ( temp int) +0:52 c3: direct index for structure ( uniform 3-component vector of int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 2 (const uint) +0:52 Constant: +0:52 2 (const int) +0:52 o1: direct index for structure ( uniform int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 4 (const uint) +0:53 textureFetchOffset ( temp 4-component vector of int) +0:53 'g_tTex1di4a' ( uniform itexture1DArray) +0:53 vector swizzle ( temp 2-component vector of int) +0:53 c3: direct index for structure ( uniform 3-component vector of int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 2 (const uint) +0:53 Sequence +0:53 Constant: +0:53 0 (const int) +0:53 Constant: +0:53 1 (const int) +0:53 direct index ( temp int) +0:53 c3: direct index for structure ( uniform 3-component vector of int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 2 (const uint) +0:53 Constant: +0:53 2 (const int) +0:53 o1: direct index for structure ( uniform int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 4 (const uint) +0:54 textureFetchOffset ( temp 4-component vector of uint) +0:54 'g_tTex1du4a' ( uniform utexture1DArray) +0:54 vector swizzle ( temp 2-component vector of int) +0:54 c3: direct index for structure ( uniform 3-component vector of int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 2 (const uint) +0:54 Sequence +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 1 (const int) +0:54 direct index ( temp int) +0:54 c3: direct index for structure ( uniform 3-component vector of int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 2 (const uint) +0:54 Constant: +0:54 2 (const int) +0:54 o1: direct index for structure ( uniform int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 4 (const uint) +0:57 textureFetchOffset ( temp 4-component vector of float) +0:57 'g_tTex2df4a' ( uniform texture2DArray) +0:57 vector swizzle ( temp 3-component vector of int) +0:57 c4: direct index for structure ( uniform 4-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 3 (const uint) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 2 (const int) +0:57 direct index ( temp int) +0:57 c4: direct index for structure ( uniform 4-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 3 (const uint) +0:57 Constant: +0:57 3 (const int) +0:57 o2: direct index for structure ( uniform 2-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 5 (const uint) +0:58 textureFetchOffset ( temp 4-component vector of int) +0:58 'g_tTex2di4a' ( uniform itexture2DArray) +0:58 vector swizzle ( temp 3-component vector of int) +0:58 c4: direct index for structure ( uniform 4-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 3 (const uint) +0:58 Sequence +0:58 Constant: +0:58 0 (const int) +0:58 Constant: +0:58 1 (const int) +0:58 Constant: +0:58 2 (const int) +0:58 direct index ( temp int) +0:58 c4: direct index for structure ( uniform 4-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 3 (const uint) +0:58 Constant: +0:58 3 (const int) +0:58 o2: direct index for structure ( uniform 2-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 5 (const uint) +0:59 textureFetchOffset ( temp 4-component vector of uint) +0:59 'g_tTex2du4a' ( uniform utexture2DArray) +0:59 vector swizzle ( temp 3-component vector of int) +0:59 c4: direct index for structure ( uniform 4-component vector of int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:59 Constant: +0:59 3 (const uint) +0:59 Sequence +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:59 Constant: +0:59 2 (const int) +0:59 direct index ( temp int) +0:59 c4: direct index for structure ( uniform 4-component vector of int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:59 Constant: +0:59 3 (const uint) +0:59 Constant: +0:59 3 (const int) +0:59 o2: direct index for structure ( uniform 2-component vector of int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:59 Constant: +0:59 5 (const uint) +0:65 move second child to first child ( temp 4-component vector of float) +0:65 Color: direct index for structure ( temp 4-component vector of float) +0:65 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 1.000000 +0:65 1.000000 +0:65 1.000000 +0:65 1.000000 +0:66 move second child to first child ( temp float) +0:66 Depth: direct index for structure ( temp float) +0:66 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:66 Constant: +0:66 1 (const int) +0:66 Constant: +0:66 1.000000 +0:68 Branch: Return with expression +0:68 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Definition: main( ( temp void) +0:48 Function Parameters: +0:? Sequence +0:48 Sequence +0:48 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:48 Color: direct index for structure ( temp 4-component vector of float) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 0 (const int) +0:48 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:48 Depth: direct index for structure ( temp float) +0:48 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 174 + + Capability Shader + Capability ImageGatherExtended + Capability Sampled1D + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 119 123 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 14 "g_tTex1df4a" + Name 20 "$Global" + MemberName 20($Global) 0 "c1" + MemberName 20($Global) 1 "c2" + MemberName 20($Global) 2 "c3" + MemberName 20($Global) 3 "c4" + MemberName 20($Global) 4 "o1" + MemberName 20($Global) 5 "o2" + MemberName 20($Global) 6 "o3" + MemberName 20($Global) 7 "o4" + Name 22 "" + Name 39 "g_tTex1di4a" + Name 51 "g_tTex1du4a" + Name 64 "g_tTex2df4a" + Name 81 "g_tTex2di4a" + Name 93 "g_tTex2du4a" + Name 104 "psout" + Name 116 "flattenTemp" + Name 119 "@entryPointOutput.Color" + Name 123 "@entryPointOutput.Depth" + Name 128 "g_sSamp" + Name 131 "g_tTex1df4" + Name 134 "g_tTex1di4" + Name 137 "g_tTex1du4" + Name 140 "g_tTex2df4" + Name 143 "g_tTex2di4" + Name 146 "g_tTex2du4" + Name 149 "g_tTex3df4" + Name 152 "g_tTex3di4" + Name 155 "g_tTex3du4" + Name 158 "g_tTexcdf4" + Name 161 "g_tTexcdi4" + Name 164 "g_tTexcdu4" + Name 167 "g_tTexcdf4a" + Name 170 "g_tTexcdi4a" + Name 173 "g_tTexcdu4a" + Decorate 14(g_tTex1df4a) DescriptorSet 0 + MemberDecorate 20($Global) 0 Offset 0 + MemberDecorate 20($Global) 1 Offset 8 + MemberDecorate 20($Global) 2 Offset 16 + MemberDecorate 20($Global) 3 Offset 32 + MemberDecorate 20($Global) 4 Offset 48 + MemberDecorate 20($Global) 5 Offset 56 + MemberDecorate 20($Global) 6 Offset 64 + MemberDecorate 20($Global) 7 Offset 80 + Decorate 20($Global) Block + Decorate 22 DescriptorSet 0 + Decorate 39(g_tTex1di4a) DescriptorSet 0 + Decorate 51(g_tTex1du4a) DescriptorSet 0 + Decorate 64(g_tTex2df4a) DescriptorSet 0 + Decorate 81(g_tTex2di4a) DescriptorSet 0 + Decorate 93(g_tTex2du4a) DescriptorSet 0 + Decorate 119(@entryPointOutput.Color) Location 0 + Decorate 123(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 128(g_sSamp) DescriptorSet 0 + Decorate 128(g_sSamp) Binding 0 + Decorate 131(g_tTex1df4) DescriptorSet 0 + Decorate 131(g_tTex1df4) Binding 0 + Decorate 134(g_tTex1di4) DescriptorSet 0 + Decorate 137(g_tTex1du4) DescriptorSet 0 + Decorate 140(g_tTex2df4) DescriptorSet 0 + Decorate 143(g_tTex2di4) DescriptorSet 0 + Decorate 146(g_tTex2du4) DescriptorSet 0 + Decorate 149(g_tTex3df4) DescriptorSet 0 + Decorate 152(g_tTex3di4) DescriptorSet 0 + Decorate 155(g_tTex3du4) DescriptorSet 0 + Decorate 158(g_tTexcdf4) DescriptorSet 0 + Decorate 161(g_tTexcdi4) DescriptorSet 0 + Decorate 164(g_tTexcdu4) DescriptorSet 0 + Decorate 167(g_tTexcdf4a) DescriptorSet 0 + Decorate 170(g_tTexcdi4a) DescriptorSet 0 + Decorate 173(g_tTexcdu4a) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeImage 6(float) 1D array sampled format:Unknown + 13: TypePointer UniformConstant 12 + 14(g_tTex1df4a): 13(ptr) Variable UniformConstant + 16: TypeInt 32 1 + 17: TypeVector 16(int) 2 + 18: TypeVector 16(int) 3 + 19: TypeVector 16(int) 4 + 20($Global): TypeStruct 16(int) 17(ivec2) 18(ivec3) 19(ivec4) 16(int) 17(ivec2) 18(ivec3) 19(ivec4) + 21: TypePointer Uniform 20($Global) + 22: 21(ptr) Variable Uniform + 23: 16(int) Constant 2 + 24: TypePointer Uniform 18(ivec3) + 28: TypeInt 32 0 + 29: 28(int) Constant 2 + 30: TypePointer Uniform 16(int) + 33: 16(int) Constant 4 + 37: TypeImage 16(int) 1D array sampled format:Unknown + 38: TypePointer UniformConstant 37 + 39(g_tTex1di4a): 38(ptr) Variable UniformConstant + 49: TypeImage 28(int) 1D array sampled format:Unknown + 50: TypePointer UniformConstant 49 + 51(g_tTex1du4a): 50(ptr) Variable UniformConstant + 60: TypeVector 28(int) 4 + 62: TypeImage 6(float) 2D array sampled format:Unknown + 63: TypePointer UniformConstant 62 + 64(g_tTex2df4a): 63(ptr) Variable UniformConstant + 66: 16(int) Constant 3 + 67: TypePointer Uniform 19(ivec4) + 71: 28(int) Constant 3 + 74: 16(int) Constant 5 + 75: TypePointer Uniform 17(ivec2) + 79: TypeImage 16(int) 2D array sampled format:Unknown + 80: TypePointer UniformConstant 79 + 81(g_tTex2di4a): 80(ptr) Variable UniformConstant + 91: TypeImage 28(int) 2D array sampled format:Unknown + 92: TypePointer UniformConstant 91 + 93(g_tTex2du4a): 92(ptr) Variable UniformConstant + 103: TypePointer Function 8(PS_OUTPUT) + 105: 16(int) Constant 0 + 106: 6(float) Constant 1065353216 + 107: 7(fvec4) ConstantComposite 106 106 106 106 + 108: TypePointer Function 7(fvec4) + 110: 16(int) Constant 1 + 111: TypePointer Function 6(float) + 118: TypePointer Output 7(fvec4) +119(@entryPointOutput.Color): 118(ptr) Variable Output + 122: TypePointer Output 6(float) +123(@entryPointOutput.Depth): 122(ptr) Variable Output + 126: TypeSampler + 127: TypePointer UniformConstant 126 + 128(g_sSamp): 127(ptr) Variable UniformConstant + 129: TypeImage 6(float) 1D sampled format:Unknown + 130: TypePointer UniformConstant 129 + 131(g_tTex1df4): 130(ptr) Variable UniformConstant + 132: TypeImage 16(int) 1D sampled format:Unknown + 133: TypePointer UniformConstant 132 + 134(g_tTex1di4): 133(ptr) Variable UniformConstant + 135: TypeImage 28(int) 1D sampled format:Unknown + 136: TypePointer UniformConstant 135 + 137(g_tTex1du4): 136(ptr) Variable UniformConstant + 138: TypeImage 6(float) 2D sampled format:Unknown + 139: TypePointer UniformConstant 138 + 140(g_tTex2df4): 139(ptr) Variable UniformConstant + 141: TypeImage 16(int) 2D sampled format:Unknown + 142: TypePointer UniformConstant 141 + 143(g_tTex2di4): 142(ptr) Variable UniformConstant + 144: TypeImage 28(int) 2D sampled format:Unknown + 145: TypePointer UniformConstant 144 + 146(g_tTex2du4): 145(ptr) Variable UniformConstant + 147: TypeImage 6(float) 3D sampled format:Unknown + 148: TypePointer UniformConstant 147 + 149(g_tTex3df4): 148(ptr) Variable UniformConstant + 150: TypeImage 16(int) 3D sampled format:Unknown + 151: TypePointer UniformConstant 150 + 152(g_tTex3di4): 151(ptr) Variable UniformConstant + 153: TypeImage 28(int) 3D sampled format:Unknown + 154: TypePointer UniformConstant 153 + 155(g_tTex3du4): 154(ptr) Variable UniformConstant + 156: TypeImage 6(float) Cube sampled format:Unknown + 157: TypePointer UniformConstant 156 + 158(g_tTexcdf4): 157(ptr) Variable UniformConstant + 159: TypeImage 16(int) Cube sampled format:Unknown + 160: TypePointer UniformConstant 159 + 161(g_tTexcdi4): 160(ptr) Variable UniformConstant + 162: TypeImage 28(int) Cube sampled format:Unknown + 163: TypePointer UniformConstant 162 + 164(g_tTexcdu4): 163(ptr) Variable UniformConstant + 165: TypeImage 6(float) Cube array sampled format:Unknown + 166: TypePointer UniformConstant 165 +167(g_tTexcdf4a): 166(ptr) Variable UniformConstant + 168: TypeImage 16(int) Cube array sampled format:Unknown + 169: TypePointer UniformConstant 168 +170(g_tTexcdi4a): 169(ptr) Variable UniformConstant + 171: TypeImage 28(int) Cube array sampled format:Unknown + 172: TypePointer UniformConstant 171 +173(g_tTexcdu4a): 172(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +116(flattenTemp): 103(ptr) Variable Function + 117:8(PS_OUTPUT) FunctionCall 10(@main() + Store 116(flattenTemp) 117 + 120: 108(ptr) AccessChain 116(flattenTemp) 105 + 121: 7(fvec4) Load 120 + Store 119(@entryPointOutput.Color) 121 + 124: 111(ptr) AccessChain 116(flattenTemp) 110 + 125: 6(float) Load 124 + Store 123(@entryPointOutput.Depth) 125 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 104(psout): 103(ptr) Variable Function + 15: 12 Load 14(g_tTex1df4a) + 25: 24(ptr) AccessChain 22 23 + 26: 18(ivec3) Load 25 + 27: 17(ivec2) VectorShuffle 26 26 0 1 + 31: 30(ptr) AccessChain 22 23 29 + 32: 16(int) Load 31 + 34: 30(ptr) AccessChain 22 33 + 35: 16(int) Load 34 + 36: 7(fvec4) ImageFetch 15 27 Lod Offset 32 35 + 40: 37 Load 39(g_tTex1di4a) + 41: 24(ptr) AccessChain 22 23 + 42: 18(ivec3) Load 41 + 43: 17(ivec2) VectorShuffle 42 42 0 1 + 44: 30(ptr) AccessChain 22 23 29 + 45: 16(int) Load 44 + 46: 30(ptr) AccessChain 22 33 + 47: 16(int) Load 46 + 48: 19(ivec4) ImageFetch 40 43 Lod Offset 45 47 + 52: 49 Load 51(g_tTex1du4a) + 53: 24(ptr) AccessChain 22 23 + 54: 18(ivec3) Load 53 + 55: 17(ivec2) VectorShuffle 54 54 0 1 + 56: 30(ptr) AccessChain 22 23 29 + 57: 16(int) Load 56 + 58: 30(ptr) AccessChain 22 33 + 59: 16(int) Load 58 + 61: 60(ivec4) ImageFetch 52 55 Lod Offset 57 59 + 65: 62 Load 64(g_tTex2df4a) + 68: 67(ptr) AccessChain 22 66 + 69: 19(ivec4) Load 68 + 70: 18(ivec3) VectorShuffle 69 69 0 1 2 + 72: 30(ptr) AccessChain 22 66 71 + 73: 16(int) Load 72 + 76: 75(ptr) AccessChain 22 74 + 77: 17(ivec2) Load 76 + 78: 7(fvec4) ImageFetch 65 70 Lod Offset 73 77 + 82: 79 Load 81(g_tTex2di4a) + 83: 67(ptr) AccessChain 22 66 + 84: 19(ivec4) Load 83 + 85: 18(ivec3) VectorShuffle 84 84 0 1 2 + 86: 30(ptr) AccessChain 22 66 71 + 87: 16(int) Load 86 + 88: 75(ptr) AccessChain 22 74 + 89: 17(ivec2) Load 88 + 90: 19(ivec4) ImageFetch 82 85 Lod Offset 87 89 + 94: 91 Load 93(g_tTex2du4a) + 95: 67(ptr) AccessChain 22 66 + 96: 19(ivec4) Load 95 + 97: 18(ivec3) VectorShuffle 96 96 0 1 2 + 98: 30(ptr) AccessChain 22 66 71 + 99: 16(int) Load 98 + 100: 75(ptr) AccessChain 22 74 + 101: 17(ivec2) Load 100 + 102: 60(ivec4) ImageFetch 94 97 Lod Offset 99 101 + 109: 108(ptr) AccessChain 104(psout) 105 + Store 109 107 + 112: 111(ptr) AccessChain 104(psout) 110 + Store 112 106 + 113:8(PS_OUTPUT) Load 104(psout) + ReturnValue 113 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out new file mode 100644 index 00000000..f1349012 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out @@ -0,0 +1,214 @@ +hlsl.load.rwbuffer.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:22 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:22 Function Parameters: +0:? Sequence +0:25 imageLoad ( temp 4-component vector of float) +0:25 'g_tBuffF' (layout( rgba32f) uniform imageBuffer) +0:25 c1: direct index for structure ( uniform int) +0:25 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:25 Constant: +0:25 0 (const uint) +0:26 imageLoad ( temp 4-component vector of uint) +0:26 'g_tBuffU' (layout( rgba32ui) uniform uimageBuffer) +0:26 c1: direct index for structure ( uniform int) +0:26 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:26 Constant: +0:26 0 (const uint) +0:27 imageLoad ( temp 4-component vector of int) +0:27 'g_tBuffI' (layout( rgba32i) uniform iimageBuffer) +0:27 c1: direct index for structure ( uniform int) +0:27 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:27 Constant: +0:27 0 (const uint) +0:29 move second child to first child ( temp 4-component vector of float) +0:29 Color: direct index for structure ( temp 4-component vector of float) +0:29 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 1.000000 +0:29 1.000000 +0:29 1.000000 +0:29 1.000000 +0:31 Branch: Return with expression +0:31 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:22 Function Definition: main( ( temp void) +0:22 Function Parameters: +0:? Sequence +0:22 Sequence +0:22 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:22 Color: direct index for structure ( temp 4-component vector of float) +0:22 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:22 Constant: +0:22 0 (const int) +0:? Linker Objects +0:? 'g_tBuffF' (layout( rgba32f) uniform imageBuffer) +0:? 'g_tBuffI' (layout( rgba32i) uniform iimageBuffer) +0:? 'g_tBuffU' (layout( rgba32ui) uniform uimageBuffer) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:22 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:22 Function Parameters: +0:? Sequence +0:25 imageLoad ( temp 4-component vector of float) +0:25 'g_tBuffF' (layout( rgba32f) uniform imageBuffer) +0:25 c1: direct index for structure ( uniform int) +0:25 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:25 Constant: +0:25 0 (const uint) +0:26 imageLoad ( temp 4-component vector of uint) +0:26 'g_tBuffU' (layout( rgba32ui) uniform uimageBuffer) +0:26 c1: direct index for structure ( uniform int) +0:26 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:26 Constant: +0:26 0 (const uint) +0:27 imageLoad ( temp 4-component vector of int) +0:27 'g_tBuffI' (layout( rgba32i) uniform iimageBuffer) +0:27 c1: direct index for structure ( uniform int) +0:27 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:27 Constant: +0:27 0 (const uint) +0:29 move second child to first child ( temp 4-component vector of float) +0:29 Color: direct index for structure ( temp 4-component vector of float) +0:29 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 1.000000 +0:29 1.000000 +0:29 1.000000 +0:29 1.000000 +0:31 Branch: Return with expression +0:31 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:22 Function Definition: main( ( temp void) +0:22 Function Parameters: +0:? Sequence +0:22 Sequence +0:22 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:22 Color: direct index for structure ( temp 4-component vector of float) +0:22 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:22 Constant: +0:22 0 (const int) +0:? Linker Objects +0:? 'g_tBuffF' (layout( rgba32f) uniform imageBuffer) +0:? 'g_tBuffI' (layout( rgba32i) uniform iimageBuffer) +0:? 'g_tBuffU' (layout( rgba32ui) uniform uimageBuffer) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 57 + + Capability Shader + Capability ImageBuffer + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 54 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + Name 10 "@main(" + Name 14 "g_tBuffF" + Name 20 "$Global" + MemberName 20($Global) 0 "c1" + MemberName 20($Global) 1 "c2" + MemberName 20($Global) 2 "c3" + MemberName 20($Global) 3 "c4" + MemberName 20($Global) 4 "o1" + MemberName 20($Global) 5 "o2" + MemberName 20($Global) 6 "o3" + MemberName 20($Global) 7 "o4" + Name 22 "" + Name 31 "g_tBuffU" + Name 39 "g_tBuffI" + Name 45 "psout" + Name 54 "@entryPointOutput.Color" + Decorate 14(g_tBuffF) DescriptorSet 0 + MemberDecorate 20($Global) 0 Offset 0 + MemberDecorate 20($Global) 1 Offset 8 + MemberDecorate 20($Global) 2 Offset 16 + MemberDecorate 20($Global) 3 Offset 32 + MemberDecorate 20($Global) 4 Offset 48 + MemberDecorate 20($Global) 5 Offset 56 + MemberDecorate 20($Global) 6 Offset 64 + MemberDecorate 20($Global) 7 Offset 80 + Decorate 20($Global) Block + Decorate 22 DescriptorSet 0 + Decorate 31(g_tBuffU) DescriptorSet 0 + Decorate 39(g_tBuffI) DescriptorSet 0 + Decorate 54(@entryPointOutput.Color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeImage 6(float) Buffer nonsampled format:Rgba32f + 13: TypePointer UniformConstant 12 + 14(g_tBuffF): 13(ptr) Variable UniformConstant + 16: TypeInt 32 1 + 17: TypeVector 16(int) 2 + 18: TypeVector 16(int) 3 + 19: TypeVector 16(int) 4 + 20($Global): TypeStruct 16(int) 17(ivec2) 18(ivec3) 19(ivec4) 16(int) 17(ivec2) 18(ivec3) 19(ivec4) + 21: TypePointer Uniform 20($Global) + 22: 21(ptr) Variable Uniform + 23: 16(int) Constant 0 + 24: TypePointer Uniform 16(int) + 28: TypeInt 32 0 + 29: TypeImage 28(int) Buffer nonsampled format:Rgba32ui + 30: TypePointer UniformConstant 29 + 31(g_tBuffU): 30(ptr) Variable UniformConstant + 35: TypeVector 28(int) 4 + 37: TypeImage 16(int) Buffer nonsampled format:Rgba32i + 38: TypePointer UniformConstant 37 + 39(g_tBuffI): 38(ptr) Variable UniformConstant + 44: TypePointer Function 8(PS_OUTPUT) + 46: 6(float) Constant 1065353216 + 47: 7(fvec4) ConstantComposite 46 46 46 46 + 48: TypePointer Function 7(fvec4) + 53: TypePointer Output 7(fvec4) +54(@entryPointOutput.Color): 53(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 55:8(PS_OUTPUT) FunctionCall 10(@main() + 56: 7(fvec4) CompositeExtract 55 0 + Store 54(@entryPointOutput.Color) 56 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 45(psout): 44(ptr) Variable Function + 15: 12 Load 14(g_tBuffF) + 25: 24(ptr) AccessChain 22 23 + 26: 16(int) Load 25 + 27: 7(fvec4) ImageRead 15 26 + 32: 29 Load 31(g_tBuffU) + 33: 24(ptr) AccessChain 22 23 + 34: 16(int) Load 33 + 36: 35(ivec4) ImageRead 32 34 + 40: 37 Load 39(g_tBuffI) + 41: 24(ptr) AccessChain 22 23 + 42: 16(int) Load 41 + 43: 19(ivec4) ImageRead 40 42 + 49: 48(ptr) AccessChain 45(psout) 23 + Store 49 47 + 50:8(PS_OUTPUT) Load 45(psout) + ReturnValue 50 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out new file mode 100644 index 00000000..de31ee02 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out @@ -0,0 +1,410 @@ +hlsl.load.rwtexture.array.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:40 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Function Parameters: +0:? Sequence +0:44 imageLoad ( temp 4-component vector of float) +0:44 'g_tTex1df4a' (layout( rgba32f) uniform image1DArray) +0:44 c2: direct index for structure ( uniform 2-component vector of int) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:44 Constant: +0:44 1 (const uint) +0:45 imageLoad ( temp 4-component vector of int) +0:45 'g_tTex1di4a' (layout( rgba32i) uniform iimage1DArray) +0:45 c2: direct index for structure ( uniform 2-component vector of int) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:45 Constant: +0:45 1 (const uint) +0:46 imageLoad ( temp 4-component vector of uint) +0:46 'g_tTex1du4a' (layout( rgba32ui) uniform uimage1DArray) +0:46 c2: direct index for structure ( uniform 2-component vector of int) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:46 Constant: +0:46 1 (const uint) +0:49 imageLoad ( temp 4-component vector of float) +0:49 'g_tTex2df4a' (layout( rgba32f) uniform image2DArray) +0:49 c3: direct index for structure ( uniform 3-component vector of int) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:49 Constant: +0:49 2 (const uint) +0:50 imageLoad ( temp 4-component vector of int) +0:50 'g_tTex2di4a' (layout( rgba32i) uniform iimage2DArray) +0:50 c3: direct index for structure ( uniform 3-component vector of int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:50 Constant: +0:50 2 (const uint) +0:51 imageLoad ( temp 4-component vector of uint) +0:51 'g_tTex2du4a' (layout( rgba32ui) uniform uimage2DArray) +0:51 c3: direct index for structure ( uniform 3-component vector of int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:51 Constant: +0:51 2 (const uint) +0:53 move second child to first child ( temp 4-component vector of float) +0:53 Color: direct index for structure ( temp 4-component vector of float) +0:53 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:53 Constant: +0:53 0 (const int) +0:53 Constant: +0:53 1.000000 +0:53 1.000000 +0:53 1.000000 +0:53 1.000000 +0:54 move second child to first child ( temp float) +0:54 Depth: direct index for structure ( temp float) +0:54 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:54 Constant: +0:54 1 (const int) +0:54 Constant: +0:54 1.000000 +0:56 Branch: Return with expression +0:56 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Function Definition: main( ( temp void) +0:40 Function Parameters: +0:? Sequence +0:40 Sequence +0:40 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:40 Color: direct index for structure ( temp 4-component vector of float) +0:40 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 0 (const int) +0:40 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:40 Depth: direct index for structure ( temp float) +0:40 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:? 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:? 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:? 'g_tTex2df4' (layout( rgba32f) uniform image2D) +0:? 'g_tTex2di4' (layout( rgba32i) uniform iimage2D) +0:? 'g_tTex2du4' (layout( rgba32ui) uniform uimage2D) +0:? 'g_tTex3df4' (layout( rgba32f) uniform image3D) +0:? 'g_tTex3di4' (layout( rgba32i) uniform iimage3D) +0:? 'g_tTex3du4' (layout( rgba32ui) uniform uimage3D) +0:? 'g_tTex1df4a' (layout( rgba32f) uniform image1DArray) +0:? 'g_tTex1di4a' (layout( rgba32i) uniform iimage1DArray) +0:? 'g_tTex1du4a' (layout( rgba32ui) uniform uimage1DArray) +0:? 'g_tTex2df4a' (layout( rgba32f) uniform image2DArray) +0:? 'g_tTex2di4a' (layout( rgba32i) uniform iimage2DArray) +0:? 'g_tTex2du4a' (layout( rgba32ui) uniform uimage2DArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:40 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Function Parameters: +0:? Sequence +0:44 imageLoad ( temp 4-component vector of float) +0:44 'g_tTex1df4a' (layout( rgba32f) uniform image1DArray) +0:44 c2: direct index for structure ( uniform 2-component vector of int) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:44 Constant: +0:44 1 (const uint) +0:45 imageLoad ( temp 4-component vector of int) +0:45 'g_tTex1di4a' (layout( rgba32i) uniform iimage1DArray) +0:45 c2: direct index for structure ( uniform 2-component vector of int) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:45 Constant: +0:45 1 (const uint) +0:46 imageLoad ( temp 4-component vector of uint) +0:46 'g_tTex1du4a' (layout( rgba32ui) uniform uimage1DArray) +0:46 c2: direct index for structure ( uniform 2-component vector of int) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:46 Constant: +0:46 1 (const uint) +0:49 imageLoad ( temp 4-component vector of float) +0:49 'g_tTex2df4a' (layout( rgba32f) uniform image2DArray) +0:49 c3: direct index for structure ( uniform 3-component vector of int) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:49 Constant: +0:49 2 (const uint) +0:50 imageLoad ( temp 4-component vector of int) +0:50 'g_tTex2di4a' (layout( rgba32i) uniform iimage2DArray) +0:50 c3: direct index for structure ( uniform 3-component vector of int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:50 Constant: +0:50 2 (const uint) +0:51 imageLoad ( temp 4-component vector of uint) +0:51 'g_tTex2du4a' (layout( rgba32ui) uniform uimage2DArray) +0:51 c3: direct index for structure ( uniform 3-component vector of int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:51 Constant: +0:51 2 (const uint) +0:53 move second child to first child ( temp 4-component vector of float) +0:53 Color: direct index for structure ( temp 4-component vector of float) +0:53 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:53 Constant: +0:53 0 (const int) +0:53 Constant: +0:53 1.000000 +0:53 1.000000 +0:53 1.000000 +0:53 1.000000 +0:54 move second child to first child ( temp float) +0:54 Depth: direct index for structure ( temp float) +0:54 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:54 Constant: +0:54 1 (const int) +0:54 Constant: +0:54 1.000000 +0:56 Branch: Return with expression +0:56 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Function Definition: main( ( temp void) +0:40 Function Parameters: +0:? Sequence +0:40 Sequence +0:40 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:40 Color: direct index for structure ( temp 4-component vector of float) +0:40 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 0 (const int) +0:40 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:40 Depth: direct index for structure ( temp float) +0:40 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:? 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:? 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:? 'g_tTex2df4' (layout( rgba32f) uniform image2D) +0:? 'g_tTex2di4' (layout( rgba32i) uniform iimage2D) +0:? 'g_tTex2du4' (layout( rgba32ui) uniform uimage2D) +0:? 'g_tTex3df4' (layout( rgba32f) uniform image3D) +0:? 'g_tTex3di4' (layout( rgba32i) uniform iimage3D) +0:? 'g_tTex3du4' (layout( rgba32ui) uniform uimage3D) +0:? 'g_tTex1df4a' (layout( rgba32f) uniform image1DArray) +0:? 'g_tTex1di4a' (layout( rgba32i) uniform iimage1DArray) +0:? 'g_tTex1du4a' (layout( rgba32ui) uniform uimage1DArray) +0:? 'g_tTex2df4a' (layout( rgba32f) uniform image2DArray) +0:? 'g_tTex2di4a' (layout( rgba32i) uniform iimage2DArray) +0:? 'g_tTex2du4a' (layout( rgba32ui) uniform uimage2DArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 119 + + Capability Shader + Capability Image1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 82 86 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 14 "g_tTex1df4a" + Name 20 "$Global" + MemberName 20($Global) 0 "c1" + MemberName 20($Global) 1 "c2" + MemberName 20($Global) 2 "c3" + MemberName 20($Global) 3 "c4" + MemberName 20($Global) 4 "o1" + MemberName 20($Global) 5 "o2" + MemberName 20($Global) 6 "o3" + MemberName 20($Global) 7 "o4" + Name 22 "" + Name 30 "g_tTex1di4a" + Name 38 "g_tTex1du4a" + Name 46 "g_tTex2df4a" + Name 55 "g_tTex2di4a" + Name 62 "g_tTex2du4a" + Name 68 "psout" + Name 79 "flattenTemp" + Name 82 "@entryPointOutput.Color" + Name 86 "@entryPointOutput.Depth" + Name 91 "g_sSamp" + Name 94 "g_tTex1df4" + Name 97 "g_tTex1di4" + Name 100 "g_tTex1du4" + Name 103 "g_tTex2df4" + Name 106 "g_tTex2di4" + Name 109 "g_tTex2du4" + Name 112 "g_tTex3df4" + Name 115 "g_tTex3di4" + Name 118 "g_tTex3du4" + Decorate 14(g_tTex1df4a) DescriptorSet 0 + MemberDecorate 20($Global) 0 Offset 0 + MemberDecorate 20($Global) 1 Offset 8 + MemberDecorate 20($Global) 2 Offset 16 + MemberDecorate 20($Global) 3 Offset 32 + MemberDecorate 20($Global) 4 Offset 48 + MemberDecorate 20($Global) 5 Offset 56 + MemberDecorate 20($Global) 6 Offset 64 + MemberDecorate 20($Global) 7 Offset 80 + Decorate 20($Global) Block + Decorate 22 DescriptorSet 0 + Decorate 30(g_tTex1di4a) DescriptorSet 0 + Decorate 38(g_tTex1du4a) DescriptorSet 0 + Decorate 46(g_tTex2df4a) DescriptorSet 0 + Decorate 55(g_tTex2di4a) DescriptorSet 0 + Decorate 62(g_tTex2du4a) DescriptorSet 0 + Decorate 82(@entryPointOutput.Color) Location 0 + Decorate 86(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 91(g_sSamp) DescriptorSet 0 + Decorate 91(g_sSamp) Binding 0 + Decorate 94(g_tTex1df4) DescriptorSet 0 + Decorate 94(g_tTex1df4) Binding 0 + Decorate 97(g_tTex1di4) DescriptorSet 0 + Decorate 100(g_tTex1du4) DescriptorSet 0 + Decorate 103(g_tTex2df4) DescriptorSet 0 + Decorate 106(g_tTex2di4) DescriptorSet 0 + Decorate 109(g_tTex2du4) DescriptorSet 0 + Decorate 112(g_tTex3df4) DescriptorSet 0 + Decorate 115(g_tTex3di4) DescriptorSet 0 + Decorate 118(g_tTex3du4) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeImage 6(float) 1D array nonsampled format:Rgba32f + 13: TypePointer UniformConstant 12 + 14(g_tTex1df4a): 13(ptr) Variable UniformConstant + 16: TypeInt 32 1 + 17: TypeVector 16(int) 2 + 18: TypeVector 16(int) 3 + 19: TypeVector 16(int) 4 + 20($Global): TypeStruct 16(int) 17(ivec2) 18(ivec3) 19(ivec4) 16(int) 17(ivec2) 18(ivec3) 19(ivec4) + 21: TypePointer Uniform 20($Global) + 22: 21(ptr) Variable Uniform + 23: 16(int) Constant 1 + 24: TypePointer Uniform 17(ivec2) + 28: TypeImage 16(int) 1D array nonsampled format:Rgba32i + 29: TypePointer UniformConstant 28 + 30(g_tTex1di4a): 29(ptr) Variable UniformConstant + 35: TypeInt 32 0 + 36: TypeImage 35(int) 1D array nonsampled format:Rgba32ui + 37: TypePointer UniformConstant 36 + 38(g_tTex1du4a): 37(ptr) Variable UniformConstant + 42: TypeVector 35(int) 4 + 44: TypeImage 6(float) 2D array nonsampled format:Rgba32f + 45: TypePointer UniformConstant 44 + 46(g_tTex2df4a): 45(ptr) Variable UniformConstant + 48: 16(int) Constant 2 + 49: TypePointer Uniform 18(ivec3) + 53: TypeImage 16(int) 2D array nonsampled format:Rgba32i + 54: TypePointer UniformConstant 53 + 55(g_tTex2di4a): 54(ptr) Variable UniformConstant + 60: TypeImage 35(int) 2D array nonsampled format:Rgba32ui + 61: TypePointer UniformConstant 60 + 62(g_tTex2du4a): 61(ptr) Variable UniformConstant + 67: TypePointer Function 8(PS_OUTPUT) + 69: 16(int) Constant 0 + 70: 6(float) Constant 1065353216 + 71: 7(fvec4) ConstantComposite 70 70 70 70 + 72: TypePointer Function 7(fvec4) + 74: TypePointer Function 6(float) + 81: TypePointer Output 7(fvec4) +82(@entryPointOutput.Color): 81(ptr) Variable Output + 85: TypePointer Output 6(float) +86(@entryPointOutput.Depth): 85(ptr) Variable Output + 89: TypeSampler + 90: TypePointer UniformConstant 89 + 91(g_sSamp): 90(ptr) Variable UniformConstant + 92: TypeImage 6(float) 1D nonsampled format:Rgba32f + 93: TypePointer UniformConstant 92 + 94(g_tTex1df4): 93(ptr) Variable UniformConstant + 95: TypeImage 16(int) 1D nonsampled format:Rgba32i + 96: TypePointer UniformConstant 95 + 97(g_tTex1di4): 96(ptr) Variable UniformConstant + 98: TypeImage 35(int) 1D nonsampled format:Rgba32ui + 99: TypePointer UniformConstant 98 + 100(g_tTex1du4): 99(ptr) Variable UniformConstant + 101: TypeImage 6(float) 2D nonsampled format:Rgba32f + 102: TypePointer UniformConstant 101 + 103(g_tTex2df4): 102(ptr) Variable UniformConstant + 104: TypeImage 16(int) 2D nonsampled format:Rgba32i + 105: TypePointer UniformConstant 104 + 106(g_tTex2di4): 105(ptr) Variable UniformConstant + 107: TypeImage 35(int) 2D nonsampled format:Rgba32ui + 108: TypePointer UniformConstant 107 + 109(g_tTex2du4): 108(ptr) Variable UniformConstant + 110: TypeImage 6(float) 3D nonsampled format:Rgba32f + 111: TypePointer UniformConstant 110 + 112(g_tTex3df4): 111(ptr) Variable UniformConstant + 113: TypeImage 16(int) 3D nonsampled format:Rgba32i + 114: TypePointer UniformConstant 113 + 115(g_tTex3di4): 114(ptr) Variable UniformConstant + 116: TypeImage 35(int) 3D nonsampled format:Rgba32ui + 117: TypePointer UniformConstant 116 + 118(g_tTex3du4): 117(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 79(flattenTemp): 67(ptr) Variable Function + 80:8(PS_OUTPUT) FunctionCall 10(@main() + Store 79(flattenTemp) 80 + 83: 72(ptr) AccessChain 79(flattenTemp) 69 + 84: 7(fvec4) Load 83 + Store 82(@entryPointOutput.Color) 84 + 87: 74(ptr) AccessChain 79(flattenTemp) 23 + 88: 6(float) Load 87 + Store 86(@entryPointOutput.Depth) 88 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 68(psout): 67(ptr) Variable Function + 15: 12 Load 14(g_tTex1df4a) + 25: 24(ptr) AccessChain 22 23 + 26: 17(ivec2) Load 25 + 27: 7(fvec4) ImageRead 15 26 + 31: 28 Load 30(g_tTex1di4a) + 32: 24(ptr) AccessChain 22 23 + 33: 17(ivec2) Load 32 + 34: 19(ivec4) ImageRead 31 33 + 39: 36 Load 38(g_tTex1du4a) + 40: 24(ptr) AccessChain 22 23 + 41: 17(ivec2) Load 40 + 43: 42(ivec4) ImageRead 39 41 + 47: 44 Load 46(g_tTex2df4a) + 50: 49(ptr) AccessChain 22 48 + 51: 18(ivec3) Load 50 + 52: 7(fvec4) ImageRead 47 51 + 56: 53 Load 55(g_tTex2di4a) + 57: 49(ptr) AccessChain 22 48 + 58: 18(ivec3) Load 57 + 59: 19(ivec4) ImageRead 56 58 + 63: 60 Load 62(g_tTex2du4a) + 64: 49(ptr) AccessChain 22 48 + 65: 18(ivec3) Load 64 + 66: 42(ivec4) ImageRead 63 65 + 73: 72(ptr) AccessChain 68(psout) 69 + Store 73 71 + 75: 74(ptr) AccessChain 68(psout) 23 + Store 75 70 + 76:8(PS_OUTPUT) Load 68(psout) + ReturnValue 76 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out new file mode 100644 index 00000000..68044aa5 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out @@ -0,0 +1,459 @@ +hlsl.load.rwtexture.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:40 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Function Parameters: +0:? Sequence +0:44 imageLoad ( temp 4-component vector of float) +0:44 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:44 c1: direct index for structure ( uniform int) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:44 Constant: +0:44 0 (const uint) +0:45 imageLoad ( temp 4-component vector of int) +0:45 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:45 c1: direct index for structure ( uniform int) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:45 Constant: +0:45 0 (const uint) +0:46 imageLoad ( temp 4-component vector of uint) +0:46 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:46 c1: direct index for structure ( uniform int) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:46 Constant: +0:46 0 (const uint) +0:49 imageLoad ( temp 4-component vector of float) +0:49 'g_tTex2df4' (layout( rgba32f) uniform image2D) +0:49 c2: direct index for structure ( uniform 2-component vector of int) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:49 Constant: +0:49 1 (const uint) +0:50 imageLoad ( temp 4-component vector of int) +0:50 'g_tTex2di4' (layout( rgba32i) uniform iimage2D) +0:50 c2: direct index for structure ( uniform 2-component vector of int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:50 Constant: +0:50 1 (const uint) +0:51 imageLoad ( temp 4-component vector of uint) +0:51 'g_tTex2du4' (layout( rgba32ui) uniform uimage2D) +0:51 c2: direct index for structure ( uniform 2-component vector of int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:51 Constant: +0:51 1 (const uint) +0:54 imageLoad ( temp 4-component vector of float) +0:54 'g_tTex3df4' (layout( rgba32f) uniform image3D) +0:54 c3: direct index for structure ( uniform 3-component vector of int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 2 (const uint) +0:55 imageLoad ( temp 4-component vector of int) +0:55 'g_tTex3di4' (layout( rgba32i) uniform iimage3D) +0:55 c3: direct index for structure ( uniform 3-component vector of int) +0:55 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:55 Constant: +0:55 2 (const uint) +0:56 imageLoad ( temp 4-component vector of uint) +0:56 'g_tTex3du4' (layout( rgba32ui) uniform uimage3D) +0:56 c3: direct index for structure ( uniform 3-component vector of int) +0:56 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:56 Constant: +0:56 2 (const uint) +0:58 move second child to first child ( temp 4-component vector of float) +0:58 Color: direct index for structure ( temp 4-component vector of float) +0:58 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:58 Constant: +0:58 0 (const int) +0:58 Constant: +0:58 1.000000 +0:58 1.000000 +0:58 1.000000 +0:58 1.000000 +0:59 move second child to first child ( temp float) +0:59 Depth: direct index for structure ( temp float) +0:59 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:59 Constant: +0:59 1 (const int) +0:59 Constant: +0:59 1.000000 +0:61 Branch: Return with expression +0:61 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Function Definition: main( ( temp void) +0:40 Function Parameters: +0:? Sequence +0:40 Sequence +0:40 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:40 Color: direct index for structure ( temp 4-component vector of float) +0:40 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 0 (const int) +0:40 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:40 Depth: direct index for structure ( temp float) +0:40 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:? 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:? 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:? 'g_tTex2df4' (layout( rgba32f) uniform image2D) +0:? 'g_tTex2di4' (layout( rgba32i) uniform iimage2D) +0:? 'g_tTex2du4' (layout( rgba32ui) uniform uimage2D) +0:? 'g_tTex3df4' (layout( rgba32f) uniform image3D) +0:? 'g_tTex3di4' (layout( rgba32i) uniform iimage3D) +0:? 'g_tTex3du4' (layout( rgba32ui) uniform uimage3D) +0:? 'g_tTex1df4a' (layout( rgba32f) uniform image1DArray) +0:? 'g_tTex1di4a' (layout( rgba32i) uniform iimage1DArray) +0:? 'g_tTex1du4a' (layout( rgba32ui) uniform uimage1DArray) +0:? 'g_tTex2df4a' (layout( rgba32f) uniform image2DArray) +0:? 'g_tTex2di4a' (layout( rgba32i) uniform iimage2DArray) +0:? 'g_tTex2du4a' (layout( rgba32ui) uniform uimage2DArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:40 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Function Parameters: +0:? Sequence +0:44 imageLoad ( temp 4-component vector of float) +0:44 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:44 c1: direct index for structure ( uniform int) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:44 Constant: +0:44 0 (const uint) +0:45 imageLoad ( temp 4-component vector of int) +0:45 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:45 c1: direct index for structure ( uniform int) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:45 Constant: +0:45 0 (const uint) +0:46 imageLoad ( temp 4-component vector of uint) +0:46 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:46 c1: direct index for structure ( uniform int) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:46 Constant: +0:46 0 (const uint) +0:49 imageLoad ( temp 4-component vector of float) +0:49 'g_tTex2df4' (layout( rgba32f) uniform image2D) +0:49 c2: direct index for structure ( uniform 2-component vector of int) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:49 Constant: +0:49 1 (const uint) +0:50 imageLoad ( temp 4-component vector of int) +0:50 'g_tTex2di4' (layout( rgba32i) uniform iimage2D) +0:50 c2: direct index for structure ( uniform 2-component vector of int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:50 Constant: +0:50 1 (const uint) +0:51 imageLoad ( temp 4-component vector of uint) +0:51 'g_tTex2du4' (layout( rgba32ui) uniform uimage2D) +0:51 c2: direct index for structure ( uniform 2-component vector of int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:51 Constant: +0:51 1 (const uint) +0:54 imageLoad ( temp 4-component vector of float) +0:54 'g_tTex3df4' (layout( rgba32f) uniform image3D) +0:54 c3: direct index for structure ( uniform 3-component vector of int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:54 Constant: +0:54 2 (const uint) +0:55 imageLoad ( temp 4-component vector of int) +0:55 'g_tTex3di4' (layout( rgba32i) uniform iimage3D) +0:55 c3: direct index for structure ( uniform 3-component vector of int) +0:55 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:55 Constant: +0:55 2 (const uint) +0:56 imageLoad ( temp 4-component vector of uint) +0:56 'g_tTex3du4' (layout( rgba32ui) uniform uimage3D) +0:56 c3: direct index for structure ( uniform 3-component vector of int) +0:56 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:56 Constant: +0:56 2 (const uint) +0:58 move second child to first child ( temp 4-component vector of float) +0:58 Color: direct index for structure ( temp 4-component vector of float) +0:58 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:58 Constant: +0:58 0 (const int) +0:58 Constant: +0:58 1.000000 +0:58 1.000000 +0:58 1.000000 +0:58 1.000000 +0:59 move second child to first child ( temp float) +0:59 Depth: direct index for structure ( temp float) +0:59 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:59 Constant: +0:59 1 (const int) +0:59 Constant: +0:59 1.000000 +0:61 Branch: Return with expression +0:61 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Function Definition: main( ( temp void) +0:40 Function Parameters: +0:? Sequence +0:40 Sequence +0:40 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:40 Color: direct index for structure ( temp 4-component vector of float) +0:40 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 0 (const int) +0:40 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:40 Depth: direct index for structure ( temp float) +0:40 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:? 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:? 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:? 'g_tTex2df4' (layout( rgba32f) uniform image2D) +0:? 'g_tTex2di4' (layout( rgba32i) uniform iimage2D) +0:? 'g_tTex2du4' (layout( rgba32ui) uniform uimage2D) +0:? 'g_tTex3df4' (layout( rgba32f) uniform image3D) +0:? 'g_tTex3di4' (layout( rgba32i) uniform iimage3D) +0:? 'g_tTex3du4' (layout( rgba32ui) uniform uimage3D) +0:? 'g_tTex1df4a' (layout( rgba32f) uniform image1DArray) +0:? 'g_tTex1di4a' (layout( rgba32i) uniform iimage1DArray) +0:? 'g_tTex1du4a' (layout( rgba32ui) uniform uimage1DArray) +0:? 'g_tTex2df4a' (layout( rgba32f) uniform image2DArray) +0:? 'g_tTex2di4a' (layout( rgba32i) uniform iimage2DArray) +0:? 'g_tTex2du4a' (layout( rgba32ui) uniform uimage2DArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 132 + + Capability Shader + Capability Image1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 104 108 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 14 "g_tTex1df4" + Name 20 "$Global" + MemberName 20($Global) 0 "c1" + MemberName 20($Global) 1 "c2" + MemberName 20($Global) 2 "c3" + MemberName 20($Global) 3 "c4" + MemberName 20($Global) 4 "o1" + MemberName 20($Global) 5 "o2" + MemberName 20($Global) 6 "o3" + MemberName 20($Global) 7 "o4" + Name 22 "" + Name 30 "g_tTex1di4" + Name 38 "g_tTex1du4" + Name 46 "g_tTex2df4" + Name 55 "g_tTex2di4" + Name 62 "g_tTex2du4" + Name 69 "g_tTex3df4" + Name 78 "g_tTex3di4" + Name 85 "g_tTex3du4" + Name 91 "psout" + Name 101 "flattenTemp" + Name 104 "@entryPointOutput.Color" + Name 108 "@entryPointOutput.Depth" + Name 113 "g_sSamp" + Name 116 "g_tTex1df4a" + Name 119 "g_tTex1di4a" + Name 122 "g_tTex1du4a" + Name 125 "g_tTex2df4a" + Name 128 "g_tTex2di4a" + Name 131 "g_tTex2du4a" + Decorate 14(g_tTex1df4) DescriptorSet 0 + Decorate 14(g_tTex1df4) Binding 0 + MemberDecorate 20($Global) 0 Offset 0 + MemberDecorate 20($Global) 1 Offset 8 + MemberDecorate 20($Global) 2 Offset 16 + MemberDecorate 20($Global) 3 Offset 32 + MemberDecorate 20($Global) 4 Offset 48 + MemberDecorate 20($Global) 5 Offset 56 + MemberDecorate 20($Global) 6 Offset 64 + MemberDecorate 20($Global) 7 Offset 80 + Decorate 20($Global) Block + Decorate 22 DescriptorSet 0 + Decorate 30(g_tTex1di4) DescriptorSet 0 + Decorate 38(g_tTex1du4) DescriptorSet 0 + Decorate 46(g_tTex2df4) DescriptorSet 0 + Decorate 55(g_tTex2di4) DescriptorSet 0 + Decorate 62(g_tTex2du4) DescriptorSet 0 + Decorate 69(g_tTex3df4) DescriptorSet 0 + Decorate 78(g_tTex3di4) DescriptorSet 0 + Decorate 85(g_tTex3du4) DescriptorSet 0 + Decorate 104(@entryPointOutput.Color) Location 0 + Decorate 108(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 113(g_sSamp) DescriptorSet 0 + Decorate 113(g_sSamp) Binding 0 + Decorate 116(g_tTex1df4a) DescriptorSet 0 + Decorate 119(g_tTex1di4a) DescriptorSet 0 + Decorate 122(g_tTex1du4a) DescriptorSet 0 + Decorate 125(g_tTex2df4a) DescriptorSet 0 + Decorate 128(g_tTex2di4a) DescriptorSet 0 + Decorate 131(g_tTex2du4a) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeImage 6(float) 1D nonsampled format:Rgba32f + 13: TypePointer UniformConstant 12 + 14(g_tTex1df4): 13(ptr) Variable UniformConstant + 16: TypeInt 32 1 + 17: TypeVector 16(int) 2 + 18: TypeVector 16(int) 3 + 19: TypeVector 16(int) 4 + 20($Global): TypeStruct 16(int) 17(ivec2) 18(ivec3) 19(ivec4) 16(int) 17(ivec2) 18(ivec3) 19(ivec4) + 21: TypePointer Uniform 20($Global) + 22: 21(ptr) Variable Uniform + 23: 16(int) Constant 0 + 24: TypePointer Uniform 16(int) + 28: TypeImage 16(int) 1D nonsampled format:Rgba32i + 29: TypePointer UniformConstant 28 + 30(g_tTex1di4): 29(ptr) Variable UniformConstant + 35: TypeInt 32 0 + 36: TypeImage 35(int) 1D nonsampled format:Rgba32ui + 37: TypePointer UniformConstant 36 + 38(g_tTex1du4): 37(ptr) Variable UniformConstant + 42: TypeVector 35(int) 4 + 44: TypeImage 6(float) 2D nonsampled format:Rgba32f + 45: TypePointer UniformConstant 44 + 46(g_tTex2df4): 45(ptr) Variable UniformConstant + 48: 16(int) Constant 1 + 49: TypePointer Uniform 17(ivec2) + 53: TypeImage 16(int) 2D nonsampled format:Rgba32i + 54: TypePointer UniformConstant 53 + 55(g_tTex2di4): 54(ptr) Variable UniformConstant + 60: TypeImage 35(int) 2D nonsampled format:Rgba32ui + 61: TypePointer UniformConstant 60 + 62(g_tTex2du4): 61(ptr) Variable UniformConstant + 67: TypeImage 6(float) 3D nonsampled format:Rgba32f + 68: TypePointer UniformConstant 67 + 69(g_tTex3df4): 68(ptr) Variable UniformConstant + 71: 16(int) Constant 2 + 72: TypePointer Uniform 18(ivec3) + 76: TypeImage 16(int) 3D nonsampled format:Rgba32i + 77: TypePointer UniformConstant 76 + 78(g_tTex3di4): 77(ptr) Variable UniformConstant + 83: TypeImage 35(int) 3D nonsampled format:Rgba32ui + 84: TypePointer UniformConstant 83 + 85(g_tTex3du4): 84(ptr) Variable UniformConstant + 90: TypePointer Function 8(PS_OUTPUT) + 92: 6(float) Constant 1065353216 + 93: 7(fvec4) ConstantComposite 92 92 92 92 + 94: TypePointer Function 7(fvec4) + 96: TypePointer Function 6(float) + 103: TypePointer Output 7(fvec4) +104(@entryPointOutput.Color): 103(ptr) Variable Output + 107: TypePointer Output 6(float) +108(@entryPointOutput.Depth): 107(ptr) Variable Output + 111: TypeSampler + 112: TypePointer UniformConstant 111 + 113(g_sSamp): 112(ptr) Variable UniformConstant + 114: TypeImage 6(float) 1D array nonsampled format:Rgba32f + 115: TypePointer UniformConstant 114 +116(g_tTex1df4a): 115(ptr) Variable UniformConstant + 117: TypeImage 16(int) 1D array nonsampled format:Rgba32i + 118: TypePointer UniformConstant 117 +119(g_tTex1di4a): 118(ptr) Variable UniformConstant + 120: TypeImage 35(int) 1D array nonsampled format:Rgba32ui + 121: TypePointer UniformConstant 120 +122(g_tTex1du4a): 121(ptr) Variable UniformConstant + 123: TypeImage 6(float) 2D array nonsampled format:Rgba32f + 124: TypePointer UniformConstant 123 +125(g_tTex2df4a): 124(ptr) Variable UniformConstant + 126: TypeImage 16(int) 2D array nonsampled format:Rgba32i + 127: TypePointer UniformConstant 126 +128(g_tTex2di4a): 127(ptr) Variable UniformConstant + 129: TypeImage 35(int) 2D array nonsampled format:Rgba32ui + 130: TypePointer UniformConstant 129 +131(g_tTex2du4a): 130(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +101(flattenTemp): 90(ptr) Variable Function + 102:8(PS_OUTPUT) FunctionCall 10(@main() + Store 101(flattenTemp) 102 + 105: 94(ptr) AccessChain 101(flattenTemp) 23 + 106: 7(fvec4) Load 105 + Store 104(@entryPointOutput.Color) 106 + 109: 96(ptr) AccessChain 101(flattenTemp) 48 + 110: 6(float) Load 109 + Store 108(@entryPointOutput.Depth) 110 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 91(psout): 90(ptr) Variable Function + 15: 12 Load 14(g_tTex1df4) + 25: 24(ptr) AccessChain 22 23 + 26: 16(int) Load 25 + 27: 7(fvec4) ImageRead 15 26 + 31: 28 Load 30(g_tTex1di4) + 32: 24(ptr) AccessChain 22 23 + 33: 16(int) Load 32 + 34: 19(ivec4) ImageRead 31 33 + 39: 36 Load 38(g_tTex1du4) + 40: 24(ptr) AccessChain 22 23 + 41: 16(int) Load 40 + 43: 42(ivec4) ImageRead 39 41 + 47: 44 Load 46(g_tTex2df4) + 50: 49(ptr) AccessChain 22 48 + 51: 17(ivec2) Load 50 + 52: 7(fvec4) ImageRead 47 51 + 56: 53 Load 55(g_tTex2di4) + 57: 49(ptr) AccessChain 22 48 + 58: 17(ivec2) Load 57 + 59: 19(ivec4) ImageRead 56 58 + 63: 60 Load 62(g_tTex2du4) + 64: 49(ptr) AccessChain 22 48 + 65: 17(ivec2) Load 64 + 66: 42(ivec4) ImageRead 63 65 + 70: 67 Load 69(g_tTex3df4) + 73: 72(ptr) AccessChain 22 71 + 74: 18(ivec3) Load 73 + 75: 7(fvec4) ImageRead 70 74 + 79: 76 Load 78(g_tTex3di4) + 80: 72(ptr) AccessChain 22 71 + 81: 18(ivec3) Load 80 + 82: 19(ivec4) ImageRead 79 81 + 86: 83 Load 85(g_tTex3du4) + 87: 72(ptr) AccessChain 22 71 + 88: 18(ivec3) Load 87 + 89: 42(ivec4) ImageRead 86 88 + 95: 94(ptr) AccessChain 91(psout) 23 + Store 95 93 + 97: 96(ptr) AccessChain 91(psout) 48 + Store 97 92 + 98:8(PS_OUTPUT) Load 91(psout) + ReturnValue 98 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.localStructuredBuffer.comp.out b/deps/glslang/Test/baseResults/hlsl.localStructuredBuffer.comp.out new file mode 100644 index 00000000..a2b4db0e --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.localStructuredBuffer.comp.out @@ -0,0 +1,34 @@ +hlsl.localStructuredBuffer.comp +ERROR: 0:3: 'block initializer' : buffer aliasing not yet supported +ERROR: 1 compilation errors. No code generated. + + +Shader version: 500 +local_size = (1, 1, 1) +ERROR: node is still EOpNull! +0:2 Function Definition: @main( ( temp void) +0:2 Function Parameters: +0:2 Function Definition: main( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 Function Call: @main( ( temp void) +0:? Linker Objects +0:? 'srt0' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) + + +Linked compute stage: + + +Shader version: 500 +local_size = (1, 1, 1) +ERROR: node is still EOpNull! +0:2 Function Definition: @main( ( temp void) +0:2 Function Parameters: +0:2 Function Definition: main( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 Function Call: @main( ( temp void) +0:? Linker Objects +0:? 'srt0' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/hlsl.logical.binary.frag.out b/deps/glslang/Test/baseResults/hlsl.logical.binary.frag.out new file mode 100644 index 00000000..b90811bd --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.logical.binary.frag.out @@ -0,0 +1,218 @@ +hlsl.logical.binary.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:12 Function Parameters: +0:? Sequence +0:13 Test condition and select ( temp void) +0:13 Condition +0:13 logical-and ( temp bool) +0:13 Convert int to bool ( temp bool) +0:13 ival: direct index for structure ( uniform int) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:13 Constant: +0:13 0 (const uint) +0:13 Convert float to bool ( temp bool) +0:13 fval: direct index for structure ( uniform float) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:13 Constant: +0:13 2 (const uint) +0:13 true case is null +0:14 Test condition and select ( temp void) +0:14 Condition +0:14 logical-or ( temp bool) +0:14 Convert int to bool ( temp bool) +0:14 ival: direct index for structure ( uniform int) +0:14 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:14 Constant: +0:14 0 (const uint) +0:14 Convert float to bool ( temp bool) +0:14 fval: direct index for structure ( uniform float) +0:14 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:14 Constant: +0:14 2 (const uint) +0:14 true case is null +0:17 move second child to first child ( temp 4-component vector of float) +0:17 Color: direct index for structure ( temp 4-component vector of float) +0:17 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1.000000 +0:17 1.000000 +0:17 1.000000 +0:17 1.000000 +0:18 Branch: Return with expression +0:18 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:12 Color: direct index for structure ( temp 4-component vector of float) +0:12 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:12 Constant: +0:12 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:12 Function Parameters: +0:? Sequence +0:13 Test condition and select ( temp void) +0:13 Condition +0:13 logical-and ( temp bool) +0:13 Convert int to bool ( temp bool) +0:13 ival: direct index for structure ( uniform int) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:13 Constant: +0:13 0 (const uint) +0:13 Convert float to bool ( temp bool) +0:13 fval: direct index for structure ( uniform float) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:13 Constant: +0:13 2 (const uint) +0:13 true case is null +0:14 Test condition and select ( temp void) +0:14 Condition +0:14 logical-or ( temp bool) +0:14 Convert int to bool ( temp bool) +0:14 ival: direct index for structure ( uniform int) +0:14 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:14 Constant: +0:14 0 (const uint) +0:14 Convert float to bool ( temp bool) +0:14 fval: direct index for structure ( uniform float) +0:14 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:14 Constant: +0:14 2 (const uint) +0:14 true case is null +0:17 move second child to first child ( temp 4-component vector of float) +0:17 Color: direct index for structure ( temp 4-component vector of float) +0:17 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1.000000 +0:17 1.000000 +0:17 1.000000 +0:17 1.000000 +0:18 Branch: Return with expression +0:18 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:12 Color: direct index for structure ( temp 4-component vector of float) +0:12 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:12 Constant: +0:12 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 56 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 53 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + Name 10 "@main(" + Name 14 "$Global" + MemberName 14($Global) 0 "ival" + MemberName 14($Global) 1 "ival4" + MemberName 14($Global) 2 "fval" + MemberName 14($Global) 3 "fval4" + Name 16 "" + Name 44 "psout" + Name 53 "@entryPointOutput.Color" + MemberDecorate 14($Global) 0 Offset 0 + MemberDecorate 14($Global) 1 Offset 16 + MemberDecorate 14($Global) 2 Offset 32 + MemberDecorate 14($Global) 3 Offset 48 + Decorate 14($Global) Block + Decorate 16 DescriptorSet 0 + Decorate 53(@entryPointOutput.Color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeInt 32 1 + 13: TypeVector 12(int) 4 + 14($Global): TypeStruct 12(int) 13(ivec4) 6(float) 7(fvec4) + 15: TypePointer Uniform 14($Global) + 16: 15(ptr) Variable Uniform + 17: 12(int) Constant 0 + 18: TypePointer Uniform 12(int) + 21: TypeBool + 22: TypeInt 32 0 + 23: 22(int) Constant 0 + 25: 12(int) Constant 2 + 26: TypePointer Uniform 6(float) + 29: 6(float) Constant 0 + 43: TypePointer Function 8(PS_OUTPUT) + 45: 6(float) Constant 1065353216 + 46: 7(fvec4) ConstantComposite 45 45 45 45 + 47: TypePointer Function 7(fvec4) + 52: TypePointer Output 7(fvec4) +53(@entryPointOutput.Color): 52(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 54:8(PS_OUTPUT) FunctionCall 10(@main() + 55: 7(fvec4) CompositeExtract 54 0 + Store 53(@entryPointOutput.Color) 55 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 44(psout): 43(ptr) Variable Function + 19: 18(ptr) AccessChain 16 17 + 20: 12(int) Load 19 + 24: 21(bool) INotEqual 20 23 + 27: 26(ptr) AccessChain 16 25 + 28: 6(float) Load 27 + 30: 21(bool) FOrdNotEqual 28 29 + 31: 21(bool) LogicalAnd 24 30 + SelectionMerge 33 None + BranchConditional 31 32 33 + 32: Label + Branch 33 + 33: Label + 34: 18(ptr) AccessChain 16 17 + 35: 12(int) Load 34 + 36: 21(bool) INotEqual 35 23 + 37: 26(ptr) AccessChain 16 25 + 38: 6(float) Load 37 + 39: 21(bool) FOrdNotEqual 38 29 + 40: 21(bool) LogicalOr 36 39 + SelectionMerge 42 None + BranchConditional 40 41 42 + 41: Label + Branch 42 + 42: Label + 48: 47(ptr) AccessChain 44(psout) 17 + Store 48 46 + 49:8(PS_OUTPUT) Load 44(psout) + ReturnValue 49 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.logical.binary.vec.frag.out b/deps/glslang/Test/baseResults/hlsl.logical.binary.vec.frag.out new file mode 100644 index 00000000..32753e5c --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.logical.binary.vec.frag.out @@ -0,0 +1,415 @@ +hlsl.logical.binary.vec.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:10 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:10 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of bool) +0:11 'r00' ( temp 4-component vector of bool) +0:11 Negate conditional ( temp 4-component vector of bool) +0:11 b4a: direct index for structure ( uniform 4-component vector of bool) +0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:11 Constant: +0:11 0 (const uint) +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of bool) +0:12 'r01' ( temp 4-component vector of bool) +0:12 logical-and ( temp 4-component vector of bool) +0:12 b4a: direct index for structure ( uniform 4-component vector of bool) +0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:12 Constant: +0:12 0 (const uint) +0:12 b4b: direct index for structure ( uniform 4-component vector of bool) +0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:12 Constant: +0:12 1 (const uint) +0:13 Sequence +0:13 move second child to first child ( temp 4-component vector of bool) +0:13 'r02' ( temp 4-component vector of bool) +0:13 logical-or ( temp 4-component vector of bool) +0:13 b4a: direct index for structure ( uniform 4-component vector of bool) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:13 Constant: +0:13 0 (const uint) +0:13 b4b: direct index for structure ( uniform 4-component vector of bool) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:13 Constant: +0:13 1 (const uint) +0:15 Sequence +0:15 move second child to first child ( temp 4-component vector of bool) +0:15 'r10' ( temp 4-component vector of bool) +0:15 logical-and ( temp 4-component vector of bool) +0:15 Construct bvec4 ( uniform 4-component vector of bool) +0:15 b1a: direct index for structure ( uniform bool) +0:15 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:15 Constant: +0:15 2 (const uint) +0:15 b4b: direct index for structure ( uniform 4-component vector of bool) +0:15 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:15 Constant: +0:15 1 (const uint) +0:16 Sequence +0:16 move second child to first child ( temp 4-component vector of bool) +0:16 'r11' ( temp 4-component vector of bool) +0:16 logical-or ( temp 4-component vector of bool) +0:16 Construct bvec4 ( uniform 4-component vector of bool) +0:16 b1a: direct index for structure ( uniform bool) +0:16 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:16 Constant: +0:16 2 (const uint) +0:16 b4b: direct index for structure ( uniform 4-component vector of bool) +0:16 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:16 Constant: +0:16 1 (const uint) +0:18 Sequence +0:18 move second child to first child ( temp 4-component vector of bool) +0:18 'r20' ( temp 4-component vector of bool) +0:18 logical-and ( temp 4-component vector of bool) +0:18 b4a: direct index for structure ( uniform 4-component vector of bool) +0:18 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:18 Constant: +0:18 0 (const uint) +0:18 Construct bvec4 ( uniform 4-component vector of bool) +0:18 b1b: direct index for structure ( uniform bool) +0:18 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:18 Constant: +0:18 3 (const uint) +0:19 Sequence +0:19 move second child to first child ( temp 4-component vector of bool) +0:19 'r21' ( temp 4-component vector of bool) +0:19 logical-or ( temp 4-component vector of bool) +0:19 b4a: direct index for structure ( uniform 4-component vector of bool) +0:19 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:19 Constant: +0:19 0 (const uint) +0:19 Construct bvec4 ( uniform 4-component vector of bool) +0:19 b1b: direct index for structure ( uniform bool) +0:19 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:19 Constant: +0:19 3 (const uint) +0:22 move second child to first child ( temp 4-component vector of float) +0:22 Color: direct index for structure ( temp 4-component vector of float) +0:22 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:22 Constant: +0:22 0 (const int) +0:22 Convert bool to float ( temp 4-component vector of float) +0:22 logical-or ( temp 4-component vector of bool) +0:22 logical-or ( temp 4-component vector of bool) +0:22 logical-or ( temp 4-component vector of bool) +0:22 logical-or ( temp 4-component vector of bool) +0:22 logical-or ( temp 4-component vector of bool) +0:22 logical-or ( temp 4-component vector of bool) +0:22 'r00' ( temp 4-component vector of bool) +0:22 'r01' ( temp 4-component vector of bool) +0:22 'r02' ( temp 4-component vector of bool) +0:22 'r10' ( temp 4-component vector of bool) +0:22 'r11' ( temp 4-component vector of bool) +0:22 'r20' ( temp 4-component vector of bool) +0:22 'r21' ( temp 4-component vector of bool) +0:23 Branch: Return with expression +0:23 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:10 Function Definition: main( ( temp void) +0:10 Function Parameters: +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:10 Color: direct index for structure ( temp 4-component vector of float) +0:10 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:10 Constant: +0:10 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:10 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:10 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of bool) +0:11 'r00' ( temp 4-component vector of bool) +0:11 Negate conditional ( temp 4-component vector of bool) +0:11 b4a: direct index for structure ( uniform 4-component vector of bool) +0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:11 Constant: +0:11 0 (const uint) +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of bool) +0:12 'r01' ( temp 4-component vector of bool) +0:12 logical-and ( temp 4-component vector of bool) +0:12 b4a: direct index for structure ( uniform 4-component vector of bool) +0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:12 Constant: +0:12 0 (const uint) +0:12 b4b: direct index for structure ( uniform 4-component vector of bool) +0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:12 Constant: +0:12 1 (const uint) +0:13 Sequence +0:13 move second child to first child ( temp 4-component vector of bool) +0:13 'r02' ( temp 4-component vector of bool) +0:13 logical-or ( temp 4-component vector of bool) +0:13 b4a: direct index for structure ( uniform 4-component vector of bool) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:13 Constant: +0:13 0 (const uint) +0:13 b4b: direct index for structure ( uniform 4-component vector of bool) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:13 Constant: +0:13 1 (const uint) +0:15 Sequence +0:15 move second child to first child ( temp 4-component vector of bool) +0:15 'r10' ( temp 4-component vector of bool) +0:15 logical-and ( temp 4-component vector of bool) +0:15 Construct bvec4 ( uniform 4-component vector of bool) +0:15 b1a: direct index for structure ( uniform bool) +0:15 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:15 Constant: +0:15 2 (const uint) +0:15 b4b: direct index for structure ( uniform 4-component vector of bool) +0:15 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:15 Constant: +0:15 1 (const uint) +0:16 Sequence +0:16 move second child to first child ( temp 4-component vector of bool) +0:16 'r11' ( temp 4-component vector of bool) +0:16 logical-or ( temp 4-component vector of bool) +0:16 Construct bvec4 ( uniform 4-component vector of bool) +0:16 b1a: direct index for structure ( uniform bool) +0:16 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:16 Constant: +0:16 2 (const uint) +0:16 b4b: direct index for structure ( uniform 4-component vector of bool) +0:16 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:16 Constant: +0:16 1 (const uint) +0:18 Sequence +0:18 move second child to first child ( temp 4-component vector of bool) +0:18 'r20' ( temp 4-component vector of bool) +0:18 logical-and ( temp 4-component vector of bool) +0:18 b4a: direct index for structure ( uniform 4-component vector of bool) +0:18 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:18 Constant: +0:18 0 (const uint) +0:18 Construct bvec4 ( uniform 4-component vector of bool) +0:18 b1b: direct index for structure ( uniform bool) +0:18 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:18 Constant: +0:18 3 (const uint) +0:19 Sequence +0:19 move second child to first child ( temp 4-component vector of bool) +0:19 'r21' ( temp 4-component vector of bool) +0:19 logical-or ( temp 4-component vector of bool) +0:19 b4a: direct index for structure ( uniform 4-component vector of bool) +0:19 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:19 Constant: +0:19 0 (const uint) +0:19 Construct bvec4 ( uniform 4-component vector of bool) +0:19 b1b: direct index for structure ( uniform bool) +0:19 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:19 Constant: +0:19 3 (const uint) +0:22 move second child to first child ( temp 4-component vector of float) +0:22 Color: direct index for structure ( temp 4-component vector of float) +0:22 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:22 Constant: +0:22 0 (const int) +0:22 Convert bool to float ( temp 4-component vector of float) +0:22 logical-or ( temp 4-component vector of bool) +0:22 logical-or ( temp 4-component vector of bool) +0:22 logical-or ( temp 4-component vector of bool) +0:22 logical-or ( temp 4-component vector of bool) +0:22 logical-or ( temp 4-component vector of bool) +0:22 logical-or ( temp 4-component vector of bool) +0:22 'r00' ( temp 4-component vector of bool) +0:22 'r01' ( temp 4-component vector of bool) +0:22 'r02' ( temp 4-component vector of bool) +0:22 'r10' ( temp 4-component vector of bool) +0:22 'r11' ( temp 4-component vector of bool) +0:22 'r20' ( temp 4-component vector of bool) +0:22 'r21' ( temp 4-component vector of bool) +0:23 Branch: Return with expression +0:23 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:10 Function Definition: main( ( temp void) +0:10 Function Parameters: +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:10 Color: direct index for structure ( temp 4-component vector of float) +0:10 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:10 Constant: +0:10 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of bool b4a, uniform 4-component vector of bool b4b, uniform bool b1a, uniform bool b1b}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 115 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 112 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + Name 10 "@main(" + Name 15 "r00" + Name 18 "$Global" + MemberName 18($Global) 0 "b4a" + MemberName 18($Global) 1 "b4b" + MemberName 18($Global) 2 "b1a" + MemberName 18($Global) 3 "b1b" + Name 20 "" + Name 30 "r01" + Name 39 "r02" + Name 47 "r10" + Name 58 "r11" + Name 67 "r20" + Name 77 "r21" + Name 87 "psout" + Name 112 "@entryPointOutput.Color" + MemberDecorate 18($Global) 0 Offset 0 + MemberDecorate 18($Global) 1 Offset 16 + MemberDecorate 18($Global) 2 Offset 32 + MemberDecorate 18($Global) 3 Offset 36 + Decorate 18($Global) Block + Decorate 20 DescriptorSet 0 + Decorate 112(@entryPointOutput.Color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeBool + 13: TypeVector 12(bool) 4 + 14: TypePointer Function 13(bvec4) + 16: TypeInt 32 0 + 17: TypeVector 16(int) 4 + 18($Global): TypeStruct 17(ivec4) 17(ivec4) 16(int) 16(int) + 19: TypePointer Uniform 18($Global) + 20: 19(ptr) Variable Uniform + 21: TypeInt 32 1 + 22: 21(int) Constant 0 + 23: TypePointer Uniform 17(ivec4) + 26: 16(int) Constant 0 + 27: 17(ivec4) ConstantComposite 26 26 26 26 + 34: 21(int) Constant 1 + 48: 21(int) Constant 2 + 49: TypePointer Uniform 16(int) + 71: 21(int) Constant 3 + 86: TypePointer Function 8(PS_OUTPUT) + 101: 6(float) Constant 0 + 102: 6(float) Constant 1065353216 + 103: 7(fvec4) ConstantComposite 101 101 101 101 + 104: 7(fvec4) ConstantComposite 102 102 102 102 + 106: TypePointer Function 7(fvec4) + 111: TypePointer Output 7(fvec4) +112(@entryPointOutput.Color): 111(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 113:8(PS_OUTPUT) FunctionCall 10(@main() + 114: 7(fvec4) CompositeExtract 113 0 + Store 112(@entryPointOutput.Color) 114 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 15(r00): 14(ptr) Variable Function + 30(r01): 14(ptr) Variable Function + 39(r02): 14(ptr) Variable Function + 47(r10): 14(ptr) Variable Function + 58(r11): 14(ptr) Variable Function + 67(r20): 14(ptr) Variable Function + 77(r21): 14(ptr) Variable Function + 87(psout): 86(ptr) Variable Function + 24: 23(ptr) AccessChain 20 22 + 25: 17(ivec4) Load 24 + 28: 13(bvec4) INotEqual 25 27 + 29: 13(bvec4) LogicalNot 28 + Store 15(r00) 29 + 31: 23(ptr) AccessChain 20 22 + 32: 17(ivec4) Load 31 + 33: 13(bvec4) INotEqual 32 27 + 35: 23(ptr) AccessChain 20 34 + 36: 17(ivec4) Load 35 + 37: 13(bvec4) INotEqual 36 27 + 38: 13(bvec4) LogicalAnd 33 37 + Store 30(r01) 38 + 40: 23(ptr) AccessChain 20 22 + 41: 17(ivec4) Load 40 + 42: 13(bvec4) INotEqual 41 27 + 43: 23(ptr) AccessChain 20 34 + 44: 17(ivec4) Load 43 + 45: 13(bvec4) INotEqual 44 27 + 46: 13(bvec4) LogicalOr 42 45 + Store 39(r02) 46 + 50: 49(ptr) AccessChain 20 48 + 51: 16(int) Load 50 + 52: 12(bool) INotEqual 51 26 + 53: 13(bvec4) CompositeConstruct 52 52 52 52 + 54: 23(ptr) AccessChain 20 34 + 55: 17(ivec4) Load 54 + 56: 13(bvec4) INotEqual 55 27 + 57: 13(bvec4) LogicalAnd 53 56 + Store 47(r10) 57 + 59: 49(ptr) AccessChain 20 48 + 60: 16(int) Load 59 + 61: 12(bool) INotEqual 60 26 + 62: 13(bvec4) CompositeConstruct 61 61 61 61 + 63: 23(ptr) AccessChain 20 34 + 64: 17(ivec4) Load 63 + 65: 13(bvec4) INotEqual 64 27 + 66: 13(bvec4) LogicalOr 62 65 + Store 58(r11) 66 + 68: 23(ptr) AccessChain 20 22 + 69: 17(ivec4) Load 68 + 70: 13(bvec4) INotEqual 69 27 + 72: 49(ptr) AccessChain 20 71 + 73: 16(int) Load 72 + 74: 12(bool) INotEqual 73 26 + 75: 13(bvec4) CompositeConstruct 74 74 74 74 + 76: 13(bvec4) LogicalAnd 70 75 + Store 67(r20) 76 + 78: 23(ptr) AccessChain 20 22 + 79: 17(ivec4) Load 78 + 80: 13(bvec4) INotEqual 79 27 + 81: 49(ptr) AccessChain 20 71 + 82: 16(int) Load 81 + 83: 12(bool) INotEqual 82 26 + 84: 13(bvec4) CompositeConstruct 83 83 83 83 + 85: 13(bvec4) LogicalOr 80 84 + Store 77(r21) 85 + 88: 13(bvec4) Load 15(r00) + 89: 13(bvec4) Load 30(r01) + 90: 13(bvec4) LogicalOr 88 89 + 91: 13(bvec4) Load 39(r02) + 92: 13(bvec4) LogicalOr 90 91 + 93: 13(bvec4) Load 47(r10) + 94: 13(bvec4) LogicalOr 92 93 + 95: 13(bvec4) Load 58(r11) + 96: 13(bvec4) LogicalOr 94 95 + 97: 13(bvec4) Load 67(r20) + 98: 13(bvec4) LogicalOr 96 97 + 99: 13(bvec4) Load 77(r21) + 100: 13(bvec4) LogicalOr 98 99 + 105: 7(fvec4) Select 100 104 103 + 107: 106(ptr) AccessChain 87(psout) 22 + Store 107 105 + 108:8(PS_OUTPUT) Load 87(psout) + ReturnValue 108 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.logical.unary.frag.out b/deps/glslang/Test/baseResults/hlsl.logical.unary.frag.out new file mode 100644 index 00000000..25dbc2ad --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.logical.unary.frag.out @@ -0,0 +1,312 @@ +hlsl.logical.unary.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:12 Function Parameters: +0:? Sequence +0:13 Negate conditional ( temp bool) +0:13 Convert int to bool ( temp bool) +0:13 ival: direct index for structure ( uniform int) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:13 Constant: +0:13 0 (const uint) +0:14 Negate conditional ( temp 4-component vector of bool) +0:14 Convert int to bool ( temp 4-component vector of bool) +0:14 ival4: direct index for structure ( uniform 4-component vector of int) +0:14 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:14 Constant: +0:14 1 (const uint) +0:16 Negate conditional ( temp bool) +0:16 Convert float to bool ( temp bool) +0:16 fval: direct index for structure ( uniform float) +0:16 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:16 Constant: +0:16 2 (const uint) +0:17 Negate conditional ( temp 4-component vector of bool) +0:17 Convert float to bool ( temp 4-component vector of bool) +0:17 fval4: direct index for structure ( uniform 4-component vector of float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:17 Constant: +0:17 3 (const uint) +0:19 Test condition and select ( temp void) +0:19 Condition +0:19 Convert int to bool ( temp bool) +0:19 ival: direct index for structure ( uniform int) +0:19 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:19 Constant: +0:19 0 (const uint) +0:19 true case is null +0:20 Test condition and select ( temp void) +0:20 Condition +0:20 Convert float to bool ( temp bool) +0:20 fval: direct index for structure ( uniform float) +0:20 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:20 Constant: +0:20 2 (const uint) +0:20 true case is null +0:21 Test condition and select ( temp void) +0:21 Condition +0:21 Negate conditional ( temp bool) +0:21 Convert int to bool ( temp bool) +0:21 ival: direct index for structure ( uniform int) +0:21 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:21 Constant: +0:21 0 (const uint) +0:21 true case is null +0:22 Test condition and select ( temp void) +0:22 Condition +0:22 Negate conditional ( temp bool) +0:22 Convert float to bool ( temp bool) +0:22 fval: direct index for structure ( uniform float) +0:22 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:22 Constant: +0:22 2 (const uint) +0:22 true case is null +0:25 move second child to first child ( temp 4-component vector of float) +0:25 Color: direct index for structure ( temp 4-component vector of float) +0:25 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 1.000000 +0:25 1.000000 +0:25 1.000000 +0:25 1.000000 +0:26 Branch: Return with expression +0:26 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:12 Color: direct index for structure ( temp 4-component vector of float) +0:12 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:12 Constant: +0:12 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:12 Function Parameters: +0:? Sequence +0:13 Negate conditional ( temp bool) +0:13 Convert int to bool ( temp bool) +0:13 ival: direct index for structure ( uniform int) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:13 Constant: +0:13 0 (const uint) +0:14 Negate conditional ( temp 4-component vector of bool) +0:14 Convert int to bool ( temp 4-component vector of bool) +0:14 ival4: direct index for structure ( uniform 4-component vector of int) +0:14 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:14 Constant: +0:14 1 (const uint) +0:16 Negate conditional ( temp bool) +0:16 Convert float to bool ( temp bool) +0:16 fval: direct index for structure ( uniform float) +0:16 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:16 Constant: +0:16 2 (const uint) +0:17 Negate conditional ( temp 4-component vector of bool) +0:17 Convert float to bool ( temp 4-component vector of bool) +0:17 fval4: direct index for structure ( uniform 4-component vector of float) +0:17 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:17 Constant: +0:17 3 (const uint) +0:19 Test condition and select ( temp void) +0:19 Condition +0:19 Convert int to bool ( temp bool) +0:19 ival: direct index for structure ( uniform int) +0:19 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:19 Constant: +0:19 0 (const uint) +0:19 true case is null +0:20 Test condition and select ( temp void) +0:20 Condition +0:20 Convert float to bool ( temp bool) +0:20 fval: direct index for structure ( uniform float) +0:20 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:20 Constant: +0:20 2 (const uint) +0:20 true case is null +0:21 Test condition and select ( temp void) +0:21 Condition +0:21 Negate conditional ( temp bool) +0:21 Convert int to bool ( temp bool) +0:21 ival: direct index for structure ( uniform int) +0:21 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:21 Constant: +0:21 0 (const uint) +0:21 true case is null +0:22 Test condition and select ( temp void) +0:22 Condition +0:22 Negate conditional ( temp bool) +0:22 Convert float to bool ( temp bool) +0:22 fval: direct index for structure ( uniform float) +0:22 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:22 Constant: +0:22 2 (const uint) +0:22 true case is null +0:25 move second child to first child ( temp 4-component vector of float) +0:25 Color: direct index for structure ( temp 4-component vector of float) +0:25 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 1.000000 +0:25 1.000000 +0:25 1.000000 +0:25 1.000000 +0:26 Branch: Return with expression +0:26 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:12 Color: direct index for structure ( temp 4-component vector of float) +0:12 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:12 Constant: +0:12 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 84 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 81 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + Name 10 "@main(" + Name 14 "$Global" + MemberName 14($Global) 0 "ival" + MemberName 14($Global) 1 "ival4" + MemberName 14($Global) 2 "fval" + MemberName 14($Global) 3 "fval4" + Name 16 "" + Name 72 "psout" + Name 81 "@entryPointOutput.Color" + MemberDecorate 14($Global) 0 Offset 0 + MemberDecorate 14($Global) 1 Offset 16 + MemberDecorate 14($Global) 2 Offset 32 + MemberDecorate 14($Global) 3 Offset 48 + Decorate 14($Global) Block + Decorate 16 DescriptorSet 0 + Decorate 81(@entryPointOutput.Color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeInt 32 1 + 13: TypeVector 12(int) 4 + 14($Global): TypeStruct 12(int) 13(ivec4) 6(float) 7(fvec4) + 15: TypePointer Uniform 14($Global) + 16: 15(ptr) Variable Uniform + 17: 12(int) Constant 0 + 18: TypePointer Uniform 12(int) + 21: TypeBool + 22: TypeInt 32 0 + 23: 22(int) Constant 0 + 26: 12(int) Constant 1 + 27: TypePointer Uniform 13(ivec4) + 30: TypeVector 21(bool) 4 + 31: TypeVector 22(int) 4 + 32: 31(ivec4) ConstantComposite 23 23 23 23 + 35: 12(int) Constant 2 + 36: TypePointer Uniform 6(float) + 39: 6(float) Constant 0 + 42: 12(int) Constant 3 + 43: TypePointer Uniform 7(fvec4) + 46: 7(fvec4) ConstantComposite 39 39 39 39 + 71: TypePointer Function 8(PS_OUTPUT) + 73: 6(float) Constant 1065353216 + 74: 7(fvec4) ConstantComposite 73 73 73 73 + 75: TypePointer Function 7(fvec4) + 80: TypePointer Output 7(fvec4) +81(@entryPointOutput.Color): 80(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 82:8(PS_OUTPUT) FunctionCall 10(@main() + 83: 7(fvec4) CompositeExtract 82 0 + Store 81(@entryPointOutput.Color) 83 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 72(psout): 71(ptr) Variable Function + 19: 18(ptr) AccessChain 16 17 + 20: 12(int) Load 19 + 24: 21(bool) INotEqual 20 23 + 25: 21(bool) LogicalNot 24 + 28: 27(ptr) AccessChain 16 26 + 29: 13(ivec4) Load 28 + 33: 30(bvec4) INotEqual 29 32 + 34: 30(bvec4) LogicalNot 33 + 37: 36(ptr) AccessChain 16 35 + 38: 6(float) Load 37 + 40: 21(bool) FOrdNotEqual 38 39 + 41: 21(bool) LogicalNot 40 + 44: 43(ptr) AccessChain 16 42 + 45: 7(fvec4) Load 44 + 47: 30(bvec4) FOrdNotEqual 45 46 + 48: 30(bvec4) LogicalNot 47 + 49: 18(ptr) AccessChain 16 17 + 50: 12(int) Load 49 + 51: 21(bool) INotEqual 50 23 + SelectionMerge 53 None + BranchConditional 51 52 53 + 52: Label + Branch 53 + 53: Label + 54: 36(ptr) AccessChain 16 35 + 55: 6(float) Load 54 + 56: 21(bool) FOrdNotEqual 55 39 + SelectionMerge 58 None + BranchConditional 56 57 58 + 57: Label + Branch 58 + 58: Label + 59: 18(ptr) AccessChain 16 17 + 60: 12(int) Load 59 + 61: 21(bool) INotEqual 60 23 + 62: 21(bool) LogicalNot 61 + SelectionMerge 64 None + BranchConditional 62 63 64 + 63: Label + Branch 64 + 64: Label + 65: 36(ptr) AccessChain 16 35 + 66: 6(float) Load 65 + 67: 21(bool) FOrdNotEqual 66 39 + 68: 21(bool) LogicalNot 67 + SelectionMerge 70 None + BranchConditional 68 69 70 + 69: Label + Branch 70 + 70: Label + 76: 75(ptr) AccessChain 72(psout) 17 + Store 76 74 + 77:8(PS_OUTPUT) Load 72(psout) + ReturnValue 77 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.logicalConvert.frag.out b/deps/glslang/Test/baseResults/hlsl.logicalConvert.frag.out new file mode 100644 index 00000000..6c595f8e --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.logicalConvert.frag.out @@ -0,0 +1,342 @@ +hlsl.logicalConvert.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @main( ( temp 4-component vector of float) +0:2 Function Parameters: +0:? Sequence +0:3 Test condition and select ( temp void) +0:3 Condition +0:3 Constant: +0:3 false (const bool) +0:3 true case +0:4 Branch: Return with expression +0:4 Constant: +0:4 0.000000 +0:4 0.000000 +0:4 0.000000 +0:4 0.000000 +0:5 Test condition and select ( temp void) +0:5 Condition +0:5 Constant: +0:5 false (const bool) +0:5 true case +0:6 Branch: Return with expression +0:6 Constant: +0:6 0.000000 +0:6 0.000000 +0:6 0.000000 +0:6 0.000000 +0:7 Test condition and select ( temp void) +0:7 Condition +0:7 Constant: +0:7 true (const bool) +0:7 true case +0:8 Branch: Return with expression +0:8 Constant: +0:8 0.000000 +0:8 0.000000 +0:8 0.000000 +0:8 0.000000 +0:9 Test condition and select ( temp void) +0:9 Condition +0:9 Constant: +0:9 true (const bool) +0:9 true case +0:10 Branch: Return with expression +0:10 Constant: +0:10 0.000000 +0:10 0.000000 +0:10 0.000000 +0:10 0.000000 +0:11 Test condition and select ( temp void) +0:11 Condition +0:11 Constant: +0:11 false (const bool) +0:11 true case +0:12 Branch: Return with expression +0:12 Constant: +0:12 0.000000 +0:12 0.000000 +0:12 0.000000 +0:12 0.000000 +0:13 Test condition and select ( temp void) +0:13 Condition +0:13 Constant: +0:13 false (const bool) +0:13 true case +0:14 Branch: Return with expression +0:14 Constant: +0:14 0.000000 +0:14 0.000000 +0:14 0.000000 +0:14 0.000000 +0:15 Test condition and select ( temp void) +0:15 Condition +0:15 Constant: +0:15 true (const bool) +0:15 true case +0:16 Branch: Return with expression +0:16 Constant: +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:17 Test condition and select ( temp void) +0:17 Condition +0:17 Constant: +0:17 false (const bool) +0:17 true case +0:18 Branch: Return with expression +0:18 Constant: +0:18 0.000000 +0:18 0.000000 +0:18 0.000000 +0:18 0.000000 +0:19 Test condition and select ( temp void) +0:19 Condition +0:19 Constant: +0:19 true (const bool) +0:19 true case +0:20 Branch: Return with expression +0:20 Constant: +0:20 0.000000 +0:20 0.000000 +0:20 0.000000 +0:20 0.000000 +0:21 Test condition and select ( temp void) +0:21 Condition +0:21 Constant: +0:21 true (const bool) +0:21 true case +0:22 Branch: Return with expression +0:22 Constant: +0:22 0.000000 +0:22 0.000000 +0:22 0.000000 +0:22 0.000000 +0:2 Function Definition: main( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @main( ( temp 4-component vector of float) +0:2 Function Parameters: +0:? Sequence +0:3 Test condition and select ( temp void) +0:3 Condition +0:3 Constant: +0:3 false (const bool) +0:3 true case +0:4 Branch: Return with expression +0:4 Constant: +0:4 0.000000 +0:4 0.000000 +0:4 0.000000 +0:4 0.000000 +0:5 Test condition and select ( temp void) +0:5 Condition +0:5 Constant: +0:5 false (const bool) +0:5 true case +0:6 Branch: Return with expression +0:6 Constant: +0:6 0.000000 +0:6 0.000000 +0:6 0.000000 +0:6 0.000000 +0:7 Test condition and select ( temp void) +0:7 Condition +0:7 Constant: +0:7 true (const bool) +0:7 true case +0:8 Branch: Return with expression +0:8 Constant: +0:8 0.000000 +0:8 0.000000 +0:8 0.000000 +0:8 0.000000 +0:9 Test condition and select ( temp void) +0:9 Condition +0:9 Constant: +0:9 true (const bool) +0:9 true case +0:10 Branch: Return with expression +0:10 Constant: +0:10 0.000000 +0:10 0.000000 +0:10 0.000000 +0:10 0.000000 +0:11 Test condition and select ( temp void) +0:11 Condition +0:11 Constant: +0:11 false (const bool) +0:11 true case +0:12 Branch: Return with expression +0:12 Constant: +0:12 0.000000 +0:12 0.000000 +0:12 0.000000 +0:12 0.000000 +0:13 Test condition and select ( temp void) +0:13 Condition +0:13 Constant: +0:13 false (const bool) +0:13 true case +0:14 Branch: Return with expression +0:14 Constant: +0:14 0.000000 +0:14 0.000000 +0:14 0.000000 +0:14 0.000000 +0:15 Test condition and select ( temp void) +0:15 Condition +0:15 Constant: +0:15 true (const bool) +0:15 true case +0:16 Branch: Return with expression +0:16 Constant: +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:17 Test condition and select ( temp void) +0:17 Condition +0:17 Constant: +0:17 false (const bool) +0:17 true case +0:18 Branch: Return with expression +0:18 Constant: +0:18 0.000000 +0:18 0.000000 +0:18 0.000000 +0:18 0.000000 +0:19 Test condition and select ( temp void) +0:19 Condition +0:19 Constant: +0:19 true (const bool) +0:19 true case +0:20 Branch: Return with expression +0:20 Constant: +0:20 0.000000 +0:20 0.000000 +0:20 0.000000 +0:20 0.000000 +0:21 Test condition and select ( temp void) +0:21 Condition +0:21 Constant: +0:21 true (const bool) +0:21 true case +0:22 Branch: Return with expression +0:22 Constant: +0:22 0.000000 +0:22 0.000000 +0:22 0.000000 +0:22 0.000000 +0:2 Function Definition: main( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 50 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 48 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 48 "@entryPointOutput" + Decorate 48(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeBool + 12: 11(bool) ConstantFalse + 15: 6(float) Constant 0 + 16: 7(fvec4) ConstantComposite 15 15 15 15 + 21: 11(bool) ConstantTrue + 47: TypePointer Output 7(fvec4) +48(@entryPointOutput): 47(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 49: 7(fvec4) FunctionCall 9(@main() + Store 48(@entryPointOutput) 49 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + SelectionMerge 14 None + BranchConditional 12 13 14 + 13: Label + ReturnValue 16 + 14: Label + SelectionMerge 19 None + BranchConditional 12 18 19 + 18: Label + ReturnValue 16 + 19: Label + SelectionMerge 23 None + BranchConditional 21 22 23 + 22: Label + ReturnValue 16 + 23: Label + SelectionMerge 26 None + BranchConditional 21 25 26 + 25: Label + ReturnValue 16 + 26: Label + SelectionMerge 29 None + BranchConditional 12 28 29 + 28: Label + ReturnValue 16 + 29: Label + SelectionMerge 32 None + BranchConditional 12 31 32 + 31: Label + ReturnValue 16 + 32: Label + SelectionMerge 35 None + BranchConditional 21 34 35 + 34: Label + ReturnValue 16 + 35: Label + SelectionMerge 38 None + BranchConditional 12 37 38 + 37: Label + ReturnValue 16 + 38: Label + SelectionMerge 41 None + BranchConditional 21 40 41 + 40: Label + ReturnValue 16 + 41: Label + SelectionMerge 44 None + BranchConditional 21 43 44 + 43: Label + ReturnValue 16 + 44: Label + 46: 7(fvec4) Undef + ReturnValue 46 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.loopattr.frag.out b/deps/glslang/Test/baseResults/hlsl.loopattr.frag.out new file mode 100644 index 00000000..cc0073ac --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.loopattr.frag.out @@ -0,0 +1,233 @@ +hlsl.loopattr.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: @main( ( temp 4-component vector of float) +0:3 Function Parameters: +0:? Sequence +0:5 Sequence +0:5 move second child to first child ( temp int) +0:5 'x' ( temp int) +0:5 Constant: +0:5 0 (const int) +0:5 Loop with condition tested first: Unroll +0:5 Loop Condition +0:5 Compare Less Than ( temp bool) +0:5 'x' ( temp int) +0:5 Constant: +0:5 5 (const int) +0:5 No loop body +0:5 Loop Terminal Expression +0:5 Pre-Increment ( temp int) +0:5 'x' ( temp int) +0:8 Sequence +0:8 move second child to first child ( temp int) +0:8 'y' ( temp int) +0:8 Constant: +0:8 0 (const int) +0:8 Loop with condition tested first: DontUnroll +0:8 Loop Condition +0:8 Compare Less Than ( temp bool) +0:8 'y' ( temp int) +0:8 Constant: +0:8 5 (const int) +0:8 No loop body +0:8 Loop Terminal Expression +0:8 Pre-Increment ( temp int) +0:8 'y' ( temp int) +0:11 Sequence +0:11 move second child to first child ( temp int) +0:11 'z' ( temp int) +0:11 Constant: +0:11 0 (const int) +0:11 Loop with condition tested first +0:11 Loop Condition +0:11 Compare Less Than ( temp bool) +0:11 'z' ( temp int) +0:11 Constant: +0:11 5 (const int) +0:11 No loop body +0:11 Loop Terminal Expression +0:11 Pre-Increment ( temp int) +0:11 'z' ( temp int) +0:13 Branch: Return with expression +0:13 Constant: +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:3 Function Definition: main( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:3 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:3 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: @main( ( temp 4-component vector of float) +0:3 Function Parameters: +0:? Sequence +0:5 Sequence +0:5 move second child to first child ( temp int) +0:5 'x' ( temp int) +0:5 Constant: +0:5 0 (const int) +0:5 Loop with condition tested first: Unroll +0:5 Loop Condition +0:5 Compare Less Than ( temp bool) +0:5 'x' ( temp int) +0:5 Constant: +0:5 5 (const int) +0:5 No loop body +0:5 Loop Terminal Expression +0:5 Pre-Increment ( temp int) +0:5 'x' ( temp int) +0:8 Sequence +0:8 move second child to first child ( temp int) +0:8 'y' ( temp int) +0:8 Constant: +0:8 0 (const int) +0:8 Loop with condition tested first: DontUnroll +0:8 Loop Condition +0:8 Compare Less Than ( temp bool) +0:8 'y' ( temp int) +0:8 Constant: +0:8 5 (const int) +0:8 No loop body +0:8 Loop Terminal Expression +0:8 Pre-Increment ( temp int) +0:8 'y' ( temp int) +0:11 Sequence +0:11 move second child to first child ( temp int) +0:11 'z' ( temp int) +0:11 Constant: +0:11 0 (const int) +0:11 Loop with condition tested first +0:11 Loop Condition +0:11 Compare Less Than ( temp bool) +0:11 'z' ( temp int) +0:11 Constant: +0:11 5 (const int) +0:11 No loop body +0:11 Loop Terminal Expression +0:11 Pre-Increment ( temp int) +0:11 'z' ( temp int) +0:13 Branch: Return with expression +0:13 Constant: +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:3 Function Definition: main( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:3 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:3 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 54 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 52 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 13 "x" + Name 27 "y" + Name 37 "z" + Name 52 "@entryPointOutput" + Decorate 52(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeInt 32 1 + 12: TypePointer Function 11(int) + 14: 11(int) Constant 0 + 21: 11(int) Constant 5 + 22: TypeBool + 25: 11(int) Constant 1 + 47: 6(float) Constant 0 + 48: 7(fvec4) ConstantComposite 47 47 47 47 + 51: TypePointer Output 7(fvec4) +52(@entryPointOutput): 51(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 53: 7(fvec4) FunctionCall 9(@main() + Store 52(@entryPointOutput) 53 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 13(x): 12(ptr) Variable Function + 27(y): 12(ptr) Variable Function + 37(z): 12(ptr) Variable Function + Store 13(x) 14 + Branch 15 + 15: Label + LoopMerge 17 18 Unroll + Branch 19 + 19: Label + 20: 11(int) Load 13(x) + 23: 22(bool) SLessThan 20 21 + BranchConditional 23 16 17 + 16: Label + Branch 18 + 18: Label + 24: 11(int) Load 13(x) + 26: 11(int) IAdd 24 25 + Store 13(x) 26 + Branch 15 + 17: Label + Store 27(y) 14 + Branch 28 + 28: Label + LoopMerge 30 31 DontUnroll + Branch 32 + 32: Label + 33: 11(int) Load 27(y) + 34: 22(bool) SLessThan 33 21 + BranchConditional 34 29 30 + 29: Label + Branch 31 + 31: Label + 35: 11(int) Load 27(y) + 36: 11(int) IAdd 35 25 + Store 27(y) 36 + Branch 28 + 30: Label + Store 37(z) 14 + Branch 38 + 38: Label + LoopMerge 40 41 None + Branch 42 + 42: Label + 43: 11(int) Load 37(z) + 44: 22(bool) SLessThan 43 21 + BranchConditional 44 39 40 + 39: Label + Branch 41 + 41: Label + 45: 11(int) Load 37(z) + 46: 11(int) IAdd 45 25 + Store 37(z) 46 + Branch 38 + 40: Label + ReturnValue 48 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.matNx1.frag.out b/deps/glslang/Test/baseResults/hlsl.matNx1.frag.out new file mode 100644 index 00000000..276d4c24 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.matNx1.frag.out @@ -0,0 +1,279 @@ +hlsl.matNx1.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: TestMatNx1( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp 1X1 matrix of float) +0:13 'r00' ( temp 1X1 matrix of float) +0:13 transpose ( temp 1X1 matrix of float) +0:13 'f1x1' ( temp 1X1 matrix of float) +0:14 Sequence +0:14 move second child to first child ( temp 1X2 matrix of float) +0:14 'r01' ( temp 1X2 matrix of float) +0:14 transpose ( temp 1X2 matrix of float) +0:14 'f2x1' ( temp 2X1 matrix of float) +0:15 Sequence +0:15 move second child to first child ( temp 1X3 matrix of float) +0:15 'r02' ( temp 1X3 matrix of float) +0:15 transpose ( temp 1X3 matrix of float) +0:15 'f3x1' ( temp 3X1 matrix of float) +0:16 Sequence +0:16 move second child to first child ( temp 1X4 matrix of float) +0:16 'r03' ( temp 1X4 matrix of float) +0:16 transpose ( temp 1X4 matrix of float) +0:16 'f4x1' ( temp 4X1 matrix of float) +0:18 Sequence +0:18 move second child to first child ( temp 1X1 matrix of float) +0:18 'r10' ( temp 1X1 matrix of float) +0:18 transpose ( temp 1X1 matrix of float) +0:18 'f1x1' ( temp 1X1 matrix of float) +0:19 Sequence +0:19 move second child to first child ( temp 2X1 matrix of float) +0:19 'r11' ( temp 2X1 matrix of float) +0:19 transpose ( temp 2X1 matrix of float) +0:19 'f1x2' ( temp 1X2 matrix of float) +0:20 Sequence +0:20 move second child to first child ( temp 3X1 matrix of float) +0:20 'r12' ( temp 3X1 matrix of float) +0:20 transpose ( temp 3X1 matrix of float) +0:20 'f1x3' ( temp 1X3 matrix of float) +0:21 Sequence +0:21 move second child to first child ( temp 4X1 matrix of float) +0:21 'r13' ( temp 4X1 matrix of float) +0:21 transpose ( temp 4X1 matrix of float) +0:21 'f1x4' ( temp 1X4 matrix of float) +0:27 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:27 Function Parameters: +0:? Sequence +0:29 move second child to first child ( temp 4-component vector of float) +0:29 color: direct index for structure ( temp 4-component vector of float) +0:29 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 1.000000 +0:29 1.000000 +0:29 1.000000 +0:29 1.000000 +0:30 Branch: Return with expression +0:30 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:27 Function Definition: main( ( temp void) +0:27 Function Parameters: +0:? Sequence +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:27 color: direct index for structure ( temp 4-component vector of float) +0:27 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:27 Constant: +0:27 0 (const int) +0:? Linker Objects +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: TestMatNx1( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp 1X1 matrix of float) +0:13 'r00' ( temp 1X1 matrix of float) +0:13 transpose ( temp 1X1 matrix of float) +0:13 'f1x1' ( temp 1X1 matrix of float) +0:14 Sequence +0:14 move second child to first child ( temp 1X2 matrix of float) +0:14 'r01' ( temp 1X2 matrix of float) +0:14 transpose ( temp 1X2 matrix of float) +0:14 'f2x1' ( temp 2X1 matrix of float) +0:15 Sequence +0:15 move second child to first child ( temp 1X3 matrix of float) +0:15 'r02' ( temp 1X3 matrix of float) +0:15 transpose ( temp 1X3 matrix of float) +0:15 'f3x1' ( temp 3X1 matrix of float) +0:16 Sequence +0:16 move second child to first child ( temp 1X4 matrix of float) +0:16 'r03' ( temp 1X4 matrix of float) +0:16 transpose ( temp 1X4 matrix of float) +0:16 'f4x1' ( temp 4X1 matrix of float) +0:18 Sequence +0:18 move second child to first child ( temp 1X1 matrix of float) +0:18 'r10' ( temp 1X1 matrix of float) +0:18 transpose ( temp 1X1 matrix of float) +0:18 'f1x1' ( temp 1X1 matrix of float) +0:19 Sequence +0:19 move second child to first child ( temp 2X1 matrix of float) +0:19 'r11' ( temp 2X1 matrix of float) +0:19 transpose ( temp 2X1 matrix of float) +0:19 'f1x2' ( temp 1X2 matrix of float) +0:20 Sequence +0:20 move second child to first child ( temp 3X1 matrix of float) +0:20 'r12' ( temp 3X1 matrix of float) +0:20 transpose ( temp 3X1 matrix of float) +0:20 'f1x3' ( temp 1X3 matrix of float) +0:21 Sequence +0:21 move second child to first child ( temp 4X1 matrix of float) +0:21 'r13' ( temp 4X1 matrix of float) +0:21 transpose ( temp 4X1 matrix of float) +0:21 'f1x4' ( temp 1X4 matrix of float) +0:27 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:27 Function Parameters: +0:? Sequence +0:29 move second child to first child ( temp 4-component vector of float) +0:29 color: direct index for structure ( temp 4-component vector of float) +0:29 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 1.000000 +0:29 1.000000 +0:29 1.000000 +0:29 1.000000 +0:30 Branch: Return with expression +0:30 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:27 Function Definition: main( ( temp void) +0:27 Function Parameters: +0:? Sequence +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:27 color: direct index for structure ( temp 4-component vector of float) +0:27 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:27 Constant: +0:27 0 (const int) +0:? Linker Objects +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: Illegal number of components (1) for TypeVector + %v1float = OpTypeVector %float 1 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 77 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 74 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 6 "TestMatNx1(" + Name 10 "PS_OUTPUT" + MemberName 10(PS_OUTPUT) 0 "color" + Name 12 "@main(" + Name 17 "r00" + Name 18 "f1x1" + Name 24 "r01" + Name 27 "f2x1" + Name 33 "r02" + Name 36 "f3x1" + Name 41 "r03" + Name 44 "f4x1" + Name 47 "r10" + Name 50 "r11" + Name 51 "f1x2" + Name 54 "r12" + Name 55 "f1x3" + Name 58 "r13" + Name 59 "f1x4" + Name 63 "ps_output" + Name 74 "@entryPointOutput.color" + Decorate 74(@entryPointOutput.color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10(PS_OUTPUT): TypeStruct 9(fvec4) + 11: TypeFunction 10(PS_OUTPUT) + 14: TypeVector 8(float) 1 + 15: TypeMatrix 14(fvec) 1 + 16: TypePointer Function 15 + 21: TypeVector 8(float) 2 + 22: TypeMatrix 21(fvec2) 1 + 23: TypePointer Function 22 + 25: TypeMatrix 14(fvec) 2 + 26: TypePointer Function 25 + 30: TypeVector 8(float) 3 + 31: TypeMatrix 30(fvec3) 1 + 32: TypePointer Function 31 + 34: TypeMatrix 14(fvec) 3 + 35: TypePointer Function 34 + 39: TypeMatrix 9(fvec4) 1 + 40: TypePointer Function 39 + 42: TypeMatrix 14(fvec) 4 + 43: TypePointer Function 42 + 62: TypePointer Function 10(PS_OUTPUT) + 64: TypeInt 32 1 + 65: 64(int) Constant 0 + 66: 8(float) Constant 1065353216 + 67: 9(fvec4) ConstantComposite 66 66 66 66 + 68: TypePointer Function 9(fvec4) + 73: TypePointer Output 9(fvec4) +74(@entryPointOutput.color): 73(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 75:10(PS_OUTPUT) FunctionCall 12(@main() + 76: 9(fvec4) CompositeExtract 75 0 + Store 74(@entryPointOutput.color) 76 + Return + FunctionEnd + 6(TestMatNx1(): 2 Function None 3 + 7: Label + 17(r00): 16(ptr) Variable Function + 18(f1x1): 16(ptr) Variable Function + 24(r01): 23(ptr) Variable Function + 27(f2x1): 26(ptr) Variable Function + 33(r02): 32(ptr) Variable Function + 36(f3x1): 35(ptr) Variable Function + 41(r03): 40(ptr) Variable Function + 44(f4x1): 43(ptr) Variable Function + 47(r10): 16(ptr) Variable Function + 50(r11): 26(ptr) Variable Function + 51(f1x2): 23(ptr) Variable Function + 54(r12): 35(ptr) Variable Function + 55(f1x3): 32(ptr) Variable Function + 58(r13): 43(ptr) Variable Function + 59(f1x4): 40(ptr) Variable Function + 19: 15 Load 18(f1x1) + 20: 15 Transpose 19 + Store 17(r00) 20 + 28: 25 Load 27(f2x1) + 29: 22 Transpose 28 + Store 24(r01) 29 + 37: 34 Load 36(f3x1) + 38: 31 Transpose 37 + Store 33(r02) 38 + 45: 42 Load 44(f4x1) + 46: 39 Transpose 45 + Store 41(r03) 46 + 48: 15 Load 18(f1x1) + 49: 15 Transpose 48 + Store 47(r10) 49 + 52: 22 Load 51(f1x2) + 53: 25 Transpose 52 + Store 50(r11) 53 + 56: 31 Load 55(f1x3) + 57: 34 Transpose 56 + Store 54(r12) 57 + 60: 39 Load 59(f1x4) + 61: 42 Transpose 60 + Store 58(r13) 61 + Return + FunctionEnd + 12(@main():10(PS_OUTPUT) Function None 11 + 13: Label + 63(ps_output): 62(ptr) Variable Function + 69: 68(ptr) AccessChain 63(ps_output) 65 + Store 69 67 + 70:10(PS_OUTPUT) Load 63(ps_output) + ReturnValue 70 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.matType.bool.frag.out b/deps/glslang/Test/baseResults/hlsl.matType.bool.frag.out new file mode 100644 index 00000000..900c60fc --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.matType.bool.frag.out @@ -0,0 +1,437 @@ +hlsl.matType.bool.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: TestBoolMatTypes( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:25 Sequence +0:25 move second child to first child ( temp 1X1 matrix of bool) +0:25 'r00' ( temp 1X1 matrix of bool) +0:25 transpose ( temp 1X1 matrix of bool) +0:25 'b1x1' ( temp 1X1 matrix of bool) +0:26 Sequence +0:26 move second child to first child ( temp 1X2 matrix of bool) +0:26 'r01' ( temp 1X2 matrix of bool) +0:26 transpose ( temp 1X2 matrix of bool) +0:26 'b2x1' ( temp 2X1 matrix of bool) +0:27 Sequence +0:27 move second child to first child ( temp 1X3 matrix of bool) +0:27 'r02' ( temp 1X3 matrix of bool) +0:27 transpose ( temp 1X3 matrix of bool) +0:27 'b3x1' ( temp 3X1 matrix of bool) +0:28 Sequence +0:28 move second child to first child ( temp 1X4 matrix of bool) +0:28 'r03' ( temp 1X4 matrix of bool) +0:28 transpose ( temp 1X4 matrix of bool) +0:28 'b4x1' ( temp 4X1 matrix of bool) +0:30 Sequence +0:30 move second child to first child ( temp 2X1 matrix of bool) +0:30 'r10' ( temp 2X1 matrix of bool) +0:30 transpose ( temp 2X1 matrix of bool) +0:30 'b1x2' ( temp 1X2 matrix of bool) +0:31 Sequence +0:31 move second child to first child ( temp 2X2 matrix of bool) +0:31 'r11' ( temp 2X2 matrix of bool) +0:31 transpose ( temp 2X2 matrix of bool) +0:31 'b2x2' ( temp 2X2 matrix of bool) +0:32 Sequence +0:32 move second child to first child ( temp 2X3 matrix of bool) +0:32 'r12' ( temp 2X3 matrix of bool) +0:32 transpose ( temp 2X3 matrix of bool) +0:32 'b3x2' ( temp 3X2 matrix of bool) +0:33 Sequence +0:33 move second child to first child ( temp 2X4 matrix of bool) +0:33 'r13' ( temp 2X4 matrix of bool) +0:33 transpose ( temp 2X4 matrix of bool) +0:33 'b4x2' ( temp 4X2 matrix of bool) +0:35 Sequence +0:35 move second child to first child ( temp 3X1 matrix of bool) +0:35 'r20' ( temp 3X1 matrix of bool) +0:35 transpose ( temp 3X1 matrix of bool) +0:35 'b1x3' ( temp 1X3 matrix of bool) +0:36 Sequence +0:36 move second child to first child ( temp 3X2 matrix of bool) +0:36 'r21' ( temp 3X2 matrix of bool) +0:36 transpose ( temp 3X2 matrix of bool) +0:36 'b2x3' ( temp 2X3 matrix of bool) +0:37 Sequence +0:37 move second child to first child ( temp 3X3 matrix of bool) +0:37 'r22' ( temp 3X3 matrix of bool) +0:37 transpose ( temp 3X3 matrix of bool) +0:37 'b3x3' ( temp 3X3 matrix of bool) +0:38 Sequence +0:38 move second child to first child ( temp 3X4 matrix of bool) +0:38 'r23' ( temp 3X4 matrix of bool) +0:38 transpose ( temp 3X4 matrix of bool) +0:38 'b4x3' ( temp 4X3 matrix of bool) +0:40 Sequence +0:40 move second child to first child ( temp 4X1 matrix of bool) +0:40 'r30' ( temp 4X1 matrix of bool) +0:40 transpose ( temp 4X1 matrix of bool) +0:40 'b1x4' ( temp 1X4 matrix of bool) +0:41 Sequence +0:41 move second child to first child ( temp 4X2 matrix of bool) +0:41 'r31' ( temp 4X2 matrix of bool) +0:41 transpose ( temp 4X2 matrix of bool) +0:41 'b2x4' ( temp 2X4 matrix of bool) +0:42 Sequence +0:42 move second child to first child ( temp 4X3 matrix of bool) +0:42 'r32' ( temp 4X3 matrix of bool) +0:42 transpose ( temp 4X3 matrix of bool) +0:42 'b3x4' ( temp 3X4 matrix of bool) +0:43 Sequence +0:43 move second child to first child ( temp 4X4 matrix of bool) +0:43 'r33' ( temp 4X4 matrix of bool) +0:43 transpose ( temp 4X4 matrix of bool) +0:43 'b4x4' ( temp 4X4 matrix of bool) +0:49 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:49 Function Parameters: +0:? Sequence +0:51 move second child to first child ( temp 4-component vector of float) +0:51 color: direct index for structure ( temp 4-component vector of float) +0:51 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:51 Constant: +0:51 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:52 Branch: Return with expression +0:52 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:49 Function Definition: main( ( temp void) +0:49 Function Parameters: +0:? Sequence +0:49 Sequence +0:49 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:49 color: direct index for structure ( temp 4-component vector of float) +0:49 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:49 Constant: +0:49 0 (const int) +0:? Linker Objects +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: TestBoolMatTypes( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:25 Sequence +0:25 move second child to first child ( temp 1X1 matrix of bool) +0:25 'r00' ( temp 1X1 matrix of bool) +0:25 transpose ( temp 1X1 matrix of bool) +0:25 'b1x1' ( temp 1X1 matrix of bool) +0:26 Sequence +0:26 move second child to first child ( temp 1X2 matrix of bool) +0:26 'r01' ( temp 1X2 matrix of bool) +0:26 transpose ( temp 1X2 matrix of bool) +0:26 'b2x1' ( temp 2X1 matrix of bool) +0:27 Sequence +0:27 move second child to first child ( temp 1X3 matrix of bool) +0:27 'r02' ( temp 1X3 matrix of bool) +0:27 transpose ( temp 1X3 matrix of bool) +0:27 'b3x1' ( temp 3X1 matrix of bool) +0:28 Sequence +0:28 move second child to first child ( temp 1X4 matrix of bool) +0:28 'r03' ( temp 1X4 matrix of bool) +0:28 transpose ( temp 1X4 matrix of bool) +0:28 'b4x1' ( temp 4X1 matrix of bool) +0:30 Sequence +0:30 move second child to first child ( temp 2X1 matrix of bool) +0:30 'r10' ( temp 2X1 matrix of bool) +0:30 transpose ( temp 2X1 matrix of bool) +0:30 'b1x2' ( temp 1X2 matrix of bool) +0:31 Sequence +0:31 move second child to first child ( temp 2X2 matrix of bool) +0:31 'r11' ( temp 2X2 matrix of bool) +0:31 transpose ( temp 2X2 matrix of bool) +0:31 'b2x2' ( temp 2X2 matrix of bool) +0:32 Sequence +0:32 move second child to first child ( temp 2X3 matrix of bool) +0:32 'r12' ( temp 2X3 matrix of bool) +0:32 transpose ( temp 2X3 matrix of bool) +0:32 'b3x2' ( temp 3X2 matrix of bool) +0:33 Sequence +0:33 move second child to first child ( temp 2X4 matrix of bool) +0:33 'r13' ( temp 2X4 matrix of bool) +0:33 transpose ( temp 2X4 matrix of bool) +0:33 'b4x2' ( temp 4X2 matrix of bool) +0:35 Sequence +0:35 move second child to first child ( temp 3X1 matrix of bool) +0:35 'r20' ( temp 3X1 matrix of bool) +0:35 transpose ( temp 3X1 matrix of bool) +0:35 'b1x3' ( temp 1X3 matrix of bool) +0:36 Sequence +0:36 move second child to first child ( temp 3X2 matrix of bool) +0:36 'r21' ( temp 3X2 matrix of bool) +0:36 transpose ( temp 3X2 matrix of bool) +0:36 'b2x3' ( temp 2X3 matrix of bool) +0:37 Sequence +0:37 move second child to first child ( temp 3X3 matrix of bool) +0:37 'r22' ( temp 3X3 matrix of bool) +0:37 transpose ( temp 3X3 matrix of bool) +0:37 'b3x3' ( temp 3X3 matrix of bool) +0:38 Sequence +0:38 move second child to first child ( temp 3X4 matrix of bool) +0:38 'r23' ( temp 3X4 matrix of bool) +0:38 transpose ( temp 3X4 matrix of bool) +0:38 'b4x3' ( temp 4X3 matrix of bool) +0:40 Sequence +0:40 move second child to first child ( temp 4X1 matrix of bool) +0:40 'r30' ( temp 4X1 matrix of bool) +0:40 transpose ( temp 4X1 matrix of bool) +0:40 'b1x4' ( temp 1X4 matrix of bool) +0:41 Sequence +0:41 move second child to first child ( temp 4X2 matrix of bool) +0:41 'r31' ( temp 4X2 matrix of bool) +0:41 transpose ( temp 4X2 matrix of bool) +0:41 'b2x4' ( temp 2X4 matrix of bool) +0:42 Sequence +0:42 move second child to first child ( temp 4X3 matrix of bool) +0:42 'r32' ( temp 4X3 matrix of bool) +0:42 transpose ( temp 4X3 matrix of bool) +0:42 'b3x4' ( temp 3X4 matrix of bool) +0:43 Sequence +0:43 move second child to first child ( temp 4X4 matrix of bool) +0:43 'r33' ( temp 4X4 matrix of bool) +0:43 transpose ( temp 4X4 matrix of bool) +0:43 'b4x4' ( temp 4X4 matrix of bool) +0:49 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:49 Function Parameters: +0:? Sequence +0:51 move second child to first child ( temp 4-component vector of float) +0:51 color: direct index for structure ( temp 4-component vector of float) +0:51 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:51 Constant: +0:51 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:52 Branch: Return with expression +0:52 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:49 Function Definition: main( ( temp void) +0:49 Function Parameters: +0:? Sequence +0:49 Sequence +0:49 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:49 color: direct index for structure ( temp 4-component vector of float) +0:49 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:49 Constant: +0:49 0 (const int) +0:? Linker Objects +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: Illegal number of components (1) for TypeVector + %v1bool = OpTypeVector %bool 1 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 130 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 127 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 6 "TestBoolMatTypes(" + Name 10 "PS_OUTPUT" + MemberName 10(PS_OUTPUT) 0 "color" + Name 12 "@main(" + Name 18 "r00" + Name 19 "b1x1" + Name 25 "r01" + Name 28 "b2x1" + Name 34 "r02" + Name 37 "b3x1" + Name 43 "r03" + Name 46 "b4x1" + Name 49 "r10" + Name 50 "b1x2" + Name 55 "r11" + Name 56 "b2x2" + Name 61 "r12" + Name 64 "b3x2" + Name 69 "r13" + Name 72 "b4x2" + Name 75 "r20" + Name 76 "b1x3" + Name 79 "r21" + Name 80 "b2x3" + Name 85 "r22" + Name 86 "b3x3" + Name 91 "r23" + Name 94 "b4x3" + Name 97 "r30" + Name 98 "b1x4" + Name 101 "r31" + Name 102 "b2x4" + Name 105 "r32" + Name 106 "b3x4" + Name 111 "r33" + Name 112 "b4x4" + Name 116 "ps_output" + Name 127 "@entryPointOutput.color" + Decorate 127(@entryPointOutput.color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10(PS_OUTPUT): TypeStruct 9(fvec4) + 11: TypeFunction 10(PS_OUTPUT) + 14: TypeBool + 15: TypeVector 14(bool) 1 + 16: TypeMatrix 15(bvec) 1 + 17: TypePointer Function 16 + 22: TypeVector 14(bool) 2 + 23: TypeMatrix 22(bvec2) 1 + 24: TypePointer Function 23 + 26: TypeMatrix 15(bvec) 2 + 27: TypePointer Function 26 + 31: TypeVector 14(bool) 3 + 32: TypeMatrix 31(bvec3) 1 + 33: TypePointer Function 32 + 35: TypeMatrix 15(bvec) 3 + 36: TypePointer Function 35 + 40: TypeVector 14(bool) 4 + 41: TypeMatrix 40(bvec4) 1 + 42: TypePointer Function 41 + 44: TypeMatrix 15(bvec) 4 + 45: TypePointer Function 44 + 53: TypeMatrix 22(bvec2) 2 + 54: TypePointer Function 53 + 59: TypeMatrix 31(bvec3) 2 + 60: TypePointer Function 59 + 62: TypeMatrix 22(bvec2) 3 + 63: TypePointer Function 62 + 67: TypeMatrix 40(bvec4) 2 + 68: TypePointer Function 67 + 70: TypeMatrix 22(bvec2) 4 + 71: TypePointer Function 70 + 83: TypeMatrix 31(bvec3) 3 + 84: TypePointer Function 83 + 89: TypeMatrix 40(bvec4) 3 + 90: TypePointer Function 89 + 92: TypeMatrix 31(bvec3) 4 + 93: TypePointer Function 92 + 109: TypeMatrix 40(bvec4) 4 + 110: TypePointer Function 109 + 115: TypePointer Function 10(PS_OUTPUT) + 117: TypeInt 32 1 + 118: 117(int) Constant 0 + 119: 8(float) Constant 0 + 120: 9(fvec4) ConstantComposite 119 119 119 119 + 121: TypePointer Function 9(fvec4) + 126: TypePointer Output 9(fvec4) +127(@entryPointOutput.color): 126(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 128:10(PS_OUTPUT) FunctionCall 12(@main() + 129: 9(fvec4) CompositeExtract 128 0 + Store 127(@entryPointOutput.color) 129 + Return + FunctionEnd +6(TestBoolMatTypes(): 2 Function None 3 + 7: Label + 18(r00): 17(ptr) Variable Function + 19(b1x1): 17(ptr) Variable Function + 25(r01): 24(ptr) Variable Function + 28(b2x1): 27(ptr) Variable Function + 34(r02): 33(ptr) Variable Function + 37(b3x1): 36(ptr) Variable Function + 43(r03): 42(ptr) Variable Function + 46(b4x1): 45(ptr) Variable Function + 49(r10): 27(ptr) Variable Function + 50(b1x2): 24(ptr) Variable Function + 55(r11): 54(ptr) Variable Function + 56(b2x2): 54(ptr) Variable Function + 61(r12): 60(ptr) Variable Function + 64(b3x2): 63(ptr) Variable Function + 69(r13): 68(ptr) Variable Function + 72(b4x2): 71(ptr) Variable Function + 75(r20): 36(ptr) Variable Function + 76(b1x3): 33(ptr) Variable Function + 79(r21): 63(ptr) Variable Function + 80(b2x3): 60(ptr) Variable Function + 85(r22): 84(ptr) Variable Function + 86(b3x3): 84(ptr) Variable Function + 91(r23): 90(ptr) Variable Function + 94(b4x3): 93(ptr) Variable Function + 97(r30): 45(ptr) Variable Function + 98(b1x4): 42(ptr) Variable Function + 101(r31): 71(ptr) Variable Function + 102(b2x4): 68(ptr) Variable Function + 105(r32): 93(ptr) Variable Function + 106(b3x4): 90(ptr) Variable Function + 111(r33): 110(ptr) Variable Function + 112(b4x4): 110(ptr) Variable Function + 20: 16 Load 19(b1x1) + 21: 16 Transpose 20 + Store 18(r00) 21 + 29: 26 Load 28(b2x1) + 30: 23 Transpose 29 + Store 25(r01) 30 + 38: 35 Load 37(b3x1) + 39: 32 Transpose 38 + Store 34(r02) 39 + 47: 44 Load 46(b4x1) + 48: 41 Transpose 47 + Store 43(r03) 48 + 51: 23 Load 50(b1x2) + 52: 26 Transpose 51 + Store 49(r10) 52 + 57: 53 Load 56(b2x2) + 58: 53 Transpose 57 + Store 55(r11) 58 + 65: 62 Load 64(b3x2) + 66: 59 Transpose 65 + Store 61(r12) 66 + 73: 70 Load 72(b4x2) + 74: 67 Transpose 73 + Store 69(r13) 74 + 77: 32 Load 76(b1x3) + 78: 35 Transpose 77 + Store 75(r20) 78 + 81: 59 Load 80(b2x3) + 82: 62 Transpose 81 + Store 79(r21) 82 + 87: 83 Load 86(b3x3) + 88: 83 Transpose 87 + Store 85(r22) 88 + 95: 92 Load 94(b4x3) + 96: 89 Transpose 95 + Store 91(r23) 96 + 99: 41 Load 98(b1x4) + 100: 44 Transpose 99 + Store 97(r30) 100 + 103: 67 Load 102(b2x4) + 104: 70 Transpose 103 + Store 101(r31) 104 + 107: 89 Load 106(b3x4) + 108: 92 Transpose 107 + Store 105(r32) 108 + 113: 109 Load 112(b4x4) + 114: 109 Transpose 113 + Store 111(r33) 114 + Return + FunctionEnd + 12(@main():10(PS_OUTPUT) Function None 11 + 13: Label + 116(ps_output): 115(ptr) Variable Function + 122: 121(ptr) AccessChain 116(ps_output) 118 + Store 122 120 + 123:10(PS_OUTPUT) Load 116(ps_output) + ReturnValue 123 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.matType.frag.out b/deps/glslang/Test/baseResults/hlsl.matType.frag.out new file mode 100644 index 00000000..c0d2e4b3 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.matType.frag.out @@ -0,0 +1,107 @@ +hlsl.matType.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:9 Function Definition: ShaderFunction(vf1;f1; ( temp 1-component vector of float) +0:9 Function Parameters: +0:9 'inFloat1' ( in 1-component vector of float) +0:9 'inScalar' ( in float) +0:? Sequence +0:10 Branch: Return with expression +0:10 'inFloat1' ( in 1-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 1-component vector of float f1, uniform 1X1 matrix of float fmat11, uniform 4X1 matrix of float fmat41, uniform 1X2 matrix of float fmat12, uniform 2X3 matrix of double dmat23, uniform 4X4 matrix of int int44}) + + +Linked fragment stage: + +WARNING: Linking fragment stage: Entry point not found + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:9 Function Definition: ShaderFunction(vf1;f1; ( temp 1-component vector of float) +0:9 Function Parameters: +0:9 'inFloat1' ( in 1-component vector of float) +0:9 'inScalar' ( in float) +0:? Sequence +0:10 Branch: Return with expression +0:10 'inFloat1' ( in 1-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 1-component vector of float f1, uniform 1X1 matrix of float fmat11, uniform 4X1 matrix of float fmat41, uniform 1X2 matrix of float fmat12, uniform 2X3 matrix of double dmat23, uniform 4X4 matrix of int int44}) + +error: SPIRV-Tools Validation Errors +error: Illegal number of components (1) for TypeVector + %v1float = OpTypeVector %float 1 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 30 + + Capability Shader + Capability Float64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 11 "ShaderFunction(vf1;f1;" + Name 9 "inFloat1" + Name 10 "inScalar" + Name 27 "$Global" + MemberName 27($Global) 0 "f1" + MemberName 27($Global) 1 "fmat11" + MemberName 27($Global) 2 "fmat41" + MemberName 27($Global) 3 "fmat12" + MemberName 27($Global) 4 "dmat23" + MemberName 27($Global) 5 "int44" + Name 29 "" + MemberDecorate 27($Global) 0 Offset 0 + MemberDecorate 27($Global) 1 RowMajor + MemberDecorate 27($Global) 1 Offset 16 + MemberDecorate 27($Global) 1 MatrixStride 16 + MemberDecorate 27($Global) 2 RowMajor + MemberDecorate 27($Global) 2 Offset 32 + MemberDecorate 27($Global) 2 MatrixStride 16 + MemberDecorate 27($Global) 3 RowMajor + MemberDecorate 27($Global) 3 Offset 48 + MemberDecorate 27($Global) 3 MatrixStride 16 + MemberDecorate 27($Global) 4 RowMajor + MemberDecorate 27($Global) 4 Offset 80 + MemberDecorate 27($Global) 4 MatrixStride 16 + MemberDecorate 27($Global) 5 RowMajor + MemberDecorate 27($Global) 5 Offset 128 + MemberDecorate 27($Global) 5 MatrixStride 16 + Decorate 27($Global) Block + Decorate 29 DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeFunction 6(float) 7(ptr) 7(ptr) + 16: TypeVector 6(float) 1 + 17: TypeMatrix 16(fvec) 1 + 18: TypeMatrix 16(fvec) 4 + 19: TypeVector 6(float) 2 + 20: TypeMatrix 19(fvec2) 1 + 21: TypeFloat 64 + 22: TypeVector 21(float64_t) 3 + 23: TypeMatrix 22(f64vec3) 2 + 24: TypeInt 32 1 + 25: TypeVector 24(int) 4 + 26: TypeMatrix 25(ivec4) 4 + 27($Global): TypeStruct 6(float) 17 18 20 23 26 + 28: TypePointer Uniform 27($Global) + 29: 28(ptr) Variable Uniform +4(PixelShaderFunction): 2 Function None 3 + 5: Label + Return + FunctionEnd +11(ShaderFunction(vf1;f1;): 6(float) Function None 8 + 9(inFloat1): 7(ptr) FunctionParameter + 10(inScalar): 7(ptr) FunctionParameter + 12: Label + 13: 6(float) Load 9(inFloat1) + ReturnValue 13 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.matType.int.frag.out b/deps/glslang/Test/baseResults/hlsl.matType.int.frag.out new file mode 100644 index 00000000..2039dfd5 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.matType.int.frag.out @@ -0,0 +1,756 @@ +hlsl.matType.int.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: TestIntMatTypes( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:25 Sequence +0:25 move second child to first child ( temp 1X1 matrix of int) +0:25 'r00' ( temp 1X1 matrix of int) +0:25 transpose ( temp 1X1 matrix of int) +0:25 'i1x1' ( temp 1X1 matrix of int) +0:26 Sequence +0:26 move second child to first child ( temp 1X2 matrix of int) +0:26 'r01' ( temp 1X2 matrix of int) +0:26 transpose ( temp 1X2 matrix of int) +0:26 'i2x1' ( temp 2X1 matrix of int) +0:27 Sequence +0:27 move second child to first child ( temp 1X3 matrix of int) +0:27 'r02' ( temp 1X3 matrix of int) +0:27 transpose ( temp 1X3 matrix of int) +0:27 'i3x1' ( temp 3X1 matrix of int) +0:28 Sequence +0:28 move second child to first child ( temp 1X4 matrix of int) +0:28 'r03' ( temp 1X4 matrix of int) +0:28 transpose ( temp 1X4 matrix of int) +0:28 'i4x1' ( temp 4X1 matrix of int) +0:30 Sequence +0:30 move second child to first child ( temp 2X1 matrix of int) +0:30 'r10' ( temp 2X1 matrix of int) +0:30 transpose ( temp 2X1 matrix of int) +0:30 'i1x2' ( temp 1X2 matrix of int) +0:31 Sequence +0:31 move second child to first child ( temp 2X2 matrix of int) +0:31 'r11' ( temp 2X2 matrix of int) +0:31 transpose ( temp 2X2 matrix of int) +0:31 'i2x2' ( temp 2X2 matrix of int) +0:32 Sequence +0:32 move second child to first child ( temp 2X3 matrix of int) +0:32 'r12' ( temp 2X3 matrix of int) +0:32 transpose ( temp 2X3 matrix of int) +0:32 'i3x2' ( temp 3X2 matrix of int) +0:33 Sequence +0:33 move second child to first child ( temp 2X4 matrix of int) +0:33 'r13' ( temp 2X4 matrix of int) +0:33 transpose ( temp 2X4 matrix of int) +0:33 'i4x2' ( temp 4X2 matrix of int) +0:35 Sequence +0:35 move second child to first child ( temp 3X1 matrix of int) +0:35 'r20' ( temp 3X1 matrix of int) +0:35 transpose ( temp 3X1 matrix of int) +0:35 'i1x3' ( temp 1X3 matrix of int) +0:36 Sequence +0:36 move second child to first child ( temp 3X2 matrix of int) +0:36 'r21' ( temp 3X2 matrix of int) +0:36 transpose ( temp 3X2 matrix of int) +0:36 'i2x3' ( temp 2X3 matrix of int) +0:37 Sequence +0:37 move second child to first child ( temp 3X3 matrix of int) +0:37 'r22' ( temp 3X3 matrix of int) +0:37 transpose ( temp 3X3 matrix of int) +0:37 'i3x3' ( temp 3X3 matrix of int) +0:38 Sequence +0:38 move second child to first child ( temp 3X4 matrix of int) +0:38 'r23' ( temp 3X4 matrix of int) +0:38 transpose ( temp 3X4 matrix of int) +0:38 'i4x3' ( temp 4X3 matrix of int) +0:40 Sequence +0:40 move second child to first child ( temp 4X1 matrix of int) +0:40 'r30' ( temp 4X1 matrix of int) +0:40 transpose ( temp 4X1 matrix of int) +0:40 'i1x4' ( temp 1X4 matrix of int) +0:41 Sequence +0:41 move second child to first child ( temp 4X2 matrix of int) +0:41 'r31' ( temp 4X2 matrix of int) +0:41 transpose ( temp 4X2 matrix of int) +0:41 'i2x4' ( temp 2X4 matrix of int) +0:42 Sequence +0:42 move second child to first child ( temp 4X3 matrix of int) +0:42 'r32' ( temp 4X3 matrix of int) +0:42 transpose ( temp 4X3 matrix of int) +0:42 'i3x4' ( temp 3X4 matrix of int) +0:43 Sequence +0:43 move second child to first child ( temp 4X4 matrix of int) +0:43 'r33' ( temp 4X4 matrix of int) +0:43 transpose ( temp 4X4 matrix of int) +0:43 'i4x4' ( temp 4X4 matrix of int) +0:47 Function Definition: TestUintMatTypes( ( temp void) +0:47 Function Parameters: +0:? Sequence +0:69 Sequence +0:69 move second child to first child ( temp 1X1 matrix of uint) +0:69 'r00' ( temp 1X1 matrix of uint) +0:69 transpose ( temp 1X1 matrix of uint) +0:69 'u1x1' ( temp 1X1 matrix of uint) +0:70 Sequence +0:70 move second child to first child ( temp 1X2 matrix of uint) +0:70 'r01' ( temp 1X2 matrix of uint) +0:70 transpose ( temp 1X2 matrix of uint) +0:70 'u2x1' ( temp 2X1 matrix of uint) +0:71 Sequence +0:71 move second child to first child ( temp 1X3 matrix of uint) +0:71 'r02' ( temp 1X3 matrix of uint) +0:71 transpose ( temp 1X3 matrix of uint) +0:71 'u3x1' ( temp 3X1 matrix of uint) +0:72 Sequence +0:72 move second child to first child ( temp 1X4 matrix of uint) +0:72 'r03' ( temp 1X4 matrix of uint) +0:72 transpose ( temp 1X4 matrix of uint) +0:72 'u4x1' ( temp 4X1 matrix of uint) +0:74 Sequence +0:74 move second child to first child ( temp 2X1 matrix of uint) +0:74 'r10' ( temp 2X1 matrix of uint) +0:74 transpose ( temp 2X1 matrix of uint) +0:74 'u1x2' ( temp 1X2 matrix of uint) +0:75 Sequence +0:75 move second child to first child ( temp 2X2 matrix of uint) +0:75 'r11' ( temp 2X2 matrix of uint) +0:75 transpose ( temp 2X2 matrix of uint) +0:75 'u2x2' ( temp 2X2 matrix of uint) +0:76 Sequence +0:76 move second child to first child ( temp 2X3 matrix of uint) +0:76 'r12' ( temp 2X3 matrix of uint) +0:76 transpose ( temp 2X3 matrix of uint) +0:76 'u3x2' ( temp 3X2 matrix of uint) +0:77 Sequence +0:77 move second child to first child ( temp 2X4 matrix of uint) +0:77 'r13' ( temp 2X4 matrix of uint) +0:77 transpose ( temp 2X4 matrix of uint) +0:77 'u4x2' ( temp 4X2 matrix of uint) +0:79 Sequence +0:79 move second child to first child ( temp 3X1 matrix of uint) +0:79 'r20' ( temp 3X1 matrix of uint) +0:79 transpose ( temp 3X1 matrix of uint) +0:79 'u1x3' ( temp 1X3 matrix of uint) +0:80 Sequence +0:80 move second child to first child ( temp 3X2 matrix of uint) +0:80 'r21' ( temp 3X2 matrix of uint) +0:80 transpose ( temp 3X2 matrix of uint) +0:80 'u2x3' ( temp 2X3 matrix of uint) +0:81 Sequence +0:81 move second child to first child ( temp 3X3 matrix of uint) +0:81 'r22' ( temp 3X3 matrix of uint) +0:81 transpose ( temp 3X3 matrix of uint) +0:81 'u3x3' ( temp 3X3 matrix of uint) +0:82 Sequence +0:82 move second child to first child ( temp 3X4 matrix of uint) +0:82 'r23' ( temp 3X4 matrix of uint) +0:82 transpose ( temp 3X4 matrix of uint) +0:82 'u4x3' ( temp 4X3 matrix of uint) +0:84 Sequence +0:84 move second child to first child ( temp 4X1 matrix of uint) +0:84 'r30' ( temp 4X1 matrix of uint) +0:84 transpose ( temp 4X1 matrix of uint) +0:84 'u1x4' ( temp 1X4 matrix of uint) +0:85 Sequence +0:85 move second child to first child ( temp 4X2 matrix of uint) +0:85 'r31' ( temp 4X2 matrix of uint) +0:85 transpose ( temp 4X2 matrix of uint) +0:85 'u2x4' ( temp 2X4 matrix of uint) +0:86 Sequence +0:86 move second child to first child ( temp 4X3 matrix of uint) +0:86 'r32' ( temp 4X3 matrix of uint) +0:86 transpose ( temp 4X3 matrix of uint) +0:86 'u3x4' ( temp 3X4 matrix of uint) +0:87 Sequence +0:87 move second child to first child ( temp 4X4 matrix of uint) +0:87 'r33' ( temp 4X4 matrix of uint) +0:87 transpose ( temp 4X4 matrix of uint) +0:87 'u4x4' ( temp 4X4 matrix of uint) +0:93 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:93 Function Parameters: +0:? Sequence +0:95 move second child to first child ( temp 4-component vector of float) +0:95 color: direct index for structure ( temp 4-component vector of float) +0:95 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:95 Constant: +0:95 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:96 Branch: Return with expression +0:96 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:93 Function Definition: main( ( temp void) +0:93 Function Parameters: +0:? Sequence +0:93 Sequence +0:93 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:93 color: direct index for structure ( temp 4-component vector of float) +0:93 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:93 Constant: +0:93 0 (const int) +0:? Linker Objects +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: TestIntMatTypes( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:25 Sequence +0:25 move second child to first child ( temp 1X1 matrix of int) +0:25 'r00' ( temp 1X1 matrix of int) +0:25 transpose ( temp 1X1 matrix of int) +0:25 'i1x1' ( temp 1X1 matrix of int) +0:26 Sequence +0:26 move second child to first child ( temp 1X2 matrix of int) +0:26 'r01' ( temp 1X2 matrix of int) +0:26 transpose ( temp 1X2 matrix of int) +0:26 'i2x1' ( temp 2X1 matrix of int) +0:27 Sequence +0:27 move second child to first child ( temp 1X3 matrix of int) +0:27 'r02' ( temp 1X3 matrix of int) +0:27 transpose ( temp 1X3 matrix of int) +0:27 'i3x1' ( temp 3X1 matrix of int) +0:28 Sequence +0:28 move second child to first child ( temp 1X4 matrix of int) +0:28 'r03' ( temp 1X4 matrix of int) +0:28 transpose ( temp 1X4 matrix of int) +0:28 'i4x1' ( temp 4X1 matrix of int) +0:30 Sequence +0:30 move second child to first child ( temp 2X1 matrix of int) +0:30 'r10' ( temp 2X1 matrix of int) +0:30 transpose ( temp 2X1 matrix of int) +0:30 'i1x2' ( temp 1X2 matrix of int) +0:31 Sequence +0:31 move second child to first child ( temp 2X2 matrix of int) +0:31 'r11' ( temp 2X2 matrix of int) +0:31 transpose ( temp 2X2 matrix of int) +0:31 'i2x2' ( temp 2X2 matrix of int) +0:32 Sequence +0:32 move second child to first child ( temp 2X3 matrix of int) +0:32 'r12' ( temp 2X3 matrix of int) +0:32 transpose ( temp 2X3 matrix of int) +0:32 'i3x2' ( temp 3X2 matrix of int) +0:33 Sequence +0:33 move second child to first child ( temp 2X4 matrix of int) +0:33 'r13' ( temp 2X4 matrix of int) +0:33 transpose ( temp 2X4 matrix of int) +0:33 'i4x2' ( temp 4X2 matrix of int) +0:35 Sequence +0:35 move second child to first child ( temp 3X1 matrix of int) +0:35 'r20' ( temp 3X1 matrix of int) +0:35 transpose ( temp 3X1 matrix of int) +0:35 'i1x3' ( temp 1X3 matrix of int) +0:36 Sequence +0:36 move second child to first child ( temp 3X2 matrix of int) +0:36 'r21' ( temp 3X2 matrix of int) +0:36 transpose ( temp 3X2 matrix of int) +0:36 'i2x3' ( temp 2X3 matrix of int) +0:37 Sequence +0:37 move second child to first child ( temp 3X3 matrix of int) +0:37 'r22' ( temp 3X3 matrix of int) +0:37 transpose ( temp 3X3 matrix of int) +0:37 'i3x3' ( temp 3X3 matrix of int) +0:38 Sequence +0:38 move second child to first child ( temp 3X4 matrix of int) +0:38 'r23' ( temp 3X4 matrix of int) +0:38 transpose ( temp 3X4 matrix of int) +0:38 'i4x3' ( temp 4X3 matrix of int) +0:40 Sequence +0:40 move second child to first child ( temp 4X1 matrix of int) +0:40 'r30' ( temp 4X1 matrix of int) +0:40 transpose ( temp 4X1 matrix of int) +0:40 'i1x4' ( temp 1X4 matrix of int) +0:41 Sequence +0:41 move second child to first child ( temp 4X2 matrix of int) +0:41 'r31' ( temp 4X2 matrix of int) +0:41 transpose ( temp 4X2 matrix of int) +0:41 'i2x4' ( temp 2X4 matrix of int) +0:42 Sequence +0:42 move second child to first child ( temp 4X3 matrix of int) +0:42 'r32' ( temp 4X3 matrix of int) +0:42 transpose ( temp 4X3 matrix of int) +0:42 'i3x4' ( temp 3X4 matrix of int) +0:43 Sequence +0:43 move second child to first child ( temp 4X4 matrix of int) +0:43 'r33' ( temp 4X4 matrix of int) +0:43 transpose ( temp 4X4 matrix of int) +0:43 'i4x4' ( temp 4X4 matrix of int) +0:47 Function Definition: TestUintMatTypes( ( temp void) +0:47 Function Parameters: +0:? Sequence +0:69 Sequence +0:69 move second child to first child ( temp 1X1 matrix of uint) +0:69 'r00' ( temp 1X1 matrix of uint) +0:69 transpose ( temp 1X1 matrix of uint) +0:69 'u1x1' ( temp 1X1 matrix of uint) +0:70 Sequence +0:70 move second child to first child ( temp 1X2 matrix of uint) +0:70 'r01' ( temp 1X2 matrix of uint) +0:70 transpose ( temp 1X2 matrix of uint) +0:70 'u2x1' ( temp 2X1 matrix of uint) +0:71 Sequence +0:71 move second child to first child ( temp 1X3 matrix of uint) +0:71 'r02' ( temp 1X3 matrix of uint) +0:71 transpose ( temp 1X3 matrix of uint) +0:71 'u3x1' ( temp 3X1 matrix of uint) +0:72 Sequence +0:72 move second child to first child ( temp 1X4 matrix of uint) +0:72 'r03' ( temp 1X4 matrix of uint) +0:72 transpose ( temp 1X4 matrix of uint) +0:72 'u4x1' ( temp 4X1 matrix of uint) +0:74 Sequence +0:74 move second child to first child ( temp 2X1 matrix of uint) +0:74 'r10' ( temp 2X1 matrix of uint) +0:74 transpose ( temp 2X1 matrix of uint) +0:74 'u1x2' ( temp 1X2 matrix of uint) +0:75 Sequence +0:75 move second child to first child ( temp 2X2 matrix of uint) +0:75 'r11' ( temp 2X2 matrix of uint) +0:75 transpose ( temp 2X2 matrix of uint) +0:75 'u2x2' ( temp 2X2 matrix of uint) +0:76 Sequence +0:76 move second child to first child ( temp 2X3 matrix of uint) +0:76 'r12' ( temp 2X3 matrix of uint) +0:76 transpose ( temp 2X3 matrix of uint) +0:76 'u3x2' ( temp 3X2 matrix of uint) +0:77 Sequence +0:77 move second child to first child ( temp 2X4 matrix of uint) +0:77 'r13' ( temp 2X4 matrix of uint) +0:77 transpose ( temp 2X4 matrix of uint) +0:77 'u4x2' ( temp 4X2 matrix of uint) +0:79 Sequence +0:79 move second child to first child ( temp 3X1 matrix of uint) +0:79 'r20' ( temp 3X1 matrix of uint) +0:79 transpose ( temp 3X1 matrix of uint) +0:79 'u1x3' ( temp 1X3 matrix of uint) +0:80 Sequence +0:80 move second child to first child ( temp 3X2 matrix of uint) +0:80 'r21' ( temp 3X2 matrix of uint) +0:80 transpose ( temp 3X2 matrix of uint) +0:80 'u2x3' ( temp 2X3 matrix of uint) +0:81 Sequence +0:81 move second child to first child ( temp 3X3 matrix of uint) +0:81 'r22' ( temp 3X3 matrix of uint) +0:81 transpose ( temp 3X3 matrix of uint) +0:81 'u3x3' ( temp 3X3 matrix of uint) +0:82 Sequence +0:82 move second child to first child ( temp 3X4 matrix of uint) +0:82 'r23' ( temp 3X4 matrix of uint) +0:82 transpose ( temp 3X4 matrix of uint) +0:82 'u4x3' ( temp 4X3 matrix of uint) +0:84 Sequence +0:84 move second child to first child ( temp 4X1 matrix of uint) +0:84 'r30' ( temp 4X1 matrix of uint) +0:84 transpose ( temp 4X1 matrix of uint) +0:84 'u1x4' ( temp 1X4 matrix of uint) +0:85 Sequence +0:85 move second child to first child ( temp 4X2 matrix of uint) +0:85 'r31' ( temp 4X2 matrix of uint) +0:85 transpose ( temp 4X2 matrix of uint) +0:85 'u2x4' ( temp 2X4 matrix of uint) +0:86 Sequence +0:86 move second child to first child ( temp 4X3 matrix of uint) +0:86 'r32' ( temp 4X3 matrix of uint) +0:86 transpose ( temp 4X3 matrix of uint) +0:86 'u3x4' ( temp 3X4 matrix of uint) +0:87 Sequence +0:87 move second child to first child ( temp 4X4 matrix of uint) +0:87 'r33' ( temp 4X4 matrix of uint) +0:87 transpose ( temp 4X4 matrix of uint) +0:87 'u4x4' ( temp 4X4 matrix of uint) +0:93 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:93 Function Parameters: +0:? Sequence +0:95 move second child to first child ( temp 4-component vector of float) +0:95 color: direct index for structure ( temp 4-component vector of float) +0:95 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:95 Constant: +0:95 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:96 Branch: Return with expression +0:96 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:93 Function Definition: main( ( temp void) +0:93 Function Parameters: +0:? Sequence +0:93 Sequence +0:93 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:93 color: direct index for structure ( temp 4-component vector of float) +0:93 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:93 Constant: +0:93 0 (const int) +0:? Linker Objects +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: Illegal number of components (1) for TypeVector + %v1int = OpTypeVector %int 1 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 232 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 229 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 6 "TestIntMatTypes(" + Name 8 "TestUintMatTypes(" + Name 12 "PS_OUTPUT" + MemberName 12(PS_OUTPUT) 0 "color" + Name 14 "@main(" + Name 20 "r00" + Name 21 "i1x1" + Name 27 "r01" + Name 30 "i2x1" + Name 36 "r02" + Name 39 "i3x1" + Name 45 "r03" + Name 48 "i4x1" + Name 51 "r10" + Name 52 "i1x2" + Name 57 "r11" + Name 58 "i2x2" + Name 63 "r12" + Name 66 "i3x2" + Name 71 "r13" + Name 74 "i4x2" + Name 77 "r20" + Name 78 "i1x3" + Name 81 "r21" + Name 82 "i2x3" + Name 87 "r22" + Name 88 "i3x3" + Name 93 "r23" + Name 96 "i4x3" + Name 99 "r30" + Name 100 "i1x4" + Name 103 "r31" + Name 104 "i2x4" + Name 107 "r32" + Name 108 "i3x4" + Name 113 "r33" + Name 114 "i4x4" + Name 121 "r00" + Name 122 "u1x1" + Name 128 "r01" + Name 131 "u2x1" + Name 137 "r02" + Name 140 "u3x1" + Name 146 "r03" + Name 149 "u4x1" + Name 152 "r10" + Name 153 "u1x2" + Name 158 "r11" + Name 159 "u2x2" + Name 164 "r12" + Name 167 "u3x2" + Name 172 "r13" + Name 175 "u4x2" + Name 178 "r20" + Name 179 "u1x3" + Name 182 "r21" + Name 183 "u2x3" + Name 188 "r22" + Name 189 "u3x3" + Name 194 "r23" + Name 197 "u4x3" + Name 200 "r30" + Name 201 "u1x4" + Name 204 "r31" + Name 205 "u2x4" + Name 208 "r32" + Name 209 "u3x4" + Name 214 "r33" + Name 215 "u4x4" + Name 219 "ps_output" + Name 229 "@entryPointOutput.color" + Decorate 229(@entryPointOutput.color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 10: TypeFloat 32 + 11: TypeVector 10(float) 4 + 12(PS_OUTPUT): TypeStruct 11(fvec4) + 13: TypeFunction 12(PS_OUTPUT) + 16: TypeInt 32 1 + 17: TypeVector 16(int) 1 + 18: TypeMatrix 17(ivec) 1 + 19: TypePointer Function 18 + 24: TypeVector 16(int) 2 + 25: TypeMatrix 24(ivec2) 1 + 26: TypePointer Function 25 + 28: TypeMatrix 17(ivec) 2 + 29: TypePointer Function 28 + 33: TypeVector 16(int) 3 + 34: TypeMatrix 33(ivec3) 1 + 35: TypePointer Function 34 + 37: TypeMatrix 17(ivec) 3 + 38: TypePointer Function 37 + 42: TypeVector 16(int) 4 + 43: TypeMatrix 42(ivec4) 1 + 44: TypePointer Function 43 + 46: TypeMatrix 17(ivec) 4 + 47: TypePointer Function 46 + 55: TypeMatrix 24(ivec2) 2 + 56: TypePointer Function 55 + 61: TypeMatrix 33(ivec3) 2 + 62: TypePointer Function 61 + 64: TypeMatrix 24(ivec2) 3 + 65: TypePointer Function 64 + 69: TypeMatrix 42(ivec4) 2 + 70: TypePointer Function 69 + 72: TypeMatrix 24(ivec2) 4 + 73: TypePointer Function 72 + 85: TypeMatrix 33(ivec3) 3 + 86: TypePointer Function 85 + 91: TypeMatrix 42(ivec4) 3 + 92: TypePointer Function 91 + 94: TypeMatrix 33(ivec3) 4 + 95: TypePointer Function 94 + 111: TypeMatrix 42(ivec4) 4 + 112: TypePointer Function 111 + 117: TypeInt 32 0 + 118: TypeVector 117(int) 1 + 119: TypeMatrix 118(ivec) 1 + 120: TypePointer Function 119 + 125: TypeVector 117(int) 2 + 126: TypeMatrix 125(ivec2) 1 + 127: TypePointer Function 126 + 129: TypeMatrix 118(ivec) 2 + 130: TypePointer Function 129 + 134: TypeVector 117(int) 3 + 135: TypeMatrix 134(ivec3) 1 + 136: TypePointer Function 135 + 138: TypeMatrix 118(ivec) 3 + 139: TypePointer Function 138 + 143: TypeVector 117(int) 4 + 144: TypeMatrix 143(ivec4) 1 + 145: TypePointer Function 144 + 147: TypeMatrix 118(ivec) 4 + 148: TypePointer Function 147 + 156: TypeMatrix 125(ivec2) 2 + 157: TypePointer Function 156 + 162: TypeMatrix 134(ivec3) 2 + 163: TypePointer Function 162 + 165: TypeMatrix 125(ivec2) 3 + 166: TypePointer Function 165 + 170: TypeMatrix 143(ivec4) 2 + 171: TypePointer Function 170 + 173: TypeMatrix 125(ivec2) 4 + 174: TypePointer Function 173 + 186: TypeMatrix 134(ivec3) 3 + 187: TypePointer Function 186 + 192: TypeMatrix 143(ivec4) 3 + 193: TypePointer Function 192 + 195: TypeMatrix 134(ivec3) 4 + 196: TypePointer Function 195 + 212: TypeMatrix 143(ivec4) 4 + 213: TypePointer Function 212 + 218: TypePointer Function 12(PS_OUTPUT) + 220: 16(int) Constant 0 + 221: 10(float) Constant 0 + 222: 11(fvec4) ConstantComposite 221 221 221 221 + 223: TypePointer Function 11(fvec4) + 228: TypePointer Output 11(fvec4) +229(@entryPointOutput.color): 228(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 230:12(PS_OUTPUT) FunctionCall 14(@main() + 231: 11(fvec4) CompositeExtract 230 0 + Store 229(@entryPointOutput.color) 231 + Return + FunctionEnd +6(TestIntMatTypes(): 2 Function None 3 + 7: Label + 20(r00): 19(ptr) Variable Function + 21(i1x1): 19(ptr) Variable Function + 27(r01): 26(ptr) Variable Function + 30(i2x1): 29(ptr) Variable Function + 36(r02): 35(ptr) Variable Function + 39(i3x1): 38(ptr) Variable Function + 45(r03): 44(ptr) Variable Function + 48(i4x1): 47(ptr) Variable Function + 51(r10): 29(ptr) Variable Function + 52(i1x2): 26(ptr) Variable Function + 57(r11): 56(ptr) Variable Function + 58(i2x2): 56(ptr) Variable Function + 63(r12): 62(ptr) Variable Function + 66(i3x2): 65(ptr) Variable Function + 71(r13): 70(ptr) Variable Function + 74(i4x2): 73(ptr) Variable Function + 77(r20): 38(ptr) Variable Function + 78(i1x3): 35(ptr) Variable Function + 81(r21): 65(ptr) Variable Function + 82(i2x3): 62(ptr) Variable Function + 87(r22): 86(ptr) Variable Function + 88(i3x3): 86(ptr) Variable Function + 93(r23): 92(ptr) Variable Function + 96(i4x3): 95(ptr) Variable Function + 99(r30): 47(ptr) Variable Function + 100(i1x4): 44(ptr) Variable Function + 103(r31): 73(ptr) Variable Function + 104(i2x4): 70(ptr) Variable Function + 107(r32): 95(ptr) Variable Function + 108(i3x4): 92(ptr) Variable Function + 113(r33): 112(ptr) Variable Function + 114(i4x4): 112(ptr) Variable Function + 22: 18 Load 21(i1x1) + 23: 18 Transpose 22 + Store 20(r00) 23 + 31: 28 Load 30(i2x1) + 32: 25 Transpose 31 + Store 27(r01) 32 + 40: 37 Load 39(i3x1) + 41: 34 Transpose 40 + Store 36(r02) 41 + 49: 46 Load 48(i4x1) + 50: 43 Transpose 49 + Store 45(r03) 50 + 53: 25 Load 52(i1x2) + 54: 28 Transpose 53 + Store 51(r10) 54 + 59: 55 Load 58(i2x2) + 60: 55 Transpose 59 + Store 57(r11) 60 + 67: 64 Load 66(i3x2) + 68: 61 Transpose 67 + Store 63(r12) 68 + 75: 72 Load 74(i4x2) + 76: 69 Transpose 75 + Store 71(r13) 76 + 79: 34 Load 78(i1x3) + 80: 37 Transpose 79 + Store 77(r20) 80 + 83: 61 Load 82(i2x3) + 84: 64 Transpose 83 + Store 81(r21) 84 + 89: 85 Load 88(i3x3) + 90: 85 Transpose 89 + Store 87(r22) 90 + 97: 94 Load 96(i4x3) + 98: 91 Transpose 97 + Store 93(r23) 98 + 101: 43 Load 100(i1x4) + 102: 46 Transpose 101 + Store 99(r30) 102 + 105: 69 Load 104(i2x4) + 106: 72 Transpose 105 + Store 103(r31) 106 + 109: 91 Load 108(i3x4) + 110: 94 Transpose 109 + Store 107(r32) 110 + 115: 111 Load 114(i4x4) + 116: 111 Transpose 115 + Store 113(r33) 116 + Return + FunctionEnd +8(TestUintMatTypes(): 2 Function None 3 + 9: Label + 121(r00): 120(ptr) Variable Function + 122(u1x1): 120(ptr) Variable Function + 128(r01): 127(ptr) Variable Function + 131(u2x1): 130(ptr) Variable Function + 137(r02): 136(ptr) Variable Function + 140(u3x1): 139(ptr) Variable Function + 146(r03): 145(ptr) Variable Function + 149(u4x1): 148(ptr) Variable Function + 152(r10): 130(ptr) Variable Function + 153(u1x2): 127(ptr) Variable Function + 158(r11): 157(ptr) Variable Function + 159(u2x2): 157(ptr) Variable Function + 164(r12): 163(ptr) Variable Function + 167(u3x2): 166(ptr) Variable Function + 172(r13): 171(ptr) Variable Function + 175(u4x2): 174(ptr) Variable Function + 178(r20): 139(ptr) Variable Function + 179(u1x3): 136(ptr) Variable Function + 182(r21): 166(ptr) Variable Function + 183(u2x3): 163(ptr) Variable Function + 188(r22): 187(ptr) Variable Function + 189(u3x3): 187(ptr) Variable Function + 194(r23): 193(ptr) Variable Function + 197(u4x3): 196(ptr) Variable Function + 200(r30): 148(ptr) Variable Function + 201(u1x4): 145(ptr) Variable Function + 204(r31): 174(ptr) Variable Function + 205(u2x4): 171(ptr) Variable Function + 208(r32): 196(ptr) Variable Function + 209(u3x4): 193(ptr) Variable Function + 214(r33): 213(ptr) Variable Function + 215(u4x4): 213(ptr) Variable Function + 123: 119 Load 122(u1x1) + 124: 119 Transpose 123 + Store 121(r00) 124 + 132: 129 Load 131(u2x1) + 133: 126 Transpose 132 + Store 128(r01) 133 + 141: 138 Load 140(u3x1) + 142: 135 Transpose 141 + Store 137(r02) 142 + 150: 147 Load 149(u4x1) + 151: 144 Transpose 150 + Store 146(r03) 151 + 154: 126 Load 153(u1x2) + 155: 129 Transpose 154 + Store 152(r10) 155 + 160: 156 Load 159(u2x2) + 161: 156 Transpose 160 + Store 158(r11) 161 + 168: 165 Load 167(u3x2) + 169: 162 Transpose 168 + Store 164(r12) 169 + 176: 173 Load 175(u4x2) + 177: 170 Transpose 176 + Store 172(r13) 177 + 180: 135 Load 179(u1x3) + 181: 138 Transpose 180 + Store 178(r20) 181 + 184: 162 Load 183(u2x3) + 185: 165 Transpose 184 + Store 182(r21) 185 + 190: 186 Load 189(u3x3) + 191: 186 Transpose 190 + Store 188(r22) 191 + 198: 195 Load 197(u4x3) + 199: 192 Transpose 198 + Store 194(r23) 199 + 202: 144 Load 201(u1x4) + 203: 147 Transpose 202 + Store 200(r30) 203 + 206: 170 Load 205(u2x4) + 207: 173 Transpose 206 + Store 204(r31) 207 + 210: 192 Load 209(u3x4) + 211: 195 Transpose 210 + Store 208(r32) 211 + 216: 212 Load 215(u4x4) + 217: 212 Transpose 216 + Store 214(r33) 217 + Return + FunctionEnd + 14(@main():12(PS_OUTPUT) Function None 13 + 15: Label + 219(ps_output): 218(ptr) Variable Function + 224: 223(ptr) AccessChain 219(ps_output) 220 + Store 224 222 + 225:12(PS_OUTPUT) Load 219(ps_output) + ReturnValue 225 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.matpack-1.frag.out b/deps/glslang/Test/baseResults/hlsl.matpack-1.frag.out new file mode 100644 index 00000000..b92f79d2 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.matpack-1.frag.out @@ -0,0 +1,187 @@ +hlsl.matpack-1.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:23 Function Definition: @main( ( temp 4-component vector of float) +0:23 Function Parameters: +0:? Sequence +0:25 Branch: Return with expression +0:24 add ( temp 4-component vector of float) +0:24 vector-times-matrix ( temp 4-component vector of float) +0:24 vec1: direct index for structure ( temp 4-component vector of float) +0:24 g_MyBuffer1: direct index for structure (layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, temp 4-component vector of float vec1, temp float foo}) +0:24 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, temp 4-component vector of float vec1, temp float foo} g_MyBuffer1, layout( row_major std140) uniform structure{layout( column_major) temp 4X4 matrix of float mat1, temp 4-component vector of float vec1} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:24 Constant: +0:24 0 (const uint) +0:24 Constant: +0:24 2 (const int) +0:24 mat1: direct index for structure (layout( row_major) temp 4X4 matrix of float) +0:24 g_MyBuffer1: direct index for structure (layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, temp 4-component vector of float vec1, temp float foo}) +0:24 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, temp 4-component vector of float vec1, temp float foo} g_MyBuffer1, layout( row_major std140) uniform structure{layout( column_major) temp 4X4 matrix of float mat1, temp 4-component vector of float vec1} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:24 Constant: +0:24 0 (const uint) +0:24 Constant: +0:24 0 (const int) +0:25 vector-times-matrix ( temp 4-component vector of float) +0:25 vec1: direct index for structure ( temp 4-component vector of float) +0:25 g_MyBuffer2: direct index for structure (layout( row_major std140) uniform structure{layout( column_major) temp 4X4 matrix of float mat1, temp 4-component vector of float vec1}) +0:25 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, temp 4-component vector of float vec1, temp float foo} g_MyBuffer1, layout( row_major std140) uniform structure{layout( column_major) temp 4X4 matrix of float mat1, temp 4-component vector of float vec1} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:25 Constant: +0:25 1 (const uint) +0:25 Constant: +0:25 1 (const int) +0:25 mat1: direct index for structure (layout( column_major) temp 4X4 matrix of float) +0:25 g_MyBuffer2: direct index for structure (layout( row_major std140) uniform structure{layout( column_major) temp 4X4 matrix of float mat1, temp 4-component vector of float vec1}) +0:25 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, temp 4-component vector of float vec1, temp float foo} g_MyBuffer1, layout( row_major std140) uniform structure{layout( column_major) temp 4X4 matrix of float mat1, temp 4-component vector of float vec1} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:25 Constant: +0:25 1 (const uint) +0:25 Constant: +0:25 0 (const int) +0:23 Function Definition: main( ( temp void) +0:23 Function Parameters: +0:? Sequence +0:23 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:23 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, temp 4-component vector of float vec1, temp float foo} g_MyBuffer1, layout( row_major std140) uniform structure{layout( column_major) temp 4X4 matrix of float mat1, temp 4-component vector of float vec1} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:23 Function Definition: @main( ( temp 4-component vector of float) +0:23 Function Parameters: +0:? Sequence +0:25 Branch: Return with expression +0:24 add ( temp 4-component vector of float) +0:24 vector-times-matrix ( temp 4-component vector of float) +0:24 vec1: direct index for structure ( temp 4-component vector of float) +0:24 g_MyBuffer1: direct index for structure (layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, temp 4-component vector of float vec1, temp float foo}) +0:24 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, temp 4-component vector of float vec1, temp float foo} g_MyBuffer1, layout( row_major std140) uniform structure{layout( column_major) temp 4X4 matrix of float mat1, temp 4-component vector of float vec1} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:24 Constant: +0:24 0 (const uint) +0:24 Constant: +0:24 2 (const int) +0:24 mat1: direct index for structure (layout( row_major) temp 4X4 matrix of float) +0:24 g_MyBuffer1: direct index for structure (layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, temp 4-component vector of float vec1, temp float foo}) +0:24 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, temp 4-component vector of float vec1, temp float foo} g_MyBuffer1, layout( row_major std140) uniform structure{layout( column_major) temp 4X4 matrix of float mat1, temp 4-component vector of float vec1} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:24 Constant: +0:24 0 (const uint) +0:24 Constant: +0:24 0 (const int) +0:25 vector-times-matrix ( temp 4-component vector of float) +0:25 vec1: direct index for structure ( temp 4-component vector of float) +0:25 g_MyBuffer2: direct index for structure (layout( row_major std140) uniform structure{layout( column_major) temp 4X4 matrix of float mat1, temp 4-component vector of float vec1}) +0:25 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, temp 4-component vector of float vec1, temp float foo} g_MyBuffer1, layout( row_major std140) uniform structure{layout( column_major) temp 4X4 matrix of float mat1, temp 4-component vector of float vec1} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:25 Constant: +0:25 1 (const uint) +0:25 Constant: +0:25 1 (const int) +0:25 mat1: direct index for structure (layout( column_major) temp 4X4 matrix of float) +0:25 g_MyBuffer2: direct index for structure (layout( row_major std140) uniform structure{layout( column_major) temp 4X4 matrix of float mat1, temp 4-component vector of float vec1}) +0:25 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, temp 4-component vector of float vec1, temp float foo} g_MyBuffer1, layout( row_major std140) uniform structure{layout( column_major) temp 4X4 matrix of float mat1, temp 4-component vector of float vec1} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:25 Constant: +0:25 1 (const uint) +0:25 Constant: +0:25 0 (const int) +0:23 Function Definition: main( ( temp void) +0:23 Function Parameters: +0:? Sequence +0:23 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:23 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, temp 4-component vector of float vec1, temp float foo} g_MyBuffer1, layout( row_major std140) uniform structure{layout( column_major) temp 4X4 matrix of float mat1, temp 4-component vector of float vec1} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 39 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 37 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 12 "MyBuffer1" + MemberName 12(MyBuffer1) 0 "mat1" + MemberName 12(MyBuffer1) 1 "mat2" + MemberName 12(MyBuffer1) 2 "vec1" + MemberName 12(MyBuffer1) 3 "foo" + Name 13 "MyBuffer2" + MemberName 13(MyBuffer2) 0 "mat1" + MemberName 13(MyBuffer2) 1 "vec1" + Name 14 "Example" + MemberName 14(Example) 0 "g_MyBuffer1" + MemberName 14(Example) 1 "g_MyBuffer2" + MemberName 14(Example) 2 "mat1a" + Name 16 "" + Name 37 "@entryPointOutput" + MemberDecorate 12(MyBuffer1) 0 RowMajor + MemberDecorate 12(MyBuffer1) 0 Offset 0 + MemberDecorate 12(MyBuffer1) 0 MatrixStride 16 + MemberDecorate 12(MyBuffer1) 1 ColMajor + MemberDecorate 12(MyBuffer1) 1 Offset 64 + MemberDecorate 12(MyBuffer1) 1 MatrixStride 16 + MemberDecorate 12(MyBuffer1) 2 Offset 128 + MemberDecorate 12(MyBuffer1) 3 Offset 144 + MemberDecorate 13(MyBuffer2) 0 ColMajor + MemberDecorate 13(MyBuffer2) 0 Offset 0 + MemberDecorate 13(MyBuffer2) 0 MatrixStride 16 + MemberDecorate 13(MyBuffer2) 1 Offset 64 + MemberDecorate 14(Example) 0 Offset 0 + MemberDecorate 14(Example) 1 Offset 160 + MemberDecorate 14(Example) 2 RowMajor + MemberDecorate 14(Example) 2 Offset 240 + MemberDecorate 14(Example) 2 MatrixStride 16 + Decorate 14(Example) Block + Decorate 16 DescriptorSet 0 + Decorate 37(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeMatrix 7(fvec4) 4 + 12(MyBuffer1): TypeStruct 11 11 7(fvec4) 6(float) + 13(MyBuffer2): TypeStruct 11 7(fvec4) + 14(Example): TypeStruct 12(MyBuffer1) 13(MyBuffer2) 11 + 15: TypePointer Uniform 14(Example) + 16: 15(ptr) Variable Uniform + 17: TypeInt 32 1 + 18: 17(int) Constant 0 + 19: 17(int) Constant 2 + 20: TypePointer Uniform 7(fvec4) + 23: TypePointer Uniform 11 + 27: 17(int) Constant 1 + 36: TypePointer Output 7(fvec4) +37(@entryPointOutput): 36(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 38: 7(fvec4) FunctionCall 9(@main() + Store 37(@entryPointOutput) 38 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 21: 20(ptr) AccessChain 16 18 19 + 22: 7(fvec4) Load 21 + 24: 23(ptr) AccessChain 16 18 18 + 25: 11 Load 24 + 26: 7(fvec4) VectorTimesMatrix 22 25 + 28: 20(ptr) AccessChain 16 27 27 + 29: 7(fvec4) Load 28 + 30: 23(ptr) AccessChain 16 27 18 + 31: 11 Load 30 + 32: 7(fvec4) VectorTimesMatrix 29 31 + 33: 7(fvec4) FAdd 26 32 + ReturnValue 33 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.matpack-pragma.frag.out b/deps/glslang/Test/baseResults/hlsl.matpack-pragma.frag.out new file mode 100644 index 00000000..2750d76a --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.matpack-pragma.frag.out @@ -0,0 +1,268 @@ +hlsl.matpack-pragma.frag +WARNING: 0:19: 'random_string_foo' : unknown pack_matrix pragma value + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:29 Function Definition: @main( ( temp 4-component vector of float) +0:29 Function Parameters: +0:? Sequence +0:32 Branch: Return with expression +0:32 add ( temp 4-component vector of float) +0:32 add ( temp 4-component vector of float) +0:31 add ( temp 4-component vector of float) +0:31 add ( temp 4-component vector of float) +0:31 add ( temp 4-component vector of float) +0:31 direct index (layout( row_major) temp 4-component vector of float) +0:31 mat1: direct index for structure (layout( row_major) temp 4X4 matrix of float) +0:31 g_MyBuffer1: direct index for structure (layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( column_major) temp 4X4 matrix of float mat3}) +0:31 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( column_major) temp 4X4 matrix of float mat3} g_MyBuffer1, layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( row_major) temp 4X4 matrix of float mat3} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:31 Constant: +0:31 0 (const uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 0 (const int) +0:31 direct index (layout( column_major) temp 4-component vector of float) +0:31 mat2: direct index for structure (layout( column_major) temp 4X4 matrix of float) +0:31 g_MyBuffer1: direct index for structure (layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( column_major) temp 4X4 matrix of float mat3}) +0:31 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( column_major) temp 4X4 matrix of float mat3} g_MyBuffer1, layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( row_major) temp 4X4 matrix of float mat3} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:31 Constant: +0:31 0 (const uint) +0:31 Constant: +0:31 1 (const int) +0:31 Constant: +0:31 0 (const int) +0:31 direct index (layout( column_major) temp 4-component vector of float) +0:31 mat3: direct index for structure (layout( column_major) temp 4X4 matrix of float) +0:31 g_MyBuffer1: direct index for structure (layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( column_major) temp 4X4 matrix of float mat3}) +0:31 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( column_major) temp 4X4 matrix of float mat3} g_MyBuffer1, layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( row_major) temp 4X4 matrix of float mat3} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:31 Constant: +0:31 0 (const uint) +0:31 Constant: +0:31 2 (const int) +0:31 Constant: +0:31 0 (const int) +0:32 direct index (layout( row_major) temp 4-component vector of float) +0:32 mat1: direct index for structure (layout( row_major) temp 4X4 matrix of float) +0:32 g_MyBuffer2: direct index for structure (layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( row_major) temp 4X4 matrix of float mat3}) +0:32 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( column_major) temp 4X4 matrix of float mat3} g_MyBuffer1, layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( row_major) temp 4X4 matrix of float mat3} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:32 Constant: +0:32 1 (const uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 0 (const int) +0:32 direct index (layout( column_major) temp 4-component vector of float) +0:32 mat2: direct index for structure (layout( column_major) temp 4X4 matrix of float) +0:32 g_MyBuffer2: direct index for structure (layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( row_major) temp 4X4 matrix of float mat3}) +0:32 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( column_major) temp 4X4 matrix of float mat3} g_MyBuffer1, layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( row_major) temp 4X4 matrix of float mat3} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:32 Constant: +0:32 1 (const uint) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 0 (const int) +0:32 direct index (layout( row_major) temp 4-component vector of float) +0:32 mat3: direct index for structure (layout( row_major) temp 4X4 matrix of float) +0:32 g_MyBuffer2: direct index for structure (layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( row_major) temp 4X4 matrix of float mat3}) +0:32 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( column_major) temp 4X4 matrix of float mat3} g_MyBuffer1, layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( row_major) temp 4X4 matrix of float mat3} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:32 Constant: +0:32 1 (const uint) +0:32 Constant: +0:32 2 (const int) +0:32 Constant: +0:32 0 (const int) +0:29 Function Definition: main( ( temp void) +0:29 Function Parameters: +0:? Sequence +0:29 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:29 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( column_major) temp 4X4 matrix of float mat3} g_MyBuffer1, layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( row_major) temp 4X4 matrix of float mat3} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:29 Function Definition: @main( ( temp 4-component vector of float) +0:29 Function Parameters: +0:? Sequence +0:32 Branch: Return with expression +0:32 add ( temp 4-component vector of float) +0:32 add ( temp 4-component vector of float) +0:31 add ( temp 4-component vector of float) +0:31 add ( temp 4-component vector of float) +0:31 add ( temp 4-component vector of float) +0:31 direct index (layout( row_major) temp 4-component vector of float) +0:31 mat1: direct index for structure (layout( row_major) temp 4X4 matrix of float) +0:31 g_MyBuffer1: direct index for structure (layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( column_major) temp 4X4 matrix of float mat3}) +0:31 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( column_major) temp 4X4 matrix of float mat3} g_MyBuffer1, layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( row_major) temp 4X4 matrix of float mat3} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:31 Constant: +0:31 0 (const uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 0 (const int) +0:31 direct index (layout( column_major) temp 4-component vector of float) +0:31 mat2: direct index for structure (layout( column_major) temp 4X4 matrix of float) +0:31 g_MyBuffer1: direct index for structure (layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( column_major) temp 4X4 matrix of float mat3}) +0:31 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( column_major) temp 4X4 matrix of float mat3} g_MyBuffer1, layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( row_major) temp 4X4 matrix of float mat3} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:31 Constant: +0:31 0 (const uint) +0:31 Constant: +0:31 1 (const int) +0:31 Constant: +0:31 0 (const int) +0:31 direct index (layout( column_major) temp 4-component vector of float) +0:31 mat3: direct index for structure (layout( column_major) temp 4X4 matrix of float) +0:31 g_MyBuffer1: direct index for structure (layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( column_major) temp 4X4 matrix of float mat3}) +0:31 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( column_major) temp 4X4 matrix of float mat3} g_MyBuffer1, layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( row_major) temp 4X4 matrix of float mat3} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:31 Constant: +0:31 0 (const uint) +0:31 Constant: +0:31 2 (const int) +0:31 Constant: +0:31 0 (const int) +0:32 direct index (layout( row_major) temp 4-component vector of float) +0:32 mat1: direct index for structure (layout( row_major) temp 4X4 matrix of float) +0:32 g_MyBuffer2: direct index for structure (layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( row_major) temp 4X4 matrix of float mat3}) +0:32 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( column_major) temp 4X4 matrix of float mat3} g_MyBuffer1, layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( row_major) temp 4X4 matrix of float mat3} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:32 Constant: +0:32 1 (const uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 0 (const int) +0:32 direct index (layout( column_major) temp 4-component vector of float) +0:32 mat2: direct index for structure (layout( column_major) temp 4X4 matrix of float) +0:32 g_MyBuffer2: direct index for structure (layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( row_major) temp 4X4 matrix of float mat3}) +0:32 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( column_major) temp 4X4 matrix of float mat3} g_MyBuffer1, layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( row_major) temp 4X4 matrix of float mat3} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:32 Constant: +0:32 1 (const uint) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 0 (const int) +0:32 direct index (layout( row_major) temp 4-component vector of float) +0:32 mat3: direct index for structure (layout( row_major) temp 4X4 matrix of float) +0:32 g_MyBuffer2: direct index for structure (layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( row_major) temp 4X4 matrix of float mat3}) +0:32 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( column_major) temp 4X4 matrix of float mat3} g_MyBuffer1, layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( row_major) temp 4X4 matrix of float mat3} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:32 Constant: +0:32 1 (const uint) +0:32 Constant: +0:32 2 (const int) +0:32 Constant: +0:32 0 (const int) +0:29 Function Definition: main( ( temp void) +0:29 Function Parameters: +0:? Sequence +0:29 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:29 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( column_major) temp 4X4 matrix of float mat3} g_MyBuffer1, layout( row_major std140) uniform structure{layout( row_major) temp 4X4 matrix of float mat1, layout( column_major) temp 4X4 matrix of float mat2, layout( row_major) temp 4X4 matrix of float mat3} g_MyBuffer2, layout( row_major std140) uniform 4X4 matrix of float mat1a}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 44 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 42 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 12 "MyBuffer1" + MemberName 12(MyBuffer1) 0 "mat1" + MemberName 12(MyBuffer1) 1 "mat2" + MemberName 12(MyBuffer1) 2 "mat3" + Name 13 "MyBuffer2" + MemberName 13(MyBuffer2) 0 "mat1" + MemberName 13(MyBuffer2) 1 "mat2" + MemberName 13(MyBuffer2) 2 "mat3" + Name 14 "Example" + MemberName 14(Example) 0 "g_MyBuffer1" + MemberName 14(Example) 1 "g_MyBuffer2" + MemberName 14(Example) 2 "mat1a" + Name 16 "" + Name 42 "@entryPointOutput" + MemberDecorate 12(MyBuffer1) 0 RowMajor + MemberDecorate 12(MyBuffer1) 0 Offset 0 + MemberDecorate 12(MyBuffer1) 0 MatrixStride 16 + MemberDecorate 12(MyBuffer1) 1 ColMajor + MemberDecorate 12(MyBuffer1) 1 Offset 64 + MemberDecorate 12(MyBuffer1) 1 MatrixStride 16 + MemberDecorate 12(MyBuffer1) 2 ColMajor + MemberDecorate 12(MyBuffer1) 2 Offset 128 + MemberDecorate 12(MyBuffer1) 2 MatrixStride 16 + MemberDecorate 13(MyBuffer2) 0 RowMajor + MemberDecorate 13(MyBuffer2) 0 Offset 0 + MemberDecorate 13(MyBuffer2) 0 MatrixStride 16 + MemberDecorate 13(MyBuffer2) 1 ColMajor + MemberDecorate 13(MyBuffer2) 1 Offset 64 + MemberDecorate 13(MyBuffer2) 1 MatrixStride 16 + MemberDecorate 13(MyBuffer2) 2 RowMajor + MemberDecorate 13(MyBuffer2) 2 Offset 128 + MemberDecorate 13(MyBuffer2) 2 MatrixStride 16 + MemberDecorate 14(Example) 0 Offset 0 + MemberDecorate 14(Example) 1 Offset 192 + MemberDecorate 14(Example) 2 RowMajor + MemberDecorate 14(Example) 2 Offset 384 + MemberDecorate 14(Example) 2 MatrixStride 16 + Decorate 14(Example) Block + Decorate 16 DescriptorSet 0 + Decorate 42(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeMatrix 7(fvec4) 4 + 12(MyBuffer1): TypeStruct 11 11 11 + 13(MyBuffer2): TypeStruct 11 11 11 + 14(Example): TypeStruct 12(MyBuffer1) 13(MyBuffer2) 11 + 15: TypePointer Uniform 14(Example) + 16: 15(ptr) Variable Uniform + 17: TypeInt 32 1 + 18: 17(int) Constant 0 + 19: TypePointer Uniform 7(fvec4) + 22: 17(int) Constant 1 + 26: 17(int) Constant 2 + 41: TypePointer Output 7(fvec4) +42(@entryPointOutput): 41(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 43: 7(fvec4) FunctionCall 9(@main() + Store 42(@entryPointOutput) 43 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 20: 19(ptr) AccessChain 16 18 18 18 + 21: 7(fvec4) Load 20 + 23: 19(ptr) AccessChain 16 18 22 18 + 24: 7(fvec4) Load 23 + 25: 7(fvec4) FAdd 21 24 + 27: 19(ptr) AccessChain 16 18 26 18 + 28: 7(fvec4) Load 27 + 29: 7(fvec4) FAdd 25 28 + 30: 19(ptr) AccessChain 16 22 18 18 + 31: 7(fvec4) Load 30 + 32: 7(fvec4) FAdd 29 31 + 33: 19(ptr) AccessChain 16 22 22 18 + 34: 7(fvec4) Load 33 + 35: 7(fvec4) FAdd 32 34 + 36: 19(ptr) AccessChain 16 22 26 18 + 37: 7(fvec4) Load 36 + 38: 7(fvec4) FAdd 35 37 + ReturnValue 38 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.matrixSwizzle.vert.out b/deps/glslang/Test/baseResults/hlsl.matrixSwizzle.vert.out new file mode 100644 index 00000000..abb3e495 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.matrixSwizzle.vert.out @@ -0,0 +1,856 @@ +hlsl.matrixSwizzle.vert +Shader version: 500 +0:? Sequence +0:2 Function Definition: @ShaderFunction(f1; ( temp void) +0:2 Function Parameters: +0:2 'inf' ( in float) +0:? Sequence +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 direct index ( temp 4-component vector of float) +0:7 'm' ( temp 3X4 matrix of float) +0:7 Constant: +0:7 2 (const int) +0:7 Constant: +0:7 3 (const int) +0:7 Constant: +0:7 1.000000 +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 direct index ( temp 4-component vector of float) +0:8 'm' ( temp 3X4 matrix of float) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 3 (const int) +0:8 Constant: +0:8 2.000000 +0:9 move second child to first child ( temp float) +0:9 direct index ( temp float) +0:9 direct index ( temp 4-component vector of float) +0:9 'm' ( temp 3X4 matrix of float) +0:9 Constant: +0:9 2 (const int) +0:9 Constant: +0:9 3 (const int) +0:9 Constant: +0:9 2.000000 +0:11 move second child to first child ( temp 4-component vector of float) +0:11 direct index ( temp 4-component vector of float) +0:11 'm' ( temp 3X4 matrix of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 3.000000 +0:11 3.000000 +0:11 3.000000 +0:11 3.000000 +0:12 move second child to first child ( temp 4-component vector of float) +0:12 direct index ( temp 4-component vector of float) +0:12 'm' ( temp 3X4 matrix of float) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 3.000000 +0:12 3.000000 +0:12 3.000000 +0:12 3.000000 +0:13 move second child to first child ( temp 4-component vector of float) +0:13 direct index ( temp 4-component vector of float) +0:13 'm' ( temp 3X4 matrix of float) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 3.000000 +0:13 3.000000 +0:13 3.000000 +0:13 3.000000 +0:? Sequence +0:18 move second child to first child ( temp float) +0:18 direct index ( temp float) +0:18 direct index ( temp 4-component vector of float) +0:18 'm' ( temp 3X4 matrix of float) +0:18 Constant: +0:18 0 (const int) +0:18 Constant: +0:18 0 (const int) +0:18 direct index ( temp float) +0:18 'f3' ( temp 3-component vector of float) +0:18 Constant: +0:18 0 (const int) +0:18 move second child to first child ( temp float) +0:18 direct index ( temp float) +0:18 direct index ( temp 4-component vector of float) +0:18 'm' ( temp 3X4 matrix of float) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 1 (const int) +0:18 direct index ( temp float) +0:18 'f3' ( temp 3-component vector of float) +0:18 Constant: +0:18 1 (const int) +0:18 move second child to first child ( temp float) +0:18 direct index ( temp float) +0:18 direct index ( temp 4-component vector of float) +0:18 'm' ( temp 3X4 matrix of float) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 2 (const int) +0:18 direct index ( temp float) +0:18 'f3' ( temp 3-component vector of float) +0:18 Constant: +0:18 2 (const int) +0:19 Sequence +0:19 move second child to first child ( temp 3-component vector of float) +0:19 'intermVec' ( temp 3-component vector of float) +0:19 Constant: +0:19 5.000000 +0:19 5.000000 +0:19 5.000000 +0:19 move second child to first child ( temp float) +0:19 direct index ( temp float) +0:19 direct index ( temp 4-component vector of float) +0:19 'm' ( temp 3X4 matrix of float) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 0 (const int) +0:19 direct index ( temp float) +0:19 'intermVec' ( temp 3-component vector of float) +0:19 Constant: +0:19 0 (const int) +0:19 move second child to first child ( temp float) +0:19 direct index ( temp float) +0:19 direct index ( temp 4-component vector of float) +0:19 'm' ( temp 3X4 matrix of float) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 direct index ( temp float) +0:19 'intermVec' ( temp 3-component vector of float) +0:19 Constant: +0:19 1 (const int) +0:19 move second child to first child ( temp float) +0:19 direct index ( temp float) +0:19 direct index ( temp 4-component vector of float) +0:19 'm' ( temp 3X4 matrix of float) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 0 (const int) +0:19 direct index ( temp float) +0:19 'intermVec' ( temp 3-component vector of float) +0:19 Constant: +0:19 2 (const int) +0:20 Sequence +0:20 move second child to first child ( temp 3-component vector of float) +0:20 'intermVec' ( temp 3-component vector of float) +0:20 vector-scale ( temp 3-component vector of float) +0:20 Constant: +0:20 2.000000 +0:20 'f3' ( temp 3-component vector of float) +0:20 move second child to first child ( temp float) +0:20 direct index ( temp float) +0:20 direct index ( temp 4-component vector of float) +0:20 'm' ( temp 3X4 matrix of float) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 direct index ( temp float) +0:20 'intermVec' ( temp 3-component vector of float) +0:20 Constant: +0:20 0 (const int) +0:20 move second child to first child ( temp float) +0:20 direct index ( temp float) +0:20 direct index ( temp 4-component vector of float) +0:20 'm' ( temp 3X4 matrix of float) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 direct index ( temp float) +0:20 'intermVec' ( temp 3-component vector of float) +0:20 Constant: +0:20 1 (const int) +0:20 move second child to first child ( temp float) +0:20 direct index ( temp float) +0:20 direct index ( temp 4-component vector of float) +0:20 'm' ( temp 3X4 matrix of float) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 direct index ( temp float) +0:20 'intermVec' ( temp 3-component vector of float) +0:20 Constant: +0:20 2 (const int) +0:23 move second child to first child ( temp 3-component vector of float) +0:23 'f3' ( temp 3-component vector of float) +0:23 matrix swizzle ( temp 3-component vector of float) +0:23 'm' ( temp 3X4 matrix of float) +0:23 Sequence +0:23 Constant: +0:23 1 (const int) +0:23 Constant: +0:23 0 (const int) +0:23 Constant: +0:23 0 (const int) +0:23 Constant: +0:23 1 (const int) +0:23 Constant: +0:23 2 (const int) +0:23 Constant: +0:23 0 (const int) +0:2 Function Definition: ShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp float) +0:? 'inf' ( temp float) +0:? 'inf' (layout( location=0) in float) +0:2 Function Call: @ShaderFunction(f1; ( temp void) +0:? 'inf' ( temp float) +0:27 Function Definition: createMat3x3(vf3;vf3;vf3; ( temp 3X3 matrix of float) +0:27 Function Parameters: +0:27 'a' ( in 3-component vector of float) +0:27 'b' ( in 3-component vector of float) +0:27 'c' ( in 3-component vector of float) +0:? Sequence +0:? Sequence +0:29 move second child to first child ( temp float) +0:29 direct index ( temp float) +0:29 direct index ( temp 3-component vector of float) +0:29 'm' ( temp 3X3 matrix of float) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 0 (const int) +0:29 direct index ( temp float) +0:29 'a' ( in 3-component vector of float) +0:29 Constant: +0:29 0 (const int) +0:29 move second child to first child ( temp float) +0:29 direct index ( temp float) +0:29 direct index ( temp 3-component vector of float) +0:29 'm' ( temp 3X3 matrix of float) +0:29 Constant: +0:29 1 (const int) +0:29 Constant: +0:29 0 (const int) +0:29 direct index ( temp float) +0:29 'a' ( in 3-component vector of float) +0:29 Constant: +0:29 1 (const int) +0:29 move second child to first child ( temp float) +0:29 direct index ( temp float) +0:29 direct index ( temp 3-component vector of float) +0:29 'm' ( temp 3X3 matrix of float) +0:29 Constant: +0:29 2 (const int) +0:29 Constant: +0:29 0 (const int) +0:29 direct index ( temp float) +0:29 'a' ( in 3-component vector of float) +0:29 Constant: +0:29 2 (const int) +0:? Sequence +0:30 move second child to first child ( temp float) +0:30 direct index ( temp float) +0:30 direct index ( temp 3-component vector of float) +0:30 'm' ( temp 3X3 matrix of float) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 1 (const int) +0:30 direct index ( temp float) +0:30 'b' ( in 3-component vector of float) +0:30 Constant: +0:30 0 (const int) +0:30 move second child to first child ( temp float) +0:30 direct index ( temp float) +0:30 direct index ( temp 3-component vector of float) +0:30 'm' ( temp 3X3 matrix of float) +0:30 Constant: +0:30 1 (const int) +0:30 Constant: +0:30 1 (const int) +0:30 direct index ( temp float) +0:30 'b' ( in 3-component vector of float) +0:30 Constant: +0:30 1 (const int) +0:30 move second child to first child ( temp float) +0:30 direct index ( temp float) +0:30 direct index ( temp 3-component vector of float) +0:30 'm' ( temp 3X3 matrix of float) +0:30 Constant: +0:30 2 (const int) +0:30 Constant: +0:30 1 (const int) +0:30 direct index ( temp float) +0:30 'b' ( in 3-component vector of float) +0:30 Constant: +0:30 2 (const int) +0:? Sequence +0:31 move second child to first child ( temp float) +0:31 direct index ( temp float) +0:31 direct index ( temp 3-component vector of float) +0:31 'm' ( temp 3X3 matrix of float) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 2 (const int) +0:31 direct index ( temp float) +0:31 'c' ( in 3-component vector of float) +0:31 Constant: +0:31 0 (const int) +0:31 move second child to first child ( temp float) +0:31 direct index ( temp float) +0:31 direct index ( temp 3-component vector of float) +0:31 'm' ( temp 3X3 matrix of float) +0:31 Constant: +0:31 1 (const int) +0:31 Constant: +0:31 2 (const int) +0:31 direct index ( temp float) +0:31 'c' ( in 3-component vector of float) +0:31 Constant: +0:31 1 (const int) +0:31 move second child to first child ( temp float) +0:31 direct index ( temp float) +0:31 direct index ( temp 3-component vector of float) +0:31 'm' ( temp 3X3 matrix of float) +0:31 Constant: +0:31 2 (const int) +0:31 Constant: +0:31 2 (const int) +0:31 direct index ( temp float) +0:31 'c' ( in 3-component vector of float) +0:31 Constant: +0:31 2 (const int) +0:32 Branch: Return with expression +0:32 'm' ( temp 3X3 matrix of float) +0:? Linker Objects +0:? 'inf' (layout( location=0) in float) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:2 Function Definition: @ShaderFunction(f1; ( temp void) +0:2 Function Parameters: +0:2 'inf' ( in float) +0:? Sequence +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 direct index ( temp 4-component vector of float) +0:7 'm' ( temp 3X4 matrix of float) +0:7 Constant: +0:7 2 (const int) +0:7 Constant: +0:7 3 (const int) +0:7 Constant: +0:7 1.000000 +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 direct index ( temp 4-component vector of float) +0:8 'm' ( temp 3X4 matrix of float) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 3 (const int) +0:8 Constant: +0:8 2.000000 +0:9 move second child to first child ( temp float) +0:9 direct index ( temp float) +0:9 direct index ( temp 4-component vector of float) +0:9 'm' ( temp 3X4 matrix of float) +0:9 Constant: +0:9 2 (const int) +0:9 Constant: +0:9 3 (const int) +0:9 Constant: +0:9 2.000000 +0:11 move second child to first child ( temp 4-component vector of float) +0:11 direct index ( temp 4-component vector of float) +0:11 'm' ( temp 3X4 matrix of float) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 3.000000 +0:11 3.000000 +0:11 3.000000 +0:11 3.000000 +0:12 move second child to first child ( temp 4-component vector of float) +0:12 direct index ( temp 4-component vector of float) +0:12 'm' ( temp 3X4 matrix of float) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 3.000000 +0:12 3.000000 +0:12 3.000000 +0:12 3.000000 +0:13 move second child to first child ( temp 4-component vector of float) +0:13 direct index ( temp 4-component vector of float) +0:13 'm' ( temp 3X4 matrix of float) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 3.000000 +0:13 3.000000 +0:13 3.000000 +0:13 3.000000 +0:? Sequence +0:18 move second child to first child ( temp float) +0:18 direct index ( temp float) +0:18 direct index ( temp 4-component vector of float) +0:18 'm' ( temp 3X4 matrix of float) +0:18 Constant: +0:18 0 (const int) +0:18 Constant: +0:18 0 (const int) +0:18 direct index ( temp float) +0:18 'f3' ( temp 3-component vector of float) +0:18 Constant: +0:18 0 (const int) +0:18 move second child to first child ( temp float) +0:18 direct index ( temp float) +0:18 direct index ( temp 4-component vector of float) +0:18 'm' ( temp 3X4 matrix of float) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 1 (const int) +0:18 direct index ( temp float) +0:18 'f3' ( temp 3-component vector of float) +0:18 Constant: +0:18 1 (const int) +0:18 move second child to first child ( temp float) +0:18 direct index ( temp float) +0:18 direct index ( temp 4-component vector of float) +0:18 'm' ( temp 3X4 matrix of float) +0:18 Constant: +0:18 1 (const int) +0:18 Constant: +0:18 2 (const int) +0:18 direct index ( temp float) +0:18 'f3' ( temp 3-component vector of float) +0:18 Constant: +0:18 2 (const int) +0:19 Sequence +0:19 move second child to first child ( temp 3-component vector of float) +0:19 'intermVec' ( temp 3-component vector of float) +0:19 Constant: +0:19 5.000000 +0:19 5.000000 +0:19 5.000000 +0:19 move second child to first child ( temp float) +0:19 direct index ( temp float) +0:19 direct index ( temp 4-component vector of float) +0:19 'm' ( temp 3X4 matrix of float) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 0 (const int) +0:19 direct index ( temp float) +0:19 'intermVec' ( temp 3-component vector of float) +0:19 Constant: +0:19 0 (const int) +0:19 move second child to first child ( temp float) +0:19 direct index ( temp float) +0:19 direct index ( temp 4-component vector of float) +0:19 'm' ( temp 3X4 matrix of float) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 direct index ( temp float) +0:19 'intermVec' ( temp 3-component vector of float) +0:19 Constant: +0:19 1 (const int) +0:19 move second child to first child ( temp float) +0:19 direct index ( temp float) +0:19 direct index ( temp 4-component vector of float) +0:19 'm' ( temp 3X4 matrix of float) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 0 (const int) +0:19 direct index ( temp float) +0:19 'intermVec' ( temp 3-component vector of float) +0:19 Constant: +0:19 2 (const int) +0:20 Sequence +0:20 move second child to first child ( temp 3-component vector of float) +0:20 'intermVec' ( temp 3-component vector of float) +0:20 vector-scale ( temp 3-component vector of float) +0:20 Constant: +0:20 2.000000 +0:20 'f3' ( temp 3-component vector of float) +0:20 move second child to first child ( temp float) +0:20 direct index ( temp float) +0:20 direct index ( temp 4-component vector of float) +0:20 'm' ( temp 3X4 matrix of float) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 direct index ( temp float) +0:20 'intermVec' ( temp 3-component vector of float) +0:20 Constant: +0:20 0 (const int) +0:20 move second child to first child ( temp float) +0:20 direct index ( temp float) +0:20 direct index ( temp 4-component vector of float) +0:20 'm' ( temp 3X4 matrix of float) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 direct index ( temp float) +0:20 'intermVec' ( temp 3-component vector of float) +0:20 Constant: +0:20 1 (const int) +0:20 move second child to first child ( temp float) +0:20 direct index ( temp float) +0:20 direct index ( temp 4-component vector of float) +0:20 'm' ( temp 3X4 matrix of float) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 direct index ( temp float) +0:20 'intermVec' ( temp 3-component vector of float) +0:20 Constant: +0:20 2 (const int) +0:23 move second child to first child ( temp 3-component vector of float) +0:23 'f3' ( temp 3-component vector of float) +0:23 matrix swizzle ( temp 3-component vector of float) +0:23 'm' ( temp 3X4 matrix of float) +0:23 Sequence +0:23 Constant: +0:23 1 (const int) +0:23 Constant: +0:23 0 (const int) +0:23 Constant: +0:23 0 (const int) +0:23 Constant: +0:23 1 (const int) +0:23 Constant: +0:23 2 (const int) +0:23 Constant: +0:23 0 (const int) +0:2 Function Definition: ShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp float) +0:? 'inf' ( temp float) +0:? 'inf' (layout( location=0) in float) +0:2 Function Call: @ShaderFunction(f1; ( temp void) +0:? 'inf' ( temp float) +0:27 Function Definition: createMat3x3(vf3;vf3;vf3; ( temp 3X3 matrix of float) +0:27 Function Parameters: +0:27 'a' ( in 3-component vector of float) +0:27 'b' ( in 3-component vector of float) +0:27 'c' ( in 3-component vector of float) +0:? Sequence +0:? Sequence +0:29 move second child to first child ( temp float) +0:29 direct index ( temp float) +0:29 direct index ( temp 3-component vector of float) +0:29 'm' ( temp 3X3 matrix of float) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 0 (const int) +0:29 direct index ( temp float) +0:29 'a' ( in 3-component vector of float) +0:29 Constant: +0:29 0 (const int) +0:29 move second child to first child ( temp float) +0:29 direct index ( temp float) +0:29 direct index ( temp 3-component vector of float) +0:29 'm' ( temp 3X3 matrix of float) +0:29 Constant: +0:29 1 (const int) +0:29 Constant: +0:29 0 (const int) +0:29 direct index ( temp float) +0:29 'a' ( in 3-component vector of float) +0:29 Constant: +0:29 1 (const int) +0:29 move second child to first child ( temp float) +0:29 direct index ( temp float) +0:29 direct index ( temp 3-component vector of float) +0:29 'm' ( temp 3X3 matrix of float) +0:29 Constant: +0:29 2 (const int) +0:29 Constant: +0:29 0 (const int) +0:29 direct index ( temp float) +0:29 'a' ( in 3-component vector of float) +0:29 Constant: +0:29 2 (const int) +0:? Sequence +0:30 move second child to first child ( temp float) +0:30 direct index ( temp float) +0:30 direct index ( temp 3-component vector of float) +0:30 'm' ( temp 3X3 matrix of float) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 1 (const int) +0:30 direct index ( temp float) +0:30 'b' ( in 3-component vector of float) +0:30 Constant: +0:30 0 (const int) +0:30 move second child to first child ( temp float) +0:30 direct index ( temp float) +0:30 direct index ( temp 3-component vector of float) +0:30 'm' ( temp 3X3 matrix of float) +0:30 Constant: +0:30 1 (const int) +0:30 Constant: +0:30 1 (const int) +0:30 direct index ( temp float) +0:30 'b' ( in 3-component vector of float) +0:30 Constant: +0:30 1 (const int) +0:30 move second child to first child ( temp float) +0:30 direct index ( temp float) +0:30 direct index ( temp 3-component vector of float) +0:30 'm' ( temp 3X3 matrix of float) +0:30 Constant: +0:30 2 (const int) +0:30 Constant: +0:30 1 (const int) +0:30 direct index ( temp float) +0:30 'b' ( in 3-component vector of float) +0:30 Constant: +0:30 2 (const int) +0:? Sequence +0:31 move second child to first child ( temp float) +0:31 direct index ( temp float) +0:31 direct index ( temp 3-component vector of float) +0:31 'm' ( temp 3X3 matrix of float) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 2 (const int) +0:31 direct index ( temp float) +0:31 'c' ( in 3-component vector of float) +0:31 Constant: +0:31 0 (const int) +0:31 move second child to first child ( temp float) +0:31 direct index ( temp float) +0:31 direct index ( temp 3-component vector of float) +0:31 'm' ( temp 3X3 matrix of float) +0:31 Constant: +0:31 1 (const int) +0:31 Constant: +0:31 2 (const int) +0:31 direct index ( temp float) +0:31 'c' ( in 3-component vector of float) +0:31 Constant: +0:31 1 (const int) +0:31 move second child to first child ( temp float) +0:31 direct index ( temp float) +0:31 direct index ( temp 3-component vector of float) +0:31 'm' ( temp 3X3 matrix of float) +0:31 Constant: +0:31 2 (const int) +0:31 Constant: +0:31 2 (const int) +0:31 direct index ( temp float) +0:31 'c' ( in 3-component vector of float) +0:31 Constant: +0:31 2 (const int) +0:32 Branch: Return with expression +0:32 'm' ( temp 3X3 matrix of float) +0:? Linker Objects +0:? 'inf' (layout( location=0) in float) + +Missing functionality: matrix swizzle +error: SPIRV-Tools Validation Errors +error: OpStore Pointer '42[f3]'s type does not match Object '34's type. + OpStore %f3 %int_0 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 118 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "ShaderFunction" 81 + Source HLSL 500 + Name 4 "ShaderFunction" + Name 10 "@ShaderFunction(f1;" + Name 9 "inf" + Name 19 "createMat3x3(vf3;vf3;vf3;" + Name 16 "a" + Name 17 "b" + Name 18 "c" + Name 24 "m" + Name 42 "f3" + Name 55 "intermVec" + Name 67 "intermVec" + Name 79 "inf" + Name 81 "inf" + Name 83 "param" + Name 87 "m" + Decorate 81(inf) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeFunction 2 7(ptr) + 12: TypeVector 6(float) 3 + 13: TypePointer Function 12(fvec3) + 14: TypeMatrix 12(fvec3) 3 + 15: TypeFunction 14 13(ptr) 13(ptr) 13(ptr) + 21: TypeVector 6(float) 4 + 22: TypeMatrix 21(fvec4) 3 + 23: TypePointer Function 22 + 25: TypeInt 32 1 + 26: 25(int) Constant 2 + 27: 6(float) Constant 1065353216 + 28: TypeInt 32 0 + 29: 28(int) Constant 3 + 31: 6(float) Constant 1073741824 + 34: 25(int) Constant 0 + 35: 6(float) Constant 1077936128 + 36: 21(fvec4) ConstantComposite 35 35 35 35 + 37: TypePointer Function 21(fvec4) + 39: 25(int) Constant 1 + 43: 28(int) Constant 0 + 47: 28(int) Constant 1 + 51: 28(int) Constant 2 + 56: 6(float) Constant 1084227584 + 57: 12(fvec3) ConstantComposite 56 56 56 + 80: TypePointer Input 6(float) + 81(inf): 80(ptr) Variable Input + 86: TypePointer Function 14 +4(ShaderFunction): 2 Function None 3 + 5: Label + 79(inf): 7(ptr) Variable Function + 83(param): 7(ptr) Variable Function + 82: 6(float) Load 81(inf) + Store 79(inf) 82 + 84: 6(float) Load 79(inf) + Store 83(param) 84 + 85: 2 FunctionCall 10(@ShaderFunction(f1;) 83(param) + Return + FunctionEnd +10(@ShaderFunction(f1;): 2 Function None 8 + 9(inf): 7(ptr) FunctionParameter + 11: Label + 24(m): 23(ptr) Variable Function + 42(f3): 13(ptr) Variable Function + 55(intermVec): 13(ptr) Variable Function + 67(intermVec): 13(ptr) Variable Function + 30: 7(ptr) AccessChain 24(m) 26 29 + Store 30 27 + 32: 7(ptr) AccessChain 24(m) 26 29 + Store 32 31 + 33: 7(ptr) AccessChain 24(m) 26 29 + Store 33 31 + 38: 37(ptr) AccessChain 24(m) 34 + Store 38 36 + 40: 37(ptr) AccessChain 24(m) 39 + Store 40 36 + 41: 37(ptr) AccessChain 24(m) 39 + Store 41 36 + 44: 7(ptr) AccessChain 42(f3) 43 + 45: 6(float) Load 44 + 46: 7(ptr) AccessChain 24(m) 34 43 + Store 46 45 + 48: 7(ptr) AccessChain 42(f3) 47 + 49: 6(float) Load 48 + 50: 7(ptr) AccessChain 24(m) 39 47 + Store 50 49 + 52: 7(ptr) AccessChain 42(f3) 51 + 53: 6(float) Load 52 + 54: 7(ptr) AccessChain 24(m) 39 51 + Store 54 53 + Store 55(intermVec) 57 + 58: 7(ptr) AccessChain 55(intermVec) 43 + 59: 6(float) Load 58 + 60: 7(ptr) AccessChain 24(m) 39 43 + Store 60 59 + 61: 7(ptr) AccessChain 55(intermVec) 47 + 62: 6(float) Load 61 + 63: 7(ptr) AccessChain 24(m) 34 47 + Store 63 62 + 64: 7(ptr) AccessChain 55(intermVec) 51 + 65: 6(float) Load 64 + 66: 7(ptr) AccessChain 24(m) 26 43 + Store 66 65 + 68: 12(fvec3) Load 42(f3) + 69: 12(fvec3) VectorTimesScalar 68 31 + Store 67(intermVec) 69 + 70: 7(ptr) AccessChain 67(intermVec) 43 + 71: 6(float) Load 70 + 72: 7(ptr) AccessChain 24(m) 34 43 + Store 72 71 + 73: 7(ptr) AccessChain 67(intermVec) 47 + 74: 6(float) Load 73 + 75: 7(ptr) AccessChain 24(m) 34 47 + Store 75 74 + 76: 7(ptr) AccessChain 67(intermVec) 51 + 77: 6(float) Load 76 + 78: 7(ptr) AccessChain 24(m) 39 43 + Store 78 77 + Store 42(f3) 34 + Return + FunctionEnd +19(createMat3x3(vf3;vf3;vf3;): 14 Function None 15 + 16(a): 13(ptr) FunctionParameter + 17(b): 13(ptr) FunctionParameter + 18(c): 13(ptr) FunctionParameter + 20: Label + 87(m): 86(ptr) Variable Function + 88: 7(ptr) AccessChain 16(a) 43 + 89: 6(float) Load 88 + 90: 7(ptr) AccessChain 87(m) 34 43 + Store 90 89 + 91: 7(ptr) AccessChain 16(a) 47 + 92: 6(float) Load 91 + 93: 7(ptr) AccessChain 87(m) 39 43 + Store 93 92 + 94: 7(ptr) AccessChain 16(a) 51 + 95: 6(float) Load 94 + 96: 7(ptr) AccessChain 87(m) 26 43 + Store 96 95 + 97: 7(ptr) AccessChain 17(b) 43 + 98: 6(float) Load 97 + 99: 7(ptr) AccessChain 87(m) 34 47 + Store 99 98 + 100: 7(ptr) AccessChain 17(b) 47 + 101: 6(float) Load 100 + 102: 7(ptr) AccessChain 87(m) 39 47 + Store 102 101 + 103: 7(ptr) AccessChain 17(b) 51 + 104: 6(float) Load 103 + 105: 7(ptr) AccessChain 87(m) 26 47 + Store 105 104 + 106: 7(ptr) AccessChain 18(c) 43 + 107: 6(float) Load 106 + 108: 7(ptr) AccessChain 87(m) 34 51 + Store 108 107 + 109: 7(ptr) AccessChain 18(c) 47 + 110: 6(float) Load 109 + 111: 7(ptr) AccessChain 87(m) 39 51 + Store 111 110 + 112: 7(ptr) AccessChain 18(c) 51 + 113: 6(float) Load 112 + 114: 7(ptr) AccessChain 87(m) 26 51 + Store 114 113 + 115: 14 Load 87(m) + ReturnValue 115 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.matrixindex.frag.out b/deps/glslang/Test/baseResults/hlsl.matrixindex.frag.out new file mode 100644 index 00000000..63e5614e --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.matrixindex.frag.out @@ -0,0 +1,421 @@ +hlsl.matrixindex.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:10 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:10 Function Parameters: +0:? Sequence +0:22 Sequence +0:22 move second child to first child ( temp float) +0:22 'e1_00' ( temp float) +0:22 Constant: +0:22 10.000000 +0:23 Sequence +0:23 move second child to first child ( temp float) +0:23 'e1_01' ( temp float) +0:23 Constant: +0:23 11.000000 +0:24 Sequence +0:24 move second child to first child ( temp float) +0:24 'e1_10' ( temp float) +0:24 Constant: +0:24 12.000000 +0:25 Sequence +0:25 move second child to first child ( temp float) +0:25 'e1_11' ( temp float) +0:25 Constant: +0:25 13.000000 +0:26 Sequence +0:26 move second child to first child ( temp float) +0:26 'e1_20' ( temp float) +0:26 Constant: +0:26 14.000000 +0:27 Sequence +0:27 move second child to first child ( temp float) +0:27 'e1_21' ( temp float) +0:27 Constant: +0:27 15.000000 +0:29 Sequence +0:29 move second child to first child ( temp float) +0:29 'e2_00' ( temp float) +0:29 Constant: +0:29 20.000000 +0:30 Sequence +0:30 move second child to first child ( temp float) +0:30 'e2_01' ( temp float) +0:30 Constant: +0:30 21.000000 +0:31 Sequence +0:31 move second child to first child ( temp float) +0:31 'e2_10' ( temp float) +0:31 Constant: +0:31 22.000000 +0:32 Sequence +0:32 move second child to first child ( temp float) +0:32 'e2_11' ( temp float) +0:32 Constant: +0:32 23.000000 +0:33 Sequence +0:33 move second child to first child ( temp float) +0:33 'e2_20' ( temp float) +0:33 Constant: +0:33 24.000000 +0:34 Sequence +0:34 move second child to first child ( temp float) +0:34 'e2_21' ( temp float) +0:34 Constant: +0:34 25.000000 +0:39 Sequence +0:39 move second child to first child ( temp 2-component vector of float) +0:39 'r0a' ( temp 2-component vector of float) +0:39 Constant: +0:39 10.000000 +0:39 11.000000 +0:40 Sequence +0:40 move second child to first child ( temp 2-component vector of float) +0:40 'r1a' ( temp 2-component vector of float) +0:40 Constant: +0:40 12.000000 +0:40 13.000000 +0:41 Sequence +0:41 move second child to first child ( temp 2-component vector of float) +0:41 'r2a' ( temp 2-component vector of float) +0:41 Constant: +0:41 14.000000 +0:41 15.000000 +0:43 Sequence +0:43 move second child to first child ( temp 2-component vector of float) +0:43 'r0b' ( temp 2-component vector of float) +0:43 indirect index ( temp 2-component vector of float) +0:43 Constant: +0:43 20.000000 +0:43 21.000000 +0:43 22.000000 +0:43 23.000000 +0:43 24.000000 +0:43 25.000000 +0:43 idx: direct index for structure ( uniform int) +0:43 'anon@0' (layout( row_major std140) uniform block{ uniform int idx, uniform 3X2 matrix of float um}) +0:43 Constant: +0:43 0 (const uint) +0:44 Sequence +0:44 move second child to first child ( temp 2-component vector of float) +0:44 'r0c' ( temp 2-component vector of float) +0:44 indirect index ( temp 2-component vector of float) +0:44 um: direct index for structure ( uniform 3X2 matrix of float) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform int idx, uniform 3X2 matrix of float um}) +0:44 Constant: +0:44 1 (const uint) +0:44 idx: direct index for structure ( uniform int) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform int idx, uniform 3X2 matrix of float um}) +0:44 Constant: +0:44 0 (const uint) +0:47 move second child to first child ( temp 4-component vector of float) +0:47 Color: direct index for structure ( temp 4-component vector of float) +0:47 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:47 Constant: +0:47 0 (const int) +0:47 Construct vec4 ( temp 4-component vector of float) +0:47 'e2_11' ( temp float) +0:48 Branch: Return with expression +0:48 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:10 Function Definition: main( ( temp void) +0:10 Function Parameters: +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:10 Color: direct index for structure ( temp 4-component vector of float) +0:10 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:10 Constant: +0:10 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int idx, uniform 3X2 matrix of float um}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:10 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:10 Function Parameters: +0:? Sequence +0:22 Sequence +0:22 move second child to first child ( temp float) +0:22 'e1_00' ( temp float) +0:22 Constant: +0:22 10.000000 +0:23 Sequence +0:23 move second child to first child ( temp float) +0:23 'e1_01' ( temp float) +0:23 Constant: +0:23 11.000000 +0:24 Sequence +0:24 move second child to first child ( temp float) +0:24 'e1_10' ( temp float) +0:24 Constant: +0:24 12.000000 +0:25 Sequence +0:25 move second child to first child ( temp float) +0:25 'e1_11' ( temp float) +0:25 Constant: +0:25 13.000000 +0:26 Sequence +0:26 move second child to first child ( temp float) +0:26 'e1_20' ( temp float) +0:26 Constant: +0:26 14.000000 +0:27 Sequence +0:27 move second child to first child ( temp float) +0:27 'e1_21' ( temp float) +0:27 Constant: +0:27 15.000000 +0:29 Sequence +0:29 move second child to first child ( temp float) +0:29 'e2_00' ( temp float) +0:29 Constant: +0:29 20.000000 +0:30 Sequence +0:30 move second child to first child ( temp float) +0:30 'e2_01' ( temp float) +0:30 Constant: +0:30 21.000000 +0:31 Sequence +0:31 move second child to first child ( temp float) +0:31 'e2_10' ( temp float) +0:31 Constant: +0:31 22.000000 +0:32 Sequence +0:32 move second child to first child ( temp float) +0:32 'e2_11' ( temp float) +0:32 Constant: +0:32 23.000000 +0:33 Sequence +0:33 move second child to first child ( temp float) +0:33 'e2_20' ( temp float) +0:33 Constant: +0:33 24.000000 +0:34 Sequence +0:34 move second child to first child ( temp float) +0:34 'e2_21' ( temp float) +0:34 Constant: +0:34 25.000000 +0:39 Sequence +0:39 move second child to first child ( temp 2-component vector of float) +0:39 'r0a' ( temp 2-component vector of float) +0:39 Constant: +0:39 10.000000 +0:39 11.000000 +0:40 Sequence +0:40 move second child to first child ( temp 2-component vector of float) +0:40 'r1a' ( temp 2-component vector of float) +0:40 Constant: +0:40 12.000000 +0:40 13.000000 +0:41 Sequence +0:41 move second child to first child ( temp 2-component vector of float) +0:41 'r2a' ( temp 2-component vector of float) +0:41 Constant: +0:41 14.000000 +0:41 15.000000 +0:43 Sequence +0:43 move second child to first child ( temp 2-component vector of float) +0:43 'r0b' ( temp 2-component vector of float) +0:43 indirect index ( temp 2-component vector of float) +0:43 Constant: +0:43 20.000000 +0:43 21.000000 +0:43 22.000000 +0:43 23.000000 +0:43 24.000000 +0:43 25.000000 +0:43 idx: direct index for structure ( uniform int) +0:43 'anon@0' (layout( row_major std140) uniform block{ uniform int idx, uniform 3X2 matrix of float um}) +0:43 Constant: +0:43 0 (const uint) +0:44 Sequence +0:44 move second child to first child ( temp 2-component vector of float) +0:44 'r0c' ( temp 2-component vector of float) +0:44 indirect index ( temp 2-component vector of float) +0:44 um: direct index for structure ( uniform 3X2 matrix of float) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform int idx, uniform 3X2 matrix of float um}) +0:44 Constant: +0:44 1 (const uint) +0:44 idx: direct index for structure ( uniform int) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform int idx, uniform 3X2 matrix of float um}) +0:44 Constant: +0:44 0 (const uint) +0:47 move second child to first child ( temp 4-component vector of float) +0:47 Color: direct index for structure ( temp 4-component vector of float) +0:47 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:47 Constant: +0:47 0 (const int) +0:47 Construct vec4 ( temp 4-component vector of float) +0:47 'e2_11' ( temp float) +0:48 Branch: Return with expression +0:48 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:10 Function Definition: main( ( temp void) +0:10 Function Parameters: +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:10 Color: direct index for structure ( temp 4-component vector of float) +0:10 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:10 Constant: +0:10 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int idx, uniform 3X2 matrix of float um}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 83 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 80 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + Name 10 "@main(" + Name 13 "e1_00" + Name 15 "e1_01" + Name 17 "e1_10" + Name 19 "e1_11" + Name 21 "e1_20" + Name 23 "e1_21" + Name 25 "e2_00" + Name 27 "e2_01" + Name 29 "e2_10" + Name 31 "e2_11" + Name 33 "e2_20" + Name 35 "e2_21" + Name 39 "r0a" + Name 41 "r1a" + Name 43 "r2a" + Name 45 "r0b" + Name 52 "$Global" + MemberName 52($Global) 0 "idx" + MemberName 52($Global) 1 "um" + Name 54 "" + Name 60 "indexable" + Name 63 "r0c" + Name 71 "psout" + Name 80 "@entryPointOutput.Color" + MemberDecorate 52($Global) 0 Offset 0 + MemberDecorate 52($Global) 1 RowMajor + MemberDecorate 52($Global) 1 Offset 16 + MemberDecorate 52($Global) 1 MatrixStride 16 + Decorate 52($Global) Block + Decorate 54 DescriptorSet 0 + Decorate 80(@entryPointOutput.Color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 6(float) + 14: 6(float) Constant 1092616192 + 16: 6(float) Constant 1093664768 + 18: 6(float) Constant 1094713344 + 20: 6(float) Constant 1095761920 + 22: 6(float) Constant 1096810496 + 24: 6(float) Constant 1097859072 + 26: 6(float) Constant 1101004800 + 28: 6(float) Constant 1101529088 + 30: 6(float) Constant 1102053376 + 32: 6(float) Constant 1102577664 + 34: 6(float) Constant 1103101952 + 36: 6(float) Constant 1103626240 + 37: TypeVector 6(float) 2 + 38: TypePointer Function 37(fvec2) + 40: 37(fvec2) ConstantComposite 14 16 + 42: 37(fvec2) ConstantComposite 18 20 + 44: 37(fvec2) ConstantComposite 22 24 + 46: TypeMatrix 37(fvec2) 3 + 47: 37(fvec2) ConstantComposite 26 28 + 48: 37(fvec2) ConstantComposite 30 32 + 49: 37(fvec2) ConstantComposite 34 36 + 50: 46 ConstantComposite 47 48 49 + 51: TypeInt 32 1 + 52($Global): TypeStruct 51(int) 46 + 53: TypePointer Uniform 52($Global) + 54: 53(ptr) Variable Uniform + 55: 51(int) Constant 0 + 56: TypePointer Uniform 51(int) + 59: TypePointer Function 46 + 64: 51(int) Constant 1 + 67: TypePointer Uniform 37(fvec2) + 70: TypePointer Function 8(PS_OUTPUT) + 74: TypePointer Function 7(fvec4) + 79: TypePointer Output 7(fvec4) +80(@entryPointOutput.Color): 79(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 81:8(PS_OUTPUT) FunctionCall 10(@main() + 82: 7(fvec4) CompositeExtract 81 0 + Store 80(@entryPointOutput.Color) 82 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(e1_00): 12(ptr) Variable Function + 15(e1_01): 12(ptr) Variable Function + 17(e1_10): 12(ptr) Variable Function + 19(e1_11): 12(ptr) Variable Function + 21(e1_20): 12(ptr) Variable Function + 23(e1_21): 12(ptr) Variable Function + 25(e2_00): 12(ptr) Variable Function + 27(e2_01): 12(ptr) Variable Function + 29(e2_10): 12(ptr) Variable Function + 31(e2_11): 12(ptr) Variable Function + 33(e2_20): 12(ptr) Variable Function + 35(e2_21): 12(ptr) Variable Function + 39(r0a): 38(ptr) Variable Function + 41(r1a): 38(ptr) Variable Function + 43(r2a): 38(ptr) Variable Function + 45(r0b): 38(ptr) Variable Function + 60(indexable): 59(ptr) Variable Function + 63(r0c): 38(ptr) Variable Function + 71(psout): 70(ptr) Variable Function + Store 13(e1_00) 14 + Store 15(e1_01) 16 + Store 17(e1_10) 18 + Store 19(e1_11) 20 + Store 21(e1_20) 22 + Store 23(e1_21) 24 + Store 25(e2_00) 26 + Store 27(e2_01) 28 + Store 29(e2_10) 30 + Store 31(e2_11) 32 + Store 33(e2_20) 34 + Store 35(e2_21) 36 + Store 39(r0a) 40 + Store 41(r1a) 42 + Store 43(r2a) 44 + 57: 56(ptr) AccessChain 54 55 + 58: 51(int) Load 57 + Store 60(indexable) 50 + 61: 38(ptr) AccessChain 60(indexable) 58 + 62: 37(fvec2) Load 61 + Store 45(r0b) 62 + 65: 56(ptr) AccessChain 54 55 + 66: 51(int) Load 65 + 68: 67(ptr) AccessChain 54 64 66 + 69: 37(fvec2) Load 68 + Store 63(r0c) 69 + 72: 6(float) Load 31(e2_11) + 73: 7(fvec4) CompositeConstruct 72 72 72 72 + 75: 74(ptr) AccessChain 71(psout) 55 + Store 75 73 + 76:8(PS_OUTPUT) Load 71(psout) + ReturnValue 76 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.max.frag.out b/deps/glslang/Test/baseResults/hlsl.max.frag.out new file mode 100644 index 00000000..db215a2c --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.max.frag.out @@ -0,0 +1,129 @@ +hlsl.max.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(vf4;vf4; ( temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input1' ( in 4-component vector of float) +0:2 'input2' ( in 4-component vector of float) +0:? Sequence +0:3 Branch: Return with expression +0:3 max ( temp 4-component vector of float) +0:3 'input1' ( in 4-component vector of float) +0:3 'input2' ( in 4-component vector of float) +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? 'input1' ( temp 4-component vector of float) +0:? 'input1' (layout( location=0) in 4-component vector of float) +0:2 move second child to first child ( temp 4-component vector of float) +0:? 'input2' ( temp 4-component vector of float) +0:? 'input2' (layout( location=1) in 4-component vector of float) +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @PixelShaderFunction(vf4;vf4; ( temp 4-component vector of float) +0:? 'input1' ( temp 4-component vector of float) +0:? 'input2' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input1' (layout( location=0) in 4-component vector of float) +0:? 'input2' (layout( location=1) in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(vf4;vf4; ( temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input1' ( in 4-component vector of float) +0:2 'input2' ( in 4-component vector of float) +0:? Sequence +0:3 Branch: Return with expression +0:3 max ( temp 4-component vector of float) +0:3 'input1' ( in 4-component vector of float) +0:3 'input2' ( in 4-component vector of float) +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? 'input1' ( temp 4-component vector of float) +0:? 'input1' (layout( location=0) in 4-component vector of float) +0:2 move second child to first child ( temp 4-component vector of float) +0:? 'input2' ( temp 4-component vector of float) +0:? 'input2' (layout( location=1) in 4-component vector of float) +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @PixelShaderFunction(vf4;vf4; ( temp 4-component vector of float) +0:? 'input1' ( temp 4-component vector of float) +0:? 'input2' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input1' (layout( location=0) in 4-component vector of float) +0:? 'input2' (layout( location=1) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 33 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 21 24 27 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 12 "@PixelShaderFunction(vf4;vf4;" + Name 10 "input1" + Name 11 "input2" + Name 19 "input1" + Name 21 "input1" + Name 23 "input2" + Name 24 "input2" + Name 27 "@entryPointOutput" + Name 28 "param" + Name 30 "param" + Decorate 21(input1) Location 0 + Decorate 24(input2) Location 1 + Decorate 27(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) 8(ptr) + 20: TypePointer Input 7(fvec4) + 21(input1): 20(ptr) Variable Input + 24(input2): 20(ptr) Variable Input + 26: TypePointer Output 7(fvec4) +27(@entryPointOutput): 26(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 19(input1): 8(ptr) Variable Function + 23(input2): 8(ptr) Variable Function + 28(param): 8(ptr) Variable Function + 30(param): 8(ptr) Variable Function + 22: 7(fvec4) Load 21(input1) + Store 19(input1) 22 + 25: 7(fvec4) Load 24(input2) + Store 23(input2) 25 + 29: 7(fvec4) Load 19(input1) + Store 28(param) 29 + 31: 7(fvec4) Load 23(input2) + Store 30(param) 31 + 32: 7(fvec4) FunctionCall 12(@PixelShaderFunction(vf4;vf4;) 28(param) 30(param) + Store 27(@entryPointOutput) 32 + Return + FunctionEnd +12(@PixelShaderFunction(vf4;vf4;): 7(fvec4) Function None 9 + 10(input1): 8(ptr) FunctionParameter + 11(input2): 8(ptr) FunctionParameter + 13: Label + 14: 7(fvec4) Load 10(input1) + 15: 7(fvec4) Load 11(input2) + 16: 7(fvec4) ExtInst 1(GLSL.std.450) 40(FMax) 14 15 + ReturnValue 16 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.memberFunCall.frag.out b/deps/glslang/Test/baseResults/hlsl.memberFunCall.frag.out new file mode 100644 index 00000000..01cb99ad --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.memberFunCall.frag.out @@ -0,0 +1,264 @@ +hlsl.memberFunCall.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:1 Function Definition: method3(f1; ( temp float) +0:1 Function Parameters: +0:1 'a' ( in float) +0:? Sequence +0:1 Branch: Return with expression +0:1 Constant: +0:1 1.000000 +0:4 Function Definition: myContext::method1( ( temp float) +0:4 Function Parameters: +0:4 '@this' ( temp structure{ temp float f}) +0:? Sequence +0:4 Branch: Return with expression +0:4 Function Call: myContext::method2( ( temp float) +0:? '@this' ( temp structure{ temp float f}) +0:5 Function Definition: myContext::method2( ( temp float) +0:5 Function Parameters: +0:5 '@this' ( temp structure{ temp float f}) +0:? Sequence +0:5 Branch: Return with expression +0:5 Function Call: myContext::method3(f1; ( temp float) +0:? '@this' ( temp structure{ temp float f}) +0:5 Constant: +0:5 1.000000 +0:6 Function Definition: myContext::method3(f1; ( temp float) +0:6 Function Parameters: +0:6 '@this' ( temp structure{ temp float f}) +0:6 'a' ( in float) +0:? Sequence +0:6 Branch: Return with expression +0:6 Function Call: myContext::method4(f1;f1; ( temp float) +0:? '@this' ( temp structure{ temp float f}) +0:6 'a' ( in float) +0:6 'a' ( in float) +0:7 Function Definition: myContext::method4(f1;f1; ( temp float) +0:7 Function Parameters: +0:7 '@this' ( temp structure{ temp float f}) +0:7 'a' ( in float) +0:7 'b' ( in float) +0:? Sequence +0:7 Branch: Return with expression +0:7 add ( temp float) +0:7 add ( temp float) +0:7 'a' ( in float) +0:7 'b' ( in float) +0:7 f: direct index for structure ( temp float) +0:7 '@this' ( temp structure{ temp float f}) +0:7 Constant: +0:7 0 (const uint) +0:12 Function Definition: @main( ( temp 4-component vector of float) +0:12 Function Parameters: +0:? Sequence +0:14 move second child to first child ( temp float) +0:14 f: direct index for structure ( temp float) +0:14 'context' ( temp structure{ temp float f}) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 3.000000 +0:15 Branch: Return with expression +0:15 Construct vec4 ( temp 4-component vector of float) +0:15 Function Call: myContext::method1( ( temp float) +0:15 'context' ( temp structure{ temp float f}) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:12 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:1 Function Definition: method3(f1; ( temp float) +0:1 Function Parameters: +0:1 'a' ( in float) +0:? Sequence +0:1 Branch: Return with expression +0:1 Constant: +0:1 1.000000 +0:4 Function Definition: myContext::method1( ( temp float) +0:4 Function Parameters: +0:4 '@this' ( temp structure{ temp float f}) +0:? Sequence +0:4 Branch: Return with expression +0:4 Function Call: myContext::method2( ( temp float) +0:? '@this' ( temp structure{ temp float f}) +0:5 Function Definition: myContext::method2( ( temp float) +0:5 Function Parameters: +0:5 '@this' ( temp structure{ temp float f}) +0:? Sequence +0:5 Branch: Return with expression +0:5 Function Call: myContext::method3(f1; ( temp float) +0:? '@this' ( temp structure{ temp float f}) +0:5 Constant: +0:5 1.000000 +0:6 Function Definition: myContext::method3(f1; ( temp float) +0:6 Function Parameters: +0:6 '@this' ( temp structure{ temp float f}) +0:6 'a' ( in float) +0:? Sequence +0:6 Branch: Return with expression +0:6 Function Call: myContext::method4(f1;f1; ( temp float) +0:? '@this' ( temp structure{ temp float f}) +0:6 'a' ( in float) +0:6 'a' ( in float) +0:7 Function Definition: myContext::method4(f1;f1; ( temp float) +0:7 Function Parameters: +0:7 '@this' ( temp structure{ temp float f}) +0:7 'a' ( in float) +0:7 'b' ( in float) +0:? Sequence +0:7 Branch: Return with expression +0:7 add ( temp float) +0:7 add ( temp float) +0:7 'a' ( in float) +0:7 'b' ( in float) +0:7 f: direct index for structure ( temp float) +0:7 '@this' ( temp structure{ temp float f}) +0:7 Constant: +0:7 0 (const uint) +0:12 Function Definition: @main( ( temp 4-component vector of float) +0:12 Function Parameters: +0:? Sequence +0:14 move second child to first child ( temp float) +0:14 f: direct index for structure ( temp float) +0:14 'context' ( temp structure{ temp float f}) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 3.000000 +0:15 Branch: Return with expression +0:15 Construct vec4 ( temp 4-component vector of float) +0:15 Function Call: myContext::method1( ( temp float) +0:15 'context' ( temp structure{ temp float f}) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:12 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 73 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 71 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 10 "method3(f1;" + Name 9 "a" + Name 12 "myContext" + MemberName 12(myContext) 0 "f" + Name 16 "myContext::method1(" + Name 15 "@this" + Name 19 "myContext::method2(" + Name 18 "@this" + Name 24 "myContext::method3(f1;" + Name 22 "@this" + Name 23 "a" + Name 30 "myContext::method4(f1;f1;" + Name 27 "@this" + Name 28 "a" + Name 29 "b" + Name 34 "@main(" + Name 42 "param" + Name 46 "param" + Name 48 "param" + Name 63 "context" + Name 71 "@entryPointOutput" + Decorate 71(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeFunction 6(float) 7(ptr) + 12(myContext): TypeStruct 6(float) + 13: TypePointer Function 12(myContext) + 14: TypeFunction 6(float) 13(ptr) + 21: TypeFunction 6(float) 13(ptr) 7(ptr) + 26: TypeFunction 6(float) 13(ptr) 7(ptr) 7(ptr) + 32: TypeVector 6(float) 4 + 33: TypeFunction 32(fvec4) + 36: 6(float) Constant 1065353216 + 56: TypeInt 32 1 + 57: 56(int) Constant 0 + 64: 6(float) Constant 1077936128 + 70: TypePointer Output 32(fvec4) +71(@entryPointOutput): 70(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 72: 32(fvec4) FunctionCall 34(@main() + Store 71(@entryPointOutput) 72 + Return + FunctionEnd + 10(method3(f1;): 6(float) Function None 8 + 9(a): 7(ptr) FunctionParameter + 11: Label + ReturnValue 36 + FunctionEnd +16(myContext::method1(): 6(float) Function None 14 + 15(@this): 13(ptr) FunctionParameter + 17: Label + 39: 6(float) FunctionCall 19(myContext::method2() 15(@this) + ReturnValue 39 + FunctionEnd +19(myContext::method2(): 6(float) Function None 14 + 18(@this): 13(ptr) FunctionParameter + 20: Label + 42(param): 7(ptr) Variable Function + Store 42(param) 36 + 43: 6(float) FunctionCall 24(myContext::method3(f1;) 18(@this) 42(param) + ReturnValue 43 + FunctionEnd +24(myContext::method3(f1;): 6(float) Function None 21 + 22(@this): 13(ptr) FunctionParameter + 23(a): 7(ptr) FunctionParameter + 25: Label + 46(param): 7(ptr) Variable Function + 48(param): 7(ptr) Variable Function + 47: 6(float) Load 23(a) + Store 46(param) 47 + 49: 6(float) Load 23(a) + Store 48(param) 49 + 50: 6(float) FunctionCall 30(myContext::method4(f1;f1;) 22(@this) 46(param) 48(param) + ReturnValue 50 + FunctionEnd +30(myContext::method4(f1;f1;): 6(float) Function None 26 + 27(@this): 13(ptr) FunctionParameter + 28(a): 7(ptr) FunctionParameter + 29(b): 7(ptr) FunctionParameter + 31: Label + 53: 6(float) Load 28(a) + 54: 6(float) Load 29(b) + 55: 6(float) FAdd 53 54 + 58: 7(ptr) AccessChain 27(@this) 57 + 59: 6(float) Load 58 + 60: 6(float) FAdd 55 59 + ReturnValue 60 + FunctionEnd + 34(@main(): 32(fvec4) Function None 33 + 35: Label + 63(context): 13(ptr) Variable Function + 65: 7(ptr) AccessChain 63(context) 57 + Store 65 64 + 66: 6(float) FunctionCall 16(myContext::method1() 63(context) + 67: 32(fvec4) CompositeConstruct 66 66 66 66 + ReturnValue 67 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.mintypes.frag.out b/deps/glslang/Test/baseResults/hlsl.mintypes.frag.out new file mode 100644 index 00000000..8722cf27 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.mintypes.frag.out @@ -0,0 +1,238 @@ +hlsl.mintypes.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:9 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:9 Function Parameters: +0:? Sequence +0:40 add ( temp mediump 2-component vector of float) +0:40 'mf16_2' ( temp mediump 2-component vector of float) +0:40 'mf16' ( temp mediump float) +0:41 add ( temp mediump 2-component vector of float) +0:41 'mf10_2' ( temp mediump 2-component vector of float) +0:41 'mf10' ( temp mediump float) +0:42 add ( temp mediump 2-component vector of int) +0:42 'mi16_2' ( temp mediump 2-component vector of int) +0:42 'mi16' ( temp mediump int) +0:43 add ( temp mediump 2-component vector of int) +0:43 'mi12_2' ( temp mediump 2-component vector of int) +0:43 'mi12' ( temp mediump int) +0:44 add ( temp mediump 2-component vector of uint) +0:44 'mu16_2' ( temp mediump 2-component vector of uint) +0:44 'mu16' ( temp mediump uint) +0:47 move second child to first child ( temp 4-component vector of float) +0:47 Color: direct index for structure ( temp 4-component vector of float) +0:47 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 0.000000 +0:47 0.000000 +0:47 0.000000 +0:47 0.000000 +0:48 Branch: Return with expression +0:48 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:9 Function Definition: main( ( temp void) +0:9 Function Parameters: +0:? Sequence +0:9 Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:9 Color: direct index for structure ( temp 4-component vector of float) +0:9 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:9 Constant: +0:9 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform mediump float b1a, uniform mediump float b1b}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:9 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:9 Function Parameters: +0:? Sequence +0:40 add ( temp mediump 2-component vector of float) +0:40 'mf16_2' ( temp mediump 2-component vector of float) +0:40 'mf16' ( temp mediump float) +0:41 add ( temp mediump 2-component vector of float) +0:41 'mf10_2' ( temp mediump 2-component vector of float) +0:41 'mf10' ( temp mediump float) +0:42 add ( temp mediump 2-component vector of int) +0:42 'mi16_2' ( temp mediump 2-component vector of int) +0:42 'mi16' ( temp mediump int) +0:43 add ( temp mediump 2-component vector of int) +0:43 'mi12_2' ( temp mediump 2-component vector of int) +0:43 'mi12' ( temp mediump int) +0:44 add ( temp mediump 2-component vector of uint) +0:44 'mu16_2' ( temp mediump 2-component vector of uint) +0:44 'mu16' ( temp mediump uint) +0:47 move second child to first child ( temp 4-component vector of float) +0:47 Color: direct index for structure ( temp 4-component vector of float) +0:47 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 0.000000 +0:47 0.000000 +0:47 0.000000 +0:47 0.000000 +0:48 Branch: Return with expression +0:48 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:9 Function Definition: main( ( temp void) +0:9 Function Parameters: +0:? Sequence +0:9 Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:9 Color: direct index for structure ( temp 4-component vector of float) +0:9 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:9 Constant: +0:9 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform mediump float b1a, uniform mediump float b1b}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 70 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 64 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + Name 10 "@main(" + Name 14 "mf16_2" + Name 17 "mf16" + Name 21 "mf10_2" + Name 23 "mf10" + Name 30 "mi16_2" + Name 33 "mi16" + Name 37 "mi12_2" + Name 39 "mi12" + Name 46 "mu16_2" + Name 49 "mu16" + Name 54 "psout" + Name 64 "@entryPointOutput.Color" + Name 67 "$Global" + MemberName 67($Global) 0 "b1a" + MemberName 67($Global) 1 "b1b" + Name 69 "" + Decorate 14(mf16_2) RelaxedPrecision + Decorate 15 RelaxedPrecision + Decorate 17(mf16) RelaxedPrecision + Decorate 18 RelaxedPrecision + Decorate 19 RelaxedPrecision + Decorate 20 RelaxedPrecision + Decorate 21(mf10_2) RelaxedPrecision + Decorate 22 RelaxedPrecision + Decorate 23(mf10) RelaxedPrecision + Decorate 24 RelaxedPrecision + Decorate 25 RelaxedPrecision + Decorate 26 RelaxedPrecision + Decorate 30(mi16_2) RelaxedPrecision + Decorate 31 RelaxedPrecision + Decorate 33(mi16) RelaxedPrecision + Decorate 34 RelaxedPrecision + Decorate 35 RelaxedPrecision + Decorate 36 RelaxedPrecision + Decorate 37(mi12_2) RelaxedPrecision + Decorate 38 RelaxedPrecision + Decorate 39(mi12) RelaxedPrecision + Decorate 40 RelaxedPrecision + Decorate 41 RelaxedPrecision + Decorate 42 RelaxedPrecision + Decorate 46(mu16_2) RelaxedPrecision + Decorate 47 RelaxedPrecision + Decorate 49(mu16) RelaxedPrecision + Decorate 50 RelaxedPrecision + Decorate 51 RelaxedPrecision + Decorate 52 RelaxedPrecision + Decorate 64(@entryPointOutput.Color) Location 0 + MemberDecorate 67($Global) 0 RelaxedPrecision + MemberDecorate 67($Global) 0 Offset 0 + MemberDecorate 67($Global) 1 RelaxedPrecision + MemberDecorate 67($Global) 1 Offset 4 + Decorate 67($Global) Block + Decorate 69 DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeVector 6(float) 2 + 13: TypePointer Function 12(fvec2) + 16: TypePointer Function 6(float) + 27: TypeInt 32 1 + 28: TypeVector 27(int) 2 + 29: TypePointer Function 28(ivec2) + 32: TypePointer Function 27(int) + 43: TypeInt 32 0 + 44: TypeVector 43(int) 2 + 45: TypePointer Function 44(ivec2) + 48: TypePointer Function 43(int) + 53: TypePointer Function 8(PS_OUTPUT) + 55: 27(int) Constant 0 + 56: 6(float) Constant 0 + 57: 7(fvec4) ConstantComposite 56 56 56 56 + 58: TypePointer Function 7(fvec4) + 63: TypePointer Output 7(fvec4) +64(@entryPointOutput.Color): 63(ptr) Variable Output + 67($Global): TypeStruct 6(float) 6(float) + 68: TypePointer Uniform 67($Global) + 69: 68(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + 65:8(PS_OUTPUT) FunctionCall 10(@main() + 66: 7(fvec4) CompositeExtract 65 0 + Store 64(@entryPointOutput.Color) 66 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 14(mf16_2): 13(ptr) Variable Function + 17(mf16): 16(ptr) Variable Function + 21(mf10_2): 13(ptr) Variable Function + 23(mf10): 16(ptr) Variable Function + 30(mi16_2): 29(ptr) Variable Function + 33(mi16): 32(ptr) Variable Function + 37(mi12_2): 29(ptr) Variable Function + 39(mi12): 32(ptr) Variable Function + 46(mu16_2): 45(ptr) Variable Function + 49(mu16): 48(ptr) Variable Function + 54(psout): 53(ptr) Variable Function + 15: 12(fvec2) Load 14(mf16_2) + 18: 6(float) Load 17(mf16) + 19: 12(fvec2) CompositeConstruct 18 18 + 20: 12(fvec2) FAdd 15 19 + 22: 12(fvec2) Load 21(mf10_2) + 24: 6(float) Load 23(mf10) + 25: 12(fvec2) CompositeConstruct 24 24 + 26: 12(fvec2) FAdd 22 25 + 31: 28(ivec2) Load 30(mi16_2) + 34: 27(int) Load 33(mi16) + 35: 28(ivec2) CompositeConstruct 34 34 + 36: 28(ivec2) IAdd 31 35 + 38: 28(ivec2) Load 37(mi12_2) + 40: 27(int) Load 39(mi12) + 41: 28(ivec2) CompositeConstruct 40 40 + 42: 28(ivec2) IAdd 38 41 + 47: 44(ivec2) Load 46(mu16_2) + 50: 43(int) Load 49(mu16) + 51: 44(ivec2) CompositeConstruct 50 50 + 52: 44(ivec2) IAdd 47 51 + 59: 58(ptr) AccessChain 54(psout) 55 + Store 59 57 + 60:8(PS_OUTPUT) Load 54(psout) + ReturnValue 60 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.mip.negative.frag.out b/deps/glslang/Test/baseResults/hlsl.mip.negative.frag.out new file mode 100644 index 00000000..36f41377 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.mip.negative.frag.out @@ -0,0 +1,68 @@ +hlsl.mip.negative.frag +ERROR: 0:5: '' : unterminated mips operator: +ERROR: 1 compilation errors. No code generated. + + +Shader version: 500 +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:4 Function Definition: @main( ( temp 4-component vector of float) +0:4 Function Parameters: +0:? Sequence +0:? textureFetch ( temp 4-component vector of float) +0:5 'g_tTex2df4' ( uniform texture2D) +0:? Constant: +0:? 3 (const uint) +0:? 4 (const uint) +0:5 Constant: +0:5 2 (const int) +0:7 Branch: Return with expression +0:7 Constant: +0:7 0.000000 +0:7 0.000000 +0:7 0.000000 +0:7 0.000000 +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:4 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_tTex2df4' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:4 Function Definition: @main( ( temp 4-component vector of float) +0:4 Function Parameters: +0:? Sequence +0:? textureFetch ( temp 4-component vector of float) +0:5 'g_tTex2df4' ( uniform texture2D) +0:? Constant: +0:? 3 (const uint) +0:? 4 (const uint) +0:5 Constant: +0:5 2 (const int) +0:7 Branch: Return with expression +0:7 Constant: +0:7 0.000000 +0:7 0.000000 +0:7 0.000000 +0:7 0.000000 +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:4 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_tTex2df4' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/hlsl.mip.negative2.frag.out b/deps/glslang/Test/baseResults/hlsl.mip.negative2.frag.out new file mode 100644 index 00000000..75cf95fc --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.mip.negative2.frag.out @@ -0,0 +1,74 @@ +hlsl.mip.negative2.frag +ERROR: 0:5: 'r' : unexpected operator on texture type: uniform texture2D +ERROR: 1 compilation errors. No code generated. + + +Shader version: 500 +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:4 Function Definition: @main( ( temp 4-component vector of float) +0:4 Function Parameters: +0:? Sequence +0:5 direct index ( temp float) +0:5 textureFetch ( temp 4-component vector of float) +0:5 'g_tTex2df4' ( uniform texture2D) +0:5 Constant: +0:5 2 (const int) +0:5 Constant: +0:5 0 (const int) +0:? Constant: +0:? 3 (const uint) +0:? 4 (const uint) +0:7 Branch: Return with expression +0:7 Constant: +0:7 0.000000 +0:7 0.000000 +0:7 0.000000 +0:7 0.000000 +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:4 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_tTex2df4' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:4 Function Definition: @main( ( temp 4-component vector of float) +0:4 Function Parameters: +0:? Sequence +0:5 direct index ( temp float) +0:5 textureFetch ( temp 4-component vector of float) +0:5 'g_tTex2df4' ( uniform texture2D) +0:5 Constant: +0:5 2 (const int) +0:5 Constant: +0:5 0 (const int) +0:? Constant: +0:? 3 (const uint) +0:? 4 (const uint) +0:7 Branch: Return with expression +0:7 Constant: +0:7 0.000000 +0:7 0.000000 +0:7 0.000000 +0:7 0.000000 +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:4 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_tTex2df4' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/hlsl.mip.operator.frag.out b/deps/glslang/Test/baseResults/hlsl.mip.operator.frag.out new file mode 100644 index 00000000..eb884da9 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.mip.operator.frag.out @@ -0,0 +1,209 @@ +hlsl.mip.operator.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main( ( temp 4-component vector of float) +0:5 Function Parameters: +0:? Sequence +0:13 Branch: Return with expression +0:9 add ( temp 4-component vector of float) +0:6 add ( temp 4-component vector of float) +0:? textureFetch ( temp 4-component vector of float) +0:6 'g_tTex2df4' ( uniform texture2D) +0:? Constant: +0:? 3 (const uint) +0:? 4 (const uint) +0:6 Constant: +0:6 2 (const int) +0:? textureFetch ( temp 4-component vector of float) +0:9 'g_tTex2df4a' ( uniform texture2DArray) +0:? Constant: +0:? 6 (const uint) +0:? 7 (const uint) +0:? 8 (const uint) +0:9 Constant: +0:9 5 (const uint) +0:13 textureFetch ( temp 4-component vector of float) +0:13 'g_tTex2df4' ( uniform texture2D) +0:13 Convert float to uint ( temp 2-component vector of uint) +0:13 vector swizzle ( temp 2-component vector of float) +0:? textureFetch ( temp 4-component vector of float) +0:13 'g_tTex2df4' ( uniform texture2D) +0:? Constant: +0:? 14 (const uint) +0:? 15 (const uint) +0:13 Constant: +0:13 13 (const int) +0:13 Sequence +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 Convert float to uint ( temp uint) +0:13 direct index ( temp float) +0:? textureFetch ( temp 4-component vector of float) +0:13 'g_tTex2df4' ( uniform texture2D) +0:? Constant: +0:? 10 (const uint) +0:? 11 (const uint) +0:13 Constant: +0:13 9 (const int) +0:13 Constant: +0:13 0 (const int) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:5 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main( ( temp 4-component vector of float) +0:5 Function Parameters: +0:? Sequence +0:13 Branch: Return with expression +0:9 add ( temp 4-component vector of float) +0:6 add ( temp 4-component vector of float) +0:? textureFetch ( temp 4-component vector of float) +0:6 'g_tTex2df4' ( uniform texture2D) +0:? Constant: +0:? 3 (const uint) +0:? 4 (const uint) +0:6 Constant: +0:6 2 (const int) +0:? textureFetch ( temp 4-component vector of float) +0:9 'g_tTex2df4a' ( uniform texture2DArray) +0:? Constant: +0:? 6 (const uint) +0:? 7 (const uint) +0:? 8 (const uint) +0:9 Constant: +0:9 5 (const uint) +0:13 textureFetch ( temp 4-component vector of float) +0:13 'g_tTex2df4' ( uniform texture2D) +0:13 Convert float to uint ( temp 2-component vector of uint) +0:13 vector swizzle ( temp 2-component vector of float) +0:? textureFetch ( temp 4-component vector of float) +0:13 'g_tTex2df4' ( uniform texture2D) +0:? Constant: +0:? 14 (const uint) +0:? 15 (const uint) +0:13 Constant: +0:13 13 (const int) +0:13 Sequence +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 Convert float to uint ( temp uint) +0:13 direct index ( temp float) +0:? textureFetch ( temp 4-component vector of float) +0:13 'g_tTex2df4' ( uniform texture2D) +0:? Constant: +0:? 10 (const uint) +0:? 11 (const uint) +0:13 Constant: +0:13 9 (const int) +0:13 Constant: +0:13 0 (const int) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:5 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 61 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 59 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 13 "g_tTex2df4" + Name 25 "g_tTex2df4a" + Name 59 "@entryPointOutput" + Decorate 13(g_tTex2df4) DescriptorSet 0 + Decorate 25(g_tTex2df4a) DescriptorSet 0 + Decorate 59(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeImage 6(float) 2D sampled format:Unknown + 12: TypePointer UniformConstant 11 + 13(g_tTex2df4): 12(ptr) Variable UniformConstant + 15: TypeInt 32 0 + 16: TypeVector 15(int) 2 + 17: 15(int) Constant 3 + 18: 15(int) Constant 4 + 19: 16(ivec2) ConstantComposite 17 18 + 20: TypeInt 32 1 + 21: 20(int) Constant 2 + 23: TypeImage 6(float) 2D array sampled format:Unknown + 24: TypePointer UniformConstant 23 + 25(g_tTex2df4a): 24(ptr) Variable UniformConstant + 27: TypeVector 15(int) 3 + 28: 15(int) Constant 6 + 29: 15(int) Constant 7 + 30: 15(int) Constant 8 + 31: 27(ivec3) ConstantComposite 28 29 30 + 32: 15(int) Constant 5 + 37: 15(int) Constant 14 + 38: 15(int) Constant 15 + 39: 16(ivec2) ConstantComposite 37 38 + 40: 20(int) Constant 13 + 42: TypeVector 6(float) 2 + 46: 15(int) Constant 10 + 47: 15(int) Constant 11 + 48: 16(ivec2) ConstantComposite 46 47 + 49: 20(int) Constant 9 + 51: 15(int) Constant 0 + 58: TypePointer Output 7(fvec4) +59(@entryPointOutput): 58(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 60: 7(fvec4) FunctionCall 9(@main() + Store 59(@entryPointOutput) 60 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 14: 11 Load 13(g_tTex2df4) + 22: 7(fvec4) ImageFetch 14 19 Lod 21 + 26: 23 Load 25(g_tTex2df4a) + 33: 7(fvec4) ImageFetch 26 31 Lod 32 + 34: 7(fvec4) FAdd 22 33 + 35: 11 Load 13(g_tTex2df4) + 36: 11 Load 13(g_tTex2df4) + 41: 7(fvec4) ImageFetch 36 39 Lod 40 + 43: 42(fvec2) VectorShuffle 41 41 0 1 + 44: 16(ivec2) ConvertFToU 43 + 45: 11 Load 13(g_tTex2df4) + 50: 7(fvec4) ImageFetch 45 48 Lod 49 + 52: 6(float) CompositeExtract 50 0 + 53: 15(int) ConvertFToU 52 + 54: 7(fvec4) ImageFetch 35 44 Lod 53 + 55: 7(fvec4) FAdd 34 54 + ReturnValue 55 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.mul-truncate.frag.out b/deps/glslang/Test/baseResults/hlsl.mul-truncate.frag.out new file mode 100644 index 00000000..1973fad1 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.mul-truncate.frag.out @@ -0,0 +1,643 @@ +hlsl.mul-truncate.frag +WARNING: 0:24: '' : mul() matrix size mismatch +WARNING: 0:25: '' : mul() matrix size mismatch +WARNING: 0:28: '' : mul() matrix size mismatch +WARNING: 0:29: '' : mul() matrix size mismatch +WARNING: 0:32: '' : mul() matrix size mismatch +WARNING: 0:33: '' : mul() matrix size mismatch +WARNING: 0:34: '' : mul() matrix size mismatch +WARNING: 0:35: '' : mul() matrix size mismatch + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:18 Function Definition: @main( ( temp 4-component vector of float) +0:18 Function Parameters: +0:? Sequence +0:20 Sequence +0:20 move second child to first child ( temp float) +0:20 'r00' ( temp float) +0:20 dot-product ( temp float) +0:20 v2: direct index for structure (layout( row_major std140) uniform 2-component vector of float) +0:20 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:20 Constant: +0:20 8 (const uint) +0:20 Construct vec2 ( in 2-component vector of float) +0:20 v3: direct index for structure (layout( row_major std140) uniform 3-component vector of float) +0:20 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:20 Constant: +0:20 7 (const uint) +0:21 Sequence +0:21 move second child to first child ( temp float) +0:21 'r01' ( temp float) +0:21 dot-product ( temp float) +0:21 Construct vec2 ( in 2-component vector of float) +0:21 v4: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:21 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:21 Constant: +0:21 6 (const uint) +0:21 v2: direct index for structure (layout( row_major std140) uniform 2-component vector of float) +0:21 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:21 Constant: +0:21 8 (const uint) +0:24 Sequence +0:24 move second child to first child ( temp 4-component vector of float) +0:24 'r10' ( temp 4-component vector of float) +0:24 matrix-times-vector ( temp 4-component vector of float) +0:24 Construct mat3x4 ( uniform 3X4 matrix of float) +0:24 m44: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:24 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:24 Constant: +0:24 0 (const uint) +0:24 v3: direct index for structure (layout( row_major std140) uniform 3-component vector of float) +0:24 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:24 Constant: +0:24 7 (const uint) +0:25 Sequence +0:25 move second child to first child ( temp 4-component vector of float) +0:25 'r11' ( temp 4-component vector of float) +0:25 matrix-times-vector ( temp 4-component vector of float) +0:25 m34: direct index for structure (layout( row_major std140) uniform 3X4 matrix of float) +0:25 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:25 Constant: +0:25 2 (const uint) +0:25 Construct vec3 ( uniform 3-component vector of float) +0:25 v4: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:25 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:25 Constant: +0:25 6 (const uint) +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of float) +0:28 'r20' ( temp 4-component vector of float) +0:28 vector-times-matrix ( temp 4-component vector of float) +0:28 v3: direct index for structure (layout( row_major std140) uniform 3-component vector of float) +0:28 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:28 Constant: +0:28 7 (const uint) +0:28 Construct mat4x3 ( uniform 4X3 matrix of float) +0:28 m44: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:28 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:28 Constant: +0:28 0 (const uint) +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of float) +0:29 'r21' ( temp 4-component vector of float) +0:29 vector-times-matrix ( temp 4-component vector of float) +0:29 Construct vec3 ( uniform 3-component vector of float) +0:29 v4: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:29 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:29 Constant: +0:29 6 (const uint) +0:29 m43: direct index for structure (layout( row_major std140) uniform 4X3 matrix of float) +0:29 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:29 Constant: +0:29 1 (const uint) +0:32 Sequence +0:32 move second child to first child ( temp 2X3 matrix of float) +0:32 'r30' ( temp 2X3 matrix of float) +0:32 matrix-multiply ( temp 2X3 matrix of float) +0:32 m33: direct index for structure (layout( row_major std140) uniform 3X3 matrix of float) +0:32 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:32 Constant: +0:32 3 (const uint) +0:32 Construct mat2x3 ( uniform 2X3 matrix of float) +0:32 m24: direct index for structure (layout( row_major std140) uniform 2X4 matrix of float) +0:32 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:32 Constant: +0:32 4 (const uint) +0:33 Sequence +0:33 move second child to first child ( temp 3X4 matrix of float) +0:33 'r31' ( temp 3X4 matrix of float) +0:33 matrix-multiply ( temp 3X4 matrix of float) +0:33 m24: direct index for structure (layout( row_major std140) uniform 2X4 matrix of float) +0:33 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:33 Constant: +0:33 4 (const uint) +0:33 Construct mat3x2 ( uniform 3X2 matrix of float) +0:33 m33: direct index for structure (layout( row_major std140) uniform 3X3 matrix of float) +0:33 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:33 Constant: +0:33 3 (const uint) +0:34 Sequence +0:34 move second child to first child ( temp 3X2 matrix of float) +0:34 'r32' ( temp 3X2 matrix of float) +0:34 matrix-multiply ( temp 3X2 matrix of float) +0:34 Construct mat3x2 ( uniform 3X2 matrix of float) +0:34 m42: direct index for structure (layout( row_major std140) uniform 4X2 matrix of float) +0:34 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:34 Constant: +0:34 5 (const uint) +0:34 m33: direct index for structure (layout( row_major std140) uniform 3X3 matrix of float) +0:34 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:34 Constant: +0:34 3 (const uint) +0:35 Sequence +0:35 move second child to first child ( temp 4X3 matrix of float) +0:35 'r33' ( temp 4X3 matrix of float) +0:35 matrix-multiply ( temp 4X3 matrix of float) +0:35 Construct mat2x3 ( uniform 2X3 matrix of float) +0:35 m33: direct index for structure (layout( row_major std140) uniform 3X3 matrix of float) +0:35 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:35 Constant: +0:35 3 (const uint) +0:35 m42: direct index for structure (layout( row_major std140) uniform 4X2 matrix of float) +0:35 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:35 Constant: +0:35 5 (const uint) +0:37 Branch: Return with expression +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 'r10' ( temp 4-component vector of float) +0:37 'r11' ( temp 4-component vector of float) +0:37 'r20' ( temp 4-component vector of float) +0:37 'r21' ( temp 4-component vector of float) +0:37 'r00' ( temp float) +0:37 'r01' ( temp float) +0:37 direct index ( temp float) +0:37 direct index ( temp 3-component vector of float) +0:37 'r30' ( temp 2X3 matrix of float) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 direct index ( temp 4-component vector of float) +0:37 'r31' ( temp 3X4 matrix of float) +0:37 Constant: +0:37 0 (const int) +0:37 direct index ( temp float) +0:37 direct index ( temp 2-component vector of float) +0:37 'r32' ( temp 3X2 matrix of float) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 direct index ( temp 4-component vector of float) +0:37 transpose ( temp 3X4 matrix of float) +0:37 'r33' ( temp 4X3 matrix of float) +0:37 Constant: +0:37 0 (const int) +0:18 Function Definition: main( ( temp void) +0:18 Function Parameters: +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:18 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:18 Function Definition: @main( ( temp 4-component vector of float) +0:18 Function Parameters: +0:? Sequence +0:20 Sequence +0:20 move second child to first child ( temp float) +0:20 'r00' ( temp float) +0:20 dot-product ( temp float) +0:20 v2: direct index for structure (layout( row_major std140) uniform 2-component vector of float) +0:20 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:20 Constant: +0:20 8 (const uint) +0:20 Construct vec2 ( in 2-component vector of float) +0:20 v3: direct index for structure (layout( row_major std140) uniform 3-component vector of float) +0:20 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:20 Constant: +0:20 7 (const uint) +0:21 Sequence +0:21 move second child to first child ( temp float) +0:21 'r01' ( temp float) +0:21 dot-product ( temp float) +0:21 Construct vec2 ( in 2-component vector of float) +0:21 v4: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:21 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:21 Constant: +0:21 6 (const uint) +0:21 v2: direct index for structure (layout( row_major std140) uniform 2-component vector of float) +0:21 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:21 Constant: +0:21 8 (const uint) +0:24 Sequence +0:24 move second child to first child ( temp 4-component vector of float) +0:24 'r10' ( temp 4-component vector of float) +0:24 matrix-times-vector ( temp 4-component vector of float) +0:24 Construct mat3x4 ( uniform 3X4 matrix of float) +0:24 m44: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:24 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:24 Constant: +0:24 0 (const uint) +0:24 v3: direct index for structure (layout( row_major std140) uniform 3-component vector of float) +0:24 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:24 Constant: +0:24 7 (const uint) +0:25 Sequence +0:25 move second child to first child ( temp 4-component vector of float) +0:25 'r11' ( temp 4-component vector of float) +0:25 matrix-times-vector ( temp 4-component vector of float) +0:25 m34: direct index for structure (layout( row_major std140) uniform 3X4 matrix of float) +0:25 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:25 Constant: +0:25 2 (const uint) +0:25 Construct vec3 ( uniform 3-component vector of float) +0:25 v4: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:25 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:25 Constant: +0:25 6 (const uint) +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of float) +0:28 'r20' ( temp 4-component vector of float) +0:28 vector-times-matrix ( temp 4-component vector of float) +0:28 v3: direct index for structure (layout( row_major std140) uniform 3-component vector of float) +0:28 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:28 Constant: +0:28 7 (const uint) +0:28 Construct mat4x3 ( uniform 4X3 matrix of float) +0:28 m44: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:28 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:28 Constant: +0:28 0 (const uint) +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of float) +0:29 'r21' ( temp 4-component vector of float) +0:29 vector-times-matrix ( temp 4-component vector of float) +0:29 Construct vec3 ( uniform 3-component vector of float) +0:29 v4: direct index for structure (layout( row_major std140) uniform 4-component vector of float) +0:29 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:29 Constant: +0:29 6 (const uint) +0:29 m43: direct index for structure (layout( row_major std140) uniform 4X3 matrix of float) +0:29 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:29 Constant: +0:29 1 (const uint) +0:32 Sequence +0:32 move second child to first child ( temp 2X3 matrix of float) +0:32 'r30' ( temp 2X3 matrix of float) +0:32 matrix-multiply ( temp 2X3 matrix of float) +0:32 m33: direct index for structure (layout( row_major std140) uniform 3X3 matrix of float) +0:32 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:32 Constant: +0:32 3 (const uint) +0:32 Construct mat2x3 ( uniform 2X3 matrix of float) +0:32 m24: direct index for structure (layout( row_major std140) uniform 2X4 matrix of float) +0:32 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:32 Constant: +0:32 4 (const uint) +0:33 Sequence +0:33 move second child to first child ( temp 3X4 matrix of float) +0:33 'r31' ( temp 3X4 matrix of float) +0:33 matrix-multiply ( temp 3X4 matrix of float) +0:33 m24: direct index for structure (layout( row_major std140) uniform 2X4 matrix of float) +0:33 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:33 Constant: +0:33 4 (const uint) +0:33 Construct mat3x2 ( uniform 3X2 matrix of float) +0:33 m33: direct index for structure (layout( row_major std140) uniform 3X3 matrix of float) +0:33 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:33 Constant: +0:33 3 (const uint) +0:34 Sequence +0:34 move second child to first child ( temp 3X2 matrix of float) +0:34 'r32' ( temp 3X2 matrix of float) +0:34 matrix-multiply ( temp 3X2 matrix of float) +0:34 Construct mat3x2 ( uniform 3X2 matrix of float) +0:34 m42: direct index for structure (layout( row_major std140) uniform 4X2 matrix of float) +0:34 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:34 Constant: +0:34 5 (const uint) +0:34 m33: direct index for structure (layout( row_major std140) uniform 3X3 matrix of float) +0:34 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:34 Constant: +0:34 3 (const uint) +0:35 Sequence +0:35 move second child to first child ( temp 4X3 matrix of float) +0:35 'r33' ( temp 4X3 matrix of float) +0:35 matrix-multiply ( temp 4X3 matrix of float) +0:35 Construct mat2x3 ( uniform 2X3 matrix of float) +0:35 m33: direct index for structure (layout( row_major std140) uniform 3X3 matrix of float) +0:35 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:35 Constant: +0:35 3 (const uint) +0:35 m42: direct index for structure (layout( row_major std140) uniform 4X2 matrix of float) +0:35 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:35 Constant: +0:35 5 (const uint) +0:37 Branch: Return with expression +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 add ( temp 4-component vector of float) +0:37 'r10' ( temp 4-component vector of float) +0:37 'r11' ( temp 4-component vector of float) +0:37 'r20' ( temp 4-component vector of float) +0:37 'r21' ( temp 4-component vector of float) +0:37 'r00' ( temp float) +0:37 'r01' ( temp float) +0:37 direct index ( temp float) +0:37 direct index ( temp 3-component vector of float) +0:37 'r30' ( temp 2X3 matrix of float) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 direct index ( temp 4-component vector of float) +0:37 'r31' ( temp 3X4 matrix of float) +0:37 Constant: +0:37 0 (const int) +0:37 direct index ( temp float) +0:37 direct index ( temp 2-component vector of float) +0:37 'r32' ( temp 3X2 matrix of float) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 direct index ( temp 4-component vector of float) +0:37 transpose ( temp 3X4 matrix of float) +0:37 'r33' ( temp 4X3 matrix of float) +0:37 Constant: +0:37 0 (const int) +0:18 Function Definition: main( ( temp void) +0:18 Function Parameters: +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:18 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float m44, layout( row_major std140) uniform 4X3 matrix of float m43, layout( row_major std140) uniform 3X4 matrix of float m34, layout( row_major std140) uniform 3X3 matrix of float m33, layout( row_major std140) uniform 2X4 matrix of float m24, layout( row_major std140) uniform 4X2 matrix of float m42, layout( row_major std140) uniform 4-component vector of float v4, layout( row_major std140) uniform 3-component vector of float v3, layout( row_major std140) uniform 2-component vector of float v2}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 190 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 188 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 12 "r00" + Name 21 "Matrix" + MemberName 21(Matrix) 0 "m44" + MemberName 21(Matrix) 1 "m43" + MemberName 21(Matrix) 2 "m34" + MemberName 21(Matrix) 3 "m33" + MemberName 21(Matrix) 4 "m24" + MemberName 21(Matrix) 5 "m42" + MemberName 21(Matrix) 6 "v4" + MemberName 21(Matrix) 7 "v3" + MemberName 21(Matrix) 8 "v2" + Name 23 "" + Name 37 "r01" + Name 49 "r10" + Name 61 "r11" + Name 73 "r20" + Name 88 "r21" + Name 102 "r30" + Name 118 "r31" + Name 133 "r32" + Name 146 "r33" + Name 188 "@entryPointOutput" + MemberDecorate 21(Matrix) 0 RowMajor + MemberDecorate 21(Matrix) 0 Offset 0 + MemberDecorate 21(Matrix) 0 MatrixStride 16 + MemberDecorate 21(Matrix) 1 RowMajor + MemberDecorate 21(Matrix) 1 Offset 64 + MemberDecorate 21(Matrix) 1 MatrixStride 16 + MemberDecorate 21(Matrix) 2 RowMajor + MemberDecorate 21(Matrix) 2 Offset 112 + MemberDecorate 21(Matrix) 2 MatrixStride 16 + MemberDecorate 21(Matrix) 3 RowMajor + MemberDecorate 21(Matrix) 3 Offset 176 + MemberDecorate 21(Matrix) 3 MatrixStride 16 + MemberDecorate 21(Matrix) 4 RowMajor + MemberDecorate 21(Matrix) 4 Offset 224 + MemberDecorate 21(Matrix) 4 MatrixStride 16 + MemberDecorate 21(Matrix) 5 RowMajor + MemberDecorate 21(Matrix) 5 Offset 288 + MemberDecorate 21(Matrix) 5 MatrixStride 16 + MemberDecorate 21(Matrix) 6 Offset 320 + MemberDecorate 21(Matrix) 7 Offset 336 + MemberDecorate 21(Matrix) 8 Offset 352 + Decorate 21(Matrix) Block + Decorate 23 DescriptorSet 0 + Decorate 188(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypePointer Function 6(float) + 13: TypeMatrix 7(fvec4) 4 + 14: TypeVector 6(float) 3 + 15: TypeMatrix 14(fvec3) 4 + 16: TypeMatrix 7(fvec4) 3 + 17: TypeMatrix 14(fvec3) 3 + 18: TypeMatrix 7(fvec4) 2 + 19: TypeVector 6(float) 2 + 20: TypeMatrix 19(fvec2) 4 + 21(Matrix): TypeStruct 13 15 16 17 18 20 7(fvec4) 14(fvec3) 19(fvec2) + 22: TypePointer Uniform 21(Matrix) + 23: 22(ptr) Variable Uniform + 24: TypeInt 32 1 + 25: 24(int) Constant 8 + 26: TypePointer Uniform 19(fvec2) + 29: 24(int) Constant 7 + 30: TypePointer Uniform 14(fvec3) + 38: 24(int) Constant 6 + 39: TypePointer Uniform 7(fvec4) + 48: TypePointer Function 7(fvec4) + 50: 24(int) Constant 0 + 51: TypePointer Uniform 13 + 62: 24(int) Constant 2 + 63: TypePointer Uniform 16 + 95: 24(int) Constant 1 + 96: TypePointer Uniform 15 + 100: TypeMatrix 14(fvec3) 2 + 101: TypePointer Function 100 + 103: 24(int) Constant 3 + 104: TypePointer Uniform 17 + 107: 24(int) Constant 4 + 108: TypePointer Uniform 18 + 117: TypePointer Function 16 + 123: TypeMatrix 19(fvec2) 3 + 132: TypePointer Function 123 + 134: 24(int) Constant 5 + 135: TypePointer Uniform 20 + 145: TypePointer Function 15 + 168: TypeInt 32 0 + 169: 168(int) Constant 0 + 187: TypePointer Output 7(fvec4) +188(@entryPointOutput): 187(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 189: 7(fvec4) FunctionCall 9(@main() + Store 188(@entryPointOutput) 189 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 12(r00): 11(ptr) Variable Function + 37(r01): 11(ptr) Variable Function + 49(r10): 48(ptr) Variable Function + 61(r11): 48(ptr) Variable Function + 73(r20): 48(ptr) Variable Function + 88(r21): 48(ptr) Variable Function + 102(r30): 101(ptr) Variable Function + 118(r31): 117(ptr) Variable Function + 133(r32): 132(ptr) Variable Function + 146(r33): 145(ptr) Variable Function + 27: 26(ptr) AccessChain 23 25 + 28: 19(fvec2) Load 27 + 31: 30(ptr) AccessChain 23 29 + 32: 14(fvec3) Load 31 + 33: 6(float) CompositeExtract 32 0 + 34: 6(float) CompositeExtract 32 1 + 35: 19(fvec2) CompositeConstruct 33 34 + 36: 6(float) Dot 28 35 + Store 12(r00) 36 + 40: 39(ptr) AccessChain 23 38 + 41: 7(fvec4) Load 40 + 42: 6(float) CompositeExtract 41 0 + 43: 6(float) CompositeExtract 41 1 + 44: 19(fvec2) CompositeConstruct 42 43 + 45: 26(ptr) AccessChain 23 25 + 46: 19(fvec2) Load 45 + 47: 6(float) Dot 44 46 + Store 37(r01) 47 + 52: 51(ptr) AccessChain 23 50 + 53: 13 Load 52 + 54: 7(fvec4) CompositeExtract 53 0 + 55: 7(fvec4) CompositeExtract 53 1 + 56: 7(fvec4) CompositeExtract 53 2 + 57: 16 CompositeConstruct 54 55 56 + 58: 30(ptr) AccessChain 23 29 + 59: 14(fvec3) Load 58 + 60: 7(fvec4) MatrixTimesVector 57 59 + Store 49(r10) 60 + 64: 63(ptr) AccessChain 23 62 + 65: 16 Load 64 + 66: 39(ptr) AccessChain 23 38 + 67: 7(fvec4) Load 66 + 68: 6(float) CompositeExtract 67 0 + 69: 6(float) CompositeExtract 67 1 + 70: 6(float) CompositeExtract 67 2 + 71: 14(fvec3) CompositeConstruct 68 69 70 + 72: 7(fvec4) MatrixTimesVector 65 71 + Store 61(r11) 72 + 74: 30(ptr) AccessChain 23 29 + 75: 14(fvec3) Load 74 + 76: 51(ptr) AccessChain 23 50 + 77: 13 Load 76 + 78: 7(fvec4) CompositeExtract 77 0 + 79: 14(fvec3) VectorShuffle 78 78 0 1 2 + 80: 7(fvec4) CompositeExtract 77 1 + 81: 14(fvec3) VectorShuffle 80 80 0 1 2 + 82: 7(fvec4) CompositeExtract 77 2 + 83: 14(fvec3) VectorShuffle 82 82 0 1 2 + 84: 7(fvec4) CompositeExtract 77 3 + 85: 14(fvec3) VectorShuffle 84 84 0 1 2 + 86: 15 CompositeConstruct 79 81 83 85 + 87: 7(fvec4) VectorTimesMatrix 75 86 + Store 73(r20) 87 + 89: 39(ptr) AccessChain 23 38 + 90: 7(fvec4) Load 89 + 91: 6(float) CompositeExtract 90 0 + 92: 6(float) CompositeExtract 90 1 + 93: 6(float) CompositeExtract 90 2 + 94: 14(fvec3) CompositeConstruct 91 92 93 + 97: 96(ptr) AccessChain 23 95 + 98: 15 Load 97 + 99: 7(fvec4) VectorTimesMatrix 94 98 + Store 88(r21) 99 + 105: 104(ptr) AccessChain 23 103 + 106: 17 Load 105 + 109: 108(ptr) AccessChain 23 107 + 110: 18 Load 109 + 111: 7(fvec4) CompositeExtract 110 0 + 112: 14(fvec3) VectorShuffle 111 111 0 1 2 + 113: 7(fvec4) CompositeExtract 110 1 + 114: 14(fvec3) VectorShuffle 113 113 0 1 2 + 115: 100 CompositeConstruct 112 114 + 116: 100 MatrixTimesMatrix 106 115 + Store 102(r30) 116 + 119: 108(ptr) AccessChain 23 107 + 120: 18 Load 119 + 121: 104(ptr) AccessChain 23 103 + 122: 17 Load 121 + 124: 14(fvec3) CompositeExtract 122 0 + 125: 19(fvec2) VectorShuffle 124 124 0 1 + 126: 14(fvec3) CompositeExtract 122 1 + 127: 19(fvec2) VectorShuffle 126 126 0 1 + 128: 14(fvec3) CompositeExtract 122 2 + 129: 19(fvec2) VectorShuffle 128 128 0 1 + 130: 123 CompositeConstruct 125 127 129 + 131: 16 MatrixTimesMatrix 120 130 + Store 118(r31) 131 + 136: 135(ptr) AccessChain 23 134 + 137: 20 Load 136 + 138: 19(fvec2) CompositeExtract 137 0 + 139: 19(fvec2) CompositeExtract 137 1 + 140: 19(fvec2) CompositeExtract 137 2 + 141: 123 CompositeConstruct 138 139 140 + 142: 104(ptr) AccessChain 23 103 + 143: 17 Load 142 + 144: 123 MatrixTimesMatrix 141 143 + Store 133(r32) 144 + 147: 104(ptr) AccessChain 23 103 + 148: 17 Load 147 + 149: 14(fvec3) CompositeExtract 148 0 + 150: 14(fvec3) CompositeExtract 148 1 + 151: 100 CompositeConstruct 149 150 + 152: 135(ptr) AccessChain 23 134 + 153: 20 Load 152 + 154: 15 MatrixTimesMatrix 151 153 + Store 146(r33) 154 + 155: 7(fvec4) Load 49(r10) + 156: 7(fvec4) Load 61(r11) + 157: 7(fvec4) FAdd 155 156 + 158: 7(fvec4) Load 73(r20) + 159: 7(fvec4) FAdd 157 158 + 160: 7(fvec4) Load 88(r21) + 161: 7(fvec4) FAdd 159 160 + 162: 6(float) Load 12(r00) + 163: 7(fvec4) CompositeConstruct 162 162 162 162 + 164: 7(fvec4) FAdd 161 163 + 165: 6(float) Load 37(r01) + 166: 7(fvec4) CompositeConstruct 165 165 165 165 + 167: 7(fvec4) FAdd 164 166 + 170: 11(ptr) AccessChain 102(r30) 50 169 + 171: 6(float) Load 170 + 172: 7(fvec4) CompositeConstruct 171 171 171 171 + 173: 7(fvec4) FAdd 167 172 + 174: 48(ptr) AccessChain 118(r31) 50 + 175: 7(fvec4) Load 174 + 176: 7(fvec4) FAdd 173 175 + 177: 11(ptr) AccessChain 133(r32) 50 169 + 178: 6(float) Load 177 + 179: 7(fvec4) CompositeConstruct 178 178 178 178 + 180: 7(fvec4) FAdd 176 179 + 181: 15 Load 146(r33) + 182: 16 Transpose 181 + 183: 7(fvec4) CompositeExtract 182 0 + 184: 7(fvec4) FAdd 180 183 + ReturnValue 184 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.multiDescriptorSet.frag.out b/deps/glslang/Test/baseResults/hlsl.multiDescriptorSet.frag.out new file mode 100644 index 00000000..8bd1ad85 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.multiDescriptorSet.frag.out @@ -0,0 +1,168 @@ +hlsl.multiDescriptorSet.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 92 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 78 82 86 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "PS_INPUT" + MemberName 9(PS_INPUT) 0 "Pos" + MemberName 9(PS_INPUT) 1 "Tex" + Name 13 "@main(struct-PS_INPUT-vf4-vf21;" + Name 12 "input" + Name 15 "output" + Name 23 "cbChangesEveryFrame" + MemberName 23(cbChangesEveryFrame) 0 "World" + MemberName 23(cbChangesEveryFrame) 1 "vMeshColor" + Name 25 "" + Name 34 "cbNeverChanges" + MemberName 34(cbNeverChanges) 0 "View" + Name 36 "" + Name 43 "cbChangeOnResize" + MemberName 43(cbChangeOnResize) 0 "Projection" + Name 45 "" + Name 59 "txDiffuseA" + Name 63 "samLinearA" + Name 76 "input" + Name 78 "input.Pos" + Name 82 "input.Tex" + Name 86 "@entryPointOutput" + Name 87 "param" + Name 90 "txDiffuseB" + Name 91 "samLinearB" + MemberDecorate 23(cbChangesEveryFrame) 0 RowMajor + MemberDecorate 23(cbChangesEveryFrame) 0 Offset 0 + MemberDecorate 23(cbChangesEveryFrame) 0 MatrixStride 16 + MemberDecorate 23(cbChangesEveryFrame) 1 Offset 64 + Decorate 23(cbChangesEveryFrame) Block + Decorate 25 DescriptorSet 2 + Decorate 25 Binding 2 + MemberDecorate 34(cbNeverChanges) 0 RowMajor + MemberDecorate 34(cbNeverChanges) 0 Offset 0 + MemberDecorate 34(cbNeverChanges) 0 MatrixStride 16 + Decorate 34(cbNeverChanges) Block + Decorate 36 DescriptorSet 2 + Decorate 36 Binding 0 + MemberDecorate 43(cbChangeOnResize) 0 RowMajor + MemberDecorate 43(cbChangeOnResize) 0 Offset 0 + MemberDecorate 43(cbChangeOnResize) 0 MatrixStride 16 + Decorate 43(cbChangeOnResize) Block + Decorate 45 DescriptorSet 2 + Decorate 45 Binding 1 + Decorate 59(txDiffuseA) DescriptorSet 0 + Decorate 59(txDiffuseA) Binding 0 + Decorate 63(samLinearA) DescriptorSet 0 + Decorate 63(samLinearA) Binding 1 + Decorate 78(input.Pos) BuiltIn FragCoord + Decorate 82(input.Tex) Location 0 + Decorate 86(@entryPointOutput) Location 0 + Decorate 90(txDiffuseB) DescriptorSet 1 + Decorate 90(txDiffuseB) Binding 0 + Decorate 91(samLinearB) DescriptorSet 1 + Decorate 91(samLinearB) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeVector 6(float) 2 + 9(PS_INPUT): TypeStruct 7(fvec4) 8(fvec2) + 10: TypePointer Function 9(PS_INPUT) + 11: TypeFunction 7(fvec4) 10(ptr) + 16: 6(float) Constant 0 + 17: 7(fvec4) ConstantComposite 16 16 16 16 + 18: 8(fvec2) ConstantComposite 16 16 + 19: 9(PS_INPUT) ConstantComposite 17 18 + 20: TypeInt 32 1 + 21: 20(int) Constant 0 + 22: TypeMatrix 7(fvec4) 4 +23(cbChangesEveryFrame): TypeStruct 22 7(fvec4) + 24: TypePointer Uniform 23(cbChangesEveryFrame) + 25: 24(ptr) Variable Uniform + 26: TypePointer Uniform 22 + 29: TypePointer Function 7(fvec4) +34(cbNeverChanges): TypeStruct 22 + 35: TypePointer Uniform 34(cbNeverChanges) + 36: 35(ptr) Variable Uniform +43(cbChangeOnResize): TypeStruct 22 + 44: TypePointer Uniform 43(cbChangeOnResize) + 45: 44(ptr) Variable Uniform + 52: 20(int) Constant 1 + 53: TypePointer Function 8(fvec2) + 57: TypeImage 6(float) 2D sampled format:Unknown + 58: TypePointer UniformConstant 57 + 59(txDiffuseA): 58(ptr) Variable UniformConstant + 61: TypeSampler + 62: TypePointer UniformConstant 61 + 63(samLinearA): 62(ptr) Variable UniformConstant + 65: TypeSampledImage 57 + 70: TypePointer Uniform 7(fvec4) + 77: TypePointer Input 7(fvec4) + 78(input.Pos): 77(ptr) Variable Input + 81: TypePointer Input 8(fvec2) + 82(input.Tex): 81(ptr) Variable Input + 85: TypePointer Output 7(fvec4) +86(@entryPointOutput): 85(ptr) Variable Output + 90(txDiffuseB): 58(ptr) Variable UniformConstant + 91(samLinearB): 62(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 76(input): 10(ptr) Variable Function + 87(param): 10(ptr) Variable Function + 79: 7(fvec4) Load 78(input.Pos) + 80: 29(ptr) AccessChain 76(input) 21 + Store 80 79 + 83: 8(fvec2) Load 82(input.Tex) + 84: 53(ptr) AccessChain 76(input) 52 + Store 84 83 + 88: 9(PS_INPUT) Load 76(input) + Store 87(param) 88 + 89: 7(fvec4) FunctionCall 13(@main(struct-PS_INPUT-vf4-vf21;) 87(param) + Store 86(@entryPointOutput) 89 + Return + FunctionEnd +13(@main(struct-PS_INPUT-vf4-vf21;): 7(fvec4) Function None 11 + 12(input): 10(ptr) FunctionParameter + 14: Label + 15(output): 10(ptr) Variable Function + Store 15(output) 19 + 27: 26(ptr) AccessChain 25 21 + 28: 22 Load 27 + 30: 29(ptr) AccessChain 12(input) 21 + 31: 7(fvec4) Load 30 + 32: 7(fvec4) MatrixTimesVector 28 31 + 33: 29(ptr) AccessChain 15(output) 21 + Store 33 32 + 37: 26(ptr) AccessChain 36 21 + 38: 22 Load 37 + 39: 29(ptr) AccessChain 15(output) 21 + 40: 7(fvec4) Load 39 + 41: 7(fvec4) MatrixTimesVector 38 40 + 42: 29(ptr) AccessChain 15(output) 21 + Store 42 41 + 46: 26(ptr) AccessChain 45 21 + 47: 22 Load 46 + 48: 29(ptr) AccessChain 15(output) 21 + 49: 7(fvec4) Load 48 + 50: 7(fvec4) MatrixTimesVector 47 49 + 51: 29(ptr) AccessChain 15(output) 21 + Store 51 50 + 54: 53(ptr) AccessChain 12(input) 52 + 55: 8(fvec2) Load 54 + 56: 53(ptr) AccessChain 15(output) 52 + Store 56 55 + 60: 57 Load 59(txDiffuseA) + 64: 61 Load 63(samLinearA) + 66: 65 SampledImage 60 64 + 67: 53(ptr) AccessChain 15(output) 52 + 68: 8(fvec2) Load 67 + 69: 7(fvec4) ImageSampleImplicitLod 66 68 + 71: 70(ptr) AccessChain 25 52 + 72: 7(fvec4) Load 71 + 73: 7(fvec4) FMul 69 72 + ReturnValue 73 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.multiEntry.vert.out b/deps/glslang/Test/baseResults/hlsl.multiEntry.vert.out new file mode 100644 index 00000000..1c771188 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.multiEntry.vert.out @@ -0,0 +1,140 @@ +hlsl.multiEntry.vert +Shader version: 500 +0:? Sequence +0:4 Function Definition: FakeEntrypoint(u1; ( temp 4-component vector of float) +0:4 Function Parameters: +0:4 'Index' ( in uint) +0:? Sequence +0:5 Branch: Return with expression +0:5 textureFetch ( temp 4-component vector of float) +0:5 'Position' (layout( rgba32f) uniform textureBuffer) +0:5 Convert uint to int ( temp int) +0:5 'Index' ( in uint) +0:9 Function Definition: @RealEntrypoint(u1; ( temp 4-component vector of float) +0:9 Function Parameters: +0:9 'Index' ( in uint) +0:? Sequence +0:10 Branch: Return with expression +0:10 Function Call: FakeEntrypoint(u1; ( temp 4-component vector of float) +0:10 'Index' ( in uint) +0:9 Function Definition: RealEntrypoint( ( temp void) +0:9 Function Parameters: +0:? Sequence +0:9 move second child to first child ( temp uint) +0:? 'Index' ( temp uint) +0:? 'Index' ( in uint VertexIndex) +0:9 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:9 Function Call: @RealEntrypoint(u1; ( temp 4-component vector of float) +0:? 'Index' ( temp uint) +0:? Linker Objects +0:? 'Position' (layout( rgba32f) uniform textureBuffer) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:? 'Index' ( in uint VertexIndex) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:4 Function Definition: FakeEntrypoint(u1; ( temp 4-component vector of float) +0:4 Function Parameters: +0:4 'Index' ( in uint) +0:? Sequence +0:5 Branch: Return with expression +0:5 textureFetch ( temp 4-component vector of float) +0:5 'Position' (layout( rgba32f) uniform textureBuffer) +0:5 Convert uint to int ( temp int) +0:5 'Index' ( in uint) +0:9 Function Definition: @RealEntrypoint(u1; ( temp 4-component vector of float) +0:9 Function Parameters: +0:9 'Index' ( in uint) +0:? Sequence +0:10 Branch: Return with expression +0:10 Function Call: FakeEntrypoint(u1; ( temp 4-component vector of float) +0:10 'Index' ( in uint) +0:9 Function Definition: RealEntrypoint( ( temp void) +0:9 Function Parameters: +0:? Sequence +0:9 move second child to first child ( temp uint) +0:? 'Index' ( temp uint) +0:? 'Index' ( in uint VertexIndex) +0:9 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:9 Function Call: @RealEntrypoint(u1; ( temp 4-component vector of float) +0:? 'Index' ( temp uint) +0:? Linker Objects +0:? 'Position' (layout( rgba32f) uniform textureBuffer) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:? 'Index' ( in uint VertexIndex) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 41 + + Capability Shader + Capability SampledBuffer + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "RealEntrypoint" 34 37 + Source HLSL 500 + Name 4 "RealEntrypoint" + Name 12 "FakeEntrypoint(u1;" + Name 11 "Index" + Name 15 "@RealEntrypoint(u1;" + Name 14 "Index" + Name 19 "Position" + Name 27 "param" + Name 32 "Index" + Name 34 "Index" + Name 37 "@entryPointOutput" + Name 38 "param" + Decorate 19(Position) DescriptorSet 0 + Decorate 34(Index) BuiltIn VertexIndex + Decorate 37(@entryPointOutput) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeFunction 9(fvec4) 7(ptr) + 17: TypeImage 8(float) Buffer sampled format:Rgba32f + 18: TypePointer UniformConstant 17 + 19(Position): 18(ptr) Variable UniformConstant + 22: TypeInt 32 1 + 33: TypePointer Input 6(int) + 34(Index): 33(ptr) Variable Input + 36: TypePointer Output 9(fvec4) +37(@entryPointOutput): 36(ptr) Variable Output +4(RealEntrypoint): 2 Function None 3 + 5: Label + 32(Index): 7(ptr) Variable Function + 38(param): 7(ptr) Variable Function + 35: 6(int) Load 34(Index) + Store 32(Index) 35 + 39: 6(int) Load 32(Index) + Store 38(param) 39 + 40: 9(fvec4) FunctionCall 15(@RealEntrypoint(u1;) 38(param) + Store 37(@entryPointOutput) 40 + Return + FunctionEnd +12(FakeEntrypoint(u1;): 9(fvec4) Function None 10 + 11(Index): 7(ptr) FunctionParameter + 13: Label + 20: 17 Load 19(Position) + 21: 6(int) Load 11(Index) + 23: 22(int) Bitcast 21 + 24: 9(fvec4) ImageFetch 20 23 + ReturnValue 24 + FunctionEnd +15(@RealEntrypoint(u1;): 9(fvec4) Function None 10 + 14(Index): 7(ptr) FunctionParameter + 16: Label + 27(param): 7(ptr) Variable Function + 28: 6(int) Load 14(Index) + Store 27(param) 28 + 29: 9(fvec4) FunctionCall 12(FakeEntrypoint(u1;) 27(param) + ReturnValue 29 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.multiReturn.frag.out b/deps/glslang/Test/baseResults/hlsl.multiReturn.frag.out new file mode 100644 index 00000000..695a52c6 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.multiReturn.frag.out @@ -0,0 +1,128 @@ +hlsl.multiReturn.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: foo( ( temp structure{ temp float f, temp 3-component vector of float v, temp 3X3 matrix of float m}) +0:12 Function Parameters: +0:? Sequence +0:13 Branch: Return with expression +0:13 s: direct index for structure (layout( row_major std140) uniform structure{ temp float f, temp 3-component vector of float v, temp 3X3 matrix of float m}) +0:13 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{ temp float f, temp 3-component vector of float v, temp 3X3 matrix of float m} s}) +0:13 Constant: +0:13 0 (const uint) +0:17 Function Definition: @main( ( temp void) +0:17 Function Parameters: +0:? Sequence +0:18 Function Call: foo( ( temp structure{ temp float f, temp 3-component vector of float v, temp 3X3 matrix of float m}) +0:17 Function Definition: main( ( temp void) +0:17 Function Parameters: +0:? Sequence +0:17 Function Call: @main( ( temp void) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{ temp float f, temp 3-component vector of float v, temp 3X3 matrix of float m} s}) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: foo( ( temp structure{ temp float f, temp 3-component vector of float v, temp 3X3 matrix of float m}) +0:12 Function Parameters: +0:? Sequence +0:13 Branch: Return with expression +0:13 s: direct index for structure (layout( row_major std140) uniform structure{ temp float f, temp 3-component vector of float v, temp 3X3 matrix of float m}) +0:13 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{ temp float f, temp 3-component vector of float v, temp 3X3 matrix of float m} s}) +0:13 Constant: +0:13 0 (const uint) +0:17 Function Definition: @main( ( temp void) +0:17 Function Parameters: +0:? Sequence +0:18 Function Call: foo( ( temp structure{ temp float f, temp 3-component vector of float v, temp 3X3 matrix of float m}) +0:17 Function Definition: main( ( temp void) +0:17 Function Parameters: +0:? Sequence +0:17 Function Call: @main( ( temp void) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{ temp float f, temp 3-component vector of float v, temp 3X3 matrix of float m} s}) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 42 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "S" + MemberName 9(S) 0 "f" + MemberName 9(S) 1 "v" + MemberName 9(S) 2 "m" + Name 11 "foo(" + Name 13 "@main(" + Name 15 "S" + MemberName 15(S) 0 "f" + MemberName 15(S) 1 "v" + MemberName 15(S) 2 "m" + Name 16 "bufName" + MemberName 16(bufName) 0 "s" + Name 18 "" + MemberDecorate 15(S) 0 Offset 0 + MemberDecorate 15(S) 1 Offset 4 + MemberDecorate 15(S) 2 RowMajor + MemberDecorate 15(S) 2 Offset 16 + MemberDecorate 15(S) 2 MatrixStride 16 + MemberDecorate 16(bufName) 0 Offset 0 + Decorate 16(bufName) Block + Decorate 18 DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8: TypeMatrix 7(fvec3) 3 + 9(S): TypeStruct 6(float) 7(fvec3) 8 + 10: TypeFunction 9(S) + 15(S): TypeStruct 6(float) 7(fvec3) 8 + 16(bufName): TypeStruct 15(S) + 17: TypePointer Uniform 16(bufName) + 18: 17(ptr) Variable Uniform + 19: TypeInt 32 1 + 20: 19(int) Constant 0 + 21: TypePointer Uniform 15(S) + 24: TypePointer Function 9(S) + 27: TypePointer Function 6(float) + 30: 19(int) Constant 1 + 31: TypePointer Function 7(fvec3) + 34: 19(int) Constant 2 + 35: TypePointer Function 8 + 4(main): 2 Function None 3 + 5: Label + 41: 2 FunctionCall 13(@main() + Return + FunctionEnd + 11(foo(): 9(S) Function None 10 + 12: Label + 25: 24(ptr) Variable Function + 22: 21(ptr) AccessChain 18 20 + 23: 15(S) Load 22 + 26: 6(float) CompositeExtract 23 0 + 28: 27(ptr) AccessChain 25 20 + Store 28 26 + 29: 7(fvec3) CompositeExtract 23 1 + 32: 31(ptr) AccessChain 25 30 + Store 32 29 + 33: 8 CompositeExtract 23 2 + 36: 35(ptr) AccessChain 25 34 + Store 36 33 + 37: 9(S) Load 25 + ReturnValue 37 + FunctionEnd + 13(@main(): 2 Function None 3 + 14: Label + 40: 9(S) FunctionCall 11(foo() + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.namespace.frag.out b/deps/glslang/Test/baseResults/hlsl.namespace.frag.out new file mode 100644 index 00000000..08d959b3 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.namespace.frag.out @@ -0,0 +1,185 @@ +hlsl.namespace.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: N1::getVec( ( temp 4-component vector of float) +0:5 Function Parameters: +0:? Sequence +0:5 Branch: Return with expression +0:5 'v1' ( global 4-component vector of float) +0:10 Function Definition: N2::getVec( ( temp 4-component vector of float) +0:10 Function Parameters: +0:? Sequence +0:10 Branch: Return with expression +0:10 'v2' ( global 4-component vector of float) +0:12 Function Definition: N2::N3::getVec( ( temp 4-component vector of float) +0:12 Function Parameters: +0:? Sequence +0:12 Branch: Return with expression +0:12 'v2' ( global 4-component vector of float) +0:15 Function Definition: N2::N3::C1::getVec( ( temp 4-component vector of float) +0:15 Function Parameters: +0:15 '@this' ( temp structure{}) +0:? Sequence +0:15 Branch: Return with expression +0:15 'v2' ( global 4-component vector of float) +0:21 Function Definition: @main( ( temp 4-component vector of float) +0:21 Function Parameters: +0:? Sequence +0:22 Branch: Return with expression +0:22 add ( temp 4-component vector of float) +0:22 add ( temp 4-component vector of float) +0:22 add ( temp 4-component vector of float) +0:22 Function Call: N1::getVec( ( temp 4-component vector of float) +0:22 Function Call: N2::getVec( ( temp 4-component vector of float) +0:22 Function Call: N2::N3::getVec( ( temp 4-component vector of float) +0:22 vector-scale ( temp 4-component vector of float) +0:22 Function Call: N2::N3::C1::getVec( ( temp 4-component vector of float) +0:22 'N2::gf' ( global float) +0:21 Function Definition: main( ( temp void) +0:21 Function Parameters: +0:? Sequence +0:21 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:21 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'v1' ( global 4-component vector of float) +0:? 'v2' ( global 4-component vector of float) +0:? 'N2::gf' ( global float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: N1::getVec( ( temp 4-component vector of float) +0:5 Function Parameters: +0:? Sequence +0:5 Branch: Return with expression +0:5 'v1' ( global 4-component vector of float) +0:10 Function Definition: N2::getVec( ( temp 4-component vector of float) +0:10 Function Parameters: +0:? Sequence +0:10 Branch: Return with expression +0:10 'v2' ( global 4-component vector of float) +0:12 Function Definition: N2::N3::getVec( ( temp 4-component vector of float) +0:12 Function Parameters: +0:? Sequence +0:12 Branch: Return with expression +0:12 'v2' ( global 4-component vector of float) +0:15 Function Definition: N2::N3::C1::getVec( ( temp 4-component vector of float) +0:15 Function Parameters: +0:15 '@this' ( temp structure{}) +0:? Sequence +0:15 Branch: Return with expression +0:15 'v2' ( global 4-component vector of float) +0:21 Function Definition: @main( ( temp 4-component vector of float) +0:21 Function Parameters: +0:? Sequence +0:22 Branch: Return with expression +0:22 add ( temp 4-component vector of float) +0:22 add ( temp 4-component vector of float) +0:22 add ( temp 4-component vector of float) +0:22 Function Call: N1::getVec( ( temp 4-component vector of float) +0:22 Function Call: N2::getVec( ( temp 4-component vector of float) +0:22 Function Call: N2::N3::getVec( ( temp 4-component vector of float) +0:22 vector-scale ( temp 4-component vector of float) +0:22 Function Call: N2::N3::C1::getVec( ( temp 4-component vector of float) +0:22 'N2::gf' ( global float) +0:21 Function Definition: main( ( temp void) +0:21 Function Parameters: +0:? Sequence +0:21 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:21 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'v1' ( global 4-component vector of float) +0:? 'v2' ( global 4-component vector of float) +0:? 'N2::gf' ( global float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: OpFunctionCall Function 's parameter count does not match the argument count. + %43 = OpFunctionCall %v4float %N2__N3__C1__getVec_ + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 54 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 52 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "N1::getVec(" + Name 11 "N2::getVec(" + Name 13 "N2::N3::getVec(" + Name 15 "C1" + Name 19 "N2::N3::C1::getVec(" + Name 18 "@this" + Name 21 "@main(" + Name 24 "v1" + Name 28 "v2" + Name 45 "N2::gf" + Name 52 "@entryPointOutput" + Decorate 52(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 15(C1): TypeStruct + 16: TypePointer Function 15(C1) + 17: TypeFunction 7(fvec4) 16(ptr) + 23: TypePointer Private 7(fvec4) + 24(v1): 23(ptr) Variable Private + 28(v2): 23(ptr) Variable Private + 44: TypePointer Private 6(float) + 45(N2::gf): 44(ptr) Variable Private + 51: TypePointer Output 7(fvec4) +52(@entryPointOutput): 51(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 53: 7(fvec4) FunctionCall 21(@main() + Store 52(@entryPointOutput) 53 + Return + FunctionEnd + 9(N1::getVec(): 7(fvec4) Function None 8 + 10: Label + 25: 7(fvec4) Load 24(v1) + ReturnValue 25 + FunctionEnd + 11(N2::getVec(): 7(fvec4) Function None 8 + 12: Label + 29: 7(fvec4) Load 28(v2) + ReturnValue 29 + FunctionEnd +13(N2::N3::getVec(): 7(fvec4) Function None 8 + 14: Label + 32: 7(fvec4) Load 28(v2) + ReturnValue 32 + FunctionEnd +19(N2::N3::C1::getVec(): 7(fvec4) Function None 17 + 18(@this): 16(ptr) FunctionParameter + 20: Label + 35: 7(fvec4) Load 28(v2) + ReturnValue 35 + FunctionEnd + 21(@main(): 7(fvec4) Function None 8 + 22: Label + 38: 7(fvec4) FunctionCall 9(N1::getVec() + 39: 7(fvec4) FunctionCall 11(N2::getVec() + 40: 7(fvec4) FAdd 38 39 + 41: 7(fvec4) FunctionCall 13(N2::N3::getVec() + 42: 7(fvec4) FAdd 40 41 + 43: 7(fvec4) FunctionCall 19(N2::N3::C1::getVec() + 46: 6(float) Load 45(N2::gf) + 47: 7(fvec4) VectorTimesScalar 43 46 + 48: 7(fvec4) FAdd 42 47 + ReturnValue 48 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.noSemantic.functionality1.comp.out b/deps/glslang/Test/baseResults/hlsl.noSemantic.functionality1.comp.out new file mode 100644 index 00000000..f00fe744 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.noSemantic.functionality1.comp.out @@ -0,0 +1,62 @@ +hlsl.noSemantic.functionality1.comp +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 30 + + Capability Shader + Extension "SPV_GOOGLE_hlsl_functionality1" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" + ExecutionMode 4 LocalSize 1 1 1 + Source HLSL 500 + Name 4 "main" + Name 6 "@main(" + Name 11 "Buf" + MemberName 11(Buf) 0 "@data" + Name 13 "Buf" + Name 17 "Buf@count" + MemberName 17(Buf@count) 0 "@count" + Name 19 "Buf@count" + Decorate 10 ArrayStride 16 + MemberDecorate 11(Buf) 0 Offset 0 + Decorate 11(Buf) BufferBlock + Decorate 13(Buf) DescriptorSet 0 + Decorate 13(Buf) Binding 0 + MemberDecorate 17(Buf@count) 0 Offset 0 + Decorate 17(Buf@count) BufferBlock + Decorate 19(Buf@count) DescriptorSet 0 + DecorateId 13(Buf) DecorationHlslCounterBufferGOOGLE 19(Buf@count) + 2: TypeVoid + 3: TypeFunction 2 + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeRuntimeArray 9(fvec4) + 11(Buf): TypeStruct 10 + 12: TypePointer Uniform 11(Buf) + 13(Buf): 12(ptr) Variable Uniform + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16: TypeInt 32 0 + 17(Buf@count): TypeStruct 16(int) + 18: TypePointer Uniform 17(Buf@count) + 19(Buf@count): 18(ptr) Variable Uniform + 20: TypePointer Uniform 16(int) + 22: 16(int) Constant 1 + 23: 16(int) Constant 0 + 25: 8(float) Constant 1065353216 + 26: 9(fvec4) ConstantComposite 25 25 25 25 + 27: TypePointer Uniform 9(fvec4) + 4(main): 2 Function None 3 + 5: Label + 29: 2 FunctionCall 6(@main() + Return + FunctionEnd + 6(@main(): 2 Function None 3 + 7: Label + 21: 20(ptr) AccessChain 19(Buf@count) 15 + 24: 16(int) AtomicIAdd 21 22 23 22 + 28: 27(ptr) AccessChain 13(Buf) 15 24 + Store 28 26 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.nonint-index.frag.out b/deps/glslang/Test/baseResults/hlsl.nonint-index.frag.out new file mode 100644 index 00000000..131c1ec0 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.nonint-index.frag.out @@ -0,0 +1,152 @@ +hlsl.nonint-index.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: @main(f1; ( temp float) +0:4 Function Parameters: +0:4 'input' ( in float) +0:? Sequence +0:7 Branch: Return with expression +0:7 add ( temp float) +0:7 add ( temp float) +0:7 add ( temp float) +0:7 indirect index ( temp float) +0:7 Constant: +0:7 1.000000 +0:7 2.000000 +0:7 3.000000 +0:7 Convert float to uint ( temp uint) +0:7 'input' ( in float) +0:7 Constant: +0:7 3.000000 +0:7 Constant: +0:7 2.000000 +0:7 Constant: +0:7 1.000000 +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 move second child to first child ( temp float) +0:? 'input' ( temp float) +0:? 'input' (layout( location=0) in float) +0:4 move second child to first child ( temp float) +0:? '@entryPointOutput' (layout( location=0) out float) +0:4 Function Call: @main(f1; ( temp float) +0:? 'input' ( temp float) +0:? Linker Objects +0:? 'array' ( const 3-element array of float) +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? '@entryPointOutput' (layout( location=0) out float) +0:? 'input' (layout( location=0) in float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: @main(f1; ( temp float) +0:4 Function Parameters: +0:4 'input' ( in float) +0:? Sequence +0:7 Branch: Return with expression +0:7 add ( temp float) +0:7 add ( temp float) +0:7 add ( temp float) +0:7 indirect index ( temp float) +0:7 Constant: +0:7 1.000000 +0:7 2.000000 +0:7 3.000000 +0:7 Convert float to uint ( temp uint) +0:7 'input' ( in float) +0:7 Constant: +0:7 3.000000 +0:7 Constant: +0:7 2.000000 +0:7 Constant: +0:7 1.000000 +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 move second child to first child ( temp float) +0:? 'input' ( temp float) +0:? 'input' (layout( location=0) in float) +0:4 move second child to first child ( temp float) +0:? '@entryPointOutput' (layout( location=0) out float) +0:4 Function Call: @main(f1; ( temp float) +0:? 'input' ( temp float) +0:? Linker Objects +0:? 'array' ( const 3-element array of float) +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? '@entryPointOutput' (layout( location=0) out float) +0:? 'input' (layout( location=0) in float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 39 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 32 35 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 10 "@main(f1;" + Name 9 "input" + Name 22 "indexable" + Name 30 "input" + Name 32 "input" + Name 35 "@entryPointOutput" + Name 36 "param" + Decorate 32(input) Location 0 + Decorate 35(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeFunction 6(float) 7(ptr) + 12: TypeInt 32 0 + 13: 12(int) Constant 3 + 14: TypeArray 6(float) 13 + 15: 6(float) Constant 1065353216 + 16: 6(float) Constant 1073741824 + 17: 6(float) Constant 1077936128 + 18: 14 ConstantComposite 15 16 17 + 21: TypePointer Function 14 + 31: TypePointer Input 6(float) + 32(input): 31(ptr) Variable Input + 34: TypePointer Output 6(float) +35(@entryPointOutput): 34(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 30(input): 7(ptr) Variable Function + 36(param): 7(ptr) Variable Function + 33: 6(float) Load 32(input) + Store 30(input) 33 + 37: 6(float) Load 30(input) + Store 36(param) 37 + 38: 6(float) FunctionCall 10(@main(f1;) 36(param) + Store 35(@entryPointOutput) 38 + Return + FunctionEnd + 10(@main(f1;): 6(float) Function None 8 + 9(input): 7(ptr) FunctionParameter + 11: Label + 22(indexable): 21(ptr) Variable Function + 19: 6(float) Load 9(input) + 20: 12(int) ConvertFToU 19 + Store 22(indexable) 18 + 23: 7(ptr) AccessChain 22(indexable) 20 + 24: 6(float) Load 23 + 25: 6(float) FAdd 24 17 + 26: 6(float) FAdd 25 16 + 27: 6(float) FAdd 26 15 + ReturnValue 27 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.nonstaticMemberFunction.frag.out b/deps/glslang/Test/baseResults/hlsl.nonstaticMemberFunction.frag.out new file mode 100644 index 00000000..1927a4cf --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.nonstaticMemberFunction.frag.out @@ -0,0 +1,436 @@ +hlsl.nonstaticMemberFunction.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:1 Sequence +0:1 move second child to first child ( temp 2-component vector of float) +0:1 'i' ( global 2-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:5 Function Definition: type1::setmem(vf4; ( temp void) +0:5 Function Parameters: +0:5 '@this' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:5 'm' ( in 4-component vector of float) +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:5 memVar: direct index for structure ( temp 4-component vector of float) +0:5 '@this' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:5 Constant: +0:5 0 (const uint) +0:5 'm' ( in 4-component vector of float) +0:6 Function Definition: type1::seti(i1; ( temp void) +0:6 Function Parameters: +0:6 '@this' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:6 'si' ( in int) +0:? Sequence +0:6 move second child to first child ( temp int) +0:6 i: direct index for structure ( temp int) +0:6 '@this' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:6 Constant: +0:6 1 (const uint) +0:6 'si' ( in int) +0:9 Function Definition: type1::memFun(vf4; ( temp 4-component vector of float) +0:9 Function Parameters: +0:9 '@this' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:9 'a' ( in 4-component vector of float) +0:? Sequence +0:10 Branch: Return with expression +0:10 add ( temp 4-component vector of float) +0:10 vector-scale ( temp 4-component vector of float) +0:10 Convert int to float ( temp float) +0:10 i: direct index for structure ( temp int) +0:10 '@this' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:10 Constant: +0:10 1 (const uint) +0:10 'a' ( in 4-component vector of float) +0:10 memVar: direct index for structure ( temp 4-component vector of float) +0:10 '@this' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:10 Constant: +0:10 0 (const uint) +0:13 Function Definition: type1::memFun(i1; ( temp int) +0:13 Function Parameters: +0:13 '@this' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:13 'a' ( in int) +0:? Sequence +0:14 Branch: Return with expression +0:14 Convert float to int ( temp int) +0:14 subtract ( temp float) +0:14 Convert int to float ( temp float) +0:14 add ( temp int) +0:14 i: direct index for structure ( temp int) +0:14 '@this' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:14 Constant: +0:14 1 (const uint) +0:14 'a' ( in int) +0:14 direct index ( temp float) +0:14 memVar: direct index for structure ( temp 4-component vector of float) +0:14 '@this' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:14 Constant: +0:14 0 (const uint) +0:14 Constant: +0:14 2 (const int) +0:19 Sequence +0:19 move second child to first child ( temp 2-component vector of float) +0:19 'j' ( global 2-component vector of float) +0:19 'i' ( global 2-component vector of float) +0:23 Function Definition: type2::memFun( ( temp 2-component vector of float) +0:23 Function Parameters: +0:23 '@this' ( temp structure{}) +0:? Sequence +0:23 Branch: Return with expression +0:23 'i' ( global 2-component vector of float) +0:27 Function Definition: @main( ( temp 4-component vector of float) +0:27 Function Parameters: +0:? Sequence +0:29 Function Call: type1::setmem(vf4; ( temp void) +0:29 'test' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:? Constant: +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:30 Function Call: type1::seti(i1; ( temp void) +0:30 'test' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:30 Constant: +0:30 17 (const int) +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'f4' ( temp 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 1.000000 +0:? 1.000000 +0:? 1.000000 +0:32 add second child into first child ( temp 4-component vector of float) +0:32 'f4' ( temp 4-component vector of float) +0:32 Function Call: type1::memFun(vf4; ( temp 4-component vector of float) +0:32 'test' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:? Constant: +0:? 5.000000 +0:? 5.000000 +0:? 5.000000 +0:? 5.000000 +0:33 add second child into first child ( temp 4-component vector of float) +0:33 'f4' ( temp 4-component vector of float) +0:33 Convert int to float ( temp float) +0:33 Function Call: type1::memFun(i1; ( temp int) +0:33 'test' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:33 Constant: +0:33 7 (const int) +0:34 Branch: Return with expression +0:34 'f4' ( temp 4-component vector of float) +0:27 Function Definition: main( ( temp void) +0:27 Function Parameters: +0:? Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:27 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'i' ( global 2-component vector of float) +0:? 'j' ( global 2-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:1 Sequence +0:1 move second child to first child ( temp 2-component vector of float) +0:1 'i' ( global 2-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:5 Function Definition: type1::setmem(vf4; ( temp void) +0:5 Function Parameters: +0:5 '@this' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:5 'm' ( in 4-component vector of float) +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:5 memVar: direct index for structure ( temp 4-component vector of float) +0:5 '@this' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:5 Constant: +0:5 0 (const uint) +0:5 'm' ( in 4-component vector of float) +0:6 Function Definition: type1::seti(i1; ( temp void) +0:6 Function Parameters: +0:6 '@this' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:6 'si' ( in int) +0:? Sequence +0:6 move second child to first child ( temp int) +0:6 i: direct index for structure ( temp int) +0:6 '@this' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:6 Constant: +0:6 1 (const uint) +0:6 'si' ( in int) +0:9 Function Definition: type1::memFun(vf4; ( temp 4-component vector of float) +0:9 Function Parameters: +0:9 '@this' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:9 'a' ( in 4-component vector of float) +0:? Sequence +0:10 Branch: Return with expression +0:10 add ( temp 4-component vector of float) +0:10 vector-scale ( temp 4-component vector of float) +0:10 Convert int to float ( temp float) +0:10 i: direct index for structure ( temp int) +0:10 '@this' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:10 Constant: +0:10 1 (const uint) +0:10 'a' ( in 4-component vector of float) +0:10 memVar: direct index for structure ( temp 4-component vector of float) +0:10 '@this' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:10 Constant: +0:10 0 (const uint) +0:13 Function Definition: type1::memFun(i1; ( temp int) +0:13 Function Parameters: +0:13 '@this' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:13 'a' ( in int) +0:? Sequence +0:14 Branch: Return with expression +0:14 Convert float to int ( temp int) +0:14 subtract ( temp float) +0:14 Convert int to float ( temp float) +0:14 add ( temp int) +0:14 i: direct index for structure ( temp int) +0:14 '@this' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:14 Constant: +0:14 1 (const uint) +0:14 'a' ( in int) +0:14 direct index ( temp float) +0:14 memVar: direct index for structure ( temp 4-component vector of float) +0:14 '@this' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:14 Constant: +0:14 0 (const uint) +0:14 Constant: +0:14 2 (const int) +0:19 Sequence +0:19 move second child to first child ( temp 2-component vector of float) +0:19 'j' ( global 2-component vector of float) +0:19 'i' ( global 2-component vector of float) +0:23 Function Definition: type2::memFun( ( temp 2-component vector of float) +0:23 Function Parameters: +0:23 '@this' ( temp structure{}) +0:? Sequence +0:23 Branch: Return with expression +0:23 'i' ( global 2-component vector of float) +0:27 Function Definition: @main( ( temp 4-component vector of float) +0:27 Function Parameters: +0:? Sequence +0:29 Function Call: type1::setmem(vf4; ( temp void) +0:29 'test' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:? Constant: +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:30 Function Call: type1::seti(i1; ( temp void) +0:30 'test' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:30 Constant: +0:30 17 (const int) +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'f4' ( temp 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 1.000000 +0:? 1.000000 +0:? 1.000000 +0:32 add second child into first child ( temp 4-component vector of float) +0:32 'f4' ( temp 4-component vector of float) +0:32 Function Call: type1::memFun(vf4; ( temp 4-component vector of float) +0:32 'test' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:? Constant: +0:? 5.000000 +0:? 5.000000 +0:? 5.000000 +0:? 5.000000 +0:33 add second child into first child ( temp 4-component vector of float) +0:33 'f4' ( temp 4-component vector of float) +0:33 Convert int to float ( temp float) +0:33 Function Call: type1::memFun(i1; ( temp int) +0:33 'test' ( temp structure{ temp 4-component vector of float memVar, temp int i}) +0:33 Constant: +0:33 7 (const int) +0:34 Branch: Return with expression +0:34 'f4' ( temp 4-component vector of float) +0:27 Function Definition: main( ( temp void) +0:27 Function Parameters: +0:? Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:27 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'i' ( global 2-component vector of float) +0:? 'j' ( global 2-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 111 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 109 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "type1" + MemberName 9(type1) 0 "memVar" + MemberName 9(type1) 1 "i" + Name 15 "type1::setmem(vf4;" + Name 13 "@this" + Name 14 "m" + Name 21 "type1::seti(i1;" + Name 19 "@this" + Name 20 "si" + Name 26 "type1::memFun(vf4;" + Name 24 "@this" + Name 25 "a" + Name 31 "type1::memFun(i1;" + Name 29 "@this" + Name 30 "a" + Name 33 "type2" + Name 38 "type2::memFun(" + Name 37 "@this" + Name 41 "@main(" + Name 44 "i" + Name 48 "j" + Name 83 "test" + Name 85 "param" + Name 88 "param" + Name 90 "f4" + Name 94 "param" + Name 99 "param" + Name 109 "@entryPointOutput" + Decorate 109(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 1 + 9(type1): TypeStruct 7(fvec4) 8(int) + 10: TypePointer Function 9(type1) + 11: TypePointer Function 7(fvec4) + 12: TypeFunction 2 10(ptr) 11(ptr) + 17: TypePointer Function 8(int) + 18: TypeFunction 2 10(ptr) 17(ptr) + 23: TypeFunction 7(fvec4) 10(ptr) 11(ptr) + 28: TypeFunction 8(int) 10(ptr) 17(ptr) + 33(type2): TypeStruct + 34: TypePointer Function 33(type2) + 35: TypeVector 6(float) 2 + 36: TypeFunction 35(fvec2) 34(ptr) + 40: TypeFunction 7(fvec4) + 43: TypePointer Private 35(fvec2) + 44(i): 43(ptr) Variable Private + 45: 6(float) Constant 1065353216 + 46: 6(float) Constant 1073741824 + 47: 35(fvec2) ConstantComposite 45 46 + 48(j): 43(ptr) Variable Private + 50: 8(int) Constant 0 + 53: 8(int) Constant 1 + 71: TypeInt 32 0 + 72: 71(int) Constant 2 + 73: TypePointer Function 6(float) + 84: 7(fvec4) ConstantComposite 46 46 46 46 + 87: 8(int) Constant 17 + 91: 7(fvec4) ConstantComposite 45 45 45 45 + 92: 6(float) Constant 1084227584 + 93: 7(fvec4) ConstantComposite 92 92 92 92 + 98: 8(int) Constant 7 + 108: TypePointer Output 7(fvec4) +109(@entryPointOutput): 108(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + Store 44(i) 47 + 49: 35(fvec2) Load 44(i) + Store 48(j) 49 + 110: 7(fvec4) FunctionCall 41(@main() + Store 109(@entryPointOutput) 110 + Return + FunctionEnd +15(type1::setmem(vf4;): 2 Function None 12 + 13(@this): 10(ptr) FunctionParameter + 14(m): 11(ptr) FunctionParameter + 16: Label + 51: 7(fvec4) Load 14(m) + 52: 11(ptr) AccessChain 13(@this) 50 + Store 52 51 + Return + FunctionEnd +21(type1::seti(i1;): 2 Function None 18 + 19(@this): 10(ptr) FunctionParameter + 20(si): 17(ptr) FunctionParameter + 22: Label + 54: 8(int) Load 20(si) + 55: 17(ptr) AccessChain 19(@this) 53 + Store 55 54 + Return + FunctionEnd +26(type1::memFun(vf4;): 7(fvec4) Function None 23 + 24(@this): 10(ptr) FunctionParameter + 25(a): 11(ptr) FunctionParameter + 27: Label + 56: 17(ptr) AccessChain 24(@this) 53 + 57: 8(int) Load 56 + 58: 6(float) ConvertSToF 57 + 59: 7(fvec4) Load 25(a) + 60: 7(fvec4) VectorTimesScalar 59 58 + 61: 11(ptr) AccessChain 24(@this) 50 + 62: 7(fvec4) Load 61 + 63: 7(fvec4) FAdd 60 62 + ReturnValue 63 + FunctionEnd +31(type1::memFun(i1;): 8(int) Function None 28 + 29(@this): 10(ptr) FunctionParameter + 30(a): 17(ptr) FunctionParameter + 32: Label + 66: 17(ptr) AccessChain 29(@this) 53 + 67: 8(int) Load 66 + 68: 8(int) Load 30(a) + 69: 8(int) IAdd 67 68 + 70: 6(float) ConvertSToF 69 + 74: 73(ptr) AccessChain 29(@this) 50 72 + 75: 6(float) Load 74 + 76: 6(float) FSub 70 75 + 77: 8(int) ConvertFToS 76 + ReturnValue 77 + FunctionEnd +38(type2::memFun(): 35(fvec2) Function None 36 + 37(@this): 34(ptr) FunctionParameter + 39: Label + 80: 35(fvec2) Load 44(i) + ReturnValue 80 + FunctionEnd + 41(@main(): 7(fvec4) Function None 40 + 42: Label + 83(test): 10(ptr) Variable Function + 85(param): 11(ptr) Variable Function + 88(param): 17(ptr) Variable Function + 90(f4): 11(ptr) Variable Function + 94(param): 11(ptr) Variable Function + 99(param): 17(ptr) Variable Function + Store 85(param) 84 + 86: 2 FunctionCall 15(type1::setmem(vf4;) 83(test) 85(param) + Store 88(param) 87 + 89: 2 FunctionCall 21(type1::seti(i1;) 83(test) 88(param) + Store 90(f4) 91 + Store 94(param) 93 + 95: 7(fvec4) FunctionCall 26(type1::memFun(vf4;) 83(test) 94(param) + 96: 7(fvec4) Load 90(f4) + 97: 7(fvec4) FAdd 96 95 + Store 90(f4) 97 + Store 99(param) 98 + 100: 8(int) FunctionCall 31(type1::memFun(i1;) 83(test) 99(param) + 101: 6(float) ConvertSToF 100 + 102: 7(fvec4) Load 90(f4) + 103: 7(fvec4) CompositeConstruct 101 101 101 101 + 104: 7(fvec4) FAdd 102 103 + Store 90(f4) 104 + 105: 7(fvec4) Load 90(f4) + ReturnValue 105 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.numericsuffixes.frag.out b/deps/glslang/Test/baseResults/hlsl.numericsuffixes.frag.out new file mode 100644 index 00000000..b1fa856f --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.numericsuffixes.frag.out @@ -0,0 +1,292 @@ +hlsl.numericsuffixes.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:5 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp float) +0:7 'r00' ( temp float) +0:7 Constant: +0:7 1.000000 +0:8 Sequence +0:8 move second child to first child ( temp uint) +0:8 'r01' ( temp uint) +0:8 Constant: +0:8 1 (const uint) +0:9 Sequence +0:9 move second child to first child ( temp uint) +0:9 'r02' ( temp uint) +0:9 Constant: +0:9 2 (const uint) +0:10 Sequence +0:10 move second child to first child ( temp uint) +0:10 'r03' ( temp uint) +0:10 Constant: +0:10 2748 (const uint) +0:11 Sequence +0:11 move second child to first child ( temp uint) +0:11 'r04' ( temp uint) +0:11 Constant: +0:11 2748 (const uint) +0:12 Sequence +0:12 move second child to first child ( temp int) +0:12 'r05' ( temp int) +0:12 Constant: +0:12 5 (const int) +0:13 Sequence +0:13 move second child to first child ( temp int) +0:13 'r06' ( temp int) +0:13 Constant: +0:13 6 (const int) +0:14 Sequence +0:14 move second child to first child ( temp int) +0:14 'r07' ( temp int) +0:14 Constant: +0:14 57 (const int) +0:15 Sequence +0:15 move second child to first child ( temp uint) +0:15 'r08' ( temp uint) +0:15 Constant: +0:15 58 (const uint) +0:16 Sequence +0:16 move second child to first child ( temp float) +0:16 'r09' ( temp float) +0:16 Constant: +0:16 1.000000 +0:17 Sequence +0:17 move second child to first child ( temp float) +0:17 'r10' ( temp float) +0:17 Constant: +0:17 1.000000 +0:18 Sequence +0:18 move second child to first child ( temp float) +0:18 'r11' ( temp float) +0:18 Constant: +0:18 1.100000 +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'r12' ( temp float) +0:19 Constant: +0:19 1.100000 +0:22 move second child to first child ( temp 4-component vector of float) +0:22 color: direct index for structure ( temp 4-component vector of float) +0:22 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:22 Constant: +0:22 0 (const int) +0:22 Construct vec4 ( temp 4-component vector of float) +0:22 Convert int to float ( temp float) +0:22 'r07' ( temp int) +0:23 Branch: Return with expression +0:23 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:5 color: direct index for structure ( temp 4-component vector of float) +0:5 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:5 Constant: +0:5 0 (const int) +0:? Linker Objects +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:5 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp float) +0:7 'r00' ( temp float) +0:7 Constant: +0:7 1.000000 +0:8 Sequence +0:8 move second child to first child ( temp uint) +0:8 'r01' ( temp uint) +0:8 Constant: +0:8 1 (const uint) +0:9 Sequence +0:9 move second child to first child ( temp uint) +0:9 'r02' ( temp uint) +0:9 Constant: +0:9 2 (const uint) +0:10 Sequence +0:10 move second child to first child ( temp uint) +0:10 'r03' ( temp uint) +0:10 Constant: +0:10 2748 (const uint) +0:11 Sequence +0:11 move second child to first child ( temp uint) +0:11 'r04' ( temp uint) +0:11 Constant: +0:11 2748 (const uint) +0:12 Sequence +0:12 move second child to first child ( temp int) +0:12 'r05' ( temp int) +0:12 Constant: +0:12 5 (const int) +0:13 Sequence +0:13 move second child to first child ( temp int) +0:13 'r06' ( temp int) +0:13 Constant: +0:13 6 (const int) +0:14 Sequence +0:14 move second child to first child ( temp int) +0:14 'r07' ( temp int) +0:14 Constant: +0:14 57 (const int) +0:15 Sequence +0:15 move second child to first child ( temp uint) +0:15 'r08' ( temp uint) +0:15 Constant: +0:15 58 (const uint) +0:16 Sequence +0:16 move second child to first child ( temp float) +0:16 'r09' ( temp float) +0:16 Constant: +0:16 1.000000 +0:17 Sequence +0:17 move second child to first child ( temp float) +0:17 'r10' ( temp float) +0:17 Constant: +0:17 1.000000 +0:18 Sequence +0:18 move second child to first child ( temp float) +0:18 'r11' ( temp float) +0:18 Constant: +0:18 1.100000 +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'r12' ( temp float) +0:19 Constant: +0:19 1.100000 +0:22 move second child to first child ( temp 4-component vector of float) +0:22 color: direct index for structure ( temp 4-component vector of float) +0:22 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:22 Constant: +0:22 0 (const int) +0:22 Construct vec4 ( temp 4-component vector of float) +0:22 Convert int to float ( temp float) +0:22 'r07' ( temp int) +0:23 Branch: Return with expression +0:23 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:5 color: direct index for structure ( temp 4-component vector of float) +0:5 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:5 Constant: +0:5 0 (const int) +0:? Linker Objects +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 54 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 51 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "color" + Name 10 "@main(" + Name 13 "r00" + Name 17 "r01" + Name 19 "r02" + Name 21 "r03" + Name 23 "r04" + Name 26 "r05" + Name 28 "r06" + Name 30 "r07" + Name 32 "r08" + Name 34 "r09" + Name 35 "r10" + Name 36 "r11" + Name 38 "r12" + Name 40 "ps_output" + Name 51 "@entryPointOutput.color" + Decorate 51(@entryPointOutput.color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 6(float) + 14: 6(float) Constant 1065353216 + 15: TypeInt 32 0 + 16: TypePointer Function 15(int) + 18: 15(int) Constant 1 + 20: 15(int) Constant 2 + 22: 15(int) Constant 2748 + 24: TypeInt 32 1 + 25: TypePointer Function 24(int) + 27: 24(int) Constant 5 + 29: 24(int) Constant 6 + 31: 24(int) Constant 57 + 33: 15(int) Constant 58 + 37: 6(float) Constant 1066192077 + 39: TypePointer Function 8(PS_OUTPUT) + 41: 24(int) Constant 0 + 45: TypePointer Function 7(fvec4) + 50: TypePointer Output 7(fvec4) +51(@entryPointOutput.color): 50(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 52:8(PS_OUTPUT) FunctionCall 10(@main() + 53: 7(fvec4) CompositeExtract 52 0 + Store 51(@entryPointOutput.color) 53 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(r00): 12(ptr) Variable Function + 17(r01): 16(ptr) Variable Function + 19(r02): 16(ptr) Variable Function + 21(r03): 16(ptr) Variable Function + 23(r04): 16(ptr) Variable Function + 26(r05): 25(ptr) Variable Function + 28(r06): 25(ptr) Variable Function + 30(r07): 25(ptr) Variable Function + 32(r08): 16(ptr) Variable Function + 34(r09): 12(ptr) Variable Function + 35(r10): 12(ptr) Variable Function + 36(r11): 12(ptr) Variable Function + 38(r12): 12(ptr) Variable Function + 40(ps_output): 39(ptr) Variable Function + Store 13(r00) 14 + Store 17(r01) 18 + Store 19(r02) 20 + Store 21(r03) 22 + Store 23(r04) 22 + Store 26(r05) 27 + Store 28(r06) 29 + Store 30(r07) 31 + Store 32(r08) 33 + Store 34(r09) 14 + Store 35(r10) 14 + Store 36(r11) 37 + Store 38(r12) 37 + 42: 24(int) Load 30(r07) + 43: 6(float) ConvertSToF 42 + 44: 7(fvec4) CompositeConstruct 43 43 43 43 + 46: 45(ptr) AccessChain 40(ps_output) 41 + Store 46 44 + 47:8(PS_OUTPUT) Load 40(ps_output) + ReturnValue 47 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.numthreads.comp.out b/deps/glslang/Test/baseResults/hlsl.numthreads.comp.out new file mode 100644 index 00000000..fd7de34b --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.numthreads.comp.out @@ -0,0 +1,93 @@ +hlsl.numthreads.comp +Shader version: 500 +local_size = (1, 4, 8) +0:? Sequence +0:4 Function Definition: main(vu3; ( temp void) +0:4 Function Parameters: +0:4 'tid' ( in 3-component vector of uint) +0:9 Function Definition: @main_aux2(vu3; ( temp void) +0:9 Function Parameters: +0:9 'tid' ( in 3-component vector of uint) +0:9 Function Definition: main_aux2( ( temp void) +0:9 Function Parameters: +0:? Sequence +0:9 move second child to first child ( temp 3-component vector of uint) +0:? 'tid' ( temp 3-component vector of uint) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) +0:9 Function Call: @main_aux2(vu3; ( temp void) +0:? 'tid' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (1, 4, 8) +0:? Sequence +0:4 Function Definition: main(vu3; ( temp void) +0:4 Function Parameters: +0:4 'tid' ( in 3-component vector of uint) +0:9 Function Definition: @main_aux2(vu3; ( temp void) +0:9 Function Parameters: +0:9 'tid' ( in 3-component vector of uint) +0:9 Function Definition: main_aux2( ( temp void) +0:9 Function Parameters: +0:? Sequence +0:9 move second child to first child ( temp 3-component vector of uint) +0:? 'tid' ( temp 3-component vector of uint) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) +0:9 Function Call: @main_aux2(vu3; ( temp void) +0:? 'tid' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 23 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main_aux2" 18 + ExecutionMode 4 LocalSize 1 4 8 + Source HLSL 500 + Name 4 "main_aux2" + Name 11 "main(vu3;" + Name 10 "tid" + Name 14 "@main_aux2(vu3;" + Name 13 "tid" + Name 16 "tid" + Name 18 "tid" + Name 20 "param" + Decorate 18(tid) BuiltIn GlobalInvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 9: TypeFunction 2 8(ptr) + 17: TypePointer Input 7(ivec3) + 18(tid): 17(ptr) Variable Input + 4(main_aux2): 2 Function None 3 + 5: Label + 16(tid): 8(ptr) Variable Function + 20(param): 8(ptr) Variable Function + 19: 7(ivec3) Load 18(tid) + Store 16(tid) 19 + 21: 7(ivec3) Load 16(tid) + Store 20(param) 21 + 22: 2 FunctionCall 14(@main_aux2(vu3;) 20(param) + Return + FunctionEnd + 11(main(vu3;): 2 Function None 9 + 10(tid): 8(ptr) FunctionParameter + 12: Label + Return + FunctionEnd +14(@main_aux2(vu3;): 2 Function None 9 + 13(tid): 8(ptr) FunctionParameter + 15: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.opaque-type-bug.frag.out b/deps/glslang/Test/baseResults/hlsl.opaque-type-bug.frag.out new file mode 100644 index 00000000..918b462f --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.opaque-type-bug.frag.out @@ -0,0 +1,112 @@ +hlsl.opaque-type-bug.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:6 Function Definition: TexFunc(t21;vf3; ( temp void) +0:6 Function Parameters: +0:6 't2D' ( const (read only) texture2D) +0:6 'RGB' ( out 3-component vector of float) +0:? Sequence +0:7 move second child to first child ( temp 3-component vector of float) +0:7 'RGB' ( out 3-component vector of float) +0:7 Constant: +0:7 0.000000 +0:7 0.000000 +0:7 0.000000 +0:12 Function Definition: @main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:15 Function Call: TexFunc(t21;vf3; ( temp void) +0:15 'MyTexture' (layout( binding=0) uniform texture2D) +0:15 'final_RGB' ( temp 3-component vector of float) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 Function Call: @main( ( temp void) +0:? Linker Objects +0:? 'MyTexture' (layout( binding=0) uniform texture2D) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:6 Function Definition: TexFunc(t21;vf3; ( temp void) +0:6 Function Parameters: +0:6 't2D' ( const (read only) texture2D) +0:6 'RGB' ( out 3-component vector of float) +0:? Sequence +0:7 move second child to first child ( temp 3-component vector of float) +0:7 'RGB' ( out 3-component vector of float) +0:7 Constant: +0:7 0.000000 +0:7 0.000000 +0:7 0.000000 +0:12 Function Definition: @main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:15 Function Call: TexFunc(t21;vf3; ( temp void) +0:15 'MyTexture' (layout( binding=0) uniform texture2D) +0:15 'final_RGB' ( temp 3-component vector of float) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 Function Call: @main( ( temp void) +0:? Linker Objects +0:? 'MyTexture' (layout( binding=0) uniform texture2D) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 27 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 13 "TexFunc(t21;vf3;" + Name 11 "t2D" + Name 12 "RGB" + Name 15 "@main(" + Name 20 "MyTexture" + Name 22 "final_RGB" + Name 23 "param" + Decorate 20(MyTexture) DescriptorSet 0 + Decorate 20(MyTexture) Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeImage 6(float) 2D sampled format:Unknown + 8: TypeVector 6(float) 3 + 9: TypePointer Function 8(fvec3) + 10: TypeFunction 2 7 9(ptr) + 17: 6(float) Constant 0 + 18: 8(fvec3) ConstantComposite 17 17 17 + 19: TypePointer UniformConstant 7 + 20(MyTexture): 19(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 26: 2 FunctionCall 15(@main() + Return + FunctionEnd +13(TexFunc(t21;vf3;): 2 Function None 10 + 11(t2D): 7 FunctionParameter + 12(RGB): 9(ptr) FunctionParameter + 14: Label + Store 12(RGB) 18 + Return + FunctionEnd + 15(@main(): 2 Function None 3 + 16: Label + 22(final_RGB): 9(ptr) Variable Function + 23(param): 9(ptr) Variable Function + 21: 7 Load 20(MyTexture) + 24: 2 FunctionCall 13(TexFunc(t21;vf3;) 21 23(param) + 25: 8(fvec3) Load 23(param) + Store 22(final_RGB) 25 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.overload.frag.out b/deps/glslang/Test/baseResults/hlsl.overload.frag.out new file mode 100644 index 00000000..5960d3d5 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.overload.frag.out @@ -0,0 +1,1625 @@ +hlsl.overload.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: foo1(d1;b1; ( temp void) +0:2 Function Parameters: +0:2 'a' ( in double) +0:2 'b' ( in bool) +0:3 Function Definition: foo1(d1;u1; ( temp void) +0:3 Function Parameters: +0:3 'a' ( in double) +0:3 'b' ( in uint) +0:4 Function Definition: foo1(d1;i1; ( temp void) +0:4 Function Parameters: +0:4 'a' ( in double) +0:4 'b' ( in int) +0:5 Function Definition: foo1(d1;f1; ( temp void) +0:5 Function Parameters: +0:5 'a' ( in double) +0:5 'b' ( in float) +0:6 Function Definition: foo1(d1;d1; ( temp void) +0:6 Function Parameters: +0:6 'a' ( in double) +0:6 'b' ( in double) +0:9 Function Definition: foo2(i1;b1; ( temp void) +0:9 Function Parameters: +0:9 'a' ( in int) +0:9 'b' ( in bool) +0:10 Function Definition: foo2(i1;u1; ( temp void) +0:10 Function Parameters: +0:10 'a' ( in int) +0:10 'b' ( in uint) +0:11 Function Definition: foo2(i1;i1; ( temp void) +0:11 Function Parameters: +0:11 'a' ( in int) +0:11 'b' ( in int) +0:12 Function Definition: foo2(i1;f1; ( temp void) +0:12 Function Parameters: +0:12 'a' ( in int) +0:12 'b' ( in float) +0:13 Function Definition: foo2(i1;d1; ( temp void) +0:13 Function Parameters: +0:13 'a' ( in int) +0:13 'b' ( in double) +0:16 Function Definition: foo3(b1; ( temp void) +0:16 Function Parameters: +0:16 'b' ( in bool) +0:17 Function Definition: foo4(u1; ( temp void) +0:17 Function Parameters: +0:17 'b' ( in uint) +0:18 Function Definition: foo5(i1; ( temp void) +0:18 Function Parameters: +0:18 'b' ( in int) +0:19 Function Definition: foo6(f1; ( temp void) +0:19 Function Parameters: +0:19 'b' ( in float) +0:20 Function Definition: foo7(d1; ( temp void) +0:20 Function Parameters: +0:20 'b' ( in double) +0:23 Function Definition: foo8(f1; ( temp void) +0:23 Function Parameters: +0:23 '' ( in float) +0:24 Function Definition: foo8(d1; ( temp void) +0:24 Function Parameters: +0:24 '' ( in double) +0:25 Function Definition: foo9(i1; ( temp void) +0:25 Function Parameters: +0:25 '' ( in int) +0:26 Function Definition: foo9(u1; ( temp void) +0:26 Function Parameters: +0:26 '' ( in uint) +0:27 Function Definition: foo10(b1; ( temp void) +0:27 Function Parameters: +0:27 '' ( in bool) +0:28 Function Definition: foo10(i1; ( temp void) +0:28 Function Parameters: +0:28 '' ( in int) +0:31 Function Definition: foo11(vf3; ( temp void) +0:31 Function Parameters: +0:31 '' ( in 3-component vector of float) +0:32 Function Definition: foo11(d1; ( temp void) +0:32 Function Parameters: +0:32 '' ( in double) +0:33 Function Definition: foo11(vi3; ( temp void) +0:33 Function Parameters: +0:33 '' ( in 3-component vector of int) +0:34 Function Definition: foo11(u1; ( temp void) +0:34 Function Parameters: +0:34 '' ( in uint) +0:35 Function Definition: foo12(vf1; ( temp void) +0:35 Function Parameters: +0:35 '' ( in 1-component vector of float) +0:36 Function Definition: foo12(vd3; ( temp void) +0:36 Function Parameters: +0:36 '' ( in 3-component vector of double) +0:37 Function Definition: foo16(u1; ( temp void) +0:37 Function Parameters: +0:37 '' ( in uint) +0:38 Function Definition: foo16(vu2; ( temp void) +0:38 Function Parameters: +0:38 '' ( in 2-component vector of uint) +0:41 Function Definition: foo13(vf3; ( temp void) +0:41 Function Parameters: +0:41 '' ( in 3-component vector of float) +0:42 Function Definition: foo14(vi1; ( temp void) +0:42 Function Parameters: +0:42 '' ( in 1-component vector of int) +0:43 Function Definition: foo15(vb1; ( temp void) +0:43 Function Parameters: +0:43 '' ( in 1-component vector of bool) +0:46 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:46 Function Parameters: +0:46 'input' ( in 4-component vector of float) +0:? Sequence +0:53 Function Call: foo1(d1;b1; ( temp void) +0:53 'd' ( temp double) +0:53 'b' ( temp bool) +0:54 Function Call: foo1(d1;d1; ( temp void) +0:54 'd' ( temp double) +0:54 'd' ( temp double) +0:55 Function Call: foo1(d1;u1; ( temp void) +0:55 'd' ( temp double) +0:55 'u' ( temp uint) +0:56 Function Call: foo1(d1;i1; ( temp void) +0:56 'd' ( temp double) +0:56 'i' ( temp int) +0:57 Function Call: foo1(d1;f1; ( temp void) +0:57 'd' ( temp double) +0:57 'f' ( temp float) +0:59 Function Call: foo1(d1;b1; ( temp void) +0:59 Convert float to double ( temp double) +0:59 'f' ( temp float) +0:59 'b' ( temp bool) +0:60 Function Call: foo1(d1;d1; ( temp void) +0:60 Convert float to double ( temp double) +0:60 'f' ( temp float) +0:60 'd' ( temp double) +0:61 Function Call: foo1(d1;u1; ( temp void) +0:61 Convert float to double ( temp double) +0:61 'f' ( temp float) +0:61 'u' ( temp uint) +0:62 Function Call: foo1(d1;i1; ( temp void) +0:62 Convert float to double ( temp double) +0:62 'f' ( temp float) +0:62 'i' ( temp int) +0:63 Function Call: foo1(d1;f1; ( temp void) +0:63 Convert float to double ( temp double) +0:63 'f' ( temp float) +0:63 'f' ( temp float) +0:65 Function Call: foo1(d1;b1; ( temp void) +0:65 Convert uint to double ( temp double) +0:65 'u' ( temp uint) +0:65 'b' ( temp bool) +0:66 Function Call: foo1(d1;d1; ( temp void) +0:66 Convert uint to double ( temp double) +0:66 'u' ( temp uint) +0:66 'd' ( temp double) +0:67 Function Call: foo1(d1;u1; ( temp void) +0:67 Convert uint to double ( temp double) +0:67 'u' ( temp uint) +0:67 'u' ( temp uint) +0:68 Function Call: foo1(d1;i1; ( temp void) +0:68 Convert uint to double ( temp double) +0:68 'u' ( temp uint) +0:68 'i' ( temp int) +0:69 Function Call: foo1(d1;f1; ( temp void) +0:69 Convert uint to double ( temp double) +0:69 'u' ( temp uint) +0:69 'f' ( temp float) +0:71 Function Call: foo1(d1;b1; ( temp void) +0:71 Convert int to double ( temp double) +0:71 'i' ( temp int) +0:71 'b' ( temp bool) +0:72 Function Call: foo1(d1;d1; ( temp void) +0:72 Convert int to double ( temp double) +0:72 'i' ( temp int) +0:72 'd' ( temp double) +0:73 Function Call: foo1(d1;u1; ( temp void) +0:73 Convert int to double ( temp double) +0:73 'i' ( temp int) +0:73 'u' ( temp uint) +0:74 Function Call: foo1(d1;i1; ( temp void) +0:74 Convert int to double ( temp double) +0:74 'i' ( temp int) +0:74 'i' ( temp int) +0:75 Function Call: foo1(d1;f1; ( temp void) +0:75 Convert int to double ( temp double) +0:75 'i' ( temp int) +0:75 'f' ( temp float) +0:77 Function Call: foo2(i1;b1; ( temp void) +0:77 Convert uint to int ( temp int) +0:77 'u' ( temp uint) +0:77 'b' ( temp bool) +0:78 Function Call: foo2(i1;d1; ( temp void) +0:78 Convert uint to int ( temp int) +0:78 'u' ( temp uint) +0:78 'd' ( temp double) +0:79 Function Call: foo2(i1;u1; ( temp void) +0:79 Convert uint to int ( temp int) +0:79 'u' ( temp uint) +0:79 'u' ( temp uint) +0:80 Function Call: foo2(i1;i1; ( temp void) +0:80 Convert uint to int ( temp int) +0:80 'u' ( temp uint) +0:80 'i' ( temp int) +0:81 Function Call: foo2(i1;f1; ( temp void) +0:81 Convert uint to int ( temp int) +0:81 'u' ( temp uint) +0:81 'f' ( temp float) +0:83 Function Call: foo2(i1;b1; ( temp void) +0:83 'i' ( temp int) +0:83 'b' ( temp bool) +0:84 Function Call: foo2(i1;d1; ( temp void) +0:84 'i' ( temp int) +0:84 'd' ( temp double) +0:85 Function Call: foo2(i1;u1; ( temp void) +0:85 'i' ( temp int) +0:85 'u' ( temp uint) +0:86 Function Call: foo2(i1;i1; ( temp void) +0:86 'i' ( temp int) +0:86 'i' ( temp int) +0:87 Function Call: foo2(i1;f1; ( temp void) +0:87 'i' ( temp int) +0:87 'f' ( temp float) +0:89 Function Call: foo3(b1; ( temp void) +0:89 'b' ( temp bool) +0:90 Function Call: foo3(b1; ( temp void) +0:90 Convert double to bool ( temp bool) +0:90 'd' ( temp double) +0:91 Function Call: foo3(b1; ( temp void) +0:91 Convert uint to bool ( temp bool) +0:91 'u' ( temp uint) +0:92 Function Call: foo3(b1; ( temp void) +0:92 Convert int to bool ( temp bool) +0:92 'i' ( temp int) +0:93 Function Call: foo3(b1; ( temp void) +0:93 Convert float to bool ( temp bool) +0:93 'f' ( temp float) +0:95 Function Call: foo4(u1; ( temp void) +0:95 Convert bool to uint ( temp uint) +0:95 'b' ( temp bool) +0:96 Function Call: foo4(u1; ( temp void) +0:96 Convert double to uint ( temp uint) +0:96 'd' ( temp double) +0:97 Function Call: foo4(u1; ( temp void) +0:97 'u' ( temp uint) +0:98 Function Call: foo4(u1; ( temp void) +0:98 Convert int to uint ( temp uint) +0:98 'i' ( temp int) +0:99 Function Call: foo4(u1; ( temp void) +0:99 Convert float to uint ( temp uint) +0:99 'f' ( temp float) +0:101 Function Call: foo5(i1; ( temp void) +0:101 Convert bool to int ( temp int) +0:101 'b' ( temp bool) +0:102 Function Call: foo5(i1; ( temp void) +0:102 Convert double to int ( temp int) +0:102 'd' ( temp double) +0:103 Function Call: foo5(i1; ( temp void) +0:103 Convert uint to int ( temp int) +0:103 'u' ( temp uint) +0:104 Function Call: foo5(i1; ( temp void) +0:104 'i' ( temp int) +0:105 Function Call: foo5(i1; ( temp void) +0:105 Convert float to int ( temp int) +0:105 'f' ( temp float) +0:107 Function Call: foo6(f1; ( temp void) +0:107 Convert bool to float ( temp float) +0:107 'b' ( temp bool) +0:108 Function Call: foo6(f1; ( temp void) +0:108 Convert double to float ( temp float) +0:108 'd' ( temp double) +0:109 Function Call: foo6(f1; ( temp void) +0:109 Convert uint to float ( temp float) +0:109 'u' ( temp uint) +0:110 Function Call: foo6(f1; ( temp void) +0:110 Convert int to float ( temp float) +0:110 'i' ( temp int) +0:111 Function Call: foo6(f1; ( temp void) +0:111 'f' ( temp float) +0:113 Function Call: foo7(d1; ( temp void) +0:113 Convert bool to double ( temp double) +0:113 'b' ( temp bool) +0:114 Function Call: foo7(d1; ( temp void) +0:114 'd' ( temp double) +0:115 Function Call: foo7(d1; ( temp void) +0:115 Convert uint to double ( temp double) +0:115 'u' ( temp uint) +0:116 Function Call: foo7(d1; ( temp void) +0:116 Convert int to double ( temp double) +0:116 'i' ( temp int) +0:117 Function Call: foo7(d1; ( temp void) +0:117 Convert float to double ( temp double) +0:117 'f' ( temp float) +0:119 Function Call: foo8(f1; ( temp void) +0:119 Convert bool to float ( temp float) +0:119 'b' ( temp bool) +0:120 Function Call: foo8(f1; ( temp void) +0:120 Convert uint to float ( temp float) +0:120 'u' ( temp uint) +0:121 Function Call: foo8(f1; ( temp void) +0:121 Convert int to float ( temp float) +0:121 'i' ( temp int) +0:123 Function Call: foo9(i1; ( temp void) +0:123 Convert bool to int ( temp int) +0:123 'b' ( temp bool) +0:124 Function Call: foo9(u1; ( temp void) +0:124 Convert float to uint ( temp uint) +0:124 'f' ( temp float) +0:125 Function Call: foo9(u1; ( temp void) +0:125 Convert double to uint ( temp uint) +0:125 'd' ( temp double) +0:127 Function Call: foo10(i1; ( temp void) +0:127 Convert uint to int ( temp int) +0:127 'u' ( temp uint) +0:128 Function Call: foo10(i1; ( temp void) +0:128 Convert float to int ( temp int) +0:128 'f' ( temp float) +0:129 Function Call: foo10(i1; ( temp void) +0:129 Convert double to int ( temp int) +0:129 'd' ( temp double) +0:131 Function Call: foo11(u1; ( temp void) +0:131 Convert bool to uint ( temp uint) +0:131 'b' ( temp bool) +0:132 Function Call: foo11(d1; ( temp void) +0:132 Convert float to double ( temp double) +0:132 'f' ( temp float) +0:133 Function Call: foo12(vd3; ( temp void) +0:133 Convert float to double ( temp 3-component vector of double) +0:133 Construct vec3 ( temp 3-component vector of float) +0:133 'f' ( temp float) +0:134 Function Call: foo16(vu2; ( temp void) +0:? Convert int to uint ( temp 2-component vector of uint) +0:? Construct ivec2 ( temp 2-component vector of int) +0:134 'i' ( temp int) +0:134 'i' ( temp int) +0:136 Function Call: foo13(vf3; ( temp void) +0:136 Construct vec3 ( in 3-component vector of float) +0:136 'f' ( temp float) +0:137 Function Call: foo14(vi1; ( temp void) +0:137 Construct int ( in 1-component vector of int) +0:137 Construct ivec4 ( temp 4-component vector of int) +0:137 'i' ( temp int) +0:138 Function Call: foo15(vb1; ( temp void) +0:138 Construct bool ( in 1-component vector of bool) +0:138 'b' ( temp bool) +0:139 Function Call: foo15(vb1; ( temp void) +0:139 Construct bool ( in 1-component vector of bool) +0:139 Construct bvec3 ( temp 3-component vector of bool) +0:139 'b' ( temp bool) +0:141 Branch: Return with expression +0:141 'input' ( in 4-component vector of float) +0:46 Function Definition: PixelShaderFunction( ( temp void) +0:46 Function Parameters: +0:? Sequence +0:46 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:46 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:46 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: foo1(d1;b1; ( temp void) +0:2 Function Parameters: +0:2 'a' ( in double) +0:2 'b' ( in bool) +0:3 Function Definition: foo1(d1;u1; ( temp void) +0:3 Function Parameters: +0:3 'a' ( in double) +0:3 'b' ( in uint) +0:4 Function Definition: foo1(d1;i1; ( temp void) +0:4 Function Parameters: +0:4 'a' ( in double) +0:4 'b' ( in int) +0:5 Function Definition: foo1(d1;f1; ( temp void) +0:5 Function Parameters: +0:5 'a' ( in double) +0:5 'b' ( in float) +0:6 Function Definition: foo1(d1;d1; ( temp void) +0:6 Function Parameters: +0:6 'a' ( in double) +0:6 'b' ( in double) +0:9 Function Definition: foo2(i1;b1; ( temp void) +0:9 Function Parameters: +0:9 'a' ( in int) +0:9 'b' ( in bool) +0:10 Function Definition: foo2(i1;u1; ( temp void) +0:10 Function Parameters: +0:10 'a' ( in int) +0:10 'b' ( in uint) +0:11 Function Definition: foo2(i1;i1; ( temp void) +0:11 Function Parameters: +0:11 'a' ( in int) +0:11 'b' ( in int) +0:12 Function Definition: foo2(i1;f1; ( temp void) +0:12 Function Parameters: +0:12 'a' ( in int) +0:12 'b' ( in float) +0:13 Function Definition: foo2(i1;d1; ( temp void) +0:13 Function Parameters: +0:13 'a' ( in int) +0:13 'b' ( in double) +0:16 Function Definition: foo3(b1; ( temp void) +0:16 Function Parameters: +0:16 'b' ( in bool) +0:17 Function Definition: foo4(u1; ( temp void) +0:17 Function Parameters: +0:17 'b' ( in uint) +0:18 Function Definition: foo5(i1; ( temp void) +0:18 Function Parameters: +0:18 'b' ( in int) +0:19 Function Definition: foo6(f1; ( temp void) +0:19 Function Parameters: +0:19 'b' ( in float) +0:20 Function Definition: foo7(d1; ( temp void) +0:20 Function Parameters: +0:20 'b' ( in double) +0:23 Function Definition: foo8(f1; ( temp void) +0:23 Function Parameters: +0:23 '' ( in float) +0:24 Function Definition: foo8(d1; ( temp void) +0:24 Function Parameters: +0:24 '' ( in double) +0:25 Function Definition: foo9(i1; ( temp void) +0:25 Function Parameters: +0:25 '' ( in int) +0:26 Function Definition: foo9(u1; ( temp void) +0:26 Function Parameters: +0:26 '' ( in uint) +0:27 Function Definition: foo10(b1; ( temp void) +0:27 Function Parameters: +0:27 '' ( in bool) +0:28 Function Definition: foo10(i1; ( temp void) +0:28 Function Parameters: +0:28 '' ( in int) +0:31 Function Definition: foo11(vf3; ( temp void) +0:31 Function Parameters: +0:31 '' ( in 3-component vector of float) +0:32 Function Definition: foo11(d1; ( temp void) +0:32 Function Parameters: +0:32 '' ( in double) +0:33 Function Definition: foo11(vi3; ( temp void) +0:33 Function Parameters: +0:33 '' ( in 3-component vector of int) +0:34 Function Definition: foo11(u1; ( temp void) +0:34 Function Parameters: +0:34 '' ( in uint) +0:35 Function Definition: foo12(vf1; ( temp void) +0:35 Function Parameters: +0:35 '' ( in 1-component vector of float) +0:36 Function Definition: foo12(vd3; ( temp void) +0:36 Function Parameters: +0:36 '' ( in 3-component vector of double) +0:37 Function Definition: foo16(u1; ( temp void) +0:37 Function Parameters: +0:37 '' ( in uint) +0:38 Function Definition: foo16(vu2; ( temp void) +0:38 Function Parameters: +0:38 '' ( in 2-component vector of uint) +0:41 Function Definition: foo13(vf3; ( temp void) +0:41 Function Parameters: +0:41 '' ( in 3-component vector of float) +0:42 Function Definition: foo14(vi1; ( temp void) +0:42 Function Parameters: +0:42 '' ( in 1-component vector of int) +0:43 Function Definition: foo15(vb1; ( temp void) +0:43 Function Parameters: +0:43 '' ( in 1-component vector of bool) +0:46 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:46 Function Parameters: +0:46 'input' ( in 4-component vector of float) +0:? Sequence +0:53 Function Call: foo1(d1;b1; ( temp void) +0:53 'd' ( temp double) +0:53 'b' ( temp bool) +0:54 Function Call: foo1(d1;d1; ( temp void) +0:54 'd' ( temp double) +0:54 'd' ( temp double) +0:55 Function Call: foo1(d1;u1; ( temp void) +0:55 'd' ( temp double) +0:55 'u' ( temp uint) +0:56 Function Call: foo1(d1;i1; ( temp void) +0:56 'd' ( temp double) +0:56 'i' ( temp int) +0:57 Function Call: foo1(d1;f1; ( temp void) +0:57 'd' ( temp double) +0:57 'f' ( temp float) +0:59 Function Call: foo1(d1;b1; ( temp void) +0:59 Convert float to double ( temp double) +0:59 'f' ( temp float) +0:59 'b' ( temp bool) +0:60 Function Call: foo1(d1;d1; ( temp void) +0:60 Convert float to double ( temp double) +0:60 'f' ( temp float) +0:60 'd' ( temp double) +0:61 Function Call: foo1(d1;u1; ( temp void) +0:61 Convert float to double ( temp double) +0:61 'f' ( temp float) +0:61 'u' ( temp uint) +0:62 Function Call: foo1(d1;i1; ( temp void) +0:62 Convert float to double ( temp double) +0:62 'f' ( temp float) +0:62 'i' ( temp int) +0:63 Function Call: foo1(d1;f1; ( temp void) +0:63 Convert float to double ( temp double) +0:63 'f' ( temp float) +0:63 'f' ( temp float) +0:65 Function Call: foo1(d1;b1; ( temp void) +0:65 Convert uint to double ( temp double) +0:65 'u' ( temp uint) +0:65 'b' ( temp bool) +0:66 Function Call: foo1(d1;d1; ( temp void) +0:66 Convert uint to double ( temp double) +0:66 'u' ( temp uint) +0:66 'd' ( temp double) +0:67 Function Call: foo1(d1;u1; ( temp void) +0:67 Convert uint to double ( temp double) +0:67 'u' ( temp uint) +0:67 'u' ( temp uint) +0:68 Function Call: foo1(d1;i1; ( temp void) +0:68 Convert uint to double ( temp double) +0:68 'u' ( temp uint) +0:68 'i' ( temp int) +0:69 Function Call: foo1(d1;f1; ( temp void) +0:69 Convert uint to double ( temp double) +0:69 'u' ( temp uint) +0:69 'f' ( temp float) +0:71 Function Call: foo1(d1;b1; ( temp void) +0:71 Convert int to double ( temp double) +0:71 'i' ( temp int) +0:71 'b' ( temp bool) +0:72 Function Call: foo1(d1;d1; ( temp void) +0:72 Convert int to double ( temp double) +0:72 'i' ( temp int) +0:72 'd' ( temp double) +0:73 Function Call: foo1(d1;u1; ( temp void) +0:73 Convert int to double ( temp double) +0:73 'i' ( temp int) +0:73 'u' ( temp uint) +0:74 Function Call: foo1(d1;i1; ( temp void) +0:74 Convert int to double ( temp double) +0:74 'i' ( temp int) +0:74 'i' ( temp int) +0:75 Function Call: foo1(d1;f1; ( temp void) +0:75 Convert int to double ( temp double) +0:75 'i' ( temp int) +0:75 'f' ( temp float) +0:77 Function Call: foo2(i1;b1; ( temp void) +0:77 Convert uint to int ( temp int) +0:77 'u' ( temp uint) +0:77 'b' ( temp bool) +0:78 Function Call: foo2(i1;d1; ( temp void) +0:78 Convert uint to int ( temp int) +0:78 'u' ( temp uint) +0:78 'd' ( temp double) +0:79 Function Call: foo2(i1;u1; ( temp void) +0:79 Convert uint to int ( temp int) +0:79 'u' ( temp uint) +0:79 'u' ( temp uint) +0:80 Function Call: foo2(i1;i1; ( temp void) +0:80 Convert uint to int ( temp int) +0:80 'u' ( temp uint) +0:80 'i' ( temp int) +0:81 Function Call: foo2(i1;f1; ( temp void) +0:81 Convert uint to int ( temp int) +0:81 'u' ( temp uint) +0:81 'f' ( temp float) +0:83 Function Call: foo2(i1;b1; ( temp void) +0:83 'i' ( temp int) +0:83 'b' ( temp bool) +0:84 Function Call: foo2(i1;d1; ( temp void) +0:84 'i' ( temp int) +0:84 'd' ( temp double) +0:85 Function Call: foo2(i1;u1; ( temp void) +0:85 'i' ( temp int) +0:85 'u' ( temp uint) +0:86 Function Call: foo2(i1;i1; ( temp void) +0:86 'i' ( temp int) +0:86 'i' ( temp int) +0:87 Function Call: foo2(i1;f1; ( temp void) +0:87 'i' ( temp int) +0:87 'f' ( temp float) +0:89 Function Call: foo3(b1; ( temp void) +0:89 'b' ( temp bool) +0:90 Function Call: foo3(b1; ( temp void) +0:90 Convert double to bool ( temp bool) +0:90 'd' ( temp double) +0:91 Function Call: foo3(b1; ( temp void) +0:91 Convert uint to bool ( temp bool) +0:91 'u' ( temp uint) +0:92 Function Call: foo3(b1; ( temp void) +0:92 Convert int to bool ( temp bool) +0:92 'i' ( temp int) +0:93 Function Call: foo3(b1; ( temp void) +0:93 Convert float to bool ( temp bool) +0:93 'f' ( temp float) +0:95 Function Call: foo4(u1; ( temp void) +0:95 Convert bool to uint ( temp uint) +0:95 'b' ( temp bool) +0:96 Function Call: foo4(u1; ( temp void) +0:96 Convert double to uint ( temp uint) +0:96 'd' ( temp double) +0:97 Function Call: foo4(u1; ( temp void) +0:97 'u' ( temp uint) +0:98 Function Call: foo4(u1; ( temp void) +0:98 Convert int to uint ( temp uint) +0:98 'i' ( temp int) +0:99 Function Call: foo4(u1; ( temp void) +0:99 Convert float to uint ( temp uint) +0:99 'f' ( temp float) +0:101 Function Call: foo5(i1; ( temp void) +0:101 Convert bool to int ( temp int) +0:101 'b' ( temp bool) +0:102 Function Call: foo5(i1; ( temp void) +0:102 Convert double to int ( temp int) +0:102 'd' ( temp double) +0:103 Function Call: foo5(i1; ( temp void) +0:103 Convert uint to int ( temp int) +0:103 'u' ( temp uint) +0:104 Function Call: foo5(i1; ( temp void) +0:104 'i' ( temp int) +0:105 Function Call: foo5(i1; ( temp void) +0:105 Convert float to int ( temp int) +0:105 'f' ( temp float) +0:107 Function Call: foo6(f1; ( temp void) +0:107 Convert bool to float ( temp float) +0:107 'b' ( temp bool) +0:108 Function Call: foo6(f1; ( temp void) +0:108 Convert double to float ( temp float) +0:108 'd' ( temp double) +0:109 Function Call: foo6(f1; ( temp void) +0:109 Convert uint to float ( temp float) +0:109 'u' ( temp uint) +0:110 Function Call: foo6(f1; ( temp void) +0:110 Convert int to float ( temp float) +0:110 'i' ( temp int) +0:111 Function Call: foo6(f1; ( temp void) +0:111 'f' ( temp float) +0:113 Function Call: foo7(d1; ( temp void) +0:113 Convert bool to double ( temp double) +0:113 'b' ( temp bool) +0:114 Function Call: foo7(d1; ( temp void) +0:114 'd' ( temp double) +0:115 Function Call: foo7(d1; ( temp void) +0:115 Convert uint to double ( temp double) +0:115 'u' ( temp uint) +0:116 Function Call: foo7(d1; ( temp void) +0:116 Convert int to double ( temp double) +0:116 'i' ( temp int) +0:117 Function Call: foo7(d1; ( temp void) +0:117 Convert float to double ( temp double) +0:117 'f' ( temp float) +0:119 Function Call: foo8(f1; ( temp void) +0:119 Convert bool to float ( temp float) +0:119 'b' ( temp bool) +0:120 Function Call: foo8(f1; ( temp void) +0:120 Convert uint to float ( temp float) +0:120 'u' ( temp uint) +0:121 Function Call: foo8(f1; ( temp void) +0:121 Convert int to float ( temp float) +0:121 'i' ( temp int) +0:123 Function Call: foo9(i1; ( temp void) +0:123 Convert bool to int ( temp int) +0:123 'b' ( temp bool) +0:124 Function Call: foo9(u1; ( temp void) +0:124 Convert float to uint ( temp uint) +0:124 'f' ( temp float) +0:125 Function Call: foo9(u1; ( temp void) +0:125 Convert double to uint ( temp uint) +0:125 'd' ( temp double) +0:127 Function Call: foo10(i1; ( temp void) +0:127 Convert uint to int ( temp int) +0:127 'u' ( temp uint) +0:128 Function Call: foo10(i1; ( temp void) +0:128 Convert float to int ( temp int) +0:128 'f' ( temp float) +0:129 Function Call: foo10(i1; ( temp void) +0:129 Convert double to int ( temp int) +0:129 'd' ( temp double) +0:131 Function Call: foo11(u1; ( temp void) +0:131 Convert bool to uint ( temp uint) +0:131 'b' ( temp bool) +0:132 Function Call: foo11(d1; ( temp void) +0:132 Convert float to double ( temp double) +0:132 'f' ( temp float) +0:133 Function Call: foo12(vd3; ( temp void) +0:133 Convert float to double ( temp 3-component vector of double) +0:133 Construct vec3 ( temp 3-component vector of float) +0:133 'f' ( temp float) +0:134 Function Call: foo16(vu2; ( temp void) +0:? Convert int to uint ( temp 2-component vector of uint) +0:? Construct ivec2 ( temp 2-component vector of int) +0:134 'i' ( temp int) +0:134 'i' ( temp int) +0:136 Function Call: foo13(vf3; ( temp void) +0:136 Construct vec3 ( in 3-component vector of float) +0:136 'f' ( temp float) +0:137 Function Call: foo14(vi1; ( temp void) +0:137 Construct int ( in 1-component vector of int) +0:137 Construct ivec4 ( temp 4-component vector of int) +0:137 'i' ( temp int) +0:138 Function Call: foo15(vb1; ( temp void) +0:138 Construct bool ( in 1-component vector of bool) +0:138 'b' ( temp bool) +0:139 Function Call: foo15(vb1; ( temp void) +0:139 Construct bool ( in 1-component vector of bool) +0:139 Construct bvec3 ( temp 3-component vector of bool) +0:139 'b' ( temp bool) +0:141 Branch: Return with expression +0:141 'input' ( in 4-component vector of float) +0:46 Function Definition: PixelShaderFunction( ( temp void) +0:46 Function Parameters: +0:? Sequence +0:46 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:46 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:46 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 520 + + Capability Shader + Capability Float64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 513 516 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 13 "foo1(d1;b1;" + Name 11 "a" + Name 12 "b" + Name 20 "foo1(d1;u1;" + Name 18 "a" + Name 19 "b" + Name 27 "foo1(d1;i1;" + Name 25 "a" + Name 26 "b" + Name 34 "foo1(d1;f1;" + Name 32 "a" + Name 33 "b" + Name 39 "foo1(d1;d1;" + Name 37 "a" + Name 38 "b" + Name 44 "foo2(i1;b1;" + Name 42 "a" + Name 43 "b" + Name 49 "foo2(i1;u1;" + Name 47 "a" + Name 48 "b" + Name 54 "foo2(i1;i1;" + Name 52 "a" + Name 53 "b" + Name 59 "foo2(i1;f1;" + Name 57 "a" + Name 58 "b" + Name 64 "foo2(i1;d1;" + Name 62 "a" + Name 63 "b" + Name 68 "foo3(b1;" + Name 67 "b" + Name 72 "foo4(u1;" + Name 71 "b" + Name 76 "foo5(i1;" + Name 75 "b" + Name 80 "foo6(f1;" + Name 79 "b" + Name 84 "foo7(d1;" + Name 83 "b" + Name 87 "foo8(f1;" + Name 86 "" + Name 90 "foo8(d1;" + Name 89 "" + Name 93 "foo9(i1;" + Name 92 "" + Name 96 "foo9(u1;" + Name 95 "" + Name 99 "foo10(b1;" + Name 98 "" + Name 102 "foo10(i1;" + Name 101 "" + Name 108 "foo11(vf3;" + Name 107 "" + Name 111 "foo11(d1;" + Name 110 "" + Name 117 "foo11(vi3;" + Name 116 "" + Name 120 "foo11(u1;" + Name 119 "" + Name 123 "foo12(vf1;" + Name 122 "" + Name 129 "foo12(vd3;" + Name 128 "" + Name 132 "foo16(u1;" + Name 131 "" + Name 138 "foo16(vu2;" + Name 137 "" + Name 141 "foo13(vf3;" + Name 140 "" + Name 144 "foo14(vi1;" + Name 143 "" + Name 147 "foo15(vb1;" + Name 146 "" + Name 153 "@PixelShaderFunction(vf4;" + Name 152 "input" + Name 155 "d" + Name 156 "b" + Name 157 "param" + Name 159 "param" + Name 162 "param" + Name 164 "param" + Name 167 "u" + Name 168 "param" + Name 170 "param" + Name 173 "i" + Name 174 "param" + Name 176 "param" + Name 179 "f" + Name 180 "param" + Name 182 "param" + Name 187 "param" + Name 188 "param" + Name 193 "param" + Name 194 "param" + Name 199 "param" + Name 200 "param" + Name 205 "param" + Name 206 "param" + Name 211 "param" + Name 212 "param" + Name 217 "param" + Name 218 "param" + Name 223 "param" + Name 224 "param" + Name 229 "param" + Name 230 "param" + Name 235 "param" + Name 236 "param" + Name 241 "param" + Name 242 "param" + Name 247 "param" + Name 248 "param" + Name 253 "param" + Name 254 "param" + Name 259 "param" + Name 260 "param" + Name 265 "param" + Name 266 "param" + Name 271 "param" + Name 272 "param" + Name 277 "param" + Name 278 "param" + Name 283 "param" + Name 284 "param" + Name 289 "param" + Name 290 "param" + Name 295 "param" + Name 296 "param" + Name 301 "param" + Name 302 "param" + Name 305 "param" + Name 307 "param" + Name 310 "param" + Name 312 "param" + Name 315 "param" + Name 317 "param" + Name 320 "param" + Name 322 "param" + Name 325 "param" + Name 327 "param" + Name 330 "param" + Name 336 "param" + Name 341 "param" + Name 345 "param" + Name 350 "param" + Name 355 "param" + Name 359 "param" + Name 361 "param" + Name 366 "param" + Name 370 "param" + Name 376 "param" + Name 380 "param" + Name 384 "param" + Name 386 "param" + Name 391 "param" + Name 396 "param" + Name 400 "param" + Name 404 "param" + Name 408 "param" + Name 410 "param" + Name 416 "param" + Name 418 "param" + Name 423 "param" + Name 427 "param" + Name 431 "param" + Name 435 "param" + Name 439 "param" + Name 443 "param" + Name 447 "param" + Name 451 "param" + Name 455 "param" + Name 459 "param" + Name 463 "param" + Name 467 "param" + Name 471 "param" + Name 475 "param" + Name 480 "param" + Name 487 "param" + Name 491 "param" + Name 497 "param" + Name 500 "param" + Name 506 "param" + Name 511 "input" + Name 513 "input" + Name 516 "@entryPointOutput" + Name 517 "param" + Decorate 513(input) Location 0 + Decorate 516(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 64 + 7: TypePointer Function 6(float64_t) + 8: TypeBool + 9: TypePointer Function 8(bool) + 10: TypeFunction 2 7(ptr) 9(ptr) + 15: TypeInt 32 0 + 16: TypePointer Function 15(int) + 17: TypeFunction 2 7(ptr) 16(ptr) + 22: TypeInt 32 1 + 23: TypePointer Function 22(int) + 24: TypeFunction 2 7(ptr) 23(ptr) + 29: TypeFloat 32 + 30: TypePointer Function 29(float) + 31: TypeFunction 2 7(ptr) 30(ptr) + 36: TypeFunction 2 7(ptr) 7(ptr) + 41: TypeFunction 2 23(ptr) 9(ptr) + 46: TypeFunction 2 23(ptr) 16(ptr) + 51: TypeFunction 2 23(ptr) 23(ptr) + 56: TypeFunction 2 23(ptr) 30(ptr) + 61: TypeFunction 2 23(ptr) 7(ptr) + 66: TypeFunction 2 9(ptr) + 70: TypeFunction 2 16(ptr) + 74: TypeFunction 2 23(ptr) + 78: TypeFunction 2 30(ptr) + 82: TypeFunction 2 7(ptr) + 104: TypeVector 29(float) 3 + 105: TypePointer Function 104(fvec3) + 106: TypeFunction 2 105(ptr) + 113: TypeVector 22(int) 3 + 114: TypePointer Function 113(ivec3) + 115: TypeFunction 2 114(ptr) + 125: TypeVector 6(float64_t) 3 + 126: TypePointer Function 125(f64vec3) + 127: TypeFunction 2 126(ptr) + 134: TypeVector 15(int) 2 + 135: TypePointer Function 134(ivec2) + 136: TypeFunction 2 135(ptr) + 149: TypeVector 29(float) 4 + 150: TypePointer Function 149(fvec4) + 151: TypeFunction 149(fvec4) 150(ptr) + 334:6(float64_t) Constant 0 0 + 339: 15(int) Constant 0 + 348: 29(float) Constant 0 + 353: 15(int) Constant 1 + 373: 22(int) Constant 0 + 374: 22(int) Constant 1 + 394: 29(float) Constant 1065353216 + 414:6(float64_t) Constant 0 1072693248 + 484: TypeVector 22(int) 2 + 494: TypeVector 22(int) 4 + 503: TypeVector 8(bool) 3 + 512: TypePointer Input 149(fvec4) + 513(input): 512(ptr) Variable Input + 515: TypePointer Output 149(fvec4) +516(@entryPointOutput): 515(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 511(input): 150(ptr) Variable Function + 517(param): 150(ptr) Variable Function + 514: 149(fvec4) Load 513(input) + Store 511(input) 514 + 518: 149(fvec4) Load 511(input) + Store 517(param) 518 + 519: 149(fvec4) FunctionCall 153(@PixelShaderFunction(vf4;) 517(param) + Store 516(@entryPointOutput) 519 + Return + FunctionEnd + 13(foo1(d1;b1;): 2 Function None 10 + 11(a): 7(ptr) FunctionParameter + 12(b): 9(ptr) FunctionParameter + 14: Label + Return + FunctionEnd + 20(foo1(d1;u1;): 2 Function None 17 + 18(a): 7(ptr) FunctionParameter + 19(b): 16(ptr) FunctionParameter + 21: Label + Return + FunctionEnd + 27(foo1(d1;i1;): 2 Function None 24 + 25(a): 7(ptr) FunctionParameter + 26(b): 23(ptr) FunctionParameter + 28: Label + Return + FunctionEnd + 34(foo1(d1;f1;): 2 Function None 31 + 32(a): 7(ptr) FunctionParameter + 33(b): 30(ptr) FunctionParameter + 35: Label + Return + FunctionEnd + 39(foo1(d1;d1;): 2 Function None 36 + 37(a): 7(ptr) FunctionParameter + 38(b): 7(ptr) FunctionParameter + 40: Label + Return + FunctionEnd + 44(foo2(i1;b1;): 2 Function None 41 + 42(a): 23(ptr) FunctionParameter + 43(b): 9(ptr) FunctionParameter + 45: Label + Return + FunctionEnd + 49(foo2(i1;u1;): 2 Function None 46 + 47(a): 23(ptr) FunctionParameter + 48(b): 16(ptr) FunctionParameter + 50: Label + Return + FunctionEnd + 54(foo2(i1;i1;): 2 Function None 51 + 52(a): 23(ptr) FunctionParameter + 53(b): 23(ptr) FunctionParameter + 55: Label + Return + FunctionEnd + 59(foo2(i1;f1;): 2 Function None 56 + 57(a): 23(ptr) FunctionParameter + 58(b): 30(ptr) FunctionParameter + 60: Label + Return + FunctionEnd + 64(foo2(i1;d1;): 2 Function None 61 + 62(a): 23(ptr) FunctionParameter + 63(b): 7(ptr) FunctionParameter + 65: Label + Return + FunctionEnd + 68(foo3(b1;): 2 Function None 66 + 67(b): 9(ptr) FunctionParameter + 69: Label + Return + FunctionEnd + 72(foo4(u1;): 2 Function None 70 + 71(b): 16(ptr) FunctionParameter + 73: Label + Return + FunctionEnd + 76(foo5(i1;): 2 Function None 74 + 75(b): 23(ptr) FunctionParameter + 77: Label + Return + FunctionEnd + 80(foo6(f1;): 2 Function None 78 + 79(b): 30(ptr) FunctionParameter + 81: Label + Return + FunctionEnd + 84(foo7(d1;): 2 Function None 82 + 83(b): 7(ptr) FunctionParameter + 85: Label + Return + FunctionEnd + 87(foo8(f1;): 2 Function None 78 + 86: 30(ptr) FunctionParameter + 88: Label + Return + FunctionEnd + 90(foo8(d1;): 2 Function None 82 + 89: 7(ptr) FunctionParameter + 91: Label + Return + FunctionEnd + 93(foo9(i1;): 2 Function None 74 + 92: 23(ptr) FunctionParameter + 94: Label + Return + FunctionEnd + 96(foo9(u1;): 2 Function None 70 + 95: 16(ptr) FunctionParameter + 97: Label + Return + FunctionEnd + 99(foo10(b1;): 2 Function None 66 + 98: 9(ptr) FunctionParameter + 100: Label + Return + FunctionEnd + 102(foo10(i1;): 2 Function None 74 + 101: 23(ptr) FunctionParameter + 103: Label + Return + FunctionEnd + 108(foo11(vf3;): 2 Function None 106 + 107: 105(ptr) FunctionParameter + 109: Label + Return + FunctionEnd + 111(foo11(d1;): 2 Function None 82 + 110: 7(ptr) FunctionParameter + 112: Label + Return + FunctionEnd + 117(foo11(vi3;): 2 Function None 115 + 116: 114(ptr) FunctionParameter + 118: Label + Return + FunctionEnd + 120(foo11(u1;): 2 Function None 70 + 119: 16(ptr) FunctionParameter + 121: Label + Return + FunctionEnd + 123(foo12(vf1;): 2 Function None 78 + 122: 30(ptr) FunctionParameter + 124: Label + Return + FunctionEnd + 129(foo12(vd3;): 2 Function None 127 + 128: 126(ptr) FunctionParameter + 130: Label + Return + FunctionEnd + 132(foo16(u1;): 2 Function None 70 + 131: 16(ptr) FunctionParameter + 133: Label + Return + FunctionEnd + 138(foo16(vu2;): 2 Function None 136 + 137: 135(ptr) FunctionParameter + 139: Label + Return + FunctionEnd + 141(foo13(vf3;): 2 Function None 106 + 140: 105(ptr) FunctionParameter + 142: Label + Return + FunctionEnd + 144(foo14(vi1;): 2 Function None 74 + 143: 23(ptr) FunctionParameter + 145: Label + Return + FunctionEnd + 147(foo15(vb1;): 2 Function None 66 + 146: 9(ptr) FunctionParameter + 148: Label + Return + FunctionEnd +153(@PixelShaderFunction(vf4;): 149(fvec4) Function None 151 + 152(input): 150(ptr) FunctionParameter + 154: Label + 155(d): 7(ptr) Variable Function + 156(b): 9(ptr) Variable Function + 157(param): 7(ptr) Variable Function + 159(param): 9(ptr) Variable Function + 162(param): 7(ptr) Variable Function + 164(param): 7(ptr) Variable Function + 167(u): 16(ptr) Variable Function + 168(param): 7(ptr) Variable Function + 170(param): 16(ptr) Variable Function + 173(i): 23(ptr) Variable Function + 174(param): 7(ptr) Variable Function + 176(param): 23(ptr) Variable Function + 179(f): 30(ptr) Variable Function + 180(param): 7(ptr) Variable Function + 182(param): 30(ptr) Variable Function + 187(param): 7(ptr) Variable Function + 188(param): 9(ptr) Variable Function + 193(param): 7(ptr) Variable Function + 194(param): 7(ptr) Variable Function + 199(param): 7(ptr) Variable Function + 200(param): 16(ptr) Variable Function + 205(param): 7(ptr) Variable Function + 206(param): 23(ptr) Variable Function + 211(param): 7(ptr) Variable Function + 212(param): 30(ptr) Variable Function + 217(param): 7(ptr) Variable Function + 218(param): 9(ptr) Variable Function + 223(param): 7(ptr) Variable Function + 224(param): 7(ptr) Variable Function + 229(param): 7(ptr) Variable Function + 230(param): 16(ptr) Variable Function + 235(param): 7(ptr) Variable Function + 236(param): 23(ptr) Variable Function + 241(param): 7(ptr) Variable Function + 242(param): 30(ptr) Variable Function + 247(param): 7(ptr) Variable Function + 248(param): 9(ptr) Variable Function + 253(param): 7(ptr) Variable Function + 254(param): 7(ptr) Variable Function + 259(param): 7(ptr) Variable Function + 260(param): 16(ptr) Variable Function + 265(param): 7(ptr) Variable Function + 266(param): 23(ptr) Variable Function + 271(param): 7(ptr) Variable Function + 272(param): 30(ptr) Variable Function + 277(param): 23(ptr) Variable Function + 278(param): 9(ptr) Variable Function + 283(param): 23(ptr) Variable Function + 284(param): 7(ptr) Variable Function + 289(param): 23(ptr) Variable Function + 290(param): 16(ptr) Variable Function + 295(param): 23(ptr) Variable Function + 296(param): 23(ptr) Variable Function + 301(param): 23(ptr) Variable Function + 302(param): 30(ptr) Variable Function + 305(param): 23(ptr) Variable Function + 307(param): 9(ptr) Variable Function + 310(param): 23(ptr) Variable Function + 312(param): 7(ptr) Variable Function + 315(param): 23(ptr) Variable Function + 317(param): 16(ptr) Variable Function + 320(param): 23(ptr) Variable Function + 322(param): 23(ptr) Variable Function + 325(param): 23(ptr) Variable Function + 327(param): 30(ptr) Variable Function + 330(param): 9(ptr) Variable Function + 336(param): 9(ptr) Variable Function + 341(param): 9(ptr) Variable Function + 345(param): 9(ptr) Variable Function + 350(param): 9(ptr) Variable Function + 355(param): 16(ptr) Variable Function + 359(param): 16(ptr) Variable Function + 361(param): 16(ptr) Variable Function + 366(param): 16(ptr) Variable Function + 370(param): 16(ptr) Variable Function + 376(param): 23(ptr) Variable Function + 380(param): 23(ptr) Variable Function + 384(param): 23(ptr) Variable Function + 386(param): 23(ptr) Variable Function + 391(param): 23(ptr) Variable Function + 396(param): 30(ptr) Variable Function + 400(param): 30(ptr) Variable Function + 404(param): 30(ptr) Variable Function + 408(param): 30(ptr) Variable Function + 410(param): 30(ptr) Variable Function + 416(param): 7(ptr) Variable Function + 418(param): 7(ptr) Variable Function + 423(param): 7(ptr) Variable Function + 427(param): 7(ptr) Variable Function + 431(param): 7(ptr) Variable Function + 435(param): 30(ptr) Variable Function + 439(param): 30(ptr) Variable Function + 443(param): 30(ptr) Variable Function + 447(param): 23(ptr) Variable Function + 451(param): 16(ptr) Variable Function + 455(param): 16(ptr) Variable Function + 459(param): 23(ptr) Variable Function + 463(param): 23(ptr) Variable Function + 467(param): 23(ptr) Variable Function + 471(param): 16(ptr) Variable Function + 475(param): 7(ptr) Variable Function + 480(param): 126(ptr) Variable Function + 487(param): 135(ptr) Variable Function + 491(param): 105(ptr) Variable Function + 497(param): 23(ptr) Variable Function + 500(param): 9(ptr) Variable Function + 506(param): 9(ptr) Variable Function + 158:6(float64_t) Load 155(d) + Store 157(param) 158 + 160: 8(bool) Load 156(b) + Store 159(param) 160 + 161: 2 FunctionCall 13(foo1(d1;b1;) 157(param) 159(param) + 163:6(float64_t) Load 155(d) + Store 162(param) 163 + 165:6(float64_t) Load 155(d) + Store 164(param) 165 + 166: 2 FunctionCall 39(foo1(d1;d1;) 162(param) 164(param) + 169:6(float64_t) Load 155(d) + Store 168(param) 169 + 171: 15(int) Load 167(u) + Store 170(param) 171 + 172: 2 FunctionCall 20(foo1(d1;u1;) 168(param) 170(param) + 175:6(float64_t) Load 155(d) + Store 174(param) 175 + 177: 22(int) Load 173(i) + Store 176(param) 177 + 178: 2 FunctionCall 27(foo1(d1;i1;) 174(param) 176(param) + 181:6(float64_t) Load 155(d) + Store 180(param) 181 + 183: 29(float) Load 179(f) + Store 182(param) 183 + 184: 2 FunctionCall 34(foo1(d1;f1;) 180(param) 182(param) + 185: 29(float) Load 179(f) + 186:6(float64_t) FConvert 185 + Store 187(param) 186 + 189: 8(bool) Load 156(b) + Store 188(param) 189 + 190: 2 FunctionCall 13(foo1(d1;b1;) 187(param) 188(param) + 191: 29(float) Load 179(f) + 192:6(float64_t) FConvert 191 + Store 193(param) 192 + 195:6(float64_t) Load 155(d) + Store 194(param) 195 + 196: 2 FunctionCall 39(foo1(d1;d1;) 193(param) 194(param) + 197: 29(float) Load 179(f) + 198:6(float64_t) FConvert 197 + Store 199(param) 198 + 201: 15(int) Load 167(u) + Store 200(param) 201 + 202: 2 FunctionCall 20(foo1(d1;u1;) 199(param) 200(param) + 203: 29(float) Load 179(f) + 204:6(float64_t) FConvert 203 + Store 205(param) 204 + 207: 22(int) Load 173(i) + Store 206(param) 207 + 208: 2 FunctionCall 27(foo1(d1;i1;) 205(param) 206(param) + 209: 29(float) Load 179(f) + 210:6(float64_t) FConvert 209 + Store 211(param) 210 + 213: 29(float) Load 179(f) + Store 212(param) 213 + 214: 2 FunctionCall 34(foo1(d1;f1;) 211(param) 212(param) + 215: 15(int) Load 167(u) + 216:6(float64_t) ConvertUToF 215 + Store 217(param) 216 + 219: 8(bool) Load 156(b) + Store 218(param) 219 + 220: 2 FunctionCall 13(foo1(d1;b1;) 217(param) 218(param) + 221: 15(int) Load 167(u) + 222:6(float64_t) ConvertUToF 221 + Store 223(param) 222 + 225:6(float64_t) Load 155(d) + Store 224(param) 225 + 226: 2 FunctionCall 39(foo1(d1;d1;) 223(param) 224(param) + 227: 15(int) Load 167(u) + 228:6(float64_t) ConvertUToF 227 + Store 229(param) 228 + 231: 15(int) Load 167(u) + Store 230(param) 231 + 232: 2 FunctionCall 20(foo1(d1;u1;) 229(param) 230(param) + 233: 15(int) Load 167(u) + 234:6(float64_t) ConvertUToF 233 + Store 235(param) 234 + 237: 22(int) Load 173(i) + Store 236(param) 237 + 238: 2 FunctionCall 27(foo1(d1;i1;) 235(param) 236(param) + 239: 15(int) Load 167(u) + 240:6(float64_t) ConvertUToF 239 + Store 241(param) 240 + 243: 29(float) Load 179(f) + Store 242(param) 243 + 244: 2 FunctionCall 34(foo1(d1;f1;) 241(param) 242(param) + 245: 22(int) Load 173(i) + 246:6(float64_t) ConvertSToF 245 + Store 247(param) 246 + 249: 8(bool) Load 156(b) + Store 248(param) 249 + 250: 2 FunctionCall 13(foo1(d1;b1;) 247(param) 248(param) + 251: 22(int) Load 173(i) + 252:6(float64_t) ConvertSToF 251 + Store 253(param) 252 + 255:6(float64_t) Load 155(d) + Store 254(param) 255 + 256: 2 FunctionCall 39(foo1(d1;d1;) 253(param) 254(param) + 257: 22(int) Load 173(i) + 258:6(float64_t) ConvertSToF 257 + Store 259(param) 258 + 261: 15(int) Load 167(u) + Store 260(param) 261 + 262: 2 FunctionCall 20(foo1(d1;u1;) 259(param) 260(param) + 263: 22(int) Load 173(i) + 264:6(float64_t) ConvertSToF 263 + Store 265(param) 264 + 267: 22(int) Load 173(i) + Store 266(param) 267 + 268: 2 FunctionCall 27(foo1(d1;i1;) 265(param) 266(param) + 269: 22(int) Load 173(i) + 270:6(float64_t) ConvertSToF 269 + Store 271(param) 270 + 273: 29(float) Load 179(f) + Store 272(param) 273 + 274: 2 FunctionCall 34(foo1(d1;f1;) 271(param) 272(param) + 275: 15(int) Load 167(u) + 276: 22(int) Bitcast 275 + Store 277(param) 276 + 279: 8(bool) Load 156(b) + Store 278(param) 279 + 280: 2 FunctionCall 44(foo2(i1;b1;) 277(param) 278(param) + 281: 15(int) Load 167(u) + 282: 22(int) Bitcast 281 + Store 283(param) 282 + 285:6(float64_t) Load 155(d) + Store 284(param) 285 + 286: 2 FunctionCall 64(foo2(i1;d1;) 283(param) 284(param) + 287: 15(int) Load 167(u) + 288: 22(int) Bitcast 287 + Store 289(param) 288 + 291: 15(int) Load 167(u) + Store 290(param) 291 + 292: 2 FunctionCall 49(foo2(i1;u1;) 289(param) 290(param) + 293: 15(int) Load 167(u) + 294: 22(int) Bitcast 293 + Store 295(param) 294 + 297: 22(int) Load 173(i) + Store 296(param) 297 + 298: 2 FunctionCall 54(foo2(i1;i1;) 295(param) 296(param) + 299: 15(int) Load 167(u) + 300: 22(int) Bitcast 299 + Store 301(param) 300 + 303: 29(float) Load 179(f) + Store 302(param) 303 + 304: 2 FunctionCall 59(foo2(i1;f1;) 301(param) 302(param) + 306: 22(int) Load 173(i) + Store 305(param) 306 + 308: 8(bool) Load 156(b) + Store 307(param) 308 + 309: 2 FunctionCall 44(foo2(i1;b1;) 305(param) 307(param) + 311: 22(int) Load 173(i) + Store 310(param) 311 + 313:6(float64_t) Load 155(d) + Store 312(param) 313 + 314: 2 FunctionCall 64(foo2(i1;d1;) 310(param) 312(param) + 316: 22(int) Load 173(i) + Store 315(param) 316 + 318: 15(int) Load 167(u) + Store 317(param) 318 + 319: 2 FunctionCall 49(foo2(i1;u1;) 315(param) 317(param) + 321: 22(int) Load 173(i) + Store 320(param) 321 + 323: 22(int) Load 173(i) + Store 322(param) 323 + 324: 2 FunctionCall 54(foo2(i1;i1;) 320(param) 322(param) + 326: 22(int) Load 173(i) + Store 325(param) 326 + 328: 29(float) Load 179(f) + Store 327(param) 328 + 329: 2 FunctionCall 59(foo2(i1;f1;) 325(param) 327(param) + 331: 8(bool) Load 156(b) + Store 330(param) 331 + 332: 2 FunctionCall 68(foo3(b1;) 330(param) + 333:6(float64_t) Load 155(d) + 335: 8(bool) FOrdNotEqual 333 334 + Store 336(param) 335 + 337: 2 FunctionCall 68(foo3(b1;) 336(param) + 338: 15(int) Load 167(u) + 340: 8(bool) INotEqual 338 339 + Store 341(param) 340 + 342: 2 FunctionCall 68(foo3(b1;) 341(param) + 343: 22(int) Load 173(i) + 344: 8(bool) INotEqual 343 339 + Store 345(param) 344 + 346: 2 FunctionCall 68(foo3(b1;) 345(param) + 347: 29(float) Load 179(f) + 349: 8(bool) FOrdNotEqual 347 348 + Store 350(param) 349 + 351: 2 FunctionCall 68(foo3(b1;) 350(param) + 352: 8(bool) Load 156(b) + 354: 15(int) Select 352 353 339 + Store 355(param) 354 + 356: 2 FunctionCall 72(foo4(u1;) 355(param) + 357:6(float64_t) Load 155(d) + 358: 15(int) ConvertFToU 357 + Store 359(param) 358 + 360: 2 FunctionCall 72(foo4(u1;) 359(param) + 362: 15(int) Load 167(u) + Store 361(param) 362 + 363: 2 FunctionCall 72(foo4(u1;) 361(param) + 364: 22(int) Load 173(i) + 365: 15(int) Bitcast 364 + Store 366(param) 365 + 367: 2 FunctionCall 72(foo4(u1;) 366(param) + 368: 29(float) Load 179(f) + 369: 15(int) ConvertFToU 368 + Store 370(param) 369 + 371: 2 FunctionCall 72(foo4(u1;) 370(param) + 372: 8(bool) Load 156(b) + 375: 22(int) Select 372 374 373 + Store 376(param) 375 + 377: 2 FunctionCall 76(foo5(i1;) 376(param) + 378:6(float64_t) Load 155(d) + 379: 22(int) ConvertFToS 378 + Store 380(param) 379 + 381: 2 FunctionCall 76(foo5(i1;) 380(param) + 382: 15(int) Load 167(u) + 383: 22(int) Bitcast 382 + Store 384(param) 383 + 385: 2 FunctionCall 76(foo5(i1;) 384(param) + 387: 22(int) Load 173(i) + Store 386(param) 387 + 388: 2 FunctionCall 76(foo5(i1;) 386(param) + 389: 29(float) Load 179(f) + 390: 22(int) ConvertFToS 389 + Store 391(param) 390 + 392: 2 FunctionCall 76(foo5(i1;) 391(param) + 393: 8(bool) Load 156(b) + 395: 29(float) Select 393 394 348 + Store 396(param) 395 + 397: 2 FunctionCall 80(foo6(f1;) 396(param) + 398:6(float64_t) Load 155(d) + 399: 29(float) FConvert 398 + Store 400(param) 399 + 401: 2 FunctionCall 80(foo6(f1;) 400(param) + 402: 15(int) Load 167(u) + 403: 29(float) ConvertUToF 402 + Store 404(param) 403 + 405: 2 FunctionCall 80(foo6(f1;) 404(param) + 406: 22(int) Load 173(i) + 407: 29(float) ConvertSToF 406 + Store 408(param) 407 + 409: 2 FunctionCall 80(foo6(f1;) 408(param) + 411: 29(float) Load 179(f) + Store 410(param) 411 + 412: 2 FunctionCall 80(foo6(f1;) 410(param) + 413: 8(bool) Load 156(b) + 415:6(float64_t) Select 413 414 334 + Store 416(param) 415 + 417: 2 FunctionCall 84(foo7(d1;) 416(param) + 419:6(float64_t) Load 155(d) + Store 418(param) 419 + 420: 2 FunctionCall 84(foo7(d1;) 418(param) + 421: 15(int) Load 167(u) + 422:6(float64_t) ConvertUToF 421 + Store 423(param) 422 + 424: 2 FunctionCall 84(foo7(d1;) 423(param) + 425: 22(int) Load 173(i) + 426:6(float64_t) ConvertSToF 425 + Store 427(param) 426 + 428: 2 FunctionCall 84(foo7(d1;) 427(param) + 429: 29(float) Load 179(f) + 430:6(float64_t) FConvert 429 + Store 431(param) 430 + 432: 2 FunctionCall 84(foo7(d1;) 431(param) + 433: 8(bool) Load 156(b) + 434: 29(float) Select 433 394 348 + Store 435(param) 434 + 436: 2 FunctionCall 87(foo8(f1;) 435(param) + 437: 15(int) Load 167(u) + 438: 29(float) ConvertUToF 437 + Store 439(param) 438 + 440: 2 FunctionCall 87(foo8(f1;) 439(param) + 441: 22(int) Load 173(i) + 442: 29(float) ConvertSToF 441 + Store 443(param) 442 + 444: 2 FunctionCall 87(foo8(f1;) 443(param) + 445: 8(bool) Load 156(b) + 446: 22(int) Select 445 374 373 + Store 447(param) 446 + 448: 2 FunctionCall 93(foo9(i1;) 447(param) + 449: 29(float) Load 179(f) + 450: 15(int) ConvertFToU 449 + Store 451(param) 450 + 452: 2 FunctionCall 96(foo9(u1;) 451(param) + 453:6(float64_t) Load 155(d) + 454: 15(int) ConvertFToU 453 + Store 455(param) 454 + 456: 2 FunctionCall 96(foo9(u1;) 455(param) + 457: 15(int) Load 167(u) + 458: 22(int) Bitcast 457 + Store 459(param) 458 + 460: 2 FunctionCall 102(foo10(i1;) 459(param) + 461: 29(float) Load 179(f) + 462: 22(int) ConvertFToS 461 + Store 463(param) 462 + 464: 2 FunctionCall 102(foo10(i1;) 463(param) + 465:6(float64_t) Load 155(d) + 466: 22(int) ConvertFToS 465 + Store 467(param) 466 + 468: 2 FunctionCall 102(foo10(i1;) 467(param) + 469: 8(bool) Load 156(b) + 470: 15(int) Select 469 353 339 + Store 471(param) 470 + 472: 2 FunctionCall 120(foo11(u1;) 471(param) + 473: 29(float) Load 179(f) + 474:6(float64_t) FConvert 473 + Store 475(param) 474 + 476: 2 FunctionCall 111(foo11(d1;) 475(param) + 477: 29(float) Load 179(f) + 478: 104(fvec3) CompositeConstruct 477 477 477 + 479:125(f64vec3) FConvert 478 + Store 480(param) 479 + 481: 2 FunctionCall 129(foo12(vd3;) 480(param) + 482: 22(int) Load 173(i) + 483: 22(int) Load 173(i) + 485: 484(ivec2) CompositeConstruct 482 483 + 486: 134(ivec2) Bitcast 485 + Store 487(param) 486 + 488: 2 FunctionCall 138(foo16(vu2;) 487(param) + 489: 29(float) Load 179(f) + 490: 104(fvec3) CompositeConstruct 489 489 489 + Store 491(param) 490 + 492: 2 FunctionCall 141(foo13(vf3;) 491(param) + 493: 22(int) Load 173(i) + 495: 494(ivec4) CompositeConstruct 493 493 493 493 + 496: 22(int) CompositeExtract 495 0 + Store 497(param) 496 + 498: 2 FunctionCall 144(foo14(vi1;) 497(param) + 499: 8(bool) Load 156(b) + Store 500(param) 499 + 501: 2 FunctionCall 147(foo15(vb1;) 500(param) + 502: 8(bool) Load 156(b) + 504: 503(bvec3) CompositeConstruct 502 502 502 + 505: 8(bool) CompositeExtract 504 0 + Store 506(param) 505 + 507: 2 FunctionCall 147(foo15(vb1;) 506(param) + 508: 149(fvec4) Load 152(input) + ReturnValue 508 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.params.default.frag.out b/deps/glslang/Test/baseResults/hlsl.params.default.frag.out new file mode 100644 index 00000000..c98e0c64 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.params.default.frag.out @@ -0,0 +1,653 @@ +hlsl.params.default.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:9 Function Definition: fn1(vi4;b1;b1; ( temp 4-component vector of int) +0:9 Function Parameters: +0:9 'p0' ( in 4-component vector of int) +0:9 'b1' ( in bool) +0:9 'b2' ( in bool) +0:? Sequence +0:10 Branch: Return with expression +0:10 'p0' ( in 4-component vector of int) +0:17 Function Definition: fn1(vi4;vi4;i1[2];i1; ( temp 4-component vector of int) +0:17 Function Parameters: +0:17 'p0' ( in 4-component vector of int) +0:17 'p1' ( in 4-component vector of int) +0:17 'p2' ( in 2-element array of int) +0:17 'p3' ( in int) +0:? Sequence +0:18 Branch: Return with expression +0:18 add ( temp 4-component vector of int) +0:18 add ( temp 4-component vector of int) +0:18 add ( temp 4-component vector of int) +0:18 'p0' ( in 4-component vector of int) +0:18 'p1' ( in 4-component vector of int) +0:18 direct index ( temp int) +0:18 'p2' ( in 2-element array of int) +0:18 Constant: +0:18 0 (const int) +0:18 'p3' ( in int) +0:23 Function Definition: fn2(vi4;i1; ( temp 4-component vector of int) +0:23 Function Parameters: +0:23 'p0' ( in 4-component vector of int) +0:23 'x' ( in int) +0:? Sequence +0:24 Branch: Return with expression +0:? Constant: +0:? 10 (const int) +0:? 11 (const int) +0:? 12 (const int) +0:? 13 (const int) +0:28 Function Definition: fn2(vi4;f1; ( temp 4-component vector of int) +0:28 Function Parameters: +0:28 'p0' ( in 4-component vector of int) +0:28 'x' ( in float) +0:? Sequence +0:29 Branch: Return with expression +0:29 add ( temp 4-component vector of int) +0:29 'p0' ( in 4-component vector of int) +0:? Constant: +0:? 20 (const int) +0:? 21 (const int) +0:? 22 (const int) +0:? 23 (const int) +0:32 Function Definition: fn3(i1; ( temp void) +0:32 Function Parameters: +0:32 'p0' ( in int) +0:36 Function Definition: @main( ( temp 4-component vector of int) +0:36 Function Parameters: +0:? Sequence +0:37 Sequence +0:37 move second child to first child ( temp 2-element array of int) +0:37 'myarray' ( temp 2-element array of int) +0:37 Constant: +0:37 30 (const int) +0:37 31 (const int) +0:39 Function Call: fn3(i1; ( temp void) +0:32 Constant: +0:32 3 (const int) +0:40 Function Call: fn3(i1; ( temp void) +0:40 Constant: +0:40 5 (const int) +0:50 Branch: Return with expression +0:49 add ( temp 4-component vector of int) +0:47 add ( temp 4-component vector of int) +0:46 add ( temp 4-component vector of int) +0:45 add ( temp 4-component vector of int) +0:44 add ( temp 4-component vector of int) +0:43 add ( temp 4-component vector of int) +0:42 add ( temp 4-component vector of int) +0:42 Function Call: fn1(vi4;vi4;i1[2];i1; ( temp 4-component vector of int) +0:42 Constant: +0:42 100 (const int) +0:42 100 (const int) +0:42 100 (const int) +0:42 100 (const int) +0:? Constant: +0:? -1 (const int) +0:? -2 (const int) +0:? -3 (const int) +0:? -4 (const int) +0:15 Constant: +0:15 1 (const int) +0:15 2 (const int) +0:16 Constant: +0:16 42 (const int) +0:43 Function Call: fn1(vi4;vi4;i1[2];i1; ( temp 4-component vector of int) +0:43 Constant: +0:43 101 (const int) +0:43 101 (const int) +0:43 101 (const int) +0:43 101 (const int) +0:43 ui4: direct index for structure ( uniform 4-component vector of int) +0:43 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of int ui4}) +0:43 Constant: +0:43 0 (const uint) +0:15 Constant: +0:15 1 (const int) +0:15 2 (const int) +0:16 Constant: +0:16 42 (const int) +0:44 Function Call: fn1(vi4;vi4;i1[2];i1; ( temp 4-component vector of int) +0:44 Constant: +0:44 102 (const int) +0:44 102 (const int) +0:44 102 (const int) +0:44 102 (const int) +0:44 ui4: direct index for structure ( uniform 4-component vector of int) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of int ui4}) +0:44 Constant: +0:44 0 (const uint) +0:44 'myarray' ( temp 2-element array of int) +0:16 Constant: +0:16 42 (const int) +0:45 Function Call: fn1(vi4;vi4;i1[2];i1; ( temp 4-component vector of int) +0:45 Constant: +0:45 103 (const int) +0:45 103 (const int) +0:45 103 (const int) +0:45 103 (const int) +0:45 ui4: direct index for structure ( uniform 4-component vector of int) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of int ui4}) +0:45 Constant: +0:45 0 (const uint) +0:45 'myarray' ( temp 2-element array of int) +0:45 Constant: +0:45 99 (const int) +0:46 Function Call: fn1(vi4;b1;b1; ( temp 4-component vector of int) +0:46 Constant: +0:46 104 (const int) +0:46 104 (const int) +0:46 104 (const int) +0:46 104 (const int) +0:46 Constant: +0:46 false (const bool) +0:9 Constant: +0:9 false (const bool) +0:47 Function Call: fn1(vi4;b1;b1; ( temp 4-component vector of int) +0:47 Constant: +0:47 105 (const int) +0:47 105 (const int) +0:47 105 (const int) +0:47 105 (const int) +0:47 Constant: +0:47 false (const bool) +0:47 Constant: +0:47 true (const bool) +0:49 Function Call: fn2(vi4;f1; ( temp 4-component vector of int) +0:49 Constant: +0:49 110 (const int) +0:49 110 (const int) +0:49 110 (const int) +0:49 110 (const int) +0:49 Constant: +0:49 11.110000 +0:50 Function Call: fn2(vi4;i1; ( temp 4-component vector of int) +0:50 Constant: +0:50 111 (const int) +0:50 111 (const int) +0:50 111 (const int) +0:50 111 (const int) +0:50 Constant: +0:50 12 (const int) +0:36 Function Definition: main( ( temp void) +0:36 Function Parameters: +0:? Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of int) +0:36 Function Call: @main( ( temp 4-component vector of int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of int ui4}) +0:? 'cia' ( const int) +0:? -4 (const int) +0:? 'cib' ( const int) +0:? -42 (const int) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of int) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:9 Function Definition: fn1(vi4;b1;b1; ( temp 4-component vector of int) +0:9 Function Parameters: +0:9 'p0' ( in 4-component vector of int) +0:9 'b1' ( in bool) +0:9 'b2' ( in bool) +0:? Sequence +0:10 Branch: Return with expression +0:10 'p0' ( in 4-component vector of int) +0:17 Function Definition: fn1(vi4;vi4;i1[2];i1; ( temp 4-component vector of int) +0:17 Function Parameters: +0:17 'p0' ( in 4-component vector of int) +0:17 'p1' ( in 4-component vector of int) +0:17 'p2' ( in 2-element array of int) +0:17 'p3' ( in int) +0:? Sequence +0:18 Branch: Return with expression +0:18 add ( temp 4-component vector of int) +0:18 add ( temp 4-component vector of int) +0:18 add ( temp 4-component vector of int) +0:18 'p0' ( in 4-component vector of int) +0:18 'p1' ( in 4-component vector of int) +0:18 direct index ( temp int) +0:18 'p2' ( in 2-element array of int) +0:18 Constant: +0:18 0 (const int) +0:18 'p3' ( in int) +0:23 Function Definition: fn2(vi4;i1; ( temp 4-component vector of int) +0:23 Function Parameters: +0:23 'p0' ( in 4-component vector of int) +0:23 'x' ( in int) +0:? Sequence +0:24 Branch: Return with expression +0:? Constant: +0:? 10 (const int) +0:? 11 (const int) +0:? 12 (const int) +0:? 13 (const int) +0:28 Function Definition: fn2(vi4;f1; ( temp 4-component vector of int) +0:28 Function Parameters: +0:28 'p0' ( in 4-component vector of int) +0:28 'x' ( in float) +0:? Sequence +0:29 Branch: Return with expression +0:29 add ( temp 4-component vector of int) +0:29 'p0' ( in 4-component vector of int) +0:? Constant: +0:? 20 (const int) +0:? 21 (const int) +0:? 22 (const int) +0:? 23 (const int) +0:32 Function Definition: fn3(i1; ( temp void) +0:32 Function Parameters: +0:32 'p0' ( in int) +0:36 Function Definition: @main( ( temp 4-component vector of int) +0:36 Function Parameters: +0:? Sequence +0:37 Sequence +0:37 move second child to first child ( temp 2-element array of int) +0:37 'myarray' ( temp 2-element array of int) +0:37 Constant: +0:37 30 (const int) +0:37 31 (const int) +0:39 Function Call: fn3(i1; ( temp void) +0:32 Constant: +0:32 3 (const int) +0:40 Function Call: fn3(i1; ( temp void) +0:40 Constant: +0:40 5 (const int) +0:50 Branch: Return with expression +0:49 add ( temp 4-component vector of int) +0:47 add ( temp 4-component vector of int) +0:46 add ( temp 4-component vector of int) +0:45 add ( temp 4-component vector of int) +0:44 add ( temp 4-component vector of int) +0:43 add ( temp 4-component vector of int) +0:42 add ( temp 4-component vector of int) +0:42 Function Call: fn1(vi4;vi4;i1[2];i1; ( temp 4-component vector of int) +0:42 Constant: +0:42 100 (const int) +0:42 100 (const int) +0:42 100 (const int) +0:42 100 (const int) +0:? Constant: +0:? -1 (const int) +0:? -2 (const int) +0:? -3 (const int) +0:? -4 (const int) +0:15 Constant: +0:15 1 (const int) +0:15 2 (const int) +0:16 Constant: +0:16 42 (const int) +0:43 Function Call: fn1(vi4;vi4;i1[2];i1; ( temp 4-component vector of int) +0:43 Constant: +0:43 101 (const int) +0:43 101 (const int) +0:43 101 (const int) +0:43 101 (const int) +0:43 ui4: direct index for structure ( uniform 4-component vector of int) +0:43 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of int ui4}) +0:43 Constant: +0:43 0 (const uint) +0:15 Constant: +0:15 1 (const int) +0:15 2 (const int) +0:16 Constant: +0:16 42 (const int) +0:44 Function Call: fn1(vi4;vi4;i1[2];i1; ( temp 4-component vector of int) +0:44 Constant: +0:44 102 (const int) +0:44 102 (const int) +0:44 102 (const int) +0:44 102 (const int) +0:44 ui4: direct index for structure ( uniform 4-component vector of int) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of int ui4}) +0:44 Constant: +0:44 0 (const uint) +0:44 'myarray' ( temp 2-element array of int) +0:16 Constant: +0:16 42 (const int) +0:45 Function Call: fn1(vi4;vi4;i1[2];i1; ( temp 4-component vector of int) +0:45 Constant: +0:45 103 (const int) +0:45 103 (const int) +0:45 103 (const int) +0:45 103 (const int) +0:45 ui4: direct index for structure ( uniform 4-component vector of int) +0:45 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of int ui4}) +0:45 Constant: +0:45 0 (const uint) +0:45 'myarray' ( temp 2-element array of int) +0:45 Constant: +0:45 99 (const int) +0:46 Function Call: fn1(vi4;b1;b1; ( temp 4-component vector of int) +0:46 Constant: +0:46 104 (const int) +0:46 104 (const int) +0:46 104 (const int) +0:46 104 (const int) +0:46 Constant: +0:46 false (const bool) +0:9 Constant: +0:9 false (const bool) +0:47 Function Call: fn1(vi4;b1;b1; ( temp 4-component vector of int) +0:47 Constant: +0:47 105 (const int) +0:47 105 (const int) +0:47 105 (const int) +0:47 105 (const int) +0:47 Constant: +0:47 false (const bool) +0:47 Constant: +0:47 true (const bool) +0:49 Function Call: fn2(vi4;f1; ( temp 4-component vector of int) +0:49 Constant: +0:49 110 (const int) +0:49 110 (const int) +0:49 110 (const int) +0:49 110 (const int) +0:49 Constant: +0:49 11.110000 +0:50 Function Call: fn2(vi4;i1; ( temp 4-component vector of int) +0:50 Constant: +0:50 111 (const int) +0:50 111 (const int) +0:50 111 (const int) +0:50 111 (const int) +0:50 Constant: +0:50 12 (const int) +0:36 Function Definition: main( ( temp void) +0:36 Function Parameters: +0:? Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of int) +0:36 Function Call: @main( ( temp 4-component vector of int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of int ui4}) +0:? 'cia' ( const int) +0:? -4 (const int) +0:? 'cib' ( const int) +0:? -42 (const int) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of int) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 178 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 175 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 15 "fn1(vi4;b1;b1;" + Name 12 "p0" + Name 13 "b1" + Name 14 "b2" + Name 27 "fn1(vi4;vi4;i1[2];i1;" + Name 23 "p0" + Name 24 "p1" + Name 25 "p2" + Name 26 "p3" + Name 32 "fn2(vi4;i1;" + Name 30 "p0" + Name 31 "x" + Name 39 "fn2(vi4;f1;" + Name 37 "p0" + Name 38 "x" + Name 43 "fn3(i1;" + Name 42 "p0" + Name 46 "@main(" + Name 80 "myarray" + Name 85 "param" + Name 88 "param" + Name 101 "param" + Name 102 "param" + Name 103 "param" + Name 104 "param" + Name 108 "$Global" + MemberName 108($Global) 0 "ui4" + Name 110 "" + Name 111 "param" + Name 112 "param" + Name 116 "param" + Name 117 "param" + Name 122 "param" + Name 123 "param" + Name 126 "param" + Name 128 "param" + Name 134 "param" + Name 135 "param" + Name 138 "param" + Name 140 "param" + Name 146 "param" + Name 147 "param" + Name 148 "param" + Name 154 "param" + Name 155 "param" + Name 156 "param" + Name 162 "param" + Name 163 "param" + Name 168 "param" + Name 169 "param" + Name 175 "@entryPointOutput" + MemberDecorate 108($Global) 0 Offset 0 + Decorate 108($Global) Block + Decorate 110 DescriptorSet 0 + Decorate 175(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeVector 6(int) 4 + 8: TypePointer Function 7(ivec4) + 9: TypeBool + 10: TypePointer Function 9(bool) + 11: TypeFunction 7(ivec4) 8(ptr) 10(ptr) 10(ptr) + 17: TypeInt 32 0 + 18: 17(int) Constant 2 + 19: TypeArray 6(int) 18 + 20: TypePointer Function 19 + 21: TypePointer Function 6(int) + 22: TypeFunction 7(ivec4) 8(ptr) 8(ptr) 20(ptr) 21(ptr) + 29: TypeFunction 7(ivec4) 8(ptr) 21(ptr) + 34: TypeFloat 32 + 35: TypePointer Function 34(float) + 36: TypeFunction 7(ivec4) 8(ptr) 35(ptr) + 41: TypeFunction 2 21(ptr) + 45: TypeFunction 7(ivec4) + 54: 6(int) Constant 0 + 64: 6(int) Constant 10 + 65: 6(int) Constant 11 + 66: 6(int) Constant 12 + 67: 6(int) Constant 13 + 68: 7(ivec4) ConstantComposite 64 65 66 67 + 72: 6(int) Constant 20 + 73: 6(int) Constant 21 + 74: 6(int) Constant 22 + 75: 6(int) Constant 23 + 76: 7(ivec4) ConstantComposite 72 73 74 75 + 81: 6(int) Constant 30 + 82: 6(int) Constant 31 + 83: 19 ConstantComposite 81 82 + 84: 6(int) Constant 3 + 87: 6(int) Constant 5 + 90: 6(int) Constant 100 + 91: 7(ivec4) ConstantComposite 90 90 90 90 + 92: 6(int) Constant 4294967295 + 93: 6(int) Constant 4294967294 + 94: 6(int) Constant 4294967293 + 95: 6(int) Constant 4294967292 + 96: 7(ivec4) ConstantComposite 92 93 94 95 + 97: 6(int) Constant 1 + 98: 6(int) Constant 2 + 99: 19 ConstantComposite 97 98 + 100: 6(int) Constant 42 + 106: 6(int) Constant 101 + 107: 7(ivec4) ConstantComposite 106 106 106 106 + 108($Global): TypeStruct 7(ivec4) + 109: TypePointer Uniform 108($Global) + 110: 109(ptr) Variable Uniform + 113: TypePointer Uniform 7(ivec4) + 120: 6(int) Constant 102 + 121: 7(ivec4) ConstantComposite 120 120 120 120 + 131: 6(int) Constant 103 + 132: 7(ivec4) ConstantComposite 131 131 131 131 + 133: 6(int) Constant 99 + 143: 6(int) Constant 104 + 144: 7(ivec4) ConstantComposite 143 143 143 143 + 145: 9(bool) ConstantFalse + 151: 6(int) Constant 105 + 152: 7(ivec4) ConstantComposite 151 151 151 151 + 153: 9(bool) ConstantTrue + 159: 6(int) Constant 110 + 160: 7(ivec4) ConstantComposite 159 159 159 159 + 161: 34(float) Constant 1093780111 + 166: 6(int) Constant 111 + 167: 7(ivec4) ConstantComposite 166 166 166 166 + 174: TypePointer Output 7(ivec4) +175(@entryPointOutput): 174(ptr) Variable Output + 177: 6(int) Constant 4294967254 + 4(main): 2 Function None 3 + 5: Label + 176: 7(ivec4) FunctionCall 46(@main() + Store 175(@entryPointOutput) 176 + Return + FunctionEnd +15(fn1(vi4;b1;b1;): 7(ivec4) Function None 11 + 12(p0): 8(ptr) FunctionParameter + 13(b1): 10(ptr) FunctionParameter + 14(b2): 10(ptr) FunctionParameter + 16: Label + 48: 7(ivec4) Load 12(p0) + ReturnValue 48 + FunctionEnd +27(fn1(vi4;vi4;i1[2];i1;): 7(ivec4) Function None 22 + 23(p0): 8(ptr) FunctionParameter + 24(p1): 8(ptr) FunctionParameter + 25(p2): 20(ptr) FunctionParameter + 26(p3): 21(ptr) FunctionParameter + 28: Label + 51: 7(ivec4) Load 23(p0) + 52: 7(ivec4) Load 24(p1) + 53: 7(ivec4) IAdd 51 52 + 55: 21(ptr) AccessChain 25(p2) 54 + 56: 6(int) Load 55 + 57: 7(ivec4) CompositeConstruct 56 56 56 56 + 58: 7(ivec4) IAdd 53 57 + 59: 6(int) Load 26(p3) + 60: 7(ivec4) CompositeConstruct 59 59 59 59 + 61: 7(ivec4) IAdd 58 60 + ReturnValue 61 + FunctionEnd + 32(fn2(vi4;i1;): 7(ivec4) Function None 29 + 30(p0): 8(ptr) FunctionParameter + 31(x): 21(ptr) FunctionParameter + 33: Label + ReturnValue 68 + FunctionEnd + 39(fn2(vi4;f1;): 7(ivec4) Function None 36 + 37(p0): 8(ptr) FunctionParameter + 38(x): 35(ptr) FunctionParameter + 40: Label + 71: 7(ivec4) Load 37(p0) + 77: 7(ivec4) IAdd 71 76 + ReturnValue 77 + FunctionEnd + 43(fn3(i1;): 2 Function None 41 + 42(p0): 21(ptr) FunctionParameter + 44: Label + Return + FunctionEnd + 46(@main(): 7(ivec4) Function None 45 + 47: Label + 80(myarray): 20(ptr) Variable Function + 85(param): 21(ptr) Variable Function + 88(param): 21(ptr) Variable Function + 101(param): 8(ptr) Variable Function + 102(param): 8(ptr) Variable Function + 103(param): 20(ptr) Variable Function + 104(param): 21(ptr) Variable Function + 111(param): 8(ptr) Variable Function + 112(param): 8(ptr) Variable Function + 116(param): 20(ptr) Variable Function + 117(param): 21(ptr) Variable Function + 122(param): 8(ptr) Variable Function + 123(param): 8(ptr) Variable Function + 126(param): 20(ptr) Variable Function + 128(param): 21(ptr) Variable Function + 134(param): 8(ptr) Variable Function + 135(param): 8(ptr) Variable Function + 138(param): 20(ptr) Variable Function + 140(param): 21(ptr) Variable Function + 146(param): 8(ptr) Variable Function + 147(param): 10(ptr) Variable Function + 148(param): 10(ptr) Variable Function + 154(param): 8(ptr) Variable Function + 155(param): 10(ptr) Variable Function + 156(param): 10(ptr) Variable Function + 162(param): 8(ptr) Variable Function + 163(param): 35(ptr) Variable Function + 168(param): 8(ptr) Variable Function + 169(param): 21(ptr) Variable Function + Store 80(myarray) 83 + Store 85(param) 84 + 86: 2 FunctionCall 43(fn3(i1;) 85(param) + Store 88(param) 87 + 89: 2 FunctionCall 43(fn3(i1;) 88(param) + Store 101(param) 91 + Store 102(param) 96 + Store 103(param) 99 + Store 104(param) 100 + 105: 7(ivec4) FunctionCall 27(fn1(vi4;vi4;i1[2];i1;) 101(param) 102(param) 103(param) 104(param) + Store 111(param) 107 + 114: 113(ptr) AccessChain 110 54 + 115: 7(ivec4) Load 114 + Store 112(param) 115 + Store 116(param) 99 + Store 117(param) 100 + 118: 7(ivec4) FunctionCall 27(fn1(vi4;vi4;i1[2];i1;) 111(param) 112(param) 116(param) 117(param) + 119: 7(ivec4) IAdd 105 118 + Store 122(param) 121 + 124: 113(ptr) AccessChain 110 54 + 125: 7(ivec4) Load 124 + Store 123(param) 125 + 127: 19 Load 80(myarray) + Store 126(param) 127 + Store 128(param) 100 + 129: 7(ivec4) FunctionCall 27(fn1(vi4;vi4;i1[2];i1;) 122(param) 123(param) 126(param) 128(param) + 130: 7(ivec4) IAdd 119 129 + Store 134(param) 132 + 136: 113(ptr) AccessChain 110 54 + 137: 7(ivec4) Load 136 + Store 135(param) 137 + 139: 19 Load 80(myarray) + Store 138(param) 139 + Store 140(param) 133 + 141: 7(ivec4) FunctionCall 27(fn1(vi4;vi4;i1[2];i1;) 134(param) 135(param) 138(param) 140(param) + 142: 7(ivec4) IAdd 130 141 + Store 146(param) 144 + Store 147(param) 145 + Store 148(param) 145 + 149: 7(ivec4) FunctionCall 15(fn1(vi4;b1;b1;) 146(param) 147(param) 148(param) + 150: 7(ivec4) IAdd 142 149 + Store 154(param) 152 + Store 155(param) 145 + Store 156(param) 153 + 157: 7(ivec4) FunctionCall 15(fn1(vi4;b1;b1;) 154(param) 155(param) 156(param) + 158: 7(ivec4) IAdd 150 157 + Store 162(param) 160 + Store 163(param) 161 + 164: 7(ivec4) FunctionCall 39(fn2(vi4;f1;) 162(param) 163(param) + 165: 7(ivec4) IAdd 158 164 + Store 168(param) 167 + Store 169(param) 66 + 170: 7(ivec4) FunctionCall 32(fn2(vi4;i1;) 168(param) 169(param) + 171: 7(ivec4) IAdd 165 170 + ReturnValue 171 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.params.default.negative.frag.out b/deps/glslang/Test/baseResults/hlsl.params.default.negative.frag.out new file mode 100644 index 00000000..f841bd8b --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.params.default.negative.frag.out @@ -0,0 +1,385 @@ +hlsl.params.default.negative.frag +ERROR: 0:27: '' : invalid default parameter value +ERROR: 0:32: 'p1' : invalid parameter after default value parameters +ERROR: 0:40: 'fn1' : ambiguous best function under implicit type conversion +ERROR: 0:47: 'fn2' : ambiguous best function under implicit type conversion +ERROR: 4 compilation errors. No code generated. + + +Shader version: 500 +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:7 Function Definition: fn1(vi4; ( temp 4-component vector of int) +0:7 Function Parameters: +0:7 'p0' ( in 4-component vector of int) +0:? Sequence +0:7 Branch: Return with expression +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:? 3 (const int) +0:? 4 (const int) +0:9 Function Definition: fn1(vi4;b1;b1; ( temp 4-component vector of int) +0:9 Function Parameters: +0:9 'p0' ( in 4-component vector of int) +0:9 'b1' ( in bool) +0:9 'b2' ( in bool) +0:? Sequence +0:10 Branch: Return with expression +0:10 'p0' ( in 4-component vector of int) +0:17 Function Definition: fn1(vi4;vi4;i1[2];i1; ( temp 4-component vector of int) +0:17 Function Parameters: +0:17 'p0' ( in 4-component vector of int) +0:17 'p1' ( in 4-component vector of int) +0:17 'p2' ( in 2-element array of int) +0:17 'p3' ( in int) +0:? Sequence +0:18 Branch: Return with expression +0:18 add ( temp 4-component vector of int) +0:18 add ( temp 4-component vector of int) +0:18 add ( temp 4-component vector of int) +0:18 'p0' ( in 4-component vector of int) +0:18 'p1' ( in 4-component vector of int) +0:18 direct index ( temp int) +0:18 'p2' ( in 2-element array of int) +0:18 Constant: +0:18 0 (const int) +0:18 'p3' ( in int) +0:23 Function Definition: fn2(vi4;i1; ( temp 4-component vector of int) +0:23 Function Parameters: +0:23 'p0' ( in 4-component vector of int) +0:23 'x' ( in int) +0:? Sequence +0:24 Branch: Return with expression +0:? Constant: +0:? 10 (const int) +0:? 11 (const int) +0:? 12 (const int) +0:? 13 (const int) +0:28 Function Definition: fn2(vi4; ( temp 4-component vector of int) +0:28 Function Parameters: +0:28 'p0' ( in 4-component vector of int) +0:? Sequence +0:29 Branch: Return with expression +0:29 add ( temp 4-component vector of int) +0:29 'p0' ( in 4-component vector of int) +0:? Constant: +0:? 20 (const int) +0:? 21 (const int) +0:? 22 (const int) +0:? 23 (const int) +0:33 Function Definition: fn3(i1; ( temp void) +0:33 Function Parameters: +0:33 'p0' ( in int) +0:37 Function Definition: @main( ( temp 4-component vector of int) +0:37 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp 2-element array of int) +0:38 'myarray' ( temp 2-element array of int) +0:38 Constant: +0:38 30 (const int) +0:38 31 (const int) +0:49 Branch: Return with expression +0:48 add ( temp 4-component vector of int) +0:47 add ( temp 4-component vector of int) +0:45 add ( temp 4-component vector of int) +0:44 add ( temp 4-component vector of int) +0:43 add ( temp 4-component vector of int) +0:42 add ( temp 4-component vector of int) +0:41 add ( temp 4-component vector of int) +0:40 add ( temp 4-component vector of int) +0:40 Function Call: fn1(vi4; ( temp 4-component vector of int) +0:40 Constant: +0:40 100 (const int) +0:40 100 (const int) +0:40 100 (const int) +0:40 100 (const int) +0:41 Function Call: fn1(vi4;vi4;i1[2];i1; ( temp 4-component vector of int) +0:41 Constant: +0:41 101 (const int) +0:41 101 (const int) +0:41 101 (const int) +0:41 101 (const int) +0:41 ui4: direct index for structure ( uniform 4-component vector of int) +0:41 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of int ui4, uniform float ufvar}) +0:41 Constant: +0:41 0 (const uint) +0:15 Constant: +0:15 1 (const int) +0:15 2 (const int) +0:16 Constant: +0:16 42 (const int) +0:42 Function Call: fn1(vi4;vi4;i1[2];i1; ( temp 4-component vector of int) +0:42 Constant: +0:42 102 (const int) +0:42 102 (const int) +0:42 102 (const int) +0:42 102 (const int) +0:42 ui4: direct index for structure ( uniform 4-component vector of int) +0:42 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of int ui4, uniform float ufvar}) +0:42 Constant: +0:42 0 (const uint) +0:42 'myarray' ( temp 2-element array of int) +0:16 Constant: +0:16 42 (const int) +0:43 Function Call: fn1(vi4;vi4;i1[2];i1; ( temp 4-component vector of int) +0:43 Constant: +0:43 103 (const int) +0:43 103 (const int) +0:43 103 (const int) +0:43 103 (const int) +0:43 ui4: direct index for structure ( uniform 4-component vector of int) +0:43 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of int ui4, uniform float ufvar}) +0:43 Constant: +0:43 0 (const uint) +0:43 'myarray' ( temp 2-element array of int) +0:43 Constant: +0:43 99 (const int) +0:44 Function Call: fn1(vi4;b1;b1; ( temp 4-component vector of int) +0:44 Constant: +0:44 104 (const int) +0:44 104 (const int) +0:44 104 (const int) +0:44 104 (const int) +0:44 Constant: +0:44 false (const bool) +0:9 Constant: +0:9 false (const bool) +0:45 Function Call: fn1(vi4;b1;b1; ( temp 4-component vector of int) +0:45 Constant: +0:45 105 (const int) +0:45 105 (const int) +0:45 105 (const int) +0:45 105 (const int) +0:45 Constant: +0:45 false (const bool) +0:45 Constant: +0:45 true (const bool) +0:47 Function Call: fn2(vi4; ( temp 4-component vector of int) +0:47 Constant: +0:47 112 (const int) +0:47 112 (const int) +0:47 112 (const int) +0:47 112 (const int) +0:48 Function Call: fn2(vi4;i1; ( temp 4-component vector of int) +0:48 Constant: +0:48 110 (const int) +0:48 110 (const int) +0:48 110 (const int) +0:48 110 (const int) +0:48 Constant: +0:48 11 (const int) +0:49 Function Call: fn2(vi4;i1; ( temp 4-component vector of int) +0:49 Constant: +0:49 111 (const int) +0:49 111 (const int) +0:49 111 (const int) +0:49 111 (const int) +0:49 Constant: +0:49 12 (const int) +0:37 Function Definition: main( ( temp void) +0:37 Function Parameters: +0:? Sequence +0:37 move second child to first child ( temp 4-component vector of int) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of int) +0:37 Function Call: @main( ( temp 4-component vector of int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of int ui4, uniform float ufvar}) +0:? 'cia' ( const int) +0:? -4 (const int) +0:? 'cib' ( const int) +0:? -42 (const int) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of int) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:7 Function Definition: fn1(vi4; ( temp 4-component vector of int) +0:7 Function Parameters: +0:7 'p0' ( in 4-component vector of int) +0:? Sequence +0:7 Branch: Return with expression +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:? 3 (const int) +0:? 4 (const int) +0:9 Function Definition: fn1(vi4;b1;b1; ( temp 4-component vector of int) +0:9 Function Parameters: +0:9 'p0' ( in 4-component vector of int) +0:9 'b1' ( in bool) +0:9 'b2' ( in bool) +0:? Sequence +0:10 Branch: Return with expression +0:10 'p0' ( in 4-component vector of int) +0:17 Function Definition: fn1(vi4;vi4;i1[2];i1; ( temp 4-component vector of int) +0:17 Function Parameters: +0:17 'p0' ( in 4-component vector of int) +0:17 'p1' ( in 4-component vector of int) +0:17 'p2' ( in 2-element array of int) +0:17 'p3' ( in int) +0:? Sequence +0:18 Branch: Return with expression +0:18 add ( temp 4-component vector of int) +0:18 add ( temp 4-component vector of int) +0:18 add ( temp 4-component vector of int) +0:18 'p0' ( in 4-component vector of int) +0:18 'p1' ( in 4-component vector of int) +0:18 direct index ( temp int) +0:18 'p2' ( in 2-element array of int) +0:18 Constant: +0:18 0 (const int) +0:18 'p3' ( in int) +0:23 Function Definition: fn2(vi4;i1; ( temp 4-component vector of int) +0:23 Function Parameters: +0:23 'p0' ( in 4-component vector of int) +0:23 'x' ( in int) +0:? Sequence +0:24 Branch: Return with expression +0:? Constant: +0:? 10 (const int) +0:? 11 (const int) +0:? 12 (const int) +0:? 13 (const int) +0:28 Function Definition: fn2(vi4; ( temp 4-component vector of int) +0:28 Function Parameters: +0:28 'p0' ( in 4-component vector of int) +0:? Sequence +0:29 Branch: Return with expression +0:29 add ( temp 4-component vector of int) +0:29 'p0' ( in 4-component vector of int) +0:? Constant: +0:? 20 (const int) +0:? 21 (const int) +0:? 22 (const int) +0:? 23 (const int) +0:33 Function Definition: fn3(i1; ( temp void) +0:33 Function Parameters: +0:33 'p0' ( in int) +0:37 Function Definition: @main( ( temp 4-component vector of int) +0:37 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp 2-element array of int) +0:38 'myarray' ( temp 2-element array of int) +0:38 Constant: +0:38 30 (const int) +0:38 31 (const int) +0:49 Branch: Return with expression +0:48 add ( temp 4-component vector of int) +0:47 add ( temp 4-component vector of int) +0:45 add ( temp 4-component vector of int) +0:44 add ( temp 4-component vector of int) +0:43 add ( temp 4-component vector of int) +0:42 add ( temp 4-component vector of int) +0:41 add ( temp 4-component vector of int) +0:40 add ( temp 4-component vector of int) +0:40 Function Call: fn1(vi4; ( temp 4-component vector of int) +0:40 Constant: +0:40 100 (const int) +0:40 100 (const int) +0:40 100 (const int) +0:40 100 (const int) +0:41 Function Call: fn1(vi4;vi4;i1[2];i1; ( temp 4-component vector of int) +0:41 Constant: +0:41 101 (const int) +0:41 101 (const int) +0:41 101 (const int) +0:41 101 (const int) +0:41 ui4: direct index for structure ( uniform 4-component vector of int) +0:41 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of int ui4, uniform float ufvar}) +0:41 Constant: +0:41 0 (const uint) +0:15 Constant: +0:15 1 (const int) +0:15 2 (const int) +0:16 Constant: +0:16 42 (const int) +0:42 Function Call: fn1(vi4;vi4;i1[2];i1; ( temp 4-component vector of int) +0:42 Constant: +0:42 102 (const int) +0:42 102 (const int) +0:42 102 (const int) +0:42 102 (const int) +0:42 ui4: direct index for structure ( uniform 4-component vector of int) +0:42 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of int ui4, uniform float ufvar}) +0:42 Constant: +0:42 0 (const uint) +0:42 'myarray' ( temp 2-element array of int) +0:16 Constant: +0:16 42 (const int) +0:43 Function Call: fn1(vi4;vi4;i1[2];i1; ( temp 4-component vector of int) +0:43 Constant: +0:43 103 (const int) +0:43 103 (const int) +0:43 103 (const int) +0:43 103 (const int) +0:43 ui4: direct index for structure ( uniform 4-component vector of int) +0:43 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of int ui4, uniform float ufvar}) +0:43 Constant: +0:43 0 (const uint) +0:43 'myarray' ( temp 2-element array of int) +0:43 Constant: +0:43 99 (const int) +0:44 Function Call: fn1(vi4;b1;b1; ( temp 4-component vector of int) +0:44 Constant: +0:44 104 (const int) +0:44 104 (const int) +0:44 104 (const int) +0:44 104 (const int) +0:44 Constant: +0:44 false (const bool) +0:9 Constant: +0:9 false (const bool) +0:45 Function Call: fn1(vi4;b1;b1; ( temp 4-component vector of int) +0:45 Constant: +0:45 105 (const int) +0:45 105 (const int) +0:45 105 (const int) +0:45 105 (const int) +0:45 Constant: +0:45 false (const bool) +0:45 Constant: +0:45 true (const bool) +0:47 Function Call: fn2(vi4; ( temp 4-component vector of int) +0:47 Constant: +0:47 112 (const int) +0:47 112 (const int) +0:47 112 (const int) +0:47 112 (const int) +0:48 Function Call: fn2(vi4;i1; ( temp 4-component vector of int) +0:48 Constant: +0:48 110 (const int) +0:48 110 (const int) +0:48 110 (const int) +0:48 110 (const int) +0:48 Constant: +0:48 11 (const int) +0:49 Function Call: fn2(vi4;i1; ( temp 4-component vector of int) +0:49 Constant: +0:49 111 (const int) +0:49 111 (const int) +0:49 111 (const int) +0:49 111 (const int) +0:49 Constant: +0:49 12 (const int) +0:37 Function Definition: main( ( temp void) +0:37 Function Parameters: +0:? Sequence +0:37 move second child to first child ( temp 4-component vector of int) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of int) +0:37 Function Call: @main( ( temp 4-component vector of int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of int ui4, uniform float ufvar}) +0:? 'cia' ( const int) +0:? -4 (const int) +0:? 'cib' ( const int) +0:? -42 (const int) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of int) + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/hlsl.partialFlattenLocal.vert.out b/deps/glslang/Test/baseResults/hlsl.partialFlattenLocal.vert.out new file mode 100644 index 00000000..95241189 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.partialFlattenLocal.vert.out @@ -0,0 +1,375 @@ +hlsl.partialFlattenLocal.vert +WARNING: AST will form illegal SPIR-V; need to transform to legalize +Shader version: 500 +0:? Sequence +0:12 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:12 Function Parameters: +0:12 'pos' ( in 4-component vector of float) +0:? Sequence +0:14 move second child to first child ( temp texture2D) +0:14 tex: direct index for structure ( temp texture2D) +0:14 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:14 Constant: +0:14 0 (const int) +0:14 'tex' ( uniform texture2D) +0:15 move second child to first child ( temp 3-component vector of float) +0:15 direct index ( temp 3-component vector of float) +0:15 pos: direct index for structure ( temp 3-element array of 3-component vector of float) +0:15 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:15 Constant: +0:15 1 (const int) +0:15 Constant: +0:15 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:16 move second child to first child ( temp 2-component vector of float) +0:16 direct index ( temp 2-component vector of float) +0:16 uv: direct index for structure ( temp 2-element array of 2-component vector of float) +0:16 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:16 Constant: +0:16 2 (const int) +0:16 Constant: +0:16 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 1.000000 +0:17 move second child to first child ( temp float) +0:17 x: direct index for structure ( temp float) +0:17 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:17 Constant: +0:17 3 (const int) +0:17 Constant: +0:17 1.000000 +0:18 move second child to first child ( temp int) +0:18 n: direct index for structure ( temp int) +0:18 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:18 Constant: +0:18 4 (const int) +0:18 Constant: +0:18 3 (const int) +0:20 Sequence +0:20 move second child to first child ( temp int) +0:20 'i' ( temp int) +0:20 Constant: +0:20 0 (const int) +0:20 Loop with condition tested first +0:20 Loop Condition +0:20 Compare Less Than ( temp bool) +0:20 'i' ( temp int) +0:20 Constant: +0:20 1 (const int) +0:20 Loop Body +0:? Sequence +0:21 add second child into first child ( temp 2-component vector of float) +0:21 vector swizzle ( temp 2-component vector of float) +0:21 indirect index ( temp 3-component vector of float) +0:21 pos: direct index for structure ( temp 3-element array of 3-component vector of float) +0:21 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:21 Constant: +0:21 1 (const int) +0:21 'i' ( temp int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 indirect index ( temp 2-component vector of float) +0:21 uv: direct index for structure ( temp 2-element array of 2-component vector of float) +0:21 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:21 Constant: +0:21 2 (const int) +0:21 'i' ( temp int) +0:20 Loop Terminal Expression +0:20 Pre-Increment ( temp int) +0:20 'i' ( temp int) +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:24 'packed2' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:24 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:26 Branch: Return with expression +0:26 add ( temp 4-component vector of float) +0:26 'pos' ( in 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:26 direct index ( temp 3-component vector of float) +0:26 pos: direct index for structure ( temp 3-element array of 3-component vector of float) +0:26 'packed2' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:26 Constant: +0:26 1 (const int) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 0.000000 +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'pos' (layout( location=0) in 4-component vector of float) +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:12 Function Call: @main(vf4; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'tex' ( uniform texture2D) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:? 'pos' (layout( location=0) in 4-component vector of float) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:12 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:12 Function Parameters: +0:12 'pos' ( in 4-component vector of float) +0:? Sequence +0:14 move second child to first child ( temp texture2D) +0:14 tex: direct index for structure ( temp texture2D) +0:14 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:14 Constant: +0:14 0 (const int) +0:14 'tex' ( uniform texture2D) +0:15 move second child to first child ( temp 3-component vector of float) +0:15 direct index ( temp 3-component vector of float) +0:15 pos: direct index for structure ( temp 3-element array of 3-component vector of float) +0:15 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:15 Constant: +0:15 1 (const int) +0:15 Constant: +0:15 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:16 move second child to first child ( temp 2-component vector of float) +0:16 direct index ( temp 2-component vector of float) +0:16 uv: direct index for structure ( temp 2-element array of 2-component vector of float) +0:16 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:16 Constant: +0:16 2 (const int) +0:16 Constant: +0:16 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 1.000000 +0:17 move second child to first child ( temp float) +0:17 x: direct index for structure ( temp float) +0:17 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:17 Constant: +0:17 3 (const int) +0:17 Constant: +0:17 1.000000 +0:18 move second child to first child ( temp int) +0:18 n: direct index for structure ( temp int) +0:18 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:18 Constant: +0:18 4 (const int) +0:18 Constant: +0:18 3 (const int) +0:20 Sequence +0:20 move second child to first child ( temp int) +0:20 'i' ( temp int) +0:20 Constant: +0:20 0 (const int) +0:20 Loop with condition tested first +0:20 Loop Condition +0:20 Compare Less Than ( temp bool) +0:20 'i' ( temp int) +0:20 Constant: +0:20 1 (const int) +0:20 Loop Body +0:? Sequence +0:21 add second child into first child ( temp 2-component vector of float) +0:21 vector swizzle ( temp 2-component vector of float) +0:21 indirect index ( temp 3-component vector of float) +0:21 pos: direct index for structure ( temp 3-element array of 3-component vector of float) +0:21 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:21 Constant: +0:21 1 (const int) +0:21 'i' ( temp int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 indirect index ( temp 2-component vector of float) +0:21 uv: direct index for structure ( temp 2-element array of 2-component vector of float) +0:21 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:21 Constant: +0:21 2 (const int) +0:21 'i' ( temp int) +0:20 Loop Terminal Expression +0:20 Pre-Increment ( temp int) +0:20 'i' ( temp int) +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:24 'packed2' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:24 'packed' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:26 Branch: Return with expression +0:26 add ( temp 4-component vector of float) +0:26 'pos' ( in 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:26 direct index ( temp 3-component vector of float) +0:26 pos: direct index for structure ( temp 3-element array of 3-component vector of float) +0:26 'packed2' ( temp structure{ temp texture2D tex, temp 3-element array of 3-component vector of float pos, temp 2-element array of 2-component vector of float uv, temp float x, temp int n}) +0:26 Constant: +0:26 1 (const int) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 0.000000 +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'pos' (layout( location=0) in 4-component vector of float) +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:12 Function Call: @main(vf4; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'tex' ( uniform texture2D) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:? 'pos' (layout( location=0) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 90 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 83 86 + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vf4;" + Name 10 "pos" + Name 22 "Packed" + MemberName 22(Packed) 0 "tex" + MemberName 22(Packed) 1 "pos" + MemberName 22(Packed) 2 "uv" + MemberName 22(Packed) 3 "x" + MemberName 22(Packed) 4 "n" + Name 24 "packed" + Name 27 "tex" + Name 47 "i" + Name 69 "packed2" + Name 81 "pos" + Name 83 "pos" + Name 86 "@entryPointOutput" + Name 87 "param" + Decorate 27(tex) DescriptorSet 0 + Decorate 83(pos) Location 0 + Decorate 86(@entryPointOutput) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) + 13: TypeImage 6(float) 2D sampled format:Unknown + 14: TypeVector 6(float) 3 + 15: TypeInt 32 0 + 16: 15(int) Constant 3 + 17: TypeArray 14(fvec3) 16 + 18: TypeVector 6(float) 2 + 19: 15(int) Constant 2 + 20: TypeArray 18(fvec2) 19 + 21: TypeInt 32 1 + 22(Packed): TypeStruct 13 17 20 6(float) 21(int) + 23: TypePointer Function 22(Packed) + 25: 21(int) Constant 0 + 26: TypePointer UniformConstant 13 + 27(tex): 26(ptr) Variable UniformConstant + 29: TypePointer Function 13 + 31: 21(int) Constant 1 + 32: 6(float) Constant 0 + 33: 14(fvec3) ConstantComposite 32 32 32 + 34: TypePointer Function 14(fvec3) + 36: 21(int) Constant 2 + 37: 6(float) Constant 1065353216 + 38: 18(fvec2) ConstantComposite 32 37 + 39: TypePointer Function 18(fvec2) + 41: 21(int) Constant 3 + 42: TypePointer Function 6(float) + 44: 21(int) Constant 4 + 45: TypePointer Function 21(int) + 54: TypeBool + 82: TypePointer Input 7(fvec4) + 83(pos): 82(ptr) Variable Input + 85: TypePointer Output 7(fvec4) +86(@entryPointOutput): 85(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 81(pos): 8(ptr) Variable Function + 87(param): 8(ptr) Variable Function + 84: 7(fvec4) Load 83(pos) + Store 81(pos) 84 + 88: 7(fvec4) Load 81(pos) + Store 87(param) 88 + 89: 7(fvec4) FunctionCall 11(@main(vf4;) 87(param) + Store 86(@entryPointOutput) 89 + Return + FunctionEnd + 11(@main(vf4;): 7(fvec4) Function None 9 + 10(pos): 8(ptr) FunctionParameter + 12: Label + 24(packed): 23(ptr) Variable Function + 47(i): 45(ptr) Variable Function + 69(packed2): 23(ptr) Variable Function + 28: 13 Load 27(tex) + 30: 29(ptr) AccessChain 24(packed) 25 + Store 30 28 + 35: 34(ptr) AccessChain 24(packed) 31 25 + Store 35 33 + 40: 39(ptr) AccessChain 24(packed) 36 25 + Store 40 38 + 43: 42(ptr) AccessChain 24(packed) 41 + Store 43 37 + 46: 45(ptr) AccessChain 24(packed) 44 + Store 46 41 + Store 47(i) 25 + Branch 48 + 48: Label + LoopMerge 50 51 None + Branch 52 + 52: Label + 53: 21(int) Load 47(i) + 55: 54(bool) SLessThan 53 31 + BranchConditional 55 49 50 + 49: Label + 56: 21(int) Load 47(i) + 57: 21(int) Load 47(i) + 58: 39(ptr) AccessChain 24(packed) 36 57 + 59: 18(fvec2) Load 58 + 60: 34(ptr) AccessChain 24(packed) 31 56 + 61: 14(fvec3) Load 60 + 62: 18(fvec2) VectorShuffle 61 61 0 1 + 63: 18(fvec2) FAdd 62 59 + 64: 34(ptr) AccessChain 24(packed) 31 56 + 65: 14(fvec3) Load 64 + 66: 14(fvec3) VectorShuffle 65 63 3 4 2 + Store 64 66 + Branch 51 + 51: Label + 67: 21(int) Load 47(i) + 68: 21(int) IAdd 67 31 + Store 47(i) 68 + Branch 48 + 50: Label + 70: 22(Packed) Load 24(packed) + Store 69(packed2) 70 + 71: 7(fvec4) Load 10(pos) + 72: 34(ptr) AccessChain 69(packed2) 31 25 + 73: 14(fvec3) Load 72 + 74: 6(float) CompositeExtract 73 0 + 75: 6(float) CompositeExtract 73 1 + 76: 6(float) CompositeExtract 73 2 + 77: 7(fvec4) CompositeConstruct 74 75 76 32 + 78: 7(fvec4) FAdd 71 77 + ReturnValue 78 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.partialFlattenMixed.vert.out b/deps/glslang/Test/baseResults/hlsl.partialFlattenMixed.vert.out new file mode 100644 index 00000000..51e4c934 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.partialFlattenMixed.vert.out @@ -0,0 +1,167 @@ +hlsl.partialFlattenMixed.vert +WARNING: AST will form illegal SPIR-V; need to transform to legalize +Shader version: 500 +0:? Sequence +0:10 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:10 Function Parameters: +0:10 'pos' ( in 4-component vector of float) +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp texture2D) +0:13 direct index ( temp texture2D) +0:13 membTex: direct index for structure ( temp 2-element array of texture2D) +0:13 'packed' ( temp structure{ temp int a, temp 2-element array of texture2D membTex, temp int b}) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:? 'tex[0]' ( uniform texture2D) +0:13 move second child to first child ( temp texture2D) +0:13 direct index ( temp texture2D) +0:13 membTex: direct index for structure ( temp 2-element array of texture2D) +0:13 'packed' ( temp structure{ temp int a, temp 2-element array of texture2D membTex, temp int b}) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 1 (const int) +0:? 'tex[1]' ( uniform texture2D) +0:15 Branch: Return with expression +0:15 'pos' ( in 4-component vector of float) +0:10 Function Definition: main( ( temp void) +0:10 Function Parameters: +0:? Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'pos' (layout( location=0) in 4-component vector of float) +0:10 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:10 Function Call: @main(vf4; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'tex[0]' ( uniform texture2D) +0:? 'tex[1]' ( uniform texture2D) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:? 'pos' (layout( location=0) in 4-component vector of float) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:10 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:10 Function Parameters: +0:10 'pos' ( in 4-component vector of float) +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp texture2D) +0:13 direct index ( temp texture2D) +0:13 membTex: direct index for structure ( temp 2-element array of texture2D) +0:13 'packed' ( temp structure{ temp int a, temp 2-element array of texture2D membTex, temp int b}) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:? 'tex[0]' ( uniform texture2D) +0:13 move second child to first child ( temp texture2D) +0:13 direct index ( temp texture2D) +0:13 membTex: direct index for structure ( temp 2-element array of texture2D) +0:13 'packed' ( temp structure{ temp int a, temp 2-element array of texture2D membTex, temp int b}) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 1 (const int) +0:? 'tex[1]' ( uniform texture2D) +0:15 Branch: Return with expression +0:15 'pos' ( in 4-component vector of float) +0:10 Function Definition: main( ( temp void) +0:10 Function Parameters: +0:? Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'pos' (layout( location=0) in 4-component vector of float) +0:10 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:10 Function Call: @main(vf4; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'tex[0]' ( uniform texture2D) +0:? 'tex[1]' ( uniform texture2D) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:? 'pos' (layout( location=0) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 43 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 36 39 + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vf4;" + Name 10 "pos" + Name 18 "Packed" + MemberName 18(Packed) 0 "a" + MemberName 18(Packed) 1 "membTex" + MemberName 18(Packed) 2 "b" + Name 20 "packed" + Name 24 "tex[0]" + Name 28 "tex[1]" + Name 34 "pos" + Name 36 "pos" + Name 39 "@entryPointOutput" + Name 40 "param" + Decorate 24(tex[0]) DescriptorSet 0 + Decorate 28(tex[1]) DescriptorSet 0 + Decorate 36(pos) Location 0 + Decorate 39(@entryPointOutput) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) + 13: TypeInt 32 1 + 14: TypeImage 6(float) 2D sampled format:Unknown + 15: TypeInt 32 0 + 16: 15(int) Constant 2 + 17: TypeArray 14 16 + 18(Packed): TypeStruct 13(int) 17 13(int) + 19: TypePointer Function 18(Packed) + 21: 13(int) Constant 1 + 22: 13(int) Constant 0 + 23: TypePointer UniformConstant 14 + 24(tex[0]): 23(ptr) Variable UniformConstant + 26: TypePointer Function 14 + 28(tex[1]): 23(ptr) Variable UniformConstant + 35: TypePointer Input 7(fvec4) + 36(pos): 35(ptr) Variable Input + 38: TypePointer Output 7(fvec4) +39(@entryPointOutput): 38(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 34(pos): 8(ptr) Variable Function + 40(param): 8(ptr) Variable Function + 37: 7(fvec4) Load 36(pos) + Store 34(pos) 37 + 41: 7(fvec4) Load 34(pos) + Store 40(param) 41 + 42: 7(fvec4) FunctionCall 11(@main(vf4;) 40(param) + Store 39(@entryPointOutput) 42 + Return + FunctionEnd + 11(@main(vf4;): 7(fvec4) Function None 9 + 10(pos): 8(ptr) FunctionParameter + 12: Label + 20(packed): 19(ptr) Variable Function + 25: 14 Load 24(tex[0]) + 27: 26(ptr) AccessChain 20(packed) 21 22 + Store 27 25 + 29: 14 Load 28(tex[1]) + 30: 26(ptr) AccessChain 20(packed) 21 21 + Store 30 29 + 31: 7(fvec4) Load 10(pos) + ReturnValue 31 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.partialInit.frag.out b/deps/glslang/Test/baseResults/hlsl.partialInit.frag.out new file mode 100644 index 00000000..2cdbb0ff --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.partialInit.frag.out @@ -0,0 +1,571 @@ +hlsl.partialInit.frag +WARNING: 0:35: 'cgf2a' : variable with qualifier 'const' not initialized; zero initializing +WARNING: 0:36: 'ci' : variable with qualifier 'const' not initialized; zero initializing + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'gv' ( global 4-component vector of float) +0:8 Constant: +0:8 0.000000 +0:8 0.000000 +0:8 1.000000 +0:8 0.000000 +0:9 Sequence +0:9 move second child to first child ( temp 3-element array of float) +0:9 'gfa' ( global 3-element array of float) +0:9 Constant: +0:9 0.000000 +0:9 0.000000 +0:9 0.000000 +0:18 Function Definition: @PixelShaderFunction(vf4; ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:18 Function Parameters: +0:18 'input' ( in 4-component vector of float) +0:? Sequence +0:19 Sequence +0:19 move second child to first child ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:19 'o2' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:19 Constant: +0:19 3 (const int) +0:19 0.000000 +0:19 false (const bool) +0:19 0.000000 +0:19 0.000000 +0:19 0.000000 +0:19 0.000000 +0:21 move second child to first child ( temp 4-component vector of float) +0:21 v: direct index for structure ( temp 4-component vector of float) +0:21 'o4' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:21 Constant: +0:21 3 (const int) +0:21 vector-scale ( temp 4-component vector of float) +0:21 'gv' ( global 4-component vector of float) +0:21 direct index ( temp float) +0:21 'gfa' ( global 3-element array of float) +0:21 Constant: +0:21 2 (const int) +0:22 Sequence +0:22 move second child to first child ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:22 'o1' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:22 Constant: +0:22 0 (const int) +0:22 0.000000 +0:22 false (const bool) +0:22 0.000000 +0:22 0.000000 +0:22 0.000000 +0:22 0.000000 +0:23 Sequence +0:23 move second child to first child ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:23 'o3' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:23 Constant: +0:23 0 (const int) +0:23 0.000000 +0:23 false (const bool) +0:23 0.000000 +0:23 0.000000 +0:23 0.000000 +0:23 0.000000 +0:24 move second child to first child ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:24 'o4' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:24 Constant: +0:24 0 (const int) +0:24 0.000000 +0:24 false (const bool) +0:24 0.000000 +0:24 0.000000 +0:24 0.000000 +0:24 0.000000 +0:25 move second child to first child ( temp bool) +0:25 c: direct index for structure ( temp bool) +0:25 'o4' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:25 Constant: +0:25 2 (const int) +0:25 c: direct index for structure ( temp bool) +0:25 'o1' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:25 Constant: +0:25 2 (const int) +0:26 Sequence +0:26 move second child to first child ( temp structure{ temp 4X3 matrix of float m, temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v} os, temp bool b}) +0:26 'nest' ( temp structure{ temp 4X3 matrix of float m, temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v} os, temp bool b}) +0:26 Constant: +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0 (const int) +0:26 0.000000 +0:26 false (const bool) +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 false (const bool) +0:28 Sequence +0:28 move second child to first child ( temp 4-element array of 2-component vector of float) +0:28 'gf2a' ( temp 4-element array of 2-component vector of float) +0:28 Constant: +0:28 0.000000 +0:28 0.000000 +0:28 0.000000 +0:28 0.000000 +0:28 0.000000 +0:28 0.000000 +0:28 0.000000 +0:28 0.000000 +0:29 Sequence +0:29 move second child to first child ( temp int) +0:29 'cgi' ( temp int) +0:29 Constant: +0:29 0 (const int) +0:30 move second child to first child ( temp float) +0:30 b: direct index for structure ( temp float) +0:30 'o4' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:30 Constant: +0:30 1 (const int) +0:30 component-wise multiply ( temp float) +0:30 direct index ( temp float) +0:30 direct index ( temp 2-component vector of float) +0:30 'gf2a' ( temp 4-element array of 2-component vector of float) +0:30 Constant: +0:30 2 (const int) +0:30 Constant: +0:30 1 (const int) +0:30 Convert int to float ( temp float) +0:30 'cgi' ( temp int) +0:32 Branch: Return with expression +0:32 'o4' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:18 Function Definition: PixelShaderFunction( ( temp void) +0:18 Function Parameters: +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:18 Sequence +0:18 move second child to first child ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:18 'flattenTemp' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:18 Function Call: @PixelShaderFunction(vf4; ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:? 'input' ( temp 4-component vector of float) +0:18 move second child to first child ( temp int) +0:? '@entryPointOutput.a' (layout( location=0) out int) +0:18 a: direct index for structure ( temp int) +0:18 'flattenTemp' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:18 Constant: +0:18 0 (const int) +0:18 move second child to first child ( temp float) +0:? '@entryPointOutput.b' (layout( location=1) out float) +0:18 b: direct index for structure ( temp float) +0:18 'flattenTemp' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:18 Constant: +0:18 1 (const int) +0:18 move second child to first child ( temp bool) +0:? '@entryPointOutput.c' (layout( location=2) out bool) +0:18 c: direct index for structure ( temp bool) +0:18 'flattenTemp' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:18 Constant: +0:18 2 (const int) +0:18 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.v' (layout( location=3) out 4-component vector of float) +0:18 v: direct index for structure ( temp 4-component vector of float) +0:18 'flattenTemp' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:18 Constant: +0:18 3 (const int) +0:? Linker Objects +0:? 'gv' ( global 4-component vector of float) +0:? 'gfa' ( global 3-element array of float) +0:? '@entryPointOutput.a' (layout( location=0) out int) +0:? '@entryPointOutput.b' (layout( location=1) out float) +0:? '@entryPointOutput.c' (layout( location=2) out bool) +0:? '@entryPointOutput.v' (layout( location=3) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:? 'cgf2a' ( const 3-element array of 2-component vector of float) +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 'ci' ( const int) +0:? 0 (const int) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'gv' ( global 4-component vector of float) +0:8 Constant: +0:8 0.000000 +0:8 0.000000 +0:8 1.000000 +0:8 0.000000 +0:9 Sequence +0:9 move second child to first child ( temp 3-element array of float) +0:9 'gfa' ( global 3-element array of float) +0:9 Constant: +0:9 0.000000 +0:9 0.000000 +0:9 0.000000 +0:18 Function Definition: @PixelShaderFunction(vf4; ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:18 Function Parameters: +0:18 'input' ( in 4-component vector of float) +0:? Sequence +0:19 Sequence +0:19 move second child to first child ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:19 'o2' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:19 Constant: +0:19 3 (const int) +0:19 0.000000 +0:19 false (const bool) +0:19 0.000000 +0:19 0.000000 +0:19 0.000000 +0:19 0.000000 +0:21 move second child to first child ( temp 4-component vector of float) +0:21 v: direct index for structure ( temp 4-component vector of float) +0:21 'o4' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:21 Constant: +0:21 3 (const int) +0:21 vector-scale ( temp 4-component vector of float) +0:21 'gv' ( global 4-component vector of float) +0:21 direct index ( temp float) +0:21 'gfa' ( global 3-element array of float) +0:21 Constant: +0:21 2 (const int) +0:22 Sequence +0:22 move second child to first child ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:22 'o1' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:22 Constant: +0:22 0 (const int) +0:22 0.000000 +0:22 false (const bool) +0:22 0.000000 +0:22 0.000000 +0:22 0.000000 +0:22 0.000000 +0:23 Sequence +0:23 move second child to first child ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:23 'o3' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:23 Constant: +0:23 0 (const int) +0:23 0.000000 +0:23 false (const bool) +0:23 0.000000 +0:23 0.000000 +0:23 0.000000 +0:23 0.000000 +0:24 move second child to first child ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:24 'o4' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:24 Constant: +0:24 0 (const int) +0:24 0.000000 +0:24 false (const bool) +0:24 0.000000 +0:24 0.000000 +0:24 0.000000 +0:24 0.000000 +0:25 move second child to first child ( temp bool) +0:25 c: direct index for structure ( temp bool) +0:25 'o4' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:25 Constant: +0:25 2 (const int) +0:25 c: direct index for structure ( temp bool) +0:25 'o1' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:25 Constant: +0:25 2 (const int) +0:26 Sequence +0:26 move second child to first child ( temp structure{ temp 4X3 matrix of float m, temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v} os, temp bool b}) +0:26 'nest' ( temp structure{ temp 4X3 matrix of float m, temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v} os, temp bool b}) +0:26 Constant: +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0 (const int) +0:26 0.000000 +0:26 false (const bool) +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 false (const bool) +0:28 Sequence +0:28 move second child to first child ( temp 4-element array of 2-component vector of float) +0:28 'gf2a' ( temp 4-element array of 2-component vector of float) +0:28 Constant: +0:28 0.000000 +0:28 0.000000 +0:28 0.000000 +0:28 0.000000 +0:28 0.000000 +0:28 0.000000 +0:28 0.000000 +0:28 0.000000 +0:29 Sequence +0:29 move second child to first child ( temp int) +0:29 'cgi' ( temp int) +0:29 Constant: +0:29 0 (const int) +0:30 move second child to first child ( temp float) +0:30 b: direct index for structure ( temp float) +0:30 'o4' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:30 Constant: +0:30 1 (const int) +0:30 component-wise multiply ( temp float) +0:30 direct index ( temp float) +0:30 direct index ( temp 2-component vector of float) +0:30 'gf2a' ( temp 4-element array of 2-component vector of float) +0:30 Constant: +0:30 2 (const int) +0:30 Constant: +0:30 1 (const int) +0:30 Convert int to float ( temp float) +0:30 'cgi' ( temp int) +0:32 Branch: Return with expression +0:32 'o4' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:18 Function Definition: PixelShaderFunction( ( temp void) +0:18 Function Parameters: +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:18 Sequence +0:18 move second child to first child ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:18 'flattenTemp' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:18 Function Call: @PixelShaderFunction(vf4; ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:? 'input' ( temp 4-component vector of float) +0:18 move second child to first child ( temp int) +0:? '@entryPointOutput.a' (layout( location=0) out int) +0:18 a: direct index for structure ( temp int) +0:18 'flattenTemp' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:18 Constant: +0:18 0 (const int) +0:18 move second child to first child ( temp float) +0:? '@entryPointOutput.b' (layout( location=1) out float) +0:18 b: direct index for structure ( temp float) +0:18 'flattenTemp' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:18 Constant: +0:18 1 (const int) +0:18 move second child to first child ( temp bool) +0:? '@entryPointOutput.c' (layout( location=2) out bool) +0:18 c: direct index for structure ( temp bool) +0:18 'flattenTemp' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:18 Constant: +0:18 2 (const int) +0:18 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.v' (layout( location=3) out 4-component vector of float) +0:18 v: direct index for structure ( temp 4-component vector of float) +0:18 'flattenTemp' ( temp structure{ temp int a, temp float b, temp bool c, temp 4-component vector of float v}) +0:18 Constant: +0:18 3 (const int) +0:? Linker Objects +0:? 'gv' ( global 4-component vector of float) +0:? 'gfa' ( global 3-element array of float) +0:? '@entryPointOutput.a' (layout( location=0) out int) +0:? '@entryPointOutput.b' (layout( location=1) out float) +0:? '@entryPointOutput.c' (layout( location=2) out bool) +0:? '@entryPointOutput.v' (layout( location=3) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:? 'cgf2a' ( const 3-element array of 2-component vector of float) +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 'ci' ( const int) +0:? 0 (const int) + +error: SPIRV-Tools Validation Errors +error: If OpTypeBool is stored in conjunction with OpVariable, it can only be used with non-externally visible shader Storage Classes: Workgroup, CrossWorkgroup, Private, and Function + %_entryPointOutput_c = OpVariable %_ptr_Output_bool Output + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 104 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 80 87 91 95 99 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 11 "outs" + MemberName 11(outs) 0 "a" + MemberName 11(outs) 1 "b" + MemberName 11(outs) 2 "c" + MemberName 11(outs) 3 "v" + Name 14 "@PixelShaderFunction(vf4;" + Name 13 "input" + Name 17 "gv" + Name 25 "gfa" + Name 28 "o2" + Name 33 "o4" + Name 41 "o1" + Name 44 "o3" + Name 51 "Nest" + MemberName 51(Nest) 0 "m" + MemberName 51(Nest) 1 "os" + MemberName 51(Nest) 2 "b" + Name 53 "nest" + Name 61 "gf2a" + Name 65 "cgi" + Name 78 "input" + Name 80 "input" + Name 82 "flattenTemp" + Name 83 "param" + Name 87 "@entryPointOutput.a" + Name 91 "@entryPointOutput.b" + Name 95 "@entryPointOutput.c" + Name 99 "@entryPointOutput.v" + Decorate 80(input) Location 0 + Decorate 87(@entryPointOutput.a) Location 0 + Decorate 91(@entryPointOutput.b) Location 1 + Decorate 95(@entryPointOutput.c) Location 2 + Decorate 99(@entryPointOutput.v) Location 3 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeInt 32 1 + 10: TypeBool + 11(outs): TypeStruct 9(int) 6(float) 10(bool) 7(fvec4) + 12: TypeFunction 11(outs) 8(ptr) + 16: TypePointer Private 7(fvec4) + 17(gv): 16(ptr) Variable Private + 18: 6(float) Constant 0 + 19: 6(float) Constant 1065353216 + 20: 7(fvec4) ConstantComposite 18 18 19 18 + 21: TypeInt 32 0 + 22: 21(int) Constant 3 + 23: TypeArray 6(float) 22 + 24: TypePointer Private 23 + 25(gfa): 24(ptr) Variable Private + 26: 23 ConstantComposite 18 18 18 + 27: TypePointer Function 11(outs) + 29: 9(int) Constant 3 + 30: 10(bool) ConstantFalse + 31: 7(fvec4) ConstantComposite 18 18 18 18 + 32: 11(outs) ConstantComposite 29 18 30 31 + 35: 9(int) Constant 2 + 36: TypePointer Private 6(float) + 42: 9(int) Constant 0 + 43: 11(outs) ConstantComposite 42 18 30 31 + 45: TypePointer Function 10(bool) + 49: TypeVector 6(float) 3 + 50: TypeMatrix 49(fvec3) 4 + 51(Nest): TypeStruct 50 11(outs) 10(bool) + 52: TypePointer Function 51(Nest) + 54: 49(fvec3) ConstantComposite 18 18 18 + 55: 50 ConstantComposite 54 54 54 54 + 56: 51(Nest) ConstantComposite 55 43 30 + 57: TypeVector 6(float) 2 + 58: 21(int) Constant 4 + 59: TypeArray 57(fvec2) 58 + 60: TypePointer Function 59 + 62: 57(fvec2) ConstantComposite 18 18 + 63: 59 ConstantComposite 62 62 62 62 + 64: TypePointer Function 9(int) + 66: 9(int) Constant 1 + 67: 21(int) Constant 1 + 68: TypePointer Function 6(float) + 79: TypePointer Input 7(fvec4) + 80(input): 79(ptr) Variable Input + 86: TypePointer Output 9(int) +87(@entryPointOutput.a): 86(ptr) Variable Output + 90: TypePointer Output 6(float) +91(@entryPointOutput.b): 90(ptr) Variable Output + 94: TypePointer Output 10(bool) +95(@entryPointOutput.c): 94(ptr) Variable Output + 98: TypePointer Output 7(fvec4) +99(@entryPointOutput.v): 98(ptr) Variable Output + 102: TypeArray 57(fvec2) 22 + 103: 102 ConstantComposite 62 62 62 +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 78(input): 8(ptr) Variable Function + 82(flattenTemp): 27(ptr) Variable Function + 83(param): 8(ptr) Variable Function + Store 17(gv) 20 + Store 25(gfa) 26 + 81: 7(fvec4) Load 80(input) + Store 78(input) 81 + 84: 7(fvec4) Load 78(input) + Store 83(param) 84 + 85: 11(outs) FunctionCall 14(@PixelShaderFunction(vf4;) 83(param) + Store 82(flattenTemp) 85 + 88: 64(ptr) AccessChain 82(flattenTemp) 42 + 89: 9(int) Load 88 + Store 87(@entryPointOutput.a) 89 + 92: 68(ptr) AccessChain 82(flattenTemp) 66 + 93: 6(float) Load 92 + Store 91(@entryPointOutput.b) 93 + 96: 45(ptr) AccessChain 82(flattenTemp) 35 + 97: 10(bool) Load 96 + Store 95(@entryPointOutput.c) 97 + 100: 8(ptr) AccessChain 82(flattenTemp) 29 + 101: 7(fvec4) Load 100 + Store 99(@entryPointOutput.v) 101 + Return + FunctionEnd +14(@PixelShaderFunction(vf4;): 11(outs) Function None 12 + 13(input): 8(ptr) FunctionParameter + 15: Label + 28(o2): 27(ptr) Variable Function + 33(o4): 27(ptr) Variable Function + 41(o1): 27(ptr) Variable Function + 44(o3): 27(ptr) Variable Function + 53(nest): 52(ptr) Variable Function + 61(gf2a): 60(ptr) Variable Function + 65(cgi): 64(ptr) Variable Function + Store 28(o2) 32 + 34: 7(fvec4) Load 17(gv) + 37: 36(ptr) AccessChain 25(gfa) 35 + 38: 6(float) Load 37 + 39: 7(fvec4) VectorTimesScalar 34 38 + 40: 8(ptr) AccessChain 33(o4) 29 + Store 40 39 + Store 41(o1) 43 + Store 44(o3) 43 + Store 33(o4) 43 + 46: 45(ptr) AccessChain 41(o1) 35 + 47: 10(bool) Load 46 + 48: 45(ptr) AccessChain 33(o4) 35 + Store 48 47 + Store 53(nest) 56 + Store 61(gf2a) 63 + Store 65(cgi) 42 + 69: 68(ptr) AccessChain 61(gf2a) 35 67 + 70: 6(float) Load 69 + 71: 9(int) Load 65(cgi) + 72: 6(float) ConvertSToF 71 + 73: 6(float) FMul 70 72 + 74: 68(ptr) AccessChain 33(o4) 66 + Store 74 73 + 75: 11(outs) Load 33(o4) + ReturnValue 75 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.pp.expand.frag.err b/deps/glslang/Test/baseResults/hlsl.pp.expand.frag.err new file mode 100644 index 00000000..e69de29b diff --git a/deps/glslang/Test/baseResults/hlsl.pp.expand.frag.out b/deps/glslang/Test/baseResults/hlsl.pp.expand.frag.out new file mode 100644 index 00000000..adfe02c1 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.pp.expand.frag.out @@ -0,0 +1,19 @@ + + + + + + +struct A +{ + float4 a; + float4 b; + float4 c = { 1, 2, 3, 4 }; + float4 d = {({ {(({ 1, 2, 3, 4 }))} })}, { { 1, 2, 3, 4 } }; +}; + +void main() +{ + "a string" +} + diff --git a/deps/glslang/Test/baseResults/hlsl.pp.line.frag.out b/deps/glslang/Test/baseResults/hlsl.pp.line.frag.out new file mode 100644 index 00000000..2c06fe91 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.pp.line.frag.out @@ -0,0 +1,192 @@ +hlsl.pp.line.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:4 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:4 Function Parameters: +0:? Sequence +0:124 Sequence +0:124 move second child to first child ( temp int) +0:124 'thisLineIs' ( temp int) +0:124 Constant: +0:124 124 (const int) +0:126 move second child to first child ( temp 4-component vector of float) +0:126 Color: direct index for structure ( temp 4-component vector of float) +0:126 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:126 Constant: +0:126 0 (const int) +0:? Construct vec4 ( temp 4-component vector of float) +0:126 Convert int to float ( temp float) +0:126 'thisLineIs' ( temp int) +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 1.000000 +0:127 move second child to first child ( temp float) +0:127 Depth: direct index for structure ( temp float) +0:127 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:127 Constant: +0:127 1 (const int) +0:127 Constant: +0:127 1.000000 +0:129 Branch: Return with expression +0:129 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 Sequence +0:4 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:4 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:4 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:4 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:4 Color: direct index for structure ( temp 4-component vector of float) +0:4 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:4 Depth: direct index for structure ( temp float) +0:4 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:4 Constant: +0:4 1 (const int) +0:? Linker Objects +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:4 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:4 Function Parameters: +0:? Sequence +0:124 Sequence +0:124 move second child to first child ( temp int) +0:124 'thisLineIs' ( temp int) +0:124 Constant: +0:124 124 (const int) +0:126 move second child to first child ( temp 4-component vector of float) +0:126 Color: direct index for structure ( temp 4-component vector of float) +0:126 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:126 Constant: +0:126 0 (const int) +0:? Construct vec4 ( temp 4-component vector of float) +0:126 Convert int to float ( temp float) +0:126 'thisLineIs' ( temp int) +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 1.000000 +0:127 move second child to first child ( temp float) +0:127 Depth: direct index for structure ( temp float) +0:127 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:127 Constant: +0:127 1 (const int) +0:127 Constant: +0:127 1.000000 +0:129 Branch: Return with expression +0:129 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 Sequence +0:4 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:4 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:4 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:4 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:4 Color: direct index for structure ( temp 4-component vector of float) +0:4 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:4 Depth: direct index for structure ( temp float) +0:4 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:4 Constant: +0:4 1 (const int) +0:? Linker Objects +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 42 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 35 39 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 14 "thisLineIs" + Name 17 "psout" + Name 32 "flattenTemp" + Name 35 "@entryPointOutput.Color" + Name 39 "@entryPointOutput.Depth" + Decorate 35(@entryPointOutput.Color) Location 0 + Decorate 39(@entryPointOutput.Depth) BuiltIn FragDepth + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeInt 32 1 + 13: TypePointer Function 12(int) + 15: 12(int) Constant 124 + 16: TypePointer Function 8(PS_OUTPUT) + 18: 12(int) Constant 0 + 21: 6(float) Constant 0 + 22: 6(float) Constant 1065353216 + 24: TypePointer Function 7(fvec4) + 26: 12(int) Constant 1 + 27: TypePointer Function 6(float) + 34: TypePointer Output 7(fvec4) +35(@entryPointOutput.Color): 34(ptr) Variable Output + 38: TypePointer Output 6(float) +39(@entryPointOutput.Depth): 38(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 32(flattenTemp): 16(ptr) Variable Function + 33:8(PS_OUTPUT) FunctionCall 10(@main() + Store 32(flattenTemp) 33 + 36: 24(ptr) AccessChain 32(flattenTemp) 18 + 37: 7(fvec4) Load 36 + Store 35(@entryPointOutput.Color) 37 + 40: 27(ptr) AccessChain 32(flattenTemp) 26 + 41: 6(float) Load 40 + Store 39(@entryPointOutput.Depth) 41 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 14(thisLineIs): 13(ptr) Variable Function + 17(psout): 16(ptr) Variable Function + Store 14(thisLineIs) 15 + 19: 12(int) Load 14(thisLineIs) + 20: 6(float) ConvertSToF 19 + 23: 7(fvec4) CompositeConstruct 20 21 21 22 + 25: 24(ptr) AccessChain 17(psout) 18 + Store 25 23 + 28: 27(ptr) AccessChain 17(psout) 26 + Store 28 22 + 29:8(PS_OUTPUT) Load 17(psout) + ReturnValue 29 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.pp.vert.out b/deps/glslang/Test/baseResults/hlsl.pp.vert.out new file mode 100644 index 00000000..817b6471 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.pp.vert.out @@ -0,0 +1,61 @@ +hlsl.pp.vert +Shader version: 500 +0:? Sequence +0:17 Function Definition: @main( ( temp void) +0:17 Function Parameters: +0:17 Function Definition: main( ( temp void) +0:17 Function Parameters: +0:? Sequence +0:17 Function Call: @main( ( temp void) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int goodGlobal1, uniform int goodGlobal2}) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:17 Function Definition: @main( ( temp void) +0:17 Function Parameters: +0:17 Function Definition: main( ( temp void) +0:17 Function Parameters: +0:? Sequence +0:17 Function Call: @main( ( temp void) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int goodGlobal1, uniform int goodGlobal2}) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 13 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" + Source HLSL 500 + Name 4 "main" + Name 6 "@main(" + Name 10 "$Global" + MemberName 10($Global) 0 "goodGlobal1" + MemberName 10($Global) 1 "goodGlobal2" + Name 12 "" + MemberDecorate 10($Global) 0 Offset 0 + MemberDecorate 10($Global) 1 Offset 4 + Decorate 10($Global) Block + Decorate 12 DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 9: TypeInt 32 1 + 10($Global): TypeStruct 9(int) 9(int) + 11: TypePointer Uniform 10($Global) + 12: 11(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + 8: 2 FunctionCall 6(@main() + Return + FunctionEnd + 6(@main(): 2 Function None 3 + 7: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.precedence.frag.out b/deps/glslang/Test/baseResults/hlsl.precedence.frag.out new file mode 100644 index 00000000..f4c53389 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.precedence.frag.out @@ -0,0 +1,257 @@ +hlsl.precedence.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @PixelShaderFunction(vf4;vf4;vf4;vf4; ( temp 4-component vector of float) +0:7 Function Parameters: +0:7 'a1' ( in 4-component vector of float) +0:7 'a2' ( in 4-component vector of float) +0:7 'a3' ( in 4-component vector of float) +0:7 'a4' ( in 4-component vector of float) +0:? Sequence +0:8 Branch: Return with expression +0:8 add ( temp 4-component vector of float) +0:8 add ( temp 4-component vector of float) +0:8 add ( temp 4-component vector of float) +0:8 'a1' ( in 4-component vector of float) +0:8 component-wise multiply ( temp 4-component vector of float) +0:8 'a2' ( in 4-component vector of float) +0:8 'a3' ( in 4-component vector of float) +0:8 'a4' ( in 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:8 component-wise multiply ( temp 3-component vector of float) +0:8 vector swizzle ( temp 3-component vector of float) +0:8 'a1' ( in 4-component vector of float) +0:8 Sequence +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 vector swizzle ( temp 3-component vector of float) +0:8 'a2' ( in 4-component vector of float) +0:8 Sequence +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( temp float) +0:8 'a3' ( in 4-component vector of float) +0:8 Constant: +0:8 3 (const int) +0:7 Function Definition: PixelShaderFunction( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:? 'a1' ( temp 4-component vector of float) +0:? 'a1' (layout( location=0) in 4-component vector of float) +0:7 move second child to first child ( temp 4-component vector of float) +0:? 'a2' ( temp 4-component vector of float) +0:? 'a2' (layout( location=1) in 4-component vector of float) +0:7 move second child to first child ( temp 4-component vector of float) +0:? 'a3' ( temp 4-component vector of float) +0:? 'a3' (layout( location=2) in 4-component vector of float) +0:7 move second child to first child ( temp 4-component vector of float) +0:? 'a4' ( temp 4-component vector of float) +0:? 'a4' (layout( location=3) in 4-component vector of float) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @PixelShaderFunction(vf4;vf4;vf4;vf4; ( temp 4-component vector of float) +0:? 'a1' ( temp 4-component vector of float) +0:? 'a2' ( temp 4-component vector of float) +0:? 'a3' ( temp 4-component vector of float) +0:? 'a4' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'a1' (layout( location=0) in 4-component vector of float) +0:? 'a2' (layout( location=1) in 4-component vector of float) +0:? 'a3' (layout( location=2) in 4-component vector of float) +0:? 'a4' (layout( location=3) in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @PixelShaderFunction(vf4;vf4;vf4;vf4; ( temp 4-component vector of float) +0:7 Function Parameters: +0:7 'a1' ( in 4-component vector of float) +0:7 'a2' ( in 4-component vector of float) +0:7 'a3' ( in 4-component vector of float) +0:7 'a4' ( in 4-component vector of float) +0:? Sequence +0:8 Branch: Return with expression +0:8 add ( temp 4-component vector of float) +0:8 add ( temp 4-component vector of float) +0:8 add ( temp 4-component vector of float) +0:8 'a1' ( in 4-component vector of float) +0:8 component-wise multiply ( temp 4-component vector of float) +0:8 'a2' ( in 4-component vector of float) +0:8 'a3' ( in 4-component vector of float) +0:8 'a4' ( in 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:8 component-wise multiply ( temp 3-component vector of float) +0:8 vector swizzle ( temp 3-component vector of float) +0:8 'a1' ( in 4-component vector of float) +0:8 Sequence +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 vector swizzle ( temp 3-component vector of float) +0:8 'a2' ( in 4-component vector of float) +0:8 Sequence +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( temp float) +0:8 'a3' ( in 4-component vector of float) +0:8 Constant: +0:8 3 (const int) +0:7 Function Definition: PixelShaderFunction( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:? 'a1' ( temp 4-component vector of float) +0:? 'a1' (layout( location=0) in 4-component vector of float) +0:7 move second child to first child ( temp 4-component vector of float) +0:? 'a2' ( temp 4-component vector of float) +0:? 'a2' (layout( location=1) in 4-component vector of float) +0:7 move second child to first child ( temp 4-component vector of float) +0:? 'a3' ( temp 4-component vector of float) +0:? 'a3' (layout( location=2) in 4-component vector of float) +0:7 move second child to first child ( temp 4-component vector of float) +0:? 'a4' ( temp 4-component vector of float) +0:? 'a4' (layout( location=3) in 4-component vector of float) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @PixelShaderFunction(vf4;vf4;vf4;vf4; ( temp 4-component vector of float) +0:? 'a1' ( temp 4-component vector of float) +0:? 'a2' ( temp 4-component vector of float) +0:? 'a3' ( temp 4-component vector of float) +0:? 'a4' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'a1' (layout( location=0) in 4-component vector of float) +0:? 'a2' (layout( location=1) in 4-component vector of float) +0:? 'a3' (layout( location=2) in 4-component vector of float) +0:? 'a4' (layout( location=3) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 65 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 43 46 49 52 55 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 14 "@PixelShaderFunction(vf4;vf4;vf4;vf4;" + Name 10 "a1" + Name 11 "a2" + Name 12 "a3" + Name 13 "a4" + Name 41 "a1" + Name 43 "a1" + Name 45 "a2" + Name 46 "a2" + Name 48 "a3" + Name 49 "a3" + Name 51 "a4" + Name 52 "a4" + Name 55 "@entryPointOutput" + Name 56 "param" + Name 58 "param" + Name 60 "param" + Name 62 "param" + Decorate 43(a1) Location 0 + Decorate 46(a2) Location 1 + Decorate 49(a3) Location 2 + Decorate 52(a4) Location 3 + Decorate 55(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) 8(ptr) 8(ptr) 8(ptr) + 23: TypeVector 6(float) 3 + 29: TypeInt 32 0 + 30: 29(int) Constant 3 + 31: TypePointer Function 6(float) + 42: TypePointer Input 7(fvec4) + 43(a1): 42(ptr) Variable Input + 46(a2): 42(ptr) Variable Input + 49(a3): 42(ptr) Variable Input + 52(a4): 42(ptr) Variable Input + 54: TypePointer Output 7(fvec4) +55(@entryPointOutput): 54(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 41(a1): 8(ptr) Variable Function + 45(a2): 8(ptr) Variable Function + 48(a3): 8(ptr) Variable Function + 51(a4): 8(ptr) Variable Function + 56(param): 8(ptr) Variable Function + 58(param): 8(ptr) Variable Function + 60(param): 8(ptr) Variable Function + 62(param): 8(ptr) Variable Function + 44: 7(fvec4) Load 43(a1) + Store 41(a1) 44 + 47: 7(fvec4) Load 46(a2) + Store 45(a2) 47 + 50: 7(fvec4) Load 49(a3) + Store 48(a3) 50 + 53: 7(fvec4) Load 52(a4) + Store 51(a4) 53 + 57: 7(fvec4) Load 41(a1) + Store 56(param) 57 + 59: 7(fvec4) Load 45(a2) + Store 58(param) 59 + 61: 7(fvec4) Load 48(a3) + Store 60(param) 61 + 63: 7(fvec4) Load 51(a4) + Store 62(param) 63 + 64: 7(fvec4) FunctionCall 14(@PixelShaderFunction(vf4;vf4;vf4;vf4;) 56(param) 58(param) 60(param) 62(param) + Store 55(@entryPointOutput) 64 + Return + FunctionEnd +14(@PixelShaderFunction(vf4;vf4;vf4;vf4;): 7(fvec4) Function None 9 + 10(a1): 8(ptr) FunctionParameter + 11(a2): 8(ptr) FunctionParameter + 12(a3): 8(ptr) FunctionParameter + 13(a4): 8(ptr) FunctionParameter + 15: Label + 16: 7(fvec4) Load 10(a1) + 17: 7(fvec4) Load 11(a2) + 18: 7(fvec4) Load 12(a3) + 19: 7(fvec4) FMul 17 18 + 20: 7(fvec4) FAdd 16 19 + 21: 7(fvec4) Load 13(a4) + 22: 7(fvec4) FAdd 20 21 + 24: 7(fvec4) Load 10(a1) + 25: 23(fvec3) VectorShuffle 24 24 0 1 2 + 26: 7(fvec4) Load 11(a2) + 27: 23(fvec3) VectorShuffle 26 26 0 1 2 + 28: 23(fvec3) FMul 25 27 + 32: 31(ptr) AccessChain 12(a3) 30 + 33: 6(float) Load 32 + 34: 6(float) CompositeExtract 28 0 + 35: 6(float) CompositeExtract 28 1 + 36: 6(float) CompositeExtract 28 2 + 37: 7(fvec4) CompositeConstruct 34 35 36 33 + 38: 7(fvec4) FAdd 22 37 + ReturnValue 38 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.precedence2.frag.out b/deps/glslang/Test/baseResults/hlsl.precedence2.frag.out new file mode 100644 index 00000000..9ce674d6 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.precedence2.frag.out @@ -0,0 +1,218 @@ +hlsl.precedence2.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @PixelShaderFunction(i1;i1;i1;i1; ( temp int) +0:7 Function Parameters: +0:7 'a1' ( in int) +0:7 'a2' ( in int) +0:7 'a3' ( in int) +0:7 'a4' ( in int) +0:? Sequence +0:8 Branch: Return with expression +0:8 add ( temp int) +0:8 left-shift ( temp int) +0:8 add ( temp int) +0:8 component-wise multiply ( temp int) +0:8 'a1' ( in int) +0:8 'a2' ( in int) +0:8 'a3' ( in int) +0:8 'a4' ( in int) +0:8 left-shift ( temp int) +0:8 'a1' ( in int) +0:8 add ( temp int) +0:8 'a2' ( in int) +0:8 component-wise multiply ( temp int) +0:8 'a3' ( in int) +0:8 'a4' ( in int) +0:7 Function Definition: PixelShaderFunction( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp int) +0:? 'a1' ( temp int) +0:? 'a1' (layout( location=0) flat in int) +0:7 move second child to first child ( temp int) +0:? 'a2' ( temp int) +0:? 'a2' (layout( location=1) flat in int) +0:7 move second child to first child ( temp int) +0:? 'a3' ( temp int) +0:? 'a3' (layout( location=2) flat in int) +0:7 move second child to first child ( temp int) +0:? 'a4' ( temp int) +0:? 'a4' (layout( location=3) flat in int) +0:7 move second child to first child ( temp int) +0:? '@entryPointOutput' (layout( location=0) out int) +0:7 Function Call: @PixelShaderFunction(i1;i1;i1;i1; ( temp int) +0:? 'a1' ( temp int) +0:? 'a2' ( temp int) +0:? 'a3' ( temp int) +0:? 'a4' ( temp int) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out int) +0:? 'a1' (layout( location=0) flat in int) +0:? 'a2' (layout( location=1) flat in int) +0:? 'a3' (layout( location=2) flat in int) +0:? 'a4' (layout( location=3) flat in int) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @PixelShaderFunction(i1;i1;i1;i1; ( temp int) +0:7 Function Parameters: +0:7 'a1' ( in int) +0:7 'a2' ( in int) +0:7 'a3' ( in int) +0:7 'a4' ( in int) +0:? Sequence +0:8 Branch: Return with expression +0:8 add ( temp int) +0:8 left-shift ( temp int) +0:8 add ( temp int) +0:8 component-wise multiply ( temp int) +0:8 'a1' ( in int) +0:8 'a2' ( in int) +0:8 'a3' ( in int) +0:8 'a4' ( in int) +0:8 left-shift ( temp int) +0:8 'a1' ( in int) +0:8 add ( temp int) +0:8 'a2' ( in int) +0:8 component-wise multiply ( temp int) +0:8 'a3' ( in int) +0:8 'a4' ( in int) +0:7 Function Definition: PixelShaderFunction( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp int) +0:? 'a1' ( temp int) +0:? 'a1' (layout( location=0) flat in int) +0:7 move second child to first child ( temp int) +0:? 'a2' ( temp int) +0:? 'a2' (layout( location=1) flat in int) +0:7 move second child to first child ( temp int) +0:? 'a3' ( temp int) +0:? 'a3' (layout( location=2) flat in int) +0:7 move second child to first child ( temp int) +0:? 'a4' ( temp int) +0:? 'a4' (layout( location=3) flat in int) +0:7 move second child to first child ( temp int) +0:? '@entryPointOutput' (layout( location=0) out int) +0:7 Function Call: @PixelShaderFunction(i1;i1;i1;i1; ( temp int) +0:? 'a1' ( temp int) +0:? 'a2' ( temp int) +0:? 'a3' ( temp int) +0:? 'a4' ( temp int) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out int) +0:? 'a1' (layout( location=0) flat in int) +0:? 'a2' (layout( location=1) flat in int) +0:? 'a3' (layout( location=2) flat in int) +0:? 'a4' (layout( location=3) flat in int) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 56 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 34 37 40 43 46 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 13 "@PixelShaderFunction(i1;i1;i1;i1;" + Name 9 "a1" + Name 10 "a2" + Name 11 "a3" + Name 12 "a4" + Name 32 "a1" + Name 34 "a1" + Name 36 "a2" + Name 37 "a2" + Name 39 "a3" + Name 40 "a3" + Name 42 "a4" + Name 43 "a4" + Name 46 "@entryPointOutput" + Name 47 "param" + Name 49 "param" + Name 51 "param" + Name 53 "param" + Decorate 34(a1) Flat + Decorate 34(a1) Location 0 + Decorate 37(a2) Flat + Decorate 37(a2) Location 1 + Decorate 40(a3) Flat + Decorate 40(a3) Location 2 + Decorate 43(a4) Flat + Decorate 43(a4) Location 3 + Decorate 46(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 8: TypeFunction 6(int) 7(ptr) 7(ptr) 7(ptr) 7(ptr) + 33: TypePointer Input 6(int) + 34(a1): 33(ptr) Variable Input + 37(a2): 33(ptr) Variable Input + 40(a3): 33(ptr) Variable Input + 43(a4): 33(ptr) Variable Input + 45: TypePointer Output 6(int) +46(@entryPointOutput): 45(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 32(a1): 7(ptr) Variable Function + 36(a2): 7(ptr) Variable Function + 39(a3): 7(ptr) Variable Function + 42(a4): 7(ptr) Variable Function + 47(param): 7(ptr) Variable Function + 49(param): 7(ptr) Variable Function + 51(param): 7(ptr) Variable Function + 53(param): 7(ptr) Variable Function + 35: 6(int) Load 34(a1) + Store 32(a1) 35 + 38: 6(int) Load 37(a2) + Store 36(a2) 38 + 41: 6(int) Load 40(a3) + Store 39(a3) 41 + 44: 6(int) Load 43(a4) + Store 42(a4) 44 + 48: 6(int) Load 32(a1) + Store 47(param) 48 + 50: 6(int) Load 36(a2) + Store 49(param) 50 + 52: 6(int) Load 39(a3) + Store 51(param) 52 + 54: 6(int) Load 42(a4) + Store 53(param) 54 + 55: 6(int) FunctionCall 13(@PixelShaderFunction(i1;i1;i1;i1;) 47(param) 49(param) 51(param) 53(param) + Store 46(@entryPointOutput) 55 + Return + FunctionEnd +13(@PixelShaderFunction(i1;i1;i1;i1;): 6(int) Function None 8 + 9(a1): 7(ptr) FunctionParameter + 10(a2): 7(ptr) FunctionParameter + 11(a3): 7(ptr) FunctionParameter + 12(a4): 7(ptr) FunctionParameter + 14: Label + 15: 6(int) Load 9(a1) + 16: 6(int) Load 10(a2) + 17: 6(int) IMul 15 16 + 18: 6(int) Load 11(a3) + 19: 6(int) IAdd 17 18 + 20: 6(int) Load 12(a4) + 21: 6(int) ShiftLeftLogical 19 20 + 22: 6(int) Load 9(a1) + 23: 6(int) Load 10(a2) + 24: 6(int) Load 11(a3) + 25: 6(int) Load 12(a4) + 26: 6(int) IMul 24 25 + 27: 6(int) IAdd 23 26 + 28: 6(int) ShiftLeftLogical 22 27 + 29: 6(int) IAdd 21 28 + ReturnValue 29 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.precise.frag.out b/deps/glslang/Test/baseResults/hlsl.precise.frag.out new file mode 100644 index 00000000..dd450690 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.precise.frag.out @@ -0,0 +1,139 @@ +hlsl.precise.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:6 Function Definition: MyFunction(f1;vf3; ( temp void) +0:6 Function Parameters: +0:6 'myfloat' ( noContraction in float) +0:6 'myfloat3' ( noContraction out 3-component vector of float) +0:9 Function Definition: @main( ( temp structure{ noContraction temp 4-component vector of float color}) +0:9 Function Parameters: +0:? Sequence +0:11 move second child to first child ( noContraction temp 4-component vector of float) +0:11 color: direct index for structure ( noContraction temp 4-component vector of float) +0:11 'ps_output' ( temp structure{ noContraction temp 4-component vector of float color}) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1.000000 +0:11 1.000000 +0:11 1.000000 +0:11 1.000000 +0:12 Branch: Return with expression +0:12 'ps_output' ( temp structure{ noContraction temp 4-component vector of float color}) +0:9 Function Definition: main( ( temp void) +0:9 Function Parameters: +0:? Sequence +0:9 Sequence +0:9 move second child to first child ( noContraction temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) noContraction out 4-component vector of float) +0:9 color: direct index for structure ( noContraction temp 4-component vector of float) +0:9 Function Call: @main( ( temp structure{ noContraction temp 4-component vector of float color}) +0:9 Constant: +0:9 0 (const int) +0:? Linker Objects +0:? 'precisefloat' ( noContraction global float) +0:? '@entryPointOutput.color' (layout( location=0) noContraction out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:6 Function Definition: MyFunction(f1;vf3; ( temp void) +0:6 Function Parameters: +0:6 'myfloat' ( noContraction in float) +0:6 'myfloat3' ( noContraction out 3-component vector of float) +0:9 Function Definition: @main( ( temp structure{ noContraction temp 4-component vector of float color}) +0:9 Function Parameters: +0:? Sequence +0:11 move second child to first child ( noContraction temp 4-component vector of float) +0:11 color: direct index for structure ( noContraction temp 4-component vector of float) +0:11 'ps_output' ( temp structure{ noContraction temp 4-component vector of float color}) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1.000000 +0:11 1.000000 +0:11 1.000000 +0:11 1.000000 +0:12 Branch: Return with expression +0:12 'ps_output' ( temp structure{ noContraction temp 4-component vector of float color}) +0:9 Function Definition: main( ( temp void) +0:9 Function Parameters: +0:? Sequence +0:9 Sequence +0:9 move second child to first child ( noContraction temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) noContraction out 4-component vector of float) +0:9 color: direct index for structure ( noContraction temp 4-component vector of float) +0:9 Function Call: @main( ( temp structure{ noContraction temp 4-component vector of float color}) +0:9 Constant: +0:9 0 (const int) +0:? Linker Objects +0:? 'precisefloat' ( noContraction global float) +0:? '@entryPointOutput.color' (layout( location=0) noContraction out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 37 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 32 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 13 "MyFunction(f1;vf3;" + Name 11 "myfloat" + Name 12 "myfloat3" + Name 16 "PS_OUTPUT" + MemberName 16(PS_OUTPUT) 0 "color" + Name 18 "@main(" + Name 21 "ps_output" + Name 32 "@entryPointOutput.color" + Name 36 "precisefloat" + Decorate 32(@entryPointOutput.color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeVector 6(float) 3 + 9: TypePointer Function 8(fvec3) + 10: TypeFunction 2 7(ptr) 9(ptr) + 15: TypeVector 6(float) 4 + 16(PS_OUTPUT): TypeStruct 15(fvec4) + 17: TypeFunction 16(PS_OUTPUT) + 20: TypePointer Function 16(PS_OUTPUT) + 22: TypeInt 32 1 + 23: 22(int) Constant 0 + 24: 6(float) Constant 1065353216 + 25: 15(fvec4) ConstantComposite 24 24 24 24 + 26: TypePointer Function 15(fvec4) + 31: TypePointer Output 15(fvec4) +32(@entryPointOutput.color): 31(ptr) Variable Output + 35: TypePointer Private 6(float) +36(precisefloat): 35(ptr) Variable Private + 4(main): 2 Function None 3 + 5: Label + 33:16(PS_OUTPUT) FunctionCall 18(@main() + 34: 15(fvec4) CompositeExtract 33 0 + Store 32(@entryPointOutput.color) 34 + Return + FunctionEnd +13(MyFunction(f1;vf3;): 2 Function None 10 + 11(myfloat): 7(ptr) FunctionParameter + 12(myfloat3): 9(ptr) FunctionParameter + 14: Label + Return + FunctionEnd + 18(@main():16(PS_OUTPUT) Function None 17 + 19: Label + 21(ps_output): 20(ptr) Variable Function + 27: 26(ptr) AccessChain 21(ps_output) 23 + Store 27 25 + 28:16(PS_OUTPUT) Load 21(ps_output) + ReturnValue 28 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.preprocessor.frag.out b/deps/glslang/Test/baseResults/hlsl.preprocessor.frag.out new file mode 100644 index 00000000..c78de3dd --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.preprocessor.frag.out @@ -0,0 +1,163 @@ +hlsl.preprocessor.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:9 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:9 Function Parameters: +0:9 'input' ( in 4-component vector of float) +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:10 'tex' ( temp 4-component vector of float) +0:10 texture ( temp 4-component vector of float) +0:10 Construct combined texture-sampler ( temp sampler2D) +0:10 'test_texture' ( uniform texture2D) +0:10 'test_texture_ss' ( uniform sampler) +0:10 vector swizzle ( temp 2-component vector of float) +0:10 vector swizzle ( temp 2-component vector of float) +0:10 'input' ( in 4-component vector of float) +0:10 Sequence +0:10 Constant: +0:10 0 (const int) +0:10 Constant: +0:10 1 (const int) +0:10 Sequence +0:10 Constant: +0:10 0 (const int) +0:10 Constant: +0:10 1 (const int) +0:11 Branch: Return with expression +0:11 'tex' ( temp 4-component vector of float) +0:9 Function Definition: main( ( temp void) +0:9 Function Parameters: +0:? Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:9 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:9 Function Call: @main(vf4; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'test_texture' ( uniform texture2D) +0:? 'test_texture_ss' ( uniform sampler) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:9 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:9 Function Parameters: +0:9 'input' ( in 4-component vector of float) +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:10 'tex' ( temp 4-component vector of float) +0:10 texture ( temp 4-component vector of float) +0:10 Construct combined texture-sampler ( temp sampler2D) +0:10 'test_texture' ( uniform texture2D) +0:10 'test_texture_ss' ( uniform sampler) +0:10 vector swizzle ( temp 2-component vector of float) +0:10 vector swizzle ( temp 2-component vector of float) +0:10 'input' ( in 4-component vector of float) +0:10 Sequence +0:10 Constant: +0:10 0 (const int) +0:10 Constant: +0:10 1 (const int) +0:10 Sequence +0:10 Constant: +0:10 0 (const int) +0:10 Constant: +0:10 1 (const int) +0:11 Branch: Return with expression +0:11 'tex' ( temp 4-component vector of float) +0:9 Function Definition: main( ( temp void) +0:9 Function Parameters: +0:? Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:9 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:9 Function Call: @main(vf4; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'test_texture' ( uniform texture2D) +0:? 'test_texture_ss' ( uniform sampler) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 40 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 33 36 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vf4;" + Name 10 "input" + Name 13 "tex" + Name 16 "test_texture" + Name 20 "test_texture_ss" + Name 31 "input" + Name 33 "input" + Name 36 "@entryPointOutput" + Name 37 "param" + Decorate 16(test_texture) DescriptorSet 0 + Decorate 20(test_texture_ss) DescriptorSet 0 + Decorate 33(input) Location 0 + Decorate 36(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) + 14: TypeImage 6(float) 2D sampled format:Unknown + 15: TypePointer UniformConstant 14 +16(test_texture): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 +20(test_texture_ss): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 2 + 32: TypePointer Input 7(fvec4) + 33(input): 32(ptr) Variable Input + 35: TypePointer Output 7(fvec4) +36(@entryPointOutput): 35(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 31(input): 8(ptr) Variable Function + 37(param): 8(ptr) Variable Function + 34: 7(fvec4) Load 33(input) + Store 31(input) 34 + 38: 7(fvec4) Load 31(input) + Store 37(param) 38 + 39: 7(fvec4) FunctionCall 11(@main(vf4;) 37(param) + Store 36(@entryPointOutput) 39 + Return + FunctionEnd + 11(@main(vf4;): 7(fvec4) Function None 9 + 10(input): 8(ptr) FunctionParameter + 12: Label + 13(tex): 8(ptr) Variable Function + 17: 14 Load 16(test_texture) + 21: 18 Load 20(test_texture_ss) + 23: 22 SampledImage 17 21 + 25: 7(fvec4) Load 10(input) + 26: 24(fvec2) VectorShuffle 25 25 0 1 + 27: 7(fvec4) ImageSampleImplicitLod 23 26 + Store 13(tex) 27 + 28: 7(fvec4) Load 13(tex) + ReturnValue 28 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.promote.atomic.frag.out b/deps/glslang/Test/baseResults/hlsl.promote.atomic.frag.out new file mode 100644 index 00000000..ecc188b1 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.promote.atomic.frag.out @@ -0,0 +1,123 @@ +hlsl.promote.atomic.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main( ( temp 4-component vector of float) +0:5 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp int) +0:13 'Orig' ( temp int) +0:13 Convert uint to int ( temp int) +0:13 imageAtomicAdd ( temp uint) +0:13 's_uintbuff' (layout( r32ui) uniform uimageBuffer) +0:13 'Loc' ( temp int) +0:13 Convert int to uint ( temp uint) +0:13 'Inc' ( temp int) +0:15 Branch: Return with expression +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:5 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 's_uintbuff' (layout( r32ui) uniform uimageBuffer) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main( ( temp 4-component vector of float) +0:5 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp int) +0:13 'Orig' ( temp int) +0:13 Convert uint to int ( temp int) +0:13 imageAtomicAdd ( temp uint) +0:13 's_uintbuff' (layout( r32ui) uniform uimageBuffer) +0:13 'Loc' ( temp int) +0:13 Convert int to uint ( temp uint) +0:13 'Inc' ( temp int) +0:15 Branch: Return with expression +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:5 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 's_uintbuff' (layout( r32ui) uniform uimageBuffer) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 36 + + Capability Shader + Capability ImageBuffer + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 34 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 13 "Orig" + Name 17 "s_uintbuff" + Name 18 "Loc" + Name 20 "Inc" + Name 34 "@entryPointOutput" + Decorate 17(s_uintbuff) DescriptorSet 0 + Decorate 34(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeInt 32 1 + 12: TypePointer Function 11(int) + 14: TypeInt 32 0 + 15: TypeImage 14(int) Buffer nonsampled format:R32ui + 16: TypePointer UniformConstant 15 + 17(s_uintbuff): 16(ptr) Variable UniformConstant + 23: 14(int) Constant 0 + 24: TypePointer Image 14(int) + 26: 14(int) Constant 1 + 29: 6(float) Constant 0 + 30: 7(fvec4) ConstantComposite 29 29 29 29 + 33: TypePointer Output 7(fvec4) +34(@entryPointOutput): 33(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 35: 7(fvec4) FunctionCall 9(@main() + Store 34(@entryPointOutput) 35 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 13(Orig): 12(ptr) Variable Function + 18(Loc): 12(ptr) Variable Function + 20(Inc): 12(ptr) Variable Function + 19: 11(int) Load 18(Loc) + 21: 11(int) Load 20(Inc) + 22: 14(int) Bitcast 21 + 25: 24(ptr) ImageTexelPointer 17(s_uintbuff) 19 23 + 27: 14(int) AtomicIAdd 25 26 23 22 + 28: 11(int) Bitcast 27 + Store 13(Orig) 28 + ReturnValue 30 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.promote.binary.frag.out b/deps/glslang/Test/baseResults/hlsl.promote.binary.frag.out new file mode 100644 index 00000000..e1931af1 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.promote.binary.frag.out @@ -0,0 +1,294 @@ +hlsl.promote.binary.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:14 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:14 Function Parameters: +0:? Sequence +0:15 mod ( temp float) +0:15 Convert int to float ( temp float) +0:15 ival: direct index for structure ( uniform int) +0:15 'anon@0' (layout( row_major std140) uniform block{ uniform bool bval, uniform 4-component vector of bool bval4, uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:15 Constant: +0:15 2 (const uint) +0:15 fval: direct index for structure ( uniform float) +0:15 'anon@0' (layout( row_major std140) uniform block{ uniform bool bval, uniform 4-component vector of bool bval4, uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:15 Constant: +0:15 4 (const uint) +0:16 mod ( temp 4-component vector of float) +0:16 Convert int to float ( temp 4-component vector of float) +0:16 ival4: direct index for structure ( uniform 4-component vector of int) +0:16 'anon@0' (layout( row_major std140) uniform block{ uniform bool bval, uniform 4-component vector of bool bval4, uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:16 Constant: +0:16 3 (const uint) +0:16 fval4: direct index for structure ( uniform 4-component vector of float) +0:16 'anon@0' (layout( row_major std140) uniform block{ uniform bool bval, uniform 4-component vector of bool bval4, uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:16 Constant: +0:16 5 (const uint) +0:18 mod ( temp float) +0:18 Convert bool to float ( temp float) +0:18 bval: direct index for structure ( uniform bool) +0:18 'anon@0' (layout( row_major std140) uniform block{ uniform bool bval, uniform 4-component vector of bool bval4, uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:18 Constant: +0:18 0 (const uint) +0:18 fval: direct index for structure ( uniform float) +0:18 'anon@0' (layout( row_major std140) uniform block{ uniform bool bval, uniform 4-component vector of bool bval4, uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:18 Constant: +0:18 4 (const uint) +0:19 mod ( temp 4-component vector of float) +0:19 Convert bool to float ( temp 4-component vector of float) +0:19 bval4: direct index for structure ( uniform 4-component vector of bool) +0:19 'anon@0' (layout( row_major std140) uniform block{ uniform bool bval, uniform 4-component vector of bool bval4, uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:19 Constant: +0:19 1 (const uint) +0:19 fval4: direct index for structure ( uniform 4-component vector of float) +0:19 'anon@0' (layout( row_major std140) uniform block{ uniform bool bval, uniform 4-component vector of bool bval4, uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:19 Constant: +0:19 5 (const uint) +0:21 Sequence +0:21 move second child to first child ( temp int) +0:21 'l_int' ( temp int) +0:21 Constant: +0:21 1 (const int) +0:22 mod second child into first child ( temp int) +0:22 'l_int' ( temp int) +0:22 Convert float to int ( temp int) +0:22 fval: direct index for structure ( uniform float) +0:22 'anon@0' (layout( row_major std140) uniform block{ uniform bool bval, uniform 4-component vector of bool bval4, uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:22 Constant: +0:22 4 (const uint) +0:25 move second child to first child ( temp 4-component vector of float) +0:25 Color: direct index for structure ( temp 4-component vector of float) +0:25 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:26 Branch: Return with expression +0:26 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:14 Function Definition: main( ( temp void) +0:14 Function Parameters: +0:? Sequence +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:14 Color: direct index for structure ( temp 4-component vector of float) +0:14 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:14 Constant: +0:14 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform bool bval, uniform 4-component vector of bool bval4, uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:14 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:14 Function Parameters: +0:? Sequence +0:15 mod ( temp float) +0:15 Convert int to float ( temp float) +0:15 ival: direct index for structure ( uniform int) +0:15 'anon@0' (layout( row_major std140) uniform block{ uniform bool bval, uniform 4-component vector of bool bval4, uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:15 Constant: +0:15 2 (const uint) +0:15 fval: direct index for structure ( uniform float) +0:15 'anon@0' (layout( row_major std140) uniform block{ uniform bool bval, uniform 4-component vector of bool bval4, uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:15 Constant: +0:15 4 (const uint) +0:16 mod ( temp 4-component vector of float) +0:16 Convert int to float ( temp 4-component vector of float) +0:16 ival4: direct index for structure ( uniform 4-component vector of int) +0:16 'anon@0' (layout( row_major std140) uniform block{ uniform bool bval, uniform 4-component vector of bool bval4, uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:16 Constant: +0:16 3 (const uint) +0:16 fval4: direct index for structure ( uniform 4-component vector of float) +0:16 'anon@0' (layout( row_major std140) uniform block{ uniform bool bval, uniform 4-component vector of bool bval4, uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:16 Constant: +0:16 5 (const uint) +0:18 mod ( temp float) +0:18 Convert bool to float ( temp float) +0:18 bval: direct index for structure ( uniform bool) +0:18 'anon@0' (layout( row_major std140) uniform block{ uniform bool bval, uniform 4-component vector of bool bval4, uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:18 Constant: +0:18 0 (const uint) +0:18 fval: direct index for structure ( uniform float) +0:18 'anon@0' (layout( row_major std140) uniform block{ uniform bool bval, uniform 4-component vector of bool bval4, uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:18 Constant: +0:18 4 (const uint) +0:19 mod ( temp 4-component vector of float) +0:19 Convert bool to float ( temp 4-component vector of float) +0:19 bval4: direct index for structure ( uniform 4-component vector of bool) +0:19 'anon@0' (layout( row_major std140) uniform block{ uniform bool bval, uniform 4-component vector of bool bval4, uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:19 Constant: +0:19 1 (const uint) +0:19 fval4: direct index for structure ( uniform 4-component vector of float) +0:19 'anon@0' (layout( row_major std140) uniform block{ uniform bool bval, uniform 4-component vector of bool bval4, uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:19 Constant: +0:19 5 (const uint) +0:21 Sequence +0:21 move second child to first child ( temp int) +0:21 'l_int' ( temp int) +0:21 Constant: +0:21 1 (const int) +0:22 mod second child into first child ( temp int) +0:22 'l_int' ( temp int) +0:22 Convert float to int ( temp int) +0:22 fval: direct index for structure ( uniform float) +0:22 'anon@0' (layout( row_major std140) uniform block{ uniform bool bval, uniform 4-component vector of bool bval4, uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:22 Constant: +0:22 4 (const uint) +0:25 move second child to first child ( temp 4-component vector of float) +0:25 Color: direct index for structure ( temp 4-component vector of float) +0:25 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:26 Branch: Return with expression +0:26 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:14 Function Definition: main( ( temp void) +0:14 Function Parameters: +0:? Sequence +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:14 Color: direct index for structure ( temp 4-component vector of float) +0:14 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:14 Constant: +0:14 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform bool bval, uniform 4-component vector of bool bval4, uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 83 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 80 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + Name 10 "@main(" + Name 16 "$Global" + MemberName 16($Global) 0 "bval" + MemberName 16($Global) 1 "bval4" + MemberName 16($Global) 2 "ival" + MemberName 16($Global) 3 "ival4" + MemberName 16($Global) 4 "fval" + MemberName 16($Global) 5 "fval4" + Name 18 "" + Name 66 "l_int" + Name 73 "psout" + Name 80 "@entryPointOutput.Color" + MemberDecorate 16($Global) 0 Offset 0 + MemberDecorate 16($Global) 1 Offset 16 + MemberDecorate 16($Global) 2 Offset 32 + MemberDecorate 16($Global) 3 Offset 48 + MemberDecorate 16($Global) 4 Offset 64 + MemberDecorate 16($Global) 5 Offset 80 + Decorate 16($Global) Block + Decorate 18 DescriptorSet 0 + Decorate 80(@entryPointOutput.Color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeInt 32 0 + 13: TypeVector 12(int) 4 + 14: TypeInt 32 1 + 15: TypeVector 14(int) 4 + 16($Global): TypeStruct 12(int) 13(ivec4) 14(int) 15(ivec4) 6(float) 7(fvec4) + 17: TypePointer Uniform 16($Global) + 18: 17(ptr) Variable Uniform + 19: 14(int) Constant 2 + 20: TypePointer Uniform 14(int) + 24: 14(int) Constant 4 + 25: TypePointer Uniform 6(float) + 29: 14(int) Constant 3 + 30: TypePointer Uniform 15(ivec4) + 34: 14(int) Constant 5 + 35: TypePointer Uniform 7(fvec4) + 39: 14(int) Constant 0 + 40: TypePointer Uniform 12(int) + 43: TypeBool + 44: 12(int) Constant 0 + 46: 6(float) Constant 0 + 47: 6(float) Constant 1065353216 + 52: 14(int) Constant 1 + 53: TypePointer Uniform 13(ivec4) + 56: TypeVector 43(bool) 4 + 57: 13(ivec4) ConstantComposite 44 44 44 44 + 59: 7(fvec4) ConstantComposite 46 46 46 46 + 60: 7(fvec4) ConstantComposite 47 47 47 47 + 65: TypePointer Function 14(int) + 72: TypePointer Function 8(PS_OUTPUT) + 74: TypePointer Function 7(fvec4) + 79: TypePointer Output 7(fvec4) +80(@entryPointOutput.Color): 79(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 81:8(PS_OUTPUT) FunctionCall 10(@main() + 82: 7(fvec4) CompositeExtract 81 0 + Store 80(@entryPointOutput.Color) 82 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 66(l_int): 65(ptr) Variable Function + 73(psout): 72(ptr) Variable Function + 21: 20(ptr) AccessChain 18 19 + 22: 14(int) Load 21 + 23: 6(float) ConvertSToF 22 + 26: 25(ptr) AccessChain 18 24 + 27: 6(float) Load 26 + 28: 6(float) FMod 23 27 + 31: 30(ptr) AccessChain 18 29 + 32: 15(ivec4) Load 31 + 33: 7(fvec4) ConvertSToF 32 + 36: 35(ptr) AccessChain 18 34 + 37: 7(fvec4) Load 36 + 38: 7(fvec4) FMod 33 37 + 41: 40(ptr) AccessChain 18 39 + 42: 12(int) Load 41 + 45: 43(bool) INotEqual 42 44 + 48: 6(float) Select 45 47 46 + 49: 25(ptr) AccessChain 18 24 + 50: 6(float) Load 49 + 51: 6(float) FMod 48 50 + 54: 53(ptr) AccessChain 18 52 + 55: 13(ivec4) Load 54 + 58: 56(bvec4) INotEqual 55 57 + 61: 7(fvec4) Select 58 60 59 + 62: 35(ptr) AccessChain 18 34 + 63: 7(fvec4) Load 62 + 64: 7(fvec4) FMod 61 63 + Store 66(l_int) 52 + 67: 25(ptr) AccessChain 18 24 + 68: 6(float) Load 67 + 69: 14(int) ConvertFToS 68 + 70: 14(int) Load 66(l_int) + 71: 14(int) SMod 70 69 + Store 66(l_int) 71 + 75: 74(ptr) AccessChain 73(psout) 39 + Store 75 59 + 76:8(PS_OUTPUT) Load 73(psout) + ReturnValue 76 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.promote.vec1.frag.out b/deps/glslang/Test/baseResults/hlsl.promote.vec1.frag.out new file mode 100644 index 00000000..b92d7409 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.promote.vec1.frag.out @@ -0,0 +1,132 @@ +hlsl.promote.vec1.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: @main( ( temp 4-component vector of float) +0:3 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp float) +0:7 'f1a' ( temp float) +0:7 Construct float ( temp float) +0:7 'f1b' ( temp 1-component vector of float) +0:8 move second child to first child ( temp 1-component vector of float) +0:8 'f1b' ( temp 1-component vector of float) +0:8 Construct float ( temp 1-component vector of float) +0:8 'f1a' ( temp float) +0:11 step ( temp 3-component vector of float) +0:11 Constant: +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 'f3' ( temp 3-component vector of float) +0:13 sine ( temp float) +0:13 Construct float ( in float) +0:13 'f1b' ( temp 1-component vector of float) +0:15 Branch: Return with expression +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:3 Function Definition: main( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:3 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:3 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: @main( ( temp 4-component vector of float) +0:3 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp float) +0:7 'f1a' ( temp float) +0:7 Construct float ( temp float) +0:7 'f1b' ( temp 1-component vector of float) +0:8 move second child to first child ( temp 1-component vector of float) +0:8 'f1b' ( temp 1-component vector of float) +0:8 Construct float ( temp 1-component vector of float) +0:8 'f1a' ( temp float) +0:11 step ( temp 3-component vector of float) +0:11 Constant: +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 'f3' ( temp 3-component vector of float) +0:13 sine ( temp float) +0:13 Construct float ( in float) +0:13 'f1b' ( temp 1-component vector of float) +0:15 Branch: Return with expression +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:3 Function Definition: main( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:3 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:3 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 31 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 29 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 12 "f1a" + Name 13 "f1b" + Name 20 "f3" + Name 29 "@entryPointOutput" + Decorate 29(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypePointer Function 6(float) + 16: TypeVector 6(float) 3 + 17: 6(float) Constant 0 + 18: 16(fvec3) ConstantComposite 17 17 17 + 19: TypePointer Function 16(fvec3) + 25: 7(fvec4) ConstantComposite 17 17 17 17 + 28: TypePointer Output 7(fvec4) +29(@entryPointOutput): 28(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 30: 7(fvec4) FunctionCall 9(@main() + Store 29(@entryPointOutput) 30 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 12(f1a): 11(ptr) Variable Function + 13(f1b): 11(ptr) Variable Function + 20(f3): 19(ptr) Variable Function + 14: 6(float) Load 13(f1b) + Store 12(f1a) 14 + 15: 6(float) Load 12(f1a) + Store 13(f1b) 15 + 21: 16(fvec3) Load 20(f3) + 22: 16(fvec3) ExtInst 1(GLSL.std.450) 48(Step) 18 21 + 23: 6(float) Load 13(f1b) + 24: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 23 + ReturnValue 25 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.promotions.frag.out b/deps/glslang/Test/baseResults/hlsl.promotions.frag.out new file mode 100644 index 00000000..9c089484 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.promotions.frag.out @@ -0,0 +1,2381 @@ +hlsl.promotions.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:19 Function Definition: Fn_F3(vf3; ( temp void) +0:19 Function Parameters: +0:19 'x' ( in 3-component vector of float) +0:20 Function Definition: Fn_I3(vi3; ( temp void) +0:20 Function Parameters: +0:20 'x' ( in 3-component vector of int) +0:21 Function Definition: Fn_U3(vu3; ( temp void) +0:21 Function Parameters: +0:21 'x' ( in 3-component vector of uint) +0:22 Function Definition: Fn_B3(vb3; ( temp void) +0:22 Function Parameters: +0:22 'x' ( in 3-component vector of bool) +0:23 Function Definition: Fn_D3(vd3; ( temp void) +0:23 Function Parameters: +0:23 'x' ( in 3-component vector of double) +0:26 Function Definition: Fn_R_F3I(vf3; ( temp 3-component vector of float) +0:26 Function Parameters: +0:26 'p' ( out 3-component vector of float) +0:? Sequence +0:26 move second child to first child ( temp 3-component vector of float) +0:26 'p' ( out 3-component vector of float) +0:26 Convert int to float ( temp 3-component vector of float) +0:26 i3: direct index for structure ( uniform 3-component vector of int) +0:26 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:26 Constant: +0:26 0 (const uint) +0:26 Branch: Return with expression +0:26 Convert int to float ( temp 3-component vector of float) +0:26 i3: direct index for structure ( uniform 3-component vector of int) +0:26 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:26 Constant: +0:26 0 (const uint) +0:27 Function Definition: Fn_R_F3U(vf3; ( temp 3-component vector of float) +0:27 Function Parameters: +0:27 'p' ( out 3-component vector of float) +0:? Sequence +0:27 move second child to first child ( temp 3-component vector of float) +0:27 'p' ( out 3-component vector of float) +0:27 Convert uint to float ( temp 3-component vector of float) +0:27 u3: direct index for structure ( uniform 3-component vector of uint) +0:27 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:27 Constant: +0:27 3 (const uint) +0:27 Branch: Return with expression +0:27 Convert uint to float ( temp 3-component vector of float) +0:27 u3: direct index for structure ( uniform 3-component vector of uint) +0:27 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:27 Constant: +0:27 3 (const uint) +0:28 Function Definition: Fn_R_F3B(vf3; ( temp 3-component vector of float) +0:28 Function Parameters: +0:28 'p' ( out 3-component vector of float) +0:? Sequence +0:28 move second child to first child ( temp 3-component vector of float) +0:28 'p' ( out 3-component vector of float) +0:28 Convert bool to float ( temp 3-component vector of float) +0:28 b3: direct index for structure ( uniform 3-component vector of bool) +0:28 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:28 Constant: +0:28 1 (const uint) +0:28 Branch: Return with expression +0:28 Convert bool to float ( temp 3-component vector of float) +0:28 b3: direct index for structure ( uniform 3-component vector of bool) +0:28 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:28 Constant: +0:28 1 (const uint) +0:29 Function Definition: Fn_R_F3D(vf3; ( temp 3-component vector of float) +0:29 Function Parameters: +0:29 'p' ( out 3-component vector of float) +0:? Sequence +0:29 move second child to first child ( temp 3-component vector of float) +0:29 'p' ( out 3-component vector of float) +0:29 Convert double to float ( temp 3-component vector of float) +0:29 d3: direct index for structure ( uniform 3-component vector of double) +0:29 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:29 Constant: +0:29 4 (const uint) +0:29 Branch: Return with expression +0:29 Convert double to float ( temp 3-component vector of float) +0:29 d3: direct index for structure ( uniform 3-component vector of double) +0:29 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:29 Constant: +0:29 4 (const uint) +0:31 Function Definition: Fn_R_I3U(vi3; ( temp 3-component vector of int) +0:31 Function Parameters: +0:31 'p' ( out 3-component vector of int) +0:? Sequence +0:31 move second child to first child ( temp 3-component vector of int) +0:31 'p' ( out 3-component vector of int) +0:31 Convert uint to int ( temp 3-component vector of int) +0:31 u3: direct index for structure ( uniform 3-component vector of uint) +0:31 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:31 Constant: +0:31 3 (const uint) +0:31 Branch: Return with expression +0:31 Convert uint to int ( temp 3-component vector of int) +0:31 u3: direct index for structure ( uniform 3-component vector of uint) +0:31 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:31 Constant: +0:31 3 (const uint) +0:32 Function Definition: Fn_R_I3B(vi3; ( temp 3-component vector of int) +0:32 Function Parameters: +0:32 'p' ( out 3-component vector of int) +0:? Sequence +0:32 move second child to first child ( temp 3-component vector of int) +0:32 'p' ( out 3-component vector of int) +0:32 Convert bool to int ( temp 3-component vector of int) +0:32 b3: direct index for structure ( uniform 3-component vector of bool) +0:32 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:32 Constant: +0:32 1 (const uint) +0:32 Branch: Return with expression +0:32 Convert bool to int ( temp 3-component vector of int) +0:32 b3: direct index for structure ( uniform 3-component vector of bool) +0:32 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:32 Constant: +0:32 1 (const uint) +0:33 Function Definition: Fn_R_I3F(vi3; ( temp 3-component vector of int) +0:33 Function Parameters: +0:33 'p' ( out 3-component vector of int) +0:? Sequence +0:33 move second child to first child ( temp 3-component vector of int) +0:33 'p' ( out 3-component vector of int) +0:33 Convert float to int ( temp 3-component vector of int) +0:33 f3: direct index for structure ( uniform 3-component vector of float) +0:33 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:33 Constant: +0:33 2 (const uint) +0:33 Branch: Return with expression +0:33 Convert float to int ( temp 3-component vector of int) +0:33 f3: direct index for structure ( uniform 3-component vector of float) +0:33 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:33 Constant: +0:33 2 (const uint) +0:34 Function Definition: Fn_R_I3D(vi3; ( temp 3-component vector of int) +0:34 Function Parameters: +0:34 'p' ( out 3-component vector of int) +0:? Sequence +0:34 move second child to first child ( temp 3-component vector of int) +0:34 'p' ( out 3-component vector of int) +0:34 Convert double to int ( temp 3-component vector of int) +0:34 d3: direct index for structure ( uniform 3-component vector of double) +0:34 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:34 Constant: +0:34 4 (const uint) +0:34 Branch: Return with expression +0:34 Convert double to int ( temp 3-component vector of int) +0:34 d3: direct index for structure ( uniform 3-component vector of double) +0:34 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:34 Constant: +0:34 4 (const uint) +0:36 Function Definition: Fn_R_U3I(vu3; ( temp 3-component vector of uint) +0:36 Function Parameters: +0:36 'p' ( out 3-component vector of uint) +0:? Sequence +0:36 move second child to first child ( temp 3-component vector of uint) +0:36 'p' ( out 3-component vector of uint) +0:36 Convert int to uint ( temp 3-component vector of uint) +0:36 i3: direct index for structure ( uniform 3-component vector of int) +0:36 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:36 Constant: +0:36 0 (const uint) +0:36 Branch: Return with expression +0:36 Convert int to uint ( temp 3-component vector of uint) +0:36 i3: direct index for structure ( uniform 3-component vector of int) +0:36 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:36 Constant: +0:36 0 (const uint) +0:37 Function Definition: Fn_R_U3F(vu3; ( temp 3-component vector of uint) +0:37 Function Parameters: +0:37 'p' ( out 3-component vector of uint) +0:? Sequence +0:37 move second child to first child ( temp 3-component vector of uint) +0:37 'p' ( out 3-component vector of uint) +0:37 Convert float to uint ( temp 3-component vector of uint) +0:37 f3: direct index for structure ( uniform 3-component vector of float) +0:37 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:37 Constant: +0:37 2 (const uint) +0:37 Branch: Return with expression +0:37 Convert float to uint ( temp 3-component vector of uint) +0:37 f3: direct index for structure ( uniform 3-component vector of float) +0:37 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:37 Constant: +0:37 2 (const uint) +0:38 Function Definition: Fn_R_U3B(vu3; ( temp 3-component vector of uint) +0:38 Function Parameters: +0:38 'p' ( out 3-component vector of uint) +0:? Sequence +0:38 move second child to first child ( temp 3-component vector of uint) +0:38 'p' ( out 3-component vector of uint) +0:38 Convert bool to uint ( temp 3-component vector of uint) +0:38 b3: direct index for structure ( uniform 3-component vector of bool) +0:38 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:38 Constant: +0:38 1 (const uint) +0:38 Branch: Return with expression +0:38 Convert bool to uint ( temp 3-component vector of uint) +0:38 b3: direct index for structure ( uniform 3-component vector of bool) +0:38 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:38 Constant: +0:38 1 (const uint) +0:39 Function Definition: Fn_R_U3D(vu3; ( temp 3-component vector of uint) +0:39 Function Parameters: +0:39 'p' ( out 3-component vector of uint) +0:? Sequence +0:39 move second child to first child ( temp 3-component vector of uint) +0:39 'p' ( out 3-component vector of uint) +0:39 Convert double to uint ( temp 3-component vector of uint) +0:39 d3: direct index for structure ( uniform 3-component vector of double) +0:39 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:39 Constant: +0:39 4 (const uint) +0:39 Branch: Return with expression +0:39 Convert double to uint ( temp 3-component vector of uint) +0:39 d3: direct index for structure ( uniform 3-component vector of double) +0:39 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:39 Constant: +0:39 4 (const uint) +0:41 Function Definition: Fn_R_B3I(vb3; ( temp 3-component vector of bool) +0:41 Function Parameters: +0:41 'p' ( out 3-component vector of bool) +0:? Sequence +0:41 move second child to first child ( temp 3-component vector of bool) +0:41 'p' ( out 3-component vector of bool) +0:41 Convert int to bool ( temp 3-component vector of bool) +0:41 i3: direct index for structure ( uniform 3-component vector of int) +0:41 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:41 Constant: +0:41 0 (const uint) +0:41 Branch: Return with expression +0:41 Convert int to bool ( temp 3-component vector of bool) +0:41 i3: direct index for structure ( uniform 3-component vector of int) +0:41 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:41 Constant: +0:41 0 (const uint) +0:42 Function Definition: Fn_R_B3U(vb3; ( temp 3-component vector of bool) +0:42 Function Parameters: +0:42 'p' ( out 3-component vector of bool) +0:? Sequence +0:42 move second child to first child ( temp 3-component vector of bool) +0:42 'p' ( out 3-component vector of bool) +0:42 Convert uint to bool ( temp 3-component vector of bool) +0:42 u3: direct index for structure ( uniform 3-component vector of uint) +0:42 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:42 Constant: +0:42 3 (const uint) +0:42 Branch: Return with expression +0:42 Convert uint to bool ( temp 3-component vector of bool) +0:42 u3: direct index for structure ( uniform 3-component vector of uint) +0:42 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:42 Constant: +0:42 3 (const uint) +0:43 Function Definition: Fn_R_B3F(vb3; ( temp 3-component vector of bool) +0:43 Function Parameters: +0:43 'p' ( out 3-component vector of bool) +0:? Sequence +0:43 move second child to first child ( temp 3-component vector of bool) +0:43 'p' ( out 3-component vector of bool) +0:43 Convert float to bool ( temp 3-component vector of bool) +0:43 f3: direct index for structure ( uniform 3-component vector of float) +0:43 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:43 Constant: +0:43 2 (const uint) +0:43 Branch: Return with expression +0:43 Convert float to bool ( temp 3-component vector of bool) +0:43 f3: direct index for structure ( uniform 3-component vector of float) +0:43 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:43 Constant: +0:43 2 (const uint) +0:44 Function Definition: Fn_R_B3D(vb3; ( temp 3-component vector of bool) +0:44 Function Parameters: +0:44 'p' ( out 3-component vector of bool) +0:? Sequence +0:44 move second child to first child ( temp 3-component vector of bool) +0:44 'p' ( out 3-component vector of bool) +0:44 Convert double to bool ( temp 3-component vector of bool) +0:44 d3: direct index for structure ( uniform 3-component vector of double) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:44 Constant: +0:44 4 (const uint) +0:44 Branch: Return with expression +0:44 Convert double to bool ( temp 3-component vector of bool) +0:44 d3: direct index for structure ( uniform 3-component vector of double) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:44 Constant: +0:44 4 (const uint) +0:46 Function Definition: Fn_R_D3I(vd3; ( temp 3-component vector of double) +0:46 Function Parameters: +0:46 'p' ( out 3-component vector of double) +0:? Sequence +0:46 move second child to first child ( temp 3-component vector of double) +0:46 'p' ( out 3-component vector of double) +0:46 Convert int to double ( temp 3-component vector of double) +0:46 i3: direct index for structure ( uniform 3-component vector of int) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:46 Constant: +0:46 0 (const uint) +0:46 Branch: Return with expression +0:46 Convert int to double ( temp 3-component vector of double) +0:46 i3: direct index for structure ( uniform 3-component vector of int) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:46 Constant: +0:46 0 (const uint) +0:47 Function Definition: Fn_R_D3U(vd3; ( temp 3-component vector of double) +0:47 Function Parameters: +0:47 'p' ( out 3-component vector of double) +0:? Sequence +0:47 move second child to first child ( temp 3-component vector of double) +0:47 'p' ( out 3-component vector of double) +0:47 Convert uint to double ( temp 3-component vector of double) +0:47 u3: direct index for structure ( uniform 3-component vector of uint) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:47 Constant: +0:47 3 (const uint) +0:47 Branch: Return with expression +0:47 Convert uint to double ( temp 3-component vector of double) +0:47 u3: direct index for structure ( uniform 3-component vector of uint) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:47 Constant: +0:47 3 (const uint) +0:48 Function Definition: Fn_R_D3B(vd3; ( temp 3-component vector of double) +0:48 Function Parameters: +0:48 'p' ( out 3-component vector of double) +0:? Sequence +0:48 move second child to first child ( temp 3-component vector of double) +0:48 'p' ( out 3-component vector of double) +0:48 Convert bool to double ( temp 3-component vector of double) +0:48 b3: direct index for structure ( uniform 3-component vector of bool) +0:48 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:48 Constant: +0:48 1 (const uint) +0:48 Branch: Return with expression +0:48 Convert bool to double ( temp 3-component vector of double) +0:48 b3: direct index for structure ( uniform 3-component vector of bool) +0:48 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:48 Constant: +0:48 1 (const uint) +0:49 Function Definition: Fn_R_D3F(vd3; ( temp 3-component vector of double) +0:49 Function Parameters: +0:49 'p' ( out 3-component vector of double) +0:? Sequence +0:49 move second child to first child ( temp 3-component vector of double) +0:49 'p' ( out 3-component vector of double) +0:49 Convert float to double ( temp 3-component vector of double) +0:49 f3: direct index for structure ( uniform 3-component vector of float) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:49 Constant: +0:49 2 (const uint) +0:49 Branch: Return with expression +0:49 Convert float to double ( temp 3-component vector of double) +0:49 f3: direct index for structure ( uniform 3-component vector of float) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:49 Constant: +0:49 2 (const uint) +0:52 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:52 Function Parameters: +0:? Sequence +0:54 Sequence +0:54 move second child to first child ( temp 3-component vector of float) +0:54 'r00' ( temp 3-component vector of float) +0:54 Convert int to float ( temp 3-component vector of float) +0:54 i3: direct index for structure ( uniform 3-component vector of int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:54 Constant: +0:54 0 (const uint) +0:55 Sequence +0:55 move second child to first child ( temp 3-component vector of float) +0:55 'r01' ( temp 3-component vector of float) +0:55 Convert bool to float ( temp 3-component vector of float) +0:55 b3: direct index for structure ( uniform 3-component vector of bool) +0:55 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:55 Constant: +0:55 1 (const uint) +0:56 Sequence +0:56 move second child to first child ( temp 3-component vector of float) +0:56 'r02' ( temp 3-component vector of float) +0:56 Convert uint to float ( temp 3-component vector of float) +0:56 u3: direct index for structure ( uniform 3-component vector of uint) +0:56 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:56 Constant: +0:56 3 (const uint) +0:57 Sequence +0:57 move second child to first child ( temp 3-component vector of float) +0:57 'r03' ( temp 3-component vector of float) +0:57 Convert double to float ( temp 3-component vector of float) +0:57 d3: direct index for structure ( uniform 3-component vector of double) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:57 Constant: +0:57 4 (const uint) +0:59 Sequence +0:59 move second child to first child ( temp 3-component vector of int) +0:59 'r10' ( temp 3-component vector of int) +0:59 Convert bool to int ( temp 3-component vector of int) +0:59 b3: direct index for structure ( uniform 3-component vector of bool) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:59 Constant: +0:59 1 (const uint) +0:60 Sequence +0:60 move second child to first child ( temp 3-component vector of int) +0:60 'r11' ( temp 3-component vector of int) +0:60 Convert uint to int ( temp 3-component vector of int) +0:60 u3: direct index for structure ( uniform 3-component vector of uint) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:60 Constant: +0:60 3 (const uint) +0:61 Sequence +0:61 move second child to first child ( temp 3-component vector of int) +0:61 'r12' ( temp 3-component vector of int) +0:61 Convert float to int ( temp 3-component vector of int) +0:61 f3: direct index for structure ( uniform 3-component vector of float) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:61 Constant: +0:61 2 (const uint) +0:62 Sequence +0:62 move second child to first child ( temp 3-component vector of int) +0:62 'r13' ( temp 3-component vector of int) +0:62 Convert double to int ( temp 3-component vector of int) +0:62 d3: direct index for structure ( uniform 3-component vector of double) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:62 Constant: +0:62 4 (const uint) +0:64 Sequence +0:64 move second child to first child ( temp 3-component vector of uint) +0:64 'r20' ( temp 3-component vector of uint) +0:64 Convert bool to uint ( temp 3-component vector of uint) +0:64 b3: direct index for structure ( uniform 3-component vector of bool) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:64 Constant: +0:64 1 (const uint) +0:65 Sequence +0:65 move second child to first child ( temp 3-component vector of uint) +0:65 'r21' ( temp 3-component vector of uint) +0:65 Convert int to uint ( temp 3-component vector of uint) +0:65 i3: direct index for structure ( uniform 3-component vector of int) +0:65 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:65 Constant: +0:65 0 (const uint) +0:66 Sequence +0:66 move second child to first child ( temp 3-component vector of uint) +0:66 'r22' ( temp 3-component vector of uint) +0:66 Convert float to uint ( temp 3-component vector of uint) +0:66 f3: direct index for structure ( uniform 3-component vector of float) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:66 Constant: +0:66 2 (const uint) +0:67 Sequence +0:67 move second child to first child ( temp 3-component vector of uint) +0:67 'r23' ( temp 3-component vector of uint) +0:67 Convert double to uint ( temp 3-component vector of uint) +0:67 d3: direct index for structure ( uniform 3-component vector of double) +0:67 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:67 Constant: +0:67 4 (const uint) +0:69 Sequence +0:69 move second child to first child ( temp 3-component vector of bool) +0:69 'r30' ( temp 3-component vector of bool) +0:69 Convert int to bool ( temp 3-component vector of bool) +0:69 i3: direct index for structure ( uniform 3-component vector of int) +0:69 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:69 Constant: +0:69 0 (const uint) +0:70 Sequence +0:70 move second child to first child ( temp 3-component vector of bool) +0:70 'r31' ( temp 3-component vector of bool) +0:70 Convert uint to bool ( temp 3-component vector of bool) +0:70 u3: direct index for structure ( uniform 3-component vector of uint) +0:70 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:70 Constant: +0:70 3 (const uint) +0:71 Sequence +0:71 move second child to first child ( temp 3-component vector of bool) +0:71 'r32' ( temp 3-component vector of bool) +0:71 Convert float to bool ( temp 3-component vector of bool) +0:71 f3: direct index for structure ( uniform 3-component vector of float) +0:71 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:71 Constant: +0:71 2 (const uint) +0:72 Sequence +0:72 move second child to first child ( temp 3-component vector of bool) +0:72 'r33' ( temp 3-component vector of bool) +0:72 Convert double to bool ( temp 3-component vector of bool) +0:72 d3: direct index for structure ( uniform 3-component vector of double) +0:72 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:72 Constant: +0:72 4 (const uint) +0:74 Sequence +0:74 move second child to first child ( temp 3-component vector of double) +0:74 'r40' ( temp 3-component vector of double) +0:74 Convert int to double ( temp 3-component vector of double) +0:74 i3: direct index for structure ( uniform 3-component vector of int) +0:74 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:74 Constant: +0:74 0 (const uint) +0:75 Sequence +0:75 move second child to first child ( temp 3-component vector of double) +0:75 'r41' ( temp 3-component vector of double) +0:75 Convert uint to double ( temp 3-component vector of double) +0:75 u3: direct index for structure ( uniform 3-component vector of uint) +0:75 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:75 Constant: +0:75 3 (const uint) +0:76 Sequence +0:76 move second child to first child ( temp 3-component vector of double) +0:76 'r42' ( temp 3-component vector of double) +0:76 Convert float to double ( temp 3-component vector of double) +0:76 f3: direct index for structure ( uniform 3-component vector of float) +0:76 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:76 Constant: +0:76 2 (const uint) +0:77 Sequence +0:77 move second child to first child ( temp 3-component vector of double) +0:77 'r43' ( temp 3-component vector of double) +0:77 Convert bool to double ( temp 3-component vector of double) +0:77 b3: direct index for structure ( uniform 3-component vector of bool) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:77 Constant: +0:77 1 (const uint) +0:80 multiply second child into first child ( temp 3-component vector of float) +0:80 'r00' ( temp 3-component vector of float) +0:80 Convert int to float ( temp 3-component vector of float) +0:80 i3: direct index for structure ( uniform 3-component vector of int) +0:80 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:80 Constant: +0:80 0 (const uint) +0:81 multiply second child into first child ( temp 3-component vector of float) +0:81 'r01' ( temp 3-component vector of float) +0:81 Convert bool to float ( temp 3-component vector of float) +0:81 b3: direct index for structure ( uniform 3-component vector of bool) +0:81 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:81 Constant: +0:81 1 (const uint) +0:82 multiply second child into first child ( temp 3-component vector of float) +0:82 'r02' ( temp 3-component vector of float) +0:82 Convert uint to float ( temp 3-component vector of float) +0:82 u3: direct index for structure ( uniform 3-component vector of uint) +0:82 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:82 Constant: +0:82 3 (const uint) +0:83 multiply second child into first child ( temp 3-component vector of float) +0:83 'r03' ( temp 3-component vector of float) +0:83 Convert double to float ( temp 3-component vector of float) +0:83 d3: direct index for structure ( uniform 3-component vector of double) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:83 Constant: +0:83 4 (const uint) +0:85 multiply second child into first child ( temp 3-component vector of int) +0:85 'r10' ( temp 3-component vector of int) +0:85 Convert bool to int ( temp 3-component vector of int) +0:85 b3: direct index for structure ( uniform 3-component vector of bool) +0:85 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:85 Constant: +0:85 1 (const uint) +0:86 multiply second child into first child ( temp 3-component vector of int) +0:86 'r11' ( temp 3-component vector of int) +0:86 Convert uint to int ( temp 3-component vector of int) +0:86 u3: direct index for structure ( uniform 3-component vector of uint) +0:86 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:86 Constant: +0:86 3 (const uint) +0:87 multiply second child into first child ( temp 3-component vector of int) +0:87 'r12' ( temp 3-component vector of int) +0:87 Convert float to int ( temp 3-component vector of int) +0:87 f3: direct index for structure ( uniform 3-component vector of float) +0:87 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:87 Constant: +0:87 2 (const uint) +0:88 multiply second child into first child ( temp 3-component vector of int) +0:88 'r13' ( temp 3-component vector of int) +0:88 Convert double to int ( temp 3-component vector of int) +0:88 d3: direct index for structure ( uniform 3-component vector of double) +0:88 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:88 Constant: +0:88 4 (const uint) +0:90 multiply second child into first child ( temp 3-component vector of uint) +0:90 'r20' ( temp 3-component vector of uint) +0:90 Convert bool to uint ( temp 3-component vector of uint) +0:90 b3: direct index for structure ( uniform 3-component vector of bool) +0:90 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:90 Constant: +0:90 1 (const uint) +0:91 multiply second child into first child ( temp 3-component vector of uint) +0:91 'r21' ( temp 3-component vector of uint) +0:91 Convert int to uint ( temp 3-component vector of uint) +0:91 i3: direct index for structure ( uniform 3-component vector of int) +0:91 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:91 Constant: +0:91 0 (const uint) +0:92 multiply second child into first child ( temp 3-component vector of uint) +0:92 'r22' ( temp 3-component vector of uint) +0:92 Convert float to uint ( temp 3-component vector of uint) +0:92 f3: direct index for structure ( uniform 3-component vector of float) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:92 Constant: +0:92 2 (const uint) +0:93 multiply second child into first child ( temp 3-component vector of uint) +0:93 'r23' ( temp 3-component vector of uint) +0:93 Convert double to uint ( temp 3-component vector of uint) +0:93 d3: direct index for structure ( uniform 3-component vector of double) +0:93 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:93 Constant: +0:93 4 (const uint) +0:97 multiply second child into first child ( temp 3-component vector of double) +0:97 'r40' ( temp 3-component vector of double) +0:97 Convert int to double ( temp 3-component vector of double) +0:97 i3: direct index for structure ( uniform 3-component vector of int) +0:97 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:97 Constant: +0:97 0 (const uint) +0:98 multiply second child into first child ( temp 3-component vector of double) +0:98 'r41' ( temp 3-component vector of double) +0:98 Convert uint to double ( temp 3-component vector of double) +0:98 u3: direct index for structure ( uniform 3-component vector of uint) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:98 Constant: +0:98 3 (const uint) +0:99 multiply second child into first child ( temp 3-component vector of double) +0:99 'r42' ( temp 3-component vector of double) +0:99 Convert float to double ( temp 3-component vector of double) +0:99 f3: direct index for structure ( uniform 3-component vector of float) +0:99 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:99 Constant: +0:99 2 (const uint) +0:100 multiply second child into first child ( temp 3-component vector of double) +0:100 'r43' ( temp 3-component vector of double) +0:100 Convert bool to double ( temp 3-component vector of double) +0:100 b3: direct index for structure ( uniform 3-component vector of bool) +0:100 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:100 Constant: +0:100 1 (const uint) +0:103 vector scale second child into first child ( temp 3-component vector of float) +0:103 'r00' ( temp 3-component vector of float) +0:103 Convert int to float ( temp float) +0:103 is: direct index for structure ( uniform int) +0:103 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:103 Constant: +0:103 5 (const uint) +0:104 vector scale second child into first child ( temp 3-component vector of float) +0:104 'r01' ( temp 3-component vector of float) +0:104 Convert bool to float ( temp float) +0:104 bs: direct index for structure ( uniform bool) +0:104 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:104 Constant: +0:104 6 (const uint) +0:105 vector scale second child into first child ( temp 3-component vector of float) +0:105 'r02' ( temp 3-component vector of float) +0:105 Convert uint to float ( temp float) +0:105 us: direct index for structure ( uniform uint) +0:105 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:105 Constant: +0:105 8 (const uint) +0:106 vector scale second child into first child ( temp 3-component vector of float) +0:106 'r03' ( temp 3-component vector of float) +0:106 Convert double to float ( temp float) +0:106 ds: direct index for structure ( uniform double) +0:106 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:106 Constant: +0:106 9 (const uint) +0:108 vector scale second child into first child ( temp 3-component vector of int) +0:108 'r10' ( temp 3-component vector of int) +0:108 Convert bool to int ( temp int) +0:108 bs: direct index for structure ( uniform bool) +0:108 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:108 Constant: +0:108 6 (const uint) +0:109 vector scale second child into first child ( temp 3-component vector of int) +0:109 'r11' ( temp 3-component vector of int) +0:109 Convert uint to int ( temp int) +0:109 us: direct index for structure ( uniform uint) +0:109 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:109 Constant: +0:109 8 (const uint) +0:110 vector scale second child into first child ( temp 3-component vector of int) +0:110 'r12' ( temp 3-component vector of int) +0:110 Convert float to int ( temp int) +0:110 fs: direct index for structure ( uniform float) +0:110 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:110 Constant: +0:110 7 (const uint) +0:111 vector scale second child into first child ( temp 3-component vector of int) +0:111 'r13' ( temp 3-component vector of int) +0:111 Convert double to int ( temp int) +0:111 ds: direct index for structure ( uniform double) +0:111 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:111 Constant: +0:111 9 (const uint) +0:113 vector scale second child into first child ( temp 3-component vector of uint) +0:113 'r20' ( temp 3-component vector of uint) +0:113 Convert bool to uint ( temp uint) +0:113 bs: direct index for structure ( uniform bool) +0:113 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:113 Constant: +0:113 6 (const uint) +0:114 vector scale second child into first child ( temp 3-component vector of uint) +0:114 'r21' ( temp 3-component vector of uint) +0:114 Convert int to uint ( temp uint) +0:114 is: direct index for structure ( uniform int) +0:114 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:114 Constant: +0:114 5 (const uint) +0:115 vector scale second child into first child ( temp 3-component vector of uint) +0:115 'r22' ( temp 3-component vector of uint) +0:115 Convert float to uint ( temp uint) +0:115 fs: direct index for structure ( uniform float) +0:115 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:115 Constant: +0:115 7 (const uint) +0:116 vector scale second child into first child ( temp 3-component vector of uint) +0:116 'r23' ( temp 3-component vector of uint) +0:116 Convert double to uint ( temp uint) +0:116 ds: direct index for structure ( uniform double) +0:116 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:116 Constant: +0:116 9 (const uint) +0:120 vector scale second child into first child ( temp 3-component vector of double) +0:120 'r40' ( temp 3-component vector of double) +0:120 Convert int to double ( temp double) +0:120 is: direct index for structure ( uniform int) +0:120 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:120 Constant: +0:120 5 (const uint) +0:121 vector scale second child into first child ( temp 3-component vector of double) +0:121 'r41' ( temp 3-component vector of double) +0:121 Convert uint to double ( temp double) +0:121 us: direct index for structure ( uniform uint) +0:121 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:121 Constant: +0:121 8 (const uint) +0:122 vector scale second child into first child ( temp 3-component vector of double) +0:122 'r42' ( temp 3-component vector of double) +0:122 Convert float to double ( temp double) +0:122 fs: direct index for structure ( uniform float) +0:122 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:122 Constant: +0:122 7 (const uint) +0:123 vector scale second child into first child ( temp 3-component vector of double) +0:123 'r43' ( temp 3-component vector of double) +0:123 Convert bool to double ( temp double) +0:123 bs: direct index for structure ( uniform bool) +0:123 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:123 Constant: +0:123 6 (const uint) +0:193 Sequence +0:193 move second child to first child ( temp int) +0:193 'c1' ( temp int) +0:193 Constant: +0:193 3 (const int) +0:194 Sequence +0:194 move second child to first child ( temp int) +0:194 'c2' ( temp int) +0:194 Constant: +0:194 3 (const int) +0:196 Sequence +0:196 move second child to first child ( temp 4-component vector of float) +0:196 'outval' ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:196 Constant: +0:196 3.600000 +0:196 Constant: +0:196 3.600000 +0:196 Convert int to float ( temp float) +0:196 'c1' ( temp int) +0:196 Convert int to float ( temp float) +0:196 'c2' ( temp int) +0:199 move second child to first child ( temp 4-component vector of float) +0:199 Color: direct index for structure ( temp 4-component vector of float) +0:199 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:199 Constant: +0:199 0 (const int) +0:199 'outval' ( temp 4-component vector of float) +0:200 Branch: Return with expression +0:200 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:52 Function Definition: main( ( temp void) +0:52 Function Parameters: +0:? Sequence +0:52 Sequence +0:52 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:52 Color: direct index for structure ( temp 4-component vector of float) +0:52 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:52 Constant: +0:52 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:19 Function Definition: Fn_F3(vf3; ( temp void) +0:19 Function Parameters: +0:19 'x' ( in 3-component vector of float) +0:20 Function Definition: Fn_I3(vi3; ( temp void) +0:20 Function Parameters: +0:20 'x' ( in 3-component vector of int) +0:21 Function Definition: Fn_U3(vu3; ( temp void) +0:21 Function Parameters: +0:21 'x' ( in 3-component vector of uint) +0:22 Function Definition: Fn_B3(vb3; ( temp void) +0:22 Function Parameters: +0:22 'x' ( in 3-component vector of bool) +0:23 Function Definition: Fn_D3(vd3; ( temp void) +0:23 Function Parameters: +0:23 'x' ( in 3-component vector of double) +0:26 Function Definition: Fn_R_F3I(vf3; ( temp 3-component vector of float) +0:26 Function Parameters: +0:26 'p' ( out 3-component vector of float) +0:? Sequence +0:26 move second child to first child ( temp 3-component vector of float) +0:26 'p' ( out 3-component vector of float) +0:26 Convert int to float ( temp 3-component vector of float) +0:26 i3: direct index for structure ( uniform 3-component vector of int) +0:26 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:26 Constant: +0:26 0 (const uint) +0:26 Branch: Return with expression +0:26 Convert int to float ( temp 3-component vector of float) +0:26 i3: direct index for structure ( uniform 3-component vector of int) +0:26 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:26 Constant: +0:26 0 (const uint) +0:27 Function Definition: Fn_R_F3U(vf3; ( temp 3-component vector of float) +0:27 Function Parameters: +0:27 'p' ( out 3-component vector of float) +0:? Sequence +0:27 move second child to first child ( temp 3-component vector of float) +0:27 'p' ( out 3-component vector of float) +0:27 Convert uint to float ( temp 3-component vector of float) +0:27 u3: direct index for structure ( uniform 3-component vector of uint) +0:27 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:27 Constant: +0:27 3 (const uint) +0:27 Branch: Return with expression +0:27 Convert uint to float ( temp 3-component vector of float) +0:27 u3: direct index for structure ( uniform 3-component vector of uint) +0:27 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:27 Constant: +0:27 3 (const uint) +0:28 Function Definition: Fn_R_F3B(vf3; ( temp 3-component vector of float) +0:28 Function Parameters: +0:28 'p' ( out 3-component vector of float) +0:? Sequence +0:28 move second child to first child ( temp 3-component vector of float) +0:28 'p' ( out 3-component vector of float) +0:28 Convert bool to float ( temp 3-component vector of float) +0:28 b3: direct index for structure ( uniform 3-component vector of bool) +0:28 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:28 Constant: +0:28 1 (const uint) +0:28 Branch: Return with expression +0:28 Convert bool to float ( temp 3-component vector of float) +0:28 b3: direct index for structure ( uniform 3-component vector of bool) +0:28 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:28 Constant: +0:28 1 (const uint) +0:29 Function Definition: Fn_R_F3D(vf3; ( temp 3-component vector of float) +0:29 Function Parameters: +0:29 'p' ( out 3-component vector of float) +0:? Sequence +0:29 move second child to first child ( temp 3-component vector of float) +0:29 'p' ( out 3-component vector of float) +0:29 Convert double to float ( temp 3-component vector of float) +0:29 d3: direct index for structure ( uniform 3-component vector of double) +0:29 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:29 Constant: +0:29 4 (const uint) +0:29 Branch: Return with expression +0:29 Convert double to float ( temp 3-component vector of float) +0:29 d3: direct index for structure ( uniform 3-component vector of double) +0:29 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:29 Constant: +0:29 4 (const uint) +0:31 Function Definition: Fn_R_I3U(vi3; ( temp 3-component vector of int) +0:31 Function Parameters: +0:31 'p' ( out 3-component vector of int) +0:? Sequence +0:31 move second child to first child ( temp 3-component vector of int) +0:31 'p' ( out 3-component vector of int) +0:31 Convert uint to int ( temp 3-component vector of int) +0:31 u3: direct index for structure ( uniform 3-component vector of uint) +0:31 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:31 Constant: +0:31 3 (const uint) +0:31 Branch: Return with expression +0:31 Convert uint to int ( temp 3-component vector of int) +0:31 u3: direct index for structure ( uniform 3-component vector of uint) +0:31 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:31 Constant: +0:31 3 (const uint) +0:32 Function Definition: Fn_R_I3B(vi3; ( temp 3-component vector of int) +0:32 Function Parameters: +0:32 'p' ( out 3-component vector of int) +0:? Sequence +0:32 move second child to first child ( temp 3-component vector of int) +0:32 'p' ( out 3-component vector of int) +0:32 Convert bool to int ( temp 3-component vector of int) +0:32 b3: direct index for structure ( uniform 3-component vector of bool) +0:32 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:32 Constant: +0:32 1 (const uint) +0:32 Branch: Return with expression +0:32 Convert bool to int ( temp 3-component vector of int) +0:32 b3: direct index for structure ( uniform 3-component vector of bool) +0:32 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:32 Constant: +0:32 1 (const uint) +0:33 Function Definition: Fn_R_I3F(vi3; ( temp 3-component vector of int) +0:33 Function Parameters: +0:33 'p' ( out 3-component vector of int) +0:? Sequence +0:33 move second child to first child ( temp 3-component vector of int) +0:33 'p' ( out 3-component vector of int) +0:33 Convert float to int ( temp 3-component vector of int) +0:33 f3: direct index for structure ( uniform 3-component vector of float) +0:33 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:33 Constant: +0:33 2 (const uint) +0:33 Branch: Return with expression +0:33 Convert float to int ( temp 3-component vector of int) +0:33 f3: direct index for structure ( uniform 3-component vector of float) +0:33 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:33 Constant: +0:33 2 (const uint) +0:34 Function Definition: Fn_R_I3D(vi3; ( temp 3-component vector of int) +0:34 Function Parameters: +0:34 'p' ( out 3-component vector of int) +0:? Sequence +0:34 move second child to first child ( temp 3-component vector of int) +0:34 'p' ( out 3-component vector of int) +0:34 Convert double to int ( temp 3-component vector of int) +0:34 d3: direct index for structure ( uniform 3-component vector of double) +0:34 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:34 Constant: +0:34 4 (const uint) +0:34 Branch: Return with expression +0:34 Convert double to int ( temp 3-component vector of int) +0:34 d3: direct index for structure ( uniform 3-component vector of double) +0:34 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:34 Constant: +0:34 4 (const uint) +0:36 Function Definition: Fn_R_U3I(vu3; ( temp 3-component vector of uint) +0:36 Function Parameters: +0:36 'p' ( out 3-component vector of uint) +0:? Sequence +0:36 move second child to first child ( temp 3-component vector of uint) +0:36 'p' ( out 3-component vector of uint) +0:36 Convert int to uint ( temp 3-component vector of uint) +0:36 i3: direct index for structure ( uniform 3-component vector of int) +0:36 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:36 Constant: +0:36 0 (const uint) +0:36 Branch: Return with expression +0:36 Convert int to uint ( temp 3-component vector of uint) +0:36 i3: direct index for structure ( uniform 3-component vector of int) +0:36 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:36 Constant: +0:36 0 (const uint) +0:37 Function Definition: Fn_R_U3F(vu3; ( temp 3-component vector of uint) +0:37 Function Parameters: +0:37 'p' ( out 3-component vector of uint) +0:? Sequence +0:37 move second child to first child ( temp 3-component vector of uint) +0:37 'p' ( out 3-component vector of uint) +0:37 Convert float to uint ( temp 3-component vector of uint) +0:37 f3: direct index for structure ( uniform 3-component vector of float) +0:37 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:37 Constant: +0:37 2 (const uint) +0:37 Branch: Return with expression +0:37 Convert float to uint ( temp 3-component vector of uint) +0:37 f3: direct index for structure ( uniform 3-component vector of float) +0:37 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:37 Constant: +0:37 2 (const uint) +0:38 Function Definition: Fn_R_U3B(vu3; ( temp 3-component vector of uint) +0:38 Function Parameters: +0:38 'p' ( out 3-component vector of uint) +0:? Sequence +0:38 move second child to first child ( temp 3-component vector of uint) +0:38 'p' ( out 3-component vector of uint) +0:38 Convert bool to uint ( temp 3-component vector of uint) +0:38 b3: direct index for structure ( uniform 3-component vector of bool) +0:38 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:38 Constant: +0:38 1 (const uint) +0:38 Branch: Return with expression +0:38 Convert bool to uint ( temp 3-component vector of uint) +0:38 b3: direct index for structure ( uniform 3-component vector of bool) +0:38 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:38 Constant: +0:38 1 (const uint) +0:39 Function Definition: Fn_R_U3D(vu3; ( temp 3-component vector of uint) +0:39 Function Parameters: +0:39 'p' ( out 3-component vector of uint) +0:? Sequence +0:39 move second child to first child ( temp 3-component vector of uint) +0:39 'p' ( out 3-component vector of uint) +0:39 Convert double to uint ( temp 3-component vector of uint) +0:39 d3: direct index for structure ( uniform 3-component vector of double) +0:39 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:39 Constant: +0:39 4 (const uint) +0:39 Branch: Return with expression +0:39 Convert double to uint ( temp 3-component vector of uint) +0:39 d3: direct index for structure ( uniform 3-component vector of double) +0:39 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:39 Constant: +0:39 4 (const uint) +0:41 Function Definition: Fn_R_B3I(vb3; ( temp 3-component vector of bool) +0:41 Function Parameters: +0:41 'p' ( out 3-component vector of bool) +0:? Sequence +0:41 move second child to first child ( temp 3-component vector of bool) +0:41 'p' ( out 3-component vector of bool) +0:41 Convert int to bool ( temp 3-component vector of bool) +0:41 i3: direct index for structure ( uniform 3-component vector of int) +0:41 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:41 Constant: +0:41 0 (const uint) +0:41 Branch: Return with expression +0:41 Convert int to bool ( temp 3-component vector of bool) +0:41 i3: direct index for structure ( uniform 3-component vector of int) +0:41 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:41 Constant: +0:41 0 (const uint) +0:42 Function Definition: Fn_R_B3U(vb3; ( temp 3-component vector of bool) +0:42 Function Parameters: +0:42 'p' ( out 3-component vector of bool) +0:? Sequence +0:42 move second child to first child ( temp 3-component vector of bool) +0:42 'p' ( out 3-component vector of bool) +0:42 Convert uint to bool ( temp 3-component vector of bool) +0:42 u3: direct index for structure ( uniform 3-component vector of uint) +0:42 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:42 Constant: +0:42 3 (const uint) +0:42 Branch: Return with expression +0:42 Convert uint to bool ( temp 3-component vector of bool) +0:42 u3: direct index for structure ( uniform 3-component vector of uint) +0:42 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:42 Constant: +0:42 3 (const uint) +0:43 Function Definition: Fn_R_B3F(vb3; ( temp 3-component vector of bool) +0:43 Function Parameters: +0:43 'p' ( out 3-component vector of bool) +0:? Sequence +0:43 move second child to first child ( temp 3-component vector of bool) +0:43 'p' ( out 3-component vector of bool) +0:43 Convert float to bool ( temp 3-component vector of bool) +0:43 f3: direct index for structure ( uniform 3-component vector of float) +0:43 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:43 Constant: +0:43 2 (const uint) +0:43 Branch: Return with expression +0:43 Convert float to bool ( temp 3-component vector of bool) +0:43 f3: direct index for structure ( uniform 3-component vector of float) +0:43 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:43 Constant: +0:43 2 (const uint) +0:44 Function Definition: Fn_R_B3D(vb3; ( temp 3-component vector of bool) +0:44 Function Parameters: +0:44 'p' ( out 3-component vector of bool) +0:? Sequence +0:44 move second child to first child ( temp 3-component vector of bool) +0:44 'p' ( out 3-component vector of bool) +0:44 Convert double to bool ( temp 3-component vector of bool) +0:44 d3: direct index for structure ( uniform 3-component vector of double) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:44 Constant: +0:44 4 (const uint) +0:44 Branch: Return with expression +0:44 Convert double to bool ( temp 3-component vector of bool) +0:44 d3: direct index for structure ( uniform 3-component vector of double) +0:44 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:44 Constant: +0:44 4 (const uint) +0:46 Function Definition: Fn_R_D3I(vd3; ( temp 3-component vector of double) +0:46 Function Parameters: +0:46 'p' ( out 3-component vector of double) +0:? Sequence +0:46 move second child to first child ( temp 3-component vector of double) +0:46 'p' ( out 3-component vector of double) +0:46 Convert int to double ( temp 3-component vector of double) +0:46 i3: direct index for structure ( uniform 3-component vector of int) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:46 Constant: +0:46 0 (const uint) +0:46 Branch: Return with expression +0:46 Convert int to double ( temp 3-component vector of double) +0:46 i3: direct index for structure ( uniform 3-component vector of int) +0:46 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:46 Constant: +0:46 0 (const uint) +0:47 Function Definition: Fn_R_D3U(vd3; ( temp 3-component vector of double) +0:47 Function Parameters: +0:47 'p' ( out 3-component vector of double) +0:? Sequence +0:47 move second child to first child ( temp 3-component vector of double) +0:47 'p' ( out 3-component vector of double) +0:47 Convert uint to double ( temp 3-component vector of double) +0:47 u3: direct index for structure ( uniform 3-component vector of uint) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:47 Constant: +0:47 3 (const uint) +0:47 Branch: Return with expression +0:47 Convert uint to double ( temp 3-component vector of double) +0:47 u3: direct index for structure ( uniform 3-component vector of uint) +0:47 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:47 Constant: +0:47 3 (const uint) +0:48 Function Definition: Fn_R_D3B(vd3; ( temp 3-component vector of double) +0:48 Function Parameters: +0:48 'p' ( out 3-component vector of double) +0:? Sequence +0:48 move second child to first child ( temp 3-component vector of double) +0:48 'p' ( out 3-component vector of double) +0:48 Convert bool to double ( temp 3-component vector of double) +0:48 b3: direct index for structure ( uniform 3-component vector of bool) +0:48 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:48 Constant: +0:48 1 (const uint) +0:48 Branch: Return with expression +0:48 Convert bool to double ( temp 3-component vector of double) +0:48 b3: direct index for structure ( uniform 3-component vector of bool) +0:48 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:48 Constant: +0:48 1 (const uint) +0:49 Function Definition: Fn_R_D3F(vd3; ( temp 3-component vector of double) +0:49 Function Parameters: +0:49 'p' ( out 3-component vector of double) +0:? Sequence +0:49 move second child to first child ( temp 3-component vector of double) +0:49 'p' ( out 3-component vector of double) +0:49 Convert float to double ( temp 3-component vector of double) +0:49 f3: direct index for structure ( uniform 3-component vector of float) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:49 Constant: +0:49 2 (const uint) +0:49 Branch: Return with expression +0:49 Convert float to double ( temp 3-component vector of double) +0:49 f3: direct index for structure ( uniform 3-component vector of float) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:49 Constant: +0:49 2 (const uint) +0:52 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:52 Function Parameters: +0:? Sequence +0:54 Sequence +0:54 move second child to first child ( temp 3-component vector of float) +0:54 'r00' ( temp 3-component vector of float) +0:54 Convert int to float ( temp 3-component vector of float) +0:54 i3: direct index for structure ( uniform 3-component vector of int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:54 Constant: +0:54 0 (const uint) +0:55 Sequence +0:55 move second child to first child ( temp 3-component vector of float) +0:55 'r01' ( temp 3-component vector of float) +0:55 Convert bool to float ( temp 3-component vector of float) +0:55 b3: direct index for structure ( uniform 3-component vector of bool) +0:55 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:55 Constant: +0:55 1 (const uint) +0:56 Sequence +0:56 move second child to first child ( temp 3-component vector of float) +0:56 'r02' ( temp 3-component vector of float) +0:56 Convert uint to float ( temp 3-component vector of float) +0:56 u3: direct index for structure ( uniform 3-component vector of uint) +0:56 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:56 Constant: +0:56 3 (const uint) +0:57 Sequence +0:57 move second child to first child ( temp 3-component vector of float) +0:57 'r03' ( temp 3-component vector of float) +0:57 Convert double to float ( temp 3-component vector of float) +0:57 d3: direct index for structure ( uniform 3-component vector of double) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:57 Constant: +0:57 4 (const uint) +0:59 Sequence +0:59 move second child to first child ( temp 3-component vector of int) +0:59 'r10' ( temp 3-component vector of int) +0:59 Convert bool to int ( temp 3-component vector of int) +0:59 b3: direct index for structure ( uniform 3-component vector of bool) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:59 Constant: +0:59 1 (const uint) +0:60 Sequence +0:60 move second child to first child ( temp 3-component vector of int) +0:60 'r11' ( temp 3-component vector of int) +0:60 Convert uint to int ( temp 3-component vector of int) +0:60 u3: direct index for structure ( uniform 3-component vector of uint) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:60 Constant: +0:60 3 (const uint) +0:61 Sequence +0:61 move second child to first child ( temp 3-component vector of int) +0:61 'r12' ( temp 3-component vector of int) +0:61 Convert float to int ( temp 3-component vector of int) +0:61 f3: direct index for structure ( uniform 3-component vector of float) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:61 Constant: +0:61 2 (const uint) +0:62 Sequence +0:62 move second child to first child ( temp 3-component vector of int) +0:62 'r13' ( temp 3-component vector of int) +0:62 Convert double to int ( temp 3-component vector of int) +0:62 d3: direct index for structure ( uniform 3-component vector of double) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:62 Constant: +0:62 4 (const uint) +0:64 Sequence +0:64 move second child to first child ( temp 3-component vector of uint) +0:64 'r20' ( temp 3-component vector of uint) +0:64 Convert bool to uint ( temp 3-component vector of uint) +0:64 b3: direct index for structure ( uniform 3-component vector of bool) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:64 Constant: +0:64 1 (const uint) +0:65 Sequence +0:65 move second child to first child ( temp 3-component vector of uint) +0:65 'r21' ( temp 3-component vector of uint) +0:65 Convert int to uint ( temp 3-component vector of uint) +0:65 i3: direct index for structure ( uniform 3-component vector of int) +0:65 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:65 Constant: +0:65 0 (const uint) +0:66 Sequence +0:66 move second child to first child ( temp 3-component vector of uint) +0:66 'r22' ( temp 3-component vector of uint) +0:66 Convert float to uint ( temp 3-component vector of uint) +0:66 f3: direct index for structure ( uniform 3-component vector of float) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:66 Constant: +0:66 2 (const uint) +0:67 Sequence +0:67 move second child to first child ( temp 3-component vector of uint) +0:67 'r23' ( temp 3-component vector of uint) +0:67 Convert double to uint ( temp 3-component vector of uint) +0:67 d3: direct index for structure ( uniform 3-component vector of double) +0:67 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:67 Constant: +0:67 4 (const uint) +0:69 Sequence +0:69 move second child to first child ( temp 3-component vector of bool) +0:69 'r30' ( temp 3-component vector of bool) +0:69 Convert int to bool ( temp 3-component vector of bool) +0:69 i3: direct index for structure ( uniform 3-component vector of int) +0:69 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:69 Constant: +0:69 0 (const uint) +0:70 Sequence +0:70 move second child to first child ( temp 3-component vector of bool) +0:70 'r31' ( temp 3-component vector of bool) +0:70 Convert uint to bool ( temp 3-component vector of bool) +0:70 u3: direct index for structure ( uniform 3-component vector of uint) +0:70 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:70 Constant: +0:70 3 (const uint) +0:71 Sequence +0:71 move second child to first child ( temp 3-component vector of bool) +0:71 'r32' ( temp 3-component vector of bool) +0:71 Convert float to bool ( temp 3-component vector of bool) +0:71 f3: direct index for structure ( uniform 3-component vector of float) +0:71 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:71 Constant: +0:71 2 (const uint) +0:72 Sequence +0:72 move second child to first child ( temp 3-component vector of bool) +0:72 'r33' ( temp 3-component vector of bool) +0:72 Convert double to bool ( temp 3-component vector of bool) +0:72 d3: direct index for structure ( uniform 3-component vector of double) +0:72 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:72 Constant: +0:72 4 (const uint) +0:74 Sequence +0:74 move second child to first child ( temp 3-component vector of double) +0:74 'r40' ( temp 3-component vector of double) +0:74 Convert int to double ( temp 3-component vector of double) +0:74 i3: direct index for structure ( uniform 3-component vector of int) +0:74 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:74 Constant: +0:74 0 (const uint) +0:75 Sequence +0:75 move second child to first child ( temp 3-component vector of double) +0:75 'r41' ( temp 3-component vector of double) +0:75 Convert uint to double ( temp 3-component vector of double) +0:75 u3: direct index for structure ( uniform 3-component vector of uint) +0:75 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:75 Constant: +0:75 3 (const uint) +0:76 Sequence +0:76 move second child to first child ( temp 3-component vector of double) +0:76 'r42' ( temp 3-component vector of double) +0:76 Convert float to double ( temp 3-component vector of double) +0:76 f3: direct index for structure ( uniform 3-component vector of float) +0:76 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:76 Constant: +0:76 2 (const uint) +0:77 Sequence +0:77 move second child to first child ( temp 3-component vector of double) +0:77 'r43' ( temp 3-component vector of double) +0:77 Convert bool to double ( temp 3-component vector of double) +0:77 b3: direct index for structure ( uniform 3-component vector of bool) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:77 Constant: +0:77 1 (const uint) +0:80 multiply second child into first child ( temp 3-component vector of float) +0:80 'r00' ( temp 3-component vector of float) +0:80 Convert int to float ( temp 3-component vector of float) +0:80 i3: direct index for structure ( uniform 3-component vector of int) +0:80 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:80 Constant: +0:80 0 (const uint) +0:81 multiply second child into first child ( temp 3-component vector of float) +0:81 'r01' ( temp 3-component vector of float) +0:81 Convert bool to float ( temp 3-component vector of float) +0:81 b3: direct index for structure ( uniform 3-component vector of bool) +0:81 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:81 Constant: +0:81 1 (const uint) +0:82 multiply second child into first child ( temp 3-component vector of float) +0:82 'r02' ( temp 3-component vector of float) +0:82 Convert uint to float ( temp 3-component vector of float) +0:82 u3: direct index for structure ( uniform 3-component vector of uint) +0:82 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:82 Constant: +0:82 3 (const uint) +0:83 multiply second child into first child ( temp 3-component vector of float) +0:83 'r03' ( temp 3-component vector of float) +0:83 Convert double to float ( temp 3-component vector of float) +0:83 d3: direct index for structure ( uniform 3-component vector of double) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:83 Constant: +0:83 4 (const uint) +0:85 multiply second child into first child ( temp 3-component vector of int) +0:85 'r10' ( temp 3-component vector of int) +0:85 Convert bool to int ( temp 3-component vector of int) +0:85 b3: direct index for structure ( uniform 3-component vector of bool) +0:85 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:85 Constant: +0:85 1 (const uint) +0:86 multiply second child into first child ( temp 3-component vector of int) +0:86 'r11' ( temp 3-component vector of int) +0:86 Convert uint to int ( temp 3-component vector of int) +0:86 u3: direct index for structure ( uniform 3-component vector of uint) +0:86 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:86 Constant: +0:86 3 (const uint) +0:87 multiply second child into first child ( temp 3-component vector of int) +0:87 'r12' ( temp 3-component vector of int) +0:87 Convert float to int ( temp 3-component vector of int) +0:87 f3: direct index for structure ( uniform 3-component vector of float) +0:87 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:87 Constant: +0:87 2 (const uint) +0:88 multiply second child into first child ( temp 3-component vector of int) +0:88 'r13' ( temp 3-component vector of int) +0:88 Convert double to int ( temp 3-component vector of int) +0:88 d3: direct index for structure ( uniform 3-component vector of double) +0:88 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:88 Constant: +0:88 4 (const uint) +0:90 multiply second child into first child ( temp 3-component vector of uint) +0:90 'r20' ( temp 3-component vector of uint) +0:90 Convert bool to uint ( temp 3-component vector of uint) +0:90 b3: direct index for structure ( uniform 3-component vector of bool) +0:90 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:90 Constant: +0:90 1 (const uint) +0:91 multiply second child into first child ( temp 3-component vector of uint) +0:91 'r21' ( temp 3-component vector of uint) +0:91 Convert int to uint ( temp 3-component vector of uint) +0:91 i3: direct index for structure ( uniform 3-component vector of int) +0:91 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:91 Constant: +0:91 0 (const uint) +0:92 multiply second child into first child ( temp 3-component vector of uint) +0:92 'r22' ( temp 3-component vector of uint) +0:92 Convert float to uint ( temp 3-component vector of uint) +0:92 f3: direct index for structure ( uniform 3-component vector of float) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:92 Constant: +0:92 2 (const uint) +0:93 multiply second child into first child ( temp 3-component vector of uint) +0:93 'r23' ( temp 3-component vector of uint) +0:93 Convert double to uint ( temp 3-component vector of uint) +0:93 d3: direct index for structure ( uniform 3-component vector of double) +0:93 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:93 Constant: +0:93 4 (const uint) +0:97 multiply second child into first child ( temp 3-component vector of double) +0:97 'r40' ( temp 3-component vector of double) +0:97 Convert int to double ( temp 3-component vector of double) +0:97 i3: direct index for structure ( uniform 3-component vector of int) +0:97 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:97 Constant: +0:97 0 (const uint) +0:98 multiply second child into first child ( temp 3-component vector of double) +0:98 'r41' ( temp 3-component vector of double) +0:98 Convert uint to double ( temp 3-component vector of double) +0:98 u3: direct index for structure ( uniform 3-component vector of uint) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:98 Constant: +0:98 3 (const uint) +0:99 multiply second child into first child ( temp 3-component vector of double) +0:99 'r42' ( temp 3-component vector of double) +0:99 Convert float to double ( temp 3-component vector of double) +0:99 f3: direct index for structure ( uniform 3-component vector of float) +0:99 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:99 Constant: +0:99 2 (const uint) +0:100 multiply second child into first child ( temp 3-component vector of double) +0:100 'r43' ( temp 3-component vector of double) +0:100 Convert bool to double ( temp 3-component vector of double) +0:100 b3: direct index for structure ( uniform 3-component vector of bool) +0:100 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:100 Constant: +0:100 1 (const uint) +0:103 vector scale second child into first child ( temp 3-component vector of float) +0:103 'r00' ( temp 3-component vector of float) +0:103 Convert int to float ( temp float) +0:103 is: direct index for structure ( uniform int) +0:103 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:103 Constant: +0:103 5 (const uint) +0:104 vector scale second child into first child ( temp 3-component vector of float) +0:104 'r01' ( temp 3-component vector of float) +0:104 Convert bool to float ( temp float) +0:104 bs: direct index for structure ( uniform bool) +0:104 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:104 Constant: +0:104 6 (const uint) +0:105 vector scale second child into first child ( temp 3-component vector of float) +0:105 'r02' ( temp 3-component vector of float) +0:105 Convert uint to float ( temp float) +0:105 us: direct index for structure ( uniform uint) +0:105 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:105 Constant: +0:105 8 (const uint) +0:106 vector scale second child into first child ( temp 3-component vector of float) +0:106 'r03' ( temp 3-component vector of float) +0:106 Convert double to float ( temp float) +0:106 ds: direct index for structure ( uniform double) +0:106 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:106 Constant: +0:106 9 (const uint) +0:108 vector scale second child into first child ( temp 3-component vector of int) +0:108 'r10' ( temp 3-component vector of int) +0:108 Convert bool to int ( temp int) +0:108 bs: direct index for structure ( uniform bool) +0:108 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:108 Constant: +0:108 6 (const uint) +0:109 vector scale second child into first child ( temp 3-component vector of int) +0:109 'r11' ( temp 3-component vector of int) +0:109 Convert uint to int ( temp int) +0:109 us: direct index for structure ( uniform uint) +0:109 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:109 Constant: +0:109 8 (const uint) +0:110 vector scale second child into first child ( temp 3-component vector of int) +0:110 'r12' ( temp 3-component vector of int) +0:110 Convert float to int ( temp int) +0:110 fs: direct index for structure ( uniform float) +0:110 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:110 Constant: +0:110 7 (const uint) +0:111 vector scale second child into first child ( temp 3-component vector of int) +0:111 'r13' ( temp 3-component vector of int) +0:111 Convert double to int ( temp int) +0:111 ds: direct index for structure ( uniform double) +0:111 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:111 Constant: +0:111 9 (const uint) +0:113 vector scale second child into first child ( temp 3-component vector of uint) +0:113 'r20' ( temp 3-component vector of uint) +0:113 Convert bool to uint ( temp uint) +0:113 bs: direct index for structure ( uniform bool) +0:113 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:113 Constant: +0:113 6 (const uint) +0:114 vector scale second child into first child ( temp 3-component vector of uint) +0:114 'r21' ( temp 3-component vector of uint) +0:114 Convert int to uint ( temp uint) +0:114 is: direct index for structure ( uniform int) +0:114 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:114 Constant: +0:114 5 (const uint) +0:115 vector scale second child into first child ( temp 3-component vector of uint) +0:115 'r22' ( temp 3-component vector of uint) +0:115 Convert float to uint ( temp uint) +0:115 fs: direct index for structure ( uniform float) +0:115 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:115 Constant: +0:115 7 (const uint) +0:116 vector scale second child into first child ( temp 3-component vector of uint) +0:116 'r23' ( temp 3-component vector of uint) +0:116 Convert double to uint ( temp uint) +0:116 ds: direct index for structure ( uniform double) +0:116 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:116 Constant: +0:116 9 (const uint) +0:120 vector scale second child into first child ( temp 3-component vector of double) +0:120 'r40' ( temp 3-component vector of double) +0:120 Convert int to double ( temp double) +0:120 is: direct index for structure ( uniform int) +0:120 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:120 Constant: +0:120 5 (const uint) +0:121 vector scale second child into first child ( temp 3-component vector of double) +0:121 'r41' ( temp 3-component vector of double) +0:121 Convert uint to double ( temp double) +0:121 us: direct index for structure ( uniform uint) +0:121 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:121 Constant: +0:121 8 (const uint) +0:122 vector scale second child into first child ( temp 3-component vector of double) +0:122 'r42' ( temp 3-component vector of double) +0:122 Convert float to double ( temp double) +0:122 fs: direct index for structure ( uniform float) +0:122 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:122 Constant: +0:122 7 (const uint) +0:123 vector scale second child into first child ( temp 3-component vector of double) +0:123 'r43' ( temp 3-component vector of double) +0:123 Convert bool to double ( temp double) +0:123 bs: direct index for structure ( uniform bool) +0:123 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:123 Constant: +0:123 6 (const uint) +0:193 Sequence +0:193 move second child to first child ( temp int) +0:193 'c1' ( temp int) +0:193 Constant: +0:193 3 (const int) +0:194 Sequence +0:194 move second child to first child ( temp int) +0:194 'c2' ( temp int) +0:194 Constant: +0:194 3 (const int) +0:196 Sequence +0:196 move second child to first child ( temp 4-component vector of float) +0:196 'outval' ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:196 Constant: +0:196 3.600000 +0:196 Constant: +0:196 3.600000 +0:196 Convert int to float ( temp float) +0:196 'c1' ( temp int) +0:196 Convert int to float ( temp float) +0:196 'c2' ( temp int) +0:199 move second child to first child ( temp 4-component vector of float) +0:199 Color: direct index for structure ( temp 4-component vector of float) +0:199 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:199 Constant: +0:199 0 (const int) +0:199 'outval' ( temp 4-component vector of float) +0:200 Branch: Return with expression +0:200 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:52 Function Definition: main( ( temp void) +0:52 Function Parameters: +0:? Sequence +0:52 Sequence +0:52 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:52 Color: direct index for structure ( temp 4-component vector of float) +0:52 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:52 Constant: +0:52 0 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 3-component vector of int i3, uniform 3-component vector of bool b3, uniform 3-component vector of float f3, uniform 3-component vector of uint u3, uniform 3-component vector of double d3, uniform int is, uniform bool bs, uniform float fs, uniform uint us, uniform double ds}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 596 + + Capability Shader + Capability Float64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 593 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "Fn_F3(vf3;" + Name 10 "x" + Name 18 "Fn_I3(vi3;" + Name 17 "x" + Name 25 "Fn_U3(vu3;" + Name 24 "x" + Name 32 "Fn_B3(vb3;" + Name 31 "x" + Name 39 "Fn_D3(vd3;" + Name 38 "x" + Name 43 "Fn_R_F3I(vf3;" + Name 42 "p" + Name 46 "Fn_R_F3U(vf3;" + Name 45 "p" + Name 49 "Fn_R_F3B(vf3;" + Name 48 "p" + Name 52 "Fn_R_F3D(vf3;" + Name 51 "p" + Name 56 "Fn_R_I3U(vi3;" + Name 55 "p" + Name 59 "Fn_R_I3B(vi3;" + Name 58 "p" + Name 62 "Fn_R_I3F(vi3;" + Name 61 "p" + Name 65 "Fn_R_I3D(vi3;" + Name 64 "p" + Name 69 "Fn_R_U3I(vu3;" + Name 68 "p" + Name 72 "Fn_R_U3F(vu3;" + Name 71 "p" + Name 75 "Fn_R_U3B(vu3;" + Name 74 "p" + Name 78 "Fn_R_U3D(vu3;" + Name 77 "p" + Name 82 "Fn_R_B3I(vb3;" + Name 81 "p" + Name 85 "Fn_R_B3U(vb3;" + Name 84 "p" + Name 88 "Fn_R_B3F(vb3;" + Name 87 "p" + Name 91 "Fn_R_B3D(vb3;" + Name 90 "p" + Name 95 "Fn_R_D3I(vd3;" + Name 94 "p" + Name 98 "Fn_R_D3U(vd3;" + Name 97 "p" + Name 101 "Fn_R_D3B(vd3;" + Name 100 "p" + Name 104 "Fn_R_D3F(vd3;" + Name 103 "p" + Name 107 "PS_OUTPUT" + MemberName 107(PS_OUTPUT) 0 "Color" + Name 109 "@main(" + Name 111 "$Global" + MemberName 111($Global) 0 "i3" + MemberName 111($Global) 1 "b3" + MemberName 111($Global) 2 "f3" + MemberName 111($Global) 3 "u3" + MemberName 111($Global) 4 "d3" + MemberName 111($Global) 5 "is" + MemberName 111($Global) 6 "bs" + MemberName 111($Global) 7 "fs" + MemberName 111($Global) 8 "us" + MemberName 111($Global) 9 "ds" + Name 113 "" + Name 305 "r00" + Name 309 "r01" + Name 314 "r02" + Name 318 "r03" + Name 322 "r10" + Name 327 "r11" + Name 331 "r12" + Name 335 "r13" + Name 339 "r20" + Name 344 "r21" + Name 348 "r22" + Name 352 "r23" + Name 356 "r30" + Name 360 "r31" + Name 364 "r32" + Name 368 "r33" + Name 372 "r40" + Name 376 "r41" + Name 380 "r42" + Name 384 "r43" + Name 575 "c1" + Name 576 "c2" + Name 578 "outval" + Name 586 "psout" + Name 593 "@entryPointOutput.Color" + MemberDecorate 111($Global) 0 Offset 0 + MemberDecorate 111($Global) 1 Offset 16 + MemberDecorate 111($Global) 2 Offset 32 + MemberDecorate 111($Global) 3 Offset 48 + MemberDecorate 111($Global) 4 Offset 64 + MemberDecorate 111($Global) 5 Offset 88 + MemberDecorate 111($Global) 6 Offset 92 + MemberDecorate 111($Global) 7 Offset 96 + MemberDecorate 111($Global) 8 Offset 100 + MemberDecorate 111($Global) 9 Offset 104 + Decorate 111($Global) Block + Decorate 113 DescriptorSet 0 + Decorate 593(@entryPointOutput.Color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8: TypePointer Function 7(fvec3) + 9: TypeFunction 2 8(ptr) + 13: TypeInt 32 1 + 14: TypeVector 13(int) 3 + 15: TypePointer Function 14(ivec3) + 16: TypeFunction 2 15(ptr) + 20: TypeInt 32 0 + 21: TypeVector 20(int) 3 + 22: TypePointer Function 21(ivec3) + 23: TypeFunction 2 22(ptr) + 27: TypeBool + 28: TypeVector 27(bool) 3 + 29: TypePointer Function 28(bvec3) + 30: TypeFunction 2 29(ptr) + 34: TypeFloat 64 + 35: TypeVector 34(float64_t) 3 + 36: TypePointer Function 35(f64vec3) + 37: TypeFunction 2 36(ptr) + 41: TypeFunction 7(fvec3) 8(ptr) + 54: TypeFunction 14(ivec3) 15(ptr) + 67: TypeFunction 21(ivec3) 22(ptr) + 80: TypeFunction 28(bvec3) 29(ptr) + 93: TypeFunction 35(f64vec3) 36(ptr) + 106: TypeVector 6(float) 4 + 107(PS_OUTPUT): TypeStruct 106(fvec4) + 108: TypeFunction 107(PS_OUTPUT) + 111($Global): TypeStruct 14(ivec3) 21(ivec3) 7(fvec3) 21(ivec3) 35(f64vec3) 13(int) 20(int) 6(float) 20(int) 34(float64_t) + 112: TypePointer Uniform 111($Global) + 113: 112(ptr) Variable Uniform + 114: 13(int) Constant 0 + 115: TypePointer Uniform 14(ivec3) + 124: 13(int) Constant 3 + 125: TypePointer Uniform 21(ivec3) + 134: 13(int) Constant 1 + 137: 20(int) Constant 0 + 138: 21(ivec3) ConstantComposite 137 137 137 + 140: 6(float) Constant 0 + 141: 6(float) Constant 1065353216 + 142: 7(fvec3) ConstantComposite 140 140 140 + 143: 7(fvec3) ConstantComposite 141 141 141 + 151: 13(int) Constant 4 + 152: TypePointer Uniform 35(f64vec3) + 172: 14(ivec3) ConstantComposite 114 114 114 + 173: 14(ivec3) ConstantComposite 134 134 134 + 181: 13(int) Constant 2 + 182: TypePointer Uniform 7(fvec3) + 218: 20(int) Constant 1 + 219: 21(ivec3) ConstantComposite 218 218 218 + 261:34(float64_t) Constant 0 0 + 262: 35(f64vec3) ConstantComposite 261 261 261 + 288:34(float64_t) Constant 0 1072693248 + 289: 35(f64vec3) ConstantComposite 288 288 288 + 473: 13(int) Constant 5 + 474: TypePointer Uniform 13(int) + 480: 13(int) Constant 6 + 481: TypePointer Uniform 20(int) + 488: 13(int) Constant 8 + 494: 13(int) Constant 9 + 495: TypePointer Uniform 34(float64_t) + 514: 13(int) Constant 7 + 515: TypePointer Uniform 6(float) + 574: TypePointer Function 13(int) + 577: TypePointer Function 106(fvec4) + 579: 6(float) Constant 1080452710 + 585: TypePointer Function 107(PS_OUTPUT) + 592: TypePointer Output 106(fvec4) +593(@entryPointOutput.Color): 592(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 594:107(PS_OUTPUT) FunctionCall 109(@main() + 595: 106(fvec4) CompositeExtract 594 0 + Store 593(@entryPointOutput.Color) 595 + Return + FunctionEnd + 11(Fn_F3(vf3;): 2 Function None 9 + 10(x): 8(ptr) FunctionParameter + 12: Label + Return + FunctionEnd + 18(Fn_I3(vi3;): 2 Function None 16 + 17(x): 15(ptr) FunctionParameter + 19: Label + Return + FunctionEnd + 25(Fn_U3(vu3;): 2 Function None 23 + 24(x): 22(ptr) FunctionParameter + 26: Label + Return + FunctionEnd + 32(Fn_B3(vb3;): 2 Function None 30 + 31(x): 29(ptr) FunctionParameter + 33: Label + Return + FunctionEnd + 39(Fn_D3(vd3;): 2 Function None 37 + 38(x): 36(ptr) FunctionParameter + 40: Label + Return + FunctionEnd +43(Fn_R_F3I(vf3;): 7(fvec3) Function None 41 + 42(p): 8(ptr) FunctionParameter + 44: Label + 116: 115(ptr) AccessChain 113 114 + 117: 14(ivec3) Load 116 + 118: 7(fvec3) ConvertSToF 117 + Store 42(p) 118 + 119: 115(ptr) AccessChain 113 114 + 120: 14(ivec3) Load 119 + 121: 7(fvec3) ConvertSToF 120 + ReturnValue 121 + FunctionEnd +46(Fn_R_F3U(vf3;): 7(fvec3) Function None 41 + 45(p): 8(ptr) FunctionParameter + 47: Label + 126: 125(ptr) AccessChain 113 124 + 127: 21(ivec3) Load 126 + 128: 7(fvec3) ConvertUToF 127 + Store 45(p) 128 + 129: 125(ptr) AccessChain 113 124 + 130: 21(ivec3) Load 129 + 131: 7(fvec3) ConvertUToF 130 + ReturnValue 131 + FunctionEnd +49(Fn_R_F3B(vf3;): 7(fvec3) Function None 41 + 48(p): 8(ptr) FunctionParameter + 50: Label + 135: 125(ptr) AccessChain 113 134 + 136: 21(ivec3) Load 135 + 139: 28(bvec3) INotEqual 136 138 + 144: 7(fvec3) Select 139 143 142 + Store 48(p) 144 + 145: 125(ptr) AccessChain 113 134 + 146: 21(ivec3) Load 145 + 147: 28(bvec3) INotEqual 146 138 + 148: 7(fvec3) Select 147 143 142 + ReturnValue 148 + FunctionEnd +52(Fn_R_F3D(vf3;): 7(fvec3) Function None 41 + 51(p): 8(ptr) FunctionParameter + 53: Label + 153: 152(ptr) AccessChain 113 151 + 154: 35(f64vec3) Load 153 + 155: 7(fvec3) FConvert 154 + Store 51(p) 155 + 156: 152(ptr) AccessChain 113 151 + 157: 35(f64vec3) Load 156 + 158: 7(fvec3) FConvert 157 + ReturnValue 158 + FunctionEnd +56(Fn_R_I3U(vi3;): 14(ivec3) Function None 54 + 55(p): 15(ptr) FunctionParameter + 57: Label + 161: 125(ptr) AccessChain 113 124 + 162: 21(ivec3) Load 161 + 163: 14(ivec3) Bitcast 162 + Store 55(p) 163 + 164: 125(ptr) AccessChain 113 124 + 165: 21(ivec3) Load 164 + 166: 14(ivec3) Bitcast 165 + ReturnValue 166 + FunctionEnd +59(Fn_R_I3B(vi3;): 14(ivec3) Function None 54 + 58(p): 15(ptr) FunctionParameter + 60: Label + 169: 125(ptr) AccessChain 113 134 + 170: 21(ivec3) Load 169 + 171: 28(bvec3) INotEqual 170 138 + 174: 14(ivec3) Select 171 173 172 + Store 58(p) 174 + 175: 125(ptr) AccessChain 113 134 + 176: 21(ivec3) Load 175 + 177: 28(bvec3) INotEqual 176 138 + 178: 14(ivec3) Select 177 173 172 + ReturnValue 178 + FunctionEnd +62(Fn_R_I3F(vi3;): 14(ivec3) Function None 54 + 61(p): 15(ptr) FunctionParameter + 63: Label + 183: 182(ptr) AccessChain 113 181 + 184: 7(fvec3) Load 183 + 185: 14(ivec3) ConvertFToS 184 + Store 61(p) 185 + 186: 182(ptr) AccessChain 113 181 + 187: 7(fvec3) Load 186 + 188: 14(ivec3) ConvertFToS 187 + ReturnValue 188 + FunctionEnd +65(Fn_R_I3D(vi3;): 14(ivec3) Function None 54 + 64(p): 15(ptr) FunctionParameter + 66: Label + 191: 152(ptr) AccessChain 113 151 + 192: 35(f64vec3) Load 191 + 193: 14(ivec3) ConvertFToS 192 + Store 64(p) 193 + 194: 152(ptr) AccessChain 113 151 + 195: 35(f64vec3) Load 194 + 196: 14(ivec3) ConvertFToS 195 + ReturnValue 196 + FunctionEnd +69(Fn_R_U3I(vu3;): 21(ivec3) Function None 67 + 68(p): 22(ptr) FunctionParameter + 70: Label + 199: 115(ptr) AccessChain 113 114 + 200: 14(ivec3) Load 199 + 201: 21(ivec3) Bitcast 200 + Store 68(p) 201 + 202: 115(ptr) AccessChain 113 114 + 203: 14(ivec3) Load 202 + 204: 21(ivec3) Bitcast 203 + ReturnValue 204 + FunctionEnd +72(Fn_R_U3F(vu3;): 21(ivec3) Function None 67 + 71(p): 22(ptr) FunctionParameter + 73: Label + 207: 182(ptr) AccessChain 113 181 + 208: 7(fvec3) Load 207 + 209: 21(ivec3) ConvertFToU 208 + Store 71(p) 209 + 210: 182(ptr) AccessChain 113 181 + 211: 7(fvec3) Load 210 + 212: 21(ivec3) ConvertFToU 211 + ReturnValue 212 + FunctionEnd +75(Fn_R_U3B(vu3;): 21(ivec3) Function None 67 + 74(p): 22(ptr) FunctionParameter + 76: Label + 215: 125(ptr) AccessChain 113 134 + 216: 21(ivec3) Load 215 + 217: 28(bvec3) INotEqual 216 138 + 220: 21(ivec3) Select 217 219 138 + Store 74(p) 220 + 221: 125(ptr) AccessChain 113 134 + 222: 21(ivec3) Load 221 + 223: 28(bvec3) INotEqual 222 138 + 224: 21(ivec3) Select 223 219 138 + ReturnValue 224 + FunctionEnd +78(Fn_R_U3D(vu3;): 21(ivec3) Function None 67 + 77(p): 22(ptr) FunctionParameter + 79: Label + 227: 152(ptr) AccessChain 113 151 + 228: 35(f64vec3) Load 227 + 229: 21(ivec3) ConvertFToU 228 + Store 77(p) 229 + 230: 152(ptr) AccessChain 113 151 + 231: 35(f64vec3) Load 230 + 232: 21(ivec3) ConvertFToU 231 + ReturnValue 232 + FunctionEnd +82(Fn_R_B3I(vb3;): 28(bvec3) Function None 80 + 81(p): 29(ptr) FunctionParameter + 83: Label + 235: 115(ptr) AccessChain 113 114 + 236: 14(ivec3) Load 235 + 237: 28(bvec3) INotEqual 236 138 + Store 81(p) 237 + 238: 115(ptr) AccessChain 113 114 + 239: 14(ivec3) Load 238 + 240: 28(bvec3) INotEqual 239 138 + ReturnValue 240 + FunctionEnd +85(Fn_R_B3U(vb3;): 28(bvec3) Function None 80 + 84(p): 29(ptr) FunctionParameter + 86: Label + 243: 125(ptr) AccessChain 113 124 + 244: 21(ivec3) Load 243 + 245: 28(bvec3) INotEqual 244 138 + Store 84(p) 245 + 246: 125(ptr) AccessChain 113 124 + 247: 21(ivec3) Load 246 + 248: 28(bvec3) INotEqual 247 138 + ReturnValue 248 + FunctionEnd +88(Fn_R_B3F(vb3;): 28(bvec3) Function None 80 + 87(p): 29(ptr) FunctionParameter + 89: Label + 251: 182(ptr) AccessChain 113 181 + 252: 7(fvec3) Load 251 + 253: 28(bvec3) FOrdNotEqual 252 142 + Store 87(p) 253 + 254: 182(ptr) AccessChain 113 181 + 255: 7(fvec3) Load 254 + 256: 28(bvec3) FOrdNotEqual 255 142 + ReturnValue 256 + FunctionEnd +91(Fn_R_B3D(vb3;): 28(bvec3) Function None 80 + 90(p): 29(ptr) FunctionParameter + 92: Label + 259: 152(ptr) AccessChain 113 151 + 260: 35(f64vec3) Load 259 + 263: 28(bvec3) FOrdNotEqual 260 262 + Store 90(p) 263 + 264: 152(ptr) AccessChain 113 151 + 265: 35(f64vec3) Load 264 + 266: 28(bvec3) FOrdNotEqual 265 262 + ReturnValue 266 + FunctionEnd +95(Fn_R_D3I(vd3;): 35(f64vec3) Function None 93 + 94(p): 36(ptr) FunctionParameter + 96: Label + 269: 115(ptr) AccessChain 113 114 + 270: 14(ivec3) Load 269 + 271: 35(f64vec3) ConvertSToF 270 + Store 94(p) 271 + 272: 115(ptr) AccessChain 113 114 + 273: 14(ivec3) Load 272 + 274: 35(f64vec3) ConvertSToF 273 + ReturnValue 274 + FunctionEnd +98(Fn_R_D3U(vd3;): 35(f64vec3) Function None 93 + 97(p): 36(ptr) FunctionParameter + 99: Label + 277: 125(ptr) AccessChain 113 124 + 278: 21(ivec3) Load 277 + 279: 35(f64vec3) ConvertUToF 278 + Store 97(p) 279 + 280: 125(ptr) AccessChain 113 124 + 281: 21(ivec3) Load 280 + 282: 35(f64vec3) ConvertUToF 281 + ReturnValue 282 + FunctionEnd +101(Fn_R_D3B(vd3;): 35(f64vec3) Function None 93 + 100(p): 36(ptr) FunctionParameter + 102: Label + 285: 125(ptr) AccessChain 113 134 + 286: 21(ivec3) Load 285 + 287: 28(bvec3) INotEqual 286 138 + 290: 35(f64vec3) Select 287 289 262 + Store 100(p) 290 + 291: 125(ptr) AccessChain 113 134 + 292: 21(ivec3) Load 291 + 293: 28(bvec3) INotEqual 292 138 + 294: 35(f64vec3) Select 293 289 262 + ReturnValue 294 + FunctionEnd +104(Fn_R_D3F(vd3;): 35(f64vec3) Function None 93 + 103(p): 36(ptr) FunctionParameter + 105: Label + 297: 182(ptr) AccessChain 113 181 + 298: 7(fvec3) Load 297 + 299: 35(f64vec3) FConvert 298 + Store 103(p) 299 + 300: 182(ptr) AccessChain 113 181 + 301: 7(fvec3) Load 300 + 302: 35(f64vec3) FConvert 301 + ReturnValue 302 + FunctionEnd + 109(@main():107(PS_OUTPUT) Function None 108 + 110: Label + 305(r00): 8(ptr) Variable Function + 309(r01): 8(ptr) Variable Function + 314(r02): 8(ptr) Variable Function + 318(r03): 8(ptr) Variable Function + 322(r10): 15(ptr) Variable Function + 327(r11): 15(ptr) Variable Function + 331(r12): 15(ptr) Variable Function + 335(r13): 15(ptr) Variable Function + 339(r20): 22(ptr) Variable Function + 344(r21): 22(ptr) Variable Function + 348(r22): 22(ptr) Variable Function + 352(r23): 22(ptr) Variable Function + 356(r30): 29(ptr) Variable Function + 360(r31): 29(ptr) Variable Function + 364(r32): 29(ptr) Variable Function + 368(r33): 29(ptr) Variable Function + 372(r40): 36(ptr) Variable Function + 376(r41): 36(ptr) Variable Function + 380(r42): 36(ptr) Variable Function + 384(r43): 36(ptr) Variable Function + 575(c1): 574(ptr) Variable Function + 576(c2): 574(ptr) Variable Function + 578(outval): 577(ptr) Variable Function + 586(psout): 585(ptr) Variable Function + 306: 115(ptr) AccessChain 113 114 + 307: 14(ivec3) Load 306 + 308: 7(fvec3) ConvertSToF 307 + Store 305(r00) 308 + 310: 125(ptr) AccessChain 113 134 + 311: 21(ivec3) Load 310 + 312: 28(bvec3) INotEqual 311 138 + 313: 7(fvec3) Select 312 143 142 + Store 309(r01) 313 + 315: 125(ptr) AccessChain 113 124 + 316: 21(ivec3) Load 315 + 317: 7(fvec3) ConvertUToF 316 + Store 314(r02) 317 + 319: 152(ptr) AccessChain 113 151 + 320: 35(f64vec3) Load 319 + 321: 7(fvec3) FConvert 320 + Store 318(r03) 321 + 323: 125(ptr) AccessChain 113 134 + 324: 21(ivec3) Load 323 + 325: 28(bvec3) INotEqual 324 138 + 326: 14(ivec3) Select 325 173 172 + Store 322(r10) 326 + 328: 125(ptr) AccessChain 113 124 + 329: 21(ivec3) Load 328 + 330: 14(ivec3) Bitcast 329 + Store 327(r11) 330 + 332: 182(ptr) AccessChain 113 181 + 333: 7(fvec3) Load 332 + 334: 14(ivec3) ConvertFToS 333 + Store 331(r12) 334 + 336: 152(ptr) AccessChain 113 151 + 337: 35(f64vec3) Load 336 + 338: 14(ivec3) ConvertFToS 337 + Store 335(r13) 338 + 340: 125(ptr) AccessChain 113 134 + 341: 21(ivec3) Load 340 + 342: 28(bvec3) INotEqual 341 138 + 343: 21(ivec3) Select 342 219 138 + Store 339(r20) 343 + 345: 115(ptr) AccessChain 113 114 + 346: 14(ivec3) Load 345 + 347: 21(ivec3) Bitcast 346 + Store 344(r21) 347 + 349: 182(ptr) AccessChain 113 181 + 350: 7(fvec3) Load 349 + 351: 21(ivec3) ConvertFToU 350 + Store 348(r22) 351 + 353: 152(ptr) AccessChain 113 151 + 354: 35(f64vec3) Load 353 + 355: 21(ivec3) ConvertFToU 354 + Store 352(r23) 355 + 357: 115(ptr) AccessChain 113 114 + 358: 14(ivec3) Load 357 + 359: 28(bvec3) INotEqual 358 138 + Store 356(r30) 359 + 361: 125(ptr) AccessChain 113 124 + 362: 21(ivec3) Load 361 + 363: 28(bvec3) INotEqual 362 138 + Store 360(r31) 363 + 365: 182(ptr) AccessChain 113 181 + 366: 7(fvec3) Load 365 + 367: 28(bvec3) FOrdNotEqual 366 142 + Store 364(r32) 367 + 369: 152(ptr) AccessChain 113 151 + 370: 35(f64vec3) Load 369 + 371: 28(bvec3) FOrdNotEqual 370 262 + Store 368(r33) 371 + 373: 115(ptr) AccessChain 113 114 + 374: 14(ivec3) Load 373 + 375: 35(f64vec3) ConvertSToF 374 + Store 372(r40) 375 + 377: 125(ptr) AccessChain 113 124 + 378: 21(ivec3) Load 377 + 379: 35(f64vec3) ConvertUToF 378 + Store 376(r41) 379 + 381: 182(ptr) AccessChain 113 181 + 382: 7(fvec3) Load 381 + 383: 35(f64vec3) FConvert 382 + Store 380(r42) 383 + 385: 125(ptr) AccessChain 113 134 + 386: 21(ivec3) Load 385 + 387: 28(bvec3) INotEqual 386 138 + 388: 35(f64vec3) Select 387 289 262 + Store 384(r43) 388 + 389: 115(ptr) AccessChain 113 114 + 390: 14(ivec3) Load 389 + 391: 7(fvec3) ConvertSToF 390 + 392: 7(fvec3) Load 305(r00) + 393: 7(fvec3) FMul 392 391 + Store 305(r00) 393 + 394: 125(ptr) AccessChain 113 134 + 395: 21(ivec3) Load 394 + 396: 28(bvec3) INotEqual 395 138 + 397: 7(fvec3) Select 396 143 142 + 398: 7(fvec3) Load 309(r01) + 399: 7(fvec3) FMul 398 397 + Store 309(r01) 399 + 400: 125(ptr) AccessChain 113 124 + 401: 21(ivec3) Load 400 + 402: 7(fvec3) ConvertUToF 401 + 403: 7(fvec3) Load 314(r02) + 404: 7(fvec3) FMul 403 402 + Store 314(r02) 404 + 405: 152(ptr) AccessChain 113 151 + 406: 35(f64vec3) Load 405 + 407: 7(fvec3) FConvert 406 + 408: 7(fvec3) Load 318(r03) + 409: 7(fvec3) FMul 408 407 + Store 318(r03) 409 + 410: 125(ptr) AccessChain 113 134 + 411: 21(ivec3) Load 410 + 412: 28(bvec3) INotEqual 411 138 + 413: 14(ivec3) Select 412 173 172 + 414: 14(ivec3) Load 322(r10) + 415: 14(ivec3) IMul 414 413 + Store 322(r10) 415 + 416: 125(ptr) AccessChain 113 124 + 417: 21(ivec3) Load 416 + 418: 14(ivec3) Bitcast 417 + 419: 14(ivec3) Load 327(r11) + 420: 14(ivec3) IMul 419 418 + Store 327(r11) 420 + 421: 182(ptr) AccessChain 113 181 + 422: 7(fvec3) Load 421 + 423: 14(ivec3) ConvertFToS 422 + 424: 14(ivec3) Load 331(r12) + 425: 14(ivec3) IMul 424 423 + Store 331(r12) 425 + 426: 152(ptr) AccessChain 113 151 + 427: 35(f64vec3) Load 426 + 428: 14(ivec3) ConvertFToS 427 + 429: 14(ivec3) Load 335(r13) + 430: 14(ivec3) IMul 429 428 + Store 335(r13) 430 + 431: 125(ptr) AccessChain 113 134 + 432: 21(ivec3) Load 431 + 433: 28(bvec3) INotEqual 432 138 + 434: 21(ivec3) Select 433 219 138 + 435: 21(ivec3) Load 339(r20) + 436: 21(ivec3) IMul 435 434 + Store 339(r20) 436 + 437: 115(ptr) AccessChain 113 114 + 438: 14(ivec3) Load 437 + 439: 21(ivec3) Bitcast 438 + 440: 21(ivec3) Load 344(r21) + 441: 21(ivec3) IMul 440 439 + Store 344(r21) 441 + 442: 182(ptr) AccessChain 113 181 + 443: 7(fvec3) Load 442 + 444: 21(ivec3) ConvertFToU 443 + 445: 21(ivec3) Load 348(r22) + 446: 21(ivec3) IMul 445 444 + Store 348(r22) 446 + 447: 152(ptr) AccessChain 113 151 + 448: 35(f64vec3) Load 447 + 449: 21(ivec3) ConvertFToU 448 + 450: 21(ivec3) Load 352(r23) + 451: 21(ivec3) IMul 450 449 + Store 352(r23) 451 + 452: 115(ptr) AccessChain 113 114 + 453: 14(ivec3) Load 452 + 454: 35(f64vec3) ConvertSToF 453 + 455: 35(f64vec3) Load 372(r40) + 456: 35(f64vec3) FMul 455 454 + Store 372(r40) 456 + 457: 125(ptr) AccessChain 113 124 + 458: 21(ivec3) Load 457 + 459: 35(f64vec3) ConvertUToF 458 + 460: 35(f64vec3) Load 376(r41) + 461: 35(f64vec3) FMul 460 459 + Store 376(r41) 461 + 462: 182(ptr) AccessChain 113 181 + 463: 7(fvec3) Load 462 + 464: 35(f64vec3) FConvert 463 + 465: 35(f64vec3) Load 380(r42) + 466: 35(f64vec3) FMul 465 464 + Store 380(r42) 466 + 467: 125(ptr) AccessChain 113 134 + 468: 21(ivec3) Load 467 + 469: 28(bvec3) INotEqual 468 138 + 470: 35(f64vec3) Select 469 289 262 + 471: 35(f64vec3) Load 384(r43) + 472: 35(f64vec3) FMul 471 470 + Store 384(r43) 472 + 475: 474(ptr) AccessChain 113 473 + 476: 13(int) Load 475 + 477: 6(float) ConvertSToF 476 + 478: 7(fvec3) Load 305(r00) + 479: 7(fvec3) VectorTimesScalar 478 477 + Store 305(r00) 479 + 482: 481(ptr) AccessChain 113 480 + 483: 20(int) Load 482 + 484: 27(bool) INotEqual 483 137 + 485: 6(float) Select 484 141 140 + 486: 7(fvec3) Load 309(r01) + 487: 7(fvec3) VectorTimesScalar 486 485 + Store 309(r01) 487 + 489: 481(ptr) AccessChain 113 488 + 490: 20(int) Load 489 + 491: 6(float) ConvertUToF 490 + 492: 7(fvec3) Load 314(r02) + 493: 7(fvec3) VectorTimesScalar 492 491 + Store 314(r02) 493 + 496: 495(ptr) AccessChain 113 494 + 497:34(float64_t) Load 496 + 498: 6(float) FConvert 497 + 499: 7(fvec3) Load 318(r03) + 500: 7(fvec3) VectorTimesScalar 499 498 + Store 318(r03) 500 + 501: 481(ptr) AccessChain 113 480 + 502: 20(int) Load 501 + 503: 27(bool) INotEqual 502 137 + 504: 13(int) Select 503 134 114 + 505: 14(ivec3) Load 322(r10) + 506: 14(ivec3) CompositeConstruct 504 504 504 + 507: 14(ivec3) IMul 505 506 + Store 322(r10) 507 + 508: 481(ptr) AccessChain 113 488 + 509: 20(int) Load 508 + 510: 13(int) Bitcast 509 + 511: 14(ivec3) Load 327(r11) + 512: 14(ivec3) CompositeConstruct 510 510 510 + 513: 14(ivec3) IMul 511 512 + Store 327(r11) 513 + 516: 515(ptr) AccessChain 113 514 + 517: 6(float) Load 516 + 518: 13(int) ConvertFToS 517 + 519: 14(ivec3) Load 331(r12) + 520: 14(ivec3) CompositeConstruct 518 518 518 + 521: 14(ivec3) IMul 519 520 + Store 331(r12) 521 + 522: 495(ptr) AccessChain 113 494 + 523:34(float64_t) Load 522 + 524: 13(int) ConvertFToS 523 + 525: 14(ivec3) Load 335(r13) + 526: 14(ivec3) CompositeConstruct 524 524 524 + 527: 14(ivec3) IMul 525 526 + Store 335(r13) 527 + 528: 481(ptr) AccessChain 113 480 + 529: 20(int) Load 528 + 530: 27(bool) INotEqual 529 137 + 531: 20(int) Select 530 218 137 + 532: 21(ivec3) Load 339(r20) + 533: 21(ivec3) CompositeConstruct 531 531 531 + 534: 21(ivec3) IMul 532 533 + Store 339(r20) 534 + 535: 474(ptr) AccessChain 113 473 + 536: 13(int) Load 535 + 537: 20(int) Bitcast 536 + 538: 21(ivec3) Load 344(r21) + 539: 21(ivec3) CompositeConstruct 537 537 537 + 540: 21(ivec3) IMul 538 539 + Store 344(r21) 540 + 541: 515(ptr) AccessChain 113 514 + 542: 6(float) Load 541 + 543: 20(int) ConvertFToU 542 + 544: 21(ivec3) Load 348(r22) + 545: 21(ivec3) CompositeConstruct 543 543 543 + 546: 21(ivec3) IMul 544 545 + Store 348(r22) 546 + 547: 495(ptr) AccessChain 113 494 + 548:34(float64_t) Load 547 + 549: 20(int) ConvertFToU 548 + 550: 21(ivec3) Load 352(r23) + 551: 21(ivec3) CompositeConstruct 549 549 549 + 552: 21(ivec3) IMul 550 551 + Store 352(r23) 552 + 553: 474(ptr) AccessChain 113 473 + 554: 13(int) Load 553 + 555:34(float64_t) ConvertSToF 554 + 556: 35(f64vec3) Load 372(r40) + 557: 35(f64vec3) VectorTimesScalar 556 555 + Store 372(r40) 557 + 558: 481(ptr) AccessChain 113 488 + 559: 20(int) Load 558 + 560:34(float64_t) ConvertUToF 559 + 561: 35(f64vec3) Load 376(r41) + 562: 35(f64vec3) VectorTimesScalar 561 560 + Store 376(r41) 562 + 563: 515(ptr) AccessChain 113 514 + 564: 6(float) Load 563 + 565:34(float64_t) FConvert 564 + 566: 35(f64vec3) Load 380(r42) + 567: 35(f64vec3) VectorTimesScalar 566 565 + Store 380(r42) 567 + 568: 481(ptr) AccessChain 113 480 + 569: 20(int) Load 568 + 570: 27(bool) INotEqual 569 137 + 571:34(float64_t) Select 570 288 261 + 572: 35(f64vec3) Load 384(r43) + 573: 35(f64vec3) VectorTimesScalar 572 571 + Store 384(r43) 573 + Store 575(c1) 124 + Store 576(c2) 124 + 580: 13(int) Load 575(c1) + 581: 6(float) ConvertSToF 580 + 582: 13(int) Load 576(c2) + 583: 6(float) ConvertSToF 582 + 584: 106(fvec4) CompositeConstruct 579 579 581 583 + Store 578(outval) 584 + 587: 106(fvec4) Load 578(outval) + 588: 577(ptr) AccessChain 586(psout) 114 + Store 588 587 + 589:107(PS_OUTPUT) Load 586(psout) + ReturnValue 589 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.reflection.binding.frag.out b/deps/glslang/Test/baseResults/hlsl.reflection.binding.frag.out new file mode 100644 index 00000000..464ce0f7 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.reflection.binding.frag.out @@ -0,0 +1,19 @@ +hlsl.reflection.binding.frag +Uniform reflection: +t1: offset -1, type 8b5d, size 1, index -1, binding 15, stages 16 +s1: offset -1, type 0, size 1, index -1, binding 5, stages 16 +t1a: offset -1, type 8b5d, size 1, index -1, binding 16, stages 16 +s1a: offset -1, type 0, size 1, index -1, binding 6, stages 16 +c1_a: offset 0, type 8b52, size 1, index 0, binding -1, stages 16 +c1_b: offset 16, type 1404, size 1, index 0, binding -1, stages 16 +c1_c: offset 20, type 1406, size 1, index 0, binding -1, stages 16 +c2_a: offset 0, type 8b52, size 1, index 1, binding -1, stages 16 +c2_b: offset 16, type 1404, size 1, index 1, binding -1, stages 16 +c2_c: offset 20, type 1406, size 1, index 1, binding -1, stages 16 + +Uniform block reflection: +cbuff1: offset -1, type ffffffff, size 24, index -1, binding 2, stages 0 +cbuff2: offset -1, type ffffffff, size 24, index -1, binding 3, stages 0 + +Vertex attribute reflection: + diff --git a/deps/glslang/Test/baseResults/hlsl.reflection.binding.vert.out b/deps/glslang/Test/baseResults/hlsl.reflection.binding.vert.out new file mode 100644 index 00000000..f1368df9 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.reflection.binding.vert.out @@ -0,0 +1,15 @@ +hlsl.reflection.binding.vert + +Linked vertex stage: + + +Uniform reflection: +t1: offset -1, type 8b5d, size 1, index -1, binding 15 +s1: offset -1, type 0, size 1, index -1, binding 5 +t1a: offset -1, type 8b5d, size 1, index -1, binding 16 +s1a: offset -1, type 0, size 1, index -1, binding 6 + +Uniform block reflection: + +Vertex attribute reflection: + diff --git a/deps/glslang/Test/baseResults/hlsl.reflection.vert.out b/deps/glslang/Test/baseResults/hlsl.reflection.vert.out new file mode 100644 index 00000000..ea8d8690 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.reflection.vert.out @@ -0,0 +1,76 @@ +hlsl.reflection.vert +Uniform reflection: +anonMember3: offset 80, type 8b52, size 1, index 0, binding -1, stages 1 +s.a: offset 0, type 1404, size 1, index 1, binding -1, stages 1 +m23: offset 16, type 8b67, size 1, index 0, binding -1, stages 1 +scalarAfterm23: offset 48, type 1404, size 1, index 0, binding -1, stages 1 +c_m23: offset 16, type 8b67, size 1, index 2, binding -1, stages 1 +c_scalarAfterm23: offset 48, type 1404, size 1, index 2, binding -1, stages 1 +scalarBeforeArray: offset 96, type 1404, size 1, index 0, binding -1, stages 1 +floatArray: offset 112, type 1406, size 5, index 0, binding -1, stages 1 +scalarAfterArray: offset 192, type 1404, size 1, index 0, binding -1, stages 1 +m22: offset 208, type 8b5a, size 9, index 0, binding -1, stages 1 +dm22: offset 32, type 8b5a, size 4, index 1, binding -1, stages 1 +foo.n1.a: offset 0, type 1406, size 1, index 3, binding -1, stages 1 +foo.n2.b: offset 16, type 1406, size 1, index 3, binding -1, stages 1 +foo.n2.c: offset 20, type 1406, size 1, index 3, binding -1, stages 1 +foo.n2.d: offset 24, type 1406, size 1, index 3, binding -1, stages 1 +deepA.d2.d1[2].va: offset 376, type 8b50, size 2, index 1, binding -1, stages 1 +deepB.d2.d1.va: offset 984, type 8b50, size 2, index 1, binding -1, stages 1 +deepB.d2.d1[0].va: offset 984, type 8b50, size 2, index 1, binding -1, stages 1 +deepB.d2.d1[1].va: offset 984, type 8b50, size 2, index 1, binding -1, stages 1 +deepB.d2.d1[2].va: offset 984, type 8b50, size 2, index 1, binding -1, stages 1 +deepB.d2.d1[3].va: offset 984, type 8b50, size 2, index 1, binding -1, stages 1 +deepC.iv4: offset 1568, type 8b52, size 1, index 1, binding -1, stages 1 +deepC.d2.i: offset 1568, type 1404, size 1, index 1, binding -1, stages 1 +deepC.d2.d1[0].va: offset 1568, type 8b50, size 3, index 1, binding -1, stages 1 +deepC.d2.d1[0].b: offset 1568, type 8b56, size 1, index 1, binding -1, stages 1 +deepC.d2.d1[1].va: offset 1568, type 8b50, size 3, index 1, binding -1, stages 1 +deepC.d2.d1[1].b: offset 1568, type 8b56, size 1, index 1, binding -1, stages 1 +deepC.d2.d1[2].va: offset 1568, type 8b50, size 3, index 1, binding -1, stages 1 +deepC.d2.d1[2].b: offset 1568, type 8b56, size 1, index 1, binding -1, stages 1 +deepC.d2.d1[3].va: offset 1568, type 8b50, size 3, index 1, binding -1, stages 1 +deepC.d2.d1[3].b: offset 1568, type 8b56, size 1, index 1, binding -1, stages 1 +deepC.v3: offset 1568, type 8b54, size 1, index 1, binding -1, stages 1 +deepD[0].iv4: offset 2480, type 8b52, size 1, index 1, binding -1, stages 1 +deepD[0].d2.i: offset 2480, type 1404, size 1, index 1, binding -1, stages 1 +deepD[0].d2.d1[0].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1 +deepD[0].d2.d1[0].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1 +deepD[0].d2.d1[1].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1 +deepD[0].d2.d1[1].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1 +deepD[0].d2.d1[2].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1 +deepD[0].d2.d1[2].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1 +deepD[0].d2.d1[3].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1 +deepD[0].d2.d1[3].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1 +deepD[0].v3: offset 2480, type 8b54, size 1, index 1, binding -1, stages 1 +deepD[1].iv4: offset 2480, type 8b52, size 1, index 1, binding -1, stages 1 +deepD[1].d2.i: offset 2480, type 1404, size 1, index 1, binding -1, stages 1 +deepD[1].d2.d1[0].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1 +deepD[1].d2.d1[0].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1 +deepD[1].d2.d1[1].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1 +deepD[1].d2.d1[1].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1 +deepD[1].d2.d1[2].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1 +deepD[1].d2.d1[2].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1 +deepD[1].d2.d1[3].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1 +deepD[1].d2.d1[3].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1 +deepD[1].v3: offset 2480, type 8b54, size 1, index 1, binding -1, stages 1 +foo1: offset 0, type 1406, size 1, index 4, binding -1, stages 1 +foo2: offset 0, type 1406, size 1, index 5, binding -1, stages 1 +anonMember1: offset 0, type 8b51, size 1, index 0, binding -1, stages 1 +uf1: offset 16, type 1406, size 1, index 1, binding -1, stages 1 + +Uniform block reflection: +nameless: offset -1, type ffffffff, size 496, index -1, binding -1, stages 0 +$Global: offset -1, type ffffffff, size 3088, index -1, binding -1, stages 0 +c_nameless: offset -1, type ffffffff, size 96, index -1, binding -1, stages 0 +nested: offset -1, type ffffffff, size 32, index -1, binding -1, stages 0 +abl: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0 +abl2: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0 + +Vertex attribute reflection: +attributeFloat: offset 0, type 1406, size 0, index 0, binding -1, stages 0 +attributeFloat2: offset 0, type 8b50, size 0, index 0, binding -1, stages 0 +attributeFloat3: offset 0, type 8b51, size 0, index 0, binding -1, stages 0 +attributeFloat4: offset 0, type 8b52, size 0, index 0, binding -1, stages 0 +attributeMat4: offset 0, type 8b5c, size 0, index 0, binding -1, stages 0 + diff --git a/deps/glslang/Test/baseResults/hlsl.rw.atomics.frag.out b/deps/glslang/Test/baseResults/hlsl.rw.atomics.frag.out new file mode 100644 index 00000000..c874cd23 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.rw.atomics.frag.out @@ -0,0 +1,5275 @@ +hlsl.rw.atomics.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:45 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:45 Function Parameters: +0:? Sequence +0:50 imageAtomicAdd ( temp int) +0:50 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:50 i1: direct index for structure ( uniform int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:50 Constant: +0:50 5 (const uint) +0:50 i1b: direct index for structure ( uniform int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:50 Constant: +0:50 8 (const uint) +0:51 move second child to first child ( temp int) +0:51 'out_i1' ( temp int) +0:51 imageAtomicAdd ( temp int) +0:51 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:51 i1: direct index for structure ( uniform int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:51 Constant: +0:51 5 (const uint) +0:51 i1: direct index for structure ( uniform int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:51 Constant: +0:51 5 (const uint) +0:52 imageAtomicAnd ( temp int) +0:52 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:52 i1: direct index for structure ( uniform int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:52 Constant: +0:52 5 (const uint) +0:52 i1b: direct index for structure ( uniform int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:52 Constant: +0:52 8 (const uint) +0:53 move second child to first child ( temp int) +0:53 'out_i1' ( temp int) +0:53 imageAtomicAnd ( temp int) +0:53 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:53 i1: direct index for structure ( uniform int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:53 Constant: +0:53 5 (const uint) +0:53 i1: direct index for structure ( uniform int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:53 Constant: +0:53 5 (const uint) +0:54 move second child to first child ( temp int) +0:54 'out_i1' ( temp int) +0:54 imageAtomicCompSwap ( temp int) +0:54 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:54 i1: direct index for structure ( uniform int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:54 Constant: +0:54 5 (const uint) +0:54 i1b: direct index for structure ( uniform int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:54 Constant: +0:54 8 (const uint) +0:54 i1c: direct index for structure ( uniform int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:54 Constant: +0:54 9 (const uint) +0:55 move second child to first child ( temp int) +0:55 'out_i1' ( temp int) +0:55 imageAtomicExchange ( temp int) +0:55 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:55 i1: direct index for structure ( uniform int) +0:55 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:55 Constant: +0:55 5 (const uint) +0:55 i1: direct index for structure ( uniform int) +0:55 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:55 Constant: +0:55 5 (const uint) +0:56 imageAtomicMax ( temp int) +0:56 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:56 i1: direct index for structure ( uniform int) +0:56 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:56 Constant: +0:56 5 (const uint) +0:56 i1b: direct index for structure ( uniform int) +0:56 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:56 Constant: +0:56 8 (const uint) +0:57 move second child to first child ( temp int) +0:57 'out_i1' ( temp int) +0:57 imageAtomicMax ( temp int) +0:57 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:57 i1: direct index for structure ( uniform int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:57 Constant: +0:57 5 (const uint) +0:57 i1: direct index for structure ( uniform int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:57 Constant: +0:57 5 (const uint) +0:58 imageAtomicMin ( temp int) +0:58 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:58 i1: direct index for structure ( uniform int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:58 Constant: +0:58 5 (const uint) +0:58 i1b: direct index for structure ( uniform int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:58 Constant: +0:58 8 (const uint) +0:59 move second child to first child ( temp int) +0:59 'out_i1' ( temp int) +0:59 imageAtomicMin ( temp int) +0:59 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:59 i1: direct index for structure ( uniform int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:59 Constant: +0:59 5 (const uint) +0:59 i1: direct index for structure ( uniform int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:59 Constant: +0:59 5 (const uint) +0:60 imageAtomicOr ( temp int) +0:60 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:60 i1: direct index for structure ( uniform int) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:60 Constant: +0:60 5 (const uint) +0:60 i1b: direct index for structure ( uniform int) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:60 Constant: +0:60 8 (const uint) +0:61 move second child to first child ( temp int) +0:61 'out_i1' ( temp int) +0:61 imageAtomicOr ( temp int) +0:61 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:61 i1: direct index for structure ( uniform int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:61 Constant: +0:61 5 (const uint) +0:61 i1: direct index for structure ( uniform int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:61 Constant: +0:61 5 (const uint) +0:62 imageAtomicXor ( temp int) +0:62 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:62 i1: direct index for structure ( uniform int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:62 Constant: +0:62 5 (const uint) +0:62 i1b: direct index for structure ( uniform int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:62 Constant: +0:62 8 (const uint) +0:63 move second child to first child ( temp int) +0:63 'out_i1' ( temp int) +0:63 imageAtomicXor ( temp int) +0:63 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:63 i1: direct index for structure ( uniform int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:63 Constant: +0:63 5 (const uint) +0:63 i1: direct index for structure ( uniform int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:63 Constant: +0:63 5 (const uint) +0:66 imageAtomicAdd ( temp uint) +0:66 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:66 u1: direct index for structure ( uniform uint) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:66 Constant: +0:66 0 (const uint) +0:66 u1: direct index for structure ( uniform uint) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:66 Constant: +0:66 0 (const uint) +0:67 move second child to first child ( temp uint) +0:67 'out_u1' ( temp uint) +0:67 imageAtomicAdd ( temp uint) +0:67 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:67 u1: direct index for structure ( uniform uint) +0:67 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:67 Constant: +0:67 0 (const uint) +0:67 u1: direct index for structure ( uniform uint) +0:67 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:67 Constant: +0:67 0 (const uint) +0:68 imageAtomicAnd ( temp uint) +0:68 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:68 u1: direct index for structure ( uniform uint) +0:68 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:68 Constant: +0:68 0 (const uint) +0:68 u1: direct index for structure ( uniform uint) +0:68 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:68 Constant: +0:68 0 (const uint) +0:69 move second child to first child ( temp uint) +0:69 'out_u1' ( temp uint) +0:69 imageAtomicAnd ( temp uint) +0:69 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:69 u1: direct index for structure ( uniform uint) +0:69 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:69 Constant: +0:69 0 (const uint) +0:69 u1: direct index for structure ( uniform uint) +0:69 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:69 Constant: +0:69 0 (const uint) +0:70 move second child to first child ( temp uint) +0:70 'out_u1' ( temp uint) +0:70 imageAtomicCompSwap ( temp uint) +0:70 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:70 u1: direct index for structure ( uniform uint) +0:70 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:70 Constant: +0:70 0 (const uint) +0:70 u1b: direct index for structure ( uniform uint) +0:70 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:70 Constant: +0:70 3 (const uint) +0:70 u1c: direct index for structure ( uniform uint) +0:70 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:70 Constant: +0:70 4 (const uint) +0:71 move second child to first child ( temp uint) +0:71 'out_u1' ( temp uint) +0:71 imageAtomicExchange ( temp uint) +0:71 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:71 u1: direct index for structure ( uniform uint) +0:71 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:71 Constant: +0:71 0 (const uint) +0:71 u1: direct index for structure ( uniform uint) +0:71 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:71 Constant: +0:71 0 (const uint) +0:72 imageAtomicMax ( temp uint) +0:72 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:72 u1: direct index for structure ( uniform uint) +0:72 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:72 Constant: +0:72 0 (const uint) +0:72 u1: direct index for structure ( uniform uint) +0:72 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:72 Constant: +0:72 0 (const uint) +0:73 move second child to first child ( temp uint) +0:73 'out_u1' ( temp uint) +0:73 imageAtomicMax ( temp uint) +0:73 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:73 u1: direct index for structure ( uniform uint) +0:73 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:73 Constant: +0:73 0 (const uint) +0:73 u1: direct index for structure ( uniform uint) +0:73 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:73 Constant: +0:73 0 (const uint) +0:74 imageAtomicMin ( temp uint) +0:74 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:74 u1: direct index for structure ( uniform uint) +0:74 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:74 Constant: +0:74 0 (const uint) +0:74 u1: direct index for structure ( uniform uint) +0:74 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:74 Constant: +0:74 0 (const uint) +0:75 move second child to first child ( temp uint) +0:75 'out_u1' ( temp uint) +0:75 imageAtomicMin ( temp uint) +0:75 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:75 u1: direct index for structure ( uniform uint) +0:75 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:75 Constant: +0:75 0 (const uint) +0:75 u1: direct index for structure ( uniform uint) +0:75 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:75 Constant: +0:75 0 (const uint) +0:76 imageAtomicOr ( temp uint) +0:76 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:76 u1: direct index for structure ( uniform uint) +0:76 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:76 Constant: +0:76 0 (const uint) +0:76 u1: direct index for structure ( uniform uint) +0:76 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:76 Constant: +0:76 0 (const uint) +0:77 move second child to first child ( temp uint) +0:77 'out_u1' ( temp uint) +0:77 imageAtomicOr ( temp uint) +0:77 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:77 u1: direct index for structure ( uniform uint) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:77 Constant: +0:77 0 (const uint) +0:77 u1: direct index for structure ( uniform uint) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:77 Constant: +0:77 0 (const uint) +0:78 imageAtomicXor ( temp uint) +0:78 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:78 u1: direct index for structure ( uniform uint) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:78 Constant: +0:78 0 (const uint) +0:78 u1: direct index for structure ( uniform uint) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:78 Constant: +0:78 0 (const uint) +0:79 move second child to first child ( temp uint) +0:79 'out_u1' ( temp uint) +0:79 imageAtomicXor ( temp uint) +0:79 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:79 u1: direct index for structure ( uniform uint) +0:79 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:79 Constant: +0:79 0 (const uint) +0:79 u1: direct index for structure ( uniform uint) +0:79 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:79 Constant: +0:79 0 (const uint) +0:82 imageAtomicAdd ( temp int) +0:82 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:82 i2: direct index for structure ( uniform 2-component vector of int) +0:82 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:82 Constant: +0:82 6 (const uint) +0:82 i1b: direct index for structure ( uniform int) +0:82 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:82 Constant: +0:82 8 (const uint) +0:83 move second child to first child ( temp int) +0:83 'out_i1' ( temp int) +0:83 imageAtomicAdd ( temp int) +0:83 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:83 i2: direct index for structure ( uniform 2-component vector of int) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:83 Constant: +0:83 6 (const uint) +0:83 i1: direct index for structure ( uniform int) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:83 Constant: +0:83 5 (const uint) +0:84 imageAtomicAnd ( temp int) +0:84 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:84 i2: direct index for structure ( uniform 2-component vector of int) +0:84 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:84 Constant: +0:84 6 (const uint) +0:84 i1b: direct index for structure ( uniform int) +0:84 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:84 Constant: +0:84 8 (const uint) +0:85 move second child to first child ( temp int) +0:85 'out_i1' ( temp int) +0:85 imageAtomicAnd ( temp int) +0:85 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:85 i2: direct index for structure ( uniform 2-component vector of int) +0:85 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:85 Constant: +0:85 6 (const uint) +0:85 i1: direct index for structure ( uniform int) +0:85 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:85 Constant: +0:85 5 (const uint) +0:86 move second child to first child ( temp int) +0:86 'out_i1' ( temp int) +0:86 imageAtomicCompSwap ( temp int) +0:86 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:86 i2: direct index for structure ( uniform 2-component vector of int) +0:86 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:86 Constant: +0:86 6 (const uint) +0:86 i1b: direct index for structure ( uniform int) +0:86 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:86 Constant: +0:86 8 (const uint) +0:86 i1c: direct index for structure ( uniform int) +0:86 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:86 Constant: +0:86 9 (const uint) +0:87 move second child to first child ( temp int) +0:87 'out_i1' ( temp int) +0:87 imageAtomicExchange ( temp int) +0:87 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:87 i2: direct index for structure ( uniform 2-component vector of int) +0:87 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:87 Constant: +0:87 6 (const uint) +0:87 i1: direct index for structure ( uniform int) +0:87 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:87 Constant: +0:87 5 (const uint) +0:88 imageAtomicMax ( temp int) +0:88 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:88 i2: direct index for structure ( uniform 2-component vector of int) +0:88 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:88 Constant: +0:88 6 (const uint) +0:88 i1b: direct index for structure ( uniform int) +0:88 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:88 Constant: +0:88 8 (const uint) +0:89 move second child to first child ( temp int) +0:89 'out_i1' ( temp int) +0:89 imageAtomicMax ( temp int) +0:89 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:89 i2: direct index for structure ( uniform 2-component vector of int) +0:89 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:89 Constant: +0:89 6 (const uint) +0:89 i1: direct index for structure ( uniform int) +0:89 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:89 Constant: +0:89 5 (const uint) +0:90 imageAtomicMin ( temp int) +0:90 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:90 i2: direct index for structure ( uniform 2-component vector of int) +0:90 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:90 Constant: +0:90 6 (const uint) +0:90 i1b: direct index for structure ( uniform int) +0:90 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:90 Constant: +0:90 8 (const uint) +0:91 move second child to first child ( temp int) +0:91 'out_i1' ( temp int) +0:91 imageAtomicMin ( temp int) +0:91 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:91 i2: direct index for structure ( uniform 2-component vector of int) +0:91 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:91 Constant: +0:91 6 (const uint) +0:91 i1: direct index for structure ( uniform int) +0:91 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:91 Constant: +0:91 5 (const uint) +0:92 imageAtomicOr ( temp int) +0:92 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:92 i2: direct index for structure ( uniform 2-component vector of int) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:92 Constant: +0:92 6 (const uint) +0:92 i1b: direct index for structure ( uniform int) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:92 Constant: +0:92 8 (const uint) +0:93 move second child to first child ( temp int) +0:93 'out_i1' ( temp int) +0:93 imageAtomicOr ( temp int) +0:93 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:93 i2: direct index for structure ( uniform 2-component vector of int) +0:93 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:93 Constant: +0:93 6 (const uint) +0:93 i1: direct index for structure ( uniform int) +0:93 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:93 Constant: +0:93 5 (const uint) +0:94 imageAtomicXor ( temp int) +0:94 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:94 i2: direct index for structure ( uniform 2-component vector of int) +0:94 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:94 Constant: +0:94 6 (const uint) +0:94 i1b: direct index for structure ( uniform int) +0:94 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:94 Constant: +0:94 8 (const uint) +0:95 move second child to first child ( temp int) +0:95 'out_i1' ( temp int) +0:95 imageAtomicXor ( temp int) +0:95 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:95 i2: direct index for structure ( uniform 2-component vector of int) +0:95 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:95 Constant: +0:95 6 (const uint) +0:95 i1: direct index for structure ( uniform int) +0:95 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:95 Constant: +0:95 5 (const uint) +0:98 imageAtomicAdd ( temp uint) +0:98 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:98 u2: direct index for structure ( uniform 2-component vector of uint) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:98 Constant: +0:98 1 (const uint) +0:98 u1: direct index for structure ( uniform uint) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:98 Constant: +0:98 0 (const uint) +0:99 move second child to first child ( temp uint) +0:99 'out_u1' ( temp uint) +0:99 imageAtomicAdd ( temp uint) +0:99 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:99 u2: direct index for structure ( uniform 2-component vector of uint) +0:99 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:99 Constant: +0:99 1 (const uint) +0:99 u1: direct index for structure ( uniform uint) +0:99 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:99 Constant: +0:99 0 (const uint) +0:100 imageAtomicAnd ( temp uint) +0:100 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:100 u2: direct index for structure ( uniform 2-component vector of uint) +0:100 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:100 Constant: +0:100 1 (const uint) +0:100 u1: direct index for structure ( uniform uint) +0:100 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:100 Constant: +0:100 0 (const uint) +0:101 move second child to first child ( temp uint) +0:101 'out_u1' ( temp uint) +0:101 imageAtomicAnd ( temp uint) +0:101 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:101 u2: direct index for structure ( uniform 2-component vector of uint) +0:101 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:101 Constant: +0:101 1 (const uint) +0:101 u1: direct index for structure ( uniform uint) +0:101 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:101 Constant: +0:101 0 (const uint) +0:102 move second child to first child ( temp uint) +0:102 'out_u1' ( temp uint) +0:102 imageAtomicCompSwap ( temp uint) +0:102 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:102 u2: direct index for structure ( uniform 2-component vector of uint) +0:102 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:102 Constant: +0:102 1 (const uint) +0:102 u1b: direct index for structure ( uniform uint) +0:102 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:102 Constant: +0:102 3 (const uint) +0:102 u1c: direct index for structure ( uniform uint) +0:102 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:102 Constant: +0:102 4 (const uint) +0:103 move second child to first child ( temp uint) +0:103 'out_u1' ( temp uint) +0:103 imageAtomicExchange ( temp uint) +0:103 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:103 u2: direct index for structure ( uniform 2-component vector of uint) +0:103 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:103 Constant: +0:103 1 (const uint) +0:103 u1: direct index for structure ( uniform uint) +0:103 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:103 Constant: +0:103 0 (const uint) +0:104 imageAtomicMax ( temp uint) +0:104 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:104 u2: direct index for structure ( uniform 2-component vector of uint) +0:104 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:104 Constant: +0:104 1 (const uint) +0:104 u1: direct index for structure ( uniform uint) +0:104 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:104 Constant: +0:104 0 (const uint) +0:105 move second child to first child ( temp uint) +0:105 'out_u1' ( temp uint) +0:105 imageAtomicMax ( temp uint) +0:105 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:105 u2: direct index for structure ( uniform 2-component vector of uint) +0:105 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:105 Constant: +0:105 1 (const uint) +0:105 u1: direct index for structure ( uniform uint) +0:105 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:105 Constant: +0:105 0 (const uint) +0:106 imageAtomicMin ( temp uint) +0:106 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:106 u2: direct index for structure ( uniform 2-component vector of uint) +0:106 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:106 Constant: +0:106 1 (const uint) +0:106 u1: direct index for structure ( uniform uint) +0:106 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:106 Constant: +0:106 0 (const uint) +0:107 move second child to first child ( temp uint) +0:107 'out_u1' ( temp uint) +0:107 imageAtomicMin ( temp uint) +0:107 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:107 u2: direct index for structure ( uniform 2-component vector of uint) +0:107 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:107 Constant: +0:107 1 (const uint) +0:107 u1: direct index for structure ( uniform uint) +0:107 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:107 Constant: +0:107 0 (const uint) +0:108 imageAtomicOr ( temp uint) +0:108 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:108 u2: direct index for structure ( uniform 2-component vector of uint) +0:108 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:108 Constant: +0:108 1 (const uint) +0:108 u1: direct index for structure ( uniform uint) +0:108 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:108 Constant: +0:108 0 (const uint) +0:109 move second child to first child ( temp uint) +0:109 'out_u1' ( temp uint) +0:109 imageAtomicOr ( temp uint) +0:109 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:109 u2: direct index for structure ( uniform 2-component vector of uint) +0:109 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:109 Constant: +0:109 1 (const uint) +0:109 u1: direct index for structure ( uniform uint) +0:109 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:109 Constant: +0:109 0 (const uint) +0:110 imageAtomicXor ( temp uint) +0:110 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:110 u2: direct index for structure ( uniform 2-component vector of uint) +0:110 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:110 Constant: +0:110 1 (const uint) +0:110 u1: direct index for structure ( uniform uint) +0:110 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:110 Constant: +0:110 0 (const uint) +0:111 move second child to first child ( temp uint) +0:111 'out_u1' ( temp uint) +0:111 imageAtomicXor ( temp uint) +0:111 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:111 u2: direct index for structure ( uniform 2-component vector of uint) +0:111 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:111 Constant: +0:111 1 (const uint) +0:111 u1: direct index for structure ( uniform uint) +0:111 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:111 Constant: +0:111 0 (const uint) +0:114 imageAtomicAdd ( temp int) +0:114 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:114 i3: direct index for structure ( uniform 3-component vector of int) +0:114 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:114 Constant: +0:114 7 (const uint) +0:114 i1b: direct index for structure ( uniform int) +0:114 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:114 Constant: +0:114 8 (const uint) +0:115 move second child to first child ( temp int) +0:115 'out_i1' ( temp int) +0:115 imageAtomicAdd ( temp int) +0:115 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:115 i3: direct index for structure ( uniform 3-component vector of int) +0:115 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:115 Constant: +0:115 7 (const uint) +0:115 i1: direct index for structure ( uniform int) +0:115 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:115 Constant: +0:115 5 (const uint) +0:116 imageAtomicAnd ( temp int) +0:116 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:116 i3: direct index for structure ( uniform 3-component vector of int) +0:116 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:116 Constant: +0:116 7 (const uint) +0:116 i1b: direct index for structure ( uniform int) +0:116 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:116 Constant: +0:116 8 (const uint) +0:117 move second child to first child ( temp int) +0:117 'out_i1' ( temp int) +0:117 imageAtomicAnd ( temp int) +0:117 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:117 i3: direct index for structure ( uniform 3-component vector of int) +0:117 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:117 Constant: +0:117 7 (const uint) +0:117 i1: direct index for structure ( uniform int) +0:117 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:117 Constant: +0:117 5 (const uint) +0:118 move second child to first child ( temp int) +0:118 'out_i1' ( temp int) +0:118 imageAtomicCompSwap ( temp int) +0:118 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:118 i3: direct index for structure ( uniform 3-component vector of int) +0:118 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:118 Constant: +0:118 7 (const uint) +0:118 i1b: direct index for structure ( uniform int) +0:118 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:118 Constant: +0:118 8 (const uint) +0:118 i1c: direct index for structure ( uniform int) +0:118 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:118 Constant: +0:118 9 (const uint) +0:119 move second child to first child ( temp int) +0:119 'out_i1' ( temp int) +0:119 imageAtomicExchange ( temp int) +0:119 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:119 i3: direct index for structure ( uniform 3-component vector of int) +0:119 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:119 Constant: +0:119 7 (const uint) +0:119 i1: direct index for structure ( uniform int) +0:119 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:119 Constant: +0:119 5 (const uint) +0:120 imageAtomicMax ( temp int) +0:120 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:120 i3: direct index for structure ( uniform 3-component vector of int) +0:120 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:120 Constant: +0:120 7 (const uint) +0:120 i1b: direct index for structure ( uniform int) +0:120 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:120 Constant: +0:120 8 (const uint) +0:121 move second child to first child ( temp int) +0:121 'out_i1' ( temp int) +0:121 imageAtomicMax ( temp int) +0:121 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:121 i3: direct index for structure ( uniform 3-component vector of int) +0:121 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:121 Constant: +0:121 7 (const uint) +0:121 i1: direct index for structure ( uniform int) +0:121 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:121 Constant: +0:121 5 (const uint) +0:122 imageAtomicMin ( temp int) +0:122 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:122 i3: direct index for structure ( uniform 3-component vector of int) +0:122 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:122 Constant: +0:122 7 (const uint) +0:122 i1b: direct index for structure ( uniform int) +0:122 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:122 Constant: +0:122 8 (const uint) +0:123 move second child to first child ( temp int) +0:123 'out_i1' ( temp int) +0:123 imageAtomicMin ( temp int) +0:123 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:123 i3: direct index for structure ( uniform 3-component vector of int) +0:123 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:123 Constant: +0:123 7 (const uint) +0:123 i1: direct index for structure ( uniform int) +0:123 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:123 Constant: +0:123 5 (const uint) +0:124 imageAtomicOr ( temp int) +0:124 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:124 i3: direct index for structure ( uniform 3-component vector of int) +0:124 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:124 Constant: +0:124 7 (const uint) +0:124 i1b: direct index for structure ( uniform int) +0:124 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:124 Constant: +0:124 8 (const uint) +0:125 move second child to first child ( temp int) +0:125 'out_i1' ( temp int) +0:125 imageAtomicOr ( temp int) +0:125 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:125 i3: direct index for structure ( uniform 3-component vector of int) +0:125 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:125 Constant: +0:125 7 (const uint) +0:125 i1: direct index for structure ( uniform int) +0:125 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:125 Constant: +0:125 5 (const uint) +0:126 imageAtomicXor ( temp int) +0:126 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:126 i3: direct index for structure ( uniform 3-component vector of int) +0:126 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:126 Constant: +0:126 7 (const uint) +0:126 i1b: direct index for structure ( uniform int) +0:126 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:126 Constant: +0:126 8 (const uint) +0:127 move second child to first child ( temp int) +0:127 'out_i1' ( temp int) +0:127 imageAtomicXor ( temp int) +0:127 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:127 i3: direct index for structure ( uniform 3-component vector of int) +0:127 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:127 Constant: +0:127 7 (const uint) +0:127 i1: direct index for structure ( uniform int) +0:127 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:127 Constant: +0:127 5 (const uint) +0:130 imageAtomicAdd ( temp uint) +0:130 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:130 u3: direct index for structure ( uniform 3-component vector of uint) +0:130 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:130 Constant: +0:130 2 (const uint) +0:130 u1: direct index for structure ( uniform uint) +0:130 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:130 Constant: +0:130 0 (const uint) +0:131 move second child to first child ( temp uint) +0:131 'out_u1' ( temp uint) +0:131 imageAtomicAdd ( temp uint) +0:131 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:131 u3: direct index for structure ( uniform 3-component vector of uint) +0:131 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:131 Constant: +0:131 2 (const uint) +0:131 u1: direct index for structure ( uniform uint) +0:131 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:131 Constant: +0:131 0 (const uint) +0:132 imageAtomicAnd ( temp uint) +0:132 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:132 u3: direct index for structure ( uniform 3-component vector of uint) +0:132 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:132 Constant: +0:132 2 (const uint) +0:132 u1: direct index for structure ( uniform uint) +0:132 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:132 Constant: +0:132 0 (const uint) +0:133 move second child to first child ( temp uint) +0:133 'out_u1' ( temp uint) +0:133 imageAtomicAnd ( temp uint) +0:133 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:133 u3: direct index for structure ( uniform 3-component vector of uint) +0:133 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:133 Constant: +0:133 2 (const uint) +0:133 u1: direct index for structure ( uniform uint) +0:133 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:133 Constant: +0:133 0 (const uint) +0:134 move second child to first child ( temp uint) +0:134 'out_u1' ( temp uint) +0:134 imageAtomicCompSwap ( temp uint) +0:134 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:134 u3: direct index for structure ( uniform 3-component vector of uint) +0:134 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:134 Constant: +0:134 2 (const uint) +0:134 u1b: direct index for structure ( uniform uint) +0:134 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:134 Constant: +0:134 3 (const uint) +0:134 u1c: direct index for structure ( uniform uint) +0:134 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:134 Constant: +0:134 4 (const uint) +0:135 move second child to first child ( temp uint) +0:135 'out_u1' ( temp uint) +0:135 imageAtomicExchange ( temp uint) +0:135 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:135 u3: direct index for structure ( uniform 3-component vector of uint) +0:135 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:135 Constant: +0:135 2 (const uint) +0:135 u1: direct index for structure ( uniform uint) +0:135 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:135 Constant: +0:135 0 (const uint) +0:136 imageAtomicMax ( temp uint) +0:136 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:136 u3: direct index for structure ( uniform 3-component vector of uint) +0:136 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:136 Constant: +0:136 2 (const uint) +0:136 u1: direct index for structure ( uniform uint) +0:136 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:136 Constant: +0:136 0 (const uint) +0:137 move second child to first child ( temp uint) +0:137 'out_u1' ( temp uint) +0:137 imageAtomicMax ( temp uint) +0:137 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:137 u3: direct index for structure ( uniform 3-component vector of uint) +0:137 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:137 Constant: +0:137 2 (const uint) +0:137 u1: direct index for structure ( uniform uint) +0:137 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:137 Constant: +0:137 0 (const uint) +0:138 imageAtomicMin ( temp uint) +0:138 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:138 u3: direct index for structure ( uniform 3-component vector of uint) +0:138 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:138 Constant: +0:138 2 (const uint) +0:138 u1: direct index for structure ( uniform uint) +0:138 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:138 Constant: +0:138 0 (const uint) +0:139 move second child to first child ( temp uint) +0:139 'out_u1' ( temp uint) +0:139 imageAtomicMin ( temp uint) +0:139 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:139 u3: direct index for structure ( uniform 3-component vector of uint) +0:139 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:139 Constant: +0:139 2 (const uint) +0:139 u1: direct index for structure ( uniform uint) +0:139 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:139 Constant: +0:139 0 (const uint) +0:140 imageAtomicOr ( temp uint) +0:140 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:140 u3: direct index for structure ( uniform 3-component vector of uint) +0:140 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:140 Constant: +0:140 2 (const uint) +0:140 u1: direct index for structure ( uniform uint) +0:140 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:140 Constant: +0:140 0 (const uint) +0:141 move second child to first child ( temp uint) +0:141 'out_u1' ( temp uint) +0:141 imageAtomicOr ( temp uint) +0:141 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:141 u3: direct index for structure ( uniform 3-component vector of uint) +0:141 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:141 Constant: +0:141 2 (const uint) +0:141 u1: direct index for structure ( uniform uint) +0:141 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:141 Constant: +0:141 0 (const uint) +0:142 imageAtomicXor ( temp uint) +0:142 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:142 u3: direct index for structure ( uniform 3-component vector of uint) +0:142 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:142 Constant: +0:142 2 (const uint) +0:142 u1: direct index for structure ( uniform uint) +0:142 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:142 Constant: +0:142 0 (const uint) +0:143 move second child to first child ( temp uint) +0:143 'out_u1' ( temp uint) +0:143 imageAtomicXor ( temp uint) +0:143 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:143 u3: direct index for structure ( uniform 3-component vector of uint) +0:143 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:143 Constant: +0:143 2 (const uint) +0:143 u1: direct index for structure ( uniform uint) +0:143 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:143 Constant: +0:143 0 (const uint) +0:146 imageAtomicAdd ( temp int) +0:146 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:146 i2: direct index for structure ( uniform 2-component vector of int) +0:146 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:146 Constant: +0:146 6 (const uint) +0:146 i1b: direct index for structure ( uniform int) +0:146 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:146 Constant: +0:146 8 (const uint) +0:147 move second child to first child ( temp int) +0:147 'out_i1' ( temp int) +0:147 imageAtomicAdd ( temp int) +0:147 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:147 i2: direct index for structure ( uniform 2-component vector of int) +0:147 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:147 Constant: +0:147 6 (const uint) +0:147 i1: direct index for structure ( uniform int) +0:147 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:147 Constant: +0:147 5 (const uint) +0:148 imageAtomicAnd ( temp int) +0:148 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:148 i2: direct index for structure ( uniform 2-component vector of int) +0:148 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:148 Constant: +0:148 6 (const uint) +0:148 i1b: direct index for structure ( uniform int) +0:148 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:148 Constant: +0:148 8 (const uint) +0:149 move second child to first child ( temp int) +0:149 'out_i1' ( temp int) +0:149 imageAtomicAnd ( temp int) +0:149 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:149 i2: direct index for structure ( uniform 2-component vector of int) +0:149 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:149 Constant: +0:149 6 (const uint) +0:149 i1: direct index for structure ( uniform int) +0:149 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:149 Constant: +0:149 5 (const uint) +0:150 move second child to first child ( temp int) +0:150 'out_i1' ( temp int) +0:150 imageAtomicCompSwap ( temp int) +0:150 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:150 i2: direct index for structure ( uniform 2-component vector of int) +0:150 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:150 Constant: +0:150 6 (const uint) +0:150 i1b: direct index for structure ( uniform int) +0:150 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:150 Constant: +0:150 8 (const uint) +0:150 i1c: direct index for structure ( uniform int) +0:150 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:150 Constant: +0:150 9 (const uint) +0:151 move second child to first child ( temp int) +0:151 'out_i1' ( temp int) +0:151 imageAtomicExchange ( temp int) +0:151 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:151 i2: direct index for structure ( uniform 2-component vector of int) +0:151 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:151 Constant: +0:151 6 (const uint) +0:151 i1: direct index for structure ( uniform int) +0:151 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:151 Constant: +0:151 5 (const uint) +0:152 imageAtomicMax ( temp int) +0:152 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:152 i2: direct index for structure ( uniform 2-component vector of int) +0:152 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:152 Constant: +0:152 6 (const uint) +0:152 i1b: direct index for structure ( uniform int) +0:152 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:152 Constant: +0:152 8 (const uint) +0:153 move second child to first child ( temp int) +0:153 'out_i1' ( temp int) +0:153 imageAtomicMax ( temp int) +0:153 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:153 i2: direct index for structure ( uniform 2-component vector of int) +0:153 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:153 Constant: +0:153 6 (const uint) +0:153 i1: direct index for structure ( uniform int) +0:153 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:153 Constant: +0:153 5 (const uint) +0:154 imageAtomicMin ( temp int) +0:154 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:154 i2: direct index for structure ( uniform 2-component vector of int) +0:154 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:154 Constant: +0:154 6 (const uint) +0:154 i1b: direct index for structure ( uniform int) +0:154 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:154 Constant: +0:154 8 (const uint) +0:155 move second child to first child ( temp int) +0:155 'out_i1' ( temp int) +0:155 imageAtomicMin ( temp int) +0:155 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:155 i2: direct index for structure ( uniform 2-component vector of int) +0:155 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:155 Constant: +0:155 6 (const uint) +0:155 i1: direct index for structure ( uniform int) +0:155 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:155 Constant: +0:155 5 (const uint) +0:156 imageAtomicOr ( temp int) +0:156 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:156 i2: direct index for structure ( uniform 2-component vector of int) +0:156 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:156 Constant: +0:156 6 (const uint) +0:156 i1b: direct index for structure ( uniform int) +0:156 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:156 Constant: +0:156 8 (const uint) +0:157 move second child to first child ( temp int) +0:157 'out_i1' ( temp int) +0:157 imageAtomicOr ( temp int) +0:157 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:157 i2: direct index for structure ( uniform 2-component vector of int) +0:157 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:157 Constant: +0:157 6 (const uint) +0:157 i1: direct index for structure ( uniform int) +0:157 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:157 Constant: +0:157 5 (const uint) +0:158 imageAtomicXor ( temp int) +0:158 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:158 i2: direct index for structure ( uniform 2-component vector of int) +0:158 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:158 Constant: +0:158 6 (const uint) +0:158 i1b: direct index for structure ( uniform int) +0:158 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:158 Constant: +0:158 8 (const uint) +0:159 move second child to first child ( temp int) +0:159 'out_i1' ( temp int) +0:159 imageAtomicXor ( temp int) +0:159 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:159 i2: direct index for structure ( uniform 2-component vector of int) +0:159 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:159 Constant: +0:159 6 (const uint) +0:159 i1: direct index for structure ( uniform int) +0:159 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:159 Constant: +0:159 5 (const uint) +0:162 imageAtomicAdd ( temp uint) +0:162 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:162 u2: direct index for structure ( uniform 2-component vector of uint) +0:162 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:162 Constant: +0:162 1 (const uint) +0:162 u1: direct index for structure ( uniform uint) +0:162 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:162 Constant: +0:162 0 (const uint) +0:163 move second child to first child ( temp uint) +0:163 'out_u1' ( temp uint) +0:163 imageAtomicAdd ( temp uint) +0:163 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:163 u2: direct index for structure ( uniform 2-component vector of uint) +0:163 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:163 Constant: +0:163 1 (const uint) +0:163 u1: direct index for structure ( uniform uint) +0:163 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:163 Constant: +0:163 0 (const uint) +0:164 imageAtomicAnd ( temp uint) +0:164 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:164 u2: direct index for structure ( uniform 2-component vector of uint) +0:164 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:164 Constant: +0:164 1 (const uint) +0:164 u1: direct index for structure ( uniform uint) +0:164 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:164 Constant: +0:164 0 (const uint) +0:165 move second child to first child ( temp uint) +0:165 'out_u1' ( temp uint) +0:165 imageAtomicAnd ( temp uint) +0:165 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:165 u2: direct index for structure ( uniform 2-component vector of uint) +0:165 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:165 Constant: +0:165 1 (const uint) +0:165 u1: direct index for structure ( uniform uint) +0:165 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:165 Constant: +0:165 0 (const uint) +0:166 move second child to first child ( temp uint) +0:166 'out_u1' ( temp uint) +0:166 imageAtomicCompSwap ( temp uint) +0:166 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:166 u2: direct index for structure ( uniform 2-component vector of uint) +0:166 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:166 Constant: +0:166 1 (const uint) +0:166 u1b: direct index for structure ( uniform uint) +0:166 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:166 Constant: +0:166 3 (const uint) +0:166 u1c: direct index for structure ( uniform uint) +0:166 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:166 Constant: +0:166 4 (const uint) +0:167 move second child to first child ( temp uint) +0:167 'out_u1' ( temp uint) +0:167 imageAtomicExchange ( temp uint) +0:167 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:167 u2: direct index for structure ( uniform 2-component vector of uint) +0:167 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:167 Constant: +0:167 1 (const uint) +0:167 u1: direct index for structure ( uniform uint) +0:167 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:167 Constant: +0:167 0 (const uint) +0:168 imageAtomicMax ( temp uint) +0:168 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:168 u2: direct index for structure ( uniform 2-component vector of uint) +0:168 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:168 Constant: +0:168 1 (const uint) +0:168 u1: direct index for structure ( uniform uint) +0:168 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:168 Constant: +0:168 0 (const uint) +0:169 move second child to first child ( temp uint) +0:169 'out_u1' ( temp uint) +0:169 imageAtomicMax ( temp uint) +0:169 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:169 u2: direct index for structure ( uniform 2-component vector of uint) +0:169 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:169 Constant: +0:169 1 (const uint) +0:169 u1: direct index for structure ( uniform uint) +0:169 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:169 Constant: +0:169 0 (const uint) +0:170 imageAtomicMin ( temp uint) +0:170 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:170 u2: direct index for structure ( uniform 2-component vector of uint) +0:170 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:170 Constant: +0:170 1 (const uint) +0:170 u1: direct index for structure ( uniform uint) +0:170 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:170 Constant: +0:170 0 (const uint) +0:171 move second child to first child ( temp uint) +0:171 'out_u1' ( temp uint) +0:171 imageAtomicMin ( temp uint) +0:171 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:171 u2: direct index for structure ( uniform 2-component vector of uint) +0:171 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:171 Constant: +0:171 1 (const uint) +0:171 u1: direct index for structure ( uniform uint) +0:171 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:171 Constant: +0:171 0 (const uint) +0:172 imageAtomicOr ( temp uint) +0:172 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:172 u2: direct index for structure ( uniform 2-component vector of uint) +0:172 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:172 Constant: +0:172 1 (const uint) +0:172 u1: direct index for structure ( uniform uint) +0:172 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:172 Constant: +0:172 0 (const uint) +0:173 move second child to first child ( temp uint) +0:173 'out_u1' ( temp uint) +0:173 imageAtomicOr ( temp uint) +0:173 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:173 u2: direct index for structure ( uniform 2-component vector of uint) +0:173 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:173 Constant: +0:173 1 (const uint) +0:173 u1: direct index for structure ( uniform uint) +0:173 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:173 Constant: +0:173 0 (const uint) +0:174 imageAtomicXor ( temp uint) +0:174 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:174 u2: direct index for structure ( uniform 2-component vector of uint) +0:174 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:174 Constant: +0:174 1 (const uint) +0:174 u1: direct index for structure ( uniform uint) +0:174 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:174 Constant: +0:174 0 (const uint) +0:175 move second child to first child ( temp uint) +0:175 'out_u1' ( temp uint) +0:175 imageAtomicXor ( temp uint) +0:175 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:175 u2: direct index for structure ( uniform 2-component vector of uint) +0:175 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:175 Constant: +0:175 1 (const uint) +0:175 u1: direct index for structure ( uniform uint) +0:175 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:175 Constant: +0:175 0 (const uint) +0:178 imageAtomicAdd ( temp int) +0:178 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:178 i2: direct index for structure ( uniform 2-component vector of int) +0:178 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:178 Constant: +0:178 6 (const uint) +0:178 i1b: direct index for structure ( uniform int) +0:178 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:178 Constant: +0:178 8 (const uint) +0:179 move second child to first child ( temp int) +0:179 'out_i1' ( temp int) +0:179 imageAtomicAdd ( temp int) +0:179 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:179 i2: direct index for structure ( uniform 2-component vector of int) +0:179 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:179 Constant: +0:179 6 (const uint) +0:179 i1: direct index for structure ( uniform int) +0:179 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:179 Constant: +0:179 5 (const uint) +0:180 imageAtomicAnd ( temp int) +0:180 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:180 i2: direct index for structure ( uniform 2-component vector of int) +0:180 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:180 Constant: +0:180 6 (const uint) +0:180 i1b: direct index for structure ( uniform int) +0:180 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:180 Constant: +0:180 8 (const uint) +0:181 move second child to first child ( temp int) +0:181 'out_i1' ( temp int) +0:181 imageAtomicAnd ( temp int) +0:181 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:181 i2: direct index for structure ( uniform 2-component vector of int) +0:181 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:181 Constant: +0:181 6 (const uint) +0:181 i1: direct index for structure ( uniform int) +0:181 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:181 Constant: +0:181 5 (const uint) +0:182 move second child to first child ( temp int) +0:182 'out_i1' ( temp int) +0:182 imageAtomicCompSwap ( temp int) +0:182 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:182 i2: direct index for structure ( uniform 2-component vector of int) +0:182 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:182 Constant: +0:182 6 (const uint) +0:182 i1b: direct index for structure ( uniform int) +0:182 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:182 Constant: +0:182 8 (const uint) +0:182 i1c: direct index for structure ( uniform int) +0:182 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:182 Constant: +0:182 9 (const uint) +0:183 move second child to first child ( temp int) +0:183 'out_i1' ( temp int) +0:183 imageAtomicExchange ( temp int) +0:183 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:183 i2: direct index for structure ( uniform 2-component vector of int) +0:183 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:183 Constant: +0:183 6 (const uint) +0:183 i1: direct index for structure ( uniform int) +0:183 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:183 Constant: +0:183 5 (const uint) +0:184 imageAtomicMax ( temp int) +0:184 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:184 i2: direct index for structure ( uniform 2-component vector of int) +0:184 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:184 Constant: +0:184 6 (const uint) +0:184 i1b: direct index for structure ( uniform int) +0:184 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:184 Constant: +0:184 8 (const uint) +0:185 move second child to first child ( temp int) +0:185 'out_i1' ( temp int) +0:185 imageAtomicMax ( temp int) +0:185 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:185 i2: direct index for structure ( uniform 2-component vector of int) +0:185 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:185 Constant: +0:185 6 (const uint) +0:185 i1: direct index for structure ( uniform int) +0:185 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:185 Constant: +0:185 5 (const uint) +0:186 imageAtomicMin ( temp int) +0:186 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:186 i2: direct index for structure ( uniform 2-component vector of int) +0:186 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:186 Constant: +0:186 6 (const uint) +0:186 i1b: direct index for structure ( uniform int) +0:186 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:186 Constant: +0:186 8 (const uint) +0:187 move second child to first child ( temp int) +0:187 'out_i1' ( temp int) +0:187 imageAtomicMin ( temp int) +0:187 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:187 i2: direct index for structure ( uniform 2-component vector of int) +0:187 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:187 Constant: +0:187 6 (const uint) +0:187 i1: direct index for structure ( uniform int) +0:187 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:187 Constant: +0:187 5 (const uint) +0:188 imageAtomicOr ( temp int) +0:188 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:188 i2: direct index for structure ( uniform 2-component vector of int) +0:188 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:188 Constant: +0:188 6 (const uint) +0:188 i1b: direct index for structure ( uniform int) +0:188 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:188 Constant: +0:188 8 (const uint) +0:189 move second child to first child ( temp int) +0:189 'out_i1' ( temp int) +0:189 imageAtomicOr ( temp int) +0:189 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:189 i2: direct index for structure ( uniform 2-component vector of int) +0:189 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:189 Constant: +0:189 6 (const uint) +0:189 i1: direct index for structure ( uniform int) +0:189 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:189 Constant: +0:189 5 (const uint) +0:190 imageAtomicXor ( temp int) +0:190 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:190 i2: direct index for structure ( uniform 2-component vector of int) +0:190 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:190 Constant: +0:190 6 (const uint) +0:190 i1b: direct index for structure ( uniform int) +0:190 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:190 Constant: +0:190 8 (const uint) +0:191 move second child to first child ( temp int) +0:191 'out_i1' ( temp int) +0:191 imageAtomicXor ( temp int) +0:191 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:191 i2: direct index for structure ( uniform 2-component vector of int) +0:191 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:191 Constant: +0:191 6 (const uint) +0:191 i1: direct index for structure ( uniform int) +0:191 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:191 Constant: +0:191 5 (const uint) +0:194 imageAtomicAdd ( temp uint) +0:194 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:194 u2: direct index for structure ( uniform 2-component vector of uint) +0:194 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:194 Constant: +0:194 1 (const uint) +0:194 u1: direct index for structure ( uniform uint) +0:194 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:194 Constant: +0:194 0 (const uint) +0:195 move second child to first child ( temp uint) +0:195 'out_u1' ( temp uint) +0:195 imageAtomicAdd ( temp uint) +0:195 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:195 u2: direct index for structure ( uniform 2-component vector of uint) +0:195 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:195 Constant: +0:195 1 (const uint) +0:195 u1: direct index for structure ( uniform uint) +0:195 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:195 Constant: +0:195 0 (const uint) +0:196 imageAtomicAnd ( temp uint) +0:196 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:196 u2: direct index for structure ( uniform 2-component vector of uint) +0:196 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:196 Constant: +0:196 1 (const uint) +0:196 u1: direct index for structure ( uniform uint) +0:196 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:196 Constant: +0:196 0 (const uint) +0:197 move second child to first child ( temp uint) +0:197 'out_u1' ( temp uint) +0:197 imageAtomicAnd ( temp uint) +0:197 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:197 u2: direct index for structure ( uniform 2-component vector of uint) +0:197 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:197 Constant: +0:197 1 (const uint) +0:197 u1: direct index for structure ( uniform uint) +0:197 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:197 Constant: +0:197 0 (const uint) +0:198 move second child to first child ( temp uint) +0:198 'out_u1' ( temp uint) +0:198 imageAtomicCompSwap ( temp uint) +0:198 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:198 u2: direct index for structure ( uniform 2-component vector of uint) +0:198 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:198 Constant: +0:198 1 (const uint) +0:198 u1b: direct index for structure ( uniform uint) +0:198 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:198 Constant: +0:198 3 (const uint) +0:198 u1c: direct index for structure ( uniform uint) +0:198 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:198 Constant: +0:198 4 (const uint) +0:199 move second child to first child ( temp uint) +0:199 'out_u1' ( temp uint) +0:199 imageAtomicExchange ( temp uint) +0:199 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:199 u2: direct index for structure ( uniform 2-component vector of uint) +0:199 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:199 Constant: +0:199 1 (const uint) +0:199 u1: direct index for structure ( uniform uint) +0:199 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:199 Constant: +0:199 0 (const uint) +0:200 imageAtomicMax ( temp uint) +0:200 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:200 u2: direct index for structure ( uniform 2-component vector of uint) +0:200 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:200 Constant: +0:200 1 (const uint) +0:200 u1: direct index for structure ( uniform uint) +0:200 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:200 Constant: +0:200 0 (const uint) +0:201 move second child to first child ( temp uint) +0:201 'out_u1' ( temp uint) +0:201 imageAtomicMax ( temp uint) +0:201 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:201 u2: direct index for structure ( uniform 2-component vector of uint) +0:201 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:201 Constant: +0:201 1 (const uint) +0:201 u1: direct index for structure ( uniform uint) +0:201 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:201 Constant: +0:201 0 (const uint) +0:202 imageAtomicMin ( temp uint) +0:202 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:202 u2: direct index for structure ( uniform 2-component vector of uint) +0:202 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:202 Constant: +0:202 1 (const uint) +0:202 u1: direct index for structure ( uniform uint) +0:202 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:202 Constant: +0:202 0 (const uint) +0:203 move second child to first child ( temp uint) +0:203 'out_u1' ( temp uint) +0:203 imageAtomicMin ( temp uint) +0:203 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:203 u2: direct index for structure ( uniform 2-component vector of uint) +0:203 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:203 Constant: +0:203 1 (const uint) +0:203 u1: direct index for structure ( uniform uint) +0:203 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:203 Constant: +0:203 0 (const uint) +0:204 imageAtomicOr ( temp uint) +0:204 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:204 u2: direct index for structure ( uniform 2-component vector of uint) +0:204 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:204 Constant: +0:204 1 (const uint) +0:204 u1: direct index for structure ( uniform uint) +0:204 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:204 Constant: +0:204 0 (const uint) +0:205 move second child to first child ( temp uint) +0:205 'out_u1' ( temp uint) +0:205 imageAtomicOr ( temp uint) +0:205 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:205 u2: direct index for structure ( uniform 2-component vector of uint) +0:205 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:205 Constant: +0:205 1 (const uint) +0:205 u1: direct index for structure ( uniform uint) +0:205 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:205 Constant: +0:205 0 (const uint) +0:206 imageAtomicXor ( temp uint) +0:206 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:206 u2: direct index for structure ( uniform 2-component vector of uint) +0:206 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:206 Constant: +0:206 1 (const uint) +0:206 u1: direct index for structure ( uniform uint) +0:206 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:206 Constant: +0:206 0 (const uint) +0:207 move second child to first child ( temp uint) +0:207 'out_u1' ( temp uint) +0:207 imageAtomicXor ( temp uint) +0:207 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:207 u2: direct index for structure ( uniform 2-component vector of uint) +0:207 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:207 Constant: +0:207 1 (const uint) +0:207 u1: direct index for structure ( uniform uint) +0:207 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:207 Constant: +0:207 0 (const uint) +0:210 imageAtomicAdd ( temp int) +0:210 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:210 i1: direct index for structure ( uniform int) +0:210 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:210 Constant: +0:210 5 (const uint) +0:210 i1b: direct index for structure ( uniform int) +0:210 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:210 Constant: +0:210 8 (const uint) +0:211 move second child to first child ( temp int) +0:211 'out_i1' ( temp int) +0:211 imageAtomicAdd ( temp int) +0:211 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:211 i1: direct index for structure ( uniform int) +0:211 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:211 Constant: +0:211 5 (const uint) +0:211 i1: direct index for structure ( uniform int) +0:211 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:211 Constant: +0:211 5 (const uint) +0:212 imageAtomicAnd ( temp int) +0:212 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:212 i1: direct index for structure ( uniform int) +0:212 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:212 Constant: +0:212 5 (const uint) +0:212 i1b: direct index for structure ( uniform int) +0:212 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:212 Constant: +0:212 8 (const uint) +0:213 move second child to first child ( temp int) +0:213 'out_i1' ( temp int) +0:213 imageAtomicAnd ( temp int) +0:213 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:213 i1: direct index for structure ( uniform int) +0:213 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:213 Constant: +0:213 5 (const uint) +0:213 i1: direct index for structure ( uniform int) +0:213 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:213 Constant: +0:213 5 (const uint) +0:214 move second child to first child ( temp int) +0:214 'out_i1' ( temp int) +0:214 imageAtomicCompSwap ( temp int) +0:214 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:214 i1: direct index for structure ( uniform int) +0:214 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:214 Constant: +0:214 5 (const uint) +0:214 i1b: direct index for structure ( uniform int) +0:214 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:214 Constant: +0:214 8 (const uint) +0:214 i1c: direct index for structure ( uniform int) +0:214 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:214 Constant: +0:214 9 (const uint) +0:215 move second child to first child ( temp int) +0:215 'out_i1' ( temp int) +0:215 imageAtomicExchange ( temp int) +0:215 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:215 i1: direct index for structure ( uniform int) +0:215 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:215 Constant: +0:215 5 (const uint) +0:215 i1: direct index for structure ( uniform int) +0:215 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:215 Constant: +0:215 5 (const uint) +0:216 imageAtomicMax ( temp int) +0:216 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:216 i1: direct index for structure ( uniform int) +0:216 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:216 Constant: +0:216 5 (const uint) +0:216 i1b: direct index for structure ( uniform int) +0:216 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:216 Constant: +0:216 8 (const uint) +0:217 move second child to first child ( temp int) +0:217 'out_i1' ( temp int) +0:217 imageAtomicMax ( temp int) +0:217 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:217 i1: direct index for structure ( uniform int) +0:217 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:217 Constant: +0:217 5 (const uint) +0:217 i1: direct index for structure ( uniform int) +0:217 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:217 Constant: +0:217 5 (const uint) +0:218 imageAtomicMin ( temp int) +0:218 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:218 i1: direct index for structure ( uniform int) +0:218 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:218 Constant: +0:218 5 (const uint) +0:218 i1b: direct index for structure ( uniform int) +0:218 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:218 Constant: +0:218 8 (const uint) +0:219 move second child to first child ( temp int) +0:219 'out_i1' ( temp int) +0:219 imageAtomicMin ( temp int) +0:219 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:219 i1: direct index for structure ( uniform int) +0:219 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:219 Constant: +0:219 5 (const uint) +0:219 i1: direct index for structure ( uniform int) +0:219 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:219 Constant: +0:219 5 (const uint) +0:220 imageAtomicOr ( temp int) +0:220 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:220 i1: direct index for structure ( uniform int) +0:220 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:220 Constant: +0:220 5 (const uint) +0:220 i1b: direct index for structure ( uniform int) +0:220 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:220 Constant: +0:220 8 (const uint) +0:221 move second child to first child ( temp int) +0:221 'out_i1' ( temp int) +0:221 imageAtomicOr ( temp int) +0:221 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:221 i1: direct index for structure ( uniform int) +0:221 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:221 Constant: +0:221 5 (const uint) +0:221 i1: direct index for structure ( uniform int) +0:221 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:221 Constant: +0:221 5 (const uint) +0:222 imageAtomicXor ( temp int) +0:222 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:222 i1: direct index for structure ( uniform int) +0:222 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:222 Constant: +0:222 5 (const uint) +0:222 i1b: direct index for structure ( uniform int) +0:222 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:222 Constant: +0:222 8 (const uint) +0:223 move second child to first child ( temp int) +0:223 'out_i1' ( temp int) +0:223 imageAtomicXor ( temp int) +0:223 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:223 i1: direct index for structure ( uniform int) +0:223 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:223 Constant: +0:223 5 (const uint) +0:223 i1: direct index for structure ( uniform int) +0:223 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:223 Constant: +0:223 5 (const uint) +0:226 imageAtomicAdd ( temp uint) +0:226 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:226 u1: direct index for structure ( uniform uint) +0:226 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:226 Constant: +0:226 0 (const uint) +0:226 u1: direct index for structure ( uniform uint) +0:226 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:226 Constant: +0:226 0 (const uint) +0:227 move second child to first child ( temp uint) +0:227 'out_u1' ( temp uint) +0:227 imageAtomicAdd ( temp uint) +0:227 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:227 u1: direct index for structure ( uniform uint) +0:227 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:227 Constant: +0:227 0 (const uint) +0:227 u1: direct index for structure ( uniform uint) +0:227 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:227 Constant: +0:227 0 (const uint) +0:228 imageAtomicAnd ( temp uint) +0:228 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:228 u1: direct index for structure ( uniform uint) +0:228 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:228 Constant: +0:228 0 (const uint) +0:228 u1: direct index for structure ( uniform uint) +0:228 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:228 Constant: +0:228 0 (const uint) +0:229 move second child to first child ( temp uint) +0:229 'out_u1' ( temp uint) +0:229 imageAtomicAnd ( temp uint) +0:229 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:229 u1: direct index for structure ( uniform uint) +0:229 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:229 Constant: +0:229 0 (const uint) +0:229 u1: direct index for structure ( uniform uint) +0:229 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:229 Constant: +0:229 0 (const uint) +0:230 move second child to first child ( temp uint) +0:230 'out_u1' ( temp uint) +0:230 imageAtomicCompSwap ( temp uint) +0:230 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:230 u1: direct index for structure ( uniform uint) +0:230 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:230 Constant: +0:230 0 (const uint) +0:230 u1b: direct index for structure ( uniform uint) +0:230 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:230 Constant: +0:230 3 (const uint) +0:230 u1c: direct index for structure ( uniform uint) +0:230 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:230 Constant: +0:230 4 (const uint) +0:231 move second child to first child ( temp uint) +0:231 'out_u1' ( temp uint) +0:231 imageAtomicExchange ( temp uint) +0:231 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:231 u1: direct index for structure ( uniform uint) +0:231 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:231 Constant: +0:231 0 (const uint) +0:231 u1: direct index for structure ( uniform uint) +0:231 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:231 Constant: +0:231 0 (const uint) +0:232 imageAtomicMax ( temp uint) +0:232 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:232 u1: direct index for structure ( uniform uint) +0:232 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:232 Constant: +0:232 0 (const uint) +0:232 u1: direct index for structure ( uniform uint) +0:232 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:232 Constant: +0:232 0 (const uint) +0:233 move second child to first child ( temp uint) +0:233 'out_u1' ( temp uint) +0:233 imageAtomicMax ( temp uint) +0:233 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:233 u1: direct index for structure ( uniform uint) +0:233 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:233 Constant: +0:233 0 (const uint) +0:233 u1: direct index for structure ( uniform uint) +0:233 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:233 Constant: +0:233 0 (const uint) +0:234 imageAtomicMin ( temp uint) +0:234 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:234 u1: direct index for structure ( uniform uint) +0:234 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:234 Constant: +0:234 0 (const uint) +0:234 u1: direct index for structure ( uniform uint) +0:234 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:234 Constant: +0:234 0 (const uint) +0:235 move second child to first child ( temp uint) +0:235 'out_u1' ( temp uint) +0:235 imageAtomicMin ( temp uint) +0:235 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:235 u1: direct index for structure ( uniform uint) +0:235 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:235 Constant: +0:235 0 (const uint) +0:235 u1: direct index for structure ( uniform uint) +0:235 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:235 Constant: +0:235 0 (const uint) +0:236 imageAtomicOr ( temp uint) +0:236 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:236 u1: direct index for structure ( uniform uint) +0:236 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:236 Constant: +0:236 0 (const uint) +0:236 u1: direct index for structure ( uniform uint) +0:236 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:236 Constant: +0:236 0 (const uint) +0:237 move second child to first child ( temp uint) +0:237 'out_u1' ( temp uint) +0:237 imageAtomicOr ( temp uint) +0:237 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:237 u1: direct index for structure ( uniform uint) +0:237 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:237 Constant: +0:237 0 (const uint) +0:237 u1: direct index for structure ( uniform uint) +0:237 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:237 Constant: +0:237 0 (const uint) +0:238 imageAtomicXor ( temp uint) +0:238 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:238 u1: direct index for structure ( uniform uint) +0:238 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:238 Constant: +0:238 0 (const uint) +0:238 u1: direct index for structure ( uniform uint) +0:238 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:238 Constant: +0:238 0 (const uint) +0:239 move second child to first child ( temp uint) +0:239 'out_u1' ( temp uint) +0:239 imageAtomicXor ( temp uint) +0:239 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:239 u1: direct index for structure ( uniform uint) +0:239 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:239 Constant: +0:239 0 (const uint) +0:239 u1: direct index for structure ( uniform uint) +0:239 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:239 Constant: +0:239 0 (const uint) +0:242 move second child to first child ( temp 4-component vector of float) +0:242 Color: direct index for structure ( temp 4-component vector of float) +0:242 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:242 Constant: +0:242 0 (const int) +0:242 Constant: +0:242 1.000000 +0:242 1.000000 +0:242 1.000000 +0:242 1.000000 +0:243 Branch: Return with expression +0:243 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:45 Function Definition: main( ( temp void) +0:45 Function Parameters: +0:? Sequence +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:45 Color: direct index for structure ( temp 4-component vector of float) +0:45 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:45 Constant: +0:45 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' ( uniform sampler) +0:? 'g_tTex1df1' (layout( r32f) uniform image1D) +0:? 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:? 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:? 'g_tTex2df1' (layout( r32f) uniform image2D) +0:? 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:? 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:? 'g_tTex3df1' (layout( r32f) uniform image3D) +0:? 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:? 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:? 'g_tTex1df1a' (layout( r32f) uniform image1DArray) +0:? 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:? 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:? 'g_tTex2df1a' (layout( r32f) uniform image2DArray) +0:? 'g_tTex2di1a' (layout( r32i) uniform iimage2DArray) +0:? 'g_tTex2du1a' (layout( r32ui) uniform uimage2DArray) +0:? 'g_tBuffF' (layout( r32f) uniform imageBuffer) +0:? 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:? 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:45 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:45 Function Parameters: +0:? Sequence +0:50 imageAtomicAdd ( temp int) +0:50 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:50 i1: direct index for structure ( uniform int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:50 Constant: +0:50 5 (const uint) +0:50 i1b: direct index for structure ( uniform int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:50 Constant: +0:50 8 (const uint) +0:51 move second child to first child ( temp int) +0:51 'out_i1' ( temp int) +0:51 imageAtomicAdd ( temp int) +0:51 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:51 i1: direct index for structure ( uniform int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:51 Constant: +0:51 5 (const uint) +0:51 i1: direct index for structure ( uniform int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:51 Constant: +0:51 5 (const uint) +0:52 imageAtomicAnd ( temp int) +0:52 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:52 i1: direct index for structure ( uniform int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:52 Constant: +0:52 5 (const uint) +0:52 i1b: direct index for structure ( uniform int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:52 Constant: +0:52 8 (const uint) +0:53 move second child to first child ( temp int) +0:53 'out_i1' ( temp int) +0:53 imageAtomicAnd ( temp int) +0:53 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:53 i1: direct index for structure ( uniform int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:53 Constant: +0:53 5 (const uint) +0:53 i1: direct index for structure ( uniform int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:53 Constant: +0:53 5 (const uint) +0:54 move second child to first child ( temp int) +0:54 'out_i1' ( temp int) +0:54 imageAtomicCompSwap ( temp int) +0:54 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:54 i1: direct index for structure ( uniform int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:54 Constant: +0:54 5 (const uint) +0:54 i1b: direct index for structure ( uniform int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:54 Constant: +0:54 8 (const uint) +0:54 i1c: direct index for structure ( uniform int) +0:54 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:54 Constant: +0:54 9 (const uint) +0:55 move second child to first child ( temp int) +0:55 'out_i1' ( temp int) +0:55 imageAtomicExchange ( temp int) +0:55 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:55 i1: direct index for structure ( uniform int) +0:55 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:55 Constant: +0:55 5 (const uint) +0:55 i1: direct index for structure ( uniform int) +0:55 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:55 Constant: +0:55 5 (const uint) +0:56 imageAtomicMax ( temp int) +0:56 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:56 i1: direct index for structure ( uniform int) +0:56 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:56 Constant: +0:56 5 (const uint) +0:56 i1b: direct index for structure ( uniform int) +0:56 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:56 Constant: +0:56 8 (const uint) +0:57 move second child to first child ( temp int) +0:57 'out_i1' ( temp int) +0:57 imageAtomicMax ( temp int) +0:57 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:57 i1: direct index for structure ( uniform int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:57 Constant: +0:57 5 (const uint) +0:57 i1: direct index for structure ( uniform int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:57 Constant: +0:57 5 (const uint) +0:58 imageAtomicMin ( temp int) +0:58 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:58 i1: direct index for structure ( uniform int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:58 Constant: +0:58 5 (const uint) +0:58 i1b: direct index for structure ( uniform int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:58 Constant: +0:58 8 (const uint) +0:59 move second child to first child ( temp int) +0:59 'out_i1' ( temp int) +0:59 imageAtomicMin ( temp int) +0:59 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:59 i1: direct index for structure ( uniform int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:59 Constant: +0:59 5 (const uint) +0:59 i1: direct index for structure ( uniform int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:59 Constant: +0:59 5 (const uint) +0:60 imageAtomicOr ( temp int) +0:60 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:60 i1: direct index for structure ( uniform int) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:60 Constant: +0:60 5 (const uint) +0:60 i1b: direct index for structure ( uniform int) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:60 Constant: +0:60 8 (const uint) +0:61 move second child to first child ( temp int) +0:61 'out_i1' ( temp int) +0:61 imageAtomicOr ( temp int) +0:61 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:61 i1: direct index for structure ( uniform int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:61 Constant: +0:61 5 (const uint) +0:61 i1: direct index for structure ( uniform int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:61 Constant: +0:61 5 (const uint) +0:62 imageAtomicXor ( temp int) +0:62 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:62 i1: direct index for structure ( uniform int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:62 Constant: +0:62 5 (const uint) +0:62 i1b: direct index for structure ( uniform int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:62 Constant: +0:62 8 (const uint) +0:63 move second child to first child ( temp int) +0:63 'out_i1' ( temp int) +0:63 imageAtomicXor ( temp int) +0:63 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:63 i1: direct index for structure ( uniform int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:63 Constant: +0:63 5 (const uint) +0:63 i1: direct index for structure ( uniform int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:63 Constant: +0:63 5 (const uint) +0:66 imageAtomicAdd ( temp uint) +0:66 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:66 u1: direct index for structure ( uniform uint) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:66 Constant: +0:66 0 (const uint) +0:66 u1: direct index for structure ( uniform uint) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:66 Constant: +0:66 0 (const uint) +0:67 move second child to first child ( temp uint) +0:67 'out_u1' ( temp uint) +0:67 imageAtomicAdd ( temp uint) +0:67 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:67 u1: direct index for structure ( uniform uint) +0:67 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:67 Constant: +0:67 0 (const uint) +0:67 u1: direct index for structure ( uniform uint) +0:67 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:67 Constant: +0:67 0 (const uint) +0:68 imageAtomicAnd ( temp uint) +0:68 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:68 u1: direct index for structure ( uniform uint) +0:68 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:68 Constant: +0:68 0 (const uint) +0:68 u1: direct index for structure ( uniform uint) +0:68 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:68 Constant: +0:68 0 (const uint) +0:69 move second child to first child ( temp uint) +0:69 'out_u1' ( temp uint) +0:69 imageAtomicAnd ( temp uint) +0:69 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:69 u1: direct index for structure ( uniform uint) +0:69 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:69 Constant: +0:69 0 (const uint) +0:69 u1: direct index for structure ( uniform uint) +0:69 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:69 Constant: +0:69 0 (const uint) +0:70 move second child to first child ( temp uint) +0:70 'out_u1' ( temp uint) +0:70 imageAtomicCompSwap ( temp uint) +0:70 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:70 u1: direct index for structure ( uniform uint) +0:70 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:70 Constant: +0:70 0 (const uint) +0:70 u1b: direct index for structure ( uniform uint) +0:70 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:70 Constant: +0:70 3 (const uint) +0:70 u1c: direct index for structure ( uniform uint) +0:70 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:70 Constant: +0:70 4 (const uint) +0:71 move second child to first child ( temp uint) +0:71 'out_u1' ( temp uint) +0:71 imageAtomicExchange ( temp uint) +0:71 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:71 u1: direct index for structure ( uniform uint) +0:71 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:71 Constant: +0:71 0 (const uint) +0:71 u1: direct index for structure ( uniform uint) +0:71 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:71 Constant: +0:71 0 (const uint) +0:72 imageAtomicMax ( temp uint) +0:72 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:72 u1: direct index for structure ( uniform uint) +0:72 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:72 Constant: +0:72 0 (const uint) +0:72 u1: direct index for structure ( uniform uint) +0:72 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:72 Constant: +0:72 0 (const uint) +0:73 move second child to first child ( temp uint) +0:73 'out_u1' ( temp uint) +0:73 imageAtomicMax ( temp uint) +0:73 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:73 u1: direct index for structure ( uniform uint) +0:73 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:73 Constant: +0:73 0 (const uint) +0:73 u1: direct index for structure ( uniform uint) +0:73 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:73 Constant: +0:73 0 (const uint) +0:74 imageAtomicMin ( temp uint) +0:74 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:74 u1: direct index for structure ( uniform uint) +0:74 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:74 Constant: +0:74 0 (const uint) +0:74 u1: direct index for structure ( uniform uint) +0:74 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:74 Constant: +0:74 0 (const uint) +0:75 move second child to first child ( temp uint) +0:75 'out_u1' ( temp uint) +0:75 imageAtomicMin ( temp uint) +0:75 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:75 u1: direct index for structure ( uniform uint) +0:75 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:75 Constant: +0:75 0 (const uint) +0:75 u1: direct index for structure ( uniform uint) +0:75 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:75 Constant: +0:75 0 (const uint) +0:76 imageAtomicOr ( temp uint) +0:76 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:76 u1: direct index for structure ( uniform uint) +0:76 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:76 Constant: +0:76 0 (const uint) +0:76 u1: direct index for structure ( uniform uint) +0:76 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:76 Constant: +0:76 0 (const uint) +0:77 move second child to first child ( temp uint) +0:77 'out_u1' ( temp uint) +0:77 imageAtomicOr ( temp uint) +0:77 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:77 u1: direct index for structure ( uniform uint) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:77 Constant: +0:77 0 (const uint) +0:77 u1: direct index for structure ( uniform uint) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:77 Constant: +0:77 0 (const uint) +0:78 imageAtomicXor ( temp uint) +0:78 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:78 u1: direct index for structure ( uniform uint) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:78 Constant: +0:78 0 (const uint) +0:78 u1: direct index for structure ( uniform uint) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:78 Constant: +0:78 0 (const uint) +0:79 move second child to first child ( temp uint) +0:79 'out_u1' ( temp uint) +0:79 imageAtomicXor ( temp uint) +0:79 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:79 u1: direct index for structure ( uniform uint) +0:79 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:79 Constant: +0:79 0 (const uint) +0:79 u1: direct index for structure ( uniform uint) +0:79 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:79 Constant: +0:79 0 (const uint) +0:82 imageAtomicAdd ( temp int) +0:82 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:82 i2: direct index for structure ( uniform 2-component vector of int) +0:82 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:82 Constant: +0:82 6 (const uint) +0:82 i1b: direct index for structure ( uniform int) +0:82 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:82 Constant: +0:82 8 (const uint) +0:83 move second child to first child ( temp int) +0:83 'out_i1' ( temp int) +0:83 imageAtomicAdd ( temp int) +0:83 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:83 i2: direct index for structure ( uniform 2-component vector of int) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:83 Constant: +0:83 6 (const uint) +0:83 i1: direct index for structure ( uniform int) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:83 Constant: +0:83 5 (const uint) +0:84 imageAtomicAnd ( temp int) +0:84 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:84 i2: direct index for structure ( uniform 2-component vector of int) +0:84 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:84 Constant: +0:84 6 (const uint) +0:84 i1b: direct index for structure ( uniform int) +0:84 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:84 Constant: +0:84 8 (const uint) +0:85 move second child to first child ( temp int) +0:85 'out_i1' ( temp int) +0:85 imageAtomicAnd ( temp int) +0:85 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:85 i2: direct index for structure ( uniform 2-component vector of int) +0:85 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:85 Constant: +0:85 6 (const uint) +0:85 i1: direct index for structure ( uniform int) +0:85 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:85 Constant: +0:85 5 (const uint) +0:86 move second child to first child ( temp int) +0:86 'out_i1' ( temp int) +0:86 imageAtomicCompSwap ( temp int) +0:86 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:86 i2: direct index for structure ( uniform 2-component vector of int) +0:86 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:86 Constant: +0:86 6 (const uint) +0:86 i1b: direct index for structure ( uniform int) +0:86 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:86 Constant: +0:86 8 (const uint) +0:86 i1c: direct index for structure ( uniform int) +0:86 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:86 Constant: +0:86 9 (const uint) +0:87 move second child to first child ( temp int) +0:87 'out_i1' ( temp int) +0:87 imageAtomicExchange ( temp int) +0:87 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:87 i2: direct index for structure ( uniform 2-component vector of int) +0:87 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:87 Constant: +0:87 6 (const uint) +0:87 i1: direct index for structure ( uniform int) +0:87 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:87 Constant: +0:87 5 (const uint) +0:88 imageAtomicMax ( temp int) +0:88 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:88 i2: direct index for structure ( uniform 2-component vector of int) +0:88 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:88 Constant: +0:88 6 (const uint) +0:88 i1b: direct index for structure ( uniform int) +0:88 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:88 Constant: +0:88 8 (const uint) +0:89 move second child to first child ( temp int) +0:89 'out_i1' ( temp int) +0:89 imageAtomicMax ( temp int) +0:89 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:89 i2: direct index for structure ( uniform 2-component vector of int) +0:89 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:89 Constant: +0:89 6 (const uint) +0:89 i1: direct index for structure ( uniform int) +0:89 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:89 Constant: +0:89 5 (const uint) +0:90 imageAtomicMin ( temp int) +0:90 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:90 i2: direct index for structure ( uniform 2-component vector of int) +0:90 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:90 Constant: +0:90 6 (const uint) +0:90 i1b: direct index for structure ( uniform int) +0:90 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:90 Constant: +0:90 8 (const uint) +0:91 move second child to first child ( temp int) +0:91 'out_i1' ( temp int) +0:91 imageAtomicMin ( temp int) +0:91 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:91 i2: direct index for structure ( uniform 2-component vector of int) +0:91 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:91 Constant: +0:91 6 (const uint) +0:91 i1: direct index for structure ( uniform int) +0:91 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:91 Constant: +0:91 5 (const uint) +0:92 imageAtomicOr ( temp int) +0:92 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:92 i2: direct index for structure ( uniform 2-component vector of int) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:92 Constant: +0:92 6 (const uint) +0:92 i1b: direct index for structure ( uniform int) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:92 Constant: +0:92 8 (const uint) +0:93 move second child to first child ( temp int) +0:93 'out_i1' ( temp int) +0:93 imageAtomicOr ( temp int) +0:93 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:93 i2: direct index for structure ( uniform 2-component vector of int) +0:93 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:93 Constant: +0:93 6 (const uint) +0:93 i1: direct index for structure ( uniform int) +0:93 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:93 Constant: +0:93 5 (const uint) +0:94 imageAtomicXor ( temp int) +0:94 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:94 i2: direct index for structure ( uniform 2-component vector of int) +0:94 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:94 Constant: +0:94 6 (const uint) +0:94 i1b: direct index for structure ( uniform int) +0:94 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:94 Constant: +0:94 8 (const uint) +0:95 move second child to first child ( temp int) +0:95 'out_i1' ( temp int) +0:95 imageAtomicXor ( temp int) +0:95 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:95 i2: direct index for structure ( uniform 2-component vector of int) +0:95 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:95 Constant: +0:95 6 (const uint) +0:95 i1: direct index for structure ( uniform int) +0:95 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:95 Constant: +0:95 5 (const uint) +0:98 imageAtomicAdd ( temp uint) +0:98 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:98 u2: direct index for structure ( uniform 2-component vector of uint) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:98 Constant: +0:98 1 (const uint) +0:98 u1: direct index for structure ( uniform uint) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:98 Constant: +0:98 0 (const uint) +0:99 move second child to first child ( temp uint) +0:99 'out_u1' ( temp uint) +0:99 imageAtomicAdd ( temp uint) +0:99 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:99 u2: direct index for structure ( uniform 2-component vector of uint) +0:99 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:99 Constant: +0:99 1 (const uint) +0:99 u1: direct index for structure ( uniform uint) +0:99 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:99 Constant: +0:99 0 (const uint) +0:100 imageAtomicAnd ( temp uint) +0:100 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:100 u2: direct index for structure ( uniform 2-component vector of uint) +0:100 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:100 Constant: +0:100 1 (const uint) +0:100 u1: direct index for structure ( uniform uint) +0:100 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:100 Constant: +0:100 0 (const uint) +0:101 move second child to first child ( temp uint) +0:101 'out_u1' ( temp uint) +0:101 imageAtomicAnd ( temp uint) +0:101 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:101 u2: direct index for structure ( uniform 2-component vector of uint) +0:101 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:101 Constant: +0:101 1 (const uint) +0:101 u1: direct index for structure ( uniform uint) +0:101 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:101 Constant: +0:101 0 (const uint) +0:102 move second child to first child ( temp uint) +0:102 'out_u1' ( temp uint) +0:102 imageAtomicCompSwap ( temp uint) +0:102 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:102 u2: direct index for structure ( uniform 2-component vector of uint) +0:102 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:102 Constant: +0:102 1 (const uint) +0:102 u1b: direct index for structure ( uniform uint) +0:102 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:102 Constant: +0:102 3 (const uint) +0:102 u1c: direct index for structure ( uniform uint) +0:102 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:102 Constant: +0:102 4 (const uint) +0:103 move second child to first child ( temp uint) +0:103 'out_u1' ( temp uint) +0:103 imageAtomicExchange ( temp uint) +0:103 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:103 u2: direct index for structure ( uniform 2-component vector of uint) +0:103 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:103 Constant: +0:103 1 (const uint) +0:103 u1: direct index for structure ( uniform uint) +0:103 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:103 Constant: +0:103 0 (const uint) +0:104 imageAtomicMax ( temp uint) +0:104 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:104 u2: direct index for structure ( uniform 2-component vector of uint) +0:104 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:104 Constant: +0:104 1 (const uint) +0:104 u1: direct index for structure ( uniform uint) +0:104 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:104 Constant: +0:104 0 (const uint) +0:105 move second child to first child ( temp uint) +0:105 'out_u1' ( temp uint) +0:105 imageAtomicMax ( temp uint) +0:105 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:105 u2: direct index for structure ( uniform 2-component vector of uint) +0:105 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:105 Constant: +0:105 1 (const uint) +0:105 u1: direct index for structure ( uniform uint) +0:105 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:105 Constant: +0:105 0 (const uint) +0:106 imageAtomicMin ( temp uint) +0:106 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:106 u2: direct index for structure ( uniform 2-component vector of uint) +0:106 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:106 Constant: +0:106 1 (const uint) +0:106 u1: direct index for structure ( uniform uint) +0:106 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:106 Constant: +0:106 0 (const uint) +0:107 move second child to first child ( temp uint) +0:107 'out_u1' ( temp uint) +0:107 imageAtomicMin ( temp uint) +0:107 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:107 u2: direct index for structure ( uniform 2-component vector of uint) +0:107 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:107 Constant: +0:107 1 (const uint) +0:107 u1: direct index for structure ( uniform uint) +0:107 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:107 Constant: +0:107 0 (const uint) +0:108 imageAtomicOr ( temp uint) +0:108 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:108 u2: direct index for structure ( uniform 2-component vector of uint) +0:108 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:108 Constant: +0:108 1 (const uint) +0:108 u1: direct index for structure ( uniform uint) +0:108 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:108 Constant: +0:108 0 (const uint) +0:109 move second child to first child ( temp uint) +0:109 'out_u1' ( temp uint) +0:109 imageAtomicOr ( temp uint) +0:109 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:109 u2: direct index for structure ( uniform 2-component vector of uint) +0:109 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:109 Constant: +0:109 1 (const uint) +0:109 u1: direct index for structure ( uniform uint) +0:109 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:109 Constant: +0:109 0 (const uint) +0:110 imageAtomicXor ( temp uint) +0:110 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:110 u2: direct index for structure ( uniform 2-component vector of uint) +0:110 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:110 Constant: +0:110 1 (const uint) +0:110 u1: direct index for structure ( uniform uint) +0:110 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:110 Constant: +0:110 0 (const uint) +0:111 move second child to first child ( temp uint) +0:111 'out_u1' ( temp uint) +0:111 imageAtomicXor ( temp uint) +0:111 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:111 u2: direct index for structure ( uniform 2-component vector of uint) +0:111 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:111 Constant: +0:111 1 (const uint) +0:111 u1: direct index for structure ( uniform uint) +0:111 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:111 Constant: +0:111 0 (const uint) +0:114 imageAtomicAdd ( temp int) +0:114 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:114 i3: direct index for structure ( uniform 3-component vector of int) +0:114 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:114 Constant: +0:114 7 (const uint) +0:114 i1b: direct index for structure ( uniform int) +0:114 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:114 Constant: +0:114 8 (const uint) +0:115 move second child to first child ( temp int) +0:115 'out_i1' ( temp int) +0:115 imageAtomicAdd ( temp int) +0:115 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:115 i3: direct index for structure ( uniform 3-component vector of int) +0:115 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:115 Constant: +0:115 7 (const uint) +0:115 i1: direct index for structure ( uniform int) +0:115 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:115 Constant: +0:115 5 (const uint) +0:116 imageAtomicAnd ( temp int) +0:116 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:116 i3: direct index for structure ( uniform 3-component vector of int) +0:116 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:116 Constant: +0:116 7 (const uint) +0:116 i1b: direct index for structure ( uniform int) +0:116 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:116 Constant: +0:116 8 (const uint) +0:117 move second child to first child ( temp int) +0:117 'out_i1' ( temp int) +0:117 imageAtomicAnd ( temp int) +0:117 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:117 i3: direct index for structure ( uniform 3-component vector of int) +0:117 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:117 Constant: +0:117 7 (const uint) +0:117 i1: direct index for structure ( uniform int) +0:117 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:117 Constant: +0:117 5 (const uint) +0:118 move second child to first child ( temp int) +0:118 'out_i1' ( temp int) +0:118 imageAtomicCompSwap ( temp int) +0:118 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:118 i3: direct index for structure ( uniform 3-component vector of int) +0:118 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:118 Constant: +0:118 7 (const uint) +0:118 i1b: direct index for structure ( uniform int) +0:118 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:118 Constant: +0:118 8 (const uint) +0:118 i1c: direct index for structure ( uniform int) +0:118 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:118 Constant: +0:118 9 (const uint) +0:119 move second child to first child ( temp int) +0:119 'out_i1' ( temp int) +0:119 imageAtomicExchange ( temp int) +0:119 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:119 i3: direct index for structure ( uniform 3-component vector of int) +0:119 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:119 Constant: +0:119 7 (const uint) +0:119 i1: direct index for structure ( uniform int) +0:119 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:119 Constant: +0:119 5 (const uint) +0:120 imageAtomicMax ( temp int) +0:120 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:120 i3: direct index for structure ( uniform 3-component vector of int) +0:120 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:120 Constant: +0:120 7 (const uint) +0:120 i1b: direct index for structure ( uniform int) +0:120 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:120 Constant: +0:120 8 (const uint) +0:121 move second child to first child ( temp int) +0:121 'out_i1' ( temp int) +0:121 imageAtomicMax ( temp int) +0:121 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:121 i3: direct index for structure ( uniform 3-component vector of int) +0:121 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:121 Constant: +0:121 7 (const uint) +0:121 i1: direct index for structure ( uniform int) +0:121 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:121 Constant: +0:121 5 (const uint) +0:122 imageAtomicMin ( temp int) +0:122 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:122 i3: direct index for structure ( uniform 3-component vector of int) +0:122 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:122 Constant: +0:122 7 (const uint) +0:122 i1b: direct index for structure ( uniform int) +0:122 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:122 Constant: +0:122 8 (const uint) +0:123 move second child to first child ( temp int) +0:123 'out_i1' ( temp int) +0:123 imageAtomicMin ( temp int) +0:123 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:123 i3: direct index for structure ( uniform 3-component vector of int) +0:123 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:123 Constant: +0:123 7 (const uint) +0:123 i1: direct index for structure ( uniform int) +0:123 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:123 Constant: +0:123 5 (const uint) +0:124 imageAtomicOr ( temp int) +0:124 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:124 i3: direct index for structure ( uniform 3-component vector of int) +0:124 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:124 Constant: +0:124 7 (const uint) +0:124 i1b: direct index for structure ( uniform int) +0:124 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:124 Constant: +0:124 8 (const uint) +0:125 move second child to first child ( temp int) +0:125 'out_i1' ( temp int) +0:125 imageAtomicOr ( temp int) +0:125 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:125 i3: direct index for structure ( uniform 3-component vector of int) +0:125 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:125 Constant: +0:125 7 (const uint) +0:125 i1: direct index for structure ( uniform int) +0:125 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:125 Constant: +0:125 5 (const uint) +0:126 imageAtomicXor ( temp int) +0:126 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:126 i3: direct index for structure ( uniform 3-component vector of int) +0:126 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:126 Constant: +0:126 7 (const uint) +0:126 i1b: direct index for structure ( uniform int) +0:126 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:126 Constant: +0:126 8 (const uint) +0:127 move second child to first child ( temp int) +0:127 'out_i1' ( temp int) +0:127 imageAtomicXor ( temp int) +0:127 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:127 i3: direct index for structure ( uniform 3-component vector of int) +0:127 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:127 Constant: +0:127 7 (const uint) +0:127 i1: direct index for structure ( uniform int) +0:127 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:127 Constant: +0:127 5 (const uint) +0:130 imageAtomicAdd ( temp uint) +0:130 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:130 u3: direct index for structure ( uniform 3-component vector of uint) +0:130 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:130 Constant: +0:130 2 (const uint) +0:130 u1: direct index for structure ( uniform uint) +0:130 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:130 Constant: +0:130 0 (const uint) +0:131 move second child to first child ( temp uint) +0:131 'out_u1' ( temp uint) +0:131 imageAtomicAdd ( temp uint) +0:131 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:131 u3: direct index for structure ( uniform 3-component vector of uint) +0:131 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:131 Constant: +0:131 2 (const uint) +0:131 u1: direct index for structure ( uniform uint) +0:131 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:131 Constant: +0:131 0 (const uint) +0:132 imageAtomicAnd ( temp uint) +0:132 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:132 u3: direct index for structure ( uniform 3-component vector of uint) +0:132 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:132 Constant: +0:132 2 (const uint) +0:132 u1: direct index for structure ( uniform uint) +0:132 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:132 Constant: +0:132 0 (const uint) +0:133 move second child to first child ( temp uint) +0:133 'out_u1' ( temp uint) +0:133 imageAtomicAnd ( temp uint) +0:133 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:133 u3: direct index for structure ( uniform 3-component vector of uint) +0:133 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:133 Constant: +0:133 2 (const uint) +0:133 u1: direct index for structure ( uniform uint) +0:133 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:133 Constant: +0:133 0 (const uint) +0:134 move second child to first child ( temp uint) +0:134 'out_u1' ( temp uint) +0:134 imageAtomicCompSwap ( temp uint) +0:134 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:134 u3: direct index for structure ( uniform 3-component vector of uint) +0:134 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:134 Constant: +0:134 2 (const uint) +0:134 u1b: direct index for structure ( uniform uint) +0:134 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:134 Constant: +0:134 3 (const uint) +0:134 u1c: direct index for structure ( uniform uint) +0:134 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:134 Constant: +0:134 4 (const uint) +0:135 move second child to first child ( temp uint) +0:135 'out_u1' ( temp uint) +0:135 imageAtomicExchange ( temp uint) +0:135 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:135 u3: direct index for structure ( uniform 3-component vector of uint) +0:135 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:135 Constant: +0:135 2 (const uint) +0:135 u1: direct index for structure ( uniform uint) +0:135 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:135 Constant: +0:135 0 (const uint) +0:136 imageAtomicMax ( temp uint) +0:136 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:136 u3: direct index for structure ( uniform 3-component vector of uint) +0:136 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:136 Constant: +0:136 2 (const uint) +0:136 u1: direct index for structure ( uniform uint) +0:136 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:136 Constant: +0:136 0 (const uint) +0:137 move second child to first child ( temp uint) +0:137 'out_u1' ( temp uint) +0:137 imageAtomicMax ( temp uint) +0:137 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:137 u3: direct index for structure ( uniform 3-component vector of uint) +0:137 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:137 Constant: +0:137 2 (const uint) +0:137 u1: direct index for structure ( uniform uint) +0:137 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:137 Constant: +0:137 0 (const uint) +0:138 imageAtomicMin ( temp uint) +0:138 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:138 u3: direct index for structure ( uniform 3-component vector of uint) +0:138 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:138 Constant: +0:138 2 (const uint) +0:138 u1: direct index for structure ( uniform uint) +0:138 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:138 Constant: +0:138 0 (const uint) +0:139 move second child to first child ( temp uint) +0:139 'out_u1' ( temp uint) +0:139 imageAtomicMin ( temp uint) +0:139 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:139 u3: direct index for structure ( uniform 3-component vector of uint) +0:139 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:139 Constant: +0:139 2 (const uint) +0:139 u1: direct index for structure ( uniform uint) +0:139 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:139 Constant: +0:139 0 (const uint) +0:140 imageAtomicOr ( temp uint) +0:140 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:140 u3: direct index for structure ( uniform 3-component vector of uint) +0:140 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:140 Constant: +0:140 2 (const uint) +0:140 u1: direct index for structure ( uniform uint) +0:140 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:140 Constant: +0:140 0 (const uint) +0:141 move second child to first child ( temp uint) +0:141 'out_u1' ( temp uint) +0:141 imageAtomicOr ( temp uint) +0:141 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:141 u3: direct index for structure ( uniform 3-component vector of uint) +0:141 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:141 Constant: +0:141 2 (const uint) +0:141 u1: direct index for structure ( uniform uint) +0:141 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:141 Constant: +0:141 0 (const uint) +0:142 imageAtomicXor ( temp uint) +0:142 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:142 u3: direct index for structure ( uniform 3-component vector of uint) +0:142 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:142 Constant: +0:142 2 (const uint) +0:142 u1: direct index for structure ( uniform uint) +0:142 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:142 Constant: +0:142 0 (const uint) +0:143 move second child to first child ( temp uint) +0:143 'out_u1' ( temp uint) +0:143 imageAtomicXor ( temp uint) +0:143 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:143 u3: direct index for structure ( uniform 3-component vector of uint) +0:143 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:143 Constant: +0:143 2 (const uint) +0:143 u1: direct index for structure ( uniform uint) +0:143 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:143 Constant: +0:143 0 (const uint) +0:146 imageAtomicAdd ( temp int) +0:146 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:146 i2: direct index for structure ( uniform 2-component vector of int) +0:146 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:146 Constant: +0:146 6 (const uint) +0:146 i1b: direct index for structure ( uniform int) +0:146 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:146 Constant: +0:146 8 (const uint) +0:147 move second child to first child ( temp int) +0:147 'out_i1' ( temp int) +0:147 imageAtomicAdd ( temp int) +0:147 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:147 i2: direct index for structure ( uniform 2-component vector of int) +0:147 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:147 Constant: +0:147 6 (const uint) +0:147 i1: direct index for structure ( uniform int) +0:147 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:147 Constant: +0:147 5 (const uint) +0:148 imageAtomicAnd ( temp int) +0:148 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:148 i2: direct index for structure ( uniform 2-component vector of int) +0:148 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:148 Constant: +0:148 6 (const uint) +0:148 i1b: direct index for structure ( uniform int) +0:148 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:148 Constant: +0:148 8 (const uint) +0:149 move second child to first child ( temp int) +0:149 'out_i1' ( temp int) +0:149 imageAtomicAnd ( temp int) +0:149 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:149 i2: direct index for structure ( uniform 2-component vector of int) +0:149 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:149 Constant: +0:149 6 (const uint) +0:149 i1: direct index for structure ( uniform int) +0:149 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:149 Constant: +0:149 5 (const uint) +0:150 move second child to first child ( temp int) +0:150 'out_i1' ( temp int) +0:150 imageAtomicCompSwap ( temp int) +0:150 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:150 i2: direct index for structure ( uniform 2-component vector of int) +0:150 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:150 Constant: +0:150 6 (const uint) +0:150 i1b: direct index for structure ( uniform int) +0:150 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:150 Constant: +0:150 8 (const uint) +0:150 i1c: direct index for structure ( uniform int) +0:150 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:150 Constant: +0:150 9 (const uint) +0:151 move second child to first child ( temp int) +0:151 'out_i1' ( temp int) +0:151 imageAtomicExchange ( temp int) +0:151 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:151 i2: direct index for structure ( uniform 2-component vector of int) +0:151 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:151 Constant: +0:151 6 (const uint) +0:151 i1: direct index for structure ( uniform int) +0:151 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:151 Constant: +0:151 5 (const uint) +0:152 imageAtomicMax ( temp int) +0:152 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:152 i2: direct index for structure ( uniform 2-component vector of int) +0:152 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:152 Constant: +0:152 6 (const uint) +0:152 i1b: direct index for structure ( uniform int) +0:152 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:152 Constant: +0:152 8 (const uint) +0:153 move second child to first child ( temp int) +0:153 'out_i1' ( temp int) +0:153 imageAtomicMax ( temp int) +0:153 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:153 i2: direct index for structure ( uniform 2-component vector of int) +0:153 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:153 Constant: +0:153 6 (const uint) +0:153 i1: direct index for structure ( uniform int) +0:153 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:153 Constant: +0:153 5 (const uint) +0:154 imageAtomicMin ( temp int) +0:154 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:154 i2: direct index for structure ( uniform 2-component vector of int) +0:154 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:154 Constant: +0:154 6 (const uint) +0:154 i1b: direct index for structure ( uniform int) +0:154 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:154 Constant: +0:154 8 (const uint) +0:155 move second child to first child ( temp int) +0:155 'out_i1' ( temp int) +0:155 imageAtomicMin ( temp int) +0:155 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:155 i2: direct index for structure ( uniform 2-component vector of int) +0:155 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:155 Constant: +0:155 6 (const uint) +0:155 i1: direct index for structure ( uniform int) +0:155 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:155 Constant: +0:155 5 (const uint) +0:156 imageAtomicOr ( temp int) +0:156 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:156 i2: direct index for structure ( uniform 2-component vector of int) +0:156 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:156 Constant: +0:156 6 (const uint) +0:156 i1b: direct index for structure ( uniform int) +0:156 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:156 Constant: +0:156 8 (const uint) +0:157 move second child to first child ( temp int) +0:157 'out_i1' ( temp int) +0:157 imageAtomicOr ( temp int) +0:157 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:157 i2: direct index for structure ( uniform 2-component vector of int) +0:157 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:157 Constant: +0:157 6 (const uint) +0:157 i1: direct index for structure ( uniform int) +0:157 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:157 Constant: +0:157 5 (const uint) +0:158 imageAtomicXor ( temp int) +0:158 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:158 i2: direct index for structure ( uniform 2-component vector of int) +0:158 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:158 Constant: +0:158 6 (const uint) +0:158 i1b: direct index for structure ( uniform int) +0:158 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:158 Constant: +0:158 8 (const uint) +0:159 move second child to first child ( temp int) +0:159 'out_i1' ( temp int) +0:159 imageAtomicXor ( temp int) +0:159 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:159 i2: direct index for structure ( uniform 2-component vector of int) +0:159 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:159 Constant: +0:159 6 (const uint) +0:159 i1: direct index for structure ( uniform int) +0:159 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:159 Constant: +0:159 5 (const uint) +0:162 imageAtomicAdd ( temp uint) +0:162 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:162 u2: direct index for structure ( uniform 2-component vector of uint) +0:162 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:162 Constant: +0:162 1 (const uint) +0:162 u1: direct index for structure ( uniform uint) +0:162 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:162 Constant: +0:162 0 (const uint) +0:163 move second child to first child ( temp uint) +0:163 'out_u1' ( temp uint) +0:163 imageAtomicAdd ( temp uint) +0:163 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:163 u2: direct index for structure ( uniform 2-component vector of uint) +0:163 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:163 Constant: +0:163 1 (const uint) +0:163 u1: direct index for structure ( uniform uint) +0:163 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:163 Constant: +0:163 0 (const uint) +0:164 imageAtomicAnd ( temp uint) +0:164 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:164 u2: direct index for structure ( uniform 2-component vector of uint) +0:164 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:164 Constant: +0:164 1 (const uint) +0:164 u1: direct index for structure ( uniform uint) +0:164 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:164 Constant: +0:164 0 (const uint) +0:165 move second child to first child ( temp uint) +0:165 'out_u1' ( temp uint) +0:165 imageAtomicAnd ( temp uint) +0:165 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:165 u2: direct index for structure ( uniform 2-component vector of uint) +0:165 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:165 Constant: +0:165 1 (const uint) +0:165 u1: direct index for structure ( uniform uint) +0:165 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:165 Constant: +0:165 0 (const uint) +0:166 move second child to first child ( temp uint) +0:166 'out_u1' ( temp uint) +0:166 imageAtomicCompSwap ( temp uint) +0:166 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:166 u2: direct index for structure ( uniform 2-component vector of uint) +0:166 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:166 Constant: +0:166 1 (const uint) +0:166 u1b: direct index for structure ( uniform uint) +0:166 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:166 Constant: +0:166 3 (const uint) +0:166 u1c: direct index for structure ( uniform uint) +0:166 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:166 Constant: +0:166 4 (const uint) +0:167 move second child to first child ( temp uint) +0:167 'out_u1' ( temp uint) +0:167 imageAtomicExchange ( temp uint) +0:167 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:167 u2: direct index for structure ( uniform 2-component vector of uint) +0:167 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:167 Constant: +0:167 1 (const uint) +0:167 u1: direct index for structure ( uniform uint) +0:167 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:167 Constant: +0:167 0 (const uint) +0:168 imageAtomicMax ( temp uint) +0:168 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:168 u2: direct index for structure ( uniform 2-component vector of uint) +0:168 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:168 Constant: +0:168 1 (const uint) +0:168 u1: direct index for structure ( uniform uint) +0:168 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:168 Constant: +0:168 0 (const uint) +0:169 move second child to first child ( temp uint) +0:169 'out_u1' ( temp uint) +0:169 imageAtomicMax ( temp uint) +0:169 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:169 u2: direct index for structure ( uniform 2-component vector of uint) +0:169 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:169 Constant: +0:169 1 (const uint) +0:169 u1: direct index for structure ( uniform uint) +0:169 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:169 Constant: +0:169 0 (const uint) +0:170 imageAtomicMin ( temp uint) +0:170 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:170 u2: direct index for structure ( uniform 2-component vector of uint) +0:170 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:170 Constant: +0:170 1 (const uint) +0:170 u1: direct index for structure ( uniform uint) +0:170 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:170 Constant: +0:170 0 (const uint) +0:171 move second child to first child ( temp uint) +0:171 'out_u1' ( temp uint) +0:171 imageAtomicMin ( temp uint) +0:171 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:171 u2: direct index for structure ( uniform 2-component vector of uint) +0:171 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:171 Constant: +0:171 1 (const uint) +0:171 u1: direct index for structure ( uniform uint) +0:171 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:171 Constant: +0:171 0 (const uint) +0:172 imageAtomicOr ( temp uint) +0:172 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:172 u2: direct index for structure ( uniform 2-component vector of uint) +0:172 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:172 Constant: +0:172 1 (const uint) +0:172 u1: direct index for structure ( uniform uint) +0:172 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:172 Constant: +0:172 0 (const uint) +0:173 move second child to first child ( temp uint) +0:173 'out_u1' ( temp uint) +0:173 imageAtomicOr ( temp uint) +0:173 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:173 u2: direct index for structure ( uniform 2-component vector of uint) +0:173 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:173 Constant: +0:173 1 (const uint) +0:173 u1: direct index for structure ( uniform uint) +0:173 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:173 Constant: +0:173 0 (const uint) +0:174 imageAtomicXor ( temp uint) +0:174 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:174 u2: direct index for structure ( uniform 2-component vector of uint) +0:174 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:174 Constant: +0:174 1 (const uint) +0:174 u1: direct index for structure ( uniform uint) +0:174 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:174 Constant: +0:174 0 (const uint) +0:175 move second child to first child ( temp uint) +0:175 'out_u1' ( temp uint) +0:175 imageAtomicXor ( temp uint) +0:175 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:175 u2: direct index for structure ( uniform 2-component vector of uint) +0:175 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:175 Constant: +0:175 1 (const uint) +0:175 u1: direct index for structure ( uniform uint) +0:175 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:175 Constant: +0:175 0 (const uint) +0:178 imageAtomicAdd ( temp int) +0:178 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:178 i2: direct index for structure ( uniform 2-component vector of int) +0:178 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:178 Constant: +0:178 6 (const uint) +0:178 i1b: direct index for structure ( uniform int) +0:178 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:178 Constant: +0:178 8 (const uint) +0:179 move second child to first child ( temp int) +0:179 'out_i1' ( temp int) +0:179 imageAtomicAdd ( temp int) +0:179 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:179 i2: direct index for structure ( uniform 2-component vector of int) +0:179 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:179 Constant: +0:179 6 (const uint) +0:179 i1: direct index for structure ( uniform int) +0:179 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:179 Constant: +0:179 5 (const uint) +0:180 imageAtomicAnd ( temp int) +0:180 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:180 i2: direct index for structure ( uniform 2-component vector of int) +0:180 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:180 Constant: +0:180 6 (const uint) +0:180 i1b: direct index for structure ( uniform int) +0:180 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:180 Constant: +0:180 8 (const uint) +0:181 move second child to first child ( temp int) +0:181 'out_i1' ( temp int) +0:181 imageAtomicAnd ( temp int) +0:181 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:181 i2: direct index for structure ( uniform 2-component vector of int) +0:181 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:181 Constant: +0:181 6 (const uint) +0:181 i1: direct index for structure ( uniform int) +0:181 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:181 Constant: +0:181 5 (const uint) +0:182 move second child to first child ( temp int) +0:182 'out_i1' ( temp int) +0:182 imageAtomicCompSwap ( temp int) +0:182 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:182 i2: direct index for structure ( uniform 2-component vector of int) +0:182 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:182 Constant: +0:182 6 (const uint) +0:182 i1b: direct index for structure ( uniform int) +0:182 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:182 Constant: +0:182 8 (const uint) +0:182 i1c: direct index for structure ( uniform int) +0:182 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:182 Constant: +0:182 9 (const uint) +0:183 move second child to first child ( temp int) +0:183 'out_i1' ( temp int) +0:183 imageAtomicExchange ( temp int) +0:183 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:183 i2: direct index for structure ( uniform 2-component vector of int) +0:183 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:183 Constant: +0:183 6 (const uint) +0:183 i1: direct index for structure ( uniform int) +0:183 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:183 Constant: +0:183 5 (const uint) +0:184 imageAtomicMax ( temp int) +0:184 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:184 i2: direct index for structure ( uniform 2-component vector of int) +0:184 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:184 Constant: +0:184 6 (const uint) +0:184 i1b: direct index for structure ( uniform int) +0:184 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:184 Constant: +0:184 8 (const uint) +0:185 move second child to first child ( temp int) +0:185 'out_i1' ( temp int) +0:185 imageAtomicMax ( temp int) +0:185 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:185 i2: direct index for structure ( uniform 2-component vector of int) +0:185 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:185 Constant: +0:185 6 (const uint) +0:185 i1: direct index for structure ( uniform int) +0:185 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:185 Constant: +0:185 5 (const uint) +0:186 imageAtomicMin ( temp int) +0:186 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:186 i2: direct index for structure ( uniform 2-component vector of int) +0:186 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:186 Constant: +0:186 6 (const uint) +0:186 i1b: direct index for structure ( uniform int) +0:186 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:186 Constant: +0:186 8 (const uint) +0:187 move second child to first child ( temp int) +0:187 'out_i1' ( temp int) +0:187 imageAtomicMin ( temp int) +0:187 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:187 i2: direct index for structure ( uniform 2-component vector of int) +0:187 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:187 Constant: +0:187 6 (const uint) +0:187 i1: direct index for structure ( uniform int) +0:187 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:187 Constant: +0:187 5 (const uint) +0:188 imageAtomicOr ( temp int) +0:188 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:188 i2: direct index for structure ( uniform 2-component vector of int) +0:188 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:188 Constant: +0:188 6 (const uint) +0:188 i1b: direct index for structure ( uniform int) +0:188 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:188 Constant: +0:188 8 (const uint) +0:189 move second child to first child ( temp int) +0:189 'out_i1' ( temp int) +0:189 imageAtomicOr ( temp int) +0:189 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:189 i2: direct index for structure ( uniform 2-component vector of int) +0:189 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:189 Constant: +0:189 6 (const uint) +0:189 i1: direct index for structure ( uniform int) +0:189 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:189 Constant: +0:189 5 (const uint) +0:190 imageAtomicXor ( temp int) +0:190 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:190 i2: direct index for structure ( uniform 2-component vector of int) +0:190 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:190 Constant: +0:190 6 (const uint) +0:190 i1b: direct index for structure ( uniform int) +0:190 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:190 Constant: +0:190 8 (const uint) +0:191 move second child to first child ( temp int) +0:191 'out_i1' ( temp int) +0:191 imageAtomicXor ( temp int) +0:191 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:191 i2: direct index for structure ( uniform 2-component vector of int) +0:191 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:191 Constant: +0:191 6 (const uint) +0:191 i1: direct index for structure ( uniform int) +0:191 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:191 Constant: +0:191 5 (const uint) +0:194 imageAtomicAdd ( temp uint) +0:194 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:194 u2: direct index for structure ( uniform 2-component vector of uint) +0:194 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:194 Constant: +0:194 1 (const uint) +0:194 u1: direct index for structure ( uniform uint) +0:194 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:194 Constant: +0:194 0 (const uint) +0:195 move second child to first child ( temp uint) +0:195 'out_u1' ( temp uint) +0:195 imageAtomicAdd ( temp uint) +0:195 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:195 u2: direct index for structure ( uniform 2-component vector of uint) +0:195 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:195 Constant: +0:195 1 (const uint) +0:195 u1: direct index for structure ( uniform uint) +0:195 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:195 Constant: +0:195 0 (const uint) +0:196 imageAtomicAnd ( temp uint) +0:196 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:196 u2: direct index for structure ( uniform 2-component vector of uint) +0:196 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:196 Constant: +0:196 1 (const uint) +0:196 u1: direct index for structure ( uniform uint) +0:196 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:196 Constant: +0:196 0 (const uint) +0:197 move second child to first child ( temp uint) +0:197 'out_u1' ( temp uint) +0:197 imageAtomicAnd ( temp uint) +0:197 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:197 u2: direct index for structure ( uniform 2-component vector of uint) +0:197 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:197 Constant: +0:197 1 (const uint) +0:197 u1: direct index for structure ( uniform uint) +0:197 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:197 Constant: +0:197 0 (const uint) +0:198 move second child to first child ( temp uint) +0:198 'out_u1' ( temp uint) +0:198 imageAtomicCompSwap ( temp uint) +0:198 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:198 u2: direct index for structure ( uniform 2-component vector of uint) +0:198 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:198 Constant: +0:198 1 (const uint) +0:198 u1b: direct index for structure ( uniform uint) +0:198 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:198 Constant: +0:198 3 (const uint) +0:198 u1c: direct index for structure ( uniform uint) +0:198 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:198 Constant: +0:198 4 (const uint) +0:199 move second child to first child ( temp uint) +0:199 'out_u1' ( temp uint) +0:199 imageAtomicExchange ( temp uint) +0:199 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:199 u2: direct index for structure ( uniform 2-component vector of uint) +0:199 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:199 Constant: +0:199 1 (const uint) +0:199 u1: direct index for structure ( uniform uint) +0:199 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:199 Constant: +0:199 0 (const uint) +0:200 imageAtomicMax ( temp uint) +0:200 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:200 u2: direct index for structure ( uniform 2-component vector of uint) +0:200 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:200 Constant: +0:200 1 (const uint) +0:200 u1: direct index for structure ( uniform uint) +0:200 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:200 Constant: +0:200 0 (const uint) +0:201 move second child to first child ( temp uint) +0:201 'out_u1' ( temp uint) +0:201 imageAtomicMax ( temp uint) +0:201 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:201 u2: direct index for structure ( uniform 2-component vector of uint) +0:201 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:201 Constant: +0:201 1 (const uint) +0:201 u1: direct index for structure ( uniform uint) +0:201 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:201 Constant: +0:201 0 (const uint) +0:202 imageAtomicMin ( temp uint) +0:202 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:202 u2: direct index for structure ( uniform 2-component vector of uint) +0:202 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:202 Constant: +0:202 1 (const uint) +0:202 u1: direct index for structure ( uniform uint) +0:202 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:202 Constant: +0:202 0 (const uint) +0:203 move second child to first child ( temp uint) +0:203 'out_u1' ( temp uint) +0:203 imageAtomicMin ( temp uint) +0:203 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:203 u2: direct index for structure ( uniform 2-component vector of uint) +0:203 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:203 Constant: +0:203 1 (const uint) +0:203 u1: direct index for structure ( uniform uint) +0:203 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:203 Constant: +0:203 0 (const uint) +0:204 imageAtomicOr ( temp uint) +0:204 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:204 u2: direct index for structure ( uniform 2-component vector of uint) +0:204 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:204 Constant: +0:204 1 (const uint) +0:204 u1: direct index for structure ( uniform uint) +0:204 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:204 Constant: +0:204 0 (const uint) +0:205 move second child to first child ( temp uint) +0:205 'out_u1' ( temp uint) +0:205 imageAtomicOr ( temp uint) +0:205 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:205 u2: direct index for structure ( uniform 2-component vector of uint) +0:205 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:205 Constant: +0:205 1 (const uint) +0:205 u1: direct index for structure ( uniform uint) +0:205 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:205 Constant: +0:205 0 (const uint) +0:206 imageAtomicXor ( temp uint) +0:206 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:206 u2: direct index for structure ( uniform 2-component vector of uint) +0:206 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:206 Constant: +0:206 1 (const uint) +0:206 u1: direct index for structure ( uniform uint) +0:206 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:206 Constant: +0:206 0 (const uint) +0:207 move second child to first child ( temp uint) +0:207 'out_u1' ( temp uint) +0:207 imageAtomicXor ( temp uint) +0:207 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:207 u2: direct index for structure ( uniform 2-component vector of uint) +0:207 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:207 Constant: +0:207 1 (const uint) +0:207 u1: direct index for structure ( uniform uint) +0:207 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:207 Constant: +0:207 0 (const uint) +0:210 imageAtomicAdd ( temp int) +0:210 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:210 i1: direct index for structure ( uniform int) +0:210 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:210 Constant: +0:210 5 (const uint) +0:210 i1b: direct index for structure ( uniform int) +0:210 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:210 Constant: +0:210 8 (const uint) +0:211 move second child to first child ( temp int) +0:211 'out_i1' ( temp int) +0:211 imageAtomicAdd ( temp int) +0:211 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:211 i1: direct index for structure ( uniform int) +0:211 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:211 Constant: +0:211 5 (const uint) +0:211 i1: direct index for structure ( uniform int) +0:211 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:211 Constant: +0:211 5 (const uint) +0:212 imageAtomicAnd ( temp int) +0:212 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:212 i1: direct index for structure ( uniform int) +0:212 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:212 Constant: +0:212 5 (const uint) +0:212 i1b: direct index for structure ( uniform int) +0:212 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:212 Constant: +0:212 8 (const uint) +0:213 move second child to first child ( temp int) +0:213 'out_i1' ( temp int) +0:213 imageAtomicAnd ( temp int) +0:213 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:213 i1: direct index for structure ( uniform int) +0:213 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:213 Constant: +0:213 5 (const uint) +0:213 i1: direct index for structure ( uniform int) +0:213 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:213 Constant: +0:213 5 (const uint) +0:214 move second child to first child ( temp int) +0:214 'out_i1' ( temp int) +0:214 imageAtomicCompSwap ( temp int) +0:214 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:214 i1: direct index for structure ( uniform int) +0:214 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:214 Constant: +0:214 5 (const uint) +0:214 i1b: direct index for structure ( uniform int) +0:214 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:214 Constant: +0:214 8 (const uint) +0:214 i1c: direct index for structure ( uniform int) +0:214 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:214 Constant: +0:214 9 (const uint) +0:215 move second child to first child ( temp int) +0:215 'out_i1' ( temp int) +0:215 imageAtomicExchange ( temp int) +0:215 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:215 i1: direct index for structure ( uniform int) +0:215 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:215 Constant: +0:215 5 (const uint) +0:215 i1: direct index for structure ( uniform int) +0:215 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:215 Constant: +0:215 5 (const uint) +0:216 imageAtomicMax ( temp int) +0:216 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:216 i1: direct index for structure ( uniform int) +0:216 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:216 Constant: +0:216 5 (const uint) +0:216 i1b: direct index for structure ( uniform int) +0:216 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:216 Constant: +0:216 8 (const uint) +0:217 move second child to first child ( temp int) +0:217 'out_i1' ( temp int) +0:217 imageAtomicMax ( temp int) +0:217 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:217 i1: direct index for structure ( uniform int) +0:217 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:217 Constant: +0:217 5 (const uint) +0:217 i1: direct index for structure ( uniform int) +0:217 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:217 Constant: +0:217 5 (const uint) +0:218 imageAtomicMin ( temp int) +0:218 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:218 i1: direct index for structure ( uniform int) +0:218 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:218 Constant: +0:218 5 (const uint) +0:218 i1b: direct index for structure ( uniform int) +0:218 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:218 Constant: +0:218 8 (const uint) +0:219 move second child to first child ( temp int) +0:219 'out_i1' ( temp int) +0:219 imageAtomicMin ( temp int) +0:219 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:219 i1: direct index for structure ( uniform int) +0:219 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:219 Constant: +0:219 5 (const uint) +0:219 i1: direct index for structure ( uniform int) +0:219 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:219 Constant: +0:219 5 (const uint) +0:220 imageAtomicOr ( temp int) +0:220 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:220 i1: direct index for structure ( uniform int) +0:220 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:220 Constant: +0:220 5 (const uint) +0:220 i1b: direct index for structure ( uniform int) +0:220 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:220 Constant: +0:220 8 (const uint) +0:221 move second child to first child ( temp int) +0:221 'out_i1' ( temp int) +0:221 imageAtomicOr ( temp int) +0:221 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:221 i1: direct index for structure ( uniform int) +0:221 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:221 Constant: +0:221 5 (const uint) +0:221 i1: direct index for structure ( uniform int) +0:221 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:221 Constant: +0:221 5 (const uint) +0:222 imageAtomicXor ( temp int) +0:222 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:222 i1: direct index for structure ( uniform int) +0:222 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:222 Constant: +0:222 5 (const uint) +0:222 i1b: direct index for structure ( uniform int) +0:222 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:222 Constant: +0:222 8 (const uint) +0:223 move second child to first child ( temp int) +0:223 'out_i1' ( temp int) +0:223 imageAtomicXor ( temp int) +0:223 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:223 i1: direct index for structure ( uniform int) +0:223 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:223 Constant: +0:223 5 (const uint) +0:223 i1: direct index for structure ( uniform int) +0:223 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:223 Constant: +0:223 5 (const uint) +0:226 imageAtomicAdd ( temp uint) +0:226 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:226 u1: direct index for structure ( uniform uint) +0:226 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:226 Constant: +0:226 0 (const uint) +0:226 u1: direct index for structure ( uniform uint) +0:226 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:226 Constant: +0:226 0 (const uint) +0:227 move second child to first child ( temp uint) +0:227 'out_u1' ( temp uint) +0:227 imageAtomicAdd ( temp uint) +0:227 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:227 u1: direct index for structure ( uniform uint) +0:227 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:227 Constant: +0:227 0 (const uint) +0:227 u1: direct index for structure ( uniform uint) +0:227 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:227 Constant: +0:227 0 (const uint) +0:228 imageAtomicAnd ( temp uint) +0:228 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:228 u1: direct index for structure ( uniform uint) +0:228 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:228 Constant: +0:228 0 (const uint) +0:228 u1: direct index for structure ( uniform uint) +0:228 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:228 Constant: +0:228 0 (const uint) +0:229 move second child to first child ( temp uint) +0:229 'out_u1' ( temp uint) +0:229 imageAtomicAnd ( temp uint) +0:229 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:229 u1: direct index for structure ( uniform uint) +0:229 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:229 Constant: +0:229 0 (const uint) +0:229 u1: direct index for structure ( uniform uint) +0:229 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:229 Constant: +0:229 0 (const uint) +0:230 move second child to first child ( temp uint) +0:230 'out_u1' ( temp uint) +0:230 imageAtomicCompSwap ( temp uint) +0:230 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:230 u1: direct index for structure ( uniform uint) +0:230 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:230 Constant: +0:230 0 (const uint) +0:230 u1b: direct index for structure ( uniform uint) +0:230 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:230 Constant: +0:230 3 (const uint) +0:230 u1c: direct index for structure ( uniform uint) +0:230 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:230 Constant: +0:230 4 (const uint) +0:231 move second child to first child ( temp uint) +0:231 'out_u1' ( temp uint) +0:231 imageAtomicExchange ( temp uint) +0:231 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:231 u1: direct index for structure ( uniform uint) +0:231 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:231 Constant: +0:231 0 (const uint) +0:231 u1: direct index for structure ( uniform uint) +0:231 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:231 Constant: +0:231 0 (const uint) +0:232 imageAtomicMax ( temp uint) +0:232 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:232 u1: direct index for structure ( uniform uint) +0:232 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:232 Constant: +0:232 0 (const uint) +0:232 u1: direct index for structure ( uniform uint) +0:232 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:232 Constant: +0:232 0 (const uint) +0:233 move second child to first child ( temp uint) +0:233 'out_u1' ( temp uint) +0:233 imageAtomicMax ( temp uint) +0:233 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:233 u1: direct index for structure ( uniform uint) +0:233 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:233 Constant: +0:233 0 (const uint) +0:233 u1: direct index for structure ( uniform uint) +0:233 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:233 Constant: +0:233 0 (const uint) +0:234 imageAtomicMin ( temp uint) +0:234 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:234 u1: direct index for structure ( uniform uint) +0:234 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:234 Constant: +0:234 0 (const uint) +0:234 u1: direct index for structure ( uniform uint) +0:234 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:234 Constant: +0:234 0 (const uint) +0:235 move second child to first child ( temp uint) +0:235 'out_u1' ( temp uint) +0:235 imageAtomicMin ( temp uint) +0:235 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:235 u1: direct index for structure ( uniform uint) +0:235 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:235 Constant: +0:235 0 (const uint) +0:235 u1: direct index for structure ( uniform uint) +0:235 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:235 Constant: +0:235 0 (const uint) +0:236 imageAtomicOr ( temp uint) +0:236 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:236 u1: direct index for structure ( uniform uint) +0:236 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:236 Constant: +0:236 0 (const uint) +0:236 u1: direct index for structure ( uniform uint) +0:236 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:236 Constant: +0:236 0 (const uint) +0:237 move second child to first child ( temp uint) +0:237 'out_u1' ( temp uint) +0:237 imageAtomicOr ( temp uint) +0:237 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:237 u1: direct index for structure ( uniform uint) +0:237 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:237 Constant: +0:237 0 (const uint) +0:237 u1: direct index for structure ( uniform uint) +0:237 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:237 Constant: +0:237 0 (const uint) +0:238 imageAtomicXor ( temp uint) +0:238 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:238 u1: direct index for structure ( uniform uint) +0:238 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:238 Constant: +0:238 0 (const uint) +0:238 u1: direct index for structure ( uniform uint) +0:238 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:238 Constant: +0:238 0 (const uint) +0:239 move second child to first child ( temp uint) +0:239 'out_u1' ( temp uint) +0:239 imageAtomicXor ( temp uint) +0:239 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:239 u1: direct index for structure ( uniform uint) +0:239 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:239 Constant: +0:239 0 (const uint) +0:239 u1: direct index for structure ( uniform uint) +0:239 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:239 Constant: +0:239 0 (const uint) +0:242 move second child to first child ( temp 4-component vector of float) +0:242 Color: direct index for structure ( temp 4-component vector of float) +0:242 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:242 Constant: +0:242 0 (const int) +0:242 Constant: +0:242 1.000000 +0:242 1.000000 +0:242 1.000000 +0:242 1.000000 +0:243 Branch: Return with expression +0:243 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:45 Function Definition: main( ( temp void) +0:45 Function Parameters: +0:? Sequence +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:45 Color: direct index for structure ( temp 4-component vector of float) +0:45 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:45 Constant: +0:45 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' ( uniform sampler) +0:? 'g_tTex1df1' (layout( r32f) uniform image1D) +0:? 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:? 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:? 'g_tTex2df1' (layout( r32f) uniform image2D) +0:? 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:? 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:? 'g_tTex3df1' (layout( r32f) uniform image3D) +0:? 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:? 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:? 'g_tTex1df1a' (layout( r32f) uniform image1DArray) +0:? 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:? 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:? 'g_tTex2df1a' (layout( r32f) uniform image2DArray) +0:? 'g_tTex2di1a' (layout( r32i) uniform iimage2DArray) +0:? 'g_tTex2du1a' (layout( r32ui) uniform uimage2DArray) +0:? 'g_tBuffF' (layout( r32f) uniform imageBuffer) +0:? 'g_tBuffI' (layout( r32i) uniform iimageBuffer) +0:? 'g_tBuffU' (layout( r32ui) uniform uimageBuffer) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform uint u1, uniform 2-component vector of uint u2, uniform 3-component vector of uint u3, uniform uint u1b, uniform uint u1c, uniform int i1, uniform 2-component vector of int i2, uniform 3-component vector of int i3, uniform int i1b, uniform int i1c}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 1147 + + Capability Shader + Capability Image1D + Capability ImageBuffer + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 1117 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + Name 10 "@main(" + Name 15 "g_tTex1di1" + Name 21 "$Global" + MemberName 21($Global) 0 "u1" + MemberName 21($Global) 1 "u2" + MemberName 21($Global) 2 "u3" + MemberName 21($Global) 3 "u1b" + MemberName 21($Global) 4 "u1c" + MemberName 21($Global) 5 "i1" + MemberName 21($Global) 6 "i2" + MemberName 21($Global) 7 "i3" + MemberName 21($Global) 8 "i1b" + MemberName 21($Global) 9 "i1c" + Name 23 "" + Name 37 "out_i1" + Name 121 "g_tTex1du1" + Name 132 "out_u1" + Name 217 "g_tTex2di1" + Name 308 "g_tTex2du1" + Name 399 "g_tTex3di1" + Name 490 "g_tTex3du1" + Name 581 "g_tTex1di1a" + Name 670 "g_tTex1du1a" + Name 931 "g_tBuffI" + Name 1020 "g_tBuffU" + Name 1108 "psout" + Name 1117 "@entryPointOutput.Color" + Name 1122 "g_sSamp" + Name 1125 "g_tTex1df1" + Name 1128 "g_tTex2df1" + Name 1131 "g_tTex3df1" + Name 1134 "g_tTex1df1a" + Name 1137 "g_tTex2df1a" + Name 1140 "g_tTex2di1a" + Name 1143 "g_tTex2du1a" + Name 1146 "g_tBuffF" + Decorate 15(g_tTex1di1) DescriptorSet 0 + MemberDecorate 21($Global) 0 Offset 0 + MemberDecorate 21($Global) 1 Offset 8 + MemberDecorate 21($Global) 2 Offset 16 + MemberDecorate 21($Global) 3 Offset 28 + MemberDecorate 21($Global) 4 Offset 32 + MemberDecorate 21($Global) 5 Offset 36 + MemberDecorate 21($Global) 6 Offset 40 + MemberDecorate 21($Global) 7 Offset 48 + MemberDecorate 21($Global) 8 Offset 60 + MemberDecorate 21($Global) 9 Offset 64 + Decorate 21($Global) Block + Decorate 23 DescriptorSet 0 + Decorate 121(g_tTex1du1) DescriptorSet 0 + Decorate 217(g_tTex2di1) DescriptorSet 0 + Decorate 308(g_tTex2du1) DescriptorSet 0 + Decorate 399(g_tTex3di1) DescriptorSet 0 + Decorate 490(g_tTex3du1) DescriptorSet 0 + Decorate 581(g_tTex1di1a) DescriptorSet 0 + Decorate 670(g_tTex1du1a) DescriptorSet 0 + Decorate 931(g_tBuffI) DescriptorSet 0 + Decorate 1020(g_tBuffU) DescriptorSet 0 + Decorate 1117(@entryPointOutput.Color) Location 0 + Decorate 1122(g_sSamp) DescriptorSet 0 + Decorate 1125(g_tTex1df1) DescriptorSet 0 + Decorate 1128(g_tTex2df1) DescriptorSet 0 + Decorate 1131(g_tTex3df1) DescriptorSet 0 + Decorate 1134(g_tTex1df1a) DescriptorSet 0 + Decorate 1137(g_tTex2df1a) DescriptorSet 0 + Decorate 1140(g_tTex2di1a) DescriptorSet 0 + Decorate 1143(g_tTex2du1a) DescriptorSet 0 + Decorate 1146(g_tBuffF) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeInt 32 1 + 13: TypeImage 12(int) 1D nonsampled format:R32i + 14: TypePointer UniformConstant 13 + 15(g_tTex1di1): 14(ptr) Variable UniformConstant + 16: TypeInt 32 0 + 17: TypeVector 16(int) 2 + 18: TypeVector 16(int) 3 + 19: TypeVector 12(int) 2 + 20: TypeVector 12(int) 3 + 21($Global): TypeStruct 16(int) 17(ivec2) 18(ivec3) 16(int) 16(int) 12(int) 19(ivec2) 20(ivec3) 12(int) 12(int) + 22: TypePointer Uniform 21($Global) + 23: 22(ptr) Variable Uniform + 24: 12(int) Constant 5 + 25: TypePointer Uniform 12(int) + 28: 12(int) Constant 8 + 31: 16(int) Constant 0 + 32: TypePointer Image 12(int) + 34: 16(int) Constant 1 + 36: TypePointer Function 12(int) + 60: 12(int) Constant 9 + 119: TypeImage 16(int) 1D nonsampled format:R32ui + 120: TypePointer UniformConstant 119 + 121(g_tTex1du1): 120(ptr) Variable UniformConstant + 122: 12(int) Constant 0 + 123: TypePointer Uniform 16(int) + 128: TypePointer Image 16(int) + 131: TypePointer Function 16(int) + 153: 12(int) Constant 3 + 156: 12(int) Constant 4 + 215: TypeImage 12(int) 2D nonsampled format:R32i + 216: TypePointer UniformConstant 215 + 217(g_tTex2di1): 216(ptr) Variable UniformConstant + 218: 12(int) Constant 6 + 219: TypePointer Uniform 19(ivec2) + 306: TypeImage 16(int) 2D nonsampled format:R32ui + 307: TypePointer UniformConstant 306 + 308(g_tTex2du1): 307(ptr) Variable UniformConstant + 309: 12(int) Constant 1 + 310: TypePointer Uniform 17(ivec2) + 397: TypeImage 12(int) 3D nonsampled format:R32i + 398: TypePointer UniformConstant 397 + 399(g_tTex3di1): 398(ptr) Variable UniformConstant + 400: 12(int) Constant 7 + 401: TypePointer Uniform 20(ivec3) + 488: TypeImage 16(int) 3D nonsampled format:R32ui + 489: TypePointer UniformConstant 488 + 490(g_tTex3du1): 489(ptr) Variable UniformConstant + 491: 12(int) Constant 2 + 492: TypePointer Uniform 18(ivec3) + 579: TypeImage 12(int) 1D array nonsampled format:R32i + 580: TypePointer UniformConstant 579 +581(g_tTex1di1a): 580(ptr) Variable UniformConstant + 668: TypeImage 16(int) 1D array nonsampled format:R32ui + 669: TypePointer UniformConstant 668 +670(g_tTex1du1a): 669(ptr) Variable UniformConstant + 929: TypeImage 12(int) Buffer nonsampled format:R32i + 930: TypePointer UniformConstant 929 + 931(g_tBuffI): 930(ptr) Variable UniformConstant + 1018: TypeImage 16(int) Buffer nonsampled format:R32ui + 1019: TypePointer UniformConstant 1018 + 1020(g_tBuffU): 1019(ptr) Variable UniformConstant + 1107: TypePointer Function 8(PS_OUTPUT) + 1109: 6(float) Constant 1065353216 + 1110: 7(fvec4) ConstantComposite 1109 1109 1109 1109 + 1111: TypePointer Function 7(fvec4) + 1116: TypePointer Output 7(fvec4) +1117(@entryPointOutput.Color): 1116(ptr) Variable Output + 1120: TypeSampler + 1121: TypePointer UniformConstant 1120 + 1122(g_sSamp): 1121(ptr) Variable UniformConstant + 1123: TypeImage 6(float) 1D nonsampled format:R32f + 1124: TypePointer UniformConstant 1123 +1125(g_tTex1df1): 1124(ptr) Variable UniformConstant + 1126: TypeImage 6(float) 2D nonsampled format:R32f + 1127: TypePointer UniformConstant 1126 +1128(g_tTex2df1): 1127(ptr) Variable UniformConstant + 1129: TypeImage 6(float) 3D nonsampled format:R32f + 1130: TypePointer UniformConstant 1129 +1131(g_tTex3df1): 1130(ptr) Variable UniformConstant + 1132: TypeImage 6(float) 1D array nonsampled format:R32f + 1133: TypePointer UniformConstant 1132 +1134(g_tTex1df1a): 1133(ptr) Variable UniformConstant + 1135: TypeImage 6(float) 2D array nonsampled format:R32f + 1136: TypePointer UniformConstant 1135 +1137(g_tTex2df1a): 1136(ptr) Variable UniformConstant + 1138: TypeImage 12(int) 2D array nonsampled format:R32i + 1139: TypePointer UniformConstant 1138 +1140(g_tTex2di1a): 1139(ptr) Variable UniformConstant + 1141: TypeImage 16(int) 2D array nonsampled format:R32ui + 1142: TypePointer UniformConstant 1141 +1143(g_tTex2du1a): 1142(ptr) Variable UniformConstant + 1144: TypeImage 6(float) Buffer nonsampled format:R32f + 1145: TypePointer UniformConstant 1144 + 1146(g_tBuffF): 1145(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 1118:8(PS_OUTPUT) FunctionCall 10(@main() + 1119: 7(fvec4) CompositeExtract 1118 0 + Store 1117(@entryPointOutput.Color) 1119 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 37(out_i1): 36(ptr) Variable Function + 132(out_u1): 131(ptr) Variable Function + 1108(psout): 1107(ptr) Variable Function + 26: 25(ptr) AccessChain 23 24 + 27: 12(int) Load 26 + 29: 25(ptr) AccessChain 23 28 + 30: 12(int) Load 29 + 33: 32(ptr) ImageTexelPointer 15(g_tTex1di1) 27 31 + 35: 12(int) AtomicIAdd 33 34 31 30 + 38: 25(ptr) AccessChain 23 24 + 39: 12(int) Load 38 + 40: 25(ptr) AccessChain 23 24 + 41: 12(int) Load 40 + 42: 32(ptr) ImageTexelPointer 15(g_tTex1di1) 39 31 + 43: 12(int) AtomicIAdd 42 34 31 41 + Store 37(out_i1) 43 + 44: 25(ptr) AccessChain 23 24 + 45: 12(int) Load 44 + 46: 25(ptr) AccessChain 23 28 + 47: 12(int) Load 46 + 48: 32(ptr) ImageTexelPointer 15(g_tTex1di1) 45 31 + 49: 12(int) AtomicAnd 48 34 31 47 + 50: 25(ptr) AccessChain 23 24 + 51: 12(int) Load 50 + 52: 25(ptr) AccessChain 23 24 + 53: 12(int) Load 52 + 54: 32(ptr) ImageTexelPointer 15(g_tTex1di1) 51 31 + 55: 12(int) AtomicAnd 54 34 31 53 + Store 37(out_i1) 55 + 56: 25(ptr) AccessChain 23 24 + 57: 12(int) Load 56 + 58: 25(ptr) AccessChain 23 28 + 59: 12(int) Load 58 + 61: 25(ptr) AccessChain 23 60 + 62: 12(int) Load 61 + 63: 32(ptr) ImageTexelPointer 15(g_tTex1di1) 57 31 + 64: 12(int) AtomicCompareExchange 63 34 31 31 62 59 + Store 37(out_i1) 64 + 65: 25(ptr) AccessChain 23 24 + 66: 12(int) Load 65 + 67: 25(ptr) AccessChain 23 24 + 68: 12(int) Load 67 + 69: 32(ptr) ImageTexelPointer 15(g_tTex1di1) 66 31 + 70: 12(int) AtomicExchange 69 34 31 68 + Store 37(out_i1) 70 + 71: 25(ptr) AccessChain 23 24 + 72: 12(int) Load 71 + 73: 25(ptr) AccessChain 23 28 + 74: 12(int) Load 73 + 75: 32(ptr) ImageTexelPointer 15(g_tTex1di1) 72 31 + 76: 12(int) AtomicSMax 75 34 31 74 + 77: 25(ptr) AccessChain 23 24 + 78: 12(int) Load 77 + 79: 25(ptr) AccessChain 23 24 + 80: 12(int) Load 79 + 81: 32(ptr) ImageTexelPointer 15(g_tTex1di1) 78 31 + 82: 12(int) AtomicSMax 81 34 31 80 + Store 37(out_i1) 82 + 83: 25(ptr) AccessChain 23 24 + 84: 12(int) Load 83 + 85: 25(ptr) AccessChain 23 28 + 86: 12(int) Load 85 + 87: 32(ptr) ImageTexelPointer 15(g_tTex1di1) 84 31 + 88: 12(int) AtomicSMin 87 34 31 86 + 89: 25(ptr) AccessChain 23 24 + 90: 12(int) Load 89 + 91: 25(ptr) AccessChain 23 24 + 92: 12(int) Load 91 + 93: 32(ptr) ImageTexelPointer 15(g_tTex1di1) 90 31 + 94: 12(int) AtomicSMin 93 34 31 92 + Store 37(out_i1) 94 + 95: 25(ptr) AccessChain 23 24 + 96: 12(int) Load 95 + 97: 25(ptr) AccessChain 23 28 + 98: 12(int) Load 97 + 99: 32(ptr) ImageTexelPointer 15(g_tTex1di1) 96 31 + 100: 12(int) AtomicOr 99 34 31 98 + 101: 25(ptr) AccessChain 23 24 + 102: 12(int) Load 101 + 103: 25(ptr) AccessChain 23 24 + 104: 12(int) Load 103 + 105: 32(ptr) ImageTexelPointer 15(g_tTex1di1) 102 31 + 106: 12(int) AtomicOr 105 34 31 104 + Store 37(out_i1) 106 + 107: 25(ptr) AccessChain 23 24 + 108: 12(int) Load 107 + 109: 25(ptr) AccessChain 23 28 + 110: 12(int) Load 109 + 111: 32(ptr) ImageTexelPointer 15(g_tTex1di1) 108 31 + 112: 12(int) AtomicXor 111 34 31 110 + 113: 25(ptr) AccessChain 23 24 + 114: 12(int) Load 113 + 115: 25(ptr) AccessChain 23 24 + 116: 12(int) Load 115 + 117: 32(ptr) ImageTexelPointer 15(g_tTex1di1) 114 31 + 118: 12(int) AtomicXor 117 34 31 116 + Store 37(out_i1) 118 + 124: 123(ptr) AccessChain 23 122 + 125: 16(int) Load 124 + 126: 123(ptr) AccessChain 23 122 + 127: 16(int) Load 126 + 129: 128(ptr) ImageTexelPointer 121(g_tTex1du1) 125 31 + 130: 16(int) AtomicIAdd 129 34 31 127 + 133: 123(ptr) AccessChain 23 122 + 134: 16(int) Load 133 + 135: 123(ptr) AccessChain 23 122 + 136: 16(int) Load 135 + 137: 128(ptr) ImageTexelPointer 121(g_tTex1du1) 134 31 + 138: 16(int) AtomicIAdd 137 34 31 136 + Store 132(out_u1) 138 + 139: 123(ptr) AccessChain 23 122 + 140: 16(int) Load 139 + 141: 123(ptr) AccessChain 23 122 + 142: 16(int) Load 141 + 143: 128(ptr) ImageTexelPointer 121(g_tTex1du1) 140 31 + 144: 16(int) AtomicAnd 143 34 31 142 + 145: 123(ptr) AccessChain 23 122 + 146: 16(int) Load 145 + 147: 123(ptr) AccessChain 23 122 + 148: 16(int) Load 147 + 149: 128(ptr) ImageTexelPointer 121(g_tTex1du1) 146 31 + 150: 16(int) AtomicAnd 149 34 31 148 + Store 132(out_u1) 150 + 151: 123(ptr) AccessChain 23 122 + 152: 16(int) Load 151 + 154: 123(ptr) AccessChain 23 153 + 155: 16(int) Load 154 + 157: 123(ptr) AccessChain 23 156 + 158: 16(int) Load 157 + 159: 128(ptr) ImageTexelPointer 121(g_tTex1du1) 152 31 + 160: 16(int) AtomicCompareExchange 159 34 31 31 158 155 + Store 132(out_u1) 160 + 161: 123(ptr) AccessChain 23 122 + 162: 16(int) Load 161 + 163: 123(ptr) AccessChain 23 122 + 164: 16(int) Load 163 + 165: 128(ptr) ImageTexelPointer 121(g_tTex1du1) 162 31 + 166: 16(int) AtomicExchange 165 34 31 164 + Store 132(out_u1) 166 + 167: 123(ptr) AccessChain 23 122 + 168: 16(int) Load 167 + 169: 123(ptr) AccessChain 23 122 + 170: 16(int) Load 169 + 171: 128(ptr) ImageTexelPointer 121(g_tTex1du1) 168 31 + 172: 16(int) AtomicUMax 171 34 31 170 + 173: 123(ptr) AccessChain 23 122 + 174: 16(int) Load 173 + 175: 123(ptr) AccessChain 23 122 + 176: 16(int) Load 175 + 177: 128(ptr) ImageTexelPointer 121(g_tTex1du1) 174 31 + 178: 16(int) AtomicUMax 177 34 31 176 + Store 132(out_u1) 178 + 179: 123(ptr) AccessChain 23 122 + 180: 16(int) Load 179 + 181: 123(ptr) AccessChain 23 122 + 182: 16(int) Load 181 + 183: 128(ptr) ImageTexelPointer 121(g_tTex1du1) 180 31 + 184: 16(int) AtomicUMin 183 34 31 182 + 185: 123(ptr) AccessChain 23 122 + 186: 16(int) Load 185 + 187: 123(ptr) AccessChain 23 122 + 188: 16(int) Load 187 + 189: 128(ptr) ImageTexelPointer 121(g_tTex1du1) 186 31 + 190: 16(int) AtomicUMin 189 34 31 188 + Store 132(out_u1) 190 + 191: 123(ptr) AccessChain 23 122 + 192: 16(int) Load 191 + 193: 123(ptr) AccessChain 23 122 + 194: 16(int) Load 193 + 195: 128(ptr) ImageTexelPointer 121(g_tTex1du1) 192 31 + 196: 16(int) AtomicOr 195 34 31 194 + 197: 123(ptr) AccessChain 23 122 + 198: 16(int) Load 197 + 199: 123(ptr) AccessChain 23 122 + 200: 16(int) Load 199 + 201: 128(ptr) ImageTexelPointer 121(g_tTex1du1) 198 31 + 202: 16(int) AtomicOr 201 34 31 200 + Store 132(out_u1) 202 + 203: 123(ptr) AccessChain 23 122 + 204: 16(int) Load 203 + 205: 123(ptr) AccessChain 23 122 + 206: 16(int) Load 205 + 207: 128(ptr) ImageTexelPointer 121(g_tTex1du1) 204 31 + 208: 16(int) AtomicXor 207 34 31 206 + 209: 123(ptr) AccessChain 23 122 + 210: 16(int) Load 209 + 211: 123(ptr) AccessChain 23 122 + 212: 16(int) Load 211 + 213: 128(ptr) ImageTexelPointer 121(g_tTex1du1) 210 31 + 214: 16(int) AtomicXor 213 34 31 212 + Store 132(out_u1) 214 + 220: 219(ptr) AccessChain 23 218 + 221: 19(ivec2) Load 220 + 222: 25(ptr) AccessChain 23 28 + 223: 12(int) Load 222 + 224: 32(ptr) ImageTexelPointer 217(g_tTex2di1) 221 31 + 225: 12(int) AtomicIAdd 224 34 31 223 + 226: 219(ptr) AccessChain 23 218 + 227: 19(ivec2) Load 226 + 228: 25(ptr) AccessChain 23 24 + 229: 12(int) Load 228 + 230: 32(ptr) ImageTexelPointer 217(g_tTex2di1) 227 31 + 231: 12(int) AtomicIAdd 230 34 31 229 + Store 37(out_i1) 231 + 232: 219(ptr) AccessChain 23 218 + 233: 19(ivec2) Load 232 + 234: 25(ptr) AccessChain 23 28 + 235: 12(int) Load 234 + 236: 32(ptr) ImageTexelPointer 217(g_tTex2di1) 233 31 + 237: 12(int) AtomicAnd 236 34 31 235 + 238: 219(ptr) AccessChain 23 218 + 239: 19(ivec2) Load 238 + 240: 25(ptr) AccessChain 23 24 + 241: 12(int) Load 240 + 242: 32(ptr) ImageTexelPointer 217(g_tTex2di1) 239 31 + 243: 12(int) AtomicAnd 242 34 31 241 + Store 37(out_i1) 243 + 244: 219(ptr) AccessChain 23 218 + 245: 19(ivec2) Load 244 + 246: 25(ptr) AccessChain 23 28 + 247: 12(int) Load 246 + 248: 25(ptr) AccessChain 23 60 + 249: 12(int) Load 248 + 250: 32(ptr) ImageTexelPointer 217(g_tTex2di1) 245 31 + 251: 12(int) AtomicCompareExchange 250 34 31 31 249 247 + Store 37(out_i1) 251 + 252: 219(ptr) AccessChain 23 218 + 253: 19(ivec2) Load 252 + 254: 25(ptr) AccessChain 23 24 + 255: 12(int) Load 254 + 256: 32(ptr) ImageTexelPointer 217(g_tTex2di1) 253 31 + 257: 12(int) AtomicExchange 256 34 31 255 + Store 37(out_i1) 257 + 258: 219(ptr) AccessChain 23 218 + 259: 19(ivec2) Load 258 + 260: 25(ptr) AccessChain 23 28 + 261: 12(int) Load 260 + 262: 32(ptr) ImageTexelPointer 217(g_tTex2di1) 259 31 + 263: 12(int) AtomicSMax 262 34 31 261 + 264: 219(ptr) AccessChain 23 218 + 265: 19(ivec2) Load 264 + 266: 25(ptr) AccessChain 23 24 + 267: 12(int) Load 266 + 268: 32(ptr) ImageTexelPointer 217(g_tTex2di1) 265 31 + 269: 12(int) AtomicSMax 268 34 31 267 + Store 37(out_i1) 269 + 270: 219(ptr) AccessChain 23 218 + 271: 19(ivec2) Load 270 + 272: 25(ptr) AccessChain 23 28 + 273: 12(int) Load 272 + 274: 32(ptr) ImageTexelPointer 217(g_tTex2di1) 271 31 + 275: 12(int) AtomicSMin 274 34 31 273 + 276: 219(ptr) AccessChain 23 218 + 277: 19(ivec2) Load 276 + 278: 25(ptr) AccessChain 23 24 + 279: 12(int) Load 278 + 280: 32(ptr) ImageTexelPointer 217(g_tTex2di1) 277 31 + 281: 12(int) AtomicSMin 280 34 31 279 + Store 37(out_i1) 281 + 282: 219(ptr) AccessChain 23 218 + 283: 19(ivec2) Load 282 + 284: 25(ptr) AccessChain 23 28 + 285: 12(int) Load 284 + 286: 32(ptr) ImageTexelPointer 217(g_tTex2di1) 283 31 + 287: 12(int) AtomicOr 286 34 31 285 + 288: 219(ptr) AccessChain 23 218 + 289: 19(ivec2) Load 288 + 290: 25(ptr) AccessChain 23 24 + 291: 12(int) Load 290 + 292: 32(ptr) ImageTexelPointer 217(g_tTex2di1) 289 31 + 293: 12(int) AtomicOr 292 34 31 291 + Store 37(out_i1) 293 + 294: 219(ptr) AccessChain 23 218 + 295: 19(ivec2) Load 294 + 296: 25(ptr) AccessChain 23 28 + 297: 12(int) Load 296 + 298: 32(ptr) ImageTexelPointer 217(g_tTex2di1) 295 31 + 299: 12(int) AtomicXor 298 34 31 297 + 300: 219(ptr) AccessChain 23 218 + 301: 19(ivec2) Load 300 + 302: 25(ptr) AccessChain 23 24 + 303: 12(int) Load 302 + 304: 32(ptr) ImageTexelPointer 217(g_tTex2di1) 301 31 + 305: 12(int) AtomicXor 304 34 31 303 + Store 37(out_i1) 305 + 311: 310(ptr) AccessChain 23 309 + 312: 17(ivec2) Load 311 + 313: 123(ptr) AccessChain 23 122 + 314: 16(int) Load 313 + 315: 128(ptr) ImageTexelPointer 308(g_tTex2du1) 312 31 + 316: 16(int) AtomicIAdd 315 34 31 314 + 317: 310(ptr) AccessChain 23 309 + 318: 17(ivec2) Load 317 + 319: 123(ptr) AccessChain 23 122 + 320: 16(int) Load 319 + 321: 128(ptr) ImageTexelPointer 308(g_tTex2du1) 318 31 + 322: 16(int) AtomicIAdd 321 34 31 320 + Store 132(out_u1) 322 + 323: 310(ptr) AccessChain 23 309 + 324: 17(ivec2) Load 323 + 325: 123(ptr) AccessChain 23 122 + 326: 16(int) Load 325 + 327: 128(ptr) ImageTexelPointer 308(g_tTex2du1) 324 31 + 328: 16(int) AtomicAnd 327 34 31 326 + 329: 310(ptr) AccessChain 23 309 + 330: 17(ivec2) Load 329 + 331: 123(ptr) AccessChain 23 122 + 332: 16(int) Load 331 + 333: 128(ptr) ImageTexelPointer 308(g_tTex2du1) 330 31 + 334: 16(int) AtomicAnd 333 34 31 332 + Store 132(out_u1) 334 + 335: 310(ptr) AccessChain 23 309 + 336: 17(ivec2) Load 335 + 337: 123(ptr) AccessChain 23 153 + 338: 16(int) Load 337 + 339: 123(ptr) AccessChain 23 156 + 340: 16(int) Load 339 + 341: 128(ptr) ImageTexelPointer 308(g_tTex2du1) 336 31 + 342: 16(int) AtomicCompareExchange 341 34 31 31 340 338 + Store 132(out_u1) 342 + 343: 310(ptr) AccessChain 23 309 + 344: 17(ivec2) Load 343 + 345: 123(ptr) AccessChain 23 122 + 346: 16(int) Load 345 + 347: 128(ptr) ImageTexelPointer 308(g_tTex2du1) 344 31 + 348: 16(int) AtomicExchange 347 34 31 346 + Store 132(out_u1) 348 + 349: 310(ptr) AccessChain 23 309 + 350: 17(ivec2) Load 349 + 351: 123(ptr) AccessChain 23 122 + 352: 16(int) Load 351 + 353: 128(ptr) ImageTexelPointer 308(g_tTex2du1) 350 31 + 354: 16(int) AtomicUMax 353 34 31 352 + 355: 310(ptr) AccessChain 23 309 + 356: 17(ivec2) Load 355 + 357: 123(ptr) AccessChain 23 122 + 358: 16(int) Load 357 + 359: 128(ptr) ImageTexelPointer 308(g_tTex2du1) 356 31 + 360: 16(int) AtomicUMax 359 34 31 358 + Store 132(out_u1) 360 + 361: 310(ptr) AccessChain 23 309 + 362: 17(ivec2) Load 361 + 363: 123(ptr) AccessChain 23 122 + 364: 16(int) Load 363 + 365: 128(ptr) ImageTexelPointer 308(g_tTex2du1) 362 31 + 366: 16(int) AtomicUMin 365 34 31 364 + 367: 310(ptr) AccessChain 23 309 + 368: 17(ivec2) Load 367 + 369: 123(ptr) AccessChain 23 122 + 370: 16(int) Load 369 + 371: 128(ptr) ImageTexelPointer 308(g_tTex2du1) 368 31 + 372: 16(int) AtomicUMin 371 34 31 370 + Store 132(out_u1) 372 + 373: 310(ptr) AccessChain 23 309 + 374: 17(ivec2) Load 373 + 375: 123(ptr) AccessChain 23 122 + 376: 16(int) Load 375 + 377: 128(ptr) ImageTexelPointer 308(g_tTex2du1) 374 31 + 378: 16(int) AtomicOr 377 34 31 376 + 379: 310(ptr) AccessChain 23 309 + 380: 17(ivec2) Load 379 + 381: 123(ptr) AccessChain 23 122 + 382: 16(int) Load 381 + 383: 128(ptr) ImageTexelPointer 308(g_tTex2du1) 380 31 + 384: 16(int) AtomicOr 383 34 31 382 + Store 132(out_u1) 384 + 385: 310(ptr) AccessChain 23 309 + 386: 17(ivec2) Load 385 + 387: 123(ptr) AccessChain 23 122 + 388: 16(int) Load 387 + 389: 128(ptr) ImageTexelPointer 308(g_tTex2du1) 386 31 + 390: 16(int) AtomicXor 389 34 31 388 + 391: 310(ptr) AccessChain 23 309 + 392: 17(ivec2) Load 391 + 393: 123(ptr) AccessChain 23 122 + 394: 16(int) Load 393 + 395: 128(ptr) ImageTexelPointer 308(g_tTex2du1) 392 31 + 396: 16(int) AtomicXor 395 34 31 394 + Store 132(out_u1) 396 + 402: 401(ptr) AccessChain 23 400 + 403: 20(ivec3) Load 402 + 404: 25(ptr) AccessChain 23 28 + 405: 12(int) Load 404 + 406: 32(ptr) ImageTexelPointer 399(g_tTex3di1) 403 31 + 407: 12(int) AtomicIAdd 406 34 31 405 + 408: 401(ptr) AccessChain 23 400 + 409: 20(ivec3) Load 408 + 410: 25(ptr) AccessChain 23 24 + 411: 12(int) Load 410 + 412: 32(ptr) ImageTexelPointer 399(g_tTex3di1) 409 31 + 413: 12(int) AtomicIAdd 412 34 31 411 + Store 37(out_i1) 413 + 414: 401(ptr) AccessChain 23 400 + 415: 20(ivec3) Load 414 + 416: 25(ptr) AccessChain 23 28 + 417: 12(int) Load 416 + 418: 32(ptr) ImageTexelPointer 399(g_tTex3di1) 415 31 + 419: 12(int) AtomicAnd 418 34 31 417 + 420: 401(ptr) AccessChain 23 400 + 421: 20(ivec3) Load 420 + 422: 25(ptr) AccessChain 23 24 + 423: 12(int) Load 422 + 424: 32(ptr) ImageTexelPointer 399(g_tTex3di1) 421 31 + 425: 12(int) AtomicAnd 424 34 31 423 + Store 37(out_i1) 425 + 426: 401(ptr) AccessChain 23 400 + 427: 20(ivec3) Load 426 + 428: 25(ptr) AccessChain 23 28 + 429: 12(int) Load 428 + 430: 25(ptr) AccessChain 23 60 + 431: 12(int) Load 430 + 432: 32(ptr) ImageTexelPointer 399(g_tTex3di1) 427 31 + 433: 12(int) AtomicCompareExchange 432 34 31 31 431 429 + Store 37(out_i1) 433 + 434: 401(ptr) AccessChain 23 400 + 435: 20(ivec3) Load 434 + 436: 25(ptr) AccessChain 23 24 + 437: 12(int) Load 436 + 438: 32(ptr) ImageTexelPointer 399(g_tTex3di1) 435 31 + 439: 12(int) AtomicExchange 438 34 31 437 + Store 37(out_i1) 439 + 440: 401(ptr) AccessChain 23 400 + 441: 20(ivec3) Load 440 + 442: 25(ptr) AccessChain 23 28 + 443: 12(int) Load 442 + 444: 32(ptr) ImageTexelPointer 399(g_tTex3di1) 441 31 + 445: 12(int) AtomicSMax 444 34 31 443 + 446: 401(ptr) AccessChain 23 400 + 447: 20(ivec3) Load 446 + 448: 25(ptr) AccessChain 23 24 + 449: 12(int) Load 448 + 450: 32(ptr) ImageTexelPointer 399(g_tTex3di1) 447 31 + 451: 12(int) AtomicSMax 450 34 31 449 + Store 37(out_i1) 451 + 452: 401(ptr) AccessChain 23 400 + 453: 20(ivec3) Load 452 + 454: 25(ptr) AccessChain 23 28 + 455: 12(int) Load 454 + 456: 32(ptr) ImageTexelPointer 399(g_tTex3di1) 453 31 + 457: 12(int) AtomicSMin 456 34 31 455 + 458: 401(ptr) AccessChain 23 400 + 459: 20(ivec3) Load 458 + 460: 25(ptr) AccessChain 23 24 + 461: 12(int) Load 460 + 462: 32(ptr) ImageTexelPointer 399(g_tTex3di1) 459 31 + 463: 12(int) AtomicSMin 462 34 31 461 + Store 37(out_i1) 463 + 464: 401(ptr) AccessChain 23 400 + 465: 20(ivec3) Load 464 + 466: 25(ptr) AccessChain 23 28 + 467: 12(int) Load 466 + 468: 32(ptr) ImageTexelPointer 399(g_tTex3di1) 465 31 + 469: 12(int) AtomicOr 468 34 31 467 + 470: 401(ptr) AccessChain 23 400 + 471: 20(ivec3) Load 470 + 472: 25(ptr) AccessChain 23 24 + 473: 12(int) Load 472 + 474: 32(ptr) ImageTexelPointer 399(g_tTex3di1) 471 31 + 475: 12(int) AtomicOr 474 34 31 473 + Store 37(out_i1) 475 + 476: 401(ptr) AccessChain 23 400 + 477: 20(ivec3) Load 476 + 478: 25(ptr) AccessChain 23 28 + 479: 12(int) Load 478 + 480: 32(ptr) ImageTexelPointer 399(g_tTex3di1) 477 31 + 481: 12(int) AtomicXor 480 34 31 479 + 482: 401(ptr) AccessChain 23 400 + 483: 20(ivec3) Load 482 + 484: 25(ptr) AccessChain 23 24 + 485: 12(int) Load 484 + 486: 32(ptr) ImageTexelPointer 399(g_tTex3di1) 483 31 + 487: 12(int) AtomicXor 486 34 31 485 + Store 37(out_i1) 487 + 493: 492(ptr) AccessChain 23 491 + 494: 18(ivec3) Load 493 + 495: 123(ptr) AccessChain 23 122 + 496: 16(int) Load 495 + 497: 128(ptr) ImageTexelPointer 490(g_tTex3du1) 494 31 + 498: 16(int) AtomicIAdd 497 34 31 496 + 499: 492(ptr) AccessChain 23 491 + 500: 18(ivec3) Load 499 + 501: 123(ptr) AccessChain 23 122 + 502: 16(int) Load 501 + 503: 128(ptr) ImageTexelPointer 490(g_tTex3du1) 500 31 + 504: 16(int) AtomicIAdd 503 34 31 502 + Store 132(out_u1) 504 + 505: 492(ptr) AccessChain 23 491 + 506: 18(ivec3) Load 505 + 507: 123(ptr) AccessChain 23 122 + 508: 16(int) Load 507 + 509: 128(ptr) ImageTexelPointer 490(g_tTex3du1) 506 31 + 510: 16(int) AtomicAnd 509 34 31 508 + 511: 492(ptr) AccessChain 23 491 + 512: 18(ivec3) Load 511 + 513: 123(ptr) AccessChain 23 122 + 514: 16(int) Load 513 + 515: 128(ptr) ImageTexelPointer 490(g_tTex3du1) 512 31 + 516: 16(int) AtomicAnd 515 34 31 514 + Store 132(out_u1) 516 + 517: 492(ptr) AccessChain 23 491 + 518: 18(ivec3) Load 517 + 519: 123(ptr) AccessChain 23 153 + 520: 16(int) Load 519 + 521: 123(ptr) AccessChain 23 156 + 522: 16(int) Load 521 + 523: 128(ptr) ImageTexelPointer 490(g_tTex3du1) 518 31 + 524: 16(int) AtomicCompareExchange 523 34 31 31 522 520 + Store 132(out_u1) 524 + 525: 492(ptr) AccessChain 23 491 + 526: 18(ivec3) Load 525 + 527: 123(ptr) AccessChain 23 122 + 528: 16(int) Load 527 + 529: 128(ptr) ImageTexelPointer 490(g_tTex3du1) 526 31 + 530: 16(int) AtomicExchange 529 34 31 528 + Store 132(out_u1) 530 + 531: 492(ptr) AccessChain 23 491 + 532: 18(ivec3) Load 531 + 533: 123(ptr) AccessChain 23 122 + 534: 16(int) Load 533 + 535: 128(ptr) ImageTexelPointer 490(g_tTex3du1) 532 31 + 536: 16(int) AtomicUMax 535 34 31 534 + 537: 492(ptr) AccessChain 23 491 + 538: 18(ivec3) Load 537 + 539: 123(ptr) AccessChain 23 122 + 540: 16(int) Load 539 + 541: 128(ptr) ImageTexelPointer 490(g_tTex3du1) 538 31 + 542: 16(int) AtomicUMax 541 34 31 540 + Store 132(out_u1) 542 + 543: 492(ptr) AccessChain 23 491 + 544: 18(ivec3) Load 543 + 545: 123(ptr) AccessChain 23 122 + 546: 16(int) Load 545 + 547: 128(ptr) ImageTexelPointer 490(g_tTex3du1) 544 31 + 548: 16(int) AtomicUMin 547 34 31 546 + 549: 492(ptr) AccessChain 23 491 + 550: 18(ivec3) Load 549 + 551: 123(ptr) AccessChain 23 122 + 552: 16(int) Load 551 + 553: 128(ptr) ImageTexelPointer 490(g_tTex3du1) 550 31 + 554: 16(int) AtomicUMin 553 34 31 552 + Store 132(out_u1) 554 + 555: 492(ptr) AccessChain 23 491 + 556: 18(ivec3) Load 555 + 557: 123(ptr) AccessChain 23 122 + 558: 16(int) Load 557 + 559: 128(ptr) ImageTexelPointer 490(g_tTex3du1) 556 31 + 560: 16(int) AtomicOr 559 34 31 558 + 561: 492(ptr) AccessChain 23 491 + 562: 18(ivec3) Load 561 + 563: 123(ptr) AccessChain 23 122 + 564: 16(int) Load 563 + 565: 128(ptr) ImageTexelPointer 490(g_tTex3du1) 562 31 + 566: 16(int) AtomicOr 565 34 31 564 + Store 132(out_u1) 566 + 567: 492(ptr) AccessChain 23 491 + 568: 18(ivec3) Load 567 + 569: 123(ptr) AccessChain 23 122 + 570: 16(int) Load 569 + 571: 128(ptr) ImageTexelPointer 490(g_tTex3du1) 568 31 + 572: 16(int) AtomicXor 571 34 31 570 + 573: 492(ptr) AccessChain 23 491 + 574: 18(ivec3) Load 573 + 575: 123(ptr) AccessChain 23 122 + 576: 16(int) Load 575 + 577: 128(ptr) ImageTexelPointer 490(g_tTex3du1) 574 31 + 578: 16(int) AtomicXor 577 34 31 576 + Store 132(out_u1) 578 + 582: 219(ptr) AccessChain 23 218 + 583: 19(ivec2) Load 582 + 584: 25(ptr) AccessChain 23 28 + 585: 12(int) Load 584 + 586: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 583 31 + 587: 12(int) AtomicIAdd 586 34 31 585 + 588: 219(ptr) AccessChain 23 218 + 589: 19(ivec2) Load 588 + 590: 25(ptr) AccessChain 23 24 + 591: 12(int) Load 590 + 592: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 589 31 + 593: 12(int) AtomicIAdd 592 34 31 591 + Store 37(out_i1) 593 + 594: 219(ptr) AccessChain 23 218 + 595: 19(ivec2) Load 594 + 596: 25(ptr) AccessChain 23 28 + 597: 12(int) Load 596 + 598: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 595 31 + 599: 12(int) AtomicAnd 598 34 31 597 + 600: 219(ptr) AccessChain 23 218 + 601: 19(ivec2) Load 600 + 602: 25(ptr) AccessChain 23 24 + 603: 12(int) Load 602 + 604: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 601 31 + 605: 12(int) AtomicAnd 604 34 31 603 + Store 37(out_i1) 605 + 606: 219(ptr) AccessChain 23 218 + 607: 19(ivec2) Load 606 + 608: 25(ptr) AccessChain 23 28 + 609: 12(int) Load 608 + 610: 25(ptr) AccessChain 23 60 + 611: 12(int) Load 610 + 612: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 607 31 + 613: 12(int) AtomicCompareExchange 612 34 31 31 611 609 + Store 37(out_i1) 613 + 614: 219(ptr) AccessChain 23 218 + 615: 19(ivec2) Load 614 + 616: 25(ptr) AccessChain 23 24 + 617: 12(int) Load 616 + 618: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 615 31 + 619: 12(int) AtomicExchange 618 34 31 617 + Store 37(out_i1) 619 + 620: 219(ptr) AccessChain 23 218 + 621: 19(ivec2) Load 620 + 622: 25(ptr) AccessChain 23 28 + 623: 12(int) Load 622 + 624: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 621 31 + 625: 12(int) AtomicSMax 624 34 31 623 + 626: 219(ptr) AccessChain 23 218 + 627: 19(ivec2) Load 626 + 628: 25(ptr) AccessChain 23 24 + 629: 12(int) Load 628 + 630: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 627 31 + 631: 12(int) AtomicSMax 630 34 31 629 + Store 37(out_i1) 631 + 632: 219(ptr) AccessChain 23 218 + 633: 19(ivec2) Load 632 + 634: 25(ptr) AccessChain 23 28 + 635: 12(int) Load 634 + 636: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 633 31 + 637: 12(int) AtomicSMin 636 34 31 635 + 638: 219(ptr) AccessChain 23 218 + 639: 19(ivec2) Load 638 + 640: 25(ptr) AccessChain 23 24 + 641: 12(int) Load 640 + 642: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 639 31 + 643: 12(int) AtomicSMin 642 34 31 641 + Store 37(out_i1) 643 + 644: 219(ptr) AccessChain 23 218 + 645: 19(ivec2) Load 644 + 646: 25(ptr) AccessChain 23 28 + 647: 12(int) Load 646 + 648: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 645 31 + 649: 12(int) AtomicOr 648 34 31 647 + 650: 219(ptr) AccessChain 23 218 + 651: 19(ivec2) Load 650 + 652: 25(ptr) AccessChain 23 24 + 653: 12(int) Load 652 + 654: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 651 31 + 655: 12(int) AtomicOr 654 34 31 653 + Store 37(out_i1) 655 + 656: 219(ptr) AccessChain 23 218 + 657: 19(ivec2) Load 656 + 658: 25(ptr) AccessChain 23 28 + 659: 12(int) Load 658 + 660: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 657 31 + 661: 12(int) AtomicXor 660 34 31 659 + 662: 219(ptr) AccessChain 23 218 + 663: 19(ivec2) Load 662 + 664: 25(ptr) AccessChain 23 24 + 665: 12(int) Load 664 + 666: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 663 31 + 667: 12(int) AtomicXor 666 34 31 665 + Store 37(out_i1) 667 + 671: 310(ptr) AccessChain 23 309 + 672: 17(ivec2) Load 671 + 673: 123(ptr) AccessChain 23 122 + 674: 16(int) Load 673 + 675: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 672 31 + 676: 16(int) AtomicIAdd 675 34 31 674 + 677: 310(ptr) AccessChain 23 309 + 678: 17(ivec2) Load 677 + 679: 123(ptr) AccessChain 23 122 + 680: 16(int) Load 679 + 681: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 678 31 + 682: 16(int) AtomicIAdd 681 34 31 680 + Store 132(out_u1) 682 + 683: 310(ptr) AccessChain 23 309 + 684: 17(ivec2) Load 683 + 685: 123(ptr) AccessChain 23 122 + 686: 16(int) Load 685 + 687: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 684 31 + 688: 16(int) AtomicAnd 687 34 31 686 + 689: 310(ptr) AccessChain 23 309 + 690: 17(ivec2) Load 689 + 691: 123(ptr) AccessChain 23 122 + 692: 16(int) Load 691 + 693: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 690 31 + 694: 16(int) AtomicAnd 693 34 31 692 + Store 132(out_u1) 694 + 695: 310(ptr) AccessChain 23 309 + 696: 17(ivec2) Load 695 + 697: 123(ptr) AccessChain 23 153 + 698: 16(int) Load 697 + 699: 123(ptr) AccessChain 23 156 + 700: 16(int) Load 699 + 701: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 696 31 + 702: 16(int) AtomicCompareExchange 701 34 31 31 700 698 + Store 132(out_u1) 702 + 703: 310(ptr) AccessChain 23 309 + 704: 17(ivec2) Load 703 + 705: 123(ptr) AccessChain 23 122 + 706: 16(int) Load 705 + 707: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 704 31 + 708: 16(int) AtomicExchange 707 34 31 706 + Store 132(out_u1) 708 + 709: 310(ptr) AccessChain 23 309 + 710: 17(ivec2) Load 709 + 711: 123(ptr) AccessChain 23 122 + 712: 16(int) Load 711 + 713: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 710 31 + 714: 16(int) AtomicUMax 713 34 31 712 + 715: 310(ptr) AccessChain 23 309 + 716: 17(ivec2) Load 715 + 717: 123(ptr) AccessChain 23 122 + 718: 16(int) Load 717 + 719: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 716 31 + 720: 16(int) AtomicUMax 719 34 31 718 + Store 132(out_u1) 720 + 721: 310(ptr) AccessChain 23 309 + 722: 17(ivec2) Load 721 + 723: 123(ptr) AccessChain 23 122 + 724: 16(int) Load 723 + 725: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 722 31 + 726: 16(int) AtomicUMin 725 34 31 724 + 727: 310(ptr) AccessChain 23 309 + 728: 17(ivec2) Load 727 + 729: 123(ptr) AccessChain 23 122 + 730: 16(int) Load 729 + 731: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 728 31 + 732: 16(int) AtomicUMin 731 34 31 730 + Store 132(out_u1) 732 + 733: 310(ptr) AccessChain 23 309 + 734: 17(ivec2) Load 733 + 735: 123(ptr) AccessChain 23 122 + 736: 16(int) Load 735 + 737: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 734 31 + 738: 16(int) AtomicOr 737 34 31 736 + 739: 310(ptr) AccessChain 23 309 + 740: 17(ivec2) Load 739 + 741: 123(ptr) AccessChain 23 122 + 742: 16(int) Load 741 + 743: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 740 31 + 744: 16(int) AtomicOr 743 34 31 742 + Store 132(out_u1) 744 + 745: 310(ptr) AccessChain 23 309 + 746: 17(ivec2) Load 745 + 747: 123(ptr) AccessChain 23 122 + 748: 16(int) Load 747 + 749: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 746 31 + 750: 16(int) AtomicXor 749 34 31 748 + 751: 310(ptr) AccessChain 23 309 + 752: 17(ivec2) Load 751 + 753: 123(ptr) AccessChain 23 122 + 754: 16(int) Load 753 + 755: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 752 31 + 756: 16(int) AtomicXor 755 34 31 754 + Store 132(out_u1) 756 + 757: 219(ptr) AccessChain 23 218 + 758: 19(ivec2) Load 757 + 759: 25(ptr) AccessChain 23 28 + 760: 12(int) Load 759 + 761: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 758 31 + 762: 12(int) AtomicIAdd 761 34 31 760 + 763: 219(ptr) AccessChain 23 218 + 764: 19(ivec2) Load 763 + 765: 25(ptr) AccessChain 23 24 + 766: 12(int) Load 765 + 767: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 764 31 + 768: 12(int) AtomicIAdd 767 34 31 766 + Store 37(out_i1) 768 + 769: 219(ptr) AccessChain 23 218 + 770: 19(ivec2) Load 769 + 771: 25(ptr) AccessChain 23 28 + 772: 12(int) Load 771 + 773: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 770 31 + 774: 12(int) AtomicAnd 773 34 31 772 + 775: 219(ptr) AccessChain 23 218 + 776: 19(ivec2) Load 775 + 777: 25(ptr) AccessChain 23 24 + 778: 12(int) Load 777 + 779: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 776 31 + 780: 12(int) AtomicAnd 779 34 31 778 + Store 37(out_i1) 780 + 781: 219(ptr) AccessChain 23 218 + 782: 19(ivec2) Load 781 + 783: 25(ptr) AccessChain 23 28 + 784: 12(int) Load 783 + 785: 25(ptr) AccessChain 23 60 + 786: 12(int) Load 785 + 787: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 782 31 + 788: 12(int) AtomicCompareExchange 787 34 31 31 786 784 + Store 37(out_i1) 788 + 789: 219(ptr) AccessChain 23 218 + 790: 19(ivec2) Load 789 + 791: 25(ptr) AccessChain 23 24 + 792: 12(int) Load 791 + 793: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 790 31 + 794: 12(int) AtomicExchange 793 34 31 792 + Store 37(out_i1) 794 + 795: 219(ptr) AccessChain 23 218 + 796: 19(ivec2) Load 795 + 797: 25(ptr) AccessChain 23 28 + 798: 12(int) Load 797 + 799: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 796 31 + 800: 12(int) AtomicSMax 799 34 31 798 + 801: 219(ptr) AccessChain 23 218 + 802: 19(ivec2) Load 801 + 803: 25(ptr) AccessChain 23 24 + 804: 12(int) Load 803 + 805: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 802 31 + 806: 12(int) AtomicSMax 805 34 31 804 + Store 37(out_i1) 806 + 807: 219(ptr) AccessChain 23 218 + 808: 19(ivec2) Load 807 + 809: 25(ptr) AccessChain 23 28 + 810: 12(int) Load 809 + 811: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 808 31 + 812: 12(int) AtomicSMin 811 34 31 810 + 813: 219(ptr) AccessChain 23 218 + 814: 19(ivec2) Load 813 + 815: 25(ptr) AccessChain 23 24 + 816: 12(int) Load 815 + 817: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 814 31 + 818: 12(int) AtomicSMin 817 34 31 816 + Store 37(out_i1) 818 + 819: 219(ptr) AccessChain 23 218 + 820: 19(ivec2) Load 819 + 821: 25(ptr) AccessChain 23 28 + 822: 12(int) Load 821 + 823: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 820 31 + 824: 12(int) AtomicOr 823 34 31 822 + 825: 219(ptr) AccessChain 23 218 + 826: 19(ivec2) Load 825 + 827: 25(ptr) AccessChain 23 24 + 828: 12(int) Load 827 + 829: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 826 31 + 830: 12(int) AtomicOr 829 34 31 828 + Store 37(out_i1) 830 + 831: 219(ptr) AccessChain 23 218 + 832: 19(ivec2) Load 831 + 833: 25(ptr) AccessChain 23 28 + 834: 12(int) Load 833 + 835: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 832 31 + 836: 12(int) AtomicXor 835 34 31 834 + 837: 219(ptr) AccessChain 23 218 + 838: 19(ivec2) Load 837 + 839: 25(ptr) AccessChain 23 24 + 840: 12(int) Load 839 + 841: 32(ptr) ImageTexelPointer 581(g_tTex1di1a) 838 31 + 842: 12(int) AtomicXor 841 34 31 840 + Store 37(out_i1) 842 + 843: 310(ptr) AccessChain 23 309 + 844: 17(ivec2) Load 843 + 845: 123(ptr) AccessChain 23 122 + 846: 16(int) Load 845 + 847: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 844 31 + 848: 16(int) AtomicIAdd 847 34 31 846 + 849: 310(ptr) AccessChain 23 309 + 850: 17(ivec2) Load 849 + 851: 123(ptr) AccessChain 23 122 + 852: 16(int) Load 851 + 853: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 850 31 + 854: 16(int) AtomicIAdd 853 34 31 852 + Store 132(out_u1) 854 + 855: 310(ptr) AccessChain 23 309 + 856: 17(ivec2) Load 855 + 857: 123(ptr) AccessChain 23 122 + 858: 16(int) Load 857 + 859: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 856 31 + 860: 16(int) AtomicAnd 859 34 31 858 + 861: 310(ptr) AccessChain 23 309 + 862: 17(ivec2) Load 861 + 863: 123(ptr) AccessChain 23 122 + 864: 16(int) Load 863 + 865: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 862 31 + 866: 16(int) AtomicAnd 865 34 31 864 + Store 132(out_u1) 866 + 867: 310(ptr) AccessChain 23 309 + 868: 17(ivec2) Load 867 + 869: 123(ptr) AccessChain 23 153 + 870: 16(int) Load 869 + 871: 123(ptr) AccessChain 23 156 + 872: 16(int) Load 871 + 873: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 868 31 + 874: 16(int) AtomicCompareExchange 873 34 31 31 872 870 + Store 132(out_u1) 874 + 875: 310(ptr) AccessChain 23 309 + 876: 17(ivec2) Load 875 + 877: 123(ptr) AccessChain 23 122 + 878: 16(int) Load 877 + 879: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 876 31 + 880: 16(int) AtomicExchange 879 34 31 878 + Store 132(out_u1) 880 + 881: 310(ptr) AccessChain 23 309 + 882: 17(ivec2) Load 881 + 883: 123(ptr) AccessChain 23 122 + 884: 16(int) Load 883 + 885: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 882 31 + 886: 16(int) AtomicUMax 885 34 31 884 + 887: 310(ptr) AccessChain 23 309 + 888: 17(ivec2) Load 887 + 889: 123(ptr) AccessChain 23 122 + 890: 16(int) Load 889 + 891: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 888 31 + 892: 16(int) AtomicUMax 891 34 31 890 + Store 132(out_u1) 892 + 893: 310(ptr) AccessChain 23 309 + 894: 17(ivec2) Load 893 + 895: 123(ptr) AccessChain 23 122 + 896: 16(int) Load 895 + 897: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 894 31 + 898: 16(int) AtomicUMin 897 34 31 896 + 899: 310(ptr) AccessChain 23 309 + 900: 17(ivec2) Load 899 + 901: 123(ptr) AccessChain 23 122 + 902: 16(int) Load 901 + 903: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 900 31 + 904: 16(int) AtomicUMin 903 34 31 902 + Store 132(out_u1) 904 + 905: 310(ptr) AccessChain 23 309 + 906: 17(ivec2) Load 905 + 907: 123(ptr) AccessChain 23 122 + 908: 16(int) Load 907 + 909: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 906 31 + 910: 16(int) AtomicOr 909 34 31 908 + 911: 310(ptr) AccessChain 23 309 + 912: 17(ivec2) Load 911 + 913: 123(ptr) AccessChain 23 122 + 914: 16(int) Load 913 + 915: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 912 31 + 916: 16(int) AtomicOr 915 34 31 914 + Store 132(out_u1) 916 + 917: 310(ptr) AccessChain 23 309 + 918: 17(ivec2) Load 917 + 919: 123(ptr) AccessChain 23 122 + 920: 16(int) Load 919 + 921: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 918 31 + 922: 16(int) AtomicXor 921 34 31 920 + 923: 310(ptr) AccessChain 23 309 + 924: 17(ivec2) Load 923 + 925: 123(ptr) AccessChain 23 122 + 926: 16(int) Load 925 + 927: 128(ptr) ImageTexelPointer 670(g_tTex1du1a) 924 31 + 928: 16(int) AtomicXor 927 34 31 926 + Store 132(out_u1) 928 + 932: 25(ptr) AccessChain 23 24 + 933: 12(int) Load 932 + 934: 25(ptr) AccessChain 23 28 + 935: 12(int) Load 934 + 936: 32(ptr) ImageTexelPointer 931(g_tBuffI) 933 31 + 937: 12(int) AtomicIAdd 936 34 31 935 + 938: 25(ptr) AccessChain 23 24 + 939: 12(int) Load 938 + 940: 25(ptr) AccessChain 23 24 + 941: 12(int) Load 940 + 942: 32(ptr) ImageTexelPointer 931(g_tBuffI) 939 31 + 943: 12(int) AtomicIAdd 942 34 31 941 + Store 37(out_i1) 943 + 944: 25(ptr) AccessChain 23 24 + 945: 12(int) Load 944 + 946: 25(ptr) AccessChain 23 28 + 947: 12(int) Load 946 + 948: 32(ptr) ImageTexelPointer 931(g_tBuffI) 945 31 + 949: 12(int) AtomicAnd 948 34 31 947 + 950: 25(ptr) AccessChain 23 24 + 951: 12(int) Load 950 + 952: 25(ptr) AccessChain 23 24 + 953: 12(int) Load 952 + 954: 32(ptr) ImageTexelPointer 931(g_tBuffI) 951 31 + 955: 12(int) AtomicAnd 954 34 31 953 + Store 37(out_i1) 955 + 956: 25(ptr) AccessChain 23 24 + 957: 12(int) Load 956 + 958: 25(ptr) AccessChain 23 28 + 959: 12(int) Load 958 + 960: 25(ptr) AccessChain 23 60 + 961: 12(int) Load 960 + 962: 32(ptr) ImageTexelPointer 931(g_tBuffI) 957 31 + 963: 12(int) AtomicCompareExchange 962 34 31 31 961 959 + Store 37(out_i1) 963 + 964: 25(ptr) AccessChain 23 24 + 965: 12(int) Load 964 + 966: 25(ptr) AccessChain 23 24 + 967: 12(int) Load 966 + 968: 32(ptr) ImageTexelPointer 931(g_tBuffI) 965 31 + 969: 12(int) AtomicExchange 968 34 31 967 + Store 37(out_i1) 969 + 970: 25(ptr) AccessChain 23 24 + 971: 12(int) Load 970 + 972: 25(ptr) AccessChain 23 28 + 973: 12(int) Load 972 + 974: 32(ptr) ImageTexelPointer 931(g_tBuffI) 971 31 + 975: 12(int) AtomicSMax 974 34 31 973 + 976: 25(ptr) AccessChain 23 24 + 977: 12(int) Load 976 + 978: 25(ptr) AccessChain 23 24 + 979: 12(int) Load 978 + 980: 32(ptr) ImageTexelPointer 931(g_tBuffI) 977 31 + 981: 12(int) AtomicSMax 980 34 31 979 + Store 37(out_i1) 981 + 982: 25(ptr) AccessChain 23 24 + 983: 12(int) Load 982 + 984: 25(ptr) AccessChain 23 28 + 985: 12(int) Load 984 + 986: 32(ptr) ImageTexelPointer 931(g_tBuffI) 983 31 + 987: 12(int) AtomicSMin 986 34 31 985 + 988: 25(ptr) AccessChain 23 24 + 989: 12(int) Load 988 + 990: 25(ptr) AccessChain 23 24 + 991: 12(int) Load 990 + 992: 32(ptr) ImageTexelPointer 931(g_tBuffI) 989 31 + 993: 12(int) AtomicSMin 992 34 31 991 + Store 37(out_i1) 993 + 994: 25(ptr) AccessChain 23 24 + 995: 12(int) Load 994 + 996: 25(ptr) AccessChain 23 28 + 997: 12(int) Load 996 + 998: 32(ptr) ImageTexelPointer 931(g_tBuffI) 995 31 + 999: 12(int) AtomicOr 998 34 31 997 + 1000: 25(ptr) AccessChain 23 24 + 1001: 12(int) Load 1000 + 1002: 25(ptr) AccessChain 23 24 + 1003: 12(int) Load 1002 + 1004: 32(ptr) ImageTexelPointer 931(g_tBuffI) 1001 31 + 1005: 12(int) AtomicOr 1004 34 31 1003 + Store 37(out_i1) 1005 + 1006: 25(ptr) AccessChain 23 24 + 1007: 12(int) Load 1006 + 1008: 25(ptr) AccessChain 23 28 + 1009: 12(int) Load 1008 + 1010: 32(ptr) ImageTexelPointer 931(g_tBuffI) 1007 31 + 1011: 12(int) AtomicXor 1010 34 31 1009 + 1012: 25(ptr) AccessChain 23 24 + 1013: 12(int) Load 1012 + 1014: 25(ptr) AccessChain 23 24 + 1015: 12(int) Load 1014 + 1016: 32(ptr) ImageTexelPointer 931(g_tBuffI) 1013 31 + 1017: 12(int) AtomicXor 1016 34 31 1015 + Store 37(out_i1) 1017 + 1021: 123(ptr) AccessChain 23 122 + 1022: 16(int) Load 1021 + 1023: 123(ptr) AccessChain 23 122 + 1024: 16(int) Load 1023 + 1025: 128(ptr) ImageTexelPointer 1020(g_tBuffU) 1022 31 + 1026: 16(int) AtomicIAdd 1025 34 31 1024 + 1027: 123(ptr) AccessChain 23 122 + 1028: 16(int) Load 1027 + 1029: 123(ptr) AccessChain 23 122 + 1030: 16(int) Load 1029 + 1031: 128(ptr) ImageTexelPointer 1020(g_tBuffU) 1028 31 + 1032: 16(int) AtomicIAdd 1031 34 31 1030 + Store 132(out_u1) 1032 + 1033: 123(ptr) AccessChain 23 122 + 1034: 16(int) Load 1033 + 1035: 123(ptr) AccessChain 23 122 + 1036: 16(int) Load 1035 + 1037: 128(ptr) ImageTexelPointer 1020(g_tBuffU) 1034 31 + 1038: 16(int) AtomicAnd 1037 34 31 1036 + 1039: 123(ptr) AccessChain 23 122 + 1040: 16(int) Load 1039 + 1041: 123(ptr) AccessChain 23 122 + 1042: 16(int) Load 1041 + 1043: 128(ptr) ImageTexelPointer 1020(g_tBuffU) 1040 31 + 1044: 16(int) AtomicAnd 1043 34 31 1042 + Store 132(out_u1) 1044 + 1045: 123(ptr) AccessChain 23 122 + 1046: 16(int) Load 1045 + 1047: 123(ptr) AccessChain 23 153 + 1048: 16(int) Load 1047 + 1049: 123(ptr) AccessChain 23 156 + 1050: 16(int) Load 1049 + 1051: 128(ptr) ImageTexelPointer 1020(g_tBuffU) 1046 31 + 1052: 16(int) AtomicCompareExchange 1051 34 31 31 1050 1048 + Store 132(out_u1) 1052 + 1053: 123(ptr) AccessChain 23 122 + 1054: 16(int) Load 1053 + 1055: 123(ptr) AccessChain 23 122 + 1056: 16(int) Load 1055 + 1057: 128(ptr) ImageTexelPointer 1020(g_tBuffU) 1054 31 + 1058: 16(int) AtomicExchange 1057 34 31 1056 + Store 132(out_u1) 1058 + 1059: 123(ptr) AccessChain 23 122 + 1060: 16(int) Load 1059 + 1061: 123(ptr) AccessChain 23 122 + 1062: 16(int) Load 1061 + 1063: 128(ptr) ImageTexelPointer 1020(g_tBuffU) 1060 31 + 1064: 16(int) AtomicUMax 1063 34 31 1062 + 1065: 123(ptr) AccessChain 23 122 + 1066: 16(int) Load 1065 + 1067: 123(ptr) AccessChain 23 122 + 1068: 16(int) Load 1067 + 1069: 128(ptr) ImageTexelPointer 1020(g_tBuffU) 1066 31 + 1070: 16(int) AtomicUMax 1069 34 31 1068 + Store 132(out_u1) 1070 + 1071: 123(ptr) AccessChain 23 122 + 1072: 16(int) Load 1071 + 1073: 123(ptr) AccessChain 23 122 + 1074: 16(int) Load 1073 + 1075: 128(ptr) ImageTexelPointer 1020(g_tBuffU) 1072 31 + 1076: 16(int) AtomicUMin 1075 34 31 1074 + 1077: 123(ptr) AccessChain 23 122 + 1078: 16(int) Load 1077 + 1079: 123(ptr) AccessChain 23 122 + 1080: 16(int) Load 1079 + 1081: 128(ptr) ImageTexelPointer 1020(g_tBuffU) 1078 31 + 1082: 16(int) AtomicUMin 1081 34 31 1080 + Store 132(out_u1) 1082 + 1083: 123(ptr) AccessChain 23 122 + 1084: 16(int) Load 1083 + 1085: 123(ptr) AccessChain 23 122 + 1086: 16(int) Load 1085 + 1087: 128(ptr) ImageTexelPointer 1020(g_tBuffU) 1084 31 + 1088: 16(int) AtomicOr 1087 34 31 1086 + 1089: 123(ptr) AccessChain 23 122 + 1090: 16(int) Load 1089 + 1091: 123(ptr) AccessChain 23 122 + 1092: 16(int) Load 1091 + 1093: 128(ptr) ImageTexelPointer 1020(g_tBuffU) 1090 31 + 1094: 16(int) AtomicOr 1093 34 31 1092 + Store 132(out_u1) 1094 + 1095: 123(ptr) AccessChain 23 122 + 1096: 16(int) Load 1095 + 1097: 123(ptr) AccessChain 23 122 + 1098: 16(int) Load 1097 + 1099: 128(ptr) ImageTexelPointer 1020(g_tBuffU) 1096 31 + 1100: 16(int) AtomicXor 1099 34 31 1098 + 1101: 123(ptr) AccessChain 23 122 + 1102: 16(int) Load 1101 + 1103: 123(ptr) AccessChain 23 122 + 1104: 16(int) Load 1103 + 1105: 128(ptr) ImageTexelPointer 1020(g_tBuffU) 1102 31 + 1106: 16(int) AtomicXor 1105 34 31 1104 + Store 132(out_u1) 1106 + 1112: 1111(ptr) AccessChain 1108(psout) 122 + Store 1112 1110 + 1113:8(PS_OUTPUT) Load 1108(psout) + ReturnValue 1113 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.rw.bracket.frag.out b/deps/glslang/Test/baseResults/hlsl.rw.bracket.frag.out new file mode 100644 index 00000000..d829a7bc --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.rw.bracket.frag.out @@ -0,0 +1,2665 @@ +hlsl.rw.bracket.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:42 Function Definition: Fn1(vi4; ( temp 4-component vector of int) +0:42 Function Parameters: +0:42 'x' ( in 4-component vector of int) +0:? Sequence +0:42 Branch: Return with expression +0:42 'x' ( in 4-component vector of int) +0:43 Function Definition: Fn1(vu4; ( temp 4-component vector of uint) +0:43 Function Parameters: +0:43 'x' ( in 4-component vector of uint) +0:? Sequence +0:43 Branch: Return with expression +0:43 'x' ( in 4-component vector of uint) +0:44 Function Definition: Fn1(vf4; ( temp 4-component vector of float) +0:44 Function Parameters: +0:44 'x' ( in 4-component vector of float) +0:? Sequence +0:44 Branch: Return with expression +0:44 'x' ( in 4-component vector of float) +0:46 Function Definition: Fn2(vi4; ( temp void) +0:46 Function Parameters: +0:46 'x' ( out 4-component vector of int) +0:? Sequence +0:46 move second child to first child ( temp 4-component vector of int) +0:46 'x' ( out 4-component vector of int) +0:46 Constant: +0:46 0 (const int) +0:46 0 (const int) +0:46 0 (const int) +0:46 0 (const int) +0:47 Function Definition: Fn2(vu4; ( temp void) +0:47 Function Parameters: +0:47 'x' ( out 4-component vector of uint) +0:? Sequence +0:47 move second child to first child ( temp 4-component vector of uint) +0:47 'x' ( out 4-component vector of uint) +0:47 Constant: +0:47 0 (const uint) +0:47 0 (const uint) +0:47 0 (const uint) +0:47 0 (const uint) +0:48 Function Definition: Fn2(vf4; ( temp void) +0:48 Function Parameters: +0:48 'x' ( out 4-component vector of float) +0:? Sequence +0:48 move second child to first child ( temp 4-component vector of float) +0:48 'x' ( out 4-component vector of float) +0:48 Constant: +0:48 0.000000 +0:48 0.000000 +0:48 0.000000 +0:48 0.000000 +0:50 Function Definition: SomeValue( ( temp 4-component vector of float) +0:50 Function Parameters: +0:? Sequence +0:50 Branch: Return with expression +0:50 Convert int to float ( temp 4-component vector of float) +0:50 c4: direct index for structure ( uniform 4-component vector of int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:50 Constant: +0:50 3 (const uint) +0:53 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:53 Function Parameters: +0:? Sequence +0:57 imageLoad ( temp 4-component vector of float) +0:57 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:57 c1: direct index for structure ( uniform int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:57 Constant: +0:57 0 (const uint) +0:59 Sequence +0:59 move second child to first child ( temp 4-component vector of float) +0:59 'r00' ( temp 4-component vector of float) +0:59 imageLoad ( temp 4-component vector of float) +0:59 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:59 c1: direct index for structure ( uniform int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:59 Constant: +0:59 0 (const uint) +0:60 Sequence +0:60 move second child to first child ( temp 4-component vector of int) +0:60 'r01' ( temp 4-component vector of int) +0:60 imageLoad ( temp 4-component vector of int) +0:60 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:60 c1: direct index for structure ( uniform int) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:60 Constant: +0:60 0 (const uint) +0:61 Sequence +0:61 move second child to first child ( temp 4-component vector of uint) +0:61 'r02' ( temp 4-component vector of uint) +0:61 imageLoad ( temp 4-component vector of uint) +0:61 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:61 c1: direct index for structure ( uniform int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:61 Constant: +0:61 0 (const uint) +0:64 Sequence +0:64 move second child to first child ( temp 4-component vector of float) +0:64 'r10' ( temp 4-component vector of float) +0:64 imageLoad ( temp 4-component vector of float) +0:64 'g_tTex2df4' (layout( rgba32f) uniform image2D) +0:64 c2: direct index for structure ( uniform 2-component vector of int) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:64 Constant: +0:64 1 (const uint) +0:65 Sequence +0:65 move second child to first child ( temp 4-component vector of int) +0:65 'r11' ( temp 4-component vector of int) +0:65 imageLoad ( temp 4-component vector of int) +0:65 'g_tTex2di4' (layout( rgba32i) uniform iimage2D) +0:65 c2: direct index for structure ( uniform 2-component vector of int) +0:65 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:65 Constant: +0:65 1 (const uint) +0:66 Sequence +0:66 move second child to first child ( temp 4-component vector of uint) +0:66 'r12' ( temp 4-component vector of uint) +0:66 imageLoad ( temp 4-component vector of uint) +0:66 'g_tTex2du4' (layout( rgba32ui) uniform uimage2D) +0:66 c2: direct index for structure ( uniform 2-component vector of int) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:66 Constant: +0:66 1 (const uint) +0:69 Sequence +0:69 move second child to first child ( temp 4-component vector of float) +0:69 'r20' ( temp 4-component vector of float) +0:69 imageLoad ( temp 4-component vector of float) +0:69 'g_tTex3df4' (layout( rgba32f) uniform image3D) +0:69 c3: direct index for structure ( uniform 3-component vector of int) +0:69 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:69 Constant: +0:69 2 (const uint) +0:70 Sequence +0:70 move second child to first child ( temp 4-component vector of int) +0:70 'r21' ( temp 4-component vector of int) +0:70 imageLoad ( temp 4-component vector of int) +0:70 'g_tTex3di4' (layout( rgba32i) uniform iimage3D) +0:70 c3: direct index for structure ( uniform 3-component vector of int) +0:70 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:70 Constant: +0:70 2 (const uint) +0:71 Sequence +0:71 move second child to first child ( temp 4-component vector of uint) +0:71 'r22' ( temp 4-component vector of uint) +0:71 imageLoad ( temp 4-component vector of uint) +0:71 'g_tTex3du4' (layout( rgba32ui) uniform uimage3D) +0:71 c3: direct index for structure ( uniform 3-component vector of int) +0:71 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:71 Constant: +0:71 2 (const uint) +0:73 Sequence +0:73 move second child to first child ( temp 4-component vector of float) +0:73 'lf4' ( temp 4-component vector of float) +0:73 uf4: direct index for structure ( uniform 4-component vector of float) +0:73 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:73 Constant: +0:73 8 (const uint) +0:77 Sequence +0:77 move second child to first child ( temp 4-component vector of float) +0:77 'storeTemp' ( temp 4-component vector of float) +0:77 Function Call: SomeValue( ( temp 4-component vector of float) +0:77 imageStore ( temp void) +0:77 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:77 c1: direct index for structure ( uniform int) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:77 Constant: +0:77 0 (const uint) +0:77 'storeTemp' ( temp 4-component vector of float) +0:77 'storeTemp' ( temp 4-component vector of float) +0:78 Sequence +0:78 imageStore ( temp void) +0:78 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:78 c1: direct index for structure ( uniform int) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:78 Constant: +0:78 0 (const uint) +0:78 'lf4' ( temp 4-component vector of float) +0:78 'lf4' ( temp 4-component vector of float) +0:79 Sequence +0:79 move second child to first child ( temp 4-component vector of int) +0:79 'storeTemp' ( temp 4-component vector of int) +0:? Constant: +0:? 2 (const int) +0:? 2 (const int) +0:? 3 (const int) +0:? 4 (const int) +0:79 imageStore ( temp void) +0:79 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:79 c1: direct index for structure ( uniform int) +0:79 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:79 Constant: +0:79 0 (const uint) +0:79 'storeTemp' ( temp 4-component vector of int) +0:79 'storeTemp' ( temp 4-component vector of int) +0:80 Sequence +0:80 move second child to first child ( temp 4-component vector of uint) +0:80 'storeTemp' ( temp 4-component vector of uint) +0:? Constant: +0:? 3 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:? 4 (const uint) +0:80 imageStore ( temp void) +0:80 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:80 c1: direct index for structure ( uniform int) +0:80 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:80 Constant: +0:80 0 (const uint) +0:80 'storeTemp' ( temp 4-component vector of uint) +0:80 'storeTemp' ( temp 4-component vector of uint) +0:83 Sequence +0:83 move second child to first child ( temp 4-component vector of float) +0:83 'val1' ( temp 4-component vector of float) +0:83 Sequence +0:83 move second child to first child ( temp int) +0:83 'coordTemp' ( temp int) +0:83 c1: direct index for structure ( uniform int) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:83 Constant: +0:83 0 (const uint) +0:83 move second child to first child ( temp 4-component vector of float) +0:83 'storeTemp' ( temp 4-component vector of float) +0:83 imageLoad ( temp 4-component vector of float) +0:83 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:83 'coordTemp' ( temp int) +0:83 vector scale second child into first child ( temp 4-component vector of float) +0:83 'storeTemp' ( temp 4-component vector of float) +0:83 Constant: +0:83 2.000000 +0:83 imageStore ( temp void) +0:83 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:83 'coordTemp' ( temp int) +0:83 'storeTemp' ( temp 4-component vector of float) +0:83 'storeTemp' ( temp 4-component vector of float) +0:84 Sequence +0:84 move second child to first child ( temp int) +0:84 'coordTemp' ( temp int) +0:84 c1: direct index for structure ( uniform int) +0:84 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:84 Constant: +0:84 0 (const uint) +0:84 move second child to first child ( temp 4-component vector of float) +0:84 'storeTemp' ( temp 4-component vector of float) +0:84 imageLoad ( temp 4-component vector of float) +0:84 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:84 'coordTemp' ( temp int) +0:84 subtract second child into first child ( temp 4-component vector of float) +0:84 'storeTemp' ( temp 4-component vector of float) +0:84 Constant: +0:84 3.000000 +0:84 imageStore ( temp void) +0:84 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:84 'coordTemp' ( temp int) +0:84 'storeTemp' ( temp 4-component vector of float) +0:84 'storeTemp' ( temp 4-component vector of float) +0:85 Sequence +0:85 move second child to first child ( temp int) +0:85 'coordTemp' ( temp int) +0:85 c1: direct index for structure ( uniform int) +0:85 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:85 Constant: +0:85 0 (const uint) +0:85 move second child to first child ( temp 4-component vector of float) +0:85 'storeTemp' ( temp 4-component vector of float) +0:85 imageLoad ( temp 4-component vector of float) +0:85 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:85 'coordTemp' ( temp int) +0:85 add second child into first child ( temp 4-component vector of float) +0:85 'storeTemp' ( temp 4-component vector of float) +0:85 Constant: +0:85 4.000000 +0:85 imageStore ( temp void) +0:85 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:85 'coordTemp' ( temp int) +0:85 'storeTemp' ( temp 4-component vector of float) +0:85 'storeTemp' ( temp 4-component vector of float) +0:87 Sequence +0:87 move second child to first child ( temp int) +0:87 'coordTemp' ( temp int) +0:87 c1: direct index for structure ( uniform int) +0:87 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:87 Constant: +0:87 0 (const uint) +0:87 move second child to first child ( temp 4-component vector of int) +0:87 'storeTemp' ( temp 4-component vector of int) +0:87 imageLoad ( temp 4-component vector of int) +0:87 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:87 'coordTemp' ( temp int) +0:87 divide second child into first child ( temp 4-component vector of int) +0:87 'storeTemp' ( temp 4-component vector of int) +0:87 Constant: +0:87 2 (const int) +0:87 imageStore ( temp void) +0:87 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:87 'coordTemp' ( temp int) +0:87 'storeTemp' ( temp 4-component vector of int) +0:87 'storeTemp' ( temp 4-component vector of int) +0:88 Sequence +0:88 move second child to first child ( temp int) +0:88 'coordTemp' ( temp int) +0:88 c1: direct index for structure ( uniform int) +0:88 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:88 Constant: +0:88 0 (const uint) +0:88 move second child to first child ( temp 4-component vector of int) +0:88 'storeTemp' ( temp 4-component vector of int) +0:88 imageLoad ( temp 4-component vector of int) +0:88 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:88 'coordTemp' ( temp int) +0:88 mod second child into first child ( temp 4-component vector of int) +0:88 'storeTemp' ( temp 4-component vector of int) +0:88 Constant: +0:88 2 (const int) +0:88 imageStore ( temp void) +0:88 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:88 'coordTemp' ( temp int) +0:88 'storeTemp' ( temp 4-component vector of int) +0:88 'storeTemp' ( temp 4-component vector of int) +0:89 Sequence +0:89 move second child to first child ( temp int) +0:89 'coordTemp' ( temp int) +0:89 c1: direct index for structure ( uniform int) +0:89 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:89 Constant: +0:89 0 (const uint) +0:89 move second child to first child ( temp 4-component vector of int) +0:89 'storeTemp' ( temp 4-component vector of int) +0:89 imageLoad ( temp 4-component vector of int) +0:89 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:89 'coordTemp' ( temp int) +0:89 and second child into first child ( temp 4-component vector of int) +0:89 'storeTemp' ( temp 4-component vector of int) +0:89 Constant: +0:89 65535 (const int) +0:89 imageStore ( temp void) +0:89 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:89 'coordTemp' ( temp int) +0:89 'storeTemp' ( temp 4-component vector of int) +0:89 'storeTemp' ( temp 4-component vector of int) +0:90 Sequence +0:90 move second child to first child ( temp int) +0:90 'coordTemp' ( temp int) +0:90 c1: direct index for structure ( uniform int) +0:90 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:90 Constant: +0:90 0 (const uint) +0:90 move second child to first child ( temp 4-component vector of int) +0:90 'storeTemp' ( temp 4-component vector of int) +0:90 imageLoad ( temp 4-component vector of int) +0:90 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:90 'coordTemp' ( temp int) +0:90 or second child into first child ( temp 4-component vector of int) +0:90 'storeTemp' ( temp 4-component vector of int) +0:90 Constant: +0:90 61680 (const int) +0:90 imageStore ( temp void) +0:90 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:90 'coordTemp' ( temp int) +0:90 'storeTemp' ( temp 4-component vector of int) +0:90 'storeTemp' ( temp 4-component vector of int) +0:91 Sequence +0:91 move second child to first child ( temp int) +0:91 'coordTemp' ( temp int) +0:91 c1: direct index for structure ( uniform int) +0:91 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:91 Constant: +0:91 0 (const uint) +0:91 move second child to first child ( temp 4-component vector of int) +0:91 'storeTemp' ( temp 4-component vector of int) +0:91 imageLoad ( temp 4-component vector of int) +0:91 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:91 'coordTemp' ( temp int) +0:91 left shift second child into first child ( temp 4-component vector of int) +0:91 'storeTemp' ( temp 4-component vector of int) +0:91 Constant: +0:91 2 (const int) +0:91 imageStore ( temp void) +0:91 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:91 'coordTemp' ( temp int) +0:91 'storeTemp' ( temp 4-component vector of int) +0:91 'storeTemp' ( temp 4-component vector of int) +0:92 Sequence +0:92 move second child to first child ( temp int) +0:92 'coordTemp' ( temp int) +0:92 c1: direct index for structure ( uniform int) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:92 Constant: +0:92 0 (const uint) +0:92 move second child to first child ( temp 4-component vector of int) +0:92 'storeTemp' ( temp 4-component vector of int) +0:92 imageLoad ( temp 4-component vector of int) +0:92 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:92 'coordTemp' ( temp int) +0:92 right shift second child into first child ( temp 4-component vector of int) +0:92 'storeTemp' ( temp 4-component vector of int) +0:92 Constant: +0:92 2 (const int) +0:92 imageStore ( temp void) +0:92 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:92 'coordTemp' ( temp int) +0:92 'storeTemp' ( temp 4-component vector of int) +0:92 'storeTemp' ( temp 4-component vector of int) +0:95 Sequence +0:95 move second child to first child ( temp 4-component vector of float) +0:95 'storeTemp' ( temp 4-component vector of float) +0:95 Function Call: SomeValue( ( temp 4-component vector of float) +0:95 imageStore ( temp void) +0:95 'g_tTex2df4' (layout( rgba32f) uniform image2D) +0:95 c2: direct index for structure ( uniform 2-component vector of int) +0:95 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:95 Constant: +0:95 1 (const uint) +0:95 'storeTemp' ( temp 4-component vector of float) +0:95 'storeTemp' ( temp 4-component vector of float) +0:96 Sequence +0:96 imageStore ( temp void) +0:96 'g_tTex2df4' (layout( rgba32f) uniform image2D) +0:96 c2: direct index for structure ( uniform 2-component vector of int) +0:96 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:96 Constant: +0:96 1 (const uint) +0:96 'lf4' ( temp 4-component vector of float) +0:96 'lf4' ( temp 4-component vector of float) +0:97 Sequence +0:97 move second child to first child ( temp 4-component vector of int) +0:97 'storeTemp' ( temp 4-component vector of int) +0:? Constant: +0:? 5 (const int) +0:? 2 (const int) +0:? 3 (const int) +0:? 4 (const int) +0:97 imageStore ( temp void) +0:97 'g_tTex2di4' (layout( rgba32i) uniform iimage2D) +0:97 c2: direct index for structure ( uniform 2-component vector of int) +0:97 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:97 Constant: +0:97 1 (const uint) +0:97 'storeTemp' ( temp 4-component vector of int) +0:97 'storeTemp' ( temp 4-component vector of int) +0:98 Sequence +0:98 move second child to first child ( temp 4-component vector of uint) +0:98 'storeTemp' ( temp 4-component vector of uint) +0:? Constant: +0:? 6 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:? 4 (const uint) +0:98 imageStore ( temp void) +0:98 'g_tTex2du4' (layout( rgba32ui) uniform uimage2D) +0:98 c2: direct index for structure ( uniform 2-component vector of int) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:98 Constant: +0:98 1 (const uint) +0:98 'storeTemp' ( temp 4-component vector of uint) +0:98 'storeTemp' ( temp 4-component vector of uint) +0:101 Sequence +0:101 move second child to first child ( temp 4-component vector of float) +0:101 'storeTemp' ( temp 4-component vector of float) +0:101 Function Call: SomeValue( ( temp 4-component vector of float) +0:101 imageStore ( temp void) +0:101 'g_tTex3df4' (layout( rgba32f) uniform image3D) +0:101 c3: direct index for structure ( uniform 3-component vector of int) +0:101 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:101 Constant: +0:101 2 (const uint) +0:101 'storeTemp' ( temp 4-component vector of float) +0:101 'storeTemp' ( temp 4-component vector of float) +0:102 Sequence +0:102 imageStore ( temp void) +0:102 'g_tTex3df4' (layout( rgba32f) uniform image3D) +0:102 c3: direct index for structure ( uniform 3-component vector of int) +0:102 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:102 Constant: +0:102 2 (const uint) +0:102 'lf4' ( temp 4-component vector of float) +0:102 'lf4' ( temp 4-component vector of float) +0:103 Sequence +0:103 move second child to first child ( temp 4-component vector of int) +0:103 'storeTemp' ( temp 4-component vector of int) +0:? Constant: +0:? 8 (const int) +0:? 6 (const int) +0:? 7 (const int) +0:? 8 (const int) +0:103 imageStore ( temp void) +0:103 'g_tTex3di4' (layout( rgba32i) uniform iimage3D) +0:103 c3: direct index for structure ( uniform 3-component vector of int) +0:103 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:103 Constant: +0:103 2 (const uint) +0:103 'storeTemp' ( temp 4-component vector of int) +0:103 'storeTemp' ( temp 4-component vector of int) +0:104 Sequence +0:104 move second child to first child ( temp 4-component vector of uint) +0:104 'storeTemp' ( temp 4-component vector of uint) +0:? Constant: +0:? 9 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:? 4 (const uint) +0:104 imageStore ( temp void) +0:104 'g_tTex3du4' (layout( rgba32ui) uniform uimage3D) +0:104 c3: direct index for structure ( uniform 3-component vector of int) +0:104 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:104 Constant: +0:104 2 (const uint) +0:104 'storeTemp' ( temp 4-component vector of uint) +0:104 'storeTemp' ( temp 4-component vector of uint) +0:107 Function Call: Fn1(vf4; ( temp 4-component vector of float) +0:107 imageLoad ( temp 4-component vector of float) +0:107 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:107 c1: direct index for structure ( uniform int) +0:107 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:107 Constant: +0:107 0 (const uint) +0:108 Function Call: Fn1(vi4; ( temp 4-component vector of int) +0:108 imageLoad ( temp 4-component vector of int) +0:108 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:108 c1: direct index for structure ( uniform int) +0:108 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:108 Constant: +0:108 0 (const uint) +0:109 Function Call: Fn1(vu4; ( temp 4-component vector of uint) +0:109 imageLoad ( temp 4-component vector of uint) +0:109 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:109 c1: direct index for structure ( uniform int) +0:109 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:109 Constant: +0:109 0 (const uint) +0:111 Comma ( temp void) +0:111 Function Call: Fn2(vf4; ( temp void) +0:111 'tempArg' ( temp 4-component vector of float) +0:111 Sequence +0:111 imageStore ( temp void) +0:111 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:111 c1: direct index for structure ( uniform int) +0:111 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:111 Constant: +0:111 0 (const uint) +0:111 'tempArg' ( temp 4-component vector of float) +0:111 'tempArg' ( temp 4-component vector of float) +0:112 Comma ( temp void) +0:112 Function Call: Fn2(vi4; ( temp void) +0:112 'tempArg' ( temp 4-component vector of int) +0:112 Sequence +0:112 imageStore ( temp void) +0:112 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:112 c1: direct index for structure ( uniform int) +0:112 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:112 Constant: +0:112 0 (const uint) +0:112 'tempArg' ( temp 4-component vector of int) +0:112 'tempArg' ( temp 4-component vector of int) +0:113 Comma ( temp void) +0:113 Function Call: Fn2(vu4; ( temp void) +0:113 'tempArg' ( temp 4-component vector of uint) +0:113 Sequence +0:113 imageStore ( temp void) +0:113 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:113 c1: direct index for structure ( uniform int) +0:113 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:113 Constant: +0:113 0 (const uint) +0:113 'tempArg' ( temp 4-component vector of uint) +0:113 'tempArg' ( temp 4-component vector of uint) +0:117 Sequence +0:117 move second child to first child ( temp int) +0:117 'coordTemp' ( temp int) +0:117 c1: direct index for structure ( uniform int) +0:117 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:117 Constant: +0:117 0 (const uint) +0:117 move second child to first child ( temp 4-component vector of float) +0:117 'storeTemp' ( temp 4-component vector of float) +0:117 imageLoad ( temp 4-component vector of float) +0:117 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:117 'coordTemp' ( temp int) +0:117 Pre-Increment ( temp 4-component vector of float) +0:117 'storeTemp' ( temp 4-component vector of float) +0:117 imageStore ( temp void) +0:117 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:117 'coordTemp' ( temp int) +0:117 'storeTemp' ( temp 4-component vector of float) +0:117 'storeTemp' ( temp 4-component vector of float) +0:118 Sequence +0:118 move second child to first child ( temp int) +0:118 'coordTemp' ( temp int) +0:118 c1: direct index for structure ( uniform int) +0:118 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:118 Constant: +0:118 0 (const uint) +0:118 move second child to first child ( temp 4-component vector of int) +0:118 'storeTemp' ( temp 4-component vector of int) +0:118 imageLoad ( temp 4-component vector of int) +0:118 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:118 'coordTemp' ( temp int) +0:118 Pre-Increment ( temp 4-component vector of int) +0:118 'storeTemp' ( temp 4-component vector of int) +0:118 imageStore ( temp void) +0:118 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:118 'coordTemp' ( temp int) +0:118 'storeTemp' ( temp 4-component vector of int) +0:118 'storeTemp' ( temp 4-component vector of int) +0:119 Sequence +0:119 move second child to first child ( temp int) +0:119 'coordTemp' ( temp int) +0:119 c1: direct index for structure ( uniform int) +0:119 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:119 Constant: +0:119 0 (const uint) +0:119 move second child to first child ( temp 4-component vector of uint) +0:119 'storeTemp' ( temp 4-component vector of uint) +0:119 imageLoad ( temp 4-component vector of uint) +0:119 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:119 'coordTemp' ( temp int) +0:119 Pre-Increment ( temp 4-component vector of uint) +0:119 'storeTemp' ( temp 4-component vector of uint) +0:119 imageStore ( temp void) +0:119 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:119 'coordTemp' ( temp int) +0:119 'storeTemp' ( temp 4-component vector of uint) +0:119 'storeTemp' ( temp 4-component vector of uint) +0:121 Sequence +0:121 move second child to first child ( temp int) +0:121 'coordTemp' ( temp int) +0:121 c1: direct index for structure ( uniform int) +0:121 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:121 Constant: +0:121 0 (const uint) +0:121 move second child to first child ( temp 4-component vector of float) +0:121 'storeTemp' ( temp 4-component vector of float) +0:121 imageLoad ( temp 4-component vector of float) +0:121 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:121 'coordTemp' ( temp int) +0:121 Pre-Decrement ( temp 4-component vector of float) +0:121 'storeTemp' ( temp 4-component vector of float) +0:121 imageStore ( temp void) +0:121 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:121 'coordTemp' ( temp int) +0:121 'storeTemp' ( temp 4-component vector of float) +0:121 'storeTemp' ( temp 4-component vector of float) +0:122 Sequence +0:122 move second child to first child ( temp int) +0:122 'coordTemp' ( temp int) +0:122 c1: direct index for structure ( uniform int) +0:122 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:122 Constant: +0:122 0 (const uint) +0:122 move second child to first child ( temp 4-component vector of int) +0:122 'storeTemp' ( temp 4-component vector of int) +0:122 imageLoad ( temp 4-component vector of int) +0:122 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:122 'coordTemp' ( temp int) +0:122 Pre-Decrement ( temp 4-component vector of int) +0:122 'storeTemp' ( temp 4-component vector of int) +0:122 imageStore ( temp void) +0:122 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:122 'coordTemp' ( temp int) +0:122 'storeTemp' ( temp 4-component vector of int) +0:122 'storeTemp' ( temp 4-component vector of int) +0:123 Sequence +0:123 move second child to first child ( temp int) +0:123 'coordTemp' ( temp int) +0:123 c1: direct index for structure ( uniform int) +0:123 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:123 Constant: +0:123 0 (const uint) +0:123 move second child to first child ( temp 4-component vector of uint) +0:123 'storeTemp' ( temp 4-component vector of uint) +0:123 imageLoad ( temp 4-component vector of uint) +0:123 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:123 'coordTemp' ( temp int) +0:123 Pre-Decrement ( temp 4-component vector of uint) +0:123 'storeTemp' ( temp 4-component vector of uint) +0:123 imageStore ( temp void) +0:123 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:123 'coordTemp' ( temp int) +0:123 'storeTemp' ( temp 4-component vector of uint) +0:123 'storeTemp' ( temp 4-component vector of uint) +0:126 Sequence +0:126 move second child to first child ( temp int) +0:126 'coordTemp' ( temp int) +0:126 c1: direct index for structure ( uniform int) +0:126 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:126 Constant: +0:126 0 (const uint) +0:126 move second child to first child ( temp 4-component vector of float) +0:126 'storeTempPre' ( temp 4-component vector of float) +0:126 imageLoad ( temp 4-component vector of float) +0:126 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:126 'coordTemp' ( temp int) +0:126 move second child to first child ( temp 4-component vector of float) +0:126 'storeTempPost' ( temp 4-component vector of float) +0:126 'storeTempPre' ( temp 4-component vector of float) +0:126 Post-Increment ( temp 4-component vector of float) +0:126 'storeTempPost' ( temp 4-component vector of float) +0:126 imageStore ( temp void) +0:126 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:126 'coordTemp' ( temp int) +0:126 'storeTempPost' ( temp 4-component vector of float) +0:126 'storeTempPre' ( temp 4-component vector of float) +0:127 Sequence +0:127 move second child to first child ( temp int) +0:127 'coordTemp' ( temp int) +0:127 c1: direct index for structure ( uniform int) +0:127 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:127 Constant: +0:127 0 (const uint) +0:127 move second child to first child ( temp 4-component vector of uint) +0:127 'storeTempPre' ( temp 4-component vector of uint) +0:127 imageLoad ( temp 4-component vector of uint) +0:127 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:127 'coordTemp' ( temp int) +0:127 move second child to first child ( temp 4-component vector of uint) +0:127 'storeTempPost' ( temp 4-component vector of uint) +0:127 'storeTempPre' ( temp 4-component vector of uint) +0:127 Post-Decrement ( temp 4-component vector of uint) +0:127 'storeTempPost' ( temp 4-component vector of uint) +0:127 imageStore ( temp void) +0:127 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:127 'coordTemp' ( temp int) +0:127 'storeTempPost' ( temp 4-component vector of uint) +0:127 'storeTempPre' ( temp 4-component vector of uint) +0:128 Sequence +0:128 move second child to first child ( temp int) +0:128 'coordTemp' ( temp int) +0:128 c1: direct index for structure ( uniform int) +0:128 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:128 Constant: +0:128 0 (const uint) +0:128 move second child to first child ( temp 4-component vector of int) +0:128 'storeTempPre' ( temp 4-component vector of int) +0:128 imageLoad ( temp 4-component vector of int) +0:128 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:128 'coordTemp' ( temp int) +0:128 move second child to first child ( temp 4-component vector of int) +0:128 'storeTempPost' ( temp 4-component vector of int) +0:128 'storeTempPre' ( temp 4-component vector of int) +0:128 Post-Increment ( temp 4-component vector of int) +0:128 'storeTempPost' ( temp 4-component vector of int) +0:128 imageStore ( temp void) +0:128 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:128 'coordTemp' ( temp int) +0:128 'storeTempPost' ( temp 4-component vector of int) +0:128 'storeTempPre' ( temp 4-component vector of int) +0:130 Sequence +0:130 move second child to first child ( temp int) +0:130 'coordTemp' ( temp int) +0:130 c1: direct index for structure ( uniform int) +0:130 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:130 Constant: +0:130 0 (const uint) +0:130 move second child to first child ( temp 4-component vector of float) +0:130 'storeTempPre' ( temp 4-component vector of float) +0:130 imageLoad ( temp 4-component vector of float) +0:130 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:130 'coordTemp' ( temp int) +0:130 move second child to first child ( temp 4-component vector of float) +0:130 'storeTempPost' ( temp 4-component vector of float) +0:130 'storeTempPre' ( temp 4-component vector of float) +0:130 Post-Decrement ( temp 4-component vector of float) +0:130 'storeTempPost' ( temp 4-component vector of float) +0:130 imageStore ( temp void) +0:130 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:130 'coordTemp' ( temp int) +0:130 'storeTempPost' ( temp 4-component vector of float) +0:130 'storeTempPre' ( temp 4-component vector of float) +0:131 Sequence +0:131 move second child to first child ( temp int) +0:131 'coordTemp' ( temp int) +0:131 c1: direct index for structure ( uniform int) +0:131 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:131 Constant: +0:131 0 (const uint) +0:131 move second child to first child ( temp 4-component vector of int) +0:131 'storeTempPre' ( temp 4-component vector of int) +0:131 imageLoad ( temp 4-component vector of int) +0:131 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:131 'coordTemp' ( temp int) +0:131 move second child to first child ( temp 4-component vector of int) +0:131 'storeTempPost' ( temp 4-component vector of int) +0:131 'storeTempPre' ( temp 4-component vector of int) +0:131 Post-Increment ( temp 4-component vector of int) +0:131 'storeTempPost' ( temp 4-component vector of int) +0:131 imageStore ( temp void) +0:131 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:131 'coordTemp' ( temp int) +0:131 'storeTempPost' ( temp 4-component vector of int) +0:131 'storeTempPre' ( temp 4-component vector of int) +0:132 Sequence +0:132 move second child to first child ( temp int) +0:132 'coordTemp' ( temp int) +0:132 c1: direct index for structure ( uniform int) +0:132 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:132 Constant: +0:132 0 (const uint) +0:132 move second child to first child ( temp 4-component vector of uint) +0:132 'storeTempPre' ( temp 4-component vector of uint) +0:132 imageLoad ( temp 4-component vector of uint) +0:132 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:132 'coordTemp' ( temp int) +0:132 move second child to first child ( temp 4-component vector of uint) +0:132 'storeTempPost' ( temp 4-component vector of uint) +0:132 'storeTempPre' ( temp 4-component vector of uint) +0:132 Post-Decrement ( temp 4-component vector of uint) +0:132 'storeTempPost' ( temp 4-component vector of uint) +0:132 imageStore ( temp void) +0:132 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:132 'coordTemp' ( temp int) +0:132 'storeTempPost' ( temp 4-component vector of uint) +0:132 'storeTempPre' ( temp 4-component vector of uint) +0:135 Sequence +0:135 move second child to first child ( temp 4-component vector of float) +0:135 'storeTemp' ( temp 4-component vector of float) +0:? imageLoad ( temp 4-component vector of float) +0:135 'g_tTex2df4' (layout( rgba32f) uniform image2D) +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:135 imageStore ( temp void) +0:135 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:135 Constant: +0:135 1 (const int) +0:135 'storeTemp' ( temp 4-component vector of float) +0:135 'storeTemp' ( temp 4-component vector of float) +0:137 move second child to first child ( temp 4-component vector of float) +0:137 Color: direct index for structure ( temp 4-component vector of float) +0:137 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 1.000000 +0:137 1.000000 +0:137 1.000000 +0:137 1.000000 +0:139 Branch: Return with expression +0:139 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:53 Function Definition: main( ( temp void) +0:53 Function Parameters: +0:? Sequence +0:53 Sequence +0:53 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:53 Color: direct index for structure ( temp 4-component vector of float) +0:53 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:53 Constant: +0:53 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:? 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:? 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:? 'g_tTex2df4' (layout( rgba32f) uniform image2D) +0:? 'g_tTex2di4' (layout( rgba32i) uniform iimage2D) +0:? 'g_tTex2du4' (layout( rgba32ui) uniform uimage2D) +0:? 'g_tTex3df4' (layout( rgba32f) uniform image3D) +0:? 'g_tTex3di4' (layout( rgba32i) uniform iimage3D) +0:? 'g_tTex3du4' (layout( rgba32ui) uniform uimage3D) +0:? 'g_tTex1df4a' (layout( rgba32f) uniform image1DArray) +0:? 'g_tTex1di4a' (layout( rgba32i) uniform iimage1DArray) +0:? 'g_tTex1du4a' (layout( rgba32ui) uniform uimage1DArray) +0:? 'g_tTex2df4a' (layout( rgba32f) uniform image2DArray) +0:? 'g_tTex2di4a' (layout( rgba32i) uniform iimage2DArray) +0:? 'g_tTex2du4a' (layout( rgba32ui) uniform uimage2DArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:42 Function Definition: Fn1(vi4; ( temp 4-component vector of int) +0:42 Function Parameters: +0:42 'x' ( in 4-component vector of int) +0:? Sequence +0:42 Branch: Return with expression +0:42 'x' ( in 4-component vector of int) +0:43 Function Definition: Fn1(vu4; ( temp 4-component vector of uint) +0:43 Function Parameters: +0:43 'x' ( in 4-component vector of uint) +0:? Sequence +0:43 Branch: Return with expression +0:43 'x' ( in 4-component vector of uint) +0:44 Function Definition: Fn1(vf4; ( temp 4-component vector of float) +0:44 Function Parameters: +0:44 'x' ( in 4-component vector of float) +0:? Sequence +0:44 Branch: Return with expression +0:44 'x' ( in 4-component vector of float) +0:46 Function Definition: Fn2(vi4; ( temp void) +0:46 Function Parameters: +0:46 'x' ( out 4-component vector of int) +0:? Sequence +0:46 move second child to first child ( temp 4-component vector of int) +0:46 'x' ( out 4-component vector of int) +0:46 Constant: +0:46 0 (const int) +0:46 0 (const int) +0:46 0 (const int) +0:46 0 (const int) +0:47 Function Definition: Fn2(vu4; ( temp void) +0:47 Function Parameters: +0:47 'x' ( out 4-component vector of uint) +0:? Sequence +0:47 move second child to first child ( temp 4-component vector of uint) +0:47 'x' ( out 4-component vector of uint) +0:47 Constant: +0:47 0 (const uint) +0:47 0 (const uint) +0:47 0 (const uint) +0:47 0 (const uint) +0:48 Function Definition: Fn2(vf4; ( temp void) +0:48 Function Parameters: +0:48 'x' ( out 4-component vector of float) +0:? Sequence +0:48 move second child to first child ( temp 4-component vector of float) +0:48 'x' ( out 4-component vector of float) +0:48 Constant: +0:48 0.000000 +0:48 0.000000 +0:48 0.000000 +0:48 0.000000 +0:50 Function Definition: SomeValue( ( temp 4-component vector of float) +0:50 Function Parameters: +0:? Sequence +0:50 Branch: Return with expression +0:50 Convert int to float ( temp 4-component vector of float) +0:50 c4: direct index for structure ( uniform 4-component vector of int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:50 Constant: +0:50 3 (const uint) +0:53 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:53 Function Parameters: +0:? Sequence +0:57 imageLoad ( temp 4-component vector of float) +0:57 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:57 c1: direct index for structure ( uniform int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:57 Constant: +0:57 0 (const uint) +0:59 Sequence +0:59 move second child to first child ( temp 4-component vector of float) +0:59 'r00' ( temp 4-component vector of float) +0:59 imageLoad ( temp 4-component vector of float) +0:59 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:59 c1: direct index for structure ( uniform int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:59 Constant: +0:59 0 (const uint) +0:60 Sequence +0:60 move second child to first child ( temp 4-component vector of int) +0:60 'r01' ( temp 4-component vector of int) +0:60 imageLoad ( temp 4-component vector of int) +0:60 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:60 c1: direct index for structure ( uniform int) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:60 Constant: +0:60 0 (const uint) +0:61 Sequence +0:61 move second child to first child ( temp 4-component vector of uint) +0:61 'r02' ( temp 4-component vector of uint) +0:61 imageLoad ( temp 4-component vector of uint) +0:61 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:61 c1: direct index for structure ( uniform int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:61 Constant: +0:61 0 (const uint) +0:64 Sequence +0:64 move second child to first child ( temp 4-component vector of float) +0:64 'r10' ( temp 4-component vector of float) +0:64 imageLoad ( temp 4-component vector of float) +0:64 'g_tTex2df4' (layout( rgba32f) uniform image2D) +0:64 c2: direct index for structure ( uniform 2-component vector of int) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:64 Constant: +0:64 1 (const uint) +0:65 Sequence +0:65 move second child to first child ( temp 4-component vector of int) +0:65 'r11' ( temp 4-component vector of int) +0:65 imageLoad ( temp 4-component vector of int) +0:65 'g_tTex2di4' (layout( rgba32i) uniform iimage2D) +0:65 c2: direct index for structure ( uniform 2-component vector of int) +0:65 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:65 Constant: +0:65 1 (const uint) +0:66 Sequence +0:66 move second child to first child ( temp 4-component vector of uint) +0:66 'r12' ( temp 4-component vector of uint) +0:66 imageLoad ( temp 4-component vector of uint) +0:66 'g_tTex2du4' (layout( rgba32ui) uniform uimage2D) +0:66 c2: direct index for structure ( uniform 2-component vector of int) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:66 Constant: +0:66 1 (const uint) +0:69 Sequence +0:69 move second child to first child ( temp 4-component vector of float) +0:69 'r20' ( temp 4-component vector of float) +0:69 imageLoad ( temp 4-component vector of float) +0:69 'g_tTex3df4' (layout( rgba32f) uniform image3D) +0:69 c3: direct index for structure ( uniform 3-component vector of int) +0:69 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:69 Constant: +0:69 2 (const uint) +0:70 Sequence +0:70 move second child to first child ( temp 4-component vector of int) +0:70 'r21' ( temp 4-component vector of int) +0:70 imageLoad ( temp 4-component vector of int) +0:70 'g_tTex3di4' (layout( rgba32i) uniform iimage3D) +0:70 c3: direct index for structure ( uniform 3-component vector of int) +0:70 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:70 Constant: +0:70 2 (const uint) +0:71 Sequence +0:71 move second child to first child ( temp 4-component vector of uint) +0:71 'r22' ( temp 4-component vector of uint) +0:71 imageLoad ( temp 4-component vector of uint) +0:71 'g_tTex3du4' (layout( rgba32ui) uniform uimage3D) +0:71 c3: direct index for structure ( uniform 3-component vector of int) +0:71 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:71 Constant: +0:71 2 (const uint) +0:73 Sequence +0:73 move second child to first child ( temp 4-component vector of float) +0:73 'lf4' ( temp 4-component vector of float) +0:73 uf4: direct index for structure ( uniform 4-component vector of float) +0:73 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:73 Constant: +0:73 8 (const uint) +0:77 Sequence +0:77 move second child to first child ( temp 4-component vector of float) +0:77 'storeTemp' ( temp 4-component vector of float) +0:77 Function Call: SomeValue( ( temp 4-component vector of float) +0:77 imageStore ( temp void) +0:77 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:77 c1: direct index for structure ( uniform int) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:77 Constant: +0:77 0 (const uint) +0:77 'storeTemp' ( temp 4-component vector of float) +0:77 'storeTemp' ( temp 4-component vector of float) +0:78 Sequence +0:78 imageStore ( temp void) +0:78 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:78 c1: direct index for structure ( uniform int) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:78 Constant: +0:78 0 (const uint) +0:78 'lf4' ( temp 4-component vector of float) +0:78 'lf4' ( temp 4-component vector of float) +0:79 Sequence +0:79 move second child to first child ( temp 4-component vector of int) +0:79 'storeTemp' ( temp 4-component vector of int) +0:? Constant: +0:? 2 (const int) +0:? 2 (const int) +0:? 3 (const int) +0:? 4 (const int) +0:79 imageStore ( temp void) +0:79 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:79 c1: direct index for structure ( uniform int) +0:79 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:79 Constant: +0:79 0 (const uint) +0:79 'storeTemp' ( temp 4-component vector of int) +0:79 'storeTemp' ( temp 4-component vector of int) +0:80 Sequence +0:80 move second child to first child ( temp 4-component vector of uint) +0:80 'storeTemp' ( temp 4-component vector of uint) +0:? Constant: +0:? 3 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:? 4 (const uint) +0:80 imageStore ( temp void) +0:80 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:80 c1: direct index for structure ( uniform int) +0:80 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:80 Constant: +0:80 0 (const uint) +0:80 'storeTemp' ( temp 4-component vector of uint) +0:80 'storeTemp' ( temp 4-component vector of uint) +0:83 Sequence +0:83 move second child to first child ( temp 4-component vector of float) +0:83 'val1' ( temp 4-component vector of float) +0:83 Sequence +0:83 move second child to first child ( temp int) +0:83 'coordTemp' ( temp int) +0:83 c1: direct index for structure ( uniform int) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:83 Constant: +0:83 0 (const uint) +0:83 move second child to first child ( temp 4-component vector of float) +0:83 'storeTemp' ( temp 4-component vector of float) +0:83 imageLoad ( temp 4-component vector of float) +0:83 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:83 'coordTemp' ( temp int) +0:83 vector scale second child into first child ( temp 4-component vector of float) +0:83 'storeTemp' ( temp 4-component vector of float) +0:83 Constant: +0:83 2.000000 +0:83 imageStore ( temp void) +0:83 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:83 'coordTemp' ( temp int) +0:83 'storeTemp' ( temp 4-component vector of float) +0:83 'storeTemp' ( temp 4-component vector of float) +0:84 Sequence +0:84 move second child to first child ( temp int) +0:84 'coordTemp' ( temp int) +0:84 c1: direct index for structure ( uniform int) +0:84 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:84 Constant: +0:84 0 (const uint) +0:84 move second child to first child ( temp 4-component vector of float) +0:84 'storeTemp' ( temp 4-component vector of float) +0:84 imageLoad ( temp 4-component vector of float) +0:84 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:84 'coordTemp' ( temp int) +0:84 subtract second child into first child ( temp 4-component vector of float) +0:84 'storeTemp' ( temp 4-component vector of float) +0:84 Constant: +0:84 3.000000 +0:84 imageStore ( temp void) +0:84 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:84 'coordTemp' ( temp int) +0:84 'storeTemp' ( temp 4-component vector of float) +0:84 'storeTemp' ( temp 4-component vector of float) +0:85 Sequence +0:85 move second child to first child ( temp int) +0:85 'coordTemp' ( temp int) +0:85 c1: direct index for structure ( uniform int) +0:85 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:85 Constant: +0:85 0 (const uint) +0:85 move second child to first child ( temp 4-component vector of float) +0:85 'storeTemp' ( temp 4-component vector of float) +0:85 imageLoad ( temp 4-component vector of float) +0:85 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:85 'coordTemp' ( temp int) +0:85 add second child into first child ( temp 4-component vector of float) +0:85 'storeTemp' ( temp 4-component vector of float) +0:85 Constant: +0:85 4.000000 +0:85 imageStore ( temp void) +0:85 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:85 'coordTemp' ( temp int) +0:85 'storeTemp' ( temp 4-component vector of float) +0:85 'storeTemp' ( temp 4-component vector of float) +0:87 Sequence +0:87 move second child to first child ( temp int) +0:87 'coordTemp' ( temp int) +0:87 c1: direct index for structure ( uniform int) +0:87 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:87 Constant: +0:87 0 (const uint) +0:87 move second child to first child ( temp 4-component vector of int) +0:87 'storeTemp' ( temp 4-component vector of int) +0:87 imageLoad ( temp 4-component vector of int) +0:87 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:87 'coordTemp' ( temp int) +0:87 divide second child into first child ( temp 4-component vector of int) +0:87 'storeTemp' ( temp 4-component vector of int) +0:87 Constant: +0:87 2 (const int) +0:87 imageStore ( temp void) +0:87 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:87 'coordTemp' ( temp int) +0:87 'storeTemp' ( temp 4-component vector of int) +0:87 'storeTemp' ( temp 4-component vector of int) +0:88 Sequence +0:88 move second child to first child ( temp int) +0:88 'coordTemp' ( temp int) +0:88 c1: direct index for structure ( uniform int) +0:88 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:88 Constant: +0:88 0 (const uint) +0:88 move second child to first child ( temp 4-component vector of int) +0:88 'storeTemp' ( temp 4-component vector of int) +0:88 imageLoad ( temp 4-component vector of int) +0:88 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:88 'coordTemp' ( temp int) +0:88 mod second child into first child ( temp 4-component vector of int) +0:88 'storeTemp' ( temp 4-component vector of int) +0:88 Constant: +0:88 2 (const int) +0:88 imageStore ( temp void) +0:88 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:88 'coordTemp' ( temp int) +0:88 'storeTemp' ( temp 4-component vector of int) +0:88 'storeTemp' ( temp 4-component vector of int) +0:89 Sequence +0:89 move second child to first child ( temp int) +0:89 'coordTemp' ( temp int) +0:89 c1: direct index for structure ( uniform int) +0:89 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:89 Constant: +0:89 0 (const uint) +0:89 move second child to first child ( temp 4-component vector of int) +0:89 'storeTemp' ( temp 4-component vector of int) +0:89 imageLoad ( temp 4-component vector of int) +0:89 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:89 'coordTemp' ( temp int) +0:89 and second child into first child ( temp 4-component vector of int) +0:89 'storeTemp' ( temp 4-component vector of int) +0:89 Constant: +0:89 65535 (const int) +0:89 imageStore ( temp void) +0:89 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:89 'coordTemp' ( temp int) +0:89 'storeTemp' ( temp 4-component vector of int) +0:89 'storeTemp' ( temp 4-component vector of int) +0:90 Sequence +0:90 move second child to first child ( temp int) +0:90 'coordTemp' ( temp int) +0:90 c1: direct index for structure ( uniform int) +0:90 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:90 Constant: +0:90 0 (const uint) +0:90 move second child to first child ( temp 4-component vector of int) +0:90 'storeTemp' ( temp 4-component vector of int) +0:90 imageLoad ( temp 4-component vector of int) +0:90 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:90 'coordTemp' ( temp int) +0:90 or second child into first child ( temp 4-component vector of int) +0:90 'storeTemp' ( temp 4-component vector of int) +0:90 Constant: +0:90 61680 (const int) +0:90 imageStore ( temp void) +0:90 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:90 'coordTemp' ( temp int) +0:90 'storeTemp' ( temp 4-component vector of int) +0:90 'storeTemp' ( temp 4-component vector of int) +0:91 Sequence +0:91 move second child to first child ( temp int) +0:91 'coordTemp' ( temp int) +0:91 c1: direct index for structure ( uniform int) +0:91 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:91 Constant: +0:91 0 (const uint) +0:91 move second child to first child ( temp 4-component vector of int) +0:91 'storeTemp' ( temp 4-component vector of int) +0:91 imageLoad ( temp 4-component vector of int) +0:91 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:91 'coordTemp' ( temp int) +0:91 left shift second child into first child ( temp 4-component vector of int) +0:91 'storeTemp' ( temp 4-component vector of int) +0:91 Constant: +0:91 2 (const int) +0:91 imageStore ( temp void) +0:91 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:91 'coordTemp' ( temp int) +0:91 'storeTemp' ( temp 4-component vector of int) +0:91 'storeTemp' ( temp 4-component vector of int) +0:92 Sequence +0:92 move second child to first child ( temp int) +0:92 'coordTemp' ( temp int) +0:92 c1: direct index for structure ( uniform int) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:92 Constant: +0:92 0 (const uint) +0:92 move second child to first child ( temp 4-component vector of int) +0:92 'storeTemp' ( temp 4-component vector of int) +0:92 imageLoad ( temp 4-component vector of int) +0:92 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:92 'coordTemp' ( temp int) +0:92 right shift second child into first child ( temp 4-component vector of int) +0:92 'storeTemp' ( temp 4-component vector of int) +0:92 Constant: +0:92 2 (const int) +0:92 imageStore ( temp void) +0:92 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:92 'coordTemp' ( temp int) +0:92 'storeTemp' ( temp 4-component vector of int) +0:92 'storeTemp' ( temp 4-component vector of int) +0:95 Sequence +0:95 move second child to first child ( temp 4-component vector of float) +0:95 'storeTemp' ( temp 4-component vector of float) +0:95 Function Call: SomeValue( ( temp 4-component vector of float) +0:95 imageStore ( temp void) +0:95 'g_tTex2df4' (layout( rgba32f) uniform image2D) +0:95 c2: direct index for structure ( uniform 2-component vector of int) +0:95 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:95 Constant: +0:95 1 (const uint) +0:95 'storeTemp' ( temp 4-component vector of float) +0:95 'storeTemp' ( temp 4-component vector of float) +0:96 Sequence +0:96 imageStore ( temp void) +0:96 'g_tTex2df4' (layout( rgba32f) uniform image2D) +0:96 c2: direct index for structure ( uniform 2-component vector of int) +0:96 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:96 Constant: +0:96 1 (const uint) +0:96 'lf4' ( temp 4-component vector of float) +0:96 'lf4' ( temp 4-component vector of float) +0:97 Sequence +0:97 move second child to first child ( temp 4-component vector of int) +0:97 'storeTemp' ( temp 4-component vector of int) +0:? Constant: +0:? 5 (const int) +0:? 2 (const int) +0:? 3 (const int) +0:? 4 (const int) +0:97 imageStore ( temp void) +0:97 'g_tTex2di4' (layout( rgba32i) uniform iimage2D) +0:97 c2: direct index for structure ( uniform 2-component vector of int) +0:97 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:97 Constant: +0:97 1 (const uint) +0:97 'storeTemp' ( temp 4-component vector of int) +0:97 'storeTemp' ( temp 4-component vector of int) +0:98 Sequence +0:98 move second child to first child ( temp 4-component vector of uint) +0:98 'storeTemp' ( temp 4-component vector of uint) +0:? Constant: +0:? 6 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:? 4 (const uint) +0:98 imageStore ( temp void) +0:98 'g_tTex2du4' (layout( rgba32ui) uniform uimage2D) +0:98 c2: direct index for structure ( uniform 2-component vector of int) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:98 Constant: +0:98 1 (const uint) +0:98 'storeTemp' ( temp 4-component vector of uint) +0:98 'storeTemp' ( temp 4-component vector of uint) +0:101 Sequence +0:101 move second child to first child ( temp 4-component vector of float) +0:101 'storeTemp' ( temp 4-component vector of float) +0:101 Function Call: SomeValue( ( temp 4-component vector of float) +0:101 imageStore ( temp void) +0:101 'g_tTex3df4' (layout( rgba32f) uniform image3D) +0:101 c3: direct index for structure ( uniform 3-component vector of int) +0:101 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:101 Constant: +0:101 2 (const uint) +0:101 'storeTemp' ( temp 4-component vector of float) +0:101 'storeTemp' ( temp 4-component vector of float) +0:102 Sequence +0:102 imageStore ( temp void) +0:102 'g_tTex3df4' (layout( rgba32f) uniform image3D) +0:102 c3: direct index for structure ( uniform 3-component vector of int) +0:102 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:102 Constant: +0:102 2 (const uint) +0:102 'lf4' ( temp 4-component vector of float) +0:102 'lf4' ( temp 4-component vector of float) +0:103 Sequence +0:103 move second child to first child ( temp 4-component vector of int) +0:103 'storeTemp' ( temp 4-component vector of int) +0:? Constant: +0:? 8 (const int) +0:? 6 (const int) +0:? 7 (const int) +0:? 8 (const int) +0:103 imageStore ( temp void) +0:103 'g_tTex3di4' (layout( rgba32i) uniform iimage3D) +0:103 c3: direct index for structure ( uniform 3-component vector of int) +0:103 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:103 Constant: +0:103 2 (const uint) +0:103 'storeTemp' ( temp 4-component vector of int) +0:103 'storeTemp' ( temp 4-component vector of int) +0:104 Sequence +0:104 move second child to first child ( temp 4-component vector of uint) +0:104 'storeTemp' ( temp 4-component vector of uint) +0:? Constant: +0:? 9 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:? 4 (const uint) +0:104 imageStore ( temp void) +0:104 'g_tTex3du4' (layout( rgba32ui) uniform uimage3D) +0:104 c3: direct index for structure ( uniform 3-component vector of int) +0:104 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:104 Constant: +0:104 2 (const uint) +0:104 'storeTemp' ( temp 4-component vector of uint) +0:104 'storeTemp' ( temp 4-component vector of uint) +0:107 Function Call: Fn1(vf4; ( temp 4-component vector of float) +0:107 imageLoad ( temp 4-component vector of float) +0:107 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:107 c1: direct index for structure ( uniform int) +0:107 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:107 Constant: +0:107 0 (const uint) +0:108 Function Call: Fn1(vi4; ( temp 4-component vector of int) +0:108 imageLoad ( temp 4-component vector of int) +0:108 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:108 c1: direct index for structure ( uniform int) +0:108 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:108 Constant: +0:108 0 (const uint) +0:109 Function Call: Fn1(vu4; ( temp 4-component vector of uint) +0:109 imageLoad ( temp 4-component vector of uint) +0:109 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:109 c1: direct index for structure ( uniform int) +0:109 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:109 Constant: +0:109 0 (const uint) +0:111 Comma ( temp void) +0:111 Function Call: Fn2(vf4; ( temp void) +0:111 'tempArg' ( temp 4-component vector of float) +0:111 Sequence +0:111 imageStore ( temp void) +0:111 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:111 c1: direct index for structure ( uniform int) +0:111 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:111 Constant: +0:111 0 (const uint) +0:111 'tempArg' ( temp 4-component vector of float) +0:111 'tempArg' ( temp 4-component vector of float) +0:112 Comma ( temp void) +0:112 Function Call: Fn2(vi4; ( temp void) +0:112 'tempArg' ( temp 4-component vector of int) +0:112 Sequence +0:112 imageStore ( temp void) +0:112 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:112 c1: direct index for structure ( uniform int) +0:112 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:112 Constant: +0:112 0 (const uint) +0:112 'tempArg' ( temp 4-component vector of int) +0:112 'tempArg' ( temp 4-component vector of int) +0:113 Comma ( temp void) +0:113 Function Call: Fn2(vu4; ( temp void) +0:113 'tempArg' ( temp 4-component vector of uint) +0:113 Sequence +0:113 imageStore ( temp void) +0:113 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:113 c1: direct index for structure ( uniform int) +0:113 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:113 Constant: +0:113 0 (const uint) +0:113 'tempArg' ( temp 4-component vector of uint) +0:113 'tempArg' ( temp 4-component vector of uint) +0:117 Sequence +0:117 move second child to first child ( temp int) +0:117 'coordTemp' ( temp int) +0:117 c1: direct index for structure ( uniform int) +0:117 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:117 Constant: +0:117 0 (const uint) +0:117 move second child to first child ( temp 4-component vector of float) +0:117 'storeTemp' ( temp 4-component vector of float) +0:117 imageLoad ( temp 4-component vector of float) +0:117 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:117 'coordTemp' ( temp int) +0:117 Pre-Increment ( temp 4-component vector of float) +0:117 'storeTemp' ( temp 4-component vector of float) +0:117 imageStore ( temp void) +0:117 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:117 'coordTemp' ( temp int) +0:117 'storeTemp' ( temp 4-component vector of float) +0:117 'storeTemp' ( temp 4-component vector of float) +0:118 Sequence +0:118 move second child to first child ( temp int) +0:118 'coordTemp' ( temp int) +0:118 c1: direct index for structure ( uniform int) +0:118 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:118 Constant: +0:118 0 (const uint) +0:118 move second child to first child ( temp 4-component vector of int) +0:118 'storeTemp' ( temp 4-component vector of int) +0:118 imageLoad ( temp 4-component vector of int) +0:118 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:118 'coordTemp' ( temp int) +0:118 Pre-Increment ( temp 4-component vector of int) +0:118 'storeTemp' ( temp 4-component vector of int) +0:118 imageStore ( temp void) +0:118 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:118 'coordTemp' ( temp int) +0:118 'storeTemp' ( temp 4-component vector of int) +0:118 'storeTemp' ( temp 4-component vector of int) +0:119 Sequence +0:119 move second child to first child ( temp int) +0:119 'coordTemp' ( temp int) +0:119 c1: direct index for structure ( uniform int) +0:119 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:119 Constant: +0:119 0 (const uint) +0:119 move second child to first child ( temp 4-component vector of uint) +0:119 'storeTemp' ( temp 4-component vector of uint) +0:119 imageLoad ( temp 4-component vector of uint) +0:119 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:119 'coordTemp' ( temp int) +0:119 Pre-Increment ( temp 4-component vector of uint) +0:119 'storeTemp' ( temp 4-component vector of uint) +0:119 imageStore ( temp void) +0:119 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:119 'coordTemp' ( temp int) +0:119 'storeTemp' ( temp 4-component vector of uint) +0:119 'storeTemp' ( temp 4-component vector of uint) +0:121 Sequence +0:121 move second child to first child ( temp int) +0:121 'coordTemp' ( temp int) +0:121 c1: direct index for structure ( uniform int) +0:121 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:121 Constant: +0:121 0 (const uint) +0:121 move second child to first child ( temp 4-component vector of float) +0:121 'storeTemp' ( temp 4-component vector of float) +0:121 imageLoad ( temp 4-component vector of float) +0:121 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:121 'coordTemp' ( temp int) +0:121 Pre-Decrement ( temp 4-component vector of float) +0:121 'storeTemp' ( temp 4-component vector of float) +0:121 imageStore ( temp void) +0:121 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:121 'coordTemp' ( temp int) +0:121 'storeTemp' ( temp 4-component vector of float) +0:121 'storeTemp' ( temp 4-component vector of float) +0:122 Sequence +0:122 move second child to first child ( temp int) +0:122 'coordTemp' ( temp int) +0:122 c1: direct index for structure ( uniform int) +0:122 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:122 Constant: +0:122 0 (const uint) +0:122 move second child to first child ( temp 4-component vector of int) +0:122 'storeTemp' ( temp 4-component vector of int) +0:122 imageLoad ( temp 4-component vector of int) +0:122 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:122 'coordTemp' ( temp int) +0:122 Pre-Decrement ( temp 4-component vector of int) +0:122 'storeTemp' ( temp 4-component vector of int) +0:122 imageStore ( temp void) +0:122 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:122 'coordTemp' ( temp int) +0:122 'storeTemp' ( temp 4-component vector of int) +0:122 'storeTemp' ( temp 4-component vector of int) +0:123 Sequence +0:123 move second child to first child ( temp int) +0:123 'coordTemp' ( temp int) +0:123 c1: direct index for structure ( uniform int) +0:123 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:123 Constant: +0:123 0 (const uint) +0:123 move second child to first child ( temp 4-component vector of uint) +0:123 'storeTemp' ( temp 4-component vector of uint) +0:123 imageLoad ( temp 4-component vector of uint) +0:123 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:123 'coordTemp' ( temp int) +0:123 Pre-Decrement ( temp 4-component vector of uint) +0:123 'storeTemp' ( temp 4-component vector of uint) +0:123 imageStore ( temp void) +0:123 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:123 'coordTemp' ( temp int) +0:123 'storeTemp' ( temp 4-component vector of uint) +0:123 'storeTemp' ( temp 4-component vector of uint) +0:126 Sequence +0:126 move second child to first child ( temp int) +0:126 'coordTemp' ( temp int) +0:126 c1: direct index for structure ( uniform int) +0:126 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:126 Constant: +0:126 0 (const uint) +0:126 move second child to first child ( temp 4-component vector of float) +0:126 'storeTempPre' ( temp 4-component vector of float) +0:126 imageLoad ( temp 4-component vector of float) +0:126 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:126 'coordTemp' ( temp int) +0:126 move second child to first child ( temp 4-component vector of float) +0:126 'storeTempPost' ( temp 4-component vector of float) +0:126 'storeTempPre' ( temp 4-component vector of float) +0:126 Post-Increment ( temp 4-component vector of float) +0:126 'storeTempPost' ( temp 4-component vector of float) +0:126 imageStore ( temp void) +0:126 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:126 'coordTemp' ( temp int) +0:126 'storeTempPost' ( temp 4-component vector of float) +0:126 'storeTempPre' ( temp 4-component vector of float) +0:127 Sequence +0:127 move second child to first child ( temp int) +0:127 'coordTemp' ( temp int) +0:127 c1: direct index for structure ( uniform int) +0:127 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:127 Constant: +0:127 0 (const uint) +0:127 move second child to first child ( temp 4-component vector of uint) +0:127 'storeTempPre' ( temp 4-component vector of uint) +0:127 imageLoad ( temp 4-component vector of uint) +0:127 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:127 'coordTemp' ( temp int) +0:127 move second child to first child ( temp 4-component vector of uint) +0:127 'storeTempPost' ( temp 4-component vector of uint) +0:127 'storeTempPre' ( temp 4-component vector of uint) +0:127 Post-Decrement ( temp 4-component vector of uint) +0:127 'storeTempPost' ( temp 4-component vector of uint) +0:127 imageStore ( temp void) +0:127 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:127 'coordTemp' ( temp int) +0:127 'storeTempPost' ( temp 4-component vector of uint) +0:127 'storeTempPre' ( temp 4-component vector of uint) +0:128 Sequence +0:128 move second child to first child ( temp int) +0:128 'coordTemp' ( temp int) +0:128 c1: direct index for structure ( uniform int) +0:128 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:128 Constant: +0:128 0 (const uint) +0:128 move second child to first child ( temp 4-component vector of int) +0:128 'storeTempPre' ( temp 4-component vector of int) +0:128 imageLoad ( temp 4-component vector of int) +0:128 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:128 'coordTemp' ( temp int) +0:128 move second child to first child ( temp 4-component vector of int) +0:128 'storeTempPost' ( temp 4-component vector of int) +0:128 'storeTempPre' ( temp 4-component vector of int) +0:128 Post-Increment ( temp 4-component vector of int) +0:128 'storeTempPost' ( temp 4-component vector of int) +0:128 imageStore ( temp void) +0:128 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:128 'coordTemp' ( temp int) +0:128 'storeTempPost' ( temp 4-component vector of int) +0:128 'storeTempPre' ( temp 4-component vector of int) +0:130 Sequence +0:130 move second child to first child ( temp int) +0:130 'coordTemp' ( temp int) +0:130 c1: direct index for structure ( uniform int) +0:130 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:130 Constant: +0:130 0 (const uint) +0:130 move second child to first child ( temp 4-component vector of float) +0:130 'storeTempPre' ( temp 4-component vector of float) +0:130 imageLoad ( temp 4-component vector of float) +0:130 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:130 'coordTemp' ( temp int) +0:130 move second child to first child ( temp 4-component vector of float) +0:130 'storeTempPost' ( temp 4-component vector of float) +0:130 'storeTempPre' ( temp 4-component vector of float) +0:130 Post-Decrement ( temp 4-component vector of float) +0:130 'storeTempPost' ( temp 4-component vector of float) +0:130 imageStore ( temp void) +0:130 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:130 'coordTemp' ( temp int) +0:130 'storeTempPost' ( temp 4-component vector of float) +0:130 'storeTempPre' ( temp 4-component vector of float) +0:131 Sequence +0:131 move second child to first child ( temp int) +0:131 'coordTemp' ( temp int) +0:131 c1: direct index for structure ( uniform int) +0:131 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:131 Constant: +0:131 0 (const uint) +0:131 move second child to first child ( temp 4-component vector of int) +0:131 'storeTempPre' ( temp 4-component vector of int) +0:131 imageLoad ( temp 4-component vector of int) +0:131 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:131 'coordTemp' ( temp int) +0:131 move second child to first child ( temp 4-component vector of int) +0:131 'storeTempPost' ( temp 4-component vector of int) +0:131 'storeTempPre' ( temp 4-component vector of int) +0:131 Post-Increment ( temp 4-component vector of int) +0:131 'storeTempPost' ( temp 4-component vector of int) +0:131 imageStore ( temp void) +0:131 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:131 'coordTemp' ( temp int) +0:131 'storeTempPost' ( temp 4-component vector of int) +0:131 'storeTempPre' ( temp 4-component vector of int) +0:132 Sequence +0:132 move second child to first child ( temp int) +0:132 'coordTemp' ( temp int) +0:132 c1: direct index for structure ( uniform int) +0:132 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:132 Constant: +0:132 0 (const uint) +0:132 move second child to first child ( temp 4-component vector of uint) +0:132 'storeTempPre' ( temp 4-component vector of uint) +0:132 imageLoad ( temp 4-component vector of uint) +0:132 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:132 'coordTemp' ( temp int) +0:132 move second child to first child ( temp 4-component vector of uint) +0:132 'storeTempPost' ( temp 4-component vector of uint) +0:132 'storeTempPre' ( temp 4-component vector of uint) +0:132 Post-Decrement ( temp 4-component vector of uint) +0:132 'storeTempPost' ( temp 4-component vector of uint) +0:132 imageStore ( temp void) +0:132 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:132 'coordTemp' ( temp int) +0:132 'storeTempPost' ( temp 4-component vector of uint) +0:132 'storeTempPre' ( temp 4-component vector of uint) +0:135 Sequence +0:135 move second child to first child ( temp 4-component vector of float) +0:135 'storeTemp' ( temp 4-component vector of float) +0:? imageLoad ( temp 4-component vector of float) +0:135 'g_tTex2df4' (layout( rgba32f) uniform image2D) +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:135 imageStore ( temp void) +0:135 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:135 Constant: +0:135 1 (const int) +0:135 'storeTemp' ( temp 4-component vector of float) +0:135 'storeTemp' ( temp 4-component vector of float) +0:137 move second child to first child ( temp 4-component vector of float) +0:137 Color: direct index for structure ( temp 4-component vector of float) +0:137 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 1.000000 +0:137 1.000000 +0:137 1.000000 +0:137 1.000000 +0:139 Branch: Return with expression +0:139 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:53 Function Definition: main( ( temp void) +0:53 Function Parameters: +0:? Sequence +0:53 Sequence +0:53 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:53 Color: direct index for structure ( temp 4-component vector of float) +0:53 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:53 Constant: +0:53 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D) +0:? 'g_tTex1di4' (layout( rgba32i) uniform iimage1D) +0:? 'g_tTex1du4' (layout( rgba32ui) uniform uimage1D) +0:? 'g_tTex2df4' (layout( rgba32f) uniform image2D) +0:? 'g_tTex2di4' (layout( rgba32i) uniform iimage2D) +0:? 'g_tTex2du4' (layout( rgba32ui) uniform uimage2D) +0:? 'g_tTex3df4' (layout( rgba32f) uniform image3D) +0:? 'g_tTex3di4' (layout( rgba32i) uniform iimage3D) +0:? 'g_tTex3du4' (layout( rgba32ui) uniform uimage3D) +0:? 'g_tTex1df4a' (layout( rgba32f) uniform image1DArray) +0:? 'g_tTex1di4a' (layout( rgba32i) uniform iimage1DArray) +0:? 'g_tTex1du4a' (layout( rgba32ui) uniform uimage1DArray) +0:? 'g_tTex2df4a' (layout( rgba32f) uniform image2DArray) +0:? 'g_tTex2di4a' (layout( rgba32i) uniform iimage2DArray) +0:? 'g_tTex2du4a' (layout( rgba32ui) uniform uimage2DArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 4-component vector of float uf4, uniform 4-component vector of int ui4, uniform 4-component vector of uint uu4}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 607 + + Capability Shader + Capability Image1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 583 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "Fn1(vi4;" + Name 10 "x" + Name 18 "Fn1(vu4;" + Name 17 "x" + Name 25 "Fn1(vf4;" + Name 24 "x" + Name 29 "Fn2(vi4;" + Name 28 "x" + Name 33 "Fn2(vu4;" + Name 32 "x" + Name 37 "Fn2(vf4;" + Name 36 "x" + Name 40 "SomeValue(" + Name 42 "PS_OUTPUT" + MemberName 42(PS_OUTPUT) 0 "Color" + Name 44 "@main(" + Name 63 "$Global" + MemberName 63($Global) 0 "c1" + MemberName 63($Global) 1 "c2" + MemberName 63($Global) 2 "c3" + MemberName 63($Global) 3 "c4" + MemberName 63($Global) 4 "o1" + MemberName 63($Global) 5 "o2" + MemberName 63($Global) 6 "o3" + MemberName 63($Global) 7 "o4" + MemberName 63($Global) 8 "uf4" + MemberName 63($Global) 9 "ui4" + MemberName 63($Global) 10 "uu4" + Name 65 "" + Name 75 "g_tTex1df4" + Name 81 "r00" + Name 86 "r01" + Name 89 "g_tTex1di4" + Name 94 "r02" + Name 97 "g_tTex1du4" + Name 102 "r10" + Name 105 "g_tTex2df4" + Name 112 "r11" + Name 115 "g_tTex2di4" + Name 120 "r12" + Name 123 "g_tTex2du4" + Name 128 "r20" + Name 131 "g_tTex3df4" + Name 138 "r21" + Name 141 "g_tTex3di4" + Name 146 "r22" + Name 149 "g_tTex3du4" + Name 154 "lf4" + Name 159 "storeTemp" + Name 169 "storeTemp" + Name 176 "storeTemp" + Name 185 "val1" + Name 187 "coordTemp" + Name 190 "storeTemp" + Name 201 "coordTemp" + Name 204 "storeTemp" + Name 215 "coordTemp" + Name 218 "storeTemp" + Name 229 "coordTemp" + Name 232 "storeTemp" + Name 242 "coordTemp" + Name 245 "storeTemp" + Name 255 "coordTemp" + Name 258 "storeTemp" + Name 269 "coordTemp" + Name 272 "storeTemp" + Name 283 "coordTemp" + Name 286 "storeTemp" + Name 296 "coordTemp" + Name 299 "storeTemp" + Name 309 "storeTemp" + Name 319 "storeTemp" + Name 326 "storeTemp" + Name 333 "storeTemp" + Name 343 "storeTemp" + Name 351 "storeTemp" + Name 362 "param" + Name 368 "param" + Name 374 "param" + Name 376 "tempArg" + Name 377 "param" + Name 384 "tempArg" + Name 385 "param" + Name 392 "tempArg" + Name 393 "param" + Name 400 "coordTemp" + Name 403 "storeTemp" + Name 414 "coordTemp" + Name 417 "storeTemp" + Name 427 "coordTemp" + Name 430 "storeTemp" + Name 440 "coordTemp" + Name 443 "storeTemp" + Name 453 "coordTemp" + Name 456 "storeTemp" + Name 466 "coordTemp" + Name 469 "storeTemp" + Name 479 "coordTemp" + Name 482 "storeTempPre" + Name 486 "storeTempPost" + Name 494 "coordTemp" + Name 497 "storeTempPre" + Name 501 "storeTempPost" + Name 509 "coordTemp" + Name 512 "storeTempPre" + Name 516 "storeTempPost" + Name 524 "coordTemp" + Name 527 "storeTempPre" + Name 531 "storeTempPost" + Name 539 "coordTemp" + Name 542 "storeTempPre" + Name 546 "storeTempPost" + Name 554 "coordTemp" + Name 557 "storeTempPre" + Name 561 "storeTempPost" + Name 569 "storeTemp" + Name 576 "psout" + Name 583 "@entryPointOutput.Color" + Name 588 "g_sSamp" + Name 591 "g_tTex1df4a" + Name 594 "g_tTex1di4a" + Name 597 "g_tTex1du4a" + Name 600 "g_tTex2df4a" + Name 603 "g_tTex2di4a" + Name 606 "g_tTex2du4a" + MemberDecorate 63($Global) 0 Offset 0 + MemberDecorate 63($Global) 1 Offset 8 + MemberDecorate 63($Global) 2 Offset 16 + MemberDecorate 63($Global) 3 Offset 32 + MemberDecorate 63($Global) 4 Offset 48 + MemberDecorate 63($Global) 5 Offset 56 + MemberDecorate 63($Global) 6 Offset 64 + MemberDecorate 63($Global) 7 Offset 80 + MemberDecorate 63($Global) 8 Offset 96 + MemberDecorate 63($Global) 9 Offset 112 + MemberDecorate 63($Global) 10 Offset 128 + Decorate 63($Global) Block + Decorate 65 DescriptorSet 0 + Decorate 75(g_tTex1df4) DescriptorSet 0 + Decorate 75(g_tTex1df4) Binding 0 + Decorate 89(g_tTex1di4) DescriptorSet 0 + Decorate 97(g_tTex1du4) DescriptorSet 0 + Decorate 105(g_tTex2df4) DescriptorSet 0 + Decorate 115(g_tTex2di4) DescriptorSet 0 + Decorate 123(g_tTex2du4) DescriptorSet 0 + Decorate 131(g_tTex3df4) DescriptorSet 0 + Decorate 141(g_tTex3di4) DescriptorSet 0 + Decorate 149(g_tTex3du4) DescriptorSet 0 + Decorate 583(@entryPointOutput.Color) Location 0 + Decorate 588(g_sSamp) DescriptorSet 0 + Decorate 588(g_sSamp) Binding 0 + Decorate 591(g_tTex1df4a) DescriptorSet 0 + Decorate 594(g_tTex1di4a) DescriptorSet 0 + Decorate 597(g_tTex1du4a) DescriptorSet 0 + Decorate 600(g_tTex2df4a) DescriptorSet 0 + Decorate 603(g_tTex2di4a) DescriptorSet 0 + Decorate 606(g_tTex2du4a) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeVector 6(int) 4 + 8: TypePointer Function 7(ivec4) + 9: TypeFunction 7(ivec4) 8(ptr) + 13: TypeInt 32 0 + 14: TypeVector 13(int) 4 + 15: TypePointer Function 14(ivec4) + 16: TypeFunction 14(ivec4) 15(ptr) + 20: TypeFloat 32 + 21: TypeVector 20(float) 4 + 22: TypePointer Function 21(fvec4) + 23: TypeFunction 21(fvec4) 22(ptr) + 27: TypeFunction 2 8(ptr) + 31: TypeFunction 2 15(ptr) + 35: TypeFunction 2 22(ptr) + 39: TypeFunction 21(fvec4) + 42(PS_OUTPUT): TypeStruct 21(fvec4) + 43: TypeFunction 42(PS_OUTPUT) + 55: 6(int) Constant 0 + 56: 7(ivec4) ConstantComposite 55 55 55 55 + 57: 13(int) Constant 0 + 58: 14(ivec4) ConstantComposite 57 57 57 57 + 59: 20(float) Constant 0 + 60: 21(fvec4) ConstantComposite 59 59 59 59 + 61: TypeVector 6(int) 2 + 62: TypeVector 6(int) 3 + 63($Global): TypeStruct 6(int) 61(ivec2) 62(ivec3) 7(ivec4) 6(int) 61(ivec2) 62(ivec3) 7(ivec4) 21(fvec4) 7(ivec4) 14(ivec4) + 64: TypePointer Uniform 63($Global) + 65: 64(ptr) Variable Uniform + 66: 6(int) Constant 3 + 67: TypePointer Uniform 7(ivec4) + 73: TypeImage 20(float) 1D nonsampled format:Rgba32f + 74: TypePointer UniformConstant 73 + 75(g_tTex1df4): 74(ptr) Variable UniformConstant + 77: TypePointer Uniform 6(int) + 87: TypeImage 6(int) 1D nonsampled format:Rgba32i + 88: TypePointer UniformConstant 87 + 89(g_tTex1di4): 88(ptr) Variable UniformConstant + 95: TypeImage 13(int) 1D nonsampled format:Rgba32ui + 96: TypePointer UniformConstant 95 + 97(g_tTex1du4): 96(ptr) Variable UniformConstant + 103: TypeImage 20(float) 2D nonsampled format:Rgba32f + 104: TypePointer UniformConstant 103 + 105(g_tTex2df4): 104(ptr) Variable UniformConstant + 107: 6(int) Constant 1 + 108: TypePointer Uniform 61(ivec2) + 113: TypeImage 6(int) 2D nonsampled format:Rgba32i + 114: TypePointer UniformConstant 113 + 115(g_tTex2di4): 114(ptr) Variable UniformConstant + 121: TypeImage 13(int) 2D nonsampled format:Rgba32ui + 122: TypePointer UniformConstant 121 + 123(g_tTex2du4): 122(ptr) Variable UniformConstant + 129: TypeImage 20(float) 3D nonsampled format:Rgba32f + 130: TypePointer UniformConstant 129 + 131(g_tTex3df4): 130(ptr) Variable UniformConstant + 133: 6(int) Constant 2 + 134: TypePointer Uniform 62(ivec3) + 139: TypeImage 6(int) 3D nonsampled format:Rgba32i + 140: TypePointer UniformConstant 139 + 141(g_tTex3di4): 140(ptr) Variable UniformConstant + 147: TypeImage 13(int) 3D nonsampled format:Rgba32ui + 148: TypePointer UniformConstant 147 + 149(g_tTex3du4): 148(ptr) Variable UniformConstant + 155: 6(int) Constant 8 + 156: TypePointer Uniform 21(fvec4) + 170: 6(int) Constant 4 + 171: 7(ivec4) ConstantComposite 133 133 66 170 + 177: 13(int) Constant 3 + 178: 13(int) Constant 2 + 179: 13(int) Constant 4 + 180: 14(ivec4) ConstantComposite 177 178 177 179 + 186: TypePointer Function 6(int) + 194: 20(float) Constant 1073741824 + 208: 20(float) Constant 1077936128 + 222: 20(float) Constant 1082130432 + 262: 6(int) Constant 65535 + 276: 6(int) Constant 61680 + 320: 6(int) Constant 5 + 321: 7(ivec4) ConstantComposite 320 133 66 170 + 327: 13(int) Constant 6 + 328: 14(ivec4) ConstantComposite 327 178 177 179 + 344: 6(int) Constant 6 + 345: 6(int) Constant 7 + 346: 7(ivec4) ConstantComposite 155 344 345 155 + 352: 13(int) Constant 9 + 353: 14(ivec4) ConstantComposite 352 178 177 179 + 408: 20(float) Constant 1065353216 + 571: 61(ivec2) ConstantComposite 133 66 + 575: TypePointer Function 42(PS_OUTPUT) + 577: 21(fvec4) ConstantComposite 408 408 408 408 + 582: TypePointer Output 21(fvec4) +583(@entryPointOutput.Color): 582(ptr) Variable Output + 586: TypeSampler + 587: TypePointer UniformConstant 586 + 588(g_sSamp): 587(ptr) Variable UniformConstant + 589: TypeImage 20(float) 1D array nonsampled format:Rgba32f + 590: TypePointer UniformConstant 589 +591(g_tTex1df4a): 590(ptr) Variable UniformConstant + 592: TypeImage 6(int) 1D array nonsampled format:Rgba32i + 593: TypePointer UniformConstant 592 +594(g_tTex1di4a): 593(ptr) Variable UniformConstant + 595: TypeImage 13(int) 1D array nonsampled format:Rgba32ui + 596: TypePointer UniformConstant 595 +597(g_tTex1du4a): 596(ptr) Variable UniformConstant + 598: TypeImage 20(float) 2D array nonsampled format:Rgba32f + 599: TypePointer UniformConstant 598 +600(g_tTex2df4a): 599(ptr) Variable UniformConstant + 601: TypeImage 6(int) 2D array nonsampled format:Rgba32i + 602: TypePointer UniformConstant 601 +603(g_tTex2di4a): 602(ptr) Variable UniformConstant + 604: TypeImage 13(int) 2D array nonsampled format:Rgba32ui + 605: TypePointer UniformConstant 604 +606(g_tTex2du4a): 605(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 584:42(PS_OUTPUT) FunctionCall 44(@main() + 585: 21(fvec4) CompositeExtract 584 0 + Store 583(@entryPointOutput.Color) 585 + Return + FunctionEnd + 11(Fn1(vi4;): 7(ivec4) Function None 9 + 10(x): 8(ptr) FunctionParameter + 12: Label + 46: 7(ivec4) Load 10(x) + ReturnValue 46 + FunctionEnd + 18(Fn1(vu4;): 14(ivec4) Function None 16 + 17(x): 15(ptr) FunctionParameter + 19: Label + 49: 14(ivec4) Load 17(x) + ReturnValue 49 + FunctionEnd + 25(Fn1(vf4;): 21(fvec4) Function None 23 + 24(x): 22(ptr) FunctionParameter + 26: Label + 52: 21(fvec4) Load 24(x) + ReturnValue 52 + FunctionEnd + 29(Fn2(vi4;): 2 Function None 27 + 28(x): 8(ptr) FunctionParameter + 30: Label + Store 28(x) 56 + Return + FunctionEnd + 33(Fn2(vu4;): 2 Function None 31 + 32(x): 15(ptr) FunctionParameter + 34: Label + Store 32(x) 58 + Return + FunctionEnd + 37(Fn2(vf4;): 2 Function None 35 + 36(x): 22(ptr) FunctionParameter + 38: Label + Store 36(x) 60 + Return + FunctionEnd + 40(SomeValue(): 21(fvec4) Function None 39 + 41: Label + 68: 67(ptr) AccessChain 65 66 + 69: 7(ivec4) Load 68 + 70: 21(fvec4) ConvertSToF 69 + ReturnValue 70 + FunctionEnd + 44(@main():42(PS_OUTPUT) Function None 43 + 45: Label + 81(r00): 22(ptr) Variable Function + 86(r01): 8(ptr) Variable Function + 94(r02): 15(ptr) Variable Function + 102(r10): 22(ptr) Variable Function + 112(r11): 8(ptr) Variable Function + 120(r12): 15(ptr) Variable Function + 128(r20): 22(ptr) Variable Function + 138(r21): 8(ptr) Variable Function + 146(r22): 15(ptr) Variable Function + 154(lf4): 22(ptr) Variable Function + 159(storeTemp): 22(ptr) Variable Function + 169(storeTemp): 8(ptr) Variable Function + 176(storeTemp): 15(ptr) Variable Function + 185(val1): 22(ptr) Variable Function + 187(coordTemp): 186(ptr) Variable Function + 190(storeTemp): 22(ptr) Variable Function + 201(coordTemp): 186(ptr) Variable Function + 204(storeTemp): 22(ptr) Variable Function + 215(coordTemp): 186(ptr) Variable Function + 218(storeTemp): 22(ptr) Variable Function + 229(coordTemp): 186(ptr) Variable Function + 232(storeTemp): 8(ptr) Variable Function + 242(coordTemp): 186(ptr) Variable Function + 245(storeTemp): 8(ptr) Variable Function + 255(coordTemp): 186(ptr) Variable Function + 258(storeTemp): 8(ptr) Variable Function + 269(coordTemp): 186(ptr) Variable Function + 272(storeTemp): 8(ptr) Variable Function + 283(coordTemp): 186(ptr) Variable Function + 286(storeTemp): 8(ptr) Variable Function + 296(coordTemp): 186(ptr) Variable Function + 299(storeTemp): 8(ptr) Variable Function + 309(storeTemp): 22(ptr) Variable Function + 319(storeTemp): 8(ptr) Variable Function + 326(storeTemp): 15(ptr) Variable Function + 333(storeTemp): 22(ptr) Variable Function + 343(storeTemp): 8(ptr) Variable Function + 351(storeTemp): 15(ptr) Variable Function + 362(param): 22(ptr) Variable Function + 368(param): 8(ptr) Variable Function + 374(param): 15(ptr) Variable Function + 376(tempArg): 22(ptr) Variable Function + 377(param): 22(ptr) Variable Function + 384(tempArg): 8(ptr) Variable Function + 385(param): 8(ptr) Variable Function + 392(tempArg): 15(ptr) Variable Function + 393(param): 15(ptr) Variable Function + 400(coordTemp): 186(ptr) Variable Function + 403(storeTemp): 22(ptr) Variable Function + 414(coordTemp): 186(ptr) Variable Function + 417(storeTemp): 8(ptr) Variable Function + 427(coordTemp): 186(ptr) Variable Function + 430(storeTemp): 15(ptr) Variable Function + 440(coordTemp): 186(ptr) Variable Function + 443(storeTemp): 22(ptr) Variable Function + 453(coordTemp): 186(ptr) Variable Function + 456(storeTemp): 8(ptr) Variable Function + 466(coordTemp): 186(ptr) Variable Function + 469(storeTemp): 15(ptr) Variable Function + 479(coordTemp): 186(ptr) Variable Function +482(storeTempPre): 22(ptr) Variable Function +486(storeTempPost): 22(ptr) Variable Function + 494(coordTemp): 186(ptr) Variable Function +497(storeTempPre): 15(ptr) Variable Function +501(storeTempPost): 15(ptr) Variable Function + 509(coordTemp): 186(ptr) Variable Function +512(storeTempPre): 8(ptr) Variable Function +516(storeTempPost): 8(ptr) Variable Function + 524(coordTemp): 186(ptr) Variable Function +527(storeTempPre): 22(ptr) Variable Function +531(storeTempPost): 22(ptr) Variable Function + 539(coordTemp): 186(ptr) Variable Function +542(storeTempPre): 8(ptr) Variable Function +546(storeTempPost): 8(ptr) Variable Function + 554(coordTemp): 186(ptr) Variable Function +557(storeTempPre): 15(ptr) Variable Function +561(storeTempPost): 15(ptr) Variable Function + 569(storeTemp): 22(ptr) Variable Function + 576(psout): 575(ptr) Variable Function + 76: 73 Load 75(g_tTex1df4) + 78: 77(ptr) AccessChain 65 55 + 79: 6(int) Load 78 + 80: 21(fvec4) ImageRead 76 79 + 82: 73 Load 75(g_tTex1df4) + 83: 77(ptr) AccessChain 65 55 + 84: 6(int) Load 83 + 85: 21(fvec4) ImageRead 82 84 + Store 81(r00) 85 + 90: 87 Load 89(g_tTex1di4) + 91: 77(ptr) AccessChain 65 55 + 92: 6(int) Load 91 + 93: 7(ivec4) ImageRead 90 92 + Store 86(r01) 93 + 98: 95 Load 97(g_tTex1du4) + 99: 77(ptr) AccessChain 65 55 + 100: 6(int) Load 99 + 101: 14(ivec4) ImageRead 98 100 + Store 94(r02) 101 + 106: 103 Load 105(g_tTex2df4) + 109: 108(ptr) AccessChain 65 107 + 110: 61(ivec2) Load 109 + 111: 21(fvec4) ImageRead 106 110 + Store 102(r10) 111 + 116: 113 Load 115(g_tTex2di4) + 117: 108(ptr) AccessChain 65 107 + 118: 61(ivec2) Load 117 + 119: 7(ivec4) ImageRead 116 118 + Store 112(r11) 119 + 124: 121 Load 123(g_tTex2du4) + 125: 108(ptr) AccessChain 65 107 + 126: 61(ivec2) Load 125 + 127: 14(ivec4) ImageRead 124 126 + Store 120(r12) 127 + 132: 129 Load 131(g_tTex3df4) + 135: 134(ptr) AccessChain 65 133 + 136: 62(ivec3) Load 135 + 137: 21(fvec4) ImageRead 132 136 + Store 128(r20) 137 + 142: 139 Load 141(g_tTex3di4) + 143: 134(ptr) AccessChain 65 133 + 144: 62(ivec3) Load 143 + 145: 7(ivec4) ImageRead 142 144 + Store 138(r21) 145 + 150: 147 Load 149(g_tTex3du4) + 151: 134(ptr) AccessChain 65 133 + 152: 62(ivec3) Load 151 + 153: 14(ivec4) ImageRead 150 152 + Store 146(r22) 153 + 157: 156(ptr) AccessChain 65 155 + 158: 21(fvec4) Load 157 + Store 154(lf4) 158 + 160: 21(fvec4) FunctionCall 40(SomeValue() + Store 159(storeTemp) 160 + 161: 73 Load 75(g_tTex1df4) + 162: 77(ptr) AccessChain 65 55 + 163: 6(int) Load 162 + 164: 21(fvec4) Load 159(storeTemp) + ImageWrite 161 163 164 + 165: 73 Load 75(g_tTex1df4) + 166: 77(ptr) AccessChain 65 55 + 167: 6(int) Load 166 + 168: 21(fvec4) Load 154(lf4) + ImageWrite 165 167 168 + Store 169(storeTemp) 171 + 172: 87 Load 89(g_tTex1di4) + 173: 77(ptr) AccessChain 65 55 + 174: 6(int) Load 173 + 175: 7(ivec4) Load 169(storeTemp) + ImageWrite 172 174 175 + Store 176(storeTemp) 180 + 181: 95 Load 97(g_tTex1du4) + 182: 77(ptr) AccessChain 65 55 + 183: 6(int) Load 182 + 184: 14(ivec4) Load 176(storeTemp) + ImageWrite 181 183 184 + 188: 77(ptr) AccessChain 65 55 + 189: 6(int) Load 188 + Store 187(coordTemp) 189 + 191: 73 Load 75(g_tTex1df4) + 192: 6(int) Load 187(coordTemp) + 193: 21(fvec4) ImageRead 191 192 + Store 190(storeTemp) 193 + 195: 21(fvec4) Load 190(storeTemp) + 196: 21(fvec4) VectorTimesScalar 195 194 + Store 190(storeTemp) 196 + 197: 73 Load 75(g_tTex1df4) + 198: 6(int) Load 187(coordTemp) + 199: 21(fvec4) Load 190(storeTemp) + ImageWrite 197 198 199 + 200: 21(fvec4) Load 190(storeTemp) + Store 185(val1) 200 + 202: 77(ptr) AccessChain 65 55 + 203: 6(int) Load 202 + Store 201(coordTemp) 203 + 205: 73 Load 75(g_tTex1df4) + 206: 6(int) Load 201(coordTemp) + 207: 21(fvec4) ImageRead 205 206 + Store 204(storeTemp) 207 + 209: 21(fvec4) Load 204(storeTemp) + 210: 21(fvec4) CompositeConstruct 208 208 208 208 + 211: 21(fvec4) FSub 209 210 + Store 204(storeTemp) 211 + 212: 73 Load 75(g_tTex1df4) + 213: 6(int) Load 201(coordTemp) + 214: 21(fvec4) Load 204(storeTemp) + ImageWrite 212 213 214 + 216: 77(ptr) AccessChain 65 55 + 217: 6(int) Load 216 + Store 215(coordTemp) 217 + 219: 73 Load 75(g_tTex1df4) + 220: 6(int) Load 215(coordTemp) + 221: 21(fvec4) ImageRead 219 220 + Store 218(storeTemp) 221 + 223: 21(fvec4) Load 218(storeTemp) + 224: 21(fvec4) CompositeConstruct 222 222 222 222 + 225: 21(fvec4) FAdd 223 224 + Store 218(storeTemp) 225 + 226: 73 Load 75(g_tTex1df4) + 227: 6(int) Load 215(coordTemp) + 228: 21(fvec4) Load 218(storeTemp) + ImageWrite 226 227 228 + 230: 77(ptr) AccessChain 65 55 + 231: 6(int) Load 230 + Store 229(coordTemp) 231 + 233: 87 Load 89(g_tTex1di4) + 234: 6(int) Load 229(coordTemp) + 235: 7(ivec4) ImageRead 233 234 + Store 232(storeTemp) 235 + 236: 7(ivec4) Load 232(storeTemp) + 237: 7(ivec4) CompositeConstruct 133 133 133 133 + 238: 7(ivec4) SDiv 236 237 + Store 232(storeTemp) 238 + 239: 87 Load 89(g_tTex1di4) + 240: 6(int) Load 229(coordTemp) + 241: 7(ivec4) Load 232(storeTemp) + ImageWrite 239 240 241 + 243: 77(ptr) AccessChain 65 55 + 244: 6(int) Load 243 + Store 242(coordTemp) 244 + 246: 87 Load 89(g_tTex1di4) + 247: 6(int) Load 242(coordTemp) + 248: 7(ivec4) ImageRead 246 247 + Store 245(storeTemp) 248 + 249: 7(ivec4) Load 245(storeTemp) + 250: 7(ivec4) CompositeConstruct 133 133 133 133 + 251: 7(ivec4) SMod 249 250 + Store 245(storeTemp) 251 + 252: 87 Load 89(g_tTex1di4) + 253: 6(int) Load 242(coordTemp) + 254: 7(ivec4) Load 245(storeTemp) + ImageWrite 252 253 254 + 256: 77(ptr) AccessChain 65 55 + 257: 6(int) Load 256 + Store 255(coordTemp) 257 + 259: 87 Load 89(g_tTex1di4) + 260: 6(int) Load 255(coordTemp) + 261: 7(ivec4) ImageRead 259 260 + Store 258(storeTemp) 261 + 263: 7(ivec4) Load 258(storeTemp) + 264: 7(ivec4) CompositeConstruct 262 262 262 262 + 265: 7(ivec4) BitwiseAnd 263 264 + Store 258(storeTemp) 265 + 266: 87 Load 89(g_tTex1di4) + 267: 6(int) Load 255(coordTemp) + 268: 7(ivec4) Load 258(storeTemp) + ImageWrite 266 267 268 + 270: 77(ptr) AccessChain 65 55 + 271: 6(int) Load 270 + Store 269(coordTemp) 271 + 273: 87 Load 89(g_tTex1di4) + 274: 6(int) Load 269(coordTemp) + 275: 7(ivec4) ImageRead 273 274 + Store 272(storeTemp) 275 + 277: 7(ivec4) Load 272(storeTemp) + 278: 7(ivec4) CompositeConstruct 276 276 276 276 + 279: 7(ivec4) BitwiseOr 277 278 + Store 272(storeTemp) 279 + 280: 87 Load 89(g_tTex1di4) + 281: 6(int) Load 269(coordTemp) + 282: 7(ivec4) Load 272(storeTemp) + ImageWrite 280 281 282 + 284: 77(ptr) AccessChain 65 55 + 285: 6(int) Load 284 + Store 283(coordTemp) 285 + 287: 87 Load 89(g_tTex1di4) + 288: 6(int) Load 283(coordTemp) + 289: 7(ivec4) ImageRead 287 288 + Store 286(storeTemp) 289 + 290: 7(ivec4) Load 286(storeTemp) + 291: 7(ivec4) CompositeConstruct 133 133 133 133 + 292: 7(ivec4) ShiftLeftLogical 290 291 + Store 286(storeTemp) 292 + 293: 87 Load 89(g_tTex1di4) + 294: 6(int) Load 283(coordTemp) + 295: 7(ivec4) Load 286(storeTemp) + ImageWrite 293 294 295 + 297: 77(ptr) AccessChain 65 55 + 298: 6(int) Load 297 + Store 296(coordTemp) 298 + 300: 87 Load 89(g_tTex1di4) + 301: 6(int) Load 296(coordTemp) + 302: 7(ivec4) ImageRead 300 301 + Store 299(storeTemp) 302 + 303: 7(ivec4) Load 299(storeTemp) + 304: 7(ivec4) CompositeConstruct 133 133 133 133 + 305: 7(ivec4) ShiftRightArithmetic 303 304 + Store 299(storeTemp) 305 + 306: 87 Load 89(g_tTex1di4) + 307: 6(int) Load 296(coordTemp) + 308: 7(ivec4) Load 299(storeTemp) + ImageWrite 306 307 308 + 310: 21(fvec4) FunctionCall 40(SomeValue() + Store 309(storeTemp) 310 + 311: 103 Load 105(g_tTex2df4) + 312: 108(ptr) AccessChain 65 107 + 313: 61(ivec2) Load 312 + 314: 21(fvec4) Load 309(storeTemp) + ImageWrite 311 313 314 + 315: 103 Load 105(g_tTex2df4) + 316: 108(ptr) AccessChain 65 107 + 317: 61(ivec2) Load 316 + 318: 21(fvec4) Load 154(lf4) + ImageWrite 315 317 318 + Store 319(storeTemp) 321 + 322: 113 Load 115(g_tTex2di4) + 323: 108(ptr) AccessChain 65 107 + 324: 61(ivec2) Load 323 + 325: 7(ivec4) Load 319(storeTemp) + ImageWrite 322 324 325 + Store 326(storeTemp) 328 + 329: 121 Load 123(g_tTex2du4) + 330: 108(ptr) AccessChain 65 107 + 331: 61(ivec2) Load 330 + 332: 14(ivec4) Load 326(storeTemp) + ImageWrite 329 331 332 + 334: 21(fvec4) FunctionCall 40(SomeValue() + Store 333(storeTemp) 334 + 335: 129 Load 131(g_tTex3df4) + 336: 134(ptr) AccessChain 65 133 + 337: 62(ivec3) Load 336 + 338: 21(fvec4) Load 333(storeTemp) + ImageWrite 335 337 338 + 339: 129 Load 131(g_tTex3df4) + 340: 134(ptr) AccessChain 65 133 + 341: 62(ivec3) Load 340 + 342: 21(fvec4) Load 154(lf4) + ImageWrite 339 341 342 + Store 343(storeTemp) 346 + 347: 139 Load 141(g_tTex3di4) + 348: 134(ptr) AccessChain 65 133 + 349: 62(ivec3) Load 348 + 350: 7(ivec4) Load 343(storeTemp) + ImageWrite 347 349 350 + Store 351(storeTemp) 353 + 354: 147 Load 149(g_tTex3du4) + 355: 134(ptr) AccessChain 65 133 + 356: 62(ivec3) Load 355 + 357: 14(ivec4) Load 351(storeTemp) + ImageWrite 354 356 357 + 358: 73 Load 75(g_tTex1df4) + 359: 77(ptr) AccessChain 65 55 + 360: 6(int) Load 359 + 361: 21(fvec4) ImageRead 358 360 + Store 362(param) 361 + 363: 21(fvec4) FunctionCall 25(Fn1(vf4;) 362(param) + 364: 87 Load 89(g_tTex1di4) + 365: 77(ptr) AccessChain 65 55 + 366: 6(int) Load 365 + 367: 7(ivec4) ImageRead 364 366 + Store 368(param) 367 + 369: 7(ivec4) FunctionCall 11(Fn1(vi4;) 368(param) + 370: 95 Load 97(g_tTex1du4) + 371: 77(ptr) AccessChain 65 55 + 372: 6(int) Load 371 + 373: 14(ivec4) ImageRead 370 372 + Store 374(param) 373 + 375: 14(ivec4) FunctionCall 18(Fn1(vu4;) 374(param) + 378: 2 FunctionCall 37(Fn2(vf4;) 377(param) + 379: 21(fvec4) Load 377(param) + Store 376(tempArg) 379 + 380: 73 Load 75(g_tTex1df4) + 381: 77(ptr) AccessChain 65 55 + 382: 6(int) Load 381 + 383: 21(fvec4) Load 376(tempArg) + ImageWrite 380 382 383 + 386: 2 FunctionCall 29(Fn2(vi4;) 385(param) + 387: 7(ivec4) Load 385(param) + Store 384(tempArg) 387 + 388: 87 Load 89(g_tTex1di4) + 389: 77(ptr) AccessChain 65 55 + 390: 6(int) Load 389 + 391: 7(ivec4) Load 384(tempArg) + ImageWrite 388 390 391 + 394: 2 FunctionCall 33(Fn2(vu4;) 393(param) + 395: 14(ivec4) Load 393(param) + Store 392(tempArg) 395 + 396: 95 Load 97(g_tTex1du4) + 397: 77(ptr) AccessChain 65 55 + 398: 6(int) Load 397 + 399: 14(ivec4) Load 392(tempArg) + ImageWrite 396 398 399 + 401: 77(ptr) AccessChain 65 55 + 402: 6(int) Load 401 + Store 400(coordTemp) 402 + 404: 73 Load 75(g_tTex1df4) + 405: 6(int) Load 400(coordTemp) + 406: 21(fvec4) ImageRead 404 405 + Store 403(storeTemp) 406 + 407: 21(fvec4) Load 403(storeTemp) + 409: 21(fvec4) CompositeConstruct 408 408 408 408 + 410: 21(fvec4) FAdd 407 409 + Store 403(storeTemp) 410 + 411: 73 Load 75(g_tTex1df4) + 412: 6(int) Load 400(coordTemp) + 413: 21(fvec4) Load 403(storeTemp) + ImageWrite 411 412 413 + 415: 77(ptr) AccessChain 65 55 + 416: 6(int) Load 415 + Store 414(coordTemp) 416 + 418: 87 Load 89(g_tTex1di4) + 419: 6(int) Load 414(coordTemp) + 420: 7(ivec4) ImageRead 418 419 + Store 417(storeTemp) 420 + 421: 7(ivec4) Load 417(storeTemp) + 422: 7(ivec4) CompositeConstruct 107 107 107 107 + 423: 7(ivec4) IAdd 421 422 + Store 417(storeTemp) 423 + 424: 87 Load 89(g_tTex1di4) + 425: 6(int) Load 414(coordTemp) + 426: 7(ivec4) Load 417(storeTemp) + ImageWrite 424 425 426 + 428: 77(ptr) AccessChain 65 55 + 429: 6(int) Load 428 + Store 427(coordTemp) 429 + 431: 95 Load 97(g_tTex1du4) + 432: 6(int) Load 427(coordTemp) + 433: 14(ivec4) ImageRead 431 432 + Store 430(storeTemp) 433 + 434: 14(ivec4) Load 430(storeTemp) + 435: 7(ivec4) CompositeConstruct 107 107 107 107 + 436: 14(ivec4) IAdd 434 435 + Store 430(storeTemp) 436 + 437: 95 Load 97(g_tTex1du4) + 438: 6(int) Load 427(coordTemp) + 439: 14(ivec4) Load 430(storeTemp) + ImageWrite 437 438 439 + 441: 77(ptr) AccessChain 65 55 + 442: 6(int) Load 441 + Store 440(coordTemp) 442 + 444: 73 Load 75(g_tTex1df4) + 445: 6(int) Load 440(coordTemp) + 446: 21(fvec4) ImageRead 444 445 + Store 443(storeTemp) 446 + 447: 21(fvec4) Load 443(storeTemp) + 448: 21(fvec4) CompositeConstruct 408 408 408 408 + 449: 21(fvec4) FSub 447 448 + Store 443(storeTemp) 449 + 450: 73 Load 75(g_tTex1df4) + 451: 6(int) Load 440(coordTemp) + 452: 21(fvec4) Load 443(storeTemp) + ImageWrite 450 451 452 + 454: 77(ptr) AccessChain 65 55 + 455: 6(int) Load 454 + Store 453(coordTemp) 455 + 457: 87 Load 89(g_tTex1di4) + 458: 6(int) Load 453(coordTemp) + 459: 7(ivec4) ImageRead 457 458 + Store 456(storeTemp) 459 + 460: 7(ivec4) Load 456(storeTemp) + 461: 7(ivec4) CompositeConstruct 107 107 107 107 + 462: 7(ivec4) ISub 460 461 + Store 456(storeTemp) 462 + 463: 87 Load 89(g_tTex1di4) + 464: 6(int) Load 453(coordTemp) + 465: 7(ivec4) Load 456(storeTemp) + ImageWrite 463 464 465 + 467: 77(ptr) AccessChain 65 55 + 468: 6(int) Load 467 + Store 466(coordTemp) 468 + 470: 95 Load 97(g_tTex1du4) + 471: 6(int) Load 466(coordTemp) + 472: 14(ivec4) ImageRead 470 471 + Store 469(storeTemp) 472 + 473: 14(ivec4) Load 469(storeTemp) + 474: 7(ivec4) CompositeConstruct 107 107 107 107 + 475: 14(ivec4) ISub 473 474 + Store 469(storeTemp) 475 + 476: 95 Load 97(g_tTex1du4) + 477: 6(int) Load 466(coordTemp) + 478: 14(ivec4) Load 469(storeTemp) + ImageWrite 476 477 478 + 480: 77(ptr) AccessChain 65 55 + 481: 6(int) Load 480 + Store 479(coordTemp) 481 + 483: 73 Load 75(g_tTex1df4) + 484: 6(int) Load 479(coordTemp) + 485: 21(fvec4) ImageRead 483 484 + Store 482(storeTempPre) 485 + 487: 21(fvec4) Load 482(storeTempPre) + Store 486(storeTempPost) 487 + 488: 21(fvec4) Load 486(storeTempPost) + 489: 21(fvec4) CompositeConstruct 408 408 408 408 + 490: 21(fvec4) FAdd 488 489 + Store 486(storeTempPost) 490 + 491: 73 Load 75(g_tTex1df4) + 492: 6(int) Load 479(coordTemp) + 493: 21(fvec4) Load 486(storeTempPost) + ImageWrite 491 492 493 + 495: 77(ptr) AccessChain 65 55 + 496: 6(int) Load 495 + Store 494(coordTemp) 496 + 498: 95 Load 97(g_tTex1du4) + 499: 6(int) Load 494(coordTemp) + 500: 14(ivec4) ImageRead 498 499 + Store 497(storeTempPre) 500 + 502: 14(ivec4) Load 497(storeTempPre) + Store 501(storeTempPost) 502 + 503: 14(ivec4) Load 501(storeTempPost) + 504: 7(ivec4) CompositeConstruct 107 107 107 107 + 505: 14(ivec4) ISub 503 504 + Store 501(storeTempPost) 505 + 506: 95 Load 97(g_tTex1du4) + 507: 6(int) Load 494(coordTemp) + 508: 14(ivec4) Load 501(storeTempPost) + ImageWrite 506 507 508 + 510: 77(ptr) AccessChain 65 55 + 511: 6(int) Load 510 + Store 509(coordTemp) 511 + 513: 87 Load 89(g_tTex1di4) + 514: 6(int) Load 509(coordTemp) + 515: 7(ivec4) ImageRead 513 514 + Store 512(storeTempPre) 515 + 517: 7(ivec4) Load 512(storeTempPre) + Store 516(storeTempPost) 517 + 518: 7(ivec4) Load 516(storeTempPost) + 519: 7(ivec4) CompositeConstruct 107 107 107 107 + 520: 7(ivec4) IAdd 518 519 + Store 516(storeTempPost) 520 + 521: 87 Load 89(g_tTex1di4) + 522: 6(int) Load 509(coordTemp) + 523: 7(ivec4) Load 516(storeTempPost) + ImageWrite 521 522 523 + 525: 77(ptr) AccessChain 65 55 + 526: 6(int) Load 525 + Store 524(coordTemp) 526 + 528: 73 Load 75(g_tTex1df4) + 529: 6(int) Load 524(coordTemp) + 530: 21(fvec4) ImageRead 528 529 + Store 527(storeTempPre) 530 + 532: 21(fvec4) Load 527(storeTempPre) + Store 531(storeTempPost) 532 + 533: 21(fvec4) Load 531(storeTempPost) + 534: 21(fvec4) CompositeConstruct 408 408 408 408 + 535: 21(fvec4) FSub 533 534 + Store 531(storeTempPost) 535 + 536: 73 Load 75(g_tTex1df4) + 537: 6(int) Load 524(coordTemp) + 538: 21(fvec4) Load 531(storeTempPost) + ImageWrite 536 537 538 + 540: 77(ptr) AccessChain 65 55 + 541: 6(int) Load 540 + Store 539(coordTemp) 541 + 543: 87 Load 89(g_tTex1di4) + 544: 6(int) Load 539(coordTemp) + 545: 7(ivec4) ImageRead 543 544 + Store 542(storeTempPre) 545 + 547: 7(ivec4) Load 542(storeTempPre) + Store 546(storeTempPost) 547 + 548: 7(ivec4) Load 546(storeTempPost) + 549: 7(ivec4) CompositeConstruct 107 107 107 107 + 550: 7(ivec4) IAdd 548 549 + Store 546(storeTempPost) 550 + 551: 87 Load 89(g_tTex1di4) + 552: 6(int) Load 539(coordTemp) + 553: 7(ivec4) Load 546(storeTempPost) + ImageWrite 551 552 553 + 555: 77(ptr) AccessChain 65 55 + 556: 6(int) Load 555 + Store 554(coordTemp) 556 + 558: 95 Load 97(g_tTex1du4) + 559: 6(int) Load 554(coordTemp) + 560: 14(ivec4) ImageRead 558 559 + Store 557(storeTempPre) 560 + 562: 14(ivec4) Load 557(storeTempPre) + Store 561(storeTempPost) 562 + 563: 14(ivec4) Load 561(storeTempPost) + 564: 7(ivec4) CompositeConstruct 107 107 107 107 + 565: 14(ivec4) ISub 563 564 + Store 561(storeTempPost) 565 + 566: 95 Load 97(g_tTex1du4) + 567: 6(int) Load 554(coordTemp) + 568: 14(ivec4) Load 561(storeTempPost) + ImageWrite 566 567 568 + 570: 103 Load 105(g_tTex2df4) + 572: 21(fvec4) ImageRead 570 571 + Store 569(storeTemp) 572 + 573: 73 Load 75(g_tTex1df4) + 574: 21(fvec4) Load 569(storeTemp) + ImageWrite 573 107 574 + 578: 22(ptr) AccessChain 576(psout) 55 + Store 578 577 + 579:42(PS_OUTPUT) Load 576(psout) + ReturnValue 579 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.rw.register.frag.out b/deps/glslang/Test/baseResults/hlsl.rw.register.frag.out new file mode 100644 index 00000000..01f6c89c --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.rw.register.frag.out @@ -0,0 +1,172 @@ +hlsl.rw.register.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:11 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:11 Function Parameters: +0:? Sequence +0:12 Sequence +0:12 move second child to first child ( temp float) +0:12 'r00' ( temp float) +0:12 imageLoad ( temp float) +0:12 'g_tTex1df1' (layout( binding=2 r32f) uniform image1D) +0:12 Constant: +0:12 0 (const int) +0:13 Sequence +0:13 move second child to first child ( temp uint) +0:13 'r01' ( temp uint) +0:13 imageLoad ( temp uint) +0:13 'g_tBuf1du1' (layout( binding=3 r32ui) uniform uimageBuffer) +0:13 Constant: +0:13 0 (const int) +0:16 move second child to first child ( temp 4-component vector of float) +0:16 Color: direct index for structure ( temp 4-component vector of float) +0:16 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1.000000 +0:16 1.000000 +0:16 1.000000 +0:16 1.000000 +0:17 Branch: Return with expression +0:17 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:11 Function Definition: main( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:11 Color: direct index for structure ( temp 4-component vector of float) +0:11 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:11 Constant: +0:11 0 (const int) +0:? Linker Objects +0:? 'g_tTex1df1' (layout( binding=2 r32f) uniform image1D) +0:? 'g_tBuf1du1' (layout( binding=3 r32ui) uniform uimageBuffer) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:11 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:11 Function Parameters: +0:? Sequence +0:12 Sequence +0:12 move second child to first child ( temp float) +0:12 'r00' ( temp float) +0:12 imageLoad ( temp float) +0:12 'g_tTex1df1' (layout( binding=2 r32f) uniform image1D) +0:12 Constant: +0:12 0 (const int) +0:13 Sequence +0:13 move second child to first child ( temp uint) +0:13 'r01' ( temp uint) +0:13 imageLoad ( temp uint) +0:13 'g_tBuf1du1' (layout( binding=3 r32ui) uniform uimageBuffer) +0:13 Constant: +0:13 0 (const int) +0:16 move second child to first child ( temp 4-component vector of float) +0:16 Color: direct index for structure ( temp 4-component vector of float) +0:16 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1.000000 +0:16 1.000000 +0:16 1.000000 +0:16 1.000000 +0:17 Branch: Return with expression +0:17 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:11 Function Definition: main( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:11 Color: direct index for structure ( temp 4-component vector of float) +0:11 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:11 Constant: +0:11 0 (const int) +0:? Linker Objects +0:? 'g_tTex1df1' (layout( binding=2 r32f) uniform image1D) +0:? 'g_tBuf1du1' (layout( binding=3 r32ui) uniform uimageBuffer) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 42 + + Capability Shader + Capability Image1D + Capability ImageBuffer + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 39 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + Name 10 "@main(" + Name 13 "r00" + Name 16 "g_tTex1df1" + Name 23 "r01" + Name 26 "g_tBuf1du1" + Name 30 "psout" + Name 39 "@entryPointOutput.Color" + Decorate 16(g_tTex1df1) DescriptorSet 0 + Decorate 16(g_tTex1df1) Binding 2 + Decorate 26(g_tBuf1du1) DescriptorSet 0 + Decorate 26(g_tBuf1du1) Binding 3 + Decorate 39(@entryPointOutput.Color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 6(float) + 14: TypeImage 6(float) 1D nonsampled format:R32f + 15: TypePointer UniformConstant 14 + 16(g_tTex1df1): 15(ptr) Variable UniformConstant + 18: TypeInt 32 1 + 19: 18(int) Constant 0 + 21: TypeInt 32 0 + 22: TypePointer Function 21(int) + 24: TypeImage 21(int) Buffer nonsampled format:R32ui + 25: TypePointer UniformConstant 24 + 26(g_tBuf1du1): 25(ptr) Variable UniformConstant + 29: TypePointer Function 8(PS_OUTPUT) + 31: 6(float) Constant 1065353216 + 32: 7(fvec4) ConstantComposite 31 31 31 31 + 33: TypePointer Function 7(fvec4) + 38: TypePointer Output 7(fvec4) +39(@entryPointOutput.Color): 38(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 40:8(PS_OUTPUT) FunctionCall 10(@main() + 41: 7(fvec4) CompositeExtract 40 0 + Store 39(@entryPointOutput.Color) 41 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(r00): 12(ptr) Variable Function + 23(r01): 22(ptr) Variable Function + 30(psout): 29(ptr) Variable Function + 17: 14 Load 16(g_tTex1df1) + 20: 6(float) ImageRead 17 19 + Store 13(r00) 20 + 27: 24 Load 26(g_tBuf1du1) + 28: 21(int) ImageRead 27 19 + Store 23(r01) 28 + 34: 33(ptr) AccessChain 30(psout) 19 + Store 34 32 + 35:8(PS_OUTPUT) Load 30(psout) + ReturnValue 35 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out b/deps/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out new file mode 100644 index 00000000..7fc26cc7 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out @@ -0,0 +1,2574 @@ +hlsl.rw.scalar.bracket.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:42 Function Definition: Fn1(i1; ( temp int) +0:42 Function Parameters: +0:42 'x' ( in int) +0:? Sequence +0:42 Branch: Return with expression +0:42 'x' ( in int) +0:43 Function Definition: Fn1(u1; ( temp uint) +0:43 Function Parameters: +0:43 'x' ( in uint) +0:? Sequence +0:43 Branch: Return with expression +0:43 'x' ( in uint) +0:44 Function Definition: Fn1(f1; ( temp float) +0:44 Function Parameters: +0:44 'x' ( in float) +0:? Sequence +0:44 Branch: Return with expression +0:44 'x' ( in float) +0:46 Function Definition: Fn2(i1; ( temp void) +0:46 Function Parameters: +0:46 'x' ( out int) +0:? Sequence +0:46 move second child to first child ( temp int) +0:46 'x' ( out int) +0:46 Constant: +0:46 0 (const int) +0:47 Function Definition: Fn2(u1; ( temp void) +0:47 Function Parameters: +0:47 'x' ( out uint) +0:? Sequence +0:47 move second child to first child ( temp uint) +0:47 'x' ( out uint) +0:47 Constant: +0:47 0 (const uint) +0:48 Function Definition: Fn2(f1; ( temp void) +0:48 Function Parameters: +0:48 'x' ( out float) +0:? Sequence +0:48 move second child to first child ( temp float) +0:48 'x' ( out float) +0:48 Constant: +0:48 0.000000 +0:50 Function Definition: SomeValue( ( temp float) +0:50 Function Parameters: +0:? Sequence +0:50 Branch: Return with expression +0:50 Convert int to float ( temp float) +0:50 c1: direct index for structure ( uniform int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:50 Constant: +0:50 0 (const uint) +0:53 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:53 Function Parameters: +0:? Sequence +0:57 imageLoad ( temp float) +0:57 'g_tTex1df1' (layout( r32f) uniform image1D) +0:57 c1: direct index for structure ( uniform int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:57 Constant: +0:57 0 (const uint) +0:59 Sequence +0:59 move second child to first child ( temp float) +0:59 'r00' ( temp float) +0:59 imageLoad ( temp float) +0:59 'g_tTex1df1' (layout( r32f) uniform image1D) +0:59 c1: direct index for structure ( uniform int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:59 Constant: +0:59 0 (const uint) +0:60 Sequence +0:60 move second child to first child ( temp int) +0:60 'r01' ( temp int) +0:60 imageLoad ( temp int) +0:60 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:60 c1: direct index for structure ( uniform int) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:60 Constant: +0:60 0 (const uint) +0:61 Sequence +0:61 move second child to first child ( temp uint) +0:61 'r02' ( temp uint) +0:61 imageLoad ( temp uint) +0:61 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:61 c1: direct index for structure ( uniform int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:61 Constant: +0:61 0 (const uint) +0:64 Sequence +0:64 move second child to first child ( temp float) +0:64 'r10' ( temp float) +0:64 imageLoad ( temp float) +0:64 'g_tTex2df1' (layout( r32f) uniform image2D) +0:64 c2: direct index for structure ( uniform 2-component vector of int) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:64 Constant: +0:64 1 (const uint) +0:65 Sequence +0:65 move second child to first child ( temp int) +0:65 'r11' ( temp int) +0:65 imageLoad ( temp int) +0:65 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:65 c2: direct index for structure ( uniform 2-component vector of int) +0:65 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:65 Constant: +0:65 1 (const uint) +0:66 Sequence +0:66 move second child to first child ( temp uint) +0:66 'r12' ( temp uint) +0:66 imageLoad ( temp uint) +0:66 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:66 c2: direct index for structure ( uniform 2-component vector of int) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:66 Constant: +0:66 1 (const uint) +0:69 Sequence +0:69 move second child to first child ( temp float) +0:69 'r20' ( temp float) +0:69 imageLoad ( temp float) +0:69 'g_tTex3df1' (layout( r32f) uniform image3D) +0:69 c3: direct index for structure ( uniform 3-component vector of int) +0:69 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:69 Constant: +0:69 2 (const uint) +0:70 Sequence +0:70 move second child to first child ( temp int) +0:70 'r21' ( temp int) +0:70 imageLoad ( temp int) +0:70 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:70 c3: direct index for structure ( uniform 3-component vector of int) +0:70 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:70 Constant: +0:70 2 (const uint) +0:71 Sequence +0:71 move second child to first child ( temp uint) +0:71 'r22' ( temp uint) +0:71 imageLoad ( temp uint) +0:71 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:71 c3: direct index for structure ( uniform 3-component vector of int) +0:71 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:71 Constant: +0:71 2 (const uint) +0:73 Sequence +0:73 move second child to first child ( temp float) +0:73 'lf1' ( temp float) +0:73 uf1: direct index for structure ( uniform float) +0:73 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:73 Constant: +0:73 8 (const uint) +0:77 Sequence +0:77 move second child to first child ( temp float) +0:77 'storeTemp' ( temp float) +0:77 Function Call: SomeValue( ( temp float) +0:77 imageStore ( temp void) +0:77 'g_tTex1df1' (layout( r32f) uniform image1D) +0:77 c1: direct index for structure ( uniform int) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:77 Constant: +0:77 0 (const uint) +0:77 'storeTemp' ( temp float) +0:77 'storeTemp' ( temp float) +0:78 Sequence +0:78 imageStore ( temp void) +0:78 'g_tTex1df1' (layout( r32f) uniform image1D) +0:78 c1: direct index for structure ( uniform int) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:78 Constant: +0:78 0 (const uint) +0:78 'lf1' ( temp float) +0:78 'lf1' ( temp float) +0:79 Sequence +0:79 move second child to first child ( temp int) +0:79 'storeTemp' ( temp int) +0:79 Constant: +0:79 2 (const int) +0:79 imageStore ( temp void) +0:79 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:79 c1: direct index for structure ( uniform int) +0:79 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:79 Constant: +0:79 0 (const uint) +0:79 'storeTemp' ( temp int) +0:79 'storeTemp' ( temp int) +0:80 Sequence +0:80 move second child to first child ( temp uint) +0:80 'storeTemp' ( temp uint) +0:80 Constant: +0:80 3 (const uint) +0:80 imageStore ( temp void) +0:80 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:80 c1: direct index for structure ( uniform int) +0:80 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:80 Constant: +0:80 0 (const uint) +0:80 'storeTemp' ( temp uint) +0:80 'storeTemp' ( temp uint) +0:83 Sequence +0:83 move second child to first child ( temp float) +0:83 'val1' ( temp float) +0:83 Sequence +0:83 move second child to first child ( temp int) +0:83 'coordTemp' ( temp int) +0:83 c1: direct index for structure ( uniform int) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:83 Constant: +0:83 0 (const uint) +0:83 move second child to first child ( temp float) +0:83 'storeTemp' ( temp float) +0:83 imageLoad ( temp float) +0:83 'g_tTex1df1' (layout( r32f) uniform image1D) +0:83 'coordTemp' ( temp int) +0:83 multiply second child into first child ( temp float) +0:83 'storeTemp' ( temp float) +0:83 Constant: +0:83 2.000000 +0:83 imageStore ( temp void) +0:83 'g_tTex1df1' (layout( r32f) uniform image1D) +0:83 'coordTemp' ( temp int) +0:83 'storeTemp' ( temp float) +0:83 'storeTemp' ( temp float) +0:84 Sequence +0:84 move second child to first child ( temp int) +0:84 'coordTemp' ( temp int) +0:84 c1: direct index for structure ( uniform int) +0:84 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:84 Constant: +0:84 0 (const uint) +0:84 move second child to first child ( temp float) +0:84 'storeTemp' ( temp float) +0:84 imageLoad ( temp float) +0:84 'g_tTex1df1' (layout( r32f) uniform image1D) +0:84 'coordTemp' ( temp int) +0:84 subtract second child into first child ( temp float) +0:84 'storeTemp' ( temp float) +0:84 Constant: +0:84 3.000000 +0:84 imageStore ( temp void) +0:84 'g_tTex1df1' (layout( r32f) uniform image1D) +0:84 'coordTemp' ( temp int) +0:84 'storeTemp' ( temp float) +0:84 'storeTemp' ( temp float) +0:85 Sequence +0:85 move second child to first child ( temp int) +0:85 'coordTemp' ( temp int) +0:85 c1: direct index for structure ( uniform int) +0:85 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:85 Constant: +0:85 0 (const uint) +0:85 move second child to first child ( temp float) +0:85 'storeTemp' ( temp float) +0:85 imageLoad ( temp float) +0:85 'g_tTex1df1' (layout( r32f) uniform image1D) +0:85 'coordTemp' ( temp int) +0:85 add second child into first child ( temp float) +0:85 'storeTemp' ( temp float) +0:85 Constant: +0:85 4.000000 +0:85 imageStore ( temp void) +0:85 'g_tTex1df1' (layout( r32f) uniform image1D) +0:85 'coordTemp' ( temp int) +0:85 'storeTemp' ( temp float) +0:85 'storeTemp' ( temp float) +0:87 Sequence +0:87 move second child to first child ( temp int) +0:87 'coordTemp' ( temp int) +0:87 c1: direct index for structure ( uniform int) +0:87 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:87 Constant: +0:87 0 (const uint) +0:87 move second child to first child ( temp int) +0:87 'storeTemp' ( temp int) +0:87 imageLoad ( temp int) +0:87 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:87 'coordTemp' ( temp int) +0:87 divide second child into first child ( temp int) +0:87 'storeTemp' ( temp int) +0:87 Constant: +0:87 2 (const int) +0:87 imageStore ( temp void) +0:87 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:87 'coordTemp' ( temp int) +0:87 'storeTemp' ( temp int) +0:87 'storeTemp' ( temp int) +0:88 Sequence +0:88 move second child to first child ( temp int) +0:88 'coordTemp' ( temp int) +0:88 c1: direct index for structure ( uniform int) +0:88 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:88 Constant: +0:88 0 (const uint) +0:88 move second child to first child ( temp int) +0:88 'storeTemp' ( temp int) +0:88 imageLoad ( temp int) +0:88 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:88 'coordTemp' ( temp int) +0:88 mod second child into first child ( temp int) +0:88 'storeTemp' ( temp int) +0:88 Constant: +0:88 2 (const int) +0:88 imageStore ( temp void) +0:88 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:88 'coordTemp' ( temp int) +0:88 'storeTemp' ( temp int) +0:88 'storeTemp' ( temp int) +0:89 Sequence +0:89 move second child to first child ( temp int) +0:89 'coordTemp' ( temp int) +0:89 c1: direct index for structure ( uniform int) +0:89 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:89 Constant: +0:89 0 (const uint) +0:89 move second child to first child ( temp int) +0:89 'storeTemp' ( temp int) +0:89 imageLoad ( temp int) +0:89 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:89 'coordTemp' ( temp int) +0:89 and second child into first child ( temp int) +0:89 'storeTemp' ( temp int) +0:89 Constant: +0:89 65535 (const int) +0:89 imageStore ( temp void) +0:89 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:89 'coordTemp' ( temp int) +0:89 'storeTemp' ( temp int) +0:89 'storeTemp' ( temp int) +0:90 Sequence +0:90 move second child to first child ( temp int) +0:90 'coordTemp' ( temp int) +0:90 c1: direct index for structure ( uniform int) +0:90 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:90 Constant: +0:90 0 (const uint) +0:90 move second child to first child ( temp int) +0:90 'storeTemp' ( temp int) +0:90 imageLoad ( temp int) +0:90 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:90 'coordTemp' ( temp int) +0:90 or second child into first child ( temp int) +0:90 'storeTemp' ( temp int) +0:90 Constant: +0:90 61680 (const int) +0:90 imageStore ( temp void) +0:90 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:90 'coordTemp' ( temp int) +0:90 'storeTemp' ( temp int) +0:90 'storeTemp' ( temp int) +0:91 Sequence +0:91 move second child to first child ( temp int) +0:91 'coordTemp' ( temp int) +0:91 c1: direct index for structure ( uniform int) +0:91 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:91 Constant: +0:91 0 (const uint) +0:91 move second child to first child ( temp int) +0:91 'storeTemp' ( temp int) +0:91 imageLoad ( temp int) +0:91 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:91 'coordTemp' ( temp int) +0:91 left shift second child into first child ( temp int) +0:91 'storeTemp' ( temp int) +0:91 Constant: +0:91 2 (const int) +0:91 imageStore ( temp void) +0:91 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:91 'coordTemp' ( temp int) +0:91 'storeTemp' ( temp int) +0:91 'storeTemp' ( temp int) +0:92 Sequence +0:92 move second child to first child ( temp int) +0:92 'coordTemp' ( temp int) +0:92 c1: direct index for structure ( uniform int) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:92 Constant: +0:92 0 (const uint) +0:92 move second child to first child ( temp int) +0:92 'storeTemp' ( temp int) +0:92 imageLoad ( temp int) +0:92 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:92 'coordTemp' ( temp int) +0:92 right shift second child into first child ( temp int) +0:92 'storeTemp' ( temp int) +0:92 Constant: +0:92 2 (const int) +0:92 imageStore ( temp void) +0:92 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:92 'coordTemp' ( temp int) +0:92 'storeTemp' ( temp int) +0:92 'storeTemp' ( temp int) +0:95 Sequence +0:95 move second child to first child ( temp float) +0:95 'storeTemp' ( temp float) +0:95 Function Call: SomeValue( ( temp float) +0:95 imageStore ( temp void) +0:95 'g_tTex2df1' (layout( r32f) uniform image2D) +0:95 c2: direct index for structure ( uniform 2-component vector of int) +0:95 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:95 Constant: +0:95 1 (const uint) +0:95 'storeTemp' ( temp float) +0:95 'storeTemp' ( temp float) +0:96 Sequence +0:96 imageStore ( temp void) +0:96 'g_tTex2df1' (layout( r32f) uniform image2D) +0:96 c2: direct index for structure ( uniform 2-component vector of int) +0:96 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:96 Constant: +0:96 1 (const uint) +0:96 'lf1' ( temp float) +0:96 'lf1' ( temp float) +0:97 Sequence +0:97 move second child to first child ( temp int) +0:97 'storeTemp' ( temp int) +0:97 Constant: +0:97 5 (const int) +0:97 imageStore ( temp void) +0:97 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:97 c2: direct index for structure ( uniform 2-component vector of int) +0:97 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:97 Constant: +0:97 1 (const uint) +0:97 'storeTemp' ( temp int) +0:97 'storeTemp' ( temp int) +0:98 Sequence +0:98 move second child to first child ( temp uint) +0:98 'storeTemp' ( temp uint) +0:98 Constant: +0:98 6 (const uint) +0:98 imageStore ( temp void) +0:98 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:98 c2: direct index for structure ( uniform 2-component vector of int) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:98 Constant: +0:98 1 (const uint) +0:98 'storeTemp' ( temp uint) +0:98 'storeTemp' ( temp uint) +0:101 Sequence +0:101 move second child to first child ( temp float) +0:101 'storeTemp' ( temp float) +0:101 Function Call: SomeValue( ( temp float) +0:101 imageStore ( temp void) +0:101 'g_tTex3df1' (layout( r32f) uniform image3D) +0:101 c3: direct index for structure ( uniform 3-component vector of int) +0:101 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:101 Constant: +0:101 2 (const uint) +0:101 'storeTemp' ( temp float) +0:101 'storeTemp' ( temp float) +0:102 Sequence +0:102 imageStore ( temp void) +0:102 'g_tTex3df1' (layout( r32f) uniform image3D) +0:102 c3: direct index for structure ( uniform 3-component vector of int) +0:102 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:102 Constant: +0:102 2 (const uint) +0:102 'lf1' ( temp float) +0:102 'lf1' ( temp float) +0:103 Sequence +0:103 move second child to first child ( temp int) +0:103 'storeTemp' ( temp int) +0:103 Constant: +0:103 8 (const int) +0:103 imageStore ( temp void) +0:103 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:103 c3: direct index for structure ( uniform 3-component vector of int) +0:103 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:103 Constant: +0:103 2 (const uint) +0:103 'storeTemp' ( temp int) +0:103 'storeTemp' ( temp int) +0:104 Sequence +0:104 move second child to first child ( temp uint) +0:104 'storeTemp' ( temp uint) +0:104 Constant: +0:104 9 (const uint) +0:104 imageStore ( temp void) +0:104 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:104 c3: direct index for structure ( uniform 3-component vector of int) +0:104 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:104 Constant: +0:104 2 (const uint) +0:104 'storeTemp' ( temp uint) +0:104 'storeTemp' ( temp uint) +0:107 Function Call: Fn1(f1; ( temp float) +0:107 imageLoad ( temp float) +0:107 'g_tTex1df1' (layout( r32f) uniform image1D) +0:107 c1: direct index for structure ( uniform int) +0:107 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:107 Constant: +0:107 0 (const uint) +0:108 Function Call: Fn1(i1; ( temp int) +0:108 imageLoad ( temp int) +0:108 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:108 c1: direct index for structure ( uniform int) +0:108 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:108 Constant: +0:108 0 (const uint) +0:109 Function Call: Fn1(u1; ( temp uint) +0:109 imageLoad ( temp uint) +0:109 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:109 c1: direct index for structure ( uniform int) +0:109 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:109 Constant: +0:109 0 (const uint) +0:111 Comma ( temp void) +0:111 Function Call: Fn2(f1; ( temp void) +0:111 'tempArg' ( temp float) +0:111 Sequence +0:111 imageStore ( temp void) +0:111 'g_tTex1df1' (layout( r32f) uniform image1D) +0:111 c1: direct index for structure ( uniform int) +0:111 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:111 Constant: +0:111 0 (const uint) +0:111 'tempArg' ( temp float) +0:111 'tempArg' ( temp float) +0:112 Comma ( temp void) +0:112 Function Call: Fn2(i1; ( temp void) +0:112 'tempArg' ( temp int) +0:112 Sequence +0:112 imageStore ( temp void) +0:112 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:112 c1: direct index for structure ( uniform int) +0:112 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:112 Constant: +0:112 0 (const uint) +0:112 'tempArg' ( temp int) +0:112 'tempArg' ( temp int) +0:113 Comma ( temp void) +0:113 Function Call: Fn2(u1; ( temp void) +0:113 'tempArg' ( temp uint) +0:113 Sequence +0:113 imageStore ( temp void) +0:113 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:113 c1: direct index for structure ( uniform int) +0:113 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:113 Constant: +0:113 0 (const uint) +0:113 'tempArg' ( temp uint) +0:113 'tempArg' ( temp uint) +0:117 Sequence +0:117 move second child to first child ( temp int) +0:117 'coordTemp' ( temp int) +0:117 c1: direct index for structure ( uniform int) +0:117 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:117 Constant: +0:117 0 (const uint) +0:117 move second child to first child ( temp float) +0:117 'storeTemp' ( temp float) +0:117 imageLoad ( temp float) +0:117 'g_tTex1df1' (layout( r32f) uniform image1D) +0:117 'coordTemp' ( temp int) +0:117 Pre-Increment ( temp float) +0:117 'storeTemp' ( temp float) +0:117 imageStore ( temp void) +0:117 'g_tTex1df1' (layout( r32f) uniform image1D) +0:117 'coordTemp' ( temp int) +0:117 'storeTemp' ( temp float) +0:117 'storeTemp' ( temp float) +0:118 Sequence +0:118 move second child to first child ( temp int) +0:118 'coordTemp' ( temp int) +0:118 c1: direct index for structure ( uniform int) +0:118 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:118 Constant: +0:118 0 (const uint) +0:118 move second child to first child ( temp int) +0:118 'storeTemp' ( temp int) +0:118 imageLoad ( temp int) +0:118 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:118 'coordTemp' ( temp int) +0:118 Pre-Increment ( temp int) +0:118 'storeTemp' ( temp int) +0:118 imageStore ( temp void) +0:118 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:118 'coordTemp' ( temp int) +0:118 'storeTemp' ( temp int) +0:118 'storeTemp' ( temp int) +0:119 Sequence +0:119 move second child to first child ( temp int) +0:119 'coordTemp' ( temp int) +0:119 c1: direct index for structure ( uniform int) +0:119 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:119 Constant: +0:119 0 (const uint) +0:119 move second child to first child ( temp uint) +0:119 'storeTemp' ( temp uint) +0:119 imageLoad ( temp uint) +0:119 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:119 'coordTemp' ( temp int) +0:119 Pre-Increment ( temp uint) +0:119 'storeTemp' ( temp uint) +0:119 imageStore ( temp void) +0:119 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:119 'coordTemp' ( temp int) +0:119 'storeTemp' ( temp uint) +0:119 'storeTemp' ( temp uint) +0:121 Sequence +0:121 move second child to first child ( temp int) +0:121 'coordTemp' ( temp int) +0:121 c1: direct index for structure ( uniform int) +0:121 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:121 Constant: +0:121 0 (const uint) +0:121 move second child to first child ( temp float) +0:121 'storeTemp' ( temp float) +0:121 imageLoad ( temp float) +0:121 'g_tTex1df1' (layout( r32f) uniform image1D) +0:121 'coordTemp' ( temp int) +0:121 Pre-Decrement ( temp float) +0:121 'storeTemp' ( temp float) +0:121 imageStore ( temp void) +0:121 'g_tTex1df1' (layout( r32f) uniform image1D) +0:121 'coordTemp' ( temp int) +0:121 'storeTemp' ( temp float) +0:121 'storeTemp' ( temp float) +0:122 Sequence +0:122 move second child to first child ( temp int) +0:122 'coordTemp' ( temp int) +0:122 c1: direct index for structure ( uniform int) +0:122 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:122 Constant: +0:122 0 (const uint) +0:122 move second child to first child ( temp int) +0:122 'storeTemp' ( temp int) +0:122 imageLoad ( temp int) +0:122 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:122 'coordTemp' ( temp int) +0:122 Pre-Decrement ( temp int) +0:122 'storeTemp' ( temp int) +0:122 imageStore ( temp void) +0:122 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:122 'coordTemp' ( temp int) +0:122 'storeTemp' ( temp int) +0:122 'storeTemp' ( temp int) +0:123 Sequence +0:123 move second child to first child ( temp int) +0:123 'coordTemp' ( temp int) +0:123 c1: direct index for structure ( uniform int) +0:123 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:123 Constant: +0:123 0 (const uint) +0:123 move second child to first child ( temp uint) +0:123 'storeTemp' ( temp uint) +0:123 imageLoad ( temp uint) +0:123 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:123 'coordTemp' ( temp int) +0:123 Pre-Decrement ( temp uint) +0:123 'storeTemp' ( temp uint) +0:123 imageStore ( temp void) +0:123 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:123 'coordTemp' ( temp int) +0:123 'storeTemp' ( temp uint) +0:123 'storeTemp' ( temp uint) +0:126 Sequence +0:126 move second child to first child ( temp int) +0:126 'coordTemp' ( temp int) +0:126 c1: direct index for structure ( uniform int) +0:126 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:126 Constant: +0:126 0 (const uint) +0:126 move second child to first child ( temp float) +0:126 'storeTempPre' ( temp float) +0:126 imageLoad ( temp float) +0:126 'g_tTex1df1' (layout( r32f) uniform image1D) +0:126 'coordTemp' ( temp int) +0:126 move second child to first child ( temp float) +0:126 'storeTempPost' ( temp float) +0:126 'storeTempPre' ( temp float) +0:126 Post-Increment ( temp float) +0:126 'storeTempPost' ( temp float) +0:126 imageStore ( temp void) +0:126 'g_tTex1df1' (layout( r32f) uniform image1D) +0:126 'coordTemp' ( temp int) +0:126 'storeTempPost' ( temp float) +0:126 'storeTempPre' ( temp float) +0:127 Sequence +0:127 move second child to first child ( temp int) +0:127 'coordTemp' ( temp int) +0:127 c1: direct index for structure ( uniform int) +0:127 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:127 Constant: +0:127 0 (const uint) +0:127 move second child to first child ( temp uint) +0:127 'storeTempPre' ( temp uint) +0:127 imageLoad ( temp uint) +0:127 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:127 'coordTemp' ( temp int) +0:127 move second child to first child ( temp uint) +0:127 'storeTempPost' ( temp uint) +0:127 'storeTempPre' ( temp uint) +0:127 Post-Decrement ( temp uint) +0:127 'storeTempPost' ( temp uint) +0:127 imageStore ( temp void) +0:127 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:127 'coordTemp' ( temp int) +0:127 'storeTempPost' ( temp uint) +0:127 'storeTempPre' ( temp uint) +0:128 Sequence +0:128 move second child to first child ( temp int) +0:128 'coordTemp' ( temp int) +0:128 c1: direct index for structure ( uniform int) +0:128 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:128 Constant: +0:128 0 (const uint) +0:128 move second child to first child ( temp int) +0:128 'storeTempPre' ( temp int) +0:128 imageLoad ( temp int) +0:128 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:128 'coordTemp' ( temp int) +0:128 move second child to first child ( temp int) +0:128 'storeTempPost' ( temp int) +0:128 'storeTempPre' ( temp int) +0:128 Post-Increment ( temp int) +0:128 'storeTempPost' ( temp int) +0:128 imageStore ( temp void) +0:128 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:128 'coordTemp' ( temp int) +0:128 'storeTempPost' ( temp int) +0:128 'storeTempPre' ( temp int) +0:130 Sequence +0:130 move second child to first child ( temp int) +0:130 'coordTemp' ( temp int) +0:130 c1: direct index for structure ( uniform int) +0:130 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:130 Constant: +0:130 0 (const uint) +0:130 move second child to first child ( temp float) +0:130 'storeTempPre' ( temp float) +0:130 imageLoad ( temp float) +0:130 'g_tTex1df1' (layout( r32f) uniform image1D) +0:130 'coordTemp' ( temp int) +0:130 move second child to first child ( temp float) +0:130 'storeTempPost' ( temp float) +0:130 'storeTempPre' ( temp float) +0:130 Post-Decrement ( temp float) +0:130 'storeTempPost' ( temp float) +0:130 imageStore ( temp void) +0:130 'g_tTex1df1' (layout( r32f) uniform image1D) +0:130 'coordTemp' ( temp int) +0:130 'storeTempPost' ( temp float) +0:130 'storeTempPre' ( temp float) +0:131 Sequence +0:131 move second child to first child ( temp int) +0:131 'coordTemp' ( temp int) +0:131 c1: direct index for structure ( uniform int) +0:131 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:131 Constant: +0:131 0 (const uint) +0:131 move second child to first child ( temp int) +0:131 'storeTempPre' ( temp int) +0:131 imageLoad ( temp int) +0:131 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:131 'coordTemp' ( temp int) +0:131 move second child to first child ( temp int) +0:131 'storeTempPost' ( temp int) +0:131 'storeTempPre' ( temp int) +0:131 Post-Increment ( temp int) +0:131 'storeTempPost' ( temp int) +0:131 imageStore ( temp void) +0:131 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:131 'coordTemp' ( temp int) +0:131 'storeTempPost' ( temp int) +0:131 'storeTempPre' ( temp int) +0:132 Sequence +0:132 move second child to first child ( temp int) +0:132 'coordTemp' ( temp int) +0:132 c1: direct index for structure ( uniform int) +0:132 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:132 Constant: +0:132 0 (const uint) +0:132 move second child to first child ( temp uint) +0:132 'storeTempPre' ( temp uint) +0:132 imageLoad ( temp uint) +0:132 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:132 'coordTemp' ( temp int) +0:132 move second child to first child ( temp uint) +0:132 'storeTempPost' ( temp uint) +0:132 'storeTempPre' ( temp uint) +0:132 Post-Decrement ( temp uint) +0:132 'storeTempPost' ( temp uint) +0:132 imageStore ( temp void) +0:132 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:132 'coordTemp' ( temp int) +0:132 'storeTempPost' ( temp uint) +0:132 'storeTempPre' ( temp uint) +0:135 Sequence +0:135 move second child to first child ( temp float) +0:135 'storeTemp' ( temp float) +0:? imageLoad ( temp float) +0:135 'g_tTex2df1' (layout( r32f) uniform image2D) +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:135 imageStore ( temp void) +0:135 'g_tTex1df1' (layout( r32f) uniform image1D) +0:135 Constant: +0:135 1 (const int) +0:135 'storeTemp' ( temp float) +0:135 'storeTemp' ( temp float) +0:137 move second child to first child ( temp 4-component vector of float) +0:137 Color: direct index for structure ( temp 4-component vector of float) +0:137 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 1.000000 +0:137 1.000000 +0:137 1.000000 +0:137 1.000000 +0:139 Branch: Return with expression +0:139 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:53 Function Definition: main( ( temp void) +0:53 Function Parameters: +0:? Sequence +0:53 Sequence +0:53 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:53 Color: direct index for structure ( temp 4-component vector of float) +0:53 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:53 Constant: +0:53 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df1' (layout( r32f) uniform image1D) +0:? 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:? 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:? 'g_tTex2df1' (layout( r32f) uniform image2D) +0:? 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:? 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:? 'g_tTex3df1' (layout( r32f) uniform image3D) +0:? 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:? 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:? 'g_tTex1df1a' (layout( r32f) uniform image1DArray) +0:? 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:? 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:? 'g_tTex2df1a' (layout( r32f) uniform image2DArray) +0:? 'g_tTex2di1a' (layout( r32i) uniform iimage2DArray) +0:? 'g_tTex2du1a' (layout( r32ui) uniform uimage2DArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:42 Function Definition: Fn1(i1; ( temp int) +0:42 Function Parameters: +0:42 'x' ( in int) +0:? Sequence +0:42 Branch: Return with expression +0:42 'x' ( in int) +0:43 Function Definition: Fn1(u1; ( temp uint) +0:43 Function Parameters: +0:43 'x' ( in uint) +0:? Sequence +0:43 Branch: Return with expression +0:43 'x' ( in uint) +0:44 Function Definition: Fn1(f1; ( temp float) +0:44 Function Parameters: +0:44 'x' ( in float) +0:? Sequence +0:44 Branch: Return with expression +0:44 'x' ( in float) +0:46 Function Definition: Fn2(i1; ( temp void) +0:46 Function Parameters: +0:46 'x' ( out int) +0:? Sequence +0:46 move second child to first child ( temp int) +0:46 'x' ( out int) +0:46 Constant: +0:46 0 (const int) +0:47 Function Definition: Fn2(u1; ( temp void) +0:47 Function Parameters: +0:47 'x' ( out uint) +0:? Sequence +0:47 move second child to first child ( temp uint) +0:47 'x' ( out uint) +0:47 Constant: +0:47 0 (const uint) +0:48 Function Definition: Fn2(f1; ( temp void) +0:48 Function Parameters: +0:48 'x' ( out float) +0:? Sequence +0:48 move second child to first child ( temp float) +0:48 'x' ( out float) +0:48 Constant: +0:48 0.000000 +0:50 Function Definition: SomeValue( ( temp float) +0:50 Function Parameters: +0:? Sequence +0:50 Branch: Return with expression +0:50 Convert int to float ( temp float) +0:50 c1: direct index for structure ( uniform int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:50 Constant: +0:50 0 (const uint) +0:53 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:53 Function Parameters: +0:? Sequence +0:57 imageLoad ( temp float) +0:57 'g_tTex1df1' (layout( r32f) uniform image1D) +0:57 c1: direct index for structure ( uniform int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:57 Constant: +0:57 0 (const uint) +0:59 Sequence +0:59 move second child to first child ( temp float) +0:59 'r00' ( temp float) +0:59 imageLoad ( temp float) +0:59 'g_tTex1df1' (layout( r32f) uniform image1D) +0:59 c1: direct index for structure ( uniform int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:59 Constant: +0:59 0 (const uint) +0:60 Sequence +0:60 move second child to first child ( temp int) +0:60 'r01' ( temp int) +0:60 imageLoad ( temp int) +0:60 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:60 c1: direct index for structure ( uniform int) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:60 Constant: +0:60 0 (const uint) +0:61 Sequence +0:61 move second child to first child ( temp uint) +0:61 'r02' ( temp uint) +0:61 imageLoad ( temp uint) +0:61 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:61 c1: direct index for structure ( uniform int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:61 Constant: +0:61 0 (const uint) +0:64 Sequence +0:64 move second child to first child ( temp float) +0:64 'r10' ( temp float) +0:64 imageLoad ( temp float) +0:64 'g_tTex2df1' (layout( r32f) uniform image2D) +0:64 c2: direct index for structure ( uniform 2-component vector of int) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:64 Constant: +0:64 1 (const uint) +0:65 Sequence +0:65 move second child to first child ( temp int) +0:65 'r11' ( temp int) +0:65 imageLoad ( temp int) +0:65 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:65 c2: direct index for structure ( uniform 2-component vector of int) +0:65 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:65 Constant: +0:65 1 (const uint) +0:66 Sequence +0:66 move second child to first child ( temp uint) +0:66 'r12' ( temp uint) +0:66 imageLoad ( temp uint) +0:66 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:66 c2: direct index for structure ( uniform 2-component vector of int) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:66 Constant: +0:66 1 (const uint) +0:69 Sequence +0:69 move second child to first child ( temp float) +0:69 'r20' ( temp float) +0:69 imageLoad ( temp float) +0:69 'g_tTex3df1' (layout( r32f) uniform image3D) +0:69 c3: direct index for structure ( uniform 3-component vector of int) +0:69 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:69 Constant: +0:69 2 (const uint) +0:70 Sequence +0:70 move second child to first child ( temp int) +0:70 'r21' ( temp int) +0:70 imageLoad ( temp int) +0:70 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:70 c3: direct index for structure ( uniform 3-component vector of int) +0:70 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:70 Constant: +0:70 2 (const uint) +0:71 Sequence +0:71 move second child to first child ( temp uint) +0:71 'r22' ( temp uint) +0:71 imageLoad ( temp uint) +0:71 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:71 c3: direct index for structure ( uniform 3-component vector of int) +0:71 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:71 Constant: +0:71 2 (const uint) +0:73 Sequence +0:73 move second child to first child ( temp float) +0:73 'lf1' ( temp float) +0:73 uf1: direct index for structure ( uniform float) +0:73 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:73 Constant: +0:73 8 (const uint) +0:77 Sequence +0:77 move second child to first child ( temp float) +0:77 'storeTemp' ( temp float) +0:77 Function Call: SomeValue( ( temp float) +0:77 imageStore ( temp void) +0:77 'g_tTex1df1' (layout( r32f) uniform image1D) +0:77 c1: direct index for structure ( uniform int) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:77 Constant: +0:77 0 (const uint) +0:77 'storeTemp' ( temp float) +0:77 'storeTemp' ( temp float) +0:78 Sequence +0:78 imageStore ( temp void) +0:78 'g_tTex1df1' (layout( r32f) uniform image1D) +0:78 c1: direct index for structure ( uniform int) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:78 Constant: +0:78 0 (const uint) +0:78 'lf1' ( temp float) +0:78 'lf1' ( temp float) +0:79 Sequence +0:79 move second child to first child ( temp int) +0:79 'storeTemp' ( temp int) +0:79 Constant: +0:79 2 (const int) +0:79 imageStore ( temp void) +0:79 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:79 c1: direct index for structure ( uniform int) +0:79 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:79 Constant: +0:79 0 (const uint) +0:79 'storeTemp' ( temp int) +0:79 'storeTemp' ( temp int) +0:80 Sequence +0:80 move second child to first child ( temp uint) +0:80 'storeTemp' ( temp uint) +0:80 Constant: +0:80 3 (const uint) +0:80 imageStore ( temp void) +0:80 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:80 c1: direct index for structure ( uniform int) +0:80 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:80 Constant: +0:80 0 (const uint) +0:80 'storeTemp' ( temp uint) +0:80 'storeTemp' ( temp uint) +0:83 Sequence +0:83 move second child to first child ( temp float) +0:83 'val1' ( temp float) +0:83 Sequence +0:83 move second child to first child ( temp int) +0:83 'coordTemp' ( temp int) +0:83 c1: direct index for structure ( uniform int) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:83 Constant: +0:83 0 (const uint) +0:83 move second child to first child ( temp float) +0:83 'storeTemp' ( temp float) +0:83 imageLoad ( temp float) +0:83 'g_tTex1df1' (layout( r32f) uniform image1D) +0:83 'coordTemp' ( temp int) +0:83 multiply second child into first child ( temp float) +0:83 'storeTemp' ( temp float) +0:83 Constant: +0:83 2.000000 +0:83 imageStore ( temp void) +0:83 'g_tTex1df1' (layout( r32f) uniform image1D) +0:83 'coordTemp' ( temp int) +0:83 'storeTemp' ( temp float) +0:83 'storeTemp' ( temp float) +0:84 Sequence +0:84 move second child to first child ( temp int) +0:84 'coordTemp' ( temp int) +0:84 c1: direct index for structure ( uniform int) +0:84 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:84 Constant: +0:84 0 (const uint) +0:84 move second child to first child ( temp float) +0:84 'storeTemp' ( temp float) +0:84 imageLoad ( temp float) +0:84 'g_tTex1df1' (layout( r32f) uniform image1D) +0:84 'coordTemp' ( temp int) +0:84 subtract second child into first child ( temp float) +0:84 'storeTemp' ( temp float) +0:84 Constant: +0:84 3.000000 +0:84 imageStore ( temp void) +0:84 'g_tTex1df1' (layout( r32f) uniform image1D) +0:84 'coordTemp' ( temp int) +0:84 'storeTemp' ( temp float) +0:84 'storeTemp' ( temp float) +0:85 Sequence +0:85 move second child to first child ( temp int) +0:85 'coordTemp' ( temp int) +0:85 c1: direct index for structure ( uniform int) +0:85 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:85 Constant: +0:85 0 (const uint) +0:85 move second child to first child ( temp float) +0:85 'storeTemp' ( temp float) +0:85 imageLoad ( temp float) +0:85 'g_tTex1df1' (layout( r32f) uniform image1D) +0:85 'coordTemp' ( temp int) +0:85 add second child into first child ( temp float) +0:85 'storeTemp' ( temp float) +0:85 Constant: +0:85 4.000000 +0:85 imageStore ( temp void) +0:85 'g_tTex1df1' (layout( r32f) uniform image1D) +0:85 'coordTemp' ( temp int) +0:85 'storeTemp' ( temp float) +0:85 'storeTemp' ( temp float) +0:87 Sequence +0:87 move second child to first child ( temp int) +0:87 'coordTemp' ( temp int) +0:87 c1: direct index for structure ( uniform int) +0:87 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:87 Constant: +0:87 0 (const uint) +0:87 move second child to first child ( temp int) +0:87 'storeTemp' ( temp int) +0:87 imageLoad ( temp int) +0:87 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:87 'coordTemp' ( temp int) +0:87 divide second child into first child ( temp int) +0:87 'storeTemp' ( temp int) +0:87 Constant: +0:87 2 (const int) +0:87 imageStore ( temp void) +0:87 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:87 'coordTemp' ( temp int) +0:87 'storeTemp' ( temp int) +0:87 'storeTemp' ( temp int) +0:88 Sequence +0:88 move second child to first child ( temp int) +0:88 'coordTemp' ( temp int) +0:88 c1: direct index for structure ( uniform int) +0:88 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:88 Constant: +0:88 0 (const uint) +0:88 move second child to first child ( temp int) +0:88 'storeTemp' ( temp int) +0:88 imageLoad ( temp int) +0:88 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:88 'coordTemp' ( temp int) +0:88 mod second child into first child ( temp int) +0:88 'storeTemp' ( temp int) +0:88 Constant: +0:88 2 (const int) +0:88 imageStore ( temp void) +0:88 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:88 'coordTemp' ( temp int) +0:88 'storeTemp' ( temp int) +0:88 'storeTemp' ( temp int) +0:89 Sequence +0:89 move second child to first child ( temp int) +0:89 'coordTemp' ( temp int) +0:89 c1: direct index for structure ( uniform int) +0:89 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:89 Constant: +0:89 0 (const uint) +0:89 move second child to first child ( temp int) +0:89 'storeTemp' ( temp int) +0:89 imageLoad ( temp int) +0:89 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:89 'coordTemp' ( temp int) +0:89 and second child into first child ( temp int) +0:89 'storeTemp' ( temp int) +0:89 Constant: +0:89 65535 (const int) +0:89 imageStore ( temp void) +0:89 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:89 'coordTemp' ( temp int) +0:89 'storeTemp' ( temp int) +0:89 'storeTemp' ( temp int) +0:90 Sequence +0:90 move second child to first child ( temp int) +0:90 'coordTemp' ( temp int) +0:90 c1: direct index for structure ( uniform int) +0:90 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:90 Constant: +0:90 0 (const uint) +0:90 move second child to first child ( temp int) +0:90 'storeTemp' ( temp int) +0:90 imageLoad ( temp int) +0:90 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:90 'coordTemp' ( temp int) +0:90 or second child into first child ( temp int) +0:90 'storeTemp' ( temp int) +0:90 Constant: +0:90 61680 (const int) +0:90 imageStore ( temp void) +0:90 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:90 'coordTemp' ( temp int) +0:90 'storeTemp' ( temp int) +0:90 'storeTemp' ( temp int) +0:91 Sequence +0:91 move second child to first child ( temp int) +0:91 'coordTemp' ( temp int) +0:91 c1: direct index for structure ( uniform int) +0:91 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:91 Constant: +0:91 0 (const uint) +0:91 move second child to first child ( temp int) +0:91 'storeTemp' ( temp int) +0:91 imageLoad ( temp int) +0:91 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:91 'coordTemp' ( temp int) +0:91 left shift second child into first child ( temp int) +0:91 'storeTemp' ( temp int) +0:91 Constant: +0:91 2 (const int) +0:91 imageStore ( temp void) +0:91 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:91 'coordTemp' ( temp int) +0:91 'storeTemp' ( temp int) +0:91 'storeTemp' ( temp int) +0:92 Sequence +0:92 move second child to first child ( temp int) +0:92 'coordTemp' ( temp int) +0:92 c1: direct index for structure ( uniform int) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:92 Constant: +0:92 0 (const uint) +0:92 move second child to first child ( temp int) +0:92 'storeTemp' ( temp int) +0:92 imageLoad ( temp int) +0:92 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:92 'coordTemp' ( temp int) +0:92 right shift second child into first child ( temp int) +0:92 'storeTemp' ( temp int) +0:92 Constant: +0:92 2 (const int) +0:92 imageStore ( temp void) +0:92 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:92 'coordTemp' ( temp int) +0:92 'storeTemp' ( temp int) +0:92 'storeTemp' ( temp int) +0:95 Sequence +0:95 move second child to first child ( temp float) +0:95 'storeTemp' ( temp float) +0:95 Function Call: SomeValue( ( temp float) +0:95 imageStore ( temp void) +0:95 'g_tTex2df1' (layout( r32f) uniform image2D) +0:95 c2: direct index for structure ( uniform 2-component vector of int) +0:95 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:95 Constant: +0:95 1 (const uint) +0:95 'storeTemp' ( temp float) +0:95 'storeTemp' ( temp float) +0:96 Sequence +0:96 imageStore ( temp void) +0:96 'g_tTex2df1' (layout( r32f) uniform image2D) +0:96 c2: direct index for structure ( uniform 2-component vector of int) +0:96 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:96 Constant: +0:96 1 (const uint) +0:96 'lf1' ( temp float) +0:96 'lf1' ( temp float) +0:97 Sequence +0:97 move second child to first child ( temp int) +0:97 'storeTemp' ( temp int) +0:97 Constant: +0:97 5 (const int) +0:97 imageStore ( temp void) +0:97 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:97 c2: direct index for structure ( uniform 2-component vector of int) +0:97 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:97 Constant: +0:97 1 (const uint) +0:97 'storeTemp' ( temp int) +0:97 'storeTemp' ( temp int) +0:98 Sequence +0:98 move second child to first child ( temp uint) +0:98 'storeTemp' ( temp uint) +0:98 Constant: +0:98 6 (const uint) +0:98 imageStore ( temp void) +0:98 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:98 c2: direct index for structure ( uniform 2-component vector of int) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:98 Constant: +0:98 1 (const uint) +0:98 'storeTemp' ( temp uint) +0:98 'storeTemp' ( temp uint) +0:101 Sequence +0:101 move second child to first child ( temp float) +0:101 'storeTemp' ( temp float) +0:101 Function Call: SomeValue( ( temp float) +0:101 imageStore ( temp void) +0:101 'g_tTex3df1' (layout( r32f) uniform image3D) +0:101 c3: direct index for structure ( uniform 3-component vector of int) +0:101 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:101 Constant: +0:101 2 (const uint) +0:101 'storeTemp' ( temp float) +0:101 'storeTemp' ( temp float) +0:102 Sequence +0:102 imageStore ( temp void) +0:102 'g_tTex3df1' (layout( r32f) uniform image3D) +0:102 c3: direct index for structure ( uniform 3-component vector of int) +0:102 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:102 Constant: +0:102 2 (const uint) +0:102 'lf1' ( temp float) +0:102 'lf1' ( temp float) +0:103 Sequence +0:103 move second child to first child ( temp int) +0:103 'storeTemp' ( temp int) +0:103 Constant: +0:103 8 (const int) +0:103 imageStore ( temp void) +0:103 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:103 c3: direct index for structure ( uniform 3-component vector of int) +0:103 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:103 Constant: +0:103 2 (const uint) +0:103 'storeTemp' ( temp int) +0:103 'storeTemp' ( temp int) +0:104 Sequence +0:104 move second child to first child ( temp uint) +0:104 'storeTemp' ( temp uint) +0:104 Constant: +0:104 9 (const uint) +0:104 imageStore ( temp void) +0:104 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:104 c3: direct index for structure ( uniform 3-component vector of int) +0:104 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:104 Constant: +0:104 2 (const uint) +0:104 'storeTemp' ( temp uint) +0:104 'storeTemp' ( temp uint) +0:107 Function Call: Fn1(f1; ( temp float) +0:107 imageLoad ( temp float) +0:107 'g_tTex1df1' (layout( r32f) uniform image1D) +0:107 c1: direct index for structure ( uniform int) +0:107 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:107 Constant: +0:107 0 (const uint) +0:108 Function Call: Fn1(i1; ( temp int) +0:108 imageLoad ( temp int) +0:108 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:108 c1: direct index for structure ( uniform int) +0:108 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:108 Constant: +0:108 0 (const uint) +0:109 Function Call: Fn1(u1; ( temp uint) +0:109 imageLoad ( temp uint) +0:109 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:109 c1: direct index for structure ( uniform int) +0:109 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:109 Constant: +0:109 0 (const uint) +0:111 Comma ( temp void) +0:111 Function Call: Fn2(f1; ( temp void) +0:111 'tempArg' ( temp float) +0:111 Sequence +0:111 imageStore ( temp void) +0:111 'g_tTex1df1' (layout( r32f) uniform image1D) +0:111 c1: direct index for structure ( uniform int) +0:111 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:111 Constant: +0:111 0 (const uint) +0:111 'tempArg' ( temp float) +0:111 'tempArg' ( temp float) +0:112 Comma ( temp void) +0:112 Function Call: Fn2(i1; ( temp void) +0:112 'tempArg' ( temp int) +0:112 Sequence +0:112 imageStore ( temp void) +0:112 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:112 c1: direct index for structure ( uniform int) +0:112 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:112 Constant: +0:112 0 (const uint) +0:112 'tempArg' ( temp int) +0:112 'tempArg' ( temp int) +0:113 Comma ( temp void) +0:113 Function Call: Fn2(u1; ( temp void) +0:113 'tempArg' ( temp uint) +0:113 Sequence +0:113 imageStore ( temp void) +0:113 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:113 c1: direct index for structure ( uniform int) +0:113 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:113 Constant: +0:113 0 (const uint) +0:113 'tempArg' ( temp uint) +0:113 'tempArg' ( temp uint) +0:117 Sequence +0:117 move second child to first child ( temp int) +0:117 'coordTemp' ( temp int) +0:117 c1: direct index for structure ( uniform int) +0:117 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:117 Constant: +0:117 0 (const uint) +0:117 move second child to first child ( temp float) +0:117 'storeTemp' ( temp float) +0:117 imageLoad ( temp float) +0:117 'g_tTex1df1' (layout( r32f) uniform image1D) +0:117 'coordTemp' ( temp int) +0:117 Pre-Increment ( temp float) +0:117 'storeTemp' ( temp float) +0:117 imageStore ( temp void) +0:117 'g_tTex1df1' (layout( r32f) uniform image1D) +0:117 'coordTemp' ( temp int) +0:117 'storeTemp' ( temp float) +0:117 'storeTemp' ( temp float) +0:118 Sequence +0:118 move second child to first child ( temp int) +0:118 'coordTemp' ( temp int) +0:118 c1: direct index for structure ( uniform int) +0:118 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:118 Constant: +0:118 0 (const uint) +0:118 move second child to first child ( temp int) +0:118 'storeTemp' ( temp int) +0:118 imageLoad ( temp int) +0:118 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:118 'coordTemp' ( temp int) +0:118 Pre-Increment ( temp int) +0:118 'storeTemp' ( temp int) +0:118 imageStore ( temp void) +0:118 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:118 'coordTemp' ( temp int) +0:118 'storeTemp' ( temp int) +0:118 'storeTemp' ( temp int) +0:119 Sequence +0:119 move second child to first child ( temp int) +0:119 'coordTemp' ( temp int) +0:119 c1: direct index for structure ( uniform int) +0:119 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:119 Constant: +0:119 0 (const uint) +0:119 move second child to first child ( temp uint) +0:119 'storeTemp' ( temp uint) +0:119 imageLoad ( temp uint) +0:119 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:119 'coordTemp' ( temp int) +0:119 Pre-Increment ( temp uint) +0:119 'storeTemp' ( temp uint) +0:119 imageStore ( temp void) +0:119 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:119 'coordTemp' ( temp int) +0:119 'storeTemp' ( temp uint) +0:119 'storeTemp' ( temp uint) +0:121 Sequence +0:121 move second child to first child ( temp int) +0:121 'coordTemp' ( temp int) +0:121 c1: direct index for structure ( uniform int) +0:121 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:121 Constant: +0:121 0 (const uint) +0:121 move second child to first child ( temp float) +0:121 'storeTemp' ( temp float) +0:121 imageLoad ( temp float) +0:121 'g_tTex1df1' (layout( r32f) uniform image1D) +0:121 'coordTemp' ( temp int) +0:121 Pre-Decrement ( temp float) +0:121 'storeTemp' ( temp float) +0:121 imageStore ( temp void) +0:121 'g_tTex1df1' (layout( r32f) uniform image1D) +0:121 'coordTemp' ( temp int) +0:121 'storeTemp' ( temp float) +0:121 'storeTemp' ( temp float) +0:122 Sequence +0:122 move second child to first child ( temp int) +0:122 'coordTemp' ( temp int) +0:122 c1: direct index for structure ( uniform int) +0:122 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:122 Constant: +0:122 0 (const uint) +0:122 move second child to first child ( temp int) +0:122 'storeTemp' ( temp int) +0:122 imageLoad ( temp int) +0:122 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:122 'coordTemp' ( temp int) +0:122 Pre-Decrement ( temp int) +0:122 'storeTemp' ( temp int) +0:122 imageStore ( temp void) +0:122 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:122 'coordTemp' ( temp int) +0:122 'storeTemp' ( temp int) +0:122 'storeTemp' ( temp int) +0:123 Sequence +0:123 move second child to first child ( temp int) +0:123 'coordTemp' ( temp int) +0:123 c1: direct index for structure ( uniform int) +0:123 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:123 Constant: +0:123 0 (const uint) +0:123 move second child to first child ( temp uint) +0:123 'storeTemp' ( temp uint) +0:123 imageLoad ( temp uint) +0:123 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:123 'coordTemp' ( temp int) +0:123 Pre-Decrement ( temp uint) +0:123 'storeTemp' ( temp uint) +0:123 imageStore ( temp void) +0:123 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:123 'coordTemp' ( temp int) +0:123 'storeTemp' ( temp uint) +0:123 'storeTemp' ( temp uint) +0:126 Sequence +0:126 move second child to first child ( temp int) +0:126 'coordTemp' ( temp int) +0:126 c1: direct index for structure ( uniform int) +0:126 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:126 Constant: +0:126 0 (const uint) +0:126 move second child to first child ( temp float) +0:126 'storeTempPre' ( temp float) +0:126 imageLoad ( temp float) +0:126 'g_tTex1df1' (layout( r32f) uniform image1D) +0:126 'coordTemp' ( temp int) +0:126 move second child to first child ( temp float) +0:126 'storeTempPost' ( temp float) +0:126 'storeTempPre' ( temp float) +0:126 Post-Increment ( temp float) +0:126 'storeTempPost' ( temp float) +0:126 imageStore ( temp void) +0:126 'g_tTex1df1' (layout( r32f) uniform image1D) +0:126 'coordTemp' ( temp int) +0:126 'storeTempPost' ( temp float) +0:126 'storeTempPre' ( temp float) +0:127 Sequence +0:127 move second child to first child ( temp int) +0:127 'coordTemp' ( temp int) +0:127 c1: direct index for structure ( uniform int) +0:127 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:127 Constant: +0:127 0 (const uint) +0:127 move second child to first child ( temp uint) +0:127 'storeTempPre' ( temp uint) +0:127 imageLoad ( temp uint) +0:127 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:127 'coordTemp' ( temp int) +0:127 move second child to first child ( temp uint) +0:127 'storeTempPost' ( temp uint) +0:127 'storeTempPre' ( temp uint) +0:127 Post-Decrement ( temp uint) +0:127 'storeTempPost' ( temp uint) +0:127 imageStore ( temp void) +0:127 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:127 'coordTemp' ( temp int) +0:127 'storeTempPost' ( temp uint) +0:127 'storeTempPre' ( temp uint) +0:128 Sequence +0:128 move second child to first child ( temp int) +0:128 'coordTemp' ( temp int) +0:128 c1: direct index for structure ( uniform int) +0:128 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:128 Constant: +0:128 0 (const uint) +0:128 move second child to first child ( temp int) +0:128 'storeTempPre' ( temp int) +0:128 imageLoad ( temp int) +0:128 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:128 'coordTemp' ( temp int) +0:128 move second child to first child ( temp int) +0:128 'storeTempPost' ( temp int) +0:128 'storeTempPre' ( temp int) +0:128 Post-Increment ( temp int) +0:128 'storeTempPost' ( temp int) +0:128 imageStore ( temp void) +0:128 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:128 'coordTemp' ( temp int) +0:128 'storeTempPost' ( temp int) +0:128 'storeTempPre' ( temp int) +0:130 Sequence +0:130 move second child to first child ( temp int) +0:130 'coordTemp' ( temp int) +0:130 c1: direct index for structure ( uniform int) +0:130 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:130 Constant: +0:130 0 (const uint) +0:130 move second child to first child ( temp float) +0:130 'storeTempPre' ( temp float) +0:130 imageLoad ( temp float) +0:130 'g_tTex1df1' (layout( r32f) uniform image1D) +0:130 'coordTemp' ( temp int) +0:130 move second child to first child ( temp float) +0:130 'storeTempPost' ( temp float) +0:130 'storeTempPre' ( temp float) +0:130 Post-Decrement ( temp float) +0:130 'storeTempPost' ( temp float) +0:130 imageStore ( temp void) +0:130 'g_tTex1df1' (layout( r32f) uniform image1D) +0:130 'coordTemp' ( temp int) +0:130 'storeTempPost' ( temp float) +0:130 'storeTempPre' ( temp float) +0:131 Sequence +0:131 move second child to first child ( temp int) +0:131 'coordTemp' ( temp int) +0:131 c1: direct index for structure ( uniform int) +0:131 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:131 Constant: +0:131 0 (const uint) +0:131 move second child to first child ( temp int) +0:131 'storeTempPre' ( temp int) +0:131 imageLoad ( temp int) +0:131 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:131 'coordTemp' ( temp int) +0:131 move second child to first child ( temp int) +0:131 'storeTempPost' ( temp int) +0:131 'storeTempPre' ( temp int) +0:131 Post-Increment ( temp int) +0:131 'storeTempPost' ( temp int) +0:131 imageStore ( temp void) +0:131 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:131 'coordTemp' ( temp int) +0:131 'storeTempPost' ( temp int) +0:131 'storeTempPre' ( temp int) +0:132 Sequence +0:132 move second child to first child ( temp int) +0:132 'coordTemp' ( temp int) +0:132 c1: direct index for structure ( uniform int) +0:132 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:132 Constant: +0:132 0 (const uint) +0:132 move second child to first child ( temp uint) +0:132 'storeTempPre' ( temp uint) +0:132 imageLoad ( temp uint) +0:132 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:132 'coordTemp' ( temp int) +0:132 move second child to first child ( temp uint) +0:132 'storeTempPost' ( temp uint) +0:132 'storeTempPre' ( temp uint) +0:132 Post-Decrement ( temp uint) +0:132 'storeTempPost' ( temp uint) +0:132 imageStore ( temp void) +0:132 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:132 'coordTemp' ( temp int) +0:132 'storeTempPost' ( temp uint) +0:132 'storeTempPre' ( temp uint) +0:135 Sequence +0:135 move second child to first child ( temp float) +0:135 'storeTemp' ( temp float) +0:? imageLoad ( temp float) +0:135 'g_tTex2df1' (layout( r32f) uniform image2D) +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:135 imageStore ( temp void) +0:135 'g_tTex1df1' (layout( r32f) uniform image1D) +0:135 Constant: +0:135 1 (const int) +0:135 'storeTemp' ( temp float) +0:135 'storeTemp' ( temp float) +0:137 move second child to first child ( temp 4-component vector of float) +0:137 Color: direct index for structure ( temp 4-component vector of float) +0:137 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 1.000000 +0:137 1.000000 +0:137 1.000000 +0:137 1.000000 +0:139 Branch: Return with expression +0:139 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:53 Function Definition: main( ( temp void) +0:53 Function Parameters: +0:? Sequence +0:53 Sequence +0:53 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:53 Color: direct index for structure ( temp 4-component vector of float) +0:53 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:53 Constant: +0:53 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df1' (layout( r32f) uniform image1D) +0:? 'g_tTex1di1' (layout( r32i) uniform iimage1D) +0:? 'g_tTex1du1' (layout( r32ui) uniform uimage1D) +0:? 'g_tTex2df1' (layout( r32f) uniform image2D) +0:? 'g_tTex2di1' (layout( r32i) uniform iimage2D) +0:? 'g_tTex2du1' (layout( r32ui) uniform uimage2D) +0:? 'g_tTex3df1' (layout( r32f) uniform image3D) +0:? 'g_tTex3di1' (layout( r32i) uniform iimage3D) +0:? 'g_tTex3du1' (layout( r32ui) uniform uimage3D) +0:? 'g_tTex1df1a' (layout( r32f) uniform image1DArray) +0:? 'g_tTex1di1a' (layout( r32i) uniform iimage1DArray) +0:? 'g_tTex1du1a' (layout( r32ui) uniform uimage1DArray) +0:? 'g_tTex2df1a' (layout( r32f) uniform image2DArray) +0:? 'g_tTex2di1a' (layout( r32i) uniform iimage2DArray) +0:? 'g_tTex2du1a' (layout( r32ui) uniform uimage2DArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform float uf1, uniform int ui1, uniform uint uu1}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 571 + + Capability Shader + Capability Image1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 547 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 10 "Fn1(i1;" + Name 9 "x" + Name 16 "Fn1(u1;" + Name 15 "x" + Name 22 "Fn1(f1;" + Name 21 "x" + Name 26 "Fn2(i1;" + Name 25 "x" + Name 30 "Fn2(u1;" + Name 29 "x" + Name 34 "Fn2(f1;" + Name 33 "x" + Name 37 "SomeValue(" + Name 40 "PS_OUTPUT" + MemberName 40(PS_OUTPUT) 0 "Color" + Name 42 "@main(" + Name 59 "$Global" + MemberName 59($Global) 0 "c1" + MemberName 59($Global) 1 "c2" + MemberName 59($Global) 2 "c3" + MemberName 59($Global) 3 "c4" + MemberName 59($Global) 4 "o1" + MemberName 59($Global) 5 "o2" + MemberName 59($Global) 6 "o3" + MemberName 59($Global) 7 "o4" + MemberName 59($Global) 8 "uf1" + MemberName 59($Global) 9 "ui1" + MemberName 59($Global) 10 "uu1" + Name 61 "" + Name 70 "g_tTex1df1" + Name 75 "r00" + Name 80 "r01" + Name 83 "g_tTex1di1" + Name 88 "r02" + Name 91 "g_tTex1du1" + Name 96 "r10" + Name 99 "g_tTex2df1" + Name 106 "r11" + Name 109 "g_tTex2di1" + Name 114 "r12" + Name 117 "g_tTex2du1" + Name 122 "r20" + Name 125 "g_tTex3df1" + Name 132 "r21" + Name 135 "g_tTex3di1" + Name 140 "r22" + Name 143 "g_tTex3du1" + Name 148 "lf1" + Name 153 "storeTemp" + Name 163 "storeTemp" + Name 168 "storeTemp" + Name 174 "val1" + Name 175 "coordTemp" + Name 178 "storeTemp" + Name 189 "coordTemp" + Name 192 "storeTemp" + Name 202 "coordTemp" + Name 205 "storeTemp" + Name 215 "coordTemp" + Name 218 "storeTemp" + Name 227 "coordTemp" + Name 230 "storeTemp" + Name 239 "coordTemp" + Name 242 "storeTemp" + Name 252 "coordTemp" + Name 255 "storeTemp" + Name 265 "coordTemp" + Name 268 "storeTemp" + Name 277 "coordTemp" + Name 280 "storeTemp" + Name 289 "storeTemp" + Name 299 "storeTemp" + Name 305 "storeTemp" + Name 311 "storeTemp" + Name 321 "storeTemp" + Name 326 "storeTemp" + Name 336 "param" + Name 342 "param" + Name 348 "param" + Name 350 "tempArg" + Name 351 "param" + Name 358 "tempArg" + Name 359 "param" + Name 366 "tempArg" + Name 367 "param" + Name 374 "coordTemp" + Name 377 "storeTemp" + Name 387 "coordTemp" + Name 390 "storeTemp" + Name 399 "coordTemp" + Name 402 "storeTemp" + Name 411 "coordTemp" + Name 414 "storeTemp" + Name 423 "coordTemp" + Name 426 "storeTemp" + Name 435 "coordTemp" + Name 438 "storeTemp" + Name 447 "coordTemp" + Name 450 "storeTempPre" + Name 454 "storeTempPost" + Name 461 "coordTemp" + Name 464 "storeTempPre" + Name 468 "storeTempPost" + Name 475 "coordTemp" + Name 478 "storeTempPre" + Name 482 "storeTempPost" + Name 489 "coordTemp" + Name 492 "storeTempPre" + Name 496 "storeTempPost" + Name 503 "coordTemp" + Name 506 "storeTempPre" + Name 510 "storeTempPost" + Name 517 "coordTemp" + Name 520 "storeTempPre" + Name 524 "storeTempPost" + Name 531 "storeTemp" + Name 539 "psout" + Name 547 "@entryPointOutput.Color" + Name 552 "g_sSamp" + Name 555 "g_tTex1df1a" + Name 558 "g_tTex1di1a" + Name 561 "g_tTex1du1a" + Name 564 "g_tTex2df1a" + Name 567 "g_tTex2di1a" + Name 570 "g_tTex2du1a" + MemberDecorate 59($Global) 0 Offset 0 + MemberDecorate 59($Global) 1 Offset 8 + MemberDecorate 59($Global) 2 Offset 16 + MemberDecorate 59($Global) 3 Offset 32 + MemberDecorate 59($Global) 4 Offset 48 + MemberDecorate 59($Global) 5 Offset 56 + MemberDecorate 59($Global) 6 Offset 64 + MemberDecorate 59($Global) 7 Offset 80 + MemberDecorate 59($Global) 8 Offset 96 + MemberDecorate 59($Global) 9 Offset 100 + MemberDecorate 59($Global) 10 Offset 104 + Decorate 59($Global) Block + Decorate 61 DescriptorSet 0 + Decorate 70(g_tTex1df1) DescriptorSet 0 + Decorate 83(g_tTex1di1) DescriptorSet 0 + Decorate 91(g_tTex1du1) DescriptorSet 0 + Decorate 99(g_tTex2df1) DescriptorSet 0 + Decorate 109(g_tTex2di1) DescriptorSet 0 + Decorate 117(g_tTex2du1) DescriptorSet 0 + Decorate 125(g_tTex3df1) DescriptorSet 0 + Decorate 135(g_tTex3di1) DescriptorSet 0 + Decorate 143(g_tTex3du1) DescriptorSet 0 + Decorate 547(@entryPointOutput.Color) Location 0 + Decorate 552(g_sSamp) DescriptorSet 0 + Decorate 552(g_sSamp) Binding 0 + Decorate 555(g_tTex1df1a) DescriptorSet 0 + Decorate 558(g_tTex1di1a) DescriptorSet 0 + Decorate 561(g_tTex1du1a) DescriptorSet 0 + Decorate 564(g_tTex2df1a) DescriptorSet 0 + Decorate 567(g_tTex2di1a) DescriptorSet 0 + Decorate 570(g_tTex2du1a) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 8: TypeFunction 6(int) 7(ptr) + 12: TypeInt 32 0 + 13: TypePointer Function 12(int) + 14: TypeFunction 12(int) 13(ptr) + 18: TypeFloat 32 + 19: TypePointer Function 18(float) + 20: TypeFunction 18(float) 19(ptr) + 24: TypeFunction 2 7(ptr) + 28: TypeFunction 2 13(ptr) + 32: TypeFunction 2 19(ptr) + 36: TypeFunction 18(float) + 39: TypeVector 18(float) 4 + 40(PS_OUTPUT): TypeStruct 39(fvec4) + 41: TypeFunction 40(PS_OUTPUT) + 53: 6(int) Constant 0 + 54: 12(int) Constant 0 + 55: 18(float) Constant 0 + 56: TypeVector 6(int) 2 + 57: TypeVector 6(int) 3 + 58: TypeVector 6(int) 4 + 59($Global): TypeStruct 6(int) 56(ivec2) 57(ivec3) 58(ivec4) 6(int) 56(ivec2) 57(ivec3) 58(ivec4) 18(float) 6(int) 12(int) + 60: TypePointer Uniform 59($Global) + 61: 60(ptr) Variable Uniform + 62: TypePointer Uniform 6(int) + 68: TypeImage 18(float) 1D nonsampled format:R32f + 69: TypePointer UniformConstant 68 + 70(g_tTex1df1): 69(ptr) Variable UniformConstant + 81: TypeImage 6(int) 1D nonsampled format:R32i + 82: TypePointer UniformConstant 81 + 83(g_tTex1di1): 82(ptr) Variable UniformConstant + 89: TypeImage 12(int) 1D nonsampled format:R32ui + 90: TypePointer UniformConstant 89 + 91(g_tTex1du1): 90(ptr) Variable UniformConstant + 97: TypeImage 18(float) 2D nonsampled format:R32f + 98: TypePointer UniformConstant 97 + 99(g_tTex2df1): 98(ptr) Variable UniformConstant + 101: 6(int) Constant 1 + 102: TypePointer Uniform 56(ivec2) + 107: TypeImage 6(int) 2D nonsampled format:R32i + 108: TypePointer UniformConstant 107 + 109(g_tTex2di1): 108(ptr) Variable UniformConstant + 115: TypeImage 12(int) 2D nonsampled format:R32ui + 116: TypePointer UniformConstant 115 + 117(g_tTex2du1): 116(ptr) Variable UniformConstant + 123: TypeImage 18(float) 3D nonsampled format:R32f + 124: TypePointer UniformConstant 123 + 125(g_tTex3df1): 124(ptr) Variable UniformConstant + 127: 6(int) Constant 2 + 128: TypePointer Uniform 57(ivec3) + 133: TypeImage 6(int) 3D nonsampled format:R32i + 134: TypePointer UniformConstant 133 + 135(g_tTex3di1): 134(ptr) Variable UniformConstant + 141: TypeImage 12(int) 3D nonsampled format:R32ui + 142: TypePointer UniformConstant 141 + 143(g_tTex3du1): 142(ptr) Variable UniformConstant + 149: 6(int) Constant 8 + 150: TypePointer Uniform 18(float) + 169: 12(int) Constant 3 + 182: 18(float) Constant 1073741824 + 196: 18(float) Constant 1077936128 + 209: 18(float) Constant 1082130432 + 246: 6(int) Constant 65535 + 259: 6(int) Constant 61680 + 300: 6(int) Constant 5 + 306: 12(int) Constant 6 + 327: 12(int) Constant 9 + 382: 18(float) Constant 1065353216 + 533: 6(int) Constant 3 + 534: 56(ivec2) ConstantComposite 127 533 + 538: TypePointer Function 40(PS_OUTPUT) + 540: 39(fvec4) ConstantComposite 382 382 382 382 + 541: TypePointer Function 39(fvec4) + 546: TypePointer Output 39(fvec4) +547(@entryPointOutput.Color): 546(ptr) Variable Output + 550: TypeSampler + 551: TypePointer UniformConstant 550 + 552(g_sSamp): 551(ptr) Variable UniformConstant + 553: TypeImage 18(float) 1D array nonsampled format:R32f + 554: TypePointer UniformConstant 553 +555(g_tTex1df1a): 554(ptr) Variable UniformConstant + 556: TypeImage 6(int) 1D array nonsampled format:R32i + 557: TypePointer UniformConstant 556 +558(g_tTex1di1a): 557(ptr) Variable UniformConstant + 559: TypeImage 12(int) 1D array nonsampled format:R32ui + 560: TypePointer UniformConstant 559 +561(g_tTex1du1a): 560(ptr) Variable UniformConstant + 562: TypeImage 18(float) 2D array nonsampled format:R32f + 563: TypePointer UniformConstant 562 +564(g_tTex2df1a): 563(ptr) Variable UniformConstant + 565: TypeImage 6(int) 2D array nonsampled format:R32i + 566: TypePointer UniformConstant 565 +567(g_tTex2di1a): 566(ptr) Variable UniformConstant + 568: TypeImage 12(int) 2D array nonsampled format:R32ui + 569: TypePointer UniformConstant 568 +570(g_tTex2du1a): 569(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 548:40(PS_OUTPUT) FunctionCall 42(@main() + 549: 39(fvec4) CompositeExtract 548 0 + Store 547(@entryPointOutput.Color) 549 + Return + FunctionEnd + 10(Fn1(i1;): 6(int) Function None 8 + 9(x): 7(ptr) FunctionParameter + 11: Label + 44: 6(int) Load 9(x) + ReturnValue 44 + FunctionEnd + 16(Fn1(u1;): 12(int) Function None 14 + 15(x): 13(ptr) FunctionParameter + 17: Label + 47: 12(int) Load 15(x) + ReturnValue 47 + FunctionEnd + 22(Fn1(f1;): 18(float) Function None 20 + 21(x): 19(ptr) FunctionParameter + 23: Label + 50: 18(float) Load 21(x) + ReturnValue 50 + FunctionEnd + 26(Fn2(i1;): 2 Function None 24 + 25(x): 7(ptr) FunctionParameter + 27: Label + Store 25(x) 53 + Return + FunctionEnd + 30(Fn2(u1;): 2 Function None 28 + 29(x): 13(ptr) FunctionParameter + 31: Label + Store 29(x) 54 + Return + FunctionEnd + 34(Fn2(f1;): 2 Function None 32 + 33(x): 19(ptr) FunctionParameter + 35: Label + Store 33(x) 55 + Return + FunctionEnd + 37(SomeValue(): 18(float) Function None 36 + 38: Label + 63: 62(ptr) AccessChain 61 53 + 64: 6(int) Load 63 + 65: 18(float) ConvertSToF 64 + ReturnValue 65 + FunctionEnd + 42(@main():40(PS_OUTPUT) Function None 41 + 43: Label + 75(r00): 19(ptr) Variable Function + 80(r01): 7(ptr) Variable Function + 88(r02): 13(ptr) Variable Function + 96(r10): 19(ptr) Variable Function + 106(r11): 7(ptr) Variable Function + 114(r12): 13(ptr) Variable Function + 122(r20): 19(ptr) Variable Function + 132(r21): 7(ptr) Variable Function + 140(r22): 13(ptr) Variable Function + 148(lf1): 19(ptr) Variable Function + 153(storeTemp): 19(ptr) Variable Function + 163(storeTemp): 7(ptr) Variable Function + 168(storeTemp): 13(ptr) Variable Function + 174(val1): 19(ptr) Variable Function + 175(coordTemp): 7(ptr) Variable Function + 178(storeTemp): 19(ptr) Variable Function + 189(coordTemp): 7(ptr) Variable Function + 192(storeTemp): 19(ptr) Variable Function + 202(coordTemp): 7(ptr) Variable Function + 205(storeTemp): 19(ptr) Variable Function + 215(coordTemp): 7(ptr) Variable Function + 218(storeTemp): 7(ptr) Variable Function + 227(coordTemp): 7(ptr) Variable Function + 230(storeTemp): 7(ptr) Variable Function + 239(coordTemp): 7(ptr) Variable Function + 242(storeTemp): 7(ptr) Variable Function + 252(coordTemp): 7(ptr) Variable Function + 255(storeTemp): 7(ptr) Variable Function + 265(coordTemp): 7(ptr) Variable Function + 268(storeTemp): 7(ptr) Variable Function + 277(coordTemp): 7(ptr) Variable Function + 280(storeTemp): 7(ptr) Variable Function + 289(storeTemp): 19(ptr) Variable Function + 299(storeTemp): 7(ptr) Variable Function + 305(storeTemp): 13(ptr) Variable Function + 311(storeTemp): 19(ptr) Variable Function + 321(storeTemp): 7(ptr) Variable Function + 326(storeTemp): 13(ptr) Variable Function + 336(param): 19(ptr) Variable Function + 342(param): 7(ptr) Variable Function + 348(param): 13(ptr) Variable Function + 350(tempArg): 19(ptr) Variable Function + 351(param): 19(ptr) Variable Function + 358(tempArg): 7(ptr) Variable Function + 359(param): 7(ptr) Variable Function + 366(tempArg): 13(ptr) Variable Function + 367(param): 13(ptr) Variable Function + 374(coordTemp): 7(ptr) Variable Function + 377(storeTemp): 19(ptr) Variable Function + 387(coordTemp): 7(ptr) Variable Function + 390(storeTemp): 7(ptr) Variable Function + 399(coordTemp): 7(ptr) Variable Function + 402(storeTemp): 13(ptr) Variable Function + 411(coordTemp): 7(ptr) Variable Function + 414(storeTemp): 19(ptr) Variable Function + 423(coordTemp): 7(ptr) Variable Function + 426(storeTemp): 7(ptr) Variable Function + 435(coordTemp): 7(ptr) Variable Function + 438(storeTemp): 13(ptr) Variable Function + 447(coordTemp): 7(ptr) Variable Function +450(storeTempPre): 19(ptr) Variable Function +454(storeTempPost): 19(ptr) Variable Function + 461(coordTemp): 7(ptr) Variable Function +464(storeTempPre): 13(ptr) Variable Function +468(storeTempPost): 13(ptr) Variable Function + 475(coordTemp): 7(ptr) Variable Function +478(storeTempPre): 7(ptr) Variable Function +482(storeTempPost): 7(ptr) Variable Function + 489(coordTemp): 7(ptr) Variable Function +492(storeTempPre): 19(ptr) Variable Function +496(storeTempPost): 19(ptr) Variable Function + 503(coordTemp): 7(ptr) Variable Function +506(storeTempPre): 7(ptr) Variable Function +510(storeTempPost): 7(ptr) Variable Function + 517(coordTemp): 7(ptr) Variable Function +520(storeTempPre): 13(ptr) Variable Function +524(storeTempPost): 13(ptr) Variable Function + 531(storeTemp): 19(ptr) Variable Function + 539(psout): 538(ptr) Variable Function + 71: 68 Load 70(g_tTex1df1) + 72: 62(ptr) AccessChain 61 53 + 73: 6(int) Load 72 + 74: 18(float) ImageRead 71 73 + 76: 68 Load 70(g_tTex1df1) + 77: 62(ptr) AccessChain 61 53 + 78: 6(int) Load 77 + 79: 18(float) ImageRead 76 78 + Store 75(r00) 79 + 84: 81 Load 83(g_tTex1di1) + 85: 62(ptr) AccessChain 61 53 + 86: 6(int) Load 85 + 87: 6(int) ImageRead 84 86 + Store 80(r01) 87 + 92: 89 Load 91(g_tTex1du1) + 93: 62(ptr) AccessChain 61 53 + 94: 6(int) Load 93 + 95: 12(int) ImageRead 92 94 + Store 88(r02) 95 + 100: 97 Load 99(g_tTex2df1) + 103: 102(ptr) AccessChain 61 101 + 104: 56(ivec2) Load 103 + 105: 18(float) ImageRead 100 104 + Store 96(r10) 105 + 110: 107 Load 109(g_tTex2di1) + 111: 102(ptr) AccessChain 61 101 + 112: 56(ivec2) Load 111 + 113: 6(int) ImageRead 110 112 + Store 106(r11) 113 + 118: 115 Load 117(g_tTex2du1) + 119: 102(ptr) AccessChain 61 101 + 120: 56(ivec2) Load 119 + 121: 12(int) ImageRead 118 120 + Store 114(r12) 121 + 126: 123 Load 125(g_tTex3df1) + 129: 128(ptr) AccessChain 61 127 + 130: 57(ivec3) Load 129 + 131: 18(float) ImageRead 126 130 + Store 122(r20) 131 + 136: 133 Load 135(g_tTex3di1) + 137: 128(ptr) AccessChain 61 127 + 138: 57(ivec3) Load 137 + 139: 6(int) ImageRead 136 138 + Store 132(r21) 139 + 144: 141 Load 143(g_tTex3du1) + 145: 128(ptr) AccessChain 61 127 + 146: 57(ivec3) Load 145 + 147: 12(int) ImageRead 144 146 + Store 140(r22) 147 + 151: 150(ptr) AccessChain 61 149 + 152: 18(float) Load 151 + Store 148(lf1) 152 + 154: 18(float) FunctionCall 37(SomeValue() + Store 153(storeTemp) 154 + 155: 68 Load 70(g_tTex1df1) + 156: 62(ptr) AccessChain 61 53 + 157: 6(int) Load 156 + 158: 18(float) Load 153(storeTemp) + ImageWrite 155 157 158 + 159: 68 Load 70(g_tTex1df1) + 160: 62(ptr) AccessChain 61 53 + 161: 6(int) Load 160 + 162: 18(float) Load 148(lf1) + ImageWrite 159 161 162 + Store 163(storeTemp) 127 + 164: 81 Load 83(g_tTex1di1) + 165: 62(ptr) AccessChain 61 53 + 166: 6(int) Load 165 + 167: 6(int) Load 163(storeTemp) + ImageWrite 164 166 167 + Store 168(storeTemp) 169 + 170: 89 Load 91(g_tTex1du1) + 171: 62(ptr) AccessChain 61 53 + 172: 6(int) Load 171 + 173: 12(int) Load 168(storeTemp) + ImageWrite 170 172 173 + 176: 62(ptr) AccessChain 61 53 + 177: 6(int) Load 176 + Store 175(coordTemp) 177 + 179: 68 Load 70(g_tTex1df1) + 180: 6(int) Load 175(coordTemp) + 181: 18(float) ImageRead 179 180 + Store 178(storeTemp) 181 + 183: 18(float) Load 178(storeTemp) + 184: 18(float) FMul 183 182 + Store 178(storeTemp) 184 + 185: 68 Load 70(g_tTex1df1) + 186: 6(int) Load 175(coordTemp) + 187: 18(float) Load 178(storeTemp) + ImageWrite 185 186 187 + 188: 18(float) Load 178(storeTemp) + Store 174(val1) 188 + 190: 62(ptr) AccessChain 61 53 + 191: 6(int) Load 190 + Store 189(coordTemp) 191 + 193: 68 Load 70(g_tTex1df1) + 194: 6(int) Load 189(coordTemp) + 195: 18(float) ImageRead 193 194 + Store 192(storeTemp) 195 + 197: 18(float) Load 192(storeTemp) + 198: 18(float) FSub 197 196 + Store 192(storeTemp) 198 + 199: 68 Load 70(g_tTex1df1) + 200: 6(int) Load 189(coordTemp) + 201: 18(float) Load 192(storeTemp) + ImageWrite 199 200 201 + 203: 62(ptr) AccessChain 61 53 + 204: 6(int) Load 203 + Store 202(coordTemp) 204 + 206: 68 Load 70(g_tTex1df1) + 207: 6(int) Load 202(coordTemp) + 208: 18(float) ImageRead 206 207 + Store 205(storeTemp) 208 + 210: 18(float) Load 205(storeTemp) + 211: 18(float) FAdd 210 209 + Store 205(storeTemp) 211 + 212: 68 Load 70(g_tTex1df1) + 213: 6(int) Load 202(coordTemp) + 214: 18(float) Load 205(storeTemp) + ImageWrite 212 213 214 + 216: 62(ptr) AccessChain 61 53 + 217: 6(int) Load 216 + Store 215(coordTemp) 217 + 219: 81 Load 83(g_tTex1di1) + 220: 6(int) Load 215(coordTemp) + 221: 6(int) ImageRead 219 220 + Store 218(storeTemp) 221 + 222: 6(int) Load 218(storeTemp) + 223: 6(int) SDiv 222 127 + Store 218(storeTemp) 223 + 224: 81 Load 83(g_tTex1di1) + 225: 6(int) Load 215(coordTemp) + 226: 6(int) Load 218(storeTemp) + ImageWrite 224 225 226 + 228: 62(ptr) AccessChain 61 53 + 229: 6(int) Load 228 + Store 227(coordTemp) 229 + 231: 81 Load 83(g_tTex1di1) + 232: 6(int) Load 227(coordTemp) + 233: 6(int) ImageRead 231 232 + Store 230(storeTemp) 233 + 234: 6(int) Load 230(storeTemp) + 235: 6(int) SMod 234 127 + Store 230(storeTemp) 235 + 236: 81 Load 83(g_tTex1di1) + 237: 6(int) Load 227(coordTemp) + 238: 6(int) Load 230(storeTemp) + ImageWrite 236 237 238 + 240: 62(ptr) AccessChain 61 53 + 241: 6(int) Load 240 + Store 239(coordTemp) 241 + 243: 81 Load 83(g_tTex1di1) + 244: 6(int) Load 239(coordTemp) + 245: 6(int) ImageRead 243 244 + Store 242(storeTemp) 245 + 247: 6(int) Load 242(storeTemp) + 248: 6(int) BitwiseAnd 247 246 + Store 242(storeTemp) 248 + 249: 81 Load 83(g_tTex1di1) + 250: 6(int) Load 239(coordTemp) + 251: 6(int) Load 242(storeTemp) + ImageWrite 249 250 251 + 253: 62(ptr) AccessChain 61 53 + 254: 6(int) Load 253 + Store 252(coordTemp) 254 + 256: 81 Load 83(g_tTex1di1) + 257: 6(int) Load 252(coordTemp) + 258: 6(int) ImageRead 256 257 + Store 255(storeTemp) 258 + 260: 6(int) Load 255(storeTemp) + 261: 6(int) BitwiseOr 260 259 + Store 255(storeTemp) 261 + 262: 81 Load 83(g_tTex1di1) + 263: 6(int) Load 252(coordTemp) + 264: 6(int) Load 255(storeTemp) + ImageWrite 262 263 264 + 266: 62(ptr) AccessChain 61 53 + 267: 6(int) Load 266 + Store 265(coordTemp) 267 + 269: 81 Load 83(g_tTex1di1) + 270: 6(int) Load 265(coordTemp) + 271: 6(int) ImageRead 269 270 + Store 268(storeTemp) 271 + 272: 6(int) Load 268(storeTemp) + 273: 6(int) ShiftLeftLogical 272 127 + Store 268(storeTemp) 273 + 274: 81 Load 83(g_tTex1di1) + 275: 6(int) Load 265(coordTemp) + 276: 6(int) Load 268(storeTemp) + ImageWrite 274 275 276 + 278: 62(ptr) AccessChain 61 53 + 279: 6(int) Load 278 + Store 277(coordTemp) 279 + 281: 81 Load 83(g_tTex1di1) + 282: 6(int) Load 277(coordTemp) + 283: 6(int) ImageRead 281 282 + Store 280(storeTemp) 283 + 284: 6(int) Load 280(storeTemp) + 285: 6(int) ShiftRightArithmetic 284 127 + Store 280(storeTemp) 285 + 286: 81 Load 83(g_tTex1di1) + 287: 6(int) Load 277(coordTemp) + 288: 6(int) Load 280(storeTemp) + ImageWrite 286 287 288 + 290: 18(float) FunctionCall 37(SomeValue() + Store 289(storeTemp) 290 + 291: 97 Load 99(g_tTex2df1) + 292: 102(ptr) AccessChain 61 101 + 293: 56(ivec2) Load 292 + 294: 18(float) Load 289(storeTemp) + ImageWrite 291 293 294 + 295: 97 Load 99(g_tTex2df1) + 296: 102(ptr) AccessChain 61 101 + 297: 56(ivec2) Load 296 + 298: 18(float) Load 148(lf1) + ImageWrite 295 297 298 + Store 299(storeTemp) 300 + 301: 107 Load 109(g_tTex2di1) + 302: 102(ptr) AccessChain 61 101 + 303: 56(ivec2) Load 302 + 304: 6(int) Load 299(storeTemp) + ImageWrite 301 303 304 + Store 305(storeTemp) 306 + 307: 115 Load 117(g_tTex2du1) + 308: 102(ptr) AccessChain 61 101 + 309: 56(ivec2) Load 308 + 310: 12(int) Load 305(storeTemp) + ImageWrite 307 309 310 + 312: 18(float) FunctionCall 37(SomeValue() + Store 311(storeTemp) 312 + 313: 123 Load 125(g_tTex3df1) + 314: 128(ptr) AccessChain 61 127 + 315: 57(ivec3) Load 314 + 316: 18(float) Load 311(storeTemp) + ImageWrite 313 315 316 + 317: 123 Load 125(g_tTex3df1) + 318: 128(ptr) AccessChain 61 127 + 319: 57(ivec3) Load 318 + 320: 18(float) Load 148(lf1) + ImageWrite 317 319 320 + Store 321(storeTemp) 149 + 322: 133 Load 135(g_tTex3di1) + 323: 128(ptr) AccessChain 61 127 + 324: 57(ivec3) Load 323 + 325: 6(int) Load 321(storeTemp) + ImageWrite 322 324 325 + Store 326(storeTemp) 327 + 328: 141 Load 143(g_tTex3du1) + 329: 128(ptr) AccessChain 61 127 + 330: 57(ivec3) Load 329 + 331: 12(int) Load 326(storeTemp) + ImageWrite 328 330 331 + 332: 68 Load 70(g_tTex1df1) + 333: 62(ptr) AccessChain 61 53 + 334: 6(int) Load 333 + 335: 18(float) ImageRead 332 334 + Store 336(param) 335 + 337: 18(float) FunctionCall 22(Fn1(f1;) 336(param) + 338: 81 Load 83(g_tTex1di1) + 339: 62(ptr) AccessChain 61 53 + 340: 6(int) Load 339 + 341: 6(int) ImageRead 338 340 + Store 342(param) 341 + 343: 6(int) FunctionCall 10(Fn1(i1;) 342(param) + 344: 89 Load 91(g_tTex1du1) + 345: 62(ptr) AccessChain 61 53 + 346: 6(int) Load 345 + 347: 12(int) ImageRead 344 346 + Store 348(param) 347 + 349: 12(int) FunctionCall 16(Fn1(u1;) 348(param) + 352: 2 FunctionCall 34(Fn2(f1;) 351(param) + 353: 18(float) Load 351(param) + Store 350(tempArg) 353 + 354: 68 Load 70(g_tTex1df1) + 355: 62(ptr) AccessChain 61 53 + 356: 6(int) Load 355 + 357: 18(float) Load 350(tempArg) + ImageWrite 354 356 357 + 360: 2 FunctionCall 26(Fn2(i1;) 359(param) + 361: 6(int) Load 359(param) + Store 358(tempArg) 361 + 362: 81 Load 83(g_tTex1di1) + 363: 62(ptr) AccessChain 61 53 + 364: 6(int) Load 363 + 365: 6(int) Load 358(tempArg) + ImageWrite 362 364 365 + 368: 2 FunctionCall 30(Fn2(u1;) 367(param) + 369: 12(int) Load 367(param) + Store 366(tempArg) 369 + 370: 89 Load 91(g_tTex1du1) + 371: 62(ptr) AccessChain 61 53 + 372: 6(int) Load 371 + 373: 12(int) Load 366(tempArg) + ImageWrite 370 372 373 + 375: 62(ptr) AccessChain 61 53 + 376: 6(int) Load 375 + Store 374(coordTemp) 376 + 378: 68 Load 70(g_tTex1df1) + 379: 6(int) Load 374(coordTemp) + 380: 18(float) ImageRead 378 379 + Store 377(storeTemp) 380 + 381: 18(float) Load 377(storeTemp) + 383: 18(float) FAdd 381 382 + Store 377(storeTemp) 383 + 384: 68 Load 70(g_tTex1df1) + 385: 6(int) Load 374(coordTemp) + 386: 18(float) Load 377(storeTemp) + ImageWrite 384 385 386 + 388: 62(ptr) AccessChain 61 53 + 389: 6(int) Load 388 + Store 387(coordTemp) 389 + 391: 81 Load 83(g_tTex1di1) + 392: 6(int) Load 387(coordTemp) + 393: 6(int) ImageRead 391 392 + Store 390(storeTemp) 393 + 394: 6(int) Load 390(storeTemp) + 395: 6(int) IAdd 394 101 + Store 390(storeTemp) 395 + 396: 81 Load 83(g_tTex1di1) + 397: 6(int) Load 387(coordTemp) + 398: 6(int) Load 390(storeTemp) + ImageWrite 396 397 398 + 400: 62(ptr) AccessChain 61 53 + 401: 6(int) Load 400 + Store 399(coordTemp) 401 + 403: 89 Load 91(g_tTex1du1) + 404: 6(int) Load 399(coordTemp) + 405: 12(int) ImageRead 403 404 + Store 402(storeTemp) 405 + 406: 12(int) Load 402(storeTemp) + 407: 12(int) IAdd 406 101 + Store 402(storeTemp) 407 + 408: 89 Load 91(g_tTex1du1) + 409: 6(int) Load 399(coordTemp) + 410: 12(int) Load 402(storeTemp) + ImageWrite 408 409 410 + 412: 62(ptr) AccessChain 61 53 + 413: 6(int) Load 412 + Store 411(coordTemp) 413 + 415: 68 Load 70(g_tTex1df1) + 416: 6(int) Load 411(coordTemp) + 417: 18(float) ImageRead 415 416 + Store 414(storeTemp) 417 + 418: 18(float) Load 414(storeTemp) + 419: 18(float) FSub 418 382 + Store 414(storeTemp) 419 + 420: 68 Load 70(g_tTex1df1) + 421: 6(int) Load 411(coordTemp) + 422: 18(float) Load 414(storeTemp) + ImageWrite 420 421 422 + 424: 62(ptr) AccessChain 61 53 + 425: 6(int) Load 424 + Store 423(coordTemp) 425 + 427: 81 Load 83(g_tTex1di1) + 428: 6(int) Load 423(coordTemp) + 429: 6(int) ImageRead 427 428 + Store 426(storeTemp) 429 + 430: 6(int) Load 426(storeTemp) + 431: 6(int) ISub 430 101 + Store 426(storeTemp) 431 + 432: 81 Load 83(g_tTex1di1) + 433: 6(int) Load 423(coordTemp) + 434: 6(int) Load 426(storeTemp) + ImageWrite 432 433 434 + 436: 62(ptr) AccessChain 61 53 + 437: 6(int) Load 436 + Store 435(coordTemp) 437 + 439: 89 Load 91(g_tTex1du1) + 440: 6(int) Load 435(coordTemp) + 441: 12(int) ImageRead 439 440 + Store 438(storeTemp) 441 + 442: 12(int) Load 438(storeTemp) + 443: 12(int) ISub 442 101 + Store 438(storeTemp) 443 + 444: 89 Load 91(g_tTex1du1) + 445: 6(int) Load 435(coordTemp) + 446: 12(int) Load 438(storeTemp) + ImageWrite 444 445 446 + 448: 62(ptr) AccessChain 61 53 + 449: 6(int) Load 448 + Store 447(coordTemp) 449 + 451: 68 Load 70(g_tTex1df1) + 452: 6(int) Load 447(coordTemp) + 453: 18(float) ImageRead 451 452 + Store 450(storeTempPre) 453 + 455: 18(float) Load 450(storeTempPre) + Store 454(storeTempPost) 455 + 456: 18(float) Load 454(storeTempPost) + 457: 18(float) FAdd 456 382 + Store 454(storeTempPost) 457 + 458: 68 Load 70(g_tTex1df1) + 459: 6(int) Load 447(coordTemp) + 460: 18(float) Load 454(storeTempPost) + ImageWrite 458 459 460 + 462: 62(ptr) AccessChain 61 53 + 463: 6(int) Load 462 + Store 461(coordTemp) 463 + 465: 89 Load 91(g_tTex1du1) + 466: 6(int) Load 461(coordTemp) + 467: 12(int) ImageRead 465 466 + Store 464(storeTempPre) 467 + 469: 12(int) Load 464(storeTempPre) + Store 468(storeTempPost) 469 + 470: 12(int) Load 468(storeTempPost) + 471: 12(int) ISub 470 101 + Store 468(storeTempPost) 471 + 472: 89 Load 91(g_tTex1du1) + 473: 6(int) Load 461(coordTemp) + 474: 12(int) Load 468(storeTempPost) + ImageWrite 472 473 474 + 476: 62(ptr) AccessChain 61 53 + 477: 6(int) Load 476 + Store 475(coordTemp) 477 + 479: 81 Load 83(g_tTex1di1) + 480: 6(int) Load 475(coordTemp) + 481: 6(int) ImageRead 479 480 + Store 478(storeTempPre) 481 + 483: 6(int) Load 478(storeTempPre) + Store 482(storeTempPost) 483 + 484: 6(int) Load 482(storeTempPost) + 485: 6(int) IAdd 484 101 + Store 482(storeTempPost) 485 + 486: 81 Load 83(g_tTex1di1) + 487: 6(int) Load 475(coordTemp) + 488: 6(int) Load 482(storeTempPost) + ImageWrite 486 487 488 + 490: 62(ptr) AccessChain 61 53 + 491: 6(int) Load 490 + Store 489(coordTemp) 491 + 493: 68 Load 70(g_tTex1df1) + 494: 6(int) Load 489(coordTemp) + 495: 18(float) ImageRead 493 494 + Store 492(storeTempPre) 495 + 497: 18(float) Load 492(storeTempPre) + Store 496(storeTempPost) 497 + 498: 18(float) Load 496(storeTempPost) + 499: 18(float) FSub 498 382 + Store 496(storeTempPost) 499 + 500: 68 Load 70(g_tTex1df1) + 501: 6(int) Load 489(coordTemp) + 502: 18(float) Load 496(storeTempPost) + ImageWrite 500 501 502 + 504: 62(ptr) AccessChain 61 53 + 505: 6(int) Load 504 + Store 503(coordTemp) 505 + 507: 81 Load 83(g_tTex1di1) + 508: 6(int) Load 503(coordTemp) + 509: 6(int) ImageRead 507 508 + Store 506(storeTempPre) 509 + 511: 6(int) Load 506(storeTempPre) + Store 510(storeTempPost) 511 + 512: 6(int) Load 510(storeTempPost) + 513: 6(int) IAdd 512 101 + Store 510(storeTempPost) 513 + 514: 81 Load 83(g_tTex1di1) + 515: 6(int) Load 503(coordTemp) + 516: 6(int) Load 510(storeTempPost) + ImageWrite 514 515 516 + 518: 62(ptr) AccessChain 61 53 + 519: 6(int) Load 518 + Store 517(coordTemp) 519 + 521: 89 Load 91(g_tTex1du1) + 522: 6(int) Load 517(coordTemp) + 523: 12(int) ImageRead 521 522 + Store 520(storeTempPre) 523 + 525: 12(int) Load 520(storeTempPre) + Store 524(storeTempPost) 525 + 526: 12(int) Load 524(storeTempPost) + 527: 12(int) ISub 526 101 + Store 524(storeTempPost) 527 + 528: 89 Load 91(g_tTex1du1) + 529: 6(int) Load 517(coordTemp) + 530: 12(int) Load 524(storeTempPost) + ImageWrite 528 529 530 + 532: 97 Load 99(g_tTex2df1) + 535: 18(float) ImageRead 532 534 + Store 531(storeTemp) 535 + 536: 68 Load 70(g_tTex1df1) + 537: 18(float) Load 531(storeTemp) + ImageWrite 536 101 537 + 542: 541(ptr) AccessChain 539(psout) 53 + Store 542 540 + 543:40(PS_OUTPUT) Load 539(psout) + ReturnValue 543 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out b/deps/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out new file mode 100644 index 00000000..8fcbb4ba --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out @@ -0,0 +1,300 @@ +hlsl.rw.swizzle.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: SomeValue( ( temp 3-component vector of float) +0:4 Function Parameters: +0:? Sequence +0:4 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:7 Function Definition: @main( ( temp 4-component vector of float) +0:7 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 2-component vector of int) +0:8 'tc2' ( temp 2-component vector of int) +0:8 Constant: +0:8 0 (const int) +0:8 0 (const int) +0:9 Sequence +0:9 move second child to first child ( temp int) +0:9 'tc' ( temp int) +0:9 Constant: +0:9 0 (const int) +0:12 Sequence +0:12 move second child to first child ( temp 3-component vector of float) +0:12 vector swizzle ( temp 3-component vector of float) +0:12 'storeTemp' ( temp 3-component vector of float) +0:12 Sequence +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 0 (const int) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:12 imageStore ( temp void) +0:12 'rwtx' (layout( rgba32f) uniform image2D) +0:12 'tc2' ( temp 2-component vector of int) +0:12 'storeTemp' ( temp 3-component vector of float) +0:12 'storeTemp' ( temp 3-component vector of float) +0:13 Sequence +0:13 move second child to first child ( temp 3-component vector of float) +0:13 vector swizzle ( temp 3-component vector of float) +0:13 'storeTemp' ( temp 3-component vector of float) +0:13 Sequence +0:13 Constant: +0:13 2 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Function Call: SomeValue( ( temp 3-component vector of float) +0:13 imageStore ( temp void) +0:13 'rwtx' (layout( rgba32f) uniform image2D) +0:13 'tc2' ( temp 2-component vector of int) +0:13 'storeTemp' ( temp 3-component vector of float) +0:13 'storeTemp' ( temp 3-component vector of float) +0:14 Sequence +0:14 move second child to first child ( temp 3-component vector of float) +0:14 vector swizzle ( temp 3-component vector of float) +0:14 'storeTemp' ( temp 3-component vector of float) +0:14 Sequence +0:14 Constant: +0:14 2 (const int) +0:14 Constant: +0:14 1 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 2.000000 +0:14 2.000000 +0:14 2.000000 +0:14 imageStore ( temp void) +0:14 'rwtx' (layout( rgba32f) uniform image2D) +0:14 'tc2' ( temp 2-component vector of int) +0:14 'storeTemp' ( temp 3-component vector of float) +0:14 'storeTemp' ( temp 3-component vector of float) +0:27 Branch: Return with expression +0:27 Constant: +0:27 0.000000 +0:27 0.000000 +0:27 0.000000 +0:27 0.000000 +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'rwtx' (layout( rgba32f) uniform image2D) +0:? 'buf' (layout( rgba32f) uniform imageBuffer) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: SomeValue( ( temp 3-component vector of float) +0:4 Function Parameters: +0:? Sequence +0:4 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:7 Function Definition: @main( ( temp 4-component vector of float) +0:7 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 2-component vector of int) +0:8 'tc2' ( temp 2-component vector of int) +0:8 Constant: +0:8 0 (const int) +0:8 0 (const int) +0:9 Sequence +0:9 move second child to first child ( temp int) +0:9 'tc' ( temp int) +0:9 Constant: +0:9 0 (const int) +0:12 Sequence +0:12 move second child to first child ( temp 3-component vector of float) +0:12 vector swizzle ( temp 3-component vector of float) +0:12 'storeTemp' ( temp 3-component vector of float) +0:12 Sequence +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 0 (const int) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:12 imageStore ( temp void) +0:12 'rwtx' (layout( rgba32f) uniform image2D) +0:12 'tc2' ( temp 2-component vector of int) +0:12 'storeTemp' ( temp 3-component vector of float) +0:12 'storeTemp' ( temp 3-component vector of float) +0:13 Sequence +0:13 move second child to first child ( temp 3-component vector of float) +0:13 vector swizzle ( temp 3-component vector of float) +0:13 'storeTemp' ( temp 3-component vector of float) +0:13 Sequence +0:13 Constant: +0:13 2 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Function Call: SomeValue( ( temp 3-component vector of float) +0:13 imageStore ( temp void) +0:13 'rwtx' (layout( rgba32f) uniform image2D) +0:13 'tc2' ( temp 2-component vector of int) +0:13 'storeTemp' ( temp 3-component vector of float) +0:13 'storeTemp' ( temp 3-component vector of float) +0:14 Sequence +0:14 move second child to first child ( temp 3-component vector of float) +0:14 vector swizzle ( temp 3-component vector of float) +0:14 'storeTemp' ( temp 3-component vector of float) +0:14 Sequence +0:14 Constant: +0:14 2 (const int) +0:14 Constant: +0:14 1 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 2.000000 +0:14 2.000000 +0:14 2.000000 +0:14 imageStore ( temp void) +0:14 'rwtx' (layout( rgba32f) uniform image2D) +0:14 'tc2' ( temp 2-component vector of int) +0:14 'storeTemp' ( temp 3-component vector of float) +0:14 'storeTemp' ( temp 3-component vector of float) +0:27 Branch: Return with expression +0:27 Constant: +0:27 0.000000 +0:27 0.000000 +0:27 0.000000 +0:27 0.000000 +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'rwtx' (layout( rgba32f) uniform image2D) +0:? 'buf' (layout( rgba32f) uniform imageBuffer) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 63 + + Capability Shader + Capability ImageBuffer + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 58 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "SomeValue(" + Name 13 "@main(" + Name 24 "tc2" + Name 28 "tc" + Name 30 "storeTemp" + Name 35 "rwtx" + Name 39 "storeTemp" + Name 46 "storeTemp" + Name 58 "@entryPointOutput" + Name 62 "buf" + Decorate 35(rwtx) DescriptorSet 0 + Decorate 58(@entryPointOutput) Location 0 + Decorate 62(buf) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8: TypeFunction 7(fvec3) + 11: TypeVector 6(float) 4 + 12: TypeFunction 11(fvec4) + 15: 6(float) Constant 1065353216 + 16: 6(float) Constant 1073741824 + 17: 6(float) Constant 1077936128 + 18: 7(fvec3) ConstantComposite 15 16 17 + 21: TypeInt 32 1 + 22: TypeVector 21(int) 2 + 23: TypePointer Function 22(ivec2) + 25: 21(int) Constant 0 + 26: 22(ivec2) ConstantComposite 25 25 + 27: TypePointer Function 21(int) + 29: TypePointer Function 7(fvec3) + 33: TypeImage 6(float) 2D nonsampled format:Rgba32f + 34: TypePointer UniformConstant 33 + 35(rwtx): 34(ptr) Variable UniformConstant + 47: 7(fvec3) ConstantComposite 16 16 16 + 53: 6(float) Constant 0 + 54: 11(fvec4) ConstantComposite 53 53 53 53 + 57: TypePointer Output 11(fvec4) +58(@entryPointOutput): 57(ptr) Variable Output + 60: TypeImage 6(float) Buffer nonsampled format:Rgba32f + 61: TypePointer UniformConstant 60 + 62(buf): 61(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 59: 11(fvec4) FunctionCall 13(@main() + Store 58(@entryPointOutput) 59 + Return + FunctionEnd + 9(SomeValue(): 7(fvec3) Function None 8 + 10: Label + ReturnValue 18 + FunctionEnd + 13(@main(): 11(fvec4) Function None 12 + 14: Label + 24(tc2): 23(ptr) Variable Function + 28(tc): 27(ptr) Variable Function + 30(storeTemp): 29(ptr) Variable Function + 39(storeTemp): 29(ptr) Variable Function + 46(storeTemp): 29(ptr) Variable Function + Store 24(tc2) 26 + Store 28(tc) 25 + 31: 7(fvec3) Load 30(storeTemp) + 32: 7(fvec3) VectorShuffle 31 18 5 4 3 + Store 30(storeTemp) 32 + 36: 33 Load 35(rwtx) + 37: 22(ivec2) Load 24(tc2) + 38: 7(fvec3) Load 30(storeTemp) + ImageWrite 36 37 38 + 40: 7(fvec3) FunctionCall 9(SomeValue() + 41: 7(fvec3) Load 39(storeTemp) + 42: 7(fvec3) VectorShuffle 41 40 5 4 3 + Store 39(storeTemp) 42 + 43: 33 Load 35(rwtx) + 44: 22(ivec2) Load 24(tc2) + 45: 7(fvec3) Load 39(storeTemp) + ImageWrite 43 44 45 + 48: 7(fvec3) Load 46(storeTemp) + 49: 7(fvec3) VectorShuffle 48 47 5 4 3 + Store 46(storeTemp) 49 + 50: 33 Load 35(rwtx) + 51: 22(ivec2) Load 24(tc2) + 52: 7(fvec3) Load 46(storeTemp) + ImageWrite 50 51 52 + ReturnValue 54 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out b/deps/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out new file mode 100644 index 00000000..bf1fe088 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out @@ -0,0 +1,2627 @@ +hlsl.rw.vec2.bracket.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:42 Function Definition: Fn1(vi2; ( temp 2-component vector of int) +0:42 Function Parameters: +0:42 'x' ( in 2-component vector of int) +0:? Sequence +0:42 Branch: Return with expression +0:42 'x' ( in 2-component vector of int) +0:43 Function Definition: Fn1(vu2; ( temp 2-component vector of uint) +0:43 Function Parameters: +0:43 'x' ( in 2-component vector of uint) +0:? Sequence +0:43 Branch: Return with expression +0:43 'x' ( in 2-component vector of uint) +0:44 Function Definition: Fn1(vf2; ( temp 2-component vector of float) +0:44 Function Parameters: +0:44 'x' ( in 2-component vector of float) +0:? Sequence +0:44 Branch: Return with expression +0:44 'x' ( in 2-component vector of float) +0:46 Function Definition: Fn2(vi2; ( temp void) +0:46 Function Parameters: +0:46 'x' ( out 2-component vector of int) +0:? Sequence +0:46 move second child to first child ( temp 2-component vector of int) +0:46 'x' ( out 2-component vector of int) +0:? Constant: +0:? 0 (const int) +0:? 0 (const int) +0:47 Function Definition: Fn2(vu2; ( temp void) +0:47 Function Parameters: +0:47 'x' ( out 2-component vector of uint) +0:? Sequence +0:47 move second child to first child ( temp 2-component vector of uint) +0:47 'x' ( out 2-component vector of uint) +0:? Constant: +0:? 0 (const uint) +0:? 0 (const uint) +0:48 Function Definition: Fn2(vf2; ( temp void) +0:48 Function Parameters: +0:48 'x' ( out 2-component vector of float) +0:? Sequence +0:48 move second child to first child ( temp 2-component vector of float) +0:48 'x' ( out 2-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:50 Function Definition: SomeValue( ( temp 2-component vector of float) +0:50 Function Parameters: +0:? Sequence +0:50 Branch: Return with expression +0:50 Convert int to float ( temp 2-component vector of float) +0:50 c2: direct index for structure ( uniform 2-component vector of int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:50 Constant: +0:50 1 (const uint) +0:53 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:53 Function Parameters: +0:? Sequence +0:57 imageLoad ( temp 2-component vector of float) +0:57 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:57 c1: direct index for structure ( uniform int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:57 Constant: +0:57 0 (const uint) +0:59 Sequence +0:59 move second child to first child ( temp 2-component vector of float) +0:59 'r00' ( temp 2-component vector of float) +0:59 imageLoad ( temp 2-component vector of float) +0:59 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:59 c1: direct index for structure ( uniform int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:59 Constant: +0:59 0 (const uint) +0:60 Sequence +0:60 move second child to first child ( temp 2-component vector of int) +0:60 'r01' ( temp 2-component vector of int) +0:60 imageLoad ( temp 2-component vector of int) +0:60 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:60 c1: direct index for structure ( uniform int) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:60 Constant: +0:60 0 (const uint) +0:61 Sequence +0:61 move second child to first child ( temp 2-component vector of uint) +0:61 'r02' ( temp 2-component vector of uint) +0:61 imageLoad ( temp 2-component vector of uint) +0:61 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:61 c1: direct index for structure ( uniform int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:61 Constant: +0:61 0 (const uint) +0:64 Sequence +0:64 move second child to first child ( temp 2-component vector of float) +0:64 'r10' ( temp 2-component vector of float) +0:64 imageLoad ( temp 2-component vector of float) +0:64 'g_tTex2df2' (layout( rg32f) uniform image2D) +0:64 c2: direct index for structure ( uniform 2-component vector of int) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:64 Constant: +0:64 1 (const uint) +0:65 Sequence +0:65 move second child to first child ( temp 2-component vector of int) +0:65 'r11' ( temp 2-component vector of int) +0:65 imageLoad ( temp 2-component vector of int) +0:65 'g_tTex2di2' (layout( rg32i) uniform iimage2D) +0:65 c2: direct index for structure ( uniform 2-component vector of int) +0:65 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:65 Constant: +0:65 1 (const uint) +0:66 Sequence +0:66 move second child to first child ( temp 2-component vector of uint) +0:66 'r12' ( temp 2-component vector of uint) +0:66 imageLoad ( temp 2-component vector of uint) +0:66 'g_tTex2du2' (layout( rg32ui) uniform uimage2D) +0:66 c2: direct index for structure ( uniform 2-component vector of int) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:66 Constant: +0:66 1 (const uint) +0:69 Sequence +0:69 move second child to first child ( temp 2-component vector of float) +0:69 'r20' ( temp 2-component vector of float) +0:69 imageLoad ( temp 2-component vector of float) +0:69 'g_tTex3df2' (layout( rg32f) uniform image3D) +0:69 c3: direct index for structure ( uniform 3-component vector of int) +0:69 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:69 Constant: +0:69 2 (const uint) +0:70 Sequence +0:70 move second child to first child ( temp 2-component vector of int) +0:70 'r21' ( temp 2-component vector of int) +0:70 imageLoad ( temp 2-component vector of int) +0:70 'g_tTex3di2' (layout( rg32i) uniform iimage3D) +0:70 c3: direct index for structure ( uniform 3-component vector of int) +0:70 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:70 Constant: +0:70 2 (const uint) +0:71 Sequence +0:71 move second child to first child ( temp 2-component vector of uint) +0:71 'r22' ( temp 2-component vector of uint) +0:71 imageLoad ( temp 2-component vector of uint) +0:71 'g_tTex3du2' (layout( rg32ui) uniform uimage3D) +0:71 c3: direct index for structure ( uniform 3-component vector of int) +0:71 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:71 Constant: +0:71 2 (const uint) +0:73 Sequence +0:73 move second child to first child ( temp 2-component vector of float) +0:73 'lf2' ( temp 2-component vector of float) +0:73 uf2: direct index for structure ( uniform 2-component vector of float) +0:73 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:73 Constant: +0:73 8 (const uint) +0:77 Sequence +0:77 move second child to first child ( temp 2-component vector of float) +0:77 'storeTemp' ( temp 2-component vector of float) +0:77 Function Call: SomeValue( ( temp 2-component vector of float) +0:77 imageStore ( temp void) +0:77 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:77 c1: direct index for structure ( uniform int) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:77 Constant: +0:77 0 (const uint) +0:77 'storeTemp' ( temp 2-component vector of float) +0:77 'storeTemp' ( temp 2-component vector of float) +0:78 Sequence +0:78 imageStore ( temp void) +0:78 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:78 c1: direct index for structure ( uniform int) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:78 Constant: +0:78 0 (const uint) +0:78 'lf2' ( temp 2-component vector of float) +0:78 'lf2' ( temp 2-component vector of float) +0:79 Sequence +0:79 move second child to first child ( temp 2-component vector of int) +0:79 'storeTemp' ( temp 2-component vector of int) +0:? Constant: +0:? 2 (const int) +0:? 2 (const int) +0:79 imageStore ( temp void) +0:79 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:79 c1: direct index for structure ( uniform int) +0:79 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:79 Constant: +0:79 0 (const uint) +0:79 'storeTemp' ( temp 2-component vector of int) +0:79 'storeTemp' ( temp 2-component vector of int) +0:80 Sequence +0:80 move second child to first child ( temp 2-component vector of uint) +0:80 'storeTemp' ( temp 2-component vector of uint) +0:? Constant: +0:? 3 (const uint) +0:? 2 (const uint) +0:80 imageStore ( temp void) +0:80 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:80 c1: direct index for structure ( uniform int) +0:80 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:80 Constant: +0:80 0 (const uint) +0:80 'storeTemp' ( temp 2-component vector of uint) +0:80 'storeTemp' ( temp 2-component vector of uint) +0:83 Sequence +0:83 move second child to first child ( temp 2-component vector of float) +0:83 'val1' ( temp 2-component vector of float) +0:83 Sequence +0:83 move second child to first child ( temp int) +0:83 'coordTemp' ( temp int) +0:83 c1: direct index for structure ( uniform int) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:83 Constant: +0:83 0 (const uint) +0:83 move second child to first child ( temp 2-component vector of float) +0:83 'storeTemp' ( temp 2-component vector of float) +0:83 imageLoad ( temp 2-component vector of float) +0:83 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:83 'coordTemp' ( temp int) +0:83 vector scale second child into first child ( temp 2-component vector of float) +0:83 'storeTemp' ( temp 2-component vector of float) +0:83 Constant: +0:83 2.000000 +0:83 imageStore ( temp void) +0:83 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:83 'coordTemp' ( temp int) +0:83 'storeTemp' ( temp 2-component vector of float) +0:83 'storeTemp' ( temp 2-component vector of float) +0:84 Sequence +0:84 move second child to first child ( temp int) +0:84 'coordTemp' ( temp int) +0:84 c1: direct index for structure ( uniform int) +0:84 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:84 Constant: +0:84 0 (const uint) +0:84 move second child to first child ( temp 2-component vector of float) +0:84 'storeTemp' ( temp 2-component vector of float) +0:84 imageLoad ( temp 2-component vector of float) +0:84 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:84 'coordTemp' ( temp int) +0:84 subtract second child into first child ( temp 2-component vector of float) +0:84 'storeTemp' ( temp 2-component vector of float) +0:84 Constant: +0:84 3.000000 +0:84 imageStore ( temp void) +0:84 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:84 'coordTemp' ( temp int) +0:84 'storeTemp' ( temp 2-component vector of float) +0:84 'storeTemp' ( temp 2-component vector of float) +0:85 Sequence +0:85 move second child to first child ( temp int) +0:85 'coordTemp' ( temp int) +0:85 c1: direct index for structure ( uniform int) +0:85 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:85 Constant: +0:85 0 (const uint) +0:85 move second child to first child ( temp 2-component vector of float) +0:85 'storeTemp' ( temp 2-component vector of float) +0:85 imageLoad ( temp 2-component vector of float) +0:85 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:85 'coordTemp' ( temp int) +0:85 add second child into first child ( temp 2-component vector of float) +0:85 'storeTemp' ( temp 2-component vector of float) +0:85 Constant: +0:85 4.000000 +0:85 imageStore ( temp void) +0:85 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:85 'coordTemp' ( temp int) +0:85 'storeTemp' ( temp 2-component vector of float) +0:85 'storeTemp' ( temp 2-component vector of float) +0:87 Sequence +0:87 move second child to first child ( temp int) +0:87 'coordTemp' ( temp int) +0:87 c1: direct index for structure ( uniform int) +0:87 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:87 Constant: +0:87 0 (const uint) +0:87 move second child to first child ( temp 2-component vector of int) +0:87 'storeTemp' ( temp 2-component vector of int) +0:87 imageLoad ( temp 2-component vector of int) +0:87 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:87 'coordTemp' ( temp int) +0:87 divide second child into first child ( temp 2-component vector of int) +0:87 'storeTemp' ( temp 2-component vector of int) +0:87 Constant: +0:87 2 (const int) +0:87 imageStore ( temp void) +0:87 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:87 'coordTemp' ( temp int) +0:87 'storeTemp' ( temp 2-component vector of int) +0:87 'storeTemp' ( temp 2-component vector of int) +0:88 Sequence +0:88 move second child to first child ( temp int) +0:88 'coordTemp' ( temp int) +0:88 c1: direct index for structure ( uniform int) +0:88 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:88 Constant: +0:88 0 (const uint) +0:88 move second child to first child ( temp 2-component vector of int) +0:88 'storeTemp' ( temp 2-component vector of int) +0:88 imageLoad ( temp 2-component vector of int) +0:88 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:88 'coordTemp' ( temp int) +0:88 mod second child into first child ( temp 2-component vector of int) +0:88 'storeTemp' ( temp 2-component vector of int) +0:88 Constant: +0:88 2 (const int) +0:88 imageStore ( temp void) +0:88 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:88 'coordTemp' ( temp int) +0:88 'storeTemp' ( temp 2-component vector of int) +0:88 'storeTemp' ( temp 2-component vector of int) +0:89 Sequence +0:89 move second child to first child ( temp int) +0:89 'coordTemp' ( temp int) +0:89 c1: direct index for structure ( uniform int) +0:89 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:89 Constant: +0:89 0 (const uint) +0:89 move second child to first child ( temp 2-component vector of int) +0:89 'storeTemp' ( temp 2-component vector of int) +0:89 imageLoad ( temp 2-component vector of int) +0:89 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:89 'coordTemp' ( temp int) +0:89 and second child into first child ( temp 2-component vector of int) +0:89 'storeTemp' ( temp 2-component vector of int) +0:89 Constant: +0:89 65535 (const int) +0:89 imageStore ( temp void) +0:89 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:89 'coordTemp' ( temp int) +0:89 'storeTemp' ( temp 2-component vector of int) +0:89 'storeTemp' ( temp 2-component vector of int) +0:90 Sequence +0:90 move second child to first child ( temp int) +0:90 'coordTemp' ( temp int) +0:90 c1: direct index for structure ( uniform int) +0:90 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:90 Constant: +0:90 0 (const uint) +0:90 move second child to first child ( temp 2-component vector of int) +0:90 'storeTemp' ( temp 2-component vector of int) +0:90 imageLoad ( temp 2-component vector of int) +0:90 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:90 'coordTemp' ( temp int) +0:90 or second child into first child ( temp 2-component vector of int) +0:90 'storeTemp' ( temp 2-component vector of int) +0:90 Constant: +0:90 61680 (const int) +0:90 imageStore ( temp void) +0:90 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:90 'coordTemp' ( temp int) +0:90 'storeTemp' ( temp 2-component vector of int) +0:90 'storeTemp' ( temp 2-component vector of int) +0:91 Sequence +0:91 move second child to first child ( temp int) +0:91 'coordTemp' ( temp int) +0:91 c1: direct index for structure ( uniform int) +0:91 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:91 Constant: +0:91 0 (const uint) +0:91 move second child to first child ( temp 2-component vector of int) +0:91 'storeTemp' ( temp 2-component vector of int) +0:91 imageLoad ( temp 2-component vector of int) +0:91 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:91 'coordTemp' ( temp int) +0:91 left shift second child into first child ( temp 2-component vector of int) +0:91 'storeTemp' ( temp 2-component vector of int) +0:91 Constant: +0:91 2 (const int) +0:91 imageStore ( temp void) +0:91 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:91 'coordTemp' ( temp int) +0:91 'storeTemp' ( temp 2-component vector of int) +0:91 'storeTemp' ( temp 2-component vector of int) +0:92 Sequence +0:92 move second child to first child ( temp int) +0:92 'coordTemp' ( temp int) +0:92 c1: direct index for structure ( uniform int) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:92 Constant: +0:92 0 (const uint) +0:92 move second child to first child ( temp 2-component vector of int) +0:92 'storeTemp' ( temp 2-component vector of int) +0:92 imageLoad ( temp 2-component vector of int) +0:92 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:92 'coordTemp' ( temp int) +0:92 right shift second child into first child ( temp 2-component vector of int) +0:92 'storeTemp' ( temp 2-component vector of int) +0:92 Constant: +0:92 2 (const int) +0:92 imageStore ( temp void) +0:92 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:92 'coordTemp' ( temp int) +0:92 'storeTemp' ( temp 2-component vector of int) +0:92 'storeTemp' ( temp 2-component vector of int) +0:95 Sequence +0:95 move second child to first child ( temp 2-component vector of float) +0:95 'storeTemp' ( temp 2-component vector of float) +0:95 Function Call: SomeValue( ( temp 2-component vector of float) +0:95 imageStore ( temp void) +0:95 'g_tTex2df2' (layout( rg32f) uniform image2D) +0:95 c2: direct index for structure ( uniform 2-component vector of int) +0:95 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:95 Constant: +0:95 1 (const uint) +0:95 'storeTemp' ( temp 2-component vector of float) +0:95 'storeTemp' ( temp 2-component vector of float) +0:96 Sequence +0:96 imageStore ( temp void) +0:96 'g_tTex2df2' (layout( rg32f) uniform image2D) +0:96 c2: direct index for structure ( uniform 2-component vector of int) +0:96 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:96 Constant: +0:96 1 (const uint) +0:96 'lf2' ( temp 2-component vector of float) +0:96 'lf2' ( temp 2-component vector of float) +0:97 Sequence +0:97 move second child to first child ( temp 2-component vector of int) +0:97 'storeTemp' ( temp 2-component vector of int) +0:? Constant: +0:? 5 (const int) +0:? 2 (const int) +0:97 imageStore ( temp void) +0:97 'g_tTex2di2' (layout( rg32i) uniform iimage2D) +0:97 c2: direct index for structure ( uniform 2-component vector of int) +0:97 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:97 Constant: +0:97 1 (const uint) +0:97 'storeTemp' ( temp 2-component vector of int) +0:97 'storeTemp' ( temp 2-component vector of int) +0:98 Sequence +0:98 move second child to first child ( temp 2-component vector of uint) +0:98 'storeTemp' ( temp 2-component vector of uint) +0:? Constant: +0:? 6 (const uint) +0:? 2 (const uint) +0:98 imageStore ( temp void) +0:98 'g_tTex2du2' (layout( rg32ui) uniform uimage2D) +0:98 c2: direct index for structure ( uniform 2-component vector of int) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:98 Constant: +0:98 1 (const uint) +0:98 'storeTemp' ( temp 2-component vector of uint) +0:98 'storeTemp' ( temp 2-component vector of uint) +0:101 Sequence +0:101 move second child to first child ( temp 2-component vector of float) +0:101 'storeTemp' ( temp 2-component vector of float) +0:101 Function Call: SomeValue( ( temp 2-component vector of float) +0:101 imageStore ( temp void) +0:101 'g_tTex3df2' (layout( rg32f) uniform image3D) +0:101 c3: direct index for structure ( uniform 3-component vector of int) +0:101 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:101 Constant: +0:101 2 (const uint) +0:101 'storeTemp' ( temp 2-component vector of float) +0:101 'storeTemp' ( temp 2-component vector of float) +0:102 Sequence +0:102 imageStore ( temp void) +0:102 'g_tTex3df2' (layout( rg32f) uniform image3D) +0:102 c3: direct index for structure ( uniform 3-component vector of int) +0:102 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:102 Constant: +0:102 2 (const uint) +0:102 'lf2' ( temp 2-component vector of float) +0:102 'lf2' ( temp 2-component vector of float) +0:103 Sequence +0:103 move second child to first child ( temp 2-component vector of int) +0:103 'storeTemp' ( temp 2-component vector of int) +0:? Constant: +0:? 8 (const int) +0:? 6 (const int) +0:103 imageStore ( temp void) +0:103 'g_tTex3di2' (layout( rg32i) uniform iimage3D) +0:103 c3: direct index for structure ( uniform 3-component vector of int) +0:103 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:103 Constant: +0:103 2 (const uint) +0:103 'storeTemp' ( temp 2-component vector of int) +0:103 'storeTemp' ( temp 2-component vector of int) +0:104 Sequence +0:104 move second child to first child ( temp 2-component vector of uint) +0:104 'storeTemp' ( temp 2-component vector of uint) +0:? Constant: +0:? 9 (const uint) +0:? 2 (const uint) +0:104 imageStore ( temp void) +0:104 'g_tTex3du2' (layout( rg32ui) uniform uimage3D) +0:104 c3: direct index for structure ( uniform 3-component vector of int) +0:104 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:104 Constant: +0:104 2 (const uint) +0:104 'storeTemp' ( temp 2-component vector of uint) +0:104 'storeTemp' ( temp 2-component vector of uint) +0:107 Function Call: Fn1(vf2; ( temp 2-component vector of float) +0:107 imageLoad ( temp 2-component vector of float) +0:107 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:107 c1: direct index for structure ( uniform int) +0:107 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:107 Constant: +0:107 0 (const uint) +0:108 Function Call: Fn1(vi2; ( temp 2-component vector of int) +0:108 imageLoad ( temp 2-component vector of int) +0:108 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:108 c1: direct index for structure ( uniform int) +0:108 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:108 Constant: +0:108 0 (const uint) +0:109 Function Call: Fn1(vu2; ( temp 2-component vector of uint) +0:109 imageLoad ( temp 2-component vector of uint) +0:109 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:109 c1: direct index for structure ( uniform int) +0:109 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:109 Constant: +0:109 0 (const uint) +0:111 Comma ( temp void) +0:111 Function Call: Fn2(vf2; ( temp void) +0:111 'tempArg' ( temp 2-component vector of float) +0:111 Sequence +0:111 imageStore ( temp void) +0:111 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:111 c1: direct index for structure ( uniform int) +0:111 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:111 Constant: +0:111 0 (const uint) +0:111 'tempArg' ( temp 2-component vector of float) +0:111 'tempArg' ( temp 2-component vector of float) +0:112 Comma ( temp void) +0:112 Function Call: Fn2(vi2; ( temp void) +0:112 'tempArg' ( temp 2-component vector of int) +0:112 Sequence +0:112 imageStore ( temp void) +0:112 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:112 c1: direct index for structure ( uniform int) +0:112 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:112 Constant: +0:112 0 (const uint) +0:112 'tempArg' ( temp 2-component vector of int) +0:112 'tempArg' ( temp 2-component vector of int) +0:113 Comma ( temp void) +0:113 Function Call: Fn2(vu2; ( temp void) +0:113 'tempArg' ( temp 2-component vector of uint) +0:113 Sequence +0:113 imageStore ( temp void) +0:113 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:113 c1: direct index for structure ( uniform int) +0:113 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:113 Constant: +0:113 0 (const uint) +0:113 'tempArg' ( temp 2-component vector of uint) +0:113 'tempArg' ( temp 2-component vector of uint) +0:117 Sequence +0:117 move second child to first child ( temp int) +0:117 'coordTemp' ( temp int) +0:117 c1: direct index for structure ( uniform int) +0:117 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:117 Constant: +0:117 0 (const uint) +0:117 move second child to first child ( temp 2-component vector of float) +0:117 'storeTemp' ( temp 2-component vector of float) +0:117 imageLoad ( temp 2-component vector of float) +0:117 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:117 'coordTemp' ( temp int) +0:117 Pre-Increment ( temp 2-component vector of float) +0:117 'storeTemp' ( temp 2-component vector of float) +0:117 imageStore ( temp void) +0:117 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:117 'coordTemp' ( temp int) +0:117 'storeTemp' ( temp 2-component vector of float) +0:117 'storeTemp' ( temp 2-component vector of float) +0:118 Sequence +0:118 move second child to first child ( temp int) +0:118 'coordTemp' ( temp int) +0:118 c1: direct index for structure ( uniform int) +0:118 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:118 Constant: +0:118 0 (const uint) +0:118 move second child to first child ( temp 2-component vector of int) +0:118 'storeTemp' ( temp 2-component vector of int) +0:118 imageLoad ( temp 2-component vector of int) +0:118 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:118 'coordTemp' ( temp int) +0:118 Pre-Increment ( temp 2-component vector of int) +0:118 'storeTemp' ( temp 2-component vector of int) +0:118 imageStore ( temp void) +0:118 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:118 'coordTemp' ( temp int) +0:118 'storeTemp' ( temp 2-component vector of int) +0:118 'storeTemp' ( temp 2-component vector of int) +0:119 Sequence +0:119 move second child to first child ( temp int) +0:119 'coordTemp' ( temp int) +0:119 c1: direct index for structure ( uniform int) +0:119 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:119 Constant: +0:119 0 (const uint) +0:119 move second child to first child ( temp 2-component vector of uint) +0:119 'storeTemp' ( temp 2-component vector of uint) +0:119 imageLoad ( temp 2-component vector of uint) +0:119 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:119 'coordTemp' ( temp int) +0:119 Pre-Increment ( temp 2-component vector of uint) +0:119 'storeTemp' ( temp 2-component vector of uint) +0:119 imageStore ( temp void) +0:119 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:119 'coordTemp' ( temp int) +0:119 'storeTemp' ( temp 2-component vector of uint) +0:119 'storeTemp' ( temp 2-component vector of uint) +0:121 Sequence +0:121 move second child to first child ( temp int) +0:121 'coordTemp' ( temp int) +0:121 c1: direct index for structure ( uniform int) +0:121 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:121 Constant: +0:121 0 (const uint) +0:121 move second child to first child ( temp 2-component vector of float) +0:121 'storeTemp' ( temp 2-component vector of float) +0:121 imageLoad ( temp 2-component vector of float) +0:121 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:121 'coordTemp' ( temp int) +0:121 Pre-Decrement ( temp 2-component vector of float) +0:121 'storeTemp' ( temp 2-component vector of float) +0:121 imageStore ( temp void) +0:121 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:121 'coordTemp' ( temp int) +0:121 'storeTemp' ( temp 2-component vector of float) +0:121 'storeTemp' ( temp 2-component vector of float) +0:122 Sequence +0:122 move second child to first child ( temp int) +0:122 'coordTemp' ( temp int) +0:122 c1: direct index for structure ( uniform int) +0:122 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:122 Constant: +0:122 0 (const uint) +0:122 move second child to first child ( temp 2-component vector of int) +0:122 'storeTemp' ( temp 2-component vector of int) +0:122 imageLoad ( temp 2-component vector of int) +0:122 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:122 'coordTemp' ( temp int) +0:122 Pre-Decrement ( temp 2-component vector of int) +0:122 'storeTemp' ( temp 2-component vector of int) +0:122 imageStore ( temp void) +0:122 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:122 'coordTemp' ( temp int) +0:122 'storeTemp' ( temp 2-component vector of int) +0:122 'storeTemp' ( temp 2-component vector of int) +0:123 Sequence +0:123 move second child to first child ( temp int) +0:123 'coordTemp' ( temp int) +0:123 c1: direct index for structure ( uniform int) +0:123 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:123 Constant: +0:123 0 (const uint) +0:123 move second child to first child ( temp 2-component vector of uint) +0:123 'storeTemp' ( temp 2-component vector of uint) +0:123 imageLoad ( temp 2-component vector of uint) +0:123 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:123 'coordTemp' ( temp int) +0:123 Pre-Decrement ( temp 2-component vector of uint) +0:123 'storeTemp' ( temp 2-component vector of uint) +0:123 imageStore ( temp void) +0:123 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:123 'coordTemp' ( temp int) +0:123 'storeTemp' ( temp 2-component vector of uint) +0:123 'storeTemp' ( temp 2-component vector of uint) +0:126 Sequence +0:126 move second child to first child ( temp int) +0:126 'coordTemp' ( temp int) +0:126 c1: direct index for structure ( uniform int) +0:126 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:126 Constant: +0:126 0 (const uint) +0:126 move second child to first child ( temp 2-component vector of float) +0:126 'storeTempPre' ( temp 2-component vector of float) +0:126 imageLoad ( temp 2-component vector of float) +0:126 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:126 'coordTemp' ( temp int) +0:126 move second child to first child ( temp 2-component vector of float) +0:126 'storeTempPost' ( temp 2-component vector of float) +0:126 'storeTempPre' ( temp 2-component vector of float) +0:126 Post-Increment ( temp 2-component vector of float) +0:126 'storeTempPost' ( temp 2-component vector of float) +0:126 imageStore ( temp void) +0:126 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:126 'coordTemp' ( temp int) +0:126 'storeTempPost' ( temp 2-component vector of float) +0:126 'storeTempPre' ( temp 2-component vector of float) +0:127 Sequence +0:127 move second child to first child ( temp int) +0:127 'coordTemp' ( temp int) +0:127 c1: direct index for structure ( uniform int) +0:127 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:127 Constant: +0:127 0 (const uint) +0:127 move second child to first child ( temp 2-component vector of uint) +0:127 'storeTempPre' ( temp 2-component vector of uint) +0:127 imageLoad ( temp 2-component vector of uint) +0:127 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:127 'coordTemp' ( temp int) +0:127 move second child to first child ( temp 2-component vector of uint) +0:127 'storeTempPost' ( temp 2-component vector of uint) +0:127 'storeTempPre' ( temp 2-component vector of uint) +0:127 Post-Decrement ( temp 2-component vector of uint) +0:127 'storeTempPost' ( temp 2-component vector of uint) +0:127 imageStore ( temp void) +0:127 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:127 'coordTemp' ( temp int) +0:127 'storeTempPost' ( temp 2-component vector of uint) +0:127 'storeTempPre' ( temp 2-component vector of uint) +0:128 Sequence +0:128 move second child to first child ( temp int) +0:128 'coordTemp' ( temp int) +0:128 c1: direct index for structure ( uniform int) +0:128 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:128 Constant: +0:128 0 (const uint) +0:128 move second child to first child ( temp 2-component vector of int) +0:128 'storeTempPre' ( temp 2-component vector of int) +0:128 imageLoad ( temp 2-component vector of int) +0:128 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:128 'coordTemp' ( temp int) +0:128 move second child to first child ( temp 2-component vector of int) +0:128 'storeTempPost' ( temp 2-component vector of int) +0:128 'storeTempPre' ( temp 2-component vector of int) +0:128 Post-Increment ( temp 2-component vector of int) +0:128 'storeTempPost' ( temp 2-component vector of int) +0:128 imageStore ( temp void) +0:128 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:128 'coordTemp' ( temp int) +0:128 'storeTempPost' ( temp 2-component vector of int) +0:128 'storeTempPre' ( temp 2-component vector of int) +0:130 Sequence +0:130 move second child to first child ( temp int) +0:130 'coordTemp' ( temp int) +0:130 c1: direct index for structure ( uniform int) +0:130 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:130 Constant: +0:130 0 (const uint) +0:130 move second child to first child ( temp 2-component vector of float) +0:130 'storeTempPre' ( temp 2-component vector of float) +0:130 imageLoad ( temp 2-component vector of float) +0:130 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:130 'coordTemp' ( temp int) +0:130 move second child to first child ( temp 2-component vector of float) +0:130 'storeTempPost' ( temp 2-component vector of float) +0:130 'storeTempPre' ( temp 2-component vector of float) +0:130 Post-Decrement ( temp 2-component vector of float) +0:130 'storeTempPost' ( temp 2-component vector of float) +0:130 imageStore ( temp void) +0:130 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:130 'coordTemp' ( temp int) +0:130 'storeTempPost' ( temp 2-component vector of float) +0:130 'storeTempPre' ( temp 2-component vector of float) +0:131 Sequence +0:131 move second child to first child ( temp int) +0:131 'coordTemp' ( temp int) +0:131 c1: direct index for structure ( uniform int) +0:131 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:131 Constant: +0:131 0 (const uint) +0:131 move second child to first child ( temp 2-component vector of int) +0:131 'storeTempPre' ( temp 2-component vector of int) +0:131 imageLoad ( temp 2-component vector of int) +0:131 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:131 'coordTemp' ( temp int) +0:131 move second child to first child ( temp 2-component vector of int) +0:131 'storeTempPost' ( temp 2-component vector of int) +0:131 'storeTempPre' ( temp 2-component vector of int) +0:131 Post-Increment ( temp 2-component vector of int) +0:131 'storeTempPost' ( temp 2-component vector of int) +0:131 imageStore ( temp void) +0:131 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:131 'coordTemp' ( temp int) +0:131 'storeTempPost' ( temp 2-component vector of int) +0:131 'storeTempPre' ( temp 2-component vector of int) +0:132 Sequence +0:132 move second child to first child ( temp int) +0:132 'coordTemp' ( temp int) +0:132 c1: direct index for structure ( uniform int) +0:132 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:132 Constant: +0:132 0 (const uint) +0:132 move second child to first child ( temp 2-component vector of uint) +0:132 'storeTempPre' ( temp 2-component vector of uint) +0:132 imageLoad ( temp 2-component vector of uint) +0:132 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:132 'coordTemp' ( temp int) +0:132 move second child to first child ( temp 2-component vector of uint) +0:132 'storeTempPost' ( temp 2-component vector of uint) +0:132 'storeTempPre' ( temp 2-component vector of uint) +0:132 Post-Decrement ( temp 2-component vector of uint) +0:132 'storeTempPost' ( temp 2-component vector of uint) +0:132 imageStore ( temp void) +0:132 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:132 'coordTemp' ( temp int) +0:132 'storeTempPost' ( temp 2-component vector of uint) +0:132 'storeTempPre' ( temp 2-component vector of uint) +0:135 Sequence +0:135 move second child to first child ( temp 2-component vector of float) +0:135 'storeTemp' ( temp 2-component vector of float) +0:? imageLoad ( temp 2-component vector of float) +0:135 'g_tTex2df2' (layout( rg32f) uniform image2D) +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:135 imageStore ( temp void) +0:135 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:135 Constant: +0:135 1 (const int) +0:135 'storeTemp' ( temp 2-component vector of float) +0:135 'storeTemp' ( temp 2-component vector of float) +0:137 move second child to first child ( temp 4-component vector of float) +0:137 Color: direct index for structure ( temp 4-component vector of float) +0:137 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 1.000000 +0:137 1.000000 +0:137 1.000000 +0:137 1.000000 +0:139 Branch: Return with expression +0:139 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:53 Function Definition: main( ( temp void) +0:53 Function Parameters: +0:? Sequence +0:53 Sequence +0:53 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:53 Color: direct index for structure ( temp 4-component vector of float) +0:53 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:53 Constant: +0:53 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:? 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:? 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:? 'g_tTex2df2' (layout( rg32f) uniform image2D) +0:? 'g_tTex2di2' (layout( rg32i) uniform iimage2D) +0:? 'g_tTex2du2' (layout( rg32ui) uniform uimage2D) +0:? 'g_tTex3df2' (layout( rg32f) uniform image3D) +0:? 'g_tTex3di2' (layout( rg32i) uniform iimage3D) +0:? 'g_tTex3du2' (layout( rg32ui) uniform uimage3D) +0:? 'g_tTex1df2a' (layout( rg32f) uniform image1DArray) +0:? 'g_tTex1di2a' (layout( rg32i) uniform iimage1DArray) +0:? 'g_tTex1du2a' (layout( rg32ui) uniform uimage1DArray) +0:? 'g_tTex2df2a' (layout( rg32f) uniform image2DArray) +0:? 'g_tTex2di2a' (layout( rg32i) uniform iimage2DArray) +0:? 'g_tTex2du2a' (layout( rg32ui) uniform uimage2DArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:42 Function Definition: Fn1(vi2; ( temp 2-component vector of int) +0:42 Function Parameters: +0:42 'x' ( in 2-component vector of int) +0:? Sequence +0:42 Branch: Return with expression +0:42 'x' ( in 2-component vector of int) +0:43 Function Definition: Fn1(vu2; ( temp 2-component vector of uint) +0:43 Function Parameters: +0:43 'x' ( in 2-component vector of uint) +0:? Sequence +0:43 Branch: Return with expression +0:43 'x' ( in 2-component vector of uint) +0:44 Function Definition: Fn1(vf2; ( temp 2-component vector of float) +0:44 Function Parameters: +0:44 'x' ( in 2-component vector of float) +0:? Sequence +0:44 Branch: Return with expression +0:44 'x' ( in 2-component vector of float) +0:46 Function Definition: Fn2(vi2; ( temp void) +0:46 Function Parameters: +0:46 'x' ( out 2-component vector of int) +0:? Sequence +0:46 move second child to first child ( temp 2-component vector of int) +0:46 'x' ( out 2-component vector of int) +0:? Constant: +0:? 0 (const int) +0:? 0 (const int) +0:47 Function Definition: Fn2(vu2; ( temp void) +0:47 Function Parameters: +0:47 'x' ( out 2-component vector of uint) +0:? Sequence +0:47 move second child to first child ( temp 2-component vector of uint) +0:47 'x' ( out 2-component vector of uint) +0:? Constant: +0:? 0 (const uint) +0:? 0 (const uint) +0:48 Function Definition: Fn2(vf2; ( temp void) +0:48 Function Parameters: +0:48 'x' ( out 2-component vector of float) +0:? Sequence +0:48 move second child to first child ( temp 2-component vector of float) +0:48 'x' ( out 2-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:50 Function Definition: SomeValue( ( temp 2-component vector of float) +0:50 Function Parameters: +0:? Sequence +0:50 Branch: Return with expression +0:50 Convert int to float ( temp 2-component vector of float) +0:50 c2: direct index for structure ( uniform 2-component vector of int) +0:50 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:50 Constant: +0:50 1 (const uint) +0:53 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:53 Function Parameters: +0:? Sequence +0:57 imageLoad ( temp 2-component vector of float) +0:57 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:57 c1: direct index for structure ( uniform int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:57 Constant: +0:57 0 (const uint) +0:59 Sequence +0:59 move second child to first child ( temp 2-component vector of float) +0:59 'r00' ( temp 2-component vector of float) +0:59 imageLoad ( temp 2-component vector of float) +0:59 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:59 c1: direct index for structure ( uniform int) +0:59 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:59 Constant: +0:59 0 (const uint) +0:60 Sequence +0:60 move second child to first child ( temp 2-component vector of int) +0:60 'r01' ( temp 2-component vector of int) +0:60 imageLoad ( temp 2-component vector of int) +0:60 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:60 c1: direct index for structure ( uniform int) +0:60 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:60 Constant: +0:60 0 (const uint) +0:61 Sequence +0:61 move second child to first child ( temp 2-component vector of uint) +0:61 'r02' ( temp 2-component vector of uint) +0:61 imageLoad ( temp 2-component vector of uint) +0:61 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:61 c1: direct index for structure ( uniform int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:61 Constant: +0:61 0 (const uint) +0:64 Sequence +0:64 move second child to first child ( temp 2-component vector of float) +0:64 'r10' ( temp 2-component vector of float) +0:64 imageLoad ( temp 2-component vector of float) +0:64 'g_tTex2df2' (layout( rg32f) uniform image2D) +0:64 c2: direct index for structure ( uniform 2-component vector of int) +0:64 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:64 Constant: +0:64 1 (const uint) +0:65 Sequence +0:65 move second child to first child ( temp 2-component vector of int) +0:65 'r11' ( temp 2-component vector of int) +0:65 imageLoad ( temp 2-component vector of int) +0:65 'g_tTex2di2' (layout( rg32i) uniform iimage2D) +0:65 c2: direct index for structure ( uniform 2-component vector of int) +0:65 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:65 Constant: +0:65 1 (const uint) +0:66 Sequence +0:66 move second child to first child ( temp 2-component vector of uint) +0:66 'r12' ( temp 2-component vector of uint) +0:66 imageLoad ( temp 2-component vector of uint) +0:66 'g_tTex2du2' (layout( rg32ui) uniform uimage2D) +0:66 c2: direct index for structure ( uniform 2-component vector of int) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:66 Constant: +0:66 1 (const uint) +0:69 Sequence +0:69 move second child to first child ( temp 2-component vector of float) +0:69 'r20' ( temp 2-component vector of float) +0:69 imageLoad ( temp 2-component vector of float) +0:69 'g_tTex3df2' (layout( rg32f) uniform image3D) +0:69 c3: direct index for structure ( uniform 3-component vector of int) +0:69 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:69 Constant: +0:69 2 (const uint) +0:70 Sequence +0:70 move second child to first child ( temp 2-component vector of int) +0:70 'r21' ( temp 2-component vector of int) +0:70 imageLoad ( temp 2-component vector of int) +0:70 'g_tTex3di2' (layout( rg32i) uniform iimage3D) +0:70 c3: direct index for structure ( uniform 3-component vector of int) +0:70 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:70 Constant: +0:70 2 (const uint) +0:71 Sequence +0:71 move second child to first child ( temp 2-component vector of uint) +0:71 'r22' ( temp 2-component vector of uint) +0:71 imageLoad ( temp 2-component vector of uint) +0:71 'g_tTex3du2' (layout( rg32ui) uniform uimage3D) +0:71 c3: direct index for structure ( uniform 3-component vector of int) +0:71 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:71 Constant: +0:71 2 (const uint) +0:73 Sequence +0:73 move second child to first child ( temp 2-component vector of float) +0:73 'lf2' ( temp 2-component vector of float) +0:73 uf2: direct index for structure ( uniform 2-component vector of float) +0:73 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:73 Constant: +0:73 8 (const uint) +0:77 Sequence +0:77 move second child to first child ( temp 2-component vector of float) +0:77 'storeTemp' ( temp 2-component vector of float) +0:77 Function Call: SomeValue( ( temp 2-component vector of float) +0:77 imageStore ( temp void) +0:77 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:77 c1: direct index for structure ( uniform int) +0:77 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:77 Constant: +0:77 0 (const uint) +0:77 'storeTemp' ( temp 2-component vector of float) +0:77 'storeTemp' ( temp 2-component vector of float) +0:78 Sequence +0:78 imageStore ( temp void) +0:78 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:78 c1: direct index for structure ( uniform int) +0:78 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:78 Constant: +0:78 0 (const uint) +0:78 'lf2' ( temp 2-component vector of float) +0:78 'lf2' ( temp 2-component vector of float) +0:79 Sequence +0:79 move second child to first child ( temp 2-component vector of int) +0:79 'storeTemp' ( temp 2-component vector of int) +0:? Constant: +0:? 2 (const int) +0:? 2 (const int) +0:79 imageStore ( temp void) +0:79 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:79 c1: direct index for structure ( uniform int) +0:79 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:79 Constant: +0:79 0 (const uint) +0:79 'storeTemp' ( temp 2-component vector of int) +0:79 'storeTemp' ( temp 2-component vector of int) +0:80 Sequence +0:80 move second child to first child ( temp 2-component vector of uint) +0:80 'storeTemp' ( temp 2-component vector of uint) +0:? Constant: +0:? 3 (const uint) +0:? 2 (const uint) +0:80 imageStore ( temp void) +0:80 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:80 c1: direct index for structure ( uniform int) +0:80 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:80 Constant: +0:80 0 (const uint) +0:80 'storeTemp' ( temp 2-component vector of uint) +0:80 'storeTemp' ( temp 2-component vector of uint) +0:83 Sequence +0:83 move second child to first child ( temp 2-component vector of float) +0:83 'val1' ( temp 2-component vector of float) +0:83 Sequence +0:83 move second child to first child ( temp int) +0:83 'coordTemp' ( temp int) +0:83 c1: direct index for structure ( uniform int) +0:83 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:83 Constant: +0:83 0 (const uint) +0:83 move second child to first child ( temp 2-component vector of float) +0:83 'storeTemp' ( temp 2-component vector of float) +0:83 imageLoad ( temp 2-component vector of float) +0:83 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:83 'coordTemp' ( temp int) +0:83 vector scale second child into first child ( temp 2-component vector of float) +0:83 'storeTemp' ( temp 2-component vector of float) +0:83 Constant: +0:83 2.000000 +0:83 imageStore ( temp void) +0:83 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:83 'coordTemp' ( temp int) +0:83 'storeTemp' ( temp 2-component vector of float) +0:83 'storeTemp' ( temp 2-component vector of float) +0:84 Sequence +0:84 move second child to first child ( temp int) +0:84 'coordTemp' ( temp int) +0:84 c1: direct index for structure ( uniform int) +0:84 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:84 Constant: +0:84 0 (const uint) +0:84 move second child to first child ( temp 2-component vector of float) +0:84 'storeTemp' ( temp 2-component vector of float) +0:84 imageLoad ( temp 2-component vector of float) +0:84 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:84 'coordTemp' ( temp int) +0:84 subtract second child into first child ( temp 2-component vector of float) +0:84 'storeTemp' ( temp 2-component vector of float) +0:84 Constant: +0:84 3.000000 +0:84 imageStore ( temp void) +0:84 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:84 'coordTemp' ( temp int) +0:84 'storeTemp' ( temp 2-component vector of float) +0:84 'storeTemp' ( temp 2-component vector of float) +0:85 Sequence +0:85 move second child to first child ( temp int) +0:85 'coordTemp' ( temp int) +0:85 c1: direct index for structure ( uniform int) +0:85 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:85 Constant: +0:85 0 (const uint) +0:85 move second child to first child ( temp 2-component vector of float) +0:85 'storeTemp' ( temp 2-component vector of float) +0:85 imageLoad ( temp 2-component vector of float) +0:85 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:85 'coordTemp' ( temp int) +0:85 add second child into first child ( temp 2-component vector of float) +0:85 'storeTemp' ( temp 2-component vector of float) +0:85 Constant: +0:85 4.000000 +0:85 imageStore ( temp void) +0:85 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:85 'coordTemp' ( temp int) +0:85 'storeTemp' ( temp 2-component vector of float) +0:85 'storeTemp' ( temp 2-component vector of float) +0:87 Sequence +0:87 move second child to first child ( temp int) +0:87 'coordTemp' ( temp int) +0:87 c1: direct index for structure ( uniform int) +0:87 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:87 Constant: +0:87 0 (const uint) +0:87 move second child to first child ( temp 2-component vector of int) +0:87 'storeTemp' ( temp 2-component vector of int) +0:87 imageLoad ( temp 2-component vector of int) +0:87 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:87 'coordTemp' ( temp int) +0:87 divide second child into first child ( temp 2-component vector of int) +0:87 'storeTemp' ( temp 2-component vector of int) +0:87 Constant: +0:87 2 (const int) +0:87 imageStore ( temp void) +0:87 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:87 'coordTemp' ( temp int) +0:87 'storeTemp' ( temp 2-component vector of int) +0:87 'storeTemp' ( temp 2-component vector of int) +0:88 Sequence +0:88 move second child to first child ( temp int) +0:88 'coordTemp' ( temp int) +0:88 c1: direct index for structure ( uniform int) +0:88 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:88 Constant: +0:88 0 (const uint) +0:88 move second child to first child ( temp 2-component vector of int) +0:88 'storeTemp' ( temp 2-component vector of int) +0:88 imageLoad ( temp 2-component vector of int) +0:88 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:88 'coordTemp' ( temp int) +0:88 mod second child into first child ( temp 2-component vector of int) +0:88 'storeTemp' ( temp 2-component vector of int) +0:88 Constant: +0:88 2 (const int) +0:88 imageStore ( temp void) +0:88 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:88 'coordTemp' ( temp int) +0:88 'storeTemp' ( temp 2-component vector of int) +0:88 'storeTemp' ( temp 2-component vector of int) +0:89 Sequence +0:89 move second child to first child ( temp int) +0:89 'coordTemp' ( temp int) +0:89 c1: direct index for structure ( uniform int) +0:89 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:89 Constant: +0:89 0 (const uint) +0:89 move second child to first child ( temp 2-component vector of int) +0:89 'storeTemp' ( temp 2-component vector of int) +0:89 imageLoad ( temp 2-component vector of int) +0:89 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:89 'coordTemp' ( temp int) +0:89 and second child into first child ( temp 2-component vector of int) +0:89 'storeTemp' ( temp 2-component vector of int) +0:89 Constant: +0:89 65535 (const int) +0:89 imageStore ( temp void) +0:89 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:89 'coordTemp' ( temp int) +0:89 'storeTemp' ( temp 2-component vector of int) +0:89 'storeTemp' ( temp 2-component vector of int) +0:90 Sequence +0:90 move second child to first child ( temp int) +0:90 'coordTemp' ( temp int) +0:90 c1: direct index for structure ( uniform int) +0:90 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:90 Constant: +0:90 0 (const uint) +0:90 move second child to first child ( temp 2-component vector of int) +0:90 'storeTemp' ( temp 2-component vector of int) +0:90 imageLoad ( temp 2-component vector of int) +0:90 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:90 'coordTemp' ( temp int) +0:90 or second child into first child ( temp 2-component vector of int) +0:90 'storeTemp' ( temp 2-component vector of int) +0:90 Constant: +0:90 61680 (const int) +0:90 imageStore ( temp void) +0:90 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:90 'coordTemp' ( temp int) +0:90 'storeTemp' ( temp 2-component vector of int) +0:90 'storeTemp' ( temp 2-component vector of int) +0:91 Sequence +0:91 move second child to first child ( temp int) +0:91 'coordTemp' ( temp int) +0:91 c1: direct index for structure ( uniform int) +0:91 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:91 Constant: +0:91 0 (const uint) +0:91 move second child to first child ( temp 2-component vector of int) +0:91 'storeTemp' ( temp 2-component vector of int) +0:91 imageLoad ( temp 2-component vector of int) +0:91 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:91 'coordTemp' ( temp int) +0:91 left shift second child into first child ( temp 2-component vector of int) +0:91 'storeTemp' ( temp 2-component vector of int) +0:91 Constant: +0:91 2 (const int) +0:91 imageStore ( temp void) +0:91 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:91 'coordTemp' ( temp int) +0:91 'storeTemp' ( temp 2-component vector of int) +0:91 'storeTemp' ( temp 2-component vector of int) +0:92 Sequence +0:92 move second child to first child ( temp int) +0:92 'coordTemp' ( temp int) +0:92 c1: direct index for structure ( uniform int) +0:92 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:92 Constant: +0:92 0 (const uint) +0:92 move second child to first child ( temp 2-component vector of int) +0:92 'storeTemp' ( temp 2-component vector of int) +0:92 imageLoad ( temp 2-component vector of int) +0:92 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:92 'coordTemp' ( temp int) +0:92 right shift second child into first child ( temp 2-component vector of int) +0:92 'storeTemp' ( temp 2-component vector of int) +0:92 Constant: +0:92 2 (const int) +0:92 imageStore ( temp void) +0:92 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:92 'coordTemp' ( temp int) +0:92 'storeTemp' ( temp 2-component vector of int) +0:92 'storeTemp' ( temp 2-component vector of int) +0:95 Sequence +0:95 move second child to first child ( temp 2-component vector of float) +0:95 'storeTemp' ( temp 2-component vector of float) +0:95 Function Call: SomeValue( ( temp 2-component vector of float) +0:95 imageStore ( temp void) +0:95 'g_tTex2df2' (layout( rg32f) uniform image2D) +0:95 c2: direct index for structure ( uniform 2-component vector of int) +0:95 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:95 Constant: +0:95 1 (const uint) +0:95 'storeTemp' ( temp 2-component vector of float) +0:95 'storeTemp' ( temp 2-component vector of float) +0:96 Sequence +0:96 imageStore ( temp void) +0:96 'g_tTex2df2' (layout( rg32f) uniform image2D) +0:96 c2: direct index for structure ( uniform 2-component vector of int) +0:96 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:96 Constant: +0:96 1 (const uint) +0:96 'lf2' ( temp 2-component vector of float) +0:96 'lf2' ( temp 2-component vector of float) +0:97 Sequence +0:97 move second child to first child ( temp 2-component vector of int) +0:97 'storeTemp' ( temp 2-component vector of int) +0:? Constant: +0:? 5 (const int) +0:? 2 (const int) +0:97 imageStore ( temp void) +0:97 'g_tTex2di2' (layout( rg32i) uniform iimage2D) +0:97 c2: direct index for structure ( uniform 2-component vector of int) +0:97 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:97 Constant: +0:97 1 (const uint) +0:97 'storeTemp' ( temp 2-component vector of int) +0:97 'storeTemp' ( temp 2-component vector of int) +0:98 Sequence +0:98 move second child to first child ( temp 2-component vector of uint) +0:98 'storeTemp' ( temp 2-component vector of uint) +0:? Constant: +0:? 6 (const uint) +0:? 2 (const uint) +0:98 imageStore ( temp void) +0:98 'g_tTex2du2' (layout( rg32ui) uniform uimage2D) +0:98 c2: direct index for structure ( uniform 2-component vector of int) +0:98 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:98 Constant: +0:98 1 (const uint) +0:98 'storeTemp' ( temp 2-component vector of uint) +0:98 'storeTemp' ( temp 2-component vector of uint) +0:101 Sequence +0:101 move second child to first child ( temp 2-component vector of float) +0:101 'storeTemp' ( temp 2-component vector of float) +0:101 Function Call: SomeValue( ( temp 2-component vector of float) +0:101 imageStore ( temp void) +0:101 'g_tTex3df2' (layout( rg32f) uniform image3D) +0:101 c3: direct index for structure ( uniform 3-component vector of int) +0:101 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:101 Constant: +0:101 2 (const uint) +0:101 'storeTemp' ( temp 2-component vector of float) +0:101 'storeTemp' ( temp 2-component vector of float) +0:102 Sequence +0:102 imageStore ( temp void) +0:102 'g_tTex3df2' (layout( rg32f) uniform image3D) +0:102 c3: direct index for structure ( uniform 3-component vector of int) +0:102 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:102 Constant: +0:102 2 (const uint) +0:102 'lf2' ( temp 2-component vector of float) +0:102 'lf2' ( temp 2-component vector of float) +0:103 Sequence +0:103 move second child to first child ( temp 2-component vector of int) +0:103 'storeTemp' ( temp 2-component vector of int) +0:? Constant: +0:? 8 (const int) +0:? 6 (const int) +0:103 imageStore ( temp void) +0:103 'g_tTex3di2' (layout( rg32i) uniform iimage3D) +0:103 c3: direct index for structure ( uniform 3-component vector of int) +0:103 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:103 Constant: +0:103 2 (const uint) +0:103 'storeTemp' ( temp 2-component vector of int) +0:103 'storeTemp' ( temp 2-component vector of int) +0:104 Sequence +0:104 move second child to first child ( temp 2-component vector of uint) +0:104 'storeTemp' ( temp 2-component vector of uint) +0:? Constant: +0:? 9 (const uint) +0:? 2 (const uint) +0:104 imageStore ( temp void) +0:104 'g_tTex3du2' (layout( rg32ui) uniform uimage3D) +0:104 c3: direct index for structure ( uniform 3-component vector of int) +0:104 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:104 Constant: +0:104 2 (const uint) +0:104 'storeTemp' ( temp 2-component vector of uint) +0:104 'storeTemp' ( temp 2-component vector of uint) +0:107 Function Call: Fn1(vf2; ( temp 2-component vector of float) +0:107 imageLoad ( temp 2-component vector of float) +0:107 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:107 c1: direct index for structure ( uniform int) +0:107 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:107 Constant: +0:107 0 (const uint) +0:108 Function Call: Fn1(vi2; ( temp 2-component vector of int) +0:108 imageLoad ( temp 2-component vector of int) +0:108 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:108 c1: direct index for structure ( uniform int) +0:108 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:108 Constant: +0:108 0 (const uint) +0:109 Function Call: Fn1(vu2; ( temp 2-component vector of uint) +0:109 imageLoad ( temp 2-component vector of uint) +0:109 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:109 c1: direct index for structure ( uniform int) +0:109 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:109 Constant: +0:109 0 (const uint) +0:111 Comma ( temp void) +0:111 Function Call: Fn2(vf2; ( temp void) +0:111 'tempArg' ( temp 2-component vector of float) +0:111 Sequence +0:111 imageStore ( temp void) +0:111 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:111 c1: direct index for structure ( uniform int) +0:111 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:111 Constant: +0:111 0 (const uint) +0:111 'tempArg' ( temp 2-component vector of float) +0:111 'tempArg' ( temp 2-component vector of float) +0:112 Comma ( temp void) +0:112 Function Call: Fn2(vi2; ( temp void) +0:112 'tempArg' ( temp 2-component vector of int) +0:112 Sequence +0:112 imageStore ( temp void) +0:112 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:112 c1: direct index for structure ( uniform int) +0:112 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:112 Constant: +0:112 0 (const uint) +0:112 'tempArg' ( temp 2-component vector of int) +0:112 'tempArg' ( temp 2-component vector of int) +0:113 Comma ( temp void) +0:113 Function Call: Fn2(vu2; ( temp void) +0:113 'tempArg' ( temp 2-component vector of uint) +0:113 Sequence +0:113 imageStore ( temp void) +0:113 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:113 c1: direct index for structure ( uniform int) +0:113 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:113 Constant: +0:113 0 (const uint) +0:113 'tempArg' ( temp 2-component vector of uint) +0:113 'tempArg' ( temp 2-component vector of uint) +0:117 Sequence +0:117 move second child to first child ( temp int) +0:117 'coordTemp' ( temp int) +0:117 c1: direct index for structure ( uniform int) +0:117 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:117 Constant: +0:117 0 (const uint) +0:117 move second child to first child ( temp 2-component vector of float) +0:117 'storeTemp' ( temp 2-component vector of float) +0:117 imageLoad ( temp 2-component vector of float) +0:117 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:117 'coordTemp' ( temp int) +0:117 Pre-Increment ( temp 2-component vector of float) +0:117 'storeTemp' ( temp 2-component vector of float) +0:117 imageStore ( temp void) +0:117 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:117 'coordTemp' ( temp int) +0:117 'storeTemp' ( temp 2-component vector of float) +0:117 'storeTemp' ( temp 2-component vector of float) +0:118 Sequence +0:118 move second child to first child ( temp int) +0:118 'coordTemp' ( temp int) +0:118 c1: direct index for structure ( uniform int) +0:118 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:118 Constant: +0:118 0 (const uint) +0:118 move second child to first child ( temp 2-component vector of int) +0:118 'storeTemp' ( temp 2-component vector of int) +0:118 imageLoad ( temp 2-component vector of int) +0:118 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:118 'coordTemp' ( temp int) +0:118 Pre-Increment ( temp 2-component vector of int) +0:118 'storeTemp' ( temp 2-component vector of int) +0:118 imageStore ( temp void) +0:118 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:118 'coordTemp' ( temp int) +0:118 'storeTemp' ( temp 2-component vector of int) +0:118 'storeTemp' ( temp 2-component vector of int) +0:119 Sequence +0:119 move second child to first child ( temp int) +0:119 'coordTemp' ( temp int) +0:119 c1: direct index for structure ( uniform int) +0:119 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:119 Constant: +0:119 0 (const uint) +0:119 move second child to first child ( temp 2-component vector of uint) +0:119 'storeTemp' ( temp 2-component vector of uint) +0:119 imageLoad ( temp 2-component vector of uint) +0:119 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:119 'coordTemp' ( temp int) +0:119 Pre-Increment ( temp 2-component vector of uint) +0:119 'storeTemp' ( temp 2-component vector of uint) +0:119 imageStore ( temp void) +0:119 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:119 'coordTemp' ( temp int) +0:119 'storeTemp' ( temp 2-component vector of uint) +0:119 'storeTemp' ( temp 2-component vector of uint) +0:121 Sequence +0:121 move second child to first child ( temp int) +0:121 'coordTemp' ( temp int) +0:121 c1: direct index for structure ( uniform int) +0:121 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:121 Constant: +0:121 0 (const uint) +0:121 move second child to first child ( temp 2-component vector of float) +0:121 'storeTemp' ( temp 2-component vector of float) +0:121 imageLoad ( temp 2-component vector of float) +0:121 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:121 'coordTemp' ( temp int) +0:121 Pre-Decrement ( temp 2-component vector of float) +0:121 'storeTemp' ( temp 2-component vector of float) +0:121 imageStore ( temp void) +0:121 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:121 'coordTemp' ( temp int) +0:121 'storeTemp' ( temp 2-component vector of float) +0:121 'storeTemp' ( temp 2-component vector of float) +0:122 Sequence +0:122 move second child to first child ( temp int) +0:122 'coordTemp' ( temp int) +0:122 c1: direct index for structure ( uniform int) +0:122 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:122 Constant: +0:122 0 (const uint) +0:122 move second child to first child ( temp 2-component vector of int) +0:122 'storeTemp' ( temp 2-component vector of int) +0:122 imageLoad ( temp 2-component vector of int) +0:122 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:122 'coordTemp' ( temp int) +0:122 Pre-Decrement ( temp 2-component vector of int) +0:122 'storeTemp' ( temp 2-component vector of int) +0:122 imageStore ( temp void) +0:122 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:122 'coordTemp' ( temp int) +0:122 'storeTemp' ( temp 2-component vector of int) +0:122 'storeTemp' ( temp 2-component vector of int) +0:123 Sequence +0:123 move second child to first child ( temp int) +0:123 'coordTemp' ( temp int) +0:123 c1: direct index for structure ( uniform int) +0:123 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:123 Constant: +0:123 0 (const uint) +0:123 move second child to first child ( temp 2-component vector of uint) +0:123 'storeTemp' ( temp 2-component vector of uint) +0:123 imageLoad ( temp 2-component vector of uint) +0:123 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:123 'coordTemp' ( temp int) +0:123 Pre-Decrement ( temp 2-component vector of uint) +0:123 'storeTemp' ( temp 2-component vector of uint) +0:123 imageStore ( temp void) +0:123 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:123 'coordTemp' ( temp int) +0:123 'storeTemp' ( temp 2-component vector of uint) +0:123 'storeTemp' ( temp 2-component vector of uint) +0:126 Sequence +0:126 move second child to first child ( temp int) +0:126 'coordTemp' ( temp int) +0:126 c1: direct index for structure ( uniform int) +0:126 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:126 Constant: +0:126 0 (const uint) +0:126 move second child to first child ( temp 2-component vector of float) +0:126 'storeTempPre' ( temp 2-component vector of float) +0:126 imageLoad ( temp 2-component vector of float) +0:126 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:126 'coordTemp' ( temp int) +0:126 move second child to first child ( temp 2-component vector of float) +0:126 'storeTempPost' ( temp 2-component vector of float) +0:126 'storeTempPre' ( temp 2-component vector of float) +0:126 Post-Increment ( temp 2-component vector of float) +0:126 'storeTempPost' ( temp 2-component vector of float) +0:126 imageStore ( temp void) +0:126 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:126 'coordTemp' ( temp int) +0:126 'storeTempPost' ( temp 2-component vector of float) +0:126 'storeTempPre' ( temp 2-component vector of float) +0:127 Sequence +0:127 move second child to first child ( temp int) +0:127 'coordTemp' ( temp int) +0:127 c1: direct index for structure ( uniform int) +0:127 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:127 Constant: +0:127 0 (const uint) +0:127 move second child to first child ( temp 2-component vector of uint) +0:127 'storeTempPre' ( temp 2-component vector of uint) +0:127 imageLoad ( temp 2-component vector of uint) +0:127 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:127 'coordTemp' ( temp int) +0:127 move second child to first child ( temp 2-component vector of uint) +0:127 'storeTempPost' ( temp 2-component vector of uint) +0:127 'storeTempPre' ( temp 2-component vector of uint) +0:127 Post-Decrement ( temp 2-component vector of uint) +0:127 'storeTempPost' ( temp 2-component vector of uint) +0:127 imageStore ( temp void) +0:127 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:127 'coordTemp' ( temp int) +0:127 'storeTempPost' ( temp 2-component vector of uint) +0:127 'storeTempPre' ( temp 2-component vector of uint) +0:128 Sequence +0:128 move second child to first child ( temp int) +0:128 'coordTemp' ( temp int) +0:128 c1: direct index for structure ( uniform int) +0:128 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:128 Constant: +0:128 0 (const uint) +0:128 move second child to first child ( temp 2-component vector of int) +0:128 'storeTempPre' ( temp 2-component vector of int) +0:128 imageLoad ( temp 2-component vector of int) +0:128 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:128 'coordTemp' ( temp int) +0:128 move second child to first child ( temp 2-component vector of int) +0:128 'storeTempPost' ( temp 2-component vector of int) +0:128 'storeTempPre' ( temp 2-component vector of int) +0:128 Post-Increment ( temp 2-component vector of int) +0:128 'storeTempPost' ( temp 2-component vector of int) +0:128 imageStore ( temp void) +0:128 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:128 'coordTemp' ( temp int) +0:128 'storeTempPost' ( temp 2-component vector of int) +0:128 'storeTempPre' ( temp 2-component vector of int) +0:130 Sequence +0:130 move second child to first child ( temp int) +0:130 'coordTemp' ( temp int) +0:130 c1: direct index for structure ( uniform int) +0:130 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:130 Constant: +0:130 0 (const uint) +0:130 move second child to first child ( temp 2-component vector of float) +0:130 'storeTempPre' ( temp 2-component vector of float) +0:130 imageLoad ( temp 2-component vector of float) +0:130 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:130 'coordTemp' ( temp int) +0:130 move second child to first child ( temp 2-component vector of float) +0:130 'storeTempPost' ( temp 2-component vector of float) +0:130 'storeTempPre' ( temp 2-component vector of float) +0:130 Post-Decrement ( temp 2-component vector of float) +0:130 'storeTempPost' ( temp 2-component vector of float) +0:130 imageStore ( temp void) +0:130 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:130 'coordTemp' ( temp int) +0:130 'storeTempPost' ( temp 2-component vector of float) +0:130 'storeTempPre' ( temp 2-component vector of float) +0:131 Sequence +0:131 move second child to first child ( temp int) +0:131 'coordTemp' ( temp int) +0:131 c1: direct index for structure ( uniform int) +0:131 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:131 Constant: +0:131 0 (const uint) +0:131 move second child to first child ( temp 2-component vector of int) +0:131 'storeTempPre' ( temp 2-component vector of int) +0:131 imageLoad ( temp 2-component vector of int) +0:131 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:131 'coordTemp' ( temp int) +0:131 move second child to first child ( temp 2-component vector of int) +0:131 'storeTempPost' ( temp 2-component vector of int) +0:131 'storeTempPre' ( temp 2-component vector of int) +0:131 Post-Increment ( temp 2-component vector of int) +0:131 'storeTempPost' ( temp 2-component vector of int) +0:131 imageStore ( temp void) +0:131 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:131 'coordTemp' ( temp int) +0:131 'storeTempPost' ( temp 2-component vector of int) +0:131 'storeTempPre' ( temp 2-component vector of int) +0:132 Sequence +0:132 move second child to first child ( temp int) +0:132 'coordTemp' ( temp int) +0:132 c1: direct index for structure ( uniform int) +0:132 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:132 Constant: +0:132 0 (const uint) +0:132 move second child to first child ( temp 2-component vector of uint) +0:132 'storeTempPre' ( temp 2-component vector of uint) +0:132 imageLoad ( temp 2-component vector of uint) +0:132 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:132 'coordTemp' ( temp int) +0:132 move second child to first child ( temp 2-component vector of uint) +0:132 'storeTempPost' ( temp 2-component vector of uint) +0:132 'storeTempPre' ( temp 2-component vector of uint) +0:132 Post-Decrement ( temp 2-component vector of uint) +0:132 'storeTempPost' ( temp 2-component vector of uint) +0:132 imageStore ( temp void) +0:132 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:132 'coordTemp' ( temp int) +0:132 'storeTempPost' ( temp 2-component vector of uint) +0:132 'storeTempPre' ( temp 2-component vector of uint) +0:135 Sequence +0:135 move second child to first child ( temp 2-component vector of float) +0:135 'storeTemp' ( temp 2-component vector of float) +0:? imageLoad ( temp 2-component vector of float) +0:135 'g_tTex2df2' (layout( rg32f) uniform image2D) +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:135 imageStore ( temp void) +0:135 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:135 Constant: +0:135 1 (const int) +0:135 'storeTemp' ( temp 2-component vector of float) +0:135 'storeTemp' ( temp 2-component vector of float) +0:137 move second child to first child ( temp 4-component vector of float) +0:137 Color: direct index for structure ( temp 4-component vector of float) +0:137 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 1.000000 +0:137 1.000000 +0:137 1.000000 +0:137 1.000000 +0:139 Branch: Return with expression +0:139 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:53 Function Definition: main( ( temp void) +0:53 Function Parameters: +0:? Sequence +0:53 Sequence +0:53 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:53 Color: direct index for structure ( temp 4-component vector of float) +0:53 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:53 Constant: +0:53 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df2' (layout( rg32f) uniform image1D) +0:? 'g_tTex1di2' (layout( rg32i) uniform iimage1D) +0:? 'g_tTex1du2' (layout( rg32ui) uniform uimage1D) +0:? 'g_tTex2df2' (layout( rg32f) uniform image2D) +0:? 'g_tTex2di2' (layout( rg32i) uniform iimage2D) +0:? 'g_tTex2du2' (layout( rg32ui) uniform uimage2D) +0:? 'g_tTex3df2' (layout( rg32f) uniform image3D) +0:? 'g_tTex3di2' (layout( rg32i) uniform iimage3D) +0:? 'g_tTex3du2' (layout( rg32ui) uniform uimage3D) +0:? 'g_tTex1df2a' (layout( rg32f) uniform image1DArray) +0:? 'g_tTex1di2a' (layout( rg32i) uniform iimage1DArray) +0:? 'g_tTex1du2a' (layout( rg32ui) uniform uimage1DArray) +0:? 'g_tTex2df2a' (layout( rg32f) uniform image2DArray) +0:? 'g_tTex2di2a' (layout( rg32i) uniform iimage2DArray) +0:? 'g_tTex2du2a' (layout( rg32ui) uniform uimage2DArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4, uniform 2-component vector of float uf2, uniform 2-component vector of int ui2, uniform 2-component vector of uint uu2}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 605 + + Capability Shader + Capability Image1D + Capability StorageImageExtendedFormats + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 581 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "Fn1(vi2;" + Name 10 "x" + Name 18 "Fn1(vu2;" + Name 17 "x" + Name 25 "Fn1(vf2;" + Name 24 "x" + Name 29 "Fn2(vi2;" + Name 28 "x" + Name 33 "Fn2(vu2;" + Name 32 "x" + Name 37 "Fn2(vf2;" + Name 36 "x" + Name 40 "SomeValue(" + Name 43 "PS_OUTPUT" + MemberName 43(PS_OUTPUT) 0 "Color" + Name 45 "@main(" + Name 64 "$Global" + MemberName 64($Global) 0 "c1" + MemberName 64($Global) 1 "c2" + MemberName 64($Global) 2 "c3" + MemberName 64($Global) 3 "c4" + MemberName 64($Global) 4 "o1" + MemberName 64($Global) 5 "o2" + MemberName 64($Global) 6 "o3" + MemberName 64($Global) 7 "o4" + MemberName 64($Global) 8 "uf2" + MemberName 64($Global) 9 "ui2" + MemberName 64($Global) 10 "uu2" + Name 66 "" + Name 76 "g_tTex1df2" + Name 82 "r00" + Name 87 "r01" + Name 90 "g_tTex1di2" + Name 95 "r02" + Name 98 "g_tTex1du2" + Name 103 "r10" + Name 106 "g_tTex2df2" + Name 111 "r11" + Name 114 "g_tTex2di2" + Name 119 "r12" + Name 122 "g_tTex2du2" + Name 127 "r20" + Name 130 "g_tTex3df2" + Name 137 "r21" + Name 140 "g_tTex3di2" + Name 145 "r22" + Name 148 "g_tTex3du2" + Name 153 "lf2" + Name 158 "storeTemp" + Name 168 "storeTemp" + Name 174 "storeTemp" + Name 182 "val1" + Name 184 "coordTemp" + Name 187 "storeTemp" + Name 198 "coordTemp" + Name 201 "storeTemp" + Name 212 "coordTemp" + Name 215 "storeTemp" + Name 226 "coordTemp" + Name 229 "storeTemp" + Name 239 "coordTemp" + Name 242 "storeTemp" + Name 252 "coordTemp" + Name 255 "storeTemp" + Name 266 "coordTemp" + Name 269 "storeTemp" + Name 280 "coordTemp" + Name 283 "storeTemp" + Name 293 "coordTemp" + Name 296 "storeTemp" + Name 306 "storeTemp" + Name 316 "storeTemp" + Name 323 "storeTemp" + Name 330 "storeTemp" + Name 340 "storeTemp" + Name 347 "storeTemp" + Name 358 "param" + Name 364 "param" + Name 370 "param" + Name 372 "tempArg" + Name 373 "param" + Name 380 "tempArg" + Name 381 "param" + Name 388 "tempArg" + Name 389 "param" + Name 396 "coordTemp" + Name 399 "storeTemp" + Name 410 "coordTemp" + Name 413 "storeTemp" + Name 423 "coordTemp" + Name 426 "storeTemp" + Name 436 "coordTemp" + Name 439 "storeTemp" + Name 449 "coordTemp" + Name 452 "storeTemp" + Name 462 "coordTemp" + Name 465 "storeTemp" + Name 475 "coordTemp" + Name 478 "storeTempPre" + Name 482 "storeTempPost" + Name 490 "coordTemp" + Name 493 "storeTempPre" + Name 497 "storeTempPost" + Name 505 "coordTemp" + Name 508 "storeTempPre" + Name 512 "storeTempPost" + Name 520 "coordTemp" + Name 523 "storeTempPre" + Name 527 "storeTempPost" + Name 535 "coordTemp" + Name 538 "storeTempPre" + Name 542 "storeTempPost" + Name 550 "coordTemp" + Name 553 "storeTempPre" + Name 557 "storeTempPost" + Name 565 "storeTemp" + Name 573 "psout" + Name 581 "@entryPointOutput.Color" + Name 586 "g_sSamp" + Name 589 "g_tTex1df2a" + Name 592 "g_tTex1di2a" + Name 595 "g_tTex1du2a" + Name 598 "g_tTex2df2a" + Name 601 "g_tTex2di2a" + Name 604 "g_tTex2du2a" + MemberDecorate 64($Global) 0 Offset 0 + MemberDecorate 64($Global) 1 Offset 8 + MemberDecorate 64($Global) 2 Offset 16 + MemberDecorate 64($Global) 3 Offset 32 + MemberDecorate 64($Global) 4 Offset 48 + MemberDecorate 64($Global) 5 Offset 56 + MemberDecorate 64($Global) 6 Offset 64 + MemberDecorate 64($Global) 7 Offset 80 + MemberDecorate 64($Global) 8 Offset 96 + MemberDecorate 64($Global) 9 Offset 104 + MemberDecorate 64($Global) 10 Offset 112 + Decorate 64($Global) Block + Decorate 66 DescriptorSet 0 + Decorate 76(g_tTex1df2) DescriptorSet 0 + Decorate 90(g_tTex1di2) DescriptorSet 0 + Decorate 98(g_tTex1du2) DescriptorSet 0 + Decorate 106(g_tTex2df2) DescriptorSet 0 + Decorate 114(g_tTex2di2) DescriptorSet 0 + Decorate 122(g_tTex2du2) DescriptorSet 0 + Decorate 130(g_tTex3df2) DescriptorSet 0 + Decorate 140(g_tTex3di2) DescriptorSet 0 + Decorate 148(g_tTex3du2) DescriptorSet 0 + Decorate 581(@entryPointOutput.Color) Location 0 + Decorate 586(g_sSamp) DescriptorSet 0 + Decorate 586(g_sSamp) Binding 0 + Decorate 589(g_tTex1df2a) DescriptorSet 0 + Decorate 592(g_tTex1di2a) DescriptorSet 0 + Decorate 595(g_tTex1du2a) DescriptorSet 0 + Decorate 598(g_tTex2df2a) DescriptorSet 0 + Decorate 601(g_tTex2di2a) DescriptorSet 0 + Decorate 604(g_tTex2du2a) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeVector 6(int) 2 + 8: TypePointer Function 7(ivec2) + 9: TypeFunction 7(ivec2) 8(ptr) + 13: TypeInt 32 0 + 14: TypeVector 13(int) 2 + 15: TypePointer Function 14(ivec2) + 16: TypeFunction 14(ivec2) 15(ptr) + 20: TypeFloat 32 + 21: TypeVector 20(float) 2 + 22: TypePointer Function 21(fvec2) + 23: TypeFunction 21(fvec2) 22(ptr) + 27: TypeFunction 2 8(ptr) + 31: TypeFunction 2 15(ptr) + 35: TypeFunction 2 22(ptr) + 39: TypeFunction 21(fvec2) + 42: TypeVector 20(float) 4 + 43(PS_OUTPUT): TypeStruct 42(fvec4) + 44: TypeFunction 43(PS_OUTPUT) + 56: 6(int) Constant 0 + 57: 7(ivec2) ConstantComposite 56 56 + 58: 13(int) Constant 0 + 59: 14(ivec2) ConstantComposite 58 58 + 60: 20(float) Constant 0 + 61: 21(fvec2) ConstantComposite 60 60 + 62: TypeVector 6(int) 3 + 63: TypeVector 6(int) 4 + 64($Global): TypeStruct 6(int) 7(ivec2) 62(ivec3) 63(ivec4) 6(int) 7(ivec2) 62(ivec3) 63(ivec4) 21(fvec2) 7(ivec2) 14(ivec2) + 65: TypePointer Uniform 64($Global) + 66: 65(ptr) Variable Uniform + 67: 6(int) Constant 1 + 68: TypePointer Uniform 7(ivec2) + 74: TypeImage 20(float) 1D nonsampled format:Rg32f + 75: TypePointer UniformConstant 74 + 76(g_tTex1df2): 75(ptr) Variable UniformConstant + 78: TypePointer Uniform 6(int) + 88: TypeImage 6(int) 1D nonsampled format:Rg32i + 89: TypePointer UniformConstant 88 + 90(g_tTex1di2): 89(ptr) Variable UniformConstant + 96: TypeImage 13(int) 1D nonsampled format:Rg32ui + 97: TypePointer UniformConstant 96 + 98(g_tTex1du2): 97(ptr) Variable UniformConstant + 104: TypeImage 20(float) 2D nonsampled format:Rg32f + 105: TypePointer UniformConstant 104 + 106(g_tTex2df2): 105(ptr) Variable UniformConstant + 112: TypeImage 6(int) 2D nonsampled format:Rg32i + 113: TypePointer UniformConstant 112 + 114(g_tTex2di2): 113(ptr) Variable UniformConstant + 120: TypeImage 13(int) 2D nonsampled format:Rg32ui + 121: TypePointer UniformConstant 120 + 122(g_tTex2du2): 121(ptr) Variable UniformConstant + 128: TypeImage 20(float) 3D nonsampled format:Rg32f + 129: TypePointer UniformConstant 128 + 130(g_tTex3df2): 129(ptr) Variable UniformConstant + 132: 6(int) Constant 2 + 133: TypePointer Uniform 62(ivec3) + 138: TypeImage 6(int) 3D nonsampled format:Rg32i + 139: TypePointer UniformConstant 138 + 140(g_tTex3di2): 139(ptr) Variable UniformConstant + 146: TypeImage 13(int) 3D nonsampled format:Rg32ui + 147: TypePointer UniformConstant 146 + 148(g_tTex3du2): 147(ptr) Variable UniformConstant + 154: 6(int) Constant 8 + 155: TypePointer Uniform 21(fvec2) + 169: 7(ivec2) ConstantComposite 132 132 + 175: 13(int) Constant 3 + 176: 13(int) Constant 2 + 177: 14(ivec2) ConstantComposite 175 176 + 183: TypePointer Function 6(int) + 191: 20(float) Constant 1073741824 + 205: 20(float) Constant 1077936128 + 219: 20(float) Constant 1082130432 + 259: 6(int) Constant 65535 + 273: 6(int) Constant 61680 + 317: 6(int) Constant 5 + 318: 7(ivec2) ConstantComposite 317 132 + 324: 13(int) Constant 6 + 325: 14(ivec2) ConstantComposite 324 176 + 341: 6(int) Constant 6 + 342: 7(ivec2) ConstantComposite 154 341 + 348: 13(int) Constant 9 + 349: 14(ivec2) ConstantComposite 348 176 + 404: 20(float) Constant 1065353216 + 567: 6(int) Constant 3 + 568: 7(ivec2) ConstantComposite 132 567 + 572: TypePointer Function 43(PS_OUTPUT) + 574: 42(fvec4) ConstantComposite 404 404 404 404 + 575: TypePointer Function 42(fvec4) + 580: TypePointer Output 42(fvec4) +581(@entryPointOutput.Color): 580(ptr) Variable Output + 584: TypeSampler + 585: TypePointer UniformConstant 584 + 586(g_sSamp): 585(ptr) Variable UniformConstant + 587: TypeImage 20(float) 1D array nonsampled format:Rg32f + 588: TypePointer UniformConstant 587 +589(g_tTex1df2a): 588(ptr) Variable UniformConstant + 590: TypeImage 6(int) 1D array nonsampled format:Rg32i + 591: TypePointer UniformConstant 590 +592(g_tTex1di2a): 591(ptr) Variable UniformConstant + 593: TypeImage 13(int) 1D array nonsampled format:Rg32ui + 594: TypePointer UniformConstant 593 +595(g_tTex1du2a): 594(ptr) Variable UniformConstant + 596: TypeImage 20(float) 2D array nonsampled format:Rg32f + 597: TypePointer UniformConstant 596 +598(g_tTex2df2a): 597(ptr) Variable UniformConstant + 599: TypeImage 6(int) 2D array nonsampled format:Rg32i + 600: TypePointer UniformConstant 599 +601(g_tTex2di2a): 600(ptr) Variable UniformConstant + 602: TypeImage 13(int) 2D array nonsampled format:Rg32ui + 603: TypePointer UniformConstant 602 +604(g_tTex2du2a): 603(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 582:43(PS_OUTPUT) FunctionCall 45(@main() + 583: 42(fvec4) CompositeExtract 582 0 + Store 581(@entryPointOutput.Color) 583 + Return + FunctionEnd + 11(Fn1(vi2;): 7(ivec2) Function None 9 + 10(x): 8(ptr) FunctionParameter + 12: Label + 47: 7(ivec2) Load 10(x) + ReturnValue 47 + FunctionEnd + 18(Fn1(vu2;): 14(ivec2) Function None 16 + 17(x): 15(ptr) FunctionParameter + 19: Label + 50: 14(ivec2) Load 17(x) + ReturnValue 50 + FunctionEnd + 25(Fn1(vf2;): 21(fvec2) Function None 23 + 24(x): 22(ptr) FunctionParameter + 26: Label + 53: 21(fvec2) Load 24(x) + ReturnValue 53 + FunctionEnd + 29(Fn2(vi2;): 2 Function None 27 + 28(x): 8(ptr) FunctionParameter + 30: Label + Store 28(x) 57 + Return + FunctionEnd + 33(Fn2(vu2;): 2 Function None 31 + 32(x): 15(ptr) FunctionParameter + 34: Label + Store 32(x) 59 + Return + FunctionEnd + 37(Fn2(vf2;): 2 Function None 35 + 36(x): 22(ptr) FunctionParameter + 38: Label + Store 36(x) 61 + Return + FunctionEnd + 40(SomeValue(): 21(fvec2) Function None 39 + 41: Label + 69: 68(ptr) AccessChain 66 67 + 70: 7(ivec2) Load 69 + 71: 21(fvec2) ConvertSToF 70 + ReturnValue 71 + FunctionEnd + 45(@main():43(PS_OUTPUT) Function None 44 + 46: Label + 82(r00): 22(ptr) Variable Function + 87(r01): 8(ptr) Variable Function + 95(r02): 15(ptr) Variable Function + 103(r10): 22(ptr) Variable Function + 111(r11): 8(ptr) Variable Function + 119(r12): 15(ptr) Variable Function + 127(r20): 22(ptr) Variable Function + 137(r21): 8(ptr) Variable Function + 145(r22): 15(ptr) Variable Function + 153(lf2): 22(ptr) Variable Function + 158(storeTemp): 22(ptr) Variable Function + 168(storeTemp): 8(ptr) Variable Function + 174(storeTemp): 15(ptr) Variable Function + 182(val1): 22(ptr) Variable Function + 184(coordTemp): 183(ptr) Variable Function + 187(storeTemp): 22(ptr) Variable Function + 198(coordTemp): 183(ptr) Variable Function + 201(storeTemp): 22(ptr) Variable Function + 212(coordTemp): 183(ptr) Variable Function + 215(storeTemp): 22(ptr) Variable Function + 226(coordTemp): 183(ptr) Variable Function + 229(storeTemp): 8(ptr) Variable Function + 239(coordTemp): 183(ptr) Variable Function + 242(storeTemp): 8(ptr) Variable Function + 252(coordTemp): 183(ptr) Variable Function + 255(storeTemp): 8(ptr) Variable Function + 266(coordTemp): 183(ptr) Variable Function + 269(storeTemp): 8(ptr) Variable Function + 280(coordTemp): 183(ptr) Variable Function + 283(storeTemp): 8(ptr) Variable Function + 293(coordTemp): 183(ptr) Variable Function + 296(storeTemp): 8(ptr) Variable Function + 306(storeTemp): 22(ptr) Variable Function + 316(storeTemp): 8(ptr) Variable Function + 323(storeTemp): 15(ptr) Variable Function + 330(storeTemp): 22(ptr) Variable Function + 340(storeTemp): 8(ptr) Variable Function + 347(storeTemp): 15(ptr) Variable Function + 358(param): 22(ptr) Variable Function + 364(param): 8(ptr) Variable Function + 370(param): 15(ptr) Variable Function + 372(tempArg): 22(ptr) Variable Function + 373(param): 22(ptr) Variable Function + 380(tempArg): 8(ptr) Variable Function + 381(param): 8(ptr) Variable Function + 388(tempArg): 15(ptr) Variable Function + 389(param): 15(ptr) Variable Function + 396(coordTemp): 183(ptr) Variable Function + 399(storeTemp): 22(ptr) Variable Function + 410(coordTemp): 183(ptr) Variable Function + 413(storeTemp): 8(ptr) Variable Function + 423(coordTemp): 183(ptr) Variable Function + 426(storeTemp): 15(ptr) Variable Function + 436(coordTemp): 183(ptr) Variable Function + 439(storeTemp): 22(ptr) Variable Function + 449(coordTemp): 183(ptr) Variable Function + 452(storeTemp): 8(ptr) Variable Function + 462(coordTemp): 183(ptr) Variable Function + 465(storeTemp): 15(ptr) Variable Function + 475(coordTemp): 183(ptr) Variable Function +478(storeTempPre): 22(ptr) Variable Function +482(storeTempPost): 22(ptr) Variable Function + 490(coordTemp): 183(ptr) Variable Function +493(storeTempPre): 15(ptr) Variable Function +497(storeTempPost): 15(ptr) Variable Function + 505(coordTemp): 183(ptr) Variable Function +508(storeTempPre): 8(ptr) Variable Function +512(storeTempPost): 8(ptr) Variable Function + 520(coordTemp): 183(ptr) Variable Function +523(storeTempPre): 22(ptr) Variable Function +527(storeTempPost): 22(ptr) Variable Function + 535(coordTemp): 183(ptr) Variable Function +538(storeTempPre): 8(ptr) Variable Function +542(storeTempPost): 8(ptr) Variable Function + 550(coordTemp): 183(ptr) Variable Function +553(storeTempPre): 15(ptr) Variable Function +557(storeTempPost): 15(ptr) Variable Function + 565(storeTemp): 22(ptr) Variable Function + 573(psout): 572(ptr) Variable Function + 77: 74 Load 76(g_tTex1df2) + 79: 78(ptr) AccessChain 66 56 + 80: 6(int) Load 79 + 81: 21(fvec2) ImageRead 77 80 + 83: 74 Load 76(g_tTex1df2) + 84: 78(ptr) AccessChain 66 56 + 85: 6(int) Load 84 + 86: 21(fvec2) ImageRead 83 85 + Store 82(r00) 86 + 91: 88 Load 90(g_tTex1di2) + 92: 78(ptr) AccessChain 66 56 + 93: 6(int) Load 92 + 94: 7(ivec2) ImageRead 91 93 + Store 87(r01) 94 + 99: 96 Load 98(g_tTex1du2) + 100: 78(ptr) AccessChain 66 56 + 101: 6(int) Load 100 + 102: 14(ivec2) ImageRead 99 101 + Store 95(r02) 102 + 107: 104 Load 106(g_tTex2df2) + 108: 68(ptr) AccessChain 66 67 + 109: 7(ivec2) Load 108 + 110: 21(fvec2) ImageRead 107 109 + Store 103(r10) 110 + 115: 112 Load 114(g_tTex2di2) + 116: 68(ptr) AccessChain 66 67 + 117: 7(ivec2) Load 116 + 118: 7(ivec2) ImageRead 115 117 + Store 111(r11) 118 + 123: 120 Load 122(g_tTex2du2) + 124: 68(ptr) AccessChain 66 67 + 125: 7(ivec2) Load 124 + 126: 14(ivec2) ImageRead 123 125 + Store 119(r12) 126 + 131: 128 Load 130(g_tTex3df2) + 134: 133(ptr) AccessChain 66 132 + 135: 62(ivec3) Load 134 + 136: 21(fvec2) ImageRead 131 135 + Store 127(r20) 136 + 141: 138 Load 140(g_tTex3di2) + 142: 133(ptr) AccessChain 66 132 + 143: 62(ivec3) Load 142 + 144: 7(ivec2) ImageRead 141 143 + Store 137(r21) 144 + 149: 146 Load 148(g_tTex3du2) + 150: 133(ptr) AccessChain 66 132 + 151: 62(ivec3) Load 150 + 152: 14(ivec2) ImageRead 149 151 + Store 145(r22) 152 + 156: 155(ptr) AccessChain 66 154 + 157: 21(fvec2) Load 156 + Store 153(lf2) 157 + 159: 21(fvec2) FunctionCall 40(SomeValue() + Store 158(storeTemp) 159 + 160: 74 Load 76(g_tTex1df2) + 161: 78(ptr) AccessChain 66 56 + 162: 6(int) Load 161 + 163: 21(fvec2) Load 158(storeTemp) + ImageWrite 160 162 163 + 164: 74 Load 76(g_tTex1df2) + 165: 78(ptr) AccessChain 66 56 + 166: 6(int) Load 165 + 167: 21(fvec2) Load 153(lf2) + ImageWrite 164 166 167 + Store 168(storeTemp) 169 + 170: 88 Load 90(g_tTex1di2) + 171: 78(ptr) AccessChain 66 56 + 172: 6(int) Load 171 + 173: 7(ivec2) Load 168(storeTemp) + ImageWrite 170 172 173 + Store 174(storeTemp) 177 + 178: 96 Load 98(g_tTex1du2) + 179: 78(ptr) AccessChain 66 56 + 180: 6(int) Load 179 + 181: 14(ivec2) Load 174(storeTemp) + ImageWrite 178 180 181 + 185: 78(ptr) AccessChain 66 56 + 186: 6(int) Load 185 + Store 184(coordTemp) 186 + 188: 74 Load 76(g_tTex1df2) + 189: 6(int) Load 184(coordTemp) + 190: 21(fvec2) ImageRead 188 189 + Store 187(storeTemp) 190 + 192: 21(fvec2) Load 187(storeTemp) + 193: 21(fvec2) VectorTimesScalar 192 191 + Store 187(storeTemp) 193 + 194: 74 Load 76(g_tTex1df2) + 195: 6(int) Load 184(coordTemp) + 196: 21(fvec2) Load 187(storeTemp) + ImageWrite 194 195 196 + 197: 21(fvec2) Load 187(storeTemp) + Store 182(val1) 197 + 199: 78(ptr) AccessChain 66 56 + 200: 6(int) Load 199 + Store 198(coordTemp) 200 + 202: 74 Load 76(g_tTex1df2) + 203: 6(int) Load 198(coordTemp) + 204: 21(fvec2) ImageRead 202 203 + Store 201(storeTemp) 204 + 206: 21(fvec2) Load 201(storeTemp) + 207: 21(fvec2) CompositeConstruct 205 205 + 208: 21(fvec2) FSub 206 207 + Store 201(storeTemp) 208 + 209: 74 Load 76(g_tTex1df2) + 210: 6(int) Load 198(coordTemp) + 211: 21(fvec2) Load 201(storeTemp) + ImageWrite 209 210 211 + 213: 78(ptr) AccessChain 66 56 + 214: 6(int) Load 213 + Store 212(coordTemp) 214 + 216: 74 Load 76(g_tTex1df2) + 217: 6(int) Load 212(coordTemp) + 218: 21(fvec2) ImageRead 216 217 + Store 215(storeTemp) 218 + 220: 21(fvec2) Load 215(storeTemp) + 221: 21(fvec2) CompositeConstruct 219 219 + 222: 21(fvec2) FAdd 220 221 + Store 215(storeTemp) 222 + 223: 74 Load 76(g_tTex1df2) + 224: 6(int) Load 212(coordTemp) + 225: 21(fvec2) Load 215(storeTemp) + ImageWrite 223 224 225 + 227: 78(ptr) AccessChain 66 56 + 228: 6(int) Load 227 + Store 226(coordTemp) 228 + 230: 88 Load 90(g_tTex1di2) + 231: 6(int) Load 226(coordTemp) + 232: 7(ivec2) ImageRead 230 231 + Store 229(storeTemp) 232 + 233: 7(ivec2) Load 229(storeTemp) + 234: 7(ivec2) CompositeConstruct 132 132 + 235: 7(ivec2) SDiv 233 234 + Store 229(storeTemp) 235 + 236: 88 Load 90(g_tTex1di2) + 237: 6(int) Load 226(coordTemp) + 238: 7(ivec2) Load 229(storeTemp) + ImageWrite 236 237 238 + 240: 78(ptr) AccessChain 66 56 + 241: 6(int) Load 240 + Store 239(coordTemp) 241 + 243: 88 Load 90(g_tTex1di2) + 244: 6(int) Load 239(coordTemp) + 245: 7(ivec2) ImageRead 243 244 + Store 242(storeTemp) 245 + 246: 7(ivec2) Load 242(storeTemp) + 247: 7(ivec2) CompositeConstruct 132 132 + 248: 7(ivec2) SMod 246 247 + Store 242(storeTemp) 248 + 249: 88 Load 90(g_tTex1di2) + 250: 6(int) Load 239(coordTemp) + 251: 7(ivec2) Load 242(storeTemp) + ImageWrite 249 250 251 + 253: 78(ptr) AccessChain 66 56 + 254: 6(int) Load 253 + Store 252(coordTemp) 254 + 256: 88 Load 90(g_tTex1di2) + 257: 6(int) Load 252(coordTemp) + 258: 7(ivec2) ImageRead 256 257 + Store 255(storeTemp) 258 + 260: 7(ivec2) Load 255(storeTemp) + 261: 7(ivec2) CompositeConstruct 259 259 + 262: 7(ivec2) BitwiseAnd 260 261 + Store 255(storeTemp) 262 + 263: 88 Load 90(g_tTex1di2) + 264: 6(int) Load 252(coordTemp) + 265: 7(ivec2) Load 255(storeTemp) + ImageWrite 263 264 265 + 267: 78(ptr) AccessChain 66 56 + 268: 6(int) Load 267 + Store 266(coordTemp) 268 + 270: 88 Load 90(g_tTex1di2) + 271: 6(int) Load 266(coordTemp) + 272: 7(ivec2) ImageRead 270 271 + Store 269(storeTemp) 272 + 274: 7(ivec2) Load 269(storeTemp) + 275: 7(ivec2) CompositeConstruct 273 273 + 276: 7(ivec2) BitwiseOr 274 275 + Store 269(storeTemp) 276 + 277: 88 Load 90(g_tTex1di2) + 278: 6(int) Load 266(coordTemp) + 279: 7(ivec2) Load 269(storeTemp) + ImageWrite 277 278 279 + 281: 78(ptr) AccessChain 66 56 + 282: 6(int) Load 281 + Store 280(coordTemp) 282 + 284: 88 Load 90(g_tTex1di2) + 285: 6(int) Load 280(coordTemp) + 286: 7(ivec2) ImageRead 284 285 + Store 283(storeTemp) 286 + 287: 7(ivec2) Load 283(storeTemp) + 288: 7(ivec2) CompositeConstruct 132 132 + 289: 7(ivec2) ShiftLeftLogical 287 288 + Store 283(storeTemp) 289 + 290: 88 Load 90(g_tTex1di2) + 291: 6(int) Load 280(coordTemp) + 292: 7(ivec2) Load 283(storeTemp) + ImageWrite 290 291 292 + 294: 78(ptr) AccessChain 66 56 + 295: 6(int) Load 294 + Store 293(coordTemp) 295 + 297: 88 Load 90(g_tTex1di2) + 298: 6(int) Load 293(coordTemp) + 299: 7(ivec2) ImageRead 297 298 + Store 296(storeTemp) 299 + 300: 7(ivec2) Load 296(storeTemp) + 301: 7(ivec2) CompositeConstruct 132 132 + 302: 7(ivec2) ShiftRightArithmetic 300 301 + Store 296(storeTemp) 302 + 303: 88 Load 90(g_tTex1di2) + 304: 6(int) Load 293(coordTemp) + 305: 7(ivec2) Load 296(storeTemp) + ImageWrite 303 304 305 + 307: 21(fvec2) FunctionCall 40(SomeValue() + Store 306(storeTemp) 307 + 308: 104 Load 106(g_tTex2df2) + 309: 68(ptr) AccessChain 66 67 + 310: 7(ivec2) Load 309 + 311: 21(fvec2) Load 306(storeTemp) + ImageWrite 308 310 311 + 312: 104 Load 106(g_tTex2df2) + 313: 68(ptr) AccessChain 66 67 + 314: 7(ivec2) Load 313 + 315: 21(fvec2) Load 153(lf2) + ImageWrite 312 314 315 + Store 316(storeTemp) 318 + 319: 112 Load 114(g_tTex2di2) + 320: 68(ptr) AccessChain 66 67 + 321: 7(ivec2) Load 320 + 322: 7(ivec2) Load 316(storeTemp) + ImageWrite 319 321 322 + Store 323(storeTemp) 325 + 326: 120 Load 122(g_tTex2du2) + 327: 68(ptr) AccessChain 66 67 + 328: 7(ivec2) Load 327 + 329: 14(ivec2) Load 323(storeTemp) + ImageWrite 326 328 329 + 331: 21(fvec2) FunctionCall 40(SomeValue() + Store 330(storeTemp) 331 + 332: 128 Load 130(g_tTex3df2) + 333: 133(ptr) AccessChain 66 132 + 334: 62(ivec3) Load 333 + 335: 21(fvec2) Load 330(storeTemp) + ImageWrite 332 334 335 + 336: 128 Load 130(g_tTex3df2) + 337: 133(ptr) AccessChain 66 132 + 338: 62(ivec3) Load 337 + 339: 21(fvec2) Load 153(lf2) + ImageWrite 336 338 339 + Store 340(storeTemp) 342 + 343: 138 Load 140(g_tTex3di2) + 344: 133(ptr) AccessChain 66 132 + 345: 62(ivec3) Load 344 + 346: 7(ivec2) Load 340(storeTemp) + ImageWrite 343 345 346 + Store 347(storeTemp) 349 + 350: 146 Load 148(g_tTex3du2) + 351: 133(ptr) AccessChain 66 132 + 352: 62(ivec3) Load 351 + 353: 14(ivec2) Load 347(storeTemp) + ImageWrite 350 352 353 + 354: 74 Load 76(g_tTex1df2) + 355: 78(ptr) AccessChain 66 56 + 356: 6(int) Load 355 + 357: 21(fvec2) ImageRead 354 356 + Store 358(param) 357 + 359: 21(fvec2) FunctionCall 25(Fn1(vf2;) 358(param) + 360: 88 Load 90(g_tTex1di2) + 361: 78(ptr) AccessChain 66 56 + 362: 6(int) Load 361 + 363: 7(ivec2) ImageRead 360 362 + Store 364(param) 363 + 365: 7(ivec2) FunctionCall 11(Fn1(vi2;) 364(param) + 366: 96 Load 98(g_tTex1du2) + 367: 78(ptr) AccessChain 66 56 + 368: 6(int) Load 367 + 369: 14(ivec2) ImageRead 366 368 + Store 370(param) 369 + 371: 14(ivec2) FunctionCall 18(Fn1(vu2;) 370(param) + 374: 2 FunctionCall 37(Fn2(vf2;) 373(param) + 375: 21(fvec2) Load 373(param) + Store 372(tempArg) 375 + 376: 74 Load 76(g_tTex1df2) + 377: 78(ptr) AccessChain 66 56 + 378: 6(int) Load 377 + 379: 21(fvec2) Load 372(tempArg) + ImageWrite 376 378 379 + 382: 2 FunctionCall 29(Fn2(vi2;) 381(param) + 383: 7(ivec2) Load 381(param) + Store 380(tempArg) 383 + 384: 88 Load 90(g_tTex1di2) + 385: 78(ptr) AccessChain 66 56 + 386: 6(int) Load 385 + 387: 7(ivec2) Load 380(tempArg) + ImageWrite 384 386 387 + 390: 2 FunctionCall 33(Fn2(vu2;) 389(param) + 391: 14(ivec2) Load 389(param) + Store 388(tempArg) 391 + 392: 96 Load 98(g_tTex1du2) + 393: 78(ptr) AccessChain 66 56 + 394: 6(int) Load 393 + 395: 14(ivec2) Load 388(tempArg) + ImageWrite 392 394 395 + 397: 78(ptr) AccessChain 66 56 + 398: 6(int) Load 397 + Store 396(coordTemp) 398 + 400: 74 Load 76(g_tTex1df2) + 401: 6(int) Load 396(coordTemp) + 402: 21(fvec2) ImageRead 400 401 + Store 399(storeTemp) 402 + 403: 21(fvec2) Load 399(storeTemp) + 405: 21(fvec2) CompositeConstruct 404 404 + 406: 21(fvec2) FAdd 403 405 + Store 399(storeTemp) 406 + 407: 74 Load 76(g_tTex1df2) + 408: 6(int) Load 396(coordTemp) + 409: 21(fvec2) Load 399(storeTemp) + ImageWrite 407 408 409 + 411: 78(ptr) AccessChain 66 56 + 412: 6(int) Load 411 + Store 410(coordTemp) 412 + 414: 88 Load 90(g_tTex1di2) + 415: 6(int) Load 410(coordTemp) + 416: 7(ivec2) ImageRead 414 415 + Store 413(storeTemp) 416 + 417: 7(ivec2) Load 413(storeTemp) + 418: 7(ivec2) CompositeConstruct 67 67 + 419: 7(ivec2) IAdd 417 418 + Store 413(storeTemp) 419 + 420: 88 Load 90(g_tTex1di2) + 421: 6(int) Load 410(coordTemp) + 422: 7(ivec2) Load 413(storeTemp) + ImageWrite 420 421 422 + 424: 78(ptr) AccessChain 66 56 + 425: 6(int) Load 424 + Store 423(coordTemp) 425 + 427: 96 Load 98(g_tTex1du2) + 428: 6(int) Load 423(coordTemp) + 429: 14(ivec2) ImageRead 427 428 + Store 426(storeTemp) 429 + 430: 14(ivec2) Load 426(storeTemp) + 431: 7(ivec2) CompositeConstruct 67 67 + 432: 14(ivec2) IAdd 430 431 + Store 426(storeTemp) 432 + 433: 96 Load 98(g_tTex1du2) + 434: 6(int) Load 423(coordTemp) + 435: 14(ivec2) Load 426(storeTemp) + ImageWrite 433 434 435 + 437: 78(ptr) AccessChain 66 56 + 438: 6(int) Load 437 + Store 436(coordTemp) 438 + 440: 74 Load 76(g_tTex1df2) + 441: 6(int) Load 436(coordTemp) + 442: 21(fvec2) ImageRead 440 441 + Store 439(storeTemp) 442 + 443: 21(fvec2) Load 439(storeTemp) + 444: 21(fvec2) CompositeConstruct 404 404 + 445: 21(fvec2) FSub 443 444 + Store 439(storeTemp) 445 + 446: 74 Load 76(g_tTex1df2) + 447: 6(int) Load 436(coordTemp) + 448: 21(fvec2) Load 439(storeTemp) + ImageWrite 446 447 448 + 450: 78(ptr) AccessChain 66 56 + 451: 6(int) Load 450 + Store 449(coordTemp) 451 + 453: 88 Load 90(g_tTex1di2) + 454: 6(int) Load 449(coordTemp) + 455: 7(ivec2) ImageRead 453 454 + Store 452(storeTemp) 455 + 456: 7(ivec2) Load 452(storeTemp) + 457: 7(ivec2) CompositeConstruct 67 67 + 458: 7(ivec2) ISub 456 457 + Store 452(storeTemp) 458 + 459: 88 Load 90(g_tTex1di2) + 460: 6(int) Load 449(coordTemp) + 461: 7(ivec2) Load 452(storeTemp) + ImageWrite 459 460 461 + 463: 78(ptr) AccessChain 66 56 + 464: 6(int) Load 463 + Store 462(coordTemp) 464 + 466: 96 Load 98(g_tTex1du2) + 467: 6(int) Load 462(coordTemp) + 468: 14(ivec2) ImageRead 466 467 + Store 465(storeTemp) 468 + 469: 14(ivec2) Load 465(storeTemp) + 470: 7(ivec2) CompositeConstruct 67 67 + 471: 14(ivec2) ISub 469 470 + Store 465(storeTemp) 471 + 472: 96 Load 98(g_tTex1du2) + 473: 6(int) Load 462(coordTemp) + 474: 14(ivec2) Load 465(storeTemp) + ImageWrite 472 473 474 + 476: 78(ptr) AccessChain 66 56 + 477: 6(int) Load 476 + Store 475(coordTemp) 477 + 479: 74 Load 76(g_tTex1df2) + 480: 6(int) Load 475(coordTemp) + 481: 21(fvec2) ImageRead 479 480 + Store 478(storeTempPre) 481 + 483: 21(fvec2) Load 478(storeTempPre) + Store 482(storeTempPost) 483 + 484: 21(fvec2) Load 482(storeTempPost) + 485: 21(fvec2) CompositeConstruct 404 404 + 486: 21(fvec2) FAdd 484 485 + Store 482(storeTempPost) 486 + 487: 74 Load 76(g_tTex1df2) + 488: 6(int) Load 475(coordTemp) + 489: 21(fvec2) Load 482(storeTempPost) + ImageWrite 487 488 489 + 491: 78(ptr) AccessChain 66 56 + 492: 6(int) Load 491 + Store 490(coordTemp) 492 + 494: 96 Load 98(g_tTex1du2) + 495: 6(int) Load 490(coordTemp) + 496: 14(ivec2) ImageRead 494 495 + Store 493(storeTempPre) 496 + 498: 14(ivec2) Load 493(storeTempPre) + Store 497(storeTempPost) 498 + 499: 14(ivec2) Load 497(storeTempPost) + 500: 7(ivec2) CompositeConstruct 67 67 + 501: 14(ivec2) ISub 499 500 + Store 497(storeTempPost) 501 + 502: 96 Load 98(g_tTex1du2) + 503: 6(int) Load 490(coordTemp) + 504: 14(ivec2) Load 497(storeTempPost) + ImageWrite 502 503 504 + 506: 78(ptr) AccessChain 66 56 + 507: 6(int) Load 506 + Store 505(coordTemp) 507 + 509: 88 Load 90(g_tTex1di2) + 510: 6(int) Load 505(coordTemp) + 511: 7(ivec2) ImageRead 509 510 + Store 508(storeTempPre) 511 + 513: 7(ivec2) Load 508(storeTempPre) + Store 512(storeTempPost) 513 + 514: 7(ivec2) Load 512(storeTempPost) + 515: 7(ivec2) CompositeConstruct 67 67 + 516: 7(ivec2) IAdd 514 515 + Store 512(storeTempPost) 516 + 517: 88 Load 90(g_tTex1di2) + 518: 6(int) Load 505(coordTemp) + 519: 7(ivec2) Load 512(storeTempPost) + ImageWrite 517 518 519 + 521: 78(ptr) AccessChain 66 56 + 522: 6(int) Load 521 + Store 520(coordTemp) 522 + 524: 74 Load 76(g_tTex1df2) + 525: 6(int) Load 520(coordTemp) + 526: 21(fvec2) ImageRead 524 525 + Store 523(storeTempPre) 526 + 528: 21(fvec2) Load 523(storeTempPre) + Store 527(storeTempPost) 528 + 529: 21(fvec2) Load 527(storeTempPost) + 530: 21(fvec2) CompositeConstruct 404 404 + 531: 21(fvec2) FSub 529 530 + Store 527(storeTempPost) 531 + 532: 74 Load 76(g_tTex1df2) + 533: 6(int) Load 520(coordTemp) + 534: 21(fvec2) Load 527(storeTempPost) + ImageWrite 532 533 534 + 536: 78(ptr) AccessChain 66 56 + 537: 6(int) Load 536 + Store 535(coordTemp) 537 + 539: 88 Load 90(g_tTex1di2) + 540: 6(int) Load 535(coordTemp) + 541: 7(ivec2) ImageRead 539 540 + Store 538(storeTempPre) 541 + 543: 7(ivec2) Load 538(storeTempPre) + Store 542(storeTempPost) 543 + 544: 7(ivec2) Load 542(storeTempPost) + 545: 7(ivec2) CompositeConstruct 67 67 + 546: 7(ivec2) IAdd 544 545 + Store 542(storeTempPost) 546 + 547: 88 Load 90(g_tTex1di2) + 548: 6(int) Load 535(coordTemp) + 549: 7(ivec2) Load 542(storeTempPost) + ImageWrite 547 548 549 + 551: 78(ptr) AccessChain 66 56 + 552: 6(int) Load 551 + Store 550(coordTemp) 552 + 554: 96 Load 98(g_tTex1du2) + 555: 6(int) Load 550(coordTemp) + 556: 14(ivec2) ImageRead 554 555 + Store 553(storeTempPre) 556 + 558: 14(ivec2) Load 553(storeTempPre) + Store 557(storeTempPost) 558 + 559: 14(ivec2) Load 557(storeTempPost) + 560: 7(ivec2) CompositeConstruct 67 67 + 561: 14(ivec2) ISub 559 560 + Store 557(storeTempPost) 561 + 562: 96 Load 98(g_tTex1du2) + 563: 6(int) Load 550(coordTemp) + 564: 14(ivec2) Load 557(storeTempPost) + ImageWrite 562 563 564 + 566: 104 Load 106(g_tTex2df2) + 569: 21(fvec2) ImageRead 566 568 + Store 565(storeTemp) 569 + 570: 74 Load 76(g_tTex1df2) + 571: 21(fvec2) Load 565(storeTemp) + ImageWrite 570 67 571 + 576: 575(ptr) AccessChain 573(psout) 56 + Store 576 574 + 577:43(PS_OUTPUT) Load 573(psout) + ReturnValue 577 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.sample.array.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.sample.array.dx10.frag.out new file mode 100644 index 00000000..92e3dd84 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.sample.array.dx10.frag.out @@ -0,0 +1,541 @@ +hlsl.sample.array.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Parameters: +0:? Sequence +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'txval10' ( temp 4-component vector of float) +0:27 texture ( temp 4-component vector of float) +0:27 Construct combined texture-sampler ( temp sampler1DArray) +0:27 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:27 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of int) +0:28 'txval11' ( temp 4-component vector of int) +0:28 texture ( temp 4-component vector of int) +0:28 Construct combined texture-sampler ( temp isampler1DArray) +0:28 'g_tTex1di4' ( uniform itexture1DArray) +0:28 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of uint) +0:29 'txval12' ( temp 4-component vector of uint) +0:29 texture ( temp 4-component vector of uint) +0:29 Construct combined texture-sampler ( temp usampler1DArray) +0:29 'g_tTex1du4' ( uniform utexture1DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval20' ( temp 4-component vector of float) +0:31 texture ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler2DArray) +0:31 'g_tTex2df4' ( uniform texture2DArray) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval21' ( temp 4-component vector of int) +0:32 texture ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler2DArray) +0:32 'g_tTex2di4' ( uniform itexture2DArray) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? 0.500000 +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval22' ( temp 4-component vector of uint) +0:33 texture ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler2DArray) +0:33 'g_tTex2du4' ( uniform utexture2DArray) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval40' ( temp 4-component vector of float) +0:35 texture ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp samplerCubeArray) +0:35 'g_tTexcdf4' ( uniform textureCubeArray) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval41' ( temp 4-component vector of int) +0:36 texture ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isamplerCubeArray) +0:36 'g_tTexcdi4' ( uniform itextureCubeArray) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval42' ( temp 4-component vector of uint) +0:37 texture ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usamplerCubeArray) +0:37 'g_tTexcdu4' ( uniform utextureCubeArray) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:? 1.000000 +0:39 move second child to first child ( temp 4-component vector of float) +0:39 Color: direct index for structure ( temp 4-component vector of float) +0:39 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:40 move second child to first child ( temp float) +0:40 Depth: direct index for structure ( temp float) +0:40 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 1.000000 +0:42 Branch: Return with expression +0:42 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:24 Color: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:24 Depth: direct index for structure ( temp float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4' ( uniform itexture1DArray) +0:? 'g_tTex1du4' ( uniform utexture1DArray) +0:? 'g_tTex2df4' ( uniform texture2DArray) +0:? 'g_tTex2di4' ( uniform itexture2DArray) +0:? 'g_tTex2du4' ( uniform utexture2DArray) +0:? 'g_tTexcdf4' ( uniform textureCubeArray) +0:? 'g_tTexcdi4' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Parameters: +0:? Sequence +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'txval10' ( temp 4-component vector of float) +0:27 texture ( temp 4-component vector of float) +0:27 Construct combined texture-sampler ( temp sampler1DArray) +0:27 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:27 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of int) +0:28 'txval11' ( temp 4-component vector of int) +0:28 texture ( temp 4-component vector of int) +0:28 Construct combined texture-sampler ( temp isampler1DArray) +0:28 'g_tTex1di4' ( uniform itexture1DArray) +0:28 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of uint) +0:29 'txval12' ( temp 4-component vector of uint) +0:29 texture ( temp 4-component vector of uint) +0:29 Construct combined texture-sampler ( temp usampler1DArray) +0:29 'g_tTex1du4' ( uniform utexture1DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval20' ( temp 4-component vector of float) +0:31 texture ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler2DArray) +0:31 'g_tTex2df4' ( uniform texture2DArray) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval21' ( temp 4-component vector of int) +0:32 texture ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler2DArray) +0:32 'g_tTex2di4' ( uniform itexture2DArray) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? 0.500000 +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval22' ( temp 4-component vector of uint) +0:33 texture ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler2DArray) +0:33 'g_tTex2du4' ( uniform utexture2DArray) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval40' ( temp 4-component vector of float) +0:35 texture ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp samplerCubeArray) +0:35 'g_tTexcdf4' ( uniform textureCubeArray) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval41' ( temp 4-component vector of int) +0:36 texture ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isamplerCubeArray) +0:36 'g_tTexcdi4' ( uniform itextureCubeArray) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval42' ( temp 4-component vector of uint) +0:37 texture ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usamplerCubeArray) +0:37 'g_tTexcdu4' ( uniform utextureCubeArray) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:? 1.000000 +0:39 move second child to first child ( temp 4-component vector of float) +0:39 Color: direct index for structure ( temp 4-component vector of float) +0:39 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:40 move second child to first child ( temp float) +0:40 Depth: direct index for structure ( temp float) +0:40 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 1.000000 +0:42 Branch: Return with expression +0:42 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:24 Color: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:24 Depth: direct index for structure ( temp float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4' ( uniform itexture1DArray) +0:? 'g_tTex1du4' ( uniform utexture1DArray) +0:? 'g_tTex2df4' ( uniform texture2DArray) +0:? 'g_tTex2di4' ( uniform itexture2DArray) +0:? 'g_tTex2du4' ( uniform utexture2DArray) +0:? 'g_tTexcdf4' ( uniform textureCubeArray) +0:? 'g_tTexcdi4' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 146 + + Capability Shader + Capability Sampled1D + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 138 142 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval10" + Name 16 "g_tTex1df4" + Name 20 "g_sSamp" + Name 32 "txval11" + Name 35 "g_tTex1di4" + Name 46 "txval12" + Name 49 "g_tTex1du4" + Name 57 "txval20" + Name 60 "g_tTex2df4" + Name 68 "txval21" + Name 71 "g_tTex2di4" + Name 79 "txval22" + Name 82 "g_tTex2du4" + Name 91 "txval40" + Name 94 "g_tTexcdf4" + Name 101 "txval41" + Name 104 "g_tTexcdi4" + Name 111 "txval42" + Name 114 "g_tTexcdu4" + Name 125 "psout" + Name 135 "flattenTemp" + Name 138 "@entryPointOutput.Color" + Name 142 "@entryPointOutput.Depth" + Name 145 "g_tTex1df4a" + Decorate 16(g_tTex1df4) DescriptorSet 0 + Decorate 16(g_tTex1df4) Binding 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 35(g_tTex1di4) DescriptorSet 0 + Decorate 49(g_tTex1du4) DescriptorSet 0 + Decorate 60(g_tTex2df4) DescriptorSet 0 + Decorate 71(g_tTex2di4) DescriptorSet 0 + Decorate 82(g_tTex2du4) DescriptorSet 0 + Decorate 94(g_tTexcdf4) DescriptorSet 0 + Decorate 104(g_tTexcdi4) DescriptorSet 0 + Decorate 114(g_tTexcdu4) DescriptorSet 0 + Decorate 138(@entryPointOutput.Color) Location 0 + Decorate 142(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 145(g_tTex1df4a) DescriptorSet 0 + Decorate 145(g_tTex1df4a) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 1D array sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 2 + 25: 6(float) Constant 1036831949 + 26: 6(float) Constant 1045220557 + 27: 24(fvec2) ConstantComposite 25 26 + 29: TypeInt 32 1 + 30: TypeVector 29(int) 4 + 31: TypePointer Function 30(ivec4) + 33: TypeImage 29(int) 1D array sampled format:Unknown + 34: TypePointer UniformConstant 33 + 35(g_tTex1di4): 34(ptr) Variable UniformConstant + 38: TypeSampledImage 33 + 40: 6(float) Constant 1050253722 + 41: 24(fvec2) ConstantComposite 26 40 + 43: TypeInt 32 0 + 44: TypeVector 43(int) 4 + 45: TypePointer Function 44(ivec4) + 47: TypeImage 43(int) 1D array sampled format:Unknown + 48: TypePointer UniformConstant 47 + 49(g_tTex1du4): 48(ptr) Variable UniformConstant + 52: TypeSampledImage 47 + 54: 6(float) Constant 1053609165 + 55: 24(fvec2) ConstantComposite 40 54 + 58: TypeImage 6(float) 2D array sampled format:Unknown + 59: TypePointer UniformConstant 58 + 60(g_tTex2df4): 59(ptr) Variable UniformConstant + 63: TypeSampledImage 58 + 65: TypeVector 6(float) 3 + 66: 65(fvec3) ConstantComposite 25 26 40 + 69: TypeImage 29(int) 2D array sampled format:Unknown + 70: TypePointer UniformConstant 69 + 71(g_tTex2di4): 70(ptr) Variable UniformConstant + 74: TypeSampledImage 69 + 76: 6(float) Constant 1056964608 + 77: 65(fvec3) ConstantComposite 40 54 76 + 80: TypeImage 43(int) 2D array sampled format:Unknown + 81: TypePointer UniformConstant 80 + 82(g_tTex2du4): 81(ptr) Variable UniformConstant + 85: TypeSampledImage 80 + 87: 6(float) Constant 1058642330 + 88: 6(float) Constant 1060320051 + 89: 65(fvec3) ConstantComposite 76 87 88 + 92: TypeImage 6(float) Cube array sampled format:Unknown + 93: TypePointer UniformConstant 92 + 94(g_tTexcdf4): 93(ptr) Variable UniformConstant + 97: TypeSampledImage 92 + 99: 7(fvec4) ConstantComposite 25 26 40 54 + 102: TypeImage 29(int) Cube array sampled format:Unknown + 103: TypePointer UniformConstant 102 + 104(g_tTexcdi4): 103(ptr) Variable UniformConstant + 107: TypeSampledImage 102 + 109: 7(fvec4) ConstantComposite 54 76 87 88 + 112: TypeImage 43(int) Cube array sampled format:Unknown + 113: TypePointer UniformConstant 112 + 114(g_tTexcdu4): 113(ptr) Variable UniformConstant + 117: TypeSampledImage 112 + 119: 6(float) Constant 1061997773 + 120: 6(float) Constant 1063675494 + 121: 6(float) Constant 1065353216 + 122: 7(fvec4) ConstantComposite 88 119 120 121 + 124: TypePointer Function 8(PS_OUTPUT) + 126: 29(int) Constant 0 + 127: 7(fvec4) ConstantComposite 121 121 121 121 + 129: 29(int) Constant 1 + 130: TypePointer Function 6(float) + 137: TypePointer Output 7(fvec4) +138(@entryPointOutput.Color): 137(ptr) Variable Output + 141: TypePointer Output 6(float) +142(@entryPointOutput.Depth): 141(ptr) Variable Output +145(g_tTex1df4a): 15(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +135(flattenTemp): 124(ptr) Variable Function + 136:8(PS_OUTPUT) FunctionCall 10(@main() + Store 135(flattenTemp) 136 + 139: 12(ptr) AccessChain 135(flattenTemp) 126 + 140: 7(fvec4) Load 139 + Store 138(@entryPointOutput.Color) 140 + 143: 130(ptr) AccessChain 135(flattenTemp) 129 + 144: 6(float) Load 143 + Store 142(@entryPointOutput.Depth) 144 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval10): 12(ptr) Variable Function + 32(txval11): 31(ptr) Variable Function + 46(txval12): 45(ptr) Variable Function + 57(txval20): 12(ptr) Variable Function + 68(txval21): 31(ptr) Variable Function + 79(txval22): 45(ptr) Variable Function + 91(txval40): 12(ptr) Variable Function + 101(txval41): 31(ptr) Variable Function + 111(txval42): 45(ptr) Variable Function + 125(psout): 124(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 28: 7(fvec4) ImageSampleImplicitLod 23 27 + Store 13(txval10) 28 + 36: 33 Load 35(g_tTex1di4) + 37: 18 Load 20(g_sSamp) + 39: 38 SampledImage 36 37 + 42: 30(ivec4) ImageSampleImplicitLod 39 41 + Store 32(txval11) 42 + 50: 47 Load 49(g_tTex1du4) + 51: 18 Load 20(g_sSamp) + 53: 52 SampledImage 50 51 + 56: 44(ivec4) ImageSampleImplicitLod 53 55 + Store 46(txval12) 56 + 61: 58 Load 60(g_tTex2df4) + 62: 18 Load 20(g_sSamp) + 64: 63 SampledImage 61 62 + 67: 7(fvec4) ImageSampleImplicitLod 64 66 + Store 57(txval20) 67 + 72: 69 Load 71(g_tTex2di4) + 73: 18 Load 20(g_sSamp) + 75: 74 SampledImage 72 73 + 78: 30(ivec4) ImageSampleImplicitLod 75 77 + Store 68(txval21) 78 + 83: 80 Load 82(g_tTex2du4) + 84: 18 Load 20(g_sSamp) + 86: 85 SampledImage 83 84 + 90: 44(ivec4) ImageSampleImplicitLod 86 89 + Store 79(txval22) 90 + 95: 92 Load 94(g_tTexcdf4) + 96: 18 Load 20(g_sSamp) + 98: 97 SampledImage 95 96 + 100: 7(fvec4) ImageSampleImplicitLod 98 99 + Store 91(txval40) 100 + 105: 102 Load 104(g_tTexcdi4) + 106: 18 Load 20(g_sSamp) + 108: 107 SampledImage 105 106 + 110: 30(ivec4) ImageSampleImplicitLod 108 109 + Store 101(txval41) 110 + 115: 112 Load 114(g_tTexcdu4) + 116: 18 Load 20(g_sSamp) + 118: 117 SampledImage 115 116 + 123: 44(ivec4) ImageSampleImplicitLod 118 122 + Store 111(txval42) 123 + 128: 12(ptr) AccessChain 125(psout) 126 + Store 128 127 + 131: 130(ptr) AccessChain 125(psout) 129 + Store 131 121 + 132:8(PS_OUTPUT) Load 125(psout) + ReturnValue 132 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.sample.basic.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.sample.basic.dx10.frag.out new file mode 100644 index 00000000..b6915b6a --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.sample.basic.dx10.frag.out @@ -0,0 +1,862 @@ +hlsl.sample.basic.dx10.frag +WARNING: 0:4: 'immediate sampler state' : unimplemented + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:53 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:53 Function Parameters: +0:? Sequence +0:57 move second child to first child ( temp int) +0:57 CalculateLevelOfDetail: direct index for structure ( temp int) +0:57 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 1 (const int) +0:58 move second child to first child ( temp int) +0:58 CalculateLevelOfDetailUnclamped: direct index for structure ( temp int) +0:58 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:58 Constant: +0:58 2 (const int) +0:58 Constant: +0:58 1 (const int) +0:59 move second child to first child ( temp int) +0:59 Gather: direct index for structure ( temp int) +0:59 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:59 Constant: +0:59 3 (const int) +0:59 Constant: +0:59 1 (const int) +0:60 move second child to first child ( temp int) +0:60 GetDimensions: direct index for structure ( temp int) +0:60 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:60 Constant: +0:60 4 (const int) +0:60 Constant: +0:60 1 (const int) +0:61 move second child to first child ( temp int) +0:61 GetSamplePosition: direct index for structure ( temp int) +0:61 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:61 Constant: +0:61 5 (const int) +0:61 Constant: +0:61 1 (const int) +0:62 move second child to first child ( temp int) +0:62 Load: direct index for structure ( temp int) +0:62 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:62 Constant: +0:62 6 (const int) +0:62 Constant: +0:62 1 (const int) +0:63 move second child to first child ( temp int) +0:63 Sample: direct index for structure ( temp int) +0:63 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:63 Constant: +0:63 0 (const int) +0:63 Constant: +0:63 1 (const int) +0:64 move second child to first child ( temp int) +0:64 SampleBias: direct index for structure ( temp int) +0:64 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:64 Constant: +0:64 7 (const int) +0:64 Constant: +0:64 1 (const int) +0:65 move second child to first child ( temp int) +0:65 SampleCmp: direct index for structure ( temp int) +0:65 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:65 Constant: +0:65 8 (const int) +0:65 Constant: +0:65 1 (const int) +0:66 move second child to first child ( temp int) +0:66 SampleCmpLevelZero: direct index for structure ( temp int) +0:66 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:66 Constant: +0:66 9 (const int) +0:66 Constant: +0:66 1 (const int) +0:67 move second child to first child ( temp int) +0:67 SampleGrad: direct index for structure ( temp int) +0:67 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:67 Constant: +0:67 10 (const int) +0:67 Constant: +0:67 1 (const int) +0:68 move second child to first child ( temp int) +0:68 SampleLevel: direct index for structure ( temp int) +0:68 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:68 Constant: +0:68 11 (const int) +0:68 Constant: +0:68 1 (const int) +0:70 Sequence +0:70 move second child to first child ( temp 4-component vector of float) +0:70 'txval10' ( temp 4-component vector of float) +0:70 texture ( temp 4-component vector of float) +0:70 Construct combined texture-sampler ( temp sampler1D) +0:70 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:70 'g_sSamp' (layout( binding=0) uniform sampler) +0:70 Constant: +0:70 0.100000 +0:71 Sequence +0:71 move second child to first child ( temp 4-component vector of int) +0:71 'txval11' ( temp 4-component vector of int) +0:71 texture ( temp 4-component vector of int) +0:71 Construct combined texture-sampler ( temp isampler1D) +0:71 'g_tTex1di4' ( uniform itexture1D) +0:71 'g_sSamp' (layout( binding=0) uniform sampler) +0:71 Constant: +0:71 0.200000 +0:72 Sequence +0:72 move second child to first child ( temp 4-component vector of uint) +0:72 'txval12' ( temp 4-component vector of uint) +0:72 texture ( temp 4-component vector of uint) +0:72 Construct combined texture-sampler ( temp usampler1D) +0:72 'g_tTex1du4' ( uniform utexture1D) +0:72 'g_sSamp' (layout( binding=0) uniform sampler) +0:72 Constant: +0:72 0.300000 +0:74 Sequence +0:74 move second child to first child ( temp 4-component vector of float) +0:74 'txval20' ( temp 4-component vector of float) +0:74 texture ( temp 4-component vector of float) +0:74 Construct combined texture-sampler ( temp sampler2D) +0:74 'g_tTex2df4' ( uniform texture2D) +0:74 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:75 Sequence +0:75 move second child to first child ( temp 4-component vector of int) +0:75 'txval21' ( temp 4-component vector of int) +0:75 texture ( temp 4-component vector of int) +0:75 Construct combined texture-sampler ( temp isampler2D) +0:75 'g_tTex2di4' ( uniform itexture2D) +0:75 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:76 Sequence +0:76 move second child to first child ( temp 4-component vector of uint) +0:76 'txval22' ( temp 4-component vector of uint) +0:76 texture ( temp 4-component vector of uint) +0:76 Construct combined texture-sampler ( temp usampler2D) +0:76 'g_tTex2du4' ( uniform utexture2D) +0:76 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:78 Sequence +0:78 move second child to first child ( temp 4-component vector of float) +0:78 'txval30' ( temp 4-component vector of float) +0:78 texture ( temp 4-component vector of float) +0:78 Construct combined texture-sampler ( temp sampler3D) +0:78 'g_tTex3df4' ( uniform texture3D) +0:78 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:79 Sequence +0:79 move second child to first child ( temp 4-component vector of int) +0:79 'txval31' ( temp 4-component vector of int) +0:79 texture ( temp 4-component vector of int) +0:79 Construct combined texture-sampler ( temp isampler3D) +0:79 'g_tTex3di4' ( uniform itexture3D) +0:79 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:80 Sequence +0:80 move second child to first child ( temp 4-component vector of uint) +0:80 'txval32' ( temp 4-component vector of uint) +0:80 texture ( temp 4-component vector of uint) +0:80 Construct combined texture-sampler ( temp usampler3D) +0:80 'g_tTex3du4' ( uniform utexture3D) +0:80 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:82 Sequence +0:82 move second child to first child ( temp 4-component vector of float) +0:82 'txval40' ( temp 4-component vector of float) +0:82 texture ( temp 4-component vector of float) +0:82 Construct combined texture-sampler ( temp samplerCube) +0:82 'g_tTexcdf4' ( uniform textureCube) +0:82 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:83 Sequence +0:83 move second child to first child ( temp 4-component vector of int) +0:83 'txval41' ( temp 4-component vector of int) +0:83 texture ( temp 4-component vector of int) +0:83 Construct combined texture-sampler ( temp isamplerCube) +0:83 'g_tTexcdi4' ( uniform itextureCube) +0:83 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:84 Sequence +0:84 move second child to first child ( temp 4-component vector of uint) +0:84 'txval42' ( temp 4-component vector of uint) +0:84 texture ( temp 4-component vector of uint) +0:84 Construct combined texture-sampler ( temp usamplerCube) +0:84 'g_tTexcdu4' ( uniform utextureCube) +0:84 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:86 move second child to first child ( temp 4-component vector of float) +0:86 Color: direct index for structure ( temp 4-component vector of float) +0:86 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1.000000 +0:86 1.000000 +0:86 1.000000 +0:86 1.000000 +0:87 move second child to first child ( temp float) +0:87 Depth: direct index for structure ( temp float) +0:87 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 1.000000 +0:89 Branch: Return with expression +0:89 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:53 Function Definition: main( ( temp void) +0:53 Function Parameters: +0:? Sequence +0:53 Sequence +0:53 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:53 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:53 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:53 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:53 Color: direct index for structure ( temp 4-component vector of float) +0:53 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:53 Constant: +0:53 0 (const int) +0:53 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:53 Depth: direct index for structure ( temp float) +0:53 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:53 Constant: +0:53 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_sSamp2d' ( uniform sampler) +0:? 'g_sSamp2D_b' ( uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:53 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:53 Function Parameters: +0:? Sequence +0:57 move second child to first child ( temp int) +0:57 CalculateLevelOfDetail: direct index for structure ( temp int) +0:57 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 1 (const int) +0:58 move second child to first child ( temp int) +0:58 CalculateLevelOfDetailUnclamped: direct index for structure ( temp int) +0:58 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:58 Constant: +0:58 2 (const int) +0:58 Constant: +0:58 1 (const int) +0:59 move second child to first child ( temp int) +0:59 Gather: direct index for structure ( temp int) +0:59 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:59 Constant: +0:59 3 (const int) +0:59 Constant: +0:59 1 (const int) +0:60 move second child to first child ( temp int) +0:60 GetDimensions: direct index for structure ( temp int) +0:60 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:60 Constant: +0:60 4 (const int) +0:60 Constant: +0:60 1 (const int) +0:61 move second child to first child ( temp int) +0:61 GetSamplePosition: direct index for structure ( temp int) +0:61 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:61 Constant: +0:61 5 (const int) +0:61 Constant: +0:61 1 (const int) +0:62 move second child to first child ( temp int) +0:62 Load: direct index for structure ( temp int) +0:62 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:62 Constant: +0:62 6 (const int) +0:62 Constant: +0:62 1 (const int) +0:63 move second child to first child ( temp int) +0:63 Sample: direct index for structure ( temp int) +0:63 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:63 Constant: +0:63 0 (const int) +0:63 Constant: +0:63 1 (const int) +0:64 move second child to first child ( temp int) +0:64 SampleBias: direct index for structure ( temp int) +0:64 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:64 Constant: +0:64 7 (const int) +0:64 Constant: +0:64 1 (const int) +0:65 move second child to first child ( temp int) +0:65 SampleCmp: direct index for structure ( temp int) +0:65 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:65 Constant: +0:65 8 (const int) +0:65 Constant: +0:65 1 (const int) +0:66 move second child to first child ( temp int) +0:66 SampleCmpLevelZero: direct index for structure ( temp int) +0:66 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:66 Constant: +0:66 9 (const int) +0:66 Constant: +0:66 1 (const int) +0:67 move second child to first child ( temp int) +0:67 SampleGrad: direct index for structure ( temp int) +0:67 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:67 Constant: +0:67 10 (const int) +0:67 Constant: +0:67 1 (const int) +0:68 move second child to first child ( temp int) +0:68 SampleLevel: direct index for structure ( temp int) +0:68 'mtest' ( temp structure{ temp int Sample, temp int CalculateLevelOfDetail, temp int CalculateLevelOfDetailUnclamped, temp int Gather, temp int GetDimensions, temp int GetSamplePosition, temp int Load, temp int SampleBias, temp int SampleCmp, temp int SampleCmpLevelZero, temp int SampleGrad, temp int SampleLevel}) +0:68 Constant: +0:68 11 (const int) +0:68 Constant: +0:68 1 (const int) +0:70 Sequence +0:70 move second child to first child ( temp 4-component vector of float) +0:70 'txval10' ( temp 4-component vector of float) +0:70 texture ( temp 4-component vector of float) +0:70 Construct combined texture-sampler ( temp sampler1D) +0:70 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:70 'g_sSamp' (layout( binding=0) uniform sampler) +0:70 Constant: +0:70 0.100000 +0:71 Sequence +0:71 move second child to first child ( temp 4-component vector of int) +0:71 'txval11' ( temp 4-component vector of int) +0:71 texture ( temp 4-component vector of int) +0:71 Construct combined texture-sampler ( temp isampler1D) +0:71 'g_tTex1di4' ( uniform itexture1D) +0:71 'g_sSamp' (layout( binding=0) uniform sampler) +0:71 Constant: +0:71 0.200000 +0:72 Sequence +0:72 move second child to first child ( temp 4-component vector of uint) +0:72 'txval12' ( temp 4-component vector of uint) +0:72 texture ( temp 4-component vector of uint) +0:72 Construct combined texture-sampler ( temp usampler1D) +0:72 'g_tTex1du4' ( uniform utexture1D) +0:72 'g_sSamp' (layout( binding=0) uniform sampler) +0:72 Constant: +0:72 0.300000 +0:74 Sequence +0:74 move second child to first child ( temp 4-component vector of float) +0:74 'txval20' ( temp 4-component vector of float) +0:74 texture ( temp 4-component vector of float) +0:74 Construct combined texture-sampler ( temp sampler2D) +0:74 'g_tTex2df4' ( uniform texture2D) +0:74 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:75 Sequence +0:75 move second child to first child ( temp 4-component vector of int) +0:75 'txval21' ( temp 4-component vector of int) +0:75 texture ( temp 4-component vector of int) +0:75 Construct combined texture-sampler ( temp isampler2D) +0:75 'g_tTex2di4' ( uniform itexture2D) +0:75 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:76 Sequence +0:76 move second child to first child ( temp 4-component vector of uint) +0:76 'txval22' ( temp 4-component vector of uint) +0:76 texture ( temp 4-component vector of uint) +0:76 Construct combined texture-sampler ( temp usampler2D) +0:76 'g_tTex2du4' ( uniform utexture2D) +0:76 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:78 Sequence +0:78 move second child to first child ( temp 4-component vector of float) +0:78 'txval30' ( temp 4-component vector of float) +0:78 texture ( temp 4-component vector of float) +0:78 Construct combined texture-sampler ( temp sampler3D) +0:78 'g_tTex3df4' ( uniform texture3D) +0:78 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:79 Sequence +0:79 move second child to first child ( temp 4-component vector of int) +0:79 'txval31' ( temp 4-component vector of int) +0:79 texture ( temp 4-component vector of int) +0:79 Construct combined texture-sampler ( temp isampler3D) +0:79 'g_tTex3di4' ( uniform itexture3D) +0:79 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:80 Sequence +0:80 move second child to first child ( temp 4-component vector of uint) +0:80 'txval32' ( temp 4-component vector of uint) +0:80 texture ( temp 4-component vector of uint) +0:80 Construct combined texture-sampler ( temp usampler3D) +0:80 'g_tTex3du4' ( uniform utexture3D) +0:80 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:82 Sequence +0:82 move second child to first child ( temp 4-component vector of float) +0:82 'txval40' ( temp 4-component vector of float) +0:82 texture ( temp 4-component vector of float) +0:82 Construct combined texture-sampler ( temp samplerCube) +0:82 'g_tTexcdf4' ( uniform textureCube) +0:82 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:83 Sequence +0:83 move second child to first child ( temp 4-component vector of int) +0:83 'txval41' ( temp 4-component vector of int) +0:83 texture ( temp 4-component vector of int) +0:83 Construct combined texture-sampler ( temp isamplerCube) +0:83 'g_tTexcdi4' ( uniform itextureCube) +0:83 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:84 Sequence +0:84 move second child to first child ( temp 4-component vector of uint) +0:84 'txval42' ( temp 4-component vector of uint) +0:84 texture ( temp 4-component vector of uint) +0:84 Construct combined texture-sampler ( temp usamplerCube) +0:84 'g_tTexcdu4' ( uniform utextureCube) +0:84 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:86 move second child to first child ( temp 4-component vector of float) +0:86 Color: direct index for structure ( temp 4-component vector of float) +0:86 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1.000000 +0:86 1.000000 +0:86 1.000000 +0:86 1.000000 +0:87 move second child to first child ( temp float) +0:87 Depth: direct index for structure ( temp float) +0:87 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 1.000000 +0:89 Branch: Return with expression +0:89 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:53 Function Definition: main( ( temp void) +0:53 Function Parameters: +0:? Sequence +0:53 Sequence +0:53 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:53 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:53 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:53 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:53 Color: direct index for structure ( temp 4-component vector of float) +0:53 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:53 Constant: +0:53 0 (const int) +0:53 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:53 Depth: direct index for structure ( temp float) +0:53 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:53 Constant: +0:53 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_sSamp2d' ( uniform sampler) +0:? 'g_sSamp2D_b' ( uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 198 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 188 192 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "MemberTest" + MemberName 13(MemberTest) 0 "Sample" + MemberName 13(MemberTest) 1 "CalculateLevelOfDetail" + MemberName 13(MemberTest) 2 "CalculateLevelOfDetailUnclamped" + MemberName 13(MemberTest) 3 "Gather" + MemberName 13(MemberTest) 4 "GetDimensions" + MemberName 13(MemberTest) 5 "GetSamplePosition" + MemberName 13(MemberTest) 6 "Load" + MemberName 13(MemberTest) 7 "SampleBias" + MemberName 13(MemberTest) 8 "SampleCmp" + MemberName 13(MemberTest) 9 "SampleCmpLevelZero" + MemberName 13(MemberTest) 10 "SampleGrad" + MemberName 13(MemberTest) 11 "SampleLevel" + Name 15 "mtest" + Name 42 "txval10" + Name 45 "g_tTex1df4" + Name 49 "g_sSamp" + Name 57 "txval11" + Name 60 "g_tTex1di4" + Name 70 "txval12" + Name 73 "g_tTex1du4" + Name 80 "txval20" + Name 83 "g_tTex2df4" + Name 91 "txval21" + Name 94 "g_tTex2di4" + Name 102 "txval22" + Name 105 "g_tTex2du4" + Name 114 "txval30" + Name 117 "g_tTex3df4" + Name 125 "txval31" + Name 128 "g_tTex3di4" + Name 135 "txval32" + Name 138 "g_tTex3du4" + Name 148 "txval40" + Name 151 "g_tTexcdf4" + Name 157 "txval41" + Name 160 "g_tTexcdi4" + Name 166 "txval42" + Name 169 "g_tTexcdu4" + Name 176 "psout" + Name 185 "flattenTemp" + Name 188 "@entryPointOutput.Color" + Name 192 "@entryPointOutput.Depth" + Name 195 "g_sSamp2d" + Name 196 "g_sSamp2D_b" + Name 197 "g_tTex1df4a" + Decorate 45(g_tTex1df4) DescriptorSet 0 + Decorate 45(g_tTex1df4) Binding 0 + Decorate 49(g_sSamp) DescriptorSet 0 + Decorate 49(g_sSamp) Binding 0 + Decorate 60(g_tTex1di4) DescriptorSet 0 + Decorate 73(g_tTex1du4) DescriptorSet 0 + Decorate 83(g_tTex2df4) DescriptorSet 0 + Decorate 94(g_tTex2di4) DescriptorSet 0 + Decorate 105(g_tTex2du4) DescriptorSet 0 + Decorate 117(g_tTex3df4) DescriptorSet 0 + Decorate 128(g_tTex3di4) DescriptorSet 0 + Decorate 138(g_tTex3du4) DescriptorSet 0 + Decorate 151(g_tTexcdf4) DescriptorSet 0 + Decorate 160(g_tTexcdi4) DescriptorSet 0 + Decorate 169(g_tTexcdu4) DescriptorSet 0 + Decorate 188(@entryPointOutput.Color) Location 0 + Decorate 192(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 195(g_sSamp2d) DescriptorSet 0 + Decorate 196(g_sSamp2D_b) DescriptorSet 0 + Decorate 197(g_tTex1df4a) DescriptorSet 0 + Decorate 197(g_tTex1df4a) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeInt 32 1 + 13(MemberTest): TypeStruct 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) + 14: TypePointer Function 13(MemberTest) + 16: 12(int) Constant 1 + 17: TypePointer Function 12(int) + 19: 12(int) Constant 2 + 21: 12(int) Constant 3 + 23: 12(int) Constant 4 + 25: 12(int) Constant 5 + 27: 12(int) Constant 6 + 29: 12(int) Constant 0 + 31: 12(int) Constant 7 + 33: 12(int) Constant 8 + 35: 12(int) Constant 9 + 37: 12(int) Constant 10 + 39: 12(int) Constant 11 + 41: TypePointer Function 7(fvec4) + 43: TypeImage 6(float) 1D sampled format:Unknown + 44: TypePointer UniformConstant 43 + 45(g_tTex1df4): 44(ptr) Variable UniformConstant + 47: TypeSampler + 48: TypePointer UniformConstant 47 + 49(g_sSamp): 48(ptr) Variable UniformConstant + 51: TypeSampledImage 43 + 53: 6(float) Constant 1036831949 + 55: TypeVector 12(int) 4 + 56: TypePointer Function 55(ivec4) + 58: TypeImage 12(int) 1D sampled format:Unknown + 59: TypePointer UniformConstant 58 + 60(g_tTex1di4): 59(ptr) Variable UniformConstant + 63: TypeSampledImage 58 + 65: 6(float) Constant 1045220557 + 67: TypeInt 32 0 + 68: TypeVector 67(int) 4 + 69: TypePointer Function 68(ivec4) + 71: TypeImage 67(int) 1D sampled format:Unknown + 72: TypePointer UniformConstant 71 + 73(g_tTex1du4): 72(ptr) Variable UniformConstant + 76: TypeSampledImage 71 + 78: 6(float) Constant 1050253722 + 81: TypeImage 6(float) 2D sampled format:Unknown + 82: TypePointer UniformConstant 81 + 83(g_tTex2df4): 82(ptr) Variable UniformConstant + 86: TypeSampledImage 81 + 88: TypeVector 6(float) 2 + 89: 88(fvec2) ConstantComposite 53 65 + 92: TypeImage 12(int) 2D sampled format:Unknown + 93: TypePointer UniformConstant 92 + 94(g_tTex2di4): 93(ptr) Variable UniformConstant + 97: TypeSampledImage 92 + 99: 6(float) Constant 1053609165 + 100: 88(fvec2) ConstantComposite 78 99 + 103: TypeImage 67(int) 2D sampled format:Unknown + 104: TypePointer UniformConstant 103 + 105(g_tTex2du4): 104(ptr) Variable UniformConstant + 108: TypeSampledImage 103 + 110: 6(float) Constant 1056964608 + 111: 6(float) Constant 1058642330 + 112: 88(fvec2) ConstantComposite 110 111 + 115: TypeImage 6(float) 3D sampled format:Unknown + 116: TypePointer UniformConstant 115 + 117(g_tTex3df4): 116(ptr) Variable UniformConstant + 120: TypeSampledImage 115 + 122: TypeVector 6(float) 3 + 123: 122(fvec3) ConstantComposite 53 65 78 + 126: TypeImage 12(int) 3D sampled format:Unknown + 127: TypePointer UniformConstant 126 + 128(g_tTex3di4): 127(ptr) Variable UniformConstant + 131: TypeSampledImage 126 + 133: 122(fvec3) ConstantComposite 99 110 111 + 136: TypeImage 67(int) 3D sampled format:Unknown + 137: TypePointer UniformConstant 136 + 138(g_tTex3du4): 137(ptr) Variable UniformConstant + 141: TypeSampledImage 136 + 143: 6(float) Constant 1060320051 + 144: 6(float) Constant 1061997773 + 145: 6(float) Constant 1063675494 + 146: 122(fvec3) ConstantComposite 143 144 145 + 149: TypeImage 6(float) Cube sampled format:Unknown + 150: TypePointer UniformConstant 149 + 151(g_tTexcdf4): 150(ptr) Variable UniformConstant + 154: TypeSampledImage 149 + 158: TypeImage 12(int) Cube sampled format:Unknown + 159: TypePointer UniformConstant 158 + 160(g_tTexcdi4): 159(ptr) Variable UniformConstant + 163: TypeSampledImage 158 + 167: TypeImage 67(int) Cube sampled format:Unknown + 168: TypePointer UniformConstant 167 + 169(g_tTexcdu4): 168(ptr) Variable UniformConstant + 172: TypeSampledImage 167 + 175: TypePointer Function 8(PS_OUTPUT) + 177: 6(float) Constant 1065353216 + 178: 7(fvec4) ConstantComposite 177 177 177 177 + 180: TypePointer Function 6(float) + 187: TypePointer Output 7(fvec4) +188(@entryPointOutput.Color): 187(ptr) Variable Output + 191: TypePointer Output 6(float) +192(@entryPointOutput.Depth): 191(ptr) Variable Output + 195(g_sSamp2d): 48(ptr) Variable UniformConstant +196(g_sSamp2D_b): 48(ptr) Variable UniformConstant +197(g_tTex1df4a): 44(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +185(flattenTemp): 175(ptr) Variable Function + 186:8(PS_OUTPUT) FunctionCall 10(@main() + Store 185(flattenTemp) 186 + 189: 41(ptr) AccessChain 185(flattenTemp) 29 + 190: 7(fvec4) Load 189 + Store 188(@entryPointOutput.Color) 190 + 193: 180(ptr) AccessChain 185(flattenTemp) 16 + 194: 6(float) Load 193 + Store 192(@entryPointOutput.Depth) 194 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 15(mtest): 14(ptr) Variable Function + 42(txval10): 41(ptr) Variable Function + 57(txval11): 56(ptr) Variable Function + 70(txval12): 69(ptr) Variable Function + 80(txval20): 41(ptr) Variable Function + 91(txval21): 56(ptr) Variable Function + 102(txval22): 69(ptr) Variable Function + 114(txval30): 41(ptr) Variable Function + 125(txval31): 56(ptr) Variable Function + 135(txval32): 69(ptr) Variable Function + 148(txval40): 41(ptr) Variable Function + 157(txval41): 56(ptr) Variable Function + 166(txval42): 69(ptr) Variable Function + 176(psout): 175(ptr) Variable Function + 18: 17(ptr) AccessChain 15(mtest) 16 + Store 18 16 + 20: 17(ptr) AccessChain 15(mtest) 19 + Store 20 16 + 22: 17(ptr) AccessChain 15(mtest) 21 + Store 22 16 + 24: 17(ptr) AccessChain 15(mtest) 23 + Store 24 16 + 26: 17(ptr) AccessChain 15(mtest) 25 + Store 26 16 + 28: 17(ptr) AccessChain 15(mtest) 27 + Store 28 16 + 30: 17(ptr) AccessChain 15(mtest) 29 + Store 30 16 + 32: 17(ptr) AccessChain 15(mtest) 31 + Store 32 16 + 34: 17(ptr) AccessChain 15(mtest) 33 + Store 34 16 + 36: 17(ptr) AccessChain 15(mtest) 35 + Store 36 16 + 38: 17(ptr) AccessChain 15(mtest) 37 + Store 38 16 + 40: 17(ptr) AccessChain 15(mtest) 39 + Store 40 16 + 46: 43 Load 45(g_tTex1df4) + 50: 47 Load 49(g_sSamp) + 52: 51 SampledImage 46 50 + 54: 7(fvec4) ImageSampleImplicitLod 52 53 + Store 42(txval10) 54 + 61: 58 Load 60(g_tTex1di4) + 62: 47 Load 49(g_sSamp) + 64: 63 SampledImage 61 62 + 66: 55(ivec4) ImageSampleImplicitLod 64 65 + Store 57(txval11) 66 + 74: 71 Load 73(g_tTex1du4) + 75: 47 Load 49(g_sSamp) + 77: 76 SampledImage 74 75 + 79: 68(ivec4) ImageSampleImplicitLod 77 78 + Store 70(txval12) 79 + 84: 81 Load 83(g_tTex2df4) + 85: 47 Load 49(g_sSamp) + 87: 86 SampledImage 84 85 + 90: 7(fvec4) ImageSampleImplicitLod 87 89 + Store 80(txval20) 90 + 95: 92 Load 94(g_tTex2di4) + 96: 47 Load 49(g_sSamp) + 98: 97 SampledImage 95 96 + 101: 55(ivec4) ImageSampleImplicitLod 98 100 + Store 91(txval21) 101 + 106: 103 Load 105(g_tTex2du4) + 107: 47 Load 49(g_sSamp) + 109: 108 SampledImage 106 107 + 113: 68(ivec4) ImageSampleImplicitLod 109 112 + Store 102(txval22) 113 + 118: 115 Load 117(g_tTex3df4) + 119: 47 Load 49(g_sSamp) + 121: 120 SampledImage 118 119 + 124: 7(fvec4) ImageSampleImplicitLod 121 123 + Store 114(txval30) 124 + 129: 126 Load 128(g_tTex3di4) + 130: 47 Load 49(g_sSamp) + 132: 131 SampledImage 129 130 + 134: 55(ivec4) ImageSampleImplicitLod 132 133 + Store 125(txval31) 134 + 139: 136 Load 138(g_tTex3du4) + 140: 47 Load 49(g_sSamp) + 142: 141 SampledImage 139 140 + 147: 68(ivec4) ImageSampleImplicitLod 142 146 + Store 135(txval32) 147 + 152: 149 Load 151(g_tTexcdf4) + 153: 47 Load 49(g_sSamp) + 155: 154 SampledImage 152 153 + 156: 7(fvec4) ImageSampleImplicitLod 155 123 + Store 148(txval40) 156 + 161: 158 Load 160(g_tTexcdi4) + 162: 47 Load 49(g_sSamp) + 164: 163 SampledImage 161 162 + 165: 55(ivec4) ImageSampleImplicitLod 164 133 + Store 157(txval41) 165 + 170: 167 Load 169(g_tTexcdu4) + 171: 47 Load 49(g_sSamp) + 173: 172 SampledImage 170 171 + 174: 68(ivec4) ImageSampleImplicitLod 173 146 + Store 166(txval42) 174 + 179: 41(ptr) AccessChain 176(psout) 29 + Store 179 178 + 181: 180(ptr) AccessChain 176(psout) 16 + Store 181 177 + 182:8(PS_OUTPUT) Load 176(psout) + ReturnValue 182 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.sample.offset.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.sample.offset.dx10.frag.out new file mode 100644 index 00000000..bd199a39 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.sample.offset.dx10.frag.out @@ -0,0 +1,603 @@ +hlsl.sample.offset.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Parameters: +0:? Sequence +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval10' ( temp 4-component vector of float) +0:31 textureOffset ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler1D) +0:31 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:31 Constant: +0:31 0.100000 +0:31 Constant: +0:31 1 (const int) +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval11' ( temp 4-component vector of int) +0:32 textureOffset ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler1D) +0:32 'g_tTex1di4' ( uniform itexture1D) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:32 Constant: +0:32 0.200000 +0:32 Constant: +0:32 1 (const int) +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval12' ( temp 4-component vector of uint) +0:33 textureOffset ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler1D) +0:33 'g_tTex1du4' ( uniform utexture1D) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:33 Constant: +0:33 0.300000 +0:33 Constant: +0:33 1 (const int) +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval20' ( temp 4-component vector of float) +0:35 textureOffset ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp sampler2D) +0:35 'g_tTex2df4' ( uniform texture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval21' ( temp 4-component vector of int) +0:36 textureOffset ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isampler2D) +0:36 'g_tTex2di4' ( uniform itexture2D) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval22' ( temp 4-component vector of uint) +0:37 textureOffset ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usampler2D) +0:37 'g_tTex2du4' ( uniform utexture2D) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 1 (const int) +0:? -1 (const int) +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 'txval30' ( temp 4-component vector of float) +0:39 textureOffset ( temp 4-component vector of float) +0:39 Construct combined texture-sampler ( temp sampler3D) +0:39 'g_tTex3df4' ( uniform texture3D) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:? 1 (const int) +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of int) +0:40 'txval31' ( temp 4-component vector of int) +0:40 textureOffset ( temp 4-component vector of int) +0:40 Construct combined texture-sampler ( temp isampler3D) +0:40 'g_tTex3di4' ( uniform itexture3D) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of uint) +0:41 'txval32' ( temp 4-component vector of uint) +0:41 textureOffset ( temp 4-component vector of uint) +0:41 Construct combined texture-sampler ( temp usampler3D) +0:41 'g_tTex3du4' ( uniform utexture3D) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:? -1 (const int) +0:45 move second child to first child ( temp 4-component vector of float) +0:45 Color: direct index for structure ( temp 4-component vector of float) +0:45 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 1.000000 +0:45 1.000000 +0:45 1.000000 +0:45 1.000000 +0:46 move second child to first child ( temp float) +0:46 Depth: direct index for structure ( temp float) +0:46 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 1.000000 +0:48 Branch: Return with expression +0:48 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:28 Color: direct index for structure ( temp 4-component vector of float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 0 (const int) +0:28 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:28 Depth: direct index for structure ( temp float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Parameters: +0:? Sequence +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval10' ( temp 4-component vector of float) +0:31 textureOffset ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler1D) +0:31 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:31 Constant: +0:31 0.100000 +0:31 Constant: +0:31 1 (const int) +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval11' ( temp 4-component vector of int) +0:32 textureOffset ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler1D) +0:32 'g_tTex1di4' ( uniform itexture1D) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:32 Constant: +0:32 0.200000 +0:32 Constant: +0:32 1 (const int) +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval12' ( temp 4-component vector of uint) +0:33 textureOffset ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler1D) +0:33 'g_tTex1du4' ( uniform utexture1D) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:33 Constant: +0:33 0.300000 +0:33 Constant: +0:33 1 (const int) +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval20' ( temp 4-component vector of float) +0:35 textureOffset ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp sampler2D) +0:35 'g_tTex2df4' ( uniform texture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval21' ( temp 4-component vector of int) +0:36 textureOffset ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isampler2D) +0:36 'g_tTex2di4' ( uniform itexture2D) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval22' ( temp 4-component vector of uint) +0:37 textureOffset ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usampler2D) +0:37 'g_tTex2du4' ( uniform utexture2D) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 1 (const int) +0:? -1 (const int) +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 'txval30' ( temp 4-component vector of float) +0:39 textureOffset ( temp 4-component vector of float) +0:39 Construct combined texture-sampler ( temp sampler3D) +0:39 'g_tTex3df4' ( uniform texture3D) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:? 1 (const int) +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of int) +0:40 'txval31' ( temp 4-component vector of int) +0:40 textureOffset ( temp 4-component vector of int) +0:40 Construct combined texture-sampler ( temp isampler3D) +0:40 'g_tTex3di4' ( uniform itexture3D) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of uint) +0:41 'txval32' ( temp 4-component vector of uint) +0:41 textureOffset ( temp 4-component vector of uint) +0:41 Construct combined texture-sampler ( temp usampler3D) +0:41 'g_tTex3du4' ( uniform utexture3D) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:? -1 (const int) +0:45 move second child to first child ( temp 4-component vector of float) +0:45 Color: direct index for structure ( temp 4-component vector of float) +0:45 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 1.000000 +0:45 1.000000 +0:45 1.000000 +0:45 1.000000 +0:46 move second child to first child ( temp float) +0:46 Depth: direct index for structure ( temp float) +0:46 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 1.000000 +0:48 Branch: Return with expression +0:48 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:28 Color: direct index for structure ( temp 4-component vector of float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 0 (const int) +0:28 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:28 Depth: direct index for structure ( temp float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 161 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 144 148 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval10" + Name 16 "g_tTex1df4" + Name 20 "g_sSamp" + Name 30 "txval11" + Name 33 "g_tTex1di4" + Name 43 "txval12" + Name 46 "g_tTex1du4" + Name 53 "txval20" + Name 56 "g_tTex2df4" + Name 67 "txval21" + Name 70 "g_tTex2di4" + Name 79 "txval22" + Name 82 "g_tTex2du4" + Name 93 "txval30" + Name 96 "g_tTex3df4" + Name 106 "txval31" + Name 109 "g_tTex3di4" + Name 117 "txval32" + Name 120 "g_tTex3du4" + Name 132 "psout" + Name 141 "flattenTemp" + Name 144 "@entryPointOutput.Color" + Name 148 "@entryPointOutput.Depth" + Name 151 "g_tTex1df4a" + Name 154 "g_tTexcdf4" + Name 157 "g_tTexcdi4" + Name 160 "g_tTexcdu4" + Decorate 16(g_tTex1df4) DescriptorSet 0 + Decorate 16(g_tTex1df4) Binding 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 33(g_tTex1di4) DescriptorSet 0 + Decorate 46(g_tTex1du4) DescriptorSet 0 + Decorate 56(g_tTex2df4) DescriptorSet 0 + Decorate 70(g_tTex2di4) DescriptorSet 0 + Decorate 82(g_tTex2du4) DescriptorSet 0 + Decorate 96(g_tTex3df4) DescriptorSet 0 + Decorate 109(g_tTex3di4) DescriptorSet 0 + Decorate 120(g_tTex3du4) DescriptorSet 0 + Decorate 144(@entryPointOutput.Color) Location 0 + Decorate 148(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 151(g_tTex1df4a) DescriptorSet 0 + Decorate 151(g_tTex1df4a) Binding 1 + Decorate 154(g_tTexcdf4) DescriptorSet 0 + Decorate 157(g_tTexcdi4) DescriptorSet 0 + Decorate 160(g_tTexcdu4) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 1D sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: 6(float) Constant 1036831949 + 25: TypeInt 32 1 + 26: 25(int) Constant 1 + 28: TypeVector 25(int) 4 + 29: TypePointer Function 28(ivec4) + 31: TypeImage 25(int) 1D sampled format:Unknown + 32: TypePointer UniformConstant 31 + 33(g_tTex1di4): 32(ptr) Variable UniformConstant + 36: TypeSampledImage 31 + 38: 6(float) Constant 1045220557 + 40: TypeInt 32 0 + 41: TypeVector 40(int) 4 + 42: TypePointer Function 41(ivec4) + 44: TypeImage 40(int) 1D sampled format:Unknown + 45: TypePointer UniformConstant 44 + 46(g_tTex1du4): 45(ptr) Variable UniformConstant + 49: TypeSampledImage 44 + 51: 6(float) Constant 1050253722 + 54: TypeImage 6(float) 2D sampled format:Unknown + 55: TypePointer UniformConstant 54 + 56(g_tTex2df4): 55(ptr) Variable UniformConstant + 59: TypeSampledImage 54 + 61: TypeVector 6(float) 2 + 62: 61(fvec2) ConstantComposite 24 38 + 63: TypeVector 25(int) 2 + 64: 25(int) Constant 0 + 65: 63(ivec2) ConstantComposite 26 64 + 68: TypeImage 25(int) 2D sampled format:Unknown + 69: TypePointer UniformConstant 68 + 70(g_tTex2di4): 69(ptr) Variable UniformConstant + 73: TypeSampledImage 68 + 75: 6(float) Constant 1053609165 + 76: 61(fvec2) ConstantComposite 51 75 + 77: 63(ivec2) ConstantComposite 26 26 + 80: TypeImage 40(int) 2D sampled format:Unknown + 81: TypePointer UniformConstant 80 + 82(g_tTex2du4): 81(ptr) Variable UniformConstant + 85: TypeSampledImage 80 + 87: 6(float) Constant 1056964608 + 88: 6(float) Constant 1058642330 + 89: 61(fvec2) ConstantComposite 87 88 + 90: 25(int) Constant 4294967295 + 91: 63(ivec2) ConstantComposite 26 90 + 94: TypeImage 6(float) 3D sampled format:Unknown + 95: TypePointer UniformConstant 94 + 96(g_tTex3df4): 95(ptr) Variable UniformConstant + 99: TypeSampledImage 94 + 101: TypeVector 6(float) 3 + 102: 101(fvec3) ConstantComposite 24 38 51 + 103: TypeVector 25(int) 3 + 104: 103(ivec3) ConstantComposite 26 64 26 + 107: TypeImage 25(int) 3D sampled format:Unknown + 108: TypePointer UniformConstant 107 + 109(g_tTex3di4): 108(ptr) Variable UniformConstant + 112: TypeSampledImage 107 + 114: 101(fvec3) ConstantComposite 75 87 88 + 115: 103(ivec3) ConstantComposite 26 26 26 + 118: TypeImage 40(int) 3D sampled format:Unknown + 119: TypePointer UniformConstant 118 + 120(g_tTex3du4): 119(ptr) Variable UniformConstant + 123: TypeSampledImage 118 + 125: 6(float) Constant 1060320051 + 126: 6(float) Constant 1061997773 + 127: 6(float) Constant 1063675494 + 128: 101(fvec3) ConstantComposite 125 126 127 + 129: 103(ivec3) ConstantComposite 26 64 90 + 131: TypePointer Function 8(PS_OUTPUT) + 133: 6(float) Constant 1065353216 + 134: 7(fvec4) ConstantComposite 133 133 133 133 + 136: TypePointer Function 6(float) + 143: TypePointer Output 7(fvec4) +144(@entryPointOutput.Color): 143(ptr) Variable Output + 147: TypePointer Output 6(float) +148(@entryPointOutput.Depth): 147(ptr) Variable Output +151(g_tTex1df4a): 15(ptr) Variable UniformConstant + 152: TypeImage 6(float) Cube sampled format:Unknown + 153: TypePointer UniformConstant 152 + 154(g_tTexcdf4): 153(ptr) Variable UniformConstant + 155: TypeImage 25(int) Cube sampled format:Unknown + 156: TypePointer UniformConstant 155 + 157(g_tTexcdi4): 156(ptr) Variable UniformConstant + 158: TypeImage 40(int) Cube sampled format:Unknown + 159: TypePointer UniformConstant 158 + 160(g_tTexcdu4): 159(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +141(flattenTemp): 131(ptr) Variable Function + 142:8(PS_OUTPUT) FunctionCall 10(@main() + Store 141(flattenTemp) 142 + 145: 12(ptr) AccessChain 141(flattenTemp) 64 + 146: 7(fvec4) Load 145 + Store 144(@entryPointOutput.Color) 146 + 149: 136(ptr) AccessChain 141(flattenTemp) 26 + 150: 6(float) Load 149 + Store 148(@entryPointOutput.Depth) 150 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval10): 12(ptr) Variable Function + 30(txval11): 29(ptr) Variable Function + 43(txval12): 42(ptr) Variable Function + 53(txval20): 12(ptr) Variable Function + 67(txval21): 29(ptr) Variable Function + 79(txval22): 42(ptr) Variable Function + 93(txval30): 12(ptr) Variable Function + 106(txval31): 29(ptr) Variable Function + 117(txval32): 42(ptr) Variable Function + 132(psout): 131(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 27: 7(fvec4) ImageSampleImplicitLod 23 24 ConstOffset 26 + Store 13(txval10) 27 + 34: 31 Load 33(g_tTex1di4) + 35: 18 Load 20(g_sSamp) + 37: 36 SampledImage 34 35 + 39: 28(ivec4) ImageSampleImplicitLod 37 38 ConstOffset 26 + Store 30(txval11) 39 + 47: 44 Load 46(g_tTex1du4) + 48: 18 Load 20(g_sSamp) + 50: 49 SampledImage 47 48 + 52: 41(ivec4) ImageSampleImplicitLod 50 51 ConstOffset 26 + Store 43(txval12) 52 + 57: 54 Load 56(g_tTex2df4) + 58: 18 Load 20(g_sSamp) + 60: 59 SampledImage 57 58 + 66: 7(fvec4) ImageSampleImplicitLod 60 62 ConstOffset 65 + Store 53(txval20) 66 + 71: 68 Load 70(g_tTex2di4) + 72: 18 Load 20(g_sSamp) + 74: 73 SampledImage 71 72 + 78: 28(ivec4) ImageSampleImplicitLod 74 76 ConstOffset 77 + Store 67(txval21) 78 + 83: 80 Load 82(g_tTex2du4) + 84: 18 Load 20(g_sSamp) + 86: 85 SampledImage 83 84 + 92: 41(ivec4) ImageSampleImplicitLod 86 89 ConstOffset 91 + Store 79(txval22) 92 + 97: 94 Load 96(g_tTex3df4) + 98: 18 Load 20(g_sSamp) + 100: 99 SampledImage 97 98 + 105: 7(fvec4) ImageSampleImplicitLod 100 102 ConstOffset 104 + Store 93(txval30) 105 + 110: 107 Load 109(g_tTex3di4) + 111: 18 Load 20(g_sSamp) + 113: 112 SampledImage 110 111 + 116: 28(ivec4) ImageSampleImplicitLod 113 114 ConstOffset 115 + Store 106(txval31) 116 + 121: 118 Load 120(g_tTex3du4) + 122: 18 Load 20(g_sSamp) + 124: 123 SampledImage 121 122 + 130: 41(ivec4) ImageSampleImplicitLod 124 128 ConstOffset 129 + Store 117(txval32) 130 + 135: 12(ptr) AccessChain 132(psout) 64 + Store 135 134 + 137: 136(ptr) AccessChain 132(psout) 26 + Store 137 133 + 138:8(PS_OUTPUT) Load 132(psout) + ReturnValue 138 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.sample.offsetarray.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.sample.offsetarray.dx10.frag.out new file mode 100644 index 00000000..065cef05 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.sample.offsetarray.dx10.frag.out @@ -0,0 +1,452 @@ +hlsl.sample.offsetarray.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:20 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Parameters: +0:? Sequence +0:23 Sequence +0:23 move second child to first child ( temp 4-component vector of float) +0:23 'txval10' ( temp 4-component vector of float) +0:23 textureOffset ( temp 4-component vector of float) +0:23 Construct combined texture-sampler ( temp sampler1DArray) +0:23 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:23 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:23 Constant: +0:23 0 (const int) +0:24 Sequence +0:24 move second child to first child ( temp 4-component vector of int) +0:24 'txval11' ( temp 4-component vector of int) +0:24 textureOffset ( temp 4-component vector of int) +0:24 Construct combined texture-sampler ( temp isampler1DArray) +0:24 'g_tTex1di4' ( uniform itexture1DArray) +0:24 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:24 Constant: +0:24 1 (const int) +0:25 Sequence +0:25 move second child to first child ( temp 4-component vector of uint) +0:25 'txval12' ( temp 4-component vector of uint) +0:25 textureOffset ( temp 4-component vector of uint) +0:25 Construct combined texture-sampler ( temp usampler1DArray) +0:25 'g_tTex1du4' ( uniform utexture1DArray) +0:25 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:25 Constant: +0:25 2 (const int) +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'txval20' ( temp 4-component vector of float) +0:27 textureOffset ( temp 4-component vector of float) +0:27 Construct combined texture-sampler ( temp sampler2DArray) +0:27 'g_tTex2df4' ( uniform texture2DArray) +0:27 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 0 (const int) +0:? 0 (const int) +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of int) +0:28 'txval21' ( temp 4-component vector of int) +0:28 textureOffset ( temp 4-component vector of int) +0:28 Construct combined texture-sampler ( temp isampler2DArray) +0:28 'g_tTex2di4' ( uniform itexture2DArray) +0:28 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? 0.500000 +0:? Constant: +0:? 0 (const int) +0:? 0 (const int) +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of uint) +0:29 'txval22' ( temp 4-component vector of uint) +0:29 textureOffset ( temp 4-component vector of uint) +0:29 Construct combined texture-sampler ( temp usampler2DArray) +0:29 'g_tTex2du4' ( uniform utexture2DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:? Constant: +0:? 0 (const int) +0:? 1 (const int) +0:33 move second child to first child ( temp 4-component vector of float) +0:33 Color: direct index for structure ( temp 4-component vector of float) +0:33 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 1.000000 +0:33 1.000000 +0:33 1.000000 +0:33 1.000000 +0:34 move second child to first child ( temp float) +0:34 Depth: direct index for structure ( temp float) +0:34 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 Constant: +0:34 1 (const int) +0:34 Constant: +0:34 1.000000 +0:36 Branch: Return with expression +0:36 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 Sequence +0:20 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:20 Color: direct index for structure ( temp 4-component vector of float) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Constant: +0:20 0 (const int) +0:20 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:20 Depth: direct index for structure ( temp float) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Constant: +0:20 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4' ( uniform itexture1DArray) +0:? 'g_tTex1du4' ( uniform utexture1DArray) +0:? 'g_tTex2df4' ( uniform texture2DArray) +0:? 'g_tTex2di4' ( uniform itexture2DArray) +0:? 'g_tTex2du4' ( uniform utexture2DArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:20 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Parameters: +0:? Sequence +0:23 Sequence +0:23 move second child to first child ( temp 4-component vector of float) +0:23 'txval10' ( temp 4-component vector of float) +0:23 textureOffset ( temp 4-component vector of float) +0:23 Construct combined texture-sampler ( temp sampler1DArray) +0:23 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:23 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:23 Constant: +0:23 0 (const int) +0:24 Sequence +0:24 move second child to first child ( temp 4-component vector of int) +0:24 'txval11' ( temp 4-component vector of int) +0:24 textureOffset ( temp 4-component vector of int) +0:24 Construct combined texture-sampler ( temp isampler1DArray) +0:24 'g_tTex1di4' ( uniform itexture1DArray) +0:24 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:24 Constant: +0:24 1 (const int) +0:25 Sequence +0:25 move second child to first child ( temp 4-component vector of uint) +0:25 'txval12' ( temp 4-component vector of uint) +0:25 textureOffset ( temp 4-component vector of uint) +0:25 Construct combined texture-sampler ( temp usampler1DArray) +0:25 'g_tTex1du4' ( uniform utexture1DArray) +0:25 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:25 Constant: +0:25 2 (const int) +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'txval20' ( temp 4-component vector of float) +0:27 textureOffset ( temp 4-component vector of float) +0:27 Construct combined texture-sampler ( temp sampler2DArray) +0:27 'g_tTex2df4' ( uniform texture2DArray) +0:27 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 0 (const int) +0:? 0 (const int) +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of int) +0:28 'txval21' ( temp 4-component vector of int) +0:28 textureOffset ( temp 4-component vector of int) +0:28 Construct combined texture-sampler ( temp isampler2DArray) +0:28 'g_tTex2di4' ( uniform itexture2DArray) +0:28 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? 0.500000 +0:? Constant: +0:? 0 (const int) +0:? 0 (const int) +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of uint) +0:29 'txval22' ( temp 4-component vector of uint) +0:29 textureOffset ( temp 4-component vector of uint) +0:29 Construct combined texture-sampler ( temp usampler2DArray) +0:29 'g_tTex2du4' ( uniform utexture2DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:? Constant: +0:? 0 (const int) +0:? 1 (const int) +0:33 move second child to first child ( temp 4-component vector of float) +0:33 Color: direct index for structure ( temp 4-component vector of float) +0:33 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 1.000000 +0:33 1.000000 +0:33 1.000000 +0:33 1.000000 +0:34 move second child to first child ( temp float) +0:34 Depth: direct index for structure ( temp float) +0:34 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 Constant: +0:34 1 (const int) +0:34 Constant: +0:34 1.000000 +0:36 Branch: Return with expression +0:36 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 Sequence +0:20 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:20 Color: direct index for structure ( temp 4-component vector of float) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Constant: +0:20 0 (const int) +0:20 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:20 Depth: direct index for structure ( temp float) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Constant: +0:20 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4' ( uniform itexture1DArray) +0:? 'g_tTex1du4' ( uniform utexture1DArray) +0:? 'g_tTex2df4' ( uniform texture2DArray) +0:? 'g_tTex2di4' ( uniform itexture2DArray) +0:? 'g_tTex2du4' ( uniform utexture2DArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 118 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 110 114 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval10" + Name 16 "g_tTex1df4" + Name 20 "g_sSamp" + Name 33 "txval11" + Name 36 "g_tTex1di4" + Name 48 "txval12" + Name 51 "g_tTex1du4" + Name 60 "txval20" + Name 63 "g_tTex2df4" + Name 73 "txval21" + Name 76 "g_tTex2di4" + Name 84 "txval22" + Name 87 "g_tTex2du4" + Name 98 "psout" + Name 107 "flattenTemp" + Name 110 "@entryPointOutput.Color" + Name 114 "@entryPointOutput.Depth" + Name 117 "g_tTex1df4a" + Decorate 16(g_tTex1df4) DescriptorSet 0 + Decorate 16(g_tTex1df4) Binding 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 36(g_tTex1di4) DescriptorSet 0 + Decorate 51(g_tTex1du4) DescriptorSet 0 + Decorate 63(g_tTex2df4) DescriptorSet 0 + Decorate 76(g_tTex2di4) DescriptorSet 0 + Decorate 87(g_tTex2du4) DescriptorSet 0 + Decorate 110(@entryPointOutput.Color) Location 0 + Decorate 114(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 117(g_tTex1df4a) DescriptorSet 0 + Decorate 117(g_tTex1df4a) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 1D array sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 2 + 25: 6(float) Constant 1036831949 + 26: 6(float) Constant 1045220557 + 27: 24(fvec2) ConstantComposite 25 26 + 28: TypeInt 32 1 + 29: 28(int) Constant 0 + 31: TypeVector 28(int) 4 + 32: TypePointer Function 31(ivec4) + 34: TypeImage 28(int) 1D array sampled format:Unknown + 35: TypePointer UniformConstant 34 + 36(g_tTex1di4): 35(ptr) Variable UniformConstant + 39: TypeSampledImage 34 + 41: 6(float) Constant 1050253722 + 42: 24(fvec2) ConstantComposite 26 41 + 43: 28(int) Constant 1 + 45: TypeInt 32 0 + 46: TypeVector 45(int) 4 + 47: TypePointer Function 46(ivec4) + 49: TypeImage 45(int) 1D array sampled format:Unknown + 50: TypePointer UniformConstant 49 + 51(g_tTex1du4): 50(ptr) Variable UniformConstant + 54: TypeSampledImage 49 + 56: 6(float) Constant 1053609165 + 57: 24(fvec2) ConstantComposite 41 56 + 58: 28(int) Constant 2 + 61: TypeImage 6(float) 2D array sampled format:Unknown + 62: TypePointer UniformConstant 61 + 63(g_tTex2df4): 62(ptr) Variable UniformConstant + 66: TypeSampledImage 61 + 68: TypeVector 6(float) 3 + 69: 68(fvec3) ConstantComposite 25 26 41 + 70: TypeVector 28(int) 2 + 71: 70(ivec2) ConstantComposite 29 29 + 74: TypeImage 28(int) 2D array sampled format:Unknown + 75: TypePointer UniformConstant 74 + 76(g_tTex2di4): 75(ptr) Variable UniformConstant + 79: TypeSampledImage 74 + 81: 6(float) Constant 1056964608 + 82: 68(fvec3) ConstantComposite 41 56 81 + 85: TypeImage 45(int) 2D array sampled format:Unknown + 86: TypePointer UniformConstant 85 + 87(g_tTex2du4): 86(ptr) Variable UniformConstant + 90: TypeSampledImage 85 + 92: 6(float) Constant 1058642330 + 93: 6(float) Constant 1060320051 + 94: 68(fvec3) ConstantComposite 81 92 93 + 95: 70(ivec2) ConstantComposite 29 43 + 97: TypePointer Function 8(PS_OUTPUT) + 99: 6(float) Constant 1065353216 + 100: 7(fvec4) ConstantComposite 99 99 99 99 + 102: TypePointer Function 6(float) + 109: TypePointer Output 7(fvec4) +110(@entryPointOutput.Color): 109(ptr) Variable Output + 113: TypePointer Output 6(float) +114(@entryPointOutput.Depth): 113(ptr) Variable Output +117(g_tTex1df4a): 15(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +107(flattenTemp): 97(ptr) Variable Function + 108:8(PS_OUTPUT) FunctionCall 10(@main() + Store 107(flattenTemp) 108 + 111: 12(ptr) AccessChain 107(flattenTemp) 29 + 112: 7(fvec4) Load 111 + Store 110(@entryPointOutput.Color) 112 + 115: 102(ptr) AccessChain 107(flattenTemp) 43 + 116: 6(float) Load 115 + Store 114(@entryPointOutput.Depth) 116 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval10): 12(ptr) Variable Function + 33(txval11): 32(ptr) Variable Function + 48(txval12): 47(ptr) Variable Function + 60(txval20): 12(ptr) Variable Function + 73(txval21): 32(ptr) Variable Function + 84(txval22): 47(ptr) Variable Function + 98(psout): 97(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 30: 7(fvec4) ImageSampleImplicitLod 23 27 ConstOffset 29 + Store 13(txval10) 30 + 37: 34 Load 36(g_tTex1di4) + 38: 18 Load 20(g_sSamp) + 40: 39 SampledImage 37 38 + 44: 31(ivec4) ImageSampleImplicitLod 40 42 ConstOffset 43 + Store 33(txval11) 44 + 52: 49 Load 51(g_tTex1du4) + 53: 18 Load 20(g_sSamp) + 55: 54 SampledImage 52 53 + 59: 46(ivec4) ImageSampleImplicitLod 55 57 ConstOffset 58 + Store 48(txval12) 59 + 64: 61 Load 63(g_tTex2df4) + 65: 18 Load 20(g_sSamp) + 67: 66 SampledImage 64 65 + 72: 7(fvec4) ImageSampleImplicitLod 67 69 ConstOffset 71 + Store 60(txval20) 72 + 77: 74 Load 76(g_tTex2di4) + 78: 18 Load 20(g_sSamp) + 80: 79 SampledImage 77 78 + 83: 31(ivec4) ImageSampleImplicitLod 80 82 ConstOffset 71 + Store 73(txval21) 83 + 88: 85 Load 87(g_tTex2du4) + 89: 18 Load 20(g_sSamp) + 91: 90 SampledImage 88 89 + 96: 46(ivec4) ImageSampleImplicitLod 91 94 ConstOffset 95 + Store 84(txval22) 96 + 101: 12(ptr) AccessChain 98(psout) 29 + Store 101 100 + 103: 102(ptr) AccessChain 98(psout) 43 + Store 103 99 + 104:8(PS_OUTPUT) Load 98(psout) + ReturnValue 104 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.sample.sub-vec4.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.sample.sub-vec4.dx10.frag.out new file mode 100644 index 00000000..f24415a9 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.sample.sub-vec4.dx10.frag.out @@ -0,0 +1,266 @@ +hlsl.sample.sub-vec4.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:14 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:14 Function Parameters: +0:? Sequence +0:17 Sequence +0:17 move second child to first child ( temp float) +0:17 'txval10' ( temp float) +0:17 Construct float ( temp float) +0:? texture ( temp 4-component vector of float) +0:17 Construct combined texture-sampler ( temp sampler1D) +0:17 'g_tTex1df1' ( uniform texture1D) +0:17 'g_sSamp' (layout( binding=0) uniform sampler) +0:17 Constant: +0:17 0.100000 +0:18 Sequence +0:18 move second child to first child ( temp 2-component vector of float) +0:18 'txval11' ( temp 2-component vector of float) +0:18 Construct vec2 ( temp 2-component vector of float) +0:? texture ( temp 4-component vector of float) +0:18 Construct combined texture-sampler ( temp sampler1D) +0:18 'g_tTex1df2' ( uniform texture1D) +0:18 'g_sSamp' (layout( binding=0) uniform sampler) +0:18 Constant: +0:18 0.200000 +0:19 Sequence +0:19 move second child to first child ( temp 3-component vector of float) +0:19 'txval12' ( temp 3-component vector of float) +0:19 Construct vec3 ( temp 3-component vector of float) +0:? texture ( temp 4-component vector of float) +0:19 Construct combined texture-sampler ( temp sampler1D) +0:19 'g_tTex1df3' ( uniform texture1D) +0:19 'g_sSamp' (layout( binding=0) uniform sampler) +0:19 Constant: +0:19 0.200000 +0:20 Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:20 'txval13' ( temp 4-component vector of float) +0:20 texture ( temp 4-component vector of float) +0:20 Construct combined texture-sampler ( temp sampler1D) +0:20 'g_tTex1df4' ( uniform texture1D) +0:20 'g_sSamp' (layout( binding=0) uniform sampler) +0:20 Constant: +0:20 0.200000 +0:22 move second child to first child ( temp 4-component vector of float) +0:22 Color: direct index for structure ( temp 4-component vector of float) +0:22 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1.000000 +0:22 1.000000 +0:22 1.000000 +0:22 1.000000 +0:23 Branch: Return with expression +0:23 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:14 Function Definition: main( ( temp void) +0:14 Function Parameters: +0:? Sequence +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:14 Color: direct index for structure ( temp 4-component vector of float) +0:14 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:14 Constant: +0:14 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df1' ( uniform texture1D) +0:? 'g_tTex1df2' ( uniform texture1D) +0:? 'g_tTex1df3' ( uniform texture1D) +0:? 'g_tTex1df4' ( uniform texture1D) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:14 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:14 Function Parameters: +0:? Sequence +0:17 Sequence +0:17 move second child to first child ( temp float) +0:17 'txval10' ( temp float) +0:17 Construct float ( temp float) +0:? texture ( temp 4-component vector of float) +0:17 Construct combined texture-sampler ( temp sampler1D) +0:17 'g_tTex1df1' ( uniform texture1D) +0:17 'g_sSamp' (layout( binding=0) uniform sampler) +0:17 Constant: +0:17 0.100000 +0:18 Sequence +0:18 move second child to first child ( temp 2-component vector of float) +0:18 'txval11' ( temp 2-component vector of float) +0:18 Construct vec2 ( temp 2-component vector of float) +0:? texture ( temp 4-component vector of float) +0:18 Construct combined texture-sampler ( temp sampler1D) +0:18 'g_tTex1df2' ( uniform texture1D) +0:18 'g_sSamp' (layout( binding=0) uniform sampler) +0:18 Constant: +0:18 0.200000 +0:19 Sequence +0:19 move second child to first child ( temp 3-component vector of float) +0:19 'txval12' ( temp 3-component vector of float) +0:19 Construct vec3 ( temp 3-component vector of float) +0:? texture ( temp 4-component vector of float) +0:19 Construct combined texture-sampler ( temp sampler1D) +0:19 'g_tTex1df3' ( uniform texture1D) +0:19 'g_sSamp' (layout( binding=0) uniform sampler) +0:19 Constant: +0:19 0.200000 +0:20 Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:20 'txval13' ( temp 4-component vector of float) +0:20 texture ( temp 4-component vector of float) +0:20 Construct combined texture-sampler ( temp sampler1D) +0:20 'g_tTex1df4' ( uniform texture1D) +0:20 'g_sSamp' (layout( binding=0) uniform sampler) +0:20 Constant: +0:20 0.200000 +0:22 move second child to first child ( temp 4-component vector of float) +0:22 Color: direct index for structure ( temp 4-component vector of float) +0:22 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1.000000 +0:22 1.000000 +0:22 1.000000 +0:22 1.000000 +0:23 Branch: Return with expression +0:23 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:14 Function Definition: main( ( temp void) +0:14 Function Parameters: +0:? Sequence +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:14 Color: direct index for structure ( temp 4-component vector of float) +0:14 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:14 Constant: +0:14 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df1' ( uniform texture1D) +0:? 'g_tTex1df2' ( uniform texture1D) +0:? 'g_tTex1df3' ( uniform texture1D) +0:? 'g_tTex1df4' ( uniform texture1D) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 72 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 69 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + Name 10 "@main(" + Name 13 "txval10" + Name 16 "g_tTex1df1" + Name 20 "g_sSamp" + Name 29 "txval11" + Name 30 "g_tTex1df2" + Name 41 "txval12" + Name 42 "g_tTex1df3" + Name 52 "txval13" + Name 53 "g_tTex1df4" + Name 59 "psout" + Name 69 "@entryPointOutput.Color" + Decorate 16(g_tTex1df1) DescriptorSet 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 30(g_tTex1df2) DescriptorSet 0 + Decorate 42(g_tTex1df3) DescriptorSet 0 + Decorate 53(g_tTex1df4) DescriptorSet 0 + Decorate 69(@entryPointOutput.Color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 6(float) + 14: TypeImage 6(float) 1D sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df1): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: 6(float) Constant 1036831949 + 27: TypeVector 6(float) 2 + 28: TypePointer Function 27(fvec2) + 30(g_tTex1df2): 15(ptr) Variable UniformConstant + 34: 6(float) Constant 1045220557 + 39: TypeVector 6(float) 3 + 40: TypePointer Function 39(fvec3) + 42(g_tTex1df3): 15(ptr) Variable UniformConstant + 51: TypePointer Function 7(fvec4) + 53(g_tTex1df4): 15(ptr) Variable UniformConstant + 58: TypePointer Function 8(PS_OUTPUT) + 60: TypeInt 32 1 + 61: 60(int) Constant 0 + 62: 6(float) Constant 1065353216 + 63: 7(fvec4) ConstantComposite 62 62 62 62 + 68: TypePointer Output 7(fvec4) +69(@entryPointOutput.Color): 68(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 70:8(PS_OUTPUT) FunctionCall 10(@main() + 71: 7(fvec4) CompositeExtract 70 0 + Store 69(@entryPointOutput.Color) 71 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval10): 12(ptr) Variable Function + 29(txval11): 28(ptr) Variable Function + 41(txval12): 40(ptr) Variable Function + 52(txval13): 51(ptr) Variable Function + 59(psout): 58(ptr) Variable Function + 17: 14 Load 16(g_tTex1df1) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 25: 7(fvec4) ImageSampleImplicitLod 23 24 + 26: 6(float) CompositeExtract 25 0 + Store 13(txval10) 26 + 31: 14 Load 30(g_tTex1df2) + 32: 18 Load 20(g_sSamp) + 33: 22 SampledImage 31 32 + 35: 7(fvec4) ImageSampleImplicitLod 33 34 + 36: 6(float) CompositeExtract 35 0 + 37: 6(float) CompositeExtract 35 1 + 38: 27(fvec2) CompositeConstruct 36 37 + Store 29(txval11) 38 + 43: 14 Load 42(g_tTex1df3) + 44: 18 Load 20(g_sSamp) + 45: 22 SampledImage 43 44 + 46: 7(fvec4) ImageSampleImplicitLod 45 34 + 47: 6(float) CompositeExtract 46 0 + 48: 6(float) CompositeExtract 46 1 + 49: 6(float) CompositeExtract 46 2 + 50: 39(fvec3) CompositeConstruct 47 48 49 + Store 41(txval12) 50 + 54: 14 Load 53(g_tTex1df4) + 55: 18 Load 20(g_sSamp) + 56: 22 SampledImage 54 55 + 57: 7(fvec4) ImageSampleImplicitLod 56 34 + Store 52(txval13) 57 + 64: 51(ptr) AccessChain 59(psout) 61 + Store 64 63 + 65:8(PS_OUTPUT) Load 59(psout) + ReturnValue 65 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplebias.array.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplebias.array.dx10.frag.out new file mode 100644 index 00000000..a6fc0a5a --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplebias.array.dx10.frag.out @@ -0,0 +1,577 @@ +hlsl.samplebias.array.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Parameters: +0:? Sequence +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'txval10' ( temp 4-component vector of float) +0:27 texture ( temp 4-component vector of float) +0:27 Construct combined texture-sampler ( temp sampler1DArray) +0:27 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:27 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:27 Constant: +0:27 0.500000 +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of int) +0:28 'txval11' ( temp 4-component vector of int) +0:28 texture ( temp 4-component vector of int) +0:28 Construct combined texture-sampler ( temp isampler1DArray) +0:28 'g_tTex1di4' ( uniform itexture1DArray) +0:28 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:28 Constant: +0:28 0.500000 +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of uint) +0:29 'txval12' ( temp 4-component vector of uint) +0:29 texture ( temp 4-component vector of uint) +0:29 Construct combined texture-sampler ( temp usampler1DArray) +0:29 'g_tTex1du4' ( uniform utexture1DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:29 Constant: +0:29 0.500000 +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval20' ( temp 4-component vector of float) +0:31 texture ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler2DArray) +0:31 'g_tTex2df4' ( uniform texture2DArray) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:31 Constant: +0:31 0.500000 +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval21' ( temp 4-component vector of int) +0:32 texture ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler2DArray) +0:32 'g_tTex2di4' ( uniform itexture2DArray) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? 0.500000 +0:32 Constant: +0:32 0.500000 +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval22' ( temp 4-component vector of uint) +0:33 texture ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler2DArray) +0:33 'g_tTex2du4' ( uniform utexture2DArray) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:33 Constant: +0:33 0.500000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval40' ( temp 4-component vector of float) +0:35 texture ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp samplerCubeArray) +0:35 'g_tTexcdf4' ( uniform textureCubeArray) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:35 Constant: +0:35 0.500000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval41' ( temp 4-component vector of int) +0:36 texture ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isamplerCubeArray) +0:36 'g_tTexcdi4' ( uniform itextureCubeArray) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:36 Constant: +0:36 0.500000 +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval42' ( temp 4-component vector of uint) +0:37 texture ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usamplerCubeArray) +0:37 'g_tTexcdu4' ( uniform utextureCubeArray) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:? 1.000000 +0:37 Constant: +0:37 0.500000 +0:39 move second child to first child ( temp 4-component vector of float) +0:39 Color: direct index for structure ( temp 4-component vector of float) +0:39 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:40 move second child to first child ( temp float) +0:40 Depth: direct index for structure ( temp float) +0:40 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 1.000000 +0:42 Branch: Return with expression +0:42 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:24 Color: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:24 Depth: direct index for structure ( temp float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4' ( uniform itexture1DArray) +0:? 'g_tTex1du4' ( uniform utexture1DArray) +0:? 'g_tTex2df4' ( uniform texture2DArray) +0:? 'g_tTex2di4' ( uniform itexture2DArray) +0:? 'g_tTex2du4' ( uniform utexture2DArray) +0:? 'g_tTexcdf4' ( uniform textureCubeArray) +0:? 'g_tTexcdi4' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Parameters: +0:? Sequence +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'txval10' ( temp 4-component vector of float) +0:27 texture ( temp 4-component vector of float) +0:27 Construct combined texture-sampler ( temp sampler1DArray) +0:27 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:27 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:27 Constant: +0:27 0.500000 +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of int) +0:28 'txval11' ( temp 4-component vector of int) +0:28 texture ( temp 4-component vector of int) +0:28 Construct combined texture-sampler ( temp isampler1DArray) +0:28 'g_tTex1di4' ( uniform itexture1DArray) +0:28 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:28 Constant: +0:28 0.500000 +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of uint) +0:29 'txval12' ( temp 4-component vector of uint) +0:29 texture ( temp 4-component vector of uint) +0:29 Construct combined texture-sampler ( temp usampler1DArray) +0:29 'g_tTex1du4' ( uniform utexture1DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:29 Constant: +0:29 0.500000 +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval20' ( temp 4-component vector of float) +0:31 texture ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler2DArray) +0:31 'g_tTex2df4' ( uniform texture2DArray) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:31 Constant: +0:31 0.500000 +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval21' ( temp 4-component vector of int) +0:32 texture ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler2DArray) +0:32 'g_tTex2di4' ( uniform itexture2DArray) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? 0.500000 +0:32 Constant: +0:32 0.500000 +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval22' ( temp 4-component vector of uint) +0:33 texture ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler2DArray) +0:33 'g_tTex2du4' ( uniform utexture2DArray) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:33 Constant: +0:33 0.500000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval40' ( temp 4-component vector of float) +0:35 texture ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp samplerCubeArray) +0:35 'g_tTexcdf4' ( uniform textureCubeArray) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:35 Constant: +0:35 0.500000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval41' ( temp 4-component vector of int) +0:36 texture ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isamplerCubeArray) +0:36 'g_tTexcdi4' ( uniform itextureCubeArray) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:36 Constant: +0:36 0.500000 +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval42' ( temp 4-component vector of uint) +0:37 texture ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usamplerCubeArray) +0:37 'g_tTexcdu4' ( uniform utextureCubeArray) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:? 1.000000 +0:37 Constant: +0:37 0.500000 +0:39 move second child to first child ( temp 4-component vector of float) +0:39 Color: direct index for structure ( temp 4-component vector of float) +0:39 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:40 move second child to first child ( temp float) +0:40 Depth: direct index for structure ( temp float) +0:40 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 1.000000 +0:42 Branch: Return with expression +0:42 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:24 Color: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:24 Depth: direct index for structure ( temp float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4' ( uniform itexture1DArray) +0:? 'g_tTex1du4' ( uniform utexture1DArray) +0:? 'g_tTex2df4' ( uniform texture2DArray) +0:? 'g_tTex2di4' ( uniform itexture2DArray) +0:? 'g_tTex2du4' ( uniform utexture2DArray) +0:? 'g_tTexcdf4' ( uniform textureCubeArray) +0:? 'g_tTexcdi4' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 146 + + Capability Shader + Capability Sampled1D + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 138 142 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval10" + Name 16 "g_tTex1df4" + Name 20 "g_sSamp" + Name 33 "txval11" + Name 36 "g_tTex1di4" + Name 47 "txval12" + Name 50 "g_tTex1du4" + Name 58 "txval20" + Name 61 "g_tTex2df4" + Name 69 "txval21" + Name 72 "g_tTex2di4" + Name 79 "txval22" + Name 82 "g_tTex2du4" + Name 91 "txval40" + Name 94 "g_tTexcdf4" + Name 101 "txval41" + Name 104 "g_tTexcdi4" + Name 111 "txval42" + Name 114 "g_tTexcdu4" + Name 125 "psout" + Name 135 "flattenTemp" + Name 138 "@entryPointOutput.Color" + Name 142 "@entryPointOutput.Depth" + Name 145 "g_tTex1df4a" + Decorate 16(g_tTex1df4) DescriptorSet 0 + Decorate 16(g_tTex1df4) Binding 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 36(g_tTex1di4) DescriptorSet 0 + Decorate 50(g_tTex1du4) DescriptorSet 0 + Decorate 61(g_tTex2df4) DescriptorSet 0 + Decorate 72(g_tTex2di4) DescriptorSet 0 + Decorate 82(g_tTex2du4) DescriptorSet 0 + Decorate 94(g_tTexcdf4) DescriptorSet 0 + Decorate 104(g_tTexcdi4) DescriptorSet 0 + Decorate 114(g_tTexcdu4) DescriptorSet 0 + Decorate 138(@entryPointOutput.Color) Location 0 + Decorate 142(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 145(g_tTex1df4a) DescriptorSet 0 + Decorate 145(g_tTex1df4a) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 1D array sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 2 + 25: 6(float) Constant 1036831949 + 26: 6(float) Constant 1045220557 + 27: 24(fvec2) ConstantComposite 25 26 + 28: 6(float) Constant 1056964608 + 30: TypeInt 32 1 + 31: TypeVector 30(int) 4 + 32: TypePointer Function 31(ivec4) + 34: TypeImage 30(int) 1D array sampled format:Unknown + 35: TypePointer UniformConstant 34 + 36(g_tTex1di4): 35(ptr) Variable UniformConstant + 39: TypeSampledImage 34 + 41: 6(float) Constant 1050253722 + 42: 24(fvec2) ConstantComposite 26 41 + 44: TypeInt 32 0 + 45: TypeVector 44(int) 4 + 46: TypePointer Function 45(ivec4) + 48: TypeImage 44(int) 1D array sampled format:Unknown + 49: TypePointer UniformConstant 48 + 50(g_tTex1du4): 49(ptr) Variable UniformConstant + 53: TypeSampledImage 48 + 55: 6(float) Constant 1053609165 + 56: 24(fvec2) ConstantComposite 41 55 + 59: TypeImage 6(float) 2D array sampled format:Unknown + 60: TypePointer UniformConstant 59 + 61(g_tTex2df4): 60(ptr) Variable UniformConstant + 64: TypeSampledImage 59 + 66: TypeVector 6(float) 3 + 67: 66(fvec3) ConstantComposite 25 26 41 + 70: TypeImage 30(int) 2D array sampled format:Unknown + 71: TypePointer UniformConstant 70 + 72(g_tTex2di4): 71(ptr) Variable UniformConstant + 75: TypeSampledImage 70 + 77: 66(fvec3) ConstantComposite 41 55 28 + 80: TypeImage 44(int) 2D array sampled format:Unknown + 81: TypePointer UniformConstant 80 + 82(g_tTex2du4): 81(ptr) Variable UniformConstant + 85: TypeSampledImage 80 + 87: 6(float) Constant 1058642330 + 88: 6(float) Constant 1060320051 + 89: 66(fvec3) ConstantComposite 28 87 88 + 92: TypeImage 6(float) Cube array sampled format:Unknown + 93: TypePointer UniformConstant 92 + 94(g_tTexcdf4): 93(ptr) Variable UniformConstant + 97: TypeSampledImage 92 + 99: 7(fvec4) ConstantComposite 25 26 41 55 + 102: TypeImage 30(int) Cube array sampled format:Unknown + 103: TypePointer UniformConstant 102 + 104(g_tTexcdi4): 103(ptr) Variable UniformConstant + 107: TypeSampledImage 102 + 109: 7(fvec4) ConstantComposite 55 28 87 88 + 112: TypeImage 44(int) Cube array sampled format:Unknown + 113: TypePointer UniformConstant 112 + 114(g_tTexcdu4): 113(ptr) Variable UniformConstant + 117: TypeSampledImage 112 + 119: 6(float) Constant 1061997773 + 120: 6(float) Constant 1063675494 + 121: 6(float) Constant 1065353216 + 122: 7(fvec4) ConstantComposite 88 119 120 121 + 124: TypePointer Function 8(PS_OUTPUT) + 126: 30(int) Constant 0 + 127: 7(fvec4) ConstantComposite 121 121 121 121 + 129: 30(int) Constant 1 + 130: TypePointer Function 6(float) + 137: TypePointer Output 7(fvec4) +138(@entryPointOutput.Color): 137(ptr) Variable Output + 141: TypePointer Output 6(float) +142(@entryPointOutput.Depth): 141(ptr) Variable Output +145(g_tTex1df4a): 15(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +135(flattenTemp): 124(ptr) Variable Function + 136:8(PS_OUTPUT) FunctionCall 10(@main() + Store 135(flattenTemp) 136 + 139: 12(ptr) AccessChain 135(flattenTemp) 126 + 140: 7(fvec4) Load 139 + Store 138(@entryPointOutput.Color) 140 + 143: 130(ptr) AccessChain 135(flattenTemp) 129 + 144: 6(float) Load 143 + Store 142(@entryPointOutput.Depth) 144 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval10): 12(ptr) Variable Function + 33(txval11): 32(ptr) Variable Function + 47(txval12): 46(ptr) Variable Function + 58(txval20): 12(ptr) Variable Function + 69(txval21): 32(ptr) Variable Function + 79(txval22): 46(ptr) Variable Function + 91(txval40): 12(ptr) Variable Function + 101(txval41): 32(ptr) Variable Function + 111(txval42): 46(ptr) Variable Function + 125(psout): 124(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 29: 7(fvec4) ImageSampleImplicitLod 23 27 Bias 28 + Store 13(txval10) 29 + 37: 34 Load 36(g_tTex1di4) + 38: 18 Load 20(g_sSamp) + 40: 39 SampledImage 37 38 + 43: 31(ivec4) ImageSampleImplicitLod 40 42 Bias 28 + Store 33(txval11) 43 + 51: 48 Load 50(g_tTex1du4) + 52: 18 Load 20(g_sSamp) + 54: 53 SampledImage 51 52 + 57: 45(ivec4) ImageSampleImplicitLod 54 56 Bias 28 + Store 47(txval12) 57 + 62: 59 Load 61(g_tTex2df4) + 63: 18 Load 20(g_sSamp) + 65: 64 SampledImage 62 63 + 68: 7(fvec4) ImageSampleImplicitLod 65 67 Bias 28 + Store 58(txval20) 68 + 73: 70 Load 72(g_tTex2di4) + 74: 18 Load 20(g_sSamp) + 76: 75 SampledImage 73 74 + 78: 31(ivec4) ImageSampleImplicitLod 76 77 Bias 28 + Store 69(txval21) 78 + 83: 80 Load 82(g_tTex2du4) + 84: 18 Load 20(g_sSamp) + 86: 85 SampledImage 83 84 + 90: 45(ivec4) ImageSampleImplicitLod 86 89 Bias 28 + Store 79(txval22) 90 + 95: 92 Load 94(g_tTexcdf4) + 96: 18 Load 20(g_sSamp) + 98: 97 SampledImage 95 96 + 100: 7(fvec4) ImageSampleImplicitLod 98 99 Bias 28 + Store 91(txval40) 100 + 105: 102 Load 104(g_tTexcdi4) + 106: 18 Load 20(g_sSamp) + 108: 107 SampledImage 105 106 + 110: 31(ivec4) ImageSampleImplicitLod 108 109 Bias 28 + Store 101(txval41) 110 + 115: 112 Load 114(g_tTexcdu4) + 116: 18 Load 20(g_sSamp) + 118: 117 SampledImage 115 116 + 123: 45(ivec4) ImageSampleImplicitLod 118 122 Bias 28 + Store 111(txval42) 123 + 128: 12(ptr) AccessChain 125(psout) 126 + Store 128 127 + 131: 130(ptr) AccessChain 125(psout) 129 + Store 131 121 + 132:8(PS_OUTPUT) Load 125(psout) + ReturnValue 132 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplebias.basic.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplebias.basic.dx10.frag.out new file mode 100644 index 00000000..21794f9f --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplebias.basic.dx10.frag.out @@ -0,0 +1,678 @@ +hlsl.samplebias.basic.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Parameters: +0:? Sequence +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval10' ( temp 4-component vector of float) +0:31 texture ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler1D) +0:31 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:31 Constant: +0:31 0.100000 +0:31 Constant: +0:31 0.500000 +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval11' ( temp 4-component vector of int) +0:32 texture ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler1D) +0:32 'g_tTex1di4' ( uniform itexture1D) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:32 Constant: +0:32 0.200000 +0:32 Constant: +0:32 0.500000 +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval12' ( temp 4-component vector of uint) +0:33 texture ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler1D) +0:33 'g_tTex1du4' ( uniform utexture1D) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:33 Constant: +0:33 0.300000 +0:33 Constant: +0:33 0.500000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval20' ( temp 4-component vector of float) +0:35 texture ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp sampler2D) +0:35 'g_tTex2df4' ( uniform texture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:35 Constant: +0:35 0.500000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval21' ( temp 4-component vector of int) +0:36 texture ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isampler2D) +0:36 'g_tTex2di4' ( uniform itexture2D) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:36 Constant: +0:36 0.500000 +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval22' ( temp 4-component vector of uint) +0:37 texture ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usampler2D) +0:37 'g_tTex2du4' ( uniform utexture2D) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:37 Constant: +0:37 0.500000 +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 'txval30' ( temp 4-component vector of float) +0:39 texture ( temp 4-component vector of float) +0:39 Construct combined texture-sampler ( temp sampler3D) +0:39 'g_tTex3df4' ( uniform texture3D) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:39 Constant: +0:39 0.500000 +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of int) +0:40 'txval31' ( temp 4-component vector of int) +0:40 texture ( temp 4-component vector of int) +0:40 Construct combined texture-sampler ( temp isampler3D) +0:40 'g_tTex3di4' ( uniform itexture3D) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:40 Constant: +0:40 0.500000 +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of uint) +0:41 'txval32' ( temp 4-component vector of uint) +0:41 texture ( temp 4-component vector of uint) +0:41 Construct combined texture-sampler ( temp usampler3D) +0:41 'g_tTex3du4' ( uniform utexture3D) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:41 Constant: +0:41 0.500000 +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of float) +0:43 'txval40' ( temp 4-component vector of float) +0:43 texture ( temp 4-component vector of float) +0:43 Construct combined texture-sampler ( temp samplerCube) +0:43 'g_tTexcdf4' ( uniform textureCube) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:43 Constant: +0:43 0.500000 +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of int) +0:44 'txval41' ( temp 4-component vector of int) +0:44 texture ( temp 4-component vector of int) +0:44 Construct combined texture-sampler ( temp isamplerCube) +0:44 'g_tTexcdi4' ( uniform itextureCube) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:44 Constant: +0:44 0.500000 +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of uint) +0:45 'txval42' ( temp 4-component vector of uint) +0:45 texture ( temp 4-component vector of uint) +0:45 Construct combined texture-sampler ( temp usamplerCube) +0:45 'g_tTexcdu4' ( uniform utextureCube) +0:45 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:45 Constant: +0:45 0.500000 +0:47 move second child to first child ( temp 4-component vector of float) +0:47 Color: direct index for structure ( temp 4-component vector of float) +0:47 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1.000000 +0:47 1.000000 +0:47 1.000000 +0:47 1.000000 +0:48 move second child to first child ( temp float) +0:48 Depth: direct index for structure ( temp float) +0:48 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 1 (const int) +0:48 Constant: +0:48 1.000000 +0:50 Branch: Return with expression +0:50 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:28 Color: direct index for structure ( temp 4-component vector of float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 0 (const int) +0:28 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:28 Depth: direct index for structure ( temp float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Parameters: +0:? Sequence +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval10' ( temp 4-component vector of float) +0:31 texture ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler1D) +0:31 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:31 Constant: +0:31 0.100000 +0:31 Constant: +0:31 0.500000 +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval11' ( temp 4-component vector of int) +0:32 texture ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler1D) +0:32 'g_tTex1di4' ( uniform itexture1D) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:32 Constant: +0:32 0.200000 +0:32 Constant: +0:32 0.500000 +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval12' ( temp 4-component vector of uint) +0:33 texture ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler1D) +0:33 'g_tTex1du4' ( uniform utexture1D) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:33 Constant: +0:33 0.300000 +0:33 Constant: +0:33 0.500000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval20' ( temp 4-component vector of float) +0:35 texture ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp sampler2D) +0:35 'g_tTex2df4' ( uniform texture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:35 Constant: +0:35 0.500000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval21' ( temp 4-component vector of int) +0:36 texture ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isampler2D) +0:36 'g_tTex2di4' ( uniform itexture2D) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:36 Constant: +0:36 0.500000 +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval22' ( temp 4-component vector of uint) +0:37 texture ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usampler2D) +0:37 'g_tTex2du4' ( uniform utexture2D) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:37 Constant: +0:37 0.500000 +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 'txval30' ( temp 4-component vector of float) +0:39 texture ( temp 4-component vector of float) +0:39 Construct combined texture-sampler ( temp sampler3D) +0:39 'g_tTex3df4' ( uniform texture3D) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:39 Constant: +0:39 0.500000 +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of int) +0:40 'txval31' ( temp 4-component vector of int) +0:40 texture ( temp 4-component vector of int) +0:40 Construct combined texture-sampler ( temp isampler3D) +0:40 'g_tTex3di4' ( uniform itexture3D) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:40 Constant: +0:40 0.500000 +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of uint) +0:41 'txval32' ( temp 4-component vector of uint) +0:41 texture ( temp 4-component vector of uint) +0:41 Construct combined texture-sampler ( temp usampler3D) +0:41 'g_tTex3du4' ( uniform utexture3D) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:41 Constant: +0:41 0.500000 +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of float) +0:43 'txval40' ( temp 4-component vector of float) +0:43 texture ( temp 4-component vector of float) +0:43 Construct combined texture-sampler ( temp samplerCube) +0:43 'g_tTexcdf4' ( uniform textureCube) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:43 Constant: +0:43 0.500000 +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of int) +0:44 'txval41' ( temp 4-component vector of int) +0:44 texture ( temp 4-component vector of int) +0:44 Construct combined texture-sampler ( temp isamplerCube) +0:44 'g_tTexcdi4' ( uniform itextureCube) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:44 Constant: +0:44 0.500000 +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of uint) +0:45 'txval42' ( temp 4-component vector of uint) +0:45 texture ( temp 4-component vector of uint) +0:45 Construct combined texture-sampler ( temp usamplerCube) +0:45 'g_tTexcdu4' ( uniform utextureCube) +0:45 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:45 Constant: +0:45 0.500000 +0:47 move second child to first child ( temp 4-component vector of float) +0:47 Color: direct index for structure ( temp 4-component vector of float) +0:47 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1.000000 +0:47 1.000000 +0:47 1.000000 +0:47 1.000000 +0:48 move second child to first child ( temp float) +0:48 Depth: direct index for structure ( temp float) +0:48 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 1 (const int) +0:48 Constant: +0:48 1.000000 +0:50 Branch: Return with expression +0:50 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:28 Color: direct index for structure ( temp 4-component vector of float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 0 (const int) +0:28 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:28 Depth: direct index for structure ( temp float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 170 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 162 166 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval10" + Name 16 "g_tTex1df4" + Name 20 "g_sSamp" + Name 30 "txval11" + Name 33 "g_tTex1di4" + Name 43 "txval12" + Name 46 "g_tTex1du4" + Name 53 "txval20" + Name 56 "g_tTex2df4" + Name 64 "txval21" + Name 67 "g_tTex2di4" + Name 75 "txval22" + Name 78 "g_tTex2du4" + Name 86 "txval30" + Name 89 "g_tTex3df4" + Name 97 "txval31" + Name 100 "g_tTex3di4" + Name 107 "txval32" + Name 110 "g_tTex3du4" + Name 120 "txval40" + Name 123 "g_tTexcdf4" + Name 129 "txval41" + Name 132 "g_tTexcdi4" + Name 138 "txval42" + Name 141 "g_tTexcdu4" + Name 148 "psout" + Name 159 "flattenTemp" + Name 162 "@entryPointOutput.Color" + Name 166 "@entryPointOutput.Depth" + Name 169 "g_tTex1df4a" + Decorate 16(g_tTex1df4) DescriptorSet 0 + Decorate 16(g_tTex1df4) Binding 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 33(g_tTex1di4) DescriptorSet 0 + Decorate 46(g_tTex1du4) DescriptorSet 0 + Decorate 56(g_tTex2df4) DescriptorSet 0 + Decorate 67(g_tTex2di4) DescriptorSet 0 + Decorate 78(g_tTex2du4) DescriptorSet 0 + Decorate 89(g_tTex3df4) DescriptorSet 0 + Decorate 100(g_tTex3di4) DescriptorSet 0 + Decorate 110(g_tTex3du4) DescriptorSet 0 + Decorate 123(g_tTexcdf4) DescriptorSet 0 + Decorate 132(g_tTexcdi4) DescriptorSet 0 + Decorate 141(g_tTexcdu4) DescriptorSet 0 + Decorate 162(@entryPointOutput.Color) Location 0 + Decorate 166(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 169(g_tTex1df4a) DescriptorSet 0 + Decorate 169(g_tTex1df4a) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 1D sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: 6(float) Constant 1036831949 + 25: 6(float) Constant 1056964608 + 27: TypeInt 32 1 + 28: TypeVector 27(int) 4 + 29: TypePointer Function 28(ivec4) + 31: TypeImage 27(int) 1D sampled format:Unknown + 32: TypePointer UniformConstant 31 + 33(g_tTex1di4): 32(ptr) Variable UniformConstant + 36: TypeSampledImage 31 + 38: 6(float) Constant 1045220557 + 40: TypeInt 32 0 + 41: TypeVector 40(int) 4 + 42: TypePointer Function 41(ivec4) + 44: TypeImage 40(int) 1D sampled format:Unknown + 45: TypePointer UniformConstant 44 + 46(g_tTex1du4): 45(ptr) Variable UniformConstant + 49: TypeSampledImage 44 + 51: 6(float) Constant 1050253722 + 54: TypeImage 6(float) 2D sampled format:Unknown + 55: TypePointer UniformConstant 54 + 56(g_tTex2df4): 55(ptr) Variable UniformConstant + 59: TypeSampledImage 54 + 61: TypeVector 6(float) 2 + 62: 61(fvec2) ConstantComposite 24 38 + 65: TypeImage 27(int) 2D sampled format:Unknown + 66: TypePointer UniformConstant 65 + 67(g_tTex2di4): 66(ptr) Variable UniformConstant + 70: TypeSampledImage 65 + 72: 6(float) Constant 1053609165 + 73: 61(fvec2) ConstantComposite 51 72 + 76: TypeImage 40(int) 2D sampled format:Unknown + 77: TypePointer UniformConstant 76 + 78(g_tTex2du4): 77(ptr) Variable UniformConstant + 81: TypeSampledImage 76 + 83: 6(float) Constant 1058642330 + 84: 61(fvec2) ConstantComposite 25 83 + 87: TypeImage 6(float) 3D sampled format:Unknown + 88: TypePointer UniformConstant 87 + 89(g_tTex3df4): 88(ptr) Variable UniformConstant + 92: TypeSampledImage 87 + 94: TypeVector 6(float) 3 + 95: 94(fvec3) ConstantComposite 24 38 51 + 98: TypeImage 27(int) 3D sampled format:Unknown + 99: TypePointer UniformConstant 98 + 100(g_tTex3di4): 99(ptr) Variable UniformConstant + 103: TypeSampledImage 98 + 105: 94(fvec3) ConstantComposite 72 25 83 + 108: TypeImage 40(int) 3D sampled format:Unknown + 109: TypePointer UniformConstant 108 + 110(g_tTex3du4): 109(ptr) Variable UniformConstant + 113: TypeSampledImage 108 + 115: 6(float) Constant 1060320051 + 116: 6(float) Constant 1061997773 + 117: 6(float) Constant 1063675494 + 118: 94(fvec3) ConstantComposite 115 116 117 + 121: TypeImage 6(float) Cube sampled format:Unknown + 122: TypePointer UniformConstant 121 + 123(g_tTexcdf4): 122(ptr) Variable UniformConstant + 126: TypeSampledImage 121 + 130: TypeImage 27(int) Cube sampled format:Unknown + 131: TypePointer UniformConstant 130 + 132(g_tTexcdi4): 131(ptr) Variable UniformConstant + 135: TypeSampledImage 130 + 139: TypeImage 40(int) Cube sampled format:Unknown + 140: TypePointer UniformConstant 139 + 141(g_tTexcdu4): 140(ptr) Variable UniformConstant + 144: TypeSampledImage 139 + 147: TypePointer Function 8(PS_OUTPUT) + 149: 27(int) Constant 0 + 150: 6(float) Constant 1065353216 + 151: 7(fvec4) ConstantComposite 150 150 150 150 + 153: 27(int) Constant 1 + 154: TypePointer Function 6(float) + 161: TypePointer Output 7(fvec4) +162(@entryPointOutput.Color): 161(ptr) Variable Output + 165: TypePointer Output 6(float) +166(@entryPointOutput.Depth): 165(ptr) Variable Output +169(g_tTex1df4a): 15(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +159(flattenTemp): 147(ptr) Variable Function + 160:8(PS_OUTPUT) FunctionCall 10(@main() + Store 159(flattenTemp) 160 + 163: 12(ptr) AccessChain 159(flattenTemp) 149 + 164: 7(fvec4) Load 163 + Store 162(@entryPointOutput.Color) 164 + 167: 154(ptr) AccessChain 159(flattenTemp) 153 + 168: 6(float) Load 167 + Store 166(@entryPointOutput.Depth) 168 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval10): 12(ptr) Variable Function + 30(txval11): 29(ptr) Variable Function + 43(txval12): 42(ptr) Variable Function + 53(txval20): 12(ptr) Variable Function + 64(txval21): 29(ptr) Variable Function + 75(txval22): 42(ptr) Variable Function + 86(txval30): 12(ptr) Variable Function + 97(txval31): 29(ptr) Variable Function + 107(txval32): 42(ptr) Variable Function + 120(txval40): 12(ptr) Variable Function + 129(txval41): 29(ptr) Variable Function + 138(txval42): 42(ptr) Variable Function + 148(psout): 147(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 26: 7(fvec4) ImageSampleImplicitLod 23 24 Bias 25 + Store 13(txval10) 26 + 34: 31 Load 33(g_tTex1di4) + 35: 18 Load 20(g_sSamp) + 37: 36 SampledImage 34 35 + 39: 28(ivec4) ImageSampleImplicitLod 37 38 Bias 25 + Store 30(txval11) 39 + 47: 44 Load 46(g_tTex1du4) + 48: 18 Load 20(g_sSamp) + 50: 49 SampledImage 47 48 + 52: 41(ivec4) ImageSampleImplicitLod 50 51 Bias 25 + Store 43(txval12) 52 + 57: 54 Load 56(g_tTex2df4) + 58: 18 Load 20(g_sSamp) + 60: 59 SampledImage 57 58 + 63: 7(fvec4) ImageSampleImplicitLod 60 62 Bias 25 + Store 53(txval20) 63 + 68: 65 Load 67(g_tTex2di4) + 69: 18 Load 20(g_sSamp) + 71: 70 SampledImage 68 69 + 74: 28(ivec4) ImageSampleImplicitLod 71 73 Bias 25 + Store 64(txval21) 74 + 79: 76 Load 78(g_tTex2du4) + 80: 18 Load 20(g_sSamp) + 82: 81 SampledImage 79 80 + 85: 41(ivec4) ImageSampleImplicitLod 82 84 Bias 25 + Store 75(txval22) 85 + 90: 87 Load 89(g_tTex3df4) + 91: 18 Load 20(g_sSamp) + 93: 92 SampledImage 90 91 + 96: 7(fvec4) ImageSampleImplicitLod 93 95 Bias 25 + Store 86(txval30) 96 + 101: 98 Load 100(g_tTex3di4) + 102: 18 Load 20(g_sSamp) + 104: 103 SampledImage 101 102 + 106: 28(ivec4) ImageSampleImplicitLod 104 105 Bias 25 + Store 97(txval31) 106 + 111: 108 Load 110(g_tTex3du4) + 112: 18 Load 20(g_sSamp) + 114: 113 SampledImage 111 112 + 119: 41(ivec4) ImageSampleImplicitLod 114 118 Bias 25 + Store 107(txval32) 119 + 124: 121 Load 123(g_tTexcdf4) + 125: 18 Load 20(g_sSamp) + 127: 126 SampledImage 124 125 + 128: 7(fvec4) ImageSampleImplicitLod 127 95 Bias 25 + Store 120(txval40) 128 + 133: 130 Load 132(g_tTexcdi4) + 134: 18 Load 20(g_sSamp) + 136: 135 SampledImage 133 134 + 137: 28(ivec4) ImageSampleImplicitLod 136 105 Bias 25 + Store 129(txval41) 137 + 142: 139 Load 141(g_tTexcdu4) + 143: 18 Load 20(g_sSamp) + 145: 144 SampledImage 142 143 + 146: 41(ivec4) ImageSampleImplicitLod 145 118 Bias 25 + Store 138(txval42) 146 + 152: 12(ptr) AccessChain 148(psout) 149 + Store 152 151 + 155: 154(ptr) AccessChain 148(psout) 153 + Store 155 150 + 156:8(PS_OUTPUT) Load 148(psout) + ReturnValue 156 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplebias.offset.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplebias.offset.dx10.frag.out new file mode 100644 index 00000000..ae492e4d --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplebias.offset.dx10.frag.out @@ -0,0 +1,643 @@ +hlsl.samplebias.offset.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Parameters: +0:? Sequence +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval10' ( temp 4-component vector of float) +0:31 textureOffset ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler1D) +0:31 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:31 Constant: +0:31 0.100000 +0:31 Constant: +0:31 0.500000 +0:31 Constant: +0:31 1 (const int) +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval11' ( temp 4-component vector of int) +0:32 textureOffset ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler1D) +0:32 'g_tTex1di4' ( uniform itexture1D) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:32 Constant: +0:32 0.200000 +0:32 Constant: +0:32 0.500000 +0:32 Constant: +0:32 1 (const int) +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval12' ( temp 4-component vector of uint) +0:33 textureOffset ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler1D) +0:33 'g_tTex1du4' ( uniform utexture1D) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:33 Constant: +0:33 0.300000 +0:33 Constant: +0:33 0.500000 +0:33 Constant: +0:33 1 (const int) +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval20' ( temp 4-component vector of float) +0:35 textureOffset ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp sampler2D) +0:35 'g_tTex2df4' ( uniform texture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:35 Constant: +0:35 0.500000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval21' ( temp 4-component vector of int) +0:36 textureOffset ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isampler2D) +0:36 'g_tTex2di4' ( uniform itexture2D) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:36 Constant: +0:36 0.500000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval22' ( temp 4-component vector of uint) +0:37 textureOffset ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usampler2D) +0:37 'g_tTex2du4' ( uniform utexture2D) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:37 Constant: +0:37 0.500000 +0:? Constant: +0:? 1 (const int) +0:? -1 (const int) +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 'txval30' ( temp 4-component vector of float) +0:39 textureOffset ( temp 4-component vector of float) +0:39 Construct combined texture-sampler ( temp sampler3D) +0:39 'g_tTex3df4' ( uniform texture3D) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:39 Constant: +0:39 0.500000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:? 1 (const int) +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of int) +0:40 'txval31' ( temp 4-component vector of int) +0:40 textureOffset ( temp 4-component vector of int) +0:40 Construct combined texture-sampler ( temp isampler3D) +0:40 'g_tTex3di4' ( uniform itexture3D) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:40 Constant: +0:40 0.500000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of uint) +0:41 'txval32' ( temp 4-component vector of uint) +0:41 textureOffset ( temp 4-component vector of uint) +0:41 Construct combined texture-sampler ( temp usampler3D) +0:41 'g_tTex3du4' ( uniform utexture3D) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:41 Constant: +0:41 0.500000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:? -1 (const int) +0:45 move second child to first child ( temp 4-component vector of float) +0:45 Color: direct index for structure ( temp 4-component vector of float) +0:45 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 1.000000 +0:45 1.000000 +0:45 1.000000 +0:45 1.000000 +0:46 move second child to first child ( temp float) +0:46 Depth: direct index for structure ( temp float) +0:46 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 1.000000 +0:48 Branch: Return with expression +0:48 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:28 Color: direct index for structure ( temp 4-component vector of float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 0 (const int) +0:28 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:28 Depth: direct index for structure ( temp float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Parameters: +0:? Sequence +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval10' ( temp 4-component vector of float) +0:31 textureOffset ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler1D) +0:31 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:31 Constant: +0:31 0.100000 +0:31 Constant: +0:31 0.500000 +0:31 Constant: +0:31 1 (const int) +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval11' ( temp 4-component vector of int) +0:32 textureOffset ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler1D) +0:32 'g_tTex1di4' ( uniform itexture1D) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:32 Constant: +0:32 0.200000 +0:32 Constant: +0:32 0.500000 +0:32 Constant: +0:32 1 (const int) +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval12' ( temp 4-component vector of uint) +0:33 textureOffset ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler1D) +0:33 'g_tTex1du4' ( uniform utexture1D) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:33 Constant: +0:33 0.300000 +0:33 Constant: +0:33 0.500000 +0:33 Constant: +0:33 1 (const int) +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval20' ( temp 4-component vector of float) +0:35 textureOffset ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp sampler2D) +0:35 'g_tTex2df4' ( uniform texture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:35 Constant: +0:35 0.500000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval21' ( temp 4-component vector of int) +0:36 textureOffset ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isampler2D) +0:36 'g_tTex2di4' ( uniform itexture2D) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:36 Constant: +0:36 0.500000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval22' ( temp 4-component vector of uint) +0:37 textureOffset ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usampler2D) +0:37 'g_tTex2du4' ( uniform utexture2D) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:37 Constant: +0:37 0.500000 +0:? Constant: +0:? 1 (const int) +0:? -1 (const int) +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 'txval30' ( temp 4-component vector of float) +0:39 textureOffset ( temp 4-component vector of float) +0:39 Construct combined texture-sampler ( temp sampler3D) +0:39 'g_tTex3df4' ( uniform texture3D) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:39 Constant: +0:39 0.500000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:? 1 (const int) +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of int) +0:40 'txval31' ( temp 4-component vector of int) +0:40 textureOffset ( temp 4-component vector of int) +0:40 Construct combined texture-sampler ( temp isampler3D) +0:40 'g_tTex3di4' ( uniform itexture3D) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:40 Constant: +0:40 0.500000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of uint) +0:41 'txval32' ( temp 4-component vector of uint) +0:41 textureOffset ( temp 4-component vector of uint) +0:41 Construct combined texture-sampler ( temp usampler3D) +0:41 'g_tTex3du4' ( uniform utexture3D) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:41 Constant: +0:41 0.500000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:? -1 (const int) +0:45 move second child to first child ( temp 4-component vector of float) +0:45 Color: direct index for structure ( temp 4-component vector of float) +0:45 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 1.000000 +0:45 1.000000 +0:45 1.000000 +0:45 1.000000 +0:46 move second child to first child ( temp float) +0:46 Depth: direct index for structure ( temp float) +0:46 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 1.000000 +0:48 Branch: Return with expression +0:48 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:28 Color: direct index for structure ( temp 4-component vector of float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 0 (const int) +0:28 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:28 Depth: direct index for structure ( temp float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: Expected Image Operand Bias to be float scalar + %28 = OpImageSampleImplicitLod %v4float %23 %float_0_100000001 Bias|ConstOffset %int_1 %float_0_5 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 161 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 144 148 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval10" + Name 16 "g_tTex1df4" + Name 20 "g_sSamp" + Name 31 "txval11" + Name 34 "g_tTex1di4" + Name 44 "txval12" + Name 47 "g_tTex1du4" + Name 54 "txval20" + Name 57 "g_tTex2df4" + Name 68 "txval21" + Name 71 "g_tTex2di4" + Name 80 "txval22" + Name 83 "g_tTex2du4" + Name 93 "txval30" + Name 96 "g_tTex3df4" + Name 106 "txval31" + Name 109 "g_tTex3di4" + Name 117 "txval32" + Name 120 "g_tTex3du4" + Name 132 "psout" + Name 141 "flattenTemp" + Name 144 "@entryPointOutput.Color" + Name 148 "@entryPointOutput.Depth" + Name 151 "g_tTex1df4a" + Name 154 "g_tTexcdf4" + Name 157 "g_tTexcdi4" + Name 160 "g_tTexcdu4" + Decorate 16(g_tTex1df4) DescriptorSet 0 + Decorate 16(g_tTex1df4) Binding 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 34(g_tTex1di4) DescriptorSet 0 + Decorate 47(g_tTex1du4) DescriptorSet 0 + Decorate 57(g_tTex2df4) DescriptorSet 0 + Decorate 71(g_tTex2di4) DescriptorSet 0 + Decorate 83(g_tTex2du4) DescriptorSet 0 + Decorate 96(g_tTex3df4) DescriptorSet 0 + Decorate 109(g_tTex3di4) DescriptorSet 0 + Decorate 120(g_tTex3du4) DescriptorSet 0 + Decorate 144(@entryPointOutput.Color) Location 0 + Decorate 148(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 151(g_tTex1df4a) DescriptorSet 0 + Decorate 151(g_tTex1df4a) Binding 1 + Decorate 154(g_tTexcdf4) DescriptorSet 0 + Decorate 157(g_tTexcdi4) DescriptorSet 0 + Decorate 160(g_tTexcdu4) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 1D sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: 6(float) Constant 1036831949 + 25: 6(float) Constant 1056964608 + 26: TypeInt 32 1 + 27: 26(int) Constant 1 + 29: TypeVector 26(int) 4 + 30: TypePointer Function 29(ivec4) + 32: TypeImage 26(int) 1D sampled format:Unknown + 33: TypePointer UniformConstant 32 + 34(g_tTex1di4): 33(ptr) Variable UniformConstant + 37: TypeSampledImage 32 + 39: 6(float) Constant 1045220557 + 41: TypeInt 32 0 + 42: TypeVector 41(int) 4 + 43: TypePointer Function 42(ivec4) + 45: TypeImage 41(int) 1D sampled format:Unknown + 46: TypePointer UniformConstant 45 + 47(g_tTex1du4): 46(ptr) Variable UniformConstant + 50: TypeSampledImage 45 + 52: 6(float) Constant 1050253722 + 55: TypeImage 6(float) 2D sampled format:Unknown + 56: TypePointer UniformConstant 55 + 57(g_tTex2df4): 56(ptr) Variable UniformConstant + 60: TypeSampledImage 55 + 62: TypeVector 6(float) 2 + 63: 62(fvec2) ConstantComposite 24 39 + 64: TypeVector 26(int) 2 + 65: 26(int) Constant 0 + 66: 64(ivec2) ConstantComposite 27 65 + 69: TypeImage 26(int) 2D sampled format:Unknown + 70: TypePointer UniformConstant 69 + 71(g_tTex2di4): 70(ptr) Variable UniformConstant + 74: TypeSampledImage 69 + 76: 6(float) Constant 1053609165 + 77: 62(fvec2) ConstantComposite 52 76 + 78: 64(ivec2) ConstantComposite 27 27 + 81: TypeImage 41(int) 2D sampled format:Unknown + 82: TypePointer UniformConstant 81 + 83(g_tTex2du4): 82(ptr) Variable UniformConstant + 86: TypeSampledImage 81 + 88: 6(float) Constant 1058642330 + 89: 62(fvec2) ConstantComposite 25 88 + 90: 26(int) Constant 4294967295 + 91: 64(ivec2) ConstantComposite 27 90 + 94: TypeImage 6(float) 3D sampled format:Unknown + 95: TypePointer UniformConstant 94 + 96(g_tTex3df4): 95(ptr) Variable UniformConstant + 99: TypeSampledImage 94 + 101: TypeVector 6(float) 3 + 102: 101(fvec3) ConstantComposite 24 39 52 + 103: TypeVector 26(int) 3 + 104: 103(ivec3) ConstantComposite 27 65 27 + 107: TypeImage 26(int) 3D sampled format:Unknown + 108: TypePointer UniformConstant 107 + 109(g_tTex3di4): 108(ptr) Variable UniformConstant + 112: TypeSampledImage 107 + 114: 101(fvec3) ConstantComposite 76 25 88 + 115: 103(ivec3) ConstantComposite 27 27 27 + 118: TypeImage 41(int) 3D sampled format:Unknown + 119: TypePointer UniformConstant 118 + 120(g_tTex3du4): 119(ptr) Variable UniformConstant + 123: TypeSampledImage 118 + 125: 6(float) Constant 1060320051 + 126: 6(float) Constant 1061997773 + 127: 6(float) Constant 1063675494 + 128: 101(fvec3) ConstantComposite 125 126 127 + 129: 103(ivec3) ConstantComposite 27 65 90 + 131: TypePointer Function 8(PS_OUTPUT) + 133: 6(float) Constant 1065353216 + 134: 7(fvec4) ConstantComposite 133 133 133 133 + 136: TypePointer Function 6(float) + 143: TypePointer Output 7(fvec4) +144(@entryPointOutput.Color): 143(ptr) Variable Output + 147: TypePointer Output 6(float) +148(@entryPointOutput.Depth): 147(ptr) Variable Output +151(g_tTex1df4a): 15(ptr) Variable UniformConstant + 152: TypeImage 6(float) Cube sampled format:Unknown + 153: TypePointer UniformConstant 152 + 154(g_tTexcdf4): 153(ptr) Variable UniformConstant + 155: TypeImage 26(int) Cube sampled format:Unknown + 156: TypePointer UniformConstant 155 + 157(g_tTexcdi4): 156(ptr) Variable UniformConstant + 158: TypeImage 41(int) Cube sampled format:Unknown + 159: TypePointer UniformConstant 158 + 160(g_tTexcdu4): 159(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +141(flattenTemp): 131(ptr) Variable Function + 142:8(PS_OUTPUT) FunctionCall 10(@main() + Store 141(flattenTemp) 142 + 145: 12(ptr) AccessChain 141(flattenTemp) 65 + 146: 7(fvec4) Load 145 + Store 144(@entryPointOutput.Color) 146 + 149: 136(ptr) AccessChain 141(flattenTemp) 27 + 150: 6(float) Load 149 + Store 148(@entryPointOutput.Depth) 150 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval10): 12(ptr) Variable Function + 31(txval11): 30(ptr) Variable Function + 44(txval12): 43(ptr) Variable Function + 54(txval20): 12(ptr) Variable Function + 68(txval21): 30(ptr) Variable Function + 80(txval22): 43(ptr) Variable Function + 93(txval30): 12(ptr) Variable Function + 106(txval31): 30(ptr) Variable Function + 117(txval32): 43(ptr) Variable Function + 132(psout): 131(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 28: 7(fvec4) ImageSampleImplicitLod 23 24 Bias ConstOffset 27 25 + Store 13(txval10) 28 + 35: 32 Load 34(g_tTex1di4) + 36: 18 Load 20(g_sSamp) + 38: 37 SampledImage 35 36 + 40: 29(ivec4) ImageSampleImplicitLod 38 39 Bias ConstOffset 27 25 + Store 31(txval11) 40 + 48: 45 Load 47(g_tTex1du4) + 49: 18 Load 20(g_sSamp) + 51: 50 SampledImage 48 49 + 53: 42(ivec4) ImageSampleImplicitLod 51 52 Bias ConstOffset 27 25 + Store 44(txval12) 53 + 58: 55 Load 57(g_tTex2df4) + 59: 18 Load 20(g_sSamp) + 61: 60 SampledImage 58 59 + 67: 7(fvec4) ImageSampleImplicitLod 61 63 Bias ConstOffset 66 25 + Store 54(txval20) 67 + 72: 69 Load 71(g_tTex2di4) + 73: 18 Load 20(g_sSamp) + 75: 74 SampledImage 72 73 + 79: 29(ivec4) ImageSampleImplicitLod 75 77 Bias ConstOffset 78 25 + Store 68(txval21) 79 + 84: 81 Load 83(g_tTex2du4) + 85: 18 Load 20(g_sSamp) + 87: 86 SampledImage 84 85 + 92: 42(ivec4) ImageSampleImplicitLod 87 89 Bias ConstOffset 91 25 + Store 80(txval22) 92 + 97: 94 Load 96(g_tTex3df4) + 98: 18 Load 20(g_sSamp) + 100: 99 SampledImage 97 98 + 105: 7(fvec4) ImageSampleImplicitLod 100 102 Bias ConstOffset 104 25 + Store 93(txval30) 105 + 110: 107 Load 109(g_tTex3di4) + 111: 18 Load 20(g_sSamp) + 113: 112 SampledImage 110 111 + 116: 29(ivec4) ImageSampleImplicitLod 113 114 Bias ConstOffset 115 25 + Store 106(txval31) 116 + 121: 118 Load 120(g_tTex3du4) + 122: 18 Load 20(g_sSamp) + 124: 123 SampledImage 121 122 + 130: 42(ivec4) ImageSampleImplicitLod 124 128 Bias ConstOffset 129 25 + Store 117(txval32) 130 + 135: 12(ptr) AccessChain 132(psout) 65 + Store 135 134 + 137: 136(ptr) AccessChain 132(psout) 27 + Store 137 133 + 138:8(PS_OUTPUT) Load 132(psout) + ReturnValue 138 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out new file mode 100644 index 00000000..0cea7670 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out @@ -0,0 +1,480 @@ +hlsl.samplebias.offsetarray.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:20 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Parameters: +0:? Sequence +0:23 Sequence +0:23 move second child to first child ( temp 4-component vector of float) +0:23 'txval10' ( temp 4-component vector of float) +0:23 textureOffset ( temp 4-component vector of float) +0:23 Construct combined texture-sampler ( temp sampler1DArray) +0:23 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:23 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:23 Constant: +0:23 0.500000 +0:23 Constant: +0:23 0 (const int) +0:24 Sequence +0:24 move second child to first child ( temp 4-component vector of int) +0:24 'txval11' ( temp 4-component vector of int) +0:24 textureOffset ( temp 4-component vector of int) +0:24 Construct combined texture-sampler ( temp isampler1DArray) +0:24 'g_tTex1di4' ( uniform itexture1DArray) +0:24 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:24 Constant: +0:24 0.500000 +0:24 Constant: +0:24 1 (const int) +0:25 Sequence +0:25 move second child to first child ( temp 4-component vector of uint) +0:25 'txval12' ( temp 4-component vector of uint) +0:25 textureOffset ( temp 4-component vector of uint) +0:25 Construct combined texture-sampler ( temp usampler1DArray) +0:25 'g_tTex1du4' ( uniform utexture1DArray) +0:25 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:25 Constant: +0:25 0.500000 +0:25 Constant: +0:25 2 (const int) +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'txval20' ( temp 4-component vector of float) +0:27 textureOffset ( temp 4-component vector of float) +0:27 Construct combined texture-sampler ( temp sampler2DArray) +0:27 'g_tTex2df4' ( uniform texture2DArray) +0:27 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:27 Constant: +0:27 0.500000 +0:? Constant: +0:? 0 (const int) +0:? 0 (const int) +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of int) +0:28 'txval21' ( temp 4-component vector of int) +0:28 textureOffset ( temp 4-component vector of int) +0:28 Construct combined texture-sampler ( temp isampler2DArray) +0:28 'g_tTex2di4' ( uniform itexture2DArray) +0:28 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? 0.500000 +0:28 Constant: +0:28 0.500000 +0:? Constant: +0:? 0 (const int) +0:? 0 (const int) +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of uint) +0:29 'txval22' ( temp 4-component vector of uint) +0:29 textureOffset ( temp 4-component vector of uint) +0:29 Construct combined texture-sampler ( temp usampler2DArray) +0:29 'g_tTex2du4' ( uniform utexture2DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:29 Constant: +0:29 0.500000 +0:? Constant: +0:? 0 (const int) +0:? 1 (const int) +0:33 move second child to first child ( temp 4-component vector of float) +0:33 Color: direct index for structure ( temp 4-component vector of float) +0:33 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 1.000000 +0:33 1.000000 +0:33 1.000000 +0:33 1.000000 +0:34 move second child to first child ( temp float) +0:34 Depth: direct index for structure ( temp float) +0:34 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 Constant: +0:34 1 (const int) +0:34 Constant: +0:34 1.000000 +0:36 Branch: Return with expression +0:36 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 Sequence +0:20 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:20 Color: direct index for structure ( temp 4-component vector of float) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Constant: +0:20 0 (const int) +0:20 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:20 Depth: direct index for structure ( temp float) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Constant: +0:20 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4' ( uniform itexture1DArray) +0:? 'g_tTex1du4' ( uniform utexture1DArray) +0:? 'g_tTex2df4' ( uniform texture2DArray) +0:? 'g_tTex2di4' ( uniform itexture2DArray) +0:? 'g_tTex2du4' ( uniform utexture2DArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:20 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Parameters: +0:? Sequence +0:23 Sequence +0:23 move second child to first child ( temp 4-component vector of float) +0:23 'txval10' ( temp 4-component vector of float) +0:23 textureOffset ( temp 4-component vector of float) +0:23 Construct combined texture-sampler ( temp sampler1DArray) +0:23 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:23 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:23 Constant: +0:23 0.500000 +0:23 Constant: +0:23 0 (const int) +0:24 Sequence +0:24 move second child to first child ( temp 4-component vector of int) +0:24 'txval11' ( temp 4-component vector of int) +0:24 textureOffset ( temp 4-component vector of int) +0:24 Construct combined texture-sampler ( temp isampler1DArray) +0:24 'g_tTex1di4' ( uniform itexture1DArray) +0:24 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:24 Constant: +0:24 0.500000 +0:24 Constant: +0:24 1 (const int) +0:25 Sequence +0:25 move second child to first child ( temp 4-component vector of uint) +0:25 'txval12' ( temp 4-component vector of uint) +0:25 textureOffset ( temp 4-component vector of uint) +0:25 Construct combined texture-sampler ( temp usampler1DArray) +0:25 'g_tTex1du4' ( uniform utexture1DArray) +0:25 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:25 Constant: +0:25 0.500000 +0:25 Constant: +0:25 2 (const int) +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'txval20' ( temp 4-component vector of float) +0:27 textureOffset ( temp 4-component vector of float) +0:27 Construct combined texture-sampler ( temp sampler2DArray) +0:27 'g_tTex2df4' ( uniform texture2DArray) +0:27 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:27 Constant: +0:27 0.500000 +0:? Constant: +0:? 0 (const int) +0:? 0 (const int) +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of int) +0:28 'txval21' ( temp 4-component vector of int) +0:28 textureOffset ( temp 4-component vector of int) +0:28 Construct combined texture-sampler ( temp isampler2DArray) +0:28 'g_tTex2di4' ( uniform itexture2DArray) +0:28 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? 0.500000 +0:28 Constant: +0:28 0.500000 +0:? Constant: +0:? 0 (const int) +0:? 0 (const int) +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of uint) +0:29 'txval22' ( temp 4-component vector of uint) +0:29 textureOffset ( temp 4-component vector of uint) +0:29 Construct combined texture-sampler ( temp usampler2DArray) +0:29 'g_tTex2du4' ( uniform utexture2DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:29 Constant: +0:29 0.500000 +0:? Constant: +0:? 0 (const int) +0:? 1 (const int) +0:33 move second child to first child ( temp 4-component vector of float) +0:33 Color: direct index for structure ( temp 4-component vector of float) +0:33 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 1.000000 +0:33 1.000000 +0:33 1.000000 +0:33 1.000000 +0:34 move second child to first child ( temp float) +0:34 Depth: direct index for structure ( temp float) +0:34 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 Constant: +0:34 1 (const int) +0:34 Constant: +0:34 1.000000 +0:36 Branch: Return with expression +0:36 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 Sequence +0:20 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:20 Color: direct index for structure ( temp 4-component vector of float) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Constant: +0:20 0 (const int) +0:20 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:20 Depth: direct index for structure ( temp float) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Constant: +0:20 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4' ( uniform itexture1DArray) +0:? 'g_tTex1du4' ( uniform utexture1DArray) +0:? 'g_tTex2df4' ( uniform texture2DArray) +0:? 'g_tTex2di4' ( uniform itexture2DArray) +0:? 'g_tTex2du4' ( uniform utexture2DArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: Expected Image Operand Bias to be float scalar + %31 = OpImageSampleImplicitLod %v4float %23 %27 Bias|ConstOffset %int_0 %float_0_5 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 118 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 110 114 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval10" + Name 16 "g_tTex1df4" + Name 20 "g_sSamp" + Name 34 "txval11" + Name 37 "g_tTex1di4" + Name 49 "txval12" + Name 52 "g_tTex1du4" + Name 61 "txval20" + Name 64 "g_tTex2df4" + Name 74 "txval21" + Name 77 "g_tTex2di4" + Name 84 "txval22" + Name 87 "g_tTex2du4" + Name 98 "psout" + Name 107 "flattenTemp" + Name 110 "@entryPointOutput.Color" + Name 114 "@entryPointOutput.Depth" + Name 117 "g_tTex1df4a" + Decorate 16(g_tTex1df4) DescriptorSet 0 + Decorate 16(g_tTex1df4) Binding 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 37(g_tTex1di4) DescriptorSet 0 + Decorate 52(g_tTex1du4) DescriptorSet 0 + Decorate 64(g_tTex2df4) DescriptorSet 0 + Decorate 77(g_tTex2di4) DescriptorSet 0 + Decorate 87(g_tTex2du4) DescriptorSet 0 + Decorate 110(@entryPointOutput.Color) Location 0 + Decorate 114(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 117(g_tTex1df4a) DescriptorSet 0 + Decorate 117(g_tTex1df4a) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 1D array sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 2 + 25: 6(float) Constant 1036831949 + 26: 6(float) Constant 1045220557 + 27: 24(fvec2) ConstantComposite 25 26 + 28: 6(float) Constant 1056964608 + 29: TypeInt 32 1 + 30: 29(int) Constant 0 + 32: TypeVector 29(int) 4 + 33: TypePointer Function 32(ivec4) + 35: TypeImage 29(int) 1D array sampled format:Unknown + 36: TypePointer UniformConstant 35 + 37(g_tTex1di4): 36(ptr) Variable UniformConstant + 40: TypeSampledImage 35 + 42: 6(float) Constant 1050253722 + 43: 24(fvec2) ConstantComposite 26 42 + 44: 29(int) Constant 1 + 46: TypeInt 32 0 + 47: TypeVector 46(int) 4 + 48: TypePointer Function 47(ivec4) + 50: TypeImage 46(int) 1D array sampled format:Unknown + 51: TypePointer UniformConstant 50 + 52(g_tTex1du4): 51(ptr) Variable UniformConstant + 55: TypeSampledImage 50 + 57: 6(float) Constant 1053609165 + 58: 24(fvec2) ConstantComposite 42 57 + 59: 29(int) Constant 2 + 62: TypeImage 6(float) 2D array sampled format:Unknown + 63: TypePointer UniformConstant 62 + 64(g_tTex2df4): 63(ptr) Variable UniformConstant + 67: TypeSampledImage 62 + 69: TypeVector 6(float) 3 + 70: 69(fvec3) ConstantComposite 25 26 42 + 71: TypeVector 29(int) 2 + 72: 71(ivec2) ConstantComposite 30 30 + 75: TypeImage 29(int) 2D array sampled format:Unknown + 76: TypePointer UniformConstant 75 + 77(g_tTex2di4): 76(ptr) Variable UniformConstant + 80: TypeSampledImage 75 + 82: 69(fvec3) ConstantComposite 42 57 28 + 85: TypeImage 46(int) 2D array sampled format:Unknown + 86: TypePointer UniformConstant 85 + 87(g_tTex2du4): 86(ptr) Variable UniformConstant + 90: TypeSampledImage 85 + 92: 6(float) Constant 1058642330 + 93: 6(float) Constant 1060320051 + 94: 69(fvec3) ConstantComposite 28 92 93 + 95: 71(ivec2) ConstantComposite 30 44 + 97: TypePointer Function 8(PS_OUTPUT) + 99: 6(float) Constant 1065353216 + 100: 7(fvec4) ConstantComposite 99 99 99 99 + 102: TypePointer Function 6(float) + 109: TypePointer Output 7(fvec4) +110(@entryPointOutput.Color): 109(ptr) Variable Output + 113: TypePointer Output 6(float) +114(@entryPointOutput.Depth): 113(ptr) Variable Output +117(g_tTex1df4a): 15(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +107(flattenTemp): 97(ptr) Variable Function + 108:8(PS_OUTPUT) FunctionCall 10(@main() + Store 107(flattenTemp) 108 + 111: 12(ptr) AccessChain 107(flattenTemp) 30 + 112: 7(fvec4) Load 111 + Store 110(@entryPointOutput.Color) 112 + 115: 102(ptr) AccessChain 107(flattenTemp) 44 + 116: 6(float) Load 115 + Store 114(@entryPointOutput.Depth) 116 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval10): 12(ptr) Variable Function + 34(txval11): 33(ptr) Variable Function + 49(txval12): 48(ptr) Variable Function + 61(txval20): 12(ptr) Variable Function + 74(txval21): 33(ptr) Variable Function + 84(txval22): 48(ptr) Variable Function + 98(psout): 97(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 31: 7(fvec4) ImageSampleImplicitLod 23 27 Bias ConstOffset 30 28 + Store 13(txval10) 31 + 38: 35 Load 37(g_tTex1di4) + 39: 18 Load 20(g_sSamp) + 41: 40 SampledImage 38 39 + 45: 32(ivec4) ImageSampleImplicitLod 41 43 Bias ConstOffset 44 28 + Store 34(txval11) 45 + 53: 50 Load 52(g_tTex1du4) + 54: 18 Load 20(g_sSamp) + 56: 55 SampledImage 53 54 + 60: 47(ivec4) ImageSampleImplicitLod 56 58 Bias ConstOffset 59 28 + Store 49(txval12) 60 + 65: 62 Load 64(g_tTex2df4) + 66: 18 Load 20(g_sSamp) + 68: 67 SampledImage 65 66 + 73: 7(fvec4) ImageSampleImplicitLod 68 70 Bias ConstOffset 72 28 + Store 61(txval20) 73 + 78: 75 Load 77(g_tTex2di4) + 79: 18 Load 20(g_sSamp) + 81: 80 SampledImage 78 79 + 83: 32(ivec4) ImageSampleImplicitLod 81 82 Bias ConstOffset 72 28 + Store 74(txval21) 83 + 88: 85 Load 87(g_tTex2du4) + 89: 18 Load 20(g_sSamp) + 91: 90 SampledImage 88 89 + 96: 47(ivec4) ImageSampleImplicitLod 91 94 Bias ConstOffset 95 28 + Store 84(txval22) 96 + 101: 12(ptr) AccessChain 98(psout) 30 + Store 101 100 + 103: 102(ptr) AccessChain 98(psout) 44 + Store 103 99 + 104:8(PS_OUTPUT) Load 98(psout) + ReturnValue 104 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplecmp.array.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplecmp.array.dx10.frag.out new file mode 100644 index 00000000..a41481da --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplecmp.array.dx10.frag.out @@ -0,0 +1,705 @@ +hlsl.samplecmp.array.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Parameters: +0:? Sequence +0:42 Sequence +0:42 move second child to first child ( temp float) +0:42 'r10' ( temp float) +0:42 texture ( temp float) +0:42 Construct combined texture-sampler ( temp sampler1DArrayShadow) +0:42 'g_tTex1df4a' ( uniform texture1DArrayShadow) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:42 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:42 Constant: +0:42 0.750000 +0:43 Sequence +0:43 move second child to first child ( temp float) +0:43 'r12' ( temp float) +0:43 texture ( temp float) +0:43 Construct combined texture-sampler ( temp isampler1DArrayShadow) +0:43 'g_tTex1di4a' ( uniform itexture1DArrayShadow) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:43 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:43 Constant: +0:43 0.750000 +0:44 Sequence +0:44 move second child to first child ( temp float) +0:44 'r14' ( temp float) +0:44 texture ( temp float) +0:44 Construct combined texture-sampler ( temp usampler1DArrayShadow) +0:44 'g_tTex1du4a' ( uniform utexture1DArrayShadow) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:44 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:44 Constant: +0:44 0.750000 +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'r30' ( temp float) +0:47 texture ( temp float) +0:47 Construct combined texture-sampler ( temp sampler2DArrayShadow) +0:47 'g_tTex2df4a' ( uniform texture2DArrayShadow) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:47 Constant: +0:47 0.750000 +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'r32' ( temp float) +0:48 texture ( temp float) +0:48 Construct combined texture-sampler ( temp isampler2DArrayShadow) +0:48 'g_tTex2di4a' ( uniform itexture2DArrayShadow) +0:48 'g_sSamp' (layout( binding=0) uniform sampler) +0:48 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:48 Constant: +0:48 0.750000 +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'r34' ( temp float) +0:49 texture ( temp float) +0:49 Construct combined texture-sampler ( temp usampler2DArrayShadow) +0:49 'g_tTex2du4a' ( uniform utexture2DArrayShadow) +0:49 'g_sSamp' (layout( binding=0) uniform sampler) +0:49 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:49 Constant: +0:49 0.750000 +0:52 Sequence +0:52 move second child to first child ( temp float) +0:52 'r60' ( temp float) +0:52 texture ( temp float) +0:52 Construct combined texture-sampler ( temp samplerCubeArrayShadow) +0:52 'g_tTexcdf4a' ( uniform textureCubeArrayShadow) +0:52 'g_sSamp' (layout( binding=0) uniform sampler) +0:52 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:52 Constant: +0:52 0.750000 +0:53 Sequence +0:53 move second child to first child ( temp float) +0:53 'r62' ( temp float) +0:53 texture ( temp float) +0:53 Construct combined texture-sampler ( temp isamplerCubeArrayShadow) +0:53 'g_tTexcdi4a' ( uniform itextureCubeArrayShadow) +0:53 'g_sSamp' (layout( binding=0) uniform sampler) +0:53 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:53 Constant: +0:53 0.750000 +0:54 Sequence +0:54 move second child to first child ( temp float) +0:54 'r64' ( temp float) +0:54 texture ( temp float) +0:54 Construct combined texture-sampler ( temp usamplerCubeArrayShadow) +0:54 'g_tTexcdu4a' ( uniform utextureCubeArrayShadow) +0:54 'g_sSamp' (layout( binding=0) uniform sampler) +0:54 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:54 Constant: +0:54 0.750000 +0:56 move second child to first child ( temp 4-component vector of float) +0:56 Color: direct index for structure ( temp 4-component vector of float) +0:56 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1.000000 +0:56 1.000000 +0:56 1.000000 +0:56 1.000000 +0:57 move second child to first child ( temp float) +0:57 Depth: direct index for structure ( temp float) +0:57 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 1.000000 +0:59 Branch: Return with expression +0:59 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Definition: main( ( temp void) +0:38 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:38 Color: direct index for structure ( temp 4-component vector of float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 0 (const int) +0:38 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:38 Depth: direct index for structure ( temp float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArrayShadow) +0:? 'g_tTex1di4a' ( uniform itexture1DArrayShadow) +0:? 'g_tTex1du4a' ( uniform utexture1DArrayShadow) +0:? 'g_tTex2df4a' ( uniform texture2DArrayShadow) +0:? 'g_tTex2di4a' ( uniform itexture2DArrayShadow) +0:? 'g_tTex2du4a' ( uniform utexture2DArrayShadow) +0:? 'g_tTexcdf4a' ( uniform textureCubeArrayShadow) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArrayShadow) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArrayShadow) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Parameters: +0:? Sequence +0:42 Sequence +0:42 move second child to first child ( temp float) +0:42 'r10' ( temp float) +0:42 texture ( temp float) +0:42 Construct combined texture-sampler ( temp sampler1DArrayShadow) +0:42 'g_tTex1df4a' ( uniform texture1DArrayShadow) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:42 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:42 Constant: +0:42 0.750000 +0:43 Sequence +0:43 move second child to first child ( temp float) +0:43 'r12' ( temp float) +0:43 texture ( temp float) +0:43 Construct combined texture-sampler ( temp isampler1DArrayShadow) +0:43 'g_tTex1di4a' ( uniform itexture1DArrayShadow) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:43 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:43 Constant: +0:43 0.750000 +0:44 Sequence +0:44 move second child to first child ( temp float) +0:44 'r14' ( temp float) +0:44 texture ( temp float) +0:44 Construct combined texture-sampler ( temp usampler1DArrayShadow) +0:44 'g_tTex1du4a' ( uniform utexture1DArrayShadow) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:44 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:44 Constant: +0:44 0.750000 +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'r30' ( temp float) +0:47 texture ( temp float) +0:47 Construct combined texture-sampler ( temp sampler2DArrayShadow) +0:47 'g_tTex2df4a' ( uniform texture2DArrayShadow) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:47 Constant: +0:47 0.750000 +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'r32' ( temp float) +0:48 texture ( temp float) +0:48 Construct combined texture-sampler ( temp isampler2DArrayShadow) +0:48 'g_tTex2di4a' ( uniform itexture2DArrayShadow) +0:48 'g_sSamp' (layout( binding=0) uniform sampler) +0:48 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:48 Constant: +0:48 0.750000 +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'r34' ( temp float) +0:49 texture ( temp float) +0:49 Construct combined texture-sampler ( temp usampler2DArrayShadow) +0:49 'g_tTex2du4a' ( uniform utexture2DArrayShadow) +0:49 'g_sSamp' (layout( binding=0) uniform sampler) +0:49 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:49 Constant: +0:49 0.750000 +0:52 Sequence +0:52 move second child to first child ( temp float) +0:52 'r60' ( temp float) +0:52 texture ( temp float) +0:52 Construct combined texture-sampler ( temp samplerCubeArrayShadow) +0:52 'g_tTexcdf4a' ( uniform textureCubeArrayShadow) +0:52 'g_sSamp' (layout( binding=0) uniform sampler) +0:52 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:52 Constant: +0:52 0.750000 +0:53 Sequence +0:53 move second child to first child ( temp float) +0:53 'r62' ( temp float) +0:53 texture ( temp float) +0:53 Construct combined texture-sampler ( temp isamplerCubeArrayShadow) +0:53 'g_tTexcdi4a' ( uniform itextureCubeArrayShadow) +0:53 'g_sSamp' (layout( binding=0) uniform sampler) +0:53 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:53 Constant: +0:53 0.750000 +0:54 Sequence +0:54 move second child to first child ( temp float) +0:54 'r64' ( temp float) +0:54 texture ( temp float) +0:54 Construct combined texture-sampler ( temp usamplerCubeArrayShadow) +0:54 'g_tTexcdu4a' ( uniform utextureCubeArrayShadow) +0:54 'g_sSamp' (layout( binding=0) uniform sampler) +0:54 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:54 Constant: +0:54 0.750000 +0:56 move second child to first child ( temp 4-component vector of float) +0:56 Color: direct index for structure ( temp 4-component vector of float) +0:56 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1.000000 +0:56 1.000000 +0:56 1.000000 +0:56 1.000000 +0:57 move second child to first child ( temp float) +0:57 Depth: direct index for structure ( temp float) +0:57 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 1.000000 +0:59 Branch: Return with expression +0:59 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Definition: main( ( temp void) +0:38 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:38 Color: direct index for structure ( temp 4-component vector of float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 0 (const int) +0:38 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:38 Depth: direct index for structure ( temp float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArrayShadow) +0:? 'g_tTex1di4a' ( uniform itexture1DArrayShadow) +0:? 'g_tTex1du4a' ( uniform utexture1DArrayShadow) +0:? 'g_tTex2df4a' ( uniform texture2DArrayShadow) +0:? 'g_tTex2di4a' ( uniform itexture2DArrayShadow) +0:? 'g_tTex2du4a' ( uniform utexture2DArrayShadow) +0:? 'g_tTexcdf4a' ( uniform textureCubeArrayShadow) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArrayShadow) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArrayShadow) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: Expected Image 'Sampled Type' to be the same as Result Type + %48 = OpImageSampleDrefImplicitLod %float %43 %46 %47 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 209 + + Capability Shader + Capability Sampled1D + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 166 170 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "r10" + Name 16 "g_tTex1df4a" + Name 20 "g_sSamp" + Name 35 "r12" + Name 39 "g_tTex1di4a" + Name 49 "r14" + Name 53 "g_tTex1du4a" + Name 63 "r30" + Name 66 "g_tTex2df4a" + Name 79 "r32" + Name 82 "g_tTex2di4a" + Name 93 "r34" + Name 96 "g_tTex2du4a" + Name 107 "r60" + Name 110 "g_tTexcdf4a" + Name 123 "r62" + Name 126 "g_tTexcdi4a" + Name 137 "r64" + Name 140 "g_tTexcdu4a" + Name 152 "psout" + Name 163 "flattenTemp" + Name 166 "@entryPointOutput.Color" + Name 170 "@entryPointOutput.Depth" + Name 175 "g_tTex1df4" + Name 178 "g_tTex1di4" + Name 181 "g_tTex1du4" + Name 184 "g_tTex2df4" + Name 187 "g_tTex2di4" + Name 190 "g_tTex2du4" + Name 193 "g_tTex3df4" + Name 196 "g_tTex3di4" + Name 199 "g_tTex3du4" + Name 202 "g_tTexcdf4" + Name 205 "g_tTexcdi4" + Name 208 "g_tTexcdu4" + Decorate 16(g_tTex1df4a) DescriptorSet 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 39(g_tTex1di4a) DescriptorSet 0 + Decorate 53(g_tTex1du4a) DescriptorSet 0 + Decorate 66(g_tTex2df4a) DescriptorSet 0 + Decorate 82(g_tTex2di4a) DescriptorSet 0 + Decorate 96(g_tTex2du4a) DescriptorSet 0 + Decorate 110(g_tTexcdf4a) DescriptorSet 0 + Decorate 126(g_tTexcdi4a) DescriptorSet 0 + Decorate 140(g_tTexcdu4a) DescriptorSet 0 + Decorate 166(@entryPointOutput.Color) Location 0 + Decorate 170(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 175(g_tTex1df4) DescriptorSet 0 + Decorate 175(g_tTex1df4) Binding 0 + Decorate 178(g_tTex1di4) DescriptorSet 0 + Decorate 181(g_tTex1du4) DescriptorSet 0 + Decorate 184(g_tTex2df4) DescriptorSet 0 + Decorate 187(g_tTex2di4) DescriptorSet 0 + Decorate 190(g_tTex2du4) DescriptorSet 0 + Decorate 193(g_tTex3df4) DescriptorSet 0 + Decorate 196(g_tTex3di4) DescriptorSet 0 + Decorate 199(g_tTex3du4) DescriptorSet 0 + Decorate 202(g_tTexcdf4) DescriptorSet 0 + Decorate 205(g_tTexcdi4) DescriptorSet 0 + Decorate 208(g_tTexcdu4) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 6(float) + 14: TypeImage 6(float) 1D depth array sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4a): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 2 + 25: 6(float) Constant 1036831949 + 26: 6(float) Constant 1045220557 + 27: 24(fvec2) ConstantComposite 25 26 + 28: 6(float) Constant 1061158912 + 29: TypeVector 6(float) 3 + 36: TypeInt 32 1 + 37: TypeImage 36(int) 1D depth array sampled format:Unknown + 38: TypePointer UniformConstant 37 + 39(g_tTex1di4a): 38(ptr) Variable UniformConstant + 42: TypeSampledImage 37 + 50: TypeInt 32 0 + 51: TypeImage 50(int) 1D depth array sampled format:Unknown + 52: TypePointer UniformConstant 51 + 53(g_tTex1du4a): 52(ptr) Variable UniformConstant + 56: TypeSampledImage 51 + 64: TypeImage 6(float) 2D depth array sampled format:Unknown + 65: TypePointer UniformConstant 64 + 66(g_tTex2df4a): 65(ptr) Variable UniformConstant + 69: TypeSampledImage 64 + 71: 6(float) Constant 1050253722 + 72: 29(fvec3) ConstantComposite 25 26 71 + 80: TypeImage 36(int) 2D depth array sampled format:Unknown + 81: TypePointer UniformConstant 80 + 82(g_tTex2di4a): 81(ptr) Variable UniformConstant + 85: TypeSampledImage 80 + 94: TypeImage 50(int) 2D depth array sampled format:Unknown + 95: TypePointer UniformConstant 94 + 96(g_tTex2du4a): 95(ptr) Variable UniformConstant + 99: TypeSampledImage 94 + 108: TypeImage 6(float) Cube depth array sampled format:Unknown + 109: TypePointer UniformConstant 108 +110(g_tTexcdf4a): 109(ptr) Variable UniformConstant + 113: TypeSampledImage 108 + 115: 6(float) Constant 1053609165 + 116: 7(fvec4) ConstantComposite 25 26 71 115 + 124: TypeImage 36(int) Cube depth array sampled format:Unknown + 125: TypePointer UniformConstant 124 +126(g_tTexcdi4a): 125(ptr) Variable UniformConstant + 129: TypeSampledImage 124 + 138: TypeImage 50(int) Cube depth array sampled format:Unknown + 139: TypePointer UniformConstant 138 +140(g_tTexcdu4a): 139(ptr) Variable UniformConstant + 143: TypeSampledImage 138 + 151: TypePointer Function 8(PS_OUTPUT) + 153: 36(int) Constant 0 + 154: 6(float) Constant 1065353216 + 155: 7(fvec4) ConstantComposite 154 154 154 154 + 156: TypePointer Function 7(fvec4) + 158: 36(int) Constant 1 + 165: TypePointer Output 7(fvec4) +166(@entryPointOutput.Color): 165(ptr) Variable Output + 169: TypePointer Output 6(float) +170(@entryPointOutput.Depth): 169(ptr) Variable Output + 173: TypeImage 6(float) 1D sampled format:Unknown + 174: TypePointer UniformConstant 173 + 175(g_tTex1df4): 174(ptr) Variable UniformConstant + 176: TypeImage 36(int) 1D sampled format:Unknown + 177: TypePointer UniformConstant 176 + 178(g_tTex1di4): 177(ptr) Variable UniformConstant + 179: TypeImage 50(int) 1D sampled format:Unknown + 180: TypePointer UniformConstant 179 + 181(g_tTex1du4): 180(ptr) Variable UniformConstant + 182: TypeImage 6(float) 2D sampled format:Unknown + 183: TypePointer UniformConstant 182 + 184(g_tTex2df4): 183(ptr) Variable UniformConstant + 185: TypeImage 36(int) 2D sampled format:Unknown + 186: TypePointer UniformConstant 185 + 187(g_tTex2di4): 186(ptr) Variable UniformConstant + 188: TypeImage 50(int) 2D sampled format:Unknown + 189: TypePointer UniformConstant 188 + 190(g_tTex2du4): 189(ptr) Variable UniformConstant + 191: TypeImage 6(float) 3D sampled format:Unknown + 192: TypePointer UniformConstant 191 + 193(g_tTex3df4): 192(ptr) Variable UniformConstant + 194: TypeImage 36(int) 3D sampled format:Unknown + 195: TypePointer UniformConstant 194 + 196(g_tTex3di4): 195(ptr) Variable UniformConstant + 197: TypeImage 50(int) 3D sampled format:Unknown + 198: TypePointer UniformConstant 197 + 199(g_tTex3du4): 198(ptr) Variable UniformConstant + 200: TypeImage 6(float) Cube sampled format:Unknown + 201: TypePointer UniformConstant 200 + 202(g_tTexcdf4): 201(ptr) Variable UniformConstant + 203: TypeImage 36(int) Cube sampled format:Unknown + 204: TypePointer UniformConstant 203 + 205(g_tTexcdi4): 204(ptr) Variable UniformConstant + 206: TypeImage 50(int) Cube sampled format:Unknown + 207: TypePointer UniformConstant 206 + 208(g_tTexcdu4): 207(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +163(flattenTemp): 151(ptr) Variable Function + 164:8(PS_OUTPUT) FunctionCall 10(@main() + Store 163(flattenTemp) 164 + 167: 156(ptr) AccessChain 163(flattenTemp) 153 + 168: 7(fvec4) Load 167 + Store 166(@entryPointOutput.Color) 168 + 171: 12(ptr) AccessChain 163(flattenTemp) 158 + 172: 6(float) Load 171 + Store 170(@entryPointOutput.Depth) 172 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(r10): 12(ptr) Variable Function + 35(r12): 12(ptr) Variable Function + 49(r14): 12(ptr) Variable Function + 63(r30): 12(ptr) Variable Function + 79(r32): 12(ptr) Variable Function + 93(r34): 12(ptr) Variable Function + 107(r60): 12(ptr) Variable Function + 123(r62): 12(ptr) Variable Function + 137(r64): 12(ptr) Variable Function + 152(psout): 151(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4a) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 30: 6(float) CompositeExtract 27 0 + 31: 6(float) CompositeExtract 27 1 + 32: 29(fvec3) CompositeConstruct 30 31 28 + 33: 6(float) CompositeExtract 32 2 + 34: 6(float) ImageSampleDrefImplicitLod 23 32 33 + Store 13(r10) 34 + 40: 37 Load 39(g_tTex1di4a) + 41: 18 Load 20(g_sSamp) + 43: 42 SampledImage 40 41 + 44: 6(float) CompositeExtract 27 0 + 45: 6(float) CompositeExtract 27 1 + 46: 29(fvec3) CompositeConstruct 44 45 28 + 47: 6(float) CompositeExtract 46 2 + 48: 6(float) ImageSampleDrefImplicitLod 43 46 47 + Store 35(r12) 48 + 54: 51 Load 53(g_tTex1du4a) + 55: 18 Load 20(g_sSamp) + 57: 56 SampledImage 54 55 + 58: 6(float) CompositeExtract 27 0 + 59: 6(float) CompositeExtract 27 1 + 60: 29(fvec3) CompositeConstruct 58 59 28 + 61: 6(float) CompositeExtract 60 2 + 62: 6(float) ImageSampleDrefImplicitLod 57 60 61 + Store 49(r14) 62 + 67: 64 Load 66(g_tTex2df4a) + 68: 18 Load 20(g_sSamp) + 70: 69 SampledImage 67 68 + 73: 6(float) CompositeExtract 72 0 + 74: 6(float) CompositeExtract 72 1 + 75: 6(float) CompositeExtract 72 2 + 76: 7(fvec4) CompositeConstruct 73 74 75 28 + 77: 6(float) CompositeExtract 76 3 + 78: 6(float) ImageSampleDrefImplicitLod 70 76 77 + Store 63(r30) 78 + 83: 80 Load 82(g_tTex2di4a) + 84: 18 Load 20(g_sSamp) + 86: 85 SampledImage 83 84 + 87: 6(float) CompositeExtract 72 0 + 88: 6(float) CompositeExtract 72 1 + 89: 6(float) CompositeExtract 72 2 + 90: 7(fvec4) CompositeConstruct 87 88 89 28 + 91: 6(float) CompositeExtract 90 3 + 92: 6(float) ImageSampleDrefImplicitLod 86 90 91 + Store 79(r32) 92 + 97: 94 Load 96(g_tTex2du4a) + 98: 18 Load 20(g_sSamp) + 100: 99 SampledImage 97 98 + 101: 6(float) CompositeExtract 72 0 + 102: 6(float) CompositeExtract 72 1 + 103: 6(float) CompositeExtract 72 2 + 104: 7(fvec4) CompositeConstruct 101 102 103 28 + 105: 6(float) CompositeExtract 104 3 + 106: 6(float) ImageSampleDrefImplicitLod 100 104 105 + Store 93(r34) 106 + 111: 108 Load 110(g_tTexcdf4a) + 112: 18 Load 20(g_sSamp) + 114: 113 SampledImage 111 112 + 117: 6(float) CompositeExtract 116 0 + 118: 6(float) CompositeExtract 116 1 + 119: 6(float) CompositeExtract 116 2 + 120: 6(float) CompositeExtract 116 3 + 121: 7(fvec4) CompositeConstruct 117 118 119 120 + 122: 6(float) ImageSampleDrefImplicitLod 114 121 28 + Store 107(r60) 122 + 127: 124 Load 126(g_tTexcdi4a) + 128: 18 Load 20(g_sSamp) + 130: 129 SampledImage 127 128 + 131: 6(float) CompositeExtract 116 0 + 132: 6(float) CompositeExtract 116 1 + 133: 6(float) CompositeExtract 116 2 + 134: 6(float) CompositeExtract 116 3 + 135: 7(fvec4) CompositeConstruct 131 132 133 134 + 136: 6(float) ImageSampleDrefImplicitLod 130 135 28 + Store 123(r62) 136 + 141: 138 Load 140(g_tTexcdu4a) + 142: 18 Load 20(g_sSamp) + 144: 143 SampledImage 141 142 + 145: 6(float) CompositeExtract 116 0 + 146: 6(float) CompositeExtract 116 1 + 147: 6(float) CompositeExtract 116 2 + 148: 6(float) CompositeExtract 116 3 + 149: 7(fvec4) CompositeConstruct 145 146 147 148 + 150: 6(float) ImageSampleDrefImplicitLod 144 149 28 + Store 137(r64) 150 + 157: 156(ptr) AccessChain 152(psout) 153 + Store 157 155 + 159: 12(ptr) AccessChain 152(psout) 158 + Store 159 154 + 160:8(PS_OUTPUT) Load 152(psout) + ReturnValue 160 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplecmp.basic.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplecmp.basic.dx10.frag.out new file mode 100644 index 00000000..e8252d38 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplecmp.basic.dx10.frag.out @@ -0,0 +1,676 @@ +hlsl.samplecmp.basic.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Parameters: +0:? Sequence +0:42 Sequence +0:42 move second child to first child ( temp float) +0:42 'r00' ( temp float) +0:42 texture ( temp float) +0:42 Construct combined texture-sampler ( temp sampler1DShadow) +0:42 'g_tTex1df4' (layout( binding=0) uniform texture1DShadow) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:42 Construct vec2 ( temp 2-component vector of float) +0:42 Constant: +0:42 0.100000 +0:42 Constant: +0:42 0.750000 +0:43 Sequence +0:43 move second child to first child ( temp float) +0:43 'r02' ( temp float) +0:43 texture ( temp float) +0:43 Construct combined texture-sampler ( temp isampler1DShadow) +0:43 'g_tTex1di4' ( uniform itexture1DShadow) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:43 Construct vec2 ( temp 2-component vector of float) +0:43 Constant: +0:43 0.100000 +0:43 Constant: +0:43 0.750000 +0:44 Sequence +0:44 move second child to first child ( temp float) +0:44 'r04' ( temp float) +0:44 texture ( temp float) +0:44 Construct combined texture-sampler ( temp usampler1DShadow) +0:44 'g_tTex1du4' ( uniform utexture1DShadow) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:44 Construct vec2 ( temp 2-component vector of float) +0:44 Constant: +0:44 0.100000 +0:44 Constant: +0:44 0.750000 +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'r20' ( temp float) +0:47 texture ( temp float) +0:47 Construct combined texture-sampler ( temp sampler2DShadow) +0:47 'g_tTex2df4' ( uniform texture2DShadow) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:47 Constant: +0:47 0.750000 +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'r22' ( temp float) +0:48 texture ( temp float) +0:48 Construct combined texture-sampler ( temp isampler2DShadow) +0:48 'g_tTex2di4' ( uniform itexture2DShadow) +0:48 'g_sSamp' (layout( binding=0) uniform sampler) +0:48 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:48 Constant: +0:48 0.750000 +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'r24' ( temp float) +0:49 texture ( temp float) +0:49 Construct combined texture-sampler ( temp usampler2DShadow) +0:49 'g_tTex2du4' ( uniform utexture2DShadow) +0:49 'g_sSamp' (layout( binding=0) uniform sampler) +0:49 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:49 Constant: +0:49 0.750000 +0:53 Sequence +0:53 move second child to first child ( temp float) +0:53 'r50' ( temp float) +0:53 texture ( temp float) +0:53 Construct combined texture-sampler ( temp samplerCubeShadow) +0:53 'g_tTexcdf4' ( uniform textureCubeShadow) +0:53 'g_sSamp' (layout( binding=0) uniform sampler) +0:53 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:53 Constant: +0:53 0.750000 +0:54 Sequence +0:54 move second child to first child ( temp float) +0:54 'r52' ( temp float) +0:54 texture ( temp float) +0:54 Construct combined texture-sampler ( temp isamplerCubeShadow) +0:54 'g_tTexcdi4' ( uniform itextureCubeShadow) +0:54 'g_sSamp' (layout( binding=0) uniform sampler) +0:54 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:54 Constant: +0:54 0.750000 +0:55 Sequence +0:55 move second child to first child ( temp float) +0:55 'r54' ( temp float) +0:55 texture ( temp float) +0:55 Construct combined texture-sampler ( temp usamplerCubeShadow) +0:55 'g_tTexcdu4' ( uniform utextureCubeShadow) +0:55 'g_sSamp' (layout( binding=0) uniform sampler) +0:55 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:55 Constant: +0:55 0.750000 +0:57 move second child to first child ( temp 4-component vector of float) +0:57 Color: direct index for structure ( temp 4-component vector of float) +0:57 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1.000000 +0:57 1.000000 +0:57 1.000000 +0:57 1.000000 +0:58 move second child to first child ( temp float) +0:58 Depth: direct index for structure ( temp float) +0:58 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:58 Constant: +0:58 1 (const int) +0:58 Constant: +0:58 1.000000 +0:60 Branch: Return with expression +0:60 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Definition: main( ( temp void) +0:38 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:38 Color: direct index for structure ( temp 4-component vector of float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 0 (const int) +0:38 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:38 Depth: direct index for structure ( temp float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DShadow) +0:? 'g_tTex1di4' ( uniform itexture1DShadow) +0:? 'g_tTex1du4' ( uniform utexture1DShadow) +0:? 'g_tTex2df4' ( uniform texture2DShadow) +0:? 'g_tTex2di4' ( uniform itexture2DShadow) +0:? 'g_tTex2du4' ( uniform utexture2DShadow) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCubeShadow) +0:? 'g_tTexcdi4' ( uniform itextureCubeShadow) +0:? 'g_tTexcdu4' ( uniform utextureCubeShadow) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Parameters: +0:? Sequence +0:42 Sequence +0:42 move second child to first child ( temp float) +0:42 'r00' ( temp float) +0:42 texture ( temp float) +0:42 Construct combined texture-sampler ( temp sampler1DShadow) +0:42 'g_tTex1df4' (layout( binding=0) uniform texture1DShadow) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:42 Construct vec2 ( temp 2-component vector of float) +0:42 Constant: +0:42 0.100000 +0:42 Constant: +0:42 0.750000 +0:43 Sequence +0:43 move second child to first child ( temp float) +0:43 'r02' ( temp float) +0:43 texture ( temp float) +0:43 Construct combined texture-sampler ( temp isampler1DShadow) +0:43 'g_tTex1di4' ( uniform itexture1DShadow) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:43 Construct vec2 ( temp 2-component vector of float) +0:43 Constant: +0:43 0.100000 +0:43 Constant: +0:43 0.750000 +0:44 Sequence +0:44 move second child to first child ( temp float) +0:44 'r04' ( temp float) +0:44 texture ( temp float) +0:44 Construct combined texture-sampler ( temp usampler1DShadow) +0:44 'g_tTex1du4' ( uniform utexture1DShadow) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:44 Construct vec2 ( temp 2-component vector of float) +0:44 Constant: +0:44 0.100000 +0:44 Constant: +0:44 0.750000 +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'r20' ( temp float) +0:47 texture ( temp float) +0:47 Construct combined texture-sampler ( temp sampler2DShadow) +0:47 'g_tTex2df4' ( uniform texture2DShadow) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:47 Constant: +0:47 0.750000 +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'r22' ( temp float) +0:48 texture ( temp float) +0:48 Construct combined texture-sampler ( temp isampler2DShadow) +0:48 'g_tTex2di4' ( uniform itexture2DShadow) +0:48 'g_sSamp' (layout( binding=0) uniform sampler) +0:48 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:48 Constant: +0:48 0.750000 +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'r24' ( temp float) +0:49 texture ( temp float) +0:49 Construct combined texture-sampler ( temp usampler2DShadow) +0:49 'g_tTex2du4' ( uniform utexture2DShadow) +0:49 'g_sSamp' (layout( binding=0) uniform sampler) +0:49 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:49 Constant: +0:49 0.750000 +0:53 Sequence +0:53 move second child to first child ( temp float) +0:53 'r50' ( temp float) +0:53 texture ( temp float) +0:53 Construct combined texture-sampler ( temp samplerCubeShadow) +0:53 'g_tTexcdf4' ( uniform textureCubeShadow) +0:53 'g_sSamp' (layout( binding=0) uniform sampler) +0:53 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:53 Constant: +0:53 0.750000 +0:54 Sequence +0:54 move second child to first child ( temp float) +0:54 'r52' ( temp float) +0:54 texture ( temp float) +0:54 Construct combined texture-sampler ( temp isamplerCubeShadow) +0:54 'g_tTexcdi4' ( uniform itextureCubeShadow) +0:54 'g_sSamp' (layout( binding=0) uniform sampler) +0:54 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:54 Constant: +0:54 0.750000 +0:55 Sequence +0:55 move second child to first child ( temp float) +0:55 'r54' ( temp float) +0:55 texture ( temp float) +0:55 Construct combined texture-sampler ( temp usamplerCubeShadow) +0:55 'g_tTexcdu4' ( uniform utextureCubeShadow) +0:55 'g_sSamp' (layout( binding=0) uniform sampler) +0:55 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:55 Constant: +0:55 0.750000 +0:57 move second child to first child ( temp 4-component vector of float) +0:57 Color: direct index for structure ( temp 4-component vector of float) +0:57 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1.000000 +0:57 1.000000 +0:57 1.000000 +0:57 1.000000 +0:58 move second child to first child ( temp float) +0:58 Depth: direct index for structure ( temp float) +0:58 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:58 Constant: +0:58 1 (const int) +0:58 Constant: +0:58 1.000000 +0:60 Branch: Return with expression +0:60 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Definition: main( ( temp void) +0:38 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:38 Color: direct index for structure ( temp 4-component vector of float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 0 (const int) +0:38 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:38 Depth: direct index for structure ( temp float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DShadow) +0:? 'g_tTex1di4' ( uniform itexture1DShadow) +0:? 'g_tTex1du4' ( uniform utexture1DShadow) +0:? 'g_tTex2df4' ( uniform texture2DShadow) +0:? 'g_tTex2di4' ( uniform itexture2DShadow) +0:? 'g_tTex2du4' ( uniform utexture2DShadow) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCubeShadow) +0:? 'g_tTexcdi4' ( uniform itextureCubeShadow) +0:? 'g_tTexcdu4' ( uniform utextureCubeShadow) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: Expected Image 'Sampled Type' to be the same as Result Type + %41 = OpImageSampleDrefImplicitLod %float %38 %39 %40 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 198 + + Capability Shader + Capability Sampled1D + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 155 159 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "r00" + Name 16 "g_tTex1df4" + Name 20 "g_sSamp" + Name 30 "r02" + Name 34 "g_tTex1di4" + Name 42 "r04" + Name 46 "g_tTex1du4" + Name 54 "r20" + Name 57 "g_tTex2df4" + Name 70 "r22" + Name 73 "g_tTex2di4" + Name 83 "r24" + Name 86 "g_tTex2du4" + Name 96 "r50" + Name 99 "g_tTexcdf4" + Name 112 "r52" + Name 115 "g_tTexcdi4" + Name 126 "r54" + Name 129 "g_tTexcdu4" + Name 141 "psout" + Name 152 "flattenTemp" + Name 155 "@entryPointOutput.Color" + Name 159 "@entryPointOutput.Depth" + Name 164 "g_tTex3df4" + Name 167 "g_tTex3di4" + Name 170 "g_tTex3du4" + Name 173 "g_tTex1df4a" + Name 176 "g_tTex1di4a" + Name 179 "g_tTex1du4a" + Name 182 "g_tTex2df4a" + Name 185 "g_tTex2di4a" + Name 188 "g_tTex2du4a" + Name 191 "g_tTexcdf4a" + Name 194 "g_tTexcdi4a" + Name 197 "g_tTexcdu4a" + Decorate 16(g_tTex1df4) DescriptorSet 0 + Decorate 16(g_tTex1df4) Binding 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 34(g_tTex1di4) DescriptorSet 0 + Decorate 46(g_tTex1du4) DescriptorSet 0 + Decorate 57(g_tTex2df4) DescriptorSet 0 + Decorate 73(g_tTex2di4) DescriptorSet 0 + Decorate 86(g_tTex2du4) DescriptorSet 0 + Decorate 99(g_tTexcdf4) DescriptorSet 0 + Decorate 115(g_tTexcdi4) DescriptorSet 0 + Decorate 129(g_tTexcdu4) DescriptorSet 0 + Decorate 155(@entryPointOutput.Color) Location 0 + Decorate 159(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 164(g_tTex3df4) DescriptorSet 0 + Decorate 167(g_tTex3di4) DescriptorSet 0 + Decorate 170(g_tTex3du4) DescriptorSet 0 + Decorate 173(g_tTex1df4a) DescriptorSet 0 + Decorate 176(g_tTex1di4a) DescriptorSet 0 + Decorate 179(g_tTex1du4a) DescriptorSet 0 + Decorate 182(g_tTex2df4a) DescriptorSet 0 + Decorate 185(g_tTex2di4a) DescriptorSet 0 + Decorate 188(g_tTex2du4a) DescriptorSet 0 + Decorate 191(g_tTexcdf4a) DescriptorSet 0 + Decorate 194(g_tTexcdi4a) DescriptorSet 0 + Decorate 197(g_tTexcdu4a) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 6(float) + 14: TypeImage 6(float) 1D depth sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: 6(float) Constant 1036831949 + 25: 6(float) Constant 1061158912 + 26: TypeVector 6(float) 2 + 31: TypeInt 32 1 + 32: TypeImage 31(int) 1D depth sampled format:Unknown + 33: TypePointer UniformConstant 32 + 34(g_tTex1di4): 33(ptr) Variable UniformConstant + 37: TypeSampledImage 32 + 43: TypeInt 32 0 + 44: TypeImage 43(int) 1D depth sampled format:Unknown + 45: TypePointer UniformConstant 44 + 46(g_tTex1du4): 45(ptr) Variable UniformConstant + 49: TypeSampledImage 44 + 55: TypeImage 6(float) 2D depth sampled format:Unknown + 56: TypePointer UniformConstant 55 + 57(g_tTex2df4): 56(ptr) Variable UniformConstant + 60: TypeSampledImage 55 + 62: 6(float) Constant 1045220557 + 63: 26(fvec2) ConstantComposite 24 62 + 64: TypeVector 6(float) 3 + 71: TypeImage 31(int) 2D depth sampled format:Unknown + 72: TypePointer UniformConstant 71 + 73(g_tTex2di4): 72(ptr) Variable UniformConstant + 76: TypeSampledImage 71 + 84: TypeImage 43(int) 2D depth sampled format:Unknown + 85: TypePointer UniformConstant 84 + 86(g_tTex2du4): 85(ptr) Variable UniformConstant + 89: TypeSampledImage 84 + 97: TypeImage 6(float) Cube depth sampled format:Unknown + 98: TypePointer UniformConstant 97 + 99(g_tTexcdf4): 98(ptr) Variable UniformConstant + 102: TypeSampledImage 97 + 104: 6(float) Constant 1050253722 + 105: 64(fvec3) ConstantComposite 24 62 104 + 113: TypeImage 31(int) Cube depth sampled format:Unknown + 114: TypePointer UniformConstant 113 + 115(g_tTexcdi4): 114(ptr) Variable UniformConstant + 118: TypeSampledImage 113 + 127: TypeImage 43(int) Cube depth sampled format:Unknown + 128: TypePointer UniformConstant 127 + 129(g_tTexcdu4): 128(ptr) Variable UniformConstant + 132: TypeSampledImage 127 + 140: TypePointer Function 8(PS_OUTPUT) + 142: 31(int) Constant 0 + 143: 6(float) Constant 1065353216 + 144: 7(fvec4) ConstantComposite 143 143 143 143 + 145: TypePointer Function 7(fvec4) + 147: 31(int) Constant 1 + 154: TypePointer Output 7(fvec4) +155(@entryPointOutput.Color): 154(ptr) Variable Output + 158: TypePointer Output 6(float) +159(@entryPointOutput.Depth): 158(ptr) Variable Output + 162: TypeImage 6(float) 3D sampled format:Unknown + 163: TypePointer UniformConstant 162 + 164(g_tTex3df4): 163(ptr) Variable UniformConstant + 165: TypeImage 31(int) 3D sampled format:Unknown + 166: TypePointer UniformConstant 165 + 167(g_tTex3di4): 166(ptr) Variable UniformConstant + 168: TypeImage 43(int) 3D sampled format:Unknown + 169: TypePointer UniformConstant 168 + 170(g_tTex3du4): 169(ptr) Variable UniformConstant + 171: TypeImage 6(float) 1D array sampled format:Unknown + 172: TypePointer UniformConstant 171 +173(g_tTex1df4a): 172(ptr) Variable UniformConstant + 174: TypeImage 31(int) 1D array sampled format:Unknown + 175: TypePointer UniformConstant 174 +176(g_tTex1di4a): 175(ptr) Variable UniformConstant + 177: TypeImage 43(int) 1D array sampled format:Unknown + 178: TypePointer UniformConstant 177 +179(g_tTex1du4a): 178(ptr) Variable UniformConstant + 180: TypeImage 6(float) 2D array sampled format:Unknown + 181: TypePointer UniformConstant 180 +182(g_tTex2df4a): 181(ptr) Variable UniformConstant + 183: TypeImage 31(int) 2D array sampled format:Unknown + 184: TypePointer UniformConstant 183 +185(g_tTex2di4a): 184(ptr) Variable UniformConstant + 186: TypeImage 43(int) 2D array sampled format:Unknown + 187: TypePointer UniformConstant 186 +188(g_tTex2du4a): 187(ptr) Variable UniformConstant + 189: TypeImage 6(float) Cube array sampled format:Unknown + 190: TypePointer UniformConstant 189 +191(g_tTexcdf4a): 190(ptr) Variable UniformConstant + 192: TypeImage 31(int) Cube array sampled format:Unknown + 193: TypePointer UniformConstant 192 +194(g_tTexcdi4a): 193(ptr) Variable UniformConstant + 195: TypeImage 43(int) Cube array sampled format:Unknown + 196: TypePointer UniformConstant 195 +197(g_tTexcdu4a): 196(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +152(flattenTemp): 140(ptr) Variable Function + 153:8(PS_OUTPUT) FunctionCall 10(@main() + Store 152(flattenTemp) 153 + 156: 145(ptr) AccessChain 152(flattenTemp) 142 + 157: 7(fvec4) Load 156 + Store 155(@entryPointOutput.Color) 157 + 160: 12(ptr) AccessChain 152(flattenTemp) 147 + 161: 6(float) Load 160 + Store 159(@entryPointOutput.Depth) 161 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(r00): 12(ptr) Variable Function + 30(r02): 12(ptr) Variable Function + 42(r04): 12(ptr) Variable Function + 54(r20): 12(ptr) Variable Function + 70(r22): 12(ptr) Variable Function + 83(r24): 12(ptr) Variable Function + 96(r50): 12(ptr) Variable Function + 112(r52): 12(ptr) Variable Function + 126(r54): 12(ptr) Variable Function + 141(psout): 140(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 27: 26(fvec2) CompositeConstruct 24 25 + 28: 6(float) CompositeExtract 27 1 + 29: 6(float) ImageSampleDrefImplicitLod 23 27 28 + Store 13(r00) 29 + 35: 32 Load 34(g_tTex1di4) + 36: 18 Load 20(g_sSamp) + 38: 37 SampledImage 35 36 + 39: 26(fvec2) CompositeConstruct 24 25 + 40: 6(float) CompositeExtract 39 1 + 41: 6(float) ImageSampleDrefImplicitLod 38 39 40 + Store 30(r02) 41 + 47: 44 Load 46(g_tTex1du4) + 48: 18 Load 20(g_sSamp) + 50: 49 SampledImage 47 48 + 51: 26(fvec2) CompositeConstruct 24 25 + 52: 6(float) CompositeExtract 51 1 + 53: 6(float) ImageSampleDrefImplicitLod 50 51 52 + Store 42(r04) 53 + 58: 55 Load 57(g_tTex2df4) + 59: 18 Load 20(g_sSamp) + 61: 60 SampledImage 58 59 + 65: 6(float) CompositeExtract 63 0 + 66: 6(float) CompositeExtract 63 1 + 67: 64(fvec3) CompositeConstruct 65 66 25 + 68: 6(float) CompositeExtract 67 2 + 69: 6(float) ImageSampleDrefImplicitLod 61 67 68 + Store 54(r20) 69 + 74: 71 Load 73(g_tTex2di4) + 75: 18 Load 20(g_sSamp) + 77: 76 SampledImage 74 75 + 78: 6(float) CompositeExtract 63 0 + 79: 6(float) CompositeExtract 63 1 + 80: 64(fvec3) CompositeConstruct 78 79 25 + 81: 6(float) CompositeExtract 80 2 + 82: 6(float) ImageSampleDrefImplicitLod 77 80 81 + Store 70(r22) 82 + 87: 84 Load 86(g_tTex2du4) + 88: 18 Load 20(g_sSamp) + 90: 89 SampledImage 87 88 + 91: 6(float) CompositeExtract 63 0 + 92: 6(float) CompositeExtract 63 1 + 93: 64(fvec3) CompositeConstruct 91 92 25 + 94: 6(float) CompositeExtract 93 2 + 95: 6(float) ImageSampleDrefImplicitLod 90 93 94 + Store 83(r24) 95 + 100: 97 Load 99(g_tTexcdf4) + 101: 18 Load 20(g_sSamp) + 103: 102 SampledImage 100 101 + 106: 6(float) CompositeExtract 105 0 + 107: 6(float) CompositeExtract 105 1 + 108: 6(float) CompositeExtract 105 2 + 109: 7(fvec4) CompositeConstruct 106 107 108 25 + 110: 6(float) CompositeExtract 109 3 + 111: 6(float) ImageSampleDrefImplicitLod 103 109 110 + Store 96(r50) 111 + 116: 113 Load 115(g_tTexcdi4) + 117: 18 Load 20(g_sSamp) + 119: 118 SampledImage 116 117 + 120: 6(float) CompositeExtract 105 0 + 121: 6(float) CompositeExtract 105 1 + 122: 6(float) CompositeExtract 105 2 + 123: 7(fvec4) CompositeConstruct 120 121 122 25 + 124: 6(float) CompositeExtract 123 3 + 125: 6(float) ImageSampleDrefImplicitLod 119 123 124 + Store 112(r52) 125 + 130: 127 Load 129(g_tTexcdu4) + 131: 18 Load 20(g_sSamp) + 133: 132 SampledImage 130 131 + 134: 6(float) CompositeExtract 105 0 + 135: 6(float) CompositeExtract 105 1 + 136: 6(float) CompositeExtract 105 2 + 137: 7(fvec4) CompositeConstruct 134 135 136 25 + 138: 6(float) CompositeExtract 137 3 + 139: 6(float) ImageSampleDrefImplicitLod 133 137 138 + Store 126(r54) 139 + 146: 145(ptr) AccessChain 141(psout) 142 + Store 146 144 + 148: 12(ptr) AccessChain 141(psout) 147 + Store 148 143 + 149:8(PS_OUTPUT) Load 141(psout) + ReturnValue 149 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplecmp.dualmode.frag.out b/deps/glslang/Test/baseResults/hlsl.samplecmp.dualmode.frag.out new file mode 100644 index 00000000..7bcf0852 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplecmp.dualmode.frag.out @@ -0,0 +1,157 @@ +hlsl.samplecmp.dualmode.frag +WARNING: AST will form illegal SPIR-V; need to transform to legalize +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main( ( temp 4-component vector of float) +0:7 Function Parameters: +0:? Sequence +0:10 texture ( temp float) +0:10 Construct combined texture-sampler ( temp sampler1DShadow) +0:10 'g_tTex' (layout( binding=3) uniform texture1DShadow) +0:10 'g_sSampCmp' (layout( binding=1) uniform sampler) +0:10 Construct vec2 ( temp 2-component vector of float) +0:10 Constant: +0:10 0.100000 +0:10 Constant: +0:10 0.750000 +0:11 texture ( temp 4-component vector of float) +0:11 Construct combined texture-sampler ( temp sampler1D) +0:11 'g_tTex' (layout( binding=3) uniform texture1D) +0:11 'g_sSamp' (layout( binding=0) uniform sampler) +0:11 Constant: +0:11 0.100000 +0:13 Branch: Return with expression +0:13 Constant: +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_sSampCmp' (layout( binding=1) uniform sampler) +0:? 'g_tTex' (layout( binding=3) uniform texture1DShadow) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'g_tTex' (layout( binding=3) uniform texture1D) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main( ( temp 4-component vector of float) +0:7 Function Parameters: +0:? Sequence +0:10 texture ( temp float) +0:10 Construct combined texture-sampler ( temp sampler1DShadow) +0:10 'g_tTex' (layout( binding=3) uniform texture1DShadow) +0:10 'g_sSampCmp' (layout( binding=1) uniform sampler) +0:10 Construct vec2 ( temp 2-component vector of float) +0:10 Constant: +0:10 0.100000 +0:10 Constant: +0:10 0.750000 +0:11 texture ( temp 4-component vector of float) +0:11 Construct combined texture-sampler ( temp sampler1D) +0:11 'g_tTex' (layout( binding=3) uniform texture1D) +0:11 'g_sSamp' (layout( binding=0) uniform sampler) +0:11 Constant: +0:11 0.100000 +0:13 Branch: Return with expression +0:13 Constant: +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_sSampCmp' (layout( binding=1) uniform sampler) +0:? 'g_tTex' (layout( binding=3) uniform texture1DShadow) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'g_tTex' (layout( binding=3) uniform texture1D) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 43 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 41 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 13 "g_tTex" + Name 17 "g_sSampCmp" + Name 29 "g_tTex" + Name 31 "g_sSamp" + Name 41 "@entryPointOutput" + Decorate 13(g_tTex) DescriptorSet 0 + Decorate 13(g_tTex) Binding 3 + Decorate 17(g_sSampCmp) DescriptorSet 0 + Decorate 17(g_sSampCmp) Binding 1 + Decorate 29(g_tTex) DescriptorSet 0 + Decorate 29(g_tTex) Binding 3 + Decorate 31(g_sSamp) DescriptorSet 0 + Decorate 31(g_sSamp) Binding 0 + Decorate 41(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeImage 6(float) 1D depth sampled format:Unknown + 12: TypePointer UniformConstant 11 + 13(g_tTex): 12(ptr) Variable UniformConstant + 15: TypeSampler + 16: TypePointer UniformConstant 15 + 17(g_sSampCmp): 16(ptr) Variable UniformConstant + 19: TypeSampledImage 11 + 21: 6(float) Constant 1036831949 + 22: 6(float) Constant 1061158912 + 23: TypeVector 6(float) 2 + 27: TypeImage 6(float) 1D sampled format:Unknown + 28: TypePointer UniformConstant 27 + 29(g_tTex): 28(ptr) Variable UniformConstant + 31(g_sSamp): 16(ptr) Variable UniformConstant + 33: TypeSampledImage 27 + 36: 6(float) Constant 0 + 37: 7(fvec4) ConstantComposite 36 36 36 36 + 40: TypePointer Output 7(fvec4) +41(@entryPointOutput): 40(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 42: 7(fvec4) FunctionCall 9(@main() + Store 41(@entryPointOutput) 42 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 14: 11 Load 13(g_tTex) + 18: 15 Load 17(g_sSampCmp) + 20: 19 SampledImage 14 18 + 24: 23(fvec2) CompositeConstruct 21 22 + 25: 6(float) CompositeExtract 24 1 + 26: 6(float) ImageSampleDrefImplicitLod 20 24 25 + 30: 27 Load 29(g_tTex) + 32: 15 Load 31(g_sSamp) + 34: 33 SampledImage 30 32 + 35: 7(fvec4) ImageSampleImplicitLod 34 21 + ReturnValue 37 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplecmp.negative.frag.out b/deps/glslang/Test/baseResults/hlsl.samplecmp.negative.frag.out new file mode 100644 index 00000000..65a69e8f --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplecmp.negative.frag.out @@ -0,0 +1,98 @@ +hlsl.samplecmp.negative.frag +ERROR: 0:10: '' : expected: SamplerComparisonState +ERROR: 1 compilation errors. No code generated. + + +Shader version: 500 +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:8 Function Definition: @main( ( temp 4-component vector of float) +0:8 Function Parameters: +0:? Sequence +0:9 texture ( temp float) +0:9 Construct combined texture-sampler ( temp sampler2DShadow) +0:9 'g_shadowTex' ( uniform texture2DShadow) +0:9 'g_shadowSamplerComp' ( uniform sampler) +0:9 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:9 Constant: +0:9 0.000000 +0:10 ERROR: Bad aggregation op + ( temp float) +0:10 'g_nonShadowTex' ( uniform texture2D) +0:10 'g_shadowSampler' ( uniform sampler) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:10 Constant: +0:10 0.000000 +0:12 Branch: Return with expression +0:12 Constant: +0:12 0.000000 +0:12 0.000000 +0:12 0.000000 +0:12 0.000000 +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:8 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_nonShadowTex' ( uniform texture2D) +0:? 'g_shadowTex' ( uniform texture2DShadow) +0:? 'g_shadowSampler' ( uniform sampler) +0:? 'g_shadowSamplerComp' ( uniform sampler) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:8 Function Definition: @main( ( temp 4-component vector of float) +0:8 Function Parameters: +0:? Sequence +0:9 texture ( temp float) +0:9 Construct combined texture-sampler ( temp sampler2DShadow) +0:9 'g_shadowTex' ( uniform texture2DShadow) +0:9 'g_shadowSamplerComp' ( uniform sampler) +0:9 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:9 Constant: +0:9 0.000000 +0:10 ERROR: Bad aggregation op + ( temp float) +0:10 'g_nonShadowTex' ( uniform texture2D) +0:10 'g_shadowSampler' ( uniform sampler) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:10 Constant: +0:10 0.000000 +0:12 Branch: Return with expression +0:12 Constant: +0:12 0.000000 +0:12 0.000000 +0:12 0.000000 +0:12 0.000000 +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:8 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_nonShadowTex' ( uniform texture2D) +0:? 'g_shadowTex' ( uniform texture2DShadow) +0:? 'g_shadowSampler' ( uniform sampler) +0:? 'g_shadowSamplerComp' ( uniform sampler) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/hlsl.samplecmp.negative2.frag.out b/deps/glslang/Test/baseResults/hlsl.samplecmp.negative2.frag.out new file mode 100644 index 00000000..996b3f87 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplecmp.negative2.frag.out @@ -0,0 +1,80 @@ +hlsl.samplecmp.negative2.frag +ERROR: 0:7: '' : expected: SamplerComparisonState +ERROR: 1 compilation errors. No code generated. + + +Shader version: 500 +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:6 Function Definition: @main( ( temp 4-component vector of float) +0:6 Function Parameters: +0:? Sequence +0:7 ERROR: Bad aggregation op + ( temp 4-component vector of float) +0:7 'g_shadowTex' ( uniform texture2D) +0:7 'g_shadowSampler' ( uniform sampler) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:7 Constant: +0:7 0.000000 +0:? Constant: +0:? 0 (const int) +0:? 0 (const int) +0:9 Branch: Return with expression +0:9 Constant: +0:9 0.000000 +0:9 0.000000 +0:9 0.000000 +0:9 0.000000 +0:6 Function Definition: main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:6 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_shadowTex' ( uniform texture2D) +0:? 'g_shadowSampler' ( uniform sampler) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:6 Function Definition: @main( ( temp 4-component vector of float) +0:6 Function Parameters: +0:? Sequence +0:7 ERROR: Bad aggregation op + ( temp 4-component vector of float) +0:7 'g_shadowTex' ( uniform texture2D) +0:7 'g_shadowSampler' ( uniform sampler) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:7 Constant: +0:7 0.000000 +0:? Constant: +0:? 0 (const int) +0:? 0 (const int) +0:9 Branch: Return with expression +0:9 Constant: +0:9 0.000000 +0:9 0.000000 +0:9 0.000000 +0:9 0.000000 +0:6 Function Definition: main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:6 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_shadowTex' ( uniform texture2D) +0:? 'g_shadowSampler' ( uniform sampler) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/hlsl.samplecmp.offset.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplecmp.offset.dx10.frag.out new file mode 100644 index 00000000..cb4ce390 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplecmp.offset.dx10.frag.out @@ -0,0 +1,585 @@ +hlsl.samplecmp.offset.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Parameters: +0:? Sequence +0:42 Sequence +0:42 move second child to first child ( temp float) +0:42 'r01' ( temp float) +0:42 textureOffset ( temp float) +0:42 Construct combined texture-sampler ( temp sampler1DShadow) +0:42 'g_tTex1df4' (layout( binding=0) uniform texture1DShadow) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:42 Construct vec2 ( temp 2-component vector of float) +0:42 Constant: +0:42 0.100000 +0:42 Constant: +0:42 0.750000 +0:42 Constant: +0:42 2 (const int) +0:43 Sequence +0:43 move second child to first child ( temp float) +0:43 'r03' ( temp float) +0:43 textureOffset ( temp float) +0:43 Construct combined texture-sampler ( temp isampler1DShadow) +0:43 'g_tTex1di4' ( uniform itexture1DShadow) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:43 Construct vec2 ( temp 2-component vector of float) +0:43 Constant: +0:43 0.100000 +0:43 Constant: +0:43 0.750000 +0:43 Constant: +0:43 2 (const int) +0:44 Sequence +0:44 move second child to first child ( temp float) +0:44 'r05' ( temp float) +0:44 textureOffset ( temp float) +0:44 Construct combined texture-sampler ( temp usampler1DShadow) +0:44 'g_tTex1du4' ( uniform utexture1DShadow) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:44 Construct vec2 ( temp 2-component vector of float) +0:44 Constant: +0:44 0.100000 +0:44 Constant: +0:44 0.750000 +0:44 Constant: +0:44 2 (const int) +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'r21' ( temp float) +0:47 textureOffset ( temp float) +0:47 Construct combined texture-sampler ( temp sampler2DShadow) +0:47 'g_tTex2df4' ( uniform texture2DShadow) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:47 Constant: +0:47 0.750000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'r23' ( temp float) +0:48 textureOffset ( temp float) +0:48 Construct combined texture-sampler ( temp isampler2DShadow) +0:48 'g_tTex2di4' ( uniform itexture2DShadow) +0:48 'g_sSamp' (layout( binding=0) uniform sampler) +0:48 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:48 Constant: +0:48 0.750000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'r25' ( temp float) +0:49 textureOffset ( temp float) +0:49 Construct combined texture-sampler ( temp usampler2DShadow) +0:49 'g_tTex2du4' ( uniform utexture2DShadow) +0:49 'g_sSamp' (layout( binding=0) uniform sampler) +0:49 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:49 Constant: +0:49 0.750000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:62 move second child to first child ( temp 4-component vector of float) +0:62 Color: direct index for structure ( temp 4-component vector of float) +0:62 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1.000000 +0:62 1.000000 +0:62 1.000000 +0:62 1.000000 +0:63 move second child to first child ( temp float) +0:63 Depth: direct index for structure ( temp float) +0:63 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:63 Constant: +0:63 1 (const int) +0:63 Constant: +0:63 1.000000 +0:65 Branch: Return with expression +0:65 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Definition: main( ( temp void) +0:38 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:38 Color: direct index for structure ( temp 4-component vector of float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 0 (const int) +0:38 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:38 Depth: direct index for structure ( temp float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DShadow) +0:? 'g_tTex1di4' ( uniform itexture1DShadow) +0:? 'g_tTex1du4' ( uniform utexture1DShadow) +0:? 'g_tTex2df4' ( uniform texture2DShadow) +0:? 'g_tTex2di4' ( uniform itexture2DShadow) +0:? 'g_tTex2du4' ( uniform utexture2DShadow) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Parameters: +0:? Sequence +0:42 Sequence +0:42 move second child to first child ( temp float) +0:42 'r01' ( temp float) +0:42 textureOffset ( temp float) +0:42 Construct combined texture-sampler ( temp sampler1DShadow) +0:42 'g_tTex1df4' (layout( binding=0) uniform texture1DShadow) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:42 Construct vec2 ( temp 2-component vector of float) +0:42 Constant: +0:42 0.100000 +0:42 Constant: +0:42 0.750000 +0:42 Constant: +0:42 2 (const int) +0:43 Sequence +0:43 move second child to first child ( temp float) +0:43 'r03' ( temp float) +0:43 textureOffset ( temp float) +0:43 Construct combined texture-sampler ( temp isampler1DShadow) +0:43 'g_tTex1di4' ( uniform itexture1DShadow) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:43 Construct vec2 ( temp 2-component vector of float) +0:43 Constant: +0:43 0.100000 +0:43 Constant: +0:43 0.750000 +0:43 Constant: +0:43 2 (const int) +0:44 Sequence +0:44 move second child to first child ( temp float) +0:44 'r05' ( temp float) +0:44 textureOffset ( temp float) +0:44 Construct combined texture-sampler ( temp usampler1DShadow) +0:44 'g_tTex1du4' ( uniform utexture1DShadow) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:44 Construct vec2 ( temp 2-component vector of float) +0:44 Constant: +0:44 0.100000 +0:44 Constant: +0:44 0.750000 +0:44 Constant: +0:44 2 (const int) +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'r21' ( temp float) +0:47 textureOffset ( temp float) +0:47 Construct combined texture-sampler ( temp sampler2DShadow) +0:47 'g_tTex2df4' ( uniform texture2DShadow) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:47 Constant: +0:47 0.750000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'r23' ( temp float) +0:48 textureOffset ( temp float) +0:48 Construct combined texture-sampler ( temp isampler2DShadow) +0:48 'g_tTex2di4' ( uniform itexture2DShadow) +0:48 'g_sSamp' (layout( binding=0) uniform sampler) +0:48 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:48 Constant: +0:48 0.750000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'r25' ( temp float) +0:49 textureOffset ( temp float) +0:49 Construct combined texture-sampler ( temp usampler2DShadow) +0:49 'g_tTex2du4' ( uniform utexture2DShadow) +0:49 'g_sSamp' (layout( binding=0) uniform sampler) +0:49 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:49 Constant: +0:49 0.750000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:62 move second child to first child ( temp 4-component vector of float) +0:62 Color: direct index for structure ( temp 4-component vector of float) +0:62 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1.000000 +0:62 1.000000 +0:62 1.000000 +0:62 1.000000 +0:63 move second child to first child ( temp float) +0:63 Depth: direct index for structure ( temp float) +0:63 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:63 Constant: +0:63 1 (const int) +0:63 Constant: +0:63 1.000000 +0:65 Branch: Return with expression +0:65 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Definition: main( ( temp void) +0:38 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:38 Color: direct index for structure ( temp 4-component vector of float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 0 (const int) +0:38 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:38 Depth: direct index for structure ( temp float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DShadow) +0:? 'g_tTex1di4' ( uniform itexture1DShadow) +0:? 'g_tTex1du4' ( uniform utexture1DShadow) +0:? 'g_tTex2df4' ( uniform texture2DShadow) +0:? 'g_tTex2di4' ( uniform itexture2DShadow) +0:? 'g_tTex2du4' ( uniform utexture2DShadow) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: Expected Image 'Sampled Type' to be the same as Result Type + %42 = OpImageSampleDrefImplicitLod %float %39 %40 %41 ConstOffset %int_2 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 167 + + Capability Shader + Capability Sampled1D + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 115 119 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "r01" + Name 16 "g_tTex1df4" + Name 20 "g_sSamp" + Name 32 "r03" + Name 35 "g_tTex1di4" + Name 43 "r05" + Name 47 "g_tTex1du4" + Name 55 "r21" + Name 58 "g_tTex2df4" + Name 74 "r23" + Name 77 "g_tTex2di4" + Name 87 "r25" + Name 90 "g_tTex2du4" + Name 101 "psout" + Name 112 "flattenTemp" + Name 115 "@entryPointOutput.Color" + Name 119 "@entryPointOutput.Depth" + Name 124 "g_tTex3df4" + Name 127 "g_tTex3di4" + Name 130 "g_tTex3du4" + Name 133 "g_tTexcdf4" + Name 136 "g_tTexcdi4" + Name 139 "g_tTexcdu4" + Name 142 "g_tTex1df4a" + Name 145 "g_tTex1di4a" + Name 148 "g_tTex1du4a" + Name 151 "g_tTex2df4a" + Name 154 "g_tTex2di4a" + Name 157 "g_tTex2du4a" + Name 160 "g_tTexcdf4a" + Name 163 "g_tTexcdi4a" + Name 166 "g_tTexcdu4a" + Decorate 16(g_tTex1df4) DescriptorSet 0 + Decorate 16(g_tTex1df4) Binding 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 35(g_tTex1di4) DescriptorSet 0 + Decorate 47(g_tTex1du4) DescriptorSet 0 + Decorate 58(g_tTex2df4) DescriptorSet 0 + Decorate 77(g_tTex2di4) DescriptorSet 0 + Decorate 90(g_tTex2du4) DescriptorSet 0 + Decorate 115(@entryPointOutput.Color) Location 0 + Decorate 119(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 124(g_tTex3df4) DescriptorSet 0 + Decorate 127(g_tTex3di4) DescriptorSet 0 + Decorate 130(g_tTex3du4) DescriptorSet 0 + Decorate 133(g_tTexcdf4) DescriptorSet 0 + Decorate 136(g_tTexcdi4) DescriptorSet 0 + Decorate 139(g_tTexcdu4) DescriptorSet 0 + Decorate 142(g_tTex1df4a) DescriptorSet 0 + Decorate 145(g_tTex1di4a) DescriptorSet 0 + Decorate 148(g_tTex1du4a) DescriptorSet 0 + Decorate 151(g_tTex2df4a) DescriptorSet 0 + Decorate 154(g_tTex2di4a) DescriptorSet 0 + Decorate 157(g_tTex2du4a) DescriptorSet 0 + Decorate 160(g_tTexcdf4a) DescriptorSet 0 + Decorate 163(g_tTexcdi4a) DescriptorSet 0 + Decorate 166(g_tTexcdu4a) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 6(float) + 14: TypeImage 6(float) 1D depth sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: 6(float) Constant 1036831949 + 25: 6(float) Constant 1061158912 + 26: TypeVector 6(float) 2 + 28: TypeInt 32 1 + 29: 28(int) Constant 2 + 33: TypeImage 28(int) 1D depth sampled format:Unknown + 34: TypePointer UniformConstant 33 + 35(g_tTex1di4): 34(ptr) Variable UniformConstant + 38: TypeSampledImage 33 + 44: TypeInt 32 0 + 45: TypeImage 44(int) 1D depth sampled format:Unknown + 46: TypePointer UniformConstant 45 + 47(g_tTex1du4): 46(ptr) Variable UniformConstant + 50: TypeSampledImage 45 + 56: TypeImage 6(float) 2D depth sampled format:Unknown + 57: TypePointer UniformConstant 56 + 58(g_tTex2df4): 57(ptr) Variable UniformConstant + 61: TypeSampledImage 56 + 63: 6(float) Constant 1045220557 + 64: 26(fvec2) ConstantComposite 24 63 + 65: TypeVector 6(float) 3 + 69: TypeVector 28(int) 2 + 70: 28(int) Constant 3 + 71: 69(ivec2) ConstantComposite 29 70 + 75: TypeImage 28(int) 2D depth sampled format:Unknown + 76: TypePointer UniformConstant 75 + 77(g_tTex2di4): 76(ptr) Variable UniformConstant + 80: TypeSampledImage 75 + 88: TypeImage 44(int) 2D depth sampled format:Unknown + 89: TypePointer UniformConstant 88 + 90(g_tTex2du4): 89(ptr) Variable UniformConstant + 93: TypeSampledImage 88 + 100: TypePointer Function 8(PS_OUTPUT) + 102: 28(int) Constant 0 + 103: 6(float) Constant 1065353216 + 104: 7(fvec4) ConstantComposite 103 103 103 103 + 105: TypePointer Function 7(fvec4) + 107: 28(int) Constant 1 + 114: TypePointer Output 7(fvec4) +115(@entryPointOutput.Color): 114(ptr) Variable Output + 118: TypePointer Output 6(float) +119(@entryPointOutput.Depth): 118(ptr) Variable Output + 122: TypeImage 6(float) 3D sampled format:Unknown + 123: TypePointer UniformConstant 122 + 124(g_tTex3df4): 123(ptr) Variable UniformConstant + 125: TypeImage 28(int) 3D sampled format:Unknown + 126: TypePointer UniformConstant 125 + 127(g_tTex3di4): 126(ptr) Variable UniformConstant + 128: TypeImage 44(int) 3D sampled format:Unknown + 129: TypePointer UniformConstant 128 + 130(g_tTex3du4): 129(ptr) Variable UniformConstant + 131: TypeImage 6(float) Cube sampled format:Unknown + 132: TypePointer UniformConstant 131 + 133(g_tTexcdf4): 132(ptr) Variable UniformConstant + 134: TypeImage 28(int) Cube sampled format:Unknown + 135: TypePointer UniformConstant 134 + 136(g_tTexcdi4): 135(ptr) Variable UniformConstant + 137: TypeImage 44(int) Cube sampled format:Unknown + 138: TypePointer UniformConstant 137 + 139(g_tTexcdu4): 138(ptr) Variable UniformConstant + 140: TypeImage 6(float) 1D array sampled format:Unknown + 141: TypePointer UniformConstant 140 +142(g_tTex1df4a): 141(ptr) Variable UniformConstant + 143: TypeImage 28(int) 1D array sampled format:Unknown + 144: TypePointer UniformConstant 143 +145(g_tTex1di4a): 144(ptr) Variable UniformConstant + 146: TypeImage 44(int) 1D array sampled format:Unknown + 147: TypePointer UniformConstant 146 +148(g_tTex1du4a): 147(ptr) Variable UniformConstant + 149: TypeImage 6(float) 2D array sampled format:Unknown + 150: TypePointer UniformConstant 149 +151(g_tTex2df4a): 150(ptr) Variable UniformConstant + 152: TypeImage 28(int) 2D array sampled format:Unknown + 153: TypePointer UniformConstant 152 +154(g_tTex2di4a): 153(ptr) Variable UniformConstant + 155: TypeImage 44(int) 2D array sampled format:Unknown + 156: TypePointer UniformConstant 155 +157(g_tTex2du4a): 156(ptr) Variable UniformConstant + 158: TypeImage 6(float) Cube array sampled format:Unknown + 159: TypePointer UniformConstant 158 +160(g_tTexcdf4a): 159(ptr) Variable UniformConstant + 161: TypeImage 28(int) Cube array sampled format:Unknown + 162: TypePointer UniformConstant 161 +163(g_tTexcdi4a): 162(ptr) Variable UniformConstant + 164: TypeImage 44(int) Cube array sampled format:Unknown + 165: TypePointer UniformConstant 164 +166(g_tTexcdu4a): 165(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +112(flattenTemp): 100(ptr) Variable Function + 113:8(PS_OUTPUT) FunctionCall 10(@main() + Store 112(flattenTemp) 113 + 116: 105(ptr) AccessChain 112(flattenTemp) 102 + 117: 7(fvec4) Load 116 + Store 115(@entryPointOutput.Color) 117 + 120: 12(ptr) AccessChain 112(flattenTemp) 107 + 121: 6(float) Load 120 + Store 119(@entryPointOutput.Depth) 121 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(r01): 12(ptr) Variable Function + 32(r03): 12(ptr) Variable Function + 43(r05): 12(ptr) Variable Function + 55(r21): 12(ptr) Variable Function + 74(r23): 12(ptr) Variable Function + 87(r25): 12(ptr) Variable Function + 101(psout): 100(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 27: 26(fvec2) CompositeConstruct 24 25 + 30: 6(float) CompositeExtract 27 1 + 31: 6(float) ImageSampleDrefImplicitLod 23 27 30 ConstOffset 29 + Store 13(r01) 31 + 36: 33 Load 35(g_tTex1di4) + 37: 18 Load 20(g_sSamp) + 39: 38 SampledImage 36 37 + 40: 26(fvec2) CompositeConstruct 24 25 + 41: 6(float) CompositeExtract 40 1 + 42: 6(float) ImageSampleDrefImplicitLod 39 40 41 ConstOffset 29 + Store 32(r03) 42 + 48: 45 Load 47(g_tTex1du4) + 49: 18 Load 20(g_sSamp) + 51: 50 SampledImage 48 49 + 52: 26(fvec2) CompositeConstruct 24 25 + 53: 6(float) CompositeExtract 52 1 + 54: 6(float) ImageSampleDrefImplicitLod 51 52 53 ConstOffset 29 + Store 43(r05) 54 + 59: 56 Load 58(g_tTex2df4) + 60: 18 Load 20(g_sSamp) + 62: 61 SampledImage 59 60 + 66: 6(float) CompositeExtract 64 0 + 67: 6(float) CompositeExtract 64 1 + 68: 65(fvec3) CompositeConstruct 66 67 25 + 72: 6(float) CompositeExtract 68 2 + 73: 6(float) ImageSampleDrefImplicitLod 62 68 72 ConstOffset 71 + Store 55(r21) 73 + 78: 75 Load 77(g_tTex2di4) + 79: 18 Load 20(g_sSamp) + 81: 80 SampledImage 78 79 + 82: 6(float) CompositeExtract 64 0 + 83: 6(float) CompositeExtract 64 1 + 84: 65(fvec3) CompositeConstruct 82 83 25 + 85: 6(float) CompositeExtract 84 2 + 86: 6(float) ImageSampleDrefImplicitLod 81 84 85 ConstOffset 71 + Store 74(r23) 86 + 91: 88 Load 90(g_tTex2du4) + 92: 18 Load 20(g_sSamp) + 94: 93 SampledImage 91 92 + 95: 6(float) CompositeExtract 64 0 + 96: 6(float) CompositeExtract 64 1 + 97: 65(fvec3) CompositeConstruct 95 96 25 + 98: 6(float) CompositeExtract 97 2 + 99: 6(float) ImageSampleDrefImplicitLod 94 97 98 ConstOffset 71 + Store 87(r25) 99 + 106: 105(ptr) AccessChain 101(psout) 102 + Store 106 104 + 108: 12(ptr) AccessChain 101(psout) 107 + Store 108 103 + 109:8(PS_OUTPUT) Load 101(psout) + ReturnValue 109 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplecmp.offsetarray.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplecmp.offsetarray.dx10.frag.out new file mode 100644 index 00000000..af2af3f2 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplecmp.offsetarray.dx10.frag.out @@ -0,0 +1,608 @@ +hlsl.samplecmp.offsetarray.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Parameters: +0:? Sequence +0:42 Sequence +0:42 move second child to first child ( temp float) +0:42 'r11' ( temp float) +0:42 textureOffset ( temp float) +0:42 Construct combined texture-sampler ( temp sampler1DArrayShadow) +0:42 'g_tTex1df4a' ( uniform texture1DArrayShadow) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:42 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:42 Constant: +0:42 0.750000 +0:42 Constant: +0:42 2 (const int) +0:43 Sequence +0:43 move second child to first child ( temp float) +0:43 'r13' ( temp float) +0:43 textureOffset ( temp float) +0:43 Construct combined texture-sampler ( temp isampler1DArrayShadow) +0:43 'g_tTex1di4a' ( uniform itexture1DArrayShadow) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:43 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:43 Constant: +0:43 0.750000 +0:43 Constant: +0:43 2 (const int) +0:44 Sequence +0:44 move second child to first child ( temp float) +0:44 'r15' ( temp float) +0:44 textureOffset ( temp float) +0:44 Construct combined texture-sampler ( temp usampler1DArrayShadow) +0:44 'g_tTex1du4a' ( uniform utexture1DArrayShadow) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:44 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:44 Constant: +0:44 0.750000 +0:44 Constant: +0:44 2 (const int) +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'r31' ( temp float) +0:47 textureOffset ( temp float) +0:47 Construct combined texture-sampler ( temp sampler2DArrayShadow) +0:47 'g_tTex2df4a' ( uniform texture2DArrayShadow) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:47 Constant: +0:47 0.750000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'r33' ( temp float) +0:48 textureOffset ( temp float) +0:48 Construct combined texture-sampler ( temp isampler2DArrayShadow) +0:48 'g_tTex2di4a' ( uniform itexture2DArrayShadow) +0:48 'g_sSamp' (layout( binding=0) uniform sampler) +0:48 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:48 Constant: +0:48 0.750000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'r35' ( temp float) +0:49 textureOffset ( temp float) +0:49 Construct combined texture-sampler ( temp usampler2DArrayShadow) +0:49 'g_tTex2du4a' ( uniform utexture2DArrayShadow) +0:49 'g_sSamp' (layout( binding=0) uniform sampler) +0:49 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:49 Constant: +0:49 0.750000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:63 move second child to first child ( temp 4-component vector of float) +0:63 Color: direct index for structure ( temp 4-component vector of float) +0:63 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:63 Constant: +0:63 0 (const int) +0:63 Constant: +0:63 1.000000 +0:63 1.000000 +0:63 1.000000 +0:63 1.000000 +0:64 move second child to first child ( temp float) +0:64 Depth: direct index for structure ( temp float) +0:64 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:64 Constant: +0:64 1 (const int) +0:64 Constant: +0:64 1.000000 +0:66 Branch: Return with expression +0:66 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Definition: main( ( temp void) +0:38 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:38 Color: direct index for structure ( temp 4-component vector of float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 0 (const int) +0:38 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:38 Depth: direct index for structure ( temp float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArrayShadow) +0:? 'g_tTex1di4a' ( uniform itexture1DArrayShadow) +0:? 'g_tTex1du4a' ( uniform utexture1DArrayShadow) +0:? 'g_tTex2df4a' ( uniform texture2DArrayShadow) +0:? 'g_tTex2di4a' ( uniform itexture2DArrayShadow) +0:? 'g_tTex2du4a' ( uniform utexture2DArrayShadow) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Parameters: +0:? Sequence +0:42 Sequence +0:42 move second child to first child ( temp float) +0:42 'r11' ( temp float) +0:42 textureOffset ( temp float) +0:42 Construct combined texture-sampler ( temp sampler1DArrayShadow) +0:42 'g_tTex1df4a' ( uniform texture1DArrayShadow) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:42 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:42 Constant: +0:42 0.750000 +0:42 Constant: +0:42 2 (const int) +0:43 Sequence +0:43 move second child to first child ( temp float) +0:43 'r13' ( temp float) +0:43 textureOffset ( temp float) +0:43 Construct combined texture-sampler ( temp isampler1DArrayShadow) +0:43 'g_tTex1di4a' ( uniform itexture1DArrayShadow) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:43 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:43 Constant: +0:43 0.750000 +0:43 Constant: +0:43 2 (const int) +0:44 Sequence +0:44 move second child to first child ( temp float) +0:44 'r15' ( temp float) +0:44 textureOffset ( temp float) +0:44 Construct combined texture-sampler ( temp usampler1DArrayShadow) +0:44 'g_tTex1du4a' ( uniform utexture1DArrayShadow) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:44 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:44 Constant: +0:44 0.750000 +0:44 Constant: +0:44 2 (const int) +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'r31' ( temp float) +0:47 textureOffset ( temp float) +0:47 Construct combined texture-sampler ( temp sampler2DArrayShadow) +0:47 'g_tTex2df4a' ( uniform texture2DArrayShadow) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:47 Constant: +0:47 0.750000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'r33' ( temp float) +0:48 textureOffset ( temp float) +0:48 Construct combined texture-sampler ( temp isampler2DArrayShadow) +0:48 'g_tTex2di4a' ( uniform itexture2DArrayShadow) +0:48 'g_sSamp' (layout( binding=0) uniform sampler) +0:48 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:48 Constant: +0:48 0.750000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'r35' ( temp float) +0:49 textureOffset ( temp float) +0:49 Construct combined texture-sampler ( temp usampler2DArrayShadow) +0:49 'g_tTex2du4a' ( uniform utexture2DArrayShadow) +0:49 'g_sSamp' (layout( binding=0) uniform sampler) +0:49 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:49 Constant: +0:49 0.750000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:63 move second child to first child ( temp 4-component vector of float) +0:63 Color: direct index for structure ( temp 4-component vector of float) +0:63 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:63 Constant: +0:63 0 (const int) +0:63 Constant: +0:63 1.000000 +0:63 1.000000 +0:63 1.000000 +0:63 1.000000 +0:64 move second child to first child ( temp float) +0:64 Depth: direct index for structure ( temp float) +0:64 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:64 Constant: +0:64 1 (const int) +0:64 Constant: +0:64 1.000000 +0:66 Branch: Return with expression +0:66 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Definition: main( ( temp void) +0:38 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:38 Color: direct index for structure ( temp 4-component vector of float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 0 (const int) +0:38 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:38 Depth: direct index for structure ( temp float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArrayShadow) +0:? 'g_tTex1di4a' ( uniform itexture1DArrayShadow) +0:? 'g_tTex1du4a' ( uniform utexture1DArrayShadow) +0:? 'g_tTex2df4a' ( uniform texture2DArrayShadow) +0:? 'g_tTex2di4a' ( uniform itexture2DArrayShadow) +0:? 'g_tTex2du4a' ( uniform utexture2DArrayShadow) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: Expected Image 'Sampled Type' to be the same as Result Type + %49 = OpImageSampleDrefImplicitLod %float %44 %47 %48 ConstOffset %int_2 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 178 + + Capability Shader + Capability Sampled1D + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 126 130 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "r11" + Name 16 "g_tTex1df4a" + Name 20 "g_sSamp" + Name 37 "r13" + Name 40 "g_tTex1di4a" + Name 50 "r15" + Name 54 "g_tTex1du4a" + Name 64 "r31" + Name 67 "g_tTex2df4a" + Name 83 "r33" + Name 86 "g_tTex2di4a" + Name 97 "r35" + Name 100 "g_tTex2du4a" + Name 112 "psout" + Name 123 "flattenTemp" + Name 126 "@entryPointOutput.Color" + Name 130 "@entryPointOutput.Depth" + Name 135 "g_tTex1df4" + Name 138 "g_tTex1di4" + Name 141 "g_tTex1du4" + Name 144 "g_tTex2df4" + Name 147 "g_tTex2di4" + Name 150 "g_tTex2du4" + Name 153 "g_tTex3df4" + Name 156 "g_tTex3di4" + Name 159 "g_tTex3du4" + Name 162 "g_tTexcdf4" + Name 165 "g_tTexcdi4" + Name 168 "g_tTexcdu4" + Name 171 "g_tTexcdf4a" + Name 174 "g_tTexcdi4a" + Name 177 "g_tTexcdu4a" + Decorate 16(g_tTex1df4a) DescriptorSet 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 40(g_tTex1di4a) DescriptorSet 0 + Decorate 54(g_tTex1du4a) DescriptorSet 0 + Decorate 67(g_tTex2df4a) DescriptorSet 0 + Decorate 86(g_tTex2di4a) DescriptorSet 0 + Decorate 100(g_tTex2du4a) DescriptorSet 0 + Decorate 126(@entryPointOutput.Color) Location 0 + Decorate 130(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 135(g_tTex1df4) DescriptorSet 0 + Decorate 135(g_tTex1df4) Binding 0 + Decorate 138(g_tTex1di4) DescriptorSet 0 + Decorate 141(g_tTex1du4) DescriptorSet 0 + Decorate 144(g_tTex2df4) DescriptorSet 0 + Decorate 147(g_tTex2di4) DescriptorSet 0 + Decorate 150(g_tTex2du4) DescriptorSet 0 + Decorate 153(g_tTex3df4) DescriptorSet 0 + Decorate 156(g_tTex3di4) DescriptorSet 0 + Decorate 159(g_tTex3du4) DescriptorSet 0 + Decorate 162(g_tTexcdf4) DescriptorSet 0 + Decorate 165(g_tTexcdi4) DescriptorSet 0 + Decorate 168(g_tTexcdu4) DescriptorSet 0 + Decorate 171(g_tTexcdf4a) DescriptorSet 0 + Decorate 174(g_tTexcdi4a) DescriptorSet 0 + Decorate 177(g_tTexcdu4a) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 6(float) + 14: TypeImage 6(float) 1D depth array sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4a): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 2 + 25: 6(float) Constant 1036831949 + 26: 6(float) Constant 1045220557 + 27: 24(fvec2) ConstantComposite 25 26 + 28: 6(float) Constant 1061158912 + 29: TypeVector 6(float) 3 + 33: TypeInt 32 1 + 34: 33(int) Constant 2 + 38: TypeImage 33(int) 1D depth array sampled format:Unknown + 39: TypePointer UniformConstant 38 + 40(g_tTex1di4a): 39(ptr) Variable UniformConstant + 43: TypeSampledImage 38 + 51: TypeInt 32 0 + 52: TypeImage 51(int) 1D depth array sampled format:Unknown + 53: TypePointer UniformConstant 52 + 54(g_tTex1du4a): 53(ptr) Variable UniformConstant + 57: TypeSampledImage 52 + 65: TypeImage 6(float) 2D depth array sampled format:Unknown + 66: TypePointer UniformConstant 65 + 67(g_tTex2df4a): 66(ptr) Variable UniformConstant + 70: TypeSampledImage 65 + 72: 6(float) Constant 1050253722 + 73: 29(fvec3) ConstantComposite 25 26 72 + 78: TypeVector 33(int) 2 + 79: 33(int) Constant 3 + 80: 78(ivec2) ConstantComposite 34 79 + 84: TypeImage 33(int) 2D depth array sampled format:Unknown + 85: TypePointer UniformConstant 84 + 86(g_tTex2di4a): 85(ptr) Variable UniformConstant + 89: TypeSampledImage 84 + 98: TypeImage 51(int) 2D depth array sampled format:Unknown + 99: TypePointer UniformConstant 98 +100(g_tTex2du4a): 99(ptr) Variable UniformConstant + 103: TypeSampledImage 98 + 111: TypePointer Function 8(PS_OUTPUT) + 113: 33(int) Constant 0 + 114: 6(float) Constant 1065353216 + 115: 7(fvec4) ConstantComposite 114 114 114 114 + 116: TypePointer Function 7(fvec4) + 118: 33(int) Constant 1 + 125: TypePointer Output 7(fvec4) +126(@entryPointOutput.Color): 125(ptr) Variable Output + 129: TypePointer Output 6(float) +130(@entryPointOutput.Depth): 129(ptr) Variable Output + 133: TypeImage 6(float) 1D sampled format:Unknown + 134: TypePointer UniformConstant 133 + 135(g_tTex1df4): 134(ptr) Variable UniformConstant + 136: TypeImage 33(int) 1D sampled format:Unknown + 137: TypePointer UniformConstant 136 + 138(g_tTex1di4): 137(ptr) Variable UniformConstant + 139: TypeImage 51(int) 1D sampled format:Unknown + 140: TypePointer UniformConstant 139 + 141(g_tTex1du4): 140(ptr) Variable UniformConstant + 142: TypeImage 6(float) 2D sampled format:Unknown + 143: TypePointer UniformConstant 142 + 144(g_tTex2df4): 143(ptr) Variable UniformConstant + 145: TypeImage 33(int) 2D sampled format:Unknown + 146: TypePointer UniformConstant 145 + 147(g_tTex2di4): 146(ptr) Variable UniformConstant + 148: TypeImage 51(int) 2D sampled format:Unknown + 149: TypePointer UniformConstant 148 + 150(g_tTex2du4): 149(ptr) Variable UniformConstant + 151: TypeImage 6(float) 3D sampled format:Unknown + 152: TypePointer UniformConstant 151 + 153(g_tTex3df4): 152(ptr) Variable UniformConstant + 154: TypeImage 33(int) 3D sampled format:Unknown + 155: TypePointer UniformConstant 154 + 156(g_tTex3di4): 155(ptr) Variable UniformConstant + 157: TypeImage 51(int) 3D sampled format:Unknown + 158: TypePointer UniformConstant 157 + 159(g_tTex3du4): 158(ptr) Variable UniformConstant + 160: TypeImage 6(float) Cube sampled format:Unknown + 161: TypePointer UniformConstant 160 + 162(g_tTexcdf4): 161(ptr) Variable UniformConstant + 163: TypeImage 33(int) Cube sampled format:Unknown + 164: TypePointer UniformConstant 163 + 165(g_tTexcdi4): 164(ptr) Variable UniformConstant + 166: TypeImage 51(int) Cube sampled format:Unknown + 167: TypePointer UniformConstant 166 + 168(g_tTexcdu4): 167(ptr) Variable UniformConstant + 169: TypeImage 6(float) Cube array sampled format:Unknown + 170: TypePointer UniformConstant 169 +171(g_tTexcdf4a): 170(ptr) Variable UniformConstant + 172: TypeImage 33(int) Cube array sampled format:Unknown + 173: TypePointer UniformConstant 172 +174(g_tTexcdi4a): 173(ptr) Variable UniformConstant + 175: TypeImage 51(int) Cube array sampled format:Unknown + 176: TypePointer UniformConstant 175 +177(g_tTexcdu4a): 176(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +123(flattenTemp): 111(ptr) Variable Function + 124:8(PS_OUTPUT) FunctionCall 10(@main() + Store 123(flattenTemp) 124 + 127: 116(ptr) AccessChain 123(flattenTemp) 113 + 128: 7(fvec4) Load 127 + Store 126(@entryPointOutput.Color) 128 + 131: 12(ptr) AccessChain 123(flattenTemp) 118 + 132: 6(float) Load 131 + Store 130(@entryPointOutput.Depth) 132 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(r11): 12(ptr) Variable Function + 37(r13): 12(ptr) Variable Function + 50(r15): 12(ptr) Variable Function + 64(r31): 12(ptr) Variable Function + 83(r33): 12(ptr) Variable Function + 97(r35): 12(ptr) Variable Function + 112(psout): 111(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4a) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 30: 6(float) CompositeExtract 27 0 + 31: 6(float) CompositeExtract 27 1 + 32: 29(fvec3) CompositeConstruct 30 31 28 + 35: 6(float) CompositeExtract 32 2 + 36: 6(float) ImageSampleDrefImplicitLod 23 32 35 ConstOffset 34 + Store 13(r11) 36 + 41: 38 Load 40(g_tTex1di4a) + 42: 18 Load 20(g_sSamp) + 44: 43 SampledImage 41 42 + 45: 6(float) CompositeExtract 27 0 + 46: 6(float) CompositeExtract 27 1 + 47: 29(fvec3) CompositeConstruct 45 46 28 + 48: 6(float) CompositeExtract 47 2 + 49: 6(float) ImageSampleDrefImplicitLod 44 47 48 ConstOffset 34 + Store 37(r13) 49 + 55: 52 Load 54(g_tTex1du4a) + 56: 18 Load 20(g_sSamp) + 58: 57 SampledImage 55 56 + 59: 6(float) CompositeExtract 27 0 + 60: 6(float) CompositeExtract 27 1 + 61: 29(fvec3) CompositeConstruct 59 60 28 + 62: 6(float) CompositeExtract 61 2 + 63: 6(float) ImageSampleDrefImplicitLod 58 61 62 ConstOffset 34 + Store 50(r15) 63 + 68: 65 Load 67(g_tTex2df4a) + 69: 18 Load 20(g_sSamp) + 71: 70 SampledImage 68 69 + 74: 6(float) CompositeExtract 73 0 + 75: 6(float) CompositeExtract 73 1 + 76: 6(float) CompositeExtract 73 2 + 77: 7(fvec4) CompositeConstruct 74 75 76 28 + 81: 6(float) CompositeExtract 77 3 + 82: 6(float) ImageSampleDrefImplicitLod 71 77 81 ConstOffset 80 + Store 64(r31) 82 + 87: 84 Load 86(g_tTex2di4a) + 88: 18 Load 20(g_sSamp) + 90: 89 SampledImage 87 88 + 91: 6(float) CompositeExtract 73 0 + 92: 6(float) CompositeExtract 73 1 + 93: 6(float) CompositeExtract 73 2 + 94: 7(fvec4) CompositeConstruct 91 92 93 28 + 95: 6(float) CompositeExtract 94 3 + 96: 6(float) ImageSampleDrefImplicitLod 90 94 95 ConstOffset 80 + Store 83(r33) 96 + 101: 98 Load 100(g_tTex2du4a) + 102: 18 Load 20(g_sSamp) + 104: 103 SampledImage 101 102 + 105: 6(float) CompositeExtract 73 0 + 106: 6(float) CompositeExtract 73 1 + 107: 6(float) CompositeExtract 73 2 + 108: 7(fvec4) CompositeConstruct 105 106 107 28 + 109: 6(float) CompositeExtract 108 3 + 110: 6(float) ImageSampleDrefImplicitLod 104 108 109 ConstOffset 80 + Store 97(r35) 110 + 117: 116(ptr) AccessChain 112(psout) 113 + Store 117 115 + 119: 12(ptr) AccessChain 112(psout) 118 + Store 119 114 + 120:8(PS_OUTPUT) Load 112(psout) + ReturnValue 120 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.array.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.array.dx10.frag.out new file mode 100644 index 00000000..a0e5a487 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.array.dx10.frag.out @@ -0,0 +1,742 @@ +hlsl.samplecmplevelzero.array.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Parameters: +0:? Sequence +0:42 Sequence +0:42 move second child to first child ( temp float) +0:42 'r10' ( temp float) +0:42 textureLod ( temp float) +0:42 Construct combined texture-sampler ( temp sampler1DArrayShadow) +0:42 'g_tTex1df4a' ( uniform texture1DArrayShadow) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:42 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:42 Constant: +0:42 0.750000 +0:42 Constant: +0:42 0.000000 +0:43 Sequence +0:43 move second child to first child ( temp float) +0:43 'r12' ( temp float) +0:43 textureLod ( temp float) +0:43 Construct combined texture-sampler ( temp isampler1DArrayShadow) +0:43 'g_tTex1di4a' ( uniform itexture1DArrayShadow) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:43 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:43 Constant: +0:43 0.750000 +0:43 Constant: +0:43 0.000000 +0:44 Sequence +0:44 move second child to first child ( temp float) +0:44 'r14' ( temp float) +0:44 textureLod ( temp float) +0:44 Construct combined texture-sampler ( temp usampler1DArrayShadow) +0:44 'g_tTex1du4a' ( uniform utexture1DArrayShadow) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:44 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:44 Constant: +0:44 0.750000 +0:44 Constant: +0:44 0.000000 +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'r30' ( temp float) +0:47 textureLod ( temp float) +0:47 Construct combined texture-sampler ( temp sampler2DArrayShadow) +0:47 'g_tTex2df4a' ( uniform texture2DArrayShadow) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:47 Constant: +0:47 0.750000 +0:47 Constant: +0:47 0.000000 +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'r32' ( temp float) +0:48 textureLod ( temp float) +0:48 Construct combined texture-sampler ( temp isampler2DArrayShadow) +0:48 'g_tTex2di4a' ( uniform itexture2DArrayShadow) +0:48 'g_sSamp' (layout( binding=0) uniform sampler) +0:48 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:48 Constant: +0:48 0.750000 +0:48 Constant: +0:48 0.000000 +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'r34' ( temp float) +0:49 textureLod ( temp float) +0:49 Construct combined texture-sampler ( temp usampler2DArrayShadow) +0:49 'g_tTex2du4a' ( uniform utexture2DArrayShadow) +0:49 'g_sSamp' (layout( binding=0) uniform sampler) +0:49 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:49 Constant: +0:49 0.750000 +0:49 Constant: +0:49 0.000000 +0:52 Sequence +0:52 move second child to first child ( temp float) +0:52 'r60' ( temp float) +0:52 textureLod ( temp float) +0:52 Construct combined texture-sampler ( temp samplerCubeArrayShadow) +0:52 'g_tTexcdf4a' ( uniform textureCubeArrayShadow) +0:52 'g_sSamp' (layout( binding=0) uniform sampler) +0:52 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:52 Constant: +0:52 0.750000 +0:52 Constant: +0:52 0.000000 +0:53 Sequence +0:53 move second child to first child ( temp float) +0:53 'r62' ( temp float) +0:53 textureLod ( temp float) +0:53 Construct combined texture-sampler ( temp isamplerCubeArrayShadow) +0:53 'g_tTexcdi4a' ( uniform itextureCubeArrayShadow) +0:53 'g_sSamp' (layout( binding=0) uniform sampler) +0:53 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:53 Constant: +0:53 0.750000 +0:53 Constant: +0:53 0.000000 +0:54 Sequence +0:54 move second child to first child ( temp float) +0:54 'r64' ( temp float) +0:54 textureLod ( temp float) +0:54 Construct combined texture-sampler ( temp usamplerCubeArrayShadow) +0:54 'g_tTexcdu4a' ( uniform utextureCubeArrayShadow) +0:54 'g_sSamp' (layout( binding=0) uniform sampler) +0:54 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:54 Constant: +0:54 0.750000 +0:54 Constant: +0:54 0.000000 +0:56 move second child to first child ( temp 4-component vector of float) +0:56 Color: direct index for structure ( temp 4-component vector of float) +0:56 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1.000000 +0:56 1.000000 +0:56 1.000000 +0:56 1.000000 +0:57 move second child to first child ( temp float) +0:57 Depth: direct index for structure ( temp float) +0:57 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 1.000000 +0:59 Branch: Return with expression +0:59 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Definition: main( ( temp void) +0:38 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:38 Color: direct index for structure ( temp 4-component vector of float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 0 (const int) +0:38 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:38 Depth: direct index for structure ( temp float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArrayShadow) +0:? 'g_tTex1di4a' ( uniform itexture1DArrayShadow) +0:? 'g_tTex1du4a' ( uniform utexture1DArrayShadow) +0:? 'g_tTex2df4a' ( uniform texture2DArrayShadow) +0:? 'g_tTex2di4a' ( uniform itexture2DArrayShadow) +0:? 'g_tTex2du4a' ( uniform utexture2DArrayShadow) +0:? 'g_tTexcdf4a' ( uniform textureCubeArrayShadow) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArrayShadow) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArrayShadow) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Parameters: +0:? Sequence +0:42 Sequence +0:42 move second child to first child ( temp float) +0:42 'r10' ( temp float) +0:42 textureLod ( temp float) +0:42 Construct combined texture-sampler ( temp sampler1DArrayShadow) +0:42 'g_tTex1df4a' ( uniform texture1DArrayShadow) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:42 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:42 Constant: +0:42 0.750000 +0:42 Constant: +0:42 0.000000 +0:43 Sequence +0:43 move second child to first child ( temp float) +0:43 'r12' ( temp float) +0:43 textureLod ( temp float) +0:43 Construct combined texture-sampler ( temp isampler1DArrayShadow) +0:43 'g_tTex1di4a' ( uniform itexture1DArrayShadow) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:43 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:43 Constant: +0:43 0.750000 +0:43 Constant: +0:43 0.000000 +0:44 Sequence +0:44 move second child to first child ( temp float) +0:44 'r14' ( temp float) +0:44 textureLod ( temp float) +0:44 Construct combined texture-sampler ( temp usampler1DArrayShadow) +0:44 'g_tTex1du4a' ( uniform utexture1DArrayShadow) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:44 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:44 Constant: +0:44 0.750000 +0:44 Constant: +0:44 0.000000 +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'r30' ( temp float) +0:47 textureLod ( temp float) +0:47 Construct combined texture-sampler ( temp sampler2DArrayShadow) +0:47 'g_tTex2df4a' ( uniform texture2DArrayShadow) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:47 Constant: +0:47 0.750000 +0:47 Constant: +0:47 0.000000 +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'r32' ( temp float) +0:48 textureLod ( temp float) +0:48 Construct combined texture-sampler ( temp isampler2DArrayShadow) +0:48 'g_tTex2di4a' ( uniform itexture2DArrayShadow) +0:48 'g_sSamp' (layout( binding=0) uniform sampler) +0:48 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:48 Constant: +0:48 0.750000 +0:48 Constant: +0:48 0.000000 +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'r34' ( temp float) +0:49 textureLod ( temp float) +0:49 Construct combined texture-sampler ( temp usampler2DArrayShadow) +0:49 'g_tTex2du4a' ( uniform utexture2DArrayShadow) +0:49 'g_sSamp' (layout( binding=0) uniform sampler) +0:49 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:49 Constant: +0:49 0.750000 +0:49 Constant: +0:49 0.000000 +0:52 Sequence +0:52 move second child to first child ( temp float) +0:52 'r60' ( temp float) +0:52 textureLod ( temp float) +0:52 Construct combined texture-sampler ( temp samplerCubeArrayShadow) +0:52 'g_tTexcdf4a' ( uniform textureCubeArrayShadow) +0:52 'g_sSamp' (layout( binding=0) uniform sampler) +0:52 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:52 Constant: +0:52 0.750000 +0:52 Constant: +0:52 0.000000 +0:53 Sequence +0:53 move second child to first child ( temp float) +0:53 'r62' ( temp float) +0:53 textureLod ( temp float) +0:53 Construct combined texture-sampler ( temp isamplerCubeArrayShadow) +0:53 'g_tTexcdi4a' ( uniform itextureCubeArrayShadow) +0:53 'g_sSamp' (layout( binding=0) uniform sampler) +0:53 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:53 Constant: +0:53 0.750000 +0:53 Constant: +0:53 0.000000 +0:54 Sequence +0:54 move second child to first child ( temp float) +0:54 'r64' ( temp float) +0:54 textureLod ( temp float) +0:54 Construct combined texture-sampler ( temp usamplerCubeArrayShadow) +0:54 'g_tTexcdu4a' ( uniform utextureCubeArrayShadow) +0:54 'g_sSamp' (layout( binding=0) uniform sampler) +0:54 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:54 Constant: +0:54 0.750000 +0:54 Constant: +0:54 0.000000 +0:56 move second child to first child ( temp 4-component vector of float) +0:56 Color: direct index for structure ( temp 4-component vector of float) +0:56 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1.000000 +0:56 1.000000 +0:56 1.000000 +0:56 1.000000 +0:57 move second child to first child ( temp float) +0:57 Depth: direct index for structure ( temp float) +0:57 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 1.000000 +0:59 Branch: Return with expression +0:59 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Definition: main( ( temp void) +0:38 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:38 Color: direct index for structure ( temp 4-component vector of float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 0 (const int) +0:38 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:38 Depth: direct index for structure ( temp float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArrayShadow) +0:? 'g_tTex1di4a' ( uniform itexture1DArrayShadow) +0:? 'g_tTex1du4a' ( uniform utexture1DArrayShadow) +0:? 'g_tTex2df4a' ( uniform texture2DArrayShadow) +0:? 'g_tTex2di4a' ( uniform itexture2DArrayShadow) +0:? 'g_tTex2du4a' ( uniform utexture2DArrayShadow) +0:? 'g_tTexcdf4a' ( uniform textureCubeArrayShadow) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArrayShadow) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArrayShadow) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: Expected Image 'Sampled Type' to be the same as Result Type + %49 = OpImageSampleDrefExplicitLod %float %44 %47 %48 Lod %float_0 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 210 + + Capability Shader + Capability Sampled1D + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 167 171 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "r10" + Name 16 "g_tTex1df4a" + Name 20 "g_sSamp" + Name 36 "r12" + Name 40 "g_tTex1di4a" + Name 50 "r14" + Name 54 "g_tTex1du4a" + Name 64 "r30" + Name 67 "g_tTex2df4a" + Name 80 "r32" + Name 83 "g_tTex2di4a" + Name 94 "r34" + Name 97 "g_tTex2du4a" + Name 108 "r60" + Name 111 "g_tTexcdf4a" + Name 124 "r62" + Name 127 "g_tTexcdi4a" + Name 138 "r64" + Name 141 "g_tTexcdu4a" + Name 153 "psout" + Name 164 "flattenTemp" + Name 167 "@entryPointOutput.Color" + Name 171 "@entryPointOutput.Depth" + Name 176 "g_tTex1df4" + Name 179 "g_tTex1di4" + Name 182 "g_tTex1du4" + Name 185 "g_tTex2df4" + Name 188 "g_tTex2di4" + Name 191 "g_tTex2du4" + Name 194 "g_tTex3df4" + Name 197 "g_tTex3di4" + Name 200 "g_tTex3du4" + Name 203 "g_tTexcdf4" + Name 206 "g_tTexcdi4" + Name 209 "g_tTexcdu4" + Decorate 16(g_tTex1df4a) DescriptorSet 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 40(g_tTex1di4a) DescriptorSet 0 + Decorate 54(g_tTex1du4a) DescriptorSet 0 + Decorate 67(g_tTex2df4a) DescriptorSet 0 + Decorate 83(g_tTex2di4a) DescriptorSet 0 + Decorate 97(g_tTex2du4a) DescriptorSet 0 + Decorate 111(g_tTexcdf4a) DescriptorSet 0 + Decorate 127(g_tTexcdi4a) DescriptorSet 0 + Decorate 141(g_tTexcdu4a) DescriptorSet 0 + Decorate 167(@entryPointOutput.Color) Location 0 + Decorate 171(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 176(g_tTex1df4) DescriptorSet 0 + Decorate 176(g_tTex1df4) Binding 0 + Decorate 179(g_tTex1di4) DescriptorSet 0 + Decorate 182(g_tTex1du4) DescriptorSet 0 + Decorate 185(g_tTex2df4) DescriptorSet 0 + Decorate 188(g_tTex2di4) DescriptorSet 0 + Decorate 191(g_tTex2du4) DescriptorSet 0 + Decorate 194(g_tTex3df4) DescriptorSet 0 + Decorate 197(g_tTex3di4) DescriptorSet 0 + Decorate 200(g_tTex3du4) DescriptorSet 0 + Decorate 203(g_tTexcdf4) DescriptorSet 0 + Decorate 206(g_tTexcdi4) DescriptorSet 0 + Decorate 209(g_tTexcdu4) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 6(float) + 14: TypeImage 6(float) 1D depth array sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4a): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 2 + 25: 6(float) Constant 1036831949 + 26: 6(float) Constant 1045220557 + 27: 24(fvec2) ConstantComposite 25 26 + 28: 6(float) Constant 1061158912 + 29: TypeVector 6(float) 3 + 33: 6(float) Constant 0 + 37: TypeInt 32 1 + 38: TypeImage 37(int) 1D depth array sampled format:Unknown + 39: TypePointer UniformConstant 38 + 40(g_tTex1di4a): 39(ptr) Variable UniformConstant + 43: TypeSampledImage 38 + 51: TypeInt 32 0 + 52: TypeImage 51(int) 1D depth array sampled format:Unknown + 53: TypePointer UniformConstant 52 + 54(g_tTex1du4a): 53(ptr) Variable UniformConstant + 57: TypeSampledImage 52 + 65: TypeImage 6(float) 2D depth array sampled format:Unknown + 66: TypePointer UniformConstant 65 + 67(g_tTex2df4a): 66(ptr) Variable UniformConstant + 70: TypeSampledImage 65 + 72: 6(float) Constant 1050253722 + 73: 29(fvec3) ConstantComposite 25 26 72 + 81: TypeImage 37(int) 2D depth array sampled format:Unknown + 82: TypePointer UniformConstant 81 + 83(g_tTex2di4a): 82(ptr) Variable UniformConstant + 86: TypeSampledImage 81 + 95: TypeImage 51(int) 2D depth array sampled format:Unknown + 96: TypePointer UniformConstant 95 + 97(g_tTex2du4a): 96(ptr) Variable UniformConstant + 100: TypeSampledImage 95 + 109: TypeImage 6(float) Cube depth array sampled format:Unknown + 110: TypePointer UniformConstant 109 +111(g_tTexcdf4a): 110(ptr) Variable UniformConstant + 114: TypeSampledImage 109 + 116: 6(float) Constant 1053609165 + 117: 7(fvec4) ConstantComposite 25 26 72 116 + 125: TypeImage 37(int) Cube depth array sampled format:Unknown + 126: TypePointer UniformConstant 125 +127(g_tTexcdi4a): 126(ptr) Variable UniformConstant + 130: TypeSampledImage 125 + 139: TypeImage 51(int) Cube depth array sampled format:Unknown + 140: TypePointer UniformConstant 139 +141(g_tTexcdu4a): 140(ptr) Variable UniformConstant + 144: TypeSampledImage 139 + 152: TypePointer Function 8(PS_OUTPUT) + 154: 37(int) Constant 0 + 155: 6(float) Constant 1065353216 + 156: 7(fvec4) ConstantComposite 155 155 155 155 + 157: TypePointer Function 7(fvec4) + 159: 37(int) Constant 1 + 166: TypePointer Output 7(fvec4) +167(@entryPointOutput.Color): 166(ptr) Variable Output + 170: TypePointer Output 6(float) +171(@entryPointOutput.Depth): 170(ptr) Variable Output + 174: TypeImage 6(float) 1D sampled format:Unknown + 175: TypePointer UniformConstant 174 + 176(g_tTex1df4): 175(ptr) Variable UniformConstant + 177: TypeImage 37(int) 1D sampled format:Unknown + 178: TypePointer UniformConstant 177 + 179(g_tTex1di4): 178(ptr) Variable UniformConstant + 180: TypeImage 51(int) 1D sampled format:Unknown + 181: TypePointer UniformConstant 180 + 182(g_tTex1du4): 181(ptr) Variable UniformConstant + 183: TypeImage 6(float) 2D sampled format:Unknown + 184: TypePointer UniformConstant 183 + 185(g_tTex2df4): 184(ptr) Variable UniformConstant + 186: TypeImage 37(int) 2D sampled format:Unknown + 187: TypePointer UniformConstant 186 + 188(g_tTex2di4): 187(ptr) Variable UniformConstant + 189: TypeImage 51(int) 2D sampled format:Unknown + 190: TypePointer UniformConstant 189 + 191(g_tTex2du4): 190(ptr) Variable UniformConstant + 192: TypeImage 6(float) 3D sampled format:Unknown + 193: TypePointer UniformConstant 192 + 194(g_tTex3df4): 193(ptr) Variable UniformConstant + 195: TypeImage 37(int) 3D sampled format:Unknown + 196: TypePointer UniformConstant 195 + 197(g_tTex3di4): 196(ptr) Variable UniformConstant + 198: TypeImage 51(int) 3D sampled format:Unknown + 199: TypePointer UniformConstant 198 + 200(g_tTex3du4): 199(ptr) Variable UniformConstant + 201: TypeImage 6(float) Cube sampled format:Unknown + 202: TypePointer UniformConstant 201 + 203(g_tTexcdf4): 202(ptr) Variable UniformConstant + 204: TypeImage 37(int) Cube sampled format:Unknown + 205: TypePointer UniformConstant 204 + 206(g_tTexcdi4): 205(ptr) Variable UniformConstant + 207: TypeImage 51(int) Cube sampled format:Unknown + 208: TypePointer UniformConstant 207 + 209(g_tTexcdu4): 208(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +164(flattenTemp): 152(ptr) Variable Function + 165:8(PS_OUTPUT) FunctionCall 10(@main() + Store 164(flattenTemp) 165 + 168: 157(ptr) AccessChain 164(flattenTemp) 154 + 169: 7(fvec4) Load 168 + Store 167(@entryPointOutput.Color) 169 + 172: 12(ptr) AccessChain 164(flattenTemp) 159 + 173: 6(float) Load 172 + Store 171(@entryPointOutput.Depth) 173 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(r10): 12(ptr) Variable Function + 36(r12): 12(ptr) Variable Function + 50(r14): 12(ptr) Variable Function + 64(r30): 12(ptr) Variable Function + 80(r32): 12(ptr) Variable Function + 94(r34): 12(ptr) Variable Function + 108(r60): 12(ptr) Variable Function + 124(r62): 12(ptr) Variable Function + 138(r64): 12(ptr) Variable Function + 153(psout): 152(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4a) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 30: 6(float) CompositeExtract 27 0 + 31: 6(float) CompositeExtract 27 1 + 32: 29(fvec3) CompositeConstruct 30 31 28 + 34: 6(float) CompositeExtract 32 2 + 35: 6(float) ImageSampleDrefExplicitLod 23 32 34 Lod 33 + Store 13(r10) 35 + 41: 38 Load 40(g_tTex1di4a) + 42: 18 Load 20(g_sSamp) + 44: 43 SampledImage 41 42 + 45: 6(float) CompositeExtract 27 0 + 46: 6(float) CompositeExtract 27 1 + 47: 29(fvec3) CompositeConstruct 45 46 28 + 48: 6(float) CompositeExtract 47 2 + 49: 6(float) ImageSampleDrefExplicitLod 44 47 48 Lod 33 + Store 36(r12) 49 + 55: 52 Load 54(g_tTex1du4a) + 56: 18 Load 20(g_sSamp) + 58: 57 SampledImage 55 56 + 59: 6(float) CompositeExtract 27 0 + 60: 6(float) CompositeExtract 27 1 + 61: 29(fvec3) CompositeConstruct 59 60 28 + 62: 6(float) CompositeExtract 61 2 + 63: 6(float) ImageSampleDrefExplicitLod 58 61 62 Lod 33 + Store 50(r14) 63 + 68: 65 Load 67(g_tTex2df4a) + 69: 18 Load 20(g_sSamp) + 71: 70 SampledImage 68 69 + 74: 6(float) CompositeExtract 73 0 + 75: 6(float) CompositeExtract 73 1 + 76: 6(float) CompositeExtract 73 2 + 77: 7(fvec4) CompositeConstruct 74 75 76 28 + 78: 6(float) CompositeExtract 77 3 + 79: 6(float) ImageSampleDrefExplicitLod 71 77 78 Lod 33 + Store 64(r30) 79 + 84: 81 Load 83(g_tTex2di4a) + 85: 18 Load 20(g_sSamp) + 87: 86 SampledImage 84 85 + 88: 6(float) CompositeExtract 73 0 + 89: 6(float) CompositeExtract 73 1 + 90: 6(float) CompositeExtract 73 2 + 91: 7(fvec4) CompositeConstruct 88 89 90 28 + 92: 6(float) CompositeExtract 91 3 + 93: 6(float) ImageSampleDrefExplicitLod 87 91 92 Lod 33 + Store 80(r32) 93 + 98: 95 Load 97(g_tTex2du4a) + 99: 18 Load 20(g_sSamp) + 101: 100 SampledImage 98 99 + 102: 6(float) CompositeExtract 73 0 + 103: 6(float) CompositeExtract 73 1 + 104: 6(float) CompositeExtract 73 2 + 105: 7(fvec4) CompositeConstruct 102 103 104 28 + 106: 6(float) CompositeExtract 105 3 + 107: 6(float) ImageSampleDrefExplicitLod 101 105 106 Lod 33 + Store 94(r34) 107 + 112: 109 Load 111(g_tTexcdf4a) + 113: 18 Load 20(g_sSamp) + 115: 114 SampledImage 112 113 + 118: 6(float) CompositeExtract 117 0 + 119: 6(float) CompositeExtract 117 1 + 120: 6(float) CompositeExtract 117 2 + 121: 6(float) CompositeExtract 117 3 + 122: 7(fvec4) CompositeConstruct 118 119 120 121 + 123: 6(float) ImageSampleDrefExplicitLod 115 122 28 Lod 33 + Store 108(r60) 123 + 128: 125 Load 127(g_tTexcdi4a) + 129: 18 Load 20(g_sSamp) + 131: 130 SampledImage 128 129 + 132: 6(float) CompositeExtract 117 0 + 133: 6(float) CompositeExtract 117 1 + 134: 6(float) CompositeExtract 117 2 + 135: 6(float) CompositeExtract 117 3 + 136: 7(fvec4) CompositeConstruct 132 133 134 135 + 137: 6(float) ImageSampleDrefExplicitLod 131 136 28 Lod 33 + Store 124(r62) 137 + 142: 139 Load 141(g_tTexcdu4a) + 143: 18 Load 20(g_sSamp) + 145: 144 SampledImage 142 143 + 146: 6(float) CompositeExtract 117 0 + 147: 6(float) CompositeExtract 117 1 + 148: 6(float) CompositeExtract 117 2 + 149: 6(float) CompositeExtract 117 3 + 150: 7(fvec4) CompositeConstruct 146 147 148 149 + 151: 6(float) ImageSampleDrefExplicitLod 145 150 28 Lod 33 + Store 138(r64) 151 + 158: 157(ptr) AccessChain 153(psout) 154 + Store 158 156 + 160: 12(ptr) AccessChain 153(psout) 159 + Store 160 155 + 161:8(PS_OUTPUT) Load 153(psout) + ReturnValue 161 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.basic.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.basic.dx10.frag.out new file mode 100644 index 00000000..ffe22988 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.basic.dx10.frag.out @@ -0,0 +1,713 @@ +hlsl.samplecmplevelzero.basic.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Parameters: +0:? Sequence +0:42 Sequence +0:42 move second child to first child ( temp float) +0:42 'r00' ( temp float) +0:42 textureLod ( temp float) +0:42 Construct combined texture-sampler ( temp sampler1DShadow) +0:42 'g_tTex1df4' (layout( binding=0) uniform texture1DShadow) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:42 Construct vec2 ( temp 2-component vector of float) +0:42 Constant: +0:42 0.100000 +0:42 Constant: +0:42 0.750000 +0:42 Constant: +0:42 0.000000 +0:43 Sequence +0:43 move second child to first child ( temp float) +0:43 'r02' ( temp float) +0:43 textureLod ( temp float) +0:43 Construct combined texture-sampler ( temp isampler1DShadow) +0:43 'g_tTex1di4' ( uniform itexture1DShadow) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:43 Construct vec2 ( temp 2-component vector of float) +0:43 Constant: +0:43 0.100000 +0:43 Constant: +0:43 0.750000 +0:43 Constant: +0:43 0.000000 +0:44 Sequence +0:44 move second child to first child ( temp float) +0:44 'r04' ( temp float) +0:44 textureLod ( temp float) +0:44 Construct combined texture-sampler ( temp usampler1DShadow) +0:44 'g_tTex1du4' ( uniform utexture1DShadow) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:44 Construct vec2 ( temp 2-component vector of float) +0:44 Constant: +0:44 0.100000 +0:44 Constant: +0:44 0.750000 +0:44 Constant: +0:44 0.000000 +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'r20' ( temp float) +0:47 textureLod ( temp float) +0:47 Construct combined texture-sampler ( temp sampler2DShadow) +0:47 'g_tTex2df4' ( uniform texture2DShadow) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:47 Constant: +0:47 0.750000 +0:47 Constant: +0:47 0.000000 +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'r22' ( temp float) +0:48 textureLod ( temp float) +0:48 Construct combined texture-sampler ( temp isampler2DShadow) +0:48 'g_tTex2di4' ( uniform itexture2DShadow) +0:48 'g_sSamp' (layout( binding=0) uniform sampler) +0:48 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:48 Constant: +0:48 0.750000 +0:48 Constant: +0:48 0.000000 +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'r24' ( temp float) +0:49 textureLod ( temp float) +0:49 Construct combined texture-sampler ( temp usampler2DShadow) +0:49 'g_tTex2du4' ( uniform utexture2DShadow) +0:49 'g_sSamp' (layout( binding=0) uniform sampler) +0:49 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:49 Constant: +0:49 0.750000 +0:49 Constant: +0:49 0.000000 +0:53 Sequence +0:53 move second child to first child ( temp float) +0:53 'r50' ( temp float) +0:53 textureLod ( temp float) +0:53 Construct combined texture-sampler ( temp samplerCubeShadow) +0:53 'g_tTexcdf4' ( uniform textureCubeShadow) +0:53 'g_sSamp' (layout( binding=0) uniform sampler) +0:53 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:53 Constant: +0:53 0.750000 +0:53 Constant: +0:53 0.000000 +0:54 Sequence +0:54 move second child to first child ( temp float) +0:54 'r52' ( temp float) +0:54 textureLod ( temp float) +0:54 Construct combined texture-sampler ( temp isamplerCubeShadow) +0:54 'g_tTexcdi4' ( uniform itextureCubeShadow) +0:54 'g_sSamp' (layout( binding=0) uniform sampler) +0:54 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:54 Constant: +0:54 0.750000 +0:54 Constant: +0:54 0.000000 +0:55 Sequence +0:55 move second child to first child ( temp float) +0:55 'r54' ( temp float) +0:55 textureLod ( temp float) +0:55 Construct combined texture-sampler ( temp usamplerCubeShadow) +0:55 'g_tTexcdu4' ( uniform utextureCubeShadow) +0:55 'g_sSamp' (layout( binding=0) uniform sampler) +0:55 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:55 Constant: +0:55 0.750000 +0:55 Constant: +0:55 0.000000 +0:57 move second child to first child ( temp 4-component vector of float) +0:57 Color: direct index for structure ( temp 4-component vector of float) +0:57 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1.000000 +0:57 1.000000 +0:57 1.000000 +0:57 1.000000 +0:58 move second child to first child ( temp float) +0:58 Depth: direct index for structure ( temp float) +0:58 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:58 Constant: +0:58 1 (const int) +0:58 Constant: +0:58 1.000000 +0:60 Branch: Return with expression +0:60 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Definition: main( ( temp void) +0:38 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:38 Color: direct index for structure ( temp 4-component vector of float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 0 (const int) +0:38 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:38 Depth: direct index for structure ( temp float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DShadow) +0:? 'g_tTex1di4' ( uniform itexture1DShadow) +0:? 'g_tTex1du4' ( uniform utexture1DShadow) +0:? 'g_tTex2df4' ( uniform texture2DShadow) +0:? 'g_tTex2di4' ( uniform itexture2DShadow) +0:? 'g_tTex2du4' ( uniform utexture2DShadow) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCubeShadow) +0:? 'g_tTexcdi4' ( uniform itextureCubeShadow) +0:? 'g_tTexcdu4' ( uniform utextureCubeShadow) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Parameters: +0:? Sequence +0:42 Sequence +0:42 move second child to first child ( temp float) +0:42 'r00' ( temp float) +0:42 textureLod ( temp float) +0:42 Construct combined texture-sampler ( temp sampler1DShadow) +0:42 'g_tTex1df4' (layout( binding=0) uniform texture1DShadow) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:42 Construct vec2 ( temp 2-component vector of float) +0:42 Constant: +0:42 0.100000 +0:42 Constant: +0:42 0.750000 +0:42 Constant: +0:42 0.000000 +0:43 Sequence +0:43 move second child to first child ( temp float) +0:43 'r02' ( temp float) +0:43 textureLod ( temp float) +0:43 Construct combined texture-sampler ( temp isampler1DShadow) +0:43 'g_tTex1di4' ( uniform itexture1DShadow) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:43 Construct vec2 ( temp 2-component vector of float) +0:43 Constant: +0:43 0.100000 +0:43 Constant: +0:43 0.750000 +0:43 Constant: +0:43 0.000000 +0:44 Sequence +0:44 move second child to first child ( temp float) +0:44 'r04' ( temp float) +0:44 textureLod ( temp float) +0:44 Construct combined texture-sampler ( temp usampler1DShadow) +0:44 'g_tTex1du4' ( uniform utexture1DShadow) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:44 Construct vec2 ( temp 2-component vector of float) +0:44 Constant: +0:44 0.100000 +0:44 Constant: +0:44 0.750000 +0:44 Constant: +0:44 0.000000 +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'r20' ( temp float) +0:47 textureLod ( temp float) +0:47 Construct combined texture-sampler ( temp sampler2DShadow) +0:47 'g_tTex2df4' ( uniform texture2DShadow) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:47 Constant: +0:47 0.750000 +0:47 Constant: +0:47 0.000000 +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'r22' ( temp float) +0:48 textureLod ( temp float) +0:48 Construct combined texture-sampler ( temp isampler2DShadow) +0:48 'g_tTex2di4' ( uniform itexture2DShadow) +0:48 'g_sSamp' (layout( binding=0) uniform sampler) +0:48 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:48 Constant: +0:48 0.750000 +0:48 Constant: +0:48 0.000000 +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'r24' ( temp float) +0:49 textureLod ( temp float) +0:49 Construct combined texture-sampler ( temp usampler2DShadow) +0:49 'g_tTex2du4' ( uniform utexture2DShadow) +0:49 'g_sSamp' (layout( binding=0) uniform sampler) +0:49 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:49 Constant: +0:49 0.750000 +0:49 Constant: +0:49 0.000000 +0:53 Sequence +0:53 move second child to first child ( temp float) +0:53 'r50' ( temp float) +0:53 textureLod ( temp float) +0:53 Construct combined texture-sampler ( temp samplerCubeShadow) +0:53 'g_tTexcdf4' ( uniform textureCubeShadow) +0:53 'g_sSamp' (layout( binding=0) uniform sampler) +0:53 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:53 Constant: +0:53 0.750000 +0:53 Constant: +0:53 0.000000 +0:54 Sequence +0:54 move second child to first child ( temp float) +0:54 'r52' ( temp float) +0:54 textureLod ( temp float) +0:54 Construct combined texture-sampler ( temp isamplerCubeShadow) +0:54 'g_tTexcdi4' ( uniform itextureCubeShadow) +0:54 'g_sSamp' (layout( binding=0) uniform sampler) +0:54 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:54 Constant: +0:54 0.750000 +0:54 Constant: +0:54 0.000000 +0:55 Sequence +0:55 move second child to first child ( temp float) +0:55 'r54' ( temp float) +0:55 textureLod ( temp float) +0:55 Construct combined texture-sampler ( temp usamplerCubeShadow) +0:55 'g_tTexcdu4' ( uniform utextureCubeShadow) +0:55 'g_sSamp' (layout( binding=0) uniform sampler) +0:55 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:55 Constant: +0:55 0.750000 +0:55 Constant: +0:55 0.000000 +0:57 move second child to first child ( temp 4-component vector of float) +0:57 Color: direct index for structure ( temp 4-component vector of float) +0:57 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1.000000 +0:57 1.000000 +0:57 1.000000 +0:57 1.000000 +0:58 move second child to first child ( temp float) +0:58 Depth: direct index for structure ( temp float) +0:58 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:58 Constant: +0:58 1 (const int) +0:58 Constant: +0:58 1.000000 +0:60 Branch: Return with expression +0:60 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Definition: main( ( temp void) +0:38 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:38 Color: direct index for structure ( temp 4-component vector of float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 0 (const int) +0:38 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:38 Depth: direct index for structure ( temp float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DShadow) +0:? 'g_tTex1di4' ( uniform itexture1DShadow) +0:? 'g_tTex1du4' ( uniform utexture1DShadow) +0:? 'g_tTex2df4' ( uniform texture2DShadow) +0:? 'g_tTex2di4' ( uniform itexture2DShadow) +0:? 'g_tTex2du4' ( uniform utexture2DShadow) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCubeShadow) +0:? 'g_tTexcdi4' ( uniform itextureCubeShadow) +0:? 'g_tTexcdu4' ( uniform utextureCubeShadow) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: Expected Image 'Sampled Type' to be the same as Result Type + %42 = OpImageSampleDrefExplicitLod %float %39 %40 %41 Lod %float_0 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 199 + + Capability Shader + Capability Sampled1D + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 156 160 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "r00" + Name 16 "g_tTex1df4" + Name 20 "g_sSamp" + Name 31 "r02" + Name 35 "g_tTex1di4" + Name 43 "r04" + Name 47 "g_tTex1du4" + Name 55 "r20" + Name 58 "g_tTex2df4" + Name 71 "r22" + Name 74 "g_tTex2di4" + Name 84 "r24" + Name 87 "g_tTex2du4" + Name 97 "r50" + Name 100 "g_tTexcdf4" + Name 113 "r52" + Name 116 "g_tTexcdi4" + Name 127 "r54" + Name 130 "g_tTexcdu4" + Name 142 "psout" + Name 153 "flattenTemp" + Name 156 "@entryPointOutput.Color" + Name 160 "@entryPointOutput.Depth" + Name 165 "g_tTex3df4" + Name 168 "g_tTex3di4" + Name 171 "g_tTex3du4" + Name 174 "g_tTex1df4a" + Name 177 "g_tTex1di4a" + Name 180 "g_tTex1du4a" + Name 183 "g_tTex2df4a" + Name 186 "g_tTex2di4a" + Name 189 "g_tTex2du4a" + Name 192 "g_tTexcdf4a" + Name 195 "g_tTexcdi4a" + Name 198 "g_tTexcdu4a" + Decorate 16(g_tTex1df4) DescriptorSet 0 + Decorate 16(g_tTex1df4) Binding 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 35(g_tTex1di4) DescriptorSet 0 + Decorate 47(g_tTex1du4) DescriptorSet 0 + Decorate 58(g_tTex2df4) DescriptorSet 0 + Decorate 74(g_tTex2di4) DescriptorSet 0 + Decorate 87(g_tTex2du4) DescriptorSet 0 + Decorate 100(g_tTexcdf4) DescriptorSet 0 + Decorate 116(g_tTexcdi4) DescriptorSet 0 + Decorate 130(g_tTexcdu4) DescriptorSet 0 + Decorate 156(@entryPointOutput.Color) Location 0 + Decorate 160(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 165(g_tTex3df4) DescriptorSet 0 + Decorate 168(g_tTex3di4) DescriptorSet 0 + Decorate 171(g_tTex3du4) DescriptorSet 0 + Decorate 174(g_tTex1df4a) DescriptorSet 0 + Decorate 177(g_tTex1di4a) DescriptorSet 0 + Decorate 180(g_tTex1du4a) DescriptorSet 0 + Decorate 183(g_tTex2df4a) DescriptorSet 0 + Decorate 186(g_tTex2di4a) DescriptorSet 0 + Decorate 189(g_tTex2du4a) DescriptorSet 0 + Decorate 192(g_tTexcdf4a) DescriptorSet 0 + Decorate 195(g_tTexcdi4a) DescriptorSet 0 + Decorate 198(g_tTexcdu4a) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 6(float) + 14: TypeImage 6(float) 1D depth sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: 6(float) Constant 1036831949 + 25: 6(float) Constant 1061158912 + 26: TypeVector 6(float) 2 + 28: 6(float) Constant 0 + 32: TypeInt 32 1 + 33: TypeImage 32(int) 1D depth sampled format:Unknown + 34: TypePointer UniformConstant 33 + 35(g_tTex1di4): 34(ptr) Variable UniformConstant + 38: TypeSampledImage 33 + 44: TypeInt 32 0 + 45: TypeImage 44(int) 1D depth sampled format:Unknown + 46: TypePointer UniformConstant 45 + 47(g_tTex1du4): 46(ptr) Variable UniformConstant + 50: TypeSampledImage 45 + 56: TypeImage 6(float) 2D depth sampled format:Unknown + 57: TypePointer UniformConstant 56 + 58(g_tTex2df4): 57(ptr) Variable UniformConstant + 61: TypeSampledImage 56 + 63: 6(float) Constant 1045220557 + 64: 26(fvec2) ConstantComposite 24 63 + 65: TypeVector 6(float) 3 + 72: TypeImage 32(int) 2D depth sampled format:Unknown + 73: TypePointer UniformConstant 72 + 74(g_tTex2di4): 73(ptr) Variable UniformConstant + 77: TypeSampledImage 72 + 85: TypeImage 44(int) 2D depth sampled format:Unknown + 86: TypePointer UniformConstant 85 + 87(g_tTex2du4): 86(ptr) Variable UniformConstant + 90: TypeSampledImage 85 + 98: TypeImage 6(float) Cube depth sampled format:Unknown + 99: TypePointer UniformConstant 98 + 100(g_tTexcdf4): 99(ptr) Variable UniformConstant + 103: TypeSampledImage 98 + 105: 6(float) Constant 1050253722 + 106: 65(fvec3) ConstantComposite 24 63 105 + 114: TypeImage 32(int) Cube depth sampled format:Unknown + 115: TypePointer UniformConstant 114 + 116(g_tTexcdi4): 115(ptr) Variable UniformConstant + 119: TypeSampledImage 114 + 128: TypeImage 44(int) Cube depth sampled format:Unknown + 129: TypePointer UniformConstant 128 + 130(g_tTexcdu4): 129(ptr) Variable UniformConstant + 133: TypeSampledImage 128 + 141: TypePointer Function 8(PS_OUTPUT) + 143: 32(int) Constant 0 + 144: 6(float) Constant 1065353216 + 145: 7(fvec4) ConstantComposite 144 144 144 144 + 146: TypePointer Function 7(fvec4) + 148: 32(int) Constant 1 + 155: TypePointer Output 7(fvec4) +156(@entryPointOutput.Color): 155(ptr) Variable Output + 159: TypePointer Output 6(float) +160(@entryPointOutput.Depth): 159(ptr) Variable Output + 163: TypeImage 6(float) 3D sampled format:Unknown + 164: TypePointer UniformConstant 163 + 165(g_tTex3df4): 164(ptr) Variable UniformConstant + 166: TypeImage 32(int) 3D sampled format:Unknown + 167: TypePointer UniformConstant 166 + 168(g_tTex3di4): 167(ptr) Variable UniformConstant + 169: TypeImage 44(int) 3D sampled format:Unknown + 170: TypePointer UniformConstant 169 + 171(g_tTex3du4): 170(ptr) Variable UniformConstant + 172: TypeImage 6(float) 1D array sampled format:Unknown + 173: TypePointer UniformConstant 172 +174(g_tTex1df4a): 173(ptr) Variable UniformConstant + 175: TypeImage 32(int) 1D array sampled format:Unknown + 176: TypePointer UniformConstant 175 +177(g_tTex1di4a): 176(ptr) Variable UniformConstant + 178: TypeImage 44(int) 1D array sampled format:Unknown + 179: TypePointer UniformConstant 178 +180(g_tTex1du4a): 179(ptr) Variable UniformConstant + 181: TypeImage 6(float) 2D array sampled format:Unknown + 182: TypePointer UniformConstant 181 +183(g_tTex2df4a): 182(ptr) Variable UniformConstant + 184: TypeImage 32(int) 2D array sampled format:Unknown + 185: TypePointer UniformConstant 184 +186(g_tTex2di4a): 185(ptr) Variable UniformConstant + 187: TypeImage 44(int) 2D array sampled format:Unknown + 188: TypePointer UniformConstant 187 +189(g_tTex2du4a): 188(ptr) Variable UniformConstant + 190: TypeImage 6(float) Cube array sampled format:Unknown + 191: TypePointer UniformConstant 190 +192(g_tTexcdf4a): 191(ptr) Variable UniformConstant + 193: TypeImage 32(int) Cube array sampled format:Unknown + 194: TypePointer UniformConstant 193 +195(g_tTexcdi4a): 194(ptr) Variable UniformConstant + 196: TypeImage 44(int) Cube array sampled format:Unknown + 197: TypePointer UniformConstant 196 +198(g_tTexcdu4a): 197(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +153(flattenTemp): 141(ptr) Variable Function + 154:8(PS_OUTPUT) FunctionCall 10(@main() + Store 153(flattenTemp) 154 + 157: 146(ptr) AccessChain 153(flattenTemp) 143 + 158: 7(fvec4) Load 157 + Store 156(@entryPointOutput.Color) 158 + 161: 12(ptr) AccessChain 153(flattenTemp) 148 + 162: 6(float) Load 161 + Store 160(@entryPointOutput.Depth) 162 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(r00): 12(ptr) Variable Function + 31(r02): 12(ptr) Variable Function + 43(r04): 12(ptr) Variable Function + 55(r20): 12(ptr) Variable Function + 71(r22): 12(ptr) Variable Function + 84(r24): 12(ptr) Variable Function + 97(r50): 12(ptr) Variable Function + 113(r52): 12(ptr) Variable Function + 127(r54): 12(ptr) Variable Function + 142(psout): 141(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 27: 26(fvec2) CompositeConstruct 24 25 + 29: 6(float) CompositeExtract 27 1 + 30: 6(float) ImageSampleDrefExplicitLod 23 27 29 Lod 28 + Store 13(r00) 30 + 36: 33 Load 35(g_tTex1di4) + 37: 18 Load 20(g_sSamp) + 39: 38 SampledImage 36 37 + 40: 26(fvec2) CompositeConstruct 24 25 + 41: 6(float) CompositeExtract 40 1 + 42: 6(float) ImageSampleDrefExplicitLod 39 40 41 Lod 28 + Store 31(r02) 42 + 48: 45 Load 47(g_tTex1du4) + 49: 18 Load 20(g_sSamp) + 51: 50 SampledImage 48 49 + 52: 26(fvec2) CompositeConstruct 24 25 + 53: 6(float) CompositeExtract 52 1 + 54: 6(float) ImageSampleDrefExplicitLod 51 52 53 Lod 28 + Store 43(r04) 54 + 59: 56 Load 58(g_tTex2df4) + 60: 18 Load 20(g_sSamp) + 62: 61 SampledImage 59 60 + 66: 6(float) CompositeExtract 64 0 + 67: 6(float) CompositeExtract 64 1 + 68: 65(fvec3) CompositeConstruct 66 67 25 + 69: 6(float) CompositeExtract 68 2 + 70: 6(float) ImageSampleDrefExplicitLod 62 68 69 Lod 28 + Store 55(r20) 70 + 75: 72 Load 74(g_tTex2di4) + 76: 18 Load 20(g_sSamp) + 78: 77 SampledImage 75 76 + 79: 6(float) CompositeExtract 64 0 + 80: 6(float) CompositeExtract 64 1 + 81: 65(fvec3) CompositeConstruct 79 80 25 + 82: 6(float) CompositeExtract 81 2 + 83: 6(float) ImageSampleDrefExplicitLod 78 81 82 Lod 28 + Store 71(r22) 83 + 88: 85 Load 87(g_tTex2du4) + 89: 18 Load 20(g_sSamp) + 91: 90 SampledImage 88 89 + 92: 6(float) CompositeExtract 64 0 + 93: 6(float) CompositeExtract 64 1 + 94: 65(fvec3) CompositeConstruct 92 93 25 + 95: 6(float) CompositeExtract 94 2 + 96: 6(float) ImageSampleDrefExplicitLod 91 94 95 Lod 28 + Store 84(r24) 96 + 101: 98 Load 100(g_tTexcdf4) + 102: 18 Load 20(g_sSamp) + 104: 103 SampledImage 101 102 + 107: 6(float) CompositeExtract 106 0 + 108: 6(float) CompositeExtract 106 1 + 109: 6(float) CompositeExtract 106 2 + 110: 7(fvec4) CompositeConstruct 107 108 109 25 + 111: 6(float) CompositeExtract 110 3 + 112: 6(float) ImageSampleDrefExplicitLod 104 110 111 Lod 28 + Store 97(r50) 112 + 117: 114 Load 116(g_tTexcdi4) + 118: 18 Load 20(g_sSamp) + 120: 119 SampledImage 117 118 + 121: 6(float) CompositeExtract 106 0 + 122: 6(float) CompositeExtract 106 1 + 123: 6(float) CompositeExtract 106 2 + 124: 7(fvec4) CompositeConstruct 121 122 123 25 + 125: 6(float) CompositeExtract 124 3 + 126: 6(float) ImageSampleDrefExplicitLod 120 124 125 Lod 28 + Store 113(r52) 126 + 131: 128 Load 130(g_tTexcdu4) + 132: 18 Load 20(g_sSamp) + 134: 133 SampledImage 131 132 + 135: 6(float) CompositeExtract 106 0 + 136: 6(float) CompositeExtract 106 1 + 137: 6(float) CompositeExtract 106 2 + 138: 7(fvec4) CompositeConstruct 135 136 137 25 + 139: 6(float) CompositeExtract 138 3 + 140: 6(float) ImageSampleDrefExplicitLod 134 138 139 Lod 28 + Store 127(r54) 140 + 147: 146(ptr) AccessChain 142(psout) 143 + Store 147 145 + 149: 12(ptr) AccessChain 142(psout) 148 + Store 149 144 + 150:8(PS_OUTPUT) Load 142(psout) + ReturnValue 150 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.offset.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.offset.dx10.frag.out new file mode 100644 index 00000000..08e8749f --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.offset.dx10.frag.out @@ -0,0 +1,610 @@ +hlsl.samplecmplevelzero.offset.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Parameters: +0:? Sequence +0:42 Sequence +0:42 move second child to first child ( temp float) +0:42 'r01' ( temp float) +0:42 textureLodOffset ( temp float) +0:42 Construct combined texture-sampler ( temp sampler1DShadow) +0:42 'g_tTex1df4' (layout( binding=0) uniform texture1DShadow) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:42 Construct vec2 ( temp 2-component vector of float) +0:42 Constant: +0:42 0.100000 +0:42 Constant: +0:42 0.750000 +0:42 Constant: +0:42 0.000000 +0:42 Constant: +0:42 2 (const int) +0:43 Sequence +0:43 move second child to first child ( temp float) +0:43 'r03' ( temp float) +0:43 textureLodOffset ( temp float) +0:43 Construct combined texture-sampler ( temp isampler1DShadow) +0:43 'g_tTex1di4' ( uniform itexture1DShadow) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:43 Construct vec2 ( temp 2-component vector of float) +0:43 Constant: +0:43 0.100000 +0:43 Constant: +0:43 0.750000 +0:43 Constant: +0:43 0.000000 +0:43 Constant: +0:43 2 (const int) +0:44 Sequence +0:44 move second child to first child ( temp float) +0:44 'r05' ( temp float) +0:44 textureLodOffset ( temp float) +0:44 Construct combined texture-sampler ( temp usampler1DShadow) +0:44 'g_tTex1du4' ( uniform utexture1DShadow) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:44 Construct vec2 ( temp 2-component vector of float) +0:44 Constant: +0:44 0.100000 +0:44 Constant: +0:44 0.750000 +0:44 Constant: +0:44 0.000000 +0:44 Constant: +0:44 2 (const int) +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'r21' ( temp float) +0:47 textureLodOffset ( temp float) +0:47 Construct combined texture-sampler ( temp sampler2DShadow) +0:47 'g_tTex2df4' ( uniform texture2DShadow) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:47 Constant: +0:47 0.750000 +0:47 Constant: +0:47 0.000000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'r23' ( temp float) +0:48 textureLodOffset ( temp float) +0:48 Construct combined texture-sampler ( temp isampler2DShadow) +0:48 'g_tTex2di4' ( uniform itexture2DShadow) +0:48 'g_sSamp' (layout( binding=0) uniform sampler) +0:48 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:48 Constant: +0:48 0.750000 +0:48 Constant: +0:48 0.000000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'r25' ( temp float) +0:49 textureLodOffset ( temp float) +0:49 Construct combined texture-sampler ( temp usampler2DShadow) +0:49 'g_tTex2du4' ( uniform utexture2DShadow) +0:49 'g_sSamp' (layout( binding=0) uniform sampler) +0:49 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:49 Constant: +0:49 0.750000 +0:49 Constant: +0:49 0.000000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:62 move second child to first child ( temp 4-component vector of float) +0:62 Color: direct index for structure ( temp 4-component vector of float) +0:62 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1.000000 +0:62 1.000000 +0:62 1.000000 +0:62 1.000000 +0:63 move second child to first child ( temp float) +0:63 Depth: direct index for structure ( temp float) +0:63 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:63 Constant: +0:63 1 (const int) +0:63 Constant: +0:63 1.000000 +0:65 Branch: Return with expression +0:65 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Definition: main( ( temp void) +0:38 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:38 Color: direct index for structure ( temp 4-component vector of float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 0 (const int) +0:38 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:38 Depth: direct index for structure ( temp float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DShadow) +0:? 'g_tTex1di4' ( uniform itexture1DShadow) +0:? 'g_tTex1du4' ( uniform utexture1DShadow) +0:? 'g_tTex2df4' ( uniform texture2DShadow) +0:? 'g_tTex2di4' ( uniform itexture2DShadow) +0:? 'g_tTex2du4' ( uniform utexture2DShadow) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Parameters: +0:? Sequence +0:42 Sequence +0:42 move second child to first child ( temp float) +0:42 'r01' ( temp float) +0:42 textureLodOffset ( temp float) +0:42 Construct combined texture-sampler ( temp sampler1DShadow) +0:42 'g_tTex1df4' (layout( binding=0) uniform texture1DShadow) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:42 Construct vec2 ( temp 2-component vector of float) +0:42 Constant: +0:42 0.100000 +0:42 Constant: +0:42 0.750000 +0:42 Constant: +0:42 0.000000 +0:42 Constant: +0:42 2 (const int) +0:43 Sequence +0:43 move second child to first child ( temp float) +0:43 'r03' ( temp float) +0:43 textureLodOffset ( temp float) +0:43 Construct combined texture-sampler ( temp isampler1DShadow) +0:43 'g_tTex1di4' ( uniform itexture1DShadow) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:43 Construct vec2 ( temp 2-component vector of float) +0:43 Constant: +0:43 0.100000 +0:43 Constant: +0:43 0.750000 +0:43 Constant: +0:43 0.000000 +0:43 Constant: +0:43 2 (const int) +0:44 Sequence +0:44 move second child to first child ( temp float) +0:44 'r05' ( temp float) +0:44 textureLodOffset ( temp float) +0:44 Construct combined texture-sampler ( temp usampler1DShadow) +0:44 'g_tTex1du4' ( uniform utexture1DShadow) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:44 Construct vec2 ( temp 2-component vector of float) +0:44 Constant: +0:44 0.100000 +0:44 Constant: +0:44 0.750000 +0:44 Constant: +0:44 0.000000 +0:44 Constant: +0:44 2 (const int) +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'r21' ( temp float) +0:47 textureLodOffset ( temp float) +0:47 Construct combined texture-sampler ( temp sampler2DShadow) +0:47 'g_tTex2df4' ( uniform texture2DShadow) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:47 Constant: +0:47 0.750000 +0:47 Constant: +0:47 0.000000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'r23' ( temp float) +0:48 textureLodOffset ( temp float) +0:48 Construct combined texture-sampler ( temp isampler2DShadow) +0:48 'g_tTex2di4' ( uniform itexture2DShadow) +0:48 'g_sSamp' (layout( binding=0) uniform sampler) +0:48 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:48 Constant: +0:48 0.750000 +0:48 Constant: +0:48 0.000000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'r25' ( temp float) +0:49 textureLodOffset ( temp float) +0:49 Construct combined texture-sampler ( temp usampler2DShadow) +0:49 'g_tTex2du4' ( uniform utexture2DShadow) +0:49 'g_sSamp' (layout( binding=0) uniform sampler) +0:49 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:49 Constant: +0:49 0.750000 +0:49 Constant: +0:49 0.000000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:62 move second child to first child ( temp 4-component vector of float) +0:62 Color: direct index for structure ( temp 4-component vector of float) +0:62 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1.000000 +0:62 1.000000 +0:62 1.000000 +0:62 1.000000 +0:63 move second child to first child ( temp float) +0:63 Depth: direct index for structure ( temp float) +0:63 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:63 Constant: +0:63 1 (const int) +0:63 Constant: +0:63 1.000000 +0:65 Branch: Return with expression +0:65 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Definition: main( ( temp void) +0:38 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:38 Color: direct index for structure ( temp 4-component vector of float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 0 (const int) +0:38 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:38 Depth: direct index for structure ( temp float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DShadow) +0:? 'g_tTex1di4' ( uniform itexture1DShadow) +0:? 'g_tTex1du4' ( uniform utexture1DShadow) +0:? 'g_tTex2df4' ( uniform texture2DShadow) +0:? 'g_tTex2di4' ( uniform itexture2DShadow) +0:? 'g_tTex2du4' ( uniform utexture2DShadow) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: Expected Image 'Sampled Type' to be the same as Result Type + %43 = OpImageSampleDrefExplicitLod %float %40 %41 %42 Lod|ConstOffset %float_0 %int_2 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 168 + + Capability Shader + Capability Sampled1D + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 116 120 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "r01" + Name 16 "g_tTex1df4" + Name 20 "g_sSamp" + Name 33 "r03" + Name 36 "g_tTex1di4" + Name 44 "r05" + Name 48 "g_tTex1du4" + Name 56 "r21" + Name 59 "g_tTex2df4" + Name 75 "r23" + Name 78 "g_tTex2di4" + Name 88 "r25" + Name 91 "g_tTex2du4" + Name 102 "psout" + Name 113 "flattenTemp" + Name 116 "@entryPointOutput.Color" + Name 120 "@entryPointOutput.Depth" + Name 125 "g_tTex3df4" + Name 128 "g_tTex3di4" + Name 131 "g_tTex3du4" + Name 134 "g_tTexcdf4" + Name 137 "g_tTexcdi4" + Name 140 "g_tTexcdu4" + Name 143 "g_tTex1df4a" + Name 146 "g_tTex1di4a" + Name 149 "g_tTex1du4a" + Name 152 "g_tTex2df4a" + Name 155 "g_tTex2di4a" + Name 158 "g_tTex2du4a" + Name 161 "g_tTexcdf4a" + Name 164 "g_tTexcdi4a" + Name 167 "g_tTexcdu4a" + Decorate 16(g_tTex1df4) DescriptorSet 0 + Decorate 16(g_tTex1df4) Binding 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 36(g_tTex1di4) DescriptorSet 0 + Decorate 48(g_tTex1du4) DescriptorSet 0 + Decorate 59(g_tTex2df4) DescriptorSet 0 + Decorate 78(g_tTex2di4) DescriptorSet 0 + Decorate 91(g_tTex2du4) DescriptorSet 0 + Decorate 116(@entryPointOutput.Color) Location 0 + Decorate 120(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 125(g_tTex3df4) DescriptorSet 0 + Decorate 128(g_tTex3di4) DescriptorSet 0 + Decorate 131(g_tTex3du4) DescriptorSet 0 + Decorate 134(g_tTexcdf4) DescriptorSet 0 + Decorate 137(g_tTexcdi4) DescriptorSet 0 + Decorate 140(g_tTexcdu4) DescriptorSet 0 + Decorate 143(g_tTex1df4a) DescriptorSet 0 + Decorate 146(g_tTex1di4a) DescriptorSet 0 + Decorate 149(g_tTex1du4a) DescriptorSet 0 + Decorate 152(g_tTex2df4a) DescriptorSet 0 + Decorate 155(g_tTex2di4a) DescriptorSet 0 + Decorate 158(g_tTex2du4a) DescriptorSet 0 + Decorate 161(g_tTexcdf4a) DescriptorSet 0 + Decorate 164(g_tTexcdi4a) DescriptorSet 0 + Decorate 167(g_tTexcdu4a) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 6(float) + 14: TypeImage 6(float) 1D depth sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: 6(float) Constant 1036831949 + 25: 6(float) Constant 1061158912 + 26: TypeVector 6(float) 2 + 28: 6(float) Constant 0 + 29: TypeInt 32 1 + 30: 29(int) Constant 2 + 34: TypeImage 29(int) 1D depth sampled format:Unknown + 35: TypePointer UniformConstant 34 + 36(g_tTex1di4): 35(ptr) Variable UniformConstant + 39: TypeSampledImage 34 + 45: TypeInt 32 0 + 46: TypeImage 45(int) 1D depth sampled format:Unknown + 47: TypePointer UniformConstant 46 + 48(g_tTex1du4): 47(ptr) Variable UniformConstant + 51: TypeSampledImage 46 + 57: TypeImage 6(float) 2D depth sampled format:Unknown + 58: TypePointer UniformConstant 57 + 59(g_tTex2df4): 58(ptr) Variable UniformConstant + 62: TypeSampledImage 57 + 64: 6(float) Constant 1045220557 + 65: 26(fvec2) ConstantComposite 24 64 + 66: TypeVector 6(float) 3 + 70: TypeVector 29(int) 2 + 71: 29(int) Constant 3 + 72: 70(ivec2) ConstantComposite 30 71 + 76: TypeImage 29(int) 2D depth sampled format:Unknown + 77: TypePointer UniformConstant 76 + 78(g_tTex2di4): 77(ptr) Variable UniformConstant + 81: TypeSampledImage 76 + 89: TypeImage 45(int) 2D depth sampled format:Unknown + 90: TypePointer UniformConstant 89 + 91(g_tTex2du4): 90(ptr) Variable UniformConstant + 94: TypeSampledImage 89 + 101: TypePointer Function 8(PS_OUTPUT) + 103: 29(int) Constant 0 + 104: 6(float) Constant 1065353216 + 105: 7(fvec4) ConstantComposite 104 104 104 104 + 106: TypePointer Function 7(fvec4) + 108: 29(int) Constant 1 + 115: TypePointer Output 7(fvec4) +116(@entryPointOutput.Color): 115(ptr) Variable Output + 119: TypePointer Output 6(float) +120(@entryPointOutput.Depth): 119(ptr) Variable Output + 123: TypeImage 6(float) 3D sampled format:Unknown + 124: TypePointer UniformConstant 123 + 125(g_tTex3df4): 124(ptr) Variable UniformConstant + 126: TypeImage 29(int) 3D sampled format:Unknown + 127: TypePointer UniformConstant 126 + 128(g_tTex3di4): 127(ptr) Variable UniformConstant + 129: TypeImage 45(int) 3D sampled format:Unknown + 130: TypePointer UniformConstant 129 + 131(g_tTex3du4): 130(ptr) Variable UniformConstant + 132: TypeImage 6(float) Cube sampled format:Unknown + 133: TypePointer UniformConstant 132 + 134(g_tTexcdf4): 133(ptr) Variable UniformConstant + 135: TypeImage 29(int) Cube sampled format:Unknown + 136: TypePointer UniformConstant 135 + 137(g_tTexcdi4): 136(ptr) Variable UniformConstant + 138: TypeImage 45(int) Cube sampled format:Unknown + 139: TypePointer UniformConstant 138 + 140(g_tTexcdu4): 139(ptr) Variable UniformConstant + 141: TypeImage 6(float) 1D array sampled format:Unknown + 142: TypePointer UniformConstant 141 +143(g_tTex1df4a): 142(ptr) Variable UniformConstant + 144: TypeImage 29(int) 1D array sampled format:Unknown + 145: TypePointer UniformConstant 144 +146(g_tTex1di4a): 145(ptr) Variable UniformConstant + 147: TypeImage 45(int) 1D array sampled format:Unknown + 148: TypePointer UniformConstant 147 +149(g_tTex1du4a): 148(ptr) Variable UniformConstant + 150: TypeImage 6(float) 2D array sampled format:Unknown + 151: TypePointer UniformConstant 150 +152(g_tTex2df4a): 151(ptr) Variable UniformConstant + 153: TypeImage 29(int) 2D array sampled format:Unknown + 154: TypePointer UniformConstant 153 +155(g_tTex2di4a): 154(ptr) Variable UniformConstant + 156: TypeImage 45(int) 2D array sampled format:Unknown + 157: TypePointer UniformConstant 156 +158(g_tTex2du4a): 157(ptr) Variable UniformConstant + 159: TypeImage 6(float) Cube array sampled format:Unknown + 160: TypePointer UniformConstant 159 +161(g_tTexcdf4a): 160(ptr) Variable UniformConstant + 162: TypeImage 29(int) Cube array sampled format:Unknown + 163: TypePointer UniformConstant 162 +164(g_tTexcdi4a): 163(ptr) Variable UniformConstant + 165: TypeImage 45(int) Cube array sampled format:Unknown + 166: TypePointer UniformConstant 165 +167(g_tTexcdu4a): 166(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +113(flattenTemp): 101(ptr) Variable Function + 114:8(PS_OUTPUT) FunctionCall 10(@main() + Store 113(flattenTemp) 114 + 117: 106(ptr) AccessChain 113(flattenTemp) 103 + 118: 7(fvec4) Load 117 + Store 116(@entryPointOutput.Color) 118 + 121: 12(ptr) AccessChain 113(flattenTemp) 108 + 122: 6(float) Load 121 + Store 120(@entryPointOutput.Depth) 122 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(r01): 12(ptr) Variable Function + 33(r03): 12(ptr) Variable Function + 44(r05): 12(ptr) Variable Function + 56(r21): 12(ptr) Variable Function + 75(r23): 12(ptr) Variable Function + 88(r25): 12(ptr) Variable Function + 102(psout): 101(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 27: 26(fvec2) CompositeConstruct 24 25 + 31: 6(float) CompositeExtract 27 1 + 32: 6(float) ImageSampleDrefExplicitLod 23 27 31 Lod ConstOffset 28 30 + Store 13(r01) 32 + 37: 34 Load 36(g_tTex1di4) + 38: 18 Load 20(g_sSamp) + 40: 39 SampledImage 37 38 + 41: 26(fvec2) CompositeConstruct 24 25 + 42: 6(float) CompositeExtract 41 1 + 43: 6(float) ImageSampleDrefExplicitLod 40 41 42 Lod ConstOffset 28 30 + Store 33(r03) 43 + 49: 46 Load 48(g_tTex1du4) + 50: 18 Load 20(g_sSamp) + 52: 51 SampledImage 49 50 + 53: 26(fvec2) CompositeConstruct 24 25 + 54: 6(float) CompositeExtract 53 1 + 55: 6(float) ImageSampleDrefExplicitLod 52 53 54 Lod ConstOffset 28 30 + Store 44(r05) 55 + 60: 57 Load 59(g_tTex2df4) + 61: 18 Load 20(g_sSamp) + 63: 62 SampledImage 60 61 + 67: 6(float) CompositeExtract 65 0 + 68: 6(float) CompositeExtract 65 1 + 69: 66(fvec3) CompositeConstruct 67 68 25 + 73: 6(float) CompositeExtract 69 2 + 74: 6(float) ImageSampleDrefExplicitLod 63 69 73 Lod ConstOffset 28 72 + Store 56(r21) 74 + 79: 76 Load 78(g_tTex2di4) + 80: 18 Load 20(g_sSamp) + 82: 81 SampledImage 79 80 + 83: 6(float) CompositeExtract 65 0 + 84: 6(float) CompositeExtract 65 1 + 85: 66(fvec3) CompositeConstruct 83 84 25 + 86: 6(float) CompositeExtract 85 2 + 87: 6(float) ImageSampleDrefExplicitLod 82 85 86 Lod ConstOffset 28 72 + Store 75(r23) 87 + 92: 89 Load 91(g_tTex2du4) + 93: 18 Load 20(g_sSamp) + 95: 94 SampledImage 92 93 + 96: 6(float) CompositeExtract 65 0 + 97: 6(float) CompositeExtract 65 1 + 98: 66(fvec3) CompositeConstruct 96 97 25 + 99: 6(float) CompositeExtract 98 2 + 100: 6(float) ImageSampleDrefExplicitLod 95 98 99 Lod ConstOffset 28 72 + Store 88(r25) 100 + 107: 106(ptr) AccessChain 102(psout) 103 + Store 107 105 + 109: 12(ptr) AccessChain 102(psout) 108 + Store 109 104 + 110:8(PS_OUTPUT) Load 102(psout) + ReturnValue 110 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.offsetarray.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.offsetarray.dx10.frag.out new file mode 100644 index 00000000..b5c0fc0d --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.offsetarray.dx10.frag.out @@ -0,0 +1,633 @@ +hlsl.samplecmplevelzero.offsetarray.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Parameters: +0:? Sequence +0:42 Sequence +0:42 move second child to first child ( temp float) +0:42 'r11' ( temp float) +0:42 textureLodOffset ( temp float) +0:42 Construct combined texture-sampler ( temp sampler1DArrayShadow) +0:42 'g_tTex1df4a' ( uniform texture1DArrayShadow) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:42 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:42 Constant: +0:42 0.750000 +0:42 Constant: +0:42 0.000000 +0:42 Constant: +0:42 2 (const int) +0:43 Sequence +0:43 move second child to first child ( temp float) +0:43 'r13' ( temp float) +0:43 textureLodOffset ( temp float) +0:43 Construct combined texture-sampler ( temp isampler1DArrayShadow) +0:43 'g_tTex1di4a' ( uniform itexture1DArrayShadow) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:43 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:43 Constant: +0:43 0.750000 +0:43 Constant: +0:43 0.000000 +0:43 Constant: +0:43 2 (const int) +0:44 Sequence +0:44 move second child to first child ( temp float) +0:44 'r15' ( temp float) +0:44 textureLodOffset ( temp float) +0:44 Construct combined texture-sampler ( temp usampler1DArrayShadow) +0:44 'g_tTex1du4a' ( uniform utexture1DArrayShadow) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:44 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:44 Constant: +0:44 0.750000 +0:44 Constant: +0:44 0.000000 +0:44 Constant: +0:44 2 (const int) +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'r31' ( temp float) +0:47 textureLodOffset ( temp float) +0:47 Construct combined texture-sampler ( temp sampler2DArrayShadow) +0:47 'g_tTex2df4a' ( uniform texture2DArrayShadow) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:47 Constant: +0:47 0.750000 +0:47 Constant: +0:47 0.000000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'r33' ( temp float) +0:48 textureLodOffset ( temp float) +0:48 Construct combined texture-sampler ( temp isampler2DArrayShadow) +0:48 'g_tTex2di4a' ( uniform itexture2DArrayShadow) +0:48 'g_sSamp' (layout( binding=0) uniform sampler) +0:48 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:48 Constant: +0:48 0.750000 +0:48 Constant: +0:48 0.000000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'r35' ( temp float) +0:49 textureLodOffset ( temp float) +0:49 Construct combined texture-sampler ( temp usampler2DArrayShadow) +0:49 'g_tTex2du4a' ( uniform utexture2DArrayShadow) +0:49 'g_sSamp' (layout( binding=0) uniform sampler) +0:49 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:49 Constant: +0:49 0.750000 +0:49 Constant: +0:49 0.000000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:63 move second child to first child ( temp 4-component vector of float) +0:63 Color: direct index for structure ( temp 4-component vector of float) +0:63 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:63 Constant: +0:63 0 (const int) +0:63 Constant: +0:63 1.000000 +0:63 1.000000 +0:63 1.000000 +0:63 1.000000 +0:64 move second child to first child ( temp float) +0:64 Depth: direct index for structure ( temp float) +0:64 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:64 Constant: +0:64 1 (const int) +0:64 Constant: +0:64 1.000000 +0:66 Branch: Return with expression +0:66 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Definition: main( ( temp void) +0:38 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:38 Color: direct index for structure ( temp 4-component vector of float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 0 (const int) +0:38 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:38 Depth: direct index for structure ( temp float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArrayShadow) +0:? 'g_tTex1di4a' ( uniform itexture1DArrayShadow) +0:? 'g_tTex1du4a' ( uniform utexture1DArrayShadow) +0:? 'g_tTex2df4a' ( uniform texture2DArrayShadow) +0:? 'g_tTex2di4a' ( uniform itexture2DArrayShadow) +0:? 'g_tTex2du4a' ( uniform utexture2DArrayShadow) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:38 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Parameters: +0:? Sequence +0:42 Sequence +0:42 move second child to first child ( temp float) +0:42 'r11' ( temp float) +0:42 textureLodOffset ( temp float) +0:42 Construct combined texture-sampler ( temp sampler1DArrayShadow) +0:42 'g_tTex1df4a' ( uniform texture1DArrayShadow) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:42 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:42 Constant: +0:42 0.750000 +0:42 Constant: +0:42 0.000000 +0:42 Constant: +0:42 2 (const int) +0:43 Sequence +0:43 move second child to first child ( temp float) +0:43 'r13' ( temp float) +0:43 textureLodOffset ( temp float) +0:43 Construct combined texture-sampler ( temp isampler1DArrayShadow) +0:43 'g_tTex1di4a' ( uniform itexture1DArrayShadow) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:43 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:43 Constant: +0:43 0.750000 +0:43 Constant: +0:43 0.000000 +0:43 Constant: +0:43 2 (const int) +0:44 Sequence +0:44 move second child to first child ( temp float) +0:44 'r15' ( temp float) +0:44 textureLodOffset ( temp float) +0:44 Construct combined texture-sampler ( temp usampler1DArrayShadow) +0:44 'g_tTex1du4a' ( uniform utexture1DArrayShadow) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:44 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:44 Constant: +0:44 0.750000 +0:44 Constant: +0:44 0.000000 +0:44 Constant: +0:44 2 (const int) +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'r31' ( temp float) +0:47 textureLodOffset ( temp float) +0:47 Construct combined texture-sampler ( temp sampler2DArrayShadow) +0:47 'g_tTex2df4a' ( uniform texture2DArrayShadow) +0:47 'g_sSamp' (layout( binding=0) uniform sampler) +0:47 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:47 Constant: +0:47 0.750000 +0:47 Constant: +0:47 0.000000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'r33' ( temp float) +0:48 textureLodOffset ( temp float) +0:48 Construct combined texture-sampler ( temp isampler2DArrayShadow) +0:48 'g_tTex2di4a' ( uniform itexture2DArrayShadow) +0:48 'g_sSamp' (layout( binding=0) uniform sampler) +0:48 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:48 Constant: +0:48 0.750000 +0:48 Constant: +0:48 0.000000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'r35' ( temp float) +0:49 textureLodOffset ( temp float) +0:49 Construct combined texture-sampler ( temp usampler2DArrayShadow) +0:49 'g_tTex2du4a' ( uniform utexture2DArrayShadow) +0:49 'g_sSamp' (layout( binding=0) uniform sampler) +0:49 Construct vec4 ( temp 4-component vector of float) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:49 Constant: +0:49 0.750000 +0:49 Constant: +0:49 0.000000 +0:? Constant: +0:? 2 (const int) +0:? 3 (const int) +0:63 move second child to first child ( temp 4-component vector of float) +0:63 Color: direct index for structure ( temp 4-component vector of float) +0:63 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:63 Constant: +0:63 0 (const int) +0:63 Constant: +0:63 1.000000 +0:63 1.000000 +0:63 1.000000 +0:63 1.000000 +0:64 move second child to first child ( temp float) +0:64 Depth: direct index for structure ( temp float) +0:64 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:64 Constant: +0:64 1 (const int) +0:64 Constant: +0:64 1.000000 +0:66 Branch: Return with expression +0:66 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Definition: main( ( temp void) +0:38 Function Parameters: +0:? Sequence +0:38 Sequence +0:38 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:38 Color: direct index for structure ( temp 4-component vector of float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 0 (const int) +0:38 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:38 Depth: direct index for structure ( temp float) +0:38 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:38 Constant: +0:38 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? 'g_tTex1df4a' ( uniform texture1DArrayShadow) +0:? 'g_tTex1di4a' ( uniform itexture1DArrayShadow) +0:? 'g_tTex1du4a' ( uniform utexture1DArrayShadow) +0:? 'g_tTex2df4a' ( uniform texture2DArrayShadow) +0:? 'g_tTex2di4a' ( uniform itexture2DArrayShadow) +0:? 'g_tTex2du4a' ( uniform utexture2DArrayShadow) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: Expected Image 'Sampled Type' to be the same as Result Type + %50 = OpImageSampleDrefExplicitLod %float %45 %48 %49 Lod|ConstOffset %float_0 %int_2 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 179 + + Capability Shader + Capability Sampled1D + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 127 131 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "r11" + Name 16 "g_tTex1df4a" + Name 20 "g_sSamp" + Name 38 "r13" + Name 41 "g_tTex1di4a" + Name 51 "r15" + Name 55 "g_tTex1du4a" + Name 65 "r31" + Name 68 "g_tTex2df4a" + Name 84 "r33" + Name 87 "g_tTex2di4a" + Name 98 "r35" + Name 101 "g_tTex2du4a" + Name 113 "psout" + Name 124 "flattenTemp" + Name 127 "@entryPointOutput.Color" + Name 131 "@entryPointOutput.Depth" + Name 136 "g_tTex1df4" + Name 139 "g_tTex1di4" + Name 142 "g_tTex1du4" + Name 145 "g_tTex2df4" + Name 148 "g_tTex2di4" + Name 151 "g_tTex2du4" + Name 154 "g_tTex3df4" + Name 157 "g_tTex3di4" + Name 160 "g_tTex3du4" + Name 163 "g_tTexcdf4" + Name 166 "g_tTexcdi4" + Name 169 "g_tTexcdu4" + Name 172 "g_tTexcdf4a" + Name 175 "g_tTexcdi4a" + Name 178 "g_tTexcdu4a" + Decorate 16(g_tTex1df4a) DescriptorSet 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 41(g_tTex1di4a) DescriptorSet 0 + Decorate 55(g_tTex1du4a) DescriptorSet 0 + Decorate 68(g_tTex2df4a) DescriptorSet 0 + Decorate 87(g_tTex2di4a) DescriptorSet 0 + Decorate 101(g_tTex2du4a) DescriptorSet 0 + Decorate 127(@entryPointOutput.Color) Location 0 + Decorate 131(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 136(g_tTex1df4) DescriptorSet 0 + Decorate 136(g_tTex1df4) Binding 0 + Decorate 139(g_tTex1di4) DescriptorSet 0 + Decorate 142(g_tTex1du4) DescriptorSet 0 + Decorate 145(g_tTex2df4) DescriptorSet 0 + Decorate 148(g_tTex2di4) DescriptorSet 0 + Decorate 151(g_tTex2du4) DescriptorSet 0 + Decorate 154(g_tTex3df4) DescriptorSet 0 + Decorate 157(g_tTex3di4) DescriptorSet 0 + Decorate 160(g_tTex3du4) DescriptorSet 0 + Decorate 163(g_tTexcdf4) DescriptorSet 0 + Decorate 166(g_tTexcdi4) DescriptorSet 0 + Decorate 169(g_tTexcdu4) DescriptorSet 0 + Decorate 172(g_tTexcdf4a) DescriptorSet 0 + Decorate 175(g_tTexcdi4a) DescriptorSet 0 + Decorate 178(g_tTexcdu4a) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 6(float) + 14: TypeImage 6(float) 1D depth array sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4a): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 2 + 25: 6(float) Constant 1036831949 + 26: 6(float) Constant 1045220557 + 27: 24(fvec2) ConstantComposite 25 26 + 28: 6(float) Constant 1061158912 + 29: TypeVector 6(float) 3 + 33: 6(float) Constant 0 + 34: TypeInt 32 1 + 35: 34(int) Constant 2 + 39: TypeImage 34(int) 1D depth array sampled format:Unknown + 40: TypePointer UniformConstant 39 + 41(g_tTex1di4a): 40(ptr) Variable UniformConstant + 44: TypeSampledImage 39 + 52: TypeInt 32 0 + 53: TypeImage 52(int) 1D depth array sampled format:Unknown + 54: TypePointer UniformConstant 53 + 55(g_tTex1du4a): 54(ptr) Variable UniformConstant + 58: TypeSampledImage 53 + 66: TypeImage 6(float) 2D depth array sampled format:Unknown + 67: TypePointer UniformConstant 66 + 68(g_tTex2df4a): 67(ptr) Variable UniformConstant + 71: TypeSampledImage 66 + 73: 6(float) Constant 1050253722 + 74: 29(fvec3) ConstantComposite 25 26 73 + 79: TypeVector 34(int) 2 + 80: 34(int) Constant 3 + 81: 79(ivec2) ConstantComposite 35 80 + 85: TypeImage 34(int) 2D depth array sampled format:Unknown + 86: TypePointer UniformConstant 85 + 87(g_tTex2di4a): 86(ptr) Variable UniformConstant + 90: TypeSampledImage 85 + 99: TypeImage 52(int) 2D depth array sampled format:Unknown + 100: TypePointer UniformConstant 99 +101(g_tTex2du4a): 100(ptr) Variable UniformConstant + 104: TypeSampledImage 99 + 112: TypePointer Function 8(PS_OUTPUT) + 114: 34(int) Constant 0 + 115: 6(float) Constant 1065353216 + 116: 7(fvec4) ConstantComposite 115 115 115 115 + 117: TypePointer Function 7(fvec4) + 119: 34(int) Constant 1 + 126: TypePointer Output 7(fvec4) +127(@entryPointOutput.Color): 126(ptr) Variable Output + 130: TypePointer Output 6(float) +131(@entryPointOutput.Depth): 130(ptr) Variable Output + 134: TypeImage 6(float) 1D sampled format:Unknown + 135: TypePointer UniformConstant 134 + 136(g_tTex1df4): 135(ptr) Variable UniformConstant + 137: TypeImage 34(int) 1D sampled format:Unknown + 138: TypePointer UniformConstant 137 + 139(g_tTex1di4): 138(ptr) Variable UniformConstant + 140: TypeImage 52(int) 1D sampled format:Unknown + 141: TypePointer UniformConstant 140 + 142(g_tTex1du4): 141(ptr) Variable UniformConstant + 143: TypeImage 6(float) 2D sampled format:Unknown + 144: TypePointer UniformConstant 143 + 145(g_tTex2df4): 144(ptr) Variable UniformConstant + 146: TypeImage 34(int) 2D sampled format:Unknown + 147: TypePointer UniformConstant 146 + 148(g_tTex2di4): 147(ptr) Variable UniformConstant + 149: TypeImage 52(int) 2D sampled format:Unknown + 150: TypePointer UniformConstant 149 + 151(g_tTex2du4): 150(ptr) Variable UniformConstant + 152: TypeImage 6(float) 3D sampled format:Unknown + 153: TypePointer UniformConstant 152 + 154(g_tTex3df4): 153(ptr) Variable UniformConstant + 155: TypeImage 34(int) 3D sampled format:Unknown + 156: TypePointer UniformConstant 155 + 157(g_tTex3di4): 156(ptr) Variable UniformConstant + 158: TypeImage 52(int) 3D sampled format:Unknown + 159: TypePointer UniformConstant 158 + 160(g_tTex3du4): 159(ptr) Variable UniformConstant + 161: TypeImage 6(float) Cube sampled format:Unknown + 162: TypePointer UniformConstant 161 + 163(g_tTexcdf4): 162(ptr) Variable UniformConstant + 164: TypeImage 34(int) Cube sampled format:Unknown + 165: TypePointer UniformConstant 164 + 166(g_tTexcdi4): 165(ptr) Variable UniformConstant + 167: TypeImage 52(int) Cube sampled format:Unknown + 168: TypePointer UniformConstant 167 + 169(g_tTexcdu4): 168(ptr) Variable UniformConstant + 170: TypeImage 6(float) Cube array sampled format:Unknown + 171: TypePointer UniformConstant 170 +172(g_tTexcdf4a): 171(ptr) Variable UniformConstant + 173: TypeImage 34(int) Cube array sampled format:Unknown + 174: TypePointer UniformConstant 173 +175(g_tTexcdi4a): 174(ptr) Variable UniformConstant + 176: TypeImage 52(int) Cube array sampled format:Unknown + 177: TypePointer UniformConstant 176 +178(g_tTexcdu4a): 177(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +124(flattenTemp): 112(ptr) Variable Function + 125:8(PS_OUTPUT) FunctionCall 10(@main() + Store 124(flattenTemp) 125 + 128: 117(ptr) AccessChain 124(flattenTemp) 114 + 129: 7(fvec4) Load 128 + Store 127(@entryPointOutput.Color) 129 + 132: 12(ptr) AccessChain 124(flattenTemp) 119 + 133: 6(float) Load 132 + Store 131(@entryPointOutput.Depth) 133 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(r11): 12(ptr) Variable Function + 38(r13): 12(ptr) Variable Function + 51(r15): 12(ptr) Variable Function + 65(r31): 12(ptr) Variable Function + 84(r33): 12(ptr) Variable Function + 98(r35): 12(ptr) Variable Function + 113(psout): 112(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4a) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 30: 6(float) CompositeExtract 27 0 + 31: 6(float) CompositeExtract 27 1 + 32: 29(fvec3) CompositeConstruct 30 31 28 + 36: 6(float) CompositeExtract 32 2 + 37: 6(float) ImageSampleDrefExplicitLod 23 32 36 Lod ConstOffset 33 35 + Store 13(r11) 37 + 42: 39 Load 41(g_tTex1di4a) + 43: 18 Load 20(g_sSamp) + 45: 44 SampledImage 42 43 + 46: 6(float) CompositeExtract 27 0 + 47: 6(float) CompositeExtract 27 1 + 48: 29(fvec3) CompositeConstruct 46 47 28 + 49: 6(float) CompositeExtract 48 2 + 50: 6(float) ImageSampleDrefExplicitLod 45 48 49 Lod ConstOffset 33 35 + Store 38(r13) 50 + 56: 53 Load 55(g_tTex1du4a) + 57: 18 Load 20(g_sSamp) + 59: 58 SampledImage 56 57 + 60: 6(float) CompositeExtract 27 0 + 61: 6(float) CompositeExtract 27 1 + 62: 29(fvec3) CompositeConstruct 60 61 28 + 63: 6(float) CompositeExtract 62 2 + 64: 6(float) ImageSampleDrefExplicitLod 59 62 63 Lod ConstOffset 33 35 + Store 51(r15) 64 + 69: 66 Load 68(g_tTex2df4a) + 70: 18 Load 20(g_sSamp) + 72: 71 SampledImage 69 70 + 75: 6(float) CompositeExtract 74 0 + 76: 6(float) CompositeExtract 74 1 + 77: 6(float) CompositeExtract 74 2 + 78: 7(fvec4) CompositeConstruct 75 76 77 28 + 82: 6(float) CompositeExtract 78 3 + 83: 6(float) ImageSampleDrefExplicitLod 72 78 82 Lod ConstOffset 33 81 + Store 65(r31) 83 + 88: 85 Load 87(g_tTex2di4a) + 89: 18 Load 20(g_sSamp) + 91: 90 SampledImage 88 89 + 92: 6(float) CompositeExtract 74 0 + 93: 6(float) CompositeExtract 74 1 + 94: 6(float) CompositeExtract 74 2 + 95: 7(fvec4) CompositeConstruct 92 93 94 28 + 96: 6(float) CompositeExtract 95 3 + 97: 6(float) ImageSampleDrefExplicitLod 91 95 96 Lod ConstOffset 33 81 + Store 84(r33) 97 + 102: 99 Load 101(g_tTex2du4a) + 103: 18 Load 20(g_sSamp) + 105: 104 SampledImage 102 103 + 106: 6(float) CompositeExtract 74 0 + 107: 6(float) CompositeExtract 74 1 + 108: 6(float) CompositeExtract 74 2 + 109: 7(fvec4) CompositeConstruct 106 107 108 28 + 110: 6(float) CompositeExtract 109 3 + 111: 6(float) ImageSampleDrefExplicitLod 105 109 110 Lod ConstOffset 33 81 + Store 98(r35) 111 + 118: 117(ptr) AccessChain 113(psout) 114 + Store 118 116 + 120: 12(ptr) AccessChain 113(psout) 119 + Store 120 115 + 121:8(PS_OUTPUT) Load 113(psout) + ReturnValue 121 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplegrad.array.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplegrad.array.dx10.frag.out new file mode 100644 index 00000000..81a92a23 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplegrad.array.dx10.frag.out @@ -0,0 +1,643 @@ +hlsl.samplegrad.array.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Parameters: +0:? Sequence +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'txval10' ( temp 4-component vector of float) +0:27 textureGrad ( temp 4-component vector of float) +0:27 Construct combined texture-sampler ( temp sampler1DArray) +0:27 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:27 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:27 Constant: +0:27 1.100000 +0:27 Constant: +0:27 1.200000 +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of int) +0:28 'txval11' ( temp 4-component vector of int) +0:28 textureGrad ( temp 4-component vector of int) +0:28 Construct combined texture-sampler ( temp isampler1DArray) +0:28 'g_tTex1di4' ( uniform itexture1DArray) +0:28 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:28 Constant: +0:28 1.100000 +0:28 Constant: +0:28 1.200000 +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of uint) +0:29 'txval12' ( temp 4-component vector of uint) +0:29 textureGrad ( temp 4-component vector of uint) +0:29 Construct combined texture-sampler ( temp usampler1DArray) +0:29 'g_tTex1du4' ( uniform utexture1DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:29 Constant: +0:29 1.100000 +0:29 Constant: +0:29 1.200000 +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval20' ( temp 4-component vector of float) +0:31 textureGrad ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler2DArray) +0:31 'g_tTex2df4' ( uniform texture2DArray) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval21' ( temp 4-component vector of int) +0:32 textureGrad ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler2DArray) +0:32 'g_tTex2di4' ( uniform itexture2DArray) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval22' ( temp 4-component vector of uint) +0:33 textureGrad ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler2DArray) +0:33 'g_tTex2du4' ( uniform utexture2DArray) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval40' ( temp 4-component vector of float) +0:35 textureGrad ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp samplerCubeArray) +0:35 'g_tTexcdf4' ( uniform textureCubeArray) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval41' ( temp 4-component vector of int) +0:36 textureGrad ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isamplerCubeArray) +0:36 'g_tTexcdi4' ( uniform itextureCubeArray) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval42' ( temp 4-component vector of uint) +0:37 textureGrad ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usamplerCubeArray) +0:37 'g_tTexcdu4' ( uniform utextureCubeArray) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:39 move second child to first child ( temp 4-component vector of float) +0:39 Color: direct index for structure ( temp 4-component vector of float) +0:39 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:40 move second child to first child ( temp float) +0:40 Depth: direct index for structure ( temp float) +0:40 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 1.000000 +0:42 Branch: Return with expression +0:42 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:24 Color: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:24 Depth: direct index for structure ( temp float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4' ( uniform itexture1DArray) +0:? 'g_tTex1du4' ( uniform utexture1DArray) +0:? 'g_tTex2df4' ( uniform texture2DArray) +0:? 'g_tTex2di4' ( uniform itexture2DArray) +0:? 'g_tTex2du4' ( uniform utexture2DArray) +0:? 'g_tTexcdf4' ( uniform textureCubeArray) +0:? 'g_tTexcdi4' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Parameters: +0:? Sequence +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'txval10' ( temp 4-component vector of float) +0:27 textureGrad ( temp 4-component vector of float) +0:27 Construct combined texture-sampler ( temp sampler1DArray) +0:27 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:27 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:27 Constant: +0:27 1.100000 +0:27 Constant: +0:27 1.200000 +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of int) +0:28 'txval11' ( temp 4-component vector of int) +0:28 textureGrad ( temp 4-component vector of int) +0:28 Construct combined texture-sampler ( temp isampler1DArray) +0:28 'g_tTex1di4' ( uniform itexture1DArray) +0:28 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:28 Constant: +0:28 1.100000 +0:28 Constant: +0:28 1.200000 +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of uint) +0:29 'txval12' ( temp 4-component vector of uint) +0:29 textureGrad ( temp 4-component vector of uint) +0:29 Construct combined texture-sampler ( temp usampler1DArray) +0:29 'g_tTex1du4' ( uniform utexture1DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:29 Constant: +0:29 1.100000 +0:29 Constant: +0:29 1.200000 +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval20' ( temp 4-component vector of float) +0:31 textureGrad ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler2DArray) +0:31 'g_tTex2df4' ( uniform texture2DArray) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval21' ( temp 4-component vector of int) +0:32 textureGrad ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler2DArray) +0:32 'g_tTex2di4' ( uniform itexture2DArray) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval22' ( temp 4-component vector of uint) +0:33 textureGrad ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler2DArray) +0:33 'g_tTex2du4' ( uniform utexture2DArray) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval40' ( temp 4-component vector of float) +0:35 textureGrad ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp samplerCubeArray) +0:35 'g_tTexcdf4' ( uniform textureCubeArray) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval41' ( temp 4-component vector of int) +0:36 textureGrad ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isamplerCubeArray) +0:36 'g_tTexcdi4' ( uniform itextureCubeArray) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval42' ( temp 4-component vector of uint) +0:37 textureGrad ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usamplerCubeArray) +0:37 'g_tTexcdu4' ( uniform utextureCubeArray) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:39 move second child to first child ( temp 4-component vector of float) +0:39 Color: direct index for structure ( temp 4-component vector of float) +0:39 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:40 move second child to first child ( temp float) +0:40 Depth: direct index for structure ( temp float) +0:40 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 1.000000 +0:42 Branch: Return with expression +0:42 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:24 Color: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:24 Depth: direct index for structure ( temp float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4' ( uniform itexture1DArray) +0:? 'g_tTex1du4' ( uniform utexture1DArray) +0:? 'g_tTex2df4' ( uniform texture2DArray) +0:? 'g_tTex2di4' ( uniform itexture2DArray) +0:? 'g_tTex2du4' ( uniform utexture2DArray) +0:? 'g_tTexcdf4' ( uniform textureCubeArray) +0:? 'g_tTexcdi4' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 140 + + Capability Shader + Capability Sampled1D + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 132 136 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval10" + Name 16 "g_tTex1df4" + Name 20 "g_sSamp" + Name 34 "txval11" + Name 37 "g_tTex1di4" + Name 46 "txval12" + Name 49 "g_tTex1du4" + Name 55 "txval20" + Name 58 "g_tTex2df4" + Name 68 "txval21" + Name 71 "g_tTex2di4" + Name 77 "txval22" + Name 80 "g_tTex2du4" + Name 86 "txval40" + Name 89 "g_tTexcdf4" + Name 99 "txval41" + Name 102 "g_tTexcdi4" + Name 108 "txval42" + Name 111 "g_tTexcdu4" + Name 118 "psout" + Name 129 "flattenTemp" + Name 132 "@entryPointOutput.Color" + Name 136 "@entryPointOutput.Depth" + Name 139 "g_tTex1df4a" + Decorate 16(g_tTex1df4) DescriptorSet 0 + Decorate 16(g_tTex1df4) Binding 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 37(g_tTex1di4) DescriptorSet 0 + Decorate 49(g_tTex1du4) DescriptorSet 0 + Decorate 58(g_tTex2df4) DescriptorSet 0 + Decorate 71(g_tTex2di4) DescriptorSet 0 + Decorate 80(g_tTex2du4) DescriptorSet 0 + Decorate 89(g_tTexcdf4) DescriptorSet 0 + Decorate 102(g_tTexcdi4) DescriptorSet 0 + Decorate 111(g_tTexcdu4) DescriptorSet 0 + Decorate 132(@entryPointOutput.Color) Location 0 + Decorate 136(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 139(g_tTex1df4a) DescriptorSet 0 + Decorate 139(g_tTex1df4a) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 1D array sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 2 + 25: 6(float) Constant 1036831949 + 26: 6(float) Constant 1045220557 + 27: 24(fvec2) ConstantComposite 25 26 + 28: 6(float) Constant 1066192077 + 29: 6(float) Constant 1067030938 + 31: TypeInt 32 1 + 32: TypeVector 31(int) 4 + 33: TypePointer Function 32(ivec4) + 35: TypeImage 31(int) 1D array sampled format:Unknown + 36: TypePointer UniformConstant 35 + 37(g_tTex1di4): 36(ptr) Variable UniformConstant + 40: TypeSampledImage 35 + 43: TypeInt 32 0 + 44: TypeVector 43(int) 4 + 45: TypePointer Function 44(ivec4) + 47: TypeImage 43(int) 1D array sampled format:Unknown + 48: TypePointer UniformConstant 47 + 49(g_tTex1du4): 48(ptr) Variable UniformConstant + 52: TypeSampledImage 47 + 56: TypeImage 6(float) 2D array sampled format:Unknown + 57: TypePointer UniformConstant 56 + 58(g_tTex2df4): 57(ptr) Variable UniformConstant + 61: TypeSampledImage 56 + 63: TypeVector 6(float) 3 + 64: 6(float) Constant 1050253722 + 65: 63(fvec3) ConstantComposite 25 26 64 + 66: 24(fvec2) ConstantComposite 28 29 + 69: TypeImage 31(int) 2D array sampled format:Unknown + 70: TypePointer UniformConstant 69 + 71(g_tTex2di4): 70(ptr) Variable UniformConstant + 74: TypeSampledImage 69 + 78: TypeImage 43(int) 2D array sampled format:Unknown + 79: TypePointer UniformConstant 78 + 80(g_tTex2du4): 79(ptr) Variable UniformConstant + 83: TypeSampledImage 78 + 87: TypeImage 6(float) Cube array sampled format:Unknown + 88: TypePointer UniformConstant 87 + 89(g_tTexcdf4): 88(ptr) Variable UniformConstant + 92: TypeSampledImage 87 + 94: 6(float) Constant 1053609165 + 95: 7(fvec4) ConstantComposite 25 26 64 94 + 96: 6(float) Constant 1067869798 + 97: 63(fvec3) ConstantComposite 28 29 96 + 100: TypeImage 31(int) Cube array sampled format:Unknown + 101: TypePointer UniformConstant 100 + 102(g_tTexcdi4): 101(ptr) Variable UniformConstant + 105: TypeSampledImage 100 + 109: TypeImage 43(int) Cube array sampled format:Unknown + 110: TypePointer UniformConstant 109 + 111(g_tTexcdu4): 110(ptr) Variable UniformConstant + 114: TypeSampledImage 109 + 117: TypePointer Function 8(PS_OUTPUT) + 119: 31(int) Constant 0 + 120: 6(float) Constant 1065353216 + 121: 7(fvec4) ConstantComposite 120 120 120 120 + 123: 31(int) Constant 1 + 124: TypePointer Function 6(float) + 131: TypePointer Output 7(fvec4) +132(@entryPointOutput.Color): 131(ptr) Variable Output + 135: TypePointer Output 6(float) +136(@entryPointOutput.Depth): 135(ptr) Variable Output +139(g_tTex1df4a): 15(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +129(flattenTemp): 117(ptr) Variable Function + 130:8(PS_OUTPUT) FunctionCall 10(@main() + Store 129(flattenTemp) 130 + 133: 12(ptr) AccessChain 129(flattenTemp) 119 + 134: 7(fvec4) Load 133 + Store 132(@entryPointOutput.Color) 134 + 137: 124(ptr) AccessChain 129(flattenTemp) 123 + 138: 6(float) Load 137 + Store 136(@entryPointOutput.Depth) 138 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval10): 12(ptr) Variable Function + 34(txval11): 33(ptr) Variable Function + 46(txval12): 45(ptr) Variable Function + 55(txval20): 12(ptr) Variable Function + 68(txval21): 33(ptr) Variable Function + 77(txval22): 45(ptr) Variable Function + 86(txval40): 12(ptr) Variable Function + 99(txval41): 33(ptr) Variable Function + 108(txval42): 45(ptr) Variable Function + 118(psout): 117(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 30: 7(fvec4) ImageSampleExplicitLod 23 27 Grad 28 29 + Store 13(txval10) 30 + 38: 35 Load 37(g_tTex1di4) + 39: 18 Load 20(g_sSamp) + 41: 40 SampledImage 38 39 + 42: 32(ivec4) ImageSampleExplicitLod 41 27 Grad 28 29 + Store 34(txval11) 42 + 50: 47 Load 49(g_tTex1du4) + 51: 18 Load 20(g_sSamp) + 53: 52 SampledImage 50 51 + 54: 44(ivec4) ImageSampleExplicitLod 53 27 Grad 28 29 + Store 46(txval12) 54 + 59: 56 Load 58(g_tTex2df4) + 60: 18 Load 20(g_sSamp) + 62: 61 SampledImage 59 60 + 67: 7(fvec4) ImageSampleExplicitLod 62 65 Grad 66 66 + Store 55(txval20) 67 + 72: 69 Load 71(g_tTex2di4) + 73: 18 Load 20(g_sSamp) + 75: 74 SampledImage 72 73 + 76: 32(ivec4) ImageSampleExplicitLod 75 65 Grad 66 66 + Store 68(txval21) 76 + 81: 78 Load 80(g_tTex2du4) + 82: 18 Load 20(g_sSamp) + 84: 83 SampledImage 81 82 + 85: 44(ivec4) ImageSampleExplicitLod 84 65 Grad 66 66 + Store 77(txval22) 85 + 90: 87 Load 89(g_tTexcdf4) + 91: 18 Load 20(g_sSamp) + 93: 92 SampledImage 90 91 + 98: 7(fvec4) ImageSampleExplicitLod 93 95 Grad 97 97 + Store 86(txval40) 98 + 103: 100 Load 102(g_tTexcdi4) + 104: 18 Load 20(g_sSamp) + 106: 105 SampledImage 103 104 + 107: 32(ivec4) ImageSampleExplicitLod 106 95 Grad 97 97 + Store 99(txval41) 107 + 112: 109 Load 111(g_tTexcdu4) + 113: 18 Load 20(g_sSamp) + 115: 114 SampledImage 112 113 + 116: 44(ivec4) ImageSampleExplicitLod 115 95 Grad 97 97 + Store 108(txval42) 116 + 122: 12(ptr) AccessChain 118(psout) 119 + Store 122 121 + 125: 124(ptr) AccessChain 118(psout) 123 + Store 125 120 + 126:8(PS_OUTPUT) Load 118(psout) + ReturnValue 126 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.frag.out new file mode 100644 index 00000000..3acd9afe --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.frag.out @@ -0,0 +1,791 @@ +hlsl.samplegrad.basic.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Parameters: +0:? Sequence +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval10' ( temp 4-component vector of float) +0:31 textureGrad ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler1D) +0:31 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:31 Constant: +0:31 0.100000 +0:31 Constant: +0:31 1.100000 +0:31 Constant: +0:31 1.200000 +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval11' ( temp 4-component vector of int) +0:32 textureGrad ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler1D) +0:32 'g_tTex1di4' ( uniform itexture1D) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:32 Constant: +0:32 0.200000 +0:32 Constant: +0:32 1.100000 +0:32 Constant: +0:32 1.200000 +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval12' ( temp 4-component vector of uint) +0:33 textureGrad ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler1D) +0:33 'g_tTex1du4' ( uniform utexture1D) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:33 Constant: +0:33 0.300000 +0:33 Constant: +0:33 1.100000 +0:33 Constant: +0:33 1.200000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval20' ( temp 4-component vector of float) +0:35 textureGrad ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp sampler2D) +0:35 'g_tTex2df4' ( uniform texture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval21' ( temp 4-component vector of int) +0:36 textureGrad ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isampler2D) +0:36 'g_tTex2di4' ( uniform itexture2D) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval22' ( temp 4-component vector of uint) +0:37 textureGrad ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usampler2D) +0:37 'g_tTex2du4' ( uniform utexture2D) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 'txval30' ( temp 4-component vector of float) +0:39 textureGrad ( temp 4-component vector of float) +0:39 Construct combined texture-sampler ( temp sampler3D) +0:39 'g_tTex3df4' ( uniform texture3D) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of int) +0:40 'txval31' ( temp 4-component vector of int) +0:40 textureGrad ( temp 4-component vector of int) +0:40 Construct combined texture-sampler ( temp isampler3D) +0:40 'g_tTex3di4' ( uniform itexture3D) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of uint) +0:41 'txval32' ( temp 4-component vector of uint) +0:41 textureGrad ( temp 4-component vector of uint) +0:41 Construct combined texture-sampler ( temp usampler3D) +0:41 'g_tTex3du4' ( uniform utexture3D) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of float) +0:43 'txval40' ( temp 4-component vector of float) +0:43 textureGrad ( temp 4-component vector of float) +0:43 Construct combined texture-sampler ( temp samplerCube) +0:43 'g_tTexcdf4' ( uniform textureCube) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of int) +0:44 'txval41' ( temp 4-component vector of int) +0:44 textureGrad ( temp 4-component vector of int) +0:44 Construct combined texture-sampler ( temp isamplerCube) +0:44 'g_tTexcdi4' ( uniform itextureCube) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of uint) +0:45 'txval42' ( temp 4-component vector of uint) +0:45 textureGrad ( temp 4-component vector of uint) +0:45 Construct combined texture-sampler ( temp usamplerCube) +0:45 'g_tTexcdu4' ( uniform utextureCube) +0:45 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:47 move second child to first child ( temp 4-component vector of float) +0:47 Color: direct index for structure ( temp 4-component vector of float) +0:47 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1.000000 +0:47 1.000000 +0:47 1.000000 +0:47 1.000000 +0:48 move second child to first child ( temp float) +0:48 Depth: direct index for structure ( temp float) +0:48 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 1 (const int) +0:48 Constant: +0:48 1.000000 +0:50 Branch: Return with expression +0:50 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:28 Color: direct index for structure ( temp 4-component vector of float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 0 (const int) +0:28 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:28 Depth: direct index for structure ( temp float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Parameters: +0:? Sequence +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval10' ( temp 4-component vector of float) +0:31 textureGrad ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler1D) +0:31 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:31 Constant: +0:31 0.100000 +0:31 Constant: +0:31 1.100000 +0:31 Constant: +0:31 1.200000 +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval11' ( temp 4-component vector of int) +0:32 textureGrad ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler1D) +0:32 'g_tTex1di4' ( uniform itexture1D) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:32 Constant: +0:32 0.200000 +0:32 Constant: +0:32 1.100000 +0:32 Constant: +0:32 1.200000 +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval12' ( temp 4-component vector of uint) +0:33 textureGrad ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler1D) +0:33 'g_tTex1du4' ( uniform utexture1D) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:33 Constant: +0:33 0.300000 +0:33 Constant: +0:33 1.100000 +0:33 Constant: +0:33 1.200000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval20' ( temp 4-component vector of float) +0:35 textureGrad ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp sampler2D) +0:35 'g_tTex2df4' ( uniform texture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval21' ( temp 4-component vector of int) +0:36 textureGrad ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isampler2D) +0:36 'g_tTex2di4' ( uniform itexture2D) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval22' ( temp 4-component vector of uint) +0:37 textureGrad ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usampler2D) +0:37 'g_tTex2du4' ( uniform utexture2D) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 'txval30' ( temp 4-component vector of float) +0:39 textureGrad ( temp 4-component vector of float) +0:39 Construct combined texture-sampler ( temp sampler3D) +0:39 'g_tTex3df4' ( uniform texture3D) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of int) +0:40 'txval31' ( temp 4-component vector of int) +0:40 textureGrad ( temp 4-component vector of int) +0:40 Construct combined texture-sampler ( temp isampler3D) +0:40 'g_tTex3di4' ( uniform itexture3D) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of uint) +0:41 'txval32' ( temp 4-component vector of uint) +0:41 textureGrad ( temp 4-component vector of uint) +0:41 Construct combined texture-sampler ( temp usampler3D) +0:41 'g_tTex3du4' ( uniform utexture3D) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of float) +0:43 'txval40' ( temp 4-component vector of float) +0:43 textureGrad ( temp 4-component vector of float) +0:43 Construct combined texture-sampler ( temp samplerCube) +0:43 'g_tTexcdf4' ( uniform textureCube) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of int) +0:44 'txval41' ( temp 4-component vector of int) +0:44 textureGrad ( temp 4-component vector of int) +0:44 Construct combined texture-sampler ( temp isamplerCube) +0:44 'g_tTexcdi4' ( uniform itextureCube) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of uint) +0:45 'txval42' ( temp 4-component vector of uint) +0:45 textureGrad ( temp 4-component vector of uint) +0:45 Construct combined texture-sampler ( temp usamplerCube) +0:45 'g_tTexcdu4' ( uniform utextureCube) +0:45 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:47 move second child to first child ( temp 4-component vector of float) +0:47 Color: direct index for structure ( temp 4-component vector of float) +0:47 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1.000000 +0:47 1.000000 +0:47 1.000000 +0:47 1.000000 +0:48 move second child to first child ( temp float) +0:48 Depth: direct index for structure ( temp float) +0:48 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 1 (const int) +0:48 Constant: +0:48 1.000000 +0:50 Branch: Return with expression +0:50 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:28 Color: direct index for structure ( temp 4-component vector of float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 0 (const int) +0:28 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:28 Depth: direct index for structure ( temp float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 175 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 167 171 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval10" + Name 16 "g_tTex1df4" + Name 20 "g_sSamp" + Name 31 "txval11" + Name 34 "g_tTex1di4" + Name 44 "txval12" + Name 47 "g_tTex1du4" + Name 54 "txval20" + Name 57 "g_tTex2df4" + Name 66 "txval21" + Name 69 "g_tTex2di4" + Name 77 "txval22" + Name 80 "g_tTex2du4" + Name 89 "txval30" + Name 92 "g_tTex3df4" + Name 102 "txval31" + Name 105 "g_tTex3di4" + Name 112 "txval32" + Name 115 "g_tTex3du4" + Name 125 "txval40" + Name 128 "g_tTexcdf4" + Name 134 "txval41" + Name 137 "g_tTexcdi4" + Name 143 "txval42" + Name 146 "g_tTexcdu4" + Name 153 "psout" + Name 164 "flattenTemp" + Name 167 "@entryPointOutput.Color" + Name 171 "@entryPointOutput.Depth" + Name 174 "g_tTex1df4a" + Decorate 16(g_tTex1df4) DescriptorSet 0 + Decorate 16(g_tTex1df4) Binding 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 34(g_tTex1di4) DescriptorSet 0 + Decorate 47(g_tTex1du4) DescriptorSet 0 + Decorate 57(g_tTex2df4) DescriptorSet 0 + Decorate 69(g_tTex2di4) DescriptorSet 0 + Decorate 80(g_tTex2du4) DescriptorSet 0 + Decorate 92(g_tTex3df4) DescriptorSet 0 + Decorate 105(g_tTex3di4) DescriptorSet 0 + Decorate 115(g_tTex3du4) DescriptorSet 0 + Decorate 128(g_tTexcdf4) DescriptorSet 0 + Decorate 137(g_tTexcdi4) DescriptorSet 0 + Decorate 146(g_tTexcdu4) DescriptorSet 0 + Decorate 167(@entryPointOutput.Color) Location 0 + Decorate 171(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 174(g_tTex1df4a) DescriptorSet 0 + Decorate 174(g_tTex1df4a) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 1D sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: 6(float) Constant 1036831949 + 25: 6(float) Constant 1066192077 + 26: 6(float) Constant 1067030938 + 28: TypeInt 32 1 + 29: TypeVector 28(int) 4 + 30: TypePointer Function 29(ivec4) + 32: TypeImage 28(int) 1D sampled format:Unknown + 33: TypePointer UniformConstant 32 + 34(g_tTex1di4): 33(ptr) Variable UniformConstant + 37: TypeSampledImage 32 + 39: 6(float) Constant 1045220557 + 41: TypeInt 32 0 + 42: TypeVector 41(int) 4 + 43: TypePointer Function 42(ivec4) + 45: TypeImage 41(int) 1D sampled format:Unknown + 46: TypePointer UniformConstant 45 + 47(g_tTex1du4): 46(ptr) Variable UniformConstant + 50: TypeSampledImage 45 + 52: 6(float) Constant 1050253722 + 55: TypeImage 6(float) 2D sampled format:Unknown + 56: TypePointer UniformConstant 55 + 57(g_tTex2df4): 56(ptr) Variable UniformConstant + 60: TypeSampledImage 55 + 62: TypeVector 6(float) 2 + 63: 62(fvec2) ConstantComposite 24 39 + 64: 62(fvec2) ConstantComposite 25 26 + 67: TypeImage 28(int) 2D sampled format:Unknown + 68: TypePointer UniformConstant 67 + 69(g_tTex2di4): 68(ptr) Variable UniformConstant + 72: TypeSampledImage 67 + 74: 6(float) Constant 1053609165 + 75: 62(fvec2) ConstantComposite 52 74 + 78: TypeImage 41(int) 2D sampled format:Unknown + 79: TypePointer UniformConstant 78 + 80(g_tTex2du4): 79(ptr) Variable UniformConstant + 83: TypeSampledImage 78 + 85: 6(float) Constant 1056964608 + 86: 6(float) Constant 1058642330 + 87: 62(fvec2) ConstantComposite 85 86 + 90: TypeImage 6(float) 3D sampled format:Unknown + 91: TypePointer UniformConstant 90 + 92(g_tTex3df4): 91(ptr) Variable UniformConstant + 95: TypeSampledImage 90 + 97: TypeVector 6(float) 3 + 98: 97(fvec3) ConstantComposite 24 39 52 + 99: 6(float) Constant 1067869798 + 100: 97(fvec3) ConstantComposite 25 26 99 + 103: TypeImage 28(int) 3D sampled format:Unknown + 104: TypePointer UniformConstant 103 + 105(g_tTex3di4): 104(ptr) Variable UniformConstant + 108: TypeSampledImage 103 + 110: 97(fvec3) ConstantComposite 74 85 86 + 113: TypeImage 41(int) 3D sampled format:Unknown + 114: TypePointer UniformConstant 113 + 115(g_tTex3du4): 114(ptr) Variable UniformConstant + 118: TypeSampledImage 113 + 120: 6(float) Constant 1060320051 + 121: 6(float) Constant 1061997773 + 122: 6(float) Constant 1063675494 + 123: 97(fvec3) ConstantComposite 120 121 122 + 126: TypeImage 6(float) Cube sampled format:Unknown + 127: TypePointer UniformConstant 126 + 128(g_tTexcdf4): 127(ptr) Variable UniformConstant + 131: TypeSampledImage 126 + 135: TypeImage 28(int) Cube sampled format:Unknown + 136: TypePointer UniformConstant 135 + 137(g_tTexcdi4): 136(ptr) Variable UniformConstant + 140: TypeSampledImage 135 + 144: TypeImage 41(int) Cube sampled format:Unknown + 145: TypePointer UniformConstant 144 + 146(g_tTexcdu4): 145(ptr) Variable UniformConstant + 149: TypeSampledImage 144 + 152: TypePointer Function 8(PS_OUTPUT) + 154: 28(int) Constant 0 + 155: 6(float) Constant 1065353216 + 156: 7(fvec4) ConstantComposite 155 155 155 155 + 158: 28(int) Constant 1 + 159: TypePointer Function 6(float) + 166: TypePointer Output 7(fvec4) +167(@entryPointOutput.Color): 166(ptr) Variable Output + 170: TypePointer Output 6(float) +171(@entryPointOutput.Depth): 170(ptr) Variable Output +174(g_tTex1df4a): 15(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +164(flattenTemp): 152(ptr) Variable Function + 165:8(PS_OUTPUT) FunctionCall 10(@main() + Store 164(flattenTemp) 165 + 168: 12(ptr) AccessChain 164(flattenTemp) 154 + 169: 7(fvec4) Load 168 + Store 167(@entryPointOutput.Color) 169 + 172: 159(ptr) AccessChain 164(flattenTemp) 158 + 173: 6(float) Load 172 + Store 171(@entryPointOutput.Depth) 173 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval10): 12(ptr) Variable Function + 31(txval11): 30(ptr) Variable Function + 44(txval12): 43(ptr) Variable Function + 54(txval20): 12(ptr) Variable Function + 66(txval21): 30(ptr) Variable Function + 77(txval22): 43(ptr) Variable Function + 89(txval30): 12(ptr) Variable Function + 102(txval31): 30(ptr) Variable Function + 112(txval32): 43(ptr) Variable Function + 125(txval40): 12(ptr) Variable Function + 134(txval41): 30(ptr) Variable Function + 143(txval42): 43(ptr) Variable Function + 153(psout): 152(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 27: 7(fvec4) ImageSampleExplicitLod 23 24 Grad 25 26 + Store 13(txval10) 27 + 35: 32 Load 34(g_tTex1di4) + 36: 18 Load 20(g_sSamp) + 38: 37 SampledImage 35 36 + 40: 29(ivec4) ImageSampleExplicitLod 38 39 Grad 25 26 + Store 31(txval11) 40 + 48: 45 Load 47(g_tTex1du4) + 49: 18 Load 20(g_sSamp) + 51: 50 SampledImage 48 49 + 53: 42(ivec4) ImageSampleExplicitLod 51 52 Grad 25 26 + Store 44(txval12) 53 + 58: 55 Load 57(g_tTex2df4) + 59: 18 Load 20(g_sSamp) + 61: 60 SampledImage 58 59 + 65: 7(fvec4) ImageSampleExplicitLod 61 63 Grad 64 64 + Store 54(txval20) 65 + 70: 67 Load 69(g_tTex2di4) + 71: 18 Load 20(g_sSamp) + 73: 72 SampledImage 70 71 + 76: 29(ivec4) ImageSampleExplicitLod 73 75 Grad 64 64 + Store 66(txval21) 76 + 81: 78 Load 80(g_tTex2du4) + 82: 18 Load 20(g_sSamp) + 84: 83 SampledImage 81 82 + 88: 42(ivec4) ImageSampleExplicitLod 84 87 Grad 64 64 + Store 77(txval22) 88 + 93: 90 Load 92(g_tTex3df4) + 94: 18 Load 20(g_sSamp) + 96: 95 SampledImage 93 94 + 101: 7(fvec4) ImageSampleExplicitLod 96 98 Grad 100 100 + Store 89(txval30) 101 + 106: 103 Load 105(g_tTex3di4) + 107: 18 Load 20(g_sSamp) + 109: 108 SampledImage 106 107 + 111: 29(ivec4) ImageSampleExplicitLod 109 110 Grad 100 100 + Store 102(txval31) 111 + 116: 113 Load 115(g_tTex3du4) + 117: 18 Load 20(g_sSamp) + 119: 118 SampledImage 116 117 + 124: 42(ivec4) ImageSampleExplicitLod 119 123 Grad 100 100 + Store 112(txval32) 124 + 129: 126 Load 128(g_tTexcdf4) + 130: 18 Load 20(g_sSamp) + 132: 131 SampledImage 129 130 + 133: 7(fvec4) ImageSampleExplicitLod 132 98 Grad 100 100 + Store 125(txval40) 133 + 138: 135 Load 137(g_tTexcdi4) + 139: 18 Load 20(g_sSamp) + 141: 140 SampledImage 138 139 + 142: 29(ivec4) ImageSampleExplicitLod 141 110 Grad 100 100 + Store 134(txval41) 142 + 147: 144 Load 146(g_tTexcdu4) + 148: 18 Load 20(g_sSamp) + 150: 149 SampledImage 147 148 + 151: 42(ivec4) ImageSampleExplicitLod 150 123 Grad 100 100 + Store 143(txval42) 151 + 157: 12(ptr) AccessChain 153(psout) 154 + Store 157 156 + 160: 159(ptr) AccessChain 153(psout) 158 + Store 160 155 + 161:8(PS_OUTPUT) Load 153(psout) + ReturnValue 161 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out b/deps/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out new file mode 100644 index 00000000..d787939b --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out @@ -0,0 +1,735 @@ +hlsl.samplegrad.basic.dx10.vert +Shader version: 500 +0:? Sequence +0:27 Function Definition: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:27 Function Parameters: +0:? Sequence +0:30 Sequence +0:30 move second child to first child ( temp 4-component vector of float) +0:30 'txval10' ( temp 4-component vector of float) +0:30 textureGrad ( temp 4-component vector of float) +0:30 Construct combined texture-sampler ( temp sampler1D) +0:30 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:30 'g_sSamp' (layout( binding=0) uniform sampler) +0:30 Constant: +0:30 0.100000 +0:30 Constant: +0:30 1.100000 +0:30 Constant: +0:30 1.200000 +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of int) +0:31 'txval11' ( temp 4-component vector of int) +0:31 textureGrad ( temp 4-component vector of int) +0:31 Construct combined texture-sampler ( temp isampler1D) +0:31 'g_tTex1di4' ( uniform itexture1D) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:31 Constant: +0:31 0.200000 +0:31 Constant: +0:31 1.100000 +0:31 Constant: +0:31 1.200000 +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of uint) +0:32 'txval12' ( temp 4-component vector of uint) +0:32 textureGrad ( temp 4-component vector of uint) +0:32 Construct combined texture-sampler ( temp usampler1D) +0:32 'g_tTex1du4' ( uniform utexture1D) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:32 Constant: +0:32 0.300000 +0:32 Constant: +0:32 1.100000 +0:32 Constant: +0:32 1.200000 +0:34 Sequence +0:34 move second child to first child ( temp 4-component vector of float) +0:34 'txval20' ( temp 4-component vector of float) +0:34 textureGrad ( temp 4-component vector of float) +0:34 Construct combined texture-sampler ( temp sampler2D) +0:34 'g_tTex2df4' ( uniform texture2D) +0:34 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of int) +0:35 'txval21' ( temp 4-component vector of int) +0:35 textureGrad ( temp 4-component vector of int) +0:35 Construct combined texture-sampler ( temp isampler2D) +0:35 'g_tTex2di4' ( uniform itexture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of uint) +0:36 'txval22' ( temp 4-component vector of uint) +0:36 textureGrad ( temp 4-component vector of uint) +0:36 Construct combined texture-sampler ( temp usampler2D) +0:36 'g_tTex2du4' ( uniform utexture2D) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:38 Sequence +0:38 move second child to first child ( temp 4-component vector of float) +0:38 'txval30' ( temp 4-component vector of float) +0:38 textureGrad ( temp 4-component vector of float) +0:38 Construct combined texture-sampler ( temp sampler3D) +0:38 'g_tTex3df4' ( uniform texture3D) +0:38 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of int) +0:39 'txval31' ( temp 4-component vector of int) +0:39 textureGrad ( temp 4-component vector of int) +0:39 Construct combined texture-sampler ( temp isampler3D) +0:39 'g_tTex3di4' ( uniform itexture3D) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of uint) +0:40 'txval32' ( temp 4-component vector of uint) +0:40 textureGrad ( temp 4-component vector of uint) +0:40 Construct combined texture-sampler ( temp usampler3D) +0:40 'g_tTex3du4' ( uniform utexture3D) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:42 Sequence +0:42 move second child to first child ( temp 4-component vector of float) +0:42 'txval40' ( temp 4-component vector of float) +0:42 textureGrad ( temp 4-component vector of float) +0:42 Construct combined texture-sampler ( temp samplerCube) +0:42 'g_tTexcdf4' ( uniform textureCube) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of int) +0:43 'txval41' ( temp 4-component vector of int) +0:43 textureGrad ( temp 4-component vector of int) +0:43 Construct combined texture-sampler ( temp isamplerCube) +0:43 'g_tTexcdi4' ( uniform itextureCube) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of uint) +0:44 'txval42' ( temp 4-component vector of uint) +0:44 textureGrad ( temp 4-component vector of uint) +0:44 Construct combined texture-sampler ( temp usamplerCube) +0:44 'g_tTexcdu4' ( uniform utextureCube) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:46 move second child to first child ( temp 4-component vector of float) +0:46 Pos: direct index for structure ( temp 4-component vector of float) +0:46 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:46 Constant: +0:46 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:48 Branch: Return with expression +0:48 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:27 Function Definition: main( ( temp void) +0:27 Function Parameters: +0:? Sequence +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:27 Pos: direct index for structure ( temp 4-component vector of float) +0:27 Function Call: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:27 Constant: +0:27 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:27 Function Definition: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:27 Function Parameters: +0:? Sequence +0:30 Sequence +0:30 move second child to first child ( temp 4-component vector of float) +0:30 'txval10' ( temp 4-component vector of float) +0:30 textureGrad ( temp 4-component vector of float) +0:30 Construct combined texture-sampler ( temp sampler1D) +0:30 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:30 'g_sSamp' (layout( binding=0) uniform sampler) +0:30 Constant: +0:30 0.100000 +0:30 Constant: +0:30 1.100000 +0:30 Constant: +0:30 1.200000 +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of int) +0:31 'txval11' ( temp 4-component vector of int) +0:31 textureGrad ( temp 4-component vector of int) +0:31 Construct combined texture-sampler ( temp isampler1D) +0:31 'g_tTex1di4' ( uniform itexture1D) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:31 Constant: +0:31 0.200000 +0:31 Constant: +0:31 1.100000 +0:31 Constant: +0:31 1.200000 +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of uint) +0:32 'txval12' ( temp 4-component vector of uint) +0:32 textureGrad ( temp 4-component vector of uint) +0:32 Construct combined texture-sampler ( temp usampler1D) +0:32 'g_tTex1du4' ( uniform utexture1D) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:32 Constant: +0:32 0.300000 +0:32 Constant: +0:32 1.100000 +0:32 Constant: +0:32 1.200000 +0:34 Sequence +0:34 move second child to first child ( temp 4-component vector of float) +0:34 'txval20' ( temp 4-component vector of float) +0:34 textureGrad ( temp 4-component vector of float) +0:34 Construct combined texture-sampler ( temp sampler2D) +0:34 'g_tTex2df4' ( uniform texture2D) +0:34 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of int) +0:35 'txval21' ( temp 4-component vector of int) +0:35 textureGrad ( temp 4-component vector of int) +0:35 Construct combined texture-sampler ( temp isampler2D) +0:35 'g_tTex2di4' ( uniform itexture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of uint) +0:36 'txval22' ( temp 4-component vector of uint) +0:36 textureGrad ( temp 4-component vector of uint) +0:36 Construct combined texture-sampler ( temp usampler2D) +0:36 'g_tTex2du4' ( uniform utexture2D) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:38 Sequence +0:38 move second child to first child ( temp 4-component vector of float) +0:38 'txval30' ( temp 4-component vector of float) +0:38 textureGrad ( temp 4-component vector of float) +0:38 Construct combined texture-sampler ( temp sampler3D) +0:38 'g_tTex3df4' ( uniform texture3D) +0:38 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of int) +0:39 'txval31' ( temp 4-component vector of int) +0:39 textureGrad ( temp 4-component vector of int) +0:39 Construct combined texture-sampler ( temp isampler3D) +0:39 'g_tTex3di4' ( uniform itexture3D) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of uint) +0:40 'txval32' ( temp 4-component vector of uint) +0:40 textureGrad ( temp 4-component vector of uint) +0:40 Construct combined texture-sampler ( temp usampler3D) +0:40 'g_tTex3du4' ( uniform utexture3D) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:42 Sequence +0:42 move second child to first child ( temp 4-component vector of float) +0:42 'txval40' ( temp 4-component vector of float) +0:42 textureGrad ( temp 4-component vector of float) +0:42 Construct combined texture-sampler ( temp samplerCube) +0:42 'g_tTexcdf4' ( uniform textureCube) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of int) +0:43 'txval41' ( temp 4-component vector of int) +0:43 textureGrad ( temp 4-component vector of int) +0:43 Construct combined texture-sampler ( temp isamplerCube) +0:43 'g_tTexcdi4' ( uniform itextureCube) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of uint) +0:44 'txval42' ( temp 4-component vector of uint) +0:44 textureGrad ( temp 4-component vector of uint) +0:44 Construct combined texture-sampler ( temp usamplerCube) +0:44 'g_tTexcdu4' ( uniform utextureCube) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:46 move second child to first child ( temp 4-component vector of float) +0:46 Pos: direct index for structure ( temp 4-component vector of float) +0:46 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:46 Constant: +0:46 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:48 Branch: Return with expression +0:48 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:27 Function Definition: main( ( temp void) +0:27 Function Parameters: +0:? Sequence +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:27 Pos: direct index for structure ( temp 4-component vector of float) +0:27 Function Call: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:27 Constant: +0:27 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 166 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 162 + Source HLSL 500 + Name 4 "main" + Name 8 "VS_OUTPUT" + MemberName 8(VS_OUTPUT) 0 "Pos" + Name 10 "@main(" + Name 13 "txval10" + Name 16 "g_tTex1df4" + Name 20 "g_sSamp" + Name 31 "txval11" + Name 34 "g_tTex1di4" + Name 44 "txval12" + Name 47 "g_tTex1du4" + Name 54 "txval20" + Name 57 "g_tTex2df4" + Name 66 "txval21" + Name 69 "g_tTex2di4" + Name 77 "txval22" + Name 80 "g_tTex2du4" + Name 89 "txval30" + Name 92 "g_tTex3df4" + Name 102 "txval31" + Name 105 "g_tTex3di4" + Name 112 "txval32" + Name 115 "g_tTex3du4" + Name 125 "txval40" + Name 128 "g_tTexcdf4" + Name 134 "txval41" + Name 137 "g_tTexcdi4" + Name 143 "txval42" + Name 146 "g_tTexcdu4" + Name 153 "vsout" + Name 162 "@entryPointOutput.Pos" + Name 165 "g_tTex1df4a" + Decorate 16(g_tTex1df4) DescriptorSet 0 + Decorate 16(g_tTex1df4) Binding 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 34(g_tTex1di4) DescriptorSet 0 + Decorate 47(g_tTex1du4) DescriptorSet 0 + Decorate 57(g_tTex2df4) DescriptorSet 0 + Decorate 69(g_tTex2di4) DescriptorSet 0 + Decorate 80(g_tTex2du4) DescriptorSet 0 + Decorate 92(g_tTex3df4) DescriptorSet 0 + Decorate 105(g_tTex3di4) DescriptorSet 0 + Decorate 115(g_tTex3du4) DescriptorSet 0 + Decorate 128(g_tTexcdf4) DescriptorSet 0 + Decorate 137(g_tTexcdi4) DescriptorSet 0 + Decorate 146(g_tTexcdu4) DescriptorSet 0 + Decorate 162(@entryPointOutput.Pos) BuiltIn Position + Decorate 165(g_tTex1df4a) DescriptorSet 0 + Decorate 165(g_tTex1df4a) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(VS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(VS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 1D sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: 6(float) Constant 1036831949 + 25: 6(float) Constant 1066192077 + 26: 6(float) Constant 1067030938 + 28: TypeInt 32 1 + 29: TypeVector 28(int) 4 + 30: TypePointer Function 29(ivec4) + 32: TypeImage 28(int) 1D sampled format:Unknown + 33: TypePointer UniformConstant 32 + 34(g_tTex1di4): 33(ptr) Variable UniformConstant + 37: TypeSampledImage 32 + 39: 6(float) Constant 1045220557 + 41: TypeInt 32 0 + 42: TypeVector 41(int) 4 + 43: TypePointer Function 42(ivec4) + 45: TypeImage 41(int) 1D sampled format:Unknown + 46: TypePointer UniformConstant 45 + 47(g_tTex1du4): 46(ptr) Variable UniformConstant + 50: TypeSampledImage 45 + 52: 6(float) Constant 1050253722 + 55: TypeImage 6(float) 2D sampled format:Unknown + 56: TypePointer UniformConstant 55 + 57(g_tTex2df4): 56(ptr) Variable UniformConstant + 60: TypeSampledImage 55 + 62: TypeVector 6(float) 2 + 63: 62(fvec2) ConstantComposite 24 39 + 64: 62(fvec2) ConstantComposite 25 26 + 67: TypeImage 28(int) 2D sampled format:Unknown + 68: TypePointer UniformConstant 67 + 69(g_tTex2di4): 68(ptr) Variable UniformConstant + 72: TypeSampledImage 67 + 74: 6(float) Constant 1053609165 + 75: 62(fvec2) ConstantComposite 52 74 + 78: TypeImage 41(int) 2D sampled format:Unknown + 79: TypePointer UniformConstant 78 + 80(g_tTex2du4): 79(ptr) Variable UniformConstant + 83: TypeSampledImage 78 + 85: 6(float) Constant 1056964608 + 86: 6(float) Constant 1058642330 + 87: 62(fvec2) ConstantComposite 85 86 + 90: TypeImage 6(float) 3D sampled format:Unknown + 91: TypePointer UniformConstant 90 + 92(g_tTex3df4): 91(ptr) Variable UniformConstant + 95: TypeSampledImage 90 + 97: TypeVector 6(float) 3 + 98: 97(fvec3) ConstantComposite 24 39 52 + 99: 6(float) Constant 1067869798 + 100: 97(fvec3) ConstantComposite 25 26 99 + 103: TypeImage 28(int) 3D sampled format:Unknown + 104: TypePointer UniformConstant 103 + 105(g_tTex3di4): 104(ptr) Variable UniformConstant + 108: TypeSampledImage 103 + 110: 97(fvec3) ConstantComposite 74 85 86 + 113: TypeImage 41(int) 3D sampled format:Unknown + 114: TypePointer UniformConstant 113 + 115(g_tTex3du4): 114(ptr) Variable UniformConstant + 118: TypeSampledImage 113 + 120: 6(float) Constant 1060320051 + 121: 6(float) Constant 1061997773 + 122: 6(float) Constant 1063675494 + 123: 97(fvec3) ConstantComposite 120 121 122 + 126: TypeImage 6(float) Cube sampled format:Unknown + 127: TypePointer UniformConstant 126 + 128(g_tTexcdf4): 127(ptr) Variable UniformConstant + 131: TypeSampledImage 126 + 135: TypeImage 28(int) Cube sampled format:Unknown + 136: TypePointer UniformConstant 135 + 137(g_tTexcdi4): 136(ptr) Variable UniformConstant + 140: TypeSampledImage 135 + 144: TypeImage 41(int) Cube sampled format:Unknown + 145: TypePointer UniformConstant 144 + 146(g_tTexcdu4): 145(ptr) Variable UniformConstant + 149: TypeSampledImage 144 + 152: TypePointer Function 8(VS_OUTPUT) + 154: 28(int) Constant 0 + 155: 6(float) Constant 0 + 156: 7(fvec4) ConstantComposite 155 155 155 155 + 161: TypePointer Output 7(fvec4) +162(@entryPointOutput.Pos): 161(ptr) Variable Output +165(g_tTex1df4a): 15(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 163:8(VS_OUTPUT) FunctionCall 10(@main() + 164: 7(fvec4) CompositeExtract 163 0 + Store 162(@entryPointOutput.Pos) 164 + Return + FunctionEnd + 10(@main():8(VS_OUTPUT) Function None 9 + 11: Label + 13(txval10): 12(ptr) Variable Function + 31(txval11): 30(ptr) Variable Function + 44(txval12): 43(ptr) Variable Function + 54(txval20): 12(ptr) Variable Function + 66(txval21): 30(ptr) Variable Function + 77(txval22): 43(ptr) Variable Function + 89(txval30): 12(ptr) Variable Function + 102(txval31): 30(ptr) Variable Function + 112(txval32): 43(ptr) Variable Function + 125(txval40): 12(ptr) Variable Function + 134(txval41): 30(ptr) Variable Function + 143(txval42): 43(ptr) Variable Function + 153(vsout): 152(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 27: 7(fvec4) ImageSampleExplicitLod 23 24 Grad 25 26 + Store 13(txval10) 27 + 35: 32 Load 34(g_tTex1di4) + 36: 18 Load 20(g_sSamp) + 38: 37 SampledImage 35 36 + 40: 29(ivec4) ImageSampleExplicitLod 38 39 Grad 25 26 + Store 31(txval11) 40 + 48: 45 Load 47(g_tTex1du4) + 49: 18 Load 20(g_sSamp) + 51: 50 SampledImage 48 49 + 53: 42(ivec4) ImageSampleExplicitLod 51 52 Grad 25 26 + Store 44(txval12) 53 + 58: 55 Load 57(g_tTex2df4) + 59: 18 Load 20(g_sSamp) + 61: 60 SampledImage 58 59 + 65: 7(fvec4) ImageSampleExplicitLod 61 63 Grad 64 64 + Store 54(txval20) 65 + 70: 67 Load 69(g_tTex2di4) + 71: 18 Load 20(g_sSamp) + 73: 72 SampledImage 70 71 + 76: 29(ivec4) ImageSampleExplicitLod 73 75 Grad 64 64 + Store 66(txval21) 76 + 81: 78 Load 80(g_tTex2du4) + 82: 18 Load 20(g_sSamp) + 84: 83 SampledImage 81 82 + 88: 42(ivec4) ImageSampleExplicitLod 84 87 Grad 64 64 + Store 77(txval22) 88 + 93: 90 Load 92(g_tTex3df4) + 94: 18 Load 20(g_sSamp) + 96: 95 SampledImage 93 94 + 101: 7(fvec4) ImageSampleExplicitLod 96 98 Grad 100 100 + Store 89(txval30) 101 + 106: 103 Load 105(g_tTex3di4) + 107: 18 Load 20(g_sSamp) + 109: 108 SampledImage 106 107 + 111: 29(ivec4) ImageSampleExplicitLod 109 110 Grad 100 100 + Store 102(txval31) 111 + 116: 113 Load 115(g_tTex3du4) + 117: 18 Load 20(g_sSamp) + 119: 118 SampledImage 116 117 + 124: 42(ivec4) ImageSampleExplicitLod 119 123 Grad 100 100 + Store 112(txval32) 124 + 129: 126 Load 128(g_tTexcdf4) + 130: 18 Load 20(g_sSamp) + 132: 131 SampledImage 129 130 + 133: 7(fvec4) ImageSampleExplicitLod 132 98 Grad 100 100 + Store 125(txval40) 133 + 138: 135 Load 137(g_tTexcdi4) + 139: 18 Load 20(g_sSamp) + 141: 140 SampledImage 138 139 + 142: 29(ivec4) ImageSampleExplicitLod 141 110 Grad 100 100 + Store 134(txval41) 142 + 147: 144 Load 146(g_tTexcdu4) + 148: 18 Load 20(g_sSamp) + 150: 149 SampledImage 147 148 + 151: 42(ivec4) ImageSampleExplicitLod 150 123 Grad 100 100 + Store 143(txval42) 151 + 157: 12(ptr) AccessChain 153(vsout) 154 + Store 157 156 + 158:8(VS_OUTPUT) Load 153(vsout) + ReturnValue 158 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplegrad.offset.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplegrad.offset.dx10.frag.out new file mode 100644 index 00000000..b5a85493 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplegrad.offset.dx10.frag.out @@ -0,0 +1,716 @@ +hlsl.samplegrad.offset.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Parameters: +0:? Sequence +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval10' ( temp 4-component vector of float) +0:31 textureGradOffset ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler1D) +0:31 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:31 Constant: +0:31 0.100000 +0:31 Constant: +0:31 1.100000 +0:31 Constant: +0:31 1.200000 +0:31 Constant: +0:31 1 (const int) +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval11' ( temp 4-component vector of int) +0:32 textureGradOffset ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler1D) +0:32 'g_tTex1di4' ( uniform itexture1D) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:32 Constant: +0:32 0.200000 +0:32 Constant: +0:32 1.100000 +0:32 Constant: +0:32 1.200000 +0:32 Constant: +0:32 1 (const int) +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval12' ( temp 4-component vector of uint) +0:33 textureGradOffset ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler1D) +0:33 'g_tTex1du4' ( uniform utexture1D) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:33 Constant: +0:33 0.300000 +0:33 Constant: +0:33 1.100000 +0:33 Constant: +0:33 1.200000 +0:33 Constant: +0:33 1 (const int) +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval20' ( temp 4-component vector of float) +0:35 textureGradOffset ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp sampler2D) +0:35 'g_tTex2df4' ( uniform texture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval21' ( temp 4-component vector of int) +0:36 textureGradOffset ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isampler2D) +0:36 'g_tTex2di4' ( uniform itexture2D) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval22' ( temp 4-component vector of uint) +0:37 textureGradOffset ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usampler2D) +0:37 'g_tTex2du4' ( uniform utexture2D) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1 (const int) +0:? -1 (const int) +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 'txval30' ( temp 4-component vector of float) +0:39 textureGradOffset ( temp 4-component vector of float) +0:39 Construct combined texture-sampler ( temp sampler3D) +0:39 'g_tTex3df4' ( uniform texture3D) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:? 1 (const int) +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of int) +0:40 'txval31' ( temp 4-component vector of int) +0:40 textureGradOffset ( temp 4-component vector of int) +0:40 Construct combined texture-sampler ( temp isampler3D) +0:40 'g_tTex3di4' ( uniform itexture3D) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of uint) +0:41 'txval32' ( temp 4-component vector of uint) +0:41 textureGradOffset ( temp 4-component vector of uint) +0:41 Construct combined texture-sampler ( temp usampler3D) +0:41 'g_tTex3du4' ( uniform utexture3D) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:? -1 (const int) +0:45 move second child to first child ( temp 4-component vector of float) +0:45 Color: direct index for structure ( temp 4-component vector of float) +0:45 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 1.000000 +0:45 1.000000 +0:45 1.000000 +0:45 1.000000 +0:46 move second child to first child ( temp float) +0:46 Depth: direct index for structure ( temp float) +0:46 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 1.000000 +0:48 Branch: Return with expression +0:48 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:28 Color: direct index for structure ( temp 4-component vector of float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 0 (const int) +0:28 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:28 Depth: direct index for structure ( temp float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Parameters: +0:? Sequence +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval10' ( temp 4-component vector of float) +0:31 textureGradOffset ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler1D) +0:31 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:31 Constant: +0:31 0.100000 +0:31 Constant: +0:31 1.100000 +0:31 Constant: +0:31 1.200000 +0:31 Constant: +0:31 1 (const int) +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval11' ( temp 4-component vector of int) +0:32 textureGradOffset ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler1D) +0:32 'g_tTex1di4' ( uniform itexture1D) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:32 Constant: +0:32 0.200000 +0:32 Constant: +0:32 1.100000 +0:32 Constant: +0:32 1.200000 +0:32 Constant: +0:32 1 (const int) +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval12' ( temp 4-component vector of uint) +0:33 textureGradOffset ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler1D) +0:33 'g_tTex1du4' ( uniform utexture1D) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:33 Constant: +0:33 0.300000 +0:33 Constant: +0:33 1.100000 +0:33 Constant: +0:33 1.200000 +0:33 Constant: +0:33 1 (const int) +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval20' ( temp 4-component vector of float) +0:35 textureGradOffset ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp sampler2D) +0:35 'g_tTex2df4' ( uniform texture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval21' ( temp 4-component vector of int) +0:36 textureGradOffset ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isampler2D) +0:36 'g_tTex2di4' ( uniform itexture2D) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval22' ( temp 4-component vector of uint) +0:37 textureGradOffset ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usampler2D) +0:37 'g_tTex2du4' ( uniform utexture2D) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1 (const int) +0:? -1 (const int) +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 'txval30' ( temp 4-component vector of float) +0:39 textureGradOffset ( temp 4-component vector of float) +0:39 Construct combined texture-sampler ( temp sampler3D) +0:39 'g_tTex3df4' ( uniform texture3D) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:? 1 (const int) +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of int) +0:40 'txval31' ( temp 4-component vector of int) +0:40 textureGradOffset ( temp 4-component vector of int) +0:40 Construct combined texture-sampler ( temp isampler3D) +0:40 'g_tTex3di4' ( uniform itexture3D) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of uint) +0:41 'txval32' ( temp 4-component vector of uint) +0:41 textureGradOffset ( temp 4-component vector of uint) +0:41 Construct combined texture-sampler ( temp usampler3D) +0:41 'g_tTex3du4' ( uniform utexture3D) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? 1.300000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:? -1 (const int) +0:45 move second child to first child ( temp 4-component vector of float) +0:45 Color: direct index for structure ( temp 4-component vector of float) +0:45 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 1.000000 +0:45 1.000000 +0:45 1.000000 +0:45 1.000000 +0:46 move second child to first child ( temp float) +0:46 Depth: direct index for structure ( temp float) +0:46 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 1.000000 +0:48 Branch: Return with expression +0:48 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:28 Color: direct index for structure ( temp 4-component vector of float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 0 (const int) +0:28 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:28 Depth: direct index for structure ( temp float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 166 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 149 153 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval10" + Name 16 "g_tTex1df4" + Name 20 "g_sSamp" + Name 32 "txval11" + Name 35 "g_tTex1di4" + Name 45 "txval12" + Name 48 "g_tTex1du4" + Name 55 "txval20" + Name 58 "g_tTex2df4" + Name 70 "txval21" + Name 73 "g_tTex2di4" + Name 82 "txval22" + Name 85 "g_tTex2du4" + Name 96 "txval30" + Name 99 "g_tTex3df4" + Name 111 "txval31" + Name 114 "g_tTex3di4" + Name 122 "txval32" + Name 125 "g_tTex3du4" + Name 137 "psout" + Name 146 "flattenTemp" + Name 149 "@entryPointOutput.Color" + Name 153 "@entryPointOutput.Depth" + Name 156 "g_tTex1df4a" + Name 159 "g_tTexcdf4" + Name 162 "g_tTexcdi4" + Name 165 "g_tTexcdu4" + Decorate 16(g_tTex1df4) DescriptorSet 0 + Decorate 16(g_tTex1df4) Binding 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 35(g_tTex1di4) DescriptorSet 0 + Decorate 48(g_tTex1du4) DescriptorSet 0 + Decorate 58(g_tTex2df4) DescriptorSet 0 + Decorate 73(g_tTex2di4) DescriptorSet 0 + Decorate 85(g_tTex2du4) DescriptorSet 0 + Decorate 99(g_tTex3df4) DescriptorSet 0 + Decorate 114(g_tTex3di4) DescriptorSet 0 + Decorate 125(g_tTex3du4) DescriptorSet 0 + Decorate 149(@entryPointOutput.Color) Location 0 + Decorate 153(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 156(g_tTex1df4a) DescriptorSet 0 + Decorate 156(g_tTex1df4a) Binding 1 + Decorate 159(g_tTexcdf4) DescriptorSet 0 + Decorate 162(g_tTexcdi4) DescriptorSet 0 + Decorate 165(g_tTexcdu4) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 1D sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: 6(float) Constant 1036831949 + 25: 6(float) Constant 1066192077 + 26: 6(float) Constant 1067030938 + 27: TypeInt 32 1 + 28: 27(int) Constant 1 + 30: TypeVector 27(int) 4 + 31: TypePointer Function 30(ivec4) + 33: TypeImage 27(int) 1D sampled format:Unknown + 34: TypePointer UniformConstant 33 + 35(g_tTex1di4): 34(ptr) Variable UniformConstant + 38: TypeSampledImage 33 + 40: 6(float) Constant 1045220557 + 42: TypeInt 32 0 + 43: TypeVector 42(int) 4 + 44: TypePointer Function 43(ivec4) + 46: TypeImage 42(int) 1D sampled format:Unknown + 47: TypePointer UniformConstant 46 + 48(g_tTex1du4): 47(ptr) Variable UniformConstant + 51: TypeSampledImage 46 + 53: 6(float) Constant 1050253722 + 56: TypeImage 6(float) 2D sampled format:Unknown + 57: TypePointer UniformConstant 56 + 58(g_tTex2df4): 57(ptr) Variable UniformConstant + 61: TypeSampledImage 56 + 63: TypeVector 6(float) 2 + 64: 63(fvec2) ConstantComposite 24 40 + 65: 63(fvec2) ConstantComposite 25 26 + 66: TypeVector 27(int) 2 + 67: 27(int) Constant 0 + 68: 66(ivec2) ConstantComposite 28 67 + 71: TypeImage 27(int) 2D sampled format:Unknown + 72: TypePointer UniformConstant 71 + 73(g_tTex2di4): 72(ptr) Variable UniformConstant + 76: TypeSampledImage 71 + 78: 6(float) Constant 1053609165 + 79: 63(fvec2) ConstantComposite 53 78 + 80: 66(ivec2) ConstantComposite 28 28 + 83: TypeImage 42(int) 2D sampled format:Unknown + 84: TypePointer UniformConstant 83 + 85(g_tTex2du4): 84(ptr) Variable UniformConstant + 88: TypeSampledImage 83 + 90: 6(float) Constant 1056964608 + 91: 6(float) Constant 1058642330 + 92: 63(fvec2) ConstantComposite 90 91 + 93: 27(int) Constant 4294967295 + 94: 66(ivec2) ConstantComposite 28 93 + 97: TypeImage 6(float) 3D sampled format:Unknown + 98: TypePointer UniformConstant 97 + 99(g_tTex3df4): 98(ptr) Variable UniformConstant + 102: TypeSampledImage 97 + 104: TypeVector 6(float) 3 + 105: 104(fvec3) ConstantComposite 24 40 53 + 106: 6(float) Constant 1067869798 + 107: 104(fvec3) ConstantComposite 25 26 106 + 108: TypeVector 27(int) 3 + 109: 108(ivec3) ConstantComposite 28 67 28 + 112: TypeImage 27(int) 3D sampled format:Unknown + 113: TypePointer UniformConstant 112 + 114(g_tTex3di4): 113(ptr) Variable UniformConstant + 117: TypeSampledImage 112 + 119: 104(fvec3) ConstantComposite 78 90 91 + 120: 108(ivec3) ConstantComposite 28 28 28 + 123: TypeImage 42(int) 3D sampled format:Unknown + 124: TypePointer UniformConstant 123 + 125(g_tTex3du4): 124(ptr) Variable UniformConstant + 128: TypeSampledImage 123 + 130: 6(float) Constant 1060320051 + 131: 6(float) Constant 1061997773 + 132: 6(float) Constant 1063675494 + 133: 104(fvec3) ConstantComposite 130 131 132 + 134: 108(ivec3) ConstantComposite 28 67 93 + 136: TypePointer Function 8(PS_OUTPUT) + 138: 6(float) Constant 1065353216 + 139: 7(fvec4) ConstantComposite 138 138 138 138 + 141: TypePointer Function 6(float) + 148: TypePointer Output 7(fvec4) +149(@entryPointOutput.Color): 148(ptr) Variable Output + 152: TypePointer Output 6(float) +153(@entryPointOutput.Depth): 152(ptr) Variable Output +156(g_tTex1df4a): 15(ptr) Variable UniformConstant + 157: TypeImage 6(float) Cube sampled format:Unknown + 158: TypePointer UniformConstant 157 + 159(g_tTexcdf4): 158(ptr) Variable UniformConstant + 160: TypeImage 27(int) Cube sampled format:Unknown + 161: TypePointer UniformConstant 160 + 162(g_tTexcdi4): 161(ptr) Variable UniformConstant + 163: TypeImage 42(int) Cube sampled format:Unknown + 164: TypePointer UniformConstant 163 + 165(g_tTexcdu4): 164(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +146(flattenTemp): 136(ptr) Variable Function + 147:8(PS_OUTPUT) FunctionCall 10(@main() + Store 146(flattenTemp) 147 + 150: 12(ptr) AccessChain 146(flattenTemp) 67 + 151: 7(fvec4) Load 150 + Store 149(@entryPointOutput.Color) 151 + 154: 141(ptr) AccessChain 146(flattenTemp) 28 + 155: 6(float) Load 154 + Store 153(@entryPointOutput.Depth) 155 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval10): 12(ptr) Variable Function + 32(txval11): 31(ptr) Variable Function + 45(txval12): 44(ptr) Variable Function + 55(txval20): 12(ptr) Variable Function + 70(txval21): 31(ptr) Variable Function + 82(txval22): 44(ptr) Variable Function + 96(txval30): 12(ptr) Variable Function + 111(txval31): 31(ptr) Variable Function + 122(txval32): 44(ptr) Variable Function + 137(psout): 136(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 29: 7(fvec4) ImageSampleExplicitLod 23 24 Grad ConstOffset 25 26 28 + Store 13(txval10) 29 + 36: 33 Load 35(g_tTex1di4) + 37: 18 Load 20(g_sSamp) + 39: 38 SampledImage 36 37 + 41: 30(ivec4) ImageSampleExplicitLod 39 40 Grad ConstOffset 25 26 28 + Store 32(txval11) 41 + 49: 46 Load 48(g_tTex1du4) + 50: 18 Load 20(g_sSamp) + 52: 51 SampledImage 49 50 + 54: 43(ivec4) ImageSampleExplicitLod 52 53 Grad ConstOffset 25 26 28 + Store 45(txval12) 54 + 59: 56 Load 58(g_tTex2df4) + 60: 18 Load 20(g_sSamp) + 62: 61 SampledImage 59 60 + 69: 7(fvec4) ImageSampleExplicitLod 62 64 Grad ConstOffset 64 65 68 + Store 55(txval20) 69 + 74: 71 Load 73(g_tTex2di4) + 75: 18 Load 20(g_sSamp) + 77: 76 SampledImage 74 75 + 81: 30(ivec4) ImageSampleExplicitLod 77 79 Grad ConstOffset 64 65 80 + Store 70(txval21) 81 + 86: 83 Load 85(g_tTex2du4) + 87: 18 Load 20(g_sSamp) + 89: 88 SampledImage 86 87 + 95: 43(ivec4) ImageSampleExplicitLod 89 92 Grad ConstOffset 64 65 94 + Store 82(txval22) 95 + 100: 97 Load 99(g_tTex3df4) + 101: 18 Load 20(g_sSamp) + 103: 102 SampledImage 100 101 + 110: 7(fvec4) ImageSampleExplicitLod 103 105 Grad ConstOffset 107 107 109 + Store 96(txval30) 110 + 115: 112 Load 114(g_tTex3di4) + 116: 18 Load 20(g_sSamp) + 118: 117 SampledImage 115 116 + 121: 30(ivec4) ImageSampleExplicitLod 118 119 Grad ConstOffset 107 107 120 + Store 111(txval31) 121 + 126: 123 Load 125(g_tTex3du4) + 127: 18 Load 20(g_sSamp) + 129: 128 SampledImage 126 127 + 135: 43(ivec4) ImageSampleExplicitLod 129 133 Grad ConstOffset 107 107 134 + Store 122(txval32) 135 + 140: 12(ptr) AccessChain 137(psout) 67 + Store 140 139 + 142: 141(ptr) AccessChain 137(psout) 28 + Store 142 138 + 143:8(PS_OUTPUT) Load 137(psout) + ReturnValue 143 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplegrad.offsetarray.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplegrad.offsetarray.dx10.frag.out new file mode 100644 index 00000000..39a28389 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplegrad.offsetarray.dx10.frag.out @@ -0,0 +1,527 @@ +hlsl.samplegrad.offsetarray.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Parameters: +0:? Sequence +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'txval10' ( temp 4-component vector of float) +0:27 textureGradOffset ( temp 4-component vector of float) +0:27 Construct combined texture-sampler ( temp sampler1DArray) +0:27 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:27 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:27 Constant: +0:27 1.100000 +0:27 Constant: +0:27 1.200000 +0:27 Constant: +0:27 1 (const int) +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of int) +0:28 'txval11' ( temp 4-component vector of int) +0:28 textureGradOffset ( temp 4-component vector of int) +0:28 Construct combined texture-sampler ( temp isampler1DArray) +0:28 'g_tTex1di4' ( uniform itexture1DArray) +0:28 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:28 Constant: +0:28 1.100000 +0:28 Constant: +0:28 1.200000 +0:28 Constant: +0:28 1 (const int) +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of uint) +0:29 'txval12' ( temp 4-component vector of uint) +0:29 textureGradOffset ( temp 4-component vector of uint) +0:29 Construct combined texture-sampler ( temp usampler1DArray) +0:29 'g_tTex1du4' ( uniform utexture1DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:29 Constant: +0:29 1.100000 +0:29 Constant: +0:29 1.200000 +0:29 Constant: +0:29 1 (const int) +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval20' ( temp 4-component vector of float) +0:31 textureGradOffset ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler2DArray) +0:31 'g_tTex2df4' ( uniform texture2DArray) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval21' ( temp 4-component vector of int) +0:32 textureGradOffset ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler2DArray) +0:32 'g_tTex2di4' ( uniform itexture2DArray) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval22' ( temp 4-component vector of uint) +0:33 textureGradOffset ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler2DArray) +0:33 'g_tTex2du4' ( uniform utexture2DArray) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:35 move second child to first child ( temp 4-component vector of float) +0:35 Color: direct index for structure ( temp 4-component vector of float) +0:35 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 1.000000 +0:35 1.000000 +0:35 1.000000 +0:35 1.000000 +0:36 move second child to first child ( temp float) +0:36 Depth: direct index for structure ( temp float) +0:36 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:36 Constant: +0:36 1 (const int) +0:36 Constant: +0:36 1.000000 +0:38 Branch: Return with expression +0:38 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:24 Color: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:24 Depth: direct index for structure ( temp float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4' ( uniform itexture1DArray) +0:? 'g_tTex1du4' ( uniform utexture1DArray) +0:? 'g_tTex2df4' ( uniform texture2DArray) +0:? 'g_tTex2di4' ( uniform itexture2DArray) +0:? 'g_tTex2du4' ( uniform utexture2DArray) +0:? 'g_tTexcdf4' ( uniform textureCubeArray) +0:? 'g_tTexcdi4' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Parameters: +0:? Sequence +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'txval10' ( temp 4-component vector of float) +0:27 textureGradOffset ( temp 4-component vector of float) +0:27 Construct combined texture-sampler ( temp sampler1DArray) +0:27 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:27 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:27 Constant: +0:27 1.100000 +0:27 Constant: +0:27 1.200000 +0:27 Constant: +0:27 1 (const int) +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of int) +0:28 'txval11' ( temp 4-component vector of int) +0:28 textureGradOffset ( temp 4-component vector of int) +0:28 Construct combined texture-sampler ( temp isampler1DArray) +0:28 'g_tTex1di4' ( uniform itexture1DArray) +0:28 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:28 Constant: +0:28 1.100000 +0:28 Constant: +0:28 1.200000 +0:28 Constant: +0:28 1 (const int) +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of uint) +0:29 'txval12' ( temp 4-component vector of uint) +0:29 textureGradOffset ( temp 4-component vector of uint) +0:29 Construct combined texture-sampler ( temp usampler1DArray) +0:29 'g_tTex1du4' ( uniform utexture1DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:29 Constant: +0:29 1.100000 +0:29 Constant: +0:29 1.200000 +0:29 Constant: +0:29 1 (const int) +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval20' ( temp 4-component vector of float) +0:31 textureGradOffset ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler2DArray) +0:31 'g_tTex2df4' ( uniform texture2DArray) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval21' ( temp 4-component vector of int) +0:32 textureGradOffset ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler2DArray) +0:32 'g_tTex2di4' ( uniform itexture2DArray) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval22' ( temp 4-component vector of uint) +0:33 textureGradOffset ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler2DArray) +0:33 'g_tTex2du4' ( uniform utexture2DArray) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1.100000 +0:? 1.200000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:35 move second child to first child ( temp 4-component vector of float) +0:35 Color: direct index for structure ( temp 4-component vector of float) +0:35 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 1.000000 +0:35 1.000000 +0:35 1.000000 +0:35 1.000000 +0:36 move second child to first child ( temp float) +0:36 Depth: direct index for structure ( temp float) +0:36 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:36 Constant: +0:36 1 (const int) +0:36 Constant: +0:36 1.000000 +0:38 Branch: Return with expression +0:38 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:24 Color: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:24 Depth: direct index for structure ( temp float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4' ( uniform itexture1DArray) +0:? 'g_tTex1du4' ( uniform utexture1DArray) +0:? 'g_tTex2df4' ( uniform texture2DArray) +0:? 'g_tTex2di4' ( uniform itexture2DArray) +0:? 'g_tTex2du4' ( uniform utexture2DArray) +0:? 'g_tTexcdf4' ( uniform textureCubeArray) +0:? 'g_tTexcdi4' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 120 + + Capability Shader + Capability Sampled1D + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 103 107 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval10" + Name 16 "g_tTex1df4" + Name 20 "g_sSamp" + Name 35 "txval11" + Name 38 "g_tTex1di4" + Name 47 "txval12" + Name 50 "g_tTex1du4" + Name 56 "txval20" + Name 59 "g_tTex2df4" + Name 72 "txval21" + Name 75 "g_tTex2di4" + Name 81 "txval22" + Name 84 "g_tTex2du4" + Name 91 "psout" + Name 100 "flattenTemp" + Name 103 "@entryPointOutput.Color" + Name 107 "@entryPointOutput.Depth" + Name 110 "g_tTex1df4a" + Name 113 "g_tTexcdf4" + Name 116 "g_tTexcdi4" + Name 119 "g_tTexcdu4" + Decorate 16(g_tTex1df4) DescriptorSet 0 + Decorate 16(g_tTex1df4) Binding 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 38(g_tTex1di4) DescriptorSet 0 + Decorate 50(g_tTex1du4) DescriptorSet 0 + Decorate 59(g_tTex2df4) DescriptorSet 0 + Decorate 75(g_tTex2di4) DescriptorSet 0 + Decorate 84(g_tTex2du4) DescriptorSet 0 + Decorate 103(@entryPointOutput.Color) Location 0 + Decorate 107(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 110(g_tTex1df4a) DescriptorSet 0 + Decorate 110(g_tTex1df4a) Binding 1 + Decorate 113(g_tTexcdf4) DescriptorSet 0 + Decorate 116(g_tTexcdi4) DescriptorSet 0 + Decorate 119(g_tTexcdu4) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 1D array sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 2 + 25: 6(float) Constant 1036831949 + 26: 6(float) Constant 1045220557 + 27: 24(fvec2) ConstantComposite 25 26 + 28: 6(float) Constant 1066192077 + 29: 6(float) Constant 1067030938 + 30: TypeInt 32 1 + 31: 30(int) Constant 1 + 33: TypeVector 30(int) 4 + 34: TypePointer Function 33(ivec4) + 36: TypeImage 30(int) 1D array sampled format:Unknown + 37: TypePointer UniformConstant 36 + 38(g_tTex1di4): 37(ptr) Variable UniformConstant + 41: TypeSampledImage 36 + 44: TypeInt 32 0 + 45: TypeVector 44(int) 4 + 46: TypePointer Function 45(ivec4) + 48: TypeImage 44(int) 1D array sampled format:Unknown + 49: TypePointer UniformConstant 48 + 50(g_tTex1du4): 49(ptr) Variable UniformConstant + 53: TypeSampledImage 48 + 57: TypeImage 6(float) 2D array sampled format:Unknown + 58: TypePointer UniformConstant 57 + 59(g_tTex2df4): 58(ptr) Variable UniformConstant + 62: TypeSampledImage 57 + 64: TypeVector 6(float) 3 + 65: 6(float) Constant 1050253722 + 66: 64(fvec3) ConstantComposite 25 26 65 + 67: 24(fvec2) ConstantComposite 28 29 + 68: TypeVector 30(int) 2 + 69: 30(int) Constant 0 + 70: 68(ivec2) ConstantComposite 31 69 + 73: TypeImage 30(int) 2D array sampled format:Unknown + 74: TypePointer UniformConstant 73 + 75(g_tTex2di4): 74(ptr) Variable UniformConstant + 78: TypeSampledImage 73 + 82: TypeImage 44(int) 2D array sampled format:Unknown + 83: TypePointer UniformConstant 82 + 84(g_tTex2du4): 83(ptr) Variable UniformConstant + 87: TypeSampledImage 82 + 90: TypePointer Function 8(PS_OUTPUT) + 92: 6(float) Constant 1065353216 + 93: 7(fvec4) ConstantComposite 92 92 92 92 + 95: TypePointer Function 6(float) + 102: TypePointer Output 7(fvec4) +103(@entryPointOutput.Color): 102(ptr) Variable Output + 106: TypePointer Output 6(float) +107(@entryPointOutput.Depth): 106(ptr) Variable Output +110(g_tTex1df4a): 15(ptr) Variable UniformConstant + 111: TypeImage 6(float) Cube array sampled format:Unknown + 112: TypePointer UniformConstant 111 + 113(g_tTexcdf4): 112(ptr) Variable UniformConstant + 114: TypeImage 30(int) Cube array sampled format:Unknown + 115: TypePointer UniformConstant 114 + 116(g_tTexcdi4): 115(ptr) Variable UniformConstant + 117: TypeImage 44(int) Cube array sampled format:Unknown + 118: TypePointer UniformConstant 117 + 119(g_tTexcdu4): 118(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +100(flattenTemp): 90(ptr) Variable Function + 101:8(PS_OUTPUT) FunctionCall 10(@main() + Store 100(flattenTemp) 101 + 104: 12(ptr) AccessChain 100(flattenTemp) 69 + 105: 7(fvec4) Load 104 + Store 103(@entryPointOutput.Color) 105 + 108: 95(ptr) AccessChain 100(flattenTemp) 31 + 109: 6(float) Load 108 + Store 107(@entryPointOutput.Depth) 109 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval10): 12(ptr) Variable Function + 35(txval11): 34(ptr) Variable Function + 47(txval12): 46(ptr) Variable Function + 56(txval20): 12(ptr) Variable Function + 72(txval21): 34(ptr) Variable Function + 81(txval22): 46(ptr) Variable Function + 91(psout): 90(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 32: 7(fvec4) ImageSampleExplicitLod 23 27 Grad ConstOffset 28 29 31 + Store 13(txval10) 32 + 39: 36 Load 38(g_tTex1di4) + 40: 18 Load 20(g_sSamp) + 42: 41 SampledImage 39 40 + 43: 33(ivec4) ImageSampleExplicitLod 42 27 Grad ConstOffset 28 29 31 + Store 35(txval11) 43 + 51: 48 Load 50(g_tTex1du4) + 52: 18 Load 20(g_sSamp) + 54: 53 SampledImage 51 52 + 55: 45(ivec4) ImageSampleExplicitLod 54 27 Grad ConstOffset 28 29 31 + Store 47(txval12) 55 + 60: 57 Load 59(g_tTex2df4) + 61: 18 Load 20(g_sSamp) + 63: 62 SampledImage 60 61 + 71: 7(fvec4) ImageSampleExplicitLod 63 66 Grad ConstOffset 67 67 70 + Store 56(txval20) 71 + 76: 73 Load 75(g_tTex2di4) + 77: 18 Load 20(g_sSamp) + 79: 78 SampledImage 76 77 + 80: 33(ivec4) ImageSampleExplicitLod 79 66 Grad ConstOffset 67 67 70 + Store 72(txval21) 80 + 85: 82 Load 84(g_tTex2du4) + 86: 18 Load 20(g_sSamp) + 88: 87 SampledImage 85 86 + 89: 45(ivec4) ImageSampleExplicitLod 88 66 Grad ConstOffset 67 67 70 + Store 81(txval22) 89 + 94: 12(ptr) AccessChain 91(psout) 69 + Store 94 93 + 96: 95(ptr) AccessChain 91(psout) 31 + Store 96 92 + 97:8(PS_OUTPUT) Load 91(psout) + ReturnValue 97 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplelevel.array.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplelevel.array.dx10.frag.out new file mode 100644 index 00000000..0151cdd3 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplelevel.array.dx10.frag.out @@ -0,0 +1,578 @@ +hlsl.samplelevel.array.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Parameters: +0:? Sequence +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'txval10' ( temp 4-component vector of float) +0:27 textureLod ( temp 4-component vector of float) +0:27 Construct combined texture-sampler ( temp sampler1DArray) +0:27 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:27 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:27 Constant: +0:27 0.750000 +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of int) +0:28 'txval11' ( temp 4-component vector of int) +0:28 textureLod ( temp 4-component vector of int) +0:28 Construct combined texture-sampler ( temp isampler1DArray) +0:28 'g_tTex1di4a' ( uniform itexture1DArray) +0:28 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:28 Constant: +0:28 0.750000 +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of uint) +0:29 'txval12' ( temp 4-component vector of uint) +0:29 textureLod ( temp 4-component vector of uint) +0:29 Construct combined texture-sampler ( temp usampler1DArray) +0:29 'g_tTex1du4a' ( uniform utexture1DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:29 Constant: +0:29 0.750000 +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval20' ( temp 4-component vector of float) +0:31 textureLod ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler2DArray) +0:31 'g_tTex2df4a' ( uniform texture2DArray) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:31 Constant: +0:31 0.750000 +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval21' ( temp 4-component vector of int) +0:32 textureLod ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler2DArray) +0:32 'g_tTex2di4a' ( uniform itexture2DArray) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? 0.500000 +0:32 Constant: +0:32 0.750000 +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval22' ( temp 4-component vector of uint) +0:33 textureLod ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler2DArray) +0:33 'g_tTex2du4a' ( uniform utexture2DArray) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:33 Constant: +0:33 0.750000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval40' ( temp 4-component vector of float) +0:35 textureLod ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp samplerCubeArray) +0:35 'g_tTexcdf4a' ( uniform textureCubeArray) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:35 Constant: +0:35 0.750000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval41' ( temp 4-component vector of int) +0:36 textureLod ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isamplerCubeArray) +0:36 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:36 Constant: +0:36 0.750000 +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval42' ( temp 4-component vector of uint) +0:37 textureLod ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usamplerCubeArray) +0:37 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:? 1.000000 +0:37 Constant: +0:37 0.750000 +0:39 move second child to first child ( temp 4-component vector of float) +0:39 Color: direct index for structure ( temp 4-component vector of float) +0:39 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:40 move second child to first child ( temp float) +0:40 Depth: direct index for structure ( temp float) +0:40 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 1.000000 +0:42 Branch: Return with expression +0:42 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:24 Color: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:24 Depth: direct index for structure ( temp float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:24 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Parameters: +0:? Sequence +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'txval10' ( temp 4-component vector of float) +0:27 textureLod ( temp 4-component vector of float) +0:27 Construct combined texture-sampler ( temp sampler1DArray) +0:27 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:27 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:27 Constant: +0:27 0.750000 +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of int) +0:28 'txval11' ( temp 4-component vector of int) +0:28 textureLod ( temp 4-component vector of int) +0:28 Construct combined texture-sampler ( temp isampler1DArray) +0:28 'g_tTex1di4a' ( uniform itexture1DArray) +0:28 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:28 Constant: +0:28 0.750000 +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of uint) +0:29 'txval12' ( temp 4-component vector of uint) +0:29 textureLod ( temp 4-component vector of uint) +0:29 Construct combined texture-sampler ( temp usampler1DArray) +0:29 'g_tTex1du4a' ( uniform utexture1DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:29 Constant: +0:29 0.750000 +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval20' ( temp 4-component vector of float) +0:31 textureLod ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler2DArray) +0:31 'g_tTex2df4a' ( uniform texture2DArray) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:31 Constant: +0:31 0.750000 +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval21' ( temp 4-component vector of int) +0:32 textureLod ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler2DArray) +0:32 'g_tTex2di4a' ( uniform itexture2DArray) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? 0.500000 +0:32 Constant: +0:32 0.750000 +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval22' ( temp 4-component vector of uint) +0:33 textureLod ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler2DArray) +0:33 'g_tTex2du4a' ( uniform utexture2DArray) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:33 Constant: +0:33 0.750000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval40' ( temp 4-component vector of float) +0:35 textureLod ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp samplerCubeArray) +0:35 'g_tTexcdf4a' ( uniform textureCubeArray) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:? 0.400000 +0:35 Constant: +0:35 0.750000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval41' ( temp 4-component vector of int) +0:36 textureLod ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isamplerCubeArray) +0:36 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:36 Constant: +0:36 0.750000 +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval42' ( temp 4-component vector of uint) +0:37 textureLod ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usamplerCubeArray) +0:37 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:? 1.000000 +0:37 Constant: +0:37 0.750000 +0:39 move second child to first child ( temp 4-component vector of float) +0:39 Color: direct index for structure ( temp 4-component vector of float) +0:39 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:39 1.000000 +0:40 move second child to first child ( temp float) +0:40 Depth: direct index for structure ( temp float) +0:40 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 1.000000 +0:42 Branch: Return with expression +0:42 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:24 Color: direct index for structure ( temp 4-component vector of float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:24 Depth: direct index for structure ( temp float) +0:24 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:24 Constant: +0:24 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'g_tTexcdf4a' ( uniform textureCubeArray) +0:? 'g_tTexcdi4a' ( uniform itextureCubeArray) +0:? 'g_tTexcdu4a' ( uniform utextureCubeArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 147 + + Capability Shader + Capability Sampled1D + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 139 143 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval10" + Name 16 "g_tTex1df4a" + Name 20 "g_sSamp" + Name 33 "txval11" + Name 36 "g_tTex1di4a" + Name 47 "txval12" + Name 50 "g_tTex1du4a" + Name 58 "txval20" + Name 61 "g_tTex2df4a" + Name 69 "txval21" + Name 72 "g_tTex2di4a" + Name 80 "txval22" + Name 83 "g_tTex2du4a" + Name 92 "txval40" + Name 95 "g_tTexcdf4a" + Name 102 "txval41" + Name 105 "g_tTexcdi4a" + Name 112 "txval42" + Name 115 "g_tTexcdu4a" + Name 126 "psout" + Name 136 "flattenTemp" + Name 139 "@entryPointOutput.Color" + Name 143 "@entryPointOutput.Depth" + Name 146 "g_tTex1df4" + Decorate 16(g_tTex1df4a) DescriptorSet 0 + Decorate 16(g_tTex1df4a) Binding 1 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 36(g_tTex1di4a) DescriptorSet 0 + Decorate 50(g_tTex1du4a) DescriptorSet 0 + Decorate 61(g_tTex2df4a) DescriptorSet 0 + Decorate 72(g_tTex2di4a) DescriptorSet 0 + Decorate 83(g_tTex2du4a) DescriptorSet 0 + Decorate 95(g_tTexcdf4a) DescriptorSet 0 + Decorate 105(g_tTexcdi4a) DescriptorSet 0 + Decorate 115(g_tTexcdu4a) DescriptorSet 0 + Decorate 139(@entryPointOutput.Color) Location 0 + Decorate 143(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 146(g_tTex1df4) DescriptorSet 0 + Decorate 146(g_tTex1df4) Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 1D array sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4a): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 2 + 25: 6(float) Constant 1036831949 + 26: 6(float) Constant 1045220557 + 27: 24(fvec2) ConstantComposite 25 26 + 28: 6(float) Constant 1061158912 + 30: TypeInt 32 1 + 31: TypeVector 30(int) 4 + 32: TypePointer Function 31(ivec4) + 34: TypeImage 30(int) 1D array sampled format:Unknown + 35: TypePointer UniformConstant 34 + 36(g_tTex1di4a): 35(ptr) Variable UniformConstant + 39: TypeSampledImage 34 + 41: 6(float) Constant 1050253722 + 42: 24(fvec2) ConstantComposite 26 41 + 44: TypeInt 32 0 + 45: TypeVector 44(int) 4 + 46: TypePointer Function 45(ivec4) + 48: TypeImage 44(int) 1D array sampled format:Unknown + 49: TypePointer UniformConstant 48 + 50(g_tTex1du4a): 49(ptr) Variable UniformConstant + 53: TypeSampledImage 48 + 55: 6(float) Constant 1053609165 + 56: 24(fvec2) ConstantComposite 41 55 + 59: TypeImage 6(float) 2D array sampled format:Unknown + 60: TypePointer UniformConstant 59 + 61(g_tTex2df4a): 60(ptr) Variable UniformConstant + 64: TypeSampledImage 59 + 66: TypeVector 6(float) 3 + 67: 66(fvec3) ConstantComposite 25 26 41 + 70: TypeImage 30(int) 2D array sampled format:Unknown + 71: TypePointer UniformConstant 70 + 72(g_tTex2di4a): 71(ptr) Variable UniformConstant + 75: TypeSampledImage 70 + 77: 6(float) Constant 1056964608 + 78: 66(fvec3) ConstantComposite 41 55 77 + 81: TypeImage 44(int) 2D array sampled format:Unknown + 82: TypePointer UniformConstant 81 + 83(g_tTex2du4a): 82(ptr) Variable UniformConstant + 86: TypeSampledImage 81 + 88: 6(float) Constant 1058642330 + 89: 6(float) Constant 1060320051 + 90: 66(fvec3) ConstantComposite 77 88 89 + 93: TypeImage 6(float) Cube array sampled format:Unknown + 94: TypePointer UniformConstant 93 + 95(g_tTexcdf4a): 94(ptr) Variable UniformConstant + 98: TypeSampledImage 93 + 100: 7(fvec4) ConstantComposite 25 26 41 55 + 103: TypeImage 30(int) Cube array sampled format:Unknown + 104: TypePointer UniformConstant 103 +105(g_tTexcdi4a): 104(ptr) Variable UniformConstant + 108: TypeSampledImage 103 + 110: 7(fvec4) ConstantComposite 55 77 88 89 + 113: TypeImage 44(int) Cube array sampled format:Unknown + 114: TypePointer UniformConstant 113 +115(g_tTexcdu4a): 114(ptr) Variable UniformConstant + 118: TypeSampledImage 113 + 120: 6(float) Constant 1061997773 + 121: 6(float) Constant 1063675494 + 122: 6(float) Constant 1065353216 + 123: 7(fvec4) ConstantComposite 89 120 121 122 + 125: TypePointer Function 8(PS_OUTPUT) + 127: 30(int) Constant 0 + 128: 7(fvec4) ConstantComposite 122 122 122 122 + 130: 30(int) Constant 1 + 131: TypePointer Function 6(float) + 138: TypePointer Output 7(fvec4) +139(@entryPointOutput.Color): 138(ptr) Variable Output + 142: TypePointer Output 6(float) +143(@entryPointOutput.Depth): 142(ptr) Variable Output + 146(g_tTex1df4): 15(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +136(flattenTemp): 125(ptr) Variable Function + 137:8(PS_OUTPUT) FunctionCall 10(@main() + Store 136(flattenTemp) 137 + 140: 12(ptr) AccessChain 136(flattenTemp) 127 + 141: 7(fvec4) Load 140 + Store 139(@entryPointOutput.Color) 141 + 144: 131(ptr) AccessChain 136(flattenTemp) 130 + 145: 6(float) Load 144 + Store 143(@entryPointOutput.Depth) 145 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval10): 12(ptr) Variable Function + 33(txval11): 32(ptr) Variable Function + 47(txval12): 46(ptr) Variable Function + 58(txval20): 12(ptr) Variable Function + 69(txval21): 32(ptr) Variable Function + 80(txval22): 46(ptr) Variable Function + 92(txval40): 12(ptr) Variable Function + 102(txval41): 32(ptr) Variable Function + 112(txval42): 46(ptr) Variable Function + 126(psout): 125(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4a) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 29: 7(fvec4) ImageSampleExplicitLod 23 27 Lod 28 + Store 13(txval10) 29 + 37: 34 Load 36(g_tTex1di4a) + 38: 18 Load 20(g_sSamp) + 40: 39 SampledImage 37 38 + 43: 31(ivec4) ImageSampleExplicitLod 40 42 Lod 28 + Store 33(txval11) 43 + 51: 48 Load 50(g_tTex1du4a) + 52: 18 Load 20(g_sSamp) + 54: 53 SampledImage 51 52 + 57: 45(ivec4) ImageSampleExplicitLod 54 56 Lod 28 + Store 47(txval12) 57 + 62: 59 Load 61(g_tTex2df4a) + 63: 18 Load 20(g_sSamp) + 65: 64 SampledImage 62 63 + 68: 7(fvec4) ImageSampleExplicitLod 65 67 Lod 28 + Store 58(txval20) 68 + 73: 70 Load 72(g_tTex2di4a) + 74: 18 Load 20(g_sSamp) + 76: 75 SampledImage 73 74 + 79: 31(ivec4) ImageSampleExplicitLod 76 78 Lod 28 + Store 69(txval21) 79 + 84: 81 Load 83(g_tTex2du4a) + 85: 18 Load 20(g_sSamp) + 87: 86 SampledImage 84 85 + 91: 45(ivec4) ImageSampleExplicitLod 87 90 Lod 28 + Store 80(txval22) 91 + 96: 93 Load 95(g_tTexcdf4a) + 97: 18 Load 20(g_sSamp) + 99: 98 SampledImage 96 97 + 101: 7(fvec4) ImageSampleExplicitLod 99 100 Lod 28 + Store 92(txval40) 101 + 106: 103 Load 105(g_tTexcdi4a) + 107: 18 Load 20(g_sSamp) + 109: 108 SampledImage 106 107 + 111: 31(ivec4) ImageSampleExplicitLod 109 110 Lod 28 + Store 102(txval41) 111 + 116: 113 Load 115(g_tTexcdu4a) + 117: 18 Load 20(g_sSamp) + 119: 118 SampledImage 116 117 + 124: 45(ivec4) ImageSampleExplicitLod 119 123 Lod 28 + Store 112(txval42) 124 + 129: 12(ptr) AccessChain 126(psout) 127 + Store 129 128 + 132: 131(ptr) AccessChain 126(psout) 130 + Store 132 122 + 133:8(PS_OUTPUT) Load 126(psout) + ReturnValue 133 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.frag.out new file mode 100644 index 00000000..9327b844 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.frag.out @@ -0,0 +1,684 @@ +hlsl.samplelevel.basic.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:29 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 Function Parameters: +0:? Sequence +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of float) +0:32 'txval10' ( temp 4-component vector of float) +0:32 textureLod ( temp 4-component vector of float) +0:32 Construct combined texture-sampler ( temp sampler1D) +0:32 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:32 Constant: +0:32 0.100000 +0:32 Constant: +0:32 0.750000 +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of int) +0:33 'txval11' ( temp 4-component vector of int) +0:33 textureLod ( temp 4-component vector of int) +0:33 Construct combined texture-sampler ( temp isampler1D) +0:33 'g_tTex1di4' ( uniform itexture1D) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:33 Constant: +0:33 0.200000 +0:33 Constant: +0:33 0.750000 +0:34 Sequence +0:34 move second child to first child ( temp 4-component vector of uint) +0:34 'txval12' ( temp 4-component vector of uint) +0:34 textureLod ( temp 4-component vector of uint) +0:34 Construct combined texture-sampler ( temp usampler1D) +0:34 'g_tTex1du4' ( uniform utexture1D) +0:34 'g_sSamp' (layout( binding=0) uniform sampler) +0:34 Constant: +0:34 0.300000 +0:34 Constant: +0:34 0.750000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of float) +0:36 'txval20' ( temp 4-component vector of float) +0:36 textureLod ( temp 4-component vector of float) +0:36 Construct combined texture-sampler ( temp sampler2D) +0:36 'g_tTex2df4' ( uniform texture2D) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:36 Constant: +0:36 0.750000 +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of int) +0:37 'txval21' ( temp 4-component vector of int) +0:37 textureLod ( temp 4-component vector of int) +0:37 Construct combined texture-sampler ( temp isampler2D) +0:37 'g_tTex2di4' ( uniform itexture2D) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:37 Constant: +0:37 0.750000 +0:38 Sequence +0:38 move second child to first child ( temp 4-component vector of uint) +0:38 'txval22' ( temp 4-component vector of uint) +0:38 textureLod ( temp 4-component vector of uint) +0:38 Construct combined texture-sampler ( temp usampler2D) +0:38 'g_tTex2du4' ( uniform utexture2D) +0:38 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:38 Constant: +0:38 0.750000 +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of float) +0:40 'txval30' ( temp 4-component vector of float) +0:40 textureLod ( temp 4-component vector of float) +0:40 Construct combined texture-sampler ( temp sampler3D) +0:40 'g_tTex3df4' ( uniform texture3D) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:40 Constant: +0:40 0.750000 +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of int) +0:41 'txval31' ( temp 4-component vector of int) +0:41 textureLod ( temp 4-component vector of int) +0:41 Construct combined texture-sampler ( temp isampler3D) +0:41 'g_tTex3di4' ( uniform itexture3D) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:41 Constant: +0:41 0.750000 +0:42 Sequence +0:42 move second child to first child ( temp 4-component vector of uint) +0:42 'txval32' ( temp 4-component vector of uint) +0:42 textureLod ( temp 4-component vector of uint) +0:42 Construct combined texture-sampler ( temp usampler3D) +0:42 'g_tTex3du4' ( uniform utexture3D) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:42 Constant: +0:42 0.750000 +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of float) +0:44 'txval40' ( temp 4-component vector of float) +0:44 textureLod ( temp 4-component vector of float) +0:44 Construct combined texture-sampler ( temp samplerCube) +0:44 'g_tTexcdf4' ( uniform textureCube) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:44 Constant: +0:44 0.750000 +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of int) +0:45 'txval41' ( temp 4-component vector of int) +0:45 textureLod ( temp 4-component vector of int) +0:45 Construct combined texture-sampler ( temp isamplerCube) +0:45 'g_tTexcdi4' ( uniform itextureCube) +0:45 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:45 Constant: +0:45 0.750000 +0:46 Sequence +0:46 move second child to first child ( temp 4-component vector of uint) +0:46 'txval42' ( temp 4-component vector of uint) +0:46 textureLod ( temp 4-component vector of uint) +0:46 Construct combined texture-sampler ( temp usamplerCube) +0:46 'g_tTexcdu4' ( uniform utextureCube) +0:46 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:46 Constant: +0:46 0.750000 +0:48 move second child to first child ( temp 4-component vector of float) +0:48 Color: direct index for structure ( temp 4-component vector of float) +0:48 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 0 (const int) +0:48 Constant: +0:48 1.000000 +0:48 1.000000 +0:48 1.000000 +0:48 1.000000 +0:49 move second child to first child ( temp float) +0:49 Depth: direct index for structure ( temp float) +0:49 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:49 Constant: +0:49 1 (const int) +0:49 Constant: +0:49 1.000000 +0:51 Branch: Return with expression +0:51 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 Function Definition: main( ( temp void) +0:29 Function Parameters: +0:? Sequence +0:29 Sequence +0:29 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:29 Color: direct index for structure ( temp 4-component vector of float) +0:29 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 Constant: +0:29 0 (const int) +0:29 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:29 Depth: direct index for structure ( temp float) +0:29 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 Constant: +0:29 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_sSamp2d' ( uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:29 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 Function Parameters: +0:? Sequence +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of float) +0:32 'txval10' ( temp 4-component vector of float) +0:32 textureLod ( temp 4-component vector of float) +0:32 Construct combined texture-sampler ( temp sampler1D) +0:32 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:32 Constant: +0:32 0.100000 +0:32 Constant: +0:32 0.750000 +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of int) +0:33 'txval11' ( temp 4-component vector of int) +0:33 textureLod ( temp 4-component vector of int) +0:33 Construct combined texture-sampler ( temp isampler1D) +0:33 'g_tTex1di4' ( uniform itexture1D) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:33 Constant: +0:33 0.200000 +0:33 Constant: +0:33 0.750000 +0:34 Sequence +0:34 move second child to first child ( temp 4-component vector of uint) +0:34 'txval12' ( temp 4-component vector of uint) +0:34 textureLod ( temp 4-component vector of uint) +0:34 Construct combined texture-sampler ( temp usampler1D) +0:34 'g_tTex1du4' ( uniform utexture1D) +0:34 'g_sSamp' (layout( binding=0) uniform sampler) +0:34 Constant: +0:34 0.300000 +0:34 Constant: +0:34 0.750000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of float) +0:36 'txval20' ( temp 4-component vector of float) +0:36 textureLod ( temp 4-component vector of float) +0:36 Construct combined texture-sampler ( temp sampler2D) +0:36 'g_tTex2df4' ( uniform texture2D) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:36 Constant: +0:36 0.750000 +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of int) +0:37 'txval21' ( temp 4-component vector of int) +0:37 textureLod ( temp 4-component vector of int) +0:37 Construct combined texture-sampler ( temp isampler2D) +0:37 'g_tTex2di4' ( uniform itexture2D) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:37 Constant: +0:37 0.750000 +0:38 Sequence +0:38 move second child to first child ( temp 4-component vector of uint) +0:38 'txval22' ( temp 4-component vector of uint) +0:38 textureLod ( temp 4-component vector of uint) +0:38 Construct combined texture-sampler ( temp usampler2D) +0:38 'g_tTex2du4' ( uniform utexture2D) +0:38 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:38 Constant: +0:38 0.750000 +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of float) +0:40 'txval30' ( temp 4-component vector of float) +0:40 textureLod ( temp 4-component vector of float) +0:40 Construct combined texture-sampler ( temp sampler3D) +0:40 'g_tTex3df4' ( uniform texture3D) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:40 Constant: +0:40 0.750000 +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of int) +0:41 'txval31' ( temp 4-component vector of int) +0:41 textureLod ( temp 4-component vector of int) +0:41 Construct combined texture-sampler ( temp isampler3D) +0:41 'g_tTex3di4' ( uniform itexture3D) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:41 Constant: +0:41 0.750000 +0:42 Sequence +0:42 move second child to first child ( temp 4-component vector of uint) +0:42 'txval32' ( temp 4-component vector of uint) +0:42 textureLod ( temp 4-component vector of uint) +0:42 Construct combined texture-sampler ( temp usampler3D) +0:42 'g_tTex3du4' ( uniform utexture3D) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:42 Constant: +0:42 0.750000 +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of float) +0:44 'txval40' ( temp 4-component vector of float) +0:44 textureLod ( temp 4-component vector of float) +0:44 Construct combined texture-sampler ( temp samplerCube) +0:44 'g_tTexcdf4' ( uniform textureCube) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:44 Constant: +0:44 0.750000 +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of int) +0:45 'txval41' ( temp 4-component vector of int) +0:45 textureLod ( temp 4-component vector of int) +0:45 Construct combined texture-sampler ( temp isamplerCube) +0:45 'g_tTexcdi4' ( uniform itextureCube) +0:45 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:45 Constant: +0:45 0.750000 +0:46 Sequence +0:46 move second child to first child ( temp 4-component vector of uint) +0:46 'txval42' ( temp 4-component vector of uint) +0:46 textureLod ( temp 4-component vector of uint) +0:46 Construct combined texture-sampler ( temp usamplerCube) +0:46 'g_tTexcdu4' ( uniform utextureCube) +0:46 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:46 Constant: +0:46 0.750000 +0:48 move second child to first child ( temp 4-component vector of float) +0:48 Color: direct index for structure ( temp 4-component vector of float) +0:48 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:48 Constant: +0:48 0 (const int) +0:48 Constant: +0:48 1.000000 +0:48 1.000000 +0:48 1.000000 +0:48 1.000000 +0:49 move second child to first child ( temp float) +0:49 Depth: direct index for structure ( temp float) +0:49 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:49 Constant: +0:49 1 (const int) +0:49 Constant: +0:49 1.000000 +0:51 Branch: Return with expression +0:51 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 Function Definition: main( ( temp void) +0:29 Function Parameters: +0:? Sequence +0:29 Sequence +0:29 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:29 Color: direct index for structure ( temp 4-component vector of float) +0:29 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 Constant: +0:29 0 (const int) +0:29 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:29 Depth: direct index for structure ( temp float) +0:29 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:29 Constant: +0:29 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_sSamp2d' ( uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 172 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 163 167 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval10" + Name 16 "g_tTex1df4" + Name 20 "g_sSamp" + Name 30 "txval11" + Name 33 "g_tTex1di4" + Name 43 "txval12" + Name 46 "g_tTex1du4" + Name 53 "txval20" + Name 56 "g_tTex2df4" + Name 64 "txval21" + Name 67 "g_tTex2di4" + Name 75 "txval22" + Name 78 "g_tTex2du4" + Name 87 "txval30" + Name 90 "g_tTex3df4" + Name 98 "txval31" + Name 101 "g_tTex3di4" + Name 108 "txval32" + Name 111 "g_tTex3du4" + Name 121 "txval40" + Name 124 "g_tTexcdf4" + Name 130 "txval41" + Name 133 "g_tTexcdi4" + Name 139 "txval42" + Name 142 "g_tTexcdu4" + Name 149 "psout" + Name 160 "flattenTemp" + Name 163 "@entryPointOutput.Color" + Name 167 "@entryPointOutput.Depth" + Name 170 "g_sSamp2d" + Name 171 "g_tTex1df4a" + Decorate 16(g_tTex1df4) DescriptorSet 0 + Decorate 16(g_tTex1df4) Binding 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 33(g_tTex1di4) DescriptorSet 0 + Decorate 46(g_tTex1du4) DescriptorSet 0 + Decorate 56(g_tTex2df4) DescriptorSet 0 + Decorate 67(g_tTex2di4) DescriptorSet 0 + Decorate 78(g_tTex2du4) DescriptorSet 0 + Decorate 90(g_tTex3df4) DescriptorSet 0 + Decorate 101(g_tTex3di4) DescriptorSet 0 + Decorate 111(g_tTex3du4) DescriptorSet 0 + Decorate 124(g_tTexcdf4) DescriptorSet 0 + Decorate 133(g_tTexcdi4) DescriptorSet 0 + Decorate 142(g_tTexcdu4) DescriptorSet 0 + Decorate 163(@entryPointOutput.Color) Location 0 + Decorate 167(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 170(g_sSamp2d) DescriptorSet 0 + Decorate 171(g_tTex1df4a) DescriptorSet 0 + Decorate 171(g_tTex1df4a) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 1D sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: 6(float) Constant 1036831949 + 25: 6(float) Constant 1061158912 + 27: TypeInt 32 1 + 28: TypeVector 27(int) 4 + 29: TypePointer Function 28(ivec4) + 31: TypeImage 27(int) 1D sampled format:Unknown + 32: TypePointer UniformConstant 31 + 33(g_tTex1di4): 32(ptr) Variable UniformConstant + 36: TypeSampledImage 31 + 38: 6(float) Constant 1045220557 + 40: TypeInt 32 0 + 41: TypeVector 40(int) 4 + 42: TypePointer Function 41(ivec4) + 44: TypeImage 40(int) 1D sampled format:Unknown + 45: TypePointer UniformConstant 44 + 46(g_tTex1du4): 45(ptr) Variable UniformConstant + 49: TypeSampledImage 44 + 51: 6(float) Constant 1050253722 + 54: TypeImage 6(float) 2D sampled format:Unknown + 55: TypePointer UniformConstant 54 + 56(g_tTex2df4): 55(ptr) Variable UniformConstant + 59: TypeSampledImage 54 + 61: TypeVector 6(float) 2 + 62: 61(fvec2) ConstantComposite 24 38 + 65: TypeImage 27(int) 2D sampled format:Unknown + 66: TypePointer UniformConstant 65 + 67(g_tTex2di4): 66(ptr) Variable UniformConstant + 70: TypeSampledImage 65 + 72: 6(float) Constant 1053609165 + 73: 61(fvec2) ConstantComposite 51 72 + 76: TypeImage 40(int) 2D sampled format:Unknown + 77: TypePointer UniformConstant 76 + 78(g_tTex2du4): 77(ptr) Variable UniformConstant + 81: TypeSampledImage 76 + 83: 6(float) Constant 1056964608 + 84: 6(float) Constant 1058642330 + 85: 61(fvec2) ConstantComposite 83 84 + 88: TypeImage 6(float) 3D sampled format:Unknown + 89: TypePointer UniformConstant 88 + 90(g_tTex3df4): 89(ptr) Variable UniformConstant + 93: TypeSampledImage 88 + 95: TypeVector 6(float) 3 + 96: 95(fvec3) ConstantComposite 24 38 51 + 99: TypeImage 27(int) 3D sampled format:Unknown + 100: TypePointer UniformConstant 99 + 101(g_tTex3di4): 100(ptr) Variable UniformConstant + 104: TypeSampledImage 99 + 106: 95(fvec3) ConstantComposite 72 83 84 + 109: TypeImage 40(int) 3D sampled format:Unknown + 110: TypePointer UniformConstant 109 + 111(g_tTex3du4): 110(ptr) Variable UniformConstant + 114: TypeSampledImage 109 + 116: 6(float) Constant 1060320051 + 117: 6(float) Constant 1061997773 + 118: 6(float) Constant 1063675494 + 119: 95(fvec3) ConstantComposite 116 117 118 + 122: TypeImage 6(float) Cube sampled format:Unknown + 123: TypePointer UniformConstant 122 + 124(g_tTexcdf4): 123(ptr) Variable UniformConstant + 127: TypeSampledImage 122 + 131: TypeImage 27(int) Cube sampled format:Unknown + 132: TypePointer UniformConstant 131 + 133(g_tTexcdi4): 132(ptr) Variable UniformConstant + 136: TypeSampledImage 131 + 140: TypeImage 40(int) Cube sampled format:Unknown + 141: TypePointer UniformConstant 140 + 142(g_tTexcdu4): 141(ptr) Variable UniformConstant + 145: TypeSampledImage 140 + 148: TypePointer Function 8(PS_OUTPUT) + 150: 27(int) Constant 0 + 151: 6(float) Constant 1065353216 + 152: 7(fvec4) ConstantComposite 151 151 151 151 + 154: 27(int) Constant 1 + 155: TypePointer Function 6(float) + 162: TypePointer Output 7(fvec4) +163(@entryPointOutput.Color): 162(ptr) Variable Output + 166: TypePointer Output 6(float) +167(@entryPointOutput.Depth): 166(ptr) Variable Output + 170(g_sSamp2d): 19(ptr) Variable UniformConstant +171(g_tTex1df4a): 15(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +160(flattenTemp): 148(ptr) Variable Function + 161:8(PS_OUTPUT) FunctionCall 10(@main() + Store 160(flattenTemp) 161 + 164: 12(ptr) AccessChain 160(flattenTemp) 150 + 165: 7(fvec4) Load 164 + Store 163(@entryPointOutput.Color) 165 + 168: 155(ptr) AccessChain 160(flattenTemp) 154 + 169: 6(float) Load 168 + Store 167(@entryPointOutput.Depth) 169 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval10): 12(ptr) Variable Function + 30(txval11): 29(ptr) Variable Function + 43(txval12): 42(ptr) Variable Function + 53(txval20): 12(ptr) Variable Function + 64(txval21): 29(ptr) Variable Function + 75(txval22): 42(ptr) Variable Function + 87(txval30): 12(ptr) Variable Function + 98(txval31): 29(ptr) Variable Function + 108(txval32): 42(ptr) Variable Function + 121(txval40): 12(ptr) Variable Function + 130(txval41): 29(ptr) Variable Function + 139(txval42): 42(ptr) Variable Function + 149(psout): 148(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 26: 7(fvec4) ImageSampleExplicitLod 23 24 Lod 25 + Store 13(txval10) 26 + 34: 31 Load 33(g_tTex1di4) + 35: 18 Load 20(g_sSamp) + 37: 36 SampledImage 34 35 + 39: 28(ivec4) ImageSampleExplicitLod 37 38 Lod 25 + Store 30(txval11) 39 + 47: 44 Load 46(g_tTex1du4) + 48: 18 Load 20(g_sSamp) + 50: 49 SampledImage 47 48 + 52: 41(ivec4) ImageSampleExplicitLod 50 51 Lod 25 + Store 43(txval12) 52 + 57: 54 Load 56(g_tTex2df4) + 58: 18 Load 20(g_sSamp) + 60: 59 SampledImage 57 58 + 63: 7(fvec4) ImageSampleExplicitLod 60 62 Lod 25 + Store 53(txval20) 63 + 68: 65 Load 67(g_tTex2di4) + 69: 18 Load 20(g_sSamp) + 71: 70 SampledImage 68 69 + 74: 28(ivec4) ImageSampleExplicitLod 71 73 Lod 25 + Store 64(txval21) 74 + 79: 76 Load 78(g_tTex2du4) + 80: 18 Load 20(g_sSamp) + 82: 81 SampledImage 79 80 + 86: 41(ivec4) ImageSampleExplicitLod 82 85 Lod 25 + Store 75(txval22) 86 + 91: 88 Load 90(g_tTex3df4) + 92: 18 Load 20(g_sSamp) + 94: 93 SampledImage 91 92 + 97: 7(fvec4) ImageSampleExplicitLod 94 96 Lod 25 + Store 87(txval30) 97 + 102: 99 Load 101(g_tTex3di4) + 103: 18 Load 20(g_sSamp) + 105: 104 SampledImage 102 103 + 107: 28(ivec4) ImageSampleExplicitLod 105 106 Lod 25 + Store 98(txval31) 107 + 112: 109 Load 111(g_tTex3du4) + 113: 18 Load 20(g_sSamp) + 115: 114 SampledImage 112 113 + 120: 41(ivec4) ImageSampleExplicitLod 115 119 Lod 25 + Store 108(txval32) 120 + 125: 122 Load 124(g_tTexcdf4) + 126: 18 Load 20(g_sSamp) + 128: 127 SampledImage 125 126 + 129: 7(fvec4) ImageSampleExplicitLod 128 96 Lod 25 + Store 121(txval40) 129 + 134: 131 Load 133(g_tTexcdi4) + 135: 18 Load 20(g_sSamp) + 137: 136 SampledImage 134 135 + 138: 28(ivec4) ImageSampleExplicitLod 137 106 Lod 25 + Store 130(txval41) 138 + 143: 140 Load 142(g_tTexcdu4) + 144: 18 Load 20(g_sSamp) + 146: 145 SampledImage 143 144 + 147: 41(ivec4) ImageSampleExplicitLod 146 119 Lod 25 + Store 139(txval42) 147 + 153: 12(ptr) AccessChain 149(psout) 150 + Store 153 152 + 156: 155(ptr) AccessChain 149(psout) 154 + Store 156 151 + 157:8(PS_OUTPUT) Load 149(psout) + ReturnValue 157 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out b/deps/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out new file mode 100644 index 00000000..d2bd1b87 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out @@ -0,0 +1,623 @@ +hlsl.samplelevel.basic.dx10.vert +Shader version: 500 +0:? Sequence +0:27 Function Definition: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:27 Function Parameters: +0:? Sequence +0:30 Sequence +0:30 move second child to first child ( temp 4-component vector of float) +0:30 'txval10' ( temp 4-component vector of float) +0:30 textureLod ( temp 4-component vector of float) +0:30 Construct combined texture-sampler ( temp sampler1D) +0:30 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:30 'g_sSamp' (layout( binding=0) uniform sampler) +0:30 Constant: +0:30 0.100000 +0:30 Constant: +0:30 0.750000 +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of int) +0:31 'txval11' ( temp 4-component vector of int) +0:31 textureLod ( temp 4-component vector of int) +0:31 Construct combined texture-sampler ( temp isampler1D) +0:31 'g_tTex1di4' ( uniform itexture1D) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:31 Constant: +0:31 0.200000 +0:31 Constant: +0:31 0.750000 +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of uint) +0:32 'txval12' ( temp 4-component vector of uint) +0:32 textureLod ( temp 4-component vector of uint) +0:32 Construct combined texture-sampler ( temp usampler1D) +0:32 'g_tTex1du4' ( uniform utexture1D) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:32 Constant: +0:32 0.300000 +0:32 Constant: +0:32 0.750000 +0:34 Sequence +0:34 move second child to first child ( temp 4-component vector of float) +0:34 'txval20' ( temp 4-component vector of float) +0:34 textureLod ( temp 4-component vector of float) +0:34 Construct combined texture-sampler ( temp sampler2D) +0:34 'g_tTex2df4' ( uniform texture2D) +0:34 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:34 Constant: +0:34 0.750000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of int) +0:35 'txval21' ( temp 4-component vector of int) +0:35 textureLod ( temp 4-component vector of int) +0:35 Construct combined texture-sampler ( temp isampler2D) +0:35 'g_tTex2di4' ( uniform itexture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:35 Constant: +0:35 0.750000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of uint) +0:36 'txval22' ( temp 4-component vector of uint) +0:36 textureLod ( temp 4-component vector of uint) +0:36 Construct combined texture-sampler ( temp usampler2D) +0:36 'g_tTex2du4' ( uniform utexture2D) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:36 Constant: +0:36 0.750000 +0:38 Sequence +0:38 move second child to first child ( temp 4-component vector of float) +0:38 'txval30' ( temp 4-component vector of float) +0:38 textureLod ( temp 4-component vector of float) +0:38 Construct combined texture-sampler ( temp sampler3D) +0:38 'g_tTex3df4' ( uniform texture3D) +0:38 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:38 Constant: +0:38 0.750000 +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of int) +0:39 'txval31' ( temp 4-component vector of int) +0:39 textureLod ( temp 4-component vector of int) +0:39 Construct combined texture-sampler ( temp isampler3D) +0:39 'g_tTex3di4' ( uniform itexture3D) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:39 Constant: +0:39 0.750000 +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of uint) +0:40 'txval32' ( temp 4-component vector of uint) +0:40 textureLod ( temp 4-component vector of uint) +0:40 Construct combined texture-sampler ( temp usampler3D) +0:40 'g_tTex3du4' ( uniform utexture3D) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:40 Constant: +0:40 0.750000 +0:42 Sequence +0:42 move second child to first child ( temp 4-component vector of float) +0:42 'txval40' ( temp 4-component vector of float) +0:42 textureLod ( temp 4-component vector of float) +0:42 Construct combined texture-sampler ( temp samplerCube) +0:42 'g_tTexcdf4' ( uniform textureCube) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:42 Constant: +0:42 0.750000 +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of int) +0:43 'txval41' ( temp 4-component vector of int) +0:43 textureLod ( temp 4-component vector of int) +0:43 Construct combined texture-sampler ( temp isamplerCube) +0:43 'g_tTexcdi4' ( uniform itextureCube) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:43 Constant: +0:43 0.750000 +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of uint) +0:44 'txval42' ( temp 4-component vector of uint) +0:44 textureLod ( temp 4-component vector of uint) +0:44 Construct combined texture-sampler ( temp usamplerCube) +0:44 'g_tTexcdu4' ( uniform utextureCube) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:44 Constant: +0:44 0.750000 +0:46 move second child to first child ( temp 4-component vector of float) +0:46 Pos: direct index for structure ( temp 4-component vector of float) +0:46 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:46 Constant: +0:46 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:48 Branch: Return with expression +0:48 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:27 Function Definition: main( ( temp void) +0:27 Function Parameters: +0:? Sequence +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:27 Pos: direct index for structure ( temp 4-component vector of float) +0:27 Function Call: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:27 Constant: +0:27 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:27 Function Definition: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:27 Function Parameters: +0:? Sequence +0:30 Sequence +0:30 move second child to first child ( temp 4-component vector of float) +0:30 'txval10' ( temp 4-component vector of float) +0:30 textureLod ( temp 4-component vector of float) +0:30 Construct combined texture-sampler ( temp sampler1D) +0:30 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:30 'g_sSamp' (layout( binding=0) uniform sampler) +0:30 Constant: +0:30 0.100000 +0:30 Constant: +0:30 0.750000 +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of int) +0:31 'txval11' ( temp 4-component vector of int) +0:31 textureLod ( temp 4-component vector of int) +0:31 Construct combined texture-sampler ( temp isampler1D) +0:31 'g_tTex1di4' ( uniform itexture1D) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:31 Constant: +0:31 0.200000 +0:31 Constant: +0:31 0.750000 +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of uint) +0:32 'txval12' ( temp 4-component vector of uint) +0:32 textureLod ( temp 4-component vector of uint) +0:32 Construct combined texture-sampler ( temp usampler1D) +0:32 'g_tTex1du4' ( uniform utexture1D) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:32 Constant: +0:32 0.300000 +0:32 Constant: +0:32 0.750000 +0:34 Sequence +0:34 move second child to first child ( temp 4-component vector of float) +0:34 'txval20' ( temp 4-component vector of float) +0:34 textureLod ( temp 4-component vector of float) +0:34 Construct combined texture-sampler ( temp sampler2D) +0:34 'g_tTex2df4' ( uniform texture2D) +0:34 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:34 Constant: +0:34 0.750000 +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of int) +0:35 'txval21' ( temp 4-component vector of int) +0:35 textureLod ( temp 4-component vector of int) +0:35 Construct combined texture-sampler ( temp isampler2D) +0:35 'g_tTex2di4' ( uniform itexture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:35 Constant: +0:35 0.750000 +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of uint) +0:36 'txval22' ( temp 4-component vector of uint) +0:36 textureLod ( temp 4-component vector of uint) +0:36 Construct combined texture-sampler ( temp usampler2D) +0:36 'g_tTex2du4' ( uniform utexture2D) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:36 Constant: +0:36 0.750000 +0:38 Sequence +0:38 move second child to first child ( temp 4-component vector of float) +0:38 'txval30' ( temp 4-component vector of float) +0:38 textureLod ( temp 4-component vector of float) +0:38 Construct combined texture-sampler ( temp sampler3D) +0:38 'g_tTex3df4' ( uniform texture3D) +0:38 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:38 Constant: +0:38 0.750000 +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of int) +0:39 'txval31' ( temp 4-component vector of int) +0:39 textureLod ( temp 4-component vector of int) +0:39 Construct combined texture-sampler ( temp isampler3D) +0:39 'g_tTex3di4' ( uniform itexture3D) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:39 Constant: +0:39 0.750000 +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of uint) +0:40 'txval32' ( temp 4-component vector of uint) +0:40 textureLod ( temp 4-component vector of uint) +0:40 Construct combined texture-sampler ( temp usampler3D) +0:40 'g_tTex3du4' ( uniform utexture3D) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:40 Constant: +0:40 0.750000 +0:42 Sequence +0:42 move second child to first child ( temp 4-component vector of float) +0:42 'txval40' ( temp 4-component vector of float) +0:42 textureLod ( temp 4-component vector of float) +0:42 Construct combined texture-sampler ( temp samplerCube) +0:42 'g_tTexcdf4' ( uniform textureCube) +0:42 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:42 Constant: +0:42 0.750000 +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of int) +0:43 'txval41' ( temp 4-component vector of int) +0:43 textureLod ( temp 4-component vector of int) +0:43 Construct combined texture-sampler ( temp isamplerCube) +0:43 'g_tTexcdi4' ( uniform itextureCube) +0:43 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:43 Constant: +0:43 0.750000 +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of uint) +0:44 'txval42' ( temp 4-component vector of uint) +0:44 textureLod ( temp 4-component vector of uint) +0:44 Construct combined texture-sampler ( temp usamplerCube) +0:44 'g_tTexcdu4' ( uniform utextureCube) +0:44 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:44 Constant: +0:44 0.750000 +0:46 move second child to first child ( temp 4-component vector of float) +0:46 Pos: direct index for structure ( temp 4-component vector of float) +0:46 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:46 Constant: +0:46 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:48 Branch: Return with expression +0:48 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:27 Function Definition: main( ( temp void) +0:27 Function Parameters: +0:? Sequence +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:27 Pos: direct index for structure ( temp 4-component vector of float) +0:27 Function Call: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:27 Constant: +0:27 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 162 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 158 + Source HLSL 500 + Name 4 "main" + Name 8 "VS_OUTPUT" + MemberName 8(VS_OUTPUT) 0 "Pos" + Name 10 "@main(" + Name 13 "txval10" + Name 16 "g_tTex1df4" + Name 20 "g_sSamp" + Name 30 "txval11" + Name 33 "g_tTex1di4" + Name 43 "txval12" + Name 46 "g_tTex1du4" + Name 53 "txval20" + Name 56 "g_tTex2df4" + Name 64 "txval21" + Name 67 "g_tTex2di4" + Name 75 "txval22" + Name 78 "g_tTex2du4" + Name 87 "txval30" + Name 90 "g_tTex3df4" + Name 98 "txval31" + Name 101 "g_tTex3di4" + Name 108 "txval32" + Name 111 "g_tTex3du4" + Name 121 "txval40" + Name 124 "g_tTexcdf4" + Name 130 "txval41" + Name 133 "g_tTexcdi4" + Name 139 "txval42" + Name 142 "g_tTexcdu4" + Name 149 "vsout" + Name 158 "@entryPointOutput.Pos" + Name 161 "g_tTex1df4a" + Decorate 16(g_tTex1df4) DescriptorSet 0 + Decorate 16(g_tTex1df4) Binding 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 33(g_tTex1di4) DescriptorSet 0 + Decorate 46(g_tTex1du4) DescriptorSet 0 + Decorate 56(g_tTex2df4) DescriptorSet 0 + Decorate 67(g_tTex2di4) DescriptorSet 0 + Decorate 78(g_tTex2du4) DescriptorSet 0 + Decorate 90(g_tTex3df4) DescriptorSet 0 + Decorate 101(g_tTex3di4) DescriptorSet 0 + Decorate 111(g_tTex3du4) DescriptorSet 0 + Decorate 124(g_tTexcdf4) DescriptorSet 0 + Decorate 133(g_tTexcdi4) DescriptorSet 0 + Decorate 142(g_tTexcdu4) DescriptorSet 0 + Decorate 158(@entryPointOutput.Pos) BuiltIn Position + Decorate 161(g_tTex1df4a) DescriptorSet 0 + Decorate 161(g_tTex1df4a) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(VS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(VS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 1D sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: 6(float) Constant 1036831949 + 25: 6(float) Constant 1061158912 + 27: TypeInt 32 1 + 28: TypeVector 27(int) 4 + 29: TypePointer Function 28(ivec4) + 31: TypeImage 27(int) 1D sampled format:Unknown + 32: TypePointer UniformConstant 31 + 33(g_tTex1di4): 32(ptr) Variable UniformConstant + 36: TypeSampledImage 31 + 38: 6(float) Constant 1045220557 + 40: TypeInt 32 0 + 41: TypeVector 40(int) 4 + 42: TypePointer Function 41(ivec4) + 44: TypeImage 40(int) 1D sampled format:Unknown + 45: TypePointer UniformConstant 44 + 46(g_tTex1du4): 45(ptr) Variable UniformConstant + 49: TypeSampledImage 44 + 51: 6(float) Constant 1050253722 + 54: TypeImage 6(float) 2D sampled format:Unknown + 55: TypePointer UniformConstant 54 + 56(g_tTex2df4): 55(ptr) Variable UniformConstant + 59: TypeSampledImage 54 + 61: TypeVector 6(float) 2 + 62: 61(fvec2) ConstantComposite 24 38 + 65: TypeImage 27(int) 2D sampled format:Unknown + 66: TypePointer UniformConstant 65 + 67(g_tTex2di4): 66(ptr) Variable UniformConstant + 70: TypeSampledImage 65 + 72: 6(float) Constant 1053609165 + 73: 61(fvec2) ConstantComposite 51 72 + 76: TypeImage 40(int) 2D sampled format:Unknown + 77: TypePointer UniformConstant 76 + 78(g_tTex2du4): 77(ptr) Variable UniformConstant + 81: TypeSampledImage 76 + 83: 6(float) Constant 1056964608 + 84: 6(float) Constant 1058642330 + 85: 61(fvec2) ConstantComposite 83 84 + 88: TypeImage 6(float) 3D sampled format:Unknown + 89: TypePointer UniformConstant 88 + 90(g_tTex3df4): 89(ptr) Variable UniformConstant + 93: TypeSampledImage 88 + 95: TypeVector 6(float) 3 + 96: 95(fvec3) ConstantComposite 24 38 51 + 99: TypeImage 27(int) 3D sampled format:Unknown + 100: TypePointer UniformConstant 99 + 101(g_tTex3di4): 100(ptr) Variable UniformConstant + 104: TypeSampledImage 99 + 106: 95(fvec3) ConstantComposite 72 83 84 + 109: TypeImage 40(int) 3D sampled format:Unknown + 110: TypePointer UniformConstant 109 + 111(g_tTex3du4): 110(ptr) Variable UniformConstant + 114: TypeSampledImage 109 + 116: 6(float) Constant 1060320051 + 117: 6(float) Constant 1061997773 + 118: 6(float) Constant 1063675494 + 119: 95(fvec3) ConstantComposite 116 117 118 + 122: TypeImage 6(float) Cube sampled format:Unknown + 123: TypePointer UniformConstant 122 + 124(g_tTexcdf4): 123(ptr) Variable UniformConstant + 127: TypeSampledImage 122 + 131: TypeImage 27(int) Cube sampled format:Unknown + 132: TypePointer UniformConstant 131 + 133(g_tTexcdi4): 132(ptr) Variable UniformConstant + 136: TypeSampledImage 131 + 140: TypeImage 40(int) Cube sampled format:Unknown + 141: TypePointer UniformConstant 140 + 142(g_tTexcdu4): 141(ptr) Variable UniformConstant + 145: TypeSampledImage 140 + 148: TypePointer Function 8(VS_OUTPUT) + 150: 27(int) Constant 0 + 151: 6(float) Constant 0 + 152: 7(fvec4) ConstantComposite 151 151 151 151 + 157: TypePointer Output 7(fvec4) +158(@entryPointOutput.Pos): 157(ptr) Variable Output +161(g_tTex1df4a): 15(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 159:8(VS_OUTPUT) FunctionCall 10(@main() + 160: 7(fvec4) CompositeExtract 159 0 + Store 158(@entryPointOutput.Pos) 160 + Return + FunctionEnd + 10(@main():8(VS_OUTPUT) Function None 9 + 11: Label + 13(txval10): 12(ptr) Variable Function + 30(txval11): 29(ptr) Variable Function + 43(txval12): 42(ptr) Variable Function + 53(txval20): 12(ptr) Variable Function + 64(txval21): 29(ptr) Variable Function + 75(txval22): 42(ptr) Variable Function + 87(txval30): 12(ptr) Variable Function + 98(txval31): 29(ptr) Variable Function + 108(txval32): 42(ptr) Variable Function + 121(txval40): 12(ptr) Variable Function + 130(txval41): 29(ptr) Variable Function + 139(txval42): 42(ptr) Variable Function + 149(vsout): 148(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 26: 7(fvec4) ImageSampleExplicitLod 23 24 Lod 25 + Store 13(txval10) 26 + 34: 31 Load 33(g_tTex1di4) + 35: 18 Load 20(g_sSamp) + 37: 36 SampledImage 34 35 + 39: 28(ivec4) ImageSampleExplicitLod 37 38 Lod 25 + Store 30(txval11) 39 + 47: 44 Load 46(g_tTex1du4) + 48: 18 Load 20(g_sSamp) + 50: 49 SampledImage 47 48 + 52: 41(ivec4) ImageSampleExplicitLod 50 51 Lod 25 + Store 43(txval12) 52 + 57: 54 Load 56(g_tTex2df4) + 58: 18 Load 20(g_sSamp) + 60: 59 SampledImage 57 58 + 63: 7(fvec4) ImageSampleExplicitLod 60 62 Lod 25 + Store 53(txval20) 63 + 68: 65 Load 67(g_tTex2di4) + 69: 18 Load 20(g_sSamp) + 71: 70 SampledImage 68 69 + 74: 28(ivec4) ImageSampleExplicitLod 71 73 Lod 25 + Store 64(txval21) 74 + 79: 76 Load 78(g_tTex2du4) + 80: 18 Load 20(g_sSamp) + 82: 81 SampledImage 79 80 + 86: 41(ivec4) ImageSampleExplicitLod 82 85 Lod 25 + Store 75(txval22) 86 + 91: 88 Load 90(g_tTex3df4) + 92: 18 Load 20(g_sSamp) + 94: 93 SampledImage 91 92 + 97: 7(fvec4) ImageSampleExplicitLod 94 96 Lod 25 + Store 87(txval30) 97 + 102: 99 Load 101(g_tTex3di4) + 103: 18 Load 20(g_sSamp) + 105: 104 SampledImage 102 103 + 107: 28(ivec4) ImageSampleExplicitLod 105 106 Lod 25 + Store 98(txval31) 107 + 112: 109 Load 111(g_tTex3du4) + 113: 18 Load 20(g_sSamp) + 115: 114 SampledImage 112 113 + 120: 41(ivec4) ImageSampleExplicitLod 115 119 Lod 25 + Store 108(txval32) 120 + 125: 122 Load 124(g_tTexcdf4) + 126: 18 Load 20(g_sSamp) + 128: 127 SampledImage 125 126 + 129: 7(fvec4) ImageSampleExplicitLod 128 96 Lod 25 + Store 121(txval40) 129 + 134: 131 Load 133(g_tTexcdi4) + 135: 18 Load 20(g_sSamp) + 137: 136 SampledImage 134 135 + 138: 28(ivec4) ImageSampleExplicitLod 137 106 Lod 25 + Store 130(txval41) 138 + 143: 140 Load 142(g_tTexcdu4) + 144: 18 Load 20(g_sSamp) + 146: 145 SampledImage 143 144 + 147: 41(ivec4) ImageSampleExplicitLod 146 119 Lod 25 + Store 139(txval42) 147 + 153: 12(ptr) AccessChain 149(vsout) 150 + Store 153 152 + 154:8(VS_OUTPUT) Load 149(vsout) + ReturnValue 154 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplelevel.offset.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplelevel.offset.dx10.frag.out new file mode 100644 index 00000000..36c932c8 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplelevel.offset.dx10.frag.out @@ -0,0 +1,640 @@ +hlsl.samplelevel.offset.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Parameters: +0:? Sequence +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval10' ( temp 4-component vector of float) +0:31 textureLodOffset ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler1D) +0:31 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:31 Constant: +0:31 0.100000 +0:31 Constant: +0:31 0.750000 +0:31 Constant: +0:31 1 (const int) +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval11' ( temp 4-component vector of int) +0:32 textureLodOffset ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler1D) +0:32 'g_tTex1di4' ( uniform itexture1D) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:32 Constant: +0:32 0.200000 +0:32 Constant: +0:32 0.750000 +0:32 Constant: +0:32 1 (const int) +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval12' ( temp 4-component vector of uint) +0:33 textureLodOffset ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler1D) +0:33 'g_tTex1du4' ( uniform utexture1D) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:33 Constant: +0:33 0.300000 +0:33 Constant: +0:33 0.750000 +0:33 Constant: +0:33 1 (const int) +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval20' ( temp 4-component vector of float) +0:35 textureLodOffset ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp sampler2D) +0:35 'g_tTex2df4' ( uniform texture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:35 Constant: +0:35 0.750000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval21' ( temp 4-component vector of int) +0:36 textureLodOffset ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isampler2D) +0:36 'g_tTex2di4' ( uniform itexture2D) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:36 Constant: +0:36 0.750000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval22' ( temp 4-component vector of uint) +0:37 textureLodOffset ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usampler2D) +0:37 'g_tTex2du4' ( uniform utexture2D) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:37 Constant: +0:37 0.750000 +0:? Constant: +0:? 1 (const int) +0:? -1 (const int) +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 'txval30' ( temp 4-component vector of float) +0:39 textureLodOffset ( temp 4-component vector of float) +0:39 Construct combined texture-sampler ( temp sampler3D) +0:39 'g_tTex3df4' ( uniform texture3D) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:39 Constant: +0:39 0.750000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:? 1 (const int) +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of int) +0:40 'txval31' ( temp 4-component vector of int) +0:40 textureLodOffset ( temp 4-component vector of int) +0:40 Construct combined texture-sampler ( temp isampler3D) +0:40 'g_tTex3di4' ( uniform itexture3D) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:40 Constant: +0:40 0.750000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of uint) +0:41 'txval32' ( temp 4-component vector of uint) +0:41 textureLodOffset ( temp 4-component vector of uint) +0:41 Construct combined texture-sampler ( temp usampler3D) +0:41 'g_tTex3du4' ( uniform utexture3D) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:41 Constant: +0:41 0.750000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:? -1 (const int) +0:45 move second child to first child ( temp 4-component vector of float) +0:45 Color: direct index for structure ( temp 4-component vector of float) +0:45 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 1.000000 +0:45 1.000000 +0:45 1.000000 +0:45 1.000000 +0:46 move second child to first child ( temp float) +0:46 Depth: direct index for structure ( temp float) +0:46 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 1.000000 +0:48 Branch: Return with expression +0:48 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:28 Color: direct index for structure ( temp 4-component vector of float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 0 (const int) +0:28 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:28 Depth: direct index for structure ( temp float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:28 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Parameters: +0:? Sequence +0:31 Sequence +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'txval10' ( temp 4-component vector of float) +0:31 textureLodOffset ( temp 4-component vector of float) +0:31 Construct combined texture-sampler ( temp sampler1D) +0:31 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:31 'g_sSamp' (layout( binding=0) uniform sampler) +0:31 Constant: +0:31 0.100000 +0:31 Constant: +0:31 0.750000 +0:31 Constant: +0:31 1 (const int) +0:32 Sequence +0:32 move second child to first child ( temp 4-component vector of int) +0:32 'txval11' ( temp 4-component vector of int) +0:32 textureLodOffset ( temp 4-component vector of int) +0:32 Construct combined texture-sampler ( temp isampler1D) +0:32 'g_tTex1di4' ( uniform itexture1D) +0:32 'g_sSamp' (layout( binding=0) uniform sampler) +0:32 Constant: +0:32 0.200000 +0:32 Constant: +0:32 0.750000 +0:32 Constant: +0:32 1 (const int) +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of uint) +0:33 'txval12' ( temp 4-component vector of uint) +0:33 textureLodOffset ( temp 4-component vector of uint) +0:33 Construct combined texture-sampler ( temp usampler1D) +0:33 'g_tTex1du4' ( uniform utexture1D) +0:33 'g_sSamp' (layout( binding=0) uniform sampler) +0:33 Constant: +0:33 0.300000 +0:33 Constant: +0:33 0.750000 +0:33 Constant: +0:33 1 (const int) +0:35 Sequence +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'txval20' ( temp 4-component vector of float) +0:35 textureLodOffset ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp sampler2D) +0:35 'g_tTex2df4' ( uniform texture2D) +0:35 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:35 Constant: +0:35 0.750000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of int) +0:36 'txval21' ( temp 4-component vector of int) +0:36 textureLodOffset ( temp 4-component vector of int) +0:36 Construct combined texture-sampler ( temp isampler2D) +0:36 'g_tTex2di4' ( uniform itexture2D) +0:36 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:36 Constant: +0:36 0.750000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:37 Sequence +0:37 move second child to first child ( temp 4-component vector of uint) +0:37 'txval22' ( temp 4-component vector of uint) +0:37 textureLodOffset ( temp 4-component vector of uint) +0:37 Construct combined texture-sampler ( temp usampler2D) +0:37 'g_tTex2du4' ( uniform utexture2D) +0:37 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:37 Constant: +0:37 0.750000 +0:? Constant: +0:? 1 (const int) +0:? -1 (const int) +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 'txval30' ( temp 4-component vector of float) +0:39 textureLodOffset ( temp 4-component vector of float) +0:39 Construct combined texture-sampler ( temp sampler3D) +0:39 'g_tTex3df4' ( uniform texture3D) +0:39 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:39 Constant: +0:39 0.750000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:? 1 (const int) +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of int) +0:40 'txval31' ( temp 4-component vector of int) +0:40 textureLodOffset ( temp 4-component vector of int) +0:40 Construct combined texture-sampler ( temp isampler3D) +0:40 'g_tTex3di4' ( uniform itexture3D) +0:40 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.500000 +0:? 0.600000 +0:40 Constant: +0:40 0.750000 +0:? Constant: +0:? 1 (const int) +0:? 1 (const int) +0:? 1 (const int) +0:41 Sequence +0:41 move second child to first child ( temp 4-component vector of uint) +0:41 'txval32' ( temp 4-component vector of uint) +0:41 textureLodOffset ( temp 4-component vector of uint) +0:41 Construct combined texture-sampler ( temp usampler3D) +0:41 'g_tTex3du4' ( uniform utexture3D) +0:41 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.700000 +0:? 0.800000 +0:? 0.900000 +0:41 Constant: +0:41 0.750000 +0:? Constant: +0:? 1 (const int) +0:? 0 (const int) +0:? -1 (const int) +0:45 move second child to first child ( temp 4-component vector of float) +0:45 Color: direct index for structure ( temp 4-component vector of float) +0:45 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 1.000000 +0:45 1.000000 +0:45 1.000000 +0:45 1.000000 +0:46 move second child to first child ( temp float) +0:46 Depth: direct index for structure ( temp float) +0:46 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 1.000000 +0:48 Branch: Return with expression +0:48 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Definition: main( ( temp void) +0:28 Function Parameters: +0:? Sequence +0:28 Sequence +0:28 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:28 Color: direct index for structure ( temp 4-component vector of float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 0 (const int) +0:28 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:28 Depth: direct index for structure ( temp float) +0:28 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:28 Constant: +0:28 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1D) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTexcdf4' ( uniform textureCube) +0:? 'g_tTexcdi4' ( uniform itextureCube) +0:? 'g_tTexcdu4' ( uniform utextureCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 162 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 145 149 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval10" + Name 16 "g_tTex1df4" + Name 20 "g_sSamp" + Name 31 "txval11" + Name 34 "g_tTex1di4" + Name 44 "txval12" + Name 47 "g_tTex1du4" + Name 54 "txval20" + Name 57 "g_tTex2df4" + Name 68 "txval21" + Name 71 "g_tTex2di4" + Name 80 "txval22" + Name 83 "g_tTex2du4" + Name 94 "txval30" + Name 97 "g_tTex3df4" + Name 107 "txval31" + Name 110 "g_tTex3di4" + Name 118 "txval32" + Name 121 "g_tTex3du4" + Name 133 "psout" + Name 142 "flattenTemp" + Name 145 "@entryPointOutput.Color" + Name 149 "@entryPointOutput.Depth" + Name 152 "g_tTex1df4a" + Name 155 "g_tTexcdf4" + Name 158 "g_tTexcdi4" + Name 161 "g_tTexcdu4" + Decorate 16(g_tTex1df4) DescriptorSet 0 + Decorate 16(g_tTex1df4) Binding 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 34(g_tTex1di4) DescriptorSet 0 + Decorate 47(g_tTex1du4) DescriptorSet 0 + Decorate 57(g_tTex2df4) DescriptorSet 0 + Decorate 71(g_tTex2di4) DescriptorSet 0 + Decorate 83(g_tTex2du4) DescriptorSet 0 + Decorate 97(g_tTex3df4) DescriptorSet 0 + Decorate 110(g_tTex3di4) DescriptorSet 0 + Decorate 121(g_tTex3du4) DescriptorSet 0 + Decorate 145(@entryPointOutput.Color) Location 0 + Decorate 149(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 152(g_tTex1df4a) DescriptorSet 0 + Decorate 152(g_tTex1df4a) Binding 1 + Decorate 155(g_tTexcdf4) DescriptorSet 0 + Decorate 158(g_tTexcdi4) DescriptorSet 0 + Decorate 161(g_tTexcdu4) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 1D sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: 6(float) Constant 1036831949 + 25: 6(float) Constant 1061158912 + 26: TypeInt 32 1 + 27: 26(int) Constant 1 + 29: TypeVector 26(int) 4 + 30: TypePointer Function 29(ivec4) + 32: TypeImage 26(int) 1D sampled format:Unknown + 33: TypePointer UniformConstant 32 + 34(g_tTex1di4): 33(ptr) Variable UniformConstant + 37: TypeSampledImage 32 + 39: 6(float) Constant 1045220557 + 41: TypeInt 32 0 + 42: TypeVector 41(int) 4 + 43: TypePointer Function 42(ivec4) + 45: TypeImage 41(int) 1D sampled format:Unknown + 46: TypePointer UniformConstant 45 + 47(g_tTex1du4): 46(ptr) Variable UniformConstant + 50: TypeSampledImage 45 + 52: 6(float) Constant 1050253722 + 55: TypeImage 6(float) 2D sampled format:Unknown + 56: TypePointer UniformConstant 55 + 57(g_tTex2df4): 56(ptr) Variable UniformConstant + 60: TypeSampledImage 55 + 62: TypeVector 6(float) 2 + 63: 62(fvec2) ConstantComposite 24 39 + 64: TypeVector 26(int) 2 + 65: 26(int) Constant 0 + 66: 64(ivec2) ConstantComposite 27 65 + 69: TypeImage 26(int) 2D sampled format:Unknown + 70: TypePointer UniformConstant 69 + 71(g_tTex2di4): 70(ptr) Variable UniformConstant + 74: TypeSampledImage 69 + 76: 6(float) Constant 1053609165 + 77: 62(fvec2) ConstantComposite 52 76 + 78: 64(ivec2) ConstantComposite 27 27 + 81: TypeImage 41(int) 2D sampled format:Unknown + 82: TypePointer UniformConstant 81 + 83(g_tTex2du4): 82(ptr) Variable UniformConstant + 86: TypeSampledImage 81 + 88: 6(float) Constant 1056964608 + 89: 6(float) Constant 1058642330 + 90: 62(fvec2) ConstantComposite 88 89 + 91: 26(int) Constant 4294967295 + 92: 64(ivec2) ConstantComposite 27 91 + 95: TypeImage 6(float) 3D sampled format:Unknown + 96: TypePointer UniformConstant 95 + 97(g_tTex3df4): 96(ptr) Variable UniformConstant + 100: TypeSampledImage 95 + 102: TypeVector 6(float) 3 + 103: 102(fvec3) ConstantComposite 24 39 52 + 104: TypeVector 26(int) 3 + 105: 104(ivec3) ConstantComposite 27 65 27 + 108: TypeImage 26(int) 3D sampled format:Unknown + 109: TypePointer UniformConstant 108 + 110(g_tTex3di4): 109(ptr) Variable UniformConstant + 113: TypeSampledImage 108 + 115: 102(fvec3) ConstantComposite 76 88 89 + 116: 104(ivec3) ConstantComposite 27 27 27 + 119: TypeImage 41(int) 3D sampled format:Unknown + 120: TypePointer UniformConstant 119 + 121(g_tTex3du4): 120(ptr) Variable UniformConstant + 124: TypeSampledImage 119 + 126: 6(float) Constant 1060320051 + 127: 6(float) Constant 1061997773 + 128: 6(float) Constant 1063675494 + 129: 102(fvec3) ConstantComposite 126 127 128 + 130: 104(ivec3) ConstantComposite 27 65 91 + 132: TypePointer Function 8(PS_OUTPUT) + 134: 6(float) Constant 1065353216 + 135: 7(fvec4) ConstantComposite 134 134 134 134 + 137: TypePointer Function 6(float) + 144: TypePointer Output 7(fvec4) +145(@entryPointOutput.Color): 144(ptr) Variable Output + 148: TypePointer Output 6(float) +149(@entryPointOutput.Depth): 148(ptr) Variable Output +152(g_tTex1df4a): 15(ptr) Variable UniformConstant + 153: TypeImage 6(float) Cube sampled format:Unknown + 154: TypePointer UniformConstant 153 + 155(g_tTexcdf4): 154(ptr) Variable UniformConstant + 156: TypeImage 26(int) Cube sampled format:Unknown + 157: TypePointer UniformConstant 156 + 158(g_tTexcdi4): 157(ptr) Variable UniformConstant + 159: TypeImage 41(int) Cube sampled format:Unknown + 160: TypePointer UniformConstant 159 + 161(g_tTexcdu4): 160(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +142(flattenTemp): 132(ptr) Variable Function + 143:8(PS_OUTPUT) FunctionCall 10(@main() + Store 142(flattenTemp) 143 + 146: 12(ptr) AccessChain 142(flattenTemp) 65 + 147: 7(fvec4) Load 146 + Store 145(@entryPointOutput.Color) 147 + 150: 137(ptr) AccessChain 142(flattenTemp) 27 + 151: 6(float) Load 150 + Store 149(@entryPointOutput.Depth) 151 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval10): 12(ptr) Variable Function + 31(txval11): 30(ptr) Variable Function + 44(txval12): 43(ptr) Variable Function + 54(txval20): 12(ptr) Variable Function + 68(txval21): 30(ptr) Variable Function + 80(txval22): 43(ptr) Variable Function + 94(txval30): 12(ptr) Variable Function + 107(txval31): 30(ptr) Variable Function + 118(txval32): 43(ptr) Variable Function + 133(psout): 132(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 28: 7(fvec4) ImageSampleExplicitLod 23 24 Lod ConstOffset 25 27 + Store 13(txval10) 28 + 35: 32 Load 34(g_tTex1di4) + 36: 18 Load 20(g_sSamp) + 38: 37 SampledImage 35 36 + 40: 29(ivec4) ImageSampleExplicitLod 38 39 Lod ConstOffset 25 27 + Store 31(txval11) 40 + 48: 45 Load 47(g_tTex1du4) + 49: 18 Load 20(g_sSamp) + 51: 50 SampledImage 48 49 + 53: 42(ivec4) ImageSampleExplicitLod 51 52 Lod ConstOffset 25 27 + Store 44(txval12) 53 + 58: 55 Load 57(g_tTex2df4) + 59: 18 Load 20(g_sSamp) + 61: 60 SampledImage 58 59 + 67: 7(fvec4) ImageSampleExplicitLod 61 63 Lod ConstOffset 25 66 + Store 54(txval20) 67 + 72: 69 Load 71(g_tTex2di4) + 73: 18 Load 20(g_sSamp) + 75: 74 SampledImage 72 73 + 79: 29(ivec4) ImageSampleExplicitLod 75 77 Lod ConstOffset 25 78 + Store 68(txval21) 79 + 84: 81 Load 83(g_tTex2du4) + 85: 18 Load 20(g_sSamp) + 87: 86 SampledImage 84 85 + 93: 42(ivec4) ImageSampleExplicitLod 87 90 Lod ConstOffset 25 92 + Store 80(txval22) 93 + 98: 95 Load 97(g_tTex3df4) + 99: 18 Load 20(g_sSamp) + 101: 100 SampledImage 98 99 + 106: 7(fvec4) ImageSampleExplicitLod 101 103 Lod ConstOffset 25 105 + Store 94(txval30) 106 + 111: 108 Load 110(g_tTex3di4) + 112: 18 Load 20(g_sSamp) + 114: 113 SampledImage 111 112 + 117: 29(ivec4) ImageSampleExplicitLod 114 115 Lod ConstOffset 25 116 + Store 107(txval31) 117 + 122: 119 Load 121(g_tTex3du4) + 123: 18 Load 20(g_sSamp) + 125: 124 SampledImage 122 123 + 131: 42(ivec4) ImageSampleExplicitLod 125 129 Lod ConstOffset 25 130 + Store 118(txval32) 131 + 136: 12(ptr) AccessChain 133(psout) 65 + Store 136 135 + 138: 137(ptr) AccessChain 133(psout) 27 + Store 138 134 + 139:8(PS_OUTPUT) Load 133(psout) + ReturnValue 139 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.samplelevel.offsetarray.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplelevel.offsetarray.dx10.frag.out new file mode 100644 index 00000000..bc6fd6b4 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.samplelevel.offsetarray.dx10.frag.out @@ -0,0 +1,477 @@ +hlsl.samplelevel.offsetarray.dx10.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:20 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Parameters: +0:? Sequence +0:23 Sequence +0:23 move second child to first child ( temp 4-component vector of float) +0:23 'txval10' ( temp 4-component vector of float) +0:23 textureLodOffset ( temp 4-component vector of float) +0:23 Construct combined texture-sampler ( temp sampler1DArray) +0:23 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:23 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:23 Constant: +0:23 0.750000 +0:23 Constant: +0:23 0 (const int) +0:24 Sequence +0:24 move second child to first child ( temp 4-component vector of int) +0:24 'txval11' ( temp 4-component vector of int) +0:24 textureLodOffset ( temp 4-component vector of int) +0:24 Construct combined texture-sampler ( temp isampler1DArray) +0:24 'g_tTex1di4' ( uniform itexture1DArray) +0:24 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:24 Constant: +0:24 0.750000 +0:24 Constant: +0:24 1 (const int) +0:25 Sequence +0:25 move second child to first child ( temp 4-component vector of uint) +0:25 'txval12' ( temp 4-component vector of uint) +0:25 textureLodOffset ( temp 4-component vector of uint) +0:25 Construct combined texture-sampler ( temp usampler1DArray) +0:25 'g_tTex1du4' ( uniform utexture1DArray) +0:25 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:25 Constant: +0:25 0.750000 +0:25 Constant: +0:25 2 (const int) +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'txval20' ( temp 4-component vector of float) +0:27 textureLodOffset ( temp 4-component vector of float) +0:27 Construct combined texture-sampler ( temp sampler2DArray) +0:27 'g_tTex2df4' ( uniform texture2DArray) +0:27 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:27 Constant: +0:27 0.750000 +0:? Constant: +0:? 0 (const int) +0:? 0 (const int) +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of int) +0:28 'txval21' ( temp 4-component vector of int) +0:28 textureLodOffset ( temp 4-component vector of int) +0:28 Construct combined texture-sampler ( temp isampler2DArray) +0:28 'g_tTex2di4' ( uniform itexture2DArray) +0:28 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? 0.500000 +0:28 Constant: +0:28 0.750000 +0:? Constant: +0:? 0 (const int) +0:? 0 (const int) +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of uint) +0:29 'txval22' ( temp 4-component vector of uint) +0:29 textureLodOffset ( temp 4-component vector of uint) +0:29 Construct combined texture-sampler ( temp usampler2DArray) +0:29 'g_tTex2du4' ( uniform utexture2DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:29 Constant: +0:29 0.750000 +0:? Constant: +0:? 0 (const int) +0:? 1 (const int) +0:33 move second child to first child ( temp 4-component vector of float) +0:33 Color: direct index for structure ( temp 4-component vector of float) +0:33 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 1.000000 +0:33 1.000000 +0:33 1.000000 +0:33 1.000000 +0:34 move second child to first child ( temp float) +0:34 Depth: direct index for structure ( temp float) +0:34 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 Constant: +0:34 1 (const int) +0:34 Constant: +0:34 1.000000 +0:36 Branch: Return with expression +0:36 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 Sequence +0:20 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:20 Color: direct index for structure ( temp 4-component vector of float) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Constant: +0:20 0 (const int) +0:20 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:20 Depth: direct index for structure ( temp float) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Constant: +0:20 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4' ( uniform itexture1DArray) +0:? 'g_tTex1du4' ( uniform utexture1DArray) +0:? 'g_tTex2df4' ( uniform texture2DArray) +0:? 'g_tTex2di4' ( uniform itexture2DArray) +0:? 'g_tTex2du4' ( uniform utexture2DArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:20 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Parameters: +0:? Sequence +0:23 Sequence +0:23 move second child to first child ( temp 4-component vector of float) +0:23 'txval10' ( temp 4-component vector of float) +0:23 textureLodOffset ( temp 4-component vector of float) +0:23 Construct combined texture-sampler ( temp sampler1DArray) +0:23 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:23 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:23 Constant: +0:23 0.750000 +0:23 Constant: +0:23 0 (const int) +0:24 Sequence +0:24 move second child to first child ( temp 4-component vector of int) +0:24 'txval11' ( temp 4-component vector of int) +0:24 textureLodOffset ( temp 4-component vector of int) +0:24 Construct combined texture-sampler ( temp isampler1DArray) +0:24 'g_tTex1di4' ( uniform itexture1DArray) +0:24 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.200000 +0:? 0.300000 +0:24 Constant: +0:24 0.750000 +0:24 Constant: +0:24 1 (const int) +0:25 Sequence +0:25 move second child to first child ( temp 4-component vector of uint) +0:25 'txval12' ( temp 4-component vector of uint) +0:25 textureLodOffset ( temp 4-component vector of uint) +0:25 Construct combined texture-sampler ( temp usampler1DArray) +0:25 'g_tTex1du4' ( uniform utexture1DArray) +0:25 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:25 Constant: +0:25 0.750000 +0:25 Constant: +0:25 2 (const int) +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'txval20' ( temp 4-component vector of float) +0:27 textureLodOffset ( temp 4-component vector of float) +0:27 Construct combined texture-sampler ( temp sampler2DArray) +0:27 'g_tTex2df4' ( uniform texture2DArray) +0:27 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:? 0.300000 +0:27 Constant: +0:27 0.750000 +0:? Constant: +0:? 0 (const int) +0:? 0 (const int) +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of int) +0:28 'txval21' ( temp 4-component vector of int) +0:28 textureLodOffset ( temp 4-component vector of int) +0:28 Construct combined texture-sampler ( temp isampler2DArray) +0:28 'g_tTex2di4' ( uniform itexture2DArray) +0:28 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? 0.500000 +0:28 Constant: +0:28 0.750000 +0:? Constant: +0:? 0 (const int) +0:? 0 (const int) +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of uint) +0:29 'txval22' ( temp 4-component vector of uint) +0:29 textureLodOffset ( temp 4-component vector of uint) +0:29 Construct combined texture-sampler ( temp usampler2DArray) +0:29 'g_tTex2du4' ( uniform utexture2DArray) +0:29 'g_sSamp' (layout( binding=0) uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.700000 +0:29 Constant: +0:29 0.750000 +0:? Constant: +0:? 0 (const int) +0:? 1 (const int) +0:33 move second child to first child ( temp 4-component vector of float) +0:33 Color: direct index for structure ( temp 4-component vector of float) +0:33 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 1.000000 +0:33 1.000000 +0:33 1.000000 +0:33 1.000000 +0:34 move second child to first child ( temp float) +0:34 Depth: direct index for structure ( temp float) +0:34 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:34 Constant: +0:34 1 (const int) +0:34 Constant: +0:34 1.000000 +0:36 Branch: Return with expression +0:36 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 Sequence +0:20 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:20 Color: direct index for structure ( temp 4-component vector of float) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Constant: +0:20 0 (const int) +0:20 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:20 Depth: direct index for structure ( temp float) +0:20 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:20 Constant: +0:20 1 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4a' (layout( binding=1) uniform texture1DArray) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1DArray) +0:? 'g_tTex1di4' ( uniform itexture1DArray) +0:? 'g_tTex1du4' ( uniform utexture1DArray) +0:? 'g_tTex2df4' ( uniform texture2DArray) +0:? 'g_tTex2di4' ( uniform itexture2DArray) +0:? 'g_tTex2du4' ( uniform utexture2DArray) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 119 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 111 115 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "txval10" + Name 16 "g_tTex1df4" + Name 20 "g_sSamp" + Name 34 "txval11" + Name 37 "g_tTex1di4" + Name 49 "txval12" + Name 52 "g_tTex1du4" + Name 61 "txval20" + Name 64 "g_tTex2df4" + Name 74 "txval21" + Name 77 "g_tTex2di4" + Name 85 "txval22" + Name 88 "g_tTex2du4" + Name 99 "psout" + Name 108 "flattenTemp" + Name 111 "@entryPointOutput.Color" + Name 115 "@entryPointOutput.Depth" + Name 118 "g_tTex1df4a" + Decorate 16(g_tTex1df4) DescriptorSet 0 + Decorate 16(g_tTex1df4) Binding 0 + Decorate 20(g_sSamp) DescriptorSet 0 + Decorate 20(g_sSamp) Binding 0 + Decorate 37(g_tTex1di4) DescriptorSet 0 + Decorate 52(g_tTex1du4) DescriptorSet 0 + Decorate 64(g_tTex2df4) DescriptorSet 0 + Decorate 77(g_tTex2di4) DescriptorSet 0 + Decorate 88(g_tTex2du4) DescriptorSet 0 + Decorate 111(@entryPointOutput.Color) Location 0 + Decorate 115(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 118(g_tTex1df4a) DescriptorSet 0 + Decorate 118(g_tTex1df4a) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 7(fvec4) + 14: TypeImage 6(float) 1D array sampled format:Unknown + 15: TypePointer UniformConstant 14 + 16(g_tTex1df4): 15(ptr) Variable UniformConstant + 18: TypeSampler + 19: TypePointer UniformConstant 18 + 20(g_sSamp): 19(ptr) Variable UniformConstant + 22: TypeSampledImage 14 + 24: TypeVector 6(float) 2 + 25: 6(float) Constant 1036831949 + 26: 6(float) Constant 1045220557 + 27: 24(fvec2) ConstantComposite 25 26 + 28: 6(float) Constant 1061158912 + 29: TypeInt 32 1 + 30: 29(int) Constant 0 + 32: TypeVector 29(int) 4 + 33: TypePointer Function 32(ivec4) + 35: TypeImage 29(int) 1D array sampled format:Unknown + 36: TypePointer UniformConstant 35 + 37(g_tTex1di4): 36(ptr) Variable UniformConstant + 40: TypeSampledImage 35 + 42: 6(float) Constant 1050253722 + 43: 24(fvec2) ConstantComposite 26 42 + 44: 29(int) Constant 1 + 46: TypeInt 32 0 + 47: TypeVector 46(int) 4 + 48: TypePointer Function 47(ivec4) + 50: TypeImage 46(int) 1D array sampled format:Unknown + 51: TypePointer UniformConstant 50 + 52(g_tTex1du4): 51(ptr) Variable UniformConstant + 55: TypeSampledImage 50 + 57: 6(float) Constant 1053609165 + 58: 24(fvec2) ConstantComposite 42 57 + 59: 29(int) Constant 2 + 62: TypeImage 6(float) 2D array sampled format:Unknown + 63: TypePointer UniformConstant 62 + 64(g_tTex2df4): 63(ptr) Variable UniformConstant + 67: TypeSampledImage 62 + 69: TypeVector 6(float) 3 + 70: 69(fvec3) ConstantComposite 25 26 42 + 71: TypeVector 29(int) 2 + 72: 71(ivec2) ConstantComposite 30 30 + 75: TypeImage 29(int) 2D array sampled format:Unknown + 76: TypePointer UniformConstant 75 + 77(g_tTex2di4): 76(ptr) Variable UniformConstant + 80: TypeSampledImage 75 + 82: 6(float) Constant 1056964608 + 83: 69(fvec3) ConstantComposite 42 57 82 + 86: TypeImage 46(int) 2D array sampled format:Unknown + 87: TypePointer UniformConstant 86 + 88(g_tTex2du4): 87(ptr) Variable UniformConstant + 91: TypeSampledImage 86 + 93: 6(float) Constant 1058642330 + 94: 6(float) Constant 1060320051 + 95: 69(fvec3) ConstantComposite 82 93 94 + 96: 71(ivec2) ConstantComposite 30 44 + 98: TypePointer Function 8(PS_OUTPUT) + 100: 6(float) Constant 1065353216 + 101: 7(fvec4) ConstantComposite 100 100 100 100 + 103: TypePointer Function 6(float) + 110: TypePointer Output 7(fvec4) +111(@entryPointOutput.Color): 110(ptr) Variable Output + 114: TypePointer Output 6(float) +115(@entryPointOutput.Depth): 114(ptr) Variable Output +118(g_tTex1df4a): 15(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +108(flattenTemp): 98(ptr) Variable Function + 109:8(PS_OUTPUT) FunctionCall 10(@main() + Store 108(flattenTemp) 109 + 112: 12(ptr) AccessChain 108(flattenTemp) 30 + 113: 7(fvec4) Load 112 + Store 111(@entryPointOutput.Color) 113 + 116: 103(ptr) AccessChain 108(flattenTemp) 44 + 117: 6(float) Load 116 + Store 115(@entryPointOutput.Depth) 117 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(txval10): 12(ptr) Variable Function + 34(txval11): 33(ptr) Variable Function + 49(txval12): 48(ptr) Variable Function + 61(txval20): 12(ptr) Variable Function + 74(txval21): 33(ptr) Variable Function + 85(txval22): 48(ptr) Variable Function + 99(psout): 98(ptr) Variable Function + 17: 14 Load 16(g_tTex1df4) + 21: 18 Load 20(g_sSamp) + 23: 22 SampledImage 17 21 + 31: 7(fvec4) ImageSampleExplicitLod 23 27 Lod ConstOffset 28 30 + Store 13(txval10) 31 + 38: 35 Load 37(g_tTex1di4) + 39: 18 Load 20(g_sSamp) + 41: 40 SampledImage 38 39 + 45: 32(ivec4) ImageSampleExplicitLod 41 43 Lod ConstOffset 28 44 + Store 34(txval11) 45 + 53: 50 Load 52(g_tTex1du4) + 54: 18 Load 20(g_sSamp) + 56: 55 SampledImage 53 54 + 60: 47(ivec4) ImageSampleExplicitLod 56 58 Lod ConstOffset 28 59 + Store 49(txval12) 60 + 65: 62 Load 64(g_tTex2df4) + 66: 18 Load 20(g_sSamp) + 68: 67 SampledImage 65 66 + 73: 7(fvec4) ImageSampleExplicitLod 68 70 Lod ConstOffset 28 72 + Store 61(txval20) 73 + 78: 75 Load 77(g_tTex2di4) + 79: 18 Load 20(g_sSamp) + 81: 80 SampledImage 78 79 + 84: 32(ivec4) ImageSampleExplicitLod 81 83 Lod ConstOffset 28 72 + Store 74(txval21) 84 + 89: 86 Load 88(g_tTex2du4) + 90: 18 Load 20(g_sSamp) + 92: 91 SampledImage 89 90 + 97: 47(ivec4) ImageSampleExplicitLod 92 95 Lod ConstOffset 28 96 + Store 85(txval22) 97 + 102: 12(ptr) AccessChain 99(psout) 30 + Store 102 101 + 104: 103(ptr) AccessChain 99(psout) 44 + Store 104 100 + 105:8(PS_OUTPUT) Load 99(psout) + ReturnValue 105 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.scalar-length.frag.out b/deps/glslang/Test/baseResults/hlsl.scalar-length.frag.out new file mode 100644 index 00000000..aa11af55 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.scalar-length.frag.out @@ -0,0 +1,112 @@ +hlsl.scalar-length.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @main( ( temp 4-component vector of float) +0:2 Function Parameters: +0:? Sequence +0:3 Sequence +0:3 move second child to first child ( temp 4-component vector of float) +0:3 'test' ( temp 4-component vector of float) +0:3 Constant: +0:3 0.000000 +0:3 1.000000 +0:3 2.000000 +0:3 3.000000 +0:5 Branch: Return with expression +0:5 Construct vec4 ( temp 4-component vector of float) +0:5 length ( temp float) +0:5 direct index ( temp float) +0:5 'test' ( temp 4-component vector of float) +0:5 Constant: +0:5 3 (const int) +0:2 Function Definition: main( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @main( ( temp 4-component vector of float) +0:2 Function Parameters: +0:? Sequence +0:3 Sequence +0:3 move second child to first child ( temp 4-component vector of float) +0:3 'test' ( temp 4-component vector of float) +0:3 Constant: +0:3 0.000000 +0:3 1.000000 +0:3 2.000000 +0:3 3.000000 +0:5 Branch: Return with expression +0:5 Construct vec4 ( temp 4-component vector of float) +0:5 length ( temp float) +0:5 direct index ( temp float) +0:5 'test' ( temp 4-component vector of float) +0:5 Constant: +0:5 3 (const int) +0:2 Function Definition: main( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 30 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 28 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 12 "test" + Name 28 "@entryPointOutput" + Decorate 28(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypePointer Function 7(fvec4) + 13: 6(float) Constant 0 + 14: 6(float) Constant 1065353216 + 15: 6(float) Constant 1073741824 + 16: 6(float) Constant 1077936128 + 17: 7(fvec4) ConstantComposite 13 14 15 16 + 18: TypeInt 32 0 + 19: 18(int) Constant 3 + 20: TypePointer Function 6(float) + 27: TypePointer Output 7(fvec4) +28(@entryPointOutput): 27(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 29: 7(fvec4) FunctionCall 9(@main() + Store 28(@entryPointOutput) 29 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 12(test): 11(ptr) Variable Function + Store 12(test) 17 + 21: 20(ptr) AccessChain 12(test) 19 + 22: 6(float) Load 21 + 23: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 22 + 24: 7(fvec4) CompositeConstruct 23 23 23 23 + ReturnValue 24 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.scalar2matrix.frag.out b/deps/glslang/Test/baseResults/hlsl.scalar2matrix.frag.out new file mode 100644 index 00000000..57d250eb --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.scalar2matrix.frag.out @@ -0,0 +1,506 @@ +hlsl.scalar2matrix.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: Fn1(mf44; ( temp void) +0:2 Function Parameters: +0:2 'p' ( in 4X4 matrix of float) +0:5 Function Definition: @main( ( temp 4-component vector of float) +0:5 Function Parameters: +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp 4X4 matrix of float) +0:10 'mat1' ( temp 4X4 matrix of float) +0:10 Constant: +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:11 Sequence +0:11 move second child to first child ( temp 4X4 matrix of float) +0:11 'mat2' ( temp 4X4 matrix of float) +0:11 Constant: +0:11 3.000000 +0:11 3.100000 +0:11 3.200000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:12 Sequence +0:12 move second child to first child ( temp 4X4 matrix of float) +0:12 'mat3' ( temp 4X4 matrix of float) +0:12 Constant: +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:16 move second child to first child ( temp 4X4 matrix of float) +0:16 'mat4' ( temp 4X4 matrix of float) +0:16 Constant: +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:17 move second child to first child ( temp 4X4 matrix of float) +0:17 'mat4' ( temp 4X4 matrix of float) +0:? Constant: +0:? 4.000000 +0:? 4.100000 +0:? 4.200000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:18 move second child to first child ( temp 4X4 matrix of float) +0:18 'mat4' ( temp 4X4 matrix of float) +0:18 Constant: +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:20 matrix scale second child into first child ( temp 4X4 matrix of float) +0:20 'mat4' ( temp 4X4 matrix of float) +0:20 Constant: +0:20 0.750000 +0:21 add second child into first child ( temp 4X4 matrix of float) +0:21 'mat4' ( temp 4X4 matrix of float) +0:21 Constant: +0:21 0.750000 +0:22 subtract second child into first child ( temp 4X4 matrix of float) +0:22 'mat4' ( temp 4X4 matrix of float) +0:22 Constant: +0:22 0.500000 +0:23 divide second child into first child ( temp 4X4 matrix of float) +0:23 'mat4' ( temp 4X4 matrix of float) +0:23 Constant: +0:23 2.000000 +0:25 Function Call: Fn1(mf44; ( temp void) +0:25 Constant: +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:27 Branch: Return with expression +0:27 add ( temp 4-component vector of float) +0:27 add ( temp 4-component vector of float) +0:27 Constant: +0:27 0.300000 +0:27 0.300000 +0:27 0.300000 +0:27 0.300000 +0:27 direct index ( temp 4-component vector of float) +0:27 'mat1' ( temp 4X4 matrix of float) +0:27 Constant: +0:27 1 (const int) +0:27 direct index ( temp 4-component vector of float) +0:27 'mat4' ( temp 4X4 matrix of float) +0:27 Constant: +0:27 2 (const int) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:5 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: Fn1(mf44; ( temp void) +0:2 Function Parameters: +0:2 'p' ( in 4X4 matrix of float) +0:5 Function Definition: @main( ( temp 4-component vector of float) +0:5 Function Parameters: +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp 4X4 matrix of float) +0:10 'mat1' ( temp 4X4 matrix of float) +0:10 Constant: +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:10 0.250000 +0:11 Sequence +0:11 move second child to first child ( temp 4X4 matrix of float) +0:11 'mat2' ( temp 4X4 matrix of float) +0:11 Constant: +0:11 3.000000 +0:11 3.100000 +0:11 3.200000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:11 0.000000 +0:12 Sequence +0:12 move second child to first child ( temp 4X4 matrix of float) +0:12 'mat3' ( temp 4X4 matrix of float) +0:12 Constant: +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:12 0.375000 +0:16 move second child to first child ( temp 4X4 matrix of float) +0:16 'mat4' ( temp 4X4 matrix of float) +0:16 Constant: +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:16 0.750000 +0:17 move second child to first child ( temp 4X4 matrix of float) +0:17 'mat4' ( temp 4X4 matrix of float) +0:? Constant: +0:? 4.000000 +0:? 4.100000 +0:? 4.200000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:18 move second child to first child ( temp 4X4 matrix of float) +0:18 'mat4' ( temp 4X4 matrix of float) +0:18 Constant: +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:18 0.500000 +0:20 matrix scale second child into first child ( temp 4X4 matrix of float) +0:20 'mat4' ( temp 4X4 matrix of float) +0:20 Constant: +0:20 0.750000 +0:21 add second child into first child ( temp 4X4 matrix of float) +0:21 'mat4' ( temp 4X4 matrix of float) +0:21 Constant: +0:21 0.750000 +0:22 subtract second child into first child ( temp 4X4 matrix of float) +0:22 'mat4' ( temp 4X4 matrix of float) +0:22 Constant: +0:22 0.500000 +0:23 divide second child into first child ( temp 4X4 matrix of float) +0:23 'mat4' ( temp 4X4 matrix of float) +0:23 Constant: +0:23 2.000000 +0:25 Function Call: Fn1(mf44; ( temp void) +0:25 Constant: +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:25 5.000000 +0:27 Branch: Return with expression +0:27 add ( temp 4-component vector of float) +0:27 add ( temp 4-component vector of float) +0:27 Constant: +0:27 0.300000 +0:27 0.300000 +0:27 0.300000 +0:27 0.300000 +0:27 direct index ( temp 4-component vector of float) +0:27 'mat1' ( temp 4X4 matrix of float) +0:27 Constant: +0:27 1 (const int) +0:27 direct index ( temp 4-component vector of float) +0:27 'mat4' ( temp 4X4 matrix of float) +0:27 Constant: +0:27 2 (const int) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:5 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 96 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 94 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 12 "Fn1(mf44;" + Name 11 "p" + Name 15 "@main(" + Name 17 "mat1" + Name 21 "mat2" + Name 29 "mat3" + Name 33 "mat4" + Name 77 "param" + Name 94 "@entryPointOutput" + Decorate 94(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeMatrix 7(fvec4) 4 + 9: TypePointer Function 8 + 10: TypeFunction 2 9(ptr) + 14: TypeFunction 7(fvec4) + 18: 6(float) Constant 1048576000 + 19: 7(fvec4) ConstantComposite 18 18 18 18 + 20: 8 ConstantComposite 19 19 19 19 + 22: 6(float) Constant 1077936128 + 23: 6(float) Constant 1078355558 + 24: 6(float) Constant 1078774989 + 25: 6(float) Constant 0 + 26: 7(fvec4) ConstantComposite 22 23 24 25 + 27: 7(fvec4) ConstantComposite 25 25 25 25 + 28: 8 ConstantComposite 26 27 27 27 + 30: 6(float) Constant 1052770304 + 31: 7(fvec4) ConstantComposite 30 30 30 30 + 32: 8 ConstantComposite 31 31 31 31 + 34: 6(float) Constant 1061158912 + 35: 7(fvec4) ConstantComposite 34 34 34 34 + 36: 8 ConstantComposite 35 35 35 35 + 37: 6(float) Constant 1082130432 + 38: 6(float) Constant 1082340147 + 39: 6(float) Constant 1082549862 + 40: 7(fvec4) ConstantComposite 37 38 39 25 + 41: 8 ConstantComposite 40 27 27 27 + 42: 6(float) Constant 1056964608 + 43: 7(fvec4) ConstantComposite 42 42 42 42 + 44: 8 ConstantComposite 43 43 43 43 + 69: 6(float) Constant 1073741824 + 71: 6(float) Constant 1065353216 + 74: 6(float) Constant 1084227584 + 75: 7(fvec4) ConstantComposite 74 74 74 74 + 76: 8 ConstantComposite 75 75 75 75 + 79: 6(float) Constant 1050253722 + 80: 7(fvec4) ConstantComposite 79 79 79 79 + 81: TypeInt 32 1 + 82: 81(int) Constant 1 + 83: TypePointer Function 7(fvec4) + 87: 81(int) Constant 2 + 93: TypePointer Output 7(fvec4) +94(@entryPointOutput): 93(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 95: 7(fvec4) FunctionCall 15(@main() + Store 94(@entryPointOutput) 95 + Return + FunctionEnd + 12(Fn1(mf44;): 2 Function None 10 + 11(p): 9(ptr) FunctionParameter + 13: Label + Return + FunctionEnd + 15(@main(): 7(fvec4) Function None 14 + 16: Label + 17(mat1): 9(ptr) Variable Function + 21(mat2): 9(ptr) Variable Function + 29(mat3): 9(ptr) Variable Function + 33(mat4): 9(ptr) Variable Function + 77(param): 9(ptr) Variable Function + Store 17(mat1) 20 + Store 21(mat2) 28 + Store 29(mat3) 32 + Store 33(mat4) 36 + Store 33(mat4) 41 + Store 33(mat4) 44 + 45: 8 Load 33(mat4) + 46: 8 MatrixTimesScalar 45 34 + Store 33(mat4) 46 + 47: 8 Load 33(mat4) + 48: 7(fvec4) CompositeConstruct 34 34 34 34 + 49: 7(fvec4) CompositeExtract 47 0 + 50: 7(fvec4) FAdd 49 48 + 51: 7(fvec4) CompositeExtract 47 1 + 52: 7(fvec4) FAdd 51 48 + 53: 7(fvec4) CompositeExtract 47 2 + 54: 7(fvec4) FAdd 53 48 + 55: 7(fvec4) CompositeExtract 47 3 + 56: 7(fvec4) FAdd 55 48 + 57: 8 CompositeConstruct 50 52 54 56 + Store 33(mat4) 57 + 58: 8 Load 33(mat4) + 59: 7(fvec4) CompositeConstruct 42 42 42 42 + 60: 7(fvec4) CompositeExtract 58 0 + 61: 7(fvec4) FSub 60 59 + 62: 7(fvec4) CompositeExtract 58 1 + 63: 7(fvec4) FSub 62 59 + 64: 7(fvec4) CompositeExtract 58 2 + 65: 7(fvec4) FSub 64 59 + 66: 7(fvec4) CompositeExtract 58 3 + 67: 7(fvec4) FSub 66 59 + 68: 8 CompositeConstruct 61 63 65 67 + Store 33(mat4) 68 + 70: 8 Load 33(mat4) + 72: 6(float) FDiv 71 69 + 73: 8 MatrixTimesScalar 70 72 + Store 33(mat4) 73 + Store 77(param) 76 + 78: 2 FunctionCall 12(Fn1(mf44;) 77(param) + 84: 83(ptr) AccessChain 17(mat1) 82 + 85: 7(fvec4) Load 84 + 86: 7(fvec4) FAdd 80 85 + 88: 83(ptr) AccessChain 33(mat4) 87 + 89: 7(fvec4) Load 88 + 90: 7(fvec4) FAdd 86 89 + ReturnValue 90 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.scalarCast.vert.out b/deps/glslang/Test/baseResults/hlsl.scalarCast.vert.out new file mode 100644 index 00000000..0e07c9f6 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.scalarCast.vert.out @@ -0,0 +1,493 @@ +hlsl.scalarCast.vert +Shader version: 500 +0:? Sequence +0:5 Function Definition: r0( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:5 Function Parameters: +0:? Sequence +0:7 Branch: Return with expression +0:7 Constant: +0:7 2.000000 +0:7 2.000000 +0:7 2.000000 +0:7 2.000000 +0:7 2.000000 +0:7 2.000000 +0:9 Function Definition: r1( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:9 Function Parameters: +0:? Sequence +0:11 Branch: Return with expression +0:11 Constant: +0:11 3.000000 +0:11 3.000000 +0:11 3.000000 +0:11 3.000000 +0:11 3.000000 +0:11 3.000000 +0:13 Function Definition: r2( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:13 Function Parameters: +0:? Sequence +0:15 Branch: Return with expression +0:15 Constant: +0:15 0.909297 +0:15 0.909297 +0:15 0.909297 +0:15 0.909297 +0:15 0.909297 +0:15 0.909297 +0:17 Function Definition: r3( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:17 Function Parameters: +0:? Sequence +0:18 Sequence +0:18 move second child to first child ( temp float) +0:18 'f' ( temp float) +0:18 Constant: +0:18 2.000000 +0:19 Branch: Return with expression +0:19 Construct structure ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:19 Construct vec4 ( temp 4-component vector of float) +0:19 'f' ( temp float) +0:19 'f' ( temp float) +0:19 'f' ( temp float) +0:19 'f' ( temp float) +0:19 Construct vec2 ( temp 2-component vector of float) +0:19 'f' ( temp float) +0:19 'f' ( temp float) +0:21 Function Definition: r4( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:21 Function Parameters: +0:? Sequence +0:22 Sequence +0:22 move second child to first child ( temp float) +0:22 'f' ( temp float) +0:22 Constant: +0:22 2.000000 +0:23 Branch: Return with expression +0:23 Comma ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:23 move second child to first child ( temp float) +0:23 'scalarCopy' ( temp float) +0:23 add ( temp float) +0:23 'f' ( temp float) +0:23 Constant: +0:23 1.000000 +0:23 Construct structure ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:23 Construct vec4 ( temp 4-component vector of float) +0:23 'scalarCopy' ( temp float) +0:23 'scalarCopy' ( temp float) +0:23 'scalarCopy' ( temp float) +0:23 'scalarCopy' ( temp float) +0:23 Construct vec2 ( temp 2-component vector of float) +0:23 'scalarCopy' ( temp float) +0:23 'scalarCopy' ( temp float) +0:25 Function Definition: r5( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:25 Function Parameters: +0:? Sequence +0:26 Sequence +0:26 move second child to first child ( temp float) +0:26 'f' ( temp float) +0:26 Constant: +0:26 2.000000 +0:27 Branch: Return with expression +0:27 Comma ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:27 move second child to first child ( temp float) +0:27 'scalarCopy' ( temp float) +0:27 sine ( temp float) +0:27 'f' ( temp float) +0:27 Construct structure ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:27 Construct vec4 ( temp 4-component vector of float) +0:27 'scalarCopy' ( temp float) +0:27 'scalarCopy' ( temp float) +0:27 'scalarCopy' ( temp float) +0:27 'scalarCopy' ( temp float) +0:27 Construct vec2 ( temp 2-component vector of float) +0:27 'scalarCopy' ( temp float) +0:27 'scalarCopy' ( temp float) +0:29 Function Definition: @main( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:29 Function Parameters: +0:? Sequence +0:30 Sequence +0:30 move second child to first child ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:30 'v0' ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:30 Function Call: r0( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:31 Sequence +0:31 move second child to first child ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:31 'v1' ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:31 Function Call: r1( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:32 Sequence +0:32 move second child to first child ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:32 'v2' ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:32 Function Call: r2( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:33 Sequence +0:33 move second child to first child ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:33 'v3' ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:33 Function Call: r3( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:34 Sequence +0:34 move second child to first child ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:34 'v4' ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:34 Function Call: r4( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:35 Sequence +0:35 move second child to first child ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:35 'v5' ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:35 Function Call: r5( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:36 Branch: Return with expression +0:36 Constant: +0:36 1.000000 +0:36 1.000000 +0:36 1.000000 +0:36 1.000000 +0:36 1.000000 +0:36 1.000000 +0:29 Function Definition: main( ( temp void) +0:29 Function Parameters: +0:? Sequence +0:29 Sequence +0:29 move second child to first child ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:29 'flattenTemp' ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:29 Function Call: @main( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:29 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.position' ( out 4-component vector of float Position) +0:29 position: direct index for structure ( temp 4-component vector of float) +0:29 'flattenTemp' ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:29 Constant: +0:29 0 (const int) +0:29 move second child to first child ( temp 2-component vector of float) +0:? '@entryPointOutput.texCoord' (layout( location=0) out 2-component vector of float) +0:29 texCoord: direct index for structure ( temp 2-component vector of float) +0:29 'flattenTemp' ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:29 Constant: +0:29 1 (const int) +0:? Linker Objects +0:? '@entryPointOutput.position' ( out 4-component vector of float Position) +0:? '@entryPointOutput.texCoord' (layout( location=0) out 2-component vector of float) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:5 Function Definition: r0( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:5 Function Parameters: +0:? Sequence +0:7 Branch: Return with expression +0:7 Constant: +0:7 2.000000 +0:7 2.000000 +0:7 2.000000 +0:7 2.000000 +0:7 2.000000 +0:7 2.000000 +0:9 Function Definition: r1( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:9 Function Parameters: +0:? Sequence +0:11 Branch: Return with expression +0:11 Constant: +0:11 3.000000 +0:11 3.000000 +0:11 3.000000 +0:11 3.000000 +0:11 3.000000 +0:11 3.000000 +0:13 Function Definition: r2( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:13 Function Parameters: +0:? Sequence +0:15 Branch: Return with expression +0:15 Constant: +0:15 0.909297 +0:15 0.909297 +0:15 0.909297 +0:15 0.909297 +0:15 0.909297 +0:15 0.909297 +0:17 Function Definition: r3( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:17 Function Parameters: +0:? Sequence +0:18 Sequence +0:18 move second child to first child ( temp float) +0:18 'f' ( temp float) +0:18 Constant: +0:18 2.000000 +0:19 Branch: Return with expression +0:19 Construct structure ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:19 Construct vec4 ( temp 4-component vector of float) +0:19 'f' ( temp float) +0:19 'f' ( temp float) +0:19 'f' ( temp float) +0:19 'f' ( temp float) +0:19 Construct vec2 ( temp 2-component vector of float) +0:19 'f' ( temp float) +0:19 'f' ( temp float) +0:21 Function Definition: r4( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:21 Function Parameters: +0:? Sequence +0:22 Sequence +0:22 move second child to first child ( temp float) +0:22 'f' ( temp float) +0:22 Constant: +0:22 2.000000 +0:23 Branch: Return with expression +0:23 Comma ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:23 move second child to first child ( temp float) +0:23 'scalarCopy' ( temp float) +0:23 add ( temp float) +0:23 'f' ( temp float) +0:23 Constant: +0:23 1.000000 +0:23 Construct structure ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:23 Construct vec4 ( temp 4-component vector of float) +0:23 'scalarCopy' ( temp float) +0:23 'scalarCopy' ( temp float) +0:23 'scalarCopy' ( temp float) +0:23 'scalarCopy' ( temp float) +0:23 Construct vec2 ( temp 2-component vector of float) +0:23 'scalarCopy' ( temp float) +0:23 'scalarCopy' ( temp float) +0:25 Function Definition: r5( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:25 Function Parameters: +0:? Sequence +0:26 Sequence +0:26 move second child to first child ( temp float) +0:26 'f' ( temp float) +0:26 Constant: +0:26 2.000000 +0:27 Branch: Return with expression +0:27 Comma ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:27 move second child to first child ( temp float) +0:27 'scalarCopy' ( temp float) +0:27 sine ( temp float) +0:27 'f' ( temp float) +0:27 Construct structure ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:27 Construct vec4 ( temp 4-component vector of float) +0:27 'scalarCopy' ( temp float) +0:27 'scalarCopy' ( temp float) +0:27 'scalarCopy' ( temp float) +0:27 'scalarCopy' ( temp float) +0:27 Construct vec2 ( temp 2-component vector of float) +0:27 'scalarCopy' ( temp float) +0:27 'scalarCopy' ( temp float) +0:29 Function Definition: @main( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:29 Function Parameters: +0:? Sequence +0:30 Sequence +0:30 move second child to first child ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:30 'v0' ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:30 Function Call: r0( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:31 Sequence +0:31 move second child to first child ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:31 'v1' ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:31 Function Call: r1( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:32 Sequence +0:32 move second child to first child ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:32 'v2' ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:32 Function Call: r2( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:33 Sequence +0:33 move second child to first child ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:33 'v3' ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:33 Function Call: r3( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:34 Sequence +0:34 move second child to first child ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:34 'v4' ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:34 Function Call: r4( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:35 Sequence +0:35 move second child to first child ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:35 'v5' ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:35 Function Call: r5( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:36 Branch: Return with expression +0:36 Constant: +0:36 1.000000 +0:36 1.000000 +0:36 1.000000 +0:36 1.000000 +0:36 1.000000 +0:36 1.000000 +0:29 Function Definition: main( ( temp void) +0:29 Function Parameters: +0:? Sequence +0:29 Sequence +0:29 move second child to first child ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:29 'flattenTemp' ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:29 Function Call: @main( ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:29 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.position' ( out 4-component vector of float Position) +0:29 position: direct index for structure ( temp 4-component vector of float) +0:29 'flattenTemp' ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:29 Constant: +0:29 0 (const int) +0:29 move second child to first child ( temp 2-component vector of float) +0:? '@entryPointOutput.texCoord' (layout( location=0) out 2-component vector of float) +0:29 texCoord: direct index for structure ( temp 2-component vector of float) +0:29 'flattenTemp' ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) +0:29 Constant: +0:29 1 (const int) +0:? Linker Objects +0:? '@entryPointOutput.position' ( out 4-component vector of float Position) +0:? '@entryPointOutput.texCoord' (layout( location=0) out 2-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 120 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 108 115 + Source HLSL 500 + Name 4 "main" + Name 9 "VertexOut" + MemberName 9(VertexOut) 0 "position" + MemberName 9(VertexOut) 1 "texCoord" + Name 11 "r0(" + Name 13 "r1(" + Name 15 "r2(" + Name 17 "r3(" + Name 19 "r4(" + Name 21 "r5(" + Name 23 "@main(" + Name 44 "f" + Name 56 "f" + Name 57 "scalarCopy" + Name 72 "f" + Name 73 "scalarCopy" + Name 88 "v0" + Name 90 "v1" + Name 92 "v2" + Name 94 "v3" + Name 96 "v4" + Name 98 "v5" + Name 105 "flattenTemp" + Name 108 "@entryPointOutput.position" + Name 115 "@entryPointOutput.texCoord" + Decorate 108(@entryPointOutput.position) BuiltIn Position + Decorate 115(@entryPointOutput.texCoord) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeVector 6(float) 2 + 9(VertexOut): TypeStruct 7(fvec4) 8(fvec2) + 10: TypeFunction 9(VertexOut) + 25: 6(float) Constant 1073741824 + 26: 7(fvec4) ConstantComposite 25 25 25 25 + 27: 8(fvec2) ConstantComposite 25 25 + 28:9(VertexOut) ConstantComposite 26 27 + 31: 6(float) Constant 1077936128 + 32: 7(fvec4) ConstantComposite 31 31 31 31 + 33: 8(fvec2) ConstantComposite 31 31 + 34:9(VertexOut) ConstantComposite 32 33 + 37: 6(float) Constant 1063831479 + 38: 7(fvec4) ConstantComposite 37 37 37 37 + 39: 8(fvec2) ConstantComposite 37 37 + 40:9(VertexOut) ConstantComposite 38 39 + 43: TypePointer Function 6(float) + 59: 6(float) Constant 1065353216 + 87: TypePointer Function 9(VertexOut) + 100: 7(fvec4) ConstantComposite 59 59 59 59 + 101: 8(fvec2) ConstantComposite 59 59 + 102:9(VertexOut) ConstantComposite 100 101 + 107: TypePointer Output 7(fvec4) +108(@entryPointOutput.position): 107(ptr) Variable Output + 109: TypeInt 32 1 + 110: 109(int) Constant 0 + 111: TypePointer Function 7(fvec4) + 114: TypePointer Output 8(fvec2) +115(@entryPointOutput.texCoord): 114(ptr) Variable Output + 116: 109(int) Constant 1 + 117: TypePointer Function 8(fvec2) + 4(main): 2 Function None 3 + 5: Label +105(flattenTemp): 87(ptr) Variable Function + 106:9(VertexOut) FunctionCall 23(@main() + Store 105(flattenTemp) 106 + 112: 111(ptr) AccessChain 105(flattenTemp) 110 + 113: 7(fvec4) Load 112 + Store 108(@entryPointOutput.position) 113 + 118: 117(ptr) AccessChain 105(flattenTemp) 116 + 119: 8(fvec2) Load 118 + Store 115(@entryPointOutput.texCoord) 119 + Return + FunctionEnd + 11(r0():9(VertexOut) Function None 10 + 12: Label + ReturnValue 28 + FunctionEnd + 13(r1():9(VertexOut) Function None 10 + 14: Label + ReturnValue 34 + FunctionEnd + 15(r2():9(VertexOut) Function None 10 + 16: Label + ReturnValue 40 + FunctionEnd + 17(r3():9(VertexOut) Function None 10 + 18: Label + 44(f): 43(ptr) Variable Function + Store 44(f) 25 + 45: 6(float) Load 44(f) + 46: 6(float) Load 44(f) + 47: 6(float) Load 44(f) + 48: 6(float) Load 44(f) + 49: 7(fvec4) CompositeConstruct 45 46 47 48 + 50: 6(float) Load 44(f) + 51: 6(float) Load 44(f) + 52: 8(fvec2) CompositeConstruct 50 51 + 53:9(VertexOut) CompositeConstruct 49 52 + ReturnValue 53 + FunctionEnd + 19(r4():9(VertexOut) Function None 10 + 20: Label + 56(f): 43(ptr) Variable Function + 57(scalarCopy): 43(ptr) Variable Function + Store 56(f) 25 + 58: 6(float) Load 56(f) + 60: 6(float) FAdd 58 59 + Store 57(scalarCopy) 60 + 61: 6(float) Load 57(scalarCopy) + 62: 6(float) Load 57(scalarCopy) + 63: 6(float) Load 57(scalarCopy) + 64: 6(float) Load 57(scalarCopy) + 65: 7(fvec4) CompositeConstruct 61 62 63 64 + 66: 6(float) Load 57(scalarCopy) + 67: 6(float) Load 57(scalarCopy) + 68: 8(fvec2) CompositeConstruct 66 67 + 69:9(VertexOut) CompositeConstruct 65 68 + ReturnValue 69 + FunctionEnd + 21(r5():9(VertexOut) Function None 10 + 22: Label + 72(f): 43(ptr) Variable Function + 73(scalarCopy): 43(ptr) Variable Function + Store 72(f) 25 + 74: 6(float) Load 72(f) + 75: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 74 + Store 73(scalarCopy) 75 + 76: 6(float) Load 73(scalarCopy) + 77: 6(float) Load 73(scalarCopy) + 78: 6(float) Load 73(scalarCopy) + 79: 6(float) Load 73(scalarCopy) + 80: 7(fvec4) CompositeConstruct 76 77 78 79 + 81: 6(float) Load 73(scalarCopy) + 82: 6(float) Load 73(scalarCopy) + 83: 8(fvec2) CompositeConstruct 81 82 + 84:9(VertexOut) CompositeConstruct 80 83 + ReturnValue 84 + FunctionEnd + 23(@main():9(VertexOut) Function None 10 + 24: Label + 88(v0): 87(ptr) Variable Function + 90(v1): 87(ptr) Variable Function + 92(v2): 87(ptr) Variable Function + 94(v3): 87(ptr) Variable Function + 96(v4): 87(ptr) Variable Function + 98(v5): 87(ptr) Variable Function + 89:9(VertexOut) FunctionCall 11(r0() + Store 88(v0) 89 + 91:9(VertexOut) FunctionCall 13(r1() + Store 90(v1) 91 + 93:9(VertexOut) FunctionCall 15(r2() + Store 92(v2) 93 + 95:9(VertexOut) FunctionCall 17(r3() + Store 94(v3) 95 + 97:9(VertexOut) FunctionCall 19(r4() + Store 96(v4) 97 + 99:9(VertexOut) FunctionCall 21(r5() + Store 98(v5) 99 + ReturnValue 102 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.scope.frag.out b/deps/glslang/Test/baseResults/hlsl.scope.frag.out new file mode 100644 index 00000000..b563380e --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.scope.frag.out @@ -0,0 +1,191 @@ +hlsl.scope.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(vf4; ( temp void) +0:2 Function Parameters: +0:2 'input' ( in 4-component vector of float) +0:? Sequence +0:4 'x' ( temp int) +0:? Sequence +0:7 'x' ( temp float) +0:? Sequence +0:10 'x' ( temp bool) +0:? Sequence +0:13 'x' ( temp 3-component vector of float) +0:15 'x' ( temp bool) +0:17 'x' ( temp float) +0:19 'x' ( temp int) +0:21 Test condition and select ( temp void) +0:21 Condition +0:21 Compare Greater Than ( temp bool) +0:21 'x' ( temp int) +0:21 Constant: +0:21 0 (const int) +0:21 true case is null +0:24 Loop with condition tested first +0:24 Loop Condition +0:24 Compare Greater Than ( temp bool) +0:24 'x' ( temp int) +0:24 Constant: +0:24 0 (const int) +0:24 No loop body +0:27 Loop with condition not tested first +0:27 Loop Condition +0:29 Compare Greater Than ( temp bool) +0:29 'x' ( temp int) +0:29 Constant: +0:29 0 (const int) +0:27 No loop body +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:2 Function Call: @PixelShaderFunction(vf4; ( temp void) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'input' (layout( location=0) in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(vf4; ( temp void) +0:2 Function Parameters: +0:2 'input' ( in 4-component vector of float) +0:? Sequence +0:4 'x' ( temp int) +0:? Sequence +0:7 'x' ( temp float) +0:? Sequence +0:10 'x' ( temp bool) +0:? Sequence +0:13 'x' ( temp 3-component vector of float) +0:15 'x' ( temp bool) +0:17 'x' ( temp float) +0:19 'x' ( temp int) +0:21 Test condition and select ( temp void) +0:21 Condition +0:21 Compare Greater Than ( temp bool) +0:21 'x' ( temp int) +0:21 Constant: +0:21 0 (const int) +0:21 true case is null +0:24 Loop with condition tested first +0:24 Loop Condition +0:24 Compare Greater Than ( temp bool) +0:24 'x' ( temp int) +0:24 Constant: +0:24 0 (const int) +0:24 No loop body +0:27 Loop with condition not tested first +0:27 Loop Condition +0:29 Compare Greater Than ( temp bool) +0:29 'x' ( temp int) +0:29 Constant: +0:29 0 (const int) +0:27 No loop body +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:2 Function Call: @PixelShaderFunction(vf4; ( temp void) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'input' (layout( location=0) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 49 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 44 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 11 "@PixelShaderFunction(vf4;" + Name 10 "input" + Name 15 "x" + Name 17 "x" + Name 20 "x" + Name 23 "x" + Name 42 "input" + Name 44 "input" + Name 46 "param" + Decorate 44(input) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 2 8(ptr) + 13: TypeInt 32 1 + 14: TypePointer Function 13(int) + 16: TypePointer Function 6(float) + 18: TypeBool + 19: TypePointer Function 18(bool) + 21: TypeVector 6(float) 3 + 22: TypePointer Function 21(fvec3) + 25: 13(int) Constant 0 + 43: TypePointer Input 7(fvec4) + 44(input): 43(ptr) Variable Input +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 42(input): 8(ptr) Variable Function + 46(param): 8(ptr) Variable Function + 45: 7(fvec4) Load 44(input) + Store 42(input) 45 + 47: 7(fvec4) Load 42(input) + Store 46(param) 47 + 48: 2 FunctionCall 11(@PixelShaderFunction(vf4;) 46(param) + Return + FunctionEnd +11(@PixelShaderFunction(vf4;): 2 Function None 9 + 10(input): 8(ptr) FunctionParameter + 12: Label + 15(x): 14(ptr) Variable Function + 17(x): 16(ptr) Variable Function + 20(x): 19(ptr) Variable Function + 23(x): 22(ptr) Variable Function + 24: 13(int) Load 15(x) + 26: 18(bool) SGreaterThan 24 25 + SelectionMerge 28 None + BranchConditional 26 27 28 + 27: Label + Branch 28 + 28: Label + Branch 29 + 29: Label + LoopMerge 31 32 None + Branch 33 + 33: Label + 34: 13(int) Load 15(x) + 35: 18(bool) SGreaterThan 34 25 + BranchConditional 35 30 31 + 30: Label + Branch 32 + 32: Label + Branch 29 + 31: Label + Branch 36 + 36: Label + LoopMerge 38 39 None + Branch 37 + 37: Label + Branch 39 + 39: Label + 40: 13(int) Load 15(x) + 41: 18(bool) SGreaterThan 40 25 + BranchConditional 41 36 38 + 38: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.self_cast.frag.out b/deps/glslang/Test/baseResults/hlsl.self_cast.frag.out new file mode 100644 index 00000000..9d398ed9 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.self_cast.frag.out @@ -0,0 +1,130 @@ +hlsl.self_cast.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp structure{}) +0:8 'b' ( temp structure{}) +0:8 'a' ( temp structure{}) +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp structure{ temp float f}) +0:13 'b' ( temp structure{ temp float f}) +0:13 'a' ( temp structure{ temp float f}) +0:? Sequence +0:18 Sequence +0:18 move second child to first child ( temp 2-element array of structure{}) +0:18 'b' ( temp 2-element array of structure{}) +0:18 'a' ( temp 2-element array of structure{}) +0:? Sequence +0:23 Sequence +0:23 move second child to first child ( temp 2-element array of structure{ temp float f}) +0:23 'b' ( temp 2-element array of structure{ temp float f}) +0:23 'a' ( temp 2-element array of structure{ temp float f}) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 Function Call: @main( ( temp void) +0:? Linker Objects + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp structure{}) +0:8 'b' ( temp structure{}) +0:8 'a' ( temp structure{}) +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp structure{ temp float f}) +0:13 'b' ( temp structure{ temp float f}) +0:13 'a' ( temp structure{ temp float f}) +0:? Sequence +0:18 Sequence +0:18 move second child to first child ( temp 2-element array of structure{}) +0:18 'b' ( temp 2-element array of structure{}) +0:18 'a' ( temp 2-element array of structure{}) +0:? Sequence +0:23 Sequence +0:23 move second child to first child ( temp 2-element array of structure{ temp float f}) +0:23 'b' ( temp 2-element array of structure{ temp float f}) +0:23 'a' ( temp 2-element array of structure{ temp float f}) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 Function Call: @main( ( temp void) +0:? Linker Objects + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 32 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 6 "@main(" + Name 8 "Test0" + Name 10 "b" + Name 11 "a" + Name 14 "Test1" + MemberName 14(Test1) 0 "f" + Name 16 "b" + Name 17 "a" + Name 23 "b" + Name 24 "a" + Name 28 "b" + Name 29 "a" + 2: TypeVoid + 3: TypeFunction 2 + 8(Test0): TypeStruct + 9: TypePointer Function 8(Test0) + 13: TypeFloat 32 + 14(Test1): TypeStruct 13(float) + 15: TypePointer Function 14(Test1) + 19: TypeInt 32 0 + 20: 19(int) Constant 2 + 21: TypeArray 8(Test0) 20 + 22: TypePointer Function 21 + 26: TypeArray 14(Test1) 20 + 27: TypePointer Function 26 + 4(main): 2 Function None 3 + 5: Label + 31: 2 FunctionCall 6(@main() + Return + FunctionEnd + 6(@main(): 2 Function None 3 + 7: Label + 10(b): 9(ptr) Variable Function + 11(a): 9(ptr) Variable Function + 16(b): 15(ptr) Variable Function + 17(a): 15(ptr) Variable Function + 23(b): 22(ptr) Variable Function + 24(a): 22(ptr) Variable Function + 28(b): 27(ptr) Variable Function + 29(a): 27(ptr) Variable Function + 12: 8(Test0) Load 11(a) + Store 10(b) 12 + 18: 14(Test1) Load 17(a) + Store 16(b) 18 + 25: 21 Load 24(a) + Store 23(b) 25 + 30: 26 Load 29(a) + Store 28(b) 30 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.semantic-1.vert.out b/deps/glslang/Test/baseResults/hlsl.semantic-1.vert.out new file mode 100644 index 00000000..b5e40913 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.semantic-1.vert.out @@ -0,0 +1,374 @@ +hlsl.semantic-1.vert +Shader version: 500 +0:? Sequence +0:16 Function Definition: @main(vf4; ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:16 Function Parameters: +0:16 'v' ( in 4-component vector of float) +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:18 pos: direct index for structure ( temp 4-component vector of float) +0:18 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:18 Constant: +0:18 0 (const int) +0:18 'v' ( in 4-component vector of float) +0:19 move second child to first child ( temp 2-component vector of float) +0:19 UV0: direct index for structure ( temp 2-component vector of float) +0:19 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:19 Constant: +0:19 1 (const int) +0:? Construct vec2 ( temp 2-component vector of float) +0:19 direct index ( temp float) +0:19 'v' ( in 4-component vector of float) +0:19 Constant: +0:19 0 (const int) +0:19 direct index ( temp float) +0:19 'v' ( in 4-component vector of float) +0:19 Constant: +0:19 0 (const int) +0:20 move second child to first child ( temp 2-component vector of float) +0:20 UV1: direct index for structure ( temp 2-component vector of float) +0:20 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:20 Constant: +0:20 2 (const int) +0:? Construct vec2 ( temp 2-component vector of float) +0:20 direct index ( temp float) +0:20 'v' ( in 4-component vector of float) +0:20 Constant: +0:20 1 (const int) +0:20 direct index ( temp float) +0:20 'v' ( in 4-component vector of float) +0:20 Constant: +0:20 1 (const int) +0:21 move second child to first child ( temp 2-component vector of float) +0:21 UV2: direct index for structure ( temp 2-component vector of float) +0:21 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:21 Constant: +0:21 3 (const int) +0:? Construct vec2 ( temp 2-component vector of float) +0:21 direct index ( temp float) +0:21 'v' ( in 4-component vector of float) +0:21 Constant: +0:21 2 (const int) +0:21 direct index ( temp float) +0:21 'v' ( in 4-component vector of float) +0:21 Constant: +0:21 2 (const int) +0:22 move second child to first child ( temp 2-component vector of float) +0:22 UV3: direct index for structure ( temp 2-component vector of float) +0:22 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:22 Constant: +0:22 4 (const int) +0:? Construct vec2 ( temp 2-component vector of float) +0:22 direct index ( temp float) +0:22 'v' ( in 4-component vector of float) +0:22 Constant: +0:22 3 (const int) +0:22 direct index ( temp float) +0:22 'v' ( in 4-component vector of float) +0:22 Constant: +0:22 3 (const int) +0:23 Branch: Return with expression +0:23 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:16 Function Definition: main( ( temp void) +0:16 Function Parameters: +0:? Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:? 'v' ( temp 4-component vector of float) +0:? 'v' (layout( location=0) in 4-component vector of float) +0:16 Sequence +0:16 move second child to first child ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:16 Function Call: @main(vf4; ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:? 'v' ( temp 4-component vector of float) +0:16 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.pos' (layout( location=0) out 4-component vector of float) +0:16 pos: direct index for structure ( temp 4-component vector of float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:16 Constant: +0:16 0 (const int) +0:16 move second child to first child ( temp 2-component vector of float) +0:? '@entryPointOutput.UV0' (layout( location=1) out 2-component vector of float) +0:16 UV0: direct index for structure ( temp 2-component vector of float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:16 Constant: +0:16 1 (const int) +0:16 move second child to first child ( temp 2-component vector of float) +0:? '@entryPointOutput.UV1' (layout( location=2) out 2-component vector of float) +0:16 UV1: direct index for structure ( temp 2-component vector of float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:16 Constant: +0:16 2 (const int) +0:16 move second child to first child ( temp 2-component vector of float) +0:? '@entryPointOutput.UV2' (layout( location=3) out 2-component vector of float) +0:16 UV2: direct index for structure ( temp 2-component vector of float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:16 Constant: +0:16 3 (const int) +0:16 move second child to first child ( temp 2-component vector of float) +0:? '@entryPointOutput.UV3' (layout( location=4) out 2-component vector of float) +0:16 UV3: direct index for structure ( temp 2-component vector of float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:16 Constant: +0:16 4 (const int) +0:? Linker Objects +0:? '@entryPointOutput.pos' (layout( location=0) out 4-component vector of float) +0:? '@entryPointOutput.UV0' (layout( location=1) out 2-component vector of float) +0:? '@entryPointOutput.UV1' (layout( location=2) out 2-component vector of float) +0:? '@entryPointOutput.UV2' (layout( location=3) out 2-component vector of float) +0:? '@entryPointOutput.UV3' (layout( location=4) out 2-component vector of float) +0:? 'v' (layout( location=0) in 4-component vector of float) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:16 Function Definition: @main(vf4; ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:16 Function Parameters: +0:16 'v' ( in 4-component vector of float) +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:18 pos: direct index for structure ( temp 4-component vector of float) +0:18 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:18 Constant: +0:18 0 (const int) +0:18 'v' ( in 4-component vector of float) +0:19 move second child to first child ( temp 2-component vector of float) +0:19 UV0: direct index for structure ( temp 2-component vector of float) +0:19 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:19 Constant: +0:19 1 (const int) +0:? Construct vec2 ( temp 2-component vector of float) +0:19 direct index ( temp float) +0:19 'v' ( in 4-component vector of float) +0:19 Constant: +0:19 0 (const int) +0:19 direct index ( temp float) +0:19 'v' ( in 4-component vector of float) +0:19 Constant: +0:19 0 (const int) +0:20 move second child to first child ( temp 2-component vector of float) +0:20 UV1: direct index for structure ( temp 2-component vector of float) +0:20 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:20 Constant: +0:20 2 (const int) +0:? Construct vec2 ( temp 2-component vector of float) +0:20 direct index ( temp float) +0:20 'v' ( in 4-component vector of float) +0:20 Constant: +0:20 1 (const int) +0:20 direct index ( temp float) +0:20 'v' ( in 4-component vector of float) +0:20 Constant: +0:20 1 (const int) +0:21 move second child to first child ( temp 2-component vector of float) +0:21 UV2: direct index for structure ( temp 2-component vector of float) +0:21 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:21 Constant: +0:21 3 (const int) +0:? Construct vec2 ( temp 2-component vector of float) +0:21 direct index ( temp float) +0:21 'v' ( in 4-component vector of float) +0:21 Constant: +0:21 2 (const int) +0:21 direct index ( temp float) +0:21 'v' ( in 4-component vector of float) +0:21 Constant: +0:21 2 (const int) +0:22 move second child to first child ( temp 2-component vector of float) +0:22 UV3: direct index for structure ( temp 2-component vector of float) +0:22 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:22 Constant: +0:22 4 (const int) +0:? Construct vec2 ( temp 2-component vector of float) +0:22 direct index ( temp float) +0:22 'v' ( in 4-component vector of float) +0:22 Constant: +0:22 3 (const int) +0:22 direct index ( temp float) +0:22 'v' ( in 4-component vector of float) +0:22 Constant: +0:22 3 (const int) +0:23 Branch: Return with expression +0:23 's' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:16 Function Definition: main( ( temp void) +0:16 Function Parameters: +0:? Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:? 'v' ( temp 4-component vector of float) +0:? 'v' (layout( location=0) in 4-component vector of float) +0:16 Sequence +0:16 move second child to first child ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:16 Function Call: @main(vf4; ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:? 'v' ( temp 4-component vector of float) +0:16 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.pos' (layout( location=0) out 4-component vector of float) +0:16 pos: direct index for structure ( temp 4-component vector of float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:16 Constant: +0:16 0 (const int) +0:16 move second child to first child ( temp 2-component vector of float) +0:? '@entryPointOutput.UV0' (layout( location=1) out 2-component vector of float) +0:16 UV0: direct index for structure ( temp 2-component vector of float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:16 Constant: +0:16 1 (const int) +0:16 move second child to first child ( temp 2-component vector of float) +0:? '@entryPointOutput.UV1' (layout( location=2) out 2-component vector of float) +0:16 UV1: direct index for structure ( temp 2-component vector of float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:16 Constant: +0:16 2 (const int) +0:16 move second child to first child ( temp 2-component vector of float) +0:? '@entryPointOutput.UV2' (layout( location=3) out 2-component vector of float) +0:16 UV2: direct index for structure ( temp 2-component vector of float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:16 Constant: +0:16 3 (const int) +0:16 move second child to first child ( temp 2-component vector of float) +0:? '@entryPointOutput.UV3' (layout( location=4) out 2-component vector of float) +0:16 UV3: direct index for structure ( temp 2-component vector of float) +0:16 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float UV0, temp 2-component vector of float UV1, temp 2-component vector of float UV2, temp 2-component vector of float UV3}) +0:16 Constant: +0:16 4 (const int) +0:? Linker Objects +0:? '@entryPointOutput.pos' (layout( location=0) out 4-component vector of float) +0:? '@entryPointOutput.UV0' (layout( location=1) out 2-component vector of float) +0:? '@entryPointOutput.UV1' (layout( location=2) out 2-component vector of float) +0:? '@entryPointOutput.UV2' (layout( location=3) out 2-component vector of float) +0:? '@entryPointOutput.UV3' (layout( location=4) out 2-component vector of float) +0:? 'v' (layout( location=0) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 84 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 61 68 72 75 78 81 + Source HLSL 500 + Name 4 "main" + Name 10 "S" + MemberName 10(S) 0 "pos" + MemberName 10(S) 1 "UV0" + MemberName 10(S) 2 "UV1" + MemberName 10(S) 3 "UV2" + MemberName 10(S) 4 "UV3" + Name 13 "@main(vf4;" + Name 12 "v" + Name 16 "s" + Name 59 "v" + Name 61 "v" + Name 63 "flattenTemp" + Name 64 "param" + Name 68 "@entryPointOutput.pos" + Name 72 "@entryPointOutput.UV0" + Name 75 "@entryPointOutput.UV1" + Name 78 "@entryPointOutput.UV2" + Name 81 "@entryPointOutput.UV3" + Decorate 61(v) Location 0 + Decorate 68(@entryPointOutput.pos) Location 0 + Decorate 72(@entryPointOutput.UV0) Location 1 + Decorate 75(@entryPointOutput.UV1) Location 2 + Decorate 78(@entryPointOutput.UV2) Location 3 + Decorate 81(@entryPointOutput.UV3) Location 4 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeVector 6(float) 2 + 10(S): TypeStruct 7(fvec4) 9(fvec2) 9(fvec2) 9(fvec2) 9(fvec2) + 11: TypeFunction 10(S) 8(ptr) + 15: TypePointer Function 10(S) + 17: TypeInt 32 1 + 18: 17(int) Constant 0 + 21: 17(int) Constant 1 + 22: TypeInt 32 0 + 23: 22(int) Constant 0 + 24: TypePointer Function 6(float) + 30: TypePointer Function 9(fvec2) + 32: 17(int) Constant 2 + 33: 22(int) Constant 1 + 40: 17(int) Constant 3 + 41: 22(int) Constant 2 + 48: 17(int) Constant 4 + 49: 22(int) Constant 3 + 60: TypePointer Input 7(fvec4) + 61(v): 60(ptr) Variable Input + 67: TypePointer Output 7(fvec4) +68(@entryPointOutput.pos): 67(ptr) Variable Output + 71: TypePointer Output 9(fvec2) +72(@entryPointOutput.UV0): 71(ptr) Variable Output +75(@entryPointOutput.UV1): 71(ptr) Variable Output +78(@entryPointOutput.UV2): 71(ptr) Variable Output +81(@entryPointOutput.UV3): 71(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 59(v): 8(ptr) Variable Function + 63(flattenTemp): 15(ptr) Variable Function + 64(param): 8(ptr) Variable Function + 62: 7(fvec4) Load 61(v) + Store 59(v) 62 + 65: 7(fvec4) Load 59(v) + Store 64(param) 65 + 66: 10(S) FunctionCall 13(@main(vf4;) 64(param) + Store 63(flattenTemp) 66 + 69: 8(ptr) AccessChain 63(flattenTemp) 18 + 70: 7(fvec4) Load 69 + Store 68(@entryPointOutput.pos) 70 + 73: 30(ptr) AccessChain 63(flattenTemp) 21 + 74: 9(fvec2) Load 73 + Store 72(@entryPointOutput.UV0) 74 + 76: 30(ptr) AccessChain 63(flattenTemp) 32 + 77: 9(fvec2) Load 76 + Store 75(@entryPointOutput.UV1) 77 + 79: 30(ptr) AccessChain 63(flattenTemp) 40 + 80: 9(fvec2) Load 79 + Store 78(@entryPointOutput.UV2) 80 + 82: 30(ptr) AccessChain 63(flattenTemp) 48 + 83: 9(fvec2) Load 82 + Store 81(@entryPointOutput.UV3) 83 + Return + FunctionEnd + 13(@main(vf4;): 10(S) Function None 11 + 12(v): 8(ptr) FunctionParameter + 14: Label + 16(s): 15(ptr) Variable Function + 19: 7(fvec4) Load 12(v) + 20: 8(ptr) AccessChain 16(s) 18 + Store 20 19 + 25: 24(ptr) AccessChain 12(v) 23 + 26: 6(float) Load 25 + 27: 24(ptr) AccessChain 12(v) 23 + 28: 6(float) Load 27 + 29: 9(fvec2) CompositeConstruct 26 28 + 31: 30(ptr) AccessChain 16(s) 21 + Store 31 29 + 34: 24(ptr) AccessChain 12(v) 33 + 35: 6(float) Load 34 + 36: 24(ptr) AccessChain 12(v) 33 + 37: 6(float) Load 36 + 38: 9(fvec2) CompositeConstruct 35 37 + 39: 30(ptr) AccessChain 16(s) 32 + Store 39 38 + 42: 24(ptr) AccessChain 12(v) 41 + 43: 6(float) Load 42 + 44: 24(ptr) AccessChain 12(v) 41 + 45: 6(float) Load 44 + 46: 9(fvec2) CompositeConstruct 43 45 + 47: 30(ptr) AccessChain 16(s) 40 + Store 47 46 + 50: 24(ptr) AccessChain 12(v) 49 + 51: 6(float) Load 50 + 52: 24(ptr) AccessChain 12(v) 49 + 53: 6(float) Load 52 + 54: 9(fvec2) CompositeConstruct 51 53 + 55: 30(ptr) AccessChain 16(s) 48 + Store 55 54 + 56: 10(S) Load 16(s) + ReturnValue 56 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.semantic.geom.out b/deps/glslang/Test/baseResults/hlsl.semantic.geom.out new file mode 100644 index 00000000..e73940bc --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.semantic.geom.out @@ -0,0 +1,284 @@ +hlsl.semantic.geom +Shader version: 500 +invocations = -1 +max_vertices = 4 +input primitive = triangles +output primitive = line_strip +0:? Sequence +0:13 Function Definition: @main(u1[3];struct-S-f1-f1-f1-u1-u1-i11; ( temp void) +0:13 Function Parameters: +0:13 'VertexID' ( in 3-element array of uint) +0:13 'OutputStream' ( out structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:? Sequence +0:15 Sequence +0:15 Sequence +0:15 move second child to first child ( temp float) +0:? 'OutputStream.clip0' ( out float Position) +0:15 clip0: direct index for structure ( temp float) +0:15 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:15 Constant: +0:15 0 (const int) +0:? Sequence +0:15 move second child to first child ( temp float) +0:15 direct index ( out float ClipDistance) +0:? 'OutputStream.clip0' ( out 1-element array of float ClipDistance) +0:15 Constant: +0:15 0 (const int) +0:15 clip0: direct index for structure ( temp float) +0:15 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:15 Constant: +0:15 1 (const int) +0:? Sequence +0:15 move second child to first child ( temp float) +0:15 direct index ( out float CullDistance) +0:? 'OutputStream.cull0' ( out 1-element array of float CullDistance) +0:15 Constant: +0:15 0 (const int) +0:15 cull0: direct index for structure ( temp float) +0:15 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:15 Constant: +0:15 2 (const int) +0:15 move second child to first child ( temp uint) +0:? 'OutputStream.vpai' ( out uint ViewportIndex) +0:15 vpai: direct index for structure ( temp uint) +0:15 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:15 Constant: +0:15 3 (const int) +0:15 move second child to first child ( temp uint) +0:? 'OutputStream.rtai' ( out uint Layer) +0:15 rtai: direct index for structure ( temp uint) +0:15 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:15 Constant: +0:15 4 (const int) +0:15 move second child to first child ( temp int) +0:? 'OutputStream.ii' (layout( location=0) out int) +0:15 ii: direct index for structure ( temp int) +0:15 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:15 Constant: +0:15 5 (const int) +0:15 EmitVertex ( temp void) +0:13 Function Definition: main( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-element array of uint) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:13 Function Call: @main(u1[3];struct-S-f1-f1-f1-u1-u1-i11; ( temp void) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'OutputStream' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:? Linker Objects +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? 'OutputStream.clip0' ( out float Position) +0:? 'OutputStream.vpai' ( out uint ViewportIndex) +0:? 'OutputStream.rtai' ( out uint Layer) +0:? 'OutputStream.ii' (layout( location=0) out int) +0:? 'OutputStream.clip0' ( out 1-element array of float ClipDistance) +0:? 'OutputStream.cull0' ( out 1-element array of float CullDistance) + + +Linked geometry stage: + + +Shader version: 500 +invocations = 1 +max_vertices = 4 +input primitive = triangles +output primitive = line_strip +0:? Sequence +0:13 Function Definition: @main(u1[3];struct-S-f1-f1-f1-u1-u1-i11; ( temp void) +0:13 Function Parameters: +0:13 'VertexID' ( in 3-element array of uint) +0:13 'OutputStream' ( out structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:? Sequence +0:15 Sequence +0:15 Sequence +0:15 move second child to first child ( temp float) +0:? 'OutputStream.clip0' ( out float Position) +0:15 clip0: direct index for structure ( temp float) +0:15 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:15 Constant: +0:15 0 (const int) +0:? Sequence +0:15 move second child to first child ( temp float) +0:15 direct index ( out float ClipDistance) +0:? 'OutputStream.clip0' ( out 1-element array of float ClipDistance) +0:15 Constant: +0:15 0 (const int) +0:15 clip0: direct index for structure ( temp float) +0:15 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:15 Constant: +0:15 1 (const int) +0:? Sequence +0:15 move second child to first child ( temp float) +0:15 direct index ( out float CullDistance) +0:? 'OutputStream.cull0' ( out 1-element array of float CullDistance) +0:15 Constant: +0:15 0 (const int) +0:15 cull0: direct index for structure ( temp float) +0:15 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:15 Constant: +0:15 2 (const int) +0:15 move second child to first child ( temp uint) +0:? 'OutputStream.vpai' ( out uint ViewportIndex) +0:15 vpai: direct index for structure ( temp uint) +0:15 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:15 Constant: +0:15 3 (const int) +0:15 move second child to first child ( temp uint) +0:? 'OutputStream.rtai' ( out uint Layer) +0:15 rtai: direct index for structure ( temp uint) +0:15 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:15 Constant: +0:15 4 (const int) +0:15 move second child to first child ( temp int) +0:? 'OutputStream.ii' (layout( location=0) out int) +0:15 ii: direct index for structure ( temp int) +0:15 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:15 Constant: +0:15 5 (const int) +0:15 EmitVertex ( temp void) +0:13 Function Definition: main( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-element array of uint) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:13 Function Call: @main(u1[3];struct-S-f1-f1-f1-u1-u1-i11; ( temp void) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'OutputStream' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:? Linker Objects +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? 'OutputStream.clip0' ( out float Position) +0:? 'OutputStream.vpai' ( out uint ViewportIndex) +0:? 'OutputStream.rtai' ( out uint Layer) +0:? 'OutputStream.ii' (layout( location=0) out int) +0:? 'OutputStream.clip0' ( out 1-element array of float ClipDistance) +0:? 'OutputStream.cull0' ( out 1-element array of float CullDistance) + +error: SPIRV-Tools Validation Errors +error: According to the Vulkan spec BuiltIn Position variable needs to be a 4-component 32-bit float vector. ID <20> (OpVariable) is not a float vector. + OpStore %OutputStream_clip0 %25 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 65 + + Capability Geometry + Capability ClipDistance + Capability CullDistance + Capability MultiViewport + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 20 29 34 40 45 50 57 + ExecutionMode 4 Triangles + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputLineStrip + ExecutionMode 4 OutputVertices 4 + Source HLSL 500 + Name 4 "main" + Name 12 "S" + MemberName 12(S) 0 "clip0" + MemberName 12(S) 1 "clip0" + MemberName 12(S) 2 "cull0" + MemberName 12(S) 3 "vpai" + MemberName 12(S) 4 "rtai" + MemberName 12(S) 5 "ii" + Name 17 "@main(u1[3];struct-S-f1-f1-f1-u1-u1-i11;" + Name 15 "VertexID" + Name 16 "OutputStream" + Name 20 "OutputStream.clip0" + Name 21 "s" + Name 29 "OutputStream.clip0" + Name 34 "OutputStream.cull0" + Name 40 "OutputStream.vpai" + Name 45 "OutputStream.rtai" + Name 50 "OutputStream.ii" + Name 55 "VertexID" + Name 57 "VertexID" + Name 59 "OutputStream" + Name 60 "param" + Name 62 "param" + Decorate 20(OutputStream.clip0) BuiltIn Position + Decorate 29(OutputStream.clip0) BuiltIn ClipDistance + Decorate 34(OutputStream.cull0) BuiltIn CullDistance + Decorate 40(OutputStream.vpai) BuiltIn ViewportIndex + Decorate 45(OutputStream.rtai) BuiltIn Layer + Decorate 50(OutputStream.ii) Location 0 + Decorate 57(VertexID) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: 6(int) Constant 3 + 8: TypeArray 6(int) 7 + 9: TypePointer Function 8 + 10: TypeFloat 32 + 11: TypeInt 32 1 + 12(S): TypeStruct 10(float) 10(float) 10(float) 6(int) 6(int) 11(int) + 13: TypePointer Function 12(S) + 14: TypeFunction 2 9(ptr) 13(ptr) + 19: TypePointer Output 10(float) +20(OutputStream.clip0): 19(ptr) Variable Output + 22: 11(int) Constant 0 + 23: TypePointer Function 10(float) + 26: 6(int) Constant 1 + 27: TypeArray 10(float) 26 + 28: TypePointer Output 27 +29(OutputStream.clip0): 28(ptr) Variable Output + 30: 11(int) Constant 1 +34(OutputStream.cull0): 28(ptr) Variable Output + 35: 11(int) Constant 2 + 39: TypePointer Output 6(int) +40(OutputStream.vpai): 39(ptr) Variable Output + 41: 11(int) Constant 3 + 42: TypePointer Function 6(int) +45(OutputStream.rtai): 39(ptr) Variable Output + 46: 11(int) Constant 4 + 49: TypePointer Output 11(int) +50(OutputStream.ii): 49(ptr) Variable Output + 51: 11(int) Constant 5 + 52: TypePointer Function 11(int) + 56: TypePointer Input 8 + 57(VertexID): 56(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 55(VertexID): 9(ptr) Variable Function +59(OutputStream): 13(ptr) Variable Function + 60(param): 9(ptr) Variable Function + 62(param): 13(ptr) Variable Function + 58: 8 Load 57(VertexID) + Store 55(VertexID) 58 + 61: 8 Load 55(VertexID) + Store 60(param) 61 + 63: 2 FunctionCall 17(@main(u1[3];struct-S-f1-f1-f1-u1-u1-i11;) 60(param) 62(param) + 64: 12(S) Load 62(param) + Store 59(OutputStream) 64 + Return + FunctionEnd +17(@main(u1[3];struct-S-f1-f1-f1-u1-u1-i11;): 2 Function None 14 + 15(VertexID): 9(ptr) FunctionParameter +16(OutputStream): 13(ptr) FunctionParameter + 18: Label + 21(s): 13(ptr) Variable Function + 24: 23(ptr) AccessChain 21(s) 22 + 25: 10(float) Load 24 + Store 20(OutputStream.clip0) 25 + 31: 23(ptr) AccessChain 21(s) 30 + 32: 10(float) Load 31 + 33: 19(ptr) AccessChain 29(OutputStream.clip0) 22 + Store 33 32 + 36: 23(ptr) AccessChain 21(s) 35 + 37: 10(float) Load 36 + 38: 19(ptr) AccessChain 34(OutputStream.cull0) 22 + Store 38 37 + 43: 42(ptr) AccessChain 21(s) 41 + 44: 6(int) Load 43 + Store 40(OutputStream.vpai) 44 + 47: 42(ptr) AccessChain 21(s) 46 + 48: 6(int) Load 47 + Store 45(OutputStream.rtai) 48 + 53: 52(ptr) AccessChain 21(s) 51 + 54: 11(int) Load 53 + Store 50(OutputStream.ii) 54 + EmitVertex + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.semantic.vert.out b/deps/glslang/Test/baseResults/hlsl.semantic.vert.out new file mode 100644 index 00000000..2dbcd57f --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.semantic.vert.out @@ -0,0 +1,333 @@ +hlsl.semantic.vert +Shader version: 500 +0:? Sequence +0:10 Function Definition: @main(struct-S-f1-f1-f1-f1-i11; ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Function Parameters: +0:10 'ins' ( in structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:? Sequence +0:12 Branch: Return with expression +0:12 's' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Function Definition: main( ( temp void) +0:10 Function Parameters: +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp float) +0:10 clip0: direct index for structure ( temp float) +0:? 'ins' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Constant: +0:10 0 (const int) +0:? 'ins.clip0' (layout( location=0) in float) +0:10 move second child to first child ( temp float) +0:10 clip1: direct index for structure ( temp float) +0:? 'ins' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Constant: +0:10 1 (const int) +0:? 'ins.clip1' (layout( location=1) in float) +0:10 move second child to first child ( temp float) +0:10 cull0: direct index for structure ( temp float) +0:? 'ins' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Constant: +0:10 2 (const int) +0:? 'ins.cull0' (layout( location=0) in float) +0:10 move second child to first child ( temp float) +0:10 cull1: direct index for structure ( temp float) +0:? 'ins' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Constant: +0:10 3 (const int) +0:? 'ins.cull1' (layout( location=1) in float) +0:10 move second child to first child ( temp int) +0:10 ii: direct index for structure ( temp int) +0:? 'ins' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Constant: +0:10 4 (const int) +0:? 'ins.ii' ( in int InstanceIndex) +0:10 Sequence +0:10 move second child to first child ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 'flattenTemp' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Function Call: @main(struct-S-f1-f1-f1-f1-i11; ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:? 'ins' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:? Sequence +0:10 move second child to first child ( temp float) +0:10 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 2-element array of float ClipDistance) +0:10 Constant: +0:10 0 (const int) +0:10 clip0: direct index for structure ( temp float) +0:10 'flattenTemp' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Constant: +0:10 0 (const int) +0:? Sequence +0:10 move second child to first child ( temp float) +0:10 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 2-element array of float ClipDistance) +0:10 Constant: +0:10 1 (const int) +0:10 clip1: direct index for structure ( temp float) +0:10 'flattenTemp' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Constant: +0:10 1 (const int) +0:? Sequence +0:10 move second child to first child ( temp float) +0:10 direct index ( out float CullDistance) +0:? '@entryPointOutput.cull1' ( out 2-element array of float CullDistance) +0:10 Constant: +0:10 0 (const int) +0:10 cull0: direct index for structure ( temp float) +0:10 'flattenTemp' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Constant: +0:10 2 (const int) +0:? Sequence +0:10 move second child to first child ( temp float) +0:10 direct index ( out float CullDistance) +0:? '@entryPointOutput.cull1' ( out 2-element array of float CullDistance) +0:10 Constant: +0:10 1 (const int) +0:10 cull1: direct index for structure ( temp float) +0:10 'flattenTemp' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Constant: +0:10 3 (const int) +0:10 move second child to first child ( temp int) +0:? '@entryPointOutput.ii' (layout( location=0) out int) +0:10 ii: direct index for structure ( temp int) +0:10 'flattenTemp' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Constant: +0:10 4 (const int) +0:? Linker Objects +0:? '@entryPointOutput.ii' (layout( location=0) out int) +0:? 'ins.ii' ( in int InstanceIndex) +0:? 'ins.clip0' (layout( location=0) in float) +0:? 'ins.clip1' (layout( location=1) in float) +0:? 'ins.cull0' (layout( location=0) in float) +0:? 'ins.cull1' (layout( location=1) in float) +0:? '@entryPointOutput.clip1' ( out 2-element array of float ClipDistance) +0:? '@entryPointOutput.cull1' ( out 2-element array of float CullDistance) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:10 Function Definition: @main(struct-S-f1-f1-f1-f1-i11; ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Function Parameters: +0:10 'ins' ( in structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:? Sequence +0:12 Branch: Return with expression +0:12 's' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Function Definition: main( ( temp void) +0:10 Function Parameters: +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp float) +0:10 clip0: direct index for structure ( temp float) +0:? 'ins' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Constant: +0:10 0 (const int) +0:? 'ins.clip0' (layout( location=0) in float) +0:10 move second child to first child ( temp float) +0:10 clip1: direct index for structure ( temp float) +0:? 'ins' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Constant: +0:10 1 (const int) +0:? 'ins.clip1' (layout( location=1) in float) +0:10 move second child to first child ( temp float) +0:10 cull0: direct index for structure ( temp float) +0:? 'ins' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Constant: +0:10 2 (const int) +0:? 'ins.cull0' (layout( location=0) in float) +0:10 move second child to first child ( temp float) +0:10 cull1: direct index for structure ( temp float) +0:? 'ins' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Constant: +0:10 3 (const int) +0:? 'ins.cull1' (layout( location=1) in float) +0:10 move second child to first child ( temp int) +0:10 ii: direct index for structure ( temp int) +0:? 'ins' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Constant: +0:10 4 (const int) +0:? 'ins.ii' ( in int InstanceIndex) +0:10 Sequence +0:10 move second child to first child ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 'flattenTemp' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Function Call: @main(struct-S-f1-f1-f1-f1-i11; ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:? 'ins' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:? Sequence +0:10 move second child to first child ( temp float) +0:10 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 2-element array of float ClipDistance) +0:10 Constant: +0:10 0 (const int) +0:10 clip0: direct index for structure ( temp float) +0:10 'flattenTemp' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Constant: +0:10 0 (const int) +0:? Sequence +0:10 move second child to first child ( temp float) +0:10 direct index ( out float ClipDistance) +0:? '@entryPointOutput.clip1' ( out 2-element array of float ClipDistance) +0:10 Constant: +0:10 1 (const int) +0:10 clip1: direct index for structure ( temp float) +0:10 'flattenTemp' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Constant: +0:10 1 (const int) +0:? Sequence +0:10 move second child to first child ( temp float) +0:10 direct index ( out float CullDistance) +0:? '@entryPointOutput.cull1' ( out 2-element array of float CullDistance) +0:10 Constant: +0:10 0 (const int) +0:10 cull0: direct index for structure ( temp float) +0:10 'flattenTemp' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Constant: +0:10 2 (const int) +0:? Sequence +0:10 move second child to first child ( temp float) +0:10 direct index ( out float CullDistance) +0:? '@entryPointOutput.cull1' ( out 2-element array of float CullDistance) +0:10 Constant: +0:10 1 (const int) +0:10 cull1: direct index for structure ( temp float) +0:10 'flattenTemp' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Constant: +0:10 3 (const int) +0:10 move second child to first child ( temp int) +0:? '@entryPointOutput.ii' (layout( location=0) out int) +0:10 ii: direct index for structure ( temp int) +0:10 'flattenTemp' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) +0:10 Constant: +0:10 4 (const int) +0:? Linker Objects +0:? '@entryPointOutput.ii' (layout( location=0) out int) +0:? 'ins.ii' ( in int InstanceIndex) +0:? 'ins.clip0' (layout( location=0) in float) +0:? 'ins.clip1' (layout( location=1) in float) +0:? 'ins.cull0' (layout( location=0) in float) +0:? 'ins.cull1' (layout( location=1) in float) +0:? '@entryPointOutput.clip1' ( out 2-element array of float ClipDistance) +0:? '@entryPointOutput.cull1' ( out 2-element array of float CullDistance) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 70 + + Capability Shader + Capability ClipDistance + Capability CullDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 21 26 30 34 39 51 59 67 + Source HLSL 500 + Name 4 "main" + Name 8 "S" + MemberName 8(S) 0 "clip0" + MemberName 8(S) 1 "clip1" + MemberName 8(S) 2 "cull0" + MemberName 8(S) 3 "cull1" + MemberName 8(S) 4 "ii" + Name 12 "@main(struct-S-f1-f1-f1-f1-i11;" + Name 11 "ins" + Name 14 "s" + Name 18 "ins" + Name 21 "ins.clip0" + Name 26 "ins.clip1" + Name 30 "ins.cull0" + Name 34 "ins.cull1" + Name 39 "ins.ii" + Name 43 "flattenTemp" + Name 44 "param" + Name 51 "@entryPointOutput.clip1" + Name 59 "@entryPointOutput.cull1" + Name 67 "@entryPointOutput.ii" + Decorate 21(ins.clip0) Location 0 + Decorate 26(ins.clip1) Location 1 + Decorate 30(ins.cull0) Location 0 + Decorate 34(ins.cull1) Location 1 + Decorate 39(ins.ii) BuiltIn InstanceIndex + Decorate 51(@entryPointOutput.clip1) BuiltIn ClipDistance + Decorate 59(@entryPointOutput.cull1) BuiltIn CullDistance + Decorate 67(@entryPointOutput.ii) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeInt 32 1 + 8(S): TypeStruct 6(float) 6(float) 6(float) 6(float) 7(int) + 9: TypePointer Function 8(S) + 10: TypeFunction 8(S) 9(ptr) + 19: 7(int) Constant 0 + 20: TypePointer Input 6(float) + 21(ins.clip0): 20(ptr) Variable Input + 23: TypePointer Function 6(float) + 25: 7(int) Constant 1 + 26(ins.clip1): 20(ptr) Variable Input + 29: 7(int) Constant 2 + 30(ins.cull0): 20(ptr) Variable Input + 33: 7(int) Constant 3 + 34(ins.cull1): 20(ptr) Variable Input + 37: 7(int) Constant 4 + 38: TypePointer Input 7(int) + 39(ins.ii): 38(ptr) Variable Input + 41: TypePointer Function 7(int) + 47: TypeInt 32 0 + 48: 47(int) Constant 2 + 49: TypeArray 6(float) 48 + 50: TypePointer Output 49 +51(@entryPointOutput.clip1): 50(ptr) Variable Output + 54: TypePointer Output 6(float) +59(@entryPointOutput.cull1): 50(ptr) Variable Output + 66: TypePointer Output 7(int) +67(@entryPointOutput.ii): 66(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 18(ins): 9(ptr) Variable Function + 43(flattenTemp): 9(ptr) Variable Function + 44(param): 9(ptr) Variable Function + 22: 6(float) Load 21(ins.clip0) + 24: 23(ptr) AccessChain 18(ins) 19 + Store 24 22 + 27: 6(float) Load 26(ins.clip1) + 28: 23(ptr) AccessChain 18(ins) 25 + Store 28 27 + 31: 6(float) Load 30(ins.cull0) + 32: 23(ptr) AccessChain 18(ins) 29 + Store 32 31 + 35: 6(float) Load 34(ins.cull1) + 36: 23(ptr) AccessChain 18(ins) 33 + Store 36 35 + 40: 7(int) Load 39(ins.ii) + 42: 41(ptr) AccessChain 18(ins) 37 + Store 42 40 + 45: 8(S) Load 18(ins) + Store 44(param) 45 + 46: 8(S) FunctionCall 12(@main(struct-S-f1-f1-f1-f1-i11;) 44(param) + Store 43(flattenTemp) 46 + 52: 23(ptr) AccessChain 43(flattenTemp) 19 + 53: 6(float) Load 52 + 55: 54(ptr) AccessChain 51(@entryPointOutput.clip1) 19 + Store 55 53 + 56: 23(ptr) AccessChain 43(flattenTemp) 25 + 57: 6(float) Load 56 + 58: 54(ptr) AccessChain 51(@entryPointOutput.clip1) 25 + Store 58 57 + 60: 23(ptr) AccessChain 43(flattenTemp) 29 + 61: 6(float) Load 60 + 62: 54(ptr) AccessChain 59(@entryPointOutput.cull1) 19 + Store 62 61 + 63: 23(ptr) AccessChain 43(flattenTemp) 33 + 64: 6(float) Load 63 + 65: 54(ptr) AccessChain 59(@entryPointOutput.cull1) 25 + Store 65 64 + 68: 41(ptr) AccessChain 43(flattenTemp) 37 + 69: 7(int) Load 68 + Store 67(@entryPointOutput.ii) 69 + Return + FunctionEnd +12(@main(struct-S-f1-f1-f1-f1-i11;): 8(S) Function None 10 + 11(ins): 9(ptr) FunctionParameter + 13: Label + 14(s): 9(ptr) Variable Function + 15: 8(S) Load 14(s) + ReturnValue 15 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.semicolons.frag.out b/deps/glslang/Test/baseResults/hlsl.semicolons.frag.out new file mode 100644 index 00000000..94307a6a --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.semicolons.frag.out @@ -0,0 +1,131 @@ +hlsl.semicolons.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: MyFunc( ( temp void) +0:2 Function Parameters: +0:8 Function Definition: MyFunc2( ( temp void) +0:8 Function Parameters: +0:13 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:13 Function Parameters: +0:? Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:16 color: direct index for structure ( temp 4-component vector of float) +0:16 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1.000000 +0:16 1.000000 +0:16 1.000000 +0:16 1.000000 +0:17 Branch: Return with expression +0:17 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:13 Function Definition: main( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:13 color: direct index for structure ( temp 4-component vector of float) +0:13 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:13 Constant: +0:13 0 (const int) +0:? Linker Objects +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: MyFunc( ( temp void) +0:2 Function Parameters: +0:8 Function Definition: MyFunc2( ( temp void) +0:8 Function Parameters: +0:13 Function Definition: @main( ( temp structure{ temp 4-component vector of float color}) +0:13 Function Parameters: +0:? Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:16 color: direct index for structure ( temp 4-component vector of float) +0:16 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1.000000 +0:16 1.000000 +0:16 1.000000 +0:16 1.000000 +0:17 Branch: Return with expression +0:17 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:13 Function Definition: main( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) +0:13 color: direct index for structure ( temp 4-component vector of float) +0:13 Function Call: @main( ( temp structure{ temp 4-component vector of float color}) +0:13 Constant: +0:13 0 (const int) +0:? Linker Objects +0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 31 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 28 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 6 "MyFunc(" + Name 8 "MyFunc2(" + Name 12 "PS_OUTPUT" + MemberName 12(PS_OUTPUT) 0 "color" + Name 14 "@main(" + Name 17 "ps_output" + Name 28 "@entryPointOutput.color" + Decorate 28(@entryPointOutput.color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 10: TypeFloat 32 + 11: TypeVector 10(float) 4 + 12(PS_OUTPUT): TypeStruct 11(fvec4) + 13: TypeFunction 12(PS_OUTPUT) + 16: TypePointer Function 12(PS_OUTPUT) + 18: TypeInt 32 1 + 19: 18(int) Constant 0 + 20: 10(float) Constant 1065353216 + 21: 11(fvec4) ConstantComposite 20 20 20 20 + 22: TypePointer Function 11(fvec4) + 27: TypePointer Output 11(fvec4) +28(@entryPointOutput.color): 27(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 29:12(PS_OUTPUT) FunctionCall 14(@main() + 30: 11(fvec4) CompositeExtract 29 0 + Store 28(@entryPointOutput.color) 30 + Return + FunctionEnd + 6(MyFunc(): 2 Function None 3 + 7: Label + Return + FunctionEnd + 8(MyFunc2(): 2 Function None 3 + 9: Label + Return + FunctionEnd + 14(@main():12(PS_OUTPUT) Function None 13 + 15: Label + 17(ps_output): 16(ptr) Variable Function + 23: 22(ptr) AccessChain 17(ps_output) 19 + Store 23 21 + 24:12(PS_OUTPUT) Load 17(ps_output) + ReturnValue 24 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.shapeConv.frag.out b/deps/glslang/Test/baseResults/hlsl.shapeConv.frag.out new file mode 100644 index 00000000..d2838099 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.shapeConv.frag.out @@ -0,0 +1,489 @@ +hlsl.shapeConv.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: PixelShaderFunction(vf4;f1; ( temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' ( in 4-component vector of float) +0:2 'f' ( in float) +0:? Sequence +0:4 move second child to first child ( temp 4-component vector of float) +0:4 'v' ( temp 4-component vector of float) +0:4 Constant: +0:4 1.000000 +0:4 1.000000 +0:4 1.000000 +0:4 1.000000 +0:5 move second child to first child ( temp 4-component vector of float) +0:5 'v' ( temp 4-component vector of float) +0:5 Constant: +0:5 2.000000 +0:5 2.000000 +0:5 2.000000 +0:5 2.000000 +0:6 move second child to first child ( temp 4-component vector of float) +0:6 'v' ( temp 4-component vector of float) +0:6 Construct vec4 ( temp 4-component vector of float) +0:6 'f' ( in float) +0:8 move second child to first child ( temp 3-component vector of float) +0:8 'u' ( temp 3-component vector of float) +0:8 Constant: +0:8 1.000000 +0:8 1.000000 +0:8 1.000000 +0:9 move second child to first child ( temp 3-component vector of float) +0:9 'u' ( temp 3-component vector of float) +0:9 Constant: +0:9 2.000000 +0:9 2.000000 +0:9 2.000000 +0:10 move second child to first child ( temp 3-component vector of float) +0:10 'u' ( temp 3-component vector of float) +0:10 Construct vec3 ( temp 3-component vector of float) +0:10 'f' ( in float) +0:11 Sequence +0:11 move second child to first child ( temp 2-component vector of float) +0:11 'w' ( temp 2-component vector of float) +0:11 Constant: +0:11 2.000000 +0:11 2.000000 +0:12 Sequence +0:12 move second child to first child ( temp float) +0:12 'V' ( temp float) +0:12 Constant: +0:12 1.000000 +0:13 Sequence +0:13 move second child to first child ( temp 3-component vector of float) +0:13 'MyVal' ( temp 3-component vector of float) +0:13 Construct vec3 ( temp 3-component vector of float) +0:13 'V' ( temp float) +0:16 Compare Greater Than ( temp 3-component vector of bool) +0:16 'foo' ( temp 3-component vector of float) +0:16 Constant: +0:16 4.000000 +0:16 4.000000 +0:16 4.000000 +0:17 Compare Greater Than or Equal ( temp 3-component vector of bool) +0:17 'foo' ( temp 3-component vector of float) +0:17 Constant: +0:17 5.000000 +0:17 5.000000 +0:17 5.000000 +0:18 Compare Less Than ( temp 3-component vector of bool) +0:18 Constant: +0:18 6.000000 +0:18 6.000000 +0:18 6.000000 +0:18 'foo' ( temp 3-component vector of float) +0:19 Compare Less Than or Equal ( temp 3-component vector of bool) +0:19 Constant: +0:19 7.000000 +0:19 7.000000 +0:19 7.000000 +0:19 'foo' ( temp 3-component vector of float) +0:21 all ( temp bool) +0:21 Equal ( temp 4-component vector of bool) +0:21 Construct vec4 ( temp 4-component vector of float) +0:21 direct index ( temp float) +0:21 'v' ( temp 4-component vector of float) +0:21 Constant: +0:21 0 (const int) +0:21 'v' ( temp 4-component vector of float) +0:22 any ( temp bool) +0:22 NotEqual ( temp 4-component vector of bool) +0:22 Construct vec4 ( temp 4-component vector of float) +0:22 'f' ( in float) +0:22 'v' ( temp 4-component vector of float) +0:26 Equal ( temp 4-component vector of bool) +0:26 Construct vec4 ( temp 4-component vector of float) +0:26 'f1' ( temp 1-component vector of float) +0:26 'v' ( temp 4-component vector of float) +0:27 Compare Less Than ( temp 4-component vector of bool) +0:27 'v' ( temp 4-component vector of float) +0:27 Construct vec4 ( temp 4-component vector of float) +0:27 'f1' ( temp 1-component vector of float) +0:28 Construct float ( temp float) +0:28 'f1' ( temp 1-component vector of float) +0:29 Construct vec3 ( temp 3-component vector of float) +0:29 Construct float ( temp float) +0:29 'f1' ( temp 1-component vector of float) +0:36 right-shift ( temp 3-component vector of uint) +0:36 Construct uvec3 ( temp 3-component vector of uint) +0:36 'ui' ( temp uint) +0:36 'ui3' ( temp 3-component vector of uint) +0:37 right-shift ( temp 3-component vector of uint) +0:37 'ui3' ( temp 3-component vector of uint) +0:37 'ui' ( temp uint) +0:39 multiply second child into first child ( temp 4-component vector of float) +0:39 'v' ( temp 4-component vector of float) +0:39 'f1' ( temp 1-component vector of float) +0:40 multiply second child into first child ( temp 1-component vector of float) +0:40 'f1' ( temp 1-component vector of float) +0:40 Construct float ( temp 1-component vector of float) +0:40 'v' ( temp 4-component vector of float) +0:42 Sequence +0:42 move second child to first child ( temp 3-component vector of float) +0:42 'mixed' ( temp 3-component vector of float) +0:42 component-wise multiply ( temp 3-component vector of float) +0:42 'u' ( temp 3-component vector of float) +0:42 Construct vec3 ( temp 3-component vector of float) +0:42 'v' ( temp 4-component vector of float) +0:43 move second child to first child ( temp float) +0:43 'f' ( in float) +0:43 Construct float ( in float) +0:43 'u' ( temp 3-component vector of float) +0:44 move second child to first child ( temp 1-component vector of float) +0:44 'f1' ( temp 1-component vector of float) +0:44 Construct float ( temp 1-component vector of float) +0:44 'u' ( temp 3-component vector of float) +0:45 Sequence +0:45 move second child to first child ( temp float) +0:45 'sf' ( temp float) +0:45 Construct float ( temp float) +0:45 'v' ( temp 4-component vector of float) +0:46 Sequence +0:46 move second child to first child ( temp 1-component vector of float) +0:46 'sf1' ( temp 1-component vector of float) +0:46 Construct float ( temp 1-component vector of float) +0:46 'v' ( temp 4-component vector of float) +0:48 Branch: Return with expression +0:48 component-wise multiply ( temp 4-component vector of float) +0:48 'input' ( in 4-component vector of float) +0:48 Constant: +0:48 3.000000 +0:48 3.000000 +0:48 3.000000 +0:48 3.000000 +0:? Linker Objects + + +Linked fragment stage: + +WARNING: Linking fragment stage: Entry point not found + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: PixelShaderFunction(vf4;f1; ( temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' ( in 4-component vector of float) +0:2 'f' ( in float) +0:? Sequence +0:4 move second child to first child ( temp 4-component vector of float) +0:4 'v' ( temp 4-component vector of float) +0:4 Constant: +0:4 1.000000 +0:4 1.000000 +0:4 1.000000 +0:4 1.000000 +0:5 move second child to first child ( temp 4-component vector of float) +0:5 'v' ( temp 4-component vector of float) +0:5 Constant: +0:5 2.000000 +0:5 2.000000 +0:5 2.000000 +0:5 2.000000 +0:6 move second child to first child ( temp 4-component vector of float) +0:6 'v' ( temp 4-component vector of float) +0:6 Construct vec4 ( temp 4-component vector of float) +0:6 'f' ( in float) +0:8 move second child to first child ( temp 3-component vector of float) +0:8 'u' ( temp 3-component vector of float) +0:8 Constant: +0:8 1.000000 +0:8 1.000000 +0:8 1.000000 +0:9 move second child to first child ( temp 3-component vector of float) +0:9 'u' ( temp 3-component vector of float) +0:9 Constant: +0:9 2.000000 +0:9 2.000000 +0:9 2.000000 +0:10 move second child to first child ( temp 3-component vector of float) +0:10 'u' ( temp 3-component vector of float) +0:10 Construct vec3 ( temp 3-component vector of float) +0:10 'f' ( in float) +0:11 Sequence +0:11 move second child to first child ( temp 2-component vector of float) +0:11 'w' ( temp 2-component vector of float) +0:11 Constant: +0:11 2.000000 +0:11 2.000000 +0:12 Sequence +0:12 move second child to first child ( temp float) +0:12 'V' ( temp float) +0:12 Constant: +0:12 1.000000 +0:13 Sequence +0:13 move second child to first child ( temp 3-component vector of float) +0:13 'MyVal' ( temp 3-component vector of float) +0:13 Construct vec3 ( temp 3-component vector of float) +0:13 'V' ( temp float) +0:16 Compare Greater Than ( temp 3-component vector of bool) +0:16 'foo' ( temp 3-component vector of float) +0:16 Constant: +0:16 4.000000 +0:16 4.000000 +0:16 4.000000 +0:17 Compare Greater Than or Equal ( temp 3-component vector of bool) +0:17 'foo' ( temp 3-component vector of float) +0:17 Constant: +0:17 5.000000 +0:17 5.000000 +0:17 5.000000 +0:18 Compare Less Than ( temp 3-component vector of bool) +0:18 Constant: +0:18 6.000000 +0:18 6.000000 +0:18 6.000000 +0:18 'foo' ( temp 3-component vector of float) +0:19 Compare Less Than or Equal ( temp 3-component vector of bool) +0:19 Constant: +0:19 7.000000 +0:19 7.000000 +0:19 7.000000 +0:19 'foo' ( temp 3-component vector of float) +0:21 all ( temp bool) +0:21 Equal ( temp 4-component vector of bool) +0:21 Construct vec4 ( temp 4-component vector of float) +0:21 direct index ( temp float) +0:21 'v' ( temp 4-component vector of float) +0:21 Constant: +0:21 0 (const int) +0:21 'v' ( temp 4-component vector of float) +0:22 any ( temp bool) +0:22 NotEqual ( temp 4-component vector of bool) +0:22 Construct vec4 ( temp 4-component vector of float) +0:22 'f' ( in float) +0:22 'v' ( temp 4-component vector of float) +0:26 Equal ( temp 4-component vector of bool) +0:26 Construct vec4 ( temp 4-component vector of float) +0:26 'f1' ( temp 1-component vector of float) +0:26 'v' ( temp 4-component vector of float) +0:27 Compare Less Than ( temp 4-component vector of bool) +0:27 'v' ( temp 4-component vector of float) +0:27 Construct vec4 ( temp 4-component vector of float) +0:27 'f1' ( temp 1-component vector of float) +0:28 Construct float ( temp float) +0:28 'f1' ( temp 1-component vector of float) +0:29 Construct vec3 ( temp 3-component vector of float) +0:29 Construct float ( temp float) +0:29 'f1' ( temp 1-component vector of float) +0:36 right-shift ( temp 3-component vector of uint) +0:36 Construct uvec3 ( temp 3-component vector of uint) +0:36 'ui' ( temp uint) +0:36 'ui3' ( temp 3-component vector of uint) +0:37 right-shift ( temp 3-component vector of uint) +0:37 'ui3' ( temp 3-component vector of uint) +0:37 'ui' ( temp uint) +0:39 multiply second child into first child ( temp 4-component vector of float) +0:39 'v' ( temp 4-component vector of float) +0:39 'f1' ( temp 1-component vector of float) +0:40 multiply second child into first child ( temp 1-component vector of float) +0:40 'f1' ( temp 1-component vector of float) +0:40 Construct float ( temp 1-component vector of float) +0:40 'v' ( temp 4-component vector of float) +0:42 Sequence +0:42 move second child to first child ( temp 3-component vector of float) +0:42 'mixed' ( temp 3-component vector of float) +0:42 component-wise multiply ( temp 3-component vector of float) +0:42 'u' ( temp 3-component vector of float) +0:42 Construct vec3 ( temp 3-component vector of float) +0:42 'v' ( temp 4-component vector of float) +0:43 move second child to first child ( temp float) +0:43 'f' ( in float) +0:43 Construct float ( in float) +0:43 'u' ( temp 3-component vector of float) +0:44 move second child to first child ( temp 1-component vector of float) +0:44 'f1' ( temp 1-component vector of float) +0:44 Construct float ( temp 1-component vector of float) +0:44 'u' ( temp 3-component vector of float) +0:45 Sequence +0:45 move second child to first child ( temp float) +0:45 'sf' ( temp float) +0:45 Construct float ( temp float) +0:45 'v' ( temp 4-component vector of float) +0:46 Sequence +0:46 move second child to first child ( temp 1-component vector of float) +0:46 'sf1' ( temp 1-component vector of float) +0:46 Construct float ( temp 1-component vector of float) +0:46 'v' ( temp 4-component vector of float) +0:48 Branch: Return with expression +0:48 component-wise multiply ( temp 4-component vector of float) +0:48 'input' ( in 4-component vector of float) +0:48 Constant: +0:48 3.000000 +0:48 3.000000 +0:48 3.000000 +0:48 3.000000 +0:? Linker Objects + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 127 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 13 "PixelShaderFunction(vf4;f1;" + Name 11 "input" + Name 12 "f" + Name 15 "v" + Name 24 "u" + Name 31 "w" + Name 33 "V" + Name 34 "MyVal" + Name 37 "foo" + Name 70 "f1" + Name 83 "ui" + Name 88 "ui3" + Name 103 "mixed" + Name 115 "sf" + Name 118 "sf1" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypePointer Function 6(float) + 10: TypeFunction 7(fvec4) 8(ptr) 9(ptr) + 16: 6(float) Constant 1065353216 + 17: 7(fvec4) ConstantComposite 16 16 16 16 + 18: 6(float) Constant 1073741824 + 19: 7(fvec4) ConstantComposite 18 18 18 18 + 22: TypeVector 6(float) 3 + 23: TypePointer Function 22(fvec3) + 25: 22(fvec3) ConstantComposite 16 16 16 + 26: 22(fvec3) ConstantComposite 18 18 18 + 29: TypeVector 6(float) 2 + 30: TypePointer Function 29(fvec2) + 32: 29(fvec2) ConstantComposite 18 18 + 39: 6(float) Constant 1082130432 + 40: 22(fvec3) ConstantComposite 39 39 39 + 41: TypeBool + 42: TypeVector 41(bool) 3 + 45: 6(float) Constant 1084227584 + 46: 22(fvec3) ConstantComposite 45 45 45 + 48: 6(float) Constant 1086324736 + 49: 22(fvec3) ConstantComposite 48 48 48 + 52: 6(float) Constant 1088421888 + 53: 22(fvec3) ConstantComposite 52 52 52 + 56: TypeInt 32 0 + 57: 56(int) Constant 0 + 62: TypeVector 41(bool) 4 + 82: TypePointer Function 56(int) + 85: TypeVector 56(int) 3 + 87: TypePointer Function 85(ivec3) + 122: 6(float) Constant 1077936128 + 123: 7(fvec4) ConstantComposite 122 122 122 122 + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd +13(PixelShaderFunction(vf4;f1;): 7(fvec4) Function None 10 + 11(input): 8(ptr) FunctionParameter + 12(f): 9(ptr) FunctionParameter + 14: Label + 15(v): 8(ptr) Variable Function + 24(u): 23(ptr) Variable Function + 31(w): 30(ptr) Variable Function + 33(V): 9(ptr) Variable Function + 34(MyVal): 23(ptr) Variable Function + 37(foo): 23(ptr) Variable Function + 70(f1): 9(ptr) Variable Function + 83(ui): 82(ptr) Variable Function + 88(ui3): 87(ptr) Variable Function + 103(mixed): 23(ptr) Variable Function + 115(sf): 9(ptr) Variable Function + 118(sf1): 9(ptr) Variable Function + Store 15(v) 17 + Store 15(v) 19 + 20: 6(float) Load 12(f) + 21: 7(fvec4) CompositeConstruct 20 20 20 20 + Store 15(v) 21 + Store 24(u) 25 + Store 24(u) 26 + 27: 6(float) Load 12(f) + 28: 22(fvec3) CompositeConstruct 27 27 27 + Store 24(u) 28 + Store 31(w) 32 + Store 33(V) 16 + 35: 6(float) Load 33(V) + 36: 22(fvec3) CompositeConstruct 35 35 35 + Store 34(MyVal) 36 + 38: 22(fvec3) Load 37(foo) + 43: 42(bvec3) FOrdGreaterThan 38 40 + 44: 22(fvec3) Load 37(foo) + 47: 42(bvec3) FOrdGreaterThanEqual 44 46 + 50: 22(fvec3) Load 37(foo) + 51: 42(bvec3) FOrdLessThan 49 50 + 54: 22(fvec3) Load 37(foo) + 55: 42(bvec3) FOrdLessThanEqual 53 54 + 58: 9(ptr) AccessChain 15(v) 57 + 59: 6(float) Load 58 + 60: 7(fvec4) CompositeConstruct 59 59 59 59 + 61: 7(fvec4) Load 15(v) + 63: 62(bvec4) FOrdEqual 60 61 + 64: 41(bool) All 63 + 65: 6(float) Load 12(f) + 66: 7(fvec4) CompositeConstruct 65 65 65 65 + 67: 7(fvec4) Load 15(v) + 68: 62(bvec4) FOrdNotEqual 66 67 + 69: 41(bool) Any 68 + 71: 6(float) Load 70(f1) + 72: 7(fvec4) CompositeConstruct 71 71 71 71 + 73: 7(fvec4) Load 15(v) + 74: 62(bvec4) FOrdEqual 72 73 + 75: 7(fvec4) Load 15(v) + 76: 6(float) Load 70(f1) + 77: 7(fvec4) CompositeConstruct 76 76 76 76 + 78: 62(bvec4) FOrdLessThan 75 77 + 79: 6(float) Load 70(f1) + 80: 6(float) Load 70(f1) + 81: 22(fvec3) CompositeConstruct 80 80 80 + 84: 56(int) Load 83(ui) + 86: 85(ivec3) CompositeConstruct 84 84 84 + 89: 85(ivec3) Load 88(ui3) + 90: 85(ivec3) ShiftRightLogical 86 89 + 91: 85(ivec3) Load 88(ui3) + 92: 56(int) Load 83(ui) + 93: 85(ivec3) CompositeConstruct 92 92 92 + 94: 85(ivec3) ShiftRightLogical 91 93 + 95: 6(float) Load 70(f1) + 96: 7(fvec4) Load 15(v) + 97: 7(fvec4) CompositeConstruct 95 95 95 95 + 98: 7(fvec4) FMul 96 97 + Store 15(v) 98 + 99: 7(fvec4) Load 15(v) + 100: 6(float) CompositeExtract 99 0 + 101: 6(float) Load 70(f1) + 102: 6(float) FMul 101 100 + Store 70(f1) 102 + 104: 22(fvec3) Load 24(u) + 105: 7(fvec4) Load 15(v) + 106: 6(float) CompositeExtract 105 0 + 107: 6(float) CompositeExtract 105 1 + 108: 6(float) CompositeExtract 105 2 + 109: 22(fvec3) CompositeConstruct 106 107 108 + 110: 22(fvec3) FMul 104 109 + Store 103(mixed) 110 + 111: 22(fvec3) Load 24(u) + 112: 6(float) CompositeExtract 111 0 + Store 12(f) 112 + 113: 22(fvec3) Load 24(u) + 114: 6(float) CompositeExtract 113 0 + Store 70(f1) 114 + 116: 7(fvec4) Load 15(v) + 117: 6(float) CompositeExtract 116 0 + Store 115(sf) 117 + 119: 7(fvec4) Load 15(v) + 120: 6(float) CompositeExtract 119 0 + Store 118(sf1) 120 + 121: 7(fvec4) Load 11(input) + 124: 7(fvec4) FMul 121 123 + ReturnValue 124 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.shapeConvRet.frag.out b/deps/glslang/Test/baseResults/hlsl.shapeConvRet.frag.out new file mode 100644 index 00000000..fc12f7f0 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.shapeConvRet.frag.out @@ -0,0 +1,127 @@ +hlsl.shapeConvRet.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: foo( ( temp 3-component vector of int) +0:2 Function Parameters: +0:? Sequence +0:3 Branch: Return with expression +0:3 Constant: +0:3 13 (const int) +0:3 13 (const int) +0:3 13 (const int) +0:7 Function Definition: @main(f1; ( temp 4-component vector of float) +0:7 Function Parameters: +0:7 'f' ( in float) +0:? Sequence +0:8 Branch: Return with expression +0:8 Construct vec4 ( temp 4-component vector of float) +0:8 'f' ( in float) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp float) +0:? 'f' ( temp float) +0:? 'f' (layout( location=0) in float) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main(f1; ( temp 4-component vector of float) +0:? 'f' ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'f' (layout( location=0) in float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: foo( ( temp 3-component vector of int) +0:2 Function Parameters: +0:? Sequence +0:3 Branch: Return with expression +0:3 Constant: +0:3 13 (const int) +0:3 13 (const int) +0:3 13 (const int) +0:7 Function Definition: @main(f1; ( temp 4-component vector of float) +0:7 Function Parameters: +0:7 'f' ( in float) +0:? Sequence +0:8 Branch: Return with expression +0:8 Construct vec4 ( temp 4-component vector of float) +0:8 'f' ( in float) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp float) +0:? 'f' ( temp float) +0:? 'f' (layout( location=0) in float) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main(f1; ( temp 4-component vector of float) +0:? 'f' ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'f' (layout( location=0) in float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 35 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 28 31 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "foo(" + Name 16 "@main(f1;" + Name 15 "f" + Name 26 "f" + Name 28 "f" + Name 31 "@entryPointOutput" + Name 32 "param" + Decorate 28(f) Location 0 + Decorate 31(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeVector 6(int) 3 + 8: TypeFunction 7(ivec3) + 11: TypeFloat 32 + 12: TypePointer Function 11(float) + 13: TypeVector 11(float) 4 + 14: TypeFunction 13(fvec4) 12(ptr) + 18: 6(int) Constant 13 + 19: 7(ivec3) ConstantComposite 18 18 18 + 27: TypePointer Input 11(float) + 28(f): 27(ptr) Variable Input + 30: TypePointer Output 13(fvec4) +31(@entryPointOutput): 30(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 26(f): 12(ptr) Variable Function + 32(param): 12(ptr) Variable Function + 29: 11(float) Load 28(f) + Store 26(f) 29 + 33: 11(float) Load 26(f) + Store 32(param) 33 + 34: 13(fvec4) FunctionCall 16(@main(f1;) 32(param) + Store 31(@entryPointOutput) 34 + Return + FunctionEnd + 9(foo(): 7(ivec3) Function None 8 + 10: Label + ReturnValue 19 + FunctionEnd + 16(@main(f1;): 13(fvec4) Function None 14 + 15(f): 12(ptr) FunctionParameter + 17: Label + 22: 11(float) Load 15(f) + 23: 13(fvec4) CompositeConstruct 22 22 22 22 + ReturnValue 23 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.shift.per-set.frag.out b/deps/glslang/Test/baseResults/hlsl.shift.per-set.frag.out new file mode 100644 index 00000000..7c7d3830 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.shift.per-set.frag.out @@ -0,0 +1,230 @@ +hlsl.shift.per-set.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:34 Function Definition: @main( ( temp 4-component vector of float) +0:34 Function Parameters: +0:? Sequence +0:35 't1' (layout( set=1 binding=1) uniform texture1D) +0:36 't2' (layout( set=1 binding=2) uniform texture2D) +0:37 't3' (layout( set=2 binding=1) uniform texture3D) +0:38 direct index (layout( row_major std430) buffer 4-component vector of float) +0:38 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of float) +0:38 't4' (layout( set=3 binding=1 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:38 Constant: +0:38 0 (const uint) +0:38 Constant: +0:38 0 (const int) +0:39 indirect index (layout( row_major std430) buffer uint) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:39 't5' (layout( set=3 binding=2 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 right-shift ( temp int) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 2 (const int) +0:40 't6' (layout( set=3 binding=3 rgba32f) uniform textureBuffer) +0:42 's1' (layout( set=1 binding=1) uniform sampler) +0:43 's2' (layout( set=2 binding=2) uniform sampler) +0:45 'u1' (layout( set=1 binding=1 rgba32f) uniform image1D) +0:46 'u2' (layout( set=2 binding=2 rgba32f) uniform image2D) +0:47 'u3' (layout( set=2 binding=3 rgba32f) uniform image3D) +0:49 imageLoad ( temp float) +0:49 'u4' (layout( set=1 binding=4 r32f) uniform imageBuffer) +0:49 Constant: +0:49 0 (const int) +0:50 indirect index (layout( row_major std430) buffer uint) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:50 'u5' (layout( set=2 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 right-shift ( temp int) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 2 (const int) +0:51 direct index (layout( row_major std430) buffer float) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:51 'u6' (layout( set=3 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 Constant: +0:51 0 (const int) +0:52 'u7' (layout( set=4 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:53 'u8' (layout( set=5 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:55 cb1: direct index for structure (layout( row_major std140) uniform int) +0:55 'anon@0' (layout( set=6 binding=1 row_major std140) uniform block{layout( row_major std140) uniform int cb1}) +0:55 Constant: +0:55 0 (const uint) +0:56 tb1: direct index for structure (layout( row_major std430) buffer int) +0:56 'anon@1' (layout( binding=7 row_major std430) readonly buffer block{layout( row_major std430) buffer int tb1}) +0:56 Constant: +0:56 0 (const uint) +0:57 'ts6' (layout( set=6 binding=1) uniform texture3D) +0:59 Branch: Return with expression +0:59 Constant: +0:59 0.000000 +0:59 0.000000 +0:59 0.000000 +0:59 0.000000 +0:34 Function Definition: main( ( temp void) +0:34 Function Parameters: +0:? Sequence +0:34 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:34 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 's1' (layout( set=1 binding=1) uniform sampler) +0:? 's2' (layout( set=2 binding=2) uniform sampler) +0:? 't1' (layout( set=1 binding=1) uniform texture1D) +0:? 't2' (layout( set=1 binding=2) uniform texture2D) +0:? 't3' (layout( set=2 binding=1) uniform texture3D) +0:? 'ts6' (layout( set=6 binding=1) uniform texture3D) +0:? 't4' (layout( set=3 binding=1 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 't5' (layout( set=3 binding=2 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? 't6' (layout( set=3 binding=3 rgba32f) uniform textureBuffer) +0:? 'u1' (layout( set=1 binding=1 rgba32f) uniform image1D) +0:? 'u2' (layout( set=2 binding=2 rgba32f) uniform image2D) +0:? 'u3' (layout( set=2 binding=3 rgba32f) uniform image3D) +0:? 'u4' (layout( set=1 binding=4 r32f) uniform imageBuffer) +0:? 'u5' (layout( set=2 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? 'u6' (layout( set=3 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:? 'u7' (layout( set=4 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:? 'u8' (layout( set=5 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:? 'anon@0' (layout( set=6 binding=1 row_major std140) uniform block{layout( row_major std140) uniform int cb1}) +0:? 'anon@1' (layout( binding=7 row_major std430) readonly buffer block{layout( row_major std430) buffer int tb1}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:34 Function Definition: @main( ( temp 4-component vector of float) +0:34 Function Parameters: +0:? Sequence +0:35 't1' (layout( set=1 binding=1) uniform texture1D) +0:36 't2' (layout( set=1 binding=2) uniform texture2D) +0:37 't3' (layout( set=2 binding=1) uniform texture3D) +0:38 direct index (layout( row_major std430) buffer 4-component vector of float) +0:38 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of float) +0:38 't4' (layout( set=3 binding=1 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:38 Constant: +0:38 0 (const uint) +0:38 Constant: +0:38 0 (const int) +0:39 indirect index (layout( row_major std430) buffer uint) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:39 't5' (layout( set=3 binding=2 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 right-shift ( temp int) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 2 (const int) +0:40 't6' (layout( set=3 binding=3 rgba32f) uniform textureBuffer) +0:42 's1' (layout( set=1 binding=1) uniform sampler) +0:43 's2' (layout( set=2 binding=2) uniform sampler) +0:45 'u1' (layout( set=1 binding=1 rgba32f) uniform image1D) +0:46 'u2' (layout( set=2 binding=2 rgba32f) uniform image2D) +0:47 'u3' (layout( set=2 binding=3 rgba32f) uniform image3D) +0:49 imageLoad ( temp float) +0:49 'u4' (layout( set=1 binding=4 r32f) uniform imageBuffer) +0:49 Constant: +0:49 0 (const int) +0:50 indirect index (layout( row_major std430) buffer uint) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:50 'u5' (layout( set=2 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 right-shift ( temp int) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 2 (const int) +0:51 direct index (layout( row_major std430) buffer float) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:51 'u6' (layout( set=3 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 Constant: +0:51 0 (const int) +0:52 'u7' (layout( set=4 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:53 'u8' (layout( set=5 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:55 cb1: direct index for structure (layout( row_major std140) uniform int) +0:55 'anon@0' (layout( set=6 binding=1 row_major std140) uniform block{layout( row_major std140) uniform int cb1}) +0:55 Constant: +0:55 0 (const uint) +0:56 tb1: direct index for structure (layout( row_major std430) buffer int) +0:56 'anon@1' (layout( binding=7 row_major std430) readonly buffer block{layout( row_major std430) buffer int tb1}) +0:56 Constant: +0:56 0 (const uint) +0:57 'ts6' (layout( set=6 binding=1) uniform texture3D) +0:59 Branch: Return with expression +0:59 Constant: +0:59 0.000000 +0:59 0.000000 +0:59 0.000000 +0:59 0.000000 +0:34 Function Definition: main( ( temp void) +0:34 Function Parameters: +0:? Sequence +0:34 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:34 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 's1' (layout( set=1 binding=1) uniform sampler) +0:? 's2' (layout( set=2 binding=2) uniform sampler) +0:? 't1' (layout( set=1 binding=1) uniform texture1D) +0:? 't2' (layout( set=1 binding=2) uniform texture2D) +0:? 't3' (layout( set=2 binding=1) uniform texture3D) +0:? 'ts6' (layout( set=6 binding=1) uniform texture3D) +0:? 't4' (layout( set=3 binding=1 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 't5' (layout( set=3 binding=2 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? 't6' (layout( set=3 binding=3 rgba32f) uniform textureBuffer) +0:? 'u1' (layout( set=1 binding=1 rgba32f) uniform image1D) +0:? 'u2' (layout( set=2 binding=2 rgba32f) uniform image2D) +0:? 'u3' (layout( set=2 binding=3 rgba32f) uniform image3D) +0:? 'u4' (layout( set=1 binding=4 r32f) uniform imageBuffer) +0:? 'u5' (layout( set=2 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? 'u6' (layout( set=3 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:? 'u7' (layout( set=4 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:? 'u8' (layout( set=5 binding=4 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:? 'anon@0' (layout( set=6 binding=1 row_major std140) uniform block{layout( row_major std140) uniform int cb1}) +0:? 'anon@1' (layout( binding=7 row_major std430) readonly buffer block{layout( row_major std430) buffer int tb1}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +Uniform reflection: +t1: offset -1, type 8b5d, size 1, index -1, binding 21, stages 16 +t2: offset -1, type 8b5e, size 1, index -1, binding 22, stages 16 +t3: offset -1, type 8b5f, size 1, index -1, binding 26, stages 16 +t4.@data: offset 0, type 8b52, size 1, index 0, binding -1, stages 16 +t5.@data: offset 0, type 1405, size 0, index 1, binding -1, stages 16 +t6: offset -1, type 8dc2, size 1, index -1, binding 23, stages 16 +s1: offset -1, type 0, size 1, index -1, binding 11, stages 16 +s2: offset -1, type 0, size 1, index -1, binding 17, stages 16 +u1: offset -1, type 904c, size 1, index -1, binding 31, stages 16 +u2: offset -1, type 904d, size 1, index -1, binding 42, stages 16 +u3: offset -1, type 904e, size 1, index -1, binding 43, stages 16 +u4: offset -1, type 9051, size 1, index -1, binding 34, stages 16 +u5.@data: offset 0, type 1405, size 0, index 2, binding -1, stages 16 +u6.@data: offset 0, type 1406, size 1, index 3, binding -1, stages 16 +cb1: offset 0, type 1404, size 1, index 4, binding -1, stages 16 +tb1: offset 0, type 1404, size 1, index 5, binding -1, stages 16 +ts6: offset -1, type 8b5f, size 1, index -1, binding 71, stages 16 + +Uniform block reflection: +t4: offset -1, type ffffffff, size 0, index -1, binding 21, stages 0 +t5: offset -1, type ffffffff, size 0, index -1, binding 22, stages 0 +u5: offset -1, type ffffffff, size 0, index -1, binding 44, stages 0 +u6: offset -1, type ffffffff, size 0, index -1, binding 34, stages 0 +cb: offset -1, type ffffffff, size 4, index -1, binding 51, stages 0 +tb: offset -1, type ffffffff, size 4, index -1, binding 27, stages 0 + +Vertex attribute reflection: + diff --git a/deps/glslang/Test/baseResults/hlsl.sin.frag.out b/deps/glslang/Test/baseResults/hlsl.sin.frag.out new file mode 100644 index 00000000..b92085e4 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.sin.frag.out @@ -0,0 +1,101 @@ +hlsl.sin.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' ( in 4-component vector of float) +0:? Sequence +0:3 Branch: Return with expression +0:3 sine ( temp 4-component vector of float) +0:3 'input' ( in 4-component vector of float) +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' ( in 4-component vector of float) +0:? Sequence +0:3 Branch: Return with expression +0:3 sine ( temp 4-component vector of float) +0:3 'input' ( in 4-component vector of float) +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 26 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 19 22 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 11 "@PixelShaderFunction(vf4;" + Name 10 "input" + Name 17 "input" + Name 19 "input" + Name 22 "@entryPointOutput" + Name 23 "param" + Decorate 19(input) Location 0 + Decorate 22(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) + 18: TypePointer Input 7(fvec4) + 19(input): 18(ptr) Variable Input + 21: TypePointer Output 7(fvec4) +22(@entryPointOutput): 21(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 17(input): 8(ptr) Variable Function + 23(param): 8(ptr) Variable Function + 20: 7(fvec4) Load 19(input) + Store 17(input) 20 + 24: 7(fvec4) Load 17(input) + Store 23(param) 24 + 25: 7(fvec4) FunctionCall 11(@PixelShaderFunction(vf4;) 23(param) + Store 22(@entryPointOutput) 25 + Return + FunctionEnd +11(@PixelShaderFunction(vf4;): 7(fvec4) Function None 9 + 10(input): 8(ptr) FunctionParameter + 12: Label + 13: 7(fvec4) Load 10(input) + 14: 7(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 13 + ReturnValue 14 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.snorm.uav.comp.out b/deps/glslang/Test/baseResults/hlsl.snorm.uav.comp.out new file mode 100644 index 00000000..2d6dae7c --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.snorm.uav.comp.out @@ -0,0 +1,212 @@ +hlsl.snorm.uav.comp +Shader version: 500 +local_size = (16, 16, 1) +0:? Sequence +0:12 Function Definition: @main(vu3; ( temp void) +0:12 Function Parameters: +0:12 'tid' ( in 3-component vector of uint) +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 'storeTemp' ( temp 4-component vector of float) +0:13 add ( temp 4-component vector of float) +0:13 textureFetch ( temp 4-component vector of float) +0:13 'ResultInS' (layout( binding=1) uniform texture3D) +0:13 'tid' ( in 3-component vector of uint) +0:13 Constant: +0:13 0 (const int) +0:13 uf4: direct index for structure ( uniform 4-component vector of float) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float uf4}) +0:13 Constant: +0:13 0 (const uint) +0:13 imageStore ( temp void) +0:13 'ResultOutS' (layout( binding=1 rgba32f) uniform image3D) +0:13 'tid' ( in 3-component vector of uint) +0:13 'storeTemp' ( temp 4-component vector of float) +0:13 'storeTemp' ( temp 4-component vector of float) +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 'storeTemp' ( temp 4-component vector of float) +0:14 textureFetch ( temp 4-component vector of float) +0:14 'ResultInU' (layout( binding=0) uniform texture3D) +0:14 'tid' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 imageStore ( temp void) +0:14 'ResultOutU' (layout( binding=0 rgba32f) uniform image3D) +0:14 'tid' ( in 3-component vector of uint) +0:14 'storeTemp' ( temp 4-component vector of float) +0:14 'storeTemp' ( temp 4-component vector of float) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp 3-component vector of uint) +0:? 'tid' ( temp 3-component vector of uint) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) +0:12 Function Call: @main(vu3; ( temp void) +0:? 'tid' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float uf4}) +0:? 'ResultInU' (layout( binding=0) uniform texture3D) +0:? 'ResultOutU' (layout( binding=0 rgba32f) uniform image3D) +0:? 'ResultInS' (layout( binding=1) uniform texture3D) +0:? 'ResultOutS' (layout( binding=1 rgba32f) uniform image3D) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (16, 16, 1) +0:? Sequence +0:12 Function Definition: @main(vu3; ( temp void) +0:12 Function Parameters: +0:12 'tid' ( in 3-component vector of uint) +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 'storeTemp' ( temp 4-component vector of float) +0:13 add ( temp 4-component vector of float) +0:13 textureFetch ( temp 4-component vector of float) +0:13 'ResultInS' (layout( binding=1) uniform texture3D) +0:13 'tid' ( in 3-component vector of uint) +0:13 Constant: +0:13 0 (const int) +0:13 uf4: direct index for structure ( uniform 4-component vector of float) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float uf4}) +0:13 Constant: +0:13 0 (const uint) +0:13 imageStore ( temp void) +0:13 'ResultOutS' (layout( binding=1 rgba32f) uniform image3D) +0:13 'tid' ( in 3-component vector of uint) +0:13 'storeTemp' ( temp 4-component vector of float) +0:13 'storeTemp' ( temp 4-component vector of float) +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 'storeTemp' ( temp 4-component vector of float) +0:14 textureFetch ( temp 4-component vector of float) +0:14 'ResultInU' (layout( binding=0) uniform texture3D) +0:14 'tid' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 imageStore ( temp void) +0:14 'ResultOutU' (layout( binding=0 rgba32f) uniform image3D) +0:14 'tid' ( in 3-component vector of uint) +0:14 'storeTemp' ( temp 4-component vector of float) +0:14 'storeTemp' ( temp 4-component vector of float) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp 3-component vector of uint) +0:? 'tid' ( temp 3-component vector of uint) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) +0:12 Function Call: @main(vu3; ( temp void) +0:? 'tid' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float uf4}) +0:? 'ResultInU' (layout( binding=0) uniform texture3D) +0:? 'ResultOutU' (layout( binding=0 rgba32f) uniform image3D) +0:? 'ResultInS' (layout( binding=1) uniform texture3D) +0:? 'ResultOutS' (layout( binding=1 rgba32f) uniform image3D) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 54 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 49 + ExecutionMode 4 LocalSize 16 16 1 + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vu3;" + Name 10 "tid" + Name 16 "storeTemp" + Name 19 "ResultInS" + Name 25 "$Global" + MemberName 25($Global) 0 "uf4" + Name 27 "" + Name 34 "ResultOutS" + Name 38 "storeTemp" + Name 39 "ResultInU" + Name 43 "ResultOutU" + Name 47 "tid" + Name 49 "tid" + Name 51 "param" + Decorate 19(ResultInS) DescriptorSet 0 + Decorate 19(ResultInS) Binding 1 + MemberDecorate 25($Global) 0 Offset 0 + Decorate 25($Global) Block + Decorate 27 DescriptorSet 0 + Decorate 34(ResultOutS) DescriptorSet 0 + Decorate 34(ResultOutS) Binding 1 + Decorate 39(ResultInU) DescriptorSet 0 + Decorate 39(ResultInU) Binding 0 + Decorate 43(ResultOutU) DescriptorSet 0 + Decorate 43(ResultOutU) Binding 0 + Decorate 49(tid) BuiltIn GlobalInvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 9: TypeFunction 2 8(ptr) + 13: TypeFloat 32 + 14: TypeVector 13(float) 4 + 15: TypePointer Function 14(fvec4) + 17: TypeImage 13(float) 3D sampled format:Unknown + 18: TypePointer UniformConstant 17 + 19(ResultInS): 18(ptr) Variable UniformConstant + 22: TypeInt 32 1 + 23: 22(int) Constant 0 + 25($Global): TypeStruct 14(fvec4) + 26: TypePointer Uniform 25($Global) + 27: 26(ptr) Variable Uniform + 28: TypePointer Uniform 14(fvec4) + 32: TypeImage 13(float) 3D nonsampled format:Rgba32f + 33: TypePointer UniformConstant 32 + 34(ResultOutS): 33(ptr) Variable UniformConstant + 39(ResultInU): 18(ptr) Variable UniformConstant + 43(ResultOutU): 33(ptr) Variable UniformConstant + 48: TypePointer Input 7(ivec3) + 49(tid): 48(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 47(tid): 8(ptr) Variable Function + 51(param): 8(ptr) Variable Function + 50: 7(ivec3) Load 49(tid) + Store 47(tid) 50 + 52: 7(ivec3) Load 47(tid) + Store 51(param) 52 + 53: 2 FunctionCall 11(@main(vu3;) 51(param) + Return + FunctionEnd + 11(@main(vu3;): 2 Function None 9 + 10(tid): 8(ptr) FunctionParameter + 12: Label + 16(storeTemp): 15(ptr) Variable Function + 38(storeTemp): 15(ptr) Variable Function + 20: 17 Load 19(ResultInS) + 21: 7(ivec3) Load 10(tid) + 24: 14(fvec4) ImageFetch 20 21 Lod 23 + 29: 28(ptr) AccessChain 27 23 + 30: 14(fvec4) Load 29 + 31: 14(fvec4) FAdd 24 30 + Store 16(storeTemp) 31 + 35: 32 Load 34(ResultOutS) + 36: 7(ivec3) Load 10(tid) + 37: 14(fvec4) Load 16(storeTemp) + ImageWrite 35 36 37 + 40: 17 Load 39(ResultInU) + 41: 7(ivec3) Load 10(tid) + 42: 14(fvec4) ImageFetch 40 41 Lod 23 + Store 38(storeTemp) 42 + 44: 32 Load 43(ResultOutU) + 45: 7(ivec3) Load 10(tid) + 46: 14(fvec4) Load 38(storeTemp) + ImageWrite 44 45 46 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.staticFuncInit.frag.out b/deps/glslang/Test/baseResults/hlsl.staticFuncInit.frag.out new file mode 100644 index 00000000..d468cec3 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.staticFuncInit.frag.out @@ -0,0 +1,218 @@ +hlsl.staticFuncInit.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:12Sequence +0:1 Sequence +0:1 move second child to first child ( temp float) +0:1 'x' ( global float) +0:1 Constant: +0:1 1.000000 +0:5 Sequence +0:5 move second child to first child ( temp float) +0:5 'x' ( global float) +0:5 Constant: +0:5 2.000000 +0:4 Function Definition: f1( ( temp float) +0:4 Function Parameters: +0:? Sequence +0:6 add second child into first child ( temp float) +0:6 'x' ( global float) +0:6 Constant: +0:6 10.000000 +0:7 Branch: Return with expression +0:7 'x' ( global float) +0:12 Sequence +0:12 move second child to first child ( temp float) +0:12 'x' ( global float) +0:12 Constant: +0:12 7.000000 +0:11 Function Definition: f2(f1; ( temp float) +0:11 Function Parameters: +0:11 'p' ( in float) +0:? Sequence +0:13 add second child into first child ( temp float) +0:13 'x' ( global float) +0:13 'p' ( in float) +0:14 Branch: Return with expression +0:14 'x' ( global float) +0:18 Function Definition: @main( ( temp 4-component vector of float) +0:18 Function Parameters: +0:? Sequence +0:19 Branch: Return with expression +0:19 Construct vec4 ( temp 4-component vector of float) +0:19 add ( temp float) +0:19 add ( temp float) +0:19 add ( temp float) +0:19 add ( temp float) +0:19 'x' ( global float) +0:19 Function Call: f1( ( temp float) +0:19 Function Call: f1( ( temp float) +0:19 Function Call: f2(f1; ( temp float) +0:19 Constant: +0:19 5.000000 +0:19 Function Call: f2(f1; ( temp float) +0:19 'x' ( global float) +0:18 Function Definition: main( ( temp void) +0:18 Function Parameters: +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:18 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'x' ( global float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:12Sequence +0:1 Sequence +0:1 move second child to first child ( temp float) +0:1 'x' ( global float) +0:1 Constant: +0:1 1.000000 +0:5 Sequence +0:5 move second child to first child ( temp float) +0:5 'x' ( global float) +0:5 Constant: +0:5 2.000000 +0:4 Function Definition: f1( ( temp float) +0:4 Function Parameters: +0:? Sequence +0:6 add second child into first child ( temp float) +0:6 'x' ( global float) +0:6 Constant: +0:6 10.000000 +0:7 Branch: Return with expression +0:7 'x' ( global float) +0:12 Sequence +0:12 move second child to first child ( temp float) +0:12 'x' ( global float) +0:12 Constant: +0:12 7.000000 +0:11 Function Definition: f2(f1; ( temp float) +0:11 Function Parameters: +0:11 'p' ( in float) +0:? Sequence +0:13 add second child into first child ( temp float) +0:13 'x' ( global float) +0:13 'p' ( in float) +0:14 Branch: Return with expression +0:14 'x' ( global float) +0:18 Function Definition: @main( ( temp 4-component vector of float) +0:18 Function Parameters: +0:? Sequence +0:19 Branch: Return with expression +0:19 Construct vec4 ( temp 4-component vector of float) +0:19 add ( temp float) +0:19 add ( temp float) +0:19 add ( temp float) +0:19 add ( temp float) +0:19 'x' ( global float) +0:19 Function Call: f1( ( temp float) +0:19 Function Call: f1( ( temp float) +0:19 Function Call: f2(f1; ( temp float) +0:19 Constant: +0:19 5.000000 +0:19 Function Call: f2(f1; ( temp float) +0:19 'x' ( global float) +0:18 Function Definition: main( ( temp void) +0:18 Function Parameters: +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:18 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'x' ( global float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 57 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 55 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "f1(" + Name 13 "f2(f1;" + Name 12 "p" + Name 17 "@main(" + Name 20 "x" + Name 22 "x" + Name 24 "x" + Name 44 "param" + Name 47 "param" + Name 55 "@entryPointOutput" + Decorate 55(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeFunction 6(float) + 10: TypePointer Function 6(float) + 11: TypeFunction 6(float) 10(ptr) + 15: TypeVector 6(float) 4 + 16: TypeFunction 15(fvec4) + 19: TypePointer Private 6(float) + 20(x): 19(ptr) Variable Private + 21: 6(float) Constant 1065353216 + 22(x): 19(ptr) Variable Private + 23: 6(float) Constant 1073741824 + 24(x): 19(ptr) Variable Private + 25: 6(float) Constant 1088421888 + 26: 6(float) Constant 1092616192 + 43: 6(float) Constant 1084227584 + 54: TypePointer Output 15(fvec4) +55(@entryPointOutput): 54(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + Store 20(x) 21 + Store 22(x) 23 + Store 24(x) 25 + 56: 15(fvec4) FunctionCall 17(@main() + Store 55(@entryPointOutput) 56 + Return + FunctionEnd + 8(f1(): 6(float) Function None 7 + 9: Label + 27: 6(float) Load 22(x) + 28: 6(float) FAdd 27 26 + Store 22(x) 28 + 29: 6(float) Load 22(x) + ReturnValue 29 + FunctionEnd + 13(f2(f1;): 6(float) Function None 11 + 12(p): 10(ptr) FunctionParameter + 14: Label + 32: 6(float) Load 12(p) + 33: 6(float) Load 24(x) + 34: 6(float) FAdd 33 32 + Store 24(x) 34 + 35: 6(float) Load 24(x) + ReturnValue 35 + FunctionEnd + 17(@main(): 15(fvec4) Function None 16 + 18: Label + 44(param): 10(ptr) Variable Function + 47(param): 10(ptr) Variable Function + 38: 6(float) Load 20(x) + 39: 6(float) FunctionCall 8(f1() + 40: 6(float) FAdd 38 39 + 41: 6(float) FunctionCall 8(f1() + 42: 6(float) FAdd 40 41 + Store 44(param) 43 + 45: 6(float) FunctionCall 13(f2(f1;) 44(param) + 46: 6(float) FAdd 42 45 + 48: 6(float) Load 20(x) + Store 47(param) 48 + 49: 6(float) FunctionCall 13(f2(f1;) 47(param) + 50: 6(float) FAdd 46 49 + 51: 15(fvec4) CompositeConstruct 50 50 50 50 + ReturnValue 51 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.staticMemberFunction.frag.out b/deps/glslang/Test/baseResults/hlsl.staticMemberFunction.frag.out new file mode 100644 index 00000000..2c7e4180 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.staticMemberFunction.frag.out @@ -0,0 +1,200 @@ +hlsl.staticMemberFunction.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: Test::staticMemFun(vf4; ( global 4-component vector of float) +0:5 Function Parameters: +0:5 'a' ( in 4-component vector of float) +0:? Sequence +0:6 Branch: Return with expression +0:6 vector-scale ( temp 4-component vector of float) +0:6 Constant: +0:6 2.000000 +0:6 'a' ( in 4-component vector of float) +0:9 Function Definition: Test::staticMemFun(i1; ( global int) +0:9 Function Parameters: +0:9 'a' ( in int) +0:? Sequence +0:10 Branch: Return with expression +0:10 add ( temp int) +0:10 Constant: +0:10 2 (const int) +0:10 'a' ( in int) +0:16 Function Definition: @main( ( temp 4-component vector of float) +0:16 Function Parameters: +0:? Sequence +0:18 Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:18 'f4' ( temp 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 1.000000 +0:? 1.000000 +0:? 1.000000 +0:19 add second child into first child ( temp 4-component vector of float) +0:19 'f4' ( temp 4-component vector of float) +0:19 Function Call: Test::staticMemFun(vf4; ( global 4-component vector of float) +0:? Constant: +0:? 5.000000 +0:? 5.000000 +0:? 5.000000 +0:? 5.000000 +0:20 add second child into first child ( temp 4-component vector of float) +0:20 'f4' ( temp 4-component vector of float) +0:20 Convert int to float ( temp float) +0:20 Function Call: Test::staticMemFun(i1; ( global int) +0:20 Constant: +0:20 7 (const int) +0:21 Branch: Return with expression +0:21 'f4' ( temp 4-component vector of float) +0:16 Function Definition: main( ( temp void) +0:16 Function Parameters: +0:? Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:16 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: Test::staticMemFun(vf4; ( global 4-component vector of float) +0:5 Function Parameters: +0:5 'a' ( in 4-component vector of float) +0:? Sequence +0:6 Branch: Return with expression +0:6 vector-scale ( temp 4-component vector of float) +0:6 Constant: +0:6 2.000000 +0:6 'a' ( in 4-component vector of float) +0:9 Function Definition: Test::staticMemFun(i1; ( global int) +0:9 Function Parameters: +0:9 'a' ( in int) +0:? Sequence +0:10 Branch: Return with expression +0:10 add ( temp int) +0:10 Constant: +0:10 2 (const int) +0:10 'a' ( in int) +0:16 Function Definition: @main( ( temp 4-component vector of float) +0:16 Function Parameters: +0:? Sequence +0:18 Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:18 'f4' ( temp 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 1.000000 +0:? 1.000000 +0:? 1.000000 +0:19 add second child into first child ( temp 4-component vector of float) +0:19 'f4' ( temp 4-component vector of float) +0:19 Function Call: Test::staticMemFun(vf4; ( global 4-component vector of float) +0:? Constant: +0:? 5.000000 +0:? 5.000000 +0:? 5.000000 +0:? 5.000000 +0:20 add second child into first child ( temp 4-component vector of float) +0:20 'f4' ( temp 4-component vector of float) +0:20 Convert int to float ( temp float) +0:20 Function Call: Test::staticMemFun(i1; ( global int) +0:20 Constant: +0:20 7 (const int) +0:21 Branch: Return with expression +0:21 'f4' ( temp 4-component vector of float) +0:16 Function Definition: main( ( temp void) +0:16 Function Parameters: +0:? Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:16 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 54 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 52 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "Test::staticMemFun(vf4;" + Name 10 "a" + Name 17 "Test::staticMemFun(i1;" + Name 16 "a" + Name 20 "@main(" + Name 32 "f4" + Name 37 "param" + Name 42 "param" + Name 52 "@entryPointOutput" + Decorate 52(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) + 13: TypeInt 32 1 + 14: TypePointer Function 13(int) + 15: TypeFunction 13(int) 14(ptr) + 19: TypeFunction 7(fvec4) + 22: 6(float) Constant 1073741824 + 27: 13(int) Constant 2 + 33: 6(float) Constant 1065353216 + 34: 7(fvec4) ConstantComposite 33 33 33 33 + 35: 6(float) Constant 1084227584 + 36: 7(fvec4) ConstantComposite 35 35 35 35 + 41: 13(int) Constant 7 + 51: TypePointer Output 7(fvec4) +52(@entryPointOutput): 51(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 53: 7(fvec4) FunctionCall 20(@main() + Store 52(@entryPointOutput) 53 + Return + FunctionEnd +11(Test::staticMemFun(vf4;): 7(fvec4) Function None 9 + 10(a): 8(ptr) FunctionParameter + 12: Label + 23: 7(fvec4) Load 10(a) + 24: 7(fvec4) VectorTimesScalar 23 22 + ReturnValue 24 + FunctionEnd +17(Test::staticMemFun(i1;): 13(int) Function None 15 + 16(a): 14(ptr) FunctionParameter + 18: Label + 28: 13(int) Load 16(a) + 29: 13(int) IAdd 27 28 + ReturnValue 29 + FunctionEnd + 20(@main(): 7(fvec4) Function None 19 + 21: Label + 32(f4): 8(ptr) Variable Function + 37(param): 8(ptr) Variable Function + 42(param): 14(ptr) Variable Function + Store 32(f4) 34 + Store 37(param) 36 + 38: 7(fvec4) FunctionCall 11(Test::staticMemFun(vf4;) 37(param) + 39: 7(fvec4) Load 32(f4) + 40: 7(fvec4) FAdd 39 38 + Store 32(f4) 40 + Store 42(param) 41 + 43: 13(int) FunctionCall 17(Test::staticMemFun(i1;) 42(param) + 44: 6(float) ConvertSToF 43 + 45: 7(fvec4) Load 32(f4) + 46: 7(fvec4) CompositeConstruct 44 44 44 44 + 47: 7(fvec4) FAdd 45 46 + Store 32(f4) 47 + 48: 7(fvec4) Load 32(f4) + ReturnValue 48 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.store.rwbyteaddressbuffer.type.comp.out b/deps/glslang/Test/baseResults/hlsl.store.rwbyteaddressbuffer.type.comp.out new file mode 100644 index 00000000..6436db7c --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.store.rwbyteaddressbuffer.type.comp.out @@ -0,0 +1,173 @@ +hlsl.store.rwbyteaddressbuffer.type.comp +Shader version: 500 +local_size = (64, 1, 1) +0:? Sequence +0:5 Function Definition: @main(vu3; ( temp void) +0:5 Function Parameters: +0:5 'dispatchThreadID' ( in 3-component vector of uint) +0:? Sequence +0:6 Test condition and select ( temp void) +0:6 Condition +0:6 Compare Equal ( temp bool) +0:6 direct index ( temp uint) +0:6 'dispatchThreadID' ( in 3-component vector of uint) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0 (const uint) +0:6 true case +0:? Sequence +0:7 move second child to first child ( temp int) +0:7 'byteAddrTemp' ( temp int) +0:7 right-shift ( temp int) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 2 (const int) +0:7 move second child to first child ( temp uint) +0:7 indirect index (layout( row_major std430) buffer uint) +0:7 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:7 'buffer' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:7 Constant: +0:7 0 (const uint) +0:7 'byteAddrTemp' ( temp int) +0:7 Constant: +0:7 2 (const uint) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 3-component vector of uint) +0:? 'dispatchThreadID' ( temp 3-component vector of uint) +0:? 'dispatchThreadID' ( in 3-component vector of uint GlobalInvocationID) +0:5 Function Call: @main(vu3; ( temp void) +0:? 'dispatchThreadID' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'buffer' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? 'dispatchThreadID' ( in 3-component vector of uint GlobalInvocationID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (64, 1, 1) +0:? Sequence +0:5 Function Definition: @main(vu3; ( temp void) +0:5 Function Parameters: +0:5 'dispatchThreadID' ( in 3-component vector of uint) +0:? Sequence +0:6 Test condition and select ( temp void) +0:6 Condition +0:6 Compare Equal ( temp bool) +0:6 direct index ( temp uint) +0:6 'dispatchThreadID' ( in 3-component vector of uint) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0 (const uint) +0:6 true case +0:? Sequence +0:7 move second child to first child ( temp int) +0:7 'byteAddrTemp' ( temp int) +0:7 right-shift ( temp int) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 2 (const int) +0:7 move second child to first child ( temp uint) +0:7 indirect index (layout( row_major std430) buffer uint) +0:7 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:7 'buffer' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:7 Constant: +0:7 0 (const uint) +0:7 'byteAddrTemp' ( temp int) +0:7 Constant: +0:7 2 (const uint) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 3-component vector of uint) +0:? 'dispatchThreadID' ( temp 3-component vector of uint) +0:? 'dispatchThreadID' ( in 3-component vector of uint GlobalInvocationID) +0:5 Function Call: @main(vu3; ( temp void) +0:? 'dispatchThreadID' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'buffer' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? 'dispatchThreadID' ( in 3-component vector of uint GlobalInvocationID) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 42 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 37 + ExecutionMode 4 LocalSize 64 1 1 + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vu3;" + Name 10 "dispatchThreadID" + Name 23 "byteAddrTemp" + Name 28 "buffer" + MemberName 28(buffer) 0 "@data" + Name 30 "buffer" + Name 35 "dispatchThreadID" + Name 37 "dispatchThreadID" + Name 39 "param" + Decorate 27 ArrayStride 4 + MemberDecorate 28(buffer) 0 Offset 0 + Decorate 28(buffer) BufferBlock + Decorate 30(buffer) DescriptorSet 0 + Decorate 37(dispatchThreadID) BuiltIn GlobalInvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 9: TypeFunction 2 8(ptr) + 13: 6(int) Constant 0 + 14: TypePointer Function 6(int) + 17: TypeBool + 21: TypeInt 32 1 + 22: TypePointer Function 21(int) + 24: 21(int) Constant 0 + 25: 21(int) Constant 2 + 27: TypeRuntimeArray 6(int) + 28(buffer): TypeStruct 27 + 29: TypePointer Uniform 28(buffer) + 30(buffer): 29(ptr) Variable Uniform + 32: 6(int) Constant 2 + 33: TypePointer Uniform 6(int) + 36: TypePointer Input 7(ivec3) +37(dispatchThreadID): 36(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label +35(dispatchThreadID): 8(ptr) Variable Function + 39(param): 8(ptr) Variable Function + 38: 7(ivec3) Load 37(dispatchThreadID) + Store 35(dispatchThreadID) 38 + 40: 7(ivec3) Load 35(dispatchThreadID) + Store 39(param) 40 + 41: 2 FunctionCall 11(@main(vu3;) 39(param) + Return + FunctionEnd + 11(@main(vu3;): 2 Function None 9 +10(dispatchThreadID): 8(ptr) FunctionParameter + 12: Label +23(byteAddrTemp): 22(ptr) Variable Function + 15: 14(ptr) AccessChain 10(dispatchThreadID) 13 + 16: 6(int) Load 15 + 18: 17(bool) IEqual 16 13 + SelectionMerge 20 None + BranchConditional 18 19 20 + 19: Label + 26: 21(int) ShiftRightArithmetic 24 25 + Store 23(byteAddrTemp) 26 + 31: 21(int) Load 23(byteAddrTemp) + 34: 33(ptr) AccessChain 30(buffer) 24 31 + Store 34 32 + Branch 20 + 20: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.string.frag.out b/deps/glslang/Test/baseResults/hlsl.string.frag.out new file mode 100644 index 00000000..9181b933 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.string.frag.out @@ -0,0 +1,97 @@ +hlsl.string.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:10 Function Definition: @main(f1; ( temp float) +0:10 Function Parameters: +0:10 'f' ( in float) +0:? Sequence +0:11 Branch: Return with expression +0:11 'f' ( in float) +0:10 Function Definition: main( ( temp void) +0:10 Function Parameters: +0:? Sequence +0:10 move second child to first child ( temp float) +0:? 'f' ( temp float) +0:? 'f' (layout( location=0) in float) +0:10 move second child to first child ( temp float) +0:? '@entryPointOutput' (layout( location=0) out float) +0:10 Function Call: @main(f1; ( temp float) +0:? 'f' ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out float) +0:? 'f' (layout( location=0) in float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:10 Function Definition: @main(f1; ( temp float) +0:10 Function Parameters: +0:10 'f' ( in float) +0:? Sequence +0:11 Branch: Return with expression +0:11 'f' ( in float) +0:10 Function Definition: main( ( temp void) +0:10 Function Parameters: +0:? Sequence +0:10 move second child to first child ( temp float) +0:? 'f' ( temp float) +0:? 'f' (layout( location=0) in float) +0:10 move second child to first child ( temp float) +0:? '@entryPointOutput' (layout( location=0) out float) +0:10 Function Call: @main(f1; ( temp float) +0:? 'f' ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out float) +0:? 'f' (layout( location=0) in float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 24 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 17 20 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 10 "@main(f1;" + Name 9 "f" + Name 15 "f" + Name 17 "f" + Name 20 "@entryPointOutput" + Name 21 "param" + Decorate 17(f) Location 0 + Decorate 20(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeFunction 6(float) 7(ptr) + 16: TypePointer Input 6(float) + 17(f): 16(ptr) Variable Input + 19: TypePointer Output 6(float) +20(@entryPointOutput): 19(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 15(f): 7(ptr) Variable Function + 21(param): 7(ptr) Variable Function + 18: 6(float) Load 17(f) + Store 15(f) 18 + 22: 6(float) Load 15(f) + Store 21(param) 22 + 23: 6(float) FunctionCall 10(@main(f1;) 21(param) + Store 20(@entryPointOutput) 23 + Return + FunctionEnd + 10(@main(f1;): 6(float) Function None 8 + 9(f): 7(ptr) FunctionParameter + 11: Label + 12: 6(float) Load 9(f) + ReturnValue 12 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.stringtoken.frag.out b/deps/glslang/Test/baseResults/hlsl.stringtoken.frag.out new file mode 100644 index 00000000..82033cf3 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.stringtoken.frag.out @@ -0,0 +1,132 @@ +hlsl.stringtoken.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:16 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:16 Function Parameters: +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:18 Color: direct index for structure ( temp 4-component vector of float) +0:18 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:18 Constant: +0:18 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 1.000000 +0:19 Branch: Return with expression +0:19 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:16 Function Definition: main( ( temp void) +0:16 Function Parameters: +0:? Sequence +0:16 Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:16 Color: direct index for structure ( temp 4-component vector of float) +0:16 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:16 Constant: +0:16 0 (const int) +0:? Linker Objects +0:? 'TestTexture' ( uniform texture2D) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float TestUF}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:16 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:16 Function Parameters: +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:18 Color: direct index for structure ( temp 4-component vector of float) +0:18 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:18 Constant: +0:18 0 (const int) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 1.000000 +0:19 Branch: Return with expression +0:19 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:16 Function Definition: main( ( temp void) +0:16 Function Parameters: +0:? Sequence +0:16 Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:16 Color: direct index for structure ( temp 4-component vector of float) +0:16 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:16 Constant: +0:16 0 (const int) +0:? Linker Objects +0:? 'TestTexture' ( uniform texture2D) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float TestUF}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 34 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 25 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + Name 10 "@main(" + Name 13 "psout" + Name 25 "@entryPointOutput.Color" + Name 30 "TestTexture" + Name 31 "$Global" + MemberName 31($Global) 0 "TestUF" + Name 33 "" + Decorate 25(@entryPointOutput.Color) Location 0 + Decorate 30(TestTexture) DescriptorSet 0 + MemberDecorate 31($Global) 0 Offset 0 + Decorate 31($Global) Block + Decorate 33 DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 8(PS_OUTPUT) + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16: 6(float) Constant 0 + 17: 6(float) Constant 1065353216 + 18: 7(fvec4) ConstantComposite 16 16 16 17 + 19: TypePointer Function 7(fvec4) + 24: TypePointer Output 7(fvec4) +25(@entryPointOutput.Color): 24(ptr) Variable Output + 28: TypeImage 6(float) 2D sampled format:Unknown + 29: TypePointer UniformConstant 28 + 30(TestTexture): 29(ptr) Variable UniformConstant + 31($Global): TypeStruct 7(fvec4) + 32: TypePointer Uniform 31($Global) + 33: 32(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + 26:8(PS_OUTPUT) FunctionCall 10(@main() + 27: 7(fvec4) CompositeExtract 26 0 + Store 25(@entryPointOutput.Color) 27 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(psout): 12(ptr) Variable Function + 20: 19(ptr) AccessChain 13(psout) 15 + Store 20 18 + 21:8(PS_OUTPUT) Load 13(psout) + ReturnValue 21 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.struct.frag.out b/deps/glslang/Test/baseResults/hlsl.struct.frag.out new file mode 100644 index 00000000..4ea7bbbd --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.struct.frag.out @@ -0,0 +1,417 @@ +hlsl.struct.frag +WARNING: 0:26: 'register' : ignoring shader_profile +WARNING: 0:27: 'register' : ignoring shader_profile +WARNING: 0:30: 'register' : ignoring shader_profile + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:40 Function Definition: @PixelShaderFunction(vf4;struct-IN_S-vf4-b1-vf1-vf2-b1-b1-b1-vf41; ( temp 4-component vector of float) +0:40 Function Parameters: +0:40 'input' ( in 4-component vector of float) +0:40 's' ( in structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:? Sequence +0:45 Compare Equal ( temp bool) +0:45 's3' ( temp structure{ temp 3-component vector of bool b3}) +0:45 's3' ( temp structure{ temp 3-component vector of bool b3}) +0:46 move second child to first child ( temp 4-component vector of float) +0:46 i: direct index for structure ( temp 4-component vector of float) +0:46 's2' ( global structure{ temp 4-component vector of float i}) +0:46 Constant: +0:46 0 (const int) +0:46 ff4: direct index for structure ( temp 4-component vector of float) +0:46 's' ( in structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:46 Constant: +0:46 7 (const int) +0:50 move second child to first child ( temp structure{}) +0:50 'e' ( temp structure{}) +0:50 e: direct index for structure ( temp structure{}) +0:50 'ce' ( temp structure{ temp structure{} e}) +0:50 Constant: +0:50 0 (const int) +0:52 Branch: Return with expression +0:52 'input' ( in 4-component vector of float) +0:40 Function Definition: PixelShaderFunction( ( temp void) +0:40 Function Parameters: +0:? Sequence +0:40 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of float) +0:40 a: direct index for structure ( temp 4-component vector of float) +0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:40 Constant: +0:40 0 (const int) +0:? 's.a' (layout( location=1) smooth in 4-component vector of float) +0:40 move second child to first child ( temp bool) +0:40 b: direct index for structure ( temp bool) +0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:40 Constant: +0:40 1 (const int) +0:? 's.b' (layout( location=2) flat in bool) +0:40 move second child to first child ( temp 1-component vector of float) +0:40 c: direct index for structure ( temp 1-component vector of float) +0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:40 Constant: +0:40 2 (const int) +0:? 's.c' (layout( location=3) centroid noperspective in 1-component vector of float) +0:40 move second child to first child ( temp 2-component vector of float) +0:40 d: direct index for structure ( temp 2-component vector of float) +0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:40 Constant: +0:40 3 (const int) +0:? 's.d' (layout( location=4) centroid sample in 2-component vector of float) +0:40 move second child to first child ( temp bool) +0:40 ff1: direct index for structure ( temp bool) +0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:40 Constant: +0:40 4 (const int) +0:? 's.ff1' ( flat in bool Face) +0:40 move second child to first child ( temp bool) +0:40 ff2: direct index for structure ( temp bool) +0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:40 Constant: +0:40 5 (const int) +0:? 's.ff2' (layout( location=5) flat in bool) +0:40 move second child to first child ( temp bool) +0:40 ff3: direct index for structure ( temp bool) +0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:40 Constant: +0:40 6 (const int) +0:? 's.ff3' (layout( location=6) flat in bool) +0:40 move second child to first child ( temp 4-component vector of float) +0:40 ff4: direct index for structure ( temp 4-component vector of float) +0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:40 Constant: +0:40 7 (const int) +0:? 's.ff4' (layout( location=7) in 4-component vector of float) +0:40 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:40 Function Call: @PixelShaderFunction(vf4;struct-IN_S-vf4-b1-vf1-vf2-b1-b1-b1-vf41; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform structure{ temp bool b, temp bool c, temp 4-component vector of float a, temp 4-component vector of float d} s1, layout( binding=5 offset=1620) uniform float ff5, layout( binding=8 offset=1636) uniform float ff6}) +0:? 's2' ( global structure{ temp 4-component vector of float i}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:? 's.ff1' ( flat in bool Face) +0:? 's.a' (layout( location=1) smooth in 4-component vector of float) +0:? 's.b' (layout( location=2) flat in bool) +0:? 's.c' (layout( location=3) centroid noperspective in 1-component vector of float) +0:? 's.d' (layout( location=4) centroid sample in 2-component vector of float) +0:? 's.ff2' (layout( location=5) flat in bool) +0:? 's.ff3' (layout( location=6) flat in bool) +0:? 's.ff4' (layout( location=7) in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:40 Function Definition: @PixelShaderFunction(vf4;struct-IN_S-vf4-b1-vf1-vf2-b1-b1-b1-vf41; ( temp 4-component vector of float) +0:40 Function Parameters: +0:40 'input' ( in 4-component vector of float) +0:40 's' ( in structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:? Sequence +0:45 Compare Equal ( temp bool) +0:45 's3' ( temp structure{ temp 3-component vector of bool b3}) +0:45 's3' ( temp structure{ temp 3-component vector of bool b3}) +0:46 move second child to first child ( temp 4-component vector of float) +0:46 i: direct index for structure ( temp 4-component vector of float) +0:46 's2' ( global structure{ temp 4-component vector of float i}) +0:46 Constant: +0:46 0 (const int) +0:46 ff4: direct index for structure ( temp 4-component vector of float) +0:46 's' ( in structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:46 Constant: +0:46 7 (const int) +0:50 move second child to first child ( temp structure{}) +0:50 'e' ( temp structure{}) +0:50 e: direct index for structure ( temp structure{}) +0:50 'ce' ( temp structure{ temp structure{} e}) +0:50 Constant: +0:50 0 (const int) +0:52 Branch: Return with expression +0:52 'input' ( in 4-component vector of float) +0:40 Function Definition: PixelShaderFunction( ( temp void) +0:40 Function Parameters: +0:? Sequence +0:40 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of float) +0:40 a: direct index for structure ( temp 4-component vector of float) +0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:40 Constant: +0:40 0 (const int) +0:? 's.a' (layout( location=1) smooth in 4-component vector of float) +0:40 move second child to first child ( temp bool) +0:40 b: direct index for structure ( temp bool) +0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:40 Constant: +0:40 1 (const int) +0:? 's.b' (layout( location=2) flat in bool) +0:40 move second child to first child ( temp 1-component vector of float) +0:40 c: direct index for structure ( temp 1-component vector of float) +0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:40 Constant: +0:40 2 (const int) +0:? 's.c' (layout( location=3) centroid noperspective in 1-component vector of float) +0:40 move second child to first child ( temp 2-component vector of float) +0:40 d: direct index for structure ( temp 2-component vector of float) +0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:40 Constant: +0:40 3 (const int) +0:? 's.d' (layout( location=4) centroid sample in 2-component vector of float) +0:40 move second child to first child ( temp bool) +0:40 ff1: direct index for structure ( temp bool) +0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:40 Constant: +0:40 4 (const int) +0:? 's.ff1' ( flat in bool Face) +0:40 move second child to first child ( temp bool) +0:40 ff2: direct index for structure ( temp bool) +0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:40 Constant: +0:40 5 (const int) +0:? 's.ff2' (layout( location=5) flat in bool) +0:40 move second child to first child ( temp bool) +0:40 ff3: direct index for structure ( temp bool) +0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:40 Constant: +0:40 6 (const int) +0:? 's.ff3' (layout( location=6) flat in bool) +0:40 move second child to first child ( temp 4-component vector of float) +0:40 ff4: direct index for structure ( temp 4-component vector of float) +0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:40 Constant: +0:40 7 (const int) +0:? 's.ff4' (layout( location=7) in 4-component vector of float) +0:40 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:40 Function Call: @PixelShaderFunction(vf4;struct-IN_S-vf4-b1-vf1-vf2-b1-b1-b1-vf41; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform structure{ temp bool b, temp bool c, temp 4-component vector of float a, temp 4-component vector of float d} s1, layout( binding=5 offset=1620) uniform float ff5, layout( binding=8 offset=1636) uniform float ff6}) +0:? 's2' ( global structure{ temp 4-component vector of float i}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:? 's.ff1' ( flat in bool Face) +0:? 's.a' (layout( location=1) smooth in 4-component vector of float) +0:? 's.b' (layout( location=2) flat in bool) +0:? 's.c' (layout( location=3) centroid noperspective in 1-component vector of float) +0:? 's.d' (layout( location=4) centroid sample in 2-component vector of float) +0:? 's.ff2' (layout( location=5) flat in bool) +0:? 's.ff3' (layout( location=6) flat in bool) +0:? 's.ff4' (layout( location=7) in 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: If OpTypeBool is stored in conjunction with OpVariable, it can only be used with non-externally visible shader Storage Classes: Workgroup, CrossWorkgroup, Private, and Function + %s_b = OpVariable %_ptr_Input_bool Input + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 102 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 51 54 59 65 71 76 80 84 87 91 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 11 "IN_S" + MemberName 11(IN_S) 0 "a" + MemberName 11(IN_S) 1 "b" + MemberName 11(IN_S) 2 "c" + MemberName 11(IN_S) 3 "d" + MemberName 11(IN_S) 4 "ff1" + MemberName 11(IN_S) 5 "ff2" + MemberName 11(IN_S) 6 "ff3" + MemberName 11(IN_S) 7 "ff4" + Name 16 "@PixelShaderFunction(vf4;struct-IN_S-vf4-b1-vf1-vf2-b1-b1-b1-vf41;" + Name 14 "input" + Name 15 "s" + Name 19 "FS" + MemberName 19(FS) 0 "b3" + Name 21 "s3" + Name 28 "" + MemberName 28 0 "i" + Name 30 "s2" + Name 38 "empty" + Name 40 "e" + Name 41 "containEmpty" + MemberName 41(containEmpty) 0 "e" + Name 43 "ce" + Name 49 "input" + Name 51 "input" + Name 53 "s" + Name 54 "s.a" + Name 59 "s.b" + Name 65 "s.c" + Name 71 "s.d" + Name 76 "s.ff1" + Name 80 "s.ff2" + Name 84 "s.ff3" + Name 87 "s.ff4" + Name 91 "@entryPointOutput" + Name 92 "param" + Name 94 "param" + Name 98 "myS" + MemberName 98(myS) 0 "b" + MemberName 98(myS) 1 "c" + MemberName 98(myS) 2 "a" + MemberName 98(myS) 3 "d" + Name 99 "$Global" + MemberName 99($Global) 0 "s1" + MemberName 99($Global) 1 "ff5" + MemberName 99($Global) 2 "ff6" + Name 101 "" + Decorate 51(input) Location 0 + Decorate 54(s.a) Location 1 + Decorate 59(s.b) Flat + Decorate 59(s.b) Location 2 + Decorate 65(s.c) NoPerspective + Decorate 65(s.c) Centroid + Decorate 65(s.c) Location 3 + Decorate 71(s.d) Centroid + Decorate 71(s.d) Location 4 + Decorate 76(s.ff1) Flat + Decorate 76(s.ff1) BuiltIn FrontFacing + Decorate 80(s.ff2) Flat + Decorate 80(s.ff2) Location 5 + Decorate 84(s.ff3) Flat + Decorate 84(s.ff3) Location 6 + Decorate 87(s.ff4) Location 7 + Decorate 91(@entryPointOutput) Location 0 + MemberDecorate 98(myS) 0 Offset 0 + MemberDecorate 98(myS) 1 Offset 4 + MemberDecorate 98(myS) 2 Offset 16 + MemberDecorate 98(myS) 3 Offset 32 + MemberDecorate 99($Global) 0 Offset 0 + MemberDecorate 99($Global) 1 Offset 1620 + MemberDecorate 99($Global) 2 Offset 1636 + Decorate 99($Global) Block + Decorate 101 DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeBool + 10: TypeVector 6(float) 2 + 11(IN_S): TypeStruct 7(fvec4) 9(bool) 6(float) 10(fvec2) 9(bool) 9(bool) 9(bool) 7(fvec4) + 12: TypePointer Function 11(IN_S) + 13: TypeFunction 7(fvec4) 8(ptr) 12(ptr) + 18: TypeVector 9(bool) 3 + 19(FS): TypeStruct 18(bvec3) + 20: TypePointer Function 19(FS) + 28: TypeStruct 7(fvec4) + 29: TypePointer Private 28(struct) + 30(s2): 29(ptr) Variable Private + 31: TypeInt 32 1 + 32: 31(int) Constant 0 + 33: 31(int) Constant 7 + 36: TypePointer Private 7(fvec4) + 38(empty): TypeStruct + 39: TypePointer Function 38(empty) +41(containEmpty): TypeStruct 38(empty) + 42: TypePointer Function 41(containEmpty) + 50: TypePointer Input 7(fvec4) + 51(input): 50(ptr) Variable Input + 54(s.a): 50(ptr) Variable Input + 57: 31(int) Constant 1 + 58: TypePointer Input 9(bool) + 59(s.b): 58(ptr) Variable Input + 61: TypePointer Function 9(bool) + 63: 31(int) Constant 2 + 64: TypePointer Input 6(float) + 65(s.c): 64(ptr) Variable Input + 67: TypePointer Function 6(float) + 69: 31(int) Constant 3 + 70: TypePointer Input 10(fvec2) + 71(s.d): 70(ptr) Variable Input + 73: TypePointer Function 10(fvec2) + 75: 31(int) Constant 4 + 76(s.ff1): 58(ptr) Variable Input + 79: 31(int) Constant 5 + 80(s.ff2): 58(ptr) Variable Input + 83: 31(int) Constant 6 + 84(s.ff3): 58(ptr) Variable Input + 87(s.ff4): 50(ptr) Variable Input + 90: TypePointer Output 7(fvec4) +91(@entryPointOutput): 90(ptr) Variable Output + 97: TypeInt 32 0 + 98(myS): TypeStruct 97(int) 97(int) 7(fvec4) 7(fvec4) + 99($Global): TypeStruct 98(myS) 6(float) 6(float) + 100: TypePointer Uniform 99($Global) + 101: 100(ptr) Variable Uniform +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 49(input): 8(ptr) Variable Function + 53(s): 12(ptr) Variable Function + 92(param): 8(ptr) Variable Function + 94(param): 12(ptr) Variable Function + 52: 7(fvec4) Load 51(input) + Store 49(input) 52 + 55: 7(fvec4) Load 54(s.a) + 56: 8(ptr) AccessChain 53(s) 32 + Store 56 55 + 60: 9(bool) Load 59(s.b) + 62: 61(ptr) AccessChain 53(s) 57 + Store 62 60 + 66: 6(float) Load 65(s.c) + 68: 67(ptr) AccessChain 53(s) 63 + Store 68 66 + 72: 10(fvec2) Load 71(s.d) + 74: 73(ptr) AccessChain 53(s) 69 + Store 74 72 + 77: 9(bool) Load 76(s.ff1) + 78: 61(ptr) AccessChain 53(s) 75 + Store 78 77 + 81: 9(bool) Load 80(s.ff2) + 82: 61(ptr) AccessChain 53(s) 79 + Store 82 81 + 85: 9(bool) Load 84(s.ff3) + 86: 61(ptr) AccessChain 53(s) 83 + Store 86 85 + 88: 7(fvec4) Load 87(s.ff4) + 89: 8(ptr) AccessChain 53(s) 33 + Store 89 88 + 93: 7(fvec4) Load 49(input) + Store 92(param) 93 + 95: 11(IN_S) Load 53(s) + Store 94(param) 95 + 96: 7(fvec4) FunctionCall 16(@PixelShaderFunction(vf4;struct-IN_S-vf4-b1-vf1-vf2-b1-b1-b1-vf41;) 92(param) 94(param) + Store 91(@entryPointOutput) 96 + Return + FunctionEnd +16(@PixelShaderFunction(vf4;struct-IN_S-vf4-b1-vf1-vf2-b1-b1-b1-vf41;): 7(fvec4) Function None 13 + 14(input): 8(ptr) FunctionParameter + 15(s): 12(ptr) FunctionParameter + 17: Label + 21(s3): 20(ptr) Variable Function + 40(e): 39(ptr) Variable Function + 43(ce): 42(ptr) Variable Function + 22: 19(FS) Load 21(s3) + 23: 19(FS) Load 21(s3) + 24: 18(bvec3) CompositeExtract 22 0 + 25: 18(bvec3) CompositeExtract 23 0 + 26: 18(bvec3) LogicalEqual 24 25 + 27: 9(bool) All 26 + 34: 8(ptr) AccessChain 15(s) 33 + 35: 7(fvec4) Load 34 + 37: 36(ptr) AccessChain 30(s2) 32 + Store 37 35 + 44: 39(ptr) AccessChain 43(ce) 32 + 45: 38(empty) Load 44 + Store 40(e) 45 + 46: 7(fvec4) Load 14(input) + ReturnValue 46 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.struct.split-1.vert.out b/deps/glslang/Test/baseResults/hlsl.struct.split-1.vert.out new file mode 100644 index 00000000..d7d6e92b --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.struct.split-1.vert.out @@ -0,0 +1,321 @@ +hlsl.struct.split-1.vert +Shader version: 500 +0:? Sequence +0:17 Function Definition: @main(struct-VS_INPUT-i1-vf4-i11;vf4; ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:17 Function Parameters: +0:17 'vsin' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:17 'Pos_loose' ( in 4-component vector of float) +0:? Sequence +0:20 move second child to first child ( temp int) +0:20 x0_out: direct index for structure ( temp int) +0:20 'vsout' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:20 Constant: +0:20 0 (const int) +0:20 x0_in: direct index for structure ( temp int) +0:20 'vsin' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:20 Constant: +0:20 0 (const int) +0:21 move second child to first child ( temp 4-component vector of float) +0:21 Pos_out: direct index for structure ( temp 4-component vector of float) +0:21 'vsout' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:21 Constant: +0:21 1 (const int) +0:21 add ( temp 4-component vector of float) +0:21 Pos_in: direct index for structure ( temp 4-component vector of float) +0:21 'vsin' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:21 Constant: +0:21 1 (const int) +0:21 'Pos_loose' ( in 4-component vector of float) +0:22 move second child to first child ( temp int) +0:22 x1_out: direct index for structure ( temp int) +0:22 'vsout' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:22 Constant: +0:22 2 (const int) +0:22 x1_in: direct index for structure ( temp int) +0:22 'vsin' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:22 Constant: +0:22 2 (const int) +0:24 Branch: Return with expression +0:24 'vsout' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:17 Function Definition: main( ( temp void) +0:17 Function Parameters: +0:? Sequence +0:17 Sequence +0:17 move second child to first child ( temp int) +0:17 x0_in: direct index for structure ( temp int) +0:? 'vsin' ( temp structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:17 Constant: +0:17 0 (const int) +0:? 'vsin.x0_in' (layout( location=0) in int) +0:17 move second child to first child ( temp 4-component vector of float) +0:17 Pos_in: direct index for structure ( temp 4-component vector of float) +0:? 'vsin' ( temp structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:17 Constant: +0:17 1 (const int) +0:? 'vsin.Pos_in' (layout( location=1) in 4-component vector of float) +0:17 move second child to first child ( temp int) +0:17 x1_in: direct index for structure ( temp int) +0:? 'vsin' ( temp structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:17 Constant: +0:17 2 (const int) +0:? 'vsin.x1_in' (layout( location=2) in int) +0:17 move second child to first child ( temp 4-component vector of float) +0:? 'Pos_loose' ( temp 4-component vector of float) +0:? 'Pos_loose' (layout( location=3) in 4-component vector of float) +0:17 Sequence +0:17 move second child to first child ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:17 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:17 Function Call: @main(struct-VS_INPUT-i1-vf4-i11;vf4; ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:? 'vsin' ( temp structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:? 'Pos_loose' ( temp 4-component vector of float) +0:17 move second child to first child ( temp int) +0:? '@entryPointOutput.x0_out' (layout( location=0) out int) +0:17 x0_out: direct index for structure ( temp int) +0:17 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:17 Constant: +0:17 0 (const int) +0:17 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos_out' ( out 4-component vector of float Position) +0:17 Pos_out: direct index for structure ( temp 4-component vector of float) +0:17 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:17 Constant: +0:17 1 (const int) +0:17 move second child to first child ( temp int) +0:? '@entryPointOutput.x1_out' (layout( location=1) out int) +0:17 x1_out: direct index for structure ( temp int) +0:17 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:17 Constant: +0:17 2 (const int) +0:? Linker Objects +0:? '@entryPointOutput.Pos_out' ( out 4-component vector of float Position) +0:? '@entryPointOutput.x0_out' (layout( location=0) out int) +0:? '@entryPointOutput.x1_out' (layout( location=1) out int) +0:? 'vsin.x0_in' (layout( location=0) in int) +0:? 'vsin.Pos_in' (layout( location=1) in 4-component vector of float) +0:? 'vsin.x1_in' (layout( location=2) in int) +0:? 'Pos_loose' (layout( location=3) in 4-component vector of float) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:17 Function Definition: @main(struct-VS_INPUT-i1-vf4-i11;vf4; ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:17 Function Parameters: +0:17 'vsin' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:17 'Pos_loose' ( in 4-component vector of float) +0:? Sequence +0:20 move second child to first child ( temp int) +0:20 x0_out: direct index for structure ( temp int) +0:20 'vsout' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:20 Constant: +0:20 0 (const int) +0:20 x0_in: direct index for structure ( temp int) +0:20 'vsin' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:20 Constant: +0:20 0 (const int) +0:21 move second child to first child ( temp 4-component vector of float) +0:21 Pos_out: direct index for structure ( temp 4-component vector of float) +0:21 'vsout' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:21 Constant: +0:21 1 (const int) +0:21 add ( temp 4-component vector of float) +0:21 Pos_in: direct index for structure ( temp 4-component vector of float) +0:21 'vsin' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:21 Constant: +0:21 1 (const int) +0:21 'Pos_loose' ( in 4-component vector of float) +0:22 move second child to first child ( temp int) +0:22 x1_out: direct index for structure ( temp int) +0:22 'vsout' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:22 Constant: +0:22 2 (const int) +0:22 x1_in: direct index for structure ( temp int) +0:22 'vsin' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:22 Constant: +0:22 2 (const int) +0:24 Branch: Return with expression +0:24 'vsout' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:17 Function Definition: main( ( temp void) +0:17 Function Parameters: +0:? Sequence +0:17 Sequence +0:17 move second child to first child ( temp int) +0:17 x0_in: direct index for structure ( temp int) +0:? 'vsin' ( temp structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:17 Constant: +0:17 0 (const int) +0:? 'vsin.x0_in' (layout( location=0) in int) +0:17 move second child to first child ( temp 4-component vector of float) +0:17 Pos_in: direct index for structure ( temp 4-component vector of float) +0:? 'vsin' ( temp structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:17 Constant: +0:17 1 (const int) +0:? 'vsin.Pos_in' (layout( location=1) in 4-component vector of float) +0:17 move second child to first child ( temp int) +0:17 x1_in: direct index for structure ( temp int) +0:? 'vsin' ( temp structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:17 Constant: +0:17 2 (const int) +0:? 'vsin.x1_in' (layout( location=2) in int) +0:17 move second child to first child ( temp 4-component vector of float) +0:? 'Pos_loose' ( temp 4-component vector of float) +0:? 'Pos_loose' (layout( location=3) in 4-component vector of float) +0:17 Sequence +0:17 move second child to first child ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:17 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:17 Function Call: @main(struct-VS_INPUT-i1-vf4-i11;vf4; ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:? 'vsin' ( temp structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:? 'Pos_loose' ( temp 4-component vector of float) +0:17 move second child to first child ( temp int) +0:? '@entryPointOutput.x0_out' (layout( location=0) out int) +0:17 x0_out: direct index for structure ( temp int) +0:17 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:17 Constant: +0:17 0 (const int) +0:17 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos_out' ( out 4-component vector of float Position) +0:17 Pos_out: direct index for structure ( temp 4-component vector of float) +0:17 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:17 Constant: +0:17 1 (const int) +0:17 move second child to first child ( temp int) +0:? '@entryPointOutput.x1_out' (layout( location=1) out int) +0:17 x1_out: direct index for structure ( temp int) +0:17 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:17 Constant: +0:17 2 (const int) +0:? Linker Objects +0:? '@entryPointOutput.Pos_out' ( out 4-component vector of float Position) +0:? '@entryPointOutput.x0_out' (layout( location=0) out int) +0:? '@entryPointOutput.x1_out' (layout( location=1) out int) +0:? 'vsin.x0_in' (layout( location=0) in int) +0:? 'vsin.Pos_in' (layout( location=1) in 4-component vector of float) +0:? 'vsin.x1_in' (layout( location=2) in int) +0:? 'Pos_loose' (layout( location=3) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 70 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 40 44 47 51 60 64 67 + Source HLSL 500 + Name 4 "main" + Name 9 "VS_INPUT" + MemberName 9(VS_INPUT) 0 "x0_in" + MemberName 9(VS_INPUT) 1 "Pos_in" + MemberName 9(VS_INPUT) 2 "x1_in" + Name 12 "VS_OUTPUT" + MemberName 12(VS_OUTPUT) 0 "x0_out" + MemberName 12(VS_OUTPUT) 1 "Pos_out" + MemberName 12(VS_OUTPUT) 2 "x1_out" + Name 16 "@main(struct-VS_INPUT-i1-vf4-i11;vf4;" + Name 14 "vsin" + Name 15 "Pos_loose" + Name 19 "vsout" + Name 38 "vsin" + Name 40 "vsin.x0_in" + Name 44 "vsin.Pos_in" + Name 47 "vsin.x1_in" + Name 50 "Pos_loose" + Name 51 "Pos_loose" + Name 53 "flattenTemp" + Name 54 "param" + Name 56 "param" + Name 60 "@entryPointOutput.x0_out" + Name 64 "@entryPointOutput.Pos_out" + Name 67 "@entryPointOutput.x1_out" + Decorate 40(vsin.x0_in) Location 0 + Decorate 44(vsin.Pos_in) Location 1 + Decorate 47(vsin.x1_in) Location 2 + Decorate 51(Pos_loose) Location 3 + Decorate 60(@entryPointOutput.x0_out) Location 0 + Decorate 64(@entryPointOutput.Pos_out) BuiltIn Position + Decorate 67(@entryPointOutput.x1_out) Location 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeFloat 32 + 8: TypeVector 7(float) 4 + 9(VS_INPUT): TypeStruct 6(int) 8(fvec4) 6(int) + 10: TypePointer Function 9(VS_INPUT) + 11: TypePointer Function 8(fvec4) + 12(VS_OUTPUT): TypeStruct 6(int) 8(fvec4) 6(int) + 13: TypeFunction 12(VS_OUTPUT) 10(ptr) 11(ptr) + 18: TypePointer Function 12(VS_OUTPUT) + 20: 6(int) Constant 0 + 21: TypePointer Function 6(int) + 25: 6(int) Constant 1 + 31: 6(int) Constant 2 + 39: TypePointer Input 6(int) + 40(vsin.x0_in): 39(ptr) Variable Input + 43: TypePointer Input 8(fvec4) + 44(vsin.Pos_in): 43(ptr) Variable Input + 47(vsin.x1_in): 39(ptr) Variable Input + 51(Pos_loose): 43(ptr) Variable Input + 59: TypePointer Output 6(int) +60(@entryPointOutput.x0_out): 59(ptr) Variable Output + 63: TypePointer Output 8(fvec4) +64(@entryPointOutput.Pos_out): 63(ptr) Variable Output +67(@entryPointOutput.x1_out): 59(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 38(vsin): 10(ptr) Variable Function + 50(Pos_loose): 11(ptr) Variable Function + 53(flattenTemp): 18(ptr) Variable Function + 54(param): 10(ptr) Variable Function + 56(param): 11(ptr) Variable Function + 41: 6(int) Load 40(vsin.x0_in) + 42: 21(ptr) AccessChain 38(vsin) 20 + Store 42 41 + 45: 8(fvec4) Load 44(vsin.Pos_in) + 46: 11(ptr) AccessChain 38(vsin) 25 + Store 46 45 + 48: 6(int) Load 47(vsin.x1_in) + 49: 21(ptr) AccessChain 38(vsin) 31 + Store 49 48 + 52: 8(fvec4) Load 51(Pos_loose) + Store 50(Pos_loose) 52 + 55: 9(VS_INPUT) Load 38(vsin) + Store 54(param) 55 + 57: 8(fvec4) Load 50(Pos_loose) + Store 56(param) 57 + 58:12(VS_OUTPUT) FunctionCall 16(@main(struct-VS_INPUT-i1-vf4-i11;vf4;) 54(param) 56(param) + Store 53(flattenTemp) 58 + 61: 21(ptr) AccessChain 53(flattenTemp) 20 + 62: 6(int) Load 61 + Store 60(@entryPointOutput.x0_out) 62 + 65: 11(ptr) AccessChain 53(flattenTemp) 25 + 66: 8(fvec4) Load 65 + Store 64(@entryPointOutput.Pos_out) 66 + 68: 21(ptr) AccessChain 53(flattenTemp) 31 + 69: 6(int) Load 68 + Store 67(@entryPointOutput.x1_out) 69 + Return + FunctionEnd +16(@main(struct-VS_INPUT-i1-vf4-i11;vf4;):12(VS_OUTPUT) Function None 13 + 14(vsin): 10(ptr) FunctionParameter + 15(Pos_loose): 11(ptr) FunctionParameter + 17: Label + 19(vsout): 18(ptr) Variable Function + 22: 21(ptr) AccessChain 14(vsin) 20 + 23: 6(int) Load 22 + 24: 21(ptr) AccessChain 19(vsout) 20 + Store 24 23 + 26: 11(ptr) AccessChain 14(vsin) 25 + 27: 8(fvec4) Load 26 + 28: 8(fvec4) Load 15(Pos_loose) + 29: 8(fvec4) FAdd 27 28 + 30: 11(ptr) AccessChain 19(vsout) 25 + Store 30 29 + 32: 21(ptr) AccessChain 14(vsin) 31 + 33: 6(int) Load 32 + 34: 21(ptr) AccessChain 19(vsout) 31 + Store 34 33 + 35:12(VS_OUTPUT) Load 19(vsout) + ReturnValue 35 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.struct.split.array.geom.out b/deps/glslang/Test/baseResults/hlsl.struct.split.array.geom.out new file mode 100644 index 00000000..081b05cb --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.struct.split.array.geom.out @@ -0,0 +1,306 @@ +hlsl.struct.split.array.geom +Shader version: 500 +invocations = -1 +max_vertices = 4 +input primitive = points +output primitive = triangle_strip +0:? Sequence +0:13 Function Definition: @main(u1[1];struct-PSInput-vf4-vf2-vf3-u11; ( temp void) +0:13 Function Parameters: +0:13 'v' ( in 1-element array of uint) +0:13 'OutputStream' ( out structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) +0:? Sequence +0:16 Sequence +0:16 move second child to first child ( temp structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) +0:16 'Out' ( temp structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) +0:16 Constant: +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0 (const uint) +0:18 Sequence +0:18 move second child to first child ( temp int) +0:18 'x' ( temp int) +0:18 Constant: +0:18 0 (const int) +0:18 Loop with condition tested first +0:18 Loop Condition +0:18 Compare Less Than ( temp bool) +0:18 'x' ( temp int) +0:18 Constant: +0:18 2 (const int) +0:18 Loop Body +0:19 Sequence +0:19 move second child to first child ( temp int) +0:19 'y' ( temp int) +0:19 Constant: +0:19 0 (const int) +0:19 Loop with condition tested first +0:19 Loop Condition +0:19 Compare Less Than ( temp bool) +0:19 'y' ( temp int) +0:19 Constant: +0:19 2 (const int) +0:19 Loop Body +0:20 move second child to first child ( temp structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) +0:20 indirect index ( temp structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) +0:20 indirect index ( temp 3-element array of structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) +0:20 'Verts' ( temp 2-element array of 3-element array of structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) +0:20 'x' ( temp int) +0:20 'y' ( temp int) +0:20 'Out' ( temp structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) +0:19 Loop Terminal Expression +0:19 Pre-Increment ( temp int) +0:19 'y' ( temp int) +0:18 Loop Terminal Expression +0:18 Pre-Increment ( temp int) +0:18 'x' ( temp int) +0:13 Function Definition: main( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 1-element array of uint) +0:? 'v' ( temp 1-element array of uint) +0:? 'v' (layout( location=0) in 1-element array of uint) +0:13 Function Call: @main(u1[1];struct-PSInput-vf4-vf2-vf3-u11; ( temp void) +0:? 'v' ( temp 1-element array of uint) +0:? 'OutputStream' ( temp structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) +0:? Linker Objects +0:? 'v' (layout( location=0) in 1-element array of uint) +0:? 'OutputStream.Pos' ( out 4-component vector of float Position) +0:? 'OutputStream.TexCoord' (layout( location=0) out 2-component vector of float) +0:? 'OutputStream.TerrainPos' (layout( location=1) out 3-component vector of float) +0:? 'OutputStream.VertexID' (layout( location=2) out uint) + + +Linked geometry stage: + + +Shader version: 500 +invocations = 1 +max_vertices = 4 +input primitive = points +output primitive = triangle_strip +0:? Sequence +0:13 Function Definition: @main(u1[1];struct-PSInput-vf4-vf2-vf3-u11; ( temp void) +0:13 Function Parameters: +0:13 'v' ( in 1-element array of uint) +0:13 'OutputStream' ( out structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) +0:? Sequence +0:16 Sequence +0:16 move second child to first child ( temp structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) +0:16 'Out' ( temp structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) +0:16 Constant: +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0 (const uint) +0:18 Sequence +0:18 move second child to first child ( temp int) +0:18 'x' ( temp int) +0:18 Constant: +0:18 0 (const int) +0:18 Loop with condition tested first +0:18 Loop Condition +0:18 Compare Less Than ( temp bool) +0:18 'x' ( temp int) +0:18 Constant: +0:18 2 (const int) +0:18 Loop Body +0:19 Sequence +0:19 move second child to first child ( temp int) +0:19 'y' ( temp int) +0:19 Constant: +0:19 0 (const int) +0:19 Loop with condition tested first +0:19 Loop Condition +0:19 Compare Less Than ( temp bool) +0:19 'y' ( temp int) +0:19 Constant: +0:19 2 (const int) +0:19 Loop Body +0:20 move second child to first child ( temp structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) +0:20 indirect index ( temp structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) +0:20 indirect index ( temp 3-element array of structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) +0:20 'Verts' ( temp 2-element array of 3-element array of structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) +0:20 'x' ( temp int) +0:20 'y' ( temp int) +0:20 'Out' ( temp structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) +0:19 Loop Terminal Expression +0:19 Pre-Increment ( temp int) +0:19 'y' ( temp int) +0:18 Loop Terminal Expression +0:18 Pre-Increment ( temp int) +0:18 'x' ( temp int) +0:13 Function Definition: main( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 1-element array of uint) +0:? 'v' ( temp 1-element array of uint) +0:? 'v' (layout( location=0) in 1-element array of uint) +0:13 Function Call: @main(u1[1];struct-PSInput-vf4-vf2-vf3-u11; ( temp void) +0:? 'v' ( temp 1-element array of uint) +0:? 'OutputStream' ( temp structure{ temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) +0:? Linker Objects +0:? 'v' (layout( location=0) in 1-element array of uint) +0:? 'OutputStream.Pos' ( out 4-component vector of float Position) +0:? 'OutputStream.TexCoord' (layout( location=0) out 2-component vector of float) +0:? 'OutputStream.TerrainPos' (layout( location=1) out 3-component vector of float) +0:? 'OutputStream.VertexID' (layout( location=2) out uint) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 82 + + Capability Geometry + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 66 75 77 79 81 + ExecutionMode 4 InputPoints + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputTriangleStrip + ExecutionMode 4 OutputVertices 4 + Source HLSL 500 + Name 4 "main" + Name 14 "PSInput" + MemberName 14(PSInput) 0 "Pos" + MemberName 14(PSInput) 1 "TexCoord" + MemberName 14(PSInput) 2 "TerrainPos" + MemberName 14(PSInput) 3 "VertexID" + Name 19 "@main(u1[1];struct-PSInput-vf4-vf2-vf3-u11;" + Name 17 "v" + Name 18 "OutputStream" + Name 21 "Out" + Name 30 "x" + Name 41 "y" + Name 54 "Verts" + Name 64 "v" + Name 66 "v" + Name 68 "OutputStream" + Name 69 "param" + Name 71 "param" + Name 75 "OutputStream.Pos" + Name 77 "OutputStream.TexCoord" + Name 79 "OutputStream.TerrainPos" + Name 81 "OutputStream.VertexID" + Decorate 66(v) Location 0 + Decorate 75(OutputStream.Pos) BuiltIn Position + Decorate 77(OutputStream.TexCoord) Location 0 + Decorate 79(OutputStream.TerrainPos) Location 1 + Decorate 81(OutputStream.VertexID) Location 2 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: 6(int) Constant 1 + 8: TypeArray 6(int) 7 + 9: TypePointer Function 8 + 10: TypeFloat 32 + 11: TypeVector 10(float) 4 + 12: TypeVector 10(float) 2 + 13: TypeVector 10(float) 3 + 14(PSInput): TypeStruct 11(fvec4) 12(fvec2) 13(fvec3) 6(int) + 15: TypePointer Function 14(PSInput) + 16: TypeFunction 2 9(ptr) 15(ptr) + 22: 10(float) Constant 0 + 23: 11(fvec4) ConstantComposite 22 22 22 22 + 24: 12(fvec2) ConstantComposite 22 22 + 25: 13(fvec3) ConstantComposite 22 22 22 + 26: 6(int) Constant 0 + 27: 14(PSInput) ConstantComposite 23 24 25 26 + 28: TypeInt 32 1 + 29: TypePointer Function 28(int) + 31: 28(int) Constant 0 + 38: 28(int) Constant 2 + 39: TypeBool + 49: 6(int) Constant 3 + 50: TypeArray 14(PSInput) 49 + 51: 6(int) Constant 2 + 52: TypeArray 50 51 + 53: TypePointer Function 52 + 60: 28(int) Constant 1 + 65: TypePointer Input 8 + 66(v): 65(ptr) Variable Input + 74: TypePointer Output 11(fvec4) +75(OutputStream.Pos): 74(ptr) Variable Output + 76: TypePointer Output 12(fvec2) +77(OutputStream.TexCoord): 76(ptr) Variable Output + 78: TypePointer Output 13(fvec3) +79(OutputStream.TerrainPos): 78(ptr) Variable Output + 80: TypePointer Output 6(int) +81(OutputStream.VertexID): 80(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 64(v): 9(ptr) Variable Function +68(OutputStream): 15(ptr) Variable Function + 69(param): 9(ptr) Variable Function + 71(param): 15(ptr) Variable Function + 67: 8 Load 66(v) + Store 64(v) 67 + 70: 8 Load 64(v) + Store 69(param) 70 + 72: 2 FunctionCall 19(@main(u1[1];struct-PSInput-vf4-vf2-vf3-u11;) 69(param) 71(param) + 73: 14(PSInput) Load 71(param) + Store 68(OutputStream) 73 + Return + FunctionEnd +19(@main(u1[1];struct-PSInput-vf4-vf2-vf3-u11;): 2 Function None 16 + 17(v): 9(ptr) FunctionParameter +18(OutputStream): 15(ptr) FunctionParameter + 20: Label + 21(Out): 15(ptr) Variable Function + 30(x): 29(ptr) Variable Function + 41(y): 29(ptr) Variable Function + 54(Verts): 53(ptr) Variable Function + Store 21(Out) 27 + Store 30(x) 31 + Branch 32 + 32: Label + LoopMerge 34 35 None + Branch 36 + 36: Label + 37: 28(int) Load 30(x) + 40: 39(bool) SLessThan 37 38 + BranchConditional 40 33 34 + 33: Label + Store 41(y) 31 + Branch 42 + 42: Label + LoopMerge 44 45 None + Branch 46 + 46: Label + 47: 28(int) Load 41(y) + 48: 39(bool) SLessThan 47 38 + BranchConditional 48 43 44 + 43: Label + 55: 28(int) Load 30(x) + 56: 28(int) Load 41(y) + 57: 14(PSInput) Load 21(Out) + 58: 15(ptr) AccessChain 54(Verts) 55 56 + Store 58 57 + Branch 45 + 45: Label + 59: 28(int) Load 41(y) + 61: 28(int) IAdd 59 60 + Store 41(y) 61 + Branch 42 + 44: Label + Branch 35 + 35: Label + 62: 28(int) Load 30(x) + 63: 28(int) IAdd 62 60 + Store 30(x) 63 + Branch 32 + 34: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.struct.split.assign.frag.out b/deps/glslang/Test/baseResults/hlsl.struct.split.assign.frag.out new file mode 100644 index 00000000..0598ac9c --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.struct.split.assign.frag.out @@ -0,0 +1,325 @@ +hlsl.struct.split.assign.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main(i1;struct-S-f1-vf41[3]; ( temp 4-component vector of float) +0:7 Function Parameters: +0:7 'i' ( in int) +0:7 'input' ( in 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:? Sequence +0:9 move second child to first child ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:9 'input' ( in 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:9 'a' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:11 Branch: Return with expression +0:11 pos: direct index for structure ( temp 4-component vector of float) +0:11 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) +0:11 'a' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp int) +0:? 'i' ( temp int) +0:? 'i' (layout( location=0) flat in int) +0:7 Sequence +0:7 move second child to first child ( temp float) +0:7 f: direct index for structure ( temp float) +0:7 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) +0:? 'input' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 0 (const int) +0:? 'input[0].f' (layout( location=1) in float) +0:7 move second child to first child ( temp 4-component vector of float) +0:7 pos: direct index for structure ( temp 4-component vector of float) +0:7 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) +0:? 'input' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 direct index ( in 4-component vector of float FragCoord) +0:? 'input.pos' ( in 3-element array of 4-component vector of float FragCoord) +0:7 Constant: +0:7 0 (const int) +0:7 move second child to first child ( temp float) +0:7 f: direct index for structure ( temp float) +0:7 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) +0:? 'input' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const int) +0:? 'input[1].f' (layout( location=2) in float) +0:7 move second child to first child ( temp 4-component vector of float) +0:7 pos: direct index for structure ( temp 4-component vector of float) +0:7 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) +0:? 'input' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 direct index ( in 4-component vector of float FragCoord) +0:? 'input.pos' ( in 3-element array of 4-component vector of float FragCoord) +0:7 Constant: +0:7 1 (const int) +0:7 move second child to first child ( temp float) +0:7 f: direct index for structure ( temp float) +0:7 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) +0:? 'input' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:7 Constant: +0:7 2 (const int) +0:7 Constant: +0:7 0 (const int) +0:? 'input[2].f' (layout( location=3) in float) +0:7 move second child to first child ( temp 4-component vector of float) +0:7 pos: direct index for structure ( temp 4-component vector of float) +0:7 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) +0:? 'input' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:7 Constant: +0:7 2 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 direct index ( in 4-component vector of float FragCoord) +0:? 'input.pos' ( in 3-element array of 4-component vector of float FragCoord) +0:7 Constant: +0:7 2 (const int) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main(i1;struct-S-f1-vf41[3]; ( temp 4-component vector of float) +0:? 'i' ( temp int) +0:? 'input' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'i' (layout( location=0) flat in int) +0:? 'input.pos' ( in 3-element array of 4-component vector of float FragCoord) +0:? 'input[0].f' (layout( location=1) in float) +0:? 'input[1].f' (layout( location=2) in float) +0:? 'input[2].f' (layout( location=3) in float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main(i1;struct-S-f1-vf41[3]; ( temp 4-component vector of float) +0:7 Function Parameters: +0:7 'i' ( in int) +0:7 'input' ( in 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:? Sequence +0:9 move second child to first child ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:9 'input' ( in 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:9 'a' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:11 Branch: Return with expression +0:11 pos: direct index for structure ( temp 4-component vector of float) +0:11 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) +0:11 'a' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp int) +0:? 'i' ( temp int) +0:? 'i' (layout( location=0) flat in int) +0:7 Sequence +0:7 move second child to first child ( temp float) +0:7 f: direct index for structure ( temp float) +0:7 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) +0:? 'input' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 0 (const int) +0:? 'input[0].f' (layout( location=1) in float) +0:7 move second child to first child ( temp 4-component vector of float) +0:7 pos: direct index for structure ( temp 4-component vector of float) +0:7 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) +0:? 'input' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 direct index ( in 4-component vector of float FragCoord) +0:? 'input.pos' ( in 3-element array of 4-component vector of float FragCoord) +0:7 Constant: +0:7 0 (const int) +0:7 move second child to first child ( temp float) +0:7 f: direct index for structure ( temp float) +0:7 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) +0:? 'input' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const int) +0:? 'input[1].f' (layout( location=2) in float) +0:7 move second child to first child ( temp 4-component vector of float) +0:7 pos: direct index for structure ( temp 4-component vector of float) +0:7 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) +0:? 'input' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 direct index ( in 4-component vector of float FragCoord) +0:? 'input.pos' ( in 3-element array of 4-component vector of float FragCoord) +0:7 Constant: +0:7 1 (const int) +0:7 move second child to first child ( temp float) +0:7 f: direct index for structure ( temp float) +0:7 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) +0:? 'input' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:7 Constant: +0:7 2 (const int) +0:7 Constant: +0:7 0 (const int) +0:? 'input[2].f' (layout( location=3) in float) +0:7 move second child to first child ( temp 4-component vector of float) +0:7 pos: direct index for structure ( temp 4-component vector of float) +0:7 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) +0:? 'input' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:7 Constant: +0:7 2 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 direct index ( in 4-component vector of float FragCoord) +0:? 'input.pos' ( in 3-element array of 4-component vector of float FragCoord) +0:7 Constant: +0:7 2 (const int) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main(i1;struct-S-f1-vf41[3]; ( temp 4-component vector of float) +0:? 'i' ( temp int) +0:? 'input' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'i' (layout( location=0) flat in int) +0:? 'input.pos' ( in 3-element array of 4-component vector of float FragCoord) +0:? 'input[0].f' (layout( location=1) in float) +0:? 'input[1].f' (layout( location=2) in float) +0:? 'input[2].f' (layout( location=3) in float) + +error: SPIRV-Tools Validation Errors +error: According to the Vulkan spec BuiltIn FragCoord variable needs to be a 4-component 32-bit float vector. ID <41> (OpVariable) is not a float vector. + %input_pos = OpVariable %_ptr_Input__arr_v4float_uint_3 Input + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 66 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 30 35 41 46 53 60 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 10 "S" + MemberName 10(S) 0 "f" + MemberName 10(S) 1 "pos" + Name 18 "@main(i1;struct-S-f1-vf41[3];" + Name 16 "i" + Name 17 "input" + Name 20 "a" + Name 28 "i" + Name 30 "i" + Name 32 "input" + Name 35 "input[0].f" + Name 41 "input.pos" + Name 46 "input[1].f" + Name 53 "input[2].f" + Name 60 "@entryPointOutput" + Name 61 "param" + Name 63 "param" + Decorate 30(i) Flat + Decorate 30(i) Location 0 + Decorate 35(input[0].f) Location 1 + Decorate 41(input.pos) BuiltIn FragCoord + Decorate 46(input[1].f) Location 2 + Decorate 53(input[2].f) Location 3 + Decorate 60(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10(S): TypeStruct 8(float) 9(fvec4) + 11: TypeInt 32 0 + 12: 11(int) Constant 3 + 13: TypeArray 10(S) 12 + 14: TypePointer Function 13 + 15: TypeFunction 9(fvec4) 7(ptr) 14(ptr) + 22: 6(int) Constant 1 + 23: TypePointer Function 9(fvec4) + 29: TypePointer Input 6(int) + 30(i): 29(ptr) Variable Input + 33: 6(int) Constant 0 + 34: TypePointer Input 8(float) + 35(input[0].f): 34(ptr) Variable Input + 37: TypePointer Function 8(float) + 39: TypeArray 9(fvec4) 12 + 40: TypePointer Input 39 + 41(input.pos): 40(ptr) Variable Input + 42: TypePointer Input 9(fvec4) + 46(input[1].f): 34(ptr) Variable Input + 52: 6(int) Constant 2 + 53(input[2].f): 34(ptr) Variable Input + 59: TypePointer Output 9(fvec4) +60(@entryPointOutput): 59(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 28(i): 7(ptr) Variable Function + 32(input): 14(ptr) Variable Function + 61(param): 7(ptr) Variable Function + 63(param): 14(ptr) Variable Function + 31: 6(int) Load 30(i) + Store 28(i) 31 + 36: 8(float) Load 35(input[0].f) + 38: 37(ptr) AccessChain 32(input) 33 33 + Store 38 36 + 43: 42(ptr) AccessChain 41(input.pos) 33 + 44: 9(fvec4) Load 43 + 45: 23(ptr) AccessChain 32(input) 33 22 + Store 45 44 + 47: 8(float) Load 46(input[1].f) + 48: 37(ptr) AccessChain 32(input) 22 33 + Store 48 47 + 49: 42(ptr) AccessChain 41(input.pos) 22 + 50: 9(fvec4) Load 49 + 51: 23(ptr) AccessChain 32(input) 22 22 + Store 51 50 + 54: 8(float) Load 53(input[2].f) + 55: 37(ptr) AccessChain 32(input) 52 33 + Store 55 54 + 56: 42(ptr) AccessChain 41(input.pos) 52 + 57: 9(fvec4) Load 56 + 58: 23(ptr) AccessChain 32(input) 52 22 + Store 58 57 + 62: 6(int) Load 28(i) + Store 61(param) 62 + 64: 13 Load 32(input) + Store 63(param) 64 + 65: 9(fvec4) FunctionCall 18(@main(i1;struct-S-f1-vf41[3];) 61(param) 63(param) + Store 60(@entryPointOutput) 65 + Return + FunctionEnd +18(@main(i1;struct-S-f1-vf41[3];): 9(fvec4) Function None 15 + 16(i): 7(ptr) FunctionParameter + 17(input): 14(ptr) FunctionParameter + 19: Label + 20(a): 14(ptr) Variable Function + 21: 13 Load 20(a) + Store 17(input) 21 + 24: 23(ptr) AccessChain 20(a) 22 22 + 25: 9(fvec4) Load 24 + ReturnValue 25 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.struct.split.call.vert.out b/deps/glslang/Test/baseResults/hlsl.struct.split.call.vert.out new file mode 100644 index 00000000..50d1d2b1 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.struct.split.call.vert.out @@ -0,0 +1,348 @@ +hlsl.struct.split.call.vert +Shader version: 500 +0:? Sequence +0:17 Function Definition: Fn1(struct-VS_INPUT-i1-vf4-i11;struct-VS_OUTPUT-i1-vf4-i11; ( temp void) +0:17 Function Parameters: +0:17 'fn1_in' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:17 'fn1_out' ( in structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:? Sequence +0:18 add ( temp 4-component vector of float) +0:18 Pos_in: direct index for structure ( temp 4-component vector of float) +0:18 'fn1_in' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:18 Constant: +0:18 1 (const int) +0:18 Pos_out: direct index for structure ( temp 4-component vector of float) +0:18 'fn1_out' ( in structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:18 Constant: +0:18 1 (const int) +0:22 Function Definition: @main(struct-VS_INPUT-i1-vf4-i11; ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:22 Function Parameters: +0:22 'vsin' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:? Sequence +0:25 move second child to first child ( temp int) +0:25 x0_out: direct index for structure ( temp int) +0:25 'vsout' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:25 Constant: +0:25 0 (const int) +0:25 x0_in: direct index for structure ( temp int) +0:25 'vsin' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:25 Constant: +0:25 0 (const int) +0:26 move second child to first child ( temp 4-component vector of float) +0:26 Pos_out: direct index for structure ( temp 4-component vector of float) +0:26 'vsout' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:26 Constant: +0:26 1 (const int) +0:26 Pos_in: direct index for structure ( temp 4-component vector of float) +0:26 'vsin' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:26 Constant: +0:26 1 (const int) +0:27 move second child to first child ( temp int) +0:27 x1_out: direct index for structure ( temp int) +0:27 'vsout' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:27 Constant: +0:27 2 (const int) +0:27 x1_in: direct index for structure ( temp int) +0:27 'vsin' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:27 Constant: +0:27 2 (const int) +0:29 Function Call: Fn1(struct-VS_INPUT-i1-vf4-i11;struct-VS_OUTPUT-i1-vf4-i11; ( temp void) +0:29 'vsin' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:29 'vsout' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:31 Branch: Return with expression +0:31 'vsout' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:22 Function Definition: main( ( temp void) +0:22 Function Parameters: +0:? Sequence +0:22 Sequence +0:22 move second child to first child ( temp int) +0:22 x0_in: direct index for structure ( temp int) +0:? 'vsin' ( temp structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:22 Constant: +0:22 0 (const int) +0:? 'vsin.x0_in' (layout( location=0) in int) +0:22 move second child to first child ( temp 4-component vector of float) +0:22 Pos_in: direct index for structure ( temp 4-component vector of float) +0:? 'vsin' ( temp structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:22 Constant: +0:22 1 (const int) +0:? 'vsin.Pos_in' (layout( location=1) in 4-component vector of float) +0:22 move second child to first child ( temp int) +0:22 x1_in: direct index for structure ( temp int) +0:? 'vsin' ( temp structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:22 Constant: +0:22 2 (const int) +0:? 'vsin.x1_in' (layout( location=2) in int) +0:22 Sequence +0:22 move second child to first child ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:22 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:22 Function Call: @main(struct-VS_INPUT-i1-vf4-i11; ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:? 'vsin' ( temp structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:22 move second child to first child ( temp int) +0:? '@entryPointOutput.x0_out' (layout( location=0) out int) +0:22 x0_out: direct index for structure ( temp int) +0:22 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:22 Constant: +0:22 0 (const int) +0:22 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos_out' ( out 4-component vector of float Position) +0:22 Pos_out: direct index for structure ( temp 4-component vector of float) +0:22 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:22 Constant: +0:22 1 (const int) +0:22 move second child to first child ( temp int) +0:? '@entryPointOutput.x1_out' (layout( location=1) out int) +0:22 x1_out: direct index for structure ( temp int) +0:22 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:22 Constant: +0:22 2 (const int) +0:? Linker Objects +0:? '@entryPointOutput.Pos_out' ( out 4-component vector of float Position) +0:? '@entryPointOutput.x0_out' (layout( location=0) out int) +0:? '@entryPointOutput.x1_out' (layout( location=1) out int) +0:? 'vsin.x0_in' (layout( location=0) in int) +0:? 'vsin.Pos_in' (layout( location=1) in 4-component vector of float) +0:? 'vsin.x1_in' (layout( location=2) in int) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:17 Function Definition: Fn1(struct-VS_INPUT-i1-vf4-i11;struct-VS_OUTPUT-i1-vf4-i11; ( temp void) +0:17 Function Parameters: +0:17 'fn1_in' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:17 'fn1_out' ( in structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:? Sequence +0:18 add ( temp 4-component vector of float) +0:18 Pos_in: direct index for structure ( temp 4-component vector of float) +0:18 'fn1_in' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:18 Constant: +0:18 1 (const int) +0:18 Pos_out: direct index for structure ( temp 4-component vector of float) +0:18 'fn1_out' ( in structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:18 Constant: +0:18 1 (const int) +0:22 Function Definition: @main(struct-VS_INPUT-i1-vf4-i11; ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:22 Function Parameters: +0:22 'vsin' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:? Sequence +0:25 move second child to first child ( temp int) +0:25 x0_out: direct index for structure ( temp int) +0:25 'vsout' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:25 Constant: +0:25 0 (const int) +0:25 x0_in: direct index for structure ( temp int) +0:25 'vsin' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:25 Constant: +0:25 0 (const int) +0:26 move second child to first child ( temp 4-component vector of float) +0:26 Pos_out: direct index for structure ( temp 4-component vector of float) +0:26 'vsout' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:26 Constant: +0:26 1 (const int) +0:26 Pos_in: direct index for structure ( temp 4-component vector of float) +0:26 'vsin' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:26 Constant: +0:26 1 (const int) +0:27 move second child to first child ( temp int) +0:27 x1_out: direct index for structure ( temp int) +0:27 'vsout' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:27 Constant: +0:27 2 (const int) +0:27 x1_in: direct index for structure ( temp int) +0:27 'vsin' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:27 Constant: +0:27 2 (const int) +0:29 Function Call: Fn1(struct-VS_INPUT-i1-vf4-i11;struct-VS_OUTPUT-i1-vf4-i11; ( temp void) +0:29 'vsin' ( in structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:29 'vsout' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:31 Branch: Return with expression +0:31 'vsout' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:22 Function Definition: main( ( temp void) +0:22 Function Parameters: +0:? Sequence +0:22 Sequence +0:22 move second child to first child ( temp int) +0:22 x0_in: direct index for structure ( temp int) +0:? 'vsin' ( temp structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:22 Constant: +0:22 0 (const int) +0:? 'vsin.x0_in' (layout( location=0) in int) +0:22 move second child to first child ( temp 4-component vector of float) +0:22 Pos_in: direct index for structure ( temp 4-component vector of float) +0:? 'vsin' ( temp structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:22 Constant: +0:22 1 (const int) +0:? 'vsin.Pos_in' (layout( location=1) in 4-component vector of float) +0:22 move second child to first child ( temp int) +0:22 x1_in: direct index for structure ( temp int) +0:? 'vsin' ( temp structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:22 Constant: +0:22 2 (const int) +0:? 'vsin.x1_in' (layout( location=2) in int) +0:22 Sequence +0:22 move second child to first child ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:22 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:22 Function Call: @main(struct-VS_INPUT-i1-vf4-i11; ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:? 'vsin' ( temp structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) +0:22 move second child to first child ( temp int) +0:? '@entryPointOutput.x0_out' (layout( location=0) out int) +0:22 x0_out: direct index for structure ( temp int) +0:22 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:22 Constant: +0:22 0 (const int) +0:22 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos_out' ( out 4-component vector of float Position) +0:22 Pos_out: direct index for structure ( temp 4-component vector of float) +0:22 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:22 Constant: +0:22 1 (const int) +0:22 move second child to first child ( temp int) +0:? '@entryPointOutput.x1_out' (layout( location=1) out int) +0:22 x1_out: direct index for structure ( temp int) +0:22 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) +0:22 Constant: +0:22 2 (const int) +0:? Linker Objects +0:? '@entryPointOutput.Pos_out' ( out 4-component vector of float Position) +0:? '@entryPointOutput.x0_out' (layout( location=0) out int) +0:? '@entryPointOutput.x1_out' (layout( location=1) out int) +0:? 'vsin.x0_in' (layout( location=0) in int) +0:? 'vsin.Pos_in' (layout( location=1) in 4-component vector of float) +0:? 'vsin.x1_in' (layout( location=2) in int) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 77 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 52 56 59 67 71 74 + Source HLSL 500 + Name 4 "main" + Name 9 "VS_INPUT" + MemberName 9(VS_INPUT) 0 "x0_in" + MemberName 9(VS_INPUT) 1 "Pos_in" + MemberName 9(VS_INPUT) 2 "x1_in" + Name 11 "VS_OUTPUT" + MemberName 11(VS_OUTPUT) 0 "x0_out" + MemberName 11(VS_OUTPUT) 1 "Pos_out" + MemberName 11(VS_OUTPUT) 2 "x1_out" + Name 16 "Fn1(struct-VS_INPUT-i1-vf4-i11;struct-VS_OUTPUT-i1-vf4-i11;" + Name 14 "fn1_in" + Name 15 "fn1_out" + Name 20 "@main(struct-VS_INPUT-i1-vf4-i11;" + Name 19 "vsin" + Name 29 "vsout" + Name 42 "param" + Name 44 "param" + Name 50 "vsin" + Name 52 "vsin.x0_in" + Name 56 "vsin.Pos_in" + Name 59 "vsin.x1_in" + Name 62 "flattenTemp" + Name 63 "param" + Name 67 "@entryPointOutput.x0_out" + Name 71 "@entryPointOutput.Pos_out" + Name 74 "@entryPointOutput.x1_out" + Decorate 52(vsin.x0_in) Location 0 + Decorate 56(vsin.Pos_in) Location 1 + Decorate 59(vsin.x1_in) Location 2 + Decorate 67(@entryPointOutput.x0_out) Location 0 + Decorate 71(@entryPointOutput.Pos_out) BuiltIn Position + Decorate 74(@entryPointOutput.x1_out) Location 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeFloat 32 + 8: TypeVector 7(float) 4 + 9(VS_INPUT): TypeStruct 6(int) 8(fvec4) 6(int) + 10: TypePointer Function 9(VS_INPUT) + 11(VS_OUTPUT): TypeStruct 6(int) 8(fvec4) 6(int) + 12: TypePointer Function 11(VS_OUTPUT) + 13: TypeFunction 2 10(ptr) 12(ptr) + 18: TypeFunction 11(VS_OUTPUT) 10(ptr) + 22: 6(int) Constant 1 + 23: TypePointer Function 8(fvec4) + 30: 6(int) Constant 0 + 31: TypePointer Function 6(int) + 38: 6(int) Constant 2 + 51: TypePointer Input 6(int) + 52(vsin.x0_in): 51(ptr) Variable Input + 55: TypePointer Input 8(fvec4) + 56(vsin.Pos_in): 55(ptr) Variable Input + 59(vsin.x1_in): 51(ptr) Variable Input + 66: TypePointer Output 6(int) +67(@entryPointOutput.x0_out): 66(ptr) Variable Output + 70: TypePointer Output 8(fvec4) +71(@entryPointOutput.Pos_out): 70(ptr) Variable Output +74(@entryPointOutput.x1_out): 66(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 50(vsin): 10(ptr) Variable Function + 62(flattenTemp): 12(ptr) Variable Function + 63(param): 10(ptr) Variable Function + 53: 6(int) Load 52(vsin.x0_in) + 54: 31(ptr) AccessChain 50(vsin) 30 + Store 54 53 + 57: 8(fvec4) Load 56(vsin.Pos_in) + 58: 23(ptr) AccessChain 50(vsin) 22 + Store 58 57 + 60: 6(int) Load 59(vsin.x1_in) + 61: 31(ptr) AccessChain 50(vsin) 38 + Store 61 60 + 64: 9(VS_INPUT) Load 50(vsin) + Store 63(param) 64 + 65:11(VS_OUTPUT) FunctionCall 20(@main(struct-VS_INPUT-i1-vf4-i11;) 63(param) + Store 62(flattenTemp) 65 + 68: 31(ptr) AccessChain 62(flattenTemp) 30 + 69: 6(int) Load 68 + Store 67(@entryPointOutput.x0_out) 69 + 72: 23(ptr) AccessChain 62(flattenTemp) 22 + 73: 8(fvec4) Load 72 + Store 71(@entryPointOutput.Pos_out) 73 + 75: 31(ptr) AccessChain 62(flattenTemp) 38 + 76: 6(int) Load 75 + Store 74(@entryPointOutput.x1_out) 76 + Return + FunctionEnd +16(Fn1(struct-VS_INPUT-i1-vf4-i11;struct-VS_OUTPUT-i1-vf4-i11;): 2 Function None 13 + 14(fn1_in): 10(ptr) FunctionParameter + 15(fn1_out): 12(ptr) FunctionParameter + 17: Label + 24: 23(ptr) AccessChain 14(fn1_in) 22 + 25: 8(fvec4) Load 24 + 26: 23(ptr) AccessChain 15(fn1_out) 22 + 27: 8(fvec4) Load 26 + 28: 8(fvec4) FAdd 25 27 + Return + FunctionEnd +20(@main(struct-VS_INPUT-i1-vf4-i11;):11(VS_OUTPUT) Function None 18 + 19(vsin): 10(ptr) FunctionParameter + 21: Label + 29(vsout): 12(ptr) Variable Function + 42(param): 10(ptr) Variable Function + 44(param): 12(ptr) Variable Function + 32: 31(ptr) AccessChain 19(vsin) 30 + 33: 6(int) Load 32 + 34: 31(ptr) AccessChain 29(vsout) 30 + Store 34 33 + 35: 23(ptr) AccessChain 19(vsin) 22 + 36: 8(fvec4) Load 35 + 37: 23(ptr) AccessChain 29(vsout) 22 + Store 37 36 + 39: 31(ptr) AccessChain 19(vsin) 38 + 40: 6(int) Load 39 + 41: 31(ptr) AccessChain 29(vsout) 38 + Store 41 40 + 43: 9(VS_INPUT) Load 19(vsin) + Store 42(param) 43 + 45:11(VS_OUTPUT) Load 29(vsout) + Store 44(param) 45 + 46: 2 FunctionCall 16(Fn1(struct-VS_INPUT-i1-vf4-i11;struct-VS_OUTPUT-i1-vf4-i11;) 42(param) 44(param) + 47:11(VS_OUTPUT) Load 29(vsout) + ReturnValue 47 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.struct.split.nested.geom.out b/deps/glslang/Test/baseResults/hlsl.struct.split.nested.geom.out new file mode 100644 index 00000000..7a72a3f8 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.struct.split.nested.geom.out @@ -0,0 +1,617 @@ +hlsl.struct.split.nested.geom +Shader version: 500 +invocations = -1 +max_vertices = 3 +input primitive = triangles +output primitive = triangle_strip +0:? Sequence +0:24 Function Definition: @main(struct-PS_IN-vf4-vf21[3];struct-GS_OUT-struct-PS_IN-vf4-vf21-struct-STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO-f1[2]-i111; ( temp void) +0:24 Function Parameters: +0:24 'tin' ( in 3-element array of structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:24 'ts' ( out structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:? Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 pos: direct index for structure ( temp 4-component vector of float) +0:27 psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:27 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 0 (const int) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:28 move second child to first child ( temp 2-component vector of float) +0:28 tc: direct index for structure ( temp 2-component vector of float) +0:28 psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:28 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 1 (const int) +0:? Constant: +0:? 5.000000 +0:? 6.000000 +0:29 move second child to first child ( temp float) +0:29 direct index ( temp float) +0:29 m0_array: direct index for structure ( temp 2-element array of float) +0:29 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:29 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:29 Constant: +0:29 1 (const int) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 2.300000 +0:30 move second child to first child ( temp float) +0:30 direct index ( temp float) +0:30 m0_array: direct index for structure ( temp 2-element array of float) +0:30 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:30 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:30 Constant: +0:30 1 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 1 (const int) +0:30 Constant: +0:30 2.300000 +0:31 move second child to first child ( temp int) +0:31 m1: direct index for structure ( temp int) +0:31 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:31 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:31 Constant: +0:31 1 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 Constant: +0:31 2 (const int) +0:33 Sequence +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of float) +0:? 'ts.pos' ( out 4-component vector of float Position) +0:33 pos: direct index for structure ( temp 4-component vector of float) +0:33 psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 0 (const int) +0:33 move second child to first child ( temp 2-component vector of float) +0:? 'ts.psIn.tc' (layout( location=0) out 2-component vector of float) +0:33 tc: direct index for structure ( temp 2-component vector of float) +0:33 psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 1 (const int) +0:33 move second child to first child ( temp float) +0:? 'ts.contains_no_builtin_io.m0_array[0]' (layout( location=1) out float) +0:33 direct index ( temp float) +0:33 m0_array: direct index for structure ( temp 2-element array of float) +0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 0 (const int) +0:33 move second child to first child ( temp float) +0:? 'ts.contains_no_builtin_io.m0_array[1]' (layout( location=2) out float) +0:33 direct index ( temp float) +0:33 m0_array: direct index for structure ( temp 2-element array of float) +0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 1 (const int) +0:33 move second child to first child ( temp int) +0:? 'ts.contains_no_builtin_io.m1' (layout( location=3) out int) +0:33 m1: direct index for structure ( temp int) +0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 1 (const int) +0:33 EmitVertex ( temp void) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp 4-component vector of float) +0:24 pos: direct index for structure ( temp 4-component vector of float) +0:24 direct index ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:? 'tin' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 0 (const int) +0:24 direct index ( in 4-component vector of float Position) +0:? 'tin.pos' ( in 3-element array of 4-component vector of float Position) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp 2-component vector of float) +0:24 tc: direct index for structure ( temp 2-component vector of float) +0:24 direct index ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:? 'tin' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 1 (const int) +0:24 tc: direct index for structure ( temp 2-component vector of float) +0:24 direct index (layout( location=0) in structure{ temp 2-component vector of float tc}) +0:24 'tin' (layout( location=0) in 3-element array of structure{ temp 2-component vector of float tc}) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 pos: direct index for structure ( temp 4-component vector of float) +0:24 direct index ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:? 'tin' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:24 Constant: +0:24 1 (const int) +0:24 Constant: +0:24 0 (const int) +0:24 direct index ( in 4-component vector of float Position) +0:? 'tin.pos' ( in 3-element array of 4-component vector of float Position) +0:24 Constant: +0:24 1 (const int) +0:24 move second child to first child ( temp 2-component vector of float) +0:24 tc: direct index for structure ( temp 2-component vector of float) +0:24 direct index ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:? 'tin' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:24 Constant: +0:24 1 (const int) +0:24 Constant: +0:24 1 (const int) +0:24 tc: direct index for structure ( temp 2-component vector of float) +0:24 direct index (layout( location=0) in structure{ temp 2-component vector of float tc}) +0:24 'tin' (layout( location=0) in 3-element array of structure{ temp 2-component vector of float tc}) +0:24 Constant: +0:24 1 (const int) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 pos: direct index for structure ( temp 4-component vector of float) +0:24 direct index ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:? 'tin' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 0 (const int) +0:24 direct index ( in 4-component vector of float Position) +0:? 'tin.pos' ( in 3-element array of 4-component vector of float Position) +0:24 Constant: +0:24 2 (const int) +0:24 move second child to first child ( temp 2-component vector of float) +0:24 tc: direct index for structure ( temp 2-component vector of float) +0:24 direct index ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:? 'tin' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 1 (const int) +0:24 tc: direct index for structure ( temp 2-component vector of float) +0:24 direct index (layout( location=0) in structure{ temp 2-component vector of float tc}) +0:24 'tin' (layout( location=0) in 3-element array of structure{ temp 2-component vector of float tc}) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 0 (const int) +0:24 Function Call: @main(struct-PS_IN-vf4-vf21[3];struct-GS_OUT-struct-PS_IN-vf4-vf21-struct-STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO-f1[2]-i111; ( temp void) +0:? 'tin' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:? 'ts' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:? Linker Objects +0:? 'tin.pos' ( in 3-element array of 4-component vector of float Position) +0:? 'tin' (layout( location=0) in 3-element array of structure{ temp 2-component vector of float tc}) +0:? 'ts.pos' ( out 4-component vector of float Position) +0:? 'ts.psIn.tc' (layout( location=0) out 2-component vector of float) +0:? 'ts.contains_no_builtin_io.m0_array[0]' (layout( location=1) out float) +0:? 'ts.contains_no_builtin_io.m0_array[1]' (layout( location=2) out float) +0:? 'ts.contains_no_builtin_io.m1' (layout( location=3) out int) + + +Linked geometry stage: + + +Shader version: 500 +invocations = 1 +max_vertices = 3 +input primitive = triangles +output primitive = triangle_strip +0:? Sequence +0:24 Function Definition: @main(struct-PS_IN-vf4-vf21[3];struct-GS_OUT-struct-PS_IN-vf4-vf21-struct-STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO-f1[2]-i111; ( temp void) +0:24 Function Parameters: +0:24 'tin' ( in 3-element array of structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:24 'ts' ( out structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:? Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 pos: direct index for structure ( temp 4-component vector of float) +0:27 psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:27 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 0 (const int) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:28 move second child to first child ( temp 2-component vector of float) +0:28 tc: direct index for structure ( temp 2-component vector of float) +0:28 psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:28 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 1 (const int) +0:? Constant: +0:? 5.000000 +0:? 6.000000 +0:29 move second child to first child ( temp float) +0:29 direct index ( temp float) +0:29 m0_array: direct index for structure ( temp 2-element array of float) +0:29 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:29 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:29 Constant: +0:29 1 (const int) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 2.300000 +0:30 move second child to first child ( temp float) +0:30 direct index ( temp float) +0:30 m0_array: direct index for structure ( temp 2-element array of float) +0:30 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:30 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:30 Constant: +0:30 1 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 1 (const int) +0:30 Constant: +0:30 2.300000 +0:31 move second child to first child ( temp int) +0:31 m1: direct index for structure ( temp int) +0:31 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:31 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:31 Constant: +0:31 1 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 Constant: +0:31 2 (const int) +0:33 Sequence +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of float) +0:? 'ts.pos' ( out 4-component vector of float Position) +0:33 pos: direct index for structure ( temp 4-component vector of float) +0:33 psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 0 (const int) +0:33 move second child to first child ( temp 2-component vector of float) +0:? 'ts.psIn.tc' (layout( location=0) out 2-component vector of float) +0:33 tc: direct index for structure ( temp 2-component vector of float) +0:33 psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 1 (const int) +0:33 move second child to first child ( temp float) +0:? 'ts.contains_no_builtin_io.m0_array[0]' (layout( location=1) out float) +0:33 direct index ( temp float) +0:33 m0_array: direct index for structure ( temp 2-element array of float) +0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 0 (const int) +0:33 move second child to first child ( temp float) +0:? 'ts.contains_no_builtin_io.m0_array[1]' (layout( location=2) out float) +0:33 direct index ( temp float) +0:33 m0_array: direct index for structure ( temp 2-element array of float) +0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 1 (const int) +0:33 move second child to first child ( temp int) +0:? 'ts.contains_no_builtin_io.m1' (layout( location=3) out int) +0:33 m1: direct index for structure ( temp int) +0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 1 (const int) +0:33 EmitVertex ( temp void) +0:24 Function Definition: main( ( temp void) +0:24 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp 4-component vector of float) +0:24 pos: direct index for structure ( temp 4-component vector of float) +0:24 direct index ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:? 'tin' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 0 (const int) +0:24 direct index ( in 4-component vector of float Position) +0:? 'tin.pos' ( in 3-element array of 4-component vector of float Position) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp 2-component vector of float) +0:24 tc: direct index for structure ( temp 2-component vector of float) +0:24 direct index ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:? 'tin' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 1 (const int) +0:24 tc: direct index for structure ( temp 2-component vector of float) +0:24 direct index (layout( location=0) in structure{ temp 2-component vector of float tc}) +0:24 'tin' (layout( location=0) in 3-element array of structure{ temp 2-component vector of float tc}) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 pos: direct index for structure ( temp 4-component vector of float) +0:24 direct index ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:? 'tin' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:24 Constant: +0:24 1 (const int) +0:24 Constant: +0:24 0 (const int) +0:24 direct index ( in 4-component vector of float Position) +0:? 'tin.pos' ( in 3-element array of 4-component vector of float Position) +0:24 Constant: +0:24 1 (const int) +0:24 move second child to first child ( temp 2-component vector of float) +0:24 tc: direct index for structure ( temp 2-component vector of float) +0:24 direct index ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:? 'tin' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:24 Constant: +0:24 1 (const int) +0:24 Constant: +0:24 1 (const int) +0:24 tc: direct index for structure ( temp 2-component vector of float) +0:24 direct index (layout( location=0) in structure{ temp 2-component vector of float tc}) +0:24 'tin' (layout( location=0) in 3-element array of structure{ temp 2-component vector of float tc}) +0:24 Constant: +0:24 1 (const int) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 pos: direct index for structure ( temp 4-component vector of float) +0:24 direct index ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:? 'tin' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 0 (const int) +0:24 direct index ( in 4-component vector of float Position) +0:? 'tin.pos' ( in 3-element array of 4-component vector of float Position) +0:24 Constant: +0:24 2 (const int) +0:24 move second child to first child ( temp 2-component vector of float) +0:24 tc: direct index for structure ( temp 2-component vector of float) +0:24 direct index ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:? 'tin' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 1 (const int) +0:24 tc: direct index for structure ( temp 2-component vector of float) +0:24 direct index (layout( location=0) in structure{ temp 2-component vector of float tc}) +0:24 'tin' (layout( location=0) in 3-element array of structure{ temp 2-component vector of float tc}) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 0 (const int) +0:24 Function Call: @main(struct-PS_IN-vf4-vf21[3];struct-GS_OUT-struct-PS_IN-vf4-vf21-struct-STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO-f1[2]-i111; ( temp void) +0:? 'tin' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) +0:? 'ts' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:? Linker Objects +0:? 'tin.pos' ( in 3-element array of 4-component vector of float Position) +0:? 'tin' (layout( location=0) in 3-element array of structure{ temp 2-component vector of float tc}) +0:? 'ts.pos' ( out 4-component vector of float Position) +0:? 'ts.psIn.tc' (layout( location=0) out 2-component vector of float) +0:? 'ts.contains_no_builtin_io.m0_array[0]' (layout( location=1) out float) +0:? 'ts.contains_no_builtin_io.m0_array[1]' (layout( location=2) out float) +0:? 'ts.contains_no_builtin_io.m1' (layout( location=3) out int) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 100 + + Capability Geometry + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 48 52 56 59 63 69 77 + ExecutionMode 4 Triangles + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputTriangleStrip + ExecutionMode 4 OutputVertices 3 + Source HLSL 500 + Name 4 "main" + Name 9 "PS_IN" + MemberName 9(PS_IN) 0 "pos" + MemberName 9(PS_IN) 1 "tc" + Name 17 "STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO" + MemberName 17(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) 0 "m0_array" + MemberName 17(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) 1 "m1" + Name 18 "GS_OUT" + MemberName 18(GS_OUT) 0 "psIn" + MemberName 18(GS_OUT) 1 "contains_no_builtin_io" + Name 23 "@main(struct-PS_IN-vf4-vf21[3];struct-GS_OUT-struct-PS_IN-vf4-vf21-struct-STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO-f1[2]-i111;" + Name 21 "tin" + Name 22 "ts" + Name 25 "o" + Name 48 "ts.pos" + Name 52 "ts.psIn.tc" + Name 56 "ts.contains_no_builtin_io.m0_array[0]" + Name 59 "ts.contains_no_builtin_io.m0_array[1]" + Name 63 "ts.contains_no_builtin_io.m1" + Name 66 "tin" + Name 69 "tin.pos" + Name 74 "PS_IN" + MemberName 74(PS_IN) 0 "tc" + Name 77 "tin" + Name 94 "ts" + Name 95 "param" + Name 97 "param" + Decorate 48(ts.pos) BuiltIn Position + Decorate 52(ts.psIn.tc) Location 0 + Decorate 56(ts.contains_no_builtin_io.m0_array[0]) Location 1 + Decorate 59(ts.contains_no_builtin_io.m0_array[1]) Location 2 + Decorate 63(ts.contains_no_builtin_io.m1) Location 3 + Decorate 69(tin.pos) BuiltIn Position + Decorate 77(tin) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeVector 6(float) 2 + 9(PS_IN): TypeStruct 7(fvec4) 8(fvec2) + 10: TypeInt 32 0 + 11: 10(int) Constant 3 + 12: TypeArray 9(PS_IN) 11 + 13: TypePointer Function 12 + 14: 10(int) Constant 2 + 15: TypeArray 6(float) 14 + 16: TypeInt 32 1 +17(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO): TypeStruct 15 16(int) + 18(GS_OUT): TypeStruct 9(PS_IN) 17(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) + 19: TypePointer Function 18(GS_OUT) + 20: TypeFunction 2 13(ptr) 19(ptr) + 26: 16(int) Constant 0 + 27: 6(float) Constant 1065353216 + 28: 6(float) Constant 1073741824 + 29: 6(float) Constant 1077936128 + 30: 6(float) Constant 1082130432 + 31: 7(fvec4) ConstantComposite 27 28 29 30 + 32: TypePointer Function 7(fvec4) + 34: 16(int) Constant 1 + 35: 6(float) Constant 1084227584 + 36: 6(float) Constant 1086324736 + 37: 8(fvec2) ConstantComposite 35 36 + 38: TypePointer Function 8(fvec2) + 40: 6(float) Constant 1075000115 + 41: TypePointer Function 6(float) + 44: 16(int) Constant 2 + 45: TypePointer Function 16(int) + 47: TypePointer Output 7(fvec4) + 48(ts.pos): 47(ptr) Variable Output + 51: TypePointer Output 8(fvec2) + 52(ts.psIn.tc): 51(ptr) Variable Output + 55: TypePointer Output 6(float) +56(ts.contains_no_builtin_io.m0_array[0]): 55(ptr) Variable Output +59(ts.contains_no_builtin_io.m0_array[1]): 55(ptr) Variable Output + 62: TypePointer Output 16(int) +63(ts.contains_no_builtin_io.m1): 62(ptr) Variable Output + 67: TypeArray 7(fvec4) 11 + 68: TypePointer Input 67 + 69(tin.pos): 68(ptr) Variable Input + 70: TypePointer Input 7(fvec4) + 74(PS_IN): TypeStruct 8(fvec2) + 75: TypeArray 74(PS_IN) 11 + 76: TypePointer Input 75 + 77(tin): 76(ptr) Variable Input + 78: TypePointer Input 8(fvec2) + 4(main): 2 Function None 3 + 5: Label + 66(tin): 13(ptr) Variable Function + 94(ts): 19(ptr) Variable Function + 95(param): 13(ptr) Variable Function + 97(param): 19(ptr) Variable Function + 71: 70(ptr) AccessChain 69(tin.pos) 26 + 72: 7(fvec4) Load 71 + 73: 32(ptr) AccessChain 66(tin) 26 26 + Store 73 72 + 79: 78(ptr) AccessChain 77(tin) 26 26 + 80: 8(fvec2) Load 79 + 81: 38(ptr) AccessChain 66(tin) 26 34 + Store 81 80 + 82: 70(ptr) AccessChain 69(tin.pos) 34 + 83: 7(fvec4) Load 82 + 84: 32(ptr) AccessChain 66(tin) 34 26 + Store 84 83 + 85: 78(ptr) AccessChain 77(tin) 34 26 + 86: 8(fvec2) Load 85 + 87: 38(ptr) AccessChain 66(tin) 34 34 + Store 87 86 + 88: 70(ptr) AccessChain 69(tin.pos) 44 + 89: 7(fvec4) Load 88 + 90: 32(ptr) AccessChain 66(tin) 44 26 + Store 90 89 + 91: 78(ptr) AccessChain 77(tin) 44 26 + 92: 8(fvec2) Load 91 + 93: 38(ptr) AccessChain 66(tin) 44 34 + Store 93 92 + 96: 12 Load 66(tin) + Store 95(param) 96 + 98: 2 FunctionCall 23(@main(struct-PS_IN-vf4-vf21[3];struct-GS_OUT-struct-PS_IN-vf4-vf21-struct-STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO-f1[2]-i111;) 95(param) 97(param) + 99: 18(GS_OUT) Load 97(param) + Store 94(ts) 99 + Return + FunctionEnd +23(@main(struct-PS_IN-vf4-vf21[3];struct-GS_OUT-struct-PS_IN-vf4-vf21-struct-STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO-f1[2]-i111;): 2 Function None 20 + 21(tin): 13(ptr) FunctionParameter + 22(ts): 19(ptr) FunctionParameter + 24: Label + 25(o): 19(ptr) Variable Function + 33: 32(ptr) AccessChain 25(o) 26 26 + Store 33 31 + 39: 38(ptr) AccessChain 25(o) 26 34 + Store 39 37 + 42: 41(ptr) AccessChain 25(o) 34 26 26 + Store 42 40 + 43: 41(ptr) AccessChain 25(o) 34 26 34 + Store 43 40 + 46: 45(ptr) AccessChain 25(o) 34 34 + Store 46 44 + 49: 32(ptr) AccessChain 25(o) 26 26 + 50: 7(fvec4) Load 49 + Store 48(ts.pos) 50 + 53: 38(ptr) AccessChain 25(o) 26 34 + 54: 8(fvec2) Load 53 + Store 52(ts.psIn.tc) 54 + 57: 41(ptr) AccessChain 25(o) 34 26 26 + 58: 6(float) Load 57 + Store 56(ts.contains_no_builtin_io.m0_array[0]) 58 + 60: 41(ptr) AccessChain 25(o) 34 26 34 + 61: 6(float) Load 60 + Store 59(ts.contains_no_builtin_io.m0_array[1]) 61 + 64: 45(ptr) AccessChain 25(o) 34 34 + 65: 16(int) Load 64 + Store 63(ts.contains_no_builtin_io.m1) 65 + EmitVertex + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.struct.split.trivial.geom.out b/deps/glslang/Test/baseResults/hlsl.struct.split.trivial.geom.out new file mode 100644 index 00000000..477fbd20 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.struct.split.trivial.geom.out @@ -0,0 +1,309 @@ +hlsl.struct.split.trivial.geom +Shader version: 500 +invocations = -1 +max_vertices = 3 +input primitive = triangles +output primitive = triangle_strip +0:? Sequence +0:14 Function Definition: @main(struct-PS_IN-vf41[3];struct-GS_OUT-vf41; ( temp void) +0:14 Function Parameters: +0:14 'i' ( in 3-element array of structure{ temp 4-component vector of float pos}) +0:14 'ts' ( out structure{ temp 4-component vector of float pos}) +0:? Sequence +0:17 Sequence +0:17 move second child to first child ( temp int) +0:17 'x' ( temp int) +0:17 Constant: +0:17 0 (const int) +0:17 Loop with condition tested first +0:17 Loop Condition +0:17 Compare Less Than ( temp bool) +0:17 'x' ( temp int) +0:17 Constant: +0:17 3 (const int) +0:17 Loop Body +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:18 pos: direct index for structure ( temp 4-component vector of float) +0:18 'o' ( temp structure{ temp 4-component vector of float pos}) +0:18 Constant: +0:18 0 (const int) +0:18 pos: direct index for structure ( temp 4-component vector of float) +0:18 indirect index ( temp structure{ temp 4-component vector of float pos}) +0:18 'i' ( in 3-element array of structure{ temp 4-component vector of float pos}) +0:18 'x' ( temp int) +0:18 Constant: +0:18 0 (const int) +0:19 Sequence +0:19 Sequence +0:19 move second child to first child ( temp 4-component vector of float) +0:? 'ts.pos' ( out 4-component vector of float Position) +0:19 pos: direct index for structure ( temp 4-component vector of float) +0:19 'o' ( temp structure{ temp 4-component vector of float pos}) +0:19 Constant: +0:19 0 (const int) +0:19 EmitVertex ( temp void) +0:17 Loop Terminal Expression +0:17 Pre-Increment ( temp int) +0:17 'x' ( temp int) +0:14 Function Definition: main( ( temp void) +0:14 Function Parameters: +0:? Sequence +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 pos: direct index for structure ( temp 4-component vector of float) +0:14 direct index ( temp structure{ temp 4-component vector of float pos}) +0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos}) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 direct index ( in 4-component vector of float Position) +0:? 'i.pos' ( in 3-element array of 4-component vector of float Position) +0:14 Constant: +0:14 0 (const int) +0:14 move second child to first child ( temp 4-component vector of float) +0:14 pos: direct index for structure ( temp 4-component vector of float) +0:14 direct index ( temp structure{ temp 4-component vector of float pos}) +0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos}) +0:14 Constant: +0:14 1 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 direct index ( in 4-component vector of float Position) +0:? 'i.pos' ( in 3-element array of 4-component vector of float Position) +0:14 Constant: +0:14 1 (const int) +0:14 move second child to first child ( temp 4-component vector of float) +0:14 pos: direct index for structure ( temp 4-component vector of float) +0:14 direct index ( temp structure{ temp 4-component vector of float pos}) +0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos}) +0:14 Constant: +0:14 2 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 direct index ( in 4-component vector of float Position) +0:? 'i.pos' ( in 3-element array of 4-component vector of float Position) +0:14 Constant: +0:14 2 (const int) +0:14 Function Call: @main(struct-PS_IN-vf41[3];struct-GS_OUT-vf41; ( temp void) +0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos}) +0:? 'ts' ( temp structure{ temp 4-component vector of float pos}) +0:? Linker Objects +0:? 'i.pos' ( in 3-element array of 4-component vector of float Position) +0:? 'ts.pos' ( out 4-component vector of float Position) + + +Linked geometry stage: + + +Shader version: 500 +invocations = 1 +max_vertices = 3 +input primitive = triangles +output primitive = triangle_strip +0:? Sequence +0:14 Function Definition: @main(struct-PS_IN-vf41[3];struct-GS_OUT-vf41; ( temp void) +0:14 Function Parameters: +0:14 'i' ( in 3-element array of structure{ temp 4-component vector of float pos}) +0:14 'ts' ( out structure{ temp 4-component vector of float pos}) +0:? Sequence +0:17 Sequence +0:17 move second child to first child ( temp int) +0:17 'x' ( temp int) +0:17 Constant: +0:17 0 (const int) +0:17 Loop with condition tested first +0:17 Loop Condition +0:17 Compare Less Than ( temp bool) +0:17 'x' ( temp int) +0:17 Constant: +0:17 3 (const int) +0:17 Loop Body +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:18 pos: direct index for structure ( temp 4-component vector of float) +0:18 'o' ( temp structure{ temp 4-component vector of float pos}) +0:18 Constant: +0:18 0 (const int) +0:18 pos: direct index for structure ( temp 4-component vector of float) +0:18 indirect index ( temp structure{ temp 4-component vector of float pos}) +0:18 'i' ( in 3-element array of structure{ temp 4-component vector of float pos}) +0:18 'x' ( temp int) +0:18 Constant: +0:18 0 (const int) +0:19 Sequence +0:19 Sequence +0:19 move second child to first child ( temp 4-component vector of float) +0:? 'ts.pos' ( out 4-component vector of float Position) +0:19 pos: direct index for structure ( temp 4-component vector of float) +0:19 'o' ( temp structure{ temp 4-component vector of float pos}) +0:19 Constant: +0:19 0 (const int) +0:19 EmitVertex ( temp void) +0:17 Loop Terminal Expression +0:17 Pre-Increment ( temp int) +0:17 'x' ( temp int) +0:14 Function Definition: main( ( temp void) +0:14 Function Parameters: +0:? Sequence +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 pos: direct index for structure ( temp 4-component vector of float) +0:14 direct index ( temp structure{ temp 4-component vector of float pos}) +0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos}) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 direct index ( in 4-component vector of float Position) +0:? 'i.pos' ( in 3-element array of 4-component vector of float Position) +0:14 Constant: +0:14 0 (const int) +0:14 move second child to first child ( temp 4-component vector of float) +0:14 pos: direct index for structure ( temp 4-component vector of float) +0:14 direct index ( temp structure{ temp 4-component vector of float pos}) +0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos}) +0:14 Constant: +0:14 1 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 direct index ( in 4-component vector of float Position) +0:? 'i.pos' ( in 3-element array of 4-component vector of float Position) +0:14 Constant: +0:14 1 (const int) +0:14 move second child to first child ( temp 4-component vector of float) +0:14 pos: direct index for structure ( temp 4-component vector of float) +0:14 direct index ( temp structure{ temp 4-component vector of float pos}) +0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos}) +0:14 Constant: +0:14 2 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 direct index ( in 4-component vector of float Position) +0:? 'i.pos' ( in 3-element array of 4-component vector of float Position) +0:14 Constant: +0:14 2 (const int) +0:14 Function Call: @main(struct-PS_IN-vf41[3];struct-GS_OUT-vf41; ( temp void) +0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos}) +0:? 'ts' ( temp structure{ temp 4-component vector of float pos}) +0:? Linker Objects +0:? 'i.pos' ( in 3-element array of 4-component vector of float Position) +0:? 'ts.pos' ( out 4-component vector of float Position) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 67 + + Capability Geometry + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 40 49 + ExecutionMode 4 Triangles + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputTriangleStrip + ExecutionMode 4 OutputVertices 3 + Source HLSL 500 + Name 4 "main" + Name 8 "PS_IN" + MemberName 8(PS_IN) 0 "pos" + Name 13 "GS_OUT" + MemberName 13(GS_OUT) 0 "pos" + Name 18 "@main(struct-PS_IN-vf41[3];struct-GS_OUT-vf41;" + Name 16 "i" + Name 17 "ts" + Name 22 "x" + Name 33 "o" + Name 40 "ts.pos" + Name 46 "i" + Name 49 "i.pos" + Name 61 "ts" + Name 62 "param" + Name 64 "param" + Decorate 40(ts.pos) BuiltIn Position + Decorate 49(i.pos) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_IN): TypeStruct 7(fvec4) + 9: TypeInt 32 0 + 10: 9(int) Constant 3 + 11: TypeArray 8(PS_IN) 10 + 12: TypePointer Function 11 + 13(GS_OUT): TypeStruct 7(fvec4) + 14: TypePointer Function 13(GS_OUT) + 15: TypeFunction 2 12(ptr) 14(ptr) + 20: TypeInt 32 1 + 21: TypePointer Function 20(int) + 23: 20(int) Constant 0 + 30: 20(int) Constant 3 + 31: TypeBool + 35: TypePointer Function 7(fvec4) + 39: TypePointer Output 7(fvec4) + 40(ts.pos): 39(ptr) Variable Output + 44: 20(int) Constant 1 + 47: TypeArray 7(fvec4) 10 + 48: TypePointer Input 47 + 49(i.pos): 48(ptr) Variable Input + 50: TypePointer Input 7(fvec4) + 57: 20(int) Constant 2 + 4(main): 2 Function None 3 + 5: Label + 46(i): 12(ptr) Variable Function + 61(ts): 14(ptr) Variable Function + 62(param): 12(ptr) Variable Function + 64(param): 14(ptr) Variable Function + 51: 50(ptr) AccessChain 49(i.pos) 23 + 52: 7(fvec4) Load 51 + 53: 35(ptr) AccessChain 46(i) 23 23 + Store 53 52 + 54: 50(ptr) AccessChain 49(i.pos) 44 + 55: 7(fvec4) Load 54 + 56: 35(ptr) AccessChain 46(i) 44 23 + Store 56 55 + 58: 50(ptr) AccessChain 49(i.pos) 57 + 59: 7(fvec4) Load 58 + 60: 35(ptr) AccessChain 46(i) 57 23 + Store 60 59 + 63: 11 Load 46(i) + Store 62(param) 63 + 65: 2 FunctionCall 18(@main(struct-PS_IN-vf41[3];struct-GS_OUT-vf41;) 62(param) 64(param) + 66: 13(GS_OUT) Load 64(param) + Store 61(ts) 66 + Return + FunctionEnd +18(@main(struct-PS_IN-vf41[3];struct-GS_OUT-vf41;): 2 Function None 15 + 16(i): 12(ptr) FunctionParameter + 17(ts): 14(ptr) FunctionParameter + 19: Label + 22(x): 21(ptr) Variable Function + 33(o): 14(ptr) Variable Function + Store 22(x) 23 + Branch 24 + 24: Label + LoopMerge 26 27 None + Branch 28 + 28: Label + 29: 20(int) Load 22(x) + 32: 31(bool) SLessThan 29 30 + BranchConditional 32 25 26 + 25: Label + 34: 20(int) Load 22(x) + 36: 35(ptr) AccessChain 16(i) 34 23 + 37: 7(fvec4) Load 36 + 38: 35(ptr) AccessChain 33(o) 23 + Store 38 37 + 41: 35(ptr) AccessChain 33(o) 23 + 42: 7(fvec4) Load 41 + Store 40(ts.pos) 42 + EmitVertex + Branch 27 + 27: Label + 43: 20(int) Load 22(x) + 45: 20(int) IAdd 43 44 + Store 22(x) 45 + Branch 24 + 26: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.struct.split.trivial.vert.out b/deps/glslang/Test/baseResults/hlsl.struct.split.trivial.vert.out new file mode 100644 index 00000000..8bf477e6 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.struct.split.trivial.vert.out @@ -0,0 +1,178 @@ +hlsl.struct.split.trivial.vert +Shader version: 500 +0:? Sequence +0:16 Function Definition: @main(struct-VS_INPUT-vf41;vf4; ( temp structure{ temp 4-component vector of float Pos}) +0:16 Function Parameters: +0:16 'vsin' ( in structure{ temp 4-component vector of float Pos_in}) +0:16 'Pos_loose' ( in 4-component vector of float) +0:? Sequence +0:19 move second child to first child ( temp 4-component vector of float) +0:19 Pos: direct index for structure ( temp 4-component vector of float) +0:19 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:19 Constant: +0:19 0 (const int) +0:19 add ( temp 4-component vector of float) +0:19 Pos_in: direct index for structure ( temp 4-component vector of float) +0:19 'vsin' ( in structure{ temp 4-component vector of float Pos_in}) +0:19 Constant: +0:19 0 (const int) +0:19 'Pos_loose' ( in 4-component vector of float) +0:21 Branch: Return with expression +0:21 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:16 Function Definition: main( ( temp void) +0:16 Function Parameters: +0:? Sequence +0:16 Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:16 Pos_in: direct index for structure ( temp 4-component vector of float) +0:? 'vsin' ( temp structure{ temp 4-component vector of float Pos_in}) +0:16 Constant: +0:16 0 (const int) +0:? 'vsin.Pos_in' (layout( location=0) in 4-component vector of float) +0:16 move second child to first child ( temp 4-component vector of float) +0:? 'Pos_loose' ( temp 4-component vector of float) +0:? 'Pos_loose' (layout( location=1) in 4-component vector of float) +0:16 Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:16 Pos: direct index for structure ( temp 4-component vector of float) +0:16 Function Call: @main(struct-VS_INPUT-vf41;vf4; ( temp structure{ temp 4-component vector of float Pos}) +0:? 'vsin' ( temp structure{ temp 4-component vector of float Pos_in}) +0:? 'Pos_loose' ( temp 4-component vector of float) +0:16 Constant: +0:16 0 (const int) +0:? Linker Objects +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:? 'vsin.Pos_in' (layout( location=0) in 4-component vector of float) +0:? 'Pos_loose' (layout( location=1) in 4-component vector of float) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:16 Function Definition: @main(struct-VS_INPUT-vf41;vf4; ( temp structure{ temp 4-component vector of float Pos}) +0:16 Function Parameters: +0:16 'vsin' ( in structure{ temp 4-component vector of float Pos_in}) +0:16 'Pos_loose' ( in 4-component vector of float) +0:? Sequence +0:19 move second child to first child ( temp 4-component vector of float) +0:19 Pos: direct index for structure ( temp 4-component vector of float) +0:19 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:19 Constant: +0:19 0 (const int) +0:19 add ( temp 4-component vector of float) +0:19 Pos_in: direct index for structure ( temp 4-component vector of float) +0:19 'vsin' ( in structure{ temp 4-component vector of float Pos_in}) +0:19 Constant: +0:19 0 (const int) +0:19 'Pos_loose' ( in 4-component vector of float) +0:21 Branch: Return with expression +0:21 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:16 Function Definition: main( ( temp void) +0:16 Function Parameters: +0:? Sequence +0:16 Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:16 Pos_in: direct index for structure ( temp 4-component vector of float) +0:? 'vsin' ( temp structure{ temp 4-component vector of float Pos_in}) +0:16 Constant: +0:16 0 (const int) +0:? 'vsin.Pos_in' (layout( location=0) in 4-component vector of float) +0:16 move second child to first child ( temp 4-component vector of float) +0:? 'Pos_loose' ( temp 4-component vector of float) +0:? 'Pos_loose' (layout( location=1) in 4-component vector of float) +0:16 Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:16 Pos: direct index for structure ( temp 4-component vector of float) +0:16 Function Call: @main(struct-VS_INPUT-vf41;vf4; ( temp structure{ temp 4-component vector of float Pos}) +0:? 'vsin' ( temp structure{ temp 4-component vector of float Pos_in}) +0:? 'Pos_loose' ( temp 4-component vector of float) +0:16 Constant: +0:16 0 (const int) +0:? Linker Objects +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:? 'vsin.Pos_in' (layout( location=0) in 4-component vector of float) +0:? 'Pos_loose' (layout( location=1) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 45 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 31 35 38 + Source HLSL 500 + Name 4 "main" + Name 8 "VS_INPUT" + MemberName 8(VS_INPUT) 0 "Pos_in" + Name 11 "VS_OUTPUT" + MemberName 11(VS_OUTPUT) 0 "Pos" + Name 15 "@main(struct-VS_INPUT-vf41;vf4;" + Name 13 "vsin" + Name 14 "Pos_loose" + Name 18 "vsout" + Name 29 "vsin" + Name 31 "vsin.Pos_in" + Name 34 "Pos_loose" + Name 35 "Pos_loose" + Name 38 "@entryPointOutput.Pos" + Name 39 "param" + Name 41 "param" + Decorate 31(vsin.Pos_in) Location 0 + Decorate 35(Pos_loose) Location 1 + Decorate 38(@entryPointOutput.Pos) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(VS_INPUT): TypeStruct 7(fvec4) + 9: TypePointer Function 8(VS_INPUT) + 10: TypePointer Function 7(fvec4) + 11(VS_OUTPUT): TypeStruct 7(fvec4) + 12: TypeFunction 11(VS_OUTPUT) 9(ptr) 10(ptr) + 17: TypePointer Function 11(VS_OUTPUT) + 19: TypeInt 32 1 + 20: 19(int) Constant 0 + 30: TypePointer Input 7(fvec4) + 31(vsin.Pos_in): 30(ptr) Variable Input + 35(Pos_loose): 30(ptr) Variable Input + 37: TypePointer Output 7(fvec4) +38(@entryPointOutput.Pos): 37(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 29(vsin): 9(ptr) Variable Function + 34(Pos_loose): 10(ptr) Variable Function + 39(param): 9(ptr) Variable Function + 41(param): 10(ptr) Variable Function + 32: 7(fvec4) Load 31(vsin.Pos_in) + 33: 10(ptr) AccessChain 29(vsin) 20 + Store 33 32 + 36: 7(fvec4) Load 35(Pos_loose) + Store 34(Pos_loose) 36 + 40: 8(VS_INPUT) Load 29(vsin) + Store 39(param) 40 + 42: 7(fvec4) Load 34(Pos_loose) + Store 41(param) 42 + 43:11(VS_OUTPUT) FunctionCall 15(@main(struct-VS_INPUT-vf41;vf4;) 39(param) 41(param) + 44: 7(fvec4) CompositeExtract 43 0 + Store 38(@entryPointOutput.Pos) 44 + Return + FunctionEnd +15(@main(struct-VS_INPUT-vf41;vf4;):11(VS_OUTPUT) Function None 12 + 13(vsin): 9(ptr) FunctionParameter + 14(Pos_loose): 10(ptr) FunctionParameter + 16: Label + 18(vsout): 17(ptr) Variable Function + 21: 10(ptr) AccessChain 13(vsin) 20 + 22: 7(fvec4) Load 21 + 23: 7(fvec4) Load 14(Pos_loose) + 24: 7(fvec4) FAdd 22 23 + 25: 10(ptr) AccessChain 18(vsout) 20 + Store 25 24 + 26:11(VS_OUTPUT) Load 18(vsout) + ReturnValue 26 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.structIoFourWay.frag.out b/deps/glslang/Test/baseResults/hlsl.structIoFourWay.frag.out new file mode 100644 index 00000000..f60c80b4 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.structIoFourWay.frag.out @@ -0,0 +1,300 @@ +hlsl.structIoFourWay.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_greater +0:? Sequence +0:15 Function Definition: @main(struct-T-f1-f1-f1-vf41; ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Function Parameters: +0:15 't' ( in structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:? Sequence +0:17 Branch: Return with expression +0:17 'local' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Function Definition: main( ( temp void) +0:15 Function Parameters: +0:? Sequence +0:15 Sequence +0:15 move second child to first child ( temp float) +0:15 f: direct index for structure ( temp float) +0:? 't' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Constant: +0:15 0 (const int) +0:? 't.f' (layout( location=0) in float) +0:15 move second child to first child ( temp float) +0:15 g: direct index for structure ( temp float) +0:? 't' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Constant: +0:15 1 (const int) +0:? 't.g' (layout( location=1) centroid in float) +0:15 move second child to first child ( temp float) +0:15 d: direct index for structure ( temp float) +0:? 't' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Constant: +0:15 2 (const int) +0:? 't.d' (layout( location=2) in float) +0:15 move second child to first child ( temp 4-component vector of float) +0:15 normal: direct index for structure ( temp 4-component vector of float) +0:? 't' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Constant: +0:15 3 (const int) +0:? 't.normal' (layout( location=3) in 4-component vector of float) +0:15 Sequence +0:15 move second child to first child ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 'flattenTemp' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Function Call: @main(struct-T-f1-f1-f1-vf41; ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:? 't' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 move second child to first child ( temp float) +0:? '@entryPointOutput.f' (layout( location=0) out float) +0:15 f: direct index for structure ( temp float) +0:15 'flattenTemp' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Constant: +0:15 0 (const int) +0:15 move second child to first child ( temp float) +0:? '@entryPointOutput.g' (layout( location=1) out float) +0:15 g: direct index for structure ( temp float) +0:15 'flattenTemp' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Constant: +0:15 1 (const int) +0:15 move second child to first child ( temp float) +0:? '@entryPointOutput.d' ( out float FragDepth) +0:15 d: direct index for structure ( temp float) +0:15 'flattenTemp' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Constant: +0:15 2 (const int) +0:15 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.normal' (layout( location=2) out 4-component vector of float) +0:15 normal: direct index for structure ( temp 4-component vector of float) +0:15 'flattenTemp' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Constant: +0:15 3 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform structure{layout( offset=68) temp float f, temp float g, temp float d, temp 4-component vector of float normal} s}) +0:? 'anon@1' (layout( row_major std140) uniform block{layout( row_major std140 offset=88) uniform structure{layout( offset=68) temp float f, temp float g, temp float d, temp 4-component vector of float normal} t}) +0:? '@entryPointOutput.d' ( out float FragDepth) +0:? '@entryPointOutput.f' (layout( location=0) out float) +0:? '@entryPointOutput.g' (layout( location=1) out float) +0:? '@entryPointOutput.normal' (layout( location=2) out 4-component vector of float) +0:? 't.f' (layout( location=0) in float) +0:? 't.g' (layout( location=1) centroid in float) +0:? 't.d' (layout( location=2) in float) +0:? 't.normal' (layout( location=3) in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_greater +0:? Sequence +0:15 Function Definition: @main(struct-T-f1-f1-f1-vf41; ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Function Parameters: +0:15 't' ( in structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:? Sequence +0:17 Branch: Return with expression +0:17 'local' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Function Definition: main( ( temp void) +0:15 Function Parameters: +0:? Sequence +0:15 Sequence +0:15 move second child to first child ( temp float) +0:15 f: direct index for structure ( temp float) +0:? 't' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Constant: +0:15 0 (const int) +0:? 't.f' (layout( location=0) in float) +0:15 move second child to first child ( temp float) +0:15 g: direct index for structure ( temp float) +0:? 't' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Constant: +0:15 1 (const int) +0:? 't.g' (layout( location=1) centroid in float) +0:15 move second child to first child ( temp float) +0:15 d: direct index for structure ( temp float) +0:? 't' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Constant: +0:15 2 (const int) +0:? 't.d' (layout( location=2) in float) +0:15 move second child to first child ( temp 4-component vector of float) +0:15 normal: direct index for structure ( temp 4-component vector of float) +0:? 't' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Constant: +0:15 3 (const int) +0:? 't.normal' (layout( location=3) in 4-component vector of float) +0:15 Sequence +0:15 move second child to first child ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 'flattenTemp' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Function Call: @main(struct-T-f1-f1-f1-vf41; ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:? 't' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 move second child to first child ( temp float) +0:? '@entryPointOutput.f' (layout( location=0) out float) +0:15 f: direct index for structure ( temp float) +0:15 'flattenTemp' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Constant: +0:15 0 (const int) +0:15 move second child to first child ( temp float) +0:? '@entryPointOutput.g' (layout( location=1) out float) +0:15 g: direct index for structure ( temp float) +0:15 'flattenTemp' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Constant: +0:15 1 (const int) +0:15 move second child to first child ( temp float) +0:? '@entryPointOutput.d' ( out float FragDepth) +0:15 d: direct index for structure ( temp float) +0:15 'flattenTemp' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Constant: +0:15 2 (const int) +0:15 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.normal' (layout( location=2) out 4-component vector of float) +0:15 normal: direct index for structure ( temp 4-component vector of float) +0:15 'flattenTemp' ( temp structure{ temp float f, temp float g, temp float d, temp 4-component vector of float normal}) +0:15 Constant: +0:15 3 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform structure{layout( offset=68) temp float f, temp float g, temp float d, temp 4-component vector of float normal} s}) +0:? 'anon@1' (layout( row_major std140) uniform block{layout( row_major std140 offset=88) uniform structure{layout( offset=68) temp float f, temp float g, temp float d, temp 4-component vector of float normal} t}) +0:? '@entryPointOutput.d' ( out float FragDepth) +0:? '@entryPointOutput.f' (layout( location=0) out float) +0:? '@entryPointOutput.g' (layout( location=1) out float) +0:? '@entryPointOutput.normal' (layout( location=2) out 4-component vector of float) +0:? 't.f' (layout( location=0) in float) +0:? 't.g' (layout( location=1) centroid in float) +0:? 't.d' (layout( location=2) in float) +0:? 't.normal' (layout( location=3) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 65 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 22 27 31 36 45 48 51 55 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthGreater + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "T" + MemberName 8(T) 0 "f" + MemberName 8(T) 1 "g" + MemberName 8(T) 2 "d" + MemberName 8(T) 3 "normal" + Name 12 "@main(struct-T-f1-f1-f1-vf41;" + Name 11 "t" + Name 14 "local" + Name 18 "t" + Name 22 "t.f" + Name 27 "t.g" + Name 31 "t.d" + Name 36 "t.normal" + Name 40 "flattenTemp" + Name 41 "param" + Name 45 "@entryPointOutput.f" + Name 48 "@entryPointOutput.g" + Name 51 "@entryPointOutput.d" + Name 55 "@entryPointOutput.normal" + Name 58 "T" + MemberName 58(T) 0 "f" + MemberName 58(T) 1 "g" + MemberName 58(T) 2 "d" + MemberName 58(T) 3 "normal" + Name 59 "$Global" + MemberName 59($Global) 0 "s" + Name 61 "" + Name 62 "buff" + MemberName 62(buff) 0 "t" + Name 64 "" + Decorate 22(t.f) Location 0 + Decorate 27(t.g) Centroid + Decorate 27(t.g) Location 1 + Decorate 31(t.d) Location 2 + Decorate 36(t.normal) Location 3 + Decorate 45(@entryPointOutput.f) Location 0 + Decorate 48(@entryPointOutput.g) Location 1 + Decorate 51(@entryPointOutput.d) BuiltIn FragDepth + Decorate 55(@entryPointOutput.normal) Location 2 + MemberDecorate 58(T) 0 Offset 68 + MemberDecorate 58(T) 1 Offset 72 + MemberDecorate 58(T) 2 Offset 76 + MemberDecorate 58(T) 3 Offset 80 + MemberDecorate 59($Global) 0 Offset 0 + Decorate 59($Global) Block + Decorate 61 DescriptorSet 0 + MemberDecorate 62(buff) 0 Offset 96 + Decorate 62(buff) Block + Decorate 64 DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(T): TypeStruct 6(float) 6(float) 6(float) 7(fvec4) + 9: TypePointer Function 8(T) + 10: TypeFunction 8(T) 9(ptr) + 19: TypeInt 32 1 + 20: 19(int) Constant 0 + 21: TypePointer Input 6(float) + 22(t.f): 21(ptr) Variable Input + 24: TypePointer Function 6(float) + 26: 19(int) Constant 1 + 27(t.g): 21(ptr) Variable Input + 30: 19(int) Constant 2 + 31(t.d): 21(ptr) Variable Input + 34: 19(int) Constant 3 + 35: TypePointer Input 7(fvec4) + 36(t.normal): 35(ptr) Variable Input + 38: TypePointer Function 7(fvec4) + 44: TypePointer Output 6(float) +45(@entryPointOutput.f): 44(ptr) Variable Output +48(@entryPointOutput.g): 44(ptr) Variable Output +51(@entryPointOutput.d): 44(ptr) Variable Output + 54: TypePointer Output 7(fvec4) +55(@entryPointOutput.normal): 54(ptr) Variable Output + 58(T): TypeStruct 6(float) 6(float) 6(float) 7(fvec4) + 59($Global): TypeStruct 58(T) + 60: TypePointer Uniform 59($Global) + 61: 60(ptr) Variable Uniform + 62(buff): TypeStruct 58(T) + 63: TypePointer Uniform 62(buff) + 64: 63(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + 18(t): 9(ptr) Variable Function + 40(flattenTemp): 9(ptr) Variable Function + 41(param): 9(ptr) Variable Function + 23: 6(float) Load 22(t.f) + 25: 24(ptr) AccessChain 18(t) 20 + Store 25 23 + 28: 6(float) Load 27(t.g) + 29: 24(ptr) AccessChain 18(t) 26 + Store 29 28 + 32: 6(float) Load 31(t.d) + 33: 24(ptr) AccessChain 18(t) 30 + Store 33 32 + 37: 7(fvec4) Load 36(t.normal) + 39: 38(ptr) AccessChain 18(t) 34 + Store 39 37 + 42: 8(T) Load 18(t) + Store 41(param) 42 + 43: 8(T) FunctionCall 12(@main(struct-T-f1-f1-f1-vf41;) 41(param) + Store 40(flattenTemp) 43 + 46: 24(ptr) AccessChain 40(flattenTemp) 20 + 47: 6(float) Load 46 + Store 45(@entryPointOutput.f) 47 + 49: 24(ptr) AccessChain 40(flattenTemp) 26 + 50: 6(float) Load 49 + Store 48(@entryPointOutput.g) 50 + 52: 24(ptr) AccessChain 40(flattenTemp) 30 + 53: 6(float) Load 52 + Store 51(@entryPointOutput.d) 53 + 56: 38(ptr) AccessChain 40(flattenTemp) 34 + 57: 7(fvec4) Load 56 + Store 55(@entryPointOutput.normal) 57 + Return + FunctionEnd +12(@main(struct-T-f1-f1-f1-vf41;): 8(T) Function None 10 + 11(t): 9(ptr) FunctionParameter + 13: Label + 14(local): 9(ptr) Variable Function + 15: 8(T) Load 14(local) + ReturnValue 15 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.structStructName.frag.out b/deps/glslang/Test/baseResults/hlsl.structStructName.frag.out new file mode 100644 index 00000000..183dcf63 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.structStructName.frag.out @@ -0,0 +1,85 @@ +hlsl.structStructName.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: @main( ( temp int) +0:4 Function Parameters: +0:? Sequence +0:6 Branch: Return with expression +0:6 s: direct index for structure ( temp int) +0:6 't' ( temp structure{ temp int s}) +0:6 Constant: +0:6 0 (const int) +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 move second child to first child ( temp int) +0:? '@entryPointOutput' (layout( location=0) out int) +0:4 Function Call: @main( ( temp int) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out int) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: @main( ( temp int) +0:4 Function Parameters: +0:? Sequence +0:6 Branch: Return with expression +0:6 s: direct index for structure ( temp int) +0:6 't' ( temp structure{ temp int s}) +0:6 Constant: +0:6 0 (const int) +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 move second child to first child ( temp int) +0:? '@entryPointOutput' (layout( location=0) out int) +0:4 Function Call: @main( ( temp int) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out int) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 22 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 20 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "@main(" + Name 10 "S" + MemberName 10(S) 0 "s" + Name 12 "t" + Name 20 "@entryPointOutput" + Decorate 20(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeFunction 6(int) + 10(S): TypeStruct 6(int) + 11: TypePointer Function 10(S) + 13: 6(int) Constant 0 + 14: TypePointer Function 6(int) + 19: TypePointer Output 6(int) +20(@entryPointOutput): 19(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 21: 6(int) FunctionCall 8(@main() + Store 20(@entryPointOutput) 21 + Return + FunctionEnd + 8(@main(): 6(int) Function None 7 + 9: Label + 12(t): 11(ptr) Variable Function + 15: 14(ptr) AccessChain 12(t) 13 + 16: 6(int) Load 15 + ReturnValue 16 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.structarray.flatten.frag.out b/deps/glslang/Test/baseResults/hlsl.structarray.flatten.frag.out new file mode 100644 index 00000000..0756a528 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.structarray.flatten.frag.out @@ -0,0 +1,306 @@ +hlsl.structarray.flatten.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:23 Function Definition: @main(struct-PS_OUTPUT-vf41; ( temp void) +0:23 Function Parameters: +0:23 'ps_output' ( out structure{ temp 4-component vector of float color}) +0:? Sequence +0:24 move second child to first child ( temp 4-component vector of float) +0:24 color: direct index for structure ( temp 4-component vector of float) +0:24 'ps_output' ( out structure{ temp 4-component vector of float color}) +0:24 Constant: +0:24 0 (const int) +0:26 add ( temp 4-component vector of float) +0:25 add ( temp 4-component vector of float) +0:25 texture ( temp 4-component vector of float) +0:25 Construct combined texture-sampler ( temp sampler1D) +0:? 'g_texdata.tex' ( uniform texture1D) +0:? 'g_texdata.samp' ( uniform sampler) +0:25 Constant: +0:25 0.500000 +0:26 texture ( temp 4-component vector of float) +0:26 Construct combined texture-sampler ( temp sampler1D) +0:? 'g_texdata_array[1].tex' ( uniform texture1D) +0:? 'g_texdata_array[1].samp' ( uniform sampler) +0:26 Constant: +0:26 0.400000 +0:27 texture ( temp 4-component vector of float) +0:27 Construct combined texture-sampler ( temp sampler1D) +0:27 direct index ( temp texture1D) +0:? 'g_texdata_array2[1].tex' ( uniform 2-element array of texture1D) +0:27 Constant: +0:27 0 (const int) +0:27 direct index ( temp sampler) +0:? 'g_texdata_array2[1].samp' ( uniform 2-element array of sampler) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 0.300000 +0:23 Function Definition: main( ( temp void) +0:23 Function Parameters: +0:? Sequence +0:23 Function Call: @main(struct-PS_OUTPUT-vf41; ( temp void) +0:? 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:23 Sequence +0:23 move second child to first child ( temp 4-component vector of float) +0:? 'ps_output.color' (layout( location=0) out 4-component vector of float) +0:23 color: direct index for structure ( temp 4-component vector of float) +0:? 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:23 Constant: +0:23 0 (const int) +0:? Linker Objects +0:? 'g_samp' ( uniform sampler) +0:? 'g_tex' ( uniform texture1D) +0:? 'g_texdata.samp' ( uniform sampler) +0:? 'g_texdata.tex' ( uniform texture1D) +0:? 'g_texdata.nonopaque_thing' ( uniform int) +0:? 'g_texdata_array[0].samp' ( uniform sampler) +0:? 'g_texdata_array[0].tex' ( uniform texture1D) +0:? 'g_texdata_array[0].nonopaque_thing' ( uniform int) +0:? 'g_texdata_array[1].samp' ( uniform sampler) +0:? 'g_texdata_array[1].tex' ( uniform texture1D) +0:? 'g_texdata_array[1].nonopaque_thing' ( uniform int) +0:? 'g_texdata_array[2].samp' ( uniform sampler) +0:? 'g_texdata_array[2].tex' ( uniform texture1D) +0:? 'g_texdata_array[2].nonopaque_thing' ( uniform int) +0:? 'g_texdata_array2[0].samp' ( uniform 2-element array of sampler) +0:? 'g_texdata_array2[0].tex' ( uniform 2-element array of texture1D) +0:? 'g_texdata_array2[0].nonopaque_thing' ( uniform int) +0:? 'g_texdata_array2[1].samp' ( uniform 2-element array of sampler) +0:? 'g_texdata_array2[1].tex' ( uniform 2-element array of texture1D) +0:? 'g_texdata_array2[1].nonopaque_thing' ( uniform int) +0:? 'g_texdata_array2[2].samp' ( uniform 2-element array of sampler) +0:? 'g_texdata_array2[2].tex' ( uniform 2-element array of texture1D) +0:? 'g_texdata_array2[2].nonopaque_thing' ( uniform int) +0:? 'ps_output.color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:23 Function Definition: @main(struct-PS_OUTPUT-vf41; ( temp void) +0:23 Function Parameters: +0:23 'ps_output' ( out structure{ temp 4-component vector of float color}) +0:? Sequence +0:24 move second child to first child ( temp 4-component vector of float) +0:24 color: direct index for structure ( temp 4-component vector of float) +0:24 'ps_output' ( out structure{ temp 4-component vector of float color}) +0:24 Constant: +0:24 0 (const int) +0:26 add ( temp 4-component vector of float) +0:25 add ( temp 4-component vector of float) +0:25 texture ( temp 4-component vector of float) +0:25 Construct combined texture-sampler ( temp sampler1D) +0:? 'g_texdata.tex' ( uniform texture1D) +0:? 'g_texdata.samp' ( uniform sampler) +0:25 Constant: +0:25 0.500000 +0:26 texture ( temp 4-component vector of float) +0:26 Construct combined texture-sampler ( temp sampler1D) +0:? 'g_texdata_array[1].tex' ( uniform texture1D) +0:? 'g_texdata_array[1].samp' ( uniform sampler) +0:26 Constant: +0:26 0.400000 +0:27 texture ( temp 4-component vector of float) +0:27 Construct combined texture-sampler ( temp sampler1D) +0:27 direct index ( temp texture1D) +0:? 'g_texdata_array2[1].tex' ( uniform 2-element array of texture1D) +0:27 Constant: +0:27 0 (const int) +0:27 direct index ( temp sampler) +0:? 'g_texdata_array2[1].samp' ( uniform 2-element array of sampler) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 0.300000 +0:23 Function Definition: main( ( temp void) +0:23 Function Parameters: +0:? Sequence +0:23 Function Call: @main(struct-PS_OUTPUT-vf41; ( temp void) +0:? 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:23 Sequence +0:23 move second child to first child ( temp 4-component vector of float) +0:? 'ps_output.color' (layout( location=0) out 4-component vector of float) +0:23 color: direct index for structure ( temp 4-component vector of float) +0:? 'ps_output' ( temp structure{ temp 4-component vector of float color}) +0:23 Constant: +0:23 0 (const int) +0:? Linker Objects +0:? 'g_samp' ( uniform sampler) +0:? 'g_tex' ( uniform texture1D) +0:? 'g_texdata.samp' ( uniform sampler) +0:? 'g_texdata.tex' ( uniform texture1D) +0:? 'g_texdata.nonopaque_thing' ( uniform int) +0:? 'g_texdata_array[0].samp' ( uniform sampler) +0:? 'g_texdata_array[0].tex' ( uniform texture1D) +0:? 'g_texdata_array[0].nonopaque_thing' ( uniform int) +0:? 'g_texdata_array[1].samp' ( uniform sampler) +0:? 'g_texdata_array[1].tex' ( uniform texture1D) +0:? 'g_texdata_array[1].nonopaque_thing' ( uniform int) +0:? 'g_texdata_array[2].samp' ( uniform sampler) +0:? 'g_texdata_array[2].tex' ( uniform texture1D) +0:? 'g_texdata_array[2].nonopaque_thing' ( uniform int) +0:? 'g_texdata_array2[0].samp' ( uniform 2-element array of sampler) +0:? 'g_texdata_array2[0].tex' ( uniform 2-element array of texture1D) +0:? 'g_texdata_array2[0].nonopaque_thing' ( uniform int) +0:? 'g_texdata_array2[1].samp' ( uniform 2-element array of sampler) +0:? 'g_texdata_array2[1].tex' ( uniform 2-element array of texture1D) +0:? 'g_texdata_array2[1].nonopaque_thing' ( uniform int) +0:? 'g_texdata_array2[2].samp' ( uniform 2-element array of sampler) +0:? 'g_texdata_array2[2].tex' ( uniform 2-element array of texture1D) +0:? 'g_texdata_array2[2].nonopaque_thing' ( uniform int) +0:? 'ps_output.color' (layout( location=0) out 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: From Vulkan spec, section 14.5.2: +Variables identified with the UniformConstant storage class are used only as handles to refer to opaque resources. Such variables must be typed as OpTypeImage, OpTypeSampler, OpTypeSampledImage, OpTypeAccelerationStructureNV, or an array of one of these types. + %g_texdata_nonopaque_thing = OpVariable %_ptr_UniformConstant_int UniformConstant + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 80 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 59 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "color" + Name 12 "@main(struct-PS_OUTPUT-vf41;" + Name 11 "ps_output" + Name 18 "g_texdata.tex" + Name 22 "g_texdata.samp" + Name 28 "g_texdata_array[1].tex" + Name 30 "g_texdata_array[1].samp" + Name 40 "g_texdata_array2[1].tex" + Name 45 "g_texdata_array2[1].samp" + Name 54 "ps_output" + Name 55 "param" + Name 59 "ps_output.color" + Name 62 "g_samp" + Name 63 "g_tex" + Name 65 "g_texdata.nonopaque_thing" + Name 66 "g_texdata_array[0].samp" + Name 67 "g_texdata_array[0].tex" + Name 68 "g_texdata_array[0].nonopaque_thing" + Name 69 "g_texdata_array[1].nonopaque_thing" + Name 70 "g_texdata_array[2].samp" + Name 71 "g_texdata_array[2].tex" + Name 72 "g_texdata_array[2].nonopaque_thing" + Name 73 "g_texdata_array2[0].samp" + Name 74 "g_texdata_array2[0].tex" + Name 75 "g_texdata_array2[0].nonopaque_thing" + Name 76 "g_texdata_array2[1].nonopaque_thing" + Name 77 "g_texdata_array2[2].samp" + Name 78 "g_texdata_array2[2].tex" + Name 79 "g_texdata_array2[2].nonopaque_thing" + Decorate 18(g_texdata.tex) DescriptorSet 0 + Decorate 22(g_texdata.samp) DescriptorSet 0 + Decorate 28(g_texdata_array[1].tex) DescriptorSet 0 + Decorate 30(g_texdata_array[1].samp) DescriptorSet 0 + Decorate 40(g_texdata_array2[1].tex) DescriptorSet 0 + Decorate 45(g_texdata_array2[1].samp) DescriptorSet 0 + Decorate 59(ps_output.color) Location 0 + Decorate 62(g_samp) DescriptorSet 0 + Decorate 63(g_tex) DescriptorSet 0 + Decorate 66(g_texdata_array[0].samp) DescriptorSet 0 + Decorate 67(g_texdata_array[0].tex) DescriptorSet 0 + Decorate 70(g_texdata_array[2].samp) DescriptorSet 0 + Decorate 71(g_texdata_array[2].tex) DescriptorSet 0 + Decorate 73(g_texdata_array2[0].samp) DescriptorSet 0 + Decorate 74(g_texdata_array2[0].tex) DescriptorSet 0 + Decorate 77(g_texdata_array2[2].samp) DescriptorSet 0 + Decorate 78(g_texdata_array2[2].tex) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypePointer Function 8(PS_OUTPUT) + 10: TypeFunction 2 9(ptr) + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16: TypeImage 6(float) 1D sampled format:Unknown + 17: TypePointer UniformConstant 16 +18(g_texdata.tex): 17(ptr) Variable UniformConstant + 20: TypeSampler + 21: TypePointer UniformConstant 20 +22(g_texdata.samp): 21(ptr) Variable UniformConstant + 24: TypeSampledImage 16 + 26: 6(float) Constant 1056964608 +28(g_texdata_array[1].tex): 17(ptr) Variable UniformConstant +30(g_texdata_array[1].samp): 21(ptr) Variable UniformConstant + 33: 6(float) Constant 1053609165 + 36: TypeInt 32 0 + 37: 36(int) Constant 2 + 38: TypeArray 16 37 + 39: TypePointer UniformConstant 38 +40(g_texdata_array2[1].tex): 39(ptr) Variable UniformConstant + 43: TypeArray 20 37 + 44: TypePointer UniformConstant 43 +45(g_texdata_array2[1].samp): 44(ptr) Variable UniformConstant + 49: 6(float) Constant 1050253722 + 52: TypePointer Function 7(fvec4) + 58: TypePointer Output 7(fvec4) +59(ps_output.color): 58(ptr) Variable Output + 62(g_samp): 21(ptr) Variable UniformConstant + 63(g_tex): 17(ptr) Variable UniformConstant + 64: TypePointer UniformConstant 14(int) +65(g_texdata.nonopaque_thing): 64(ptr) Variable UniformConstant +66(g_texdata_array[0].samp): 21(ptr) Variable UniformConstant +67(g_texdata_array[0].tex): 17(ptr) Variable UniformConstant +68(g_texdata_array[0].nonopaque_thing): 64(ptr) Variable UniformConstant +69(g_texdata_array[1].nonopaque_thing): 64(ptr) Variable UniformConstant +70(g_texdata_array[2].samp): 21(ptr) Variable UniformConstant +71(g_texdata_array[2].tex): 17(ptr) Variable UniformConstant +72(g_texdata_array[2].nonopaque_thing): 64(ptr) Variable UniformConstant +73(g_texdata_array2[0].samp): 44(ptr) Variable UniformConstant +74(g_texdata_array2[0].tex): 39(ptr) Variable UniformConstant +75(g_texdata_array2[0].nonopaque_thing): 64(ptr) Variable UniformConstant +76(g_texdata_array2[1].nonopaque_thing): 64(ptr) Variable UniformConstant +77(g_texdata_array2[2].samp): 44(ptr) Variable UniformConstant +78(g_texdata_array2[2].tex): 39(ptr) Variable UniformConstant +79(g_texdata_array2[2].nonopaque_thing): 64(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 54(ps_output): 9(ptr) Variable Function + 55(param): 9(ptr) Variable Function + 56: 2 FunctionCall 12(@main(struct-PS_OUTPUT-vf41;) 55(param) + 57:8(PS_OUTPUT) Load 55(param) + Store 54(ps_output) 57 + 60: 52(ptr) AccessChain 54(ps_output) 15 + 61: 7(fvec4) Load 60 + Store 59(ps_output.color) 61 + Return + FunctionEnd +12(@main(struct-PS_OUTPUT-vf41;): 2 Function None 10 + 11(ps_output): 9(ptr) FunctionParameter + 13: Label + 19: 16 Load 18(g_texdata.tex) + 23: 20 Load 22(g_texdata.samp) + 25: 24 SampledImage 19 23 + 27: 7(fvec4) ImageSampleImplicitLod 25 26 + 29: 16 Load 28(g_texdata_array[1].tex) + 31: 20 Load 30(g_texdata_array[1].samp) + 32: 24 SampledImage 29 31 + 34: 7(fvec4) ImageSampleImplicitLod 32 33 + 35: 7(fvec4) FAdd 27 34 + 41: 17(ptr) AccessChain 40(g_texdata_array2[1].tex) 15 + 42: 16 Load 41 + 46: 21(ptr) AccessChain 45(g_texdata_array2[1].samp) 15 + 47: 20 Load 46 + 48: 24 SampledImage 42 47 + 50: 7(fvec4) ImageSampleImplicitLod 48 49 + 51: 7(fvec4) FAdd 35 50 + 53: 52(ptr) AccessChain 11(ps_output) 15 + Store 53 51 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.structarray.flatten.geom.out b/deps/glslang/Test/baseResults/hlsl.structarray.flatten.geom.out new file mode 100644 index 00000000..f88118d6 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.structarray.flatten.geom.out @@ -0,0 +1,279 @@ +hlsl.structarray.flatten.geom +Shader version: 500 +invocations = -1 +max_vertices = 4 +input primitive = lines +output primitive = triangle_strip +0:? Sequence +0:16 Function Definition: @main(struct-VertexData-vf4-vf4-vf21[2];struct-PS_IN-vf4-vf4-vf21; ( temp void) +0:16 Function Parameters: +0:16 'vin' ( in 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:16 'outStream' ( out structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:? Sequence +0:19 move second child to first child ( temp 4-component vector of float) +0:19 color: direct index for structure ( temp 4-component vector of float) +0:19 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:19 Constant: +0:19 1 (const int) +0:19 color: direct index for structure ( temp 4-component vector of float) +0:19 direct index ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:19 'vin' ( in 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 1 (const int) +0:20 move second child to first child ( temp 2-component vector of float) +0:20 uv: direct index for structure ( temp 2-component vector of float) +0:20 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:20 Constant: +0:20 2 (const int) +0:20 uv: direct index for structure ( temp 2-component vector of float) +0:20 direct index ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:20 'vin' ( in 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 2 (const int) +0:21 move second child to first child ( temp 4-component vector of float) +0:21 position: direct index for structure ( temp 4-component vector of float) +0:21 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:21 Constant: +0:21 0 (const int) +0:21 position: direct index for structure ( temp 4-component vector of float) +0:21 direct index ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:21 'vin' ( in 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 0 (const int) +0:22 Sequence +0:22 Sequence +0:22 move second child to first child ( temp 4-component vector of float) +0:? 'outStream.position' ( out 4-component vector of float Position) +0:22 position: direct index for structure ( temp 4-component vector of float) +0:22 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:22 Constant: +0:22 0 (const int) +0:22 move second child to first child ( temp 4-component vector of float) +0:? 'outStream.color' (layout( location=0) out 4-component vector of float) +0:22 color: direct index for structure ( temp 4-component vector of float) +0:22 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:22 Constant: +0:22 1 (const int) +0:22 move second child to first child ( temp 2-component vector of float) +0:? 'outStream.uv' (layout( location=1) out 2-component vector of float) +0:22 uv: direct index for structure ( temp 2-component vector of float) +0:22 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:22 Constant: +0:22 2 (const int) +0:22 EmitVertex ( temp void) +0:16 Function Definition: main( ( temp void) +0:16 Function Parameters: +0:? Sequence +0:16 move second child to first child ( temp 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:? 'vin' ( temp 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:? 'vin' (layout( location=0) in 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:16 Function Call: @main(struct-VertexData-vf4-vf4-vf21[2];struct-PS_IN-vf4-vf4-vf21; ( temp void) +0:? 'vin' ( temp 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:? 'outStream' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:? Linker Objects +0:? 'vin' (layout( location=0) in 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:? 'outStream.position' ( out 4-component vector of float Position) +0:? 'outStream.color' (layout( location=0) out 4-component vector of float) +0:? 'outStream.uv' (layout( location=1) out 2-component vector of float) + + +Linked geometry stage: + + +Shader version: 500 +invocations = 1 +max_vertices = 4 +input primitive = lines +output primitive = triangle_strip +0:? Sequence +0:16 Function Definition: @main(struct-VertexData-vf4-vf4-vf21[2];struct-PS_IN-vf4-vf4-vf21; ( temp void) +0:16 Function Parameters: +0:16 'vin' ( in 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:16 'outStream' ( out structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:? Sequence +0:19 move second child to first child ( temp 4-component vector of float) +0:19 color: direct index for structure ( temp 4-component vector of float) +0:19 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:19 Constant: +0:19 1 (const int) +0:19 color: direct index for structure ( temp 4-component vector of float) +0:19 direct index ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:19 'vin' ( in 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 1 (const int) +0:20 move second child to first child ( temp 2-component vector of float) +0:20 uv: direct index for structure ( temp 2-component vector of float) +0:20 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:20 Constant: +0:20 2 (const int) +0:20 uv: direct index for structure ( temp 2-component vector of float) +0:20 direct index ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:20 'vin' ( in 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 2 (const int) +0:21 move second child to first child ( temp 4-component vector of float) +0:21 position: direct index for structure ( temp 4-component vector of float) +0:21 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:21 Constant: +0:21 0 (const int) +0:21 position: direct index for structure ( temp 4-component vector of float) +0:21 direct index ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:21 'vin' ( in 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 0 (const int) +0:22 Sequence +0:22 Sequence +0:22 move second child to first child ( temp 4-component vector of float) +0:? 'outStream.position' ( out 4-component vector of float Position) +0:22 position: direct index for structure ( temp 4-component vector of float) +0:22 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:22 Constant: +0:22 0 (const int) +0:22 move second child to first child ( temp 4-component vector of float) +0:? 'outStream.color' (layout( location=0) out 4-component vector of float) +0:22 color: direct index for structure ( temp 4-component vector of float) +0:22 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:22 Constant: +0:22 1 (const int) +0:22 move second child to first child ( temp 2-component vector of float) +0:? 'outStream.uv' (layout( location=1) out 2-component vector of float) +0:22 uv: direct index for structure ( temp 2-component vector of float) +0:22 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:22 Constant: +0:22 2 (const int) +0:22 EmitVertex ( temp void) +0:16 Function Definition: main( ( temp void) +0:16 Function Parameters: +0:? Sequence +0:16 move second child to first child ( temp 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:? 'vin' ( temp 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:? 'vin' (layout( location=0) in 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:16 Function Call: @main(struct-VertexData-vf4-vf4-vf21[2];struct-PS_IN-vf4-vf4-vf21; ( temp void) +0:? 'vin' ( temp 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:? 'outStream' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:? Linker Objects +0:? 'vin' (layout( location=0) in 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) +0:? 'outStream.position' ( out 4-component vector of float Position) +0:? 'outStream.color' (layout( location=0) out 4-component vector of float) +0:? 'outStream.uv' (layout( location=1) out 2-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 58 + + Capability Geometry + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 38 41 45 50 + ExecutionMode 4 InputLines + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputTriangleStrip + ExecutionMode 4 OutputVertices 4 + Source HLSL 500 + Name 4 "main" + Name 9 "VertexData" + MemberName 9(VertexData) 0 "position" + MemberName 9(VertexData) 1 "color" + MemberName 9(VertexData) 2 "uv" + Name 14 "PS_IN" + MemberName 14(PS_IN) 0 "position" + MemberName 14(PS_IN) 1 "color" + MemberName 14(PS_IN) 2 "uv" + Name 19 "@main(struct-VertexData-vf4-vf4-vf21[2];struct-PS_IN-vf4-vf4-vf21;" + Name 17 "vin" + Name 18 "outStream" + Name 21 "vout" + Name 38 "outStream.position" + Name 41 "outStream.color" + Name 45 "outStream.uv" + Name 48 "vin" + Name 50 "vin" + Name 52 "outStream" + Name 53 "param" + Name 55 "param" + Decorate 38(outStream.position) BuiltIn Position + Decorate 41(outStream.color) Location 0 + Decorate 45(outStream.uv) Location 1 + Decorate 50(vin) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeVector 6(float) 2 + 9(VertexData): TypeStruct 7(fvec4) 7(fvec4) 8(fvec2) + 10: TypeInt 32 0 + 11: 10(int) Constant 2 + 12: TypeArray 9(VertexData) 11 + 13: TypePointer Function 12 + 14(PS_IN): TypeStruct 7(fvec4) 7(fvec4) 8(fvec2) + 15: TypePointer Function 14(PS_IN) + 16: TypeFunction 2 13(ptr) 15(ptr) + 22: TypeInt 32 1 + 23: 22(int) Constant 1 + 24: TypePointer Function 7(fvec4) + 28: 22(int) Constant 2 + 29: TypePointer Function 8(fvec2) + 33: 22(int) Constant 0 + 37: TypePointer Output 7(fvec4) +38(outStream.position): 37(ptr) Variable Output +41(outStream.color): 37(ptr) Variable Output + 44: TypePointer Output 8(fvec2) +45(outStream.uv): 44(ptr) Variable Output + 49: TypePointer Input 12 + 50(vin): 49(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 48(vin): 13(ptr) Variable Function + 52(outStream): 15(ptr) Variable Function + 53(param): 13(ptr) Variable Function + 55(param): 15(ptr) Variable Function + 51: 12 Load 50(vin) + Store 48(vin) 51 + 54: 12 Load 48(vin) + Store 53(param) 54 + 56: 2 FunctionCall 19(@main(struct-VertexData-vf4-vf4-vf21[2];struct-PS_IN-vf4-vf4-vf21;) 53(param) 55(param) + 57: 14(PS_IN) Load 55(param) + Store 52(outStream) 57 + Return + FunctionEnd +19(@main(struct-VertexData-vf4-vf4-vf21[2];struct-PS_IN-vf4-vf4-vf21;): 2 Function None 16 + 17(vin): 13(ptr) FunctionParameter + 18(outStream): 15(ptr) FunctionParameter + 20: Label + 21(vout): 15(ptr) Variable Function + 25: 24(ptr) AccessChain 17(vin) 23 23 + 26: 7(fvec4) Load 25 + 27: 24(ptr) AccessChain 21(vout) 23 + Store 27 26 + 30: 29(ptr) AccessChain 17(vin) 23 28 + 31: 8(fvec2) Load 30 + 32: 29(ptr) AccessChain 21(vout) 28 + Store 32 31 + 34: 24(ptr) AccessChain 17(vin) 23 33 + 35: 7(fvec4) Load 34 + 36: 24(ptr) AccessChain 21(vout) 33 + Store 36 35 + 39: 24(ptr) AccessChain 21(vout) 33 + 40: 7(fvec4) Load 39 + Store 38(outStream.position) 40 + 42: 24(ptr) AccessChain 21(vout) 23 + 43: 7(fvec4) Load 42 + Store 41(outStream.color) 43 + 46: 29(ptr) AccessChain 21(vout) 28 + 47: 8(fvec2) Load 46 + Store 45(outStream.uv) 47 + EmitVertex + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.append.fn.frag.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.append.fn.frag.out new file mode 100644 index 00000000..df086556 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.append.fn.frag.out @@ -0,0 +1,280 @@ +hlsl.structbuffer.append.fn.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: Fn2(block--vf4[0]1;block--vf4[0]1; ( temp 4-component vector of float) +0:8 Function Parameters: +0:8 'arg_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:8 'arg_a@count' ( buffer block{layout( row_major std430) buffer uint @count}) +0:8 'arg_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:8 'arg_c@count' ( buffer block{layout( row_major std430) buffer uint @count}) +0:? Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:9 indirect index ( buffer 4-component vector of float) +0:9 @data: direct index for structure ( buffer unsized 1-element array of 4-component vector of float) +0:9 'arg_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:9 Constant: +0:9 0 (const uint) +0:9 AtomicAdd ( temp uint) +0:9 @count: direct index for structure ( temp uint) +0:9 'arg_a@count' ( buffer block{layout( row_major std430) buffer uint @count}) +0:9 Constant: +0:9 0 (const int) +0:9 Constant: +0:9 1 (const uint) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:10 Branch: Return with expression +0:10 indirect index ( buffer 4-component vector of float) +0:10 @data: direct index for structure ( buffer unsized 1-element array of 4-component vector of float) +0:10 'arg_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 add ( temp uint) +0:10 AtomicAdd ( temp uint) +0:10 @count: direct index for structure ( temp uint) +0:10 'arg_c@count' ( buffer block{layout( row_major std430) buffer uint @count}) +0:10 Constant: +0:10 0 (const int) +0:10 Constant: +0:10 4294967295 (const uint) +0:10 Constant: +0:10 -1 (const int) +0:19 Function Definition: @main(u1; ( temp 4-component vector of float) +0:19 Function Parameters: +0:19 'pos' ( in uint) +0:? Sequence +0:22 Branch: Return with expression +0:22 Function Call: Fn2(block--vf4[0]1;block--vf4[0]1; ( temp 4-component vector of float) +0:22 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:22 'sbuf_a@count' ( buffer block{layout( row_major std430) buffer uint @count}) +0:22 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:22 'sbuf_c@count' ( buffer block{layout( row_major std430) buffer uint @count}) +0:19 Function Definition: main( ( temp void) +0:19 Function Parameters: +0:? Sequence +0:19 move second child to first child ( temp uint) +0:? 'pos' ( temp uint) +0:? 'pos' (layout( location=0) flat in uint) +0:19 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:19 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'pos' ( temp uint) +0:? Linker Objects +0:? 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' (layout( location=0) flat in uint) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: Fn2(block--vf4[0]1;block--vf4[0]1; ( temp 4-component vector of float) +0:8 Function Parameters: +0:8 'arg_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:8 'arg_a@count' ( buffer block{layout( row_major std430) buffer uint @count}) +0:8 'arg_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:8 'arg_c@count' ( buffer block{layout( row_major std430) buffer uint @count}) +0:? Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:9 indirect index ( buffer 4-component vector of float) +0:9 @data: direct index for structure ( buffer unsized 1-element array of 4-component vector of float) +0:9 'arg_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:9 Constant: +0:9 0 (const uint) +0:9 AtomicAdd ( temp uint) +0:9 @count: direct index for structure ( temp uint) +0:9 'arg_a@count' ( buffer block{layout( row_major std430) buffer uint @count}) +0:9 Constant: +0:9 0 (const int) +0:9 Constant: +0:9 1 (const uint) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:10 Branch: Return with expression +0:10 indirect index ( buffer 4-component vector of float) +0:10 @data: direct index for structure ( buffer unsized 1-element array of 4-component vector of float) +0:10 'arg_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 add ( temp uint) +0:10 AtomicAdd ( temp uint) +0:10 @count: direct index for structure ( temp uint) +0:10 'arg_c@count' ( buffer block{layout( row_major std430) buffer uint @count}) +0:10 Constant: +0:10 0 (const int) +0:10 Constant: +0:10 4294967295 (const uint) +0:10 Constant: +0:10 -1 (const int) +0:19 Function Definition: @main(u1; ( temp 4-component vector of float) +0:19 Function Parameters: +0:19 'pos' ( in uint) +0:? Sequence +0:22 Branch: Return with expression +0:22 Function Call: Fn2(block--vf4[0]1;block--vf4[0]1; ( temp 4-component vector of float) +0:22 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:22 'sbuf_a@count' ( buffer block{layout( row_major std430) buffer uint @count}) +0:22 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:22 'sbuf_c@count' ( buffer block{layout( row_major std430) buffer uint @count}) +0:19 Function Definition: main( ( temp void) +0:19 Function Parameters: +0:? Sequence +0:19 move second child to first child ( temp uint) +0:? 'pos' ( temp uint) +0:? 'pos' (layout( location=0) flat in uint) +0:19 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:19 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'pos' ( temp uint) +0:? Linker Objects +0:? 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' (layout( location=0) flat in uint) + +error: SPIRV-Tools Validation Errors +error: Structure id 12 decorated as BufferBlock must be explicitly laid out with Offset decorations. + %__0 = OpTypeStruct %uint + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 70 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 58 61 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "" + MemberName 9 0 "@data" + Name 12 "" + MemberName 12 0 "@count" + Name 19 "Fn2(block--vf4[0]1;block--vf4[0]1;" + Name 15 "arg_a" + Name 16 "arg_a@count" + Name 17 "arg_c" + Name 18 "arg_c@count" + Name 24 "@main(u1;" + Name 23 "pos" + Name 49 "sbuf_a" + Name 50 "sbuf_a@count" + Name 51 "sbuf_c" + Name 52 "sbuf_c@count" + Name 56 "pos" + Name 58 "pos" + Name 61 "@entryPointOutput" + Name 62 "param" + Name 65 "sbuf_a@count" + MemberName 65(sbuf_a@count) 0 "@count" + Name 67 "sbuf_a@count" + Name 68 "sbuf_c@count" + Name 69 "sbuf_unused" + Decorate 8 ArrayStride 16 + MemberDecorate 9 0 Offset 0 + Decorate 9 BufferBlock + Decorate 12 BufferBlock + Decorate 49(sbuf_a) DescriptorSet 0 + Decorate 50(sbuf_a@count) DescriptorSet 0 + Decorate 51(sbuf_c) DescriptorSet 0 + Decorate 52(sbuf_c@count) DescriptorSet 0 + Decorate 58(pos) Flat + Decorate 58(pos) Location 0 + Decorate 61(@entryPointOutput) Location 0 + MemberDecorate 65(sbuf_a@count) 0 Offset 0 + Decorate 65(sbuf_a@count) BufferBlock + Decorate 67(sbuf_a@count) DescriptorSet 0 + Decorate 68(sbuf_c@count) DescriptorSet 0 + Decorate 69(sbuf_unused) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeRuntimeArray 7(fvec4) + 9: TypeStruct 8 + 10: TypePointer Uniform 9(struct) + 11: TypeInt 32 0 + 12: TypeStruct 11(int) + 13: TypePointer Uniform 12(struct) + 14: TypeFunction 7(fvec4) 10(ptr) 13(ptr) 10(ptr) 13(ptr) + 21: TypePointer Function 11(int) + 22: TypeFunction 7(fvec4) 21(ptr) + 26: TypeInt 32 1 + 27: 26(int) Constant 0 + 28: TypePointer Uniform 11(int) + 30: 11(int) Constant 1 + 31: 11(int) Constant 0 + 33: 6(float) Constant 1065353216 + 34: 6(float) Constant 1073741824 + 35: 6(float) Constant 1077936128 + 36: 6(float) Constant 1082130432 + 37: 7(fvec4) ConstantComposite 33 34 35 36 + 38: TypePointer Uniform 7(fvec4) + 41: 11(int) Constant 4294967295 + 43: 26(int) Constant 4294967295 + 49(sbuf_a): 10(ptr) Variable Uniform +50(sbuf_a@count): 13(ptr) Variable Uniform + 51(sbuf_c): 10(ptr) Variable Uniform +52(sbuf_c@count): 13(ptr) Variable Uniform + 57: TypePointer Input 11(int) + 58(pos): 57(ptr) Variable Input + 60: TypePointer Output 7(fvec4) +61(@entryPointOutput): 60(ptr) Variable Output +65(sbuf_a@count): TypeStruct 11(int) + 66: TypePointer Uniform 65(sbuf_a@count) +67(sbuf_a@count): 66(ptr) Variable Uniform +68(sbuf_c@count): 66(ptr) Variable Uniform + 69(sbuf_unused): 10(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + 56(pos): 21(ptr) Variable Function + 62(param): 21(ptr) Variable Function + 59: 11(int) Load 58(pos) + Store 56(pos) 59 + 63: 11(int) Load 56(pos) + Store 62(param) 63 + 64: 7(fvec4) FunctionCall 24(@main(u1;) 62(param) + Store 61(@entryPointOutput) 64 + Return + FunctionEnd +19(Fn2(block--vf4[0]1;block--vf4[0]1;): 7(fvec4) Function None 14 + 15(arg_a): 10(ptr) FunctionParameter + 16(arg_a@count): 13(ptr) FunctionParameter + 17(arg_c): 10(ptr) FunctionParameter + 18(arg_c@count): 13(ptr) FunctionParameter + 20: Label + 29: 28(ptr) AccessChain 16(arg_a@count) 27 + 32: 11(int) AtomicIAdd 29 30 31 30 + 39: 38(ptr) AccessChain 15(arg_a) 27 32 + Store 39 37 + 40: 28(ptr) AccessChain 18(arg_c@count) 27 + 42: 11(int) AtomicIAdd 40 30 31 41 + 44: 11(int) IAdd 42 43 + 45: 38(ptr) AccessChain 17(arg_c) 27 44 + 46: 7(fvec4) Load 45 + ReturnValue 46 + FunctionEnd + 24(@main(u1;): 7(fvec4) Function None 22 + 23(pos): 21(ptr) FunctionParameter + 25: Label + 53: 7(fvec4) FunctionCall 19(Fn2(block--vf4[0]1;block--vf4[0]1;) 49(sbuf_a) 50(sbuf_a@count) 51(sbuf_c) 52(sbuf_c@count) + ReturnValue 53 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.append.frag.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.append.frag.out new file mode 100644 index 00000000..dff47f88 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.append.frag.out @@ -0,0 +1,224 @@ +hlsl.structbuffer.append.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main(u1; ( temp 4-component vector of float) +0:7 Function Parameters: +0:7 'pos' ( in uint) +0:? Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 indirect index (layout( row_major std430) buffer 4-component vector of float) +0:8 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of float) +0:8 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:8 Constant: +0:8 0 (const uint) +0:8 AtomicAdd ( temp uint) +0:8 @count: direct index for structure ( temp uint) +0:8 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 1 (const uint) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:10 Branch: Return with expression +0:10 indirect index (layout( row_major std430) buffer 4-component vector of float) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of float) +0:10 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 add ( temp uint) +0:10 AtomicAdd ( temp uint) +0:10 @count: direct index for structure ( temp uint) +0:10 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:10 Constant: +0:10 0 (const int) +0:10 Constant: +0:10 4294967295 (const uint) +0:10 Constant: +0:10 -1 (const int) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp uint) +0:? 'pos' ( temp uint) +0:? 'pos' (layout( location=0) flat in uint) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'pos' ( temp uint) +0:? Linker Objects +0:? 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' (layout( location=0) flat in uint) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main(u1; ( temp 4-component vector of float) +0:7 Function Parameters: +0:7 'pos' ( in uint) +0:? Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 indirect index (layout( row_major std430) buffer 4-component vector of float) +0:8 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of float) +0:8 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:8 Constant: +0:8 0 (const uint) +0:8 AtomicAdd ( temp uint) +0:8 @count: direct index for structure ( temp uint) +0:8 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 1 (const uint) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:10 Branch: Return with expression +0:10 indirect index (layout( row_major std430) buffer 4-component vector of float) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of float) +0:10 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 add ( temp uint) +0:10 AtomicAdd ( temp uint) +0:10 @count: direct index for structure ( temp uint) +0:10 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:10 Constant: +0:10 0 (const int) +0:10 Constant: +0:10 4294967295 (const uint) +0:10 Constant: +0:10 -1 (const int) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp uint) +0:? 'pos' ( temp uint) +0:? 'pos' (layout( location=0) flat in uint) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'pos' ( temp uint) +0:? Linker Objects +0:? 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' (layout( location=0) flat in uint) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 56 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 48 51 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 12 "@main(u1;" + Name 11 "pos" + Name 15 "sbuf_a" + MemberName 15(sbuf_a) 0 "@data" + Name 17 "sbuf_a" + Name 20 "sbuf_a@count" + MemberName 20(sbuf_a@count) 0 "@count" + Name 22 "sbuf_a@count" + Name 35 "sbuf_c" + Name 36 "sbuf_c@count" + Name 46 "pos" + Name 48 "pos" + Name 51 "@entryPointOutput" + Name 52 "param" + Name 55 "sbuf_unused" + Decorate 14 ArrayStride 16 + MemberDecorate 15(sbuf_a) 0 Offset 0 + Decorate 15(sbuf_a) BufferBlock + Decorate 17(sbuf_a) DescriptorSet 0 + MemberDecorate 20(sbuf_a@count) 0 Offset 0 + Decorate 20(sbuf_a@count) BufferBlock + Decorate 22(sbuf_a@count) DescriptorSet 0 + Decorate 35(sbuf_c) DescriptorSet 0 + Decorate 36(sbuf_c@count) DescriptorSet 0 + Decorate 48(pos) Flat + Decorate 48(pos) Location 0 + Decorate 51(@entryPointOutput) Location 0 + Decorate 55(sbuf_unused) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeFunction 9(fvec4) 7(ptr) + 14: TypeRuntimeArray 9(fvec4) + 15(sbuf_a): TypeStruct 14 + 16: TypePointer Uniform 15(sbuf_a) + 17(sbuf_a): 16(ptr) Variable Uniform + 18: TypeInt 32 1 + 19: 18(int) Constant 0 +20(sbuf_a@count): TypeStruct 6(int) + 21: TypePointer Uniform 20(sbuf_a@count) +22(sbuf_a@count): 21(ptr) Variable Uniform + 23: TypePointer Uniform 6(int) + 25: 6(int) Constant 1 + 26: 6(int) Constant 0 + 28: 8(float) Constant 1065353216 + 29: 8(float) Constant 1073741824 + 30: 8(float) Constant 1077936128 + 31: 8(float) Constant 1082130432 + 32: 9(fvec4) ConstantComposite 28 29 30 31 + 33: TypePointer Uniform 9(fvec4) + 35(sbuf_c): 16(ptr) Variable Uniform +36(sbuf_c@count): 21(ptr) Variable Uniform + 38: 6(int) Constant 4294967295 + 40: 18(int) Constant 4294967295 + 47: TypePointer Input 6(int) + 48(pos): 47(ptr) Variable Input + 50: TypePointer Output 9(fvec4) +51(@entryPointOutput): 50(ptr) Variable Output + 55(sbuf_unused): 16(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + 46(pos): 7(ptr) Variable Function + 52(param): 7(ptr) Variable Function + 49: 6(int) Load 48(pos) + Store 46(pos) 49 + 53: 6(int) Load 46(pos) + Store 52(param) 53 + 54: 9(fvec4) FunctionCall 12(@main(u1;) 52(param) + Store 51(@entryPointOutput) 54 + Return + FunctionEnd + 12(@main(u1;): 9(fvec4) Function None 10 + 11(pos): 7(ptr) FunctionParameter + 13: Label + 24: 23(ptr) AccessChain 22(sbuf_a@count) 19 + 27: 6(int) AtomicIAdd 24 25 26 25 + 34: 33(ptr) AccessChain 17(sbuf_a) 19 27 + Store 34 32 + 37: 23(ptr) AccessChain 36(sbuf_c@count) 19 + 39: 6(int) AtomicIAdd 37 25 26 38 + 41: 6(int) IAdd 39 40 + 42: 33(ptr) AccessChain 35(sbuf_c) 19 41 + 43: 9(fvec4) Load 42 + ReturnValue 43 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.atomics.frag.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.atomics.frag.out new file mode 100644 index 00000000..68d93c18 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.atomics.frag.out @@ -0,0 +1,605 @@ +hlsl.structbuffer.atomics.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main(u1; ( temp 4-component vector of float) +0:5 Function Parameters: +0:5 'pos' ( in uint) +0:? Sequence +0:8 AtomicAdd ( temp uint) +0:8 indirect index (layout( row_major std430) buffer uint) +0:8 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:8 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:8 Constant: +0:8 0 (const uint) +0:8 right-shift ( temp int) +0:8 Constant: +0:8 8 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 1 (const int) +0:9 move second child to first child ( temp uint) +0:9 'u' ( temp uint) +0:9 AtomicAdd ( temp uint) +0:9 indirect index (layout( row_major std430) buffer uint) +0:9 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:9 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:9 Constant: +0:9 0 (const uint) +0:9 right-shift ( temp int) +0:9 Constant: +0:9 8 (const int) +0:9 Constant: +0:9 2 (const int) +0:9 Constant: +0:9 1 (const int) +0:10 AtomicAnd ( temp uint) +0:10 indirect index (layout( row_major std430) buffer uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 right-shift ( temp int) +0:10 Constant: +0:10 8 (const int) +0:10 Constant: +0:10 2 (const int) +0:10 Constant: +0:10 1 (const int) +0:11 move second child to first child ( temp uint) +0:11 'u' ( temp uint) +0:11 AtomicAnd ( temp uint) +0:11 indirect index (layout( row_major std430) buffer uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 right-shift ( temp int) +0:11 Constant: +0:11 8 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 1 (const int) +0:12 move second child to first child ( temp uint) +0:12 'u' ( temp uint) +0:12 Convert int to uint ( temp uint) +0:12 AtomicCompSwap ( temp int) +0:12 indirect index (layout( row_major std430) buffer uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 right-shift ( temp int) +0:12 Constant: +0:12 8 (const int) +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 2 (const int) +0:14 move second child to first child ( temp uint) +0:14 'u' ( temp uint) +0:14 AtomicExchange ( temp uint) +0:14 indirect index (layout( row_major std430) buffer uint) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:14 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 right-shift ( temp int) +0:14 Constant: +0:14 8 (const int) +0:14 Constant: +0:14 2 (const int) +0:14 Constant: +0:14 1 (const int) +0:15 AtomicMax ( temp uint) +0:15 indirect index (layout( row_major std430) buffer uint) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:15 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 right-shift ( temp int) +0:15 Constant: +0:15 8 (const int) +0:15 Constant: +0:15 2 (const int) +0:15 Constant: +0:15 1 (const int) +0:16 move second child to first child ( temp uint) +0:16 'u' ( temp uint) +0:16 AtomicMax ( temp uint) +0:16 indirect index (layout( row_major std430) buffer uint) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:16 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 right-shift ( temp int) +0:16 Constant: +0:16 8 (const int) +0:16 Constant: +0:16 2 (const int) +0:16 Constant: +0:16 1 (const int) +0:17 AtomicMin ( temp uint) +0:17 indirect index (layout( row_major std430) buffer uint) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:17 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 right-shift ( temp int) +0:17 Constant: +0:17 8 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 1 (const int) +0:18 move second child to first child ( temp uint) +0:18 'u' ( temp uint) +0:18 AtomicMin ( temp uint) +0:18 indirect index (layout( row_major std430) buffer uint) +0:18 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:18 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:18 Constant: +0:18 0 (const uint) +0:18 right-shift ( temp int) +0:18 Constant: +0:18 8 (const int) +0:18 Constant: +0:18 2 (const int) +0:18 Constant: +0:18 1 (const int) +0:19 AtomicOr ( temp uint) +0:19 indirect index (layout( row_major std430) buffer uint) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:19 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 right-shift ( temp int) +0:19 Constant: +0:19 8 (const int) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 1 (const int) +0:20 move second child to first child ( temp uint) +0:20 'u' ( temp uint) +0:20 AtomicOr ( temp uint) +0:20 indirect index (layout( row_major std430) buffer uint) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:20 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 right-shift ( temp int) +0:20 Constant: +0:20 8 (const int) +0:20 Constant: +0:20 2 (const int) +0:20 Constant: +0:20 1 (const int) +0:21 AtomicXor ( temp uint) +0:21 indirect index (layout( row_major std430) buffer uint) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:21 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 right-shift ( temp int) +0:21 Constant: +0:21 8 (const int) +0:21 Constant: +0:21 2 (const int) +0:21 Constant: +0:21 1 (const int) +0:22 move second child to first child ( temp uint) +0:22 'u' ( temp uint) +0:22 AtomicXor ( temp uint) +0:22 indirect index (layout( row_major std430) buffer uint) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:22 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 right-shift ( temp int) +0:22 Constant: +0:22 8 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 Constant: +0:22 1 (const int) +0:24 Branch: Return with expression +0:24 Construct vec4 ( temp 4-component vector of float) +0:24 Convert uint to float ( temp float) +0:24 indirect index (layout( row_major std430) buffer uint) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:24 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 right-shift ( temp int) +0:24 'pos' ( in uint) +0:24 Constant: +0:24 2 (const int) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp uint) +0:? 'pos' ( temp uint) +0:? 'pos' (layout( location=0) flat in uint) +0:5 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:5 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'pos' ( temp uint) +0:? Linker Objects +0:? 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' (layout( location=0) flat in uint) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main(u1; ( temp 4-component vector of float) +0:5 Function Parameters: +0:5 'pos' ( in uint) +0:? Sequence +0:8 AtomicAdd ( temp uint) +0:8 indirect index (layout( row_major std430) buffer uint) +0:8 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:8 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:8 Constant: +0:8 0 (const uint) +0:8 right-shift ( temp int) +0:8 Constant: +0:8 8 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 1 (const int) +0:9 move second child to first child ( temp uint) +0:9 'u' ( temp uint) +0:9 AtomicAdd ( temp uint) +0:9 indirect index (layout( row_major std430) buffer uint) +0:9 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:9 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:9 Constant: +0:9 0 (const uint) +0:9 right-shift ( temp int) +0:9 Constant: +0:9 8 (const int) +0:9 Constant: +0:9 2 (const int) +0:9 Constant: +0:9 1 (const int) +0:10 AtomicAnd ( temp uint) +0:10 indirect index (layout( row_major std430) buffer uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 right-shift ( temp int) +0:10 Constant: +0:10 8 (const int) +0:10 Constant: +0:10 2 (const int) +0:10 Constant: +0:10 1 (const int) +0:11 move second child to first child ( temp uint) +0:11 'u' ( temp uint) +0:11 AtomicAnd ( temp uint) +0:11 indirect index (layout( row_major std430) buffer uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 right-shift ( temp int) +0:11 Constant: +0:11 8 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 1 (const int) +0:12 move second child to first child ( temp uint) +0:12 'u' ( temp uint) +0:12 Convert int to uint ( temp uint) +0:12 AtomicCompSwap ( temp int) +0:12 indirect index (layout( row_major std430) buffer uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 right-shift ( temp int) +0:12 Constant: +0:12 8 (const int) +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 2 (const int) +0:14 move second child to first child ( temp uint) +0:14 'u' ( temp uint) +0:14 AtomicExchange ( temp uint) +0:14 indirect index (layout( row_major std430) buffer uint) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:14 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 right-shift ( temp int) +0:14 Constant: +0:14 8 (const int) +0:14 Constant: +0:14 2 (const int) +0:14 Constant: +0:14 1 (const int) +0:15 AtomicMax ( temp uint) +0:15 indirect index (layout( row_major std430) buffer uint) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:15 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 right-shift ( temp int) +0:15 Constant: +0:15 8 (const int) +0:15 Constant: +0:15 2 (const int) +0:15 Constant: +0:15 1 (const int) +0:16 move second child to first child ( temp uint) +0:16 'u' ( temp uint) +0:16 AtomicMax ( temp uint) +0:16 indirect index (layout( row_major std430) buffer uint) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:16 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 right-shift ( temp int) +0:16 Constant: +0:16 8 (const int) +0:16 Constant: +0:16 2 (const int) +0:16 Constant: +0:16 1 (const int) +0:17 AtomicMin ( temp uint) +0:17 indirect index (layout( row_major std430) buffer uint) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:17 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 right-shift ( temp int) +0:17 Constant: +0:17 8 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 1 (const int) +0:18 move second child to first child ( temp uint) +0:18 'u' ( temp uint) +0:18 AtomicMin ( temp uint) +0:18 indirect index (layout( row_major std430) buffer uint) +0:18 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:18 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:18 Constant: +0:18 0 (const uint) +0:18 right-shift ( temp int) +0:18 Constant: +0:18 8 (const int) +0:18 Constant: +0:18 2 (const int) +0:18 Constant: +0:18 1 (const int) +0:19 AtomicOr ( temp uint) +0:19 indirect index (layout( row_major std430) buffer uint) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:19 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 right-shift ( temp int) +0:19 Constant: +0:19 8 (const int) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 1 (const int) +0:20 move second child to first child ( temp uint) +0:20 'u' ( temp uint) +0:20 AtomicOr ( temp uint) +0:20 indirect index (layout( row_major std430) buffer uint) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:20 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 right-shift ( temp int) +0:20 Constant: +0:20 8 (const int) +0:20 Constant: +0:20 2 (const int) +0:20 Constant: +0:20 1 (const int) +0:21 AtomicXor ( temp uint) +0:21 indirect index (layout( row_major std430) buffer uint) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:21 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 right-shift ( temp int) +0:21 Constant: +0:21 8 (const int) +0:21 Constant: +0:21 2 (const int) +0:21 Constant: +0:21 1 (const int) +0:22 move second child to first child ( temp uint) +0:22 'u' ( temp uint) +0:22 AtomicXor ( temp uint) +0:22 indirect index (layout( row_major std430) buffer uint) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:22 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 right-shift ( temp int) +0:22 Constant: +0:22 8 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 Constant: +0:22 1 (const int) +0:24 Branch: Return with expression +0:24 Construct vec4 ( temp 4-component vector of float) +0:24 Convert uint to float ( temp float) +0:24 indirect index (layout( row_major std430) buffer uint) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:24 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 right-shift ( temp int) +0:24 'pos' ( in uint) +0:24 Constant: +0:24 2 (const int) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp uint) +0:? 'pos' ( temp uint) +0:? 'pos' (layout( location=0) flat in uint) +0:5 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:5 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'pos' ( temp uint) +0:? Linker Objects +0:? 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' (layout( location=0) flat in uint) + +error: SPIRV-Tools Validation Errors +error: AtomicIAdd: expected Value to be of type Result Type + %28 = OpAtomicIAdd %uint %24 %uint_1 %uint_0 %int_1 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 87 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 80 83 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 12 "@main(u1;" + Name 11 "pos" + Name 15 "sbuf" + MemberName 15(sbuf) 0 "@data" + Name 17 "sbuf" + Name 29 "u" + Name 78 "pos" + Name 80 "pos" + Name 83 "@entryPointOutput" + Name 84 "param" + Decorate 14 ArrayStride 4 + MemberDecorate 15(sbuf) 0 Offset 0 + Decorate 15(sbuf) BufferBlock + Decorate 17(sbuf) DescriptorSet 0 + Decorate 80(pos) Flat + Decorate 80(pos) Location 0 + Decorate 83(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeFunction 9(fvec4) 7(ptr) + 14: TypeRuntimeArray 6(int) + 15(sbuf): TypeStruct 14 + 16: TypePointer Uniform 15(sbuf) + 17(sbuf): 16(ptr) Variable Uniform + 18: TypeInt 32 1 + 19: 18(int) Constant 0 + 20: 18(int) Constant 8 + 21: 18(int) Constant 2 + 23: TypePointer Uniform 6(int) + 25: 18(int) Constant 1 + 26: 6(int) Constant 1 + 27: 6(int) Constant 0 + 79: TypePointer Input 6(int) + 80(pos): 79(ptr) Variable Input + 82: TypePointer Output 9(fvec4) +83(@entryPointOutput): 82(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 78(pos): 7(ptr) Variable Function + 84(param): 7(ptr) Variable Function + 81: 6(int) Load 80(pos) + Store 78(pos) 81 + 85: 6(int) Load 78(pos) + Store 84(param) 85 + 86: 9(fvec4) FunctionCall 12(@main(u1;) 84(param) + Store 83(@entryPointOutput) 86 + Return + FunctionEnd + 12(@main(u1;): 9(fvec4) Function None 10 + 11(pos): 7(ptr) FunctionParameter + 13: Label + 29(u): 7(ptr) Variable Function + 22: 18(int) ShiftRightArithmetic 20 21 + 24: 23(ptr) AccessChain 17(sbuf) 19 22 + 28: 6(int) AtomicIAdd 24 26 27 25 + 30: 18(int) ShiftRightArithmetic 20 21 + 31: 23(ptr) AccessChain 17(sbuf) 19 30 + 32: 6(int) AtomicIAdd 31 26 27 25 + Store 29(u) 32 + 33: 18(int) ShiftRightArithmetic 20 21 + 34: 23(ptr) AccessChain 17(sbuf) 19 33 + 35: 6(int) AtomicAnd 34 26 27 25 + 36: 18(int) ShiftRightArithmetic 20 21 + 37: 23(ptr) AccessChain 17(sbuf) 19 36 + 38: 6(int) AtomicAnd 37 26 27 25 + Store 29(u) 38 + 39: 18(int) ShiftRightArithmetic 20 21 + 40: 23(ptr) AccessChain 17(sbuf) 19 39 + 41: 18(int) AtomicCompareExchange 40 26 27 27 21 25 + 42: 6(int) Bitcast 41 + Store 29(u) 42 + 43: 18(int) ShiftRightArithmetic 20 21 + 44: 23(ptr) AccessChain 17(sbuf) 19 43 + 45: 6(int) AtomicExchange 44 26 27 25 + Store 29(u) 45 + 46: 18(int) ShiftRightArithmetic 20 21 + 47: 23(ptr) AccessChain 17(sbuf) 19 46 + 48: 6(int) AtomicUMax 47 26 27 25 + 49: 18(int) ShiftRightArithmetic 20 21 + 50: 23(ptr) AccessChain 17(sbuf) 19 49 + 51: 6(int) AtomicUMax 50 26 27 25 + Store 29(u) 51 + 52: 18(int) ShiftRightArithmetic 20 21 + 53: 23(ptr) AccessChain 17(sbuf) 19 52 + 54: 6(int) AtomicUMin 53 26 27 25 + 55: 18(int) ShiftRightArithmetic 20 21 + 56: 23(ptr) AccessChain 17(sbuf) 19 55 + 57: 6(int) AtomicUMin 56 26 27 25 + Store 29(u) 57 + 58: 18(int) ShiftRightArithmetic 20 21 + 59: 23(ptr) AccessChain 17(sbuf) 19 58 + 60: 6(int) AtomicOr 59 26 27 25 + 61: 18(int) ShiftRightArithmetic 20 21 + 62: 23(ptr) AccessChain 17(sbuf) 19 61 + 63: 6(int) AtomicOr 62 26 27 25 + Store 29(u) 63 + 64: 18(int) ShiftRightArithmetic 20 21 + 65: 23(ptr) AccessChain 17(sbuf) 19 64 + 66: 6(int) AtomicXor 65 26 27 25 + 67: 18(int) ShiftRightArithmetic 20 21 + 68: 23(ptr) AccessChain 17(sbuf) 19 67 + 69: 6(int) AtomicXor 68 26 27 25 + Store 29(u) 69 + 70: 6(int) Load 11(pos) + 71: 18(int) ShiftRightLogical 70 21 + 72: 23(ptr) AccessChain 17(sbuf) 19 71 + 73: 6(int) Load 72 + 74: 8(float) ConvertUToF 73 + 75: 9(fvec4) CompositeConstruct 74 74 74 74 + ReturnValue 75 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.byte.frag.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.byte.frag.out new file mode 100644 index 00000000..49958a65 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.byte.frag.out @@ -0,0 +1,482 @@ +hlsl.structbuffer.byte.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main(u1; ( temp 4-component vector of float) +0:5 Function Parameters: +0:5 'pos' ( in uint) +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp uint) +0:7 'size' ( temp uint) +0:7 array length ( temp uint) +0:7 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:7 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:7 Constant: +0:7 0 (const uint) +0:12 Branch: Return with expression +0:11 add ( temp 4-component vector of float) +0:10 add ( temp 4-component vector of float) +0:9 add ( temp 4-component vector of float) +0:9 Convert uint to float ( temp float) +0:9 indirect index (layout( row_major std430) buffer uint) +0:9 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:9 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:9 Constant: +0:9 0 (const uint) +0:9 right-shift ( temp int) +0:9 'pos' ( in uint) +0:9 Constant: +0:9 2 (const int) +0:? Construct vec4 ( temp 4-component vector of float) +0:? Convert uint to float ( temp 2-component vector of float) +0:? Sequence +0:10 move second child to first child ( temp int) +0:10 'byteAddrTemp' ( temp int) +0:10 right-shift ( temp int) +0:10 add ( temp uint) +0:10 'pos' ( in uint) +0:10 Constant: +0:10 4 (const uint) +0:10 Constant: +0:10 2 (const int) +0:? Construct vec2 ( temp 2-component vector of uint) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 'byteAddrTemp' ( temp int) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 add ( temp int) +0:10 'byteAddrTemp' ( temp int) +0:10 Constant: +0:10 1 (const int) +0:10 Constant: +0:10 0.000000 +0:10 Constant: +0:10 0.000000 +0:? Construct vec4 ( temp 4-component vector of float) +0:? Convert uint to float ( temp 3-component vector of float) +0:? Sequence +0:11 move second child to first child ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 right-shift ( temp int) +0:11 add ( temp uint) +0:11 'pos' ( in uint) +0:11 Constant: +0:11 8 (const uint) +0:11 Constant: +0:11 2 (const int) +0:? Construct vec3 ( temp 3-component vector of uint) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 'byteAddrTemp' ( temp int) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 add ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 Constant: +0:11 1 (const int) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 add ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 0.000000 +0:? Convert uint to float ( temp 4-component vector of float) +0:? Sequence +0:12 move second child to first child ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 right-shift ( temp int) +0:12 add ( temp uint) +0:12 'pos' ( in uint) +0:12 Constant: +0:12 12 (const uint) +0:12 Constant: +0:12 2 (const int) +0:? Construct vec4 ( temp 4-component vector of uint) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' ( temp int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 1 (const int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 2 (const int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 3 (const int) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp uint) +0:? 'pos' ( temp uint) +0:? 'pos' (layout( location=0) flat in uint) +0:5 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:5 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'pos' ( temp uint) +0:? Linker Objects +0:? 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' (layout( location=0) flat in uint) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main(u1; ( temp 4-component vector of float) +0:5 Function Parameters: +0:5 'pos' ( in uint) +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp uint) +0:7 'size' ( temp uint) +0:7 array length ( temp uint) +0:7 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:7 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:7 Constant: +0:7 0 (const uint) +0:12 Branch: Return with expression +0:11 add ( temp 4-component vector of float) +0:10 add ( temp 4-component vector of float) +0:9 add ( temp 4-component vector of float) +0:9 Convert uint to float ( temp float) +0:9 indirect index (layout( row_major std430) buffer uint) +0:9 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:9 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:9 Constant: +0:9 0 (const uint) +0:9 right-shift ( temp int) +0:9 'pos' ( in uint) +0:9 Constant: +0:9 2 (const int) +0:? Construct vec4 ( temp 4-component vector of float) +0:? Convert uint to float ( temp 2-component vector of float) +0:? Sequence +0:10 move second child to first child ( temp int) +0:10 'byteAddrTemp' ( temp int) +0:10 right-shift ( temp int) +0:10 add ( temp uint) +0:10 'pos' ( in uint) +0:10 Constant: +0:10 4 (const uint) +0:10 Constant: +0:10 2 (const int) +0:? Construct vec2 ( temp 2-component vector of uint) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 'byteAddrTemp' ( temp int) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 add ( temp int) +0:10 'byteAddrTemp' ( temp int) +0:10 Constant: +0:10 1 (const int) +0:10 Constant: +0:10 0.000000 +0:10 Constant: +0:10 0.000000 +0:? Construct vec4 ( temp 4-component vector of float) +0:? Convert uint to float ( temp 3-component vector of float) +0:? Sequence +0:11 move second child to first child ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 right-shift ( temp int) +0:11 add ( temp uint) +0:11 'pos' ( in uint) +0:11 Constant: +0:11 8 (const uint) +0:11 Constant: +0:11 2 (const int) +0:? Construct vec3 ( temp 3-component vector of uint) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 'byteAddrTemp' ( temp int) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 add ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 Constant: +0:11 1 (const int) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 add ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 0.000000 +0:? Convert uint to float ( temp 4-component vector of float) +0:? Sequence +0:12 move second child to first child ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 right-shift ( temp int) +0:12 add ( temp uint) +0:12 'pos' ( in uint) +0:12 Constant: +0:12 12 (const uint) +0:12 Constant: +0:12 2 (const int) +0:? Construct vec4 ( temp 4-component vector of uint) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' ( temp int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 1 (const int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 2 (const int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 3 (const int) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp uint) +0:? 'pos' ( temp uint) +0:? 'pos' (layout( location=0) flat in uint) +0:5 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:5 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'pos' ( temp uint) +0:? Linker Objects +0:? 'sbuf' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' (layout( location=0) flat in uint) + +error: SPIRV-Tools Validation Errors +error: OpStore Pointer '14[size]'s type does not match Object '20's type. + OpStore %size %20 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 114 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 107 110 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 12 "@main(u1;" + Name 11 "pos" + Name 14 "size" + Name 16 "sbuf" + MemberName 16(sbuf) 0 "@data" + Name 18 "sbuf" + Name 30 "byteAddrTemp" + Name 53 "byteAddrTemp" + Name 78 "byteAddrTemp" + Name 105 "pos" + Name 107 "pos" + Name 110 "@entryPointOutput" + Name 111 "param" + Decorate 15 ArrayStride 4 + MemberDecorate 16(sbuf) 0 NonWritable + MemberDecorate 16(sbuf) 0 Offset 0 + Decorate 16(sbuf) BufferBlock + Decorate 18(sbuf) DescriptorSet 0 + Decorate 107(pos) Flat + Decorate 107(pos) Location 0 + Decorate 110(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeFunction 9(fvec4) 7(ptr) + 15: TypeRuntimeArray 6(int) + 16(sbuf): TypeStruct 15 + 17: TypePointer Uniform 16(sbuf) + 18(sbuf): 17(ptr) Variable Uniform + 19: TypeInt 32 1 + 21: 19(int) Constant 0 + 23: 19(int) Constant 2 + 25: TypePointer Uniform 6(int) + 29: TypePointer Function 19(int) + 32: 6(int) Constant 4 + 39: 19(int) Constant 1 + 43: TypeVector 6(int) 2 + 45: TypeVector 8(float) 2 + 47: 8(float) Constant 0 + 55: 6(int) Constant 8 + 69: TypeVector 6(int) 3 + 71: TypeVector 8(float) 3 + 80: 6(int) Constant 12 + 95: 19(int) Constant 3 + 99: TypeVector 6(int) 4 + 106: TypePointer Input 6(int) + 107(pos): 106(ptr) Variable Input + 109: TypePointer Output 9(fvec4) +110(@entryPointOutput): 109(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 105(pos): 7(ptr) Variable Function + 111(param): 7(ptr) Variable Function + 108: 6(int) Load 107(pos) + Store 105(pos) 108 + 112: 6(int) Load 105(pos) + Store 111(param) 112 + 113: 9(fvec4) FunctionCall 12(@main(u1;) 111(param) + Store 110(@entryPointOutput) 113 + Return + FunctionEnd + 12(@main(u1;): 9(fvec4) Function None 10 + 11(pos): 7(ptr) FunctionParameter + 13: Label + 14(size): 7(ptr) Variable Function +30(byteAddrTemp): 29(ptr) Variable Function +53(byteAddrTemp): 29(ptr) Variable Function +78(byteAddrTemp): 29(ptr) Variable Function + 20: 19(int) ArrayLength 18(sbuf) 0 + Store 14(size) 20 + 22: 6(int) Load 11(pos) + 24: 19(int) ShiftRightLogical 22 23 + 26: 25(ptr) AccessChain 18(sbuf) 21 24 + 27: 6(int) Load 26 + 28: 8(float) ConvertUToF 27 + 31: 6(int) Load 11(pos) + 33: 6(int) IAdd 31 32 + 34: 19(int) ShiftRightLogical 33 23 + Store 30(byteAddrTemp) 34 + 35: 19(int) Load 30(byteAddrTemp) + 36: 25(ptr) AccessChain 18(sbuf) 21 35 + 37: 6(int) Load 36 + 38: 19(int) Load 30(byteAddrTemp) + 40: 19(int) IAdd 38 39 + 41: 25(ptr) AccessChain 18(sbuf) 21 40 + 42: 6(int) Load 41 + 44: 43(ivec2) CompositeConstruct 37 42 + 46: 45(fvec2) ConvertUToF 44 + 48: 8(float) CompositeExtract 46 0 + 49: 8(float) CompositeExtract 46 1 + 50: 9(fvec4) CompositeConstruct 48 49 47 47 + 51: 9(fvec4) CompositeConstruct 28 28 28 28 + 52: 9(fvec4) FAdd 51 50 + 54: 6(int) Load 11(pos) + 56: 6(int) IAdd 54 55 + 57: 19(int) ShiftRightLogical 56 23 + Store 53(byteAddrTemp) 57 + 58: 19(int) Load 53(byteAddrTemp) + 59: 25(ptr) AccessChain 18(sbuf) 21 58 + 60: 6(int) Load 59 + 61: 19(int) Load 53(byteAddrTemp) + 62: 19(int) IAdd 61 39 + 63: 25(ptr) AccessChain 18(sbuf) 21 62 + 64: 6(int) Load 63 + 65: 19(int) Load 53(byteAddrTemp) + 66: 19(int) IAdd 65 23 + 67: 25(ptr) AccessChain 18(sbuf) 21 66 + 68: 6(int) Load 67 + 70: 69(ivec3) CompositeConstruct 60 64 68 + 72: 71(fvec3) ConvertUToF 70 + 73: 8(float) CompositeExtract 72 0 + 74: 8(float) CompositeExtract 72 1 + 75: 8(float) CompositeExtract 72 2 + 76: 9(fvec4) CompositeConstruct 73 74 75 47 + 77: 9(fvec4) FAdd 52 76 + 79: 6(int) Load 11(pos) + 81: 6(int) IAdd 79 80 + 82: 19(int) ShiftRightLogical 81 23 + Store 78(byteAddrTemp) 82 + 83: 19(int) Load 78(byteAddrTemp) + 84: 25(ptr) AccessChain 18(sbuf) 21 83 + 85: 6(int) Load 84 + 86: 19(int) Load 78(byteAddrTemp) + 87: 19(int) IAdd 86 39 + 88: 25(ptr) AccessChain 18(sbuf) 21 87 + 89: 6(int) Load 88 + 90: 19(int) Load 78(byteAddrTemp) + 91: 19(int) IAdd 90 23 + 92: 25(ptr) AccessChain 18(sbuf) 21 91 + 93: 6(int) Load 92 + 94: 19(int) Load 78(byteAddrTemp) + 96: 19(int) IAdd 94 95 + 97: 25(ptr) AccessChain 18(sbuf) 21 96 + 98: 6(int) Load 97 + 100: 99(ivec4) CompositeConstruct 85 89 93 98 + 101: 9(fvec4) ConvertUToF 100 + 102: 9(fvec4) FAdd 77 101 + ReturnValue 102 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.coherent.frag.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.coherent.frag.out new file mode 100644 index 00000000..1d11b647 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.coherent.frag.out @@ -0,0 +1,312 @@ +hlsl.structbuffer.coherent.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: @main(u1; ( temp 4-component vector of float) +0:12 Function Parameters: +0:12 'pos' ( in uint) +0:? Sequence +0:13 move second child to first child ( temp float) +0:13 indirect index (layout( row_major std430) buffer float) +0:13 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:13 'sbuf2' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:13 Constant: +0:13 0 (const uint) +0:13 add ( temp uint) +0:13 'pos' ( in uint) +0:13 Constant: +0:13 1 (const uint) +0:13 Constant: +0:13 42.000000 +0:17 Sequence +0:17 move second child to first child ( temp uint) +0:17 'size' ( temp uint) +0:17 array length ( temp uint) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:17 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 move second child to first child ( temp uint) +0:17 'stride' ( temp uint) +0:17 Constant: +0:17 16 (const uint) +0:19 Test condition and select ( temp void) +0:19 Condition +0:19 test: direct index for structure ( temp bool) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:19 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 'pos' ( in uint) +0:19 Constant: +0:19 1 (const int) +0:19 true case +0:20 Branch: Return with expression +0:? Construct vec4 ( temp 4-component vector of float) +0:20 add ( temp 3-component vector of float) +0:20 color: direct index for structure ( temp 3-component vector of float) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:20 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' ( in uint) +0:20 Constant: +0:20 0 (const int) +0:20 indirect index (layout( row_major std430) buffer float) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:20 'sbuf2' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' ( in uint) +0:20 Constant: +0:20 0.000000 +0:19 false case +0:22 Branch: Return with expression +0:22 Construct vec4 ( temp 4-component vector of float) +0:22 Convert uint to float ( temp float) +0:22 add ( temp uint) +0:22 'size' ( temp uint) +0:22 'stride' ( temp uint) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp uint) +0:? 'pos' ( temp uint) +0:? 'pos' (layout( location=0) flat in uint) +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:12 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'pos' ( temp uint) +0:? Linker Objects +0:? 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:? 'sbuf2' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' (layout( location=0) flat in uint) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: @main(u1; ( temp 4-component vector of float) +0:12 Function Parameters: +0:12 'pos' ( in uint) +0:? Sequence +0:13 move second child to first child ( temp float) +0:13 indirect index (layout( row_major std430) buffer float) +0:13 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:13 'sbuf2' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:13 Constant: +0:13 0 (const uint) +0:13 add ( temp uint) +0:13 'pos' ( in uint) +0:13 Constant: +0:13 1 (const uint) +0:13 Constant: +0:13 42.000000 +0:17 Sequence +0:17 move second child to first child ( temp uint) +0:17 'size' ( temp uint) +0:17 array length ( temp uint) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:17 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 move second child to first child ( temp uint) +0:17 'stride' ( temp uint) +0:17 Constant: +0:17 16 (const uint) +0:19 Test condition and select ( temp void) +0:19 Condition +0:19 test: direct index for structure ( temp bool) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:19 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 'pos' ( in uint) +0:19 Constant: +0:19 1 (const int) +0:19 true case +0:20 Branch: Return with expression +0:? Construct vec4 ( temp 4-component vector of float) +0:20 add ( temp 3-component vector of float) +0:20 color: direct index for structure ( temp 3-component vector of float) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:20 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' ( in uint) +0:20 Constant: +0:20 0 (const int) +0:20 indirect index (layout( row_major std430) buffer float) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:20 'sbuf2' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' ( in uint) +0:20 Constant: +0:20 0.000000 +0:19 false case +0:22 Branch: Return with expression +0:22 Construct vec4 ( temp 4-component vector of float) +0:22 Convert uint to float ( temp float) +0:22 add ( temp uint) +0:22 'size' ( temp uint) +0:22 'stride' ( temp uint) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp uint) +0:? 'pos' ( temp uint) +0:? 'pos' (layout( location=0) flat in uint) +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:12 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'pos' ( temp uint) +0:? Linker Objects +0:? 'sbuf' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:? 'sbuf2' (layout( row_major std430) coherent buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' (layout( location=0) flat in uint) + +error: SPIRV-Tools Validation Errors +error: OpStore Pointer '26[size]'s type does not match Object '33's type. + OpStore %size %33 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 78 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 71 74 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 12 "@main(u1;" + Name 11 "pos" + Name 15 "sbuf2" + MemberName 15(sbuf2) 0 "@data" + Name 17 "sbuf2" + Name 26 "size" + Name 28 "sb_t" + MemberName 28(sb_t) 0 "color" + MemberName 28(sb_t) 1 "test" + Name 30 "sbuf" + MemberName 30(sbuf) 0 "@data" + Name 32 "sbuf" + Name 34 "stride" + Name 69 "pos" + Name 71 "pos" + Name 74 "@entryPointOutput" + Name 75 "param" + Decorate 14 ArrayStride 4 + MemberDecorate 15(sbuf2) 0 Coherent + MemberDecorate 15(sbuf2) 0 Offset 0 + Decorate 15(sbuf2) BufferBlock + Decorate 17(sbuf2) DescriptorSet 0 + MemberDecorate 28(sb_t) 0 Offset 0 + MemberDecorate 28(sb_t) 1 Offset 12 + Decorate 29 ArrayStride 16 + MemberDecorate 30(sbuf) 0 Coherent + MemberDecorate 30(sbuf) 0 Offset 0 + Decorate 30(sbuf) BufferBlock + Decorate 32(sbuf) DescriptorSet 0 + Decorate 71(pos) Flat + Decorate 71(pos) Location 0 + Decorate 74(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeFunction 9(fvec4) 7(ptr) + 14: TypeRuntimeArray 8(float) + 15(sbuf2): TypeStruct 14 + 16: TypePointer Uniform 15(sbuf2) + 17(sbuf2): 16(ptr) Variable Uniform + 18: TypeInt 32 1 + 19: 18(int) Constant 0 + 21: 6(int) Constant 1 + 23: 8(float) Constant 1109917696 + 24: TypePointer Uniform 8(float) + 27: TypeVector 8(float) 3 + 28(sb_t): TypeStruct 27(fvec3) 6(int) + 29: TypeRuntimeArray 28(sb_t) + 30(sbuf): TypeStruct 29 + 31: TypePointer Uniform 30(sbuf) + 32(sbuf): 31(ptr) Variable Uniform + 35: 6(int) Constant 16 + 37: 18(int) Constant 1 + 38: TypePointer Uniform 6(int) + 41: TypeBool + 42: 6(int) Constant 0 + 47: TypePointer Uniform 27(fvec3) + 55: 8(float) Constant 0 + 70: TypePointer Input 6(int) + 71(pos): 70(ptr) Variable Input + 73: TypePointer Output 9(fvec4) +74(@entryPointOutput): 73(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 69(pos): 7(ptr) Variable Function + 75(param): 7(ptr) Variable Function + 72: 6(int) Load 71(pos) + Store 69(pos) 72 + 76: 6(int) Load 69(pos) + Store 75(param) 76 + 77: 9(fvec4) FunctionCall 12(@main(u1;) 75(param) + Store 74(@entryPointOutput) 77 + Return + FunctionEnd + 12(@main(u1;): 9(fvec4) Function None 10 + 11(pos): 7(ptr) FunctionParameter + 13: Label + 26(size): 7(ptr) Variable Function + 34(stride): 7(ptr) Variable Function + 20: 6(int) Load 11(pos) + 22: 6(int) IAdd 20 21 + 25: 24(ptr) AccessChain 17(sbuf2) 19 22 + Store 25 23 + 33: 18(int) ArrayLength 32(sbuf) 0 + Store 26(size) 33 + Store 34(stride) 35 + 36: 6(int) Load 11(pos) + 39: 38(ptr) AccessChain 32(sbuf) 19 36 37 + 40: 6(int) Load 39 + 43: 41(bool) INotEqual 40 42 + SelectionMerge 45 None + BranchConditional 43 44 61 + 44: Label + 46: 6(int) Load 11(pos) + 48: 47(ptr) AccessChain 32(sbuf) 19 46 19 + 49: 27(fvec3) Load 48 + 50: 6(int) Load 11(pos) + 51: 24(ptr) AccessChain 17(sbuf2) 19 50 + 52: 8(float) Load 51 + 53: 27(fvec3) CompositeConstruct 52 52 52 + 54: 27(fvec3) FAdd 49 53 + 56: 8(float) CompositeExtract 54 0 + 57: 8(float) CompositeExtract 54 1 + 58: 8(float) CompositeExtract 54 2 + 59: 9(fvec4) CompositeConstruct 56 57 58 55 + ReturnValue 59 + 61: Label + 62: 6(int) Load 26(size) + 63: 6(int) Load 34(stride) + 64: 6(int) IAdd 62 63 + 65: 8(float) ConvertUToF 64 + 66: 9(fvec4) CompositeConstruct 65 65 65 65 + ReturnValue 66 + 45: Label + 68: 9(fvec4) Undef + ReturnValue 68 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.floatidx.comp.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.floatidx.comp.out new file mode 100644 index 00000000..82e307be --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.floatidx.comp.out @@ -0,0 +1,327 @@ +hlsl.structbuffer.floatidx.comp +Shader version: 500 +local_size = (1, 1, 1) +0:? Sequence +0:13 Function Definition: @main(vu3; ( temp void) +0:13 Function Parameters: +0:13 'nThreadId' ( in 3-component vector of uint) +0:? Sequence +0:14 Sequence +0:14 move second child to first child ( temp structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) +0:14 'data' ( temp structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) +0:14 'csb' (layout( binding=1 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 add ( temp uint) +0:14 AtomicAdd ( temp uint) +0:14 @count: direct index for structure ( temp uint) +0:14 'csb@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 4294967295 (const uint) +0:14 Constant: +0:14 -1 (const int) +0:15 Sequence +0:15 move second child to first child ( temp 2-component vector of float) +0:15 'coord' ( temp 2-component vector of float) +0:15 Convert uint to float ( temp 2-component vector of float) +0:15 vector swizzle ( temp 2-component vector of uint) +0:15 threadId: direct index for structure ( temp 2-component vector of uint) +0:15 'data' ( temp structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) +0:15 Constant: +0:15 1 (const int) +0:15 Sequence +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 1 (const int) +0:16 Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:16 'storeTemp' ( temp 4-component vector of float) +0:16 color: direct index for structure ( temp 4-component vector of float) +0:16 'data' ( temp structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) +0:16 Constant: +0:16 0 (const int) +0:16 imageStore ( temp void) +0:16 'outtx' (layout( rgba32f) uniform image2D) +0:16 Convert float to uint ( temp 2-component vector of uint) +0:16 'coord' ( temp 2-component vector of float) +0:16 'storeTemp' ( temp 4-component vector of float) +0:16 'storeTemp' ( temp 4-component vector of float) +0:18 move second child to first child ( temp 4-component vector of float) +0:18 indirect index (layout( row_major std430) buffer 4-component vector of float) +0:18 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of float) +0:18 'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:18 Constant: +0:18 0 (const uint) +0:18 Convert float to uint ( temp uint) +0:18 direct index ( temp float) +0:18 'coord' ( temp 2-component vector of float) +0:18 Constant: +0:18 0 (const int) +0:18 indirect index (layout( row_major std430) buffer 4-component vector of float) +0:18 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of float) +0:18 'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:18 Constant: +0:18 0 (const uint) +0:18 Convert float to uint ( temp uint) +0:18 direct index ( temp float) +0:18 'coord' ( temp 2-component vector of float) +0:18 Constant: +0:18 1 (const int) +0:13 Function Definition: main( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-component vector of uint) +0:? 'nThreadId' ( temp 3-component vector of uint) +0:? 'nThreadId' ( in 3-component vector of uint GlobalInvocationID) +0:13 Function Call: @main(vu3; ( temp void) +0:? 'nThreadId' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'outtx' (layout( rgba32f) uniform image2D) +0:? 'csb' (layout( binding=1 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId} @data}) +0:? 'csb@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 'nThreadId' ( in 3-component vector of uint GlobalInvocationID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (1, 1, 1) +0:? Sequence +0:13 Function Definition: @main(vu3; ( temp void) +0:13 Function Parameters: +0:13 'nThreadId' ( in 3-component vector of uint) +0:? Sequence +0:14 Sequence +0:14 move second child to first child ( temp structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) +0:14 'data' ( temp structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) +0:14 'csb' (layout( binding=1 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 add ( temp uint) +0:14 AtomicAdd ( temp uint) +0:14 @count: direct index for structure ( temp uint) +0:14 'csb@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 4294967295 (const uint) +0:14 Constant: +0:14 -1 (const int) +0:15 Sequence +0:15 move second child to first child ( temp 2-component vector of float) +0:15 'coord' ( temp 2-component vector of float) +0:15 Convert uint to float ( temp 2-component vector of float) +0:15 vector swizzle ( temp 2-component vector of uint) +0:15 threadId: direct index for structure ( temp 2-component vector of uint) +0:15 'data' ( temp structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) +0:15 Constant: +0:15 1 (const int) +0:15 Sequence +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 1 (const int) +0:16 Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:16 'storeTemp' ( temp 4-component vector of float) +0:16 color: direct index for structure ( temp 4-component vector of float) +0:16 'data' ( temp structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId}) +0:16 Constant: +0:16 0 (const int) +0:16 imageStore ( temp void) +0:16 'outtx' (layout( rgba32f) uniform image2D) +0:16 Convert float to uint ( temp 2-component vector of uint) +0:16 'coord' ( temp 2-component vector of float) +0:16 'storeTemp' ( temp 4-component vector of float) +0:16 'storeTemp' ( temp 4-component vector of float) +0:18 move second child to first child ( temp 4-component vector of float) +0:18 indirect index (layout( row_major std430) buffer 4-component vector of float) +0:18 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of float) +0:18 'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:18 Constant: +0:18 0 (const uint) +0:18 Convert float to uint ( temp uint) +0:18 direct index ( temp float) +0:18 'coord' ( temp 2-component vector of float) +0:18 Constant: +0:18 0 (const int) +0:18 indirect index (layout( row_major std430) buffer 4-component vector of float) +0:18 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of float) +0:18 'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:18 Constant: +0:18 0 (const uint) +0:18 Convert float to uint ( temp uint) +0:18 direct index ( temp float) +0:18 'coord' ( temp 2-component vector of float) +0:18 Constant: +0:18 1 (const int) +0:13 Function Definition: main( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-component vector of uint) +0:? 'nThreadId' ( temp 3-component vector of uint) +0:? 'nThreadId' ( in 3-component vector of uint GlobalInvocationID) +0:13 Function Call: @main(vu3; ( temp void) +0:? 'nThreadId' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'outtx' (layout( rgba32f) uniform image2D) +0:? 'csb' (layout( binding=1 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of float color, temp 2-component vector of uint threadId} @data}) +0:? 'csb@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of float @data}) +0:? 'nThreadId' ( in 3-component vector of uint GlobalInvocationID) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 85 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 80 + ExecutionMode 4 LocalSize 1 1 1 + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vu3;" + Name 10 "nThreadId" + Name 16 "sb_t" + MemberName 16(sb_t) 0 "color" + MemberName 16(sb_t) 1 "threadId" + Name 18 "data" + Name 19 "sb_t" + MemberName 19(sb_t) 0 "color" + MemberName 19(sb_t) 1 "threadId" + Name 21 "csb" + MemberName 21(csb) 0 "@data" + Name 23 "csb" + Name 26 "csb@count" + MemberName 26(csb@count) 0 "@count" + Name 28 "csb@count" + Name 49 "coord" + Name 53 "storeTemp" + Name 58 "outtx" + Name 64 "rwsb" + MemberName 64(rwsb) 0 "@data" + Name 66 "rwsb" + Name 78 "nThreadId" + Name 80 "nThreadId" + Name 82 "param" + MemberDecorate 19(sb_t) 0 Offset 0 + MemberDecorate 19(sb_t) 1 Offset 16 + Decorate 20 ArrayStride 32 + MemberDecorate 21(csb) 0 Offset 0 + Decorate 21(csb) BufferBlock + Decorate 23(csb) DescriptorSet 0 + Decorate 23(csb) Binding 1 + MemberDecorate 26(csb@count) 0 Offset 0 + Decorate 26(csb@count) BufferBlock + Decorate 28(csb@count) DescriptorSet 0 + Decorate 58(outtx) DescriptorSet 0 + Decorate 63 ArrayStride 16 + MemberDecorate 64(rwsb) 0 Offset 0 + Decorate 64(rwsb) BufferBlock + Decorate 66(rwsb) DescriptorSet 0 + Decorate 80(nThreadId) BuiltIn GlobalInvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 9: TypeFunction 2 8(ptr) + 13: TypeFloat 32 + 14: TypeVector 13(float) 4 + 15: TypeVector 6(int) 2 + 16(sb_t): TypeStruct 14(fvec4) 15(ivec2) + 17: TypePointer Function 16(sb_t) + 19(sb_t): TypeStruct 14(fvec4) 15(ivec2) + 20: TypeRuntimeArray 19(sb_t) + 21(csb): TypeStruct 20 + 22: TypePointer Uniform 21(csb) + 23(csb): 22(ptr) Variable Uniform + 24: TypeInt 32 1 + 25: 24(int) Constant 0 + 26(csb@count): TypeStruct 6(int) + 27: TypePointer Uniform 26(csb@count) + 28(csb@count): 27(ptr) Variable Uniform + 29: TypePointer Uniform 6(int) + 31: 6(int) Constant 4294967295 + 32: 6(int) Constant 1 + 33: 6(int) Constant 0 + 35: 24(int) Constant 4294967295 + 37: TypePointer Uniform 19(sb_t) + 41: TypePointer Function 14(fvec4) + 44: 24(int) Constant 1 + 45: TypePointer Function 15(ivec2) + 47: TypeVector 13(float) 2 + 48: TypePointer Function 47(fvec2) + 56: TypeImage 13(float) 2D nonsampled format:Rgba32f + 57: TypePointer UniformConstant 56 + 58(outtx): 57(ptr) Variable UniformConstant + 63: TypeRuntimeArray 14(fvec4) + 64(rwsb): TypeStruct 63 + 65: TypePointer Uniform 64(rwsb) + 66(rwsb): 65(ptr) Variable Uniform + 67: TypePointer Function 13(float) + 74: TypePointer Uniform 14(fvec4) + 79: TypePointer Input 7(ivec3) + 80(nThreadId): 79(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 78(nThreadId): 8(ptr) Variable Function + 82(param): 8(ptr) Variable Function + 81: 7(ivec3) Load 80(nThreadId) + Store 78(nThreadId) 81 + 83: 7(ivec3) Load 78(nThreadId) + Store 82(param) 83 + 84: 2 FunctionCall 11(@main(vu3;) 82(param) + Return + FunctionEnd + 11(@main(vu3;): 2 Function None 9 + 10(nThreadId): 8(ptr) FunctionParameter + 12: Label + 18(data): 17(ptr) Variable Function + 49(coord): 48(ptr) Variable Function + 53(storeTemp): 41(ptr) Variable Function + 30: 29(ptr) AccessChain 28(csb@count) 25 + 34: 6(int) AtomicIAdd 30 32 33 31 + 36: 6(int) IAdd 34 35 + 38: 37(ptr) AccessChain 23(csb) 25 36 + 39: 19(sb_t) Load 38 + 40: 14(fvec4) CompositeExtract 39 0 + 42: 41(ptr) AccessChain 18(data) 25 + Store 42 40 + 43: 15(ivec2) CompositeExtract 39 1 + 46: 45(ptr) AccessChain 18(data) 44 + Store 46 43 + 50: 45(ptr) AccessChain 18(data) 44 + 51: 15(ivec2) Load 50 + 52: 47(fvec2) ConvertUToF 51 + Store 49(coord) 52 + 54: 41(ptr) AccessChain 18(data) 25 + 55: 14(fvec4) Load 54 + Store 53(storeTemp) 55 + 59: 56 Load 58(outtx) + 60: 47(fvec2) Load 49(coord) + 61: 15(ivec2) ConvertFToU 60 + 62: 14(fvec4) Load 53(storeTemp) + ImageWrite 59 61 62 + 68: 67(ptr) AccessChain 49(coord) 33 + 69: 13(float) Load 68 + 70: 6(int) ConvertFToU 69 + 71: 67(ptr) AccessChain 49(coord) 32 + 72: 13(float) Load 71 + 73: 6(int) ConvertFToU 72 + 75: 74(ptr) AccessChain 66(rwsb) 25 73 + 76: 14(fvec4) Load 75 + 77: 74(ptr) AccessChain 66(rwsb) 25 70 + Store 77 76 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.fn.frag.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.fn.frag.out new file mode 100644 index 00000000..4b8ee635 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.fn.frag.out @@ -0,0 +1,298 @@ +hlsl.structbuffer.fn.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: get(block--vu4[0]1;u1; ( temp 4-component vector of uint) +0:5 Function Parameters: +0:5 'sb' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:5 'bufferOffset' ( in uint) +0:? Sequence +0:6 Branch: Return with expression +0:6 indirect index (layout( row_major std430) buffer 4-component vector of uint) +0:6 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint) +0:6 'sb' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:6 Constant: +0:6 0 (const uint) +0:6 'bufferOffset' ( in uint) +0:10 Function Definition: set(block--vu4[0]1;u1;vu4; ( temp void) +0:10 Function Parameters: +0:10 'sb' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:10 'sb@count' ( buffer block{layout( row_major std430) buffer uint @count}) +0:10 'bufferOffset' ( in uint) +0:10 'data' ( in 4-component vector of uint) +0:? Sequence +0:11 move second child to first child ( temp 4-component vector of uint) +0:11 indirect index ( buffer 4-component vector of uint) +0:11 @data: direct index for structure ( buffer unsized 1-element array of 4-component vector of uint) +0:11 'sb' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 'bufferOffset' ( in uint) +0:11 'data' ( in 4-component vector of uint) +0:20 Function Definition: @main(u1; ( temp 4-component vector of float) +0:20 Function Parameters: +0:20 'pos' ( in uint) +0:? Sequence +0:21 Function Call: set(block--vu4[0]1;u1;vu4; ( temp void) +0:21 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:21 'sbuf2@count' ( buffer block{layout( row_major std430) buffer uint @count}) +0:21 Constant: +0:21 2 (const uint) +0:21 Function Call: get(block--vu4[0]1;u1; ( temp 4-component vector of uint) +0:21 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:21 Constant: +0:21 3 (const uint) +0:23 Branch: Return with expression +0:23 Constant: +0:23 0.000000 +0:23 0.000000 +0:23 0.000000 +0:23 0.000000 +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 move second child to first child ( temp uint) +0:? 'pos' ( temp uint) +0:? 'pos' (layout( location=0) flat in uint) +0:20 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:20 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'pos' ( temp uint) +0:? Linker Objects +0:? 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:? 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:? 'sbuf2@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf3' (layout( binding=12 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 3-component vector of uint @data}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' (layout( location=0) flat in uint) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: get(block--vu4[0]1;u1; ( temp 4-component vector of uint) +0:5 Function Parameters: +0:5 'sb' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:5 'bufferOffset' ( in uint) +0:? Sequence +0:6 Branch: Return with expression +0:6 indirect index (layout( row_major std430) buffer 4-component vector of uint) +0:6 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint) +0:6 'sb' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:6 Constant: +0:6 0 (const uint) +0:6 'bufferOffset' ( in uint) +0:10 Function Definition: set(block--vu4[0]1;u1;vu4; ( temp void) +0:10 Function Parameters: +0:10 'sb' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:10 'sb@count' ( buffer block{layout( row_major std430) buffer uint @count}) +0:10 'bufferOffset' ( in uint) +0:10 'data' ( in 4-component vector of uint) +0:? Sequence +0:11 move second child to first child ( temp 4-component vector of uint) +0:11 indirect index ( buffer 4-component vector of uint) +0:11 @data: direct index for structure ( buffer unsized 1-element array of 4-component vector of uint) +0:11 'sb' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 'bufferOffset' ( in uint) +0:11 'data' ( in 4-component vector of uint) +0:20 Function Definition: @main(u1; ( temp 4-component vector of float) +0:20 Function Parameters: +0:20 'pos' ( in uint) +0:? Sequence +0:21 Function Call: set(block--vu4[0]1;u1;vu4; ( temp void) +0:21 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:21 'sbuf2@count' ( buffer block{layout( row_major std430) buffer uint @count}) +0:21 Constant: +0:21 2 (const uint) +0:21 Function Call: get(block--vu4[0]1;u1; ( temp 4-component vector of uint) +0:21 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:21 Constant: +0:21 3 (const uint) +0:23 Branch: Return with expression +0:23 Constant: +0:23 0.000000 +0:23 0.000000 +0:23 0.000000 +0:23 0.000000 +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 move second child to first child ( temp uint) +0:? 'pos' ( temp uint) +0:? 'pos' (layout( location=0) flat in uint) +0:20 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:20 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'pos' ( temp uint) +0:? Linker Objects +0:? 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:? 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:? 'sbuf2@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf3' (layout( binding=12 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of 3-component vector of uint @data}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' (layout( location=0) flat in uint) + +error: SPIRV-Tools Validation Errors +error: Structure id 20 decorated as BufferBlock must be explicitly laid out with Offset decorations. + %__1 = OpTypeStruct %uint + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 78 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 63 66 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "" + MemberName 9 0 "@data" + Name 15 "get(block--vu4[0]1;u1;" + Name 13 "sb" + Name 14 "bufferOffset" + Name 18 "" + MemberName 18 0 "@data" + Name 20 "" + MemberName 20 0 "@count" + Name 28 "set(block--vu4[0]1;u1;vu4;" + Name 24 "sb" + Name 25 "sb@count" + Name 26 "bufferOffset" + Name 27 "data" + Name 34 "@main(u1;" + Name 33 "pos" + Name 47 "sbuf2" + Name 48 "sbuf2@count" + Name 50 "sbuf" + Name 52 "param" + Name 54 "param" + Name 55 "param" + Name 61 "pos" + Name 63 "pos" + Name 66 "@entryPointOutput" + Name 67 "param" + Name 70 "sbuf2@count" + MemberName 70(sbuf2@count) 0 "@count" + Name 72 "sbuf2@count" + Name 75 "sbuf3" + MemberName 75(sbuf3) 0 "@data" + Name 77 "sbuf3" + Decorate 8 ArrayStride 16 + MemberDecorate 9 0 NonWritable + MemberDecorate 9 0 Offset 0 + Decorate 9 BufferBlock + Decorate 13(sb) NonWritable + Decorate 17 ArrayStride 16 + MemberDecorate 18 0 Offset 0 + Decorate 18 BufferBlock + Decorate 20 BufferBlock + Decorate 47(sbuf2) DescriptorSet 0 + Decorate 48(sbuf2@count) DescriptorSet 0 + Decorate 50(sbuf) DescriptorSet 0 + Decorate 50(sbuf) Binding 10 + Decorate 63(pos) Flat + Decorate 63(pos) Location 0 + Decorate 66(@entryPointOutput) Location 0 + MemberDecorate 70(sbuf2@count) 0 Offset 0 + Decorate 70(sbuf2@count) BufferBlock + Decorate 72(sbuf2@count) DescriptorSet 0 + Decorate 74 ArrayStride 16 + MemberDecorate 75(sbuf3) 0 NonWritable + MemberDecorate 75(sbuf3) 0 Offset 0 + Decorate 75(sbuf3) BufferBlock + Decorate 77(sbuf3) DescriptorSet 0 + Decorate 77(sbuf3) Binding 12 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 4 + 8: TypeRuntimeArray 7(ivec4) + 9: TypeStruct 8 + 10: TypePointer Uniform 9(struct) + 11: TypePointer Function 6(int) + 12: TypeFunction 7(ivec4) 10(ptr) 11(ptr) + 17: TypeRuntimeArray 7(ivec4) + 18: TypeStruct 17 + 19: TypePointer Uniform 18(struct) + 20: TypeStruct 6(int) + 21: TypePointer Uniform 20(struct) + 22: TypePointer Function 7(ivec4) + 23: TypeFunction 2 19(ptr) 21(ptr) 11(ptr) 22(ptr) + 30: TypeFloat 32 + 31: TypeVector 30(float) 4 + 32: TypeFunction 31(fvec4) 11(ptr) + 36: TypeInt 32 1 + 37: 36(int) Constant 0 + 39: TypePointer Uniform 7(ivec4) + 47(sbuf2): 19(ptr) Variable Uniform + 48(sbuf2@count): 21(ptr) Variable Uniform + 49: 6(int) Constant 2 + 50(sbuf): 10(ptr) Variable Uniform + 51: 6(int) Constant 3 + 57: 30(float) Constant 0 + 58: 31(fvec4) ConstantComposite 57 57 57 57 + 62: TypePointer Input 6(int) + 63(pos): 62(ptr) Variable Input + 65: TypePointer Output 31(fvec4) +66(@entryPointOutput): 65(ptr) Variable Output + 70(sbuf2@count): TypeStruct 6(int) + 71: TypePointer Uniform 70(sbuf2@count) + 72(sbuf2@count): 71(ptr) Variable Uniform + 73: TypeVector 6(int) 3 + 74: TypeRuntimeArray 73(ivec3) + 75(sbuf3): TypeStruct 74 + 76: TypePointer Uniform 75(sbuf3) + 77(sbuf3): 76(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + 61(pos): 11(ptr) Variable Function + 67(param): 11(ptr) Variable Function + 64: 6(int) Load 63(pos) + Store 61(pos) 64 + 68: 6(int) Load 61(pos) + Store 67(param) 68 + 69: 31(fvec4) FunctionCall 34(@main(u1;) 67(param) + Store 66(@entryPointOutput) 69 + Return + FunctionEnd +15(get(block--vu4[0]1;u1;): 7(ivec4) Function None 12 + 13(sb): 10(ptr) FunctionParameter +14(bufferOffset): 11(ptr) FunctionParameter + 16: Label + 38: 6(int) Load 14(bufferOffset) + 40: 39(ptr) AccessChain 13(sb) 37 38 + 41: 7(ivec4) Load 40 + ReturnValue 41 + FunctionEnd +28(set(block--vu4[0]1;u1;vu4;): 2 Function None 23 + 24(sb): 19(ptr) FunctionParameter + 25(sb@count): 21(ptr) FunctionParameter +26(bufferOffset): 11(ptr) FunctionParameter + 27(data): 22(ptr) FunctionParameter + 29: Label + 44: 6(int) Load 26(bufferOffset) + 45: 7(ivec4) Load 27(data) + 46: 39(ptr) AccessChain 24(sb) 37 44 + Store 46 45 + Return + FunctionEnd + 34(@main(u1;): 31(fvec4) Function None 32 + 33(pos): 11(ptr) FunctionParameter + 35: Label + 52(param): 11(ptr) Variable Function + 54(param): 11(ptr) Variable Function + 55(param): 22(ptr) Variable Function + Store 52(param) 51 + 53: 7(ivec4) FunctionCall 15(get(block--vu4[0]1;u1;) 50(sbuf) 52(param) + Store 54(param) 49 + Store 55(param) 53 + 56: 2 FunctionCall 28(set(block--vu4[0]1;u1;vu4;) 47(sbuf2) 48(sbuf2@count) 54(param) 55(param) + ReturnValue 58 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out new file mode 100644 index 00000000..517b48c8 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out @@ -0,0 +1,248 @@ +hlsl.structbuffer.fn2.comp +Shader version: 500 +local_size = (256, 1, 1) +0:? Sequence +0:5 Function Definition: testLoad(u1;block--u1[0]1; ( temp 2-component vector of uint) +0:5 Function Parameters: +0:5 'loc' ( in uint) +0:5 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? Sequence +0:6 Sequence +0:6 move second child to first child ( temp 2-component vector of uint) +0:6 'result' ( temp 2-component vector of uint) +0:? Sequence +0:6 move second child to first child ( temp int) +0:6 'byteAddrTemp' ( temp int) +0:6 right-shift ( temp int) +0:6 'loc' ( in uint) +0:6 Constant: +0:6 2 (const int) +0:? Construct vec2 ( temp 2-component vector of uint) +0:6 indirect index ( temp uint) +0:6 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:6 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:6 Constant: +0:6 0 (const uint) +0:6 'byteAddrTemp' ( temp int) +0:6 indirect index ( temp uint) +0:6 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:6 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:6 Constant: +0:6 0 (const uint) +0:6 add ( temp int) +0:6 'byteAddrTemp' ( temp int) +0:6 Constant: +0:6 1 (const int) +0:7 Branch: Return with expression +0:7 'result' ( temp 2-component vector of uint) +0:12 Function Definition: @main(u1; ( temp void) +0:12 Function Parameters: +0:12 'dispatchId' ( in uint) +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp 2-component vector of uint) +0:13 'result' ( temp 2-component vector of uint) +0:13 Function Call: testLoad(u1;block--u1[0]1; ( temp 2-component vector of uint) +0:13 'dispatchId' ( in uint) +0:13 'g_input' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:14 Sequence +0:14 imageStore ( temp void) +0:14 'g_output' (layout( binding=1 rg32ui) uniform uimageBuffer) +0:14 'dispatchId' ( in uint) +0:14 'result' ( temp 2-component vector of uint) +0:14 'result' ( temp 2-component vector of uint) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp uint) +0:? 'dispatchId' ( temp uint) +0:? Construct uint ( temp uint) +0:? 'dispatchId' ( in 3-component vector of uint GlobalInvocationID) +0:12 Function Call: @main(u1; ( temp void) +0:? 'dispatchId' ( temp uint) +0:? Linker Objects +0:? 'g_input' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? 'g_output' (layout( binding=1 rg32ui) uniform uimageBuffer) +0:? 'dispatchId' ( in 3-component vector of uint GlobalInvocationID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (256, 1, 1) +0:? Sequence +0:5 Function Definition: testLoad(u1;block--u1[0]1; ( temp 2-component vector of uint) +0:5 Function Parameters: +0:5 'loc' ( in uint) +0:5 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? Sequence +0:6 Sequence +0:6 move second child to first child ( temp 2-component vector of uint) +0:6 'result' ( temp 2-component vector of uint) +0:? Sequence +0:6 move second child to first child ( temp int) +0:6 'byteAddrTemp' ( temp int) +0:6 right-shift ( temp int) +0:6 'loc' ( in uint) +0:6 Constant: +0:6 2 (const int) +0:? Construct vec2 ( temp 2-component vector of uint) +0:6 indirect index ( temp uint) +0:6 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:6 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:6 Constant: +0:6 0 (const uint) +0:6 'byteAddrTemp' ( temp int) +0:6 indirect index ( temp uint) +0:6 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:6 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:6 Constant: +0:6 0 (const uint) +0:6 add ( temp int) +0:6 'byteAddrTemp' ( temp int) +0:6 Constant: +0:6 1 (const int) +0:7 Branch: Return with expression +0:7 'result' ( temp 2-component vector of uint) +0:12 Function Definition: @main(u1; ( temp void) +0:12 Function Parameters: +0:12 'dispatchId' ( in uint) +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp 2-component vector of uint) +0:13 'result' ( temp 2-component vector of uint) +0:13 Function Call: testLoad(u1;block--u1[0]1; ( temp 2-component vector of uint) +0:13 'dispatchId' ( in uint) +0:13 'g_input' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:14 Sequence +0:14 imageStore ( temp void) +0:14 'g_output' (layout( binding=1 rg32ui) uniform uimageBuffer) +0:14 'dispatchId' ( in uint) +0:14 'result' ( temp 2-component vector of uint) +0:14 'result' ( temp 2-component vector of uint) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp uint) +0:? 'dispatchId' ( temp uint) +0:? Construct uint ( temp uint) +0:? 'dispatchId' ( in 3-component vector of uint GlobalInvocationID) +0:12 Function Call: @main(u1; ( temp void) +0:? 'dispatchId' ( temp uint) +0:? Linker Objects +0:? 'g_input' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? 'g_output' (layout( binding=1 rg32ui) uniform uimageBuffer) +0:? 'dispatchId' ( in 3-component vector of uint GlobalInvocationID) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 63 + + Capability Shader + Capability ImageBuffer + Capability StorageImageExtendedFormats + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 57 + ExecutionMode 4 LocalSize 256 1 1 + Source HLSL 500 + Name 4 "main" + Name 9 "" + MemberName 9 0 "@data" + Name 15 "testLoad(u1;block--u1[0]1;" + Name 13 "loc" + Name 14 "buffer" + Name 19 "@main(u1;" + Name 18 "dispatchId" + Name 22 "result" + Name 25 "byteAddrTemp" + Name 43 "result" + Name 44 "g_input" + Name 45 "param" + Name 50 "g_output" + Name 54 "dispatchId" + Name 57 "dispatchId" + Name 60 "param" + Decorate 8 ArrayStride 4 + MemberDecorate 9 0 NonWritable + MemberDecorate 9 0 Offset 0 + Decorate 9 BufferBlock + Decorate 14(buffer) NonWritable + Decorate 44(g_input) DescriptorSet 0 + Decorate 44(g_input) Binding 0 + Decorate 50(g_output) DescriptorSet 0 + Decorate 50(g_output) Binding 1 + Decorate 57(dispatchId) BuiltIn GlobalInvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 8: TypeRuntimeArray 6(int) + 9: TypeStruct 8 + 10: TypePointer Uniform 9(struct) + 11: TypeVector 6(int) 2 + 12: TypeFunction 11(ivec2) 7(ptr) 10(ptr) + 17: TypeFunction 2 7(ptr) + 21: TypePointer Function 11(ivec2) + 23: TypeInt 32 1 + 24: TypePointer Function 23(int) + 27: 23(int) Constant 2 + 29: 23(int) Constant 0 + 31: TypePointer Uniform 6(int) + 35: 23(int) Constant 1 + 44(g_input): 10(ptr) Variable Uniform + 48: TypeImage 6(int) Buffer nonsampled format:Rg32ui + 49: TypePointer UniformConstant 48 + 50(g_output): 49(ptr) Variable UniformConstant + 55: TypeVector 6(int) 3 + 56: TypePointer Input 55(ivec3) + 57(dispatchId): 56(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 54(dispatchId): 7(ptr) Variable Function + 60(param): 7(ptr) Variable Function + 58: 55(ivec3) Load 57(dispatchId) + 59: 6(int) CompositeExtract 58 0 + Store 54(dispatchId) 59 + 61: 6(int) Load 54(dispatchId) + Store 60(param) 61 + 62: 2 FunctionCall 19(@main(u1;) 60(param) + Return + FunctionEnd +15(testLoad(u1;block--u1[0]1;): 11(ivec2) Function None 12 + 13(loc): 7(ptr) FunctionParameter + 14(buffer): 10(ptr) FunctionParameter + 16: Label + 22(result): 21(ptr) Variable Function +25(byteAddrTemp): 24(ptr) Variable Function + 26: 6(int) Load 13(loc) + 28: 23(int) ShiftRightLogical 26 27 + Store 25(byteAddrTemp) 28 + 30: 23(int) Load 25(byteAddrTemp) + 32: 31(ptr) AccessChain 14(buffer) 29 30 + 33: 6(int) Load 32 + 34: 23(int) Load 25(byteAddrTemp) + 36: 23(int) IAdd 34 35 + 37: 31(ptr) AccessChain 14(buffer) 29 36 + 38: 6(int) Load 37 + 39: 11(ivec2) CompositeConstruct 33 38 + Store 22(result) 39 + 40: 11(ivec2) Load 22(result) + ReturnValue 40 + FunctionEnd + 19(@main(u1;): 2 Function None 17 + 18(dispatchId): 7(ptr) FunctionParameter + 20: Label + 43(result): 21(ptr) Variable Function + 45(param): 7(ptr) Variable Function + 46: 6(int) Load 18(dispatchId) + Store 45(param) 46 + 47: 11(ivec2) FunctionCall 15(testLoad(u1;block--u1[0]1;) 45(param) 44(g_input) + Store 43(result) 47 + 51: 48 Load 50(g_output) + 52: 6(int) Load 18(dispatchId) + 53: 11(ivec2) Load 43(result) + ImageWrite 51 52 53 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.frag.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.frag.out new file mode 100644 index 00000000..e058d112 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.frag.out @@ -0,0 +1,352 @@ +hlsl.structbuffer.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: @main(u1; ( temp 4-component vector of float) +0:12 Function Parameters: +0:12 'pos' ( in uint) +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:13 'mydata' ( temp structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:13 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:13 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:13 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) +0:13 Constant: +0:13 0 (const uint) +0:13 'pos' ( in uint) +0:17 Sequence +0:17 move second child to first child ( temp uint) +0:17 'size' ( temp uint) +0:17 array length ( temp uint) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:17 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 move second child to first child ( temp uint) +0:17 'stride' ( temp uint) +0:17 Constant: +0:17 32 (const uint) +0:19 Test condition and select ( temp void) +0:19 Condition +0:19 test: direct index for structure ( temp bool) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:19 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 'pos' ( in uint) +0:19 Constant: +0:19 1 (const int) +0:19 true case +0:20 Branch: Return with expression +0:? Construct vec4 ( temp 4-component vector of float) +0:20 add ( temp 3-component vector of float) +0:20 color: direct index for structure ( temp 3-component vector of float) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:20 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' ( in uint) +0:20 Constant: +0:20 0 (const int) +0:20 indirect index (layout( row_major std430) buffer float) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:20 'sbuf2' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' ( in uint) +0:20 Constant: +0:20 0.000000 +0:19 false case +0:22 Branch: Return with expression +0:22 Construct vec4 ( temp 4-component vector of float) +0:22 add ( temp float) +0:22 add ( temp float) +0:22 direct index ( temp float) +0:22 color: direct index for structure ( temp 3-component vector of float) +0:22 'mydata' ( temp structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 0 (const int) +0:22 Convert uint to float ( temp float) +0:22 'size' ( temp uint) +0:22 Convert uint to float ( temp float) +0:22 'stride' ( temp uint) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp uint) +0:? 'pos' ( temp uint) +0:? 'pos' (layout( location=0) flat in uint) +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:12 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'pos' ( temp uint) +0:? Linker Objects +0:? 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) +0:? 'sbuf2' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' (layout( location=0) flat in uint) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: @main(u1; ( temp 4-component vector of float) +0:12 Function Parameters: +0:12 'pos' ( in uint) +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:13 'mydata' ( temp structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:13 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:13 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:13 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) +0:13 Constant: +0:13 0 (const uint) +0:13 'pos' ( in uint) +0:17 Sequence +0:17 move second child to first child ( temp uint) +0:17 'size' ( temp uint) +0:17 array length ( temp uint) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:17 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 move second child to first child ( temp uint) +0:17 'stride' ( temp uint) +0:17 Constant: +0:17 32 (const uint) +0:19 Test condition and select ( temp void) +0:19 Condition +0:19 test: direct index for structure ( temp bool) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:19 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 'pos' ( in uint) +0:19 Constant: +0:19 1 (const int) +0:19 true case +0:20 Branch: Return with expression +0:? Construct vec4 ( temp 4-component vector of float) +0:20 add ( temp 3-component vector of float) +0:20 color: direct index for structure ( temp 3-component vector of float) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:20 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' ( in uint) +0:20 Constant: +0:20 0 (const int) +0:20 indirect index (layout( row_major std430) buffer float) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:20 'sbuf2' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' ( in uint) +0:20 Constant: +0:20 0.000000 +0:19 false case +0:22 Branch: Return with expression +0:22 Construct vec4 ( temp 4-component vector of float) +0:22 add ( temp float) +0:22 add ( temp float) +0:22 direct index ( temp float) +0:22 color: direct index for structure ( temp 3-component vector of float) +0:22 'mydata' ( temp structure{ temp 3-component vector of float color, temp bool test, temp bool test2}) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 0 (const int) +0:22 Convert uint to float ( temp float) +0:22 'size' ( temp uint) +0:22 Convert uint to float ( temp float) +0:22 'stride' ( temp uint) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp uint) +0:? 'pos' ( temp uint) +0:? 'pos' (layout( location=0) flat in uint) +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:12 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'pos' ( temp uint) +0:? Linker Objects +0:? 'sbuf' (layout( binding=10 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test, temp bool test2} @data}) +0:? 'sbuf2' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' (layout( location=0) flat in uint) + +error: SPIRV-Tools Validation Errors +error: OpStore Pointer '43[size]'s type does not match Object '44's type. + OpStore %size %44 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 96 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 89 92 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 12 "@main(u1;" + Name 11 "pos" + Name 16 "sb_t" + MemberName 16(sb_t) 0 "color" + MemberName 16(sb_t) 1 "test" + MemberName 16(sb_t) 2 "test2" + Name 18 "mydata" + Name 19 "sb_t" + MemberName 19(sb_t) 0 "color" + MemberName 19(sb_t) 1 "test" + MemberName 19(sb_t) 2 "test2" + Name 21 "sbuf" + MemberName 21(sbuf) 0 "@data" + Name 23 "sbuf" + Name 43 "size" + Name 45 "stride" + Name 59 "sbuf2" + MemberName 59(sbuf2) 0 "@data" + Name 61 "sbuf2" + Name 87 "pos" + Name 89 "pos" + Name 92 "@entryPointOutput" + Name 93 "param" + MemberDecorate 19(sb_t) 0 Offset 0 + MemberDecorate 19(sb_t) 1 Offset 12 + MemberDecorate 19(sb_t) 2 Offset 16 + Decorate 20 ArrayStride 32 + MemberDecorate 21(sbuf) 0 NonWritable + MemberDecorate 21(sbuf) 0 Offset 0 + Decorate 21(sbuf) BufferBlock + Decorate 23(sbuf) DescriptorSet 0 + Decorate 23(sbuf) Binding 10 + Decorate 58 ArrayStride 4 + MemberDecorate 59(sbuf2) 0 NonWritable + MemberDecorate 59(sbuf2) 0 Offset 0 + Decorate 59(sbuf2) BufferBlock + Decorate 61(sbuf2) DescriptorSet 0 + Decorate 89(pos) Flat + Decorate 89(pos) Location 0 + Decorate 92(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeFunction 9(fvec4) 7(ptr) + 14: TypeVector 8(float) 3 + 15: TypeBool + 16(sb_t): TypeStruct 14(fvec3) 15(bool) 15(bool) + 17: TypePointer Function 16(sb_t) + 19(sb_t): TypeStruct 14(fvec3) 6(int) 6(int) + 20: TypeRuntimeArray 19(sb_t) + 21(sbuf): TypeStruct 20 + 22: TypePointer Uniform 21(sbuf) + 23(sbuf): 22(ptr) Variable Uniform + 24: TypeInt 32 1 + 25: 24(int) Constant 0 + 27: TypePointer Uniform 19(sb_t) + 31: TypePointer Function 14(fvec3) + 34: 24(int) Constant 1 + 35: 6(int) Constant 0 + 37: TypePointer Function 15(bool) + 40: 24(int) Constant 2 + 46: 6(int) Constant 32 + 48: TypePointer Uniform 6(int) + 55: TypePointer Uniform 14(fvec3) + 58: TypeRuntimeArray 8(float) + 59(sbuf2): TypeStruct 58 + 60: TypePointer Uniform 59(sbuf2) + 61(sbuf2): 60(ptr) Variable Uniform + 63: TypePointer Uniform 8(float) + 68: 8(float) Constant 0 + 75: TypePointer Function 8(float) + 88: TypePointer Input 6(int) + 89(pos): 88(ptr) Variable Input + 91: TypePointer Output 9(fvec4) +92(@entryPointOutput): 91(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 87(pos): 7(ptr) Variable Function + 93(param): 7(ptr) Variable Function + 90: 6(int) Load 89(pos) + Store 87(pos) 90 + 94: 6(int) Load 87(pos) + Store 93(param) 94 + 95: 9(fvec4) FunctionCall 12(@main(u1;) 93(param) + Store 92(@entryPointOutput) 95 + Return + FunctionEnd + 12(@main(u1;): 9(fvec4) Function None 10 + 11(pos): 7(ptr) FunctionParameter + 13: Label + 18(mydata): 17(ptr) Variable Function + 43(size): 7(ptr) Variable Function + 45(stride): 7(ptr) Variable Function + 26: 6(int) Load 11(pos) + 28: 27(ptr) AccessChain 23(sbuf) 25 26 + 29: 19(sb_t) Load 28 + 30: 14(fvec3) CompositeExtract 29 0 + 32: 31(ptr) AccessChain 18(mydata) 25 + Store 32 30 + 33: 6(int) CompositeExtract 29 1 + 36: 15(bool) INotEqual 33 35 + 38: 37(ptr) AccessChain 18(mydata) 34 + Store 38 36 + 39: 6(int) CompositeExtract 29 2 + 41: 15(bool) INotEqual 39 35 + 42: 37(ptr) AccessChain 18(mydata) 40 + Store 42 41 + 44: 24(int) ArrayLength 23(sbuf) 0 + Store 43(size) 44 + Store 45(stride) 46 + 47: 6(int) Load 11(pos) + 49: 48(ptr) AccessChain 23(sbuf) 25 47 34 + 50: 6(int) Load 49 + 51: 15(bool) INotEqual 50 35 + SelectionMerge 53 None + BranchConditional 51 52 74 + 52: Label + 54: 6(int) Load 11(pos) + 56: 55(ptr) AccessChain 23(sbuf) 25 54 25 + 57: 14(fvec3) Load 56 + 62: 6(int) Load 11(pos) + 64: 63(ptr) AccessChain 61(sbuf2) 25 62 + 65: 8(float) Load 64 + 66: 14(fvec3) CompositeConstruct 65 65 65 + 67: 14(fvec3) FAdd 57 66 + 69: 8(float) CompositeExtract 67 0 + 70: 8(float) CompositeExtract 67 1 + 71: 8(float) CompositeExtract 67 2 + 72: 9(fvec4) CompositeConstruct 69 70 71 68 + ReturnValue 72 + 74: Label + 76: 75(ptr) AccessChain 18(mydata) 25 35 + 77: 8(float) Load 76 + 78: 6(int) Load 43(size) + 79: 8(float) ConvertUToF 78 + 80: 8(float) FAdd 77 79 + 81: 6(int) Load 45(stride) + 82: 8(float) ConvertUToF 81 + 83: 8(float) FAdd 80 82 + 84: 9(fvec4) CompositeConstruct 83 83 83 83 + ReturnValue 84 + 53: Label + 86: 9(fvec4) Undef + ReturnValue 86 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.hlslfun1.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.hlslfun1.out new file mode 100644 index 00000000..8b84a731 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.hlslfun1.out @@ -0,0 +1,125 @@ +hlsl.structbuffer.incdec.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 70 + + Capability Shader + Extension "SPV_GOOGLE_hlsl_functionality1" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 63 66 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 12 "@main(u1;" + Name 11 "pos" + Name 16 "result" + Name 20 "sbuf_rw_i" + MemberName 20(sbuf_rw_i) 0 "@data" + Name 22 "sbuf_rw_i" + Name 26 "sbuf_rw_d" + Name 27 "sbuf_rw_nocounter" + Name 33 "c1" + Name 34 "sbuf_rw_i@count" + MemberName 34(sbuf_rw_i@count) 0 "@count" + Name 36 "sbuf_rw_i@count" + Name 41 "c2" + Name 42 "sbuf_rw_d@count" + Name 61 "pos" + Name 63 "pos" + Name 66 "@entryPointOutput" + Name 67 "param" + Decorate 19 ArrayStride 16 + MemberDecorate 20(sbuf_rw_i) 0 Offset 0 + Decorate 20(sbuf_rw_i) BufferBlock + Decorate 22(sbuf_rw_i) DescriptorSet 0 + Decorate 26(sbuf_rw_d) DescriptorSet 0 + Decorate 27(sbuf_rw_nocounter) DescriptorSet 0 + MemberDecorate 34(sbuf_rw_i@count) 0 Offset 0 + Decorate 34(sbuf_rw_i@count) BufferBlock + Decorate 36(sbuf_rw_i@count) DescriptorSet 0 + Decorate 42(sbuf_rw_d@count) DescriptorSet 0 + Decorate 63(pos) Flat + Decorate 63(pos) Location 0 + DecorateStringGOOGLE 63(pos) DecorationHlslSemanticGOOGLE "FOO" + Decorate 66(@entryPointOutput) Location 0 + DecorateStringGOOGLE 66(@entryPointOutput) DecorationHlslSemanticGOOGLE "SV_TARGET0" + DecorateId 22(sbuf_rw_i) DecorationHlslCounterBufferGOOGLE 36(sbuf_rw_i@count) + DecorateId 26(sbuf_rw_d) DecorationHlslCounterBufferGOOGLE 42(sbuf_rw_d@count) + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeFunction 9(fvec4) 7(ptr) + 14: TypeVector 6(int) 4 + 15: TypePointer Function 14(ivec4) + 17: 6(int) Constant 0 + 18: 14(ivec4) ConstantComposite 17 17 17 17 + 19: TypeRuntimeArray 14(ivec4) + 20(sbuf_rw_i): TypeStruct 19 + 21: TypePointer Uniform 20(sbuf_rw_i) + 22(sbuf_rw_i): 21(ptr) Variable Uniform + 23: TypeInt 32 1 + 24: 23(int) Constant 0 + 25: 23(int) Constant 7 + 26(sbuf_rw_d): 21(ptr) Variable Uniform +27(sbuf_rw_nocounter): 21(ptr) Variable Uniform + 28: 23(int) Constant 5 + 29: 6(int) Constant 2 + 30: 14(ivec4) ConstantComposite 29 29 29 29 + 31: TypePointer Uniform 14(ivec4) +34(sbuf_rw_i@count): TypeStruct 6(int) + 35: TypePointer Uniform 34(sbuf_rw_i@count) +36(sbuf_rw_i@count): 35(ptr) Variable Uniform + 37: TypePointer Uniform 6(int) + 39: 6(int) Constant 1 +42(sbuf_rw_d@count): 35(ptr) Variable Uniform + 44: 6(int) Constant 4294967295 + 46: 23(int) Constant 4294967295 + 62: TypePointer Input 6(int) + 63(pos): 62(ptr) Variable Input + 65: TypePointer Output 9(fvec4) +66(@entryPointOutput): 65(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 61(pos): 7(ptr) Variable Function + 67(param): 7(ptr) Variable Function + 64: 6(int) Load 63(pos) + Store 61(pos) 64 + 68: 6(int) Load 61(pos) + Store 67(param) 68 + 69: 9(fvec4) FunctionCall 12(@main(u1;) 67(param) + Store 66(@entryPointOutput) 69 + Return + FunctionEnd + 12(@main(u1;): 9(fvec4) Function None 10 + 11(pos): 7(ptr) FunctionParameter + 13: Label + 16(result): 15(ptr) Variable Function + 33(c1): 7(ptr) Variable Function + 41(c2): 7(ptr) Variable Function + Store 16(result) 18 + 32: 31(ptr) AccessChain 27(sbuf_rw_nocounter) 24 28 + Store 32 30 + 38: 37(ptr) AccessChain 36(sbuf_rw_i@count) 24 + 40: 6(int) AtomicIAdd 38 39 17 39 + Store 33(c1) 40 + 43: 37(ptr) AccessChain 42(sbuf_rw_d@count) 24 + 45: 6(int) AtomicIAdd 43 39 17 44 + 47: 6(int) IAdd 45 46 + Store 41(c2) 47 + 48: 7(ptr) AccessChain 16(result) 17 + 49: 6(int) Load 48 + 50: 8(float) ConvertUToF 49 + 51: 7(ptr) AccessChain 16(result) 39 + 52: 6(int) Load 51 + 53: 8(float) ConvertUToF 52 + 54: 6(int) Load 33(c1) + 55: 8(float) ConvertUToF 54 + 56: 6(int) Load 41(c2) + 57: 8(float) ConvertUToF 56 + 58: 9(fvec4) CompositeConstruct 50 53 55 57 + ReturnValue 58 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.out new file mode 100644 index 00000000..5c8afd9d --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.out @@ -0,0 +1,324 @@ +hlsl.structbuffer.incdec.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main(u1; ( temp 4-component vector of float) +0:7 Function Parameters: +0:7 'pos' ( in uint) +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of uint) +0:8 'result' ( temp 4-component vector of uint) +0:8 Constant: +0:8 0 (const uint) +0:8 0 (const uint) +0:8 0 (const uint) +0:8 0 (const uint) +0:10 direct index (layout( row_major std430) buffer 4-component vector of uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint) +0:10 'sbuf_rw_i' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 Constant: +0:10 7 (const int) +0:11 direct index (layout( row_major std430) buffer 4-component vector of uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint) +0:11 'sbuf_rw_d' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 Constant: +0:11 7 (const int) +0:13 move second child to first child ( temp 4-component vector of uint) +0:13 direct index (layout( row_major std430) buffer 4-component vector of uint) +0:13 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint) +0:13 'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:13 Constant: +0:13 0 (const uint) +0:13 Constant: +0:13 5 (const int) +0:13 Constant: +0:13 2 (const uint) +0:13 2 (const uint) +0:13 2 (const uint) +0:13 2 (const uint) +0:15 Sequence +0:15 move second child to first child ( temp uint) +0:15 'c1' ( temp uint) +0:15 AtomicAdd ( temp uint) +0:15 @count: direct index for structure ( temp uint) +0:15 'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 1 (const uint) +0:16 Sequence +0:16 move second child to first child ( temp uint) +0:16 'c2' ( temp uint) +0:16 add ( temp uint) +0:16 AtomicAdd ( temp uint) +0:16 @count: direct index for structure ( temp uint) +0:16 'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 4294967295 (const uint) +0:16 Constant: +0:16 -1 (const int) +0:18 Branch: Return with expression +0:? Construct vec4 ( temp 4-component vector of float) +0:18 Convert uint to float ( temp float) +0:18 direct index ( temp uint) +0:18 'result' ( temp 4-component vector of uint) +0:18 Constant: +0:18 0 (const int) +0:18 Convert uint to float ( temp float) +0:18 direct index ( temp uint) +0:18 'result' ( temp 4-component vector of uint) +0:18 Constant: +0:18 1 (const int) +0:18 Convert uint to float ( temp float) +0:18 'c1' ( temp uint) +0:18 Convert uint to float ( temp float) +0:18 'c2' ( temp uint) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp uint) +0:? 'pos' ( temp uint) +0:? 'pos' (layout( location=0) flat in uint) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'pos' ( temp uint) +0:? Linker Objects +0:? 'sbuf_rw_i' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:? 'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_rw_d' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:? 'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' (layout( location=0) flat in uint) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main(u1; ( temp 4-component vector of float) +0:7 Function Parameters: +0:7 'pos' ( in uint) +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of uint) +0:8 'result' ( temp 4-component vector of uint) +0:8 Constant: +0:8 0 (const uint) +0:8 0 (const uint) +0:8 0 (const uint) +0:8 0 (const uint) +0:10 direct index (layout( row_major std430) buffer 4-component vector of uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint) +0:10 'sbuf_rw_i' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 Constant: +0:10 7 (const int) +0:11 direct index (layout( row_major std430) buffer 4-component vector of uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint) +0:11 'sbuf_rw_d' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 Constant: +0:11 7 (const int) +0:13 move second child to first child ( temp 4-component vector of uint) +0:13 direct index (layout( row_major std430) buffer 4-component vector of uint) +0:13 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint) +0:13 'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:13 Constant: +0:13 0 (const uint) +0:13 Constant: +0:13 5 (const int) +0:13 Constant: +0:13 2 (const uint) +0:13 2 (const uint) +0:13 2 (const uint) +0:13 2 (const uint) +0:15 Sequence +0:15 move second child to first child ( temp uint) +0:15 'c1' ( temp uint) +0:15 AtomicAdd ( temp uint) +0:15 @count: direct index for structure ( temp uint) +0:15 'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 1 (const uint) +0:16 Sequence +0:16 move second child to first child ( temp uint) +0:16 'c2' ( temp uint) +0:16 add ( temp uint) +0:16 AtomicAdd ( temp uint) +0:16 @count: direct index for structure ( temp uint) +0:16 'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 4294967295 (const uint) +0:16 Constant: +0:16 -1 (const int) +0:18 Branch: Return with expression +0:? Construct vec4 ( temp 4-component vector of float) +0:18 Convert uint to float ( temp float) +0:18 direct index ( temp uint) +0:18 'result' ( temp 4-component vector of uint) +0:18 Constant: +0:18 0 (const int) +0:18 Convert uint to float ( temp float) +0:18 direct index ( temp uint) +0:18 'result' ( temp 4-component vector of uint) +0:18 Constant: +0:18 1 (const int) +0:18 Convert uint to float ( temp float) +0:18 'c1' ( temp uint) +0:18 Convert uint to float ( temp float) +0:18 'c2' ( temp uint) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 move second child to first child ( temp uint) +0:? 'pos' ( temp uint) +0:? 'pos' (layout( location=0) flat in uint) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'pos' ( temp uint) +0:? Linker Objects +0:? 'sbuf_rw_i' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:? 'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_rw_d' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:? 'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer uint @count}) +0:? 'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of 4-component vector of uint @data}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' (layout( location=0) flat in uint) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 70 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 63 66 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 12 "@main(u1;" + Name 11 "pos" + Name 16 "result" + Name 20 "sbuf_rw_i" + MemberName 20(sbuf_rw_i) 0 "@data" + Name 22 "sbuf_rw_i" + Name 26 "sbuf_rw_d" + Name 27 "sbuf_rw_nocounter" + Name 33 "c1" + Name 34 "sbuf_rw_i@count" + MemberName 34(sbuf_rw_i@count) 0 "@count" + Name 36 "sbuf_rw_i@count" + Name 41 "c2" + Name 42 "sbuf_rw_d@count" + Name 61 "pos" + Name 63 "pos" + Name 66 "@entryPointOutput" + Name 67 "param" + Decorate 19 ArrayStride 16 + MemberDecorate 20(sbuf_rw_i) 0 Offset 0 + Decorate 20(sbuf_rw_i) BufferBlock + Decorate 22(sbuf_rw_i) DescriptorSet 0 + Decorate 26(sbuf_rw_d) DescriptorSet 0 + Decorate 27(sbuf_rw_nocounter) DescriptorSet 0 + MemberDecorate 34(sbuf_rw_i@count) 0 Offset 0 + Decorate 34(sbuf_rw_i@count) BufferBlock + Decorate 36(sbuf_rw_i@count) DescriptorSet 0 + Decorate 42(sbuf_rw_d@count) DescriptorSet 0 + Decorate 63(pos) Flat + Decorate 63(pos) Location 0 + Decorate 66(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeFunction 9(fvec4) 7(ptr) + 14: TypeVector 6(int) 4 + 15: TypePointer Function 14(ivec4) + 17: 6(int) Constant 0 + 18: 14(ivec4) ConstantComposite 17 17 17 17 + 19: TypeRuntimeArray 14(ivec4) + 20(sbuf_rw_i): TypeStruct 19 + 21: TypePointer Uniform 20(sbuf_rw_i) + 22(sbuf_rw_i): 21(ptr) Variable Uniform + 23: TypeInt 32 1 + 24: 23(int) Constant 0 + 25: 23(int) Constant 7 + 26(sbuf_rw_d): 21(ptr) Variable Uniform +27(sbuf_rw_nocounter): 21(ptr) Variable Uniform + 28: 23(int) Constant 5 + 29: 6(int) Constant 2 + 30: 14(ivec4) ConstantComposite 29 29 29 29 + 31: TypePointer Uniform 14(ivec4) +34(sbuf_rw_i@count): TypeStruct 6(int) + 35: TypePointer Uniform 34(sbuf_rw_i@count) +36(sbuf_rw_i@count): 35(ptr) Variable Uniform + 37: TypePointer Uniform 6(int) + 39: 6(int) Constant 1 +42(sbuf_rw_d@count): 35(ptr) Variable Uniform + 44: 6(int) Constant 4294967295 + 46: 23(int) Constant 4294967295 + 62: TypePointer Input 6(int) + 63(pos): 62(ptr) Variable Input + 65: TypePointer Output 9(fvec4) +66(@entryPointOutput): 65(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 61(pos): 7(ptr) Variable Function + 67(param): 7(ptr) Variable Function + 64: 6(int) Load 63(pos) + Store 61(pos) 64 + 68: 6(int) Load 61(pos) + Store 67(param) 68 + 69: 9(fvec4) FunctionCall 12(@main(u1;) 67(param) + Store 66(@entryPointOutput) 69 + Return + FunctionEnd + 12(@main(u1;): 9(fvec4) Function None 10 + 11(pos): 7(ptr) FunctionParameter + 13: Label + 16(result): 15(ptr) Variable Function + 33(c1): 7(ptr) Variable Function + 41(c2): 7(ptr) Variable Function + Store 16(result) 18 + 32: 31(ptr) AccessChain 27(sbuf_rw_nocounter) 24 28 + Store 32 30 + 38: 37(ptr) AccessChain 36(sbuf_rw_i@count) 24 + 40: 6(int) AtomicIAdd 38 39 17 39 + Store 33(c1) 40 + 43: 37(ptr) AccessChain 42(sbuf_rw_d@count) 24 + 45: 6(int) AtomicIAdd 43 39 17 44 + 47: 6(int) IAdd 45 46 + Store 41(c2) 47 + 48: 7(ptr) AccessChain 16(result) 17 + 49: 6(int) Load 48 + 50: 8(float) ConvertUToF 49 + 51: 7(ptr) AccessChain 16(result) 39 + 52: 6(int) Load 51 + 53: 8(float) ConvertUToF 52 + 54: 6(int) Load 33(c1) + 55: 8(float) ConvertUToF 54 + 56: 6(int) Load 41(c2) + 57: 8(float) ConvertUToF 56 + 58: 9(fvec4) CompositeConstruct 50 53 55 57 + ReturnValue 58 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.rw.frag.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.rw.frag.out new file mode 100644 index 00000000..7fbd1502 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.rw.frag.out @@ -0,0 +1,310 @@ +hlsl.structbuffer.rw.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: @main(u1; ( temp 4-component vector of float) +0:12 Function Parameters: +0:12 'pos' ( in uint) +0:? Sequence +0:13 move second child to first child ( temp float) +0:13 indirect index (layout( row_major std430) buffer float) +0:13 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:13 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:13 Constant: +0:13 0 (const uint) +0:13 add ( temp uint) +0:13 'pos' ( in uint) +0:13 Constant: +0:13 1 (const uint) +0:13 Constant: +0:13 42.000000 +0:17 Sequence +0:17 move second child to first child ( temp uint) +0:17 'size' ( temp uint) +0:17 array length ( temp uint) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:17 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 move second child to first child ( temp uint) +0:17 'stride' ( temp uint) +0:17 Constant: +0:17 16 (const uint) +0:19 Test condition and select ( temp void) +0:19 Condition +0:19 test: direct index for structure ( temp bool) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:19 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 'pos' ( in uint) +0:19 Constant: +0:19 1 (const int) +0:19 true case +0:20 Branch: Return with expression +0:? Construct vec4 ( temp 4-component vector of float) +0:20 add ( temp 3-component vector of float) +0:20 color: direct index for structure ( temp 3-component vector of float) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:20 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' ( in uint) +0:20 Constant: +0:20 0 (const int) +0:20 indirect index (layout( row_major std430) buffer float) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:20 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' ( in uint) +0:20 Constant: +0:20 0.000000 +0:19 false case +0:22 Branch: Return with expression +0:22 Construct vec4 ( temp 4-component vector of float) +0:22 Convert uint to float ( temp float) +0:22 add ( temp uint) +0:22 'size' ( temp uint) +0:22 'stride' ( temp uint) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp uint) +0:? 'pos' ( temp uint) +0:? 'pos' (layout( location=0) flat in uint) +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:12 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'pos' ( temp uint) +0:? Linker Objects +0:? 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:? 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' (layout( location=0) flat in uint) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: @main(u1; ( temp 4-component vector of float) +0:12 Function Parameters: +0:12 'pos' ( in uint) +0:? Sequence +0:13 move second child to first child ( temp float) +0:13 indirect index (layout( row_major std430) buffer float) +0:13 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:13 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:13 Constant: +0:13 0 (const uint) +0:13 add ( temp uint) +0:13 'pos' ( in uint) +0:13 Constant: +0:13 1 (const uint) +0:13 Constant: +0:13 42.000000 +0:17 Sequence +0:17 move second child to first child ( temp uint) +0:17 'size' ( temp uint) +0:17 array length ( temp uint) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:17 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 move second child to first child ( temp uint) +0:17 'stride' ( temp uint) +0:17 Constant: +0:17 16 (const uint) +0:19 Test condition and select ( temp void) +0:19 Condition +0:19 test: direct index for structure ( temp bool) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:19 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 'pos' ( in uint) +0:19 Constant: +0:19 1 (const int) +0:19 true case +0:20 Branch: Return with expression +0:? Construct vec4 ( temp 4-component vector of float) +0:20 add ( temp 3-component vector of float) +0:20 color: direct index for structure ( temp 3-component vector of float) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 3-component vector of float color, temp bool test}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test}) +0:20 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' ( in uint) +0:20 Constant: +0:20 0 (const int) +0:20 indirect index (layout( row_major std430) buffer float) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of float) +0:20 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' ( in uint) +0:20 Constant: +0:20 0.000000 +0:19 false case +0:22 Branch: Return with expression +0:22 Construct vec4 ( temp 4-component vector of float) +0:22 Convert uint to float ( temp float) +0:22 add ( temp uint) +0:22 'size' ( temp uint) +0:22 'stride' ( temp uint) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp uint) +0:? 'pos' ( temp uint) +0:? 'pos' (layout( location=0) flat in uint) +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:12 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'pos' ( temp uint) +0:? Linker Objects +0:? 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 3-component vector of float color, temp bool test} @data}) +0:? 'sbuf2' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of float @data}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' (layout( location=0) flat in uint) + +error: SPIRV-Tools Validation Errors +error: OpStore Pointer '26[size]'s type does not match Object '33's type. + OpStore %size %33 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 78 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 71 74 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 12 "@main(u1;" + Name 11 "pos" + Name 15 "sbuf2" + MemberName 15(sbuf2) 0 "@data" + Name 17 "sbuf2" + Name 26 "size" + Name 28 "sb_t" + MemberName 28(sb_t) 0 "color" + MemberName 28(sb_t) 1 "test" + Name 30 "sbuf" + MemberName 30(sbuf) 0 "@data" + Name 32 "sbuf" + Name 34 "stride" + Name 69 "pos" + Name 71 "pos" + Name 74 "@entryPointOutput" + Name 75 "param" + Decorate 14 ArrayStride 4 + MemberDecorate 15(sbuf2) 0 Offset 0 + Decorate 15(sbuf2) BufferBlock + Decorate 17(sbuf2) DescriptorSet 0 + MemberDecorate 28(sb_t) 0 Offset 0 + MemberDecorate 28(sb_t) 1 Offset 12 + Decorate 29 ArrayStride 16 + MemberDecorate 30(sbuf) 0 Offset 0 + Decorate 30(sbuf) BufferBlock + Decorate 32(sbuf) DescriptorSet 0 + Decorate 71(pos) Flat + Decorate 71(pos) Location 0 + Decorate 74(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeFunction 9(fvec4) 7(ptr) + 14: TypeRuntimeArray 8(float) + 15(sbuf2): TypeStruct 14 + 16: TypePointer Uniform 15(sbuf2) + 17(sbuf2): 16(ptr) Variable Uniform + 18: TypeInt 32 1 + 19: 18(int) Constant 0 + 21: 6(int) Constant 1 + 23: 8(float) Constant 1109917696 + 24: TypePointer Uniform 8(float) + 27: TypeVector 8(float) 3 + 28(sb_t): TypeStruct 27(fvec3) 6(int) + 29: TypeRuntimeArray 28(sb_t) + 30(sbuf): TypeStruct 29 + 31: TypePointer Uniform 30(sbuf) + 32(sbuf): 31(ptr) Variable Uniform + 35: 6(int) Constant 16 + 37: 18(int) Constant 1 + 38: TypePointer Uniform 6(int) + 41: TypeBool + 42: 6(int) Constant 0 + 47: TypePointer Uniform 27(fvec3) + 55: 8(float) Constant 0 + 70: TypePointer Input 6(int) + 71(pos): 70(ptr) Variable Input + 73: TypePointer Output 9(fvec4) +74(@entryPointOutput): 73(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 69(pos): 7(ptr) Variable Function + 75(param): 7(ptr) Variable Function + 72: 6(int) Load 71(pos) + Store 69(pos) 72 + 76: 6(int) Load 69(pos) + Store 75(param) 76 + 77: 9(fvec4) FunctionCall 12(@main(u1;) 75(param) + Store 74(@entryPointOutput) 77 + Return + FunctionEnd + 12(@main(u1;): 9(fvec4) Function None 10 + 11(pos): 7(ptr) FunctionParameter + 13: Label + 26(size): 7(ptr) Variable Function + 34(stride): 7(ptr) Variable Function + 20: 6(int) Load 11(pos) + 22: 6(int) IAdd 20 21 + 25: 24(ptr) AccessChain 17(sbuf2) 19 22 + Store 25 23 + 33: 18(int) ArrayLength 32(sbuf) 0 + Store 26(size) 33 + Store 34(stride) 35 + 36: 6(int) Load 11(pos) + 39: 38(ptr) AccessChain 32(sbuf) 19 36 37 + 40: 6(int) Load 39 + 43: 41(bool) INotEqual 40 42 + SelectionMerge 45 None + BranchConditional 43 44 61 + 44: Label + 46: 6(int) Load 11(pos) + 48: 47(ptr) AccessChain 32(sbuf) 19 46 19 + 49: 27(fvec3) Load 48 + 50: 6(int) Load 11(pos) + 51: 24(ptr) AccessChain 17(sbuf2) 19 50 + 52: 8(float) Load 51 + 53: 27(fvec3) CompositeConstruct 52 52 52 + 54: 27(fvec3) FAdd 49 53 + 56: 8(float) CompositeExtract 54 0 + 57: 8(float) CompositeExtract 54 1 + 58: 8(float) CompositeExtract 54 2 + 59: 9(fvec4) CompositeConstruct 56 57 58 55 + ReturnValue 59 + 61: Label + 62: 6(int) Load 26(size) + 63: 6(int) Load 34(stride) + 64: 6(int) IAdd 62 63 + 65: 8(float) ConvertUToF 64 + 66: 9(fvec4) CompositeConstruct 65 65 65 65 + ReturnValue 66 + 45: Label + 68: 9(fvec4) Undef + ReturnValue 68 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out new file mode 100644 index 00000000..ed27c893 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out @@ -0,0 +1,1310 @@ +hlsl.structbuffer.rwbyte.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main(u1; ( temp 4-component vector of float) +0:5 Function Parameters: +0:5 'pos' ( in uint) +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp uint) +0:7 'size' ( temp uint) +0:7 array length ( temp uint) +0:7 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:7 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:7 Constant: +0:7 0 (const uint) +0:? Sequence +0:9 move second child to first child ( temp int) +0:9 'byteAddrTemp' ( temp int) +0:9 right-shift ( temp int) +0:9 'pos' ( in uint) +0:9 Constant: +0:9 2 (const int) +0:9 move second child to first child ( temp uint) +0:9 indirect index (layout( row_major std430) buffer uint) +0:9 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:9 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:9 Constant: +0:9 0 (const uint) +0:9 'byteAddrTemp' ( temp int) +0:9 indirect index (layout( row_major std430) buffer uint) +0:9 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:9 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:9 Constant: +0:9 0 (const uint) +0:9 right-shift ( temp int) +0:9 'pos' ( in uint) +0:9 Constant: +0:9 2 (const int) +0:? Sequence +0:10 move second child to first child ( temp int) +0:10 'byteAddrTemp' ( temp int) +0:10 right-shift ( temp int) +0:10 'pos' ( in uint) +0:10 Constant: +0:10 2 (const int) +0:10 move second child to first child ( temp uint) +0:10 indirect index (layout( row_major std430) buffer uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 'byteAddrTemp' ( temp int) +0:10 direct index ( temp uint) +0:? Sequence +0:10 move second child to first child ( temp int) +0:10 'byteAddrTemp' ( temp int) +0:10 right-shift ( temp int) +0:10 'pos' ( in uint) +0:10 Constant: +0:10 2 (const int) +0:? Construct vec2 ( temp 2-component vector of uint) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 'byteAddrTemp' ( temp int) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 add ( temp int) +0:10 'byteAddrTemp' ( temp int) +0:10 Constant: +0:10 1 (const int) +0:10 Constant: +0:10 0 (const int) +0:10 move second child to first child ( temp uint) +0:10 indirect index (layout( row_major std430) buffer uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 add ( temp int) +0:10 'byteAddrTemp' ( temp int) +0:10 Constant: +0:10 1 (const int) +0:10 direct index ( temp uint) +0:? Sequence +0:10 move second child to first child ( temp int) +0:10 'byteAddrTemp' ( temp int) +0:10 right-shift ( temp int) +0:10 'pos' ( in uint) +0:10 Constant: +0:10 2 (const int) +0:? Construct vec2 ( temp 2-component vector of uint) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 'byteAddrTemp' ( temp int) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 add ( temp int) +0:10 'byteAddrTemp' ( temp int) +0:10 Constant: +0:10 1 (const int) +0:10 Constant: +0:10 1 (const int) +0:? Sequence +0:11 move second child to first child ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 right-shift ( temp int) +0:11 'pos' ( in uint) +0:11 Constant: +0:11 2 (const int) +0:11 move second child to first child ( temp uint) +0:11 indirect index (layout( row_major std430) buffer uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 'byteAddrTemp' ( temp int) +0:11 direct index ( temp uint) +0:? Sequence +0:11 move second child to first child ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 right-shift ( temp int) +0:11 'pos' ( in uint) +0:11 Constant: +0:11 2 (const int) +0:? Construct vec3 ( temp 3-component vector of uint) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 'byteAddrTemp' ( temp int) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 add ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 Constant: +0:11 1 (const int) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 add ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp uint) +0:11 indirect index (layout( row_major std430) buffer uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 add ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( temp uint) +0:? Sequence +0:11 move second child to first child ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 right-shift ( temp int) +0:11 'pos' ( in uint) +0:11 Constant: +0:11 2 (const int) +0:? Construct vec3 ( temp 3-component vector of uint) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 'byteAddrTemp' ( temp int) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 add ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 Constant: +0:11 1 (const int) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 add ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp uint) +0:11 indirect index (layout( row_major std430) buffer uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 add ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 Constant: +0:11 2 (const int) +0:11 direct index ( temp uint) +0:? Sequence +0:11 move second child to first child ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 right-shift ( temp int) +0:11 'pos' ( in uint) +0:11 Constant: +0:11 2 (const int) +0:? Construct vec3 ( temp 3-component vector of uint) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 'byteAddrTemp' ( temp int) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 add ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 Constant: +0:11 1 (const int) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 add ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 2 (const int) +0:? Sequence +0:12 move second child to first child ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 right-shift ( temp int) +0:12 'pos' ( in uint) +0:12 Constant: +0:12 2 (const int) +0:12 move second child to first child ( temp uint) +0:12 indirect index (layout( row_major std430) buffer uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' ( temp int) +0:12 direct index ( temp uint) +0:? Sequence +0:12 move second child to first child ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 right-shift ( temp int) +0:12 'pos' ( in uint) +0:12 Constant: +0:12 2 (const int) +0:? Construct vec4 ( temp 4-component vector of uint) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' ( temp int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 1 (const int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 2 (const int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 3 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 move second child to first child ( temp uint) +0:12 indirect index (layout( row_major std430) buffer uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 1 (const int) +0:12 direct index ( temp uint) +0:? Sequence +0:12 move second child to first child ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 right-shift ( temp int) +0:12 'pos' ( in uint) +0:12 Constant: +0:12 2 (const int) +0:? Construct vec4 ( temp 4-component vector of uint) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' ( temp int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 1 (const int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 2 (const int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 3 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 move second child to first child ( temp uint) +0:12 indirect index (layout( row_major std430) buffer uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 2 (const int) +0:12 direct index ( temp uint) +0:? Sequence +0:12 move second child to first child ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 right-shift ( temp int) +0:12 'pos' ( in uint) +0:12 Constant: +0:12 2 (const int) +0:? Construct vec4 ( temp 4-component vector of uint) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' ( temp int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 1 (const int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 2 (const int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 3 (const int) +0:12 Constant: +0:12 2 (const int) +0:12 move second child to first child ( temp uint) +0:12 indirect index (layout( row_major std430) buffer uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 3 (const int) +0:12 direct index ( temp uint) +0:? Sequence +0:12 move second child to first child ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 right-shift ( temp int) +0:12 'pos' ( in uint) +0:12 Constant: +0:12 2 (const int) +0:? Construct vec4 ( temp 4-component vector of uint) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' ( temp int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 1 (const int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 2 (const int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 3 (const int) +0:12 Constant: +0:12 3 (const int) +0:14 Branch: Return with expression +0:14 Construct vec4 ( temp 4-component vector of float) +0:14 Convert uint to float ( temp float) +0:14 indirect index (layout( row_major std430) buffer uint) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:14 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 right-shift ( temp int) +0:14 'pos' ( in uint) +0:14 Constant: +0:14 2 (const int) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp uint) +0:? 'pos' ( temp uint) +0:? 'pos' (layout( location=0) flat in uint) +0:5 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:5 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'pos' ( temp uint) +0:? Linker Objects +0:? 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' (layout( location=0) flat in uint) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main(u1; ( temp 4-component vector of float) +0:5 Function Parameters: +0:5 'pos' ( in uint) +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp uint) +0:7 'size' ( temp uint) +0:7 array length ( temp uint) +0:7 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:7 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:7 Constant: +0:7 0 (const uint) +0:? Sequence +0:9 move second child to first child ( temp int) +0:9 'byteAddrTemp' ( temp int) +0:9 right-shift ( temp int) +0:9 'pos' ( in uint) +0:9 Constant: +0:9 2 (const int) +0:9 move second child to first child ( temp uint) +0:9 indirect index (layout( row_major std430) buffer uint) +0:9 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:9 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:9 Constant: +0:9 0 (const uint) +0:9 'byteAddrTemp' ( temp int) +0:9 indirect index (layout( row_major std430) buffer uint) +0:9 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:9 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:9 Constant: +0:9 0 (const uint) +0:9 right-shift ( temp int) +0:9 'pos' ( in uint) +0:9 Constant: +0:9 2 (const int) +0:? Sequence +0:10 move second child to first child ( temp int) +0:10 'byteAddrTemp' ( temp int) +0:10 right-shift ( temp int) +0:10 'pos' ( in uint) +0:10 Constant: +0:10 2 (const int) +0:10 move second child to first child ( temp uint) +0:10 indirect index (layout( row_major std430) buffer uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 'byteAddrTemp' ( temp int) +0:10 direct index ( temp uint) +0:? Sequence +0:10 move second child to first child ( temp int) +0:10 'byteAddrTemp' ( temp int) +0:10 right-shift ( temp int) +0:10 'pos' ( in uint) +0:10 Constant: +0:10 2 (const int) +0:? Construct vec2 ( temp 2-component vector of uint) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 'byteAddrTemp' ( temp int) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 add ( temp int) +0:10 'byteAddrTemp' ( temp int) +0:10 Constant: +0:10 1 (const int) +0:10 Constant: +0:10 0 (const int) +0:10 move second child to first child ( temp uint) +0:10 indirect index (layout( row_major std430) buffer uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 add ( temp int) +0:10 'byteAddrTemp' ( temp int) +0:10 Constant: +0:10 1 (const int) +0:10 direct index ( temp uint) +0:? Sequence +0:10 move second child to first child ( temp int) +0:10 'byteAddrTemp' ( temp int) +0:10 right-shift ( temp int) +0:10 'pos' ( in uint) +0:10 Constant: +0:10 2 (const int) +0:? Construct vec2 ( temp 2-component vector of uint) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 'byteAddrTemp' ( temp int) +0:10 indirect index ( temp uint) +0:10 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:10 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:10 Constant: +0:10 0 (const uint) +0:10 add ( temp int) +0:10 'byteAddrTemp' ( temp int) +0:10 Constant: +0:10 1 (const int) +0:10 Constant: +0:10 1 (const int) +0:? Sequence +0:11 move second child to first child ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 right-shift ( temp int) +0:11 'pos' ( in uint) +0:11 Constant: +0:11 2 (const int) +0:11 move second child to first child ( temp uint) +0:11 indirect index (layout( row_major std430) buffer uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 'byteAddrTemp' ( temp int) +0:11 direct index ( temp uint) +0:? Sequence +0:11 move second child to first child ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 right-shift ( temp int) +0:11 'pos' ( in uint) +0:11 Constant: +0:11 2 (const int) +0:? Construct vec3 ( temp 3-component vector of uint) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 'byteAddrTemp' ( temp int) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 add ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 Constant: +0:11 1 (const int) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 add ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp uint) +0:11 indirect index (layout( row_major std430) buffer uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 add ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( temp uint) +0:? Sequence +0:11 move second child to first child ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 right-shift ( temp int) +0:11 'pos' ( in uint) +0:11 Constant: +0:11 2 (const int) +0:? Construct vec3 ( temp 3-component vector of uint) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 'byteAddrTemp' ( temp int) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 add ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 Constant: +0:11 1 (const int) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 add ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp uint) +0:11 indirect index (layout( row_major std430) buffer uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 add ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 Constant: +0:11 2 (const int) +0:11 direct index ( temp uint) +0:? Sequence +0:11 move second child to first child ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 right-shift ( temp int) +0:11 'pos' ( in uint) +0:11 Constant: +0:11 2 (const int) +0:? Construct vec3 ( temp 3-component vector of uint) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 'byteAddrTemp' ( temp int) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 add ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 Constant: +0:11 1 (const int) +0:11 indirect index ( temp uint) +0:11 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:11 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:11 Constant: +0:11 0 (const uint) +0:11 add ( temp int) +0:11 'byteAddrTemp' ( temp int) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 2 (const int) +0:? Sequence +0:12 move second child to first child ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 right-shift ( temp int) +0:12 'pos' ( in uint) +0:12 Constant: +0:12 2 (const int) +0:12 move second child to first child ( temp uint) +0:12 indirect index (layout( row_major std430) buffer uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' ( temp int) +0:12 direct index ( temp uint) +0:? Sequence +0:12 move second child to first child ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 right-shift ( temp int) +0:12 'pos' ( in uint) +0:12 Constant: +0:12 2 (const int) +0:? Construct vec4 ( temp 4-component vector of uint) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' ( temp int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 1 (const int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 2 (const int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 3 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 move second child to first child ( temp uint) +0:12 indirect index (layout( row_major std430) buffer uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 1 (const int) +0:12 direct index ( temp uint) +0:? Sequence +0:12 move second child to first child ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 right-shift ( temp int) +0:12 'pos' ( in uint) +0:12 Constant: +0:12 2 (const int) +0:? Construct vec4 ( temp 4-component vector of uint) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' ( temp int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 1 (const int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 2 (const int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 3 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 move second child to first child ( temp uint) +0:12 indirect index (layout( row_major std430) buffer uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 2 (const int) +0:12 direct index ( temp uint) +0:? Sequence +0:12 move second child to first child ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 right-shift ( temp int) +0:12 'pos' ( in uint) +0:12 Constant: +0:12 2 (const int) +0:? Construct vec4 ( temp 4-component vector of uint) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' ( temp int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 1 (const int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 2 (const int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 3 (const int) +0:12 Constant: +0:12 2 (const int) +0:12 move second child to first child ( temp uint) +0:12 indirect index (layout( row_major std430) buffer uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 3 (const int) +0:12 direct index ( temp uint) +0:? Sequence +0:12 move second child to first child ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 right-shift ( temp int) +0:12 'pos' ( in uint) +0:12 Constant: +0:12 2 (const int) +0:? Construct vec4 ( temp 4-component vector of uint) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' ( temp int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 1 (const int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 2 (const int) +0:12 indirect index ( temp uint) +0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:12 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:12 Constant: +0:12 0 (const uint) +0:12 add ( temp int) +0:12 'byteAddrTemp' ( temp int) +0:12 Constant: +0:12 3 (const int) +0:12 Constant: +0:12 3 (const int) +0:14 Branch: Return with expression +0:14 Construct vec4 ( temp 4-component vector of float) +0:14 Convert uint to float ( temp float) +0:14 indirect index (layout( row_major std430) buffer uint) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:14 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 right-shift ( temp int) +0:14 'pos' ( in uint) +0:14 Constant: +0:14 2 (const int) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp uint) +0:? 'pos' ( temp uint) +0:? 'pos' (layout( location=0) flat in uint) +0:5 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:5 Function Call: @main(u1; ( temp 4-component vector of float) +0:? 'pos' ( temp uint) +0:? Linker Objects +0:? 'sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' (layout( location=0) flat in uint) + +error: SPIRV-Tools Validation Errors +error: OpStore Pointer '14[size]'s type does not match Object '20's type. + OpStore %size %20 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 239 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 232 235 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 12 "@main(u1;" + Name 11 "pos" + Name 14 "size" + Name 16 "sbuf" + MemberName 16(sbuf) 0 "@data" + Name 18 "sbuf" + Name 22 "byteAddrTemp" + Name 34 "byteAddrTemp" + Name 38 "byteAddrTemp" + Name 69 "byteAddrTemp" + Name 73 "byteAddrTemp" + Name 128 "byteAddrTemp" + Name 132 "byteAddrTemp" + Name 230 "pos" + Name 232 "pos" + Name 235 "@entryPointOutput" + Name 236 "param" + Decorate 15 ArrayStride 4 + MemberDecorate 16(sbuf) 0 Offset 0 + Decorate 16(sbuf) BufferBlock + Decorate 18(sbuf) DescriptorSet 0 + Decorate 232(pos) Flat + Decorate 232(pos) Location 0 + Decorate 235(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeFunction 9(fvec4) 7(ptr) + 15: TypeRuntimeArray 6(int) + 16(sbuf): TypeStruct 15 + 17: TypePointer Uniform 16(sbuf) + 18(sbuf): 17(ptr) Variable Uniform + 19: TypeInt 32 1 + 21: TypePointer Function 19(int) + 24: 19(int) Constant 2 + 26: 19(int) Constant 0 + 30: TypePointer Uniform 6(int) + 45: 19(int) Constant 1 + 49: TypeVector 6(int) 2 + 51: 6(int) Constant 0 + 66: 6(int) Constant 1 + 87: TypeVector 6(int) 3 + 125: 6(int) Constant 2 + 147: 19(int) Constant 3 + 151: TypeVector 6(int) 4 + 219: 6(int) Constant 3 + 231: TypePointer Input 6(int) + 232(pos): 231(ptr) Variable Input + 234: TypePointer Output 9(fvec4) +235(@entryPointOutput): 234(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 230(pos): 7(ptr) Variable Function + 236(param): 7(ptr) Variable Function + 233: 6(int) Load 232(pos) + Store 230(pos) 233 + 237: 6(int) Load 230(pos) + Store 236(param) 237 + 238: 9(fvec4) FunctionCall 12(@main(u1;) 236(param) + Store 235(@entryPointOutput) 238 + Return + FunctionEnd + 12(@main(u1;): 9(fvec4) Function None 10 + 11(pos): 7(ptr) FunctionParameter + 13: Label + 14(size): 7(ptr) Variable Function +22(byteAddrTemp): 21(ptr) Variable Function +34(byteAddrTemp): 21(ptr) Variable Function +38(byteAddrTemp): 21(ptr) Variable Function +69(byteAddrTemp): 21(ptr) Variable Function +73(byteAddrTemp): 21(ptr) Variable Function +128(byteAddrTemp): 21(ptr) Variable Function +132(byteAddrTemp): 21(ptr) Variable Function + 20: 19(int) ArrayLength 18(sbuf) 0 + Store 14(size) 20 + 23: 6(int) Load 11(pos) + 25: 19(int) ShiftRightLogical 23 24 + Store 22(byteAddrTemp) 25 + 27: 19(int) Load 22(byteAddrTemp) + 28: 6(int) Load 11(pos) + 29: 19(int) ShiftRightLogical 28 24 + 31: 30(ptr) AccessChain 18(sbuf) 26 29 + 32: 6(int) Load 31 + 33: 30(ptr) AccessChain 18(sbuf) 26 27 + Store 33 32 + 35: 6(int) Load 11(pos) + 36: 19(int) ShiftRightLogical 35 24 + Store 34(byteAddrTemp) 36 + 37: 19(int) Load 34(byteAddrTemp) + 39: 6(int) Load 11(pos) + 40: 19(int) ShiftRightLogical 39 24 + Store 38(byteAddrTemp) 40 + 41: 19(int) Load 38(byteAddrTemp) + 42: 30(ptr) AccessChain 18(sbuf) 26 41 + 43: 6(int) Load 42 + 44: 19(int) Load 38(byteAddrTemp) + 46: 19(int) IAdd 44 45 + 47: 30(ptr) AccessChain 18(sbuf) 26 46 + 48: 6(int) Load 47 + 50: 49(ivec2) CompositeConstruct 43 48 + 52: 6(int) CompositeExtract 50 0 + 53: 30(ptr) AccessChain 18(sbuf) 26 37 + Store 53 52 + 54: 19(int) Load 34(byteAddrTemp) + 55: 19(int) IAdd 54 45 + 56: 6(int) Load 11(pos) + 57: 19(int) ShiftRightLogical 56 24 + Store 38(byteAddrTemp) 57 + 58: 19(int) Load 38(byteAddrTemp) + 59: 30(ptr) AccessChain 18(sbuf) 26 58 + 60: 6(int) Load 59 + 61: 19(int) Load 38(byteAddrTemp) + 62: 19(int) IAdd 61 45 + 63: 30(ptr) AccessChain 18(sbuf) 26 62 + 64: 6(int) Load 63 + 65: 49(ivec2) CompositeConstruct 60 64 + 67: 6(int) CompositeExtract 65 1 + 68: 30(ptr) AccessChain 18(sbuf) 26 55 + Store 68 67 + 70: 6(int) Load 11(pos) + 71: 19(int) ShiftRightLogical 70 24 + Store 69(byteAddrTemp) 71 + 72: 19(int) Load 69(byteAddrTemp) + 74: 6(int) Load 11(pos) + 75: 19(int) ShiftRightLogical 74 24 + Store 73(byteAddrTemp) 75 + 76: 19(int) Load 73(byteAddrTemp) + 77: 30(ptr) AccessChain 18(sbuf) 26 76 + 78: 6(int) Load 77 + 79: 19(int) Load 73(byteAddrTemp) + 80: 19(int) IAdd 79 45 + 81: 30(ptr) AccessChain 18(sbuf) 26 80 + 82: 6(int) Load 81 + 83: 19(int) Load 73(byteAddrTemp) + 84: 19(int) IAdd 83 24 + 85: 30(ptr) AccessChain 18(sbuf) 26 84 + 86: 6(int) Load 85 + 88: 87(ivec3) CompositeConstruct 78 82 86 + 89: 6(int) CompositeExtract 88 0 + 90: 30(ptr) AccessChain 18(sbuf) 26 72 + Store 90 89 + 91: 19(int) Load 69(byteAddrTemp) + 92: 19(int) IAdd 91 45 + 93: 6(int) Load 11(pos) + 94: 19(int) ShiftRightLogical 93 24 + Store 73(byteAddrTemp) 94 + 95: 19(int) Load 73(byteAddrTemp) + 96: 30(ptr) AccessChain 18(sbuf) 26 95 + 97: 6(int) Load 96 + 98: 19(int) Load 73(byteAddrTemp) + 99: 19(int) IAdd 98 45 + 100: 30(ptr) AccessChain 18(sbuf) 26 99 + 101: 6(int) Load 100 + 102: 19(int) Load 73(byteAddrTemp) + 103: 19(int) IAdd 102 24 + 104: 30(ptr) AccessChain 18(sbuf) 26 103 + 105: 6(int) Load 104 + 106: 87(ivec3) CompositeConstruct 97 101 105 + 107: 6(int) CompositeExtract 106 1 + 108: 30(ptr) AccessChain 18(sbuf) 26 92 + Store 108 107 + 109: 19(int) Load 69(byteAddrTemp) + 110: 19(int) IAdd 109 24 + 111: 6(int) Load 11(pos) + 112: 19(int) ShiftRightLogical 111 24 + Store 73(byteAddrTemp) 112 + 113: 19(int) Load 73(byteAddrTemp) + 114: 30(ptr) AccessChain 18(sbuf) 26 113 + 115: 6(int) Load 114 + 116: 19(int) Load 73(byteAddrTemp) + 117: 19(int) IAdd 116 45 + 118: 30(ptr) AccessChain 18(sbuf) 26 117 + 119: 6(int) Load 118 + 120: 19(int) Load 73(byteAddrTemp) + 121: 19(int) IAdd 120 24 + 122: 30(ptr) AccessChain 18(sbuf) 26 121 + 123: 6(int) Load 122 + 124: 87(ivec3) CompositeConstruct 115 119 123 + 126: 6(int) CompositeExtract 124 2 + 127: 30(ptr) AccessChain 18(sbuf) 26 110 + Store 127 126 + 129: 6(int) Load 11(pos) + 130: 19(int) ShiftRightLogical 129 24 + Store 128(byteAddrTemp) 130 + 131: 19(int) Load 128(byteAddrTemp) + 133: 6(int) Load 11(pos) + 134: 19(int) ShiftRightLogical 133 24 + Store 132(byteAddrTemp) 134 + 135: 19(int) Load 132(byteAddrTemp) + 136: 30(ptr) AccessChain 18(sbuf) 26 135 + 137: 6(int) Load 136 + 138: 19(int) Load 132(byteAddrTemp) + 139: 19(int) IAdd 138 45 + 140: 30(ptr) AccessChain 18(sbuf) 26 139 + 141: 6(int) Load 140 + 142: 19(int) Load 132(byteAddrTemp) + 143: 19(int) IAdd 142 24 + 144: 30(ptr) AccessChain 18(sbuf) 26 143 + 145: 6(int) Load 144 + 146: 19(int) Load 132(byteAddrTemp) + 148: 19(int) IAdd 146 147 + 149: 30(ptr) AccessChain 18(sbuf) 26 148 + 150: 6(int) Load 149 + 152: 151(ivec4) CompositeConstruct 137 141 145 150 + 153: 6(int) CompositeExtract 152 0 + 154: 30(ptr) AccessChain 18(sbuf) 26 131 + Store 154 153 + 155: 19(int) Load 128(byteAddrTemp) + 156: 19(int) IAdd 155 45 + 157: 6(int) Load 11(pos) + 158: 19(int) ShiftRightLogical 157 24 + Store 132(byteAddrTemp) 158 + 159: 19(int) Load 132(byteAddrTemp) + 160: 30(ptr) AccessChain 18(sbuf) 26 159 + 161: 6(int) Load 160 + 162: 19(int) Load 132(byteAddrTemp) + 163: 19(int) IAdd 162 45 + 164: 30(ptr) AccessChain 18(sbuf) 26 163 + 165: 6(int) Load 164 + 166: 19(int) Load 132(byteAddrTemp) + 167: 19(int) IAdd 166 24 + 168: 30(ptr) AccessChain 18(sbuf) 26 167 + 169: 6(int) Load 168 + 170: 19(int) Load 132(byteAddrTemp) + 171: 19(int) IAdd 170 147 + 172: 30(ptr) AccessChain 18(sbuf) 26 171 + 173: 6(int) Load 172 + 174: 151(ivec4) CompositeConstruct 161 165 169 173 + 175: 6(int) CompositeExtract 174 1 + 176: 30(ptr) AccessChain 18(sbuf) 26 156 + Store 176 175 + 177: 19(int) Load 128(byteAddrTemp) + 178: 19(int) IAdd 177 24 + 179: 6(int) Load 11(pos) + 180: 19(int) ShiftRightLogical 179 24 + Store 132(byteAddrTemp) 180 + 181: 19(int) Load 132(byteAddrTemp) + 182: 30(ptr) AccessChain 18(sbuf) 26 181 + 183: 6(int) Load 182 + 184: 19(int) Load 132(byteAddrTemp) + 185: 19(int) IAdd 184 45 + 186: 30(ptr) AccessChain 18(sbuf) 26 185 + 187: 6(int) Load 186 + 188: 19(int) Load 132(byteAddrTemp) + 189: 19(int) IAdd 188 24 + 190: 30(ptr) AccessChain 18(sbuf) 26 189 + 191: 6(int) Load 190 + 192: 19(int) Load 132(byteAddrTemp) + 193: 19(int) IAdd 192 147 + 194: 30(ptr) AccessChain 18(sbuf) 26 193 + 195: 6(int) Load 194 + 196: 151(ivec4) CompositeConstruct 183 187 191 195 + 197: 6(int) CompositeExtract 196 2 + 198: 30(ptr) AccessChain 18(sbuf) 26 178 + Store 198 197 + 199: 19(int) Load 128(byteAddrTemp) + 200: 19(int) IAdd 199 147 + 201: 6(int) Load 11(pos) + 202: 19(int) ShiftRightLogical 201 24 + Store 132(byteAddrTemp) 202 + 203: 19(int) Load 132(byteAddrTemp) + 204: 30(ptr) AccessChain 18(sbuf) 26 203 + 205: 6(int) Load 204 + 206: 19(int) Load 132(byteAddrTemp) + 207: 19(int) IAdd 206 45 + 208: 30(ptr) AccessChain 18(sbuf) 26 207 + 209: 6(int) Load 208 + 210: 19(int) Load 132(byteAddrTemp) + 211: 19(int) IAdd 210 24 + 212: 30(ptr) AccessChain 18(sbuf) 26 211 + 213: 6(int) Load 212 + 214: 19(int) Load 132(byteAddrTemp) + 215: 19(int) IAdd 214 147 + 216: 30(ptr) AccessChain 18(sbuf) 26 215 + 217: 6(int) Load 216 + 218: 151(ivec4) CompositeConstruct 205 209 213 217 + 220: 6(int) CompositeExtract 218 3 + 221: 30(ptr) AccessChain 18(sbuf) 26 200 + Store 221 220 + 222: 6(int) Load 11(pos) + 223: 19(int) ShiftRightLogical 222 24 + 224: 30(ptr) AccessChain 18(sbuf) 26 223 + 225: 6(int) Load 224 + 226: 8(float) ConvertUToF 225 + 227: 9(fvec4) CompositeConstruct 226 226 226 226 + ReturnValue 227 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.structin.vert.out b/deps/glslang/Test/baseResults/hlsl.structin.vert.out new file mode 100644 index 00000000..d7f539d0 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.structin.vert.out @@ -0,0 +1,499 @@ +hlsl.structin.vert +Shader version: 500 +0:? Sequence +0:8 Function Definition: @main(vf4;struct-VI-vf4[2]-vf4-vf41;vf4; ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Function Parameters: +0:8 'd' ( in 4-component vector of float) +0:8 'vi' ( in structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 'e' ( in 4-component vector of float) +0:? Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:11 b: direct index for structure ( temp 4-component vector of float) +0:11 'local' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:11 Constant: +0:11 2 (const int) +0:11 add ( temp 4-component vector of float) +0:11 add ( temp 4-component vector of float) +0:11 add ( temp 4-component vector of float) +0:11 add ( temp 4-component vector of float) +0:11 direct index ( temp 4-component vector of float) +0:11 m: direct index for structure ( temp 2-element array of 4-component vector of float) +0:11 'vi' ( in structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( temp 4-component vector of float) +0:11 m: direct index for structure ( temp 2-element array of 4-component vector of float) +0:11 'vi' ( in structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 Construct vec4 ( temp 4-component vector of float) +0:11 direct index ( temp float) +0:11 coord: direct index for structure ( temp 4-component vector of float) +0:11 'vi' ( in structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 'd' ( in 4-component vector of float) +0:11 'e' ( in 4-component vector of float) +0:12 move second child to first child ( temp 4-component vector of float) +0:12 coord: direct index for structure ( temp 4-component vector of float) +0:12 'local' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 1.000000 +0:12 1.000000 +0:12 1.000000 +0:12 1.000000 +0:13 move second child to first child ( temp 4-component vector of float) +0:13 direct index ( temp 4-component vector of float) +0:13 m: direct index for structure ( temp 2-element array of 4-component vector of float) +0:13 'local' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 2.000000 +0:13 2.000000 +0:13 2.000000 +0:13 2.000000 +0:14 move second child to first child ( temp 4-component vector of float) +0:14 direct index ( temp 4-component vector of float) +0:14 m: direct index for structure ( temp 2-element array of 4-component vector of float) +0:14 'local' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 1 (const int) +0:14 Constant: +0:14 3.000000 +0:14 3.000000 +0:14 3.000000 +0:14 3.000000 +0:16 Branch: Return with expression +0:16 'local' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:? 'd' ( temp 4-component vector of float) +0:? 'd' (layout( location=0) in 4-component vector of float) +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 direct index ( temp 4-component vector of float) +0:8 m: direct index for structure ( temp 2-element array of 4-component vector of float) +0:? 'vi' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 0 (const int) +0:? 'vi.m[0]' (layout( location=1) in 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:8 direct index ( temp 4-component vector of float) +0:8 m: direct index for structure ( temp 2-element array of 4-component vector of float) +0:? 'vi' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 1 (const int) +0:? 'vi.m[1]' (layout( location=2) in 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:8 coord: direct index for structure ( temp 4-component vector of float) +0:? 'vi' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Constant: +0:8 1 (const int) +0:? 'vi.coord' (layout( location=3) in 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:8 b: direct index for structure ( temp 4-component vector of float) +0:? 'vi' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Constant: +0:8 2 (const int) +0:? 'vi.b' (layout( location=4) in 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:? 'e' ( temp 4-component vector of float) +0:? 'e' (layout( location=5) in 4-component vector of float) +0:8 Sequence +0:8 move second child to first child ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Function Call: @main(vf4;struct-VI-vf4[2]-vf4-vf41;vf4; ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:? 'd' ( temp 4-component vector of float) +0:? 'vi' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:? 'e' ( temp 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.m[0]' (layout( location=0) out 4-component vector of float) +0:8 direct index ( temp 4-component vector of float) +0:8 m: direct index for structure ( temp 2-element array of 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.m[1]' (layout( location=1) out 4-component vector of float) +0:8 direct index ( temp 4-component vector of float) +0:8 m: direct index for structure ( temp 2-element array of 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.coord' ( out 4-component vector of float Position) +0:8 coord: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.b' (layout( location=2) smooth out 4-component vector of float) +0:8 b: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Constant: +0:8 2 (const int) +0:? Linker Objects +0:? '@entryPointOutput.coord' ( out 4-component vector of float Position) +0:? '@entryPointOutput.m[0]' (layout( location=0) out 4-component vector of float) +0:? '@entryPointOutput.m[1]' (layout( location=1) out 4-component vector of float) +0:? '@entryPointOutput.b' (layout( location=2) smooth out 4-component vector of float) +0:? 'd' (layout( location=0) in 4-component vector of float) +0:? 'vi.m[0]' (layout( location=1) in 4-component vector of float) +0:? 'vi.m[1]' (layout( location=2) in 4-component vector of float) +0:? 'vi.coord' (layout( location=3) in 4-component vector of float) +0:? 'vi.b' (layout( location=4) in 4-component vector of float) +0:? 'e' (layout( location=5) in 4-component vector of float) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:8 Function Definition: @main(vf4;struct-VI-vf4[2]-vf4-vf41;vf4; ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Function Parameters: +0:8 'd' ( in 4-component vector of float) +0:8 'vi' ( in structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 'e' ( in 4-component vector of float) +0:? Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:11 b: direct index for structure ( temp 4-component vector of float) +0:11 'local' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:11 Constant: +0:11 2 (const int) +0:11 add ( temp 4-component vector of float) +0:11 add ( temp 4-component vector of float) +0:11 add ( temp 4-component vector of float) +0:11 add ( temp 4-component vector of float) +0:11 direct index ( temp 4-component vector of float) +0:11 m: direct index for structure ( temp 2-element array of 4-component vector of float) +0:11 'vi' ( in structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index ( temp 4-component vector of float) +0:11 m: direct index for structure ( temp 2-element array of 4-component vector of float) +0:11 'vi' ( in structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 Construct vec4 ( temp 4-component vector of float) +0:11 direct index ( temp float) +0:11 coord: direct index for structure ( temp 4-component vector of float) +0:11 'vi' ( in structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 'd' ( in 4-component vector of float) +0:11 'e' ( in 4-component vector of float) +0:12 move second child to first child ( temp 4-component vector of float) +0:12 coord: direct index for structure ( temp 4-component vector of float) +0:12 'local' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 1.000000 +0:12 1.000000 +0:12 1.000000 +0:12 1.000000 +0:13 move second child to first child ( temp 4-component vector of float) +0:13 direct index ( temp 4-component vector of float) +0:13 m: direct index for structure ( temp 2-element array of 4-component vector of float) +0:13 'local' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 2.000000 +0:13 2.000000 +0:13 2.000000 +0:13 2.000000 +0:14 move second child to first child ( temp 4-component vector of float) +0:14 direct index ( temp 4-component vector of float) +0:14 m: direct index for structure ( temp 2-element array of 4-component vector of float) +0:14 'local' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 1 (const int) +0:14 Constant: +0:14 3.000000 +0:14 3.000000 +0:14 3.000000 +0:14 3.000000 +0:16 Branch: Return with expression +0:16 'local' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:? 'd' ( temp 4-component vector of float) +0:? 'd' (layout( location=0) in 4-component vector of float) +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 direct index ( temp 4-component vector of float) +0:8 m: direct index for structure ( temp 2-element array of 4-component vector of float) +0:? 'vi' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 0 (const int) +0:? 'vi.m[0]' (layout( location=1) in 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:8 direct index ( temp 4-component vector of float) +0:8 m: direct index for structure ( temp 2-element array of 4-component vector of float) +0:? 'vi' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 1 (const int) +0:? 'vi.m[1]' (layout( location=2) in 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:8 coord: direct index for structure ( temp 4-component vector of float) +0:? 'vi' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Constant: +0:8 1 (const int) +0:? 'vi.coord' (layout( location=3) in 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:8 b: direct index for structure ( temp 4-component vector of float) +0:? 'vi' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Constant: +0:8 2 (const int) +0:? 'vi.b' (layout( location=4) in 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:? 'e' ( temp 4-component vector of float) +0:? 'e' (layout( location=5) in 4-component vector of float) +0:8 Sequence +0:8 move second child to first child ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Function Call: @main(vf4;struct-VI-vf4[2]-vf4-vf41;vf4; ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:? 'd' ( temp 4-component vector of float) +0:? 'vi' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:? 'e' ( temp 4-component vector of float) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.m[0]' (layout( location=0) out 4-component vector of float) +0:8 direct index ( temp 4-component vector of float) +0:8 m: direct index for structure ( temp 2-element array of 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.m[1]' (layout( location=1) out 4-component vector of float) +0:8 direct index ( temp 4-component vector of float) +0:8 m: direct index for structure ( temp 2-element array of 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.coord' ( out 4-component vector of float Position) +0:8 coord: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.b' (layout( location=2) smooth out 4-component vector of float) +0:8 b: direct index for structure ( temp 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Constant: +0:8 2 (const int) +0:? Linker Objects +0:? '@entryPointOutput.coord' ( out 4-component vector of float Position) +0:? '@entryPointOutput.m[0]' (layout( location=0) out 4-component vector of float) +0:? '@entryPointOutput.m[1]' (layout( location=1) out 4-component vector of float) +0:? '@entryPointOutput.b' (layout( location=2) smooth out 4-component vector of float) +0:? 'd' (layout( location=0) in 4-component vector of float) +0:? 'vi.m[0]' (layout( location=1) in 4-component vector of float) +0:? 'vi.m[1]' (layout( location=2) in 4-component vector of float) +0:? 'vi.coord' (layout( location=3) in 4-component vector of float) +0:? 'vi.b' (layout( location=4) in 4-component vector of float) +0:? 'e' (layout( location=5) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 94 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 55 58 61 64 67 71 82 85 88 91 + Source HLSL 500 + Name 4 "main" + Name 12 "VI" + MemberName 12(VI) 0 "m" + MemberName 12(VI) 1 "coord" + MemberName 12(VI) 2 "b" + Name 18 "@main(vf4;struct-VI-vf4[2]-vf4-vf41;vf4;" + Name 15 "d" + Name 16 "vi" + Name 17 "e" + Name 20 "local" + Name 53 "d" + Name 55 "d" + Name 57 "vi" + Name 58 "vi.m[0]" + Name 61 "vi.m[1]" + Name 64 "vi.coord" + Name 67 "vi.b" + Name 70 "e" + Name 71 "e" + Name 73 "flattenTemp" + Name 74 "param" + Name 76 "param" + Name 78 "param" + Name 82 "@entryPointOutput.m[0]" + Name 85 "@entryPointOutput.m[1]" + Name 88 "@entryPointOutput.coord" + Name 91 "@entryPointOutput.b" + Decorate 55(d) Location 0 + Decorate 58(vi.m[0]) Location 1 + Decorate 61(vi.m[1]) Location 2 + Decorate 64(vi.coord) Location 3 + Decorate 67(vi.b) Location 4 + Decorate 71(e) Location 5 + Decorate 82(@entryPointOutput.m[0]) Location 0 + Decorate 85(@entryPointOutput.m[1]) Location 1 + Decorate 88(@entryPointOutput.coord) BuiltIn Position + Decorate 91(@entryPointOutput.b) Location 2 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeInt 32 0 + 10: 9(int) Constant 2 + 11: TypeArray 7(fvec4) 10 + 12(VI): TypeStruct 11 7(fvec4) 7(fvec4) + 13: TypePointer Function 12(VI) + 14: TypeFunction 12(VI) 8(ptr) 13(ptr) 8(ptr) + 21: TypeInt 32 1 + 22: 21(int) Constant 2 + 23: 21(int) Constant 0 + 24: 21(int) Constant 1 + 30: 9(int) Constant 0 + 31: TypePointer Function 6(float) + 41: 6(float) Constant 1065353216 + 42: 7(fvec4) ConstantComposite 41 41 41 41 + 44: 6(float) Constant 1073741824 + 45: 7(fvec4) ConstantComposite 44 44 44 44 + 47: 6(float) Constant 1077936128 + 48: 7(fvec4) ConstantComposite 47 47 47 47 + 54: TypePointer Input 7(fvec4) + 55(d): 54(ptr) Variable Input + 58(vi.m[0]): 54(ptr) Variable Input + 61(vi.m[1]): 54(ptr) Variable Input + 64(vi.coord): 54(ptr) Variable Input + 67(vi.b): 54(ptr) Variable Input + 71(e): 54(ptr) Variable Input + 81: TypePointer Output 7(fvec4) +82(@entryPointOutput.m[0]): 81(ptr) Variable Output +85(@entryPointOutput.m[1]): 81(ptr) Variable Output +88(@entryPointOutput.coord): 81(ptr) Variable Output +91(@entryPointOutput.b): 81(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 53(d): 8(ptr) Variable Function + 57(vi): 13(ptr) Variable Function + 70(e): 8(ptr) Variable Function + 73(flattenTemp): 13(ptr) Variable Function + 74(param): 8(ptr) Variable Function + 76(param): 13(ptr) Variable Function + 78(param): 8(ptr) Variable Function + 56: 7(fvec4) Load 55(d) + Store 53(d) 56 + 59: 7(fvec4) Load 58(vi.m[0]) + 60: 8(ptr) AccessChain 57(vi) 23 23 + Store 60 59 + 62: 7(fvec4) Load 61(vi.m[1]) + 63: 8(ptr) AccessChain 57(vi) 23 24 + Store 63 62 + 65: 7(fvec4) Load 64(vi.coord) + 66: 8(ptr) AccessChain 57(vi) 24 + Store 66 65 + 68: 7(fvec4) Load 67(vi.b) + 69: 8(ptr) AccessChain 57(vi) 22 + Store 69 68 + 72: 7(fvec4) Load 71(e) + Store 70(e) 72 + 75: 7(fvec4) Load 53(d) + Store 74(param) 75 + 77: 12(VI) Load 57(vi) + Store 76(param) 77 + 79: 7(fvec4) Load 70(e) + Store 78(param) 79 + 80: 12(VI) FunctionCall 18(@main(vf4;struct-VI-vf4[2]-vf4-vf41;vf4;) 74(param) 76(param) 78(param) + Store 73(flattenTemp) 80 + 83: 8(ptr) AccessChain 73(flattenTemp) 23 23 + 84: 7(fvec4) Load 83 + Store 82(@entryPointOutput.m[0]) 84 + 86: 8(ptr) AccessChain 73(flattenTemp) 23 24 + 87: 7(fvec4) Load 86 + Store 85(@entryPointOutput.m[1]) 87 + 89: 8(ptr) AccessChain 73(flattenTemp) 24 + 90: 7(fvec4) Load 89 + Store 88(@entryPointOutput.coord) 90 + 92: 8(ptr) AccessChain 73(flattenTemp) 22 + 93: 7(fvec4) Load 92 + Store 91(@entryPointOutput.b) 93 + Return + FunctionEnd +18(@main(vf4;struct-VI-vf4[2]-vf4-vf41;vf4;): 12(VI) Function None 14 + 15(d): 8(ptr) FunctionParameter + 16(vi): 13(ptr) FunctionParameter + 17(e): 8(ptr) FunctionParameter + 19: Label + 20(local): 13(ptr) Variable Function + 25: 8(ptr) AccessChain 16(vi) 23 24 + 26: 7(fvec4) Load 25 + 27: 8(ptr) AccessChain 16(vi) 23 23 + 28: 7(fvec4) Load 27 + 29: 7(fvec4) FAdd 26 28 + 32: 31(ptr) AccessChain 16(vi) 24 30 + 33: 6(float) Load 32 + 34: 7(fvec4) CompositeConstruct 33 33 33 33 + 35: 7(fvec4) FAdd 29 34 + 36: 7(fvec4) Load 15(d) + 37: 7(fvec4) FAdd 35 36 + 38: 7(fvec4) Load 17(e) + 39: 7(fvec4) FAdd 37 38 + 40: 8(ptr) AccessChain 20(local) 22 + Store 40 39 + 43: 8(ptr) AccessChain 20(local) 24 + Store 43 42 + 46: 8(ptr) AccessChain 20(local) 23 23 + Store 46 45 + 49: 8(ptr) AccessChain 20(local) 23 24 + Store 49 48 + 50: 12(VI) Load 20(local) + ReturnValue 50 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.subpass.frag.out b/deps/glslang/Test/baseResults/hlsl.subpass.frag.out new file mode 100644 index 00000000..99aeb96b --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.subpass.frag.out @@ -0,0 +1,777 @@ +hlsl.subpass.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:68 Function Definition: @main( ( temp 4-component vector of float) +0:68 Function Parameters: +0:? Sequence +0:69 Sequence +0:69 move second child to first child ( temp 4-component vector of float) +0:69 'result00' ( temp 4-component vector of float) +0:69 subpassLoad ( temp 4-component vector of float) +0:69 'subpass_f4' (layout( binding=1 input_attachment_index=1) uniform subpassInput) +0:70 Sequence +0:70 move second child to first child ( temp 4-component vector of int) +0:70 'result01' ( temp 4-component vector of int) +0:70 subpassLoad ( temp 4-component vector of int) +0:70 'subpass_i4' ( uniform isubpassInput) +0:71 Sequence +0:71 move second child to first child ( temp 4-component vector of uint) +0:71 'result02' ( temp 4-component vector of uint) +0:71 subpassLoad ( temp 4-component vector of uint) +0:71 'subpass_u4' ( uniform usubpassInput) +0:73 Sequence +0:73 move second child to first child ( temp 4-component vector of float) +0:73 'result10' ( temp 4-component vector of float) +0:73 subpassLoadMS ( temp 4-component vector of float) +0:73 'subpass_ms_f4' ( uniform subpassInputMS) +0:73 Constant: +0:73 3 (const int) +0:74 Sequence +0:74 move second child to first child ( temp 4-component vector of int) +0:74 'result11' ( temp 4-component vector of int) +0:74 subpassLoadMS ( temp 4-component vector of int) +0:74 'subpass_ms_i4' ( uniform isubpassInputMS) +0:74 Constant: +0:74 3 (const int) +0:75 Sequence +0:75 move second child to first child ( temp 4-component vector of uint) +0:75 'result12' ( temp 4-component vector of uint) +0:75 subpassLoadMS ( temp 4-component vector of uint) +0:75 'subpass_ms_u4' ( uniform usubpassInputMS) +0:75 Constant: +0:75 3 (const int) +0:77 Sequence +0:77 move second child to first child ( temp 3-component vector of float) +0:77 'result20' ( temp 3-component vector of float) +0:77 Construct vec3 ( temp 3-component vector of float) +0:77 subpassLoad ( temp 4-component vector of float) +0:77 'subpass_f3' ( uniform subpassInput) +0:78 Sequence +0:78 move second child to first child ( temp 3-component vector of int) +0:78 'result21' ( temp 3-component vector of int) +0:78 Construct ivec3 ( temp 3-component vector of int) +0:78 subpassLoad ( temp 4-component vector of int) +0:78 'subpass_i3' ( uniform isubpassInput) +0:79 Sequence +0:79 move second child to first child ( temp 3-component vector of uint) +0:79 'result22' ( temp 3-component vector of uint) +0:79 Construct uvec3 ( temp 3-component vector of uint) +0:79 subpassLoad ( temp 4-component vector of uint) +0:79 'subpass_u3' ( uniform usubpassInput) +0:81 Sequence +0:81 move second child to first child ( temp 3-component vector of float) +0:81 'result30' ( temp 3-component vector of float) +0:81 Construct vec3 ( temp 3-component vector of float) +0:81 subpassLoadMS ( temp 4-component vector of float) +0:81 'subpass_ms_f3' ( uniform subpassInputMS) +0:81 Constant: +0:81 3 (const int) +0:82 Sequence +0:82 move second child to first child ( temp 3-component vector of int) +0:82 'result31' ( temp 3-component vector of int) +0:82 Construct ivec3 ( temp 3-component vector of int) +0:82 subpassLoadMS ( temp 4-component vector of int) +0:82 'subpass_ms_i3' ( uniform isubpassInputMS) +0:82 Constant: +0:82 3 (const int) +0:83 Sequence +0:83 move second child to first child ( temp 3-component vector of uint) +0:83 'result32' ( temp 3-component vector of uint) +0:83 Construct uvec3 ( temp 3-component vector of uint) +0:83 subpassLoadMS ( temp 4-component vector of uint) +0:83 'subpass_ms_u3' ( uniform usubpassInputMS) +0:83 Constant: +0:83 3 (const int) +0:85 Sequence +0:85 move second child to first child ( temp 2-component vector of float) +0:85 'result40' ( temp 2-component vector of float) +0:85 Construct vec2 ( temp 2-component vector of float) +0:85 subpassLoad ( temp 4-component vector of float) +0:85 'subpass_f2' ( uniform subpassInput) +0:86 Sequence +0:86 move second child to first child ( temp 2-component vector of int) +0:86 'result41' ( temp 2-component vector of int) +0:86 Construct ivec2 ( temp 2-component vector of int) +0:86 subpassLoad ( temp 4-component vector of int) +0:86 'subpass_i2' ( uniform isubpassInput) +0:87 Sequence +0:87 move second child to first child ( temp 2-component vector of uint) +0:87 'result42' ( temp 2-component vector of uint) +0:87 Construct uvec2 ( temp 2-component vector of uint) +0:87 subpassLoad ( temp 4-component vector of uint) +0:87 'subpass_u2' ( uniform usubpassInput) +0:89 Sequence +0:89 move second child to first child ( temp 2-component vector of float) +0:89 'result50' ( temp 2-component vector of float) +0:89 Construct vec2 ( temp 2-component vector of float) +0:89 subpassLoadMS ( temp 4-component vector of float) +0:89 'subpass_ms_f2' ( uniform subpassInputMS) +0:89 Constant: +0:89 2 (const int) +0:90 Sequence +0:90 move second child to first child ( temp 2-component vector of int) +0:90 'result51' ( temp 2-component vector of int) +0:90 Construct ivec2 ( temp 2-component vector of int) +0:90 subpassLoadMS ( temp 4-component vector of int) +0:90 'subpass_ms_i2' ( uniform isubpassInputMS) +0:90 Constant: +0:90 2 (const int) +0:91 Sequence +0:91 move second child to first child ( temp 2-component vector of uint) +0:91 'result52' ( temp 2-component vector of uint) +0:91 Construct uvec2 ( temp 2-component vector of uint) +0:91 subpassLoadMS ( temp 4-component vector of uint) +0:91 'subpass_ms_u2' ( uniform usubpassInputMS) +0:91 Constant: +0:91 2 (const int) +0:93 Sequence +0:93 move second child to first child ( temp float) +0:93 'result60' ( temp float) +0:93 Construct float ( temp float) +0:93 subpassLoad ( temp 4-component vector of float) +0:93 'subpass_f' ( uniform subpassInput) +0:94 Sequence +0:94 move second child to first child ( temp int) +0:94 'result61' ( temp int) +0:94 Construct int ( temp int) +0:94 subpassLoad ( temp 4-component vector of int) +0:94 'subpass_i' ( uniform isubpassInput) +0:95 Sequence +0:95 move second child to first child ( temp uint) +0:95 'result62' ( temp uint) +0:95 Construct uint ( temp uint) +0:95 subpassLoad ( temp 4-component vector of uint) +0:95 'subpass_u' ( uniform usubpassInput) +0:97 Sequence +0:97 move second child to first child ( temp float) +0:97 'result70' ( temp float) +0:97 Construct float ( temp float) +0:97 subpassLoadMS ( temp 4-component vector of float) +0:97 'subpass_ms_f' ( uniform subpassInputMS) +0:97 Constant: +0:97 2 (const int) +0:98 Sequence +0:98 move second child to first child ( temp int) +0:98 'result71' ( temp int) +0:98 Construct int ( temp int) +0:98 subpassLoadMS ( temp 4-component vector of int) +0:98 'subpass_ms_i' ( uniform isubpassInputMS) +0:98 Constant: +0:98 2 (const int) +0:99 Sequence +0:99 move second child to first child ( temp uint) +0:99 'result72' ( temp uint) +0:99 Construct uint ( temp uint) +0:99 subpassLoadMS ( temp 4-component vector of uint) +0:99 'subpass_ms_u' ( uniform usubpassInputMS) +0:99 Constant: +0:99 2 (const int) +0:101 Sequence +0:101 move second child to first child ( temp 4-component vector of float) +0:101 'result73' ( temp 4-component vector of float) +0:101 subpassLoad ( temp 4-component vector of float) +0:101 'subpass_2' ( uniform subpassInput) +0:112 Branch: Return with expression +0:112 Constant: +0:112 0.000000 +0:112 0.000000 +0:112 0.000000 +0:112 0.000000 +0:68 Function Definition: main( ( temp void) +0:68 Function Parameters: +0:? Sequence +0:68 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:68 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'subpass_f4' (layout( binding=1 input_attachment_index=1) uniform subpassInput) +0:? 'subpass_i4' ( uniform isubpassInput) +0:? 'subpass_u4' ( uniform usubpassInput) +0:? 'subpass_ms_f4' ( uniform subpassInputMS) +0:? 'subpass_ms_i4' ( uniform isubpassInputMS) +0:? 'subpass_ms_u4' ( uniform usubpassInputMS) +0:? 'subpass_f3' ( uniform subpassInput) +0:? 'subpass_i3' ( uniform isubpassInput) +0:? 'subpass_u3' ( uniform usubpassInput) +0:? 'subpass_ms_f3' ( uniform subpassInputMS) +0:? 'subpass_ms_i3' ( uniform isubpassInputMS) +0:? 'subpass_ms_u3' ( uniform usubpassInputMS) +0:? 'subpass_f2' ( uniform subpassInput) +0:? 'subpass_i2' ( uniform isubpassInput) +0:? 'subpass_u2' ( uniform usubpassInput) +0:? 'subpass_ms_f2' ( uniform subpassInputMS) +0:? 'subpass_ms_i2' ( uniform isubpassInputMS) +0:? 'subpass_ms_u2' ( uniform usubpassInputMS) +0:? 'subpass_f' ( uniform subpassInput) +0:? 'subpass_i' ( uniform isubpassInput) +0:? 'subpass_u' ( uniform usubpassInput) +0:? 'subpass_ms_f' ( uniform subpassInputMS) +0:? 'subpass_ms_i' ( uniform isubpassInputMS) +0:? 'subpass_ms_u' ( uniform usubpassInputMS) +0:? 'subpass_2' ( uniform subpassInput) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:68 Function Definition: @main( ( temp 4-component vector of float) +0:68 Function Parameters: +0:? Sequence +0:69 Sequence +0:69 move second child to first child ( temp 4-component vector of float) +0:69 'result00' ( temp 4-component vector of float) +0:69 subpassLoad ( temp 4-component vector of float) +0:69 'subpass_f4' (layout( binding=1 input_attachment_index=1) uniform subpassInput) +0:70 Sequence +0:70 move second child to first child ( temp 4-component vector of int) +0:70 'result01' ( temp 4-component vector of int) +0:70 subpassLoad ( temp 4-component vector of int) +0:70 'subpass_i4' ( uniform isubpassInput) +0:71 Sequence +0:71 move second child to first child ( temp 4-component vector of uint) +0:71 'result02' ( temp 4-component vector of uint) +0:71 subpassLoad ( temp 4-component vector of uint) +0:71 'subpass_u4' ( uniform usubpassInput) +0:73 Sequence +0:73 move second child to first child ( temp 4-component vector of float) +0:73 'result10' ( temp 4-component vector of float) +0:73 subpassLoadMS ( temp 4-component vector of float) +0:73 'subpass_ms_f4' ( uniform subpassInputMS) +0:73 Constant: +0:73 3 (const int) +0:74 Sequence +0:74 move second child to first child ( temp 4-component vector of int) +0:74 'result11' ( temp 4-component vector of int) +0:74 subpassLoadMS ( temp 4-component vector of int) +0:74 'subpass_ms_i4' ( uniform isubpassInputMS) +0:74 Constant: +0:74 3 (const int) +0:75 Sequence +0:75 move second child to first child ( temp 4-component vector of uint) +0:75 'result12' ( temp 4-component vector of uint) +0:75 subpassLoadMS ( temp 4-component vector of uint) +0:75 'subpass_ms_u4' ( uniform usubpassInputMS) +0:75 Constant: +0:75 3 (const int) +0:77 Sequence +0:77 move second child to first child ( temp 3-component vector of float) +0:77 'result20' ( temp 3-component vector of float) +0:77 Construct vec3 ( temp 3-component vector of float) +0:77 subpassLoad ( temp 4-component vector of float) +0:77 'subpass_f3' ( uniform subpassInput) +0:78 Sequence +0:78 move second child to first child ( temp 3-component vector of int) +0:78 'result21' ( temp 3-component vector of int) +0:78 Construct ivec3 ( temp 3-component vector of int) +0:78 subpassLoad ( temp 4-component vector of int) +0:78 'subpass_i3' ( uniform isubpassInput) +0:79 Sequence +0:79 move second child to first child ( temp 3-component vector of uint) +0:79 'result22' ( temp 3-component vector of uint) +0:79 Construct uvec3 ( temp 3-component vector of uint) +0:79 subpassLoad ( temp 4-component vector of uint) +0:79 'subpass_u3' ( uniform usubpassInput) +0:81 Sequence +0:81 move second child to first child ( temp 3-component vector of float) +0:81 'result30' ( temp 3-component vector of float) +0:81 Construct vec3 ( temp 3-component vector of float) +0:81 subpassLoadMS ( temp 4-component vector of float) +0:81 'subpass_ms_f3' ( uniform subpassInputMS) +0:81 Constant: +0:81 3 (const int) +0:82 Sequence +0:82 move second child to first child ( temp 3-component vector of int) +0:82 'result31' ( temp 3-component vector of int) +0:82 Construct ivec3 ( temp 3-component vector of int) +0:82 subpassLoadMS ( temp 4-component vector of int) +0:82 'subpass_ms_i3' ( uniform isubpassInputMS) +0:82 Constant: +0:82 3 (const int) +0:83 Sequence +0:83 move second child to first child ( temp 3-component vector of uint) +0:83 'result32' ( temp 3-component vector of uint) +0:83 Construct uvec3 ( temp 3-component vector of uint) +0:83 subpassLoadMS ( temp 4-component vector of uint) +0:83 'subpass_ms_u3' ( uniform usubpassInputMS) +0:83 Constant: +0:83 3 (const int) +0:85 Sequence +0:85 move second child to first child ( temp 2-component vector of float) +0:85 'result40' ( temp 2-component vector of float) +0:85 Construct vec2 ( temp 2-component vector of float) +0:85 subpassLoad ( temp 4-component vector of float) +0:85 'subpass_f2' ( uniform subpassInput) +0:86 Sequence +0:86 move second child to first child ( temp 2-component vector of int) +0:86 'result41' ( temp 2-component vector of int) +0:86 Construct ivec2 ( temp 2-component vector of int) +0:86 subpassLoad ( temp 4-component vector of int) +0:86 'subpass_i2' ( uniform isubpassInput) +0:87 Sequence +0:87 move second child to first child ( temp 2-component vector of uint) +0:87 'result42' ( temp 2-component vector of uint) +0:87 Construct uvec2 ( temp 2-component vector of uint) +0:87 subpassLoad ( temp 4-component vector of uint) +0:87 'subpass_u2' ( uniform usubpassInput) +0:89 Sequence +0:89 move second child to first child ( temp 2-component vector of float) +0:89 'result50' ( temp 2-component vector of float) +0:89 Construct vec2 ( temp 2-component vector of float) +0:89 subpassLoadMS ( temp 4-component vector of float) +0:89 'subpass_ms_f2' ( uniform subpassInputMS) +0:89 Constant: +0:89 2 (const int) +0:90 Sequence +0:90 move second child to first child ( temp 2-component vector of int) +0:90 'result51' ( temp 2-component vector of int) +0:90 Construct ivec2 ( temp 2-component vector of int) +0:90 subpassLoadMS ( temp 4-component vector of int) +0:90 'subpass_ms_i2' ( uniform isubpassInputMS) +0:90 Constant: +0:90 2 (const int) +0:91 Sequence +0:91 move second child to first child ( temp 2-component vector of uint) +0:91 'result52' ( temp 2-component vector of uint) +0:91 Construct uvec2 ( temp 2-component vector of uint) +0:91 subpassLoadMS ( temp 4-component vector of uint) +0:91 'subpass_ms_u2' ( uniform usubpassInputMS) +0:91 Constant: +0:91 2 (const int) +0:93 Sequence +0:93 move second child to first child ( temp float) +0:93 'result60' ( temp float) +0:93 Construct float ( temp float) +0:93 subpassLoad ( temp 4-component vector of float) +0:93 'subpass_f' ( uniform subpassInput) +0:94 Sequence +0:94 move second child to first child ( temp int) +0:94 'result61' ( temp int) +0:94 Construct int ( temp int) +0:94 subpassLoad ( temp 4-component vector of int) +0:94 'subpass_i' ( uniform isubpassInput) +0:95 Sequence +0:95 move second child to first child ( temp uint) +0:95 'result62' ( temp uint) +0:95 Construct uint ( temp uint) +0:95 subpassLoad ( temp 4-component vector of uint) +0:95 'subpass_u' ( uniform usubpassInput) +0:97 Sequence +0:97 move second child to first child ( temp float) +0:97 'result70' ( temp float) +0:97 Construct float ( temp float) +0:97 subpassLoadMS ( temp 4-component vector of float) +0:97 'subpass_ms_f' ( uniform subpassInputMS) +0:97 Constant: +0:97 2 (const int) +0:98 Sequence +0:98 move second child to first child ( temp int) +0:98 'result71' ( temp int) +0:98 Construct int ( temp int) +0:98 subpassLoadMS ( temp 4-component vector of int) +0:98 'subpass_ms_i' ( uniform isubpassInputMS) +0:98 Constant: +0:98 2 (const int) +0:99 Sequence +0:99 move second child to first child ( temp uint) +0:99 'result72' ( temp uint) +0:99 Construct uint ( temp uint) +0:99 subpassLoadMS ( temp 4-component vector of uint) +0:99 'subpass_ms_u' ( uniform usubpassInputMS) +0:99 Constant: +0:99 2 (const int) +0:101 Sequence +0:101 move second child to first child ( temp 4-component vector of float) +0:101 'result73' ( temp 4-component vector of float) +0:101 subpassLoad ( temp 4-component vector of float) +0:101 'subpass_2' ( uniform subpassInput) +0:112 Branch: Return with expression +0:112 Constant: +0:112 0.000000 +0:112 0.000000 +0:112 0.000000 +0:112 0.000000 +0:68 Function Definition: main( ( temp void) +0:68 Function Parameters: +0:? Sequence +0:68 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:68 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'subpass_f4' (layout( binding=1 input_attachment_index=1) uniform subpassInput) +0:? 'subpass_i4' ( uniform isubpassInput) +0:? 'subpass_u4' ( uniform usubpassInput) +0:? 'subpass_ms_f4' ( uniform subpassInputMS) +0:? 'subpass_ms_i4' ( uniform isubpassInputMS) +0:? 'subpass_ms_u4' ( uniform usubpassInputMS) +0:? 'subpass_f3' ( uniform subpassInput) +0:? 'subpass_i3' ( uniform isubpassInput) +0:? 'subpass_u3' ( uniform usubpassInput) +0:? 'subpass_ms_f3' ( uniform subpassInputMS) +0:? 'subpass_ms_i3' ( uniform isubpassInputMS) +0:? 'subpass_ms_u3' ( uniform usubpassInputMS) +0:? 'subpass_f2' ( uniform subpassInput) +0:? 'subpass_i2' ( uniform isubpassInput) +0:? 'subpass_u2' ( uniform usubpassInput) +0:? 'subpass_ms_f2' ( uniform subpassInputMS) +0:? 'subpass_ms_i2' ( uniform isubpassInputMS) +0:? 'subpass_ms_u2' ( uniform usubpassInputMS) +0:? 'subpass_f' ( uniform subpassInput) +0:? 'subpass_i' ( uniform isubpassInput) +0:? 'subpass_u' ( uniform usubpassInput) +0:? 'subpass_ms_f' ( uniform subpassInputMS) +0:? 'subpass_ms_i' ( uniform isubpassInputMS) +0:? 'subpass_ms_u' ( uniform usubpassInputMS) +0:? 'subpass_2' ( uniform subpassInput) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 204 + + Capability Shader + Capability InputAttachment + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 202 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 12 "result00" + Name 15 "subpass_f4" + Name 24 "result01" + Name 27 "subpass_i4" + Name 33 "result02" + Name 36 "subpass_u4" + Name 39 "result10" + Name 42 "subpass_ms_f4" + Name 46 "result11" + Name 49 "subpass_ms_i4" + Name 52 "result12" + Name 55 "subpass_ms_u4" + Name 60 "result20" + Name 61 "subpass_f3" + Name 70 "result21" + Name 71 "subpass_i3" + Name 80 "result22" + Name 81 "subpass_u3" + Name 88 "result30" + Name 89 "subpass_ms_f3" + Name 96 "result31" + Name 97 "subpass_ms_i3" + Name 104 "result32" + Name 105 "subpass_ms_u3" + Name 114 "result40" + Name 115 "subpass_f2" + Name 122 "result41" + Name 123 "subpass_i2" + Name 131 "result42" + Name 132 "subpass_u2" + Name 138 "result50" + Name 139 "subpass_ms_f2" + Name 146 "result51" + Name 147 "subpass_ms_i2" + Name 153 "result52" + Name 154 "subpass_ms_u2" + Name 161 "result60" + Name 162 "subpass_f" + Name 167 "result61" + Name 168 "subpass_i" + Name 173 "result62" + Name 174 "subpass_u" + Name 178 "result70" + Name 179 "subpass_ms_f" + Name 183 "result71" + Name 184 "subpass_ms_i" + Name 188 "result72" + Name 189 "subpass_ms_u" + Name 193 "result73" + Name 194 "subpass_2" + Name 202 "@entryPointOutput" + Decorate 15(subpass_f4) DescriptorSet 0 + Decorate 15(subpass_f4) Binding 1 + Decorate 15(subpass_f4) InputAttachmentIndex 1 + Decorate 27(subpass_i4) DescriptorSet 0 + Decorate 27(subpass_i4) InputAttachmentIndex 2 + Decorate 36(subpass_u4) DescriptorSet 0 + Decorate 36(subpass_u4) InputAttachmentIndex 3 + Decorate 42(subpass_ms_f4) DescriptorSet 0 + Decorate 42(subpass_ms_f4) InputAttachmentIndex 4 + Decorate 49(subpass_ms_i4) DescriptorSet 0 + Decorate 49(subpass_ms_i4) InputAttachmentIndex 5 + Decorate 55(subpass_ms_u4) DescriptorSet 0 + Decorate 55(subpass_ms_u4) InputAttachmentIndex 6 + Decorate 61(subpass_f3) DescriptorSet 0 + Decorate 61(subpass_f3) InputAttachmentIndex 1 + Decorate 71(subpass_i3) DescriptorSet 0 + Decorate 71(subpass_i3) InputAttachmentIndex 2 + Decorate 81(subpass_u3) DescriptorSet 0 + Decorate 81(subpass_u3) InputAttachmentIndex 3 + Decorate 89(subpass_ms_f3) DescriptorSet 0 + Decorate 89(subpass_ms_f3) InputAttachmentIndex 4 + Decorate 97(subpass_ms_i3) DescriptorSet 0 + Decorate 97(subpass_ms_i3) InputAttachmentIndex 5 + Decorate 105(subpass_ms_u3) DescriptorSet 0 + Decorate 105(subpass_ms_u3) InputAttachmentIndex 6 + Decorate 115(subpass_f2) DescriptorSet 0 + Decorate 115(subpass_f2) InputAttachmentIndex 1 + Decorate 123(subpass_i2) DescriptorSet 0 + Decorate 123(subpass_i2) InputAttachmentIndex 2 + Decorate 132(subpass_u2) DescriptorSet 0 + Decorate 132(subpass_u2) InputAttachmentIndex 3 + Decorate 139(subpass_ms_f2) DescriptorSet 0 + Decorate 139(subpass_ms_f2) InputAttachmentIndex 4 + Decorate 147(subpass_ms_i2) DescriptorSet 0 + Decorate 147(subpass_ms_i2) InputAttachmentIndex 5 + Decorate 154(subpass_ms_u2) DescriptorSet 0 + Decorate 154(subpass_ms_u2) InputAttachmentIndex 6 + Decorate 162(subpass_f) DescriptorSet 0 + Decorate 162(subpass_f) InputAttachmentIndex 1 + Decorate 168(subpass_i) DescriptorSet 0 + Decorate 168(subpass_i) InputAttachmentIndex 2 + Decorate 174(subpass_u) DescriptorSet 0 + Decorate 174(subpass_u) InputAttachmentIndex 3 + Decorate 179(subpass_ms_f) DescriptorSet 0 + Decorate 179(subpass_ms_f) InputAttachmentIndex 4 + Decorate 184(subpass_ms_i) DescriptorSet 0 + Decorate 184(subpass_ms_i) InputAttachmentIndex 5 + Decorate 189(subpass_ms_u) DescriptorSet 0 + Decorate 189(subpass_ms_u) InputAttachmentIndex 6 + Decorate 194(subpass_2) DescriptorSet 0 + Decorate 194(subpass_2) InputAttachmentIndex 7 + Decorate 202(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypePointer Function 7(fvec4) + 13: TypeImage 6(float) SubpassData nonsampled format:Unknown + 14: TypePointer UniformConstant 13 + 15(subpass_f4): 14(ptr) Variable UniformConstant + 17: TypeInt 32 1 + 18: 17(int) Constant 0 + 19: TypeVector 17(int) 2 + 20: 19(ivec2) ConstantComposite 18 18 + 22: TypeVector 17(int) 4 + 23: TypePointer Function 22(ivec4) + 25: TypeImage 17(int) SubpassData nonsampled format:Unknown + 26: TypePointer UniformConstant 25 + 27(subpass_i4): 26(ptr) Variable UniformConstant + 30: TypeInt 32 0 + 31: TypeVector 30(int) 4 + 32: TypePointer Function 31(ivec4) + 34: TypeImage 30(int) SubpassData nonsampled format:Unknown + 35: TypePointer UniformConstant 34 + 36(subpass_u4): 35(ptr) Variable UniformConstant + 40: TypeImage 6(float) SubpassData multi-sampled nonsampled format:Unknown + 41: TypePointer UniformConstant 40 +42(subpass_ms_f4): 41(ptr) Variable UniformConstant + 44: 17(int) Constant 3 + 47: TypeImage 17(int) SubpassData multi-sampled nonsampled format:Unknown + 48: TypePointer UniformConstant 47 +49(subpass_ms_i4): 48(ptr) Variable UniformConstant + 53: TypeImage 30(int) SubpassData multi-sampled nonsampled format:Unknown + 54: TypePointer UniformConstant 53 +55(subpass_ms_u4): 54(ptr) Variable UniformConstant + 58: TypeVector 6(float) 3 + 59: TypePointer Function 58(fvec3) + 61(subpass_f3): 14(ptr) Variable UniformConstant + 68: TypeVector 17(int) 3 + 69: TypePointer Function 68(ivec3) + 71(subpass_i3): 26(ptr) Variable UniformConstant + 78: TypeVector 30(int) 3 + 79: TypePointer Function 78(ivec3) + 81(subpass_u3): 35(ptr) Variable UniformConstant +89(subpass_ms_f3): 41(ptr) Variable UniformConstant +97(subpass_ms_i3): 48(ptr) Variable UniformConstant +105(subpass_ms_u3): 54(ptr) Variable UniformConstant + 112: TypeVector 6(float) 2 + 113: TypePointer Function 112(fvec2) + 115(subpass_f2): 14(ptr) Variable UniformConstant + 121: TypePointer Function 19(ivec2) + 123(subpass_i2): 26(ptr) Variable UniformConstant + 129: TypeVector 30(int) 2 + 130: TypePointer Function 129(ivec2) + 132(subpass_u2): 35(ptr) Variable UniformConstant +139(subpass_ms_f2): 41(ptr) Variable UniformConstant + 141: 17(int) Constant 2 +147(subpass_ms_i2): 48(ptr) Variable UniformConstant +154(subpass_ms_u2): 54(ptr) Variable UniformConstant + 160: TypePointer Function 6(float) + 162(subpass_f): 14(ptr) Variable UniformConstant + 166: TypePointer Function 17(int) + 168(subpass_i): 26(ptr) Variable UniformConstant + 172: TypePointer Function 30(int) + 174(subpass_u): 35(ptr) Variable UniformConstant +179(subpass_ms_f): 41(ptr) Variable UniformConstant +184(subpass_ms_i): 48(ptr) Variable UniformConstant +189(subpass_ms_u): 54(ptr) Variable UniformConstant + 194(subpass_2): 14(ptr) Variable UniformConstant + 197: 6(float) Constant 0 + 198: 7(fvec4) ConstantComposite 197 197 197 197 + 201: TypePointer Output 7(fvec4) +202(@entryPointOutput): 201(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 203: 7(fvec4) FunctionCall 9(@main() + Store 202(@entryPointOutput) 203 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 12(result00): 11(ptr) Variable Function + 24(result01): 23(ptr) Variable Function + 33(result02): 32(ptr) Variable Function + 39(result10): 11(ptr) Variable Function + 46(result11): 23(ptr) Variable Function + 52(result12): 32(ptr) Variable Function + 60(result20): 59(ptr) Variable Function + 70(result21): 69(ptr) Variable Function + 80(result22): 79(ptr) Variable Function + 88(result30): 59(ptr) Variable Function + 96(result31): 69(ptr) Variable Function + 104(result32): 79(ptr) Variable Function + 114(result40): 113(ptr) Variable Function + 122(result41): 121(ptr) Variable Function + 131(result42): 130(ptr) Variable Function + 138(result50): 113(ptr) Variable Function + 146(result51): 121(ptr) Variable Function + 153(result52): 130(ptr) Variable Function + 161(result60): 160(ptr) Variable Function + 167(result61): 166(ptr) Variable Function + 173(result62): 172(ptr) Variable Function + 178(result70): 160(ptr) Variable Function + 183(result71): 166(ptr) Variable Function + 188(result72): 172(ptr) Variable Function + 193(result73): 11(ptr) Variable Function + 16: 13 Load 15(subpass_f4) + 21: 7(fvec4) ImageRead 16 20 + Store 12(result00) 21 + 28: 25 Load 27(subpass_i4) + 29: 22(ivec4) ImageRead 28 20 + Store 24(result01) 29 + 37: 34 Load 36(subpass_u4) + 38: 31(ivec4) ImageRead 37 20 + Store 33(result02) 38 + 43: 40 Load 42(subpass_ms_f4) + 45: 7(fvec4) ImageRead 43 20 Sample 44 + Store 39(result10) 45 + 50: 47 Load 49(subpass_ms_i4) + 51: 22(ivec4) ImageRead 50 20 Sample 44 + Store 46(result11) 51 + 56: 53 Load 55(subpass_ms_u4) + 57: 31(ivec4) ImageRead 56 20 Sample 44 + Store 52(result12) 57 + 62: 13 Load 61(subpass_f3) + 63: 7(fvec4) ImageRead 62 20 + 64: 6(float) CompositeExtract 63 0 + 65: 6(float) CompositeExtract 63 1 + 66: 6(float) CompositeExtract 63 2 + 67: 58(fvec3) CompositeConstruct 64 65 66 + Store 60(result20) 67 + 72: 25 Load 71(subpass_i3) + 73: 22(ivec4) ImageRead 72 20 + 74: 17(int) CompositeExtract 73 0 + 75: 17(int) CompositeExtract 73 1 + 76: 17(int) CompositeExtract 73 2 + 77: 68(ivec3) CompositeConstruct 74 75 76 + Store 70(result21) 77 + 82: 34 Load 81(subpass_u3) + 83: 31(ivec4) ImageRead 82 20 + 84: 30(int) CompositeExtract 83 0 + 85: 30(int) CompositeExtract 83 1 + 86: 30(int) CompositeExtract 83 2 + 87: 78(ivec3) CompositeConstruct 84 85 86 + Store 80(result22) 87 + 90: 40 Load 89(subpass_ms_f3) + 91: 7(fvec4) ImageRead 90 20 Sample 44 + 92: 6(float) CompositeExtract 91 0 + 93: 6(float) CompositeExtract 91 1 + 94: 6(float) CompositeExtract 91 2 + 95: 58(fvec3) CompositeConstruct 92 93 94 + Store 88(result30) 95 + 98: 47 Load 97(subpass_ms_i3) + 99: 22(ivec4) ImageRead 98 20 Sample 44 + 100: 17(int) CompositeExtract 99 0 + 101: 17(int) CompositeExtract 99 1 + 102: 17(int) CompositeExtract 99 2 + 103: 68(ivec3) CompositeConstruct 100 101 102 + Store 96(result31) 103 + 106: 53 Load 105(subpass_ms_u3) + 107: 31(ivec4) ImageRead 106 20 Sample 44 + 108: 30(int) CompositeExtract 107 0 + 109: 30(int) CompositeExtract 107 1 + 110: 30(int) CompositeExtract 107 2 + 111: 78(ivec3) CompositeConstruct 108 109 110 + Store 104(result32) 111 + 116: 13 Load 115(subpass_f2) + 117: 7(fvec4) ImageRead 116 20 + 118: 6(float) CompositeExtract 117 0 + 119: 6(float) CompositeExtract 117 1 + 120: 112(fvec2) CompositeConstruct 118 119 + Store 114(result40) 120 + 124: 25 Load 123(subpass_i2) + 125: 22(ivec4) ImageRead 124 20 + 126: 17(int) CompositeExtract 125 0 + 127: 17(int) CompositeExtract 125 1 + 128: 19(ivec2) CompositeConstruct 126 127 + Store 122(result41) 128 + 133: 34 Load 132(subpass_u2) + 134: 31(ivec4) ImageRead 133 20 + 135: 30(int) CompositeExtract 134 0 + 136: 30(int) CompositeExtract 134 1 + 137: 129(ivec2) CompositeConstruct 135 136 + Store 131(result42) 137 + 140: 40 Load 139(subpass_ms_f2) + 142: 7(fvec4) ImageRead 140 20 Sample 141 + 143: 6(float) CompositeExtract 142 0 + 144: 6(float) CompositeExtract 142 1 + 145: 112(fvec2) CompositeConstruct 143 144 + Store 138(result50) 145 + 148: 47 Load 147(subpass_ms_i2) + 149: 22(ivec4) ImageRead 148 20 Sample 141 + 150: 17(int) CompositeExtract 149 0 + 151: 17(int) CompositeExtract 149 1 + 152: 19(ivec2) CompositeConstruct 150 151 + Store 146(result51) 152 + 155: 53 Load 154(subpass_ms_u2) + 156: 31(ivec4) ImageRead 155 20 Sample 141 + 157: 30(int) CompositeExtract 156 0 + 158: 30(int) CompositeExtract 156 1 + 159: 129(ivec2) CompositeConstruct 157 158 + Store 153(result52) 159 + 163: 13 Load 162(subpass_f) + 164: 7(fvec4) ImageRead 163 20 + 165: 6(float) CompositeExtract 164 0 + Store 161(result60) 165 + 169: 25 Load 168(subpass_i) + 170: 22(ivec4) ImageRead 169 20 + 171: 17(int) CompositeExtract 170 0 + Store 167(result61) 171 + 175: 34 Load 174(subpass_u) + 176: 31(ivec4) ImageRead 175 20 + 177: 30(int) CompositeExtract 176 0 + Store 173(result62) 177 + 180: 40 Load 179(subpass_ms_f) + 181: 7(fvec4) ImageRead 180 20 Sample 141 + 182: 6(float) CompositeExtract 181 0 + Store 178(result70) 182 + 185: 47 Load 184(subpass_ms_i) + 186: 22(ivec4) ImageRead 185 20 Sample 141 + 187: 17(int) CompositeExtract 186 0 + Store 183(result71) 187 + 190: 53 Load 189(subpass_ms_u) + 191: 31(ivec4) ImageRead 190 20 Sample 141 + 192: 30(int) CompositeExtract 191 0 + Store 188(result72) 192 + 195: 13 Load 194(subpass_2) + 196: 7(fvec4) ImageRead 195 20 + Store 193(result73) 196 + ReturnValue 198 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.switch.frag.out b/deps/glslang/Test/baseResults/hlsl.switch.frag.out new file mode 100644 index 00000000..b72891ea --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.switch.frag.out @@ -0,0 +1,469 @@ +hlsl.switch.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(vf4;i1;i1; ( temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' ( in 4-component vector of float) +0:2 'c' ( in int) +0:2 'd' ( in int) +0:? Sequence +0:3 'c' ( in int) +0:7 switch +0:7 condition +0:7 'c' ( in int) +0:7 body +0:7 Sequence +0:9 default: +0:7 Sequence +0:7 Branch: Break +0:12 switch +0:12 condition +0:12 'c' ( in int) +0:12 body +0:12 Sequence +0:13 case: with expression +0:13 Constant: +0:13 1 (const int) +0:? Sequence +0:14 Pre-Increment ( temp 4-component vector of float) +0:14 'input' ( in 4-component vector of float) +0:15 Branch: Break +0:16 case: with expression +0:16 Constant: +0:16 2 (const int) +0:? Sequence +0:17 Pre-Decrement ( temp 4-component vector of float) +0:17 'input' ( in 4-component vector of float) +0:18 Branch: Break +0:21 switch: DontFlatten +0:21 condition +0:21 'c' ( in int) +0:21 body +0:21 Sequence +0:22 case: with expression +0:22 Constant: +0:22 1 (const int) +0:? Sequence +0:23 Pre-Increment ( temp 4-component vector of float) +0:23 'input' ( in 4-component vector of float) +0:24 Branch: Break +0:25 case: with expression +0:25 Constant: +0:25 2 (const int) +0:? Sequence +0:26 switch +0:26 condition +0:26 'd' ( in int) +0:26 body +0:26 Sequence +0:27 case: with expression +0:27 Constant: +0:27 2 (const int) +0:? Sequence +0:28 add second child into first child ( temp 4-component vector of float) +0:28 'input' ( in 4-component vector of float) +0:28 Constant: +0:28 2.000000 +0:29 Branch: Break +0:30 case: with expression +0:30 Constant: +0:30 3 (const int) +0:? Sequence +0:31 add second child into first child ( temp 4-component vector of float) +0:31 'input' ( in 4-component vector of float) +0:31 Constant: +0:31 3.000000 +0:32 Branch: Break +0:34 Branch: Break +0:35 default: +0:? Sequence +0:36 add second child into first child ( temp 4-component vector of float) +0:36 'input' ( in 4-component vector of float) +0:36 Constant: +0:36 4.000000 +0:39 switch +0:39 condition +0:39 'c' ( in int) +0:39 body +0:39 Sequence +0:40 case: with expression +0:40 Constant: +0:40 1 (const int) +0:39 Sequence +0:39 Branch: Break +0:43 switch +0:43 condition +0:43 'c' ( in int) +0:43 body +0:43 Sequence +0:44 case: with expression +0:44 Constant: +0:44 1 (const int) +0:45 case: with expression +0:45 Constant: +0:45 2 (const int) +0:46 case: with expression +0:46 Constant: +0:46 3 (const int) +0:? Sequence +0:47 Pre-Increment ( temp 4-component vector of float) +0:47 'input' ( in 4-component vector of float) +0:48 Branch: Break +0:49 case: with expression +0:49 Constant: +0:49 4 (const int) +0:50 case: with expression +0:50 Constant: +0:50 5 (const int) +0:? Sequence +0:51 Pre-Decrement ( temp 4-component vector of float) +0:51 'input' ( in 4-component vector of float) +0:54 Branch: Return with expression +0:54 'input' ( in 4-component vector of float) +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:2 move second child to first child ( temp int) +0:? 'c' ( temp int) +0:? 'c' (layout( location=1) flat in int) +0:2 move second child to first child ( temp int) +0:? 'd' ( temp int) +0:? 'd' (layout( location=2) flat in int) +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @PixelShaderFunction(vf4;i1;i1; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'c' ( temp int) +0:? 'd' ( temp int) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:? 'c' (layout( location=1) flat in int) +0:? 'd' (layout( location=2) flat in int) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(vf4;i1;i1; ( temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' ( in 4-component vector of float) +0:2 'c' ( in int) +0:2 'd' ( in int) +0:? Sequence +0:3 'c' ( in int) +0:7 switch +0:7 condition +0:7 'c' ( in int) +0:7 body +0:7 Sequence +0:9 default: +0:7 Sequence +0:7 Branch: Break +0:12 switch +0:12 condition +0:12 'c' ( in int) +0:12 body +0:12 Sequence +0:13 case: with expression +0:13 Constant: +0:13 1 (const int) +0:? Sequence +0:14 Pre-Increment ( temp 4-component vector of float) +0:14 'input' ( in 4-component vector of float) +0:15 Branch: Break +0:16 case: with expression +0:16 Constant: +0:16 2 (const int) +0:? Sequence +0:17 Pre-Decrement ( temp 4-component vector of float) +0:17 'input' ( in 4-component vector of float) +0:18 Branch: Break +0:21 switch: DontFlatten +0:21 condition +0:21 'c' ( in int) +0:21 body +0:21 Sequence +0:22 case: with expression +0:22 Constant: +0:22 1 (const int) +0:? Sequence +0:23 Pre-Increment ( temp 4-component vector of float) +0:23 'input' ( in 4-component vector of float) +0:24 Branch: Break +0:25 case: with expression +0:25 Constant: +0:25 2 (const int) +0:? Sequence +0:26 switch +0:26 condition +0:26 'd' ( in int) +0:26 body +0:26 Sequence +0:27 case: with expression +0:27 Constant: +0:27 2 (const int) +0:? Sequence +0:28 add second child into first child ( temp 4-component vector of float) +0:28 'input' ( in 4-component vector of float) +0:28 Constant: +0:28 2.000000 +0:29 Branch: Break +0:30 case: with expression +0:30 Constant: +0:30 3 (const int) +0:? Sequence +0:31 add second child into first child ( temp 4-component vector of float) +0:31 'input' ( in 4-component vector of float) +0:31 Constant: +0:31 3.000000 +0:32 Branch: Break +0:34 Branch: Break +0:35 default: +0:? Sequence +0:36 add second child into first child ( temp 4-component vector of float) +0:36 'input' ( in 4-component vector of float) +0:36 Constant: +0:36 4.000000 +0:39 switch +0:39 condition +0:39 'c' ( in int) +0:39 body +0:39 Sequence +0:40 case: with expression +0:40 Constant: +0:40 1 (const int) +0:39 Sequence +0:39 Branch: Break +0:43 switch +0:43 condition +0:43 'c' ( in int) +0:43 body +0:43 Sequence +0:44 case: with expression +0:44 Constant: +0:44 1 (const int) +0:45 case: with expression +0:45 Constant: +0:45 2 (const int) +0:46 case: with expression +0:46 Constant: +0:46 3 (const int) +0:? Sequence +0:47 Pre-Increment ( temp 4-component vector of float) +0:47 'input' ( in 4-component vector of float) +0:48 Branch: Break +0:49 case: with expression +0:49 Constant: +0:49 4 (const int) +0:50 case: with expression +0:50 Constant: +0:50 5 (const int) +0:? Sequence +0:51 Pre-Decrement ( temp 4-component vector of float) +0:51 'input' ( in 4-component vector of float) +0:54 Branch: Return with expression +0:54 'input' ( in 4-component vector of float) +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:2 move second child to first child ( temp int) +0:? 'c' ( temp int) +0:? 'c' (layout( location=1) flat in int) +0:2 move second child to first child ( temp int) +0:? 'd' ( temp int) +0:? 'd' (layout( location=2) flat in int) +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @PixelShaderFunction(vf4;i1;i1; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'c' ( temp int) +0:? 'd' ( temp int) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:? 'c' (layout( location=1) flat in int) +0:? 'd' (layout( location=2) flat in int) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 106 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 88 92 95 98 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 15 "@PixelShaderFunction(vf4;i1;i1;" + Name 12 "input" + Name 13 "c" + Name 14 "d" + Name 86 "input" + Name 88 "input" + Name 90 "c" + Name 92 "c" + Name 94 "d" + Name 95 "d" + Name 98 "@entryPointOutput" + Name 99 "param" + Name 101 "param" + Name 103 "param" + Decorate 88(input) Location 0 + Decorate 92(c) Flat + Decorate 92(c) Location 1 + Decorate 95(d) Flat + Decorate 95(d) Location 2 + Decorate 98(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeInt 32 1 + 10: TypePointer Function 9(int) + 11: TypeFunction 7(fvec4) 8(ptr) 10(ptr) 10(ptr) + 27: 6(float) Constant 1065353216 + 49: 6(float) Constant 1073741824 + 54: 6(float) Constant 1077936128 + 61: 6(float) Constant 1082130432 + 87: TypePointer Input 7(fvec4) + 88(input): 87(ptr) Variable Input + 91: TypePointer Input 9(int) + 92(c): 91(ptr) Variable Input + 95(d): 91(ptr) Variable Input + 97: TypePointer Output 7(fvec4) +98(@entryPointOutput): 97(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 86(input): 8(ptr) Variable Function + 90(c): 10(ptr) Variable Function + 94(d): 10(ptr) Variable Function + 99(param): 8(ptr) Variable Function + 101(param): 10(ptr) Variable Function + 103(param): 10(ptr) Variable Function + 89: 7(fvec4) Load 88(input) + Store 86(input) 89 + 93: 9(int) Load 92(c) + Store 90(c) 93 + 96: 9(int) Load 95(d) + Store 94(d) 96 + 100: 7(fvec4) Load 86(input) + Store 99(param) 100 + 102: 9(int) Load 90(c) + Store 101(param) 102 + 104: 9(int) Load 94(d) + Store 103(param) 104 + 105: 7(fvec4) FunctionCall 15(@PixelShaderFunction(vf4;i1;i1;) 99(param) 101(param) 103(param) + Store 98(@entryPointOutput) 105 + Return + FunctionEnd +15(@PixelShaderFunction(vf4;i1;i1;): 7(fvec4) Function None 11 + 12(input): 8(ptr) FunctionParameter + 13(c): 10(ptr) FunctionParameter + 14(d): 10(ptr) FunctionParameter + 16: Label + 17: 9(int) Load 13(c) + SelectionMerge 19 None + Switch 17 18 + 18: Label + Branch 19 + 19: Label + 22: 9(int) Load 13(c) + SelectionMerge 25 None + Switch 22 25 + case 1: 23 + case 2: 24 + 23: Label + 26: 7(fvec4) Load 12(input) + 28: 7(fvec4) CompositeConstruct 27 27 27 27 + 29: 7(fvec4) FAdd 26 28 + Store 12(input) 29 + Branch 25 + 24: Label + 31: 7(fvec4) Load 12(input) + 32: 7(fvec4) CompositeConstruct 27 27 27 27 + 33: 7(fvec4) FSub 31 32 + Store 12(input) 33 + Branch 25 + 25: Label + 36: 9(int) Load 13(c) + SelectionMerge 40 DontFlatten + Switch 36 39 + case 1: 37 + case 2: 38 + 39: Label + 62: 7(fvec4) Load 12(input) + 63: 7(fvec4) CompositeConstruct 61 61 61 61 + 64: 7(fvec4) FAdd 62 63 + Store 12(input) 64 + Branch 40 + 37: Label + 41: 7(fvec4) Load 12(input) + 42: 7(fvec4) CompositeConstruct 27 27 27 27 + 43: 7(fvec4) FAdd 41 42 + Store 12(input) 43 + Branch 40 + 38: Label + 45: 9(int) Load 14(d) + SelectionMerge 48 None + Switch 45 48 + case 2: 46 + case 3: 47 + 46: Label + 50: 7(fvec4) Load 12(input) + 51: 7(fvec4) CompositeConstruct 49 49 49 49 + 52: 7(fvec4) FAdd 50 51 + Store 12(input) 52 + Branch 48 + 47: Label + 55: 7(fvec4) Load 12(input) + 56: 7(fvec4) CompositeConstruct 54 54 54 54 + 57: 7(fvec4) FAdd 55 56 + Store 12(input) 57 + Branch 48 + 48: Label + Branch 40 + 40: Label + 66: 9(int) Load 13(c) + SelectionMerge 68 None + Switch 66 68 + case 1: 67 + 67: Label + Branch 68 + 68: Label + 71: 9(int) Load 13(c) + SelectionMerge 74 None + Switch 71 74 + case 1: 72 + case 2: 72 + case 3: 72 + case 4: 73 + case 5: 73 + 72: Label + 75: 7(fvec4) Load 12(input) + 76: 7(fvec4) CompositeConstruct 27 27 27 27 + 77: 7(fvec4) FAdd 75 76 + Store 12(input) 77 + Branch 74 + 73: Label + 79: 7(fvec4) Load 12(input) + 80: 7(fvec4) CompositeConstruct 27 27 27 27 + 81: 7(fvec4) FSub 79 80 + Store 12(input) 81 + Branch 74 + 74: Label + 83: 7(fvec4) Load 12(input) + ReturnValue 83 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.swizzle.frag.out b/deps/glslang/Test/baseResults/hlsl.swizzle.frag.out new file mode 100644 index 00000000..c734d509 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.swizzle.frag.out @@ -0,0 +1,123 @@ +hlsl.swizzle.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:1 Sequence +0:1 move second child to first child ( temp 4-component vector of float) +0:1 'AmbientColor' ( global 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 0.500000 +0:? 0.000000 +0:? 1.000000 +0:4 Function Definition: ShaderFunction(vf4; ( temp 4-component vector of float) +0:4 Function Parameters: +0:4 'input' ( in 4-component vector of float) +0:? Sequence +0:5 Branch: Return with expression +0:5 component-wise multiply ( temp 4-component vector of float) +0:5 vector swizzle ( temp 4-component vector of float) +0:5 'input' ( in 4-component vector of float) +0:5 Sequence +0:5 Constant: +0:5 3 (const int) +0:5 Constant: +0:5 3 (const int) +0:5 Constant: +0:5 1 (const int) +0:5 Constant: +0:5 0 (const int) +0:5 Construct vec4 ( temp 4-component vector of float) +0:5 direct index ( temp float) +0:5 'AmbientColor' ( global 4-component vector of float) +0:5 Constant: +0:5 2 (const int) +0:? Linker Objects +0:? 'AmbientColor' ( global 4-component vector of float) + + +Linked fragment stage: + +WARNING: Linking fragment stage: Entry point not found + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:1 Sequence +0:1 move second child to first child ( temp 4-component vector of float) +0:1 'AmbientColor' ( global 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 0.500000 +0:? 0.000000 +0:? 1.000000 +0:4 Function Definition: ShaderFunction(vf4; ( temp 4-component vector of float) +0:4 Function Parameters: +0:4 'input' ( in 4-component vector of float) +0:? Sequence +0:5 Branch: Return with expression +0:5 component-wise multiply ( temp 4-component vector of float) +0:5 vector swizzle ( temp 4-component vector of float) +0:5 'input' ( in 4-component vector of float) +0:5 Sequence +0:5 Constant: +0:5 3 (const int) +0:5 Constant: +0:5 3 (const int) +0:5 Constant: +0:5 1 (const int) +0:5 Constant: +0:5 0 (const int) +0:5 Construct vec4 ( temp 4-component vector of float) +0:5 direct index ( temp float) +0:5 'AmbientColor' ( global 4-component vector of float) +0:5 Constant: +0:5 2 (const int) +0:? Linker Objects +0:? 'AmbientColor' ( global 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 30 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 11 "ShaderFunction(vf4;" + Name 10 "input" + Name 14 "AmbientColor" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) + 13: TypePointer Private 7(fvec4) +14(AmbientColor): 13(ptr) Variable Private + 15: 6(float) Constant 1065353216 + 16: 6(float) Constant 1056964608 + 17: 6(float) Constant 0 + 18: 7(fvec4) ConstantComposite 15 16 17 15 + 21: TypeInt 32 0 + 22: 21(int) Constant 2 + 23: TypePointer Private 6(float) +4(PixelShaderFunction): 2 Function None 3 + 5: Label + Store 14(AmbientColor) 18 + Return + FunctionEnd +11(ShaderFunction(vf4;): 7(fvec4) Function None 9 + 10(input): 8(ptr) FunctionParameter + 12: Label + 19: 7(fvec4) Load 10(input) + 20: 7(fvec4) VectorShuffle 19 19 3 3 1 0 + 24: 23(ptr) AccessChain 14(AmbientColor) 22 + 25: 6(float) Load 24 + 26: 7(fvec4) CompositeConstruct 25 25 25 25 + 27: 7(fvec4) FMul 20 26 + ReturnValue 27 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.synthesizeInput.frag.out b/deps/glslang/Test/baseResults/hlsl.synthesizeInput.frag.out new file mode 100644 index 00000000..bbe97434 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.synthesizeInput.frag.out @@ -0,0 +1,172 @@ +hlsl.synthesizeInput.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main(struct-PSInput-f1-u11; ( temp 4-component vector of float) +0:7 Function Parameters: +0:7 'input' ( in structure{ temp float interp, temp uint no_interp}) +0:? Sequence +0:8 Branch: Return with expression +0:? Construct vec4 ( temp 4-component vector of float) +0:8 Convert uint to float ( temp float) +0:8 no_interp: direct index for structure ( temp uint) +0:8 'input' ( in structure{ temp float interp, temp uint no_interp}) +0:8 Constant: +0:8 1 (const int) +0:8 interp: direct index for structure ( temp float) +0:8 'input' ( in structure{ temp float interp, temp uint no_interp}) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 0.000000 +0:8 Constant: +0:8 1.000000 +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp float) +0:7 interp: direct index for structure ( temp float) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:7 Constant: +0:7 0 (const int) +0:? 'input.interp' (layout( location=0) in float) +0:7 move second child to first child ( temp uint) +0:7 no_interp: direct index for structure ( temp uint) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:7 Constant: +0:7 1 (const int) +0:? 'input.no_interp' (layout( location=1) flat in uint) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main(struct-PSInput-f1-u11; ( temp 4-component vector of float) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input.interp' (layout( location=0) in float) +0:? 'input.no_interp' (layout( location=1) flat in uint) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main(struct-PSInput-f1-u11; ( temp 4-component vector of float) +0:7 Function Parameters: +0:7 'input' ( in structure{ temp float interp, temp uint no_interp}) +0:? Sequence +0:8 Branch: Return with expression +0:? Construct vec4 ( temp 4-component vector of float) +0:8 Convert uint to float ( temp float) +0:8 no_interp: direct index for structure ( temp uint) +0:8 'input' ( in structure{ temp float interp, temp uint no_interp}) +0:8 Constant: +0:8 1 (const int) +0:8 interp: direct index for structure ( temp float) +0:8 'input' ( in structure{ temp float interp, temp uint no_interp}) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 0.000000 +0:8 Constant: +0:8 1.000000 +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp float) +0:7 interp: direct index for structure ( temp float) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:7 Constant: +0:7 0 (const int) +0:? 'input.interp' (layout( location=0) in float) +0:7 move second child to first child ( temp uint) +0:7 no_interp: direct index for structure ( temp uint) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:7 Constant: +0:7 1 (const int) +0:? 'input.no_interp' (layout( location=1) flat in uint) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main(struct-PSInput-f1-u11; ( temp 4-component vector of float) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input.interp' (layout( location=0) in float) +0:? 'input.no_interp' (layout( location=1) flat in uint) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 44 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 32 36 40 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PSInput" + MemberName 8(PSInput) 0 "interp" + MemberName 8(PSInput) 1 "no_interp" + Name 13 "@main(struct-PSInput-f1-u11;" + Name 12 "input" + Name 30 "input" + Name 32 "input.interp" + Name 36 "input.no_interp" + Name 40 "@entryPointOutput" + Name 41 "param" + Decorate 32(input.interp) Location 0 + Decorate 36(input.no_interp) Flat + Decorate 36(input.no_interp) Location 1 + Decorate 40(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeInt 32 0 + 8(PSInput): TypeStruct 6(float) 7(int) + 9: TypePointer Function 8(PSInput) + 10: TypeVector 6(float) 4 + 11: TypeFunction 10(fvec4) 9(ptr) + 15: TypeInt 32 1 + 16: 15(int) Constant 1 + 17: TypePointer Function 7(int) + 21: 15(int) Constant 0 + 22: TypePointer Function 6(float) + 25: 6(float) Constant 0 + 26: 6(float) Constant 1065353216 + 31: TypePointer Input 6(float) +32(input.interp): 31(ptr) Variable Input + 35: TypePointer Input 7(int) +36(input.no_interp): 35(ptr) Variable Input + 39: TypePointer Output 10(fvec4) +40(@entryPointOutput): 39(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 30(input): 9(ptr) Variable Function + 41(param): 9(ptr) Variable Function + 33: 6(float) Load 32(input.interp) + 34: 22(ptr) AccessChain 30(input) 21 + Store 34 33 + 37: 7(int) Load 36(input.no_interp) + 38: 17(ptr) AccessChain 30(input) 16 + Store 38 37 + 42: 8(PSInput) Load 30(input) + Store 41(param) 42 + 43: 10(fvec4) FunctionCall 13(@main(struct-PSInput-f1-u11;) 41(param) + Store 40(@entryPointOutput) 43 + Return + FunctionEnd +13(@main(struct-PSInput-f1-u11;): 10(fvec4) Function None 11 + 12(input): 9(ptr) FunctionParameter + 14: Label + 18: 17(ptr) AccessChain 12(input) 16 + 19: 7(int) Load 18 + 20: 6(float) ConvertUToF 19 + 23: 22(ptr) AccessChain 12(input) 21 + 24: 6(float) Load 23 + 27: 10(fvec4) CompositeConstruct 20 24 25 26 + ReturnValue 27 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.target.frag.out b/deps/glslang/Test/baseResults/hlsl.target.frag.out new file mode 100644 index 00000000..00017968 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.target.frag.out @@ -0,0 +1,209 @@ +hlsl.target.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main(struct-PSInput-f1-u11;vf4;vf4; ( temp void) +0:7 Function Parameters: +0:7 'input' ( in structure{ temp float interp, temp uint no_interp}) +0:7 'out1' ( out 4-component vector of float) +0:7 'out2' ( out 4-component vector of float) +0:? Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'out1' ( out 4-component vector of float) +0:8 Constant: +0:8 1.000000 +0:8 1.000000 +0:8 1.000000 +0:8 1.000000 +0:9 move second child to first child ( temp 4-component vector of float) +0:9 'out2' ( out 4-component vector of float) +0:9 Constant: +0:9 0.000000 +0:9 0.000000 +0:9 0.000000 +0:9 0.000000 +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp float) +0:7 interp: direct index for structure ( temp float) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:7 Constant: +0:7 0 (const int) +0:? 'input.interp' (layout( location=0) in float) +0:7 move second child to first child ( temp uint) +0:7 no_interp: direct index for structure ( temp uint) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:7 Constant: +0:7 1 (const int) +0:? 'input.no_interp' (layout( location=1) flat in uint) +0:7 Function Call: @main(struct-PSInput-f1-u11;vf4;vf4; ( temp void) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:? 'out1' ( temp 4-component vector of float) +0:? 'out2' ( temp 4-component vector of float) +0:7 move second child to first child ( temp 4-component vector of float) +0:? 'out1' (layout( location=1) out 4-component vector of float) +0:? 'out1' ( temp 4-component vector of float) +0:7 move second child to first child ( temp 4-component vector of float) +0:? 'out2' (layout( location=3) out 4-component vector of float) +0:? 'out2' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'input.interp' (layout( location=0) in float) +0:? 'input.no_interp' (layout( location=1) flat in uint) +0:? 'out1' (layout( location=1) out 4-component vector of float) +0:? 'out2' (layout( location=3) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main(struct-PSInput-f1-u11;vf4;vf4; ( temp void) +0:7 Function Parameters: +0:7 'input' ( in structure{ temp float interp, temp uint no_interp}) +0:7 'out1' ( out 4-component vector of float) +0:7 'out2' ( out 4-component vector of float) +0:? Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'out1' ( out 4-component vector of float) +0:8 Constant: +0:8 1.000000 +0:8 1.000000 +0:8 1.000000 +0:8 1.000000 +0:9 move second child to first child ( temp 4-component vector of float) +0:9 'out2' ( out 4-component vector of float) +0:9 Constant: +0:9 0.000000 +0:9 0.000000 +0:9 0.000000 +0:9 0.000000 +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp float) +0:7 interp: direct index for structure ( temp float) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:7 Constant: +0:7 0 (const int) +0:? 'input.interp' (layout( location=0) in float) +0:7 move second child to first child ( temp uint) +0:7 no_interp: direct index for structure ( temp uint) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:7 Constant: +0:7 1 (const int) +0:? 'input.no_interp' (layout( location=1) flat in uint) +0:7 Function Call: @main(struct-PSInput-f1-u11;vf4;vf4; ( temp void) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:? 'out1' ( temp 4-component vector of float) +0:? 'out2' ( temp 4-component vector of float) +0:7 move second child to first child ( temp 4-component vector of float) +0:? 'out1' (layout( location=1) out 4-component vector of float) +0:? 'out1' ( temp 4-component vector of float) +0:7 move second child to first child ( temp 4-component vector of float) +0:? 'out2' (layout( location=3) out 4-component vector of float) +0:? 'out2' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'input.interp' (layout( location=0) in float) +0:? 'input.no_interp' (layout( location=1) flat in uint) +0:? 'out1' (layout( location=1) out 4-component vector of float) +0:? 'out2' (layout( location=3) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 50 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 26 32 46 48 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PSInput" + MemberName 8(PSInput) 0 "interp" + MemberName 8(PSInput) 1 "no_interp" + Name 16 "@main(struct-PSInput-f1-u11;vf4;vf4;" + Name 13 "input" + Name 14 "out1" + Name 15 "out2" + Name 22 "input" + Name 26 "input.interp" + Name 32 "input.no_interp" + Name 36 "out1" + Name 37 "out2" + Name 38 "param" + Name 40 "param" + Name 41 "param" + Name 46 "out1" + Name 48 "out2" + Decorate 26(input.interp) Location 0 + Decorate 32(input.no_interp) Flat + Decorate 32(input.no_interp) Location 1 + Decorate 46(out1) Location 1 + Decorate 48(out2) Location 3 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeInt 32 0 + 8(PSInput): TypeStruct 6(float) 7(int) + 9: TypePointer Function 8(PSInput) + 10: TypeVector 6(float) 4 + 11: TypePointer Function 10(fvec4) + 12: TypeFunction 2 9(ptr) 11(ptr) 11(ptr) + 18: 6(float) Constant 1065353216 + 19: 10(fvec4) ConstantComposite 18 18 18 18 + 20: 6(float) Constant 0 + 21: 10(fvec4) ConstantComposite 20 20 20 20 + 23: TypeInt 32 1 + 24: 23(int) Constant 0 + 25: TypePointer Input 6(float) +26(input.interp): 25(ptr) Variable Input + 28: TypePointer Function 6(float) + 30: 23(int) Constant 1 + 31: TypePointer Input 7(int) +32(input.no_interp): 31(ptr) Variable Input + 34: TypePointer Function 7(int) + 45: TypePointer Output 10(fvec4) + 46(out1): 45(ptr) Variable Output + 48(out2): 45(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 22(input): 9(ptr) Variable Function + 36(out1): 11(ptr) Variable Function + 37(out2): 11(ptr) Variable Function + 38(param): 9(ptr) Variable Function + 40(param): 11(ptr) Variable Function + 41(param): 11(ptr) Variable Function + 27: 6(float) Load 26(input.interp) + 29: 28(ptr) AccessChain 22(input) 24 + Store 29 27 + 33: 7(int) Load 32(input.no_interp) + 35: 34(ptr) AccessChain 22(input) 30 + Store 35 33 + 39: 8(PSInput) Load 22(input) + Store 38(param) 39 + 42: 2 FunctionCall 16(@main(struct-PSInput-f1-u11;vf4;vf4;) 38(param) 40(param) 41(param) + 43: 10(fvec4) Load 40(param) + Store 36(out1) 43 + 44: 10(fvec4) Load 41(param) + Store 37(out2) 44 + 47: 10(fvec4) Load 36(out1) + Store 46(out1) 47 + 49: 10(fvec4) Load 37(out2) + Store 48(out2) 49 + Return + FunctionEnd +16(@main(struct-PSInput-f1-u11;vf4;vf4;): 2 Function None 12 + 13(input): 9(ptr) FunctionParameter + 14(out1): 11(ptr) FunctionParameter + 15(out2): 11(ptr) FunctionParameter + 17: Label + Store 14(out1) 19 + Store 15(out2) 21 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.targetStruct1.frag.out b/deps/glslang/Test/baseResults/hlsl.targetStruct1.frag.out new file mode 100644 index 00000000..371ce2a1 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.targetStruct1.frag.out @@ -0,0 +1,298 @@ +hlsl.targetStruct1.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: @main(struct-PSInput-f1-u11;vf4; ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 Function Parameters: +0:12 'input' ( in structure{ temp float interp, temp uint no_interp}) +0:12 'po' ( out 4-component vector of float) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 o1: direct index for structure ( temp 4-component vector of float) +0:14 'pso' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:14 Constant: +0:14 0 (const int) +0:? Construct vec4 ( temp 4-component vector of float) +0:14 Convert uint to float ( temp float) +0:14 no_interp: direct index for structure ( temp uint) +0:14 'input' ( in structure{ temp float interp, temp uint no_interp}) +0:14 Constant: +0:14 1 (const int) +0:14 interp: direct index for structure ( temp float) +0:14 'input' ( in structure{ temp float interp, temp uint no_interp}) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0.000000 +0:14 Constant: +0:14 1.000000 +0:15 move second child to first child ( temp 4-component vector of float) +0:15 o2: direct index for structure ( temp 4-component vector of float) +0:15 'pso' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:15 Constant: +0:15 1 (const int) +0:15 Constant: +0:15 1.000000 +0:15 1.000000 +0:15 1.000000 +0:15 1.000000 +0:16 move second child to first child ( temp 4-component vector of float) +0:16 'po' ( out 4-component vector of float) +0:16 Constant: +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:18 Branch: Return with expression +0:18 'pso' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 Sequence +0:12 move second child to first child ( temp float) +0:12 interp: direct index for structure ( temp float) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:12 Constant: +0:12 0 (const int) +0:? 'input.interp' (layout( location=0) in float) +0:12 move second child to first child ( temp uint) +0:12 no_interp: direct index for structure ( temp uint) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:12 Constant: +0:12 1 (const int) +0:? 'input.no_interp' (layout( location=1) flat in uint) +0:12 Sequence +0:12 move second child to first child ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 'flattenTemp' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 Function Call: @main(struct-PSInput-f1-u11;vf4; ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:? 'po' ( temp 4-component vector of float) +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.o1' (layout( location=2) out 4-component vector of float) +0:12 o1: direct index for structure ( temp 4-component vector of float) +0:12 'flattenTemp' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 Constant: +0:12 0 (const int) +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.o2' (layout( location=1) out 4-component vector of float) +0:12 o2: direct index for structure ( temp 4-component vector of float) +0:12 'flattenTemp' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 Constant: +0:12 1 (const int) +0:12 move second child to first child ( temp 4-component vector of float) +0:? 'po' (layout( location=0) out 4-component vector of float) +0:? 'po' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput.o1' (layout( location=2) out 4-component vector of float) +0:? '@entryPointOutput.o2' (layout( location=1) out 4-component vector of float) +0:? 'input.interp' (layout( location=0) in float) +0:? 'input.no_interp' (layout( location=1) flat in uint) +0:? 'po' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: @main(struct-PSInput-f1-u11;vf4; ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 Function Parameters: +0:12 'input' ( in structure{ temp float interp, temp uint no_interp}) +0:12 'po' ( out 4-component vector of float) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 o1: direct index for structure ( temp 4-component vector of float) +0:14 'pso' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:14 Constant: +0:14 0 (const int) +0:? Construct vec4 ( temp 4-component vector of float) +0:14 Convert uint to float ( temp float) +0:14 no_interp: direct index for structure ( temp uint) +0:14 'input' ( in structure{ temp float interp, temp uint no_interp}) +0:14 Constant: +0:14 1 (const int) +0:14 interp: direct index for structure ( temp float) +0:14 'input' ( in structure{ temp float interp, temp uint no_interp}) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0.000000 +0:14 Constant: +0:14 1.000000 +0:15 move second child to first child ( temp 4-component vector of float) +0:15 o2: direct index for structure ( temp 4-component vector of float) +0:15 'pso' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:15 Constant: +0:15 1 (const int) +0:15 Constant: +0:15 1.000000 +0:15 1.000000 +0:15 1.000000 +0:15 1.000000 +0:16 move second child to first child ( temp 4-component vector of float) +0:16 'po' ( out 4-component vector of float) +0:16 Constant: +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:18 Branch: Return with expression +0:18 'pso' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 Sequence +0:12 move second child to first child ( temp float) +0:12 interp: direct index for structure ( temp float) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:12 Constant: +0:12 0 (const int) +0:? 'input.interp' (layout( location=0) in float) +0:12 move second child to first child ( temp uint) +0:12 no_interp: direct index for structure ( temp uint) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:12 Constant: +0:12 1 (const int) +0:? 'input.no_interp' (layout( location=1) flat in uint) +0:12 Sequence +0:12 move second child to first child ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 'flattenTemp' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 Function Call: @main(struct-PSInput-f1-u11;vf4; ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:? 'po' ( temp 4-component vector of float) +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.o1' (layout( location=2) out 4-component vector of float) +0:12 o1: direct index for structure ( temp 4-component vector of float) +0:12 'flattenTemp' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 Constant: +0:12 0 (const int) +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.o2' (layout( location=1) out 4-component vector of float) +0:12 o2: direct index for structure ( temp 4-component vector of float) +0:12 'flattenTemp' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 Constant: +0:12 1 (const int) +0:12 move second child to first child ( temp 4-component vector of float) +0:? 'po' (layout( location=0) out 4-component vector of float) +0:? 'po' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput.o1' (layout( location=2) out 4-component vector of float) +0:? '@entryPointOutput.o2' (layout( location=1) out 4-component vector of float) +0:? 'input.interp' (layout( location=0) in float) +0:? 'input.no_interp' (layout( location=1) flat in uint) +0:? 'po' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 65 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 42 46 57 60 63 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PSInput" + MemberName 8(PSInput) 0 "interp" + MemberName 8(PSInput) 1 "no_interp" + Name 12 "PSOutput" + MemberName 12(PSOutput) 0 "o1" + MemberName 12(PSOutput) 1 "o2" + Name 16 "@main(struct-PSInput-f1-u11;vf4;" + Name 14 "input" + Name 15 "po" + Name 19 "pso" + Name 40 "input" + Name 42 "input.interp" + Name 46 "input.no_interp" + Name 49 "flattenTemp" + Name 50 "po" + Name 51 "param" + Name 53 "param" + Name 57 "@entryPointOutput.o1" + Name 60 "@entryPointOutput.o2" + Name 63 "po" + Decorate 42(input.interp) Location 0 + Decorate 46(input.no_interp) Flat + Decorate 46(input.no_interp) Location 1 + Decorate 57(@entryPointOutput.o1) Location 2 + Decorate 60(@entryPointOutput.o2) Location 1 + Decorate 63(po) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeInt 32 0 + 8(PSInput): TypeStruct 6(float) 7(int) + 9: TypePointer Function 8(PSInput) + 10: TypeVector 6(float) 4 + 11: TypePointer Function 10(fvec4) + 12(PSOutput): TypeStruct 10(fvec4) 10(fvec4) + 13: TypeFunction 12(PSOutput) 9(ptr) 11(ptr) + 18: TypePointer Function 12(PSOutput) + 20: TypeInt 32 1 + 21: 20(int) Constant 0 + 22: 20(int) Constant 1 + 23: TypePointer Function 7(int) + 27: TypePointer Function 6(float) + 30: 6(float) Constant 0 + 31: 6(float) Constant 1065353216 + 34: 10(fvec4) ConstantComposite 31 31 31 31 + 36: 10(fvec4) ConstantComposite 30 30 30 30 + 41: TypePointer Input 6(float) +42(input.interp): 41(ptr) Variable Input + 45: TypePointer Input 7(int) +46(input.no_interp): 45(ptr) Variable Input + 56: TypePointer Output 10(fvec4) +57(@entryPointOutput.o1): 56(ptr) Variable Output +60(@entryPointOutput.o2): 56(ptr) Variable Output + 63(po): 56(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 40(input): 9(ptr) Variable Function + 49(flattenTemp): 18(ptr) Variable Function + 50(po): 11(ptr) Variable Function + 51(param): 9(ptr) Variable Function + 53(param): 11(ptr) Variable Function + 43: 6(float) Load 42(input.interp) + 44: 27(ptr) AccessChain 40(input) 21 + Store 44 43 + 47: 7(int) Load 46(input.no_interp) + 48: 23(ptr) AccessChain 40(input) 22 + Store 48 47 + 52: 8(PSInput) Load 40(input) + Store 51(param) 52 + 54:12(PSOutput) FunctionCall 16(@main(struct-PSInput-f1-u11;vf4;) 51(param) 53(param) + 55: 10(fvec4) Load 53(param) + Store 50(po) 55 + Store 49(flattenTemp) 54 + 58: 11(ptr) AccessChain 49(flattenTemp) 21 + 59: 10(fvec4) Load 58 + Store 57(@entryPointOutput.o1) 59 + 61: 11(ptr) AccessChain 49(flattenTemp) 22 + 62: 10(fvec4) Load 61 + Store 60(@entryPointOutput.o2) 62 + 64: 10(fvec4) Load 50(po) + Store 63(po) 64 + Return + FunctionEnd +16(@main(struct-PSInput-f1-u11;vf4;):12(PSOutput) Function None 13 + 14(input): 9(ptr) FunctionParameter + 15(po): 11(ptr) FunctionParameter + 17: Label + 19(pso): 18(ptr) Variable Function + 24: 23(ptr) AccessChain 14(input) 22 + 25: 7(int) Load 24 + 26: 6(float) ConvertUToF 25 + 28: 27(ptr) AccessChain 14(input) 21 + 29: 6(float) Load 28 + 32: 10(fvec4) CompositeConstruct 26 29 30 31 + 33: 11(ptr) AccessChain 19(pso) 21 + Store 33 32 + 35: 11(ptr) AccessChain 19(pso) 22 + Store 35 34 + Store 15(po) 36 + 37:12(PSOutput) Load 19(pso) + ReturnValue 37 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.targetStruct2.frag.out b/deps/glslang/Test/baseResults/hlsl.targetStruct2.frag.out new file mode 100644 index 00000000..e6099c9e --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.targetStruct2.frag.out @@ -0,0 +1,298 @@ +hlsl.targetStruct2.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: @main(struct-PSInput-f1-u11;vf4; ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 Function Parameters: +0:12 'input' ( in structure{ temp float interp, temp uint no_interp}) +0:12 'po' ( out 4-component vector of float) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 o1: direct index for structure ( temp 4-component vector of float) +0:14 'pso' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:14 Constant: +0:14 0 (const int) +0:? Construct vec4 ( temp 4-component vector of float) +0:14 Convert uint to float ( temp float) +0:14 no_interp: direct index for structure ( temp uint) +0:14 'input' ( in structure{ temp float interp, temp uint no_interp}) +0:14 Constant: +0:14 1 (const int) +0:14 interp: direct index for structure ( temp float) +0:14 'input' ( in structure{ temp float interp, temp uint no_interp}) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0.000000 +0:14 Constant: +0:14 1.000000 +0:15 move second child to first child ( temp 4-component vector of float) +0:15 o2: direct index for structure ( temp 4-component vector of float) +0:15 'pso' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:15 Constant: +0:15 1 (const int) +0:15 Constant: +0:15 1.000000 +0:15 1.000000 +0:15 1.000000 +0:15 1.000000 +0:16 move second child to first child ( temp 4-component vector of float) +0:16 'po' ( out 4-component vector of float) +0:16 Constant: +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:18 Branch: Return with expression +0:18 'pso' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 Sequence +0:12 move second child to first child ( temp float) +0:12 interp: direct index for structure ( temp float) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:12 Constant: +0:12 0 (const int) +0:? 'input.interp' (layout( location=0) in float) +0:12 move second child to first child ( temp uint) +0:12 no_interp: direct index for structure ( temp uint) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:12 Constant: +0:12 1 (const int) +0:? 'input.no_interp' (layout( location=1) flat in uint) +0:12 Sequence +0:12 move second child to first child ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 'flattenTemp' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 Function Call: @main(struct-PSInput-f1-u11;vf4; ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:? 'po' ( temp 4-component vector of float) +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.o1' (layout( location=2) out 4-component vector of float) +0:12 o1: direct index for structure ( temp 4-component vector of float) +0:12 'flattenTemp' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 Constant: +0:12 0 (const int) +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.o2' (layout( location=3) out 4-component vector of float) +0:12 o2: direct index for structure ( temp 4-component vector of float) +0:12 'flattenTemp' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 Constant: +0:12 1 (const int) +0:12 move second child to first child ( temp 4-component vector of float) +0:? 'po' (layout( location=0) out 4-component vector of float) +0:? 'po' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput.o1' (layout( location=2) out 4-component vector of float) +0:? '@entryPointOutput.o2' (layout( location=3) out 4-component vector of float) +0:? 'input.interp' (layout( location=0) in float) +0:? 'input.no_interp' (layout( location=1) flat in uint) +0:? 'po' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: @main(struct-PSInput-f1-u11;vf4; ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 Function Parameters: +0:12 'input' ( in structure{ temp float interp, temp uint no_interp}) +0:12 'po' ( out 4-component vector of float) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 o1: direct index for structure ( temp 4-component vector of float) +0:14 'pso' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:14 Constant: +0:14 0 (const int) +0:? Construct vec4 ( temp 4-component vector of float) +0:14 Convert uint to float ( temp float) +0:14 no_interp: direct index for structure ( temp uint) +0:14 'input' ( in structure{ temp float interp, temp uint no_interp}) +0:14 Constant: +0:14 1 (const int) +0:14 interp: direct index for structure ( temp float) +0:14 'input' ( in structure{ temp float interp, temp uint no_interp}) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0.000000 +0:14 Constant: +0:14 1.000000 +0:15 move second child to first child ( temp 4-component vector of float) +0:15 o2: direct index for structure ( temp 4-component vector of float) +0:15 'pso' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:15 Constant: +0:15 1 (const int) +0:15 Constant: +0:15 1.000000 +0:15 1.000000 +0:15 1.000000 +0:15 1.000000 +0:16 move second child to first child ( temp 4-component vector of float) +0:16 'po' ( out 4-component vector of float) +0:16 Constant: +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:16 0.000000 +0:18 Branch: Return with expression +0:18 'pso' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 Sequence +0:12 move second child to first child ( temp float) +0:12 interp: direct index for structure ( temp float) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:12 Constant: +0:12 0 (const int) +0:? 'input.interp' (layout( location=0) in float) +0:12 move second child to first child ( temp uint) +0:12 no_interp: direct index for structure ( temp uint) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:12 Constant: +0:12 1 (const int) +0:? 'input.no_interp' (layout( location=1) flat in uint) +0:12 Sequence +0:12 move second child to first child ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 'flattenTemp' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 Function Call: @main(struct-PSInput-f1-u11;vf4; ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:? 'input' ( temp structure{ temp float interp, temp uint no_interp}) +0:? 'po' ( temp 4-component vector of float) +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.o1' (layout( location=2) out 4-component vector of float) +0:12 o1: direct index for structure ( temp 4-component vector of float) +0:12 'flattenTemp' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 Constant: +0:12 0 (const int) +0:12 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.o2' (layout( location=3) out 4-component vector of float) +0:12 o2: direct index for structure ( temp 4-component vector of float) +0:12 'flattenTemp' ( temp structure{ temp 4-component vector of float o1, temp 4-component vector of float o2}) +0:12 Constant: +0:12 1 (const int) +0:12 move second child to first child ( temp 4-component vector of float) +0:? 'po' (layout( location=0) out 4-component vector of float) +0:? 'po' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput.o1' (layout( location=2) out 4-component vector of float) +0:? '@entryPointOutput.o2' (layout( location=3) out 4-component vector of float) +0:? 'input.interp' (layout( location=0) in float) +0:? 'input.no_interp' (layout( location=1) flat in uint) +0:? 'po' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 65 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 42 46 57 60 63 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PSInput" + MemberName 8(PSInput) 0 "interp" + MemberName 8(PSInput) 1 "no_interp" + Name 12 "PSOutput" + MemberName 12(PSOutput) 0 "o1" + MemberName 12(PSOutput) 1 "o2" + Name 16 "@main(struct-PSInput-f1-u11;vf4;" + Name 14 "input" + Name 15 "po" + Name 19 "pso" + Name 40 "input" + Name 42 "input.interp" + Name 46 "input.no_interp" + Name 49 "flattenTemp" + Name 50 "po" + Name 51 "param" + Name 53 "param" + Name 57 "@entryPointOutput.o1" + Name 60 "@entryPointOutput.o2" + Name 63 "po" + Decorate 42(input.interp) Location 0 + Decorate 46(input.no_interp) Flat + Decorate 46(input.no_interp) Location 1 + Decorate 57(@entryPointOutput.o1) Location 2 + Decorate 60(@entryPointOutput.o2) Location 3 + Decorate 63(po) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeInt 32 0 + 8(PSInput): TypeStruct 6(float) 7(int) + 9: TypePointer Function 8(PSInput) + 10: TypeVector 6(float) 4 + 11: TypePointer Function 10(fvec4) + 12(PSOutput): TypeStruct 10(fvec4) 10(fvec4) + 13: TypeFunction 12(PSOutput) 9(ptr) 11(ptr) + 18: TypePointer Function 12(PSOutput) + 20: TypeInt 32 1 + 21: 20(int) Constant 0 + 22: 20(int) Constant 1 + 23: TypePointer Function 7(int) + 27: TypePointer Function 6(float) + 30: 6(float) Constant 0 + 31: 6(float) Constant 1065353216 + 34: 10(fvec4) ConstantComposite 31 31 31 31 + 36: 10(fvec4) ConstantComposite 30 30 30 30 + 41: TypePointer Input 6(float) +42(input.interp): 41(ptr) Variable Input + 45: TypePointer Input 7(int) +46(input.no_interp): 45(ptr) Variable Input + 56: TypePointer Output 10(fvec4) +57(@entryPointOutput.o1): 56(ptr) Variable Output +60(@entryPointOutput.o2): 56(ptr) Variable Output + 63(po): 56(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 40(input): 9(ptr) Variable Function + 49(flattenTemp): 18(ptr) Variable Function + 50(po): 11(ptr) Variable Function + 51(param): 9(ptr) Variable Function + 53(param): 11(ptr) Variable Function + 43: 6(float) Load 42(input.interp) + 44: 27(ptr) AccessChain 40(input) 21 + Store 44 43 + 47: 7(int) Load 46(input.no_interp) + 48: 23(ptr) AccessChain 40(input) 22 + Store 48 47 + 52: 8(PSInput) Load 40(input) + Store 51(param) 52 + 54:12(PSOutput) FunctionCall 16(@main(struct-PSInput-f1-u11;vf4;) 51(param) 53(param) + 55: 10(fvec4) Load 53(param) + Store 50(po) 55 + Store 49(flattenTemp) 54 + 58: 11(ptr) AccessChain 49(flattenTemp) 21 + 59: 10(fvec4) Load 58 + Store 57(@entryPointOutput.o1) 59 + 61: 11(ptr) AccessChain 49(flattenTemp) 22 + 62: 10(fvec4) Load 61 + Store 60(@entryPointOutput.o2) 62 + 64: 10(fvec4) Load 50(po) + Store 63(po) 64 + Return + FunctionEnd +16(@main(struct-PSInput-f1-u11;vf4;):12(PSOutput) Function None 13 + 14(input): 9(ptr) FunctionParameter + 15(po): 11(ptr) FunctionParameter + 17: Label + 19(pso): 18(ptr) Variable Function + 24: 23(ptr) AccessChain 14(input) 22 + 25: 7(int) Load 24 + 26: 6(float) ConvertUToF 25 + 28: 27(ptr) AccessChain 14(input) 21 + 29: 6(float) Load 28 + 32: 10(fvec4) CompositeConstruct 26 29 30 31 + 33: 11(ptr) AccessChain 19(pso) 21 + Store 33 32 + 35: 11(ptr) AccessChain 19(pso) 22 + Store 35 34 + Store 15(po) 36 + 37:12(PSOutput) Load 19(pso) + ReturnValue 37 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.templatetypes.frag.out b/deps/glslang/Test/baseResults/hlsl.templatetypes.frag.out new file mode 100644 index 00000000..3fc5846a --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.templatetypes.frag.out @@ -0,0 +1,734 @@ +hlsl.templatetypes.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: @PixelShaderFunction( ( temp float) +0:3 Function Parameters: +0:? Sequence +0:4 Sequence +0:4 move second child to first child ( temp 4-component vector of float) +0:4 'r00' ( temp 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:5 Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:5 'r01' ( temp 4-component vector of float) +0:? Constant: +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:7 Sequence +0:7 move second child to first child ( temp 1-component vector of bool) +0:7 'r12' ( temp 1-component vector of bool) +0:7 Constant: +0:7 false (const bool) +0:8 Sequence +0:8 move second child to first child ( temp 1-component vector of int) +0:8 'r13' ( temp 1-component vector of int) +0:8 Constant: +0:8 1 (const int) +0:9 Sequence +0:9 move second child to first child ( temp 1-component vector of float) +0:9 'r14' ( temp 1-component vector of float) +0:9 Constant: +0:9 1.000000 +0:10 Sequence +0:10 move second child to first child ( temp 1-component vector of double) +0:10 'r15' ( temp 1-component vector of double) +0:10 Constant: +0:10 1.000000 +0:11 Sequence +0:11 move second child to first child ( temp 1-component vector of uint) +0:11 'r16' ( temp 1-component vector of uint) +0:11 Constant: +0:11 1 (const uint) +0:13 Sequence +0:13 move second child to first child ( temp 2-component vector of bool) +0:13 'r20' ( temp 2-component vector of bool) +0:? Constant: +0:? false (const bool) +0:? true (const bool) +0:14 Sequence +0:14 move second child to first child ( temp 2-component vector of int) +0:14 'r21' ( temp 2-component vector of int) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:15 Sequence +0:15 move second child to first child ( temp 2-component vector of float) +0:15 'r22' ( temp 2-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:16 Sequence +0:16 move second child to first child ( temp 2-component vector of double) +0:16 'r23' ( temp 2-component vector of double) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:17 Sequence +0:17 move second child to first child ( temp 2-component vector of uint) +0:17 'r24' ( temp 2-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:19 Sequence +0:19 move second child to first child ( temp 3-component vector of bool) +0:19 'r30' ( temp 3-component vector of bool) +0:? Constant: +0:? false (const bool) +0:? true (const bool) +0:? true (const bool) +0:20 Sequence +0:20 move second child to first child ( temp 3-component vector of int) +0:20 'r31' ( temp 3-component vector of int) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:? 3 (const int) +0:21 Sequence +0:21 move second child to first child ( temp 3-component vector of float) +0:21 'r32' ( temp 3-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:22 Sequence +0:22 move second child to first child ( temp 3-component vector of double) +0:22 'r33' ( temp 3-component vector of double) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:23 Sequence +0:23 move second child to first child ( temp 3-component vector of uint) +0:23 'r34' ( temp 3-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:25 Sequence +0:25 move second child to first child ( temp 4-component vector of bool) +0:25 'r40' ( temp 4-component vector of bool) +0:? Constant: +0:? false (const bool) +0:? true (const bool) +0:? true (const bool) +0:? false (const bool) +0:26 Sequence +0:26 move second child to first child ( temp 4-component vector of int) +0:26 'r41' ( temp 4-component vector of int) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:? 3 (const int) +0:? 4 (const int) +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'r42' ( temp 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of double) +0:28 'r43' ( temp 4-component vector of double) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of uint) +0:29 'r44' ( temp 4-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:? 4 (const uint) +0:31 Sequence +0:31 move second child to first child ( temp 4X4 matrix of float) +0:31 'r50' ( temp 4X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 6.000000 +0:? 7.000000 +0:? 8.000000 +0:? 9.000000 +0:? 10.000000 +0:? 11.000000 +0:? 12.000000 +0:? 13.000000 +0:? 14.000000 +0:? 15.000000 +0:32 Sequence +0:32 move second child to first child ( temp 4X4 matrix of float) +0:32 'r51' ( temp 4X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 6.000000 +0:? 7.000000 +0:? 8.000000 +0:? 9.000000 +0:? 10.000000 +0:? 11.000000 +0:? 12.000000 +0:? 13.000000 +0:? 14.000000 +0:? 15.000000 +0:35 Sequence +0:35 move second child to first child ( temp 2X3 matrix of float) +0:35 'r61' ( temp 2X3 matrix of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 6.000000 +0:36 Sequence +0:36 move second child to first child ( temp 3X2 matrix of float) +0:36 'r62' ( temp 3X2 matrix of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 6.000000 +0:39 Sequence +0:39 move second child to first child ( temp 4X2 matrix of float) +0:39 'r65' ( temp 4X2 matrix of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 6.000000 +0:? 7.000000 +0:? 8.000000 +0:40 Sequence +0:40 move second child to first child ( temp 4X3 matrix of float) +0:40 'r66' ( temp 4X3 matrix of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 6.000000 +0:? 7.000000 +0:? 8.000000 +0:? 9.000000 +0:? 10.000000 +0:? 11.000000 +0:? 12.000000 +0:45 Branch: Return with expression +0:45 Constant: +0:45 0.000000 +0:3 Function Definition: PixelShaderFunction( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:3 move second child to first child ( temp float) +0:? '@entryPointOutput' (layout( location=0) out float) +0:3 Function Call: @PixelShaderFunction( ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: @PixelShaderFunction( ( temp float) +0:3 Function Parameters: +0:? Sequence +0:4 Sequence +0:4 move second child to first child ( temp 4-component vector of float) +0:4 'r00' ( temp 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:5 Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:5 'r01' ( temp 4-component vector of float) +0:? Constant: +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:7 Sequence +0:7 move second child to first child ( temp 1-component vector of bool) +0:7 'r12' ( temp 1-component vector of bool) +0:7 Constant: +0:7 false (const bool) +0:8 Sequence +0:8 move second child to first child ( temp 1-component vector of int) +0:8 'r13' ( temp 1-component vector of int) +0:8 Constant: +0:8 1 (const int) +0:9 Sequence +0:9 move second child to first child ( temp 1-component vector of float) +0:9 'r14' ( temp 1-component vector of float) +0:9 Constant: +0:9 1.000000 +0:10 Sequence +0:10 move second child to first child ( temp 1-component vector of double) +0:10 'r15' ( temp 1-component vector of double) +0:10 Constant: +0:10 1.000000 +0:11 Sequence +0:11 move second child to first child ( temp 1-component vector of uint) +0:11 'r16' ( temp 1-component vector of uint) +0:11 Constant: +0:11 1 (const uint) +0:13 Sequence +0:13 move second child to first child ( temp 2-component vector of bool) +0:13 'r20' ( temp 2-component vector of bool) +0:? Constant: +0:? false (const bool) +0:? true (const bool) +0:14 Sequence +0:14 move second child to first child ( temp 2-component vector of int) +0:14 'r21' ( temp 2-component vector of int) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:15 Sequence +0:15 move second child to first child ( temp 2-component vector of float) +0:15 'r22' ( temp 2-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:16 Sequence +0:16 move second child to first child ( temp 2-component vector of double) +0:16 'r23' ( temp 2-component vector of double) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:17 Sequence +0:17 move second child to first child ( temp 2-component vector of uint) +0:17 'r24' ( temp 2-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:19 Sequence +0:19 move second child to first child ( temp 3-component vector of bool) +0:19 'r30' ( temp 3-component vector of bool) +0:? Constant: +0:? false (const bool) +0:? true (const bool) +0:? true (const bool) +0:20 Sequence +0:20 move second child to first child ( temp 3-component vector of int) +0:20 'r31' ( temp 3-component vector of int) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:? 3 (const int) +0:21 Sequence +0:21 move second child to first child ( temp 3-component vector of float) +0:21 'r32' ( temp 3-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:22 Sequence +0:22 move second child to first child ( temp 3-component vector of double) +0:22 'r33' ( temp 3-component vector of double) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:23 Sequence +0:23 move second child to first child ( temp 3-component vector of uint) +0:23 'r34' ( temp 3-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:25 Sequence +0:25 move second child to first child ( temp 4-component vector of bool) +0:25 'r40' ( temp 4-component vector of bool) +0:? Constant: +0:? false (const bool) +0:? true (const bool) +0:? true (const bool) +0:? false (const bool) +0:26 Sequence +0:26 move second child to first child ( temp 4-component vector of int) +0:26 'r41' ( temp 4-component vector of int) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:? 3 (const int) +0:? 4 (const int) +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'r42' ( temp 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of double) +0:28 'r43' ( temp 4-component vector of double) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:29 Sequence +0:29 move second child to first child ( temp 4-component vector of uint) +0:29 'r44' ( temp 4-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:? 4 (const uint) +0:31 Sequence +0:31 move second child to first child ( temp 4X4 matrix of float) +0:31 'r50' ( temp 4X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 6.000000 +0:? 7.000000 +0:? 8.000000 +0:? 9.000000 +0:? 10.000000 +0:? 11.000000 +0:? 12.000000 +0:? 13.000000 +0:? 14.000000 +0:? 15.000000 +0:32 Sequence +0:32 move second child to first child ( temp 4X4 matrix of float) +0:32 'r51' ( temp 4X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 6.000000 +0:? 7.000000 +0:? 8.000000 +0:? 9.000000 +0:? 10.000000 +0:? 11.000000 +0:? 12.000000 +0:? 13.000000 +0:? 14.000000 +0:? 15.000000 +0:35 Sequence +0:35 move second child to first child ( temp 2X3 matrix of float) +0:35 'r61' ( temp 2X3 matrix of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 6.000000 +0:36 Sequence +0:36 move second child to first child ( temp 3X2 matrix of float) +0:36 'r62' ( temp 3X2 matrix of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 6.000000 +0:39 Sequence +0:39 move second child to first child ( temp 4X2 matrix of float) +0:39 'r65' ( temp 4X2 matrix of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 6.000000 +0:? 7.000000 +0:? 8.000000 +0:40 Sequence +0:40 move second child to first child ( temp 4X3 matrix of float) +0:40 'r66' ( temp 4X3 matrix of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 6.000000 +0:? 7.000000 +0:? 8.000000 +0:? 9.000000 +0:? 10.000000 +0:? 11.000000 +0:? 12.000000 +0:45 Branch: Return with expression +0:45 Constant: +0:45 0.000000 +0:3 Function Definition: PixelShaderFunction( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:3 move second child to first child ( temp float) +0:? '@entryPointOutput' (layout( location=0) out float) +0:3 Function Call: @PixelShaderFunction( ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 153 + + Capability Shader + Capability Float64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 151 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 8 "@PixelShaderFunction(" + Name 12 "r00" + Name 18 "r01" + Name 23 "r12" + Name 27 "r13" + Name 30 "r14" + Name 33 "r15" + Name 37 "r16" + Name 41 "r20" + Name 46 "r21" + Name 51 "r22" + Name 55 "r23" + Name 60 "r24" + Name 65 "r30" + Name 69 "r31" + Name 74 "r32" + Name 78 "r33" + Name 83 "r34" + Name 88 "r40" + Name 92 "r41" + Name 95 "r42" + Name 98 "r43" + Name 103 "r44" + Name 108 "r50" + Name 125 "r51" + Name 128 "r61" + Name 133 "r62" + Name 139 "r65" + Name 144 "r66" + Name 151 "@entryPointOutput" + Decorate 151(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeFunction 6(float) + 10: TypeVector 6(float) 4 + 11: TypePointer Function 10(fvec4) + 13: 6(float) Constant 1065353216 + 14: 6(float) Constant 1073741824 + 15: 6(float) Constant 1077936128 + 16: 6(float) Constant 1082130432 + 17: 10(fvec4) ConstantComposite 13 14 15 16 + 19: 6(float) Constant 1084227584 + 20: 10(fvec4) ConstantComposite 14 15 16 19 + 21: TypeBool + 22: TypePointer Function 21(bool) + 24: 21(bool) ConstantFalse + 25: TypeInt 32 1 + 26: TypePointer Function 25(int) + 28: 25(int) Constant 1 + 29: TypePointer Function 6(float) + 31: TypeFloat 64 + 32: TypePointer Function 31(float64_t) + 34:31(float64_t) Constant 0 1072693248 + 35: TypeInt 32 0 + 36: TypePointer Function 35(int) + 38: 35(int) Constant 1 + 39: TypeVector 21(bool) 2 + 40: TypePointer Function 39(bvec2) + 42: 21(bool) ConstantTrue + 43: 39(bvec2) ConstantComposite 24 42 + 44: TypeVector 25(int) 2 + 45: TypePointer Function 44(ivec2) + 47: 25(int) Constant 2 + 48: 44(ivec2) ConstantComposite 28 47 + 49: TypeVector 6(float) 2 + 50: TypePointer Function 49(fvec2) + 52: 49(fvec2) ConstantComposite 13 14 + 53: TypeVector 31(float64_t) 2 + 54: TypePointer Function 53(f64vec2) + 56:31(float64_t) Constant 0 1073741824 + 57: 53(f64vec2) ConstantComposite 34 56 + 58: TypeVector 35(int) 2 + 59: TypePointer Function 58(ivec2) + 61: 35(int) Constant 2 + 62: 58(ivec2) ConstantComposite 38 61 + 63: TypeVector 21(bool) 3 + 64: TypePointer Function 63(bvec3) + 66: 63(bvec3) ConstantComposite 24 42 42 + 67: TypeVector 25(int) 3 + 68: TypePointer Function 67(ivec3) + 70: 25(int) Constant 3 + 71: 67(ivec3) ConstantComposite 28 47 70 + 72: TypeVector 6(float) 3 + 73: TypePointer Function 72(fvec3) + 75: 72(fvec3) ConstantComposite 13 14 15 + 76: TypeVector 31(float64_t) 3 + 77: TypePointer Function 76(f64vec3) + 79:31(float64_t) Constant 0 1074266112 + 80: 76(f64vec3) ConstantComposite 34 56 79 + 81: TypeVector 35(int) 3 + 82: TypePointer Function 81(ivec3) + 84: 35(int) Constant 3 + 85: 81(ivec3) ConstantComposite 38 61 84 + 86: TypeVector 21(bool) 4 + 87: TypePointer Function 86(bvec4) + 89: 86(bvec4) ConstantComposite 24 42 42 24 + 90: TypeVector 25(int) 4 + 91: TypePointer Function 90(ivec4) + 93: 25(int) Constant 4 + 94: 90(ivec4) ConstantComposite 28 47 70 93 + 96: TypeVector 31(float64_t) 4 + 97: TypePointer Function 96(f64vec4) + 99:31(float64_t) Constant 0 1074790400 + 100: 96(f64vec4) ConstantComposite 34 56 79 99 + 101: TypeVector 35(int) 4 + 102: TypePointer Function 101(ivec4) + 104: 35(int) Constant 4 + 105: 101(ivec4) ConstantComposite 38 61 84 104 + 106: TypeMatrix 10(fvec4) 4 + 107: TypePointer Function 106 + 109: 6(float) Constant 0 + 110: 10(fvec4) ConstantComposite 109 13 14 15 + 111: 6(float) Constant 1086324736 + 112: 6(float) Constant 1088421888 + 113: 10(fvec4) ConstantComposite 16 19 111 112 + 114: 6(float) Constant 1090519040 + 115: 6(float) Constant 1091567616 + 116: 6(float) Constant 1092616192 + 117: 6(float) Constant 1093664768 + 118: 10(fvec4) ConstantComposite 114 115 116 117 + 119: 6(float) Constant 1094713344 + 120: 6(float) Constant 1095761920 + 121: 6(float) Constant 1096810496 + 122: 6(float) Constant 1097859072 + 123: 10(fvec4) ConstantComposite 119 120 121 122 + 124: 106 ConstantComposite 110 113 118 123 + 126: TypeMatrix 72(fvec3) 2 + 127: TypePointer Function 126 + 129: 72(fvec3) ConstantComposite 16 19 111 + 130: 126 ConstantComposite 75 129 + 131: TypeMatrix 49(fvec2) 3 + 132: TypePointer Function 131 + 134: 49(fvec2) ConstantComposite 15 16 + 135: 49(fvec2) ConstantComposite 19 111 + 136: 131 ConstantComposite 52 134 135 + 137: TypeMatrix 49(fvec2) 4 + 138: TypePointer Function 137 + 140: 49(fvec2) ConstantComposite 112 114 + 141: 137 ConstantComposite 52 134 135 140 + 142: TypeMatrix 72(fvec3) 4 + 143: TypePointer Function 142 + 145: 72(fvec3) ConstantComposite 112 114 115 + 146: 72(fvec3) ConstantComposite 116 117 119 + 147: 142 ConstantComposite 75 129 145 146 + 150: TypePointer Output 6(float) +151(@entryPointOutput): 150(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 152: 6(float) FunctionCall 8(@PixelShaderFunction() + Store 151(@entryPointOutput) 152 + Return + FunctionEnd +8(@PixelShaderFunction(): 6(float) Function None 7 + 9: Label + 12(r00): 11(ptr) Variable Function + 18(r01): 11(ptr) Variable Function + 23(r12): 22(ptr) Variable Function + 27(r13): 26(ptr) Variable Function + 30(r14): 29(ptr) Variable Function + 33(r15): 32(ptr) Variable Function + 37(r16): 36(ptr) Variable Function + 41(r20): 40(ptr) Variable Function + 46(r21): 45(ptr) Variable Function + 51(r22): 50(ptr) Variable Function + 55(r23): 54(ptr) Variable Function + 60(r24): 59(ptr) Variable Function + 65(r30): 64(ptr) Variable Function + 69(r31): 68(ptr) Variable Function + 74(r32): 73(ptr) Variable Function + 78(r33): 77(ptr) Variable Function + 83(r34): 82(ptr) Variable Function + 88(r40): 87(ptr) Variable Function + 92(r41): 91(ptr) Variable Function + 95(r42): 11(ptr) Variable Function + 98(r43): 97(ptr) Variable Function + 103(r44): 102(ptr) Variable Function + 108(r50): 107(ptr) Variable Function + 125(r51): 107(ptr) Variable Function + 128(r61): 127(ptr) Variable Function + 133(r62): 132(ptr) Variable Function + 139(r65): 138(ptr) Variable Function + 144(r66): 143(ptr) Variable Function + Store 12(r00) 17 + Store 18(r01) 20 + Store 23(r12) 24 + Store 27(r13) 28 + Store 30(r14) 13 + Store 33(r15) 34 + Store 37(r16) 38 + Store 41(r20) 43 + Store 46(r21) 48 + Store 51(r22) 52 + Store 55(r23) 57 + Store 60(r24) 62 + Store 65(r30) 66 + Store 69(r31) 71 + Store 74(r32) 75 + Store 78(r33) 80 + Store 83(r34) 85 + Store 88(r40) 89 + Store 92(r41) 94 + Store 95(r42) 17 + Store 98(r43) 100 + Store 103(r44) 105 + Store 108(r50) 124 + Store 125(r51) 124 + Store 128(r61) 130 + Store 133(r62) 136 + Store 139(r65) 141 + Store 144(r66) 147 + ReturnValue 109 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.texture.struct.frag.out b/deps/glslang/Test/baseResults/hlsl.texture.struct.frag.out new file mode 100644 index 00000000..62cb5749 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.texture.struct.frag.out @@ -0,0 +1,1201 @@ +hlsl.texture.struct.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:38 Function Definition: fn1(t2-tx-struct0-1; ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:38 Function Parameters: +0:38 't1' ( in texture2D) +0:? Sequence +0:38 Branch: Return with expression +0:38 Sequence +0:38 move second child to first child ( temp 4-component vector of float) +0:38 '@sampleResultShadow' ( temp 4-component vector of float) +0:? texture ( temp 4-component vector of float) +0:38 Construct combined texture-sampler ( temp sampler2D) +0:38 't1' ( in texture2D) +0:38 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.600000 +0:? 0.610000 +0:38 move second child to first child ( temp float) +0:38 c0: direct index for structure ( temp float) +0:38 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:38 Constant: +0:38 0 (const uint) +0:38 direct index ( temp float) +0:38 '@sampleResultShadow' ( temp 4-component vector of float) +0:38 Constant: +0:38 0 (const uint) +0:38 move second child to first child ( temp float) +0:38 direct index ( temp float) +0:38 c1: direct index for structure ( temp 2-component vector of float) +0:38 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:38 Constant: +0:38 1 (const uint) +0:38 Constant: +0:38 0 (const int) +0:38 direct index ( temp float) +0:38 '@sampleResultShadow' ( temp 4-component vector of float) +0:38 Constant: +0:38 1 (const uint) +0:38 move second child to first child ( temp float) +0:38 direct index ( temp float) +0:38 c1: direct index for structure ( temp 2-component vector of float) +0:38 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:38 Constant: +0:38 1 (const uint) +0:38 Constant: +0:38 1 (const int) +0:38 direct index ( temp float) +0:38 '@sampleResultShadow' ( temp 4-component vector of float) +0:38 Constant: +0:38 2 (const uint) +0:38 move second child to first child ( temp float) +0:38 c2: direct index for structure ( temp float) +0:38 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:38 Constant: +0:38 2 (const uint) +0:38 direct index ( temp float) +0:38 '@sampleResultShadow' ( temp 4-component vector of float) +0:38 Constant: +0:38 3 (const uint) +0:38 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:39 Function Definition: fn1(t2-tx-struct1-1; ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:39 Function Parameters: +0:39 't2' ( in texture2D) +0:? Sequence +0:39 Branch: Return with expression +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 '@sampleResultShadow' ( temp 4-component vector of float) +0:? texture ( temp 4-component vector of float) +0:39 Construct combined texture-sampler ( temp sampler2D) +0:39 't2' ( in texture2D) +0:39 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.600000 +0:? 0.610000 +0:39 move second child to first child ( temp float) +0:39 c0: direct index for structure ( temp float) +0:39 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp float) +0:39 '@sampleResultShadow' ( temp 4-component vector of float) +0:39 Constant: +0:39 0 (const uint) +0:39 move second child to first child ( temp float) +0:39 direct index ( temp float) +0:39 c1: direct index for structure ( temp 3-component vector of float) +0:39 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:39 Constant: +0:39 1 (const uint) +0:39 Constant: +0:39 0 (const int) +0:39 direct index ( temp float) +0:39 '@sampleResultShadow' ( temp 4-component vector of float) +0:39 Constant: +0:39 1 (const uint) +0:39 move second child to first child ( temp float) +0:39 direct index ( temp float) +0:39 c1: direct index for structure ( temp 3-component vector of float) +0:39 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:39 Constant: +0:39 1 (const uint) +0:39 Constant: +0:39 1 (const int) +0:39 direct index ( temp float) +0:39 '@sampleResultShadow' ( temp 4-component vector of float) +0:39 Constant: +0:39 2 (const uint) +0:39 move second child to first child ( temp float) +0:39 direct index ( temp float) +0:39 c1: direct index for structure ( temp 3-component vector of float) +0:39 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:39 Constant: +0:39 1 (const uint) +0:39 Constant: +0:39 2 (const int) +0:39 direct index ( temp float) +0:39 '@sampleResultShadow' ( temp 4-component vector of float) +0:39 Constant: +0:39 3 (const uint) +0:39 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:42 Function Definition: @main( ( temp 4-component vector of float) +0:42 Function Parameters: +0:? Sequence +0:43 Sequence +0:43 move second child to first child ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 's1' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of float) +0:43 '@sampleResultShadow' ( temp 4-component vector of float) +0:? texture ( temp 4-component vector of float) +0:43 Construct combined texture-sampler ( temp sampler2D) +0:43 'g_tTex2s1' ( uniform texture2D) +0:43 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.110000 +0:43 move second child to first child ( temp float) +0:43 c0: direct index for structure ( temp float) +0:43 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 Constant: +0:43 0 (const uint) +0:43 direct index ( temp float) +0:43 '@sampleResultShadow' ( temp 4-component vector of float) +0:43 Constant: +0:43 0 (const uint) +0:43 move second child to first child ( temp float) +0:43 direct index ( temp float) +0:43 c1: direct index for structure ( temp 2-component vector of float) +0:43 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 Constant: +0:43 1 (const uint) +0:43 Constant: +0:43 0 (const int) +0:43 direct index ( temp float) +0:43 '@sampleResultShadow' ( temp 4-component vector of float) +0:43 Constant: +0:43 1 (const uint) +0:43 move second child to first child ( temp float) +0:43 direct index ( temp float) +0:43 c1: direct index for structure ( temp 2-component vector of float) +0:43 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 Constant: +0:43 1 (const uint) +0:43 Constant: +0:43 1 (const int) +0:43 direct index ( temp float) +0:43 '@sampleResultShadow' ( temp 4-component vector of float) +0:43 Constant: +0:43 2 (const uint) +0:43 move second child to first child ( temp float) +0:43 c2: direct index for structure ( temp float) +0:43 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 Constant: +0:43 2 (const uint) +0:43 direct index ( temp float) +0:43 '@sampleResultShadow' ( temp 4-component vector of float) +0:43 Constant: +0:43 3 (const uint) +0:43 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:44 Sequence +0:44 move second child to first child ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 's2' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of float) +0:44 '@sampleResultShadow' ( temp 4-component vector of float) +0:? texture ( temp 4-component vector of float) +0:44 Construct combined texture-sampler ( temp sampler2D) +0:44 'g_tTex2s2' ( uniform texture2D) +0:44 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.200000 +0:? 0.210000 +0:44 move second child to first child ( temp float) +0:44 c0: direct index for structure ( temp float) +0:44 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp float) +0:44 '@sampleResultShadow' ( temp 4-component vector of float) +0:44 Constant: +0:44 0 (const uint) +0:44 move second child to first child ( temp float) +0:44 direct index ( temp float) +0:44 c1: direct index for structure ( temp 3-component vector of float) +0:44 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 Constant: +0:44 1 (const uint) +0:44 Constant: +0:44 0 (const int) +0:44 direct index ( temp float) +0:44 '@sampleResultShadow' ( temp 4-component vector of float) +0:44 Constant: +0:44 1 (const uint) +0:44 move second child to first child ( temp float) +0:44 direct index ( temp float) +0:44 c1: direct index for structure ( temp 3-component vector of float) +0:44 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 Constant: +0:44 1 (const uint) +0:44 Constant: +0:44 1 (const int) +0:44 direct index ( temp float) +0:44 '@sampleResultShadow' ( temp 4-component vector of float) +0:44 Constant: +0:44 2 (const uint) +0:44 move second child to first child ( temp float) +0:44 direct index ( temp float) +0:44 c1: direct index for structure ( temp 3-component vector of float) +0:44 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 Constant: +0:44 1 (const uint) +0:44 Constant: +0:44 2 (const int) +0:44 direct index ( temp float) +0:44 '@sampleResultShadow' ( temp 4-component vector of float) +0:44 Constant: +0:44 3 (const uint) +0:44 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:45 Sequence +0:45 move second child to first child ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:45 's3' ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of float) +0:45 '@sampleResultShadow' ( temp 4-component vector of float) +0:? texture ( temp 4-component vector of float) +0:45 Construct combined texture-sampler ( temp sampler2D) +0:45 'g_tTex2s3' ( uniform texture2D) +0:45 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.310000 +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 c0: direct index for structure ( temp 2-component vector of float) +0:45 '@sampleStructTemp' ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:45 Constant: +0:45 0 (const uint) +0:45 Constant: +0:45 0 (const int) +0:45 direct index ( temp float) +0:45 '@sampleResultShadow' ( temp 4-component vector of float) +0:45 Constant: +0:45 0 (const uint) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 c0: direct index for structure ( temp 2-component vector of float) +0:45 '@sampleStructTemp' ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:45 Constant: +0:45 0 (const uint) +0:45 Constant: +0:45 1 (const int) +0:45 direct index ( temp float) +0:45 '@sampleResultShadow' ( temp 4-component vector of float) +0:45 Constant: +0:45 1 (const uint) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 c1: direct index for structure ( temp 1-component vector of float) +0:45 '@sampleStructTemp' ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:45 Constant: +0:45 1 (const uint) +0:45 Constant: +0:45 0 (const int) +0:45 direct index ( temp float) +0:45 '@sampleResultShadow' ( temp 4-component vector of float) +0:45 Constant: +0:45 2 (const uint) +0:45 '@sampleStructTemp' ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:46 Sequence +0:46 move second child to first child ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 's4' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 Sequence +0:46 move second child to first child ( temp 4-component vector of int) +0:46 '@sampleResultShadow' ( temp 4-component vector of int) +0:? texture ( temp 4-component vector of int) +0:46 Construct combined texture-sampler ( temp isampler2D) +0:46 'g_tTex2s4' ( uniform itexture2D) +0:46 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.410000 +0:46 move second child to first child ( temp int) +0:46 c0: direct index for structure ( temp int) +0:46 '@sampleStructTemp' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp int) +0:46 '@sampleResultShadow' ( temp 4-component vector of int) +0:46 Constant: +0:46 0 (const uint) +0:46 move second child to first child ( temp float) +0:46 direct index ( temp float) +0:46 c1: direct index for structure ( temp 2-component vector of int) +0:46 '@sampleStructTemp' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 Constant: +0:46 1 (const uint) +0:46 Constant: +0:46 0 (const int) +0:46 Convert int to float ( temp float) +0:46 direct index ( temp int) +0:46 '@sampleResultShadow' ( temp 4-component vector of int) +0:46 Constant: +0:46 1 (const uint) +0:46 move second child to first child ( temp float) +0:46 direct index ( temp float) +0:46 c1: direct index for structure ( temp 2-component vector of int) +0:46 '@sampleStructTemp' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 Constant: +0:46 1 (const uint) +0:46 Constant: +0:46 1 (const int) +0:46 Convert int to float ( temp float) +0:46 direct index ( temp int) +0:46 '@sampleResultShadow' ( temp 4-component vector of int) +0:46 Constant: +0:46 2 (const uint) +0:46 move second child to first child ( temp int) +0:46 c2: direct index for structure ( temp int) +0:46 '@sampleStructTemp' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 Constant: +0:46 2 (const uint) +0:46 direct index ( temp int) +0:46 '@sampleResultShadow' ( temp 4-component vector of int) +0:46 Constant: +0:46 3 (const uint) +0:46 '@sampleStructTemp' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:47 Sequence +0:47 move second child to first child ( temp structure{ temp uint c0, temp uint c1}) +0:47 's5' ( temp structure{ temp uint c0, temp uint c1}) +0:47 Sequence +0:47 move second child to first child ( temp 4-component vector of uint) +0:47 '@sampleResultShadow' ( temp 4-component vector of uint) +0:? texture ( temp 4-component vector of uint) +0:47 Construct combined texture-sampler ( temp usampler2D) +0:47 'g_tTex2s5' ( uniform utexture2D) +0:47 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.510000 +0:47 move second child to first child ( temp uint) +0:47 c0: direct index for structure ( temp uint) +0:47 '@sampleStructTemp' ( temp structure{ temp uint c0, temp uint c1}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 '@sampleResultShadow' ( temp 4-component vector of uint) +0:47 Constant: +0:47 0 (const uint) +0:47 move second child to first child ( temp uint) +0:47 c1: direct index for structure ( temp uint) +0:47 '@sampleStructTemp' ( temp structure{ temp uint c0, temp uint c1}) +0:47 Constant: +0:47 1 (const uint) +0:47 direct index ( temp uint) +0:47 '@sampleResultShadow' ( temp 4-component vector of uint) +0:47 Constant: +0:47 1 (const uint) +0:47 '@sampleStructTemp' ( temp structure{ temp uint c0, temp uint c1}) +0:49 Sequence +0:49 move second child to first child ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:49 'r0' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:49 Function Call: fn1(t2-tx-struct0-1; ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:49 'g_tTex2s1' ( uniform texture2D) +0:50 Sequence +0:50 move second child to first child ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:50 'r1' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:50 Function Call: fn1(t2-tx-struct1-1; ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:50 'g_tTex2s2' ( uniform texture2D) +0:51 Sequence +0:51 move second child to first child ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:51 'r2' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:51 Function Call: fn1(t2-tx-struct0-1; ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:51 'g_tTex2s1a' ( uniform texture2D) +0:53 Branch: Return with expression +0:53 Constant: +0:53 0.000000 +0:53 0.000000 +0:53 0.000000 +0:53 0.000000 +0:42 Function Definition: main( ( temp void) +0:42 Function Parameters: +0:? Sequence +0:42 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:42 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_sSamp' ( uniform sampler) +0:? 'g_tTex2s1' ( uniform texture2D) +0:? 'g_tTex2s2' ( uniform texture2D) +0:? 'g_tTex2s3' ( uniform texture2D) +0:? 'g_tTex2s4' ( uniform itexture2D) +0:? 'g_tTex2s5' ( uniform utexture2D) +0:? 'g_tTex2s1a' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:38 Function Definition: fn1(t2-tx-struct0-1; ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:38 Function Parameters: +0:38 't1' ( in texture2D) +0:? Sequence +0:38 Branch: Return with expression +0:38 Sequence +0:38 move second child to first child ( temp 4-component vector of float) +0:38 '@sampleResultShadow' ( temp 4-component vector of float) +0:? texture ( temp 4-component vector of float) +0:38 Construct combined texture-sampler ( temp sampler2D) +0:38 't1' ( in texture2D) +0:38 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.600000 +0:? 0.610000 +0:38 move second child to first child ( temp float) +0:38 c0: direct index for structure ( temp float) +0:38 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:38 Constant: +0:38 0 (const uint) +0:38 direct index ( temp float) +0:38 '@sampleResultShadow' ( temp 4-component vector of float) +0:38 Constant: +0:38 0 (const uint) +0:38 move second child to first child ( temp float) +0:38 direct index ( temp float) +0:38 c1: direct index for structure ( temp 2-component vector of float) +0:38 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:38 Constant: +0:38 1 (const uint) +0:38 Constant: +0:38 0 (const int) +0:38 direct index ( temp float) +0:38 '@sampleResultShadow' ( temp 4-component vector of float) +0:38 Constant: +0:38 1 (const uint) +0:38 move second child to first child ( temp float) +0:38 direct index ( temp float) +0:38 c1: direct index for structure ( temp 2-component vector of float) +0:38 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:38 Constant: +0:38 1 (const uint) +0:38 Constant: +0:38 1 (const int) +0:38 direct index ( temp float) +0:38 '@sampleResultShadow' ( temp 4-component vector of float) +0:38 Constant: +0:38 2 (const uint) +0:38 move second child to first child ( temp float) +0:38 c2: direct index for structure ( temp float) +0:38 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:38 Constant: +0:38 2 (const uint) +0:38 direct index ( temp float) +0:38 '@sampleResultShadow' ( temp 4-component vector of float) +0:38 Constant: +0:38 3 (const uint) +0:38 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:39 Function Definition: fn1(t2-tx-struct1-1; ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:39 Function Parameters: +0:39 't2' ( in texture2D) +0:? Sequence +0:39 Branch: Return with expression +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 '@sampleResultShadow' ( temp 4-component vector of float) +0:? texture ( temp 4-component vector of float) +0:39 Construct combined texture-sampler ( temp sampler2D) +0:39 't2' ( in texture2D) +0:39 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.600000 +0:? 0.610000 +0:39 move second child to first child ( temp float) +0:39 c0: direct index for structure ( temp float) +0:39 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp float) +0:39 '@sampleResultShadow' ( temp 4-component vector of float) +0:39 Constant: +0:39 0 (const uint) +0:39 move second child to first child ( temp float) +0:39 direct index ( temp float) +0:39 c1: direct index for structure ( temp 3-component vector of float) +0:39 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:39 Constant: +0:39 1 (const uint) +0:39 Constant: +0:39 0 (const int) +0:39 direct index ( temp float) +0:39 '@sampleResultShadow' ( temp 4-component vector of float) +0:39 Constant: +0:39 1 (const uint) +0:39 move second child to first child ( temp float) +0:39 direct index ( temp float) +0:39 c1: direct index for structure ( temp 3-component vector of float) +0:39 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:39 Constant: +0:39 1 (const uint) +0:39 Constant: +0:39 1 (const int) +0:39 direct index ( temp float) +0:39 '@sampleResultShadow' ( temp 4-component vector of float) +0:39 Constant: +0:39 2 (const uint) +0:39 move second child to first child ( temp float) +0:39 direct index ( temp float) +0:39 c1: direct index for structure ( temp 3-component vector of float) +0:39 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:39 Constant: +0:39 1 (const uint) +0:39 Constant: +0:39 2 (const int) +0:39 direct index ( temp float) +0:39 '@sampleResultShadow' ( temp 4-component vector of float) +0:39 Constant: +0:39 3 (const uint) +0:39 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:42 Function Definition: @main( ( temp 4-component vector of float) +0:42 Function Parameters: +0:? Sequence +0:43 Sequence +0:43 move second child to first child ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 's1' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of float) +0:43 '@sampleResultShadow' ( temp 4-component vector of float) +0:? texture ( temp 4-component vector of float) +0:43 Construct combined texture-sampler ( temp sampler2D) +0:43 'g_tTex2s1' ( uniform texture2D) +0:43 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.110000 +0:43 move second child to first child ( temp float) +0:43 c0: direct index for structure ( temp float) +0:43 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 Constant: +0:43 0 (const uint) +0:43 direct index ( temp float) +0:43 '@sampleResultShadow' ( temp 4-component vector of float) +0:43 Constant: +0:43 0 (const uint) +0:43 move second child to first child ( temp float) +0:43 direct index ( temp float) +0:43 c1: direct index for structure ( temp 2-component vector of float) +0:43 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 Constant: +0:43 1 (const uint) +0:43 Constant: +0:43 0 (const int) +0:43 direct index ( temp float) +0:43 '@sampleResultShadow' ( temp 4-component vector of float) +0:43 Constant: +0:43 1 (const uint) +0:43 move second child to first child ( temp float) +0:43 direct index ( temp float) +0:43 c1: direct index for structure ( temp 2-component vector of float) +0:43 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 Constant: +0:43 1 (const uint) +0:43 Constant: +0:43 1 (const int) +0:43 direct index ( temp float) +0:43 '@sampleResultShadow' ( temp 4-component vector of float) +0:43 Constant: +0:43 2 (const uint) +0:43 move second child to first child ( temp float) +0:43 c2: direct index for structure ( temp float) +0:43 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 Constant: +0:43 2 (const uint) +0:43 direct index ( temp float) +0:43 '@sampleResultShadow' ( temp 4-component vector of float) +0:43 Constant: +0:43 3 (const uint) +0:43 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:44 Sequence +0:44 move second child to first child ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 's2' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of float) +0:44 '@sampleResultShadow' ( temp 4-component vector of float) +0:? texture ( temp 4-component vector of float) +0:44 Construct combined texture-sampler ( temp sampler2D) +0:44 'g_tTex2s2' ( uniform texture2D) +0:44 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.200000 +0:? 0.210000 +0:44 move second child to first child ( temp float) +0:44 c0: direct index for structure ( temp float) +0:44 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp float) +0:44 '@sampleResultShadow' ( temp 4-component vector of float) +0:44 Constant: +0:44 0 (const uint) +0:44 move second child to first child ( temp float) +0:44 direct index ( temp float) +0:44 c1: direct index for structure ( temp 3-component vector of float) +0:44 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 Constant: +0:44 1 (const uint) +0:44 Constant: +0:44 0 (const int) +0:44 direct index ( temp float) +0:44 '@sampleResultShadow' ( temp 4-component vector of float) +0:44 Constant: +0:44 1 (const uint) +0:44 move second child to first child ( temp float) +0:44 direct index ( temp float) +0:44 c1: direct index for structure ( temp 3-component vector of float) +0:44 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 Constant: +0:44 1 (const uint) +0:44 Constant: +0:44 1 (const int) +0:44 direct index ( temp float) +0:44 '@sampleResultShadow' ( temp 4-component vector of float) +0:44 Constant: +0:44 2 (const uint) +0:44 move second child to first child ( temp float) +0:44 direct index ( temp float) +0:44 c1: direct index for structure ( temp 3-component vector of float) +0:44 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 Constant: +0:44 1 (const uint) +0:44 Constant: +0:44 2 (const int) +0:44 direct index ( temp float) +0:44 '@sampleResultShadow' ( temp 4-component vector of float) +0:44 Constant: +0:44 3 (const uint) +0:44 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:45 Sequence +0:45 move second child to first child ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:45 's3' ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of float) +0:45 '@sampleResultShadow' ( temp 4-component vector of float) +0:? texture ( temp 4-component vector of float) +0:45 Construct combined texture-sampler ( temp sampler2D) +0:45 'g_tTex2s3' ( uniform texture2D) +0:45 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.310000 +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 c0: direct index for structure ( temp 2-component vector of float) +0:45 '@sampleStructTemp' ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:45 Constant: +0:45 0 (const uint) +0:45 Constant: +0:45 0 (const int) +0:45 direct index ( temp float) +0:45 '@sampleResultShadow' ( temp 4-component vector of float) +0:45 Constant: +0:45 0 (const uint) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 c0: direct index for structure ( temp 2-component vector of float) +0:45 '@sampleStructTemp' ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:45 Constant: +0:45 0 (const uint) +0:45 Constant: +0:45 1 (const int) +0:45 direct index ( temp float) +0:45 '@sampleResultShadow' ( temp 4-component vector of float) +0:45 Constant: +0:45 1 (const uint) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 c1: direct index for structure ( temp 1-component vector of float) +0:45 '@sampleStructTemp' ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:45 Constant: +0:45 1 (const uint) +0:45 Constant: +0:45 0 (const int) +0:45 direct index ( temp float) +0:45 '@sampleResultShadow' ( temp 4-component vector of float) +0:45 Constant: +0:45 2 (const uint) +0:45 '@sampleStructTemp' ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:46 Sequence +0:46 move second child to first child ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 's4' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 Sequence +0:46 move second child to first child ( temp 4-component vector of int) +0:46 '@sampleResultShadow' ( temp 4-component vector of int) +0:? texture ( temp 4-component vector of int) +0:46 Construct combined texture-sampler ( temp isampler2D) +0:46 'g_tTex2s4' ( uniform itexture2D) +0:46 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.410000 +0:46 move second child to first child ( temp int) +0:46 c0: direct index for structure ( temp int) +0:46 '@sampleStructTemp' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp int) +0:46 '@sampleResultShadow' ( temp 4-component vector of int) +0:46 Constant: +0:46 0 (const uint) +0:46 move second child to first child ( temp float) +0:46 direct index ( temp float) +0:46 c1: direct index for structure ( temp 2-component vector of int) +0:46 '@sampleStructTemp' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 Constant: +0:46 1 (const uint) +0:46 Constant: +0:46 0 (const int) +0:46 Convert int to float ( temp float) +0:46 direct index ( temp int) +0:46 '@sampleResultShadow' ( temp 4-component vector of int) +0:46 Constant: +0:46 1 (const uint) +0:46 move second child to first child ( temp float) +0:46 direct index ( temp float) +0:46 c1: direct index for structure ( temp 2-component vector of int) +0:46 '@sampleStructTemp' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 Constant: +0:46 1 (const uint) +0:46 Constant: +0:46 1 (const int) +0:46 Convert int to float ( temp float) +0:46 direct index ( temp int) +0:46 '@sampleResultShadow' ( temp 4-component vector of int) +0:46 Constant: +0:46 2 (const uint) +0:46 move second child to first child ( temp int) +0:46 c2: direct index for structure ( temp int) +0:46 '@sampleStructTemp' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 Constant: +0:46 2 (const uint) +0:46 direct index ( temp int) +0:46 '@sampleResultShadow' ( temp 4-component vector of int) +0:46 Constant: +0:46 3 (const uint) +0:46 '@sampleStructTemp' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:47 Sequence +0:47 move second child to first child ( temp structure{ temp uint c0, temp uint c1}) +0:47 's5' ( temp structure{ temp uint c0, temp uint c1}) +0:47 Sequence +0:47 move second child to first child ( temp 4-component vector of uint) +0:47 '@sampleResultShadow' ( temp 4-component vector of uint) +0:? texture ( temp 4-component vector of uint) +0:47 Construct combined texture-sampler ( temp usampler2D) +0:47 'g_tTex2s5' ( uniform utexture2D) +0:47 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.510000 +0:47 move second child to first child ( temp uint) +0:47 c0: direct index for structure ( temp uint) +0:47 '@sampleStructTemp' ( temp structure{ temp uint c0, temp uint c1}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 '@sampleResultShadow' ( temp 4-component vector of uint) +0:47 Constant: +0:47 0 (const uint) +0:47 move second child to first child ( temp uint) +0:47 c1: direct index for structure ( temp uint) +0:47 '@sampleStructTemp' ( temp structure{ temp uint c0, temp uint c1}) +0:47 Constant: +0:47 1 (const uint) +0:47 direct index ( temp uint) +0:47 '@sampleResultShadow' ( temp 4-component vector of uint) +0:47 Constant: +0:47 1 (const uint) +0:47 '@sampleStructTemp' ( temp structure{ temp uint c0, temp uint c1}) +0:49 Sequence +0:49 move second child to first child ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:49 'r0' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:49 Function Call: fn1(t2-tx-struct0-1; ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:49 'g_tTex2s1' ( uniform texture2D) +0:50 Sequence +0:50 move second child to first child ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:50 'r1' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:50 Function Call: fn1(t2-tx-struct1-1; ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:50 'g_tTex2s2' ( uniform texture2D) +0:51 Sequence +0:51 move second child to first child ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:51 'r2' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:51 Function Call: fn1(t2-tx-struct0-1; ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:51 'g_tTex2s1a' ( uniform texture2D) +0:53 Branch: Return with expression +0:53 Constant: +0:53 0.000000 +0:53 0.000000 +0:53 0.000000 +0:53 0.000000 +0:42 Function Definition: main( ( temp void) +0:42 Function Parameters: +0:? Sequence +0:42 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:42 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_sSamp' ( uniform sampler) +0:? 'g_tTex2s1' ( uniform texture2D) +0:? 'g_tTex2s2' ( uniform texture2D) +0:? 'g_tTex2s3' ( uniform texture2D) +0:? 'g_tTex2s4' ( uniform itexture2D) +0:? 'g_tTex2s5' ( uniform utexture2D) +0:? 'g_tTex2s1a' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +error: SPIRV-Tools Validation Errors +error: OpStore Pointer '185's type does not match Object '184's type. + OpStore %185 %184 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 240 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 238 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 10 "s1_t" + MemberName 10(s1_t) 0 "c0" + MemberName 10(s1_t) 1 "c1" + MemberName 10(s1_t) 2 "c2" + Name 13 "fn1(t2-tx-struct0-1;" + Name 12 "t1" + Name 16 "s2_t" + MemberName 16(s2_t) 0 "c0" + MemberName 16(s2_t) 1 "c1" + Name 19 "fn1(t2-tx-struct1-1;" + Name 18 "t2" + Name 23 "@main(" + Name 26 "@sampleResultShadow" + Name 30 "g_sSamp" + Name 39 "@sampleStructTemp" + Name 65 "@sampleResultShadow" + Name 71 "@sampleStructTemp" + Name 87 "s1" + Name 88 "@sampleResultShadow" + Name 90 "g_tTex2s1" + Name 98 "@sampleStructTemp" + Name 112 "s2" + Name 113 "@sampleResultShadow" + Name 114 "g_tTex2s2" + Name 122 "@sampleStructTemp" + Name 136 "s3_t" + MemberName 136(s3_t) 0 "c0" + MemberName 136(s3_t) 1 "c1" + Name 138 "s3" + Name 139 "@sampleResultShadow" + Name 140 "g_tTex2s3" + Name 148 "@sampleStructTemp" + Name 160 "s4_t" + MemberName 160(s4_t) 0 "c0" + MemberName 160(s4_t) 1 "c1" + MemberName 160(s4_t) 2 "c2" + Name 162 "s4" + Name 165 "@sampleResultShadow" + Name 168 "g_tTex2s4" + Name 177 "@sampleStructTemp" + Name 194 "s5_t" + MemberName 194(s5_t) 0 "c0" + MemberName 194(s5_t) 1 "c1" + Name 196 "s5" + Name 199 "@sampleResultShadow" + Name 202 "g_tTex2s5" + Name 211 "@sampleStructTemp" + Name 220 "r0" + Name 221 "param" + Name 224 "r1" + Name 225 "param" + Name 228 "r2" + Name 229 "g_tTex2s1a" + Name 230 "param" + Name 238 "@entryPointOutput" + Decorate 30(g_sSamp) DescriptorSet 0 + Decorate 90(g_tTex2s1) DescriptorSet 0 + Decorate 114(g_tTex2s2) DescriptorSet 0 + Decorate 140(g_tTex2s3) DescriptorSet 0 + Decorate 168(g_tTex2s4) DescriptorSet 0 + Decorate 202(g_tTex2s5) DescriptorSet 0 + Decorate 229(g_tTex2s1a) DescriptorSet 0 + Decorate 238(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeImage 6(float) 2D sampled format:Unknown + 8: TypePointer Function 7 + 9: TypeVector 6(float) 2 + 10(s1_t): TypeStruct 6(float) 9(fvec2) 6(float) + 11: TypeFunction 10(s1_t) 8(ptr) + 15: TypeVector 6(float) 3 + 16(s2_t): TypeStruct 6(float) 15(fvec3) + 17: TypeFunction 16(s2_t) 8(ptr) + 21: TypeVector 6(float) 4 + 22: TypeFunction 21(fvec4) + 25: TypePointer Function 21(fvec4) + 28: TypeSampler + 29: TypePointer UniformConstant 28 + 30(g_sSamp): 29(ptr) Variable UniformConstant + 32: TypeSampledImage 7 + 34: 6(float) Constant 1058642330 + 35: 6(float) Constant 1058810102 + 36: 9(fvec2) ConstantComposite 34 35 + 38: TypePointer Function 10(s1_t) + 40: TypeInt 32 1 + 41: 40(int) Constant 0 + 42: TypeInt 32 0 + 43: 42(int) Constant 0 + 44: TypePointer Function 6(float) + 48: 40(int) Constant 1 + 49: 42(int) Constant 1 + 53: 42(int) Constant 2 + 57: 40(int) Constant 2 + 58: 42(int) Constant 3 + 70: TypePointer Function 16(s2_t) + 89: TypePointer UniformConstant 7 + 90(g_tTex2s1): 89(ptr) Variable UniformConstant + 94: 6(float) Constant 1036831949 + 95: 6(float) Constant 1038174126 + 96: 9(fvec2) ConstantComposite 94 95 + 114(g_tTex2s2): 89(ptr) Variable UniformConstant + 118: 6(float) Constant 1045220557 + 119: 6(float) Constant 1045891645 + 120: 9(fvec2) ConstantComposite 118 119 + 136(s3_t): TypeStruct 9(fvec2) 6(float) + 137: TypePointer Function 136(s3_t) + 140(g_tTex2s3): 89(ptr) Variable UniformConstant + 144: 6(float) Constant 1050253722 + 145: 6(float) Constant 1050589266 + 146: 9(fvec2) ConstantComposite 144 145 + 159: TypeVector 40(int) 2 + 160(s4_t): TypeStruct 40(int) 159(ivec2) 40(int) + 161: TypePointer Function 160(s4_t) + 163: TypeVector 40(int) 4 + 164: TypePointer Function 163(ivec4) + 166: TypeImage 40(int) 2D sampled format:Unknown + 167: TypePointer UniformConstant 166 + 168(g_tTex2s4): 167(ptr) Variable UniformConstant + 171: TypeSampledImage 166 + 173: 6(float) Constant 1053609165 + 174: 6(float) Constant 1053944709 + 175: 9(fvec2) ConstantComposite 173 174 + 178: TypePointer Function 40(int) + 194(s5_t): TypeStruct 42(int) 42(int) + 195: TypePointer Function 194(s5_t) + 197: TypeVector 42(int) 4 + 198: TypePointer Function 197(ivec4) + 200: TypeImage 42(int) 2D sampled format:Unknown + 201: TypePointer UniformConstant 200 + 202(g_tTex2s5): 201(ptr) Variable UniformConstant + 205: TypeSampledImage 200 + 207: 6(float) Constant 1056964608 + 208: 6(float) Constant 1057132380 + 209: 9(fvec2) ConstantComposite 207 208 + 212: TypePointer Function 42(int) + 229(g_tTex2s1a): 89(ptr) Variable UniformConstant + 233: 6(float) Constant 0 + 234: 21(fvec4) ConstantComposite 233 233 233 233 + 237: TypePointer Output 21(fvec4) +238(@entryPointOutput): 237(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 239: 21(fvec4) FunctionCall 23(@main() + Store 238(@entryPointOutput) 239 + Return + FunctionEnd +13(fn1(t2-tx-struct0-1;): 10(s1_t) Function None 11 + 12(t1): 8(ptr) FunctionParameter + 14: Label +26(@sampleResultShadow): 25(ptr) Variable Function +39(@sampleStructTemp): 38(ptr) Variable Function + 27: 7 Load 12(t1) + 31: 28 Load 30(g_sSamp) + 33: 32 SampledImage 27 31 + 37: 21(fvec4) ImageSampleImplicitLod 33 36 + Store 26(@sampleResultShadow) 37 + 45: 44(ptr) AccessChain 26(@sampleResultShadow) 43 + 46: 6(float) Load 45 + 47: 44(ptr) AccessChain 39(@sampleStructTemp) 41 + Store 47 46 + 50: 44(ptr) AccessChain 26(@sampleResultShadow) 49 + 51: 6(float) Load 50 + 52: 44(ptr) AccessChain 39(@sampleStructTemp) 48 43 + Store 52 51 + 54: 44(ptr) AccessChain 26(@sampleResultShadow) 53 + 55: 6(float) Load 54 + 56: 44(ptr) AccessChain 39(@sampleStructTemp) 48 49 + Store 56 55 + 59: 44(ptr) AccessChain 26(@sampleResultShadow) 58 + 60: 6(float) Load 59 + 61: 44(ptr) AccessChain 39(@sampleStructTemp) 57 + Store 61 60 + 62: 10(s1_t) Load 39(@sampleStructTemp) + ReturnValue 62 + FunctionEnd +19(fn1(t2-tx-struct1-1;): 16(s2_t) Function None 17 + 18(t2): 8(ptr) FunctionParameter + 20: Label +65(@sampleResultShadow): 25(ptr) Variable Function +71(@sampleStructTemp): 70(ptr) Variable Function + 66: 7 Load 18(t2) + 67: 28 Load 30(g_sSamp) + 68: 32 SampledImage 66 67 + 69: 21(fvec4) ImageSampleImplicitLod 68 36 + Store 65(@sampleResultShadow) 69 + 72: 44(ptr) AccessChain 65(@sampleResultShadow) 43 + 73: 6(float) Load 72 + 74: 44(ptr) AccessChain 71(@sampleStructTemp) 41 + Store 74 73 + 75: 44(ptr) AccessChain 65(@sampleResultShadow) 49 + 76: 6(float) Load 75 + 77: 44(ptr) AccessChain 71(@sampleStructTemp) 48 43 + Store 77 76 + 78: 44(ptr) AccessChain 65(@sampleResultShadow) 53 + 79: 6(float) Load 78 + 80: 44(ptr) AccessChain 71(@sampleStructTemp) 48 49 + Store 80 79 + 81: 44(ptr) AccessChain 65(@sampleResultShadow) 58 + 82: 6(float) Load 81 + 83: 44(ptr) AccessChain 71(@sampleStructTemp) 48 53 + Store 83 82 + 84: 16(s2_t) Load 71(@sampleStructTemp) + ReturnValue 84 + FunctionEnd + 23(@main(): 21(fvec4) Function None 22 + 24: Label + 87(s1): 38(ptr) Variable Function +88(@sampleResultShadow): 25(ptr) Variable Function +98(@sampleStructTemp): 38(ptr) Variable Function + 112(s2): 70(ptr) Variable Function +113(@sampleResultShadow): 25(ptr) Variable Function +122(@sampleStructTemp): 70(ptr) Variable Function + 138(s3): 137(ptr) Variable Function +139(@sampleResultShadow): 25(ptr) Variable Function +148(@sampleStructTemp): 137(ptr) Variable Function + 162(s4): 161(ptr) Variable Function +165(@sampleResultShadow): 164(ptr) Variable Function +177(@sampleStructTemp): 161(ptr) Variable Function + 196(s5): 195(ptr) Variable Function +199(@sampleResultShadow): 198(ptr) Variable Function +211(@sampleStructTemp): 195(ptr) Variable Function + 220(r0): 38(ptr) Variable Function + 221(param): 8(ptr) Variable Function + 224(r1): 70(ptr) Variable Function + 225(param): 8(ptr) Variable Function + 228(r2): 38(ptr) Variable Function + 230(param): 8(ptr) Variable Function + 91: 7 Load 90(g_tTex2s1) + 92: 28 Load 30(g_sSamp) + 93: 32 SampledImage 91 92 + 97: 21(fvec4) ImageSampleImplicitLod 93 96 + Store 88(@sampleResultShadow) 97 + 99: 44(ptr) AccessChain 88(@sampleResultShadow) 43 + 100: 6(float) Load 99 + 101: 44(ptr) AccessChain 98(@sampleStructTemp) 41 + Store 101 100 + 102: 44(ptr) AccessChain 88(@sampleResultShadow) 49 + 103: 6(float) Load 102 + 104: 44(ptr) AccessChain 98(@sampleStructTemp) 48 43 + Store 104 103 + 105: 44(ptr) AccessChain 88(@sampleResultShadow) 53 + 106: 6(float) Load 105 + 107: 44(ptr) AccessChain 98(@sampleStructTemp) 48 49 + Store 107 106 + 108: 44(ptr) AccessChain 88(@sampleResultShadow) 58 + 109: 6(float) Load 108 + 110: 44(ptr) AccessChain 98(@sampleStructTemp) 57 + Store 110 109 + 111: 10(s1_t) Load 98(@sampleStructTemp) + Store 87(s1) 111 + 115: 7 Load 114(g_tTex2s2) + 116: 28 Load 30(g_sSamp) + 117: 32 SampledImage 115 116 + 121: 21(fvec4) ImageSampleImplicitLod 117 120 + Store 113(@sampleResultShadow) 121 + 123: 44(ptr) AccessChain 113(@sampleResultShadow) 43 + 124: 6(float) Load 123 + 125: 44(ptr) AccessChain 122(@sampleStructTemp) 41 + Store 125 124 + 126: 44(ptr) AccessChain 113(@sampleResultShadow) 49 + 127: 6(float) Load 126 + 128: 44(ptr) AccessChain 122(@sampleStructTemp) 48 43 + Store 128 127 + 129: 44(ptr) AccessChain 113(@sampleResultShadow) 53 + 130: 6(float) Load 129 + 131: 44(ptr) AccessChain 122(@sampleStructTemp) 48 49 + Store 131 130 + 132: 44(ptr) AccessChain 113(@sampleResultShadow) 58 + 133: 6(float) Load 132 + 134: 44(ptr) AccessChain 122(@sampleStructTemp) 48 53 + Store 134 133 + 135: 16(s2_t) Load 122(@sampleStructTemp) + Store 112(s2) 135 + 141: 7 Load 140(g_tTex2s3) + 142: 28 Load 30(g_sSamp) + 143: 32 SampledImage 141 142 + 147: 21(fvec4) ImageSampleImplicitLod 143 146 + Store 139(@sampleResultShadow) 147 + 149: 44(ptr) AccessChain 139(@sampleResultShadow) 43 + 150: 6(float) Load 149 + 151: 44(ptr) AccessChain 148(@sampleStructTemp) 41 43 + Store 151 150 + 152: 44(ptr) AccessChain 139(@sampleResultShadow) 49 + 153: 6(float) Load 152 + 154: 44(ptr) AccessChain 148(@sampleStructTemp) 41 49 + Store 154 153 + 155: 44(ptr) AccessChain 139(@sampleResultShadow) 53 + 156: 6(float) Load 155 + 157: 44(ptr) AccessChain 148(@sampleStructTemp) 48 + Store 157 156 + 158: 136(s3_t) Load 148(@sampleStructTemp) + Store 138(s3) 158 + 169: 166 Load 168(g_tTex2s4) + 170: 28 Load 30(g_sSamp) + 172: 171 SampledImage 169 170 + 176: 163(ivec4) ImageSampleImplicitLod 172 175 + Store 165(@sampleResultShadow) 176 + 179: 178(ptr) AccessChain 165(@sampleResultShadow) 43 + 180: 40(int) Load 179 + 181: 178(ptr) AccessChain 177(@sampleStructTemp) 41 + Store 181 180 + 182: 178(ptr) AccessChain 165(@sampleResultShadow) 49 + 183: 40(int) Load 182 + 184: 6(float) ConvertSToF 183 + 185: 178(ptr) AccessChain 177(@sampleStructTemp) 48 43 + Store 185 184 + 186: 178(ptr) AccessChain 165(@sampleResultShadow) 53 + 187: 40(int) Load 186 + 188: 6(float) ConvertSToF 187 + 189: 178(ptr) AccessChain 177(@sampleStructTemp) 48 49 + Store 189 188 + 190: 178(ptr) AccessChain 165(@sampleResultShadow) 58 + 191: 40(int) Load 190 + 192: 178(ptr) AccessChain 177(@sampleStructTemp) 57 + Store 192 191 + 193: 160(s4_t) Load 177(@sampleStructTemp) + Store 162(s4) 193 + 203: 200 Load 202(g_tTex2s5) + 204: 28 Load 30(g_sSamp) + 206: 205 SampledImage 203 204 + 210: 197(ivec4) ImageSampleImplicitLod 206 209 + Store 199(@sampleResultShadow) 210 + 213: 212(ptr) AccessChain 199(@sampleResultShadow) 43 + 214: 42(int) Load 213 + 215: 212(ptr) AccessChain 211(@sampleStructTemp) 41 + Store 215 214 + 216: 212(ptr) AccessChain 199(@sampleResultShadow) 49 + 217: 42(int) Load 216 + 218: 212(ptr) AccessChain 211(@sampleStructTemp) 48 + Store 218 217 + 219: 194(s5_t) Load 211(@sampleStructTemp) + Store 196(s5) 219 + 222: 7 Load 90(g_tTex2s1) + Store 221(param) 222 + 223: 10(s1_t) FunctionCall 13(fn1(t2-tx-struct0-1;) 221(param) + Store 220(r0) 223 + 226: 7 Load 114(g_tTex2s2) + Store 225(param) 226 + 227: 16(s2_t) FunctionCall 19(fn1(t2-tx-struct1-1;) 225(param) + Store 224(r1) 227 + 231: 7 Load 229(g_tTex2s1a) + Store 230(param) 231 + 232: 10(s1_t) FunctionCall 13(fn1(t2-tx-struct0-1;) 230(param) + Store 228(r2) 232 + ReturnValue 234 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.texture.subvec4.frag.out b/deps/glslang/Test/baseResults/hlsl.texture.subvec4.frag.out new file mode 100644 index 00000000..bf0f146e --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.texture.subvec4.frag.out @@ -0,0 +1,544 @@ +hlsl.texture.subvec4.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:15 Function Definition: @main( ( temp 4-component vector of float) +0:15 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp 2-component vector of uint) +0:24 'sizeQueryTemp' ( temp 2-component vector of uint) +0:24 textureSize ( temp 2-component vector of uint) +0:24 'g_tTex2dmsf1' ( uniform texture2DMS) +0:24 move second child to first child ( temp uint) +0:24 'WidthU' ( temp uint) +0:24 direct index ( temp uint) +0:24 'sizeQueryTemp' ( temp 2-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp uint) +0:24 'HeightU' ( temp uint) +0:24 direct index ( temp uint) +0:24 'sizeQueryTemp' ( temp 2-component vector of uint) +0:24 Constant: +0:24 1 (const int) +0:24 move second child to first child ( temp uint) +0:24 'NumberOfSamplesU' ( temp uint) +0:24 imageQuerySamples ( temp uint) +0:24 'g_tTex2dmsf1' ( uniform texture2DMS) +0:25 Sequence +0:25 move second child to first child ( temp 2-component vector of uint) +0:25 'sizeQueryTemp' ( temp 2-component vector of uint) +0:25 textureSize ( temp 2-component vector of uint) +0:25 'g_tTex2dmsf2' ( uniform texture2DMS) +0:25 move second child to first child ( temp uint) +0:25 'WidthU' ( temp uint) +0:25 direct index ( temp uint) +0:25 'sizeQueryTemp' ( temp 2-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 move second child to first child ( temp uint) +0:25 'HeightU' ( temp uint) +0:25 direct index ( temp uint) +0:25 'sizeQueryTemp' ( temp 2-component vector of uint) +0:25 Constant: +0:25 1 (const int) +0:25 move second child to first child ( temp uint) +0:25 'NumberOfSamplesU' ( temp uint) +0:25 imageQuerySamples ( temp uint) +0:25 'g_tTex2dmsf2' ( uniform texture2DMS) +0:26 Sequence +0:26 move second child to first child ( temp 2-component vector of uint) +0:26 'sizeQueryTemp' ( temp 2-component vector of uint) +0:26 textureSize ( temp 2-component vector of uint) +0:26 'g_tTex2dmsf3' ( uniform texture2DMS) +0:26 move second child to first child ( temp uint) +0:26 'WidthU' ( temp uint) +0:26 direct index ( temp uint) +0:26 'sizeQueryTemp' ( temp 2-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 move second child to first child ( temp uint) +0:26 'HeightU' ( temp uint) +0:26 direct index ( temp uint) +0:26 'sizeQueryTemp' ( temp 2-component vector of uint) +0:26 Constant: +0:26 1 (const int) +0:26 move second child to first child ( temp uint) +0:26 'NumberOfSamplesU' ( temp uint) +0:26 imageQuerySamples ( temp uint) +0:26 'g_tTex2dmsf3' ( uniform texture2DMS) +0:27 Sequence +0:27 move second child to first child ( temp 2-component vector of uint) +0:27 'sizeQueryTemp' ( temp 2-component vector of uint) +0:27 textureSize ( temp 2-component vector of uint) +0:27 'g_tTex2dmsf4' ( uniform texture2DMS) +0:27 move second child to first child ( temp uint) +0:27 'WidthU' ( temp uint) +0:27 direct index ( temp uint) +0:27 'sizeQueryTemp' ( temp 2-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 move second child to first child ( temp uint) +0:27 'HeightU' ( temp uint) +0:27 direct index ( temp uint) +0:27 'sizeQueryTemp' ( temp 2-component vector of uint) +0:27 Constant: +0:27 1 (const int) +0:27 move second child to first child ( temp uint) +0:27 'NumberOfSamplesU' ( temp uint) +0:27 imageQuerySamples ( temp uint) +0:27 'g_tTex2dmsf4' ( uniform texture2DMS) +0:29 Construct float ( temp float) +0:? textureFetch ( temp 4-component vector of float) +0:29 'g_tTex2dmsf1' ( uniform texture2DMS) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:29 Constant: +0:29 3 (const int) +0:30 Construct vec2 ( temp 2-component vector of float) +0:? textureFetch ( temp 4-component vector of float) +0:30 'g_tTex2dmsf2' ( uniform texture2DMS) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:30 Constant: +0:30 3 (const int) +0:31 Construct vec3 ( temp 3-component vector of float) +0:? textureFetch ( temp 4-component vector of float) +0:31 'g_tTex2dmsf3' ( uniform texture2DMS) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:31 Constant: +0:31 3 (const int) +0:32 textureFetch ( temp 4-component vector of float) +0:32 'g_tTex2dmsf4' ( uniform texture2DMS) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:32 Constant: +0:32 3 (const int) +0:34 Construct float ( temp float) +0:? texture ( temp 4-component vector of float) +0:34 Construct combined texture-sampler ( temp sampler2D) +0:34 'g_tTex2df1' ( uniform texture2D) +0:34 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:35 Construct vec2 ( temp 2-component vector of float) +0:? texture ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp sampler2D) +0:35 'g_tTex2df2' ( uniform texture2D) +0:35 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:36 Construct vec3 ( temp 3-component vector of float) +0:? texture ( temp 4-component vector of float) +0:36 Construct combined texture-sampler ( temp sampler2D) +0:36 'g_tTex2df3' ( uniform texture2D) +0:36 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:37 texture ( temp 4-component vector of float) +0:37 Construct combined texture-sampler ( temp sampler2D) +0:37 'g_tTex2df4' ( uniform texture2D) +0:37 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:39 Branch: Return with expression +0:39 Constant: +0:39 0.000000 +0:39 0.000000 +0:39 0.000000 +0:39 0.000000 +0:15 Function Definition: main( ( temp void) +0:15 Function Parameters: +0:? Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:15 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_tTex2dmsf1' ( uniform texture2DMS) +0:? 'g_tTex2dmsf2' ( uniform texture2DMS) +0:? 'g_tTex2dmsf3' ( uniform texture2DMS) +0:? 'g_tTex2dmsf4' ( uniform texture2DMS) +0:? 'g_tTex2df1' ( uniform texture2D) +0:? 'g_tTex2df2' ( uniform texture2D) +0:? 'g_tTex2df3' ( uniform texture2D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_sSamp' ( uniform sampler) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:15 Function Definition: @main( ( temp 4-component vector of float) +0:15 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp 2-component vector of uint) +0:24 'sizeQueryTemp' ( temp 2-component vector of uint) +0:24 textureSize ( temp 2-component vector of uint) +0:24 'g_tTex2dmsf1' ( uniform texture2DMS) +0:24 move second child to first child ( temp uint) +0:24 'WidthU' ( temp uint) +0:24 direct index ( temp uint) +0:24 'sizeQueryTemp' ( temp 2-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 move second child to first child ( temp uint) +0:24 'HeightU' ( temp uint) +0:24 direct index ( temp uint) +0:24 'sizeQueryTemp' ( temp 2-component vector of uint) +0:24 Constant: +0:24 1 (const int) +0:24 move second child to first child ( temp uint) +0:24 'NumberOfSamplesU' ( temp uint) +0:24 imageQuerySamples ( temp uint) +0:24 'g_tTex2dmsf1' ( uniform texture2DMS) +0:25 Sequence +0:25 move second child to first child ( temp 2-component vector of uint) +0:25 'sizeQueryTemp' ( temp 2-component vector of uint) +0:25 textureSize ( temp 2-component vector of uint) +0:25 'g_tTex2dmsf2' ( uniform texture2DMS) +0:25 move second child to first child ( temp uint) +0:25 'WidthU' ( temp uint) +0:25 direct index ( temp uint) +0:25 'sizeQueryTemp' ( temp 2-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 move second child to first child ( temp uint) +0:25 'HeightU' ( temp uint) +0:25 direct index ( temp uint) +0:25 'sizeQueryTemp' ( temp 2-component vector of uint) +0:25 Constant: +0:25 1 (const int) +0:25 move second child to first child ( temp uint) +0:25 'NumberOfSamplesU' ( temp uint) +0:25 imageQuerySamples ( temp uint) +0:25 'g_tTex2dmsf2' ( uniform texture2DMS) +0:26 Sequence +0:26 move second child to first child ( temp 2-component vector of uint) +0:26 'sizeQueryTemp' ( temp 2-component vector of uint) +0:26 textureSize ( temp 2-component vector of uint) +0:26 'g_tTex2dmsf3' ( uniform texture2DMS) +0:26 move second child to first child ( temp uint) +0:26 'WidthU' ( temp uint) +0:26 direct index ( temp uint) +0:26 'sizeQueryTemp' ( temp 2-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 move second child to first child ( temp uint) +0:26 'HeightU' ( temp uint) +0:26 direct index ( temp uint) +0:26 'sizeQueryTemp' ( temp 2-component vector of uint) +0:26 Constant: +0:26 1 (const int) +0:26 move second child to first child ( temp uint) +0:26 'NumberOfSamplesU' ( temp uint) +0:26 imageQuerySamples ( temp uint) +0:26 'g_tTex2dmsf3' ( uniform texture2DMS) +0:27 Sequence +0:27 move second child to first child ( temp 2-component vector of uint) +0:27 'sizeQueryTemp' ( temp 2-component vector of uint) +0:27 textureSize ( temp 2-component vector of uint) +0:27 'g_tTex2dmsf4' ( uniform texture2DMS) +0:27 move second child to first child ( temp uint) +0:27 'WidthU' ( temp uint) +0:27 direct index ( temp uint) +0:27 'sizeQueryTemp' ( temp 2-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 move second child to first child ( temp uint) +0:27 'HeightU' ( temp uint) +0:27 direct index ( temp uint) +0:27 'sizeQueryTemp' ( temp 2-component vector of uint) +0:27 Constant: +0:27 1 (const int) +0:27 move second child to first child ( temp uint) +0:27 'NumberOfSamplesU' ( temp uint) +0:27 imageQuerySamples ( temp uint) +0:27 'g_tTex2dmsf4' ( uniform texture2DMS) +0:29 Construct float ( temp float) +0:? textureFetch ( temp 4-component vector of float) +0:29 'g_tTex2dmsf1' ( uniform texture2DMS) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:29 Constant: +0:29 3 (const int) +0:30 Construct vec2 ( temp 2-component vector of float) +0:? textureFetch ( temp 4-component vector of float) +0:30 'g_tTex2dmsf2' ( uniform texture2DMS) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:30 Constant: +0:30 3 (const int) +0:31 Construct vec3 ( temp 3-component vector of float) +0:? textureFetch ( temp 4-component vector of float) +0:31 'g_tTex2dmsf3' ( uniform texture2DMS) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:31 Constant: +0:31 3 (const int) +0:32 textureFetch ( temp 4-component vector of float) +0:32 'g_tTex2dmsf4' ( uniform texture2DMS) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:32 Constant: +0:32 3 (const int) +0:34 Construct float ( temp float) +0:? texture ( temp 4-component vector of float) +0:34 Construct combined texture-sampler ( temp sampler2D) +0:34 'g_tTex2df1' ( uniform texture2D) +0:34 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:35 Construct vec2 ( temp 2-component vector of float) +0:? texture ( temp 4-component vector of float) +0:35 Construct combined texture-sampler ( temp sampler2D) +0:35 'g_tTex2df2' ( uniform texture2D) +0:35 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:36 Construct vec3 ( temp 3-component vector of float) +0:? texture ( temp 4-component vector of float) +0:36 Construct combined texture-sampler ( temp sampler2D) +0:36 'g_tTex2df3' ( uniform texture2D) +0:36 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:37 texture ( temp 4-component vector of float) +0:37 Construct combined texture-sampler ( temp sampler2D) +0:37 'g_tTex2df4' ( uniform texture2D) +0:37 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.200000 +0:39 Branch: Return with expression +0:39 Constant: +0:39 0.000000 +0:39 0.000000 +0:39 0.000000 +0:39 0.000000 +0:15 Function Definition: main( ( temp void) +0:15 Function Parameters: +0:? Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:15 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_tTex2dmsf1' ( uniform texture2DMS) +0:? 'g_tTex2dmsf2' ( uniform texture2DMS) +0:? 'g_tTex2dmsf3' ( uniform texture2DMS) +0:? 'g_tTex2dmsf4' ( uniform texture2DMS) +0:? 'g_tTex2df1' ( uniform texture2D) +0:? 'g_tTex2df2' ( uniform texture2D) +0:? 'g_tTex2df3' ( uniform texture2D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_sSamp' ( uniform sampler) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 130 + + Capability Shader + Capability ImageQuery + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 128 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 14 "sizeQueryTemp" + Name 17 "g_tTex2dmsf1" + Name 21 "WidthU" + Name 25 "HeightU" + Name 29 "NumberOfSamplesU" + Name 32 "sizeQueryTemp" + Name 33 "g_tTex2dmsf2" + Name 42 "sizeQueryTemp" + Name 43 "g_tTex2dmsf3" + Name 52 "sizeQueryTemp" + Name 53 "g_tTex2dmsf4" + Name 88 "g_tTex2df1" + Name 92 "g_sSamp" + Name 101 "g_tTex2df2" + Name 109 "g_tTex2df3" + Name 118 "g_tTex2df4" + Name 128 "@entryPointOutput" + Decorate 17(g_tTex2dmsf1) DescriptorSet 0 + Decorate 33(g_tTex2dmsf2) DescriptorSet 0 + Decorate 43(g_tTex2dmsf3) DescriptorSet 0 + Decorate 53(g_tTex2dmsf4) DescriptorSet 0 + Decorate 88(g_tTex2df1) DescriptorSet 0 + Decorate 92(g_sSamp) DescriptorSet 0 + Decorate 101(g_tTex2df2) DescriptorSet 0 + Decorate 109(g_tTex2df3) DescriptorSet 0 + Decorate 118(g_tTex2df4) DescriptorSet 0 + Decorate 128(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeInt 32 0 + 12: TypeVector 11(int) 2 + 13: TypePointer Function 12(ivec2) + 15: TypeImage 6(float) 2D multi-sampled sampled format:Unknown + 16: TypePointer UniformConstant 15 +17(g_tTex2dmsf1): 16(ptr) Variable UniformConstant + 20: TypePointer Function 11(int) + 22: 11(int) Constant 0 + 26: 11(int) Constant 1 +33(g_tTex2dmsf2): 16(ptr) Variable UniformConstant +43(g_tTex2dmsf3): 16(ptr) Variable UniformConstant +53(g_tTex2dmsf4): 16(ptr) Variable UniformConstant + 63: TypeInt 32 1 + 64: TypeVector 63(int) 2 + 65: 63(int) Constant 1 + 66: 63(int) Constant 2 + 67: 64(ivec2) ConstantComposite 65 66 + 68: 63(int) Constant 3 + 73: TypeVector 6(float) 2 + 79: TypeVector 6(float) 3 + 86: TypeImage 6(float) 2D sampled format:Unknown + 87: TypePointer UniformConstant 86 + 88(g_tTex2df1): 87(ptr) Variable UniformConstant + 90: TypeSampler + 91: TypePointer UniformConstant 90 + 92(g_sSamp): 91(ptr) Variable UniformConstant + 94: TypeSampledImage 86 + 96: 6(float) Constant 1036831949 + 97: 6(float) Constant 1045220557 + 98: 73(fvec2) ConstantComposite 96 97 + 101(g_tTex2df2): 87(ptr) Variable UniformConstant + 109(g_tTex2df3): 87(ptr) Variable UniformConstant + 118(g_tTex2df4): 87(ptr) Variable UniformConstant + 123: 6(float) Constant 0 + 124: 7(fvec4) ConstantComposite 123 123 123 123 + 127: TypePointer Output 7(fvec4) +128(@entryPointOutput): 127(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 129: 7(fvec4) FunctionCall 9(@main() + Store 128(@entryPointOutput) 129 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label +14(sizeQueryTemp): 13(ptr) Variable Function + 21(WidthU): 20(ptr) Variable Function + 25(HeightU): 20(ptr) Variable Function +29(NumberOfSamplesU): 20(ptr) Variable Function +32(sizeQueryTemp): 13(ptr) Variable Function +42(sizeQueryTemp): 13(ptr) Variable Function +52(sizeQueryTemp): 13(ptr) Variable Function + 18: 15 Load 17(g_tTex2dmsf1) + 19: 12(ivec2) ImageQuerySize 18 + Store 14(sizeQueryTemp) 19 + 23: 20(ptr) AccessChain 14(sizeQueryTemp) 22 + 24: 11(int) Load 23 + Store 21(WidthU) 24 + 27: 20(ptr) AccessChain 14(sizeQueryTemp) 26 + 28: 11(int) Load 27 + Store 25(HeightU) 28 + 30: 15 Load 17(g_tTex2dmsf1) + 31: 11(int) ImageQuerySamples 30 + Store 29(NumberOfSamplesU) 31 + 34: 15 Load 33(g_tTex2dmsf2) + 35: 12(ivec2) ImageQuerySize 34 + Store 32(sizeQueryTemp) 35 + 36: 20(ptr) AccessChain 32(sizeQueryTemp) 22 + 37: 11(int) Load 36 + Store 21(WidthU) 37 + 38: 20(ptr) AccessChain 32(sizeQueryTemp) 26 + 39: 11(int) Load 38 + Store 25(HeightU) 39 + 40: 15 Load 33(g_tTex2dmsf2) + 41: 11(int) ImageQuerySamples 40 + Store 29(NumberOfSamplesU) 41 + 44: 15 Load 43(g_tTex2dmsf3) + 45: 12(ivec2) ImageQuerySize 44 + Store 42(sizeQueryTemp) 45 + 46: 20(ptr) AccessChain 42(sizeQueryTemp) 22 + 47: 11(int) Load 46 + Store 21(WidthU) 47 + 48: 20(ptr) AccessChain 42(sizeQueryTemp) 26 + 49: 11(int) Load 48 + Store 25(HeightU) 49 + 50: 15 Load 43(g_tTex2dmsf3) + 51: 11(int) ImageQuerySamples 50 + Store 29(NumberOfSamplesU) 51 + 54: 15 Load 53(g_tTex2dmsf4) + 55: 12(ivec2) ImageQuerySize 54 + Store 52(sizeQueryTemp) 55 + 56: 20(ptr) AccessChain 52(sizeQueryTemp) 22 + 57: 11(int) Load 56 + Store 21(WidthU) 57 + 58: 20(ptr) AccessChain 52(sizeQueryTemp) 26 + 59: 11(int) Load 58 + Store 25(HeightU) 59 + 60: 15 Load 53(g_tTex2dmsf4) + 61: 11(int) ImageQuerySamples 60 + Store 29(NumberOfSamplesU) 61 + 62: 15 Load 17(g_tTex2dmsf1) + 69: 7(fvec4) ImageFetch 62 67 Sample 68 + 70: 6(float) CompositeExtract 69 0 + 71: 15 Load 33(g_tTex2dmsf2) + 72: 7(fvec4) ImageFetch 71 67 Sample 68 + 74: 6(float) CompositeExtract 72 0 + 75: 6(float) CompositeExtract 72 1 + 76: 73(fvec2) CompositeConstruct 74 75 + 77: 15 Load 43(g_tTex2dmsf3) + 78: 7(fvec4) ImageFetch 77 67 Sample 68 + 80: 6(float) CompositeExtract 78 0 + 81: 6(float) CompositeExtract 78 1 + 82: 6(float) CompositeExtract 78 2 + 83: 79(fvec3) CompositeConstruct 80 81 82 + 84: 15 Load 53(g_tTex2dmsf4) + 85: 7(fvec4) ImageFetch 84 67 Sample 68 + 89: 86 Load 88(g_tTex2df1) + 93: 90 Load 92(g_sSamp) + 95: 94 SampledImage 89 93 + 99: 7(fvec4) ImageSampleImplicitLod 95 98 + 100: 6(float) CompositeExtract 99 0 + 102: 86 Load 101(g_tTex2df2) + 103: 90 Load 92(g_sSamp) + 104: 94 SampledImage 102 103 + 105: 7(fvec4) ImageSampleImplicitLod 104 98 + 106: 6(float) CompositeExtract 105 0 + 107: 6(float) CompositeExtract 105 1 + 108: 73(fvec2) CompositeConstruct 106 107 + 110: 86 Load 109(g_tTex2df3) + 111: 90 Load 92(g_sSamp) + 112: 94 SampledImage 110 111 + 113: 7(fvec4) ImageSampleImplicitLod 112 98 + 114: 6(float) CompositeExtract 113 0 + 115: 6(float) CompositeExtract 113 1 + 116: 6(float) CompositeExtract 113 2 + 117: 79(fvec3) CompositeConstruct 114 115 116 + 119: 86 Load 118(g_tTex2df4) + 120: 90 Load 92(g_sSamp) + 121: 94 SampledImage 119 120 + 122: 7(fvec4) ImageSampleImplicitLod 121 98 + ReturnValue 124 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.texturebuffer.frag.out b/deps/glslang/Test/baseResults/hlsl.texturebuffer.frag.out new file mode 100644 index 00000000..89b5c542 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.texturebuffer.frag.out @@ -0,0 +1,153 @@ +hlsl.texturebuffer.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:15 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:15 Function Parameters: +0:15 'pos' ( in 4-component vector of float) +0:? Sequence +0:16 Branch: Return with expression +0:16 add ( temp 4-component vector of float) +0:16 f: direct index for structure (layout( row_major std430) buffer 4-component vector of float) +0:16 'TextureBuffer_var' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f, layout( row_major std430) buffer 4-component vector of int i}) +0:16 Constant: +0:16 0 (const int) +0:16 f2: direct index for structure (layout( row_major std430) buffer 4-component vector of float) +0:16 'anon@0' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f2, layout( row_major std430) buffer 4-component vector of int i2}) +0:16 Constant: +0:16 0 (const uint) +0:15 Function Definition: main( ( temp void) +0:15 Function Parameters: +0:? Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:15 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:15 Function Call: @main(vf4; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'TextureBuffer_var' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f, layout( row_major std430) buffer 4-component vector of int i}) +0:? 'anon@0' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f2, layout( row_major std430) buffer 4-component vector of int i2}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:15 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:15 Function Parameters: +0:15 'pos' ( in 4-component vector of float) +0:? Sequence +0:16 Branch: Return with expression +0:16 add ( temp 4-component vector of float) +0:16 f: direct index for structure (layout( row_major std430) buffer 4-component vector of float) +0:16 'TextureBuffer_var' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f, layout( row_major std430) buffer 4-component vector of int i}) +0:16 Constant: +0:16 0 (const int) +0:16 f2: direct index for structure (layout( row_major std430) buffer 4-component vector of float) +0:16 'anon@0' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f2, layout( row_major std430) buffer 4-component vector of int i2}) +0:16 Constant: +0:16 0 (const uint) +0:15 Function Definition: main( ( temp void) +0:15 Function Parameters: +0:? Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:15 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:15 Function Call: @main(vf4; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'TextureBuffer_var' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f, layout( row_major std430) buffer 4-component vector of int i}) +0:? 'anon@0' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f2, layout( row_major std430) buffer 4-component vector of int i2}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 39 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 32 35 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vf4;" + Name 10 "pos" + Name 15 "TextureBuffer_var" + MemberName 15(TextureBuffer_var) 0 "f" + MemberName 15(TextureBuffer_var) 1 "i" + Name 17 "TextureBuffer_var" + Name 22 "tbuf2" + MemberName 22(tbuf2) 0 "f2" + MemberName 22(tbuf2) 1 "i2" + Name 24 "" + Name 30 "pos" + Name 32 "pos" + Name 35 "@entryPointOutput" + Name 36 "param" + MemberDecorate 15(TextureBuffer_var) 0 NonWritable + MemberDecorate 15(TextureBuffer_var) 0 Offset 0 + MemberDecorate 15(TextureBuffer_var) 1 NonWritable + MemberDecorate 15(TextureBuffer_var) 1 Offset 16 + Decorate 15(TextureBuffer_var) BufferBlock + Decorate 17(TextureBuffer_var) DescriptorSet 0 + Decorate 17(TextureBuffer_var) Binding 0 + MemberDecorate 22(tbuf2) 0 NonWritable + MemberDecorate 22(tbuf2) 0 Offset 0 + MemberDecorate 22(tbuf2) 1 NonWritable + MemberDecorate 22(tbuf2) 1 Offset 16 + Decorate 22(tbuf2) BufferBlock + Decorate 24 DescriptorSet 0 + Decorate 32(pos) BuiltIn FragCoord + Decorate 35(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) + 13: TypeInt 32 1 + 14: TypeVector 13(int) 4 +15(TextureBuffer_var): TypeStruct 7(fvec4) 14(ivec4) + 16: TypePointer Uniform 15(TextureBuffer_var) +17(TextureBuffer_var): 16(ptr) Variable Uniform + 18: 13(int) Constant 0 + 19: TypePointer Uniform 7(fvec4) + 22(tbuf2): TypeStruct 7(fvec4) 14(ivec4) + 23: TypePointer Uniform 22(tbuf2) + 24: 23(ptr) Variable Uniform + 31: TypePointer Input 7(fvec4) + 32(pos): 31(ptr) Variable Input + 34: TypePointer Output 7(fvec4) +35(@entryPointOutput): 34(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 30(pos): 8(ptr) Variable Function + 36(param): 8(ptr) Variable Function + 33: 7(fvec4) Load 32(pos) + Store 30(pos) 33 + 37: 7(fvec4) Load 30(pos) + Store 36(param) 37 + 38: 7(fvec4) FunctionCall 11(@main(vf4;) 36(param) + Store 35(@entryPointOutput) 38 + Return + FunctionEnd + 11(@main(vf4;): 7(fvec4) Function None 9 + 10(pos): 8(ptr) FunctionParameter + 12: Label + 20: 19(ptr) AccessChain 17(TextureBuffer_var) 18 + 21: 7(fvec4) Load 20 + 25: 19(ptr) AccessChain 24 18 + 26: 7(fvec4) Load 25 + 27: 7(fvec4) FAdd 21 26 + ReturnValue 27 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.this.frag.out b/deps/glslang/Test/baseResults/hlsl.this.frag.out new file mode 100644 index 00000000..ac5fde8b --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.this.frag.out @@ -0,0 +1,379 @@ +hlsl.this.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:1 Sequence +0:1 move second child to first child ( temp 2-component vector of float) +0:1 'var' ( global 2-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:6 Function Definition: type1::memFun1(vi3; ( temp int) +0:6 Function Parameters: +0:6 '@this' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:6 'var' ( in 3-component vector of int) +0:? Sequence +0:7 Branch: Return with expression +0:7 add ( temp int) +0:7 add ( temp int) +0:7 direct index ( temp int) +0:7 'var' ( in 3-component vector of int) +0:7 Constant: +0:7 2 (const int) +0:7 var: direct index for structure ( temp int) +0:7 '@this' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:7 Constant: +0:7 1 (const int) +0:7 var2: direct index for structure ( temp int) +0:7 '@this' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:7 Constant: +0:7 2 (const uint) +0:10 Function Definition: type1::memFun2(i1; ( temp int) +0:10 Function Parameters: +0:10 '@this' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:10 'a' ( in int) +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp 3-component vector of int) +0:11 'var' ( temp 3-component vector of int) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:? 3 (const int) +0:12 Branch: Return with expression +0:12 add ( temp int) +0:12 add ( temp int) +0:12 direct index ( temp int) +0:12 'var' ( temp 3-component vector of int) +0:12 Constant: +0:12 2 (const int) +0:12 Convert float to int ( temp int) +0:12 direct index ( temp float) +0:12 bar: direct index for structure ( temp 2-component vector of float) +0:12 '@this' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:12 Constant: +0:12 0 (const uint) +0:12 Constant: +0:12 1 (const int) +0:12 var2: direct index for structure ( temp int) +0:12 '@this' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:12 Constant: +0:12 2 (const int) +0:20 Function Definition: @main( ( temp 4-component vector of float) +0:20 Function Parameters: +0:? Sequence +0:22 move second child to first child ( temp 2-component vector of float) +0:22 bar: direct index for structure ( temp 2-component vector of float) +0:22 'T' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:22 Constant: +0:22 0 (const int) +0:22 'var' ( global 2-component vector of float) +0:23 move second child to first child ( temp int) +0:23 var: direct index for structure ( temp int) +0:23 'T' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:23 Constant: +0:23 1 (const int) +0:23 Constant: +0:23 7 (const int) +0:24 move second child to first child ( temp int) +0:24 var2: direct index for structure ( temp int) +0:24 'T' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 9 (const int) +0:25 Sequence +0:25 move second child to first child ( temp int) +0:25 'i' ( temp int) +0:25 Function Call: type1::memFun1(vi3; ( temp int) +0:25 'T' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:? Constant: +0:? 10 (const int) +0:? 11 (const int) +0:? 12 (const int) +0:26 add second child into first child ( temp int) +0:26 'i' ( temp int) +0:26 Function Call: type1::memFun2(i1; ( temp int) +0:26 'T' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:26 Constant: +0:26 17 (const int) +0:28 Branch: Return with expression +0:? Construct vec4 ( temp 4-component vector of float) +0:28 Convert int to float ( temp float) +0:28 'i' ( temp int) +0:28 Convert int to float ( temp float) +0:28 'i' ( temp int) +0:28 Convert int to float ( temp float) +0:28 'i' ( temp int) +0:28 Convert int to float ( temp float) +0:28 'i' ( temp int) +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:20 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'var' ( global 2-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:1 Sequence +0:1 move second child to first child ( temp 2-component vector of float) +0:1 'var' ( global 2-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:6 Function Definition: type1::memFun1(vi3; ( temp int) +0:6 Function Parameters: +0:6 '@this' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:6 'var' ( in 3-component vector of int) +0:? Sequence +0:7 Branch: Return with expression +0:7 add ( temp int) +0:7 add ( temp int) +0:7 direct index ( temp int) +0:7 'var' ( in 3-component vector of int) +0:7 Constant: +0:7 2 (const int) +0:7 var: direct index for structure ( temp int) +0:7 '@this' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:7 Constant: +0:7 1 (const int) +0:7 var2: direct index for structure ( temp int) +0:7 '@this' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:7 Constant: +0:7 2 (const uint) +0:10 Function Definition: type1::memFun2(i1; ( temp int) +0:10 Function Parameters: +0:10 '@this' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:10 'a' ( in int) +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp 3-component vector of int) +0:11 'var' ( temp 3-component vector of int) +0:? Constant: +0:? 1 (const int) +0:? 2 (const int) +0:? 3 (const int) +0:12 Branch: Return with expression +0:12 add ( temp int) +0:12 add ( temp int) +0:12 direct index ( temp int) +0:12 'var' ( temp 3-component vector of int) +0:12 Constant: +0:12 2 (const int) +0:12 Convert float to int ( temp int) +0:12 direct index ( temp float) +0:12 bar: direct index for structure ( temp 2-component vector of float) +0:12 '@this' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:12 Constant: +0:12 0 (const uint) +0:12 Constant: +0:12 1 (const int) +0:12 var2: direct index for structure ( temp int) +0:12 '@this' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:12 Constant: +0:12 2 (const int) +0:20 Function Definition: @main( ( temp 4-component vector of float) +0:20 Function Parameters: +0:? Sequence +0:22 move second child to first child ( temp 2-component vector of float) +0:22 bar: direct index for structure ( temp 2-component vector of float) +0:22 'T' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:22 Constant: +0:22 0 (const int) +0:22 'var' ( global 2-component vector of float) +0:23 move second child to first child ( temp int) +0:23 var: direct index for structure ( temp int) +0:23 'T' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:23 Constant: +0:23 1 (const int) +0:23 Constant: +0:23 7 (const int) +0:24 move second child to first child ( temp int) +0:24 var2: direct index for structure ( temp int) +0:24 'T' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 9 (const int) +0:25 Sequence +0:25 move second child to first child ( temp int) +0:25 'i' ( temp int) +0:25 Function Call: type1::memFun1(vi3; ( temp int) +0:25 'T' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:? Constant: +0:? 10 (const int) +0:? 11 (const int) +0:? 12 (const int) +0:26 add second child into first child ( temp int) +0:26 'i' ( temp int) +0:26 Function Call: type1::memFun2(i1; ( temp int) +0:26 'T' ( temp structure{ temp 2-component vector of float bar, temp int var, temp int var2}) +0:26 Constant: +0:26 17 (const int) +0:28 Branch: Return with expression +0:? Construct vec4 ( temp 4-component vector of float) +0:28 Convert int to float ( temp float) +0:28 'i' ( temp int) +0:28 Convert int to float ( temp float) +0:28 'i' ( temp int) +0:28 Convert int to float ( temp float) +0:28 'i' ( temp int) +0:28 Convert int to float ( temp float) +0:28 'i' ( temp int) +0:20 Function Definition: main( ( temp void) +0:20 Function Parameters: +0:? Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:20 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'var' ( global 2-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 98 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 96 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "type1" + MemberName 9(type1) 0 "bar" + MemberName 9(type1) 1 "var" + MemberName 9(type1) 2 "var2" + Name 16 "type1::memFun1(vi3;" + Name 14 "@this" + Name 15 "var" + Name 22 "type1::memFun2(i1;" + Name 20 "@this" + Name 21 "a" + Name 26 "@main(" + Name 29 "var" + Name 47 "var" + Name 64 "T" + Name 72 "i" + Name 77 "param" + Name 80 "param" + Name 96 "@entryPointOutput" + Decorate 96(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypeInt 32 1 + 9(type1): TypeStruct 7(fvec2) 8(int) 8(int) + 10: TypePointer Function 9(type1) + 11: TypeVector 8(int) 3 + 12: TypePointer Function 11(ivec3) + 13: TypeFunction 8(int) 10(ptr) 12(ptr) + 18: TypePointer Function 8(int) + 19: TypeFunction 8(int) 10(ptr) 18(ptr) + 24: TypeVector 6(float) 4 + 25: TypeFunction 24(fvec4) + 28: TypePointer Private 7(fvec2) + 29(var): 28(ptr) Variable Private + 30: 6(float) Constant 1065353216 + 31: 6(float) Constant 1073741824 + 32: 7(fvec2) ConstantComposite 30 31 + 33: TypeInt 32 0 + 34: 33(int) Constant 2 + 37: 8(int) Constant 1 + 41: 8(int) Constant 2 + 48: 8(int) Constant 3 + 49: 11(ivec3) ConstantComposite 37 41 48 + 52: 8(int) Constant 0 + 53: 33(int) Constant 1 + 54: TypePointer Function 6(float) + 66: TypePointer Function 7(fvec2) + 68: 8(int) Constant 7 + 70: 8(int) Constant 9 + 73: 8(int) Constant 10 + 74: 8(int) Constant 11 + 75: 8(int) Constant 12 + 76: 11(ivec3) ConstantComposite 73 74 75 + 79: 8(int) Constant 17 + 95: TypePointer Output 24(fvec4) +96(@entryPointOutput): 95(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + Store 29(var) 32 + 97: 24(fvec4) FunctionCall 26(@main() + Store 96(@entryPointOutput) 97 + Return + FunctionEnd +16(type1::memFun1(vi3;): 8(int) Function None 13 + 14(@this): 10(ptr) FunctionParameter + 15(var): 12(ptr) FunctionParameter + 17: Label + 35: 18(ptr) AccessChain 15(var) 34 + 36: 8(int) Load 35 + 38: 18(ptr) AccessChain 14(@this) 37 + 39: 8(int) Load 38 + 40: 8(int) IAdd 36 39 + 42: 18(ptr) AccessChain 14(@this) 41 + 43: 8(int) Load 42 + 44: 8(int) IAdd 40 43 + ReturnValue 44 + FunctionEnd +22(type1::memFun2(i1;): 8(int) Function None 19 + 20(@this): 10(ptr) FunctionParameter + 21(a): 18(ptr) FunctionParameter + 23: Label + 47(var): 12(ptr) Variable Function + Store 47(var) 49 + 50: 18(ptr) AccessChain 47(var) 34 + 51: 8(int) Load 50 + 55: 54(ptr) AccessChain 20(@this) 52 53 + 56: 6(float) Load 55 + 57: 8(int) ConvertFToS 56 + 58: 8(int) IAdd 51 57 + 59: 18(ptr) AccessChain 20(@this) 41 + 60: 8(int) Load 59 + 61: 8(int) IAdd 58 60 + ReturnValue 61 + FunctionEnd + 26(@main(): 24(fvec4) Function None 25 + 27: Label + 64(T): 10(ptr) Variable Function + 72(i): 18(ptr) Variable Function + 77(param): 12(ptr) Variable Function + 80(param): 18(ptr) Variable Function + 65: 7(fvec2) Load 29(var) + 67: 66(ptr) AccessChain 64(T) 52 + Store 67 65 + 69: 18(ptr) AccessChain 64(T) 37 + Store 69 68 + 71: 18(ptr) AccessChain 64(T) 41 + Store 71 70 + Store 77(param) 76 + 78: 8(int) FunctionCall 16(type1::memFun1(vi3;) 64(T) 77(param) + Store 72(i) 78 + Store 80(param) 79 + 81: 8(int) FunctionCall 22(type1::memFun2(i1;) 64(T) 80(param) + 82: 8(int) Load 72(i) + 83: 8(int) IAdd 82 81 + Store 72(i) 83 + 84: 8(int) Load 72(i) + 85: 6(float) ConvertSToF 84 + 86: 8(int) Load 72(i) + 87: 6(float) ConvertSToF 86 + 88: 8(int) Load 72(i) + 89: 6(float) ConvertSToF 88 + 90: 8(int) Load 72(i) + 91: 6(float) ConvertSToF 90 + 92: 24(fvec4) CompositeConstruct 85 87 89 91 + ReturnValue 92 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.tristream-append.geom.out b/deps/glslang/Test/baseResults/hlsl.tristream-append.geom.out new file mode 100644 index 00000000..c1167249 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.tristream-append.geom.out @@ -0,0 +1,216 @@ +hlsl.tristream-append.geom +Shader version: 500 +invocations = -1 +max_vertices = 3 +input primitive = triangles +output primitive = triangle_strip +0:? Sequence +0:8 Function Definition: EmitVertex(struct-GSPS_INPUT1;struct-GSPS_INPUT1; ( temp void) +0:8 Function Parameters: +0:8 'output' ( in structure{}) +0:8 'TriStream' ( out structure{}) +0:? Sequence +0:9 Sequence +0:9 Sequence +0:9 move second child to first child ( temp structure{}) +0:9 'TriStream' ( out structure{}) +0:9 'output' ( in structure{}) +0:9 EmitVertex ( temp void) +0:14 Function Definition: @main(struct-GSPS_INPUT1[3];struct-GSPS_INPUT1; ( temp void) +0:14 Function Parameters: +0:14 'input' ( in 3-element array of structure{}) +0:14 'TriStream' ( out structure{}) +0:? Sequence +0:15 Function Call: EmitVertex(struct-GSPS_INPUT1;struct-GSPS_INPUT1; ( temp void) +0:15 direct index ( temp structure{}) +0:15 'input' ( in 3-element array of structure{}) +0:15 Constant: +0:15 0 (const int) +0:15 'TriStream' ( out structure{}) +0:16 Function Call: EmitVertex(struct-GSPS_INPUT1;struct-GSPS_INPUT1; ( temp void) +0:16 direct index ( temp structure{}) +0:16 'input' ( in 3-element array of structure{}) +0:16 Constant: +0:16 1 (const int) +0:16 'TriStream' ( out structure{}) +0:17 Function Call: EmitVertex(struct-GSPS_INPUT1;struct-GSPS_INPUT1; ( temp void) +0:17 direct index ( temp structure{}) +0:17 'input' ( in 3-element array of structure{}) +0:17 Constant: +0:17 2 (const int) +0:17 'TriStream' ( out structure{}) +0:14 Function Definition: main( ( temp void) +0:14 Function Parameters: +0:? Sequence +0:14 move second child to first child ( temp 3-element array of structure{}) +0:? 'input' ( temp 3-element array of structure{}) +0:? 'input' ( in 3-element array of structure{}) +0:14 Function Call: @main(struct-GSPS_INPUT1[3];struct-GSPS_INPUT1; ( temp void) +0:? 'input' ( temp 3-element array of structure{}) +0:? 'TriStream' ( temp structure{}) +0:? Linker Objects + + +Linked geometry stage: + + +Shader version: 500 +invocations = 1 +max_vertices = 3 +input primitive = triangles +output primitive = triangle_strip +0:? Sequence +0:8 Function Definition: EmitVertex(struct-GSPS_INPUT1;struct-GSPS_INPUT1; ( temp void) +0:8 Function Parameters: +0:8 'output' ( in structure{}) +0:8 'TriStream' ( out structure{}) +0:? Sequence +0:9 Sequence +0:9 Sequence +0:9 move second child to first child ( temp structure{}) +0:9 'TriStream' ( out structure{}) +0:9 'output' ( in structure{}) +0:9 EmitVertex ( temp void) +0:14 Function Definition: @main(struct-GSPS_INPUT1[3];struct-GSPS_INPUT1; ( temp void) +0:14 Function Parameters: +0:14 'input' ( in 3-element array of structure{}) +0:14 'TriStream' ( out structure{}) +0:? Sequence +0:15 Function Call: EmitVertex(struct-GSPS_INPUT1;struct-GSPS_INPUT1; ( temp void) +0:15 direct index ( temp structure{}) +0:15 'input' ( in 3-element array of structure{}) +0:15 Constant: +0:15 0 (const int) +0:15 'TriStream' ( out structure{}) +0:16 Function Call: EmitVertex(struct-GSPS_INPUT1;struct-GSPS_INPUT1; ( temp void) +0:16 direct index ( temp structure{}) +0:16 'input' ( in 3-element array of structure{}) +0:16 Constant: +0:16 1 (const int) +0:16 'TriStream' ( out structure{}) +0:17 Function Call: EmitVertex(struct-GSPS_INPUT1;struct-GSPS_INPUT1; ( temp void) +0:17 direct index ( temp structure{}) +0:17 'input' ( in 3-element array of structure{}) +0:17 Constant: +0:17 2 (const int) +0:17 'TriStream' ( out structure{}) +0:14 Function Definition: main( ( temp void) +0:14 Function Parameters: +0:? Sequence +0:14 move second child to first child ( temp 3-element array of structure{}) +0:? 'input' ( temp 3-element array of structure{}) +0:? 'input' ( in 3-element array of structure{}) +0:14 Function Call: @main(struct-GSPS_INPUT1[3];struct-GSPS_INPUT1; ( temp void) +0:? 'input' ( temp 3-element array of structure{}) +0:? 'TriStream' ( temp structure{}) +0:? Linker Objects + +error: SPIRV-Tools Validation Errors +error: Output variable id <23> is used by entry point 'main' id <4>, but is not listed as an interface + %TriStream_1 = OpVariable %_ptr_Output_GSPS_INPUT Output + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 57 + + Capability Geometry + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" + ExecutionMode 4 Triangles + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputTriangleStrip + ExecutionMode 4 OutputVertices 3 + Source HLSL 500 + Name 4 "main" + Name 6 "GSPS_INPUT" + Name 11 "EmitVertex(struct-GSPS_INPUT1;struct-GSPS_INPUT1;" + Name 9 "output" + Name 10 "TriStream" + Name 20 "@main(struct-GSPS_INPUT1[3];struct-GSPS_INPUT1;" + Name 18 "input" + Name 19 "TriStream" + Name 23 "TriStream" + Name 27 "param" + Name 30 "param" + Name 34 "param" + Name 37 "param" + Name 41 "param" + Name 44 "param" + Name 47 "input" + Name 49 "input" + Name 51 "TriStream" + Name 52 "param" + Name 54 "param" + 2: TypeVoid + 3: TypeFunction 2 + 6(GSPS_INPUT): TypeStruct + 7: TypePointer Function 6(GSPS_INPUT) + 8: TypeFunction 2 7(ptr) 7(ptr) + 13: TypeInt 32 0 + 14: 13(int) Constant 3 + 15: TypeArray 6(GSPS_INPUT) 14 + 16: TypePointer Function 15 + 17: TypeFunction 2 16(ptr) 7(ptr) + 22: TypePointer Output 6(GSPS_INPUT) + 23(TriStream): 22(ptr) Variable Output + 25: TypeInt 32 1 + 26: 25(int) Constant 0 + 33: 25(int) Constant 1 + 40: 25(int) Constant 2 + 48: TypePointer Input 15 + 49(input): 48(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 47(input): 16(ptr) Variable Function + 51(TriStream): 7(ptr) Variable Function + 52(param): 16(ptr) Variable Function + 54(param): 7(ptr) Variable Function + 50: 15 Load 49(input) + Store 47(input) 50 + 53: 15 Load 47(input) + Store 52(param) 53 + 55: 2 FunctionCall 20(@main(struct-GSPS_INPUT1[3];struct-GSPS_INPUT1;) 52(param) 54(param) + 56:6(GSPS_INPUT) Load 54(param) + Store 51(TriStream) 56 + Return + FunctionEnd +11(EmitVertex(struct-GSPS_INPUT1;struct-GSPS_INPUT1;): 2 Function None 8 + 9(output): 7(ptr) FunctionParameter + 10(TriStream): 7(ptr) FunctionParameter + 12: Label + 24:6(GSPS_INPUT) Load 9(output) + Store 23(TriStream) 24 + EmitVertex + Return + FunctionEnd +20(@main(struct-GSPS_INPUT1[3];struct-GSPS_INPUT1;): 2 Function None 17 + 18(input): 16(ptr) FunctionParameter + 19(TriStream): 7(ptr) FunctionParameter + 21: Label + 27(param): 7(ptr) Variable Function + 30(param): 7(ptr) Variable Function + 34(param): 7(ptr) Variable Function + 37(param): 7(ptr) Variable Function + 41(param): 7(ptr) Variable Function + 44(param): 7(ptr) Variable Function + 28: 7(ptr) AccessChain 18(input) 26 + 29:6(GSPS_INPUT) Load 28 + Store 27(param) 29 + 31: 2 FunctionCall 11(EmitVertex(struct-GSPS_INPUT1;struct-GSPS_INPUT1;) 27(param) 30(param) + 32:6(GSPS_INPUT) Load 30(param) + Store 19(TriStream) 32 + 35: 7(ptr) AccessChain 18(input) 33 + 36:6(GSPS_INPUT) Load 35 + Store 34(param) 36 + 38: 2 FunctionCall 11(EmitVertex(struct-GSPS_INPUT1;struct-GSPS_INPUT1;) 34(param) 37(param) + 39:6(GSPS_INPUT) Load 37(param) + Store 19(TriStream) 39 + 42: 7(ptr) AccessChain 18(input) 40 + 43:6(GSPS_INPUT) Load 42 + Store 41(param) 43 + 45: 2 FunctionCall 11(EmitVertex(struct-GSPS_INPUT1;struct-GSPS_INPUT1;) 41(param) 44(param) + 46:6(GSPS_INPUT) Load 44(param) + Store 19(TriStream) 46 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.tx.bracket.frag.out b/deps/glslang/Test/baseResults/hlsl.tx.bracket.frag.out new file mode 100644 index 00000000..400beb61 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.tx.bracket.frag.out @@ -0,0 +1,716 @@ +hlsl.tx.bracket.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:38 Function Definition: Fn1(vi4; ( temp 4-component vector of int) +0:38 Function Parameters: +0:38 'x' ( in 4-component vector of int) +0:? Sequence +0:38 Branch: Return with expression +0:38 'x' ( in 4-component vector of int) +0:39 Function Definition: Fn1(vu4; ( temp 4-component vector of uint) +0:39 Function Parameters: +0:39 'x' ( in 4-component vector of uint) +0:? Sequence +0:39 Branch: Return with expression +0:39 'x' ( in 4-component vector of uint) +0:40 Function Definition: Fn1(vf4; ( temp 4-component vector of float) +0:40 Function Parameters: +0:40 'x' ( in 4-component vector of float) +0:? Sequence +0:40 Branch: Return with expression +0:40 'x' ( in 4-component vector of float) +0:42 Function Definition: SomeValue( ( temp 4-component vector of float) +0:42 Function Parameters: +0:? Sequence +0:42 Branch: Return with expression +0:42 Convert int to float ( temp 4-component vector of float) +0:42 c4: direct index for structure ( uniform 4-component vector of int) +0:42 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:42 Constant: +0:42 3 (const uint) +0:45 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:45 Function Parameters: +0:? Sequence +0:49 textureFetch ( temp 4-component vector of float) +0:49 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:49 c1: direct index for structure ( uniform int) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:49 Constant: +0:49 0 (const uint) +0:49 Constant: +0:49 0 (const int) +0:51 Sequence +0:51 move second child to first child ( temp 4-component vector of float) +0:51 'r00' ( temp 4-component vector of float) +0:51 textureFetch ( temp 4-component vector of float) +0:51 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:51 c1: direct index for structure ( uniform int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:51 Constant: +0:51 0 (const uint) +0:51 Constant: +0:51 0 (const int) +0:52 Sequence +0:52 move second child to first child ( temp 4-component vector of int) +0:52 'r01' ( temp 4-component vector of int) +0:52 textureFetch ( temp 4-component vector of int) +0:52 'g_tTex1di4' ( uniform itexture1D) +0:52 c1: direct index for structure ( uniform int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 0 (const uint) +0:52 Constant: +0:52 0 (const int) +0:53 Sequence +0:53 move second child to first child ( temp 4-component vector of uint) +0:53 'r02' ( temp 4-component vector of uint) +0:53 textureFetch ( temp 4-component vector of uint) +0:53 'g_tTex1du4' ( uniform utexture1D) +0:53 c1: direct index for structure ( uniform int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 0 (const uint) +0:53 Constant: +0:53 0 (const int) +0:56 Sequence +0:56 move second child to first child ( temp 4-component vector of float) +0:56 'r10' ( temp 4-component vector of float) +0:56 textureFetch ( temp 4-component vector of float) +0:56 'g_tTex2df4' ( uniform texture2D) +0:56 c2: direct index for structure ( uniform 2-component vector of int) +0:56 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:56 Constant: +0:56 1 (const uint) +0:56 Constant: +0:56 0 (const int) +0:57 Sequence +0:57 move second child to first child ( temp 4-component vector of int) +0:57 'r11' ( temp 4-component vector of int) +0:57 textureFetch ( temp 4-component vector of int) +0:57 'g_tTex2di4' ( uniform itexture2D) +0:57 c2: direct index for structure ( uniform 2-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 1 (const uint) +0:57 Constant: +0:57 0 (const int) +0:58 Sequence +0:58 move second child to first child ( temp 4-component vector of uint) +0:58 'r12' ( temp 4-component vector of uint) +0:58 textureFetch ( temp 4-component vector of uint) +0:58 'g_tTex2du4' ( uniform utexture2D) +0:58 c2: direct index for structure ( uniform 2-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 1 (const uint) +0:58 Constant: +0:58 0 (const int) +0:61 Sequence +0:61 move second child to first child ( temp 4-component vector of float) +0:61 'r20' ( temp 4-component vector of float) +0:61 textureFetch ( temp 4-component vector of float) +0:61 'g_tTex3df4' ( uniform texture3D) +0:61 c3: direct index for structure ( uniform 3-component vector of int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:61 Constant: +0:61 2 (const uint) +0:61 Constant: +0:61 0 (const int) +0:62 Sequence +0:62 move second child to first child ( temp 4-component vector of int) +0:62 'r21' ( temp 4-component vector of int) +0:62 textureFetch ( temp 4-component vector of int) +0:62 'g_tTex3di4' ( uniform itexture3D) +0:62 c3: direct index for structure ( uniform 3-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 2 (const uint) +0:62 Constant: +0:62 0 (const int) +0:63 Sequence +0:63 move second child to first child ( temp 4-component vector of uint) +0:63 'r22' ( temp 4-component vector of uint) +0:63 textureFetch ( temp 4-component vector of uint) +0:63 'g_tTex3du4' ( uniform utexture3D) +0:63 c3: direct index for structure ( uniform 3-component vector of int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:63 Constant: +0:63 2 (const uint) +0:63 Constant: +0:63 0 (const int) +0:66 Function Call: Fn1(vf4; ( temp 4-component vector of float) +0:66 textureFetch ( temp 4-component vector of float) +0:66 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:66 c1: direct index for structure ( uniform int) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:66 Constant: +0:66 0 (const uint) +0:66 Constant: +0:66 0 (const int) +0:67 Function Call: Fn1(vi4; ( temp 4-component vector of int) +0:67 textureFetch ( temp 4-component vector of int) +0:67 'g_tTex1di4' ( uniform itexture1D) +0:67 c1: direct index for structure ( uniform int) +0:67 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:67 Constant: +0:67 0 (const uint) +0:67 Constant: +0:67 0 (const int) +0:68 Function Call: Fn1(vu4; ( temp 4-component vector of uint) +0:68 textureFetch ( temp 4-component vector of uint) +0:68 'g_tTex1du4' ( uniform utexture1D) +0:68 c1: direct index for structure ( uniform int) +0:68 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:68 Constant: +0:68 0 (const uint) +0:68 Constant: +0:68 0 (const int) +0:70 move second child to first child ( temp 4-component vector of float) +0:70 Color: direct index for structure ( temp 4-component vector of float) +0:70 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 1.000000 +0:70 1.000000 +0:70 1.000000 +0:70 1.000000 +0:72 Branch: Return with expression +0:72 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:45 Function Definition: main( ( temp void) +0:45 Function Parameters: +0:? Sequence +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:45 Color: direct index for structure ( temp 4-component vector of float) +0:45 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:45 Constant: +0:45 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:38 Function Definition: Fn1(vi4; ( temp 4-component vector of int) +0:38 Function Parameters: +0:38 'x' ( in 4-component vector of int) +0:? Sequence +0:38 Branch: Return with expression +0:38 'x' ( in 4-component vector of int) +0:39 Function Definition: Fn1(vu4; ( temp 4-component vector of uint) +0:39 Function Parameters: +0:39 'x' ( in 4-component vector of uint) +0:? Sequence +0:39 Branch: Return with expression +0:39 'x' ( in 4-component vector of uint) +0:40 Function Definition: Fn1(vf4; ( temp 4-component vector of float) +0:40 Function Parameters: +0:40 'x' ( in 4-component vector of float) +0:? Sequence +0:40 Branch: Return with expression +0:40 'x' ( in 4-component vector of float) +0:42 Function Definition: SomeValue( ( temp 4-component vector of float) +0:42 Function Parameters: +0:? Sequence +0:42 Branch: Return with expression +0:42 Convert int to float ( temp 4-component vector of float) +0:42 c4: direct index for structure ( uniform 4-component vector of int) +0:42 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:42 Constant: +0:42 3 (const uint) +0:45 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color}) +0:45 Function Parameters: +0:? Sequence +0:49 textureFetch ( temp 4-component vector of float) +0:49 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:49 c1: direct index for structure ( uniform int) +0:49 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:49 Constant: +0:49 0 (const uint) +0:49 Constant: +0:49 0 (const int) +0:51 Sequence +0:51 move second child to first child ( temp 4-component vector of float) +0:51 'r00' ( temp 4-component vector of float) +0:51 textureFetch ( temp 4-component vector of float) +0:51 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:51 c1: direct index for structure ( uniform int) +0:51 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:51 Constant: +0:51 0 (const uint) +0:51 Constant: +0:51 0 (const int) +0:52 Sequence +0:52 move second child to first child ( temp 4-component vector of int) +0:52 'r01' ( temp 4-component vector of int) +0:52 textureFetch ( temp 4-component vector of int) +0:52 'g_tTex1di4' ( uniform itexture1D) +0:52 c1: direct index for structure ( uniform int) +0:52 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:52 Constant: +0:52 0 (const uint) +0:52 Constant: +0:52 0 (const int) +0:53 Sequence +0:53 move second child to first child ( temp 4-component vector of uint) +0:53 'r02' ( temp 4-component vector of uint) +0:53 textureFetch ( temp 4-component vector of uint) +0:53 'g_tTex1du4' ( uniform utexture1D) +0:53 c1: direct index for structure ( uniform int) +0:53 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:53 Constant: +0:53 0 (const uint) +0:53 Constant: +0:53 0 (const int) +0:56 Sequence +0:56 move second child to first child ( temp 4-component vector of float) +0:56 'r10' ( temp 4-component vector of float) +0:56 textureFetch ( temp 4-component vector of float) +0:56 'g_tTex2df4' ( uniform texture2D) +0:56 c2: direct index for structure ( uniform 2-component vector of int) +0:56 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:56 Constant: +0:56 1 (const uint) +0:56 Constant: +0:56 0 (const int) +0:57 Sequence +0:57 move second child to first child ( temp 4-component vector of int) +0:57 'r11' ( temp 4-component vector of int) +0:57 textureFetch ( temp 4-component vector of int) +0:57 'g_tTex2di4' ( uniform itexture2D) +0:57 c2: direct index for structure ( uniform 2-component vector of int) +0:57 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:57 Constant: +0:57 1 (const uint) +0:57 Constant: +0:57 0 (const int) +0:58 Sequence +0:58 move second child to first child ( temp 4-component vector of uint) +0:58 'r12' ( temp 4-component vector of uint) +0:58 textureFetch ( temp 4-component vector of uint) +0:58 'g_tTex2du4' ( uniform utexture2D) +0:58 c2: direct index for structure ( uniform 2-component vector of int) +0:58 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:58 Constant: +0:58 1 (const uint) +0:58 Constant: +0:58 0 (const int) +0:61 Sequence +0:61 move second child to first child ( temp 4-component vector of float) +0:61 'r20' ( temp 4-component vector of float) +0:61 textureFetch ( temp 4-component vector of float) +0:61 'g_tTex3df4' ( uniform texture3D) +0:61 c3: direct index for structure ( uniform 3-component vector of int) +0:61 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:61 Constant: +0:61 2 (const uint) +0:61 Constant: +0:61 0 (const int) +0:62 Sequence +0:62 move second child to first child ( temp 4-component vector of int) +0:62 'r21' ( temp 4-component vector of int) +0:62 textureFetch ( temp 4-component vector of int) +0:62 'g_tTex3di4' ( uniform itexture3D) +0:62 c3: direct index for structure ( uniform 3-component vector of int) +0:62 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:62 Constant: +0:62 2 (const uint) +0:62 Constant: +0:62 0 (const int) +0:63 Sequence +0:63 move second child to first child ( temp 4-component vector of uint) +0:63 'r22' ( temp 4-component vector of uint) +0:63 textureFetch ( temp 4-component vector of uint) +0:63 'g_tTex3du4' ( uniform utexture3D) +0:63 c3: direct index for structure ( uniform 3-component vector of int) +0:63 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:63 Constant: +0:63 2 (const uint) +0:63 Constant: +0:63 0 (const int) +0:66 Function Call: Fn1(vf4; ( temp 4-component vector of float) +0:66 textureFetch ( temp 4-component vector of float) +0:66 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:66 c1: direct index for structure ( uniform int) +0:66 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:66 Constant: +0:66 0 (const uint) +0:66 Constant: +0:66 0 (const int) +0:67 Function Call: Fn1(vi4; ( temp 4-component vector of int) +0:67 textureFetch ( temp 4-component vector of int) +0:67 'g_tTex1di4' ( uniform itexture1D) +0:67 c1: direct index for structure ( uniform int) +0:67 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:67 Constant: +0:67 0 (const uint) +0:67 Constant: +0:67 0 (const int) +0:68 Function Call: Fn1(vu4; ( temp 4-component vector of uint) +0:68 textureFetch ( temp 4-component vector of uint) +0:68 'g_tTex1du4' ( uniform utexture1D) +0:68 c1: direct index for structure ( uniform int) +0:68 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:68 Constant: +0:68 0 (const uint) +0:68 Constant: +0:68 0 (const int) +0:70 move second child to first child ( temp 4-component vector of float) +0:70 Color: direct index for structure ( temp 4-component vector of float) +0:70 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 1.000000 +0:70 1.000000 +0:70 1.000000 +0:70 1.000000 +0:72 Branch: Return with expression +0:72 'psout' ( temp structure{ temp 4-component vector of float Color}) +0:45 Function Definition: main( ( temp void) +0:45 Function Parameters: +0:? Sequence +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:45 Color: direct index for structure ( temp 4-component vector of float) +0:45 Function Call: @main( ( temp structure{ temp 4-component vector of float Color}) +0:45 Constant: +0:45 0 (const int) +0:? Linker Objects +0:? 'g_sSamp' (layout( binding=0) uniform sampler) +0:? 'g_tTex1df4' (layout( binding=0) uniform texture1D) +0:? 'g_tTex1di4' ( uniform itexture1D) +0:? 'g_tTex1du4' ( uniform utexture1D) +0:? 'g_tTex2df4' ( uniform texture2D) +0:? 'g_tTex2di4' ( uniform itexture2D) +0:? 'g_tTex2du4' ( uniform utexture2D) +0:? 'g_tTex3df4' ( uniform texture3D) +0:? 'g_tTex3di4' ( uniform itexture3D) +0:? 'g_tTex3du4' ( uniform utexture3D) +0:? 'g_tTex1df4a' ( uniform texture1DArray) +0:? 'g_tTex1di4a' ( uniform itexture1DArray) +0:? 'g_tTex1du4a' ( uniform utexture1DArray) +0:? 'g_tTex2df4a' ( uniform texture2DArray) +0:? 'g_tTex2di4a' ( uniform itexture2DArray) +0:? 'g_tTex2du4a' ( uniform utexture2DArray) +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int c1, uniform 2-component vector of int c2, uniform 3-component vector of int c3, uniform 4-component vector of int c4, uniform int o1, uniform 2-component vector of int o2, uniform 3-component vector of int o3, uniform 4-component vector of int o4}) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 188 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 164 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "Fn1(vi4;" + Name 10 "x" + Name 18 "Fn1(vu4;" + Name 17 "x" + Name 25 "Fn1(vf4;" + Name 24 "x" + Name 28 "SomeValue(" + Name 30 "PS_OUTPUT" + MemberName 30(PS_OUTPUT) 0 "Color" + Name 32 "@main(" + Name 45 "$Global" + MemberName 45($Global) 0 "c1" + MemberName 45($Global) 1 "c2" + MemberName 45($Global) 2 "c3" + MemberName 45($Global) 3 "c4" + MemberName 45($Global) 4 "o1" + MemberName 45($Global) 5 "o2" + MemberName 45($Global) 6 "o3" + MemberName 45($Global) 7 "o4" + Name 47 "" + Name 57 "g_tTex1df4" + Name 64 "r00" + Name 69 "r01" + Name 72 "g_tTex1di4" + Name 77 "r02" + Name 80 "g_tTex1du4" + Name 85 "r10" + Name 88 "g_tTex2df4" + Name 95 "r11" + Name 98 "g_tTex2di4" + Name 103 "r12" + Name 106 "g_tTex2du4" + Name 111 "r20" + Name 114 "g_tTex3df4" + Name 121 "r21" + Name 124 "g_tTex3di4" + Name 129 "r22" + Name 132 "g_tTex3du4" + Name 141 "param" + Name 147 "param" + Name 153 "param" + Name 156 "psout" + Name 164 "@entryPointOutput.Color" + Name 169 "g_sSamp" + Name 172 "g_tTex1df4a" + Name 175 "g_tTex1di4a" + Name 178 "g_tTex1du4a" + Name 181 "g_tTex2df4a" + Name 184 "g_tTex2di4a" + Name 187 "g_tTex2du4a" + MemberDecorate 45($Global) 0 Offset 0 + MemberDecorate 45($Global) 1 Offset 8 + MemberDecorate 45($Global) 2 Offset 16 + MemberDecorate 45($Global) 3 Offset 32 + MemberDecorate 45($Global) 4 Offset 48 + MemberDecorate 45($Global) 5 Offset 56 + MemberDecorate 45($Global) 6 Offset 64 + MemberDecorate 45($Global) 7 Offset 80 + Decorate 45($Global) Block + Decorate 47 DescriptorSet 0 + Decorate 57(g_tTex1df4) DescriptorSet 0 + Decorate 57(g_tTex1df4) Binding 0 + Decorate 72(g_tTex1di4) DescriptorSet 0 + Decorate 80(g_tTex1du4) DescriptorSet 0 + Decorate 88(g_tTex2df4) DescriptorSet 0 + Decorate 98(g_tTex2di4) DescriptorSet 0 + Decorate 106(g_tTex2du4) DescriptorSet 0 + Decorate 114(g_tTex3df4) DescriptorSet 0 + Decorate 124(g_tTex3di4) DescriptorSet 0 + Decorate 132(g_tTex3du4) DescriptorSet 0 + Decorate 164(@entryPointOutput.Color) Location 0 + Decorate 169(g_sSamp) DescriptorSet 0 + Decorate 169(g_sSamp) Binding 0 + Decorate 172(g_tTex1df4a) DescriptorSet 0 + Decorate 175(g_tTex1di4a) DescriptorSet 0 + Decorate 178(g_tTex1du4a) DescriptorSet 0 + Decorate 181(g_tTex2df4a) DescriptorSet 0 + Decorate 184(g_tTex2di4a) DescriptorSet 0 + Decorate 187(g_tTex2du4a) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeVector 6(int) 4 + 8: TypePointer Function 7(ivec4) + 9: TypeFunction 7(ivec4) 8(ptr) + 13: TypeInt 32 0 + 14: TypeVector 13(int) 4 + 15: TypePointer Function 14(ivec4) + 16: TypeFunction 14(ivec4) 15(ptr) + 20: TypeFloat 32 + 21: TypeVector 20(float) 4 + 22: TypePointer Function 21(fvec4) + 23: TypeFunction 21(fvec4) 22(ptr) + 27: TypeFunction 21(fvec4) + 30(PS_OUTPUT): TypeStruct 21(fvec4) + 31: TypeFunction 30(PS_OUTPUT) + 43: TypeVector 6(int) 2 + 44: TypeVector 6(int) 3 + 45($Global): TypeStruct 6(int) 43(ivec2) 44(ivec3) 7(ivec4) 6(int) 43(ivec2) 44(ivec3) 7(ivec4) + 46: TypePointer Uniform 45($Global) + 47: 46(ptr) Variable Uniform + 48: 6(int) Constant 3 + 49: TypePointer Uniform 7(ivec4) + 55: TypeImage 20(float) 1D sampled format:Unknown + 56: TypePointer UniformConstant 55 + 57(g_tTex1df4): 56(ptr) Variable UniformConstant + 59: 6(int) Constant 0 + 60: TypePointer Uniform 6(int) + 70: TypeImage 6(int) 1D sampled format:Unknown + 71: TypePointer UniformConstant 70 + 72(g_tTex1di4): 71(ptr) Variable UniformConstant + 78: TypeImage 13(int) 1D sampled format:Unknown + 79: TypePointer UniformConstant 78 + 80(g_tTex1du4): 79(ptr) Variable UniformConstant + 86: TypeImage 20(float) 2D sampled format:Unknown + 87: TypePointer UniformConstant 86 + 88(g_tTex2df4): 87(ptr) Variable UniformConstant + 90: 6(int) Constant 1 + 91: TypePointer Uniform 43(ivec2) + 96: TypeImage 6(int) 2D sampled format:Unknown + 97: TypePointer UniformConstant 96 + 98(g_tTex2di4): 97(ptr) Variable UniformConstant + 104: TypeImage 13(int) 2D sampled format:Unknown + 105: TypePointer UniformConstant 104 + 106(g_tTex2du4): 105(ptr) Variable UniformConstant + 112: TypeImage 20(float) 3D sampled format:Unknown + 113: TypePointer UniformConstant 112 + 114(g_tTex3df4): 113(ptr) Variable UniformConstant + 116: 6(int) Constant 2 + 117: TypePointer Uniform 44(ivec3) + 122: TypeImage 6(int) 3D sampled format:Unknown + 123: TypePointer UniformConstant 122 + 124(g_tTex3di4): 123(ptr) Variable UniformConstant + 130: TypeImage 13(int) 3D sampled format:Unknown + 131: TypePointer UniformConstant 130 + 132(g_tTex3du4): 131(ptr) Variable UniformConstant + 155: TypePointer Function 30(PS_OUTPUT) + 157: 20(float) Constant 1065353216 + 158: 21(fvec4) ConstantComposite 157 157 157 157 + 163: TypePointer Output 21(fvec4) +164(@entryPointOutput.Color): 163(ptr) Variable Output + 167: TypeSampler + 168: TypePointer UniformConstant 167 + 169(g_sSamp): 168(ptr) Variable UniformConstant + 170: TypeImage 20(float) 1D array sampled format:Unknown + 171: TypePointer UniformConstant 170 +172(g_tTex1df4a): 171(ptr) Variable UniformConstant + 173: TypeImage 6(int) 1D array sampled format:Unknown + 174: TypePointer UniformConstant 173 +175(g_tTex1di4a): 174(ptr) Variable UniformConstant + 176: TypeImage 13(int) 1D array sampled format:Unknown + 177: TypePointer UniformConstant 176 +178(g_tTex1du4a): 177(ptr) Variable UniformConstant + 179: TypeImage 20(float) 2D array sampled format:Unknown + 180: TypePointer UniformConstant 179 +181(g_tTex2df4a): 180(ptr) Variable UniformConstant + 182: TypeImage 6(int) 2D array sampled format:Unknown + 183: TypePointer UniformConstant 182 +184(g_tTex2di4a): 183(ptr) Variable UniformConstant + 185: TypeImage 13(int) 2D array sampled format:Unknown + 186: TypePointer UniformConstant 185 +187(g_tTex2du4a): 186(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 165:30(PS_OUTPUT) FunctionCall 32(@main() + 166: 21(fvec4) CompositeExtract 165 0 + Store 164(@entryPointOutput.Color) 166 + Return + FunctionEnd + 11(Fn1(vi4;): 7(ivec4) Function None 9 + 10(x): 8(ptr) FunctionParameter + 12: Label + 34: 7(ivec4) Load 10(x) + ReturnValue 34 + FunctionEnd + 18(Fn1(vu4;): 14(ivec4) Function None 16 + 17(x): 15(ptr) FunctionParameter + 19: Label + 37: 14(ivec4) Load 17(x) + ReturnValue 37 + FunctionEnd + 25(Fn1(vf4;): 21(fvec4) Function None 23 + 24(x): 22(ptr) FunctionParameter + 26: Label + 40: 21(fvec4) Load 24(x) + ReturnValue 40 + FunctionEnd + 28(SomeValue(): 21(fvec4) Function None 27 + 29: Label + 50: 49(ptr) AccessChain 47 48 + 51: 7(ivec4) Load 50 + 52: 21(fvec4) ConvertSToF 51 + ReturnValue 52 + FunctionEnd + 32(@main():30(PS_OUTPUT) Function None 31 + 33: Label + 64(r00): 22(ptr) Variable Function + 69(r01): 8(ptr) Variable Function + 77(r02): 15(ptr) Variable Function + 85(r10): 22(ptr) Variable Function + 95(r11): 8(ptr) Variable Function + 103(r12): 15(ptr) Variable Function + 111(r20): 22(ptr) Variable Function + 121(r21): 8(ptr) Variable Function + 129(r22): 15(ptr) Variable Function + 141(param): 22(ptr) Variable Function + 147(param): 8(ptr) Variable Function + 153(param): 15(ptr) Variable Function + 156(psout): 155(ptr) Variable Function + 58: 55 Load 57(g_tTex1df4) + 61: 60(ptr) AccessChain 47 59 + 62: 6(int) Load 61 + 63: 21(fvec4) ImageFetch 58 62 Lod 59 + 65: 55 Load 57(g_tTex1df4) + 66: 60(ptr) AccessChain 47 59 + 67: 6(int) Load 66 + 68: 21(fvec4) ImageFetch 65 67 Lod 59 + Store 64(r00) 68 + 73: 70 Load 72(g_tTex1di4) + 74: 60(ptr) AccessChain 47 59 + 75: 6(int) Load 74 + 76: 7(ivec4) ImageFetch 73 75 Lod 59 + Store 69(r01) 76 + 81: 78 Load 80(g_tTex1du4) + 82: 60(ptr) AccessChain 47 59 + 83: 6(int) Load 82 + 84: 14(ivec4) ImageFetch 81 83 Lod 59 + Store 77(r02) 84 + 89: 86 Load 88(g_tTex2df4) + 92: 91(ptr) AccessChain 47 90 + 93: 43(ivec2) Load 92 + 94: 21(fvec4) ImageFetch 89 93 Lod 59 + Store 85(r10) 94 + 99: 96 Load 98(g_tTex2di4) + 100: 91(ptr) AccessChain 47 90 + 101: 43(ivec2) Load 100 + 102: 7(ivec4) ImageFetch 99 101 Lod 59 + Store 95(r11) 102 + 107: 104 Load 106(g_tTex2du4) + 108: 91(ptr) AccessChain 47 90 + 109: 43(ivec2) Load 108 + 110: 14(ivec4) ImageFetch 107 109 Lod 59 + Store 103(r12) 110 + 115: 112 Load 114(g_tTex3df4) + 118: 117(ptr) AccessChain 47 116 + 119: 44(ivec3) Load 118 + 120: 21(fvec4) ImageFetch 115 119 Lod 59 + Store 111(r20) 120 + 125: 122 Load 124(g_tTex3di4) + 126: 117(ptr) AccessChain 47 116 + 127: 44(ivec3) Load 126 + 128: 7(ivec4) ImageFetch 125 127 Lod 59 + Store 121(r21) 128 + 133: 130 Load 132(g_tTex3du4) + 134: 117(ptr) AccessChain 47 116 + 135: 44(ivec3) Load 134 + 136: 14(ivec4) ImageFetch 133 135 Lod 59 + Store 129(r22) 136 + 137: 55 Load 57(g_tTex1df4) + 138: 60(ptr) AccessChain 47 59 + 139: 6(int) Load 138 + 140: 21(fvec4) ImageFetch 137 139 Lod 59 + Store 141(param) 140 + 142: 21(fvec4) FunctionCall 25(Fn1(vf4;) 141(param) + 143: 70 Load 72(g_tTex1di4) + 144: 60(ptr) AccessChain 47 59 + 145: 6(int) Load 144 + 146: 7(ivec4) ImageFetch 143 145 Lod 59 + Store 147(param) 146 + 148: 7(ivec4) FunctionCall 11(Fn1(vi4;) 147(param) + 149: 78 Load 80(g_tTex1du4) + 150: 60(ptr) AccessChain 47 59 + 151: 6(int) Load 150 + 152: 14(ivec4) ImageFetch 149 151 Lod 59 + Store 153(param) 152 + 154: 14(ivec4) FunctionCall 18(Fn1(vu4;) 153(param) + 159: 22(ptr) AccessChain 156(psout) 59 + Store 159 158 + 160:30(PS_OUTPUT) Load 156(psout) + ReturnValue 160 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.tx.overload.frag.out b/deps/glslang/Test/baseResults/hlsl.tx.overload.frag.out new file mode 100644 index 00000000..c8d064a3 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.tx.overload.frag.out @@ -0,0 +1,247 @@ +hlsl.tx.overload.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: Func(t211; ( temp float) +0:8 Function Parameters: +0:8 'DummyTex' ( in texture2D) +0:? Sequence +0:8 Branch: Return with expression +0:8 Constant: +0:8 1.000000 +0:9 Function Definition: Func(t21; ( temp 4-component vector of float) +0:9 Function Parameters: +0:9 'DummyTex' ( in texture2D) +0:? Sequence +0:9 Branch: Return with expression +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:11 Function Definition: Func(I211; ( temp float) +0:11 Function Parameters: +0:11 'DummyTex' (layout( r32f) in image2D) +0:? Sequence +0:11 Branch: Return with expression +0:11 Constant: +0:11 1.000000 +0:12 Function Definition: Func(I21; ( temp 4-component vector of float) +0:12 Function Parameters: +0:12 'DummyTex' (layout( rgba32f) in image2D) +0:? Sequence +0:12 Branch: Return with expression +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:15 Function Definition: @main( ( temp 4-component vector of float) +0:15 Function Parameters: +0:? Sequence +0:16 Branch: Return with expression +0:16 add ( temp 4-component vector of float) +0:16 add ( temp 4-component vector of float) +0:16 add ( temp 4-component vector of float) +0:16 Function Call: Func(t211; ( temp float) +0:16 'tf1' ( uniform texture2D) +0:16 Function Call: Func(t21; ( temp 4-component vector of float) +0:16 'tf4' ( uniform texture2D) +0:16 Function Call: Func(I211; ( temp float) +0:16 'twf1' (layout( r32f) uniform image2D) +0:16 Function Call: Func(I21; ( temp 4-component vector of float) +0:16 'twf4' (layout( rgba32f) uniform image2D) +0:15 Function Definition: main( ( temp void) +0:15 Function Parameters: +0:? Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:15 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'tf1' ( uniform texture2D) +0:? 'tf4' ( uniform texture2D) +0:? 'twf1' (layout( r32f) uniform image2D) +0:? 'twf4' (layout( rgba32f) uniform image2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: Func(t211; ( temp float) +0:8 Function Parameters: +0:8 'DummyTex' ( in texture2D) +0:? Sequence +0:8 Branch: Return with expression +0:8 Constant: +0:8 1.000000 +0:9 Function Definition: Func(t21; ( temp 4-component vector of float) +0:9 Function Parameters: +0:9 'DummyTex' ( in texture2D) +0:? Sequence +0:9 Branch: Return with expression +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:11 Function Definition: Func(I211; ( temp float) +0:11 Function Parameters: +0:11 'DummyTex' (layout( r32f) in image2D) +0:? Sequence +0:11 Branch: Return with expression +0:11 Constant: +0:11 1.000000 +0:12 Function Definition: Func(I21; ( temp 4-component vector of float) +0:12 Function Parameters: +0:12 'DummyTex' (layout( rgba32f) in image2D) +0:? Sequence +0:12 Branch: Return with expression +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:15 Function Definition: @main( ( temp 4-component vector of float) +0:15 Function Parameters: +0:? Sequence +0:16 Branch: Return with expression +0:16 add ( temp 4-component vector of float) +0:16 add ( temp 4-component vector of float) +0:16 add ( temp 4-component vector of float) +0:16 Function Call: Func(t211; ( temp float) +0:16 'tf1' ( uniform texture2D) +0:16 Function Call: Func(t21; ( temp 4-component vector of float) +0:16 'tf4' ( uniform texture2D) +0:16 Function Call: Func(I211; ( temp float) +0:16 'twf1' (layout( r32f) uniform image2D) +0:16 Function Call: Func(I21; ( temp 4-component vector of float) +0:16 'twf4' (layout( rgba32f) uniform image2D) +0:15 Function Definition: main( ( temp void) +0:15 Function Parameters: +0:? Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:15 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'tf1' ( uniform texture2D) +0:? 'tf4' ( uniform texture2D) +0:? 'twf1' (layout( r32f) uniform image2D) +0:? 'twf4' (layout( rgba32f) uniform image2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 73 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 71 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "Func(t211;" + Name 10 "DummyTex" + Name 16 "Func(t21;" + Name 15 "DummyTex" + Name 22 "Func(I211;" + Name 21 "DummyTex" + Name 28 "Func(I21;" + Name 27 "DummyTex" + Name 31 "@main(" + Name 45 "tf1" + Name 46 "param" + Name 49 "tf4" + Name 50 "param" + Name 56 "twf1" + Name 57 "param" + Name 63 "twf4" + Name 64 "param" + Name 71 "@entryPointOutput" + Decorate 45(tf1) DescriptorSet 0 + Decorate 49(tf4) DescriptorSet 0 + Decorate 56(twf1) DescriptorSet 0 + Decorate 63(twf4) DescriptorSet 0 + Decorate 71(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeImage 6(float) 2D sampled format:Unknown + 8: TypePointer Function 7 + 9: TypeFunction 6(float) 8(ptr) + 13: TypeVector 6(float) 4 + 14: TypeFunction 13(fvec4) 8(ptr) + 18: TypeImage 6(float) 2D nonsampled format:R32f + 19: TypePointer Function 18 + 20: TypeFunction 6(float) 19(ptr) + 24: TypeImage 6(float) 2D nonsampled format:Rgba32f + 25: TypePointer Function 24 + 26: TypeFunction 13(fvec4) 25(ptr) + 30: TypeFunction 13(fvec4) + 33: 6(float) Constant 1065353216 + 36: 6(float) Constant 0 + 37: 13(fvec4) ConstantComposite 36 36 36 36 + 44: TypePointer UniformConstant 7 + 45(tf1): 44(ptr) Variable UniformConstant + 49(tf4): 44(ptr) Variable UniformConstant + 55: TypePointer UniformConstant 18 + 56(twf1): 55(ptr) Variable UniformConstant + 62: TypePointer UniformConstant 24 + 63(twf4): 62(ptr) Variable UniformConstant + 70: TypePointer Output 13(fvec4) +71(@entryPointOutput): 70(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 72: 13(fvec4) FunctionCall 31(@main() + Store 71(@entryPointOutput) 72 + Return + FunctionEnd + 11(Func(t211;): 6(float) Function None 9 + 10(DummyTex): 8(ptr) FunctionParameter + 12: Label + ReturnValue 33 + FunctionEnd + 16(Func(t21;): 13(fvec4) Function None 14 + 15(DummyTex): 8(ptr) FunctionParameter + 17: Label + ReturnValue 37 + FunctionEnd + 22(Func(I211;): 6(float) Function None 20 + 21(DummyTex): 19(ptr) FunctionParameter + 23: Label + ReturnValue 33 + FunctionEnd + 28(Func(I21;): 13(fvec4) Function None 26 + 27(DummyTex): 25(ptr) FunctionParameter + 29: Label + ReturnValue 37 + FunctionEnd + 31(@main(): 13(fvec4) Function None 30 + 32: Label + 46(param): 8(ptr) Variable Function + 50(param): 8(ptr) Variable Function + 57(param): 19(ptr) Variable Function + 64(param): 25(ptr) Variable Function + 47: 7 Load 45(tf1) + Store 46(param) 47 + 48: 6(float) FunctionCall 11(Func(t211;) 46(param) + 51: 7 Load 49(tf4) + Store 50(param) 51 + 52: 13(fvec4) FunctionCall 16(Func(t21;) 50(param) + 53: 13(fvec4) CompositeConstruct 48 48 48 48 + 54: 13(fvec4) FAdd 53 52 + 58: 18 Load 56(twf1) + Store 57(param) 58 + 59: 6(float) FunctionCall 22(Func(I211;) 57(param) + 60: 13(fvec4) CompositeConstruct 59 59 59 59 + 61: 13(fvec4) FAdd 54 60 + 65: 24 Load 63(twf4) + Store 64(param) 65 + 66: 13(fvec4) FunctionCall 28(Func(I21;) 64(param) + 67: 13(fvec4) FAdd 61 66 + ReturnValue 67 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.type.half.frag.out b/deps/glslang/Test/baseResults/hlsl.type.half.frag.out new file mode 100644 index 00000000..6b5a945b --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.type.half.frag.out @@ -0,0 +1,254 @@ +hlsl.type.half.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: @main( ( temp 4-component vector of float) +0:3 Function Parameters: +0:? Sequence +0:4 Sequence +0:4 move second child to first child ( temp float) +0:4 'h0' ( temp float) +0:4 Constant: +0:4 0.000000 +0:5 Sequence +0:5 move second child to first child ( temp 1-component vector of float) +0:5 'h1' ( temp 1-component vector of float) +0:5 Constant: +0:5 1.000000 +0:6 Sequence +0:6 move second child to first child ( temp 2-component vector of float) +0:6 'h2' ( temp 2-component vector of float) +0:6 Constant: +0:6 2.000000 +0:6 2.000000 +0:7 Sequence +0:7 move second child to first child ( temp 3-component vector of float) +0:7 'h3' ( temp 3-component vector of float) +0:7 Constant: +0:7 3.000000 +0:7 3.000000 +0:7 3.000000 +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'h4' ( temp 4-component vector of float) +0:8 Constant: +0:8 4.000000 +0:8 4.000000 +0:8 4.000000 +0:8 4.000000 +0:15 Sequence +0:15 move second child to first child ( temp 2X2 matrix of float) +0:15 'h22' ( temp 2X2 matrix of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:16 Sequence +0:16 move second child to first child ( temp 2X3 matrix of float) +0:16 'h23' ( temp 2X3 matrix of float) +0:16 Constant: +0:16 4.900000 +0:16 4.900000 +0:16 4.900000 +0:16 4.900000 +0:16 4.900000 +0:16 4.900000 +0:27 Branch: Return with expression +0:27 Construct vec4 ( temp 4-component vector of float) +0:27 add ( temp float) +0:27 add ( temp float) +0:27 direct index ( temp float) +0:27 direct index ( temp 3-component vector of float) +0:27 'h23' ( temp 2X3 matrix of float) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 0 (const int) +0:27 direct index ( temp float) +0:27 'h4' ( temp 4-component vector of float) +0:27 Constant: +0:27 1 (const int) +0:27 'h0' ( temp float) +0:3 Function Definition: main( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:3 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:3 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:3 Function Definition: @main( ( temp 4-component vector of float) +0:3 Function Parameters: +0:? Sequence +0:4 Sequence +0:4 move second child to first child ( temp float) +0:4 'h0' ( temp float) +0:4 Constant: +0:4 0.000000 +0:5 Sequence +0:5 move second child to first child ( temp 1-component vector of float) +0:5 'h1' ( temp 1-component vector of float) +0:5 Constant: +0:5 1.000000 +0:6 Sequence +0:6 move second child to first child ( temp 2-component vector of float) +0:6 'h2' ( temp 2-component vector of float) +0:6 Constant: +0:6 2.000000 +0:6 2.000000 +0:7 Sequence +0:7 move second child to first child ( temp 3-component vector of float) +0:7 'h3' ( temp 3-component vector of float) +0:7 Constant: +0:7 3.000000 +0:7 3.000000 +0:7 3.000000 +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'h4' ( temp 4-component vector of float) +0:8 Constant: +0:8 4.000000 +0:8 4.000000 +0:8 4.000000 +0:8 4.000000 +0:15 Sequence +0:15 move second child to first child ( temp 2X2 matrix of float) +0:15 'h22' ( temp 2X2 matrix of float) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:16 Sequence +0:16 move second child to first child ( temp 2X3 matrix of float) +0:16 'h23' ( temp 2X3 matrix of float) +0:16 Constant: +0:16 4.900000 +0:16 4.900000 +0:16 4.900000 +0:16 4.900000 +0:16 4.900000 +0:16 4.900000 +0:27 Branch: Return with expression +0:27 Construct vec4 ( temp 4-component vector of float) +0:27 add ( temp float) +0:27 add ( temp float) +0:27 direct index ( temp float) +0:27 direct index ( temp 3-component vector of float) +0:27 'h23' ( temp 2X3 matrix of float) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 0 (const int) +0:27 direct index ( temp float) +0:27 'h4' ( temp 4-component vector of float) +0:27 Constant: +0:27 1 (const int) +0:27 'h0' ( temp float) +0:3 Function Definition: main( ( temp void) +0:3 Function Parameters: +0:? Sequence +0:3 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:3 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 60 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 58 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 12 "h0" + Name 14 "h1" + Name 18 "h2" + Name 23 "h3" + Name 27 "h4" + Name 32 "h22" + Name 38 "h23" + Name 58 "@entryPointOutput" + Decorate 58(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypePointer Function 6(float) + 13: 6(float) Constant 0 + 15: 6(float) Constant 1065353216 + 16: TypeVector 6(float) 2 + 17: TypePointer Function 16(fvec2) + 19: 6(float) Constant 1073741824 + 20: 16(fvec2) ConstantComposite 19 19 + 21: TypeVector 6(float) 3 + 22: TypePointer Function 21(fvec3) + 24: 6(float) Constant 1077936128 + 25: 21(fvec3) ConstantComposite 24 24 24 + 26: TypePointer Function 7(fvec4) + 28: 6(float) Constant 1082130432 + 29: 7(fvec4) ConstantComposite 28 28 28 28 + 30: TypeMatrix 16(fvec2) 2 + 31: TypePointer Function 30 + 33: 16(fvec2) ConstantComposite 15 19 + 34: 16(fvec2) ConstantComposite 24 28 + 35: 30 ConstantComposite 33 34 + 36: TypeMatrix 21(fvec3) 2 + 37: TypePointer Function 36 + 39: 6(float) Constant 1084017869 + 40: 21(fvec3) ConstantComposite 39 39 39 + 41: 36 ConstantComposite 40 40 + 42: TypeInt 32 1 + 43: 42(int) Constant 0 + 44: TypeInt 32 0 + 45: 44(int) Constant 0 + 48: 44(int) Constant 1 + 57: TypePointer Output 7(fvec4) +58(@entryPointOutput): 57(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 59: 7(fvec4) FunctionCall 9(@main() + Store 58(@entryPointOutput) 59 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 12(h0): 11(ptr) Variable Function + 14(h1): 11(ptr) Variable Function + 18(h2): 17(ptr) Variable Function + 23(h3): 22(ptr) Variable Function + 27(h4): 26(ptr) Variable Function + 32(h22): 31(ptr) Variable Function + 38(h23): 37(ptr) Variable Function + Store 12(h0) 13 + Store 14(h1) 15 + Store 18(h2) 20 + Store 23(h3) 25 + Store 27(h4) 29 + Store 32(h22) 35 + Store 38(h23) 41 + 46: 11(ptr) AccessChain 38(h23) 43 45 + 47: 6(float) Load 46 + 49: 11(ptr) AccessChain 27(h4) 48 + 50: 6(float) Load 49 + 51: 6(float) FAdd 47 50 + 52: 6(float) Load 12(h0) + 53: 6(float) FAdd 51 52 + 54: 7(fvec4) CompositeConstruct 53 53 53 53 + ReturnValue 54 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.type.identifier.frag.out b/deps/glslang/Test/baseResults/hlsl.type.identifier.frag.out new file mode 100644 index 00000000..2eaa2ae4 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.type.identifier.frag.out @@ -0,0 +1,436 @@ +hlsl.type.identifier.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:6 Function Definition: fn(f1; ( temp float) +0:6 Function Parameters: +0:6 'float' ( in float) +0:? Sequence +0:6 Branch: Return with expression +0:6 'float' ( in float) +0:9 Function Definition: @main( ( temp 4-component vector of float) +0:9 Function Parameters: +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp float) +0:10 'float' ( temp float) +0:10 Constant: +0:10 7.000000 +0:11 Sequence +0:11 move second child to first child ( temp 2-element array of bool) +0:11 'bool' ( temp 2-element array of bool) +0:11 Construct bool ( temp 2-element array of bool) +0:11 Convert float to bool ( temp bool) +0:11 'float' ( temp float) +0:11 Convert float to bool ( temp bool) +0:11 'float' ( temp float) +0:12 Sequence +0:12 move second child to first child ( temp int) +0:12 'int' ( temp int) +0:12 Convert bool to int ( temp int) +0:12 direct index ( temp bool) +0:12 'bool' ( temp 2-element array of bool) +0:12 Constant: +0:12 1 (const int) +0:13 Sequence +0:13 move second child to first child ( temp uint) +0:13 'uint' ( temp uint) +0:13 Convert float to uint ( temp uint) +0:13 add ( temp float) +0:13 'float' ( temp float) +0:13 Convert int to float ( temp float) +0:13 'int' ( temp int) +0:14 Sequence +0:14 move second child to first child ( temp mediump float) +0:14 'min16float' ( temp mediump float) +0:14 Convert uint to float ( temp mediump float) +0:14 'uint' ( temp mediump uint) +0:15 Sequence +0:15 move second child to first child ( temp mediump float) +0:15 'min10float' ( temp mediump float) +0:15 'min16float' ( temp mediump float) +0:16 Sequence +0:16 move second child to first child ( temp float) +0:16 'half' ( temp float) +0:16 Constant: +0:16 0.500000 +0:? Sequence +0:20 move second child to first child ( temp float) +0:20 float: direct index for structure ( temp float) +0:20 'float' ( temp structure{ temp float float}) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 42.000000 +0:23 move second child to first child ( temp bool) +0:23 direct index ( temp bool) +0:23 'bool' ( temp 2-element array of bool) +0:23 Constant: +0:23 0 (const int) +0:23 direct index ( temp bool) +0:23 'bool' ( temp 2-element array of bool) +0:23 Constant: +0:23 1 (const int) +0:25 move second child to first child ( temp mediump float) +0:25 'float' ( temp mediump float) +0:25 add ( temp mediump float) +0:25 add ( temp mediump float) +0:25 add ( temp mediump float) +0:25 add ( temp mediump float) +0:25 add ( temp mediump float) +0:25 add ( temp mediump float) +0:25 'float' ( temp mediump float) +0:25 Convert int to float ( temp mediump float) +0:25 'int' ( temp mediump int) +0:25 Convert uint to float ( temp mediump float) +0:25 'uint' ( temp mediump uint) +0:25 'min16float' ( temp mediump float) +0:25 'min10float' ( temp mediump float) +0:25 Test condition and select ( temp mediump float): no shortcircuit +0:25 Condition +0:25 direct index ( temp bool) +0:25 'bool' ( temp 2-element array of bool) +0:25 Constant: +0:25 0 (const int) +0:25 true case +0:25 Convert int to float ( temp mediump float) +0:25 'int' ( temp mediump int) +0:25 false case +0:25 'float' ( temp mediump float) +0:25 Function Call: fn(f1; ( temp mediump float) +0:25 'float' ( temp mediump float) +0:28 move second child to first child ( temp float) +0:28 direct index ( temp float) +0:28 direct index ( temp 3-component vector of float) +0:28 'half2x3' ( temp 2X3 matrix of float) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 0 (const int) +0:28 component-wise multiply ( temp float) +0:28 'float' ( temp float) +0:28 'float' ( temp float) +0:30 Branch: Return with expression +0:30 Construct vec4 ( temp 4-component vector of float) +0:30 add ( temp float) +0:30 'float' ( temp float) +0:30 direct index ( temp float) +0:30 direct index ( temp 3-component vector of float) +0:30 'half2x3' ( temp 2X3 matrix of float) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 0 (const int) +0:9 Function Definition: main( ( temp void) +0:9 Function Parameters: +0:? Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:9 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:6 Function Definition: fn(f1; ( temp float) +0:6 Function Parameters: +0:6 'float' ( in float) +0:? Sequence +0:6 Branch: Return with expression +0:6 'float' ( in float) +0:9 Function Definition: @main( ( temp 4-component vector of float) +0:9 Function Parameters: +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp float) +0:10 'float' ( temp float) +0:10 Constant: +0:10 7.000000 +0:11 Sequence +0:11 move second child to first child ( temp 2-element array of bool) +0:11 'bool' ( temp 2-element array of bool) +0:11 Construct bool ( temp 2-element array of bool) +0:11 Convert float to bool ( temp bool) +0:11 'float' ( temp float) +0:11 Convert float to bool ( temp bool) +0:11 'float' ( temp float) +0:12 Sequence +0:12 move second child to first child ( temp int) +0:12 'int' ( temp int) +0:12 Convert bool to int ( temp int) +0:12 direct index ( temp bool) +0:12 'bool' ( temp 2-element array of bool) +0:12 Constant: +0:12 1 (const int) +0:13 Sequence +0:13 move second child to first child ( temp uint) +0:13 'uint' ( temp uint) +0:13 Convert float to uint ( temp uint) +0:13 add ( temp float) +0:13 'float' ( temp float) +0:13 Convert int to float ( temp float) +0:13 'int' ( temp int) +0:14 Sequence +0:14 move second child to first child ( temp mediump float) +0:14 'min16float' ( temp mediump float) +0:14 Convert uint to float ( temp mediump float) +0:14 'uint' ( temp mediump uint) +0:15 Sequence +0:15 move second child to first child ( temp mediump float) +0:15 'min10float' ( temp mediump float) +0:15 'min16float' ( temp mediump float) +0:16 Sequence +0:16 move second child to first child ( temp float) +0:16 'half' ( temp float) +0:16 Constant: +0:16 0.500000 +0:? Sequence +0:20 move second child to first child ( temp float) +0:20 float: direct index for structure ( temp float) +0:20 'float' ( temp structure{ temp float float}) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 42.000000 +0:23 move second child to first child ( temp bool) +0:23 direct index ( temp bool) +0:23 'bool' ( temp 2-element array of bool) +0:23 Constant: +0:23 0 (const int) +0:23 direct index ( temp bool) +0:23 'bool' ( temp 2-element array of bool) +0:23 Constant: +0:23 1 (const int) +0:25 move second child to first child ( temp mediump float) +0:25 'float' ( temp mediump float) +0:25 add ( temp mediump float) +0:25 add ( temp mediump float) +0:25 add ( temp mediump float) +0:25 add ( temp mediump float) +0:25 add ( temp mediump float) +0:25 add ( temp mediump float) +0:25 'float' ( temp mediump float) +0:25 Convert int to float ( temp mediump float) +0:25 'int' ( temp mediump int) +0:25 Convert uint to float ( temp mediump float) +0:25 'uint' ( temp mediump uint) +0:25 'min16float' ( temp mediump float) +0:25 'min10float' ( temp mediump float) +0:25 Test condition and select ( temp mediump float): no shortcircuit +0:25 Condition +0:25 direct index ( temp bool) +0:25 'bool' ( temp 2-element array of bool) +0:25 Constant: +0:25 0 (const int) +0:25 true case +0:25 Convert int to float ( temp mediump float) +0:25 'int' ( temp mediump int) +0:25 false case +0:25 'float' ( temp mediump float) +0:25 Function Call: fn(f1; ( temp mediump float) +0:25 'float' ( temp mediump float) +0:28 move second child to first child ( temp float) +0:28 direct index ( temp float) +0:28 direct index ( temp 3-component vector of float) +0:28 'half2x3' ( temp 2X3 matrix of float) +0:28 Constant: +0:28 0 (const int) +0:28 Constant: +0:28 0 (const int) +0:28 component-wise multiply ( temp float) +0:28 'float' ( temp float) +0:28 'float' ( temp float) +0:30 Branch: Return with expression +0:30 Construct vec4 ( temp 4-component vector of float) +0:30 add ( temp float) +0:30 'float' ( temp float) +0:30 direct index ( temp float) +0:30 direct index ( temp 3-component vector of float) +0:30 'half2x3' ( temp 2X3 matrix of float) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 0 (const int) +0:9 Function Definition: main( ( temp void) +0:9 Function Parameters: +0:? Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:9 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 105 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 103 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 10 "fn(f1;" + Name 9 "float" + Name 14 "@main(" + Name 19 "float" + Name 26 "bool" + Name 35 "int" + Name 43 "uint" + Name 49 "min16float" + Name 52 "min10float" + Name 54 "half" + Name 56 "foo_t" + MemberName 56(foo_t) 0 "float" + Name 58 "float" + Name 82 "param" + Name 89 "half2x3" + Name 103 "@entryPointOutput" + Decorate 49(min16float) RelaxedPrecision + Decorate 50 RelaxedPrecision + Decorate 51 RelaxedPrecision + Decorate 52(min10float) RelaxedPrecision + Decorate 53 RelaxedPrecision + Decorate 64 RelaxedPrecision + Decorate 65 RelaxedPrecision + Decorate 66 RelaxedPrecision + Decorate 67 RelaxedPrecision + Decorate 68 RelaxedPrecision + Decorate 69 RelaxedPrecision + Decorate 70 RelaxedPrecision + Decorate 71 RelaxedPrecision + Decorate 72 RelaxedPrecision + Decorate 73 RelaxedPrecision + Decorate 74 RelaxedPrecision + Decorate 77 RelaxedPrecision + Decorate 78 RelaxedPrecision + Decorate 79 RelaxedPrecision + Decorate 81 RelaxedPrecision + Decorate 83 RelaxedPrecision + Decorate 84 RelaxedPrecision + Decorate 85 RelaxedPrecision + Decorate 103(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeFunction 6(float) 7(ptr) + 12: TypeVector 6(float) 4 + 13: TypeFunction 12(fvec4) + 20: 6(float) Constant 1088421888 + 21: TypeBool + 22: TypeInt 32 0 + 23: 22(int) Constant 2 + 24: TypeArray 21(bool) 23 + 25: TypePointer Function 24 + 28: 6(float) Constant 0 + 33: TypeInt 32 1 + 34: TypePointer Function 33(int) + 36: 33(int) Constant 1 + 37: TypePointer Function 21(bool) + 40: 33(int) Constant 0 + 42: TypePointer Function 22(int) + 55: 6(float) Constant 1056964608 + 56(foo_t): TypeStruct 6(float) + 57: TypePointer Function 56(foo_t) + 59: 6(float) Constant 1109917696 + 86: TypeVector 6(float) 3 + 87: TypeMatrix 86(fvec3) 2 + 88: TypePointer Function 87 + 93: 22(int) Constant 0 + 102: TypePointer Output 12(fvec4) +103(@entryPointOutput): 102(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 104: 12(fvec4) FunctionCall 14(@main() + Store 103(@entryPointOutput) 104 + Return + FunctionEnd + 10(fn(f1;): 6(float) Function None 8 + 9(float): 7(ptr) FunctionParameter + 11: Label + 16: 6(float) Load 9(float) + ReturnValue 16 + FunctionEnd + 14(@main(): 12(fvec4) Function None 13 + 15: Label + 19(float): 7(ptr) Variable Function + 26(bool): 25(ptr) Variable Function + 35(int): 34(ptr) Variable Function + 43(uint): 42(ptr) Variable Function + 49(min16float): 7(ptr) Variable Function + 52(min10float): 7(ptr) Variable Function + 54(half): 7(ptr) Variable Function + 58(float): 57(ptr) Variable Function + 82(param): 7(ptr) Variable Function + 89(half2x3): 88(ptr) Variable Function + Store 19(float) 20 + 27: 6(float) Load 19(float) + 29: 21(bool) FOrdNotEqual 27 28 + 30: 6(float) Load 19(float) + 31: 21(bool) FOrdNotEqual 30 28 + 32: 24 CompositeConstruct 29 31 + Store 26(bool) 32 + 38: 37(ptr) AccessChain 26(bool) 36 + 39: 21(bool) Load 38 + 41: 33(int) Select 39 36 40 + Store 35(int) 41 + 44: 6(float) Load 19(float) + 45: 33(int) Load 35(int) + 46: 6(float) ConvertSToF 45 + 47: 6(float) FAdd 44 46 + 48: 22(int) ConvertFToU 47 + Store 43(uint) 48 + 50: 22(int) Load 43(uint) + 51: 6(float) ConvertUToF 50 + Store 49(min16float) 51 + 53: 6(float) Load 49(min16float) + Store 52(min10float) 53 + Store 54(half) 55 + 60: 7(ptr) AccessChain 58(float) 40 + Store 60 59 + 61: 37(ptr) AccessChain 26(bool) 36 + 62: 21(bool) Load 61 + 63: 37(ptr) AccessChain 26(bool) 40 + Store 63 62 + 64: 6(float) Load 19(float) + 65: 33(int) Load 35(int) + 66: 6(float) ConvertSToF 65 + 67: 6(float) FAdd 64 66 + 68: 22(int) Load 43(uint) + 69: 6(float) ConvertUToF 68 + 70: 6(float) FAdd 67 69 + 71: 6(float) Load 49(min16float) + 72: 6(float) FAdd 70 71 + 73: 6(float) Load 52(min10float) + 74: 6(float) FAdd 72 73 + 75: 37(ptr) AccessChain 26(bool) 40 + 76: 21(bool) Load 75 + 77: 33(int) Load 35(int) + 78: 6(float) ConvertSToF 77 + 79: 6(float) Load 19(float) + 80: 6(float) Select 76 78 79 + 81: 6(float) FAdd 74 80 + 83: 6(float) Load 19(float) + Store 82(param) 83 + 84: 6(float) FunctionCall 10(fn(f1;) 82(param) + 85: 6(float) FAdd 81 84 + Store 19(float) 85 + 90: 6(float) Load 19(float) + 91: 6(float) Load 19(float) + 92: 6(float) FMul 90 91 + 94: 7(ptr) AccessChain 89(half2x3) 40 93 + Store 94 92 + 95: 6(float) Load 19(float) + 96: 7(ptr) AccessChain 89(half2x3) 40 93 + 97: 6(float) Load 96 + 98: 6(float) FAdd 95 97 + 99: 12(fvec4) CompositeConstruct 98 98 98 98 + ReturnValue 99 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.type.type.conversion.all.frag.out b/deps/glslang/Test/baseResults/hlsl.type.type.conversion.all.frag.out new file mode 100644 index 00000000..083c9296 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.type.type.conversion.all.frag.out @@ -0,0 +1,1469 @@ +hlsl.type.type.conversion.all.frag +ERROR: 0:88: '=' : cannot convert from ' const 2X2 matrix of float' to ' temp 2-component vector of float' +ERROR: 0:89: '=' : cannot convert from ' const 2X3 matrix of float' to ' temp 2-component vector of float' +ERROR: 0:90: '=' : cannot convert from ' const 2X4 matrix of float' to ' temp 2-component vector of float' +ERROR: 0:91: '=' : cannot convert from ' const 3X2 matrix of float' to ' temp 2-component vector of float' +ERROR: 0:92: '=' : cannot convert from ' const 3X3 matrix of float' to ' temp 2-component vector of float' +ERROR: 0:93: '=' : cannot convert from ' const 3X4 matrix of float' to ' temp 2-component vector of float' +ERROR: 0:94: '=' : cannot convert from ' const 4X2 matrix of float' to ' temp 2-component vector of float' +ERROR: 0:95: '=' : cannot convert from ' const 4X3 matrix of float' to ' temp 2-component vector of float' +ERROR: 0:96: '=' : cannot convert from ' const 4X4 matrix of float' to ' temp 2-component vector of float' +ERROR: 0:97: '=' : cannot convert from ' const 2-component vector of float' to ' temp 3-component vector of float' +ERROR: 0:98: '=' : cannot convert from ' const 2X2 matrix of float' to ' temp 3-component vector of float' +ERROR: 0:99: '=' : cannot convert from ' const 2X3 matrix of float' to ' temp 3-component vector of float' +ERROR: 0:100: '=' : cannot convert from ' const 2X4 matrix of float' to ' temp 3-component vector of float' +ERROR: 0:101: '=' : cannot convert from ' const 3X2 matrix of float' to ' temp 3-component vector of float' +ERROR: 0:102: '=' : cannot convert from ' const 3X3 matrix of float' to ' temp 3-component vector of float' +ERROR: 0:103: '=' : cannot convert from ' const 3X4 matrix of float' to ' temp 3-component vector of float' +ERROR: 0:104: '=' : cannot convert from ' const 4X2 matrix of float' to ' temp 3-component vector of float' +ERROR: 0:105: '=' : cannot convert from ' const 4X3 matrix of float' to ' temp 3-component vector of float' +ERROR: 0:106: '=' : cannot convert from ' const 4X4 matrix of float' to ' temp 3-component vector of float' +ERROR: 0:107: '=' : cannot convert from ' const 2-component vector of float' to ' temp 4-component vector of float' +ERROR: 0:108: '=' : cannot convert from ' const 3-component vector of float' to ' temp 4-component vector of float' +ERROR: 0:109: '=' : cannot convert from ' const 2X3 matrix of float' to ' temp 4-component vector of float' +ERROR: 0:110: '=' : cannot convert from ' const 2X4 matrix of float' to ' temp 4-component vector of float' +ERROR: 0:111: '=' : cannot convert from ' const 3X2 matrix of float' to ' temp 4-component vector of float' +ERROR: 0:112: '=' : cannot convert from ' const 3X3 matrix of float' to ' temp 4-component vector of float' +ERROR: 0:113: '=' : cannot convert from ' const 3X4 matrix of float' to ' temp 4-component vector of float' +ERROR: 0:114: '=' : cannot convert from ' const 4X2 matrix of float' to ' temp 4-component vector of float' +ERROR: 0:115: '=' : cannot convert from ' const 4X3 matrix of float' to ' temp 4-component vector of float' +ERROR: 0:116: '=' : cannot convert from ' const 4X4 matrix of float' to ' temp 4-component vector of float' +ERROR: 0:117: '=' : cannot convert from ' const 2-component vector of float' to ' temp 2X2 matrix of float' +ERROR: 0:118: '=' : cannot convert from ' const 3-component vector of float' to ' temp 2X2 matrix of float' +ERROR: 0:119: '=' : cannot convert from ' const 2-component vector of float' to ' temp 2X3 matrix of float' +ERROR: 0:120: '=' : cannot convert from ' const 3-component vector of float' to ' temp 2X3 matrix of float' +ERROR: 0:121: '=' : cannot convert from ' const 4-component vector of float' to ' temp 2X3 matrix of float' +ERROR: 0:122: '=' : cannot convert from ' const 2X2 matrix of float' to ' temp 2X3 matrix of float' +ERROR: 0:123: '=' : cannot convert from ' const 3X2 matrix of float' to ' temp 2X3 matrix of float' +ERROR: 0:124: '=' : cannot convert from ' const 4X2 matrix of float' to ' temp 2X3 matrix of float' +ERROR: 0:125: '=' : cannot convert from ' const 2-component vector of float' to ' temp 2X4 matrix of float' +ERROR: 0:126: '=' : cannot convert from ' const 3-component vector of float' to ' temp 2X4 matrix of float' +ERROR: 0:127: '=' : cannot convert from ' const 4-component vector of float' to ' temp 2X4 matrix of float' +ERROR: 0:128: '=' : cannot convert from ' const 2X2 matrix of float' to ' temp 2X4 matrix of float' +ERROR: 0:129: '=' : cannot convert from ' const 2X3 matrix of float' to ' temp 2X4 matrix of float' +ERROR: 0:130: '=' : cannot convert from ' const 3X2 matrix of float' to ' temp 2X4 matrix of float' +ERROR: 0:131: '=' : cannot convert from ' const 3X3 matrix of float' to ' temp 2X4 matrix of float' +ERROR: 0:132: '=' : cannot convert from ' const 4X2 matrix of float' to ' temp 2X4 matrix of float' +ERROR: 0:133: '=' : cannot convert from ' const 4X3 matrix of float' to ' temp 2X4 matrix of float' +ERROR: 0:134: '=' : cannot convert from ' const 2-component vector of float' to ' temp 3X2 matrix of float' +ERROR: 0:135: '=' : cannot convert from ' const 3-component vector of float' to ' temp 3X2 matrix of float' +ERROR: 0:136: '=' : cannot convert from ' const 4-component vector of float' to ' temp 3X2 matrix of float' +ERROR: 0:137: '=' : cannot convert from ' const 2X2 matrix of float' to ' temp 3X2 matrix of float' +ERROR: 0:138: '=' : cannot convert from ' const 2X3 matrix of float' to ' temp 3X2 matrix of float' +ERROR: 0:139: '=' : cannot convert from ' const 2X4 matrix of float' to ' temp 3X2 matrix of float' +ERROR: 0:140: '=' : cannot convert from ' const 2-component vector of float' to ' temp 3X3 matrix of float' +ERROR: 0:141: '=' : cannot convert from ' const 3-component vector of float' to ' temp 3X3 matrix of float' +ERROR: 0:142: '=' : cannot convert from ' const 4-component vector of float' to ' temp 3X3 matrix of float' +ERROR: 0:143: '=' : cannot convert from ' const 2X2 matrix of float' to ' temp 3X3 matrix of float' +ERROR: 0:144: '=' : cannot convert from ' const 2X3 matrix of float' to ' temp 3X3 matrix of float' +ERROR: 0:145: '=' : cannot convert from ' const 2X4 matrix of float' to ' temp 3X3 matrix of float' +ERROR: 0:146: '=' : cannot convert from ' const 3X2 matrix of float' to ' temp 3X3 matrix of float' +ERROR: 0:147: '=' : cannot convert from ' const 4X2 matrix of float' to ' temp 3X3 matrix of float' +ERROR: 0:148: '=' : cannot convert from ' const 2-component vector of float' to ' temp 3X4 matrix of float' +ERROR: 0:149: '=' : cannot convert from ' const 3-component vector of float' to ' temp 3X4 matrix of float' +ERROR: 0:150: '=' : cannot convert from ' const 4-component vector of float' to ' temp 3X4 matrix of float' +ERROR: 0:151: '=' : cannot convert from ' const 2X2 matrix of float' to ' temp 3X4 matrix of float' +ERROR: 0:152: '=' : cannot convert from ' const 2X3 matrix of float' to ' temp 3X4 matrix of float' +ERROR: 0:153: '=' : cannot convert from ' const 2X4 matrix of float' to ' temp 3X4 matrix of float' +ERROR: 0:154: '=' : cannot convert from ' const 3X2 matrix of float' to ' temp 3X4 matrix of float' +ERROR: 0:155: '=' : cannot convert from ' const 3X3 matrix of float' to ' temp 3X4 matrix of float' +ERROR: 0:156: '=' : cannot convert from ' const 4X2 matrix of float' to ' temp 3X4 matrix of float' +ERROR: 0:157: '=' : cannot convert from ' const 4X3 matrix of float' to ' temp 3X4 matrix of float' +ERROR: 0:158: '=' : cannot convert from ' const 2-component vector of float' to ' temp 4X2 matrix of float' +ERROR: 0:159: '=' : cannot convert from ' const 3-component vector of float' to ' temp 4X2 matrix of float' +ERROR: 0:160: '=' : cannot convert from ' const 4-component vector of float' to ' temp 4X2 matrix of float' +ERROR: 0:161: '=' : cannot convert from ' const 2X2 matrix of float' to ' temp 4X2 matrix of float' +ERROR: 0:162: '=' : cannot convert from ' const 2X3 matrix of float' to ' temp 4X2 matrix of float' +ERROR: 0:163: '=' : cannot convert from ' const 2X4 matrix of float' to ' temp 4X2 matrix of float' +ERROR: 0:164: '=' : cannot convert from ' const 3X2 matrix of float' to ' temp 4X2 matrix of float' +ERROR: 0:165: '=' : cannot convert from ' const 3X3 matrix of float' to ' temp 4X2 matrix of float' +ERROR: 0:166: '=' : cannot convert from ' const 3X4 matrix of float' to ' temp 4X2 matrix of float' +ERROR: 0:167: '=' : cannot convert from ' const 2-component vector of float' to ' temp 4X3 matrix of float' +ERROR: 0:168: '=' : cannot convert from ' const 3-component vector of float' to ' temp 4X3 matrix of float' +ERROR: 0:169: '=' : cannot convert from ' const 4-component vector of float' to ' temp 4X3 matrix of float' +ERROR: 0:170: '=' : cannot convert from ' const 2X2 matrix of float' to ' temp 4X3 matrix of float' +ERROR: 0:171: '=' : cannot convert from ' const 2X3 matrix of float' to ' temp 4X3 matrix of float' +ERROR: 0:172: '=' : cannot convert from ' const 2X4 matrix of float' to ' temp 4X3 matrix of float' +ERROR: 0:173: '=' : cannot convert from ' const 3X2 matrix of float' to ' temp 4X3 matrix of float' +ERROR: 0:174: '=' : cannot convert from ' const 3X3 matrix of float' to ' temp 4X3 matrix of float' +ERROR: 0:175: '=' : cannot convert from ' const 3X4 matrix of float' to ' temp 4X3 matrix of float' +ERROR: 0:176: '=' : cannot convert from ' const 4X2 matrix of float' to ' temp 4X3 matrix of float' +ERROR: 0:177: '=' : cannot convert from ' const 2-component vector of float' to ' temp 4X4 matrix of float' +ERROR: 0:178: '=' : cannot convert from ' const 3-component vector of float' to ' temp 4X4 matrix of float' +ERROR: 0:179: '=' : cannot convert from ' const 4-component vector of float' to ' temp 4X4 matrix of float' +ERROR: 0:180: '=' : cannot convert from ' const 2X2 matrix of float' to ' temp 4X4 matrix of float' +ERROR: 0:181: '=' : cannot convert from ' const 2X3 matrix of float' to ' temp 4X4 matrix of float' +ERROR: 0:182: '=' : cannot convert from ' const 2X4 matrix of float' to ' temp 4X4 matrix of float' +ERROR: 0:183: '=' : cannot convert from ' const 3X2 matrix of float' to ' temp 4X4 matrix of float' +ERROR: 0:184: '=' : cannot convert from ' const 3X3 matrix of float' to ' temp 4X4 matrix of float' +ERROR: 0:185: '=' : cannot convert from ' const 3X4 matrix of float' to ' temp 4X4 matrix of float' +ERROR: 0:186: '=' : cannot convert from ' const 4X2 matrix of float' to ' temp 4X4 matrix of float' +ERROR: 0:187: '=' : cannot convert from ' const 4X3 matrix of float' to ' temp 4X4 matrix of float' +ERROR: 100 compilation errors. No code generated. + + +Shader version: 500 +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:18 Function Definition: @main( ( temp 4-component vector of float) +0:18 Function Parameters: +0:? Sequence +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'var0' ( temp float) +0:19 Constant: +0:19 0.000000 +0:20 Sequence +0:20 move second child to first child ( temp 2-component vector of float) +0:20 'var13' ( temp 2-component vector of float) +0:20 Constant: +0:20 0.000000 +0:20 0.000000 +0:21 Sequence +0:21 move second child to first child ( temp 2-component vector of float) +0:21 'var14' ( temp 2-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:22 Sequence +0:22 move second child to first child ( temp 3-component vector of float) +0:22 'var26' ( temp 3-component vector of float) +0:22 Constant: +0:22 0.000000 +0:22 0.000000 +0:22 0.000000 +0:23 Sequence +0:23 move second child to first child ( temp 3-component vector of float) +0:23 'var28' ( temp 3-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:24 Sequence +0:24 move second child to first child ( temp 4-component vector of float) +0:24 'var39' ( temp 4-component vector of float) +0:24 Constant: +0:24 0.000000 +0:24 0.000000 +0:24 0.000000 +0:24 0.000000 +0:25 Sequence +0:25 move second child to first child ( temp 4-component vector of float) +0:25 'var42' ( temp 4-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:26 Sequence +0:26 move second child to first child ( temp 4-component vector of float) +0:26 'var43' ( temp 4-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:27 Sequence +0:27 move second child to first child ( temp 2X2 matrix of float) +0:27 'var52' ( temp 2X2 matrix of float) +0:27 Constant: +0:27 0.000000 +0:27 0.000000 +0:27 0.000000 +0:27 0.000000 +0:28 Sequence +0:28 move second child to first child ( temp 2X2 matrix of float) +0:28 'var55' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:29 Sequence +0:29 move second child to first child ( temp 2X2 matrix of float) +0:29 'var56' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:30 Sequence +0:30 move second child to first child ( temp 2X3 matrix of float) +0:30 'var65' ( temp 2X3 matrix of float) +0:30 Constant: +0:30 0.000000 +0:30 0.000000 +0:30 0.000000 +0:30 0.000000 +0:30 0.000000 +0:30 0.000000 +0:31 Sequence +0:31 move second child to first child ( temp 2X3 matrix of float) +0:31 'var70' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:32 Sequence +0:32 move second child to first child ( temp 2X4 matrix of float) +0:32 'var78' ( temp 2X4 matrix of float) +0:32 Constant: +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:33 Sequence +0:33 move second child to first child ( temp 2X4 matrix of float) +0:33 'var84' ( temp 2X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:34 Sequence +0:34 move second child to first child ( temp 3X2 matrix of float) +0:34 'var91' ( temp 3X2 matrix of float) +0:34 Constant: +0:34 0.000000 +0:34 0.000000 +0:34 0.000000 +0:34 0.000000 +0:34 0.000000 +0:34 0.000000 +0:35 Sequence +0:35 move second child to first child ( temp 3X2 matrix of float) +0:35 'var98' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:36 Sequence +0:36 move second child to first child ( temp 3X3 matrix of float) +0:36 'var104' ( temp 3X3 matrix of float) +0:36 Constant: +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:37 Sequence +0:37 move second child to first child ( temp 3X3 matrix of float) +0:37 'var112' ( temp 3X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:38 Sequence +0:38 move second child to first child ( temp 3X4 matrix of float) +0:38 'var117' ( temp 3X4 matrix of float) +0:38 Constant: +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:39 Sequence +0:39 move second child to first child ( temp 3X4 matrix of float) +0:39 'var126' ( temp 3X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:40 Sequence +0:40 move second child to first child ( temp 4X2 matrix of float) +0:40 'var130' ( temp 4X2 matrix of float) +0:40 Constant: +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:41 Sequence +0:41 move second child to first child ( temp 4X2 matrix of float) +0:41 'var140' ( temp 4X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:42 Sequence +0:42 move second child to first child ( temp 4X3 matrix of float) +0:42 'var143' ( temp 4X3 matrix of float) +0:42 Constant: +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:43 Sequence +0:43 move second child to first child ( temp 4X3 matrix of float) +0:43 'var154' ( temp 4X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:44 Sequence +0:44 move second child to first child ( temp 4X4 matrix of float) +0:44 'var156' ( temp 4X4 matrix of float) +0:44 Constant: +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:45 Sequence +0:45 move second child to first child ( temp 4X4 matrix of float) +0:45 'var168' ( temp 4X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:46 Sequence +0:46 move second child to first child ( temp float) +0:46 'var1' ( temp float) +0:? Constant: +0:? 0.000000 +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'var2' ( temp float) +0:? Constant: +0:? 0.000000 +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'var3' ( temp float) +0:? Constant: +0:? 0.000000 +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'var4' ( temp float) +0:? Constant: +0:? 0.000000 +0:50 Sequence +0:50 move second child to first child ( temp float) +0:50 'var5' ( temp float) +0:? Constant: +0:? 0.000000 +0:51 Sequence +0:51 move second child to first child ( temp float) +0:51 'var6' ( temp float) +0:? Constant: +0:? 0.000000 +0:52 Sequence +0:52 move second child to first child ( temp float) +0:52 'var7' ( temp float) +0:? Constant: +0:? 0.000000 +0:53 Sequence +0:53 move second child to first child ( temp float) +0:53 'var8' ( temp float) +0:? Constant: +0:? 0.000000 +0:54 Sequence +0:54 move second child to first child ( temp float) +0:54 'var9' ( temp float) +0:? Constant: +0:? 0.000000 +0:55 Sequence +0:55 move second child to first child ( temp float) +0:55 'var10' ( temp float) +0:? Constant: +0:? 0.000000 +0:56 Sequence +0:56 move second child to first child ( temp float) +0:56 'var11' ( temp float) +0:? Constant: +0:? 0.000000 +0:57 Sequence +0:57 move second child to first child ( temp float) +0:57 'var12' ( temp float) +0:? Constant: +0:? 0.000000 +0:58 Sequence +0:58 move second child to first child ( temp 2-component vector of float) +0:58 'var15' ( temp 2-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:59 Sequence +0:59 move second child to first child ( temp 2-component vector of float) +0:59 'var16' ( temp 2-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:60 Sequence +0:60 move second child to first child ( temp 3-component vector of float) +0:60 'var29' ( temp 3-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:61 Sequence +0:61 move second child to first child ( temp 2X2 matrix of float) +0:61 'var57' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:62 Sequence +0:62 move second child to first child ( temp 2X2 matrix of float) +0:62 'var58' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:63 Sequence +0:63 move second child to first child ( temp 2X2 matrix of float) +0:63 'var59' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:64 Sequence +0:64 move second child to first child ( temp 2X2 matrix of float) +0:64 'var60' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:65 Sequence +0:65 move second child to first child ( temp 2X2 matrix of float) +0:65 'var61' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:66 Sequence +0:66 move second child to first child ( temp 2X2 matrix of float) +0:66 'var62' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:67 Sequence +0:67 move second child to first child ( temp 2X2 matrix of float) +0:67 'var63' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:68 Sequence +0:68 move second child to first child ( temp 2X2 matrix of float) +0:68 'var64' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:69 Sequence +0:69 move second child to first child ( temp 2X3 matrix of float) +0:69 'var71' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:70 Sequence +0:70 move second child to first child ( temp 2X3 matrix of float) +0:70 'var73' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:71 Sequence +0:71 move second child to first child ( temp 2X3 matrix of float) +0:71 'var74' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:72 Sequence +0:72 move second child to first child ( temp 2X3 matrix of float) +0:72 'var76' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:73 Sequence +0:73 move second child to first child ( temp 2X3 matrix of float) +0:73 'var77' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:74 Sequence +0:74 move second child to first child ( temp 2X4 matrix of float) +0:74 'var87' ( temp 2X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:75 Sequence +0:75 move second child to first child ( temp 2X4 matrix of float) +0:75 'var90' ( temp 2X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:76 Sequence +0:76 move second child to first child ( temp 3X2 matrix of float) +0:76 'var99' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:77 Sequence +0:77 move second child to first child ( temp 3X2 matrix of float) +0:77 'var100' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:78 Sequence +0:78 move second child to first child ( temp 3X2 matrix of float) +0:78 'var101' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:79 Sequence +0:79 move second child to first child ( temp 3X2 matrix of float) +0:79 'var102' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:80 Sequence +0:80 move second child to first child ( temp 3X2 matrix of float) +0:80 'var103' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:81 Sequence +0:81 move second child to first child ( temp 3X3 matrix of float) +0:81 'var113' ( temp 3X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:82 Sequence +0:82 move second child to first child ( temp 3X3 matrix of float) +0:82 'var115' ( temp 3X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:83 Sequence +0:83 move second child to first child ( temp 3X3 matrix of float) +0:83 'var116' ( temp 3X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:84 Sequence +0:84 move second child to first child ( temp 3X4 matrix of float) +0:84 'var129' ( temp 3X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:85 Sequence +0:85 move second child to first child ( temp 4X2 matrix of float) +0:85 'var141' ( temp 4X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:86 Sequence +0:86 move second child to first child ( temp 4X2 matrix of float) +0:86 'var142' ( temp 4X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:87 Sequence +0:87 move second child to first child ( temp 4X3 matrix of float) +0:87 'var155' ( temp 4X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:188 Branch: Return with expression +0:188 Constant: +0:188 0.000000 +0:188 0.000000 +0:188 0.000000 +0:188 0.000000 +0:18 Function Definition: main( ( temp void) +0:18 Function Parameters: +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:18 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:18 Function Definition: @main( ( temp 4-component vector of float) +0:18 Function Parameters: +0:? Sequence +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'var0' ( temp float) +0:19 Constant: +0:19 0.000000 +0:20 Sequence +0:20 move second child to first child ( temp 2-component vector of float) +0:20 'var13' ( temp 2-component vector of float) +0:20 Constant: +0:20 0.000000 +0:20 0.000000 +0:21 Sequence +0:21 move second child to first child ( temp 2-component vector of float) +0:21 'var14' ( temp 2-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:22 Sequence +0:22 move second child to first child ( temp 3-component vector of float) +0:22 'var26' ( temp 3-component vector of float) +0:22 Constant: +0:22 0.000000 +0:22 0.000000 +0:22 0.000000 +0:23 Sequence +0:23 move second child to first child ( temp 3-component vector of float) +0:23 'var28' ( temp 3-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:24 Sequence +0:24 move second child to first child ( temp 4-component vector of float) +0:24 'var39' ( temp 4-component vector of float) +0:24 Constant: +0:24 0.000000 +0:24 0.000000 +0:24 0.000000 +0:24 0.000000 +0:25 Sequence +0:25 move second child to first child ( temp 4-component vector of float) +0:25 'var42' ( temp 4-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:26 Sequence +0:26 move second child to first child ( temp 4-component vector of float) +0:26 'var43' ( temp 4-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:27 Sequence +0:27 move second child to first child ( temp 2X2 matrix of float) +0:27 'var52' ( temp 2X2 matrix of float) +0:27 Constant: +0:27 0.000000 +0:27 0.000000 +0:27 0.000000 +0:27 0.000000 +0:28 Sequence +0:28 move second child to first child ( temp 2X2 matrix of float) +0:28 'var55' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:29 Sequence +0:29 move second child to first child ( temp 2X2 matrix of float) +0:29 'var56' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:30 Sequence +0:30 move second child to first child ( temp 2X3 matrix of float) +0:30 'var65' ( temp 2X3 matrix of float) +0:30 Constant: +0:30 0.000000 +0:30 0.000000 +0:30 0.000000 +0:30 0.000000 +0:30 0.000000 +0:30 0.000000 +0:31 Sequence +0:31 move second child to first child ( temp 2X3 matrix of float) +0:31 'var70' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:32 Sequence +0:32 move second child to first child ( temp 2X4 matrix of float) +0:32 'var78' ( temp 2X4 matrix of float) +0:32 Constant: +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:33 Sequence +0:33 move second child to first child ( temp 2X4 matrix of float) +0:33 'var84' ( temp 2X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:34 Sequence +0:34 move second child to first child ( temp 3X2 matrix of float) +0:34 'var91' ( temp 3X2 matrix of float) +0:34 Constant: +0:34 0.000000 +0:34 0.000000 +0:34 0.000000 +0:34 0.000000 +0:34 0.000000 +0:34 0.000000 +0:35 Sequence +0:35 move second child to first child ( temp 3X2 matrix of float) +0:35 'var98' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:36 Sequence +0:36 move second child to first child ( temp 3X3 matrix of float) +0:36 'var104' ( temp 3X3 matrix of float) +0:36 Constant: +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:37 Sequence +0:37 move second child to first child ( temp 3X3 matrix of float) +0:37 'var112' ( temp 3X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:38 Sequence +0:38 move second child to first child ( temp 3X4 matrix of float) +0:38 'var117' ( temp 3X4 matrix of float) +0:38 Constant: +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:39 Sequence +0:39 move second child to first child ( temp 3X4 matrix of float) +0:39 'var126' ( temp 3X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:40 Sequence +0:40 move second child to first child ( temp 4X2 matrix of float) +0:40 'var130' ( temp 4X2 matrix of float) +0:40 Constant: +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:41 Sequence +0:41 move second child to first child ( temp 4X2 matrix of float) +0:41 'var140' ( temp 4X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:42 Sequence +0:42 move second child to first child ( temp 4X3 matrix of float) +0:42 'var143' ( temp 4X3 matrix of float) +0:42 Constant: +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:43 Sequence +0:43 move second child to first child ( temp 4X3 matrix of float) +0:43 'var154' ( temp 4X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:44 Sequence +0:44 move second child to first child ( temp 4X4 matrix of float) +0:44 'var156' ( temp 4X4 matrix of float) +0:44 Constant: +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:45 Sequence +0:45 move second child to first child ( temp 4X4 matrix of float) +0:45 'var168' ( temp 4X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:46 Sequence +0:46 move second child to first child ( temp float) +0:46 'var1' ( temp float) +0:? Constant: +0:? 0.000000 +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'var2' ( temp float) +0:? Constant: +0:? 0.000000 +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'var3' ( temp float) +0:? Constant: +0:? 0.000000 +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'var4' ( temp float) +0:? Constant: +0:? 0.000000 +0:50 Sequence +0:50 move second child to first child ( temp float) +0:50 'var5' ( temp float) +0:? Constant: +0:? 0.000000 +0:51 Sequence +0:51 move second child to first child ( temp float) +0:51 'var6' ( temp float) +0:? Constant: +0:? 0.000000 +0:52 Sequence +0:52 move second child to first child ( temp float) +0:52 'var7' ( temp float) +0:? Constant: +0:? 0.000000 +0:53 Sequence +0:53 move second child to first child ( temp float) +0:53 'var8' ( temp float) +0:? Constant: +0:? 0.000000 +0:54 Sequence +0:54 move second child to first child ( temp float) +0:54 'var9' ( temp float) +0:? Constant: +0:? 0.000000 +0:55 Sequence +0:55 move second child to first child ( temp float) +0:55 'var10' ( temp float) +0:? Constant: +0:? 0.000000 +0:56 Sequence +0:56 move second child to first child ( temp float) +0:56 'var11' ( temp float) +0:? Constant: +0:? 0.000000 +0:57 Sequence +0:57 move second child to first child ( temp float) +0:57 'var12' ( temp float) +0:? Constant: +0:? 0.000000 +0:58 Sequence +0:58 move second child to first child ( temp 2-component vector of float) +0:58 'var15' ( temp 2-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:59 Sequence +0:59 move second child to first child ( temp 2-component vector of float) +0:59 'var16' ( temp 2-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:60 Sequence +0:60 move second child to first child ( temp 3-component vector of float) +0:60 'var29' ( temp 3-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:61 Sequence +0:61 move second child to first child ( temp 2X2 matrix of float) +0:61 'var57' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:62 Sequence +0:62 move second child to first child ( temp 2X2 matrix of float) +0:62 'var58' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:63 Sequence +0:63 move second child to first child ( temp 2X2 matrix of float) +0:63 'var59' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:64 Sequence +0:64 move second child to first child ( temp 2X2 matrix of float) +0:64 'var60' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:65 Sequence +0:65 move second child to first child ( temp 2X2 matrix of float) +0:65 'var61' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:66 Sequence +0:66 move second child to first child ( temp 2X2 matrix of float) +0:66 'var62' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:67 Sequence +0:67 move second child to first child ( temp 2X2 matrix of float) +0:67 'var63' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:68 Sequence +0:68 move second child to first child ( temp 2X2 matrix of float) +0:68 'var64' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:69 Sequence +0:69 move second child to first child ( temp 2X3 matrix of float) +0:69 'var71' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:70 Sequence +0:70 move second child to first child ( temp 2X3 matrix of float) +0:70 'var73' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:71 Sequence +0:71 move second child to first child ( temp 2X3 matrix of float) +0:71 'var74' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:72 Sequence +0:72 move second child to first child ( temp 2X3 matrix of float) +0:72 'var76' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:73 Sequence +0:73 move second child to first child ( temp 2X3 matrix of float) +0:73 'var77' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:74 Sequence +0:74 move second child to first child ( temp 2X4 matrix of float) +0:74 'var87' ( temp 2X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:75 Sequence +0:75 move second child to first child ( temp 2X4 matrix of float) +0:75 'var90' ( temp 2X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:76 Sequence +0:76 move second child to first child ( temp 3X2 matrix of float) +0:76 'var99' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:77 Sequence +0:77 move second child to first child ( temp 3X2 matrix of float) +0:77 'var100' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:78 Sequence +0:78 move second child to first child ( temp 3X2 matrix of float) +0:78 'var101' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:79 Sequence +0:79 move second child to first child ( temp 3X2 matrix of float) +0:79 'var102' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:80 Sequence +0:80 move second child to first child ( temp 3X2 matrix of float) +0:80 'var103' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:81 Sequence +0:81 move second child to first child ( temp 3X3 matrix of float) +0:81 'var113' ( temp 3X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:82 Sequence +0:82 move second child to first child ( temp 3X3 matrix of float) +0:82 'var115' ( temp 3X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:83 Sequence +0:83 move second child to first child ( temp 3X3 matrix of float) +0:83 'var116' ( temp 3X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:84 Sequence +0:84 move second child to first child ( temp 3X4 matrix of float) +0:84 'var129' ( temp 3X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:85 Sequence +0:85 move second child to first child ( temp 4X2 matrix of float) +0:85 'var141' ( temp 4X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:86 Sequence +0:86 move second child to first child ( temp 4X2 matrix of float) +0:86 'var142' ( temp 4X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:87 Sequence +0:87 move second child to first child ( temp 4X3 matrix of float) +0:87 'var155' ( temp 4X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:188 Branch: Return with expression +0:188 Constant: +0:188 0.000000 +0:188 0.000000 +0:188 0.000000 +0:188 0.000000 +0:18 Function Definition: main( ( temp void) +0:18 Function Parameters: +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:18 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/hlsl.type.type.conversion.valid.frag.out b/deps/glslang/Test/baseResults/hlsl.type.type.conversion.valid.frag.out new file mode 100644 index 00000000..fc672001 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.type.type.conversion.valid.frag.out @@ -0,0 +1,1640 @@ +hlsl.type.type.conversion.valid.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:18 Function Definition: @main( ( temp 4-component vector of float) +0:18 Function Parameters: +0:? Sequence +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'var0' ( temp float) +0:19 Constant: +0:19 0.000000 +0:20 Sequence +0:20 move second child to first child ( temp 2-component vector of float) +0:20 'var13' ( temp 2-component vector of float) +0:20 Constant: +0:20 0.000000 +0:20 0.000000 +0:21 Sequence +0:21 move second child to first child ( temp 2-component vector of float) +0:21 'var14' ( temp 2-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:22 Sequence +0:22 move second child to first child ( temp 3-component vector of float) +0:22 'var26' ( temp 3-component vector of float) +0:22 Constant: +0:22 0.000000 +0:22 0.000000 +0:22 0.000000 +0:23 Sequence +0:23 move second child to first child ( temp 3-component vector of float) +0:23 'var28' ( temp 3-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:24 Sequence +0:24 move second child to first child ( temp 4-component vector of float) +0:24 'var39' ( temp 4-component vector of float) +0:24 Constant: +0:24 0.000000 +0:24 0.000000 +0:24 0.000000 +0:24 0.000000 +0:25 Sequence +0:25 move second child to first child ( temp 4-component vector of float) +0:25 'var42' ( temp 4-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:26 Sequence +0:26 move second child to first child ( temp 4-component vector of float) +0:26 'var43' ( temp 4-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:27 Sequence +0:27 move second child to first child ( temp 2X2 matrix of float) +0:27 'var52' ( temp 2X2 matrix of float) +0:27 Constant: +0:27 0.000000 +0:27 0.000000 +0:27 0.000000 +0:27 0.000000 +0:28 Sequence +0:28 move second child to first child ( temp 2X2 matrix of float) +0:28 'var55' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:29 Sequence +0:29 move second child to first child ( temp 2X2 matrix of float) +0:29 'var56' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:30 Sequence +0:30 move second child to first child ( temp 2X3 matrix of float) +0:30 'var65' ( temp 2X3 matrix of float) +0:30 Constant: +0:30 0.000000 +0:30 0.000000 +0:30 0.000000 +0:30 0.000000 +0:30 0.000000 +0:30 0.000000 +0:31 Sequence +0:31 move second child to first child ( temp 2X3 matrix of float) +0:31 'var70' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:32 Sequence +0:32 move second child to first child ( temp 2X4 matrix of float) +0:32 'var78' ( temp 2X4 matrix of float) +0:32 Constant: +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:33 Sequence +0:33 move second child to first child ( temp 2X4 matrix of float) +0:33 'var84' ( temp 2X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:34 Sequence +0:34 move second child to first child ( temp 3X2 matrix of float) +0:34 'var91' ( temp 3X2 matrix of float) +0:34 Constant: +0:34 0.000000 +0:34 0.000000 +0:34 0.000000 +0:34 0.000000 +0:34 0.000000 +0:34 0.000000 +0:35 Sequence +0:35 move second child to first child ( temp 3X2 matrix of float) +0:35 'var98' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:36 Sequence +0:36 move second child to first child ( temp 3X3 matrix of float) +0:36 'var104' ( temp 3X3 matrix of float) +0:36 Constant: +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:37 Sequence +0:37 move second child to first child ( temp 3X3 matrix of float) +0:37 'var112' ( temp 3X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:38 Sequence +0:38 move second child to first child ( temp 3X4 matrix of float) +0:38 'var117' ( temp 3X4 matrix of float) +0:38 Constant: +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:39 Sequence +0:39 move second child to first child ( temp 3X4 matrix of float) +0:39 'var126' ( temp 3X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:40 Sequence +0:40 move second child to first child ( temp 4X2 matrix of float) +0:40 'var130' ( temp 4X2 matrix of float) +0:40 Constant: +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:41 Sequence +0:41 move second child to first child ( temp 4X2 matrix of float) +0:41 'var140' ( temp 4X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:42 Sequence +0:42 move second child to first child ( temp 4X3 matrix of float) +0:42 'var143' ( temp 4X3 matrix of float) +0:42 Constant: +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:43 Sequence +0:43 move second child to first child ( temp 4X3 matrix of float) +0:43 'var154' ( temp 4X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:44 Sequence +0:44 move second child to first child ( temp 4X4 matrix of float) +0:44 'var156' ( temp 4X4 matrix of float) +0:44 Constant: +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:45 Sequence +0:45 move second child to first child ( temp 4X4 matrix of float) +0:45 'var168' ( temp 4X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:46 Sequence +0:46 move second child to first child ( temp float) +0:46 'var1' ( temp float) +0:? Constant: +0:? 0.000000 +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'var2' ( temp float) +0:? Constant: +0:? 0.000000 +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'var3' ( temp float) +0:? Constant: +0:? 0.000000 +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'var4' ( temp float) +0:? Constant: +0:? 0.000000 +0:50 Sequence +0:50 move second child to first child ( temp float) +0:50 'var5' ( temp float) +0:? Constant: +0:? 0.000000 +0:51 Sequence +0:51 move second child to first child ( temp float) +0:51 'var6' ( temp float) +0:? Constant: +0:? 0.000000 +0:52 Sequence +0:52 move second child to first child ( temp float) +0:52 'var7' ( temp float) +0:? Constant: +0:? 0.000000 +0:53 Sequence +0:53 move second child to first child ( temp float) +0:53 'var8' ( temp float) +0:? Constant: +0:? 0.000000 +0:54 Sequence +0:54 move second child to first child ( temp float) +0:54 'var9' ( temp float) +0:? Constant: +0:? 0.000000 +0:55 Sequence +0:55 move second child to first child ( temp float) +0:55 'var10' ( temp float) +0:? Constant: +0:? 0.000000 +0:56 Sequence +0:56 move second child to first child ( temp float) +0:56 'var11' ( temp float) +0:? Constant: +0:? 0.000000 +0:57 Sequence +0:57 move second child to first child ( temp float) +0:57 'var12' ( temp float) +0:? Constant: +0:? 0.000000 +0:58 Sequence +0:58 move second child to first child ( temp 2-component vector of float) +0:58 'var15' ( temp 2-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:59 Sequence +0:59 move second child to first child ( temp 2-component vector of float) +0:59 'var16' ( temp 2-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:60 Sequence +0:60 move second child to first child ( temp 3-component vector of float) +0:60 'var29' ( temp 3-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:61 Sequence +0:61 move second child to first child ( temp 2X2 matrix of float) +0:61 'var57' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:62 Sequence +0:62 move second child to first child ( temp 2X2 matrix of float) +0:62 'var58' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:63 Sequence +0:63 move second child to first child ( temp 2X2 matrix of float) +0:63 'var59' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:64 Sequence +0:64 move second child to first child ( temp 2X2 matrix of float) +0:64 'var60' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:65 Sequence +0:65 move second child to first child ( temp 2X2 matrix of float) +0:65 'var61' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:66 Sequence +0:66 move second child to first child ( temp 2X2 matrix of float) +0:66 'var62' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:67 Sequence +0:67 move second child to first child ( temp 2X2 matrix of float) +0:67 'var63' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:68 Sequence +0:68 move second child to first child ( temp 2X2 matrix of float) +0:68 'var64' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:69 Sequence +0:69 move second child to first child ( temp 2X3 matrix of float) +0:69 'var71' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:70 Sequence +0:70 move second child to first child ( temp 2X3 matrix of float) +0:70 'var73' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:71 Sequence +0:71 move second child to first child ( temp 2X3 matrix of float) +0:71 'var74' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:72 Sequence +0:72 move second child to first child ( temp 2X3 matrix of float) +0:72 'var76' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:73 Sequence +0:73 move second child to first child ( temp 2X3 matrix of float) +0:73 'var77' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:74 Sequence +0:74 move second child to first child ( temp 2X4 matrix of float) +0:74 'var87' ( temp 2X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:75 Sequence +0:75 move second child to first child ( temp 2X4 matrix of float) +0:75 'var90' ( temp 2X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:76 Sequence +0:76 move second child to first child ( temp 3X2 matrix of float) +0:76 'var99' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:77 Sequence +0:77 move second child to first child ( temp 3X2 matrix of float) +0:77 'var100' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:78 Sequence +0:78 move second child to first child ( temp 3X2 matrix of float) +0:78 'var101' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:79 Sequence +0:79 move second child to first child ( temp 3X2 matrix of float) +0:79 'var102' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:80 Sequence +0:80 move second child to first child ( temp 3X2 matrix of float) +0:80 'var103' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:81 Sequence +0:81 move second child to first child ( temp 3X3 matrix of float) +0:81 'var113' ( temp 3X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:82 Sequence +0:82 move second child to first child ( temp 3X3 matrix of float) +0:82 'var115' ( temp 3X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:83 Sequence +0:83 move second child to first child ( temp 3X3 matrix of float) +0:83 'var116' ( temp 3X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:84 Sequence +0:84 move second child to first child ( temp 3X4 matrix of float) +0:84 'var129' ( temp 3X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:85 Sequence +0:85 move second child to first child ( temp 4X2 matrix of float) +0:85 'var141' ( temp 4X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:86 Sequence +0:86 move second child to first child ( temp 4X2 matrix of float) +0:86 'var142' ( temp 4X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:87 Sequence +0:87 move second child to first child ( temp 4X3 matrix of float) +0:87 'var155' ( temp 4X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:88 Branch: Return with expression +0:88 Constant: +0:88 0.000000 +0:88 0.000000 +0:88 0.000000 +0:88 0.000000 +0:18 Function Definition: main( ( temp void) +0:18 Function Parameters: +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:18 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:18 Function Definition: @main( ( temp 4-component vector of float) +0:18 Function Parameters: +0:? Sequence +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'var0' ( temp float) +0:19 Constant: +0:19 0.000000 +0:20 Sequence +0:20 move second child to first child ( temp 2-component vector of float) +0:20 'var13' ( temp 2-component vector of float) +0:20 Constant: +0:20 0.000000 +0:20 0.000000 +0:21 Sequence +0:21 move second child to first child ( temp 2-component vector of float) +0:21 'var14' ( temp 2-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:22 Sequence +0:22 move second child to first child ( temp 3-component vector of float) +0:22 'var26' ( temp 3-component vector of float) +0:22 Constant: +0:22 0.000000 +0:22 0.000000 +0:22 0.000000 +0:23 Sequence +0:23 move second child to first child ( temp 3-component vector of float) +0:23 'var28' ( temp 3-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:24 Sequence +0:24 move second child to first child ( temp 4-component vector of float) +0:24 'var39' ( temp 4-component vector of float) +0:24 Constant: +0:24 0.000000 +0:24 0.000000 +0:24 0.000000 +0:24 0.000000 +0:25 Sequence +0:25 move second child to first child ( temp 4-component vector of float) +0:25 'var42' ( temp 4-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:26 Sequence +0:26 move second child to first child ( temp 4-component vector of float) +0:26 'var43' ( temp 4-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:27 Sequence +0:27 move second child to first child ( temp 2X2 matrix of float) +0:27 'var52' ( temp 2X2 matrix of float) +0:27 Constant: +0:27 0.000000 +0:27 0.000000 +0:27 0.000000 +0:27 0.000000 +0:28 Sequence +0:28 move second child to first child ( temp 2X2 matrix of float) +0:28 'var55' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:29 Sequence +0:29 move second child to first child ( temp 2X2 matrix of float) +0:29 'var56' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:30 Sequence +0:30 move second child to first child ( temp 2X3 matrix of float) +0:30 'var65' ( temp 2X3 matrix of float) +0:30 Constant: +0:30 0.000000 +0:30 0.000000 +0:30 0.000000 +0:30 0.000000 +0:30 0.000000 +0:30 0.000000 +0:31 Sequence +0:31 move second child to first child ( temp 2X3 matrix of float) +0:31 'var70' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:32 Sequence +0:32 move second child to first child ( temp 2X4 matrix of float) +0:32 'var78' ( temp 2X4 matrix of float) +0:32 Constant: +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:32 0.000000 +0:33 Sequence +0:33 move second child to first child ( temp 2X4 matrix of float) +0:33 'var84' ( temp 2X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:34 Sequence +0:34 move second child to first child ( temp 3X2 matrix of float) +0:34 'var91' ( temp 3X2 matrix of float) +0:34 Constant: +0:34 0.000000 +0:34 0.000000 +0:34 0.000000 +0:34 0.000000 +0:34 0.000000 +0:34 0.000000 +0:35 Sequence +0:35 move second child to first child ( temp 3X2 matrix of float) +0:35 'var98' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:36 Sequence +0:36 move second child to first child ( temp 3X3 matrix of float) +0:36 'var104' ( temp 3X3 matrix of float) +0:36 Constant: +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:36 0.000000 +0:37 Sequence +0:37 move second child to first child ( temp 3X3 matrix of float) +0:37 'var112' ( temp 3X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:38 Sequence +0:38 move second child to first child ( temp 3X4 matrix of float) +0:38 'var117' ( temp 3X4 matrix of float) +0:38 Constant: +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:38 0.000000 +0:39 Sequence +0:39 move second child to first child ( temp 3X4 matrix of float) +0:39 'var126' ( temp 3X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:40 Sequence +0:40 move second child to first child ( temp 4X2 matrix of float) +0:40 'var130' ( temp 4X2 matrix of float) +0:40 Constant: +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:40 0.000000 +0:41 Sequence +0:41 move second child to first child ( temp 4X2 matrix of float) +0:41 'var140' ( temp 4X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:42 Sequence +0:42 move second child to first child ( temp 4X3 matrix of float) +0:42 'var143' ( temp 4X3 matrix of float) +0:42 Constant: +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:42 0.000000 +0:43 Sequence +0:43 move second child to first child ( temp 4X3 matrix of float) +0:43 'var154' ( temp 4X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:44 Sequence +0:44 move second child to first child ( temp 4X4 matrix of float) +0:44 'var156' ( temp 4X4 matrix of float) +0:44 Constant: +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:44 0.000000 +0:45 Sequence +0:45 move second child to first child ( temp 4X4 matrix of float) +0:45 'var168' ( temp 4X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:46 Sequence +0:46 move second child to first child ( temp float) +0:46 'var1' ( temp float) +0:? Constant: +0:? 0.000000 +0:47 Sequence +0:47 move second child to first child ( temp float) +0:47 'var2' ( temp float) +0:? Constant: +0:? 0.000000 +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 'var3' ( temp float) +0:? Constant: +0:? 0.000000 +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 'var4' ( temp float) +0:? Constant: +0:? 0.000000 +0:50 Sequence +0:50 move second child to first child ( temp float) +0:50 'var5' ( temp float) +0:? Constant: +0:? 0.000000 +0:51 Sequence +0:51 move second child to first child ( temp float) +0:51 'var6' ( temp float) +0:? Constant: +0:? 0.000000 +0:52 Sequence +0:52 move second child to first child ( temp float) +0:52 'var7' ( temp float) +0:? Constant: +0:? 0.000000 +0:53 Sequence +0:53 move second child to first child ( temp float) +0:53 'var8' ( temp float) +0:? Constant: +0:? 0.000000 +0:54 Sequence +0:54 move second child to first child ( temp float) +0:54 'var9' ( temp float) +0:? Constant: +0:? 0.000000 +0:55 Sequence +0:55 move second child to first child ( temp float) +0:55 'var10' ( temp float) +0:? Constant: +0:? 0.000000 +0:56 Sequence +0:56 move second child to first child ( temp float) +0:56 'var11' ( temp float) +0:? Constant: +0:? 0.000000 +0:57 Sequence +0:57 move second child to first child ( temp float) +0:57 'var12' ( temp float) +0:? Constant: +0:? 0.000000 +0:58 Sequence +0:58 move second child to first child ( temp 2-component vector of float) +0:58 'var15' ( temp 2-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:59 Sequence +0:59 move second child to first child ( temp 2-component vector of float) +0:59 'var16' ( temp 2-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:60 Sequence +0:60 move second child to first child ( temp 3-component vector of float) +0:60 'var29' ( temp 3-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:61 Sequence +0:61 move second child to first child ( temp 2X2 matrix of float) +0:61 'var57' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:62 Sequence +0:62 move second child to first child ( temp 2X2 matrix of float) +0:62 'var58' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:63 Sequence +0:63 move second child to first child ( temp 2X2 matrix of float) +0:63 'var59' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:64 Sequence +0:64 move second child to first child ( temp 2X2 matrix of float) +0:64 'var60' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:65 Sequence +0:65 move second child to first child ( temp 2X2 matrix of float) +0:65 'var61' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:66 Sequence +0:66 move second child to first child ( temp 2X2 matrix of float) +0:66 'var62' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:67 Sequence +0:67 move second child to first child ( temp 2X2 matrix of float) +0:67 'var63' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:68 Sequence +0:68 move second child to first child ( temp 2X2 matrix of float) +0:68 'var64' ( temp 2X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:69 Sequence +0:69 move second child to first child ( temp 2X3 matrix of float) +0:69 'var71' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:70 Sequence +0:70 move second child to first child ( temp 2X3 matrix of float) +0:70 'var73' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:71 Sequence +0:71 move second child to first child ( temp 2X3 matrix of float) +0:71 'var74' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:72 Sequence +0:72 move second child to first child ( temp 2X3 matrix of float) +0:72 'var76' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:73 Sequence +0:73 move second child to first child ( temp 2X3 matrix of float) +0:73 'var77' ( temp 2X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:74 Sequence +0:74 move second child to first child ( temp 2X4 matrix of float) +0:74 'var87' ( temp 2X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:75 Sequence +0:75 move second child to first child ( temp 2X4 matrix of float) +0:75 'var90' ( temp 2X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:76 Sequence +0:76 move second child to first child ( temp 3X2 matrix of float) +0:76 'var99' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:77 Sequence +0:77 move second child to first child ( temp 3X2 matrix of float) +0:77 'var100' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:78 Sequence +0:78 move second child to first child ( temp 3X2 matrix of float) +0:78 'var101' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:79 Sequence +0:79 move second child to first child ( temp 3X2 matrix of float) +0:79 'var102' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:80 Sequence +0:80 move second child to first child ( temp 3X2 matrix of float) +0:80 'var103' ( temp 3X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:81 Sequence +0:81 move second child to first child ( temp 3X3 matrix of float) +0:81 'var113' ( temp 3X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:82 Sequence +0:82 move second child to first child ( temp 3X3 matrix of float) +0:82 'var115' ( temp 3X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:83 Sequence +0:83 move second child to first child ( temp 3X3 matrix of float) +0:83 'var116' ( temp 3X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:84 Sequence +0:84 move second child to first child ( temp 3X4 matrix of float) +0:84 'var129' ( temp 3X4 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:85 Sequence +0:85 move second child to first child ( temp 4X2 matrix of float) +0:85 'var141' ( temp 4X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:86 Sequence +0:86 move second child to first child ( temp 4X2 matrix of float) +0:86 'var142' ( temp 4X2 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:87 Sequence +0:87 move second child to first child ( temp 4X3 matrix of float) +0:87 'var155' ( temp 4X3 matrix of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:88 Branch: Return with expression +0:88 Constant: +0:88 0.000000 +0:88 0.000000 +0:88 0.000000 +0:88 0.000000 +0:18 Function Definition: main( ( temp void) +0:18 Function Parameters: +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:18 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 122 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 120 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 12 "var0" + Name 16 "var13" + Name 18 "var14" + Name 21 "var26" + Name 23 "var28" + Name 25 "var39" + Name 27 "var42" + Name 28 "var43" + Name 31 "var52" + Name 33 "var55" + Name 34 "var56" + Name 37 "var65" + Name 39 "var70" + Name 42 "var78" + Name 44 "var84" + Name 47 "var91" + Name 49 "var98" + Name 52 "var104" + Name 54 "var112" + Name 57 "var117" + Name 59 "var126" + Name 62 "var130" + Name 64 "var140" + Name 67 "var143" + Name 69 "var154" + Name 72 "var156" + Name 74 "var168" + Name 75 "var1" + Name 76 "var2" + Name 77 "var3" + Name 78 "var4" + Name 79 "var5" + Name 80 "var6" + Name 81 "var7" + Name 82 "var8" + Name 83 "var9" + Name 84 "var10" + Name 85 "var11" + Name 86 "var12" + Name 87 "var15" + Name 88 "var16" + Name 89 "var29" + Name 90 "var57" + Name 91 "var58" + Name 92 "var59" + Name 93 "var60" + Name 94 "var61" + Name 95 "var62" + Name 96 "var63" + Name 97 "var64" + Name 98 "var71" + Name 99 "var73" + Name 100 "var74" + Name 101 "var76" + Name 102 "var77" + Name 103 "var87" + Name 104 "var90" + Name 105 "var99" + Name 106 "var100" + Name 107 "var101" + Name 108 "var102" + Name 109 "var103" + Name 110 "var113" + Name 111 "var115" + Name 112 "var116" + Name 113 "var129" + Name 114 "var141" + Name 115 "var142" + Name 116 "var155" + Name 120 "@entryPointOutput" + Decorate 120(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypePointer Function 6(float) + 13: 6(float) Constant 0 + 14: TypeVector 6(float) 2 + 15: TypePointer Function 14(fvec2) + 17: 14(fvec2) ConstantComposite 13 13 + 19: TypeVector 6(float) 3 + 20: TypePointer Function 19(fvec3) + 22: 19(fvec3) ConstantComposite 13 13 13 + 24: TypePointer Function 7(fvec4) + 26: 7(fvec4) ConstantComposite 13 13 13 13 + 29: TypeMatrix 14(fvec2) 2 + 30: TypePointer Function 29 + 32: 29 ConstantComposite 17 17 + 35: TypeMatrix 19(fvec3) 2 + 36: TypePointer Function 35 + 38: 35 ConstantComposite 22 22 + 40: TypeMatrix 7(fvec4) 2 + 41: TypePointer Function 40 + 43: 40 ConstantComposite 26 26 + 45: TypeMatrix 14(fvec2) 3 + 46: TypePointer Function 45 + 48: 45 ConstantComposite 17 17 17 + 50: TypeMatrix 19(fvec3) 3 + 51: TypePointer Function 50 + 53: 50 ConstantComposite 22 22 22 + 55: TypeMatrix 7(fvec4) 3 + 56: TypePointer Function 55 + 58: 55 ConstantComposite 26 26 26 + 60: TypeMatrix 14(fvec2) 4 + 61: TypePointer Function 60 + 63: 60 ConstantComposite 17 17 17 17 + 65: TypeMatrix 19(fvec3) 4 + 66: TypePointer Function 65 + 68: 65 ConstantComposite 22 22 22 22 + 70: TypeMatrix 7(fvec4) 4 + 71: TypePointer Function 70 + 73: 70 ConstantComposite 26 26 26 26 + 119: TypePointer Output 7(fvec4) +120(@entryPointOutput): 119(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 121: 7(fvec4) FunctionCall 9(@main() + Store 120(@entryPointOutput) 121 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 12(var0): 11(ptr) Variable Function + 16(var13): 15(ptr) Variable Function + 18(var14): 15(ptr) Variable Function + 21(var26): 20(ptr) Variable Function + 23(var28): 20(ptr) Variable Function + 25(var39): 24(ptr) Variable Function + 27(var42): 24(ptr) Variable Function + 28(var43): 24(ptr) Variable Function + 31(var52): 30(ptr) Variable Function + 33(var55): 30(ptr) Variable Function + 34(var56): 30(ptr) Variable Function + 37(var65): 36(ptr) Variable Function + 39(var70): 36(ptr) Variable Function + 42(var78): 41(ptr) Variable Function + 44(var84): 41(ptr) Variable Function + 47(var91): 46(ptr) Variable Function + 49(var98): 46(ptr) Variable Function + 52(var104): 51(ptr) Variable Function + 54(var112): 51(ptr) Variable Function + 57(var117): 56(ptr) Variable Function + 59(var126): 56(ptr) Variable Function + 62(var130): 61(ptr) Variable Function + 64(var140): 61(ptr) Variable Function + 67(var143): 66(ptr) Variable Function + 69(var154): 66(ptr) Variable Function + 72(var156): 71(ptr) Variable Function + 74(var168): 71(ptr) Variable Function + 75(var1): 11(ptr) Variable Function + 76(var2): 11(ptr) Variable Function + 77(var3): 11(ptr) Variable Function + 78(var4): 11(ptr) Variable Function + 79(var5): 11(ptr) Variable Function + 80(var6): 11(ptr) Variable Function + 81(var7): 11(ptr) Variable Function + 82(var8): 11(ptr) Variable Function + 83(var9): 11(ptr) Variable Function + 84(var10): 11(ptr) Variable Function + 85(var11): 11(ptr) Variable Function + 86(var12): 11(ptr) Variable Function + 87(var15): 15(ptr) Variable Function + 88(var16): 15(ptr) Variable Function + 89(var29): 20(ptr) Variable Function + 90(var57): 30(ptr) Variable Function + 91(var58): 30(ptr) Variable Function + 92(var59): 30(ptr) Variable Function + 93(var60): 30(ptr) Variable Function + 94(var61): 30(ptr) Variable Function + 95(var62): 30(ptr) Variable Function + 96(var63): 30(ptr) Variable Function + 97(var64): 30(ptr) Variable Function + 98(var71): 36(ptr) Variable Function + 99(var73): 36(ptr) Variable Function + 100(var74): 36(ptr) Variable Function + 101(var76): 36(ptr) Variable Function + 102(var77): 36(ptr) Variable Function + 103(var87): 41(ptr) Variable Function + 104(var90): 41(ptr) Variable Function + 105(var99): 46(ptr) Variable Function + 106(var100): 46(ptr) Variable Function + 107(var101): 46(ptr) Variable Function + 108(var102): 46(ptr) Variable Function + 109(var103): 46(ptr) Variable Function + 110(var113): 51(ptr) Variable Function + 111(var115): 51(ptr) Variable Function + 112(var116): 51(ptr) Variable Function + 113(var129): 56(ptr) Variable Function + 114(var141): 61(ptr) Variable Function + 115(var142): 61(ptr) Variable Function + 116(var155): 66(ptr) Variable Function + Store 12(var0) 13 + Store 16(var13) 17 + Store 18(var14) 17 + Store 21(var26) 22 + Store 23(var28) 22 + Store 25(var39) 26 + Store 27(var42) 26 + Store 28(var43) 26 + Store 31(var52) 32 + Store 33(var55) 32 + Store 34(var56) 32 + Store 37(var65) 38 + Store 39(var70) 38 + Store 42(var78) 43 + Store 44(var84) 43 + Store 47(var91) 48 + Store 49(var98) 48 + Store 52(var104) 53 + Store 54(var112) 53 + Store 57(var117) 58 + Store 59(var126) 58 + Store 62(var130) 63 + Store 64(var140) 63 + Store 67(var143) 68 + Store 69(var154) 68 + Store 72(var156) 73 + Store 74(var168) 73 + Store 75(var1) 13 + Store 76(var2) 13 + Store 77(var3) 13 + Store 78(var4) 13 + Store 79(var5) 13 + Store 80(var6) 13 + Store 81(var7) 13 + Store 82(var8) 13 + Store 83(var9) 13 + Store 84(var10) 13 + Store 85(var11) 13 + Store 86(var12) 13 + Store 87(var15) 17 + Store 88(var16) 17 + Store 89(var29) 22 + Store 90(var57) 32 + Store 91(var58) 32 + Store 92(var59) 32 + Store 93(var60) 32 + Store 94(var61) 32 + Store 95(var62) 32 + Store 96(var63) 32 + Store 97(var64) 32 + Store 98(var71) 38 + Store 99(var73) 38 + Store 100(var74) 38 + Store 101(var76) 38 + Store 102(var77) 38 + Store 103(var87) 43 + Store 104(var90) 43 + Store 105(var99) 48 + Store 106(var100) 48 + Store 107(var101) 48 + Store 108(var102) 48 + Store 109(var103) 48 + Store 110(var113) 53 + Store 111(var115) 53 + Store 112(var116) 53 + Store 113(var129) 58 + Store 114(var141) 63 + Store 115(var142) 63 + Store 116(var155) 68 + ReturnValue 26 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.typeGraphCopy.vert.out b/deps/glslang/Test/baseResults/hlsl.typeGraphCopy.vert.out new file mode 100644 index 00000000..c0c7227b --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.typeGraphCopy.vert.out @@ -0,0 +1,128 @@ +hlsl.typeGraphCopy.vert +Shader version: 500 +0:? Sequence +0:22 Function Definition: @main( ( temp float) +0:22 Function Parameters: +0:? Sequence +0:23 Branch: Return with expression +0:23 b: direct index for structure ( temp float) +0:23 s2: direct index for structure ( temp structure{ temp int a, temp float b}) +0:23 t3: direct index for structure ( temp structure{ temp structure{ temp int a, temp float b} s1, temp structure{ temp int a, temp float b} s2}) +0:23 foo: direct index for structure ( uniform structure{ temp structure{ temp structure{ temp int a, temp float b} s1, temp structure{ temp int a, temp float b} s2} t1, temp structure{ temp int a, temp float b} t2, temp structure{ temp structure{ temp int a, temp float b} s1, temp structure{ temp int a, temp float b} s2} t3}) +0:23 'anon@0' (layout( row_major std140) uniform block{ uniform structure{ temp structure{ temp structure{ temp int a, temp float b} s1, temp structure{ temp int a, temp float b} s2} t1, temp structure{ temp int a, temp float b} t2, temp structure{ temp structure{ temp int a, temp float b} s1, temp structure{ temp int a, temp float b} s2} t3} foo}) +0:23 Constant: +0:23 0 (const uint) +0:23 Constant: +0:23 2 (const int) +0:23 Constant: +0:23 1 (const int) +0:23 Constant: +0:23 1 (const int) +0:22 Function Definition: main( ( temp void) +0:22 Function Parameters: +0:? Sequence +0:22 move second child to first child ( temp float) +0:? '@entryPointOutput' (layout( location=0) out float) +0:22 Function Call: @main( ( temp float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform structure{ temp structure{ temp structure{ temp int a, temp float b} s1, temp structure{ temp int a, temp float b} s2} t1, temp structure{ temp int a, temp float b} t2, temp structure{ temp structure{ temp int a, temp float b} s1, temp structure{ temp int a, temp float b} s2} t3} foo}) +0:? '@entryPointOutput' (layout( location=0) out float) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:22 Function Definition: @main( ( temp float) +0:22 Function Parameters: +0:? Sequence +0:23 Branch: Return with expression +0:23 b: direct index for structure ( temp float) +0:23 s2: direct index for structure ( temp structure{ temp int a, temp float b}) +0:23 t3: direct index for structure ( temp structure{ temp structure{ temp int a, temp float b} s1, temp structure{ temp int a, temp float b} s2}) +0:23 foo: direct index for structure ( uniform structure{ temp structure{ temp structure{ temp int a, temp float b} s1, temp structure{ temp int a, temp float b} s2} t1, temp structure{ temp int a, temp float b} t2, temp structure{ temp structure{ temp int a, temp float b} s1, temp structure{ temp int a, temp float b} s2} t3}) +0:23 'anon@0' (layout( row_major std140) uniform block{ uniform structure{ temp structure{ temp structure{ temp int a, temp float b} s1, temp structure{ temp int a, temp float b} s2} t1, temp structure{ temp int a, temp float b} t2, temp structure{ temp structure{ temp int a, temp float b} s1, temp structure{ temp int a, temp float b} s2} t3} foo}) +0:23 Constant: +0:23 0 (const uint) +0:23 Constant: +0:23 2 (const int) +0:23 Constant: +0:23 1 (const int) +0:23 Constant: +0:23 1 (const int) +0:22 Function Definition: main( ( temp void) +0:22 Function Parameters: +0:? Sequence +0:22 move second child to first child ( temp float) +0:? '@entryPointOutput' (layout( location=0) out float) +0:22 Function Call: @main( ( temp float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform structure{ temp structure{ temp structure{ temp int a, temp float b} s1, temp structure{ temp int a, temp float b} s2} t1, temp structure{ temp int a, temp float b} t2, temp structure{ temp structure{ temp int a, temp float b} s1, temp structure{ temp int a, temp float b} s2} t3} foo}) +0:? '@entryPointOutput' (layout( location=0) out float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 28 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 26 + Source HLSL 500 + Name 4 "main" + Name 8 "@main(" + Name 11 "N1" + MemberName 11(N1) 0 "a" + MemberName 11(N1) 1 "b" + Name 12 "N2" + MemberName 12(N2) 0 "s1" + MemberName 12(N2) 1 "s2" + Name 13 "N3" + MemberName 13(N3) 0 "t1" + MemberName 13(N3) 1 "t2" + MemberName 13(N3) 2 "t3" + Name 14 "$Global" + MemberName 14($Global) 0 "foo" + Name 16 "" + Name 26 "@entryPointOutput" + MemberDecorate 11(N1) 0 Offset 0 + MemberDecorate 11(N1) 1 Offset 4 + MemberDecorate 12(N2) 0 Offset 0 + MemberDecorate 12(N2) 1 Offset 16 + MemberDecorate 13(N3) 0 Offset 0 + MemberDecorate 13(N3) 1 Offset 32 + MemberDecorate 13(N3) 2 Offset 48 + MemberDecorate 14($Global) 0 Offset 0 + Decorate 14($Global) Block + Decorate 16 DescriptorSet 0 + Decorate 26(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeFunction 6(float) + 10: TypeInt 32 1 + 11(N1): TypeStruct 10(int) 6(float) + 12(N2): TypeStruct 11(N1) 11(N1) + 13(N3): TypeStruct 12(N2) 11(N1) 12(N2) + 14($Global): TypeStruct 13(N3) + 15: TypePointer Uniform 14($Global) + 16: 15(ptr) Variable Uniform + 17: 10(int) Constant 0 + 18: 10(int) Constant 2 + 19: 10(int) Constant 1 + 20: TypePointer Uniform 6(float) + 25: TypePointer Output 6(float) +26(@entryPointOutput): 25(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 27: 6(float) FunctionCall 8(@main() + Store 26(@entryPointOutput) 27 + Return + FunctionEnd + 8(@main(): 6(float) Function None 7 + 9: Label + 21: 20(ptr) AccessChain 16 17 18 19 19 + 22: 6(float) Load 21 + ReturnValue 22 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.typedef.frag.out b/deps/glslang/Test/baseResults/hlsl.typedef.frag.out new file mode 100644 index 00000000..11fd1074 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.typedef.frag.out @@ -0,0 +1,134 @@ +hlsl.typedef.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: ShaderFunction(vf4;i1; ( temp 4-component vector of float) +0:4 Function Parameters: +0:4 'input' ( in 4-component vector of float) +0:4 'ii' ( in int) +0:? Sequence +0:6 Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:6 'a1' ( temp 4-component vector of float) +0:6 Constant: +0:6 1.000000 +0:6 1.000000 +0:6 1.000000 +0:6 1.000000 +0:7 Sequence +0:7 move second child to first child ( temp int) +0:7 'i' ( temp int) +0:7 Constant: +0:7 2 (const int) +0:9 Sequence +0:9 move second child to first child ( temp int) +0:9 'j' ( temp int) +0:9 'ii' ( in int) +0:10 Branch: Return with expression +0:10 add ( temp 4-component vector of float) +0:10 component-wise multiply ( temp 4-component vector of float) +0:10 'input' ( in 4-component vector of float) +0:10 'a1' ( temp 4-component vector of float) +0:10 Construct vec4 ( uniform 4-component vector of float) +0:10 Convert int to float ( temp float) +0:10 add ( temp int) +0:10 'i' ( temp int) +0:10 'j' ( temp int) +0:? Linker Objects + + +Linked fragment stage: + +WARNING: Linking fragment stage: Entry point not found + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: ShaderFunction(vf4;i1; ( temp 4-component vector of float) +0:4 Function Parameters: +0:4 'input' ( in 4-component vector of float) +0:4 'ii' ( in int) +0:? Sequence +0:6 Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:6 'a1' ( temp 4-component vector of float) +0:6 Constant: +0:6 1.000000 +0:6 1.000000 +0:6 1.000000 +0:6 1.000000 +0:7 Sequence +0:7 move second child to first child ( temp int) +0:7 'i' ( temp int) +0:7 Constant: +0:7 2 (const int) +0:9 Sequence +0:9 move second child to first child ( temp int) +0:9 'j' ( temp int) +0:9 'ii' ( in int) +0:10 Branch: Return with expression +0:10 add ( temp 4-component vector of float) +0:10 component-wise multiply ( temp 4-component vector of float) +0:10 'input' ( in 4-component vector of float) +0:10 'a1' ( temp 4-component vector of float) +0:10 Construct vec4 ( uniform 4-component vector of float) +0:10 Convert int to float ( temp float) +0:10 add ( temp int) +0:10 'i' ( temp int) +0:10 'j' ( temp int) +0:? Linker Objects + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 34 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 14 "ShaderFunction(vf4;i1;" + Name 12 "input" + Name 13 "ii" + Name 16 "a1" + Name 19 "i" + Name 21 "j" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeInt 32 1 + 10: TypePointer Function 9(int) + 11: TypeFunction 7(fvec4) 8(ptr) 10(ptr) + 17: 6(float) Constant 1065353216 + 18: 7(fvec4) ConstantComposite 17 17 17 17 + 20: 9(int) Constant 2 +4(PixelShaderFunction): 2 Function None 3 + 5: Label + Return + FunctionEnd +14(ShaderFunction(vf4;i1;): 7(fvec4) Function None 11 + 12(input): 8(ptr) FunctionParameter + 13(ii): 10(ptr) FunctionParameter + 15: Label + 16(a1): 8(ptr) Variable Function + 19(i): 10(ptr) Variable Function + 21(j): 10(ptr) Variable Function + Store 16(a1) 18 + Store 19(i) 20 + 22: 9(int) Load 13(ii) + Store 21(j) 22 + 23: 7(fvec4) Load 12(input) + 24: 7(fvec4) Load 16(a1) + 25: 7(fvec4) FMul 23 24 + 26: 9(int) Load 19(i) + 27: 9(int) Load 21(j) + 28: 9(int) IAdd 26 27 + 29: 6(float) ConvertSToF 28 + 30: 7(fvec4) CompositeConstruct 29 29 29 29 + 31: 7(fvec4) FAdd 25 30 + ReturnValue 31 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.void.frag.out b/deps/glslang/Test/baseResults/hlsl.void.frag.out new file mode 100644 index 00000000..30edd633 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.void.frag.out @@ -0,0 +1,108 @@ +hlsl.void.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:1 Function Definition: foo1( ( temp void) +0:1 Function Parameters: +0:2 Function Definition: foo2( ( temp void) +0:2 Function Parameters: +0:5 Function Definition: @PixelShaderFunction(vf4; ( temp void) +0:5 Function Parameters: +0:5 'input' ( in 4-component vector of float) +0:? Sequence +0:6 Function Call: foo1( ( temp void) +0:7 Function Call: foo2( ( temp void) +0:8 Branch: Return +0:5 Function Definition: PixelShaderFunction( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:5 Function Call: @PixelShaderFunction(vf4; ( temp void) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'input' (layout( location=0) in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:1 Function Definition: foo1( ( temp void) +0:1 Function Parameters: +0:2 Function Definition: foo2( ( temp void) +0:2 Function Parameters: +0:5 Function Definition: @PixelShaderFunction(vf4; ( temp void) +0:5 Function Parameters: +0:5 'input' ( in 4-component vector of float) +0:? Sequence +0:6 Function Call: foo1( ( temp void) +0:7 Function Call: foo2( ( temp void) +0:8 Branch: Return +0:5 Function Definition: PixelShaderFunction( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:5 Function Call: @PixelShaderFunction(vf4; ( temp void) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'input' (layout( location=0) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 27 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 22 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 6 "foo1(" + Name 8 "foo2(" + Name 15 "@PixelShaderFunction(vf4;" + Name 14 "input" + Name 20 "input" + Name 22 "input" + Name 24 "param" + Decorate 22(input) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 10: TypeFloat 32 + 11: TypeVector 10(float) 4 + 12: TypePointer Function 11(fvec4) + 13: TypeFunction 2 12(ptr) + 21: TypePointer Input 11(fvec4) + 22(input): 21(ptr) Variable Input +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 20(input): 12(ptr) Variable Function + 24(param): 12(ptr) Variable Function + 23: 11(fvec4) Load 22(input) + Store 20(input) 23 + 25: 11(fvec4) Load 20(input) + Store 24(param) 25 + 26: 2 FunctionCall 15(@PixelShaderFunction(vf4;) 24(param) + Return + FunctionEnd + 6(foo1(): 2 Function None 3 + 7: Label + Return + FunctionEnd + 8(foo2(): 2 Function None 3 + 9: Label + Return + FunctionEnd +15(@PixelShaderFunction(vf4;): 2 Function None 13 + 14(input): 12(ptr) FunctionParameter + 16: Label + 17: 2 FunctionCall 6(foo1() + 18: 2 FunctionCall 8(foo2() + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.wavebroadcast.comp.out b/deps/glslang/Test/baseResults/hlsl.wavebroadcast.comp.out new file mode 100644 index 00000000..0dfd9ef6 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.wavebroadcast.comp.out @@ -0,0 +1,2731 @@ +hlsl.wavebroadcast.comp +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:13 Function Definition: @CSMain(vu3; ( temp void) +0:13 Function Parameters: +0:13 'dti' ( in 3-component vector of uint) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 subgroupShuffle ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 13 (const uint) +0:15 move second child to first child ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 subgroupShuffle ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 13 (const uint) +0:16 move second child to first child ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 subgroupShuffle ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 13 (const uint) +0:17 move second child to first child ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 subgroupShuffle ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 13 (const uint) +0:19 move second child to first child ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 subgroupShuffle ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 13 (const uint) +0:20 move second child to first child ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 subgroupShuffle ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 13 (const uint) +0:21 move second child to first child ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 subgroupShuffle ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 13 (const uint) +0:22 move second child to first child ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 subgroupShuffle ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 Constant: +0:22 13 (const uint) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 subgroupShuffle ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 13 (const uint) +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 subgroupShuffle ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 13 (const uint) +0:26 move second child to first child ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 subgroupShuffle ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 Constant: +0:26 13 (const uint) +0:27 move second child to first child ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 subgroupShuffle ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Constant: +0:27 13 (const uint) +0:29 move second child to first child ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:29 subgroupBroadcastFirst ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:30 move second child to first child ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 subgroupBroadcastFirst ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:31 move second child to first child ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 subgroupBroadcastFirst ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:32 move second child to first child ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 subgroupBroadcastFirst ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:34 move second child to first child ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 subgroupBroadcastFirst ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:35 move second child to first child ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 subgroupBroadcastFirst ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:36 move second child to first child ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:36 subgroupBroadcastFirst ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:37 move second child to first child ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 subgroupBroadcastFirst ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:39 move second child to first child ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 subgroupBroadcastFirst ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:40 move second child to first child ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:40 subgroupBroadcastFirst ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:41 move second child to first child ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 subgroupBroadcastFirst ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:42 move second child to first child ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:42 subgroupBroadcastFirst ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:44 move second child to first child ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 subgroupBroadcastFirst ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 subgroupBroadcastFirst ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:46 move second child to first child ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 subgroupBroadcastFirst ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 subgroupBroadcastFirst ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:49 move second child to first child ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:49 subgroupBroadcastFirst ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:50 move second child to first child ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:50 subgroupBroadcastFirst ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:51 move second child to first child ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:51 subgroupBroadcastFirst ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:52 move second child to first child ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:52 subgroupBroadcastFirst ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:13 Function Definition: CSMain( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-component vector of uint) +0:? 'dti' ( temp 3-component vector of uint) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) +0:13 Function Call: @CSMain(vu3; ( temp void) +0:? 'dti' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:13 Function Definition: @CSMain(vu3; ( temp void) +0:13 Function Parameters: +0:13 'dti' ( in 3-component vector of uint) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 subgroupShuffle ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 13 (const uint) +0:15 move second child to first child ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 subgroupShuffle ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 13 (const uint) +0:16 move second child to first child ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 subgroupShuffle ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 13 (const uint) +0:17 move second child to first child ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 subgroupShuffle ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 13 (const uint) +0:19 move second child to first child ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 subgroupShuffle ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 13 (const uint) +0:20 move second child to first child ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 subgroupShuffle ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 13 (const uint) +0:21 move second child to first child ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 subgroupShuffle ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 13 (const uint) +0:22 move second child to first child ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 subgroupShuffle ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 Constant: +0:22 13 (const uint) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 subgroupShuffle ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 13 (const uint) +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 subgroupShuffle ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 13 (const uint) +0:26 move second child to first child ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 subgroupShuffle ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 Constant: +0:26 13 (const uint) +0:27 move second child to first child ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 subgroupShuffle ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Constant: +0:27 13 (const uint) +0:29 move second child to first child ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:29 subgroupBroadcastFirst ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:30 move second child to first child ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 subgroupBroadcastFirst ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:31 move second child to first child ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 subgroupBroadcastFirst ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:32 move second child to first child ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 subgroupBroadcastFirst ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:34 move second child to first child ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 subgroupBroadcastFirst ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:35 move second child to first child ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 subgroupBroadcastFirst ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:36 move second child to first child ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:36 subgroupBroadcastFirst ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:37 move second child to first child ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 subgroupBroadcastFirst ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:39 move second child to first child ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 subgroupBroadcastFirst ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:40 move second child to first child ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:40 subgroupBroadcastFirst ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:41 move second child to first child ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 subgroupBroadcastFirst ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:42 move second child to first child ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:42 subgroupBroadcastFirst ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:44 move second child to first child ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 subgroupBroadcastFirst ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 subgroupBroadcastFirst ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:46 move second child to first child ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 subgroupBroadcastFirst ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 subgroupBroadcastFirst ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:49 move second child to first child ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:49 subgroupBroadcastFirst ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:50 move second child to first child ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:50 subgroupBroadcastFirst ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:51 move second child to first child ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:51 subgroupBroadcastFirst ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:52 move second child to first child ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:52 subgroupBroadcastFirst ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:13 Function Definition: CSMain( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-component vector of uint) +0:? 'dti' ( temp 3-component vector of uint) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) +0:13 Function Call: @CSMain(vu3; ( temp void) +0:? 'dti' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) + +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 359 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformBallot + Capability GroupNonUniformShuffle + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "CSMain" 354 + ExecutionMode 4 LocalSize 32 16 1 + Source HLSL 500 + Name 4 "CSMain" + Name 11 "@CSMain(vu3;" + Name 10 "dti" + Name 20 "Types" + MemberName 20(Types) 0 "u" + MemberName 20(Types) 1 "i" + MemberName 20(Types) 2 "f" + MemberName 20(Types) 3 "d" + Name 22 "data" + MemberName 22(data) 0 "@data" + Name 24 "data" + Name 352 "dti" + Name 354 "dti" + Name 356 "param" + MemberDecorate 20(Types) 0 Offset 0 + MemberDecorate 20(Types) 1 Offset 16 + MemberDecorate 20(Types) 2 Offset 32 + MemberDecorate 20(Types) 3 Offset 64 + Decorate 21 ArrayStride 96 + MemberDecorate 22(data) 0 Offset 0 + Decorate 22(data) BufferBlock + Decorate 24(data) DescriptorSet 0 + Decorate 354(dti) BuiltIn GlobalInvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 9: TypeFunction 2 8(ptr) + 13: TypeVector 6(int) 4 + 14: TypeInt 32 1 + 15: TypeVector 14(int) 4 + 16: TypeFloat 32 + 17: TypeVector 16(float) 4 + 18: TypeFloat 64 + 19: TypeVector 18(float64_t) 4 + 20(Types): TypeStruct 13(ivec4) 15(ivec4) 17(fvec4) 19(f64vec4) + 21: TypeRuntimeArray 20(Types) + 22(data): TypeStruct 21 + 23: TypePointer Uniform 22(data) + 24(data): 23(ptr) Variable Uniform + 25: 14(int) Constant 0 + 26: 6(int) Constant 0 + 27: TypePointer Function 6(int) + 32: TypePointer Uniform 13(ivec4) + 35: 6(int) Constant 13 + 36: 6(int) Constant 3 + 43: TypePointer Uniform 6(int) + 52: TypeVector 6(int) 2 + 73: 14(int) Constant 1 + 76: TypePointer Uniform 15(ivec4) + 85: TypePointer Uniform 14(int) + 94: TypeVector 14(int) 2 + 106: TypeVector 14(int) 3 + 116: 14(int) Constant 2 + 119: TypePointer Uniform 17(fvec4) + 128: TypePointer Uniform 16(float) + 137: TypeVector 16(float) 2 + 149: TypeVector 16(float) 3 + 159: 14(int) Constant 3 + 162: TypePointer Uniform 19(f64vec4) + 171: TypePointer Uniform 18(float64_t) + 180: TypeVector 18(float64_t) 2 + 192: TypeVector 18(float64_t) 3 + 353: TypePointer Input 7(ivec3) + 354(dti): 353(ptr) Variable Input + 4(CSMain): 2 Function None 3 + 5: Label + 352(dti): 8(ptr) Variable Function + 356(param): 8(ptr) Variable Function + 355: 7(ivec3) Load 354(dti) + Store 352(dti) 355 + 357: 7(ivec3) Load 352(dti) + Store 356(param) 357 + 358: 2 FunctionCall 11(@CSMain(vu3;) 356(param) + Return + FunctionEnd +11(@CSMain(vu3;): 2 Function None 9 + 10(dti): 8(ptr) FunctionParameter + 12: Label + 28: 27(ptr) AccessChain 10(dti) 26 + 29: 6(int) Load 28 + 30: 27(ptr) AccessChain 10(dti) 26 + 31: 6(int) Load 30 + 33: 32(ptr) AccessChain 24(data) 25 31 25 + 34: 13(ivec4) Load 33 + 37: 13(ivec4) GroupNonUniformShuffle 36 34 35 + 38: 32(ptr) AccessChain 24(data) 25 29 25 + Store 38 37 + 39: 27(ptr) AccessChain 10(dti) 26 + 40: 6(int) Load 39 + 41: 27(ptr) AccessChain 10(dti) 26 + 42: 6(int) Load 41 + 44: 43(ptr) AccessChain 24(data) 25 42 25 26 + 45: 6(int) Load 44 + 46: 6(int) GroupNonUniformShuffle 36 45 35 + 47: 43(ptr) AccessChain 24(data) 25 40 25 26 + Store 47 46 + 48: 27(ptr) AccessChain 10(dti) 26 + 49: 6(int) Load 48 + 50: 27(ptr) AccessChain 10(dti) 26 + 51: 6(int) Load 50 + 53: 32(ptr) AccessChain 24(data) 25 51 25 + 54: 13(ivec4) Load 53 + 55: 52(ivec2) VectorShuffle 54 54 0 1 + 56: 52(ivec2) GroupNonUniformShuffle 36 55 35 + 57: 32(ptr) AccessChain 24(data) 25 49 25 + 58: 13(ivec4) Load 57 + 59: 13(ivec4) VectorShuffle 58 56 4 5 2 3 + Store 57 59 + 60: 27(ptr) AccessChain 10(dti) 26 + 61: 6(int) Load 60 + 62: 27(ptr) AccessChain 10(dti) 26 + 63: 6(int) Load 62 + 64: 32(ptr) AccessChain 24(data) 25 63 25 + 65: 13(ivec4) Load 64 + 66: 7(ivec3) VectorShuffle 65 65 0 1 2 + 67: 7(ivec3) GroupNonUniformShuffle 36 66 35 + 68: 32(ptr) AccessChain 24(data) 25 61 25 + 69: 13(ivec4) Load 68 + 70: 13(ivec4) VectorShuffle 69 67 4 5 6 3 + Store 68 70 + 71: 27(ptr) AccessChain 10(dti) 26 + 72: 6(int) Load 71 + 74: 27(ptr) AccessChain 10(dti) 26 + 75: 6(int) Load 74 + 77: 76(ptr) AccessChain 24(data) 25 75 73 + 78: 15(ivec4) Load 77 + 79: 15(ivec4) GroupNonUniformShuffle 36 78 35 + 80: 76(ptr) AccessChain 24(data) 25 72 73 + Store 80 79 + 81: 27(ptr) AccessChain 10(dti) 26 + 82: 6(int) Load 81 + 83: 27(ptr) AccessChain 10(dti) 26 + 84: 6(int) Load 83 + 86: 85(ptr) AccessChain 24(data) 25 84 73 26 + 87: 14(int) Load 86 + 88: 14(int) GroupNonUniformShuffle 36 87 35 + 89: 85(ptr) AccessChain 24(data) 25 82 73 26 + Store 89 88 + 90: 27(ptr) AccessChain 10(dti) 26 + 91: 6(int) Load 90 + 92: 27(ptr) AccessChain 10(dti) 26 + 93: 6(int) Load 92 + 95: 76(ptr) AccessChain 24(data) 25 93 73 + 96: 15(ivec4) Load 95 + 97: 94(ivec2) VectorShuffle 96 96 0 1 + 98: 94(ivec2) GroupNonUniformShuffle 36 97 35 + 99: 76(ptr) AccessChain 24(data) 25 91 73 + 100: 15(ivec4) Load 99 + 101: 15(ivec4) VectorShuffle 100 98 4 5 2 3 + Store 99 101 + 102: 27(ptr) AccessChain 10(dti) 26 + 103: 6(int) Load 102 + 104: 27(ptr) AccessChain 10(dti) 26 + 105: 6(int) Load 104 + 107: 76(ptr) AccessChain 24(data) 25 105 73 + 108: 15(ivec4) Load 107 + 109: 106(ivec3) VectorShuffle 108 108 0 1 2 + 110: 106(ivec3) GroupNonUniformShuffle 36 109 35 + 111: 76(ptr) AccessChain 24(data) 25 103 73 + 112: 15(ivec4) Load 111 + 113: 15(ivec4) VectorShuffle 112 110 4 5 6 3 + Store 111 113 + 114: 27(ptr) AccessChain 10(dti) 26 + 115: 6(int) Load 114 + 117: 27(ptr) AccessChain 10(dti) 26 + 118: 6(int) Load 117 + 120: 119(ptr) AccessChain 24(data) 25 118 116 + 121: 17(fvec4) Load 120 + 122: 17(fvec4) GroupNonUniformShuffle 36 121 35 + 123: 119(ptr) AccessChain 24(data) 25 115 116 + Store 123 122 + 124: 27(ptr) AccessChain 10(dti) 26 + 125: 6(int) Load 124 + 126: 27(ptr) AccessChain 10(dti) 26 + 127: 6(int) Load 126 + 129: 128(ptr) AccessChain 24(data) 25 127 116 26 + 130: 16(float) Load 129 + 131: 16(float) GroupNonUniformShuffle 36 130 35 + 132: 128(ptr) AccessChain 24(data) 25 125 116 26 + Store 132 131 + 133: 27(ptr) AccessChain 10(dti) 26 + 134: 6(int) Load 133 + 135: 27(ptr) AccessChain 10(dti) 26 + 136: 6(int) Load 135 + 138: 119(ptr) AccessChain 24(data) 25 136 116 + 139: 17(fvec4) Load 138 + 140: 137(fvec2) VectorShuffle 139 139 0 1 + 141: 137(fvec2) GroupNonUniformShuffle 36 140 35 + 142: 119(ptr) AccessChain 24(data) 25 134 116 + 143: 17(fvec4) Load 142 + 144: 17(fvec4) VectorShuffle 143 141 4 5 2 3 + Store 142 144 + 145: 27(ptr) AccessChain 10(dti) 26 + 146: 6(int) Load 145 + 147: 27(ptr) AccessChain 10(dti) 26 + 148: 6(int) Load 147 + 150: 119(ptr) AccessChain 24(data) 25 148 116 + 151: 17(fvec4) Load 150 + 152: 149(fvec3) VectorShuffle 151 151 0 1 2 + 153: 149(fvec3) GroupNonUniformShuffle 36 152 35 + 154: 119(ptr) AccessChain 24(data) 25 146 116 + 155: 17(fvec4) Load 154 + 156: 17(fvec4) VectorShuffle 155 153 4 5 6 3 + Store 154 156 + 157: 27(ptr) AccessChain 10(dti) 26 + 158: 6(int) Load 157 + 160: 27(ptr) AccessChain 10(dti) 26 + 161: 6(int) Load 160 + 163: 162(ptr) AccessChain 24(data) 25 161 159 + 164: 19(f64vec4) Load 163 + 165: 19(f64vec4) GroupNonUniformBroadcastFirst 36 164 + 166: 162(ptr) AccessChain 24(data) 25 158 159 + Store 166 165 + 167: 27(ptr) AccessChain 10(dti) 26 + 168: 6(int) Load 167 + 169: 27(ptr) AccessChain 10(dti) 26 + 170: 6(int) Load 169 + 172: 171(ptr) AccessChain 24(data) 25 170 159 26 + 173:18(float64_t) Load 172 + 174:18(float64_t) GroupNonUniformBroadcastFirst 36 173 + 175: 171(ptr) AccessChain 24(data) 25 168 159 26 + Store 175 174 + 176: 27(ptr) AccessChain 10(dti) 26 + 177: 6(int) Load 176 + 178: 27(ptr) AccessChain 10(dti) 26 + 179: 6(int) Load 178 + 181: 162(ptr) AccessChain 24(data) 25 179 159 + 182: 19(f64vec4) Load 181 + 183:180(f64vec2) VectorShuffle 182 182 0 1 + 184:180(f64vec2) GroupNonUniformBroadcastFirst 36 183 + 185: 162(ptr) AccessChain 24(data) 25 177 159 + 186: 19(f64vec4) Load 185 + 187: 19(f64vec4) VectorShuffle 186 184 4 5 2 3 + Store 185 187 + 188: 27(ptr) AccessChain 10(dti) 26 + 189: 6(int) Load 188 + 190: 27(ptr) AccessChain 10(dti) 26 + 191: 6(int) Load 190 + 193: 162(ptr) AccessChain 24(data) 25 191 159 + 194: 19(f64vec4) Load 193 + 195:192(f64vec3) VectorShuffle 194 194 0 1 2 + 196:192(f64vec3) GroupNonUniformBroadcastFirst 36 195 + 197: 162(ptr) AccessChain 24(data) 25 189 159 + 198: 19(f64vec4) Load 197 + 199: 19(f64vec4) VectorShuffle 198 196 4 5 6 3 + Store 197 199 + 200: 27(ptr) AccessChain 10(dti) 26 + 201: 6(int) Load 200 + 202: 27(ptr) AccessChain 10(dti) 26 + 203: 6(int) Load 202 + 204: 32(ptr) AccessChain 24(data) 25 203 25 + 205: 13(ivec4) Load 204 + 206: 13(ivec4) GroupNonUniformBroadcastFirst 36 205 + 207: 32(ptr) AccessChain 24(data) 25 201 25 + Store 207 206 + 208: 27(ptr) AccessChain 10(dti) 26 + 209: 6(int) Load 208 + 210: 27(ptr) AccessChain 10(dti) 26 + 211: 6(int) Load 210 + 212: 43(ptr) AccessChain 24(data) 25 211 25 26 + 213: 6(int) Load 212 + 214: 6(int) GroupNonUniformBroadcastFirst 36 213 + 215: 43(ptr) AccessChain 24(data) 25 209 25 26 + Store 215 214 + 216: 27(ptr) AccessChain 10(dti) 26 + 217: 6(int) Load 216 + 218: 27(ptr) AccessChain 10(dti) 26 + 219: 6(int) Load 218 + 220: 32(ptr) AccessChain 24(data) 25 219 25 + 221: 13(ivec4) Load 220 + 222: 52(ivec2) VectorShuffle 221 221 0 1 + 223: 52(ivec2) GroupNonUniformBroadcastFirst 36 222 + 224: 32(ptr) AccessChain 24(data) 25 217 25 + 225: 13(ivec4) Load 224 + 226: 13(ivec4) VectorShuffle 225 223 4 5 2 3 + Store 224 226 + 227: 27(ptr) AccessChain 10(dti) 26 + 228: 6(int) Load 227 + 229: 27(ptr) AccessChain 10(dti) 26 + 230: 6(int) Load 229 + 231: 32(ptr) AccessChain 24(data) 25 230 25 + 232: 13(ivec4) Load 231 + 233: 7(ivec3) VectorShuffle 232 232 0 1 2 + 234: 7(ivec3) GroupNonUniformBroadcastFirst 36 233 + 235: 32(ptr) AccessChain 24(data) 25 228 25 + 236: 13(ivec4) Load 235 + 237: 13(ivec4) VectorShuffle 236 234 4 5 6 3 + Store 235 237 + 238: 27(ptr) AccessChain 10(dti) 26 + 239: 6(int) Load 238 + 240: 27(ptr) AccessChain 10(dti) 26 + 241: 6(int) Load 240 + 242: 76(ptr) AccessChain 24(data) 25 241 73 + 243: 15(ivec4) Load 242 + 244: 15(ivec4) GroupNonUniformBroadcastFirst 36 243 + 245: 76(ptr) AccessChain 24(data) 25 239 73 + Store 245 244 + 246: 27(ptr) AccessChain 10(dti) 26 + 247: 6(int) Load 246 + 248: 27(ptr) AccessChain 10(dti) 26 + 249: 6(int) Load 248 + 250: 85(ptr) AccessChain 24(data) 25 249 73 26 + 251: 14(int) Load 250 + 252: 14(int) GroupNonUniformBroadcastFirst 36 251 + 253: 85(ptr) AccessChain 24(data) 25 247 73 26 + Store 253 252 + 254: 27(ptr) AccessChain 10(dti) 26 + 255: 6(int) Load 254 + 256: 27(ptr) AccessChain 10(dti) 26 + 257: 6(int) Load 256 + 258: 76(ptr) AccessChain 24(data) 25 257 73 + 259: 15(ivec4) Load 258 + 260: 94(ivec2) VectorShuffle 259 259 0 1 + 261: 94(ivec2) GroupNonUniformBroadcastFirst 36 260 + 262: 76(ptr) AccessChain 24(data) 25 255 73 + 263: 15(ivec4) Load 262 + 264: 15(ivec4) VectorShuffle 263 261 4 5 2 3 + Store 262 264 + 265: 27(ptr) AccessChain 10(dti) 26 + 266: 6(int) Load 265 + 267: 27(ptr) AccessChain 10(dti) 26 + 268: 6(int) Load 267 + 269: 76(ptr) AccessChain 24(data) 25 268 73 + 270: 15(ivec4) Load 269 + 271: 106(ivec3) VectorShuffle 270 270 0 1 2 + 272: 106(ivec3) GroupNonUniformBroadcastFirst 36 271 + 273: 76(ptr) AccessChain 24(data) 25 266 73 + 274: 15(ivec4) Load 273 + 275: 15(ivec4) VectorShuffle 274 272 4 5 6 3 + Store 273 275 + 276: 27(ptr) AccessChain 10(dti) 26 + 277: 6(int) Load 276 + 278: 27(ptr) AccessChain 10(dti) 26 + 279: 6(int) Load 278 + 280: 119(ptr) AccessChain 24(data) 25 279 116 + 281: 17(fvec4) Load 280 + 282: 17(fvec4) GroupNonUniformBroadcastFirst 36 281 + 283: 119(ptr) AccessChain 24(data) 25 277 116 + Store 283 282 + 284: 27(ptr) AccessChain 10(dti) 26 + 285: 6(int) Load 284 + 286: 27(ptr) AccessChain 10(dti) 26 + 287: 6(int) Load 286 + 288: 128(ptr) AccessChain 24(data) 25 287 116 26 + 289: 16(float) Load 288 + 290: 16(float) GroupNonUniformBroadcastFirst 36 289 + 291: 128(ptr) AccessChain 24(data) 25 285 116 26 + Store 291 290 + 292: 27(ptr) AccessChain 10(dti) 26 + 293: 6(int) Load 292 + 294: 27(ptr) AccessChain 10(dti) 26 + 295: 6(int) Load 294 + 296: 119(ptr) AccessChain 24(data) 25 295 116 + 297: 17(fvec4) Load 296 + 298: 137(fvec2) VectorShuffle 297 297 0 1 + 299: 137(fvec2) GroupNonUniformBroadcastFirst 36 298 + 300: 119(ptr) AccessChain 24(data) 25 293 116 + 301: 17(fvec4) Load 300 + 302: 17(fvec4) VectorShuffle 301 299 4 5 2 3 + Store 300 302 + 303: 27(ptr) AccessChain 10(dti) 26 + 304: 6(int) Load 303 + 305: 27(ptr) AccessChain 10(dti) 26 + 306: 6(int) Load 305 + 307: 119(ptr) AccessChain 24(data) 25 306 116 + 308: 17(fvec4) Load 307 + 309: 149(fvec3) VectorShuffle 308 308 0 1 2 + 310: 149(fvec3) GroupNonUniformBroadcastFirst 36 309 + 311: 119(ptr) AccessChain 24(data) 25 304 116 + 312: 17(fvec4) Load 311 + 313: 17(fvec4) VectorShuffle 312 310 4 5 6 3 + Store 311 313 + 314: 27(ptr) AccessChain 10(dti) 26 + 315: 6(int) Load 314 + 316: 27(ptr) AccessChain 10(dti) 26 + 317: 6(int) Load 316 + 318: 162(ptr) AccessChain 24(data) 25 317 159 + 319: 19(f64vec4) Load 318 + 320: 19(f64vec4) GroupNonUniformBroadcastFirst 36 319 + 321: 162(ptr) AccessChain 24(data) 25 315 159 + Store 321 320 + 322: 27(ptr) AccessChain 10(dti) 26 + 323: 6(int) Load 322 + 324: 27(ptr) AccessChain 10(dti) 26 + 325: 6(int) Load 324 + 326: 171(ptr) AccessChain 24(data) 25 325 159 26 + 327:18(float64_t) Load 326 + 328:18(float64_t) GroupNonUniformBroadcastFirst 36 327 + 329: 171(ptr) AccessChain 24(data) 25 323 159 26 + Store 329 328 + 330: 27(ptr) AccessChain 10(dti) 26 + 331: 6(int) Load 330 + 332: 27(ptr) AccessChain 10(dti) 26 + 333: 6(int) Load 332 + 334: 162(ptr) AccessChain 24(data) 25 333 159 + 335: 19(f64vec4) Load 334 + 336:180(f64vec2) VectorShuffle 335 335 0 1 + 337:180(f64vec2) GroupNonUniformBroadcastFirst 36 336 + 338: 162(ptr) AccessChain 24(data) 25 331 159 + 339: 19(f64vec4) Load 338 + 340: 19(f64vec4) VectorShuffle 339 337 4 5 2 3 + Store 338 340 + 341: 27(ptr) AccessChain 10(dti) 26 + 342: 6(int) Load 341 + 343: 27(ptr) AccessChain 10(dti) 26 + 344: 6(int) Load 343 + 345: 162(ptr) AccessChain 24(data) 25 344 159 + 346: 19(f64vec4) Load 345 + 347:192(f64vec3) VectorShuffle 346 346 0 1 2 + 348:192(f64vec3) GroupNonUniformBroadcastFirst 36 347 + 349: 162(ptr) AccessChain 24(data) 25 342 159 + 350: 19(f64vec4) Load 349 + 351: 19(f64vec4) VectorShuffle 350 348 4 5 6 3 + Store 349 351 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.waveprefix.comp.out b/deps/glslang/Test/baseResults/hlsl.waveprefix.comp.out new file mode 100644 index 00000000..9736b4e0 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.waveprefix.comp.out @@ -0,0 +1,2766 @@ +hlsl.waveprefix.comp +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:13 Function Definition: @CSMain(vu3; ( temp void) +0:13 Function Parameters: +0:13 'dti' ( in 3-component vector of uint) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 subgroupInclusiveAdd ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:15 move second child to first child ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 subgroupInclusiveAdd ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:16 move second child to first child ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 subgroupInclusiveAdd ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:17 move second child to first child ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 subgroupInclusiveAdd ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:19 move second child to first child ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 subgroupInclusiveAdd ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:20 move second child to first child ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 subgroupInclusiveAdd ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:21 move second child to first child ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 subgroupInclusiveAdd ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:22 move second child to first child ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 subgroupInclusiveAdd ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 subgroupInclusiveAdd ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 subgroupInclusiveAdd ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:26 move second child to first child ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 subgroupInclusiveAdd ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:27 move second child to first child ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 subgroupInclusiveAdd ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:29 move second child to first child ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:29 subgroupInclusiveAdd ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:30 move second child to first child ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 subgroupInclusiveAdd ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:31 move second child to first child ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 subgroupInclusiveAdd ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:32 move second child to first child ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 subgroupInclusiveAdd ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:34 move second child to first child ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 subgroupInclusiveMul ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:35 move second child to first child ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 subgroupInclusiveMul ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:36 move second child to first child ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:36 subgroupInclusiveMul ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:37 move second child to first child ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 subgroupInclusiveMul ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:39 move second child to first child ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 subgroupInclusiveMul ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:40 move second child to first child ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:40 subgroupInclusiveMul ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:41 move second child to first child ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 subgroupInclusiveMul ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:42 move second child to first child ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:42 subgroupInclusiveMul ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:44 move second child to first child ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 subgroupInclusiveMul ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 subgroupInclusiveMul ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:46 move second child to first child ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 subgroupInclusiveMul ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 subgroupInclusiveMul ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:49 move second child to first child ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:49 subgroupInclusiveMul ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:50 move second child to first child ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:50 subgroupInclusiveMul ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:51 move second child to first child ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:51 subgroupInclusiveMul ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:52 move second child to first child ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:52 subgroupInclusiveMul ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:54 move second child to first child ( temp uint) +0:54 direct index ( temp uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 subgroupBallotInclusiveBitCount ( temp uint) +0:54 subgroupBallot ( temp 4-component vector of uint) +0:54 Compare Equal ( temp bool) +0:54 direct index ( temp uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const uint) +0:13 Function Definition: CSMain( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-component vector of uint) +0:? 'dti' ( temp 3-component vector of uint) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) +0:13 Function Call: @CSMain(vu3; ( temp void) +0:? 'dti' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:13 Function Definition: @CSMain(vu3; ( temp void) +0:13 Function Parameters: +0:13 'dti' ( in 3-component vector of uint) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 subgroupInclusiveAdd ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:15 move second child to first child ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 subgroupInclusiveAdd ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:16 move second child to first child ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 subgroupInclusiveAdd ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:17 move second child to first child ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 subgroupInclusiveAdd ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:19 move second child to first child ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 subgroupInclusiveAdd ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:20 move second child to first child ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 subgroupInclusiveAdd ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:21 move second child to first child ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 subgroupInclusiveAdd ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:22 move second child to first child ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 subgroupInclusiveAdd ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 subgroupInclusiveAdd ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 subgroupInclusiveAdd ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:26 move second child to first child ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 subgroupInclusiveAdd ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:27 move second child to first child ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 subgroupInclusiveAdd ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:29 move second child to first child ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:29 subgroupInclusiveAdd ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:30 move second child to first child ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 subgroupInclusiveAdd ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:31 move second child to first child ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 subgroupInclusiveAdd ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:32 move second child to first child ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 subgroupInclusiveAdd ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:34 move second child to first child ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 subgroupInclusiveMul ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:35 move second child to first child ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 subgroupInclusiveMul ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:36 move second child to first child ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:36 subgroupInclusiveMul ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:37 move second child to first child ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 subgroupInclusiveMul ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:39 move second child to first child ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 subgroupInclusiveMul ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:40 move second child to first child ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:40 subgroupInclusiveMul ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:41 move second child to first child ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 subgroupInclusiveMul ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:42 move second child to first child ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:42 subgroupInclusiveMul ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:44 move second child to first child ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 subgroupInclusiveMul ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 subgroupInclusiveMul ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:46 move second child to first child ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 subgroupInclusiveMul ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 subgroupInclusiveMul ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:49 move second child to first child ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:49 subgroupInclusiveMul ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:50 move second child to first child ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:50 subgroupInclusiveMul ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:51 move second child to first child ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:51 subgroupInclusiveMul ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:52 move second child to first child ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:52 subgroupInclusiveMul ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:54 move second child to first child ( temp uint) +0:54 direct index ( temp uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 subgroupBallotInclusiveBitCount ( temp uint) +0:54 subgroupBallot ( temp 4-component vector of uint) +0:54 Compare Equal ( temp bool) +0:54 direct index ( temp uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const uint) +0:13 Function Definition: CSMain( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-component vector of uint) +0:? 'dti' ( temp 3-component vector of uint) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) +0:13 Function Call: @CSMain(vu3; ( temp void) +0:? 'dti' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) + +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 369 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformArithmetic + Capability GroupNonUniformBallot + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "CSMain" 364 + ExecutionMode 4 LocalSize 32 16 1 + Source HLSL 500 + Name 4 "CSMain" + Name 11 "@CSMain(vu3;" + Name 10 "dti" + Name 20 "Types" + MemberName 20(Types) 0 "u" + MemberName 20(Types) 1 "i" + MemberName 20(Types) 2 "f" + MemberName 20(Types) 3 "d" + Name 22 "data" + MemberName 22(data) 0 "@data" + Name 24 "data" + Name 362 "dti" + Name 364 "dti" + Name 366 "param" + MemberDecorate 20(Types) 0 Offset 0 + MemberDecorate 20(Types) 1 Offset 16 + MemberDecorate 20(Types) 2 Offset 32 + MemberDecorate 20(Types) 3 Offset 64 + Decorate 21 ArrayStride 96 + MemberDecorate 22(data) 0 Offset 0 + Decorate 22(data) BufferBlock + Decorate 24(data) DescriptorSet 0 + Decorate 364(dti) BuiltIn GlobalInvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 9: TypeFunction 2 8(ptr) + 13: TypeVector 6(int) 4 + 14: TypeInt 32 1 + 15: TypeVector 14(int) 4 + 16: TypeFloat 32 + 17: TypeVector 16(float) 4 + 18: TypeFloat 64 + 19: TypeVector 18(float64_t) 4 + 20(Types): TypeStruct 13(ivec4) 15(ivec4) 17(fvec4) 19(f64vec4) + 21: TypeRuntimeArray 20(Types) + 22(data): TypeStruct 21 + 23: TypePointer Uniform 22(data) + 24(data): 23(ptr) Variable Uniform + 25: 14(int) Constant 0 + 26: 6(int) Constant 0 + 27: TypePointer Function 6(int) + 32: TypePointer Uniform 13(ivec4) + 35: 6(int) Constant 3 + 42: TypePointer Uniform 6(int) + 51: TypeVector 6(int) 2 + 72: 14(int) Constant 1 + 75: TypePointer Uniform 15(ivec4) + 84: TypePointer Uniform 14(int) + 93: TypeVector 14(int) 2 + 105: TypeVector 14(int) 3 + 115: 14(int) Constant 2 + 118: TypePointer Uniform 17(fvec4) + 127: TypePointer Uniform 16(float) + 136: TypeVector 16(float) 2 + 148: TypeVector 16(float) 3 + 158: 14(int) Constant 3 + 161: TypePointer Uniform 19(f64vec4) + 170: TypePointer Uniform 18(float64_t) + 179: TypeVector 18(float64_t) 2 + 191: TypeVector 18(float64_t) 3 + 357: TypeBool + 363: TypePointer Input 7(ivec3) + 364(dti): 363(ptr) Variable Input + 4(CSMain): 2 Function None 3 + 5: Label + 362(dti): 8(ptr) Variable Function + 366(param): 8(ptr) Variable Function + 365: 7(ivec3) Load 364(dti) + Store 362(dti) 365 + 367: 7(ivec3) Load 362(dti) + Store 366(param) 367 + 368: 2 FunctionCall 11(@CSMain(vu3;) 366(param) + Return + FunctionEnd +11(@CSMain(vu3;): 2 Function None 9 + 10(dti): 8(ptr) FunctionParameter + 12: Label + 28: 27(ptr) AccessChain 10(dti) 26 + 29: 6(int) Load 28 + 30: 27(ptr) AccessChain 10(dti) 26 + 31: 6(int) Load 30 + 33: 32(ptr) AccessChain 24(data) 25 31 25 + 34: 13(ivec4) Load 33 + 36: 13(ivec4) GroupNonUniformIAdd 35 InclusiveScan 34 + 37: 32(ptr) AccessChain 24(data) 25 29 25 + Store 37 36 + 38: 27(ptr) AccessChain 10(dti) 26 + 39: 6(int) Load 38 + 40: 27(ptr) AccessChain 10(dti) 26 + 41: 6(int) Load 40 + 43: 42(ptr) AccessChain 24(data) 25 41 25 26 + 44: 6(int) Load 43 + 45: 6(int) GroupNonUniformIAdd 35 InclusiveScan 44 + 46: 42(ptr) AccessChain 24(data) 25 39 25 26 + Store 46 45 + 47: 27(ptr) AccessChain 10(dti) 26 + 48: 6(int) Load 47 + 49: 27(ptr) AccessChain 10(dti) 26 + 50: 6(int) Load 49 + 52: 32(ptr) AccessChain 24(data) 25 50 25 + 53: 13(ivec4) Load 52 + 54: 51(ivec2) VectorShuffle 53 53 0 1 + 55: 51(ivec2) GroupNonUniformIAdd 35 InclusiveScan 54 + 56: 32(ptr) AccessChain 24(data) 25 48 25 + 57: 13(ivec4) Load 56 + 58: 13(ivec4) VectorShuffle 57 55 4 5 2 3 + Store 56 58 + 59: 27(ptr) AccessChain 10(dti) 26 + 60: 6(int) Load 59 + 61: 27(ptr) AccessChain 10(dti) 26 + 62: 6(int) Load 61 + 63: 32(ptr) AccessChain 24(data) 25 62 25 + 64: 13(ivec4) Load 63 + 65: 7(ivec3) VectorShuffle 64 64 0 1 2 + 66: 7(ivec3) GroupNonUniformIAdd 35 InclusiveScan 65 + 67: 32(ptr) AccessChain 24(data) 25 60 25 + 68: 13(ivec4) Load 67 + 69: 13(ivec4) VectorShuffle 68 66 4 5 6 3 + Store 67 69 + 70: 27(ptr) AccessChain 10(dti) 26 + 71: 6(int) Load 70 + 73: 27(ptr) AccessChain 10(dti) 26 + 74: 6(int) Load 73 + 76: 75(ptr) AccessChain 24(data) 25 74 72 + 77: 15(ivec4) Load 76 + 78: 15(ivec4) GroupNonUniformIAdd 35 InclusiveScan 77 + 79: 75(ptr) AccessChain 24(data) 25 71 72 + Store 79 78 + 80: 27(ptr) AccessChain 10(dti) 26 + 81: 6(int) Load 80 + 82: 27(ptr) AccessChain 10(dti) 26 + 83: 6(int) Load 82 + 85: 84(ptr) AccessChain 24(data) 25 83 72 26 + 86: 14(int) Load 85 + 87: 14(int) GroupNonUniformIAdd 35 InclusiveScan 86 + 88: 84(ptr) AccessChain 24(data) 25 81 72 26 + Store 88 87 + 89: 27(ptr) AccessChain 10(dti) 26 + 90: 6(int) Load 89 + 91: 27(ptr) AccessChain 10(dti) 26 + 92: 6(int) Load 91 + 94: 75(ptr) AccessChain 24(data) 25 92 72 + 95: 15(ivec4) Load 94 + 96: 93(ivec2) VectorShuffle 95 95 0 1 + 97: 93(ivec2) GroupNonUniformIAdd 35 InclusiveScan 96 + 98: 75(ptr) AccessChain 24(data) 25 90 72 + 99: 15(ivec4) Load 98 + 100: 15(ivec4) VectorShuffle 99 97 4 5 2 3 + Store 98 100 + 101: 27(ptr) AccessChain 10(dti) 26 + 102: 6(int) Load 101 + 103: 27(ptr) AccessChain 10(dti) 26 + 104: 6(int) Load 103 + 106: 75(ptr) AccessChain 24(data) 25 104 72 + 107: 15(ivec4) Load 106 + 108: 105(ivec3) VectorShuffle 107 107 0 1 2 + 109: 105(ivec3) GroupNonUniformIAdd 35 InclusiveScan 108 + 110: 75(ptr) AccessChain 24(data) 25 102 72 + 111: 15(ivec4) Load 110 + 112: 15(ivec4) VectorShuffle 111 109 4 5 6 3 + Store 110 112 + 113: 27(ptr) AccessChain 10(dti) 26 + 114: 6(int) Load 113 + 116: 27(ptr) AccessChain 10(dti) 26 + 117: 6(int) Load 116 + 119: 118(ptr) AccessChain 24(data) 25 117 115 + 120: 17(fvec4) Load 119 + 121: 17(fvec4) GroupNonUniformFAdd 35 InclusiveScan 120 + 122: 118(ptr) AccessChain 24(data) 25 114 115 + Store 122 121 + 123: 27(ptr) AccessChain 10(dti) 26 + 124: 6(int) Load 123 + 125: 27(ptr) AccessChain 10(dti) 26 + 126: 6(int) Load 125 + 128: 127(ptr) AccessChain 24(data) 25 126 115 26 + 129: 16(float) Load 128 + 130: 16(float) GroupNonUniformFAdd 35 InclusiveScan 129 + 131: 127(ptr) AccessChain 24(data) 25 124 115 26 + Store 131 130 + 132: 27(ptr) AccessChain 10(dti) 26 + 133: 6(int) Load 132 + 134: 27(ptr) AccessChain 10(dti) 26 + 135: 6(int) Load 134 + 137: 118(ptr) AccessChain 24(data) 25 135 115 + 138: 17(fvec4) Load 137 + 139: 136(fvec2) VectorShuffle 138 138 0 1 + 140: 136(fvec2) GroupNonUniformFAdd 35 InclusiveScan 139 + 141: 118(ptr) AccessChain 24(data) 25 133 115 + 142: 17(fvec4) Load 141 + 143: 17(fvec4) VectorShuffle 142 140 4 5 2 3 + Store 141 143 + 144: 27(ptr) AccessChain 10(dti) 26 + 145: 6(int) Load 144 + 146: 27(ptr) AccessChain 10(dti) 26 + 147: 6(int) Load 146 + 149: 118(ptr) AccessChain 24(data) 25 147 115 + 150: 17(fvec4) Load 149 + 151: 148(fvec3) VectorShuffle 150 150 0 1 2 + 152: 148(fvec3) GroupNonUniformFAdd 35 InclusiveScan 151 + 153: 118(ptr) AccessChain 24(data) 25 145 115 + 154: 17(fvec4) Load 153 + 155: 17(fvec4) VectorShuffle 154 152 4 5 6 3 + Store 153 155 + 156: 27(ptr) AccessChain 10(dti) 26 + 157: 6(int) Load 156 + 159: 27(ptr) AccessChain 10(dti) 26 + 160: 6(int) Load 159 + 162: 161(ptr) AccessChain 24(data) 25 160 158 + 163: 19(f64vec4) Load 162 + 164: 19(f64vec4) GroupNonUniformFAdd 35 InclusiveScan 163 + 165: 161(ptr) AccessChain 24(data) 25 157 158 + Store 165 164 + 166: 27(ptr) AccessChain 10(dti) 26 + 167: 6(int) Load 166 + 168: 27(ptr) AccessChain 10(dti) 26 + 169: 6(int) Load 168 + 171: 170(ptr) AccessChain 24(data) 25 169 158 26 + 172:18(float64_t) Load 171 + 173:18(float64_t) GroupNonUniformFAdd 35 InclusiveScan 172 + 174: 170(ptr) AccessChain 24(data) 25 167 158 26 + Store 174 173 + 175: 27(ptr) AccessChain 10(dti) 26 + 176: 6(int) Load 175 + 177: 27(ptr) AccessChain 10(dti) 26 + 178: 6(int) Load 177 + 180: 161(ptr) AccessChain 24(data) 25 178 158 + 181: 19(f64vec4) Load 180 + 182:179(f64vec2) VectorShuffle 181 181 0 1 + 183:179(f64vec2) GroupNonUniformFAdd 35 InclusiveScan 182 + 184: 161(ptr) AccessChain 24(data) 25 176 158 + 185: 19(f64vec4) Load 184 + 186: 19(f64vec4) VectorShuffle 185 183 4 5 2 3 + Store 184 186 + 187: 27(ptr) AccessChain 10(dti) 26 + 188: 6(int) Load 187 + 189: 27(ptr) AccessChain 10(dti) 26 + 190: 6(int) Load 189 + 192: 161(ptr) AccessChain 24(data) 25 190 158 + 193: 19(f64vec4) Load 192 + 194:191(f64vec3) VectorShuffle 193 193 0 1 2 + 195:191(f64vec3) GroupNonUniformFAdd 35 InclusiveScan 194 + 196: 161(ptr) AccessChain 24(data) 25 188 158 + 197: 19(f64vec4) Load 196 + 198: 19(f64vec4) VectorShuffle 197 195 4 5 6 3 + Store 196 198 + 199: 27(ptr) AccessChain 10(dti) 26 + 200: 6(int) Load 199 + 201: 27(ptr) AccessChain 10(dti) 26 + 202: 6(int) Load 201 + 203: 32(ptr) AccessChain 24(data) 25 202 25 + 204: 13(ivec4) Load 203 + 205: 13(ivec4) GroupNonUniformIMul 35 InclusiveScan 204 + 206: 32(ptr) AccessChain 24(data) 25 200 25 + Store 206 205 + 207: 27(ptr) AccessChain 10(dti) 26 + 208: 6(int) Load 207 + 209: 27(ptr) AccessChain 10(dti) 26 + 210: 6(int) Load 209 + 211: 42(ptr) AccessChain 24(data) 25 210 25 26 + 212: 6(int) Load 211 + 213: 6(int) GroupNonUniformIMul 35 InclusiveScan 212 + 214: 42(ptr) AccessChain 24(data) 25 208 25 26 + Store 214 213 + 215: 27(ptr) AccessChain 10(dti) 26 + 216: 6(int) Load 215 + 217: 27(ptr) AccessChain 10(dti) 26 + 218: 6(int) Load 217 + 219: 32(ptr) AccessChain 24(data) 25 218 25 + 220: 13(ivec4) Load 219 + 221: 51(ivec2) VectorShuffle 220 220 0 1 + 222: 51(ivec2) GroupNonUniformIMul 35 InclusiveScan 221 + 223: 32(ptr) AccessChain 24(data) 25 216 25 + 224: 13(ivec4) Load 223 + 225: 13(ivec4) VectorShuffle 224 222 4 5 2 3 + Store 223 225 + 226: 27(ptr) AccessChain 10(dti) 26 + 227: 6(int) Load 226 + 228: 27(ptr) AccessChain 10(dti) 26 + 229: 6(int) Load 228 + 230: 32(ptr) AccessChain 24(data) 25 229 25 + 231: 13(ivec4) Load 230 + 232: 7(ivec3) VectorShuffle 231 231 0 1 2 + 233: 7(ivec3) GroupNonUniformIMul 35 InclusiveScan 232 + 234: 32(ptr) AccessChain 24(data) 25 227 25 + 235: 13(ivec4) Load 234 + 236: 13(ivec4) VectorShuffle 235 233 4 5 6 3 + Store 234 236 + 237: 27(ptr) AccessChain 10(dti) 26 + 238: 6(int) Load 237 + 239: 27(ptr) AccessChain 10(dti) 26 + 240: 6(int) Load 239 + 241: 75(ptr) AccessChain 24(data) 25 240 72 + 242: 15(ivec4) Load 241 + 243: 15(ivec4) GroupNonUniformIMul 35 InclusiveScan 242 + 244: 75(ptr) AccessChain 24(data) 25 238 72 + Store 244 243 + 245: 27(ptr) AccessChain 10(dti) 26 + 246: 6(int) Load 245 + 247: 27(ptr) AccessChain 10(dti) 26 + 248: 6(int) Load 247 + 249: 84(ptr) AccessChain 24(data) 25 248 72 26 + 250: 14(int) Load 249 + 251: 14(int) GroupNonUniformIMul 35 InclusiveScan 250 + 252: 84(ptr) AccessChain 24(data) 25 246 72 26 + Store 252 251 + 253: 27(ptr) AccessChain 10(dti) 26 + 254: 6(int) Load 253 + 255: 27(ptr) AccessChain 10(dti) 26 + 256: 6(int) Load 255 + 257: 75(ptr) AccessChain 24(data) 25 256 72 + 258: 15(ivec4) Load 257 + 259: 93(ivec2) VectorShuffle 258 258 0 1 + 260: 93(ivec2) GroupNonUniformIMul 35 InclusiveScan 259 + 261: 75(ptr) AccessChain 24(data) 25 254 72 + 262: 15(ivec4) Load 261 + 263: 15(ivec4) VectorShuffle 262 260 4 5 2 3 + Store 261 263 + 264: 27(ptr) AccessChain 10(dti) 26 + 265: 6(int) Load 264 + 266: 27(ptr) AccessChain 10(dti) 26 + 267: 6(int) Load 266 + 268: 75(ptr) AccessChain 24(data) 25 267 72 + 269: 15(ivec4) Load 268 + 270: 105(ivec3) VectorShuffle 269 269 0 1 2 + 271: 105(ivec3) GroupNonUniformIMul 35 InclusiveScan 270 + 272: 75(ptr) AccessChain 24(data) 25 265 72 + 273: 15(ivec4) Load 272 + 274: 15(ivec4) VectorShuffle 273 271 4 5 6 3 + Store 272 274 + 275: 27(ptr) AccessChain 10(dti) 26 + 276: 6(int) Load 275 + 277: 27(ptr) AccessChain 10(dti) 26 + 278: 6(int) Load 277 + 279: 118(ptr) AccessChain 24(data) 25 278 115 + 280: 17(fvec4) Load 279 + 281: 17(fvec4) GroupNonUniformFMul 35 InclusiveScan 280 + 282: 118(ptr) AccessChain 24(data) 25 276 115 + Store 282 281 + 283: 27(ptr) AccessChain 10(dti) 26 + 284: 6(int) Load 283 + 285: 27(ptr) AccessChain 10(dti) 26 + 286: 6(int) Load 285 + 287: 127(ptr) AccessChain 24(data) 25 286 115 26 + 288: 16(float) Load 287 + 289: 16(float) GroupNonUniformFMul 35 InclusiveScan 288 + 290: 127(ptr) AccessChain 24(data) 25 284 115 26 + Store 290 289 + 291: 27(ptr) AccessChain 10(dti) 26 + 292: 6(int) Load 291 + 293: 27(ptr) AccessChain 10(dti) 26 + 294: 6(int) Load 293 + 295: 118(ptr) AccessChain 24(data) 25 294 115 + 296: 17(fvec4) Load 295 + 297: 136(fvec2) VectorShuffle 296 296 0 1 + 298: 136(fvec2) GroupNonUniformFMul 35 InclusiveScan 297 + 299: 118(ptr) AccessChain 24(data) 25 292 115 + 300: 17(fvec4) Load 299 + 301: 17(fvec4) VectorShuffle 300 298 4 5 2 3 + Store 299 301 + 302: 27(ptr) AccessChain 10(dti) 26 + 303: 6(int) Load 302 + 304: 27(ptr) AccessChain 10(dti) 26 + 305: 6(int) Load 304 + 306: 118(ptr) AccessChain 24(data) 25 305 115 + 307: 17(fvec4) Load 306 + 308: 148(fvec3) VectorShuffle 307 307 0 1 2 + 309: 148(fvec3) GroupNonUniformFMul 35 InclusiveScan 308 + 310: 118(ptr) AccessChain 24(data) 25 303 115 + 311: 17(fvec4) Load 310 + 312: 17(fvec4) VectorShuffle 311 309 4 5 6 3 + Store 310 312 + 313: 27(ptr) AccessChain 10(dti) 26 + 314: 6(int) Load 313 + 315: 27(ptr) AccessChain 10(dti) 26 + 316: 6(int) Load 315 + 317: 161(ptr) AccessChain 24(data) 25 316 158 + 318: 19(f64vec4) Load 317 + 319: 19(f64vec4) GroupNonUniformFMul 35 InclusiveScan 318 + 320: 161(ptr) AccessChain 24(data) 25 314 158 + Store 320 319 + 321: 27(ptr) AccessChain 10(dti) 26 + 322: 6(int) Load 321 + 323: 27(ptr) AccessChain 10(dti) 26 + 324: 6(int) Load 323 + 325: 170(ptr) AccessChain 24(data) 25 324 158 26 + 326:18(float64_t) Load 325 + 327:18(float64_t) GroupNonUniformFMul 35 InclusiveScan 326 + 328: 170(ptr) AccessChain 24(data) 25 322 158 26 + Store 328 327 + 329: 27(ptr) AccessChain 10(dti) 26 + 330: 6(int) Load 329 + 331: 27(ptr) AccessChain 10(dti) 26 + 332: 6(int) Load 331 + 333: 161(ptr) AccessChain 24(data) 25 332 158 + 334: 19(f64vec4) Load 333 + 335:179(f64vec2) VectorShuffle 334 334 0 1 + 336:179(f64vec2) GroupNonUniformFMul 35 InclusiveScan 335 + 337: 161(ptr) AccessChain 24(data) 25 330 158 + 338: 19(f64vec4) Load 337 + 339: 19(f64vec4) VectorShuffle 338 336 4 5 2 3 + Store 337 339 + 340: 27(ptr) AccessChain 10(dti) 26 + 341: 6(int) Load 340 + 342: 27(ptr) AccessChain 10(dti) 26 + 343: 6(int) Load 342 + 344: 161(ptr) AccessChain 24(data) 25 343 158 + 345: 19(f64vec4) Load 344 + 346:191(f64vec3) VectorShuffle 345 345 0 1 2 + 347:191(f64vec3) GroupNonUniformFMul 35 InclusiveScan 346 + 348: 161(ptr) AccessChain 24(data) 25 341 158 + 349: 19(f64vec4) Load 348 + 350: 19(f64vec4) VectorShuffle 349 347 4 5 6 3 + Store 348 350 + 351: 27(ptr) AccessChain 10(dti) 26 + 352: 6(int) Load 351 + 353: 27(ptr) AccessChain 10(dti) 26 + 354: 6(int) Load 353 + 355: 42(ptr) AccessChain 24(data) 25 354 25 26 + 356: 6(int) Load 355 + 358: 357(bool) IEqual 356 26 + 359: 13(ivec4) GroupNonUniformBallot 35 358 + 360: 6(int) GroupNonUniformBallotBitCount 35 InclusiveScan 359 + 361: 42(ptr) AccessChain 24(data) 25 352 25 26 + Store 361 360 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.wavequad.comp.out b/deps/glslang/Test/baseResults/hlsl.wavequad.comp.out new file mode 100644 index 00000000..56ef6d74 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.wavequad.comp.out @@ -0,0 +1,9299 @@ +hlsl.wavequad.comp +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:13 Function Definition: @CSMain(vu3; ( temp void) +0:13 Function Parameters: +0:13 'dti' ( in 3-component vector of uint) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 subgroupQuadBroadcast ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const uint) +0:15 move second child to first child ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 subgroupQuadBroadcast ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const uint) +0:16 move second child to first child ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 subgroupQuadBroadcast ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 0 (const uint) +0:17 move second child to first child ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 subgroupQuadBroadcast ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 0 (const uint) +0:19 move second child to first child ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 subgroupQuadBroadcast ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 0 (const uint) +0:20 move second child to first child ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 subgroupQuadBroadcast ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 0 (const uint) +0:21 move second child to first child ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 subgroupQuadBroadcast ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 0 (const uint) +0:22 move second child to first child ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 subgroupQuadBroadcast ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 Constant: +0:22 0 (const uint) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 subgroupQuadBroadcast ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 0 (const uint) +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 subgroupQuadBroadcast ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 0 (const uint) +0:26 move second child to first child ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 subgroupQuadBroadcast ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 Constant: +0:26 0 (const uint) +0:27 move second child to first child ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 subgroupQuadBroadcast ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Constant: +0:27 0 (const uint) +0:29 move second child to first child ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:29 subgroupQuadBroadcast ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:29 Constant: +0:29 0 (const uint) +0:30 move second child to first child ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 subgroupQuadBroadcast ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 0 (const uint) +0:31 move second child to first child ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 subgroupQuadBroadcast ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 Constant: +0:31 0 (const uint) +0:32 move second child to first child ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 subgroupQuadBroadcast ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 Constant: +0:32 0 (const uint) +0:34 move second child to first child ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 subgroupQuadBroadcast ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 1 (const uint) +0:35 move second child to first child ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 subgroupQuadBroadcast ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 1 (const uint) +0:36 move second child to first child ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:36 subgroupQuadBroadcast ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:36 Constant: +0:36 1 (const uint) +0:37 move second child to first child ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 subgroupQuadBroadcast ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 Constant: +0:37 1 (const uint) +0:39 move second child to first child ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 subgroupQuadBroadcast ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 Constant: +0:39 1 (const uint) +0:40 move second child to first child ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:40 subgroupQuadBroadcast ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const uint) +0:41 move second child to first child ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 subgroupQuadBroadcast ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Constant: +0:41 1 (const uint) +0:42 move second child to first child ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:42 subgroupQuadBroadcast ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:42 Constant: +0:42 1 (const uint) +0:44 move second child to first child ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 subgroupQuadBroadcast ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 Constant: +0:44 1 (const uint) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 subgroupQuadBroadcast ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 1 (const uint) +0:46 move second child to first child ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 subgroupQuadBroadcast ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 1 (const uint) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 subgroupQuadBroadcast ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Constant: +0:47 1 (const uint) +0:49 move second child to first child ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:49 subgroupQuadBroadcast ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:49 Constant: +0:49 1 (const uint) +0:50 move second child to first child ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:50 subgroupQuadBroadcast ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 1 (const uint) +0:51 move second child to first child ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:51 subgroupQuadBroadcast ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:51 Constant: +0:51 1 (const uint) +0:52 move second child to first child ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:52 subgroupQuadBroadcast ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:52 Constant: +0:52 1 (const uint) +0:54 move second child to first child ( temp 4-component vector of uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 subgroupQuadBroadcast ( temp 4-component vector of uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 2 (const uint) +0:55 move second child to first child ( temp uint) +0:55 direct index ( temp uint) +0:55 u: direct index for structure ( temp 4-component vector of uint) +0:55 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:55 Constant: +0:55 0 (const uint) +0:55 direct index ( temp uint) +0:55 'dti' ( in 3-component vector of uint) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 subgroupQuadBroadcast ( temp uint) +0:55 direct index ( temp uint) +0:55 u: direct index for structure ( temp 4-component vector of uint) +0:55 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:55 Constant: +0:55 0 (const uint) +0:55 direct index ( temp uint) +0:55 'dti' ( in 3-component vector of uint) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 2 (const uint) +0:56 move second child to first child ( temp 2-component vector of uint) +0:56 vector swizzle ( temp 2-component vector of uint) +0:56 u: direct index for structure ( temp 4-component vector of uint) +0:56 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:56 Constant: +0:56 0 (const uint) +0:56 direct index ( temp uint) +0:56 'dti' ( in 3-component vector of uint) +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 0 (const int) +0:56 Sequence +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1 (const int) +0:56 subgroupQuadBroadcast ( temp 2-component vector of uint) +0:56 vector swizzle ( temp 2-component vector of uint) +0:56 u: direct index for structure ( temp 4-component vector of uint) +0:56 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:56 Constant: +0:56 0 (const uint) +0:56 direct index ( temp uint) +0:56 'dti' ( in 3-component vector of uint) +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 0 (const int) +0:56 Sequence +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1 (const int) +0:56 Constant: +0:56 2 (const uint) +0:57 move second child to first child ( temp 3-component vector of uint) +0:57 vector swizzle ( temp 3-component vector of uint) +0:57 u: direct index for structure ( temp 4-component vector of uint) +0:57 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:57 Constant: +0:57 0 (const uint) +0:57 direct index ( temp uint) +0:57 'dti' ( in 3-component vector of uint) +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 0 (const int) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 2 (const int) +0:57 subgroupQuadBroadcast ( temp 3-component vector of uint) +0:57 vector swizzle ( temp 3-component vector of uint) +0:57 u: direct index for structure ( temp 4-component vector of uint) +0:57 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:57 Constant: +0:57 0 (const uint) +0:57 direct index ( temp uint) +0:57 'dti' ( in 3-component vector of uint) +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 0 (const int) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 2 (const int) +0:57 Constant: +0:57 2 (const uint) +0:59 move second child to first child ( temp 4-component vector of int) +0:59 i: direct index for structure ( temp 4-component vector of int) +0:59 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:59 Constant: +0:59 0 (const uint) +0:59 direct index ( temp uint) +0:59 'dti' ( in 3-component vector of uint) +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:59 subgroupQuadBroadcast ( temp 4-component vector of int) +0:59 i: direct index for structure ( temp 4-component vector of int) +0:59 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:59 Constant: +0:59 0 (const uint) +0:59 direct index ( temp uint) +0:59 'dti' ( in 3-component vector of uint) +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:59 Constant: +0:59 2 (const uint) +0:60 move second child to first child ( temp int) +0:60 direct index ( temp int) +0:60 i: direct index for structure ( temp 4-component vector of int) +0:60 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:60 Constant: +0:60 0 (const uint) +0:60 direct index ( temp uint) +0:60 'dti' ( in 3-component vector of uint) +0:60 Constant: +0:60 0 (const int) +0:60 Constant: +0:60 1 (const int) +0:60 Constant: +0:60 0 (const int) +0:60 subgroupQuadBroadcast ( temp int) +0:60 direct index ( temp int) +0:60 i: direct index for structure ( temp 4-component vector of int) +0:60 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:60 Constant: +0:60 0 (const uint) +0:60 direct index ( temp uint) +0:60 'dti' ( in 3-component vector of uint) +0:60 Constant: +0:60 0 (const int) +0:60 Constant: +0:60 1 (const int) +0:60 Constant: +0:60 0 (const int) +0:60 Constant: +0:60 2 (const uint) +0:61 move second child to first child ( temp 2-component vector of int) +0:61 vector swizzle ( temp 2-component vector of int) +0:61 i: direct index for structure ( temp 4-component vector of int) +0:61 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:61 Constant: +0:61 0 (const uint) +0:61 direct index ( temp uint) +0:61 'dti' ( in 3-component vector of uint) +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Sequence +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 subgroupQuadBroadcast ( temp 2-component vector of int) +0:61 vector swizzle ( temp 2-component vector of int) +0:61 i: direct index for structure ( temp 4-component vector of int) +0:61 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:61 Constant: +0:61 0 (const uint) +0:61 direct index ( temp uint) +0:61 'dti' ( in 3-component vector of uint) +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Sequence +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Constant: +0:61 2 (const uint) +0:62 move second child to first child ( temp 3-component vector of int) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 i: direct index for structure ( temp 4-component vector of int) +0:62 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:62 Constant: +0:62 0 (const uint) +0:62 direct index ( temp uint) +0:62 'dti' ( in 3-component vector of uint) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:62 subgroupQuadBroadcast ( temp 3-component vector of int) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 i: direct index for structure ( temp 4-component vector of int) +0:62 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:62 Constant: +0:62 0 (const uint) +0:62 direct index ( temp uint) +0:62 'dti' ( in 3-component vector of uint) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:62 Constant: +0:62 2 (const uint) +0:64 move second child to first child ( temp 4-component vector of float) +0:64 f: direct index for structure ( temp 4-component vector of float) +0:64 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:64 Constant: +0:64 0 (const uint) +0:64 direct index ( temp uint) +0:64 'dti' ( in 3-component vector of uint) +0:64 Constant: +0:64 0 (const int) +0:64 Constant: +0:64 2 (const int) +0:64 subgroupQuadBroadcast ( temp 4-component vector of float) +0:64 f: direct index for structure ( temp 4-component vector of float) +0:64 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:64 Constant: +0:64 0 (const uint) +0:64 direct index ( temp uint) +0:64 'dti' ( in 3-component vector of uint) +0:64 Constant: +0:64 0 (const int) +0:64 Constant: +0:64 2 (const int) +0:64 Constant: +0:64 2 (const uint) +0:65 move second child to first child ( temp float) +0:65 direct index ( temp float) +0:65 f: direct index for structure ( temp 4-component vector of float) +0:65 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:65 Constant: +0:65 0 (const uint) +0:65 direct index ( temp uint) +0:65 'dti' ( in 3-component vector of uint) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 2 (const int) +0:65 Constant: +0:65 0 (const int) +0:65 subgroupQuadBroadcast ( temp float) +0:65 direct index ( temp float) +0:65 f: direct index for structure ( temp 4-component vector of float) +0:65 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:65 Constant: +0:65 0 (const uint) +0:65 direct index ( temp uint) +0:65 'dti' ( in 3-component vector of uint) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 2 (const int) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 2 (const uint) +0:66 move second child to first child ( temp 2-component vector of float) +0:66 vector swizzle ( temp 2-component vector of float) +0:66 f: direct index for structure ( temp 4-component vector of float) +0:66 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:66 Constant: +0:66 0 (const uint) +0:66 direct index ( temp uint) +0:66 'dti' ( in 3-component vector of uint) +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 2 (const int) +0:66 Sequence +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 1 (const int) +0:66 subgroupQuadBroadcast ( temp 2-component vector of float) +0:66 vector swizzle ( temp 2-component vector of float) +0:66 f: direct index for structure ( temp 4-component vector of float) +0:66 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:66 Constant: +0:66 0 (const uint) +0:66 direct index ( temp uint) +0:66 'dti' ( in 3-component vector of uint) +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 2 (const int) +0:66 Sequence +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 1 (const int) +0:66 Constant: +0:66 2 (const uint) +0:67 move second child to first child ( temp 3-component vector of float) +0:67 vector swizzle ( temp 3-component vector of float) +0:67 f: direct index for structure ( temp 4-component vector of float) +0:67 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:67 Constant: +0:67 0 (const uint) +0:67 direct index ( temp uint) +0:67 'dti' ( in 3-component vector of uint) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 Sequence +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 1 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 subgroupQuadBroadcast ( temp 3-component vector of float) +0:67 vector swizzle ( temp 3-component vector of float) +0:67 f: direct index for structure ( temp 4-component vector of float) +0:67 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:67 Constant: +0:67 0 (const uint) +0:67 direct index ( temp uint) +0:67 'dti' ( in 3-component vector of uint) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 Sequence +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 1 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 Constant: +0:67 2 (const uint) +0:69 move second child to first child ( temp 4-component vector of double) +0:69 d: direct index for structure ( temp 4-component vector of double) +0:69 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:69 Constant: +0:69 0 (const uint) +0:69 direct index ( temp uint) +0:69 'dti' ( in 3-component vector of uint) +0:69 Constant: +0:69 0 (const int) +0:69 Constant: +0:69 3 (const int) +0:69 subgroupQuadBroadcast ( temp 4-component vector of double) +0:69 d: direct index for structure ( temp 4-component vector of double) +0:69 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:69 Constant: +0:69 0 (const uint) +0:69 direct index ( temp uint) +0:69 'dti' ( in 3-component vector of uint) +0:69 Constant: +0:69 0 (const int) +0:69 Constant: +0:69 3 (const int) +0:69 Constant: +0:69 2 (const uint) +0:70 move second child to first child ( temp double) +0:70 direct index ( temp double) +0:70 d: direct index for structure ( temp 4-component vector of double) +0:70 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:70 Constant: +0:70 0 (const uint) +0:70 direct index ( temp uint) +0:70 'dti' ( in 3-component vector of uint) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 3 (const int) +0:70 Constant: +0:70 0 (const int) +0:70 subgroupQuadBroadcast ( temp double) +0:70 direct index ( temp double) +0:70 d: direct index for structure ( temp 4-component vector of double) +0:70 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:70 Constant: +0:70 0 (const uint) +0:70 direct index ( temp uint) +0:70 'dti' ( in 3-component vector of uint) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 3 (const int) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 2 (const uint) +0:71 move second child to first child ( temp 2-component vector of double) +0:71 vector swizzle ( temp 2-component vector of double) +0:71 d: direct index for structure ( temp 4-component vector of double) +0:71 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:71 Constant: +0:71 0 (const uint) +0:71 direct index ( temp uint) +0:71 'dti' ( in 3-component vector of uint) +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 3 (const int) +0:71 Sequence +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 1 (const int) +0:71 subgroupQuadBroadcast ( temp 2-component vector of double) +0:71 vector swizzle ( temp 2-component vector of double) +0:71 d: direct index for structure ( temp 4-component vector of double) +0:71 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:71 Constant: +0:71 0 (const uint) +0:71 direct index ( temp uint) +0:71 'dti' ( in 3-component vector of uint) +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 3 (const int) +0:71 Sequence +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 1 (const int) +0:71 Constant: +0:71 2 (const uint) +0:72 move second child to first child ( temp 3-component vector of double) +0:72 vector swizzle ( temp 3-component vector of double) +0:72 d: direct index for structure ( temp 4-component vector of double) +0:72 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:72 Constant: +0:72 0 (const uint) +0:72 direct index ( temp uint) +0:72 'dti' ( in 3-component vector of uint) +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 3 (const int) +0:72 Sequence +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 1 (const int) +0:72 Constant: +0:72 2 (const int) +0:72 subgroupQuadBroadcast ( temp 3-component vector of double) +0:72 vector swizzle ( temp 3-component vector of double) +0:72 d: direct index for structure ( temp 4-component vector of double) +0:72 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:72 Constant: +0:72 0 (const uint) +0:72 direct index ( temp uint) +0:72 'dti' ( in 3-component vector of uint) +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 3 (const int) +0:72 Sequence +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 1 (const int) +0:72 Constant: +0:72 2 (const int) +0:72 Constant: +0:72 2 (const uint) +0:74 move second child to first child ( temp 4-component vector of uint) +0:74 u: direct index for structure ( temp 4-component vector of uint) +0:74 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:74 Constant: +0:74 0 (const uint) +0:74 direct index ( temp uint) +0:74 'dti' ( in 3-component vector of uint) +0:74 Constant: +0:74 0 (const int) +0:74 Constant: +0:74 0 (const int) +0:74 subgroupQuadBroadcast ( temp 4-component vector of uint) +0:74 u: direct index for structure ( temp 4-component vector of uint) +0:74 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:74 Constant: +0:74 0 (const uint) +0:74 direct index ( temp uint) +0:74 'dti' ( in 3-component vector of uint) +0:74 Constant: +0:74 0 (const int) +0:74 Constant: +0:74 0 (const int) +0:74 Constant: +0:74 3 (const uint) +0:75 move second child to first child ( temp uint) +0:75 direct index ( temp uint) +0:75 u: direct index for structure ( temp 4-component vector of uint) +0:75 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:75 Constant: +0:75 0 (const uint) +0:75 direct index ( temp uint) +0:75 'dti' ( in 3-component vector of uint) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 subgroupQuadBroadcast ( temp uint) +0:75 direct index ( temp uint) +0:75 u: direct index for structure ( temp 4-component vector of uint) +0:75 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:75 Constant: +0:75 0 (const uint) +0:75 direct index ( temp uint) +0:75 'dti' ( in 3-component vector of uint) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 3 (const uint) +0:76 move second child to first child ( temp 2-component vector of uint) +0:76 vector swizzle ( temp 2-component vector of uint) +0:76 u: direct index for structure ( temp 4-component vector of uint) +0:76 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:76 Constant: +0:76 0 (const uint) +0:76 direct index ( temp uint) +0:76 'dti' ( in 3-component vector of uint) +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 0 (const int) +0:76 Sequence +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 1 (const int) +0:76 subgroupQuadBroadcast ( temp 2-component vector of uint) +0:76 vector swizzle ( temp 2-component vector of uint) +0:76 u: direct index for structure ( temp 4-component vector of uint) +0:76 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:76 Constant: +0:76 0 (const uint) +0:76 direct index ( temp uint) +0:76 'dti' ( in 3-component vector of uint) +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 0 (const int) +0:76 Sequence +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 1 (const int) +0:76 Constant: +0:76 3 (const uint) +0:77 move second child to first child ( temp 3-component vector of uint) +0:77 vector swizzle ( temp 3-component vector of uint) +0:77 u: direct index for structure ( temp 4-component vector of uint) +0:77 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:77 Constant: +0:77 0 (const uint) +0:77 direct index ( temp uint) +0:77 'dti' ( in 3-component vector of uint) +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 0 (const int) +0:77 Sequence +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 1 (const int) +0:77 Constant: +0:77 2 (const int) +0:77 subgroupQuadBroadcast ( temp 3-component vector of uint) +0:77 vector swizzle ( temp 3-component vector of uint) +0:77 u: direct index for structure ( temp 4-component vector of uint) +0:77 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:77 Constant: +0:77 0 (const uint) +0:77 direct index ( temp uint) +0:77 'dti' ( in 3-component vector of uint) +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 0 (const int) +0:77 Sequence +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 1 (const int) +0:77 Constant: +0:77 2 (const int) +0:77 Constant: +0:77 3 (const uint) +0:79 move second child to first child ( temp 4-component vector of int) +0:79 i: direct index for structure ( temp 4-component vector of int) +0:79 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:79 Constant: +0:79 0 (const uint) +0:79 direct index ( temp uint) +0:79 'dti' ( in 3-component vector of uint) +0:79 Constant: +0:79 0 (const int) +0:79 Constant: +0:79 1 (const int) +0:79 subgroupQuadBroadcast ( temp 4-component vector of int) +0:79 i: direct index for structure ( temp 4-component vector of int) +0:79 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:79 Constant: +0:79 0 (const uint) +0:79 direct index ( temp uint) +0:79 'dti' ( in 3-component vector of uint) +0:79 Constant: +0:79 0 (const int) +0:79 Constant: +0:79 1 (const int) +0:79 Constant: +0:79 3 (const uint) +0:80 move second child to first child ( temp int) +0:80 direct index ( temp int) +0:80 i: direct index for structure ( temp 4-component vector of int) +0:80 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:80 Constant: +0:80 0 (const uint) +0:80 direct index ( temp uint) +0:80 'dti' ( in 3-component vector of uint) +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 1 (const int) +0:80 Constant: +0:80 0 (const int) +0:80 subgroupQuadBroadcast ( temp int) +0:80 direct index ( temp int) +0:80 i: direct index for structure ( temp 4-component vector of int) +0:80 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:80 Constant: +0:80 0 (const uint) +0:80 direct index ( temp uint) +0:80 'dti' ( in 3-component vector of uint) +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 1 (const int) +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 3 (const uint) +0:81 move second child to first child ( temp 2-component vector of int) +0:81 vector swizzle ( temp 2-component vector of int) +0:81 i: direct index for structure ( temp 4-component vector of int) +0:81 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:81 Constant: +0:81 0 (const uint) +0:81 direct index ( temp uint) +0:81 'dti' ( in 3-component vector of uint) +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 Sequence +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 subgroupQuadBroadcast ( temp 2-component vector of int) +0:81 vector swizzle ( temp 2-component vector of int) +0:81 i: direct index for structure ( temp 4-component vector of int) +0:81 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:81 Constant: +0:81 0 (const uint) +0:81 direct index ( temp uint) +0:81 'dti' ( in 3-component vector of uint) +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 Sequence +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 Constant: +0:81 3 (const uint) +0:82 move second child to first child ( temp 3-component vector of int) +0:82 vector swizzle ( temp 3-component vector of int) +0:82 i: direct index for structure ( temp 4-component vector of int) +0:82 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:82 Constant: +0:82 0 (const uint) +0:82 direct index ( temp uint) +0:82 'dti' ( in 3-component vector of uint) +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Sequence +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Constant: +0:82 2 (const int) +0:82 subgroupQuadBroadcast ( temp 3-component vector of int) +0:82 vector swizzle ( temp 3-component vector of int) +0:82 i: direct index for structure ( temp 4-component vector of int) +0:82 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:82 Constant: +0:82 0 (const uint) +0:82 direct index ( temp uint) +0:82 'dti' ( in 3-component vector of uint) +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Sequence +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Constant: +0:82 2 (const int) +0:82 Constant: +0:82 3 (const uint) +0:84 move second child to first child ( temp 4-component vector of float) +0:84 f: direct index for structure ( temp 4-component vector of float) +0:84 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:84 Constant: +0:84 0 (const uint) +0:84 direct index ( temp uint) +0:84 'dti' ( in 3-component vector of uint) +0:84 Constant: +0:84 0 (const int) +0:84 Constant: +0:84 2 (const int) +0:84 subgroupQuadBroadcast ( temp 4-component vector of float) +0:84 f: direct index for structure ( temp 4-component vector of float) +0:84 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:84 Constant: +0:84 0 (const uint) +0:84 direct index ( temp uint) +0:84 'dti' ( in 3-component vector of uint) +0:84 Constant: +0:84 0 (const int) +0:84 Constant: +0:84 2 (const int) +0:84 Constant: +0:84 3 (const uint) +0:85 move second child to first child ( temp float) +0:85 direct index ( temp float) +0:85 f: direct index for structure ( temp 4-component vector of float) +0:85 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:85 Constant: +0:85 0 (const uint) +0:85 direct index ( temp uint) +0:85 'dti' ( in 3-component vector of uint) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 2 (const int) +0:85 Constant: +0:85 0 (const int) +0:85 subgroupQuadBroadcast ( temp float) +0:85 direct index ( temp float) +0:85 f: direct index for structure ( temp 4-component vector of float) +0:85 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:85 Constant: +0:85 0 (const uint) +0:85 direct index ( temp uint) +0:85 'dti' ( in 3-component vector of uint) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 2 (const int) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 3 (const uint) +0:86 move second child to first child ( temp 2-component vector of float) +0:86 vector swizzle ( temp 2-component vector of float) +0:86 f: direct index for structure ( temp 4-component vector of float) +0:86 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:86 Constant: +0:86 0 (const uint) +0:86 direct index ( temp uint) +0:86 'dti' ( in 3-component vector of uint) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 2 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:86 subgroupQuadBroadcast ( temp 2-component vector of float) +0:86 vector swizzle ( temp 2-component vector of float) +0:86 f: direct index for structure ( temp 4-component vector of float) +0:86 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:86 Constant: +0:86 0 (const uint) +0:86 direct index ( temp uint) +0:86 'dti' ( in 3-component vector of uint) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 2 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:86 Constant: +0:86 3 (const uint) +0:87 move second child to first child ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 f: direct index for structure ( temp 4-component vector of float) +0:87 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:87 Constant: +0:87 0 (const uint) +0:87 direct index ( temp uint) +0:87 'dti' ( in 3-component vector of uint) +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 subgroupQuadBroadcast ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 f: direct index for structure ( temp 4-component vector of float) +0:87 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:87 Constant: +0:87 0 (const uint) +0:87 direct index ( temp uint) +0:87 'dti' ( in 3-component vector of uint) +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 Constant: +0:87 3 (const uint) +0:89 move second child to first child ( temp 4-component vector of double) +0:89 d: direct index for structure ( temp 4-component vector of double) +0:89 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:89 Constant: +0:89 0 (const uint) +0:89 direct index ( temp uint) +0:89 'dti' ( in 3-component vector of uint) +0:89 Constant: +0:89 0 (const int) +0:89 Constant: +0:89 3 (const int) +0:89 subgroupQuadBroadcast ( temp 4-component vector of double) +0:89 d: direct index for structure ( temp 4-component vector of double) +0:89 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:89 Constant: +0:89 0 (const uint) +0:89 direct index ( temp uint) +0:89 'dti' ( in 3-component vector of uint) +0:89 Constant: +0:89 0 (const int) +0:89 Constant: +0:89 3 (const int) +0:89 Constant: +0:89 3 (const uint) +0:90 move second child to first child ( temp double) +0:90 direct index ( temp double) +0:90 d: direct index for structure ( temp 4-component vector of double) +0:90 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:90 Constant: +0:90 0 (const uint) +0:90 direct index ( temp uint) +0:90 'dti' ( in 3-component vector of uint) +0:90 Constant: +0:90 0 (const int) +0:90 Constant: +0:90 3 (const int) +0:90 Constant: +0:90 0 (const int) +0:90 subgroupQuadBroadcast ( temp double) +0:90 direct index ( temp double) +0:90 d: direct index for structure ( temp 4-component vector of double) +0:90 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:90 Constant: +0:90 0 (const uint) +0:90 direct index ( temp uint) +0:90 'dti' ( in 3-component vector of uint) +0:90 Constant: +0:90 0 (const int) +0:90 Constant: +0:90 3 (const int) +0:90 Constant: +0:90 0 (const int) +0:90 Constant: +0:90 3 (const uint) +0:91 move second child to first child ( temp 2-component vector of double) +0:91 vector swizzle ( temp 2-component vector of double) +0:91 d: direct index for structure ( temp 4-component vector of double) +0:91 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:91 Constant: +0:91 0 (const uint) +0:91 direct index ( temp uint) +0:91 'dti' ( in 3-component vector of uint) +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 3 (const int) +0:91 Sequence +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 1 (const int) +0:91 subgroupQuadBroadcast ( temp 2-component vector of double) +0:91 vector swizzle ( temp 2-component vector of double) +0:91 d: direct index for structure ( temp 4-component vector of double) +0:91 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:91 Constant: +0:91 0 (const uint) +0:91 direct index ( temp uint) +0:91 'dti' ( in 3-component vector of uint) +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 3 (const int) +0:91 Sequence +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 1 (const int) +0:91 Constant: +0:91 3 (const uint) +0:92 move second child to first child ( temp 3-component vector of double) +0:92 vector swizzle ( temp 3-component vector of double) +0:92 d: direct index for structure ( temp 4-component vector of double) +0:92 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:92 Constant: +0:92 0 (const uint) +0:92 direct index ( temp uint) +0:92 'dti' ( in 3-component vector of uint) +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 3 (const int) +0:92 Sequence +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 1 (const int) +0:92 Constant: +0:92 2 (const int) +0:92 subgroupQuadBroadcast ( temp 3-component vector of double) +0:92 vector swizzle ( temp 3-component vector of double) +0:92 d: direct index for structure ( temp 4-component vector of double) +0:92 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:92 Constant: +0:92 0 (const uint) +0:92 direct index ( temp uint) +0:92 'dti' ( in 3-component vector of uint) +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 3 (const int) +0:92 Sequence +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 1 (const int) +0:92 Constant: +0:92 2 (const int) +0:92 Constant: +0:92 3 (const uint) +0:94 move second child to first child ( temp 4-component vector of uint) +0:94 u: direct index for structure ( temp 4-component vector of uint) +0:94 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:94 Constant: +0:94 0 (const uint) +0:94 direct index ( temp uint) +0:94 'dti' ( in 3-component vector of uint) +0:94 Constant: +0:94 0 (const int) +0:94 Constant: +0:94 0 (const int) +0:94 subgroupQuadSwapHorizontal ( temp 4-component vector of uint) +0:94 u: direct index for structure ( temp 4-component vector of uint) +0:94 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:94 Constant: +0:94 0 (const uint) +0:94 direct index ( temp uint) +0:94 'dti' ( in 3-component vector of uint) +0:94 Constant: +0:94 0 (const int) +0:94 Constant: +0:94 0 (const int) +0:95 move second child to first child ( temp uint) +0:95 direct index ( temp uint) +0:95 u: direct index for structure ( temp 4-component vector of uint) +0:95 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:95 Constant: +0:95 0 (const uint) +0:95 direct index ( temp uint) +0:95 'dti' ( in 3-component vector of uint) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 subgroupQuadSwapHorizontal ( temp uint) +0:95 direct index ( temp uint) +0:95 u: direct index for structure ( temp 4-component vector of uint) +0:95 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:95 Constant: +0:95 0 (const uint) +0:95 direct index ( temp uint) +0:95 'dti' ( in 3-component vector of uint) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:96 move second child to first child ( temp 2-component vector of uint) +0:96 vector swizzle ( temp 2-component vector of uint) +0:96 u: direct index for structure ( temp 4-component vector of uint) +0:96 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:96 Constant: +0:96 0 (const uint) +0:96 direct index ( temp uint) +0:96 'dti' ( in 3-component vector of uint) +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 0 (const int) +0:96 Sequence +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 1 (const int) +0:96 subgroupQuadSwapHorizontal ( temp 2-component vector of uint) +0:96 vector swizzle ( temp 2-component vector of uint) +0:96 u: direct index for structure ( temp 4-component vector of uint) +0:96 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:96 Constant: +0:96 0 (const uint) +0:96 direct index ( temp uint) +0:96 'dti' ( in 3-component vector of uint) +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 0 (const int) +0:96 Sequence +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 1 (const int) +0:97 move second child to first child ( temp 3-component vector of uint) +0:97 vector swizzle ( temp 3-component vector of uint) +0:97 u: direct index for structure ( temp 4-component vector of uint) +0:97 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:97 Constant: +0:97 0 (const uint) +0:97 direct index ( temp uint) +0:97 'dti' ( in 3-component vector of uint) +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 0 (const int) +0:97 Sequence +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 1 (const int) +0:97 Constant: +0:97 2 (const int) +0:97 subgroupQuadSwapHorizontal ( temp 3-component vector of uint) +0:97 vector swizzle ( temp 3-component vector of uint) +0:97 u: direct index for structure ( temp 4-component vector of uint) +0:97 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:97 Constant: +0:97 0 (const uint) +0:97 direct index ( temp uint) +0:97 'dti' ( in 3-component vector of uint) +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 0 (const int) +0:97 Sequence +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 1 (const int) +0:97 Constant: +0:97 2 (const int) +0:99 move second child to first child ( temp 4-component vector of int) +0:99 i: direct index for structure ( temp 4-component vector of int) +0:99 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:99 Constant: +0:99 0 (const uint) +0:99 direct index ( temp uint) +0:99 'dti' ( in 3-component vector of uint) +0:99 Constant: +0:99 0 (const int) +0:99 Constant: +0:99 1 (const int) +0:99 subgroupQuadSwapHorizontal ( temp 4-component vector of int) +0:99 i: direct index for structure ( temp 4-component vector of int) +0:99 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:99 Constant: +0:99 0 (const uint) +0:99 direct index ( temp uint) +0:99 'dti' ( in 3-component vector of uint) +0:99 Constant: +0:99 0 (const int) +0:99 Constant: +0:99 1 (const int) +0:100 move second child to first child ( temp int) +0:100 direct index ( temp int) +0:100 i: direct index for structure ( temp 4-component vector of int) +0:100 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:100 Constant: +0:100 0 (const uint) +0:100 direct index ( temp uint) +0:100 'dti' ( in 3-component vector of uint) +0:100 Constant: +0:100 0 (const int) +0:100 Constant: +0:100 1 (const int) +0:100 Constant: +0:100 0 (const int) +0:100 subgroupQuadSwapHorizontal ( temp int) +0:100 direct index ( temp int) +0:100 i: direct index for structure ( temp 4-component vector of int) +0:100 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:100 Constant: +0:100 0 (const uint) +0:100 direct index ( temp uint) +0:100 'dti' ( in 3-component vector of uint) +0:100 Constant: +0:100 0 (const int) +0:100 Constant: +0:100 1 (const int) +0:100 Constant: +0:100 0 (const int) +0:101 move second child to first child ( temp 2-component vector of int) +0:101 vector swizzle ( temp 2-component vector of int) +0:101 i: direct index for structure ( temp 4-component vector of int) +0:101 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:101 Constant: +0:101 0 (const uint) +0:101 direct index ( temp uint) +0:101 'dti' ( in 3-component vector of uint) +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 Sequence +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 subgroupQuadSwapHorizontal ( temp 2-component vector of int) +0:101 vector swizzle ( temp 2-component vector of int) +0:101 i: direct index for structure ( temp 4-component vector of int) +0:101 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:101 Constant: +0:101 0 (const uint) +0:101 direct index ( temp uint) +0:101 'dti' ( in 3-component vector of uint) +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 Sequence +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:102 move second child to first child ( temp 3-component vector of int) +0:102 vector swizzle ( temp 3-component vector of int) +0:102 i: direct index for structure ( temp 4-component vector of int) +0:102 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:102 Constant: +0:102 0 (const uint) +0:102 direct index ( temp uint) +0:102 'dti' ( in 3-component vector of uint) +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Sequence +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Constant: +0:102 2 (const int) +0:102 subgroupQuadSwapHorizontal ( temp 3-component vector of int) +0:102 vector swizzle ( temp 3-component vector of int) +0:102 i: direct index for structure ( temp 4-component vector of int) +0:102 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:102 Constant: +0:102 0 (const uint) +0:102 direct index ( temp uint) +0:102 'dti' ( in 3-component vector of uint) +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Sequence +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Constant: +0:102 2 (const int) +0:104 move second child to first child ( temp 4-component vector of float) +0:104 f: direct index for structure ( temp 4-component vector of float) +0:104 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:104 Constant: +0:104 0 (const uint) +0:104 direct index ( temp uint) +0:104 'dti' ( in 3-component vector of uint) +0:104 Constant: +0:104 0 (const int) +0:104 Constant: +0:104 2 (const int) +0:104 subgroupQuadSwapHorizontal ( temp 4-component vector of float) +0:104 f: direct index for structure ( temp 4-component vector of float) +0:104 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:104 Constant: +0:104 0 (const uint) +0:104 direct index ( temp uint) +0:104 'dti' ( in 3-component vector of uint) +0:104 Constant: +0:104 0 (const int) +0:104 Constant: +0:104 2 (const int) +0:105 move second child to first child ( temp float) +0:105 direct index ( temp float) +0:105 f: direct index for structure ( temp 4-component vector of float) +0:105 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:105 Constant: +0:105 0 (const uint) +0:105 direct index ( temp uint) +0:105 'dti' ( in 3-component vector of uint) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 2 (const int) +0:105 Constant: +0:105 0 (const int) +0:105 subgroupQuadSwapHorizontal ( temp float) +0:105 direct index ( temp float) +0:105 f: direct index for structure ( temp 4-component vector of float) +0:105 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:105 Constant: +0:105 0 (const uint) +0:105 direct index ( temp uint) +0:105 'dti' ( in 3-component vector of uint) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 2 (const int) +0:105 Constant: +0:105 0 (const int) +0:106 move second child to first child ( temp 2-component vector of float) +0:106 vector swizzle ( temp 2-component vector of float) +0:106 f: direct index for structure ( temp 4-component vector of float) +0:106 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:106 Constant: +0:106 0 (const uint) +0:106 direct index ( temp uint) +0:106 'dti' ( in 3-component vector of uint) +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 2 (const int) +0:106 Sequence +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 1 (const int) +0:106 subgroupQuadSwapHorizontal ( temp 2-component vector of float) +0:106 vector swizzle ( temp 2-component vector of float) +0:106 f: direct index for structure ( temp 4-component vector of float) +0:106 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:106 Constant: +0:106 0 (const uint) +0:106 direct index ( temp uint) +0:106 'dti' ( in 3-component vector of uint) +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 2 (const int) +0:106 Sequence +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 1 (const int) +0:107 move second child to first child ( temp 3-component vector of float) +0:107 vector swizzle ( temp 3-component vector of float) +0:107 f: direct index for structure ( temp 4-component vector of float) +0:107 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:107 Constant: +0:107 0 (const uint) +0:107 direct index ( temp uint) +0:107 'dti' ( in 3-component vector of uint) +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 2 (const int) +0:107 Sequence +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 1 (const int) +0:107 Constant: +0:107 2 (const int) +0:107 subgroupQuadSwapHorizontal ( temp 3-component vector of float) +0:107 vector swizzle ( temp 3-component vector of float) +0:107 f: direct index for structure ( temp 4-component vector of float) +0:107 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:107 Constant: +0:107 0 (const uint) +0:107 direct index ( temp uint) +0:107 'dti' ( in 3-component vector of uint) +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 2 (const int) +0:107 Sequence +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 1 (const int) +0:107 Constant: +0:107 2 (const int) +0:109 move second child to first child ( temp 4-component vector of double) +0:109 d: direct index for structure ( temp 4-component vector of double) +0:109 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:109 Constant: +0:109 0 (const uint) +0:109 direct index ( temp uint) +0:109 'dti' ( in 3-component vector of uint) +0:109 Constant: +0:109 0 (const int) +0:109 Constant: +0:109 3 (const int) +0:109 subgroupQuadSwapHorizontal ( temp 4-component vector of double) +0:109 d: direct index for structure ( temp 4-component vector of double) +0:109 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:109 Constant: +0:109 0 (const uint) +0:109 direct index ( temp uint) +0:109 'dti' ( in 3-component vector of uint) +0:109 Constant: +0:109 0 (const int) +0:109 Constant: +0:109 3 (const int) +0:110 move second child to first child ( temp double) +0:110 direct index ( temp double) +0:110 d: direct index for structure ( temp 4-component vector of double) +0:110 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:110 Constant: +0:110 0 (const uint) +0:110 direct index ( temp uint) +0:110 'dti' ( in 3-component vector of uint) +0:110 Constant: +0:110 0 (const int) +0:110 Constant: +0:110 3 (const int) +0:110 Constant: +0:110 0 (const int) +0:110 subgroupQuadSwapHorizontal ( temp double) +0:110 direct index ( temp double) +0:110 d: direct index for structure ( temp 4-component vector of double) +0:110 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:110 Constant: +0:110 0 (const uint) +0:110 direct index ( temp uint) +0:110 'dti' ( in 3-component vector of uint) +0:110 Constant: +0:110 0 (const int) +0:110 Constant: +0:110 3 (const int) +0:110 Constant: +0:110 0 (const int) +0:111 move second child to first child ( temp 2-component vector of double) +0:111 vector swizzle ( temp 2-component vector of double) +0:111 d: direct index for structure ( temp 4-component vector of double) +0:111 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:111 Constant: +0:111 0 (const uint) +0:111 direct index ( temp uint) +0:111 'dti' ( in 3-component vector of uint) +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 3 (const int) +0:111 Sequence +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:111 subgroupQuadSwapHorizontal ( temp 2-component vector of double) +0:111 vector swizzle ( temp 2-component vector of double) +0:111 d: direct index for structure ( temp 4-component vector of double) +0:111 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:111 Constant: +0:111 0 (const uint) +0:111 direct index ( temp uint) +0:111 'dti' ( in 3-component vector of uint) +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 3 (const int) +0:111 Sequence +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:112 move second child to first child ( temp 3-component vector of double) +0:112 vector swizzle ( temp 3-component vector of double) +0:112 d: direct index for structure ( temp 4-component vector of double) +0:112 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:112 Constant: +0:112 0 (const uint) +0:112 direct index ( temp uint) +0:112 'dti' ( in 3-component vector of uint) +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 3 (const int) +0:112 Sequence +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Constant: +0:112 2 (const int) +0:112 subgroupQuadSwapHorizontal ( temp 3-component vector of double) +0:112 vector swizzle ( temp 3-component vector of double) +0:112 d: direct index for structure ( temp 4-component vector of double) +0:112 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:112 Constant: +0:112 0 (const uint) +0:112 direct index ( temp uint) +0:112 'dti' ( in 3-component vector of uint) +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 3 (const int) +0:112 Sequence +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Constant: +0:112 2 (const int) +0:114 move second child to first child ( temp 4-component vector of uint) +0:114 u: direct index for structure ( temp 4-component vector of uint) +0:114 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:114 Constant: +0:114 0 (const uint) +0:114 direct index ( temp uint) +0:114 'dti' ( in 3-component vector of uint) +0:114 Constant: +0:114 0 (const int) +0:114 Constant: +0:114 0 (const int) +0:114 subgroupQuadSwapVertical ( temp 4-component vector of uint) +0:114 u: direct index for structure ( temp 4-component vector of uint) +0:114 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:114 Constant: +0:114 0 (const uint) +0:114 direct index ( temp uint) +0:114 'dti' ( in 3-component vector of uint) +0:114 Constant: +0:114 0 (const int) +0:114 Constant: +0:114 0 (const int) +0:115 move second child to first child ( temp uint) +0:115 direct index ( temp uint) +0:115 u: direct index for structure ( temp 4-component vector of uint) +0:115 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:115 Constant: +0:115 0 (const uint) +0:115 direct index ( temp uint) +0:115 'dti' ( in 3-component vector of uint) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 subgroupQuadSwapVertical ( temp uint) +0:115 direct index ( temp uint) +0:115 u: direct index for structure ( temp 4-component vector of uint) +0:115 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:115 Constant: +0:115 0 (const uint) +0:115 direct index ( temp uint) +0:115 'dti' ( in 3-component vector of uint) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:116 move second child to first child ( temp 2-component vector of uint) +0:116 vector swizzle ( temp 2-component vector of uint) +0:116 u: direct index for structure ( temp 4-component vector of uint) +0:116 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:116 Constant: +0:116 0 (const uint) +0:116 direct index ( temp uint) +0:116 'dti' ( in 3-component vector of uint) +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 0 (const int) +0:116 Sequence +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 1 (const int) +0:116 subgroupQuadSwapVertical ( temp 2-component vector of uint) +0:116 vector swizzle ( temp 2-component vector of uint) +0:116 u: direct index for structure ( temp 4-component vector of uint) +0:116 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:116 Constant: +0:116 0 (const uint) +0:116 direct index ( temp uint) +0:116 'dti' ( in 3-component vector of uint) +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 0 (const int) +0:116 Sequence +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 1 (const int) +0:117 move second child to first child ( temp 3-component vector of uint) +0:117 vector swizzle ( temp 3-component vector of uint) +0:117 u: direct index for structure ( temp 4-component vector of uint) +0:117 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:117 Constant: +0:117 0 (const uint) +0:117 direct index ( temp uint) +0:117 'dti' ( in 3-component vector of uint) +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 0 (const int) +0:117 Sequence +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 1 (const int) +0:117 Constant: +0:117 2 (const int) +0:117 subgroupQuadSwapVertical ( temp 3-component vector of uint) +0:117 vector swizzle ( temp 3-component vector of uint) +0:117 u: direct index for structure ( temp 4-component vector of uint) +0:117 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:117 Constant: +0:117 0 (const uint) +0:117 direct index ( temp uint) +0:117 'dti' ( in 3-component vector of uint) +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 0 (const int) +0:117 Sequence +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 1 (const int) +0:117 Constant: +0:117 2 (const int) +0:119 move second child to first child ( temp 4-component vector of int) +0:119 i: direct index for structure ( temp 4-component vector of int) +0:119 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:119 Constant: +0:119 0 (const uint) +0:119 direct index ( temp uint) +0:119 'dti' ( in 3-component vector of uint) +0:119 Constant: +0:119 0 (const int) +0:119 Constant: +0:119 1 (const int) +0:119 subgroupQuadSwapVertical ( temp 4-component vector of int) +0:119 i: direct index for structure ( temp 4-component vector of int) +0:119 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:119 Constant: +0:119 0 (const uint) +0:119 direct index ( temp uint) +0:119 'dti' ( in 3-component vector of uint) +0:119 Constant: +0:119 0 (const int) +0:119 Constant: +0:119 1 (const int) +0:120 move second child to first child ( temp int) +0:120 direct index ( temp int) +0:120 i: direct index for structure ( temp 4-component vector of int) +0:120 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:120 Constant: +0:120 0 (const uint) +0:120 direct index ( temp uint) +0:120 'dti' ( in 3-component vector of uint) +0:120 Constant: +0:120 0 (const int) +0:120 Constant: +0:120 1 (const int) +0:120 Constant: +0:120 0 (const int) +0:120 subgroupQuadSwapVertical ( temp int) +0:120 direct index ( temp int) +0:120 i: direct index for structure ( temp 4-component vector of int) +0:120 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:120 Constant: +0:120 0 (const uint) +0:120 direct index ( temp uint) +0:120 'dti' ( in 3-component vector of uint) +0:120 Constant: +0:120 0 (const int) +0:120 Constant: +0:120 1 (const int) +0:120 Constant: +0:120 0 (const int) +0:121 move second child to first child ( temp 2-component vector of int) +0:121 vector swizzle ( temp 2-component vector of int) +0:121 i: direct index for structure ( temp 4-component vector of int) +0:121 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:121 Constant: +0:121 0 (const uint) +0:121 direct index ( temp uint) +0:121 'dti' ( in 3-component vector of uint) +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 Sequence +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 subgroupQuadSwapVertical ( temp 2-component vector of int) +0:121 vector swizzle ( temp 2-component vector of int) +0:121 i: direct index for structure ( temp 4-component vector of int) +0:121 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:121 Constant: +0:121 0 (const uint) +0:121 direct index ( temp uint) +0:121 'dti' ( in 3-component vector of uint) +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 Sequence +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:122 move second child to first child ( temp 3-component vector of int) +0:122 vector swizzle ( temp 3-component vector of int) +0:122 i: direct index for structure ( temp 4-component vector of int) +0:122 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:122 Constant: +0:122 0 (const uint) +0:122 direct index ( temp uint) +0:122 'dti' ( in 3-component vector of uint) +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Sequence +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Constant: +0:122 2 (const int) +0:122 subgroupQuadSwapVertical ( temp 3-component vector of int) +0:122 vector swizzle ( temp 3-component vector of int) +0:122 i: direct index for structure ( temp 4-component vector of int) +0:122 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:122 Constant: +0:122 0 (const uint) +0:122 direct index ( temp uint) +0:122 'dti' ( in 3-component vector of uint) +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Sequence +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Constant: +0:122 2 (const int) +0:124 move second child to first child ( temp 4-component vector of float) +0:124 f: direct index for structure ( temp 4-component vector of float) +0:124 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:124 Constant: +0:124 0 (const uint) +0:124 direct index ( temp uint) +0:124 'dti' ( in 3-component vector of uint) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 2 (const int) +0:124 subgroupQuadSwapVertical ( temp 4-component vector of float) +0:124 f: direct index for structure ( temp 4-component vector of float) +0:124 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:124 Constant: +0:124 0 (const uint) +0:124 direct index ( temp uint) +0:124 'dti' ( in 3-component vector of uint) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 2 (const int) +0:125 move second child to first child ( temp float) +0:125 direct index ( temp float) +0:125 f: direct index for structure ( temp 4-component vector of float) +0:125 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:125 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:125 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:125 Constant: +0:125 0 (const uint) +0:125 direct index ( temp uint) +0:125 'dti' ( in 3-component vector of uint) +0:125 Constant: +0:125 0 (const int) +0:125 Constant: +0:125 2 (const int) +0:125 Constant: +0:125 0 (const int) +0:125 subgroupQuadSwapVertical ( temp float) +0:125 direct index ( temp float) +0:125 f: direct index for structure ( temp 4-component vector of float) +0:125 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:125 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:125 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:125 Constant: +0:125 0 (const uint) +0:125 direct index ( temp uint) +0:125 'dti' ( in 3-component vector of uint) +0:125 Constant: +0:125 0 (const int) +0:125 Constant: +0:125 2 (const int) +0:125 Constant: +0:125 0 (const int) +0:126 move second child to first child ( temp 2-component vector of float) +0:126 vector swizzle ( temp 2-component vector of float) +0:126 f: direct index for structure ( temp 4-component vector of float) +0:126 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:126 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:126 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:126 Constant: +0:126 0 (const uint) +0:126 direct index ( temp uint) +0:126 'dti' ( in 3-component vector of uint) +0:126 Constant: +0:126 0 (const int) +0:126 Constant: +0:126 2 (const int) +0:126 Sequence +0:126 Constant: +0:126 0 (const int) +0:126 Constant: +0:126 1 (const int) +0:126 subgroupQuadSwapVertical ( temp 2-component vector of float) +0:126 vector swizzle ( temp 2-component vector of float) +0:126 f: direct index for structure ( temp 4-component vector of float) +0:126 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:126 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:126 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:126 Constant: +0:126 0 (const uint) +0:126 direct index ( temp uint) +0:126 'dti' ( in 3-component vector of uint) +0:126 Constant: +0:126 0 (const int) +0:126 Constant: +0:126 2 (const int) +0:126 Sequence +0:126 Constant: +0:126 0 (const int) +0:126 Constant: +0:126 1 (const int) +0:127 move second child to first child ( temp 3-component vector of float) +0:127 vector swizzle ( temp 3-component vector of float) +0:127 f: direct index for structure ( temp 4-component vector of float) +0:127 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:127 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:127 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:127 Constant: +0:127 0 (const uint) +0:127 direct index ( temp uint) +0:127 'dti' ( in 3-component vector of uint) +0:127 Constant: +0:127 0 (const int) +0:127 Constant: +0:127 2 (const int) +0:127 Sequence +0:127 Constant: +0:127 0 (const int) +0:127 Constant: +0:127 1 (const int) +0:127 Constant: +0:127 2 (const int) +0:127 subgroupQuadSwapVertical ( temp 3-component vector of float) +0:127 vector swizzle ( temp 3-component vector of float) +0:127 f: direct index for structure ( temp 4-component vector of float) +0:127 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:127 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:127 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:127 Constant: +0:127 0 (const uint) +0:127 direct index ( temp uint) +0:127 'dti' ( in 3-component vector of uint) +0:127 Constant: +0:127 0 (const int) +0:127 Constant: +0:127 2 (const int) +0:127 Sequence +0:127 Constant: +0:127 0 (const int) +0:127 Constant: +0:127 1 (const int) +0:127 Constant: +0:127 2 (const int) +0:129 move second child to first child ( temp 4-component vector of double) +0:129 d: direct index for structure ( temp 4-component vector of double) +0:129 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:129 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:129 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:129 Constant: +0:129 0 (const uint) +0:129 direct index ( temp uint) +0:129 'dti' ( in 3-component vector of uint) +0:129 Constant: +0:129 0 (const int) +0:129 Constant: +0:129 3 (const int) +0:129 subgroupQuadSwapVertical ( temp 4-component vector of double) +0:129 d: direct index for structure ( temp 4-component vector of double) +0:129 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:129 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:129 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:129 Constant: +0:129 0 (const uint) +0:129 direct index ( temp uint) +0:129 'dti' ( in 3-component vector of uint) +0:129 Constant: +0:129 0 (const int) +0:129 Constant: +0:129 3 (const int) +0:130 move second child to first child ( temp double) +0:130 direct index ( temp double) +0:130 d: direct index for structure ( temp 4-component vector of double) +0:130 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:130 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:130 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:130 Constant: +0:130 0 (const uint) +0:130 direct index ( temp uint) +0:130 'dti' ( in 3-component vector of uint) +0:130 Constant: +0:130 0 (const int) +0:130 Constant: +0:130 3 (const int) +0:130 Constant: +0:130 0 (const int) +0:130 subgroupQuadSwapVertical ( temp double) +0:130 direct index ( temp double) +0:130 d: direct index for structure ( temp 4-component vector of double) +0:130 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:130 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:130 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:130 Constant: +0:130 0 (const uint) +0:130 direct index ( temp uint) +0:130 'dti' ( in 3-component vector of uint) +0:130 Constant: +0:130 0 (const int) +0:130 Constant: +0:130 3 (const int) +0:130 Constant: +0:130 0 (const int) +0:131 move second child to first child ( temp 2-component vector of double) +0:131 vector swizzle ( temp 2-component vector of double) +0:131 d: direct index for structure ( temp 4-component vector of double) +0:131 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:131 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:131 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:131 Constant: +0:131 0 (const uint) +0:131 direct index ( temp uint) +0:131 'dti' ( in 3-component vector of uint) +0:131 Constant: +0:131 0 (const int) +0:131 Constant: +0:131 3 (const int) +0:131 Sequence +0:131 Constant: +0:131 0 (const int) +0:131 Constant: +0:131 1 (const int) +0:131 subgroupQuadSwapVertical ( temp 2-component vector of double) +0:131 vector swizzle ( temp 2-component vector of double) +0:131 d: direct index for structure ( temp 4-component vector of double) +0:131 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:131 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:131 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:131 Constant: +0:131 0 (const uint) +0:131 direct index ( temp uint) +0:131 'dti' ( in 3-component vector of uint) +0:131 Constant: +0:131 0 (const int) +0:131 Constant: +0:131 3 (const int) +0:131 Sequence +0:131 Constant: +0:131 0 (const int) +0:131 Constant: +0:131 1 (const int) +0:132 move second child to first child ( temp 3-component vector of double) +0:132 vector swizzle ( temp 3-component vector of double) +0:132 d: direct index for structure ( temp 4-component vector of double) +0:132 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:132 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:132 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:132 Constant: +0:132 0 (const uint) +0:132 direct index ( temp uint) +0:132 'dti' ( in 3-component vector of uint) +0:132 Constant: +0:132 0 (const int) +0:132 Constant: +0:132 3 (const int) +0:132 Sequence +0:132 Constant: +0:132 0 (const int) +0:132 Constant: +0:132 1 (const int) +0:132 Constant: +0:132 2 (const int) +0:132 subgroupQuadSwapVertical ( temp 3-component vector of double) +0:132 vector swizzle ( temp 3-component vector of double) +0:132 d: direct index for structure ( temp 4-component vector of double) +0:132 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:132 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:132 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:132 Constant: +0:132 0 (const uint) +0:132 direct index ( temp uint) +0:132 'dti' ( in 3-component vector of uint) +0:132 Constant: +0:132 0 (const int) +0:132 Constant: +0:132 3 (const int) +0:132 Sequence +0:132 Constant: +0:132 0 (const int) +0:132 Constant: +0:132 1 (const int) +0:132 Constant: +0:132 2 (const int) +0:134 move second child to first child ( temp 4-component vector of uint) +0:134 u: direct index for structure ( temp 4-component vector of uint) +0:134 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:134 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:134 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:134 Constant: +0:134 0 (const uint) +0:134 direct index ( temp uint) +0:134 'dti' ( in 3-component vector of uint) +0:134 Constant: +0:134 0 (const int) +0:134 Constant: +0:134 0 (const int) +0:134 subgroupQuadSwapDiagonal ( temp 4-component vector of uint) +0:134 u: direct index for structure ( temp 4-component vector of uint) +0:134 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:134 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:134 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:134 Constant: +0:134 0 (const uint) +0:134 direct index ( temp uint) +0:134 'dti' ( in 3-component vector of uint) +0:134 Constant: +0:134 0 (const int) +0:134 Constant: +0:134 0 (const int) +0:135 move second child to first child ( temp uint) +0:135 direct index ( temp uint) +0:135 u: direct index for structure ( temp 4-component vector of uint) +0:135 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:135 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:135 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:135 Constant: +0:135 0 (const uint) +0:135 direct index ( temp uint) +0:135 'dti' ( in 3-component vector of uint) +0:135 Constant: +0:135 0 (const int) +0:135 Constant: +0:135 0 (const int) +0:135 Constant: +0:135 0 (const int) +0:135 subgroupQuadSwapDiagonal ( temp uint) +0:135 direct index ( temp uint) +0:135 u: direct index for structure ( temp 4-component vector of uint) +0:135 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:135 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:135 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:135 Constant: +0:135 0 (const uint) +0:135 direct index ( temp uint) +0:135 'dti' ( in 3-component vector of uint) +0:135 Constant: +0:135 0 (const int) +0:135 Constant: +0:135 0 (const int) +0:135 Constant: +0:135 0 (const int) +0:136 move second child to first child ( temp 2-component vector of uint) +0:136 vector swizzle ( temp 2-component vector of uint) +0:136 u: direct index for structure ( temp 4-component vector of uint) +0:136 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:136 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:136 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:136 Constant: +0:136 0 (const uint) +0:136 direct index ( temp uint) +0:136 'dti' ( in 3-component vector of uint) +0:136 Constant: +0:136 0 (const int) +0:136 Constant: +0:136 0 (const int) +0:136 Sequence +0:136 Constant: +0:136 0 (const int) +0:136 Constant: +0:136 1 (const int) +0:136 subgroupQuadSwapDiagonal ( temp 2-component vector of uint) +0:136 vector swizzle ( temp 2-component vector of uint) +0:136 u: direct index for structure ( temp 4-component vector of uint) +0:136 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:136 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:136 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:136 Constant: +0:136 0 (const uint) +0:136 direct index ( temp uint) +0:136 'dti' ( in 3-component vector of uint) +0:136 Constant: +0:136 0 (const int) +0:136 Constant: +0:136 0 (const int) +0:136 Sequence +0:136 Constant: +0:136 0 (const int) +0:136 Constant: +0:136 1 (const int) +0:137 move second child to first child ( temp 3-component vector of uint) +0:137 vector swizzle ( temp 3-component vector of uint) +0:137 u: direct index for structure ( temp 4-component vector of uint) +0:137 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:137 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:137 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:137 Constant: +0:137 0 (const uint) +0:137 direct index ( temp uint) +0:137 'dti' ( in 3-component vector of uint) +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 0 (const int) +0:137 Sequence +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 1 (const int) +0:137 Constant: +0:137 2 (const int) +0:137 subgroupQuadSwapDiagonal ( temp 3-component vector of uint) +0:137 vector swizzle ( temp 3-component vector of uint) +0:137 u: direct index for structure ( temp 4-component vector of uint) +0:137 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:137 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:137 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:137 Constant: +0:137 0 (const uint) +0:137 direct index ( temp uint) +0:137 'dti' ( in 3-component vector of uint) +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 0 (const int) +0:137 Sequence +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 1 (const int) +0:137 Constant: +0:137 2 (const int) +0:139 move second child to first child ( temp 4-component vector of int) +0:139 i: direct index for structure ( temp 4-component vector of int) +0:139 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:139 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:139 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:139 Constant: +0:139 0 (const uint) +0:139 direct index ( temp uint) +0:139 'dti' ( in 3-component vector of uint) +0:139 Constant: +0:139 0 (const int) +0:139 Constant: +0:139 1 (const int) +0:139 subgroupQuadSwapDiagonal ( temp 4-component vector of int) +0:139 i: direct index for structure ( temp 4-component vector of int) +0:139 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:139 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:139 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:139 Constant: +0:139 0 (const uint) +0:139 direct index ( temp uint) +0:139 'dti' ( in 3-component vector of uint) +0:139 Constant: +0:139 0 (const int) +0:139 Constant: +0:139 1 (const int) +0:140 move second child to first child ( temp int) +0:140 direct index ( temp int) +0:140 i: direct index for structure ( temp 4-component vector of int) +0:140 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:140 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:140 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:140 Constant: +0:140 0 (const uint) +0:140 direct index ( temp uint) +0:140 'dti' ( in 3-component vector of uint) +0:140 Constant: +0:140 0 (const int) +0:140 Constant: +0:140 1 (const int) +0:140 Constant: +0:140 0 (const int) +0:140 subgroupQuadSwapDiagonal ( temp int) +0:140 direct index ( temp int) +0:140 i: direct index for structure ( temp 4-component vector of int) +0:140 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:140 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:140 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:140 Constant: +0:140 0 (const uint) +0:140 direct index ( temp uint) +0:140 'dti' ( in 3-component vector of uint) +0:140 Constant: +0:140 0 (const int) +0:140 Constant: +0:140 1 (const int) +0:140 Constant: +0:140 0 (const int) +0:141 move second child to first child ( temp 2-component vector of int) +0:141 vector swizzle ( temp 2-component vector of int) +0:141 i: direct index for structure ( temp 4-component vector of int) +0:141 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:141 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:141 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:141 Constant: +0:141 0 (const uint) +0:141 direct index ( temp uint) +0:141 'dti' ( in 3-component vector of uint) +0:141 Constant: +0:141 0 (const int) +0:141 Constant: +0:141 1 (const int) +0:141 Sequence +0:141 Constant: +0:141 0 (const int) +0:141 Constant: +0:141 1 (const int) +0:141 subgroupQuadSwapDiagonal ( temp 2-component vector of int) +0:141 vector swizzle ( temp 2-component vector of int) +0:141 i: direct index for structure ( temp 4-component vector of int) +0:141 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:141 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:141 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:141 Constant: +0:141 0 (const uint) +0:141 direct index ( temp uint) +0:141 'dti' ( in 3-component vector of uint) +0:141 Constant: +0:141 0 (const int) +0:141 Constant: +0:141 1 (const int) +0:141 Sequence +0:141 Constant: +0:141 0 (const int) +0:141 Constant: +0:141 1 (const int) +0:142 move second child to first child ( temp 3-component vector of int) +0:142 vector swizzle ( temp 3-component vector of int) +0:142 i: direct index for structure ( temp 4-component vector of int) +0:142 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:142 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:142 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:142 Constant: +0:142 0 (const uint) +0:142 direct index ( temp uint) +0:142 'dti' ( in 3-component vector of uint) +0:142 Constant: +0:142 0 (const int) +0:142 Constant: +0:142 1 (const int) +0:142 Sequence +0:142 Constant: +0:142 0 (const int) +0:142 Constant: +0:142 1 (const int) +0:142 Constant: +0:142 2 (const int) +0:142 subgroupQuadSwapDiagonal ( temp 3-component vector of int) +0:142 vector swizzle ( temp 3-component vector of int) +0:142 i: direct index for structure ( temp 4-component vector of int) +0:142 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:142 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:142 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:142 Constant: +0:142 0 (const uint) +0:142 direct index ( temp uint) +0:142 'dti' ( in 3-component vector of uint) +0:142 Constant: +0:142 0 (const int) +0:142 Constant: +0:142 1 (const int) +0:142 Sequence +0:142 Constant: +0:142 0 (const int) +0:142 Constant: +0:142 1 (const int) +0:142 Constant: +0:142 2 (const int) +0:144 move second child to first child ( temp 4-component vector of float) +0:144 f: direct index for structure ( temp 4-component vector of float) +0:144 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:144 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:144 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:144 Constant: +0:144 0 (const uint) +0:144 direct index ( temp uint) +0:144 'dti' ( in 3-component vector of uint) +0:144 Constant: +0:144 0 (const int) +0:144 Constant: +0:144 2 (const int) +0:144 subgroupQuadSwapDiagonal ( temp 4-component vector of float) +0:144 f: direct index for structure ( temp 4-component vector of float) +0:144 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:144 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:144 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:144 Constant: +0:144 0 (const uint) +0:144 direct index ( temp uint) +0:144 'dti' ( in 3-component vector of uint) +0:144 Constant: +0:144 0 (const int) +0:144 Constant: +0:144 2 (const int) +0:145 move second child to first child ( temp float) +0:145 direct index ( temp float) +0:145 f: direct index for structure ( temp 4-component vector of float) +0:145 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:145 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:145 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:145 Constant: +0:145 0 (const uint) +0:145 direct index ( temp uint) +0:145 'dti' ( in 3-component vector of uint) +0:145 Constant: +0:145 0 (const int) +0:145 Constant: +0:145 2 (const int) +0:145 Constant: +0:145 0 (const int) +0:145 subgroupQuadSwapDiagonal ( temp float) +0:145 direct index ( temp float) +0:145 f: direct index for structure ( temp 4-component vector of float) +0:145 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:145 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:145 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:145 Constant: +0:145 0 (const uint) +0:145 direct index ( temp uint) +0:145 'dti' ( in 3-component vector of uint) +0:145 Constant: +0:145 0 (const int) +0:145 Constant: +0:145 2 (const int) +0:145 Constant: +0:145 0 (const int) +0:146 move second child to first child ( temp 2-component vector of float) +0:146 vector swizzle ( temp 2-component vector of float) +0:146 f: direct index for structure ( temp 4-component vector of float) +0:146 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:146 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:146 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:146 Constant: +0:146 0 (const uint) +0:146 direct index ( temp uint) +0:146 'dti' ( in 3-component vector of uint) +0:146 Constant: +0:146 0 (const int) +0:146 Constant: +0:146 2 (const int) +0:146 Sequence +0:146 Constant: +0:146 0 (const int) +0:146 Constant: +0:146 1 (const int) +0:146 subgroupQuadSwapDiagonal ( temp 2-component vector of float) +0:146 vector swizzle ( temp 2-component vector of float) +0:146 f: direct index for structure ( temp 4-component vector of float) +0:146 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:146 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:146 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:146 Constant: +0:146 0 (const uint) +0:146 direct index ( temp uint) +0:146 'dti' ( in 3-component vector of uint) +0:146 Constant: +0:146 0 (const int) +0:146 Constant: +0:146 2 (const int) +0:146 Sequence +0:146 Constant: +0:146 0 (const int) +0:146 Constant: +0:146 1 (const int) +0:147 move second child to first child ( temp 3-component vector of float) +0:147 vector swizzle ( temp 3-component vector of float) +0:147 f: direct index for structure ( temp 4-component vector of float) +0:147 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:147 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:147 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:147 Constant: +0:147 0 (const uint) +0:147 direct index ( temp uint) +0:147 'dti' ( in 3-component vector of uint) +0:147 Constant: +0:147 0 (const int) +0:147 Constant: +0:147 2 (const int) +0:147 Sequence +0:147 Constant: +0:147 0 (const int) +0:147 Constant: +0:147 1 (const int) +0:147 Constant: +0:147 2 (const int) +0:147 subgroupQuadSwapDiagonal ( temp 3-component vector of float) +0:147 vector swizzle ( temp 3-component vector of float) +0:147 f: direct index for structure ( temp 4-component vector of float) +0:147 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:147 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:147 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:147 Constant: +0:147 0 (const uint) +0:147 direct index ( temp uint) +0:147 'dti' ( in 3-component vector of uint) +0:147 Constant: +0:147 0 (const int) +0:147 Constant: +0:147 2 (const int) +0:147 Sequence +0:147 Constant: +0:147 0 (const int) +0:147 Constant: +0:147 1 (const int) +0:147 Constant: +0:147 2 (const int) +0:149 move second child to first child ( temp 4-component vector of double) +0:149 d: direct index for structure ( temp 4-component vector of double) +0:149 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:149 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:149 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:149 Constant: +0:149 0 (const uint) +0:149 direct index ( temp uint) +0:149 'dti' ( in 3-component vector of uint) +0:149 Constant: +0:149 0 (const int) +0:149 Constant: +0:149 3 (const int) +0:149 subgroupQuadSwapDiagonal ( temp 4-component vector of double) +0:149 d: direct index for structure ( temp 4-component vector of double) +0:149 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:149 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:149 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:149 Constant: +0:149 0 (const uint) +0:149 direct index ( temp uint) +0:149 'dti' ( in 3-component vector of uint) +0:149 Constant: +0:149 0 (const int) +0:149 Constant: +0:149 3 (const int) +0:150 move second child to first child ( temp double) +0:150 direct index ( temp double) +0:150 d: direct index for structure ( temp 4-component vector of double) +0:150 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:150 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:150 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:150 Constant: +0:150 0 (const uint) +0:150 direct index ( temp uint) +0:150 'dti' ( in 3-component vector of uint) +0:150 Constant: +0:150 0 (const int) +0:150 Constant: +0:150 3 (const int) +0:150 Constant: +0:150 0 (const int) +0:150 subgroupQuadSwapDiagonal ( temp double) +0:150 direct index ( temp double) +0:150 d: direct index for structure ( temp 4-component vector of double) +0:150 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:150 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:150 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:150 Constant: +0:150 0 (const uint) +0:150 direct index ( temp uint) +0:150 'dti' ( in 3-component vector of uint) +0:150 Constant: +0:150 0 (const int) +0:150 Constant: +0:150 3 (const int) +0:150 Constant: +0:150 0 (const int) +0:151 move second child to first child ( temp 2-component vector of double) +0:151 vector swizzle ( temp 2-component vector of double) +0:151 d: direct index for structure ( temp 4-component vector of double) +0:151 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:151 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:151 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:151 Constant: +0:151 0 (const uint) +0:151 direct index ( temp uint) +0:151 'dti' ( in 3-component vector of uint) +0:151 Constant: +0:151 0 (const int) +0:151 Constant: +0:151 3 (const int) +0:151 Sequence +0:151 Constant: +0:151 0 (const int) +0:151 Constant: +0:151 1 (const int) +0:151 subgroupQuadSwapDiagonal ( temp 2-component vector of double) +0:151 vector swizzle ( temp 2-component vector of double) +0:151 d: direct index for structure ( temp 4-component vector of double) +0:151 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:151 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:151 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:151 Constant: +0:151 0 (const uint) +0:151 direct index ( temp uint) +0:151 'dti' ( in 3-component vector of uint) +0:151 Constant: +0:151 0 (const int) +0:151 Constant: +0:151 3 (const int) +0:151 Sequence +0:151 Constant: +0:151 0 (const int) +0:151 Constant: +0:151 1 (const int) +0:152 move second child to first child ( temp 3-component vector of double) +0:152 vector swizzle ( temp 3-component vector of double) +0:152 d: direct index for structure ( temp 4-component vector of double) +0:152 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:152 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:152 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:152 Constant: +0:152 0 (const uint) +0:152 direct index ( temp uint) +0:152 'dti' ( in 3-component vector of uint) +0:152 Constant: +0:152 0 (const int) +0:152 Constant: +0:152 3 (const int) +0:152 Sequence +0:152 Constant: +0:152 0 (const int) +0:152 Constant: +0:152 1 (const int) +0:152 Constant: +0:152 2 (const int) +0:152 subgroupQuadSwapDiagonal ( temp 3-component vector of double) +0:152 vector swizzle ( temp 3-component vector of double) +0:152 d: direct index for structure ( temp 4-component vector of double) +0:152 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:152 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:152 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:152 Constant: +0:152 0 (const uint) +0:152 direct index ( temp uint) +0:152 'dti' ( in 3-component vector of uint) +0:152 Constant: +0:152 0 (const int) +0:152 Constant: +0:152 3 (const int) +0:152 Sequence +0:152 Constant: +0:152 0 (const int) +0:152 Constant: +0:152 1 (const int) +0:152 Constant: +0:152 2 (const int) +0:13 Function Definition: CSMain( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-component vector of uint) +0:? 'dti' ( temp 3-component vector of uint) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) +0:13 Function Call: @CSMain(vu3; ( temp void) +0:? 'dti' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:13 Function Definition: @CSMain(vu3; ( temp void) +0:13 Function Parameters: +0:13 'dti' ( in 3-component vector of uint) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 subgroupQuadBroadcast ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const uint) +0:15 move second child to first child ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 subgroupQuadBroadcast ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const uint) +0:16 move second child to first child ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 subgroupQuadBroadcast ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 0 (const uint) +0:17 move second child to first child ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 subgroupQuadBroadcast ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 0 (const uint) +0:19 move second child to first child ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 subgroupQuadBroadcast ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 0 (const uint) +0:20 move second child to first child ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 subgroupQuadBroadcast ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 0 (const uint) +0:21 move second child to first child ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 subgroupQuadBroadcast ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 0 (const uint) +0:22 move second child to first child ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 subgroupQuadBroadcast ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 Constant: +0:22 0 (const uint) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 subgroupQuadBroadcast ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 Constant: +0:24 0 (const uint) +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 subgroupQuadBroadcast ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 0 (const uint) +0:26 move second child to first child ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 subgroupQuadBroadcast ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 Constant: +0:26 0 (const uint) +0:27 move second child to first child ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 subgroupQuadBroadcast ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Constant: +0:27 0 (const uint) +0:29 move second child to first child ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:29 subgroupQuadBroadcast ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:29 Constant: +0:29 0 (const uint) +0:30 move second child to first child ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 subgroupQuadBroadcast ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 0 (const uint) +0:31 move second child to first child ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 subgroupQuadBroadcast ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 Constant: +0:31 0 (const uint) +0:32 move second child to first child ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 subgroupQuadBroadcast ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 Constant: +0:32 0 (const uint) +0:34 move second child to first child ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 subgroupQuadBroadcast ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 1 (const uint) +0:35 move second child to first child ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 subgroupQuadBroadcast ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 1 (const uint) +0:36 move second child to first child ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:36 subgroupQuadBroadcast ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:36 Constant: +0:36 1 (const uint) +0:37 move second child to first child ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 subgroupQuadBroadcast ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 Constant: +0:37 1 (const uint) +0:39 move second child to first child ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 subgroupQuadBroadcast ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 Constant: +0:39 1 (const uint) +0:40 move second child to first child ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:40 subgroupQuadBroadcast ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const uint) +0:41 move second child to first child ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 subgroupQuadBroadcast ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Constant: +0:41 1 (const uint) +0:42 move second child to first child ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:42 subgroupQuadBroadcast ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:42 Constant: +0:42 1 (const uint) +0:44 move second child to first child ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 subgroupQuadBroadcast ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 Constant: +0:44 1 (const uint) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 subgroupQuadBroadcast ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 1 (const uint) +0:46 move second child to first child ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 subgroupQuadBroadcast ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 1 (const uint) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 subgroupQuadBroadcast ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Constant: +0:47 1 (const uint) +0:49 move second child to first child ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:49 subgroupQuadBroadcast ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:49 Constant: +0:49 1 (const uint) +0:50 move second child to first child ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:50 subgroupQuadBroadcast ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 1 (const uint) +0:51 move second child to first child ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:51 subgroupQuadBroadcast ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:51 Constant: +0:51 1 (const uint) +0:52 move second child to first child ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:52 subgroupQuadBroadcast ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:52 Constant: +0:52 1 (const uint) +0:54 move second child to first child ( temp 4-component vector of uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 subgroupQuadBroadcast ( temp 4-component vector of uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 2 (const uint) +0:55 move second child to first child ( temp uint) +0:55 direct index ( temp uint) +0:55 u: direct index for structure ( temp 4-component vector of uint) +0:55 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:55 Constant: +0:55 0 (const uint) +0:55 direct index ( temp uint) +0:55 'dti' ( in 3-component vector of uint) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 subgroupQuadBroadcast ( temp uint) +0:55 direct index ( temp uint) +0:55 u: direct index for structure ( temp 4-component vector of uint) +0:55 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:55 Constant: +0:55 0 (const uint) +0:55 direct index ( temp uint) +0:55 'dti' ( in 3-component vector of uint) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 2 (const uint) +0:56 move second child to first child ( temp 2-component vector of uint) +0:56 vector swizzle ( temp 2-component vector of uint) +0:56 u: direct index for structure ( temp 4-component vector of uint) +0:56 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:56 Constant: +0:56 0 (const uint) +0:56 direct index ( temp uint) +0:56 'dti' ( in 3-component vector of uint) +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 0 (const int) +0:56 Sequence +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1 (const int) +0:56 subgroupQuadBroadcast ( temp 2-component vector of uint) +0:56 vector swizzle ( temp 2-component vector of uint) +0:56 u: direct index for structure ( temp 4-component vector of uint) +0:56 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:56 Constant: +0:56 0 (const uint) +0:56 direct index ( temp uint) +0:56 'dti' ( in 3-component vector of uint) +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 0 (const int) +0:56 Sequence +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1 (const int) +0:56 Constant: +0:56 2 (const uint) +0:57 move second child to first child ( temp 3-component vector of uint) +0:57 vector swizzle ( temp 3-component vector of uint) +0:57 u: direct index for structure ( temp 4-component vector of uint) +0:57 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:57 Constant: +0:57 0 (const uint) +0:57 direct index ( temp uint) +0:57 'dti' ( in 3-component vector of uint) +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 0 (const int) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 2 (const int) +0:57 subgroupQuadBroadcast ( temp 3-component vector of uint) +0:57 vector swizzle ( temp 3-component vector of uint) +0:57 u: direct index for structure ( temp 4-component vector of uint) +0:57 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:57 Constant: +0:57 0 (const uint) +0:57 direct index ( temp uint) +0:57 'dti' ( in 3-component vector of uint) +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 0 (const int) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 2 (const int) +0:57 Constant: +0:57 2 (const uint) +0:59 move second child to first child ( temp 4-component vector of int) +0:59 i: direct index for structure ( temp 4-component vector of int) +0:59 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:59 Constant: +0:59 0 (const uint) +0:59 direct index ( temp uint) +0:59 'dti' ( in 3-component vector of uint) +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:59 subgroupQuadBroadcast ( temp 4-component vector of int) +0:59 i: direct index for structure ( temp 4-component vector of int) +0:59 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:59 Constant: +0:59 0 (const uint) +0:59 direct index ( temp uint) +0:59 'dti' ( in 3-component vector of uint) +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:59 Constant: +0:59 2 (const uint) +0:60 move second child to first child ( temp int) +0:60 direct index ( temp int) +0:60 i: direct index for structure ( temp 4-component vector of int) +0:60 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:60 Constant: +0:60 0 (const uint) +0:60 direct index ( temp uint) +0:60 'dti' ( in 3-component vector of uint) +0:60 Constant: +0:60 0 (const int) +0:60 Constant: +0:60 1 (const int) +0:60 Constant: +0:60 0 (const int) +0:60 subgroupQuadBroadcast ( temp int) +0:60 direct index ( temp int) +0:60 i: direct index for structure ( temp 4-component vector of int) +0:60 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:60 Constant: +0:60 0 (const uint) +0:60 direct index ( temp uint) +0:60 'dti' ( in 3-component vector of uint) +0:60 Constant: +0:60 0 (const int) +0:60 Constant: +0:60 1 (const int) +0:60 Constant: +0:60 0 (const int) +0:60 Constant: +0:60 2 (const uint) +0:61 move second child to first child ( temp 2-component vector of int) +0:61 vector swizzle ( temp 2-component vector of int) +0:61 i: direct index for structure ( temp 4-component vector of int) +0:61 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:61 Constant: +0:61 0 (const uint) +0:61 direct index ( temp uint) +0:61 'dti' ( in 3-component vector of uint) +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Sequence +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 subgroupQuadBroadcast ( temp 2-component vector of int) +0:61 vector swizzle ( temp 2-component vector of int) +0:61 i: direct index for structure ( temp 4-component vector of int) +0:61 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:61 Constant: +0:61 0 (const uint) +0:61 direct index ( temp uint) +0:61 'dti' ( in 3-component vector of uint) +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Sequence +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Constant: +0:61 2 (const uint) +0:62 move second child to first child ( temp 3-component vector of int) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 i: direct index for structure ( temp 4-component vector of int) +0:62 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:62 Constant: +0:62 0 (const uint) +0:62 direct index ( temp uint) +0:62 'dti' ( in 3-component vector of uint) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:62 subgroupQuadBroadcast ( temp 3-component vector of int) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 i: direct index for structure ( temp 4-component vector of int) +0:62 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:62 Constant: +0:62 0 (const uint) +0:62 direct index ( temp uint) +0:62 'dti' ( in 3-component vector of uint) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:62 Constant: +0:62 2 (const uint) +0:64 move second child to first child ( temp 4-component vector of float) +0:64 f: direct index for structure ( temp 4-component vector of float) +0:64 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:64 Constant: +0:64 0 (const uint) +0:64 direct index ( temp uint) +0:64 'dti' ( in 3-component vector of uint) +0:64 Constant: +0:64 0 (const int) +0:64 Constant: +0:64 2 (const int) +0:64 subgroupQuadBroadcast ( temp 4-component vector of float) +0:64 f: direct index for structure ( temp 4-component vector of float) +0:64 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:64 Constant: +0:64 0 (const uint) +0:64 direct index ( temp uint) +0:64 'dti' ( in 3-component vector of uint) +0:64 Constant: +0:64 0 (const int) +0:64 Constant: +0:64 2 (const int) +0:64 Constant: +0:64 2 (const uint) +0:65 move second child to first child ( temp float) +0:65 direct index ( temp float) +0:65 f: direct index for structure ( temp 4-component vector of float) +0:65 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:65 Constant: +0:65 0 (const uint) +0:65 direct index ( temp uint) +0:65 'dti' ( in 3-component vector of uint) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 2 (const int) +0:65 Constant: +0:65 0 (const int) +0:65 subgroupQuadBroadcast ( temp float) +0:65 direct index ( temp float) +0:65 f: direct index for structure ( temp 4-component vector of float) +0:65 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:65 Constant: +0:65 0 (const uint) +0:65 direct index ( temp uint) +0:65 'dti' ( in 3-component vector of uint) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 2 (const int) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 2 (const uint) +0:66 move second child to first child ( temp 2-component vector of float) +0:66 vector swizzle ( temp 2-component vector of float) +0:66 f: direct index for structure ( temp 4-component vector of float) +0:66 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:66 Constant: +0:66 0 (const uint) +0:66 direct index ( temp uint) +0:66 'dti' ( in 3-component vector of uint) +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 2 (const int) +0:66 Sequence +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 1 (const int) +0:66 subgroupQuadBroadcast ( temp 2-component vector of float) +0:66 vector swizzle ( temp 2-component vector of float) +0:66 f: direct index for structure ( temp 4-component vector of float) +0:66 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:66 Constant: +0:66 0 (const uint) +0:66 direct index ( temp uint) +0:66 'dti' ( in 3-component vector of uint) +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 2 (const int) +0:66 Sequence +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 1 (const int) +0:66 Constant: +0:66 2 (const uint) +0:67 move second child to first child ( temp 3-component vector of float) +0:67 vector swizzle ( temp 3-component vector of float) +0:67 f: direct index for structure ( temp 4-component vector of float) +0:67 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:67 Constant: +0:67 0 (const uint) +0:67 direct index ( temp uint) +0:67 'dti' ( in 3-component vector of uint) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 Sequence +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 1 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 subgroupQuadBroadcast ( temp 3-component vector of float) +0:67 vector swizzle ( temp 3-component vector of float) +0:67 f: direct index for structure ( temp 4-component vector of float) +0:67 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:67 Constant: +0:67 0 (const uint) +0:67 direct index ( temp uint) +0:67 'dti' ( in 3-component vector of uint) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 Sequence +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 1 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 Constant: +0:67 2 (const uint) +0:69 move second child to first child ( temp 4-component vector of double) +0:69 d: direct index for structure ( temp 4-component vector of double) +0:69 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:69 Constant: +0:69 0 (const uint) +0:69 direct index ( temp uint) +0:69 'dti' ( in 3-component vector of uint) +0:69 Constant: +0:69 0 (const int) +0:69 Constant: +0:69 3 (const int) +0:69 subgroupQuadBroadcast ( temp 4-component vector of double) +0:69 d: direct index for structure ( temp 4-component vector of double) +0:69 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:69 Constant: +0:69 0 (const uint) +0:69 direct index ( temp uint) +0:69 'dti' ( in 3-component vector of uint) +0:69 Constant: +0:69 0 (const int) +0:69 Constant: +0:69 3 (const int) +0:69 Constant: +0:69 2 (const uint) +0:70 move second child to first child ( temp double) +0:70 direct index ( temp double) +0:70 d: direct index for structure ( temp 4-component vector of double) +0:70 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:70 Constant: +0:70 0 (const uint) +0:70 direct index ( temp uint) +0:70 'dti' ( in 3-component vector of uint) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 3 (const int) +0:70 Constant: +0:70 0 (const int) +0:70 subgroupQuadBroadcast ( temp double) +0:70 direct index ( temp double) +0:70 d: direct index for structure ( temp 4-component vector of double) +0:70 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:70 Constant: +0:70 0 (const uint) +0:70 direct index ( temp uint) +0:70 'dti' ( in 3-component vector of uint) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 3 (const int) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 2 (const uint) +0:71 move second child to first child ( temp 2-component vector of double) +0:71 vector swizzle ( temp 2-component vector of double) +0:71 d: direct index for structure ( temp 4-component vector of double) +0:71 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:71 Constant: +0:71 0 (const uint) +0:71 direct index ( temp uint) +0:71 'dti' ( in 3-component vector of uint) +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 3 (const int) +0:71 Sequence +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 1 (const int) +0:71 subgroupQuadBroadcast ( temp 2-component vector of double) +0:71 vector swizzle ( temp 2-component vector of double) +0:71 d: direct index for structure ( temp 4-component vector of double) +0:71 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:71 Constant: +0:71 0 (const uint) +0:71 direct index ( temp uint) +0:71 'dti' ( in 3-component vector of uint) +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 3 (const int) +0:71 Sequence +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 1 (const int) +0:71 Constant: +0:71 2 (const uint) +0:72 move second child to first child ( temp 3-component vector of double) +0:72 vector swizzle ( temp 3-component vector of double) +0:72 d: direct index for structure ( temp 4-component vector of double) +0:72 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:72 Constant: +0:72 0 (const uint) +0:72 direct index ( temp uint) +0:72 'dti' ( in 3-component vector of uint) +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 3 (const int) +0:72 Sequence +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 1 (const int) +0:72 Constant: +0:72 2 (const int) +0:72 subgroupQuadBroadcast ( temp 3-component vector of double) +0:72 vector swizzle ( temp 3-component vector of double) +0:72 d: direct index for structure ( temp 4-component vector of double) +0:72 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:72 Constant: +0:72 0 (const uint) +0:72 direct index ( temp uint) +0:72 'dti' ( in 3-component vector of uint) +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 3 (const int) +0:72 Sequence +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 1 (const int) +0:72 Constant: +0:72 2 (const int) +0:72 Constant: +0:72 2 (const uint) +0:74 move second child to first child ( temp 4-component vector of uint) +0:74 u: direct index for structure ( temp 4-component vector of uint) +0:74 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:74 Constant: +0:74 0 (const uint) +0:74 direct index ( temp uint) +0:74 'dti' ( in 3-component vector of uint) +0:74 Constant: +0:74 0 (const int) +0:74 Constant: +0:74 0 (const int) +0:74 subgroupQuadBroadcast ( temp 4-component vector of uint) +0:74 u: direct index for structure ( temp 4-component vector of uint) +0:74 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:74 Constant: +0:74 0 (const uint) +0:74 direct index ( temp uint) +0:74 'dti' ( in 3-component vector of uint) +0:74 Constant: +0:74 0 (const int) +0:74 Constant: +0:74 0 (const int) +0:74 Constant: +0:74 3 (const uint) +0:75 move second child to first child ( temp uint) +0:75 direct index ( temp uint) +0:75 u: direct index for structure ( temp 4-component vector of uint) +0:75 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:75 Constant: +0:75 0 (const uint) +0:75 direct index ( temp uint) +0:75 'dti' ( in 3-component vector of uint) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 subgroupQuadBroadcast ( temp uint) +0:75 direct index ( temp uint) +0:75 u: direct index for structure ( temp 4-component vector of uint) +0:75 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:75 Constant: +0:75 0 (const uint) +0:75 direct index ( temp uint) +0:75 'dti' ( in 3-component vector of uint) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 3 (const uint) +0:76 move second child to first child ( temp 2-component vector of uint) +0:76 vector swizzle ( temp 2-component vector of uint) +0:76 u: direct index for structure ( temp 4-component vector of uint) +0:76 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:76 Constant: +0:76 0 (const uint) +0:76 direct index ( temp uint) +0:76 'dti' ( in 3-component vector of uint) +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 0 (const int) +0:76 Sequence +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 1 (const int) +0:76 subgroupQuadBroadcast ( temp 2-component vector of uint) +0:76 vector swizzle ( temp 2-component vector of uint) +0:76 u: direct index for structure ( temp 4-component vector of uint) +0:76 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:76 Constant: +0:76 0 (const uint) +0:76 direct index ( temp uint) +0:76 'dti' ( in 3-component vector of uint) +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 0 (const int) +0:76 Sequence +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 1 (const int) +0:76 Constant: +0:76 3 (const uint) +0:77 move second child to first child ( temp 3-component vector of uint) +0:77 vector swizzle ( temp 3-component vector of uint) +0:77 u: direct index for structure ( temp 4-component vector of uint) +0:77 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:77 Constant: +0:77 0 (const uint) +0:77 direct index ( temp uint) +0:77 'dti' ( in 3-component vector of uint) +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 0 (const int) +0:77 Sequence +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 1 (const int) +0:77 Constant: +0:77 2 (const int) +0:77 subgroupQuadBroadcast ( temp 3-component vector of uint) +0:77 vector swizzle ( temp 3-component vector of uint) +0:77 u: direct index for structure ( temp 4-component vector of uint) +0:77 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:77 Constant: +0:77 0 (const uint) +0:77 direct index ( temp uint) +0:77 'dti' ( in 3-component vector of uint) +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 0 (const int) +0:77 Sequence +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 1 (const int) +0:77 Constant: +0:77 2 (const int) +0:77 Constant: +0:77 3 (const uint) +0:79 move second child to first child ( temp 4-component vector of int) +0:79 i: direct index for structure ( temp 4-component vector of int) +0:79 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:79 Constant: +0:79 0 (const uint) +0:79 direct index ( temp uint) +0:79 'dti' ( in 3-component vector of uint) +0:79 Constant: +0:79 0 (const int) +0:79 Constant: +0:79 1 (const int) +0:79 subgroupQuadBroadcast ( temp 4-component vector of int) +0:79 i: direct index for structure ( temp 4-component vector of int) +0:79 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:79 Constant: +0:79 0 (const uint) +0:79 direct index ( temp uint) +0:79 'dti' ( in 3-component vector of uint) +0:79 Constant: +0:79 0 (const int) +0:79 Constant: +0:79 1 (const int) +0:79 Constant: +0:79 3 (const uint) +0:80 move second child to first child ( temp int) +0:80 direct index ( temp int) +0:80 i: direct index for structure ( temp 4-component vector of int) +0:80 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:80 Constant: +0:80 0 (const uint) +0:80 direct index ( temp uint) +0:80 'dti' ( in 3-component vector of uint) +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 1 (const int) +0:80 Constant: +0:80 0 (const int) +0:80 subgroupQuadBroadcast ( temp int) +0:80 direct index ( temp int) +0:80 i: direct index for structure ( temp 4-component vector of int) +0:80 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:80 Constant: +0:80 0 (const uint) +0:80 direct index ( temp uint) +0:80 'dti' ( in 3-component vector of uint) +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 1 (const int) +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 3 (const uint) +0:81 move second child to first child ( temp 2-component vector of int) +0:81 vector swizzle ( temp 2-component vector of int) +0:81 i: direct index for structure ( temp 4-component vector of int) +0:81 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:81 Constant: +0:81 0 (const uint) +0:81 direct index ( temp uint) +0:81 'dti' ( in 3-component vector of uint) +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 Sequence +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 subgroupQuadBroadcast ( temp 2-component vector of int) +0:81 vector swizzle ( temp 2-component vector of int) +0:81 i: direct index for structure ( temp 4-component vector of int) +0:81 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:81 Constant: +0:81 0 (const uint) +0:81 direct index ( temp uint) +0:81 'dti' ( in 3-component vector of uint) +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 Sequence +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 Constant: +0:81 3 (const uint) +0:82 move second child to first child ( temp 3-component vector of int) +0:82 vector swizzle ( temp 3-component vector of int) +0:82 i: direct index for structure ( temp 4-component vector of int) +0:82 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:82 Constant: +0:82 0 (const uint) +0:82 direct index ( temp uint) +0:82 'dti' ( in 3-component vector of uint) +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Sequence +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Constant: +0:82 2 (const int) +0:82 subgroupQuadBroadcast ( temp 3-component vector of int) +0:82 vector swizzle ( temp 3-component vector of int) +0:82 i: direct index for structure ( temp 4-component vector of int) +0:82 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:82 Constant: +0:82 0 (const uint) +0:82 direct index ( temp uint) +0:82 'dti' ( in 3-component vector of uint) +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Sequence +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Constant: +0:82 2 (const int) +0:82 Constant: +0:82 3 (const uint) +0:84 move second child to first child ( temp 4-component vector of float) +0:84 f: direct index for structure ( temp 4-component vector of float) +0:84 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:84 Constant: +0:84 0 (const uint) +0:84 direct index ( temp uint) +0:84 'dti' ( in 3-component vector of uint) +0:84 Constant: +0:84 0 (const int) +0:84 Constant: +0:84 2 (const int) +0:84 subgroupQuadBroadcast ( temp 4-component vector of float) +0:84 f: direct index for structure ( temp 4-component vector of float) +0:84 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:84 Constant: +0:84 0 (const uint) +0:84 direct index ( temp uint) +0:84 'dti' ( in 3-component vector of uint) +0:84 Constant: +0:84 0 (const int) +0:84 Constant: +0:84 2 (const int) +0:84 Constant: +0:84 3 (const uint) +0:85 move second child to first child ( temp float) +0:85 direct index ( temp float) +0:85 f: direct index for structure ( temp 4-component vector of float) +0:85 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:85 Constant: +0:85 0 (const uint) +0:85 direct index ( temp uint) +0:85 'dti' ( in 3-component vector of uint) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 2 (const int) +0:85 Constant: +0:85 0 (const int) +0:85 subgroupQuadBroadcast ( temp float) +0:85 direct index ( temp float) +0:85 f: direct index for structure ( temp 4-component vector of float) +0:85 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:85 Constant: +0:85 0 (const uint) +0:85 direct index ( temp uint) +0:85 'dti' ( in 3-component vector of uint) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 2 (const int) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 3 (const uint) +0:86 move second child to first child ( temp 2-component vector of float) +0:86 vector swizzle ( temp 2-component vector of float) +0:86 f: direct index for structure ( temp 4-component vector of float) +0:86 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:86 Constant: +0:86 0 (const uint) +0:86 direct index ( temp uint) +0:86 'dti' ( in 3-component vector of uint) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 2 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:86 subgroupQuadBroadcast ( temp 2-component vector of float) +0:86 vector swizzle ( temp 2-component vector of float) +0:86 f: direct index for structure ( temp 4-component vector of float) +0:86 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:86 Constant: +0:86 0 (const uint) +0:86 direct index ( temp uint) +0:86 'dti' ( in 3-component vector of uint) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 2 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:86 Constant: +0:86 3 (const uint) +0:87 move second child to first child ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 f: direct index for structure ( temp 4-component vector of float) +0:87 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:87 Constant: +0:87 0 (const uint) +0:87 direct index ( temp uint) +0:87 'dti' ( in 3-component vector of uint) +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 subgroupQuadBroadcast ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 f: direct index for structure ( temp 4-component vector of float) +0:87 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:87 Constant: +0:87 0 (const uint) +0:87 direct index ( temp uint) +0:87 'dti' ( in 3-component vector of uint) +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 Constant: +0:87 3 (const uint) +0:89 move second child to first child ( temp 4-component vector of double) +0:89 d: direct index for structure ( temp 4-component vector of double) +0:89 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:89 Constant: +0:89 0 (const uint) +0:89 direct index ( temp uint) +0:89 'dti' ( in 3-component vector of uint) +0:89 Constant: +0:89 0 (const int) +0:89 Constant: +0:89 3 (const int) +0:89 subgroupQuadBroadcast ( temp 4-component vector of double) +0:89 d: direct index for structure ( temp 4-component vector of double) +0:89 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:89 Constant: +0:89 0 (const uint) +0:89 direct index ( temp uint) +0:89 'dti' ( in 3-component vector of uint) +0:89 Constant: +0:89 0 (const int) +0:89 Constant: +0:89 3 (const int) +0:89 Constant: +0:89 3 (const uint) +0:90 move second child to first child ( temp double) +0:90 direct index ( temp double) +0:90 d: direct index for structure ( temp 4-component vector of double) +0:90 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:90 Constant: +0:90 0 (const uint) +0:90 direct index ( temp uint) +0:90 'dti' ( in 3-component vector of uint) +0:90 Constant: +0:90 0 (const int) +0:90 Constant: +0:90 3 (const int) +0:90 Constant: +0:90 0 (const int) +0:90 subgroupQuadBroadcast ( temp double) +0:90 direct index ( temp double) +0:90 d: direct index for structure ( temp 4-component vector of double) +0:90 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:90 Constant: +0:90 0 (const uint) +0:90 direct index ( temp uint) +0:90 'dti' ( in 3-component vector of uint) +0:90 Constant: +0:90 0 (const int) +0:90 Constant: +0:90 3 (const int) +0:90 Constant: +0:90 0 (const int) +0:90 Constant: +0:90 3 (const uint) +0:91 move second child to first child ( temp 2-component vector of double) +0:91 vector swizzle ( temp 2-component vector of double) +0:91 d: direct index for structure ( temp 4-component vector of double) +0:91 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:91 Constant: +0:91 0 (const uint) +0:91 direct index ( temp uint) +0:91 'dti' ( in 3-component vector of uint) +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 3 (const int) +0:91 Sequence +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 1 (const int) +0:91 subgroupQuadBroadcast ( temp 2-component vector of double) +0:91 vector swizzle ( temp 2-component vector of double) +0:91 d: direct index for structure ( temp 4-component vector of double) +0:91 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:91 Constant: +0:91 0 (const uint) +0:91 direct index ( temp uint) +0:91 'dti' ( in 3-component vector of uint) +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 3 (const int) +0:91 Sequence +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 1 (const int) +0:91 Constant: +0:91 3 (const uint) +0:92 move second child to first child ( temp 3-component vector of double) +0:92 vector swizzle ( temp 3-component vector of double) +0:92 d: direct index for structure ( temp 4-component vector of double) +0:92 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:92 Constant: +0:92 0 (const uint) +0:92 direct index ( temp uint) +0:92 'dti' ( in 3-component vector of uint) +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 3 (const int) +0:92 Sequence +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 1 (const int) +0:92 Constant: +0:92 2 (const int) +0:92 subgroupQuadBroadcast ( temp 3-component vector of double) +0:92 vector swizzle ( temp 3-component vector of double) +0:92 d: direct index for structure ( temp 4-component vector of double) +0:92 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:92 Constant: +0:92 0 (const uint) +0:92 direct index ( temp uint) +0:92 'dti' ( in 3-component vector of uint) +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 3 (const int) +0:92 Sequence +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 1 (const int) +0:92 Constant: +0:92 2 (const int) +0:92 Constant: +0:92 3 (const uint) +0:94 move second child to first child ( temp 4-component vector of uint) +0:94 u: direct index for structure ( temp 4-component vector of uint) +0:94 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:94 Constant: +0:94 0 (const uint) +0:94 direct index ( temp uint) +0:94 'dti' ( in 3-component vector of uint) +0:94 Constant: +0:94 0 (const int) +0:94 Constant: +0:94 0 (const int) +0:94 subgroupQuadSwapHorizontal ( temp 4-component vector of uint) +0:94 u: direct index for structure ( temp 4-component vector of uint) +0:94 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:94 Constant: +0:94 0 (const uint) +0:94 direct index ( temp uint) +0:94 'dti' ( in 3-component vector of uint) +0:94 Constant: +0:94 0 (const int) +0:94 Constant: +0:94 0 (const int) +0:95 move second child to first child ( temp uint) +0:95 direct index ( temp uint) +0:95 u: direct index for structure ( temp 4-component vector of uint) +0:95 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:95 Constant: +0:95 0 (const uint) +0:95 direct index ( temp uint) +0:95 'dti' ( in 3-component vector of uint) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 subgroupQuadSwapHorizontal ( temp uint) +0:95 direct index ( temp uint) +0:95 u: direct index for structure ( temp 4-component vector of uint) +0:95 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:95 Constant: +0:95 0 (const uint) +0:95 direct index ( temp uint) +0:95 'dti' ( in 3-component vector of uint) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:96 move second child to first child ( temp 2-component vector of uint) +0:96 vector swizzle ( temp 2-component vector of uint) +0:96 u: direct index for structure ( temp 4-component vector of uint) +0:96 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:96 Constant: +0:96 0 (const uint) +0:96 direct index ( temp uint) +0:96 'dti' ( in 3-component vector of uint) +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 0 (const int) +0:96 Sequence +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 1 (const int) +0:96 subgroupQuadSwapHorizontal ( temp 2-component vector of uint) +0:96 vector swizzle ( temp 2-component vector of uint) +0:96 u: direct index for structure ( temp 4-component vector of uint) +0:96 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:96 Constant: +0:96 0 (const uint) +0:96 direct index ( temp uint) +0:96 'dti' ( in 3-component vector of uint) +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 0 (const int) +0:96 Sequence +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 1 (const int) +0:97 move second child to first child ( temp 3-component vector of uint) +0:97 vector swizzle ( temp 3-component vector of uint) +0:97 u: direct index for structure ( temp 4-component vector of uint) +0:97 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:97 Constant: +0:97 0 (const uint) +0:97 direct index ( temp uint) +0:97 'dti' ( in 3-component vector of uint) +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 0 (const int) +0:97 Sequence +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 1 (const int) +0:97 Constant: +0:97 2 (const int) +0:97 subgroupQuadSwapHorizontal ( temp 3-component vector of uint) +0:97 vector swizzle ( temp 3-component vector of uint) +0:97 u: direct index for structure ( temp 4-component vector of uint) +0:97 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:97 Constant: +0:97 0 (const uint) +0:97 direct index ( temp uint) +0:97 'dti' ( in 3-component vector of uint) +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 0 (const int) +0:97 Sequence +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 1 (const int) +0:97 Constant: +0:97 2 (const int) +0:99 move second child to first child ( temp 4-component vector of int) +0:99 i: direct index for structure ( temp 4-component vector of int) +0:99 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:99 Constant: +0:99 0 (const uint) +0:99 direct index ( temp uint) +0:99 'dti' ( in 3-component vector of uint) +0:99 Constant: +0:99 0 (const int) +0:99 Constant: +0:99 1 (const int) +0:99 subgroupQuadSwapHorizontal ( temp 4-component vector of int) +0:99 i: direct index for structure ( temp 4-component vector of int) +0:99 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:99 Constant: +0:99 0 (const uint) +0:99 direct index ( temp uint) +0:99 'dti' ( in 3-component vector of uint) +0:99 Constant: +0:99 0 (const int) +0:99 Constant: +0:99 1 (const int) +0:100 move second child to first child ( temp int) +0:100 direct index ( temp int) +0:100 i: direct index for structure ( temp 4-component vector of int) +0:100 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:100 Constant: +0:100 0 (const uint) +0:100 direct index ( temp uint) +0:100 'dti' ( in 3-component vector of uint) +0:100 Constant: +0:100 0 (const int) +0:100 Constant: +0:100 1 (const int) +0:100 Constant: +0:100 0 (const int) +0:100 subgroupQuadSwapHorizontal ( temp int) +0:100 direct index ( temp int) +0:100 i: direct index for structure ( temp 4-component vector of int) +0:100 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:100 Constant: +0:100 0 (const uint) +0:100 direct index ( temp uint) +0:100 'dti' ( in 3-component vector of uint) +0:100 Constant: +0:100 0 (const int) +0:100 Constant: +0:100 1 (const int) +0:100 Constant: +0:100 0 (const int) +0:101 move second child to first child ( temp 2-component vector of int) +0:101 vector swizzle ( temp 2-component vector of int) +0:101 i: direct index for structure ( temp 4-component vector of int) +0:101 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:101 Constant: +0:101 0 (const uint) +0:101 direct index ( temp uint) +0:101 'dti' ( in 3-component vector of uint) +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 Sequence +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 subgroupQuadSwapHorizontal ( temp 2-component vector of int) +0:101 vector swizzle ( temp 2-component vector of int) +0:101 i: direct index for structure ( temp 4-component vector of int) +0:101 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:101 Constant: +0:101 0 (const uint) +0:101 direct index ( temp uint) +0:101 'dti' ( in 3-component vector of uint) +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 Sequence +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:102 move second child to first child ( temp 3-component vector of int) +0:102 vector swizzle ( temp 3-component vector of int) +0:102 i: direct index for structure ( temp 4-component vector of int) +0:102 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:102 Constant: +0:102 0 (const uint) +0:102 direct index ( temp uint) +0:102 'dti' ( in 3-component vector of uint) +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Sequence +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Constant: +0:102 2 (const int) +0:102 subgroupQuadSwapHorizontal ( temp 3-component vector of int) +0:102 vector swizzle ( temp 3-component vector of int) +0:102 i: direct index for structure ( temp 4-component vector of int) +0:102 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:102 Constant: +0:102 0 (const uint) +0:102 direct index ( temp uint) +0:102 'dti' ( in 3-component vector of uint) +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Sequence +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Constant: +0:102 2 (const int) +0:104 move second child to first child ( temp 4-component vector of float) +0:104 f: direct index for structure ( temp 4-component vector of float) +0:104 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:104 Constant: +0:104 0 (const uint) +0:104 direct index ( temp uint) +0:104 'dti' ( in 3-component vector of uint) +0:104 Constant: +0:104 0 (const int) +0:104 Constant: +0:104 2 (const int) +0:104 subgroupQuadSwapHorizontal ( temp 4-component vector of float) +0:104 f: direct index for structure ( temp 4-component vector of float) +0:104 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:104 Constant: +0:104 0 (const uint) +0:104 direct index ( temp uint) +0:104 'dti' ( in 3-component vector of uint) +0:104 Constant: +0:104 0 (const int) +0:104 Constant: +0:104 2 (const int) +0:105 move second child to first child ( temp float) +0:105 direct index ( temp float) +0:105 f: direct index for structure ( temp 4-component vector of float) +0:105 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:105 Constant: +0:105 0 (const uint) +0:105 direct index ( temp uint) +0:105 'dti' ( in 3-component vector of uint) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 2 (const int) +0:105 Constant: +0:105 0 (const int) +0:105 subgroupQuadSwapHorizontal ( temp float) +0:105 direct index ( temp float) +0:105 f: direct index for structure ( temp 4-component vector of float) +0:105 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:105 Constant: +0:105 0 (const uint) +0:105 direct index ( temp uint) +0:105 'dti' ( in 3-component vector of uint) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 2 (const int) +0:105 Constant: +0:105 0 (const int) +0:106 move second child to first child ( temp 2-component vector of float) +0:106 vector swizzle ( temp 2-component vector of float) +0:106 f: direct index for structure ( temp 4-component vector of float) +0:106 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:106 Constant: +0:106 0 (const uint) +0:106 direct index ( temp uint) +0:106 'dti' ( in 3-component vector of uint) +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 2 (const int) +0:106 Sequence +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 1 (const int) +0:106 subgroupQuadSwapHorizontal ( temp 2-component vector of float) +0:106 vector swizzle ( temp 2-component vector of float) +0:106 f: direct index for structure ( temp 4-component vector of float) +0:106 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:106 Constant: +0:106 0 (const uint) +0:106 direct index ( temp uint) +0:106 'dti' ( in 3-component vector of uint) +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 2 (const int) +0:106 Sequence +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 1 (const int) +0:107 move second child to first child ( temp 3-component vector of float) +0:107 vector swizzle ( temp 3-component vector of float) +0:107 f: direct index for structure ( temp 4-component vector of float) +0:107 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:107 Constant: +0:107 0 (const uint) +0:107 direct index ( temp uint) +0:107 'dti' ( in 3-component vector of uint) +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 2 (const int) +0:107 Sequence +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 1 (const int) +0:107 Constant: +0:107 2 (const int) +0:107 subgroupQuadSwapHorizontal ( temp 3-component vector of float) +0:107 vector swizzle ( temp 3-component vector of float) +0:107 f: direct index for structure ( temp 4-component vector of float) +0:107 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:107 Constant: +0:107 0 (const uint) +0:107 direct index ( temp uint) +0:107 'dti' ( in 3-component vector of uint) +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 2 (const int) +0:107 Sequence +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 1 (const int) +0:107 Constant: +0:107 2 (const int) +0:109 move second child to first child ( temp 4-component vector of double) +0:109 d: direct index for structure ( temp 4-component vector of double) +0:109 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:109 Constant: +0:109 0 (const uint) +0:109 direct index ( temp uint) +0:109 'dti' ( in 3-component vector of uint) +0:109 Constant: +0:109 0 (const int) +0:109 Constant: +0:109 3 (const int) +0:109 subgroupQuadSwapHorizontal ( temp 4-component vector of double) +0:109 d: direct index for structure ( temp 4-component vector of double) +0:109 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:109 Constant: +0:109 0 (const uint) +0:109 direct index ( temp uint) +0:109 'dti' ( in 3-component vector of uint) +0:109 Constant: +0:109 0 (const int) +0:109 Constant: +0:109 3 (const int) +0:110 move second child to first child ( temp double) +0:110 direct index ( temp double) +0:110 d: direct index for structure ( temp 4-component vector of double) +0:110 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:110 Constant: +0:110 0 (const uint) +0:110 direct index ( temp uint) +0:110 'dti' ( in 3-component vector of uint) +0:110 Constant: +0:110 0 (const int) +0:110 Constant: +0:110 3 (const int) +0:110 Constant: +0:110 0 (const int) +0:110 subgroupQuadSwapHorizontal ( temp double) +0:110 direct index ( temp double) +0:110 d: direct index for structure ( temp 4-component vector of double) +0:110 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:110 Constant: +0:110 0 (const uint) +0:110 direct index ( temp uint) +0:110 'dti' ( in 3-component vector of uint) +0:110 Constant: +0:110 0 (const int) +0:110 Constant: +0:110 3 (const int) +0:110 Constant: +0:110 0 (const int) +0:111 move second child to first child ( temp 2-component vector of double) +0:111 vector swizzle ( temp 2-component vector of double) +0:111 d: direct index for structure ( temp 4-component vector of double) +0:111 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:111 Constant: +0:111 0 (const uint) +0:111 direct index ( temp uint) +0:111 'dti' ( in 3-component vector of uint) +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 3 (const int) +0:111 Sequence +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:111 subgroupQuadSwapHorizontal ( temp 2-component vector of double) +0:111 vector swizzle ( temp 2-component vector of double) +0:111 d: direct index for structure ( temp 4-component vector of double) +0:111 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:111 Constant: +0:111 0 (const uint) +0:111 direct index ( temp uint) +0:111 'dti' ( in 3-component vector of uint) +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 3 (const int) +0:111 Sequence +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:112 move second child to first child ( temp 3-component vector of double) +0:112 vector swizzle ( temp 3-component vector of double) +0:112 d: direct index for structure ( temp 4-component vector of double) +0:112 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:112 Constant: +0:112 0 (const uint) +0:112 direct index ( temp uint) +0:112 'dti' ( in 3-component vector of uint) +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 3 (const int) +0:112 Sequence +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Constant: +0:112 2 (const int) +0:112 subgroupQuadSwapHorizontal ( temp 3-component vector of double) +0:112 vector swizzle ( temp 3-component vector of double) +0:112 d: direct index for structure ( temp 4-component vector of double) +0:112 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:112 Constant: +0:112 0 (const uint) +0:112 direct index ( temp uint) +0:112 'dti' ( in 3-component vector of uint) +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 3 (const int) +0:112 Sequence +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Constant: +0:112 2 (const int) +0:114 move second child to first child ( temp 4-component vector of uint) +0:114 u: direct index for structure ( temp 4-component vector of uint) +0:114 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:114 Constant: +0:114 0 (const uint) +0:114 direct index ( temp uint) +0:114 'dti' ( in 3-component vector of uint) +0:114 Constant: +0:114 0 (const int) +0:114 Constant: +0:114 0 (const int) +0:114 subgroupQuadSwapVertical ( temp 4-component vector of uint) +0:114 u: direct index for structure ( temp 4-component vector of uint) +0:114 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:114 Constant: +0:114 0 (const uint) +0:114 direct index ( temp uint) +0:114 'dti' ( in 3-component vector of uint) +0:114 Constant: +0:114 0 (const int) +0:114 Constant: +0:114 0 (const int) +0:115 move second child to first child ( temp uint) +0:115 direct index ( temp uint) +0:115 u: direct index for structure ( temp 4-component vector of uint) +0:115 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:115 Constant: +0:115 0 (const uint) +0:115 direct index ( temp uint) +0:115 'dti' ( in 3-component vector of uint) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 subgroupQuadSwapVertical ( temp uint) +0:115 direct index ( temp uint) +0:115 u: direct index for structure ( temp 4-component vector of uint) +0:115 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:115 Constant: +0:115 0 (const uint) +0:115 direct index ( temp uint) +0:115 'dti' ( in 3-component vector of uint) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:116 move second child to first child ( temp 2-component vector of uint) +0:116 vector swizzle ( temp 2-component vector of uint) +0:116 u: direct index for structure ( temp 4-component vector of uint) +0:116 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:116 Constant: +0:116 0 (const uint) +0:116 direct index ( temp uint) +0:116 'dti' ( in 3-component vector of uint) +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 0 (const int) +0:116 Sequence +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 1 (const int) +0:116 subgroupQuadSwapVertical ( temp 2-component vector of uint) +0:116 vector swizzle ( temp 2-component vector of uint) +0:116 u: direct index for structure ( temp 4-component vector of uint) +0:116 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:116 Constant: +0:116 0 (const uint) +0:116 direct index ( temp uint) +0:116 'dti' ( in 3-component vector of uint) +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 0 (const int) +0:116 Sequence +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 1 (const int) +0:117 move second child to first child ( temp 3-component vector of uint) +0:117 vector swizzle ( temp 3-component vector of uint) +0:117 u: direct index for structure ( temp 4-component vector of uint) +0:117 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:117 Constant: +0:117 0 (const uint) +0:117 direct index ( temp uint) +0:117 'dti' ( in 3-component vector of uint) +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 0 (const int) +0:117 Sequence +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 1 (const int) +0:117 Constant: +0:117 2 (const int) +0:117 subgroupQuadSwapVertical ( temp 3-component vector of uint) +0:117 vector swizzle ( temp 3-component vector of uint) +0:117 u: direct index for structure ( temp 4-component vector of uint) +0:117 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:117 Constant: +0:117 0 (const uint) +0:117 direct index ( temp uint) +0:117 'dti' ( in 3-component vector of uint) +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 0 (const int) +0:117 Sequence +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 1 (const int) +0:117 Constant: +0:117 2 (const int) +0:119 move second child to first child ( temp 4-component vector of int) +0:119 i: direct index for structure ( temp 4-component vector of int) +0:119 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:119 Constant: +0:119 0 (const uint) +0:119 direct index ( temp uint) +0:119 'dti' ( in 3-component vector of uint) +0:119 Constant: +0:119 0 (const int) +0:119 Constant: +0:119 1 (const int) +0:119 subgroupQuadSwapVertical ( temp 4-component vector of int) +0:119 i: direct index for structure ( temp 4-component vector of int) +0:119 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:119 Constant: +0:119 0 (const uint) +0:119 direct index ( temp uint) +0:119 'dti' ( in 3-component vector of uint) +0:119 Constant: +0:119 0 (const int) +0:119 Constant: +0:119 1 (const int) +0:120 move second child to first child ( temp int) +0:120 direct index ( temp int) +0:120 i: direct index for structure ( temp 4-component vector of int) +0:120 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:120 Constant: +0:120 0 (const uint) +0:120 direct index ( temp uint) +0:120 'dti' ( in 3-component vector of uint) +0:120 Constant: +0:120 0 (const int) +0:120 Constant: +0:120 1 (const int) +0:120 Constant: +0:120 0 (const int) +0:120 subgroupQuadSwapVertical ( temp int) +0:120 direct index ( temp int) +0:120 i: direct index for structure ( temp 4-component vector of int) +0:120 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:120 Constant: +0:120 0 (const uint) +0:120 direct index ( temp uint) +0:120 'dti' ( in 3-component vector of uint) +0:120 Constant: +0:120 0 (const int) +0:120 Constant: +0:120 1 (const int) +0:120 Constant: +0:120 0 (const int) +0:121 move second child to first child ( temp 2-component vector of int) +0:121 vector swizzle ( temp 2-component vector of int) +0:121 i: direct index for structure ( temp 4-component vector of int) +0:121 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:121 Constant: +0:121 0 (const uint) +0:121 direct index ( temp uint) +0:121 'dti' ( in 3-component vector of uint) +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 Sequence +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 subgroupQuadSwapVertical ( temp 2-component vector of int) +0:121 vector swizzle ( temp 2-component vector of int) +0:121 i: direct index for structure ( temp 4-component vector of int) +0:121 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:121 Constant: +0:121 0 (const uint) +0:121 direct index ( temp uint) +0:121 'dti' ( in 3-component vector of uint) +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 Sequence +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:122 move second child to first child ( temp 3-component vector of int) +0:122 vector swizzle ( temp 3-component vector of int) +0:122 i: direct index for structure ( temp 4-component vector of int) +0:122 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:122 Constant: +0:122 0 (const uint) +0:122 direct index ( temp uint) +0:122 'dti' ( in 3-component vector of uint) +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Sequence +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Constant: +0:122 2 (const int) +0:122 subgroupQuadSwapVertical ( temp 3-component vector of int) +0:122 vector swizzle ( temp 3-component vector of int) +0:122 i: direct index for structure ( temp 4-component vector of int) +0:122 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:122 Constant: +0:122 0 (const uint) +0:122 direct index ( temp uint) +0:122 'dti' ( in 3-component vector of uint) +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Sequence +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Constant: +0:122 2 (const int) +0:124 move second child to first child ( temp 4-component vector of float) +0:124 f: direct index for structure ( temp 4-component vector of float) +0:124 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:124 Constant: +0:124 0 (const uint) +0:124 direct index ( temp uint) +0:124 'dti' ( in 3-component vector of uint) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 2 (const int) +0:124 subgroupQuadSwapVertical ( temp 4-component vector of float) +0:124 f: direct index for structure ( temp 4-component vector of float) +0:124 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:124 Constant: +0:124 0 (const uint) +0:124 direct index ( temp uint) +0:124 'dti' ( in 3-component vector of uint) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 2 (const int) +0:125 move second child to first child ( temp float) +0:125 direct index ( temp float) +0:125 f: direct index for structure ( temp 4-component vector of float) +0:125 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:125 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:125 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:125 Constant: +0:125 0 (const uint) +0:125 direct index ( temp uint) +0:125 'dti' ( in 3-component vector of uint) +0:125 Constant: +0:125 0 (const int) +0:125 Constant: +0:125 2 (const int) +0:125 Constant: +0:125 0 (const int) +0:125 subgroupQuadSwapVertical ( temp float) +0:125 direct index ( temp float) +0:125 f: direct index for structure ( temp 4-component vector of float) +0:125 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:125 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:125 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:125 Constant: +0:125 0 (const uint) +0:125 direct index ( temp uint) +0:125 'dti' ( in 3-component vector of uint) +0:125 Constant: +0:125 0 (const int) +0:125 Constant: +0:125 2 (const int) +0:125 Constant: +0:125 0 (const int) +0:126 move second child to first child ( temp 2-component vector of float) +0:126 vector swizzle ( temp 2-component vector of float) +0:126 f: direct index for structure ( temp 4-component vector of float) +0:126 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:126 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:126 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:126 Constant: +0:126 0 (const uint) +0:126 direct index ( temp uint) +0:126 'dti' ( in 3-component vector of uint) +0:126 Constant: +0:126 0 (const int) +0:126 Constant: +0:126 2 (const int) +0:126 Sequence +0:126 Constant: +0:126 0 (const int) +0:126 Constant: +0:126 1 (const int) +0:126 subgroupQuadSwapVertical ( temp 2-component vector of float) +0:126 vector swizzle ( temp 2-component vector of float) +0:126 f: direct index for structure ( temp 4-component vector of float) +0:126 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:126 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:126 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:126 Constant: +0:126 0 (const uint) +0:126 direct index ( temp uint) +0:126 'dti' ( in 3-component vector of uint) +0:126 Constant: +0:126 0 (const int) +0:126 Constant: +0:126 2 (const int) +0:126 Sequence +0:126 Constant: +0:126 0 (const int) +0:126 Constant: +0:126 1 (const int) +0:127 move second child to first child ( temp 3-component vector of float) +0:127 vector swizzle ( temp 3-component vector of float) +0:127 f: direct index for structure ( temp 4-component vector of float) +0:127 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:127 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:127 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:127 Constant: +0:127 0 (const uint) +0:127 direct index ( temp uint) +0:127 'dti' ( in 3-component vector of uint) +0:127 Constant: +0:127 0 (const int) +0:127 Constant: +0:127 2 (const int) +0:127 Sequence +0:127 Constant: +0:127 0 (const int) +0:127 Constant: +0:127 1 (const int) +0:127 Constant: +0:127 2 (const int) +0:127 subgroupQuadSwapVertical ( temp 3-component vector of float) +0:127 vector swizzle ( temp 3-component vector of float) +0:127 f: direct index for structure ( temp 4-component vector of float) +0:127 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:127 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:127 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:127 Constant: +0:127 0 (const uint) +0:127 direct index ( temp uint) +0:127 'dti' ( in 3-component vector of uint) +0:127 Constant: +0:127 0 (const int) +0:127 Constant: +0:127 2 (const int) +0:127 Sequence +0:127 Constant: +0:127 0 (const int) +0:127 Constant: +0:127 1 (const int) +0:127 Constant: +0:127 2 (const int) +0:129 move second child to first child ( temp 4-component vector of double) +0:129 d: direct index for structure ( temp 4-component vector of double) +0:129 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:129 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:129 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:129 Constant: +0:129 0 (const uint) +0:129 direct index ( temp uint) +0:129 'dti' ( in 3-component vector of uint) +0:129 Constant: +0:129 0 (const int) +0:129 Constant: +0:129 3 (const int) +0:129 subgroupQuadSwapVertical ( temp 4-component vector of double) +0:129 d: direct index for structure ( temp 4-component vector of double) +0:129 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:129 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:129 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:129 Constant: +0:129 0 (const uint) +0:129 direct index ( temp uint) +0:129 'dti' ( in 3-component vector of uint) +0:129 Constant: +0:129 0 (const int) +0:129 Constant: +0:129 3 (const int) +0:130 move second child to first child ( temp double) +0:130 direct index ( temp double) +0:130 d: direct index for structure ( temp 4-component vector of double) +0:130 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:130 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:130 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:130 Constant: +0:130 0 (const uint) +0:130 direct index ( temp uint) +0:130 'dti' ( in 3-component vector of uint) +0:130 Constant: +0:130 0 (const int) +0:130 Constant: +0:130 3 (const int) +0:130 Constant: +0:130 0 (const int) +0:130 subgroupQuadSwapVertical ( temp double) +0:130 direct index ( temp double) +0:130 d: direct index for structure ( temp 4-component vector of double) +0:130 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:130 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:130 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:130 Constant: +0:130 0 (const uint) +0:130 direct index ( temp uint) +0:130 'dti' ( in 3-component vector of uint) +0:130 Constant: +0:130 0 (const int) +0:130 Constant: +0:130 3 (const int) +0:130 Constant: +0:130 0 (const int) +0:131 move second child to first child ( temp 2-component vector of double) +0:131 vector swizzle ( temp 2-component vector of double) +0:131 d: direct index for structure ( temp 4-component vector of double) +0:131 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:131 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:131 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:131 Constant: +0:131 0 (const uint) +0:131 direct index ( temp uint) +0:131 'dti' ( in 3-component vector of uint) +0:131 Constant: +0:131 0 (const int) +0:131 Constant: +0:131 3 (const int) +0:131 Sequence +0:131 Constant: +0:131 0 (const int) +0:131 Constant: +0:131 1 (const int) +0:131 subgroupQuadSwapVertical ( temp 2-component vector of double) +0:131 vector swizzle ( temp 2-component vector of double) +0:131 d: direct index for structure ( temp 4-component vector of double) +0:131 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:131 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:131 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:131 Constant: +0:131 0 (const uint) +0:131 direct index ( temp uint) +0:131 'dti' ( in 3-component vector of uint) +0:131 Constant: +0:131 0 (const int) +0:131 Constant: +0:131 3 (const int) +0:131 Sequence +0:131 Constant: +0:131 0 (const int) +0:131 Constant: +0:131 1 (const int) +0:132 move second child to first child ( temp 3-component vector of double) +0:132 vector swizzle ( temp 3-component vector of double) +0:132 d: direct index for structure ( temp 4-component vector of double) +0:132 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:132 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:132 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:132 Constant: +0:132 0 (const uint) +0:132 direct index ( temp uint) +0:132 'dti' ( in 3-component vector of uint) +0:132 Constant: +0:132 0 (const int) +0:132 Constant: +0:132 3 (const int) +0:132 Sequence +0:132 Constant: +0:132 0 (const int) +0:132 Constant: +0:132 1 (const int) +0:132 Constant: +0:132 2 (const int) +0:132 subgroupQuadSwapVertical ( temp 3-component vector of double) +0:132 vector swizzle ( temp 3-component vector of double) +0:132 d: direct index for structure ( temp 4-component vector of double) +0:132 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:132 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:132 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:132 Constant: +0:132 0 (const uint) +0:132 direct index ( temp uint) +0:132 'dti' ( in 3-component vector of uint) +0:132 Constant: +0:132 0 (const int) +0:132 Constant: +0:132 3 (const int) +0:132 Sequence +0:132 Constant: +0:132 0 (const int) +0:132 Constant: +0:132 1 (const int) +0:132 Constant: +0:132 2 (const int) +0:134 move second child to first child ( temp 4-component vector of uint) +0:134 u: direct index for structure ( temp 4-component vector of uint) +0:134 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:134 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:134 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:134 Constant: +0:134 0 (const uint) +0:134 direct index ( temp uint) +0:134 'dti' ( in 3-component vector of uint) +0:134 Constant: +0:134 0 (const int) +0:134 Constant: +0:134 0 (const int) +0:134 subgroupQuadSwapDiagonal ( temp 4-component vector of uint) +0:134 u: direct index for structure ( temp 4-component vector of uint) +0:134 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:134 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:134 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:134 Constant: +0:134 0 (const uint) +0:134 direct index ( temp uint) +0:134 'dti' ( in 3-component vector of uint) +0:134 Constant: +0:134 0 (const int) +0:134 Constant: +0:134 0 (const int) +0:135 move second child to first child ( temp uint) +0:135 direct index ( temp uint) +0:135 u: direct index for structure ( temp 4-component vector of uint) +0:135 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:135 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:135 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:135 Constant: +0:135 0 (const uint) +0:135 direct index ( temp uint) +0:135 'dti' ( in 3-component vector of uint) +0:135 Constant: +0:135 0 (const int) +0:135 Constant: +0:135 0 (const int) +0:135 Constant: +0:135 0 (const int) +0:135 subgroupQuadSwapDiagonal ( temp uint) +0:135 direct index ( temp uint) +0:135 u: direct index for structure ( temp 4-component vector of uint) +0:135 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:135 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:135 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:135 Constant: +0:135 0 (const uint) +0:135 direct index ( temp uint) +0:135 'dti' ( in 3-component vector of uint) +0:135 Constant: +0:135 0 (const int) +0:135 Constant: +0:135 0 (const int) +0:135 Constant: +0:135 0 (const int) +0:136 move second child to first child ( temp 2-component vector of uint) +0:136 vector swizzle ( temp 2-component vector of uint) +0:136 u: direct index for structure ( temp 4-component vector of uint) +0:136 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:136 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:136 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:136 Constant: +0:136 0 (const uint) +0:136 direct index ( temp uint) +0:136 'dti' ( in 3-component vector of uint) +0:136 Constant: +0:136 0 (const int) +0:136 Constant: +0:136 0 (const int) +0:136 Sequence +0:136 Constant: +0:136 0 (const int) +0:136 Constant: +0:136 1 (const int) +0:136 subgroupQuadSwapDiagonal ( temp 2-component vector of uint) +0:136 vector swizzle ( temp 2-component vector of uint) +0:136 u: direct index for structure ( temp 4-component vector of uint) +0:136 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:136 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:136 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:136 Constant: +0:136 0 (const uint) +0:136 direct index ( temp uint) +0:136 'dti' ( in 3-component vector of uint) +0:136 Constant: +0:136 0 (const int) +0:136 Constant: +0:136 0 (const int) +0:136 Sequence +0:136 Constant: +0:136 0 (const int) +0:136 Constant: +0:136 1 (const int) +0:137 move second child to first child ( temp 3-component vector of uint) +0:137 vector swizzle ( temp 3-component vector of uint) +0:137 u: direct index for structure ( temp 4-component vector of uint) +0:137 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:137 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:137 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:137 Constant: +0:137 0 (const uint) +0:137 direct index ( temp uint) +0:137 'dti' ( in 3-component vector of uint) +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 0 (const int) +0:137 Sequence +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 1 (const int) +0:137 Constant: +0:137 2 (const int) +0:137 subgroupQuadSwapDiagonal ( temp 3-component vector of uint) +0:137 vector swizzle ( temp 3-component vector of uint) +0:137 u: direct index for structure ( temp 4-component vector of uint) +0:137 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:137 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:137 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:137 Constant: +0:137 0 (const uint) +0:137 direct index ( temp uint) +0:137 'dti' ( in 3-component vector of uint) +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 0 (const int) +0:137 Sequence +0:137 Constant: +0:137 0 (const int) +0:137 Constant: +0:137 1 (const int) +0:137 Constant: +0:137 2 (const int) +0:139 move second child to first child ( temp 4-component vector of int) +0:139 i: direct index for structure ( temp 4-component vector of int) +0:139 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:139 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:139 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:139 Constant: +0:139 0 (const uint) +0:139 direct index ( temp uint) +0:139 'dti' ( in 3-component vector of uint) +0:139 Constant: +0:139 0 (const int) +0:139 Constant: +0:139 1 (const int) +0:139 subgroupQuadSwapDiagonal ( temp 4-component vector of int) +0:139 i: direct index for structure ( temp 4-component vector of int) +0:139 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:139 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:139 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:139 Constant: +0:139 0 (const uint) +0:139 direct index ( temp uint) +0:139 'dti' ( in 3-component vector of uint) +0:139 Constant: +0:139 0 (const int) +0:139 Constant: +0:139 1 (const int) +0:140 move second child to first child ( temp int) +0:140 direct index ( temp int) +0:140 i: direct index for structure ( temp 4-component vector of int) +0:140 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:140 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:140 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:140 Constant: +0:140 0 (const uint) +0:140 direct index ( temp uint) +0:140 'dti' ( in 3-component vector of uint) +0:140 Constant: +0:140 0 (const int) +0:140 Constant: +0:140 1 (const int) +0:140 Constant: +0:140 0 (const int) +0:140 subgroupQuadSwapDiagonal ( temp int) +0:140 direct index ( temp int) +0:140 i: direct index for structure ( temp 4-component vector of int) +0:140 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:140 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:140 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:140 Constant: +0:140 0 (const uint) +0:140 direct index ( temp uint) +0:140 'dti' ( in 3-component vector of uint) +0:140 Constant: +0:140 0 (const int) +0:140 Constant: +0:140 1 (const int) +0:140 Constant: +0:140 0 (const int) +0:141 move second child to first child ( temp 2-component vector of int) +0:141 vector swizzle ( temp 2-component vector of int) +0:141 i: direct index for structure ( temp 4-component vector of int) +0:141 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:141 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:141 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:141 Constant: +0:141 0 (const uint) +0:141 direct index ( temp uint) +0:141 'dti' ( in 3-component vector of uint) +0:141 Constant: +0:141 0 (const int) +0:141 Constant: +0:141 1 (const int) +0:141 Sequence +0:141 Constant: +0:141 0 (const int) +0:141 Constant: +0:141 1 (const int) +0:141 subgroupQuadSwapDiagonal ( temp 2-component vector of int) +0:141 vector swizzle ( temp 2-component vector of int) +0:141 i: direct index for structure ( temp 4-component vector of int) +0:141 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:141 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:141 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:141 Constant: +0:141 0 (const uint) +0:141 direct index ( temp uint) +0:141 'dti' ( in 3-component vector of uint) +0:141 Constant: +0:141 0 (const int) +0:141 Constant: +0:141 1 (const int) +0:141 Sequence +0:141 Constant: +0:141 0 (const int) +0:141 Constant: +0:141 1 (const int) +0:142 move second child to first child ( temp 3-component vector of int) +0:142 vector swizzle ( temp 3-component vector of int) +0:142 i: direct index for structure ( temp 4-component vector of int) +0:142 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:142 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:142 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:142 Constant: +0:142 0 (const uint) +0:142 direct index ( temp uint) +0:142 'dti' ( in 3-component vector of uint) +0:142 Constant: +0:142 0 (const int) +0:142 Constant: +0:142 1 (const int) +0:142 Sequence +0:142 Constant: +0:142 0 (const int) +0:142 Constant: +0:142 1 (const int) +0:142 Constant: +0:142 2 (const int) +0:142 subgroupQuadSwapDiagonal ( temp 3-component vector of int) +0:142 vector swizzle ( temp 3-component vector of int) +0:142 i: direct index for structure ( temp 4-component vector of int) +0:142 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:142 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:142 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:142 Constant: +0:142 0 (const uint) +0:142 direct index ( temp uint) +0:142 'dti' ( in 3-component vector of uint) +0:142 Constant: +0:142 0 (const int) +0:142 Constant: +0:142 1 (const int) +0:142 Sequence +0:142 Constant: +0:142 0 (const int) +0:142 Constant: +0:142 1 (const int) +0:142 Constant: +0:142 2 (const int) +0:144 move second child to first child ( temp 4-component vector of float) +0:144 f: direct index for structure ( temp 4-component vector of float) +0:144 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:144 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:144 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:144 Constant: +0:144 0 (const uint) +0:144 direct index ( temp uint) +0:144 'dti' ( in 3-component vector of uint) +0:144 Constant: +0:144 0 (const int) +0:144 Constant: +0:144 2 (const int) +0:144 subgroupQuadSwapDiagonal ( temp 4-component vector of float) +0:144 f: direct index for structure ( temp 4-component vector of float) +0:144 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:144 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:144 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:144 Constant: +0:144 0 (const uint) +0:144 direct index ( temp uint) +0:144 'dti' ( in 3-component vector of uint) +0:144 Constant: +0:144 0 (const int) +0:144 Constant: +0:144 2 (const int) +0:145 move second child to first child ( temp float) +0:145 direct index ( temp float) +0:145 f: direct index for structure ( temp 4-component vector of float) +0:145 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:145 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:145 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:145 Constant: +0:145 0 (const uint) +0:145 direct index ( temp uint) +0:145 'dti' ( in 3-component vector of uint) +0:145 Constant: +0:145 0 (const int) +0:145 Constant: +0:145 2 (const int) +0:145 Constant: +0:145 0 (const int) +0:145 subgroupQuadSwapDiagonal ( temp float) +0:145 direct index ( temp float) +0:145 f: direct index for structure ( temp 4-component vector of float) +0:145 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:145 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:145 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:145 Constant: +0:145 0 (const uint) +0:145 direct index ( temp uint) +0:145 'dti' ( in 3-component vector of uint) +0:145 Constant: +0:145 0 (const int) +0:145 Constant: +0:145 2 (const int) +0:145 Constant: +0:145 0 (const int) +0:146 move second child to first child ( temp 2-component vector of float) +0:146 vector swizzle ( temp 2-component vector of float) +0:146 f: direct index for structure ( temp 4-component vector of float) +0:146 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:146 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:146 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:146 Constant: +0:146 0 (const uint) +0:146 direct index ( temp uint) +0:146 'dti' ( in 3-component vector of uint) +0:146 Constant: +0:146 0 (const int) +0:146 Constant: +0:146 2 (const int) +0:146 Sequence +0:146 Constant: +0:146 0 (const int) +0:146 Constant: +0:146 1 (const int) +0:146 subgroupQuadSwapDiagonal ( temp 2-component vector of float) +0:146 vector swizzle ( temp 2-component vector of float) +0:146 f: direct index for structure ( temp 4-component vector of float) +0:146 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:146 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:146 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:146 Constant: +0:146 0 (const uint) +0:146 direct index ( temp uint) +0:146 'dti' ( in 3-component vector of uint) +0:146 Constant: +0:146 0 (const int) +0:146 Constant: +0:146 2 (const int) +0:146 Sequence +0:146 Constant: +0:146 0 (const int) +0:146 Constant: +0:146 1 (const int) +0:147 move second child to first child ( temp 3-component vector of float) +0:147 vector swizzle ( temp 3-component vector of float) +0:147 f: direct index for structure ( temp 4-component vector of float) +0:147 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:147 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:147 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:147 Constant: +0:147 0 (const uint) +0:147 direct index ( temp uint) +0:147 'dti' ( in 3-component vector of uint) +0:147 Constant: +0:147 0 (const int) +0:147 Constant: +0:147 2 (const int) +0:147 Sequence +0:147 Constant: +0:147 0 (const int) +0:147 Constant: +0:147 1 (const int) +0:147 Constant: +0:147 2 (const int) +0:147 subgroupQuadSwapDiagonal ( temp 3-component vector of float) +0:147 vector swizzle ( temp 3-component vector of float) +0:147 f: direct index for structure ( temp 4-component vector of float) +0:147 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:147 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:147 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:147 Constant: +0:147 0 (const uint) +0:147 direct index ( temp uint) +0:147 'dti' ( in 3-component vector of uint) +0:147 Constant: +0:147 0 (const int) +0:147 Constant: +0:147 2 (const int) +0:147 Sequence +0:147 Constant: +0:147 0 (const int) +0:147 Constant: +0:147 1 (const int) +0:147 Constant: +0:147 2 (const int) +0:149 move second child to first child ( temp 4-component vector of double) +0:149 d: direct index for structure ( temp 4-component vector of double) +0:149 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:149 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:149 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:149 Constant: +0:149 0 (const uint) +0:149 direct index ( temp uint) +0:149 'dti' ( in 3-component vector of uint) +0:149 Constant: +0:149 0 (const int) +0:149 Constant: +0:149 3 (const int) +0:149 subgroupQuadSwapDiagonal ( temp 4-component vector of double) +0:149 d: direct index for structure ( temp 4-component vector of double) +0:149 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:149 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:149 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:149 Constant: +0:149 0 (const uint) +0:149 direct index ( temp uint) +0:149 'dti' ( in 3-component vector of uint) +0:149 Constant: +0:149 0 (const int) +0:149 Constant: +0:149 3 (const int) +0:150 move second child to first child ( temp double) +0:150 direct index ( temp double) +0:150 d: direct index for structure ( temp 4-component vector of double) +0:150 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:150 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:150 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:150 Constant: +0:150 0 (const uint) +0:150 direct index ( temp uint) +0:150 'dti' ( in 3-component vector of uint) +0:150 Constant: +0:150 0 (const int) +0:150 Constant: +0:150 3 (const int) +0:150 Constant: +0:150 0 (const int) +0:150 subgroupQuadSwapDiagonal ( temp double) +0:150 direct index ( temp double) +0:150 d: direct index for structure ( temp 4-component vector of double) +0:150 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:150 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:150 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:150 Constant: +0:150 0 (const uint) +0:150 direct index ( temp uint) +0:150 'dti' ( in 3-component vector of uint) +0:150 Constant: +0:150 0 (const int) +0:150 Constant: +0:150 3 (const int) +0:150 Constant: +0:150 0 (const int) +0:151 move second child to first child ( temp 2-component vector of double) +0:151 vector swizzle ( temp 2-component vector of double) +0:151 d: direct index for structure ( temp 4-component vector of double) +0:151 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:151 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:151 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:151 Constant: +0:151 0 (const uint) +0:151 direct index ( temp uint) +0:151 'dti' ( in 3-component vector of uint) +0:151 Constant: +0:151 0 (const int) +0:151 Constant: +0:151 3 (const int) +0:151 Sequence +0:151 Constant: +0:151 0 (const int) +0:151 Constant: +0:151 1 (const int) +0:151 subgroupQuadSwapDiagonal ( temp 2-component vector of double) +0:151 vector swizzle ( temp 2-component vector of double) +0:151 d: direct index for structure ( temp 4-component vector of double) +0:151 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:151 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:151 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:151 Constant: +0:151 0 (const uint) +0:151 direct index ( temp uint) +0:151 'dti' ( in 3-component vector of uint) +0:151 Constant: +0:151 0 (const int) +0:151 Constant: +0:151 3 (const int) +0:151 Sequence +0:151 Constant: +0:151 0 (const int) +0:151 Constant: +0:151 1 (const int) +0:152 move second child to first child ( temp 3-component vector of double) +0:152 vector swizzle ( temp 3-component vector of double) +0:152 d: direct index for structure ( temp 4-component vector of double) +0:152 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:152 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:152 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:152 Constant: +0:152 0 (const uint) +0:152 direct index ( temp uint) +0:152 'dti' ( in 3-component vector of uint) +0:152 Constant: +0:152 0 (const int) +0:152 Constant: +0:152 3 (const int) +0:152 Sequence +0:152 Constant: +0:152 0 (const int) +0:152 Constant: +0:152 1 (const int) +0:152 Constant: +0:152 2 (const int) +0:152 subgroupQuadSwapDiagonal ( temp 3-component vector of double) +0:152 vector swizzle ( temp 3-component vector of double) +0:152 d: direct index for structure ( temp 4-component vector of double) +0:152 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:152 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:152 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:152 Constant: +0:152 0 (const uint) +0:152 direct index ( temp uint) +0:152 'dti' ( in 3-component vector of uint) +0:152 Constant: +0:152 0 (const int) +0:152 Constant: +0:152 3 (const int) +0:152 Sequence +0:152 Constant: +0:152 0 (const int) +0:152 Constant: +0:152 1 (const int) +0:152 Constant: +0:152 2 (const int) +0:13 Function Definition: CSMain( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-component vector of uint) +0:? 'dti' ( temp 3-component vector of uint) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) +0:13 Function Call: @CSMain(vu3; ( temp void) +0:? 'dti' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) + +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 1120 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformQuad + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "CSMain" 1115 + ExecutionMode 4 LocalSize 32 16 1 + Source HLSL 500 + Name 4 "CSMain" + Name 11 "@CSMain(vu3;" + Name 10 "dti" + Name 20 "Types" + MemberName 20(Types) 0 "u" + MemberName 20(Types) 1 "i" + MemberName 20(Types) 2 "f" + MemberName 20(Types) 3 "d" + Name 22 "data" + MemberName 22(data) 0 "@data" + Name 24 "data" + Name 1113 "dti" + Name 1115 "dti" + Name 1117 "param" + MemberDecorate 20(Types) 0 Offset 0 + MemberDecorate 20(Types) 1 Offset 16 + MemberDecorate 20(Types) 2 Offset 32 + MemberDecorate 20(Types) 3 Offset 64 + Decorate 21 ArrayStride 96 + MemberDecorate 22(data) 0 Offset 0 + Decorate 22(data) BufferBlock + Decorate 24(data) DescriptorSet 0 + Decorate 1115(dti) BuiltIn GlobalInvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 9: TypeFunction 2 8(ptr) + 13: TypeVector 6(int) 4 + 14: TypeInt 32 1 + 15: TypeVector 14(int) 4 + 16: TypeFloat 32 + 17: TypeVector 16(float) 4 + 18: TypeFloat 64 + 19: TypeVector 18(float64_t) 4 + 20(Types): TypeStruct 13(ivec4) 15(ivec4) 17(fvec4) 19(f64vec4) + 21: TypeRuntimeArray 20(Types) + 22(data): TypeStruct 21 + 23: TypePointer Uniform 22(data) + 24(data): 23(ptr) Variable Uniform + 25: 14(int) Constant 0 + 26: 6(int) Constant 0 + 27: TypePointer Function 6(int) + 32: TypePointer Uniform 13(ivec4) + 35: 6(int) Constant 3 + 42: TypePointer Uniform 6(int) + 51: TypeVector 6(int) 2 + 72: 14(int) Constant 1 + 75: TypePointer Uniform 15(ivec4) + 84: TypePointer Uniform 14(int) + 93: TypeVector 14(int) 2 + 105: TypeVector 14(int) 3 + 115: 14(int) Constant 2 + 118: TypePointer Uniform 17(fvec4) + 127: TypePointer Uniform 16(float) + 136: TypeVector 16(float) 2 + 148: TypeVector 16(float) 3 + 158: 14(int) Constant 3 + 161: TypePointer Uniform 19(f64vec4) + 170: TypePointer Uniform 18(float64_t) + 179: TypeVector 18(float64_t) 2 + 191: TypeVector 18(float64_t) 3 + 205: 6(int) Constant 1 + 358: 6(int) Constant 2 + 1114: TypePointer Input 7(ivec3) + 1115(dti): 1114(ptr) Variable Input + 4(CSMain): 2 Function None 3 + 5: Label + 1113(dti): 8(ptr) Variable Function + 1117(param): 8(ptr) Variable Function + 1116: 7(ivec3) Load 1115(dti) + Store 1113(dti) 1116 + 1118: 7(ivec3) Load 1113(dti) + Store 1117(param) 1118 + 1119: 2 FunctionCall 11(@CSMain(vu3;) 1117(param) + Return + FunctionEnd +11(@CSMain(vu3;): 2 Function None 9 + 10(dti): 8(ptr) FunctionParameter + 12: Label + 28: 27(ptr) AccessChain 10(dti) 26 + 29: 6(int) Load 28 + 30: 27(ptr) AccessChain 10(dti) 26 + 31: 6(int) Load 30 + 33: 32(ptr) AccessChain 24(data) 25 31 25 + 34: 13(ivec4) Load 33 + 36: 13(ivec4) GroupNonUniformQuadBroadcast 35 34 26 + 37: 32(ptr) AccessChain 24(data) 25 29 25 + Store 37 36 + 38: 27(ptr) AccessChain 10(dti) 26 + 39: 6(int) Load 38 + 40: 27(ptr) AccessChain 10(dti) 26 + 41: 6(int) Load 40 + 43: 42(ptr) AccessChain 24(data) 25 41 25 26 + 44: 6(int) Load 43 + 45: 6(int) GroupNonUniformQuadBroadcast 35 44 26 + 46: 42(ptr) AccessChain 24(data) 25 39 25 26 + Store 46 45 + 47: 27(ptr) AccessChain 10(dti) 26 + 48: 6(int) Load 47 + 49: 27(ptr) AccessChain 10(dti) 26 + 50: 6(int) Load 49 + 52: 32(ptr) AccessChain 24(data) 25 50 25 + 53: 13(ivec4) Load 52 + 54: 51(ivec2) VectorShuffle 53 53 0 1 + 55: 51(ivec2) GroupNonUniformQuadBroadcast 35 54 26 + 56: 32(ptr) AccessChain 24(data) 25 48 25 + 57: 13(ivec4) Load 56 + 58: 13(ivec4) VectorShuffle 57 55 4 5 2 3 + Store 56 58 + 59: 27(ptr) AccessChain 10(dti) 26 + 60: 6(int) Load 59 + 61: 27(ptr) AccessChain 10(dti) 26 + 62: 6(int) Load 61 + 63: 32(ptr) AccessChain 24(data) 25 62 25 + 64: 13(ivec4) Load 63 + 65: 7(ivec3) VectorShuffle 64 64 0 1 2 + 66: 7(ivec3) GroupNonUniformQuadBroadcast 35 65 26 + 67: 32(ptr) AccessChain 24(data) 25 60 25 + 68: 13(ivec4) Load 67 + 69: 13(ivec4) VectorShuffle 68 66 4 5 6 3 + Store 67 69 + 70: 27(ptr) AccessChain 10(dti) 26 + 71: 6(int) Load 70 + 73: 27(ptr) AccessChain 10(dti) 26 + 74: 6(int) Load 73 + 76: 75(ptr) AccessChain 24(data) 25 74 72 + 77: 15(ivec4) Load 76 + 78: 15(ivec4) GroupNonUniformQuadBroadcast 35 77 26 + 79: 75(ptr) AccessChain 24(data) 25 71 72 + Store 79 78 + 80: 27(ptr) AccessChain 10(dti) 26 + 81: 6(int) Load 80 + 82: 27(ptr) AccessChain 10(dti) 26 + 83: 6(int) Load 82 + 85: 84(ptr) AccessChain 24(data) 25 83 72 26 + 86: 14(int) Load 85 + 87: 14(int) GroupNonUniformQuadBroadcast 35 86 26 + 88: 84(ptr) AccessChain 24(data) 25 81 72 26 + Store 88 87 + 89: 27(ptr) AccessChain 10(dti) 26 + 90: 6(int) Load 89 + 91: 27(ptr) AccessChain 10(dti) 26 + 92: 6(int) Load 91 + 94: 75(ptr) AccessChain 24(data) 25 92 72 + 95: 15(ivec4) Load 94 + 96: 93(ivec2) VectorShuffle 95 95 0 1 + 97: 93(ivec2) GroupNonUniformQuadBroadcast 35 96 26 + 98: 75(ptr) AccessChain 24(data) 25 90 72 + 99: 15(ivec4) Load 98 + 100: 15(ivec4) VectorShuffle 99 97 4 5 2 3 + Store 98 100 + 101: 27(ptr) AccessChain 10(dti) 26 + 102: 6(int) Load 101 + 103: 27(ptr) AccessChain 10(dti) 26 + 104: 6(int) Load 103 + 106: 75(ptr) AccessChain 24(data) 25 104 72 + 107: 15(ivec4) Load 106 + 108: 105(ivec3) VectorShuffle 107 107 0 1 2 + 109: 105(ivec3) GroupNonUniformQuadBroadcast 35 108 26 + 110: 75(ptr) AccessChain 24(data) 25 102 72 + 111: 15(ivec4) Load 110 + 112: 15(ivec4) VectorShuffle 111 109 4 5 6 3 + Store 110 112 + 113: 27(ptr) AccessChain 10(dti) 26 + 114: 6(int) Load 113 + 116: 27(ptr) AccessChain 10(dti) 26 + 117: 6(int) Load 116 + 119: 118(ptr) AccessChain 24(data) 25 117 115 + 120: 17(fvec4) Load 119 + 121: 17(fvec4) GroupNonUniformQuadBroadcast 35 120 26 + 122: 118(ptr) AccessChain 24(data) 25 114 115 + Store 122 121 + 123: 27(ptr) AccessChain 10(dti) 26 + 124: 6(int) Load 123 + 125: 27(ptr) AccessChain 10(dti) 26 + 126: 6(int) Load 125 + 128: 127(ptr) AccessChain 24(data) 25 126 115 26 + 129: 16(float) Load 128 + 130: 16(float) GroupNonUniformQuadBroadcast 35 129 26 + 131: 127(ptr) AccessChain 24(data) 25 124 115 26 + Store 131 130 + 132: 27(ptr) AccessChain 10(dti) 26 + 133: 6(int) Load 132 + 134: 27(ptr) AccessChain 10(dti) 26 + 135: 6(int) Load 134 + 137: 118(ptr) AccessChain 24(data) 25 135 115 + 138: 17(fvec4) Load 137 + 139: 136(fvec2) VectorShuffle 138 138 0 1 + 140: 136(fvec2) GroupNonUniformQuadBroadcast 35 139 26 + 141: 118(ptr) AccessChain 24(data) 25 133 115 + 142: 17(fvec4) Load 141 + 143: 17(fvec4) VectorShuffle 142 140 4 5 2 3 + Store 141 143 + 144: 27(ptr) AccessChain 10(dti) 26 + 145: 6(int) Load 144 + 146: 27(ptr) AccessChain 10(dti) 26 + 147: 6(int) Load 146 + 149: 118(ptr) AccessChain 24(data) 25 147 115 + 150: 17(fvec4) Load 149 + 151: 148(fvec3) VectorShuffle 150 150 0 1 2 + 152: 148(fvec3) GroupNonUniformQuadBroadcast 35 151 26 + 153: 118(ptr) AccessChain 24(data) 25 145 115 + 154: 17(fvec4) Load 153 + 155: 17(fvec4) VectorShuffle 154 152 4 5 6 3 + Store 153 155 + 156: 27(ptr) AccessChain 10(dti) 26 + 157: 6(int) Load 156 + 159: 27(ptr) AccessChain 10(dti) 26 + 160: 6(int) Load 159 + 162: 161(ptr) AccessChain 24(data) 25 160 158 + 163: 19(f64vec4) Load 162 + 164: 19(f64vec4) GroupNonUniformQuadBroadcast 35 163 26 + 165: 161(ptr) AccessChain 24(data) 25 157 158 + Store 165 164 + 166: 27(ptr) AccessChain 10(dti) 26 + 167: 6(int) Load 166 + 168: 27(ptr) AccessChain 10(dti) 26 + 169: 6(int) Load 168 + 171: 170(ptr) AccessChain 24(data) 25 169 158 26 + 172:18(float64_t) Load 171 + 173:18(float64_t) GroupNonUniformQuadBroadcast 35 172 26 + 174: 170(ptr) AccessChain 24(data) 25 167 158 26 + Store 174 173 + 175: 27(ptr) AccessChain 10(dti) 26 + 176: 6(int) Load 175 + 177: 27(ptr) AccessChain 10(dti) 26 + 178: 6(int) Load 177 + 180: 161(ptr) AccessChain 24(data) 25 178 158 + 181: 19(f64vec4) Load 180 + 182:179(f64vec2) VectorShuffle 181 181 0 1 + 183:179(f64vec2) GroupNonUniformQuadBroadcast 35 182 26 + 184: 161(ptr) AccessChain 24(data) 25 176 158 + 185: 19(f64vec4) Load 184 + 186: 19(f64vec4) VectorShuffle 185 183 4 5 2 3 + Store 184 186 + 187: 27(ptr) AccessChain 10(dti) 26 + 188: 6(int) Load 187 + 189: 27(ptr) AccessChain 10(dti) 26 + 190: 6(int) Load 189 + 192: 161(ptr) AccessChain 24(data) 25 190 158 + 193: 19(f64vec4) Load 192 + 194:191(f64vec3) VectorShuffle 193 193 0 1 2 + 195:191(f64vec3) GroupNonUniformQuadBroadcast 35 194 26 + 196: 161(ptr) AccessChain 24(data) 25 188 158 + 197: 19(f64vec4) Load 196 + 198: 19(f64vec4) VectorShuffle 197 195 4 5 6 3 + Store 196 198 + 199: 27(ptr) AccessChain 10(dti) 26 + 200: 6(int) Load 199 + 201: 27(ptr) AccessChain 10(dti) 26 + 202: 6(int) Load 201 + 203: 32(ptr) AccessChain 24(data) 25 202 25 + 204: 13(ivec4) Load 203 + 206: 13(ivec4) GroupNonUniformQuadBroadcast 35 204 205 + 207: 32(ptr) AccessChain 24(data) 25 200 25 + Store 207 206 + 208: 27(ptr) AccessChain 10(dti) 26 + 209: 6(int) Load 208 + 210: 27(ptr) AccessChain 10(dti) 26 + 211: 6(int) Load 210 + 212: 42(ptr) AccessChain 24(data) 25 211 25 26 + 213: 6(int) Load 212 + 214: 6(int) GroupNonUniformQuadBroadcast 35 213 205 + 215: 42(ptr) AccessChain 24(data) 25 209 25 26 + Store 215 214 + 216: 27(ptr) AccessChain 10(dti) 26 + 217: 6(int) Load 216 + 218: 27(ptr) AccessChain 10(dti) 26 + 219: 6(int) Load 218 + 220: 32(ptr) AccessChain 24(data) 25 219 25 + 221: 13(ivec4) Load 220 + 222: 51(ivec2) VectorShuffle 221 221 0 1 + 223: 51(ivec2) GroupNonUniformQuadBroadcast 35 222 205 + 224: 32(ptr) AccessChain 24(data) 25 217 25 + 225: 13(ivec4) Load 224 + 226: 13(ivec4) VectorShuffle 225 223 4 5 2 3 + Store 224 226 + 227: 27(ptr) AccessChain 10(dti) 26 + 228: 6(int) Load 227 + 229: 27(ptr) AccessChain 10(dti) 26 + 230: 6(int) Load 229 + 231: 32(ptr) AccessChain 24(data) 25 230 25 + 232: 13(ivec4) Load 231 + 233: 7(ivec3) VectorShuffle 232 232 0 1 2 + 234: 7(ivec3) GroupNonUniformQuadBroadcast 35 233 205 + 235: 32(ptr) AccessChain 24(data) 25 228 25 + 236: 13(ivec4) Load 235 + 237: 13(ivec4) VectorShuffle 236 234 4 5 6 3 + Store 235 237 + 238: 27(ptr) AccessChain 10(dti) 26 + 239: 6(int) Load 238 + 240: 27(ptr) AccessChain 10(dti) 26 + 241: 6(int) Load 240 + 242: 75(ptr) AccessChain 24(data) 25 241 72 + 243: 15(ivec4) Load 242 + 244: 15(ivec4) GroupNonUniformQuadBroadcast 35 243 205 + 245: 75(ptr) AccessChain 24(data) 25 239 72 + Store 245 244 + 246: 27(ptr) AccessChain 10(dti) 26 + 247: 6(int) Load 246 + 248: 27(ptr) AccessChain 10(dti) 26 + 249: 6(int) Load 248 + 250: 84(ptr) AccessChain 24(data) 25 249 72 26 + 251: 14(int) Load 250 + 252: 14(int) GroupNonUniformQuadBroadcast 35 251 205 + 253: 84(ptr) AccessChain 24(data) 25 247 72 26 + Store 253 252 + 254: 27(ptr) AccessChain 10(dti) 26 + 255: 6(int) Load 254 + 256: 27(ptr) AccessChain 10(dti) 26 + 257: 6(int) Load 256 + 258: 75(ptr) AccessChain 24(data) 25 257 72 + 259: 15(ivec4) Load 258 + 260: 93(ivec2) VectorShuffle 259 259 0 1 + 261: 93(ivec2) GroupNonUniformQuadBroadcast 35 260 205 + 262: 75(ptr) AccessChain 24(data) 25 255 72 + 263: 15(ivec4) Load 262 + 264: 15(ivec4) VectorShuffle 263 261 4 5 2 3 + Store 262 264 + 265: 27(ptr) AccessChain 10(dti) 26 + 266: 6(int) Load 265 + 267: 27(ptr) AccessChain 10(dti) 26 + 268: 6(int) Load 267 + 269: 75(ptr) AccessChain 24(data) 25 268 72 + 270: 15(ivec4) Load 269 + 271: 105(ivec3) VectorShuffle 270 270 0 1 2 + 272: 105(ivec3) GroupNonUniformQuadBroadcast 35 271 205 + 273: 75(ptr) AccessChain 24(data) 25 266 72 + 274: 15(ivec4) Load 273 + 275: 15(ivec4) VectorShuffle 274 272 4 5 6 3 + Store 273 275 + 276: 27(ptr) AccessChain 10(dti) 26 + 277: 6(int) Load 276 + 278: 27(ptr) AccessChain 10(dti) 26 + 279: 6(int) Load 278 + 280: 118(ptr) AccessChain 24(data) 25 279 115 + 281: 17(fvec4) Load 280 + 282: 17(fvec4) GroupNonUniformQuadBroadcast 35 281 205 + 283: 118(ptr) AccessChain 24(data) 25 277 115 + Store 283 282 + 284: 27(ptr) AccessChain 10(dti) 26 + 285: 6(int) Load 284 + 286: 27(ptr) AccessChain 10(dti) 26 + 287: 6(int) Load 286 + 288: 127(ptr) AccessChain 24(data) 25 287 115 26 + 289: 16(float) Load 288 + 290: 16(float) GroupNonUniformQuadBroadcast 35 289 205 + 291: 127(ptr) AccessChain 24(data) 25 285 115 26 + Store 291 290 + 292: 27(ptr) AccessChain 10(dti) 26 + 293: 6(int) Load 292 + 294: 27(ptr) AccessChain 10(dti) 26 + 295: 6(int) Load 294 + 296: 118(ptr) AccessChain 24(data) 25 295 115 + 297: 17(fvec4) Load 296 + 298: 136(fvec2) VectorShuffle 297 297 0 1 + 299: 136(fvec2) GroupNonUniformQuadBroadcast 35 298 205 + 300: 118(ptr) AccessChain 24(data) 25 293 115 + 301: 17(fvec4) Load 300 + 302: 17(fvec4) VectorShuffle 301 299 4 5 2 3 + Store 300 302 + 303: 27(ptr) AccessChain 10(dti) 26 + 304: 6(int) Load 303 + 305: 27(ptr) AccessChain 10(dti) 26 + 306: 6(int) Load 305 + 307: 118(ptr) AccessChain 24(data) 25 306 115 + 308: 17(fvec4) Load 307 + 309: 148(fvec3) VectorShuffle 308 308 0 1 2 + 310: 148(fvec3) GroupNonUniformQuadBroadcast 35 309 205 + 311: 118(ptr) AccessChain 24(data) 25 304 115 + 312: 17(fvec4) Load 311 + 313: 17(fvec4) VectorShuffle 312 310 4 5 6 3 + Store 311 313 + 314: 27(ptr) AccessChain 10(dti) 26 + 315: 6(int) Load 314 + 316: 27(ptr) AccessChain 10(dti) 26 + 317: 6(int) Load 316 + 318: 161(ptr) AccessChain 24(data) 25 317 158 + 319: 19(f64vec4) Load 318 + 320: 19(f64vec4) GroupNonUniformQuadBroadcast 35 319 205 + 321: 161(ptr) AccessChain 24(data) 25 315 158 + Store 321 320 + 322: 27(ptr) AccessChain 10(dti) 26 + 323: 6(int) Load 322 + 324: 27(ptr) AccessChain 10(dti) 26 + 325: 6(int) Load 324 + 326: 170(ptr) AccessChain 24(data) 25 325 158 26 + 327:18(float64_t) Load 326 + 328:18(float64_t) GroupNonUniformQuadBroadcast 35 327 205 + 329: 170(ptr) AccessChain 24(data) 25 323 158 26 + Store 329 328 + 330: 27(ptr) AccessChain 10(dti) 26 + 331: 6(int) Load 330 + 332: 27(ptr) AccessChain 10(dti) 26 + 333: 6(int) Load 332 + 334: 161(ptr) AccessChain 24(data) 25 333 158 + 335: 19(f64vec4) Load 334 + 336:179(f64vec2) VectorShuffle 335 335 0 1 + 337:179(f64vec2) GroupNonUniformQuadBroadcast 35 336 205 + 338: 161(ptr) AccessChain 24(data) 25 331 158 + 339: 19(f64vec4) Load 338 + 340: 19(f64vec4) VectorShuffle 339 337 4 5 2 3 + Store 338 340 + 341: 27(ptr) AccessChain 10(dti) 26 + 342: 6(int) Load 341 + 343: 27(ptr) AccessChain 10(dti) 26 + 344: 6(int) Load 343 + 345: 161(ptr) AccessChain 24(data) 25 344 158 + 346: 19(f64vec4) Load 345 + 347:191(f64vec3) VectorShuffle 346 346 0 1 2 + 348:191(f64vec3) GroupNonUniformQuadBroadcast 35 347 205 + 349: 161(ptr) AccessChain 24(data) 25 342 158 + 350: 19(f64vec4) Load 349 + 351: 19(f64vec4) VectorShuffle 350 348 4 5 6 3 + Store 349 351 + 352: 27(ptr) AccessChain 10(dti) 26 + 353: 6(int) Load 352 + 354: 27(ptr) AccessChain 10(dti) 26 + 355: 6(int) Load 354 + 356: 32(ptr) AccessChain 24(data) 25 355 25 + 357: 13(ivec4) Load 356 + 359: 13(ivec4) GroupNonUniformQuadBroadcast 35 357 358 + 360: 32(ptr) AccessChain 24(data) 25 353 25 + Store 360 359 + 361: 27(ptr) AccessChain 10(dti) 26 + 362: 6(int) Load 361 + 363: 27(ptr) AccessChain 10(dti) 26 + 364: 6(int) Load 363 + 365: 42(ptr) AccessChain 24(data) 25 364 25 26 + 366: 6(int) Load 365 + 367: 6(int) GroupNonUniformQuadBroadcast 35 366 358 + 368: 42(ptr) AccessChain 24(data) 25 362 25 26 + Store 368 367 + 369: 27(ptr) AccessChain 10(dti) 26 + 370: 6(int) Load 369 + 371: 27(ptr) AccessChain 10(dti) 26 + 372: 6(int) Load 371 + 373: 32(ptr) AccessChain 24(data) 25 372 25 + 374: 13(ivec4) Load 373 + 375: 51(ivec2) VectorShuffle 374 374 0 1 + 376: 51(ivec2) GroupNonUniformQuadBroadcast 35 375 358 + 377: 32(ptr) AccessChain 24(data) 25 370 25 + 378: 13(ivec4) Load 377 + 379: 13(ivec4) VectorShuffle 378 376 4 5 2 3 + Store 377 379 + 380: 27(ptr) AccessChain 10(dti) 26 + 381: 6(int) Load 380 + 382: 27(ptr) AccessChain 10(dti) 26 + 383: 6(int) Load 382 + 384: 32(ptr) AccessChain 24(data) 25 383 25 + 385: 13(ivec4) Load 384 + 386: 7(ivec3) VectorShuffle 385 385 0 1 2 + 387: 7(ivec3) GroupNonUniformQuadBroadcast 35 386 358 + 388: 32(ptr) AccessChain 24(data) 25 381 25 + 389: 13(ivec4) Load 388 + 390: 13(ivec4) VectorShuffle 389 387 4 5 6 3 + Store 388 390 + 391: 27(ptr) AccessChain 10(dti) 26 + 392: 6(int) Load 391 + 393: 27(ptr) AccessChain 10(dti) 26 + 394: 6(int) Load 393 + 395: 75(ptr) AccessChain 24(data) 25 394 72 + 396: 15(ivec4) Load 395 + 397: 15(ivec4) GroupNonUniformQuadBroadcast 35 396 358 + 398: 75(ptr) AccessChain 24(data) 25 392 72 + Store 398 397 + 399: 27(ptr) AccessChain 10(dti) 26 + 400: 6(int) Load 399 + 401: 27(ptr) AccessChain 10(dti) 26 + 402: 6(int) Load 401 + 403: 84(ptr) AccessChain 24(data) 25 402 72 26 + 404: 14(int) Load 403 + 405: 14(int) GroupNonUniformQuadBroadcast 35 404 358 + 406: 84(ptr) AccessChain 24(data) 25 400 72 26 + Store 406 405 + 407: 27(ptr) AccessChain 10(dti) 26 + 408: 6(int) Load 407 + 409: 27(ptr) AccessChain 10(dti) 26 + 410: 6(int) Load 409 + 411: 75(ptr) AccessChain 24(data) 25 410 72 + 412: 15(ivec4) Load 411 + 413: 93(ivec2) VectorShuffle 412 412 0 1 + 414: 93(ivec2) GroupNonUniformQuadBroadcast 35 413 358 + 415: 75(ptr) AccessChain 24(data) 25 408 72 + 416: 15(ivec4) Load 415 + 417: 15(ivec4) VectorShuffle 416 414 4 5 2 3 + Store 415 417 + 418: 27(ptr) AccessChain 10(dti) 26 + 419: 6(int) Load 418 + 420: 27(ptr) AccessChain 10(dti) 26 + 421: 6(int) Load 420 + 422: 75(ptr) AccessChain 24(data) 25 421 72 + 423: 15(ivec4) Load 422 + 424: 105(ivec3) VectorShuffle 423 423 0 1 2 + 425: 105(ivec3) GroupNonUniformQuadBroadcast 35 424 358 + 426: 75(ptr) AccessChain 24(data) 25 419 72 + 427: 15(ivec4) Load 426 + 428: 15(ivec4) VectorShuffle 427 425 4 5 6 3 + Store 426 428 + 429: 27(ptr) AccessChain 10(dti) 26 + 430: 6(int) Load 429 + 431: 27(ptr) AccessChain 10(dti) 26 + 432: 6(int) Load 431 + 433: 118(ptr) AccessChain 24(data) 25 432 115 + 434: 17(fvec4) Load 433 + 435: 17(fvec4) GroupNonUniformQuadBroadcast 35 434 358 + 436: 118(ptr) AccessChain 24(data) 25 430 115 + Store 436 435 + 437: 27(ptr) AccessChain 10(dti) 26 + 438: 6(int) Load 437 + 439: 27(ptr) AccessChain 10(dti) 26 + 440: 6(int) Load 439 + 441: 127(ptr) AccessChain 24(data) 25 440 115 26 + 442: 16(float) Load 441 + 443: 16(float) GroupNonUniformQuadBroadcast 35 442 358 + 444: 127(ptr) AccessChain 24(data) 25 438 115 26 + Store 444 443 + 445: 27(ptr) AccessChain 10(dti) 26 + 446: 6(int) Load 445 + 447: 27(ptr) AccessChain 10(dti) 26 + 448: 6(int) Load 447 + 449: 118(ptr) AccessChain 24(data) 25 448 115 + 450: 17(fvec4) Load 449 + 451: 136(fvec2) VectorShuffle 450 450 0 1 + 452: 136(fvec2) GroupNonUniformQuadBroadcast 35 451 358 + 453: 118(ptr) AccessChain 24(data) 25 446 115 + 454: 17(fvec4) Load 453 + 455: 17(fvec4) VectorShuffle 454 452 4 5 2 3 + Store 453 455 + 456: 27(ptr) AccessChain 10(dti) 26 + 457: 6(int) Load 456 + 458: 27(ptr) AccessChain 10(dti) 26 + 459: 6(int) Load 458 + 460: 118(ptr) AccessChain 24(data) 25 459 115 + 461: 17(fvec4) Load 460 + 462: 148(fvec3) VectorShuffle 461 461 0 1 2 + 463: 148(fvec3) GroupNonUniformQuadBroadcast 35 462 358 + 464: 118(ptr) AccessChain 24(data) 25 457 115 + 465: 17(fvec4) Load 464 + 466: 17(fvec4) VectorShuffle 465 463 4 5 6 3 + Store 464 466 + 467: 27(ptr) AccessChain 10(dti) 26 + 468: 6(int) Load 467 + 469: 27(ptr) AccessChain 10(dti) 26 + 470: 6(int) Load 469 + 471: 161(ptr) AccessChain 24(data) 25 470 158 + 472: 19(f64vec4) Load 471 + 473: 19(f64vec4) GroupNonUniformQuadBroadcast 35 472 358 + 474: 161(ptr) AccessChain 24(data) 25 468 158 + Store 474 473 + 475: 27(ptr) AccessChain 10(dti) 26 + 476: 6(int) Load 475 + 477: 27(ptr) AccessChain 10(dti) 26 + 478: 6(int) Load 477 + 479: 170(ptr) AccessChain 24(data) 25 478 158 26 + 480:18(float64_t) Load 479 + 481:18(float64_t) GroupNonUniformQuadBroadcast 35 480 358 + 482: 170(ptr) AccessChain 24(data) 25 476 158 26 + Store 482 481 + 483: 27(ptr) AccessChain 10(dti) 26 + 484: 6(int) Load 483 + 485: 27(ptr) AccessChain 10(dti) 26 + 486: 6(int) Load 485 + 487: 161(ptr) AccessChain 24(data) 25 486 158 + 488: 19(f64vec4) Load 487 + 489:179(f64vec2) VectorShuffle 488 488 0 1 + 490:179(f64vec2) GroupNonUniformQuadBroadcast 35 489 358 + 491: 161(ptr) AccessChain 24(data) 25 484 158 + 492: 19(f64vec4) Load 491 + 493: 19(f64vec4) VectorShuffle 492 490 4 5 2 3 + Store 491 493 + 494: 27(ptr) AccessChain 10(dti) 26 + 495: 6(int) Load 494 + 496: 27(ptr) AccessChain 10(dti) 26 + 497: 6(int) Load 496 + 498: 161(ptr) AccessChain 24(data) 25 497 158 + 499: 19(f64vec4) Load 498 + 500:191(f64vec3) VectorShuffle 499 499 0 1 2 + 501:191(f64vec3) GroupNonUniformQuadBroadcast 35 500 358 + 502: 161(ptr) AccessChain 24(data) 25 495 158 + 503: 19(f64vec4) Load 502 + 504: 19(f64vec4) VectorShuffle 503 501 4 5 6 3 + Store 502 504 + 505: 27(ptr) AccessChain 10(dti) 26 + 506: 6(int) Load 505 + 507: 27(ptr) AccessChain 10(dti) 26 + 508: 6(int) Load 507 + 509: 32(ptr) AccessChain 24(data) 25 508 25 + 510: 13(ivec4) Load 509 + 511: 13(ivec4) GroupNonUniformQuadBroadcast 35 510 35 + 512: 32(ptr) AccessChain 24(data) 25 506 25 + Store 512 511 + 513: 27(ptr) AccessChain 10(dti) 26 + 514: 6(int) Load 513 + 515: 27(ptr) AccessChain 10(dti) 26 + 516: 6(int) Load 515 + 517: 42(ptr) AccessChain 24(data) 25 516 25 26 + 518: 6(int) Load 517 + 519: 6(int) GroupNonUniformQuadBroadcast 35 518 35 + 520: 42(ptr) AccessChain 24(data) 25 514 25 26 + Store 520 519 + 521: 27(ptr) AccessChain 10(dti) 26 + 522: 6(int) Load 521 + 523: 27(ptr) AccessChain 10(dti) 26 + 524: 6(int) Load 523 + 525: 32(ptr) AccessChain 24(data) 25 524 25 + 526: 13(ivec4) Load 525 + 527: 51(ivec2) VectorShuffle 526 526 0 1 + 528: 51(ivec2) GroupNonUniformQuadBroadcast 35 527 35 + 529: 32(ptr) AccessChain 24(data) 25 522 25 + 530: 13(ivec4) Load 529 + 531: 13(ivec4) VectorShuffle 530 528 4 5 2 3 + Store 529 531 + 532: 27(ptr) AccessChain 10(dti) 26 + 533: 6(int) Load 532 + 534: 27(ptr) AccessChain 10(dti) 26 + 535: 6(int) Load 534 + 536: 32(ptr) AccessChain 24(data) 25 535 25 + 537: 13(ivec4) Load 536 + 538: 7(ivec3) VectorShuffle 537 537 0 1 2 + 539: 7(ivec3) GroupNonUniformQuadBroadcast 35 538 35 + 540: 32(ptr) AccessChain 24(data) 25 533 25 + 541: 13(ivec4) Load 540 + 542: 13(ivec4) VectorShuffle 541 539 4 5 6 3 + Store 540 542 + 543: 27(ptr) AccessChain 10(dti) 26 + 544: 6(int) Load 543 + 545: 27(ptr) AccessChain 10(dti) 26 + 546: 6(int) Load 545 + 547: 75(ptr) AccessChain 24(data) 25 546 72 + 548: 15(ivec4) Load 547 + 549: 15(ivec4) GroupNonUniformQuadBroadcast 35 548 35 + 550: 75(ptr) AccessChain 24(data) 25 544 72 + Store 550 549 + 551: 27(ptr) AccessChain 10(dti) 26 + 552: 6(int) Load 551 + 553: 27(ptr) AccessChain 10(dti) 26 + 554: 6(int) Load 553 + 555: 84(ptr) AccessChain 24(data) 25 554 72 26 + 556: 14(int) Load 555 + 557: 14(int) GroupNonUniformQuadBroadcast 35 556 35 + 558: 84(ptr) AccessChain 24(data) 25 552 72 26 + Store 558 557 + 559: 27(ptr) AccessChain 10(dti) 26 + 560: 6(int) Load 559 + 561: 27(ptr) AccessChain 10(dti) 26 + 562: 6(int) Load 561 + 563: 75(ptr) AccessChain 24(data) 25 562 72 + 564: 15(ivec4) Load 563 + 565: 93(ivec2) VectorShuffle 564 564 0 1 + 566: 93(ivec2) GroupNonUniformQuadBroadcast 35 565 35 + 567: 75(ptr) AccessChain 24(data) 25 560 72 + 568: 15(ivec4) Load 567 + 569: 15(ivec4) VectorShuffle 568 566 4 5 2 3 + Store 567 569 + 570: 27(ptr) AccessChain 10(dti) 26 + 571: 6(int) Load 570 + 572: 27(ptr) AccessChain 10(dti) 26 + 573: 6(int) Load 572 + 574: 75(ptr) AccessChain 24(data) 25 573 72 + 575: 15(ivec4) Load 574 + 576: 105(ivec3) VectorShuffle 575 575 0 1 2 + 577: 105(ivec3) GroupNonUniformQuadBroadcast 35 576 35 + 578: 75(ptr) AccessChain 24(data) 25 571 72 + 579: 15(ivec4) Load 578 + 580: 15(ivec4) VectorShuffle 579 577 4 5 6 3 + Store 578 580 + 581: 27(ptr) AccessChain 10(dti) 26 + 582: 6(int) Load 581 + 583: 27(ptr) AccessChain 10(dti) 26 + 584: 6(int) Load 583 + 585: 118(ptr) AccessChain 24(data) 25 584 115 + 586: 17(fvec4) Load 585 + 587: 17(fvec4) GroupNonUniformQuadBroadcast 35 586 35 + 588: 118(ptr) AccessChain 24(data) 25 582 115 + Store 588 587 + 589: 27(ptr) AccessChain 10(dti) 26 + 590: 6(int) Load 589 + 591: 27(ptr) AccessChain 10(dti) 26 + 592: 6(int) Load 591 + 593: 127(ptr) AccessChain 24(data) 25 592 115 26 + 594: 16(float) Load 593 + 595: 16(float) GroupNonUniformQuadBroadcast 35 594 35 + 596: 127(ptr) AccessChain 24(data) 25 590 115 26 + Store 596 595 + 597: 27(ptr) AccessChain 10(dti) 26 + 598: 6(int) Load 597 + 599: 27(ptr) AccessChain 10(dti) 26 + 600: 6(int) Load 599 + 601: 118(ptr) AccessChain 24(data) 25 600 115 + 602: 17(fvec4) Load 601 + 603: 136(fvec2) VectorShuffle 602 602 0 1 + 604: 136(fvec2) GroupNonUniformQuadBroadcast 35 603 35 + 605: 118(ptr) AccessChain 24(data) 25 598 115 + 606: 17(fvec4) Load 605 + 607: 17(fvec4) VectorShuffle 606 604 4 5 2 3 + Store 605 607 + 608: 27(ptr) AccessChain 10(dti) 26 + 609: 6(int) Load 608 + 610: 27(ptr) AccessChain 10(dti) 26 + 611: 6(int) Load 610 + 612: 118(ptr) AccessChain 24(data) 25 611 115 + 613: 17(fvec4) Load 612 + 614: 148(fvec3) VectorShuffle 613 613 0 1 2 + 615: 148(fvec3) GroupNonUniformQuadBroadcast 35 614 35 + 616: 118(ptr) AccessChain 24(data) 25 609 115 + 617: 17(fvec4) Load 616 + 618: 17(fvec4) VectorShuffle 617 615 4 5 6 3 + Store 616 618 + 619: 27(ptr) AccessChain 10(dti) 26 + 620: 6(int) Load 619 + 621: 27(ptr) AccessChain 10(dti) 26 + 622: 6(int) Load 621 + 623: 161(ptr) AccessChain 24(data) 25 622 158 + 624: 19(f64vec4) Load 623 + 625: 19(f64vec4) GroupNonUniformQuadBroadcast 35 624 35 + 626: 161(ptr) AccessChain 24(data) 25 620 158 + Store 626 625 + 627: 27(ptr) AccessChain 10(dti) 26 + 628: 6(int) Load 627 + 629: 27(ptr) AccessChain 10(dti) 26 + 630: 6(int) Load 629 + 631: 170(ptr) AccessChain 24(data) 25 630 158 26 + 632:18(float64_t) Load 631 + 633:18(float64_t) GroupNonUniformQuadBroadcast 35 632 35 + 634: 170(ptr) AccessChain 24(data) 25 628 158 26 + Store 634 633 + 635: 27(ptr) AccessChain 10(dti) 26 + 636: 6(int) Load 635 + 637: 27(ptr) AccessChain 10(dti) 26 + 638: 6(int) Load 637 + 639: 161(ptr) AccessChain 24(data) 25 638 158 + 640: 19(f64vec4) Load 639 + 641:179(f64vec2) VectorShuffle 640 640 0 1 + 642:179(f64vec2) GroupNonUniformQuadBroadcast 35 641 35 + 643: 161(ptr) AccessChain 24(data) 25 636 158 + 644: 19(f64vec4) Load 643 + 645: 19(f64vec4) VectorShuffle 644 642 4 5 2 3 + Store 643 645 + 646: 27(ptr) AccessChain 10(dti) 26 + 647: 6(int) Load 646 + 648: 27(ptr) AccessChain 10(dti) 26 + 649: 6(int) Load 648 + 650: 161(ptr) AccessChain 24(data) 25 649 158 + 651: 19(f64vec4) Load 650 + 652:191(f64vec3) VectorShuffle 651 651 0 1 2 + 653:191(f64vec3) GroupNonUniformQuadBroadcast 35 652 35 + 654: 161(ptr) AccessChain 24(data) 25 647 158 + 655: 19(f64vec4) Load 654 + 656: 19(f64vec4) VectorShuffle 655 653 4 5 6 3 + Store 654 656 + 657: 27(ptr) AccessChain 10(dti) 26 + 658: 6(int) Load 657 + 659: 27(ptr) AccessChain 10(dti) 26 + 660: 6(int) Load 659 + 661: 32(ptr) AccessChain 24(data) 25 660 25 + 662: 13(ivec4) Load 661 + 663: 13(ivec4) GroupNonUniformQuadSwap 35 662 26 + 664: 32(ptr) AccessChain 24(data) 25 658 25 + Store 664 663 + 665: 27(ptr) AccessChain 10(dti) 26 + 666: 6(int) Load 665 + 667: 27(ptr) AccessChain 10(dti) 26 + 668: 6(int) Load 667 + 669: 42(ptr) AccessChain 24(data) 25 668 25 26 + 670: 6(int) Load 669 + 671: 6(int) GroupNonUniformQuadSwap 35 670 26 + 672: 42(ptr) AccessChain 24(data) 25 666 25 26 + Store 672 671 + 673: 27(ptr) AccessChain 10(dti) 26 + 674: 6(int) Load 673 + 675: 27(ptr) AccessChain 10(dti) 26 + 676: 6(int) Load 675 + 677: 32(ptr) AccessChain 24(data) 25 676 25 + 678: 13(ivec4) Load 677 + 679: 51(ivec2) VectorShuffle 678 678 0 1 + 680: 51(ivec2) GroupNonUniformQuadSwap 35 679 26 + 681: 32(ptr) AccessChain 24(data) 25 674 25 + 682: 13(ivec4) Load 681 + 683: 13(ivec4) VectorShuffle 682 680 4 5 2 3 + Store 681 683 + 684: 27(ptr) AccessChain 10(dti) 26 + 685: 6(int) Load 684 + 686: 27(ptr) AccessChain 10(dti) 26 + 687: 6(int) Load 686 + 688: 32(ptr) AccessChain 24(data) 25 687 25 + 689: 13(ivec4) Load 688 + 690: 7(ivec3) VectorShuffle 689 689 0 1 2 + 691: 7(ivec3) GroupNonUniformQuadSwap 35 690 26 + 692: 32(ptr) AccessChain 24(data) 25 685 25 + 693: 13(ivec4) Load 692 + 694: 13(ivec4) VectorShuffle 693 691 4 5 6 3 + Store 692 694 + 695: 27(ptr) AccessChain 10(dti) 26 + 696: 6(int) Load 695 + 697: 27(ptr) AccessChain 10(dti) 26 + 698: 6(int) Load 697 + 699: 75(ptr) AccessChain 24(data) 25 698 72 + 700: 15(ivec4) Load 699 + 701: 15(ivec4) GroupNonUniformQuadSwap 35 700 26 + 702: 75(ptr) AccessChain 24(data) 25 696 72 + Store 702 701 + 703: 27(ptr) AccessChain 10(dti) 26 + 704: 6(int) Load 703 + 705: 27(ptr) AccessChain 10(dti) 26 + 706: 6(int) Load 705 + 707: 84(ptr) AccessChain 24(data) 25 706 72 26 + 708: 14(int) Load 707 + 709: 14(int) GroupNonUniformQuadSwap 35 708 26 + 710: 84(ptr) AccessChain 24(data) 25 704 72 26 + Store 710 709 + 711: 27(ptr) AccessChain 10(dti) 26 + 712: 6(int) Load 711 + 713: 27(ptr) AccessChain 10(dti) 26 + 714: 6(int) Load 713 + 715: 75(ptr) AccessChain 24(data) 25 714 72 + 716: 15(ivec4) Load 715 + 717: 93(ivec2) VectorShuffle 716 716 0 1 + 718: 93(ivec2) GroupNonUniformQuadSwap 35 717 26 + 719: 75(ptr) AccessChain 24(data) 25 712 72 + 720: 15(ivec4) Load 719 + 721: 15(ivec4) VectorShuffle 720 718 4 5 2 3 + Store 719 721 + 722: 27(ptr) AccessChain 10(dti) 26 + 723: 6(int) Load 722 + 724: 27(ptr) AccessChain 10(dti) 26 + 725: 6(int) Load 724 + 726: 75(ptr) AccessChain 24(data) 25 725 72 + 727: 15(ivec4) Load 726 + 728: 105(ivec3) VectorShuffle 727 727 0 1 2 + 729: 105(ivec3) GroupNonUniformQuadSwap 35 728 26 + 730: 75(ptr) AccessChain 24(data) 25 723 72 + 731: 15(ivec4) Load 730 + 732: 15(ivec4) VectorShuffle 731 729 4 5 6 3 + Store 730 732 + 733: 27(ptr) AccessChain 10(dti) 26 + 734: 6(int) Load 733 + 735: 27(ptr) AccessChain 10(dti) 26 + 736: 6(int) Load 735 + 737: 118(ptr) AccessChain 24(data) 25 736 115 + 738: 17(fvec4) Load 737 + 739: 17(fvec4) GroupNonUniformQuadSwap 35 738 26 + 740: 118(ptr) AccessChain 24(data) 25 734 115 + Store 740 739 + 741: 27(ptr) AccessChain 10(dti) 26 + 742: 6(int) Load 741 + 743: 27(ptr) AccessChain 10(dti) 26 + 744: 6(int) Load 743 + 745: 127(ptr) AccessChain 24(data) 25 744 115 26 + 746: 16(float) Load 745 + 747: 16(float) GroupNonUniformQuadSwap 35 746 26 + 748: 127(ptr) AccessChain 24(data) 25 742 115 26 + Store 748 747 + 749: 27(ptr) AccessChain 10(dti) 26 + 750: 6(int) Load 749 + 751: 27(ptr) AccessChain 10(dti) 26 + 752: 6(int) Load 751 + 753: 118(ptr) AccessChain 24(data) 25 752 115 + 754: 17(fvec4) Load 753 + 755: 136(fvec2) VectorShuffle 754 754 0 1 + 756: 136(fvec2) GroupNonUniformQuadSwap 35 755 26 + 757: 118(ptr) AccessChain 24(data) 25 750 115 + 758: 17(fvec4) Load 757 + 759: 17(fvec4) VectorShuffle 758 756 4 5 2 3 + Store 757 759 + 760: 27(ptr) AccessChain 10(dti) 26 + 761: 6(int) Load 760 + 762: 27(ptr) AccessChain 10(dti) 26 + 763: 6(int) Load 762 + 764: 118(ptr) AccessChain 24(data) 25 763 115 + 765: 17(fvec4) Load 764 + 766: 148(fvec3) VectorShuffle 765 765 0 1 2 + 767: 148(fvec3) GroupNonUniformQuadSwap 35 766 26 + 768: 118(ptr) AccessChain 24(data) 25 761 115 + 769: 17(fvec4) Load 768 + 770: 17(fvec4) VectorShuffle 769 767 4 5 6 3 + Store 768 770 + 771: 27(ptr) AccessChain 10(dti) 26 + 772: 6(int) Load 771 + 773: 27(ptr) AccessChain 10(dti) 26 + 774: 6(int) Load 773 + 775: 161(ptr) AccessChain 24(data) 25 774 158 + 776: 19(f64vec4) Load 775 + 777: 19(f64vec4) GroupNonUniformQuadSwap 35 776 26 + 778: 161(ptr) AccessChain 24(data) 25 772 158 + Store 778 777 + 779: 27(ptr) AccessChain 10(dti) 26 + 780: 6(int) Load 779 + 781: 27(ptr) AccessChain 10(dti) 26 + 782: 6(int) Load 781 + 783: 170(ptr) AccessChain 24(data) 25 782 158 26 + 784:18(float64_t) Load 783 + 785:18(float64_t) GroupNonUniformQuadSwap 35 784 26 + 786: 170(ptr) AccessChain 24(data) 25 780 158 26 + Store 786 785 + 787: 27(ptr) AccessChain 10(dti) 26 + 788: 6(int) Load 787 + 789: 27(ptr) AccessChain 10(dti) 26 + 790: 6(int) Load 789 + 791: 161(ptr) AccessChain 24(data) 25 790 158 + 792: 19(f64vec4) Load 791 + 793:179(f64vec2) VectorShuffle 792 792 0 1 + 794:179(f64vec2) GroupNonUniformQuadSwap 35 793 26 + 795: 161(ptr) AccessChain 24(data) 25 788 158 + 796: 19(f64vec4) Load 795 + 797: 19(f64vec4) VectorShuffle 796 794 4 5 2 3 + Store 795 797 + 798: 27(ptr) AccessChain 10(dti) 26 + 799: 6(int) Load 798 + 800: 27(ptr) AccessChain 10(dti) 26 + 801: 6(int) Load 800 + 802: 161(ptr) AccessChain 24(data) 25 801 158 + 803: 19(f64vec4) Load 802 + 804:191(f64vec3) VectorShuffle 803 803 0 1 2 + 805:191(f64vec3) GroupNonUniformQuadSwap 35 804 26 + 806: 161(ptr) AccessChain 24(data) 25 799 158 + 807: 19(f64vec4) Load 806 + 808: 19(f64vec4) VectorShuffle 807 805 4 5 6 3 + Store 806 808 + 809: 27(ptr) AccessChain 10(dti) 26 + 810: 6(int) Load 809 + 811: 27(ptr) AccessChain 10(dti) 26 + 812: 6(int) Load 811 + 813: 32(ptr) AccessChain 24(data) 25 812 25 + 814: 13(ivec4) Load 813 + 815: 13(ivec4) GroupNonUniformQuadSwap 35 814 205 + 816: 32(ptr) AccessChain 24(data) 25 810 25 + Store 816 815 + 817: 27(ptr) AccessChain 10(dti) 26 + 818: 6(int) Load 817 + 819: 27(ptr) AccessChain 10(dti) 26 + 820: 6(int) Load 819 + 821: 42(ptr) AccessChain 24(data) 25 820 25 26 + 822: 6(int) Load 821 + 823: 6(int) GroupNonUniformQuadSwap 35 822 205 + 824: 42(ptr) AccessChain 24(data) 25 818 25 26 + Store 824 823 + 825: 27(ptr) AccessChain 10(dti) 26 + 826: 6(int) Load 825 + 827: 27(ptr) AccessChain 10(dti) 26 + 828: 6(int) Load 827 + 829: 32(ptr) AccessChain 24(data) 25 828 25 + 830: 13(ivec4) Load 829 + 831: 51(ivec2) VectorShuffle 830 830 0 1 + 832: 51(ivec2) GroupNonUniformQuadSwap 35 831 205 + 833: 32(ptr) AccessChain 24(data) 25 826 25 + 834: 13(ivec4) Load 833 + 835: 13(ivec4) VectorShuffle 834 832 4 5 2 3 + Store 833 835 + 836: 27(ptr) AccessChain 10(dti) 26 + 837: 6(int) Load 836 + 838: 27(ptr) AccessChain 10(dti) 26 + 839: 6(int) Load 838 + 840: 32(ptr) AccessChain 24(data) 25 839 25 + 841: 13(ivec4) Load 840 + 842: 7(ivec3) VectorShuffle 841 841 0 1 2 + 843: 7(ivec3) GroupNonUniformQuadSwap 35 842 205 + 844: 32(ptr) AccessChain 24(data) 25 837 25 + 845: 13(ivec4) Load 844 + 846: 13(ivec4) VectorShuffle 845 843 4 5 6 3 + Store 844 846 + 847: 27(ptr) AccessChain 10(dti) 26 + 848: 6(int) Load 847 + 849: 27(ptr) AccessChain 10(dti) 26 + 850: 6(int) Load 849 + 851: 75(ptr) AccessChain 24(data) 25 850 72 + 852: 15(ivec4) Load 851 + 853: 15(ivec4) GroupNonUniformQuadSwap 35 852 205 + 854: 75(ptr) AccessChain 24(data) 25 848 72 + Store 854 853 + 855: 27(ptr) AccessChain 10(dti) 26 + 856: 6(int) Load 855 + 857: 27(ptr) AccessChain 10(dti) 26 + 858: 6(int) Load 857 + 859: 84(ptr) AccessChain 24(data) 25 858 72 26 + 860: 14(int) Load 859 + 861: 14(int) GroupNonUniformQuadSwap 35 860 205 + 862: 84(ptr) AccessChain 24(data) 25 856 72 26 + Store 862 861 + 863: 27(ptr) AccessChain 10(dti) 26 + 864: 6(int) Load 863 + 865: 27(ptr) AccessChain 10(dti) 26 + 866: 6(int) Load 865 + 867: 75(ptr) AccessChain 24(data) 25 866 72 + 868: 15(ivec4) Load 867 + 869: 93(ivec2) VectorShuffle 868 868 0 1 + 870: 93(ivec2) GroupNonUniformQuadSwap 35 869 205 + 871: 75(ptr) AccessChain 24(data) 25 864 72 + 872: 15(ivec4) Load 871 + 873: 15(ivec4) VectorShuffle 872 870 4 5 2 3 + Store 871 873 + 874: 27(ptr) AccessChain 10(dti) 26 + 875: 6(int) Load 874 + 876: 27(ptr) AccessChain 10(dti) 26 + 877: 6(int) Load 876 + 878: 75(ptr) AccessChain 24(data) 25 877 72 + 879: 15(ivec4) Load 878 + 880: 105(ivec3) VectorShuffle 879 879 0 1 2 + 881: 105(ivec3) GroupNonUniformQuadSwap 35 880 205 + 882: 75(ptr) AccessChain 24(data) 25 875 72 + 883: 15(ivec4) Load 882 + 884: 15(ivec4) VectorShuffle 883 881 4 5 6 3 + Store 882 884 + 885: 27(ptr) AccessChain 10(dti) 26 + 886: 6(int) Load 885 + 887: 27(ptr) AccessChain 10(dti) 26 + 888: 6(int) Load 887 + 889: 118(ptr) AccessChain 24(data) 25 888 115 + 890: 17(fvec4) Load 889 + 891: 17(fvec4) GroupNonUniformQuadSwap 35 890 205 + 892: 118(ptr) AccessChain 24(data) 25 886 115 + Store 892 891 + 893: 27(ptr) AccessChain 10(dti) 26 + 894: 6(int) Load 893 + 895: 27(ptr) AccessChain 10(dti) 26 + 896: 6(int) Load 895 + 897: 127(ptr) AccessChain 24(data) 25 896 115 26 + 898: 16(float) Load 897 + 899: 16(float) GroupNonUniformQuadSwap 35 898 205 + 900: 127(ptr) AccessChain 24(data) 25 894 115 26 + Store 900 899 + 901: 27(ptr) AccessChain 10(dti) 26 + 902: 6(int) Load 901 + 903: 27(ptr) AccessChain 10(dti) 26 + 904: 6(int) Load 903 + 905: 118(ptr) AccessChain 24(data) 25 904 115 + 906: 17(fvec4) Load 905 + 907: 136(fvec2) VectorShuffle 906 906 0 1 + 908: 136(fvec2) GroupNonUniformQuadSwap 35 907 205 + 909: 118(ptr) AccessChain 24(data) 25 902 115 + 910: 17(fvec4) Load 909 + 911: 17(fvec4) VectorShuffle 910 908 4 5 2 3 + Store 909 911 + 912: 27(ptr) AccessChain 10(dti) 26 + 913: 6(int) Load 912 + 914: 27(ptr) AccessChain 10(dti) 26 + 915: 6(int) Load 914 + 916: 118(ptr) AccessChain 24(data) 25 915 115 + 917: 17(fvec4) Load 916 + 918: 148(fvec3) VectorShuffle 917 917 0 1 2 + 919: 148(fvec3) GroupNonUniformQuadSwap 35 918 205 + 920: 118(ptr) AccessChain 24(data) 25 913 115 + 921: 17(fvec4) Load 920 + 922: 17(fvec4) VectorShuffle 921 919 4 5 6 3 + Store 920 922 + 923: 27(ptr) AccessChain 10(dti) 26 + 924: 6(int) Load 923 + 925: 27(ptr) AccessChain 10(dti) 26 + 926: 6(int) Load 925 + 927: 161(ptr) AccessChain 24(data) 25 926 158 + 928: 19(f64vec4) Load 927 + 929: 19(f64vec4) GroupNonUniformQuadSwap 35 928 205 + 930: 161(ptr) AccessChain 24(data) 25 924 158 + Store 930 929 + 931: 27(ptr) AccessChain 10(dti) 26 + 932: 6(int) Load 931 + 933: 27(ptr) AccessChain 10(dti) 26 + 934: 6(int) Load 933 + 935: 170(ptr) AccessChain 24(data) 25 934 158 26 + 936:18(float64_t) Load 935 + 937:18(float64_t) GroupNonUniformQuadSwap 35 936 205 + 938: 170(ptr) AccessChain 24(data) 25 932 158 26 + Store 938 937 + 939: 27(ptr) AccessChain 10(dti) 26 + 940: 6(int) Load 939 + 941: 27(ptr) AccessChain 10(dti) 26 + 942: 6(int) Load 941 + 943: 161(ptr) AccessChain 24(data) 25 942 158 + 944: 19(f64vec4) Load 943 + 945:179(f64vec2) VectorShuffle 944 944 0 1 + 946:179(f64vec2) GroupNonUniformQuadSwap 35 945 205 + 947: 161(ptr) AccessChain 24(data) 25 940 158 + 948: 19(f64vec4) Load 947 + 949: 19(f64vec4) VectorShuffle 948 946 4 5 2 3 + Store 947 949 + 950: 27(ptr) AccessChain 10(dti) 26 + 951: 6(int) Load 950 + 952: 27(ptr) AccessChain 10(dti) 26 + 953: 6(int) Load 952 + 954: 161(ptr) AccessChain 24(data) 25 953 158 + 955: 19(f64vec4) Load 954 + 956:191(f64vec3) VectorShuffle 955 955 0 1 2 + 957:191(f64vec3) GroupNonUniformQuadSwap 35 956 205 + 958: 161(ptr) AccessChain 24(data) 25 951 158 + 959: 19(f64vec4) Load 958 + 960: 19(f64vec4) VectorShuffle 959 957 4 5 6 3 + Store 958 960 + 961: 27(ptr) AccessChain 10(dti) 26 + 962: 6(int) Load 961 + 963: 27(ptr) AccessChain 10(dti) 26 + 964: 6(int) Load 963 + 965: 32(ptr) AccessChain 24(data) 25 964 25 + 966: 13(ivec4) Load 965 + 967: 13(ivec4) GroupNonUniformQuadSwap 35 966 358 + 968: 32(ptr) AccessChain 24(data) 25 962 25 + Store 968 967 + 969: 27(ptr) AccessChain 10(dti) 26 + 970: 6(int) Load 969 + 971: 27(ptr) AccessChain 10(dti) 26 + 972: 6(int) Load 971 + 973: 42(ptr) AccessChain 24(data) 25 972 25 26 + 974: 6(int) Load 973 + 975: 6(int) GroupNonUniformQuadSwap 35 974 358 + 976: 42(ptr) AccessChain 24(data) 25 970 25 26 + Store 976 975 + 977: 27(ptr) AccessChain 10(dti) 26 + 978: 6(int) Load 977 + 979: 27(ptr) AccessChain 10(dti) 26 + 980: 6(int) Load 979 + 981: 32(ptr) AccessChain 24(data) 25 980 25 + 982: 13(ivec4) Load 981 + 983: 51(ivec2) VectorShuffle 982 982 0 1 + 984: 51(ivec2) GroupNonUniformQuadSwap 35 983 358 + 985: 32(ptr) AccessChain 24(data) 25 978 25 + 986: 13(ivec4) Load 985 + 987: 13(ivec4) VectorShuffle 986 984 4 5 2 3 + Store 985 987 + 988: 27(ptr) AccessChain 10(dti) 26 + 989: 6(int) Load 988 + 990: 27(ptr) AccessChain 10(dti) 26 + 991: 6(int) Load 990 + 992: 32(ptr) AccessChain 24(data) 25 991 25 + 993: 13(ivec4) Load 992 + 994: 7(ivec3) VectorShuffle 993 993 0 1 2 + 995: 7(ivec3) GroupNonUniformQuadSwap 35 994 358 + 996: 32(ptr) AccessChain 24(data) 25 989 25 + 997: 13(ivec4) Load 996 + 998: 13(ivec4) VectorShuffle 997 995 4 5 6 3 + Store 996 998 + 999: 27(ptr) AccessChain 10(dti) 26 + 1000: 6(int) Load 999 + 1001: 27(ptr) AccessChain 10(dti) 26 + 1002: 6(int) Load 1001 + 1003: 75(ptr) AccessChain 24(data) 25 1002 72 + 1004: 15(ivec4) Load 1003 + 1005: 15(ivec4) GroupNonUniformQuadSwap 35 1004 358 + 1006: 75(ptr) AccessChain 24(data) 25 1000 72 + Store 1006 1005 + 1007: 27(ptr) AccessChain 10(dti) 26 + 1008: 6(int) Load 1007 + 1009: 27(ptr) AccessChain 10(dti) 26 + 1010: 6(int) Load 1009 + 1011: 84(ptr) AccessChain 24(data) 25 1010 72 26 + 1012: 14(int) Load 1011 + 1013: 14(int) GroupNonUniformQuadSwap 35 1012 358 + 1014: 84(ptr) AccessChain 24(data) 25 1008 72 26 + Store 1014 1013 + 1015: 27(ptr) AccessChain 10(dti) 26 + 1016: 6(int) Load 1015 + 1017: 27(ptr) AccessChain 10(dti) 26 + 1018: 6(int) Load 1017 + 1019: 75(ptr) AccessChain 24(data) 25 1018 72 + 1020: 15(ivec4) Load 1019 + 1021: 93(ivec2) VectorShuffle 1020 1020 0 1 + 1022: 93(ivec2) GroupNonUniformQuadSwap 35 1021 358 + 1023: 75(ptr) AccessChain 24(data) 25 1016 72 + 1024: 15(ivec4) Load 1023 + 1025: 15(ivec4) VectorShuffle 1024 1022 4 5 2 3 + Store 1023 1025 + 1026: 27(ptr) AccessChain 10(dti) 26 + 1027: 6(int) Load 1026 + 1028: 27(ptr) AccessChain 10(dti) 26 + 1029: 6(int) Load 1028 + 1030: 75(ptr) AccessChain 24(data) 25 1029 72 + 1031: 15(ivec4) Load 1030 + 1032: 105(ivec3) VectorShuffle 1031 1031 0 1 2 + 1033: 105(ivec3) GroupNonUniformQuadSwap 35 1032 358 + 1034: 75(ptr) AccessChain 24(data) 25 1027 72 + 1035: 15(ivec4) Load 1034 + 1036: 15(ivec4) VectorShuffle 1035 1033 4 5 6 3 + Store 1034 1036 + 1037: 27(ptr) AccessChain 10(dti) 26 + 1038: 6(int) Load 1037 + 1039: 27(ptr) AccessChain 10(dti) 26 + 1040: 6(int) Load 1039 + 1041: 118(ptr) AccessChain 24(data) 25 1040 115 + 1042: 17(fvec4) Load 1041 + 1043: 17(fvec4) GroupNonUniformQuadSwap 35 1042 358 + 1044: 118(ptr) AccessChain 24(data) 25 1038 115 + Store 1044 1043 + 1045: 27(ptr) AccessChain 10(dti) 26 + 1046: 6(int) Load 1045 + 1047: 27(ptr) AccessChain 10(dti) 26 + 1048: 6(int) Load 1047 + 1049: 127(ptr) AccessChain 24(data) 25 1048 115 26 + 1050: 16(float) Load 1049 + 1051: 16(float) GroupNonUniformQuadSwap 35 1050 358 + 1052: 127(ptr) AccessChain 24(data) 25 1046 115 26 + Store 1052 1051 + 1053: 27(ptr) AccessChain 10(dti) 26 + 1054: 6(int) Load 1053 + 1055: 27(ptr) AccessChain 10(dti) 26 + 1056: 6(int) Load 1055 + 1057: 118(ptr) AccessChain 24(data) 25 1056 115 + 1058: 17(fvec4) Load 1057 + 1059: 136(fvec2) VectorShuffle 1058 1058 0 1 + 1060: 136(fvec2) GroupNonUniformQuadSwap 35 1059 358 + 1061: 118(ptr) AccessChain 24(data) 25 1054 115 + 1062: 17(fvec4) Load 1061 + 1063: 17(fvec4) VectorShuffle 1062 1060 4 5 2 3 + Store 1061 1063 + 1064: 27(ptr) AccessChain 10(dti) 26 + 1065: 6(int) Load 1064 + 1066: 27(ptr) AccessChain 10(dti) 26 + 1067: 6(int) Load 1066 + 1068: 118(ptr) AccessChain 24(data) 25 1067 115 + 1069: 17(fvec4) Load 1068 + 1070: 148(fvec3) VectorShuffle 1069 1069 0 1 2 + 1071: 148(fvec3) GroupNonUniformQuadSwap 35 1070 358 + 1072: 118(ptr) AccessChain 24(data) 25 1065 115 + 1073: 17(fvec4) Load 1072 + 1074: 17(fvec4) VectorShuffle 1073 1071 4 5 6 3 + Store 1072 1074 + 1075: 27(ptr) AccessChain 10(dti) 26 + 1076: 6(int) Load 1075 + 1077: 27(ptr) AccessChain 10(dti) 26 + 1078: 6(int) Load 1077 + 1079: 161(ptr) AccessChain 24(data) 25 1078 158 + 1080: 19(f64vec4) Load 1079 + 1081: 19(f64vec4) GroupNonUniformQuadSwap 35 1080 358 + 1082: 161(ptr) AccessChain 24(data) 25 1076 158 + Store 1082 1081 + 1083: 27(ptr) AccessChain 10(dti) 26 + 1084: 6(int) Load 1083 + 1085: 27(ptr) AccessChain 10(dti) 26 + 1086: 6(int) Load 1085 + 1087: 170(ptr) AccessChain 24(data) 25 1086 158 26 + 1088:18(float64_t) Load 1087 + 1089:18(float64_t) GroupNonUniformQuadSwap 35 1088 358 + 1090: 170(ptr) AccessChain 24(data) 25 1084 158 26 + Store 1090 1089 + 1091: 27(ptr) AccessChain 10(dti) 26 + 1092: 6(int) Load 1091 + 1093: 27(ptr) AccessChain 10(dti) 26 + 1094: 6(int) Load 1093 + 1095: 161(ptr) AccessChain 24(data) 25 1094 158 + 1096: 19(f64vec4) Load 1095 + 1097:179(f64vec2) VectorShuffle 1096 1096 0 1 + 1098:179(f64vec2) GroupNonUniformQuadSwap 35 1097 358 + 1099: 161(ptr) AccessChain 24(data) 25 1092 158 + 1100: 19(f64vec4) Load 1099 + 1101: 19(f64vec4) VectorShuffle 1100 1098 4 5 2 3 + Store 1099 1101 + 1102: 27(ptr) AccessChain 10(dti) 26 + 1103: 6(int) Load 1102 + 1104: 27(ptr) AccessChain 10(dti) 26 + 1105: 6(int) Load 1104 + 1106: 161(ptr) AccessChain 24(data) 25 1105 158 + 1107: 19(f64vec4) Load 1106 + 1108:191(f64vec3) VectorShuffle 1107 1107 0 1 2 + 1109:191(f64vec3) GroupNonUniformQuadSwap 35 1108 358 + 1110: 161(ptr) AccessChain 24(data) 25 1103 158 + 1111: 19(f64vec4) Load 1110 + 1112: 19(f64vec4) VectorShuffle 1111 1109 4 5 6 3 + Store 1110 1112 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.wavequery.comp.out b/deps/glslang/Test/baseResults/hlsl.wavequery.comp.out new file mode 100644 index 00000000..5f70124e --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.wavequery.comp.out @@ -0,0 +1,116 @@ +hlsl.wavequery.comp +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:5 Function Definition: @CSMain( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:6 move second child to first child ( temp uint) +0:6 indirect index (layout( row_major std430) buffer uint) +0:6 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:6 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:6 Constant: +0:6 0 (const uint) +0:6 '@gl_SubgroupInvocationID' ( in uint unknown built-in variable) +0:6 Test condition and select ( temp uint): no shortcircuit +0:6 Condition +0:6 subgroupElect ( temp bool) +0:6 true case +0:6 '@gl_SubgroupSize' ( in uint unknown built-in variable) +0:6 false case +0:6 Constant: +0:6 0 (const uint) +0:5 Function Definition: CSMain( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 Function Call: @CSMain( ( temp void) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) + + +Linked compute stage: + + +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:5 Function Definition: @CSMain( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:6 move second child to first child ( temp uint) +0:6 indirect index (layout( row_major std430) buffer uint) +0:6 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:6 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:6 Constant: +0:6 0 (const uint) +0:6 '@gl_SubgroupInvocationID' ( in uint unknown built-in variable) +0:6 Test condition and select ( temp uint): no shortcircuit +0:6 Condition +0:6 subgroupElect ( temp bool) +0:6 true case +0:6 '@gl_SubgroupSize' ( in uint unknown built-in variable) +0:6 false case +0:6 Constant: +0:6 0 (const uint) +0:5 Function Definition: CSMain( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 Function Call: @CSMain( ( temp void) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) + +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 28 + + Capability Shader + Capability GroupNonUniform + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "CSMain" 16 21 + ExecutionMode 4 LocalSize 32 16 1 + Source HLSL 500 + Name 4 "CSMain" + Name 6 "@CSMain(" + Name 10 "data" + MemberName 10(data) 0 "@data" + Name 12 "data" + Name 16 "@gl_SubgroupInvocationID" + Name 21 "@gl_SubgroupSize" + Decorate 9 ArrayStride 4 + MemberDecorate 10(data) 0 Offset 0 + Decorate 10(data) BufferBlock + Decorate 12(data) DescriptorSet 0 + Decorate 16(@gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 21(@gl_SubgroupSize) BuiltIn SubgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 8: TypeInt 32 0 + 9: TypeRuntimeArray 8(int) + 10(data): TypeStruct 9 + 11: TypePointer Uniform 10(data) + 12(data): 11(ptr) Variable Uniform + 13: TypeInt 32 1 + 14: 13(int) Constant 0 + 15: TypePointer Input 8(int) +16(@gl_SubgroupInvocationID): 15(ptr) Variable Input + 18: TypeBool + 19: 8(int) Constant 3 +21(@gl_SubgroupSize): 15(ptr) Variable Input + 23: 8(int) Constant 0 + 25: TypePointer Uniform 8(int) + 4(CSMain): 2 Function None 3 + 5: Label + 27: 2 FunctionCall 6(@CSMain() + Return + FunctionEnd + 6(@CSMain(): 2 Function None 3 + 7: Label + 17: 8(int) Load 16(@gl_SubgroupInvocationID) + 20: 18(bool) GroupNonUniformElect 19 + 22: 8(int) Load 21(@gl_SubgroupSize) + 24: 8(int) Select 20 22 23 + 26: 25(ptr) AccessChain 12(data) 14 17 + Store 26 24 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.wavequery.frag.out b/deps/glslang/Test/baseResults/hlsl.wavequery.frag.out new file mode 100644 index 00000000..52304a6c --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.wavequery.frag.out @@ -0,0 +1,123 @@ +hlsl.wavequery.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction( ( temp 4-component vector of float) +0:2 Function Parameters: +0:? Sequence +0:3 Test condition and select ( temp void) +0:3 Condition +0:3 subgroupElect ( temp bool) +0:3 true case +0:? Sequence +0:5 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:3 false case +0:? Sequence +0:9 Branch: Return with expression +0:? Constant: +0:? 4.000000 +0:? 3.000000 +0:? 2.000000 +0:? 1.000000 +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @PixelShaderFunction( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction( ( temp 4-component vector of float) +0:2 Function Parameters: +0:? Sequence +0:3 Test condition and select ( temp void) +0:3 Condition +0:3 subgroupElect ( temp bool) +0:3 true case +0:? Sequence +0:5 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:3 false case +0:? Sequence +0:9 Branch: Return with expression +0:? Constant: +0:? 4.000000 +0:? 3.000000 +0:? 2.000000 +0:? 1.000000 +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @PixelShaderFunction( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 30 + + Capability Shader + Capability GroupNonUniform + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 28 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 9 "@PixelShaderFunction(" + Name 28 "@entryPointOutput" + Decorate 28(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeBool + 12: TypeInt 32 0 + 13: 12(int) Constant 3 + 17: 6(float) Constant 1065353216 + 18: 6(float) Constant 1073741824 + 19: 6(float) Constant 1077936128 + 20: 6(float) Constant 1082130432 + 21: 7(fvec4) ConstantComposite 17 18 19 20 + 24: 7(fvec4) ConstantComposite 20 19 18 17 + 27: TypePointer Output 7(fvec4) +28(@entryPointOutput): 27(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 29: 7(fvec4) FunctionCall 9(@PixelShaderFunction() + Store 28(@entryPointOutput) 29 + Return + FunctionEnd +9(@PixelShaderFunction(): 7(fvec4) Function None 8 + 10: Label + 14: 11(bool) GroupNonUniformElect 13 + SelectionMerge 16 None + BranchConditional 14 15 23 + 15: Label + ReturnValue 21 + 23: Label + ReturnValue 24 + 16: Label + 26: 7(fvec4) Undef + ReturnValue 26 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.wavereduction.comp.out b/deps/glslang/Test/baseResults/hlsl.wavereduction.comp.out new file mode 100644 index 00000000..f922f3dc --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.wavereduction.comp.out @@ -0,0 +1,7218 @@ +hlsl.wavereduction.comp +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:13 Function Definition: @CSMain(vu3; ( temp void) +0:13 Function Parameters: +0:13 'dti' ( in 3-component vector of uint) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 subgroupAdd ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:15 move second child to first child ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 subgroupAdd ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:16 move second child to first child ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 subgroupAdd ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:17 move second child to first child ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 subgroupAdd ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:19 move second child to first child ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 subgroupAdd ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:20 move second child to first child ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 subgroupAdd ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:21 move second child to first child ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 subgroupAdd ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:22 move second child to first child ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 subgroupAdd ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 subgroupAdd ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 subgroupAdd ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:26 move second child to first child ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 subgroupAdd ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:27 move second child to first child ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 subgroupAdd ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:29 move second child to first child ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:29 subgroupAdd ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:30 move second child to first child ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 subgroupAdd ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:31 move second child to first child ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 subgroupAdd ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:32 move second child to first child ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 subgroupAdd ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:34 move second child to first child ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 subgroupMul ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:35 move second child to first child ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 subgroupMul ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:36 move second child to first child ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:36 subgroupMul ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:37 move second child to first child ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 subgroupMul ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:39 move second child to first child ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 subgroupMul ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:40 move second child to first child ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:40 subgroupMul ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:41 move second child to first child ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 subgroupMul ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:42 move second child to first child ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:42 subgroupMul ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:44 move second child to first child ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 subgroupMul ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 subgroupMul ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:46 move second child to first child ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 subgroupMul ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 subgroupMul ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:49 move second child to first child ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:49 subgroupMul ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:50 move second child to first child ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:50 subgroupMul ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:51 move second child to first child ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:51 subgroupMul ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:52 move second child to first child ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:52 subgroupMul ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:54 move second child to first child ( temp 4-component vector of uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 subgroupMin ( temp 4-component vector of uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:55 move second child to first child ( temp uint) +0:55 direct index ( temp uint) +0:55 u: direct index for structure ( temp 4-component vector of uint) +0:55 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:55 Constant: +0:55 0 (const uint) +0:55 direct index ( temp uint) +0:55 'dti' ( in 3-component vector of uint) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 subgroupMin ( temp uint) +0:55 direct index ( temp uint) +0:55 u: direct index for structure ( temp 4-component vector of uint) +0:55 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:55 Constant: +0:55 0 (const uint) +0:55 direct index ( temp uint) +0:55 'dti' ( in 3-component vector of uint) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:56 move second child to first child ( temp 2-component vector of uint) +0:56 vector swizzle ( temp 2-component vector of uint) +0:56 u: direct index for structure ( temp 4-component vector of uint) +0:56 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:56 Constant: +0:56 0 (const uint) +0:56 direct index ( temp uint) +0:56 'dti' ( in 3-component vector of uint) +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 0 (const int) +0:56 Sequence +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1 (const int) +0:56 subgroupMin ( temp 2-component vector of uint) +0:56 vector swizzle ( temp 2-component vector of uint) +0:56 u: direct index for structure ( temp 4-component vector of uint) +0:56 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:56 Constant: +0:56 0 (const uint) +0:56 direct index ( temp uint) +0:56 'dti' ( in 3-component vector of uint) +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 0 (const int) +0:56 Sequence +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1 (const int) +0:57 move second child to first child ( temp 3-component vector of uint) +0:57 vector swizzle ( temp 3-component vector of uint) +0:57 u: direct index for structure ( temp 4-component vector of uint) +0:57 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:57 Constant: +0:57 0 (const uint) +0:57 direct index ( temp uint) +0:57 'dti' ( in 3-component vector of uint) +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 0 (const int) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 2 (const int) +0:57 subgroupMin ( temp 3-component vector of uint) +0:57 vector swizzle ( temp 3-component vector of uint) +0:57 u: direct index for structure ( temp 4-component vector of uint) +0:57 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:57 Constant: +0:57 0 (const uint) +0:57 direct index ( temp uint) +0:57 'dti' ( in 3-component vector of uint) +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 0 (const int) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 2 (const int) +0:59 move second child to first child ( temp 4-component vector of int) +0:59 i: direct index for structure ( temp 4-component vector of int) +0:59 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:59 Constant: +0:59 0 (const uint) +0:59 direct index ( temp uint) +0:59 'dti' ( in 3-component vector of uint) +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:59 subgroupMin ( temp 4-component vector of int) +0:59 i: direct index for structure ( temp 4-component vector of int) +0:59 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:59 Constant: +0:59 0 (const uint) +0:59 direct index ( temp uint) +0:59 'dti' ( in 3-component vector of uint) +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:60 move second child to first child ( temp int) +0:60 direct index ( temp int) +0:60 i: direct index for structure ( temp 4-component vector of int) +0:60 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:60 Constant: +0:60 0 (const uint) +0:60 direct index ( temp uint) +0:60 'dti' ( in 3-component vector of uint) +0:60 Constant: +0:60 0 (const int) +0:60 Constant: +0:60 1 (const int) +0:60 Constant: +0:60 0 (const int) +0:60 subgroupMin ( temp int) +0:60 direct index ( temp int) +0:60 i: direct index for structure ( temp 4-component vector of int) +0:60 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:60 Constant: +0:60 0 (const uint) +0:60 direct index ( temp uint) +0:60 'dti' ( in 3-component vector of uint) +0:60 Constant: +0:60 0 (const int) +0:60 Constant: +0:60 1 (const int) +0:60 Constant: +0:60 0 (const int) +0:61 move second child to first child ( temp 2-component vector of int) +0:61 vector swizzle ( temp 2-component vector of int) +0:61 i: direct index for structure ( temp 4-component vector of int) +0:61 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:61 Constant: +0:61 0 (const uint) +0:61 direct index ( temp uint) +0:61 'dti' ( in 3-component vector of uint) +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Sequence +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 subgroupMin ( temp 2-component vector of int) +0:61 vector swizzle ( temp 2-component vector of int) +0:61 i: direct index for structure ( temp 4-component vector of int) +0:61 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:61 Constant: +0:61 0 (const uint) +0:61 direct index ( temp uint) +0:61 'dti' ( in 3-component vector of uint) +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Sequence +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:62 move second child to first child ( temp 3-component vector of int) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 i: direct index for structure ( temp 4-component vector of int) +0:62 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:62 Constant: +0:62 0 (const uint) +0:62 direct index ( temp uint) +0:62 'dti' ( in 3-component vector of uint) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:62 subgroupMin ( temp 3-component vector of int) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 i: direct index for structure ( temp 4-component vector of int) +0:62 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:62 Constant: +0:62 0 (const uint) +0:62 direct index ( temp uint) +0:62 'dti' ( in 3-component vector of uint) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:64 move second child to first child ( temp 4-component vector of float) +0:64 f: direct index for structure ( temp 4-component vector of float) +0:64 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:64 Constant: +0:64 0 (const uint) +0:64 direct index ( temp uint) +0:64 'dti' ( in 3-component vector of uint) +0:64 Constant: +0:64 0 (const int) +0:64 Constant: +0:64 2 (const int) +0:64 subgroupMin ( temp 4-component vector of float) +0:64 f: direct index for structure ( temp 4-component vector of float) +0:64 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:64 Constant: +0:64 0 (const uint) +0:64 direct index ( temp uint) +0:64 'dti' ( in 3-component vector of uint) +0:64 Constant: +0:64 0 (const int) +0:64 Constant: +0:64 2 (const int) +0:65 move second child to first child ( temp float) +0:65 direct index ( temp float) +0:65 f: direct index for structure ( temp 4-component vector of float) +0:65 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:65 Constant: +0:65 0 (const uint) +0:65 direct index ( temp uint) +0:65 'dti' ( in 3-component vector of uint) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 2 (const int) +0:65 Constant: +0:65 0 (const int) +0:65 subgroupMin ( temp float) +0:65 direct index ( temp float) +0:65 f: direct index for structure ( temp 4-component vector of float) +0:65 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:65 Constant: +0:65 0 (const uint) +0:65 direct index ( temp uint) +0:65 'dti' ( in 3-component vector of uint) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 2 (const int) +0:65 Constant: +0:65 0 (const int) +0:66 move second child to first child ( temp 2-component vector of float) +0:66 vector swizzle ( temp 2-component vector of float) +0:66 f: direct index for structure ( temp 4-component vector of float) +0:66 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:66 Constant: +0:66 0 (const uint) +0:66 direct index ( temp uint) +0:66 'dti' ( in 3-component vector of uint) +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 2 (const int) +0:66 Sequence +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 1 (const int) +0:66 subgroupMin ( temp 2-component vector of float) +0:66 vector swizzle ( temp 2-component vector of float) +0:66 f: direct index for structure ( temp 4-component vector of float) +0:66 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:66 Constant: +0:66 0 (const uint) +0:66 direct index ( temp uint) +0:66 'dti' ( in 3-component vector of uint) +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 2 (const int) +0:66 Sequence +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 1 (const int) +0:67 move second child to first child ( temp 3-component vector of float) +0:67 vector swizzle ( temp 3-component vector of float) +0:67 f: direct index for structure ( temp 4-component vector of float) +0:67 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:67 Constant: +0:67 0 (const uint) +0:67 direct index ( temp uint) +0:67 'dti' ( in 3-component vector of uint) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 Sequence +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 1 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 subgroupMin ( temp 3-component vector of float) +0:67 vector swizzle ( temp 3-component vector of float) +0:67 f: direct index for structure ( temp 4-component vector of float) +0:67 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:67 Constant: +0:67 0 (const uint) +0:67 direct index ( temp uint) +0:67 'dti' ( in 3-component vector of uint) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 Sequence +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 1 (const int) +0:67 Constant: +0:67 2 (const int) +0:69 move second child to first child ( temp 4-component vector of double) +0:69 d: direct index for structure ( temp 4-component vector of double) +0:69 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:69 Constant: +0:69 0 (const uint) +0:69 direct index ( temp uint) +0:69 'dti' ( in 3-component vector of uint) +0:69 Constant: +0:69 0 (const int) +0:69 Constant: +0:69 3 (const int) +0:69 subgroupMin ( temp 4-component vector of double) +0:69 d: direct index for structure ( temp 4-component vector of double) +0:69 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:69 Constant: +0:69 0 (const uint) +0:69 direct index ( temp uint) +0:69 'dti' ( in 3-component vector of uint) +0:69 Constant: +0:69 0 (const int) +0:69 Constant: +0:69 3 (const int) +0:70 move second child to first child ( temp double) +0:70 direct index ( temp double) +0:70 d: direct index for structure ( temp 4-component vector of double) +0:70 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:70 Constant: +0:70 0 (const uint) +0:70 direct index ( temp uint) +0:70 'dti' ( in 3-component vector of uint) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 3 (const int) +0:70 Constant: +0:70 0 (const int) +0:70 subgroupMin ( temp double) +0:70 direct index ( temp double) +0:70 d: direct index for structure ( temp 4-component vector of double) +0:70 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:70 Constant: +0:70 0 (const uint) +0:70 direct index ( temp uint) +0:70 'dti' ( in 3-component vector of uint) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 3 (const int) +0:70 Constant: +0:70 0 (const int) +0:71 move second child to first child ( temp 2-component vector of double) +0:71 vector swizzle ( temp 2-component vector of double) +0:71 d: direct index for structure ( temp 4-component vector of double) +0:71 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:71 Constant: +0:71 0 (const uint) +0:71 direct index ( temp uint) +0:71 'dti' ( in 3-component vector of uint) +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 3 (const int) +0:71 Sequence +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 1 (const int) +0:71 subgroupMin ( temp 2-component vector of double) +0:71 vector swizzle ( temp 2-component vector of double) +0:71 d: direct index for structure ( temp 4-component vector of double) +0:71 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:71 Constant: +0:71 0 (const uint) +0:71 direct index ( temp uint) +0:71 'dti' ( in 3-component vector of uint) +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 3 (const int) +0:71 Sequence +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 1 (const int) +0:72 move second child to first child ( temp 3-component vector of double) +0:72 vector swizzle ( temp 3-component vector of double) +0:72 d: direct index for structure ( temp 4-component vector of double) +0:72 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:72 Constant: +0:72 0 (const uint) +0:72 direct index ( temp uint) +0:72 'dti' ( in 3-component vector of uint) +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 3 (const int) +0:72 Sequence +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 1 (const int) +0:72 Constant: +0:72 2 (const int) +0:72 subgroupMin ( temp 3-component vector of double) +0:72 vector swizzle ( temp 3-component vector of double) +0:72 d: direct index for structure ( temp 4-component vector of double) +0:72 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:72 Constant: +0:72 0 (const uint) +0:72 direct index ( temp uint) +0:72 'dti' ( in 3-component vector of uint) +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 3 (const int) +0:72 Sequence +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 1 (const int) +0:72 Constant: +0:72 2 (const int) +0:74 move second child to first child ( temp 4-component vector of uint) +0:74 u: direct index for structure ( temp 4-component vector of uint) +0:74 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:74 Constant: +0:74 0 (const uint) +0:74 direct index ( temp uint) +0:74 'dti' ( in 3-component vector of uint) +0:74 Constant: +0:74 0 (const int) +0:74 Constant: +0:74 0 (const int) +0:74 subgroupMax ( temp 4-component vector of uint) +0:74 u: direct index for structure ( temp 4-component vector of uint) +0:74 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:74 Constant: +0:74 0 (const uint) +0:74 direct index ( temp uint) +0:74 'dti' ( in 3-component vector of uint) +0:74 Constant: +0:74 0 (const int) +0:74 Constant: +0:74 0 (const int) +0:75 move second child to first child ( temp uint) +0:75 direct index ( temp uint) +0:75 u: direct index for structure ( temp 4-component vector of uint) +0:75 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:75 Constant: +0:75 0 (const uint) +0:75 direct index ( temp uint) +0:75 'dti' ( in 3-component vector of uint) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 subgroupMax ( temp uint) +0:75 direct index ( temp uint) +0:75 u: direct index for structure ( temp 4-component vector of uint) +0:75 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:75 Constant: +0:75 0 (const uint) +0:75 direct index ( temp uint) +0:75 'dti' ( in 3-component vector of uint) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:76 move second child to first child ( temp 2-component vector of uint) +0:76 vector swizzle ( temp 2-component vector of uint) +0:76 u: direct index for structure ( temp 4-component vector of uint) +0:76 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:76 Constant: +0:76 0 (const uint) +0:76 direct index ( temp uint) +0:76 'dti' ( in 3-component vector of uint) +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 0 (const int) +0:76 Sequence +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 1 (const int) +0:76 subgroupMax ( temp 2-component vector of uint) +0:76 vector swizzle ( temp 2-component vector of uint) +0:76 u: direct index for structure ( temp 4-component vector of uint) +0:76 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:76 Constant: +0:76 0 (const uint) +0:76 direct index ( temp uint) +0:76 'dti' ( in 3-component vector of uint) +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 0 (const int) +0:76 Sequence +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 1 (const int) +0:77 move second child to first child ( temp 3-component vector of uint) +0:77 vector swizzle ( temp 3-component vector of uint) +0:77 u: direct index for structure ( temp 4-component vector of uint) +0:77 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:77 Constant: +0:77 0 (const uint) +0:77 direct index ( temp uint) +0:77 'dti' ( in 3-component vector of uint) +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 0 (const int) +0:77 Sequence +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 1 (const int) +0:77 Constant: +0:77 2 (const int) +0:77 subgroupMax ( temp 3-component vector of uint) +0:77 vector swizzle ( temp 3-component vector of uint) +0:77 u: direct index for structure ( temp 4-component vector of uint) +0:77 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:77 Constant: +0:77 0 (const uint) +0:77 direct index ( temp uint) +0:77 'dti' ( in 3-component vector of uint) +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 0 (const int) +0:77 Sequence +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 1 (const int) +0:77 Constant: +0:77 2 (const int) +0:79 move second child to first child ( temp 4-component vector of int) +0:79 i: direct index for structure ( temp 4-component vector of int) +0:79 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:79 Constant: +0:79 0 (const uint) +0:79 direct index ( temp uint) +0:79 'dti' ( in 3-component vector of uint) +0:79 Constant: +0:79 0 (const int) +0:79 Constant: +0:79 1 (const int) +0:79 subgroupMax ( temp 4-component vector of int) +0:79 i: direct index for structure ( temp 4-component vector of int) +0:79 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:79 Constant: +0:79 0 (const uint) +0:79 direct index ( temp uint) +0:79 'dti' ( in 3-component vector of uint) +0:79 Constant: +0:79 0 (const int) +0:79 Constant: +0:79 1 (const int) +0:80 move second child to first child ( temp int) +0:80 direct index ( temp int) +0:80 i: direct index for structure ( temp 4-component vector of int) +0:80 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:80 Constant: +0:80 0 (const uint) +0:80 direct index ( temp uint) +0:80 'dti' ( in 3-component vector of uint) +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 1 (const int) +0:80 Constant: +0:80 0 (const int) +0:80 subgroupMax ( temp int) +0:80 direct index ( temp int) +0:80 i: direct index for structure ( temp 4-component vector of int) +0:80 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:80 Constant: +0:80 0 (const uint) +0:80 direct index ( temp uint) +0:80 'dti' ( in 3-component vector of uint) +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 1 (const int) +0:80 Constant: +0:80 0 (const int) +0:81 move second child to first child ( temp 2-component vector of int) +0:81 vector swizzle ( temp 2-component vector of int) +0:81 i: direct index for structure ( temp 4-component vector of int) +0:81 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:81 Constant: +0:81 0 (const uint) +0:81 direct index ( temp uint) +0:81 'dti' ( in 3-component vector of uint) +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 Sequence +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 subgroupMax ( temp 2-component vector of int) +0:81 vector swizzle ( temp 2-component vector of int) +0:81 i: direct index for structure ( temp 4-component vector of int) +0:81 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:81 Constant: +0:81 0 (const uint) +0:81 direct index ( temp uint) +0:81 'dti' ( in 3-component vector of uint) +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 Sequence +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:82 move second child to first child ( temp 3-component vector of int) +0:82 vector swizzle ( temp 3-component vector of int) +0:82 i: direct index for structure ( temp 4-component vector of int) +0:82 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:82 Constant: +0:82 0 (const uint) +0:82 direct index ( temp uint) +0:82 'dti' ( in 3-component vector of uint) +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Sequence +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Constant: +0:82 2 (const int) +0:82 subgroupMax ( temp 3-component vector of int) +0:82 vector swizzle ( temp 3-component vector of int) +0:82 i: direct index for structure ( temp 4-component vector of int) +0:82 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:82 Constant: +0:82 0 (const uint) +0:82 direct index ( temp uint) +0:82 'dti' ( in 3-component vector of uint) +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Sequence +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Constant: +0:82 2 (const int) +0:84 move second child to first child ( temp 4-component vector of float) +0:84 f: direct index for structure ( temp 4-component vector of float) +0:84 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:84 Constant: +0:84 0 (const uint) +0:84 direct index ( temp uint) +0:84 'dti' ( in 3-component vector of uint) +0:84 Constant: +0:84 0 (const int) +0:84 Constant: +0:84 2 (const int) +0:84 subgroupMax ( temp 4-component vector of float) +0:84 f: direct index for structure ( temp 4-component vector of float) +0:84 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:84 Constant: +0:84 0 (const uint) +0:84 direct index ( temp uint) +0:84 'dti' ( in 3-component vector of uint) +0:84 Constant: +0:84 0 (const int) +0:84 Constant: +0:84 2 (const int) +0:85 move second child to first child ( temp float) +0:85 direct index ( temp float) +0:85 f: direct index for structure ( temp 4-component vector of float) +0:85 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:85 Constant: +0:85 0 (const uint) +0:85 direct index ( temp uint) +0:85 'dti' ( in 3-component vector of uint) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 2 (const int) +0:85 Constant: +0:85 0 (const int) +0:85 subgroupMax ( temp float) +0:85 direct index ( temp float) +0:85 f: direct index for structure ( temp 4-component vector of float) +0:85 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:85 Constant: +0:85 0 (const uint) +0:85 direct index ( temp uint) +0:85 'dti' ( in 3-component vector of uint) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 2 (const int) +0:85 Constant: +0:85 0 (const int) +0:86 move second child to first child ( temp 2-component vector of float) +0:86 vector swizzle ( temp 2-component vector of float) +0:86 f: direct index for structure ( temp 4-component vector of float) +0:86 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:86 Constant: +0:86 0 (const uint) +0:86 direct index ( temp uint) +0:86 'dti' ( in 3-component vector of uint) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 2 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:86 subgroupMax ( temp 2-component vector of float) +0:86 vector swizzle ( temp 2-component vector of float) +0:86 f: direct index for structure ( temp 4-component vector of float) +0:86 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:86 Constant: +0:86 0 (const uint) +0:86 direct index ( temp uint) +0:86 'dti' ( in 3-component vector of uint) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 2 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:87 move second child to first child ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 f: direct index for structure ( temp 4-component vector of float) +0:87 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:87 Constant: +0:87 0 (const uint) +0:87 direct index ( temp uint) +0:87 'dti' ( in 3-component vector of uint) +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 subgroupMax ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 f: direct index for structure ( temp 4-component vector of float) +0:87 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:87 Constant: +0:87 0 (const uint) +0:87 direct index ( temp uint) +0:87 'dti' ( in 3-component vector of uint) +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:89 move second child to first child ( temp 4-component vector of double) +0:89 d: direct index for structure ( temp 4-component vector of double) +0:89 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:89 Constant: +0:89 0 (const uint) +0:89 direct index ( temp uint) +0:89 'dti' ( in 3-component vector of uint) +0:89 Constant: +0:89 0 (const int) +0:89 Constant: +0:89 3 (const int) +0:89 subgroupMax ( temp 4-component vector of double) +0:89 d: direct index for structure ( temp 4-component vector of double) +0:89 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:89 Constant: +0:89 0 (const uint) +0:89 direct index ( temp uint) +0:89 'dti' ( in 3-component vector of uint) +0:89 Constant: +0:89 0 (const int) +0:89 Constant: +0:89 3 (const int) +0:90 move second child to first child ( temp double) +0:90 direct index ( temp double) +0:90 d: direct index for structure ( temp 4-component vector of double) +0:90 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:90 Constant: +0:90 0 (const uint) +0:90 direct index ( temp uint) +0:90 'dti' ( in 3-component vector of uint) +0:90 Constant: +0:90 0 (const int) +0:90 Constant: +0:90 3 (const int) +0:90 Constant: +0:90 0 (const int) +0:90 subgroupMax ( temp double) +0:90 direct index ( temp double) +0:90 d: direct index for structure ( temp 4-component vector of double) +0:90 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:90 Constant: +0:90 0 (const uint) +0:90 direct index ( temp uint) +0:90 'dti' ( in 3-component vector of uint) +0:90 Constant: +0:90 0 (const int) +0:90 Constant: +0:90 3 (const int) +0:90 Constant: +0:90 0 (const int) +0:91 move second child to first child ( temp 2-component vector of double) +0:91 vector swizzle ( temp 2-component vector of double) +0:91 d: direct index for structure ( temp 4-component vector of double) +0:91 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:91 Constant: +0:91 0 (const uint) +0:91 direct index ( temp uint) +0:91 'dti' ( in 3-component vector of uint) +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 3 (const int) +0:91 Sequence +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 1 (const int) +0:91 subgroupMax ( temp 2-component vector of double) +0:91 vector swizzle ( temp 2-component vector of double) +0:91 d: direct index for structure ( temp 4-component vector of double) +0:91 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:91 Constant: +0:91 0 (const uint) +0:91 direct index ( temp uint) +0:91 'dti' ( in 3-component vector of uint) +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 3 (const int) +0:91 Sequence +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 1 (const int) +0:92 move second child to first child ( temp 3-component vector of double) +0:92 vector swizzle ( temp 3-component vector of double) +0:92 d: direct index for structure ( temp 4-component vector of double) +0:92 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:92 Constant: +0:92 0 (const uint) +0:92 direct index ( temp uint) +0:92 'dti' ( in 3-component vector of uint) +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 3 (const int) +0:92 Sequence +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 1 (const int) +0:92 Constant: +0:92 2 (const int) +0:92 subgroupMax ( temp 3-component vector of double) +0:92 vector swizzle ( temp 3-component vector of double) +0:92 d: direct index for structure ( temp 4-component vector of double) +0:92 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:92 Constant: +0:92 0 (const uint) +0:92 direct index ( temp uint) +0:92 'dti' ( in 3-component vector of uint) +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 3 (const int) +0:92 Sequence +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 1 (const int) +0:92 Constant: +0:92 2 (const int) +0:94 move second child to first child ( temp 4-component vector of uint) +0:94 u: direct index for structure ( temp 4-component vector of uint) +0:94 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:94 Constant: +0:94 0 (const uint) +0:94 direct index ( temp uint) +0:94 'dti' ( in 3-component vector of uint) +0:94 Constant: +0:94 0 (const int) +0:94 Constant: +0:94 0 (const int) +0:94 subgroupAnd ( temp 4-component vector of uint) +0:94 u: direct index for structure ( temp 4-component vector of uint) +0:94 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:94 Constant: +0:94 0 (const uint) +0:94 direct index ( temp uint) +0:94 'dti' ( in 3-component vector of uint) +0:94 Constant: +0:94 0 (const int) +0:94 Constant: +0:94 0 (const int) +0:95 move second child to first child ( temp uint) +0:95 direct index ( temp uint) +0:95 u: direct index for structure ( temp 4-component vector of uint) +0:95 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:95 Constant: +0:95 0 (const uint) +0:95 direct index ( temp uint) +0:95 'dti' ( in 3-component vector of uint) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 subgroupAnd ( temp uint) +0:95 direct index ( temp uint) +0:95 u: direct index for structure ( temp 4-component vector of uint) +0:95 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:95 Constant: +0:95 0 (const uint) +0:95 direct index ( temp uint) +0:95 'dti' ( in 3-component vector of uint) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:96 move second child to first child ( temp 2-component vector of uint) +0:96 vector swizzle ( temp 2-component vector of uint) +0:96 u: direct index for structure ( temp 4-component vector of uint) +0:96 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:96 Constant: +0:96 0 (const uint) +0:96 direct index ( temp uint) +0:96 'dti' ( in 3-component vector of uint) +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 0 (const int) +0:96 Sequence +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 1 (const int) +0:96 subgroupAnd ( temp 2-component vector of uint) +0:96 vector swizzle ( temp 2-component vector of uint) +0:96 u: direct index for structure ( temp 4-component vector of uint) +0:96 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:96 Constant: +0:96 0 (const uint) +0:96 direct index ( temp uint) +0:96 'dti' ( in 3-component vector of uint) +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 0 (const int) +0:96 Sequence +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 1 (const int) +0:97 move second child to first child ( temp 3-component vector of uint) +0:97 vector swizzle ( temp 3-component vector of uint) +0:97 u: direct index for structure ( temp 4-component vector of uint) +0:97 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:97 Constant: +0:97 0 (const uint) +0:97 direct index ( temp uint) +0:97 'dti' ( in 3-component vector of uint) +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 0 (const int) +0:97 Sequence +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 1 (const int) +0:97 Constant: +0:97 2 (const int) +0:97 subgroupAnd ( temp 3-component vector of uint) +0:97 vector swizzle ( temp 3-component vector of uint) +0:97 u: direct index for structure ( temp 4-component vector of uint) +0:97 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:97 Constant: +0:97 0 (const uint) +0:97 direct index ( temp uint) +0:97 'dti' ( in 3-component vector of uint) +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 0 (const int) +0:97 Sequence +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 1 (const int) +0:97 Constant: +0:97 2 (const int) +0:99 move second child to first child ( temp 4-component vector of int) +0:99 i: direct index for structure ( temp 4-component vector of int) +0:99 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:99 Constant: +0:99 0 (const uint) +0:99 direct index ( temp uint) +0:99 'dti' ( in 3-component vector of uint) +0:99 Constant: +0:99 0 (const int) +0:99 Constant: +0:99 1 (const int) +0:99 subgroupAnd ( temp 4-component vector of int) +0:99 i: direct index for structure ( temp 4-component vector of int) +0:99 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:99 Constant: +0:99 0 (const uint) +0:99 direct index ( temp uint) +0:99 'dti' ( in 3-component vector of uint) +0:99 Constant: +0:99 0 (const int) +0:99 Constant: +0:99 1 (const int) +0:100 move second child to first child ( temp int) +0:100 direct index ( temp int) +0:100 i: direct index for structure ( temp 4-component vector of int) +0:100 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:100 Constant: +0:100 0 (const uint) +0:100 direct index ( temp uint) +0:100 'dti' ( in 3-component vector of uint) +0:100 Constant: +0:100 0 (const int) +0:100 Constant: +0:100 1 (const int) +0:100 Constant: +0:100 0 (const int) +0:100 subgroupAnd ( temp int) +0:100 direct index ( temp int) +0:100 i: direct index for structure ( temp 4-component vector of int) +0:100 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:100 Constant: +0:100 0 (const uint) +0:100 direct index ( temp uint) +0:100 'dti' ( in 3-component vector of uint) +0:100 Constant: +0:100 0 (const int) +0:100 Constant: +0:100 1 (const int) +0:100 Constant: +0:100 0 (const int) +0:101 move second child to first child ( temp 2-component vector of int) +0:101 vector swizzle ( temp 2-component vector of int) +0:101 i: direct index for structure ( temp 4-component vector of int) +0:101 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:101 Constant: +0:101 0 (const uint) +0:101 direct index ( temp uint) +0:101 'dti' ( in 3-component vector of uint) +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 Sequence +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 subgroupAnd ( temp 2-component vector of int) +0:101 vector swizzle ( temp 2-component vector of int) +0:101 i: direct index for structure ( temp 4-component vector of int) +0:101 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:101 Constant: +0:101 0 (const uint) +0:101 direct index ( temp uint) +0:101 'dti' ( in 3-component vector of uint) +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 Sequence +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:102 move second child to first child ( temp 3-component vector of int) +0:102 vector swizzle ( temp 3-component vector of int) +0:102 i: direct index for structure ( temp 4-component vector of int) +0:102 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:102 Constant: +0:102 0 (const uint) +0:102 direct index ( temp uint) +0:102 'dti' ( in 3-component vector of uint) +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Sequence +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Constant: +0:102 2 (const int) +0:102 subgroupAnd ( temp 3-component vector of int) +0:102 vector swizzle ( temp 3-component vector of int) +0:102 i: direct index for structure ( temp 4-component vector of int) +0:102 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:102 Constant: +0:102 0 (const uint) +0:102 direct index ( temp uint) +0:102 'dti' ( in 3-component vector of uint) +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Sequence +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Constant: +0:102 2 (const int) +0:104 move second child to first child ( temp 4-component vector of uint) +0:104 u: direct index for structure ( temp 4-component vector of uint) +0:104 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:104 Constant: +0:104 0 (const uint) +0:104 direct index ( temp uint) +0:104 'dti' ( in 3-component vector of uint) +0:104 Constant: +0:104 0 (const int) +0:104 Constant: +0:104 0 (const int) +0:104 subgroupOr ( temp 4-component vector of uint) +0:104 u: direct index for structure ( temp 4-component vector of uint) +0:104 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:104 Constant: +0:104 0 (const uint) +0:104 direct index ( temp uint) +0:104 'dti' ( in 3-component vector of uint) +0:104 Constant: +0:104 0 (const int) +0:104 Constant: +0:104 0 (const int) +0:105 move second child to first child ( temp uint) +0:105 direct index ( temp uint) +0:105 u: direct index for structure ( temp 4-component vector of uint) +0:105 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:105 Constant: +0:105 0 (const uint) +0:105 direct index ( temp uint) +0:105 'dti' ( in 3-component vector of uint) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 0 (const int) +0:105 subgroupOr ( temp uint) +0:105 direct index ( temp uint) +0:105 u: direct index for structure ( temp 4-component vector of uint) +0:105 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:105 Constant: +0:105 0 (const uint) +0:105 direct index ( temp uint) +0:105 'dti' ( in 3-component vector of uint) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 0 (const int) +0:106 move second child to first child ( temp 2-component vector of uint) +0:106 vector swizzle ( temp 2-component vector of uint) +0:106 u: direct index for structure ( temp 4-component vector of uint) +0:106 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:106 Constant: +0:106 0 (const uint) +0:106 direct index ( temp uint) +0:106 'dti' ( in 3-component vector of uint) +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 0 (const int) +0:106 Sequence +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 1 (const int) +0:106 subgroupOr ( temp 2-component vector of uint) +0:106 vector swizzle ( temp 2-component vector of uint) +0:106 u: direct index for structure ( temp 4-component vector of uint) +0:106 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:106 Constant: +0:106 0 (const uint) +0:106 direct index ( temp uint) +0:106 'dti' ( in 3-component vector of uint) +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 0 (const int) +0:106 Sequence +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 1 (const int) +0:107 move second child to first child ( temp 3-component vector of uint) +0:107 vector swizzle ( temp 3-component vector of uint) +0:107 u: direct index for structure ( temp 4-component vector of uint) +0:107 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:107 Constant: +0:107 0 (const uint) +0:107 direct index ( temp uint) +0:107 'dti' ( in 3-component vector of uint) +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 0 (const int) +0:107 Sequence +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 1 (const int) +0:107 Constant: +0:107 2 (const int) +0:107 subgroupOr ( temp 3-component vector of uint) +0:107 vector swizzle ( temp 3-component vector of uint) +0:107 u: direct index for structure ( temp 4-component vector of uint) +0:107 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:107 Constant: +0:107 0 (const uint) +0:107 direct index ( temp uint) +0:107 'dti' ( in 3-component vector of uint) +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 0 (const int) +0:107 Sequence +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 1 (const int) +0:107 Constant: +0:107 2 (const int) +0:109 move second child to first child ( temp 4-component vector of int) +0:109 i: direct index for structure ( temp 4-component vector of int) +0:109 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:109 Constant: +0:109 0 (const uint) +0:109 direct index ( temp uint) +0:109 'dti' ( in 3-component vector of uint) +0:109 Constant: +0:109 0 (const int) +0:109 Constant: +0:109 1 (const int) +0:109 subgroupOr ( temp 4-component vector of int) +0:109 i: direct index for structure ( temp 4-component vector of int) +0:109 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:109 Constant: +0:109 0 (const uint) +0:109 direct index ( temp uint) +0:109 'dti' ( in 3-component vector of uint) +0:109 Constant: +0:109 0 (const int) +0:109 Constant: +0:109 1 (const int) +0:110 move second child to first child ( temp int) +0:110 direct index ( temp int) +0:110 i: direct index for structure ( temp 4-component vector of int) +0:110 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:110 Constant: +0:110 0 (const uint) +0:110 direct index ( temp uint) +0:110 'dti' ( in 3-component vector of uint) +0:110 Constant: +0:110 0 (const int) +0:110 Constant: +0:110 1 (const int) +0:110 Constant: +0:110 0 (const int) +0:110 subgroupOr ( temp int) +0:110 direct index ( temp int) +0:110 i: direct index for structure ( temp 4-component vector of int) +0:110 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:110 Constant: +0:110 0 (const uint) +0:110 direct index ( temp uint) +0:110 'dti' ( in 3-component vector of uint) +0:110 Constant: +0:110 0 (const int) +0:110 Constant: +0:110 1 (const int) +0:110 Constant: +0:110 0 (const int) +0:111 move second child to first child ( temp 2-component vector of int) +0:111 vector swizzle ( temp 2-component vector of int) +0:111 i: direct index for structure ( temp 4-component vector of int) +0:111 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:111 Constant: +0:111 0 (const uint) +0:111 direct index ( temp uint) +0:111 'dti' ( in 3-component vector of uint) +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:111 Sequence +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:111 subgroupOr ( temp 2-component vector of int) +0:111 vector swizzle ( temp 2-component vector of int) +0:111 i: direct index for structure ( temp 4-component vector of int) +0:111 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:111 Constant: +0:111 0 (const uint) +0:111 direct index ( temp uint) +0:111 'dti' ( in 3-component vector of uint) +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:111 Sequence +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:112 move second child to first child ( temp 3-component vector of int) +0:112 vector swizzle ( temp 3-component vector of int) +0:112 i: direct index for structure ( temp 4-component vector of int) +0:112 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:112 Constant: +0:112 0 (const uint) +0:112 direct index ( temp uint) +0:112 'dti' ( in 3-component vector of uint) +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Sequence +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Constant: +0:112 2 (const int) +0:112 subgroupOr ( temp 3-component vector of int) +0:112 vector swizzle ( temp 3-component vector of int) +0:112 i: direct index for structure ( temp 4-component vector of int) +0:112 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:112 Constant: +0:112 0 (const uint) +0:112 direct index ( temp uint) +0:112 'dti' ( in 3-component vector of uint) +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Sequence +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Constant: +0:112 2 (const int) +0:114 move second child to first child ( temp 4-component vector of uint) +0:114 u: direct index for structure ( temp 4-component vector of uint) +0:114 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:114 Constant: +0:114 0 (const uint) +0:114 direct index ( temp uint) +0:114 'dti' ( in 3-component vector of uint) +0:114 Constant: +0:114 0 (const int) +0:114 Constant: +0:114 0 (const int) +0:114 subgroupXor ( temp 4-component vector of uint) +0:114 u: direct index for structure ( temp 4-component vector of uint) +0:114 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:114 Constant: +0:114 0 (const uint) +0:114 direct index ( temp uint) +0:114 'dti' ( in 3-component vector of uint) +0:114 Constant: +0:114 0 (const int) +0:114 Constant: +0:114 0 (const int) +0:115 move second child to first child ( temp uint) +0:115 direct index ( temp uint) +0:115 u: direct index for structure ( temp 4-component vector of uint) +0:115 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:115 Constant: +0:115 0 (const uint) +0:115 direct index ( temp uint) +0:115 'dti' ( in 3-component vector of uint) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 subgroupXor ( temp uint) +0:115 direct index ( temp uint) +0:115 u: direct index for structure ( temp 4-component vector of uint) +0:115 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:115 Constant: +0:115 0 (const uint) +0:115 direct index ( temp uint) +0:115 'dti' ( in 3-component vector of uint) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:116 move second child to first child ( temp 2-component vector of uint) +0:116 vector swizzle ( temp 2-component vector of uint) +0:116 u: direct index for structure ( temp 4-component vector of uint) +0:116 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:116 Constant: +0:116 0 (const uint) +0:116 direct index ( temp uint) +0:116 'dti' ( in 3-component vector of uint) +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 0 (const int) +0:116 Sequence +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 1 (const int) +0:116 subgroupXor ( temp 2-component vector of uint) +0:116 vector swizzle ( temp 2-component vector of uint) +0:116 u: direct index for structure ( temp 4-component vector of uint) +0:116 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:116 Constant: +0:116 0 (const uint) +0:116 direct index ( temp uint) +0:116 'dti' ( in 3-component vector of uint) +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 0 (const int) +0:116 Sequence +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 1 (const int) +0:117 move second child to first child ( temp 3-component vector of uint) +0:117 vector swizzle ( temp 3-component vector of uint) +0:117 u: direct index for structure ( temp 4-component vector of uint) +0:117 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:117 Constant: +0:117 0 (const uint) +0:117 direct index ( temp uint) +0:117 'dti' ( in 3-component vector of uint) +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 0 (const int) +0:117 Sequence +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 1 (const int) +0:117 Constant: +0:117 2 (const int) +0:117 subgroupXor ( temp 3-component vector of uint) +0:117 vector swizzle ( temp 3-component vector of uint) +0:117 u: direct index for structure ( temp 4-component vector of uint) +0:117 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:117 Constant: +0:117 0 (const uint) +0:117 direct index ( temp uint) +0:117 'dti' ( in 3-component vector of uint) +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 0 (const int) +0:117 Sequence +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 1 (const int) +0:117 Constant: +0:117 2 (const int) +0:119 move second child to first child ( temp 4-component vector of int) +0:119 i: direct index for structure ( temp 4-component vector of int) +0:119 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:119 Constant: +0:119 0 (const uint) +0:119 direct index ( temp uint) +0:119 'dti' ( in 3-component vector of uint) +0:119 Constant: +0:119 0 (const int) +0:119 Constant: +0:119 1 (const int) +0:119 subgroupXor ( temp 4-component vector of int) +0:119 i: direct index for structure ( temp 4-component vector of int) +0:119 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:119 Constant: +0:119 0 (const uint) +0:119 direct index ( temp uint) +0:119 'dti' ( in 3-component vector of uint) +0:119 Constant: +0:119 0 (const int) +0:119 Constant: +0:119 1 (const int) +0:120 move second child to first child ( temp int) +0:120 direct index ( temp int) +0:120 i: direct index for structure ( temp 4-component vector of int) +0:120 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:120 Constant: +0:120 0 (const uint) +0:120 direct index ( temp uint) +0:120 'dti' ( in 3-component vector of uint) +0:120 Constant: +0:120 0 (const int) +0:120 Constant: +0:120 1 (const int) +0:120 Constant: +0:120 0 (const int) +0:120 subgroupXor ( temp int) +0:120 direct index ( temp int) +0:120 i: direct index for structure ( temp 4-component vector of int) +0:120 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:120 Constant: +0:120 0 (const uint) +0:120 direct index ( temp uint) +0:120 'dti' ( in 3-component vector of uint) +0:120 Constant: +0:120 0 (const int) +0:120 Constant: +0:120 1 (const int) +0:120 Constant: +0:120 0 (const int) +0:121 move second child to first child ( temp 2-component vector of int) +0:121 vector swizzle ( temp 2-component vector of int) +0:121 i: direct index for structure ( temp 4-component vector of int) +0:121 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:121 Constant: +0:121 0 (const uint) +0:121 direct index ( temp uint) +0:121 'dti' ( in 3-component vector of uint) +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 Sequence +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 subgroupXor ( temp 2-component vector of int) +0:121 vector swizzle ( temp 2-component vector of int) +0:121 i: direct index for structure ( temp 4-component vector of int) +0:121 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:121 Constant: +0:121 0 (const uint) +0:121 direct index ( temp uint) +0:121 'dti' ( in 3-component vector of uint) +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 Sequence +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:122 move second child to first child ( temp 3-component vector of int) +0:122 vector swizzle ( temp 3-component vector of int) +0:122 i: direct index for structure ( temp 4-component vector of int) +0:122 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:122 Constant: +0:122 0 (const uint) +0:122 direct index ( temp uint) +0:122 'dti' ( in 3-component vector of uint) +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Sequence +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Constant: +0:122 2 (const int) +0:122 subgroupXor ( temp 3-component vector of int) +0:122 vector swizzle ( temp 3-component vector of int) +0:122 i: direct index for structure ( temp 4-component vector of int) +0:122 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:122 Constant: +0:122 0 (const uint) +0:122 direct index ( temp uint) +0:122 'dti' ( in 3-component vector of uint) +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Sequence +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Constant: +0:122 2 (const int) +0:124 move second child to first child ( temp uint) +0:124 direct index ( temp uint) +0:124 u: direct index for structure ( temp 4-component vector of uint) +0:124 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:124 Constant: +0:124 0 (const uint) +0:124 direct index ( temp uint) +0:124 'dti' ( in 3-component vector of uint) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 0 (const int) +0:124 subgroupBallotBitCount ( temp uint) +0:124 subgroupBallot ( temp 4-component vector of uint) +0:124 Compare Equal ( temp bool) +0:124 direct index ( temp uint) +0:124 u: direct index for structure ( temp 4-component vector of uint) +0:124 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:124 Constant: +0:124 0 (const uint) +0:124 direct index ( temp uint) +0:124 'dti' ( in 3-component vector of uint) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 0 (const uint) +0:13 Function Definition: CSMain( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-component vector of uint) +0:? 'dti' ( temp 3-component vector of uint) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) +0:13 Function Call: @CSMain(vu3; ( temp void) +0:? 'dti' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:13 Function Definition: @CSMain(vu3; ( temp void) +0:13 Function Parameters: +0:13 'dti' ( in 3-component vector of uint) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 subgroupAdd ( temp 4-component vector of uint) +0:14 u: direct index for structure ( temp 4-component vector of uint) +0:14 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:14 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:14 Constant: +0:14 0 (const uint) +0:14 direct index ( temp uint) +0:14 'dti' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 0 (const int) +0:15 move second child to first child ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 subgroupAdd ( temp uint) +0:15 direct index ( temp uint) +0:15 u: direct index for structure ( temp 4-component vector of uint) +0:15 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:15 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:15 Constant: +0:15 0 (const uint) +0:15 direct index ( temp uint) +0:15 'dti' ( in 3-component vector of uint) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:16 move second child to first child ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 subgroupAdd ( temp 2-component vector of uint) +0:16 vector swizzle ( temp 2-component vector of uint) +0:16 u: direct index for structure ( temp 4-component vector of uint) +0:16 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:16 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:16 Constant: +0:16 0 (const uint) +0:16 direct index ( temp uint) +0:16 'dti' ( in 3-component vector of uint) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 0 (const int) +0:16 Sequence +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:17 move second child to first child ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 subgroupAdd ( temp 3-component vector of uint) +0:17 vector swizzle ( temp 3-component vector of uint) +0:17 u: direct index for structure ( temp 4-component vector of uint) +0:17 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:17 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:17 Constant: +0:17 0 (const uint) +0:17 direct index ( temp uint) +0:17 'dti' ( in 3-component vector of uint) +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 0 (const int) +0:17 Sequence +0:17 Constant: +0:17 0 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 2 (const int) +0:19 move second child to first child ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:19 subgroupAdd ( temp 4-component vector of int) +0:19 i: direct index for structure ( temp 4-component vector of int) +0:19 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:19 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:19 Constant: +0:19 0 (const uint) +0:19 direct index ( temp uint) +0:19 'dti' ( in 3-component vector of uint) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 1 (const int) +0:20 move second child to first child ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:20 subgroupAdd ( temp int) +0:20 direct index ( temp int) +0:20 i: direct index for structure ( temp 4-component vector of int) +0:20 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:20 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:20 Constant: +0:20 0 (const uint) +0:20 direct index ( temp uint) +0:20 'dti' ( in 3-component vector of uint) +0:20 Constant: +0:20 0 (const int) +0:20 Constant: +0:20 1 (const int) +0:20 Constant: +0:20 0 (const int) +0:21 move second child to first child ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 subgroupAdd ( temp 2-component vector of int) +0:21 vector swizzle ( temp 2-component vector of int) +0:21 i: direct index for structure ( temp 4-component vector of int) +0:21 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:21 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:21 Constant: +0:21 0 (const uint) +0:21 direct index ( temp uint) +0:21 'dti' ( in 3-component vector of uint) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:21 Sequence +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 1 (const int) +0:22 move second child to first child ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 subgroupAdd ( temp 3-component vector of int) +0:22 vector swizzle ( temp 3-component vector of int) +0:22 i: direct index for structure ( temp 4-component vector of int) +0:22 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:22 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:22 Constant: +0:22 0 (const uint) +0:22 direct index ( temp uint) +0:22 'dti' ( in 3-component vector of uint) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Sequence +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 Constant: +0:22 2 (const int) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:24 subgroupAdd ( temp 4-component vector of float) +0:24 f: direct index for structure ( temp 4-component vector of float) +0:24 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:24 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:24 Constant: +0:24 0 (const uint) +0:24 direct index ( temp uint) +0:24 'dti' ( in 3-component vector of uint) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 2 (const int) +0:25 move second child to first child ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:25 subgroupAdd ( temp float) +0:25 direct index ( temp float) +0:25 f: direct index for structure ( temp 4-component vector of float) +0:25 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:25 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:25 Constant: +0:25 0 (const uint) +0:25 direct index ( temp uint) +0:25 'dti' ( in 3-component vector of uint) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 0 (const int) +0:26 move second child to first child ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 subgroupAdd ( temp 2-component vector of float) +0:26 vector swizzle ( temp 2-component vector of float) +0:26 f: direct index for structure ( temp 4-component vector of float) +0:26 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:26 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:26 Constant: +0:26 0 (const uint) +0:26 direct index ( temp uint) +0:26 'dti' ( in 3-component vector of uint) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:27 move second child to first child ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 subgroupAdd ( temp 3-component vector of float) +0:27 vector swizzle ( temp 3-component vector of float) +0:27 f: direct index for structure ( temp 4-component vector of float) +0:27 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:27 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:27 Constant: +0:27 0 (const uint) +0:27 direct index ( temp uint) +0:27 'dti' ( in 3-component vector of uint) +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Sequence +0:27 Constant: +0:27 0 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 2 (const int) +0:29 move second child to first child ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:29 subgroupAdd ( temp 4-component vector of double) +0:29 d: direct index for structure ( temp 4-component vector of double) +0:29 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:29 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:29 Constant: +0:29 0 (const uint) +0:29 direct index ( temp uint) +0:29 'dti' ( in 3-component vector of uint) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 3 (const int) +0:30 move second child to first child ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:30 subgroupAdd ( temp double) +0:30 direct index ( temp double) +0:30 d: direct index for structure ( temp 4-component vector of double) +0:30 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:30 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:30 Constant: +0:30 0 (const uint) +0:30 direct index ( temp uint) +0:30 'dti' ( in 3-component vector of uint) +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 3 (const int) +0:30 Constant: +0:30 0 (const int) +0:31 move second child to first child ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:31 subgroupAdd ( temp 2-component vector of double) +0:31 vector swizzle ( temp 2-component vector of double) +0:31 d: direct index for structure ( temp 4-component vector of double) +0:31 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:31 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:31 Constant: +0:31 0 (const uint) +0:31 direct index ( temp uint) +0:31 'dti' ( in 3-component vector of uint) +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 Sequence +0:31 Constant: +0:31 0 (const int) +0:31 Constant: +0:31 1 (const int) +0:32 move second child to first child ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:32 subgroupAdd ( temp 3-component vector of double) +0:32 vector swizzle ( temp 3-component vector of double) +0:32 d: direct index for structure ( temp 4-component vector of double) +0:32 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:32 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:32 Constant: +0:32 0 (const uint) +0:32 direct index ( temp uint) +0:32 'dti' ( in 3-component vector of uint) +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 3 (const int) +0:32 Sequence +0:32 Constant: +0:32 0 (const int) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 2 (const int) +0:34 move second child to first child ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 subgroupMul ( temp 4-component vector of uint) +0:34 u: direct index for structure ( temp 4-component vector of uint) +0:34 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:34 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:34 Constant: +0:34 0 (const uint) +0:34 direct index ( temp uint) +0:34 'dti' ( in 3-component vector of uint) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:35 move second child to first child ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 subgroupMul ( temp uint) +0:35 direct index ( temp uint) +0:35 u: direct index for structure ( temp 4-component vector of uint) +0:35 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:35 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:35 Constant: +0:35 0 (const uint) +0:35 direct index ( temp uint) +0:35 'dti' ( in 3-component vector of uint) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:36 move second child to first child ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:36 subgroupMul ( temp 2-component vector of uint) +0:36 vector swizzle ( temp 2-component vector of uint) +0:36 u: direct index for structure ( temp 4-component vector of uint) +0:36 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:36 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:36 Constant: +0:36 0 (const uint) +0:36 direct index ( temp uint) +0:36 'dti' ( in 3-component vector of uint) +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 0 (const int) +0:36 Sequence +0:36 Constant: +0:36 0 (const int) +0:36 Constant: +0:36 1 (const int) +0:37 move second child to first child ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 subgroupMul ( temp 3-component vector of uint) +0:37 vector swizzle ( temp 3-component vector of uint) +0:37 u: direct index for structure ( temp 4-component vector of uint) +0:37 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:37 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:37 Constant: +0:37 0 (const uint) +0:37 direct index ( temp uint) +0:37 'dti' ( in 3-component vector of uint) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Sequence +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 2 (const int) +0:39 move second child to first child ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:39 subgroupMul ( temp 4-component vector of int) +0:39 i: direct index for structure ( temp 4-component vector of int) +0:39 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:39 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp uint) +0:39 'dti' ( in 3-component vector of uint) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 1 (const int) +0:40 move second child to first child ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:40 subgroupMul ( temp int) +0:40 direct index ( temp int) +0:40 i: direct index for structure ( temp 4-component vector of int) +0:40 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:40 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:40 Constant: +0:40 0 (const uint) +0:40 direct index ( temp uint) +0:40 'dti' ( in 3-component vector of uint) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 Constant: +0:40 0 (const int) +0:41 move second child to first child ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 subgroupMul ( temp 2-component vector of int) +0:41 vector swizzle ( temp 2-component vector of int) +0:41 i: direct index for structure ( temp 4-component vector of int) +0:41 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:41 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:41 Constant: +0:41 0 (const uint) +0:41 direct index ( temp uint) +0:41 'dti' ( in 3-component vector of uint) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:41 Sequence +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 1 (const int) +0:42 move second child to first child ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:42 subgroupMul ( temp 3-component vector of int) +0:42 vector swizzle ( temp 3-component vector of int) +0:42 i: direct index for structure ( temp 4-component vector of int) +0:42 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:42 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:42 Constant: +0:42 0 (const uint) +0:42 direct index ( temp uint) +0:42 'dti' ( in 3-component vector of uint) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Sequence +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 2 (const int) +0:44 move second child to first child ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:44 subgroupMul ( temp 4-component vector of float) +0:44 f: direct index for structure ( temp 4-component vector of float) +0:44 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:44 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp uint) +0:44 'dti' ( in 3-component vector of uint) +0:44 Constant: +0:44 0 (const int) +0:44 Constant: +0:44 2 (const int) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 subgroupMul ( temp float) +0:45 direct index ( temp float) +0:45 f: direct index for structure ( temp 4-component vector of float) +0:45 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:45 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:45 Constant: +0:45 0 (const uint) +0:45 direct index ( temp uint) +0:45 'dti' ( in 3-component vector of uint) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:46 move second child to first child ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 subgroupMul ( temp 2-component vector of float) +0:46 vector swizzle ( temp 2-component vector of float) +0:46 f: direct index for structure ( temp 4-component vector of float) +0:46 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:46 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp uint) +0:46 'dti' ( in 3-component vector of uint) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Sequence +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 1 (const int) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 subgroupMul ( temp 3-component vector of float) +0:47 vector swizzle ( temp 3-component vector of float) +0:47 f: direct index for structure ( temp 4-component vector of float) +0:47 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:47 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 'dti' ( in 3-component vector of uint) +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 Sequence +0:47 Constant: +0:47 0 (const int) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 2 (const int) +0:49 move second child to first child ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:49 subgroupMul ( temp 4-component vector of double) +0:49 d: direct index for structure ( temp 4-component vector of double) +0:49 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:49 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:49 Constant: +0:49 0 (const uint) +0:49 direct index ( temp uint) +0:49 'dti' ( in 3-component vector of uint) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3 (const int) +0:50 move second child to first child ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:50 subgroupMul ( temp double) +0:50 direct index ( temp double) +0:50 d: direct index for structure ( temp 4-component vector of double) +0:50 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:50 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:50 Constant: +0:50 0 (const uint) +0:50 direct index ( temp uint) +0:50 'dti' ( in 3-component vector of uint) +0:50 Constant: +0:50 0 (const int) +0:50 Constant: +0:50 3 (const int) +0:50 Constant: +0:50 0 (const int) +0:51 move second child to first child ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:51 subgroupMul ( temp 2-component vector of double) +0:51 vector swizzle ( temp 2-component vector of double) +0:51 d: direct index for structure ( temp 4-component vector of double) +0:51 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:51 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:51 Constant: +0:51 0 (const uint) +0:51 direct index ( temp uint) +0:51 'dti' ( in 3-component vector of uint) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:51 Sequence +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 1 (const int) +0:52 move second child to first child ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:52 subgroupMul ( temp 3-component vector of double) +0:52 vector swizzle ( temp 3-component vector of double) +0:52 d: direct index for structure ( temp 4-component vector of double) +0:52 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:52 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:52 Constant: +0:52 0 (const uint) +0:52 direct index ( temp uint) +0:52 'dti' ( in 3-component vector of uint) +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 3 (const int) +0:52 Sequence +0:52 Constant: +0:52 0 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 2 (const int) +0:54 move second child to first child ( temp 4-component vector of uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:54 subgroupMin ( temp 4-component vector of uint) +0:54 u: direct index for structure ( temp 4-component vector of uint) +0:54 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:54 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:54 Constant: +0:54 0 (const uint) +0:54 direct index ( temp uint) +0:54 'dti' ( in 3-component vector of uint) +0:54 Constant: +0:54 0 (const int) +0:54 Constant: +0:54 0 (const int) +0:55 move second child to first child ( temp uint) +0:55 direct index ( temp uint) +0:55 u: direct index for structure ( temp 4-component vector of uint) +0:55 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:55 Constant: +0:55 0 (const uint) +0:55 direct index ( temp uint) +0:55 'dti' ( in 3-component vector of uint) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 subgroupMin ( temp uint) +0:55 direct index ( temp uint) +0:55 u: direct index for structure ( temp 4-component vector of uint) +0:55 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:55 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:55 Constant: +0:55 0 (const uint) +0:55 direct index ( temp uint) +0:55 'dti' ( in 3-component vector of uint) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:55 Constant: +0:55 0 (const int) +0:56 move second child to first child ( temp 2-component vector of uint) +0:56 vector swizzle ( temp 2-component vector of uint) +0:56 u: direct index for structure ( temp 4-component vector of uint) +0:56 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:56 Constant: +0:56 0 (const uint) +0:56 direct index ( temp uint) +0:56 'dti' ( in 3-component vector of uint) +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 0 (const int) +0:56 Sequence +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1 (const int) +0:56 subgroupMin ( temp 2-component vector of uint) +0:56 vector swizzle ( temp 2-component vector of uint) +0:56 u: direct index for structure ( temp 4-component vector of uint) +0:56 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:56 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:56 Constant: +0:56 0 (const uint) +0:56 direct index ( temp uint) +0:56 'dti' ( in 3-component vector of uint) +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 0 (const int) +0:56 Sequence +0:56 Constant: +0:56 0 (const int) +0:56 Constant: +0:56 1 (const int) +0:57 move second child to first child ( temp 3-component vector of uint) +0:57 vector swizzle ( temp 3-component vector of uint) +0:57 u: direct index for structure ( temp 4-component vector of uint) +0:57 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:57 Constant: +0:57 0 (const uint) +0:57 direct index ( temp uint) +0:57 'dti' ( in 3-component vector of uint) +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 0 (const int) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 2 (const int) +0:57 subgroupMin ( temp 3-component vector of uint) +0:57 vector swizzle ( temp 3-component vector of uint) +0:57 u: direct index for structure ( temp 4-component vector of uint) +0:57 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:57 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:57 Constant: +0:57 0 (const uint) +0:57 direct index ( temp uint) +0:57 'dti' ( in 3-component vector of uint) +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 0 (const int) +0:57 Sequence +0:57 Constant: +0:57 0 (const int) +0:57 Constant: +0:57 1 (const int) +0:57 Constant: +0:57 2 (const int) +0:59 move second child to first child ( temp 4-component vector of int) +0:59 i: direct index for structure ( temp 4-component vector of int) +0:59 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:59 Constant: +0:59 0 (const uint) +0:59 direct index ( temp uint) +0:59 'dti' ( in 3-component vector of uint) +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:59 subgroupMin ( temp 4-component vector of int) +0:59 i: direct index for structure ( temp 4-component vector of int) +0:59 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:59 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:59 Constant: +0:59 0 (const uint) +0:59 direct index ( temp uint) +0:59 'dti' ( in 3-component vector of uint) +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 1 (const int) +0:60 move second child to first child ( temp int) +0:60 direct index ( temp int) +0:60 i: direct index for structure ( temp 4-component vector of int) +0:60 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:60 Constant: +0:60 0 (const uint) +0:60 direct index ( temp uint) +0:60 'dti' ( in 3-component vector of uint) +0:60 Constant: +0:60 0 (const int) +0:60 Constant: +0:60 1 (const int) +0:60 Constant: +0:60 0 (const int) +0:60 subgroupMin ( temp int) +0:60 direct index ( temp int) +0:60 i: direct index for structure ( temp 4-component vector of int) +0:60 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:60 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:60 Constant: +0:60 0 (const uint) +0:60 direct index ( temp uint) +0:60 'dti' ( in 3-component vector of uint) +0:60 Constant: +0:60 0 (const int) +0:60 Constant: +0:60 1 (const int) +0:60 Constant: +0:60 0 (const int) +0:61 move second child to first child ( temp 2-component vector of int) +0:61 vector swizzle ( temp 2-component vector of int) +0:61 i: direct index for structure ( temp 4-component vector of int) +0:61 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:61 Constant: +0:61 0 (const uint) +0:61 direct index ( temp uint) +0:61 'dti' ( in 3-component vector of uint) +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Sequence +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 subgroupMin ( temp 2-component vector of int) +0:61 vector swizzle ( temp 2-component vector of int) +0:61 i: direct index for structure ( temp 4-component vector of int) +0:61 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:61 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:61 Constant: +0:61 0 (const uint) +0:61 direct index ( temp uint) +0:61 'dti' ( in 3-component vector of uint) +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:61 Sequence +0:61 Constant: +0:61 0 (const int) +0:61 Constant: +0:61 1 (const int) +0:62 move second child to first child ( temp 3-component vector of int) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 i: direct index for structure ( temp 4-component vector of int) +0:62 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:62 Constant: +0:62 0 (const uint) +0:62 direct index ( temp uint) +0:62 'dti' ( in 3-component vector of uint) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:62 subgroupMin ( temp 3-component vector of int) +0:62 vector swizzle ( temp 3-component vector of int) +0:62 i: direct index for structure ( temp 4-component vector of int) +0:62 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:62 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:62 Constant: +0:62 0 (const uint) +0:62 direct index ( temp uint) +0:62 'dti' ( in 3-component vector of uint) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Sequence +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 2 (const int) +0:64 move second child to first child ( temp 4-component vector of float) +0:64 f: direct index for structure ( temp 4-component vector of float) +0:64 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:64 Constant: +0:64 0 (const uint) +0:64 direct index ( temp uint) +0:64 'dti' ( in 3-component vector of uint) +0:64 Constant: +0:64 0 (const int) +0:64 Constant: +0:64 2 (const int) +0:64 subgroupMin ( temp 4-component vector of float) +0:64 f: direct index for structure ( temp 4-component vector of float) +0:64 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:64 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:64 Constant: +0:64 0 (const uint) +0:64 direct index ( temp uint) +0:64 'dti' ( in 3-component vector of uint) +0:64 Constant: +0:64 0 (const int) +0:64 Constant: +0:64 2 (const int) +0:65 move second child to first child ( temp float) +0:65 direct index ( temp float) +0:65 f: direct index for structure ( temp 4-component vector of float) +0:65 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:65 Constant: +0:65 0 (const uint) +0:65 direct index ( temp uint) +0:65 'dti' ( in 3-component vector of uint) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 2 (const int) +0:65 Constant: +0:65 0 (const int) +0:65 subgroupMin ( temp float) +0:65 direct index ( temp float) +0:65 f: direct index for structure ( temp 4-component vector of float) +0:65 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:65 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:65 Constant: +0:65 0 (const uint) +0:65 direct index ( temp uint) +0:65 'dti' ( in 3-component vector of uint) +0:65 Constant: +0:65 0 (const int) +0:65 Constant: +0:65 2 (const int) +0:65 Constant: +0:65 0 (const int) +0:66 move second child to first child ( temp 2-component vector of float) +0:66 vector swizzle ( temp 2-component vector of float) +0:66 f: direct index for structure ( temp 4-component vector of float) +0:66 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:66 Constant: +0:66 0 (const uint) +0:66 direct index ( temp uint) +0:66 'dti' ( in 3-component vector of uint) +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 2 (const int) +0:66 Sequence +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 1 (const int) +0:66 subgroupMin ( temp 2-component vector of float) +0:66 vector swizzle ( temp 2-component vector of float) +0:66 f: direct index for structure ( temp 4-component vector of float) +0:66 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:66 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:66 Constant: +0:66 0 (const uint) +0:66 direct index ( temp uint) +0:66 'dti' ( in 3-component vector of uint) +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 2 (const int) +0:66 Sequence +0:66 Constant: +0:66 0 (const int) +0:66 Constant: +0:66 1 (const int) +0:67 move second child to first child ( temp 3-component vector of float) +0:67 vector swizzle ( temp 3-component vector of float) +0:67 f: direct index for structure ( temp 4-component vector of float) +0:67 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:67 Constant: +0:67 0 (const uint) +0:67 direct index ( temp uint) +0:67 'dti' ( in 3-component vector of uint) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 Sequence +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 1 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 subgroupMin ( temp 3-component vector of float) +0:67 vector swizzle ( temp 3-component vector of float) +0:67 f: direct index for structure ( temp 4-component vector of float) +0:67 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:67 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:67 Constant: +0:67 0 (const uint) +0:67 direct index ( temp uint) +0:67 'dti' ( in 3-component vector of uint) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 2 (const int) +0:67 Sequence +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 1 (const int) +0:67 Constant: +0:67 2 (const int) +0:69 move second child to first child ( temp 4-component vector of double) +0:69 d: direct index for structure ( temp 4-component vector of double) +0:69 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:69 Constant: +0:69 0 (const uint) +0:69 direct index ( temp uint) +0:69 'dti' ( in 3-component vector of uint) +0:69 Constant: +0:69 0 (const int) +0:69 Constant: +0:69 3 (const int) +0:69 subgroupMin ( temp 4-component vector of double) +0:69 d: direct index for structure ( temp 4-component vector of double) +0:69 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:69 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:69 Constant: +0:69 0 (const uint) +0:69 direct index ( temp uint) +0:69 'dti' ( in 3-component vector of uint) +0:69 Constant: +0:69 0 (const int) +0:69 Constant: +0:69 3 (const int) +0:70 move second child to first child ( temp double) +0:70 direct index ( temp double) +0:70 d: direct index for structure ( temp 4-component vector of double) +0:70 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:70 Constant: +0:70 0 (const uint) +0:70 direct index ( temp uint) +0:70 'dti' ( in 3-component vector of uint) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 3 (const int) +0:70 Constant: +0:70 0 (const int) +0:70 subgroupMin ( temp double) +0:70 direct index ( temp double) +0:70 d: direct index for structure ( temp 4-component vector of double) +0:70 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:70 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:70 Constant: +0:70 0 (const uint) +0:70 direct index ( temp uint) +0:70 'dti' ( in 3-component vector of uint) +0:70 Constant: +0:70 0 (const int) +0:70 Constant: +0:70 3 (const int) +0:70 Constant: +0:70 0 (const int) +0:71 move second child to first child ( temp 2-component vector of double) +0:71 vector swizzle ( temp 2-component vector of double) +0:71 d: direct index for structure ( temp 4-component vector of double) +0:71 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:71 Constant: +0:71 0 (const uint) +0:71 direct index ( temp uint) +0:71 'dti' ( in 3-component vector of uint) +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 3 (const int) +0:71 Sequence +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 1 (const int) +0:71 subgroupMin ( temp 2-component vector of double) +0:71 vector swizzle ( temp 2-component vector of double) +0:71 d: direct index for structure ( temp 4-component vector of double) +0:71 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:71 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:71 Constant: +0:71 0 (const uint) +0:71 direct index ( temp uint) +0:71 'dti' ( in 3-component vector of uint) +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 3 (const int) +0:71 Sequence +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 1 (const int) +0:72 move second child to first child ( temp 3-component vector of double) +0:72 vector swizzle ( temp 3-component vector of double) +0:72 d: direct index for structure ( temp 4-component vector of double) +0:72 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:72 Constant: +0:72 0 (const uint) +0:72 direct index ( temp uint) +0:72 'dti' ( in 3-component vector of uint) +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 3 (const int) +0:72 Sequence +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 1 (const int) +0:72 Constant: +0:72 2 (const int) +0:72 subgroupMin ( temp 3-component vector of double) +0:72 vector swizzle ( temp 3-component vector of double) +0:72 d: direct index for structure ( temp 4-component vector of double) +0:72 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:72 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:72 Constant: +0:72 0 (const uint) +0:72 direct index ( temp uint) +0:72 'dti' ( in 3-component vector of uint) +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 3 (const int) +0:72 Sequence +0:72 Constant: +0:72 0 (const int) +0:72 Constant: +0:72 1 (const int) +0:72 Constant: +0:72 2 (const int) +0:74 move second child to first child ( temp 4-component vector of uint) +0:74 u: direct index for structure ( temp 4-component vector of uint) +0:74 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:74 Constant: +0:74 0 (const uint) +0:74 direct index ( temp uint) +0:74 'dti' ( in 3-component vector of uint) +0:74 Constant: +0:74 0 (const int) +0:74 Constant: +0:74 0 (const int) +0:74 subgroupMax ( temp 4-component vector of uint) +0:74 u: direct index for structure ( temp 4-component vector of uint) +0:74 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:74 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:74 Constant: +0:74 0 (const uint) +0:74 direct index ( temp uint) +0:74 'dti' ( in 3-component vector of uint) +0:74 Constant: +0:74 0 (const int) +0:74 Constant: +0:74 0 (const int) +0:75 move second child to first child ( temp uint) +0:75 direct index ( temp uint) +0:75 u: direct index for structure ( temp 4-component vector of uint) +0:75 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:75 Constant: +0:75 0 (const uint) +0:75 direct index ( temp uint) +0:75 'dti' ( in 3-component vector of uint) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 subgroupMax ( temp uint) +0:75 direct index ( temp uint) +0:75 u: direct index for structure ( temp 4-component vector of uint) +0:75 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:75 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:75 Constant: +0:75 0 (const uint) +0:75 direct index ( temp uint) +0:75 'dti' ( in 3-component vector of uint) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:75 Constant: +0:75 0 (const int) +0:76 move second child to first child ( temp 2-component vector of uint) +0:76 vector swizzle ( temp 2-component vector of uint) +0:76 u: direct index for structure ( temp 4-component vector of uint) +0:76 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:76 Constant: +0:76 0 (const uint) +0:76 direct index ( temp uint) +0:76 'dti' ( in 3-component vector of uint) +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 0 (const int) +0:76 Sequence +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 1 (const int) +0:76 subgroupMax ( temp 2-component vector of uint) +0:76 vector swizzle ( temp 2-component vector of uint) +0:76 u: direct index for structure ( temp 4-component vector of uint) +0:76 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:76 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:76 Constant: +0:76 0 (const uint) +0:76 direct index ( temp uint) +0:76 'dti' ( in 3-component vector of uint) +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 0 (const int) +0:76 Sequence +0:76 Constant: +0:76 0 (const int) +0:76 Constant: +0:76 1 (const int) +0:77 move second child to first child ( temp 3-component vector of uint) +0:77 vector swizzle ( temp 3-component vector of uint) +0:77 u: direct index for structure ( temp 4-component vector of uint) +0:77 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:77 Constant: +0:77 0 (const uint) +0:77 direct index ( temp uint) +0:77 'dti' ( in 3-component vector of uint) +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 0 (const int) +0:77 Sequence +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 1 (const int) +0:77 Constant: +0:77 2 (const int) +0:77 subgroupMax ( temp 3-component vector of uint) +0:77 vector swizzle ( temp 3-component vector of uint) +0:77 u: direct index for structure ( temp 4-component vector of uint) +0:77 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:77 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:77 Constant: +0:77 0 (const uint) +0:77 direct index ( temp uint) +0:77 'dti' ( in 3-component vector of uint) +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 0 (const int) +0:77 Sequence +0:77 Constant: +0:77 0 (const int) +0:77 Constant: +0:77 1 (const int) +0:77 Constant: +0:77 2 (const int) +0:79 move second child to first child ( temp 4-component vector of int) +0:79 i: direct index for structure ( temp 4-component vector of int) +0:79 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:79 Constant: +0:79 0 (const uint) +0:79 direct index ( temp uint) +0:79 'dti' ( in 3-component vector of uint) +0:79 Constant: +0:79 0 (const int) +0:79 Constant: +0:79 1 (const int) +0:79 subgroupMax ( temp 4-component vector of int) +0:79 i: direct index for structure ( temp 4-component vector of int) +0:79 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:79 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:79 Constant: +0:79 0 (const uint) +0:79 direct index ( temp uint) +0:79 'dti' ( in 3-component vector of uint) +0:79 Constant: +0:79 0 (const int) +0:79 Constant: +0:79 1 (const int) +0:80 move second child to first child ( temp int) +0:80 direct index ( temp int) +0:80 i: direct index for structure ( temp 4-component vector of int) +0:80 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:80 Constant: +0:80 0 (const uint) +0:80 direct index ( temp uint) +0:80 'dti' ( in 3-component vector of uint) +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 1 (const int) +0:80 Constant: +0:80 0 (const int) +0:80 subgroupMax ( temp int) +0:80 direct index ( temp int) +0:80 i: direct index for structure ( temp 4-component vector of int) +0:80 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:80 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:80 Constant: +0:80 0 (const uint) +0:80 direct index ( temp uint) +0:80 'dti' ( in 3-component vector of uint) +0:80 Constant: +0:80 0 (const int) +0:80 Constant: +0:80 1 (const int) +0:80 Constant: +0:80 0 (const int) +0:81 move second child to first child ( temp 2-component vector of int) +0:81 vector swizzle ( temp 2-component vector of int) +0:81 i: direct index for structure ( temp 4-component vector of int) +0:81 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:81 Constant: +0:81 0 (const uint) +0:81 direct index ( temp uint) +0:81 'dti' ( in 3-component vector of uint) +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 Sequence +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 subgroupMax ( temp 2-component vector of int) +0:81 vector swizzle ( temp 2-component vector of int) +0:81 i: direct index for structure ( temp 4-component vector of int) +0:81 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:81 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:81 Constant: +0:81 0 (const uint) +0:81 direct index ( temp uint) +0:81 'dti' ( in 3-component vector of uint) +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:81 Sequence +0:81 Constant: +0:81 0 (const int) +0:81 Constant: +0:81 1 (const int) +0:82 move second child to first child ( temp 3-component vector of int) +0:82 vector swizzle ( temp 3-component vector of int) +0:82 i: direct index for structure ( temp 4-component vector of int) +0:82 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:82 Constant: +0:82 0 (const uint) +0:82 direct index ( temp uint) +0:82 'dti' ( in 3-component vector of uint) +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Sequence +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Constant: +0:82 2 (const int) +0:82 subgroupMax ( temp 3-component vector of int) +0:82 vector swizzle ( temp 3-component vector of int) +0:82 i: direct index for structure ( temp 4-component vector of int) +0:82 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:82 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:82 Constant: +0:82 0 (const uint) +0:82 direct index ( temp uint) +0:82 'dti' ( in 3-component vector of uint) +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Sequence +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 1 (const int) +0:82 Constant: +0:82 2 (const int) +0:84 move second child to first child ( temp 4-component vector of float) +0:84 f: direct index for structure ( temp 4-component vector of float) +0:84 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:84 Constant: +0:84 0 (const uint) +0:84 direct index ( temp uint) +0:84 'dti' ( in 3-component vector of uint) +0:84 Constant: +0:84 0 (const int) +0:84 Constant: +0:84 2 (const int) +0:84 subgroupMax ( temp 4-component vector of float) +0:84 f: direct index for structure ( temp 4-component vector of float) +0:84 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:84 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:84 Constant: +0:84 0 (const uint) +0:84 direct index ( temp uint) +0:84 'dti' ( in 3-component vector of uint) +0:84 Constant: +0:84 0 (const int) +0:84 Constant: +0:84 2 (const int) +0:85 move second child to first child ( temp float) +0:85 direct index ( temp float) +0:85 f: direct index for structure ( temp 4-component vector of float) +0:85 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:85 Constant: +0:85 0 (const uint) +0:85 direct index ( temp uint) +0:85 'dti' ( in 3-component vector of uint) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 2 (const int) +0:85 Constant: +0:85 0 (const int) +0:85 subgroupMax ( temp float) +0:85 direct index ( temp float) +0:85 f: direct index for structure ( temp 4-component vector of float) +0:85 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:85 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:85 Constant: +0:85 0 (const uint) +0:85 direct index ( temp uint) +0:85 'dti' ( in 3-component vector of uint) +0:85 Constant: +0:85 0 (const int) +0:85 Constant: +0:85 2 (const int) +0:85 Constant: +0:85 0 (const int) +0:86 move second child to first child ( temp 2-component vector of float) +0:86 vector swizzle ( temp 2-component vector of float) +0:86 f: direct index for structure ( temp 4-component vector of float) +0:86 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:86 Constant: +0:86 0 (const uint) +0:86 direct index ( temp uint) +0:86 'dti' ( in 3-component vector of uint) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 2 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:86 subgroupMax ( temp 2-component vector of float) +0:86 vector swizzle ( temp 2-component vector of float) +0:86 f: direct index for structure ( temp 4-component vector of float) +0:86 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:86 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:86 Constant: +0:86 0 (const uint) +0:86 direct index ( temp uint) +0:86 'dti' ( in 3-component vector of uint) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 2 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:87 move second child to first child ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 f: direct index for structure ( temp 4-component vector of float) +0:87 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:87 Constant: +0:87 0 (const uint) +0:87 direct index ( temp uint) +0:87 'dti' ( in 3-component vector of uint) +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 subgroupMax ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 f: direct index for structure ( temp 4-component vector of float) +0:87 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:87 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:87 Constant: +0:87 0 (const uint) +0:87 direct index ( temp uint) +0:87 'dti' ( in 3-component vector of uint) +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 2 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:89 move second child to first child ( temp 4-component vector of double) +0:89 d: direct index for structure ( temp 4-component vector of double) +0:89 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:89 Constant: +0:89 0 (const uint) +0:89 direct index ( temp uint) +0:89 'dti' ( in 3-component vector of uint) +0:89 Constant: +0:89 0 (const int) +0:89 Constant: +0:89 3 (const int) +0:89 subgroupMax ( temp 4-component vector of double) +0:89 d: direct index for structure ( temp 4-component vector of double) +0:89 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:89 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:89 Constant: +0:89 0 (const uint) +0:89 direct index ( temp uint) +0:89 'dti' ( in 3-component vector of uint) +0:89 Constant: +0:89 0 (const int) +0:89 Constant: +0:89 3 (const int) +0:90 move second child to first child ( temp double) +0:90 direct index ( temp double) +0:90 d: direct index for structure ( temp 4-component vector of double) +0:90 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:90 Constant: +0:90 0 (const uint) +0:90 direct index ( temp uint) +0:90 'dti' ( in 3-component vector of uint) +0:90 Constant: +0:90 0 (const int) +0:90 Constant: +0:90 3 (const int) +0:90 Constant: +0:90 0 (const int) +0:90 subgroupMax ( temp double) +0:90 direct index ( temp double) +0:90 d: direct index for structure ( temp 4-component vector of double) +0:90 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:90 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:90 Constant: +0:90 0 (const uint) +0:90 direct index ( temp uint) +0:90 'dti' ( in 3-component vector of uint) +0:90 Constant: +0:90 0 (const int) +0:90 Constant: +0:90 3 (const int) +0:90 Constant: +0:90 0 (const int) +0:91 move second child to first child ( temp 2-component vector of double) +0:91 vector swizzle ( temp 2-component vector of double) +0:91 d: direct index for structure ( temp 4-component vector of double) +0:91 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:91 Constant: +0:91 0 (const uint) +0:91 direct index ( temp uint) +0:91 'dti' ( in 3-component vector of uint) +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 3 (const int) +0:91 Sequence +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 1 (const int) +0:91 subgroupMax ( temp 2-component vector of double) +0:91 vector swizzle ( temp 2-component vector of double) +0:91 d: direct index for structure ( temp 4-component vector of double) +0:91 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:91 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:91 Constant: +0:91 0 (const uint) +0:91 direct index ( temp uint) +0:91 'dti' ( in 3-component vector of uint) +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 3 (const int) +0:91 Sequence +0:91 Constant: +0:91 0 (const int) +0:91 Constant: +0:91 1 (const int) +0:92 move second child to first child ( temp 3-component vector of double) +0:92 vector swizzle ( temp 3-component vector of double) +0:92 d: direct index for structure ( temp 4-component vector of double) +0:92 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:92 Constant: +0:92 0 (const uint) +0:92 direct index ( temp uint) +0:92 'dti' ( in 3-component vector of uint) +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 3 (const int) +0:92 Sequence +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 1 (const int) +0:92 Constant: +0:92 2 (const int) +0:92 subgroupMax ( temp 3-component vector of double) +0:92 vector swizzle ( temp 3-component vector of double) +0:92 d: direct index for structure ( temp 4-component vector of double) +0:92 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:92 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:92 Constant: +0:92 0 (const uint) +0:92 direct index ( temp uint) +0:92 'dti' ( in 3-component vector of uint) +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 3 (const int) +0:92 Sequence +0:92 Constant: +0:92 0 (const int) +0:92 Constant: +0:92 1 (const int) +0:92 Constant: +0:92 2 (const int) +0:94 move second child to first child ( temp 4-component vector of uint) +0:94 u: direct index for structure ( temp 4-component vector of uint) +0:94 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:94 Constant: +0:94 0 (const uint) +0:94 direct index ( temp uint) +0:94 'dti' ( in 3-component vector of uint) +0:94 Constant: +0:94 0 (const int) +0:94 Constant: +0:94 0 (const int) +0:94 subgroupAnd ( temp 4-component vector of uint) +0:94 u: direct index for structure ( temp 4-component vector of uint) +0:94 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:94 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:94 Constant: +0:94 0 (const uint) +0:94 direct index ( temp uint) +0:94 'dti' ( in 3-component vector of uint) +0:94 Constant: +0:94 0 (const int) +0:94 Constant: +0:94 0 (const int) +0:95 move second child to first child ( temp uint) +0:95 direct index ( temp uint) +0:95 u: direct index for structure ( temp 4-component vector of uint) +0:95 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:95 Constant: +0:95 0 (const uint) +0:95 direct index ( temp uint) +0:95 'dti' ( in 3-component vector of uint) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 subgroupAnd ( temp uint) +0:95 direct index ( temp uint) +0:95 u: direct index for structure ( temp 4-component vector of uint) +0:95 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:95 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:95 Constant: +0:95 0 (const uint) +0:95 direct index ( temp uint) +0:95 'dti' ( in 3-component vector of uint) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:95 Constant: +0:95 0 (const int) +0:96 move second child to first child ( temp 2-component vector of uint) +0:96 vector swizzle ( temp 2-component vector of uint) +0:96 u: direct index for structure ( temp 4-component vector of uint) +0:96 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:96 Constant: +0:96 0 (const uint) +0:96 direct index ( temp uint) +0:96 'dti' ( in 3-component vector of uint) +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 0 (const int) +0:96 Sequence +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 1 (const int) +0:96 subgroupAnd ( temp 2-component vector of uint) +0:96 vector swizzle ( temp 2-component vector of uint) +0:96 u: direct index for structure ( temp 4-component vector of uint) +0:96 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:96 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:96 Constant: +0:96 0 (const uint) +0:96 direct index ( temp uint) +0:96 'dti' ( in 3-component vector of uint) +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 0 (const int) +0:96 Sequence +0:96 Constant: +0:96 0 (const int) +0:96 Constant: +0:96 1 (const int) +0:97 move second child to first child ( temp 3-component vector of uint) +0:97 vector swizzle ( temp 3-component vector of uint) +0:97 u: direct index for structure ( temp 4-component vector of uint) +0:97 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:97 Constant: +0:97 0 (const uint) +0:97 direct index ( temp uint) +0:97 'dti' ( in 3-component vector of uint) +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 0 (const int) +0:97 Sequence +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 1 (const int) +0:97 Constant: +0:97 2 (const int) +0:97 subgroupAnd ( temp 3-component vector of uint) +0:97 vector swizzle ( temp 3-component vector of uint) +0:97 u: direct index for structure ( temp 4-component vector of uint) +0:97 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:97 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:97 Constant: +0:97 0 (const uint) +0:97 direct index ( temp uint) +0:97 'dti' ( in 3-component vector of uint) +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 0 (const int) +0:97 Sequence +0:97 Constant: +0:97 0 (const int) +0:97 Constant: +0:97 1 (const int) +0:97 Constant: +0:97 2 (const int) +0:99 move second child to first child ( temp 4-component vector of int) +0:99 i: direct index for structure ( temp 4-component vector of int) +0:99 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:99 Constant: +0:99 0 (const uint) +0:99 direct index ( temp uint) +0:99 'dti' ( in 3-component vector of uint) +0:99 Constant: +0:99 0 (const int) +0:99 Constant: +0:99 1 (const int) +0:99 subgroupAnd ( temp 4-component vector of int) +0:99 i: direct index for structure ( temp 4-component vector of int) +0:99 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:99 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:99 Constant: +0:99 0 (const uint) +0:99 direct index ( temp uint) +0:99 'dti' ( in 3-component vector of uint) +0:99 Constant: +0:99 0 (const int) +0:99 Constant: +0:99 1 (const int) +0:100 move second child to first child ( temp int) +0:100 direct index ( temp int) +0:100 i: direct index for structure ( temp 4-component vector of int) +0:100 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:100 Constant: +0:100 0 (const uint) +0:100 direct index ( temp uint) +0:100 'dti' ( in 3-component vector of uint) +0:100 Constant: +0:100 0 (const int) +0:100 Constant: +0:100 1 (const int) +0:100 Constant: +0:100 0 (const int) +0:100 subgroupAnd ( temp int) +0:100 direct index ( temp int) +0:100 i: direct index for structure ( temp 4-component vector of int) +0:100 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:100 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:100 Constant: +0:100 0 (const uint) +0:100 direct index ( temp uint) +0:100 'dti' ( in 3-component vector of uint) +0:100 Constant: +0:100 0 (const int) +0:100 Constant: +0:100 1 (const int) +0:100 Constant: +0:100 0 (const int) +0:101 move second child to first child ( temp 2-component vector of int) +0:101 vector swizzle ( temp 2-component vector of int) +0:101 i: direct index for structure ( temp 4-component vector of int) +0:101 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:101 Constant: +0:101 0 (const uint) +0:101 direct index ( temp uint) +0:101 'dti' ( in 3-component vector of uint) +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 Sequence +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 subgroupAnd ( temp 2-component vector of int) +0:101 vector swizzle ( temp 2-component vector of int) +0:101 i: direct index for structure ( temp 4-component vector of int) +0:101 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:101 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:101 Constant: +0:101 0 (const uint) +0:101 direct index ( temp uint) +0:101 'dti' ( in 3-component vector of uint) +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:101 Sequence +0:101 Constant: +0:101 0 (const int) +0:101 Constant: +0:101 1 (const int) +0:102 move second child to first child ( temp 3-component vector of int) +0:102 vector swizzle ( temp 3-component vector of int) +0:102 i: direct index for structure ( temp 4-component vector of int) +0:102 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:102 Constant: +0:102 0 (const uint) +0:102 direct index ( temp uint) +0:102 'dti' ( in 3-component vector of uint) +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Sequence +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Constant: +0:102 2 (const int) +0:102 subgroupAnd ( temp 3-component vector of int) +0:102 vector swizzle ( temp 3-component vector of int) +0:102 i: direct index for structure ( temp 4-component vector of int) +0:102 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:102 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:102 Constant: +0:102 0 (const uint) +0:102 direct index ( temp uint) +0:102 'dti' ( in 3-component vector of uint) +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Sequence +0:102 Constant: +0:102 0 (const int) +0:102 Constant: +0:102 1 (const int) +0:102 Constant: +0:102 2 (const int) +0:104 move second child to first child ( temp 4-component vector of uint) +0:104 u: direct index for structure ( temp 4-component vector of uint) +0:104 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:104 Constant: +0:104 0 (const uint) +0:104 direct index ( temp uint) +0:104 'dti' ( in 3-component vector of uint) +0:104 Constant: +0:104 0 (const int) +0:104 Constant: +0:104 0 (const int) +0:104 subgroupOr ( temp 4-component vector of uint) +0:104 u: direct index for structure ( temp 4-component vector of uint) +0:104 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:104 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:104 Constant: +0:104 0 (const uint) +0:104 direct index ( temp uint) +0:104 'dti' ( in 3-component vector of uint) +0:104 Constant: +0:104 0 (const int) +0:104 Constant: +0:104 0 (const int) +0:105 move second child to first child ( temp uint) +0:105 direct index ( temp uint) +0:105 u: direct index for structure ( temp 4-component vector of uint) +0:105 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:105 Constant: +0:105 0 (const uint) +0:105 direct index ( temp uint) +0:105 'dti' ( in 3-component vector of uint) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 0 (const int) +0:105 subgroupOr ( temp uint) +0:105 direct index ( temp uint) +0:105 u: direct index for structure ( temp 4-component vector of uint) +0:105 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:105 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:105 Constant: +0:105 0 (const uint) +0:105 direct index ( temp uint) +0:105 'dti' ( in 3-component vector of uint) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 0 (const int) +0:105 Constant: +0:105 0 (const int) +0:106 move second child to first child ( temp 2-component vector of uint) +0:106 vector swizzle ( temp 2-component vector of uint) +0:106 u: direct index for structure ( temp 4-component vector of uint) +0:106 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:106 Constant: +0:106 0 (const uint) +0:106 direct index ( temp uint) +0:106 'dti' ( in 3-component vector of uint) +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 0 (const int) +0:106 Sequence +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 1 (const int) +0:106 subgroupOr ( temp 2-component vector of uint) +0:106 vector swizzle ( temp 2-component vector of uint) +0:106 u: direct index for structure ( temp 4-component vector of uint) +0:106 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:106 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:106 Constant: +0:106 0 (const uint) +0:106 direct index ( temp uint) +0:106 'dti' ( in 3-component vector of uint) +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 0 (const int) +0:106 Sequence +0:106 Constant: +0:106 0 (const int) +0:106 Constant: +0:106 1 (const int) +0:107 move second child to first child ( temp 3-component vector of uint) +0:107 vector swizzle ( temp 3-component vector of uint) +0:107 u: direct index for structure ( temp 4-component vector of uint) +0:107 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:107 Constant: +0:107 0 (const uint) +0:107 direct index ( temp uint) +0:107 'dti' ( in 3-component vector of uint) +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 0 (const int) +0:107 Sequence +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 1 (const int) +0:107 Constant: +0:107 2 (const int) +0:107 subgroupOr ( temp 3-component vector of uint) +0:107 vector swizzle ( temp 3-component vector of uint) +0:107 u: direct index for structure ( temp 4-component vector of uint) +0:107 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:107 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:107 Constant: +0:107 0 (const uint) +0:107 direct index ( temp uint) +0:107 'dti' ( in 3-component vector of uint) +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 0 (const int) +0:107 Sequence +0:107 Constant: +0:107 0 (const int) +0:107 Constant: +0:107 1 (const int) +0:107 Constant: +0:107 2 (const int) +0:109 move second child to first child ( temp 4-component vector of int) +0:109 i: direct index for structure ( temp 4-component vector of int) +0:109 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:109 Constant: +0:109 0 (const uint) +0:109 direct index ( temp uint) +0:109 'dti' ( in 3-component vector of uint) +0:109 Constant: +0:109 0 (const int) +0:109 Constant: +0:109 1 (const int) +0:109 subgroupOr ( temp 4-component vector of int) +0:109 i: direct index for structure ( temp 4-component vector of int) +0:109 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:109 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:109 Constant: +0:109 0 (const uint) +0:109 direct index ( temp uint) +0:109 'dti' ( in 3-component vector of uint) +0:109 Constant: +0:109 0 (const int) +0:109 Constant: +0:109 1 (const int) +0:110 move second child to first child ( temp int) +0:110 direct index ( temp int) +0:110 i: direct index for structure ( temp 4-component vector of int) +0:110 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:110 Constant: +0:110 0 (const uint) +0:110 direct index ( temp uint) +0:110 'dti' ( in 3-component vector of uint) +0:110 Constant: +0:110 0 (const int) +0:110 Constant: +0:110 1 (const int) +0:110 Constant: +0:110 0 (const int) +0:110 subgroupOr ( temp int) +0:110 direct index ( temp int) +0:110 i: direct index for structure ( temp 4-component vector of int) +0:110 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:110 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:110 Constant: +0:110 0 (const uint) +0:110 direct index ( temp uint) +0:110 'dti' ( in 3-component vector of uint) +0:110 Constant: +0:110 0 (const int) +0:110 Constant: +0:110 1 (const int) +0:110 Constant: +0:110 0 (const int) +0:111 move second child to first child ( temp 2-component vector of int) +0:111 vector swizzle ( temp 2-component vector of int) +0:111 i: direct index for structure ( temp 4-component vector of int) +0:111 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:111 Constant: +0:111 0 (const uint) +0:111 direct index ( temp uint) +0:111 'dti' ( in 3-component vector of uint) +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:111 Sequence +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:111 subgroupOr ( temp 2-component vector of int) +0:111 vector swizzle ( temp 2-component vector of int) +0:111 i: direct index for structure ( temp 4-component vector of int) +0:111 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:111 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:111 Constant: +0:111 0 (const uint) +0:111 direct index ( temp uint) +0:111 'dti' ( in 3-component vector of uint) +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:111 Sequence +0:111 Constant: +0:111 0 (const int) +0:111 Constant: +0:111 1 (const int) +0:112 move second child to first child ( temp 3-component vector of int) +0:112 vector swizzle ( temp 3-component vector of int) +0:112 i: direct index for structure ( temp 4-component vector of int) +0:112 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:112 Constant: +0:112 0 (const uint) +0:112 direct index ( temp uint) +0:112 'dti' ( in 3-component vector of uint) +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Sequence +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Constant: +0:112 2 (const int) +0:112 subgroupOr ( temp 3-component vector of int) +0:112 vector swizzle ( temp 3-component vector of int) +0:112 i: direct index for structure ( temp 4-component vector of int) +0:112 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:112 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:112 Constant: +0:112 0 (const uint) +0:112 direct index ( temp uint) +0:112 'dti' ( in 3-component vector of uint) +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Sequence +0:112 Constant: +0:112 0 (const int) +0:112 Constant: +0:112 1 (const int) +0:112 Constant: +0:112 2 (const int) +0:114 move second child to first child ( temp 4-component vector of uint) +0:114 u: direct index for structure ( temp 4-component vector of uint) +0:114 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:114 Constant: +0:114 0 (const uint) +0:114 direct index ( temp uint) +0:114 'dti' ( in 3-component vector of uint) +0:114 Constant: +0:114 0 (const int) +0:114 Constant: +0:114 0 (const int) +0:114 subgroupXor ( temp 4-component vector of uint) +0:114 u: direct index for structure ( temp 4-component vector of uint) +0:114 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:114 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:114 Constant: +0:114 0 (const uint) +0:114 direct index ( temp uint) +0:114 'dti' ( in 3-component vector of uint) +0:114 Constant: +0:114 0 (const int) +0:114 Constant: +0:114 0 (const int) +0:115 move second child to first child ( temp uint) +0:115 direct index ( temp uint) +0:115 u: direct index for structure ( temp 4-component vector of uint) +0:115 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:115 Constant: +0:115 0 (const uint) +0:115 direct index ( temp uint) +0:115 'dti' ( in 3-component vector of uint) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 subgroupXor ( temp uint) +0:115 direct index ( temp uint) +0:115 u: direct index for structure ( temp 4-component vector of uint) +0:115 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:115 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:115 Constant: +0:115 0 (const uint) +0:115 direct index ( temp uint) +0:115 'dti' ( in 3-component vector of uint) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:115 Constant: +0:115 0 (const int) +0:116 move second child to first child ( temp 2-component vector of uint) +0:116 vector swizzle ( temp 2-component vector of uint) +0:116 u: direct index for structure ( temp 4-component vector of uint) +0:116 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:116 Constant: +0:116 0 (const uint) +0:116 direct index ( temp uint) +0:116 'dti' ( in 3-component vector of uint) +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 0 (const int) +0:116 Sequence +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 1 (const int) +0:116 subgroupXor ( temp 2-component vector of uint) +0:116 vector swizzle ( temp 2-component vector of uint) +0:116 u: direct index for structure ( temp 4-component vector of uint) +0:116 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:116 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:116 Constant: +0:116 0 (const uint) +0:116 direct index ( temp uint) +0:116 'dti' ( in 3-component vector of uint) +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 0 (const int) +0:116 Sequence +0:116 Constant: +0:116 0 (const int) +0:116 Constant: +0:116 1 (const int) +0:117 move second child to first child ( temp 3-component vector of uint) +0:117 vector swizzle ( temp 3-component vector of uint) +0:117 u: direct index for structure ( temp 4-component vector of uint) +0:117 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:117 Constant: +0:117 0 (const uint) +0:117 direct index ( temp uint) +0:117 'dti' ( in 3-component vector of uint) +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 0 (const int) +0:117 Sequence +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 1 (const int) +0:117 Constant: +0:117 2 (const int) +0:117 subgroupXor ( temp 3-component vector of uint) +0:117 vector swizzle ( temp 3-component vector of uint) +0:117 u: direct index for structure ( temp 4-component vector of uint) +0:117 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:117 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:117 Constant: +0:117 0 (const uint) +0:117 direct index ( temp uint) +0:117 'dti' ( in 3-component vector of uint) +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 0 (const int) +0:117 Sequence +0:117 Constant: +0:117 0 (const int) +0:117 Constant: +0:117 1 (const int) +0:117 Constant: +0:117 2 (const int) +0:119 move second child to first child ( temp 4-component vector of int) +0:119 i: direct index for structure ( temp 4-component vector of int) +0:119 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:119 Constant: +0:119 0 (const uint) +0:119 direct index ( temp uint) +0:119 'dti' ( in 3-component vector of uint) +0:119 Constant: +0:119 0 (const int) +0:119 Constant: +0:119 1 (const int) +0:119 subgroupXor ( temp 4-component vector of int) +0:119 i: direct index for structure ( temp 4-component vector of int) +0:119 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:119 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:119 Constant: +0:119 0 (const uint) +0:119 direct index ( temp uint) +0:119 'dti' ( in 3-component vector of uint) +0:119 Constant: +0:119 0 (const int) +0:119 Constant: +0:119 1 (const int) +0:120 move second child to first child ( temp int) +0:120 direct index ( temp int) +0:120 i: direct index for structure ( temp 4-component vector of int) +0:120 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:120 Constant: +0:120 0 (const uint) +0:120 direct index ( temp uint) +0:120 'dti' ( in 3-component vector of uint) +0:120 Constant: +0:120 0 (const int) +0:120 Constant: +0:120 1 (const int) +0:120 Constant: +0:120 0 (const int) +0:120 subgroupXor ( temp int) +0:120 direct index ( temp int) +0:120 i: direct index for structure ( temp 4-component vector of int) +0:120 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:120 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:120 Constant: +0:120 0 (const uint) +0:120 direct index ( temp uint) +0:120 'dti' ( in 3-component vector of uint) +0:120 Constant: +0:120 0 (const int) +0:120 Constant: +0:120 1 (const int) +0:120 Constant: +0:120 0 (const int) +0:121 move second child to first child ( temp 2-component vector of int) +0:121 vector swizzle ( temp 2-component vector of int) +0:121 i: direct index for structure ( temp 4-component vector of int) +0:121 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:121 Constant: +0:121 0 (const uint) +0:121 direct index ( temp uint) +0:121 'dti' ( in 3-component vector of uint) +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 Sequence +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 subgroupXor ( temp 2-component vector of int) +0:121 vector swizzle ( temp 2-component vector of int) +0:121 i: direct index for structure ( temp 4-component vector of int) +0:121 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:121 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:121 Constant: +0:121 0 (const uint) +0:121 direct index ( temp uint) +0:121 'dti' ( in 3-component vector of uint) +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:121 Sequence +0:121 Constant: +0:121 0 (const int) +0:121 Constant: +0:121 1 (const int) +0:122 move second child to first child ( temp 3-component vector of int) +0:122 vector swizzle ( temp 3-component vector of int) +0:122 i: direct index for structure ( temp 4-component vector of int) +0:122 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:122 Constant: +0:122 0 (const uint) +0:122 direct index ( temp uint) +0:122 'dti' ( in 3-component vector of uint) +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Sequence +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Constant: +0:122 2 (const int) +0:122 subgroupXor ( temp 3-component vector of int) +0:122 vector swizzle ( temp 3-component vector of int) +0:122 i: direct index for structure ( temp 4-component vector of int) +0:122 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:122 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:122 Constant: +0:122 0 (const uint) +0:122 direct index ( temp uint) +0:122 'dti' ( in 3-component vector of uint) +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Sequence +0:122 Constant: +0:122 0 (const int) +0:122 Constant: +0:122 1 (const int) +0:122 Constant: +0:122 2 (const int) +0:124 move second child to first child ( temp uint) +0:124 direct index ( temp uint) +0:124 u: direct index for structure ( temp 4-component vector of uint) +0:124 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:124 Constant: +0:124 0 (const uint) +0:124 direct index ( temp uint) +0:124 'dti' ( in 3-component vector of uint) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 0 (const int) +0:124 subgroupBallotBitCount ( temp uint) +0:124 subgroupBallot ( temp 4-component vector of uint) +0:124 Compare Equal ( temp bool) +0:124 direct index ( temp uint) +0:124 u: direct index for structure ( temp 4-component vector of uint) +0:124 indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d}) +0:124 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:124 Constant: +0:124 0 (const uint) +0:124 direct index ( temp uint) +0:124 'dti' ( in 3-component vector of uint) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 0 (const int) +0:124 Constant: +0:124 0 (const uint) +0:13 Function Definition: CSMain( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-component vector of uint) +0:? 'dti' ( temp 3-component vector of uint) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) +0:13 Function Call: @CSMain(vu3; ( temp void) +0:? 'dti' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of structure{ temp 4-component vector of uint u, temp 4-component vector of int i, temp 4-component vector of float f, temp 4-component vector of double d} @data}) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) + +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 901 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformArithmetic + Capability GroupNonUniformBallot + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "CSMain" 896 + ExecutionMode 4 LocalSize 32 16 1 + Source HLSL 500 + Name 4 "CSMain" + Name 11 "@CSMain(vu3;" + Name 10 "dti" + Name 20 "Types" + MemberName 20(Types) 0 "u" + MemberName 20(Types) 1 "i" + MemberName 20(Types) 2 "f" + MemberName 20(Types) 3 "d" + Name 22 "data" + MemberName 22(data) 0 "@data" + Name 24 "data" + Name 894 "dti" + Name 896 "dti" + Name 898 "param" + MemberDecorate 20(Types) 0 Offset 0 + MemberDecorate 20(Types) 1 Offset 16 + MemberDecorate 20(Types) 2 Offset 32 + MemberDecorate 20(Types) 3 Offset 64 + Decorate 21 ArrayStride 96 + MemberDecorate 22(data) 0 Offset 0 + Decorate 22(data) BufferBlock + Decorate 24(data) DescriptorSet 0 + Decorate 896(dti) BuiltIn GlobalInvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 9: TypeFunction 2 8(ptr) + 13: TypeVector 6(int) 4 + 14: TypeInt 32 1 + 15: TypeVector 14(int) 4 + 16: TypeFloat 32 + 17: TypeVector 16(float) 4 + 18: TypeFloat 64 + 19: TypeVector 18(float64_t) 4 + 20(Types): TypeStruct 13(ivec4) 15(ivec4) 17(fvec4) 19(f64vec4) + 21: TypeRuntimeArray 20(Types) + 22(data): TypeStruct 21 + 23: TypePointer Uniform 22(data) + 24(data): 23(ptr) Variable Uniform + 25: 14(int) Constant 0 + 26: 6(int) Constant 0 + 27: TypePointer Function 6(int) + 32: TypePointer Uniform 13(ivec4) + 35: 6(int) Constant 3 + 42: TypePointer Uniform 6(int) + 51: TypeVector 6(int) 2 + 72: 14(int) Constant 1 + 75: TypePointer Uniform 15(ivec4) + 84: TypePointer Uniform 14(int) + 93: TypeVector 14(int) 2 + 105: TypeVector 14(int) 3 + 115: 14(int) Constant 2 + 118: TypePointer Uniform 17(fvec4) + 127: TypePointer Uniform 16(float) + 136: TypeVector 16(float) 2 + 148: TypeVector 16(float) 3 + 158: 14(int) Constant 3 + 161: TypePointer Uniform 19(f64vec4) + 170: TypePointer Uniform 18(float64_t) + 179: TypeVector 18(float64_t) 2 + 191: TypeVector 18(float64_t) 3 + 889: TypeBool + 895: TypePointer Input 7(ivec3) + 896(dti): 895(ptr) Variable Input + 4(CSMain): 2 Function None 3 + 5: Label + 894(dti): 8(ptr) Variable Function + 898(param): 8(ptr) Variable Function + 897: 7(ivec3) Load 896(dti) + Store 894(dti) 897 + 899: 7(ivec3) Load 894(dti) + Store 898(param) 899 + 900: 2 FunctionCall 11(@CSMain(vu3;) 898(param) + Return + FunctionEnd +11(@CSMain(vu3;): 2 Function None 9 + 10(dti): 8(ptr) FunctionParameter + 12: Label + 28: 27(ptr) AccessChain 10(dti) 26 + 29: 6(int) Load 28 + 30: 27(ptr) AccessChain 10(dti) 26 + 31: 6(int) Load 30 + 33: 32(ptr) AccessChain 24(data) 25 31 25 + 34: 13(ivec4) Load 33 + 36: 13(ivec4) GroupNonUniformIAdd 35 Reduce 34 + 37: 32(ptr) AccessChain 24(data) 25 29 25 + Store 37 36 + 38: 27(ptr) AccessChain 10(dti) 26 + 39: 6(int) Load 38 + 40: 27(ptr) AccessChain 10(dti) 26 + 41: 6(int) Load 40 + 43: 42(ptr) AccessChain 24(data) 25 41 25 26 + 44: 6(int) Load 43 + 45: 6(int) GroupNonUniformIAdd 35 Reduce 44 + 46: 42(ptr) AccessChain 24(data) 25 39 25 26 + Store 46 45 + 47: 27(ptr) AccessChain 10(dti) 26 + 48: 6(int) Load 47 + 49: 27(ptr) AccessChain 10(dti) 26 + 50: 6(int) Load 49 + 52: 32(ptr) AccessChain 24(data) 25 50 25 + 53: 13(ivec4) Load 52 + 54: 51(ivec2) VectorShuffle 53 53 0 1 + 55: 51(ivec2) GroupNonUniformIAdd 35 Reduce 54 + 56: 32(ptr) AccessChain 24(data) 25 48 25 + 57: 13(ivec4) Load 56 + 58: 13(ivec4) VectorShuffle 57 55 4 5 2 3 + Store 56 58 + 59: 27(ptr) AccessChain 10(dti) 26 + 60: 6(int) Load 59 + 61: 27(ptr) AccessChain 10(dti) 26 + 62: 6(int) Load 61 + 63: 32(ptr) AccessChain 24(data) 25 62 25 + 64: 13(ivec4) Load 63 + 65: 7(ivec3) VectorShuffle 64 64 0 1 2 + 66: 7(ivec3) GroupNonUniformIAdd 35 Reduce 65 + 67: 32(ptr) AccessChain 24(data) 25 60 25 + 68: 13(ivec4) Load 67 + 69: 13(ivec4) VectorShuffle 68 66 4 5 6 3 + Store 67 69 + 70: 27(ptr) AccessChain 10(dti) 26 + 71: 6(int) Load 70 + 73: 27(ptr) AccessChain 10(dti) 26 + 74: 6(int) Load 73 + 76: 75(ptr) AccessChain 24(data) 25 74 72 + 77: 15(ivec4) Load 76 + 78: 15(ivec4) GroupNonUniformIAdd 35 Reduce 77 + 79: 75(ptr) AccessChain 24(data) 25 71 72 + Store 79 78 + 80: 27(ptr) AccessChain 10(dti) 26 + 81: 6(int) Load 80 + 82: 27(ptr) AccessChain 10(dti) 26 + 83: 6(int) Load 82 + 85: 84(ptr) AccessChain 24(data) 25 83 72 26 + 86: 14(int) Load 85 + 87: 14(int) GroupNonUniformIAdd 35 Reduce 86 + 88: 84(ptr) AccessChain 24(data) 25 81 72 26 + Store 88 87 + 89: 27(ptr) AccessChain 10(dti) 26 + 90: 6(int) Load 89 + 91: 27(ptr) AccessChain 10(dti) 26 + 92: 6(int) Load 91 + 94: 75(ptr) AccessChain 24(data) 25 92 72 + 95: 15(ivec4) Load 94 + 96: 93(ivec2) VectorShuffle 95 95 0 1 + 97: 93(ivec2) GroupNonUniformIAdd 35 Reduce 96 + 98: 75(ptr) AccessChain 24(data) 25 90 72 + 99: 15(ivec4) Load 98 + 100: 15(ivec4) VectorShuffle 99 97 4 5 2 3 + Store 98 100 + 101: 27(ptr) AccessChain 10(dti) 26 + 102: 6(int) Load 101 + 103: 27(ptr) AccessChain 10(dti) 26 + 104: 6(int) Load 103 + 106: 75(ptr) AccessChain 24(data) 25 104 72 + 107: 15(ivec4) Load 106 + 108: 105(ivec3) VectorShuffle 107 107 0 1 2 + 109: 105(ivec3) GroupNonUniformIAdd 35 Reduce 108 + 110: 75(ptr) AccessChain 24(data) 25 102 72 + 111: 15(ivec4) Load 110 + 112: 15(ivec4) VectorShuffle 111 109 4 5 6 3 + Store 110 112 + 113: 27(ptr) AccessChain 10(dti) 26 + 114: 6(int) Load 113 + 116: 27(ptr) AccessChain 10(dti) 26 + 117: 6(int) Load 116 + 119: 118(ptr) AccessChain 24(data) 25 117 115 + 120: 17(fvec4) Load 119 + 121: 17(fvec4) GroupNonUniformFAdd 35 Reduce 120 + 122: 118(ptr) AccessChain 24(data) 25 114 115 + Store 122 121 + 123: 27(ptr) AccessChain 10(dti) 26 + 124: 6(int) Load 123 + 125: 27(ptr) AccessChain 10(dti) 26 + 126: 6(int) Load 125 + 128: 127(ptr) AccessChain 24(data) 25 126 115 26 + 129: 16(float) Load 128 + 130: 16(float) GroupNonUniformFAdd 35 Reduce 129 + 131: 127(ptr) AccessChain 24(data) 25 124 115 26 + Store 131 130 + 132: 27(ptr) AccessChain 10(dti) 26 + 133: 6(int) Load 132 + 134: 27(ptr) AccessChain 10(dti) 26 + 135: 6(int) Load 134 + 137: 118(ptr) AccessChain 24(data) 25 135 115 + 138: 17(fvec4) Load 137 + 139: 136(fvec2) VectorShuffle 138 138 0 1 + 140: 136(fvec2) GroupNonUniformFAdd 35 Reduce 139 + 141: 118(ptr) AccessChain 24(data) 25 133 115 + 142: 17(fvec4) Load 141 + 143: 17(fvec4) VectorShuffle 142 140 4 5 2 3 + Store 141 143 + 144: 27(ptr) AccessChain 10(dti) 26 + 145: 6(int) Load 144 + 146: 27(ptr) AccessChain 10(dti) 26 + 147: 6(int) Load 146 + 149: 118(ptr) AccessChain 24(data) 25 147 115 + 150: 17(fvec4) Load 149 + 151: 148(fvec3) VectorShuffle 150 150 0 1 2 + 152: 148(fvec3) GroupNonUniformFAdd 35 Reduce 151 + 153: 118(ptr) AccessChain 24(data) 25 145 115 + 154: 17(fvec4) Load 153 + 155: 17(fvec4) VectorShuffle 154 152 4 5 6 3 + Store 153 155 + 156: 27(ptr) AccessChain 10(dti) 26 + 157: 6(int) Load 156 + 159: 27(ptr) AccessChain 10(dti) 26 + 160: 6(int) Load 159 + 162: 161(ptr) AccessChain 24(data) 25 160 158 + 163: 19(f64vec4) Load 162 + 164: 19(f64vec4) GroupNonUniformFAdd 35 Reduce 163 + 165: 161(ptr) AccessChain 24(data) 25 157 158 + Store 165 164 + 166: 27(ptr) AccessChain 10(dti) 26 + 167: 6(int) Load 166 + 168: 27(ptr) AccessChain 10(dti) 26 + 169: 6(int) Load 168 + 171: 170(ptr) AccessChain 24(data) 25 169 158 26 + 172:18(float64_t) Load 171 + 173:18(float64_t) GroupNonUniformFAdd 35 Reduce 172 + 174: 170(ptr) AccessChain 24(data) 25 167 158 26 + Store 174 173 + 175: 27(ptr) AccessChain 10(dti) 26 + 176: 6(int) Load 175 + 177: 27(ptr) AccessChain 10(dti) 26 + 178: 6(int) Load 177 + 180: 161(ptr) AccessChain 24(data) 25 178 158 + 181: 19(f64vec4) Load 180 + 182:179(f64vec2) VectorShuffle 181 181 0 1 + 183:179(f64vec2) GroupNonUniformFAdd 35 Reduce 182 + 184: 161(ptr) AccessChain 24(data) 25 176 158 + 185: 19(f64vec4) Load 184 + 186: 19(f64vec4) VectorShuffle 185 183 4 5 2 3 + Store 184 186 + 187: 27(ptr) AccessChain 10(dti) 26 + 188: 6(int) Load 187 + 189: 27(ptr) AccessChain 10(dti) 26 + 190: 6(int) Load 189 + 192: 161(ptr) AccessChain 24(data) 25 190 158 + 193: 19(f64vec4) Load 192 + 194:191(f64vec3) VectorShuffle 193 193 0 1 2 + 195:191(f64vec3) GroupNonUniformFAdd 35 Reduce 194 + 196: 161(ptr) AccessChain 24(data) 25 188 158 + 197: 19(f64vec4) Load 196 + 198: 19(f64vec4) VectorShuffle 197 195 4 5 6 3 + Store 196 198 + 199: 27(ptr) AccessChain 10(dti) 26 + 200: 6(int) Load 199 + 201: 27(ptr) AccessChain 10(dti) 26 + 202: 6(int) Load 201 + 203: 32(ptr) AccessChain 24(data) 25 202 25 + 204: 13(ivec4) Load 203 + 205: 13(ivec4) GroupNonUniformIMul 35 Reduce 204 + 206: 32(ptr) AccessChain 24(data) 25 200 25 + Store 206 205 + 207: 27(ptr) AccessChain 10(dti) 26 + 208: 6(int) Load 207 + 209: 27(ptr) AccessChain 10(dti) 26 + 210: 6(int) Load 209 + 211: 42(ptr) AccessChain 24(data) 25 210 25 26 + 212: 6(int) Load 211 + 213: 6(int) GroupNonUniformIMul 35 Reduce 212 + 214: 42(ptr) AccessChain 24(data) 25 208 25 26 + Store 214 213 + 215: 27(ptr) AccessChain 10(dti) 26 + 216: 6(int) Load 215 + 217: 27(ptr) AccessChain 10(dti) 26 + 218: 6(int) Load 217 + 219: 32(ptr) AccessChain 24(data) 25 218 25 + 220: 13(ivec4) Load 219 + 221: 51(ivec2) VectorShuffle 220 220 0 1 + 222: 51(ivec2) GroupNonUniformIMul 35 Reduce 221 + 223: 32(ptr) AccessChain 24(data) 25 216 25 + 224: 13(ivec4) Load 223 + 225: 13(ivec4) VectorShuffle 224 222 4 5 2 3 + Store 223 225 + 226: 27(ptr) AccessChain 10(dti) 26 + 227: 6(int) Load 226 + 228: 27(ptr) AccessChain 10(dti) 26 + 229: 6(int) Load 228 + 230: 32(ptr) AccessChain 24(data) 25 229 25 + 231: 13(ivec4) Load 230 + 232: 7(ivec3) VectorShuffle 231 231 0 1 2 + 233: 7(ivec3) GroupNonUniformIMul 35 Reduce 232 + 234: 32(ptr) AccessChain 24(data) 25 227 25 + 235: 13(ivec4) Load 234 + 236: 13(ivec4) VectorShuffle 235 233 4 5 6 3 + Store 234 236 + 237: 27(ptr) AccessChain 10(dti) 26 + 238: 6(int) Load 237 + 239: 27(ptr) AccessChain 10(dti) 26 + 240: 6(int) Load 239 + 241: 75(ptr) AccessChain 24(data) 25 240 72 + 242: 15(ivec4) Load 241 + 243: 15(ivec4) GroupNonUniformIMul 35 Reduce 242 + 244: 75(ptr) AccessChain 24(data) 25 238 72 + Store 244 243 + 245: 27(ptr) AccessChain 10(dti) 26 + 246: 6(int) Load 245 + 247: 27(ptr) AccessChain 10(dti) 26 + 248: 6(int) Load 247 + 249: 84(ptr) AccessChain 24(data) 25 248 72 26 + 250: 14(int) Load 249 + 251: 14(int) GroupNonUniformIMul 35 Reduce 250 + 252: 84(ptr) AccessChain 24(data) 25 246 72 26 + Store 252 251 + 253: 27(ptr) AccessChain 10(dti) 26 + 254: 6(int) Load 253 + 255: 27(ptr) AccessChain 10(dti) 26 + 256: 6(int) Load 255 + 257: 75(ptr) AccessChain 24(data) 25 256 72 + 258: 15(ivec4) Load 257 + 259: 93(ivec2) VectorShuffle 258 258 0 1 + 260: 93(ivec2) GroupNonUniformIMul 35 Reduce 259 + 261: 75(ptr) AccessChain 24(data) 25 254 72 + 262: 15(ivec4) Load 261 + 263: 15(ivec4) VectorShuffle 262 260 4 5 2 3 + Store 261 263 + 264: 27(ptr) AccessChain 10(dti) 26 + 265: 6(int) Load 264 + 266: 27(ptr) AccessChain 10(dti) 26 + 267: 6(int) Load 266 + 268: 75(ptr) AccessChain 24(data) 25 267 72 + 269: 15(ivec4) Load 268 + 270: 105(ivec3) VectorShuffle 269 269 0 1 2 + 271: 105(ivec3) GroupNonUniformIMul 35 Reduce 270 + 272: 75(ptr) AccessChain 24(data) 25 265 72 + 273: 15(ivec4) Load 272 + 274: 15(ivec4) VectorShuffle 273 271 4 5 6 3 + Store 272 274 + 275: 27(ptr) AccessChain 10(dti) 26 + 276: 6(int) Load 275 + 277: 27(ptr) AccessChain 10(dti) 26 + 278: 6(int) Load 277 + 279: 118(ptr) AccessChain 24(data) 25 278 115 + 280: 17(fvec4) Load 279 + 281: 17(fvec4) GroupNonUniformFMul 35 Reduce 280 + 282: 118(ptr) AccessChain 24(data) 25 276 115 + Store 282 281 + 283: 27(ptr) AccessChain 10(dti) 26 + 284: 6(int) Load 283 + 285: 27(ptr) AccessChain 10(dti) 26 + 286: 6(int) Load 285 + 287: 127(ptr) AccessChain 24(data) 25 286 115 26 + 288: 16(float) Load 287 + 289: 16(float) GroupNonUniformFMul 35 Reduce 288 + 290: 127(ptr) AccessChain 24(data) 25 284 115 26 + Store 290 289 + 291: 27(ptr) AccessChain 10(dti) 26 + 292: 6(int) Load 291 + 293: 27(ptr) AccessChain 10(dti) 26 + 294: 6(int) Load 293 + 295: 118(ptr) AccessChain 24(data) 25 294 115 + 296: 17(fvec4) Load 295 + 297: 136(fvec2) VectorShuffle 296 296 0 1 + 298: 136(fvec2) GroupNonUniformFMul 35 Reduce 297 + 299: 118(ptr) AccessChain 24(data) 25 292 115 + 300: 17(fvec4) Load 299 + 301: 17(fvec4) VectorShuffle 300 298 4 5 2 3 + Store 299 301 + 302: 27(ptr) AccessChain 10(dti) 26 + 303: 6(int) Load 302 + 304: 27(ptr) AccessChain 10(dti) 26 + 305: 6(int) Load 304 + 306: 118(ptr) AccessChain 24(data) 25 305 115 + 307: 17(fvec4) Load 306 + 308: 148(fvec3) VectorShuffle 307 307 0 1 2 + 309: 148(fvec3) GroupNonUniformFMul 35 Reduce 308 + 310: 118(ptr) AccessChain 24(data) 25 303 115 + 311: 17(fvec4) Load 310 + 312: 17(fvec4) VectorShuffle 311 309 4 5 6 3 + Store 310 312 + 313: 27(ptr) AccessChain 10(dti) 26 + 314: 6(int) Load 313 + 315: 27(ptr) AccessChain 10(dti) 26 + 316: 6(int) Load 315 + 317: 161(ptr) AccessChain 24(data) 25 316 158 + 318: 19(f64vec4) Load 317 + 319: 19(f64vec4) GroupNonUniformFMul 35 Reduce 318 + 320: 161(ptr) AccessChain 24(data) 25 314 158 + Store 320 319 + 321: 27(ptr) AccessChain 10(dti) 26 + 322: 6(int) Load 321 + 323: 27(ptr) AccessChain 10(dti) 26 + 324: 6(int) Load 323 + 325: 170(ptr) AccessChain 24(data) 25 324 158 26 + 326:18(float64_t) Load 325 + 327:18(float64_t) GroupNonUniformFMul 35 Reduce 326 + 328: 170(ptr) AccessChain 24(data) 25 322 158 26 + Store 328 327 + 329: 27(ptr) AccessChain 10(dti) 26 + 330: 6(int) Load 329 + 331: 27(ptr) AccessChain 10(dti) 26 + 332: 6(int) Load 331 + 333: 161(ptr) AccessChain 24(data) 25 332 158 + 334: 19(f64vec4) Load 333 + 335:179(f64vec2) VectorShuffle 334 334 0 1 + 336:179(f64vec2) GroupNonUniformFMul 35 Reduce 335 + 337: 161(ptr) AccessChain 24(data) 25 330 158 + 338: 19(f64vec4) Load 337 + 339: 19(f64vec4) VectorShuffle 338 336 4 5 2 3 + Store 337 339 + 340: 27(ptr) AccessChain 10(dti) 26 + 341: 6(int) Load 340 + 342: 27(ptr) AccessChain 10(dti) 26 + 343: 6(int) Load 342 + 344: 161(ptr) AccessChain 24(data) 25 343 158 + 345: 19(f64vec4) Load 344 + 346:191(f64vec3) VectorShuffle 345 345 0 1 2 + 347:191(f64vec3) GroupNonUniformFMul 35 Reduce 346 + 348: 161(ptr) AccessChain 24(data) 25 341 158 + 349: 19(f64vec4) Load 348 + 350: 19(f64vec4) VectorShuffle 349 347 4 5 6 3 + Store 348 350 + 351: 27(ptr) AccessChain 10(dti) 26 + 352: 6(int) Load 351 + 353: 27(ptr) AccessChain 10(dti) 26 + 354: 6(int) Load 353 + 355: 32(ptr) AccessChain 24(data) 25 354 25 + 356: 13(ivec4) Load 355 + 357: 13(ivec4) GroupNonUniformUMin 35 Reduce 356 + 358: 32(ptr) AccessChain 24(data) 25 352 25 + Store 358 357 + 359: 27(ptr) AccessChain 10(dti) 26 + 360: 6(int) Load 359 + 361: 27(ptr) AccessChain 10(dti) 26 + 362: 6(int) Load 361 + 363: 42(ptr) AccessChain 24(data) 25 362 25 26 + 364: 6(int) Load 363 + 365: 6(int) GroupNonUniformUMin 35 Reduce 364 + 366: 42(ptr) AccessChain 24(data) 25 360 25 26 + Store 366 365 + 367: 27(ptr) AccessChain 10(dti) 26 + 368: 6(int) Load 367 + 369: 27(ptr) AccessChain 10(dti) 26 + 370: 6(int) Load 369 + 371: 32(ptr) AccessChain 24(data) 25 370 25 + 372: 13(ivec4) Load 371 + 373: 51(ivec2) VectorShuffle 372 372 0 1 + 374: 51(ivec2) GroupNonUniformUMin 35 Reduce 373 + 375: 32(ptr) AccessChain 24(data) 25 368 25 + 376: 13(ivec4) Load 375 + 377: 13(ivec4) VectorShuffle 376 374 4 5 2 3 + Store 375 377 + 378: 27(ptr) AccessChain 10(dti) 26 + 379: 6(int) Load 378 + 380: 27(ptr) AccessChain 10(dti) 26 + 381: 6(int) Load 380 + 382: 32(ptr) AccessChain 24(data) 25 381 25 + 383: 13(ivec4) Load 382 + 384: 7(ivec3) VectorShuffle 383 383 0 1 2 + 385: 7(ivec3) GroupNonUniformUMin 35 Reduce 384 + 386: 32(ptr) AccessChain 24(data) 25 379 25 + 387: 13(ivec4) Load 386 + 388: 13(ivec4) VectorShuffle 387 385 4 5 6 3 + Store 386 388 + 389: 27(ptr) AccessChain 10(dti) 26 + 390: 6(int) Load 389 + 391: 27(ptr) AccessChain 10(dti) 26 + 392: 6(int) Load 391 + 393: 75(ptr) AccessChain 24(data) 25 392 72 + 394: 15(ivec4) Load 393 + 395: 15(ivec4) GroupNonUniformSMin 35 Reduce 394 + 396: 75(ptr) AccessChain 24(data) 25 390 72 + Store 396 395 + 397: 27(ptr) AccessChain 10(dti) 26 + 398: 6(int) Load 397 + 399: 27(ptr) AccessChain 10(dti) 26 + 400: 6(int) Load 399 + 401: 84(ptr) AccessChain 24(data) 25 400 72 26 + 402: 14(int) Load 401 + 403: 14(int) GroupNonUniformSMin 35 Reduce 402 + 404: 84(ptr) AccessChain 24(data) 25 398 72 26 + Store 404 403 + 405: 27(ptr) AccessChain 10(dti) 26 + 406: 6(int) Load 405 + 407: 27(ptr) AccessChain 10(dti) 26 + 408: 6(int) Load 407 + 409: 75(ptr) AccessChain 24(data) 25 408 72 + 410: 15(ivec4) Load 409 + 411: 93(ivec2) VectorShuffle 410 410 0 1 + 412: 93(ivec2) GroupNonUniformSMin 35 Reduce 411 + 413: 75(ptr) AccessChain 24(data) 25 406 72 + 414: 15(ivec4) Load 413 + 415: 15(ivec4) VectorShuffle 414 412 4 5 2 3 + Store 413 415 + 416: 27(ptr) AccessChain 10(dti) 26 + 417: 6(int) Load 416 + 418: 27(ptr) AccessChain 10(dti) 26 + 419: 6(int) Load 418 + 420: 75(ptr) AccessChain 24(data) 25 419 72 + 421: 15(ivec4) Load 420 + 422: 105(ivec3) VectorShuffle 421 421 0 1 2 + 423: 105(ivec3) GroupNonUniformSMin 35 Reduce 422 + 424: 75(ptr) AccessChain 24(data) 25 417 72 + 425: 15(ivec4) Load 424 + 426: 15(ivec4) VectorShuffle 425 423 4 5 6 3 + Store 424 426 + 427: 27(ptr) AccessChain 10(dti) 26 + 428: 6(int) Load 427 + 429: 27(ptr) AccessChain 10(dti) 26 + 430: 6(int) Load 429 + 431: 118(ptr) AccessChain 24(data) 25 430 115 + 432: 17(fvec4) Load 431 + 433: 17(fvec4) GroupNonUniformFMin 35 Reduce 432 + 434: 118(ptr) AccessChain 24(data) 25 428 115 + Store 434 433 + 435: 27(ptr) AccessChain 10(dti) 26 + 436: 6(int) Load 435 + 437: 27(ptr) AccessChain 10(dti) 26 + 438: 6(int) Load 437 + 439: 127(ptr) AccessChain 24(data) 25 438 115 26 + 440: 16(float) Load 439 + 441: 16(float) GroupNonUniformFMin 35 Reduce 440 + 442: 127(ptr) AccessChain 24(data) 25 436 115 26 + Store 442 441 + 443: 27(ptr) AccessChain 10(dti) 26 + 444: 6(int) Load 443 + 445: 27(ptr) AccessChain 10(dti) 26 + 446: 6(int) Load 445 + 447: 118(ptr) AccessChain 24(data) 25 446 115 + 448: 17(fvec4) Load 447 + 449: 136(fvec2) VectorShuffle 448 448 0 1 + 450: 136(fvec2) GroupNonUniformFMin 35 Reduce 449 + 451: 118(ptr) AccessChain 24(data) 25 444 115 + 452: 17(fvec4) Load 451 + 453: 17(fvec4) VectorShuffle 452 450 4 5 2 3 + Store 451 453 + 454: 27(ptr) AccessChain 10(dti) 26 + 455: 6(int) Load 454 + 456: 27(ptr) AccessChain 10(dti) 26 + 457: 6(int) Load 456 + 458: 118(ptr) AccessChain 24(data) 25 457 115 + 459: 17(fvec4) Load 458 + 460: 148(fvec3) VectorShuffle 459 459 0 1 2 + 461: 148(fvec3) GroupNonUniformFMin 35 Reduce 460 + 462: 118(ptr) AccessChain 24(data) 25 455 115 + 463: 17(fvec4) Load 462 + 464: 17(fvec4) VectorShuffle 463 461 4 5 6 3 + Store 462 464 + 465: 27(ptr) AccessChain 10(dti) 26 + 466: 6(int) Load 465 + 467: 27(ptr) AccessChain 10(dti) 26 + 468: 6(int) Load 467 + 469: 161(ptr) AccessChain 24(data) 25 468 158 + 470: 19(f64vec4) Load 469 + 471: 19(f64vec4) GroupNonUniformFMin 35 Reduce 470 + 472: 161(ptr) AccessChain 24(data) 25 466 158 + Store 472 471 + 473: 27(ptr) AccessChain 10(dti) 26 + 474: 6(int) Load 473 + 475: 27(ptr) AccessChain 10(dti) 26 + 476: 6(int) Load 475 + 477: 170(ptr) AccessChain 24(data) 25 476 158 26 + 478:18(float64_t) Load 477 + 479:18(float64_t) GroupNonUniformFMin 35 Reduce 478 + 480: 170(ptr) AccessChain 24(data) 25 474 158 26 + Store 480 479 + 481: 27(ptr) AccessChain 10(dti) 26 + 482: 6(int) Load 481 + 483: 27(ptr) AccessChain 10(dti) 26 + 484: 6(int) Load 483 + 485: 161(ptr) AccessChain 24(data) 25 484 158 + 486: 19(f64vec4) Load 485 + 487:179(f64vec2) VectorShuffle 486 486 0 1 + 488:179(f64vec2) GroupNonUniformFMin 35 Reduce 487 + 489: 161(ptr) AccessChain 24(data) 25 482 158 + 490: 19(f64vec4) Load 489 + 491: 19(f64vec4) VectorShuffle 490 488 4 5 2 3 + Store 489 491 + 492: 27(ptr) AccessChain 10(dti) 26 + 493: 6(int) Load 492 + 494: 27(ptr) AccessChain 10(dti) 26 + 495: 6(int) Load 494 + 496: 161(ptr) AccessChain 24(data) 25 495 158 + 497: 19(f64vec4) Load 496 + 498:191(f64vec3) VectorShuffle 497 497 0 1 2 + 499:191(f64vec3) GroupNonUniformFMin 35 Reduce 498 + 500: 161(ptr) AccessChain 24(data) 25 493 158 + 501: 19(f64vec4) Load 500 + 502: 19(f64vec4) VectorShuffle 501 499 4 5 6 3 + Store 500 502 + 503: 27(ptr) AccessChain 10(dti) 26 + 504: 6(int) Load 503 + 505: 27(ptr) AccessChain 10(dti) 26 + 506: 6(int) Load 505 + 507: 32(ptr) AccessChain 24(data) 25 506 25 + 508: 13(ivec4) Load 507 + 509: 13(ivec4) GroupNonUniformUMax 35 Reduce 508 + 510: 32(ptr) AccessChain 24(data) 25 504 25 + Store 510 509 + 511: 27(ptr) AccessChain 10(dti) 26 + 512: 6(int) Load 511 + 513: 27(ptr) AccessChain 10(dti) 26 + 514: 6(int) Load 513 + 515: 42(ptr) AccessChain 24(data) 25 514 25 26 + 516: 6(int) Load 515 + 517: 6(int) GroupNonUniformUMax 35 Reduce 516 + 518: 42(ptr) AccessChain 24(data) 25 512 25 26 + Store 518 517 + 519: 27(ptr) AccessChain 10(dti) 26 + 520: 6(int) Load 519 + 521: 27(ptr) AccessChain 10(dti) 26 + 522: 6(int) Load 521 + 523: 32(ptr) AccessChain 24(data) 25 522 25 + 524: 13(ivec4) Load 523 + 525: 51(ivec2) VectorShuffle 524 524 0 1 + 526: 51(ivec2) GroupNonUniformUMax 35 Reduce 525 + 527: 32(ptr) AccessChain 24(data) 25 520 25 + 528: 13(ivec4) Load 527 + 529: 13(ivec4) VectorShuffle 528 526 4 5 2 3 + Store 527 529 + 530: 27(ptr) AccessChain 10(dti) 26 + 531: 6(int) Load 530 + 532: 27(ptr) AccessChain 10(dti) 26 + 533: 6(int) Load 532 + 534: 32(ptr) AccessChain 24(data) 25 533 25 + 535: 13(ivec4) Load 534 + 536: 7(ivec3) VectorShuffle 535 535 0 1 2 + 537: 7(ivec3) GroupNonUniformUMax 35 Reduce 536 + 538: 32(ptr) AccessChain 24(data) 25 531 25 + 539: 13(ivec4) Load 538 + 540: 13(ivec4) VectorShuffle 539 537 4 5 6 3 + Store 538 540 + 541: 27(ptr) AccessChain 10(dti) 26 + 542: 6(int) Load 541 + 543: 27(ptr) AccessChain 10(dti) 26 + 544: 6(int) Load 543 + 545: 75(ptr) AccessChain 24(data) 25 544 72 + 546: 15(ivec4) Load 545 + 547: 15(ivec4) GroupNonUniformSMax 35 Reduce 546 + 548: 75(ptr) AccessChain 24(data) 25 542 72 + Store 548 547 + 549: 27(ptr) AccessChain 10(dti) 26 + 550: 6(int) Load 549 + 551: 27(ptr) AccessChain 10(dti) 26 + 552: 6(int) Load 551 + 553: 84(ptr) AccessChain 24(data) 25 552 72 26 + 554: 14(int) Load 553 + 555: 14(int) GroupNonUniformSMax 35 Reduce 554 + 556: 84(ptr) AccessChain 24(data) 25 550 72 26 + Store 556 555 + 557: 27(ptr) AccessChain 10(dti) 26 + 558: 6(int) Load 557 + 559: 27(ptr) AccessChain 10(dti) 26 + 560: 6(int) Load 559 + 561: 75(ptr) AccessChain 24(data) 25 560 72 + 562: 15(ivec4) Load 561 + 563: 93(ivec2) VectorShuffle 562 562 0 1 + 564: 93(ivec2) GroupNonUniformSMax 35 Reduce 563 + 565: 75(ptr) AccessChain 24(data) 25 558 72 + 566: 15(ivec4) Load 565 + 567: 15(ivec4) VectorShuffle 566 564 4 5 2 3 + Store 565 567 + 568: 27(ptr) AccessChain 10(dti) 26 + 569: 6(int) Load 568 + 570: 27(ptr) AccessChain 10(dti) 26 + 571: 6(int) Load 570 + 572: 75(ptr) AccessChain 24(data) 25 571 72 + 573: 15(ivec4) Load 572 + 574: 105(ivec3) VectorShuffle 573 573 0 1 2 + 575: 105(ivec3) GroupNonUniformSMax 35 Reduce 574 + 576: 75(ptr) AccessChain 24(data) 25 569 72 + 577: 15(ivec4) Load 576 + 578: 15(ivec4) VectorShuffle 577 575 4 5 6 3 + Store 576 578 + 579: 27(ptr) AccessChain 10(dti) 26 + 580: 6(int) Load 579 + 581: 27(ptr) AccessChain 10(dti) 26 + 582: 6(int) Load 581 + 583: 118(ptr) AccessChain 24(data) 25 582 115 + 584: 17(fvec4) Load 583 + 585: 17(fvec4) GroupNonUniformFMax 35 Reduce 584 + 586: 118(ptr) AccessChain 24(data) 25 580 115 + Store 586 585 + 587: 27(ptr) AccessChain 10(dti) 26 + 588: 6(int) Load 587 + 589: 27(ptr) AccessChain 10(dti) 26 + 590: 6(int) Load 589 + 591: 127(ptr) AccessChain 24(data) 25 590 115 26 + 592: 16(float) Load 591 + 593: 16(float) GroupNonUniformFMax 35 Reduce 592 + 594: 127(ptr) AccessChain 24(data) 25 588 115 26 + Store 594 593 + 595: 27(ptr) AccessChain 10(dti) 26 + 596: 6(int) Load 595 + 597: 27(ptr) AccessChain 10(dti) 26 + 598: 6(int) Load 597 + 599: 118(ptr) AccessChain 24(data) 25 598 115 + 600: 17(fvec4) Load 599 + 601: 136(fvec2) VectorShuffle 600 600 0 1 + 602: 136(fvec2) GroupNonUniformFMax 35 Reduce 601 + 603: 118(ptr) AccessChain 24(data) 25 596 115 + 604: 17(fvec4) Load 603 + 605: 17(fvec4) VectorShuffle 604 602 4 5 2 3 + Store 603 605 + 606: 27(ptr) AccessChain 10(dti) 26 + 607: 6(int) Load 606 + 608: 27(ptr) AccessChain 10(dti) 26 + 609: 6(int) Load 608 + 610: 118(ptr) AccessChain 24(data) 25 609 115 + 611: 17(fvec4) Load 610 + 612: 148(fvec3) VectorShuffle 611 611 0 1 2 + 613: 148(fvec3) GroupNonUniformFMax 35 Reduce 612 + 614: 118(ptr) AccessChain 24(data) 25 607 115 + 615: 17(fvec4) Load 614 + 616: 17(fvec4) VectorShuffle 615 613 4 5 6 3 + Store 614 616 + 617: 27(ptr) AccessChain 10(dti) 26 + 618: 6(int) Load 617 + 619: 27(ptr) AccessChain 10(dti) 26 + 620: 6(int) Load 619 + 621: 161(ptr) AccessChain 24(data) 25 620 158 + 622: 19(f64vec4) Load 621 + 623: 19(f64vec4) GroupNonUniformFMax 35 Reduce 622 + 624: 161(ptr) AccessChain 24(data) 25 618 158 + Store 624 623 + 625: 27(ptr) AccessChain 10(dti) 26 + 626: 6(int) Load 625 + 627: 27(ptr) AccessChain 10(dti) 26 + 628: 6(int) Load 627 + 629: 170(ptr) AccessChain 24(data) 25 628 158 26 + 630:18(float64_t) Load 629 + 631:18(float64_t) GroupNonUniformFMax 35 Reduce 630 + 632: 170(ptr) AccessChain 24(data) 25 626 158 26 + Store 632 631 + 633: 27(ptr) AccessChain 10(dti) 26 + 634: 6(int) Load 633 + 635: 27(ptr) AccessChain 10(dti) 26 + 636: 6(int) Load 635 + 637: 161(ptr) AccessChain 24(data) 25 636 158 + 638: 19(f64vec4) Load 637 + 639:179(f64vec2) VectorShuffle 638 638 0 1 + 640:179(f64vec2) GroupNonUniformFMax 35 Reduce 639 + 641: 161(ptr) AccessChain 24(data) 25 634 158 + 642: 19(f64vec4) Load 641 + 643: 19(f64vec4) VectorShuffle 642 640 4 5 2 3 + Store 641 643 + 644: 27(ptr) AccessChain 10(dti) 26 + 645: 6(int) Load 644 + 646: 27(ptr) AccessChain 10(dti) 26 + 647: 6(int) Load 646 + 648: 161(ptr) AccessChain 24(data) 25 647 158 + 649: 19(f64vec4) Load 648 + 650:191(f64vec3) VectorShuffle 649 649 0 1 2 + 651:191(f64vec3) GroupNonUniformFMax 35 Reduce 650 + 652: 161(ptr) AccessChain 24(data) 25 645 158 + 653: 19(f64vec4) Load 652 + 654: 19(f64vec4) VectorShuffle 653 651 4 5 6 3 + Store 652 654 + 655: 27(ptr) AccessChain 10(dti) 26 + 656: 6(int) Load 655 + 657: 27(ptr) AccessChain 10(dti) 26 + 658: 6(int) Load 657 + 659: 32(ptr) AccessChain 24(data) 25 658 25 + 660: 13(ivec4) Load 659 + 661: 13(ivec4) GroupNonUniformBitwiseAnd 35 Reduce 660 + 662: 32(ptr) AccessChain 24(data) 25 656 25 + Store 662 661 + 663: 27(ptr) AccessChain 10(dti) 26 + 664: 6(int) Load 663 + 665: 27(ptr) AccessChain 10(dti) 26 + 666: 6(int) Load 665 + 667: 42(ptr) AccessChain 24(data) 25 666 25 26 + 668: 6(int) Load 667 + 669: 6(int) GroupNonUniformBitwiseAnd 35 Reduce 668 + 670: 42(ptr) AccessChain 24(data) 25 664 25 26 + Store 670 669 + 671: 27(ptr) AccessChain 10(dti) 26 + 672: 6(int) Load 671 + 673: 27(ptr) AccessChain 10(dti) 26 + 674: 6(int) Load 673 + 675: 32(ptr) AccessChain 24(data) 25 674 25 + 676: 13(ivec4) Load 675 + 677: 51(ivec2) VectorShuffle 676 676 0 1 + 678: 51(ivec2) GroupNonUniformBitwiseAnd 35 Reduce 677 + 679: 32(ptr) AccessChain 24(data) 25 672 25 + 680: 13(ivec4) Load 679 + 681: 13(ivec4) VectorShuffle 680 678 4 5 2 3 + Store 679 681 + 682: 27(ptr) AccessChain 10(dti) 26 + 683: 6(int) Load 682 + 684: 27(ptr) AccessChain 10(dti) 26 + 685: 6(int) Load 684 + 686: 32(ptr) AccessChain 24(data) 25 685 25 + 687: 13(ivec4) Load 686 + 688: 7(ivec3) VectorShuffle 687 687 0 1 2 + 689: 7(ivec3) GroupNonUniformBitwiseAnd 35 Reduce 688 + 690: 32(ptr) AccessChain 24(data) 25 683 25 + 691: 13(ivec4) Load 690 + 692: 13(ivec4) VectorShuffle 691 689 4 5 6 3 + Store 690 692 + 693: 27(ptr) AccessChain 10(dti) 26 + 694: 6(int) Load 693 + 695: 27(ptr) AccessChain 10(dti) 26 + 696: 6(int) Load 695 + 697: 75(ptr) AccessChain 24(data) 25 696 72 + 698: 15(ivec4) Load 697 + 699: 15(ivec4) GroupNonUniformBitwiseAnd 35 Reduce 698 + 700: 75(ptr) AccessChain 24(data) 25 694 72 + Store 700 699 + 701: 27(ptr) AccessChain 10(dti) 26 + 702: 6(int) Load 701 + 703: 27(ptr) AccessChain 10(dti) 26 + 704: 6(int) Load 703 + 705: 84(ptr) AccessChain 24(data) 25 704 72 26 + 706: 14(int) Load 705 + 707: 14(int) GroupNonUniformBitwiseAnd 35 Reduce 706 + 708: 84(ptr) AccessChain 24(data) 25 702 72 26 + Store 708 707 + 709: 27(ptr) AccessChain 10(dti) 26 + 710: 6(int) Load 709 + 711: 27(ptr) AccessChain 10(dti) 26 + 712: 6(int) Load 711 + 713: 75(ptr) AccessChain 24(data) 25 712 72 + 714: 15(ivec4) Load 713 + 715: 93(ivec2) VectorShuffle 714 714 0 1 + 716: 93(ivec2) GroupNonUniformBitwiseAnd 35 Reduce 715 + 717: 75(ptr) AccessChain 24(data) 25 710 72 + 718: 15(ivec4) Load 717 + 719: 15(ivec4) VectorShuffle 718 716 4 5 2 3 + Store 717 719 + 720: 27(ptr) AccessChain 10(dti) 26 + 721: 6(int) Load 720 + 722: 27(ptr) AccessChain 10(dti) 26 + 723: 6(int) Load 722 + 724: 75(ptr) AccessChain 24(data) 25 723 72 + 725: 15(ivec4) Load 724 + 726: 105(ivec3) VectorShuffle 725 725 0 1 2 + 727: 105(ivec3) GroupNonUniformBitwiseAnd 35 Reduce 726 + 728: 75(ptr) AccessChain 24(data) 25 721 72 + 729: 15(ivec4) Load 728 + 730: 15(ivec4) VectorShuffle 729 727 4 5 6 3 + Store 728 730 + 731: 27(ptr) AccessChain 10(dti) 26 + 732: 6(int) Load 731 + 733: 27(ptr) AccessChain 10(dti) 26 + 734: 6(int) Load 733 + 735: 32(ptr) AccessChain 24(data) 25 734 25 + 736: 13(ivec4) Load 735 + 737: 13(ivec4) GroupNonUniformBitwiseOr 35 Reduce 736 + 738: 32(ptr) AccessChain 24(data) 25 732 25 + Store 738 737 + 739: 27(ptr) AccessChain 10(dti) 26 + 740: 6(int) Load 739 + 741: 27(ptr) AccessChain 10(dti) 26 + 742: 6(int) Load 741 + 743: 42(ptr) AccessChain 24(data) 25 742 25 26 + 744: 6(int) Load 743 + 745: 6(int) GroupNonUniformBitwiseOr 35 Reduce 744 + 746: 42(ptr) AccessChain 24(data) 25 740 25 26 + Store 746 745 + 747: 27(ptr) AccessChain 10(dti) 26 + 748: 6(int) Load 747 + 749: 27(ptr) AccessChain 10(dti) 26 + 750: 6(int) Load 749 + 751: 32(ptr) AccessChain 24(data) 25 750 25 + 752: 13(ivec4) Load 751 + 753: 51(ivec2) VectorShuffle 752 752 0 1 + 754: 51(ivec2) GroupNonUniformBitwiseOr 35 Reduce 753 + 755: 32(ptr) AccessChain 24(data) 25 748 25 + 756: 13(ivec4) Load 755 + 757: 13(ivec4) VectorShuffle 756 754 4 5 2 3 + Store 755 757 + 758: 27(ptr) AccessChain 10(dti) 26 + 759: 6(int) Load 758 + 760: 27(ptr) AccessChain 10(dti) 26 + 761: 6(int) Load 760 + 762: 32(ptr) AccessChain 24(data) 25 761 25 + 763: 13(ivec4) Load 762 + 764: 7(ivec3) VectorShuffle 763 763 0 1 2 + 765: 7(ivec3) GroupNonUniformBitwiseOr 35 Reduce 764 + 766: 32(ptr) AccessChain 24(data) 25 759 25 + 767: 13(ivec4) Load 766 + 768: 13(ivec4) VectorShuffle 767 765 4 5 6 3 + Store 766 768 + 769: 27(ptr) AccessChain 10(dti) 26 + 770: 6(int) Load 769 + 771: 27(ptr) AccessChain 10(dti) 26 + 772: 6(int) Load 771 + 773: 75(ptr) AccessChain 24(data) 25 772 72 + 774: 15(ivec4) Load 773 + 775: 15(ivec4) GroupNonUniformBitwiseOr 35 Reduce 774 + 776: 75(ptr) AccessChain 24(data) 25 770 72 + Store 776 775 + 777: 27(ptr) AccessChain 10(dti) 26 + 778: 6(int) Load 777 + 779: 27(ptr) AccessChain 10(dti) 26 + 780: 6(int) Load 779 + 781: 84(ptr) AccessChain 24(data) 25 780 72 26 + 782: 14(int) Load 781 + 783: 14(int) GroupNonUniformBitwiseOr 35 Reduce 782 + 784: 84(ptr) AccessChain 24(data) 25 778 72 26 + Store 784 783 + 785: 27(ptr) AccessChain 10(dti) 26 + 786: 6(int) Load 785 + 787: 27(ptr) AccessChain 10(dti) 26 + 788: 6(int) Load 787 + 789: 75(ptr) AccessChain 24(data) 25 788 72 + 790: 15(ivec4) Load 789 + 791: 93(ivec2) VectorShuffle 790 790 0 1 + 792: 93(ivec2) GroupNonUniformBitwiseOr 35 Reduce 791 + 793: 75(ptr) AccessChain 24(data) 25 786 72 + 794: 15(ivec4) Load 793 + 795: 15(ivec4) VectorShuffle 794 792 4 5 2 3 + Store 793 795 + 796: 27(ptr) AccessChain 10(dti) 26 + 797: 6(int) Load 796 + 798: 27(ptr) AccessChain 10(dti) 26 + 799: 6(int) Load 798 + 800: 75(ptr) AccessChain 24(data) 25 799 72 + 801: 15(ivec4) Load 800 + 802: 105(ivec3) VectorShuffle 801 801 0 1 2 + 803: 105(ivec3) GroupNonUniformBitwiseOr 35 Reduce 802 + 804: 75(ptr) AccessChain 24(data) 25 797 72 + 805: 15(ivec4) Load 804 + 806: 15(ivec4) VectorShuffle 805 803 4 5 6 3 + Store 804 806 + 807: 27(ptr) AccessChain 10(dti) 26 + 808: 6(int) Load 807 + 809: 27(ptr) AccessChain 10(dti) 26 + 810: 6(int) Load 809 + 811: 32(ptr) AccessChain 24(data) 25 810 25 + 812: 13(ivec4) Load 811 + 813: 13(ivec4) GroupNonUniformBitwiseXor 35 Reduce 812 + 814: 32(ptr) AccessChain 24(data) 25 808 25 + Store 814 813 + 815: 27(ptr) AccessChain 10(dti) 26 + 816: 6(int) Load 815 + 817: 27(ptr) AccessChain 10(dti) 26 + 818: 6(int) Load 817 + 819: 42(ptr) AccessChain 24(data) 25 818 25 26 + 820: 6(int) Load 819 + 821: 6(int) GroupNonUniformBitwiseXor 35 Reduce 820 + 822: 42(ptr) AccessChain 24(data) 25 816 25 26 + Store 822 821 + 823: 27(ptr) AccessChain 10(dti) 26 + 824: 6(int) Load 823 + 825: 27(ptr) AccessChain 10(dti) 26 + 826: 6(int) Load 825 + 827: 32(ptr) AccessChain 24(data) 25 826 25 + 828: 13(ivec4) Load 827 + 829: 51(ivec2) VectorShuffle 828 828 0 1 + 830: 51(ivec2) GroupNonUniformBitwiseXor 35 Reduce 829 + 831: 32(ptr) AccessChain 24(data) 25 824 25 + 832: 13(ivec4) Load 831 + 833: 13(ivec4) VectorShuffle 832 830 4 5 2 3 + Store 831 833 + 834: 27(ptr) AccessChain 10(dti) 26 + 835: 6(int) Load 834 + 836: 27(ptr) AccessChain 10(dti) 26 + 837: 6(int) Load 836 + 838: 32(ptr) AccessChain 24(data) 25 837 25 + 839: 13(ivec4) Load 838 + 840: 7(ivec3) VectorShuffle 839 839 0 1 2 + 841: 7(ivec3) GroupNonUniformBitwiseXor 35 Reduce 840 + 842: 32(ptr) AccessChain 24(data) 25 835 25 + 843: 13(ivec4) Load 842 + 844: 13(ivec4) VectorShuffle 843 841 4 5 6 3 + Store 842 844 + 845: 27(ptr) AccessChain 10(dti) 26 + 846: 6(int) Load 845 + 847: 27(ptr) AccessChain 10(dti) 26 + 848: 6(int) Load 847 + 849: 75(ptr) AccessChain 24(data) 25 848 72 + 850: 15(ivec4) Load 849 + 851: 15(ivec4) GroupNonUniformBitwiseXor 35 Reduce 850 + 852: 75(ptr) AccessChain 24(data) 25 846 72 + Store 852 851 + 853: 27(ptr) AccessChain 10(dti) 26 + 854: 6(int) Load 853 + 855: 27(ptr) AccessChain 10(dti) 26 + 856: 6(int) Load 855 + 857: 84(ptr) AccessChain 24(data) 25 856 72 26 + 858: 14(int) Load 857 + 859: 14(int) GroupNonUniformBitwiseXor 35 Reduce 858 + 860: 84(ptr) AccessChain 24(data) 25 854 72 26 + Store 860 859 + 861: 27(ptr) AccessChain 10(dti) 26 + 862: 6(int) Load 861 + 863: 27(ptr) AccessChain 10(dti) 26 + 864: 6(int) Load 863 + 865: 75(ptr) AccessChain 24(data) 25 864 72 + 866: 15(ivec4) Load 865 + 867: 93(ivec2) VectorShuffle 866 866 0 1 + 868: 93(ivec2) GroupNonUniformBitwiseXor 35 Reduce 867 + 869: 75(ptr) AccessChain 24(data) 25 862 72 + 870: 15(ivec4) Load 869 + 871: 15(ivec4) VectorShuffle 870 868 4 5 2 3 + Store 869 871 + 872: 27(ptr) AccessChain 10(dti) 26 + 873: 6(int) Load 872 + 874: 27(ptr) AccessChain 10(dti) 26 + 875: 6(int) Load 874 + 876: 75(ptr) AccessChain 24(data) 25 875 72 + 877: 15(ivec4) Load 876 + 878: 105(ivec3) VectorShuffle 877 877 0 1 2 + 879: 105(ivec3) GroupNonUniformBitwiseXor 35 Reduce 878 + 880: 75(ptr) AccessChain 24(data) 25 873 72 + 881: 15(ivec4) Load 880 + 882: 15(ivec4) VectorShuffle 881 879 4 5 6 3 + Store 880 882 + 883: 27(ptr) AccessChain 10(dti) 26 + 884: 6(int) Load 883 + 885: 27(ptr) AccessChain 10(dti) 26 + 886: 6(int) Load 885 + 887: 42(ptr) AccessChain 24(data) 25 886 25 26 + 888: 6(int) Load 887 + 890: 889(bool) IEqual 888 26 + 891: 13(ivec4) GroupNonUniformBallot 35 890 + 892: 6(int) GroupNonUniformBallotBitCount 35 Reduce 891 + 893: 42(ptr) AccessChain 24(data) 25 884 25 26 + Store 893 892 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.wavevote.comp.out b/deps/glslang/Test/baseResults/hlsl.wavevote.comp.out new file mode 100644 index 00000000..04f2f984 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.wavevote.comp.out @@ -0,0 +1,316 @@ +hlsl.wavevote.comp +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:5 Function Definition: @CSMain(vu3; ( temp void) +0:5 Function Parameters: +0:5 'dti' ( in 3-component vector of uint) +0:? Sequence +0:6 move second child to first child ( temp uint64_t) +0:6 indirect index (layout( row_major std430) buffer uint64_t) +0:6 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint64_t) +0:6 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint64_t @data}) +0:6 Constant: +0:6 0 (const uint) +0:6 direct index ( temp uint) +0:6 'dti' ( in 3-component vector of uint) +0:6 Constant: +0:6 0 (const int) +0:6 Construct uint64 (layout( row_major std430) buffer uint64_t) +0:6 Convert uint to uint64 ( temp 4-component vector of uint64_t) +0:6 subgroupBallot ( temp 4-component vector of uint) +0:6 subgroupAny ( temp bool) +0:6 Compare Equal ( temp bool) +0:6 direct index ( temp uint) +0:6 'dti' ( in 3-component vector of uint) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0 (const uint) +0:7 move second child to first child ( temp uint64_t) +0:7 indirect index (layout( row_major std430) buffer uint64_t) +0:7 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint64_t) +0:7 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint64_t @data}) +0:7 Constant: +0:7 0 (const uint) +0:7 direct index ( temp uint) +0:7 'dti' ( in 3-component vector of uint) +0:7 Constant: +0:7 1 (const int) +0:7 Construct uint64 (layout( row_major std430) buffer uint64_t) +0:7 Convert uint to uint64 ( temp 4-component vector of uint64_t) +0:7 subgroupBallot ( temp 4-component vector of uint) +0:7 subgroupAll ( temp bool) +0:7 Compare Equal ( temp bool) +0:7 direct index ( temp uint) +0:7 'dti' ( in 3-component vector of uint) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const uint) +0:8 move second child to first child ( temp uint64_t) +0:8 indirect index (layout( row_major std430) buffer uint64_t) +0:8 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint64_t) +0:8 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint64_t @data}) +0:8 Constant: +0:8 0 (const uint) +0:8 direct index ( temp uint) +0:8 'dti' ( in 3-component vector of uint) +0:8 Constant: +0:8 2 (const int) +0:8 Construct uint64 (layout( row_major std430) buffer uint64_t) +0:8 Convert uint to uint64 ( temp 4-component vector of uint64_t) +0:8 subgroupBallot ( temp 4-component vector of uint) +0:8 subgroupAllEqual ( temp bool) +0:8 Compare Equal ( temp bool) +0:8 direct index ( temp uint) +0:8 'dti' ( in 3-component vector of uint) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 0 (const uint) +0:9 move second child to first child ( temp uint64_t) +0:9 indirect index (layout( row_major std430) buffer uint64_t) +0:9 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint64_t) +0:9 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint64_t @data}) +0:9 Constant: +0:9 0 (const uint) +0:9 direct index ( temp uint) +0:9 'dti' ( in 3-component vector of uint) +0:9 Constant: +0:9 2 (const int) +0:9 Construct uint64 (layout( row_major std430) buffer uint64_t) +0:9 Convert uint to uint64 ( temp 4-component vector of uint64_t) +0:9 subgroupBallot ( temp 4-component vector of uint) +0:9 subgroupAllEqual ( temp bool) +0:9 direct index ( temp uint) +0:9 'dti' ( in 3-component vector of uint) +0:9 Constant: +0:9 2 (const int) +0:5 Function Definition: CSMain( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 3-component vector of uint) +0:? 'dti' ( temp 3-component vector of uint) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) +0:5 Function Call: @CSMain(vu3; ( temp void) +0:? 'dti' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint64_t @data}) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (32, 16, 1) +0:? Sequence +0:5 Function Definition: @CSMain(vu3; ( temp void) +0:5 Function Parameters: +0:5 'dti' ( in 3-component vector of uint) +0:? Sequence +0:6 move second child to first child ( temp uint64_t) +0:6 indirect index (layout( row_major std430) buffer uint64_t) +0:6 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint64_t) +0:6 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint64_t @data}) +0:6 Constant: +0:6 0 (const uint) +0:6 direct index ( temp uint) +0:6 'dti' ( in 3-component vector of uint) +0:6 Constant: +0:6 0 (const int) +0:6 Construct uint64 (layout( row_major std430) buffer uint64_t) +0:6 Convert uint to uint64 ( temp 4-component vector of uint64_t) +0:6 subgroupBallot ( temp 4-component vector of uint) +0:6 subgroupAny ( temp bool) +0:6 Compare Equal ( temp bool) +0:6 direct index ( temp uint) +0:6 'dti' ( in 3-component vector of uint) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0 (const uint) +0:7 move second child to first child ( temp uint64_t) +0:7 indirect index (layout( row_major std430) buffer uint64_t) +0:7 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint64_t) +0:7 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint64_t @data}) +0:7 Constant: +0:7 0 (const uint) +0:7 direct index ( temp uint) +0:7 'dti' ( in 3-component vector of uint) +0:7 Constant: +0:7 1 (const int) +0:7 Construct uint64 (layout( row_major std430) buffer uint64_t) +0:7 Convert uint to uint64 ( temp 4-component vector of uint64_t) +0:7 subgroupBallot ( temp 4-component vector of uint) +0:7 subgroupAll ( temp bool) +0:7 Compare Equal ( temp bool) +0:7 direct index ( temp uint) +0:7 'dti' ( in 3-component vector of uint) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const uint) +0:8 move second child to first child ( temp uint64_t) +0:8 indirect index (layout( row_major std430) buffer uint64_t) +0:8 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint64_t) +0:8 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint64_t @data}) +0:8 Constant: +0:8 0 (const uint) +0:8 direct index ( temp uint) +0:8 'dti' ( in 3-component vector of uint) +0:8 Constant: +0:8 2 (const int) +0:8 Construct uint64 (layout( row_major std430) buffer uint64_t) +0:8 Convert uint to uint64 ( temp 4-component vector of uint64_t) +0:8 subgroupBallot ( temp 4-component vector of uint) +0:8 subgroupAllEqual ( temp bool) +0:8 Compare Equal ( temp bool) +0:8 direct index ( temp uint) +0:8 'dti' ( in 3-component vector of uint) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 0 (const uint) +0:9 move second child to first child ( temp uint64_t) +0:9 indirect index (layout( row_major std430) buffer uint64_t) +0:9 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint64_t) +0:9 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint64_t @data}) +0:9 Constant: +0:9 0 (const uint) +0:9 direct index ( temp uint) +0:9 'dti' ( in 3-component vector of uint) +0:9 Constant: +0:9 2 (const int) +0:9 Construct uint64 (layout( row_major std430) buffer uint64_t) +0:9 Convert uint to uint64 ( temp 4-component vector of uint64_t) +0:9 subgroupBallot ( temp 4-component vector of uint) +0:9 subgroupAllEqual ( temp bool) +0:9 direct index ( temp uint) +0:9 'dti' ( in 3-component vector of uint) +0:9 Constant: +0:9 2 (const int) +0:5 Function Definition: CSMain( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 3-component vector of uint) +0:? 'dti' ( temp 3-component vector of uint) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) +0:5 Function Call: @CSMain(vu3; ( temp void) +0:? 'dti' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint64_t @data}) +0:? 'dti' ( in 3-component vector of uint GlobalInvocationID) + +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 75 + + Capability Shader + Capability Int64 + Capability GroupNonUniform + Capability GroupNonUniformVote + Capability GroupNonUniformBallot + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "CSMain" 70 + ExecutionMode 4 LocalSize 32 16 1 + Source HLSL 500 + Name 4 "CSMain" + Name 11 "@CSMain(vu3;" + Name 10 "dti" + Name 15 "data" + MemberName 15(data) 0 "@data" + Name 17 "data" + Name 68 "dti" + Name 70 "dti" + Name 72 "param" + Decorate 14 ArrayStride 8 + MemberDecorate 15(data) 0 Offset 0 + Decorate 15(data) BufferBlock + Decorate 17(data) DescriptorSet 0 + Decorate 70(dti) BuiltIn GlobalInvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 9: TypeFunction 2 8(ptr) + 13: TypeInt 64 0 + 14: TypeRuntimeArray 13(int64_t) + 15(data): TypeStruct 14 + 16: TypePointer Uniform 15(data) + 17(data): 16(ptr) Variable Uniform + 18: TypeInt 32 1 + 19: 18(int) Constant 0 + 20: 6(int) Constant 0 + 21: TypePointer Function 6(int) + 26: TypeBool + 28: 6(int) Constant 3 + 30: TypeVector 6(int) 4 + 32: TypeVector 13(int64_t) 4 + 35: TypePointer Uniform 13(int64_t) + 37: 6(int) Constant 1 + 48: 6(int) Constant 2 + 69: TypePointer Input 7(ivec3) + 70(dti): 69(ptr) Variable Input + 4(CSMain): 2 Function None 3 + 5: Label + 68(dti): 8(ptr) Variable Function + 72(param): 8(ptr) Variable Function + 71: 7(ivec3) Load 70(dti) + Store 68(dti) 71 + 73: 7(ivec3) Load 68(dti) + Store 72(param) 73 + 74: 2 FunctionCall 11(@CSMain(vu3;) 72(param) + Return + FunctionEnd +11(@CSMain(vu3;): 2 Function None 9 + 10(dti): 8(ptr) FunctionParameter + 12: Label + 22: 21(ptr) AccessChain 10(dti) 20 + 23: 6(int) Load 22 + 24: 21(ptr) AccessChain 10(dti) 20 + 25: 6(int) Load 24 + 27: 26(bool) IEqual 25 20 + 29: 26(bool) GroupNonUniformAny 28 27 + 31: 30(ivec4) GroupNonUniformBallot 28 29 + 33: 32(i64vec4) UConvert 31 + 34: 13(int64_t) CompositeExtract 33 0 + 36: 35(ptr) AccessChain 17(data) 19 23 + Store 36 34 + 38: 21(ptr) AccessChain 10(dti) 37 + 39: 6(int) Load 38 + 40: 21(ptr) AccessChain 10(dti) 37 + 41: 6(int) Load 40 + 42: 26(bool) IEqual 41 20 + 43: 26(bool) GroupNonUniformAll 28 42 + 44: 30(ivec4) GroupNonUniformBallot 28 43 + 45: 32(i64vec4) UConvert 44 + 46: 13(int64_t) CompositeExtract 45 0 + 47: 35(ptr) AccessChain 17(data) 19 39 + Store 47 46 + 49: 21(ptr) AccessChain 10(dti) 48 + 50: 6(int) Load 49 + 51: 21(ptr) AccessChain 10(dti) 48 + 52: 6(int) Load 51 + 53: 26(bool) IEqual 52 20 + 54: 26(bool) GroupNonUniformAllEqual 28 53 + 55: 30(ivec4) GroupNonUniformBallot 28 54 + 56: 32(i64vec4) UConvert 55 + 57: 13(int64_t) CompositeExtract 56 0 + 58: 35(ptr) AccessChain 17(data) 19 50 + Store 58 57 + 59: 21(ptr) AccessChain 10(dti) 48 + 60: 6(int) Load 59 + 61: 21(ptr) AccessChain 10(dti) 48 + 62: 6(int) Load 61 + 63: 26(bool) GroupNonUniformAllEqual 28 62 + 64: 30(ivec4) GroupNonUniformBallot 28 63 + 65: 32(i64vec4) UConvert 64 + 66: 13(int64_t) CompositeExtract 65 0 + 67: 35(ptr) AccessChain 17(data) 19 60 + Store 67 66 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.whileLoop.frag.out b/deps/glslang/Test/baseResults/hlsl.whileLoop.frag.out new file mode 100644 index 00000000..babc77df --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.whileLoop.frag.out @@ -0,0 +1,196 @@ +hlsl.whileLoop.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' ( in 4-component vector of float) +0:? Sequence +0:3 Loop with condition tested first +0:3 Loop Condition +0:3 any ( temp bool) +0:3 NotEqual ( temp 4-component vector of bool) +0:3 'input' ( in 4-component vector of float) +0:3 'input' ( in 4-component vector of float) +0:3 Loop Body +0:? Sequence +0:3 Branch: Return with expression +0:3 'input' ( in 4-component vector of float) +0:4 Loop with condition tested first +0:4 Loop Condition +0:4 Constant: +0:4 false (const bool) +0:4 No loop body +0:5 Loop with condition tested first: Unroll +0:5 Loop Condition +0:5 Constant: +0:5 false (const bool) +0:5 No loop body +0:6 Loop with condition tested first +0:6 Loop Condition +0:6 Constant: +0:6 false (const bool) +0:6 No loop body +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:2 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' ( in 4-component vector of float) +0:? Sequence +0:3 Loop with condition tested first +0:3 Loop Condition +0:3 any ( temp bool) +0:3 NotEqual ( temp 4-component vector of bool) +0:3 'input' ( in 4-component vector of float) +0:3 'input' ( in 4-component vector of float) +0:3 Loop Body +0:? Sequence +0:3 Branch: Return with expression +0:3 'input' ( in 4-component vector of float) +0:4 Loop with condition tested first +0:4 Loop Condition +0:4 Constant: +0:4 false (const bool) +0:4 No loop body +0:5 Loop with condition tested first: Unroll +0:5 Loop Condition +0:5 Constant: +0:5 false (const bool) +0:5 No loop body +0:6 Loop with condition tested first +0:6 Loop Condition +0:6 Constant: +0:6 false (const bool) +0:6 No loop body +0:2 Function Definition: PixelShaderFunction( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) +0:2 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:2 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float) +0:? 'input' ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'input' (layout( location=0) in 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 52 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" 45 48 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "PixelShaderFunction" + Name 11 "@PixelShaderFunction(vf4;" + Name 10 "input" + Name 43 "input" + Name 45 "input" + Name 48 "@entryPointOutput" + Name 49 "param" + Decorate 45(input) Location 0 + Decorate 48(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) + 20: TypeBool + 21: TypeVector 20(bool) 4 + 31: 20(bool) ConstantFalse + 44: TypePointer Input 7(fvec4) + 45(input): 44(ptr) Variable Input + 47: TypePointer Output 7(fvec4) +48(@entryPointOutput): 47(ptr) Variable Output +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 43(input): 8(ptr) Variable Function + 49(param): 8(ptr) Variable Function + 46: 7(fvec4) Load 45(input) + Store 43(input) 46 + 50: 7(fvec4) Load 43(input) + Store 49(param) 50 + 51: 7(fvec4) FunctionCall 11(@PixelShaderFunction(vf4;) 49(param) + Store 48(@entryPointOutput) 51 + Return + FunctionEnd +11(@PixelShaderFunction(vf4;): 7(fvec4) Function None 9 + 10(input): 8(ptr) FunctionParameter + 12: Label + Branch 13 + 13: Label + LoopMerge 15 16 None + Branch 17 + 17: Label + 18: 7(fvec4) Load 10(input) + 19: 7(fvec4) Load 10(input) + 22: 21(bvec4) FOrdNotEqual 18 19 + 23: 20(bool) Any 22 + BranchConditional 23 14 15 + 14: Label + 24: 7(fvec4) Load 10(input) + ReturnValue 24 + 16: Label + Branch 13 + 15: Label + Branch 26 + 26: Label + LoopMerge 28 29 None + Branch 30 + 30: Label + BranchConditional 31 27 28 + 27: Label + Branch 29 + 29: Label + Branch 26 + 28: Label + Branch 32 + 32: Label + LoopMerge 34 35 Unroll + Branch 36 + 36: Label + BranchConditional 31 33 34 + 33: Label + Branch 35 + 35: Label + Branch 32 + 34: Label + Branch 37 + 37: Label + LoopMerge 39 40 None + Branch 41 + 41: Label + BranchConditional 31 38 39 + 38: Label + Branch 40 + 40: Label + Branch 37 + 39: Label + 42: 7(fvec4) Undef + ReturnValue 42 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.y-negate-1.vert.out b/deps/glslang/Test/baseResults/hlsl.y-negate-1.vert.out new file mode 100644 index 00000000..257d56c7 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.y-negate-1.vert.out @@ -0,0 +1,130 @@ +hlsl.y-negate-1.vert +Shader version: 500 +0:? Sequence +0:7 Function Definition: @main( ( temp 4-component vector of float) +0:7 Function Parameters: +0:? Sequence +0:8 Branch: Return with expression +0:8 pos: direct index for structure ( uniform 4-component vector of float) +0:8 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos}) +0:8 Constant: +0:8 0 (const uint) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 '@position' ( temp 4-component vector of float) +0:7 Function Call: @main( ( temp 4-component vector of float) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 '@position' ( temp 4-component vector of float) +0:7 Constant: +0:7 1 (const int) +0:7 Negate value ( temp float) +0:7 direct index ( temp float) +0:7 '@position' ( temp 4-component vector of float) +0:7 Constant: +0:7 1 (const int) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:7 '@position' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos}) +0:? '@entryPointOutput' ( out 4-component vector of float Position) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:7 Function Definition: @main( ( temp 4-component vector of float) +0:7 Function Parameters: +0:? Sequence +0:8 Branch: Return with expression +0:8 pos: direct index for structure ( uniform 4-component vector of float) +0:8 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos}) +0:8 Constant: +0:8 0 (const uint) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 '@position' ( temp 4-component vector of float) +0:7 Function Call: @main( ( temp 4-component vector of float) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 '@position' ( temp 4-component vector of float) +0:7 Constant: +0:7 1 (const int) +0:7 Negate value ( temp float) +0:7 direct index ( temp float) +0:7 '@position' ( temp 4-component vector of float) +0:7 Constant: +0:7 1 (const int) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' ( out 4-component vector of float Position) +0:7 '@position' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos}) +0:? '@entryPointOutput' ( out 4-component vector of float Position) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 34 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 32 + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 11 "$Global" + MemberName 11($Global) 0 "pos" + Name 13 "" + Name 22 "@position" + Name 32 "@entryPointOutput" + MemberDecorate 11($Global) 0 Offset 0 + Decorate 11($Global) Block + Decorate 13 DescriptorSet 0 + Decorate 32(@entryPointOutput) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11($Global): TypeStruct 7(fvec4) + 12: TypePointer Uniform 11($Global) + 13: 12(ptr) Variable Uniform + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16: TypePointer Uniform 7(fvec4) + 21: TypePointer Function 7(fvec4) + 24: TypeInt 32 0 + 25: 24(int) Constant 1 + 26: TypePointer Function 6(float) + 31: TypePointer Output 7(fvec4) +32(@entryPointOutput): 31(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 22(@position): 21(ptr) Variable Function + 23: 7(fvec4) FunctionCall 9(@main() + Store 22(@position) 23 + 27: 26(ptr) AccessChain 22(@position) 25 + 28: 6(float) Load 27 + 29: 6(float) FNegate 28 + 30: 26(ptr) AccessChain 22(@position) 25 + Store 30 29 + 33: 7(fvec4) Load 22(@position) + Store 32(@entryPointOutput) 33 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 17: 16(ptr) AccessChain 13 15 + 18: 7(fvec4) Load 17 + ReturnValue 18 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.y-negate-2.vert.out b/deps/glslang/Test/baseResults/hlsl.y-negate-2.vert.out new file mode 100644 index 00000000..a234a2e9 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.y-negate-2.vert.out @@ -0,0 +1,148 @@ +hlsl.y-negate-2.vert +Shader version: 500 +0:? Sequence +0:6 Function Definition: @main(vf4; ( temp void) +0:6 Function Parameters: +0:6 'position' ( out 4-component vector of float) +0:? Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 'position' ( out 4-component vector of float) +0:7 pos: direct index for structure ( uniform 4-component vector of float) +0:7 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos}) +0:7 Constant: +0:7 0 (const uint) +0:6 Function Definition: main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:6 Function Call: @main(vf4; ( temp void) +0:? 'position' ( temp 4-component vector of float) +0:6 Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:6 '@position' ( temp 4-component vector of float) +0:? 'position' ( temp 4-component vector of float) +0:6 move second child to first child ( temp float) +0:6 direct index ( temp float) +0:6 '@position' ( temp 4-component vector of float) +0:6 Constant: +0:6 1 (const int) +0:6 Negate value ( temp float) +0:6 direct index ( temp float) +0:6 '@position' ( temp 4-component vector of float) +0:6 Constant: +0:6 1 (const int) +0:6 move second child to first child ( temp 4-component vector of float) +0:? 'position' ( out 4-component vector of float Position) +0:6 '@position' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos}) +0:? 'position' ( out 4-component vector of float Position) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:6 Function Definition: @main(vf4; ( temp void) +0:6 Function Parameters: +0:6 'position' ( out 4-component vector of float) +0:? Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 'position' ( out 4-component vector of float) +0:7 pos: direct index for structure ( uniform 4-component vector of float) +0:7 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos}) +0:7 Constant: +0:7 0 (const uint) +0:6 Function Definition: main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:6 Function Call: @main(vf4; ( temp void) +0:? 'position' ( temp 4-component vector of float) +0:6 Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:6 '@position' ( temp 4-component vector of float) +0:? 'position' ( temp 4-component vector of float) +0:6 move second child to first child ( temp float) +0:6 direct index ( temp float) +0:6 '@position' ( temp 4-component vector of float) +0:6 Constant: +0:6 1 (const int) +0:6 Negate value ( temp float) +0:6 direct index ( temp float) +0:6 '@position' ( temp 4-component vector of float) +0:6 Constant: +0:6 1 (const int) +0:6 move second child to first child ( temp 4-component vector of float) +0:? 'position' ( out 4-component vector of float Position) +0:6 '@position' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos}) +0:? 'position' ( out 4-component vector of float Position) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 37 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 35 + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vf4;" + Name 10 "position" + Name 13 "$Global" + MemberName 13($Global) 0 "pos" + Name 15 "" + Name 21 "position" + Name 22 "param" + Name 25 "@position" + Name 35 "position" + MemberDecorate 13($Global) 0 Offset 0 + Decorate 13($Global) Block + Decorate 15 DescriptorSet 0 + Decorate 35(position) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 2 8(ptr) + 13($Global): TypeStruct 7(fvec4) + 14: TypePointer Uniform 13($Global) + 15: 14(ptr) Variable Uniform + 16: TypeInt 32 1 + 17: 16(int) Constant 0 + 18: TypePointer Uniform 7(fvec4) + 27: TypeInt 32 0 + 28: 27(int) Constant 1 + 29: TypePointer Function 6(float) + 34: TypePointer Output 7(fvec4) + 35(position): 34(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 21(position): 8(ptr) Variable Function + 22(param): 8(ptr) Variable Function + 25(@position): 8(ptr) Variable Function + 23: 2 FunctionCall 11(@main(vf4;) 22(param) + 24: 7(fvec4) Load 22(param) + Store 21(position) 24 + 26: 7(fvec4) Load 21(position) + Store 25(@position) 26 + 30: 29(ptr) AccessChain 25(@position) 28 + 31: 6(float) Load 30 + 32: 6(float) FNegate 31 + 33: 29(ptr) AccessChain 25(@position) 28 + Store 33 32 + 36: 7(fvec4) Load 25(@position) + Store 35(position) 36 + Return + FunctionEnd + 11(@main(vf4;): 2 Function None 9 + 10(position): 8(ptr) FunctionParameter + 12: Label + 19: 18(ptr) AccessChain 15 17 + 20: 7(fvec4) Load 19 + Store 10(position) 20 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.y-negate-3.vert.out b/deps/glslang/Test/baseResults/hlsl.y-negate-3.vert.out new file mode 100644 index 00000000..34bf8f9b --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.y-negate-3.vert.out @@ -0,0 +1,211 @@ +hlsl.y-negate-3.vert +Shader version: 500 +0:? Sequence +0:11 Function Definition: @main( ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Function Parameters: +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 pos: direct index for structure ( temp 4-component vector of float) +0:14 'vsout' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:14 Constant: +0:14 0 (const int) +0:14 position: direct index for structure ( uniform 4-component vector of float) +0:14 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float position}) +0:14 Constant: +0:14 0 (const uint) +0:15 move second child to first child ( temp int) +0:15 somethingelse: direct index for structure ( temp int) +0:15 'vsout' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:15 Constant: +0:15 1 (const int) +0:15 Constant: +0:15 42 (const int) +0:17 Branch: Return with expression +0:17 'vsout' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Function Definition: main( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Function Call: @main( ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:11 '@position' ( temp 4-component vector of float) +0:11 pos: direct index for structure ( temp 4-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 '@position' ( temp 4-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 Negate value ( temp float) +0:11 direct index ( temp float) +0:11 '@position' ( temp 4-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.pos' ( out 4-component vector of float Position) +0:11 '@position' ( temp 4-component vector of float) +0:11 move second child to first child ( temp int) +0:? '@entryPointOutput.somethingelse' (layout( location=0) out int) +0:11 somethingelse: direct index for structure ( temp int) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Constant: +0:11 1 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float position}) +0:? '@entryPointOutput.pos' ( out 4-component vector of float Position) +0:? '@entryPointOutput.somethingelse' (layout( location=0) out int) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:11 Function Definition: @main( ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Function Parameters: +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 pos: direct index for structure ( temp 4-component vector of float) +0:14 'vsout' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:14 Constant: +0:14 0 (const int) +0:14 position: direct index for structure ( uniform 4-component vector of float) +0:14 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float position}) +0:14 Constant: +0:14 0 (const uint) +0:15 move second child to first child ( temp int) +0:15 somethingelse: direct index for structure ( temp int) +0:15 'vsout' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:15 Constant: +0:15 1 (const int) +0:15 Constant: +0:15 42 (const int) +0:17 Branch: Return with expression +0:17 'vsout' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Function Definition: main( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Function Call: @main( ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:11 '@position' ( temp 4-component vector of float) +0:11 pos: direct index for structure ( temp 4-component vector of float) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child ( temp float) +0:11 direct index ( temp float) +0:11 '@position' ( temp 4-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 Negate value ( temp float) +0:11 direct index ( temp float) +0:11 '@position' ( temp 4-component vector of float) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.pos' ( out 4-component vector of float Position) +0:11 '@position' ( temp 4-component vector of float) +0:11 move second child to first child ( temp int) +0:? '@entryPointOutput.somethingelse' (layout( location=0) out int) +0:11 somethingelse: direct index for structure ( temp int) +0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse}) +0:11 Constant: +0:11 1 (const int) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float position}) +0:? '@entryPointOutput.pos' ( out 4-component vector of float Position) +0:? '@entryPointOutput.somethingelse' (layout( location=0) out int) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 50 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 44 47 + Source HLSL 500 + Name 4 "main" + Name 9 "VS_OUT" + MemberName 9(VS_OUT) 0 "pos" + MemberName 9(VS_OUT) 1 "somethingelse" + Name 11 "@main(" + Name 14 "vsout" + Name 16 "$Global" + MemberName 16($Global) 0 "position" + Name 18 "" + Name 31 "flattenTemp" + Name 33 "@position" + Name 44 "@entryPointOutput.pos" + Name 47 "@entryPointOutput.somethingelse" + MemberDecorate 16($Global) 0 Offset 0 + Decorate 16($Global) Block + Decorate 18 DescriptorSet 0 + Decorate 44(@entryPointOutput.pos) BuiltIn Position + Decorate 47(@entryPointOutput.somethingelse) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 1 + 9(VS_OUT): TypeStruct 7(fvec4) 8(int) + 10: TypeFunction 9(VS_OUT) + 13: TypePointer Function 9(VS_OUT) + 15: 8(int) Constant 0 + 16($Global): TypeStruct 7(fvec4) + 17: TypePointer Uniform 16($Global) + 18: 17(ptr) Variable Uniform + 19: TypePointer Uniform 7(fvec4) + 22: TypePointer Function 7(fvec4) + 24: 8(int) Constant 1 + 25: 8(int) Constant 42 + 26: TypePointer Function 8(int) + 36: TypeInt 32 0 + 37: 36(int) Constant 1 + 38: TypePointer Function 6(float) + 43: TypePointer Output 7(fvec4) +44(@entryPointOutput.pos): 43(ptr) Variable Output + 46: TypePointer Output 8(int) +47(@entryPointOutput.somethingelse): 46(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 31(flattenTemp): 13(ptr) Variable Function + 33(@position): 22(ptr) Variable Function + 32: 9(VS_OUT) FunctionCall 11(@main() + Store 31(flattenTemp) 32 + 34: 22(ptr) AccessChain 31(flattenTemp) 15 + 35: 7(fvec4) Load 34 + Store 33(@position) 35 + 39: 38(ptr) AccessChain 33(@position) 37 + 40: 6(float) Load 39 + 41: 6(float) FNegate 40 + 42: 38(ptr) AccessChain 33(@position) 37 + Store 42 41 + 45: 7(fvec4) Load 33(@position) + Store 44(@entryPointOutput.pos) 45 + 48: 26(ptr) AccessChain 31(flattenTemp) 24 + 49: 8(int) Load 48 + Store 47(@entryPointOutput.somethingelse) 49 + Return + FunctionEnd + 11(@main(): 9(VS_OUT) Function None 10 + 12: Label + 14(vsout): 13(ptr) Variable Function + 20: 19(ptr) AccessChain 18 15 + 21: 7(fvec4) Load 20 + 23: 22(ptr) AccessChain 14(vsout) 15 + Store 23 21 + 27: 26(ptr) AccessChain 14(vsout) 24 + Store 27 25 + 28: 9(VS_OUT) Load 14(vsout) + ReturnValue 28 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/implicitInnerAtomicUint.frag.out b/deps/glslang/Test/baseResults/implicitInnerAtomicUint.frag.out new file mode 100644 index 00000000..ed9771e7 --- /dev/null +++ b/deps/glslang/Test/baseResults/implicitInnerAtomicUint.frag.out @@ -0,0 +1,20 @@ +implicitInnerAtomicUint.frag +ERROR: 0:2: '[]' : only outermost dimension of an array of arrays can be implicitly sized +ERROR: 1 compilation errors. No code generated. + + +Shader version: 460 +ERROR: node is still EOpNull! +0:? Linker Objects +0:? 'c' (layout( binding=0 offset=0) uniform 1-element array of 1-element array of atomic_uint) + + +Linked fragment stage: + +ERROR: Linking fragment stage: Missing entry point: Each stage requires one entry point + +Shader version: 460 +ERROR: node is still EOpNull! +0:? Linker Objects +0:? 'c' (layout( binding=0 offset=0) uniform 1-element array of 1-element array of atomic_uint) + diff --git a/deps/glslang/Test/baseResults/include.vert.out b/deps/glslang/Test/baseResults/include.vert.out new file mode 100644 index 00000000..42f10323 --- /dev/null +++ b/deps/glslang/Test/baseResults/include.vert.out @@ -0,0 +1,67 @@ +include.vert +Shader version: 450 +Requested GL_GOOGLE_cpp_style_line_directive +Requested GL_GOOGLE_include_directive +0:? Sequence +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:15 Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:15 'color' ( smooth out 4-component vector of float) +0:15 add ( temp 4-component vector of float) +0:15 add ( temp 4-component vector of float) +0:15 add ( temp 4-component vector of float) +0:15 add ( temp 4-component vector of float) +0:15 add ( temp 4-component vector of float) +0:15 'i1' ( global 4-component vector of float) +0:15 'i2' ( global 4-component vector of float) +0:15 'i3' ( global 4-component vector of float) +0:15 'i4' ( global 4-component vector of float) +0:15 'i5' ( global 4-component vector of float) +0:15 'i6' ( global 4-component vector of float) +0:? Linker Objects +0:? 'i1' ( global 4-component vector of float) +0:? 'i2' ( global 4-component vector of float) +0:? 'i4' ( global 4-component vector of float) +0:? 'i3' ( global 4-component vector of float) +0:? 'i6' ( global 4-component vector of float) +0:? 'i5' ( global 4-component vector of float) +0:? 'color' ( smooth out 4-component vector of float) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 450 +Requested GL_GOOGLE_cpp_style_line_directive +Requested GL_GOOGLE_include_directive +0:? Sequence +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:15 Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:15 'color' ( smooth out 4-component vector of float) +0:15 add ( temp 4-component vector of float) +0:15 add ( temp 4-component vector of float) +0:15 add ( temp 4-component vector of float) +0:15 add ( temp 4-component vector of float) +0:15 add ( temp 4-component vector of float) +0:15 'i1' ( global 4-component vector of float) +0:15 'i2' ( global 4-component vector of float) +0:15 'i3' ( global 4-component vector of float) +0:15 'i4' ( global 4-component vector of float) +0:15 'i5' ( global 4-component vector of float) +0:15 'i6' ( global 4-component vector of float) +0:? Linker Objects +0:? 'i1' ( global 4-component vector of float) +0:? 'i2' ( global 4-component vector of float) +0:? 'i4' ( global 4-component vector of float) +0:? 'i3' ( global 4-component vector of float) +0:? 'i6' ( global 4-component vector of float) +0:? 'i5' ( global 4-component vector of float) +0:? 'color' ( smooth out 4-component vector of float) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/invalidSwizzle.vert.out b/deps/glslang/Test/baseResults/invalidSwizzle.vert.out new file mode 100644 index 00000000..5104fdcd --- /dev/null +++ b/deps/glslang/Test/baseResults/invalidSwizzle.vert.out @@ -0,0 +1,38 @@ +invalidSwizzle.vert +ERROR: 0:7: 'rr' : does not apply to this type: uniform sampler2D +ERROR: 0:7: '=' : cannot convert from ' uniform sampler2D' to ' temp 2-component vector of float' +ERROR: 0:8: 'xx' : does not apply to this type: global void +ERROR: 0:9: 'xy' : does not apply to this type: global void +ERROR: 4 compilation errors. No code generated. + + +Shader version: 420 +ERROR: node is still EOpNull! +0:6 Function Definition: main( ( global void) +0:6 Function Parameters: +0:? Sequence +0:8 Function Call: f( ( global void) +0:9 Function Call: f( ( global void) +0:? Linker Objects +0:? 's' ( uniform sampler2D) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + +ERROR: Linking vertex stage: No function definition (body) found: + f( + +Shader version: 420 +ERROR: node is still EOpNull! +0:6 Function Definition: main( ( global void) +0:6 Function Parameters: +0:? Sequence +0:8 Function Call: f( ( global void) +0:9 Function Call: f( ( global void) +0:? Linker Objects +0:? 's' ( uniform sampler2D) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/length.frag.out b/deps/glslang/Test/baseResults/length.frag.out new file mode 100644 index 00000000..bfd5bf0e --- /dev/null +++ b/deps/glslang/Test/baseResults/length.frag.out @@ -0,0 +1,61 @@ +length.frag +Shader version: 120 +0:? Sequence +0:11 Function Definition: main( ( global void) +0:11 Function Parameters: +0:? Sequence +0:15 Sequence +0:15 move second child to first child ( temp 2-component vector of float) +0:15 't' ( temp 2-component vector of float) +0:15 add ( temp 2-component vector of float) +0:15 direct index ( smooth temp 2-component vector of float) +0:15 'v' ( smooth in 2-element array of 2-component vector of float) +0:15 Constant: +0:15 0 (const int) +0:15 direct index ( smooth temp 2-component vector of float) +0:15 'v' ( smooth in 2-element array of 2-component vector of float) +0:15 Constant: +0:15 1 (const int) +0:17 move second child to first child ( temp 4-component vector of float) +0:17 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:17 Constant: +0:17 30.000000 +0:17 30.000000 +0:17 30.000000 +0:17 30.000000 +0:? Linker Objects +0:? 'u' ( uniform 3-element array of 4-component vector of float) +0:? 'v' ( smooth in 2-element array of 2-component vector of float) + + +Linked fragment stage: + + +Shader version: 120 +0:? Sequence +0:11 Function Definition: main( ( global void) +0:11 Function Parameters: +0:? Sequence +0:15 Sequence +0:15 move second child to first child ( temp 2-component vector of float) +0:15 't' ( temp 2-component vector of float) +0:15 add ( temp 2-component vector of float) +0:15 direct index ( smooth temp 2-component vector of float) +0:15 'v' ( smooth in 2-element array of 2-component vector of float) +0:15 Constant: +0:15 0 (const int) +0:15 direct index ( smooth temp 2-component vector of float) +0:15 'v' ( smooth in 2-element array of 2-component vector of float) +0:15 Constant: +0:15 1 (const int) +0:17 move second child to first child ( temp 4-component vector of float) +0:17 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:17 Constant: +0:17 30.000000 +0:17 30.000000 +0:17 30.000000 +0:17 30.000000 +0:? Linker Objects +0:? 'u' ( uniform 3-element array of 4-component vector of float) +0:? 'v' ( smooth in 2-element array of 2-component vector of float) + diff --git a/deps/glslang/Test/baseResults/lineContinuation.vert.out b/deps/glslang/Test/baseResults/lineContinuation.vert.out new file mode 100644 index 00000000..9faa420b --- /dev/null +++ b/deps/glslang/Test/baseResults/lineContinuation.vert.out @@ -0,0 +1,280 @@ +lineContinuation.vert +WARNING: 0:3: 'line continuation' : used at end of comment; the following line is still part of the comment +ERROR: 0:6: '#error' : e1 +ERROR: 0:11: '#error' : e2 +ERROR: 0:18: '#error' : e3 +ERROR: 0:42: '\' : illegal use of escape character +ERROR: 0:43: '@' : unexpected token +ERROR: 0:44: '$' : unexpected token +ERROR: 0:45: '\' : illegal use of escape character +ERROR: 0:47: '\' : illegal use of escape character +ERROR: 0:48: '\' : illegal use of escape character +ERROR: 0:49: '$' : unexpected token +ERROR: 0:50: '@' : unexpected token +ERROR: 0:55: '#error' : good continuation +WARNING: 0:62: 'line continuation' : used at end of comment; the following line is still part of the comment +ERROR: 0:111: 'macro expansion' : End of line in macro substitution: FOOM +ERROR: 0:112: 'preprocessor evaluation' : can't evaluate expression +ERROR: 0:112: '#if' : unexpected tokens following directive +ERROR: 0:117: 'macro expansion' : End of line in macro substitution: FOOM +ERROR: 0:118: 'preprocessor evaluation' : can't evaluate expression +ERROR: 0:118: '#if' : unexpected tokens following directive +ERROR: 0:150: '' : syntax error, unexpected EQUAL +ERROR: 19 compilation errors. No code generated. + + +Shader version: 300 +ERROR: node is still EOpNull! +0:20 Function Definition: main( ( global void) +0:20 Function Parameters: +0:20 Sequence +0:20 move second child to first child ( temp highp 4-component vector of float) +0:20 'gl_Position' ( gl_Position highp 4-component vector of float Position) +0:20 Construct vec4 ( temp highp 4-component vector of float) +0:20 'foo' ( global highp float) +0:22 Function Definition: foo2(vf4; ( global highp 4-component vector of float) +0:22 Function Parameters: +0:22 'a' ( in highp 4-component vector of float) +0:24 Sequence +0:24 Sequence +0:24 move second child to first child ( temp highp 4-component vector of float) +0:24 'b' ( temp highp 4-component vector of float) +0:24 'a' ( in highp 4-component vector of float) +0:25 Branch: Return with expression +0:25 'b' ( temp highp 4-component vector of float) +0:47 Sequence +0:47 move second child to first child ( temp highp int) +0:47 'q1' ( global highp int) +0:47 Constant: +0:47 1 (const int) +0:48 Sequence +0:48 move second child to first child ( temp highp int) +0:48 'q2' ( global highp int) +0:48 Constant: +0:48 1 (const int) +0:49 Sequence +0:49 move second child to first child ( temp highp int) +0:49 'q3' ( global highp int) +0:49 Constant: +0:49 1 (const int) +0:50 Sequence +0:50 move second child to first child ( temp highp int) +0:50 'q4' ( global highp int) +0:50 Constant: +0:50 1 (const int) +0:74 Sequence +0:74 move second child to first child ( temp highp float) +0:74 'funkyf' ( global highp float) +0:75 Constant: +0:75 1.2300000000000e+16 +0:85 Sequence +0:84 move second child to first child ( temp highp int) +0:84 'funkyh' ( global highp int) +0:86 Constant: +0:86 244 (const int) +0:91 Sequence +0:91 move second child to first child ( temp highp int) +0:91 'funkyo' ( global highp int) +0:92 Constant: +0:92 34 (const int) +0:96 Sequence +0:96 move second child to first child ( temp highp int) +0:96 'c' ( global highp int) +0:97 Constant: +0:97 11 (const int) +0:98 Sequence +0:98 move second child to first child ( temp highp int) +0:98 'd' ( global highp int) +0:98 Constant: +0:98 12 (const int) +0:107 Sequence +0:107 move second child to first child ( temp highp int) +0:107 'bar103' ( global highp int) +0:107 Constant: +0:107 17 (const int) +0:113 Sequence +0:113 move second child to first child ( temp highp int) +0:113 'bar104' ( global highp int) +0:113 Constant: +0:113 19 (const int) +0:119 Sequence +0:119 move second child to first child ( temp highp int) +0:119 'bar105' ( global highp int) +0:119 Constant: +0:119 19 (const int) +0:122 Sequence +0:122 move second child to first child ( temp highp int) +0:122 'bar106' ( global highp int) +0:122 Constant: +0:122 12 (const int) +0:123 Sequence +0:123 move second child to first child ( temp highp int) +0:123 'bar107' ( global highp int) +0:128 Constant: +0:128 5 (const int) +0:131 Function Definition: foo203209409( ( global void) +0:131 Function Parameters: +0:134 Sequence +0:134 add second child into first child ( temp highp int) +0:133 'bar107' ( global highp int) +0:134 Constant: +0:134 37 (const int) +0:135 multiply second child into first child ( temp highp int) +0:135 'bar107' ( global highp int) +0:136 Constant: +0:136 38 (const int) +0:137 divide second child into first child ( temp highp int) +0:137 'bar107' ( global highp int) +0:138 Constant: +0:138 39 (const int) +0:139 add ( temp highp int) +0:139 'bar107' ( global highp int) +0:140 Constant: +0:140 41 (const int) +0:? Linker Objects +0:? 'foo' ( global highp float) +0:? 'goodDecl' ( global highp int) +0:? 'a1' ( const highp int) +0:? 4 (const int) +0:? 'a2' ( const highp int) +0:? 3 (const int) +0:? 'a3' ( const highp int) +0:? 4 (const int) +0:? 'a4' ( const highp int) +0:? 3 (const int) +0:? 'q1' ( global highp int) +0:? 'q2' ( global highp int) +0:? 'q3' ( global highp int) +0:? 'q4' ( global highp int) +0:? 'abdece' ( const highp int) +0:? 10 (const int) +0:? 'aoeuntaoehu' ( const highp int) +0:? 10 (const int) +0:? 'funkyf' ( global highp float) +0:? 'funkyh' ( global highp int) +0:? 'funkyo' ( global highp int) +0:? 'c' ( global highp int) +0:? 'd' ( global highp int) +0:? 'bar103' ( global highp int) +0:? 'bar104' ( global highp int) +0:? 'bar105' ( global highp int) +0:? 'bar106' ( global highp int) +0:? 'bar107' ( global highp int) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + + +Linked vertex stage: + + +Shader version: 300 +ERROR: node is still EOpNull! +0:20 Function Definition: main( ( global void) +0:20 Function Parameters: +0:20 Sequence +0:20 move second child to first child ( temp highp 4-component vector of float) +0:20 'gl_Position' ( gl_Position highp 4-component vector of float Position) +0:20 Construct vec4 ( temp highp 4-component vector of float) +0:20 'foo' ( global highp float) +0:47 Sequence +0:47 move second child to first child ( temp highp int) +0:47 'q1' ( global highp int) +0:47 Constant: +0:47 1 (const int) +0:48 Sequence +0:48 move second child to first child ( temp highp int) +0:48 'q2' ( global highp int) +0:48 Constant: +0:48 1 (const int) +0:49 Sequence +0:49 move second child to first child ( temp highp int) +0:49 'q3' ( global highp int) +0:49 Constant: +0:49 1 (const int) +0:50 Sequence +0:50 move second child to first child ( temp highp int) +0:50 'q4' ( global highp int) +0:50 Constant: +0:50 1 (const int) +0:74 Sequence +0:74 move second child to first child ( temp highp float) +0:74 'funkyf' ( global highp float) +0:75 Constant: +0:75 1.2300000000000e+16 +0:85 Sequence +0:84 move second child to first child ( temp highp int) +0:84 'funkyh' ( global highp int) +0:86 Constant: +0:86 244 (const int) +0:91 Sequence +0:91 move second child to first child ( temp highp int) +0:91 'funkyo' ( global highp int) +0:92 Constant: +0:92 34 (const int) +0:96 Sequence +0:96 move second child to first child ( temp highp int) +0:96 'c' ( global highp int) +0:97 Constant: +0:97 11 (const int) +0:98 Sequence +0:98 move second child to first child ( temp highp int) +0:98 'd' ( global highp int) +0:98 Constant: +0:98 12 (const int) +0:107 Sequence +0:107 move second child to first child ( temp highp int) +0:107 'bar103' ( global highp int) +0:107 Constant: +0:107 17 (const int) +0:113 Sequence +0:113 move second child to first child ( temp highp int) +0:113 'bar104' ( global highp int) +0:113 Constant: +0:113 19 (const int) +0:119 Sequence +0:119 move second child to first child ( temp highp int) +0:119 'bar105' ( global highp int) +0:119 Constant: +0:119 19 (const int) +0:122 Sequence +0:122 move second child to first child ( temp highp int) +0:122 'bar106' ( global highp int) +0:122 Constant: +0:122 12 (const int) +0:123 Sequence +0:123 move second child to first child ( temp highp int) +0:123 'bar107' ( global highp int) +0:128 Constant: +0:128 5 (const int) +0:? Linker Objects +0:? 'foo' ( global highp float) +0:? 'goodDecl' ( global highp int) +0:? 'a1' ( const highp int) +0:? 4 (const int) +0:? 'a2' ( const highp int) +0:? 3 (const int) +0:? 'a3' ( const highp int) +0:? 4 (const int) +0:? 'a4' ( const highp int) +0:? 3 (const int) +0:? 'q1' ( global highp int) +0:? 'q2' ( global highp int) +0:? 'q3' ( global highp int) +0:? 'q4' ( global highp int) +0:? 'abdece' ( const highp int) +0:? 10 (const int) +0:? 'aoeuntaoehu' ( const highp int) +0:? 10 (const int) +0:? 'funkyf' ( global highp float) +0:? 'funkyh' ( global highp int) +0:? 'funkyo' ( global highp int) +0:? 'c' ( global highp int) +0:? 'd' ( global highp int) +0:? 'bar103' ( global highp int) +0:? 'bar104' ( global highp int) +0:? 'bar105' ( global highp int) +0:? 'bar106' ( global highp int) +0:? 'bar107' ( global highp int) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + diff --git a/deps/glslang/Test/baseResults/lineContinuation100.vert.out b/deps/glslang/Test/baseResults/lineContinuation100.vert.out new file mode 100644 index 00000000..c86b52bf --- /dev/null +++ b/deps/glslang/Test/baseResults/lineContinuation100.vert.out @@ -0,0 +1,127 @@ +lineContinuation100.vert +WARNING: 0:3: 'line continuation' : used at end of comment, but this version does not provide line continuation +ERROR: 0:4: '#error' : good error +ERROR: 0:8: 'line continuation' : not supported for this version or the enabled extensions +ERROR: 0:11: '#error' : e2 +ERROR: 0:13: 'line continuation' : not supported for this version or the enabled extensions +ERROR: 0:14: 'line continuation' : not supported for this version or the enabled extensions +ERROR: 0:15: 'line continuation' : not supported for this version or the enabled extensions +ERROR: 0:18: '#error' : e3 +ERROR: 0:24: 'line continuation' : not supported for this version or the enabled extensions +ERROR: 0:40: '\' : illegal use of escape character +ERROR: 0:41: '@' : unexpected token +ERROR: 0:42: '$' : unexpected token +ERROR: 0:43: '\' : illegal use of escape character +ERROR: 0:45: '\' : illegal use of escape character +ERROR: 0:46: '\' : illegal use of escape character +ERROR: 0:47: '$' : unexpected token +ERROR: 0:48: '@' : unexpected token +ERROR: 0:50: 'line continuation' : not supported for this version or the enabled extensions +ERROR: 0:52: 'line continuation' : not supported for this version or the enabled extensions +ERROR: 0:53: '#error' : bad continuation +ERROR: 0:55: 'line continuation' : not supported for this version or the enabled extensions +ERROR: 20 compilation errors. No code generated. + + +Shader version: 100 +ERROR: node is still EOpNull! +0:20 Function Definition: main( ( global void) +0:20 Function Parameters: +0:20 Sequence +0:20 move second child to first child ( temp highp 4-component vector of float) +0:20 'gl_Position' ( gl_Position highp 4-component vector of float Position) +0:20 Construct vec4 ( temp highp 4-component vector of float) +0:20 'foo' ( global highp float) +0:22 Function Definition: foo2(vf4; ( global highp 4-component vector of float) +0:22 Function Parameters: +0:22 'a' ( in highp 4-component vector of float) +0:24 Sequence +0:24 Sequence +0:24 move second child to first child ( temp highp 4-component vector of float) +0:24 'b' ( temp highp 4-component vector of float) +0:24 'a' ( in highp 4-component vector of float) +0:25 Branch: Return with expression +0:25 'b' ( temp highp 4-component vector of float) +0:45 Sequence +0:45 move second child to first child ( temp highp int) +0:45 'q1' ( global highp int) +0:45 Constant: +0:45 1 (const int) +0:46 Sequence +0:46 move second child to first child ( temp highp int) +0:46 'q2' ( global highp int) +0:46 Constant: +0:46 1 (const int) +0:47 Sequence +0:47 move second child to first child ( temp highp int) +0:47 'q3' ( global highp int) +0:47 Constant: +0:47 1 (const int) +0:48 Sequence +0:48 move second child to first child ( temp highp int) +0:48 'q4' ( global highp int) +0:48 Constant: +0:48 1 (const int) +0:? Linker Objects +0:? 'foo' ( global highp float) +0:? 'a1' ( const highp int) +0:? 4 (const int) +0:? 'a2' ( const highp int) +0:? 3 (const int) +0:? 'a3' ( const highp int) +0:? 4 (const int) +0:? 'a4' ( const highp int) +0:? 3 (const int) +0:? 'q1' ( global highp int) +0:? 'q2' ( global highp int) +0:? 'q3' ( global highp int) +0:? 'q4' ( global highp int) + + +Linked vertex stage: + + +Shader version: 100 +ERROR: node is still EOpNull! +0:20 Function Definition: main( ( global void) +0:20 Function Parameters: +0:20 Sequence +0:20 move second child to first child ( temp highp 4-component vector of float) +0:20 'gl_Position' ( gl_Position highp 4-component vector of float Position) +0:20 Construct vec4 ( temp highp 4-component vector of float) +0:20 'foo' ( global highp float) +0:45 Sequence +0:45 move second child to first child ( temp highp int) +0:45 'q1' ( global highp int) +0:45 Constant: +0:45 1 (const int) +0:46 Sequence +0:46 move second child to first child ( temp highp int) +0:46 'q2' ( global highp int) +0:46 Constant: +0:46 1 (const int) +0:47 Sequence +0:47 move second child to first child ( temp highp int) +0:47 'q3' ( global highp int) +0:47 Constant: +0:47 1 (const int) +0:48 Sequence +0:48 move second child to first child ( temp highp int) +0:48 'q4' ( global highp int) +0:48 Constant: +0:48 1 (const int) +0:? Linker Objects +0:? 'foo' ( global highp float) +0:? 'a1' ( const highp int) +0:? 4 (const int) +0:? 'a2' ( const highp int) +0:? 3 (const int) +0:? 'a3' ( const highp int) +0:? 4 (const int) +0:? 'a4' ( const highp int) +0:? 3 (const int) +0:? 'q1' ( global highp int) +0:? 'q2' ( global highp int) +0:? 'q3' ( global highp int) +0:? 'q4' ( global highp int) + diff --git a/deps/glslang/Test/baseResults/link1.frag.out b/deps/glslang/Test/baseResults/link1.frag.out new file mode 100644 index 00000000..2ea63ad5 --- /dev/null +++ b/deps/glslang/Test/baseResults/link1.frag.out @@ -0,0 +1,162 @@ +link1.frag +Shader version: 130 +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'a' ( global 4-component vector of float) +0:8 vector-scale ( temp 4-component vector of float) +0:8 Constant: +0:8 8.000000 +0:8 'uv4' ( uniform 4-component vector of float) +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:17 Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:17 'b' ( global 4-component vector of float) +0:17 vector-scale ( temp 4-component vector of float) +0:17 Constant: +0:17 8.000000 +0:17 'a' ( global 4-component vector of float) +0:19 Function Definition: foo(mf22; ( global 2-component vector of int) +0:19 Function Parameters: +0:19 'm' ( in 2X2 matrix of float) +0:21 Sequence +0:21 Branch: Return with expression +0:21 Convert float to int ( temp 2-component vector of int) +0:21 direct index ( temp 2-component vector of float) +0:21 'm' ( in 2X2 matrix of float) +0:21 Constant: +0:21 0 (const int) +0:24 Sequence +0:24 move second child to first child ( temp 4-component vector of float) +0:24 'c' ( global 4-component vector of float) +0:24 component-wise multiply ( temp 4-component vector of float) +0:24 'b' ( global 4-component vector of float) +0:24 'b' ( global 4-component vector of float) +0:? Linker Objects +0:? 'uv4' ( uniform 4-component vector of float) +0:? 'glass' ( uniform 3-component vector of float) +0:? 'ci' ( const int) +0:? 8 (const int) +0:? 'a' ( global 4-component vector of float) +0:? 'iv3' ( smooth in 3-component vector of float) +0:? 'cup' ( smooth in 4-component vector of float) +0:? 'b' ( global 4-component vector of float) +0:? 'c' ( global 4-component vector of float) +0:? 'cv3' ( const 3-component vector of float) +0:? 43.000000 +0:? 0.340000 +0:? 9.900000 +0:? 'cv3n' ( const 3-component vector of float) +0:? 43.000000 +0:? 0.340000 +0:? 9.900000 +0:? 'cv3e' ( const 3-component vector of float) +0:? 43.000000 +0:? 0.340000 +0:? 9.900000 +0:? 'um2' ( uniform 2X2 matrix of float) +0:? 4.000000 +0:? 0.000000 +0:? 0.000000 +0:? 4.000000 +0:? 'um2n' ( uniform 2X2 matrix of float) +0:? 4.000000 +0:? 0.000000 +0:? 0.000000 +0:? 4.000000 +0:? 'um2e' ( uniform 2X2 matrix of float) +0:? 4.000000 +0:? 0.000000 +0:? 0.000000 +0:? 4.000000 +0:? 's' ( uniform structure{ global int a, global float b}) +0:? 82 (const int) +0:? 3.900000 +0:? 'sn' ( uniform structure{ global int a, global float b}) +0:? 'se' ( uniform structure{ global int a, global float b}) +0:? 82 (const int) +0:? 3.900000 + +link2.frag +Shader version: 130 +Requested GL_OES_standard_derivatives +Requested GL_OES_texture_3D +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'd' ( global 4-component vector of float) +0:8 vector-scale ( temp 4-component vector of float) +0:8 Constant: +0:8 8.000000 +0:8 'uv4' ( uniform 4-component vector of float) +0:13 Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 'e' ( global 4-component vector of float) +0:13 vector-scale ( temp 4-component vector of float) +0:13 Constant: +0:13 8.000000 +0:13 'd' ( global 4-component vector of float) +0:15 Function Definition: foo( ( global 2-component vector of int) +0:15 Function Parameters: +0:17 Sequence +0:17 Branch: Return with expression +0:17 Constant: +0:17 2 (const int) +0:17 2 (const int) +0:20 Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:20 'f' ( global 4-component vector of float) +0:20 component-wise multiply ( temp 4-component vector of float) +0:20 'e' ( global 4-component vector of float) +0:20 'e' ( global 4-component vector of float) +0:? Linker Objects +0:? 'uv4' ( uniform 4-component vector of float) +0:? 'glass' ( uniform 2-component vector of float) +0:? 'ci' ( const int) +0:? 8 (const int) +0:? 'd' ( global 4-component vector of float) +0:? 'iv3' ( smooth in 3-component vector of float) +0:? 'cup' ( flat in 4-component vector of float) +0:? 'e' ( global 4-component vector of float) +0:? 'f' ( global 4-component vector of float) +0:? 'cv3' ( const 3-component vector of float) +0:? 43.000000 +0:? 0.340000 +0:? 9.900000 +0:? 'cv3e' ( const 3-component vector of float) +0:? 43.000000 +0:? 0.340000 +0:? 2.900000 +0:? 'um2' ( uniform 2X2 matrix of float) +0:? 4.000000 +0:? 0.000000 +0:? 0.000000 +0:? 4.000000 +0:? 'um2n' ( uniform 2X2 matrix of float) +0:? 'um2e' ( uniform 2X2 matrix of float) +0:? 3.000000 +0:? 0.000000 +0:? 0.000000 +0:? 3.000000 +0:? 's' ( uniform structure{ global int a, global float b}) +0:? 82 (const int) +0:? 3.900000 +0:? 'sn' ( uniform structure{ global int a, global float b}) +0:? 82 (const int) +0:? 3.900000 +0:? 'se' ( uniform structure{ global int a, global float b}) +0:? 81 (const int) +0:? 3.900000 + +link3.frag +Shader version: 300 +Requested GL_OES_EGL_image_external +Requested GL_OES_standard_derivatives +Requested GL_OES_texture_3D +0:? Sequence +0:? Linker Objects +0:? 'iv3' ( smooth in highp 2-component vector of float) + +ERROR: Cannot mix ES profile with non-ES profile shaders + diff --git a/deps/glslang/Test/baseResults/link1.vk.frag.out b/deps/glslang/Test/baseResults/link1.vk.frag.out new file mode 100644 index 00000000..333594e3 --- /dev/null +++ b/deps/glslang/Test/baseResults/link1.vk.frag.out @@ -0,0 +1,314 @@ +link1.vk.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:18 Sequence +0:18 move second child to first child ( temp highp 4-component vector of float) +0:18 'color' (layout( location=0) out highp 4-component vector of float) +0:18 Function Call: getColor( ( global highp 4-component vector of float) +0:20 move second child to first child ( temp highp int) +0:20 direct index ( temp highp int) +0:20 'a1' ( global unsized 9-element array of highp int) +0:20 Constant: +0:20 8 (const int) +0:20 Constant: +0:20 1 (const int) +0:21 move second child to first child ( temp highp int) +0:21 direct index ( temp highp int) +0:21 'a2' ( global unsized 2-element array of highp int) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 1 (const int) +0:22 move second child to first child ( temp highp int) +0:22 indirect index ( temp highp int) +0:22 'b' ( global 5-element array of highp int) +0:22 'i' ( global highp int) +0:22 Constant: +0:22 1 (const int) +0:23 move second child to first child ( temp highp int) +0:23 direct index ( temp highp int) +0:23 'c' ( global unsized 4-element array of highp int) +0:23 Constant: +0:23 3 (const int) +0:23 Constant: +0:23 1 (const int) +0:? Linker Objects +0:? 'color' (layout( location=0) out highp 4-component vector of float) +0:? 'a1' ( global unsized 9-element array of highp int) +0:? 'a2' ( global unsized 2-element array of highp int) +0:? 'b' ( global 5-element array of highp int) +0:? 'c' ( global unsized 4-element array of highp int) +0:? 'i' ( global highp int) +0:? 'anon@0' (layout( column_major std430) buffer block{layout( column_major std430) buffer unsized 1-element array of highp float r}) +0:? 'anon@1' (layout( column_major std430) buffer block{layout( column_major std430) buffer unsized 1-element array of highp float m}) + +link2.vk.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:14 Function Definition: getColor( ( global highp 4-component vector of float) +0:14 Function Parameters: +0:16 Sequence +0:16 move second child to first child ( temp highp int) +0:16 direct index ( temp highp int) +0:16 'a1' ( global unsized 3-element array of highp int) +0:16 Constant: +0:16 2 (const int) +0:16 Constant: +0:16 1 (const int) +0:17 move second child to first child ( temp highp int) +0:17 direct index ( temp highp int) +0:17 'a2' ( global unsized 10-element array of highp int) +0:17 Constant: +0:17 9 (const int) +0:17 Constant: +0:17 1 (const int) +0:18 move second child to first child ( temp highp int) +0:18 direct index ( temp highp int) +0:18 'b' ( global unsized 3-element array of highp int) +0:18 Constant: +0:18 2 (const int) +0:18 Constant: +0:18 1 (const int) +0:19 move second child to first child ( temp highp int) +0:19 direct index ( temp highp int) +0:19 'c' ( global 7-element array of highp int) +0:19 Constant: +0:19 3 (const int) +0:19 Constant: +0:19 1 (const int) +0:20 move second child to first child ( temp highp int) +0:20 indirect index ( temp highp int) +0:20 'c' ( global 7-element array of highp int) +0:20 'i' ( global highp int) +0:20 Constant: +0:20 1 (const int) +0:22 Branch: Return with expression +0:22 texture ( global highp 4-component vector of float) +0:22 's2D' (layout( binding=1) uniform highp sampler2D) +0:22 Constant: +0:22 0.500000 +0:22 0.500000 +0:? Linker Objects +0:? 's2D' (layout( binding=1) uniform highp sampler2D) +0:? 'a1' ( global unsized 3-element array of highp int) +0:? 'a2' ( global unsized 10-element array of highp int) +0:? 'b' ( global unsized 3-element array of highp int) +0:? 'c' ( global 7-element array of highp int) +0:? 'i' ( global highp int) +0:? 'anon@0' (layout( column_major std430) buffer block{layout( column_major std430) buffer unsized 1-element array of highp float r}) +0:? 'anon@1' (layout( column_major std430) buffer block{layout( column_major std430) buffer 4-element array of highp float m}) + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:18 Sequence +0:18 move second child to first child ( temp highp 4-component vector of float) +0:18 'color' (layout( location=0) out highp 4-component vector of float) +0:18 Function Call: getColor( ( global highp 4-component vector of float) +0:20 move second child to first child ( temp highp int) +0:20 direct index ( temp highp int) +0:20 'a1' ( global 9-element array of highp int) +0:20 Constant: +0:20 8 (const int) +0:20 Constant: +0:20 1 (const int) +0:21 move second child to first child ( temp highp int) +0:21 direct index ( temp highp int) +0:21 'a2' ( global 10-element array of highp int) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 1 (const int) +0:22 move second child to first child ( temp highp int) +0:22 indirect index ( temp highp int) +0:22 'b' ( global 5-element array of highp int) +0:22 'i' ( global highp int) +0:22 Constant: +0:22 1 (const int) +0:23 move second child to first child ( temp highp int) +0:23 direct index ( temp highp int) +0:23 'c' ( global 7-element array of highp int) +0:23 Constant: +0:23 3 (const int) +0:23 Constant: +0:23 1 (const int) +0:14 Function Definition: getColor( ( global highp 4-component vector of float) +0:14 Function Parameters: +0:16 Sequence +0:16 move second child to first child ( temp highp int) +0:16 direct index ( temp highp int) +0:16 'a1' ( global 3-element array of highp int) +0:16 Constant: +0:16 2 (const int) +0:16 Constant: +0:16 1 (const int) +0:17 move second child to first child ( temp highp int) +0:17 direct index ( temp highp int) +0:17 'a2' ( global 10-element array of highp int) +0:17 Constant: +0:17 9 (const int) +0:17 Constant: +0:17 1 (const int) +0:18 move second child to first child ( temp highp int) +0:18 direct index ( temp highp int) +0:18 'b' ( global 3-element array of highp int) +0:18 Constant: +0:18 2 (const int) +0:18 Constant: +0:18 1 (const int) +0:19 move second child to first child ( temp highp int) +0:19 direct index ( temp highp int) +0:19 'c' ( global 7-element array of highp int) +0:19 Constant: +0:19 3 (const int) +0:19 Constant: +0:19 1 (const int) +0:20 move second child to first child ( temp highp int) +0:20 indirect index ( temp highp int) +0:20 'c' ( global 7-element array of highp int) +0:20 'i' ( global highp int) +0:20 Constant: +0:20 1 (const int) +0:22 Branch: Return with expression +0:22 texture ( global highp 4-component vector of float) +0:22 's2D' (layout( binding=1) uniform highp sampler2D) +0:22 Constant: +0:22 0.500000 +0:22 0.500000 +0:? Linker Objects +0:? 'color' (layout( location=0) out highp 4-component vector of float) +0:? 'a1' ( global 9-element array of highp int) +0:? 'a2' ( global 10-element array of highp int) +0:? 'b' ( global 5-element array of highp int) +0:? 'c' ( global 7-element array of highp int) +0:? 'i' ( global highp int) +0:? 'anon@0' (layout( column_major std430) buffer block{layout( column_major std430) buffer unsized 1-element array of highp float r}) +0:? 'anon@1' (layout( column_major std430) buffer block{layout( column_major std430) buffer 4-element array of highp float m}) +0:? 's2D' (layout( binding=1) uniform highp sampler2D) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 70 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 12 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "getColor(" + Name 12 "color" + Name 19 "a1" + Name 27 "a2" + Name 32 "b" + Name 33 "i" + Name 39 "c" + Name 53 "s2D" + Name 62 "bnameRuntime" + MemberName 62(bnameRuntime) 0 "r" + Name 64 "" + Name 67 "bnameImplicit" + MemberName 67(bnameImplicit) 0 "m" + Name 69 "" + Decorate 12(color) Location 0 + Decorate 53(s2D) DescriptorSet 0 + Decorate 53(s2D) Binding 1 + Decorate 61 ArrayStride 4 + MemberDecorate 62(bnameRuntime) 0 Offset 0 + Decorate 62(bnameRuntime) BufferBlock + Decorate 64 DescriptorSet 0 + Decorate 66 ArrayStride 4 + MemberDecorate 67(bnameImplicit) 0 Offset 0 + Decorate 67(bnameImplicit) BufferBlock + Decorate 69 DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypePointer Output 7(fvec4) + 12(color): 11(ptr) Variable Output + 14: TypeInt 32 1 + 15: TypeInt 32 0 + 16: 15(int) Constant 9 + 17: TypeArray 14(int) 16 + 18: TypePointer Private 17 + 19(a1): 18(ptr) Variable Private + 20: 14(int) Constant 8 + 21: 14(int) Constant 1 + 22: TypePointer Private 14(int) + 24: 15(int) Constant 10 + 25: TypeArray 14(int) 24 + 26: TypePointer Private 25 + 27(a2): 26(ptr) Variable Private + 29: 15(int) Constant 5 + 30: TypeArray 14(int) 29 + 31: TypePointer Private 30 + 32(b): 31(ptr) Variable Private + 33(i): 22(ptr) Variable Private + 36: 15(int) Constant 7 + 37: TypeArray 14(int) 36 + 38: TypePointer Private 37 + 39(c): 38(ptr) Variable Private + 40: 14(int) Constant 3 + 42: 14(int) Constant 2 + 44: 14(int) Constant 9 + 50: TypeImage 6(float) 2D sampled format:Unknown + 51: TypeSampledImage 50 + 52: TypePointer UniformConstant 51 + 53(s2D): 52(ptr) Variable UniformConstant + 55: TypeVector 6(float) 2 + 56: 6(float) Constant 1056964608 + 57: 55(fvec2) ConstantComposite 56 56 + 61: TypeRuntimeArray 6(float) +62(bnameRuntime): TypeStruct 61 + 63: TypePointer Uniform 62(bnameRuntime) + 64: 63(ptr) Variable Uniform + 65: 15(int) Constant 4 + 66: TypeArray 6(float) 65 +67(bnameImplicit): TypeStruct 66 + 68: TypePointer Uniform 67(bnameImplicit) + 69: 68(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + 13: 7(fvec4) FunctionCall 9(getColor() + Store 12(color) 13 + 23: 22(ptr) AccessChain 19(a1) 20 + Store 23 21 + 28: 22(ptr) AccessChain 27(a2) 21 + Store 28 21 + 34: 14(int) Load 33(i) + 35: 22(ptr) AccessChain 32(b) 34 + Store 35 21 + 41: 22(ptr) AccessChain 39(c) 40 + Store 41 21 + Return + FunctionEnd + 9(getColor(): 7(fvec4) Function None 8 + 10: Label + 43: 22(ptr) AccessChain 19(a1) 42 + Store 43 21 + 45: 22(ptr) AccessChain 27(a2) 44 + Store 45 21 + 46: 22(ptr) AccessChain 32(b) 42 + Store 46 21 + 47: 22(ptr) AccessChain 39(c) 40 + Store 47 21 + 48: 14(int) Load 33(i) + 49: 22(ptr) AccessChain 39(c) 48 + Store 49 21 + 54: 51 Load 53(s2D) + 58: 7(fvec4) ImageSampleImplicitLod 54 57 + ReturnValue 58 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/localAggregates.frag.out b/deps/glslang/Test/baseResults/localAggregates.frag.out new file mode 100644 index 00000000..ca445bcc --- /dev/null +++ b/deps/glslang/Test/baseResults/localAggregates.frag.out @@ -0,0 +1,414 @@ +localAggregates.frag +WARNING: 0:4: varying deprecated in version 130; may be removed in future release +WARNING: 0:5: varying deprecated in version 130; may be removed in future release + +Shader version: 130 +0:? Sequence +0:34 Function Definition: main( ( global void) +0:34 Function Parameters: +0:? Sequence +0:41 move second child to first child ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:41 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:41 s2_1: direct index for structure ( global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:41 'foo3' ( uniform structure{ global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:41 Constant: +0:41 0 (const int) +0:43 Test condition and select ( temp void) +0:43 Condition +0:43 Compare Greater Than ( temp bool) +0:43 i: direct index for structure ( global int) +0:43 s2_1: direct index for structure ( global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:43 'foo3' ( uniform structure{ global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:43 Constant: +0:43 0 (const int) +0:43 Constant: +0:43 0 (const int) +0:43 Constant: +0:43 0 (const int) +0:43 true case +0:44 Sequence +0:44 move second child to first child ( temp float) +0:44 f: direct index for structure ( global float) +0:44 s1_1: direct index for structure ( global structure{ global int i, global float f}) +0:44 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:44 Constant: +0:44 2 (const int) +0:44 Constant: +0:44 1 (const int) +0:44 Constant: +0:44 1.000000 +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 'localFArray' ( temp 16-element array of float) +0:45 Constant: +0:45 4 (const int) +0:45 direct index ( temp float) +0:45 'coord' ( smooth in 2-component vector of float) +0:45 Constant: +0:45 0 (const int) +0:46 move second child to first child ( temp int) +0:46 direct index ( temp int) +0:46 'localIArray' ( temp 8-element array of int) +0:46 Constant: +0:46 2 (const int) +0:46 i: direct index for structure ( global int) +0:46 s2_1: direct index for structure ( global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:46 'foo3' ( uniform structure{ global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 0 (const int) +0:43 false case +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 f: direct index for structure ( global float) +0:48 s1_1: direct index for structure ( global structure{ global int i, global float f}) +0:48 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:48 Constant: +0:48 2 (const int) +0:48 Constant: +0:48 1 (const int) +0:48 direct index ( temp float) +0:48 'coord' ( smooth in 2-component vector of float) +0:48 Constant: +0:48 0 (const int) +0:49 move second child to first child ( temp float) +0:49 direct index ( temp float) +0:49 'localFArray' ( temp 16-element array of float) +0:49 Constant: +0:49 4 (const int) +0:49 Constant: +0:49 1.000000 +0:50 move second child to first child ( temp int) +0:50 direct index ( temp int) +0:50 'localIArray' ( temp 8-element array of int) +0:50 Constant: +0:50 2 (const int) +0:50 Constant: +0:50 0 (const int) +0:53 Test condition and select ( temp void) +0:53 Condition +0:53 Compare Equal ( temp bool) +0:53 direct index ( temp int) +0:53 'localIArray' ( temp 8-element array of int) +0:53 Constant: +0:53 2 (const int) +0:53 Constant: +0:53 0 (const int) +0:53 true case +0:54 Pre-Increment ( temp float) +0:54 direct index ( temp float) +0:54 'localFArray' ( temp 16-element array of float) +0:54 Constant: +0:54 4 (const int) +0:57 Sequence +0:57 move second child to first child ( temp int) +0:57 'x' ( temp int) +0:57 Constant: +0:57 5 (const int) +0:58 move second child to first child ( temp float) +0:58 indirect index ( temp float) +0:58 'localArray' ( temp 16-element array of float) +0:58 'x' ( temp int) +0:58 direct index ( temp float) +0:58 'coord' ( smooth in 2-component vector of float) +0:58 Constant: +0:58 0 (const int) +0:62 Sequence +0:62 Sequence +0:62 move second child to first child ( temp int) +0:62 'i' ( temp int) +0:62 Constant: +0:62 0 (const int) +0:62 Loop with condition tested first +0:62 Loop Condition +0:62 Compare Less Than ( temp bool) +0:62 'i' ( temp int) +0:62 Constant: +0:62 16 (const int) +0:62 Loop Body +0:63 move second child to first child ( temp float) +0:63 indirect index ( temp float) +0:63 'a' ( temp 16-element array of float) +0:63 'i' ( temp int) +0:63 Constant: +0:63 0.000000 +0:62 Loop Terminal Expression +0:62 Post-Increment ( temp int) +0:62 'i' ( temp int) +0:65 Test condition and select ( temp void) +0:65 Condition +0:65 Compare Equal ( temp bool) +0:65 'condition' ( uniform int) +0:65 Constant: +0:65 1 (const int) +0:65 true case +0:66 move second child to first child ( temp 16-element array of float) +0:66 'a' ( temp 16-element array of float) +0:66 'localArray' ( temp 16-element array of float) +0:68 move second child to first child ( temp 4-component vector of float) +0:68 bleh: direct index for structure ( global 4-component vector of float) +0:68 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:68 Constant: +0:68 3 (const int) +0:68 'color' ( smooth in 4-component vector of float) +0:69 move second child to first child ( temp float) +0:69 direct index ( temp float) +0:69 bleh: direct index for structure ( global 4-component vector of float) +0:69 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:69 Constant: +0:69 3 (const int) +0:69 Constant: +0:69 2 (const int) +0:69 direct index ( temp float) +0:69 'coord' ( smooth in 2-component vector of float) +0:69 Constant: +0:69 1 (const int) +0:71 move second child to first child ( temp 4-component vector of float) +0:71 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:71 component-wise multiply ( temp 4-component vector of float) +0:71 vector-scale ( temp 4-component vector of float) +0:71 bleh: direct index for structure ( global 4-component vector of float) +0:71 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:71 Constant: +0:71 3 (const int) +0:71 add ( temp float) +0:71 add ( temp float) +0:71 add ( temp float) +0:71 direct index ( temp float) +0:71 'localFArray' ( temp 16-element array of float) +0:71 Constant: +0:71 4 (const int) +0:71 f: direct index for structure ( global float) +0:71 s1_1: direct index for structure ( global structure{ global int i, global float f}) +0:71 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:71 Constant: +0:71 2 (const int) +0:71 Constant: +0:71 1 (const int) +0:71 indirect index ( temp float) +0:71 'localArray' ( temp 16-element array of float) +0:71 'x' ( temp int) +0:71 indirect index ( temp float) +0:71 'a' ( temp 16-element array of float) +0:71 'x' ( temp int) +0:71 texture ( global 4-component vector of float) +0:71 'sampler' ( uniform sampler2D) +0:71 'coord' ( smooth in 2-component vector of float) +0:? Linker Objects +0:? 'sampler' ( uniform sampler2D) +0:? 'coord' ( smooth in 2-component vector of float) +0:? 'color' ( smooth in 4-component vector of float) +0:? 'foo' ( uniform structure{ global int i, global float f}) +0:? 'foo2' ( uniform structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:? 'foo3' ( uniform structure{ global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:? 'uFloatArray' ( uniform 16-element array of float) +0:? 'condition' ( uniform int) + + +Linked fragment stage: + + +Shader version: 130 +0:? Sequence +0:34 Function Definition: main( ( global void) +0:34 Function Parameters: +0:? Sequence +0:41 move second child to first child ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:41 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:41 s2_1: direct index for structure ( global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:41 'foo3' ( uniform structure{ global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:41 Constant: +0:41 0 (const int) +0:43 Test condition and select ( temp void) +0:43 Condition +0:43 Compare Greater Than ( temp bool) +0:43 i: direct index for structure ( global int) +0:43 s2_1: direct index for structure ( global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:43 'foo3' ( uniform structure{ global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:43 Constant: +0:43 0 (const int) +0:43 Constant: +0:43 0 (const int) +0:43 Constant: +0:43 0 (const int) +0:43 true case +0:44 Sequence +0:44 move second child to first child ( temp float) +0:44 f: direct index for structure ( global float) +0:44 s1_1: direct index for structure ( global structure{ global int i, global float f}) +0:44 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:44 Constant: +0:44 2 (const int) +0:44 Constant: +0:44 1 (const int) +0:44 Constant: +0:44 1.000000 +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 'localFArray' ( temp 16-element array of float) +0:45 Constant: +0:45 4 (const int) +0:45 direct index ( temp float) +0:45 'coord' ( smooth in 2-component vector of float) +0:45 Constant: +0:45 0 (const int) +0:46 move second child to first child ( temp int) +0:46 direct index ( temp int) +0:46 'localIArray' ( temp 8-element array of int) +0:46 Constant: +0:46 2 (const int) +0:46 i: direct index for structure ( global int) +0:46 s2_1: direct index for structure ( global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:46 'foo3' ( uniform structure{ global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 0 (const int) +0:43 false case +0:48 Sequence +0:48 move second child to first child ( temp float) +0:48 f: direct index for structure ( global float) +0:48 s1_1: direct index for structure ( global structure{ global int i, global float f}) +0:48 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:48 Constant: +0:48 2 (const int) +0:48 Constant: +0:48 1 (const int) +0:48 direct index ( temp float) +0:48 'coord' ( smooth in 2-component vector of float) +0:48 Constant: +0:48 0 (const int) +0:49 move second child to first child ( temp float) +0:49 direct index ( temp float) +0:49 'localFArray' ( temp 16-element array of float) +0:49 Constant: +0:49 4 (const int) +0:49 Constant: +0:49 1.000000 +0:50 move second child to first child ( temp int) +0:50 direct index ( temp int) +0:50 'localIArray' ( temp 8-element array of int) +0:50 Constant: +0:50 2 (const int) +0:50 Constant: +0:50 0 (const int) +0:53 Test condition and select ( temp void) +0:53 Condition +0:53 Compare Equal ( temp bool) +0:53 direct index ( temp int) +0:53 'localIArray' ( temp 8-element array of int) +0:53 Constant: +0:53 2 (const int) +0:53 Constant: +0:53 0 (const int) +0:53 true case +0:54 Pre-Increment ( temp float) +0:54 direct index ( temp float) +0:54 'localFArray' ( temp 16-element array of float) +0:54 Constant: +0:54 4 (const int) +0:57 Sequence +0:57 move second child to first child ( temp int) +0:57 'x' ( temp int) +0:57 Constant: +0:57 5 (const int) +0:58 move second child to first child ( temp float) +0:58 indirect index ( temp float) +0:58 'localArray' ( temp 16-element array of float) +0:58 'x' ( temp int) +0:58 direct index ( temp float) +0:58 'coord' ( smooth in 2-component vector of float) +0:58 Constant: +0:58 0 (const int) +0:62 Sequence +0:62 Sequence +0:62 move second child to first child ( temp int) +0:62 'i' ( temp int) +0:62 Constant: +0:62 0 (const int) +0:62 Loop with condition tested first +0:62 Loop Condition +0:62 Compare Less Than ( temp bool) +0:62 'i' ( temp int) +0:62 Constant: +0:62 16 (const int) +0:62 Loop Body +0:63 move second child to first child ( temp float) +0:63 indirect index ( temp float) +0:63 'a' ( temp 16-element array of float) +0:63 'i' ( temp int) +0:63 Constant: +0:63 0.000000 +0:62 Loop Terminal Expression +0:62 Post-Increment ( temp int) +0:62 'i' ( temp int) +0:65 Test condition and select ( temp void) +0:65 Condition +0:65 Compare Equal ( temp bool) +0:65 'condition' ( uniform int) +0:65 Constant: +0:65 1 (const int) +0:65 true case +0:66 move second child to first child ( temp 16-element array of float) +0:66 'a' ( temp 16-element array of float) +0:66 'localArray' ( temp 16-element array of float) +0:68 move second child to first child ( temp 4-component vector of float) +0:68 bleh: direct index for structure ( global 4-component vector of float) +0:68 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:68 Constant: +0:68 3 (const int) +0:68 'color' ( smooth in 4-component vector of float) +0:69 move second child to first child ( temp float) +0:69 direct index ( temp float) +0:69 bleh: direct index for structure ( global 4-component vector of float) +0:69 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:69 Constant: +0:69 3 (const int) +0:69 Constant: +0:69 2 (const int) +0:69 direct index ( temp float) +0:69 'coord' ( smooth in 2-component vector of float) +0:69 Constant: +0:69 1 (const int) +0:71 move second child to first child ( temp 4-component vector of float) +0:71 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:71 component-wise multiply ( temp 4-component vector of float) +0:71 vector-scale ( temp 4-component vector of float) +0:71 bleh: direct index for structure ( global 4-component vector of float) +0:71 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:71 Constant: +0:71 3 (const int) +0:71 add ( temp float) +0:71 add ( temp float) +0:71 add ( temp float) +0:71 direct index ( temp float) +0:71 'localFArray' ( temp 16-element array of float) +0:71 Constant: +0:71 4 (const int) +0:71 f: direct index for structure ( global float) +0:71 s1_1: direct index for structure ( global structure{ global int i, global float f}) +0:71 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:71 Constant: +0:71 2 (const int) +0:71 Constant: +0:71 1 (const int) +0:71 indirect index ( temp float) +0:71 'localArray' ( temp 16-element array of float) +0:71 'x' ( temp int) +0:71 indirect index ( temp float) +0:71 'a' ( temp 16-element array of float) +0:71 'x' ( temp int) +0:71 texture ( global 4-component vector of float) +0:71 'sampler' ( uniform sampler2D) +0:71 'coord' ( smooth in 2-component vector of float) +0:? Linker Objects +0:? 'sampler' ( uniform sampler2D) +0:? 'coord' ( smooth in 2-component vector of float) +0:? 'color' ( smooth in 4-component vector of float) +0:? 'foo' ( uniform structure{ global int i, global float f}) +0:? 'foo2' ( uniform structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh}) +0:? 'foo3' ( uniform structure{ global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1, global 4-component vector of float bleh} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:? 'uFloatArray' ( uniform 16-element array of float) +0:? 'condition' ( uniform int) + diff --git a/deps/glslang/Test/baseResults/loops.frag.out b/deps/glslang/Test/baseResults/loops.frag.out new file mode 100644 index 00000000..cf382995 --- /dev/null +++ b/deps/glslang/Test/baseResults/loops.frag.out @@ -0,0 +1,1935 @@ +loops.frag +WARNING: 0:14: varying deprecated in version 130; may be removed in future release + +Shader version: 130 +0:? Sequence +0:53 Function Definition: main( ( global void) +0:53 Function Parameters: +0:55 Sequence +0:55 Sequence +0:55 move second child to first child ( temp 4-component vector of float) +0:55 'color' ( temp 4-component vector of float) +0:55 'BaseColor' ( smooth in 4-component vector of float) +0:58 Loop with condition tested first +0:58 Loop Condition +0:58 Constant: +0:58 true (const bool) +0:58 Loop Body +0:59 Sequence +0:59 Test condition and select ( temp void) +0:59 Condition +0:59 Compare Less Than ( temp bool) +0:59 direct index ( temp float) +0:59 'color' ( temp 4-component vector of float) +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 0.330000 +0:59 true case +0:60 Sequence +0:60 add second child into first child ( temp 4-component vector of float) +0:60 'color' ( temp 4-component vector of float) +0:60 Constant: +0:60 0.330000 +0:60 0.330000 +0:60 0.330000 +0:60 0.330000 +0:61 Branch: Break +0:63 Test condition and select ( temp void) +0:63 Condition +0:63 Compare Less Than ( temp bool) +0:63 direct index ( temp float) +0:63 'color' ( temp 4-component vector of float) +0:63 Constant: +0:63 0 (const int) +0:63 Constant: +0:63 0.660000 +0:63 true case +0:64 Sequence +0:64 add second child into first child ( temp 4-component vector of float) +0:64 'color' ( temp 4-component vector of float) +0:64 Constant: +0:64 0.660000 +0:64 0.660000 +0:64 0.660000 +0:64 0.660000 +0:65 Branch: Break +0:68 add second child into first child ( temp 4-component vector of float) +0:68 'color' ( temp 4-component vector of float) +0:68 Constant: +0:68 0.330000 +0:68 0.330000 +0:68 0.330000 +0:68 0.330000 +0:69 Branch: Break +0:73 Loop with condition tested first +0:73 Loop Condition +0:73 Compare Less Than ( temp bool) +0:73 direct index ( temp float) +0:73 'color' ( temp 4-component vector of float) +0:73 Constant: +0:73 0 (const int) +0:73 'd' ( uniform float) +0:73 Loop Body +0:74 Sequence +0:74 add second child into first child ( temp 4-component vector of float) +0:74 'color' ( temp 4-component vector of float) +0:74 'bigColor' ( uniform 4-component vector of float) +0:78 Loop with condition tested first +0:78 Loop Condition +0:78 Compare Less Than ( temp bool) +0:78 direct index ( temp float) +0:78 'color' ( temp 4-component vector of float) +0:78 Constant: +0:78 2 (const int) +0:78 'd' ( uniform float) +0:78 Loop Body +0:79 Sequence +0:79 add second child into first child ( temp 4-component vector of float) +0:79 'color' ( temp 4-component vector of float) +0:79 'bigColor1_1' ( uniform 4-component vector of float) +0:80 Test condition and select ( temp void) +0:80 Condition +0:80 Compare Less Than ( temp bool) +0:80 direct index ( temp float) +0:80 'color' ( temp 4-component vector of float) +0:80 Constant: +0:80 3 (const int) +0:80 'd' ( uniform float) +0:80 true case +0:81 Branch: Continue +0:83 add second child into first child ( temp 4-component vector of float) +0:83 'color' ( temp 4-component vector of float) +0:83 'bigColor1_1' ( uniform 4-component vector of float) +0:87 Loop with condition tested first +0:87 Loop Condition +0:87 Compare Less Than ( temp bool) +0:87 direct index ( temp float) +0:87 'color' ( temp 4-component vector of float) +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 42.000000 +0:87 Loop Body +0:88 Sequence +0:88 Pre-Increment ( temp 4-component vector of float) +0:88 'color' ( temp 4-component vector of float) +0:92 Loop with condition tested first +0:92 Loop Condition +0:92 logical-and ( temp bool) +0:92 Compare Less Than ( temp bool) +0:92 direct index ( temp float) +0:92 'color' ( temp 4-component vector of float) +0:92 Constant: +0:92 3 (const int) +0:92 'd2' ( uniform float) +0:92 Compare Less Than ( temp bool) +0:92 direct index ( temp float) +0:92 'color' ( temp 4-component vector of float) +0:92 Constant: +0:92 1 (const int) +0:92 'd3' ( uniform float) +0:92 Loop Body +0:93 Sequence +0:93 add second child into first child ( temp 4-component vector of float) +0:93 'color' ( temp 4-component vector of float) +0:93 'bigColor1_2' ( uniform 4-component vector of float) +0:97 Loop with condition tested first +0:97 Loop Condition +0:97 Compare Less Than ( temp bool) +0:97 direct index ( temp float) +0:97 'color' ( temp 4-component vector of float) +0:97 Constant: +0:97 2 (const int) +0:97 'd3' ( uniform float) +0:97 Loop Body +0:98 Sequence +0:98 add second child into first child ( temp 4-component vector of float) +0:98 'color' ( temp 4-component vector of float) +0:98 'bigColor1_3' ( uniform 4-component vector of float) +0:99 Test condition and select ( temp void) +0:99 Condition +0:99 Compare Less Than ( temp bool) +0:99 direct index ( temp float) +0:99 'color' ( temp 4-component vector of float) +0:99 Constant: +0:99 1 (const int) +0:99 'd4' ( uniform float) +0:99 true case +0:100 Branch: Break +0:101 add second child into first child ( temp 4-component vector of float) +0:101 'color' ( temp 4-component vector of float) +0:101 'bigColor1_3' ( uniform 4-component vector of float) +0:105 Sequence +0:105 Sequence +0:105 move second child to first child ( temp int) +0:105 'i' ( temp int) +0:105 Constant: +0:105 0 (const int) +0:105 Loop with condition tested first +0:105 Loop Condition +0:105 Compare Less Than ( temp bool) +0:105 'i' ( temp int) +0:105 'Count' ( uniform int) +0:105 Loop Body +0:106 Sequence +0:106 add second child into first child ( temp 4-component vector of float) +0:106 'color' ( temp 4-component vector of float) +0:106 'bigColor2' ( uniform 4-component vector of float) +0:105 Loop Terminal Expression +0:105 Pre-Increment ( temp int) +0:105 'i' ( temp int) +0:112 Loop with condition not tested first +0:112 Loop Condition +0:112 Compare Less Than ( temp bool) +0:112 direct index ( temp float) +0:112 'color' ( temp 4-component vector of float) +0:112 Constant: +0:112 0 (const int) +0:112 'd2' ( uniform float) +0:112 Loop Body +0:111 Sequence +0:111 add second child into first child ( temp 4-component vector of float) +0:111 'color' ( temp 4-component vector of float) +0:111 'bigColor3' ( uniform 4-component vector of float) +0:115 Sequence +0:115 Sequence +0:115 move second child to first child ( temp int) +0:115 'i' ( temp int) +0:115 Constant: +0:115 0 (const int) +0:115 Loop with condition tested first +0:115 Loop Condition +0:115 Compare Less Than ( temp bool) +0:115 'i' ( temp int) +0:115 Constant: +0:115 42 (const int) +0:115 Loop Body +0:116 Sequence +0:116 add second child into first child ( temp float) +0:116 direct index ( temp float) +0:116 'color' ( temp 4-component vector of float) +0:116 Constant: +0:116 2 (const int) +0:116 'd3' ( uniform float) +0:115 Loop Terminal Expression +0:115 Pre-Increment ( temp int) +0:115 'i' ( temp int) +0:120 Sequence +0:120 Sequence +0:120 move second child to first child ( temp int) +0:120 'i' ( temp int) +0:120 Constant: +0:120 0 (const int) +0:120 Loop with condition tested first +0:120 Loop Condition +0:120 Compare Less Than ( temp bool) +0:120 'i' ( temp int) +0:120 Constant: +0:120 100 (const int) +0:120 Loop Body +0:121 Sequence +0:121 Test condition and select ( temp void) +0:121 Condition +0:121 Compare Less Than ( temp bool) +0:121 direct index ( temp float) +0:121 'color' ( temp 4-component vector of float) +0:121 Constant: +0:121 2 (const int) +0:121 Constant: +0:121 20.000000 +0:121 true case +0:122 Post-Increment ( temp float) +0:122 direct index ( temp float) +0:122 'color' ( temp 4-component vector of float) +0:122 Constant: +0:122 0 (const int) +0:121 false case +0:124 Post-Increment ( temp float) +0:124 direct index ( temp float) +0:124 'color' ( temp 4-component vector of float) +0:124 Constant: +0:124 1 (const int) +0:125 Test condition and select ( temp void) +0:125 Condition +0:125 Compare Less Than ( temp bool) +0:125 direct index ( temp float) +0:125 'color' ( temp 4-component vector of float) +0:125 Constant: +0:125 3 (const int) +0:125 Constant: +0:125 20.000000 +0:125 true case +0:126 Test condition and select ( temp void) +0:126 Condition +0:126 Compare Greater Than ( temp bool) +0:126 direct index ( temp float) +0:126 'color' ( temp 4-component vector of float) +0:126 Constant: +0:126 2 (const int) +0:126 direct index ( temp float) +0:126 'color' ( temp 4-component vector of float) +0:126 Constant: +0:126 1 (const int) +0:126 true case +0:127 Constant: +0:127 0 (const int) +0:120 Loop Terminal Expression +0:120 Pre-Increment ( temp int) +0:120 'i' ( temp int) +0:131 Sequence +0:131 Sequence +0:131 move second child to first child ( temp int) +0:131 'i' ( temp int) +0:131 Constant: +0:131 0 (const int) +0:131 Loop with condition tested first +0:131 Loop Condition +0:131 Compare Less Than ( temp bool) +0:131 'i' ( temp int) +0:131 Constant: +0:131 120 (const int) +0:131 Loop Body +0:132 Sequence +0:132 Test condition and select ( temp void) +0:132 Condition +0:132 Compare Less Than ( temp bool) +0:132 direct index ( temp float) +0:132 'color' ( temp 4-component vector of float) +0:132 Constant: +0:132 2 (const int) +0:132 Constant: +0:132 20.000000 +0:132 true case +0:133 Post-Increment ( temp float) +0:133 direct index ( temp float) +0:133 'color' ( temp 4-component vector of float) +0:133 Constant: +0:133 0 (const int) +0:132 false case +0:135 Post-Increment ( temp float) +0:135 direct index ( temp float) +0:135 'color' ( temp 4-component vector of float) +0:135 Constant: +0:135 1 (const int) +0:131 Loop Terminal Expression +0:131 Pre-Increment ( temp int) +0:131 'i' ( temp int) +0:139 Sequence +0:139 Sequence +0:139 move second child to first child ( temp int) +0:139 'i' ( temp int) +0:139 Constant: +0:139 0 (const int) +0:139 Loop with condition tested first +0:139 Loop Condition +0:139 Compare Less Than ( temp bool) +0:139 'i' ( temp int) +0:139 Constant: +0:139 42 (const int) +0:139 Loop Body +0:140 Sequence +0:140 add second child into first child ( temp float) +0:140 direct index ( temp float) +0:140 'color' ( temp 4-component vector of float) +0:140 Constant: +0:140 2 (const int) +0:140 'd3' ( uniform float) +0:141 Test condition and select ( temp void) +0:141 Condition +0:141 Compare Less Than ( temp bool) +0:141 direct index ( temp float) +0:141 'color' ( temp 4-component vector of float) +0:141 Constant: +0:141 0 (const int) +0:141 'd4' ( uniform float) +0:141 true case +0:142 Branch: Continue +0:143 Pre-Increment ( temp float) +0:143 direct index ( temp float) +0:143 'color' ( temp 4-component vector of float) +0:143 Constant: +0:143 3 (const int) +0:139 Loop Terminal Expression +0:139 Pre-Increment ( temp int) +0:139 'i' ( temp int) +0:147 Sequence +0:147 Sequence +0:147 move second child to first child ( temp int) +0:147 'i' ( temp int) +0:147 Constant: +0:147 0 (const int) +0:147 Loop with condition tested first +0:147 Loop Condition +0:147 Compare Less Than ( temp bool) +0:147 'i' ( temp int) +0:147 Constant: +0:147 42 (const int) +0:147 Loop Body +0:148 Sequence +0:148 add second child into first child ( temp float) +0:148 direct index ( temp float) +0:148 'color' ( temp 4-component vector of float) +0:148 Constant: +0:148 2 (const int) +0:148 'd3' ( uniform float) +0:149 Test condition and select ( temp void) +0:149 Condition +0:149 Compare Less Than ( temp bool) +0:149 direct index ( temp float) +0:149 'color' ( temp 4-component vector of float) +0:149 Constant: +0:149 0 (const int) +0:149 'd4' ( uniform float) +0:149 true case +0:150 Branch: Break +0:151 Pre-Increment ( temp float) +0:151 direct index ( temp float) +0:151 'color' ( temp 4-component vector of float) +0:151 Constant: +0:151 3 (const int) +0:147 Loop Terminal Expression +0:147 Pre-Increment ( temp int) +0:147 'i' ( temp int) +0:163 Loop with condition not tested first +0:163 Loop Condition +0:163 Compare Less Than ( temp bool) +0:163 direct index ( temp float) +0:163 'color' ( temp 4-component vector of float) +0:163 Constant: +0:163 2 (const int) +0:163 'd4' ( uniform float) +0:163 Loop Body +0:156 Sequence +0:156 add second child into first child ( temp 4-component vector of float) +0:156 'color' ( temp 4-component vector of float) +0:156 'bigColor4' ( uniform 4-component vector of float) +0:157 Test condition and select ( temp void) +0:157 Condition +0:157 Compare Less Than ( temp bool) +0:157 direct index ( temp float) +0:157 'color' ( temp 4-component vector of float) +0:157 Constant: +0:157 0 (const int) +0:157 'd4' ( uniform float) +0:157 true case +0:158 Branch: Continue +0:159 Test condition and select ( temp void) +0:159 Condition +0:159 Compare Less Than ( temp bool) +0:159 direct index ( temp float) +0:159 'color' ( temp 4-component vector of float) +0:159 Constant: +0:159 1 (const int) +0:159 'd4' ( uniform float) +0:159 true case +0:160 add second child into first child ( temp float) +0:160 direct index ( temp float) +0:160 'color' ( temp 4-component vector of float) +0:160 Constant: +0:160 1 (const int) +0:160 'd4' ( uniform float) +0:159 false case +0:162 add second child into first child ( temp float) +0:162 direct index ( temp float) +0:162 'color' ( temp 4-component vector of float) +0:162 Constant: +0:162 0 (const int) +0:162 'd4' ( uniform float) +0:170 Loop with condition not tested first +0:170 Loop Condition +0:170 Compare Less Than ( temp bool) +0:170 direct index ( temp float) +0:170 'color' ( temp 4-component vector of float) +0:170 Constant: +0:170 0 (const int) +0:170 'd5' ( uniform float) +0:170 Loop Body +0:167 Sequence +0:167 add second child into first child ( temp 4-component vector of float) +0:167 'color' ( temp 4-component vector of float) +0:167 'bigColor5' ( uniform 4-component vector of float) +0:168 Test condition and select ( temp void) +0:168 Condition +0:168 Compare Less Than ( temp bool) +0:168 direct index ( temp float) +0:168 'color' ( temp 4-component vector of float) +0:168 Constant: +0:168 1 (const int) +0:168 'd5' ( uniform float) +0:168 true case +0:169 add second child into first child ( temp float) +0:169 direct index ( temp float) +0:169 'color' ( temp 4-component vector of float) +0:169 Constant: +0:169 1 (const int) +0:169 'd5' ( uniform float) +0:173 Test condition and select ( temp void) +0:173 Condition +0:173 Compare Less Than ( temp bool) +0:173 direct index ( temp float) +0:173 'color' ( temp 4-component vector of float) +0:173 Constant: +0:173 0 (const int) +0:173 'd6' ( uniform float) +0:173 true case +0:174 Sequence +0:174 Loop with condition tested first +0:174 Loop Condition +0:174 Compare Less Than ( temp bool) +0:174 direct index ( temp float) +0:174 'color' ( temp 4-component vector of float) +0:174 Constant: +0:174 1 (const int) +0:174 'd6' ( uniform float) +0:174 Loop Body +0:175 add second child into first child ( temp 4-component vector of float) +0:175 'color' ( temp 4-component vector of float) +0:175 'bigColor6' ( uniform 4-component vector of float) +0:173 false case +0:177 Sequence +0:177 Loop with condition tested first +0:177 Loop Condition +0:177 Compare Less Than ( temp bool) +0:177 direct index ( temp float) +0:177 'color' ( temp 4-component vector of float) +0:177 Constant: +0:177 2 (const int) +0:177 'd6' ( uniform float) +0:177 Loop Body +0:178 add second child into first child ( temp float) +0:178 direct index ( temp float) +0:178 'color' ( temp 4-component vector of float) +0:178 Constant: +0:178 2 (const int) +0:178 direct index ( temp float) +0:178 'bigColor6' ( uniform 4-component vector of float) +0:178 Constant: +0:178 2 (const int) +0:182 Test condition and select ( temp void) +0:182 Condition +0:182 Compare Less Than ( temp bool) +0:182 direct index ( temp float) +0:182 'color' ( temp 4-component vector of float) +0:182 Constant: +0:182 0 (const int) +0:182 'd6' ( uniform float) +0:182 true case +0:183 Sequence +0:183 Loop with condition tested first +0:183 Loop Condition +0:183 Compare Less Than ( temp bool) +0:183 direct index ( temp float) +0:183 'color' ( temp 4-component vector of float) +0:183 Constant: +0:183 1 (const int) +0:183 'd6' ( uniform float) +0:183 Loop Body +0:184 Sequence +0:184 add second child into first child ( temp 4-component vector of float) +0:184 'color' ( temp 4-component vector of float) +0:184 'bigColor6' ( uniform 4-component vector of float) +0:185 Test condition and select ( temp void) +0:185 Condition +0:185 Compare Less Than ( temp bool) +0:185 'd7' ( uniform float) +0:185 Constant: +0:185 1.000000 +0:185 true case +0:186 Branch: Break +0:182 false case +0:190 Sequence +0:190 Loop with condition tested first +0:190 Loop Condition +0:190 Compare Less Than ( temp bool) +0:190 direct index ( temp float) +0:190 'color' ( temp 4-component vector of float) +0:190 Constant: +0:190 2 (const int) +0:190 'd6' ( uniform float) +0:190 Loop Body +0:191 add second child into first child ( temp float) +0:191 direct index ( temp float) +0:191 'color' ( temp 4-component vector of float) +0:191 Constant: +0:191 2 (const int) +0:191 direct index ( temp float) +0:191 'bigColor6' ( uniform 4-component vector of float) +0:191 Constant: +0:191 2 (const int) +0:209 Loop with condition not tested first +0:209 Loop Condition +0:209 Constant: +0:209 true (const bool) +0:209 Loop Body +0:197 Sequence +0:197 Test condition and select ( temp void) +0:197 Condition +0:197 Compare Less Than ( temp bool) +0:197 'd7' ( uniform float) +0:197 Constant: +0:197 0.000000 +0:197 true case +0:198 Branch: Break +0:200 add second child into first child ( temp 4-component vector of float) +0:200 'color' ( temp 4-component vector of float) +0:200 'bigColor7' ( uniform 4-component vector of float) +0:202 Test condition and select ( temp void) +0:202 Condition +0:202 Compare Less Than ( temp bool) +0:202 'd7' ( uniform float) +0:202 Constant: +0:202 1.000000 +0:202 true case +0:203 Sequence +0:203 Post-Increment ( temp float) +0:203 direct index ( temp float) +0:203 'color' ( temp 4-component vector of float) +0:203 Constant: +0:203 2 (const int) +0:204 Branch: Break +0:207 add second child into first child ( temp 4-component vector of float) +0:207 'color' ( temp 4-component vector of float) +0:207 'BaseColor' ( smooth in 4-component vector of float) +0:234 Loop with condition not tested first +0:234 Loop Condition +0:234 Compare Less Than ( temp bool) +0:234 direct index ( temp float) +0:234 'color' ( temp 4-component vector of float) +0:234 Constant: +0:234 2 (const int) +0:234 'd8' ( uniform float) +0:234 Loop Body +0:217 Sequence +0:217 Test condition and select ( temp void) +0:217 Condition +0:217 Compare Less Than ( temp bool) +0:217 'd8' ( uniform float) +0:217 Constant: +0:217 0.000000 +0:217 true case +0:218 Branch: Break +0:220 add second child into first child ( temp 4-component vector of float) +0:220 'color' ( temp 4-component vector of float) +0:220 'bigColor7' ( uniform 4-component vector of float) +0:222 Test condition and select ( temp void) +0:222 Condition +0:222 Compare Less Than ( temp bool) +0:222 'd8' ( uniform float) +0:222 Constant: +0:222 1.000000 +0:222 true case +0:223 Sequence +0:223 Post-Increment ( temp float) +0:223 direct index ( temp float) +0:223 'color' ( temp 4-component vector of float) +0:223 Constant: +0:223 2 (const int) +0:224 Test condition and select ( temp void) +0:224 Condition +0:224 Compare Less Than ( temp bool) +0:224 'd8' ( uniform float) +0:224 Constant: +0:224 2.000000 +0:224 true case +0:225 Sequence +0:225 Post-Increment ( temp float) +0:225 direct index ( temp float) +0:225 'color' ( temp 4-component vector of float) +0:225 Constant: +0:225 1 (const int) +0:224 false case +0:227 Sequence +0:227 Post-Increment ( temp float) +0:227 direct index ( temp float) +0:227 'color' ( temp 4-component vector of float) +0:227 Constant: +0:227 0 (const int) +0:229 Branch: Break +0:232 add second child into first child ( temp 4-component vector of float) +0:232 'color' ( temp 4-component vector of float) +0:232 'BaseColor' ( smooth in 4-component vector of float) +0:237 Loop with condition tested first +0:237 Loop Condition +0:237 Compare Less Than ( temp bool) +0:237 direct index ( temp float) +0:237 'color' ( temp 4-component vector of float) +0:237 Constant: +0:237 3 (const int) +0:237 'd9' ( uniform float) +0:237 Loop Body +0:238 Sequence +0:238 Test condition and select ( temp void) +0:238 Condition +0:238 Compare Greater Than ( temp bool) +0:238 'd9' ( uniform float) +0:238 'd8' ( uniform float) +0:238 true case +0:239 Sequence +0:239 Test condition and select ( temp void) +0:239 Condition +0:239 Compare Less Than or Equal ( temp bool) +0:239 direct index ( temp float) +0:239 'color' ( temp 4-component vector of float) +0:239 Constant: +0:239 0 (const int) +0:239 'd7' ( uniform float) +0:239 true case +0:240 Sequence +0:240 Test condition and select ( temp void) +0:240 Condition +0:240 Compare Equal ( temp bool) +0:240 direct index ( temp float) +0:240 'color' ( temp 4-component vector of float) +0:240 Constant: +0:240 2 (const int) +0:240 Constant: +0:240 5.000000 +0:240 true case +0:241 Post-Increment ( temp float) +0:241 direct index ( temp float) +0:241 'color' ( temp 4-component vector of float) +0:241 Constant: +0:241 3 (const int) +0:240 false case +0:243 Branch: Break +0:250 Loop with condition tested first +0:250 Loop Condition +0:250 Compare Less Than ( temp bool) +0:250 direct index ( temp float) +0:250 'color' ( temp 4-component vector of float) +0:250 Constant: +0:250 2 (const int) +0:250 'd10' ( uniform float) +0:250 Loop Body +0:251 Sequence +0:251 Post-Increment ( temp float) +0:251 direct index ( temp float) +0:251 'color' ( temp 4-component vector of float) +0:251 Constant: +0:251 1 (const int) +0:252 Test condition and select ( temp void) +0:252 Condition +0:252 Compare Less Than ( temp bool) +0:252 direct index ( temp float) +0:252 'color' ( temp 4-component vector of float) +0:252 Constant: +0:252 1 (const int) +0:252 'd11' ( uniform float) +0:252 true case +0:253 Sequence +0:253 Post-Increment ( temp float) +0:253 direct index ( temp float) +0:253 'color' ( temp 4-component vector of float) +0:253 Constant: +0:253 2 (const int) +0:254 Test condition and select ( temp void) +0:254 Condition +0:254 Compare Less Than ( temp bool) +0:254 direct index ( temp float) +0:254 'color' ( temp 4-component vector of float) +0:254 Constant: +0:254 3 (const int) +0:254 'd12' ( uniform float) +0:254 true case +0:255 Post-Increment ( temp float) +0:255 direct index ( temp float) +0:255 'color' ( temp 4-component vector of float) +0:255 Constant: +0:255 3 (const int) +0:254 false case +0:257 Post-Increment ( temp float) +0:257 direct index ( temp float) +0:257 'color' ( temp 4-component vector of float) +0:257 Constant: +0:257 0 (const int) +0:258 Branch: Continue +0:261 Post-Increment ( temp 4-component vector of float) +0:261 'color' ( temp 4-component vector of float) +0:262 Branch: Break +0:266 Loop with condition tested first +0:266 Loop Condition +0:266 Compare Less Than ( temp bool) +0:266 direct index ( temp float) +0:266 'color' ( temp 4-component vector of float) +0:266 Constant: +0:266 0 (const int) +0:266 Constant: +0:266 10.000000 +0:266 Loop Body +0:267 Sequence +0:267 add second child into first child ( temp 4-component vector of float) +0:267 'color' ( temp 4-component vector of float) +0:267 'bigColor8' ( uniform 4-component vector of float) +0:269 Test condition and select ( temp void) +0:269 Condition +0:269 Compare Less Than ( temp bool) +0:269 direct index ( temp float) +0:269 'color' ( temp 4-component vector of float) +0:269 Constant: +0:269 2 (const int) +0:269 'd8' ( uniform float) +0:269 true case +0:270 Test condition and select ( temp void) +0:270 Condition +0:270 Compare Less Than ( temp bool) +0:270 direct index ( temp float) +0:270 'color' ( temp 4-component vector of float) +0:270 Constant: +0:270 3 (const int) +0:270 'd6' ( uniform float) +0:270 true case +0:271 Branch: Continue +0:273 add second child into first child ( temp float) +0:273 direct index ( temp float) +0:273 'color' ( temp 4-component vector of float) +0:273 Constant: +0:273 1 (const int) +0:273 direct index ( temp float) +0:273 'bigColor8' ( uniform 4-component vector of float) +0:273 Constant: +0:273 0 (const int) +0:276 Post-Increment ( temp 4-component vector of float) +0:276 'color' ( temp 4-component vector of float) +0:277 move second child to first child ( temp 4-component vector of float) +0:277 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:277 'color' ( temp 4-component vector of float) +0:280 Loop with condition tested first +0:280 Loop Condition +0:280 Compare Less Than ( temp bool) +0:280 direct index ( temp float) +0:280 'color' ( temp 4-component vector of float) +0:280 Constant: +0:280 0 (const int) +0:280 'd14' ( uniform float) +0:280 Loop Body +0:281 Sequence +0:281 Test condition and select ( temp void) +0:281 Condition +0:281 Compare Less Than ( temp bool) +0:281 direct index ( temp float) +0:281 'color' ( temp 4-component vector of float) +0:281 Constant: +0:281 1 (const int) +0:281 'd15' ( uniform float) +0:281 true case +0:282 Sequence +0:282 Branch: Return +0:281 false case +0:285 Post-Increment ( temp 4-component vector of float) +0:285 'color' ( temp 4-component vector of float) +0:288 Post-Increment ( temp 4-component vector of float) +0:288 'color' ( temp 4-component vector of float) +0:290 Loop with condition tested first +0:290 Loop Condition +0:290 Compare Less Than ( temp bool) +0:290 direct index ( temp float) +0:290 'color' ( temp 4-component vector of float) +0:290 Constant: +0:290 3 (const int) +0:290 'd16' ( uniform float) +0:290 Loop Body +0:291 Sequence +0:291 Post-Increment ( temp float) +0:291 direct index ( temp float) +0:291 'color' ( temp 4-component vector of float) +0:291 Constant: +0:291 3 (const int) +0:296 Loop with condition tested first +0:296 Loop Condition +0:296 logical-and ( temp bool) +0:296 Compare Less Than ( temp bool) +0:296 direct index ( temp float) +0:296 'color' ( temp 4-component vector of float) +0:296 Constant: +0:296 3 (const int) +0:296 'd2' ( uniform float) +0:296 Compare Less Than ( temp bool) +0:296 direct index ( temp float) +0:296 'color' ( temp 4-component vector of float) +0:296 Constant: +0:296 1 (const int) +0:296 'd3' ( uniform float) +0:296 Loop Body +0:297 Sequence +0:297 add second child into first child ( temp 4-component vector of float) +0:297 'color' ( temp 4-component vector of float) +0:297 'bigColor1_2' ( uniform 4-component vector of float) +0:298 Test condition and select ( temp void) +0:298 Condition +0:298 Compare Less Than ( temp bool) +0:298 direct index ( temp float) +0:298 'color' ( temp 4-component vector of float) +0:298 Constant: +0:298 2 (const int) +0:298 'd3' ( uniform float) +0:298 true case +0:299 Branch: Return +0:307 Loop with condition not tested first +0:307 Loop Condition +0:307 Compare Less Than ( temp bool) +0:307 direct index ( temp float) +0:307 'color' ( temp 4-component vector of float) +0:307 Constant: +0:307 0 (const int) +0:307 'd17' ( uniform float) +0:307 Loop Body +0:304 Sequence +0:304 Test condition and select ( temp void) +0:304 Condition +0:304 Compare Less Than ( temp bool) +0:304 direct index ( temp float) +0:304 'color' ( temp 4-component vector of float) +0:304 Constant: +0:304 1 (const int) +0:304 'd18' ( uniform float) +0:304 true case +0:305 Branch: Return +0:306 Post-Increment ( temp 4-component vector of float) +0:306 'color' ( temp 4-component vector of float) +0:310 Loop with condition tested first +0:310 Loop Condition +0:310 Compare Less Than ( temp bool) +0:310 direct index ( temp float) +0:310 'color' ( temp 4-component vector of float) +0:310 Constant: +0:310 1 (const int) +0:310 'd16' ( uniform float) +0:310 Loop Body +0:311 Sequence +0:311 Test condition and select ( temp void) +0:311 Condition +0:311 Compare Less Than ( temp bool) +0:311 direct index ( temp float) +0:311 'color' ( temp 4-component vector of float) +0:311 Constant: +0:311 3 (const int) +0:311 'd16' ( uniform float) +0:311 true case +0:312 Sequence +0:312 Branch: Kill +0:311 false case +0:314 Post-Increment ( temp 4-component vector of float) +0:314 'color' ( temp 4-component vector of float) +0:317 Post-Increment ( temp 4-component vector of float) +0:317 'color' ( temp 4-component vector of float) +0:319 move second child to first child ( temp 4-component vector of float) +0:319 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:319 'color' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'bigColor1_1' ( uniform 4-component vector of float) +0:? 'bigColor1_2' ( uniform 4-component vector of float) +0:? 'bigColor1_3' ( uniform 4-component vector of float) +0:? 'bigColor2' ( uniform 4-component vector of float) +0:? 'bigColor3' ( uniform 4-component vector of float) +0:? 'bigColor4' ( uniform 4-component vector of float) +0:? 'bigColor5' ( uniform 4-component vector of float) +0:? 'bigColor6' ( uniform 4-component vector of float) +0:? 'bigColor7' ( uniform 4-component vector of float) +0:? 'bigColor8' ( uniform 4-component vector of float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'd' ( uniform float) +0:? 'd2' ( uniform float) +0:? 'd3' ( uniform float) +0:? 'd4' ( uniform float) +0:? 'd5' ( uniform float) +0:? 'd6' ( uniform float) +0:? 'd7' ( uniform float) +0:? 'd8' ( uniform float) +0:? 'd9' ( uniform float) +0:? 'd10' ( uniform float) +0:? 'd11' ( uniform float) +0:? 'd12' ( uniform float) +0:? 'd13' ( uniform float) +0:? 'd14' ( uniform float) +0:? 'd15' ( uniform float) +0:? 'd16' ( uniform float) +0:? 'd17' ( uniform float) +0:? 'd18' ( uniform float) +0:? 'd19' ( uniform float) +0:? 'd20' ( uniform float) +0:? 'd21' ( uniform float) +0:? 'd22' ( uniform float) +0:? 'd23' ( uniform float) +0:? 'd24' ( uniform float) +0:? 'd25' ( uniform float) +0:? 'd26' ( uniform float) +0:? 'd27' ( uniform float) +0:? 'd28' ( uniform float) +0:? 'd29' ( uniform float) +0:? 'd30' ( uniform float) +0:? 'd31' ( uniform float) +0:? 'd32' ( uniform float) +0:? 'd33' ( uniform float) +0:? 'd34' ( uniform float) +0:? 'Count' ( uniform int) + + +Linked fragment stage: + + +Shader version: 130 +0:? Sequence +0:53 Function Definition: main( ( global void) +0:53 Function Parameters: +0:55 Sequence +0:55 Sequence +0:55 move second child to first child ( temp 4-component vector of float) +0:55 'color' ( temp 4-component vector of float) +0:55 'BaseColor' ( smooth in 4-component vector of float) +0:58 Loop with condition tested first +0:58 Loop Condition +0:58 Constant: +0:58 true (const bool) +0:58 Loop Body +0:59 Sequence +0:59 Test condition and select ( temp void) +0:59 Condition +0:59 Compare Less Than ( temp bool) +0:59 direct index ( temp float) +0:59 'color' ( temp 4-component vector of float) +0:59 Constant: +0:59 0 (const int) +0:59 Constant: +0:59 0.330000 +0:59 true case +0:60 Sequence +0:60 add second child into first child ( temp 4-component vector of float) +0:60 'color' ( temp 4-component vector of float) +0:60 Constant: +0:60 0.330000 +0:60 0.330000 +0:60 0.330000 +0:60 0.330000 +0:61 Branch: Break +0:63 Test condition and select ( temp void) +0:63 Condition +0:63 Compare Less Than ( temp bool) +0:63 direct index ( temp float) +0:63 'color' ( temp 4-component vector of float) +0:63 Constant: +0:63 0 (const int) +0:63 Constant: +0:63 0.660000 +0:63 true case +0:64 Sequence +0:64 add second child into first child ( temp 4-component vector of float) +0:64 'color' ( temp 4-component vector of float) +0:64 Constant: +0:64 0.660000 +0:64 0.660000 +0:64 0.660000 +0:64 0.660000 +0:65 Branch: Break +0:68 add second child into first child ( temp 4-component vector of float) +0:68 'color' ( temp 4-component vector of float) +0:68 Constant: +0:68 0.330000 +0:68 0.330000 +0:68 0.330000 +0:68 0.330000 +0:69 Branch: Break +0:73 Loop with condition tested first +0:73 Loop Condition +0:73 Compare Less Than ( temp bool) +0:73 direct index ( temp float) +0:73 'color' ( temp 4-component vector of float) +0:73 Constant: +0:73 0 (const int) +0:73 'd' ( uniform float) +0:73 Loop Body +0:74 Sequence +0:74 add second child into first child ( temp 4-component vector of float) +0:74 'color' ( temp 4-component vector of float) +0:74 'bigColor' ( uniform 4-component vector of float) +0:78 Loop with condition tested first +0:78 Loop Condition +0:78 Compare Less Than ( temp bool) +0:78 direct index ( temp float) +0:78 'color' ( temp 4-component vector of float) +0:78 Constant: +0:78 2 (const int) +0:78 'd' ( uniform float) +0:78 Loop Body +0:79 Sequence +0:79 add second child into first child ( temp 4-component vector of float) +0:79 'color' ( temp 4-component vector of float) +0:79 'bigColor1_1' ( uniform 4-component vector of float) +0:80 Test condition and select ( temp void) +0:80 Condition +0:80 Compare Less Than ( temp bool) +0:80 direct index ( temp float) +0:80 'color' ( temp 4-component vector of float) +0:80 Constant: +0:80 3 (const int) +0:80 'd' ( uniform float) +0:80 true case +0:81 Branch: Continue +0:83 add second child into first child ( temp 4-component vector of float) +0:83 'color' ( temp 4-component vector of float) +0:83 'bigColor1_1' ( uniform 4-component vector of float) +0:87 Loop with condition tested first +0:87 Loop Condition +0:87 Compare Less Than ( temp bool) +0:87 direct index ( temp float) +0:87 'color' ( temp 4-component vector of float) +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 42.000000 +0:87 Loop Body +0:88 Sequence +0:88 Pre-Increment ( temp 4-component vector of float) +0:88 'color' ( temp 4-component vector of float) +0:92 Loop with condition tested first +0:92 Loop Condition +0:92 logical-and ( temp bool) +0:92 Compare Less Than ( temp bool) +0:92 direct index ( temp float) +0:92 'color' ( temp 4-component vector of float) +0:92 Constant: +0:92 3 (const int) +0:92 'd2' ( uniform float) +0:92 Compare Less Than ( temp bool) +0:92 direct index ( temp float) +0:92 'color' ( temp 4-component vector of float) +0:92 Constant: +0:92 1 (const int) +0:92 'd3' ( uniform float) +0:92 Loop Body +0:93 Sequence +0:93 add second child into first child ( temp 4-component vector of float) +0:93 'color' ( temp 4-component vector of float) +0:93 'bigColor1_2' ( uniform 4-component vector of float) +0:97 Loop with condition tested first +0:97 Loop Condition +0:97 Compare Less Than ( temp bool) +0:97 direct index ( temp float) +0:97 'color' ( temp 4-component vector of float) +0:97 Constant: +0:97 2 (const int) +0:97 'd3' ( uniform float) +0:97 Loop Body +0:98 Sequence +0:98 add second child into first child ( temp 4-component vector of float) +0:98 'color' ( temp 4-component vector of float) +0:98 'bigColor1_3' ( uniform 4-component vector of float) +0:99 Test condition and select ( temp void) +0:99 Condition +0:99 Compare Less Than ( temp bool) +0:99 direct index ( temp float) +0:99 'color' ( temp 4-component vector of float) +0:99 Constant: +0:99 1 (const int) +0:99 'd4' ( uniform float) +0:99 true case +0:100 Branch: Break +0:101 add second child into first child ( temp 4-component vector of float) +0:101 'color' ( temp 4-component vector of float) +0:101 'bigColor1_3' ( uniform 4-component vector of float) +0:105 Sequence +0:105 Sequence +0:105 move second child to first child ( temp int) +0:105 'i' ( temp int) +0:105 Constant: +0:105 0 (const int) +0:105 Loop with condition tested first +0:105 Loop Condition +0:105 Compare Less Than ( temp bool) +0:105 'i' ( temp int) +0:105 'Count' ( uniform int) +0:105 Loop Body +0:106 Sequence +0:106 add second child into first child ( temp 4-component vector of float) +0:106 'color' ( temp 4-component vector of float) +0:106 'bigColor2' ( uniform 4-component vector of float) +0:105 Loop Terminal Expression +0:105 Pre-Increment ( temp int) +0:105 'i' ( temp int) +0:112 Loop with condition not tested first +0:112 Loop Condition +0:112 Compare Less Than ( temp bool) +0:112 direct index ( temp float) +0:112 'color' ( temp 4-component vector of float) +0:112 Constant: +0:112 0 (const int) +0:112 'd2' ( uniform float) +0:112 Loop Body +0:111 Sequence +0:111 add second child into first child ( temp 4-component vector of float) +0:111 'color' ( temp 4-component vector of float) +0:111 'bigColor3' ( uniform 4-component vector of float) +0:115 Sequence +0:115 Sequence +0:115 move second child to first child ( temp int) +0:115 'i' ( temp int) +0:115 Constant: +0:115 0 (const int) +0:115 Loop with condition tested first +0:115 Loop Condition +0:115 Compare Less Than ( temp bool) +0:115 'i' ( temp int) +0:115 Constant: +0:115 42 (const int) +0:115 Loop Body +0:116 Sequence +0:116 add second child into first child ( temp float) +0:116 direct index ( temp float) +0:116 'color' ( temp 4-component vector of float) +0:116 Constant: +0:116 2 (const int) +0:116 'd3' ( uniform float) +0:115 Loop Terminal Expression +0:115 Pre-Increment ( temp int) +0:115 'i' ( temp int) +0:120 Sequence +0:120 Sequence +0:120 move second child to first child ( temp int) +0:120 'i' ( temp int) +0:120 Constant: +0:120 0 (const int) +0:120 Loop with condition tested first +0:120 Loop Condition +0:120 Compare Less Than ( temp bool) +0:120 'i' ( temp int) +0:120 Constant: +0:120 100 (const int) +0:120 Loop Body +0:121 Sequence +0:121 Test condition and select ( temp void) +0:121 Condition +0:121 Compare Less Than ( temp bool) +0:121 direct index ( temp float) +0:121 'color' ( temp 4-component vector of float) +0:121 Constant: +0:121 2 (const int) +0:121 Constant: +0:121 20.000000 +0:121 true case +0:122 Post-Increment ( temp float) +0:122 direct index ( temp float) +0:122 'color' ( temp 4-component vector of float) +0:122 Constant: +0:122 0 (const int) +0:121 false case +0:124 Post-Increment ( temp float) +0:124 direct index ( temp float) +0:124 'color' ( temp 4-component vector of float) +0:124 Constant: +0:124 1 (const int) +0:125 Test condition and select ( temp void) +0:125 Condition +0:125 Compare Less Than ( temp bool) +0:125 direct index ( temp float) +0:125 'color' ( temp 4-component vector of float) +0:125 Constant: +0:125 3 (const int) +0:125 Constant: +0:125 20.000000 +0:125 true case +0:126 Test condition and select ( temp void) +0:126 Condition +0:126 Compare Greater Than ( temp bool) +0:126 direct index ( temp float) +0:126 'color' ( temp 4-component vector of float) +0:126 Constant: +0:126 2 (const int) +0:126 direct index ( temp float) +0:126 'color' ( temp 4-component vector of float) +0:126 Constant: +0:126 1 (const int) +0:126 true case +0:127 Constant: +0:127 0 (const int) +0:120 Loop Terminal Expression +0:120 Pre-Increment ( temp int) +0:120 'i' ( temp int) +0:131 Sequence +0:131 Sequence +0:131 move second child to first child ( temp int) +0:131 'i' ( temp int) +0:131 Constant: +0:131 0 (const int) +0:131 Loop with condition tested first +0:131 Loop Condition +0:131 Compare Less Than ( temp bool) +0:131 'i' ( temp int) +0:131 Constant: +0:131 120 (const int) +0:131 Loop Body +0:132 Sequence +0:132 Test condition and select ( temp void) +0:132 Condition +0:132 Compare Less Than ( temp bool) +0:132 direct index ( temp float) +0:132 'color' ( temp 4-component vector of float) +0:132 Constant: +0:132 2 (const int) +0:132 Constant: +0:132 20.000000 +0:132 true case +0:133 Post-Increment ( temp float) +0:133 direct index ( temp float) +0:133 'color' ( temp 4-component vector of float) +0:133 Constant: +0:133 0 (const int) +0:132 false case +0:135 Post-Increment ( temp float) +0:135 direct index ( temp float) +0:135 'color' ( temp 4-component vector of float) +0:135 Constant: +0:135 1 (const int) +0:131 Loop Terminal Expression +0:131 Pre-Increment ( temp int) +0:131 'i' ( temp int) +0:139 Sequence +0:139 Sequence +0:139 move second child to first child ( temp int) +0:139 'i' ( temp int) +0:139 Constant: +0:139 0 (const int) +0:139 Loop with condition tested first +0:139 Loop Condition +0:139 Compare Less Than ( temp bool) +0:139 'i' ( temp int) +0:139 Constant: +0:139 42 (const int) +0:139 Loop Body +0:140 Sequence +0:140 add second child into first child ( temp float) +0:140 direct index ( temp float) +0:140 'color' ( temp 4-component vector of float) +0:140 Constant: +0:140 2 (const int) +0:140 'd3' ( uniform float) +0:141 Test condition and select ( temp void) +0:141 Condition +0:141 Compare Less Than ( temp bool) +0:141 direct index ( temp float) +0:141 'color' ( temp 4-component vector of float) +0:141 Constant: +0:141 0 (const int) +0:141 'd4' ( uniform float) +0:141 true case +0:142 Branch: Continue +0:143 Pre-Increment ( temp float) +0:143 direct index ( temp float) +0:143 'color' ( temp 4-component vector of float) +0:143 Constant: +0:143 3 (const int) +0:139 Loop Terminal Expression +0:139 Pre-Increment ( temp int) +0:139 'i' ( temp int) +0:147 Sequence +0:147 Sequence +0:147 move second child to first child ( temp int) +0:147 'i' ( temp int) +0:147 Constant: +0:147 0 (const int) +0:147 Loop with condition tested first +0:147 Loop Condition +0:147 Compare Less Than ( temp bool) +0:147 'i' ( temp int) +0:147 Constant: +0:147 42 (const int) +0:147 Loop Body +0:148 Sequence +0:148 add second child into first child ( temp float) +0:148 direct index ( temp float) +0:148 'color' ( temp 4-component vector of float) +0:148 Constant: +0:148 2 (const int) +0:148 'd3' ( uniform float) +0:149 Test condition and select ( temp void) +0:149 Condition +0:149 Compare Less Than ( temp bool) +0:149 direct index ( temp float) +0:149 'color' ( temp 4-component vector of float) +0:149 Constant: +0:149 0 (const int) +0:149 'd4' ( uniform float) +0:149 true case +0:150 Branch: Break +0:151 Pre-Increment ( temp float) +0:151 direct index ( temp float) +0:151 'color' ( temp 4-component vector of float) +0:151 Constant: +0:151 3 (const int) +0:147 Loop Terminal Expression +0:147 Pre-Increment ( temp int) +0:147 'i' ( temp int) +0:163 Loop with condition not tested first +0:163 Loop Condition +0:163 Compare Less Than ( temp bool) +0:163 direct index ( temp float) +0:163 'color' ( temp 4-component vector of float) +0:163 Constant: +0:163 2 (const int) +0:163 'd4' ( uniform float) +0:163 Loop Body +0:156 Sequence +0:156 add second child into first child ( temp 4-component vector of float) +0:156 'color' ( temp 4-component vector of float) +0:156 'bigColor4' ( uniform 4-component vector of float) +0:157 Test condition and select ( temp void) +0:157 Condition +0:157 Compare Less Than ( temp bool) +0:157 direct index ( temp float) +0:157 'color' ( temp 4-component vector of float) +0:157 Constant: +0:157 0 (const int) +0:157 'd4' ( uniform float) +0:157 true case +0:158 Branch: Continue +0:159 Test condition and select ( temp void) +0:159 Condition +0:159 Compare Less Than ( temp bool) +0:159 direct index ( temp float) +0:159 'color' ( temp 4-component vector of float) +0:159 Constant: +0:159 1 (const int) +0:159 'd4' ( uniform float) +0:159 true case +0:160 add second child into first child ( temp float) +0:160 direct index ( temp float) +0:160 'color' ( temp 4-component vector of float) +0:160 Constant: +0:160 1 (const int) +0:160 'd4' ( uniform float) +0:159 false case +0:162 add second child into first child ( temp float) +0:162 direct index ( temp float) +0:162 'color' ( temp 4-component vector of float) +0:162 Constant: +0:162 0 (const int) +0:162 'd4' ( uniform float) +0:170 Loop with condition not tested first +0:170 Loop Condition +0:170 Compare Less Than ( temp bool) +0:170 direct index ( temp float) +0:170 'color' ( temp 4-component vector of float) +0:170 Constant: +0:170 0 (const int) +0:170 'd5' ( uniform float) +0:170 Loop Body +0:167 Sequence +0:167 add second child into first child ( temp 4-component vector of float) +0:167 'color' ( temp 4-component vector of float) +0:167 'bigColor5' ( uniform 4-component vector of float) +0:168 Test condition and select ( temp void) +0:168 Condition +0:168 Compare Less Than ( temp bool) +0:168 direct index ( temp float) +0:168 'color' ( temp 4-component vector of float) +0:168 Constant: +0:168 1 (const int) +0:168 'd5' ( uniform float) +0:168 true case +0:169 add second child into first child ( temp float) +0:169 direct index ( temp float) +0:169 'color' ( temp 4-component vector of float) +0:169 Constant: +0:169 1 (const int) +0:169 'd5' ( uniform float) +0:173 Test condition and select ( temp void) +0:173 Condition +0:173 Compare Less Than ( temp bool) +0:173 direct index ( temp float) +0:173 'color' ( temp 4-component vector of float) +0:173 Constant: +0:173 0 (const int) +0:173 'd6' ( uniform float) +0:173 true case +0:174 Sequence +0:174 Loop with condition tested first +0:174 Loop Condition +0:174 Compare Less Than ( temp bool) +0:174 direct index ( temp float) +0:174 'color' ( temp 4-component vector of float) +0:174 Constant: +0:174 1 (const int) +0:174 'd6' ( uniform float) +0:174 Loop Body +0:175 add second child into first child ( temp 4-component vector of float) +0:175 'color' ( temp 4-component vector of float) +0:175 'bigColor6' ( uniform 4-component vector of float) +0:173 false case +0:177 Sequence +0:177 Loop with condition tested first +0:177 Loop Condition +0:177 Compare Less Than ( temp bool) +0:177 direct index ( temp float) +0:177 'color' ( temp 4-component vector of float) +0:177 Constant: +0:177 2 (const int) +0:177 'd6' ( uniform float) +0:177 Loop Body +0:178 add second child into first child ( temp float) +0:178 direct index ( temp float) +0:178 'color' ( temp 4-component vector of float) +0:178 Constant: +0:178 2 (const int) +0:178 direct index ( temp float) +0:178 'bigColor6' ( uniform 4-component vector of float) +0:178 Constant: +0:178 2 (const int) +0:182 Test condition and select ( temp void) +0:182 Condition +0:182 Compare Less Than ( temp bool) +0:182 direct index ( temp float) +0:182 'color' ( temp 4-component vector of float) +0:182 Constant: +0:182 0 (const int) +0:182 'd6' ( uniform float) +0:182 true case +0:183 Sequence +0:183 Loop with condition tested first +0:183 Loop Condition +0:183 Compare Less Than ( temp bool) +0:183 direct index ( temp float) +0:183 'color' ( temp 4-component vector of float) +0:183 Constant: +0:183 1 (const int) +0:183 'd6' ( uniform float) +0:183 Loop Body +0:184 Sequence +0:184 add second child into first child ( temp 4-component vector of float) +0:184 'color' ( temp 4-component vector of float) +0:184 'bigColor6' ( uniform 4-component vector of float) +0:185 Test condition and select ( temp void) +0:185 Condition +0:185 Compare Less Than ( temp bool) +0:185 'd7' ( uniform float) +0:185 Constant: +0:185 1.000000 +0:185 true case +0:186 Branch: Break +0:182 false case +0:190 Sequence +0:190 Loop with condition tested first +0:190 Loop Condition +0:190 Compare Less Than ( temp bool) +0:190 direct index ( temp float) +0:190 'color' ( temp 4-component vector of float) +0:190 Constant: +0:190 2 (const int) +0:190 'd6' ( uniform float) +0:190 Loop Body +0:191 add second child into first child ( temp float) +0:191 direct index ( temp float) +0:191 'color' ( temp 4-component vector of float) +0:191 Constant: +0:191 2 (const int) +0:191 direct index ( temp float) +0:191 'bigColor6' ( uniform 4-component vector of float) +0:191 Constant: +0:191 2 (const int) +0:209 Loop with condition not tested first +0:209 Loop Condition +0:209 Constant: +0:209 true (const bool) +0:209 Loop Body +0:197 Sequence +0:197 Test condition and select ( temp void) +0:197 Condition +0:197 Compare Less Than ( temp bool) +0:197 'd7' ( uniform float) +0:197 Constant: +0:197 0.000000 +0:197 true case +0:198 Branch: Break +0:200 add second child into first child ( temp 4-component vector of float) +0:200 'color' ( temp 4-component vector of float) +0:200 'bigColor7' ( uniform 4-component vector of float) +0:202 Test condition and select ( temp void) +0:202 Condition +0:202 Compare Less Than ( temp bool) +0:202 'd7' ( uniform float) +0:202 Constant: +0:202 1.000000 +0:202 true case +0:203 Sequence +0:203 Post-Increment ( temp float) +0:203 direct index ( temp float) +0:203 'color' ( temp 4-component vector of float) +0:203 Constant: +0:203 2 (const int) +0:204 Branch: Break +0:207 add second child into first child ( temp 4-component vector of float) +0:207 'color' ( temp 4-component vector of float) +0:207 'BaseColor' ( smooth in 4-component vector of float) +0:234 Loop with condition not tested first +0:234 Loop Condition +0:234 Compare Less Than ( temp bool) +0:234 direct index ( temp float) +0:234 'color' ( temp 4-component vector of float) +0:234 Constant: +0:234 2 (const int) +0:234 'd8' ( uniform float) +0:234 Loop Body +0:217 Sequence +0:217 Test condition and select ( temp void) +0:217 Condition +0:217 Compare Less Than ( temp bool) +0:217 'd8' ( uniform float) +0:217 Constant: +0:217 0.000000 +0:217 true case +0:218 Branch: Break +0:220 add second child into first child ( temp 4-component vector of float) +0:220 'color' ( temp 4-component vector of float) +0:220 'bigColor7' ( uniform 4-component vector of float) +0:222 Test condition and select ( temp void) +0:222 Condition +0:222 Compare Less Than ( temp bool) +0:222 'd8' ( uniform float) +0:222 Constant: +0:222 1.000000 +0:222 true case +0:223 Sequence +0:223 Post-Increment ( temp float) +0:223 direct index ( temp float) +0:223 'color' ( temp 4-component vector of float) +0:223 Constant: +0:223 2 (const int) +0:224 Test condition and select ( temp void) +0:224 Condition +0:224 Compare Less Than ( temp bool) +0:224 'd8' ( uniform float) +0:224 Constant: +0:224 2.000000 +0:224 true case +0:225 Sequence +0:225 Post-Increment ( temp float) +0:225 direct index ( temp float) +0:225 'color' ( temp 4-component vector of float) +0:225 Constant: +0:225 1 (const int) +0:224 false case +0:227 Sequence +0:227 Post-Increment ( temp float) +0:227 direct index ( temp float) +0:227 'color' ( temp 4-component vector of float) +0:227 Constant: +0:227 0 (const int) +0:229 Branch: Break +0:232 add second child into first child ( temp 4-component vector of float) +0:232 'color' ( temp 4-component vector of float) +0:232 'BaseColor' ( smooth in 4-component vector of float) +0:237 Loop with condition tested first +0:237 Loop Condition +0:237 Compare Less Than ( temp bool) +0:237 direct index ( temp float) +0:237 'color' ( temp 4-component vector of float) +0:237 Constant: +0:237 3 (const int) +0:237 'd9' ( uniform float) +0:237 Loop Body +0:238 Sequence +0:238 Test condition and select ( temp void) +0:238 Condition +0:238 Compare Greater Than ( temp bool) +0:238 'd9' ( uniform float) +0:238 'd8' ( uniform float) +0:238 true case +0:239 Sequence +0:239 Test condition and select ( temp void) +0:239 Condition +0:239 Compare Less Than or Equal ( temp bool) +0:239 direct index ( temp float) +0:239 'color' ( temp 4-component vector of float) +0:239 Constant: +0:239 0 (const int) +0:239 'd7' ( uniform float) +0:239 true case +0:240 Sequence +0:240 Test condition and select ( temp void) +0:240 Condition +0:240 Compare Equal ( temp bool) +0:240 direct index ( temp float) +0:240 'color' ( temp 4-component vector of float) +0:240 Constant: +0:240 2 (const int) +0:240 Constant: +0:240 5.000000 +0:240 true case +0:241 Post-Increment ( temp float) +0:241 direct index ( temp float) +0:241 'color' ( temp 4-component vector of float) +0:241 Constant: +0:241 3 (const int) +0:240 false case +0:243 Branch: Break +0:250 Loop with condition tested first +0:250 Loop Condition +0:250 Compare Less Than ( temp bool) +0:250 direct index ( temp float) +0:250 'color' ( temp 4-component vector of float) +0:250 Constant: +0:250 2 (const int) +0:250 'd10' ( uniform float) +0:250 Loop Body +0:251 Sequence +0:251 Post-Increment ( temp float) +0:251 direct index ( temp float) +0:251 'color' ( temp 4-component vector of float) +0:251 Constant: +0:251 1 (const int) +0:252 Test condition and select ( temp void) +0:252 Condition +0:252 Compare Less Than ( temp bool) +0:252 direct index ( temp float) +0:252 'color' ( temp 4-component vector of float) +0:252 Constant: +0:252 1 (const int) +0:252 'd11' ( uniform float) +0:252 true case +0:253 Sequence +0:253 Post-Increment ( temp float) +0:253 direct index ( temp float) +0:253 'color' ( temp 4-component vector of float) +0:253 Constant: +0:253 2 (const int) +0:254 Test condition and select ( temp void) +0:254 Condition +0:254 Compare Less Than ( temp bool) +0:254 direct index ( temp float) +0:254 'color' ( temp 4-component vector of float) +0:254 Constant: +0:254 3 (const int) +0:254 'd12' ( uniform float) +0:254 true case +0:255 Post-Increment ( temp float) +0:255 direct index ( temp float) +0:255 'color' ( temp 4-component vector of float) +0:255 Constant: +0:255 3 (const int) +0:254 false case +0:257 Post-Increment ( temp float) +0:257 direct index ( temp float) +0:257 'color' ( temp 4-component vector of float) +0:257 Constant: +0:257 0 (const int) +0:258 Branch: Continue +0:261 Post-Increment ( temp 4-component vector of float) +0:261 'color' ( temp 4-component vector of float) +0:262 Branch: Break +0:266 Loop with condition tested first +0:266 Loop Condition +0:266 Compare Less Than ( temp bool) +0:266 direct index ( temp float) +0:266 'color' ( temp 4-component vector of float) +0:266 Constant: +0:266 0 (const int) +0:266 Constant: +0:266 10.000000 +0:266 Loop Body +0:267 Sequence +0:267 add second child into first child ( temp 4-component vector of float) +0:267 'color' ( temp 4-component vector of float) +0:267 'bigColor8' ( uniform 4-component vector of float) +0:269 Test condition and select ( temp void) +0:269 Condition +0:269 Compare Less Than ( temp bool) +0:269 direct index ( temp float) +0:269 'color' ( temp 4-component vector of float) +0:269 Constant: +0:269 2 (const int) +0:269 'd8' ( uniform float) +0:269 true case +0:270 Test condition and select ( temp void) +0:270 Condition +0:270 Compare Less Than ( temp bool) +0:270 direct index ( temp float) +0:270 'color' ( temp 4-component vector of float) +0:270 Constant: +0:270 3 (const int) +0:270 'd6' ( uniform float) +0:270 true case +0:271 Branch: Continue +0:273 add second child into first child ( temp float) +0:273 direct index ( temp float) +0:273 'color' ( temp 4-component vector of float) +0:273 Constant: +0:273 1 (const int) +0:273 direct index ( temp float) +0:273 'bigColor8' ( uniform 4-component vector of float) +0:273 Constant: +0:273 0 (const int) +0:276 Post-Increment ( temp 4-component vector of float) +0:276 'color' ( temp 4-component vector of float) +0:277 move second child to first child ( temp 4-component vector of float) +0:277 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:277 'color' ( temp 4-component vector of float) +0:280 Loop with condition tested first +0:280 Loop Condition +0:280 Compare Less Than ( temp bool) +0:280 direct index ( temp float) +0:280 'color' ( temp 4-component vector of float) +0:280 Constant: +0:280 0 (const int) +0:280 'd14' ( uniform float) +0:280 Loop Body +0:281 Sequence +0:281 Test condition and select ( temp void) +0:281 Condition +0:281 Compare Less Than ( temp bool) +0:281 direct index ( temp float) +0:281 'color' ( temp 4-component vector of float) +0:281 Constant: +0:281 1 (const int) +0:281 'd15' ( uniform float) +0:281 true case +0:282 Sequence +0:282 Branch: Return +0:281 false case +0:285 Post-Increment ( temp 4-component vector of float) +0:285 'color' ( temp 4-component vector of float) +0:288 Post-Increment ( temp 4-component vector of float) +0:288 'color' ( temp 4-component vector of float) +0:290 Loop with condition tested first +0:290 Loop Condition +0:290 Compare Less Than ( temp bool) +0:290 direct index ( temp float) +0:290 'color' ( temp 4-component vector of float) +0:290 Constant: +0:290 3 (const int) +0:290 'd16' ( uniform float) +0:290 Loop Body +0:291 Sequence +0:291 Post-Increment ( temp float) +0:291 direct index ( temp float) +0:291 'color' ( temp 4-component vector of float) +0:291 Constant: +0:291 3 (const int) +0:296 Loop with condition tested first +0:296 Loop Condition +0:296 logical-and ( temp bool) +0:296 Compare Less Than ( temp bool) +0:296 direct index ( temp float) +0:296 'color' ( temp 4-component vector of float) +0:296 Constant: +0:296 3 (const int) +0:296 'd2' ( uniform float) +0:296 Compare Less Than ( temp bool) +0:296 direct index ( temp float) +0:296 'color' ( temp 4-component vector of float) +0:296 Constant: +0:296 1 (const int) +0:296 'd3' ( uniform float) +0:296 Loop Body +0:297 Sequence +0:297 add second child into first child ( temp 4-component vector of float) +0:297 'color' ( temp 4-component vector of float) +0:297 'bigColor1_2' ( uniform 4-component vector of float) +0:298 Test condition and select ( temp void) +0:298 Condition +0:298 Compare Less Than ( temp bool) +0:298 direct index ( temp float) +0:298 'color' ( temp 4-component vector of float) +0:298 Constant: +0:298 2 (const int) +0:298 'd3' ( uniform float) +0:298 true case +0:299 Branch: Return +0:307 Loop with condition not tested first +0:307 Loop Condition +0:307 Compare Less Than ( temp bool) +0:307 direct index ( temp float) +0:307 'color' ( temp 4-component vector of float) +0:307 Constant: +0:307 0 (const int) +0:307 'd17' ( uniform float) +0:307 Loop Body +0:304 Sequence +0:304 Test condition and select ( temp void) +0:304 Condition +0:304 Compare Less Than ( temp bool) +0:304 direct index ( temp float) +0:304 'color' ( temp 4-component vector of float) +0:304 Constant: +0:304 1 (const int) +0:304 'd18' ( uniform float) +0:304 true case +0:305 Branch: Return +0:306 Post-Increment ( temp 4-component vector of float) +0:306 'color' ( temp 4-component vector of float) +0:310 Loop with condition tested first +0:310 Loop Condition +0:310 Compare Less Than ( temp bool) +0:310 direct index ( temp float) +0:310 'color' ( temp 4-component vector of float) +0:310 Constant: +0:310 1 (const int) +0:310 'd16' ( uniform float) +0:310 Loop Body +0:311 Sequence +0:311 Test condition and select ( temp void) +0:311 Condition +0:311 Compare Less Than ( temp bool) +0:311 direct index ( temp float) +0:311 'color' ( temp 4-component vector of float) +0:311 Constant: +0:311 3 (const int) +0:311 'd16' ( uniform float) +0:311 true case +0:312 Sequence +0:312 Branch: Kill +0:311 false case +0:314 Post-Increment ( temp 4-component vector of float) +0:314 'color' ( temp 4-component vector of float) +0:317 Post-Increment ( temp 4-component vector of float) +0:317 'color' ( temp 4-component vector of float) +0:319 move second child to first child ( temp 4-component vector of float) +0:319 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:319 'color' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'bigColor1_1' ( uniform 4-component vector of float) +0:? 'bigColor1_2' ( uniform 4-component vector of float) +0:? 'bigColor1_3' ( uniform 4-component vector of float) +0:? 'bigColor2' ( uniform 4-component vector of float) +0:? 'bigColor3' ( uniform 4-component vector of float) +0:? 'bigColor4' ( uniform 4-component vector of float) +0:? 'bigColor5' ( uniform 4-component vector of float) +0:? 'bigColor6' ( uniform 4-component vector of float) +0:? 'bigColor7' ( uniform 4-component vector of float) +0:? 'bigColor8' ( uniform 4-component vector of float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'd' ( uniform float) +0:? 'd2' ( uniform float) +0:? 'd3' ( uniform float) +0:? 'd4' ( uniform float) +0:? 'd5' ( uniform float) +0:? 'd6' ( uniform float) +0:? 'd7' ( uniform float) +0:? 'd8' ( uniform float) +0:? 'd9' ( uniform float) +0:? 'd10' ( uniform float) +0:? 'd11' ( uniform float) +0:? 'd12' ( uniform float) +0:? 'd13' ( uniform float) +0:? 'd14' ( uniform float) +0:? 'd15' ( uniform float) +0:? 'd16' ( uniform float) +0:? 'd17' ( uniform float) +0:? 'd18' ( uniform float) +0:? 'd19' ( uniform float) +0:? 'd20' ( uniform float) +0:? 'd21' ( uniform float) +0:? 'd22' ( uniform float) +0:? 'd23' ( uniform float) +0:? 'd24' ( uniform float) +0:? 'd25' ( uniform float) +0:? 'd26' ( uniform float) +0:? 'd27' ( uniform float) +0:? 'd28' ( uniform float) +0:? 'd29' ( uniform float) +0:? 'd30' ( uniform float) +0:? 'd31' ( uniform float) +0:? 'd32' ( uniform float) +0:? 'd33' ( uniform float) +0:? 'd34' ( uniform float) +0:? 'Count' ( uniform int) + diff --git a/deps/glslang/Test/baseResults/loopsArtificial.frag.out b/deps/glslang/Test/baseResults/loopsArtificial.frag.out new file mode 100644 index 00000000..0bb61c9a --- /dev/null +++ b/deps/glslang/Test/baseResults/loopsArtificial.frag.out @@ -0,0 +1,433 @@ +loopsArtificial.frag +WARNING: 0:14: varying deprecated in version 130; may be removed in future release + +Shader version: 130 +0:? Sequence +0:53 Function Definition: main( ( global void) +0:53 Function Parameters: +0:55 Sequence +0:55 Sequence +0:55 move second child to first child ( temp 4-component vector of float) +0:55 'color' ( temp 4-component vector of float) +0:55 'BaseColor' ( smooth in 4-component vector of float) +0:71 Loop with condition not tested first +0:71 Loop Condition +0:71 Compare Less Than ( temp bool) +0:71 direct index ( temp float) +0:71 'color' ( temp 4-component vector of float) +0:71 Constant: +0:71 2 (const int) +0:71 'd4' ( uniform float) +0:71 Loop Body +0:59 Sequence +0:59 add second child into first child ( temp 4-component vector of float) +0:59 'color' ( temp 4-component vector of float) +0:59 'bigColor4' ( uniform 4-component vector of float) +0:60 Test condition and select ( temp void) +0:60 Condition +0:60 Compare Less Than ( temp bool) +0:60 direct index ( temp float) +0:60 'color' ( temp 4-component vector of float) +0:60 Constant: +0:60 0 (const int) +0:60 'd4' ( uniform float) +0:60 true case +0:61 Sequence +0:61 add second child into first child ( temp float) +0:61 direct index ( temp float) +0:61 'color' ( temp 4-component vector of float) +0:61 Constant: +0:61 2 (const int) +0:61 Constant: +0:61 2.000000 +0:62 Test condition and select ( temp void) +0:62 Condition +0:62 Compare Less Than ( temp bool) +0:62 direct index ( temp float) +0:62 'color' ( temp 4-component vector of float) +0:62 Constant: +0:62 2 (const int) +0:62 'd4' ( uniform float) +0:62 true case +0:63 Sequence +0:63 Post-Increment ( temp float) +0:63 direct index ( temp float) +0:63 'color' ( temp 4-component vector of float) +0:63 Constant: +0:63 0 (const int) +0:64 Branch: Continue +0:67 Test condition and select ( temp void) +0:67 Condition +0:67 Compare Less Than ( temp bool) +0:67 direct index ( temp float) +0:67 'color' ( temp 4-component vector of float) +0:67 Constant: +0:67 1 (const int) +0:67 'd4' ( uniform float) +0:67 true case +0:68 add second child into first child ( temp float) +0:68 direct index ( temp float) +0:68 'color' ( temp 4-component vector of float) +0:68 Constant: +0:68 1 (const int) +0:68 'd4' ( uniform float) +0:67 false case +0:70 add second child into first child ( temp float) +0:70 direct index ( temp float) +0:70 'color' ( temp 4-component vector of float) +0:70 Constant: +0:70 0 (const int) +0:70 'd4' ( uniform float) +0:74 Loop with condition tested first +0:74 Loop Condition +0:74 Compare Less Than ( temp bool) +0:74 direct index ( temp float) +0:74 'color' ( temp 4-component vector of float) +0:74 Constant: +0:74 3 (const int) +0:74 'd13' ( uniform float) +0:74 Loop Body +0:75 Sequence +0:75 Test condition and select ( temp void) +0:75 Condition +0:75 Compare Less Than ( temp bool) +0:75 direct index ( temp float) +0:75 'color' ( temp 4-component vector of float) +0:75 Constant: +0:75 2 (const int) +0:75 'd13' ( uniform float) +0:75 true case +0:76 Post-Increment ( temp 4-component vector of float) +0:76 'color' ( temp 4-component vector of float) +0:75 false case +0:78 Post-Decrement ( temp 4-component vector of float) +0:78 'color' ( temp 4-component vector of float) +0:80 add second child into first child ( temp 4-component vector of float) +0:80 'color' ( temp 4-component vector of float) +0:80 'bigColor4' ( uniform 4-component vector of float) +0:81 Test condition and select ( temp void) +0:81 Condition +0:81 Compare Less Than ( temp bool) +0:81 direct index ( temp float) +0:81 'color' ( temp 4-component vector of float) +0:81 Constant: +0:81 0 (const int) +0:81 'd4' ( uniform float) +0:81 true case +0:82 Sequence +0:82 add second child into first child ( temp float) +0:82 direct index ( temp float) +0:82 'color' ( temp 4-component vector of float) +0:82 Constant: +0:82 2 (const int) +0:82 Constant: +0:82 2.000000 +0:83 Test condition and select ( temp void) +0:83 Condition +0:83 Compare Less Than ( temp bool) +0:83 direct index ( temp float) +0:83 'color' ( temp 4-component vector of float) +0:83 Constant: +0:83 2 (const int) +0:83 'd4' ( uniform float) +0:83 true case +0:84 Sequence +0:84 Post-Increment ( temp float) +0:84 direct index ( temp float) +0:84 'color' ( temp 4-component vector of float) +0:84 Constant: +0:84 0 (const int) +0:85 Branch: Continue +0:88 Test condition and select ( temp void) +0:88 Condition +0:88 Compare Less Than ( temp bool) +0:88 direct index ( temp float) +0:88 'color' ( temp 4-component vector of float) +0:88 Constant: +0:88 1 (const int) +0:88 'd4' ( uniform float) +0:88 true case +0:89 add second child into first child ( temp float) +0:89 direct index ( temp float) +0:89 'color' ( temp 4-component vector of float) +0:89 Constant: +0:89 1 (const int) +0:89 'd4' ( uniform float) +0:88 false case +0:91 add second child into first child ( temp float) +0:91 direct index ( temp float) +0:91 'color' ( temp 4-component vector of float) +0:91 Constant: +0:91 0 (const int) +0:91 'd4' ( uniform float) +0:94 Post-Increment ( temp 4-component vector of float) +0:94 'color' ( temp 4-component vector of float) +0:95 move second child to first child ( temp 4-component vector of float) +0:95 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:95 'color' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'bigColor1_1' ( uniform 4-component vector of float) +0:? 'bigColor1_2' ( uniform 4-component vector of float) +0:? 'bigColor1_3' ( uniform 4-component vector of float) +0:? 'bigColor2' ( uniform 4-component vector of float) +0:? 'bigColor3' ( uniform 4-component vector of float) +0:? 'bigColor4' ( uniform 4-component vector of float) +0:? 'bigColor5' ( uniform 4-component vector of float) +0:? 'bigColor6' ( uniform 4-component vector of float) +0:? 'bigColor7' ( uniform 4-component vector of float) +0:? 'bigColor8' ( uniform 4-component vector of float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'd' ( uniform float) +0:? 'd2' ( uniform float) +0:? 'd3' ( uniform float) +0:? 'd4' ( uniform float) +0:? 'd5' ( uniform float) +0:? 'd6' ( uniform float) +0:? 'd7' ( uniform float) +0:? 'd8' ( uniform float) +0:? 'd9' ( uniform float) +0:? 'd10' ( uniform float) +0:? 'd11' ( uniform float) +0:? 'd12' ( uniform float) +0:? 'd13' ( uniform float) +0:? 'd14' ( uniform float) +0:? 'd15' ( uniform float) +0:? 'd16' ( uniform float) +0:? 'd17' ( uniform float) +0:? 'd18' ( uniform float) +0:? 'd19' ( uniform float) +0:? 'd20' ( uniform float) +0:? 'd21' ( uniform float) +0:? 'd22' ( uniform float) +0:? 'd23' ( uniform float) +0:? 'd24' ( uniform float) +0:? 'd25' ( uniform float) +0:? 'd26' ( uniform float) +0:? 'd27' ( uniform float) +0:? 'd28' ( uniform float) +0:? 'd29' ( uniform float) +0:? 'd30' ( uniform float) +0:? 'd31' ( uniform float) +0:? 'd32' ( uniform float) +0:? 'd33' ( uniform float) +0:? 'd34' ( uniform float) +0:? 'Count' ( uniform int) + + +Linked fragment stage: + + +Shader version: 130 +0:? Sequence +0:53 Function Definition: main( ( global void) +0:53 Function Parameters: +0:55 Sequence +0:55 Sequence +0:55 move second child to first child ( temp 4-component vector of float) +0:55 'color' ( temp 4-component vector of float) +0:55 'BaseColor' ( smooth in 4-component vector of float) +0:71 Loop with condition not tested first +0:71 Loop Condition +0:71 Compare Less Than ( temp bool) +0:71 direct index ( temp float) +0:71 'color' ( temp 4-component vector of float) +0:71 Constant: +0:71 2 (const int) +0:71 'd4' ( uniform float) +0:71 Loop Body +0:59 Sequence +0:59 add second child into first child ( temp 4-component vector of float) +0:59 'color' ( temp 4-component vector of float) +0:59 'bigColor4' ( uniform 4-component vector of float) +0:60 Test condition and select ( temp void) +0:60 Condition +0:60 Compare Less Than ( temp bool) +0:60 direct index ( temp float) +0:60 'color' ( temp 4-component vector of float) +0:60 Constant: +0:60 0 (const int) +0:60 'd4' ( uniform float) +0:60 true case +0:61 Sequence +0:61 add second child into first child ( temp float) +0:61 direct index ( temp float) +0:61 'color' ( temp 4-component vector of float) +0:61 Constant: +0:61 2 (const int) +0:61 Constant: +0:61 2.000000 +0:62 Test condition and select ( temp void) +0:62 Condition +0:62 Compare Less Than ( temp bool) +0:62 direct index ( temp float) +0:62 'color' ( temp 4-component vector of float) +0:62 Constant: +0:62 2 (const int) +0:62 'd4' ( uniform float) +0:62 true case +0:63 Sequence +0:63 Post-Increment ( temp float) +0:63 direct index ( temp float) +0:63 'color' ( temp 4-component vector of float) +0:63 Constant: +0:63 0 (const int) +0:64 Branch: Continue +0:67 Test condition and select ( temp void) +0:67 Condition +0:67 Compare Less Than ( temp bool) +0:67 direct index ( temp float) +0:67 'color' ( temp 4-component vector of float) +0:67 Constant: +0:67 1 (const int) +0:67 'd4' ( uniform float) +0:67 true case +0:68 add second child into first child ( temp float) +0:68 direct index ( temp float) +0:68 'color' ( temp 4-component vector of float) +0:68 Constant: +0:68 1 (const int) +0:68 'd4' ( uniform float) +0:67 false case +0:70 add second child into first child ( temp float) +0:70 direct index ( temp float) +0:70 'color' ( temp 4-component vector of float) +0:70 Constant: +0:70 0 (const int) +0:70 'd4' ( uniform float) +0:74 Loop with condition tested first +0:74 Loop Condition +0:74 Compare Less Than ( temp bool) +0:74 direct index ( temp float) +0:74 'color' ( temp 4-component vector of float) +0:74 Constant: +0:74 3 (const int) +0:74 'd13' ( uniform float) +0:74 Loop Body +0:75 Sequence +0:75 Test condition and select ( temp void) +0:75 Condition +0:75 Compare Less Than ( temp bool) +0:75 direct index ( temp float) +0:75 'color' ( temp 4-component vector of float) +0:75 Constant: +0:75 2 (const int) +0:75 'd13' ( uniform float) +0:75 true case +0:76 Post-Increment ( temp 4-component vector of float) +0:76 'color' ( temp 4-component vector of float) +0:75 false case +0:78 Post-Decrement ( temp 4-component vector of float) +0:78 'color' ( temp 4-component vector of float) +0:80 add second child into first child ( temp 4-component vector of float) +0:80 'color' ( temp 4-component vector of float) +0:80 'bigColor4' ( uniform 4-component vector of float) +0:81 Test condition and select ( temp void) +0:81 Condition +0:81 Compare Less Than ( temp bool) +0:81 direct index ( temp float) +0:81 'color' ( temp 4-component vector of float) +0:81 Constant: +0:81 0 (const int) +0:81 'd4' ( uniform float) +0:81 true case +0:82 Sequence +0:82 add second child into first child ( temp float) +0:82 direct index ( temp float) +0:82 'color' ( temp 4-component vector of float) +0:82 Constant: +0:82 2 (const int) +0:82 Constant: +0:82 2.000000 +0:83 Test condition and select ( temp void) +0:83 Condition +0:83 Compare Less Than ( temp bool) +0:83 direct index ( temp float) +0:83 'color' ( temp 4-component vector of float) +0:83 Constant: +0:83 2 (const int) +0:83 'd4' ( uniform float) +0:83 true case +0:84 Sequence +0:84 Post-Increment ( temp float) +0:84 direct index ( temp float) +0:84 'color' ( temp 4-component vector of float) +0:84 Constant: +0:84 0 (const int) +0:85 Branch: Continue +0:88 Test condition and select ( temp void) +0:88 Condition +0:88 Compare Less Than ( temp bool) +0:88 direct index ( temp float) +0:88 'color' ( temp 4-component vector of float) +0:88 Constant: +0:88 1 (const int) +0:88 'd4' ( uniform float) +0:88 true case +0:89 add second child into first child ( temp float) +0:89 direct index ( temp float) +0:89 'color' ( temp 4-component vector of float) +0:89 Constant: +0:89 1 (const int) +0:89 'd4' ( uniform float) +0:88 false case +0:91 add second child into first child ( temp float) +0:91 direct index ( temp float) +0:91 'color' ( temp 4-component vector of float) +0:91 Constant: +0:91 0 (const int) +0:91 'd4' ( uniform float) +0:94 Post-Increment ( temp 4-component vector of float) +0:94 'color' ( temp 4-component vector of float) +0:95 move second child to first child ( temp 4-component vector of float) +0:95 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:95 'color' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'bigColor1_1' ( uniform 4-component vector of float) +0:? 'bigColor1_2' ( uniform 4-component vector of float) +0:? 'bigColor1_3' ( uniform 4-component vector of float) +0:? 'bigColor2' ( uniform 4-component vector of float) +0:? 'bigColor3' ( uniform 4-component vector of float) +0:? 'bigColor4' ( uniform 4-component vector of float) +0:? 'bigColor5' ( uniform 4-component vector of float) +0:? 'bigColor6' ( uniform 4-component vector of float) +0:? 'bigColor7' ( uniform 4-component vector of float) +0:? 'bigColor8' ( uniform 4-component vector of float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'd' ( uniform float) +0:? 'd2' ( uniform float) +0:? 'd3' ( uniform float) +0:? 'd4' ( uniform float) +0:? 'd5' ( uniform float) +0:? 'd6' ( uniform float) +0:? 'd7' ( uniform float) +0:? 'd8' ( uniform float) +0:? 'd9' ( uniform float) +0:? 'd10' ( uniform float) +0:? 'd11' ( uniform float) +0:? 'd12' ( uniform float) +0:? 'd13' ( uniform float) +0:? 'd14' ( uniform float) +0:? 'd15' ( uniform float) +0:? 'd16' ( uniform float) +0:? 'd17' ( uniform float) +0:? 'd18' ( uniform float) +0:? 'd19' ( uniform float) +0:? 'd20' ( uniform float) +0:? 'd21' ( uniform float) +0:? 'd22' ( uniform float) +0:? 'd23' ( uniform float) +0:? 'd24' ( uniform float) +0:? 'd25' ( uniform float) +0:? 'd26' ( uniform float) +0:? 'd27' ( uniform float) +0:? 'd28' ( uniform float) +0:? 'd29' ( uniform float) +0:? 'd30' ( uniform float) +0:? 'd31' ( uniform float) +0:? 'd32' ( uniform float) +0:? 'd33' ( uniform float) +0:? 'd34' ( uniform float) +0:? 'Count' ( uniform int) + diff --git a/deps/glslang/Test/baseResults/mains1.frag.out b/deps/glslang/Test/baseResults/mains1.frag.out new file mode 100644 index 00000000..3b318b62 --- /dev/null +++ b/deps/glslang/Test/baseResults/mains1.frag.out @@ -0,0 +1,69 @@ +mains1.frag +Shader version: 110 +0:? Sequence +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:? Linker Objects + +mains2.frag +Shader version: 110 +0:? Sequence +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:? Linker Objects + +noMain1.geom +ERROR: #version: geometry shaders require es profile with version 310 or non-es profile with version 150 or above +ERROR: 1 compilation errors. No code generated. + + +Shader version: 150 +invocations = -1 +max_vertices = -1 +input primitive = none +output primitive = points +ERROR: node is still EOpNull! +0:3 Function Definition: foo( ( global void) +0:3 Function Parameters: +0:? Linker Objects + +noMain2.geom +Shader version: 150 +invocations = -1 +max_vertices = -1 +input primitive = none +output primitive = line_strip +0:? Sequence +0:3 Function Definition: bar( ( global void) +0:3 Function Parameters: +0:? Linker Objects + + +Linked geometry stage: + +ERROR: Linking geometry stage: Contradictory output layout primitives +ERROR: Linking geometry stage: Missing entry point: Each stage requires one entry point +ERROR: Linking geometry stage: At least one shader must specify an input layout primitive +ERROR: Linking geometry stage: At least one shader must specify a layout(max_vertices = value) + +Linked fragment stage: + +ERROR: Linking fragment stage: can't handle multiple entry points per stage +ERROR: Linking fragment stage: Multiple function bodies in multiple compilation units for the same signature in the same stage: + main( + +Shader version: 150 +invocations = 1 +max_vertices = -1 +input primitive = none +output primitive = points +ERROR: node is still EOpNull! +0:? Linker Objects +Shader version: 110 +0:? Sequence +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:? Linker Objects + diff --git a/deps/glslang/Test/baseResults/matrix.frag.out b/deps/glslang/Test/baseResults/matrix.frag.out new file mode 100644 index 00000000..f3bea4b2 --- /dev/null +++ b/deps/glslang/Test/baseResults/matrix.frag.out @@ -0,0 +1,507 @@ +matrix.frag +WARNING: 0:6: varying deprecated in version 130; may be removed in future release +WARNING: 0:17: varying deprecated in version 130; may be removed in future release +WARNING: 0:22: varying deprecated in version 130; may be removed in future release + +Shader version: 130 +0:? Sequence +0:25 Function Definition: main( ( global void) +0:25 Function Parameters: +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:27 Construct vec4 ( temp 4-component vector of float) +0:27 direct index ( temp 4-component vector of float) +0:27 'un34' ( uniform 4X4 matrix of float) +0:27 Constant: +0:27 1 (const int) +0:28 add second child into first child ( temp 4-component vector of float) +0:28 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:28 Construct vec4 ( temp 4-component vector of float) +0:28 vector-times-matrix ( temp 3-component vector of float) +0:28 'Color' ( smooth in 3-component vector of float) +0:28 'colorTransform' ( uniform 3X3 matrix of float) +0:28 Constant: +0:28 1.000000 +0:30 Test condition and select ( temp void) +0:30 Condition +0:30 Compare Not Equal ( temp bool) +0:30 'm' ( uniform 4X4 matrix of float) +0:30 'n' ( uniform 4X4 matrix of float) +0:30 true case +0:31 add second child into first child ( temp 4-component vector of float) +0:31 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:31 'v' ( smooth in 4-component vector of float) +0:30 false case +0:33 Sequence +0:33 add second child into first child ( temp 4-component vector of float) +0:33 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:33 matrix-times-vector ( temp 4-component vector of float) +0:33 'm' ( uniform 4X4 matrix of float) +0:33 'v' ( smooth in 4-component vector of float) +0:34 add second child into first child ( temp 4-component vector of float) +0:34 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:34 vector-times-matrix ( temp 4-component vector of float) +0:34 'v' ( smooth in 4-component vector of float) +0:34 subtract ( temp 4X4 matrix of float) +0:34 'm' ( uniform 4X4 matrix of float) +0:34 'n' ( uniform 4X4 matrix of float) +0:42 Sequence +0:42 move second child to first child ( temp 4X4 matrix of float) +0:42 'm34' ( temp 4X4 matrix of float) +0:45 Construct mat4 ( temp 4X4 matrix of float) +0:42 component-wise multiply ( temp float) +0:42 direct index ( temp float) +0:42 'v' ( smooth in 4-component vector of float) +0:42 Constant: +0:42 0 (const int) +0:42 direct index ( temp float) +0:42 'u' ( smooth in 4-component vector of float) +0:42 Constant: +0:42 0 (const int) +0:42 component-wise multiply ( temp float) +0:42 direct index ( temp float) +0:42 'v' ( smooth in 4-component vector of float) +0:42 Constant: +0:42 0 (const int) +0:42 direct index ( temp float) +0:42 'u' ( smooth in 4-component vector of float) +0:42 Constant: +0:42 1 (const int) +0:42 component-wise multiply ( temp float) +0:42 direct index ( temp float) +0:42 'v' ( smooth in 4-component vector of float) +0:42 Constant: +0:42 0 (const int) +0:42 direct index ( temp float) +0:42 'u' ( smooth in 4-component vector of float) +0:42 Constant: +0:42 2 (const int) +0:42 component-wise multiply ( temp float) +0:42 direct index ( temp float) +0:42 'v' ( smooth in 4-component vector of float) +0:42 Constant: +0:42 0 (const int) +0:42 direct index ( temp float) +0:42 'u' ( smooth in 4-component vector of float) +0:42 Constant: +0:42 3 (const int) +0:43 component-wise multiply ( temp float) +0:43 direct index ( temp float) +0:43 'v' ( smooth in 4-component vector of float) +0:43 Constant: +0:43 1 (const int) +0:43 direct index ( temp float) +0:43 'u' ( smooth in 4-component vector of float) +0:43 Constant: +0:43 0 (const int) +0:43 component-wise multiply ( temp float) +0:43 direct index ( temp float) +0:43 'v' ( smooth in 4-component vector of float) +0:43 Constant: +0:43 1 (const int) +0:43 direct index ( temp float) +0:43 'u' ( smooth in 4-component vector of float) +0:43 Constant: +0:43 1 (const int) +0:43 component-wise multiply ( temp float) +0:43 direct index ( temp float) +0:43 'v' ( smooth in 4-component vector of float) +0:43 Constant: +0:43 1 (const int) +0:43 direct index ( temp float) +0:43 'u' ( smooth in 4-component vector of float) +0:43 Constant: +0:43 2 (const int) +0:43 component-wise multiply ( temp float) +0:43 direct index ( temp float) +0:43 'v' ( smooth in 4-component vector of float) +0:43 Constant: +0:43 1 (const int) +0:43 direct index ( temp float) +0:43 'u' ( smooth in 4-component vector of float) +0:43 Constant: +0:43 3 (const int) +0:44 component-wise multiply ( temp float) +0:44 direct index ( temp float) +0:44 'v' ( smooth in 4-component vector of float) +0:44 Constant: +0:44 2 (const int) +0:44 direct index ( temp float) +0:44 'u' ( smooth in 4-component vector of float) +0:44 Constant: +0:44 0 (const int) +0:44 component-wise multiply ( temp float) +0:44 direct index ( temp float) +0:44 'v' ( smooth in 4-component vector of float) +0:44 Constant: +0:44 2 (const int) +0:44 direct index ( temp float) +0:44 'u' ( smooth in 4-component vector of float) +0:44 Constant: +0:44 1 (const int) +0:44 component-wise multiply ( temp float) +0:44 direct index ( temp float) +0:44 'v' ( smooth in 4-component vector of float) +0:44 Constant: +0:44 2 (const int) +0:44 direct index ( temp float) +0:44 'u' ( smooth in 4-component vector of float) +0:44 Constant: +0:44 2 (const int) +0:44 component-wise multiply ( temp float) +0:44 direct index ( temp float) +0:44 'v' ( smooth in 4-component vector of float) +0:44 Constant: +0:44 2 (const int) +0:44 direct index ( temp float) +0:44 'u' ( smooth in 4-component vector of float) +0:44 Constant: +0:44 3 (const int) +0:45 component-wise multiply ( temp float) +0:45 direct index ( temp float) +0:45 'v' ( smooth in 4-component vector of float) +0:45 Constant: +0:45 3 (const int) +0:45 direct index ( temp float) +0:45 'u' ( smooth in 4-component vector of float) +0:45 Constant: +0:45 0 (const int) +0:45 component-wise multiply ( temp float) +0:45 direct index ( temp float) +0:45 'v' ( smooth in 4-component vector of float) +0:45 Constant: +0:45 3 (const int) +0:45 direct index ( temp float) +0:45 'u' ( smooth in 4-component vector of float) +0:45 Constant: +0:45 1 (const int) +0:45 component-wise multiply ( temp float) +0:45 direct index ( temp float) +0:45 'v' ( smooth in 4-component vector of float) +0:45 Constant: +0:45 3 (const int) +0:45 direct index ( temp float) +0:45 'u' ( smooth in 4-component vector of float) +0:45 Constant: +0:45 2 (const int) +0:45 component-wise multiply ( temp float) +0:45 direct index ( temp float) +0:45 'v' ( smooth in 4-component vector of float) +0:45 Constant: +0:45 3 (const int) +0:45 direct index ( temp float) +0:45 'u' ( smooth in 4-component vector of float) +0:45 Constant: +0:45 3 (const int) +0:46 add second child into first child ( temp 4X4 matrix of float) +0:46 'm34' ( temp 4X4 matrix of float) +0:46 Construct mat4 ( temp 4X4 matrix of float) +0:46 direct index ( temp float) +0:46 'v' ( smooth in 4-component vector of float) +0:46 Constant: +0:46 0 (const int) +0:47 add second child into first child ( temp 4X4 matrix of float) +0:47 'm34' ( temp 4X4 matrix of float) +0:47 Construct mat4 ( temp 4X4 matrix of float) +0:47 'u' ( smooth in 4-component vector of float) +0:47 direct index ( temp float) +0:47 'u' ( smooth in 4-component vector of float) +0:47 Constant: +0:47 0 (const int) +0:47 'u' ( smooth in 4-component vector of float) +0:47 direct index ( temp float) +0:47 'u' ( smooth in 4-component vector of float) +0:47 Constant: +0:47 0 (const int) +0:47 'u' ( smooth in 4-component vector of float) +0:47 direct index ( temp float) +0:47 'u' ( smooth in 4-component vector of float) +0:47 Constant: +0:47 0 (const int) +0:47 direct index ( temp float) +0:47 'u' ( smooth in 4-component vector of float) +0:47 Constant: +0:47 0 (const int) +0:51 Test condition and select ( temp void) +0:51 Condition +0:51 Compare Equal ( temp bool) +0:51 'm34' ( temp 4X4 matrix of float) +0:51 'un34' ( uniform 4X4 matrix of float) +0:51 true case +0:52 add second child into first child ( temp 4-component vector of float) +0:52 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:52 matrix-times-vector ( temp 4-component vector of float) +0:52 'm34' ( temp 4X4 matrix of float) +0:52 'u' ( smooth in 4-component vector of float) +0:51 false case +0:54 add second child into first child ( temp 4-component vector of float) +0:54 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:54 matrix-times-vector ( temp 4-component vector of float) +0:54 matrix-multiply ( temp 4X4 matrix of float) +0:54 'un34' ( uniform 4X4 matrix of float) +0:54 'um43' ( uniform 4X4 matrix of float) +0:54 'v' ( smooth in 4-component vector of float) +0:? Linker Objects +0:? 'colorTransform' ( uniform 3X3 matrix of float) +0:? 'Color' ( smooth in 3-component vector of float) +0:? 'm' ( uniform 4X4 matrix of float) +0:? 'n' ( uniform 4X4 matrix of float) +0:? 'um43' ( uniform 4X4 matrix of float) +0:? 'un34' ( uniform 4X4 matrix of float) +0:? 'v' ( smooth in 4-component vector of float) +0:? 'u' ( smooth in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 130 +0:? Sequence +0:25 Function Definition: main( ( global void) +0:25 Function Parameters: +0:27 Sequence +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:27 Construct vec4 ( temp 4-component vector of float) +0:27 direct index ( temp 4-component vector of float) +0:27 'un34' ( uniform 4X4 matrix of float) +0:27 Constant: +0:27 1 (const int) +0:28 add second child into first child ( temp 4-component vector of float) +0:28 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:28 Construct vec4 ( temp 4-component vector of float) +0:28 vector-times-matrix ( temp 3-component vector of float) +0:28 'Color' ( smooth in 3-component vector of float) +0:28 'colorTransform' ( uniform 3X3 matrix of float) +0:28 Constant: +0:28 1.000000 +0:30 Test condition and select ( temp void) +0:30 Condition +0:30 Compare Not Equal ( temp bool) +0:30 'm' ( uniform 4X4 matrix of float) +0:30 'n' ( uniform 4X4 matrix of float) +0:30 true case +0:31 add second child into first child ( temp 4-component vector of float) +0:31 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:31 'v' ( smooth in 4-component vector of float) +0:30 false case +0:33 Sequence +0:33 add second child into first child ( temp 4-component vector of float) +0:33 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:33 matrix-times-vector ( temp 4-component vector of float) +0:33 'm' ( uniform 4X4 matrix of float) +0:33 'v' ( smooth in 4-component vector of float) +0:34 add second child into first child ( temp 4-component vector of float) +0:34 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:34 vector-times-matrix ( temp 4-component vector of float) +0:34 'v' ( smooth in 4-component vector of float) +0:34 subtract ( temp 4X4 matrix of float) +0:34 'm' ( uniform 4X4 matrix of float) +0:34 'n' ( uniform 4X4 matrix of float) +0:42 Sequence +0:42 move second child to first child ( temp 4X4 matrix of float) +0:42 'm34' ( temp 4X4 matrix of float) +0:45 Construct mat4 ( temp 4X4 matrix of float) +0:42 component-wise multiply ( temp float) +0:42 direct index ( temp float) +0:42 'v' ( smooth in 4-component vector of float) +0:42 Constant: +0:42 0 (const int) +0:42 direct index ( temp float) +0:42 'u' ( smooth in 4-component vector of float) +0:42 Constant: +0:42 0 (const int) +0:42 component-wise multiply ( temp float) +0:42 direct index ( temp float) +0:42 'v' ( smooth in 4-component vector of float) +0:42 Constant: +0:42 0 (const int) +0:42 direct index ( temp float) +0:42 'u' ( smooth in 4-component vector of float) +0:42 Constant: +0:42 1 (const int) +0:42 component-wise multiply ( temp float) +0:42 direct index ( temp float) +0:42 'v' ( smooth in 4-component vector of float) +0:42 Constant: +0:42 0 (const int) +0:42 direct index ( temp float) +0:42 'u' ( smooth in 4-component vector of float) +0:42 Constant: +0:42 2 (const int) +0:42 component-wise multiply ( temp float) +0:42 direct index ( temp float) +0:42 'v' ( smooth in 4-component vector of float) +0:42 Constant: +0:42 0 (const int) +0:42 direct index ( temp float) +0:42 'u' ( smooth in 4-component vector of float) +0:42 Constant: +0:42 3 (const int) +0:43 component-wise multiply ( temp float) +0:43 direct index ( temp float) +0:43 'v' ( smooth in 4-component vector of float) +0:43 Constant: +0:43 1 (const int) +0:43 direct index ( temp float) +0:43 'u' ( smooth in 4-component vector of float) +0:43 Constant: +0:43 0 (const int) +0:43 component-wise multiply ( temp float) +0:43 direct index ( temp float) +0:43 'v' ( smooth in 4-component vector of float) +0:43 Constant: +0:43 1 (const int) +0:43 direct index ( temp float) +0:43 'u' ( smooth in 4-component vector of float) +0:43 Constant: +0:43 1 (const int) +0:43 component-wise multiply ( temp float) +0:43 direct index ( temp float) +0:43 'v' ( smooth in 4-component vector of float) +0:43 Constant: +0:43 1 (const int) +0:43 direct index ( temp float) +0:43 'u' ( smooth in 4-component vector of float) +0:43 Constant: +0:43 2 (const int) +0:43 component-wise multiply ( temp float) +0:43 direct index ( temp float) +0:43 'v' ( smooth in 4-component vector of float) +0:43 Constant: +0:43 1 (const int) +0:43 direct index ( temp float) +0:43 'u' ( smooth in 4-component vector of float) +0:43 Constant: +0:43 3 (const int) +0:44 component-wise multiply ( temp float) +0:44 direct index ( temp float) +0:44 'v' ( smooth in 4-component vector of float) +0:44 Constant: +0:44 2 (const int) +0:44 direct index ( temp float) +0:44 'u' ( smooth in 4-component vector of float) +0:44 Constant: +0:44 0 (const int) +0:44 component-wise multiply ( temp float) +0:44 direct index ( temp float) +0:44 'v' ( smooth in 4-component vector of float) +0:44 Constant: +0:44 2 (const int) +0:44 direct index ( temp float) +0:44 'u' ( smooth in 4-component vector of float) +0:44 Constant: +0:44 1 (const int) +0:44 component-wise multiply ( temp float) +0:44 direct index ( temp float) +0:44 'v' ( smooth in 4-component vector of float) +0:44 Constant: +0:44 2 (const int) +0:44 direct index ( temp float) +0:44 'u' ( smooth in 4-component vector of float) +0:44 Constant: +0:44 2 (const int) +0:44 component-wise multiply ( temp float) +0:44 direct index ( temp float) +0:44 'v' ( smooth in 4-component vector of float) +0:44 Constant: +0:44 2 (const int) +0:44 direct index ( temp float) +0:44 'u' ( smooth in 4-component vector of float) +0:44 Constant: +0:44 3 (const int) +0:45 component-wise multiply ( temp float) +0:45 direct index ( temp float) +0:45 'v' ( smooth in 4-component vector of float) +0:45 Constant: +0:45 3 (const int) +0:45 direct index ( temp float) +0:45 'u' ( smooth in 4-component vector of float) +0:45 Constant: +0:45 0 (const int) +0:45 component-wise multiply ( temp float) +0:45 direct index ( temp float) +0:45 'v' ( smooth in 4-component vector of float) +0:45 Constant: +0:45 3 (const int) +0:45 direct index ( temp float) +0:45 'u' ( smooth in 4-component vector of float) +0:45 Constant: +0:45 1 (const int) +0:45 component-wise multiply ( temp float) +0:45 direct index ( temp float) +0:45 'v' ( smooth in 4-component vector of float) +0:45 Constant: +0:45 3 (const int) +0:45 direct index ( temp float) +0:45 'u' ( smooth in 4-component vector of float) +0:45 Constant: +0:45 2 (const int) +0:45 component-wise multiply ( temp float) +0:45 direct index ( temp float) +0:45 'v' ( smooth in 4-component vector of float) +0:45 Constant: +0:45 3 (const int) +0:45 direct index ( temp float) +0:45 'u' ( smooth in 4-component vector of float) +0:45 Constant: +0:45 3 (const int) +0:46 add second child into first child ( temp 4X4 matrix of float) +0:46 'm34' ( temp 4X4 matrix of float) +0:46 Construct mat4 ( temp 4X4 matrix of float) +0:46 direct index ( temp float) +0:46 'v' ( smooth in 4-component vector of float) +0:46 Constant: +0:46 0 (const int) +0:47 add second child into first child ( temp 4X4 matrix of float) +0:47 'm34' ( temp 4X4 matrix of float) +0:47 Construct mat4 ( temp 4X4 matrix of float) +0:47 'u' ( smooth in 4-component vector of float) +0:47 direct index ( temp float) +0:47 'u' ( smooth in 4-component vector of float) +0:47 Constant: +0:47 0 (const int) +0:47 'u' ( smooth in 4-component vector of float) +0:47 direct index ( temp float) +0:47 'u' ( smooth in 4-component vector of float) +0:47 Constant: +0:47 0 (const int) +0:47 'u' ( smooth in 4-component vector of float) +0:47 direct index ( temp float) +0:47 'u' ( smooth in 4-component vector of float) +0:47 Constant: +0:47 0 (const int) +0:47 direct index ( temp float) +0:47 'u' ( smooth in 4-component vector of float) +0:47 Constant: +0:47 0 (const int) +0:51 Test condition and select ( temp void) +0:51 Condition +0:51 Compare Equal ( temp bool) +0:51 'm34' ( temp 4X4 matrix of float) +0:51 'un34' ( uniform 4X4 matrix of float) +0:51 true case +0:52 add second child into first child ( temp 4-component vector of float) +0:52 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:52 matrix-times-vector ( temp 4-component vector of float) +0:52 'm34' ( temp 4X4 matrix of float) +0:52 'u' ( smooth in 4-component vector of float) +0:51 false case +0:54 add second child into first child ( temp 4-component vector of float) +0:54 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:54 matrix-times-vector ( temp 4-component vector of float) +0:54 matrix-multiply ( temp 4X4 matrix of float) +0:54 'un34' ( uniform 4X4 matrix of float) +0:54 'um43' ( uniform 4X4 matrix of float) +0:54 'v' ( smooth in 4-component vector of float) +0:? Linker Objects +0:? 'colorTransform' ( uniform 3X3 matrix of float) +0:? 'Color' ( smooth in 3-component vector of float) +0:? 'm' ( uniform 4X4 matrix of float) +0:? 'n' ( uniform 4X4 matrix of float) +0:? 'um43' ( uniform 4X4 matrix of float) +0:? 'un34' ( uniform 4X4 matrix of float) +0:? 'v' ( smooth in 4-component vector of float) +0:? 'u' ( smooth in 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/matrix2.frag.out b/deps/glslang/Test/baseResults/matrix2.frag.out new file mode 100644 index 00000000..3e3b3f06 --- /dev/null +++ b/deps/glslang/Test/baseResults/matrix2.frag.out @@ -0,0 +1,353 @@ +matrix2.frag +WARNING: 0:4: varying deprecated in version 130; may be removed in future release +WARNING: 0:13: varying deprecated in version 130; may be removed in future release +WARNING: 0:15: varying deprecated in version 130; may be removed in future release + +Shader version: 150 +0:? Sequence +0:19 Function Definition: main( ( global void) +0:19 Function Parameters: +0:21 Sequence +0:21 Sequence +0:21 move second child to first child ( temp 3X4 matrix of float) +0:21 'm34' ( temp 3X4 matrix of float) +0:21 outer product ( global 3X4 matrix of float) +0:21 'v' ( smooth in 4-component vector of float) +0:21 'u' ( smooth in 3-component vector of float) +0:23 add second child into first child ( temp 3X4 matrix of float) +0:23 'm34' ( temp 3X4 matrix of float) +0:23 Constant: +0:23 4.300000 +0:23 0.000000 +0:23 0.000000 +0:23 0.000000 +0:23 0.000000 +0:23 4.300000 +0:23 0.000000 +0:23 0.000000 +0:23 0.000000 +0:23 0.000000 +0:23 4.300000 +0:23 0.000000 +0:25 move second child to first child ( temp 4-component vector of float) +0:25 'FragColor' ( out 4-component vector of float) +0:25 Construct vec4 ( temp 4-component vector of float) +0:25 'Color' ( smooth in 3-component vector of float) +0:25 Constant: +0:25 1.000000 +0:26 multiply second child into first child ( temp 4-component vector of float) +0:26 'FragColor' ( out 4-component vector of float) +0:26 Construct vec4 ( temp 4-component vector of float) +0:26 vector-times-matrix ( temp 3-component vector of float) +0:26 'FragColor' ( out 4-component vector of float) +0:26 'm34' ( temp 3X4 matrix of float) +0:26 Constant: +0:26 1.000000 +0:28 matrix scale second child into first child ( temp 3X4 matrix of float) +0:28 'm34' ( temp 3X4 matrix of float) +0:28 direct index ( temp float) +0:28 'v' ( smooth in 4-component vector of float) +0:28 Constant: +0:28 0 (const int) +0:30 Sequence +0:30 move second child to first child ( temp 4X4 matrix of float) +0:30 'm44' ( temp 4X4 matrix of float) +0:30 Construct mat4 ( temp 4X4 matrix of float) +0:30 'un34' ( uniform 3X4 matrix of float) +0:32 add second child into first child ( temp 4X4 matrix of float) +0:32 'm44' ( temp 4X4 matrix of float) +0:32 matrix-multiply ( temp 4X4 matrix of float) +0:32 'm34' ( temp 3X4 matrix of float) +0:32 'um43' ( uniform 4X3 matrix of float) +0:34 add second child into first child ( temp 4-component vector of float) +0:34 'FragColor' ( out 4-component vector of float) +0:34 matrix-times-vector ( temp 4-component vector of float) +0:34 Negate value ( temp 4X4 matrix of float) +0:34 'm44' ( temp 4X4 matrix of float) +0:34 'v' ( smooth in 4-component vector of float) +0:36 matrix mult second child into first child ( temp 4-component vector of float) +0:36 'FragColor' ( out 4-component vector of float) +0:36 component-wise multiply ( global 4X4 matrix of float) +0:36 'm44' ( temp 4X4 matrix of float) +0:36 'm44' ( temp 4X4 matrix of float) +0:38 move second child to first child ( temp 3X4 matrix of float) +0:38 'm34' ( temp 3X4 matrix of float) +0:38 transpose ( global 3X4 matrix of float) +0:38 'um43' ( uniform 4X3 matrix of float) +0:39 multiply second child into first child ( temp 4-component vector of float) +0:39 'FragColor' ( out 4-component vector of float) +0:39 Construct vec4 ( temp 4-component vector of float) +0:39 vector-times-matrix ( temp 3-component vector of float) +0:39 'FragColor' ( out 4-component vector of float) +0:39 'm34' ( temp 3X4 matrix of float) +0:39 Constant: +0:39 1.000000 +0:40 multiply second child into first child ( temp 4-component vector of float) +0:40 'FragColor' ( out 4-component vector of float) +0:40 Construct vec4 ( temp 4-component vector of float) +0:40 determinant ( global float) +0:40 'um4' ( uniform 4X4 matrix of float) +0:41 Sequence +0:41 move second child to first child ( temp 2X2 matrix of float) +0:41 'inv' ( temp 2X2 matrix of float) +0:41 inverse ( global 2X2 matrix of float) +0:41 'um2' ( uniform 2X2 matrix of float) +0:42 multiply second child into first child ( temp 4-component vector of float) +0:42 'FragColor' ( out 4-component vector of float) +0:42 Construct vec4 ( temp 4-component vector of float) +0:42 direct index ( temp float) +0:42 direct index ( temp 2-component vector of float) +0:42 'inv' ( temp 2X2 matrix of float) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 0 (const int) +0:42 direct index ( temp float) +0:42 direct index ( temp 2-component vector of float) +0:42 'inv' ( temp 2X2 matrix of float) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 0 (const int) +0:42 direct index ( temp float) +0:42 direct index ( temp 2-component vector of float) +0:42 'inv' ( temp 2X2 matrix of float) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 direct index ( temp float) +0:42 direct index ( temp 2-component vector of float) +0:42 'inv' ( temp 2X2 matrix of float) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 1 (const int) +0:43 Sequence +0:43 move second child to first child ( temp 3X3 matrix of float) +0:43 'inv3' ( temp 3X3 matrix of float) +0:43 inverse ( global 3X3 matrix of float) +0:43 'um3' ( uniform 3X3 matrix of float) +0:44 multiply second child into first child ( temp 4-component vector of float) +0:44 'FragColor' ( out 4-component vector of float) +0:44 Construct vec4 ( temp 4-component vector of float) +0:44 direct index ( temp float) +0:44 direct index ( temp 3-component vector of float) +0:44 'inv3' ( temp 3X3 matrix of float) +0:44 Constant: +0:44 2 (const int) +0:44 Constant: +0:44 1 (const int) +0:46 Sequence +0:46 move second child to first child ( temp 4X4 matrix of float) +0:46 'inv4' ( temp 4X4 matrix of float) +0:46 inverse ( global 4X4 matrix of float) +0:46 'um4' ( uniform 4X4 matrix of float) +0:47 matrix mult second child into first child ( temp 4-component vector of float) +0:47 'FragColor' ( out 4-component vector of float) +0:47 'inv4' ( temp 4X4 matrix of float) +0:49 move second child to first child ( temp 4-component vector of float) +0:49 'FragColor' ( out 4-component vector of float) +0:49 Construct vec4 ( temp 4-component vector of float) +0:49 vector-times-matrix ( temp 3-component vector of float) +0:49 'FragColor' ( out 4-component vector of float) +0:49 component-wise multiply ( global 3X4 matrix of float) +0:49 'un34' ( uniform 3X4 matrix of float) +0:49 'un34' ( uniform 3X4 matrix of float) +0:49 direct index ( temp float) +0:49 'FragColor' ( out 4-component vector of float) +0:49 Constant: +0:49 3 (const int) +0:50 matrix mult second child into first child ( temp 3X4 matrix of float) +0:50 'm34' ( temp 3X4 matrix of float) +0:50 'colorTransform' ( uniform 3X3 matrix of float) +0:? Linker Objects +0:? 'colorTransform' ( uniform 3X3 matrix of float) +0:? 'Color' ( smooth in 3-component vector of float) +0:? 'm' ( uniform 4X4 matrix of float) +0:? 'n' ( uniform 4X4 matrix of float) +0:? 'um43' ( uniform 4X3 matrix of float) +0:? 'un34' ( uniform 3X4 matrix of float) +0:? 'um2' ( uniform 2X2 matrix of float) +0:? 'um3' ( uniform 3X3 matrix of float) +0:? 'um4' ( uniform 4X4 matrix of float) +0:? 'v' ( smooth in 4-component vector of float) +0:? 'u' ( smooth in 3-component vector of float) +0:? 'FragColor' ( out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 150 +0:? Sequence +0:19 Function Definition: main( ( global void) +0:19 Function Parameters: +0:21 Sequence +0:21 Sequence +0:21 move second child to first child ( temp 3X4 matrix of float) +0:21 'm34' ( temp 3X4 matrix of float) +0:21 outer product ( global 3X4 matrix of float) +0:21 'v' ( smooth in 4-component vector of float) +0:21 'u' ( smooth in 3-component vector of float) +0:23 add second child into first child ( temp 3X4 matrix of float) +0:23 'm34' ( temp 3X4 matrix of float) +0:23 Constant: +0:23 4.300000 +0:23 0.000000 +0:23 0.000000 +0:23 0.000000 +0:23 0.000000 +0:23 4.300000 +0:23 0.000000 +0:23 0.000000 +0:23 0.000000 +0:23 0.000000 +0:23 4.300000 +0:23 0.000000 +0:25 move second child to first child ( temp 4-component vector of float) +0:25 'FragColor' ( out 4-component vector of float) +0:25 Construct vec4 ( temp 4-component vector of float) +0:25 'Color' ( smooth in 3-component vector of float) +0:25 Constant: +0:25 1.000000 +0:26 multiply second child into first child ( temp 4-component vector of float) +0:26 'FragColor' ( out 4-component vector of float) +0:26 Construct vec4 ( temp 4-component vector of float) +0:26 vector-times-matrix ( temp 3-component vector of float) +0:26 'FragColor' ( out 4-component vector of float) +0:26 'm34' ( temp 3X4 matrix of float) +0:26 Constant: +0:26 1.000000 +0:28 matrix scale second child into first child ( temp 3X4 matrix of float) +0:28 'm34' ( temp 3X4 matrix of float) +0:28 direct index ( temp float) +0:28 'v' ( smooth in 4-component vector of float) +0:28 Constant: +0:28 0 (const int) +0:30 Sequence +0:30 move second child to first child ( temp 4X4 matrix of float) +0:30 'm44' ( temp 4X4 matrix of float) +0:30 Construct mat4 ( temp 4X4 matrix of float) +0:30 'un34' ( uniform 3X4 matrix of float) +0:32 add second child into first child ( temp 4X4 matrix of float) +0:32 'm44' ( temp 4X4 matrix of float) +0:32 matrix-multiply ( temp 4X4 matrix of float) +0:32 'm34' ( temp 3X4 matrix of float) +0:32 'um43' ( uniform 4X3 matrix of float) +0:34 add second child into first child ( temp 4-component vector of float) +0:34 'FragColor' ( out 4-component vector of float) +0:34 matrix-times-vector ( temp 4-component vector of float) +0:34 Negate value ( temp 4X4 matrix of float) +0:34 'm44' ( temp 4X4 matrix of float) +0:34 'v' ( smooth in 4-component vector of float) +0:36 matrix mult second child into first child ( temp 4-component vector of float) +0:36 'FragColor' ( out 4-component vector of float) +0:36 component-wise multiply ( global 4X4 matrix of float) +0:36 'm44' ( temp 4X4 matrix of float) +0:36 'm44' ( temp 4X4 matrix of float) +0:38 move second child to first child ( temp 3X4 matrix of float) +0:38 'm34' ( temp 3X4 matrix of float) +0:38 transpose ( global 3X4 matrix of float) +0:38 'um43' ( uniform 4X3 matrix of float) +0:39 multiply second child into first child ( temp 4-component vector of float) +0:39 'FragColor' ( out 4-component vector of float) +0:39 Construct vec4 ( temp 4-component vector of float) +0:39 vector-times-matrix ( temp 3-component vector of float) +0:39 'FragColor' ( out 4-component vector of float) +0:39 'm34' ( temp 3X4 matrix of float) +0:39 Constant: +0:39 1.000000 +0:40 multiply second child into first child ( temp 4-component vector of float) +0:40 'FragColor' ( out 4-component vector of float) +0:40 Construct vec4 ( temp 4-component vector of float) +0:40 determinant ( global float) +0:40 'um4' ( uniform 4X4 matrix of float) +0:41 Sequence +0:41 move second child to first child ( temp 2X2 matrix of float) +0:41 'inv' ( temp 2X2 matrix of float) +0:41 inverse ( global 2X2 matrix of float) +0:41 'um2' ( uniform 2X2 matrix of float) +0:42 multiply second child into first child ( temp 4-component vector of float) +0:42 'FragColor' ( out 4-component vector of float) +0:42 Construct vec4 ( temp 4-component vector of float) +0:42 direct index ( temp float) +0:42 direct index ( temp 2-component vector of float) +0:42 'inv' ( temp 2X2 matrix of float) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 0 (const int) +0:42 direct index ( temp float) +0:42 direct index ( temp 2-component vector of float) +0:42 'inv' ( temp 2X2 matrix of float) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 0 (const int) +0:42 direct index ( temp float) +0:42 direct index ( temp 2-component vector of float) +0:42 'inv' ( temp 2X2 matrix of float) +0:42 Constant: +0:42 0 (const int) +0:42 Constant: +0:42 1 (const int) +0:42 direct index ( temp float) +0:42 direct index ( temp 2-component vector of float) +0:42 'inv' ( temp 2X2 matrix of float) +0:42 Constant: +0:42 1 (const int) +0:42 Constant: +0:42 1 (const int) +0:43 Sequence +0:43 move second child to first child ( temp 3X3 matrix of float) +0:43 'inv3' ( temp 3X3 matrix of float) +0:43 inverse ( global 3X3 matrix of float) +0:43 'um3' ( uniform 3X3 matrix of float) +0:44 multiply second child into first child ( temp 4-component vector of float) +0:44 'FragColor' ( out 4-component vector of float) +0:44 Construct vec4 ( temp 4-component vector of float) +0:44 direct index ( temp float) +0:44 direct index ( temp 3-component vector of float) +0:44 'inv3' ( temp 3X3 matrix of float) +0:44 Constant: +0:44 2 (const int) +0:44 Constant: +0:44 1 (const int) +0:46 Sequence +0:46 move second child to first child ( temp 4X4 matrix of float) +0:46 'inv4' ( temp 4X4 matrix of float) +0:46 inverse ( global 4X4 matrix of float) +0:46 'um4' ( uniform 4X4 matrix of float) +0:47 matrix mult second child into first child ( temp 4-component vector of float) +0:47 'FragColor' ( out 4-component vector of float) +0:47 'inv4' ( temp 4X4 matrix of float) +0:49 move second child to first child ( temp 4-component vector of float) +0:49 'FragColor' ( out 4-component vector of float) +0:49 Construct vec4 ( temp 4-component vector of float) +0:49 vector-times-matrix ( temp 3-component vector of float) +0:49 'FragColor' ( out 4-component vector of float) +0:49 component-wise multiply ( global 3X4 matrix of float) +0:49 'un34' ( uniform 3X4 matrix of float) +0:49 'un34' ( uniform 3X4 matrix of float) +0:49 direct index ( temp float) +0:49 'FragColor' ( out 4-component vector of float) +0:49 Constant: +0:49 3 (const int) +0:50 matrix mult second child into first child ( temp 3X4 matrix of float) +0:50 'm34' ( temp 3X4 matrix of float) +0:50 'colorTransform' ( uniform 3X3 matrix of float) +0:? Linker Objects +0:? 'colorTransform' ( uniform 3X3 matrix of float) +0:? 'Color' ( smooth in 3-component vector of float) +0:? 'm' ( uniform 4X4 matrix of float) +0:? 'n' ( uniform 4X4 matrix of float) +0:? 'um43' ( uniform 4X3 matrix of float) +0:? 'un34' ( uniform 3X4 matrix of float) +0:? 'um2' ( uniform 2X2 matrix of float) +0:? 'um3' ( uniform 3X3 matrix of float) +0:? 'um4' ( uniform 4X4 matrix of float) +0:? 'v' ( smooth in 4-component vector of float) +0:? 'u' ( smooth in 3-component vector of float) +0:? 'FragColor' ( out 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/matrixError.vert.out b/deps/glslang/Test/baseResults/matrixError.vert.out new file mode 100644 index 00000000..0a0d1e40 --- /dev/null +++ b/deps/glslang/Test/baseResults/matrixError.vert.out @@ -0,0 +1,77 @@ +matrixError.vert +ERROR: 0:10: 'constructor' : too many arguments +ERROR: 0:7: 'const' : non-matching or non-convertible constant type for const initializer +ERROR: 0:17: 'assign' : cannot convert from ' temp 2-component vector of float' to ' temp 3-component vector of float' +ERROR: 0:18: 'assign' : cannot convert from ' temp 2-component vector of float' to ' temp 3-component vector of float' +ERROR: 0:19: 'xy' : does not apply to this type: temp 2X3 matrix of float +ERROR: 0:21: '[' : matrix index out of range '2' +ERROR: 0:21: '[' : vector index out of range '4' +ERROR: 0:22: 'assign' : cannot convert from ' temp 2X3 matrix of float' to ' temp 2X3 matrix of float' +ERROR: 0:23: 'assign' : cannot convert from ' uniform 3X2 matrix of float' to ' temp 2X3 matrix of float' +ERROR: 9 compilation errors. No code generated. + + +Shader version: 120 +ERROR: node is still EOpNull! +0:12 Function Definition: main( ( global void) +0:12 Function Parameters: +0:? Sequence +0:17 'a' ( temp 3-component vector of float) +0:18 'b' ( temp 3-component vector of float) +0:19 'm23' ( temp 2X3 matrix of float) +0:21 move second child to first child ( temp 4-component vector of float) +0:21 'gl_Position' ( gl_Position 4-component vector of float Position) +0:21 Construct vec4 ( temp 4-component vector of float) +0:21 matrix-times-vector ( temp 3-component vector of float) +0:21 matrix-multiply ( temp 3X3 matrix of float) +0:21 'm23' ( temp 2X3 matrix of float) +0:21 'm32' ( uniform 3X2 matrix of float) +0:21 'v3' ( in 3-component vector of float) +0:21 direct index ( temp float) +0:21 direct index ( temp 4-component vector of float) +0:21 'm24' ( temp 2X4 matrix of float) +0:21 Constant: +0:21 2 (const int) +0:21 Constant: +0:21 4 (const int) +0:22 'm23' ( temp 2X3 matrix of float) +0:23 'm23' ( temp 2X3 matrix of float) +0:? Linker Objects +0:? 'v3' ( in 3-component vector of float) +0:? 'm32' ( uniform 3X2 matrix of float) +0:? 'm24' ( temp 2X4 matrix of float) + + +Linked vertex stage: + + +Shader version: 120 +ERROR: node is still EOpNull! +0:12 Function Definition: main( ( global void) +0:12 Function Parameters: +0:? Sequence +0:17 'a' ( temp 3-component vector of float) +0:18 'b' ( temp 3-component vector of float) +0:19 'm23' ( temp 2X3 matrix of float) +0:21 move second child to first child ( temp 4-component vector of float) +0:21 'gl_Position' ( gl_Position 4-component vector of float Position) +0:21 Construct vec4 ( temp 4-component vector of float) +0:21 matrix-times-vector ( temp 3-component vector of float) +0:21 matrix-multiply ( temp 3X3 matrix of float) +0:21 'm23' ( temp 2X3 matrix of float) +0:21 'm32' ( uniform 3X2 matrix of float) +0:21 'v3' ( in 3-component vector of float) +0:21 direct index ( temp float) +0:21 direct index ( temp 4-component vector of float) +0:21 'm24' ( temp 2X4 matrix of float) +0:21 Constant: +0:21 2 (const int) +0:21 Constant: +0:21 4 (const int) +0:22 'm23' ( temp 2X3 matrix of float) +0:23 'm23' ( temp 2X3 matrix of float) +0:? Linker Objects +0:? 'v3' ( in 3-component vector of float) +0:? 'm32' ( uniform 3X2 matrix of float) +0:? 'm24' ( temp 2X4 matrix of float) + diff --git a/deps/glslang/Test/baseResults/maxClipDistances.vert.out b/deps/glslang/Test/baseResults/maxClipDistances.vert.out new file mode 100644 index 00000000..8086d524 --- /dev/null +++ b/deps/glslang/Test/baseResults/maxClipDistances.vert.out @@ -0,0 +1,21 @@ +maxClipDistances.vert +Shader version: 130 +0:? Sequence +0:5 Function Definition: main( ( global void) +0:5 Function Parameters: +0:? Linker Objects +0:? 'gl_ClipDistance' ( smooth out 8-element array of float ClipDistance) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) + + +Linked vertex stage: + + +Shader version: 130 +0:? Sequence +0:5 Function Definition: main( ( global void) +0:5 Function Parameters: +0:? Linker Objects +0:? 'gl_ClipDistance' ( smooth out 8-element array of float ClipDistance) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) + diff --git a/deps/glslang/Test/baseResults/max_vertices_0.geom.out b/deps/glslang/Test/baseResults/max_vertices_0.geom.out new file mode 100644 index 00000000..d3bb4eee --- /dev/null +++ b/deps/glslang/Test/baseResults/max_vertices_0.geom.out @@ -0,0 +1,35 @@ +max_vertices_0.geom +Shader version: 330 +invocations = -1 +max_vertices = 0 +input primitive = points +output primitive = triangle_strip +0:? Sequence +0:8 Function Definition: main( ( global void) +0:8 Function Parameters: +0:10 Sequence +0:10 EndPrimitive ( global void) +0:11 EndPrimitive ( global void) +0:? Linker Objects +0:? 'v_geom_FragColor' ( in 1-element array of 4-component vector of float) +0:? 'v_frag_FragColor' (layout( stream=0) out 4-component vector of float) + + +Linked geometry stage: + + +Shader version: 330 +invocations = 1 +max_vertices = 0 +input primitive = points +output primitive = triangle_strip +0:? Sequence +0:8 Function Definition: main( ( global void) +0:8 Function Parameters: +0:10 Sequence +0:10 EndPrimitive ( global void) +0:11 EndPrimitive ( global void) +0:? Linker Objects +0:? 'v_geom_FragColor' ( in 1-element array of 4-component vector of float) +0:? 'v_frag_FragColor' (layout( stream=0) out 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/missingBodies.vert.out b/deps/glslang/Test/baseResults/missingBodies.vert.out new file mode 100644 index 00000000..3a9a99f6 --- /dev/null +++ b/deps/glslang/Test/baseResults/missingBodies.vert.out @@ -0,0 +1,96 @@ +missingBodies.vert +Shader version: 450 +0:? Sequence +0:4 Function Definition: foo( ( global void) +0:4 Function Parameters: +0:4 Sequence +0:4 Function Call: bar( ( global void) +0:8 Function Definition: C(i1;i1; ( global void) +0:8 Function Parameters: +0:8 '' ( in int) +0:8 '' ( in int) +0:10 Function Definition: A( ( global void) +0:10 Function Parameters: +0:10 Sequence +0:10 Function Call: B( ( global void) +0:10 Function Call: C(i1; ( global void) +0:10 Constant: +0:10 1 (const int) +0:10 Function Call: C(b1; ( global void) +0:10 Constant: +0:10 true (const bool) +0:10 Function Call: C(i1;i1; ( global void) +0:10 Constant: +0:10 1 (const int) +0:10 Constant: +0:10 2 (const int) +0:12 Function Definition: main( ( global void) +0:12 Function Parameters: +0:14 Sequence +0:14 Function Call: foo( ( global void) +0:15 Function Call: C(b1; ( global void) +0:15 Constant: +0:15 true (const bool) +0:20 Sequence +0:20 move second child to first child ( temp int) +0:20 'f1' ( global int) +0:20 Function Call: ret1( ( global int) +0:22 Function Definition: ret2( ( global int) +0:22 Function Parameters: +0:22 Sequence +0:22 Branch: Return with expression +0:22 Constant: +0:22 3 (const int) +0:24 Sequence +0:24 move second child to first child ( temp int) +0:24 'f2' ( global int) +0:24 Function Call: ret2( ( global int) +0:? Linker Objects +0:? 'f1' ( global int) +0:? 'f2' ( global int) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + +ERROR: Linking vertex stage: No function definition (body) found: + ret1( +ERROR: Linking vertex stage: No function definition (body) found: + C(b1; +ERROR: Linking vertex stage: No function definition (body) found: + bar( + +Shader version: 450 +0:? Sequence +0:4 Function Definition: foo( ( global void) +0:4 Function Parameters: +0:4 Sequence +0:4 Function Call: bar( ( global void) +0:12 Function Definition: main( ( global void) +0:12 Function Parameters: +0:14 Sequence +0:14 Function Call: foo( ( global void) +0:15 Function Call: C(b1; ( global void) +0:15 Constant: +0:15 true (const bool) +0:20 Sequence +0:20 move second child to first child ( temp int) +0:20 'f1' ( global int) +0:20 Function Call: ret1( ( global int) +0:22 Function Definition: ret2( ( global int) +0:22 Function Parameters: +0:22 Sequence +0:22 Branch: Return with expression +0:22 Constant: +0:22 3 (const int) +0:24 Sequence +0:24 move second child to first child ( temp int) +0:24 'f2' ( global int) +0:24 Function Call: ret2( ( global int) +0:? Linker Objects +0:? 'f1' ( global int) +0:? 'f2' ( global int) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/mixedArrayDecls.frag.out b/deps/glslang/Test/baseResults/mixedArrayDecls.frag.out new file mode 100644 index 00000000..598b8281 --- /dev/null +++ b/deps/glslang/Test/baseResults/mixedArrayDecls.frag.out @@ -0,0 +1,68 @@ +mixedArrayDecls.frag +ERROR: 0:30: '' : syntax error, unexpected LEFT_PAREN, expecting COMMA or SEMICOLON +ERROR: 1 compilation errors. No code generated. + + +Shader version: 450 +ERROR: node is still EOpNull! +0:16 Function Definition: foo(i1[14][15][6]; ( global 14-element array of 15-element array of 6-element array of int) +0:16 Function Parameters: +0:16 'p' ( in 14-element array of 15-element array of 6-element array of int) +0:16 Sequence +0:16 Branch: Return with expression +0:16 'p' ( in 14-element array of 15-element array of 6-element array of int) +0:18 Function Definition: main( ( global void) +0:18 Function Parameters: +0:20 Sequence +0:20 direct index ( temp 14-element array of int) +0:20 'g' ( global unsized 4-element array of 14-element array of int) +0:20 Constant: +0:20 3 (const int) +0:21 direct index ( temp 14-element array of int) +0:21 'h' ( global unsized 3-element array of 14-element array of int) +0:21 Constant: +0:21 2 (const int) +0:24 Function Definition: bar( ( global 4-element array of 3-element array of 2-element array of float) +0:24 Function Parameters: +0:? Sequence +0:24 Branch: Return with expression +0:24 'a' ( temp 4-element array of 3-element array of 2-element array of float) +0:? Linker Objects +0:? 's' ( global structure{ global 2-element array of 3-element array of int a, global 5-element array of 3-element array of int b}) +0:? 'c' ( global 4-element array of 5-element array of int) +0:? 'd' ( global 8-element array of 5-element array of int) +0:? 'e' ( global 11-element array of 9-element array of int) +0:? 'f' ( global 13-element array of 9-element array of int) +0:? 'g' ( global unsized 4-element array of 14-element array of int) +0:? 'h' ( global unsized 3-element array of 14-element array of int) +0:? 'inbinst' ( in 4-element array of 5-element array of 6-element array of block{ in 8-element array of 9-element array of 7-element array of float f}) +0:? 'barm' ( global 4-element array of 3-element array of 2-element array of float) + + +Linked fragment stage: + + +Shader version: 450 +ERROR: node is still EOpNull! +0:18 Function Definition: main( ( global void) +0:18 Function Parameters: +0:20 Sequence +0:20 direct index ( temp 14-element array of int) +0:20 'g' ( global 4-element array of 14-element array of int) +0:20 Constant: +0:20 3 (const int) +0:21 direct index ( temp 14-element array of int) +0:21 'h' ( global 3-element array of 14-element array of int) +0:21 Constant: +0:21 2 (const int) +0:? Linker Objects +0:? 's' ( global structure{ global 2-element array of 3-element array of int a, global 5-element array of 3-element array of int b}) +0:? 'c' ( global 4-element array of 5-element array of int) +0:? 'd' ( global 8-element array of 5-element array of int) +0:? 'e' ( global 11-element array of 9-element array of int) +0:? 'f' ( global 13-element array of 9-element array of int) +0:? 'g' ( global 4-element array of 14-element array of int) +0:? 'h' ( global 3-element array of 14-element array of int) +0:? 'inbinst' ( in 4-element array of 5-element array of 6-element array of block{ in 8-element array of 9-element array of 7-element array of float f}) +0:? 'barm' ( global 4-element array of 3-element array of 2-element array of float) + diff --git a/deps/glslang/Test/baseResults/negativeArraySize.comp.out b/deps/glslang/Test/baseResults/negativeArraySize.comp.out new file mode 100644 index 00000000..0a5ba310 --- /dev/null +++ b/deps/glslang/Test/baseResults/negativeArraySize.comp.out @@ -0,0 +1,23 @@ +negativeArraySize.comp +ERROR: 0:9: '' : array size must be a positive integer +ERROR: 1 compilation errors. No code generated. + + +Shader version: 310 +local_size = (1, 1, 1) +ERROR: node is still EOpNull! +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:? Linker Objects + + +Linked compute stage: + + +Shader version: 310 +local_size = (1, 1, 1) +ERROR: node is still EOpNull! +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:? Linker Objects + diff --git a/deps/glslang/Test/baseResults/newTexture.frag.out b/deps/glslang/Test/baseResults/newTexture.frag.out new file mode 100644 index 00000000..52921e8f --- /dev/null +++ b/deps/glslang/Test/baseResults/newTexture.frag.out @@ -0,0 +1,521 @@ +newTexture.frag +Shader version: 430 +0:? Sequence +0:36 Function Definition: main( ( global void) +0:36 Function Parameters: +0:38 Sequence +0:38 Sequence +0:38 move second child to first child ( temp 4-component vector of float) +0:38 'v' ( temp 4-component vector of float) +0:38 texture ( global 4-component vector of float) +0:38 's2D' ( uniform sampler2D) +0:38 'c2D' ( smooth in 2-component vector of float) +0:39 add second child into first child ( temp 4-component vector of float) +0:39 'v' ( temp 4-component vector of float) +0:39 textureProj ( global 4-component vector of float) +0:39 's3D' ( uniform sampler3D) +0:39 'c4D' ( smooth in 4-component vector of float) +0:40 add second child into first child ( temp 4-component vector of float) +0:40 'v' ( temp 4-component vector of float) +0:40 textureLod ( global 4-component vector of float) +0:40 's2DArray' ( uniform sampler2DArray) +0:40 'c3D' ( smooth in 3-component vector of float) +0:40 Constant: +0:40 1.200000 +0:41 add second child into first child ( temp float) +0:41 direct index ( temp float) +0:41 'v' ( temp 4-component vector of float) +0:41 Constant: +0:41 1 (const int) +0:41 textureOffset ( global float) +0:41 's2DShadow' ( uniform sampler2DShadow) +0:41 'c3D' ( smooth in 3-component vector of float) +0:41 Constant: +0:41 3 (const int) +0:41 3 (const int) +0:41 'c1D' ( smooth in float) +0:42 add second child into first child ( temp 4-component vector of float) +0:42 'v' ( temp 4-component vector of float) +0:42 textureFetch ( global 4-component vector of float) +0:42 's3D' ( uniform sampler3D) +0:42 'ic3D' ( flat in 3-component vector of int) +0:42 'ic1D' ( flat in int) +0:43 add second child into first child ( temp 4-component vector of float) +0:43 'v' ( temp 4-component vector of float) +0:43 textureFetchOffset ( global 4-component vector of float) +0:43 's2D' ( uniform sampler2D) +0:43 'ic2D' ( flat in 2-component vector of int) +0:43 Constant: +0:43 4 (const int) +0:43 Constant: +0:43 3 (const int) +0:43 3 (const int) +0:44 add second child into first child ( temp 4-component vector of float) +0:44 'v' ( temp 4-component vector of float) +0:44 textureFetchOffset ( global 4-component vector of float) +0:44 'sr' ( uniform sampler2DRect) +0:44 'ic2D' ( flat in 2-component vector of int) +0:44 Constant: +0:44 4 (const int) +0:44 4 (const int) +0:45 add second child into first child ( temp float) +0:45 direct index ( temp float) +0:45 'v' ( temp 4-component vector of float) +0:45 Constant: +0:45 1 (const int) +0:45 textureLodOffset ( global float) +0:45 's2DShadow' ( uniform sampler2DShadow) +0:45 'c3D' ( smooth in 3-component vector of float) +0:45 'c1D' ( smooth in float) +0:45 Constant: +0:45 3 (const int) +0:45 3 (const int) +0:46 add second child into first child ( temp 4-component vector of float) +0:46 'v' ( temp 4-component vector of float) +0:46 textureProjLodOffset ( global 4-component vector of float) +0:46 's2D' ( uniform sampler2D) +0:46 'c3D' ( smooth in 3-component vector of float) +0:46 'c1D' ( smooth in float) +0:46 Constant: +0:46 3 (const int) +0:46 3 (const int) +0:47 add second child into first child ( temp 4-component vector of float) +0:47 'v' ( temp 4-component vector of float) +0:47 textureGrad ( global 4-component vector of float) +0:47 'sCube' ( uniform samplerCube) +0:47 'c3D' ( smooth in 3-component vector of float) +0:47 'c3D' ( smooth in 3-component vector of float) +0:47 'c3D' ( smooth in 3-component vector of float) +0:48 add second child into first child ( temp float) +0:48 direct index ( temp float) +0:48 'v' ( temp 4-component vector of float) +0:48 Constant: +0:48 0 (const int) +0:48 textureGradOffset ( global float) +0:48 's2DArrayShadow' ( uniform sampler2DArrayShadow) +0:48 'c4D' ( smooth in 4-component vector of float) +0:48 'c2D' ( smooth in 2-component vector of float) +0:48 'c2D' ( smooth in 2-component vector of float) +0:48 Constant: +0:48 3 (const int) +0:48 3 (const int) +0:49 add second child into first child ( temp 4-component vector of float) +0:49 'v' ( temp 4-component vector of float) +0:49 textureProjGrad ( global 4-component vector of float) +0:49 's3D' ( uniform sampler3D) +0:49 'c4D' ( smooth in 4-component vector of float) +0:49 'c3D' ( smooth in 3-component vector of float) +0:49 'c3D' ( smooth in 3-component vector of float) +0:50 add second child into first child ( temp 4-component vector of float) +0:50 'v' ( temp 4-component vector of float) +0:50 textureProjGradOffset ( global 4-component vector of float) +0:50 's2D' ( uniform sampler2D) +0:50 'c3D' ( smooth in 3-component vector of float) +0:50 'c2D' ( smooth in 2-component vector of float) +0:50 'c2D' ( smooth in 2-component vector of float) +0:50 Constant: +0:50 3 (const int) +0:50 3 (const int) +0:52 Sequence +0:52 move second child to first child ( temp 4-component vector of int) +0:52 'iv' ( temp 4-component vector of int) +0:52 texture ( global 4-component vector of int) +0:52 'is2D' ( uniform isampler2D) +0:52 'c2D' ( smooth in 2-component vector of float) +0:53 add second child into first child ( temp 4-component vector of float) +0:53 'v' ( temp 4-component vector of float) +0:53 Convert int to float ( temp 4-component vector of float) +0:53 'iv' ( temp 4-component vector of int) +0:54 move second child to first child ( temp 4-component vector of int) +0:54 'iv' ( temp 4-component vector of int) +0:54 textureProjOffset ( global 4-component vector of int) +0:54 'is2D' ( uniform isampler2D) +0:54 'c4D' ( smooth in 4-component vector of float) +0:54 Constant: +0:54 3 (const int) +0:54 3 (const int) +0:55 add second child into first child ( temp 4-component vector of float) +0:55 'v' ( temp 4-component vector of float) +0:55 Convert int to float ( temp 4-component vector of float) +0:55 'iv' ( temp 4-component vector of int) +0:56 move second child to first child ( temp 4-component vector of int) +0:56 'iv' ( temp 4-component vector of int) +0:56 textureProjLod ( global 4-component vector of int) +0:56 'is2D' ( uniform isampler2D) +0:56 'c3D' ( smooth in 3-component vector of float) +0:56 'c1D' ( smooth in float) +0:57 add second child into first child ( temp 4-component vector of float) +0:57 'v' ( temp 4-component vector of float) +0:57 Convert int to float ( temp 4-component vector of float) +0:57 'iv' ( temp 4-component vector of int) +0:58 move second child to first child ( temp 4-component vector of int) +0:58 'iv' ( temp 4-component vector of int) +0:58 textureProjGrad ( global 4-component vector of int) +0:58 'is2D' ( uniform isampler2D) +0:58 'c3D' ( smooth in 3-component vector of float) +0:58 'c2D' ( smooth in 2-component vector of float) +0:58 'c2D' ( smooth in 2-component vector of float) +0:59 add second child into first child ( temp 4-component vector of float) +0:59 'v' ( temp 4-component vector of float) +0:59 Convert int to float ( temp 4-component vector of float) +0:59 'iv' ( temp 4-component vector of int) +0:60 move second child to first child ( temp 4-component vector of int) +0:60 'iv' ( temp 4-component vector of int) +0:60 texture ( global 4-component vector of int) +0:60 'is3D' ( uniform isampler3D) +0:60 'c3D' ( smooth in 3-component vector of float) +0:60 Constant: +0:60 4.200000 +0:61 add second child into first child ( temp 4-component vector of float) +0:61 'v' ( temp 4-component vector of float) +0:61 Convert int to float ( temp 4-component vector of float) +0:61 'iv' ( temp 4-component vector of int) +0:62 move second child to first child ( temp 4-component vector of int) +0:62 'iv' ( temp 4-component vector of int) +0:62 textureLod ( global 4-component vector of int) +0:62 'isCube' ( uniform isamplerCube) +0:62 'c3D' ( smooth in 3-component vector of float) +0:62 'c1D' ( smooth in float) +0:63 add second child into first child ( temp 4-component vector of float) +0:63 'v' ( temp 4-component vector of float) +0:63 Convert int to float ( temp 4-component vector of float) +0:63 'iv' ( temp 4-component vector of int) +0:64 move second child to first child ( temp 4-component vector of int) +0:64 'iv' ( temp 4-component vector of int) +0:64 textureFetch ( global 4-component vector of int) +0:64 'is2DArray' ( uniform isampler2DArray) +0:64 'ic3D' ( flat in 3-component vector of int) +0:64 'ic1D' ( flat in int) +0:65 add second child into first child ( temp 4-component vector of float) +0:65 'v' ( temp 4-component vector of float) +0:65 Convert int to float ( temp 4-component vector of float) +0:65 'iv' ( temp 4-component vector of int) +0:66 add second child into first child ( temp 4-component vector of int) +0:66 'iv' ( temp 4-component vector of int) +0:66 textureFetch ( global 4-component vector of int) +0:66 'is2Dms' ( uniform isampler2DMS) +0:66 'ic2D' ( flat in 2-component vector of int) +0:66 'ic1D' ( flat in int) +0:67 add second child into first child ( temp 4-component vector of float) +0:67 'v' ( temp 4-component vector of float) +0:67 Convert int to float ( temp 4-component vector of float) +0:67 'iv' ( temp 4-component vector of int) +0:68 add second child into first child ( temp 4-component vector of float) +0:68 'v' ( temp 4-component vector of float) +0:68 textureFetch ( global 4-component vector of float) +0:68 'sb' ( uniform samplerBuffer) +0:68 'ic1D' ( flat in int) +0:69 add second child into first child ( temp 4-component vector of float) +0:69 'v' ( temp 4-component vector of float) +0:69 textureFetch ( global 4-component vector of float) +0:69 'sr' ( uniform sampler2DRect) +0:69 'ic2D' ( flat in 2-component vector of int) +0:71 Sequence +0:71 move second child to first child ( temp 2-component vector of int) +0:71 'iv2' ( temp 2-component vector of int) +0:71 textureSize ( global 2-component vector of int) +0:71 'sCubeShadow' ( uniform samplerCubeShadow) +0:71 Constant: +0:71 2 (const int) +0:74 move second child to first child ( temp 4-component vector of float) +0:74 'FragData' ( out 4-component vector of float) +0:74 add ( temp 4-component vector of float) +0:74 'v' ( temp 4-component vector of float) +0:74 Construct vec4 ( temp 4-component vector of float) +0:74 Convert int to float ( temp 2-component vector of float) +0:74 'iv2' ( temp 2-component vector of int) +0:74 Constant: +0:74 0.000000 +0:74 Constant: +0:74 0.000000 +0:? Linker Objects +0:? 'sb' ( uniform samplerBuffer) +0:? 'sr' ( uniform sampler2DRect) +0:? 's2D' ( uniform sampler2D) +0:? 's3D' ( uniform sampler3D) +0:? 'sCube' ( uniform samplerCube) +0:? 'sCubeShadow' ( uniform samplerCubeShadow) +0:? 's2DShadow' ( uniform sampler2DShadow) +0:? 's2DArray' ( uniform sampler2DArray) +0:? 's2DArrayShadow' ( uniform sampler2DArrayShadow) +0:? 'is2D' ( uniform isampler2D) +0:? 'is3D' ( uniform isampler3D) +0:? 'isCube' ( uniform isamplerCube) +0:? 'is2DArray' ( uniform isampler2DArray) +0:? 'is2Dms' ( uniform isampler2DMS) +0:? 'us2D' ( uniform usampler2D) +0:? 'us3D' ( uniform usampler3D) +0:? 'usCube' ( uniform usamplerCube) +0:? 'us2DArray' ( uniform usampler2DArray) +0:? 'c1D' ( smooth in float) +0:? 'c2D' ( smooth in 2-component vector of float) +0:? 'c3D' ( smooth in 3-component vector of float) +0:? 'c4D' ( smooth in 4-component vector of float) +0:? 'ic1D' ( flat in int) +0:? 'ic2D' ( flat in 2-component vector of int) +0:? 'ic3D' ( flat in 3-component vector of int) +0:? 'ic4D' ( flat in 4-component vector of int) +0:? 'FragData' ( out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 430 +0:? Sequence +0:36 Function Definition: main( ( global void) +0:36 Function Parameters: +0:38 Sequence +0:38 Sequence +0:38 move second child to first child ( temp 4-component vector of float) +0:38 'v' ( temp 4-component vector of float) +0:38 texture ( global 4-component vector of float) +0:38 's2D' ( uniform sampler2D) +0:38 'c2D' ( smooth in 2-component vector of float) +0:39 add second child into first child ( temp 4-component vector of float) +0:39 'v' ( temp 4-component vector of float) +0:39 textureProj ( global 4-component vector of float) +0:39 's3D' ( uniform sampler3D) +0:39 'c4D' ( smooth in 4-component vector of float) +0:40 add second child into first child ( temp 4-component vector of float) +0:40 'v' ( temp 4-component vector of float) +0:40 textureLod ( global 4-component vector of float) +0:40 's2DArray' ( uniform sampler2DArray) +0:40 'c3D' ( smooth in 3-component vector of float) +0:40 Constant: +0:40 1.200000 +0:41 add second child into first child ( temp float) +0:41 direct index ( temp float) +0:41 'v' ( temp 4-component vector of float) +0:41 Constant: +0:41 1 (const int) +0:41 textureOffset ( global float) +0:41 's2DShadow' ( uniform sampler2DShadow) +0:41 'c3D' ( smooth in 3-component vector of float) +0:41 Constant: +0:41 3 (const int) +0:41 3 (const int) +0:41 'c1D' ( smooth in float) +0:42 add second child into first child ( temp 4-component vector of float) +0:42 'v' ( temp 4-component vector of float) +0:42 textureFetch ( global 4-component vector of float) +0:42 's3D' ( uniform sampler3D) +0:42 'ic3D' ( flat in 3-component vector of int) +0:42 'ic1D' ( flat in int) +0:43 add second child into first child ( temp 4-component vector of float) +0:43 'v' ( temp 4-component vector of float) +0:43 textureFetchOffset ( global 4-component vector of float) +0:43 's2D' ( uniform sampler2D) +0:43 'ic2D' ( flat in 2-component vector of int) +0:43 Constant: +0:43 4 (const int) +0:43 Constant: +0:43 3 (const int) +0:43 3 (const int) +0:44 add second child into first child ( temp 4-component vector of float) +0:44 'v' ( temp 4-component vector of float) +0:44 textureFetchOffset ( global 4-component vector of float) +0:44 'sr' ( uniform sampler2DRect) +0:44 'ic2D' ( flat in 2-component vector of int) +0:44 Constant: +0:44 4 (const int) +0:44 4 (const int) +0:45 add second child into first child ( temp float) +0:45 direct index ( temp float) +0:45 'v' ( temp 4-component vector of float) +0:45 Constant: +0:45 1 (const int) +0:45 textureLodOffset ( global float) +0:45 's2DShadow' ( uniform sampler2DShadow) +0:45 'c3D' ( smooth in 3-component vector of float) +0:45 'c1D' ( smooth in float) +0:45 Constant: +0:45 3 (const int) +0:45 3 (const int) +0:46 add second child into first child ( temp 4-component vector of float) +0:46 'v' ( temp 4-component vector of float) +0:46 textureProjLodOffset ( global 4-component vector of float) +0:46 's2D' ( uniform sampler2D) +0:46 'c3D' ( smooth in 3-component vector of float) +0:46 'c1D' ( smooth in float) +0:46 Constant: +0:46 3 (const int) +0:46 3 (const int) +0:47 add second child into first child ( temp 4-component vector of float) +0:47 'v' ( temp 4-component vector of float) +0:47 textureGrad ( global 4-component vector of float) +0:47 'sCube' ( uniform samplerCube) +0:47 'c3D' ( smooth in 3-component vector of float) +0:47 'c3D' ( smooth in 3-component vector of float) +0:47 'c3D' ( smooth in 3-component vector of float) +0:48 add second child into first child ( temp float) +0:48 direct index ( temp float) +0:48 'v' ( temp 4-component vector of float) +0:48 Constant: +0:48 0 (const int) +0:48 textureGradOffset ( global float) +0:48 's2DArrayShadow' ( uniform sampler2DArrayShadow) +0:48 'c4D' ( smooth in 4-component vector of float) +0:48 'c2D' ( smooth in 2-component vector of float) +0:48 'c2D' ( smooth in 2-component vector of float) +0:48 Constant: +0:48 3 (const int) +0:48 3 (const int) +0:49 add second child into first child ( temp 4-component vector of float) +0:49 'v' ( temp 4-component vector of float) +0:49 textureProjGrad ( global 4-component vector of float) +0:49 's3D' ( uniform sampler3D) +0:49 'c4D' ( smooth in 4-component vector of float) +0:49 'c3D' ( smooth in 3-component vector of float) +0:49 'c3D' ( smooth in 3-component vector of float) +0:50 add second child into first child ( temp 4-component vector of float) +0:50 'v' ( temp 4-component vector of float) +0:50 textureProjGradOffset ( global 4-component vector of float) +0:50 's2D' ( uniform sampler2D) +0:50 'c3D' ( smooth in 3-component vector of float) +0:50 'c2D' ( smooth in 2-component vector of float) +0:50 'c2D' ( smooth in 2-component vector of float) +0:50 Constant: +0:50 3 (const int) +0:50 3 (const int) +0:52 Sequence +0:52 move second child to first child ( temp 4-component vector of int) +0:52 'iv' ( temp 4-component vector of int) +0:52 texture ( global 4-component vector of int) +0:52 'is2D' ( uniform isampler2D) +0:52 'c2D' ( smooth in 2-component vector of float) +0:53 add second child into first child ( temp 4-component vector of float) +0:53 'v' ( temp 4-component vector of float) +0:53 Convert int to float ( temp 4-component vector of float) +0:53 'iv' ( temp 4-component vector of int) +0:54 move second child to first child ( temp 4-component vector of int) +0:54 'iv' ( temp 4-component vector of int) +0:54 textureProjOffset ( global 4-component vector of int) +0:54 'is2D' ( uniform isampler2D) +0:54 'c4D' ( smooth in 4-component vector of float) +0:54 Constant: +0:54 3 (const int) +0:54 3 (const int) +0:55 add second child into first child ( temp 4-component vector of float) +0:55 'v' ( temp 4-component vector of float) +0:55 Convert int to float ( temp 4-component vector of float) +0:55 'iv' ( temp 4-component vector of int) +0:56 move second child to first child ( temp 4-component vector of int) +0:56 'iv' ( temp 4-component vector of int) +0:56 textureProjLod ( global 4-component vector of int) +0:56 'is2D' ( uniform isampler2D) +0:56 'c3D' ( smooth in 3-component vector of float) +0:56 'c1D' ( smooth in float) +0:57 add second child into first child ( temp 4-component vector of float) +0:57 'v' ( temp 4-component vector of float) +0:57 Convert int to float ( temp 4-component vector of float) +0:57 'iv' ( temp 4-component vector of int) +0:58 move second child to first child ( temp 4-component vector of int) +0:58 'iv' ( temp 4-component vector of int) +0:58 textureProjGrad ( global 4-component vector of int) +0:58 'is2D' ( uniform isampler2D) +0:58 'c3D' ( smooth in 3-component vector of float) +0:58 'c2D' ( smooth in 2-component vector of float) +0:58 'c2D' ( smooth in 2-component vector of float) +0:59 add second child into first child ( temp 4-component vector of float) +0:59 'v' ( temp 4-component vector of float) +0:59 Convert int to float ( temp 4-component vector of float) +0:59 'iv' ( temp 4-component vector of int) +0:60 move second child to first child ( temp 4-component vector of int) +0:60 'iv' ( temp 4-component vector of int) +0:60 texture ( global 4-component vector of int) +0:60 'is3D' ( uniform isampler3D) +0:60 'c3D' ( smooth in 3-component vector of float) +0:60 Constant: +0:60 4.200000 +0:61 add second child into first child ( temp 4-component vector of float) +0:61 'v' ( temp 4-component vector of float) +0:61 Convert int to float ( temp 4-component vector of float) +0:61 'iv' ( temp 4-component vector of int) +0:62 move second child to first child ( temp 4-component vector of int) +0:62 'iv' ( temp 4-component vector of int) +0:62 textureLod ( global 4-component vector of int) +0:62 'isCube' ( uniform isamplerCube) +0:62 'c3D' ( smooth in 3-component vector of float) +0:62 'c1D' ( smooth in float) +0:63 add second child into first child ( temp 4-component vector of float) +0:63 'v' ( temp 4-component vector of float) +0:63 Convert int to float ( temp 4-component vector of float) +0:63 'iv' ( temp 4-component vector of int) +0:64 move second child to first child ( temp 4-component vector of int) +0:64 'iv' ( temp 4-component vector of int) +0:64 textureFetch ( global 4-component vector of int) +0:64 'is2DArray' ( uniform isampler2DArray) +0:64 'ic3D' ( flat in 3-component vector of int) +0:64 'ic1D' ( flat in int) +0:65 add second child into first child ( temp 4-component vector of float) +0:65 'v' ( temp 4-component vector of float) +0:65 Convert int to float ( temp 4-component vector of float) +0:65 'iv' ( temp 4-component vector of int) +0:66 add second child into first child ( temp 4-component vector of int) +0:66 'iv' ( temp 4-component vector of int) +0:66 textureFetch ( global 4-component vector of int) +0:66 'is2Dms' ( uniform isampler2DMS) +0:66 'ic2D' ( flat in 2-component vector of int) +0:66 'ic1D' ( flat in int) +0:67 add second child into first child ( temp 4-component vector of float) +0:67 'v' ( temp 4-component vector of float) +0:67 Convert int to float ( temp 4-component vector of float) +0:67 'iv' ( temp 4-component vector of int) +0:68 add second child into first child ( temp 4-component vector of float) +0:68 'v' ( temp 4-component vector of float) +0:68 textureFetch ( global 4-component vector of float) +0:68 'sb' ( uniform samplerBuffer) +0:68 'ic1D' ( flat in int) +0:69 add second child into first child ( temp 4-component vector of float) +0:69 'v' ( temp 4-component vector of float) +0:69 textureFetch ( global 4-component vector of float) +0:69 'sr' ( uniform sampler2DRect) +0:69 'ic2D' ( flat in 2-component vector of int) +0:71 Sequence +0:71 move second child to first child ( temp 2-component vector of int) +0:71 'iv2' ( temp 2-component vector of int) +0:71 textureSize ( global 2-component vector of int) +0:71 'sCubeShadow' ( uniform samplerCubeShadow) +0:71 Constant: +0:71 2 (const int) +0:74 move second child to first child ( temp 4-component vector of float) +0:74 'FragData' ( out 4-component vector of float) +0:74 add ( temp 4-component vector of float) +0:74 'v' ( temp 4-component vector of float) +0:74 Construct vec4 ( temp 4-component vector of float) +0:74 Convert int to float ( temp 2-component vector of float) +0:74 'iv2' ( temp 2-component vector of int) +0:74 Constant: +0:74 0.000000 +0:74 Constant: +0:74 0.000000 +0:? Linker Objects +0:? 'sb' ( uniform samplerBuffer) +0:? 'sr' ( uniform sampler2DRect) +0:? 's2D' ( uniform sampler2D) +0:? 's3D' ( uniform sampler3D) +0:? 'sCube' ( uniform samplerCube) +0:? 'sCubeShadow' ( uniform samplerCubeShadow) +0:? 's2DShadow' ( uniform sampler2DShadow) +0:? 's2DArray' ( uniform sampler2DArray) +0:? 's2DArrayShadow' ( uniform sampler2DArrayShadow) +0:? 'is2D' ( uniform isampler2D) +0:? 'is3D' ( uniform isampler3D) +0:? 'isCube' ( uniform isamplerCube) +0:? 'is2DArray' ( uniform isampler2DArray) +0:? 'is2Dms' ( uniform isampler2DMS) +0:? 'us2D' ( uniform usampler2D) +0:? 'us3D' ( uniform usampler3D) +0:? 'usCube' ( uniform usamplerCube) +0:? 'us2DArray' ( uniform usampler2DArray) +0:? 'c1D' ( smooth in float) +0:? 'c2D' ( smooth in 2-component vector of float) +0:? 'c3D' ( smooth in 3-component vector of float) +0:? 'c4D' ( smooth in 4-component vector of float) +0:? 'ic1D' ( flat in int) +0:? 'ic2D' ( flat in 2-component vector of int) +0:? 'ic3D' ( flat in 3-component vector of int) +0:? 'ic4D' ( flat in 4-component vector of int) +0:? 'FragData' ( out 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/noMain.vert.out b/deps/glslang/Test/baseResults/noMain.vert.out new file mode 100644 index 00000000..dd262438 --- /dev/null +++ b/deps/glslang/Test/baseResults/noMain.vert.out @@ -0,0 +1,43 @@ +noMain.vert +Shader version: 300 +0:? Sequence +0:3 Function Definition: foo( ( global void) +0:3 Function Parameters: +0:? Linker Objects +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + +mains.frag +ERROR: 0:7: 'main' : function already has a body +ERROR: 1 compilation errors. No code generated. + + +Shader version: 300 +ERROR: node is still EOpNull! +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:? Linker Objects + + +Linked vertex stage: + +ERROR: Linking vertex stage: Missing entry point: Each stage requires one entry point + +Linked fragment stage: + + +Shader version: 300 +0:? Sequence +0:? Linker Objects +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) +Shader version: 300 +ERROR: node is still EOpNull! +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:? Linker Objects + diff --git a/deps/glslang/Test/baseResults/nonSquare.vert.out b/deps/glslang/Test/baseResults/nonSquare.vert.out new file mode 100644 index 00000000..aa8a8273 --- /dev/null +++ b/deps/glslang/Test/baseResults/nonSquare.vert.out @@ -0,0 +1,183 @@ +nonSquare.vert +Shader version: 120 +0:? Sequence +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:? Sequence +0:20 move second child to first child ( temp 2-component vector of float) +0:20 'a' ( temp 2-component vector of float) +0:20 vector-times-matrix ( temp 2-component vector of float) +0:20 'v3' ( in 3-component vector of float) +0:20 'm23' ( temp 2X3 matrix of float) +0:21 move second child to first child ( temp 2-component vector of float) +0:21 'b' ( temp 2-component vector of float) +0:21 matrix-times-vector ( temp 2-component vector of float) +0:21 'm32' ( uniform 3X2 matrix of float) +0:21 'v3' ( in 3-component vector of float) +0:23 move second child to first child ( temp 4-component vector of float) +0:23 'gl_Position' ( gl_Position 4-component vector of float Position) +0:24 add ( temp 4-component vector of float) +0:24 add ( temp 4-component vector of float) +0:24 add ( temp 4-component vector of float) +0:23 add ( temp 4-component vector of float) +0:23 Construct vec4 ( temp 4-component vector of float) +0:23 matrix-times-vector ( temp 3-component vector of float) +0:23 matrix-multiply ( temp 3X3 matrix of float) +0:23 'm23' ( temp 2X3 matrix of float) +0:23 'm32' ( uniform 3X2 matrix of float) +0:23 'v3' ( in 3-component vector of float) +0:23 Constant: +0:23 0.000000 +0:24 matrix-times-vector ( temp 4-component vector of float) +0:24 Constant: +0:24 3.000000 +0:24 6.000000 +0:24 0.000000 +0:24 0.000000 +0:24 9.000000 +0:24 12.000000 +0:24 0.000000 +0:24 0.000000 +0:24 15.000000 +0:24 18.000000 +0:24 0.000000 +0:24 0.000000 +0:24 21.000000 +0:24 24.000000 +0:24 0.000000 +0:24 0.000000 +0:24 'v4' ( in 4-component vector of float) +0:24 Constant: +0:24 50.000000 +0:24 110.000000 +0:24 170.000000 +0:24 230.000000 +0:24 Constant: +0:24 30.000000 +0:24 60.000000 +0:24 0.000000 +0:24 0.000000 +0:24 Constant: +0:24 20.000000 +0:24 10.000000 +0:24 6.000000 +0:24 5.000000 +0:? Linker Objects +0:? 'v3' ( in 3-component vector of float) +0:? 'v4' ( in 4-component vector of float) +0:? 'm32' ( uniform 3X2 matrix of float) +0:? 'cv2' ( const 2-component vector of float) +0:? 10.000000 +0:? 20.000000 +0:? 'm24' ( const 2X4 matrix of float) +0:? 3.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 3.000000 +0:? 0.000000 +0:? 0.000000 +0:? 'm42' ( const 4X2 matrix of float) +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 6.000000 +0:? 7.000000 +0:? 8.000000 + + +Linked vertex stage: + + +Shader version: 120 +0:? Sequence +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:? Sequence +0:20 move second child to first child ( temp 2-component vector of float) +0:20 'a' ( temp 2-component vector of float) +0:20 vector-times-matrix ( temp 2-component vector of float) +0:20 'v3' ( in 3-component vector of float) +0:20 'm23' ( temp 2X3 matrix of float) +0:21 move second child to first child ( temp 2-component vector of float) +0:21 'b' ( temp 2-component vector of float) +0:21 matrix-times-vector ( temp 2-component vector of float) +0:21 'm32' ( uniform 3X2 matrix of float) +0:21 'v3' ( in 3-component vector of float) +0:23 move second child to first child ( temp 4-component vector of float) +0:23 'gl_Position' ( gl_Position 4-component vector of float Position) +0:24 add ( temp 4-component vector of float) +0:24 add ( temp 4-component vector of float) +0:24 add ( temp 4-component vector of float) +0:23 add ( temp 4-component vector of float) +0:23 Construct vec4 ( temp 4-component vector of float) +0:23 matrix-times-vector ( temp 3-component vector of float) +0:23 matrix-multiply ( temp 3X3 matrix of float) +0:23 'm23' ( temp 2X3 matrix of float) +0:23 'm32' ( uniform 3X2 matrix of float) +0:23 'v3' ( in 3-component vector of float) +0:23 Constant: +0:23 0.000000 +0:24 matrix-times-vector ( temp 4-component vector of float) +0:24 Constant: +0:24 3.000000 +0:24 6.000000 +0:24 0.000000 +0:24 0.000000 +0:24 9.000000 +0:24 12.000000 +0:24 0.000000 +0:24 0.000000 +0:24 15.000000 +0:24 18.000000 +0:24 0.000000 +0:24 0.000000 +0:24 21.000000 +0:24 24.000000 +0:24 0.000000 +0:24 0.000000 +0:24 'v4' ( in 4-component vector of float) +0:24 Constant: +0:24 50.000000 +0:24 110.000000 +0:24 170.000000 +0:24 230.000000 +0:24 Constant: +0:24 30.000000 +0:24 60.000000 +0:24 0.000000 +0:24 0.000000 +0:24 Constant: +0:24 20.000000 +0:24 10.000000 +0:24 6.000000 +0:24 5.000000 +0:? Linker Objects +0:? 'v3' ( in 3-component vector of float) +0:? 'v4' ( in 4-component vector of float) +0:? 'm32' ( uniform 3X2 matrix of float) +0:? 'cv2' ( const 2-component vector of float) +0:? 10.000000 +0:? 20.000000 +0:? 'm24' ( const 2X4 matrix of float) +0:? 3.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 3.000000 +0:? 0.000000 +0:? 0.000000 +0:? 'm42' ( const 4X2 matrix of float) +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 5.000000 +0:? 6.000000 +0:? 7.000000 +0:? 8.000000 + diff --git a/deps/glslang/Test/baseResults/nonVulkan.frag.out b/deps/glslang/Test/baseResults/nonVulkan.frag.out new file mode 100644 index 00000000..2b8b6a0c --- /dev/null +++ b/deps/glslang/Test/baseResults/nonVulkan.frag.out @@ -0,0 +1,29 @@ +nonVulkan.frag +ERROR: 0:3: 'constant_id' : only allowed when generating SPIR-V +ERROR: 0:4: 'input_attachment_index' : only allowed when using GLSL for Vulkan +ERROR: 0:4: 'input_attachment_index' : can only be used with a subpass +ERROR: 0:5: 'push_constant' : only allowed when using GLSL for Vulkan +ERROR: 4 compilation errors. No code generated. + + +Shader version: 450 +ERROR: node is still EOpNull! +0:? Linker Objects +0:? 'arraySize' ( specialization-constant const int) +0:? 12 (const int) +0:? 'foo' ( temp int) +0:? 'ubi' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform int a}) + + +Linked fragment stage: + +ERROR: Linking fragment stage: Missing entry point: Each stage requires one entry point + +Shader version: 450 +ERROR: node is still EOpNull! +0:? Linker Objects +0:? 'arraySize' ( specialization-constant const int) +0:? 12 (const int) +0:? 'foo' ( temp int) +0:? 'ubi' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform int a}) + diff --git a/deps/glslang/Test/baseResults/nonuniform.frag.out b/deps/glslang/Test/baseResults/nonuniform.frag.out new file mode 100644 index 00000000..2d4e9b01 --- /dev/null +++ b/deps/glslang/Test/baseResults/nonuniform.frag.out @@ -0,0 +1,92 @@ +nonuniform.frag +ERROR: 0:10: 'nonuniformEXT' : for non-parameter, can only apply to 'in' or no storage qualifier +ERROR: 0:11: 'nonuniformEXT' : for non-parameter, can only apply to 'in' or no storage qualifier +ERROR: 0:12: 'nonuniformEXT' : for non-parameter, can only apply to 'in' or no storage qualifier +ERROR: 0:22: 'nonuniformEXT' : for non-parameter, can only apply to 'in' or no storage qualifier +ERROR: 0:28: 'constructor' : too many arguments +ERROR: 0:28: 'assign' : cannot convert from ' const float' to ' nonuniform temp int' +ERROR: 0:29: 'constructor' : not enough data provided for construction +ERROR: 0:29: 'assign' : cannot convert from ' const float' to ' nonuniform temp int' +ERROR: 0:32: 'nonuniformEXT' : not allowed on block or structure members +ERROR: 0:33: 'nonuniformEXT' : not allowed on block or structure members +ERROR: 10 compilation errors. No code generated. + + +Shader version: 450 +Requested GL_EXT_nonuniform_qualifier +ERROR: node is still EOpNull! +0:14 Function Definition: foo(i1;i1; ( nonuniform temp int) +0:14 Function Parameters: +0:14 'nupi' ( nonuniform in int) +0:14 'f' ( nonuniform out int) +0:16 Sequence +0:16 Branch: Return with expression +0:16 'nupi' ( nonuniform in int) +0:19 Function Definition: main( ( global void) +0:19 Function Parameters: +0:? Sequence +0:24 Function Call: foo(i1;i1; ( nonuniform temp int) +0:24 'nu_li' ( nonuniform temp int) +0:24 'nu_li' ( nonuniform temp int) +0:27 move second child to first child ( temp int) +0:27 'nu_li' ( nonuniform temp int) +0:27 add ( nonuniform temp int) +0:27 'a' ( nonuniform temp int) +0:27 component-wise multiply ( nonuniform temp int) +0:27 'a' ( temp int) +0:27 Constant: +0:27 2 (const int) +0:28 'nu_li' ( nonuniform temp int) +0:29 'nu_li' ( nonuniform temp int) +0:? Linker Objects +0:? 'nonuniformEXT' ( global int) +0:? 'nu_inv4' ( smooth nonuniform in 4-component vector of float) +0:? 'nu_gf' ( nonuniform temp float) +0:? 'nu_outv4' ( nonuniform out 4-component vector of float) +0:? 'nu_uv4' ( nonuniform uniform 4-component vector of float) +0:? 'nu_constf' ( nonuniform const float) +0:? 1.000000 +0:? 'ins' (layout( location=1) smooth in structure{ global float a, temp float b}) +0:? 'inb' (layout( location=3) in block{ in float a, in float b}) + + +Linked fragment stage: + + +Shader version: 450 +Requested GL_EXT_nonuniform_qualifier +ERROR: node is still EOpNull! +0:14 Function Definition: foo(i1;i1; ( nonuniform temp int) +0:14 Function Parameters: +0:14 'nupi' ( nonuniform in int) +0:14 'f' ( nonuniform out int) +0:16 Sequence +0:16 Branch: Return with expression +0:16 'nupi' ( nonuniform in int) +0:19 Function Definition: main( ( global void) +0:19 Function Parameters: +0:? Sequence +0:24 Function Call: foo(i1;i1; ( nonuniform temp int) +0:24 'nu_li' ( nonuniform temp int) +0:24 'nu_li' ( nonuniform temp int) +0:27 move second child to first child ( temp int) +0:27 'nu_li' ( nonuniform temp int) +0:27 add ( nonuniform temp int) +0:27 'a' ( nonuniform temp int) +0:27 component-wise multiply ( nonuniform temp int) +0:27 'a' ( temp int) +0:27 Constant: +0:27 2 (const int) +0:28 'nu_li' ( nonuniform temp int) +0:29 'nu_li' ( nonuniform temp int) +0:? Linker Objects +0:? 'nonuniformEXT' ( global int) +0:? 'nu_inv4' ( smooth nonuniform in 4-component vector of float) +0:? 'nu_gf' ( nonuniform temp float) +0:? 'nu_outv4' ( nonuniform out 4-component vector of float) +0:? 'nu_uv4' ( nonuniform uniform 4-component vector of float) +0:? 'nu_constf' ( nonuniform const float) +0:? 1.000000 +0:? 'ins' (layout( location=1) smooth in structure{ global float a, temp float b}) +0:? 'inb' (layout( location=3) in block{ in float a, in float b}) + diff --git a/deps/glslang/Test/baseResults/nosuffix.out b/deps/glslang/Test/baseResults/nosuffix.out new file mode 100644 index 00000000..d881c5b8 --- /dev/null +++ b/deps/glslang/Test/baseResults/nosuffix.out @@ -0,0 +1,15 @@ +nosuffix +Shader version: 100 +0:? Sequence +0:1 Function Definition: main( ( global void) +0:1 Function Parameters: +0:3 Sequence +0:3 move second child to first child ( temp highp 4-component vector of float) +0:3 'gl_Position' ( gl_Position highp 4-component vector of float Position) +0:3 Constant: +0:3 1.000000 +0:3 1.000000 +0:3 1.000000 +0:3 1.000000 +0:? Linker Objects + diff --git a/deps/glslang/Test/baseResults/numeral.frag.out b/deps/glslang/Test/baseResults/numeral.frag.out new file mode 100644 index 00000000..b7c0a78b --- /dev/null +++ b/deps/glslang/Test/baseResults/numeral.frag.out @@ -0,0 +1,832 @@ +numeral.frag +ERROR: 0:14: '' : octal literal digit too large +ERROR: 0:15: '' : octal literal digit too large +ERROR: 0:16: '' : octal literal digit too large +ERROR: 0:17: '' : octal literal too big +ERROR: 0:18: '' : octal literal too big +ERROR: 0:23: '' : octal literal digit too large +ERROR: 0:24: '' : octal literal digit too large +ERROR: 0:49: '' : bad digit in hexadecimal literal +ERROR: 0:50: '' : hexadecimal literal too big +ERROR: 0:88: '' : float literal needs a decimal point or exponent +ERROR: 0:98: '' : numeric literal too big +ERROR: 0:101: '' : numeric literal too big +ERROR: 0:104: '#' : preprocessor directive cannot be preceded by another token +ERROR: 0:104: '' : syntax error, unexpected $end, expecting COMMA or SEMICOLON +ERROR: 14 compilation errors. No code generated. + + +Shader version: 400 +ERROR: node is still EOpNull! +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:5 Sequence +0:5 Sequence +0:5 move second child to first child ( temp int) +0:5 'o00' ( temp int) +0:5 Constant: +0:5 0 (const int) +0:6 Sequence +0:6 move second child to first child ( temp int) +0:6 'o000' ( temp int) +0:6 Constant: +0:6 0 (const int) +0:7 Sequence +0:7 move second child to first child ( temp int) +0:7 'o0000' ( temp int) +0:7 Constant: +0:7 0 (const int) +0:8 Sequence +0:8 move second child to first child ( temp int) +0:8 'o5' ( temp int) +0:8 Constant: +0:8 5 (const int) +0:9 Sequence +0:9 move second child to first child ( temp int) +0:9 'o05' ( temp int) +0:9 Constant: +0:9 5 (const int) +0:10 Sequence +0:10 move second child to first child ( temp int) +0:10 'o006' ( temp int) +0:10 Constant: +0:10 6 (const int) +0:11 Sequence +0:11 move second child to first child ( temp int) +0:11 'o7' ( temp int) +0:11 Constant: +0:11 7 (const int) +0:12 Sequence +0:12 move second child to first child ( temp int) +0:12 'o58' ( temp int) +0:12 Constant: +0:12 58 (const int) +0:13 Sequence +0:13 move second child to first child ( temp int) +0:13 'omax' ( temp int) +0:13 Constant: +0:13 -1 (const int) +0:14 Sequence +0:14 move second child to first child ( temp int) +0:14 'o8' ( temp int) +0:14 Constant: +0:14 0 (const int) +0:15 Sequence +0:15 move second child to first child ( temp int) +0:15 'o08' ( temp int) +0:15 Constant: +0:15 0 (const int) +0:16 Sequence +0:16 move second child to first child ( temp int) +0:16 'o009' ( temp int) +0:16 Constant: +0:16 0 (const int) +0:17 Sequence +0:17 move second child to first child ( temp int) +0:17 'obig' ( temp int) +0:17 Constant: +0:17 -1662398820 (const int) +0:18 Sequence +0:18 move second child to first child ( temp int) +0:18 'omax1' ( temp int) +0:18 Constant: +0:18 0 (const int) +0:20 Sequence +0:20 move second child to first child ( temp uint) +0:20 'uo5' ( temp uint) +0:20 Constant: +0:20 5 (const uint) +0:21 Sequence +0:21 move second child to first child ( temp uint) +0:21 'uo6' ( temp uint) +0:21 Constant: +0:21 6 (const uint) +0:22 Sequence +0:22 move second child to first child ( temp uint) +0:22 'uo7' ( temp uint) +0:22 Constant: +0:22 7 (const uint) +0:23 Sequence +0:23 move second child to first child ( temp uint) +0:23 'uo8' ( temp uint) +0:23 Constant: +0:23 0 (const uint) +0:24 Sequence +0:24 move second child to first child ( temp uint) +0:24 'uo9' ( temp uint) +0:24 Constant: +0:24 0 (const uint) +0:26 Sequence +0:26 move second child to first child ( temp int) +0:26 'h0' ( temp int) +0:26 Constant: +0:26 0 (const int) +0:27 Sequence +0:27 move second child to first child ( temp int) +0:27 'h00' ( temp int) +0:27 Constant: +0:27 0 (const int) +0:28 Sequence +0:28 move second child to first child ( temp int) +0:28 'h000' ( temp int) +0:28 Constant: +0:28 0 (const int) +0:29 Sequence +0:29 move second child to first child ( temp int) +0:29 'h1' ( temp int) +0:29 Constant: +0:29 1 (const int) +0:30 Sequence +0:30 move second child to first child ( temp int) +0:30 'h2' ( temp int) +0:30 Constant: +0:30 2 (const int) +0:31 Sequence +0:31 move second child to first child ( temp int) +0:31 'h300' ( temp int) +0:31 Constant: +0:31 768 (const int) +0:32 Sequence +0:32 move second child to first child ( temp int) +0:32 'hABCDEF' ( temp int) +0:32 Constant: +0:32 11259375 (const int) +0:33 Sequence +0:33 move second child to first child ( temp int) +0:33 'hFFFFFFFF' ( temp int) +0:33 Constant: +0:33 -1 (const int) +0:34 Sequence +0:34 move second child to first child ( temp int) +0:34 'h12345678' ( temp int) +0:34 Constant: +0:34 12345678 (const int) +0:35 Sequence +0:35 move second child to first child ( temp int) +0:35 'hToBeOrNotToBe' ( temp int) +0:35 Constant: +0:35 -1 (const int) +0:37 Sequence +0:37 move second child to first child ( temp uint) +0:37 'uh0' ( temp uint) +0:37 Constant: +0:37 0 (const uint) +0:38 Sequence +0:38 move second child to first child ( temp uint) +0:38 'uhg' ( temp uint) +0:38 Constant: +0:38 12 (const uint) +0:39 Sequence +0:39 move second child to first child ( temp uint) +0:39 'uh000' ( temp uint) +0:39 Constant: +0:39 0 (const uint) +0:40 Sequence +0:40 move second child to first child ( temp uint) +0:40 'uh1' ( temp uint) +0:40 Constant: +0:40 1 (const uint) +0:41 Sequence +0:41 move second child to first child ( temp uint) +0:41 'uh2' ( temp uint) +0:41 Constant: +0:41 2 (const uint) +0:42 Sequence +0:42 move second child to first child ( temp uint) +0:42 'uh300' ( temp uint) +0:42 Constant: +0:42 768 (const uint) +0:43 Sequence +0:43 move second child to first child ( temp uint) +0:43 'uhABCDEF' ( temp uint) +0:43 Constant: +0:43 11259375 (const uint) +0:44 Sequence +0:44 move second child to first child ( temp uint) +0:44 'uhFFFFFFFF' ( temp uint) +0:44 Constant: +0:44 4294967295 (const uint) +0:45 Sequence +0:45 move second child to first child ( temp uint) +0:45 'uh12345678' ( temp uint) +0:45 Constant: +0:45 12345678 (const uint) +0:46 Sequence +0:46 move second child to first child ( temp uint) +0:46 'uhToBeOrNotToBe' ( temp uint) +0:46 Constant: +0:46 4294967295 (const uint) +0:49 Sequence +0:49 move second child to first child ( temp int) +0:49 'he2' ( temp int) +0:49 Constant: +0:49 0 (const int) +0:50 Sequence +0:50 move second child to first child ( temp int) +0:50 'hbig' ( temp int) +0:50 Constant: +0:50 -15 (const int) +0:52 Sequence +0:52 move second child to first child ( temp float) +0:52 'f1' ( temp float) +0:52 Constant: +0:52 1.000000 +0:53 Sequence +0:53 move second child to first child ( temp float) +0:53 'f2' ( temp float) +0:53 Constant: +0:53 2.000000 +0:54 Sequence +0:54 move second child to first child ( temp float) +0:54 'f3' ( temp float) +0:54 Constant: +0:54 3.000000 +0:55 Sequence +0:55 move second child to first child ( temp float) +0:55 'f4' ( temp float) +0:55 Constant: +0:55 4.000000 +0:56 Sequence +0:56 move second child to first child ( temp float) +0:56 'f5' ( temp float) +0:56 Constant: +0:56 5.000000 +0:57 Sequence +0:57 move second child to first child ( temp float) +0:57 'f6' ( temp float) +0:57 Constant: +0:57 6.000000 +0:58 Sequence +0:58 move second child to first child ( temp float) +0:58 'f7' ( temp float) +0:58 Constant: +0:58 7.000000 +0:59 Sequence +0:59 move second child to first child ( temp float) +0:59 'f8' ( temp float) +0:59 Constant: +0:59 8.000000 +0:60 Sequence +0:60 move second child to first child ( temp float) +0:60 'f9' ( temp float) +0:60 Constant: +0:60 9.000000 +0:61 Sequence +0:61 move second child to first child ( temp float) +0:61 'f10' ( temp float) +0:61 Constant: +0:61 10.000000 +0:62 Sequence +0:62 move second child to first child ( temp float) +0:62 'f11' ( temp float) +0:62 Constant: +0:62 11.000000 +0:63 Sequence +0:63 move second child to first child ( temp float) +0:63 'f12' ( temp float) +0:63 Constant: +0:63 12.000000 +0:64 Sequence +0:64 move second child to first child ( temp float) +0:64 'f543' ( temp float) +0:64 Constant: +0:64 543.000000 +0:65 Sequence +0:65 move second child to first child ( temp float) +0:65 'f6789' ( temp float) +0:65 Constant: +0:65 6789.000000 +0:66 Sequence +0:66 move second child to first child ( temp float) +0:66 'f88' ( temp float) +0:66 Constant: +0:66 88.000000 +0:68 Sequence +0:68 move second child to first child ( temp float) +0:68 'g1' ( temp float) +0:68 Constant: +0:68 53876.000000 +0:69 Sequence +0:69 move second child to first child ( temp float) +0:69 'g2' ( temp float) +0:69 Constant: +0:69 0.040000 +0:70 Sequence +0:70 move second child to first child ( temp float) +0:70 'g3' ( temp float) +0:70 Constant: +0:70 100000.000000 +0:71 Sequence +0:71 move second child to first child ( temp float) +0:71 'g4' ( temp float) +0:71 Constant: +0:71 0.007321 +0:72 Sequence +0:72 move second child to first child ( temp float) +0:72 'g5' ( temp float) +0:72 Constant: +0:72 32000.000000 +0:73 Sequence +0:73 move second child to first child ( temp float) +0:73 'g6' ( temp float) +0:73 Constant: +0:73 5.0000000000000e-06 +0:74 Sequence +0:74 move second child to first child ( temp float) +0:74 'g7' ( temp float) +0:74 Constant: +0:74 0.450000 +0:75 Sequence +0:75 move second child to first child ( temp float) +0:75 'g8' ( temp float) +0:75 Constant: +0:75 60000000000.000000 +0:77 Sequence +0:77 move second child to first child ( temp double) +0:77 'gf1' ( temp double) +0:77 Constant: +0:77 1.000000 +0:78 Sequence +0:78 move second child to first child ( temp double) +0:78 'gf2' ( temp double) +0:78 Constant: +0:78 2.000000 +0:79 Sequence +0:79 move second child to first child ( temp double) +0:79 'gf3' ( temp double) +0:79 Constant: +0:79 3.000000 +0:80 Sequence +0:80 move second child to first child ( temp double) +0:80 'gf4' ( temp double) +0:80 Constant: +0:80 4.000000 +0:81 Sequence +0:81 move second child to first child ( temp float) +0:81 'gf5' ( temp float) +0:81 Constant: +0:81 5.000000 +0:82 Sequence +0:82 move second child to first child ( temp float) +0:82 'gf6' ( temp float) +0:82 Constant: +0:82 6.000000 +0:88 Sequence +0:88 move second child to first child ( temp float) +0:88 'e5' ( temp float) +0:88 Constant: +0:88 5.000000 +0:98 Sequence +0:98 move second child to first child ( temp uint) +0:98 'g1' ( global uint) +0:98 Constant: +0:98 4294967295 (const uint) +0:99 Sequence +0:99 move second child to first child ( temp uint) +0:99 'g2' ( global uint) +0:99 Constant: +0:99 4294967295 (const uint) +0:100 Sequence +0:100 move second child to first child ( temp uint) +0:100 'g3' ( global uint) +0:100 Constant: +0:100 4294967294 (const uint) +0:101 Sequence +0:101 move second child to first child ( temp int) +0:101 'g4' ( global int) +0:101 Constant: +0:101 -1 (const int) +0:102 Sequence +0:102 move second child to first child ( temp int) +0:102 'g5' ( global int) +0:102 Constant: +0:102 -1 (const int) +0:103 Sequence +0:103 move second child to first child ( temp int) +0:103 'g6' ( global int) +0:103 Constant: +0:103 -2 (const int) +0:? Linker Objects +0:? 'c2' (layout( location=2) out 4-component vector of float) +0:? 'c3' (layout( location=3) out 4-component vector of float) +0:? 'c4' (layout( location=4) out 4-component vector of float) +0:? 'c5' (layout( location=5) out 4-component vector of float) +0:? 'c6' (layout( location=6) out 4-component vector of float) +0:? 'c7' (layout( location=7) out 4-component vector of float) +0:? 'g1' ( global uint) +0:? 'g2' ( global uint) +0:? 'g3' ( global uint) +0:? 'g4' ( global int) +0:? 'g5' ( global int) +0:? 'g6' ( global int) +0:? 'inf1' ( global float) + + +Linked fragment stage: + + +Shader version: 400 +ERROR: node is still EOpNull! +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:5 Sequence +0:5 Sequence +0:5 move second child to first child ( temp int) +0:5 'o00' ( temp int) +0:5 Constant: +0:5 0 (const int) +0:6 Sequence +0:6 move second child to first child ( temp int) +0:6 'o000' ( temp int) +0:6 Constant: +0:6 0 (const int) +0:7 Sequence +0:7 move second child to first child ( temp int) +0:7 'o0000' ( temp int) +0:7 Constant: +0:7 0 (const int) +0:8 Sequence +0:8 move second child to first child ( temp int) +0:8 'o5' ( temp int) +0:8 Constant: +0:8 5 (const int) +0:9 Sequence +0:9 move second child to first child ( temp int) +0:9 'o05' ( temp int) +0:9 Constant: +0:9 5 (const int) +0:10 Sequence +0:10 move second child to first child ( temp int) +0:10 'o006' ( temp int) +0:10 Constant: +0:10 6 (const int) +0:11 Sequence +0:11 move second child to first child ( temp int) +0:11 'o7' ( temp int) +0:11 Constant: +0:11 7 (const int) +0:12 Sequence +0:12 move second child to first child ( temp int) +0:12 'o58' ( temp int) +0:12 Constant: +0:12 58 (const int) +0:13 Sequence +0:13 move second child to first child ( temp int) +0:13 'omax' ( temp int) +0:13 Constant: +0:13 -1 (const int) +0:14 Sequence +0:14 move second child to first child ( temp int) +0:14 'o8' ( temp int) +0:14 Constant: +0:14 0 (const int) +0:15 Sequence +0:15 move second child to first child ( temp int) +0:15 'o08' ( temp int) +0:15 Constant: +0:15 0 (const int) +0:16 Sequence +0:16 move second child to first child ( temp int) +0:16 'o009' ( temp int) +0:16 Constant: +0:16 0 (const int) +0:17 Sequence +0:17 move second child to first child ( temp int) +0:17 'obig' ( temp int) +0:17 Constant: +0:17 -1662398820 (const int) +0:18 Sequence +0:18 move second child to first child ( temp int) +0:18 'omax1' ( temp int) +0:18 Constant: +0:18 0 (const int) +0:20 Sequence +0:20 move second child to first child ( temp uint) +0:20 'uo5' ( temp uint) +0:20 Constant: +0:20 5 (const uint) +0:21 Sequence +0:21 move second child to first child ( temp uint) +0:21 'uo6' ( temp uint) +0:21 Constant: +0:21 6 (const uint) +0:22 Sequence +0:22 move second child to first child ( temp uint) +0:22 'uo7' ( temp uint) +0:22 Constant: +0:22 7 (const uint) +0:23 Sequence +0:23 move second child to first child ( temp uint) +0:23 'uo8' ( temp uint) +0:23 Constant: +0:23 0 (const uint) +0:24 Sequence +0:24 move second child to first child ( temp uint) +0:24 'uo9' ( temp uint) +0:24 Constant: +0:24 0 (const uint) +0:26 Sequence +0:26 move second child to first child ( temp int) +0:26 'h0' ( temp int) +0:26 Constant: +0:26 0 (const int) +0:27 Sequence +0:27 move second child to first child ( temp int) +0:27 'h00' ( temp int) +0:27 Constant: +0:27 0 (const int) +0:28 Sequence +0:28 move second child to first child ( temp int) +0:28 'h000' ( temp int) +0:28 Constant: +0:28 0 (const int) +0:29 Sequence +0:29 move second child to first child ( temp int) +0:29 'h1' ( temp int) +0:29 Constant: +0:29 1 (const int) +0:30 Sequence +0:30 move second child to first child ( temp int) +0:30 'h2' ( temp int) +0:30 Constant: +0:30 2 (const int) +0:31 Sequence +0:31 move second child to first child ( temp int) +0:31 'h300' ( temp int) +0:31 Constant: +0:31 768 (const int) +0:32 Sequence +0:32 move second child to first child ( temp int) +0:32 'hABCDEF' ( temp int) +0:32 Constant: +0:32 11259375 (const int) +0:33 Sequence +0:33 move second child to first child ( temp int) +0:33 'hFFFFFFFF' ( temp int) +0:33 Constant: +0:33 -1 (const int) +0:34 Sequence +0:34 move second child to first child ( temp int) +0:34 'h12345678' ( temp int) +0:34 Constant: +0:34 12345678 (const int) +0:35 Sequence +0:35 move second child to first child ( temp int) +0:35 'hToBeOrNotToBe' ( temp int) +0:35 Constant: +0:35 -1 (const int) +0:37 Sequence +0:37 move second child to first child ( temp uint) +0:37 'uh0' ( temp uint) +0:37 Constant: +0:37 0 (const uint) +0:38 Sequence +0:38 move second child to first child ( temp uint) +0:38 'uhg' ( temp uint) +0:38 Constant: +0:38 12 (const uint) +0:39 Sequence +0:39 move second child to first child ( temp uint) +0:39 'uh000' ( temp uint) +0:39 Constant: +0:39 0 (const uint) +0:40 Sequence +0:40 move second child to first child ( temp uint) +0:40 'uh1' ( temp uint) +0:40 Constant: +0:40 1 (const uint) +0:41 Sequence +0:41 move second child to first child ( temp uint) +0:41 'uh2' ( temp uint) +0:41 Constant: +0:41 2 (const uint) +0:42 Sequence +0:42 move second child to first child ( temp uint) +0:42 'uh300' ( temp uint) +0:42 Constant: +0:42 768 (const uint) +0:43 Sequence +0:43 move second child to first child ( temp uint) +0:43 'uhABCDEF' ( temp uint) +0:43 Constant: +0:43 11259375 (const uint) +0:44 Sequence +0:44 move second child to first child ( temp uint) +0:44 'uhFFFFFFFF' ( temp uint) +0:44 Constant: +0:44 4294967295 (const uint) +0:45 Sequence +0:45 move second child to first child ( temp uint) +0:45 'uh12345678' ( temp uint) +0:45 Constant: +0:45 12345678 (const uint) +0:46 Sequence +0:46 move second child to first child ( temp uint) +0:46 'uhToBeOrNotToBe' ( temp uint) +0:46 Constant: +0:46 4294967295 (const uint) +0:49 Sequence +0:49 move second child to first child ( temp int) +0:49 'he2' ( temp int) +0:49 Constant: +0:49 0 (const int) +0:50 Sequence +0:50 move second child to first child ( temp int) +0:50 'hbig' ( temp int) +0:50 Constant: +0:50 -15 (const int) +0:52 Sequence +0:52 move second child to first child ( temp float) +0:52 'f1' ( temp float) +0:52 Constant: +0:52 1.000000 +0:53 Sequence +0:53 move second child to first child ( temp float) +0:53 'f2' ( temp float) +0:53 Constant: +0:53 2.000000 +0:54 Sequence +0:54 move second child to first child ( temp float) +0:54 'f3' ( temp float) +0:54 Constant: +0:54 3.000000 +0:55 Sequence +0:55 move second child to first child ( temp float) +0:55 'f4' ( temp float) +0:55 Constant: +0:55 4.000000 +0:56 Sequence +0:56 move second child to first child ( temp float) +0:56 'f5' ( temp float) +0:56 Constant: +0:56 5.000000 +0:57 Sequence +0:57 move second child to first child ( temp float) +0:57 'f6' ( temp float) +0:57 Constant: +0:57 6.000000 +0:58 Sequence +0:58 move second child to first child ( temp float) +0:58 'f7' ( temp float) +0:58 Constant: +0:58 7.000000 +0:59 Sequence +0:59 move second child to first child ( temp float) +0:59 'f8' ( temp float) +0:59 Constant: +0:59 8.000000 +0:60 Sequence +0:60 move second child to first child ( temp float) +0:60 'f9' ( temp float) +0:60 Constant: +0:60 9.000000 +0:61 Sequence +0:61 move second child to first child ( temp float) +0:61 'f10' ( temp float) +0:61 Constant: +0:61 10.000000 +0:62 Sequence +0:62 move second child to first child ( temp float) +0:62 'f11' ( temp float) +0:62 Constant: +0:62 11.000000 +0:63 Sequence +0:63 move second child to first child ( temp float) +0:63 'f12' ( temp float) +0:63 Constant: +0:63 12.000000 +0:64 Sequence +0:64 move second child to first child ( temp float) +0:64 'f543' ( temp float) +0:64 Constant: +0:64 543.000000 +0:65 Sequence +0:65 move second child to first child ( temp float) +0:65 'f6789' ( temp float) +0:65 Constant: +0:65 6789.000000 +0:66 Sequence +0:66 move second child to first child ( temp float) +0:66 'f88' ( temp float) +0:66 Constant: +0:66 88.000000 +0:68 Sequence +0:68 move second child to first child ( temp float) +0:68 'g1' ( temp float) +0:68 Constant: +0:68 53876.000000 +0:69 Sequence +0:69 move second child to first child ( temp float) +0:69 'g2' ( temp float) +0:69 Constant: +0:69 0.040000 +0:70 Sequence +0:70 move second child to first child ( temp float) +0:70 'g3' ( temp float) +0:70 Constant: +0:70 100000.000000 +0:71 Sequence +0:71 move second child to first child ( temp float) +0:71 'g4' ( temp float) +0:71 Constant: +0:71 0.007321 +0:72 Sequence +0:72 move second child to first child ( temp float) +0:72 'g5' ( temp float) +0:72 Constant: +0:72 32000.000000 +0:73 Sequence +0:73 move second child to first child ( temp float) +0:73 'g6' ( temp float) +0:73 Constant: +0:73 5.0000000000000e-06 +0:74 Sequence +0:74 move second child to first child ( temp float) +0:74 'g7' ( temp float) +0:74 Constant: +0:74 0.450000 +0:75 Sequence +0:75 move second child to first child ( temp float) +0:75 'g8' ( temp float) +0:75 Constant: +0:75 60000000000.000000 +0:77 Sequence +0:77 move second child to first child ( temp double) +0:77 'gf1' ( temp double) +0:77 Constant: +0:77 1.000000 +0:78 Sequence +0:78 move second child to first child ( temp double) +0:78 'gf2' ( temp double) +0:78 Constant: +0:78 2.000000 +0:79 Sequence +0:79 move second child to first child ( temp double) +0:79 'gf3' ( temp double) +0:79 Constant: +0:79 3.000000 +0:80 Sequence +0:80 move second child to first child ( temp double) +0:80 'gf4' ( temp double) +0:80 Constant: +0:80 4.000000 +0:81 Sequence +0:81 move second child to first child ( temp float) +0:81 'gf5' ( temp float) +0:81 Constant: +0:81 5.000000 +0:82 Sequence +0:82 move second child to first child ( temp float) +0:82 'gf6' ( temp float) +0:82 Constant: +0:82 6.000000 +0:88 Sequence +0:88 move second child to first child ( temp float) +0:88 'e5' ( temp float) +0:88 Constant: +0:88 5.000000 +0:98 Sequence +0:98 move second child to first child ( temp uint) +0:98 'g1' ( global uint) +0:98 Constant: +0:98 4294967295 (const uint) +0:99 Sequence +0:99 move second child to first child ( temp uint) +0:99 'g2' ( global uint) +0:99 Constant: +0:99 4294967295 (const uint) +0:100 Sequence +0:100 move second child to first child ( temp uint) +0:100 'g3' ( global uint) +0:100 Constant: +0:100 4294967294 (const uint) +0:101 Sequence +0:101 move second child to first child ( temp int) +0:101 'g4' ( global int) +0:101 Constant: +0:101 -1 (const int) +0:102 Sequence +0:102 move second child to first child ( temp int) +0:102 'g5' ( global int) +0:102 Constant: +0:102 -1 (const int) +0:103 Sequence +0:103 move second child to first child ( temp int) +0:103 'g6' ( global int) +0:103 Constant: +0:103 -2 (const int) +0:? Linker Objects +0:? 'c2' (layout( location=2) out 4-component vector of float) +0:? 'c3' (layout( location=3) out 4-component vector of float) +0:? 'c4' (layout( location=4) out 4-component vector of float) +0:? 'c5' (layout( location=5) out 4-component vector of float) +0:? 'c6' (layout( location=6) out 4-component vector of float) +0:? 'c7' (layout( location=7) out 4-component vector of float) +0:? 'g1' ( global uint) +0:? 'g2' ( global uint) +0:? 'g3' ( global uint) +0:? 'g4' ( global int) +0:? 'g5' ( global int) +0:? 'g6' ( global int) +0:? 'inf1' ( global float) + diff --git a/deps/glslang/Test/baseResults/nvShaderNoperspectiveInterpolation.frag.out b/deps/glslang/Test/baseResults/nvShaderNoperspectiveInterpolation.frag.out new file mode 100644 index 00000000..ae004c64 --- /dev/null +++ b/deps/glslang/Test/baseResults/nvShaderNoperspectiveInterpolation.frag.out @@ -0,0 +1,38 @@ +nvShaderNoperspectiveInterpolation.frag +ERROR: 0:5: 'noperspective' : Reserved word. +ERROR: 0:5: 'noperspective' : not supported for this version or the enabled extensions +ERROR: 2 compilation errors. No code generated. + + +Shader version: 300 +Requested GL_NV_shader_noperspective_interpolation +ERROR: node is still EOpNull! +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:14 Sequence +0:14 move second child to first child ( temp mediump 4-component vector of float) +0:14 'fragColor' ( out mediump 4-component vector of float) +0:14 'color' ( noperspective in mediump 4-component vector of float) +0:? Linker Objects +0:? 'bad' ( noperspective in mediump 4-component vector of float) +0:? 'color' ( noperspective in mediump 4-component vector of float) +0:? 'fragColor' ( out mediump 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 300 +Requested GL_NV_shader_noperspective_interpolation +ERROR: node is still EOpNull! +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:14 Sequence +0:14 move second child to first child ( temp mediump 4-component vector of float) +0:14 'fragColor' ( out mediump 4-component vector of float) +0:14 'color' ( noperspective in mediump 4-component vector of float) +0:? Linker Objects +0:? 'bad' ( noperspective in mediump 4-component vector of float) +0:? 'color' ( noperspective in mediump 4-component vector of float) +0:? 'fragColor' ( out mediump 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/overlongLiteral.frag.out b/deps/glslang/Test/baseResults/overlongLiteral.frag.out new file mode 100644 index 00000000..372d7777 --- /dev/null +++ b/deps/glslang/Test/baseResults/overlongLiteral.frag.out @@ -0,0 +1,19 @@ +overlongLiteral.frag +ERROR: 0:1: '' : hexadecimal literal too long +ERROR: 0:1: '' : syntax error, unexpected INTCONSTANT +ERROR: 2 compilation errors. No code generated. + + +Shader version: 100 +ERROR: node is still EOpNull! +0:? Linker Objects + + +Linked fragment stage: + +ERROR: Linking fragment stage: Missing entry point: Each stage requires one entry point + +Shader version: 100 +ERROR: node is still EOpNull! +0:? Linker Objects + diff --git a/deps/glslang/Test/baseResults/pointCoord.frag.out b/deps/glslang/Test/baseResults/pointCoord.frag.out new file mode 100644 index 00000000..f55f9bc4 --- /dev/null +++ b/deps/glslang/Test/baseResults/pointCoord.frag.out @@ -0,0 +1,69 @@ +pointCoord.frag +Shader version: 100 +0:? Sequence +0:5 Function Definition: main( ( global void) +0:5 Function Parameters: +0:? Sequence +0:9 Test condition and select ( temp void) +0:9 Condition +0:9 Compare Less Than ( temp bool) +0:9 length ( global mediump float) +0:9 'gl_PointCoord' ( gl_PointCoord mediump 2-component vector of float PointCoord) +0:9 Constant: +0:9 0.300000 +0:9 true case +0:10 move second child to first child ( temp highp 4-component vector of float) +0:10 'color' ( temp highp 4-component vector of float) +0:10 texture ( global lowp 4-component vector of float, operation at mediump) +0:10 'sampler' ( uniform lowp sampler2D) +0:10 'gl_PointCoord' ( gl_PointCoord mediump 2-component vector of float PointCoord) +0:9 false case +0:12 move second child to first child ( temp highp 4-component vector of float) +0:12 'color' ( temp highp 4-component vector of float) +0:12 Constant: +0:12 0.000000 +0:12 0.000000 +0:12 0.000000 +0:12 0.000000 +0:14 move second child to first child ( temp highp 4-component vector of float) +0:14 'gl_FragColor' ( fragColor mediump 4-component vector of float FragColor) +0:14 'color' ( temp highp 4-component vector of float) +0:? Linker Objects +0:? 'sampler' ( uniform lowp sampler2D) + + +Linked fragment stage: + + +Shader version: 100 +0:? Sequence +0:5 Function Definition: main( ( global void) +0:5 Function Parameters: +0:? Sequence +0:9 Test condition and select ( temp void) +0:9 Condition +0:9 Compare Less Than ( temp bool) +0:9 length ( global mediump float) +0:9 'gl_PointCoord' ( gl_PointCoord mediump 2-component vector of float PointCoord) +0:9 Constant: +0:9 0.300000 +0:9 true case +0:10 move second child to first child ( temp highp 4-component vector of float) +0:10 'color' ( temp highp 4-component vector of float) +0:10 texture ( global lowp 4-component vector of float, operation at mediump) +0:10 'sampler' ( uniform lowp sampler2D) +0:10 'gl_PointCoord' ( gl_PointCoord mediump 2-component vector of float PointCoord) +0:9 false case +0:12 move second child to first child ( temp highp 4-component vector of float) +0:12 'color' ( temp highp 4-component vector of float) +0:12 Constant: +0:12 0.000000 +0:12 0.000000 +0:12 0.000000 +0:12 0.000000 +0:14 move second child to first child ( temp highp 4-component vector of float) +0:14 'gl_FragColor' ( fragColor mediump 4-component vector of float FragColor) +0:14 'color' ( temp highp 4-component vector of float) +0:? Linker Objects +0:? 'sampler' ( uniform lowp sampler2D) + diff --git a/deps/glslang/Test/baseResults/precise.tesc.out b/deps/glslang/Test/baseResults/precise.tesc.out new file mode 100644 index 00000000..abe56f75 --- /dev/null +++ b/deps/glslang/Test/baseResults/precise.tesc.out @@ -0,0 +1,396 @@ +precise.tesc +Shader version: 450 +Requested GL_EXT_gpu_shader5 +Requested GL_EXT_shader_io_blocks +Requested GL_EXT_tessellation_shader +vertices = -1 +0:? Sequence +0:5 Function Definition: minimal( ( global float) +0:5 Function Parameters: +0:6 Sequence +0:6 Sequence +0:6 move second child to first child ( temp float) +0:6 'result' ( noContraction temp float) +0:6 Constant: +0:6 5.000000 +0:7 Sequence +0:7 move second child to first child ( temp float) +0:7 'a' ( noContraction temp float) +0:7 Constant: +0:7 10.000000 +0:8 Sequence +0:8 move second child to first child ( temp float) +0:8 'b' ( noContraction temp float) +0:8 Constant: +0:8 20.000000 +0:9 Sequence +0:9 move second child to first child ( temp float) +0:9 'c' ( noContraction temp float) +0:9 Constant: +0:9 30.000000 +0:10 Sequence +0:10 move second child to first child ( temp float) +0:10 'd' ( noContraction temp float) +0:10 Constant: +0:10 40.000000 +0:11 move second child to first child ( temp float) +0:11 'result' ( noContraction temp float) +0:11 add ( noContraction temp float) +0:11 component-wise multiply ( noContraction temp float) +0:11 'a' ( noContraction temp float) +0:11 'b' ( noContraction temp float) +0:11 component-wise multiply ( noContraction temp float) +0:11 'c' ( noContraction temp float) +0:11 'd' ( noContraction temp float) +0:12 Branch: Return with expression +0:12 'result' ( noContraction temp float) +0:15 Function Definition: continuous_assignment( ( global void) +0:15 Function Parameters: +0:16 Sequence +0:16 Sequence +0:16 move second child to first child ( temp float) +0:16 'result' ( noContraction temp float) +0:16 Constant: +0:16 5.000000 +0:17 Sequence +0:17 move second child to first child ( temp float) +0:17 'a' ( noContraction temp float) +0:17 Constant: +0:17 10.000000 +0:18 Sequence +0:18 move second child to first child ( temp float) +0:18 'b' ( noContraction temp float) +0:18 Constant: +0:18 20.000000 +0:19 move second child to first child ( temp float) +0:19 'result' ( noContraction temp float) +0:19 move second child to first child ( temp float) +0:19 'a' ( noContraction temp float) +0:19 add ( noContraction temp float) +0:19 'b' ( noContraction temp float) +0:19 Constant: +0:19 4.000000 +0:22 Function Definition: convert( ( global void) +0:22 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child ( temp float) +0:24 'a' ( noContraction temp float) +0:24 Constant: +0:24 10.000000 +0:25 Sequence +0:25 move second child to first child ( temp float) +0:25 'b' ( noContraction temp float) +0:25 Constant: +0:25 20.000000 +0:26 move second child to first child ( temp float) +0:26 'b' ( noContraction temp float) +0:26 add ( noContraction temp float) +0:26 'a' ( noContraction temp float) +0:26 'b' ( noContraction temp float) +0:27 move second child to first child ( temp double) +0:27 'result' ( noContraction temp double) +0:27 Convert float to double ( temp double) +0:27 'b' ( noContraction temp float) +0:30 Function Definition: loop_for( ( global float) +0:30 Function Parameters: +0:31 Sequence +0:31 Sequence +0:31 move second child to first child ( temp float) +0:31 'r1' ( noContraction temp float) +0:31 Constant: +0:31 5.000000 +0:32 Sequence +0:32 move second child to first child ( temp float) +0:32 'r2' ( noContraction temp float) +0:32 Constant: +0:32 10.000000 +0:33 Sequence +0:33 move second child to first child ( temp int) +0:33 'a' ( temp int) +0:33 Constant: +0:33 10 (const int) +0:34 Sequence +0:34 move second child to first child ( temp int) +0:34 'b' ( noContraction temp int) +0:34 Constant: +0:34 20 (const int) +0:35 Sequence +0:35 move second child to first child ( temp int) +0:35 'c' ( noContraction temp int) +0:35 Constant: +0:35 30 (const int) +0:36 Sequence +0:36 Sequence +0:36 move second child to first child ( temp int) +0:36 'i' ( noContraction temp int) +0:36 Constant: +0:36 0 (const int) +0:36 Loop with condition tested first +0:36 Loop Condition +0:36 Compare Less Than ( temp bool) +0:36 'i' ( temp int) +0:36 'a' ( temp int) +0:36 Loop Body +0:37 Sequence +0:37 add second child into first child ( noContraction temp float) +0:37 'r1' ( noContraction temp float) +0:37 add ( noContraction temp float) +0:37 add ( noContraction temp float) +0:37 Constant: +0:37 3.120000 +0:37 Convert int to float ( temp float) +0:37 'b' ( noContraction temp int) +0:37 Convert int to float ( temp float) +0:37 'i' ( noContraction temp int) +0:38 add second child into first child ( noContraction temp int) +0:38 'c' ( noContraction temp int) +0:38 Constant: +0:38 1 (const int) +0:36 Loop Terminal Expression +0:36 Post-Increment ( noContraction temp int) +0:36 'i' ( noContraction temp int) +0:40 add second child into first child ( temp int) +0:40 'a' ( temp int) +0:40 Constant: +0:40 1 (const int) +0:41 move second child to first child ( temp float) +0:41 'r2' ( noContraction temp float) +0:41 Convert int to float ( temp float) +0:41 'c' ( noContraction temp int) +0:42 Branch: Return with expression +0:42 Construct float ( temp float) +0:42 add ( temp float) +0:42 'r1' ( noContraction temp float) +0:42 'r2' ( noContraction temp float) +0:45 Function Definition: loop_array( ( global void) +0:45 Function Parameters: +0:? Sequence +0:48 Sequence +0:48 move second child to first child ( temp int) +0:48 'x' ( noContraction temp int) +0:48 Constant: +0:48 22 (const int) +0:49 Sequence +0:49 move second child to first child ( temp int) +0:49 'y' ( noContraction temp int) +0:49 Constant: +0:49 33 (const int) +0:52 add second child into first child ( noContraction temp float) +0:52 'result' ( noContraction temp float) +0:52 add ( noContraction temp float) +0:52 Convert int to float ( temp float) +0:52 'x' ( noContraction temp int) +0:52 Convert int to float ( temp float) +0:52 'y' ( noContraction temp int) +0:54 Sequence +0:54 Sequence +0:54 move second child to first child ( temp int) +0:54 'i' ( temp int) +0:54 Constant: +0:54 0 (const int) +0:54 Loop with condition tested first +0:54 Loop Condition +0:54 Compare Less Than ( temp bool) +0:54 'i' ( temp int) +0:54 Constant: +0:54 3 (const int) +0:54 Loop Body +0:56 Sequence +0:56 add second child into first child ( noContraction temp float) +0:56 'result' ( noContraction temp float) +0:56 add ( noContraction temp float) +0:56 indirect index ( noContraction temp float) +0:56 'a0' ( temp 3-element array of float) +0:56 'i' ( temp int) +0:56 Constant: +0:56 2.000000 +0:58 move second child to first child ( temp float) +0:58 indirect index ( noContraction temp float) +0:58 'a0' ( noContraction temp 3-element array of float) +0:58 'i' ( temp int) +0:58 subtract ( noContraction temp float) +0:58 Constant: +0:58 3.000000 +0:58 Post-Increment ( noContraction temp float) +0:58 'result' ( noContraction temp float) +0:54 Loop Terminal Expression +0:54 Pre-Increment ( temp int) +0:54 'i' ( temp int) +0:62 Function Definition: loop_while( ( global void) +0:62 Function Parameters: +0:63 Sequence +0:63 Sequence +0:63 move second child to first child ( temp float) +0:63 'result' ( noContraction temp float) +0:63 Constant: +0:63 5.000000 +0:64 Sequence +0:64 move second child to first child ( temp int) +0:64 'a' ( noContraction temp int) +0:64 Constant: +0:64 10 (const int) +0:65 Sequence +0:65 move second child to first child ( temp int) +0:65 'b' ( noContraction temp int) +0:65 Constant: +0:65 20 (const int) +0:66 Loop with condition tested first +0:66 Loop Condition +0:66 Compare Less Than ( temp bool) +0:66 'result' ( noContraction temp float) +0:66 Constant: +0:66 10.000000 +0:66 Loop Body +0:67 Sequence +0:67 add second child into first child ( noContraction temp float) +0:67 'result' ( noContraction temp float) +0:67 add ( noContraction temp float) +0:67 Constant: +0:67 3.120000 +0:67 Convert int to float ( temp float) +0:67 'b' ( noContraction temp int) +0:69 move second child to first child ( temp float) +0:69 'result' ( noContraction temp float) +0:69 Convert int to float ( temp float) +0:69 add ( temp int) +0:69 add ( temp int) +0:69 'a' ( noContraction temp int) +0:69 'b' ( noContraction temp int) +0:69 Constant: +0:69 5 (const int) +0:70 move second child to first child ( temp float) +0:70 'result' ( noContraction temp float) +0:70 Constant: +0:70 11.100000 +0:73 Function Definition: fma_not_decorated( ( global float) +0:73 Function Parameters: +0:? Sequence +0:75 Sequence +0:75 move second child to first child ( temp float) +0:75 'a' ( noContraction temp float) +0:75 Constant: +0:75 1.000000 +0:76 Sequence +0:76 move second child to first child ( temp float) +0:76 'b' ( noContraction temp float) +0:76 Constant: +0:76 2.000000 +0:77 Sequence +0:77 move second child to first child ( temp float) +0:77 'c' ( noContraction temp float) +0:77 Constant: +0:77 3.000000 +0:78 move second child to first child ( temp float) +0:78 'b' ( noContraction temp float) +0:78 add ( noContraction temp float) +0:78 'b' ( noContraction temp float) +0:78 'c' ( noContraction temp float) +0:79 move second child to first child ( temp float) +0:79 'result' ( noContraction temp float) +0:79 fma ( global float) +0:79 'a' ( noContraction temp float) +0:79 'b' ( noContraction temp float) +0:79 'c' ( noContraction temp float) +0:80 Branch: Return with expression +0:80 'result' ( noContraction temp float) +0:83 Function Definition: precise_return_exp_func( ( noContraction temp float) +0:83 Function Parameters: +0:84 Sequence +0:84 Sequence +0:84 move second child to first child ( temp float) +0:84 'a' ( noContraction temp float) +0:84 Constant: +0:84 1.000000 +0:85 Sequence +0:85 move second child to first child ( temp float) +0:85 'b' ( noContraction temp float) +0:85 Constant: +0:85 2.000000 +0:86 Branch: Return with expression +0:86 add ( noContraction temp float) +0:86 'a' ( noContraction temp float) +0:86 'b' ( noContraction temp float) +0:89 Function Definition: precise_return_val_func( ( noContraction temp float) +0:89 Function Parameters: +0:90 Sequence +0:90 Sequence +0:90 move second child to first child ( temp float) +0:90 'a' ( noContraction temp float) +0:90 Constant: +0:90 1.000000 +0:91 Sequence +0:91 move second child to first child ( temp float) +0:91 'b' ( noContraction temp float) +0:91 Constant: +0:91 2.000000 +0:92 Sequence +0:92 move second child to first child ( temp float) +0:92 'result' ( noContraction temp float) +0:92 add ( noContraction temp float) +0:92 'a' ( noContraction temp float) +0:92 'b' ( noContraction temp float) +0:93 Branch: Return with expression +0:93 'result' ( noContraction temp float) +0:96 Function Definition: precise_func_parameter(f1;f1; ( global float) +0:96 Function Parameters: +0:96 'b' ( in float) +0:96 'c' ( noContraction out float) +0:97 Sequence +0:97 Sequence +0:97 move second child to first child ( temp float) +0:97 'a' ( noContraction temp float) +0:97 Constant: +0:97 0.500000 +0:98 move second child to first child ( temp float) +0:98 'c' ( noContraction out float) +0:98 add ( noContraction temp float) +0:98 'a' ( noContraction temp float) +0:98 'b' ( noContraction in float) +0:99 Branch: Return with expression +0:99 subtract ( temp float) +0:99 'a' ( temp float) +0:99 'b' ( in float) +0:102 Function Definition: matrix(mf23;mf32; ( global 3X3 matrix of float) +0:102 Function Parameters: +0:102 'a' ( in 2X3 matrix of float) +0:102 'b' ( in 3X2 matrix of float) +0:103 Sequence +0:103 Sequence +0:103 move second child to first child ( temp 2X3 matrix of float) +0:103 'c' ( noContraction temp 2X3 matrix of float) +0:103 Constant: +0:103 1.000000 +0:103 2.000000 +0:103 3.000000 +0:103 4.000000 +0:103 5.000000 +0:103 6.000000 +0:105 move second child to first child ( temp 3X3 matrix of float) +0:105 'result' ( noContraction temp 3X3 matrix of float) +0:105 matrix-multiply ( noContraction temp 3X3 matrix of float) +0:105 add ( noContraction temp 2X3 matrix of float) +0:105 'a' ( noContraction in 2X3 matrix of float) +0:105 'c' ( noContraction temp 2X3 matrix of float) +0:105 'b' ( noContraction in 3X2 matrix of float) +0:106 Branch: Return with expression +0:106 'result' ( noContraction temp 3X3 matrix of float) +0:109 Function Definition: main( ( global void) +0:109 Function Parameters: +0:? Linker Objects + + +Linked tessellation control stage: + +ERROR: Linking tessellation control stage: At least one shader must specify an output layout(vertices=...) + +Shader version: 450 +Requested GL_EXT_gpu_shader5 +Requested GL_EXT_shader_io_blocks +Requested GL_EXT_tessellation_shader +vertices = -1 +0:? Sequence +0:109 Function Definition: main( ( global void) +0:109 Function Parameters: +0:? Linker Objects + diff --git a/deps/glslang/Test/baseResults/precise_struct_block.vert.out b/deps/glslang/Test/baseResults/precise_struct_block.vert.out new file mode 100644 index 00000000..a239e95d --- /dev/null +++ b/deps/glslang/Test/baseResults/precise_struct_block.vert.out @@ -0,0 +1,534 @@ +precise_struct_block.vert +Shader version: 450 +0:? Sequence +0:11 Function Definition: struct_member( ( global float) +0:11 Function Parameters: +0:12 Sequence +0:12 Sequence +0:12 move second child to first child ( temp float) +0:12 'a' ( noContraction temp float) +0:12 Constant: +0:12 1.000000 +0:13 Sequence +0:13 move second child to first child ( temp float) +0:13 'b' ( temp float) +0:13 Constant: +0:13 2.000000 +0:14 Sequence +0:14 move second child to first child ( temp float) +0:14 'c' ( temp float) +0:14 Constant: +0:14 3.000000 +0:15 Sequence +0:15 move second child to first child ( temp float) +0:15 'd' ( temp float) +0:15 Constant: +0:15 4.000000 +0:21 move second child to first child ( temp float) +0:21 f1: direct index for structure ( noContraction global float) +0:21 'S2' ( temp structure{ global float f1, global float f2}) +0:21 Constant: +0:21 0 (const int) +0:21 add ( noContraction temp float) +0:21 'a' ( noContraction temp float) +0:21 Constant: +0:21 0.200000 +0:22 move second child to first child ( temp float) +0:22 f2: direct index for structure ( global float) +0:22 'S2' ( temp structure{ global float f1, global float f2}) +0:22 Constant: +0:22 1 (const int) +0:22 add ( temp float) +0:22 'b' ( temp float) +0:22 Constant: +0:22 0.200000 +0:23 move second child to first child ( temp float) +0:23 f1: direct index for structure ( global float) +0:23 'S3' ( temp structure{ global float f1, global float f2}) +0:23 Constant: +0:23 0 (const int) +0:23 add ( temp float) +0:23 'a' ( temp float) +0:23 'b' ( temp float) +0:24 move second child to first child ( temp structure{ global float f1, global float f2}) +0:24 'S' ( temp structure{ global float f1, global float f2}) +0:24 'S2' ( temp structure{ global float f1, global float f2}) +0:25 move second child to first child ( temp float) +0:25 'result' ( noContraction temp float) +0:25 add ( noContraction temp float) +0:25 f1: direct index for structure ( noContraction global float) +0:25 'S' ( temp structure{ global float f1, global float f2}) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 0.100000 +0:27 Branch: Return with expression +0:27 'result' ( noContraction temp float) +0:30 Function Definition: complex_array_struct( ( global float) +0:30 Function Parameters: +0:? Sequence +0:43 Sequence +0:43 Sequence +0:43 move second child to first child ( temp int) +0:43 'i' ( noContraction temp int) +0:43 Constant: +0:43 0 (const int) +0:43 Loop with condition tested first +0:43 Loop Condition +0:43 Compare Less Than ( temp bool) +0:43 'i' ( temp int) +0:43 Constant: +0:43 10 (const int) +0:43 Loop Body +0:44 Sequence +0:44 move second child to first child ( temp float) +0:44 f: direct index for structure ( temp float) +0:44 indirect index ( temp structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:44 't3' ( temp 10-element array of structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:44 'i' ( temp int) +0:44 Constant: +0:44 0 (const int) +0:44 divide ( temp float) +0:44 Convert int to float ( temp float) +0:44 'i' ( temp int) +0:44 Constant: +0:44 3.000000 +0:45 move second child to first child ( temp 4-component vector of float) +0:45 v: direct index for structure ( noContraction temp 4-component vector of float) +0:45 indirect index ( temp structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:45 't3' ( temp 10-element array of structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:45 'i' ( temp int) +0:45 Constant: +0:45 2 (const int) +0:45 Construct vec4 ( temp 4-component vector of float) +0:45 component-wise multiply ( noContraction temp float) +0:45 Convert int to float ( temp float) +0:45 'i' ( noContraction temp int) +0:45 Constant: +0:45 1.500000 +0:46 move second child to first child ( temp int) +0:46 p: direct index for structure ( temp int) +0:46 indirect index ( temp structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:46 't3' ( temp 10-element array of structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:46 'i' ( temp int) +0:46 Constant: +0:46 3 (const int) +0:46 add ( temp int) +0:46 'i' ( temp int) +0:46 Constant: +0:46 1 (const int) +0:47 Sequence +0:47 Sequence +0:47 move second child to first child ( temp int) +0:47 'j' ( temp int) +0:47 Constant: +0:47 0 (const int) +0:47 Loop with condition tested first +0:47 Loop Condition +0:47 Compare Less Than ( temp bool) +0:47 'j' ( temp int) +0:47 Constant: +0:47 5 (const int) +0:47 Loop Body +0:48 Sequence +0:48 Sequence +0:48 Sequence +0:48 move second child to first child ( temp int) +0:48 'k' ( temp int) +0:48 Constant: +0:48 0 (const int) +0:48 Loop with condition tested first +0:48 Loop Condition +0:48 Compare Less Than ( temp bool) +0:48 'k' ( temp int) +0:48 Constant: +0:48 3 (const int) +0:48 Loop Body +0:49 Sequence +0:49 move second child to first child ( temp float) +0:49 indirect index ( temp float) +0:49 t1_array: direct index for structure ( temp 3-element array of float) +0:49 indirect index ( temp structure{ temp 3-element array of float t1_array, temp float t1_scalar}) +0:49 t1a: direct index for structure ( temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar}) +0:49 t2: direct index for structure ( temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:49 indirect index ( temp structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:49 't3' ( temp 10-element array of structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:49 'i' ( temp int) +0:49 Constant: +0:49 1 (const int) +0:49 Constant: +0:49 0 (const int) +0:49 'j' ( temp int) +0:49 Constant: +0:49 0 (const int) +0:49 'k' ( temp int) +0:49 Convert int to float ( temp float) +0:49 add ( temp int) +0:49 component-wise multiply ( temp int) +0:49 'i' ( temp int) +0:49 'j' ( temp int) +0:49 'k' ( temp int) +0:48 Loop Terminal Expression +0:48 Post-Increment ( temp int) +0:48 'k' ( temp int) +0:51 move second child to first child ( temp float) +0:51 t1_scalar: direct index for structure ( temp float) +0:51 indirect index ( temp structure{ temp 3-element array of float t1_array, temp float t1_scalar}) +0:51 t1a: direct index for structure ( temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar}) +0:51 t2: direct index for structure ( temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:51 indirect index ( temp structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:51 't3' ( temp 10-element array of structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:51 'i' ( temp int) +0:51 Constant: +0:51 1 (const int) +0:51 Constant: +0:51 0 (const int) +0:51 'j' ( temp int) +0:51 Constant: +0:51 1 (const int) +0:51 divide ( temp float) +0:51 component-wise multiply ( temp float) +0:51 Convert int to float ( temp float) +0:51 'j' ( temp int) +0:51 Constant: +0:51 2.000000 +0:51 Convert int to float ( temp float) +0:51 'i' ( temp int) +0:47 Loop Terminal Expression +0:47 Post-Increment ( temp int) +0:47 'j' ( temp int) +0:54 Sequence +0:54 Sequence +0:54 move second child to first child ( temp int) +0:54 'j' ( noContraction temp int) +0:54 Constant: +0:54 0 (const int) +0:54 Loop with condition tested first +0:54 Loop Condition +0:54 Compare Less Than ( temp bool) +0:54 'j' ( temp int) +0:54 Constant: +0:54 6 (const int) +0:54 Loop Body +0:55 Sequence +0:55 Sequence +0:55 Sequence +0:55 move second child to first child ( temp int) +0:55 'k' ( temp int) +0:55 Constant: +0:55 0 (const int) +0:55 Loop with condition tested first +0:55 Loop Condition +0:55 Compare Less Than ( temp bool) +0:55 'k' ( temp int) +0:55 Constant: +0:55 3 (const int) +0:55 Loop Body +0:56 Sequence +0:56 move second child to first child ( temp float) +0:56 indirect index ( temp float) +0:56 t1_array: direct index for structure ( temp 3-element array of float) +0:56 indirect index ( temp structure{ temp 3-element array of float t1_array, temp float t1_scalar}) +0:56 t1b: direct index for structure ( temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar}) +0:56 t2: direct index for structure ( temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:56 indirect index ( temp structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:56 't3' ( temp 10-element array of structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:56 'i' ( temp int) +0:56 Constant: +0:56 1 (const int) +0:56 Constant: +0:56 1 (const int) +0:56 'j' ( temp int) +0:56 Constant: +0:56 0 (const int) +0:56 'k' ( temp int) +0:56 Convert int to float ( temp float) +0:56 add ( temp int) +0:56 component-wise multiply ( temp int) +0:56 'i' ( temp int) +0:56 'j' ( temp int) +0:56 'k' ( temp int) +0:55 Loop Terminal Expression +0:55 Post-Increment ( temp int) +0:55 'k' ( temp int) +0:58 move second child to first child ( temp float) +0:58 t1_scalar: direct index for structure ( noContraction temp float) +0:58 indirect index ( temp structure{ temp 3-element array of float t1_array, temp float t1_scalar}) +0:58 t1b: direct index for structure ( temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar}) +0:58 t2: direct index for structure ( temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:58 indirect index ( temp structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:58 't3' ( temp 10-element array of structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:58 'i' ( temp int) +0:58 Constant: +0:58 1 (const int) +0:58 Constant: +0:58 1 (const int) +0:58 'j' ( temp int) +0:58 Constant: +0:58 1 (const int) +0:58 divide ( noContraction temp float) +0:58 component-wise multiply ( noContraction temp float) +0:58 Convert int to float ( temp float) +0:58 'j' ( noContraction temp int) +0:58 Constant: +0:58 2.000000 +0:58 Convert int to float ( temp float) +0:58 'i' ( noContraction temp int) +0:54 Loop Terminal Expression +0:54 Post-Increment ( noContraction temp int) +0:54 'j' ( noContraction temp int) +0:61 Sequence +0:61 Sequence +0:61 move second child to first child ( temp int) +0:61 'j' ( noContraction temp int) +0:61 Constant: +0:61 0 (const int) +0:61 Loop with condition tested first +0:61 Loop Condition +0:61 Compare Less Than ( temp bool) +0:61 'j' ( temp int) +0:61 Constant: +0:61 6 (const int) +0:61 Loop Body +0:62 Sequence +0:62 Sequence +0:62 Sequence +0:62 move second child to first child ( temp int) +0:62 'k' ( noContraction temp int) +0:62 Constant: +0:62 0 (const int) +0:62 Loop with condition tested first +0:62 Loop Condition +0:62 Compare Less Than ( temp bool) +0:62 'k' ( temp int) +0:62 Constant: +0:62 3 (const int) +0:62 Loop Body +0:63 Sequence +0:63 move second child to first child ( temp float) +0:63 indirect index ( noContraction temp float) +0:63 t1_array: direct index for structure ( noContraction temp 3-element array of float) +0:63 indirect index ( temp structure{ temp 3-element array of float t1_array, temp float t1_scalar}) +0:63 t1c: direct index for structure ( temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar}) +0:63 t2: direct index for structure ( temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:63 indirect index ( temp structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:63 't3' ( temp 10-element array of structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:63 'i' ( temp int) +0:63 Constant: +0:63 1 (const int) +0:63 Constant: +0:63 2 (const int) +0:63 'j' ( temp int) +0:63 Constant: +0:63 0 (const int) +0:63 'k' ( temp int) +0:63 Convert int to float ( temp float) +0:63 add ( temp int) +0:63 component-wise multiply ( temp int) +0:63 'i' ( noContraction temp int) +0:63 'j' ( noContraction temp int) +0:63 'k' ( noContraction temp int) +0:62 Loop Terminal Expression +0:62 Post-Increment ( noContraction temp int) +0:62 'k' ( noContraction temp int) +0:65 move second child to first child ( temp float) +0:65 t1_scalar: direct index for structure ( temp float) +0:65 indirect index ( temp structure{ temp 3-element array of float t1_array, temp float t1_scalar}) +0:65 t1c: direct index for structure ( temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar}) +0:65 t2: direct index for structure ( temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:65 indirect index ( temp structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:65 't3' ( temp 10-element array of structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:65 'i' ( temp int) +0:65 Constant: +0:65 1 (const int) +0:65 Constant: +0:65 2 (const int) +0:65 'j' ( temp int) +0:65 Constant: +0:65 1 (const int) +0:65 divide ( temp float) +0:65 component-wise multiply ( temp float) +0:65 Convert int to float ( temp float) +0:65 'j' ( temp int) +0:65 Constant: +0:65 2.000000 +0:65 Convert int to float ( temp float) +0:65 'i' ( temp int) +0:61 Loop Terminal Expression +0:61 Post-Increment ( noContraction temp int) +0:61 'j' ( noContraction temp int) +0:43 Loop Terminal Expression +0:43 Post-Increment ( noContraction temp int) +0:43 'i' ( noContraction temp int) +0:68 Sequence +0:68 move second child to first child ( temp int) +0:68 'i' ( temp int) +0:68 Constant: +0:68 2 (const int) +0:69 move second child to first child ( temp float) +0:69 'result' ( noContraction temp float) +0:71 add ( noContraction temp float) +0:70 add ( noContraction temp float) +0:69 direct index ( noContraction temp float) +0:69 t1_array: direct index for structure ( temp 3-element array of float) +0:69 direct index ( temp structure{ temp 3-element array of float t1_array, temp float t1_scalar}) +0:69 t1c: direct index for structure ( temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar}) +0:69 t2: direct index for structure ( temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:69 direct index ( temp structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:69 't3' ( temp 10-element array of structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:69 Constant: +0:69 5 (const int) +0:69 Constant: +0:69 1 (const int) +0:69 Constant: +0:69 2 (const int) +0:69 Constant: +0:69 6 (const int) +0:69 Constant: +0:69 0 (const int) +0:69 Constant: +0:69 1 (const int) +0:70 t1_scalar: direct index for structure ( noContraction temp float) +0:70 direct index ( temp structure{ temp 3-element array of float t1_array, temp float t1_scalar}) +0:70 t1b: direct index for structure ( temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar}) +0:70 t2: direct index for structure ( temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:70 direct index ( temp structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:70 't3' ( temp 10-element array of structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:70 Constant: +0:70 2 (const int) +0:70 Constant: +0:70 1 (const int) +0:70 Constant: +0:70 1 (const int) +0:70 Constant: +0:70 1 (const int) +0:70 Constant: +0:70 1 (const int) +0:71 direct index ( noContraction temp float) +0:71 vector swizzle ( temp 2-component vector of float) +0:71 v: direct index for structure ( temp 4-component vector of float) +0:71 indirect index ( temp structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:71 't3' ( temp 10-element array of structure{ temp float f, temp structure{ temp 5-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{ temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:71 subtract ( temp int) +0:71 'i' ( temp int) +0:71 Constant: +0:71 1 (const int) +0:71 Constant: +0:71 2 (const int) +0:71 Sequence +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 1 (const int) +0:71 Constant: +0:71 0 (const int) +0:72 Branch: Return with expression +0:72 'result' ( noContraction temp float) +0:75 Function Definition: out_block( ( global float) +0:75 Function Parameters: +0:76 Sequence +0:76 Sequence +0:76 move second child to first child ( temp float) +0:76 'a' ( noContraction temp float) +0:76 Constant: +0:76 0.100000 +0:77 Sequence +0:77 move second child to first child ( temp float) +0:77 'b' ( noContraction temp float) +0:77 Constant: +0:77 0.200000 +0:78 move second child to first child ( temp float) +0:78 f1: direct index for structure ( noContraction global float) +0:78 s: direct index for structure ( noContraction out structure{ global float f1, global float f2}) +0:78 'partial_precise_block' ( out block{ noContraction out structure{ global float f1, global float f2} s, out float x}) +0:78 Constant: +0:78 0 (const int) +0:78 Constant: +0:78 0 (const int) +0:78 add ( noContraction temp float) +0:78 'a' ( noContraction temp float) +0:78 'b' ( noContraction temp float) +0:79 move second child to first child ( temp float) +0:79 f2: direct index for structure ( noContraction global float) +0:79 s: direct index for structure ( noContraction out structure{ global float f1, global float f2}) +0:79 'partial_precise_block' ( out block{ noContraction out structure{ global float f1, global float f2} s, out float x}) +0:79 Constant: +0:79 0 (const int) +0:79 Constant: +0:79 1 (const int) +0:79 subtract ( noContraction temp float) +0:79 'a' ( noContraction temp float) +0:79 'b' ( noContraction temp float) +0:80 move second child to first child ( temp float) +0:80 x: direct index for structure ( out float) +0:80 'partial_precise_block' ( out block{ noContraction out structure{ global float f1, global float f2} s, out float x}) +0:80 Constant: +0:80 1 (const int) +0:80 component-wise multiply ( temp float) +0:80 'a' ( temp float) +0:80 'b' ( temp float) +0:82 move second child to first child ( temp float) +0:82 f1: direct index for structure ( noContraction global float) +0:82 s: direct index for structure ( noContraction out structure{ global float f1, global float f2}) +0:82 'all_precise_block' ( noContraction out block{ out structure{ global float f1, global float f2} s, out float x}) +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 0 (const int) +0:82 add ( noContraction temp float) +0:82 add ( noContraction temp float) +0:82 'a' ( noContraction temp float) +0:82 'b' ( noContraction temp float) +0:82 Constant: +0:82 1.000000 +0:83 move second child to first child ( temp float) +0:83 f2: direct index for structure ( noContraction global float) +0:83 s: direct index for structure ( noContraction out structure{ global float f1, global float f2}) +0:83 'all_precise_block' ( noContraction out block{ out structure{ global float f1, global float f2} s, out float x}) +0:83 Constant: +0:83 0 (const int) +0:83 Constant: +0:83 1 (const int) +0:83 subtract ( noContraction temp float) +0:83 subtract ( noContraction temp float) +0:83 'a' ( noContraction temp float) +0:83 'b' ( noContraction temp float) +0:83 Constant: +0:83 1.000000 +0:84 move second child to first child ( temp float) +0:84 x: direct index for structure ( noContraction out float) +0:84 'all_precise_block' ( noContraction out block{ out structure{ global float f1, global float f2} s, out float x}) +0:84 Constant: +0:84 1 (const int) +0:84 component-wise multiply ( noContraction temp float) +0:84 component-wise multiply ( noContraction temp float) +0:84 'a' ( noContraction temp float) +0:84 'b' ( noContraction temp float) +0:84 Constant: +0:84 2.000000 +0:86 Branch: Return with expression +0:86 add ( temp float) +0:86 'a' ( temp float) +0:86 'b' ( temp float) +0:89 Function Definition: main( ( global void) +0:89 Function Parameters: +0:? Linker Objects +0:? 'partial_precise_block' ( out block{ noContraction out structure{ global float f1, global float f2} s, out float x}) +0:? 'all_precise_block' ( noContraction out block{ out structure{ global float f1, global float f2} s, out float x}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 450 +0:? Sequence +0:89 Function Definition: main( ( global void) +0:89 Function Parameters: +0:? Linker Objects +0:? 'partial_precise_block' ( out block{ noContraction out structure{ global float f1, global float f2} s, out float x}) +0:? 'all_precise_block' ( noContraction out block{ out structure{ global float f1, global float f2} s, out float x}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/precision.frag.out b/deps/glslang/Test/baseResults/precision.frag.out new file mode 100644 index 00000000..7174049f --- /dev/null +++ b/deps/glslang/Test/baseResults/precision.frag.out @@ -0,0 +1,233 @@ +precision.frag +ERROR: 0:3: 'float' : type requires declaration of default precision qualifier +ERROR: 0:18: 'int' : cannot apply precision statement to this type; use 'float', 'int' or a sampler type +ERROR: 0:19: 'int' : cannot apply precision statement to this type; use 'float', 'int' or a sampler type +ERROR: 0:21: 'float' : cannot apply precision statement to this type; use 'float', 'int' or a sampler type +ERROR: 0:72: 'bool' : cannot apply precision statement to this type; use 'float', 'int' or a sampler type +ERROR: 0:75: 'structure' : cannot apply precision statement to this type; use 'float', 'int' or a sampler type +ERROR: 0:76: 'bool' : type cannot have precision qualifier +ERROR: 7 compilation errors. No code generated. + + +Shader version: 100 +ERROR: node is still EOpNull! +0:5 Function Definition: foo(vf3; ( global lowp 2-component vector of float) +0:5 Function Parameters: +0:5 'mv3' ( in mediump 3-component vector of float) +0:? Sequence +0:8 Branch: Return with expression +0:8 vector swizzle ( temp highp 2-component vector of float) +0:8 'hv4' ( temp highp 4-component vector of float) +0:8 Sequence +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 1 (const int) +0:25 Function Definition: main( ( global void) +0:25 Function Parameters: +0:27 Sequence +0:27 Sequence +0:27 move second child to first child ( temp highp int) +0:27 'sum' ( temp lowp int) +0:27 add ( temp highp int) +0:27 'global_medium' ( global mediump int) +0:27 'global_high' ( global highp int) +0:29 move second child to first child ( temp mediump 4-component vector of float) +0:29 'gl_FragColor' ( fragColor mediump 4-component vector of float FragColor) +0:29 Construct vec4 ( temp mediump 4-component vector of float) +0:29 'color' ( smooth in mediump 3-component vector of float) +0:29 Constant: +0:29 1.000000 +0:32 add second child into first child ( temp highp int) +0:32 'sum' ( temp lowp int) +0:32 'level1_high' ( temp highp int) +0:36 add second child into first child ( temp lowp int) +0:36 'sum' ( temp lowp int) +0:36 'level1_low' ( temp lowp int) +0:41 Sequence +0:41 move second child to first child ( temp mediump float) +0:41 'd' ( temp lowp float) +0:41 distance ( global mediump float) +0:41 'arg1' ( temp lowp float) +0:41 'arg2' ( temp mediump float) +0:? Sequence +0:45 add second child into first child ( temp lowp int) +0:45 'sum' ( temp lowp int) +0:45 'level2_low' ( temp lowp int) +0:49 add second child into first child ( temp highp int) +0:49 'sum' ( temp lowp int) +0:49 'level2_high' ( temp highp int) +0:58 Loop with condition not tested first +0:58 Loop Condition +0:58 Constant: +0:58 true (const bool) +0:58 Loop Body +0:51 Sequence +0:51 Test condition and select ( temp void) +0:51 Condition +0:51 Constant: +0:51 true (const bool) +0:51 true case +0:? Sequence +0:54 add second child into first child ( temp mediump int) +0:54 'sum' ( temp lowp int) +0:54 'level4_medium' ( temp mediump int) +0:57 add second child into first child ( temp highp int) +0:57 'sum' ( temp lowp int) +0:57 'level3_high' ( temp highp int) +0:60 add second child into first child ( temp highp int) +0:60 'sum' ( temp lowp int) +0:60 'level2_high2' ( temp highp int) +0:63 add second child into first child ( temp lowp int) +0:63 'sum' ( temp lowp int) +0:63 'level1_low3' ( temp lowp int) +0:65 add second child into first child ( temp lowp int) +0:65 'sum' ( temp lowp int) +0:65 add ( temp lowp int) +0:65 Constant: +0:65 4 (const int) +0:65 direct index ( temp lowp int) +0:65 add ( temp lowp 2-component vector of int) +0:65 component-wise multiply ( temp lowp 2-component vector of int) +0:65 Construct ivec2 ( temp lowp 2-component vector of int) +0:65 'level1_low3' ( temp lowp int) +0:65 Construct ivec2 ( temp lowp 2-component vector of int) +0:65 'level1_high' ( temp highp int) +0:65 Construct ivec2 ( temp lowp 2-component vector of int) +0:65 Comma ( temp highp int) +0:65 'level1_low3' ( temp lowp int) +0:65 'level1_high' ( temp highp int) +0:65 Constant: +0:65 0 (const int) +0:67 texture ( global lowp 4-component vector of float) +0:67 'samplerLow' ( uniform lowp sampler2D) +0:67 Constant: +0:67 0.100000 +0:67 0.200000 +0:68 texture ( global mediump 4-component vector of float) +0:68 'samplerMed' ( uniform mediump sampler2D) +0:68 Constant: +0:68 0.100000 +0:68 0.200000 +0:69 texture ( global highp 4-component vector of float) +0:69 'samplerHigh' ( uniform highp sampler2D) +0:69 Constant: +0:69 0.100000 +0:69 0.200000 +0:? Linker Objects +0:? 'color' ( smooth in mediump 3-component vector of float) +0:? 'global_medium' ( global mediump int) +0:? 'samplerLow' ( uniform lowp sampler2D) +0:? 'samplerMed' ( uniform mediump sampler2D) +0:? 'samplerHigh' ( uniform highp sampler2D) +0:? 'uint' ( global mediump 4-component vector of float) +0:? 'global_high' ( global highp int) +0:? 'b2' ( global mediump 2-component vector of bool) + + +Linked fragment stage: + + +Shader version: 100 +ERROR: node is still EOpNull! +0:25 Function Definition: main( ( global void) +0:25 Function Parameters: +0:27 Sequence +0:27 Sequence +0:27 move second child to first child ( temp highp int) +0:27 'sum' ( temp lowp int) +0:27 add ( temp highp int) +0:27 'global_medium' ( global mediump int) +0:27 'global_high' ( global highp int) +0:29 move second child to first child ( temp mediump 4-component vector of float) +0:29 'gl_FragColor' ( fragColor mediump 4-component vector of float FragColor) +0:29 Construct vec4 ( temp mediump 4-component vector of float) +0:29 'color' ( smooth in mediump 3-component vector of float) +0:29 Constant: +0:29 1.000000 +0:32 add second child into first child ( temp highp int) +0:32 'sum' ( temp lowp int) +0:32 'level1_high' ( temp highp int) +0:36 add second child into first child ( temp lowp int) +0:36 'sum' ( temp lowp int) +0:36 'level1_low' ( temp lowp int) +0:41 Sequence +0:41 move second child to first child ( temp mediump float) +0:41 'd' ( temp lowp float) +0:41 distance ( global mediump float) +0:41 'arg1' ( temp lowp float) +0:41 'arg2' ( temp mediump float) +0:? Sequence +0:45 add second child into first child ( temp lowp int) +0:45 'sum' ( temp lowp int) +0:45 'level2_low' ( temp lowp int) +0:49 add second child into first child ( temp highp int) +0:49 'sum' ( temp lowp int) +0:49 'level2_high' ( temp highp int) +0:58 Loop with condition not tested first +0:58 Loop Condition +0:58 Constant: +0:58 true (const bool) +0:58 Loop Body +0:51 Sequence +0:51 Test condition and select ( temp void) +0:51 Condition +0:51 Constant: +0:51 true (const bool) +0:51 true case +0:? Sequence +0:54 add second child into first child ( temp mediump int) +0:54 'sum' ( temp lowp int) +0:54 'level4_medium' ( temp mediump int) +0:57 add second child into first child ( temp highp int) +0:57 'sum' ( temp lowp int) +0:57 'level3_high' ( temp highp int) +0:60 add second child into first child ( temp highp int) +0:60 'sum' ( temp lowp int) +0:60 'level2_high2' ( temp highp int) +0:63 add second child into first child ( temp lowp int) +0:63 'sum' ( temp lowp int) +0:63 'level1_low3' ( temp lowp int) +0:65 add second child into first child ( temp lowp int) +0:65 'sum' ( temp lowp int) +0:65 add ( temp lowp int) +0:65 Constant: +0:65 4 (const int) +0:65 direct index ( temp lowp int) +0:65 add ( temp lowp 2-component vector of int) +0:65 component-wise multiply ( temp lowp 2-component vector of int) +0:65 Construct ivec2 ( temp lowp 2-component vector of int) +0:65 'level1_low3' ( temp lowp int) +0:65 Construct ivec2 ( temp lowp 2-component vector of int) +0:65 'level1_high' ( temp highp int) +0:65 Construct ivec2 ( temp lowp 2-component vector of int) +0:65 Comma ( temp highp int) +0:65 'level1_low3' ( temp lowp int) +0:65 'level1_high' ( temp highp int) +0:65 Constant: +0:65 0 (const int) +0:67 texture ( global lowp 4-component vector of float) +0:67 'samplerLow' ( uniform lowp sampler2D) +0:67 Constant: +0:67 0.100000 +0:67 0.200000 +0:68 texture ( global mediump 4-component vector of float) +0:68 'samplerMed' ( uniform mediump sampler2D) +0:68 Constant: +0:68 0.100000 +0:68 0.200000 +0:69 texture ( global highp 4-component vector of float) +0:69 'samplerHigh' ( uniform highp sampler2D) +0:69 Constant: +0:69 0.100000 +0:69 0.200000 +0:? Linker Objects +0:? 'color' ( smooth in mediump 3-component vector of float) +0:? 'global_medium' ( global mediump int) +0:? 'samplerLow' ( uniform lowp sampler2D) +0:? 'samplerMed' ( uniform mediump sampler2D) +0:? 'samplerHigh' ( uniform highp sampler2D) +0:? 'uint' ( global mediump 4-component vector of float) +0:? 'global_high' ( global highp int) +0:? 'b2' ( global mediump 2-component vector of bool) + diff --git a/deps/glslang/Test/baseResults/precision.vert.out b/deps/glslang/Test/baseResults/precision.vert.out new file mode 100644 index 00000000..04ceb3a6 --- /dev/null +++ b/deps/glslang/Test/baseResults/precision.vert.out @@ -0,0 +1,99 @@ +precision.vert +ERROR: 0:7: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:8: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 0:14: 'sampler/image' : type requires declaration of default precision qualifier +ERROR: 3 compilation errors. No code generated. + + +Shader version: 300 +ERROR: node is still EOpNull! +0:18 Function Definition: main( ( global void) +0:18 Function Parameters: +0:20 Sequence +0:20 Sequence +0:20 move second child to first child ( temp highp 4-component vector of float) +0:20 't' ( temp highp 4-component vector of float) +0:20 texture ( global lowp 4-component vector of float) +0:20 's2D' ( uniform lowp sampler2D) +0:20 Constant: +0:20 0.100000 +0:20 0.200000 +0:21 add second child into first child ( temp highp 4-component vector of float) +0:21 't' ( temp highp 4-component vector of float) +0:21 texture ( global highp 4-component vector of float) +0:21 's2Dhigh' ( uniform highp sampler2D) +0:21 Constant: +0:21 0.100000 +0:21 0.200000 +0:22 add second child into first child ( temp highp 4-component vector of float) +0:22 't' ( temp highp 4-component vector of float) +0:22 texture ( global mediump float) +0:22 's2dAS' ( uniform mediump sampler2DArrayShadow) +0:22 Constant: +0:22 0.500000 +0:22 0.500000 +0:22 0.500000 +0:22 0.500000 +0:24 move second child to first child ( temp highp 4-component vector of float) +0:24 'gl_Position' ( gl_Position highp 4-component vector of float Position) +0:24 'pos' ( in highp 4-component vector of float) +0:? Linker Objects +0:? 'pos' ( in highp 4-component vector of float) +0:? 's2D' ( uniform lowp sampler2D) +0:? 'sCube' ( uniform lowp samplerCube) +0:? 'is2DAbad' ( uniform mediump isampler2DArray) +0:? 's2dASbad' ( uniform mediump sampler2DArrayShadow) +0:? 's2dAS' ( uniform mediump sampler2DArrayShadow) +0:? 'is2DAbad2' ( uniform mediump isampler2DArray) +0:? 's2Dhigh' ( uniform highp sampler2D) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + + +Linked vertex stage: + + +Shader version: 300 +ERROR: node is still EOpNull! +0:18 Function Definition: main( ( global void) +0:18 Function Parameters: +0:20 Sequence +0:20 Sequence +0:20 move second child to first child ( temp highp 4-component vector of float) +0:20 't' ( temp highp 4-component vector of float) +0:20 texture ( global lowp 4-component vector of float) +0:20 's2D' ( uniform lowp sampler2D) +0:20 Constant: +0:20 0.100000 +0:20 0.200000 +0:21 add second child into first child ( temp highp 4-component vector of float) +0:21 't' ( temp highp 4-component vector of float) +0:21 texture ( global highp 4-component vector of float) +0:21 's2Dhigh' ( uniform highp sampler2D) +0:21 Constant: +0:21 0.100000 +0:21 0.200000 +0:22 add second child into first child ( temp highp 4-component vector of float) +0:22 't' ( temp highp 4-component vector of float) +0:22 texture ( global mediump float) +0:22 's2dAS' ( uniform mediump sampler2DArrayShadow) +0:22 Constant: +0:22 0.500000 +0:22 0.500000 +0:22 0.500000 +0:22 0.500000 +0:24 move second child to first child ( temp highp 4-component vector of float) +0:24 'gl_Position' ( gl_Position highp 4-component vector of float Position) +0:24 'pos' ( in highp 4-component vector of float) +0:? Linker Objects +0:? 'pos' ( in highp 4-component vector of float) +0:? 's2D' ( uniform lowp sampler2D) +0:? 'sCube' ( uniform lowp samplerCube) +0:? 'is2DAbad' ( uniform mediump isampler2DArray) +0:? 's2dASbad' ( uniform mediump sampler2DArrayShadow) +0:? 's2dAS' ( uniform mediump sampler2DArrayShadow) +0:? 'is2DAbad2' ( uniform mediump isampler2DArray) +0:? 's2Dhigh' ( uniform highp sampler2D) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + diff --git a/deps/glslang/Test/baseResults/prepost.frag.out b/deps/glslang/Test/baseResults/prepost.frag.out new file mode 100644 index 00000000..d5f73b6d --- /dev/null +++ b/deps/glslang/Test/baseResults/prepost.frag.out @@ -0,0 +1,271 @@ +prepost.frag +Shader version: 140 +0:? Sequence +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp int) +0:10 'index' ( temp int) +0:10 Constant: +0:10 5 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 y: direct index for structure ( temp 5-element array of float) +0:12 'str' ( temp structure{ temp 5-element array of float y}) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 4 (const int) +0:12 Constant: +0:12 2.000000 +0:13 move second child to first child ( temp float) +0:13 't' ( temp float) +0:13 Pre-Increment ( temp float) +0:13 indirect index ( temp float) +0:13 y: direct index for structure ( temp 5-element array of float) +0:13 'str' ( temp structure{ temp 5-element array of float y}) +0:13 Constant: +0:13 0 (const int) +0:13 Pre-Decrement ( temp int) +0:13 'index' ( temp int) +0:14 add second child into first child ( temp float) +0:14 direct index ( temp float) +0:14 y: direct index for structure ( temp 5-element array of float) +0:14 'str' ( temp structure{ temp 5-element array of float y}) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 4 (const int) +0:14 't' ( temp float) +0:15 move second child to first child ( temp float) +0:15 't' ( temp float) +0:15 Post-Decrement ( temp float) +0:15 direct index ( temp float) +0:15 y: direct index for structure ( temp 5-element array of float) +0:15 'str' ( temp structure{ temp 5-element array of float y}) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 4 (const int) +0:16 add second child into first child ( temp float) +0:16 indirect index ( temp float) +0:16 y: direct index for structure ( temp 5-element array of float) +0:16 'str' ( temp structure{ temp 5-element array of float y}) +0:16 Constant: +0:16 0 (const int) +0:16 Post-Increment ( temp int) +0:16 'index' ( temp int) +0:16 't' ( temp float) +0:17 Pre-Decrement ( temp float) +0:17 indirect index ( temp float) +0:17 y: direct index for structure ( temp 5-element array of float) +0:17 'str' ( temp structure{ temp 5-element array of float y}) +0:17 Constant: +0:17 0 (const int) +0:17 Pre-Decrement ( temp int) +0:17 'index' ( temp int) +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'x' ( temp float) +0:19 direct index ( temp float) +0:19 y: direct index for structure ( temp 5-element array of float) +0:19 'str' ( temp structure{ temp 5-element array of float y}) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 4 (const int) +0:20 Pre-Increment ( temp float) +0:20 'x' ( temp float) +0:21 Pre-Decrement ( temp float) +0:21 'x' ( temp float) +0:22 Post-Increment ( temp float) +0:22 'x' ( temp float) +0:23 Post-Decrement ( temp float) +0:23 'x' ( temp float) +0:27 Sequence +0:27 move second child to first child ( temp float) +0:27 'y' ( temp float) +0:27 component-wise multiply ( temp float) +0:27 'x' ( temp float) +0:27 Pre-Increment ( temp float) +0:27 'x' ( temp float) +0:28 Sequence +0:28 move second child to first child ( temp float) +0:28 'z' ( temp float) +0:28 component-wise multiply ( temp float) +0:28 'y' ( temp float) +0:28 Post-Decrement ( temp float) +0:28 'x' ( temp float) +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of float) +0:33 'v' ( temp 4-component vector of float) +0:33 Constant: +0:33 1.000000 +0:33 2.000000 +0:33 3.000000 +0:33 4.000000 +0:34 move second child to first child ( temp float) +0:34 direct index ( temp float) +0:34 'v' ( temp 4-component vector of float) +0:34 Constant: +0:34 1 (const int) +0:34 Post-Decrement ( temp float) +0:34 direct index ( temp float) +0:34 'v' ( temp 4-component vector of float) +0:34 Constant: +0:34 2 (const int) +0:35 move second child to first child ( temp float) +0:35 direct index ( temp float) +0:35 'v' ( temp 4-component vector of float) +0:35 Constant: +0:35 0 (const int) +0:35 Pre-Decrement ( temp float) +0:35 direct index ( temp float) +0:35 'v' ( temp 4-component vector of float) +0:35 Constant: +0:35 3 (const int) +0:37 move second child to first child ( temp 4-component vector of float) +0:37 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:37 vector-scale ( temp 4-component vector of float) +0:37 'z' ( temp float) +0:37 'v' ( temp 4-component vector of float) +0:? Linker Objects + + +Linked fragment stage: + + +Shader version: 140 +0:? Sequence +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:? Sequence +0:10 Sequence +0:10 move second child to first child ( temp int) +0:10 'index' ( temp int) +0:10 Constant: +0:10 5 (const int) +0:12 move second child to first child ( temp float) +0:12 direct index ( temp float) +0:12 y: direct index for structure ( temp 5-element array of float) +0:12 'str' ( temp structure{ temp 5-element array of float y}) +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 4 (const int) +0:12 Constant: +0:12 2.000000 +0:13 move second child to first child ( temp float) +0:13 't' ( temp float) +0:13 Pre-Increment ( temp float) +0:13 indirect index ( temp float) +0:13 y: direct index for structure ( temp 5-element array of float) +0:13 'str' ( temp structure{ temp 5-element array of float y}) +0:13 Constant: +0:13 0 (const int) +0:13 Pre-Decrement ( temp int) +0:13 'index' ( temp int) +0:14 add second child into first child ( temp float) +0:14 direct index ( temp float) +0:14 y: direct index for structure ( temp 5-element array of float) +0:14 'str' ( temp structure{ temp 5-element array of float y}) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 4 (const int) +0:14 't' ( temp float) +0:15 move second child to first child ( temp float) +0:15 't' ( temp float) +0:15 Post-Decrement ( temp float) +0:15 direct index ( temp float) +0:15 y: direct index for structure ( temp 5-element array of float) +0:15 'str' ( temp structure{ temp 5-element array of float y}) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 4 (const int) +0:16 add second child into first child ( temp float) +0:16 indirect index ( temp float) +0:16 y: direct index for structure ( temp 5-element array of float) +0:16 'str' ( temp structure{ temp 5-element array of float y}) +0:16 Constant: +0:16 0 (const int) +0:16 Post-Increment ( temp int) +0:16 'index' ( temp int) +0:16 't' ( temp float) +0:17 Pre-Decrement ( temp float) +0:17 indirect index ( temp float) +0:17 y: direct index for structure ( temp 5-element array of float) +0:17 'str' ( temp structure{ temp 5-element array of float y}) +0:17 Constant: +0:17 0 (const int) +0:17 Pre-Decrement ( temp int) +0:17 'index' ( temp int) +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'x' ( temp float) +0:19 direct index ( temp float) +0:19 y: direct index for structure ( temp 5-element array of float) +0:19 'str' ( temp structure{ temp 5-element array of float y}) +0:19 Constant: +0:19 0 (const int) +0:19 Constant: +0:19 4 (const int) +0:20 Pre-Increment ( temp float) +0:20 'x' ( temp float) +0:21 Pre-Decrement ( temp float) +0:21 'x' ( temp float) +0:22 Post-Increment ( temp float) +0:22 'x' ( temp float) +0:23 Post-Decrement ( temp float) +0:23 'x' ( temp float) +0:27 Sequence +0:27 move second child to first child ( temp float) +0:27 'y' ( temp float) +0:27 component-wise multiply ( temp float) +0:27 'x' ( temp float) +0:27 Pre-Increment ( temp float) +0:27 'x' ( temp float) +0:28 Sequence +0:28 move second child to first child ( temp float) +0:28 'z' ( temp float) +0:28 component-wise multiply ( temp float) +0:28 'y' ( temp float) +0:28 Post-Decrement ( temp float) +0:28 'x' ( temp float) +0:33 Sequence +0:33 move second child to first child ( temp 4-component vector of float) +0:33 'v' ( temp 4-component vector of float) +0:33 Constant: +0:33 1.000000 +0:33 2.000000 +0:33 3.000000 +0:33 4.000000 +0:34 move second child to first child ( temp float) +0:34 direct index ( temp float) +0:34 'v' ( temp 4-component vector of float) +0:34 Constant: +0:34 1 (const int) +0:34 Post-Decrement ( temp float) +0:34 direct index ( temp float) +0:34 'v' ( temp 4-component vector of float) +0:34 Constant: +0:34 2 (const int) +0:35 move second child to first child ( temp float) +0:35 direct index ( temp float) +0:35 'v' ( temp 4-component vector of float) +0:35 Constant: +0:35 0 (const int) +0:35 Pre-Decrement ( temp float) +0:35 direct index ( temp float) +0:35 'v' ( temp 4-component vector of float) +0:35 Constant: +0:35 3 (const int) +0:37 move second child to first child ( temp 4-component vector of float) +0:37 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:37 vector-scale ( temp 4-component vector of float) +0:37 'z' ( temp float) +0:37 'v' ( temp 4-component vector of float) +0:? Linker Objects + diff --git a/deps/glslang/Test/baseResults/preprocessor.bad_arg.vert.err b/deps/glslang/Test/baseResults/preprocessor.bad_arg.vert.err new file mode 100644 index 00000000..ae970a0e --- /dev/null +++ b/deps/glslang/Test/baseResults/preprocessor.bad_arg.vert.err @@ -0,0 +1,4 @@ +ERROR: 0:8: 'macro expansion' : End of input in macro EXP2 +ERROR: 1 compilation errors. No code generated. + + diff --git a/deps/glslang/Test/baseResults/preprocessor.bad_arg.vert.out b/deps/glslang/Test/baseResults/preprocessor.bad_arg.vert.out new file mode 100644 index 00000000..e69de29b diff --git a/deps/glslang/Test/baseResults/preprocessor.cpp_style___FILE__.vert.err b/deps/glslang/Test/baseResults/preprocessor.cpp_style___FILE__.vert.err new file mode 100644 index 00000000..e69de29b diff --git a/deps/glslang/Test/baseResults/preprocessor.cpp_style___FILE__.vert.out b/deps/glslang/Test/baseResults/preprocessor.cpp_style___FILE__.vert.out new file mode 100644 index 00000000..e63d81a6 --- /dev/null +++ b/deps/glslang/Test/baseResults/preprocessor.cpp_style___FILE__.vert.out @@ -0,0 +1,37 @@ +#extension GL_GOOGLE_cpp_style_line_directive : enable + +0 + +#line 150 "a.h" + "a.h" + +#line 24 + "a.h" + +#line 42 + "a.h" + +#line 30 "b.cc" + "b.cc" + +#line 10 3 + 3 + +#line 48 + 3 + +#line 4 + 3 + +#line 55 100 + 100 + +#line 1000 "c" + "c" + +#line 42 1 + 1 + +#line 42 "this-is-a-quite-long-name-maybe-i-should-shorten-it" + "this-is-a-quite-long-name-maybe-i-should-shorten-it" + diff --git a/deps/glslang/Test/baseResults/preprocessor.cpp_style_line_directive.vert.err b/deps/glslang/Test/baseResults/preprocessor.cpp_style_line_directive.vert.err new file mode 100644 index 00000000..794ded80 --- /dev/null +++ b/deps/glslang/Test/baseResults/preprocessor.cpp_style_line_directive.vert.err @@ -0,0 +1,15 @@ +ERROR: 0:3: '#error' : at 0:3 +ERROR: a.h:150: '#error' : at a.h:150 +ERROR: a.h:24: '#error' : at a.h:24 +ERROR: a.h:42: '#error' : at a.h:42 +ERROR: b.cc:30: '#error' : at b.cc:30 +ERROR: 3:10: '#error' : at 3:10 +ERROR: 3:48: '#error' : at 3:48 +ERROR: 3:4: '#error' : at 3:4 +ERROR: 100:55: '#error' : at 100:55 +ERROR: c:1000: '#error' : at c:1000 +ERROR: 1:42: '#error' : at 1:42 +ERROR: this-is-a-quite-long-name-maybe-i-should-shorten-it:42: '#error' : at this-is-a-quite-long-name-maybe-i-should-shorten-it:42 +ERROR: 12 compilation errors. No code generated. + + diff --git a/deps/glslang/Test/baseResults/preprocessor.cpp_style_line_directive.vert.out b/deps/glslang/Test/baseResults/preprocessor.cpp_style_line_directive.vert.out new file mode 100644 index 00000000..e69de29b diff --git a/deps/glslang/Test/baseResults/preprocessor.defined.vert.err b/deps/glslang/Test/baseResults/preprocessor.defined.vert.err new file mode 100644 index 00000000..8dddabca --- /dev/null +++ b/deps/glslang/Test/baseResults/preprocessor.defined.vert.err @@ -0,0 +1,4 @@ +ERROR: 0:2: '#define' : "defined" can't be (un)defined: defined +ERROR: 1 compilation errors. No code generated. + + diff --git a/deps/glslang/Test/baseResults/preprocessor.defined.vert.out b/deps/glslang/Test/baseResults/preprocessor.defined.vert.out new file mode 100644 index 00000000..e69de29b diff --git a/deps/glslang/Test/baseResults/preprocessor.edge_cases.vert.err b/deps/glslang/Test/baseResults/preprocessor.edge_cases.vert.err new file mode 100644 index 00000000..e69de29b diff --git a/deps/glslang/Test/baseResults/preprocessor.edge_cases.vert.out b/deps/glslang/Test/baseResults/preprocessor.edge_cases.vert.out new file mode 100644 index 00000000..17d9049b --- /dev/null +++ b/deps/glslang/Test/baseResults/preprocessor.edge_cases.vert.out @@ -0,0 +1,16 @@ +#version 310 es + + + + + + + + + + + +void main(){ + gl_Position = vec4(3 + 2 + 2 * 4 + 2 + 3 * 2); +} + diff --git a/deps/glslang/Test/baseResults/preprocessor.eof_missing.vert.err b/deps/glslang/Test/baseResults/preprocessor.eof_missing.vert.err new file mode 100644 index 00000000..e69de29b diff --git a/deps/glslang/Test/baseResults/preprocessor.eof_missing.vert.out b/deps/glslang/Test/baseResults/preprocessor.eof_missing.vert.out new file mode 100644 index 00000000..bf09d53e --- /dev/null +++ b/deps/glslang/Test/baseResults/preprocessor.eof_missing.vert.out @@ -0,0 +1,2 @@ +noEOF + diff --git a/deps/glslang/Test/baseResults/preprocessor.errors.vert.err b/deps/glslang/Test/baseResults/preprocessor.errors.vert.err new file mode 100644 index 00000000..bc588958 --- /dev/null +++ b/deps/glslang/Test/baseResults/preprocessor.errors.vert.err @@ -0,0 +1,7 @@ +ERROR: 0:9: '#error' : This should show up in pp output . +ERROR: 0:14: '#' : invalid directive: def +ERROR: 0:15: 'preprocessor evaluation' : undefined macro in expression not allowed in es profile Y +ERROR: 0:21: '' : missing #endif +ERROR: 4 compilation errors. No code generated. + + diff --git a/deps/glslang/Test/baseResults/preprocessor.errors.vert.out b/deps/glslang/Test/baseResults/preprocessor.errors.vert.out new file mode 100644 index 00000000..e69de29b diff --git a/deps/glslang/Test/baseResults/preprocessor.extensions.vert.err b/deps/glslang/Test/baseResults/preprocessor.extensions.vert.err new file mode 100644 index 00000000..35db3034 --- /dev/null +++ b/deps/glslang/Test/baseResults/preprocessor.extensions.vert.err @@ -0,0 +1,2 @@ +WARNING: 0:6: '#extension' : extension not supported: GL_EXT_shader_texture_image_samples + diff --git a/deps/glslang/Test/baseResults/preprocessor.extensions.vert.out b/deps/glslang/Test/baseResults/preprocessor.extensions.vert.out new file mode 100644 index 00000000..57d2e199 --- /dev/null +++ b/deps/glslang/Test/baseResults/preprocessor.extensions.vert.out @@ -0,0 +1,12 @@ +#version 310 es + +#extension GL_EXT_geometry_shader : enable +#extension GL_EXT_frag_depth : disable +#extension GL_EXT_gpu_shader5 : require +#extension GL_EXT_shader_texture_image_samples : warn + +#extension unknown_extension : require + +int main(){ +} + diff --git a/deps/glslang/Test/baseResults/preprocessor.function_macro.vert.err b/deps/glslang/Test/baseResults/preprocessor.function_macro.vert.err new file mode 100644 index 00000000..e69de29b diff --git a/deps/glslang/Test/baseResults/preprocessor.function_macro.vert.out b/deps/glslang/Test/baseResults/preprocessor.function_macro.vert.out new file mode 100644 index 00000000..1280ddf6 --- /dev/null +++ b/deps/glslang/Test/baseResults/preprocessor.function_macro.vert.out @@ -0,0 +1,21 @@ +#version 310 es + + + + + + + + + + + + + + +int main(){ + gl_Position = vec4(3 + 1, 3 + 4, 3 + 1); + gl_Position = vec4(1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12); + gl_Position = vec4(4 + 3 + 3); +} + diff --git a/deps/glslang/Test/baseResults/preprocessor.include.disabled.vert.err b/deps/glslang/Test/baseResults/preprocessor.include.disabled.vert.err new file mode 100644 index 00000000..14192046 --- /dev/null +++ b/deps/glslang/Test/baseResults/preprocessor.include.disabled.vert.err @@ -0,0 +1,13 @@ +ERROR: 0:8000: '#include' : required extension not requested: GL_GOOGLE_include_directive +ERROR: 0:8000: '#include' : must be followed by a header name +ERROR: 0:8001: '#include' : required extension not requested: GL_GOOGLE_include_directive +ERROR: 0:8001: '#include' : must be followed by a header name +ERROR: 0:8002: '#include' : required extension not requested: GL_GOOGLE_include_directive +ERROR: 0:8002: '#include' : Could not process include directive for header name: foo +ERROR: 0:8003: '#include' : required extension not requested: GL_GOOGLE_include_directive +ERROR: 0:8003: '#include' : extra content after header name: foo +ERROR: 0:8004: '#include' : required extension not requested: GL_GOOGLE_include_directive +ERROR: 0:8004: '#include' : expected newline after header name: no-eol +ERROR: 10 compilation errors. No code generated. + + diff --git a/deps/glslang/Test/baseResults/preprocessor.include.disabled.vert.out b/deps/glslang/Test/baseResults/preprocessor.include.disabled.vert.out new file mode 100644 index 00000000..e69de29b diff --git a/deps/glslang/Test/baseResults/preprocessor.include.enabled.vert.err b/deps/glslang/Test/baseResults/preprocessor.include.enabled.vert.err new file mode 100644 index 00000000..252e661f --- /dev/null +++ b/deps/glslang/Test/baseResults/preprocessor.include.enabled.vert.err @@ -0,0 +1,20 @@ +ERROR: 0:8000: '#include' : must be followed by a header name +ERROR: 0:8001: '#include' : must be followed by a header name +ERROR: 0:8002: '#include' : Could not process include directive for header name: foo.oeu +ERROR: 0:8003: '#include' : Could not process include directive for header name: foo.oeu/ao eu/ao.h +ERROR: 0:8004: '#include' : Could not process include directive for header name: foo +ERROR: 0:8006: '#include' : Could not process include directive for header name: foo.oe +ERROR: 0:8007: '#include' : Could not process include directive for header name: foo"bar" +ERROR: 0:8008: '#include' : Could not process include directive for header name: foo\bar +ERROR: 0:8009: '#include' : Could not process include directive for header name: foo.oe> +ERROR: 0:8010: '#include' : Could not process include directive for header name: foo +ERROR: 0:8011: '#include' : extra content after header name: foo2.h +ERROR: 0:8012: '#include' : extra content after header name: foo.h +ERROR: 0:8014: '#include' : Could not process include directive for header name: ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789 +ERROR: 0:8016: '' : header name too long +ERROR: 0:8016: '#include' : Could not process include directive for header name: ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789 +ERROR: 0:8017: '#include' : expected newline after header name: no-eol +ERROR: 17 compilation errors. No code generated. + + diff --git a/deps/glslang/Test/baseResults/preprocessor.include.enabled.vert.out b/deps/glslang/Test/baseResults/preprocessor.include.enabled.vert.out new file mode 100644 index 00000000..e69de29b diff --git a/deps/glslang/Test/baseResults/preprocessor.line.frag.err b/deps/glslang/Test/baseResults/preprocessor.line.frag.err new file mode 100644 index 00000000..e69de29b diff --git a/deps/glslang/Test/baseResults/preprocessor.line.frag.out b/deps/glslang/Test/baseResults/preprocessor.line.frag.out new file mode 100644 index 00000000..3e2206f8 --- /dev/null +++ b/deps/glslang/Test/baseResults/preprocessor.line.frag.out @@ -0,0 +1,5 @@ +#version 310 es +#line 1 2 +#pragma something +void main(){ } + diff --git a/deps/glslang/Test/baseResults/preprocessor.line.vert.err b/deps/glslang/Test/baseResults/preprocessor.line.vert.err new file mode 100644 index 00000000..e69de29b diff --git a/deps/glslang/Test/baseResults/preprocessor.line.vert.out b/deps/glslang/Test/baseResults/preprocessor.line.vert.out new file mode 100644 index 00000000..2bf09032 --- /dev/null +++ b/deps/glslang/Test/baseResults/preprocessor.line.vert.out @@ -0,0 +1,39 @@ +#line 300 + +#line 2 + + + + + +#line 10 + + +#line 2 + +#line 0 + + + +#line 4 + + + + + +#line 8 + +void main(){ + gl_Position = vec4(10); +} + +#line 8 4 + + + + +#line 12 3 + +#line 1 + + diff --git a/deps/glslang/Test/baseResults/preprocessor.many.endif.vert.err b/deps/glslang/Test/baseResults/preprocessor.many.endif.vert.err new file mode 100644 index 00000000..49aafc5a --- /dev/null +++ b/deps/glslang/Test/baseResults/preprocessor.many.endif.vert.err @@ -0,0 +1,12 @@ +ERROR: 0:1: '#endif' : mismatched statements +ERROR: 0:2: '#endif' : mismatched statements +ERROR: 0:3: '#endif' : mismatched statements +ERROR: 0:4: '#endif' : mismatched statements +ERROR: 0:5: '#endif' : mismatched statements +ERROR: 0:6: '#endif' : mismatched statements +ERROR: 0:7: '#endif' : mismatched statements +ERROR: 0:10: 'preprocessor evaluation' : bad expression +ERROR: 0:11: '' : missing #endif +ERROR: 9 compilation errors. No code generated. + + diff --git a/deps/glslang/Test/baseResults/preprocessor.many.endif.vert.out b/deps/glslang/Test/baseResults/preprocessor.many.endif.vert.out new file mode 100644 index 00000000..e69de29b diff --git a/deps/glslang/Test/baseResults/preprocessor.pragma.vert.err b/deps/glslang/Test/baseResults/preprocessor.pragma.vert.err new file mode 100644 index 00000000..da435dbd --- /dev/null +++ b/deps/glslang/Test/baseResults/preprocessor.pragma.vert.err @@ -0,0 +1,2 @@ +WARNING: 0:10: '#pragma once' : not implemented + diff --git a/deps/glslang/Test/baseResults/preprocessor.pragma.vert.out b/deps/glslang/Test/baseResults/preprocessor.pragma.vert.out new file mode 100644 index 00000000..ebe1e4a7 --- /dev/null +++ b/deps/glslang/Test/baseResults/preprocessor.pragma.vert.out @@ -0,0 +1,14 @@ +#version 310 es + +#pragma optimize(on) +#pragma optimize(off) +#pragma debug(on) +#pragma debug(off) + +#pragma undefined_pragma(x,4) + +#pragma once + +int main(){ +} + diff --git a/deps/glslang/Test/baseResults/preprocessor.simple.vert.err b/deps/glslang/Test/baseResults/preprocessor.simple.vert.err new file mode 100644 index 00000000..e69de29b diff --git a/deps/glslang/Test/baseResults/preprocessor.simple.vert.out b/deps/glslang/Test/baseResults/preprocessor.simple.vert.out new file mode 100644 index 00000000..57b020c6 --- /dev/null +++ b/deps/glslang/Test/baseResults/preprocessor.simple.vert.out @@ -0,0 +1,66 @@ +#version 310 es + + + + + + + + + + + + + float fn(float x){ return x + 4.0;} + +int main(){ + gl_Position = vec4(1); + gl_Position = clamp(1, 2, 3); + gl_Position = vec4(1); + gl_Position = vec4(1, 2); + gl_Position = vec4(fn(3)); + []. ++ -- + + - * % / - ! ~ + << >> < > <= >= + == != + & ^ | && ^^ || ? : + += -= *= /= %= <<= >>= &= |= ^= + 1.2 2E10 5u - 5l f +} + +struct S { + int member1; + float member2; + vec4 member3; +}; + + + + + + + + + + + + + +void foo() +{ + S s; + s . member2 + s . member1; + s . member3 . zyx; + s . member2 . xxyz; + s . member2 . yyz; + s . member2 . xxyz(); + s . member2 . yzy; + vec3 a = vec3(0);vec3 b = a . zxyz;vec3 b = a . xxyz;vec3 b = a . yyz;vec3 b = a . xxyz();vec3 b = a . yzy;vec3 b = a . z; + + + yyz; + yzy + + +} + diff --git a/deps/glslang/Test/baseResults/preprocessor.success_if_parse_would_fail.vert.err b/deps/glslang/Test/baseResults/preprocessor.success_if_parse_would_fail.vert.err new file mode 100644 index 00000000..e69de29b diff --git a/deps/glslang/Test/baseResults/preprocessor.success_if_parse_would_fail.vert.out b/deps/glslang/Test/baseResults/preprocessor.success_if_parse_would_fail.vert.out new file mode 100644 index 00000000..624813a0 --- /dev/null +++ b/deps/glslang/Test/baseResults/preprocessor.success_if_parse_would_fail.vert.out @@ -0,0 +1,4 @@ +int x(){ + something that shouldnt compile; +} + diff --git a/deps/glslang/Test/baseResults/recurse1.vert.out b/deps/glslang/Test/baseResults/recurse1.vert.out new file mode 100644 index 00000000..7d09b7c1 --- /dev/null +++ b/deps/glslang/Test/baseResults/recurse1.vert.out @@ -0,0 +1,229 @@ +recurse1.vert +Shader version: 330 +0:? Sequence +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:9 Function Definition: self( ( global void) +0:9 Function Parameters: +0:11 Sequence +0:11 Function Call: self( ( global void) +0:16 Function Definition: foo(f1; ( global void) +0:16 Function Parameters: +0:16 '' ( in float) +0:18 Sequence +0:18 Function Call: bar(i1; ( global float) +0:18 Constant: +0:18 2 (const int) +0:21 Function Definition: bar(i1; ( global float) +0:21 Function Parameters: +0:21 '' ( in int) +0:23 Sequence +0:23 Function Call: foo(f1; ( global void) +0:23 Constant: +0:23 4.200000 +0:25 Branch: Return with expression +0:25 Constant: +0:25 3.200000 +0:32 Function Definition: A( ( global void) +0:32 Function Parameters: +0:32 Sequence +0:32 Function Call: B( ( global void) +0:33 Function Definition: C( ( global void) +0:33 Function Parameters: +0:33 Sequence +0:33 Function Call: D( ( global void) +0:34 Function Definition: B( ( global void) +0:34 Function Parameters: +0:34 Sequence +0:34 Function Call: C( ( global void) +0:35 Function Definition: D( ( global void) +0:35 Function Parameters: +0:35 Sequence +0:35 Function Call: A( ( global void) +0:41 Function Definition: AT( ( global void) +0:41 Function Parameters: +0:41 Sequence +0:41 Function Call: BT( ( global void) +0:41 Function Call: BT( ( global void) +0:41 Function Call: BT( ( global void) +0:42 Function Definition: CT( ( global void) +0:42 Function Parameters: +0:42 Sequence +0:42 Function Call: DT( ( global void) +0:42 Function Call: AT( ( global void) +0:42 Function Call: DT( ( global void) +0:42 Function Call: BT( ( global void) +0:43 Function Definition: BT( ( global void) +0:43 Function Parameters: +0:43 Sequence +0:43 Function Call: CT( ( global void) +0:43 Function Call: CT( ( global void) +0:43 Function Call: CT( ( global void) +0:44 Function Definition: DT( ( global void) +0:44 Function Parameters: +0:44 Sequence +0:44 Function Call: AT( ( global void) +0:? Linker Objects +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + +recurse1.frag +Shader version: 330 +0:? Sequence +0:5 Function Definition: main( ( global void) +0:5 Function Parameters: +0:11 Function Definition: cfoo(f1; ( global void) +0:11 Function Parameters: +0:11 '' ( in float) +0:13 Sequence +0:13 Function Call: cbar(i1; ( global float) +0:13 Constant: +0:13 2 (const int) +0:20 Function Definition: CA( ( global void) +0:20 Function Parameters: +0:20 Sequence +0:20 Function Call: CB( ( global void) +0:21 Function Definition: CC( ( global void) +0:21 Function Parameters: +0:21 Sequence +0:21 Function Call: CD( ( global void) +0:27 Function Definition: CAT( ( global void) +0:27 Function Parameters: +0:27 Sequence +0:27 Function Call: CBT( ( global void) +0:27 Function Call: CBT( ( global void) +0:27 Function Call: CBT( ( global void) +0:28 Function Definition: CCT( ( global void) +0:28 Function Parameters: +0:28 Sequence +0:28 Function Call: CDT( ( global void) +0:28 Function Call: CDT( ( global void) +0:28 Function Call: CBT( ( global void) +0:32 Function Definition: norA( ( global void) +0:32 Function Parameters: +0:33 Function Definition: norB( ( global void) +0:33 Function Parameters: +0:33 Sequence +0:33 Function Call: norA( ( global void) +0:34 Function Definition: norC( ( global void) +0:34 Function Parameters: +0:34 Sequence +0:34 Function Call: norA( ( global void) +0:35 Function Definition: norD( ( global void) +0:35 Function Parameters: +0:35 Sequence +0:35 Function Call: norA( ( global void) +0:36 Function Definition: norE( ( global void) +0:36 Function Parameters: +0:36 Sequence +0:36 Function Call: norB( ( global void) +0:37 Function Definition: norF( ( global void) +0:37 Function Parameters: +0:37 Sequence +0:37 Function Call: norB( ( global void) +0:38 Function Definition: norG( ( global void) +0:38 Function Parameters: +0:38 Sequence +0:38 Function Call: norE( ( global void) +0:39 Function Definition: norH( ( global void) +0:39 Function Parameters: +0:39 Sequence +0:39 Function Call: norE( ( global void) +0:40 Function Definition: norI( ( global void) +0:40 Function Parameters: +0:40 Sequence +0:40 Function Call: norE( ( global void) +0:44 Function Definition: norcA( ( global void) +0:44 Function Parameters: +0:45 Function Definition: norcB( ( global void) +0:45 Function Parameters: +0:45 Sequence +0:45 Function Call: norcA( ( global void) +0:46 Function Definition: norcC( ( global void) +0:46 Function Parameters: +0:46 Sequence +0:46 Function Call: norcB( ( global void) +0:47 Function Definition: norcD( ( global void) +0:47 Function Parameters: +0:47 Sequence +0:47 Function Call: norcC( ( global void) +0:47 Function Call: norcB( ( global void) +0:48 Function Definition: norcE( ( global void) +0:48 Function Parameters: +0:48 Sequence +0:48 Function Call: norcD( ( global void) +0:? Linker Objects + +recurse2.frag +Shader version: 330 +0:? Sequence +0:9 Function Definition: cbar(i1; ( global float) +0:9 Function Parameters: +0:9 '' ( in int) +0:11 Sequence +0:11 Function Call: cfoo(f1; ( global void) +0:11 Constant: +0:11 4.200000 +0:13 Branch: Return with expression +0:13 Constant: +0:13 3.200000 +0:20 Function Definition: CB( ( global void) +0:20 Function Parameters: +0:20 Sequence +0:20 Function Call: CC( ( global void) +0:21 Function Definition: CD( ( global void) +0:21 Function Parameters: +0:21 Sequence +0:21 Function Call: CA( ( global void) +0:27 Function Definition: CBT( ( global void) +0:27 Function Parameters: +0:27 Sequence +0:27 Function Call: CCT( ( global void) +0:27 Function Call: CCT( ( global void) +0:27 Function Call: CCT( ( global void) +0:28 Function Definition: CDT( ( global void) +0:28 Function Parameters: +0:28 Sequence +0:28 Function Call: CAT( ( global void) +0:? Linker Objects + + +Linked vertex stage: + +ERROR: Linking vertex stage: Recursion detected: + BT( calling CT( +ERROR: Linking vertex stage: Recursion detected: + AT( calling BT( +ERROR: Linking vertex stage: Recursion detected: + DT( calling AT( +ERROR: Linking vertex stage: Recursion detected: + D( calling A( +ERROR: Linking vertex stage: Recursion detected: + bar(i1; calling foo(f1; +ERROR: Linking vertex stage: Recursion detected: + self( calling self( + +Linked fragment stage: + +ERROR: Linking fragment stage: Recursion detected: + CCT( calling CBT( +ERROR: Linking fragment stage: Recursion detected: + CBT( calling CCT( +ERROR: Linking fragment stage: Recursion detected: + CC( calling CD( +ERROR: Linking fragment stage: Recursion detected: + cfoo(f1; calling cbar(i1; + +Shader version: 330 +0:? Sequence +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:? Linker Objects +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) +Shader version: 330 +0:? Sequence +0:5 Function Definition: main( ( global void) +0:5 Function Parameters: +0:? Linker Objects + diff --git a/deps/glslang/Test/baseResults/reflection.vert.out b/deps/glslang/Test/baseResults/reflection.vert.out new file mode 100644 index 00000000..52e16e60 --- /dev/null +++ b/deps/glslang/Test/baseResults/reflection.vert.out @@ -0,0 +1,107 @@ +reflection.vert +Uniform reflection: +image_ui2D: offset -1, type 9063, size 1, index -1, binding -1, stages 1 +sampler_2D: offset -1, type 8b5e, size 1, index -1, binding -1, stages 1 +sampler_2DMSArray: offset -1, type 910b, size 1, index -1, binding -1, stages 1 +anonMember3: offset 80, type 8b52, size 1, index 0, binding -1, stages 1 +s.a: offset -1, type 1404, size 1, index -1, binding -1, stages 1 +named.scalar: offset 12, type 1404, size 1, index 1, binding -1, stages 1 +m23: offset 16, type 8b67, size 1, index 0, binding -1, stages 1 +scalarAfterm23: offset 48, type 1404, size 1, index 0, binding -1, stages 1 +c_m23: offset 16, type 8b67, size 1, index 2, binding -1, stages 1 +c_scalarAfterm23: offset 64, type 1404, size 1, index 2, binding -1, stages 1 +scalarBeforeArray: offset 96, type 1404, size 1, index 0, binding -1, stages 1 +floatArray: offset 112, type 1406, size 5, index 0, binding -1, stages 1 +scalarAfterArray: offset 192, type 1404, size 1, index 0, binding -1, stages 1 +named.memvec2: offset 48, type 8b50, size 1, index 1, binding -1, stages 1 +named.memf1: offset 56, type 1406, size 1, index 1, binding -1, stages 1 +named.memf2: offset 60, type 8b56, size 1, index 1, binding -1, stages 1 +named.memf3: offset 64, type 1404, size 1, index 1, binding -1, stages 1 +named.memvec2a: offset 72, type 8b50, size 1, index 1, binding -1, stages 1 +named.m22: offset 80, type 8b5a, size 7, index 1, binding -1, stages 1 +dm22: offset -1, type 8b5a, size 4, index -1, binding -1, stages 1 +m22: offset 208, type 8b5a, size 3, index 0, binding -1, stages 1 +nested.foo.n1.a: offset 0, type 1406, size 1, index 3, binding -1, stages 1 +nested.foo.n2.b: offset 16, type 1406, size 1, index 3, binding -1, stages 1 +nested.foo.n2.c: offset 20, type 1406, size 1, index 3, binding -1, stages 1 +nested.foo.n2.d: offset 24, type 1406, size 1, index 3, binding -1, stages 1 +deepA[0].d2.d1[2].va: offset -1, type 8b50, size 2, index -1, binding -1, stages 1 +deepA[1].d2.d1[2].va: offset -1, type 8b50, size 2, index -1, binding -1, stages 1 +deepB[1].d2.d1[0].va: offset -1, type 8b50, size 2, index -1, binding -1, stages 1 +deepB[1].d2.d1[1].va: offset -1, type 8b50, size 2, index -1, binding -1, stages 1 +deepB[1].d2.d1[2].va: offset -1, type 8b50, size 2, index -1, binding -1, stages 1 +deepB[1].d2.d1[3].va: offset -1, type 8b50, size 2, index -1, binding -1, stages 1 +deepB[0].d2.d1[0].va: offset -1, type 8b50, size 2, index -1, binding -1, stages 1 +deepB[0].d2.d1[1].va: offset -1, type 8b50, size 2, index -1, binding -1, stages 1 +deepB[0].d2.d1[2].va: offset -1, type 8b50, size 2, index -1, binding -1, stages 1 +deepB[0].d2.d1[3].va: offset -1, type 8b50, size 2, index -1, binding -1, stages 1 +deepC[1].iv4: offset -1, type 8b52, size 1, index -1, binding -1, stages 1 +deepC[1].d2.i: offset -1, type 1404, size 1, index -1, binding -1, stages 1 +deepC[1].d2.d1[0].va: offset -1, type 8b50, size 3, index -1, binding -1, stages 1 +deepC[1].d2.d1[0].b: offset -1, type 8b56, size 1, index -1, binding -1, stages 1 +deepC[1].d2.d1[1].va: offset -1, type 8b50, size 3, index -1, binding -1, stages 1 +deepC[1].d2.d1[1].b: offset -1, type 8b56, size 1, index -1, binding -1, stages 1 +deepC[1].d2.d1[2].va: offset -1, type 8b50, size 3, index -1, binding -1, stages 1 +deepC[1].d2.d1[2].b: offset -1, type 8b56, size 1, index -1, binding -1, stages 1 +deepC[1].d2.d1[3].va: offset -1, type 8b50, size 3, index -1, binding -1, stages 1 +deepC[1].d2.d1[3].b: offset -1, type 8b56, size 1, index -1, binding -1, stages 1 +deepC[1].v3: offset -1, type 8b54, size 1, index -1, binding -1, stages 1 +deepD[0].iv4: offset -1, type 8b52, size 1, index -1, binding -1, stages 1 +deepD[0].d2.i: offset -1, type 1404, size 1, index -1, binding -1, stages 1 +deepD[0].d2.d1[0].va: offset -1, type 8b50, size 3, index -1, binding -1, stages 1 +deepD[0].d2.d1[0].b: offset -1, type 8b56, size 1, index -1, binding -1, stages 1 +deepD[0].d2.d1[1].va: offset -1, type 8b50, size 3, index -1, binding -1, stages 1 +deepD[0].d2.d1[1].b: offset -1, type 8b56, size 1, index -1, binding -1, stages 1 +deepD[0].d2.d1[2].va: offset -1, type 8b50, size 3, index -1, binding -1, stages 1 +deepD[0].d2.d1[2].b: offset -1, type 8b56, size 1, index -1, binding -1, stages 1 +deepD[0].d2.d1[3].va: offset -1, type 8b50, size 3, index -1, binding -1, stages 1 +deepD[0].d2.d1[3].b: offset -1, type 8b56, size 1, index -1, binding -1, stages 1 +deepD[0].v3: offset -1, type 8b54, size 1, index -1, binding -1, stages 1 +deepD[1].iv4: offset -1, type 8b52, size 1, index -1, binding -1, stages 1 +deepD[1].d2.i: offset -1, type 1404, size 1, index -1, binding -1, stages 1 +deepD[1].d2.d1[0].va: offset -1, type 8b50, size 3, index -1, binding -1, stages 1 +deepD[1].d2.d1[0].b: offset -1, type 8b56, size 1, index -1, binding -1, stages 1 +deepD[1].d2.d1[1].va: offset -1, type 8b50, size 3, index -1, binding -1, stages 1 +deepD[1].d2.d1[1].b: offset -1, type 8b56, size 1, index -1, binding -1, stages 1 +deepD[1].d2.d1[2].va: offset -1, type 8b50, size 3, index -1, binding -1, stages 1 +deepD[1].d2.d1[2].b: offset -1, type 8b56, size 1, index -1, binding -1, stages 1 +deepD[1].d2.d1[3].va: offset -1, type 8b50, size 3, index -1, binding -1, stages 1 +deepD[1].d2.d1[3].b: offset -1, type 8b56, size 1, index -1, binding -1, stages 1 +deepD[1].v3: offset -1, type 8b54, size 1, index -1, binding -1, stages 1 +abl.foo: offset 0, type 1406, size 1, index 7, binding -1, stages 1 +abl2.foo: offset 0, type 1406, size 1, index 11, binding -1, stages 1 +buf1.runtimeArray: offset 4, type 1406, size 4, index 12, binding -1, stages 1 +buf2.runtimeArray.c: offset 8, type 1406, size 1, index 13, binding -1, stages 1 +buf3.runtimeArray: offset 4, type 1406, size 0, index 14, binding -1, stages 1 +buf4.runtimeArray.c: offset 8, type 1406, size 1, index 15, binding -1, stages 1 +anonMember1: offset 0, type 8b51, size 1, index 0, binding -1, stages 1 +uf1: offset -1, type 1406, size 1, index -1, binding -1, stages 1 +uf2: offset -1, type 1406, size 1, index -1, binding -1, stages 1 +named.member3: offset 32, type 8b52, size 1, index 1, binding -1, stages 1 + +Uniform block reflection: +nameless: offset -1, type ffffffff, size 496, index -1, binding -1, stages 0 +named: offset -1, type ffffffff, size 304, index -1, binding -1, stages 0 +c_nameless: offset -1, type ffffffff, size 112, index -1, binding -1, stages 0 +nested: offset -1, type ffffffff, size 32, index -1, binding -1, stages 0 +abl[0]: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0 +abl[1]: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0 +abl[2]: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0 +abl[3]: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0 +abl2[0]: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0 +abl2[1]: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0 +abl2[2]: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0 +abl2[3]: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0 +buf1: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0 +buf2: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0 +buf3: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0 +buf4: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0 + +Vertex attribute reflection: +attributeFloat: offset 0, type 1406, size 0, index 0, binding -1, stages 0 +attributeFloat2: offset 0, type 8b50, size 0, index 0, binding -1, stages 0 +attributeFloat3: offset 0, type 8b51, size 0, index 0, binding -1, stages 0 +attributeFloat4: offset 0, type 8b52, size 0, index 0, binding -1, stages 0 +attributeMat4: offset 0, type 8b5c, size 0, index 0, binding -1, stages 0 +gl_InstanceID: offset 0, type 1404, size 0, index 0, binding -1, stages 0 + diff --git a/deps/glslang/Test/baseResults/remap.basic.dcefunc.frag.out b/deps/glslang/Test/baseResults/remap.basic.dcefunc.frag.out new file mode 100644 index 00000000..33ec069d --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.basic.dcefunc.frag.out @@ -0,0 +1,33 @@ +remap.basic.dcefunc.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 22 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 17 19 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 17 "outf4" + Name 19 "inf" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8: TypeFunction 7(fvec3) + 11: 6(float) Constant 0 + 12: 7(fvec3) ConstantComposite 11 11 11 + 15: TypeVector 6(float) 4 + 16: TypePointer Output 15(fvec4) + 17(outf4): 16(ptr) Variable Output + 18: TypePointer Input 6(float) + 19(inf): 18(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 20: 6(float) Load 19(inf) + 21: 15(fvec4) CompositeConstruct 20 20 20 20 + Store 17(outf4) 21 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/remap.basic.dcevartype.frag.out b/deps/glslang/Test/baseResults/remap.basic.dcevartype.frag.out new file mode 100644 index 00000000..dd03946d --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.basic.dcevartype.frag.out @@ -0,0 +1,12 @@ +remap.basic.dcevartype.frag +ERROR: #version: ES shaders for Vulkan SPIR-V require version 310 or higher +Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. +ERROR: 1 compilation errors. No code generated. + + + +Linked fragment stage: + +ERROR: Linking fragment stage: Missing entry point: Each stage requires one "void main()" entry point + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/remap.basic.everything.frag.out b/deps/glslang/Test/baseResults/remap.basic.everything.frag.out new file mode 100644 index 00000000..858d629e --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.basic.everything.frag.out @@ -0,0 +1,25 @@ +remap.basic.everything.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 24969 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 5663 "main" 4539 3773 + ExecutionMode 5663 OriginUpperLeft + 8: TypeVoid + 1282: TypeFunction 8 + 13: TypeFloat 32 + 29: TypeVector 13(float) 4 + 666: TypePointer Output 29(fvec4) + 4539: 666(ptr) Variable Output + 650: TypePointer Input 13(float) + 3773: 650(ptr) Variable Input + 5663: 8 Function None 1282 + 24968: Label + 17486: 13(float) Load 3773 + 17691: 29(fvec4) CompositeConstruct 17486 17486 17486 17486 + Store 4539 17691 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/remap.basic.none.frag.out b/deps/glslang/Test/baseResults/remap.basic.none.frag.out new file mode 100644 index 00000000..1ad1d74c --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.basic.none.frag.out @@ -0,0 +1,38 @@ +remap.basic.none.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 22 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 17 19 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "dead_fn(" + Name 17 "outf4" + Name 19 "inf" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8: TypeFunction 7(fvec3) + 11: 6(float) Constant 0 + 12: 7(fvec3) ConstantComposite 11 11 11 + 15: TypeVector 6(float) 4 + 16: TypePointer Output 15(fvec4) + 17(outf4): 16(ptr) Variable Output + 18: TypePointer Input 6(float) + 19(inf): 18(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 20: 6(float) Load 19(inf) + 21: 15(fvec4) CompositeConstruct 20 20 20 20 + Store 17(outf4) 21 + Return + FunctionEnd + 9(dead_fn(): 7(fvec3) Function None 8 + 10: Label + ReturnValue 12 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/remap.basic.strip.frag.out b/deps/glslang/Test/baseResults/remap.basic.strip.frag.out new file mode 100644 index 00000000..3d876d0d --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.basic.strip.frag.out @@ -0,0 +1,33 @@ +remap.basic.strip.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 22 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 17 19 + ExecutionMode 4 OriginUpperLeft + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8: TypeFunction 7(fvec3) + 11: 6(float) Constant 0 + 12: 7(fvec3) ConstantComposite 11 11 11 + 15: TypeVector 6(float) 4 + 16: TypePointer Output 15(fvec4) + 17: 16(ptr) Variable Output + 18: TypePointer Input 6(float) + 19: 18(ptr) Variable Input + 4: 2 Function None 3 + 5: Label + 20: 6(float) Load 19 + 21: 15(fvec4) CompositeConstruct 20 20 20 20 + Store 17 21 + Return + FunctionEnd + 9: 7(fvec3) Function None 8 + 10: Label + ReturnValue 12 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/remap.hlsl.sample.basic.everything.frag.out b/deps/glslang/Test/baseResults/remap.hlsl.sample.basic.everything.frag.out new file mode 100644 index 00000000..211daba2 --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.hlsl.sample.basic.everything.frag.out @@ -0,0 +1,229 @@ +remap.hlsl.sample.basic.everything.frag +WARNING: 0:4: 'immediate sampler state' : unimplemented + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 24878 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 5663 "main" 4253 3709 + ExecutionMode 5663 OriginUpperLeft + ExecutionMode 5663 DepthReplacing + Decorate 4727 DescriptorSet 0 + Decorate 4727 Binding 0 + Decorate 3305 DescriptorSet 0 + Decorate 3305 Binding 0 + Decorate 4743 DescriptorSet 0 + Decorate 4807 DescriptorSet 0 + Decorate 5042 DescriptorSet 0 + Decorate 5058 DescriptorSet 0 + Decorate 5122 DescriptorSet 0 + Decorate 3967 DescriptorSet 0 + Decorate 3983 DescriptorSet 0 + Decorate 4047 DescriptorSet 0 + Decorate 3789 DescriptorSet 0 + Decorate 3805 DescriptorSet 0 + Decorate 3869 DescriptorSet 0 + Decorate 4253 Location 0 + Decorate 3709 BuiltIn FragDepth + 8: TypeVoid + 1282: TypeFunction 8 + 13: TypeFloat 32 + 29: TypeVector 13(float) 4 + 1032: TypeStruct 29(fvec4) 13(float) + 319: TypeFunction 1032(struct) + 12: TypeInt 32 1 + 1335: TypeStruct 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) + 1972: TypePointer Function 1335(struct) + 2574: 12(int) Constant 1 + 649: TypePointer Function 12(int) + 2577: 12(int) Constant 2 + 2580: 12(int) Constant 3 + 2583: 12(int) Constant 4 + 2586: 12(int) Constant 5 + 2589: 12(int) Constant 6 + 2571: 12(int) Constant 0 + 2592: 12(int) Constant 7 + 2595: 12(int) Constant 8 + 2598: 12(int) Constant 9 + 2601: 12(int) Constant 10 + 2604: 12(int) Constant 11 + 666: TypePointer Function 29(fvec4) + 149: TypeImage 13(float) 1D sampled format:Unknown + 786: TypePointer UniformConstant 149 + 4727: 786(ptr) Variable UniformConstant + 508: TypeSampler + 1145: TypePointer UniformConstant 508 + 3305: 1145(ptr) Variable UniformConstant + 510: TypeSampledImage 149 + 2935: 13(float) Constant 1036831949 + 26: TypeVector 12(int) 4 + 148: TypeImage 12(int) 1D sampled format:Unknown + 785: TypePointer UniformConstant 148 + 4743: 785(ptr) Variable UniformConstant + 511: TypeSampledImage 148 + 2821: 13(float) Constant 1045220557 + 11: TypeInt 32 0 + 23: TypeVector 11(int) 4 + 147: TypeImage 11(int) 1D sampled format:Unknown + 784: TypePointer UniformConstant 147 + 4807: 784(ptr) Variable UniformConstant + 512: TypeSampledImage 147 + 2151: 13(float) Constant 1050253722 + 150: TypeImage 13(float) 2D sampled format:Unknown + 787: TypePointer UniformConstant 150 + 5042: 787(ptr) Variable UniformConstant + 513: TypeSampledImage 150 + 19: TypeVector 13(float) 2 + 1825: 19(fvec2) ConstantComposite 2935 2821 + 151: TypeImage 12(int) 2D sampled format:Unknown + 788: TypePointer UniformConstant 151 + 5058: 788(ptr) Variable UniformConstant + 514: TypeSampledImage 151 + 2707: 13(float) Constant 1053609165 + 2028: 19(fvec2) ConstantComposite 2151 2707 + 152: TypeImage 11(int) 2D sampled format:Unknown + 789: TypePointer UniformConstant 152 + 5122: 789(ptr) Variable UniformConstant + 515: TypeSampledImage 152 + 252: 13(float) Constant 1056964608 + 2037: 13(float) Constant 1058642330 + 2684: 19(fvec2) ConstantComposite 252 2037 + 153: TypeImage 13(float) 3D sampled format:Unknown + 790: TypePointer UniformConstant 153 + 3967: 790(ptr) Variable UniformConstant + 516: TypeSampledImage 153 + 24: TypeVector 13(float) 3 + 1660: 24(fvec3) ConstantComposite 2935 2821 2151 + 154: TypeImage 12(int) 3D sampled format:Unknown + 791: TypePointer UniformConstant 154 + 3983: 791(ptr) Variable UniformConstant + 517: TypeSampledImage 154 + 2174: 24(fvec3) ConstantComposite 2707 252 2037 + 155: TypeImage 11(int) 3D sampled format:Unknown + 792: TypePointer UniformConstant 155 + 4047: 792(ptr) Variable UniformConstant + 518: TypeSampledImage 155 + 808: 13(float) Constant 1060320051 + 2593: 13(float) Constant 1061997773 + 1364: 13(float) Constant 1063675494 + 2476: 24(fvec3) ConstantComposite 808 2593 1364 + 156: TypeImage 13(float) Cube sampled format:Unknown + 793: TypePointer UniformConstant 156 + 3789: 793(ptr) Variable UniformConstant + 519: TypeSampledImage 156 + 157: TypeImage 12(int) Cube sampled format:Unknown + 794: TypePointer UniformConstant 157 + 3805: 794(ptr) Variable UniformConstant + 520: TypeSampledImage 157 + 158: TypeImage 11(int) Cube sampled format:Unknown + 795: TypePointer UniformConstant 158 + 3869: 795(ptr) Variable UniformConstant + 521: TypeSampledImage 158 + 1669: TypePointer Function 1032(struct) + 138: 13(float) Constant 1065353216 + 1284: 29(fvec4) ConstantComposite 138 138 138 138 + 650: TypePointer Function 13(float) + 667: TypePointer Output 29(fvec4) + 4253: 667(ptr) Variable Output + 651: TypePointer Output 13(float) + 3709: 651(ptr) Variable Output + 5663: 8 Function None 1282 + 24877: Label + 4104: 1669(ptr) Variable Function + 18803:1032(struct) FunctionCall 3317 + Store 4104 18803 + 13396: 666(ptr) AccessChain 4104 2571 + 7967: 29(fvec4) Load 13396 + Store 4253 7967 + 16622: 650(ptr) AccessChain 4104 2574 + 11539: 13(float) Load 16622 + Store 3709 11539 + Return + FunctionEnd + 3317:1032(struct) Function None 319 + 12442: Label + 5830: 1972(ptr) Variable Function + 5072: 1669(ptr) Variable Function + 22671: 649(ptr) AccessChain 5830 2574 + Store 22671 2574 + 20306: 649(ptr) AccessChain 5830 2577 + Store 20306 2574 + 20307: 649(ptr) AccessChain 5830 2580 + Store 20307 2574 + 20308: 649(ptr) AccessChain 5830 2583 + Store 20308 2574 + 20309: 649(ptr) AccessChain 5830 2586 + Store 20309 2574 + 20310: 649(ptr) AccessChain 5830 2589 + Store 20310 2574 + 20311: 649(ptr) AccessChain 5830 2571 + Store 20311 2574 + 20312: 649(ptr) AccessChain 5830 2592 + Store 20312 2574 + 20313: 649(ptr) AccessChain 5830 2595 + Store 20313 2574 + 20314: 649(ptr) AccessChain 5830 2598 + Store 20314 2574 + 20315: 649(ptr) AccessChain 5830 2601 + Store 20315 2574 + 20230: 649(ptr) AccessChain 5830 2604 + Store 20230 2574 + 15508: 149 Load 4727 + 12260: 508 Load 3305 + 12514: 510 SampledImage 15508 12260 + 21065: 29(fvec4) ImageSampleImplicitLod 12514 2935 + 9477: 148 Load 4743 + 16280: 508 Load 3305 + 12515: 511 SampledImage 9477 16280 + 21066: 26(ivec4) ImageSampleImplicitLod 12515 2821 + 9478: 147 Load 4807 + 16281: 508 Load 3305 + 12516: 512 SampledImage 9478 16281 + 21067: 23(ivec4) ImageSampleImplicitLod 12516 2151 + 9479: 150 Load 5042 + 16282: 508 Load 3305 + 12517: 513 SampledImage 9479 16282 + 21068: 29(fvec4) ImageSampleImplicitLod 12517 1825 + 9480: 151 Load 5058 + 16283: 508 Load 3305 + 12518: 514 SampledImage 9480 16283 + 21069: 26(ivec4) ImageSampleImplicitLod 12518 2028 + 9481: 152 Load 5122 + 16284: 508 Load 3305 + 12519: 515 SampledImage 9481 16284 + 21070: 23(ivec4) ImageSampleImplicitLod 12519 2684 + 9482: 153 Load 3967 + 16285: 508 Load 3305 + 12520: 516 SampledImage 9482 16285 + 21071: 29(fvec4) ImageSampleImplicitLod 12520 1660 + 9483: 154 Load 3983 + 16286: 508 Load 3305 + 12521: 517 SampledImage 9483 16286 + 21072: 26(ivec4) ImageSampleImplicitLod 12521 2174 + 9484: 155 Load 4047 + 16287: 508 Load 3305 + 12522: 518 SampledImage 9484 16287 + 21073: 23(ivec4) ImageSampleImplicitLod 12522 2476 + 9485: 156 Load 3789 + 16288: 508 Load 3305 + 12523: 519 SampledImage 9485 16288 + 21074: 29(fvec4) ImageSampleImplicitLod 12523 1660 + 9486: 157 Load 3805 + 16289: 508 Load 3305 + 12524: 520 SampledImage 9486 16289 + 21075: 26(ivec4) ImageSampleImplicitLod 12524 2174 + 9487: 158 Load 3869 + 16290: 508 Load 3305 + 12590: 521 SampledImage 9487 16290 + 20392: 23(ivec4) ImageSampleImplicitLod 12590 2476 + 14275: 666(ptr) AccessChain 5072 2571 + Store 14275 1284 + 20231: 650(ptr) AccessChain 5072 2574 + Store 20231 138 + 8692:1032(struct) Load 5072 + ReturnValue 8692 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/remap.hlsl.sample.basic.none.frag.out b/deps/glslang/Test/baseResults/remap.hlsl.sample.basic.none.frag.out new file mode 100644 index 00000000..24a1adec --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.hlsl.sample.basic.none.frag.out @@ -0,0 +1,314 @@ +remap.hlsl.sample.basic.none.frag +WARNING: 0:4: 'immediate sampler state' : unimplemented + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 198 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 188 192 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + MemberName 8(PS_OUTPUT) 1 "Depth" + Name 10 "@main(" + Name 13 "MemberTest" + MemberName 13(MemberTest) 0 "Sample" + MemberName 13(MemberTest) 1 "CalculateLevelOfDetail" + MemberName 13(MemberTest) 2 "CalculateLevelOfDetailUnclamped" + MemberName 13(MemberTest) 3 "Gather" + MemberName 13(MemberTest) 4 "GetDimensions" + MemberName 13(MemberTest) 5 "GetSamplePosition" + MemberName 13(MemberTest) 6 "Load" + MemberName 13(MemberTest) 7 "SampleBias" + MemberName 13(MemberTest) 8 "SampleCmp" + MemberName 13(MemberTest) 9 "SampleCmpLevelZero" + MemberName 13(MemberTest) 10 "SampleGrad" + MemberName 13(MemberTest) 11 "SampleLevel" + Name 15 "mtest" + Name 42 "txval10" + Name 45 "g_tTex1df4" + Name 49 "g_sSamp" + Name 57 "txval11" + Name 60 "g_tTex1di4" + Name 70 "txval12" + Name 73 "g_tTex1du4" + Name 80 "txval20" + Name 83 "g_tTex2df4" + Name 91 "txval21" + Name 94 "g_tTex2di4" + Name 102 "txval22" + Name 105 "g_tTex2du4" + Name 114 "txval30" + Name 117 "g_tTex3df4" + Name 125 "txval31" + Name 128 "g_tTex3di4" + Name 135 "txval32" + Name 138 "g_tTex3du4" + Name 148 "txval40" + Name 151 "g_tTexcdf4" + Name 157 "txval41" + Name 160 "g_tTexcdi4" + Name 166 "txval42" + Name 169 "g_tTexcdu4" + Name 176 "psout" + Name 185 "flattenTemp" + Name 188 "@entryPointOutput.Color" + Name 192 "@entryPointOutput.Depth" + Name 195 "g_sSamp2d" + Name 196 "g_sSamp2D_b" + Name 197 "g_tTex1df4a" + Decorate 45(g_tTex1df4) DescriptorSet 0 + Decorate 45(g_tTex1df4) Binding 0 + Decorate 49(g_sSamp) DescriptorSet 0 + Decorate 49(g_sSamp) Binding 0 + Decorate 60(g_tTex1di4) DescriptorSet 0 + Decorate 73(g_tTex1du4) DescriptorSet 0 + Decorate 83(g_tTex2df4) DescriptorSet 0 + Decorate 94(g_tTex2di4) DescriptorSet 0 + Decorate 105(g_tTex2du4) DescriptorSet 0 + Decorate 117(g_tTex3df4) DescriptorSet 0 + Decorate 128(g_tTex3di4) DescriptorSet 0 + Decorate 138(g_tTex3du4) DescriptorSet 0 + Decorate 151(g_tTexcdf4) DescriptorSet 0 + Decorate 160(g_tTexcdi4) DescriptorSet 0 + Decorate 169(g_tTexcdu4) DescriptorSet 0 + Decorate 188(@entryPointOutput.Color) Location 0 + Decorate 192(@entryPointOutput.Depth) BuiltIn FragDepth + Decorate 195(g_sSamp2d) DescriptorSet 0 + Decorate 196(g_sSamp2D_b) DescriptorSet 0 + Decorate 197(g_tTex1df4a) DescriptorSet 0 + Decorate 197(g_tTex1df4a) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypeInt 32 1 + 13(MemberTest): TypeStruct 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) + 14: TypePointer Function 13(MemberTest) + 16: 12(int) Constant 1 + 17: TypePointer Function 12(int) + 19: 12(int) Constant 2 + 21: 12(int) Constant 3 + 23: 12(int) Constant 4 + 25: 12(int) Constant 5 + 27: 12(int) Constant 6 + 29: 12(int) Constant 0 + 31: 12(int) Constant 7 + 33: 12(int) Constant 8 + 35: 12(int) Constant 9 + 37: 12(int) Constant 10 + 39: 12(int) Constant 11 + 41: TypePointer Function 7(fvec4) + 43: TypeImage 6(float) 1D sampled format:Unknown + 44: TypePointer UniformConstant 43 + 45(g_tTex1df4): 44(ptr) Variable UniformConstant + 47: TypeSampler + 48: TypePointer UniformConstant 47 + 49(g_sSamp): 48(ptr) Variable UniformConstant + 51: TypeSampledImage 43 + 53: 6(float) Constant 1036831949 + 55: TypeVector 12(int) 4 + 56: TypePointer Function 55(ivec4) + 58: TypeImage 12(int) 1D sampled format:Unknown + 59: TypePointer UniformConstant 58 + 60(g_tTex1di4): 59(ptr) Variable UniformConstant + 63: TypeSampledImage 58 + 65: 6(float) Constant 1045220557 + 67: TypeInt 32 0 + 68: TypeVector 67(int) 4 + 69: TypePointer Function 68(ivec4) + 71: TypeImage 67(int) 1D sampled format:Unknown + 72: TypePointer UniformConstant 71 + 73(g_tTex1du4): 72(ptr) Variable UniformConstant + 76: TypeSampledImage 71 + 78: 6(float) Constant 1050253722 + 81: TypeImage 6(float) 2D sampled format:Unknown + 82: TypePointer UniformConstant 81 + 83(g_tTex2df4): 82(ptr) Variable UniformConstant + 86: TypeSampledImage 81 + 88: TypeVector 6(float) 2 + 89: 88(fvec2) ConstantComposite 53 65 + 92: TypeImage 12(int) 2D sampled format:Unknown + 93: TypePointer UniformConstant 92 + 94(g_tTex2di4): 93(ptr) Variable UniformConstant + 97: TypeSampledImage 92 + 99: 6(float) Constant 1053609165 + 100: 88(fvec2) ConstantComposite 78 99 + 103: TypeImage 67(int) 2D sampled format:Unknown + 104: TypePointer UniformConstant 103 + 105(g_tTex2du4): 104(ptr) Variable UniformConstant + 108: TypeSampledImage 103 + 110: 6(float) Constant 1056964608 + 111: 6(float) Constant 1058642330 + 112: 88(fvec2) ConstantComposite 110 111 + 115: TypeImage 6(float) 3D sampled format:Unknown + 116: TypePointer UniformConstant 115 + 117(g_tTex3df4): 116(ptr) Variable UniformConstant + 120: TypeSampledImage 115 + 122: TypeVector 6(float) 3 + 123: 122(fvec3) ConstantComposite 53 65 78 + 126: TypeImage 12(int) 3D sampled format:Unknown + 127: TypePointer UniformConstant 126 + 128(g_tTex3di4): 127(ptr) Variable UniformConstant + 131: TypeSampledImage 126 + 133: 122(fvec3) ConstantComposite 99 110 111 + 136: TypeImage 67(int) 3D sampled format:Unknown + 137: TypePointer UniformConstant 136 + 138(g_tTex3du4): 137(ptr) Variable UniformConstant + 141: TypeSampledImage 136 + 143: 6(float) Constant 1060320051 + 144: 6(float) Constant 1061997773 + 145: 6(float) Constant 1063675494 + 146: 122(fvec3) ConstantComposite 143 144 145 + 149: TypeImage 6(float) Cube sampled format:Unknown + 150: TypePointer UniformConstant 149 + 151(g_tTexcdf4): 150(ptr) Variable UniformConstant + 154: TypeSampledImage 149 + 158: TypeImage 12(int) Cube sampled format:Unknown + 159: TypePointer UniformConstant 158 + 160(g_tTexcdi4): 159(ptr) Variable UniformConstant + 163: TypeSampledImage 158 + 167: TypeImage 67(int) Cube sampled format:Unknown + 168: TypePointer UniformConstant 167 + 169(g_tTexcdu4): 168(ptr) Variable UniformConstant + 172: TypeSampledImage 167 + 175: TypePointer Function 8(PS_OUTPUT) + 177: 6(float) Constant 1065353216 + 178: 7(fvec4) ConstantComposite 177 177 177 177 + 180: TypePointer Function 6(float) + 187: TypePointer Output 7(fvec4) +188(@entryPointOutput.Color): 187(ptr) Variable Output + 191: TypePointer Output 6(float) +192(@entryPointOutput.Depth): 191(ptr) Variable Output + 195(g_sSamp2d): 48(ptr) Variable UniformConstant +196(g_sSamp2D_b): 48(ptr) Variable UniformConstant +197(g_tTex1df4a): 44(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label +185(flattenTemp): 175(ptr) Variable Function + 186:8(PS_OUTPUT) FunctionCall 10(@main() + Store 185(flattenTemp) 186 + 189: 41(ptr) AccessChain 185(flattenTemp) 29 + 190: 7(fvec4) Load 189 + Store 188(@entryPointOutput.Color) 190 + 193: 180(ptr) AccessChain 185(flattenTemp) 16 + 194: 6(float) Load 193 + Store 192(@entryPointOutput.Depth) 194 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 15(mtest): 14(ptr) Variable Function + 42(txval10): 41(ptr) Variable Function + 57(txval11): 56(ptr) Variable Function + 70(txval12): 69(ptr) Variable Function + 80(txval20): 41(ptr) Variable Function + 91(txval21): 56(ptr) Variable Function + 102(txval22): 69(ptr) Variable Function + 114(txval30): 41(ptr) Variable Function + 125(txval31): 56(ptr) Variable Function + 135(txval32): 69(ptr) Variable Function + 148(txval40): 41(ptr) Variable Function + 157(txval41): 56(ptr) Variable Function + 166(txval42): 69(ptr) Variable Function + 176(psout): 175(ptr) Variable Function + 18: 17(ptr) AccessChain 15(mtest) 16 + Store 18 16 + 20: 17(ptr) AccessChain 15(mtest) 19 + Store 20 16 + 22: 17(ptr) AccessChain 15(mtest) 21 + Store 22 16 + 24: 17(ptr) AccessChain 15(mtest) 23 + Store 24 16 + 26: 17(ptr) AccessChain 15(mtest) 25 + Store 26 16 + 28: 17(ptr) AccessChain 15(mtest) 27 + Store 28 16 + 30: 17(ptr) AccessChain 15(mtest) 29 + Store 30 16 + 32: 17(ptr) AccessChain 15(mtest) 31 + Store 32 16 + 34: 17(ptr) AccessChain 15(mtest) 33 + Store 34 16 + 36: 17(ptr) AccessChain 15(mtest) 35 + Store 36 16 + 38: 17(ptr) AccessChain 15(mtest) 37 + Store 38 16 + 40: 17(ptr) AccessChain 15(mtest) 39 + Store 40 16 + 46: 43 Load 45(g_tTex1df4) + 50: 47 Load 49(g_sSamp) + 52: 51 SampledImage 46 50 + 54: 7(fvec4) ImageSampleImplicitLod 52 53 + Store 42(txval10) 54 + 61: 58 Load 60(g_tTex1di4) + 62: 47 Load 49(g_sSamp) + 64: 63 SampledImage 61 62 + 66: 55(ivec4) ImageSampleImplicitLod 64 65 + Store 57(txval11) 66 + 74: 71 Load 73(g_tTex1du4) + 75: 47 Load 49(g_sSamp) + 77: 76 SampledImage 74 75 + 79: 68(ivec4) ImageSampleImplicitLod 77 78 + Store 70(txval12) 79 + 84: 81 Load 83(g_tTex2df4) + 85: 47 Load 49(g_sSamp) + 87: 86 SampledImage 84 85 + 90: 7(fvec4) ImageSampleImplicitLod 87 89 + Store 80(txval20) 90 + 95: 92 Load 94(g_tTex2di4) + 96: 47 Load 49(g_sSamp) + 98: 97 SampledImage 95 96 + 101: 55(ivec4) ImageSampleImplicitLod 98 100 + Store 91(txval21) 101 + 106: 103 Load 105(g_tTex2du4) + 107: 47 Load 49(g_sSamp) + 109: 108 SampledImage 106 107 + 113: 68(ivec4) ImageSampleImplicitLod 109 112 + Store 102(txval22) 113 + 118: 115 Load 117(g_tTex3df4) + 119: 47 Load 49(g_sSamp) + 121: 120 SampledImage 118 119 + 124: 7(fvec4) ImageSampleImplicitLod 121 123 + Store 114(txval30) 124 + 129: 126 Load 128(g_tTex3di4) + 130: 47 Load 49(g_sSamp) + 132: 131 SampledImage 129 130 + 134: 55(ivec4) ImageSampleImplicitLod 132 133 + Store 125(txval31) 134 + 139: 136 Load 138(g_tTex3du4) + 140: 47 Load 49(g_sSamp) + 142: 141 SampledImage 139 140 + 147: 68(ivec4) ImageSampleImplicitLod 142 146 + Store 135(txval32) 147 + 152: 149 Load 151(g_tTexcdf4) + 153: 47 Load 49(g_sSamp) + 155: 154 SampledImage 152 153 + 156: 7(fvec4) ImageSampleImplicitLod 155 123 + Store 148(txval40) 156 + 161: 158 Load 160(g_tTexcdi4) + 162: 47 Load 49(g_sSamp) + 164: 163 SampledImage 161 162 + 165: 55(ivec4) ImageSampleImplicitLod 164 133 + Store 157(txval41) 165 + 170: 167 Load 169(g_tTexcdu4) + 171: 47 Load 49(g_sSamp) + 173: 172 SampledImage 170 171 + 174: 68(ivec4) ImageSampleImplicitLod 173 146 + Store 166(txval42) 174 + 179: 41(ptr) AccessChain 176(psout) 29 + Store 179 178 + 181: 180(ptr) AccessChain 176(psout) 16 + Store 181 177 + 182:8(PS_OUTPUT) Load 176(psout) + ReturnValue 182 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/remap.hlsl.sample.basic.strip.frag.out b/deps/glslang/Test/baseResults/remap.hlsl.sample.basic.strip.frag.out new file mode 100644 index 00000000..2108108d --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.hlsl.sample.basic.strip.frag.out @@ -0,0 +1,262 @@ +remap.hlsl.sample.basic.strip.frag +WARNING: 0:4: 'immediate sampler state' : unimplemented + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 198 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 188 192 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthReplacing + Decorate 45 DescriptorSet 0 + Decorate 45 Binding 0 + Decorate 49 DescriptorSet 0 + Decorate 49 Binding 0 + Decorate 60 DescriptorSet 0 + Decorate 73 DescriptorSet 0 + Decorate 83 DescriptorSet 0 + Decorate 94 DescriptorSet 0 + Decorate 105 DescriptorSet 0 + Decorate 117 DescriptorSet 0 + Decorate 128 DescriptorSet 0 + Decorate 138 DescriptorSet 0 + Decorate 151 DescriptorSet 0 + Decorate 160 DescriptorSet 0 + Decorate 169 DescriptorSet 0 + Decorate 188 Location 0 + Decorate 192 BuiltIn FragDepth + Decorate 195 DescriptorSet 0 + Decorate 196 DescriptorSet 0 + Decorate 197 DescriptorSet 0 + Decorate 197 Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeStruct 7(fvec4) 6(float) + 9: TypeFunction 8(struct) + 12: TypeInt 32 1 + 13: TypeStruct 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) 12(int) + 14: TypePointer Function 13(struct) + 16: 12(int) Constant 1 + 17: TypePointer Function 12(int) + 19: 12(int) Constant 2 + 21: 12(int) Constant 3 + 23: 12(int) Constant 4 + 25: 12(int) Constant 5 + 27: 12(int) Constant 6 + 29: 12(int) Constant 0 + 31: 12(int) Constant 7 + 33: 12(int) Constant 8 + 35: 12(int) Constant 9 + 37: 12(int) Constant 10 + 39: 12(int) Constant 11 + 41: TypePointer Function 7(fvec4) + 43: TypeImage 6(float) 1D sampled format:Unknown + 44: TypePointer UniformConstant 43 + 45: 44(ptr) Variable UniformConstant + 47: TypeSampler + 48: TypePointer UniformConstant 47 + 49: 48(ptr) Variable UniformConstant + 51: TypeSampledImage 43 + 53: 6(float) Constant 1036831949 + 55: TypeVector 12(int) 4 + 56: TypePointer Function 55(ivec4) + 58: TypeImage 12(int) 1D sampled format:Unknown + 59: TypePointer UniformConstant 58 + 60: 59(ptr) Variable UniformConstant + 63: TypeSampledImage 58 + 65: 6(float) Constant 1045220557 + 67: TypeInt 32 0 + 68: TypeVector 67(int) 4 + 69: TypePointer Function 68(ivec4) + 71: TypeImage 67(int) 1D sampled format:Unknown + 72: TypePointer UniformConstant 71 + 73: 72(ptr) Variable UniformConstant + 76: TypeSampledImage 71 + 78: 6(float) Constant 1050253722 + 81: TypeImage 6(float) 2D sampled format:Unknown + 82: TypePointer UniformConstant 81 + 83: 82(ptr) Variable UniformConstant + 86: TypeSampledImage 81 + 88: TypeVector 6(float) 2 + 89: 88(fvec2) ConstantComposite 53 65 + 92: TypeImage 12(int) 2D sampled format:Unknown + 93: TypePointer UniformConstant 92 + 94: 93(ptr) Variable UniformConstant + 97: TypeSampledImage 92 + 99: 6(float) Constant 1053609165 + 100: 88(fvec2) ConstantComposite 78 99 + 103: TypeImage 67(int) 2D sampled format:Unknown + 104: TypePointer UniformConstant 103 + 105: 104(ptr) Variable UniformConstant + 108: TypeSampledImage 103 + 110: 6(float) Constant 1056964608 + 111: 6(float) Constant 1058642330 + 112: 88(fvec2) ConstantComposite 110 111 + 115: TypeImage 6(float) 3D sampled format:Unknown + 116: TypePointer UniformConstant 115 + 117: 116(ptr) Variable UniformConstant + 120: TypeSampledImage 115 + 122: TypeVector 6(float) 3 + 123: 122(fvec3) ConstantComposite 53 65 78 + 126: TypeImage 12(int) 3D sampled format:Unknown + 127: TypePointer UniformConstant 126 + 128: 127(ptr) Variable UniformConstant + 131: TypeSampledImage 126 + 133: 122(fvec3) ConstantComposite 99 110 111 + 136: TypeImage 67(int) 3D sampled format:Unknown + 137: TypePointer UniformConstant 136 + 138: 137(ptr) Variable UniformConstant + 141: TypeSampledImage 136 + 143: 6(float) Constant 1060320051 + 144: 6(float) Constant 1061997773 + 145: 6(float) Constant 1063675494 + 146: 122(fvec3) ConstantComposite 143 144 145 + 149: TypeImage 6(float) Cube sampled format:Unknown + 150: TypePointer UniformConstant 149 + 151: 150(ptr) Variable UniformConstant + 154: TypeSampledImage 149 + 158: TypeImage 12(int) Cube sampled format:Unknown + 159: TypePointer UniformConstant 158 + 160: 159(ptr) Variable UniformConstant + 163: TypeSampledImage 158 + 167: TypeImage 67(int) Cube sampled format:Unknown + 168: TypePointer UniformConstant 167 + 169: 168(ptr) Variable UniformConstant + 172: TypeSampledImage 167 + 175: TypePointer Function 8(struct) + 177: 6(float) Constant 1065353216 + 178: 7(fvec4) ConstantComposite 177 177 177 177 + 180: TypePointer Function 6(float) + 187: TypePointer Output 7(fvec4) + 188: 187(ptr) Variable Output + 191: TypePointer Output 6(float) + 192: 191(ptr) Variable Output + 195: 48(ptr) Variable UniformConstant + 196: 48(ptr) Variable UniformConstant + 197: 44(ptr) Variable UniformConstant + 4: 2 Function None 3 + 5: Label + 185: 175(ptr) Variable Function + 186: 8(struct) FunctionCall 10 + Store 185 186 + 189: 41(ptr) AccessChain 185 29 + 190: 7(fvec4) Load 189 + Store 188 190 + 193: 180(ptr) AccessChain 185 16 + 194: 6(float) Load 193 + Store 192 194 + Return + FunctionEnd + 10: 8(struct) Function None 9 + 11: Label + 15: 14(ptr) Variable Function + 42: 41(ptr) Variable Function + 57: 56(ptr) Variable Function + 70: 69(ptr) Variable Function + 80: 41(ptr) Variable Function + 91: 56(ptr) Variable Function + 102: 69(ptr) Variable Function + 114: 41(ptr) Variable Function + 125: 56(ptr) Variable Function + 135: 69(ptr) Variable Function + 148: 41(ptr) Variable Function + 157: 56(ptr) Variable Function + 166: 69(ptr) Variable Function + 176: 175(ptr) Variable Function + 18: 17(ptr) AccessChain 15 16 + Store 18 16 + 20: 17(ptr) AccessChain 15 19 + Store 20 16 + 22: 17(ptr) AccessChain 15 21 + Store 22 16 + 24: 17(ptr) AccessChain 15 23 + Store 24 16 + 26: 17(ptr) AccessChain 15 25 + Store 26 16 + 28: 17(ptr) AccessChain 15 27 + Store 28 16 + 30: 17(ptr) AccessChain 15 29 + Store 30 16 + 32: 17(ptr) AccessChain 15 31 + Store 32 16 + 34: 17(ptr) AccessChain 15 33 + Store 34 16 + 36: 17(ptr) AccessChain 15 35 + Store 36 16 + 38: 17(ptr) AccessChain 15 37 + Store 38 16 + 40: 17(ptr) AccessChain 15 39 + Store 40 16 + 46: 43 Load 45 + 50: 47 Load 49 + 52: 51 SampledImage 46 50 + 54: 7(fvec4) ImageSampleImplicitLod 52 53 + Store 42 54 + 61: 58 Load 60 + 62: 47 Load 49 + 64: 63 SampledImage 61 62 + 66: 55(ivec4) ImageSampleImplicitLod 64 65 + Store 57 66 + 74: 71 Load 73 + 75: 47 Load 49 + 77: 76 SampledImage 74 75 + 79: 68(ivec4) ImageSampleImplicitLod 77 78 + Store 70 79 + 84: 81 Load 83 + 85: 47 Load 49 + 87: 86 SampledImage 84 85 + 90: 7(fvec4) ImageSampleImplicitLod 87 89 + Store 80 90 + 95: 92 Load 94 + 96: 47 Load 49 + 98: 97 SampledImage 95 96 + 101: 55(ivec4) ImageSampleImplicitLod 98 100 + Store 91 101 + 106: 103 Load 105 + 107: 47 Load 49 + 109: 108 SampledImage 106 107 + 113: 68(ivec4) ImageSampleImplicitLod 109 112 + Store 102 113 + 118: 115 Load 117 + 119: 47 Load 49 + 121: 120 SampledImage 118 119 + 124: 7(fvec4) ImageSampleImplicitLod 121 123 + Store 114 124 + 129: 126 Load 128 + 130: 47 Load 49 + 132: 131 SampledImage 129 130 + 134: 55(ivec4) ImageSampleImplicitLod 132 133 + Store 125 134 + 139: 136 Load 138 + 140: 47 Load 49 + 142: 141 SampledImage 139 140 + 147: 68(ivec4) ImageSampleImplicitLod 142 146 + Store 135 147 + 152: 149 Load 151 + 153: 47 Load 49 + 155: 154 SampledImage 152 153 + 156: 7(fvec4) ImageSampleImplicitLod 155 123 + Store 148 156 + 161: 158 Load 160 + 162: 47 Load 49 + 164: 163 SampledImage 161 162 + 165: 55(ivec4) ImageSampleImplicitLod 164 133 + Store 157 165 + 170: 167 Load 169 + 171: 47 Load 49 + 173: 172 SampledImage 170 171 + 174: 68(ivec4) ImageSampleImplicitLod 173 146 + Store 166 174 + 179: 41(ptr) AccessChain 176 29 + Store 179 178 + 181: 180(ptr) AccessChain 176 16 + Store 181 177 + 182: 8(struct) Load 176 + ReturnValue 182 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/remap.hlsl.templatetypes.everything.frag.out b/deps/glslang/Test/baseResults/remap.hlsl.templatetypes.everything.frag.out new file mode 100644 index 00000000..aff0998c --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.hlsl.templatetypes.everything.frag.out @@ -0,0 +1,38 @@ +remap.hlsl.templatetypes.everything.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 24954 + + Capability Shader + Capability Float64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 5663 "main" 4872 4045 + ExecutionMode 5663 OriginUpperLeft + Decorate 4872 Location 0 + Decorate 4045 Location 0 + 8: TypeVoid + 1282: TypeFunction 8 + 13: TypeFloat 32 + 29: TypeVector 13(float) 4 + 666: TypePointer Function 29(fvec4) + 255: TypeFunction 13(float) 666(ptr) + 2572: 13(float) Constant 0 + 667: TypePointer Input 29(fvec4) + 4872: 667(ptr) Variable Input + 650: TypePointer Output 13(float) + 4045: 650(ptr) Variable Output + 5663: 8 Function None 1282 + 24953: Label + 5786: 666(ptr) Variable Function + 24021: 29(fvec4) Load 4872 + Store 5786 24021 + 9338: 13(float) FunctionCall 3917 5786 + Store 4045 9338 + Return + FunctionEnd + 3917: 13(float) Function None 255 + 10636: 666(ptr) FunctionParameter + 10637: Label + ReturnValue 2572 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/remap.hlsl.templatetypes.none.frag.out b/deps/glslang/Test/baseResults/remap.hlsl.templatetypes.none.frag.out new file mode 100644 index 00000000..282fd2a2 --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.hlsl.templatetypes.none.frag.out @@ -0,0 +1,240 @@ +remap.hlsl.templatetypes.none.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 160 + + Capability Shader + Capability Float64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 153 156 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vf4;" + Name 10 "input" + Name 13 "r00" + Name 19 "r01" + Name 24 "r12" + Name 28 "r13" + Name 31 "r14" + Name 34 "r15" + Name 38 "r16" + Name 42 "r20" + Name 47 "r21" + Name 52 "r22" + Name 56 "r23" + Name 61 "r24" + Name 66 "r30" + Name 70 "r31" + Name 75 "r32" + Name 79 "r33" + Name 84 "r34" + Name 89 "r40" + Name 93 "r41" + Name 96 "r42" + Name 99 "r43" + Name 104 "r44" + Name 109 "r50" + Name 126 "r51" + Name 129 "r61" + Name 134 "r62" + Name 140 "r65" + Name 145 "r66" + Name 151 "input" + Name 153 "input" + Name 156 "@entryPointOutput" + Name 157 "param" + Decorate 153(input) Location 0 + Decorate 156(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 6(float) 8(ptr) + 14: 6(float) Constant 1065353216 + 15: 6(float) Constant 1073741824 + 16: 6(float) Constant 1077936128 + 17: 6(float) Constant 1082130432 + 18: 7(fvec4) ConstantComposite 14 15 16 17 + 20: 6(float) Constant 1084227584 + 21: 7(fvec4) ConstantComposite 15 16 17 20 + 22: TypeBool + 23: TypePointer Function 22(bool) + 25: 22(bool) ConstantFalse + 26: TypeInt 32 1 + 27: TypePointer Function 26(int) + 29: 26(int) Constant 1 + 30: TypePointer Function 6(float) + 32: TypeFloat 64 + 33: TypePointer Function 32(float64_t) + 35:32(float64_t) Constant 0 1072693248 + 36: TypeInt 32 0 + 37: TypePointer Function 36(int) + 39: 36(int) Constant 1 + 40: TypeVector 22(bool) 2 + 41: TypePointer Function 40(bvec2) + 43: 22(bool) ConstantTrue + 44: 40(bvec2) ConstantComposite 25 43 + 45: TypeVector 26(int) 2 + 46: TypePointer Function 45(ivec2) + 48: 26(int) Constant 2 + 49: 45(ivec2) ConstantComposite 29 48 + 50: TypeVector 6(float) 2 + 51: TypePointer Function 50(fvec2) + 53: 50(fvec2) ConstantComposite 14 15 + 54: TypeVector 32(float64_t) 2 + 55: TypePointer Function 54(f64vec2) + 57:32(float64_t) Constant 0 1073741824 + 58: 54(f64vec2) ConstantComposite 35 57 + 59: TypeVector 36(int) 2 + 60: TypePointer Function 59(ivec2) + 62: 36(int) Constant 2 + 63: 59(ivec2) ConstantComposite 39 62 + 64: TypeVector 22(bool) 3 + 65: TypePointer Function 64(bvec3) + 67: 64(bvec3) ConstantComposite 25 43 43 + 68: TypeVector 26(int) 3 + 69: TypePointer Function 68(ivec3) + 71: 26(int) Constant 3 + 72: 68(ivec3) ConstantComposite 29 48 71 + 73: TypeVector 6(float) 3 + 74: TypePointer Function 73(fvec3) + 76: 73(fvec3) ConstantComposite 14 15 16 + 77: TypeVector 32(float64_t) 3 + 78: TypePointer Function 77(f64vec3) + 80:32(float64_t) Constant 0 1074266112 + 81: 77(f64vec3) ConstantComposite 35 57 80 + 82: TypeVector 36(int) 3 + 83: TypePointer Function 82(ivec3) + 85: 36(int) Constant 3 + 86: 82(ivec3) ConstantComposite 39 62 85 + 87: TypeVector 22(bool) 4 + 88: TypePointer Function 87(bvec4) + 90: 87(bvec4) ConstantComposite 25 43 43 25 + 91: TypeVector 26(int) 4 + 92: TypePointer Function 91(ivec4) + 94: 26(int) Constant 4 + 95: 91(ivec4) ConstantComposite 29 48 71 94 + 97: TypeVector 32(float64_t) 4 + 98: TypePointer Function 97(f64vec4) + 100:32(float64_t) Constant 0 1074790400 + 101: 97(f64vec4) ConstantComposite 35 57 80 100 + 102: TypeVector 36(int) 4 + 103: TypePointer Function 102(ivec4) + 105: 36(int) Constant 4 + 106: 102(ivec4) ConstantComposite 39 62 85 105 + 107: TypeMatrix 7(fvec4) 4 + 108: TypePointer Function 107 + 110: 6(float) Constant 0 + 111: 7(fvec4) ConstantComposite 110 14 15 16 + 112: 6(float) Constant 1086324736 + 113: 6(float) Constant 1088421888 + 114: 7(fvec4) ConstantComposite 17 20 112 113 + 115: 6(float) Constant 1090519040 + 116: 6(float) Constant 1091567616 + 117: 6(float) Constant 1092616192 + 118: 6(float) Constant 1093664768 + 119: 7(fvec4) ConstantComposite 115 116 117 118 + 120: 6(float) Constant 1094713344 + 121: 6(float) Constant 1095761920 + 122: 6(float) Constant 1096810496 + 123: 6(float) Constant 1097859072 + 124: 7(fvec4) ConstantComposite 120 121 122 123 + 125: 107 ConstantComposite 111 114 119 124 + 127: TypeMatrix 73(fvec3) 2 + 128: TypePointer Function 127 + 130: 73(fvec3) ConstantComposite 17 20 112 + 131: 127 ConstantComposite 76 130 + 132: TypeMatrix 50(fvec2) 3 + 133: TypePointer Function 132 + 135: 50(fvec2) ConstantComposite 16 17 + 136: 50(fvec2) ConstantComposite 20 112 + 137: 132 ConstantComposite 53 135 136 + 138: TypeMatrix 50(fvec2) 4 + 139: TypePointer Function 138 + 141: 50(fvec2) ConstantComposite 113 115 + 142: 138 ConstantComposite 53 135 136 141 + 143: TypeMatrix 73(fvec3) 4 + 144: TypePointer Function 143 + 146: 73(fvec3) ConstantComposite 113 115 116 + 147: 73(fvec3) ConstantComposite 117 118 120 + 148: 143 ConstantComposite 76 130 146 147 + 152: TypePointer Input 7(fvec4) + 153(input): 152(ptr) Variable Input + 155: TypePointer Output 6(float) +156(@entryPointOutput): 155(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 151(input): 8(ptr) Variable Function + 157(param): 8(ptr) Variable Function + 154: 7(fvec4) Load 153(input) + Store 151(input) 154 + 158: 7(fvec4) Load 151(input) + Store 157(param) 158 + 159: 6(float) FunctionCall 11(@main(vf4;) 157(param) + Store 156(@entryPointOutput) 159 + Return + FunctionEnd + 11(@main(vf4;): 6(float) Function None 9 + 10(input): 8(ptr) FunctionParameter + 12: Label + 13(r00): 8(ptr) Variable Function + 19(r01): 8(ptr) Variable Function + 24(r12): 23(ptr) Variable Function + 28(r13): 27(ptr) Variable Function + 31(r14): 30(ptr) Variable Function + 34(r15): 33(ptr) Variable Function + 38(r16): 37(ptr) Variable Function + 42(r20): 41(ptr) Variable Function + 47(r21): 46(ptr) Variable Function + 52(r22): 51(ptr) Variable Function + 56(r23): 55(ptr) Variable Function + 61(r24): 60(ptr) Variable Function + 66(r30): 65(ptr) Variable Function + 70(r31): 69(ptr) Variable Function + 75(r32): 74(ptr) Variable Function + 79(r33): 78(ptr) Variable Function + 84(r34): 83(ptr) Variable Function + 89(r40): 88(ptr) Variable Function + 93(r41): 92(ptr) Variable Function + 96(r42): 8(ptr) Variable Function + 99(r43): 98(ptr) Variable Function + 104(r44): 103(ptr) Variable Function + 109(r50): 108(ptr) Variable Function + 126(r51): 108(ptr) Variable Function + 129(r61): 128(ptr) Variable Function + 134(r62): 133(ptr) Variable Function + 140(r65): 139(ptr) Variable Function + 145(r66): 144(ptr) Variable Function + Store 13(r00) 18 + Store 19(r01) 21 + Store 24(r12) 25 + Store 28(r13) 29 + Store 31(r14) 14 + Store 34(r15) 35 + Store 38(r16) 39 + Store 42(r20) 44 + Store 47(r21) 49 + Store 52(r22) 53 + Store 56(r23) 58 + Store 61(r24) 63 + Store 66(r30) 67 + Store 70(r31) 72 + Store 75(r32) 76 + Store 79(r33) 81 + Store 84(r34) 86 + Store 89(r40) 90 + Store 93(r41) 95 + Store 96(r42) 18 + Store 99(r43) 101 + Store 104(r44) 106 + Store 109(r50) 125 + Store 126(r51) 125 + Store 129(r61) 131 + Store 134(r62) 137 + Store 140(r65) 142 + Store 145(r66) 148 + ReturnValue 110 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/remap.if.everything.frag.out b/deps/glslang/Test/baseResults/remap.if.everything.frag.out new file mode 100644 index 00000000..cdb007b3 --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.if.everything.frag.out @@ -0,0 +1,41 @@ +remap.if.everything.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 22855 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 5663 "main" 3773 4539 + ExecutionMode 5663 OriginUpperLeft + 8: TypeVoid + 1282: TypeFunction 8 + 13: TypeFloat 32 + 650: TypePointer Input 13(float) + 3773: 650(ptr) Variable Input + 24: 13(float) Constant 1073741824 + 9: TypeBool + 29: TypeVector 13(float) 4 + 666: TypePointer Output 29(fvec4) + 4539: 666(ptr) Variable Output + 947: 13(float) Constant 3204448256 + 5663: 8 Function None 1282 + 7911: Label + 21734: 13(float) Load 3773 + 13508: 9(bool) FOrdGreaterThan 21734 24 + SelectionMerge 19578 None + BranchConditional 13508 13182 10142 + 13182: Label + 9496: 13(float) Load 3773 + 17615: 29(fvec4) CompositeConstruct 9496 9496 9496 9496 + Store 4539 17615 + Branch 19578 + 10142: Label + 22854: 13(float) Load 3773 + 9982: 13(float) FAdd 22854 947 + 12421: 29(fvec4) CompositeConstruct 9982 9982 9982 9982 + Store 4539 12421 + Branch 19578 + 19578: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/remap.if.none.frag.out b/deps/glslang/Test/baseResults/remap.if.none.frag.out new file mode 100644 index 00000000..0c8d2783 --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.if.none.frag.out @@ -0,0 +1,45 @@ +remap.if.none.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 25 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 8 17 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 8 "inf" + Name 17 "outf4" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Input 6(float) + 8(inf): 7(ptr) Variable Input + 10: 6(float) Constant 1073741824 + 11: TypeBool + 15: TypeVector 6(float) 4 + 16: TypePointer Output 15(fvec4) + 17(outf4): 16(ptr) Variable Output + 22: 6(float) Constant 3204448256 + 4(main): 2 Function None 3 + 5: Label + 9: 6(float) Load 8(inf) + 12: 11(bool) FOrdGreaterThan 9 10 + SelectionMerge 14 None + BranchConditional 12 13 20 + 13: Label + 18: 6(float) Load 8(inf) + 19: 15(fvec4) CompositeConstruct 18 18 18 18 + Store 17(outf4) 19 + Branch 14 + 20: Label + 21: 6(float) Load 8(inf) + 23: 6(float) FAdd 21 22 + 24: 15(fvec4) CompositeConstruct 23 23 23 23 + Store 17(outf4) 24 + Branch 14 + 14: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/remap.invalid-spirv-1.out b/deps/glslang/Test/baseResults/remap.invalid-spirv-1.out new file mode 100644 index 00000000..91b4b6d9 --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.invalid-spirv-1.out @@ -0,0 +1 @@ +ID out of range: 4160749568 diff --git a/deps/glslang/Test/baseResults/remap.invalid-spirv-2.out b/deps/glslang/Test/baseResults/remap.invalid-spirv-2.out new file mode 100644 index 00000000..808b9b87 --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.invalid-spirv-2.out @@ -0,0 +1 @@ +ID not found diff --git a/deps/glslang/Test/baseResults/remap.literal64.everything.spv.out b/deps/glslang/Test/baseResults/remap.literal64.everything.spv.out new file mode 100644 index 00000000..7a4f37ba --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.literal64.everything.spv.out @@ -0,0 +1,7 @@ +remap.literal64.everything.spv +// Module Version 10100 +// Generated by (magic number): 70000 +// Id's are bound by 0 + + Capability Shader + MemoryModel Logical GLSL450 diff --git a/deps/glslang/Test/baseResults/remap.literal64.none.spv.out b/deps/glslang/Test/baseResults/remap.literal64.none.spv.out new file mode 100644 index 00000000..d88992fc --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.literal64.none.spv.out @@ -0,0 +1,25 @@ +remap.literal64.none.spv +// Module Version 10100 +// Generated by (magic number): 70000 +// Id's are bound by 10 + + Capability Shader + MemoryModel Logical GLSL450 + 1: TypeVoid + 2: TypeInt 64 1 + 3: TypeFunction 1 + 4: 2(int64_t) Constant 0 0 + 5: 1 Function None 3 + 6: Label + SelectionMerge 7 None + Switch 4 7 + case 0: 0 + case 8: 1 + case 0: 9 + 8: Label + Branch 7 + 9: Label + Branch 7 + 7: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/remap.similar_1a.everything.frag.out b/deps/glslang/Test/baseResults/remap.similar_1a.everything.frag.out new file mode 100644 index 00000000..2f8f1c73 --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.similar_1a.everything.frag.out @@ -0,0 +1,115 @@ +remap.similar_1a.everything.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 24916 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 5663 "main" 4201 4539 3773 + ExecutionMode 5663 OriginUpperLeft + Decorate 4201 Flat + 8: TypeVoid + 1282: TypeFunction 8 + 12: TypeInt 32 1 + 649: TypePointer Function 12(int) + 13: TypeFloat 32 + 204: TypeFunction 13(float) 649(ptr) + 650: TypePointer Function 13(float) + 2572: 13(float) Constant 0 + 2571: 12(int) Constant 0 + 9: TypeBool + 252: 13(float) Constant 1056964608 + 2574: 12(int) Constant 1 + 2577: 12(int) Constant 2 + 26: TypeVector 12(int) 4 + 663: TypePointer Input 26(ivec4) + 4201: 663(ptr) Variable Input + 11: TypeInt 32 0 + 2573: 11(int) Constant 1 + 651: TypePointer Input 12(int) + 2576: 11(int) Constant 2 + 2570: 11(int) Constant 0 + 29: TypeVector 13(float) 4 + 666: TypePointer Output 29(fvec4) + 4539: 666(ptr) Variable Output + 652: TypePointer Input 13(float) + 3773: 652(ptr) Variable Input + 5663: 8 Function None 1282 + 24915: Label + 18415: 649(ptr) Variable Function + 5786: 649(ptr) Variable Function + 8366: 13(float) Load 3773 + 8654: 12(int) ConvertFToS 8366 + Store 18415 8654 + 17256: 13(float) FunctionCall 3782 18415 + 14512: 13(float) Load 3773 + 7041: 12(int) ConvertFToS 14512 + Store 5786 7041 + 23993: 13(float) FunctionCall 3836 5786 + 9180: 13(float) FAdd 17256 23993 + 15728: 29(fvec4) CompositeConstruct 9180 9180 9180 9180 + Store 4539 15728 + Return + FunctionEnd + 3782: 13(float) Function None 204 + 6931: 649(ptr) FunctionParameter + 12220: Label + 4292: 650(ptr) Variable Function + 4298: 649(ptr) Variable Function + Store 4292 2572 + Store 4298 2571 + Branch 14924 + 14924: Label + LoopMerge 8882 6488 None + Branch 11857 + 11857: Label + 13755: 12(int) Load 4298 + 22731: 12(int) Load 6931 + 20007: 9(bool) SLessThan 13755 22731 + BranchConditional 20007 24750 8882 + 24750: Label + 22912: 13(float) Load 4292 + 19471: 13(float) FAdd 22912 252 + Store 4292 19471 + Branch 6488 + 6488: Label + 19050: 12(int) Load 4298 + 8593: 12(int) IAdd 19050 2574 + Store 4298 8593 + Branch 14924 + 8882: Label + 11601: 13(float) Load 4292 + ReturnValue 11601 + FunctionEnd + 3836: 13(float) Function None 204 + 4408: 649(ptr) FunctionParameter + 12143: Label + 22102: 649(ptr) Variable Function + 24151: 12(int) Load 4408 + 13868: 9(bool) SGreaterThan 24151 2577 + SelectionMerge 22309 None + BranchConditional 13868 9492 17416 + 9492: Label + 15624: 12(int) Load 4408 + Store 22102 15624 + 17278: 13(float) FunctionCall 3782 22102 + ReturnValue 17278 + 17416: Label + 19506: 12(int) Load 4408 + 22773: 12(int) IMul 19506 2577 + 13472: 651(ptr) AccessChain 4201 2573 + 15280: 12(int) Load 13472 + 18079: 651(ptr) AccessChain 4201 2576 + 15199: 12(int) Load 18079 + 9343: 12(int) IMul 15280 15199 + 11462: 12(int) IAdd 22773 9343 + 11885: 651(ptr) AccessChain 4201 2570 + 21176: 12(int) Load 11885 + 10505: 12(int) IAdd 11462 21176 + 14626: 13(float) ConvertSToF 10505 + ReturnValue 14626 + 22309: Label + 6429: 13(float) Undef + ReturnValue 6429 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/remap.similar_1a.none.frag.out b/deps/glslang/Test/baseResults/remap.similar_1a.none.frag.out new file mode 100644 index 00000000..80d35c3f --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.similar_1a.none.frag.out @@ -0,0 +1,129 @@ +remap.similar_1a.none.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 86 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 53 73 75 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 11 "Test1(i1;" + Name 10 "bound" + Name 14 "Test2(i1;" + Name 13 "bound" + Name 17 "r" + Name 19 "x" + Name 44 "param" + Name 53 "ini4" + Name 73 "outf4" + Name 75 "inf" + Name 78 "param" + Name 82 "param" + Decorate 53(ini4) Flat + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeFunction 8(float) 7(ptr) + 16: TypePointer Function 8(float) + 18: 8(float) Constant 0 + 20: 6(int) Constant 0 + 28: TypeBool + 30: 8(float) Constant 1056964608 + 34: 6(int) Constant 1 + 40: 6(int) Constant 2 + 51: TypeVector 6(int) 4 + 52: TypePointer Input 51(ivec4) + 53(ini4): 52(ptr) Variable Input + 54: TypeInt 32 0 + 55: 54(int) Constant 1 + 56: TypePointer Input 6(int) + 59: 54(int) Constant 2 + 64: 54(int) Constant 0 + 71: TypeVector 8(float) 4 + 72: TypePointer Output 71(fvec4) + 73(outf4): 72(ptr) Variable Output + 74: TypePointer Input 8(float) + 75(inf): 74(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 78(param): 7(ptr) Variable Function + 82(param): 7(ptr) Variable Function + 76: 8(float) Load 75(inf) + 77: 6(int) ConvertFToS 76 + Store 78(param) 77 + 79: 8(float) FunctionCall 11(Test1(i1;) 78(param) + 80: 8(float) Load 75(inf) + 81: 6(int) ConvertFToS 80 + Store 82(param) 81 + 83: 8(float) FunctionCall 14(Test2(i1;) 82(param) + 84: 8(float) FAdd 79 83 + 85: 71(fvec4) CompositeConstruct 84 84 84 84 + Store 73(outf4) 85 + Return + FunctionEnd + 11(Test1(i1;): 8(float) Function None 9 + 10(bound): 7(ptr) FunctionParameter + 12: Label + 17(r): 16(ptr) Variable Function + 19(x): 7(ptr) Variable Function + Store 17(r) 18 + Store 19(x) 20 + Branch 21 + 21: Label + LoopMerge 23 24 None + Branch 25 + 25: Label + 26: 6(int) Load 19(x) + 27: 6(int) Load 10(bound) + 29: 28(bool) SLessThan 26 27 + BranchConditional 29 22 23 + 22: Label + 31: 8(float) Load 17(r) + 32: 8(float) FAdd 31 30 + Store 17(r) 32 + Branch 24 + 24: Label + 33: 6(int) Load 19(x) + 35: 6(int) IAdd 33 34 + Store 19(x) 35 + Branch 21 + 23: Label + 36: 8(float) Load 17(r) + ReturnValue 36 + FunctionEnd + 14(Test2(i1;): 8(float) Function None 9 + 13(bound): 7(ptr) FunctionParameter + 15: Label + 44(param): 7(ptr) Variable Function + 39: 6(int) Load 13(bound) + 41: 28(bool) SGreaterThan 39 40 + SelectionMerge 43 None + BranchConditional 41 42 48 + 42: Label + 45: 6(int) Load 13(bound) + Store 44(param) 45 + 46: 8(float) FunctionCall 11(Test1(i1;) 44(param) + ReturnValue 46 + 48: Label + 49: 6(int) Load 13(bound) + 50: 6(int) IMul 49 40 + 57: 56(ptr) AccessChain 53(ini4) 55 + 58: 6(int) Load 57 + 60: 56(ptr) AccessChain 53(ini4) 59 + 61: 6(int) Load 60 + 62: 6(int) IMul 58 61 + 63: 6(int) IAdd 50 62 + 65: 56(ptr) AccessChain 53(ini4) 64 + 66: 6(int) Load 65 + 67: 6(int) IAdd 63 66 + 68: 8(float) ConvertSToF 67 + ReturnValue 68 + 43: Label + 70: 8(float) Undef + ReturnValue 70 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/remap.similar_1b.everything.frag.out b/deps/glslang/Test/baseResults/remap.similar_1b.everything.frag.out new file mode 100644 index 00000000..c76c4bfa --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.similar_1b.everything.frag.out @@ -0,0 +1,121 @@ +remap.similar_1b.everything.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 24916 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 5663 "main" 4201 4539 3773 + ExecutionMode 5663 OriginUpperLeft + Decorate 4201 Flat + 8: TypeVoid + 1282: TypeFunction 8 + 12: TypeInt 32 1 + 649: TypePointer Function 12(int) + 13: TypeFloat 32 + 204: TypeFunction 13(float) 649(ptr) + 650: TypePointer Function 13(float) + 2572: 13(float) Constant 0 + 2571: 12(int) Constant 0 + 9: TypeBool + 252: 13(float) Constant 1056964608 + 2574: 12(int) Constant 1 + 2821: 13(float) Constant 1045220557 + 2577: 12(int) Constant 2 + 2583: 12(int) Constant 4 + 26: TypeVector 12(int) 4 + 663: TypePointer Input 26(ivec4) + 4201: 663(ptr) Variable Input + 11: TypeInt 32 0 + 2573: 11(int) Constant 1 + 651: TypePointer Input 12(int) + 2576: 11(int) Constant 2 + 2570: 11(int) Constant 0 + 29: TypeVector 13(float) 4 + 666: TypePointer Output 29(fvec4) + 4539: 666(ptr) Variable Output + 652: TypePointer Input 13(float) + 3773: 652(ptr) Variable Input + 5663: 8 Function None 1282 + 24915: Label + 18415: 649(ptr) Variable Function + 5786: 649(ptr) Variable Function + 8366: 13(float) Load 3773 + 8654: 12(int) ConvertFToS 8366 + Store 18415 8654 + 17256: 13(float) FunctionCall 3782 18415 + 14512: 13(float) Load 3773 + 7041: 12(int) ConvertFToS 14512 + Store 5786 7041 + 23993: 13(float) FunctionCall 3836 5786 + 9180: 13(float) FAdd 17256 23993 + 15728: 29(fvec4) CompositeConstruct 9180 9180 9180 9180 + Store 4539 15728 + Return + FunctionEnd + 3782: 13(float) Function None 204 + 6931: 649(ptr) FunctionParameter + 12220: Label + 4292: 650(ptr) Variable Function + 4298: 649(ptr) Variable Function + Store 4292 2572 + Store 4298 2571 + Branch 14924 + 14924: Label + LoopMerge 6507 6488 None + Branch 11857 + 11857: Label + 13755: 12(int) Load 4298 + 22731: 12(int) Load 6931 + 20007: 9(bool) SLessThan 13755 22731 + BranchConditional 20007 24750 6507 + 24750: Label + 22912: 13(float) Load 4292 + 19471: 13(float) FAdd 22912 252 + Store 4292 19471 + Branch 6488 + 6488: Label + 19050: 12(int) Load 4298 + 8593: 12(int) IAdd 19050 2574 + Store 4298 8593 + Branch 14924 + 6507: Label + 18877: 13(float) Load 4292 + 15899: 13(float) FAdd 18877 2821 + Store 4292 15899 + 20342: 13(float) Load 4292 + ReturnValue 20342 + FunctionEnd + 3836: 13(float) Function None 204 + 4408: 649(ptr) FunctionParameter + 12143: Label + 22102: 649(ptr) Variable Function + 24151: 12(int) Load 4408 + 13868: 9(bool) SGreaterThan 24151 2577 + SelectionMerge 22309 None + BranchConditional 13868 10822 17416 + 10822: Label + 22680: 12(int) Load 4408 + 23216: 12(int) IMul 22680 2577 + Store 22102 23216 + 7042: 13(float) FunctionCall 3782 22102 + ReturnValue 7042 + 17416: Label + 19506: 12(int) Load 4408 + 22773: 12(int) IMul 19506 2583 + 13472: 651(ptr) AccessChain 4201 2573 + 15280: 12(int) Load 13472 + 18079: 651(ptr) AccessChain 4201 2576 + 15199: 12(int) Load 18079 + 9343: 12(int) IMul 15280 15199 + 11462: 12(int) IAdd 22773 9343 + 11885: 651(ptr) AccessChain 4201 2570 + 21176: 12(int) Load 11885 + 10505: 12(int) IAdd 11462 21176 + 14626: 13(float) ConvertSToF 10505 + ReturnValue 14626 + 22309: Label + 6429: 13(float) Undef + ReturnValue 6429 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/remap.similar_1b.none.frag.out b/deps/glslang/Test/baseResults/remap.similar_1b.none.frag.out new file mode 100644 index 00000000..0a854d6e --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.similar_1b.none.frag.out @@ -0,0 +1,135 @@ +remap.similar_1b.none.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 91 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 58 78 80 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 11 "Test1(i1;" + Name 10 "bound" + Name 14 "Test2(i1;" + Name 13 "bound" + Name 17 "r" + Name 19 "x" + Name 49 "param" + Name 58 "ini4" + Name 78 "outf4" + Name 80 "inf" + Name 83 "param" + Name 87 "param" + Decorate 58(ini4) Flat + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeFunction 8(float) 7(ptr) + 16: TypePointer Function 8(float) + 18: 8(float) Constant 0 + 20: 6(int) Constant 0 + 28: TypeBool + 30: 8(float) Constant 1056964608 + 34: 6(int) Constant 1 + 36: 8(float) Constant 1045220557 + 43: 6(int) Constant 2 + 54: 6(int) Constant 4 + 56: TypeVector 6(int) 4 + 57: TypePointer Input 56(ivec4) + 58(ini4): 57(ptr) Variable Input + 59: TypeInt 32 0 + 60: 59(int) Constant 1 + 61: TypePointer Input 6(int) + 64: 59(int) Constant 2 + 69: 59(int) Constant 0 + 76: TypeVector 8(float) 4 + 77: TypePointer Output 76(fvec4) + 78(outf4): 77(ptr) Variable Output + 79: TypePointer Input 8(float) + 80(inf): 79(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 83(param): 7(ptr) Variable Function + 87(param): 7(ptr) Variable Function + 81: 8(float) Load 80(inf) + 82: 6(int) ConvertFToS 81 + Store 83(param) 82 + 84: 8(float) FunctionCall 11(Test1(i1;) 83(param) + 85: 8(float) Load 80(inf) + 86: 6(int) ConvertFToS 85 + Store 87(param) 86 + 88: 8(float) FunctionCall 14(Test2(i1;) 87(param) + 89: 8(float) FAdd 84 88 + 90: 76(fvec4) CompositeConstruct 89 89 89 89 + Store 78(outf4) 90 + Return + FunctionEnd + 11(Test1(i1;): 8(float) Function None 9 + 10(bound): 7(ptr) FunctionParameter + 12: Label + 17(r): 16(ptr) Variable Function + 19(x): 7(ptr) Variable Function + Store 17(r) 18 + Store 19(x) 20 + Branch 21 + 21: Label + LoopMerge 23 24 None + Branch 25 + 25: Label + 26: 6(int) Load 19(x) + 27: 6(int) Load 10(bound) + 29: 28(bool) SLessThan 26 27 + BranchConditional 29 22 23 + 22: Label + 31: 8(float) Load 17(r) + 32: 8(float) FAdd 31 30 + Store 17(r) 32 + Branch 24 + 24: Label + 33: 6(int) Load 19(x) + 35: 6(int) IAdd 33 34 + Store 19(x) 35 + Branch 21 + 23: Label + 37: 8(float) Load 17(r) + 38: 8(float) FAdd 37 36 + Store 17(r) 38 + 39: 8(float) Load 17(r) + ReturnValue 39 + FunctionEnd + 14(Test2(i1;): 8(float) Function None 9 + 13(bound): 7(ptr) FunctionParameter + 15: Label + 49(param): 7(ptr) Variable Function + 42: 6(int) Load 13(bound) + 44: 28(bool) SGreaterThan 42 43 + SelectionMerge 46 None + BranchConditional 44 45 52 + 45: Label + 47: 6(int) Load 13(bound) + 48: 6(int) IMul 47 43 + Store 49(param) 48 + 50: 8(float) FunctionCall 11(Test1(i1;) 49(param) + ReturnValue 50 + 52: Label + 53: 6(int) Load 13(bound) + 55: 6(int) IMul 53 54 + 62: 61(ptr) AccessChain 58(ini4) 60 + 63: 6(int) Load 62 + 65: 61(ptr) AccessChain 58(ini4) 64 + 66: 6(int) Load 65 + 67: 6(int) IMul 63 66 + 68: 6(int) IAdd 55 67 + 70: 61(ptr) AccessChain 58(ini4) 69 + 71: 6(int) Load 70 + 72: 6(int) IAdd 68 71 + 73: 8(float) ConvertSToF 72 + ReturnValue 73 + 46: Label + 75: 8(float) Undef + ReturnValue 75 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/remap.specconst.comp.out b/deps/glslang/Test/baseResults/remap.specconst.comp.out new file mode 100644 index 00000000..ee049f43 --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.specconst.comp.out @@ -0,0 +1,31 @@ +remap.specconst.comp +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 16104 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 5663 "main" + ExecutionMode 5663 LocalSize 1 1 1 + Decorate 2 SpecId 0 + Decorate 3 SpecId 1 + Decorate 4 SpecId 2 + Decorate 5 BuiltIn WorkgroupSize + 8: TypeVoid + 1282: TypeFunction 8 + 11: TypeInt 32 0 + 2: 11(int) SpecConstant 1 + 3: 11(int) SpecConstant 1 + 4: 11(int) SpecConstant 1 + 20: TypeVector 11(int) 3 + 5: 20(ivec3) SpecConstantComposite 2 3 4 + 6: 11(int) SpecConstantOp 81 5 0 + 7: 11(int) SpecConstantOp 81 5 1(GLSL.std.450) + 9: 11(int) SpecConstantOp 81 5 2 + 10: 11(int) SpecConstantOp 132 7 9 + 12: 11(int) SpecConstantOp 128 6 10 + 5663: 8 Function None 1282 + 16103: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/remap.switch.everything.frag.out b/deps/glslang/Test/baseResults/remap.switch.everything.frag.out new file mode 100644 index 00000000..ffd64d4f --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.switch.everything.frag.out @@ -0,0 +1,76 @@ +remap.switch.everything.frag +WARNING: 0:5: '' : all default precisions are highp; use precision statements to quiet warning, e.g.: + "precision mediump int; precision highp float;" + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 23990 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 5663 "main" 3719 3994 + ExecutionMode 5663 OriginUpperLeft + Decorate 3719 Location 0 + Decorate 3994 RelaxedPrecision + Decorate 3994 Location 0 + Decorate 12421 RelaxedPrecision + Decorate 12422 RelaxedPrecision + Decorate 12423 RelaxedPrecision + 8: TypeVoid + 1282: TypeFunction 8 + 13: TypeFloat 32 + 29: TypeVector 13(float) 4 + 666: TypePointer Input 29(fvec4) + 3719: 666(ptr) Variable Input + 11: TypeInt 32 0 + 2579: 11(int) Constant 3 + 650: TypePointer Input 13(float) + 12: TypeInt 32 1 + 667: TypePointer Output 29(fvec4) + 3994: 667(ptr) Variable Output + 2570: 11(int) Constant 0 + 2572: 13(float) Constant 0 + 2573: 11(int) Constant 1 + 138: 13(float) Constant 1065353216 + 2576: 11(int) Constant 2 + 24: 13(float) Constant 1073741824 + 833: 13(float) Constant 3212836864 + 1284: 29(fvec4) ConstantComposite 833 833 833 833 + 5663: 8 Function None 1282 + 23915: Label + 7984: 650(ptr) AccessChain 3719 2579 + 11376: 13(float) Load 7984 + 16859: 12(int) ConvertFToS 11376 + SelectionMerge 19578 None + Switch 16859 15971 + case 0: 8158 + case 1: 8159 + case 2: 8160 + 15971: Label + Store 3994 1284 + Branch 19578 + 8158: Label + 21848: 650(ptr) AccessChain 3719 2570 + 23987: 13(float) Load 21848 + 19989: 13(float) FAdd 23987 2572 + 12421: 29(fvec4) CompositeConstruct 19989 19989 19989 19989 + Store 3994 12421 + Branch 19578 + 8159: Label + 21849: 650(ptr) AccessChain 3719 2573 + 23988: 13(float) Load 21849 + 19990: 13(float) FAdd 23988 138 + 12422: 29(fvec4) CompositeConstruct 19990 19990 19990 19990 + Store 3994 12422 + Branch 19578 + 8160: Label + 21850: 650(ptr) AccessChain 3719 2576 + 23989: 13(float) Load 21850 + 19991: 13(float) FAdd 23989 24 + 12423: 29(fvec4) CompositeConstruct 19991 19991 19991 19991 + Store 3994 12423 + Branch 19578 + 19578: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/remap.switch.none.frag.out b/deps/glslang/Test/baseResults/remap.switch.none.frag.out new file mode 100644 index 00000000..4dd78977 --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.switch.none.frag.out @@ -0,0 +1,80 @@ +remap.switch.none.frag +WARNING: 0:5: '' : all default precisions are highp; use precision statements to quiet warning, e.g.: + "precision mediump int; precision highp float;" + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 48 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 23 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "in0" + Name 23 "FragColor" + Decorate 9(in0) Location 0 + Decorate 23(FragColor) RelaxedPrecision + Decorate 23(FragColor) Location 0 + Decorate 29 RelaxedPrecision + Decorate 36 RelaxedPrecision + Decorate 43 RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Input 7(fvec4) + 9(in0): 8(ptr) Variable Input + 10: TypeInt 32 0 + 11: 10(int) Constant 3 + 12: TypePointer Input 6(float) + 15: TypeInt 32 1 + 22: TypePointer Output 7(fvec4) + 23(FragColor): 22(ptr) Variable Output + 24: 10(int) Constant 0 + 27: 6(float) Constant 0 + 31: 10(int) Constant 1 + 34: 6(float) Constant 1065353216 + 38: 10(int) Constant 2 + 41: 6(float) Constant 1073741824 + 45: 6(float) Constant 3212836864 + 46: 7(fvec4) ConstantComposite 45 45 45 45 + 4(main): 2 Function None 3 + 5: Label + 13: 12(ptr) AccessChain 9(in0) 11 + 14: 6(float) Load 13 + 16: 15(int) ConvertFToS 14 + SelectionMerge 21 None + Switch 16 20 + case 0: 17 + case 1: 18 + case 2: 19 + 20: Label + Store 23(FragColor) 46 + Branch 21 + 17: Label + 25: 12(ptr) AccessChain 9(in0) 24 + 26: 6(float) Load 25 + 28: 6(float) FAdd 26 27 + 29: 7(fvec4) CompositeConstruct 28 28 28 28 + Store 23(FragColor) 29 + Branch 21 + 18: Label + 32: 12(ptr) AccessChain 9(in0) 31 + 33: 6(float) Load 32 + 35: 6(float) FAdd 33 34 + 36: 7(fvec4) CompositeConstruct 35 35 35 35 + Store 23(FragColor) 36 + Branch 21 + 19: Label + 39: 12(ptr) AccessChain 9(in0) 38 + 40: 6(float) Load 39 + 42: 6(float) FAdd 40 41 + 43: 7(fvec4) CompositeConstruct 42 42 42 42 + Store 23(FragColor) 43 + Branch 21 + 21: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/remap.uniformarray.everything.frag.out b/deps/glslang/Test/baseResults/remap.uniformarray.everything.frag.out new file mode 100644 index 00000000..c1f306e1 --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.uniformarray.everything.frag.out @@ -0,0 +1,64 @@ +remap.uniformarray.everything.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 25030 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 5663 "main" 3608 4957 4339 5139 + ExecutionMode 5663 OriginUpperLeft + Decorate 5139 Location 0 + 8: TypeVoid + 1282: TypeFunction 8 + 13: TypeFloat 32 + 29: TypeVector 13(float) 4 + 666: TypePointer Function 29(fvec4) + 11: TypeInt 32 0 + 2588: 11(int) Constant 6 + 740: TypeArray 29(fvec4) 2588 + 1377: TypePointer Input 740 + 3608: 1377(ptr) Variable Input + 12: TypeInt 32 1 + 2574: 12(int) Constant 1 + 667: TypePointer Input 29(fvec4) + 24: TypeVector 13(float) 3 + 661: TypePointer Input 24(fvec3) + 4957: 661(ptr) Variable Input + 2618: 11(int) Constant 16 + 669: TypeArray 13(float) 2618 + 1306: TypePointer Input 669 + 4339: 1306(ptr) Variable Input + 2607: 12(int) Constant 12 + 650: TypePointer Input 13(float) + 2579: 11(int) Constant 3 + 651: TypePointer Function 13(float) + 668: TypePointer Output 29(fvec4) + 5139: 668(ptr) Variable Output + 5663: 8 Function None 1282 + 25029: Label + 4902: 666(ptr) Variable Function + 10645: 667(ptr) AccessChain 3608 2574 + 8181: 29(fvec4) Load 10645 + 21370: 667(ptr) AccessChain 3608 2574 + 11355: 29(fvec4) Load 21370 + 23084: 29(fvec4) FAdd 8181 11355 + Store 4902 23084 + 21218: 24(fvec3) Load 4957 + 13695: 29(fvec4) Load 4902 + 23883: 24(fvec3) VectorShuffle 13695 13695 0 1 2 + 15591: 24(fvec3) FAdd 23883 21218 + 17086: 29(fvec4) Load 4902 + 7051: 29(fvec4) VectorShuffle 17086 15591 4 5 6 3 + Store 4902 7051 + 18282: 650(ptr) AccessChain 4339 2607 + 7372: 13(float) Load 18282 + 21371: 651(ptr) AccessChain 4902 2579 + 11412: 13(float) Load 21371 + 22584: 13(float) FAdd 11412 7372 + 17318: 651(ptr) AccessChain 4902 2579 + Store 17318 22584 + 17934: 29(fvec4) Load 4902 + Store 5139 17934 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/remap.uniformarray.none.frag.out b/deps/glslang/Test/baseResults/remap.uniformarray.none.frag.out new file mode 100644 index 00000000..6ed2d45e --- /dev/null +++ b/deps/glslang/Test/baseResults/remap.uniformarray.none.frag.out @@ -0,0 +1,77 @@ +remap.uniformarray.none.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 53 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 14 25 35 47 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 9 "texColor" + Name 14 "color" + Name 25 "inColor" + Name 35 "alpha" + Name 47 "gl_FragColor" + Name 52 "texSampler2D" + Decorate 47(gl_FragColor) Location 0 + Decorate 52(texSampler2D) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypeInt 32 0 + 11: 10(int) Constant 6 + 12: TypeArray 7(fvec4) 11 + 13: TypePointer Input 12 + 14(color): 13(ptr) Variable Input + 15: TypeInt 32 1 + 16: 15(int) Constant 1 + 17: TypePointer Input 7(fvec4) + 23: TypeVector 6(float) 3 + 24: TypePointer Input 23(fvec3) + 25(inColor): 24(ptr) Variable Input + 32: 10(int) Constant 16 + 33: TypeArray 6(float) 32 + 34: TypePointer Input 33 + 35(alpha): 34(ptr) Variable Input + 36: 15(int) Constant 12 + 37: TypePointer Input 6(float) + 40: 10(int) Constant 3 + 41: TypePointer Function 6(float) + 46: TypePointer Output 7(fvec4) +47(gl_FragColor): 46(ptr) Variable Output + 49: TypeImage 6(float) 2D sampled format:Unknown + 50: TypeSampledImage 49 + 51: TypePointer UniformConstant 50 +52(texSampler2D): 51(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 9(texColor): 8(ptr) Variable Function + 18: 17(ptr) AccessChain 14(color) 16 + 19: 7(fvec4) Load 18 + 20: 17(ptr) AccessChain 14(color) 16 + 21: 7(fvec4) Load 20 + 22: 7(fvec4) FAdd 19 21 + Store 9(texColor) 22 + 26: 23(fvec3) Load 25(inColor) + 27: 7(fvec4) Load 9(texColor) + 28: 23(fvec3) VectorShuffle 27 27 0 1 2 + 29: 23(fvec3) FAdd 28 26 + 30: 7(fvec4) Load 9(texColor) + 31: 7(fvec4) VectorShuffle 30 29 4 5 6 3 + Store 9(texColor) 31 + 38: 37(ptr) AccessChain 35(alpha) 36 + 39: 6(float) Load 38 + 42: 41(ptr) AccessChain 9(texColor) 40 + 43: 6(float) Load 42 + 44: 6(float) FAdd 43 39 + 45: 41(ptr) AccessChain 9(texColor) 40 + Store 45 44 + 48: 7(fvec4) Load 9(texColor) + Store 47(gl_FragColor) 48 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/runtimeArray.vert.out b/deps/glslang/Test/baseResults/runtimeArray.vert.out new file mode 100644 index 00000000..5ba39929 --- /dev/null +++ b/deps/glslang/Test/baseResults/runtimeArray.vert.out @@ -0,0 +1,647 @@ +runtimeArray.vert +WARNING: 0:33: '[]' : assuming binding count of one for compile-time checking of binding numbers for unsized array +WARNING: 0:34: '[]' : assuming binding count of one for compile-time checking of binding numbers for unsized array +WARNING: 0:37: '[]' : assuming binding count of one for compile-time checking of binding numbers for unsized array +WARNING: 0:38: '[]' : assuming binding count of one for compile-time checking of binding numbers for unsized array +WARNING: 0:39: '[]' : assuming binding count of one for compile-time checking of binding numbers for unsized array +WARNING: 0:40: '[]' : assuming binding count of one for compile-time checking of binding numbers for unsized array +ERROR: 0:61: '[' : array must be redeclared with a size before being indexed with a variable +ERROR: 0:62: '[' : array must be redeclared with a size before being indexed with a variable +ERROR: 0:63: '[' : array must be redeclared with a size before being indexed with a variable +ERROR: 0:66: 'length' : array must be declared with a size before using this method +ERROR: 0:67: 'length' : array must be declared with a size before using this method +ERROR: 0:68: 'length' : array must be declared with a size before using this method +ERROR: 0:71: '[' : array must be redeclared with a size before being indexed with a variable +ERROR: 0:72: '[' : array must be redeclared with a size before being indexed with a variable +ERROR: 0:73: '[' : array must be redeclared with a size before being indexed with a variable +ERROR: 0:76: 'length' : array must be declared with a size before using this method +ERROR: 0:77: 'length' : array must be declared with a size before using this method +ERROR: 0:78: 'length' : array must be declared with a size before using this method +ERROR: 0:81: '[' : array must be redeclared with a size before being indexed with a variable +ERROR: 0:82: '[' : array must be redeclared with a size before being indexed with a variable +ERROR: 0:83: '[' : array must be redeclared with a size before being indexed with a variable +ERROR: 0:86: 'length' : array must be declared with a size before using this method +ERROR: 0:87: 'length' : array must be declared with a size before using this method +ERROR: 0:88: 'length' : array must be declared with a size before using this method +ERROR: 0:100: 'variable index' : required extension not requested: GL_EXT_nonuniform_qualifier +ERROR: 0:101: 'variable index' : required extension not requested: GL_EXT_nonuniform_qualifier +ERROR: 0:102: 'variable index' : required extension not requested: GL_EXT_nonuniform_qualifier +ERROR: 0:103: 'variable index' : required extension not requested: GL_EXT_nonuniform_qualifier +ERROR: 0:104: 'variable index' : required extension not requested: GL_EXT_nonuniform_qualifier +ERROR: 0:105: 'variable index' : required extension not requested: GL_EXT_nonuniform_qualifier +ERROR: 0:106: 'variable index' : required extension not requested: GL_EXT_nonuniform_qualifier +ERROR: 0:107: 'variable index' : required extension not requested: GL_EXT_nonuniform_qualifier +ERROR: 0:109: '[]' : array initializer must be sized +ERROR: 27 compilation errors. No code generated. + + +Shader version: 450 +ERROR: node is still EOpNull! +0:44 Function Definition: main( ( global void) +0:44 Function Parameters: +0:46 Sequence +0:46 direct index (layout( column_major shared) temp int) +0:46 a: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:46 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 3 (const int) +0:47 direct index (layout( column_major shared) temp float) +0:47 b: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:47 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 3 (const int) +0:48 direct index (layout( column_major shared) temp int) +0:48 a: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:48 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:48 Constant: +0:48 0 (const int) +0:48 Constant: +0:48 3 (const int) +0:49 direct index (layout( column_major shared) temp float) +0:49 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:49 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:49 Constant: +0:49 1 (const int) +0:49 Constant: +0:49 3 (const int) +0:51 direct index (layout( column_major shared) temp int) +0:51 a: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:51 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:51 'ubufa' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:51 Constant: +0:51 3 (const int) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:52 direct index (layout( column_major shared) temp float) +0:52 b: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:52 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:52 'ubufa' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:52 Constant: +0:52 3 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 3 (const int) +0:53 direct index (layout( column_major shared) temp int) +0:53 a: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:53 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:53 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:53 Constant: +0:53 3 (const int) +0:53 Constant: +0:53 0 (const int) +0:53 Constant: +0:53 3 (const int) +0:54 direct index (layout( column_major shared) temp float) +0:54 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:54 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:54 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:54 Constant: +0:54 3 (const int) +0:54 Constant: +0:54 1 (const int) +0:54 Constant: +0:54 3 (const int) +0:56 direct index (layout( column_major shared) temp int) +0:56 aua: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:56 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int aua, layout( column_major shared) uniform runtime-sized array of float aub}) +0:56 Constant: +0:56 0 (const uint) +0:56 Constant: +0:56 3 (const int) +0:57 direct index (layout( column_major shared) temp float) +0:57 aub: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:57 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int aua, layout( column_major shared) uniform runtime-sized array of float aub}) +0:57 Constant: +0:57 1 (const uint) +0:57 Constant: +0:57 3 (const int) +0:58 direct index (layout( column_major shared) temp int) +0:58 aba: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:58 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:58 Constant: +0:58 0 (const uint) +0:58 Constant: +0:58 3 (const int) +0:59 direct index (layout( column_major shared) temp float) +0:59 abb: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:59 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:59 Constant: +0:59 1 (const uint) +0:59 Constant: +0:59 3 (const int) +0:61 indirect index (layout( column_major shared) temp int) +0:61 a: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:61 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:61 Constant: +0:61 0 (const int) +0:61 'i' ( global int) +0:62 indirect index (layout( column_major shared) temp float) +0:62 b: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:62 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:62 Constant: +0:62 1 (const int) +0:62 'i' ( global int) +0:63 indirect index (layout( column_major shared) temp int) +0:63 a: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:63 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:63 Constant: +0:63 0 (const int) +0:63 'i' ( global int) +0:64 indirect index (layout( column_major shared) temp float) +0:64 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:64 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:64 Constant: +0:64 1 (const int) +0:64 'i' ( global int) +0:66 Constant: +0:66 1 (const int) +0:67 Constant: +0:67 1 (const int) +0:68 Constant: +0:68 1 (const int) +0:69 array length ( temp int) +0:69 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:69 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:69 Constant: +0:69 1 (const int) +0:71 indirect index (layout( column_major shared) temp int) +0:71 a: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:71 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:71 'ubufa' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:71 Constant: +0:71 1 (const int) +0:71 Constant: +0:71 0 (const int) +0:71 'i' ( global int) +0:72 indirect index (layout( column_major shared) temp float) +0:72 b: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:72 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:72 'ubufa' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:72 Constant: +0:72 1 (const int) +0:72 Constant: +0:72 1 (const int) +0:72 'i' ( global int) +0:73 indirect index (layout( column_major shared) temp int) +0:73 a: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:73 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:73 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:73 Constant: +0:73 1 (const int) +0:73 Constant: +0:73 0 (const int) +0:73 'i' ( global int) +0:74 indirect index (layout( column_major shared) temp float) +0:74 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:74 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:74 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:74 Constant: +0:74 1 (const int) +0:74 Constant: +0:74 1 (const int) +0:74 'i' ( global int) +0:76 Constant: +0:76 1 (const int) +0:77 Constant: +0:77 1 (const int) +0:78 Constant: +0:78 1 (const int) +0:79 array length ( temp int) +0:79 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:79 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:79 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:79 Constant: +0:79 1 (const int) +0:79 Constant: +0:79 1 (const int) +0:81 indirect index (layout( column_major shared) temp int) +0:81 aua: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:81 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int aua, layout( column_major shared) uniform runtime-sized array of float aub}) +0:81 Constant: +0:81 0 (const uint) +0:81 'i' ( global int) +0:82 indirect index (layout( column_major shared) temp float) +0:82 aub: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:82 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int aua, layout( column_major shared) uniform runtime-sized array of float aub}) +0:82 Constant: +0:82 1 (const uint) +0:82 'i' ( global int) +0:83 indirect index (layout( column_major shared) temp int) +0:83 aba: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:83 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:83 Constant: +0:83 0 (const uint) +0:83 'i' ( global int) +0:84 indirect index (layout( column_major shared) temp float) +0:84 abb: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:84 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:84 Constant: +0:84 1 (const uint) +0:84 'i' ( global int) +0:86 Constant: +0:86 1 (const int) +0:87 Constant: +0:87 1 (const int) +0:88 Constant: +0:88 1 (const int) +0:89 array length ( temp int) +0:89 abb: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:89 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:89 Constant: +0:89 1 (const uint) +0:91 direct index (layout( binding=1) temp samplerBuffer) +0:91 'uniformTexelBufferDyn' (layout( binding=1) uniform runtime-sized array of samplerBuffer) +0:91 Constant: +0:91 1 (const int) +0:92 direct index (layout( binding=2 r32f) temp imageBuffer) +0:92 'storageTexelBufferDyn' (layout( binding=2 r32f) uniform runtime-sized array of imageBuffer) +0:92 Constant: +0:92 1 (const int) +0:93 direct index (layout( binding=3 column_major shared) temp block{layout( column_major shared) uniform float a}) +0:93 'uniformBuffer' (layout( binding=3 column_major shared) uniform runtime-sized array of block{layout( column_major shared) uniform float a}) +0:93 Constant: +0:93 1 (const int) +0:94 direct index (layout( binding=4 column_major shared) temp block{layout( column_major shared) buffer float b}) +0:94 'storageBuffer' (layout( binding=4 column_major shared) buffer runtime-sized array of block{layout( column_major shared) buffer float b}) +0:94 Constant: +0:94 1 (const int) +0:95 direct index (layout( binding=5) temp sampler2D) +0:95 'sampledImage' (layout( binding=5) uniform runtime-sized array of sampler2D) +0:95 Constant: +0:95 1 (const int) +0:96 direct index (layout( binding=6 r32f) temp image2D) +0:96 'storageImage' (layout( binding=6 r32f) uniform runtime-sized array of image2D) +0:96 Constant: +0:96 1 (const int) +0:97 direct index (layout( binding=8) temp samplerBuffer) +0:97 'uniformTexelBuffer' (layout( binding=8) uniform runtime-sized array of samplerBuffer) +0:97 Constant: +0:97 1 (const int) +0:98 direct index (layout( binding=9 r32f) temp imageBuffer) +0:98 'storageTexelBuffer' (layout( binding=9 r32f) uniform runtime-sized array of imageBuffer) +0:98 Constant: +0:98 1 (const int) +0:100 indirect index (layout( binding=1) temp samplerBuffer) +0:100 'uniformTexelBufferDyn' (layout( binding=1) uniform runtime-sized array of samplerBuffer) +0:100 'i' ( global int) +0:101 indirect index (layout( binding=2 r32f) temp imageBuffer) +0:101 'storageTexelBufferDyn' (layout( binding=2 r32f) uniform runtime-sized array of imageBuffer) +0:101 'i' ( global int) +0:102 indirect index (layout( binding=3 column_major shared) temp block{layout( column_major shared) uniform float a}) +0:102 'uniformBuffer' (layout( binding=3 column_major shared) uniform runtime-sized array of block{layout( column_major shared) uniform float a}) +0:102 'i' ( global int) +0:103 indirect index (layout( binding=4 column_major shared) temp block{layout( column_major shared) buffer float b}) +0:103 'storageBuffer' (layout( binding=4 column_major shared) buffer runtime-sized array of block{layout( column_major shared) buffer float b}) +0:103 'i' ( global int) +0:104 indirect index (layout( binding=5) temp sampler2D) +0:104 'sampledImage' (layout( binding=5) uniform runtime-sized array of sampler2D) +0:104 'i' ( global int) +0:105 indirect index (layout( binding=6 r32f) temp image2D) +0:105 'storageImage' (layout( binding=6 r32f) uniform runtime-sized array of image2D) +0:105 'i' ( global int) +0:106 indirect index (layout( binding=8) temp samplerBuffer) +0:106 'uniformTexelBuffer' (layout( binding=8) uniform runtime-sized array of samplerBuffer) +0:106 'i' ( global int) +0:107 indirect index (layout( binding=9 r32f) temp imageBuffer) +0:107 'storageTexelBuffer' (layout( binding=9 r32f) uniform runtime-sized array of imageBuffer) +0:107 'i' ( global int) +0:109 Sequence +0:109 move second child to first child ( temp unsized 1-element array of float) +0:109 'local' ( temp unsized 1-element array of float) +0:109 b: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:109 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:109 Constant: +0:109 1 (const int) +0:? Linker Objects +0:? 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:? 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:? 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:? 'ubufa' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:? 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int aua, layout( column_major shared) uniform runtime-sized array of float aub}) +0:? 'uniformTexelBufferDyn' (layout( binding=1) uniform runtime-sized array of samplerBuffer) +0:? 'storageTexelBufferDyn' (layout( binding=2 r32f) uniform runtime-sized array of imageBuffer) +0:? 'uniformBuffer' (layout( binding=3 column_major shared) uniform runtime-sized array of block{layout( column_major shared) uniform float a}) +0:? 'storageBuffer' (layout( binding=4 column_major shared) buffer runtime-sized array of block{layout( column_major shared) buffer float b}) +0:? 'sampledImage' (layout( binding=5) uniform runtime-sized array of sampler2D) +0:? 'storageImage' (layout( binding=6 r32f) uniform runtime-sized array of image2D) +0:? 'uniformTexelBuffer' (layout( binding=8) uniform runtime-sized array of samplerBuffer) +0:? 'storageTexelBuffer' (layout( binding=9 r32f) uniform runtime-sized array of imageBuffer) +0:? 'i' ( global int) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 450 +ERROR: node is still EOpNull! +0:44 Function Definition: main( ( global void) +0:44 Function Parameters: +0:46 Sequence +0:46 direct index (layout( column_major shared) temp int) +0:46 a: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:46 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 3 (const int) +0:47 direct index (layout( column_major shared) temp float) +0:47 b: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:47 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:47 Constant: +0:47 1 (const int) +0:47 Constant: +0:47 3 (const int) +0:48 direct index (layout( column_major shared) temp int) +0:48 a: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:48 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:48 Constant: +0:48 0 (const int) +0:48 Constant: +0:48 3 (const int) +0:49 direct index (layout( column_major shared) temp float) +0:49 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:49 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:49 Constant: +0:49 1 (const int) +0:49 Constant: +0:49 3 (const int) +0:51 direct index (layout( column_major shared) temp int) +0:51 a: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:51 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:51 'ubufa' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:51 Constant: +0:51 3 (const int) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 3 (const int) +0:52 direct index (layout( column_major shared) temp float) +0:52 b: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:52 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:52 'ubufa' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:52 Constant: +0:52 3 (const int) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 3 (const int) +0:53 direct index (layout( column_major shared) temp int) +0:53 a: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:53 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:53 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:53 Constant: +0:53 3 (const int) +0:53 Constant: +0:53 0 (const int) +0:53 Constant: +0:53 3 (const int) +0:54 direct index (layout( column_major shared) temp float) +0:54 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:54 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:54 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:54 Constant: +0:54 3 (const int) +0:54 Constant: +0:54 1 (const int) +0:54 Constant: +0:54 3 (const int) +0:56 direct index (layout( column_major shared) temp int) +0:56 aua: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:56 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int aua, layout( column_major shared) uniform runtime-sized array of float aub}) +0:56 Constant: +0:56 0 (const uint) +0:56 Constant: +0:56 3 (const int) +0:57 direct index (layout( column_major shared) temp float) +0:57 aub: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:57 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int aua, layout( column_major shared) uniform runtime-sized array of float aub}) +0:57 Constant: +0:57 1 (const uint) +0:57 Constant: +0:57 3 (const int) +0:58 direct index (layout( column_major shared) temp int) +0:58 aba: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:58 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:58 Constant: +0:58 0 (const uint) +0:58 Constant: +0:58 3 (const int) +0:59 direct index (layout( column_major shared) temp float) +0:59 abb: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:59 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:59 Constant: +0:59 1 (const uint) +0:59 Constant: +0:59 3 (const int) +0:61 indirect index (layout( column_major shared) temp int) +0:61 a: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:61 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:61 Constant: +0:61 0 (const int) +0:61 'i' ( global int) +0:62 indirect index (layout( column_major shared) temp float) +0:62 b: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:62 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:62 Constant: +0:62 1 (const int) +0:62 'i' ( global int) +0:63 indirect index (layout( column_major shared) temp int) +0:63 a: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:63 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:63 Constant: +0:63 0 (const int) +0:63 'i' ( global int) +0:64 indirect index (layout( column_major shared) temp float) +0:64 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:64 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:64 Constant: +0:64 1 (const int) +0:64 'i' ( global int) +0:66 Constant: +0:66 1 (const int) +0:67 Constant: +0:67 1 (const int) +0:68 Constant: +0:68 1 (const int) +0:69 array length ( temp int) +0:69 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:69 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:69 Constant: +0:69 1 (const int) +0:71 indirect index (layout( column_major shared) temp int) +0:71 a: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:71 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:71 'ubufa' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:71 Constant: +0:71 1 (const int) +0:71 Constant: +0:71 0 (const int) +0:71 'i' ( global int) +0:72 indirect index (layout( column_major shared) temp float) +0:72 b: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:72 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:72 'ubufa' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:72 Constant: +0:72 1 (const int) +0:72 Constant: +0:72 1 (const int) +0:72 'i' ( global int) +0:73 indirect index (layout( column_major shared) temp int) +0:73 a: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:73 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:73 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:73 Constant: +0:73 1 (const int) +0:73 Constant: +0:73 0 (const int) +0:73 'i' ( global int) +0:74 indirect index (layout( column_major shared) temp float) +0:74 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:74 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:74 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:74 Constant: +0:74 1 (const int) +0:74 Constant: +0:74 1 (const int) +0:74 'i' ( global int) +0:76 Constant: +0:76 1 (const int) +0:77 Constant: +0:77 1 (const int) +0:78 Constant: +0:78 1 (const int) +0:79 array length ( temp int) +0:79 b: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:79 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:79 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:79 Constant: +0:79 1 (const int) +0:79 Constant: +0:79 1 (const int) +0:81 indirect index (layout( column_major shared) temp int) +0:81 aua: direct index for structure (layout( column_major shared) uniform runtime-sized array of int) +0:81 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int aua, layout( column_major shared) uniform runtime-sized array of float aub}) +0:81 Constant: +0:81 0 (const uint) +0:81 'i' ( global int) +0:82 indirect index (layout( column_major shared) temp float) +0:82 aub: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:82 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int aua, layout( column_major shared) uniform runtime-sized array of float aub}) +0:82 Constant: +0:82 1 (const uint) +0:82 'i' ( global int) +0:83 indirect index (layout( column_major shared) temp int) +0:83 aba: direct index for structure (layout( column_major shared) buffer runtime-sized array of int) +0:83 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:83 Constant: +0:83 0 (const uint) +0:83 'i' ( global int) +0:84 indirect index (layout( column_major shared) temp float) +0:84 abb: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:84 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:84 Constant: +0:84 1 (const uint) +0:84 'i' ( global int) +0:86 Constant: +0:86 1 (const int) +0:87 Constant: +0:87 1 (const int) +0:88 Constant: +0:88 1 (const int) +0:89 array length ( temp int) +0:89 abb: direct index for structure (layout( column_major shared) buffer runtime-sized array of float) +0:89 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:89 Constant: +0:89 1 (const uint) +0:91 direct index (layout( binding=1) temp samplerBuffer) +0:91 'uniformTexelBufferDyn' (layout( binding=1) uniform runtime-sized array of samplerBuffer) +0:91 Constant: +0:91 1 (const int) +0:92 direct index (layout( binding=2 r32f) temp imageBuffer) +0:92 'storageTexelBufferDyn' (layout( binding=2 r32f) uniform runtime-sized array of imageBuffer) +0:92 Constant: +0:92 1 (const int) +0:93 direct index (layout( binding=3 column_major shared) temp block{layout( column_major shared) uniform float a}) +0:93 'uniformBuffer' (layout( binding=3 column_major shared) uniform runtime-sized array of block{layout( column_major shared) uniform float a}) +0:93 Constant: +0:93 1 (const int) +0:94 direct index (layout( binding=4 column_major shared) temp block{layout( column_major shared) buffer float b}) +0:94 'storageBuffer' (layout( binding=4 column_major shared) buffer runtime-sized array of block{layout( column_major shared) buffer float b}) +0:94 Constant: +0:94 1 (const int) +0:95 direct index (layout( binding=5) temp sampler2D) +0:95 'sampledImage' (layout( binding=5) uniform runtime-sized array of sampler2D) +0:95 Constant: +0:95 1 (const int) +0:96 direct index (layout( binding=6 r32f) temp image2D) +0:96 'storageImage' (layout( binding=6 r32f) uniform runtime-sized array of image2D) +0:96 Constant: +0:96 1 (const int) +0:97 direct index (layout( binding=8) temp samplerBuffer) +0:97 'uniformTexelBuffer' (layout( binding=8) uniform runtime-sized array of samplerBuffer) +0:97 Constant: +0:97 1 (const int) +0:98 direct index (layout( binding=9 r32f) temp imageBuffer) +0:98 'storageTexelBuffer' (layout( binding=9 r32f) uniform runtime-sized array of imageBuffer) +0:98 Constant: +0:98 1 (const int) +0:100 indirect index (layout( binding=1) temp samplerBuffer) +0:100 'uniformTexelBufferDyn' (layout( binding=1) uniform runtime-sized array of samplerBuffer) +0:100 'i' ( global int) +0:101 indirect index (layout( binding=2 r32f) temp imageBuffer) +0:101 'storageTexelBufferDyn' (layout( binding=2 r32f) uniform runtime-sized array of imageBuffer) +0:101 'i' ( global int) +0:102 indirect index (layout( binding=3 column_major shared) temp block{layout( column_major shared) uniform float a}) +0:102 'uniformBuffer' (layout( binding=3 column_major shared) uniform runtime-sized array of block{layout( column_major shared) uniform float a}) +0:102 'i' ( global int) +0:103 indirect index (layout( binding=4 column_major shared) temp block{layout( column_major shared) buffer float b}) +0:103 'storageBuffer' (layout( binding=4 column_major shared) buffer runtime-sized array of block{layout( column_major shared) buffer float b}) +0:103 'i' ( global int) +0:104 indirect index (layout( binding=5) temp sampler2D) +0:104 'sampledImage' (layout( binding=5) uniform runtime-sized array of sampler2D) +0:104 'i' ( global int) +0:105 indirect index (layout( binding=6 r32f) temp image2D) +0:105 'storageImage' (layout( binding=6 r32f) uniform runtime-sized array of image2D) +0:105 'i' ( global int) +0:106 indirect index (layout( binding=8) temp samplerBuffer) +0:106 'uniformTexelBuffer' (layout( binding=8) uniform runtime-sized array of samplerBuffer) +0:106 'i' ( global int) +0:107 indirect index (layout( binding=9 r32f) temp imageBuffer) +0:107 'storageTexelBuffer' (layout( binding=9 r32f) uniform runtime-sized array of imageBuffer) +0:107 'i' ( global int) +0:109 Sequence +0:109 move second child to first child ( temp 1-element array of float) +0:109 'local' ( temp 1-element array of float) +0:109 b: direct index for structure (layout( column_major shared) uniform runtime-sized array of float) +0:109 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:109 Constant: +0:109 1 (const int) +0:? Linker Objects +0:? 'buf' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:? 'ubuf' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:? 'bufa' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer runtime-sized array of int a, layout( column_major shared) buffer runtime-sized array of float b}) +0:? 'ubufa' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform runtime-sized array of int a, layout( column_major shared) uniform runtime-sized array of float b}) +0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer runtime-sized array of int aba, layout( column_major shared) buffer runtime-sized array of float abb}) +0:? 'anon@1' (layout( column_major shared) uniform block{layout( column_major shared) uniform runtime-sized array of int aua, layout( column_major shared) uniform runtime-sized array of float aub}) +0:? 'uniformTexelBufferDyn' (layout( binding=1) uniform runtime-sized array of samplerBuffer) +0:? 'storageTexelBufferDyn' (layout( binding=2 r32f) uniform runtime-sized array of imageBuffer) +0:? 'uniformBuffer' (layout( binding=3 column_major shared) uniform runtime-sized array of block{layout( column_major shared) uniform float a}) +0:? 'storageBuffer' (layout( binding=4 column_major shared) buffer runtime-sized array of block{layout( column_major shared) buffer float b}) +0:? 'sampledImage' (layout( binding=5) uniform runtime-sized array of sampler2D) +0:? 'storageImage' (layout( binding=6 r32f) uniform runtime-sized array of image2D) +0:? 'uniformTexelBuffer' (layout( binding=8) uniform runtime-sized array of samplerBuffer) +0:? 'storageTexelBuffer' (layout( binding=9 r32f) uniform runtime-sized array of imageBuffer) +0:? 'i' ( global int) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/sample.frag.out b/deps/glslang/Test/baseResults/sample.frag.out new file mode 100644 index 00000000..780789a7 --- /dev/null +++ b/deps/glslang/Test/baseResults/sample.frag.out @@ -0,0 +1,33 @@ +sample.frag +Shader version: 110 +0:? Sequence +0:38 Function Definition: main( ( global void) +0:38 Function Parameters: +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of float) +0:40 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:40 Construct vec4 ( temp 4-component vector of float) +0:40 'color' ( smooth in 3-component vector of float) +0:40 Constant: +0:40 1.000000 +0:? Linker Objects +0:? 'color' ( smooth in 3-component vector of float) + + +Linked fragment stage: + + +Shader version: 110 +0:? Sequence +0:38 Function Definition: main( ( global void) +0:38 Function Parameters: +0:40 Sequence +0:40 move second child to first child ( temp 4-component vector of float) +0:40 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:40 Construct vec4 ( temp 4-component vector of float) +0:40 'color' ( smooth in 3-component vector of float) +0:40 Constant: +0:40 1.000000 +0:? Linker Objects +0:? 'color' ( smooth in 3-component vector of float) + diff --git a/deps/glslang/Test/baseResults/sample.vert.out b/deps/glslang/Test/baseResults/sample.vert.out new file mode 100644 index 00000000..848598eb --- /dev/null +++ b/deps/glslang/Test/baseResults/sample.vert.out @@ -0,0 +1,43 @@ +sample.vert +Shader version: 110 +0:? Sequence +0:38 Function Definition: main( ( global void) +0:38 Function Parameters: +0:40 Sequence +0:40 move second child to first child ( temp 3-component vector of float) +0:40 'color' ( smooth out 3-component vector of float) +0:40 Constant: +0:40 1.000000 +0:40 1.000000 +0:40 1.000000 +0:42 move second child to first child ( temp 4-component vector of float) +0:42 'gl_Position' ( gl_Position 4-component vector of float Position) +0:42 matrix-times-vector ( temp 4-component vector of float) +0:42 'gl_ModelViewProjectionMatrix' ( uniform 4X4 matrix of float) +0:42 'gl_Vertex' ( in 4-component vector of float Vertex) +0:? Linker Objects +0:? 'color' ( smooth out 3-component vector of float) + + +Linked vertex stage: + + +Shader version: 110 +0:? Sequence +0:38 Function Definition: main( ( global void) +0:38 Function Parameters: +0:40 Sequence +0:40 move second child to first child ( temp 3-component vector of float) +0:40 'color' ( smooth out 3-component vector of float) +0:40 Constant: +0:40 1.000000 +0:40 1.000000 +0:40 1.000000 +0:42 move second child to first child ( temp 4-component vector of float) +0:42 'gl_Position' ( gl_Position 4-component vector of float Position) +0:42 matrix-times-vector ( temp 4-component vector of float) +0:42 'gl_ModelViewProjectionMatrix' ( uniform 4X4 matrix of float) +0:42 'gl_Vertex' ( in 4-component vector of float Vertex) +0:? Linker Objects +0:? 'color' ( smooth out 3-component vector of float) + diff --git a/deps/glslang/Test/baseResults/samplerlessTextureFunctions.frag.out b/deps/glslang/Test/baseResults/samplerlessTextureFunctions.frag.out new file mode 100644 index 00000000..8ac8d4de --- /dev/null +++ b/deps/glslang/Test/baseResults/samplerlessTextureFunctions.frag.out @@ -0,0 +1,13 @@ +samplerlessTextureFunctions.frag +ERROR: 0:9: 'texelFetch' : required extension not requested: GL_EXT_samplerless_texture_functions +ERROR: 0:10: 'texelFetch' : required extension not requested: GL_EXT_samplerless_texture_functions +ERROR: 0:16: 'texelFetchOffset' : required extension not requested: GL_EXT_samplerless_texture_functions +ERROR: 0:18: 'textureSize' : required extension not requested: GL_EXT_samplerless_texture_functions +ERROR: 0:19: 'textureSize' : required extension not requested: GL_EXT_samplerless_texture_functions +ERROR: 0:20: 'textureSize' : required extension not requested: GL_EXT_samplerless_texture_functions +ERROR: 0:22: 'textureQueryLevels' : required extension not requested: GL_EXT_samplerless_texture_functions +ERROR: 0:24: 'textureSamples' : required extension not requested: GL_EXT_samplerless_texture_functions +ERROR: 8 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/simpleFunctionCall.frag.out b/deps/glslang/Test/baseResults/simpleFunctionCall.frag.out new file mode 100644 index 00000000..5ccd54d2 --- /dev/null +++ b/deps/glslang/Test/baseResults/simpleFunctionCall.frag.out @@ -0,0 +1,43 @@ +simpleFunctionCall.frag +WARNING: 0:4: varying deprecated in version 130; may be removed in future release + +Shader version: 150 +0:? Sequence +0:7 Function Definition: foo( ( global 4-component vector of float) +0:7 Function Parameters: +0:9 Sequence +0:9 Branch: Return with expression +0:9 'BaseColor' ( smooth in 4-component vector of float) +0:12 Function Definition: main( ( global void) +0:12 Function Parameters: +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:14 Function Call: foo( ( global 4-component vector of float) +0:? Linker Objects +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'd' ( uniform float) + + +Linked fragment stage: + + +Shader version: 150 +0:? Sequence +0:7 Function Definition: foo( ( global 4-component vector of float) +0:7 Function Parameters: +0:9 Sequence +0:9 Branch: Return with expression +0:9 'BaseColor' ( smooth in 4-component vector of float) +0:12 Function Definition: main( ( global void) +0:12 Function Parameters: +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:14 Function Call: foo( ( global 4-component vector of float) +0:? Linker Objects +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'd' ( uniform float) + diff --git a/deps/glslang/Test/baseResults/specExamples.frag.out b/deps/glslang/Test/baseResults/specExamples.frag.out new file mode 100644 index 00000000..5eec3cbf --- /dev/null +++ b/deps/glslang/Test/baseResults/specExamples.frag.out @@ -0,0 +1,599 @@ +specExamples.frag +ERROR: 0:6: '=' : cannot convert from ' const uint' to ' global int' +ERROR: 0:20: '' : numeric literal too big +ERROR: 0:21: '' : hexadecimal literal too big +ERROR: 0:37: 'view' : redefinition +ERROR: 0:63: 'invariant' : can only apply to an output +ERROR: 0:68: 'lightPosition' : redefinition +ERROR: 0:75: 'Atten' : member storage qualifier cannot contradict block storage qualifier +ERROR: 0:87: 'Color' : redefinition +ERROR: 0:92: 'redeclaration' : cannot redeclare with different qualification: gl_FragCoord +ERROR: 0:93: 'redeclaration' : cannot redeclare with different qualification: gl_FragCoord +ERROR: 0:99: 'local_size_x' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:99: 'local_size_y' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:100: 'local_size_x' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:102: 'color' : redefinition +ERROR: 0:112: 'redeclaration' : all redeclarations must use the same depth layout on gl_FragDepth +ERROR: 0:118: 'redeclaration' : all redeclarations must use the same depth layout on gl_FragDepth +ERROR: 0:121: 'redeclaration' : all redeclarations must use the same depth layout on gl_FragDepth +ERROR: 0:172: 'x' : undeclared identifier +ERROR: 0:172: '[]' : scalar integer expression required +ERROR: 0:175: 'x' : undeclared identifier +ERROR: 0:175: '[]' : scalar integer expression required +ERROR: 0:175: 'b' : left of '[' is not of type array, matrix, or vector +ERROR: 0:175: 'a' : vector swizzle selection out of range +ERROR: 0:175: 'length' : does not operate on this type: const float +ERROR: 0:175: '' : function call, method, or subroutine call expected +ERROR: 0:175: '' : no matching overloaded function found +ERROR: 0:178: '[]' : scalar integer expression required +ERROR: 0:178: 's' : undeclared identifier +ERROR: 0:178: 's' : left of '[' is not of type array, matrix, or vector +ERROR: 0:178: 'a' : vector swizzle selection out of range +ERROR: 0:178: 'length' : does not operate on this type: const float +ERROR: 0:178: '' : function call, method, or subroutine call expected +ERROR: 0:178: '' : no matching overloaded function found +ERROR: 0:198: 'e' : redefinition +ERROR: 0:226: 'in' : not allowed in nested scope +ERROR: 0:227: 'in' : not allowed in nested scope +ERROR: 0:228: 'in' : not allowed in nested scope +ERROR: 0:232: 'out' : not allowed in nested scope +ERROR: 38 compilation errors. No code generated. + + +Shader version: 430 +Requested GL_3DL_array_objects +gl_FragCoord pixel center is integer +gl_FragCoord origin is upper left +using early_fragment_tests +using depth_greater +ERROR: node is still EOpNull! +0:5 Sequence +0:5 move second child to first child ( temp int) +0:5 'a' ( global int) +0:5 Constant: +0:5 -1 (const int) +0:7 Sequence +0:7 move second child to first child ( temp uint) +0:7 'c' ( global uint) +0:7 Constant: +0:7 4294967295 (const uint) +0:8 Sequence +0:8 move second child to first child ( temp uint) +0:8 'd' ( global uint) +0:8 Constant: +0:8 4294967295 (const uint) +0:9 Sequence +0:9 move second child to first child ( temp int) +0:9 'e' ( global int) +0:9 Constant: +0:9 -1 (const int) +0:13 Sequence +0:13 move second child to first child ( temp uint) +0:13 'f' ( global uint) +0:13 Constant: +0:13 4294967295 (const uint) +0:17 Sequence +0:17 move second child to first child ( temp int) +0:17 'g' ( global int) +0:17 Constant: +0:17 -1294967296 (const int) +0:19 Sequence +0:19 move second child to first child ( temp int) +0:19 'h' ( global int) +0:19 Constant: +0:19 -1610612736 (const int) +0:20 Sequence +0:20 move second child to first child ( temp int) +0:20 'i' ( global int) +0:20 Constant: +0:20 -1 (const int) +0:21 Sequence +0:21 move second child to first child ( temp int) +0:21 'j' ( global int) +0:21 Constant: +0:21 -1 (const int) +0:22 Sequence +0:22 move second child to first child ( temp int) +0:22 'k' ( global int) +0:22 Constant: +0:22 -2147483648 (const int) +0:23 Sequence +0:23 move second child to first child ( temp int) +0:23 'l' ( global int) +0:23 Constant: +0:23 -2147483648 (const int) +0:25 Sequence +0:25 move second child to first child ( temp float) +0:25 'fb' ( global float) +0:25 Constant: +0:25 1.500000 +0:26 Sequence +0:26 move second child to first child ( temp double) +0:26 'fd' ( global double) +0:26 Constant: +0:26 2.000000 +0:127 Function Definition: foo(f1[5]; ( global 5-element array of float) +0:127 Function Parameters: +0:127 '' ( in 5-element array of float) +0:129 Sequence +0:129 Branch: Return with expression +0:129 Constant: +0:129 3.400000 +0:129 4.200000 +0:129 5.000000 +0:129 5.200000 +0:129 1.100000 +0:137 Function Definition: main( ( global void) +0:137 Function Parameters: +0:140 Sequence +0:140 Sequence +0:140 Sequence +0:140 move second child to first child ( temp 5-element array of float) +0:140 'a' ( temp 5-element array of float) +0:140 Constant: +0:140 3.400000 +0:140 4.200000 +0:140 5.000000 +0:140 5.200000 +0:140 1.100000 +0:143 Sequence +0:143 Sequence +0:143 move second child to first child ( temp 5-element array of float) +0:143 'a' ( temp 5-element array of float) +0:143 Constant: +0:143 3.400000 +0:143 4.200000 +0:143 5.000000 +0:143 5.200000 +0:143 1.100000 +0:? Sequence +0:149 Sequence +0:149 move second child to first child ( temp 2-element array of 4-component vector of float) +0:149 'b' ( temp 2-element array of 4-component vector of float) +0:149 Constant: +0:149 0.000000 +0:149 0.000000 +0:149 0.000000 +0:149 0.000000 +0:149 0.100000 +0:149 0.100000 +0:149 0.100000 +0:149 0.100000 +0:150 Sequence +0:150 move second child to first child ( temp 3-element array of 2-element array of 4-component vector of float) +0:150 'a3' ( temp 3-element array of 2-element array of 4-component vector of float) +0:150 Construct vec4 ( temp 3-element array of 2-element array of 4-component vector of float) +0:150 'b' ( temp 2-element array of 4-component vector of float) +0:150 'b' ( temp 2-element array of 4-component vector of float) +0:150 'b' ( temp 2-element array of 4-component vector of float) +0:152 Sequence +0:152 move second child to first child ( temp 3-element array of 2-element array of 4-component vector of float) +0:152 'a4' ( temp 3-element array of 2-element array of 4-component vector of float) +0:152 Constant: +0:152 0.000000 +0:152 0.000000 +0:152 0.000000 +0:152 0.000000 +0:152 1.000000 +0:152 1.000000 +0:152 1.000000 +0:152 1.000000 +0:152 0.000000 +0:152 0.000000 +0:152 0.000000 +0:152 0.000000 +0:152 1.000000 +0:152 1.000000 +0:152 1.000000 +0:152 1.000000 +0:152 0.000000 +0:152 0.000000 +0:152 0.000000 +0:152 0.000000 +0:152 1.000000 +0:152 1.000000 +0:152 1.000000 +0:152 1.000000 +0:? Sequence +0:159 Sequence +0:159 Sequence +0:159 move second child to first child ( temp 5-element array of float) +0:159 'b' ( temp 5-element array of float) +0:159 'a' ( temp 5-element array of float) +0:162 Sequence +0:162 Sequence +0:162 move second child to first child ( temp 5-element array of float) +0:162 'b' ( temp 5-element array of float) +0:162 'a' ( temp 5-element array of float) +0:165 Sequence +0:165 Sequence +0:165 move second child to first child ( temp 5-element array of float) +0:165 'b' ( temp 5-element array of float) +0:165 Constant: +0:165 1.000000 +0:165 2.000000 +0:165 3.000000 +0:165 4.000000 +0:165 5.000000 +0:167 Constant: +0:167 5 (const int) +0:? Sequence +0:171 Constant: +0:171 3 (const int) +0:172 Constant: +0:172 2 (const int) +0:175 Constant: +0:175 0.000000 +0:178 Constant: +0:178 0.000000 +0:193 Sequence +0:193 move second child to first child ( temp structure{ temp float a, temp int b}) +0:193 'e' ( temp structure{ temp float a, temp int b}) +0:193 Constant: +0:193 1.200000 +0:193 2 (const int) +0:216 Sequence +0:216 Sequence +0:216 move second child to first child ( temp 5-element array of float) +0:216 'a' ( temp 5-element array of float) +0:216 Constant: +0:216 3.400000 +0:216 4.200000 +0:216 5.000000 +0:216 5.200000 +0:216 1.100000 +0:217 Sequence +0:217 move second child to first child ( temp 5-element array of float) +0:217 'b' ( temp 5-element array of float) +0:217 Constant: +0:217 3.400000 +0:217 4.200000 +0:217 5.000000 +0:217 5.200000 +0:217 1.100000 +0:218 Sequence +0:218 move second child to first child ( temp 5-element array of float) +0:218 'c' ( temp 5-element array of float) +0:218 'a' ( temp 5-element array of float) +0:219 Sequence +0:219 move second child to first child ( temp 5-element array of float) +0:219 'd' ( temp 5-element array of float) +0:219 'b' ( temp 5-element array of float) +0:? Sequence +0:223 Sequence +0:223 move second child to first child ( temp float) +0:223 'ceiling' ( const (read only) float) +0:223 Convert int to float ( temp float) +0:223 add ( temp int) +0:223 'a' ( global int) +0:223 'b' ( global int) +0:? Linker Objects +0:? 'a' ( global int) +0:? 'b' ( global int) +0:? 'c' ( global uint) +0:? 'd' ( global uint) +0:? 'e' ( global int) +0:? 'f' ( global uint) +0:? 'g' ( global int) +0:? 'h' ( global int) +0:? 'i' ( global int) +0:? 'j' ( global int) +0:? 'k' ( global int) +0:? 'l' ( global int) +0:? 'fa' ( global float) +0:? 'fb' ( global float) +0:? 'fc' ( global double) +0:? 'fd' ( global double) +0:? 'texcoord1' ( global 2-component vector of float) +0:? 'texcoord2' ( global 2-component vector of float) +0:? 'position' ( global 3-component vector of float) +0:? 'myRGBA' ( global 4-component vector of float) +0:? 'textureLookup' ( global 2-component vector of int) +0:? 'less' ( global 3-component vector of bool) +0:? 'mat2D' ( global 2X2 matrix of float) +0:? 'optMatrix' ( global 3X3 matrix of float) +0:? 'view' ( global 4X4 matrix of float) +0:? 'projection' ( global 4X4 matrix of float) +0:? 'm' ( global 3X2 matrix of float) +0:? 'highPrecisionMVP' ( global 4X4 matrix of double) +0:? 'dm' ( global 2X4 matrix of double) +0:? 'lightVar' ( global structure{ global float intensity, global 3-component vector of float position}) +0:? 'frequencies' ( global 3-element array of float) +0:? 'lightPosition' ( uniform 4-element array of 4-component vector of float) +0:? 'lights' ( global 2-element array of structure{ global float intensity, global 3-component vector of float position}) +0:? 'numLights' ( const int) +0:? 2 (const int) +0:? 'normal' ( smooth in 3-component vector of float) +0:? 'TexCoord' ( centroid smooth in 2-component vector of float) +0:? 'Color' ( invariant centroid smooth in 4-component vector of float) +0:? 'temperature' ( noperspective in float) +0:? 'myColor' ( flat in 3-component vector of float) +0:? 'myTexCoord' ( centroid noperspective in 2-component vector of float) +0:? 'color' ( uniform 3-component vector of float) +0:? 0.700000 +0:? 0.700000 +0:? 0.200000 +0:? 'anon@0' ( in block{ smooth in 4-component vector of float Color1, smooth in 4-component vector of float Color2, in 2-component vector of float TexCoordA, in float Atten}) +0:? 'anon@1' ( in block{ in 4-component vector of float LightPos, in 3-component vector of float LightColor}) +0:? 'Materiala' ( in block{ in 4-component vector of float Color, in 2-component vector of float TexCoord}) +0:? 'gl_FragCoord' ( gl_FragCoord 4-component vector of float FragCoord) +0:? 'factor' (layout( location=3 index=1) out 4-component vector of float) +0:? 'colors' (layout( location=2) out 3-element array of 4-component vector of float) +0:? 'gl_FragDepth' ( gl_FragDepth float FragDepth) +0:? 'anon@2' ( in block{ in float FogFragCoord gl_FogFragCoord, in unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, flat in 4-component vector of float Color gl_Color, in 4-component vector of float SecondaryColor gl_SecondaryColor}) + + +Linked fragment stage: + + +Shader version: 430 +Requested GL_3DL_array_objects +gl_FragCoord pixel center is integer +gl_FragCoord origin is upper left +using early_fragment_tests +using depth_greater +ERROR: node is still EOpNull! +0:5 Sequence +0:5 move second child to first child ( temp int) +0:5 'a' ( global int) +0:5 Constant: +0:5 -1 (const int) +0:7 Sequence +0:7 move second child to first child ( temp uint) +0:7 'c' ( global uint) +0:7 Constant: +0:7 4294967295 (const uint) +0:8 Sequence +0:8 move second child to first child ( temp uint) +0:8 'd' ( global uint) +0:8 Constant: +0:8 4294967295 (const uint) +0:9 Sequence +0:9 move second child to first child ( temp int) +0:9 'e' ( global int) +0:9 Constant: +0:9 -1 (const int) +0:13 Sequence +0:13 move second child to first child ( temp uint) +0:13 'f' ( global uint) +0:13 Constant: +0:13 4294967295 (const uint) +0:17 Sequence +0:17 move second child to first child ( temp int) +0:17 'g' ( global int) +0:17 Constant: +0:17 -1294967296 (const int) +0:19 Sequence +0:19 move second child to first child ( temp int) +0:19 'h' ( global int) +0:19 Constant: +0:19 -1610612736 (const int) +0:20 Sequence +0:20 move second child to first child ( temp int) +0:20 'i' ( global int) +0:20 Constant: +0:20 -1 (const int) +0:21 Sequence +0:21 move second child to first child ( temp int) +0:21 'j' ( global int) +0:21 Constant: +0:21 -1 (const int) +0:22 Sequence +0:22 move second child to first child ( temp int) +0:22 'k' ( global int) +0:22 Constant: +0:22 -2147483648 (const int) +0:23 Sequence +0:23 move second child to first child ( temp int) +0:23 'l' ( global int) +0:23 Constant: +0:23 -2147483648 (const int) +0:25 Sequence +0:25 move second child to first child ( temp float) +0:25 'fb' ( global float) +0:25 Constant: +0:25 1.500000 +0:26 Sequence +0:26 move second child to first child ( temp double) +0:26 'fd' ( global double) +0:26 Constant: +0:26 2.000000 +0:137 Function Definition: main( ( global void) +0:137 Function Parameters: +0:140 Sequence +0:140 Sequence +0:140 Sequence +0:140 move second child to first child ( temp 5-element array of float) +0:140 'a' ( temp 5-element array of float) +0:140 Constant: +0:140 3.400000 +0:140 4.200000 +0:140 5.000000 +0:140 5.200000 +0:140 1.100000 +0:143 Sequence +0:143 Sequence +0:143 move second child to first child ( temp 5-element array of float) +0:143 'a' ( temp 5-element array of float) +0:143 Constant: +0:143 3.400000 +0:143 4.200000 +0:143 5.000000 +0:143 5.200000 +0:143 1.100000 +0:? Sequence +0:149 Sequence +0:149 move second child to first child ( temp 2-element array of 4-component vector of float) +0:149 'b' ( temp 2-element array of 4-component vector of float) +0:149 Constant: +0:149 0.000000 +0:149 0.000000 +0:149 0.000000 +0:149 0.000000 +0:149 0.100000 +0:149 0.100000 +0:149 0.100000 +0:149 0.100000 +0:150 Sequence +0:150 move second child to first child ( temp 3-element array of 2-element array of 4-component vector of float) +0:150 'a3' ( temp 3-element array of 2-element array of 4-component vector of float) +0:150 Construct vec4 ( temp 3-element array of 2-element array of 4-component vector of float) +0:150 'b' ( temp 2-element array of 4-component vector of float) +0:150 'b' ( temp 2-element array of 4-component vector of float) +0:150 'b' ( temp 2-element array of 4-component vector of float) +0:152 Sequence +0:152 move second child to first child ( temp 3-element array of 2-element array of 4-component vector of float) +0:152 'a4' ( temp 3-element array of 2-element array of 4-component vector of float) +0:152 Constant: +0:152 0.000000 +0:152 0.000000 +0:152 0.000000 +0:152 0.000000 +0:152 1.000000 +0:152 1.000000 +0:152 1.000000 +0:152 1.000000 +0:152 0.000000 +0:152 0.000000 +0:152 0.000000 +0:152 0.000000 +0:152 1.000000 +0:152 1.000000 +0:152 1.000000 +0:152 1.000000 +0:152 0.000000 +0:152 0.000000 +0:152 0.000000 +0:152 0.000000 +0:152 1.000000 +0:152 1.000000 +0:152 1.000000 +0:152 1.000000 +0:? Sequence +0:159 Sequence +0:159 Sequence +0:159 move second child to first child ( temp 5-element array of float) +0:159 'b' ( temp 5-element array of float) +0:159 'a' ( temp 5-element array of float) +0:162 Sequence +0:162 Sequence +0:162 move second child to first child ( temp 5-element array of float) +0:162 'b' ( temp 5-element array of float) +0:162 'a' ( temp 5-element array of float) +0:165 Sequence +0:165 Sequence +0:165 move second child to first child ( temp 5-element array of float) +0:165 'b' ( temp 5-element array of float) +0:165 Constant: +0:165 1.000000 +0:165 2.000000 +0:165 3.000000 +0:165 4.000000 +0:165 5.000000 +0:167 Constant: +0:167 5 (const int) +0:? Sequence +0:171 Constant: +0:171 3 (const int) +0:172 Constant: +0:172 2 (const int) +0:175 Constant: +0:175 0.000000 +0:178 Constant: +0:178 0.000000 +0:193 Sequence +0:193 move second child to first child ( temp structure{ temp float a, temp int b}) +0:193 'e' ( temp structure{ temp float a, temp int b}) +0:193 Constant: +0:193 1.200000 +0:193 2 (const int) +0:216 Sequence +0:216 Sequence +0:216 move second child to first child ( temp 5-element array of float) +0:216 'a' ( temp 5-element array of float) +0:216 Constant: +0:216 3.400000 +0:216 4.200000 +0:216 5.000000 +0:216 5.200000 +0:216 1.100000 +0:217 Sequence +0:217 move second child to first child ( temp 5-element array of float) +0:217 'b' ( temp 5-element array of float) +0:217 Constant: +0:217 3.400000 +0:217 4.200000 +0:217 5.000000 +0:217 5.200000 +0:217 1.100000 +0:218 Sequence +0:218 move second child to first child ( temp 5-element array of float) +0:218 'c' ( temp 5-element array of float) +0:218 'a' ( temp 5-element array of float) +0:219 Sequence +0:219 move second child to first child ( temp 5-element array of float) +0:219 'd' ( temp 5-element array of float) +0:219 'b' ( temp 5-element array of float) +0:? Sequence +0:223 Sequence +0:223 move second child to first child ( temp float) +0:223 'ceiling' ( const (read only) float) +0:223 Convert int to float ( temp float) +0:223 add ( temp int) +0:223 'a' ( global int) +0:223 'b' ( global int) +0:? Linker Objects +0:? 'a' ( global int) +0:? 'b' ( global int) +0:? 'c' ( global uint) +0:? 'd' ( global uint) +0:? 'e' ( global int) +0:? 'f' ( global uint) +0:? 'g' ( global int) +0:? 'h' ( global int) +0:? 'i' ( global int) +0:? 'j' ( global int) +0:? 'k' ( global int) +0:? 'l' ( global int) +0:? 'fa' ( global float) +0:? 'fb' ( global float) +0:? 'fc' ( global double) +0:? 'fd' ( global double) +0:? 'texcoord1' ( global 2-component vector of float) +0:? 'texcoord2' ( global 2-component vector of float) +0:? 'position' ( global 3-component vector of float) +0:? 'myRGBA' ( global 4-component vector of float) +0:? 'textureLookup' ( global 2-component vector of int) +0:? 'less' ( global 3-component vector of bool) +0:? 'mat2D' ( global 2X2 matrix of float) +0:? 'optMatrix' ( global 3X3 matrix of float) +0:? 'view' ( global 4X4 matrix of float) +0:? 'projection' ( global 4X4 matrix of float) +0:? 'm' ( global 3X2 matrix of float) +0:? 'highPrecisionMVP' ( global 4X4 matrix of double) +0:? 'dm' ( global 2X4 matrix of double) +0:? 'lightVar' ( global structure{ global float intensity, global 3-component vector of float position}) +0:? 'frequencies' ( global 3-element array of float) +0:? 'lightPosition' ( uniform 4-element array of 4-component vector of float) +0:? 'lights' ( global 2-element array of structure{ global float intensity, global 3-component vector of float position}) +0:? 'numLights' ( const int) +0:? 2 (const int) +0:? 'normal' ( smooth in 3-component vector of float) +0:? 'TexCoord' ( centroid smooth in 2-component vector of float) +0:? 'Color' ( invariant centroid smooth in 4-component vector of float) +0:? 'temperature' ( noperspective in float) +0:? 'myColor' ( flat in 3-component vector of float) +0:? 'myTexCoord' ( centroid noperspective in 2-component vector of float) +0:? 'color' ( uniform 3-component vector of float) +0:? 0.700000 +0:? 0.700000 +0:? 0.200000 +0:? 'anon@0' ( in block{ smooth in 4-component vector of float Color1, smooth in 4-component vector of float Color2, in 2-component vector of float TexCoordA, in float Atten}) +0:? 'anon@1' ( in block{ in 4-component vector of float LightPos, in 3-component vector of float LightColor}) +0:? 'Materiala' ( in block{ in 4-component vector of float Color, in 2-component vector of float TexCoord}) +0:? 'gl_FragCoord' ( gl_FragCoord 4-component vector of float FragCoord) +0:? 'factor' (layout( location=3 index=1) out 4-component vector of float) +0:? 'colors' (layout( location=2) out 3-element array of 4-component vector of float) +0:? 'gl_FragDepth' ( gl_FragDepth float FragDepth) +0:? 'anon@2' ( in block{ in float FogFragCoord gl_FogFragCoord, in 1-element array of 4-component vector of float TexCoord gl_TexCoord, flat in 4-component vector of float Color gl_Color, in 4-component vector of float SecondaryColor gl_SecondaryColor}) + diff --git a/deps/glslang/Test/baseResults/specExamples.vert.out b/deps/glslang/Test/baseResults/specExamples.vert.out new file mode 100644 index 00000000..5c8ca391 --- /dev/null +++ b/deps/glslang/Test/baseResults/specExamples.vert.out @@ -0,0 +1,598 @@ +specExamples.vert +ERROR: 0:29: 'location' : can only apply to uniform, buffer, in, or out storage qualifiers +ERROR: 0:31: 'triangles' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:31: 'invocations' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:33: 'lines' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:35: 'triangle_strip' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:35: 'max_vertices' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:36: 'max_vertices' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:37: 'triangle_strip' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:41: 'stream' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:43: 'stream' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:45: 'stream' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:46: 'stream' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:47: 'stream' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:50: 'stream' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:55: 'stream' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:80: 's17' : redefinition +ERROR: 0:85: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings +ERROR: 0:87: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings +ERROR: 0:89: 'binding' : atomic_uint binding is too large +ERROR: 0:91: 'bar' : redefinition +ERROR: 0:94: 'a2' : redefinition +ERROR: 0:95: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings +ERROR: 0:96: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings +ERROR: 0:97: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings +ERROR: 0:106: '' : vertex input cannot be further qualified +ERROR: 0:106: 'redeclaration' : cannot change storage, memory, or auxiliary qualification of gl_FrontColor +ERROR: 0:112: 'ColorIvn' : identifier not previously declared +ERROR: 0:132: 'shared' : not supported in this stage: vertex +ERROR: 0:134: '' : function does not return a value: funcA +ERROR: 0:136: '' : function does not return a value: funcB +ERROR: 0:153: '' : function does not return a value: func3 +ERROR: 0:170: 'coherent' : argument cannot drop memory qualifier when passed to formal parameter +ERROR: 32 compilation errors. No code generated. + + +Shader version: 430 +Requested GL_3DL_array_objects +ERROR: node is still EOpNull! +0:134 Function Definition: funcA(I21; ( global 4-component vector of float) +0:134 Function Parameters: +0:134 'a' ( restrict in image2D) +0:136 Function Definition: funcB(I21; ( global 4-component vector of float) +0:136 Function Parameters: +0:136 'a' ( in image2D) +0:140 Function Definition: func(f1;f1;f1;f1; ( global float) +0:140 Function Parameters: +0:140 'e' ( in float) +0:140 'f' ( in float) +0:140 'g' ( in float) +0:140 'h' ( in float) +0:142 Sequence +0:142 Branch: Return with expression +0:142 add ( temp float) +0:142 component-wise multiply ( temp float) +0:142 'e' ( in float) +0:142 'f' ( in float) +0:142 component-wise multiply ( temp float) +0:142 'g' ( in float) +0:142 'h' ( in float) +0:146 Function Definition: func2(f1;f1;f1;f1; ( global float) +0:146 Function Parameters: +0:146 'e' ( in float) +0:146 'f' ( in float) +0:146 'g' ( in float) +0:146 'h' ( in float) +0:148 Sequence +0:148 Sequence +0:148 move second child to first child ( temp float) +0:148 'result' ( noContraction temp float) +0:148 add ( temp float) +0:148 component-wise multiply ( temp float) +0:148 'e' ( in float) +0:148 'f' ( in float) +0:148 component-wise multiply ( temp float) +0:148 'g' ( in float) +0:148 'h' ( in float) +0:150 Branch: Return with expression +0:150 'result' ( noContraction temp float) +0:153 Function Definition: func3(f1;f1;f1; ( global float) +0:153 Function Parameters: +0:153 'i' ( in float) +0:153 'j' ( in float) +0:153 'k' ( noContraction out float) +0:155 Sequence +0:155 move second child to first child ( temp float) +0:155 'k' ( noContraction out float) +0:155 add ( temp float) +0:155 component-wise multiply ( temp float) +0:155 'i' ( in float) +0:155 'i' ( in float) +0:155 'j' ( in float) +0:158 Function Definition: main( ( global void) +0:158 Function Parameters: +0:160 Sequence +0:160 Sequence +0:160 move second child to first child ( temp 3-component vector of float) +0:160 'r' ( temp 3-component vector of float) +0:160 Construct vec3 ( temp 3-component vector of float) +0:160 component-wise multiply ( temp 4-component vector of float) +0:160 'a' ( in 4-component vector of float) +0:160 'b' ( in 4-component vector of float) +0:161 Sequence +0:161 move second child to first child ( temp 3-component vector of float) +0:161 's' ( temp 3-component vector of float) +0:161 Construct vec3 ( temp 3-component vector of float) +0:161 component-wise multiply ( temp 4-component vector of float) +0:161 'c' ( in 4-component vector of float) +0:161 'd' ( in 4-component vector of float) +0:162 move second child to first child ( temp 3-component vector of float) +0:162 vector swizzle ( noContraction temp 3-component vector of float) +0:162 'v' ( noContraction smooth out 4-component vector of float) +0:162 Sequence +0:162 Constant: +0:162 0 (const int) +0:162 Constant: +0:162 1 (const int) +0:162 Constant: +0:162 2 (const int) +0:162 add ( temp 3-component vector of float) +0:162 'r' ( temp 3-component vector of float) +0:162 's' ( temp 3-component vector of float) +0:163 move second child to first child ( temp float) +0:163 direct index ( noContraction temp float) +0:163 'v' ( noContraction smooth out 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 add ( temp float) +0:163 component-wise multiply ( temp float) +0:163 direct index ( temp float) +0:163 'a' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 direct index ( temp float) +0:163 'b' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 component-wise multiply ( temp float) +0:163 direct index ( temp float) +0:163 'c' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 direct index ( temp float) +0:163 'd' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:164 move second child to first child ( temp float) +0:164 direct index ( noContraction temp float) +0:164 'v' ( noContraction smooth out 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 Function Call: func(f1;f1;f1;f1; ( global float) +0:164 direct index ( temp float) +0:164 'a' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 direct index ( temp float) +0:164 'b' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 direct index ( temp float) +0:164 'c' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 direct index ( temp float) +0:164 'd' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:166 move second child to first child ( temp float) +0:166 direct index ( noContraction temp float) +0:166 'v' ( noContraction smooth out 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 Function Call: func2(f1;f1;f1;f1; ( global float) +0:166 direct index ( temp float) +0:166 'a' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 direct index ( temp float) +0:166 'b' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 direct index ( temp float) +0:166 'c' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 direct index ( temp float) +0:166 'd' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:167 Function Call: func3(f1;f1;f1; ( global float) +0:167 component-wise multiply ( temp float) +0:167 direct index ( temp float) +0:167 'a' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 direct index ( temp float) +0:167 'b' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 component-wise multiply ( temp float) +0:167 direct index ( temp float) +0:167 'c' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 direct index ( temp float) +0:167 'd' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 direct index ( noContraction temp float) +0:167 'v' ( noContraction smooth out 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:169 Function Call: funcA(I21; ( global 4-component vector of float) +0:169 'img1' (layout( rgba32f) uniform image2D) +0:170 Function Call: funcB(I21; ( global 4-component vector of float) +0:170 'img2' (layout( rgba32f) coherent uniform image2D) +0:? Sequence +0:178 Sequence +0:178 move second child to first child ( temp structure{ temp float intensity, temp 3-component vector of float position}) +0:178 'lightVar' ( temp structure{ temp float intensity, temp 3-component vector of float position}) +0:178 Constant: +0:178 3.000000 +0:178 1.000000 +0:178 2.000000 +0:178 3.000000 +0:? Sequence +0:185 Sequence +0:185 move second child to first child ( temp 5-element array of float) +0:185 'a' ( temp 5-element array of float) +0:185 Construct float ( temp 5-element array of float) +0:185 'g' ( temp float) +0:185 Constant: +0:185 1.000000 +0:185 'g' ( temp float) +0:185 Constant: +0:185 2.300000 +0:185 'g' ( temp float) +0:188 move second child to first child ( temp 3-element array of float) +0:188 'b' ( temp 3-element array of float) +0:188 Construct float ( temp 3-element array of float) +0:188 'g' ( temp float) +0:188 add ( temp float) +0:188 'g' ( temp float) +0:188 Constant: +0:188 1.000000 +0:188 add ( temp float) +0:188 'g' ( temp float) +0:188 Constant: +0:188 2.000000 +0:191 Sequence +0:191 Sequence +0:191 move second child to first child ( temp 2-element array of 4-component vector of float) +0:191 'b' ( temp 2-element array of 4-component vector of float) +0:191 Constant: +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:192 Construct vec4 ( temp 3-element array of 2-element array of 4-component vector of float) +0:192 'b' ( temp 2-element array of 4-component vector of float) +0:192 'b' ( temp 2-element array of 4-component vector of float) +0:192 'b' ( temp 2-element array of 4-component vector of float) +0:193 Construct vec4 ( temp 3-element array of 2-element array of 4-component vector of float) +0:193 'b' ( temp 2-element array of 4-component vector of float) +0:193 'b' ( temp 2-element array of 4-component vector of float) +0:193 'b' ( temp 2-element array of 4-component vector of float) +0:194 Construct vec4 ( temp 3-element array of 2-element array of 4-component vector of float) +0:194 'b' ( temp 2-element array of 4-component vector of float) +0:194 'b' ( temp 2-element array of 4-component vector of float) +0:194 'b' ( temp 2-element array of 4-component vector of float) +0:? Linker Objects +0:? 'Coords' ( out block{ out 4-component vector of float Position, out 2-component vector of float Texture}) +0:? 'anon@0' ( out block{ out 4-component vector of float Color}) +0:? 'transforms' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform 4X4 matrix of float ModelViewMatrix, layout( column_major shared) uniform 4X4 matrix of float ModelViewProjectionMatrix, layout( column_major shared) uniform unsized 1-element array of 4-component vector of float a, layout( column_major shared) uniform float Deformation}) +0:? 'normal' (layout( location=3) in 4-component vector of float) +0:? 'colors' (layout( location=6) in 3-element array of 4-component vector of float) +0:? 'transforms2' (layout( location=9) in 2-element array of 4X4 matrix of float) +0:? 's' (layout( location=3) temp structure{ global 3-component vector of float a1, global 2X2 matrix of float b, global 2-element array of 4-component vector of float c}) +0:? 'var1' ( smooth out 4-component vector of float) +0:? 'anon@1' ( out block{ out 4-component vector of float var2, out 2-component vector of float var3, out 3-component vector of float var4}) +0:? 'var5' ( smooth out 4-component vector of float) +0:? 'anon@2' ( out block{ out 4-component vector of float var6}) +0:? 'var7' ( smooth out 4-component vector of float) +0:? 'anon@3' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform 4X4 matrix of float M1, layout( column_major std140 offset=64) uniform 4X4 matrix of float M2, layout( row_major std140 offset=128) uniform 3X3 matrix of float N1}) +0:? 'anon@4' (layout( column_major shared) uniform block{layout( column_major shared) uniform 4X4 matrix of float M13, layout( row_major shared) uniform 4X4 matrix of float m14, layout( column_major shared) uniform 3X3 matrix of float N12}) +0:? 's17' (layout( binding=3) uniform sampler2D) +0:? 'a2' (layout( binding=2 offset=4) uniform atomic_uint) +0:? 'bar' (layout( binding=2) uniform atomic_uint) +0:? 'bar23' (layout( offset=8) uniform atomic_uint) +0:? 'b2' (layout( binding=2) uniform atomic_uint) +0:? 'c2' (layout( binding=3) uniform atomic_uint) +0:? 'd2' (layout( binding=2) uniform atomic_uint) +0:? 'anon@5' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, flat out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'ColorInv' ( smooth out 3-component vector of float) +0:? 'Color4' ( invariant centroid smooth out 3-component vector of float) +0:? 'position' ( noContraction smooth out 4-component vector of float) +0:? 'Color5' ( noContraction smooth out 3-component vector of float) +0:? 'a' ( in 4-component vector of float) +0:? 'b' ( in 4-component vector of float) +0:? 'c' ( in 4-component vector of float) +0:? 'd' ( in 4-component vector of float) +0:? 'v' ( noContraction smooth out 4-component vector of float) +0:? 'anon@6' (layout( column_major shared) coherent buffer block{layout( column_major shared) readonly buffer 4-component vector of float member1, layout( column_major shared) buffer 4-component vector of float member2}) +0:? 'anon@7' (layout( column_major shared) buffer block{layout( column_major shared) coherent readonly buffer 4-component vector of float member1A, layout( column_major shared) coherent buffer 4-component vector of float member2A}) +0:? 'shv' ( shared 4-component vector of float) +0:? 'img1' (layout( rgba32f) uniform image2D) +0:? 'img2' (layout( rgba32f) coherent uniform image2D) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 430 +Requested GL_3DL_array_objects +ERROR: node is still EOpNull! +0:134 Function Definition: funcA(I21; ( global 4-component vector of float) +0:134 Function Parameters: +0:134 'a' ( restrict in image2D) +0:136 Function Definition: funcB(I21; ( global 4-component vector of float) +0:136 Function Parameters: +0:136 'a' ( in image2D) +0:140 Function Definition: func(f1;f1;f1;f1; ( global float) +0:140 Function Parameters: +0:140 'e' ( in float) +0:140 'f' ( in float) +0:140 'g' ( in float) +0:140 'h' ( in float) +0:142 Sequence +0:142 Branch: Return with expression +0:142 add ( temp float) +0:142 component-wise multiply ( temp float) +0:142 'e' ( in float) +0:142 'f' ( in float) +0:142 component-wise multiply ( temp float) +0:142 'g' ( in float) +0:142 'h' ( in float) +0:146 Function Definition: func2(f1;f1;f1;f1; ( global float) +0:146 Function Parameters: +0:146 'e' ( in float) +0:146 'f' ( in float) +0:146 'g' ( in float) +0:146 'h' ( in float) +0:148 Sequence +0:148 Sequence +0:148 move second child to first child ( temp float) +0:148 'result' ( noContraction temp float) +0:148 add ( temp float) +0:148 component-wise multiply ( temp float) +0:148 'e' ( in float) +0:148 'f' ( in float) +0:148 component-wise multiply ( temp float) +0:148 'g' ( in float) +0:148 'h' ( in float) +0:150 Branch: Return with expression +0:150 'result' ( noContraction temp float) +0:153 Function Definition: func3(f1;f1;f1; ( global float) +0:153 Function Parameters: +0:153 'i' ( in float) +0:153 'j' ( in float) +0:153 'k' ( noContraction out float) +0:155 Sequence +0:155 move second child to first child ( temp float) +0:155 'k' ( noContraction out float) +0:155 add ( temp float) +0:155 component-wise multiply ( temp float) +0:155 'i' ( in float) +0:155 'i' ( in float) +0:155 'j' ( in float) +0:158 Function Definition: main( ( global void) +0:158 Function Parameters: +0:160 Sequence +0:160 Sequence +0:160 move second child to first child ( temp 3-component vector of float) +0:160 'r' ( temp 3-component vector of float) +0:160 Construct vec3 ( temp 3-component vector of float) +0:160 component-wise multiply ( temp 4-component vector of float) +0:160 'a' ( in 4-component vector of float) +0:160 'b' ( in 4-component vector of float) +0:161 Sequence +0:161 move second child to first child ( temp 3-component vector of float) +0:161 's' ( temp 3-component vector of float) +0:161 Construct vec3 ( temp 3-component vector of float) +0:161 component-wise multiply ( temp 4-component vector of float) +0:161 'c' ( in 4-component vector of float) +0:161 'd' ( in 4-component vector of float) +0:162 move second child to first child ( temp 3-component vector of float) +0:162 vector swizzle ( noContraction temp 3-component vector of float) +0:162 'v' ( noContraction smooth out 4-component vector of float) +0:162 Sequence +0:162 Constant: +0:162 0 (const int) +0:162 Constant: +0:162 1 (const int) +0:162 Constant: +0:162 2 (const int) +0:162 add ( temp 3-component vector of float) +0:162 'r' ( temp 3-component vector of float) +0:162 's' ( temp 3-component vector of float) +0:163 move second child to first child ( temp float) +0:163 direct index ( noContraction temp float) +0:163 'v' ( noContraction smooth out 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 add ( temp float) +0:163 component-wise multiply ( temp float) +0:163 direct index ( temp float) +0:163 'a' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 direct index ( temp float) +0:163 'b' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 component-wise multiply ( temp float) +0:163 direct index ( temp float) +0:163 'c' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 direct index ( temp float) +0:163 'd' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:164 move second child to first child ( temp float) +0:164 direct index ( noContraction temp float) +0:164 'v' ( noContraction smooth out 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 Function Call: func(f1;f1;f1;f1; ( global float) +0:164 direct index ( temp float) +0:164 'a' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 direct index ( temp float) +0:164 'b' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 direct index ( temp float) +0:164 'c' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 direct index ( temp float) +0:164 'd' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:166 move second child to first child ( temp float) +0:166 direct index ( noContraction temp float) +0:166 'v' ( noContraction smooth out 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 Function Call: func2(f1;f1;f1;f1; ( global float) +0:166 direct index ( temp float) +0:166 'a' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 direct index ( temp float) +0:166 'b' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 direct index ( temp float) +0:166 'c' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 direct index ( temp float) +0:166 'd' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:167 Function Call: func3(f1;f1;f1; ( global float) +0:167 component-wise multiply ( temp float) +0:167 direct index ( temp float) +0:167 'a' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 direct index ( temp float) +0:167 'b' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 component-wise multiply ( temp float) +0:167 direct index ( temp float) +0:167 'c' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 direct index ( temp float) +0:167 'd' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 direct index ( noContraction temp float) +0:167 'v' ( noContraction smooth out 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:169 Function Call: funcA(I21; ( global 4-component vector of float) +0:169 'img1' (layout( rgba32f) uniform image2D) +0:170 Function Call: funcB(I21; ( global 4-component vector of float) +0:170 'img2' (layout( rgba32f) coherent uniform image2D) +0:? Sequence +0:178 Sequence +0:178 move second child to first child ( temp structure{ temp float intensity, temp 3-component vector of float position}) +0:178 'lightVar' ( temp structure{ temp float intensity, temp 3-component vector of float position}) +0:178 Constant: +0:178 3.000000 +0:178 1.000000 +0:178 2.000000 +0:178 3.000000 +0:? Sequence +0:185 Sequence +0:185 move second child to first child ( temp 5-element array of float) +0:185 'a' ( temp 5-element array of float) +0:185 Construct float ( temp 5-element array of float) +0:185 'g' ( temp float) +0:185 Constant: +0:185 1.000000 +0:185 'g' ( temp float) +0:185 Constant: +0:185 2.300000 +0:185 'g' ( temp float) +0:188 move second child to first child ( temp 3-element array of float) +0:188 'b' ( temp 3-element array of float) +0:188 Construct float ( temp 3-element array of float) +0:188 'g' ( temp float) +0:188 add ( temp float) +0:188 'g' ( temp float) +0:188 Constant: +0:188 1.000000 +0:188 add ( temp float) +0:188 'g' ( temp float) +0:188 Constant: +0:188 2.000000 +0:191 Sequence +0:191 Sequence +0:191 move second child to first child ( temp 2-element array of 4-component vector of float) +0:191 'b' ( temp 2-element array of 4-component vector of float) +0:191 Constant: +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:192 Construct vec4 ( temp 3-element array of 2-element array of 4-component vector of float) +0:192 'b' ( temp 2-element array of 4-component vector of float) +0:192 'b' ( temp 2-element array of 4-component vector of float) +0:192 'b' ( temp 2-element array of 4-component vector of float) +0:193 Construct vec4 ( temp 3-element array of 2-element array of 4-component vector of float) +0:193 'b' ( temp 2-element array of 4-component vector of float) +0:193 'b' ( temp 2-element array of 4-component vector of float) +0:193 'b' ( temp 2-element array of 4-component vector of float) +0:194 Construct vec4 ( temp 3-element array of 2-element array of 4-component vector of float) +0:194 'b' ( temp 2-element array of 4-component vector of float) +0:194 'b' ( temp 2-element array of 4-component vector of float) +0:194 'b' ( temp 2-element array of 4-component vector of float) +0:? Linker Objects +0:? 'Coords' ( out block{ out 4-component vector of float Position, out 2-component vector of float Texture}) +0:? 'anon@0' ( out block{ out 4-component vector of float Color}) +0:? 'transforms' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform 4X4 matrix of float ModelViewMatrix, layout( column_major shared) uniform 4X4 matrix of float ModelViewProjectionMatrix, layout( column_major shared) uniform 1-element array of 4-component vector of float a, layout( column_major shared) uniform float Deformation}) +0:? 'normal' (layout( location=3) in 4-component vector of float) +0:? 'colors' (layout( location=6) in 3-element array of 4-component vector of float) +0:? 'transforms2' (layout( location=9) in 2-element array of 4X4 matrix of float) +0:? 's' (layout( location=3) temp structure{ global 3-component vector of float a1, global 2X2 matrix of float b, global 2-element array of 4-component vector of float c}) +0:? 'var1' ( smooth out 4-component vector of float) +0:? 'anon@1' ( out block{ out 4-component vector of float var2, out 2-component vector of float var3, out 3-component vector of float var4}) +0:? 'var5' ( smooth out 4-component vector of float) +0:? 'anon@2' ( out block{ out 4-component vector of float var6}) +0:? 'var7' ( smooth out 4-component vector of float) +0:? 'anon@3' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform 4X4 matrix of float M1, layout( column_major std140 offset=64) uniform 4X4 matrix of float M2, layout( row_major std140 offset=128) uniform 3X3 matrix of float N1}) +0:? 'anon@4' (layout( column_major shared) uniform block{layout( column_major shared) uniform 4X4 matrix of float M13, layout( row_major shared) uniform 4X4 matrix of float m14, layout( column_major shared) uniform 3X3 matrix of float N12}) +0:? 's17' (layout( binding=3) uniform sampler2D) +0:? 'a2' (layout( binding=2 offset=4) uniform atomic_uint) +0:? 'bar' (layout( binding=2) uniform atomic_uint) +0:? 'bar23' (layout( offset=8) uniform atomic_uint) +0:? 'b2' (layout( binding=2) uniform atomic_uint) +0:? 'c2' (layout( binding=3) uniform atomic_uint) +0:? 'd2' (layout( binding=2) uniform atomic_uint) +0:? 'anon@5' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, flat out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'ColorInv' ( smooth out 3-component vector of float) +0:? 'Color4' ( invariant centroid smooth out 3-component vector of float) +0:? 'position' ( noContraction smooth out 4-component vector of float) +0:? 'Color5' ( noContraction smooth out 3-component vector of float) +0:? 'a' ( in 4-component vector of float) +0:? 'b' ( in 4-component vector of float) +0:? 'c' ( in 4-component vector of float) +0:? 'd' ( in 4-component vector of float) +0:? 'v' ( noContraction smooth out 4-component vector of float) +0:? 'anon@6' (layout( column_major shared) coherent buffer block{layout( column_major shared) readonly buffer 4-component vector of float member1, layout( column_major shared) buffer 4-component vector of float member2}) +0:? 'anon@7' (layout( column_major shared) buffer block{layout( column_major shared) coherent readonly buffer 4-component vector of float member1A, layout( column_major shared) coherent buffer 4-component vector of float member2A}) +0:? 'shv' ( shared 4-component vector of float) +0:? 'img1' (layout( rgba32f) uniform image2D) +0:? 'img2' (layout( rgba32f) coherent uniform image2D) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/specExamplesConf.vert.out b/deps/glslang/Test/baseResults/specExamplesConf.vert.out new file mode 100644 index 00000000..e7217817 --- /dev/null +++ b/deps/glslang/Test/baseResults/specExamplesConf.vert.out @@ -0,0 +1,599 @@ +specExamples.vert +ERROR: 0:29: 'location' : can only apply to uniform, buffer, in, or out storage qualifiers +ERROR: 0:31: 'triangles' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:31: 'invocations' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:33: 'lines' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:35: 'triangle_strip' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:35: 'max_vertices' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:36: 'max_vertices' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:37: 'triangle_strip' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:41: 'stream' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:43: 'stream' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:45: 'stream' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:46: 'stream' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:47: 'stream' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:50: 'stream' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:55: 'stream' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:80: 's17' : redefinition +ERROR: 0:85: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings +ERROR: 0:87: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings +ERROR: 0:89: 'binding' : atomic_uint binding is too large +ERROR: 0:91: 'bar' : redefinition +ERROR: 0:92: 'atomic_uint' : layout(binding=X) is required +ERROR: 0:94: 'a2' : redefinition +ERROR: 0:95: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings +ERROR: 0:96: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings +ERROR: 0:97: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings +ERROR: 0:106: '' : vertex input cannot be further qualified +ERROR: 0:106: 'redeclaration' : cannot change storage, memory, or auxiliary qualification of gl_FrontColor +ERROR: 0:112: 'ColorIvn' : identifier not previously declared +ERROR: 0:132: 'shared' : not supported in this stage: vertex +ERROR: 0:134: '' : function does not return a value: funcA +ERROR: 0:136: '' : function does not return a value: funcB +ERROR: 0:153: '' : function does not return a value: func3 +ERROR: 0:170: 'coherent' : argument cannot drop memory qualifier when passed to formal parameter +ERROR: 33 compilation errors. No code generated. + + +Shader version: 430 +Requested GL_3DL_array_objects +ERROR: node is still EOpNull! +0:134 Function Definition: funcA(I21; ( global 4-component vector of float) +0:134 Function Parameters: +0:134 'a' ( restrict in image2D) +0:136 Function Definition: funcB(I21; ( global 4-component vector of float) +0:136 Function Parameters: +0:136 'a' ( in image2D) +0:140 Function Definition: func(f1;f1;f1;f1; ( global float) +0:140 Function Parameters: +0:140 'e' ( in float) +0:140 'f' ( in float) +0:140 'g' ( in float) +0:140 'h' ( in float) +0:142 Sequence +0:142 Branch: Return with expression +0:142 add ( temp float) +0:142 component-wise multiply ( temp float) +0:142 'e' ( in float) +0:142 'f' ( in float) +0:142 component-wise multiply ( temp float) +0:142 'g' ( in float) +0:142 'h' ( in float) +0:146 Function Definition: func2(f1;f1;f1;f1; ( global float) +0:146 Function Parameters: +0:146 'e' ( in float) +0:146 'f' ( in float) +0:146 'g' ( in float) +0:146 'h' ( in float) +0:148 Sequence +0:148 Sequence +0:148 move second child to first child ( temp float) +0:148 'result' ( noContraction temp float) +0:148 add ( temp float) +0:148 component-wise multiply ( temp float) +0:148 'e' ( in float) +0:148 'f' ( in float) +0:148 component-wise multiply ( temp float) +0:148 'g' ( in float) +0:148 'h' ( in float) +0:150 Branch: Return with expression +0:150 'result' ( noContraction temp float) +0:153 Function Definition: func3(f1;f1;f1; ( global float) +0:153 Function Parameters: +0:153 'i' ( in float) +0:153 'j' ( in float) +0:153 'k' ( noContraction out float) +0:155 Sequence +0:155 move second child to first child ( temp float) +0:155 'k' ( noContraction out float) +0:155 add ( temp float) +0:155 component-wise multiply ( temp float) +0:155 'i' ( in float) +0:155 'i' ( in float) +0:155 'j' ( in float) +0:158 Function Definition: main( ( global void) +0:158 Function Parameters: +0:160 Sequence +0:160 Sequence +0:160 move second child to first child ( temp 3-component vector of float) +0:160 'r' ( temp 3-component vector of float) +0:160 Construct vec3 ( temp 3-component vector of float) +0:160 component-wise multiply ( temp 4-component vector of float) +0:160 'a' ( in 4-component vector of float) +0:160 'b' ( in 4-component vector of float) +0:161 Sequence +0:161 move second child to first child ( temp 3-component vector of float) +0:161 's' ( temp 3-component vector of float) +0:161 Construct vec3 ( temp 3-component vector of float) +0:161 component-wise multiply ( temp 4-component vector of float) +0:161 'c' ( in 4-component vector of float) +0:161 'd' ( in 4-component vector of float) +0:162 move second child to first child ( temp 3-component vector of float) +0:162 vector swizzle ( noContraction temp 3-component vector of float) +0:162 'v' ( noContraction smooth out 4-component vector of float) +0:162 Sequence +0:162 Constant: +0:162 0 (const int) +0:162 Constant: +0:162 1 (const int) +0:162 Constant: +0:162 2 (const int) +0:162 add ( temp 3-component vector of float) +0:162 'r' ( temp 3-component vector of float) +0:162 's' ( temp 3-component vector of float) +0:163 move second child to first child ( temp float) +0:163 direct index ( noContraction temp float) +0:163 'v' ( noContraction smooth out 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 add ( temp float) +0:163 component-wise multiply ( temp float) +0:163 direct index ( temp float) +0:163 'a' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 direct index ( temp float) +0:163 'b' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 component-wise multiply ( temp float) +0:163 direct index ( temp float) +0:163 'c' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 direct index ( temp float) +0:163 'd' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:164 move second child to first child ( temp float) +0:164 direct index ( noContraction temp float) +0:164 'v' ( noContraction smooth out 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 Function Call: func(f1;f1;f1;f1; ( global float) +0:164 direct index ( temp float) +0:164 'a' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 direct index ( temp float) +0:164 'b' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 direct index ( temp float) +0:164 'c' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 direct index ( temp float) +0:164 'd' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:166 move second child to first child ( temp float) +0:166 direct index ( noContraction temp float) +0:166 'v' ( noContraction smooth out 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 Function Call: func2(f1;f1;f1;f1; ( global float) +0:166 direct index ( temp float) +0:166 'a' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 direct index ( temp float) +0:166 'b' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 direct index ( temp float) +0:166 'c' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 direct index ( temp float) +0:166 'd' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:167 Function Call: func3(f1;f1;f1; ( global float) +0:167 component-wise multiply ( temp float) +0:167 direct index ( temp float) +0:167 'a' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 direct index ( temp float) +0:167 'b' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 component-wise multiply ( temp float) +0:167 direct index ( temp float) +0:167 'c' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 direct index ( temp float) +0:167 'd' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 direct index ( noContraction temp float) +0:167 'v' ( noContraction smooth out 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:169 Function Call: funcA(I21; ( global 4-component vector of float) +0:169 'img1' (layout( rgba32f) uniform image2D) +0:170 Function Call: funcB(I21; ( global 4-component vector of float) +0:170 'img2' (layout( rgba32f) coherent uniform image2D) +0:? Sequence +0:178 Sequence +0:178 move second child to first child ( temp structure{ temp float intensity, temp 3-component vector of float position}) +0:178 'lightVar' ( temp structure{ temp float intensity, temp 3-component vector of float position}) +0:178 Constant: +0:178 3.000000 +0:178 1.000000 +0:178 2.000000 +0:178 3.000000 +0:? Sequence +0:185 Sequence +0:185 move second child to first child ( temp 5-element array of float) +0:185 'a' ( temp 5-element array of float) +0:185 Construct float ( temp 5-element array of float) +0:185 'g' ( temp float) +0:185 Constant: +0:185 1.000000 +0:185 'g' ( temp float) +0:185 Constant: +0:185 2.300000 +0:185 'g' ( temp float) +0:188 move second child to first child ( temp 3-element array of float) +0:188 'b' ( temp 3-element array of float) +0:188 Construct float ( temp 3-element array of float) +0:188 'g' ( temp float) +0:188 add ( temp float) +0:188 'g' ( temp float) +0:188 Constant: +0:188 1.000000 +0:188 add ( temp float) +0:188 'g' ( temp float) +0:188 Constant: +0:188 2.000000 +0:191 Sequence +0:191 Sequence +0:191 move second child to first child ( temp 2-element array of 4-component vector of float) +0:191 'b' ( temp 2-element array of 4-component vector of float) +0:191 Constant: +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:192 Construct vec4 ( temp 3-element array of 2-element array of 4-component vector of float) +0:192 'b' ( temp 2-element array of 4-component vector of float) +0:192 'b' ( temp 2-element array of 4-component vector of float) +0:192 'b' ( temp 2-element array of 4-component vector of float) +0:193 Construct vec4 ( temp 3-element array of 2-element array of 4-component vector of float) +0:193 'b' ( temp 2-element array of 4-component vector of float) +0:193 'b' ( temp 2-element array of 4-component vector of float) +0:193 'b' ( temp 2-element array of 4-component vector of float) +0:194 Construct vec4 ( temp 3-element array of 2-element array of 4-component vector of float) +0:194 'b' ( temp 2-element array of 4-component vector of float) +0:194 'b' ( temp 2-element array of 4-component vector of float) +0:194 'b' ( temp 2-element array of 4-component vector of float) +0:? Linker Objects +0:? 'Coords' ( out block{ out 4-component vector of float Position, out 2-component vector of float Texture}) +0:? 'anon@0' ( out block{ out 4-component vector of float Color}) +0:? 'transforms' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform 4X4 matrix of float ModelViewMatrix, layout( column_major shared) uniform 4X4 matrix of float ModelViewProjectionMatrix, layout( column_major shared) uniform unsized 1-element array of 4-component vector of float a, layout( column_major shared) uniform float Deformation}) +0:? 'normal' (layout( location=3) in 4-component vector of float) +0:? 'colors' (layout( location=6) in 3-element array of 4-component vector of float) +0:? 'transforms2' (layout( location=9) in 2-element array of 4X4 matrix of float) +0:? 's' (layout( location=3) temp structure{ global 3-component vector of float a1, global 2X2 matrix of float b, global 2-element array of 4-component vector of float c}) +0:? 'var1' ( smooth out 4-component vector of float) +0:? 'anon@1' ( out block{ out 4-component vector of float var2, out 2-component vector of float var3, out 3-component vector of float var4}) +0:? 'var5' ( smooth out 4-component vector of float) +0:? 'anon@2' ( out block{ out 4-component vector of float var6}) +0:? 'var7' ( smooth out 4-component vector of float) +0:? 'anon@3' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform 4X4 matrix of float M1, layout( column_major std140 offset=64) uniform 4X4 matrix of float M2, layout( row_major std140 offset=128) uniform 3X3 matrix of float N1}) +0:? 'anon@4' (layout( column_major shared) uniform block{layout( column_major shared) uniform 4X4 matrix of float M13, layout( row_major shared) uniform 4X4 matrix of float m14, layout( column_major shared) uniform 3X3 matrix of float N12}) +0:? 's17' (layout( binding=3) uniform sampler2D) +0:? 'a2' (layout( binding=2 offset=4) uniform atomic_uint) +0:? 'bar' (layout( binding=2) uniform atomic_uint) +0:? 'bar23' (layout( offset=8) uniform atomic_uint) +0:? 'b2' (layout( binding=2) uniform atomic_uint) +0:? 'c2' (layout( binding=3) uniform atomic_uint) +0:? 'd2' (layout( binding=2) uniform atomic_uint) +0:? 'anon@5' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, flat out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'ColorInv' ( smooth out 3-component vector of float) +0:? 'Color4' ( invariant centroid smooth out 3-component vector of float) +0:? 'position' ( noContraction smooth out 4-component vector of float) +0:? 'Color5' ( noContraction smooth out 3-component vector of float) +0:? 'a' ( in 4-component vector of float) +0:? 'b' ( in 4-component vector of float) +0:? 'c' ( in 4-component vector of float) +0:? 'd' ( in 4-component vector of float) +0:? 'v' ( noContraction smooth out 4-component vector of float) +0:? 'anon@6' (layout( column_major shared) coherent buffer block{layout( column_major shared) readonly buffer 4-component vector of float member1, layout( column_major shared) buffer 4-component vector of float member2}) +0:? 'anon@7' (layout( column_major shared) buffer block{layout( column_major shared) coherent readonly buffer 4-component vector of float member1A, layout( column_major shared) coherent buffer 4-component vector of float member2A}) +0:? 'shv' ( shared 4-component vector of float) +0:? 'img1' (layout( rgba32f) uniform image2D) +0:? 'img2' (layout( rgba32f) coherent uniform image2D) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 430 +Requested GL_3DL_array_objects +ERROR: node is still EOpNull! +0:134 Function Definition: funcA(I21; ( global 4-component vector of float) +0:134 Function Parameters: +0:134 'a' ( restrict in image2D) +0:136 Function Definition: funcB(I21; ( global 4-component vector of float) +0:136 Function Parameters: +0:136 'a' ( in image2D) +0:140 Function Definition: func(f1;f1;f1;f1; ( global float) +0:140 Function Parameters: +0:140 'e' ( in float) +0:140 'f' ( in float) +0:140 'g' ( in float) +0:140 'h' ( in float) +0:142 Sequence +0:142 Branch: Return with expression +0:142 add ( temp float) +0:142 component-wise multiply ( temp float) +0:142 'e' ( in float) +0:142 'f' ( in float) +0:142 component-wise multiply ( temp float) +0:142 'g' ( in float) +0:142 'h' ( in float) +0:146 Function Definition: func2(f1;f1;f1;f1; ( global float) +0:146 Function Parameters: +0:146 'e' ( in float) +0:146 'f' ( in float) +0:146 'g' ( in float) +0:146 'h' ( in float) +0:148 Sequence +0:148 Sequence +0:148 move second child to first child ( temp float) +0:148 'result' ( noContraction temp float) +0:148 add ( temp float) +0:148 component-wise multiply ( temp float) +0:148 'e' ( in float) +0:148 'f' ( in float) +0:148 component-wise multiply ( temp float) +0:148 'g' ( in float) +0:148 'h' ( in float) +0:150 Branch: Return with expression +0:150 'result' ( noContraction temp float) +0:153 Function Definition: func3(f1;f1;f1; ( global float) +0:153 Function Parameters: +0:153 'i' ( in float) +0:153 'j' ( in float) +0:153 'k' ( noContraction out float) +0:155 Sequence +0:155 move second child to first child ( temp float) +0:155 'k' ( noContraction out float) +0:155 add ( temp float) +0:155 component-wise multiply ( temp float) +0:155 'i' ( in float) +0:155 'i' ( in float) +0:155 'j' ( in float) +0:158 Function Definition: main( ( global void) +0:158 Function Parameters: +0:160 Sequence +0:160 Sequence +0:160 move second child to first child ( temp 3-component vector of float) +0:160 'r' ( temp 3-component vector of float) +0:160 Construct vec3 ( temp 3-component vector of float) +0:160 component-wise multiply ( temp 4-component vector of float) +0:160 'a' ( in 4-component vector of float) +0:160 'b' ( in 4-component vector of float) +0:161 Sequence +0:161 move second child to first child ( temp 3-component vector of float) +0:161 's' ( temp 3-component vector of float) +0:161 Construct vec3 ( temp 3-component vector of float) +0:161 component-wise multiply ( temp 4-component vector of float) +0:161 'c' ( in 4-component vector of float) +0:161 'd' ( in 4-component vector of float) +0:162 move second child to first child ( temp 3-component vector of float) +0:162 vector swizzle ( noContraction temp 3-component vector of float) +0:162 'v' ( noContraction smooth out 4-component vector of float) +0:162 Sequence +0:162 Constant: +0:162 0 (const int) +0:162 Constant: +0:162 1 (const int) +0:162 Constant: +0:162 2 (const int) +0:162 add ( temp 3-component vector of float) +0:162 'r' ( temp 3-component vector of float) +0:162 's' ( temp 3-component vector of float) +0:163 move second child to first child ( temp float) +0:163 direct index ( noContraction temp float) +0:163 'v' ( noContraction smooth out 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 add ( temp float) +0:163 component-wise multiply ( temp float) +0:163 direct index ( temp float) +0:163 'a' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 direct index ( temp float) +0:163 'b' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 component-wise multiply ( temp float) +0:163 direct index ( temp float) +0:163 'c' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:163 direct index ( temp float) +0:163 'd' ( in 4-component vector of float) +0:163 Constant: +0:163 3 (const int) +0:164 move second child to first child ( temp float) +0:164 direct index ( noContraction temp float) +0:164 'v' ( noContraction smooth out 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 Function Call: func(f1;f1;f1;f1; ( global float) +0:164 direct index ( temp float) +0:164 'a' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 direct index ( temp float) +0:164 'b' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 direct index ( temp float) +0:164 'c' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:164 direct index ( temp float) +0:164 'd' ( in 4-component vector of float) +0:164 Constant: +0:164 0 (const int) +0:166 move second child to first child ( temp float) +0:166 direct index ( noContraction temp float) +0:166 'v' ( noContraction smooth out 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 Function Call: func2(f1;f1;f1;f1; ( global float) +0:166 direct index ( temp float) +0:166 'a' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 direct index ( temp float) +0:166 'b' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 direct index ( temp float) +0:166 'c' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:166 direct index ( temp float) +0:166 'd' ( in 4-component vector of float) +0:166 Constant: +0:166 0 (const int) +0:167 Function Call: func3(f1;f1;f1; ( global float) +0:167 component-wise multiply ( temp float) +0:167 direct index ( temp float) +0:167 'a' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 direct index ( temp float) +0:167 'b' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 component-wise multiply ( temp float) +0:167 direct index ( temp float) +0:167 'c' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 direct index ( temp float) +0:167 'd' ( in 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:167 direct index ( noContraction temp float) +0:167 'v' ( noContraction smooth out 4-component vector of float) +0:167 Constant: +0:167 0 (const int) +0:169 Function Call: funcA(I21; ( global 4-component vector of float) +0:169 'img1' (layout( rgba32f) uniform image2D) +0:170 Function Call: funcB(I21; ( global 4-component vector of float) +0:170 'img2' (layout( rgba32f) coherent uniform image2D) +0:? Sequence +0:178 Sequence +0:178 move second child to first child ( temp structure{ temp float intensity, temp 3-component vector of float position}) +0:178 'lightVar' ( temp structure{ temp float intensity, temp 3-component vector of float position}) +0:178 Constant: +0:178 3.000000 +0:178 1.000000 +0:178 2.000000 +0:178 3.000000 +0:? Sequence +0:185 Sequence +0:185 move second child to first child ( temp 5-element array of float) +0:185 'a' ( temp 5-element array of float) +0:185 Construct float ( temp 5-element array of float) +0:185 'g' ( temp float) +0:185 Constant: +0:185 1.000000 +0:185 'g' ( temp float) +0:185 Constant: +0:185 2.300000 +0:185 'g' ( temp float) +0:188 move second child to first child ( temp 3-element array of float) +0:188 'b' ( temp 3-element array of float) +0:188 Construct float ( temp 3-element array of float) +0:188 'g' ( temp float) +0:188 add ( temp float) +0:188 'g' ( temp float) +0:188 Constant: +0:188 1.000000 +0:188 add ( temp float) +0:188 'g' ( temp float) +0:188 Constant: +0:188 2.000000 +0:191 Sequence +0:191 Sequence +0:191 move second child to first child ( temp 2-element array of 4-component vector of float) +0:191 'b' ( temp 2-element array of 4-component vector of float) +0:191 Constant: +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:191 1.000000 +0:192 Construct vec4 ( temp 3-element array of 2-element array of 4-component vector of float) +0:192 'b' ( temp 2-element array of 4-component vector of float) +0:192 'b' ( temp 2-element array of 4-component vector of float) +0:192 'b' ( temp 2-element array of 4-component vector of float) +0:193 Construct vec4 ( temp 3-element array of 2-element array of 4-component vector of float) +0:193 'b' ( temp 2-element array of 4-component vector of float) +0:193 'b' ( temp 2-element array of 4-component vector of float) +0:193 'b' ( temp 2-element array of 4-component vector of float) +0:194 Construct vec4 ( temp 3-element array of 2-element array of 4-component vector of float) +0:194 'b' ( temp 2-element array of 4-component vector of float) +0:194 'b' ( temp 2-element array of 4-component vector of float) +0:194 'b' ( temp 2-element array of 4-component vector of float) +0:? Linker Objects +0:? 'Coords' ( out block{ out 4-component vector of float Position, out 2-component vector of float Texture}) +0:? 'anon@0' ( out block{ out 4-component vector of float Color}) +0:? 'transforms' (layout( column_major shared) uniform 4-element array of block{layout( column_major shared) uniform 4X4 matrix of float ModelViewMatrix, layout( column_major shared) uniform 4X4 matrix of float ModelViewProjectionMatrix, layout( column_major shared) uniform 1-element array of 4-component vector of float a, layout( column_major shared) uniform float Deformation}) +0:? 'normal' (layout( location=3) in 4-component vector of float) +0:? 'colors' (layout( location=6) in 3-element array of 4-component vector of float) +0:? 'transforms2' (layout( location=9) in 2-element array of 4X4 matrix of float) +0:? 's' (layout( location=3) temp structure{ global 3-component vector of float a1, global 2X2 matrix of float b, global 2-element array of 4-component vector of float c}) +0:? 'var1' ( smooth out 4-component vector of float) +0:? 'anon@1' ( out block{ out 4-component vector of float var2, out 2-component vector of float var3, out 3-component vector of float var4}) +0:? 'var5' ( smooth out 4-component vector of float) +0:? 'anon@2' ( out block{ out 4-component vector of float var6}) +0:? 'var7' ( smooth out 4-component vector of float) +0:? 'anon@3' (layout( row_major std140) uniform block{layout( row_major std140 offset=0) uniform 4X4 matrix of float M1, layout( column_major std140 offset=64) uniform 4X4 matrix of float M2, layout( row_major std140 offset=128) uniform 3X3 matrix of float N1}) +0:? 'anon@4' (layout( column_major shared) uniform block{layout( column_major shared) uniform 4X4 matrix of float M13, layout( row_major shared) uniform 4X4 matrix of float m14, layout( column_major shared) uniform 3X3 matrix of float N12}) +0:? 's17' (layout( binding=3) uniform sampler2D) +0:? 'a2' (layout( binding=2 offset=4) uniform atomic_uint) +0:? 'bar' (layout( binding=2) uniform atomic_uint) +0:? 'bar23' (layout( offset=8) uniform atomic_uint) +0:? 'b2' (layout( binding=2) uniform atomic_uint) +0:? 'c2' (layout( binding=3) uniform atomic_uint) +0:? 'd2' (layout( binding=2) uniform atomic_uint) +0:? 'anon@5' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, flat out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'ColorInv' ( smooth out 3-component vector of float) +0:? 'Color4' ( invariant centroid smooth out 3-component vector of float) +0:? 'position' ( noContraction smooth out 4-component vector of float) +0:? 'Color5' ( noContraction smooth out 3-component vector of float) +0:? 'a' ( in 4-component vector of float) +0:? 'b' ( in 4-component vector of float) +0:? 'c' ( in 4-component vector of float) +0:? 'd' ( in 4-component vector of float) +0:? 'v' ( noContraction smooth out 4-component vector of float) +0:? 'anon@6' (layout( column_major shared) coherent buffer block{layout( column_major shared) readonly buffer 4-component vector of float member1, layout( column_major shared) buffer 4-component vector of float member2}) +0:? 'anon@7' (layout( column_major shared) buffer block{layout( column_major shared) coherent readonly buffer 4-component vector of float member1A, layout( column_major shared) coherent buffer 4-component vector of float member2A}) +0:? 'shv' ( shared 4-component vector of float) +0:? 'img1' (layout( rgba32f) uniform image2D) +0:? 'img2' (layout( rgba32f) coherent uniform image2D) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/spv.1.3.8bitstorage-ssbo.vert.out b/deps/glslang/Test/baseResults/spv.1.3.8bitstorage-ssbo.vert.out new file mode 100644 index 00000000..878aa1a2 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.1.3.8bitstorage-ssbo.vert.out @@ -0,0 +1,56 @@ +spv.1.3.8bitstorage-ssbo.vert +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 28 + + Capability Shader + Capability CapabilityStorageBuffer8BitAccess + Extension "SPV_KHR_8bit_storage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 9 18 + Source GLSL 450 + SourceExtension "GL_EXT_shader_8bit_storage" + Name 4 "main" + Name 9 "color" + Name 12 "Vertices" + MemberName 12(Vertices) 0 "vertices" + Name 14 "" + Name 18 "gl_VertexIndex" + Decorate 9(color) Location 0 + Decorate 11 ArrayStride 1 + MemberDecorate 12(Vertices) 0 NonWritable + MemberDecorate 12(Vertices) 0 Offset 0 + Decorate 12(Vertices) Block + Decorate 14 DescriptorSet 0 + Decorate 14 Binding 0 + Decorate 18(gl_VertexIndex) BuiltIn VertexIndex + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(color): 8(ptr) Variable Output + 10: TypeInt 8 0 + 11: TypeRuntimeArray 10(int8_t) + 12(Vertices): TypeStruct 11 + 13: TypePointer StorageBuffer 12(Vertices) + 14: 13(ptr) Variable StorageBuffer + 15: TypeInt 32 1 + 16: 15(int) Constant 0 + 17: TypePointer Input 15(int) +18(gl_VertexIndex): 17(ptr) Variable Input + 20: TypePointer StorageBuffer 10(int8_t) + 23: TypeInt 32 0 + 4(main): 2 Function None 3 + 5: Label + 19: 15(int) Load 18(gl_VertexIndex) + 21: 20(ptr) AccessChain 14 16 19 + 22: 10(int8_t) Load 21 + 24: 23(int) UConvert 22 + 25: 15(int) Bitcast 24 + 26: 6(float) ConvertSToF 25 + 27: 7(fvec4) CompositeConstruct 26 26 26 26 + Store 9(color) 27 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.1.3.8bitstorage-ubo.vert.out b/deps/glslang/Test/baseResults/spv.1.3.8bitstorage-ubo.vert.out new file mode 100644 index 00000000..54b497ff --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.1.3.8bitstorage-ubo.vert.out @@ -0,0 +1,56 @@ +spv.1.3.8bitstorage-ubo.vert +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 29 + + Capability Shader + Capability CapabilityUniformAndStorageBuffer8BitAccess + Extension "SPV_KHR_8bit_storage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 9 20 + Source GLSL 450 + SourceExtension "GL_EXT_shader_8bit_storage" + Name 4 "main" + Name 9 "color" + Name 14 "Vertices" + MemberName 14(Vertices) 0 "vertices" + Name 16 "" + Name 20 "gl_VertexIndex" + Decorate 9(color) Location 0 + Decorate 13 ArrayStride 16 + MemberDecorate 14(Vertices) 0 Offset 0 + Decorate 14(Vertices) Block + Decorate 16 DescriptorSet 0 + Decorate 16 Binding 0 + Decorate 20(gl_VertexIndex) BuiltIn VertexIndex + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(color): 8(ptr) Variable Output + 10: TypeInt 8 0 + 11: TypeInt 32 0 + 12: 11(int) Constant 512 + 13: TypeArray 10(int8_t) 12 + 14(Vertices): TypeStruct 13 + 15: TypePointer Uniform 14(Vertices) + 16: 15(ptr) Variable Uniform + 17: TypeInt 32 1 + 18: 17(int) Constant 0 + 19: TypePointer Input 17(int) +20(gl_VertexIndex): 19(ptr) Variable Input + 22: TypePointer Uniform 10(int8_t) + 4(main): 2 Function None 3 + 5: Label + 21: 17(int) Load 20(gl_VertexIndex) + 23: 22(ptr) AccessChain 16 18 21 + 24: 10(int8_t) Load 23 + 25: 11(int) UConvert 24 + 26: 17(int) Bitcast 25 + 27: 6(float) ConvertSToF 26 + 28: 7(fvec4) CompositeConstruct 27 27 27 27 + Store 9(color) 28 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.100ops.frag.out b/deps/glslang/Test/baseResults/spv.100ops.frag.out new file mode 100644 index 00000000..8f656ebb --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.100ops.frag.out @@ -0,0 +1,98 @@ +spv.100ops.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 49 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 21 26 37 + ExecutionMode 4 OriginUpperLeft + Source ESSL 310 + Name 4 "main" + Name 8 "foo(" + Name 11 "face1" + Name 13 "face2" + Name 17 "z" + Name 21 "low" + Name 26 "high" + Name 37 "Color" + Decorate 8(foo() RelaxedPrecision + Decorate 11(face1) RelaxedPrecision + Decorate 13(face2) RelaxedPrecision + Decorate 17(z) RelaxedPrecision + Decorate 21(low) RelaxedPrecision + Decorate 22 RelaxedPrecision + Decorate 23 RelaxedPrecision + Decorate 25 RelaxedPrecision + Decorate 26(high) RelaxedPrecision + Decorate 27 RelaxedPrecision + Decorate 32 RelaxedPrecision + Decorate 34 RelaxedPrecision + Decorate 37(Color) RelaxedPrecision + Decorate 38 RelaxedPrecision + Decorate 39 RelaxedPrecision + Decorate 40 RelaxedPrecision + Decorate 41 RelaxedPrecision + Decorate 42 RelaxedPrecision + Decorate 43 RelaxedPrecision + Decorate 44 RelaxedPrecision + Decorate 45 RelaxedPrecision + Decorate 46 RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeFunction 6(float) + 10: TypePointer Private 6(float) + 11(face1): 10(ptr) Variable Private + 12: 6(float) Constant 1093664768 + 13(face2): 10(ptr) Variable Private + 14: 6(float) Constant 3221225472 + 15: TypeInt 32 1 + 16: TypePointer Function 15(int) + 18: 15(int) Constant 3 + 19: 6(float) Constant 1073741824 + 20: TypePointer Input 6(float) + 21(low): 20(ptr) Variable Input + 24: 6(float) Constant 1065353216 + 26(high): 20(ptr) Variable Input + 28: TypeBool + 33: 15(int) Constant 1 + 35: TypeVector 6(float) 4 + 36: TypePointer Output 35(fvec4) + 37(Color): 36(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 17(z): 16(ptr) Variable Function + Store 11(face1) 12 + Store 13(face2) 14 + Store 17(z) 18 + 22: 6(float) Load 21(low) + 23: 6(float) FMul 19 22 + 25: 6(float) FAdd 23 24 + 27: 6(float) Load 26(high) + 29: 28(bool) FOrdLessThan 25 27 + SelectionMerge 31 None + BranchConditional 29 30 31 + 30: Label + 32: 15(int) Load 17(z) + 34: 15(int) IAdd 32 33 + Store 17(z) 34 + Branch 31 + 31: Label + 38: 6(float) Load 11(face1) + 39: 15(int) Load 17(z) + 40: 6(float) ConvertSToF 39 + 41: 35(fvec4) CompositeConstruct 40 40 40 40 + 42: 35(fvec4) VectorTimesScalar 41 38 + 43: 6(float) FunctionCall 8(foo() + 44: 35(fvec4) CompositeConstruct 43 43 43 43 + 45: 35(fvec4) FAdd 42 44 + Store 37(Color) 45 + Return + FunctionEnd + 8(foo(): 6(float) Function None 7 + 9: Label + 46: 6(float) Load 13(face2) + ReturnValue 46 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.130.frag.out b/deps/glslang/Test/baseResults/spv.130.frag.out new file mode 100644 index 00000000..eb02bade --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.130.frag.out @@ -0,0 +1,313 @@ +spv.130.frag +WARNING: 0:31: '#extension' : extension is only partially supported: GL_ARB_gpu_shader5 + +error: SPIRV-Tools Validation Errors +error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension) + OpCapability SampledRect + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 205 + + Capability Shader + Capability ClipDistance + Capability SampledRect + Capability Sampled1D + Capability SampledCubeArray + Capability ImageQuery + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 17 68 79 99 173 184 185 186 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + SourceExtension "GL_ARB_gpu_shader5" + SourceExtension "GL_ARB_shader_texture_lod" + SourceExtension "GL_ARB_shading_language_420pack" + SourceExtension "GL_ARB_texture_cube_map_array" + SourceExtension "GL_ARB_texture_gather" + SourceExtension "GL_ARB_texture_rectangle" + Name 4 "main" + Name 6 "bar3(" + Name 8 "bar4(" + Name 10 "bar5(" + Name 12 "bar6(" + Name 17 "o" + Name 21 "samp2D" + Name 37 "samp2DA" + Name 47 "samp2DR" + Name 55 "samp2DS" + Name 68 "io" + Name 72 "Sca" + Name 79 "i" + Name 87 "Isca" + Name 99 "uo" + Name 103 "Usca" + Name 114 "a" + Name 118 "Scas" + Name 124 "f" + Name 133 "c" + Name 154 "a1" + Name 157 "m43" + Name 160 "b" + Name 167 "sampC" + Name 173 "gl_ClipDistance" + Name 183 "b" + Name 184 "fflat" + Name 185 "fsmooth" + Name 186 "fnop" + Name 193 "bounds" + Name 194 "s2D" + Name 195 "s2DR" + Name 199 "s2DRS" + Name 203 "s1D" + Name 204 "s2DS" + Decorate 21(samp2D) DescriptorSet 0 + Decorate 37(samp2DA) DescriptorSet 0 + Decorate 47(samp2DR) DescriptorSet 0 + Decorate 55(samp2DS) DescriptorSet 0 + Decorate 72(Sca) DescriptorSet 0 + Decorate 87(Isca) DescriptorSet 0 + Decorate 103(Usca) DescriptorSet 0 + Decorate 118(Scas) DescriptorSet 0 + Decorate 167(sampC) DescriptorSet 0 + Decorate 173(gl_ClipDistance) BuiltIn ClipDistance + Decorate 184(fflat) Flat + Decorate 186(fnop) NoPerspective + Decorate 193(bounds) DescriptorSet 0 + Decorate 193(bounds) Binding 0 + Decorate 194(s2D) DescriptorSet 0 + Decorate 195(s2DR) DescriptorSet 0 + Decorate 199(s2DRS) DescriptorSet 0 + Decorate 203(s1D) DescriptorSet 0 + Decorate 204(s2DS) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 14: TypeFloat 32 + 15: TypeVector 14(float) 4 + 16: TypePointer Output 15(fvec4) + 17(o): 16(ptr) Variable Output + 18: TypeImage 14(float) 2D sampled format:Unknown + 19: TypeSampledImage 18 + 20: TypePointer UniformConstant 19 + 21(samp2D): 20(ptr) Variable UniformConstant + 23: TypeVector 14(float) 2 + 24: 14(float) Constant 1050253722 + 25: 23(fvec2) ConstantComposite 24 24 + 26: TypeInt 32 1 + 27: TypeVector 26(int) 2 + 28: 26(int) Constant 1 + 29: 27(ivec2) ConstantComposite 28 28 + 30: 26(int) Constant 0 + 34: TypeImage 14(float) 2D array sampled format:Unknown + 35: TypeSampledImage 34 + 36: TypePointer UniformConstant 35 + 37(samp2DA): 36(ptr) Variable UniformConstant + 39: TypeVector 14(float) 3 + 40: 39(fvec3) ConstantComposite 24 24 24 + 44: TypeImage 14(float) Rect sampled format:Unknown + 45: TypeSampledImage 44 + 46: TypePointer UniformConstant 45 + 47(samp2DR): 46(ptr) Variable UniformConstant + 52: TypeImage 14(float) 2D depth sampled format:Unknown + 53: TypeSampledImage 52 + 54: TypePointer UniformConstant 53 + 55(samp2DS): 54(ptr) Variable UniformConstant + 57: 14(float) Constant 1067869798 + 62: 26(int) Constant 2 + 66: TypeVector 26(int) 3 + 67: TypePointer Output 66(ivec3) + 68(io): 67(ptr) Variable Output + 69: TypeImage 14(float) Cube array sampled format:Unknown + 70: TypeSampledImage 69 + 71: TypePointer UniformConstant 70 + 72(Sca): 71(ptr) Variable UniformConstant + 74: 26(int) Constant 3 + 78: TypePointer Input 15(fvec4) + 79(i): 78(ptr) Variable Input + 84: TypeImage 26(int) Cube array sampled format:Unknown + 85: TypeSampledImage 84 + 86: TypePointer UniformConstant 85 + 87(Isca): 86(ptr) Variable UniformConstant + 90: 14(float) Constant 1060320051 + 91: TypeVector 26(int) 4 + 96: TypeInt 32 0 + 97: TypeVector 96(int) 4 + 98: TypePointer Output 97(ivec4) + 99(uo): 98(ptr) Variable Output + 100: TypeImage 96(int) Cube array sampled format:Unknown + 101: TypeSampledImage 100 + 102: TypePointer UniformConstant 101 + 103(Usca): 102(ptr) Variable UniformConstant + 109: 14(float) Constant 1071225242 + 113: TypePointer Private 39(fvec3) + 114(a): 113(ptr) Variable Private + 115: TypeImage 14(float) Cube depth array sampled format:Unknown + 116: TypeSampledImage 115 + 117: TypePointer UniformConstant 116 + 118(Scas): 117(ptr) Variable UniformConstant + 123: TypePointer Function 14(float) + 127: 96(int) Constant 1 + 128: TypePointer Input 14(float) + 132: TypePointer Function 91(ivec4) + 136: 14(float) Constant 1036831949 + 137: 39(fvec3) ConstantComposite 136 136 136 + 138: 14(float) Constant 1045220557 + 139: 39(fvec3) ConstantComposite 138 138 138 + 155: TypeMatrix 39(fvec3) 4 + 156: TypePointer Function 155 + 161: 14(float) Constant 1073741824 + 164: TypeImage 14(float) Cube sampled format:Unknown + 165: TypeSampledImage 164 + 166: TypePointer UniformConstant 165 + 167(sampC): 166(ptr) Variable UniformConstant + 170: 96(int) Constant 4 + 171: TypeArray 14(float) 170 + 172: TypePointer Input 171 +173(gl_ClipDistance): 172(ptr) Variable Input + 176: TypePointer Output 14(float) + 182: TypePointer Private 14(float) + 183(b): 182(ptr) Variable Private + 184(fflat): 128(ptr) Variable Input + 185(fsmooth): 128(ptr) Variable Input + 186(fnop): 128(ptr) Variable Input + 187: 96(int) Constant 3 + 188: TypeArray 26(int) 187 + 189: 26(int) Constant 10 + 190: 26(int) Constant 23 + 191: 26(int) Constant 32 + 192: 188 ConstantComposite 189 190 191 + 193(bounds): 20(ptr) Variable UniformConstant + 194(s2D): 20(ptr) Variable UniformConstant + 195(s2DR): 46(ptr) Variable UniformConstant + 196: TypeImage 14(float) Rect depth sampled format:Unknown + 197: TypeSampledImage 196 + 198: TypePointer UniformConstant 197 + 199(s2DRS): 198(ptr) Variable UniformConstant + 200: TypeImage 14(float) 1D sampled format:Unknown + 201: TypeSampledImage 200 + 202: TypePointer UniformConstant 201 + 203(s1D): 202(ptr) Variable UniformConstant + 204(s2DS): 54(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 168: 165 Load 167(sampC) + 169: 15(fvec4) ImageGather 168 139 30 + Store 17(o) 169 + 174: 128(ptr) AccessChain 173(gl_ClipDistance) 74 + 175: 14(float) Load 174 + 177: 176(ptr) AccessChain 17(o) 127 + Store 177 175 + 178: 2 FunctionCall 6(bar3() + 179: 2 FunctionCall 8(bar4() + 180: 2 FunctionCall 10(bar5() + 181: 2 FunctionCall 12(bar6() + Return + FunctionEnd + 6(bar3(): 2 Function None 3 + 7: Label + 22: 19 Load 21(samp2D) + 31: 15(fvec4) ImageGather 22 25 30 ConstOffset 29 + 32: 15(fvec4) Load 17(o) + 33: 15(fvec4) FAdd 32 31 + Store 17(o) 33 + 38: 35 Load 37(samp2DA) + 41: 15(fvec4) ImageGather 38 40 30 ConstOffset 29 + 42: 15(fvec4) Load 17(o) + 43: 15(fvec4) FAdd 42 41 + Store 17(o) 43 + Return + FunctionEnd + 8(bar4(): 2 Function None 3 + 9: Label + 48: 45 Load 47(samp2DR) + 49: 15(fvec4) ImageGather 48 25 30 ConstOffset 29 + 50: 15(fvec4) Load 17(o) + 51: 15(fvec4) FAdd 50 49 + Store 17(o) 51 + 56: 53 Load 55(samp2DS) + 58: 15(fvec4) ImageDrefGather 56 25 57 ConstOffset 29 + 59: 15(fvec4) Load 17(o) + 60: 15(fvec4) FAdd 59 58 + Store 17(o) 60 + 61: 19 Load 21(samp2D) + 63: 15(fvec4) ImageGather 61 25 62 ConstOffset 29 + 64: 15(fvec4) Load 17(o) + 65: 15(fvec4) FAdd 64 63 + Store 17(o) 65 + Return + FunctionEnd + 10(bar5(): 2 Function None 3 + 11: Label + 124(f): 123(ptr) Variable Function + 133(c): 132(ptr) Variable Function + 73: 70 Load 72(Sca) + 75: 69 Image 73 + 76: 66(ivec3) ImageQuerySizeLod 75 74 + Store 68(io) 76 + 77: 70 Load 72(Sca) + 80: 15(fvec4) Load 79(i) + 81: 15(fvec4) ImageSampleImplicitLod 77 80 + 82: 15(fvec4) Load 17(o) + 83: 15(fvec4) FAdd 82 81 + Store 17(o) 83 + 88: 85 Load 87(Isca) + 89: 15(fvec4) Load 79(i) + 92: 91(ivec4) ImageSampleImplicitLod 88 89 Bias 90 + 93: 66(ivec3) VectorShuffle 92 92 0 1 2 + 94: 66(ivec3) Load 68(io) + 95: 66(ivec3) IAdd 94 93 + Store 68(io) 95 + 104: 101 Load 103(Usca) + 105: 15(fvec4) Load 79(i) + 106: 97(ivec4) ImageSampleImplicitLod 104 105 + Store 99(uo) 106 + 107: 70 Load 72(Sca) + 108: 15(fvec4) Load 79(i) + 110: 15(fvec4) ImageSampleExplicitLod 107 108 Lod 109 + 111: 15(fvec4) Load 17(o) + 112: 15(fvec4) FAdd 111 110 + Store 17(o) 112 + 119: 116 Load 118(Scas) + 120: 115 Image 119 + 121: 66(ivec3) ImageQuerySizeLod 120 74 + 122: 39(fvec3) ConvertSToF 121 + Store 114(a) 122 + 125: 116 Load 118(Scas) + 126: 15(fvec4) Load 79(i) + 129: 128(ptr) AccessChain 79(i) 127 + 130: 14(float) Load 129 + 131: 14(float) ImageSampleDrefImplicitLod 125 126 130 + Store 124(f) 131 + 134: 85 Load 87(Isca) + 135: 15(fvec4) Load 79(i) + 140: 91(ivec4) ImageSampleExplicitLod 134 135 Grad 137 139 + Store 133(c) 140 + 141: 39(fvec3) Load 114(a) + 142: 14(float) Load 124(f) + 143: 91(ivec4) Load 133(c) + 144: 15(fvec4) ConvertSToF 143 + 145: 15(fvec4) CompositeConstruct 142 142 142 142 + 146: 15(fvec4) FAdd 145 144 + 147: 14(float) CompositeExtract 141 0 + 148: 14(float) CompositeExtract 141 1 + 149: 14(float) CompositeExtract 141 2 + 150: 14(float) CompositeExtract 146 0 + 151: 15(fvec4) CompositeConstruct 147 148 149 150 + 152: 15(fvec4) Load 17(o) + 153: 15(fvec4) FAdd 152 151 + Store 17(o) 153 + Return + FunctionEnd + 12(bar6(): 2 Function None 3 + 13: Label + 154(a1): 123(ptr) Variable Function + 157(m43): 156(ptr) Variable Function + 160(b): 123(ptr) Variable Function + 158: 123(ptr) AccessChain 157(m43) 74 127 + 159: 14(float) Load 158 + Store 154(a1) 159 + 162: 14(float) Load 154(a1) + 163: 14(float) FMul 161 162 + Store 160(b) 163 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.140.frag.out b/deps/glslang/Test/baseResults/spv.140.frag.out new file mode 100644 index 00000000..8a59c2f9 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.140.frag.out @@ -0,0 +1,170 @@ +spv.140.frag +error: SPIRV-Tools Validation Errors +error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension) + OpCapability SampledRect + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 96 + + Capability Shader + Capability ClipDistance + Capability SampledRect + Capability SampledBuffer + Capability ImageQuery + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 14 23 28 38 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 8 "foo(" + Name 11 "i1" + Name 14 "gl_FrontFacing" + Name 19 "i2" + Name 23 "o" + Name 28 "gl_ClipDistance" + Name 38 "k" + Name 50 "sampR" + Name 58 "sampB" + Name 82 "samp2Da" + Name 87 "bn" + MemberName 87(bn) 0 "matra" + MemberName 87(bn) 1 "matca" + MemberName 87(bn) 2 "matr" + MemberName 87(bn) 3 "matc" + MemberName 87(bn) 4 "matrdef" + Name 89 "" + Name 92 "bi" + MemberName 92(bi) 0 "v" + Name 95 "bname" + Decorate 14(gl_FrontFacing) BuiltIn FrontFacing + Decorate 28(gl_ClipDistance) BuiltIn ClipDistance + Decorate 50(sampR) DescriptorSet 0 + Decorate 58(sampB) DescriptorSet 0 + Decorate 82(samp2Da) DescriptorSet 0 + Decorate 85 ArrayStride 64 + Decorate 86 ArrayStride 64 + MemberDecorate 87(bn) 0 RowMajor + MemberDecorate 87(bn) 0 Offset 0 + MemberDecorate 87(bn) 0 MatrixStride 16 + MemberDecorate 87(bn) 1 ColMajor + MemberDecorate 87(bn) 1 Offset 256 + MemberDecorate 87(bn) 1 MatrixStride 16 + MemberDecorate 87(bn) 2 RowMajor + MemberDecorate 87(bn) 2 Offset 512 + MemberDecorate 87(bn) 2 MatrixStride 16 + MemberDecorate 87(bn) 3 ColMajor + MemberDecorate 87(bn) 3 Offset 576 + MemberDecorate 87(bn) 3 MatrixStride 16 + MemberDecorate 87(bn) 4 RowMajor + MemberDecorate 87(bn) 4 Offset 1024 + MemberDecorate 87(bn) 4 MatrixStride 16 + Decorate 87(bn) Block + Decorate 89 DescriptorSet 0 + Decorate 91 ArrayStride 16 + MemberDecorate 92(bi) 0 Offset 0 + Decorate 92(bi) Block + Decorate 95(bname) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeFunction 6(float) + 10: TypePointer Private 6(float) + 11(i1): 10(ptr) Variable Private + 12: TypeBool + 13: TypePointer Input 12(bool) +14(gl_FrontFacing): 13(ptr) Variable Input + 16: 6(float) Constant 3221225472 + 17: 6(float) Constant 1073741824 + 19(i2): 10(ptr) Variable Private + 20: 6(float) Constant 1120665600 + 21: TypeVector 6(float) 4 + 22: TypePointer Output 21(fvec4) + 23(o): 22(ptr) Variable Output + 24: TypeInt 32 0 + 25: 24(int) Constant 5 + 26: TypeArray 6(float) 25 + 27: TypePointer Input 26 +28(gl_ClipDistance): 27(ptr) Variable Input + 29: TypeInt 32 1 + 30: 29(int) Constant 2 + 31: TypePointer Input 6(float) + 34: 24(int) Constant 1 + 35: TypePointer Output 6(float) + 37: TypePointer Input 21(fvec4) + 38(k): 37(ptr) Variable Input + 40: TypeVector 29(int) 4 + 45: 24(int) Constant 2 + 47: TypeImage 6(float) Rect sampled format:Unknown + 48: TypeSampledImage 47 + 49: TypePointer UniformConstant 48 + 50(sampR): 49(ptr) Variable UniformConstant + 53: TypeVector 29(int) 2 + 55: TypeImage 29(int) Buffer sampled format:Unknown + 56: TypeSampledImage 55 + 57: TypePointer UniformConstant 56 + 58(sampB): 57(ptr) Variable UniformConstant + 64: TypeVector 6(float) 2 + 67: 6(float) Constant 1120403456 + 69: 24(int) Constant 3 + 78: TypeImage 6(float) 2D sampled format:Unknown + 79: TypeSampledImage 78 + 80: TypeArray 79 69 + 81: TypePointer UniformConstant 80 + 82(samp2Da): 81(ptr) Variable UniformConstant + 83: TypeMatrix 21(fvec4) 4 + 84: 24(int) Constant 4 + 85: TypeArray 83 84 + 86: TypeArray 83 84 + 87(bn): TypeStruct 85 86 83 83 83 + 88: TypePointer Uniform 87(bn) + 89: 88(ptr) Variable Uniform + 90: TypeVector 6(float) 3 + 91: TypeArray 90(fvec3) 45 + 92(bi): TypeStruct 91 + 93: TypeArray 92(bi) 84 + 94: TypePointer Uniform 93 + 95(bname): 94(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + 15: 12(bool) Load 14(gl_FrontFacing) + 18: 6(float) Select 15 16 17 + Store 11(i1) 18 + Store 19(i2) 20 + 32: 31(ptr) AccessChain 28(gl_ClipDistance) 30 + 33: 6(float) Load 32 + 36: 35(ptr) AccessChain 23(o) 34 + Store 36 33 + 39: 21(fvec4) Load 38(k) + 41: 40(ivec4) ConvertFToS 39 + 42: 29(int) CompositeExtract 41 0 + 43: 31(ptr) AccessChain 28(gl_ClipDistance) 42 + 44: 6(float) Load 43 + 46: 35(ptr) AccessChain 23(o) 45 + Store 46 44 + 51: 48 Load 50(sampR) + 52: 47 Image 51 + 54: 53(ivec2) ImageQuerySize 52 + 59: 56 Load 58(sampB) + 60: 55 Image 59 + 61: 29(int) ImageQuerySize 60 + 62: 53(ivec2) CompositeConstruct 61 61 + 63: 53(ivec2) IAdd 54 62 + 65: 64(fvec2) ConvertSToF 63 + 66: 6(float) CompositeExtract 65 0 + 68: 6(float) FDiv 66 67 + 70: 35(ptr) AccessChain 23(o) 69 + Store 70 68 + 71: 6(float) FunctionCall 8(foo() + 72: 35(ptr) AccessChain 23(o) 45 + Store 72 71 + Return + FunctionEnd + 8(foo(): 6(float) Function None 7 + 9: Label + 73: 6(float) Load 11(i1) + 74: 6(float) Load 19(i2) + 75: 6(float) FAdd 73 74 + ReturnValue 75 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.150.geom.out b/deps/glslang/Test/baseResults/spv.150.geom.out new file mode 100644 index 00000000..70dadf5d --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.150.geom.out @@ -0,0 +1,149 @@ +spv.150.geom +error: SPIRV-Tools Validation Errors +error: Capability GeometryStreams is not allowed by Vulkan 1.0 specification (or requires extension) + OpCapability GeometryStreams + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 71 + + Capability Geometry + Capability GeometryPointSize + Capability GeometryStreams + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 10 18 29 33 47 49 51 70 + ExecutionMode 4 InputTrianglesAdjacency + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputTriangleStrip + ExecutionMode 4 OutputVertices 30 + Source GLSL 150 + Name 4 "main" + Name 8 "fromVertex" + MemberName 8(fromVertex) 0 "color" + Name 10 "" + Name 13 "fromVertex" + MemberName 13(fromVertex) 0 "color" + Name 18 "fromV" + Name 27 "gl_PerVertex" + MemberName 27(gl_PerVertex) 0 "gl_Position" + MemberName 27(gl_PerVertex) 1 "gl_PointSize" + MemberName 27(gl_PerVertex) 2 "gl_ClipDistance" + Name 29 "" + Name 30 "gl_PerVertex" + MemberName 30(gl_PerVertex) 0 "gl_Position" + MemberName 30(gl_PerVertex) 1 "gl_PointSize" + MemberName 30(gl_PerVertex) 2 "gl_ClipDistance" + Name 33 "gl_in" + Name 47 "gl_PrimitiveID" + Name 49 "gl_PrimitiveIDIn" + Name 51 "gl_Layer" + Name 68 "toFragment" + MemberName 68(toFragment) 0 "color" + Name 70 "toF" + Decorate 8(fromVertex) Block + Decorate 8(fromVertex) Stream 3 + Decorate 10 Stream 3 + Decorate 13(fromVertex) Block + MemberDecorate 27(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 27(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 27(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 27(gl_PerVertex) Block + Decorate 27(gl_PerVertex) Stream 0 + Decorate 29 Stream 0 + MemberDecorate 30(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 30(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 30(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 30(gl_PerVertex) Block + Decorate 47(gl_PrimitiveID) Stream 0 + Decorate 47(gl_PrimitiveID) BuiltIn PrimitiveId + Decorate 49(gl_PrimitiveIDIn) BuiltIn PrimitiveId + Decorate 51(gl_Layer) Stream 0 + Decorate 51(gl_Layer) BuiltIn Layer + Decorate 68(toFragment) Block + Decorate 68(toFragment) Stream 3 + Decorate 70(toF) Stream 3 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8(fromVertex): TypeStruct 7(fvec3) + 9: TypePointer Output 8(fromVertex) + 10: 9(ptr) Variable Output + 11: TypeInt 32 1 + 12: 11(int) Constant 0 + 13(fromVertex): TypeStruct 7(fvec3) + 14: TypeInt 32 0 + 15: 14(int) Constant 6 + 16: TypeArray 13(fromVertex) 15 + 17: TypePointer Input 16 + 18(fromV): 17(ptr) Variable Input + 19: TypePointer Input 7(fvec3) + 22: TypePointer Output 7(fvec3) + 24: TypeVector 6(float) 4 + 25: 14(int) Constant 1 + 26: TypeArray 6(float) 25 +27(gl_PerVertex): TypeStruct 24(fvec4) 6(float) 26 + 28: TypePointer Output 27(gl_PerVertex) + 29: 28(ptr) Variable Output +30(gl_PerVertex): TypeStruct 24(fvec4) 6(float) 26 + 31: TypeArray 30(gl_PerVertex) 15 + 32: TypePointer Input 31 + 33(gl_in): 32(ptr) Variable Input + 34: TypePointer Input 24(fvec4) + 37: TypePointer Output 24(fvec4) + 39: 11(int) Constant 1 + 40: 11(int) Constant 3 + 41: TypePointer Input 6(float) + 44: TypePointer Output 6(float) + 46: TypePointer Output 11(int) +47(gl_PrimitiveID): 46(ptr) Variable Output + 48: TypePointer Input 11(int) +49(gl_PrimitiveIDIn): 48(ptr) Variable Input + 51(gl_Layer): 46(ptr) Variable Output + 52: 11(int) Constant 2 + 53: 6(float) Constant 1073741824 + 68(toFragment): TypeStruct 7(fvec3) + 69: TypePointer Output 68(toFragment) + 70(toF): 69(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 20: 19(ptr) AccessChain 18(fromV) 12 12 + 21: 7(fvec3) Load 20 + 23: 22(ptr) AccessChain 10 12 + Store 23 21 + 35: 34(ptr) AccessChain 33(gl_in) 12 12 + 36: 24(fvec4) Load 35 + 38: 37(ptr) AccessChain 29 12 + Store 38 36 + 42: 41(ptr) AccessChain 33(gl_in) 40 39 + 43: 6(float) Load 42 + 45: 44(ptr) AccessChain 29 39 + Store 45 43 + 50: 11(int) Load 49(gl_PrimitiveIDIn) + Store 47(gl_PrimitiveID) 50 + Store 51(gl_Layer) 52 + EmitVertex + 54: 19(ptr) AccessChain 18(fromV) 12 12 + 55: 7(fvec3) Load 54 + 56: 7(fvec3) VectorTimesScalar 55 53 + 57: 22(ptr) AccessChain 10 12 + Store 57 56 + 58: 34(ptr) AccessChain 33(gl_in) 12 12 + 59: 24(fvec4) Load 58 + 60: 24(fvec4) VectorTimesScalar 59 53 + 61: 37(ptr) AccessChain 29 12 + Store 61 60 + 62: 41(ptr) AccessChain 33(gl_in) 40 39 + 63: 6(float) Load 62 + 64: 6(float) FMul 53 63 + 65: 44(ptr) AccessChain 29 39 + Store 65 64 + 66: 11(int) Load 49(gl_PrimitiveIDIn) + 67: 11(int) IAdd 66 39 + Store 47(gl_PrimitiveID) 67 + Store 51(gl_Layer) 40 + EmitVertex + EndPrimitive + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.150.vert.out b/deps/glslang/Test/baseResults/spv.150.vert.out new file mode 100644 index 00000000..282f5f9c --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.150.vert.out @@ -0,0 +1,103 @@ +spv.150.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 63 + + Capability Shader + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 13 17 23 38 62 + Source GLSL 150 + Name 4 "main" + Name 11 "gl_PerVertex" + MemberName 11(gl_PerVertex) 0 "gl_Position" + MemberName 11(gl_PerVertex) 1 "gl_PointSize" + MemberName 11(gl_PerVertex) 2 "gl_ClipDistance" + Name 13 "" + Name 17 "iv4" + Name 23 "ps" + Name 34 "s1" + MemberName 34(s1) 0 "a" + MemberName 34(s1) 1 "a2" + MemberName 34(s1) 2 "b" + Name 36 "s2" + MemberName 36(s2) 0 "c" + MemberName 36(s2) 1 "d" + Name 38 "s2out" + Name 40 "i" + Name 47 "s2D" + Name 62 "ui" + MemberDecorate 11(gl_PerVertex) 0 Invariant + MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 11(gl_PerVertex) Block + Decorate 47(s2D) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 0 + 9: 8(int) Constant 4 + 10: TypeArray 6(float) 9 +11(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 10 + 12: TypePointer Output 11(gl_PerVertex) + 13: 12(ptr) Variable Output + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16: TypePointer Input 7(fvec4) + 17(iv4): 16(ptr) Variable Input + 19: TypePointer Output 7(fvec4) + 21: 14(int) Constant 1 + 22: TypePointer Input 6(float) + 23(ps): 22(ptr) Variable Input + 25: TypePointer Output 6(float) + 27: 14(int) Constant 2 + 28: 8(int) Constant 0 + 32: 8(int) Constant 3 + 33: TypeArray 7(fvec4) 32 + 34(s1): TypeStruct 14(int) 14(int) 33 + 35: TypeArray 34(s1) 9 + 36(s2): TypeStruct 14(int) 35 + 37: TypePointer Output 36(s2) + 38(s2out): 37(ptr) Variable Output + 39: TypePointer Function 14(int) + 44: TypeImage 6(float) 2D sampled format:Unknown + 45: TypeSampledImage 44 + 46: TypePointer UniformConstant 45 + 47(s2D): 46(ptr) Variable UniformConstant + 49: TypeVector 6(float) 2 + 50: 6(float) Constant 1056964608 + 51: 49(fvec2) ConstantComposite 50 50 + 52: 6(float) Constant 0 + 55: TypeVector 6(float) 3 + 56: 55(fvec3) ConstantComposite 50 50 50 + 59: 6(float) Constant 1078774989 + 61: TypePointer Input 14(int) + 62(ui): 61(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 40(i): 39(ptr) Variable Function + 18: 7(fvec4) Load 17(iv4) + 20: 19(ptr) AccessChain 13 15 + Store 20 18 + 24: 6(float) Load 23(ps) + 26: 25(ptr) AccessChain 13 21 + Store 26 24 + 29: 22(ptr) AccessChain 17(iv4) 28 + 30: 6(float) Load 29 + 31: 25(ptr) AccessChain 13 27 27 + Store 31 30 + 41: 14(int) Load 40(i) + 42: 6(float) Load 23(ps) + 43: 25(ptr) AccessChain 38(s2out) 21 41 27 27 32 + Store 43 42 + 48: 45 Load 47(s2D) + 53: 7(fvec4) ImageSampleExplicitLod 48 51 Lod 52 + 54: 45 Load 47(s2D) + 57: 7(fvec4) ImageSampleProjExplicitLod 54 56 Lod 52 + 58: 45 Load 47(s2D) + 60: 7(fvec4) ImageSampleExplicitLod 58 51 Lod 59 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.16bitstorage-int.frag.out b/deps/glslang/Test/baseResults/spv.16bitstorage-int.frag.out new file mode 100644 index 00000000..1b2a16ba --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.16bitstorage-int.frag.out @@ -0,0 +1,334 @@ +spv.16bitstorage-int.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 171 + + Capability Shader + Capability StorageUniformBufferBlock16 + Capability StorageUniform16 + Extension "SPV_KHR_16bit_storage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_shader_16bit_storage" + Name 4 "main" + Name 12 "S" + MemberName 12(S) 0 "x" + MemberName 12(S) 1 "y" + MemberName 12(S) 2 "z" + Name 17 "B2" + MemberName 17(B2) 0 "o" + MemberName 17(B2) 1 "p" + MemberName 17(B2) 2 "q" + MemberName 17(B2) 3 "r" + MemberName 17(B2) 4 "u" + MemberName 17(B2) 5 "v" + MemberName 17(B2) 6 "x" + MemberName 17(B2) 7 "w" + Name 19 "b2" + Name 23 "S" + MemberName 23(S) 0 "x" + MemberName 23(S) 1 "y" + MemberName 23(S) 2 "z" + Name 25 "B1" + MemberName 25(B1) 0 "a" + MemberName 25(B1) 1 "b" + MemberName 25(B1) 2 "c" + MemberName 25(B1) 3 "d" + MemberName 25(B1) 4 "g" + MemberName 25(B1) 5 "h" + MemberName 25(B1) 6 "j" + Name 27 "b1" + Name 45 "S" + MemberName 45(S) 0 "x" + MemberName 45(S) 1 "y" + MemberName 45(S) 2 "z" + Name 49 "B5" + MemberName 49(B5) 0 "o" + MemberName 49(B5) 1 "p" + MemberName 49(B5) 2 "q" + MemberName 49(B5) 3 "r" + MemberName 49(B5) 4 "u" + MemberName 49(B5) 5 "v" + MemberName 49(B5) 6 "x" + MemberName 49(B5) 7 "w" + Name 51 "b5" + Name 69 "x0" + Name 75 "x1" + Name 88 "S2" + MemberName 88(S2) 0 "x" + MemberName 88(S2) 1 "y" + MemberName 88(S2) 2 "z" + Name 89 "S3" + MemberName 89(S3) 0 "x" + Name 90 "B4" + MemberName 90(B4) 0 "x" + MemberName 90(B4) 1 "y" + Name 92 "b4" + Name 93 "S2" + MemberName 93(S2) 0 "x" + MemberName 93(S2) 1 "y" + MemberName 93(S2) 2 "z" + Name 94 "B3" + MemberName 94(B3) 0 "x" + Name 96 "b3" + Name 113 "v3" + Name 135 "u3" + Decorate 11 ArrayStride 2 + MemberDecorate 12(S) 0 Offset 0 + MemberDecorate 12(S) 1 Offset 4 + MemberDecorate 12(S) 2 Offset 8 + Decorate 13 ArrayStride 16 + Decorate 15 ArrayStride 4 + Decorate 16 ArrayStride 2 + MemberDecorate 17(B2) 0 Offset 0 + MemberDecorate 17(B2) 1 Offset 4 + MemberDecorate 17(B2) 2 Offset 8 + MemberDecorate 17(B2) 3 Offset 14 + MemberDecorate 17(B2) 4 Offset 24 + MemberDecorate 17(B2) 5 Offset 40 + MemberDecorate 17(B2) 6 Offset 72 + MemberDecorate 17(B2) 7 Offset 472 + Decorate 17(B2) BufferBlock + Decorate 19(b2) DescriptorSet 0 + Decorate 22 ArrayStride 16 + MemberDecorate 23(S) 0 Offset 0 + MemberDecorate 23(S) 1 Offset 4 + MemberDecorate 23(S) 2 Offset 8 + Decorate 24 ArrayStride 16 + MemberDecorate 25(B1) 0 Offset 0 + MemberDecorate 25(B1) 1 Offset 4 + MemberDecorate 25(B1) 2 Offset 8 + MemberDecorate 25(B1) 3 Offset 16 + MemberDecorate 25(B1) 4 Offset 48 + MemberDecorate 25(B1) 5 Offset 64 + MemberDecorate 25(B1) 6 Offset 96 + Decorate 25(B1) Block + Decorate 27(b1) DescriptorSet 0 + Decorate 44 ArrayStride 16 + MemberDecorate 45(S) 0 Offset 0 + MemberDecorate 45(S) 1 Offset 4 + MemberDecorate 45(S) 2 Offset 8 + Decorate 46 ArrayStride 16 + Decorate 47 ArrayStride 16 + Decorate 48 ArrayStride 16 + MemberDecorate 49(B5) 0 Offset 0 + MemberDecorate 49(B5) 1 Offset 4 + MemberDecorate 49(B5) 2 Offset 8 + MemberDecorate 49(B5) 3 Offset 16 + MemberDecorate 49(B5) 4 Offset 48 + MemberDecorate 49(B5) 5 Offset 64 + MemberDecorate 49(B5) 6 Offset 96 + MemberDecorate 49(B5) 7 Offset 1696 + Decorate 49(B5) Block + Decorate 51(b5) DescriptorSet 0 + MemberDecorate 88(S2) 0 ColMajor + MemberDecorate 88(S2) 0 Offset 0 + MemberDecorate 88(S2) 0 MatrixStride 16 + MemberDecorate 88(S2) 1 Offset 64 + MemberDecorate 88(S2) 2 Offset 68 + MemberDecorate 89(S3) 0 Offset 0 + MemberDecorate 90(B4) 0 Offset 0 + MemberDecorate 90(B4) 1 Offset 80 + Decorate 90(B4) BufferBlock + Decorate 92(b4) DescriptorSet 0 + MemberDecorate 93(S2) 0 RowMajor + MemberDecorate 93(S2) 0 Offset 0 + MemberDecorate 93(S2) 0 MatrixStride 16 + MemberDecorate 93(S2) 1 Offset 64 + MemberDecorate 93(S2) 2 Offset 68 + MemberDecorate 94(B3) 0 Offset 0 + Decorate 94(B3) BufferBlock + Decorate 96(b3) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 16 1 + 7: TypeVector 6(int16_t) 2 + 8: TypeVector 6(int16_t) 3 + 9: TypeInt 32 0 + 10: 9(int) Constant 2 + 11: TypeArray 6(int16_t) 10 + 12(S): TypeStruct 6(int16_t) 7(i16vec2) 8(i16vec3) + 13: TypeArray 12(S) 10 + 14: 9(int) Constant 100 + 15: TypeArray 7(i16vec2) 14 + 16: TypeRuntimeArray 6(int16_t) + 17(B2): TypeStruct 6(int16_t) 7(i16vec2) 8(i16vec3) 11 12(S) 13 15 16 + 18: TypePointer Uniform 17(B2) + 19(b2): 18(ptr) Variable Uniform + 20: TypeInt 32 1 + 21: 20(int) Constant 0 + 22: TypeArray 6(int16_t) 10 + 23(S): TypeStruct 6(int16_t) 7(i16vec2) 8(i16vec3) + 24: TypeArray 23(S) 10 + 25(B1): TypeStruct 6(int16_t) 7(i16vec2) 8(i16vec3) 22 23(S) 24 20(int) + 26: TypePointer Uniform 25(B1) + 27(b1): 26(ptr) Variable Uniform + 28: TypePointer Uniform 6(int16_t) + 32: 20(int) Constant 1 + 33: 20(int) Constant 2 + 34: TypePointer Uniform 8(i16vec3) + 37: TypeVector 20(int) 3 + 39: TypeVector 20(int) 2 + 42: TypePointer Uniform 7(i16vec2) + 44: TypeArray 6(int16_t) 10 + 45(S): TypeStruct 6(int16_t) 7(i16vec2) 8(i16vec3) + 46: TypeArray 45(S) 10 + 47: TypeArray 7(i16vec2) 14 + 48: TypeArray 6(int16_t) 14 + 49(B5): TypeStruct 6(int16_t) 7(i16vec2) 8(i16vec3) 44 45(S) 46 47 48 + 50: TypePointer Uniform 49(B5) + 51(b5): 50(ptr) Variable Uniform + 58: 20(int) Constant 3 + 68: TypePointer Function 20(int) + 73: TypeVector 20(int) 4 + 74: TypePointer Function 73(ivec4) + 85: TypeFloat 32 + 86: TypeVector 85(float) 4 + 87: TypeMatrix 86(fvec4) 4 + 88(S2): TypeStruct 87 6(int16_t) 20(int) + 89(S3): TypeStruct 88(S2) + 90(B4): TypeStruct 88(S2) 89(S3) + 91: TypePointer Uniform 90(B4) + 92(b4): 91(ptr) Variable Uniform + 93(S2): TypeStruct 87 6(int16_t) 20(int) + 94(B3): TypeStruct 93(S2) + 95: TypePointer Uniform 94(B3) + 96(b3): 95(ptr) Variable Uniform + 97: TypePointer Uniform 87 + 104: 9(int) Constant 0 + 108: 20(int) Constant 5 + 112: TypePointer Function 37(ivec3) + 114: 20(int) Constant 7 + 115: 20(int) Constant 6 + 116: TypePointer Uniform 20(int) + 166: 39(ivec2) ConstantComposite 32 33 + 4(main): 2 Function None 3 + 5: Label + 69(x0): 68(ptr) Variable Function + 75(x1): 74(ptr) Variable Function + 113(v3): 112(ptr) Variable Function + 135(u3): 112(ptr) Variable Function + 29: 28(ptr) AccessChain 27(b1) 21 + 30: 6(int16_t) Load 29 + 31: 28(ptr) AccessChain 19(b2) 21 + Store 31 30 + 35: 34(ptr) AccessChain 19(b2) 33 + 36: 8(i16vec3) Load 35 + 38: 37(ivec3) SConvert 36 + 40: 39(ivec2) VectorShuffle 38 38 0 1 + 41: 7(i16vec2) SConvert 40 + 43: 42(ptr) AccessChain 19(b2) 32 + Store 43 41 + 52: 34(ptr) AccessChain 51(b5) 33 + 53: 8(i16vec3) Load 52 + 54: 37(ivec3) SConvert 53 + 55: 39(ivec2) VectorShuffle 54 54 0 1 + 56: 7(i16vec2) SConvert 55 + 57: 42(ptr) AccessChain 19(b2) 32 + Store 57 56 + 59: 28(ptr) AccessChain 19(b2) 58 21 + 60: 6(int16_t) Load 59 + 61: 28(ptr) AccessChain 19(b2) 58 21 + Store 61 60 + 62: 28(ptr) AccessChain 51(b5) 58 32 + 63: 6(int16_t) Load 62 + 64: 28(ptr) AccessChain 19(b2) 58 32 + Store 64 63 + 65: 42(ptr) AccessChain 19(b2) 32 + 66: 7(i16vec2) Load 65 + 67: 42(ptr) AccessChain 19(b2) 32 + Store 67 66 + 70: 28(ptr) AccessChain 27(b1) 21 + 71: 6(int16_t) Load 70 + 72: 20(int) SConvert 71 + Store 69(x0) 72 + 76: 28(ptr) AccessChain 27(b1) 21 + 77: 6(int16_t) Load 76 + 78: 20(int) SConvert 77 + 79: 42(ptr) AccessChain 19(b2) 32 + 80: 7(i16vec2) Load 79 + 81: 39(ivec2) SConvert 80 + 82: 20(int) CompositeExtract 81 0 + 83: 20(int) CompositeExtract 81 1 + 84: 73(ivec4) CompositeConstruct 78 82 83 32 + Store 75(x1) 84 + 98: 97(ptr) AccessChain 96(b3) 21 21 + 99: 87 Load 98 + 100: 97(ptr) AccessChain 92(b4) 21 21 + Store 100 99 + 101: 42(ptr) AccessChain 19(b2) 32 + 102: 7(i16vec2) Load 101 + 103: 39(ivec2) SConvert 102 + 105: 20(int) CompositeExtract 103 0 + 106: 6(int16_t) SConvert 105 + 107: 28(ptr) AccessChain 19(b2) 21 + Store 107 106 + 109: 42(ptr) AccessChain 19(b2) 108 32 32 + 110: 7(i16vec2) Load 109 + 111: 42(ptr) AccessChain 19(b2) 32 + Store 111 110 + 117: 116(ptr) AccessChain 27(b1) 115 + 118: 20(int) Load 117 + 119: 28(ptr) AccessChain 19(b2) 114 118 + 120: 6(int16_t) Load 119 + 121: 20(int) SConvert 120 + 122: 116(ptr) AccessChain 27(b1) 115 + 123: 20(int) Load 122 + 124: 20(int) IAdd 123 32 + 125: 28(ptr) AccessChain 19(b2) 114 124 + 126: 6(int16_t) Load 125 + 127: 20(int) SConvert 126 + 128: 116(ptr) AccessChain 27(b1) 115 + 129: 20(int) Load 128 + 130: 20(int) IAdd 129 33 + 131: 28(ptr) AccessChain 19(b2) 114 130 + 132: 6(int16_t) Load 131 + 133: 20(int) SConvert 132 + 134: 37(ivec3) CompositeConstruct 121 127 133 + Store 113(v3) 134 + 136: 116(ptr) AccessChain 27(b1) 115 + 137: 20(int) Load 136 + 138: 28(ptr) AccessChain 51(b5) 114 137 + 139: 6(int16_t) Load 138 + 140: 20(int) SConvert 139 + 141: 116(ptr) AccessChain 27(b1) 115 + 142: 20(int) Load 141 + 143: 20(int) IAdd 142 32 + 144: 28(ptr) AccessChain 51(b5) 114 143 + 145: 6(int16_t) Load 144 + 146: 20(int) SConvert 145 + 147: 116(ptr) AccessChain 27(b1) 115 + 148: 20(int) Load 147 + 149: 20(int) IAdd 148 33 + 150: 28(ptr) AccessChain 51(b5) 114 149 + 151: 6(int16_t) Load 150 + 152: 20(int) SConvert 151 + 153: 37(ivec3) CompositeConstruct 140 146 152 + Store 135(u3) 153 + 154: 42(ptr) AccessChain 19(b2) 115 21 + 155: 7(i16vec2) Load 154 + 156: 42(ptr) AccessChain 19(b2) 115 21 + Store 156 155 + 157: 42(ptr) AccessChain 51(b5) 115 32 + 158: 7(i16vec2) Load 157 + 159: 42(ptr) AccessChain 19(b2) 115 32 + Store 159 158 + 160: 28(ptr) AccessChain 27(b1) 21 + 161: 6(int16_t) Load 160 + 162: 28(ptr) AccessChain 19(b2) 32 104 + Store 162 161 + 163: 28(ptr) AccessChain 19(b2) 32 104 + 164: 6(int16_t) Load 163 + 165: 28(ptr) AccessChain 19(b2) 21 + Store 165 164 + 167: 7(i16vec2) SConvert 166 + 168: 42(ptr) AccessChain 19(b2) 32 + Store 168 167 + 169: 6(int16_t) SConvert 58 + 170: 28(ptr) AccessChain 19(b2) 21 + Store 170 169 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.16bitstorage-uint.frag.out b/deps/glslang/Test/baseResults/spv.16bitstorage-uint.frag.out new file mode 100644 index 00000000..f935f266 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.16bitstorage-uint.frag.out @@ -0,0 +1,336 @@ +spv.16bitstorage-uint.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 173 + + Capability Shader + Capability StorageUniformBufferBlock16 + Capability StorageUniform16 + Extension "SPV_KHR_16bit_storage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_shader_16bit_storage" + Name 4 "main" + Name 12 "S" + MemberName 12(S) 0 "x" + MemberName 12(S) 1 "y" + MemberName 12(S) 2 "z" + Name 17 "B2" + MemberName 17(B2) 0 "o" + MemberName 17(B2) 1 "p" + MemberName 17(B2) 2 "q" + MemberName 17(B2) 3 "r" + MemberName 17(B2) 4 "u" + MemberName 17(B2) 5 "v" + MemberName 17(B2) 6 "x" + MemberName 17(B2) 7 "w" + Name 19 "b2" + Name 23 "S" + MemberName 23(S) 0 "x" + MemberName 23(S) 1 "y" + MemberName 23(S) 2 "z" + Name 25 "B1" + MemberName 25(B1) 0 "a" + MemberName 25(B1) 1 "b" + MemberName 25(B1) 2 "c" + MemberName 25(B1) 3 "d" + MemberName 25(B1) 4 "g" + MemberName 25(B1) 5 "h" + MemberName 25(B1) 6 "j" + Name 27 "b1" + Name 45 "S" + MemberName 45(S) 0 "x" + MemberName 45(S) 1 "y" + MemberName 45(S) 2 "z" + Name 49 "B5" + MemberName 49(B5) 0 "o" + MemberName 49(B5) 1 "p" + MemberName 49(B5) 2 "q" + MemberName 49(B5) 3 "r" + MemberName 49(B5) 4 "u" + MemberName 49(B5) 5 "v" + MemberName 49(B5) 6 "x" + MemberName 49(B5) 7 "w" + Name 51 "b5" + Name 69 "x0" + Name 75 "x1" + Name 89 "S2" + MemberName 89(S2) 0 "x" + MemberName 89(S2) 1 "y" + MemberName 89(S2) 2 "z" + Name 90 "S3" + MemberName 90(S3) 0 "x" + Name 91 "B4" + MemberName 91(B4) 0 "x" + MemberName 91(B4) 1 "y" + Name 93 "b4" + Name 94 "S2" + MemberName 94(S2) 0 "x" + MemberName 94(S2) 1 "y" + MemberName 94(S2) 2 "z" + Name 95 "B3" + MemberName 95(B3) 0 "x" + Name 97 "b3" + Name 114 "v3" + Name 136 "u3" + Decorate 11 ArrayStride 2 + MemberDecorate 12(S) 0 Offset 0 + MemberDecorate 12(S) 1 Offset 4 + MemberDecorate 12(S) 2 Offset 8 + Decorate 13 ArrayStride 16 + Decorate 15 ArrayStride 4 + Decorate 16 ArrayStride 2 + MemberDecorate 17(B2) 0 Offset 0 + MemberDecorate 17(B2) 1 Offset 4 + MemberDecorate 17(B2) 2 Offset 8 + MemberDecorate 17(B2) 3 Offset 14 + MemberDecorate 17(B2) 4 Offset 24 + MemberDecorate 17(B2) 5 Offset 40 + MemberDecorate 17(B2) 6 Offset 72 + MemberDecorate 17(B2) 7 Offset 472 + Decorate 17(B2) BufferBlock + Decorate 19(b2) DescriptorSet 0 + Decorate 22 ArrayStride 16 + MemberDecorate 23(S) 0 Offset 0 + MemberDecorate 23(S) 1 Offset 4 + MemberDecorate 23(S) 2 Offset 8 + Decorate 24 ArrayStride 16 + MemberDecorate 25(B1) 0 Offset 0 + MemberDecorate 25(B1) 1 Offset 4 + MemberDecorate 25(B1) 2 Offset 8 + MemberDecorate 25(B1) 3 Offset 16 + MemberDecorate 25(B1) 4 Offset 48 + MemberDecorate 25(B1) 5 Offset 64 + MemberDecorate 25(B1) 6 Offset 96 + Decorate 25(B1) Block + Decorate 27(b1) DescriptorSet 0 + Decorate 44 ArrayStride 16 + MemberDecorate 45(S) 0 Offset 0 + MemberDecorate 45(S) 1 Offset 4 + MemberDecorate 45(S) 2 Offset 8 + Decorate 46 ArrayStride 16 + Decorate 47 ArrayStride 16 + Decorate 48 ArrayStride 16 + MemberDecorate 49(B5) 0 Offset 0 + MemberDecorate 49(B5) 1 Offset 4 + MemberDecorate 49(B5) 2 Offset 8 + MemberDecorate 49(B5) 3 Offset 16 + MemberDecorate 49(B5) 4 Offset 48 + MemberDecorate 49(B5) 5 Offset 64 + MemberDecorate 49(B5) 6 Offset 96 + MemberDecorate 49(B5) 7 Offset 1696 + Decorate 49(B5) Block + Decorate 51(b5) DescriptorSet 0 + MemberDecorate 89(S2) 0 ColMajor + MemberDecorate 89(S2) 0 Offset 0 + MemberDecorate 89(S2) 0 MatrixStride 16 + MemberDecorate 89(S2) 1 Offset 64 + MemberDecorate 89(S2) 2 Offset 68 + MemberDecorate 90(S3) 0 Offset 0 + MemberDecorate 91(B4) 0 Offset 0 + MemberDecorate 91(B4) 1 Offset 80 + Decorate 91(B4) BufferBlock + Decorate 93(b4) DescriptorSet 0 + MemberDecorate 94(S2) 0 RowMajor + MemberDecorate 94(S2) 0 Offset 0 + MemberDecorate 94(S2) 0 MatrixStride 16 + MemberDecorate 94(S2) 1 Offset 64 + MemberDecorate 94(S2) 2 Offset 68 + MemberDecorate 95(B3) 0 Offset 0 + Decorate 95(B3) BufferBlock + Decorate 97(b3) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 16 0 + 7: TypeVector 6(int16_t) 2 + 8: TypeVector 6(int16_t) 3 + 9: TypeInt 32 0 + 10: 9(int) Constant 2 + 11: TypeArray 6(int16_t) 10 + 12(S): TypeStruct 6(int16_t) 7(i16vec2) 8(i16vec3) + 13: TypeArray 12(S) 10 + 14: 9(int) Constant 100 + 15: TypeArray 7(i16vec2) 14 + 16: TypeRuntimeArray 6(int16_t) + 17(B2): TypeStruct 6(int16_t) 7(i16vec2) 8(i16vec3) 11 12(S) 13 15 16 + 18: TypePointer Uniform 17(B2) + 19(b2): 18(ptr) Variable Uniform + 20: TypeInt 32 1 + 21: 20(int) Constant 0 + 22: TypeArray 6(int16_t) 10 + 23(S): TypeStruct 6(int16_t) 7(i16vec2) 8(i16vec3) + 24: TypeArray 23(S) 10 + 25(B1): TypeStruct 6(int16_t) 7(i16vec2) 8(i16vec3) 22 23(S) 24 9(int) + 26: TypePointer Uniform 25(B1) + 27(b1): 26(ptr) Variable Uniform + 28: TypePointer Uniform 6(int16_t) + 32: 20(int) Constant 1 + 33: 20(int) Constant 2 + 34: TypePointer Uniform 8(i16vec3) + 37: TypeVector 9(int) 3 + 39: TypeVector 9(int) 2 + 42: TypePointer Uniform 7(i16vec2) + 44: TypeArray 6(int16_t) 10 + 45(S): TypeStruct 6(int16_t) 7(i16vec2) 8(i16vec3) + 46: TypeArray 45(S) 10 + 47: TypeArray 7(i16vec2) 14 + 48: TypeArray 6(int16_t) 14 + 49(B5): TypeStruct 6(int16_t) 7(i16vec2) 8(i16vec3) 44 45(S) 46 47 48 + 50: TypePointer Uniform 49(B5) + 51(b5): 50(ptr) Variable Uniform + 58: 20(int) Constant 3 + 68: TypePointer Function 9(int) + 73: TypeVector 9(int) 4 + 74: TypePointer Function 73(ivec4) + 82: 9(int) Constant 1 + 86: TypeFloat 32 + 87: TypeVector 86(float) 4 + 88: TypeMatrix 87(fvec4) 4 + 89(S2): TypeStruct 88 6(int16_t) 9(int) + 90(S3): TypeStruct 89(S2) + 91(B4): TypeStruct 89(S2) 90(S3) + 92: TypePointer Uniform 91(B4) + 93(b4): 92(ptr) Variable Uniform + 94(S2): TypeStruct 88 6(int16_t) 9(int) + 95(B3): TypeStruct 94(S2) + 96: TypePointer Uniform 95(B3) + 97(b3): 96(ptr) Variable Uniform + 98: TypePointer Uniform 88 + 105: 9(int) Constant 0 + 109: 20(int) Constant 5 + 113: TypePointer Function 37(ivec3) + 115: 20(int) Constant 7 + 116: 20(int) Constant 6 + 117: TypePointer Uniform 9(int) + 167: 39(ivec2) ConstantComposite 82 10 + 170: 9(int) Constant 3 + 4(main): 2 Function None 3 + 5: Label + 69(x0): 68(ptr) Variable Function + 75(x1): 74(ptr) Variable Function + 114(v3): 113(ptr) Variable Function + 136(u3): 113(ptr) Variable Function + 29: 28(ptr) AccessChain 27(b1) 21 + 30: 6(int16_t) Load 29 + 31: 28(ptr) AccessChain 19(b2) 21 + Store 31 30 + 35: 34(ptr) AccessChain 19(b2) 33 + 36: 8(i16vec3) Load 35 + 38: 37(ivec3) UConvert 36 + 40: 39(ivec2) VectorShuffle 38 38 0 1 + 41: 7(i16vec2) UConvert 40 + 43: 42(ptr) AccessChain 19(b2) 32 + Store 43 41 + 52: 34(ptr) AccessChain 51(b5) 33 + 53: 8(i16vec3) Load 52 + 54: 37(ivec3) UConvert 53 + 55: 39(ivec2) VectorShuffle 54 54 0 1 + 56: 7(i16vec2) UConvert 55 + 57: 42(ptr) AccessChain 19(b2) 32 + Store 57 56 + 59: 28(ptr) AccessChain 19(b2) 58 21 + 60: 6(int16_t) Load 59 + 61: 28(ptr) AccessChain 19(b2) 58 21 + Store 61 60 + 62: 28(ptr) AccessChain 51(b5) 58 32 + 63: 6(int16_t) Load 62 + 64: 28(ptr) AccessChain 19(b2) 58 32 + Store 64 63 + 65: 42(ptr) AccessChain 19(b2) 32 + 66: 7(i16vec2) Load 65 + 67: 42(ptr) AccessChain 19(b2) 32 + Store 67 66 + 70: 28(ptr) AccessChain 27(b1) 21 + 71: 6(int16_t) Load 70 + 72: 9(int) UConvert 71 + Store 69(x0) 72 + 76: 28(ptr) AccessChain 27(b1) 21 + 77: 6(int16_t) Load 76 + 78: 9(int) UConvert 77 + 79: 42(ptr) AccessChain 19(b2) 32 + 80: 7(i16vec2) Load 79 + 81: 39(ivec2) UConvert 80 + 83: 9(int) CompositeExtract 81 0 + 84: 9(int) CompositeExtract 81 1 + 85: 73(ivec4) CompositeConstruct 78 83 84 82 + Store 75(x1) 85 + 99: 98(ptr) AccessChain 97(b3) 21 21 + 100: 88 Load 99 + 101: 98(ptr) AccessChain 93(b4) 21 21 + Store 101 100 + 102: 42(ptr) AccessChain 19(b2) 32 + 103: 7(i16vec2) Load 102 + 104: 39(ivec2) UConvert 103 + 106: 9(int) CompositeExtract 104 0 + 107: 6(int16_t) UConvert 106 + 108: 28(ptr) AccessChain 19(b2) 21 + Store 108 107 + 110: 42(ptr) AccessChain 19(b2) 109 32 32 + 111: 7(i16vec2) Load 110 + 112: 42(ptr) AccessChain 19(b2) 32 + Store 112 111 + 118: 117(ptr) AccessChain 27(b1) 116 + 119: 9(int) Load 118 + 120: 28(ptr) AccessChain 19(b2) 115 119 + 121: 6(int16_t) Load 120 + 122: 9(int) UConvert 121 + 123: 117(ptr) AccessChain 27(b1) 116 + 124: 9(int) Load 123 + 125: 9(int) IAdd 124 82 + 126: 28(ptr) AccessChain 19(b2) 115 125 + 127: 6(int16_t) Load 126 + 128: 9(int) UConvert 127 + 129: 117(ptr) AccessChain 27(b1) 116 + 130: 9(int) Load 129 + 131: 9(int) IAdd 130 10 + 132: 28(ptr) AccessChain 19(b2) 115 131 + 133: 6(int16_t) Load 132 + 134: 9(int) UConvert 133 + 135: 37(ivec3) CompositeConstruct 122 128 134 + Store 114(v3) 135 + 137: 117(ptr) AccessChain 27(b1) 116 + 138: 9(int) Load 137 + 139: 28(ptr) AccessChain 51(b5) 115 138 + 140: 6(int16_t) Load 139 + 141: 9(int) UConvert 140 + 142: 117(ptr) AccessChain 27(b1) 116 + 143: 9(int) Load 142 + 144: 9(int) IAdd 143 82 + 145: 28(ptr) AccessChain 51(b5) 115 144 + 146: 6(int16_t) Load 145 + 147: 9(int) UConvert 146 + 148: 117(ptr) AccessChain 27(b1) 116 + 149: 9(int) Load 148 + 150: 9(int) IAdd 149 10 + 151: 28(ptr) AccessChain 51(b5) 115 150 + 152: 6(int16_t) Load 151 + 153: 9(int) UConvert 152 + 154: 37(ivec3) CompositeConstruct 141 147 153 + Store 136(u3) 154 + 155: 42(ptr) AccessChain 19(b2) 116 21 + 156: 7(i16vec2) Load 155 + 157: 42(ptr) AccessChain 19(b2) 116 21 + Store 157 156 + 158: 42(ptr) AccessChain 51(b5) 116 32 + 159: 7(i16vec2) Load 158 + 160: 42(ptr) AccessChain 19(b2) 116 32 + Store 160 159 + 161: 28(ptr) AccessChain 27(b1) 21 + 162: 6(int16_t) Load 161 + 163: 28(ptr) AccessChain 19(b2) 32 105 + Store 163 162 + 164: 28(ptr) AccessChain 19(b2) 32 105 + 165: 6(int16_t) Load 164 + 166: 28(ptr) AccessChain 19(b2) 21 + Store 166 165 + 168: 7(i16vec2) UConvert 167 + 169: 42(ptr) AccessChain 19(b2) 32 + Store 169 168 + 171: 6(int16_t) UConvert 170 + 172: 28(ptr) AccessChain 19(b2) 21 + Store 172 171 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.16bitstorage.frag.out b/deps/glslang/Test/baseResults/spv.16bitstorage.frag.out new file mode 100644 index 00000000..d2a83ba9 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.16bitstorage.frag.out @@ -0,0 +1,336 @@ +spv.16bitstorage.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 173 + + Capability Shader + Capability StorageUniformBufferBlock16 + Capability StorageUniform16 + Extension "SPV_KHR_16bit_storage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_shader_16bit_storage" + Name 4 "main" + Name 12 "S" + MemberName 12(S) 0 "x" + MemberName 12(S) 1 "y" + MemberName 12(S) 2 "z" + Name 17 "B2" + MemberName 17(B2) 0 "o" + MemberName 17(B2) 1 "p" + MemberName 17(B2) 2 "q" + MemberName 17(B2) 3 "r" + MemberName 17(B2) 4 "u" + MemberName 17(B2) 5 "v" + MemberName 17(B2) 6 "x" + MemberName 17(B2) 7 "w" + Name 19 "b2" + Name 23 "S" + MemberName 23(S) 0 "x" + MemberName 23(S) 1 "y" + MemberName 23(S) 2 "z" + Name 25 "B1" + MemberName 25(B1) 0 "a" + MemberName 25(B1) 1 "b" + MemberName 25(B1) 2 "c" + MemberName 25(B1) 3 "d" + MemberName 25(B1) 4 "g" + MemberName 25(B1) 5 "h" + MemberName 25(B1) 6 "j" + Name 27 "b1" + Name 46 "S" + MemberName 46(S) 0 "x" + MemberName 46(S) 1 "y" + MemberName 46(S) 2 "z" + Name 50 "B5" + MemberName 50(B5) 0 "o" + MemberName 50(B5) 1 "p" + MemberName 50(B5) 2 "q" + MemberName 50(B5) 3 "r" + MemberName 50(B5) 4 "u" + MemberName 50(B5) 5 "v" + MemberName 50(B5) 6 "x" + MemberName 50(B5) 7 "w" + Name 52 "b5" + Name 70 "x0" + Name 76 "x1" + Name 88 "S2" + MemberName 88(S2) 0 "x" + MemberName 88(S2) 1 "y" + MemberName 88(S2) 2 "z" + Name 89 "S3" + MemberName 89(S3) 0 "x" + Name 90 "B4" + MemberName 90(B4) 0 "x" + MemberName 90(B4) 1 "y" + Name 92 "b4" + Name 93 "S2" + MemberName 93(S2) 0 "x" + MemberName 93(S2) 1 "y" + MemberName 93(S2) 2 "z" + Name 94 "B3" + MemberName 94(B3) 0 "x" + Name 96 "b3" + Name 113 "v3" + Name 135 "u3" + Decorate 11 ArrayStride 2 + MemberDecorate 12(S) 0 Offset 0 + MemberDecorate 12(S) 1 Offset 4 + MemberDecorate 12(S) 2 Offset 8 + Decorate 13 ArrayStride 16 + Decorate 15 ArrayStride 4 + Decorate 16 ArrayStride 2 + MemberDecorate 17(B2) 0 Offset 0 + MemberDecorate 17(B2) 1 Offset 4 + MemberDecorate 17(B2) 2 Offset 8 + MemberDecorate 17(B2) 3 Offset 14 + MemberDecorate 17(B2) 4 Offset 24 + MemberDecorate 17(B2) 5 Offset 40 + MemberDecorate 17(B2) 6 Offset 72 + MemberDecorate 17(B2) 7 Offset 472 + Decorate 17(B2) BufferBlock + Decorate 19(b2) DescriptorSet 0 + Decorate 22 ArrayStride 16 + MemberDecorate 23(S) 0 Offset 0 + MemberDecorate 23(S) 1 Offset 4 + MemberDecorate 23(S) 2 Offset 8 + Decorate 24 ArrayStride 16 + MemberDecorate 25(B1) 0 Offset 0 + MemberDecorate 25(B1) 1 Offset 4 + MemberDecorate 25(B1) 2 Offset 8 + MemberDecorate 25(B1) 3 Offset 16 + MemberDecorate 25(B1) 4 Offset 48 + MemberDecorate 25(B1) 5 Offset 64 + MemberDecorate 25(B1) 6 Offset 96 + Decorate 25(B1) Block + Decorate 27(b1) DescriptorSet 0 + Decorate 45 ArrayStride 16 + MemberDecorate 46(S) 0 Offset 0 + MemberDecorate 46(S) 1 Offset 4 + MemberDecorate 46(S) 2 Offset 8 + Decorate 47 ArrayStride 16 + Decorate 48 ArrayStride 16 + Decorate 49 ArrayStride 16 + MemberDecorate 50(B5) 0 Offset 0 + MemberDecorate 50(B5) 1 Offset 4 + MemberDecorate 50(B5) 2 Offset 8 + MemberDecorate 50(B5) 3 Offset 16 + MemberDecorate 50(B5) 4 Offset 48 + MemberDecorate 50(B5) 5 Offset 64 + MemberDecorate 50(B5) 6 Offset 96 + MemberDecorate 50(B5) 7 Offset 1696 + Decorate 50(B5) Block + Decorate 52(b5) DescriptorSet 0 + MemberDecorate 88(S2) 0 ColMajor + MemberDecorate 88(S2) 0 Offset 0 + MemberDecorate 88(S2) 0 MatrixStride 16 + MemberDecorate 88(S2) 1 Offset 64 + MemberDecorate 88(S2) 2 Offset 68 + MemberDecorate 89(S3) 0 Offset 0 + MemberDecorate 90(B4) 0 Offset 0 + MemberDecorate 90(B4) 1 Offset 80 + Decorate 90(B4) BufferBlock + Decorate 92(b4) DescriptorSet 0 + MemberDecorate 93(S2) 0 RowMajor + MemberDecorate 93(S2) 0 Offset 0 + MemberDecorate 93(S2) 0 MatrixStride 16 + MemberDecorate 93(S2) 1 Offset 64 + MemberDecorate 93(S2) 2 Offset 68 + MemberDecorate 94(B3) 0 Offset 0 + Decorate 94(B3) BufferBlock + Decorate 96(b3) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 16 + 7: TypeVector 6(float16_t) 2 + 8: TypeVector 6(float16_t) 3 + 9: TypeInt 32 0 + 10: 9(int) Constant 2 + 11: TypeArray 6(float16_t) 10 + 12(S): TypeStruct 6(float16_t) 7(f16vec2) 8(f16vec3) + 13: TypeArray 12(S) 10 + 14: 9(int) Constant 100 + 15: TypeArray 7(f16vec2) 14 + 16: TypeRuntimeArray 6(float16_t) + 17(B2): TypeStruct 6(float16_t) 7(f16vec2) 8(f16vec3) 11 12(S) 13 15 16 + 18: TypePointer Uniform 17(B2) + 19(b2): 18(ptr) Variable Uniform + 20: TypeInt 32 1 + 21: 20(int) Constant 0 + 22: TypeArray 6(float16_t) 10 + 23(S): TypeStruct 6(float16_t) 7(f16vec2) 8(f16vec3) + 24: TypeArray 23(S) 10 + 25(B1): TypeStruct 6(float16_t) 7(f16vec2) 8(f16vec3) 22 23(S) 24 20(int) + 26: TypePointer Uniform 25(B1) + 27(b1): 26(ptr) Variable Uniform + 28: TypePointer Uniform 6(float16_t) + 32: 20(int) Constant 1 + 33: 20(int) Constant 2 + 34: TypePointer Uniform 8(f16vec3) + 37: TypeFloat 32 + 38: TypeVector 37(float) 3 + 40: TypeVector 37(float) 2 + 43: TypePointer Uniform 7(f16vec2) + 45: TypeArray 6(float16_t) 10 + 46(S): TypeStruct 6(float16_t) 7(f16vec2) 8(f16vec3) + 47: TypeArray 46(S) 10 + 48: TypeArray 7(f16vec2) 14 + 49: TypeArray 6(float16_t) 14 + 50(B5): TypeStruct 6(float16_t) 7(f16vec2) 8(f16vec3) 45 46(S) 47 48 49 + 51: TypePointer Uniform 50(B5) + 52(b5): 51(ptr) Variable Uniform + 59: 20(int) Constant 3 + 69: TypePointer Function 37(float) + 74: TypeVector 37(float) 4 + 75: TypePointer Function 74(fvec4) + 83: 37(float) Constant 1065353216 + 87: TypeMatrix 74(fvec4) 4 + 88(S2): TypeStruct 87 6(float16_t) 37(float) + 89(S3): TypeStruct 88(S2) + 90(B4): TypeStruct 88(S2) 89(S3) + 91: TypePointer Uniform 90(B4) + 92(b4): 91(ptr) Variable Uniform + 93(S2): TypeStruct 87 6(float16_t) 37(float) + 94(B3): TypeStruct 93(S2) + 95: TypePointer Uniform 94(B3) + 96(b3): 95(ptr) Variable Uniform + 97: TypePointer Uniform 87 + 104: 9(int) Constant 0 + 108: 20(int) Constant 5 + 112: TypePointer Function 38(fvec3) + 114: 20(int) Constant 7 + 115: 20(int) Constant 6 + 116: TypePointer Uniform 20(int) + 166: 37(float) Constant 1073741824 + 167: 40(fvec2) ConstantComposite 83 166 + 170: 37(float) Constant 1077936128 + 4(main): 2 Function None 3 + 5: Label + 70(x0): 69(ptr) Variable Function + 76(x1): 75(ptr) Variable Function + 113(v3): 112(ptr) Variable Function + 135(u3): 112(ptr) Variable Function + 29: 28(ptr) AccessChain 27(b1) 21 + 30:6(float16_t) Load 29 + 31: 28(ptr) AccessChain 19(b2) 21 + Store 31 30 + 35: 34(ptr) AccessChain 19(b2) 33 + 36: 8(f16vec3) Load 35 + 39: 38(fvec3) FConvert 36 + 41: 40(fvec2) VectorShuffle 39 39 0 1 + 42: 7(f16vec2) FConvert 41 + 44: 43(ptr) AccessChain 19(b2) 32 + Store 44 42 + 53: 34(ptr) AccessChain 52(b5) 33 + 54: 8(f16vec3) Load 53 + 55: 38(fvec3) FConvert 54 + 56: 40(fvec2) VectorShuffle 55 55 0 1 + 57: 7(f16vec2) FConvert 56 + 58: 43(ptr) AccessChain 19(b2) 32 + Store 58 57 + 60: 28(ptr) AccessChain 19(b2) 59 21 + 61:6(float16_t) Load 60 + 62: 28(ptr) AccessChain 19(b2) 59 21 + Store 62 61 + 63: 28(ptr) AccessChain 52(b5) 59 32 + 64:6(float16_t) Load 63 + 65: 28(ptr) AccessChain 19(b2) 59 32 + Store 65 64 + 66: 43(ptr) AccessChain 19(b2) 32 + 67: 7(f16vec2) Load 66 + 68: 43(ptr) AccessChain 19(b2) 32 + Store 68 67 + 71: 28(ptr) AccessChain 27(b1) 21 + 72:6(float16_t) Load 71 + 73: 37(float) FConvert 72 + Store 70(x0) 73 + 77: 28(ptr) AccessChain 27(b1) 21 + 78:6(float16_t) Load 77 + 79: 37(float) FConvert 78 + 80: 43(ptr) AccessChain 19(b2) 32 + 81: 7(f16vec2) Load 80 + 82: 40(fvec2) FConvert 81 + 84: 37(float) CompositeExtract 82 0 + 85: 37(float) CompositeExtract 82 1 + 86: 74(fvec4) CompositeConstruct 79 84 85 83 + Store 76(x1) 86 + 98: 97(ptr) AccessChain 96(b3) 21 21 + 99: 87 Load 98 + 100: 97(ptr) AccessChain 92(b4) 21 21 + Store 100 99 + 101: 43(ptr) AccessChain 19(b2) 32 + 102: 7(f16vec2) Load 101 + 103: 40(fvec2) FConvert 102 + 105: 37(float) CompositeExtract 103 0 + 106:6(float16_t) FConvert 105 + 107: 28(ptr) AccessChain 19(b2) 21 + Store 107 106 + 109: 43(ptr) AccessChain 19(b2) 108 32 32 + 110: 7(f16vec2) Load 109 + 111: 43(ptr) AccessChain 19(b2) 32 + Store 111 110 + 117: 116(ptr) AccessChain 27(b1) 115 + 118: 20(int) Load 117 + 119: 28(ptr) AccessChain 19(b2) 114 118 + 120:6(float16_t) Load 119 + 121: 37(float) FConvert 120 + 122: 116(ptr) AccessChain 27(b1) 115 + 123: 20(int) Load 122 + 124: 20(int) IAdd 123 32 + 125: 28(ptr) AccessChain 19(b2) 114 124 + 126:6(float16_t) Load 125 + 127: 37(float) FConvert 126 + 128: 116(ptr) AccessChain 27(b1) 115 + 129: 20(int) Load 128 + 130: 20(int) IAdd 129 33 + 131: 28(ptr) AccessChain 19(b2) 114 130 + 132:6(float16_t) Load 131 + 133: 37(float) FConvert 132 + 134: 38(fvec3) CompositeConstruct 121 127 133 + Store 113(v3) 134 + 136: 116(ptr) AccessChain 27(b1) 115 + 137: 20(int) Load 136 + 138: 28(ptr) AccessChain 52(b5) 114 137 + 139:6(float16_t) Load 138 + 140: 37(float) FConvert 139 + 141: 116(ptr) AccessChain 27(b1) 115 + 142: 20(int) Load 141 + 143: 20(int) IAdd 142 32 + 144: 28(ptr) AccessChain 52(b5) 114 143 + 145:6(float16_t) Load 144 + 146: 37(float) FConvert 145 + 147: 116(ptr) AccessChain 27(b1) 115 + 148: 20(int) Load 147 + 149: 20(int) IAdd 148 33 + 150: 28(ptr) AccessChain 52(b5) 114 149 + 151:6(float16_t) Load 150 + 152: 37(float) FConvert 151 + 153: 38(fvec3) CompositeConstruct 140 146 152 + Store 135(u3) 153 + 154: 43(ptr) AccessChain 19(b2) 115 21 + 155: 7(f16vec2) Load 154 + 156: 43(ptr) AccessChain 19(b2) 115 21 + Store 156 155 + 157: 43(ptr) AccessChain 52(b5) 115 32 + 158: 7(f16vec2) Load 157 + 159: 43(ptr) AccessChain 19(b2) 115 32 + Store 159 158 + 160: 28(ptr) AccessChain 27(b1) 21 + 161:6(float16_t) Load 160 + 162: 28(ptr) AccessChain 19(b2) 32 104 + Store 162 161 + 163: 28(ptr) AccessChain 19(b2) 32 104 + 164:6(float16_t) Load 163 + 165: 28(ptr) AccessChain 19(b2) 21 + Store 165 164 + 168: 7(f16vec2) FConvert 167 + 169: 43(ptr) AccessChain 19(b2) 32 + Store 169 168 + 171:6(float16_t) FConvert 170 + 172: 28(ptr) AccessChain 19(b2) 21 + Store 172 171 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.16bitstorage_Error-int.frag.out b/deps/glslang/Test/baseResults/spv.16bitstorage_Error-int.frag.out new file mode 100644 index 00000000..40552583 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.16bitstorage_Error-int.frag.out @@ -0,0 +1,91 @@ +spv.16bitstorage_Error-int.frag +ERROR: 0:54: 'structure: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:58: 'return: can't use with structs containing int16' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:61: 'int16_t: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:74: '[: does not operate on types containing (u)int16' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:75: '.: can't swizzle types containing (u)int16' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:76: 'built-in function: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:76: 'built-in function: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:76: 'built-in function: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:77: 'built-in function: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:77: 'built-in function: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:78: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform int16_t' and a right operand of type 'layout( column_major std140 offset=0) uniform int16_t' (or there is no acceptable conversion) +ERROR: 0:79: '-' : wrong operand type no operation '-' exists that takes an operand of type layout( column_major std140 offset=0) uniform int16_t (or there is no acceptable conversion) +ERROR: 0:80: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform int16_t' and a right operand of type ' const int' (or there is no acceptable conversion) +ERROR: 0:81: '.: can't swizzle types containing (u)int16' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:82: '=: can't use with structs containing int16' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:83: 'qualifier: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:84: 'qualifier: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:85: 'qualifier: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:86: '==' : wrong operand types: no operation '==' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform int16_t' and a right operand of type 'layout( column_major std140 offset=0) uniform int16_t' (or there is no acceptable conversion) +ERROR: 0:87: '=: can't use with arrays containing int16' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:88: 'constructor: 16-bit vectors only take vector types' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:89: 'constructor: 16-bit arrays not supported' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:89: 'constructor: 16-bit vectors only take vector types' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:92: 'constructor: can't construct structure containing 16-bit type' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:93: 'func2' : no matching overloaded function found +ERROR: 0:99: '' : syntax error, unexpected IDENTIFIER +ERROR: 26 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.16bitstorage_Error-uint.frag.out b/deps/glslang/Test/baseResults/spv.16bitstorage_Error-uint.frag.out new file mode 100644 index 00000000..bff46d44 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.16bitstorage_Error-uint.frag.out @@ -0,0 +1,91 @@ +spv.16bitstorage_Error-uint.frag +ERROR: 0:54: 'structure: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:58: 'return: can't use with structs containing uint16' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:61: 'uint16_t: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:74: '[: does not operate on types containing (u)int16' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:75: '.: can't swizzle types containing (u)int16' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:76: 'built-in function: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:76: 'built-in function: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:76: 'built-in function: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:77: 'built-in function: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:77: 'built-in function: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:78: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform uint16_t' and a right operand of type 'layout( column_major std140 offset=0) uniform uint16_t' (or there is no acceptable conversion) +ERROR: 0:79: '-' : wrong operand type no operation '-' exists that takes an operand of type layout( column_major std140 offset=0) uniform uint16_t (or there is no acceptable conversion) +ERROR: 0:80: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform uint16_t' and a right operand of type ' const int' (or there is no acceptable conversion) +ERROR: 0:81: '.: can't swizzle types containing (u)int16' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:82: '=: can't use with structs containing uint16' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:83: 'qualifier: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:84: 'qualifier: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:85: 'qualifier: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:86: '==' : wrong operand types: no operation '==' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform uint16_t' and a right operand of type 'layout( column_major std140 offset=0) uniform uint16_t' (or there is no acceptable conversion) +ERROR: 0:87: '=: can't use with arrays containing uint16' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:88: 'constructor: 16-bit vectors only take vector types' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:89: 'constructor: 16-bit arrays not supported' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:89: 'constructor: 16-bit vectors only take vector types' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:92: 'constructor: can't construct structure containing 16-bit type' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_int16 +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int16 +ERROR: 0:93: 'func2' : no matching overloaded function found +ERROR: 0:99: '' : syntax error, unexpected IDENTIFIER +ERROR: 26 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.16bitstorage_Error.frag.out b/deps/glslang/Test/baseResults/spv.16bitstorage_Error.frag.out new file mode 100644 index 00000000..08c75e73 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.16bitstorage_Error.frag.out @@ -0,0 +1,99 @@ +spv.16bitstorage_Error.frag +ERROR: 0:54: 'structure: float16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:58: 'return: can't use with structs containing float16' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:61: 'float16_t: float16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:74: '[: does not operate on types containing float16' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:75: '.: can't swizzle types containing float16' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:76: 'built-in function: float16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:76: 'built-in function: float16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:76: 'built-in function: float16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:77: 'built-in function: float16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:77: 'built-in function: float16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:78: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform float16_t' and a right operand of type 'layout( column_major std140 offset=0) uniform float16_t' (or there is no acceptable conversion) +ERROR: 0:79: '-' : wrong operand type no operation '-' exists that takes an operand of type layout( column_major std140 offset=0) uniform float16_t (or there is no acceptable conversion) +ERROR: 0:80: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform float16_t' and a right operand of type ' const float' (or there is no acceptable conversion) +ERROR: 0:81: '.: can't swizzle types containing float16' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:82: '=: can't use with structs containing float16' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:83: 'qualifier: float16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:84: 'qualifier: float16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:85: 'qualifier: float16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:86: '==' : wrong operand types: no operation '==' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform float16_t' and a right operand of type 'layout( column_major std140 offset=0) uniform float16_t' (or there is no acceptable conversion) +ERROR: 0:87: '=: can't use with arrays containing float16' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:88: 'half floating-point suffix' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:88: 'half float literal' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:89: 'constructor: 16-bit vectors only take vector types' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:90: 'constructor: 16-bit arrays not supported' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:90: 'constructor: 16-bit vectors only take vector types' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:93: 'constructor: can't construct structure containing 16-bit type' : required extension not requested: Possible extensions include: +GL_AMD_gpu_shader_half_float +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_float16 +ERROR: 0:94: 'func2' : no matching overloaded function found +ERROR: 0:100: '' : syntax error, unexpected IDENTIFIER +ERROR: 28 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.300BuiltIns.vert.out b/deps/glslang/Test/baseResults/spv.300BuiltIns.vert.out new file mode 100644 index 00000000..ee2c236e --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.300BuiltIns.vert.out @@ -0,0 +1,73 @@ +spv.300BuiltIns.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 42 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 10 14 21 34 + Source ESSL 310 + Name 4 "main" + Name 8 "gl_PerVertex" + MemberName 8(gl_PerVertex) 0 "gl_Position" + MemberName 8(gl_PerVertex) 1 "gl_PointSize" + Name 10 "" + Name 14 "ps" + Name 21 "gl_VertexIndex" + Name 34 "gl_InstanceIndex" + MemberDecorate 8(gl_PerVertex) 0 Invariant + MemberDecorate 8(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 8(gl_PerVertex) 1 BuiltIn PointSize + Decorate 8(gl_PerVertex) Block + Decorate 14(ps) RelaxedPrecision + Decorate 15 RelaxedPrecision + Decorate 21(gl_VertexIndex) BuiltIn VertexIndex + Decorate 30 RelaxedPrecision + Decorate 34(gl_InstanceIndex) BuiltIn InstanceIndex + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(gl_PerVertex): TypeStruct 7(fvec4) 6(float) + 9: TypePointer Output 8(gl_PerVertex) + 10: 9(ptr) Variable Output + 11: TypeInt 32 1 + 12: 11(int) Constant 0 + 13: TypePointer Input 6(float) + 14(ps): 13(ptr) Variable Input + 17: TypePointer Output 7(fvec4) + 19: 11(int) Constant 4 + 20: TypePointer Input 11(int) +21(gl_VertexIndex): 20(ptr) Variable Input + 29: 11(int) Constant 1 + 31: TypePointer Output 6(float) + 33: 11(int) Constant 5 +34(gl_InstanceIndex): 20(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 15: 6(float) Load 14(ps) + 16: 7(fvec4) CompositeConstruct 15 15 15 15 + 18: 17(ptr) AccessChain 10 12 + Store 18 16 + 22: 11(int) Load 21(gl_VertexIndex) + 23: 11(int) ISub 19 22 + 24: 6(float) ConvertSToF 23 + 25: 17(ptr) AccessChain 10 12 + 26: 7(fvec4) Load 25 + 27: 7(fvec4) VectorTimesScalar 26 24 + 28: 17(ptr) AccessChain 10 12 + Store 28 27 + 30: 6(float) Load 14(ps) + 32: 31(ptr) AccessChain 10 29 + Store 32 30 + 35: 11(int) Load 34(gl_InstanceIndex) + 36: 11(int) ISub 33 35 + 37: 6(float) ConvertSToF 36 + 38: 31(ptr) AccessChain 10 29 + 39: 6(float) Load 38 + 40: 6(float) FMul 39 37 + 41: 31(ptr) AccessChain 10 29 + Store 41 40 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.300layout.frag.out b/deps/glslang/Test/baseResults/spv.300layout.frag.out new file mode 100644 index 00000000..10a6d00e --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.300layout.frag.out @@ -0,0 +1,73 @@ +spv.300layout.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 37 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 11 15 26 29 + ExecutionMode 4 OriginUpperLeft + Source ESSL 310 + Name 4 "main" + Name 9 "c" + Name 11 "color" + Name 13 "S" + MemberName 13(S) 0 "c" + MemberName 13(S) 1 "f" + Name 15 "s" + Name 26 "p" + Name 29 "pos" + Decorate 9(c) RelaxedPrecision + Decorate 9(c) Location 7 + Decorate 11(color) RelaxedPrecision + Decorate 12 RelaxedPrecision + MemberDecorate 13(S) 0 RelaxedPrecision + MemberDecorate 13(S) 1 RelaxedPrecision + Decorate 19 RelaxedPrecision + Decorate 20 RelaxedPrecision + Decorate 26(p) RelaxedPrecision + Decorate 26(p) Location 3 + Decorate 29(pos) RelaxedPrecision + Decorate 30 RelaxedPrecision + Decorate 33 RelaxedPrecision + Decorate 34 RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8: TypePointer Output 7(fvec3) + 9(c): 8(ptr) Variable Output + 10: TypePointer Input 7(fvec3) + 11(color): 10(ptr) Variable Input + 13(S): TypeStruct 7(fvec3) 6(float) + 14: TypePointer Input 13(S) + 15(s): 14(ptr) Variable Input + 16: TypeInt 32 1 + 17: 16(int) Constant 0 + 21: TypeVector 6(float) 4 + 22: TypeInt 32 0 + 23: 22(int) Constant 2 + 24: TypeArray 21(fvec4) 23 + 25: TypePointer Output 24 + 26(p): 25(ptr) Variable Output + 27: 16(int) Constant 1 + 28: TypePointer Input 21(fvec4) + 29(pos): 28(ptr) Variable Input + 31: TypePointer Input 6(float) + 35: TypePointer Output 21(fvec4) + 4(main): 2 Function None 3 + 5: Label + 12: 7(fvec3) Load 11(color) + 18: 10(ptr) AccessChain 15(s) 17 + 19: 7(fvec3) Load 18 + 20: 7(fvec3) FAdd 12 19 + Store 9(c) 20 + 30: 21(fvec4) Load 29(pos) + 32: 31(ptr) AccessChain 15(s) 27 + 33: 6(float) Load 32 + 34: 21(fvec4) VectorTimesScalar 30 33 + 36: 35(ptr) AccessChain 26(p) 27 + Store 36 34 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.300layout.vert.out b/deps/glslang/Test/baseResults/spv.300layout.vert.out new file mode 100644 index 00000000..0c0663e8 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.300layout.vert.out @@ -0,0 +1,248 @@ +spv.300layout.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 163 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 9 11 98 100 108 114 120 128 + Source ESSL 310 + Name 4 "main" + Name 9 "pos" + Name 11 "p" + Name 17 "Transform" + MemberName 17(Transform) 0 "M1" + MemberName 17(Transform) 1 "M2" + MemberName 17(Transform) 2 "N1" + MemberName 17(Transform) 3 "iuin" + Name 19 "tblock" + Name 45 "T3" + MemberName 45(T3) 0 "M3" + MemberName 45(T3) 1 "M4" + MemberName 45(T3) 2 "N2" + MemberName 45(T3) 3 "uv3a" + Name 47 "" + Name 78 "T2" + MemberName 78(T2) 0 "b" + MemberName 78(T2) 1 "t2m" + Name 80 "" + Name 98 "color" + Name 100 "c" + Name 108 "iout" + Name 114 "uiuin" + Name 120 "aiv2" + Name 126 "S" + MemberName 126(S) 0 "c" + MemberName 126(S) 1 "f" + Name 128 "s" + Decorate 11(p) Location 3 + MemberDecorate 17(Transform) 0 RowMajor + MemberDecorate 17(Transform) 0 Offset 0 + MemberDecorate 17(Transform) 0 MatrixStride 16 + MemberDecorate 17(Transform) 1 ColMajor + MemberDecorate 17(Transform) 1 Offset 64 + MemberDecorate 17(Transform) 1 MatrixStride 16 + MemberDecorate 17(Transform) 2 RowMajor + MemberDecorate 17(Transform) 2 Offset 128 + MemberDecorate 17(Transform) 2 MatrixStride 16 + MemberDecorate 17(Transform) 3 Offset 176 + Decorate 17(Transform) Block + Decorate 19(tblock) DescriptorSet 0 + Decorate 44 ArrayStride 16 + MemberDecorate 45(T3) 0 ColMajor + MemberDecorate 45(T3) 0 Offset 0 + MemberDecorate 45(T3) 0 MatrixStride 16 + MemberDecorate 45(T3) 1 RowMajor + MemberDecorate 45(T3) 1 Offset 64 + MemberDecorate 45(T3) 1 MatrixStride 16 + MemberDecorate 45(T3) 2 ColMajor + MemberDecorate 45(T3) 2 Offset 128 + MemberDecorate 45(T3) 2 MatrixStride 16 + MemberDecorate 45(T3) 3 Offset 2048 + Decorate 45(T3) Block + Decorate 47 DescriptorSet 0 + MemberDecorate 78(T2) 0 Offset 0 + MemberDecorate 78(T2) 1 RowMajor + MemberDecorate 78(T2) 1 Offset 16 + MemberDecorate 78(T2) 1 MatrixStride 16 + Decorate 78(T2) Block + Decorate 80 DescriptorSet 0 + Decorate 100(c) Location 7 + Decorate 108(iout) Flat + Decorate 120(aiv2) Location 9 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(pos): 8(ptr) Variable Output + 10: TypePointer Input 7(fvec4) + 11(p): 10(ptr) Variable Input + 13: TypeMatrix 7(fvec4) 4 + 14: TypeVector 6(float) 3 + 15: TypeMatrix 14(fvec3) 3 + 16: TypeInt 32 1 + 17(Transform): TypeStruct 13 13 15 16(int) + 18: TypePointer Uniform 17(Transform) + 19(tblock): 18(ptr) Variable Uniform + 20: 16(int) Constant 0 + 21: TypePointer Uniform 13 + 24: 16(int) Constant 1 + 40: TypeMatrix 14(fvec3) 2 + 41: TypeInt 32 0 + 42: TypeVector 41(int) 3 + 43: 41(int) Constant 4 + 44: TypeArray 42(ivec3) 43 + 45(T3): TypeStruct 13 13 40 44 + 46: TypePointer Uniform 45(T3) + 47: 46(ptr) Variable Uniform + 78(T2): TypeStruct 41(int) 13 + 79: TypePointer Uniform 78(T2) + 80: 79(ptr) Variable Uniform + 97: TypePointer Output 14(fvec3) + 98(color): 97(ptr) Variable Output + 99: TypePointer Input 14(fvec3) + 100(c): 99(ptr) Variable Input + 102: 16(int) Constant 2 + 103: TypePointer Uniform 15 + 107: TypePointer Output 16(int) + 108(iout): 107(ptr) Variable Output + 109: 16(int) Constant 3 + 110: TypePointer Uniform 16(int) + 113: TypePointer Input 41(int) + 114(uiuin): 113(ptr) Variable Input + 118: TypeVector 16(int) 2 + 119: TypePointer Input 118(ivec2) + 120(aiv2): 119(ptr) Variable Input + 121: 41(int) Constant 1 + 122: TypePointer Input 16(int) + 126(S): TypeStruct 14(fvec3) 6(float) + 127: TypePointer Output 126(S) + 128(s): 127(ptr) Variable Output + 131: 41(int) Constant 0 + 132: TypePointer Input 6(float) + 135: TypePointer Output 6(float) + 137: TypeBool + 138: TypePointer Uniform 14(fvec3) + 141: 6(float) Constant 1065353216 + 142: 14(fvec3) ConstantComposite 141 141 141 + 143: TypeVector 137(bool) 3 + 149: TypePointer Uniform 42(ivec3) + 152: 41(int) Constant 5 + 153: 42(ivec3) ConstantComposite 152 152 152 + 4(main): 2 Function None 3 + 5: Label + 12: 7(fvec4) Load 11(p) + 22: 21(ptr) AccessChain 19(tblock) 20 + 23: 13 Load 22 + 25: 21(ptr) AccessChain 19(tblock) 24 + 26: 13 Load 25 + 27: 7(fvec4) CompositeExtract 23 0 + 28: 7(fvec4) CompositeExtract 26 0 + 29: 7(fvec4) FAdd 27 28 + 30: 7(fvec4) CompositeExtract 23 1 + 31: 7(fvec4) CompositeExtract 26 1 + 32: 7(fvec4) FAdd 30 31 + 33: 7(fvec4) CompositeExtract 23 2 + 34: 7(fvec4) CompositeExtract 26 2 + 35: 7(fvec4) FAdd 33 34 + 36: 7(fvec4) CompositeExtract 23 3 + 37: 7(fvec4) CompositeExtract 26 3 + 38: 7(fvec4) FAdd 36 37 + 39: 13 CompositeConstruct 29 32 35 38 + 48: 21(ptr) AccessChain 47 24 + 49: 13 Load 48 + 50: 7(fvec4) CompositeExtract 39 0 + 51: 7(fvec4) CompositeExtract 49 0 + 52: 7(fvec4) FAdd 50 51 + 53: 7(fvec4) CompositeExtract 39 1 + 54: 7(fvec4) CompositeExtract 49 1 + 55: 7(fvec4) FAdd 53 54 + 56: 7(fvec4) CompositeExtract 39 2 + 57: 7(fvec4) CompositeExtract 49 2 + 58: 7(fvec4) FAdd 56 57 + 59: 7(fvec4) CompositeExtract 39 3 + 60: 7(fvec4) CompositeExtract 49 3 + 61: 7(fvec4) FAdd 59 60 + 62: 13 CompositeConstruct 52 55 58 61 + 63: 21(ptr) AccessChain 47 20 + 64: 13 Load 63 + 65: 7(fvec4) CompositeExtract 62 0 + 66: 7(fvec4) CompositeExtract 64 0 + 67: 7(fvec4) FAdd 65 66 + 68: 7(fvec4) CompositeExtract 62 1 + 69: 7(fvec4) CompositeExtract 64 1 + 70: 7(fvec4) FAdd 68 69 + 71: 7(fvec4) CompositeExtract 62 2 + 72: 7(fvec4) CompositeExtract 64 2 + 73: 7(fvec4) FAdd 71 72 + 74: 7(fvec4) CompositeExtract 62 3 + 75: 7(fvec4) CompositeExtract 64 3 + 76: 7(fvec4) FAdd 74 75 + 77: 13 CompositeConstruct 67 70 73 76 + 81: 21(ptr) AccessChain 80 24 + 82: 13 Load 81 + 83: 7(fvec4) CompositeExtract 77 0 + 84: 7(fvec4) CompositeExtract 82 0 + 85: 7(fvec4) FAdd 83 84 + 86: 7(fvec4) CompositeExtract 77 1 + 87: 7(fvec4) CompositeExtract 82 1 + 88: 7(fvec4) FAdd 86 87 + 89: 7(fvec4) CompositeExtract 77 2 + 90: 7(fvec4) CompositeExtract 82 2 + 91: 7(fvec4) FAdd 89 90 + 92: 7(fvec4) CompositeExtract 77 3 + 93: 7(fvec4) CompositeExtract 82 3 + 94: 7(fvec4) FAdd 92 93 + 95: 13 CompositeConstruct 85 88 91 94 + 96: 7(fvec4) VectorTimesMatrix 12 95 + Store 9(pos) 96 + 101: 14(fvec3) Load 100(c) + 104: 103(ptr) AccessChain 19(tblock) 102 + 105: 15 Load 104 + 106: 14(fvec3) VectorTimesMatrix 101 105 + Store 98(color) 106 + 111: 110(ptr) AccessChain 19(tblock) 109 + 112: 16(int) Load 111 + 115: 41(int) Load 114(uiuin) + 116: 16(int) Bitcast 115 + 117: 16(int) IAdd 112 116 + 123: 122(ptr) AccessChain 120(aiv2) 121 + 124: 16(int) Load 123 + 125: 16(int) IAdd 117 124 + Store 108(iout) 125 + 129: 14(fvec3) Load 100(c) + 130: 97(ptr) AccessChain 128(s) 20 + Store 130 129 + 133: 132(ptr) AccessChain 11(p) 131 + 134: 6(float) Load 133 + 136: 135(ptr) AccessChain 128(s) 24 + Store 136 134 + 139: 138(ptr) AccessChain 47 102 24 + 140: 14(fvec3) Load 139 + 144: 143(bvec3) FOrdNotEqual 140 142 + 145: 137(bool) Any 144 + 146: 137(bool) LogicalNot 145 + SelectionMerge 148 None + BranchConditional 146 147 148 + 147: Label + 150: 149(ptr) AccessChain 47 109 102 + 151: 42(ivec3) Load 150 + 154: 143(bvec3) INotEqual 151 153 + 155: 137(bool) Any 154 + Branch 148 + 148: Label + 156: 137(bool) Phi 145 5 155 147 + SelectionMerge 158 None + BranchConditional 156 157 158 + 157: Label + 159: 97(ptr) AccessChain 128(s) 20 + 160: 14(fvec3) Load 159 + 161: 14(fvec3) CompositeConstruct 141 141 141 + 162: 14(fvec3) FAdd 160 161 + Store 159 162 + Branch 158 + 158: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.300layoutp.vert.out b/deps/glslang/Test/baseResults/spv.300layoutp.vert.out new file mode 100644 index 00000000..9c4201de --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.300layoutp.vert.out @@ -0,0 +1,200 @@ +spv.300layoutp.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 115 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 9 11 50 52 60 72 80 + Source ESSL 310 + Name 4 "main" + Name 9 "pos" + Name 11 "p" + Name 17 "Transform" + MemberName 17(Transform) 0 "M1" + MemberName 17(Transform) 1 "M2" + MemberName 17(Transform) 2 "N1" + MemberName 17(Transform) 3 "iuin" + Name 19 "tblock" + Name 33 "T3" + MemberName 33(T3) 0 "M3" + MemberName 33(T3) 1 "M4" + MemberName 33(T3) 2 "N2" + MemberName 33(T3) 3 "uv3a" + Name 35 "" + Name 42 "T2" + MemberName 42(T2) 0 "b" + MemberName 42(T2) 1 "t2m" + Name 44 "" + Name 50 "color" + Name 52 "c" + Name 60 "iout" + Name 66 "uiuin" + Name 72 "aiv2" + Name 78 "S" + MemberName 78(S) 0 "c" + MemberName 78(S) 1 "f" + Name 80 "s" + Decorate 11(p) Location 3 + MemberDecorate 17(Transform) 0 RowMajor + MemberDecorate 17(Transform) 0 Offset 0 + MemberDecorate 17(Transform) 0 MatrixStride 16 + MemberDecorate 17(Transform) 1 ColMajor + MemberDecorate 17(Transform) 1 Offset 64 + MemberDecorate 17(Transform) 1 MatrixStride 16 + MemberDecorate 17(Transform) 2 RowMajor + MemberDecorate 17(Transform) 2 Offset 128 + MemberDecorate 17(Transform) 2 MatrixStride 16 + MemberDecorate 17(Transform) 3 Offset 176 + Decorate 17(Transform) Block + Decorate 19(tblock) DescriptorSet 0 + Decorate 32 ArrayStride 16 + MemberDecorate 33(T3) 0 ColMajor + MemberDecorate 33(T3) 0 Offset 0 + MemberDecorate 33(T3) 0 MatrixStride 16 + MemberDecorate 33(T3) 1 RowMajor + MemberDecorate 33(T3) 1 Offset 64 + MemberDecorate 33(T3) 1 MatrixStride 16 + MemberDecorate 33(T3) 2 ColMajor + MemberDecorate 33(T3) 2 Offset 128 + MemberDecorate 33(T3) 2 MatrixStride 16 + MemberDecorate 33(T3) 3 Offset 160 + Decorate 33(T3) Block + Decorate 35 DescriptorSet 0 + MemberDecorate 42(T2) 0 Offset 0 + MemberDecorate 42(T2) 1 RowMajor + MemberDecorate 42(T2) 1 Offset 16 + MemberDecorate 42(T2) 1 MatrixStride 16 + Decorate 42(T2) Block + Decorate 44 DescriptorSet 0 + Decorate 52(c) Location 7 + Decorate 60(iout) Flat + Decorate 72(aiv2) Location 9 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(pos): 8(ptr) Variable Output + 10: TypePointer Input 7(fvec4) + 11(p): 10(ptr) Variable Input + 13: TypeMatrix 7(fvec4) 4 + 14: TypeVector 6(float) 3 + 15: TypeMatrix 14(fvec3) 3 + 16: TypeInt 32 1 + 17(Transform): TypeStruct 13 13 15 16(int) + 18: TypePointer Uniform 17(Transform) + 19(tblock): 18(ptr) Variable Uniform + 20: 16(int) Constant 0 + 21: TypePointer Uniform 13 + 24: 16(int) Constant 1 + 28: TypeMatrix 14(fvec3) 2 + 29: TypeInt 32 0 + 30: TypeVector 29(int) 3 + 31: 29(int) Constant 4 + 32: TypeArray 30(ivec3) 31 + 33(T3): TypeStruct 13 13 28 32 + 34: TypePointer Uniform 33(T3) + 35: 34(ptr) Variable Uniform + 42(T2): TypeStruct 29(int) 13 + 43: TypePointer Uniform 42(T2) + 44: 43(ptr) Variable Uniform + 49: TypePointer Output 14(fvec3) + 50(color): 49(ptr) Variable Output + 51: TypePointer Input 14(fvec3) + 52(c): 51(ptr) Variable Input + 54: 16(int) Constant 2 + 55: TypePointer Uniform 15 + 59: TypePointer Output 16(int) + 60(iout): 59(ptr) Variable Output + 61: 16(int) Constant 3 + 62: TypePointer Uniform 16(int) + 65: TypePointer Private 29(int) + 66(uiuin): 65(ptr) Variable Private + 70: TypeVector 16(int) 2 + 71: TypePointer Input 70(ivec2) + 72(aiv2): 71(ptr) Variable Input + 73: 29(int) Constant 1 + 74: TypePointer Input 16(int) + 78(S): TypeStruct 14(fvec3) 6(float) + 79: TypePointer Output 78(S) + 80(s): 79(ptr) Variable Output + 83: 29(int) Constant 0 + 84: TypePointer Input 6(float) + 87: TypePointer Output 6(float) + 89: TypeBool + 90: TypePointer Uniform 14(fvec3) + 93: 6(float) Constant 1065353216 + 94: 14(fvec3) ConstantComposite 93 93 93 + 95: TypeVector 89(bool) 3 + 101: TypePointer Uniform 30(ivec3) + 104: 29(int) Constant 5 + 105: 30(ivec3) ConstantComposite 104 104 104 + 4(main): 2 Function None 3 + 5: Label + 12: 7(fvec4) Load 11(p) + 22: 21(ptr) AccessChain 19(tblock) 20 + 23: 13 Load 22 + 25: 21(ptr) AccessChain 19(tblock) 24 + 26: 13 Load 25 + 27: 13 MatrixTimesMatrix 23 26 + 36: 21(ptr) AccessChain 35 24 + 37: 13 Load 36 + 38: 13 MatrixTimesMatrix 27 37 + 39: 21(ptr) AccessChain 35 20 + 40: 13 Load 39 + 41: 13 MatrixTimesMatrix 38 40 + 45: 21(ptr) AccessChain 44 24 + 46: 13 Load 45 + 47: 13 MatrixTimesMatrix 41 46 + 48: 7(fvec4) VectorTimesMatrix 12 47 + Store 9(pos) 48 + 53: 14(fvec3) Load 52(c) + 56: 55(ptr) AccessChain 19(tblock) 54 + 57: 15 Load 56 + 58: 14(fvec3) VectorTimesMatrix 53 57 + Store 50(color) 58 + 63: 62(ptr) AccessChain 19(tblock) 61 + 64: 16(int) Load 63 + 67: 29(int) Load 66(uiuin) + 68: 16(int) Bitcast 67 + 69: 16(int) IAdd 64 68 + 75: 74(ptr) AccessChain 72(aiv2) 73 + 76: 16(int) Load 75 + 77: 16(int) IAdd 69 76 + Store 60(iout) 77 + 81: 14(fvec3) Load 52(c) + 82: 49(ptr) AccessChain 80(s) 20 + Store 82 81 + 85: 84(ptr) AccessChain 11(p) 83 + 86: 6(float) Load 85 + 88: 87(ptr) AccessChain 80(s) 24 + Store 88 86 + 91: 90(ptr) AccessChain 35 54 24 + 92: 14(fvec3) Load 91 + 96: 95(bvec3) FOrdNotEqual 92 94 + 97: 89(bool) Any 96 + 98: 89(bool) LogicalNot 97 + SelectionMerge 100 None + BranchConditional 98 99 100 + 99: Label + 102: 101(ptr) AccessChain 35 61 54 + 103: 30(ivec3) Load 102 + 106: 95(bvec3) INotEqual 103 105 + 107: 89(bool) Any 106 + Branch 100 + 100: Label + 108: 89(bool) Phi 97 5 107 99 + SelectionMerge 110 None + BranchConditional 108 109 110 + 109: Label + 111: 49(ptr) AccessChain 80(s) 20 + 112: 14(fvec3) Load 111 + 113: 14(fvec3) CompositeConstruct 93 93 93 + 114: 14(fvec3) FAdd 112 113 + Store 111 114 + Branch 110 + 110: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.310.bitcast.frag.out b/deps/glslang/Test/baseResults/spv.310.bitcast.frag.out new file mode 100644 index 00000000..d7a244f8 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.310.bitcast.frag.out @@ -0,0 +1,228 @@ +spv.310.bitcast.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 153 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 14 26 37 48 89 98 107 116 122 130 139 148 + ExecutionMode 4 OriginUpperLeft + Source ESSL 310 + Name 4 "main" + Name 9 "idata" + Name 14 "f1" + Name 26 "f2" + Name 37 "f3" + Name 48 "f4" + Name 55 "udata" + Name 85 "fdata" + Name 89 "i1" + Name 98 "i2" + Name 107 "i3" + Name 116 "i4" + Name 122 "u1" + Name 130 "u2" + Name 139 "u3" + Name 148 "u4" + Decorate 14(f1) RelaxedPrecision + Decorate 15 RelaxedPrecision + Decorate 26(f2) RelaxedPrecision + Decorate 27 RelaxedPrecision + Decorate 37(f3) RelaxedPrecision + Decorate 38 RelaxedPrecision + Decorate 57 RelaxedPrecision + Decorate 64 RelaxedPrecision + Decorate 72 RelaxedPrecision + Decorate 89(i1) RelaxedPrecision + Decorate 89(i1) Flat + Decorate 90 RelaxedPrecision + Decorate 98(i2) RelaxedPrecision + Decorate 98(i2) Flat + Decorate 99 RelaxedPrecision + Decorate 107(i3) RelaxedPrecision + Decorate 107(i3) Flat + Decorate 108 RelaxedPrecision + Decorate 116(i4) Flat + Decorate 122(u1) RelaxedPrecision + Decorate 122(u1) Flat + Decorate 123 RelaxedPrecision + Decorate 130(u2) RelaxedPrecision + Decorate 130(u2) Flat + Decorate 131 RelaxedPrecision + Decorate 139(u3) RelaxedPrecision + Decorate 139(u3) Flat + Decorate 140 RelaxedPrecision + Decorate 148(u4) Flat + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeVector 6(int) 4 + 8: TypePointer Function 7(ivec4) + 10: 6(int) Constant 0 + 11: 7(ivec4) ConstantComposite 10 10 10 10 + 12: TypeFloat 32 + 13: TypePointer Input 12(float) + 14(f1): 13(ptr) Variable Input + 17: TypeInt 32 0 + 18: 17(int) Constant 0 + 19: TypePointer Function 6(int) + 24: TypeVector 12(float) 2 + 25: TypePointer Input 24(fvec2) + 26(f2): 25(ptr) Variable Input + 28: TypeVector 6(int) 2 + 35: TypeVector 12(float) 3 + 36: TypePointer Input 35(fvec3) + 37(f3): 36(ptr) Variable Input + 39: TypeVector 6(int) 3 + 46: TypeVector 12(float) 4 + 47: TypePointer Input 46(fvec4) + 48(f4): 47(ptr) Variable Input + 53: TypeVector 17(int) 4 + 54: TypePointer Function 53(ivec4) + 56: 53(ivec4) ConstantComposite 18 18 18 18 + 59: TypePointer Function 17(int) + 65: TypeVector 17(int) 2 + 73: TypeVector 17(int) 3 + 84: TypePointer Function 46(fvec4) + 86: 12(float) Constant 0 + 87: 46(fvec4) ConstantComposite 86 86 86 86 + 88: TypePointer Input 6(int) + 89(i1): 88(ptr) Variable Input + 92: TypePointer Function 12(float) + 97: TypePointer Input 28(ivec2) + 98(i2): 97(ptr) Variable Input + 106: TypePointer Input 39(ivec3) + 107(i3): 106(ptr) Variable Input + 115: TypePointer Input 7(ivec4) + 116(i4): 115(ptr) Variable Input + 121: TypePointer Input 17(int) + 122(u1): 121(ptr) Variable Input + 129: TypePointer Input 65(ivec2) + 130(u2): 129(ptr) Variable Input + 138: TypePointer Input 73(ivec3) + 139(u3): 138(ptr) Variable Input + 147: TypePointer Input 53(ivec4) + 148(u4): 147(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 9(idata): 8(ptr) Variable Function + 55(udata): 54(ptr) Variable Function + 85(fdata): 84(ptr) Variable Function + Store 9(idata) 11 + 15: 12(float) Load 14(f1) + 16: 6(int) Bitcast 15 + 20: 19(ptr) AccessChain 9(idata) 18 + 21: 6(int) Load 20 + 22: 6(int) IAdd 21 16 + 23: 19(ptr) AccessChain 9(idata) 18 + Store 23 22 + 27: 24(fvec2) Load 26(f2) + 29: 28(ivec2) Bitcast 27 + 30: 7(ivec4) Load 9(idata) + 31: 28(ivec2) VectorShuffle 30 30 0 1 + 32: 28(ivec2) IAdd 31 29 + 33: 7(ivec4) Load 9(idata) + 34: 7(ivec4) VectorShuffle 33 32 4 5 2 3 + Store 9(idata) 34 + 38: 35(fvec3) Load 37(f3) + 40: 39(ivec3) Bitcast 38 + 41: 7(ivec4) Load 9(idata) + 42: 39(ivec3) VectorShuffle 41 41 0 1 2 + 43: 39(ivec3) IAdd 42 40 + 44: 7(ivec4) Load 9(idata) + 45: 7(ivec4) VectorShuffle 44 43 4 5 6 3 + Store 9(idata) 45 + 49: 46(fvec4) Load 48(f4) + 50: 7(ivec4) Bitcast 49 + 51: 7(ivec4) Load 9(idata) + 52: 7(ivec4) IAdd 51 50 + Store 9(idata) 52 + Store 55(udata) 56 + 57: 12(float) Load 14(f1) + 58: 17(int) Bitcast 57 + 60: 59(ptr) AccessChain 55(udata) 18 + 61: 17(int) Load 60 + 62: 17(int) IAdd 61 58 + 63: 59(ptr) AccessChain 55(udata) 18 + Store 63 62 + 64: 24(fvec2) Load 26(f2) + 66: 65(ivec2) Bitcast 64 + 67: 53(ivec4) Load 55(udata) + 68: 65(ivec2) VectorShuffle 67 67 0 1 + 69: 65(ivec2) IAdd 68 66 + 70: 53(ivec4) Load 55(udata) + 71: 53(ivec4) VectorShuffle 70 69 4 5 2 3 + Store 55(udata) 71 + 72: 35(fvec3) Load 37(f3) + 74: 73(ivec3) Bitcast 72 + 75: 53(ivec4) Load 55(udata) + 76: 73(ivec3) VectorShuffle 75 75 0 1 2 + 77: 73(ivec3) IAdd 76 74 + 78: 53(ivec4) Load 55(udata) + 79: 53(ivec4) VectorShuffle 78 77 4 5 6 3 + Store 55(udata) 79 + 80: 46(fvec4) Load 48(f4) + 81: 53(ivec4) Bitcast 80 + 82: 53(ivec4) Load 55(udata) + 83: 53(ivec4) IAdd 82 81 + Store 55(udata) 83 + Store 85(fdata) 87 + 90: 6(int) Load 89(i1) + 91: 12(float) Bitcast 90 + 93: 92(ptr) AccessChain 85(fdata) 18 + 94: 12(float) Load 93 + 95: 12(float) FAdd 94 91 + 96: 92(ptr) AccessChain 85(fdata) 18 + Store 96 95 + 99: 28(ivec2) Load 98(i2) + 100: 24(fvec2) Bitcast 99 + 101: 46(fvec4) Load 85(fdata) + 102: 24(fvec2) VectorShuffle 101 101 0 1 + 103: 24(fvec2) FAdd 102 100 + 104: 46(fvec4) Load 85(fdata) + 105: 46(fvec4) VectorShuffle 104 103 4 5 2 3 + Store 85(fdata) 105 + 108: 39(ivec3) Load 107(i3) + 109: 35(fvec3) Bitcast 108 + 110: 46(fvec4) Load 85(fdata) + 111: 35(fvec3) VectorShuffle 110 110 0 1 2 + 112: 35(fvec3) FAdd 111 109 + 113: 46(fvec4) Load 85(fdata) + 114: 46(fvec4) VectorShuffle 113 112 4 5 6 3 + Store 85(fdata) 114 + 117: 7(ivec4) Load 116(i4) + 118: 46(fvec4) Bitcast 117 + 119: 46(fvec4) Load 85(fdata) + 120: 46(fvec4) FAdd 119 118 + Store 85(fdata) 120 + 123: 17(int) Load 122(u1) + 124: 12(float) Bitcast 123 + 125: 92(ptr) AccessChain 85(fdata) 18 + 126: 12(float) Load 125 + 127: 12(float) FAdd 126 124 + 128: 92(ptr) AccessChain 85(fdata) 18 + Store 128 127 + 131: 65(ivec2) Load 130(u2) + 132: 24(fvec2) Bitcast 131 + 133: 46(fvec4) Load 85(fdata) + 134: 24(fvec2) VectorShuffle 133 133 0 1 + 135: 24(fvec2) FAdd 134 132 + 136: 46(fvec4) Load 85(fdata) + 137: 46(fvec4) VectorShuffle 136 135 4 5 2 3 + Store 85(fdata) 137 + 140: 73(ivec3) Load 139(u3) + 141: 35(fvec3) Bitcast 140 + 142: 46(fvec4) Load 85(fdata) + 143: 35(fvec3) VectorShuffle 142 142 0 1 2 + 144: 35(fvec3) FAdd 143 141 + 145: 46(fvec4) Load 85(fdata) + 146: 46(fvec4) VectorShuffle 145 144 4 5 6 3 + Store 85(fdata) 146 + 149: 53(ivec4) Load 148(u4) + 150: 46(fvec4) Bitcast 149 + 151: 46(fvec4) Load 85(fdata) + 152: 46(fvec4) FAdd 151 150 + Store 85(fdata) 152 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.310.comp.out b/deps/glslang/Test/baseResults/spv.310.comp.out new file mode 100644 index 00000000..fd1309db --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.310.comp.out @@ -0,0 +1,133 @@ +spv.310.comp +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 71 + + Capability Shader + Capability DeviceGroup + Extension "SPV_KHR_device_group" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 53 64 + ExecutionMode 4 LocalSize 16 32 4 + Source ESSL 310 + SourceExtension "GL_EXT_device_group" + Name 4 "main" + Name 12 "outb" + MemberName 12(outb) 0 "f" + MemberName 12(outb) 1 "g" + MemberName 12(outb) 2 "h" + MemberName 12(outb) 3 "uns" + Name 14 "outbname" + Name 18 "s" + Name 23 "outbna" + MemberName 23(outbna) 0 "k" + MemberName 23(outbna) 1 "na" + Name 25 "outbnamena" + Name 42 "i" + Name 48 "outs" + MemberName 48(outs) 0 "s" + MemberName 48(outs) 1 "va" + Name 50 "outnames" + Name 53 "gl_LocalInvocationID" + Name 64 "gl_DeviceIndex" + Decorate 11 ArrayStride 16 + MemberDecorate 12(outb) 0 Offset 0 + MemberDecorate 12(outb) 1 Offset 4 + MemberDecorate 12(outb) 2 Offset 8 + MemberDecorate 12(outb) 3 Offset 16 + Decorate 12(outb) BufferBlock + Decorate 14(outbname) DescriptorSet 0 + MemberDecorate 23(outbna) 0 Offset 0 + MemberDecorate 23(outbna) 1 Offset 16 + Decorate 23(outbna) BufferBlock + Decorate 25(outbnamena) DescriptorSet 0 + Decorate 47 ArrayStride 16 + MemberDecorate 48(outs) 0 Offset 0 + MemberDecorate 48(outs) 1 Offset 16 + Decorate 48(outs) BufferBlock + Decorate 50(outnames) DescriptorSet 0 + Decorate 53(gl_LocalInvocationID) BuiltIn LocalInvocationId + Decorate 64(gl_DeviceIndex) BuiltIn DeviceIndex + Decorate 70 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: 6(int) Constant 2 + 8: 6(int) Constant 264 + 9: TypeFloat 32 + 10: TypeVector 9(float) 3 + 11: TypeRuntimeArray 10(fvec3) + 12(outb): TypeStruct 9(float) 9(float) 9(float) 11 + 13: TypePointer Uniform 12(outb) + 14(outbname): 13(ptr) Variable Uniform + 15: TypeInt 32 1 + 16: 15(int) Constant 0 + 17: TypePointer Workgroup 9(float) + 18(s): 17(ptr) Variable Workgroup + 20: TypePointer Uniform 9(float) + 22: TypeVector 9(float) 4 + 23(outbna): TypeStruct 15(int) 22(fvec4) + 24: TypePointer Uniform 23(outbna) + 25(outbnamena): 24(ptr) Variable Uniform + 26: 15(int) Constant 1 + 29: TypePointer Uniform 22(fvec4) + 31: 15(int) Constant 3 + 32: 15(int) Constant 18 + 33: 6(int) Constant 0 + 36: 15(int) Constant 17 + 37: 9(float) Constant 1077936128 + 38: 10(fvec3) ConstantComposite 37 37 37 + 39: TypePointer Uniform 10(fvec3) + 41: TypePointer Workgroup 15(int) + 42(i): 41(ptr) Variable Workgroup + 47: TypeRuntimeArray 22(fvec4) + 48(outs): TypeStruct 15(int) 47 + 49: TypePointer Uniform 48(outs) + 50(outnames): 49(ptr) Variable Uniform + 51: TypeVector 6(int) 3 + 52: TypePointer Input 51(ivec3) +53(gl_LocalInvocationID): 52(ptr) Variable Input + 54: TypePointer Input 6(int) + 61: TypePointer Uniform 15(int) + 63: TypePointer Input 15(int) +64(gl_DeviceIndex): 63(ptr) Variable Input + 65: 6(int) Constant 1 + 66: 6(int) Constant 3400 + 67: 6(int) Constant 16 + 68: 6(int) Constant 32 + 69: 6(int) Constant 4 + 70: 51(ivec3) ConstantComposite 67 68 69 + 4(main): 2 Function None 3 + 5: Label + ControlBarrier 7 7 8 + 19: 9(float) Load 18(s) + 21: 20(ptr) AccessChain 14(outbname) 16 + Store 21 19 + 27: 9(float) Load 18(s) + 28: 22(fvec4) CompositeConstruct 27 27 27 27 + 30: 29(ptr) AccessChain 25(outbnamena) 26 + Store 30 28 + 34: 20(ptr) AccessChain 14(outbname) 31 32 33 + 35: 9(float) Load 34 + Store 18(s) 35 + 40: 39(ptr) AccessChain 14(outbname) 31 36 + Store 40 38 + 43: 15(int) Load 42(i) + 44: 9(float) Load 18(s) + 45: 10(fvec3) CompositeConstruct 44 44 44 + 46: 39(ptr) AccessChain 14(outbname) 31 43 + Store 46 45 + 55: 54(ptr) AccessChain 53(gl_LocalInvocationID) 33 + 56: 6(int) Load 55 + 57: 9(float) Load 18(s) + 58: 22(fvec4) CompositeConstruct 57 57 57 57 + 59: 29(ptr) AccessChain 50(outnames) 26 56 + Store 59 58 + 60: 15(int) ArrayLength 14(outbname) 3 + 62: 61(ptr) AccessChain 50(outnames) 16 + Store 62 60 + MemoryBarrier 65 8 + MemoryBarrier 7 66 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.320.meshShaderUserDefined.mesh.out b/deps/glslang/Test/baseResults/spv.320.meshShaderUserDefined.mesh.out new file mode 100644 index 00000000..20b6fa24 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.320.meshShaderUserDefined.mesh.out @@ -0,0 +1,205 @@ +spv.320.meshShaderUserDefined.mesh +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 140 + + Capability MeshShadingNV + Extension "SPV_NV_mesh_shader" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint MeshNV 4 "main" 12 19 37 103 + ExecutionMode 4 LocalSize 32 1 1 + ExecutionMode 4 OutputVertices 81 + ExecutionMode 4 OutputPrimitivesNV 32 + ExecutionMode 4 OutputTrianglesNV + Source ESSL 320 + SourceExtension "GL_NV_mesh_shader" + Name 4 "main" + Name 8 "iid" + Name 12 "gl_LocalInvocationID" + Name 18 "gid" + Name 19 "gl_WorkGroupID" + Name 33 "myblock" + MemberName 33(myblock) 0 "f" + MemberName 33(myblock) 1 "fArr" + MemberName 33(myblock) 2 "pos" + MemberName 33(myblock) 3 "posArr" + MemberName 33(myblock) 4 "m" + MemberName 33(myblock) 5 "mArr" + Name 37 "blk" + Name 99 "myblock2" + MemberName 99(myblock2) 0 "f" + MemberName 99(myblock2) 1 "pos" + MemberName 99(myblock2) 2 "m" + Name 103 "blk2" + Decorate 12(gl_LocalInvocationID) BuiltIn LocalInvocationId + Decorate 19(gl_WorkGroupID) BuiltIn WorkgroupId + MemberDecorate 33(myblock) 0 PerPrimitiveNV + MemberDecorate 33(myblock) 1 PerPrimitiveNV + MemberDecorate 33(myblock) 2 PerPrimitiveNV + MemberDecorate 33(myblock) 3 PerPrimitiveNV + MemberDecorate 33(myblock) 4 PerPrimitiveNV + MemberDecorate 33(myblock) 5 PerPrimitiveNV + Decorate 33(myblock) Block + Decorate 37(blk) Location 0 + Decorate 99(myblock2) Block + Decorate 103(blk2) Location 20 + Decorate 139 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: TypeInt 32 0 + 10: TypeVector 9(int) 3 + 11: TypePointer Input 10(ivec3) +12(gl_LocalInvocationID): 11(ptr) Variable Input + 13: 9(int) Constant 0 + 14: TypePointer Input 9(int) +19(gl_WorkGroupID): 11(ptr) Variable Input + 23: TypeFloat 32 + 24: 9(int) Constant 4 + 25: TypeArray 23(float) 24 + 26: TypeVector 23(float) 3 + 27: TypeVector 23(float) 4 + 28: TypeArray 27(fvec4) 24 + 29: TypeMatrix 27(fvec4) 4 + 30: TypeMatrix 26(fvec3) 3 + 31: 9(int) Constant 2 + 32: TypeArray 30 31 + 33(myblock): TypeStruct 23(float) 25 26(fvec3) 28 29 32 + 34: 9(int) Constant 32 + 35: TypeArray 33(myblock) 34 + 36: TypePointer Output 35 + 37(blk): 36(ptr) Variable Output + 39: 6(int) Constant 0 + 40: 23(float) Constant 1093664768 + 41: TypePointer Output 23(float) + 44: 6(int) Constant 1 + 52: 6(int) Constant 2 + 54: 23(float) Constant 1096810496 + 55: 23(float) Constant 1097859072 + 56: 23(float) Constant 1095761920 + 57: 26(fvec3) ConstantComposite 54 55 56 + 58: TypePointer Output 26(fvec3) + 64: 6(int) Constant 3 + 69: TypePointer Output 27(fvec4) + 74: 6(int) Constant 4 + 76: 23(float) Constant 1098907648 + 77: 27(fvec4) ConstantComposite 56 54 55 76 + 82: 6(int) Constant 5 + 85: 9(int) Constant 3 + 88: 9(int) Constant 1 + 93: 23(float) Constant 1099431936 + 94: 23(float) Constant 1099956224 + 95: 23(float) Constant 1100480512 + 96: 26(fvec3) ConstantComposite 93 94 95 + 98: 9(int) Constant 264 + 99(myblock2): TypeStruct 23(float) 27(fvec4) 29 + 100: 9(int) Constant 81 + 101: TypeArray 99(myblock2) 100 + 102: TypePointer Output 101 + 103(blk2): 102(ptr) Variable Output + 109: 23(float) Constant 1101004800 + 113: 23(float) Constant 1101529088 + 114: 23(float) Constant 1102053376 + 115: 23(float) Constant 1102577664 + 116: 23(float) Constant 1103101952 + 117: 27(fvec4) ConstantComposite 113 114 115 116 + 129: 23(float) Constant 1105723392 + 139: 10(ivec3) ConstantComposite 34 88 88 + 4(main): 2 Function None 3 + 5: Label + 8(iid): 7(ptr) Variable Function + 18(gid): 7(ptr) Variable Function + 15: 14(ptr) AccessChain 12(gl_LocalInvocationID) 13 + 16: 9(int) Load 15 + 17: 6(int) Bitcast 16 + Store 8(iid) 17 + 20: 14(ptr) AccessChain 19(gl_WorkGroupID) 13 + 21: 9(int) Load 20 + 22: 6(int) Bitcast 21 + Store 18(gid) 22 + 38: 6(int) Load 8(iid) + 42: 41(ptr) AccessChain 37(blk) 38 39 + Store 42 40 + 43: 6(int) Load 8(iid) + 45: 6(int) IAdd 43 44 + 46: 6(int) Load 18(gid) + 47: 6(int) Load 8(iid) + 48: 41(ptr) AccessChain 37(blk) 47 39 + 49: 23(float) Load 48 + 50: 41(ptr) AccessChain 37(blk) 45 44 46 + Store 50 49 + 51: 6(int) Load 8(iid) + 53: 6(int) SDiv 51 52 + 59: 58(ptr) AccessChain 37(blk) 53 52 + 60: 26(fvec3) Load 59 + 61: 26(fvec3) VectorShuffle 60 57 5 3 4 + Store 59 61 + 62: 6(int) Load 8(iid) + 63: 6(int) IMul 62 52 + 65: 6(int) Load 8(iid) + 66: 6(int) SDiv 65 52 + 67: 58(ptr) AccessChain 37(blk) 66 52 + 68: 26(fvec3) Load 67 + 70: 69(ptr) AccessChain 37(blk) 63 64 44 + 71: 27(fvec4) Load 70 + 72: 27(fvec4) VectorShuffle 71 68 0 4 5 6 + Store 70 72 + 73: 6(int) Load 8(iid) + 75: 6(int) SDiv 73 74 + 78: 69(ptr) AccessChain 37(blk) 75 74 52 + 79: 27(fvec4) Load 78 + 80: 27(fvec4) VectorShuffle 79 77 7 6 5 4 + Store 78 80 + 81: 6(int) Load 8(iid) + 83: 6(int) Load 8(iid) + 84: 6(int) SDiv 83 74 + 86: 41(ptr) AccessChain 37(blk) 84 74 52 85 + 87: 23(float) Load 86 + 89: 41(ptr) AccessChain 37(blk) 81 82 39 44 88 + Store 89 87 + 90: 6(int) Load 8(iid) + 91: 6(int) IMul 90 74 + 92: 6(int) Load 18(gid) + 97: 58(ptr) AccessChain 37(blk) 91 82 44 92 + Store 97 96 + MemoryBarrier 88 98 + ControlBarrier 31 31 98 + 104: 6(int) Load 8(iid) + 105: 6(int) Load 8(iid) + 106: 6(int) ISub 105 44 + 107: 41(ptr) AccessChain 103(blk2) 106 39 + 108: 23(float) Load 107 + 110: 23(float) FAdd 108 109 + 111: 41(ptr) AccessChain 103(blk2) 104 39 + Store 111 110 + 112: 6(int) Load 8(iid) + 118: 69(ptr) AccessChain 103(blk2) 112 44 + Store 118 117 + 119: 6(int) Load 8(iid) + 120: 6(int) IAdd 119 44 + 121: 6(int) Load 18(gid) + 122: 6(int) Load 8(iid) + 123: 69(ptr) AccessChain 103(blk2) 122 44 + 124: 27(fvec4) Load 123 + 125: 69(ptr) AccessChain 103(blk2) 120 52 121 + Store 125 124 + 126: 6(int) Load 8(iid) + 127: 6(int) IAdd 126 44 + 128: 6(int) Load 18(gid) + 130: 41(ptr) AccessChain 103(blk2) 127 52 128 31 + Store 130 129 + 131: 6(int) Load 8(iid) + 132: 6(int) IAdd 131 52 + 133: 6(int) Load 8(iid) + 134: 6(int) IAdd 133 44 + 135: 6(int) Load 18(gid) + 136: 69(ptr) AccessChain 103(blk2) 134 52 135 + 137: 27(fvec4) Load 136 + 138: 69(ptr) AccessChain 103(blk2) 132 52 64 + Store 138 137 + MemoryBarrier 88 98 + ControlBarrier 31 31 98 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.330.geom.out b/deps/glslang/Test/baseResults/spv.330.geom.out new file mode 100644 index 00000000..1ccbfb6c --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.330.geom.out @@ -0,0 +1,67 @@ +spv.330.geom +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 32 + + Capability Geometry + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 13 20 + ExecutionMode 4 Triangles + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputTriangleStrip + ExecutionMode 4 OutputVertices 3 + Source GLSL 330 + SourceExtension "GL_ARB_separate_shader_objects" + Name 4 "main" + Name 11 "gl_PerVertex" + MemberName 11(gl_PerVertex) 0 "gl_Position" + MemberName 11(gl_PerVertex) 1 "gl_ClipDistance" + Name 13 "" + Name 16 "gl_PerVertex" + MemberName 16(gl_PerVertex) 0 "gl_Position" + MemberName 16(gl_PerVertex) 1 "gl_ClipDistance" + Name 20 "gl_in" + MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 11(gl_PerVertex) 1 BuiltIn ClipDistance + Decorate 11(gl_PerVertex) Block + MemberDecorate 16(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 16(gl_PerVertex) 1 BuiltIn ClipDistance + Decorate 16(gl_PerVertex) Block + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 0 + 9: 8(int) Constant 1 + 10: TypeArray 6(float) 9 +11(gl_PerVertex): TypeStruct 7(fvec4) 10 + 12: TypePointer Output 11(gl_PerVertex) + 13: 12(ptr) Variable Output + 14: TypeInt 32 1 + 15: 14(int) Constant 0 +16(gl_PerVertex): TypeStruct 7(fvec4) 10 + 17: 8(int) Constant 3 + 18: TypeArray 16(gl_PerVertex) 17 + 19: TypePointer Input 18 + 20(gl_in): 19(ptr) Variable Input + 21: 14(int) Constant 1 + 22: TypePointer Input 7(fvec4) + 25: TypePointer Output 7(fvec4) + 27: TypePointer Input 6(float) + 30: TypePointer Output 6(float) + 4(main): 2 Function None 3 + 5: Label + 23: 22(ptr) AccessChain 20(gl_in) 21 15 + 24: 7(fvec4) Load 23 + 26: 25(ptr) AccessChain 13 15 + Store 26 24 + 28: 27(ptr) AccessChain 20(gl_in) 21 21 15 + 29: 6(float) Load 28 + 31: 30(ptr) AccessChain 13 21 15 + Store 31 29 + EmitVertex + EndPrimitive + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.400.frag.out b/deps/glslang/Test/baseResults/spv.400.frag.out new file mode 100644 index 00000000..a0583cff --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.400.frag.out @@ -0,0 +1,1395 @@ +spv.400.frag +error: SPIRV-Tools Validation Errors +error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension) + OpCapability SampledRect + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 1118 + + Capability Shader + Capability Geometry + Capability Float64 + Capability ImageGatherExtended + Capability ClipDistance + Capability SampledRect + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 13 1027 1033 1038 1050 1076 1097 1099 1105 1107 1116 + ExecutionMode 4 OriginUpperLeft + Source GLSL 400 + SourceExtension "GL_ARB_separate_shader_objects" + Name 4 "main" + Name 6 "foo23(" + Name 8 "doubles(" + Name 13 "outp" + Name 17 "u2drs" + Name 41 "doublev" + Name 45 "dvec2v" + Name 50 "dvec3v" + Name 55 "dvec4v" + Name 430 "boolv" + Name 439 "bvec2v" + Name 448 "bvec3v" + Name 457 "bvec4v" + Name 739 "dmat2v" + Name 745 "dmat3v" + Name 751 "dmat4v" + Name 757 "dmat2x3v" + Name 763 "dmat3x2v" + Name 769 "dmat2x4v" + Name 775 "dmat4x2v" + Name 781 "dmat3x4v" + Name 787 "dmat4x3v" + Name 1019 "v" + Name 1025 "arrayedSampler" + Name 1027 "i" + Name 1033 "c2D" + Name 1038 "gl_ClipDistance" + Name 1050 "uoutp" + Name 1054 "samp2dr" + Name 1076 "ioutp" + Name 1080 "isamp2DA" + Name 1097 "gl_FragCoord" + Name 1099 "vl2" + Name 1105 "uo" + Name 1107 "u" + Name 1115 "id" + Name 1116 "gl_PrimitiveID" + Decorate 17(u2drs) DescriptorSet 0 + Decorate 1025(arrayedSampler) DescriptorSet 0 + Decorate 1027(i) Flat + Decorate 1038(gl_ClipDistance) BuiltIn ClipDistance + Decorate 1054(samp2dr) DescriptorSet 0 + Decorate 1080(isamp2DA) DescriptorSet 0 + Decorate 1097(gl_FragCoord) BuiltIn FragCoord + Decorate 1099(vl2) Location 6 + Decorate 1107(u) Flat + Decorate 1116(gl_PrimitiveID) Flat + Decorate 1116(gl_PrimitiveID) BuiltIn PrimitiveId + 2: TypeVoid + 3: TypeFunction 2 + 10: TypeFloat 32 + 11: TypeVector 10(float) 4 + 12: TypePointer Output 11(fvec4) + 13(outp): 12(ptr) Variable Output + 14: TypeImage 10(float) Rect depth sampled format:Unknown + 15: TypeSampledImage 14 + 16: TypePointer UniformConstant 15 + 17(u2drs): 16(ptr) Variable UniformConstant + 20: TypeVector 10(float) 2 + 21: 10(float) Constant 0 + 22: 20(fvec2) ConstantComposite 21 21 + 23: TypeInt 32 1 + 24: TypeVector 23(int) 2 + 25: 23(int) Constant 3 + 26: 23(int) Constant 4 + 27: 24(ivec2) ConstantComposite 25 26 + 32: TypeInt 32 0 + 33: 32(int) Constant 0 + 34: TypePointer Output 10(float) + 39: TypeFloat 64 + 40: TypePointer Function 39(float64_t) + 42:39(float64_t) Constant 2507418074 1073430332 + 43: TypeVector 39(float64_t) 2 + 44: TypePointer Function 43(f64vec2) + 46:39(float64_t) Constant 796182188 1073367658 + 47: 43(f64vec2) ConstantComposite 46 46 + 48: TypeVector 39(float64_t) 3 + 49: TypePointer Function 48(f64vec3) + 51:39(float64_t) Constant 1719614413 1073127582 + 52: 48(f64vec3) ConstantComposite 51 51 51 + 53: TypeVector 39(float64_t) 4 + 54: TypePointer Function 53(f64vec4) + 428: TypeBool + 429: TypePointer Function 428(bool) + 437: TypeVector 428(bool) 2 + 438: TypePointer Function 437(bvec2) + 446: TypeVector 428(bool) 3 + 447: TypePointer Function 446(bvec3) + 455: TypeVector 428(bool) 4 + 456: TypePointer Function 455(bvec4) + 563: 428(bool) ConstantFalse + 572: 437(bvec2) ConstantComposite 563 563 + 581: 446(bvec3) ConstantComposite 563 563 563 + 590: 455(bvec4) ConstantComposite 563 563 563 563 + 737: TypeMatrix 43(f64vec2) 2 + 738: TypePointer Function 737 + 743: TypeMatrix 48(f64vec3) 3 + 744: TypePointer Function 743 + 749: TypeMatrix 53(f64vec4) 4 + 750: TypePointer Function 749 + 755: TypeMatrix 48(f64vec3) 2 + 756: TypePointer Function 755 + 761: TypeMatrix 43(f64vec2) 3 + 762: TypePointer Function 761 + 767: TypeMatrix 53(f64vec4) 2 + 768: TypePointer Function 767 + 773: TypeMatrix 43(f64vec2) 4 + 774: TypePointer Function 773 + 779: TypeMatrix 53(f64vec4) 3 + 780: TypePointer Function 779 + 785: TypeMatrix 48(f64vec3) 4 + 786: TypePointer Function 785 + 954: 32(int) Constant 1 + 958: 32(int) Constant 2 + 962: 32(int) Constant 3 + 966: 23(int) Constant 1 + 970: 23(int) Constant 2 + 996: 10(float) Constant 1065353216 + 1018: TypePointer Function 11(fvec4) + 1020: TypeImage 10(float) 2D sampled format:Unknown + 1021: TypeSampledImage 1020 + 1022: 32(int) Constant 5 + 1023: TypeArray 1021 1022 + 1024: TypePointer UniformConstant 1023 +1025(arrayedSampler): 1024(ptr) Variable UniformConstant + 1026: TypePointer Input 23(int) + 1027(i): 1026(ptr) Variable Input + 1029: TypePointer UniformConstant 1021 + 1032: TypePointer Input 20(fvec2) + 1033(c2D): 1032(ptr) Variable Input + 1036: TypeArray 10(float) 958 + 1037: TypePointer Input 1036 +1038(gl_ClipDistance): 1037(ptr) Variable Input + 1039: TypePointer Input 10(float) + 1043: TypeVector 10(float) 3 + 1048: TypeVector 32(int) 4 + 1049: TypePointer Output 1048(ivec4) + 1050(uoutp): 1049(ptr) Variable Output + 1051: TypeImage 32(int) Rect sampled format:Unknown + 1052: TypeSampledImage 1051 + 1053: TypePointer UniformConstant 1052 + 1054(samp2dr): 1053(ptr) Variable UniformConstant + 1057: 32(int) Constant 4 + 1058: TypeArray 24(ivec2) 1057 + 1059: 24(ivec2) ConstantComposite 966 970 + 1060: 23(int) Constant 15 + 1061: 23(int) Constant 16 + 1062: 24(ivec2) ConstantComposite 1060 1061 + 1063: 23(int) Constant 4294967294 + 1064: 23(int) Constant 0 + 1065: 24(ivec2) ConstantComposite 1063 1064 + 1066: 1058 ConstantComposite 1059 27 1062 1065 + 1074: TypeVector 23(int) 4 + 1075: TypePointer Output 1074(ivec4) + 1076(ioutp): 1075(ptr) Variable Output + 1077: TypeImage 23(int) 2D array sampled format:Unknown + 1078: TypeSampledImage 1077 + 1079: TypePointer UniformConstant 1078 + 1080(isamp2DA): 1079(ptr) Variable UniformConstant + 1082: 10(float) Constant 1036831949 + 1083: 1043(fvec3) ConstantComposite 1082 1082 1082 + 1084: 24(ivec2) ConstantComposite 966 966 + 1096: TypePointer Input 11(fvec4) +1097(gl_FragCoord): 1096(ptr) Variable Input + 1099(vl2): 1096(ptr) Variable Input + 1104: TypePointer Output 32(int) + 1105(uo): 1104(ptr) Variable Output + 1106: TypePointer Input 32(int) + 1107(u): 1106(ptr) Variable Input + 1114: TypePointer Function 23(int) +1116(gl_PrimitiveID): 1026(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 1019(v): 1018(ptr) Variable Function + 1115(id): 1114(ptr) Variable Function + 1028: 23(int) Load 1027(i) + 1030: 1029(ptr) AccessChain 1025(arrayedSampler) 1028 + 1031: 1021 Load 1030 + 1034: 20(fvec2) Load 1033(c2D) + 1035: 11(fvec4) ImageSampleImplicitLod 1031 1034 + Store 1019(v) 1035 + 1040: 1039(ptr) AccessChain 1038(gl_ClipDistance) 966 + 1041: 10(float) Load 1040 + 1042: 34(ptr) AccessChain 13(outp) 33 + Store 1042 1041 + 1044: 11(fvec4) Load 1019(v) + 1045: 1043(fvec3) VectorShuffle 1044 1044 1 2 3 + 1046: 11(fvec4) Load 13(outp) + 1047: 11(fvec4) VectorShuffle 1046 1045 0 4 5 6 + Store 13(outp) 1047 + 1055: 1052 Load 1054(samp2dr) + 1056: 20(fvec2) Load 1033(c2D) + 1067: 1048(ivec4) ImageGather 1055 1056 970 ConstOffsets 1066 + Store 1050(uoutp) 1067 + 1068: 1029(ptr) AccessChain 1025(arrayedSampler) 1064 + 1069: 1021 Load 1068 + 1070: 20(fvec2) Load 1033(c2D) + 1071: 11(fvec4) ImageGather 1069 1070 1064 + 1072: 11(fvec4) Load 13(outp) + 1073: 11(fvec4) FAdd 1072 1071 + Store 13(outp) 1073 + 1081: 1078 Load 1080(isamp2DA) + 1085: 1074(ivec4) ImageGather 1081 1083 25 ConstOffset 1084 + Store 1076(ioutp) 1085 + 1086: 1078 Load 1080(isamp2DA) + 1087: 1074(ivec4) ImageGather 1086 1083 25 ConstOffset 1084 + 1088: 1074(ivec4) Load 1076(ioutp) + 1089: 1074(ivec4) IAdd 1088 1087 + Store 1076(ioutp) 1089 + 1090: 1078 Load 1080(isamp2DA) + 1091: 23(int) Load 1027(i) + 1092: 24(ivec2) CompositeConstruct 1091 1091 + 1093: 1074(ivec4) ImageGather 1090 1083 1064 Offset 1092 + 1094: 1074(ivec4) Load 1076(ioutp) + 1095: 1074(ivec4) IAdd 1094 1093 + Store 1076(ioutp) 1095 + 1098: 11(fvec4) Load 1097(gl_FragCoord) + 1100: 11(fvec4) Load 1099(vl2) + 1101: 11(fvec4) FAdd 1098 1100 + 1102: 11(fvec4) Load 13(outp) + 1103: 11(fvec4) FAdd 1102 1101 + Store 13(outp) 1103 + 1108: 32(int) Load 1107(u) + 1109: 23(int) Load 1027(i) + 1110: 32(int) Bitcast 1109 + 1111: 32(int) UMod 1108 1110 + Store 1105(uo) 1111 + 1112: 2 FunctionCall 6(foo23() + 1113: 2 FunctionCall 8(doubles() + 1117: 23(int) Load 1116(gl_PrimitiveID) + Store 1115(id) 1117 + Return + FunctionEnd + 6(foo23(): 2 Function None 3 + 7: Label + 18: 15 Load 17(u2drs) + 19: 11(fvec4) Load 13(outp) + 28: 10(float) CompositeExtract 19 2 + 29: 10(float) CompositeExtract 19 3 + 30: 11(fvec4) CompositeInsert 29 19 2 + 31: 10(float) ImageSampleProjDrefExplicitLod 18 30 28 Grad ConstOffset 22 22 27 + 35: 34(ptr) AccessChain 13(outp) 33 + 36: 10(float) Load 35 + 37: 10(float) FAdd 36 31 + 38: 34(ptr) AccessChain 13(outp) 33 + Store 38 37 + Return + FunctionEnd + 8(doubles(): 2 Function None 3 + 9: Label + 41(doublev): 40(ptr) Variable Function + 45(dvec2v): 44(ptr) Variable Function + 50(dvec3v): 49(ptr) Variable Function + 55(dvec4v): 54(ptr) Variable Function + 430(boolv): 429(ptr) Variable Function + 439(bvec2v): 438(ptr) Variable Function + 448(bvec3v): 447(ptr) Variable Function + 457(bvec4v): 456(ptr) Variable Function + 557: 429(ptr) Variable Function + 566: 438(ptr) Variable Function + 575: 447(ptr) Variable Function + 584: 456(ptr) Variable Function + 739(dmat2v): 738(ptr) Variable Function + 745(dmat3v): 744(ptr) Variable Function + 751(dmat4v): 750(ptr) Variable Function + 757(dmat2x3v): 756(ptr) Variable Function + 763(dmat3x2v): 762(ptr) Variable Function + 769(dmat2x4v): 768(ptr) Variable Function + 775(dmat4x2v): 774(ptr) Variable Function + 781(dmat3x4v): 780(ptr) Variable Function + 787(dmat4x3v): 786(ptr) Variable Function + Store 41(doublev) 42 + Store 45(dvec2v) 47 + Store 50(dvec3v) 52 + 56:39(float64_t) Load 41(doublev) + 57: 53(f64vec4) CompositeConstruct 56 56 56 56 + 58: 53(f64vec4) ExtInst 1(GLSL.std.450) 31(Sqrt) 57 + Store 55(dvec4v) 58 + 59:39(float64_t) Load 41(doublev) + 60:39(float64_t) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 59 + 61:39(float64_t) Load 41(doublev) + 62:39(float64_t) FAdd 61 60 + Store 41(doublev) 62 + 63: 43(f64vec2) Load 45(dvec2v) + 64: 43(f64vec2) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 63 + 65: 43(f64vec2) Load 45(dvec2v) + 66: 43(f64vec2) FAdd 65 64 + Store 45(dvec2v) 66 + 67: 48(f64vec3) Load 50(dvec3v) + 68: 48(f64vec3) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 67 + 69: 48(f64vec3) Load 50(dvec3v) + 70: 48(f64vec3) FAdd 69 68 + Store 50(dvec3v) 70 + 71: 53(f64vec4) Load 55(dvec4v) + 72: 53(f64vec4) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 71 + 73: 53(f64vec4) Load 55(dvec4v) + 74: 53(f64vec4) FAdd 73 72 + Store 55(dvec4v) 74 + 75:39(float64_t) Load 41(doublev) + 76:39(float64_t) ExtInst 1(GLSL.std.450) 4(FAbs) 75 + 77:39(float64_t) Load 41(doublev) + 78:39(float64_t) FAdd 77 76 + Store 41(doublev) 78 + 79: 43(f64vec2) Load 45(dvec2v) + 80: 43(f64vec2) ExtInst 1(GLSL.std.450) 4(FAbs) 79 + 81: 43(f64vec2) Load 45(dvec2v) + 82: 43(f64vec2) FAdd 81 80 + Store 45(dvec2v) 82 + 83: 48(f64vec3) Load 50(dvec3v) + 84: 48(f64vec3) ExtInst 1(GLSL.std.450) 4(FAbs) 83 + 85: 48(f64vec3) Load 50(dvec3v) + 86: 48(f64vec3) FAdd 85 84 + Store 50(dvec3v) 86 + 87: 53(f64vec4) Load 55(dvec4v) + 88: 53(f64vec4) ExtInst 1(GLSL.std.450) 4(FAbs) 87 + 89: 53(f64vec4) Load 55(dvec4v) + 90: 53(f64vec4) FAdd 89 88 + Store 55(dvec4v) 90 + 91:39(float64_t) Load 41(doublev) + 92:39(float64_t) ExtInst 1(GLSL.std.450) 6(FSign) 91 + 93:39(float64_t) Load 41(doublev) + 94:39(float64_t) FAdd 93 92 + Store 41(doublev) 94 + 95: 43(f64vec2) Load 45(dvec2v) + 96: 43(f64vec2) ExtInst 1(GLSL.std.450) 6(FSign) 95 + 97: 43(f64vec2) Load 45(dvec2v) + 98: 43(f64vec2) FAdd 97 96 + Store 45(dvec2v) 98 + 99: 48(f64vec3) Load 50(dvec3v) + 100: 48(f64vec3) ExtInst 1(GLSL.std.450) 6(FSign) 99 + 101: 48(f64vec3) Load 50(dvec3v) + 102: 48(f64vec3) FAdd 101 100 + Store 50(dvec3v) 102 + 103: 53(f64vec4) Load 55(dvec4v) + 104: 53(f64vec4) ExtInst 1(GLSL.std.450) 6(FSign) 103 + 105: 53(f64vec4) Load 55(dvec4v) + 106: 53(f64vec4) FAdd 105 104 + Store 55(dvec4v) 106 + 107:39(float64_t) Load 41(doublev) + 108:39(float64_t) ExtInst 1(GLSL.std.450) 8(Floor) 107 + 109:39(float64_t) Load 41(doublev) + 110:39(float64_t) FAdd 109 108 + Store 41(doublev) 110 + 111: 43(f64vec2) Load 45(dvec2v) + 112: 43(f64vec2) ExtInst 1(GLSL.std.450) 8(Floor) 111 + 113: 43(f64vec2) Load 45(dvec2v) + 114: 43(f64vec2) FAdd 113 112 + Store 45(dvec2v) 114 + 115: 48(f64vec3) Load 50(dvec3v) + 116: 48(f64vec3) ExtInst 1(GLSL.std.450) 8(Floor) 115 + 117: 48(f64vec3) Load 50(dvec3v) + 118: 48(f64vec3) FAdd 117 116 + Store 50(dvec3v) 118 + 119: 53(f64vec4) Load 55(dvec4v) + 120: 53(f64vec4) ExtInst 1(GLSL.std.450) 8(Floor) 119 + 121: 53(f64vec4) Load 55(dvec4v) + 122: 53(f64vec4) FAdd 121 120 + Store 55(dvec4v) 122 + 123:39(float64_t) Load 41(doublev) + 124:39(float64_t) ExtInst 1(GLSL.std.450) 3(Trunc) 123 + 125:39(float64_t) Load 41(doublev) + 126:39(float64_t) FAdd 125 124 + Store 41(doublev) 126 + 127: 43(f64vec2) Load 45(dvec2v) + 128: 43(f64vec2) ExtInst 1(GLSL.std.450) 3(Trunc) 127 + 129: 43(f64vec2) Load 45(dvec2v) + 130: 43(f64vec2) FAdd 129 128 + Store 45(dvec2v) 130 + 131: 48(f64vec3) Load 50(dvec3v) + 132: 48(f64vec3) ExtInst 1(GLSL.std.450) 3(Trunc) 131 + 133: 48(f64vec3) Load 50(dvec3v) + 134: 48(f64vec3) FAdd 133 132 + Store 50(dvec3v) 134 + 135: 53(f64vec4) Load 55(dvec4v) + 136: 53(f64vec4) ExtInst 1(GLSL.std.450) 3(Trunc) 135 + 137: 53(f64vec4) Load 55(dvec4v) + 138: 53(f64vec4) FAdd 137 136 + Store 55(dvec4v) 138 + 139:39(float64_t) Load 41(doublev) + 140:39(float64_t) ExtInst 1(GLSL.std.450) 1(Round) 139 + 141:39(float64_t) Load 41(doublev) + 142:39(float64_t) FAdd 141 140 + Store 41(doublev) 142 + 143: 43(f64vec2) Load 45(dvec2v) + 144: 43(f64vec2) ExtInst 1(GLSL.std.450) 1(Round) 143 + 145: 43(f64vec2) Load 45(dvec2v) + 146: 43(f64vec2) FAdd 145 144 + Store 45(dvec2v) 146 + 147: 48(f64vec3) Load 50(dvec3v) + 148: 48(f64vec3) ExtInst 1(GLSL.std.450) 1(Round) 147 + 149: 48(f64vec3) Load 50(dvec3v) + 150: 48(f64vec3) FAdd 149 148 + Store 50(dvec3v) 150 + 151: 53(f64vec4) Load 55(dvec4v) + 152: 53(f64vec4) ExtInst 1(GLSL.std.450) 1(Round) 151 + 153: 53(f64vec4) Load 55(dvec4v) + 154: 53(f64vec4) FAdd 153 152 + Store 55(dvec4v) 154 + 155:39(float64_t) Load 41(doublev) + 156:39(float64_t) ExtInst 1(GLSL.std.450) 2(RoundEven) 155 + 157:39(float64_t) Load 41(doublev) + 158:39(float64_t) FAdd 157 156 + Store 41(doublev) 158 + 159: 43(f64vec2) Load 45(dvec2v) + 160: 43(f64vec2) ExtInst 1(GLSL.std.450) 2(RoundEven) 159 + 161: 43(f64vec2) Load 45(dvec2v) + 162: 43(f64vec2) FAdd 161 160 + Store 45(dvec2v) 162 + 163: 48(f64vec3) Load 50(dvec3v) + 164: 48(f64vec3) ExtInst 1(GLSL.std.450) 2(RoundEven) 163 + 165: 48(f64vec3) Load 50(dvec3v) + 166: 48(f64vec3) FAdd 165 164 + Store 50(dvec3v) 166 + 167: 53(f64vec4) Load 55(dvec4v) + 168: 53(f64vec4) ExtInst 1(GLSL.std.450) 2(RoundEven) 167 + 169: 53(f64vec4) Load 55(dvec4v) + 170: 53(f64vec4) FAdd 169 168 + Store 55(dvec4v) 170 + 171:39(float64_t) Load 41(doublev) + 172:39(float64_t) ExtInst 1(GLSL.std.450) 9(Ceil) 171 + 173:39(float64_t) Load 41(doublev) + 174:39(float64_t) FAdd 173 172 + Store 41(doublev) 174 + 175: 43(f64vec2) Load 45(dvec2v) + 176: 43(f64vec2) ExtInst 1(GLSL.std.450) 9(Ceil) 175 + 177: 43(f64vec2) Load 45(dvec2v) + 178: 43(f64vec2) FAdd 177 176 + Store 45(dvec2v) 178 + 179: 48(f64vec3) Load 50(dvec3v) + 180: 48(f64vec3) ExtInst 1(GLSL.std.450) 9(Ceil) 179 + 181: 48(f64vec3) Load 50(dvec3v) + 182: 48(f64vec3) FAdd 181 180 + Store 50(dvec3v) 182 + 183: 53(f64vec4) Load 55(dvec4v) + 184: 53(f64vec4) ExtInst 1(GLSL.std.450) 9(Ceil) 183 + 185: 53(f64vec4) Load 55(dvec4v) + 186: 53(f64vec4) FAdd 185 184 + Store 55(dvec4v) 186 + 187:39(float64_t) Load 41(doublev) + 188:39(float64_t) ExtInst 1(GLSL.std.450) 10(Fract) 187 + 189:39(float64_t) Load 41(doublev) + 190:39(float64_t) FAdd 189 188 + Store 41(doublev) 190 + 191: 43(f64vec2) Load 45(dvec2v) + 192: 43(f64vec2) ExtInst 1(GLSL.std.450) 10(Fract) 191 + 193: 43(f64vec2) Load 45(dvec2v) + 194: 43(f64vec2) FAdd 193 192 + Store 45(dvec2v) 194 + 195: 48(f64vec3) Load 50(dvec3v) + 196: 48(f64vec3) ExtInst 1(GLSL.std.450) 10(Fract) 195 + 197: 48(f64vec3) Load 50(dvec3v) + 198: 48(f64vec3) FAdd 197 196 + Store 50(dvec3v) 198 + 199: 53(f64vec4) Load 55(dvec4v) + 200: 53(f64vec4) ExtInst 1(GLSL.std.450) 10(Fract) 199 + 201: 53(f64vec4) Load 55(dvec4v) + 202: 53(f64vec4) FAdd 201 200 + Store 55(dvec4v) 202 + 203:39(float64_t) Load 41(doublev) + 204:39(float64_t) Load 41(doublev) + 205:39(float64_t) FMod 203 204 + 206:39(float64_t) Load 41(doublev) + 207:39(float64_t) FAdd 206 205 + Store 41(doublev) 207 + 208: 43(f64vec2) Load 45(dvec2v) + 209:39(float64_t) Load 41(doublev) + 210: 43(f64vec2) CompositeConstruct 209 209 + 211: 43(f64vec2) FMod 208 210 + 212: 43(f64vec2) Load 45(dvec2v) + 213: 43(f64vec2) FAdd 212 211 + Store 45(dvec2v) 213 + 214: 48(f64vec3) Load 50(dvec3v) + 215:39(float64_t) Load 41(doublev) + 216: 48(f64vec3) CompositeConstruct 215 215 215 + 217: 48(f64vec3) FMod 214 216 + 218: 48(f64vec3) Load 50(dvec3v) + 219: 48(f64vec3) FAdd 218 217 + Store 50(dvec3v) 219 + 220: 53(f64vec4) Load 55(dvec4v) + 221:39(float64_t) Load 41(doublev) + 222: 53(f64vec4) CompositeConstruct 221 221 221 221 + 223: 53(f64vec4) FMod 220 222 + 224: 53(f64vec4) Load 55(dvec4v) + 225: 53(f64vec4) FAdd 224 223 + Store 55(dvec4v) 225 + 226: 43(f64vec2) Load 45(dvec2v) + 227: 43(f64vec2) Load 45(dvec2v) + 228: 43(f64vec2) FMod 226 227 + 229: 43(f64vec2) Load 45(dvec2v) + 230: 43(f64vec2) FAdd 229 228 + Store 45(dvec2v) 230 + 231: 48(f64vec3) Load 50(dvec3v) + 232: 48(f64vec3) Load 50(dvec3v) + 233: 48(f64vec3) FMod 231 232 + 234: 48(f64vec3) Load 50(dvec3v) + 235: 48(f64vec3) FAdd 234 233 + Store 50(dvec3v) 235 + 236: 53(f64vec4) Load 55(dvec4v) + 237: 53(f64vec4) Load 55(dvec4v) + 238: 53(f64vec4) FMod 236 237 + 239: 53(f64vec4) Load 55(dvec4v) + 240: 53(f64vec4) FAdd 239 238 + Store 55(dvec4v) 240 + 241:39(float64_t) Load 41(doublev) + 242:39(float64_t) ExtInst 1(GLSL.std.450) 35(Modf) 241 41(doublev) + 243:39(float64_t) Load 41(doublev) + 244:39(float64_t) FAdd 243 242 + Store 41(doublev) 244 + 245: 43(f64vec2) Load 45(dvec2v) + 246: 43(f64vec2) ExtInst 1(GLSL.std.450) 35(Modf) 245 45(dvec2v) + 247: 43(f64vec2) Load 45(dvec2v) + 248: 43(f64vec2) FAdd 247 246 + Store 45(dvec2v) 248 + 249: 48(f64vec3) Load 50(dvec3v) + 250: 48(f64vec3) ExtInst 1(GLSL.std.450) 35(Modf) 249 50(dvec3v) + 251: 48(f64vec3) Load 50(dvec3v) + 252: 48(f64vec3) FAdd 251 250 + Store 50(dvec3v) 252 + 253: 53(f64vec4) Load 55(dvec4v) + 254: 53(f64vec4) ExtInst 1(GLSL.std.450) 35(Modf) 253 55(dvec4v) + 255: 53(f64vec4) Load 55(dvec4v) + 256: 53(f64vec4) FAdd 255 254 + Store 55(dvec4v) 256 + 257:39(float64_t) Load 41(doublev) + 258:39(float64_t) Load 41(doublev) + 259:39(float64_t) ExtInst 1(GLSL.std.450) 37(FMin) 257 258 + 260:39(float64_t) Load 41(doublev) + 261:39(float64_t) FAdd 260 259 + Store 41(doublev) 261 + 262: 43(f64vec2) Load 45(dvec2v) + 263:39(float64_t) Load 41(doublev) + 264: 43(f64vec2) CompositeConstruct 263 263 + 265: 43(f64vec2) ExtInst 1(GLSL.std.450) 37(FMin) 262 264 + 266: 43(f64vec2) Load 45(dvec2v) + 267: 43(f64vec2) FAdd 266 265 + Store 45(dvec2v) 267 + 268: 48(f64vec3) Load 50(dvec3v) + 269:39(float64_t) Load 41(doublev) + 270: 48(f64vec3) CompositeConstruct 269 269 269 + 271: 48(f64vec3) ExtInst 1(GLSL.std.450) 37(FMin) 268 270 + 272: 48(f64vec3) Load 50(dvec3v) + 273: 48(f64vec3) FAdd 272 271 + Store 50(dvec3v) 273 + 274: 53(f64vec4) Load 55(dvec4v) + 275:39(float64_t) Load 41(doublev) + 276: 53(f64vec4) CompositeConstruct 275 275 275 275 + 277: 53(f64vec4) ExtInst 1(GLSL.std.450) 37(FMin) 274 276 + 278: 53(f64vec4) Load 55(dvec4v) + 279: 53(f64vec4) FAdd 278 277 + Store 55(dvec4v) 279 + 280: 43(f64vec2) Load 45(dvec2v) + 281: 43(f64vec2) Load 45(dvec2v) + 282: 43(f64vec2) ExtInst 1(GLSL.std.450) 37(FMin) 280 281 + 283: 43(f64vec2) Load 45(dvec2v) + 284: 43(f64vec2) FAdd 283 282 + Store 45(dvec2v) 284 + 285: 48(f64vec3) Load 50(dvec3v) + 286: 48(f64vec3) Load 50(dvec3v) + 287: 48(f64vec3) ExtInst 1(GLSL.std.450) 37(FMin) 285 286 + 288: 48(f64vec3) Load 50(dvec3v) + 289: 48(f64vec3) FAdd 288 287 + Store 50(dvec3v) 289 + 290: 53(f64vec4) Load 55(dvec4v) + 291: 53(f64vec4) Load 55(dvec4v) + 292: 53(f64vec4) ExtInst 1(GLSL.std.450) 37(FMin) 290 291 + 293: 53(f64vec4) Load 55(dvec4v) + 294: 53(f64vec4) FAdd 293 292 + Store 55(dvec4v) 294 + 295:39(float64_t) Load 41(doublev) + 296:39(float64_t) Load 41(doublev) + 297:39(float64_t) ExtInst 1(GLSL.std.450) 40(FMax) 295 296 + 298:39(float64_t) Load 41(doublev) + 299:39(float64_t) FAdd 298 297 + Store 41(doublev) 299 + 300: 43(f64vec2) Load 45(dvec2v) + 301:39(float64_t) Load 41(doublev) + 302: 43(f64vec2) CompositeConstruct 301 301 + 303: 43(f64vec2) ExtInst 1(GLSL.std.450) 40(FMax) 300 302 + 304: 43(f64vec2) Load 45(dvec2v) + 305: 43(f64vec2) FAdd 304 303 + Store 45(dvec2v) 305 + 306: 48(f64vec3) Load 50(dvec3v) + 307:39(float64_t) Load 41(doublev) + 308: 48(f64vec3) CompositeConstruct 307 307 307 + 309: 48(f64vec3) ExtInst 1(GLSL.std.450) 40(FMax) 306 308 + 310: 48(f64vec3) Load 50(dvec3v) + 311: 48(f64vec3) FAdd 310 309 + Store 50(dvec3v) 311 + 312: 53(f64vec4) Load 55(dvec4v) + 313:39(float64_t) Load 41(doublev) + 314: 53(f64vec4) CompositeConstruct 313 313 313 313 + 315: 53(f64vec4) ExtInst 1(GLSL.std.450) 40(FMax) 312 314 + 316: 53(f64vec4) Load 55(dvec4v) + 317: 53(f64vec4) FAdd 316 315 + Store 55(dvec4v) 317 + 318: 43(f64vec2) Load 45(dvec2v) + 319: 43(f64vec2) Load 45(dvec2v) + 320: 43(f64vec2) ExtInst 1(GLSL.std.450) 40(FMax) 318 319 + 321: 43(f64vec2) Load 45(dvec2v) + 322: 43(f64vec2) FAdd 321 320 + Store 45(dvec2v) 322 + 323: 48(f64vec3) Load 50(dvec3v) + 324: 48(f64vec3) Load 50(dvec3v) + 325: 48(f64vec3) ExtInst 1(GLSL.std.450) 40(FMax) 323 324 + 326: 48(f64vec3) Load 50(dvec3v) + 327: 48(f64vec3) FAdd 326 325 + Store 50(dvec3v) 327 + 328: 53(f64vec4) Load 55(dvec4v) + 329: 53(f64vec4) Load 55(dvec4v) + 330: 53(f64vec4) ExtInst 1(GLSL.std.450) 40(FMax) 328 329 + 331: 53(f64vec4) Load 55(dvec4v) + 332: 53(f64vec4) FAdd 331 330 + Store 55(dvec4v) 332 + 333:39(float64_t) Load 41(doublev) + 334:39(float64_t) Load 41(doublev) + 335:39(float64_t) Load 41(doublev) + 336:39(float64_t) ExtInst 1(GLSL.std.450) 43(FClamp) 333 334 335 + 337:39(float64_t) Load 41(doublev) + 338:39(float64_t) FAdd 337 336 + Store 41(doublev) 338 + 339: 43(f64vec2) Load 45(dvec2v) + 340:39(float64_t) Load 41(doublev) + 341:39(float64_t) Load 41(doublev) + 342: 43(f64vec2) CompositeConstruct 340 340 + 343: 43(f64vec2) CompositeConstruct 341 341 + 344: 43(f64vec2) ExtInst 1(GLSL.std.450) 43(FClamp) 339 342 343 + 345: 43(f64vec2) Load 45(dvec2v) + 346: 43(f64vec2) FAdd 345 344 + Store 45(dvec2v) 346 + 347: 48(f64vec3) Load 50(dvec3v) + 348:39(float64_t) Load 41(doublev) + 349:39(float64_t) Load 41(doublev) + 350: 48(f64vec3) CompositeConstruct 348 348 348 + 351: 48(f64vec3) CompositeConstruct 349 349 349 + 352: 48(f64vec3) ExtInst 1(GLSL.std.450) 43(FClamp) 347 350 351 + 353: 48(f64vec3) Load 50(dvec3v) + 354: 48(f64vec3) FAdd 353 352 + Store 50(dvec3v) 354 + 355: 53(f64vec4) Load 55(dvec4v) + 356:39(float64_t) Load 41(doublev) + 357:39(float64_t) Load 41(doublev) + 358: 53(f64vec4) CompositeConstruct 356 356 356 356 + 359: 53(f64vec4) CompositeConstruct 357 357 357 357 + 360: 53(f64vec4) ExtInst 1(GLSL.std.450) 43(FClamp) 355 358 359 + 361: 53(f64vec4) Load 55(dvec4v) + 362: 53(f64vec4) FAdd 361 360 + Store 55(dvec4v) 362 + 363: 43(f64vec2) Load 45(dvec2v) + 364: 43(f64vec2) Load 45(dvec2v) + 365: 43(f64vec2) Load 45(dvec2v) + 366: 43(f64vec2) ExtInst 1(GLSL.std.450) 43(FClamp) 363 364 365 + 367: 43(f64vec2) Load 45(dvec2v) + 368: 43(f64vec2) FAdd 367 366 + Store 45(dvec2v) 368 + 369: 48(f64vec3) Load 50(dvec3v) + 370: 48(f64vec3) Load 50(dvec3v) + 371: 48(f64vec3) Load 50(dvec3v) + 372: 48(f64vec3) ExtInst 1(GLSL.std.450) 43(FClamp) 369 370 371 + 373: 48(f64vec3) Load 50(dvec3v) + 374: 48(f64vec3) FAdd 373 372 + Store 50(dvec3v) 374 + 375: 53(f64vec4) Load 55(dvec4v) + 376: 53(f64vec4) Load 55(dvec4v) + 377: 53(f64vec4) Load 55(dvec4v) + 378: 53(f64vec4) ExtInst 1(GLSL.std.450) 43(FClamp) 375 376 377 + 379: 53(f64vec4) Load 55(dvec4v) + 380: 53(f64vec4) FAdd 379 378 + Store 55(dvec4v) 380 + 381:39(float64_t) Load 41(doublev) + 382:39(float64_t) Load 41(doublev) + 383:39(float64_t) Load 41(doublev) + 384:39(float64_t) ExtInst 1(GLSL.std.450) 46(FMix) 381 382 383 + 385:39(float64_t) Load 41(doublev) + 386:39(float64_t) FAdd 385 384 + Store 41(doublev) 386 + 387: 43(f64vec2) Load 45(dvec2v) + 388: 43(f64vec2) Load 45(dvec2v) + 389:39(float64_t) Load 41(doublev) + 390: 43(f64vec2) CompositeConstruct 389 389 + 391: 43(f64vec2) ExtInst 1(GLSL.std.450) 46(FMix) 387 388 390 + 392: 43(f64vec2) Load 45(dvec2v) + 393: 43(f64vec2) FAdd 392 391 + Store 45(dvec2v) 393 + 394: 48(f64vec3) Load 50(dvec3v) + 395: 48(f64vec3) Load 50(dvec3v) + 396:39(float64_t) Load 41(doublev) + 397: 48(f64vec3) CompositeConstruct 396 396 396 + 398: 48(f64vec3) ExtInst 1(GLSL.std.450) 46(FMix) 394 395 397 + 399: 48(f64vec3) Load 50(dvec3v) + 400: 48(f64vec3) FAdd 399 398 + Store 50(dvec3v) 400 + 401: 53(f64vec4) Load 55(dvec4v) + 402: 53(f64vec4) Load 55(dvec4v) + 403:39(float64_t) Load 41(doublev) + 404: 53(f64vec4) CompositeConstruct 403 403 403 403 + 405: 53(f64vec4) ExtInst 1(GLSL.std.450) 46(FMix) 401 402 404 + 406: 53(f64vec4) Load 55(dvec4v) + 407: 53(f64vec4) FAdd 406 405 + Store 55(dvec4v) 407 + 408: 43(f64vec2) Load 45(dvec2v) + 409: 43(f64vec2) Load 45(dvec2v) + 410: 43(f64vec2) Load 45(dvec2v) + 411: 43(f64vec2) ExtInst 1(GLSL.std.450) 46(FMix) 408 409 410 + 412: 43(f64vec2) Load 45(dvec2v) + 413: 43(f64vec2) FAdd 412 411 + Store 45(dvec2v) 413 + 414: 48(f64vec3) Load 50(dvec3v) + 415: 48(f64vec3) Load 50(dvec3v) + 416: 48(f64vec3) Load 50(dvec3v) + 417: 48(f64vec3) ExtInst 1(GLSL.std.450) 46(FMix) 414 415 416 + 418: 48(f64vec3) Load 50(dvec3v) + 419: 48(f64vec3) FAdd 418 417 + Store 50(dvec3v) 419 + 420: 53(f64vec4) Load 55(dvec4v) + 421: 53(f64vec4) Load 55(dvec4v) + 422: 53(f64vec4) Load 55(dvec4v) + 423: 53(f64vec4) ExtInst 1(GLSL.std.450) 46(FMix) 420 421 422 + 424: 53(f64vec4) Load 55(dvec4v) + 425: 53(f64vec4) FAdd 424 423 + Store 55(dvec4v) 425 + 426:39(float64_t) Load 41(doublev) + 427:39(float64_t) Load 41(doublev) + 431: 428(bool) Load 430(boolv) + 432:39(float64_t) Select 431 427 426 + 433:39(float64_t) Load 41(doublev) + 434:39(float64_t) FAdd 433 432 + Store 41(doublev) 434 + 435: 43(f64vec2) Load 45(dvec2v) + 436: 43(f64vec2) Load 45(dvec2v) + 440: 437(bvec2) Load 439(bvec2v) + 441: 43(f64vec2) Select 440 436 435 + 442: 43(f64vec2) Load 45(dvec2v) + 443: 43(f64vec2) FAdd 442 441 + Store 45(dvec2v) 443 + 444: 48(f64vec3) Load 50(dvec3v) + 445: 48(f64vec3) Load 50(dvec3v) + 449: 446(bvec3) Load 448(bvec3v) + 450: 48(f64vec3) Select 449 445 444 + 451: 48(f64vec3) Load 50(dvec3v) + 452: 48(f64vec3) FAdd 451 450 + Store 50(dvec3v) 452 + 453: 53(f64vec4) Load 55(dvec4v) + 454: 53(f64vec4) Load 55(dvec4v) + 458: 455(bvec4) Load 457(bvec4v) + 459: 53(f64vec4) Select 458 454 453 + 460: 53(f64vec4) Load 55(dvec4v) + 461: 53(f64vec4) FAdd 460 459 + Store 55(dvec4v) 461 + 462:39(float64_t) Load 41(doublev) + 463:39(float64_t) Load 41(doublev) + 464:39(float64_t) ExtInst 1(GLSL.std.450) 48(Step) 462 463 + 465:39(float64_t) Load 41(doublev) + 466:39(float64_t) FAdd 465 464 + Store 41(doublev) 466 + 467: 43(f64vec2) Load 45(dvec2v) + 468: 43(f64vec2) Load 45(dvec2v) + 469: 43(f64vec2) ExtInst 1(GLSL.std.450) 48(Step) 467 468 + 470: 43(f64vec2) Load 45(dvec2v) + 471: 43(f64vec2) FAdd 470 469 + Store 45(dvec2v) 471 + 472: 48(f64vec3) Load 50(dvec3v) + 473: 48(f64vec3) Load 50(dvec3v) + 474: 48(f64vec3) ExtInst 1(GLSL.std.450) 48(Step) 472 473 + 475: 48(f64vec3) Load 50(dvec3v) + 476: 48(f64vec3) FAdd 475 474 + Store 50(dvec3v) 476 + 477: 53(f64vec4) Load 55(dvec4v) + 478: 53(f64vec4) Load 55(dvec4v) + 479: 53(f64vec4) ExtInst 1(GLSL.std.450) 48(Step) 477 478 + 480: 53(f64vec4) Load 55(dvec4v) + 481: 53(f64vec4) FAdd 480 479 + Store 55(dvec4v) 481 + 482:39(float64_t) Load 41(doublev) + 483: 43(f64vec2) Load 45(dvec2v) + 484: 43(f64vec2) CompositeConstruct 482 482 + 485: 43(f64vec2) ExtInst 1(GLSL.std.450) 48(Step) 484 483 + 486: 43(f64vec2) Load 45(dvec2v) + 487: 43(f64vec2) FAdd 486 485 + Store 45(dvec2v) 487 + 488:39(float64_t) Load 41(doublev) + 489: 48(f64vec3) Load 50(dvec3v) + 490: 48(f64vec3) CompositeConstruct 488 488 488 + 491: 48(f64vec3) ExtInst 1(GLSL.std.450) 48(Step) 490 489 + 492: 48(f64vec3) Load 50(dvec3v) + 493: 48(f64vec3) FAdd 492 491 + Store 50(dvec3v) 493 + 494:39(float64_t) Load 41(doublev) + 495: 53(f64vec4) Load 55(dvec4v) + 496: 53(f64vec4) CompositeConstruct 494 494 494 494 + 497: 53(f64vec4) ExtInst 1(GLSL.std.450) 48(Step) 496 495 + 498: 53(f64vec4) Load 55(dvec4v) + 499: 53(f64vec4) FAdd 498 497 + Store 55(dvec4v) 499 + 500:39(float64_t) Load 41(doublev) + 501:39(float64_t) Load 41(doublev) + 502:39(float64_t) Load 41(doublev) + 503:39(float64_t) ExtInst 1(GLSL.std.450) 49(SmoothStep) 500 501 502 + 504:39(float64_t) Load 41(doublev) + 505:39(float64_t) FAdd 504 503 + Store 41(doublev) 505 + 506: 43(f64vec2) Load 45(dvec2v) + 507: 43(f64vec2) Load 45(dvec2v) + 508: 43(f64vec2) Load 45(dvec2v) + 509: 43(f64vec2) ExtInst 1(GLSL.std.450) 49(SmoothStep) 506 507 508 + 510: 43(f64vec2) Load 45(dvec2v) + 511: 43(f64vec2) FAdd 510 509 + Store 45(dvec2v) 511 + 512: 48(f64vec3) Load 50(dvec3v) + 513: 48(f64vec3) Load 50(dvec3v) + 514: 48(f64vec3) Load 50(dvec3v) + 515: 48(f64vec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 512 513 514 + 516: 48(f64vec3) Load 50(dvec3v) + 517: 48(f64vec3) FAdd 516 515 + Store 50(dvec3v) 517 + 518: 53(f64vec4) Load 55(dvec4v) + 519: 53(f64vec4) Load 55(dvec4v) + 520: 53(f64vec4) Load 55(dvec4v) + 521: 53(f64vec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 518 519 520 + 522: 53(f64vec4) Load 55(dvec4v) + 523: 53(f64vec4) FAdd 522 521 + Store 55(dvec4v) 523 + 524:39(float64_t) Load 41(doublev) + 525:39(float64_t) Load 41(doublev) + 526: 43(f64vec2) Load 45(dvec2v) + 527: 43(f64vec2) CompositeConstruct 524 524 + 528: 43(f64vec2) CompositeConstruct 525 525 + 529: 43(f64vec2) ExtInst 1(GLSL.std.450) 49(SmoothStep) 527 528 526 + 530: 43(f64vec2) Load 45(dvec2v) + 531: 43(f64vec2) FAdd 530 529 + Store 45(dvec2v) 531 + 532:39(float64_t) Load 41(doublev) + 533:39(float64_t) Load 41(doublev) + 534: 48(f64vec3) Load 50(dvec3v) + 535: 48(f64vec3) CompositeConstruct 532 532 532 + 536: 48(f64vec3) CompositeConstruct 533 533 533 + 537: 48(f64vec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 535 536 534 + 538: 48(f64vec3) Load 50(dvec3v) + 539: 48(f64vec3) FAdd 538 537 + Store 50(dvec3v) 539 + 540:39(float64_t) Load 41(doublev) + 541:39(float64_t) Load 41(doublev) + 542: 53(f64vec4) Load 55(dvec4v) + 543: 53(f64vec4) CompositeConstruct 540 540 540 540 + 544: 53(f64vec4) CompositeConstruct 541 541 541 541 + 545: 53(f64vec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 543 544 542 + 546: 53(f64vec4) Load 55(dvec4v) + 547: 53(f64vec4) FAdd 546 545 + Store 55(dvec4v) 547 + 548:39(float64_t) Load 41(doublev) + 549: 428(bool) IsNan 548 + Store 430(boolv) 549 + 550: 43(f64vec2) Load 45(dvec2v) + 551: 437(bvec2) IsNan 550 + Store 439(bvec2v) 551 + 552: 48(f64vec3) Load 50(dvec3v) + 553: 446(bvec3) IsNan 552 + Store 448(bvec3v) 553 + 554: 53(f64vec4) Load 55(dvec4v) + 555: 455(bvec4) IsNan 554 + Store 457(bvec4v) 555 + 556: 428(bool) Load 430(boolv) + SelectionMerge 559 None + BranchConditional 556 558 562 + 558: Label + 560:39(float64_t) Load 41(doublev) + 561: 428(bool) IsInf 560 + Store 557 561 + Branch 559 + 562: Label + Store 557 563 + Branch 559 + 559: Label + 564: 428(bool) Load 557 + Store 430(boolv) 564 + 565: 428(bool) Load 430(boolv) + SelectionMerge 568 None + BranchConditional 565 567 571 + 567: Label + 569: 43(f64vec2) Load 45(dvec2v) + 570: 437(bvec2) IsInf 569 + Store 566 570 + Branch 568 + 571: Label + Store 566 572 + Branch 568 + 568: Label + 573: 437(bvec2) Load 566 + Store 439(bvec2v) 573 + 574: 428(bool) Load 430(boolv) + SelectionMerge 577 None + BranchConditional 574 576 580 + 576: Label + 578: 48(f64vec3) Load 50(dvec3v) + 579: 446(bvec3) IsInf 578 + Store 575 579 + Branch 577 + 580: Label + Store 575 581 + Branch 577 + 577: Label + 582: 446(bvec3) Load 575 + Store 448(bvec3v) 582 + 583: 428(bool) Load 430(boolv) + SelectionMerge 586 None + BranchConditional 583 585 589 + 585: Label + 587: 53(f64vec4) Load 55(dvec4v) + 588: 455(bvec4) IsInf 587 + Store 584 588 + Branch 586 + 589: Label + Store 584 590 + Branch 586 + 586: Label + 591: 455(bvec4) Load 584 + Store 457(bvec4v) 591 + 592:39(float64_t) Load 41(doublev) + 593:39(float64_t) ExtInst 1(GLSL.std.450) 66(Length) 592 + 594:39(float64_t) Load 41(doublev) + 595:39(float64_t) FAdd 594 593 + Store 41(doublev) 595 + 596: 43(f64vec2) Load 45(dvec2v) + 597:39(float64_t) ExtInst 1(GLSL.std.450) 66(Length) 596 + 598:39(float64_t) Load 41(doublev) + 599:39(float64_t) FAdd 598 597 + Store 41(doublev) 599 + 600: 48(f64vec3) Load 50(dvec3v) + 601:39(float64_t) ExtInst 1(GLSL.std.450) 66(Length) 600 + 602:39(float64_t) Load 41(doublev) + 603:39(float64_t) FAdd 602 601 + Store 41(doublev) 603 + 604: 53(f64vec4) Load 55(dvec4v) + 605:39(float64_t) ExtInst 1(GLSL.std.450) 66(Length) 604 + 606:39(float64_t) Load 41(doublev) + 607:39(float64_t) FAdd 606 605 + Store 41(doublev) 607 + 608:39(float64_t) Load 41(doublev) + 609:39(float64_t) Load 41(doublev) + 610:39(float64_t) ExtInst 1(GLSL.std.450) 67(Distance) 608 609 + 611:39(float64_t) Load 41(doublev) + 612:39(float64_t) FAdd 611 610 + Store 41(doublev) 612 + 613: 43(f64vec2) Load 45(dvec2v) + 614: 43(f64vec2) Load 45(dvec2v) + 615:39(float64_t) ExtInst 1(GLSL.std.450) 67(Distance) 613 614 + 616:39(float64_t) Load 41(doublev) + 617:39(float64_t) FAdd 616 615 + Store 41(doublev) 617 + 618: 48(f64vec3) Load 50(dvec3v) + 619: 48(f64vec3) Load 50(dvec3v) + 620:39(float64_t) ExtInst 1(GLSL.std.450) 67(Distance) 618 619 + 621:39(float64_t) Load 41(doublev) + 622:39(float64_t) FAdd 621 620 + Store 41(doublev) 622 + 623: 53(f64vec4) Load 55(dvec4v) + 624: 53(f64vec4) Load 55(dvec4v) + 625:39(float64_t) ExtInst 1(GLSL.std.450) 67(Distance) 623 624 + 626:39(float64_t) Load 41(doublev) + 627:39(float64_t) FAdd 626 625 + Store 41(doublev) 627 + 628:39(float64_t) Load 41(doublev) + 629:39(float64_t) Load 41(doublev) + 630:39(float64_t) FMul 628 629 + 631:39(float64_t) Load 41(doublev) + 632:39(float64_t) FAdd 631 630 + Store 41(doublev) 632 + 633: 43(f64vec2) Load 45(dvec2v) + 634: 43(f64vec2) Load 45(dvec2v) + 635:39(float64_t) Dot 633 634 + 636:39(float64_t) Load 41(doublev) + 637:39(float64_t) FAdd 636 635 + Store 41(doublev) 637 + 638: 48(f64vec3) Load 50(dvec3v) + 639: 48(f64vec3) Load 50(dvec3v) + 640:39(float64_t) Dot 638 639 + 641:39(float64_t) Load 41(doublev) + 642:39(float64_t) FAdd 641 640 + Store 41(doublev) 642 + 643: 53(f64vec4) Load 55(dvec4v) + 644: 53(f64vec4) Load 55(dvec4v) + 645:39(float64_t) Dot 643 644 + 646:39(float64_t) Load 41(doublev) + 647:39(float64_t) FAdd 646 645 + Store 41(doublev) 647 + 648: 48(f64vec3) Load 50(dvec3v) + 649: 48(f64vec3) Load 50(dvec3v) + 650: 48(f64vec3) ExtInst 1(GLSL.std.450) 68(Cross) 648 649 + 651: 48(f64vec3) Load 50(dvec3v) + 652: 48(f64vec3) FAdd 651 650 + Store 50(dvec3v) 652 + 653:39(float64_t) Load 41(doublev) + 654:39(float64_t) ExtInst 1(GLSL.std.450) 69(Normalize) 653 + 655:39(float64_t) Load 41(doublev) + 656:39(float64_t) FAdd 655 654 + Store 41(doublev) 656 + 657: 43(f64vec2) Load 45(dvec2v) + 658: 43(f64vec2) ExtInst 1(GLSL.std.450) 69(Normalize) 657 + 659: 43(f64vec2) Load 45(dvec2v) + 660: 43(f64vec2) FAdd 659 658 + Store 45(dvec2v) 660 + 661: 48(f64vec3) Load 50(dvec3v) + 662: 48(f64vec3) ExtInst 1(GLSL.std.450) 69(Normalize) 661 + 663: 48(f64vec3) Load 50(dvec3v) + 664: 48(f64vec3) FAdd 663 662 + Store 50(dvec3v) 664 + 665: 53(f64vec4) Load 55(dvec4v) + 666: 53(f64vec4) ExtInst 1(GLSL.std.450) 69(Normalize) 665 + 667: 53(f64vec4) Load 55(dvec4v) + 668: 53(f64vec4) FAdd 667 666 + Store 55(dvec4v) 668 + 669:39(float64_t) Load 41(doublev) + 670:39(float64_t) Load 41(doublev) + 671:39(float64_t) Load 41(doublev) + 672:39(float64_t) ExtInst 1(GLSL.std.450) 70(FaceForward) 669 670 671 + 673:39(float64_t) Load 41(doublev) + 674:39(float64_t) FAdd 673 672 + Store 41(doublev) 674 + 675: 43(f64vec2) Load 45(dvec2v) + 676: 43(f64vec2) Load 45(dvec2v) + 677: 43(f64vec2) Load 45(dvec2v) + 678: 43(f64vec2) ExtInst 1(GLSL.std.450) 70(FaceForward) 675 676 677 + 679: 43(f64vec2) Load 45(dvec2v) + 680: 43(f64vec2) FAdd 679 678 + Store 45(dvec2v) 680 + 681: 48(f64vec3) Load 50(dvec3v) + 682: 48(f64vec3) Load 50(dvec3v) + 683: 48(f64vec3) Load 50(dvec3v) + 684: 48(f64vec3) ExtInst 1(GLSL.std.450) 70(FaceForward) 681 682 683 + 685: 48(f64vec3) Load 50(dvec3v) + 686: 48(f64vec3) FAdd 685 684 + Store 50(dvec3v) 686 + 687: 53(f64vec4) Load 55(dvec4v) + 688: 53(f64vec4) Load 55(dvec4v) + 689: 53(f64vec4) Load 55(dvec4v) + 690: 53(f64vec4) ExtInst 1(GLSL.std.450) 70(FaceForward) 687 688 689 + 691: 53(f64vec4) Load 55(dvec4v) + 692: 53(f64vec4) FAdd 691 690 + Store 55(dvec4v) 692 + 693:39(float64_t) Load 41(doublev) + 694:39(float64_t) Load 41(doublev) + 695:39(float64_t) ExtInst 1(GLSL.std.450) 71(Reflect) 693 694 + 696:39(float64_t) Load 41(doublev) + 697:39(float64_t) FAdd 696 695 + Store 41(doublev) 697 + 698: 43(f64vec2) Load 45(dvec2v) + 699: 43(f64vec2) Load 45(dvec2v) + 700: 43(f64vec2) ExtInst 1(GLSL.std.450) 71(Reflect) 698 699 + 701: 43(f64vec2) Load 45(dvec2v) + 702: 43(f64vec2) FAdd 701 700 + Store 45(dvec2v) 702 + 703: 48(f64vec3) Load 50(dvec3v) + 704: 48(f64vec3) Load 50(dvec3v) + 705: 48(f64vec3) ExtInst 1(GLSL.std.450) 71(Reflect) 703 704 + 706: 48(f64vec3) Load 50(dvec3v) + 707: 48(f64vec3) FAdd 706 705 + Store 50(dvec3v) 707 + 708: 53(f64vec4) Load 55(dvec4v) + 709: 53(f64vec4) Load 55(dvec4v) + 710: 53(f64vec4) ExtInst 1(GLSL.std.450) 71(Reflect) 708 709 + 711: 53(f64vec4) Load 55(dvec4v) + 712: 53(f64vec4) FAdd 711 710 + Store 55(dvec4v) 712 + 713:39(float64_t) Load 41(doublev) + 714:39(float64_t) Load 41(doublev) + 715:39(float64_t) Load 41(doublev) + 716:39(float64_t) ExtInst 1(GLSL.std.450) 72(Refract) 713 714 715 + 717:39(float64_t) Load 41(doublev) + 718:39(float64_t) FAdd 717 716 + Store 41(doublev) 718 + 719: 43(f64vec2) Load 45(dvec2v) + 720: 43(f64vec2) Load 45(dvec2v) + 721:39(float64_t) Load 41(doublev) + 722: 43(f64vec2) ExtInst 1(GLSL.std.450) 72(Refract) 719 720 721 + 723: 43(f64vec2) Load 45(dvec2v) + 724: 43(f64vec2) FAdd 723 722 + Store 45(dvec2v) 724 + 725: 48(f64vec3) Load 50(dvec3v) + 726: 48(f64vec3) Load 50(dvec3v) + 727:39(float64_t) Load 41(doublev) + 728: 48(f64vec3) ExtInst 1(GLSL.std.450) 72(Refract) 725 726 727 + 729: 48(f64vec3) Load 50(dvec3v) + 730: 48(f64vec3) FAdd 729 728 + Store 50(dvec3v) 730 + 731: 53(f64vec4) Load 55(dvec4v) + 732: 53(f64vec4) Load 55(dvec4v) + 733:39(float64_t) Load 41(doublev) + 734: 53(f64vec4) ExtInst 1(GLSL.std.450) 72(Refract) 731 732 733 + 735: 53(f64vec4) Load 55(dvec4v) + 736: 53(f64vec4) FAdd 735 734 + Store 55(dvec4v) 736 + 740: 43(f64vec2) Load 45(dvec2v) + 741: 43(f64vec2) Load 45(dvec2v) + 742: 737 OuterProduct 740 741 + Store 739(dmat2v) 742 + 746: 48(f64vec3) Load 50(dvec3v) + 747: 48(f64vec3) Load 50(dvec3v) + 748: 743 OuterProduct 746 747 + Store 745(dmat3v) 748 + 752: 53(f64vec4) Load 55(dvec4v) + 753: 53(f64vec4) Load 55(dvec4v) + 754: 749 OuterProduct 752 753 + Store 751(dmat4v) 754 + 758: 48(f64vec3) Load 50(dvec3v) + 759: 43(f64vec2) Load 45(dvec2v) + 760: 755 OuterProduct 758 759 + Store 757(dmat2x3v) 760 + 764: 43(f64vec2) Load 45(dvec2v) + 765: 48(f64vec3) Load 50(dvec3v) + 766: 761 OuterProduct 764 765 + Store 763(dmat3x2v) 766 + 770: 53(f64vec4) Load 55(dvec4v) + 771: 43(f64vec2) Load 45(dvec2v) + 772: 767 OuterProduct 770 771 + Store 769(dmat2x4v) 772 + 776: 43(f64vec2) Load 45(dvec2v) + 777: 53(f64vec4) Load 55(dvec4v) + 778: 773 OuterProduct 776 777 + Store 775(dmat4x2v) 778 + 782: 53(f64vec4) Load 55(dvec4v) + 783: 48(f64vec3) Load 50(dvec3v) + 784: 779 OuterProduct 782 783 + Store 781(dmat3x4v) 784 + 788: 48(f64vec3) Load 50(dvec3v) + 789: 53(f64vec4) Load 55(dvec4v) + 790: 785 OuterProduct 788 789 + Store 787(dmat4x3v) 790 + 791: 737 Load 739(dmat2v) + 792: 737 Load 739(dmat2v) + 793: 43(f64vec2) CompositeExtract 791 0 + 794: 43(f64vec2) CompositeExtract 792 0 + 795: 43(f64vec2) FMul 793 794 + 796: 43(f64vec2) CompositeExtract 791 1 + 797: 43(f64vec2) CompositeExtract 792 1 + 798: 43(f64vec2) FMul 796 797 + 799: 737 CompositeConstruct 795 798 + 800: 737 Load 739(dmat2v) + 801: 737 MatrixTimesMatrix 800 799 + Store 739(dmat2v) 801 + 802: 743 Load 745(dmat3v) + 803: 743 Load 745(dmat3v) + 804: 48(f64vec3) CompositeExtract 802 0 + 805: 48(f64vec3) CompositeExtract 803 0 + 806: 48(f64vec3) FMul 804 805 + 807: 48(f64vec3) CompositeExtract 802 1 + 808: 48(f64vec3) CompositeExtract 803 1 + 809: 48(f64vec3) FMul 807 808 + 810: 48(f64vec3) CompositeExtract 802 2 + 811: 48(f64vec3) CompositeExtract 803 2 + 812: 48(f64vec3) FMul 810 811 + 813: 743 CompositeConstruct 806 809 812 + 814: 743 Load 745(dmat3v) + 815: 743 MatrixTimesMatrix 814 813 + Store 745(dmat3v) 815 + 816: 749 Load 751(dmat4v) + 817: 749 Load 751(dmat4v) + 818: 53(f64vec4) CompositeExtract 816 0 + 819: 53(f64vec4) CompositeExtract 817 0 + 820: 53(f64vec4) FMul 818 819 + 821: 53(f64vec4) CompositeExtract 816 1 + 822: 53(f64vec4) CompositeExtract 817 1 + 823: 53(f64vec4) FMul 821 822 + 824: 53(f64vec4) CompositeExtract 816 2 + 825: 53(f64vec4) CompositeExtract 817 2 + 826: 53(f64vec4) FMul 824 825 + 827: 53(f64vec4) CompositeExtract 816 3 + 828: 53(f64vec4) CompositeExtract 817 3 + 829: 53(f64vec4) FMul 827 828 + 830: 749 CompositeConstruct 820 823 826 829 + 831: 749 Load 751(dmat4v) + 832: 749 MatrixTimesMatrix 831 830 + Store 751(dmat4v) 832 + 833: 755 Load 757(dmat2x3v) + 834: 755 Load 757(dmat2x3v) + 835: 48(f64vec3) CompositeExtract 833 0 + 836: 48(f64vec3) CompositeExtract 834 0 + 837: 48(f64vec3) FMul 835 836 + 838: 48(f64vec3) CompositeExtract 833 1 + 839: 48(f64vec3) CompositeExtract 834 1 + 840: 48(f64vec3) FMul 838 839 + 841: 755 CompositeConstruct 837 840 + Store 757(dmat2x3v) 841 + 842: 767 Load 769(dmat2x4v) + 843: 767 Load 769(dmat2x4v) + 844: 53(f64vec4) CompositeExtract 842 0 + 845: 53(f64vec4) CompositeExtract 843 0 + 846: 53(f64vec4) FMul 844 845 + 847: 53(f64vec4) CompositeExtract 842 1 + 848: 53(f64vec4) CompositeExtract 843 1 + 849: 53(f64vec4) FMul 847 848 + 850: 767 CompositeConstruct 846 849 + Store 769(dmat2x4v) 850 + 851: 761 Load 763(dmat3x2v) + 852: 761 Load 763(dmat3x2v) + 853: 43(f64vec2) CompositeExtract 851 0 + 854: 43(f64vec2) CompositeExtract 852 0 + 855: 43(f64vec2) FMul 853 854 + 856: 43(f64vec2) CompositeExtract 851 1 + 857: 43(f64vec2) CompositeExtract 852 1 + 858: 43(f64vec2) FMul 856 857 + 859: 43(f64vec2) CompositeExtract 851 2 + 860: 43(f64vec2) CompositeExtract 852 2 + 861: 43(f64vec2) FMul 859 860 + 862: 761 CompositeConstruct 855 858 861 + Store 763(dmat3x2v) 862 + 863: 779 Load 781(dmat3x4v) + 864: 779 Load 781(dmat3x4v) + 865: 53(f64vec4) CompositeExtract 863 0 + 866: 53(f64vec4) CompositeExtract 864 0 + 867: 53(f64vec4) FMul 865 866 + 868: 53(f64vec4) CompositeExtract 863 1 + 869: 53(f64vec4) CompositeExtract 864 1 + 870: 53(f64vec4) FMul 868 869 + 871: 53(f64vec4) CompositeExtract 863 2 + 872: 53(f64vec4) CompositeExtract 864 2 + 873: 53(f64vec4) FMul 871 872 + 874: 779 CompositeConstruct 867 870 873 + Store 781(dmat3x4v) 874 + 875: 773 Load 775(dmat4x2v) + 876: 773 Load 775(dmat4x2v) + 877: 43(f64vec2) CompositeExtract 875 0 + 878: 43(f64vec2) CompositeExtract 876 0 + 879: 43(f64vec2) FMul 877 878 + 880: 43(f64vec2) CompositeExtract 875 1 + 881: 43(f64vec2) CompositeExtract 876 1 + 882: 43(f64vec2) FMul 880 881 + 883: 43(f64vec2) CompositeExtract 875 2 + 884: 43(f64vec2) CompositeExtract 876 2 + 885: 43(f64vec2) FMul 883 884 + 886: 43(f64vec2) CompositeExtract 875 3 + 887: 43(f64vec2) CompositeExtract 876 3 + 888: 43(f64vec2) FMul 886 887 + 889: 773 CompositeConstruct 879 882 885 888 + Store 775(dmat4x2v) 889 + 890: 785 Load 787(dmat4x3v) + 891: 785 Load 787(dmat4x3v) + 892: 48(f64vec3) CompositeExtract 890 0 + 893: 48(f64vec3) CompositeExtract 891 0 + 894: 48(f64vec3) FMul 892 893 + 895: 48(f64vec3) CompositeExtract 890 1 + 896: 48(f64vec3) CompositeExtract 891 1 + 897: 48(f64vec3) FMul 895 896 + 898: 48(f64vec3) CompositeExtract 890 2 + 899: 48(f64vec3) CompositeExtract 891 2 + 900: 48(f64vec3) FMul 898 899 + 901: 48(f64vec3) CompositeExtract 890 3 + 902: 48(f64vec3) CompositeExtract 891 3 + 903: 48(f64vec3) FMul 901 902 + 904: 785 CompositeConstruct 894 897 900 903 + Store 787(dmat4x3v) 904 + 905: 737 Load 739(dmat2v) + 906: 737 Transpose 905 + 907: 737 Load 739(dmat2v) + 908: 737 MatrixTimesMatrix 907 906 + Store 739(dmat2v) 908 + 909: 743 Load 745(dmat3v) + 910: 743 Transpose 909 + 911: 743 Load 745(dmat3v) + 912: 743 MatrixTimesMatrix 911 910 + Store 745(dmat3v) 912 + 913: 749 Load 751(dmat4v) + 914: 749 Transpose 913 + 915: 749 Load 751(dmat4v) + 916: 749 MatrixTimesMatrix 915 914 + Store 751(dmat4v) 916 + 917: 761 Load 763(dmat3x2v) + 918: 755 Transpose 917 + Store 757(dmat2x3v) 918 + 919: 755 Load 757(dmat2x3v) + 920: 761 Transpose 919 + Store 763(dmat3x2v) 920 + 921: 773 Load 775(dmat4x2v) + 922: 767 Transpose 921 + Store 769(dmat2x4v) 922 + 923: 767 Load 769(dmat2x4v) + 924: 773 Transpose 923 + Store 775(dmat4x2v) 924 + 925: 785 Load 787(dmat4x3v) + 926: 779 Transpose 925 + Store 781(dmat3x4v) 926 + 927: 779 Load 781(dmat3x4v) + 928: 785 Transpose 927 + Store 787(dmat4x3v) 928 + 929: 737 Load 739(dmat2v) + 930:39(float64_t) ExtInst 1(GLSL.std.450) 33(Determinant) 929 + 931:39(float64_t) Load 41(doublev) + 932:39(float64_t) FAdd 931 930 + Store 41(doublev) 932 + 933: 743 Load 745(dmat3v) + 934:39(float64_t) ExtInst 1(GLSL.std.450) 33(Determinant) 933 + 935:39(float64_t) Load 41(doublev) + 936:39(float64_t) FAdd 935 934 + Store 41(doublev) 936 + 937: 749 Load 751(dmat4v) + 938:39(float64_t) ExtInst 1(GLSL.std.450) 33(Determinant) 937 + 939:39(float64_t) Load 41(doublev) + 940:39(float64_t) FAdd 939 938 + Store 41(doublev) 940 + 941: 737 Load 739(dmat2v) + 942: 737 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 941 + 943: 737 Load 739(dmat2v) + 944: 737 MatrixTimesMatrix 943 942 + Store 739(dmat2v) 944 + 945: 743 Load 745(dmat3v) + 946: 743 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 945 + 947: 743 Load 745(dmat3v) + 948: 743 MatrixTimesMatrix 947 946 + Store 745(dmat3v) 948 + 949: 749 Load 751(dmat4v) + 950: 749 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 949 + 951: 749 Load 751(dmat4v) + 952: 749 MatrixTimesMatrix 951 950 + Store 751(dmat4v) 952 + 953:39(float64_t) Load 41(doublev) + 955: 40(ptr) AccessChain 45(dvec2v) 954 + 956:39(float64_t) Load 955 + 957:39(float64_t) FAdd 953 956 + 959: 40(ptr) AccessChain 50(dvec3v) 958 + 960:39(float64_t) Load 959 + 961:39(float64_t) FAdd 957 960 + 963: 40(ptr) AccessChain 55(dvec4v) 962 + 964:39(float64_t) Load 963 + 965:39(float64_t) FAdd 961 964 + 967: 40(ptr) AccessChain 739(dmat2v) 966 954 + 968:39(float64_t) Load 967 + 969:39(float64_t) FAdd 965 968 + 971: 40(ptr) AccessChain 745(dmat3v) 970 958 + 972:39(float64_t) Load 971 + 973:39(float64_t) FAdd 969 972 + 974: 40(ptr) AccessChain 751(dmat4v) 25 962 + 975:39(float64_t) Load 974 + 976:39(float64_t) FAdd 973 975 + 977: 40(ptr) AccessChain 757(dmat2x3v) 966 954 + 978:39(float64_t) Load 977 + 979:39(float64_t) FAdd 976 978 + 980: 40(ptr) AccessChain 763(dmat3x2v) 966 954 + 981:39(float64_t) Load 980 + 982:39(float64_t) FAdd 979 981 + 983: 40(ptr) AccessChain 781(dmat3x4v) 970 958 + 984:39(float64_t) Load 983 + 985:39(float64_t) FAdd 982 984 + 986: 40(ptr) AccessChain 787(dmat4x3v) 970 958 + 987:39(float64_t) Load 986 + 988:39(float64_t) FAdd 985 987 + 989: 40(ptr) AccessChain 769(dmat2x4v) 966 954 + 990:39(float64_t) Load 989 + 991:39(float64_t) FAdd 988 990 + 992: 40(ptr) AccessChain 775(dmat4x2v) 966 954 + 993:39(float64_t) Load 992 + 994:39(float64_t) FAdd 991 993 + 995: 428(bool) Load 430(boolv) + 997: 10(float) Select 995 996 21 + 998:39(float64_t) FConvert 997 + 999:39(float64_t) FAdd 994 998 + 1000: 429(ptr) AccessChain 439(bvec2v) 33 + 1001: 428(bool) Load 1000 + 1002: 10(float) Select 1001 996 21 + 1003:39(float64_t) FConvert 1002 + 1004:39(float64_t) FAdd 999 1003 + 1005: 429(ptr) AccessChain 448(bvec3v) 33 + 1006: 428(bool) Load 1005 + 1007: 10(float) Select 1006 996 21 + 1008:39(float64_t) FConvert 1007 + 1009:39(float64_t) FAdd 1004 1008 + 1010: 429(ptr) AccessChain 457(bvec4v) 33 + 1011: 428(bool) Load 1010 + 1012: 10(float) Select 1011 996 21 + 1013:39(float64_t) FConvert 1012 + 1014:39(float64_t) FAdd 1009 1013 + 1015: 10(float) FConvert 1014 + 1016: 11(fvec4) Load 13(outp) + 1017: 11(fvec4) VectorTimesScalar 1016 1015 + Store 13(outp) 1017 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.400.tesc.out b/deps/glslang/Test/baseResults/spv.400.tesc.out new file mode 100644 index 00000000..ce7c3afa --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.400.tesc.out @@ -0,0 +1,170 @@ +spv.400.tesc +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 92 + + Capability Tessellation + Capability TessellationPointSize + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "main" 24 41 44 47 53 67 72 78 82 83 86 87 90 91 + ExecutionMode 4 OutputVertices 4 + Source GLSL 400 + SourceExtension "GL_ARB_separate_shader_objects" + Name 4 "main" + Name 12 "a" + Name 17 "p" + Name 20 "gl_PerVertex" + MemberName 20(gl_PerVertex) 0 "gl_Position" + MemberName 20(gl_PerVertex) 1 "gl_PointSize" + MemberName 20(gl_PerVertex) 2 "gl_ClipDistance" + Name 24 "gl_in" + Name 31 "ps" + Name 35 "cd" + Name 39 "pvi" + Name 41 "gl_PatchVerticesIn" + Name 43 "pid" + Name 44 "gl_PrimitiveID" + Name 46 "iid" + Name 47 "gl_InvocationID" + Name 50 "gl_PerVertex" + MemberName 50(gl_PerVertex) 0 "gl_Position" + MemberName 50(gl_PerVertex) 1 "gl_PointSize" + MemberName 50(gl_PerVertex) 2 "gl_ClipDistance" + Name 53 "gl_out" + Name 67 "gl_TessLevelOuter" + Name 72 "gl_TessLevelInner" + Name 77 "outa" + Name 78 "patchOut" + Name 82 "inb" + Name 83 "ind" + Name 86 "ivla" + Name 87 "ivlb" + Name 90 "ovla" + Name 91 "ovlb" + MemberDecorate 20(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 20(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 20(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 20(gl_PerVertex) Block + Decorate 41(gl_PatchVerticesIn) BuiltIn PatchVertices + Decorate 44(gl_PrimitiveID) BuiltIn PrimitiveId + Decorate 47(gl_InvocationID) BuiltIn InvocationId + MemberDecorate 50(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 50(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 50(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 50(gl_PerVertex) Block + Decorate 67(gl_TessLevelOuter) Patch + Decorate 67(gl_TessLevelOuter) BuiltIn TessLevelOuter + Decorate 72(gl_TessLevelInner) Patch + Decorate 72(gl_TessLevelInner) BuiltIn TessLevelInner + Decorate 78(patchOut) Patch + Decorate 86(ivla) Location 3 + Decorate 87(ivlb) Location 4 + Decorate 90(ovla) Location 3 + Decorate 91(ovlb) Location 4 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: 6(int) Constant 2 + 8: 6(int) Constant 4 + 9: 6(int) Constant 0 + 10: TypeInt 32 1 + 11: TypePointer Function 10(int) + 13: 10(int) Constant 5392 + 14: TypeFloat 32 + 15: TypeVector 14(float) 4 + 16: TypePointer Function 15(fvec4) + 18: 6(int) Constant 3 + 19: TypeArray 14(float) 18 +20(gl_PerVertex): TypeStruct 15(fvec4) 14(float) 19 + 21: 6(int) Constant 32 + 22: TypeArray 20(gl_PerVertex) 21 + 23: TypePointer Input 22 + 24(gl_in): 23(ptr) Variable Input + 25: 10(int) Constant 1 + 26: 10(int) Constant 0 + 27: TypePointer Input 15(fvec4) + 30: TypePointer Function 14(float) + 32: TypePointer Input 14(float) + 36: 10(int) Constant 2 + 40: TypePointer Input 10(int) +41(gl_PatchVerticesIn): 40(ptr) Variable Input +44(gl_PrimitiveID): 40(ptr) Variable Input +47(gl_InvocationID): 40(ptr) Variable Input + 49: TypeArray 14(float) 7 +50(gl_PerVertex): TypeStruct 15(fvec4) 14(float) 49 + 51: TypeArray 50(gl_PerVertex) 8 + 52: TypePointer Output 51 + 53(gl_out): 52(ptr) Variable Output + 56: TypePointer Output 15(fvec4) + 60: TypePointer Output 14(float) + 65: TypeArray 14(float) 8 + 66: TypePointer Output 65 +67(gl_TessLevelOuter): 66(ptr) Variable Output + 68: 10(int) Constant 3 + 69: 14(float) Constant 1078774989 + 71: TypePointer Output 49 +72(gl_TessLevelInner): 71(ptr) Variable Output + 73: 14(float) Constant 1067869798 + 75: TypeArray 10(int) 8 + 76: TypePointer Private 75 + 77(outa): 76(ptr) Variable Private + 78(patchOut): 56(ptr) Variable Output + 79: TypeVector 14(float) 2 + 80: TypeArray 79(fvec2) 21 + 81: TypePointer Input 80 + 82(inb): 81(ptr) Variable Input + 83(ind): 81(ptr) Variable Input + 84: TypeArray 15(fvec4) 21 + 85: TypePointer Input 84 + 86(ivla): 85(ptr) Variable Input + 87(ivlb): 85(ptr) Variable Input + 88: TypeArray 15(fvec4) 8 + 89: TypePointer Output 88 + 90(ovla): 89(ptr) Variable Output + 91(ovlb): 89(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 12(a): 11(ptr) Variable Function + 17(p): 16(ptr) Variable Function + 31(ps): 30(ptr) Variable Function + 35(cd): 30(ptr) Variable Function + 39(pvi): 11(ptr) Variable Function + 43(pid): 11(ptr) Variable Function + 46(iid): 11(ptr) Variable Function + ControlBarrier 7 8 9 + Store 12(a) 13 + 28: 27(ptr) AccessChain 24(gl_in) 25 26 + 29: 15(fvec4) Load 28 + Store 17(p) 29 + 33: 32(ptr) AccessChain 24(gl_in) 25 25 + 34: 14(float) Load 33 + Store 31(ps) 34 + 37: 32(ptr) AccessChain 24(gl_in) 25 36 36 + 38: 14(float) Load 37 + Store 35(cd) 38 + 42: 10(int) Load 41(gl_PatchVerticesIn) + Store 39(pvi) 42 + 45: 10(int) Load 44(gl_PrimitiveID) + Store 43(pid) 45 + 48: 10(int) Load 47(gl_InvocationID) + Store 46(iid) 48 + 54: 10(int) Load 47(gl_InvocationID) + 55: 15(fvec4) Load 17(p) + 57: 56(ptr) AccessChain 53(gl_out) 54 26 + Store 57 55 + 58: 10(int) Load 47(gl_InvocationID) + 59: 14(float) Load 31(ps) + 61: 60(ptr) AccessChain 53(gl_out) 58 25 + Store 61 59 + 62: 10(int) Load 47(gl_InvocationID) + 63: 14(float) Load 35(cd) + 64: 60(ptr) AccessChain 53(gl_out) 62 36 25 + Store 64 63 + 70: 60(ptr) AccessChain 67(gl_TessLevelOuter) 68 + Store 70 69 + 74: 60(ptr) AccessChain 72(gl_TessLevelInner) 25 + Store 74 73 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.400.tese.out b/deps/glslang/Test/baseResults/spv.400.tese.out new file mode 100644 index 00000000..43b6a915 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.400.tese.out @@ -0,0 +1,183 @@ +spv.400.tese +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 96 + + Capability Tessellation + Capability TessellationPointSize + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationEvaluation 4 "main" 21 38 41 47 53 61 66 75 79 80 84 88 91 92 95 + ExecutionMode 4 Triangles + ExecutionMode 4 SpacingFractionalOdd + ExecutionMode 4 VertexOrderCcw + ExecutionMode 4 PointMode + Source GLSL 400 + SourceExtension "GL_ARB_separate_shader_objects" + Name 4 "main" + Name 8 "a" + Name 13 "p" + Name 17 "gl_PerVertex" + MemberName 17(gl_PerVertex) 0 "gl_Position" + MemberName 17(gl_PerVertex) 1 "gl_PointSize" + MemberName 17(gl_PerVertex) 2 "gl_ClipDistance" + Name 21 "gl_in" + Name 28 "ps" + Name 32 "cd" + Name 36 "pvi" + Name 38 "gl_PatchVerticesIn" + Name 40 "pid" + Name 41 "gl_PrimitiveID" + Name 45 "tc" + Name 47 "gl_TessCoord" + Name 49 "tlo" + Name 53 "gl_TessLevelOuter" + Name 57 "tli" + Name 61 "gl_TessLevelInner" + Name 64 "gl_PerVertex" + MemberName 64(gl_PerVertex) 0 "gl_Position" + MemberName 64(gl_PerVertex) 1 "gl_PointSize" + MemberName 64(gl_PerVertex) 2 "gl_ClipDistance" + Name 66 "" + Name 75 "patchIn" + Name 79 "inb" + Name 80 "ind" + Name 81 "testblb" + MemberName 81(testblb) 0 "f" + Name 84 "blb" + Name 85 "testbld" + MemberName 85(testbld) 0 "f" + Name 88 "bld" + Name 91 "ivla" + Name 92 "ivlb" + Name 95 "ovla" + MemberDecorate 17(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 17(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 17(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 17(gl_PerVertex) Block + Decorate 38(gl_PatchVerticesIn) BuiltIn PatchVertices + Decorate 41(gl_PrimitiveID) BuiltIn PrimitiveId + Decorate 47(gl_TessCoord) BuiltIn TessCoord + Decorate 53(gl_TessLevelOuter) Patch + Decorate 53(gl_TessLevelOuter) BuiltIn TessLevelOuter + Decorate 61(gl_TessLevelInner) Patch + Decorate 61(gl_TessLevelInner) BuiltIn TessLevelInner + MemberDecorate 64(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 64(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 64(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 64(gl_PerVertex) Block + Decorate 75(patchIn) Patch + Decorate 81(testblb) Block + Decorate 85(testbld) Block + Decorate 91(ivla) Location 23 + Decorate 92(ivlb) Location 24 + Decorate 95(ovla) Location 23 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 1512 + 10: TypeFloat 32 + 11: TypeVector 10(float) 4 + 12: TypePointer Function 11(fvec4) + 14: TypeInt 32 0 + 15: 14(int) Constant 3 + 16: TypeArray 10(float) 15 +17(gl_PerVertex): TypeStruct 11(fvec4) 10(float) 16 + 18: 14(int) Constant 32 + 19: TypeArray 17(gl_PerVertex) 18 + 20: TypePointer Input 19 + 21(gl_in): 20(ptr) Variable Input + 22: 6(int) Constant 1 + 23: 6(int) Constant 0 + 24: TypePointer Input 11(fvec4) + 27: TypePointer Function 10(float) + 29: TypePointer Input 10(float) + 33: 6(int) Constant 2 + 37: TypePointer Input 6(int) +38(gl_PatchVerticesIn): 37(ptr) Variable Input +41(gl_PrimitiveID): 37(ptr) Variable Input + 43: TypeVector 10(float) 3 + 44: TypePointer Function 43(fvec3) + 46: TypePointer Input 43(fvec3) +47(gl_TessCoord): 46(ptr) Variable Input + 50: 14(int) Constant 4 + 51: TypeArray 10(float) 50 + 52: TypePointer Input 51 +53(gl_TessLevelOuter): 52(ptr) Variable Input + 54: 6(int) Constant 3 + 58: 14(int) Constant 2 + 59: TypeArray 10(float) 58 + 60: TypePointer Input 59 +61(gl_TessLevelInner): 60(ptr) Variable Input +64(gl_PerVertex): TypeStruct 11(fvec4) 10(float) 16 + 65: TypePointer Output 64(gl_PerVertex) + 66: 65(ptr) Variable Output + 68: TypePointer Output 11(fvec4) + 71: TypePointer Output 10(float) + 75(patchIn): 24(ptr) Variable Input + 76: TypeVector 10(float) 2 + 77: TypeArray 76(fvec2) 18 + 78: TypePointer Input 77 + 79(inb): 78(ptr) Variable Input + 80(ind): 78(ptr) Variable Input + 81(testblb): TypeStruct 6(int) + 82: TypeArray 81(testblb) 18 + 83: TypePointer Input 82 + 84(blb): 83(ptr) Variable Input + 85(testbld): TypeStruct 6(int) + 86: TypeArray 85(testbld) 18 + 87: TypePointer Input 86 + 88(bld): 87(ptr) Variable Input + 89: TypeArray 11(fvec4) 18 + 90: TypePointer Input 89 + 91(ivla): 90(ptr) Variable Input + 92(ivlb): 90(ptr) Variable Input + 93: TypeArray 11(fvec4) 58 + 94: TypePointer Output 93 + 95(ovla): 94(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 8(a): 7(ptr) Variable Function + 13(p): 12(ptr) Variable Function + 28(ps): 27(ptr) Variable Function + 32(cd): 27(ptr) Variable Function + 36(pvi): 7(ptr) Variable Function + 40(pid): 7(ptr) Variable Function + 45(tc): 44(ptr) Variable Function + 49(tlo): 27(ptr) Variable Function + 57(tli): 27(ptr) Variable Function + Store 8(a) 9 + 25: 24(ptr) AccessChain 21(gl_in) 22 23 + 26: 11(fvec4) Load 25 + Store 13(p) 26 + 30: 29(ptr) AccessChain 21(gl_in) 22 22 + 31: 10(float) Load 30 + Store 28(ps) 31 + 34: 29(ptr) AccessChain 21(gl_in) 22 33 33 + 35: 10(float) Load 34 + Store 32(cd) 35 + 39: 6(int) Load 38(gl_PatchVerticesIn) + Store 36(pvi) 39 + 42: 6(int) Load 41(gl_PrimitiveID) + Store 40(pid) 42 + 48: 43(fvec3) Load 47(gl_TessCoord) + Store 45(tc) 48 + 55: 29(ptr) AccessChain 53(gl_TessLevelOuter) 54 + 56: 10(float) Load 55 + Store 49(tlo) 56 + 62: 29(ptr) AccessChain 61(gl_TessLevelInner) 22 + 63: 10(float) Load 62 + Store 57(tli) 63 + 67: 11(fvec4) Load 13(p) + 69: 68(ptr) AccessChain 66 23 + Store 69 67 + 70: 10(float) Load 28(ps) + 72: 71(ptr) AccessChain 66 22 + Store 72 70 + 73: 10(float) Load 32(cd) + 74: 71(ptr) AccessChain 66 33 33 + Store 74 73 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.420.geom.out b/deps/glslang/Test/baseResults/spv.420.geom.out new file mode 100644 index 00000000..45f235f4 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.420.geom.out @@ -0,0 +1,130 @@ +spv.420.geom +error: SPIRV-Tools Validation Errors +error: Capability GeometryStreams is not allowed by Vulkan 1.0 specification (or requires extension) + OpCapability GeometryStreams + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 72 + + Capability Geometry + Capability GeometryPointSize + Capability ImageGatherExtended + Capability GeometryStreams + Capability MultiViewport + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 14 23 28 33 46 + ExecutionMode 4 Triangles + ExecutionMode 4 Invocations 4 + ExecutionMode 4 OutputLineStrip + ExecutionMode 4 OutputVertices 127 + Source GLSL 420 + Name 4 "main" + Name 8 "p" + Name 9 "gl_PerVertex" + MemberName 9(gl_PerVertex) 0 "gl_PointSize" + Name 14 "gl_in" + Name 21 "gl_PerVertex" + MemberName 21(gl_PerVertex) 0 "gl_PointSize" + Name 23 "" + Name 28 "gl_ViewportIndex" + Name 31 "id" + Name 33 "gl_InvocationID" + Name 37 "v" + Name 41 "s2D" + Name 46 "coord" + Name 64 "i" + Name 67 "indexable" + MemberDecorate 9(gl_PerVertex) 0 BuiltIn PointSize + Decorate 9(gl_PerVertex) Block + MemberDecorate 21(gl_PerVertex) 0 BuiltIn PointSize + Decorate 21(gl_PerVertex) Block + Decorate 21(gl_PerVertex) Stream 0 + Decorate 23 Stream 0 + Decorate 28(gl_ViewportIndex) Stream 0 + Decorate 28(gl_ViewportIndex) BuiltIn ViewportIndex + Decorate 33(gl_InvocationID) BuiltIn InvocationId + Decorate 41(s2D) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 9(gl_PerVertex): TypeStruct 6(float) + 10: TypeInt 32 0 + 11: 10(int) Constant 3 + 12: TypeArray 9(gl_PerVertex) 11 + 13: TypePointer Input 12 + 14(gl_in): 13(ptr) Variable Input + 15: TypeInt 32 1 + 16: 15(int) Constant 1 + 17: 15(int) Constant 0 + 18: TypePointer Input 6(float) +21(gl_PerVertex): TypeStruct 6(float) + 22: TypePointer Output 21(gl_PerVertex) + 23: 22(ptr) Variable Output + 25: TypePointer Output 6(float) + 27: TypePointer Output 15(int) +28(gl_ViewportIndex): 27(ptr) Variable Output + 29: 15(int) Constant 7 + 30: TypePointer Function 15(int) + 32: TypePointer Input 15(int) +33(gl_InvocationID): 32(ptr) Variable Input + 35: TypeVector 6(float) 4 + 36: TypePointer Function 35(fvec4) + 38: TypeImage 6(float) 2D sampled format:Unknown + 39: TypeSampledImage 38 + 40: TypePointer UniformConstant 39 + 41(s2D): 40(ptr) Variable UniformConstant + 43: TypeVector 6(float) 2 + 44: TypeArray 43(fvec2) 11 + 45: TypePointer Input 44 + 46(coord): 45(ptr) Variable Input + 47: TypePointer Input 43(fvec2) + 50: TypeVector 15(int) 2 + 51: 10(int) Constant 5 + 52: TypeArray 50(ivec2) 51 + 53: 50(ivec2) ConstantComposite 17 16 + 54: 15(int) Constant 4294967294 + 55: 50(ivec2) ConstantComposite 16 54 + 56: 15(int) Constant 3 + 57: 50(ivec2) ConstantComposite 17 56 + 58: 15(int) Constant 4294967293 + 59: 50(ivec2) ConstantComposite 58 17 + 60: 15(int) Constant 2 + 61: 50(ivec2) ConstantComposite 60 16 + 62: 52 ConstantComposite 53 55 57 59 61 + 63: TypePointer Private 15(int) + 64(i): 63(ptr) Variable Private + 66: TypePointer Function 52 + 68: TypePointer Function 50(ivec2) + 4(main): 2 Function None 3 + 5: Label + 8(p): 7(ptr) Variable Function + 31(id): 30(ptr) Variable Function + 37(v): 36(ptr) Variable Function + 67(indexable): 66(ptr) Variable Function + 19: 18(ptr) AccessChain 14(gl_in) 16 17 + 20: 6(float) Load 19 + Store 8(p) 20 + 24: 6(float) Load 8(p) + 26: 25(ptr) AccessChain 23 17 + Store 26 24 + Store 28(gl_ViewportIndex) 29 + EmitStreamVertex 16 + EndStreamPrimitive 17 + EmitVertex + EndPrimitive + 34: 15(int) Load 33(gl_InvocationID) + Store 31(id) 34 + 42: 39 Load 41(s2D) + 48: 47(ptr) AccessChain 46(coord) 17 + 49: 43(fvec2) Load 48 + 65: 15(int) Load 64(i) + Store 67(indexable) 62 + 69: 68(ptr) AccessChain 67(indexable) 65 + 70: 50(ivec2) Load 69 + 71: 35(fvec4) ImageGather 42 49 17 Offset 70 + Store 37(v) 71 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.430.frag.out b/deps/glslang/Test/baseResults/spv.430.frag.out new file mode 100644 index 00000000..330489f2 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.430.frag.out @@ -0,0 +1,48 @@ +spv.430.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 24 + + Capability Shader + Capability Geometry + Capability MultiViewport + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 14 19 + ExecutionMode 4 OriginUpperLeft + Source GLSL 430 + Name 4 "main" + Name 9 "color" + Name 14 "gl_Layer" + Name 19 "gl_ViewportIndex" + Decorate 14(gl_Layer) Flat + Decorate 14(gl_Layer) BuiltIn Layer + Decorate 19(gl_ViewportIndex) Flat + Decorate 19(gl_ViewportIndex) BuiltIn ViewportIndex + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(color): 8(ptr) Variable Output + 10: 6(float) Constant 1065353216 + 11: 7(fvec4) ConstantComposite 10 10 10 10 + 12: TypeInt 32 1 + 13: TypePointer Input 12(int) + 14(gl_Layer): 13(ptr) Variable Input +19(gl_ViewportIndex): 13(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + Store 9(color) 11 + 15: 12(int) Load 14(gl_Layer) + 16: 6(float) ConvertSToF 15 + 17: 7(fvec4) Load 9(color) + 18: 7(fvec4) VectorTimesScalar 17 16 + Store 9(color) 18 + 20: 12(int) Load 19(gl_ViewportIndex) + 21: 6(float) ConvertSToF 20 + 22: 7(fvec4) Load 9(color) + 23: 7(fvec4) VectorTimesScalar 22 21 + Store 9(color) 23 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.430.vert.out b/deps/glslang/Test/baseResults/spv.430.vert.out new file mode 100644 index 00000000..1cd9e619 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.430.vert.out @@ -0,0 +1,136 @@ +spv.430.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 66 + + Capability Shader + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 12 23 34 38 41 42 62 65 + Source GLSL 450 + Name 4 "main" + Name 10 "gl_PerVertex" + MemberName 10(gl_PerVertex) 0 "gl_ClipDistance" + Name 12 "" + Name 23 "bad" + Name 34 "badorder3" + Name 38 "f" + Name 41 "badorder" + Name 42 "badorder2" + Name 43 "boundblock" + MemberName 43(boundblock) 0 "aoeu" + Name 45 "boundInst" + Name 46 "anonblock" + MemberName 46(anonblock) 0 "aoeu" + Name 48 "" + Name 52 "sampb1" + Name 55 "sampb2" + Name 56 "sampb4" + Name 59 "S" + MemberName 59(S) 0 "a" + MemberName 59(S) 1 "b" + MemberName 59(S) 2 "c" + Name 60 "SS" + MemberName 60(SS) 0 "b" + MemberName 60(SS) 1 "s" + MemberName 60(SS) 2 "c" + Name 62 "var" + Name 63 "MS" + MemberName 63(MS) 0 "f" + Name 65 "outMS" + MemberDecorate 10(gl_PerVertex) 0 BuiltIn ClipDistance + Decorate 10(gl_PerVertex) Block + Decorate 34(badorder3) Flat + Decorate 42(badorder2) Invariant + MemberDecorate 43(boundblock) 0 Offset 0 + Decorate 43(boundblock) Block + Decorate 45(boundInst) DescriptorSet 0 + Decorate 45(boundInst) Binding 3 + MemberDecorate 46(anonblock) 0 Offset 0 + Decorate 46(anonblock) Block + Decorate 48 DescriptorSet 0 + Decorate 48 Binding 7 + Decorate 52(sampb1) DescriptorSet 0 + Decorate 52(sampb1) Binding 4 + Decorate 55(sampb2) DescriptorSet 0 + Decorate 55(sampb2) Binding 5 + Decorate 56(sampb4) DescriptorSet 0 + Decorate 56(sampb4) Binding 31 + MemberDecorate 59(S) 0 RelaxedPrecision + Decorate 62(var) Flat + Decorate 62(var) Location 0 + MemberDecorate 63(MS) 0 Location 17 + Decorate 63(MS) Block + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeInt 32 0 + 8: 7(int) Constant 3 + 9: TypeArray 6(float) 8 +10(gl_PerVertex): TypeStruct 9 + 11: TypePointer Output 10(gl_PerVertex) + 12: 11(ptr) Variable Output + 13: TypeInt 32 1 + 14: 13(int) Constant 0 + 15: 13(int) Constant 2 + 16: 6(float) Constant 1080872141 + 17: TypePointer Output 6(float) + 19: TypeVector 6(float) 4 + 20: 7(int) Constant 10 + 21: TypeArray 19(fvec4) 20 + 22: TypePointer Input 21 + 23(bad): 22(ptr) Variable Input + 24: 7(int) Constant 0 + 25: TypePointer Input 6(float) + 28: 6(float) Constant 1082549862 + 29: TypeBool + 33: TypePointer Output 19(fvec4) + 34(badorder3): 33(ptr) Variable Output + 35: TypePointer Input 19(fvec4) + 38(f): 25(ptr) Variable Input + 41(badorder): 35(ptr) Variable Input + 42(badorder2): 33(ptr) Variable Output + 43(boundblock): TypeStruct 13(int) + 44: TypePointer Uniform 43(boundblock) + 45(boundInst): 44(ptr) Variable Uniform + 46(anonblock): TypeStruct 13(int) + 47: TypePointer Uniform 46(anonblock) + 48: 47(ptr) Variable Uniform + 49: TypeImage 6(float) 2D sampled format:Unknown + 50: TypeSampledImage 49 + 51: TypePointer UniformConstant 50 + 52(sampb1): 51(ptr) Variable UniformConstant + 53: TypeArray 50 20 + 54: TypePointer UniformConstant 53 + 55(sampb2): 54(ptr) Variable UniformConstant + 56(sampb4): 51(ptr) Variable UniformConstant + 57: TypeVector 7(int) 2 + 58: TypeVector 6(float) 3 + 59(S): TypeStruct 6(float) 57(ivec2) 58(fvec3) + 60(SS): TypeStruct 19(fvec4) 59(S) 19(fvec4) + 61: TypePointer Output 60(SS) + 62(var): 61(ptr) Variable Output + 63(MS): TypeStruct 6(float) + 64: TypePointer Output 63(MS) + 65(outMS): 64(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 18: 17(ptr) AccessChain 12 14 15 + Store 18 16 + 26: 25(ptr) AccessChain 23(bad) 14 24 + 27: 6(float) Load 26 + 30: 29(bool) FOrdEqual 27 28 + SelectionMerge 32 None + BranchConditional 30 31 32 + 31: Label + 36: 35(ptr) AccessChain 23(bad) 14 + 37: 19(fvec4) Load 36 + Store 34(badorder3) 37 + Branch 32 + 32: Label + 39: 6(float) Load 38(f) + 40: 17(ptr) AccessChain 12 14 14 + Store 40 39 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.450.geom.out b/deps/glslang/Test/baseResults/spv.450.geom.out new file mode 100644 index 00000000..7713e54e --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.450.geom.out @@ -0,0 +1,77 @@ +spv.450.geom +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 31 + + Capability Geometry + Capability GeometryPointSize + Capability MultiViewport + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 13 20 27 29 + ExecutionMode 4 Triangles + ExecutionMode 4 Invocations 4 + ExecutionMode 4 OutputLineStrip + ExecutionMode 4 OutputVertices 127 + Source GLSL 450 + Name 4 "main" + Name 11 "gl_PerVertex" + MemberName 11(gl_PerVertex) 0 "gl_Position" + MemberName 11(gl_PerVertex) 1 "gl_PointSize" + MemberName 11(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 11(gl_PerVertex) 3 "gl_CullDistance" + Name 13 "" + Name 16 "gl_PerVertex" + MemberName 16(gl_PerVertex) 0 "gl_Position" + MemberName 16(gl_PerVertex) 1 "gl_PointSize" + MemberName 16(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 16(gl_PerVertex) 3 "gl_CullDistance" + Name 20 "gl_in" + Name 27 "gl_Layer" + Name 29 "gl_ViewportIndex" + MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 11(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 11(gl_PerVertex) Block + MemberDecorate 16(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 16(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 16(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 16(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 16(gl_PerVertex) Block + Decorate 27(gl_Layer) BuiltIn Layer + Decorate 29(gl_ViewportIndex) BuiltIn ViewportIndex + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 0 + 9: 8(int) Constant 1 + 10: TypeArray 6(float) 9 +11(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 10 10 + 12: TypePointer Output 11(gl_PerVertex) + 13: 12(ptr) Variable Output + 14: TypeInt 32 1 + 15: 14(int) Constant 1 +16(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 10 10 + 17: 8(int) Constant 3 + 18: TypeArray 16(gl_PerVertex) 17 + 19: TypePointer Input 18 + 20(gl_in): 19(ptr) Variable Input + 21: TypePointer Input 6(float) + 24: TypePointer Output 6(float) + 26: TypePointer Output 14(int) + 27(gl_Layer): 26(ptr) Variable Output + 28: 14(int) Constant 2 +29(gl_ViewportIndex): 26(ptr) Variable Output + 30: 14(int) Constant 3 + 4(main): 2 Function None 3 + 5: Label + 22: 21(ptr) AccessChain 20(gl_in) 15 15 + 23: 6(float) Load 22 + 25: 24(ptr) AccessChain 13 15 + Store 25 23 + Store 27(gl_Layer) 28 + Store 29(gl_ViewportIndex) 30 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.450.noRedecl.tesc.out b/deps/glslang/Test/baseResults/spv.450.noRedecl.tesc.out new file mode 100644 index 00000000..b23061da --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.450.noRedecl.tesc.out @@ -0,0 +1,47 @@ +spv.450.noRedecl.tesc +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 21 + + Capability Tessellation + Capability TessellationPointSize + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "main" 15 20 + ExecutionMode 4 OutputVertices 4 + Source GLSL 450 + Name 4 "main" + Name 11 "gl_PerVertex" + MemberName 11(gl_PerVertex) 0 "gl_Position" + MemberName 11(gl_PerVertex) 1 "gl_PointSize" + MemberName 11(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 11(gl_PerVertex) 3 "gl_CullDistance" + Name 15 "gl_in" + Name 20 "patchOut" + MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 11(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 11(gl_PerVertex) Block + Decorate 20(patchOut) Patch + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 0 + 9: 8(int) Constant 1 + 10: TypeArray 6(float) 9 +11(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 10 10 + 12: 8(int) Constant 32 + 13: TypeArray 11(gl_PerVertex) 12 + 14: TypePointer Input 13 + 15(gl_in): 14(ptr) Variable Input + 16: TypeInt 32 1 + 17: 16(int) Constant 0 + 18: 16(int) Constant 1 + 19: TypePointer Output 7(fvec4) + 20(patchOut): 19(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.450.tesc.out b/deps/glslang/Test/baseResults/spv.450.tesc.out new file mode 100644 index 00000000..35653fde --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.450.tesc.out @@ -0,0 +1,120 @@ +spv.450.tesc +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 45 + + Capability Tessellation + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "main" 15 18 25 32 38 41 44 + ExecutionMode 4 OutputVertices 4 + Source GLSL 450 + Name 4 "main" + Name 11 "gl_PerVertex" + MemberName 11(gl_PerVertex) 0 "gl_Position" + MemberName 11(gl_PerVertex) 1 "gl_PointSize" + MemberName 11(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 11(gl_PerVertex) 3 "gl_CullDistance" + Name 15 "gl_out" + Name 18 "gl_InvocationID" + Name 21 "gl_PerVertex" + MemberName 21(gl_PerVertex) 0 "gl_Position" + MemberName 21(gl_PerVertex) 1 "gl_PointSize" + MemberName 21(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 21(gl_PerVertex) 3 "gl_CullDistance" + Name 25 "gl_in" + Name 32 "patchOut" + Name 33 "S" + MemberName 33(S) 0 "sMem1" + MemberName 33(S) 1 "sMem2" + Name 34 "TheBlock" + MemberName 34(TheBlock) 0 "bMem1" + MemberName 34(TheBlock) 1 "bMem2" + MemberName 34(TheBlock) 2 "s" + Name 38 "tcBlock" + Name 39 "SingleBlock" + MemberName 39(SingleBlock) 0 "bMem1" + MemberName 39(SingleBlock) 1 "bMem2" + MemberName 39(SingleBlock) 2 "s" + Name 41 "singleBlock" + Name 42 "bn" + MemberName 42(bn) 0 "v1" + MemberName 42(bn) 1 "v2" + MemberName 42(bn) 2 "v3" + Name 44 "" + MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 11(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 11(gl_PerVertex) Block + Decorate 18(gl_InvocationID) BuiltIn InvocationId + MemberDecorate 21(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 21(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 21(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 21(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 21(gl_PerVertex) Block + Decorate 32(patchOut) Patch + Decorate 32(patchOut) Location 1 + MemberDecorate 34(TheBlock) 0 Patch + MemberDecorate 34(TheBlock) 1 Patch + MemberDecorate 34(TheBlock) 2 Patch + Decorate 34(TheBlock) Block + Decorate 38(tcBlock) Location 12 + MemberDecorate 39(SingleBlock) 0 Patch + MemberDecorate 39(SingleBlock) 1 Patch + MemberDecorate 39(SingleBlock) 2 Patch + Decorate 39(SingleBlock) Block + Decorate 41(singleBlock) Location 2 + MemberDecorate 42(bn) 0 Patch + MemberDecorate 42(bn) 0 Location 20 + MemberDecorate 42(bn) 1 Patch + MemberDecorate 42(bn) 1 Location 24 + MemberDecorate 42(bn) 2 Patch + MemberDecorate 42(bn) 2 Location 25 + Decorate 42(bn) Block + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 0 + 9: 8(int) Constant 1 + 10: TypeArray 6(float) 9 +11(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 10 10 + 12: 8(int) Constant 4 + 13: TypeArray 11(gl_PerVertex) 12 + 14: TypePointer Output 13 + 15(gl_out): 14(ptr) Variable Output + 16: TypeInt 32 1 + 17: TypePointer Input 16(int) +18(gl_InvocationID): 17(ptr) Variable Input + 20: 16(int) Constant 0 +21(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 10 10 + 22: 8(int) Constant 32 + 23: TypeArray 21(gl_PerVertex) 22 + 24: TypePointer Input 23 + 25(gl_in): 24(ptr) Variable Input + 27: TypePointer Input 7(fvec4) + 30: TypePointer Output 7(fvec4) + 32(patchOut): 30(ptr) Variable Output + 33(S): TypeStruct 6(float) 6(float) + 34(TheBlock): TypeStruct 6(float) 6(float) 33(S) + 35: 8(int) Constant 2 + 36: TypeArray 34(TheBlock) 35 + 37: TypePointer Output 36 + 38(tcBlock): 37(ptr) Variable Output + 39(SingleBlock): TypeStruct 6(float) 6(float) 33(S) + 40: TypePointer Output 39(SingleBlock) + 41(singleBlock): 40(ptr) Variable Output + 42(bn): TypeStruct 7(fvec4) 7(fvec4) 7(fvec4) + 43: TypePointer Output 42(bn) + 44: 43(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 19: 16(int) Load 18(gl_InvocationID) + 26: 16(int) Load 18(gl_InvocationID) + 28: 27(ptr) AccessChain 25(gl_in) 26 20 + 29: 7(fvec4) Load 28 + 31: 30(ptr) AccessChain 15(gl_out) 19 20 + Store 31 29 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.460.comp.out b/deps/glslang/Test/baseResults/spv.460.comp.out new file mode 100644 index 00000000..6ebf49fa --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.460.comp.out @@ -0,0 +1,33 @@ +spv.460.comp +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 15 + + Capability Shader + Capability SubgroupVoteKHR + Extension "SPV_KHR_subgroup_vote" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" + ExecutionMode 4 LocalSize 1 1 1 + Source GLSL 460 + Name 4 "main" + Name 8 "b1" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeBool + 7: TypePointer Function 6(bool) + 4(main): 2 Function None 3 + 5: Label + 8(b1): 7(ptr) Variable Function + 9: 6(bool) Load 8(b1) + 10: 6(bool) SubgroupAnyKHR 9 + Store 8(b1) 10 + 11: 6(bool) Load 8(b1) + 12: 6(bool) SubgroupAllKHR 11 + Store 8(b1) 12 + 13: 6(bool) Load 8(b1) + 14: 6(bool) SubgroupAllEqualKHR 13 + Store 8(b1) 14 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.460.frag.out b/deps/glslang/Test/baseResults/spv.460.frag.out new file mode 100644 index 00000000..04393fbe --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.460.frag.out @@ -0,0 +1,51 @@ +spv.460.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 32 + + Capability Shader + Capability AtomicStorage + Capability AtomicStorageOps + Extension "SPV_KHR_shader_atomic_counter_ops" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginLowerLeft + Source GLSL 460 + Name 4 "main" + Name 8 "aui" + Name 10 "ui" + Decorate 8(aui) Offset 0 + Decorate 8(aui) Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer AtomicCounter 6(int) + 8(aui): 7(ptr) Variable AtomicCounter + 9: TypePointer Private 6(int) + 10(ui): 9(ptr) Variable Private + 12: 6(int) Constant 1 + 13: 6(int) Constant 0 + 4(main): 2 Function None 3 + 5: Label + 11: 6(int) Load 10(ui) + 14: 6(int) AtomicIAdd 8(aui) 12 13 11 + 15: 6(int) Load 10(ui) + 16: 6(int) AtomicISub 8(aui) 12 13 15 + 17: 6(int) Load 10(ui) + 18: 6(int) AtomicUMin 8(aui) 12 13 17 + 19: 6(int) Load 10(ui) + 20: 6(int) AtomicUMax 8(aui) 12 13 19 + 21: 6(int) Load 10(ui) + 22: 6(int) AtomicAnd 8(aui) 12 13 21 + 23: 6(int) Load 10(ui) + 24: 6(int) AtomicOr 8(aui) 12 13 23 + 25: 6(int) Load 10(ui) + 26: 6(int) AtomicXor 8(aui) 12 13 25 + 27: 6(int) Load 10(ui) + 28: 6(int) AtomicExchange 8(aui) 12 13 27 + 29: 6(int) Load 10(ui) + 30: 6(int) Load 10(ui) + 31: 6(int) AtomicCompareExchange 8(aui) 12 13 13 30 29 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.460.vert.out b/deps/glslang/Test/baseResults/spv.460.vert.out new file mode 100644 index 00000000..c2ef3024 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.460.vert.out @@ -0,0 +1,45 @@ +spv.460.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 20 + + Capability Shader + Capability DrawParameters + Extension "SPV_KHR_shader_draw_parameters" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 10 12 15 18 19 + Source GLSL 460 + Name 4 "main" + Name 8 "a" + Name 10 "gl_BaseVertex" + Name 12 "gl_BaseInstance" + Name 15 "gl_DrawID" + Name 18 "gl_VertexID" + Name 19 "gl_InstanceID" + Decorate 10(gl_BaseVertex) BuiltIn BaseVertex + Decorate 12(gl_BaseInstance) BuiltIn BaseInstance + Decorate 15(gl_DrawID) BuiltIn DrawIndex + Decorate 18(gl_VertexID) BuiltIn VertexId + Decorate 19(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: TypePointer Input 6(int) +10(gl_BaseVertex): 9(ptr) Variable Input +12(gl_BaseInstance): 9(ptr) Variable Input + 15(gl_DrawID): 9(ptr) Variable Input + 18(gl_VertexID): 9(ptr) Variable Input +19(gl_InstanceID): 9(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 8(a): 7(ptr) Variable Function + 11: 6(int) Load 10(gl_BaseVertex) + 13: 6(int) Load 12(gl_BaseInstance) + 14: 6(int) IAdd 11 13 + 16: 6(int) Load 15(gl_DrawID) + 17: 6(int) IAdd 14 16 + Store 8(a) 17 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.8bitstorage-int.frag.out b/deps/glslang/Test/baseResults/spv.8bitstorage-int.frag.out new file mode 100644 index 00000000..96cb2ae5 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.8bitstorage-int.frag.out @@ -0,0 +1,333 @@ +spv.8bitstorage-int.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 171 + + Capability Shader + Capability CapabilityUniformAndStorageBuffer8BitAccess + Extension "SPV_KHR_8bit_storage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_shader_8bit_storage" + Name 4 "main" + Name 12 "S" + MemberName 12(S) 0 "x" + MemberName 12(S) 1 "y" + MemberName 12(S) 2 "z" + Name 17 "B2" + MemberName 17(B2) 0 "o" + MemberName 17(B2) 1 "p" + MemberName 17(B2) 2 "q" + MemberName 17(B2) 3 "r" + MemberName 17(B2) 4 "u" + MemberName 17(B2) 5 "v" + MemberName 17(B2) 6 "x" + MemberName 17(B2) 7 "w" + Name 19 "b2" + Name 23 "S" + MemberName 23(S) 0 "x" + MemberName 23(S) 1 "y" + MemberName 23(S) 2 "z" + Name 25 "B1" + MemberName 25(B1) 0 "a" + MemberName 25(B1) 1 "b" + MemberName 25(B1) 2 "c" + MemberName 25(B1) 3 "d" + MemberName 25(B1) 4 "g" + MemberName 25(B1) 5 "h" + MemberName 25(B1) 6 "j" + Name 27 "b1" + Name 45 "S" + MemberName 45(S) 0 "x" + MemberName 45(S) 1 "y" + MemberName 45(S) 2 "z" + Name 49 "B5" + MemberName 49(B5) 0 "o" + MemberName 49(B5) 1 "p" + MemberName 49(B5) 2 "q" + MemberName 49(B5) 3 "r" + MemberName 49(B5) 4 "u" + MemberName 49(B5) 5 "v" + MemberName 49(B5) 6 "x" + MemberName 49(B5) 7 "w" + Name 51 "b5" + Name 69 "x0" + Name 75 "x1" + Name 88 "S2" + MemberName 88(S2) 0 "x" + MemberName 88(S2) 1 "y" + MemberName 88(S2) 2 "z" + Name 89 "S3" + MemberName 89(S3) 0 "x" + Name 90 "B4" + MemberName 90(B4) 0 "x" + MemberName 90(B4) 1 "y" + Name 92 "b4" + Name 93 "S2" + MemberName 93(S2) 0 "x" + MemberName 93(S2) 1 "y" + MemberName 93(S2) 2 "z" + Name 94 "B3" + MemberName 94(B3) 0 "x" + Name 96 "b3" + Name 113 "v3" + Name 135 "u3" + Decorate 11 ArrayStride 1 + MemberDecorate 12(S) 0 Offset 0 + MemberDecorate 12(S) 1 Offset 2 + MemberDecorate 12(S) 2 Offset 4 + Decorate 13 ArrayStride 8 + Decorate 15 ArrayStride 2 + Decorate 16 ArrayStride 1 + MemberDecorate 17(B2) 0 Offset 0 + MemberDecorate 17(B2) 1 Offset 2 + MemberDecorate 17(B2) 2 Offset 4 + MemberDecorate 17(B2) 3 Offset 7 + MemberDecorate 17(B2) 4 Offset 12 + MemberDecorate 17(B2) 5 Offset 20 + MemberDecorate 17(B2) 6 Offset 36 + MemberDecorate 17(B2) 7 Offset 236 + Decorate 17(B2) BufferBlock + Decorate 19(b2) DescriptorSet 0 + Decorate 22 ArrayStride 16 + MemberDecorate 23(S) 0 Offset 0 + MemberDecorate 23(S) 1 Offset 2 + MemberDecorate 23(S) 2 Offset 4 + Decorate 24 ArrayStride 16 + MemberDecorate 25(B1) 0 Offset 0 + MemberDecorate 25(B1) 1 Offset 2 + MemberDecorate 25(B1) 2 Offset 4 + MemberDecorate 25(B1) 3 Offset 16 + MemberDecorate 25(B1) 4 Offset 48 + MemberDecorate 25(B1) 5 Offset 64 + MemberDecorate 25(B1) 6 Offset 96 + Decorate 25(B1) Block + Decorate 27(b1) DescriptorSet 0 + Decorate 44 ArrayStride 16 + MemberDecorate 45(S) 0 Offset 0 + MemberDecorate 45(S) 1 Offset 2 + MemberDecorate 45(S) 2 Offset 4 + Decorate 46 ArrayStride 16 + Decorate 47 ArrayStride 16 + Decorate 48 ArrayStride 16 + MemberDecorate 49(B5) 0 Offset 0 + MemberDecorate 49(B5) 1 Offset 2 + MemberDecorate 49(B5) 2 Offset 4 + MemberDecorate 49(B5) 3 Offset 16 + MemberDecorate 49(B5) 4 Offset 48 + MemberDecorate 49(B5) 5 Offset 64 + MemberDecorate 49(B5) 6 Offset 96 + MemberDecorate 49(B5) 7 Offset 1696 + Decorate 49(B5) Block + Decorate 51(b5) DescriptorSet 0 + MemberDecorate 88(S2) 0 ColMajor + MemberDecorate 88(S2) 0 Offset 0 + MemberDecorate 88(S2) 0 MatrixStride 16 + MemberDecorate 88(S2) 1 Offset 64 + MemberDecorate 88(S2) 2 Offset 68 + MemberDecorate 89(S3) 0 Offset 0 + MemberDecorate 90(B4) 0 Offset 0 + MemberDecorate 90(B4) 1 Offset 80 + Decorate 90(B4) BufferBlock + Decorate 92(b4) DescriptorSet 0 + MemberDecorate 93(S2) 0 RowMajor + MemberDecorate 93(S2) 0 Offset 0 + MemberDecorate 93(S2) 0 MatrixStride 16 + MemberDecorate 93(S2) 1 Offset 64 + MemberDecorate 93(S2) 2 Offset 68 + MemberDecorate 94(B3) 0 Offset 0 + Decorate 94(B3) BufferBlock + Decorate 96(b3) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 8 1 + 7: TypeVector 6(int8_t) 2 + 8: TypeVector 6(int8_t) 3 + 9: TypeInt 32 0 + 10: 9(int) Constant 2 + 11: TypeArray 6(int8_t) 10 + 12(S): TypeStruct 6(int8_t) 7(i8vec2) 8(i8vec3) + 13: TypeArray 12(S) 10 + 14: 9(int) Constant 100 + 15: TypeArray 7(i8vec2) 14 + 16: TypeRuntimeArray 6(int8_t) + 17(B2): TypeStruct 6(int8_t) 7(i8vec2) 8(i8vec3) 11 12(S) 13 15 16 + 18: TypePointer Uniform 17(B2) + 19(b2): 18(ptr) Variable Uniform + 20: TypeInt 32 1 + 21: 20(int) Constant 0 + 22: TypeArray 6(int8_t) 10 + 23(S): TypeStruct 6(int8_t) 7(i8vec2) 8(i8vec3) + 24: TypeArray 23(S) 10 + 25(B1): TypeStruct 6(int8_t) 7(i8vec2) 8(i8vec3) 22 23(S) 24 20(int) + 26: TypePointer Uniform 25(B1) + 27(b1): 26(ptr) Variable Uniform + 28: TypePointer Uniform 6(int8_t) + 32: 20(int) Constant 1 + 33: 20(int) Constant 2 + 34: TypePointer Uniform 8(i8vec3) + 37: TypeVector 20(int) 3 + 39: TypeVector 20(int) 2 + 42: TypePointer Uniform 7(i8vec2) + 44: TypeArray 6(int8_t) 10 + 45(S): TypeStruct 6(int8_t) 7(i8vec2) 8(i8vec3) + 46: TypeArray 45(S) 10 + 47: TypeArray 7(i8vec2) 14 + 48: TypeArray 6(int8_t) 14 + 49(B5): TypeStruct 6(int8_t) 7(i8vec2) 8(i8vec3) 44 45(S) 46 47 48 + 50: TypePointer Uniform 49(B5) + 51(b5): 50(ptr) Variable Uniform + 58: 20(int) Constant 3 + 68: TypePointer Function 20(int) + 73: TypeVector 20(int) 4 + 74: TypePointer Function 73(ivec4) + 85: TypeFloat 32 + 86: TypeVector 85(float) 4 + 87: TypeMatrix 86(fvec4) 4 + 88(S2): TypeStruct 87 6(int8_t) 20(int) + 89(S3): TypeStruct 88(S2) + 90(B4): TypeStruct 88(S2) 89(S3) + 91: TypePointer Uniform 90(B4) + 92(b4): 91(ptr) Variable Uniform + 93(S2): TypeStruct 87 6(int8_t) 20(int) + 94(B3): TypeStruct 93(S2) + 95: TypePointer Uniform 94(B3) + 96(b3): 95(ptr) Variable Uniform + 97: TypePointer Uniform 87 + 104: 9(int) Constant 0 + 108: 20(int) Constant 5 + 112: TypePointer Function 37(ivec3) + 114: 20(int) Constant 7 + 115: 20(int) Constant 6 + 116: TypePointer Uniform 20(int) + 166: 39(ivec2) ConstantComposite 32 33 + 4(main): 2 Function None 3 + 5: Label + 69(x0): 68(ptr) Variable Function + 75(x1): 74(ptr) Variable Function + 113(v3): 112(ptr) Variable Function + 135(u3): 112(ptr) Variable Function + 29: 28(ptr) AccessChain 27(b1) 21 + 30: 6(int8_t) Load 29 + 31: 28(ptr) AccessChain 19(b2) 21 + Store 31 30 + 35: 34(ptr) AccessChain 19(b2) 33 + 36: 8(i8vec3) Load 35 + 38: 37(ivec3) SConvert 36 + 40: 39(ivec2) VectorShuffle 38 38 0 1 + 41: 7(i8vec2) SConvert 40 + 43: 42(ptr) AccessChain 19(b2) 32 + Store 43 41 + 52: 34(ptr) AccessChain 51(b5) 33 + 53: 8(i8vec3) Load 52 + 54: 37(ivec3) SConvert 53 + 55: 39(ivec2) VectorShuffle 54 54 0 1 + 56: 7(i8vec2) SConvert 55 + 57: 42(ptr) AccessChain 19(b2) 32 + Store 57 56 + 59: 28(ptr) AccessChain 19(b2) 58 21 + 60: 6(int8_t) Load 59 + 61: 28(ptr) AccessChain 19(b2) 58 21 + Store 61 60 + 62: 28(ptr) AccessChain 51(b5) 58 32 + 63: 6(int8_t) Load 62 + 64: 28(ptr) AccessChain 19(b2) 58 32 + Store 64 63 + 65: 42(ptr) AccessChain 19(b2) 32 + 66: 7(i8vec2) Load 65 + 67: 42(ptr) AccessChain 19(b2) 32 + Store 67 66 + 70: 28(ptr) AccessChain 27(b1) 21 + 71: 6(int8_t) Load 70 + 72: 20(int) SConvert 71 + Store 69(x0) 72 + 76: 28(ptr) AccessChain 27(b1) 21 + 77: 6(int8_t) Load 76 + 78: 20(int) SConvert 77 + 79: 42(ptr) AccessChain 19(b2) 32 + 80: 7(i8vec2) Load 79 + 81: 39(ivec2) SConvert 80 + 82: 20(int) CompositeExtract 81 0 + 83: 20(int) CompositeExtract 81 1 + 84: 73(ivec4) CompositeConstruct 78 82 83 32 + Store 75(x1) 84 + 98: 97(ptr) AccessChain 96(b3) 21 21 + 99: 87 Load 98 + 100: 97(ptr) AccessChain 92(b4) 21 21 + Store 100 99 + 101: 42(ptr) AccessChain 19(b2) 32 + 102: 7(i8vec2) Load 101 + 103: 39(ivec2) SConvert 102 + 105: 20(int) CompositeExtract 103 0 + 106: 6(int8_t) SConvert 105 + 107: 28(ptr) AccessChain 19(b2) 21 + Store 107 106 + 109: 42(ptr) AccessChain 19(b2) 108 32 32 + 110: 7(i8vec2) Load 109 + 111: 42(ptr) AccessChain 19(b2) 32 + Store 111 110 + 117: 116(ptr) AccessChain 27(b1) 115 + 118: 20(int) Load 117 + 119: 28(ptr) AccessChain 19(b2) 114 118 + 120: 6(int8_t) Load 119 + 121: 20(int) SConvert 120 + 122: 116(ptr) AccessChain 27(b1) 115 + 123: 20(int) Load 122 + 124: 20(int) IAdd 123 32 + 125: 28(ptr) AccessChain 19(b2) 114 124 + 126: 6(int8_t) Load 125 + 127: 20(int) SConvert 126 + 128: 116(ptr) AccessChain 27(b1) 115 + 129: 20(int) Load 128 + 130: 20(int) IAdd 129 33 + 131: 28(ptr) AccessChain 19(b2) 114 130 + 132: 6(int8_t) Load 131 + 133: 20(int) SConvert 132 + 134: 37(ivec3) CompositeConstruct 121 127 133 + Store 113(v3) 134 + 136: 116(ptr) AccessChain 27(b1) 115 + 137: 20(int) Load 136 + 138: 28(ptr) AccessChain 51(b5) 114 137 + 139: 6(int8_t) Load 138 + 140: 20(int) SConvert 139 + 141: 116(ptr) AccessChain 27(b1) 115 + 142: 20(int) Load 141 + 143: 20(int) IAdd 142 32 + 144: 28(ptr) AccessChain 51(b5) 114 143 + 145: 6(int8_t) Load 144 + 146: 20(int) SConvert 145 + 147: 116(ptr) AccessChain 27(b1) 115 + 148: 20(int) Load 147 + 149: 20(int) IAdd 148 33 + 150: 28(ptr) AccessChain 51(b5) 114 149 + 151: 6(int8_t) Load 150 + 152: 20(int) SConvert 151 + 153: 37(ivec3) CompositeConstruct 140 146 152 + Store 135(u3) 153 + 154: 42(ptr) AccessChain 19(b2) 115 21 + 155: 7(i8vec2) Load 154 + 156: 42(ptr) AccessChain 19(b2) 115 21 + Store 156 155 + 157: 42(ptr) AccessChain 51(b5) 115 32 + 158: 7(i8vec2) Load 157 + 159: 42(ptr) AccessChain 19(b2) 115 32 + Store 159 158 + 160: 28(ptr) AccessChain 27(b1) 21 + 161: 6(int8_t) Load 160 + 162: 28(ptr) AccessChain 19(b2) 32 104 + Store 162 161 + 163: 28(ptr) AccessChain 19(b2) 32 104 + 164: 6(int8_t) Load 163 + 165: 28(ptr) AccessChain 19(b2) 21 + Store 165 164 + 167: 7(i8vec2) SConvert 166 + 168: 42(ptr) AccessChain 19(b2) 32 + Store 168 167 + 169: 6(int8_t) SConvert 58 + 170: 28(ptr) AccessChain 19(b2) 21 + Store 170 169 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.8bitstorage-ssbo.vert.out b/deps/glslang/Test/baseResults/spv.8bitstorage-ssbo.vert.out new file mode 100644 index 00000000..1e233783 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.8bitstorage-ssbo.vert.out @@ -0,0 +1,56 @@ +spv.8bitstorage-ssbo.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 28 + + Capability Shader + Capability CapabilityUniformAndStorageBuffer8BitAccess + Extension "SPV_KHR_8bit_storage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 9 18 + Source GLSL 450 + SourceExtension "GL_EXT_shader_8bit_storage" + Name 4 "main" + Name 9 "color" + Name 12 "Vertices" + MemberName 12(Vertices) 0 "vertices" + Name 14 "" + Name 18 "gl_VertexIndex" + Decorate 9(color) Location 0 + Decorate 11 ArrayStride 1 + MemberDecorate 12(Vertices) 0 NonWritable + MemberDecorate 12(Vertices) 0 Offset 0 + Decorate 12(Vertices) BufferBlock + Decorate 14 DescriptorSet 0 + Decorate 14 Binding 0 + Decorate 18(gl_VertexIndex) BuiltIn VertexIndex + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(color): 8(ptr) Variable Output + 10: TypeInt 8 0 + 11: TypeRuntimeArray 10(int8_t) + 12(Vertices): TypeStruct 11 + 13: TypePointer Uniform 12(Vertices) + 14: 13(ptr) Variable Uniform + 15: TypeInt 32 1 + 16: 15(int) Constant 0 + 17: TypePointer Input 15(int) +18(gl_VertexIndex): 17(ptr) Variable Input + 20: TypePointer Uniform 10(int8_t) + 23: TypeInt 32 0 + 4(main): 2 Function None 3 + 5: Label + 19: 15(int) Load 18(gl_VertexIndex) + 21: 20(ptr) AccessChain 14 16 19 + 22: 10(int8_t) Load 21 + 24: 23(int) UConvert 22 + 25: 15(int) Bitcast 24 + 26: 6(float) ConvertSToF 25 + 27: 7(fvec4) CompositeConstruct 26 26 26 26 + Store 9(color) 27 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.8bitstorage-ubo.vert.out b/deps/glslang/Test/baseResults/spv.8bitstorage-ubo.vert.out new file mode 100644 index 00000000..a6a05cfb --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.8bitstorage-ubo.vert.out @@ -0,0 +1,56 @@ +spv.8bitstorage-ubo.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 29 + + Capability Shader + Capability CapabilityUniformAndStorageBuffer8BitAccess + Extension "SPV_KHR_8bit_storage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 9 20 + Source GLSL 450 + SourceExtension "GL_EXT_shader_8bit_storage" + Name 4 "main" + Name 9 "color" + Name 14 "Vertices" + MemberName 14(Vertices) 0 "vertices" + Name 16 "" + Name 20 "gl_VertexIndex" + Decorate 9(color) Location 0 + Decorate 13 ArrayStride 16 + MemberDecorate 14(Vertices) 0 Offset 0 + Decorate 14(Vertices) Block + Decorate 16 DescriptorSet 0 + Decorate 16 Binding 0 + Decorate 20(gl_VertexIndex) BuiltIn VertexIndex + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(color): 8(ptr) Variable Output + 10: TypeInt 8 0 + 11: TypeInt 32 0 + 12: 11(int) Constant 512 + 13: TypeArray 10(int8_t) 12 + 14(Vertices): TypeStruct 13 + 15: TypePointer Uniform 14(Vertices) + 16: 15(ptr) Variable Uniform + 17: TypeInt 32 1 + 18: 17(int) Constant 0 + 19: TypePointer Input 17(int) +20(gl_VertexIndex): 19(ptr) Variable Input + 22: TypePointer Uniform 10(int8_t) + 4(main): 2 Function None 3 + 5: Label + 21: 17(int) Load 20(gl_VertexIndex) + 23: 22(ptr) AccessChain 16 18 21 + 24: 10(int8_t) Load 23 + 25: 11(int) UConvert 24 + 26: 17(int) Bitcast 25 + 27: 6(float) ConvertSToF 26 + 28: 7(fvec4) CompositeConstruct 27 27 27 27 + Store 9(color) 28 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.8bitstorage-uint.frag.out b/deps/glslang/Test/baseResults/spv.8bitstorage-uint.frag.out new file mode 100644 index 00000000..415bada4 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.8bitstorage-uint.frag.out @@ -0,0 +1,335 @@ +spv.8bitstorage-uint.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 173 + + Capability Shader + Capability CapabilityUniformAndStorageBuffer8BitAccess + Extension "SPV_KHR_8bit_storage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_shader_8bit_storage" + Name 4 "main" + Name 12 "S" + MemberName 12(S) 0 "x" + MemberName 12(S) 1 "y" + MemberName 12(S) 2 "z" + Name 17 "B2" + MemberName 17(B2) 0 "o" + MemberName 17(B2) 1 "p" + MemberName 17(B2) 2 "q" + MemberName 17(B2) 3 "r" + MemberName 17(B2) 4 "u" + MemberName 17(B2) 5 "v" + MemberName 17(B2) 6 "x" + MemberName 17(B2) 7 "w" + Name 19 "b2" + Name 23 "S" + MemberName 23(S) 0 "x" + MemberName 23(S) 1 "y" + MemberName 23(S) 2 "z" + Name 25 "B1" + MemberName 25(B1) 0 "a" + MemberName 25(B1) 1 "b" + MemberName 25(B1) 2 "c" + MemberName 25(B1) 3 "d" + MemberName 25(B1) 4 "g" + MemberName 25(B1) 5 "h" + MemberName 25(B1) 6 "j" + Name 27 "b1" + Name 45 "S" + MemberName 45(S) 0 "x" + MemberName 45(S) 1 "y" + MemberName 45(S) 2 "z" + Name 49 "B5" + MemberName 49(B5) 0 "o" + MemberName 49(B5) 1 "p" + MemberName 49(B5) 2 "q" + MemberName 49(B5) 3 "r" + MemberName 49(B5) 4 "u" + MemberName 49(B5) 5 "v" + MemberName 49(B5) 6 "x" + MemberName 49(B5) 7 "w" + Name 51 "b5" + Name 69 "x0" + Name 75 "x1" + Name 89 "S2" + MemberName 89(S2) 0 "x" + MemberName 89(S2) 1 "y" + MemberName 89(S2) 2 "z" + Name 90 "S3" + MemberName 90(S3) 0 "x" + Name 91 "B4" + MemberName 91(B4) 0 "x" + MemberName 91(B4) 1 "y" + Name 93 "b4" + Name 94 "S2" + MemberName 94(S2) 0 "x" + MemberName 94(S2) 1 "y" + MemberName 94(S2) 2 "z" + Name 95 "B3" + MemberName 95(B3) 0 "x" + Name 97 "b3" + Name 114 "v3" + Name 136 "u3" + Decorate 11 ArrayStride 1 + MemberDecorate 12(S) 0 Offset 0 + MemberDecorate 12(S) 1 Offset 2 + MemberDecorate 12(S) 2 Offset 4 + Decorate 13 ArrayStride 8 + Decorate 15 ArrayStride 2 + Decorate 16 ArrayStride 1 + MemberDecorate 17(B2) 0 Offset 0 + MemberDecorate 17(B2) 1 Offset 2 + MemberDecorate 17(B2) 2 Offset 4 + MemberDecorate 17(B2) 3 Offset 7 + MemberDecorate 17(B2) 4 Offset 12 + MemberDecorate 17(B2) 5 Offset 20 + MemberDecorate 17(B2) 6 Offset 36 + MemberDecorate 17(B2) 7 Offset 236 + Decorate 17(B2) BufferBlock + Decorate 19(b2) DescriptorSet 0 + Decorate 22 ArrayStride 16 + MemberDecorate 23(S) 0 Offset 0 + MemberDecorate 23(S) 1 Offset 2 + MemberDecorate 23(S) 2 Offset 4 + Decorate 24 ArrayStride 16 + MemberDecorate 25(B1) 0 Offset 0 + MemberDecorate 25(B1) 1 Offset 2 + MemberDecorate 25(B1) 2 Offset 4 + MemberDecorate 25(B1) 3 Offset 16 + MemberDecorate 25(B1) 4 Offset 48 + MemberDecorate 25(B1) 5 Offset 64 + MemberDecorate 25(B1) 6 Offset 96 + Decorate 25(B1) Block + Decorate 27(b1) DescriptorSet 0 + Decorate 44 ArrayStride 16 + MemberDecorate 45(S) 0 Offset 0 + MemberDecorate 45(S) 1 Offset 2 + MemberDecorate 45(S) 2 Offset 4 + Decorate 46 ArrayStride 16 + Decorate 47 ArrayStride 16 + Decorate 48 ArrayStride 16 + MemberDecorate 49(B5) 0 Offset 0 + MemberDecorate 49(B5) 1 Offset 2 + MemberDecorate 49(B5) 2 Offset 4 + MemberDecorate 49(B5) 3 Offset 16 + MemberDecorate 49(B5) 4 Offset 48 + MemberDecorate 49(B5) 5 Offset 64 + MemberDecorate 49(B5) 6 Offset 96 + MemberDecorate 49(B5) 7 Offset 1696 + Decorate 49(B5) Block + Decorate 51(b5) DescriptorSet 0 + MemberDecorate 89(S2) 0 ColMajor + MemberDecorate 89(S2) 0 Offset 0 + MemberDecorate 89(S2) 0 MatrixStride 16 + MemberDecorate 89(S2) 1 Offset 64 + MemberDecorate 89(S2) 2 Offset 68 + MemberDecorate 90(S3) 0 Offset 0 + MemberDecorate 91(B4) 0 Offset 0 + MemberDecorate 91(B4) 1 Offset 80 + Decorate 91(B4) BufferBlock + Decorate 93(b4) DescriptorSet 0 + MemberDecorate 94(S2) 0 RowMajor + MemberDecorate 94(S2) 0 Offset 0 + MemberDecorate 94(S2) 0 MatrixStride 16 + MemberDecorate 94(S2) 1 Offset 64 + MemberDecorate 94(S2) 2 Offset 68 + MemberDecorate 95(B3) 0 Offset 0 + Decorate 95(B3) BufferBlock + Decorate 97(b3) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 8 0 + 7: TypeVector 6(int8_t) 2 + 8: TypeVector 6(int8_t) 3 + 9: TypeInt 32 0 + 10: 9(int) Constant 2 + 11: TypeArray 6(int8_t) 10 + 12(S): TypeStruct 6(int8_t) 7(i8vec2) 8(i8vec3) + 13: TypeArray 12(S) 10 + 14: 9(int) Constant 100 + 15: TypeArray 7(i8vec2) 14 + 16: TypeRuntimeArray 6(int8_t) + 17(B2): TypeStruct 6(int8_t) 7(i8vec2) 8(i8vec3) 11 12(S) 13 15 16 + 18: TypePointer Uniform 17(B2) + 19(b2): 18(ptr) Variable Uniform + 20: TypeInt 32 1 + 21: 20(int) Constant 0 + 22: TypeArray 6(int8_t) 10 + 23(S): TypeStruct 6(int8_t) 7(i8vec2) 8(i8vec3) + 24: TypeArray 23(S) 10 + 25(B1): TypeStruct 6(int8_t) 7(i8vec2) 8(i8vec3) 22 23(S) 24 9(int) + 26: TypePointer Uniform 25(B1) + 27(b1): 26(ptr) Variable Uniform + 28: TypePointer Uniform 6(int8_t) + 32: 20(int) Constant 1 + 33: 20(int) Constant 2 + 34: TypePointer Uniform 8(i8vec3) + 37: TypeVector 9(int) 3 + 39: TypeVector 9(int) 2 + 42: TypePointer Uniform 7(i8vec2) + 44: TypeArray 6(int8_t) 10 + 45(S): TypeStruct 6(int8_t) 7(i8vec2) 8(i8vec3) + 46: TypeArray 45(S) 10 + 47: TypeArray 7(i8vec2) 14 + 48: TypeArray 6(int8_t) 14 + 49(B5): TypeStruct 6(int8_t) 7(i8vec2) 8(i8vec3) 44 45(S) 46 47 48 + 50: TypePointer Uniform 49(B5) + 51(b5): 50(ptr) Variable Uniform + 58: 20(int) Constant 3 + 68: TypePointer Function 9(int) + 73: TypeVector 9(int) 4 + 74: TypePointer Function 73(ivec4) + 82: 9(int) Constant 1 + 86: TypeFloat 32 + 87: TypeVector 86(float) 4 + 88: TypeMatrix 87(fvec4) 4 + 89(S2): TypeStruct 88 6(int8_t) 9(int) + 90(S3): TypeStruct 89(S2) + 91(B4): TypeStruct 89(S2) 90(S3) + 92: TypePointer Uniform 91(B4) + 93(b4): 92(ptr) Variable Uniform + 94(S2): TypeStruct 88 6(int8_t) 9(int) + 95(B3): TypeStruct 94(S2) + 96: TypePointer Uniform 95(B3) + 97(b3): 96(ptr) Variable Uniform + 98: TypePointer Uniform 88 + 105: 9(int) Constant 0 + 109: 20(int) Constant 5 + 113: TypePointer Function 37(ivec3) + 115: 20(int) Constant 7 + 116: 20(int) Constant 6 + 117: TypePointer Uniform 9(int) + 167: 39(ivec2) ConstantComposite 82 10 + 170: 9(int) Constant 3 + 4(main): 2 Function None 3 + 5: Label + 69(x0): 68(ptr) Variable Function + 75(x1): 74(ptr) Variable Function + 114(v3): 113(ptr) Variable Function + 136(u3): 113(ptr) Variable Function + 29: 28(ptr) AccessChain 27(b1) 21 + 30: 6(int8_t) Load 29 + 31: 28(ptr) AccessChain 19(b2) 21 + Store 31 30 + 35: 34(ptr) AccessChain 19(b2) 33 + 36: 8(i8vec3) Load 35 + 38: 37(ivec3) UConvert 36 + 40: 39(ivec2) VectorShuffle 38 38 0 1 + 41: 7(i8vec2) UConvert 40 + 43: 42(ptr) AccessChain 19(b2) 32 + Store 43 41 + 52: 34(ptr) AccessChain 51(b5) 33 + 53: 8(i8vec3) Load 52 + 54: 37(ivec3) UConvert 53 + 55: 39(ivec2) VectorShuffle 54 54 0 1 + 56: 7(i8vec2) UConvert 55 + 57: 42(ptr) AccessChain 19(b2) 32 + Store 57 56 + 59: 28(ptr) AccessChain 19(b2) 58 21 + 60: 6(int8_t) Load 59 + 61: 28(ptr) AccessChain 19(b2) 58 21 + Store 61 60 + 62: 28(ptr) AccessChain 51(b5) 58 32 + 63: 6(int8_t) Load 62 + 64: 28(ptr) AccessChain 19(b2) 58 32 + Store 64 63 + 65: 42(ptr) AccessChain 19(b2) 32 + 66: 7(i8vec2) Load 65 + 67: 42(ptr) AccessChain 19(b2) 32 + Store 67 66 + 70: 28(ptr) AccessChain 27(b1) 21 + 71: 6(int8_t) Load 70 + 72: 9(int) UConvert 71 + Store 69(x0) 72 + 76: 28(ptr) AccessChain 27(b1) 21 + 77: 6(int8_t) Load 76 + 78: 9(int) UConvert 77 + 79: 42(ptr) AccessChain 19(b2) 32 + 80: 7(i8vec2) Load 79 + 81: 39(ivec2) UConvert 80 + 83: 9(int) CompositeExtract 81 0 + 84: 9(int) CompositeExtract 81 1 + 85: 73(ivec4) CompositeConstruct 78 83 84 82 + Store 75(x1) 85 + 99: 98(ptr) AccessChain 97(b3) 21 21 + 100: 88 Load 99 + 101: 98(ptr) AccessChain 93(b4) 21 21 + Store 101 100 + 102: 42(ptr) AccessChain 19(b2) 32 + 103: 7(i8vec2) Load 102 + 104: 39(ivec2) UConvert 103 + 106: 9(int) CompositeExtract 104 0 + 107: 6(int8_t) UConvert 106 + 108: 28(ptr) AccessChain 19(b2) 21 + Store 108 107 + 110: 42(ptr) AccessChain 19(b2) 109 32 32 + 111: 7(i8vec2) Load 110 + 112: 42(ptr) AccessChain 19(b2) 32 + Store 112 111 + 118: 117(ptr) AccessChain 27(b1) 116 + 119: 9(int) Load 118 + 120: 28(ptr) AccessChain 19(b2) 115 119 + 121: 6(int8_t) Load 120 + 122: 9(int) UConvert 121 + 123: 117(ptr) AccessChain 27(b1) 116 + 124: 9(int) Load 123 + 125: 9(int) IAdd 124 82 + 126: 28(ptr) AccessChain 19(b2) 115 125 + 127: 6(int8_t) Load 126 + 128: 9(int) UConvert 127 + 129: 117(ptr) AccessChain 27(b1) 116 + 130: 9(int) Load 129 + 131: 9(int) IAdd 130 10 + 132: 28(ptr) AccessChain 19(b2) 115 131 + 133: 6(int8_t) Load 132 + 134: 9(int) UConvert 133 + 135: 37(ivec3) CompositeConstruct 122 128 134 + Store 114(v3) 135 + 137: 117(ptr) AccessChain 27(b1) 116 + 138: 9(int) Load 137 + 139: 28(ptr) AccessChain 51(b5) 115 138 + 140: 6(int8_t) Load 139 + 141: 9(int) UConvert 140 + 142: 117(ptr) AccessChain 27(b1) 116 + 143: 9(int) Load 142 + 144: 9(int) IAdd 143 82 + 145: 28(ptr) AccessChain 51(b5) 115 144 + 146: 6(int8_t) Load 145 + 147: 9(int) UConvert 146 + 148: 117(ptr) AccessChain 27(b1) 116 + 149: 9(int) Load 148 + 150: 9(int) IAdd 149 10 + 151: 28(ptr) AccessChain 51(b5) 115 150 + 152: 6(int8_t) Load 151 + 153: 9(int) UConvert 152 + 154: 37(ivec3) CompositeConstruct 141 147 153 + Store 136(u3) 154 + 155: 42(ptr) AccessChain 19(b2) 116 21 + 156: 7(i8vec2) Load 155 + 157: 42(ptr) AccessChain 19(b2) 116 21 + Store 157 156 + 158: 42(ptr) AccessChain 51(b5) 116 32 + 159: 7(i8vec2) Load 158 + 160: 42(ptr) AccessChain 19(b2) 116 32 + Store 160 159 + 161: 28(ptr) AccessChain 27(b1) 21 + 162: 6(int8_t) Load 161 + 163: 28(ptr) AccessChain 19(b2) 32 105 + Store 163 162 + 164: 28(ptr) AccessChain 19(b2) 32 105 + 165: 6(int8_t) Load 164 + 166: 28(ptr) AccessChain 19(b2) 21 + Store 166 165 + 168: 7(i8vec2) UConvert 167 + 169: 42(ptr) AccessChain 19(b2) 32 + Store 169 168 + 171: 6(int8_t) UConvert 170 + 172: 28(ptr) AccessChain 19(b2) 21 + Store 172 171 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.8bitstorage_Error-int.frag.out b/deps/glslang/Test/baseResults/spv.8bitstorage_Error-int.frag.out new file mode 100644 index 00000000..0562111b --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.8bitstorage_Error-int.frag.out @@ -0,0 +1,71 @@ +spv.8bitstorage_Error-int.frag +ERROR: 0:54: 'structure: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:58: 'return: can't use with structs containing int8' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:61: 'int8_t: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:74: '[: does not operate on types containing (u)int8' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:75: '.: can't swizzle types containing (u)int8' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:76: 'built-in function: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:76: 'built-in function: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:76: 'built-in function: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:77: 'built-in function: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:77: 'built-in function: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:78: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform int8_t' and a right operand of type 'layout( column_major std140 offset=0) uniform int8_t' (or there is no acceptable conversion) +ERROR: 0:79: '-' : wrong operand type no operation '-' exists that takes an operand of type layout( column_major std140 offset=0) uniform int8_t (or there is no acceptable conversion) +ERROR: 0:80: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform int8_t' and a right operand of type ' const int' (or there is no acceptable conversion) +ERROR: 0:81: '.: can't swizzle types containing (u)int8' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:82: '=: can't use with structs containing int8' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:83: 'qualifier: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:84: 'qualifier: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:85: 'qualifier: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:86: '==' : wrong operand types: no operation '==' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform int8_t' and a right operand of type 'layout( column_major std140 offset=0) uniform int8_t' (or there is no acceptable conversion) +ERROR: 0:87: '=: can't use with arrays containing int8' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:88: 'constructor: 8-bit vectors only take vector types' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:89: 'constructor: 8-bit arrays not supported' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:89: 'constructor: 8-bit vectors only take vector types' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:92: 'constructor: can't construct structure containing 8-bit type' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:93: 'func2' : no matching overloaded function found +ERROR: 0:99: '' : syntax error, unexpected IDENTIFIER +ERROR: 26 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.8bitstorage_Error-uint.frag.out b/deps/glslang/Test/baseResults/spv.8bitstorage_Error-uint.frag.out new file mode 100644 index 00000000..93070f2a --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.8bitstorage_Error-uint.frag.out @@ -0,0 +1,71 @@ +spv.8bitstorage_Error-uint.frag +ERROR: 0:54: 'structure: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:58: 'return: can't use with structs containing uint8' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:61: 'uint8_t: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:74: '[: does not operate on types containing (u)int8' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:75: '.: can't swizzle types containing (u)int8' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:76: 'built-in function: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:76: 'built-in function: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:76: 'built-in function: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:77: 'built-in function: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:77: 'built-in function: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:78: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform uint8_t' and a right operand of type 'layout( column_major std140 offset=0) uniform uint8_t' (or there is no acceptable conversion) +ERROR: 0:79: '-' : wrong operand type no operation '-' exists that takes an operand of type layout( column_major std140 offset=0) uniform uint8_t (or there is no acceptable conversion) +ERROR: 0:80: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform uint8_t' and a right operand of type ' const int' (or there is no acceptable conversion) +ERROR: 0:81: '.: can't swizzle types containing (u)int8' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:82: '=: can't use with structs containing uint8' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:83: 'qualifier: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:84: 'qualifier: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:85: 'qualifier: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:86: '==' : wrong operand types: no operation '==' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform uint8_t' and a right operand of type 'layout( column_major std140 offset=0) uniform uint8_t' (or there is no acceptable conversion) +ERROR: 0:87: '=: can't use with arrays containing uint8' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:88: 'constructor: 8-bit vectors only take vector types' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:89: 'constructor: 8-bit arrays not supported' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:89: 'constructor: 8-bit vectors only take vector types' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:92: 'constructor: can't construct structure containing 8-bit type' : required extension not requested: Possible extensions include: +GL_KHX_shader_explicit_arithmetic_types +GL_KHX_shader_explicit_arithmetic_types_int8 +ERROR: 0:93: 'func2' : no matching overloaded function found +ERROR: 0:99: '' : syntax error, unexpected IDENTIFIER +ERROR: 26 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.AnyHitShader.rahit.out b/deps/glslang/Test/baseResults/spv.AnyHitShader.rahit.out new file mode 100644 index 00000000..92b31d08 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.AnyHitShader.rahit.out @@ -0,0 +1,163 @@ +spv.AnyHitShader.rahit +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 81 + + Capability RayTracingNV + Extension "SPV_NV_ray_tracing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint AnyHitNV 4 "main" 11 14 20 23 26 33 36 39 42 47 50 53 58 64 67 + Source GLSL 460 + SourceExtension "GL_NV_ray_tracing" + Name 4 "main" + Name 9 "v0" + Name 11 "gl_LaunchIDNV" + Name 13 "v1" + Name 14 "gl_LaunchSizeNV" + Name 18 "v2" + Name 20 "gl_PrimitiveID" + Name 22 "v3" + Name 23 "gl_InstanceID" + Name 25 "v4" + Name 26 "gl_InstanceCustomIndexNV" + Name 31 "v5" + Name 33 "gl_WorldRayOriginNV" + Name 35 "v6" + Name 36 "gl_WorldRayDirectionNV" + Name 38 "v7" + Name 39 "gl_ObjectRayOriginNV" + Name 41 "v8" + Name 42 "gl_ObjectRayDirectionNV" + Name 45 "v9" + Name 47 "gl_RayTminNV" + Name 49 "v10" + Name 50 "gl_RayTmaxNV" + Name 52 "v11" + Name 53 "gl_HitTNV" + Name 56 "v12" + Name 58 "gl_HitKindNV" + Name 62 "v13" + Name 64 "gl_ObjectToWorldNV" + Name 66 "v14" + Name 67 "gl_WorldToObjectNV" + Name 71 "incomingPayload" + Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV + Decorate 14(gl_LaunchSizeNV) BuiltIn LaunchSizeNV + Decorate 20(gl_PrimitiveID) BuiltIn PrimitiveId + Decorate 23(gl_InstanceID) BuiltIn InstanceId + Decorate 26(gl_InstanceCustomIndexNV) BuiltIn InstanceCustomIndexNV + Decorate 33(gl_WorldRayOriginNV) BuiltIn WorldRayOriginNV + Decorate 36(gl_WorldRayDirectionNV) BuiltIn WorldRayDirectionNV + Decorate 39(gl_ObjectRayOriginNV) BuiltIn ObjectRayOriginNV + Decorate 42(gl_ObjectRayDirectionNV) BuiltIn ObjectRayDirectionNV + Decorate 47(gl_RayTminNV) BuiltIn RayTminNV + Decorate 50(gl_RayTmaxNV) BuiltIn RayTmaxNV + Decorate 53(gl_HitTNV) BuiltIn HitTNV + Decorate 58(gl_HitKindNV) BuiltIn HitKindNV + Decorate 64(gl_ObjectToWorldNV) BuiltIn ObjectToWorldNV + Decorate 67(gl_WorldToObjectNV) BuiltIn WorldToObjectNV + Decorate 71(incomingPayload) Location 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 10: TypePointer Input 7(ivec3) +11(gl_LaunchIDNV): 10(ptr) Variable Input +14(gl_LaunchSizeNV): 10(ptr) Variable Input + 16: TypeInt 32 1 + 17: TypePointer Function 16(int) + 19: TypePointer Input 16(int) +20(gl_PrimitiveID): 19(ptr) Variable Input +23(gl_InstanceID): 19(ptr) Variable Input +26(gl_InstanceCustomIndexNV): 19(ptr) Variable Input + 28: TypeFloat 32 + 29: TypeVector 28(float) 3 + 30: TypePointer Function 29(fvec3) + 32: TypePointer Input 29(fvec3) +33(gl_WorldRayOriginNV): 32(ptr) Variable Input +36(gl_WorldRayDirectionNV): 32(ptr) Variable Input +39(gl_ObjectRayOriginNV): 32(ptr) Variable Input +42(gl_ObjectRayDirectionNV): 32(ptr) Variable Input + 44: TypePointer Function 28(float) + 46: TypePointer Input 28(float) +47(gl_RayTminNV): 46(ptr) Variable Input +50(gl_RayTmaxNV): 46(ptr) Variable Input + 53(gl_HitTNV): 46(ptr) Variable Input + 55: TypePointer Function 6(int) + 57: TypePointer Input 6(int) +58(gl_HitKindNV): 57(ptr) Variable Input + 60: TypeMatrix 29(fvec3) 4 + 61: TypePointer Function 60 + 63: TypePointer Input 60 +64(gl_ObjectToWorldNV): 63(ptr) Variable Input +67(gl_WorldToObjectNV): 63(ptr) Variable Input + 69: TypeVector 28(float) 4 + 70: TypePointer IncomingRayPayloadNV 69(fvec4) +71(incomingPayload): 70(ptr) Variable IncomingRayPayloadNV + 72: 28(float) Constant 1056964608 + 73: 69(fvec4) ConstantComposite 72 72 72 72 + 75: 16(int) Constant 1 + 76: TypeBool + 4(main): 2 Function None 3 + 5: Label + 9(v0): 8(ptr) Variable Function + 13(v1): 8(ptr) Variable Function + 18(v2): 17(ptr) Variable Function + 22(v3): 17(ptr) Variable Function + 25(v4): 17(ptr) Variable Function + 31(v5): 30(ptr) Variable Function + 35(v6): 30(ptr) Variable Function + 38(v7): 30(ptr) Variable Function + 41(v8): 30(ptr) Variable Function + 45(v9): 44(ptr) Variable Function + 49(v10): 44(ptr) Variable Function + 52(v11): 44(ptr) Variable Function + 56(v12): 55(ptr) Variable Function + 62(v13): 61(ptr) Variable Function + 66(v14): 61(ptr) Variable Function + 12: 7(ivec3) Load 11(gl_LaunchIDNV) + Store 9(v0) 12 + 15: 7(ivec3) Load 14(gl_LaunchSizeNV) + Store 13(v1) 15 + 21: 16(int) Load 20(gl_PrimitiveID) + Store 18(v2) 21 + 24: 16(int) Load 23(gl_InstanceID) + Store 22(v3) 24 + 27: 16(int) Load 26(gl_InstanceCustomIndexNV) + Store 25(v4) 27 + 34: 29(fvec3) Load 33(gl_WorldRayOriginNV) + Store 31(v5) 34 + 37: 29(fvec3) Load 36(gl_WorldRayDirectionNV) + Store 35(v6) 37 + 40: 29(fvec3) Load 39(gl_ObjectRayOriginNV) + Store 38(v7) 40 + 43: 29(fvec3) Load 42(gl_ObjectRayDirectionNV) + Store 41(v8) 43 + 48: 28(float) Load 47(gl_RayTminNV) + Store 45(v9) 48 + 51: 28(float) Load 50(gl_RayTmaxNV) + Store 49(v10) 51 + 54: 28(float) Load 53(gl_HitTNV) + Store 52(v11) 54 + 59: 6(int) Load 58(gl_HitKindNV) + Store 56(v12) 59 + 65: 60 Load 64(gl_ObjectToWorldNV) + Store 62(v13) 65 + 68: 60 Load 67(gl_WorldToObjectNV) + Store 66(v14) 68 + Store 71(incomingPayload) 73 + 74: 16(int) Load 18(v2) + 77: 76(bool) IEqual 74 75 + SelectionMerge 79 None + BranchConditional 77 78 80 + 78: Label + IgnoreIntersectionNV + Branch 79 + 80: Label + TerminateRayNV + Branch 79 + 79: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.AnyHitShader_Errors.rahit.out b/deps/glslang/Test/baseResults/spv.AnyHitShader_Errors.rahit.out new file mode 100644 index 00000000..e9bab082 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.AnyHitShader_Errors.rahit.out @@ -0,0 +1,8 @@ +spv.AnyHitShader_Errors.rahit +ERROR: 0:8: 'assign' : l-value required "payload" (cannot modify hitAttributeNV in this stage) +ERROR: 0:9: 'reportIntersectionNV' : no matching overloaded function found +ERROR: 0:10: 'traceNV' : no matching overloaded function found +ERROR: 3 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.AofA.frag.out b/deps/glslang/Test/baseResults/spv.AofA.frag.out new file mode 100644 index 00000000..798f083a --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.AofA.frag.out @@ -0,0 +1,156 @@ +spv.AofA.frag +WARNING: 0:6: '[][]' : Generating SPIR-V array-of-arrays, but Vulkan only supports single array level for this resource + +error: SPIRV-Tools Validation Errors +error: Only a single level of array is allowed for descriptor set variables + %nameAofA = OpVariable %_ptr_Uniform__arr__arr_uAofA_uint_5_uint_3 Uniform + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 104 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 39 44 68 70 72 78 + ExecutionMode 4 OriginUpperLeft + Source GLSL 430 + Name 4 "main" + Name 17 "foo(f1[5][7];" + Name 16 "a" + Name 20 "r" + Name 39 "outfloat" + Name 42 "g4" + Name 44 "g5" + Name 45 "param" + Name 48 "u" + Name 52 "param" + Name 66 "many" + Name 68 "i" + Name 70 "j" + Name 72 "k" + Name 78 "infloat" + Name 94 "uAofA" + MemberName 94(uAofA) 0 "f" + Name 98 "nameAofA" + Decorate 68(i) Flat + Decorate 70(j) Flat + Decorate 72(k) Flat + Decorate 92 ArrayStride 16 + Decorate 93 ArrayStride 64 + MemberDecorate 94(uAofA) 0 Offset 0 + Decorate 94(uAofA) Block + Decorate 98(nameAofA) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeInt 32 0 + 8: 7(int) Constant 7 + 9: TypeArray 6(float) 8 + 10: 7(int) Constant 5 + 11: TypeArray 9 10 + 12: TypePointer Function 11 + 13: 7(int) Constant 4 + 14: TypeArray 9 13 + 15: TypeFunction 14 12(ptr) + 19: TypePointer Function 9 + 21: TypeInt 32 1 + 22: 21(int) Constant 2 + 25: 21(int) Constant 0 + 28: 21(int) Constant 1 + 32: 21(int) Constant 3 + 38: TypePointer Output 6(float) + 39(outfloat): 38(ptr) Variable Output + 40: 6(float) Constant 0 + 41: TypePointer Private 14 + 42(g4): 41(ptr) Variable Private + 43: TypePointer Input 11 + 44(g5): 43(ptr) Variable Input + 49: 6(float) Constant 1077936128 + 50: TypePointer Function 6(float) + 55: 7(int) Constant 6 + 56: TypeArray 6(float) 55 + 57: TypeArray 56 10 + 58: TypeArray 57 13 + 59: 7(int) Constant 3 + 60: TypeArray 58 59 + 61: 7(int) Constant 2 + 62: TypeArray 60 61 + 63: 7(int) Constant 1 + 64: TypeArray 62 63 + 65: TypePointer Private 64 + 66(many): 65(ptr) Variable Private + 67: TypePointer Input 21(int) + 68(i): 67(ptr) Variable Input + 70(j): 67(ptr) Variable Input + 72(k): 67(ptr) Variable Input + 77: TypePointer Input 6(float) + 78(infloat): 77(ptr) Variable Input + 80: TypePointer Private 6(float) + 92: TypeArray 6(float) 13 + 93: TypeArray 92 61 + 94(uAofA): TypeStruct 93 + 95: TypeArray 94(uAofA) 10 + 96: TypeArray 95 59 + 97: TypePointer Uniform 96 + 98(nameAofA): 97(ptr) Variable Uniform + 99: TypePointer Uniform 6(float) + 4(main): 2 Function None 3 + 5: Label + 45(param): 12(ptr) Variable Function + 48(u): 12(ptr) Variable Function + 52(param): 12(ptr) Variable Function + Store 39(outfloat) 40 + 46: 11 Load 44(g5) + Store 45(param) 46 + 47: 14 FunctionCall 17(foo(f1[5][7];) 45(param) + Store 42(g4) 47 + 51: 50(ptr) AccessChain 48(u) 22 22 + Store 51 49 + 53: 11 Load 48(u) + Store 52(param) 53 + 54: 14 FunctionCall 17(foo(f1[5][7];) 52(param) + 69: 21(int) Load 68(i) + 71: 21(int) Load 70(j) + 73: 21(int) Load 72(k) + 74: 21(int) Load 68(i) + 75: 21(int) Load 70(j) + 76: 21(int) Load 72(k) + 79: 6(float) Load 78(infloat) + 81: 80(ptr) AccessChain 66(many) 69 71 73 74 75 76 + Store 81 79 + 82: 21(int) Load 70(j) + 83: 21(int) Load 70(j) + 84: 21(int) Load 70(j) + 85: 21(int) Load 70(j) + 86: 21(int) Load 70(j) + 87: 21(int) Load 70(j) + 88: 80(ptr) AccessChain 66(many) 82 83 84 85 86 87 + 89: 6(float) Load 88 + 90: 6(float) Load 39(outfloat) + 91: 6(float) FAdd 90 89 + Store 39(outfloat) 91 + 100: 99(ptr) AccessChain 98(nameAofA) 28 22 25 25 32 + 101: 6(float) Load 100 + 102: 6(float) Load 39(outfloat) + 103: 6(float) FAdd 102 101 + Store 39(outfloat) 103 + Return + FunctionEnd +17(foo(f1[5][7];): 14 Function None 15 + 16(a): 12(ptr) FunctionParameter + 18: Label + 20(r): 19(ptr) Variable Function + 23: 19(ptr) AccessChain 16(a) 22 + 24: 9 Load 23 + Store 20(r) 24 + 26: 19(ptr) AccessChain 16(a) 25 + 27: 9 Load 26 + 29: 19(ptr) AccessChain 16(a) 28 + 30: 9 Load 29 + 31: 9 Load 20(r) + 33: 19(ptr) AccessChain 16(a) 32 + 34: 9 Load 33 + 35: 14 CompositeConstruct 27 30 31 34 + ReturnValue 35 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.ClosestHitShader.rchit.out b/deps/glslang/Test/baseResults/spv.ClosestHitShader.rchit.out new file mode 100644 index 00000000..b461462e --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.ClosestHitShader.rchit.out @@ -0,0 +1,169 @@ +spv.ClosestHitShader.rchit +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 88 + + Capability RayTracingNV + Extension "SPV_NV_ray_tracing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint ClosestHitNV 4 "main" 11 14 20 23 26 33 36 39 42 47 50 53 58 64 67 + Source GLSL 460 + SourceExtension "GL_NV_ray_tracing" + Name 4 "main" + Name 9 "v0" + Name 11 "gl_LaunchIDNV" + Name 13 "v1" + Name 14 "gl_LaunchSizeNV" + Name 18 "v2" + Name 20 "gl_PrimitiveID" + Name 22 "v3" + Name 23 "gl_InstanceID" + Name 25 "v4" + Name 26 "gl_InstanceCustomIndexNV" + Name 31 "v5" + Name 33 "gl_WorldRayOriginNV" + Name 35 "v6" + Name 36 "gl_WorldRayDirectionNV" + Name 38 "v7" + Name 39 "gl_ObjectRayOriginNV" + Name 41 "v8" + Name 42 "gl_ObjectRayDirectionNV" + Name 45 "v9" + Name 47 "gl_RayTminNV" + Name 49 "v10" + Name 50 "gl_RayTmaxNV" + Name 52 "v11" + Name 53 "gl_HitTNV" + Name 56 "v12" + Name 58 "gl_HitKindNV" + Name 62 "v13" + Name 64 "gl_ObjectToWorldNV" + Name 66 "v14" + Name 67 "gl_WorldToObjectNV" + Name 71 "accNV" + Name 85 "localPayload" + Name 87 "incomingPayload" + Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV + Decorate 14(gl_LaunchSizeNV) BuiltIn LaunchSizeNV + Decorate 20(gl_PrimitiveID) BuiltIn PrimitiveId + Decorate 23(gl_InstanceID) BuiltIn InstanceId + Decorate 26(gl_InstanceCustomIndexNV) BuiltIn InstanceCustomIndexNV + Decorate 33(gl_WorldRayOriginNV) BuiltIn WorldRayOriginNV + Decorate 36(gl_WorldRayDirectionNV) BuiltIn WorldRayDirectionNV + Decorate 39(gl_ObjectRayOriginNV) BuiltIn ObjectRayOriginNV + Decorate 42(gl_ObjectRayDirectionNV) BuiltIn ObjectRayDirectionNV + Decorate 47(gl_RayTminNV) BuiltIn RayTminNV + Decorate 50(gl_RayTmaxNV) BuiltIn RayTmaxNV + Decorate 53(gl_HitTNV) BuiltIn HitTNV + Decorate 58(gl_HitKindNV) BuiltIn HitKindNV + Decorate 64(gl_ObjectToWorldNV) BuiltIn ObjectToWorldNV + Decorate 67(gl_WorldToObjectNV) BuiltIn WorldToObjectNV + Decorate 71(accNV) DescriptorSet 0 + Decorate 71(accNV) Binding 0 + Decorate 85(localPayload) Location 0 + Decorate 87(incomingPayload) Location 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 10: TypePointer Input 7(ivec3) +11(gl_LaunchIDNV): 10(ptr) Variable Input +14(gl_LaunchSizeNV): 10(ptr) Variable Input + 16: TypeInt 32 1 + 17: TypePointer Function 16(int) + 19: TypePointer Input 16(int) +20(gl_PrimitiveID): 19(ptr) Variable Input +23(gl_InstanceID): 19(ptr) Variable Input +26(gl_InstanceCustomIndexNV): 19(ptr) Variable Input + 28: TypeFloat 32 + 29: TypeVector 28(float) 3 + 30: TypePointer Function 29(fvec3) + 32: TypePointer Input 29(fvec3) +33(gl_WorldRayOriginNV): 32(ptr) Variable Input +36(gl_WorldRayDirectionNV): 32(ptr) Variable Input +39(gl_ObjectRayOriginNV): 32(ptr) Variable Input +42(gl_ObjectRayDirectionNV): 32(ptr) Variable Input + 44: TypePointer Function 28(float) + 46: TypePointer Input 28(float) +47(gl_RayTminNV): 46(ptr) Variable Input +50(gl_RayTmaxNV): 46(ptr) Variable Input + 53(gl_HitTNV): 46(ptr) Variable Input + 55: TypePointer Function 6(int) + 57: TypePointer Input 6(int) +58(gl_HitKindNV): 57(ptr) Variable Input + 60: TypeMatrix 29(fvec3) 4 + 61: TypePointer Function 60 + 63: TypePointer Input 60 +64(gl_ObjectToWorldNV): 63(ptr) Variable Input +67(gl_WorldToObjectNV): 63(ptr) Variable Input + 69: TypeAccelerationStructureNV + 70: TypePointer UniformConstant 69 + 71(accNV): 70(ptr) Variable UniformConstant + 73: 6(int) Constant 0 + 74: 6(int) Constant 1 + 75: 6(int) Constant 2 + 76: 6(int) Constant 3 + 77: 28(float) Constant 1056964608 + 78: 29(fvec3) ConstantComposite 77 77 77 + 79: 28(float) Constant 1065353216 + 80: 29(fvec3) ConstantComposite 79 79 79 + 81: 28(float) Constant 1061158912 + 82: 16(int) Constant 1 + 83: TypeVector 28(float) 4 + 84: TypePointer RayPayloadNV 83(fvec4) +85(localPayload): 84(ptr) Variable RayPayloadNV + 86: TypePointer IncomingRayPayloadNV 83(fvec4) +87(incomingPayload): 86(ptr) Variable IncomingRayPayloadNV + 4(main): 2 Function None 3 + 5: Label + 9(v0): 8(ptr) Variable Function + 13(v1): 8(ptr) Variable Function + 18(v2): 17(ptr) Variable Function + 22(v3): 17(ptr) Variable Function + 25(v4): 17(ptr) Variable Function + 31(v5): 30(ptr) Variable Function + 35(v6): 30(ptr) Variable Function + 38(v7): 30(ptr) Variable Function + 41(v8): 30(ptr) Variable Function + 45(v9): 44(ptr) Variable Function + 49(v10): 44(ptr) Variable Function + 52(v11): 44(ptr) Variable Function + 56(v12): 55(ptr) Variable Function + 62(v13): 61(ptr) Variable Function + 66(v14): 61(ptr) Variable Function + 12: 7(ivec3) Load 11(gl_LaunchIDNV) + Store 9(v0) 12 + 15: 7(ivec3) Load 14(gl_LaunchSizeNV) + Store 13(v1) 15 + 21: 16(int) Load 20(gl_PrimitiveID) + Store 18(v2) 21 + 24: 16(int) Load 23(gl_InstanceID) + Store 22(v3) 24 + 27: 16(int) Load 26(gl_InstanceCustomIndexNV) + Store 25(v4) 27 + 34: 29(fvec3) Load 33(gl_WorldRayOriginNV) + Store 31(v5) 34 + 37: 29(fvec3) Load 36(gl_WorldRayDirectionNV) + Store 35(v6) 37 + 40: 29(fvec3) Load 39(gl_ObjectRayOriginNV) + Store 38(v7) 40 + 43: 29(fvec3) Load 42(gl_ObjectRayDirectionNV) + Store 41(v8) 43 + 48: 28(float) Load 47(gl_RayTminNV) + Store 45(v9) 48 + 51: 28(float) Load 50(gl_RayTmaxNV) + Store 49(v10) 51 + 54: 28(float) Load 53(gl_HitTNV) + Store 52(v11) 54 + 59: 6(int) Load 58(gl_HitKindNV) + Store 56(v12) 59 + 65: 60 Load 64(gl_ObjectToWorldNV) + Store 62(v13) 65 + 68: 60 Load 67(gl_WorldToObjectNV) + Store 66(v14) 68 + 72: 69 Load 71(accNV) + TraceNV 72 73 74 75 76 73 78 77 80 81 82 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.ClosestHitShader_Errors.rchit.out b/deps/glslang/Test/baseResults/spv.ClosestHitShader_Errors.rchit.out new file mode 100644 index 00000000..e6f84108 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.ClosestHitShader_Errors.rchit.out @@ -0,0 +1,9 @@ +spv.ClosestHitShader_Errors.rchit +ERROR: 0:8: 'assign' : l-value required "payload" (cannot modify hitAttributeNV in this stage) +ERROR: 0:9: 'reportIntersectionNV' : no matching overloaded function found +ERROR: 0:10: 'terminateRayNV' : no matching overloaded function found +ERROR: 0:11: 'ignoreIntersectionNV' : no matching overloaded function found +ERROR: 4 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.GeometryShaderPassthrough.geom.out b/deps/glslang/Test/baseResults/spv.GeometryShaderPassthrough.geom.out new file mode 100644 index 00000000..5db845e5 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.GeometryShaderPassthrough.geom.out @@ -0,0 +1,45 @@ +spv.GeometryShaderPassthrough.geom +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 15 + + Capability Geometry + Capability GeometryShaderPassthroughNV + Extension "SPV_NV_geometry_shader_passthrough" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 10 14 + ExecutionMode 4 Triangles + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputTriangleStrip + ExecutionMode 4 OutputVertices 3 + Source GLSL 450 + SourceExtension "GL_NV_geometry_shader_passthrough" + Name 4 "main" + Name 8 "gl_PerVertex" + MemberName 8(gl_PerVertex) 0 "gl_Position" + Name 10 "" + Name 12 "Inputs" + MemberName 12(Inputs) 0 "texcoord" + MemberName 12(Inputs) 1 "baseColor" + Name 14 "" + MemberDecorate 8(gl_PerVertex) 0 BuiltIn Position + Decorate 8(gl_PerVertex) Block + Decorate 10 PassthroughNV + Decorate 12(Inputs) Block + Decorate 14 PassthroughNV + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(gl_PerVertex): TypeStruct 7(fvec4) + 9: TypePointer Input 8(gl_PerVertex) + 10: 9(ptr) Variable Input + 11: TypeVector 6(float) 2 + 12(Inputs): TypeStruct 11(fvec2) 7(fvec4) + 13: TypePointer Input 12(Inputs) + 14: 13(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.IntersectShader.rint.out b/deps/glslang/Test/baseResults/spv.IntersectShader.rint.out new file mode 100644 index 00000000..cbb70cd6 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.IntersectShader.rint.out @@ -0,0 +1,138 @@ +spv.IntersectShader.rint +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 71 + + Capability RayTracingNV + Extension "SPV_NV_ray_tracing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint IntersectionNV 4 "main" 11 14 20 23 26 33 36 39 42 47 50 56 59 + Source GLSL 460 + SourceExtension "GL_NV_ray_tracing" + Name 4 "main" + Name 9 "v0" + Name 11 "gl_LaunchIDNV" + Name 13 "v1" + Name 14 "gl_LaunchSizeNV" + Name 18 "v2" + Name 20 "gl_PrimitiveID" + Name 22 "v3" + Name 23 "gl_InstanceID" + Name 25 "v4" + Name 26 "gl_InstanceCustomIndexNV" + Name 31 "v5" + Name 33 "gl_WorldRayOriginNV" + Name 35 "v6" + Name 36 "gl_WorldRayDirectionNV" + Name 38 "v7" + Name 39 "gl_ObjectRayOriginNV" + Name 41 "v8" + Name 42 "gl_ObjectRayDirectionNV" + Name 45 "v9" + Name 47 "gl_RayTminNV" + Name 49 "v10" + Name 50 "gl_RayTmaxNV" + Name 54 "v11" + Name 56 "gl_ObjectToWorldNV" + Name 58 "v12" + Name 59 "gl_WorldToObjectNV" + Name 63 "iAttr" + Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV + Decorate 14(gl_LaunchSizeNV) BuiltIn LaunchSizeNV + Decorate 20(gl_PrimitiveID) BuiltIn PrimitiveId + Decorate 23(gl_InstanceID) BuiltIn InstanceId + Decorate 26(gl_InstanceCustomIndexNV) BuiltIn InstanceCustomIndexNV + Decorate 33(gl_WorldRayOriginNV) BuiltIn WorldRayOriginNV + Decorate 36(gl_WorldRayDirectionNV) BuiltIn WorldRayDirectionNV + Decorate 39(gl_ObjectRayOriginNV) BuiltIn ObjectRayOriginNV + Decorate 42(gl_ObjectRayDirectionNV) BuiltIn ObjectRayDirectionNV + Decorate 47(gl_RayTminNV) BuiltIn RayTminNV + Decorate 50(gl_RayTmaxNV) BuiltIn RayTmaxNV + Decorate 56(gl_ObjectToWorldNV) BuiltIn ObjectToWorldNV + Decorate 59(gl_WorldToObjectNV) BuiltIn WorldToObjectNV + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 10: TypePointer Input 7(ivec3) +11(gl_LaunchIDNV): 10(ptr) Variable Input +14(gl_LaunchSizeNV): 10(ptr) Variable Input + 16: TypeInt 32 1 + 17: TypePointer Function 16(int) + 19: TypePointer Input 16(int) +20(gl_PrimitiveID): 19(ptr) Variable Input +23(gl_InstanceID): 19(ptr) Variable Input +26(gl_InstanceCustomIndexNV): 19(ptr) Variable Input + 28: TypeFloat 32 + 29: TypeVector 28(float) 3 + 30: TypePointer Function 29(fvec3) + 32: TypePointer Input 29(fvec3) +33(gl_WorldRayOriginNV): 32(ptr) Variable Input +36(gl_WorldRayDirectionNV): 32(ptr) Variable Input +39(gl_ObjectRayOriginNV): 32(ptr) Variable Input +42(gl_ObjectRayDirectionNV): 32(ptr) Variable Input + 44: TypePointer Function 28(float) + 46: TypePointer Input 28(float) +47(gl_RayTminNV): 46(ptr) Variable Input +50(gl_RayTmaxNV): 46(ptr) Variable Input + 52: TypeMatrix 29(fvec3) 4 + 53: TypePointer Function 52 + 55: TypePointer Input 52 +56(gl_ObjectToWorldNV): 55(ptr) Variable Input +59(gl_WorldToObjectNV): 55(ptr) Variable Input + 61: TypeVector 28(float) 4 + 62: TypePointer HitAttributeNV 61(fvec4) + 63(iAttr): 62(ptr) Variable HitAttributeNV + 64: 28(float) Constant 1056964608 + 65: 28(float) Constant 0 + 66: 28(float) Constant 1065353216 + 67: 61(fvec4) ConstantComposite 64 64 65 66 + 68: 6(int) Constant 1 + 69: TypeBool + 4(main): 2 Function None 3 + 5: Label + 9(v0): 8(ptr) Variable Function + 13(v1): 8(ptr) Variable Function + 18(v2): 17(ptr) Variable Function + 22(v3): 17(ptr) Variable Function + 25(v4): 17(ptr) Variable Function + 31(v5): 30(ptr) Variable Function + 35(v6): 30(ptr) Variable Function + 38(v7): 30(ptr) Variable Function + 41(v8): 30(ptr) Variable Function + 45(v9): 44(ptr) Variable Function + 49(v10): 44(ptr) Variable Function + 54(v11): 53(ptr) Variable Function + 58(v12): 53(ptr) Variable Function + 12: 7(ivec3) Load 11(gl_LaunchIDNV) + Store 9(v0) 12 + 15: 7(ivec3) Load 14(gl_LaunchSizeNV) + Store 13(v1) 15 + 21: 16(int) Load 20(gl_PrimitiveID) + Store 18(v2) 21 + 24: 16(int) Load 23(gl_InstanceID) + Store 22(v3) 24 + 27: 16(int) Load 26(gl_InstanceCustomIndexNV) + Store 25(v4) 27 + 34: 29(fvec3) Load 33(gl_WorldRayOriginNV) + Store 31(v5) 34 + 37: 29(fvec3) Load 36(gl_WorldRayDirectionNV) + Store 35(v6) 37 + 40: 29(fvec3) Load 39(gl_ObjectRayOriginNV) + Store 38(v7) 40 + 43: 29(fvec3) Load 42(gl_ObjectRayDirectionNV) + Store 41(v8) 43 + 48: 28(float) Load 47(gl_RayTminNV) + Store 45(v9) 48 + 51: 28(float) Load 50(gl_RayTmaxNV) + Store 49(v10) 51 + 57: 52 Load 56(gl_ObjectToWorldNV) + Store 54(v11) 57 + 60: 52 Load 59(gl_WorldToObjectNV) + Store 58(v12) 60 + Store 63(iAttr) 67 + 70: 69(bool) ReportIntersectionNV 64 68 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.IntersectShader_Errors.rint.out b/deps/glslang/Test/baseResults/spv.IntersectShader_Errors.rint.out new file mode 100644 index 00000000..f2670265 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.IntersectShader_Errors.rint.out @@ -0,0 +1,10 @@ +spv.IntersectShader_Errors.rint +ERROR: 0:3: 'rayPayloadInNV' : not supported in this stage: intersection +ERROR: 0:4: 'rayPayloadNV' : not supported in this stage: intersection +ERROR: 0:8: 'gl_HitTNV' : undeclared identifier +ERROR: 0:9: 'gl_HitKindNV' : undeclared identifier +ERROR: 0:10: 'traceNV' : no matching overloaded function found +ERROR: 5 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.MissShader.rmiss.out b/deps/glslang/Test/baseResults/spv.MissShader.rmiss.out new file mode 100644 index 00000000..0ad3341a --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.MissShader.rmiss.out @@ -0,0 +1,113 @@ +spv.MissShader.rmiss +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 60 + + Capability RayTracingNV + Extension "SPV_NV_ray_tracing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint MissNV 4 "main" 11 14 21 24 27 30 35 38 + Source GLSL 460 + SourceExtension "GL_NV_ray_tracing" + Name 4 "main" + Name 9 "v0" + Name 11 "gl_LaunchIDNV" + Name 13 "v1" + Name 14 "gl_LaunchSizeNV" + Name 19 "v2" + Name 21 "gl_WorldRayOriginNV" + Name 23 "v3" + Name 24 "gl_WorldRayDirectionNV" + Name 26 "v4" + Name 27 "gl_ObjectRayOriginNV" + Name 29 "v5" + Name 30 "gl_ObjectRayDirectionNV" + Name 33 "v6" + Name 35 "gl_RayTminNV" + Name 37 "v7" + Name 38 "gl_RayTmaxNV" + Name 42 "accNV" + Name 57 "localPayload" + Name 59 "incomingPayload" + Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV + Decorate 14(gl_LaunchSizeNV) BuiltIn LaunchSizeNV + Decorate 21(gl_WorldRayOriginNV) BuiltIn WorldRayOriginNV + Decorate 24(gl_WorldRayDirectionNV) BuiltIn WorldRayDirectionNV + Decorate 27(gl_ObjectRayOriginNV) BuiltIn ObjectRayOriginNV + Decorate 30(gl_ObjectRayDirectionNV) BuiltIn ObjectRayDirectionNV + Decorate 35(gl_RayTminNV) BuiltIn RayTminNV + Decorate 38(gl_RayTmaxNV) BuiltIn RayTmaxNV + Decorate 42(accNV) DescriptorSet 0 + Decorate 42(accNV) Binding 0 + Decorate 57(localPayload) Location 0 + Decorate 59(incomingPayload) Location 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 10: TypePointer Input 7(ivec3) +11(gl_LaunchIDNV): 10(ptr) Variable Input +14(gl_LaunchSizeNV): 10(ptr) Variable Input + 16: TypeFloat 32 + 17: TypeVector 16(float) 3 + 18: TypePointer Function 17(fvec3) + 20: TypePointer Input 17(fvec3) +21(gl_WorldRayOriginNV): 20(ptr) Variable Input +24(gl_WorldRayDirectionNV): 20(ptr) Variable Input +27(gl_ObjectRayOriginNV): 20(ptr) Variable Input +30(gl_ObjectRayDirectionNV): 20(ptr) Variable Input + 32: TypePointer Function 16(float) + 34: TypePointer Input 16(float) +35(gl_RayTminNV): 34(ptr) Variable Input +38(gl_RayTmaxNV): 34(ptr) Variable Input + 40: TypeAccelerationStructureNV + 41: TypePointer UniformConstant 40 + 42(accNV): 41(ptr) Variable UniformConstant + 44: 6(int) Constant 0 + 45: 6(int) Constant 1 + 46: 6(int) Constant 2 + 47: 6(int) Constant 3 + 48: 16(float) Constant 1056964608 + 49: 17(fvec3) ConstantComposite 48 48 48 + 50: 16(float) Constant 1065353216 + 51: 17(fvec3) ConstantComposite 50 50 50 + 52: 16(float) Constant 1061158912 + 53: TypeInt 32 1 + 54: 53(int) Constant 1 + 55: TypeVector 16(float) 4 + 56: TypePointer RayPayloadNV 55(fvec4) +57(localPayload): 56(ptr) Variable RayPayloadNV + 58: TypePointer IncomingRayPayloadNV 55(fvec4) +59(incomingPayload): 58(ptr) Variable IncomingRayPayloadNV + 4(main): 2 Function None 3 + 5: Label + 9(v0): 8(ptr) Variable Function + 13(v1): 8(ptr) Variable Function + 19(v2): 18(ptr) Variable Function + 23(v3): 18(ptr) Variable Function + 26(v4): 18(ptr) Variable Function + 29(v5): 18(ptr) Variable Function + 33(v6): 32(ptr) Variable Function + 37(v7): 32(ptr) Variable Function + 12: 7(ivec3) Load 11(gl_LaunchIDNV) + Store 9(v0) 12 + 15: 7(ivec3) Load 14(gl_LaunchSizeNV) + Store 13(v1) 15 + 22: 17(fvec3) Load 21(gl_WorldRayOriginNV) + Store 19(v2) 22 + 25: 17(fvec3) Load 24(gl_WorldRayDirectionNV) + Store 23(v3) 25 + 28: 17(fvec3) Load 27(gl_ObjectRayOriginNV) + Store 26(v4) 28 + 31: 17(fvec3) Load 30(gl_ObjectRayDirectionNV) + Store 29(v5) 31 + 36: 16(float) Load 35(gl_RayTminNV) + Store 33(v6) 36 + 39: 16(float) Load 38(gl_RayTmaxNV) + Store 37(v7) 39 + 43: 40 Load 42(accNV) + TraceNV 43 44 45 46 47 44 49 48 51 52 54 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.MissShader_Errors.rmiss.out b/deps/glslang/Test/baseResults/spv.MissShader_Errors.rmiss.out new file mode 100644 index 00000000..52b412b4 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.MissShader_Errors.rmiss.out @@ -0,0 +1,21 @@ +spv.MissShader_Errors.rmiss +ERROR: 0:3: 'hitAttributeNV' : not supported in this stage: miss +ERROR: 0:6: 'gl_PrimitiveID' : undeclared identifier +ERROR: 0:6: '=' : cannot convert from ' temp float' to ' temp highp int' +ERROR: 0:7: 'gl_InstanceID' : undeclared identifier (Did you mean gl_InstanceIndex?) +ERROR: 0:7: '=' : cannot convert from ' temp float' to ' temp highp int' +ERROR: 0:8: 'gl_InstanceCustomIndexNV' : undeclared identifier +ERROR: 0:8: '=' : cannot convert from ' temp float' to ' temp highp int' +ERROR: 0:9: 'gl_ObjectToWorldNV' : undeclared identifier +ERROR: 0:9: '=' : cannot convert from ' temp float' to ' temp highp 4X3 matrix of float' +ERROR: 0:10: 'gl_WorldToObjectNV' : undeclared identifier +ERROR: 0:10: '=' : cannot convert from ' temp float' to ' temp highp 4X3 matrix of float' +ERROR: 0:11: 'gl_HitTNV' : undeclared identifier +ERROR: 0:12: 'gl_HitKindNV' : undeclared identifier +ERROR: 0:13: 'reportIntersectionNV' : no matching overloaded function found +ERROR: 0:14: 'ignoreIntersectionNV' : no matching overloaded function found +ERROR: 0:15: 'terminateRayNV' : no matching overloaded function found +ERROR: 16 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.OVR_multiview.vert.out b/deps/glslang/Test/baseResults/spv.OVR_multiview.vert.out new file mode 100644 index 00000000..7013cedd --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.OVR_multiview.vert.out @@ -0,0 +1,57 @@ +spv.OVR_multiview.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 27 + + Capability Shader + Capability MultiView + Extension "SPV_KHR_multiview" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 13 17 25 26 + Source GLSL 330 + SourceExtension "GL_OVR_multiview" + Name 4 "main" + Name 11 "gl_PerVertex" + MemberName 11(gl_PerVertex) 0 "gl_Position" + MemberName 11(gl_PerVertex) 1 "gl_PointSize" + MemberName 11(gl_PerVertex) 2 "gl_ClipDistance" + Name 13 "" + Name 17 "gl_ViewID_OVR" + Name 25 "gl_VertexID" + Name 26 "gl_InstanceID" + MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 11(gl_PerVertex) Block + Decorate 17(gl_ViewID_OVR) BuiltIn ViewIndex + Decorate 25(gl_VertexID) BuiltIn VertexId + Decorate 26(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 0 + 9: 8(int) Constant 1 + 10: TypeArray 6(float) 9 +11(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 10 + 12: TypePointer Output 11(gl_PerVertex) + 13: 12(ptr) Variable Output + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16: TypePointer Input 8(int) +17(gl_ViewID_OVR): 16(ptr) Variable Input + 20: 6(float) Constant 0 + 22: TypePointer Output 7(fvec4) + 24: TypePointer Input 14(int) + 25(gl_VertexID): 24(ptr) Variable Input +26(gl_InstanceID): 24(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 18: 8(int) Load 17(gl_ViewID_OVR) + 19: 6(float) ConvertUToF 18 + 21: 7(fvec4) CompositeConstruct 19 20 20 20 + 23: 22(ptr) AccessChain 13 15 + Store 23 21 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.Operations.frag.out b/deps/glslang/Test/baseResults/spv.Operations.frag.out new file mode 100644 index 00000000..4113ddf1 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.Operations.frag.out @@ -0,0 +1,702 @@ +spv.Operations.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 532 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 11 22 212 288 485 526 531 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "v" + Name 11 "uv4" + Name 20 "i" + Name 22 "ui" + Name 181 "ub41" + Name 188 "f" + Name 212 "uf" + Name 285 "u" + Name 288 "uui" + Name 305 "b" + Name 342 "ub42" + Name 485 "FragColor" + Name 503 "m1" + Name 510 "m2" + Name 526 "uiv4" + Name 528 "ub" + Name 531 "uuv4" + Decorate 22(ui) Flat + Decorate 288(uui) Flat + Decorate 526(uiv4) Flat + Decorate 531(uuv4) Flat + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypePointer Input 7(fvec4) + 11(uv4): 10(ptr) Variable Input + 18: TypeInt 32 1 + 19: TypePointer Function 18(int) + 21: TypePointer Input 18(int) + 22(ui): 21(ptr) Variable Input + 141: TypeInt 32 0 + 142: 141(int) Constant 0 + 143: TypePointer Function 6(float) + 178: TypeBool + 179: TypeVector 178(bool) 4 + 180: TypePointer Private 179(bvec4) + 181(ub41): 180(ptr) Variable Private + 211: TypePointer Input 6(float) + 212(uf): 211(ptr) Variable Input + 284: TypePointer Function 141(int) + 287: TypePointer Input 141(int) + 288(uui): 287(ptr) Variable Input + 304: TypePointer Function 178(bool) + 342(ub42): 180(ptr) Variable Private + 398: 18(int) Constant 2 + 405: 18(int) Constant 1 + 435: TypeVector 6(float) 3 + 454: 6(float) Constant 1073741824 + 461: 6(float) Constant 1065353216 + 466: 18(int) Constant 66 + 472: 18(int) Constant 17 + 484: TypePointer Output 7(fvec4) + 485(FragColor): 484(ptr) Variable Output + 501: TypeMatrix 7(fvec4) 4 + 502: TypePointer Function 501 + 504: 6(float) Constant 0 + 505: 7(fvec4) ConstantComposite 461 504 504 504 + 506: 7(fvec4) ConstantComposite 504 461 504 504 + 507: 7(fvec4) ConstantComposite 504 504 461 504 + 508: 7(fvec4) ConstantComposite 504 504 504 461 + 509: 501 ConstantComposite 505 506 507 508 + 511: 7(fvec4) ConstantComposite 504 504 504 504 + 512: 501 ConstantComposite 511 511 511 511 + 524: TypeVector 18(int) 4 + 525: TypePointer Input 524(ivec4) + 526(uiv4): 525(ptr) Variable Input + 527: TypePointer Private 178(bool) + 528(ub): 527(ptr) Variable Private + 529: TypeVector 141(int) 4 + 530: TypePointer Input 529(ivec4) + 531(uuv4): 530(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 9(v): 8(ptr) Variable Function + 20(i): 19(ptr) Variable Function + 188(f): 143(ptr) Variable Function + 285(u): 284(ptr) Variable Function + 305(b): 304(ptr) Variable Function + 487: 8(ptr) Variable Function + 503(m1): 502(ptr) Variable Function + 510(m2): 502(ptr) Variable Function + 514: 502(ptr) Variable Function + 12: 7(fvec4) Load 11(uv4) + 13: 7(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 12 + Store 9(v) 13 + 14: 7(fvec4) Load 9(v) + 15: 7(fvec4) ExtInst 1(GLSL.std.450) 12(Degrees) 14 + 16: 7(fvec4) Load 9(v) + 17: 7(fvec4) FAdd 16 15 + Store 9(v) 17 + 23: 18(int) Load 22(ui) + 24: 18(int) Load 22(ui) + 25: 18(int) IMul 23 24 + Store 20(i) 25 + 26: 7(fvec4) Load 9(v) + 27: 7(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 26 + 28: 7(fvec4) Load 9(v) + 29: 7(fvec4) FAdd 28 27 + Store 9(v) 29 + 30: 7(fvec4) Load 9(v) + 31: 7(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 30 + 32: 7(fvec4) Load 9(v) + 33: 7(fvec4) FAdd 32 31 + Store 9(v) 33 + 34: 7(fvec4) Load 9(v) + 35: 7(fvec4) ExtInst 1(GLSL.std.450) 15(Tan) 34 + 36: 7(fvec4) Load 9(v) + 37: 7(fvec4) FAdd 36 35 + Store 9(v) 37 + 38: 7(fvec4) Load 9(v) + 39: 7(fvec4) ExtInst 1(GLSL.std.450) 16(Asin) 38 + 40: 7(fvec4) Load 9(v) + 41: 7(fvec4) FAdd 40 39 + Store 9(v) 41 + 42: 7(fvec4) Load 9(v) + 43: 7(fvec4) ExtInst 1(GLSL.std.450) 17(Acos) 42 + 44: 7(fvec4) Load 9(v) + 45: 7(fvec4) FAdd 44 43 + Store 9(v) 45 + 46: 7(fvec4) Load 9(v) + 47: 7(fvec4) ExtInst 1(GLSL.std.450) 18(Atan) 46 + 48: 7(fvec4) Load 9(v) + 49: 7(fvec4) FAdd 48 47 + Store 9(v) 49 + 50: 7(fvec4) Load 9(v) + 51: 7(fvec4) ExtInst 1(GLSL.std.450) 19(Sinh) 50 + 52: 7(fvec4) Load 9(v) + 53: 7(fvec4) FAdd 52 51 + Store 9(v) 53 + 54: 7(fvec4) Load 9(v) + 55: 7(fvec4) ExtInst 1(GLSL.std.450) 20(Cosh) 54 + 56: 7(fvec4) Load 9(v) + 57: 7(fvec4) FAdd 56 55 + Store 9(v) 57 + 58: 7(fvec4) Load 9(v) + 59: 7(fvec4) ExtInst 1(GLSL.std.450) 21(Tanh) 58 + 60: 7(fvec4) Load 9(v) + 61: 7(fvec4) FAdd 60 59 + Store 9(v) 61 + 62: 7(fvec4) Load 9(v) + 63: 7(fvec4) ExtInst 1(GLSL.std.450) 22(Asinh) 62 + 64: 7(fvec4) Load 9(v) + 65: 7(fvec4) FAdd 64 63 + Store 9(v) 65 + 66: 7(fvec4) Load 9(v) + 67: 7(fvec4) ExtInst 1(GLSL.std.450) 23(Acosh) 66 + 68: 7(fvec4) Load 9(v) + 69: 7(fvec4) FAdd 68 67 + Store 9(v) 69 + 70: 7(fvec4) Load 9(v) + 71: 7(fvec4) ExtInst 1(GLSL.std.450) 24(Atanh) 70 + 72: 7(fvec4) Load 9(v) + 73: 7(fvec4) FAdd 72 71 + Store 9(v) 73 + 74: 7(fvec4) Load 9(v) + 75: 7(fvec4) Load 9(v) + 76: 7(fvec4) ExtInst 1(GLSL.std.450) 26(Pow) 74 75 + 77: 7(fvec4) Load 9(v) + 78: 7(fvec4) FAdd 77 76 + Store 9(v) 78 + 79: 7(fvec4) Load 9(v) + 80: 7(fvec4) ExtInst 1(GLSL.std.450) 27(Exp) 79 + 81: 7(fvec4) Load 9(v) + 82: 7(fvec4) FAdd 81 80 + Store 9(v) 82 + 83: 7(fvec4) Load 9(v) + 84: 7(fvec4) ExtInst 1(GLSL.std.450) 28(Log) 83 + 85: 7(fvec4) Load 9(v) + 86: 7(fvec4) FAdd 85 84 + Store 9(v) 86 + 87: 7(fvec4) Load 9(v) + 88: 7(fvec4) ExtInst 1(GLSL.std.450) 29(Exp2) 87 + 89: 7(fvec4) Load 9(v) + 90: 7(fvec4) FAdd 89 88 + Store 9(v) 90 + 91: 7(fvec4) Load 9(v) + 92: 7(fvec4) ExtInst 1(GLSL.std.450) 30(Log2) 91 + 93: 7(fvec4) Load 9(v) + 94: 7(fvec4) FAdd 93 92 + Store 9(v) 94 + 95: 7(fvec4) Load 9(v) + 96: 7(fvec4) ExtInst 1(GLSL.std.450) 31(Sqrt) 95 + 97: 7(fvec4) Load 9(v) + 98: 7(fvec4) FAdd 97 96 + Store 9(v) 98 + 99: 7(fvec4) Load 9(v) + 100: 7(fvec4) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 99 + 101: 7(fvec4) Load 9(v) + 102: 7(fvec4) FAdd 101 100 + Store 9(v) 102 + 103: 7(fvec4) Load 9(v) + 104: 7(fvec4) ExtInst 1(GLSL.std.450) 4(FAbs) 103 + 105: 7(fvec4) Load 9(v) + 106: 7(fvec4) FAdd 105 104 + Store 9(v) 106 + 107: 7(fvec4) Load 9(v) + 108: 7(fvec4) ExtInst 1(GLSL.std.450) 6(FSign) 107 + 109: 7(fvec4) Load 9(v) + 110: 7(fvec4) FAdd 109 108 + Store 9(v) 110 + 111: 7(fvec4) Load 9(v) + 112: 7(fvec4) ExtInst 1(GLSL.std.450) 8(Floor) 111 + 113: 7(fvec4) Load 9(v) + 114: 7(fvec4) FAdd 113 112 + Store 9(v) 114 + 115: 7(fvec4) Load 9(v) + 116: 7(fvec4) ExtInst 1(GLSL.std.450) 3(Trunc) 115 + 117: 7(fvec4) Load 9(v) + 118: 7(fvec4) FAdd 117 116 + Store 9(v) 118 + 119: 7(fvec4) Load 9(v) + 120: 7(fvec4) ExtInst 1(GLSL.std.450) 1(Round) 119 + 121: 7(fvec4) Load 9(v) + 122: 7(fvec4) FAdd 121 120 + Store 9(v) 122 + 123: 7(fvec4) Load 9(v) + 124: 7(fvec4) ExtInst 1(GLSL.std.450) 2(RoundEven) 123 + 125: 7(fvec4) Load 9(v) + 126: 7(fvec4) FAdd 125 124 + Store 9(v) 126 + 127: 7(fvec4) Load 9(v) + 128: 7(fvec4) ExtInst 1(GLSL.std.450) 9(Ceil) 127 + 129: 7(fvec4) Load 9(v) + 130: 7(fvec4) FAdd 129 128 + Store 9(v) 130 + 131: 7(fvec4) Load 9(v) + 132: 7(fvec4) ExtInst 1(GLSL.std.450) 10(Fract) 131 + 133: 7(fvec4) Load 9(v) + 134: 7(fvec4) FAdd 133 132 + Store 9(v) 134 + 135: 7(fvec4) Load 9(v) + 136: 7(fvec4) Load 9(v) + 137: 7(fvec4) FMod 135 136 + 138: 7(fvec4) Load 9(v) + 139: 7(fvec4) FAdd 138 137 + Store 9(v) 139 + 140: 7(fvec4) Load 9(v) + 144: 143(ptr) AccessChain 9(v) 142 + 145: 6(float) Load 144 + 146: 7(fvec4) CompositeConstruct 145 145 145 145 + 147: 7(fvec4) FMod 140 146 + 148: 7(fvec4) Load 9(v) + 149: 7(fvec4) FAdd 148 147 + Store 9(v) 149 + 150: 7(fvec4) Load 9(v) + 151: 7(fvec4) ExtInst 1(GLSL.std.450) 35(Modf) 150 9(v) + 152: 7(fvec4) Load 9(v) + 153: 7(fvec4) FAdd 152 151 + Store 9(v) 153 + 154: 7(fvec4) Load 9(v) + 155: 7(fvec4) Load 11(uv4) + 156: 7(fvec4) ExtInst 1(GLSL.std.450) 37(FMin) 154 155 + 157: 7(fvec4) Load 9(v) + 158: 7(fvec4) FAdd 157 156 + Store 9(v) 158 + 159: 7(fvec4) Load 9(v) + 160: 7(fvec4) Load 11(uv4) + 161: 7(fvec4) ExtInst 1(GLSL.std.450) 40(FMax) 159 160 + 162: 7(fvec4) Load 9(v) + 163: 7(fvec4) FAdd 162 161 + Store 9(v) 163 + 164: 7(fvec4) Load 9(v) + 165: 7(fvec4) Load 11(uv4) + 166: 7(fvec4) Load 11(uv4) + 167: 7(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 164 165 166 + 168: 7(fvec4) Load 9(v) + 169: 7(fvec4) FAdd 168 167 + Store 9(v) 169 + 170: 7(fvec4) Load 9(v) + 171: 7(fvec4) Load 9(v) + 172: 7(fvec4) Load 9(v) + 173: 7(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 170 171 172 + 174: 7(fvec4) Load 9(v) + 175: 7(fvec4) FAdd 174 173 + Store 9(v) 175 + 176: 7(fvec4) Load 9(v) + 177: 7(fvec4) Load 9(v) + 182: 179(bvec4) Load 181(ub41) + 183: 7(fvec4) Select 182 177 176 + 184: 7(fvec4) Load 9(v) + 185: 7(fvec4) FAdd 184 183 + Store 9(v) 185 + 186: 7(fvec4) Load 9(v) + 187: 7(fvec4) Load 9(v) + 189: 6(float) Load 188(f) + 190: 7(fvec4) CompositeConstruct 189 189 189 189 + 191: 7(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 186 187 190 + 192: 7(fvec4) Load 9(v) + 193: 7(fvec4) FAdd 192 191 + Store 9(v) 193 + 194: 7(fvec4) Load 9(v) + 195: 7(fvec4) Load 11(uv4) + 196: 7(fvec4) Load 9(v) + 197: 7(fvec4) ExtInst 1(GLSL.std.450) 50(Fma) 194 195 196 + 198: 7(fvec4) Load 9(v) + 199: 7(fvec4) FAdd 198 197 + Store 9(v) 199 + 200: 7(fvec4) Load 9(v) + 201: 7(fvec4) Load 9(v) + 202: 7(fvec4) ExtInst 1(GLSL.std.450) 48(Step) 200 201 + 203: 7(fvec4) Load 9(v) + 204: 7(fvec4) FAdd 203 202 + Store 9(v) 204 + 205: 7(fvec4) Load 9(v) + 206: 7(fvec4) Load 9(v) + 207: 7(fvec4) Load 9(v) + 208: 7(fvec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 205 206 207 + 209: 7(fvec4) Load 9(v) + 210: 7(fvec4) FAdd 209 208 + Store 9(v) 210 + 213: 6(float) Load 212(uf) + 214: 7(fvec4) Load 9(v) + 215: 7(fvec4) CompositeConstruct 213 213 213 213 + 216: 7(fvec4) ExtInst 1(GLSL.std.450) 48(Step) 215 214 + 217: 7(fvec4) Load 9(v) + 218: 7(fvec4) FAdd 217 216 + Store 9(v) 218 + 219: 6(float) Load 212(uf) + 220: 6(float) Load 212(uf) + 221: 7(fvec4) Load 9(v) + 222: 7(fvec4) CompositeConstruct 219 219 219 219 + 223: 7(fvec4) CompositeConstruct 220 220 220 220 + 224: 7(fvec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 222 223 221 + 225: 7(fvec4) Load 9(v) + 226: 7(fvec4) FAdd 225 224 + Store 9(v) 226 + 227: 7(fvec4) Load 9(v) + 228: 7(fvec4) ExtInst 1(GLSL.std.450) 69(Normalize) 227 + 229: 7(fvec4) Load 9(v) + 230: 7(fvec4) FAdd 229 228 + Store 9(v) 230 + 231: 7(fvec4) Load 9(v) + 232: 7(fvec4) Load 9(v) + 233: 7(fvec4) Load 9(v) + 234: 7(fvec4) ExtInst 1(GLSL.std.450) 70(FaceForward) 231 232 233 + 235: 7(fvec4) Load 9(v) + 236: 7(fvec4) FAdd 235 234 + Store 9(v) 236 + 237: 7(fvec4) Load 9(v) + 238: 7(fvec4) Load 9(v) + 239: 7(fvec4) ExtInst 1(GLSL.std.450) 71(Reflect) 237 238 + 240: 7(fvec4) Load 9(v) + 241: 7(fvec4) FAdd 240 239 + Store 9(v) 241 + 242: 7(fvec4) Load 9(v) + 243: 7(fvec4) Load 9(v) + 244: 6(float) Load 212(uf) + 245: 7(fvec4) ExtInst 1(GLSL.std.450) 72(Refract) 242 243 244 + 246: 7(fvec4) Load 9(v) + 247: 7(fvec4) FAdd 246 245 + Store 9(v) 247 + 248: 7(fvec4) Load 9(v) + 249: 7(fvec4) DPdx 248 + 250: 7(fvec4) Load 9(v) + 251: 7(fvec4) FAdd 250 249 + Store 9(v) 251 + 252: 7(fvec4) Load 9(v) + 253: 7(fvec4) DPdy 252 + 254: 7(fvec4) Load 9(v) + 255: 7(fvec4) FAdd 254 253 + Store 9(v) 255 + 256: 7(fvec4) Load 9(v) + 257: 7(fvec4) Fwidth 256 + 258: 7(fvec4) Load 9(v) + 259: 7(fvec4) FAdd 258 257 + Store 9(v) 259 + 260: 18(int) Load 22(ui) + 261: 18(int) ExtInst 1(GLSL.std.450) 5(SAbs) 260 + 262: 18(int) Load 20(i) + 263: 18(int) IAdd 262 261 + Store 20(i) 263 + 264: 18(int) Load 20(i) + 265: 18(int) ExtInst 1(GLSL.std.450) 7(SSign) 264 + 266: 18(int) Load 20(i) + 267: 18(int) IAdd 266 265 + Store 20(i) 267 + 268: 18(int) Load 20(i) + 269: 18(int) Load 22(ui) + 270: 18(int) ExtInst 1(GLSL.std.450) 39(SMin) 268 269 + 271: 18(int) Load 20(i) + 272: 18(int) IAdd 271 270 + Store 20(i) 272 + 273: 18(int) Load 20(i) + 274: 18(int) Load 22(ui) + 275: 18(int) ExtInst 1(GLSL.std.450) 42(SMax) 273 274 + 276: 18(int) Load 20(i) + 277: 18(int) IAdd 276 275 + Store 20(i) 277 + 278: 18(int) Load 20(i) + 279: 18(int) Load 22(ui) + 280: 18(int) Load 22(ui) + 281: 18(int) ExtInst 1(GLSL.std.450) 45(SClamp) 278 279 280 + 282: 18(int) Load 20(i) + 283: 18(int) IAdd 282 281 + Store 20(i) 283 + 286: 141(int) Load 285(u) + 289: 141(int) Load 288(uui) + 290: 141(int) ExtInst 1(GLSL.std.450) 38(UMin) 286 289 + 291: 141(int) Load 285(u) + 292: 141(int) IAdd 291 290 + Store 285(u) 292 + 293: 141(int) Load 285(u) + 294: 141(int) Load 288(uui) + 295: 141(int) ExtInst 1(GLSL.std.450) 41(UMax) 293 294 + 296: 141(int) Load 285(u) + 297: 141(int) IAdd 296 295 + Store 285(u) 297 + 298: 141(int) Load 285(u) + 299: 141(int) Load 288(uui) + 300: 141(int) Load 288(uui) + 301: 141(int) ExtInst 1(GLSL.std.450) 44(UClamp) 298 299 300 + 302: 141(int) Load 285(u) + 303: 141(int) IAdd 302 301 + Store 285(u) 303 + 306: 6(float) Load 212(uf) + 307: 178(bool) IsNan 306 + Store 305(b) 307 + 308: 6(float) Load 188(f) + 309: 178(bool) IsInf 308 + Store 305(b) 309 + 310: 7(fvec4) Load 9(v) + 311: 7(fvec4) Load 11(uv4) + 312: 179(bvec4) FOrdLessThan 310 311 + 313: 178(bool) Any 312 + Store 305(b) 313 + 314: 178(bool) Load 305(b) + SelectionMerge 316 None + BranchConditional 314 315 316 + 315: Label + 317: 7(fvec4) Load 9(v) + 318: 7(fvec4) Load 11(uv4) + 319: 179(bvec4) FOrdLessThanEqual 317 318 + 320: 178(bool) Any 319 + Branch 316 + 316: Label + 321: 178(bool) Phi 314 5 320 315 + Store 305(b) 321 + 322: 178(bool) Load 305(b) + SelectionMerge 324 None + BranchConditional 322 323 324 + 323: Label + 325: 7(fvec4) Load 9(v) + 326: 7(fvec4) Load 11(uv4) + 327: 179(bvec4) FOrdGreaterThan 325 326 + 328: 178(bool) Any 327 + Branch 324 + 324: Label + 329: 178(bool) Phi 322 316 328 323 + Store 305(b) 329 + 330: 178(bool) Load 305(b) + SelectionMerge 332 None + BranchConditional 330 331 332 + 331: Label + 333: 7(fvec4) Load 9(v) + 334: 7(fvec4) Load 11(uv4) + 335: 179(bvec4) FOrdGreaterThanEqual 333 334 + 336: 178(bool) Any 335 + Branch 332 + 332: Label + 337: 178(bool) Phi 330 324 336 331 + Store 305(b) 337 + 338: 178(bool) Load 305(b) + SelectionMerge 340 None + BranchConditional 338 339 340 + 339: Label + 341: 179(bvec4) Load 181(ub41) + 343: 179(bvec4) Load 342(ub42) + 344: 179(bvec4) LogicalEqual 341 343 + 345: 178(bool) Any 344 + Branch 340 + 340: Label + 346: 178(bool) Phi 338 332 345 339 + Store 305(b) 346 + 347: 178(bool) Load 305(b) + SelectionMerge 349 None + BranchConditional 347 348 349 + 348: Label + 350: 179(bvec4) Load 181(ub41) + 351: 179(bvec4) Load 342(ub42) + 352: 179(bvec4) LogicalNotEqual 350 351 + 353: 178(bool) Any 352 + Branch 349 + 349: Label + 354: 178(bool) Phi 347 340 353 348 + Store 305(b) 354 + 355: 178(bool) Load 305(b) + 356: 179(bvec4) Load 181(ub41) + 357: 178(bool) Any 356 + 358: 178(bool) LogicalAnd 355 357 + Store 305(b) 358 + 359: 178(bool) Load 305(b) + 360: 179(bvec4) Load 181(ub41) + 361: 178(bool) All 360 + 362: 178(bool) LogicalAnd 359 361 + Store 305(b) 362 + 363: 178(bool) Load 305(b) + SelectionMerge 365 None + BranchConditional 363 364 365 + 364: Label + 366: 179(bvec4) Load 181(ub41) + 367: 179(bvec4) LogicalNot 366 + 368: 178(bool) Any 367 + Branch 365 + 365: Label + 369: 178(bool) Phi 363 349 368 364 + Store 305(b) 369 + 370: 18(int) Load 20(i) + 371: 18(int) Load 22(ui) + 372: 18(int) IAdd 370 371 + 373: 18(int) Load 20(i) + 374: 18(int) IMul 372 373 + 375: 18(int) Load 22(ui) + 376: 18(int) ISub 374 375 + 377: 18(int) Load 20(i) + 378: 18(int) SDiv 376 377 + Store 20(i) 378 + 379: 18(int) Load 20(i) + 380: 18(int) Load 22(ui) + 381: 18(int) SMod 379 380 + Store 20(i) 381 + 382: 18(int) Load 20(i) + 383: 18(int) Load 22(ui) + 384: 178(bool) IEqual 382 383 + 385: 178(bool) LogicalNot 384 + SelectionMerge 387 None + BranchConditional 385 386 387 + 386: Label + 388: 18(int) Load 20(i) + 389: 18(int) Load 22(ui) + 390: 178(bool) INotEqual 388 389 + SelectionMerge 392 None + BranchConditional 390 391 392 + 391: Label + 393: 18(int) Load 20(i) + 394: 18(int) Load 22(ui) + 395: 178(bool) IEqual 393 394 + Branch 392 + 392: Label + 396: 178(bool) Phi 390 386 395 391 + 397: 18(int) Load 20(i) + 399: 178(bool) INotEqual 397 398 + 400: 178(bool) LogicalNotEqual 396 399 + Branch 387 + 387: Label + 401: 178(bool) Phi 384 365 400 392 + SelectionMerge 403 None + BranchConditional 401 402 403 + 402: Label + 404: 18(int) Load 20(i) + 406: 18(int) IAdd 404 405 + Store 20(i) 406 + Branch 403 + 403: Label + 407: 6(float) Load 212(uf) + 408: 6(float) Load 212(uf) + 409: 6(float) FAdd 407 408 + 410: 6(float) Load 212(uf) + 411: 6(float) FMul 409 410 + 412: 6(float) Load 212(uf) + 413: 6(float) FSub 411 412 + 414: 6(float) Load 212(uf) + 415: 6(float) FDiv 413 414 + Store 188(f) 415 + 416: 7(fvec4) Load 9(v) + 417: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 416 + 418: 6(float) Load 188(f) + 419: 6(float) FAdd 418 417 + Store 188(f) 419 + 420: 7(fvec4) Load 9(v) + 421: 7(fvec4) Load 9(v) + 422: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 420 421 + 423: 6(float) Load 188(f) + 424: 6(float) FAdd 423 422 + Store 188(f) 424 + 425: 7(fvec4) Load 9(v) + 426: 7(fvec4) Load 9(v) + 427: 6(float) Dot 425 426 + 428: 6(float) Load 188(f) + 429: 6(float) FAdd 428 427 + Store 188(f) 429 + 430: 6(float) Load 188(f) + 431: 6(float) Load 212(uf) + 432: 6(float) FMul 430 431 + 433: 6(float) Load 188(f) + 434: 6(float) FAdd 433 432 + Store 188(f) 434 + 436: 7(fvec4) Load 9(v) + 437: 435(fvec3) VectorShuffle 436 436 0 1 2 + 438: 7(fvec4) Load 9(v) + 439: 435(fvec3) VectorShuffle 438 438 0 1 2 + 440: 435(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 437 439 + 441: 6(float) CompositeExtract 440 0 + 442: 6(float) Load 188(f) + 443: 6(float) FAdd 442 441 + Store 188(f) 443 + 444: 6(float) Load 188(f) + 445: 6(float) Load 212(uf) + 446: 178(bool) FOrdEqual 444 445 + 447: 178(bool) LogicalNot 446 + SelectionMerge 449 None + BranchConditional 447 448 449 + 448: Label + 450: 6(float) Load 188(f) + 451: 6(float) Load 212(uf) + 452: 178(bool) FOrdNotEqual 450 451 + 453: 6(float) Load 188(f) + 455: 178(bool) FOrdNotEqual 453 454 + 456: 178(bool) LogicalAnd 452 455 + Branch 449 + 449: Label + 457: 178(bool) Phi 446 403 456 448 + SelectionMerge 459 None + BranchConditional 457 458 459 + 458: Label + 460: 6(float) Load 188(f) + 462: 6(float) FAdd 460 461 + Store 188(f) 462 + Branch 459 + 459: Label + 463: 18(int) Load 22(ui) + 464: 18(int) Load 20(i) + 465: 18(int) BitwiseAnd 464 463 + Store 20(i) 465 + 467: 18(int) Load 20(i) + 468: 18(int) BitwiseOr 467 466 + Store 20(i) 468 + 469: 18(int) Load 22(ui) + 470: 18(int) Load 20(i) + 471: 18(int) BitwiseXor 470 469 + Store 20(i) 471 + 473: 18(int) Load 20(i) + 474: 18(int) SMod 473 472 + Store 20(i) 474 + 475: 18(int) Load 20(i) + 476: 18(int) ShiftRightArithmetic 475 398 + Store 20(i) 476 + 477: 18(int) Load 22(ui) + 478: 18(int) Load 20(i) + 479: 18(int) ShiftLeftLogical 478 477 + Store 20(i) 479 + 480: 18(int) Load 20(i) + 481: 18(int) Not 480 + Store 20(i) 481 + 482: 178(bool) Load 305(b) + 483: 178(bool) LogicalNot 482 + Store 305(b) 483 + 486: 178(bool) Load 305(b) + SelectionMerge 489 None + BranchConditional 486 488 498 + 488: Label + 490: 18(int) Load 20(i) + 491: 6(float) ConvertSToF 490 + 492: 7(fvec4) CompositeConstruct 491 491 491 491 + 493: 6(float) Load 188(f) + 494: 7(fvec4) CompositeConstruct 493 493 493 493 + 495: 7(fvec4) FAdd 492 494 + 496: 7(fvec4) Load 9(v) + 497: 7(fvec4) FAdd 495 496 + Store 487 497 + Branch 489 + 498: Label + 499: 7(fvec4) Load 9(v) + Store 487 499 + Branch 489 + 489: Label + 500: 7(fvec4) Load 487 + Store 485(FragColor) 500 + Store 503(m1) 509 + Store 510(m2) 512 + 513: 178(bool) Load 305(b) + SelectionMerge 516 None + BranchConditional 513 515 518 + 515: Label + 517: 501 Load 503(m1) + Store 514 517 + Branch 516 + 518: Label + 519: 501 Load 510(m2) + Store 514 519 + Branch 516 + 516: Label + 520: 8(ptr) AccessChain 514 405 + 521: 7(fvec4) Load 520 + 522: 7(fvec4) Load 485(FragColor) + 523: 7(fvec4) FAdd 522 521 + Store 485(FragColor) 523 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.RayCallable.rcall.out b/deps/glslang/Test/baseResults/spv.RayCallable.rcall.out new file mode 100644 index 00000000..198d6860 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.RayCallable.rcall.out @@ -0,0 +1,73 @@ +spv.RayCallable.rcall +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 38 + + Capability RayTracingNV + Extension "SPV_NV_ray_tracing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint CallableNV 4 "main" 11 14 19 + Source GLSL 460 + SourceExtension "GL_NV_ray_tracing" + Name 4 "main" + Name 9 "id" + Name 11 "gl_LaunchIDNV" + Name 13 "size" + Name 14 "gl_LaunchSizeNV" + Name 17 "curFlags" + Name 19 "gl_IncomingRayFlagsNV" + Name 24 "dataBlock" + MemberName 24(dataBlock) 0 "data1" + Name 26 "" + Name 37 "data0" + Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV + Decorate 14(gl_LaunchSizeNV) BuiltIn LaunchSizeNV + Decorate 19(gl_IncomingRayFlagsNV) BuiltIn IncomingRayFlagsNV + Decorate 24(dataBlock) Block + Decorate 26 Location 1 + Decorate 37(data0) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 10: TypePointer Input 7(ivec3) +11(gl_LaunchIDNV): 10(ptr) Variable Input +14(gl_LaunchSizeNV): 10(ptr) Variable Input + 16: TypePointer Function 6(int) + 18: TypePointer Input 6(int) +19(gl_IncomingRayFlagsNV): 18(ptr) Variable Input + 22: 6(int) Constant 1 + 24(dataBlock): TypeStruct 6(int) + 25: TypePointer IncomingCallableDataNV 24(dataBlock) + 26: 25(ptr) Variable IncomingCallableDataNV + 27: TypeInt 32 1 + 28: 27(int) Constant 0 + 29: 6(int) Constant 256 + 30: TypePointer IncomingCallableDataNV 6(int) + 32: 6(int) Constant 2 + 33: 27(int) Constant 1 + 34: TypeFloat 32 + 35: TypeVector 34(float) 4 + 36: TypePointer CallableDataNV 35(fvec4) + 37(data0): 36(ptr) Variable CallableDataNV + 4(main): 2 Function None 3 + 5: Label + 9(id): 8(ptr) Variable Function + 13(size): 8(ptr) Variable Function + 17(curFlags): 16(ptr) Variable Function + 12: 7(ivec3) Load 11(gl_LaunchIDNV) + Store 9(id) 12 + 15: 7(ivec3) Load 14(gl_LaunchSizeNV) + Store 13(size) 15 + 20: 6(int) Load 19(gl_IncomingRayFlagsNV) + Store 17(curFlags) 20 + 21: 6(int) Load 17(curFlags) + 23: 6(int) BitwiseAnd 21 22 + Store 17(curFlags) 23 + 31: 30(ptr) AccessChain 26 28 + Store 31 29 + ExecuteCallableNV 32 33 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.RayCallable_Errors.rcall.out b/deps/glslang/Test/baseResults/spv.RayCallable_Errors.rcall.out new file mode 100644 index 00000000..a807a577 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.RayCallable_Errors.rcall.out @@ -0,0 +1,33 @@ +spv.RayCallable_Errors.rcall +ERROR: 0:3: 'hitAttributeNV' : not supported in this stage: callable +ERROR: 0:4: 'rayPayloadNV' : not supported in this stage: callable +ERROR: 0:5: 'rayPayloadInNV' : not supported in this stage: callable +ERROR: 0:9: 'gl_PrimitiveID' : undeclared identifier +ERROR: 0:9: '=' : cannot convert from ' temp float' to ' temp highp int' +ERROR: 0:10: 'gl_InstanceID' : undeclared identifier (Did you mean gl_InstanceIndex?) +ERROR: 0:10: '=' : cannot convert from ' temp float' to ' temp highp int' +ERROR: 0:11: 'gl_InstanceCustomIndexNV' : undeclared identifier +ERROR: 0:11: '=' : cannot convert from ' temp float' to ' temp highp int' +ERROR: 0:12: 'gl_WorldRayOriginNV' : undeclared identifier +ERROR: 0:12: '=' : cannot convert from ' temp float' to ' temp highp 3-component vector of float' +ERROR: 0:13: 'gl_WorldRayDirectionNV' : undeclared identifier +ERROR: 0:13: '=' : cannot convert from ' temp float' to ' temp highp 3-component vector of float' +ERROR: 0:14: 'gl_ObjectRayOriginNV' : undeclared identifier +ERROR: 0:14: '=' : cannot convert from ' temp float' to ' temp highp 3-component vector of float' +ERROR: 0:15: 'gl_ObjectRayDirectionNV' : undeclared identifier +ERROR: 0:15: '=' : cannot convert from ' temp float' to ' temp highp 3-component vector of float' +ERROR: 0:16: 'gl_RayTminNV' : undeclared identifier +ERROR: 0:17: 'gl_RayTmaxNV' : undeclared identifier +ERROR: 0:18: 'gl_ObjectToWorldNV' : undeclared identifier +ERROR: 0:18: '=' : cannot convert from ' temp float' to ' temp highp 4X3 matrix of float' +ERROR: 0:19: 'gl_WorldToObjectNV' : undeclared identifier +ERROR: 0:19: '=' : cannot convert from ' temp float' to ' temp highp 4X3 matrix of float' +ERROR: 0:20: 'gl_HitTNV' : undeclared identifier +ERROR: 0:21: 'gl_HitKindNV' : undeclared identifier +ERROR: 0:22: 'reportIntersectionNV' : no matching overloaded function found +ERROR: 0:23: 'ignoreIntersectionNV' : no matching overloaded function found +ERROR: 0:24: 'terminateRayNV' : no matching overloaded function found +ERROR: 28 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.RayConstants.rgen.out b/deps/glslang/Test/baseResults/spv.RayConstants.rgen.out new file mode 100644 index 00000000..d939acfb --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.RayConstants.rgen.out @@ -0,0 +1,46 @@ +spv.RayConstants.rgen +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 27 + + Capability RayTracingNV + Extension "SPV_NV_ray_tracing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint RayGenerationNV 4 "main" + Source GLSL 460 + SourceExtension "GL_NV_ray_tracing" + Name 4 "main" + Name 8 "accNV" + Name 26 "payload" + Decorate 8(accNV) DescriptorSet 0 + Decorate 8(accNV) Binding 0 + Decorate 26(payload) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeAccelerationStructureNV + 7: TypePointer UniformConstant 6 + 8(accNV): 7(ptr) Variable UniformConstant + 10: TypeInt 32 0 + 11: 10(int) Constant 255 + 12: 10(int) Constant 0 + 13: 10(int) Constant 1 + 14: TypeFloat 32 + 15: TypeVector 14(float) 3 + 16: 14(float) Constant 0 + 17: 15(fvec3) ConstantComposite 16 16 16 + 18: 14(float) Constant 1056964608 + 19: 14(float) Constant 1065353216 + 20: 15(fvec3) ConstantComposite 19 19 19 + 21: 14(float) Constant 1061158912 + 22: TypeInt 32 1 + 23: 22(int) Constant 1 + 24: TypeVector 14(float) 4 + 25: TypePointer RayPayloadNV 24(fvec4) + 26(payload): 25(ptr) Variable RayPayloadNV + 4(main): 2 Function None 3 + 5: Label + 9: 6 Load 8(accNV) + TraceNV 9 11 12 13 13 12 17 18 20 21 23 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.RayGenShader.rgen.out b/deps/glslang/Test/baseResults/spv.RayGenShader.rgen.out new file mode 100644 index 00000000..db6ecfc9 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.RayGenShader.rgen.out @@ -0,0 +1,101 @@ +spv.RayGenShader.rgen +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 60 + + Capability RayTracingNV + Extension "SPV_NV_ray_tracing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint RayGenerationNV 4 "main" 11 21 + Source GLSL 460 + SourceExtension "GL_NV_ray_tracing" + Name 4 "main" + Name 8 "lx" + Name 11 "gl_LaunchIDNV" + Name 16 "ly" + Name 20 "sx" + Name 21 "gl_LaunchSizeNV" + Name 24 "sy" + Name 29 "accNV" + Name 48 "block" + MemberName 48(block) 0 "arr" + MemberName 48(block) 1 "pad" + Name 50 "" + Name 56 "payload" + Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV + Decorate 21(gl_LaunchSizeNV) BuiltIn LaunchSizeNV + Decorate 29(accNV) DescriptorSet 0 + Decorate 29(accNV) Binding 0 + Decorate 46 ArrayStride 4 + MemberDecorate 48(block) 0 Offset 0 + MemberDecorate 48(block) 1 Offset 16 + Decorate 48(block) BufferBlock + Decorate 56(payload) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypeVector 6(int) 3 + 10: TypePointer Input 9(ivec3) +11(gl_LaunchIDNV): 10(ptr) Variable Input + 12: 6(int) Constant 0 + 13: TypePointer Input 6(int) + 17: 6(int) Constant 1 +21(gl_LaunchSizeNV): 10(ptr) Variable Input + 27: TypeAccelerationStructureNV + 28: TypePointer UniformConstant 27 + 29(accNV): 28(ptr) Variable UniformConstant + 35: TypeFloat 32 + 36: TypeVector 35(float) 3 + 37: 35(float) Constant 0 + 38: 36(fvec3) ConstantComposite 37 37 37 + 39: 35(float) Constant 1056964608 + 40: 35(float) Constant 1065353216 + 41: 36(fvec3) ConstantComposite 40 40 40 + 42: 35(float) Constant 1061158912 + 43: TypeInt 32 1 + 44: 43(int) Constant 1 + 45: 6(int) Constant 4 + 46: TypeArray 35(float) 45 + 47: TypeVector 35(float) 4 + 48(block): TypeStruct 46 47(fvec4) + 49: TypePointer ShaderRecordBufferNV 48(block) + 50: 49(ptr) Variable ShaderRecordBufferNV + 51: 43(int) Constant 0 + 52: 43(int) Constant 3 + 53: TypePointer ShaderRecordBufferNV 35(float) + 55: TypePointer RayPayloadNV 47(fvec4) + 56(payload): 55(ptr) Variable RayPayloadNV + 58: TypePointer ShaderRecordBufferNV 47(fvec4) + 4(main): 2 Function None 3 + 5: Label + 8(lx): 7(ptr) Variable Function + 16(ly): 7(ptr) Variable Function + 20(sx): 7(ptr) Variable Function + 24(sy): 7(ptr) Variable Function + 14: 13(ptr) AccessChain 11(gl_LaunchIDNV) 12 + 15: 6(int) Load 14 + Store 8(lx) 15 + 18: 13(ptr) AccessChain 11(gl_LaunchIDNV) 17 + 19: 6(int) Load 18 + Store 16(ly) 19 + 22: 13(ptr) AccessChain 21(gl_LaunchSizeNV) 12 + 23: 6(int) Load 22 + Store 20(sx) 23 + 25: 13(ptr) AccessChain 21(gl_LaunchSizeNV) 17 + 26: 6(int) Load 25 + Store 24(sy) 26 + 30: 27 Load 29(accNV) + 31: 6(int) Load 8(lx) + 32: 6(int) Load 16(ly) + 33: 6(int) Load 20(sx) + 34: 6(int) Load 24(sy) + TraceNV 30 31 32 33 34 12 38 39 41 42 44 + 54: 53(ptr) AccessChain 50 51 52 + Store 54 40 + 57: 47(fvec4) Load 56(payload) + 59: 58(ptr) AccessChain 50 44 + Store 59 57 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.RayGenShader_Errors.rgen.out b/deps/glslang/Test/baseResults/spv.RayGenShader_Errors.rgen.out new file mode 100644 index 00000000..27d51c22 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.RayGenShader_Errors.rgen.out @@ -0,0 +1,39 @@ +spv.RayGenShader_Errors.rgen +ERROR: 0:3: 'hitAttributeNV' : not supported in this stage: ray-generation +ERROR: 0:4: 'rayPayloadInNV' : not supported in this stage: ray-generation +ERROR: 0:5: 'shaderRecordNV' : can only be used with a buffer +ERROR: 0:9: 'binding' : cannot be used with shaderRecordNV +ERROR: 0:12: 'set' : cannot be used with shaderRecordNV +ERROR: 0:23: 'accelerationStructureNV' : accelerationStructureNV can only be used in uniform variables or function parameters: a +ERROR: 0:23: '=' : cannot convert from ' const int' to ' temp accelerationStructureNV' +ERROR: 0:24: 'gl_PrimitiveID' : undeclared identifier +ERROR: 0:24: '=' : cannot convert from ' temp float' to ' temp highp int' +ERROR: 0:25: 'gl_InstanceID' : undeclared identifier (Did you mean gl_InstanceIndex?) +ERROR: 0:25: '=' : cannot convert from ' temp float' to ' temp highp int' +ERROR: 0:26: 'gl_InstanceCustomIndexNV' : undeclared identifier +ERROR: 0:26: '=' : cannot convert from ' temp float' to ' temp highp int' +ERROR: 0:27: 'gl_WorldRayOriginNV' : undeclared identifier +ERROR: 0:27: '=' : cannot convert from ' temp float' to ' temp highp 3-component vector of float' +ERROR: 0:28: 'gl_WorldRayDirectionNV' : undeclared identifier +ERROR: 0:28: '=' : cannot convert from ' temp float' to ' temp highp 3-component vector of float' +ERROR: 0:29: 'gl_ObjectRayOriginNV' : undeclared identifier +ERROR: 0:29: '=' : cannot convert from ' temp float' to ' temp highp 3-component vector of float' +ERROR: 0:30: 'gl_ObjectRayDirectionNV' : undeclared identifier +ERROR: 0:30: '=' : cannot convert from ' temp float' to ' temp highp 3-component vector of float' +ERROR: 0:31: 'gl_RayTminNV' : undeclared identifier +ERROR: 0:32: 'gl_RayTmaxNV' : undeclared identifier +ERROR: 0:33: 'gl_ObjectToWorldNV' : undeclared identifier +ERROR: 0:33: '=' : cannot convert from ' temp float' to ' temp highp 4X3 matrix of float' +ERROR: 0:34: 'gl_WorldToObjectNV' : undeclared identifier +ERROR: 0:34: '=' : cannot convert from ' temp float' to ' temp highp 4X3 matrix of float' +ERROR: 0:35: 'gl_HitTNV' : undeclared identifier +ERROR: 0:36: 'gl_HitKindNV' : undeclared identifier +ERROR: 0:37: 'reportIntersectionNV' : no matching overloaded function found +ERROR: 0:38: 'ignoreIntersectionNV' : no matching overloaded function found +ERROR: 0:39: 'terminateRayNV' : no matching overloaded function found +ERROR: 32 compilation errors. No code generated. + + +ERROR: Linking ray-generation stage: Only one shaderRecordNV buffer block is allowed per stage + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.accessChain.frag.out b/deps/glslang/Test/baseResults/spv.accessChain.frag.out new file mode 100644 index 00000000..bf878292 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.accessChain.frag.out @@ -0,0 +1,351 @@ +spv.accessChain.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 222 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 69 170 + ExecutionMode 4 OriginUpperLeft + Source GLSL 420 + Name 4 "main" + Name 8 "S" + MemberName 8(S) 0 "color" + Name 11 "GetColor1(struct-S-vf31;" + Name 10 "i" + Name 18 "GetColor2(struct-S-vf31;i1;" + Name 16 "i" + Name 17 "comp" + Name 22 "GetColor3(struct-S-vf31;i1;" + Name 20 "i" + Name 21 "comp" + Name 26 "GetColor4(struct-S-vf31;i1;" + Name 24 "i" + Name 25 "comp" + Name 30 "GetColor5(struct-S-vf31;i1;" + Name 28 "i" + Name 29 "comp" + Name 34 "GetColor6(struct-S-vf31;i1;" + Name 32 "i" + Name 33 "comp" + Name 38 "GetColor7(struct-S-vf31;i1;" + Name 36 "i" + Name 37 "comp" + Name 42 "GetColor8(struct-S-vf31;i1;" + Name 40 "i" + Name 41 "comp" + Name 46 "GetColor9(struct-S-vf31;i1;" + Name 44 "i" + Name 45 "comp" + Name 50 "GetColor10(struct-S-vf31;i1;" + Name 48 "i" + Name 49 "comp" + Name 54 "GetColor11(struct-S-vf31;i1;" + Name 52 "i" + Name 53 "comp" + Name 58 "GetColor12(struct-S-vf31;i1;" + Name 56 "i" + Name 57 "comp" + Name 62 "GetColor13(struct-S-vf31;i1;" + Name 60 "i" + Name 61 "comp" + Name 66 "GetColor14(struct-S-vf31;i1;" + Name 64 "i" + Name 65 "comp" + Name 69 "OutColor" + Name 165 "s" + Name 170 "u" + Name 171 "param" + Name 175 "param" + Name 179 "param" + Name 183 "param" + Name 187 "param" + Name 191 "param" + Name 195 "param" + Name 199 "param" + Name 203 "param" + Name 207 "param" + Name 211 "param" + Name 215 "param" + Name 219 "param" + Decorate 69(OutColor) Location 0 + Decorate 170(u) Flat + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8(S): TypeStruct 7(fvec3) + 9: TypeFunction 2 8(S) + 13: TypeInt 32 1 + 14: TypePointer Function 13(int) + 15: TypeFunction 2 8(S) 14(ptr) + 68: TypePointer Output 7(fvec3) + 69(OutColor): 68(ptr) Variable Output + 70: 13(int) Constant 0 + 71: TypeInt 32 0 + 72: 71(int) Constant 0 + 99: TypeVector 6(float) 2 + 113: 71(int) Constant 2 + 140: TypePointer Output 6(float) + 147: 71(int) Constant 1 + 148: TypeVector 71(int) 2 + 149: 148(ivec2) ConstantComposite 113 147 + 158: TypeVector 71(int) 3 + 159: 158(ivec3) ConstantComposite 113 147 72 + 162: 6(float) Constant 0 + 163: 7(fvec3) ConstantComposite 162 162 162 + 164: TypePointer Function 8(S) + 169: TypePointer Input 13(int) + 170(u): 169(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 165(s): 164(ptr) Variable Function + 171(param): 14(ptr) Variable Function + 175(param): 14(ptr) Variable Function + 179(param): 14(ptr) Variable Function + 183(param): 14(ptr) Variable Function + 187(param): 14(ptr) Variable Function + 191(param): 14(ptr) Variable Function + 195(param): 14(ptr) Variable Function + 199(param): 14(ptr) Variable Function + 203(param): 14(ptr) Variable Function + 207(param): 14(ptr) Variable Function + 211(param): 14(ptr) Variable Function + 215(param): 14(ptr) Variable Function + 219(param): 14(ptr) Variable Function + Store 69(OutColor) 163 + 166: 8(S) Load 165(s) + 167: 2 FunctionCall 11(GetColor1(struct-S-vf31;) 166 + 168: 8(S) Load 165(s) + 172: 13(int) Load 170(u) + Store 171(param) 172 + 173: 2 FunctionCall 18(GetColor2(struct-S-vf31;i1;) 168 171(param) + 174: 8(S) Load 165(s) + 176: 13(int) Load 170(u) + Store 175(param) 176 + 177: 2 FunctionCall 22(GetColor3(struct-S-vf31;i1;) 174 175(param) + 178: 8(S) Load 165(s) + 180: 13(int) Load 170(u) + Store 179(param) 180 + 181: 2 FunctionCall 26(GetColor4(struct-S-vf31;i1;) 178 179(param) + 182: 8(S) Load 165(s) + 184: 13(int) Load 170(u) + Store 183(param) 184 + 185: 2 FunctionCall 30(GetColor5(struct-S-vf31;i1;) 182 183(param) + 186: 8(S) Load 165(s) + 188: 13(int) Load 170(u) + Store 187(param) 188 + 189: 2 FunctionCall 34(GetColor6(struct-S-vf31;i1;) 186 187(param) + 190: 8(S) Load 165(s) + 192: 13(int) Load 170(u) + Store 191(param) 192 + 193: 2 FunctionCall 38(GetColor7(struct-S-vf31;i1;) 190 191(param) + 194: 8(S) Load 165(s) + 196: 13(int) Load 170(u) + Store 195(param) 196 + 197: 2 FunctionCall 42(GetColor8(struct-S-vf31;i1;) 194 195(param) + 198: 8(S) Load 165(s) + 200: 13(int) Load 170(u) + Store 199(param) 200 + 201: 2 FunctionCall 46(GetColor9(struct-S-vf31;i1;) 198 199(param) + 202: 8(S) Load 165(s) + 204: 13(int) Load 170(u) + Store 203(param) 204 + 205: 2 FunctionCall 50(GetColor10(struct-S-vf31;i1;) 202 203(param) + 206: 8(S) Load 165(s) + 208: 13(int) Load 170(u) + Store 207(param) 208 + 209: 2 FunctionCall 54(GetColor11(struct-S-vf31;i1;) 206 207(param) + 210: 8(S) Load 165(s) + 212: 13(int) Load 170(u) + Store 211(param) 212 + 213: 2 FunctionCall 58(GetColor12(struct-S-vf31;i1;) 210 211(param) + 214: 8(S) Load 165(s) + 216: 13(int) Load 170(u) + Store 215(param) 216 + 217: 2 FunctionCall 62(GetColor13(struct-S-vf31;i1;) 214 215(param) + 218: 8(S) Load 165(s) + 220: 13(int) Load 170(u) + Store 219(param) 220 + 221: 2 FunctionCall 66(GetColor14(struct-S-vf31;i1;) 218 219(param) + Return + FunctionEnd +11(GetColor1(struct-S-vf31;): 2 Function None 9 + 10(i): 8(S) FunctionParameter + 12: Label + 73: 6(float) CompositeExtract 10(i) 0 0 + 74: 7(fvec3) Load 69(OutColor) + 75: 7(fvec3) CompositeConstruct 73 73 73 + 76: 7(fvec3) FAdd 74 75 + Store 69(OutColor) 76 + Return + FunctionEnd +18(GetColor2(struct-S-vf31;i1;): 2 Function None 15 + 16(i): 8(S) FunctionParameter + 17(comp): 14(ptr) FunctionParameter + 19: Label + 77: 13(int) Load 17(comp) + 78: 7(fvec3) CompositeExtract 16(i) 0 + 79: 6(float) VectorExtractDynamic 78 77 + 80: 7(fvec3) Load 69(OutColor) + 81: 7(fvec3) CompositeConstruct 79 79 79 + 82: 7(fvec3) FAdd 80 81 + Store 69(OutColor) 82 + Return + FunctionEnd +22(GetColor3(struct-S-vf31;i1;): 2 Function None 15 + 20(i): 8(S) FunctionParameter + 21(comp): 14(ptr) FunctionParameter + 23: Label + 83: 13(int) Load 21(comp) + 84: 7(fvec3) CompositeExtract 20(i) 0 + 85: 6(float) VectorExtractDynamic 84 83 + 86: 7(fvec3) Load 69(OutColor) + 87: 7(fvec3) CompositeConstruct 85 85 85 + 88: 7(fvec3) FAdd 86 87 + Store 69(OutColor) 88 + Return + FunctionEnd +26(GetColor4(struct-S-vf31;i1;): 2 Function None 15 + 24(i): 8(S) FunctionParameter + 25(comp): 14(ptr) FunctionParameter + 27: Label + 89: 13(int) Load 25(comp) + 90: 7(fvec3) CompositeExtract 24(i) 0 + 91: 6(float) VectorExtractDynamic 90 89 + 92: 7(fvec3) Load 69(OutColor) + 93: 7(fvec3) CompositeConstruct 91 91 91 + 94: 7(fvec3) FAdd 92 93 + Store 69(OutColor) 94 + Return + FunctionEnd +30(GetColor5(struct-S-vf31;i1;): 2 Function None 15 + 28(i): 8(S) FunctionParameter + 29(comp): 14(ptr) FunctionParameter + 31: Label + 95: 7(fvec3) CompositeExtract 28(i) 0 + 96: 7(fvec3) Load 69(OutColor) + 97: 7(fvec3) FAdd 96 95 + Store 69(OutColor) 97 + Return + FunctionEnd +34(GetColor6(struct-S-vf31;i1;): 2 Function None 15 + 32(i): 8(S) FunctionParameter + 33(comp): 14(ptr) FunctionParameter + 35: Label + 98: 13(int) Load 33(comp) + 100: 7(fvec3) CompositeExtract 32(i) 0 + 101: 99(fvec2) VectorShuffle 100 100 1 0 + 102: 6(float) VectorExtractDynamic 101 98 + 103: 7(fvec3) Load 69(OutColor) + 104: 7(fvec3) CompositeConstruct 102 102 102 + 105: 7(fvec3) FAdd 103 104 + Store 69(OutColor) 105 + Return + FunctionEnd +38(GetColor7(struct-S-vf31;i1;): 2 Function None 15 + 36(i): 8(S) FunctionParameter + 37(comp): 14(ptr) FunctionParameter + 39: Label + 106: 7(fvec3) CompositeExtract 36(i) 0 + 107: 99(fvec2) VectorShuffle 106 106 0 1 + 108: 7(fvec3) Load 69(OutColor) + 109: 99(fvec2) VectorShuffle 108 108 0 1 + 110: 99(fvec2) FAdd 109 107 + 111: 7(fvec3) Load 69(OutColor) + 112: 7(fvec3) VectorShuffle 111 110 3 4 2 + Store 69(OutColor) 112 + Return + FunctionEnd +42(GetColor8(struct-S-vf31;i1;): 2 Function None 15 + 40(i): 8(S) FunctionParameter + 41(comp): 14(ptr) FunctionParameter + 43: Label + 114: 6(float) CompositeExtract 40(i) 0 2 + 115: 7(fvec3) Load 69(OutColor) + 116: 7(fvec3) CompositeConstruct 114 114 114 + 117: 7(fvec3) FAdd 115 116 + Store 69(OutColor) 117 + Return + FunctionEnd +46(GetColor9(struct-S-vf31;i1;): 2 Function None 15 + 44(i): 8(S) FunctionParameter + 45(comp): 14(ptr) FunctionParameter + 47: Label + 118: 7(fvec3) CompositeExtract 44(i) 0 + 119: 7(fvec3) Load 69(OutColor) + 120: 7(fvec3) VectorShuffle 119 119 2 0 1 + 121: 7(fvec3) FAdd 120 118 + 122: 7(fvec3) Load 69(OutColor) + 123: 7(fvec3) VectorShuffle 122 121 4 5 3 + Store 69(OutColor) 123 + Return + FunctionEnd +50(GetColor10(struct-S-vf31;i1;): 2 Function None 15 + 48(i): 8(S) FunctionParameter + 49(comp): 14(ptr) FunctionParameter + 51: Label + 124: 7(fvec3) CompositeExtract 48(i) 0 + 125: 99(fvec2) VectorShuffle 124 124 0 1 + 126: 7(fvec3) Load 69(OutColor) + 127: 99(fvec2) VectorShuffle 126 126 2 1 + 128: 99(fvec2) FAdd 127 125 + 129: 7(fvec3) Load 69(OutColor) + 130: 7(fvec3) VectorShuffle 129 128 0 4 3 + Store 69(OutColor) 130 + Return + FunctionEnd +54(GetColor11(struct-S-vf31;i1;): 2 Function None 15 + 52(i): 8(S) FunctionParameter + 53(comp): 14(ptr) FunctionParameter + 55: Label + 131: 7(fvec3) CompositeExtract 52(i) 0 + 132: 99(fvec2) VectorShuffle 131 131 0 1 + 133: 7(fvec3) Load 69(OutColor) + 134: 99(fvec2) VectorShuffle 133 133 0 2 + 135: 99(fvec2) FAdd 134 132 + 136: 7(fvec3) Load 69(OutColor) + 137: 7(fvec3) VectorShuffle 136 135 3 1 4 + Store 69(OutColor) 137 + Return + FunctionEnd +58(GetColor12(struct-S-vf31;i1;): 2 Function None 15 + 56(i): 8(S) FunctionParameter + 57(comp): 14(ptr) FunctionParameter + 59: Label + 138: 13(int) Load 57(comp) + 139: 6(float) CompositeExtract 56(i) 0 0 + 141: 140(ptr) AccessChain 69(OutColor) 138 + 142: 6(float) Load 141 + 143: 6(float) FAdd 142 139 + 144: 140(ptr) AccessChain 69(OutColor) 138 + Store 144 143 + Return + FunctionEnd +62(GetColor13(struct-S-vf31;i1;): 2 Function None 15 + 60(i): 8(S) FunctionParameter + 61(comp): 14(ptr) FunctionParameter + 63: Label + 145: 13(int) Load 61(comp) + 146: 6(float) CompositeExtract 60(i) 0 0 + 150: 71(int) VectorExtractDynamic 149 145 + 151: 140(ptr) AccessChain 69(OutColor) 150 + 152: 6(float) Load 151 + 153: 6(float) FAdd 152 146 + 154: 71(int) VectorExtractDynamic 149 145 + 155: 140(ptr) AccessChain 69(OutColor) 154 + Store 155 153 + Return + FunctionEnd +66(GetColor14(struct-S-vf31;i1;): 2 Function None 15 + 64(i): 8(S) FunctionParameter + 65(comp): 14(ptr) FunctionParameter + 67: Label + 156: 13(int) Load 65(comp) + 157: 6(float) CompositeExtract 64(i) 0 0 + 160: 71(int) VectorExtractDynamic 159 156 + 161: 140(ptr) AccessChain 69(OutColor) 160 + Store 161 157 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.aggOps.frag.out b/deps/glslang/Test/baseResults/spv.aggOps.frag.out new file mode 100644 index 00000000..1c0c7e91 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.aggOps.frag.out @@ -0,0 +1,312 @@ +spv.aggOps.frag +WARNING: 0:4: '' : all default precisions are highp; use precision statements to quiet warning, e.g.: + "precision mediump int; precision highp float;" + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 215 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 16 41 101 213 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 8 "s1" + MemberName 8(s1) 0 "i" + MemberName 8(s1) 1 "f" + Name 13 "a" + Name 16 "u" + Name 37 "b" + Name 41 "w" + Name 55 "s1" + MemberName 55(s1) 0 "i" + MemberName 55(s1) 1 "f" + Name 56 "s2" + MemberName 56(s2) 0 "i" + MemberName 56(s2) 1 "f" + MemberName 56(s2) 2 "s1_1" + Name 57 "ub1" + MemberName 57(ub1) 0 "foo2a" + Name 59 "uName1" + Name 64 "s1" + MemberName 64(s1) 0 "i" + MemberName 64(s1) 1 "f" + Name 65 "s2" + MemberName 65(s2) 0 "i" + MemberName 65(s2) 1 "f" + MemberName 65(s2) 2 "s1_1" + Name 66 "ub2" + MemberName 66(ub2) 0 "foo2b" + Name 68 "uName2" + Name 93 "v" + Name 97 "samp2D" + Name 101 "coord" + Name 213 "color" + MemberDecorate 55(s1) 0 Offset 0 + MemberDecorate 55(s1) 1 Offset 4 + MemberDecorate 56(s2) 0 Offset 0 + MemberDecorate 56(s2) 1 Offset 4 + MemberDecorate 56(s2) 2 Offset 16 + MemberDecorate 57(ub1) 0 Offset 0 + Decorate 57(ub1) Block + Decorate 59(uName1) DescriptorSet 0 + MemberDecorate 64(s1) 0 Offset 0 + MemberDecorate 64(s1) 1 Offset 4 + MemberDecorate 65(s2) 0 Offset 0 + MemberDecorate 65(s2) 1 Offset 4 + MemberDecorate 65(s2) 2 Offset 8 + MemberDecorate 66(ub2) 0 Offset 0 + Decorate 66(ub2) BufferBlock + Decorate 68(uName2) DescriptorSet 0 + Decorate 97(samp2D) DescriptorSet 0 + Decorate 101(coord) RelaxedPrecision + Decorate 102 RelaxedPrecision + Decorate 107 RelaxedPrecision + Decorate 108 RelaxedPrecision + Decorate 129 RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeFloat 32 + 8(s1): TypeStruct 6(int) 7(float) + 9: TypeInt 32 0 + 10: 9(int) Constant 3 + 11: TypeArray 8(s1) 10 + 12: TypePointer Function 11 + 14: TypeVector 7(float) 4 + 15: TypePointer Input 14(fvec4) + 16(u): 15(ptr) Variable Input + 17: 9(int) Constant 0 + 18: TypePointer Input 7(float) + 22: 9(int) Constant 1 + 26: 9(int) Constant 2 + 33: 6(int) Constant 14 + 34: 7(float) Constant 1096810496 + 35: 8(s1) ConstantComposite 33 34 + 38: 6(int) Constant 17 + 39: 7(float) Constant 1099431936 + 40: 8(s1) ConstantComposite 38 39 + 41(w): 15(ptr) Variable Input + 55(s1): TypeStruct 6(int) 7(float) + 56(s2): TypeStruct 6(int) 7(float) 55(s1) + 57(ub1): TypeStruct 56(s2) + 58: TypePointer Uniform 57(ub1) + 59(uName1): 58(ptr) Variable Uniform + 60: 6(int) Constant 0 + 61: TypePointer Uniform 56(s2) + 64(s1): TypeStruct 6(int) 7(float) + 65(s2): TypeStruct 6(int) 7(float) 64(s1) + 66(ub2): TypeStruct 65(s2) + 67: TypePointer Uniform 66(ub2) + 68(uName2): 67(ptr) Variable Uniform + 69: TypePointer Uniform 65(s2) + 72: TypeBool + 92: TypePointer Function 14(fvec4) + 94: TypeImage 7(float) 2D sampled format:Unknown + 95: TypeSampledImage 94 + 96: TypePointer UniformConstant 95 + 97(samp2D): 96(ptr) Variable UniformConstant + 99: TypeVector 7(float) 2 + 100: TypePointer Input 99(fvec2) + 101(coord): 100(ptr) Variable Input + 106: 7(float) Constant 1073741824 + 112: TypeVector 72(bool) 4 + 117: 7(float) Constant 1077936128 + 126: 7(float) Constant 1082130432 + 132: TypeVector 72(bool) 2 + 137: 7(float) Constant 1084227584 + 173: 7(float) Constant 1086324736 + 209: 7(float) Constant 1088421888 + 212: TypePointer Output 14(fvec4) + 213(color): 212(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 13(a): 12(ptr) Variable Function + 37(b): 12(ptr) Variable Function + 93(v): 92(ptr) Variable Function + 19: 18(ptr) AccessChain 16(u) 17 + 20: 7(float) Load 19 + 21: 6(int) ConvertFToS 20 + 23: 18(ptr) AccessChain 16(u) 22 + 24: 7(float) Load 23 + 25: 8(s1) CompositeConstruct 21 24 + 27: 18(ptr) AccessChain 16(u) 26 + 28: 7(float) Load 27 + 29: 6(int) ConvertFToS 28 + 30: 18(ptr) AccessChain 16(u) 10 + 31: 7(float) Load 30 + 32: 8(s1) CompositeConstruct 29 31 + 36: 11 CompositeConstruct 25 32 35 + Store 13(a) 36 + 42: 18(ptr) AccessChain 41(w) 17 + 43: 7(float) Load 42 + 44: 6(int) ConvertFToS 43 + 45: 18(ptr) AccessChain 41(w) 22 + 46: 7(float) Load 45 + 47: 8(s1) CompositeConstruct 44 46 + 48: 18(ptr) AccessChain 41(w) 26 + 49: 7(float) Load 48 + 50: 6(int) ConvertFToS 49 + 51: 18(ptr) AccessChain 41(w) 10 + 52: 7(float) Load 51 + 53: 8(s1) CompositeConstruct 50 52 + 54: 11 CompositeConstruct 40 47 53 + Store 37(b) 54 + 62: 61(ptr) AccessChain 59(uName1) 60 + 63: 56(s2) Load 62 + 70: 69(ptr) AccessChain 68(uName2) 60 + 71: 65(s2) Load 70 + 73: 6(int) CompositeExtract 63 0 + 74: 6(int) CompositeExtract 71 0 + 75: 72(bool) IEqual 73 74 + 76: 7(float) CompositeExtract 63 1 + 77: 7(float) CompositeExtract 71 1 + 78: 72(bool) FOrdEqual 76 77 + 79: 72(bool) LogicalAnd 75 78 + 80: 55(s1) CompositeExtract 63 2 + 81: 64(s1) CompositeExtract 71 2 + 82: 6(int) CompositeExtract 80 0 + 83: 6(int) CompositeExtract 81 0 + 84: 72(bool) IEqual 82 83 + 85: 7(float) CompositeExtract 80 1 + 86: 7(float) CompositeExtract 81 1 + 87: 72(bool) FOrdEqual 85 86 + 88: 72(bool) LogicalAnd 84 87 + 89: 72(bool) LogicalAnd 79 88 + SelectionMerge 91 None + BranchConditional 89 90 104 + 90: Label + 98: 95 Load 97(samp2D) + 102: 99(fvec2) Load 101(coord) + 103: 14(fvec4) ImageSampleImplicitLod 98 102 + Store 93(v) 103 + Branch 91 + 104: Label + 105: 95 Load 97(samp2D) + 107: 99(fvec2) Load 101(coord) + 108: 99(fvec2) VectorTimesScalar 107 106 + 109: 14(fvec4) ImageSampleImplicitLod 105 108 + Store 93(v) 109 + Branch 91 + 91: Label + 110: 14(fvec4) Load 16(u) + 111: 14(fvec4) Load 93(v) + 113: 112(bvec4) FOrdEqual 110 111 + 114: 72(bool) All 113 + SelectionMerge 116 None + BranchConditional 114 115 116 + 115: Label + 118: 14(fvec4) Load 93(v) + 119: 14(fvec4) VectorTimesScalar 118 117 + Store 93(v) 119 + Branch 116 + 116: Label + 120: 14(fvec4) Load 16(u) + 121: 14(fvec4) Load 93(v) + 122: 112(bvec4) FOrdNotEqual 120 121 + 123: 72(bool) Any 122 + SelectionMerge 125 None + BranchConditional 123 124 125 + 124: Label + 127: 14(fvec4) Load 93(v) + 128: 14(fvec4) VectorTimesScalar 127 126 + Store 93(v) 128 + Branch 125 + 125: Label + 129: 99(fvec2) Load 101(coord) + 130: 14(fvec4) Load 93(v) + 131: 99(fvec2) VectorShuffle 130 130 1 3 + 133: 132(bvec2) FOrdEqual 129 131 + 134: 72(bool) All 133 + SelectionMerge 136 None + BranchConditional 134 135 136 + 135: Label + 138: 14(fvec4) Load 93(v) + 139: 14(fvec4) VectorTimesScalar 138 137 + Store 93(v) 139 + Branch 136 + 136: Label + 140: 11 Load 13(a) + 141: 11 Load 37(b) + 142: 8(s1) CompositeExtract 140 0 + 143: 8(s1) CompositeExtract 141 0 + 144: 6(int) CompositeExtract 142 0 + 145: 6(int) CompositeExtract 143 0 + 146: 72(bool) IEqual 144 145 + 147: 7(float) CompositeExtract 142 1 + 148: 7(float) CompositeExtract 143 1 + 149: 72(bool) FOrdEqual 147 148 + 150: 72(bool) LogicalAnd 146 149 + 151: 8(s1) CompositeExtract 140 1 + 152: 8(s1) CompositeExtract 141 1 + 153: 6(int) CompositeExtract 151 0 + 154: 6(int) CompositeExtract 152 0 + 155: 72(bool) IEqual 153 154 + 156: 7(float) CompositeExtract 151 1 + 157: 7(float) CompositeExtract 152 1 + 158: 72(bool) FOrdEqual 156 157 + 159: 72(bool) LogicalAnd 155 158 + 160: 72(bool) LogicalAnd 150 159 + 161: 8(s1) CompositeExtract 140 2 + 162: 8(s1) CompositeExtract 141 2 + 163: 6(int) CompositeExtract 161 0 + 164: 6(int) CompositeExtract 162 0 + 165: 72(bool) IEqual 163 164 + 166: 7(float) CompositeExtract 161 1 + 167: 7(float) CompositeExtract 162 1 + 168: 72(bool) FOrdEqual 166 167 + 169: 72(bool) LogicalAnd 165 168 + 170: 72(bool) LogicalAnd 160 169 + SelectionMerge 172 None + BranchConditional 170 171 172 + 171: Label + 174: 14(fvec4) Load 93(v) + 175: 14(fvec4) VectorTimesScalar 174 173 + Store 93(v) 175 + Branch 172 + 172: Label + 176: 11 Load 13(a) + 177: 11 Load 37(b) + 178: 8(s1) CompositeExtract 176 0 + 179: 8(s1) CompositeExtract 177 0 + 180: 6(int) CompositeExtract 178 0 + 181: 6(int) CompositeExtract 179 0 + 182: 72(bool) INotEqual 180 181 + 183: 7(float) CompositeExtract 178 1 + 184: 7(float) CompositeExtract 179 1 + 185: 72(bool) FOrdNotEqual 183 184 + 186: 72(bool) LogicalOr 182 185 + 187: 8(s1) CompositeExtract 176 1 + 188: 8(s1) CompositeExtract 177 1 + 189: 6(int) CompositeExtract 187 0 + 190: 6(int) CompositeExtract 188 0 + 191: 72(bool) INotEqual 189 190 + 192: 7(float) CompositeExtract 187 1 + 193: 7(float) CompositeExtract 188 1 + 194: 72(bool) FOrdNotEqual 192 193 + 195: 72(bool) LogicalOr 191 194 + 196: 72(bool) LogicalOr 186 195 + 197: 8(s1) CompositeExtract 176 2 + 198: 8(s1) CompositeExtract 177 2 + 199: 6(int) CompositeExtract 197 0 + 200: 6(int) CompositeExtract 198 0 + 201: 72(bool) INotEqual 199 200 + 202: 7(float) CompositeExtract 197 1 + 203: 7(float) CompositeExtract 198 1 + 204: 72(bool) FOrdNotEqual 202 203 + 205: 72(bool) LogicalOr 201 204 + 206: 72(bool) LogicalOr 196 205 + SelectionMerge 208 None + BranchConditional 206 207 208 + 207: Label + 210: 14(fvec4) Load 93(v) + 211: 14(fvec4) VectorTimesScalar 210 209 + Store 93(v) 211 + Branch 208 + 208: Label + 214: 14(fvec4) Load 93(v) + Store 213(color) 214 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.always-discard.frag.out b/deps/glslang/Test/baseResults/spv.always-discard.frag.out new file mode 100644 index 00000000..8074cf82 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.always-discard.frag.out @@ -0,0 +1,110 @@ +spv.always-discard.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 84 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 21 59 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 9 "white" + Name 12 "black" + Name 15 "color" + Name 18 "x" + Name 21 "tex_coord" + Name 30 "y" + Name 36 "radius" + Name 59 "gl_FragColor" + Decorate 59(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: 6(float) Constant 1065353216 + 11: 7(fvec4) ConstantComposite 10 10 10 10 + 13: 6(float) Constant 1045220557 + 14: 7(fvec4) ConstantComposite 13 13 13 13 + 17: TypePointer Function 6(float) + 19: TypeVector 6(float) 2 + 20: TypePointer Input 19(fvec2) + 21(tex_coord): 20(ptr) Variable Input + 22: TypeInt 32 0 + 23: 22(int) Constant 0 + 24: TypePointer Input 6(float) + 27: 6(float) Constant 1073741824 + 31: 22(int) Constant 1 + 46: TypeBool + 51: 6(float) Constant 1066192077 + 58: TypePointer Output 7(fvec4) +59(gl_FragColor): 58(ptr) Variable Output + 62: 6(float) Constant 1067030938 + 71: 6(float) Constant 1061158912 + 76: 6(float) Constant 1098907648 + 4(main): 2 Function None 3 + 5: Label + 9(white): 8(ptr) Variable Function + 12(black): 8(ptr) Variable Function + 15(color): 8(ptr) Variable Function + 18(x): 17(ptr) Variable Function + 30(y): 17(ptr) Variable Function + 36(radius): 17(ptr) Variable Function + Store 9(white) 11 + Store 12(black) 14 + 16: 7(fvec4) Load 9(white) + Store 15(color) 16 + 25: 24(ptr) AccessChain 21(tex_coord) 23 + 26: 6(float) Load 25 + 28: 6(float) FMul 26 27 + 29: 6(float) FSub 28 10 + Store 18(x) 29 + 32: 24(ptr) AccessChain 21(tex_coord) 31 + 33: 6(float) Load 32 + 34: 6(float) FMul 33 27 + 35: 6(float) FSub 34 10 + Store 30(y) 35 + 37: 6(float) Load 18(x) + 38: 6(float) Load 18(x) + 39: 6(float) FMul 37 38 + 40: 6(float) Load 30(y) + 41: 6(float) Load 30(y) + 42: 6(float) FMul 40 41 + 43: 6(float) FAdd 39 42 + 44: 6(float) ExtInst 1(GLSL.std.450) 31(Sqrt) 43 + Store 36(radius) 44 + 45: 6(float) Load 36(radius) + 47: 46(bool) FOrdGreaterThan 45 10 + SelectionMerge 49 None + BranchConditional 47 48 49 + 48: Label + 50: 6(float) Load 36(radius) + 52: 46(bool) FOrdGreaterThan 50 51 + SelectionMerge 54 None + BranchConditional 52 53 54 + 53: Label + 55: 7(fvec4) Load 15(color) + 56: 7(fvec4) CompositeConstruct 10 10 10 10 + 57: 7(fvec4) FAdd 55 56 + Store 15(color) 57 + Branch 54 + 54: Label + 60: 7(fvec4) Load 15(color) + Store 59(gl_FragColor) 60 + 61: 6(float) Load 36(radius) + 63: 46(bool) FOrdGreaterThan 61 62 + SelectionMerge 65 None + BranchConditional 63 64 65 + 64: Label + 66: 7(fvec4) Load 15(color) + 67: 7(fvec4) CompositeConstruct 10 10 10 10 + 68: 7(fvec4) FAdd 66 67 + Store 15(color) 68 + Branch 65 + 65: Label + Branch 49 + 49: Label + Kill + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.always-discard2.frag.out b/deps/glslang/Test/baseResults/spv.always-discard2.frag.out new file mode 100644 index 00000000..e3fa43a3 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.always-discard2.frag.out @@ -0,0 +1,63 @@ +spv.always-discard2.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 40 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 21 38 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 9 "white" + Name 12 "black" + Name 15 "color" + Name 18 "x" + Name 21 "tex_coord" + Name 30 "y" + Name 38 "gl_FragColor" + Decorate 38(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: 6(float) Constant 1065353216 + 11: 7(fvec4) ConstantComposite 10 10 10 10 + 13: 6(float) Constant 1045220557 + 14: 7(fvec4) ConstantComposite 13 13 13 13 + 17: TypePointer Function 6(float) + 19: TypeVector 6(float) 2 + 20: TypePointer Input 19(fvec2) + 21(tex_coord): 20(ptr) Variable Input + 22: TypeInt 32 0 + 23: 22(int) Constant 0 + 24: TypePointer Input 6(float) + 27: 6(float) Constant 1073741824 + 31: 22(int) Constant 1 + 37: TypePointer Output 7(fvec4) +38(gl_FragColor): 37(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 9(white): 8(ptr) Variable Function + 12(black): 8(ptr) Variable Function + 15(color): 8(ptr) Variable Function + 18(x): 17(ptr) Variable Function + 30(y): 17(ptr) Variable Function + Store 9(white) 11 + Store 12(black) 14 + 16: 7(fvec4) Load 9(white) + Store 15(color) 16 + 25: 24(ptr) AccessChain 21(tex_coord) 23 + 26: 6(float) Load 25 + 28: 6(float) FMul 26 27 + 29: 6(float) FSub 28 10 + Store 18(x) 29 + 32: 24(ptr) AccessChain 21(tex_coord) 31 + 33: 6(float) Load 32 + 34: 6(float) FMul 33 27 + 35: 6(float) FSub 34 10 + Store 30(y) 35 + Kill + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.arbPostDepthCoverage.frag.out b/deps/glslang/Test/baseResults/spv.arbPostDepthCoverage.frag.out new file mode 100644 index 00000000..f41c0121 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.arbPostDepthCoverage.frag.out @@ -0,0 +1,42 @@ +spv.arbPostDepthCoverage.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 18 + + Capability Shader + Capability SampleMaskPostDepthCoverage + Extension "SPV_KHR_post_depth_coverage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 8 13 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 EarlyFragmentTests + ExecutionMode 4 PostDepthCoverage + Source GLSL 450 + SourceExtension "GL_ARB_post_depth_coverage" + SourceExtension "GL_EXT_post_depth_coverage" + Name 4 "main" + Name 8 "readSampleMaskIn" + Name 13 "gl_SampleMaskIn" + Decorate 8(readSampleMaskIn) Location 0 + Decorate 13(gl_SampleMaskIn) Flat + Decorate 13(gl_SampleMaskIn) BuiltIn SampleMask + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Output 6(int) +8(readSampleMaskIn): 7(ptr) Variable Output + 9: TypeInt 32 0 + 10: 9(int) Constant 1 + 11: TypeArray 6(int) 10 + 12: TypePointer Input 11 +13(gl_SampleMaskIn): 12(ptr) Variable Input + 14: 6(int) Constant 0 + 15: TypePointer Input 6(int) + 4(main): 2 Function None 3 + 5: Label + 16: 15(ptr) AccessChain 13(gl_SampleMaskIn) 14 + 17: 6(int) Load 16 + Store 8(readSampleMaskIn) 17 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.arbPostDepthCoverage_Error.frag.out b/deps/glslang/Test/baseResults/spv.arbPostDepthCoverage_Error.frag.out new file mode 100644 index 00000000..b210144d --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.arbPostDepthCoverage_Error.frag.out @@ -0,0 +1,7 @@ +spv.arbPostDepthCoverage_Error.frag +ERROR: 0:7: 'early_fragment_tests' : can only apply to a standalone qualifier +ERROR: 0:7: 'post_depth_coverage' : can only apply to a standalone qualifier +ERROR: 2 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.atomic.comp.out b/deps/glslang/Test/baseResults/spv.atomic.comp.out new file mode 100644 index 00000000..3dd88f39 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.atomic.comp.out @@ -0,0 +1,128 @@ +spv.atomic.comp +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 74 + + Capability Shader + Capability AtomicStorage + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" + ExecutionMode 4 LocalSize 1 1 1 + Source GLSL 450 + Name 4 "main" + Name 10 "func(au1;" + Name 9 "c" + Name 12 "atoms(" + Name 20 "counter" + Name 23 "val" + Name 27 "countArr" + Name 37 "origi" + Name 39 "atomi" + Name 42 "origu" + Name 44 "atomu" + Name 45 "value" + Name 62 "dataSSB" + MemberName 62(dataSSB) 0 "f" + MemberName 62(dataSSB) 1 "n_frames_rendered" + Name 64 "result" + Name 71 "arrX" + Name 72 "arrY" + Name 73 "arrZ" + Decorate 20(counter) Offset 0 + Decorate 20(counter) Binding 0 + Decorate 27(countArr) Offset 4 + Decorate 27(countArr) Binding 0 + MemberDecorate 62(dataSSB) 0 Restrict + MemberDecorate 62(dataSSB) 0 Offset 0 + MemberDecorate 62(dataSSB) 1 Restrict + MemberDecorate 62(dataSSB) 1 Offset 16 + Decorate 62(dataSSB) BufferBlock + Decorate 64(result) DescriptorSet 0 + Decorate 64(result) Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer AtomicCounter 6(int) + 8: TypeFunction 6(int) 7(ptr) + 14: 6(int) Constant 1 + 15: 6(int) Constant 0 + 19: 6(int) Constant 1032 + 20(counter): 7(ptr) Variable AtomicCounter + 22: TypePointer Function 6(int) + 24: 6(int) Constant 4 + 25: TypeArray 6(int) 24 + 26: TypePointer AtomicCounter 25 + 27(countArr): 26(ptr) Variable AtomicCounter + 28: TypeInt 32 1 + 29: 28(int) Constant 2 + 33: 28(int) Constant 1 + 36: TypePointer Function 28(int) + 38: TypePointer Workgroup 28(int) + 39(atomi): 38(ptr) Variable Workgroup + 40: 28(int) Constant 3 + 43: TypePointer Workgroup 6(int) + 44(atomu): 43(ptr) Variable Workgroup + 45(value): 43(ptr) Variable Workgroup + 48: 6(int) Constant 7 + 53: 28(int) Constant 7 + 57: 6(int) Constant 10 + 60: TypeFloat 32 + 61: TypeVector 28(int) 4 + 62(dataSSB): TypeStruct 60(float) 61(ivec4) + 63: TypePointer Uniform 62(dataSSB) + 64(result): 63(ptr) Variable Uniform + 65: 6(int) Constant 2 + 66: TypePointer Uniform 28(int) + 69: TypeArray 28(int) 14 + 70: TypePointer Private 69 + 71(arrX): 70(ptr) Variable Private + 72(arrY): 70(ptr) Variable Private + 73(arrZ): 70(ptr) Variable Private + 4(main): 2 Function None 3 + 5: Label + 23(val): 22(ptr) Variable Function + MemoryBarrier 14 19 + 21: 6(int) FunctionCall 10(func(au1;) 20(counter) + 30: 7(ptr) AccessChain 27(countArr) 29 + 31: 6(int) AtomicLoad 30 14 15 + Store 23(val) 31 + 32: 6(int) AtomicIDecrement 20(counter) 14 15 + 34: 6(int) ISub 32 33 + 35: 6(int) AtomicIIncrement 20(counter) 14 15 + Return + FunctionEnd + 10(func(au1;): 6(int) Function None 8 + 9(c): 7(ptr) FunctionParameter + 11: Label + 16: 6(int) AtomicIIncrement 9(c) 14 15 + ReturnValue 16 + FunctionEnd + 12(atoms(): 2 Function None 3 + 13: Label + 37(origi): 36(ptr) Variable Function + 42(origu): 22(ptr) Variable Function + 41: 28(int) AtomicIAdd 39(atomi) 14 15 40 + Store 37(origi) 41 + 46: 6(int) Load 45(value) + 47: 6(int) AtomicAnd 44(atomu) 14 15 46 + Store 42(origu) 47 + 49: 6(int) AtomicOr 44(atomu) 14 15 48 + Store 42(origu) 49 + 50: 6(int) AtomicXor 44(atomu) 14 15 48 + Store 42(origu) 50 + 51: 6(int) Load 45(value) + 52: 6(int) AtomicUMin 44(atomu) 14 15 51 + Store 42(origu) 52 + 54: 28(int) AtomicSMax 39(atomi) 14 15 53 + Store 37(origi) 54 + 55: 28(int) Load 37(origi) + 56: 28(int) AtomicExchange 39(atomi) 14 15 55 + Store 37(origi) 56 + 58: 6(int) Load 45(value) + 59: 6(int) AtomicCompareExchange 44(atomu) 14 15 15 58 57 + Store 42(origu) 59 + 67: 66(ptr) AccessChain 64(result) 33 65 + 68: 28(int) AtomicIAdd 67 14 15 33 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.atomicInt64.comp.out b/deps/glslang/Test/baseResults/spv.atomicInt64.comp.out new file mode 100644 index 00000000..9c66aecc --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.atomicInt64.comp.out @@ -0,0 +1,215 @@ +spv.atomicInt64.comp +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 149 + + Capability Shader + Capability Int64 + Capability Int64Atomics + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" + ExecutionMode 4 LocalSize 16 16 1 + Source GLSL 450 + SourceExtension "GL_ARB_gpu_shader_int64" + SourceExtension "GL_NV_shader_atomic_int64" + Name 4 "main" + Name 8 "i64" + Name 12 "u64" + Name 14 "Buffer" + MemberName 14(Buffer) 0 "i64" + MemberName 14(Buffer) 1 "u64" + Name 16 "buf" + Name 84 "Struct" + MemberName 84(Struct) 0 "i64" + MemberName 84(Struct) 1 "u64" + Name 86 "s" + MemberDecorate 14(Buffer) 0 Offset 0 + MemberDecorate 14(Buffer) 1 Offset 8 + Decorate 14(Buffer) BufferBlock + Decorate 16(buf) DescriptorSet 0 + Decorate 16(buf) Binding 0 + Decorate 148 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 64 1 + 7: TypePointer Function 6(int64_t) + 9: 6(int64_t) Constant 0 0 + 10: TypeInt 64 0 + 11: TypePointer Function 10(int64_t) + 13: 10(int64_t) Constant 0 0 + 14(Buffer): TypeStruct 6(int64_t) 10(int64_t) + 15: TypePointer Uniform 14(Buffer) + 16(buf): 15(ptr) Variable Uniform + 17: TypeInt 32 1 + 18: 17(int) Constant 0 + 19: TypePointer Uniform 6(int64_t) + 21: 6(int64_t) Constant 4294967272 4294967295 + 22: TypeInt 32 0 + 23: 22(int) Constant 1 + 24: 22(int) Constant 0 + 28: 17(int) Constant 1 + 29: TypePointer Uniform 10(int64_t) + 31: 10(int64_t) Constant 15 240 + 84(Struct): TypeStruct 6(int64_t) 10(int64_t) + 85: TypePointer Workgroup 84(Struct) + 86(s): 85(ptr) Variable Workgroup + 87: TypePointer Workgroup 6(int64_t) + 92: TypePointer Workgroup 10(int64_t) + 146: TypeVector 22(int) 3 + 147: 22(int) Constant 16 + 148: 146(ivec3) ConstantComposite 147 147 23 + 4(main): 2 Function None 3 + 5: Label + 8(i64): 7(ptr) Variable Function + 12(u64): 11(ptr) Variable Function + Store 8(i64) 9 + Store 12(u64) 13 + 20: 19(ptr) AccessChain 16(buf) 18 + 25: 6(int64_t) AtomicSMin 20 23 24 21 + 26: 6(int64_t) Load 8(i64) + 27: 6(int64_t) IAdd 26 25 + Store 8(i64) 27 + 30: 29(ptr) AccessChain 16(buf) 28 + 32: 10(int64_t) AtomicUMin 30 23 24 31 + 33: 10(int64_t) Load 12(u64) + 34: 10(int64_t) IAdd 33 32 + Store 12(u64) 34 + 35: 19(ptr) AccessChain 16(buf) 18 + 36: 6(int64_t) AtomicSMax 35 23 24 21 + 37: 6(int64_t) Load 8(i64) + 38: 6(int64_t) IAdd 37 36 + Store 8(i64) 38 + 39: 29(ptr) AccessChain 16(buf) 28 + 40: 10(int64_t) AtomicUMax 39 23 24 31 + 41: 10(int64_t) Load 12(u64) + 42: 10(int64_t) IAdd 41 40 + Store 12(u64) 42 + 43: 19(ptr) AccessChain 16(buf) 18 + 44: 6(int64_t) AtomicAnd 43 23 24 21 + 45: 6(int64_t) Load 8(i64) + 46: 6(int64_t) IAdd 45 44 + Store 8(i64) 46 + 47: 29(ptr) AccessChain 16(buf) 28 + 48: 10(int64_t) AtomicAnd 47 23 24 31 + 49: 10(int64_t) Load 12(u64) + 50: 10(int64_t) IAdd 49 48 + Store 12(u64) 50 + 51: 19(ptr) AccessChain 16(buf) 18 + 52: 6(int64_t) AtomicOr 51 23 24 21 + 53: 6(int64_t) Load 8(i64) + 54: 6(int64_t) IAdd 53 52 + Store 8(i64) 54 + 55: 29(ptr) AccessChain 16(buf) 28 + 56: 10(int64_t) AtomicOr 55 23 24 31 + 57: 10(int64_t) Load 12(u64) + 58: 10(int64_t) IAdd 57 56 + Store 12(u64) 58 + 59: 19(ptr) AccessChain 16(buf) 18 + 60: 6(int64_t) AtomicXor 59 23 24 21 + 61: 6(int64_t) Load 8(i64) + 62: 6(int64_t) IAdd 61 60 + Store 8(i64) 62 + 63: 29(ptr) AccessChain 16(buf) 28 + 64: 10(int64_t) AtomicXor 63 23 24 31 + 65: 10(int64_t) Load 12(u64) + 66: 10(int64_t) IAdd 65 64 + Store 12(u64) 66 + 67: 19(ptr) AccessChain 16(buf) 18 + 68: 6(int64_t) AtomicIAdd 67 23 24 21 + 69: 6(int64_t) Load 8(i64) + 70: 6(int64_t) IAdd 69 68 + Store 8(i64) 70 + 71: 19(ptr) AccessChain 16(buf) 18 + 72: 6(int64_t) AtomicExchange 71 23 24 21 + 73: 6(int64_t) Load 8(i64) + 74: 6(int64_t) IAdd 73 72 + Store 8(i64) 74 + 75: 19(ptr) AccessChain 16(buf) 18 + 76: 6(int64_t) Load 8(i64) + 77: 6(int64_t) AtomicCompareExchange 75 23 24 24 76 21 + 78: 6(int64_t) Load 8(i64) + 79: 6(int64_t) IAdd 78 77 + Store 8(i64) 79 + 80: 6(int64_t) Load 8(i64) + 81: 19(ptr) AccessChain 16(buf) 18 + Store 81 80 + 82: 10(int64_t) Load 12(u64) + 83: 29(ptr) AccessChain 16(buf) 28 + Store 83 82 + Store 8(i64) 9 + Store 12(u64) 13 + 88: 87(ptr) AccessChain 86(s) 18 + 89: 6(int64_t) AtomicSMin 88 23 24 21 + 90: 6(int64_t) Load 8(i64) + 91: 6(int64_t) IAdd 90 89 + Store 8(i64) 91 + 93: 92(ptr) AccessChain 86(s) 28 + 94: 10(int64_t) AtomicUMin 93 23 24 31 + 95: 10(int64_t) Load 12(u64) + 96: 10(int64_t) IAdd 95 94 + Store 12(u64) 96 + 97: 87(ptr) AccessChain 86(s) 18 + 98: 6(int64_t) AtomicSMax 97 23 24 21 + 99: 6(int64_t) Load 8(i64) + 100: 6(int64_t) IAdd 99 98 + Store 8(i64) 100 + 101: 92(ptr) AccessChain 86(s) 28 + 102: 10(int64_t) AtomicUMax 101 23 24 31 + 103: 10(int64_t) Load 12(u64) + 104: 10(int64_t) IAdd 103 102 + Store 12(u64) 104 + 105: 87(ptr) AccessChain 86(s) 18 + 106: 6(int64_t) AtomicAnd 105 23 24 21 + 107: 6(int64_t) Load 8(i64) + 108: 6(int64_t) IAdd 107 106 + Store 8(i64) 108 + 109: 92(ptr) AccessChain 86(s) 28 + 110: 10(int64_t) AtomicAnd 109 23 24 31 + 111: 10(int64_t) Load 12(u64) + 112: 10(int64_t) IAdd 111 110 + Store 12(u64) 112 + 113: 87(ptr) AccessChain 86(s) 18 + 114: 6(int64_t) AtomicOr 113 23 24 21 + 115: 6(int64_t) Load 8(i64) + 116: 6(int64_t) IAdd 115 114 + Store 8(i64) 116 + 117: 92(ptr) AccessChain 86(s) 28 + 118: 10(int64_t) AtomicOr 117 23 24 31 + 119: 10(int64_t) Load 12(u64) + 120: 10(int64_t) IAdd 119 118 + Store 12(u64) 120 + 121: 87(ptr) AccessChain 86(s) 18 + 122: 6(int64_t) AtomicXor 121 23 24 21 + 123: 6(int64_t) Load 8(i64) + 124: 6(int64_t) IAdd 123 122 + Store 8(i64) 124 + 125: 92(ptr) AccessChain 86(s) 28 + 126: 10(int64_t) AtomicXor 125 23 24 31 + 127: 10(int64_t) Load 12(u64) + 128: 10(int64_t) IAdd 127 126 + Store 12(u64) 128 + 129: 87(ptr) AccessChain 86(s) 18 + 130: 6(int64_t) AtomicIAdd 129 23 24 21 + 131: 6(int64_t) Load 8(i64) + 132: 6(int64_t) IAdd 131 130 + Store 8(i64) 132 + 133: 87(ptr) AccessChain 86(s) 18 + 134: 6(int64_t) AtomicExchange 133 23 24 21 + 135: 6(int64_t) Load 8(i64) + 136: 6(int64_t) IAdd 135 134 + Store 8(i64) 136 + 137: 87(ptr) AccessChain 86(s) 18 + 138: 6(int64_t) Load 8(i64) + 139: 6(int64_t) AtomicCompareExchange 137 23 24 24 138 21 + 140: 6(int64_t) Load 8(i64) + 141: 6(int64_t) IAdd 140 139 + Store 8(i64) 141 + 142: 6(int64_t) Load 8(i64) + 143: 87(ptr) AccessChain 86(s) 18 + Store 143 142 + 144: 10(int64_t) Load 12(u64) + 145: 92(ptr) AccessChain 86(s) 28 + Store 145 144 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.barrier.vert.out b/deps/glslang/Test/baseResults/spv.barrier.vert.out new file mode 100644 index 00000000..b9369f27 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.barrier.vert.out @@ -0,0 +1,46 @@ +spv.barrier.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 24 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 9 15 + Source GLSL 450 + Name 4 "main" + Name 9 "c0" + Name 15 "c1" + Decorate 9(c0) Location 0 + Decorate 15(c1) Location 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(c0): 8(ptr) Variable Output + 10: 6(float) Constant 1065353216 + 11: 7(fvec4) ConstantComposite 10 10 10 10 + 12: TypeInt 32 0 + 13: 12(int) Constant 1 + 14: 12(int) Constant 3400 + 15(c1): 8(ptr) Variable Output + 16: 12(int) Constant 72 + 20: 12(int) Constant 2056 + 4(main): 2 Function None 3 + 5: Label + Store 9(c0) 11 + MemoryBarrier 13 14 + Store 15(c1) 11 + MemoryBarrier 13 16 + 17: 7(fvec4) Load 9(c0) + 18: 7(fvec4) CompositeConstruct 10 10 10 10 + 19: 7(fvec4) FAdd 17 18 + Store 9(c0) 19 + MemoryBarrier 13 20 + 21: 7(fvec4) Load 9(c0) + 22: 7(fvec4) CompositeConstruct 10 10 10 10 + 23: 7(fvec4) FAdd 21 22 + Store 9(c0) 23 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.bitCast.frag.out b/deps/glslang/Test/baseResults/spv.bitCast.frag.out new file mode 100644 index 00000000..a687b8da --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.bitCast.frag.out @@ -0,0 +1,234 @@ +spv.bitCast.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 172 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 14 26 37 48 89 98 107 116 122 130 139 148 154 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "idata" + Name 14 "f1" + Name 26 "f2" + Name 37 "f3" + Name 48 "f4" + Name 55 "udata" + Name 85 "fdata" + Name 89 "i1" + Name 98 "i2" + Name 107 "i3" + Name 116 "i4" + Name 122 "u1" + Name 130 "u2" + Name 139 "u3" + Name 148 "u4" + Name 154 "fragColor" + Decorate 89(i1) Flat + Decorate 98(i2) Flat + Decorate 107(i3) Flat + Decorate 116(i4) Flat + Decorate 122(u1) Flat + Decorate 130(u2) Flat + Decorate 139(u3) Flat + Decorate 148(u4) Flat + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeVector 6(int) 4 + 8: TypePointer Function 7(ivec4) + 10: 6(int) Constant 0 + 11: 7(ivec4) ConstantComposite 10 10 10 10 + 12: TypeFloat 32 + 13: TypePointer Input 12(float) + 14(f1): 13(ptr) Variable Input + 17: TypeInt 32 0 + 18: 17(int) Constant 0 + 19: TypePointer Function 6(int) + 24: TypeVector 12(float) 2 + 25: TypePointer Input 24(fvec2) + 26(f2): 25(ptr) Variable Input + 28: TypeVector 6(int) 2 + 35: TypeVector 12(float) 3 + 36: TypePointer Input 35(fvec3) + 37(f3): 36(ptr) Variable Input + 39: TypeVector 6(int) 3 + 46: TypeVector 12(float) 4 + 47: TypePointer Input 46(fvec4) + 48(f4): 47(ptr) Variable Input + 53: TypeVector 17(int) 4 + 54: TypePointer Function 53(ivec4) + 56: 53(ivec4) ConstantComposite 18 18 18 18 + 59: TypePointer Function 17(int) + 65: TypeVector 17(int) 2 + 73: TypeVector 17(int) 3 + 84: TypePointer Function 46(fvec4) + 86: 12(float) Constant 0 + 87: 46(fvec4) ConstantComposite 86 86 86 86 + 88: TypePointer Input 6(int) + 89(i1): 88(ptr) Variable Input + 92: TypePointer Function 12(float) + 97: TypePointer Input 28(ivec2) + 98(i2): 97(ptr) Variable Input + 106: TypePointer Input 39(ivec3) + 107(i3): 106(ptr) Variable Input + 115: TypePointer Input 7(ivec4) + 116(i4): 115(ptr) Variable Input + 121: TypePointer Input 17(int) + 122(u1): 121(ptr) Variable Input + 129: TypePointer Input 65(ivec2) + 130(u2): 129(ptr) Variable Input + 138: TypePointer Input 73(ivec3) + 139(u3): 138(ptr) Variable Input + 147: TypePointer Input 53(ivec4) + 148(u4): 147(ptr) Variable Input + 153: TypePointer Output 46(fvec4) + 154(fragColor): 153(ptr) Variable Output + 158: TypeBool + 159: TypeVector 158(bool) 4 + 168: 12(float) Constant 1045220557 + 169: 46(fvec4) ConstantComposite 168 168 168 168 + 4(main): 2 Function None 3 + 5: Label + 9(idata): 8(ptr) Variable Function + 55(udata): 54(ptr) Variable Function + 85(fdata): 84(ptr) Variable Function + 162: 84(ptr) Variable Function + Store 9(idata) 11 + 15: 12(float) Load 14(f1) + 16: 6(int) Bitcast 15 + 20: 19(ptr) AccessChain 9(idata) 18 + 21: 6(int) Load 20 + 22: 6(int) IAdd 21 16 + 23: 19(ptr) AccessChain 9(idata) 18 + Store 23 22 + 27: 24(fvec2) Load 26(f2) + 29: 28(ivec2) Bitcast 27 + 30: 7(ivec4) Load 9(idata) + 31: 28(ivec2) VectorShuffle 30 30 0 1 + 32: 28(ivec2) IAdd 31 29 + 33: 7(ivec4) Load 9(idata) + 34: 7(ivec4) VectorShuffle 33 32 4 5 2 3 + Store 9(idata) 34 + 38: 35(fvec3) Load 37(f3) + 40: 39(ivec3) Bitcast 38 + 41: 7(ivec4) Load 9(idata) + 42: 39(ivec3) VectorShuffle 41 41 0 1 2 + 43: 39(ivec3) IAdd 42 40 + 44: 7(ivec4) Load 9(idata) + 45: 7(ivec4) VectorShuffle 44 43 4 5 6 3 + Store 9(idata) 45 + 49: 46(fvec4) Load 48(f4) + 50: 7(ivec4) Bitcast 49 + 51: 7(ivec4) Load 9(idata) + 52: 7(ivec4) IAdd 51 50 + Store 9(idata) 52 + Store 55(udata) 56 + 57: 12(float) Load 14(f1) + 58: 17(int) Bitcast 57 + 60: 59(ptr) AccessChain 55(udata) 18 + 61: 17(int) Load 60 + 62: 17(int) IAdd 61 58 + 63: 59(ptr) AccessChain 55(udata) 18 + Store 63 62 + 64: 24(fvec2) Load 26(f2) + 66: 65(ivec2) Bitcast 64 + 67: 53(ivec4) Load 55(udata) + 68: 65(ivec2) VectorShuffle 67 67 0 1 + 69: 65(ivec2) IAdd 68 66 + 70: 53(ivec4) Load 55(udata) + 71: 53(ivec4) VectorShuffle 70 69 4 5 2 3 + Store 55(udata) 71 + 72: 35(fvec3) Load 37(f3) + 74: 73(ivec3) Bitcast 72 + 75: 53(ivec4) Load 55(udata) + 76: 73(ivec3) VectorShuffle 75 75 0 1 2 + 77: 73(ivec3) IAdd 76 74 + 78: 53(ivec4) Load 55(udata) + 79: 53(ivec4) VectorShuffle 78 77 4 5 6 3 + Store 55(udata) 79 + 80: 46(fvec4) Load 48(f4) + 81: 53(ivec4) Bitcast 80 + 82: 53(ivec4) Load 55(udata) + 83: 53(ivec4) IAdd 82 81 + Store 55(udata) 83 + Store 85(fdata) 87 + 90: 6(int) Load 89(i1) + 91: 12(float) Bitcast 90 + 93: 92(ptr) AccessChain 85(fdata) 18 + 94: 12(float) Load 93 + 95: 12(float) FAdd 94 91 + 96: 92(ptr) AccessChain 85(fdata) 18 + Store 96 95 + 99: 28(ivec2) Load 98(i2) + 100: 24(fvec2) Bitcast 99 + 101: 46(fvec4) Load 85(fdata) + 102: 24(fvec2) VectorShuffle 101 101 0 1 + 103: 24(fvec2) FAdd 102 100 + 104: 46(fvec4) Load 85(fdata) + 105: 46(fvec4) VectorShuffle 104 103 4 5 2 3 + Store 85(fdata) 105 + 108: 39(ivec3) Load 107(i3) + 109: 35(fvec3) Bitcast 108 + 110: 46(fvec4) Load 85(fdata) + 111: 35(fvec3) VectorShuffle 110 110 0 1 2 + 112: 35(fvec3) FAdd 111 109 + 113: 46(fvec4) Load 85(fdata) + 114: 46(fvec4) VectorShuffle 113 112 4 5 6 3 + Store 85(fdata) 114 + 117: 7(ivec4) Load 116(i4) + 118: 46(fvec4) Bitcast 117 + 119: 46(fvec4) Load 85(fdata) + 120: 46(fvec4) FAdd 119 118 + Store 85(fdata) 120 + 123: 17(int) Load 122(u1) + 124: 12(float) Bitcast 123 + 125: 92(ptr) AccessChain 85(fdata) 18 + 126: 12(float) Load 125 + 127: 12(float) FAdd 126 124 + 128: 92(ptr) AccessChain 85(fdata) 18 + Store 128 127 + 131: 65(ivec2) Load 130(u2) + 132: 24(fvec2) Bitcast 131 + 133: 46(fvec4) Load 85(fdata) + 134: 24(fvec2) VectorShuffle 133 133 0 1 + 135: 24(fvec2) FAdd 134 132 + 136: 46(fvec4) Load 85(fdata) + 137: 46(fvec4) VectorShuffle 136 135 4 5 2 3 + Store 85(fdata) 137 + 140: 73(ivec3) Load 139(u3) + 141: 35(fvec3) Bitcast 140 + 142: 46(fvec4) Load 85(fdata) + 143: 35(fvec3) VectorShuffle 142 142 0 1 2 + 144: 35(fvec3) FAdd 143 141 + 145: 46(fvec4) Load 85(fdata) + 146: 46(fvec4) VectorShuffle 145 144 4 5 6 3 + Store 85(fdata) 146 + 149: 53(ivec4) Load 148(u4) + 150: 46(fvec4) Bitcast 149 + 151: 46(fvec4) Load 85(fdata) + 152: 46(fvec4) FAdd 151 150 + Store 85(fdata) 152 + 155: 7(ivec4) Load 9(idata) + 156: 53(ivec4) Bitcast 155 + 157: 53(ivec4) Load 55(udata) + 160: 159(bvec4) IEqual 156 157 + 161: 158(bool) All 160 + SelectionMerge 164 None + BranchConditional 161 163 166 + 163: Label + 165: 46(fvec4) Load 85(fdata) + Store 162 165 + Branch 164 + 166: Label + 167: 46(fvec4) Load 85(fdata) + 170: 46(fvec4) FAdd 167 169 + Store 162 170 + Branch 164 + 164: Label + 171: 46(fvec4) Load 162 + Store 154(fragColor) 171 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.bool.vert.out b/deps/glslang/Test/baseResults/spv.bool.vert.out new file mode 100644 index 00000000..becd707a --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.bool.vert.out @@ -0,0 +1,79 @@ +spv.bool.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 46 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 24 + Source GLSL 450 + Name 4 "main" + Name 10 "foo(b1;" + Name 9 "b" + Name 22 "gl_PerVertex" + MemberName 22(gl_PerVertex) 0 "gl_Position" + MemberName 22(gl_PerVertex) 1 "gl_PointSize" + MemberName 22(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 22(gl_PerVertex) 3 "gl_CullDistance" + Name 24 "" + Name 27 "ubname" + MemberName 27(ubname) 0 "b" + Name 29 "ubinst" + Name 30 "param" + MemberDecorate 22(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 22(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 22(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 22(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 22(gl_PerVertex) Block + MemberDecorate 27(ubname) 0 Offset 0 + Decorate 27(ubname) Block + Decorate 29(ubinst) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeBool + 7: TypePointer Function 6(bool) + 8: TypeFunction 6(bool) 7(ptr) + 13: 6(bool) ConstantFalse + 17: TypeFloat 32 + 18: TypeVector 17(float) 4 + 19: TypeInt 32 0 + 20: 19(int) Constant 1 + 21: TypeArray 17(float) 20 +22(gl_PerVertex): TypeStruct 18(fvec4) 17(float) 21 21 + 23: TypePointer Output 22(gl_PerVertex) + 24: 23(ptr) Variable Output + 25: TypeInt 32 1 + 26: 25(int) Constant 0 + 27(ubname): TypeStruct 19(int) + 28: TypePointer Uniform 27(ubname) + 29(ubinst): 28(ptr) Variable Uniform + 31: TypePointer Uniform 19(int) + 34: 19(int) Constant 0 + 37: 17(float) Constant 0 + 38: 18(fvec4) ConstantComposite 37 37 37 37 + 39: 17(float) Constant 1065353216 + 40: 18(fvec4) ConstantComposite 39 39 39 39 + 41: TypeVector 6(bool) 4 + 44: TypePointer Output 18(fvec4) + 4(main): 2 Function None 3 + 5: Label + 30(param): 7(ptr) Variable Function + 32: 31(ptr) AccessChain 29(ubinst) 26 + 33: 19(int) Load 32 + 35: 6(bool) INotEqual 33 34 + Store 30(param) 35 + 36: 6(bool) FunctionCall 10(foo(b1;) 30(param) + 42: 41(bvec4) CompositeConstruct 36 36 36 36 + 43: 18(fvec4) Select 42 38 40 + 45: 44(ptr) AccessChain 24 26 + Store 45 43 + Return + FunctionEnd + 10(foo(b1;): 6(bool) Function None 8 + 9(b): 7(ptr) FunctionParameter + 11: Label + 12: 6(bool) Load 9(b) + 14: 6(bool) LogicalNotEqual 12 13 + ReturnValue 14 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.boolInBlock.frag.out b/deps/glslang/Test/baseResults/spv.boolInBlock.frag.out new file mode 100644 index 00000000..e86ca6b3 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.boolInBlock.frag.out @@ -0,0 +1,158 @@ +spv.boolInBlock.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 102 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 74 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 14 "foo(vb4;vb2;" + Name 12 "paramb4" + Name 13 "paramb2" + Name 17 "b1" + Name 25 "Buffer" + MemberName 25(Buffer) 0 "b2" + Name 27 "" + Name 40 "Uniform" + MemberName 40(Uniform) 0 "b4" + Name 42 "" + Name 60 "param" + Name 66 "param" + Name 74 "fragColor" + MemberDecorate 25(Buffer) 0 Offset 0 + Decorate 25(Buffer) BufferBlock + Decorate 27 DescriptorSet 0 + Decorate 27 Binding 1 + MemberDecorate 40(Uniform) 0 Offset 0 + Decorate 40(Uniform) Block + Decorate 42 DescriptorSet 0 + Decorate 42 Binding 0 + Decorate 74(fragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeBool + 7: TypeVector 6(bool) 4 + 8: TypePointer Function 7(bvec4) + 9: TypeVector 6(bool) 2 + 10: TypePointer Function 9(bvec2) + 11: TypeFunction 2 8(ptr) 10(ptr) + 16: TypePointer Function 6(bool) + 18: TypeInt 32 0 + 19: 18(int) Constant 2 + 24: TypeVector 18(int) 2 + 25(Buffer): TypeStruct 24(ivec2) + 26: TypePointer Uniform 25(Buffer) + 27: 26(ptr) Variable Uniform + 28: TypeInt 32 1 + 29: 28(int) Constant 0 + 30: 6(bool) ConstantFalse + 31: 9(bvec2) ConstantComposite 30 30 + 32: 18(int) Constant 1 + 33: 24(ivec2) ConstantComposite 32 32 + 34: 18(int) Constant 0 + 35: 24(ivec2) ConstantComposite 34 34 + 37: TypePointer Uniform 24(ivec2) + 39: TypeVector 18(int) 4 + 40(Uniform): TypeStruct 39(ivec4) + 41: TypePointer Uniform 40(Uniform) + 42: 41(ptr) Variable Uniform + 43: TypePointer Uniform 18(int) + 61: TypePointer Uniform 39(ivec4) + 64: 39(ivec4) ConstantComposite 34 34 34 34 + 71: TypeFloat 32 + 72: TypeVector 71(float) 4 + 73: TypePointer Output 72(fvec4) + 74(fragColor): 73(ptr) Variable Output + 84: 71(float) Constant 0 + 85: 71(float) Constant 1065353216 + 4(main): 2 Function None 3 + 5: Label + 60(param): 8(ptr) Variable Function + 66(param): 10(ptr) Variable Function + 36: 24(ivec2) Select 31 33 35 + 38: 37(ptr) AccessChain 27 29 + Store 38 36 + 44: 43(ptr) AccessChain 42 29 19 + 45: 18(int) Load 44 + 46: 6(bool) INotEqual 45 34 + SelectionMerge 48 None + BranchConditional 46 47 48 + 47: Label + 49: 43(ptr) AccessChain 42 29 34 + 50: 18(int) Load 49 + 51: 6(bool) INotEqual 50 34 + 52: 9(bvec2) CompositeConstruct 51 51 + 53: 24(ivec2) Select 52 33 35 + 54: 37(ptr) AccessChain 27 29 + Store 54 53 + Branch 48 + 48: Label + 55: 43(ptr) AccessChain 27 29 34 + 56: 18(int) Load 55 + 57: 6(bool) INotEqual 56 34 + SelectionMerge 59 None + BranchConditional 57 58 59 + 58: Label + 62: 61(ptr) AccessChain 42 29 + 63: 39(ivec4) Load 62 + 65: 7(bvec4) INotEqual 63 64 + Store 60(param) 65 + 67: 2 FunctionCall 14(foo(vb4;vb2;) 60(param) 66(param) + 68: 9(bvec2) Load 66(param) + 69: 24(ivec2) Select 68 33 35 + 70: 37(ptr) AccessChain 27 29 + Store 70 69 + Branch 59 + 59: Label + 75: 43(ptr) AccessChain 42 29 34 + 76: 18(int) Load 75 + 77: 6(bool) INotEqual 76 34 + SelectionMerge 79 None + BranchConditional 77 78 79 + 78: Label + 80: 43(ptr) AccessChain 42 29 32 + 81: 18(int) Load 80 + 82: 6(bool) INotEqual 81 34 + Branch 79 + 79: Label + 83: 6(bool) Phi 77 59 82 78 + 86: 71(float) Select 83 85 84 + 87: 72(fvec4) CompositeConstruct 86 86 86 86 + Store 74(fragColor) 87 + 88: 43(ptr) AccessChain 42 29 34 + 89: 18(int) Load 88 + 90: 6(bool) INotEqual 89 34 + 91: 6(bool) LogicalNot 90 + SelectionMerge 93 None + BranchConditional 91 92 93 + 92: Label + 94: 43(ptr) AccessChain 42 29 32 + 95: 18(int) Load 94 + 96: 6(bool) INotEqual 95 34 + Branch 93 + 93: Label + 97: 6(bool) Phi 90 79 96 92 + 98: 71(float) Select 97 85 84 + 99: 72(fvec4) CompositeConstruct 98 98 98 98 + 100: 72(fvec4) Load 74(fragColor) + 101: 72(fvec4) FSub 100 99 + Store 74(fragColor) 101 + Return + FunctionEnd +14(foo(vb4;vb2;): 2 Function None 11 + 12(paramb4): 8(ptr) FunctionParameter + 13(paramb2): 10(ptr) FunctionParameter + 15: Label + 17(b1): 16(ptr) Variable Function + 20: 16(ptr) AccessChain 12(paramb4) 19 + 21: 6(bool) Load 20 + Store 17(b1) 21 + 22: 6(bool) Load 17(b1) + 23: 9(bvec2) CompositeConstruct 22 22 + Store 13(paramb2) 23 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.branch-return.vert.out b/deps/glslang/Test/baseResults/spv.branch-return.vert.out new file mode 100644 index 00000000..ca447245 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.branch-return.vert.out @@ -0,0 +1,65 @@ +spv.branch-return.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 38 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 8 20 + Source ESSL 310 + Name 4 "main" + Name 8 "gl_InstanceIndex" + Name 18 "gl_PerVertex" + MemberName 18(gl_PerVertex) 0 "gl_Position" + MemberName 18(gl_PerVertex) 1 "gl_PointSize" + Name 20 "" + Decorate 8(gl_InstanceIndex) BuiltIn InstanceIndex + MemberDecorate 18(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 18(gl_PerVertex) 1 BuiltIn PointSize + Decorate 18(gl_PerVertex) Block + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Input 6(int) +8(gl_InstanceIndex): 7(ptr) Variable Input + 16: TypeFloat 32 + 17: TypeVector 16(float) 4 +18(gl_PerVertex): TypeStruct 17(fvec4) 16(float) + 19: TypePointer Output 18(gl_PerVertex) + 20: 19(ptr) Variable Output + 21: 6(int) Constant 0 + 22: 16(float) Constant 0 + 23: 17(fvec4) ConstantComposite 22 22 22 22 + 24: TypePointer Output 17(fvec4) + 30: 16(float) Constant 1039918957 + 31: TypeInt 32 0 + 32: 31(int) Constant 0 + 33: TypePointer Output 16(float) + 4(main): 2 Function None 3 + 5: Label + 9: 6(int) Load 8(gl_InstanceIndex) + SelectionMerge 14 None + Switch 9 14 + case 0: 10 + case 1: 11 + case 2: 12 + case 3: 13 + 10: Label + Return + 11: Label + 25: 24(ptr) AccessChain 20 21 + Store 25 23 + Branch 14 + 12: Label + Return + 13: Label + Return + 14: Label + 34: 33(ptr) AccessChain 20 21 32 + 35: 16(float) Load 34 + 36: 16(float) FAdd 35 30 + 37: 33(ptr) AccessChain 20 21 32 + Store 37 36 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.buffer.autoassign.frag.out b/deps/glslang/Test/baseResults/spv.buffer.autoassign.frag.out new file mode 100644 index 00000000..507318f7 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.buffer.autoassign.frag.out @@ -0,0 +1,93 @@ +spv.buffer.autoassign.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 50 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 47 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + Name 10 "@main(" + Name 13 "psout" + Name 16 "MyUB1" + MemberName 16(MyUB1) 0 "g_a" + MemberName 16(MyUB1) 1 "g_b" + Name 18 "" + Name 28 "MyUB2" + MemberName 28(MyUB2) 0 "g_c" + Name 30 "" + Name 34 "MyUB3" + MemberName 34(MyUB3) 0 "g_d" + Name 36 "" + Name 47 "@entryPointOutput.Color" + MemberDecorate 16(MyUB1) 0 Offset 0 + MemberDecorate 16(MyUB1) 1 Offset 4 + Decorate 16(MyUB1) Block + Decorate 18 DescriptorSet 0 + Decorate 18 Binding 20 + MemberDecorate 28(MyUB2) 0 Offset 0 + Decorate 28(MyUB2) Block + Decorate 30 DescriptorSet 0 + Decorate 30 Binding 15 + MemberDecorate 34(MyUB3) 0 Offset 0 + Decorate 34(MyUB3) Block + Decorate 36 DescriptorSet 0 + Decorate 36 Binding 16 + Decorate 47(@entryPointOutput.Color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 8(PS_OUTPUT) + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16(MyUB1): TypeStruct 6(float) 14(int) + 17: TypePointer Uniform 16(MyUB1) + 18: 17(ptr) Variable Uniform + 19: TypePointer Uniform 6(float) + 22: 14(int) Constant 1 + 23: TypePointer Uniform 14(int) + 28(MyUB2): TypeStruct 6(float) + 29: TypePointer Uniform 28(MyUB2) + 30: 29(ptr) Variable Uniform + 34(MyUB3): TypeStruct 6(float) + 35: TypePointer Uniform 34(MyUB3) + 36: 35(ptr) Variable Uniform + 41: TypePointer Function 7(fvec4) + 46: TypePointer Output 7(fvec4) +47(@entryPointOutput.Color): 46(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 48:8(PS_OUTPUT) FunctionCall 10(@main() + 49: 7(fvec4) CompositeExtract 48 0 + Store 47(@entryPointOutput.Color) 49 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(psout): 12(ptr) Variable Function + 20: 19(ptr) AccessChain 18 15 + 21: 6(float) Load 20 + 24: 23(ptr) AccessChain 18 22 + 25: 14(int) Load 24 + 26: 6(float) ConvertSToF 25 + 27: 6(float) FAdd 21 26 + 31: 19(ptr) AccessChain 30 15 + 32: 6(float) Load 31 + 33: 6(float) FAdd 27 32 + 37: 19(ptr) AccessChain 36 15 + 38: 6(float) Load 37 + 39: 6(float) FAdd 33 38 + 40: 7(fvec4) CompositeConstruct 39 39 39 39 + 42: 41(ptr) AccessChain 13(psout) 15 + Store 42 40 + 43:8(PS_OUTPUT) Load 13(psout) + ReturnValue 43 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.builtInXFB.vert.out b/deps/glslang/Test/baseResults/spv.builtInXFB.vert.out new file mode 100644 index 00000000..f175a19f --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.builtInXFB.vert.out @@ -0,0 +1,51 @@ +spv.builtInXFB.vert +error: SPIRV-Tools Validation Errors +error: Capability TransformFeedback is not allowed by Vulkan 1.0 specification (or requires extension) + OpCapability TransformFeedback + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 21 + + Capability Shader + Capability TransformFeedback + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 10 + ExecutionMode 4 Xfb + Source GLSL 450 + Name 4 "main" + Name 8 "gl_PerVertex" + MemberName 8(gl_PerVertex) 0 "gl_Position" + MemberName 8(gl_PerVertex) 1 "gl_PointSize" + Name 10 "" + MemberDecorate 8(gl_PerVertex) 0 Offset 20 + MemberDecorate 8(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 8(gl_PerVertex) 1 Offset 16 + MemberDecorate 8(gl_PerVertex) 1 BuiltIn PointSize + Decorate 8(gl_PerVertex) Block + Decorate 10 XfbBuffer 1 + Decorate 10 XfbStride 64 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(gl_PerVertex): TypeStruct 7(fvec4) 6(float) + 9: TypePointer Output 8(gl_PerVertex) + 10: 9(ptr) Variable Output + 11: TypeInt 32 1 + 12: 11(int) Constant 0 + 13: 6(float) Constant 1065353216 + 14: 7(fvec4) ConstantComposite 13 13 13 13 + 15: TypePointer Output 7(fvec4) + 17: 11(int) Constant 1 + 18: 6(float) Constant 1073741824 + 19: TypePointer Output 6(float) + 4(main): 2 Function None 3 + 5: Label + 16: 15(ptr) AccessChain 10 12 + Store 16 14 + 20: 19(ptr) AccessChain 10 17 + Store 20 18 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.computeShaderDerivatives.comp.out b/deps/glslang/Test/baseResults/spv.computeShaderDerivatives.comp.out new file mode 100644 index 00000000..f05dbc00 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.computeShaderDerivatives.comp.out @@ -0,0 +1,358 @@ +spv.computeShaderDerivatives.comp +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 212 + + Capability Shader + Capability DerivativeControl + Capability ComputeDerivativeGroupQuadsNV + Extension "SPV_NV_compute_shader_derivatives" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" + ExecutionMode 4 LocalSize 2 4 1 + ExecutionMode 4 DerivativeGroupQuadsNV + Source GLSL 450 + SourceExtension "GL_NV_compute_shader_derivatives" + Name 4 "main" + Name 10 "block" + MemberName 10(block) 0 "fDerivativeX" + MemberName 10(block) 1 "fDerivativeY" + MemberName 10(block) 2 "fDerivativeWidth" + MemberName 10(block) 3 "fCoarseDerivativeX" + MemberName 10(block) 4 "fCoarseDerivativeY" + MemberName 10(block) 5 "fCoarseDerivativeWidth" + MemberName 10(block) 6 "fFineDerivativeX" + MemberName 10(block) 7 "fFineDerivativeY" + MemberName 10(block) 8 "fFineDerivativeWidth" + MemberName 10(block) 9 "fX" + MemberName 10(block) 10 "fY" + MemberName 10(block) 11 "v2DerivativeX" + MemberName 10(block) 12 "v2DerivativeY" + MemberName 10(block) 13 "v2DerivativeWidth" + MemberName 10(block) 14 "v2CoarseDerivativeX" + MemberName 10(block) 15 "v2CoarseDerivativeY" + MemberName 10(block) 16 "v2CoarseDerivativeWidth" + MemberName 10(block) 17 "v2FineDerivativeX" + MemberName 10(block) 18 "v2FineDerivativeY" + MemberName 10(block) 19 "v2FineDerivativeWidth" + MemberName 10(block) 20 "v2X" + MemberName 10(block) 21 "v2Y" + MemberName 10(block) 22 "v3DerivativeX" + MemberName 10(block) 23 "v3DerivativeY" + MemberName 10(block) 24 "v3DerivativeWidth" + MemberName 10(block) 25 "v3CoarseDerivativeX" + MemberName 10(block) 26 "v3CoarseDerivativeY" + MemberName 10(block) 27 "v3CoarseDerivativeWidth" + MemberName 10(block) 28 "v3FineDerivativeX" + MemberName 10(block) 29 "v3FineDerivativeY" + MemberName 10(block) 30 "v3FineDerivativeWidth" + MemberName 10(block) 31 "v3X" + MemberName 10(block) 32 "v3Y" + MemberName 10(block) 33 "v4DerivativeX" + MemberName 10(block) 34 "v4DerivativeY" + MemberName 10(block) 35 "v4DerivativeWidth" + MemberName 10(block) 36 "v4CoarseDerivativeX" + MemberName 10(block) 37 "v4CoarseDerivativeY" + MemberName 10(block) 38 "v4CoarseDerivativeWidth" + MemberName 10(block) 39 "v4FineDerivativeX" + MemberName 10(block) 40 "v4FineDerivativeY" + MemberName 10(block) 41 "v4FineDerivativeWidth" + MemberName 10(block) 42 "v4X" + MemberName 10(block) 43 "v4Y" + Name 12 "" + MemberDecorate 10(block) 0 Offset 0 + MemberDecorate 10(block) 1 Offset 4 + MemberDecorate 10(block) 2 Offset 8 + MemberDecorate 10(block) 3 Offset 12 + MemberDecorate 10(block) 4 Offset 16 + MemberDecorate 10(block) 5 Offset 20 + MemberDecorate 10(block) 6 Offset 24 + MemberDecorate 10(block) 7 Offset 28 + MemberDecorate 10(block) 8 Offset 32 + MemberDecorate 10(block) 9 Offset 36 + MemberDecorate 10(block) 10 Offset 40 + MemberDecorate 10(block) 11 Offset 48 + MemberDecorate 10(block) 12 Offset 56 + MemberDecorate 10(block) 13 Offset 64 + MemberDecorate 10(block) 14 Offset 72 + MemberDecorate 10(block) 15 Offset 80 + MemberDecorate 10(block) 16 Offset 88 + MemberDecorate 10(block) 17 Offset 96 + MemberDecorate 10(block) 18 Offset 104 + MemberDecorate 10(block) 19 Offset 112 + MemberDecorate 10(block) 20 Offset 120 + MemberDecorate 10(block) 21 Offset 128 + MemberDecorate 10(block) 22 Offset 144 + MemberDecorate 10(block) 23 Offset 160 + MemberDecorate 10(block) 24 Offset 176 + MemberDecorate 10(block) 25 Offset 192 + MemberDecorate 10(block) 26 Offset 208 + MemberDecorate 10(block) 27 Offset 224 + MemberDecorate 10(block) 28 Offset 240 + MemberDecorate 10(block) 29 Offset 256 + MemberDecorate 10(block) 30 Offset 272 + MemberDecorate 10(block) 31 Offset 288 + MemberDecorate 10(block) 32 Offset 304 + MemberDecorate 10(block) 33 Offset 320 + MemberDecorate 10(block) 34 Offset 336 + MemberDecorate 10(block) 35 Offset 352 + MemberDecorate 10(block) 36 Offset 368 + MemberDecorate 10(block) 37 Offset 384 + MemberDecorate 10(block) 38 Offset 400 + MemberDecorate 10(block) 39 Offset 416 + MemberDecorate 10(block) 40 Offset 432 + MemberDecorate 10(block) 41 Offset 448 + MemberDecorate 10(block) 42 Offset 464 + MemberDecorate 10(block) 43 Offset 480 + Decorate 10(block) BufferBlock + Decorate 12 DescriptorSet 0 + Decorate 211 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypeVector 6(float) 3 + 9: TypeVector 6(float) 4 + 10(block): TypeStruct 6(float) 6(float) 6(float) 6(float) 6(float) 6(float) 6(float) 6(float) 6(float) 6(float) 6(float) 7(fvec2) 7(fvec2) 7(fvec2) 7(fvec2) 7(fvec2) 7(fvec2) 7(fvec2) 7(fvec2) 7(fvec2) 7(fvec2) 7(fvec2) 8(fvec3) 8(fvec3) 8(fvec3) 8(fvec3) 8(fvec3) 8(fvec3) 8(fvec3) 8(fvec3) 8(fvec3) 8(fvec3) 8(fvec3) 9(fvec4) 9(fvec4) 9(fvec4) 9(fvec4) 9(fvec4) 9(fvec4) 9(fvec4) 9(fvec4) 9(fvec4) 9(fvec4) 9(fvec4) + 11: TypePointer Uniform 10(block) + 12: 11(ptr) Variable Uniform + 13: TypeInt 32 1 + 14: 13(int) Constant 0 + 15: 13(int) Constant 9 + 16: TypePointer Uniform 6(float) + 21: 13(int) Constant 1 + 22: 13(int) Constant 10 + 27: 13(int) Constant 2 + 32: 13(int) Constant 3 + 37: 13(int) Constant 4 + 42: 13(int) Constant 5 + 47: 13(int) Constant 6 + 52: 13(int) Constant 7 + 57: 13(int) Constant 8 + 62: 13(int) Constant 11 + 63: 13(int) Constant 20 + 64: TypePointer Uniform 7(fvec2) + 69: 13(int) Constant 12 + 70: 13(int) Constant 21 + 75: 13(int) Constant 13 + 80: 13(int) Constant 14 + 85: 13(int) Constant 15 + 90: 13(int) Constant 16 + 95: 13(int) Constant 17 + 100: 13(int) Constant 18 + 105: 13(int) Constant 19 + 110: 13(int) Constant 22 + 111: 13(int) Constant 31 + 112: TypePointer Uniform 8(fvec3) + 117: 13(int) Constant 23 + 118: 13(int) Constant 32 + 123: 13(int) Constant 24 + 128: 13(int) Constant 25 + 133: 13(int) Constant 26 + 138: 13(int) Constant 27 + 143: 13(int) Constant 28 + 148: 13(int) Constant 29 + 153: 13(int) Constant 30 + 158: 13(int) Constant 33 + 159: 13(int) Constant 42 + 160: TypePointer Uniform 9(fvec4) + 165: 13(int) Constant 34 + 166: 13(int) Constant 43 + 171: 13(int) Constant 35 + 176: 13(int) Constant 36 + 181: 13(int) Constant 37 + 186: 13(int) Constant 38 + 191: 13(int) Constant 39 + 196: 13(int) Constant 40 + 201: 13(int) Constant 41 + 206: TypeInt 32 0 + 207: TypeVector 206(int) 3 + 208: 206(int) Constant 2 + 209: 206(int) Constant 4 + 210: 206(int) Constant 1 + 211: 207(ivec3) ConstantComposite 208 209 210 + 4(main): 2 Function None 3 + 5: Label + 17: 16(ptr) AccessChain 12 15 + 18: 6(float) Load 17 + 19: 6(float) DPdx 18 + 20: 16(ptr) AccessChain 12 14 + Store 20 19 + 23: 16(ptr) AccessChain 12 22 + 24: 6(float) Load 23 + 25: 6(float) DPdy 24 + 26: 16(ptr) AccessChain 12 21 + Store 26 25 + 28: 16(ptr) AccessChain 12 15 + 29: 6(float) Load 28 + 30: 6(float) Fwidth 29 + 31: 16(ptr) AccessChain 12 27 + Store 31 30 + 33: 16(ptr) AccessChain 12 15 + 34: 6(float) Load 33 + 35: 6(float) DPdxCoarse 34 + 36: 16(ptr) AccessChain 12 32 + Store 36 35 + 38: 16(ptr) AccessChain 12 22 + 39: 6(float) Load 38 + 40: 6(float) DPdyCoarse 39 + 41: 16(ptr) AccessChain 12 37 + Store 41 40 + 43: 16(ptr) AccessChain 12 15 + 44: 6(float) Load 43 + 45: 6(float) FwidthCoarse 44 + 46: 16(ptr) AccessChain 12 42 + Store 46 45 + 48: 16(ptr) AccessChain 12 15 + 49: 6(float) Load 48 + 50: 6(float) DPdxFine 49 + 51: 16(ptr) AccessChain 12 47 + Store 51 50 + 53: 16(ptr) AccessChain 12 22 + 54: 6(float) Load 53 + 55: 6(float) DPdyFine 54 + 56: 16(ptr) AccessChain 12 52 + Store 56 55 + 58: 16(ptr) AccessChain 12 15 + 59: 6(float) Load 58 + 60: 6(float) FwidthFine 59 + 61: 16(ptr) AccessChain 12 57 + Store 61 60 + 65: 64(ptr) AccessChain 12 63 + 66: 7(fvec2) Load 65 + 67: 7(fvec2) DPdx 66 + 68: 64(ptr) AccessChain 12 62 + Store 68 67 + 71: 64(ptr) AccessChain 12 70 + 72: 7(fvec2) Load 71 + 73: 7(fvec2) DPdy 72 + 74: 64(ptr) AccessChain 12 69 + Store 74 73 + 76: 64(ptr) AccessChain 12 63 + 77: 7(fvec2) Load 76 + 78: 7(fvec2) Fwidth 77 + 79: 64(ptr) AccessChain 12 75 + Store 79 78 + 81: 64(ptr) AccessChain 12 63 + 82: 7(fvec2) Load 81 + 83: 7(fvec2) DPdxCoarse 82 + 84: 64(ptr) AccessChain 12 80 + Store 84 83 + 86: 64(ptr) AccessChain 12 70 + 87: 7(fvec2) Load 86 + 88: 7(fvec2) DPdyCoarse 87 + 89: 64(ptr) AccessChain 12 85 + Store 89 88 + 91: 64(ptr) AccessChain 12 63 + 92: 7(fvec2) Load 91 + 93: 7(fvec2) FwidthCoarse 92 + 94: 64(ptr) AccessChain 12 90 + Store 94 93 + 96: 64(ptr) AccessChain 12 63 + 97: 7(fvec2) Load 96 + 98: 7(fvec2) DPdxFine 97 + 99: 64(ptr) AccessChain 12 95 + Store 99 98 + 101: 64(ptr) AccessChain 12 70 + 102: 7(fvec2) Load 101 + 103: 7(fvec2) DPdyFine 102 + 104: 64(ptr) AccessChain 12 100 + Store 104 103 + 106: 64(ptr) AccessChain 12 63 + 107: 7(fvec2) Load 106 + 108: 7(fvec2) FwidthFine 107 + 109: 64(ptr) AccessChain 12 105 + Store 109 108 + 113: 112(ptr) AccessChain 12 111 + 114: 8(fvec3) Load 113 + 115: 8(fvec3) DPdx 114 + 116: 112(ptr) AccessChain 12 110 + Store 116 115 + 119: 112(ptr) AccessChain 12 118 + 120: 8(fvec3) Load 119 + 121: 8(fvec3) DPdy 120 + 122: 112(ptr) AccessChain 12 117 + Store 122 121 + 124: 112(ptr) AccessChain 12 111 + 125: 8(fvec3) Load 124 + 126: 8(fvec3) Fwidth 125 + 127: 112(ptr) AccessChain 12 123 + Store 127 126 + 129: 112(ptr) AccessChain 12 111 + 130: 8(fvec3) Load 129 + 131: 8(fvec3) DPdxCoarse 130 + 132: 112(ptr) AccessChain 12 128 + Store 132 131 + 134: 112(ptr) AccessChain 12 118 + 135: 8(fvec3) Load 134 + 136: 8(fvec3) DPdyCoarse 135 + 137: 112(ptr) AccessChain 12 133 + Store 137 136 + 139: 112(ptr) AccessChain 12 111 + 140: 8(fvec3) Load 139 + 141: 8(fvec3) FwidthCoarse 140 + 142: 112(ptr) AccessChain 12 138 + Store 142 141 + 144: 112(ptr) AccessChain 12 111 + 145: 8(fvec3) Load 144 + 146: 8(fvec3) DPdxFine 145 + 147: 112(ptr) AccessChain 12 143 + Store 147 146 + 149: 112(ptr) AccessChain 12 118 + 150: 8(fvec3) Load 149 + 151: 8(fvec3) DPdyFine 150 + 152: 112(ptr) AccessChain 12 148 + Store 152 151 + 154: 112(ptr) AccessChain 12 111 + 155: 8(fvec3) Load 154 + 156: 8(fvec3) FwidthFine 155 + 157: 112(ptr) AccessChain 12 153 + Store 157 156 + 161: 160(ptr) AccessChain 12 159 + 162: 9(fvec4) Load 161 + 163: 9(fvec4) DPdx 162 + 164: 160(ptr) AccessChain 12 158 + Store 164 163 + 167: 160(ptr) AccessChain 12 166 + 168: 9(fvec4) Load 167 + 169: 9(fvec4) DPdy 168 + 170: 160(ptr) AccessChain 12 165 + Store 170 169 + 172: 160(ptr) AccessChain 12 159 + 173: 9(fvec4) Load 172 + 174: 9(fvec4) Fwidth 173 + 175: 160(ptr) AccessChain 12 171 + Store 175 174 + 177: 160(ptr) AccessChain 12 159 + 178: 9(fvec4) Load 177 + 179: 9(fvec4) DPdxCoarse 178 + 180: 160(ptr) AccessChain 12 176 + Store 180 179 + 182: 160(ptr) AccessChain 12 166 + 183: 9(fvec4) Load 182 + 184: 9(fvec4) DPdyCoarse 183 + 185: 160(ptr) AccessChain 12 181 + Store 185 184 + 187: 160(ptr) AccessChain 12 159 + 188: 9(fvec4) Load 187 + 189: 9(fvec4) FwidthCoarse 188 + 190: 160(ptr) AccessChain 12 186 + Store 190 189 + 192: 160(ptr) AccessChain 12 159 + 193: 9(fvec4) Load 192 + 194: 9(fvec4) DPdxFine 193 + 195: 160(ptr) AccessChain 12 191 + Store 195 194 + 197: 160(ptr) AccessChain 12 166 + 198: 9(fvec4) Load 197 + 199: 9(fvec4) DPdyFine 198 + 200: 160(ptr) AccessChain 12 196 + Store 200 199 + 202: 160(ptr) AccessChain 12 159 + 203: 9(fvec4) Load 202 + 204: 9(fvec4) FwidthFine 203 + 205: 160(ptr) AccessChain 12 201 + Store 205 204 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.computeShaderDerivatives2.comp.out b/deps/glslang/Test/baseResults/spv.computeShaderDerivatives2.comp.out new file mode 100644 index 00000000..94a3dfc2 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.computeShaderDerivatives2.comp.out @@ -0,0 +1,358 @@ +spv.computeShaderDerivatives2.comp +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 212 + + Capability Shader + Capability DerivativeControl + Capability ComputeDerivativeGroupLinearNV + Extension "SPV_NV_compute_shader_derivatives" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" + ExecutionMode 4 LocalSize 2 4 1 + ExecutionMode 4 DerivativeGroupLinearNV + Source ESSL 320 + SourceExtension "GL_NV_compute_shader_derivatives" + Name 4 "main" + Name 10 "block" + MemberName 10(block) 0 "fDerivativeX" + MemberName 10(block) 1 "fDerivativeY" + MemberName 10(block) 2 "fDerivativeWidth" + MemberName 10(block) 3 "fCoarseDerivativeX" + MemberName 10(block) 4 "fCoarseDerivativeY" + MemberName 10(block) 5 "fCoarseDerivativeWidth" + MemberName 10(block) 6 "fFineDerivativeX" + MemberName 10(block) 7 "fFineDerivativeY" + MemberName 10(block) 8 "fFineDerivativeWidth" + MemberName 10(block) 9 "fX" + MemberName 10(block) 10 "fY" + MemberName 10(block) 11 "v2DerivativeX" + MemberName 10(block) 12 "v2DerivativeY" + MemberName 10(block) 13 "v2DerivativeWidth" + MemberName 10(block) 14 "v2CoarseDerivativeX" + MemberName 10(block) 15 "v2CoarseDerivativeY" + MemberName 10(block) 16 "v2CoarseDerivativeWidth" + MemberName 10(block) 17 "v2FineDerivativeX" + MemberName 10(block) 18 "v2FineDerivativeY" + MemberName 10(block) 19 "v2FineDerivativeWidth" + MemberName 10(block) 20 "v2X" + MemberName 10(block) 21 "v2Y" + MemberName 10(block) 22 "v3DerivativeX" + MemberName 10(block) 23 "v3DerivativeY" + MemberName 10(block) 24 "v3DerivativeWidth" + MemberName 10(block) 25 "v3CoarseDerivativeX" + MemberName 10(block) 26 "v3CoarseDerivativeY" + MemberName 10(block) 27 "v3CoarseDerivativeWidth" + MemberName 10(block) 28 "v3FineDerivativeX" + MemberName 10(block) 29 "v3FineDerivativeY" + MemberName 10(block) 30 "v3FineDerivativeWidth" + MemberName 10(block) 31 "v3X" + MemberName 10(block) 32 "v3Y" + MemberName 10(block) 33 "v4DerivativeX" + MemberName 10(block) 34 "v4DerivativeY" + MemberName 10(block) 35 "v4DerivativeWidth" + MemberName 10(block) 36 "v4CoarseDerivativeX" + MemberName 10(block) 37 "v4CoarseDerivativeY" + MemberName 10(block) 38 "v4CoarseDerivativeWidth" + MemberName 10(block) 39 "v4FineDerivativeX" + MemberName 10(block) 40 "v4FineDerivativeY" + MemberName 10(block) 41 "v4FineDerivativeWidth" + MemberName 10(block) 42 "v4X" + MemberName 10(block) 43 "v4Y" + Name 12 "" + MemberDecorate 10(block) 0 Offset 0 + MemberDecorate 10(block) 1 Offset 4 + MemberDecorate 10(block) 2 Offset 8 + MemberDecorate 10(block) 3 Offset 12 + MemberDecorate 10(block) 4 Offset 16 + MemberDecorate 10(block) 5 Offset 20 + MemberDecorate 10(block) 6 Offset 24 + MemberDecorate 10(block) 7 Offset 28 + MemberDecorate 10(block) 8 Offset 32 + MemberDecorate 10(block) 9 Offset 36 + MemberDecorate 10(block) 10 Offset 40 + MemberDecorate 10(block) 11 Offset 48 + MemberDecorate 10(block) 12 Offset 56 + MemberDecorate 10(block) 13 Offset 64 + MemberDecorate 10(block) 14 Offset 72 + MemberDecorate 10(block) 15 Offset 80 + MemberDecorate 10(block) 16 Offset 88 + MemberDecorate 10(block) 17 Offset 96 + MemberDecorate 10(block) 18 Offset 104 + MemberDecorate 10(block) 19 Offset 112 + MemberDecorate 10(block) 20 Offset 120 + MemberDecorate 10(block) 21 Offset 128 + MemberDecorate 10(block) 22 Offset 144 + MemberDecorate 10(block) 23 Offset 160 + MemberDecorate 10(block) 24 Offset 176 + MemberDecorate 10(block) 25 Offset 192 + MemberDecorate 10(block) 26 Offset 208 + MemberDecorate 10(block) 27 Offset 224 + MemberDecorate 10(block) 28 Offset 240 + MemberDecorate 10(block) 29 Offset 256 + MemberDecorate 10(block) 30 Offset 272 + MemberDecorate 10(block) 31 Offset 288 + MemberDecorate 10(block) 32 Offset 304 + MemberDecorate 10(block) 33 Offset 320 + MemberDecorate 10(block) 34 Offset 336 + MemberDecorate 10(block) 35 Offset 352 + MemberDecorate 10(block) 36 Offset 368 + MemberDecorate 10(block) 37 Offset 384 + MemberDecorate 10(block) 38 Offset 400 + MemberDecorate 10(block) 39 Offset 416 + MemberDecorate 10(block) 40 Offset 432 + MemberDecorate 10(block) 41 Offset 448 + MemberDecorate 10(block) 42 Offset 464 + MemberDecorate 10(block) 43 Offset 480 + Decorate 10(block) BufferBlock + Decorate 12 DescriptorSet 0 + Decorate 211 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypeVector 6(float) 3 + 9: TypeVector 6(float) 4 + 10(block): TypeStruct 6(float) 6(float) 6(float) 6(float) 6(float) 6(float) 6(float) 6(float) 6(float) 6(float) 6(float) 7(fvec2) 7(fvec2) 7(fvec2) 7(fvec2) 7(fvec2) 7(fvec2) 7(fvec2) 7(fvec2) 7(fvec2) 7(fvec2) 7(fvec2) 8(fvec3) 8(fvec3) 8(fvec3) 8(fvec3) 8(fvec3) 8(fvec3) 8(fvec3) 8(fvec3) 8(fvec3) 8(fvec3) 8(fvec3) 9(fvec4) 9(fvec4) 9(fvec4) 9(fvec4) 9(fvec4) 9(fvec4) 9(fvec4) 9(fvec4) 9(fvec4) 9(fvec4) 9(fvec4) + 11: TypePointer Uniform 10(block) + 12: 11(ptr) Variable Uniform + 13: TypeInt 32 1 + 14: 13(int) Constant 0 + 15: 13(int) Constant 9 + 16: TypePointer Uniform 6(float) + 21: 13(int) Constant 1 + 22: 13(int) Constant 10 + 27: 13(int) Constant 2 + 32: 13(int) Constant 3 + 37: 13(int) Constant 4 + 42: 13(int) Constant 5 + 47: 13(int) Constant 6 + 52: 13(int) Constant 7 + 57: 13(int) Constant 8 + 62: 13(int) Constant 11 + 63: 13(int) Constant 20 + 64: TypePointer Uniform 7(fvec2) + 69: 13(int) Constant 12 + 70: 13(int) Constant 21 + 75: 13(int) Constant 13 + 80: 13(int) Constant 14 + 85: 13(int) Constant 15 + 90: 13(int) Constant 16 + 95: 13(int) Constant 17 + 100: 13(int) Constant 18 + 105: 13(int) Constant 19 + 110: 13(int) Constant 22 + 111: 13(int) Constant 31 + 112: TypePointer Uniform 8(fvec3) + 117: 13(int) Constant 23 + 118: 13(int) Constant 32 + 123: 13(int) Constant 24 + 128: 13(int) Constant 25 + 133: 13(int) Constant 26 + 138: 13(int) Constant 27 + 143: 13(int) Constant 28 + 148: 13(int) Constant 29 + 153: 13(int) Constant 30 + 158: 13(int) Constant 33 + 159: 13(int) Constant 42 + 160: TypePointer Uniform 9(fvec4) + 165: 13(int) Constant 34 + 166: 13(int) Constant 43 + 171: 13(int) Constant 35 + 176: 13(int) Constant 36 + 181: 13(int) Constant 37 + 186: 13(int) Constant 38 + 191: 13(int) Constant 39 + 196: 13(int) Constant 40 + 201: 13(int) Constant 41 + 206: TypeInt 32 0 + 207: TypeVector 206(int) 3 + 208: 206(int) Constant 2 + 209: 206(int) Constant 4 + 210: 206(int) Constant 1 + 211: 207(ivec3) ConstantComposite 208 209 210 + 4(main): 2 Function None 3 + 5: Label + 17: 16(ptr) AccessChain 12 15 + 18: 6(float) Load 17 + 19: 6(float) DPdx 18 + 20: 16(ptr) AccessChain 12 14 + Store 20 19 + 23: 16(ptr) AccessChain 12 22 + 24: 6(float) Load 23 + 25: 6(float) DPdy 24 + 26: 16(ptr) AccessChain 12 21 + Store 26 25 + 28: 16(ptr) AccessChain 12 15 + 29: 6(float) Load 28 + 30: 6(float) Fwidth 29 + 31: 16(ptr) AccessChain 12 27 + Store 31 30 + 33: 16(ptr) AccessChain 12 15 + 34: 6(float) Load 33 + 35: 6(float) DPdxCoarse 34 + 36: 16(ptr) AccessChain 12 32 + Store 36 35 + 38: 16(ptr) AccessChain 12 22 + 39: 6(float) Load 38 + 40: 6(float) DPdyCoarse 39 + 41: 16(ptr) AccessChain 12 37 + Store 41 40 + 43: 16(ptr) AccessChain 12 15 + 44: 6(float) Load 43 + 45: 6(float) FwidthCoarse 44 + 46: 16(ptr) AccessChain 12 42 + Store 46 45 + 48: 16(ptr) AccessChain 12 15 + 49: 6(float) Load 48 + 50: 6(float) DPdxFine 49 + 51: 16(ptr) AccessChain 12 47 + Store 51 50 + 53: 16(ptr) AccessChain 12 22 + 54: 6(float) Load 53 + 55: 6(float) DPdyFine 54 + 56: 16(ptr) AccessChain 12 52 + Store 56 55 + 58: 16(ptr) AccessChain 12 15 + 59: 6(float) Load 58 + 60: 6(float) FwidthFine 59 + 61: 16(ptr) AccessChain 12 57 + Store 61 60 + 65: 64(ptr) AccessChain 12 63 + 66: 7(fvec2) Load 65 + 67: 7(fvec2) DPdx 66 + 68: 64(ptr) AccessChain 12 62 + Store 68 67 + 71: 64(ptr) AccessChain 12 70 + 72: 7(fvec2) Load 71 + 73: 7(fvec2) DPdy 72 + 74: 64(ptr) AccessChain 12 69 + Store 74 73 + 76: 64(ptr) AccessChain 12 63 + 77: 7(fvec2) Load 76 + 78: 7(fvec2) Fwidth 77 + 79: 64(ptr) AccessChain 12 75 + Store 79 78 + 81: 64(ptr) AccessChain 12 63 + 82: 7(fvec2) Load 81 + 83: 7(fvec2) DPdxCoarse 82 + 84: 64(ptr) AccessChain 12 80 + Store 84 83 + 86: 64(ptr) AccessChain 12 70 + 87: 7(fvec2) Load 86 + 88: 7(fvec2) DPdyCoarse 87 + 89: 64(ptr) AccessChain 12 85 + Store 89 88 + 91: 64(ptr) AccessChain 12 63 + 92: 7(fvec2) Load 91 + 93: 7(fvec2) FwidthCoarse 92 + 94: 64(ptr) AccessChain 12 90 + Store 94 93 + 96: 64(ptr) AccessChain 12 63 + 97: 7(fvec2) Load 96 + 98: 7(fvec2) DPdxFine 97 + 99: 64(ptr) AccessChain 12 95 + Store 99 98 + 101: 64(ptr) AccessChain 12 70 + 102: 7(fvec2) Load 101 + 103: 7(fvec2) DPdyFine 102 + 104: 64(ptr) AccessChain 12 100 + Store 104 103 + 106: 64(ptr) AccessChain 12 63 + 107: 7(fvec2) Load 106 + 108: 7(fvec2) FwidthFine 107 + 109: 64(ptr) AccessChain 12 105 + Store 109 108 + 113: 112(ptr) AccessChain 12 111 + 114: 8(fvec3) Load 113 + 115: 8(fvec3) DPdx 114 + 116: 112(ptr) AccessChain 12 110 + Store 116 115 + 119: 112(ptr) AccessChain 12 118 + 120: 8(fvec3) Load 119 + 121: 8(fvec3) DPdy 120 + 122: 112(ptr) AccessChain 12 117 + Store 122 121 + 124: 112(ptr) AccessChain 12 111 + 125: 8(fvec3) Load 124 + 126: 8(fvec3) Fwidth 125 + 127: 112(ptr) AccessChain 12 123 + Store 127 126 + 129: 112(ptr) AccessChain 12 111 + 130: 8(fvec3) Load 129 + 131: 8(fvec3) DPdxCoarse 130 + 132: 112(ptr) AccessChain 12 128 + Store 132 131 + 134: 112(ptr) AccessChain 12 118 + 135: 8(fvec3) Load 134 + 136: 8(fvec3) DPdyCoarse 135 + 137: 112(ptr) AccessChain 12 133 + Store 137 136 + 139: 112(ptr) AccessChain 12 111 + 140: 8(fvec3) Load 139 + 141: 8(fvec3) FwidthCoarse 140 + 142: 112(ptr) AccessChain 12 138 + Store 142 141 + 144: 112(ptr) AccessChain 12 111 + 145: 8(fvec3) Load 144 + 146: 8(fvec3) DPdxFine 145 + 147: 112(ptr) AccessChain 12 143 + Store 147 146 + 149: 112(ptr) AccessChain 12 118 + 150: 8(fvec3) Load 149 + 151: 8(fvec3) DPdyFine 150 + 152: 112(ptr) AccessChain 12 148 + Store 152 151 + 154: 112(ptr) AccessChain 12 111 + 155: 8(fvec3) Load 154 + 156: 8(fvec3) FwidthFine 155 + 157: 112(ptr) AccessChain 12 153 + Store 157 156 + 161: 160(ptr) AccessChain 12 159 + 162: 9(fvec4) Load 161 + 163: 9(fvec4) DPdx 162 + 164: 160(ptr) AccessChain 12 158 + Store 164 163 + 167: 160(ptr) AccessChain 12 166 + 168: 9(fvec4) Load 167 + 169: 9(fvec4) DPdy 168 + 170: 160(ptr) AccessChain 12 165 + Store 170 169 + 172: 160(ptr) AccessChain 12 159 + 173: 9(fvec4) Load 172 + 174: 9(fvec4) Fwidth 173 + 175: 160(ptr) AccessChain 12 171 + Store 175 174 + 177: 160(ptr) AccessChain 12 159 + 178: 9(fvec4) Load 177 + 179: 9(fvec4) DPdxCoarse 178 + 180: 160(ptr) AccessChain 12 176 + Store 180 179 + 182: 160(ptr) AccessChain 12 166 + 183: 9(fvec4) Load 182 + 184: 9(fvec4) DPdyCoarse 183 + 185: 160(ptr) AccessChain 12 181 + Store 185 184 + 187: 160(ptr) AccessChain 12 159 + 188: 9(fvec4) Load 187 + 189: 9(fvec4) FwidthCoarse 188 + 190: 160(ptr) AccessChain 12 186 + Store 190 189 + 192: 160(ptr) AccessChain 12 159 + 193: 9(fvec4) Load 192 + 194: 9(fvec4) DPdxFine 193 + 195: 160(ptr) AccessChain 12 191 + Store 195 194 + 197: 160(ptr) AccessChain 12 166 + 198: 9(fvec4) Load 197 + 199: 9(fvec4) DPdyFine 198 + 200: 160(ptr) AccessChain 12 196 + Store 200 199 + 202: 160(ptr) AccessChain 12 159 + 203: 9(fvec4) Load 202 + 204: 9(fvec4) FwidthFine 203 + 205: 160(ptr) AccessChain 12 201 + Store 205 204 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.conditionalDiscard.frag.out b/deps/glslang/Test/baseResults/spv.conditionalDiscard.frag.out new file mode 100644 index 00000000..f5e9e6fa --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.conditionalDiscard.frag.out @@ -0,0 +1,58 @@ +spv.conditionalDiscard.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 36 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 17 34 + ExecutionMode 4 OriginUpperLeft + Source GLSL 400 + Name 4 "main" + Name 9 "v" + Name 13 "tex" + Name 17 "coord" + Name 34 "gl_FragColor" + Decorate 13(tex) DescriptorSet 0 + Decorate 34(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypeImage 6(float) 2D sampled format:Unknown + 11: TypeSampledImage 10 + 12: TypePointer UniformConstant 11 + 13(tex): 12(ptr) Variable UniformConstant + 15: TypeVector 6(float) 2 + 16: TypePointer Input 15(fvec2) + 17(coord): 16(ptr) Variable Input + 21: 6(float) Constant 1036831949 + 22: 6(float) Constant 1045220557 + 23: 6(float) Constant 1050253722 + 24: 6(float) Constant 1053609165 + 25: 7(fvec4) ConstantComposite 21 22 23 24 + 26: TypeBool + 27: TypeVector 26(bool) 4 + 33: TypePointer Output 7(fvec4) +34(gl_FragColor): 33(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 9(v): 8(ptr) Variable Function + 14: 11 Load 13(tex) + 18: 15(fvec2) Load 17(coord) + 19: 7(fvec4) ImageSampleImplicitLod 14 18 + Store 9(v) 19 + 20: 7(fvec4) Load 9(v) + 28: 27(bvec4) FOrdEqual 20 25 + 29: 26(bool) All 28 + SelectionMerge 31 None + BranchConditional 29 30 31 + 30: Label + Kill + 31: Label + 35: 7(fvec4) Load 9(v) + Store 34(gl_FragColor) 35 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.constStruct.vert.out b/deps/glslang/Test/baseResults/spv.constStruct.vert.out new file mode 100644 index 00000000..d04f33d1 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.constStruct.vert.out @@ -0,0 +1,45 @@ +spv.constStruct.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 23 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" + Source GLSL 450 + Name 4 "main" + Name 9 "T" + MemberName 9(T) 0 "m" + Name 10 "U" + MemberName 10(U) 0 "m" + Name 11 "S" + MemberName 11(S) 0 "t" + MemberName 11(S) 1 "u" + Name 13 "s1" + Name 22 "s2" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypeMatrix 7(fvec2) 2 + 9(T): TypeStruct 8 + 10(U): TypeStruct 8 + 11(S): TypeStruct 9(T) 10(U) + 12: TypePointer Function 11(S) + 14: 6(float) Constant 1065353216 + 15: 6(float) Constant 0 + 16: 7(fvec2) ConstantComposite 14 15 + 17: 7(fvec2) ConstantComposite 15 14 + 18: 8 ConstantComposite 16 17 + 19: 9(T) ConstantComposite 18 + 20: 10(U) ConstantComposite 18 + 21: 11(S) ConstantComposite 19 20 + 4(main): 2 Function None 3 + 5: Label + 13(s1): 12(ptr) Variable Function + 22(s2): 12(ptr) Variable Function + Store 13(s1) 21 + Store 22(s2) 21 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.controlFlowAttributes.frag.out b/deps/glslang/Test/baseResults/spv.controlFlowAttributes.frag.out new file mode 100644 index 00000000..2f074def --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.controlFlowAttributes.frag.out @@ -0,0 +1,240 @@ +spv.controlFlowAttributes.frag +WARNING: 0:20: '' : attribute with arguments not recognized, skipping +WARNING: 0:21: '' : attribute with arguments not recognized, skipping +WARNING: 0:22: '' : attribute with arguments not recognized, skipping +WARNING: 0:23: 'dependency_length' : expected a single integer argument +WARNING: 0:24: '' : attribute with arguments not recognized, skipping +WARNING: 0:25: '' : attribute with arguments not recognized, skipping +WARNING: 0:26: '' : attribute with arguments not recognized, skipping + +error: SPIRV-Tools Validation Errors +error: Invalid loop control operand: 4 has invalid mask component 4 +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 118 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_control_flow_attributes" + Name 4 "main" + Name 8 "i" + Name 36 "i" + Name 47 "cond" + Name 60 "i" + Name 79 "i" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 16: 6(int) Constant 8 + 17: TypeBool + 20: 6(int) Constant 1 + 31: 17(bool) ConstantTrue + 46: TypePointer Private 17(bool) + 47(cond): 46(ptr) Variable Private + 54: 17(bool) ConstantFalse + 55: 6(int) Constant 3 + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + 36(i): 7(ptr) Variable Function + 60(i): 7(ptr) Variable Function + 79(i): 7(ptr) Variable Function + Store 8(i) 9 + Branch 10 + 10: Label + LoopMerge 12 13 Unroll + Branch 14 + 14: Label + 15: 6(int) Load 8(i) + 18: 17(bool) SLessThan 15 16 + BranchConditional 18 11 12 + 11: Label + Branch 13 + 13: Label + 19: 6(int) Load 8(i) + 21: 6(int) IAdd 19 20 + Store 8(i) 21 + Branch 10 + 12: Label + Branch 22 + 22: Label + LoopMerge 24 25 DontUnroll + Branch 23 + 23: Label + Branch 25 + 25: Label + Branch 22 + 24: Label + Branch 26 + 26: Label + LoopMerge 28 29 DontUnroll + Branch 30 + 30: Label + BranchConditional 31 27 28 + 27: Label + Branch 29 + 29: Label + Branch 26 + 28: Label + Branch 32 + 32: Label + LoopMerge 34 35 DependencyInfinite + Branch 33 + 33: Label + Branch 35 + 35: Label + BranchConditional 31 32 34 + 34: Label + Store 36(i) 9 + Branch 37 + 37: Label + LoopMerge 39 40 DependencyLength 4 + Branch 41 + 41: Label + 42: 6(int) Load 36(i) + 43: 17(bool) SLessThan 42 16 + BranchConditional 43 38 39 + 38: Label + Branch 40 + 40: Label + 44: 6(int) Load 36(i) + 45: 6(int) IAdd 44 20 + Store 36(i) 45 + Branch 37 + 39: Label + 48: 17(bool) Load 47(cond) + SelectionMerge 50 Flatten + BranchConditional 48 49 50 + 49: Label + Branch 50 + 50: Label + 51: 17(bool) Load 47(cond) + SelectionMerge 53 DontFlatten + BranchConditional 51 52 53 + 52: Label + Store 47(cond) 54 + Branch 53 + 53: Label + SelectionMerge 57 DontFlatten + Switch 55 57 + case 3: 56 + 56: Label + Branch 57 + 57: Label + Store 60(i) 9 + Branch 61 + 61: Label + LoopMerge 63 64 None + Branch 65 + 65: Label + 66: 6(int) Load 60(i) + 67: 17(bool) SLessThan 66 16 + BranchConditional 67 62 63 + 62: Label + Branch 64 + 64: Label + 68: 6(int) Load 60(i) + 69: 6(int) IAdd 68 20 + Store 60(i) 69 + Branch 61 + 63: Label + Branch 70 + 70: Label + LoopMerge 72 73 None + Branch 74 + 74: Label + BranchConditional 31 71 72 + 71: Label + Branch 73 + 73: Label + Branch 70 + 72: Label + Branch 75 + 75: Label + LoopMerge 77 78 None + Branch 76 + 76: Label + Branch 78 + 78: Label + BranchConditional 31 75 77 + 77: Label + Store 79(i) 9 + Branch 80 + 80: Label + LoopMerge 82 83 None + Branch 84 + 84: Label + 85: 6(int) Load 79(i) + 86: 17(bool) SLessThan 85 16 + BranchConditional 86 81 82 + 81: Label + Branch 83 + 83: Label + 87: 6(int) Load 79(i) + 88: 6(int) IAdd 87 20 + Store 79(i) 88 + Branch 80 + 82: Label + 89: 17(bool) Load 47(cond) + SelectionMerge 91 None + BranchConditional 89 90 91 + 90: Label + Branch 91 + 91: Label + 92: 17(bool) Load 47(cond) + SelectionMerge 94 None + BranchConditional 92 93 94 + 93: Label + Store 47(cond) 54 + Branch 94 + 94: Label + SelectionMerge 96 None + Switch 55 96 + case 3: 95 + 95: Label + Branch 96 + 96: Label + Branch 99 + 99: Label + LoopMerge 101 102 Unroll DontUnroll DependencyLength 2 + Branch 103 + 103: Label + 104: 17(bool) Load 47(cond) + BranchConditional 104 100 101 + 100: Label + Branch 102 + 102: Label + Branch 99 + 101: Label + SelectionMerge 106 DontFlatten + Switch 55 106 + case 3: 105 + 105: Label + Branch 106 + 106: Label + 109: 17(bool) Load 47(cond) + SelectionMerge 111 Flatten + BranchConditional 109 110 111 + 110: Label + Branch 111 + 111: Label + Branch 112 + 112: Label + LoopMerge 114 115 DependencyInfinite + Branch 116 + 116: Label + 117: 17(bool) Load 47(cond) + BranchConditional 117 113 114 + 113: Label + Branch 115 + 115: Label + Branch 112 + 114: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.conversion.frag.out b/deps/glslang/Test/baseResults/spv.conversion.frag.out new file mode 100644 index 00000000..a3215324 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.conversion.frag.out @@ -0,0 +1,574 @@ +spv.conversion.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 455 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 39 53 157 322 446 448 450 452 454 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 8 "b" + Name 11 "u_i" + Name 18 "u_f" + Name 25 "b2" + Name 33 "b3" + Name 39 "i_i" + Name 45 "b4" + Name 53 "i_f" + Name 58 "i" + Name 68 "i2" + Name 71 "u_f2" + Name 81 "i3" + Name 84 "u_f3" + Name 94 "i4" + Name 97 "u_f4" + Name 106 "f" + Name 110 "f2" + Name 114 "f3" + Name 118 "f4" + Name 157 "i_i4" + Name 322 "gl_FragColor" + Name 417 "cv2" + Name 418 "cv5" + Name 428 "u_b" + Name 430 "u_b2" + Name 432 "u_b3" + Name 434 "u_b4" + Name 436 "u_i2" + Name 438 "u_i3" + Name 440 "u_i4" + Name 441 "i_b" + Name 442 "i_b2" + Name 443 "i_b3" + Name 444 "i_b4" + Name 446 "i_i2" + Name 448 "i_i3" + Name 450 "i_f2" + Name 452 "i_f3" + Name 454 "i_f4" + Decorate 39(i_i) Flat + Decorate 157(i_i4) Flat + Decorate 322(gl_FragColor) Location 0 + Decorate 446(i_i2) Flat + Decorate 448(i_i3) Flat + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeBool + 7: TypePointer Function 6(bool) + 9: TypeInt 32 1 + 10: TypePointer Private 9(int) + 11(u_i): 10(ptr) Variable Private + 13: TypeInt 32 0 + 14: 13(int) Constant 0 + 16: TypeFloat 32 + 17: TypePointer Private 16(float) + 18(u_f): 17(ptr) Variable Private + 20: 16(float) Constant 0 + 23: TypeVector 6(bool) 2 + 24: TypePointer Function 23(bvec2) + 31: TypeVector 6(bool) 3 + 32: TypePointer Function 31(bvec3) + 38: TypePointer Input 9(int) + 39(i_i): 38(ptr) Variable Input + 43: TypeVector 6(bool) 4 + 44: TypePointer Function 43(bvec4) + 52: TypePointer Input 16(float) + 53(i_f): 52(ptr) Variable Input + 57: TypePointer Function 9(int) + 62: 9(int) Constant 0 + 63: 9(int) Constant 1 + 66: TypeVector 9(int) 2 + 67: TypePointer Function 66(ivec2) + 69: TypeVector 16(float) 2 + 70: TypePointer Private 69(fvec2) + 71(u_f2): 70(ptr) Variable Private + 75: 66(ivec2) ConstantComposite 62 62 + 76: 66(ivec2) ConstantComposite 63 63 + 79: TypeVector 9(int) 3 + 80: TypePointer Function 79(ivec3) + 82: TypeVector 16(float) 3 + 83: TypePointer Private 82(fvec3) + 84(u_f3): 83(ptr) Variable Private + 88: 79(ivec3) ConstantComposite 62 62 62 + 89: 79(ivec3) ConstantComposite 63 63 63 + 92: TypeVector 9(int) 4 + 93: TypePointer Function 92(ivec4) + 95: TypeVector 16(float) 4 + 96: TypePointer Private 95(fvec4) + 97(u_f4): 96(ptr) Variable Private + 101: 92(ivec4) ConstantComposite 62 62 62 62 + 102: 92(ivec4) ConstantComposite 63 63 63 63 + 105: TypePointer Function 16(float) + 109: TypePointer Function 69(fvec2) + 113: TypePointer Function 82(fvec3) + 117: TypePointer Function 95(fvec4) + 124: 16(float) Constant 1065353216 + 132: 69(fvec2) ConstantComposite 20 20 + 133: 69(fvec2) ConstantComposite 124 124 + 141: 82(fvec3) ConstantComposite 20 20 20 + 142: 82(fvec3) ConstantComposite 124 124 124 + 150: 95(fvec4) ConstantComposite 20 20 20 20 + 151: 95(fvec4) ConstantComposite 124 124 124 124 + 156: TypePointer Input 92(ivec4) + 157(i_i4): 156(ptr) Variable Input + 159: TypeVector 13(int) 4 + 160: 159(ivec4) ConstantComposite 14 14 14 14 + 315: 13(int) Constant 1 + 321: TypePointer Output 95(fvec4) +322(gl_FragColor): 321(ptr) Variable Output + 336: 13(int) Constant 2 + 349: 13(int) Constant 3 + 427: TypePointer Private 6(bool) + 428(u_b): 427(ptr) Variable Private + 429: TypePointer Private 23(bvec2) + 430(u_b2): 429(ptr) Variable Private + 431: TypePointer Private 31(bvec3) + 432(u_b3): 431(ptr) Variable Private + 433: TypePointer Private 43(bvec4) + 434(u_b4): 433(ptr) Variable Private + 435: TypePointer Private 66(ivec2) + 436(u_i2): 435(ptr) Variable Private + 437: TypePointer Private 79(ivec3) + 438(u_i3): 437(ptr) Variable Private + 439: TypePointer Private 92(ivec4) + 440(u_i4): 439(ptr) Variable Private + 441(i_b): 427(ptr) Variable Private + 442(i_b2): 429(ptr) Variable Private + 443(i_b3): 431(ptr) Variable Private + 444(i_b4): 433(ptr) Variable Private + 445: TypePointer Input 66(ivec2) + 446(i_i2): 445(ptr) Variable Input + 447: TypePointer Input 79(ivec3) + 448(i_i3): 447(ptr) Variable Input + 449: TypePointer Input 69(fvec2) + 450(i_f2): 449(ptr) Variable Input + 451: TypePointer Input 82(fvec3) + 452(i_f3): 451(ptr) Variable Input + 453: TypePointer Input 95(fvec4) + 454(i_f4): 453(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 8(b): 7(ptr) Variable Function + 25(b2): 24(ptr) Variable Function + 33(b3): 32(ptr) Variable Function + 45(b4): 44(ptr) Variable Function + 58(i): 57(ptr) Variable Function + 68(i2): 67(ptr) Variable Function + 81(i3): 80(ptr) Variable Function + 94(i4): 93(ptr) Variable Function + 106(f): 105(ptr) Variable Function + 110(f2): 109(ptr) Variable Function + 114(f3): 113(ptr) Variable Function + 118(f4): 117(ptr) Variable Function + 298: 105(ptr) Variable Function + 309: 105(ptr) Variable Function + 353: 117(ptr) Variable Function + 417(cv2): 93(ptr) Variable Function + 418(cv5): 44(ptr) Variable Function + 12: 9(int) Load 11(u_i) + 15: 6(bool) INotEqual 12 14 + 19: 16(float) Load 18(u_f) + 21: 6(bool) FOrdNotEqual 19 20 + 22: 6(bool) LogicalNotEqual 15 21 + Store 8(b) 22 + 26: 9(int) Load 11(u_i) + 27: 6(bool) INotEqual 26 14 + 28: 16(float) Load 18(u_f) + 29: 6(bool) FOrdNotEqual 28 20 + 30: 23(bvec2) CompositeConstruct 27 29 + Store 25(b2) 30 + 34: 9(int) Load 11(u_i) + 35: 6(bool) INotEqual 34 14 + 36: 16(float) Load 18(u_f) + 37: 6(bool) FOrdNotEqual 36 20 + 40: 9(int) Load 39(i_i) + 41: 6(bool) INotEqual 40 14 + 42: 31(bvec3) CompositeConstruct 35 37 41 + Store 33(b3) 42 + 46: 9(int) Load 11(u_i) + 47: 6(bool) INotEqual 46 14 + 48: 16(float) Load 18(u_f) + 49: 6(bool) FOrdNotEqual 48 20 + 50: 9(int) Load 39(i_i) + 51: 6(bool) INotEqual 50 14 + 54: 16(float) Load 53(i_f) + 55: 6(bool) FOrdNotEqual 54 20 + 56: 43(bvec4) CompositeConstruct 47 49 51 55 + Store 45(b4) 56 + 59: 16(float) Load 18(u_f) + 60: 9(int) ConvertFToS 59 + 61: 6(bool) Load 8(b) + 64: 9(int) Select 61 63 62 + 65: 9(int) IAdd 60 64 + Store 58(i) 65 + 72: 69(fvec2) Load 71(u_f2) + 73: 66(ivec2) ConvertFToS 72 + 74: 23(bvec2) Load 25(b2) + 77: 66(ivec2) Select 74 76 75 + 78: 66(ivec2) IAdd 73 77 + Store 68(i2) 78 + 85: 82(fvec3) Load 84(u_f3) + 86: 79(ivec3) ConvertFToS 85 + 87: 31(bvec3) Load 33(b3) + 90: 79(ivec3) Select 87 89 88 + 91: 79(ivec3) IAdd 86 90 + Store 81(i3) 91 + 98: 95(fvec4) Load 97(u_f4) + 99: 92(ivec4) ConvertFToS 98 + 100: 43(bvec4) Load 45(b4) + 103: 92(ivec4) Select 100 102 101 + 104: 92(ivec4) IAdd 99 103 + Store 94(i4) 104 + 107: 9(int) Load 58(i) + 108: 16(float) ConvertSToF 107 + Store 106(f) 108 + 111: 66(ivec2) Load 68(i2) + 112: 69(fvec2) ConvertSToF 111 + Store 110(f2) 112 + 115: 79(ivec3) Load 81(i3) + 116: 82(fvec3) ConvertSToF 115 + Store 114(f3) 116 + 119: 92(ivec4) Load 94(i4) + 120: 95(fvec4) ConvertSToF 119 + Store 118(f4) 120 + 121: 9(int) Load 58(i) + 122: 16(float) ConvertSToF 121 + 123: 6(bool) Load 8(b) + 125: 16(float) Select 123 124 20 + 126: 16(float) FAdd 122 125 + 127: 16(float) Load 106(f) + 128: 16(float) FAdd 127 126 + Store 106(f) 128 + 129: 66(ivec2) Load 68(i2) + 130: 69(fvec2) ConvertSToF 129 + 131: 23(bvec2) Load 25(b2) + 134: 69(fvec2) Select 131 133 132 + 135: 69(fvec2) FAdd 130 134 + 136: 69(fvec2) Load 110(f2) + 137: 69(fvec2) FSub 136 135 + Store 110(f2) 137 + 138: 79(ivec3) Load 81(i3) + 139: 82(fvec3) ConvertSToF 138 + 140: 31(bvec3) Load 33(b3) + 143: 82(fvec3) Select 140 142 141 + 144: 82(fvec3) FAdd 139 143 + 145: 82(fvec3) Load 114(f3) + 146: 82(fvec3) FDiv 145 144 + Store 114(f3) 146 + 147: 92(ivec4) Load 94(i4) + 148: 95(fvec4) ConvertSToF 147 + 149: 43(bvec4) Load 45(b4) + 152: 95(fvec4) Select 149 151 150 + 153: 95(fvec4) FAdd 148 152 + 154: 95(fvec4) Load 118(f4) + 155: 95(fvec4) FAdd 154 153 + Store 118(f4) 155 + 158: 92(ivec4) Load 157(i_i4) + 161: 43(bvec4) INotEqual 158 160 + 162: 95(fvec4) Select 161 151 150 + 163: 95(fvec4) Load 118(f4) + 164: 95(fvec4) FAdd 163 162 + Store 118(f4) 164 + 165: 95(fvec4) Load 97(u_f4) + 166: 43(bvec4) FOrdNotEqual 165 150 + 167: 95(fvec4) Select 166 151 150 + 168: 95(fvec4) Load 118(f4) + 169: 95(fvec4) FAdd 168 167 + Store 118(f4) 169 + 170: 16(float) Load 106(f) + 171: 9(int) Load 58(i) + 172: 16(float) ConvertSToF 171 + 173: 16(float) FSub 170 172 + 174: 16(float) Load 106(f) + 175: 16(float) FAdd 174 173 + Store 106(f) 175 + 176: 16(float) Load 106(f) + 177: 9(int) Load 58(i) + 178: 16(float) ConvertSToF 177 + 179: 69(fvec2) CompositeConstruct 176 178 + 180: 66(ivec2) Load 68(i2) + 181: 69(fvec2) ConvertSToF 180 + 182: 69(fvec2) FAdd 179 181 + 183: 69(fvec2) Load 110(f2) + 184: 69(fvec2) FAdd 183 182 + Store 110(f2) 184 + 185: 79(ivec3) Load 81(i3) + 186: 82(fvec3) ConvertSToF 185 + 187: 16(float) Load 106(f) + 188: 9(int) Load 58(i) + 189: 16(float) ConvertSToF 188 + 190: 16(float) Load 106(f) + 191: 82(fvec3) CompositeConstruct 187 189 190 + 192: 82(fvec3) FAdd 186 191 + 193: 82(fvec3) Load 114(f3) + 194: 82(fvec3) FAdd 193 192 + Store 114(f3) 194 + 195: 6(bool) Load 8(b) + 196: 16(float) Select 195 124 20 + 197: 9(int) Load 58(i) + 198: 16(float) ConvertSToF 197 + 199: 16(float) Load 106(f) + 200: 9(int) Load 58(i) + 201: 16(float) ConvertSToF 200 + 202: 95(fvec4) CompositeConstruct 196 198 199 201 + 203: 92(ivec4) Load 94(i4) + 204: 95(fvec4) ConvertSToF 203 + 205: 95(fvec4) FAdd 202 204 + 206: 95(fvec4) Load 118(f4) + 207: 95(fvec4) FAdd 206 205 + Store 118(f4) 207 + 208: 16(float) Load 106(f) + 209: 9(int) Load 58(i) + 210: 16(float) ConvertSToF 209 + 211: 69(fvec2) CompositeConstruct 208 210 + 212: 9(int) Load 58(i) + 213: 16(float) ConvertSToF 212 + 214: 69(fvec2) VectorTimesScalar 211 213 + 215: 69(fvec2) Load 110(f2) + 216: 69(fvec2) FAdd 215 214 + Store 110(f2) 216 + 217: 16(float) Load 106(f) + 218: 9(int) Load 58(i) + 219: 16(float) ConvertSToF 218 + 220: 16(float) Load 106(f) + 221: 82(fvec3) CompositeConstruct 217 219 220 + 222: 9(int) Load 58(i) + 223: 16(float) ConvertSToF 222 + 224: 82(fvec3) CompositeConstruct 223 223 223 + 225: 82(fvec3) FAdd 221 224 + 226: 82(fvec3) Load 114(f3) + 227: 82(fvec3) FAdd 226 225 + Store 114(f3) 227 + 228: 9(int) Load 58(i) + 229: 16(float) ConvertSToF 228 + 230: 6(bool) Load 8(b) + 231: 16(float) Select 230 124 20 + 232: 9(int) Load 58(i) + 233: 16(float) ConvertSToF 232 + 234: 16(float) Load 106(f) + 235: 9(int) Load 58(i) + 236: 16(float) ConvertSToF 235 + 237: 95(fvec4) CompositeConstruct 231 233 234 236 + 238: 95(fvec4) CompositeConstruct 229 229 229 229 + 239: 95(fvec4) FSub 238 237 + 240: 95(fvec4) Load 118(f4) + 241: 95(fvec4) FAdd 240 239 + Store 118(f4) 241 + 242: 16(float) Load 106(f) + 243: 9(int) ConvertFToS 242 + 244: 9(int) Load 58(i) + 245: 66(ivec2) CompositeConstruct 243 244 + 246: 66(ivec2) Load 68(i2) + 247: 66(ivec2) IAdd 246 245 + Store 68(i2) 247 + 248: 16(float) Load 106(f) + 249: 9(int) ConvertFToS 248 + 250: 9(int) Load 58(i) + 251: 16(float) Load 106(f) + 252: 9(int) ConvertFToS 251 + 253: 79(ivec3) CompositeConstruct 249 250 252 + 254: 79(ivec3) Load 81(i3) + 255: 79(ivec3) IAdd 254 253 + Store 81(i3) 255 + 256: 6(bool) Load 8(b) + 257: 9(int) Select 256 63 62 + 258: 9(int) Load 58(i) + 259: 16(float) Load 106(f) + 260: 9(int) ConvertFToS 259 + 261: 9(int) Load 58(i) + 262: 92(ivec4) CompositeConstruct 257 258 260 261 + 263: 92(ivec4) Load 94(i4) + 264: 92(ivec4) IAdd 263 262 + Store 94(i4) 264 + 265: 16(float) Load 106(f) + 266: 9(int) Load 58(i) + 267: 16(float) ConvertSToF 266 + 268: 6(bool) FOrdLessThan 265 267 + 269: 6(bool) LogicalNot 268 + SelectionMerge 271 None + BranchConditional 269 270 271 + 270: Label + 272: 9(int) Load 58(i) + 273: 16(float) ConvertSToF 272 + 274: 16(float) Load 106(f) + 275: 6(bool) FOrdLessThan 273 274 + Branch 271 + 271: Label + 276: 6(bool) Phi 268 5 275 270 + 277: 6(bool) LogicalNot 276 + SelectionMerge 279 None + BranchConditional 277 278 279 + 278: Label + 280: 69(fvec2) Load 110(f2) + 281: 66(ivec2) Load 68(i2) + 282: 69(fvec2) ConvertSToF 281 + 283: 23(bvec2) FOrdEqual 280 282 + 284: 6(bool) All 283 + Branch 279 + 279: Label + 285: 6(bool) Phi 276 271 284 278 + 286: 6(bool) LogicalNot 285 + SelectionMerge 288 None + BranchConditional 286 287 288 + 287: Label + 289: 79(ivec3) Load 81(i3) + 290: 82(fvec3) ConvertSToF 289 + 291: 82(fvec3) Load 114(f3) + 292: 31(bvec3) FOrdNotEqual 290 291 + 293: 6(bool) Any 292 + Branch 288 + 288: Label + 294: 6(bool) Phi 285 279 293 287 + SelectionMerge 296 None + BranchConditional 294 295 296 + 295: Label + 297: 6(bool) Load 8(b) + SelectionMerge 300 None + BranchConditional 297 299 303 + 299: Label + 301: 9(int) Load 58(i) + 302: 16(float) ConvertSToF 301 + Store 298 302 + Branch 300 + 303: Label + 304: 105(ptr) AccessChain 110(f2) 14 + 305: 16(float) Load 304 + Store 298 305 + Branch 300 + 300: Label + 306: 16(float) Load 298 + 307: 7(ptr) AccessChain 25(b2) 14 + 308: 6(bool) Load 307 + SelectionMerge 311 None + BranchConditional 308 310 314 + 310: Label + 312: 105(ptr) AccessChain 114(f3) 14 + 313: 16(float) Load 312 + Store 309 313 + Branch 311 + 314: Label + 316: 57(ptr) AccessChain 68(i2) 315 + 317: 9(int) Load 316 + 318: 16(float) ConvertSToF 317 + Store 309 318 + Branch 311 + 311: Label + 319: 16(float) Load 309 + 320: 16(float) FAdd 306 319 + Store 106(f) 320 + Branch 296 + 296: Label + 323: 6(bool) Load 8(b) + 324: 7(ptr) AccessChain 25(b2) 14 + 325: 6(bool) Load 324 + 326: 6(bool) LogicalOr 323 325 + 327: 7(ptr) AccessChain 25(b2) 315 + 328: 6(bool) Load 327 + 329: 6(bool) LogicalOr 326 328 + 330: 7(ptr) AccessChain 33(b3) 14 + 331: 6(bool) Load 330 + 332: 6(bool) LogicalOr 329 331 + 333: 7(ptr) AccessChain 33(b3) 315 + 334: 6(bool) Load 333 + 335: 6(bool) LogicalOr 332 334 + 337: 7(ptr) AccessChain 33(b3) 336 + 338: 6(bool) Load 337 + 339: 6(bool) LogicalOr 335 338 + 340: 7(ptr) AccessChain 45(b4) 14 + 341: 6(bool) Load 340 + 342: 6(bool) LogicalOr 339 341 + 343: 7(ptr) AccessChain 45(b4) 315 + 344: 6(bool) Load 343 + 345: 6(bool) LogicalOr 342 344 + 346: 7(ptr) AccessChain 45(b4) 336 + 347: 6(bool) Load 346 + 348: 6(bool) LogicalOr 345 347 + 350: 7(ptr) AccessChain 45(b4) 349 + 351: 6(bool) Load 350 + 352: 6(bool) LogicalOr 348 351 + SelectionMerge 355 None + BranchConditional 352 354 415 + 354: Label + 356: 9(int) Load 58(i) + 357: 57(ptr) AccessChain 68(i2) 14 + 358: 9(int) Load 357 + 359: 9(int) IAdd 356 358 + 360: 57(ptr) AccessChain 68(i2) 315 + 361: 9(int) Load 360 + 362: 9(int) IAdd 359 361 + 363: 57(ptr) AccessChain 81(i3) 14 + 364: 9(int) Load 363 + 365: 9(int) IAdd 362 364 + 366: 57(ptr) AccessChain 81(i3) 315 + 367: 9(int) Load 366 + 368: 9(int) IAdd 365 367 + 369: 57(ptr) AccessChain 81(i3) 336 + 370: 9(int) Load 369 + 371: 9(int) IAdd 368 370 + 372: 57(ptr) AccessChain 94(i4) 14 + 373: 9(int) Load 372 + 374: 9(int) IAdd 371 373 + 375: 57(ptr) AccessChain 94(i4) 315 + 376: 9(int) Load 375 + 377: 9(int) IAdd 374 376 + 378: 57(ptr) AccessChain 94(i4) 336 + 379: 9(int) Load 378 + 380: 9(int) IAdd 377 379 + 381: 57(ptr) AccessChain 94(i4) 349 + 382: 9(int) Load 381 + 383: 9(int) IAdd 380 382 + 384: 16(float) ConvertSToF 383 + 385: 16(float) Load 106(f) + 386: 16(float) FAdd 384 385 + 387: 105(ptr) AccessChain 110(f2) 14 + 388: 16(float) Load 387 + 389: 16(float) FAdd 386 388 + 390: 105(ptr) AccessChain 110(f2) 315 + 391: 16(float) Load 390 + 392: 16(float) FAdd 389 391 + 393: 105(ptr) AccessChain 114(f3) 14 + 394: 16(float) Load 393 + 395: 16(float) FAdd 392 394 + 396: 105(ptr) AccessChain 114(f3) 315 + 397: 16(float) Load 396 + 398: 16(float) FAdd 395 397 + 399: 105(ptr) AccessChain 114(f3) 336 + 400: 16(float) Load 399 + 401: 16(float) FAdd 398 400 + 402: 105(ptr) AccessChain 118(f4) 14 + 403: 16(float) Load 402 + 404: 16(float) FAdd 401 403 + 405: 105(ptr) AccessChain 118(f4) 315 + 406: 16(float) Load 405 + 407: 16(float) FAdd 404 406 + 408: 105(ptr) AccessChain 118(f4) 336 + 409: 16(float) Load 408 + 410: 16(float) FAdd 407 409 + 411: 105(ptr) AccessChain 118(f4) 349 + 412: 16(float) Load 411 + 413: 16(float) FAdd 410 412 + 414: 95(fvec4) CompositeConstruct 413 413 413 413 + Store 353 414 + Branch 355 + 415: Label + Store 353 151 + Branch 355 + 355: Label + 416: 95(fvec4) Load 353 + Store 322(gl_FragColor) 416 + Store 417(cv2) 102 + 419: 92(ivec4) Load 417(cv2) + 420: 43(bvec4) INotEqual 419 160 + Store 418(cv5) 420 + 421: 43(bvec4) Load 418(cv5) + 422: 95(fvec4) Select 421 151 150 + 423: 16(float) CompositeExtract 422 0 + 424: 95(fvec4) Load 322(gl_FragColor) + 425: 95(fvec4) CompositeConstruct 423 423 423 423 + 426: 95(fvec4) FAdd 424 425 + Store 322(gl_FragColor) 426 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.dataOut.frag.out b/deps/glslang/Test/baseResults/spv.dataOut.frag.out new file mode 100644 index 00000000..f3847213 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.dataOut.frag.out @@ -0,0 +1,35 @@ +spv.dataOut.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 20 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 12 16 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 12 "gl_FragData" + Name 16 "Color" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 0 + 9: 8(int) Constant 32 + 10: TypeArray 7(fvec4) 9 + 11: TypePointer Output 10 + 12(gl_FragData): 11(ptr) Variable Output + 13: TypeInt 32 1 + 14: 13(int) Constant 1 + 15: TypePointer Input 7(fvec4) + 16(Color): 15(ptr) Variable Input + 18: TypePointer Output 7(fvec4) + 4(main): 2 Function None 3 + 5: Label + 17: 7(fvec4) Load 16(Color) + 19: 18(ptr) AccessChain 12(gl_FragData) 14 + Store 19 17 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.dataOutIndirect.frag.out b/deps/glslang/Test/baseResults/spv.dataOutIndirect.frag.out new file mode 100644 index 00000000..c0b52ae3 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.dataOutIndirect.frag.out @@ -0,0 +1,47 @@ +spv.dataOutIndirect.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 26 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 12 22 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 12 "fcolor" + Name 14 "b" + MemberName 14(b) 0 "i" + Name 16 "bName" + Name 22 "Color" + MemberDecorate 14(b) 0 Offset 0 + Decorate 14(b) Block + Decorate 16(bName) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 0 + 9: 8(int) Constant 4 + 10: TypeArray 7(fvec4) 9 + 11: TypePointer Output 10 + 12(fcolor): 11(ptr) Variable Output + 13: TypeInt 32 1 + 14(b): TypeStruct 13(int) + 15: TypePointer Uniform 14(b) + 16(bName): 15(ptr) Variable Uniform + 17: 13(int) Constant 0 + 18: TypePointer Uniform 13(int) + 21: TypePointer Input 7(fvec4) + 22(Color): 21(ptr) Variable Input + 24: TypePointer Output 7(fvec4) + 4(main): 2 Function None 3 + 5: Label + 19: 18(ptr) AccessChain 16(bName) 17 + 20: 13(int) Load 19 + 23: 7(fvec4) Load 22(Color) + 25: 24(ptr) AccessChain 12(fcolor) 20 + Store 25 23 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.dataOutIndirect.vert.out b/deps/glslang/Test/baseResults/spv.dataOutIndirect.vert.out new file mode 100644 index 00000000..9ba988c6 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.dataOutIndirect.vert.out @@ -0,0 +1,66 @@ +spv.dataOutIndirect.vert +WARNING: 0:3: attribute deprecated in version 130; may be removed in future release + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 38 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 25 28 34 + Source GLSL 140 + Name 4 "main" + Name 8 "i" + Name 25 "colorOut" + Name 28 "color" + Name 34 "gl_Position" + Decorate 34(gl_Position) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 1 + 16: 6(int) Constant 5 + 17: TypeBool + 19: TypeFloat 32 + 20: TypeVector 19(float) 4 + 21: TypeInt 32 0 + 22: 21(int) Constant 6 + 23: TypeArray 20(fvec4) 22 + 24: TypePointer Output 23 + 25(colorOut): 24(ptr) Variable Output + 27: TypePointer Input 20(fvec4) + 28(color): 27(ptr) Variable Input + 30: TypePointer Output 20(fvec4) + 34(gl_Position): 30(ptr) Variable Output + 35: 6(int) Constant 2 + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + Store 8(i) 9 + Branch 10 + 10: Label + LoopMerge 12 13 None + Branch 14 + 14: Label + 15: 6(int) Load 8(i) + 18: 17(bool) SLessThan 15 16 + BranchConditional 18 11 12 + 11: Label + 26: 6(int) Load 8(i) + 29: 20(fvec4) Load 28(color) + 31: 30(ptr) AccessChain 25(colorOut) 26 + Store 31 29 + Branch 13 + 13: Label + 32: 6(int) Load 8(i) + 33: 6(int) IAdd 32 9 + Store 8(i) 33 + Branch 10 + 12: Label + 36: 30(ptr) AccessChain 25(colorOut) 35 + 37: 20(fvec4) Load 36 + Store 34(gl_Position) 37 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out b/deps/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out new file mode 100644 index 00000000..f9c8578c --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out @@ -0,0 +1,279 @@ +spv.debugInfo.frag +error: SPIRV-Tools Validation Errors +error: Invalid SPIR-V binary version 1.3 for target environment SPIR-V 1.0 (under OpenGL 4.5 semantics). +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 124 + + Capability Shader + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 5 "main" 24 52 + ExecutionMode 5 OriginLowerLeft + 1: String "spv.debugInfo.frag" + Source GLSL 450 1 "#version 450 + +struct S { + int a; +}; + +uniform ubuf { + S s; +}; + +uniform sampler2D s2d; + +layout(location = 0) in vec4 inv; +layout(location = 0) out vec4 outv; + +vec4 foo(S s) +{ + vec4 r = s.a * inv; + ++r; + if (r.x > 3.0) + --r; + else + r *= 2; + + return r; +} + +void main() +{ + outv = foo(s); + outv += texture(s2d, vec2(0.5)); + + switch (s.a) { + case 10: + ++outv; + break; + case 20: + outv = 2 * outv; + ++outv; + break; + default: + --outv; + break; + } + + for (int i = 0; i < 10; ++i) + outv *= 3.0; + + outv.x < 10.0 ? + outv = sin(outv) : + outv = cos(outv); +}" + Name 5 "main" + Name 8 "S" + MemberName 8(S) 0 "a" + Name 14 "foo(struct-S-i11;" + Name 13 "s" + Name 17 "r" + Name 24 "inv" + Name 52 "outv" + Name 53 "S" + MemberName 53(S) 0 "a" + Name 54 "ubuf" + MemberName 54(ubuf) 0 "s" + Name 56 "" + Name 57 "param" + Name 67 "s2d" + Name 97 "i" + ModuleProcessed "no-storage-format" + ModuleProcessed "resource-set-binding 3" + ModuleProcessed "auto-map-locations" + ModuleProcessed "client opengl100" + ModuleProcessed "target-env opengl" + ModuleProcessed "relaxed-errors" + ModuleProcessed "suppress-warnings" + ModuleProcessed "hlsl-offsets" + ModuleProcessed "entry-point main" + ModuleProcessed "use-storage-buffer" + Decorate 24(inv) Location 0 + Decorate 52(outv) Location 0 + MemberDecorate 53(S) 0 Offset 0 + MemberDecorate 54(ubuf) 0 Offset 0 + Decorate 54(ubuf) Block + Decorate 56 DescriptorSet 3 + Decorate 67(s2d) Location 0 + Decorate 67(s2d) DescriptorSet 3 + 3: TypeVoid + 4: TypeFunction 3 + 7: TypeInt 32 1 + 8(S): TypeStruct 7(int) + 9: TypePointer Function 8(S) + 10: TypeFloat 32 + 11: TypeVector 10(float) 4 + 12: TypeFunction 11(fvec4) 9(ptr) + 16: TypePointer Function 11(fvec4) + 18: 7(int) Constant 0 + 19: TypePointer Function 7(int) + 23: TypePointer Input 11(fvec4) + 24(inv): 23(ptr) Variable Input + 28: 10(float) Constant 1065353216 + 31: TypeInt 32 0 + 32: 31(int) Constant 0 + 33: TypePointer Function 10(float) + 36: 10(float) Constant 1077936128 + 37: TypeBool + 45: 10(float) Constant 1073741824 + 51: TypePointer Output 11(fvec4) + 52(outv): 51(ptr) Variable Output + 53(S): TypeStruct 7(int) + 54(ubuf): TypeStruct 53(S) + 55: TypePointer Uniform 54(ubuf) + 56: 55(ptr) Variable Uniform + 58: TypePointer Uniform 53(S) + 64: TypeImage 10(float) 2D sampled format:Unknown + 65: TypeSampledImage 64 + 66: TypePointer UniformConstant 65 + 67(s2d): 66(ptr) Variable UniformConstant + 69: TypeVector 10(float) 2 + 70: 10(float) Constant 1056964608 + 71: 69(fvec2) ConstantComposite 70 70 + 75: TypePointer Uniform 7(int) + 104: 7(int) Constant 10 + 109: 7(int) Constant 1 + 111: TypePointer Output 10(float) + 114: 10(float) Constant 1092616192 + 5(main): 3 Function None 4 + 6: Label + 57(param): 9(ptr) Variable Function + 97(i): 19(ptr) Variable Function + 116: 16(ptr) Variable Function + Line 1 30 0 + 59: 58(ptr) AccessChain 56 18 + 60: 53(S) Load 59 + 61: 7(int) CompositeExtract 60 0 + 62: 19(ptr) AccessChain 57(param) 18 + Store 62 61 + 63: 11(fvec4) FunctionCall 14(foo(struct-S-i11;) 57(param) + Store 52(outv) 63 + Line 1 31 0 + 68: 65 Load 67(s2d) + 72: 11(fvec4) ImageSampleImplicitLod 68 71 + 73: 11(fvec4) Load 52(outv) + 74: 11(fvec4) FAdd 73 72 + Store 52(outv) 74 + Line 1 33 0 + 76: 75(ptr) AccessChain 56 18 18 + 77: 7(int) Load 76 + SelectionMerge 81 None + Switch 77 80 + case 10: 78 + case 20: 79 + 80: Label + Line 1 42 0 + 92: 11(fvec4) Load 52(outv) + 93: 11(fvec4) CompositeConstruct 28 28 28 28 + 94: 11(fvec4) FSub 92 93 + Store 52(outv) 94 + Line 1 43 0 + Branch 81 + 78: Label + Line 1 35 0 + 82: 11(fvec4) Load 52(outv) + 83: 11(fvec4) CompositeConstruct 28 28 28 28 + 84: 11(fvec4) FAdd 82 83 + Store 52(outv) 84 + Line 1 36 0 + Branch 81 + 79: Label + Line 1 38 0 + 86: 11(fvec4) Load 52(outv) + 87: 11(fvec4) VectorTimesScalar 86 45 + Store 52(outv) 87 + Line 1 39 0 + 88: 11(fvec4) Load 52(outv) + 89: 11(fvec4) CompositeConstruct 28 28 28 28 + 90: 11(fvec4) FAdd 88 89 + Store 52(outv) 90 + Line 1 40 0 + Branch 81 + 81: Label + Line 1 46 0 + Store 97(i) 18 + Branch 98 + 98: Label + LoopMerge 100 101 None + Branch 102 + 102: Label + 103: 7(int) Load 97(i) + 105: 37(bool) SLessThan 103 104 + BranchConditional 105 99 100 + 99: Label + Line 1 47 0 + 106: 11(fvec4) Load 52(outv) + 107: 11(fvec4) VectorTimesScalar 106 36 + Store 52(outv) 107 + Branch 101 + 101: Label + Line 1 46 0 + 108: 7(int) Load 97(i) + 110: 7(int) IAdd 108 109 + Store 97(i) 110 + Branch 98 + 100: Label + Line 1 49 0 + 112: 111(ptr) AccessChain 52(outv) 32 + 113: 10(float) Load 112 + 115: 37(bool) FOrdLessThan 113 114 + SelectionMerge 118 None + BranchConditional 115 117 121 + 117: Label + Line 1 50 0 + 119: 11(fvec4) Load 52(outv) + 120: 11(fvec4) ExtInst 2(GLSL.std.450) 13(Sin) 119 + Store 52(outv) 120 + Store 116 120 + Branch 118 + 121: Label + Line 1 51 0 + 122: 11(fvec4) Load 52(outv) + 123: 11(fvec4) ExtInst 2(GLSL.std.450) 14(Cos) 122 + Store 52(outv) 123 + Store 116 123 + Branch 118 + 118: Label + Return + FunctionEnd +14(foo(struct-S-i11;): 11(fvec4) Function None 12 + 13(s): 9(ptr) FunctionParameter + 15: Label + 17(r): 16(ptr) Variable Function + Line 1 18 0 + 20: 19(ptr) AccessChain 13(s) 18 + 21: 7(int) Load 20 + 22: 10(float) ConvertSToF 21 + 25: 11(fvec4) Load 24(inv) + 26: 11(fvec4) VectorTimesScalar 25 22 + Store 17(r) 26 + Line 1 19 0 + 27: 11(fvec4) Load 17(r) + 29: 11(fvec4) CompositeConstruct 28 28 28 28 + 30: 11(fvec4) FAdd 27 29 + Store 17(r) 30 + Line 1 20 0 + 34: 33(ptr) AccessChain 17(r) 32 + 35: 10(float) Load 34 + 38: 37(bool) FOrdGreaterThan 35 36 + SelectionMerge 40 None + BranchConditional 38 39 44 + 39: Label + Line 1 21 0 + 41: 11(fvec4) Load 17(r) + 42: 11(fvec4) CompositeConstruct 28 28 28 28 + 43: 11(fvec4) FSub 41 42 + Store 17(r) 43 + Branch 40 + 44: Label + Line 1 23 0 + 46: 11(fvec4) Load 17(r) + 47: 11(fvec4) VectorTimesScalar 46 45 + Store 17(r) 47 + Branch 40 + 40: Label + Line 1 25 0 + 48: 11(fvec4) Load 17(r) + ReturnValue 48 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.debugInfo.frag.out b/deps/glslang/Test/baseResults/spv.debugInfo.frag.out new file mode 100644 index 00000000..aaa988d4 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.debugInfo.frag.out @@ -0,0 +1,280 @@ +spv.debugInfo.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 124 + + Capability Shader + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 5 "main" 24 52 + ExecutionMode 5 OriginLowerLeft + 1: String "spv.debugInfo.frag" + Source GLSL 450 1 "// OpModuleProcessed no-storage-format +// OpModuleProcessed resource-set-binding 3 +// OpModuleProcessed auto-map-bindings +// OpModuleProcessed auto-map-locations +// OpModuleProcessed client opengl100 +// OpModuleProcessed target-env opengl +// OpModuleProcessed relaxed-errors +// OpModuleProcessed suppress-warnings +// OpModuleProcessed hlsl-offsets +// OpModuleProcessed entry-point main +#line 1 +#version 450 + +struct S { + int a; +}; + +uniform ubuf { + S s; +}; + +uniform sampler2D s2d; + +layout(location = 0) in vec4 inv; +layout(location = 0) out vec4 outv; + +vec4 foo(S s) +{ + vec4 r = s.a * inv; + ++r; + if (r.x > 3.0) + --r; + else + r *= 2; + + return r; +} + +void main() +{ + outv = foo(s); + outv += texture(s2d, vec2(0.5)); + + switch (s.a) { + case 10: + ++outv; + break; + case 20: + outv = 2 * outv; + ++outv; + break; + default: + --outv; + break; + } + + for (int i = 0; i < 10; ++i) + outv *= 3.0; + + outv.x < 10.0 ? + outv = sin(outv) : + outv = cos(outv); +}" + Name 5 "main" + Name 8 "S" + MemberName 8(S) 0 "a" + Name 14 "foo(struct-S-i11;" + Name 13 "s" + Name 17 "r" + Name 24 "inv" + Name 52 "outv" + Name 53 "S" + MemberName 53(S) 0 "a" + Name 54 "ubuf" + MemberName 54(ubuf) 0 "s" + Name 56 "" + Name 57 "param" + Name 67 "s2d" + Name 97 "i" + Decorate 24(inv) Location 0 + Decorate 52(outv) Location 0 + MemberDecorate 53(S) 0 Offset 0 + MemberDecorate 54(ubuf) 0 Offset 0 + Decorate 54(ubuf) Block + Decorate 56 DescriptorSet 3 + Decorate 56 Binding 0 + Decorate 67(s2d) Location 0 + Decorate 67(s2d) DescriptorSet 3 + Decorate 67(s2d) Binding 1 + 3: TypeVoid + 4: TypeFunction 3 + 7: TypeInt 32 1 + 8(S): TypeStruct 7(int) + 9: TypePointer Function 8(S) + 10: TypeFloat 32 + 11: TypeVector 10(float) 4 + 12: TypeFunction 11(fvec4) 9(ptr) + 16: TypePointer Function 11(fvec4) + 18: 7(int) Constant 0 + 19: TypePointer Function 7(int) + 23: TypePointer Input 11(fvec4) + 24(inv): 23(ptr) Variable Input + 28: 10(float) Constant 1065353216 + 31: TypeInt 32 0 + 32: 31(int) Constant 0 + 33: TypePointer Function 10(float) + 36: 10(float) Constant 1077936128 + 37: TypeBool + 45: 10(float) Constant 1073741824 + 51: TypePointer Output 11(fvec4) + 52(outv): 51(ptr) Variable Output + 53(S): TypeStruct 7(int) + 54(ubuf): TypeStruct 53(S) + 55: TypePointer Uniform 54(ubuf) + 56: 55(ptr) Variable Uniform + 58: TypePointer Uniform 53(S) + 64: TypeImage 10(float) 2D sampled format:Unknown + 65: TypeSampledImage 64 + 66: TypePointer UniformConstant 65 + 67(s2d): 66(ptr) Variable UniformConstant + 69: TypeVector 10(float) 2 + 70: 10(float) Constant 1056964608 + 71: 69(fvec2) ConstantComposite 70 70 + 75: TypePointer Uniform 7(int) + 104: 7(int) Constant 10 + 109: 7(int) Constant 1 + 111: TypePointer Output 10(float) + 114: 10(float) Constant 1092616192 + 5(main): 3 Function None 4 + 6: Label + 57(param): 9(ptr) Variable Function + 97(i): 19(ptr) Variable Function + 116: 16(ptr) Variable Function + Line 1 30 0 + 59: 58(ptr) AccessChain 56 18 + 60: 53(S) Load 59 + 61: 7(int) CompositeExtract 60 0 + 62: 19(ptr) AccessChain 57(param) 18 + Store 62 61 + 63: 11(fvec4) FunctionCall 14(foo(struct-S-i11;) 57(param) + Store 52(outv) 63 + Line 1 31 0 + 68: 65 Load 67(s2d) + 72: 11(fvec4) ImageSampleImplicitLod 68 71 + 73: 11(fvec4) Load 52(outv) + 74: 11(fvec4) FAdd 73 72 + Store 52(outv) 74 + Line 1 33 0 + 76: 75(ptr) AccessChain 56 18 18 + 77: 7(int) Load 76 + SelectionMerge 81 None + Switch 77 80 + case 10: 78 + case 20: 79 + 80: Label + Line 1 42 0 + 92: 11(fvec4) Load 52(outv) + 93: 11(fvec4) CompositeConstruct 28 28 28 28 + 94: 11(fvec4) FSub 92 93 + Store 52(outv) 94 + Line 1 43 0 + Branch 81 + 78: Label + Line 1 35 0 + 82: 11(fvec4) Load 52(outv) + 83: 11(fvec4) CompositeConstruct 28 28 28 28 + 84: 11(fvec4) FAdd 82 83 + Store 52(outv) 84 + Line 1 36 0 + Branch 81 + 79: Label + Line 1 38 0 + 86: 11(fvec4) Load 52(outv) + 87: 11(fvec4) VectorTimesScalar 86 45 + Store 52(outv) 87 + Line 1 39 0 + 88: 11(fvec4) Load 52(outv) + 89: 11(fvec4) CompositeConstruct 28 28 28 28 + 90: 11(fvec4) FAdd 88 89 + Store 52(outv) 90 + Line 1 40 0 + Branch 81 + 81: Label + Line 1 46 0 + Store 97(i) 18 + Branch 98 + 98: Label + LoopMerge 100 101 None + Branch 102 + 102: Label + 103: 7(int) Load 97(i) + 105: 37(bool) SLessThan 103 104 + BranchConditional 105 99 100 + 99: Label + Line 1 47 0 + 106: 11(fvec4) Load 52(outv) + 107: 11(fvec4) VectorTimesScalar 106 36 + Store 52(outv) 107 + Branch 101 + 101: Label + Line 1 46 0 + 108: 7(int) Load 97(i) + 110: 7(int) IAdd 108 109 + Store 97(i) 110 + Branch 98 + 100: Label + Line 1 49 0 + 112: 111(ptr) AccessChain 52(outv) 32 + 113: 10(float) Load 112 + 115: 37(bool) FOrdLessThan 113 114 + SelectionMerge 118 None + BranchConditional 115 117 121 + 117: Label + Line 1 50 0 + 119: 11(fvec4) Load 52(outv) + 120: 11(fvec4) ExtInst 2(GLSL.std.450) 13(Sin) 119 + Store 52(outv) 120 + Store 116 120 + Branch 118 + 121: Label + Line 1 51 0 + 122: 11(fvec4) Load 52(outv) + 123: 11(fvec4) ExtInst 2(GLSL.std.450) 14(Cos) 122 + Store 52(outv) 123 + Store 116 123 + Branch 118 + 118: Label + Return + FunctionEnd +14(foo(struct-S-i11;): 11(fvec4) Function None 12 + 13(s): 9(ptr) FunctionParameter + 15: Label + 17(r): 16(ptr) Variable Function + Line 1 18 0 + 20: 19(ptr) AccessChain 13(s) 18 + 21: 7(int) Load 20 + 22: 10(float) ConvertSToF 21 + 25: 11(fvec4) Load 24(inv) + 26: 11(fvec4) VectorTimesScalar 25 22 + Store 17(r) 26 + Line 1 19 0 + 27: 11(fvec4) Load 17(r) + 29: 11(fvec4) CompositeConstruct 28 28 28 28 + 30: 11(fvec4) FAdd 27 29 + Store 17(r) 30 + Line 1 20 0 + 34: 33(ptr) AccessChain 17(r) 32 + 35: 10(float) Load 34 + 38: 37(bool) FOrdGreaterThan 35 36 + SelectionMerge 40 None + BranchConditional 38 39 44 + 39: Label + Line 1 21 0 + 41: 11(fvec4) Load 17(r) + 42: 11(fvec4) CompositeConstruct 28 28 28 28 + 43: 11(fvec4) FSub 41 42 + Store 17(r) 43 + Branch 40 + 44: Label + Line 1 23 0 + 46: 11(fvec4) Load 17(r) + 47: 11(fvec4) VectorTimesScalar 46 45 + Store 17(r) 47 + Branch 40 + 40: Label + Line 1 25 0 + 48: 11(fvec4) Load 17(r) + ReturnValue 48 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.deepRvalue.frag.out b/deps/glslang/Test/baseResults/spv.deepRvalue.frag.out new file mode 100644 index 00000000..a0e4eabc --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.deepRvalue.frag.out @@ -0,0 +1,197 @@ +spv.deepRvalue.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 152 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 146 + ExecutionMode 4 OriginUpperLeft + Source GLSL 330 + Name 4 "main" + Name 9 "v1" + Name 15 "v2" + Name 21 "v3" + Name 27 "v4" + Name 35 "m" + Name 63 "mm" + Name 80 "f" + Name 87 "g" + Name 106 "h" + Name 107 "i" + Name 111 "samp2D" + Name 131 "str" + MemberName 131(str) 0 "a" + MemberName 131(str) 1 "b" + MemberName 131(str) 2 "c" + Name 133 "t" + Name 146 "gl_FragColor" + Decorate 111(samp2D) DescriptorSet 0 + Decorate 146(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Private 7(fvec4) + 9(v1): 8(ptr) Variable Private + 10: 6(float) Constant 1073741824 + 11: 6(float) Constant 1077936128 + 12: 6(float) Constant 1084227584 + 13: 6(float) Constant 1088421888 + 14: 7(fvec4) ConstantComposite 10 11 12 13 + 15(v2): 8(ptr) Variable Private + 16: 6(float) Constant 1093664768 + 17: 6(float) Constant 1095761920 + 18: 6(float) Constant 1099431936 + 19: 6(float) Constant 1100480512 + 20: 7(fvec4) ConstantComposite 16 17 18 19 + 21(v3): 8(ptr) Variable Private + 22: 6(float) Constant 1102577664 + 23: 6(float) Constant 1105723392 + 24: 6(float) Constant 1106771968 + 25: 6(float) Constant 1108606976 + 26: 7(fvec4) ConstantComposite 22 23 24 25 + 27(v4): 8(ptr) Variable Private + 28: 6(float) Constant 1109655552 + 29: 6(float) Constant 1110179840 + 30: 6(float) Constant 1111228416 + 31: 6(float) Constant 1112801280 + 32: 7(fvec4) ConstantComposite 28 29 30 31 + 33: TypeMatrix 7(fvec4) 4 + 34: TypePointer Function 33 + 40: 6(float) Constant 1065353216 + 41: 6(float) Constant 0 + 79: TypePointer Function 6(float) + 81: TypeInt 32 1 + 82: 81(int) Constant 1 + 83: TypeInt 32 0 + 84: 83(int) Constant 3 + 103: 81(int) Constant 2 + 104: 83(int) Constant 1 + 108: TypeImage 6(float) 2D sampled format:Unknown + 109: TypeSampledImage 108 + 110: TypePointer UniformConstant 109 + 111(samp2D): 110(ptr) Variable UniformConstant + 113: TypeVector 6(float) 2 + 114: 6(float) Constant 1056964608 + 115: 113(fvec2) ConstantComposite 114 114 + 119: 6(float) Constant 1036831949 + 120: TypeBool + 124: TypeVector 120(bool) 4 + 130: TypeArray 113(fvec2) 84 + 131(str): TypeStruct 81(int) 130 120(bool) + 132: TypePointer Function 131(str) + 134: 113(fvec2) ConstantComposite 10 11 + 135: 6(float) Constant 1082130432 + 136: 113(fvec2) ConstantComposite 135 12 + 137: 6(float) Constant 1086324736 + 138: 113(fvec2) ConstantComposite 137 13 + 139: 130 ConstantComposite 134 136 138 + 140: 120(bool) ConstantTrue + 141: 131(str) ConstantComposite 82 139 140 + 145: TypePointer Output 7(fvec4) +146(gl_FragColor): 145(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 35(m): 34(ptr) Variable Function + 63(mm): 34(ptr) Variable Function + 80(f): 79(ptr) Variable Function + 87(g): 79(ptr) Variable Function + 106(h): 79(ptr) Variable Function + 107(i): 79(ptr) Variable Function + 133(t): 132(ptr) Variable Function + Store 9(v1) 14 + Store 15(v2) 20 + Store 21(v3) 26 + Store 27(v4) 32 + 36: 7(fvec4) Load 9(v1) + 37: 7(fvec4) Load 15(v2) + 38: 7(fvec4) Load 21(v3) + 39: 7(fvec4) Load 27(v4) + 42: 6(float) CompositeExtract 36 0 + 43: 6(float) CompositeExtract 36 1 + 44: 6(float) CompositeExtract 36 2 + 45: 6(float) CompositeExtract 36 3 + 46: 6(float) CompositeExtract 37 0 + 47: 6(float) CompositeExtract 37 1 + 48: 6(float) CompositeExtract 37 2 + 49: 6(float) CompositeExtract 37 3 + 50: 6(float) CompositeExtract 38 0 + 51: 6(float) CompositeExtract 38 1 + 52: 6(float) CompositeExtract 38 2 + 53: 6(float) CompositeExtract 38 3 + 54: 6(float) CompositeExtract 39 0 + 55: 6(float) CompositeExtract 39 1 + 56: 6(float) CompositeExtract 39 2 + 57: 6(float) CompositeExtract 39 3 + 58: 7(fvec4) CompositeConstruct 42 43 44 45 + 59: 7(fvec4) CompositeConstruct 46 47 48 49 + 60: 7(fvec4) CompositeConstruct 50 51 52 53 + 61: 7(fvec4) CompositeConstruct 54 55 56 57 + 62: 33 CompositeConstruct 58 59 60 61 + Store 35(m) 62 + 64: 33 Load 35(m) + 65: 33 Load 35(m) + 66: 7(fvec4) CompositeExtract 64 0 + 67: 7(fvec4) CompositeExtract 65 0 + 68: 7(fvec4) FMul 66 67 + 69: 7(fvec4) CompositeExtract 64 1 + 70: 7(fvec4) CompositeExtract 65 1 + 71: 7(fvec4) FMul 69 70 + 72: 7(fvec4) CompositeExtract 64 2 + 73: 7(fvec4) CompositeExtract 65 2 + 74: 7(fvec4) FMul 72 73 + 75: 7(fvec4) CompositeExtract 64 3 + 76: 7(fvec4) CompositeExtract 65 3 + 77: 7(fvec4) FMul 75 76 + 78: 33 CompositeConstruct 68 71 74 77 + Store 63(mm) 78 + 85: 79(ptr) AccessChain 63(mm) 82 84 + 86: 6(float) Load 85 + Store 80(f) 86 + 88: 33 Load 35(m) + 89: 33 Load 35(m) + 90: 7(fvec4) CompositeExtract 88 0 + 91: 7(fvec4) CompositeExtract 89 0 + 92: 7(fvec4) FMul 90 91 + 93: 7(fvec4) CompositeExtract 88 1 + 94: 7(fvec4) CompositeExtract 89 1 + 95: 7(fvec4) FMul 93 94 + 96: 7(fvec4) CompositeExtract 88 2 + 97: 7(fvec4) CompositeExtract 89 2 + 98: 7(fvec4) FMul 96 97 + 99: 7(fvec4) CompositeExtract 88 3 + 100: 7(fvec4) CompositeExtract 89 3 + 101: 7(fvec4) FMul 99 100 + 102: 33 CompositeConstruct 92 95 98 101 + 105: 6(float) CompositeExtract 102 2 1 + Store 87(g) 105 + Store 106(h) 12 + 112: 109 Load 111(samp2D) + 116: 7(fvec4) ImageSampleImplicitLod 112 115 + 117: 6(float) CompositeExtract 116 1 + Store 107(i) 117 + 118: 6(float) Load 107(i) + 121: 120(bool) FOrdGreaterThan 118 119 + 122: 7(fvec4) Load 9(v1) + 123: 7(fvec4) Load 15(v2) + 125: 124(bvec4) CompositeConstruct 121 121 121 121 + 126: 7(fvec4) Select 125 122 123 + 127: 6(float) CompositeExtract 126 3 + 128: 6(float) Load 107(i) + 129: 6(float) FAdd 128 127 + Store 107(i) 129 + Store 133(t) 141 + 142: 6(float) CompositeExtract 141 1 2 1 + 143: 6(float) Load 107(i) + 144: 6(float) FAdd 143 142 + Store 107(i) 144 + 147: 6(float) Load 80(f) + 148: 6(float) Load 87(g) + 149: 6(float) Load 106(h) + 150: 6(float) Load 107(i) + 151: 7(fvec4) CompositeConstruct 147 148 149 150 + Store 146(gl_FragColor) 151 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.depthOut.frag.out b/deps/glslang/Test/baseResults/spv.depthOut.frag.out new file mode 100644 index 00000000..5da0df07 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.depthOut.frag.out @@ -0,0 +1,34 @@ +spv.depthOut.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 15 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 8 10 14 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 DepthGreater + ExecutionMode 4 DepthReplacing + Source GLSL 450 + Name 4 "main" + Name 8 "gl_FragDepth" + Name 10 "Depth" + Name 14 "Color" + Decorate 8(gl_FragDepth) BuiltIn FragDepth + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Output 6(float) + 8(gl_FragDepth): 7(ptr) Variable Output + 9: TypePointer Input 6(float) + 10(Depth): 9(ptr) Variable Input + 12: TypeVector 6(float) 4 + 13: TypePointer Input 12(fvec4) + 14(Color): 13(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 11: 6(float) Load 10(Depth) + Store 8(gl_FragDepth) 11 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.deviceGroup.frag.out b/deps/glslang/Test/baseResults/spv.deviceGroup.frag.out new file mode 100644 index 00000000..6710b77f --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.deviceGroup.frag.out @@ -0,0 +1,36 @@ +spv.deviceGroup.frag +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 17 + + Capability Shader + Capability DeviceGroup + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 12 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_device_group" + Name 4 "main" + Name 9 "color" + Name 12 "gl_DeviceIndex" + Decorate 12(gl_DeviceIndex) Flat + Decorate 12(gl_DeviceIndex) BuiltIn DeviceIndex + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(color): 8(ptr) Variable Output + 10: TypeInt 32 1 + 11: TypePointer Input 10(int) +12(gl_DeviceIndex): 11(ptr) Variable Input + 15: 6(float) Constant 0 + 4(main): 2 Function None 3 + 5: Label + 13: 10(int) Load 12(gl_DeviceIndex) + 14: 6(float) ConvertSToF 13 + 16: 7(fvec4) CompositeConstruct 14 15 15 15 + Store 9(color) 16 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.discard-dce.frag.out b/deps/glslang/Test/baseResults/spv.discard-dce.frag.out new file mode 100644 index 00000000..9d138f29 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.discard-dce.frag.out @@ -0,0 +1,127 @@ +spv.discard-dce.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 84 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 21 59 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 9 "white" + Name 12 "black" + Name 15 "color" + Name 18 "x" + Name 21 "tex_coord" + Name 30 "y" + Name 36 "radius" + Name 59 "gl_FragColor" + Decorate 59(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: 6(float) Constant 1065353216 + 11: 7(fvec4) ConstantComposite 10 10 10 10 + 13: 6(float) Constant 1045220557 + 14: 7(fvec4) ConstantComposite 13 13 13 13 + 17: TypePointer Function 6(float) + 19: TypeVector 6(float) 2 + 20: TypePointer Input 19(fvec2) + 21(tex_coord): 20(ptr) Variable Input + 22: TypeInt 32 0 + 23: 22(int) Constant 0 + 24: TypePointer Input 6(float) + 27: 6(float) Constant 1073741824 + 31: 22(int) Constant 1 + 46: TypeBool + 51: 6(float) Constant 1066192077 + 58: TypePointer Output 7(fvec4) +59(gl_FragColor): 58(ptr) Variable Output + 62: 6(float) Constant 1067030938 + 71: 6(float) Constant 1061158912 + 76: 6(float) Constant 1098907648 + 4(main): 2 Function None 3 + 5: Label + 9(white): 8(ptr) Variable Function + 12(black): 8(ptr) Variable Function + 15(color): 8(ptr) Variable Function + 18(x): 17(ptr) Variable Function + 30(y): 17(ptr) Variable Function + 36(radius): 17(ptr) Variable Function + Store 9(white) 11 + Store 12(black) 14 + 16: 7(fvec4) Load 9(white) + Store 15(color) 16 + 25: 24(ptr) AccessChain 21(tex_coord) 23 + 26: 6(float) Load 25 + 28: 6(float) FMul 26 27 + 29: 6(float) FSub 28 10 + Store 18(x) 29 + 32: 24(ptr) AccessChain 21(tex_coord) 31 + 33: 6(float) Load 32 + 34: 6(float) FMul 33 27 + 35: 6(float) FSub 34 10 + Store 30(y) 35 + 37: 6(float) Load 18(x) + 38: 6(float) Load 18(x) + 39: 6(float) FMul 37 38 + 40: 6(float) Load 30(y) + 41: 6(float) Load 30(y) + 42: 6(float) FMul 40 41 + 43: 6(float) FAdd 39 42 + 44: 6(float) ExtInst 1(GLSL.std.450) 31(Sqrt) 43 + Store 36(radius) 44 + 45: 6(float) Load 36(radius) + 47: 46(bool) FOrdGreaterThan 45 10 + SelectionMerge 49 None + BranchConditional 47 48 49 + 48: Label + 50: 6(float) Load 36(radius) + 52: 46(bool) FOrdGreaterThan 50 51 + SelectionMerge 54 None + BranchConditional 52 53 54 + 53: Label + 55: 7(fvec4) Load 15(color) + 56: 7(fvec4) CompositeConstruct 10 10 10 10 + 57: 7(fvec4) FAdd 55 56 + Store 15(color) 57 + Branch 54 + 54: Label + 60: 7(fvec4) Load 15(color) + Store 59(gl_FragColor) 60 + 61: 6(float) Load 36(radius) + 63: 46(bool) FOrdGreaterThan 61 62 + SelectionMerge 65 None + BranchConditional 63 64 65 + 64: Label + 66: 7(fvec4) Load 15(color) + 67: 7(fvec4) CompositeConstruct 10 10 10 10 + 68: 7(fvec4) FAdd 66 67 + Store 15(color) 68 + Branch 65 + 65: Label + Kill + 49: Label + 70: 6(float) Load 36(radius) + 72: 46(bool) FOrdGreaterThanEqual 70 71 + SelectionMerge 74 None + BranchConditional 72 73 74 + 73: Label + 75: 6(float) Load 36(radius) + 77: 6(float) ExtInst 1(GLSL.std.450) 26(Pow) 75 76 + 78: 6(float) FDiv 77 27 + 79: 6(float) ExtInst 1(GLSL.std.450) 4(FAbs) 78 + 80: 7(fvec4) Load 15(color) + 81: 7(fvec4) CompositeConstruct 79 79 79 79 + 82: 7(fvec4) FSub 80 81 + Store 15(color) 82 + Branch 74 + 74: Label + 83: 7(fvec4) Load 15(color) + Store 59(gl_FragColor) 83 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.do-simple.vert.out b/deps/glslang/Test/baseResults/spv.do-simple.vert.out new file mode 100644 index 00000000..6014dfec --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.do-simple.vert.out @@ -0,0 +1,40 @@ +spv.do-simple.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 21 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" + Source ESSL 310 + Name 4 "main" + Name 8 "i" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 15: 6(int) Constant 1 + 18: 6(int) Constant 10 + 19: TypeBool + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + Store 8(i) 9 + Branch 10 + 10: Label + LoopMerge 12 13 None + Branch 11 + 11: Label + 14: 6(int) Load 8(i) + 16: 6(int) IAdd 14 15 + Store 8(i) 16 + Branch 13 + 13: Label + 17: 6(int) Load 8(i) + 20: 19(bool) SLessThan 17 18 + BranchConditional 20 10 12 + 12: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.do-while-continue-break.vert.out b/deps/glslang/Test/baseResults/spv.do-while-continue-break.vert.out new file mode 100644 index 00000000..28388800 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.do-while-continue-break.vert.out @@ -0,0 +1,78 @@ +spv.do-while-continue-break.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 43 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" + Source ESSL 310 + Name 4 "main" + Name 8 "i" + Name 14 "A" + Name 21 "B" + Name 24 "C" + Name 30 "D" + Name 33 "E" + Name 35 "F" + Name 41 "G" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 16: 6(int) Constant 2 + 17: TypeBool + 22: 6(int) Constant 1 + 26: 6(int) Constant 5 + 31: 6(int) Constant 3 + 34: 6(int) Constant 42 + 36: 6(int) Constant 99 + 39: 6(int) Constant 19 + 42: 6(int) Constant 12 + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + 14(A): 7(ptr) Variable Function + 21(B): 7(ptr) Variable Function + 24(C): 7(ptr) Variable Function + 30(D): 7(ptr) Variable Function + 33(E): 7(ptr) Variable Function + 35(F): 7(ptr) Variable Function + 41(G): 7(ptr) Variable Function + Store 8(i) 9 + Branch 10 + 10: Label + LoopMerge 12 13 None + Branch 11 + 11: Label + Store 14(A) 9 + 15: 6(int) Load 8(i) + 18: 17(bool) IEqual 15 16 + SelectionMerge 20 None + BranchConditional 18 19 20 + 19: Label + Store 21(B) 22 + Branch 13 + 20: Label + 25: 6(int) Load 8(i) + 27: 17(bool) IEqual 25 26 + SelectionMerge 29 None + BranchConditional 27 28 29 + 28: Label + Store 30(D) 31 + Branch 12 + 29: Label + Store 35(F) 36 + Branch 13 + 13: Label + 37: 6(int) Load 8(i) + 38: 6(int) IAdd 37 22 + Store 8(i) 38 + 40: 17(bool) SLessThan 38 39 + BranchConditional 40 10 12 + 12: Label + Store 41(G) 42 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.doWhileLoop.frag.out b/deps/glslang/Test/baseResults/spv.doWhileLoop.frag.out new file mode 100644 index 00000000..808466eb --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.doWhileLoop.frag.out @@ -0,0 +1,60 @@ +spv.doWhileLoop.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 34 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 11 17 27 32 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 9 "color" + Name 11 "BaseColor" + Name 17 "bigColor" + Name 27 "d" + Name 32 "gl_FragColor" + Decorate 32(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypePointer Input 7(fvec4) + 11(BaseColor): 10(ptr) Variable Input + 17(bigColor): 10(ptr) Variable Input + 21: TypeInt 32 0 + 22: 21(int) Constant 0 + 23: TypePointer Function 6(float) + 26: TypePointer Input 6(float) + 27(d): 26(ptr) Variable Input + 29: TypeBool + 31: TypePointer Output 7(fvec4) +32(gl_FragColor): 31(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 9(color): 8(ptr) Variable Function + 12: 7(fvec4) Load 11(BaseColor) + Store 9(color) 12 + Branch 13 + 13: Label + LoopMerge 15 16 None + Branch 14 + 14: Label + 18: 7(fvec4) Load 17(bigColor) + 19: 7(fvec4) Load 9(color) + 20: 7(fvec4) FAdd 19 18 + Store 9(color) 20 + Branch 16 + 16: Label + 24: 23(ptr) AccessChain 9(color) 22 + 25: 6(float) Load 24 + 28: 6(float) Load 27(d) + 30: 29(bool) FOrdLessThan 25 28 + BranchConditional 30 13 15 + 15: Label + 33: 7(fvec4) Load 9(color) + Store 32(gl_FragColor) 33 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.double.comp.out b/deps/glslang/Test/baseResults/spv.double.comp.out new file mode 100644 index 00000000..eb8e1226 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.double.comp.out @@ -0,0 +1,98 @@ +spv.double.comp +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 60 + + Capability Shader + Capability Float64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 26 33 + ExecutionMode 4 LocalSize 1 1 1 + Source GLSL 430 + Name 4 "main" + Name 8 "bufName" + MemberName 8(bufName) 0 "f" + MemberName 8(bufName) 1 "d" + Name 10 "bufInst" + Name 22 "storePos" + Name 26 "gl_GlobalInvocationID" + Name 32 "localCoef" + Name 33 "gl_LocalInvocationID" + Name 49 "aa" + Name 54 "globalCoef" + Name 59 "destTex" + MemberDecorate 8(bufName) 0 Offset 0 + MemberDecorate 8(bufName) 1 Offset 8 + Decorate 8(bufName) BufferBlock + Decorate 10(bufInst) DescriptorSet 0 + Decorate 26(gl_GlobalInvocationID) BuiltIn GlobalInvocationId + Decorate 33(gl_LocalInvocationID) BuiltIn LocalInvocationId + Decorate 59(destTex) DescriptorSet 0 + Decorate 59(destTex) NonReadable + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeFloat 64 + 8(bufName): TypeStruct 6(float) 7(float64_t) + 9: TypePointer Uniform 8(bufName) + 10(bufInst): 9(ptr) Variable Uniform + 11: TypeInt 32 1 + 12: 11(int) Constant 1 + 13:7(float64_t) Constant 1413754136 1074340347 + 14: TypePointer Uniform 7(float64_t) + 16: 11(int) Constant 0 + 17: 6(float) Constant 1095307129 + 18: TypePointer Uniform 6(float) + 20: TypeVector 11(int) 2 + 21: TypePointer Function 20(ivec2) + 23: TypeInt 32 0 + 24: TypeVector 23(int) 3 + 25: TypePointer Input 24(ivec3) +26(gl_GlobalInvocationID): 25(ptr) Variable Input + 27: TypeVector 23(int) 2 + 31: TypePointer Function 7(float64_t) +33(gl_LocalInvocationID): 25(ptr) Variable Input + 37: 11(int) Constant 8 + 40: TypeVector 6(float) 2 + 42: 6(float) Constant 1090519040 + 47: TypeVector 7(float64_t) 4 + 48: TypePointer Function 47(f64vec4) + 50:7(float64_t) Constant 2576980378 1071225241 + 51:7(float64_t) Constant 2576980378 1070176665 + 52:7(float64_t) Constant 858993459 1070805811 + 53: 47(f64vec4) ConstantComposite 50 51 52 50 + 55:7(float64_t) Constant 0 1072693248 + 56:7(float64_t) Constant 3229815407 1074340298 + 57: TypeImage 6(float) 2D nonsampled format:Unknown + 58: TypePointer UniformConstant 57 + 59(destTex): 58(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 22(storePos): 21(ptr) Variable Function + 32(localCoef): 31(ptr) Variable Function + 49(aa): 48(ptr) Variable Function + 54(globalCoef): 31(ptr) Variable Function + 15: 14(ptr) AccessChain 10(bufInst) 12 + Store 15 13 + 19: 18(ptr) AccessChain 10(bufInst) 16 + Store 19 17 + 28: 24(ivec3) Load 26(gl_GlobalInvocationID) + 29: 27(ivec2) VectorShuffle 28 28 0 1 + 30: 20(ivec2) Bitcast 29 + Store 22(storePos) 30 + 34: 24(ivec3) Load 33(gl_LocalInvocationID) + 35: 27(ivec2) VectorShuffle 34 34 0 1 + 36: 20(ivec2) Bitcast 35 + 38: 20(ivec2) CompositeConstruct 37 37 + 39: 20(ivec2) ISub 36 38 + 41: 40(fvec2) ConvertSToF 39 + 43: 40(fvec2) CompositeConstruct 42 42 + 44: 40(fvec2) FDiv 41 43 + 45: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 44 + 46:7(float64_t) FConvert 45 + Store 32(localCoef) 46 + Store 49(aa) 53 + Store 54(globalCoef) 55 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.drawParams.vert.out b/deps/glslang/Test/baseResults/spv.drawParams.vert.out new file mode 100644 index 00000000..8f3e2c0a --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.drawParams.vert.out @@ -0,0 +1,56 @@ +spv.drawParams.vert +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 29 + + Capability Shader + Capability DrawParameters + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 10 13 16 21 + Source GLSL 450 + SourceExtension "GL_ARB_shader_draw_parameters" + Name 4 "main" + Name 8 "a" + Name 10 "gl_BaseVertexARB" + Name 12 "b" + Name 13 "gl_BaseInstanceARB" + Name 15 "c" + Name 16 "gl_DrawIDARB" + Name 21 "pos" + Decorate 10(gl_BaseVertexARB) BuiltIn BaseVertex + Decorate 13(gl_BaseInstanceARB) BuiltIn BaseInstance + Decorate 16(gl_DrawIDARB) BuiltIn DrawIndex + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: TypePointer Input 6(int) +10(gl_BaseVertexARB): 9(ptr) Variable Input +13(gl_BaseInstanceARB): 9(ptr) Variable Input +16(gl_DrawIDARB): 9(ptr) Variable Input + 18: TypeFloat 32 + 19: TypeVector 18(float) 3 + 20: TypePointer Output 19(fvec3) + 21(pos): 20(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 8(a): 7(ptr) Variable Function + 12(b): 7(ptr) Variable Function + 15(c): 7(ptr) Variable Function + 11: 6(int) Load 10(gl_BaseVertexARB) + Store 8(a) 11 + 14: 6(int) Load 13(gl_BaseInstanceARB) + Store 12(b) 14 + 17: 6(int) Load 16(gl_DrawIDARB) + Store 15(c) 17 + 22: 6(int) Load 8(a) + 23: 18(float) ConvertSToF 22 + 24: 6(int) Load 12(b) + 25: 18(float) ConvertSToF 24 + 26: 6(int) Load 15(c) + 27: 18(float) ConvertSToF 26 + 28: 19(fvec3) CompositeConstruct 23 25 27 + Store 21(pos) 28 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.earlyReturnDiscard.frag.out b/deps/glslang/Test/baseResults/spv.earlyReturnDiscard.frag.out new file mode 100644 index 00000000..c44b722f --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.earlyReturnDiscard.frag.out @@ -0,0 +1,170 @@ +spv.earlyReturnDiscard.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 110 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 11 14 17 19 25 30 39 51 63 105 109 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 9 "color" + Name 11 "BaseColor" + Name 13 "color2" + Name 14 "otherColor" + Name 17 "c" + Name 19 "d" + Name 25 "bigColor" + Name 30 "smallColor" + Name 39 "minimum" + Name 51 "threshhold" + Name 63 "threshhold2" + Name 77 "b" + Name 105 "gl_FragColor" + Name 109 "threshhold3" + Decorate 105(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypePointer Input 7(fvec4) + 11(BaseColor): 10(ptr) Variable Input + 14(otherColor): 10(ptr) Variable Input + 16: TypePointer Input 6(float) + 17(c): 16(ptr) Variable Input + 19(d): 16(ptr) Variable Input + 21: TypeBool + 25(bigColor): 10(ptr) Variable Input + 30(smallColor): 10(ptr) Variable Input + 34: TypeInt 32 0 + 35: 34(int) Constant 2 + 36: TypePointer Function 6(float) + 39(minimum): 16(ptr) Variable Input + 47: 6(float) Constant 1065353216 + 51(threshhold): 16(ptr) Variable Input + 60: 34(int) Constant 3 + 63(threshhold2): 16(ptr) Variable Input + 76: TypePointer Private 21(bool) + 77(b): 76(ptr) Variable Private + 85: 34(int) Constant 0 + 104: TypePointer Output 7(fvec4) +105(gl_FragColor): 104(ptr) Variable Output +109(threshhold3): 16(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 9(color): 8(ptr) Variable Function + 13(color2): 8(ptr) Variable Function + 12: 7(fvec4) Load 11(BaseColor) + Store 9(color) 12 + 15: 7(fvec4) Load 14(otherColor) + Store 13(color2) 15 + 18: 6(float) Load 17(c) + 20: 6(float) Load 19(d) + 22: 21(bool) FOrdGreaterThan 18 20 + SelectionMerge 24 None + BranchConditional 22 23 29 + 23: Label + 26: 7(fvec4) Load 25(bigColor) + 27: 7(fvec4) Load 9(color) + 28: 7(fvec4) FAdd 27 26 + Store 9(color) 28 + Branch 24 + 29: Label + 31: 7(fvec4) Load 30(smallColor) + 32: 7(fvec4) Load 9(color) + 33: 7(fvec4) FAdd 32 31 + Store 9(color) 33 + Branch 24 + 24: Label + 37: 36(ptr) AccessChain 9(color) 35 + 38: 6(float) Load 37 + 40: 6(float) Load 39(minimum) + 41: 21(bool) FOrdLessThan 38 40 + SelectionMerge 43 None + BranchConditional 41 42 43 + 42: Label + Return + 43: Label + 45: 36(ptr) AccessChain 9(color) 35 + 46: 6(float) Load 45 + 48: 6(float) FAdd 46 47 + Store 45 48 + 49: 36(ptr) AccessChain 9(color) 35 + 50: 6(float) Load 49 + 52: 6(float) Load 51(threshhold) + 53: 21(bool) FOrdGreaterThan 50 52 + SelectionMerge 55 None + BranchConditional 53 54 55 + 54: Label + Kill + 55: Label + 57: 7(fvec4) Load 9(color) + 58: 7(fvec4) CompositeConstruct 47 47 47 47 + 59: 7(fvec4) FAdd 57 58 + Store 9(color) 59 + 61: 36(ptr) AccessChain 9(color) 60 + 62: 6(float) Load 61 + 64: 6(float) Load 63(threshhold2) + 65: 21(bool) FOrdGreaterThan 62 64 + SelectionMerge 67 None + BranchConditional 65 66 97 + 66: Label + 68: 36(ptr) AccessChain 9(color) 35 + 69: 6(float) Load 68 + 70: 6(float) Load 63(threshhold2) + 71: 21(bool) FOrdGreaterThan 69 70 + SelectionMerge 73 None + BranchConditional 71 72 75 + 72: Label + Return + 75: Label + 78: 21(bool) Load 77(b) + SelectionMerge 80 None + BranchConditional 78 79 84 + 79: Label + 81: 36(ptr) AccessChain 9(color) 35 + 82: 6(float) Load 81 + 83: 6(float) FAdd 82 47 + Store 81 83 + Branch 80 + 84: Label + 86: 36(ptr) AccessChain 9(color) 85 + 87: 6(float) Load 86 + 88: 6(float) Load 39(minimum) + 89: 21(bool) FOrdLessThan 87 88 + SelectionMerge 91 None + BranchConditional 89 90 93 + 90: Label + Kill + 93: Label + 94: 7(fvec4) Load 9(color) + 95: 7(fvec4) CompositeConstruct 47 47 47 47 + 96: 7(fvec4) FAdd 94 95 + Store 9(color) 96 + Branch 91 + 91: Label + Branch 80 + 80: Label + Branch 73 + 73: Label + Branch 67 + 97: Label + 98: 21(bool) Load 77(b) + SelectionMerge 100 None + BranchConditional 98 99 102 + 99: Label + Kill + 102: Label + Return + 100: Label + Branch 67 + 67: Label + 106: 7(fvec4) Load 9(color) + 107: 7(fvec4) Load 13(color2) + 108: 7(fvec4) FMul 106 107 + Store 105(gl_FragColor) 108 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.explicittypes.frag.out b/deps/glslang/Test/baseResults/spv.explicittypes.frag.out new file mode 100644 index 00000000..44f5ddd3 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.explicittypes.frag.out @@ -0,0 +1,886 @@ +spv.explicittypes.frag +error: SPIRV-Tools Validation Errors +error: Capability Float16 is not allowed by Vulkan 1.1 specification (or requires extension) + OpCapability Float16 + +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 576 + + Capability Shader + Capability Float16 + Capability Float64 + Capability Int64 + Capability Int16 + Capability Int8 + Capability StorageUniform16 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_KHX_shader_explicit_arithmetic_types" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int8" + Name 4 "main" + Name 6 "literal(" + Name 8 "typeCast8(" + Name 10 "typeCast16(" + Name 12 "typeCast32(" + Name 14 "typeCast64(" + Name 18 "i64" + Name 26 "Uniforms" + MemberName 26(Uniforms) 0 "index" + Name 28 "" + Name 35 "indexable" + Name 40 "u64" + Name 49 "indexable" + Name 53 "i32" + Name 62 "indexable" + Name 66 "u32" + Name 74 "indexable" + Name 79 "i16" + Name 88 "indexable" + Name 93 "u16" + Name 101 "indexable" + Name 106 "i8" + Name 115 "indexable" + Name 120 "u8" + Name 128 "indexable" + Name 133 "u8v" + Name 136 "i8v" + Name 141 "i16v" + Name 150 "i32v" + Name 158 "u32v" + Name 164 "i64v" + Name 169 "u64v" + Name 183 "f16v" + Name 189 "f32v" + Name 195 "f64v" + Name 222 "u16v" + Name 252 "bv" + Name 268 "i32v" + Name 269 "i16v" + Name 272 "u16v" + Name 278 "u32v" + Name 282 "i64v" + Name 285 "u64v" + Name 296 "f16v" + Name 299 "f32v" + Name 302 "f64v" + Name 347 "i8v" + Name 353 "u8v" + Name 363 "bv" + Name 380 "u32v" + Name 381 "i32v" + Name 384 "i64v" + Name 387 "u64v" + Name 396 "f32v" + Name 399 "f64v" + Name 406 "i8v" + Name 412 "i16v" + Name 429 "u8v" + Name 435 "u16v" + Name 452 "f16v" + Name 465 "bv" + Name 481 "u64v" + Name 482 "i64v" + Name 485 "f64v" + Name 490 "i8v" + Name 496 "i16v" + Name 502 "i32v" + Name 510 "u8v" + Name 516 "u16v" + Name 522 "u32v" + Name 534 "f16v" + Name 537 "f32v" + Name 548 "bv" + Name 573 "Block" + MemberName 573(Block) 0 "i16" + MemberName 573(Block) 1 "i16v2" + MemberName 573(Block) 2 "i16v3" + MemberName 573(Block) 3 "i16v4" + MemberName 573(Block) 4 "u16" + MemberName 573(Block) 5 "u16v2" + MemberName 573(Block) 6 "u16v3" + MemberName 573(Block) 7 "u16v4" + MemberName 573(Block) 8 "i32" + MemberName 573(Block) 9 "i32v2" + MemberName 573(Block) 10 "i32v3" + MemberName 573(Block) 11 "i32v4" + MemberName 573(Block) 12 "u32" + MemberName 573(Block) 13 "u32v2" + MemberName 573(Block) 14 "u32v3" + MemberName 573(Block) 15 "u32v4" + Name 575 "block" + MemberDecorate 26(Uniforms) 0 Offset 0 + Decorate 26(Uniforms) Block + Decorate 28 DescriptorSet 0 + Decorate 28 Binding 0 + MemberDecorate 573(Block) 0 Offset 0 + MemberDecorate 573(Block) 1 Offset 4 + MemberDecorate 573(Block) 2 Offset 8 + MemberDecorate 573(Block) 3 Offset 16 + MemberDecorate 573(Block) 4 Offset 24 + MemberDecorate 573(Block) 5 Offset 28 + MemberDecorate 573(Block) 6 Offset 32 + MemberDecorate 573(Block) 7 Offset 40 + MemberDecorate 573(Block) 8 Offset 48 + MemberDecorate 573(Block) 9 Offset 56 + MemberDecorate 573(Block) 10 Offset 64 + MemberDecorate 573(Block) 11 Offset 80 + MemberDecorate 573(Block) 12 Offset 96 + MemberDecorate 573(Block) 13 Offset 104 + MemberDecorate 573(Block) 14 Offset 112 + MemberDecorate 573(Block) 15 Offset 128 + Decorate 573(Block) Block + Decorate 575(block) DescriptorSet 0 + Decorate 575(block) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 16: TypeInt 64 1 + 17: TypePointer Function 16(int64_t) + 19: TypeInt 32 0 + 20: 19(int) Constant 3 + 21: TypeArray 16(int64_t) 20 + 22: 16(int64_t) Constant 4008636143 4008636142 + 23: 16(int64_t) Constant 4294967295 4294967295 + 24: 16(int64_t) Constant 0 1 + 25: 21 ConstantComposite 22 23 24 + 26(Uniforms): TypeStruct 19(int) + 27: TypePointer Uniform 26(Uniforms) + 28: 27(ptr) Variable Uniform + 29: TypeInt 32 1 + 30: 29(int) Constant 0 + 31: TypePointer Uniform 19(int) + 34: TypePointer Function 21 + 38: TypeInt 64 0 + 39: TypePointer Function 38(int64_t) + 41: TypeArray 38(int64_t) 20 + 42: 38(int64_t) Constant 4294967295 4294967295 + 43: 38(int64_t) Constant 0 1 + 44: 38(int64_t) Constant 4294967295 1 + 45: 41 ConstantComposite 42 43 44 + 48: TypePointer Function 41 + 52: TypePointer Function 29(int) + 54: TypeArray 29(int) 20 + 55: 29(int) Constant 4008636143 + 56: 29(int) Constant 4294967295 + 57: 29(int) Constant 536870912 + 58: 54 ConstantComposite 55 56 57 + 61: TypePointer Function 54 + 65: TypePointer Function 19(int) + 67: TypeArray 19(int) 20 + 68: 19(int) Constant 4294967295 + 69: 19(int) Constant 2147483647 + 70: 67 ConstantComposite 68 68 69 + 73: TypePointer Function 67 + 77: TypeInt 16 1 + 78: TypePointer Function 77(int16_t) + 80: TypeArray 77(int16_t) 20 + 81: 77(int16_t) Constant 4294962927 + 82: 77(int16_t) Constant 4294967295 + 83: 77(int16_t) Constant 16384 + 84: 80 ConstantComposite 81 82 83 + 87: TypePointer Function 80 + 91: TypeInt 16 0 + 92: TypePointer Function 91(int16_t) + 94: TypeArray 91(int16_t) 20 + 95: 91(int16_t) Constant 65535 + 96: 91(int16_t) Constant 32767 + 97: 94 ConstantComposite 95 95 96 + 100: TypePointer Function 94 + 104: TypeInt 8 1 + 105: TypePointer Function 104(int8_t) + 107: TypeArray 104(int8_t) 20 + 108: 104(int8_t) Constant 4294967279 + 109: 104(int8_t) Constant 4294967295 + 110: 104(int8_t) Constant 0 + 111: 107 ConstantComposite 108 109 110 + 114: TypePointer Function 107 + 118: TypeInt 8 0 + 119: TypePointer Function 118(int8_t) + 121: TypeArray 118(int8_t) 20 + 122: 118(int8_t) Constant 255 + 123: 118(int8_t) Constant 127 + 124: 121 ConstantComposite 122 122 123 + 127: TypePointer Function 121 + 131: TypeVector 118(int8_t) 2 + 132: TypePointer Function 131(i8vec2) + 134: TypeVector 104(int8_t) 2 + 135: TypePointer Function 134(i8vec2) + 139: TypeVector 77(int16_t) 2 + 140: TypePointer Function 139(i16vec2) + 145: TypeVector 91(int16_t) 2 + 148: TypeVector 29(int) 2 + 149: TypePointer Function 148(ivec2) + 154: TypeVector 19(int) 2 + 157: TypePointer Function 154(ivec2) + 162: TypeVector 16(int64_t) 2 + 163: TypePointer Function 162(i64vec2) + 167: TypeVector 38(int64_t) 2 + 168: TypePointer Function 167(i64vec2) + 180: TypeFloat 16 + 181: TypeVector 180(float16_t) 2 + 182: TypePointer Function 181(f16vec2) + 186: TypeFloat 32 + 187: TypeVector 186(float) 2 + 188: TypePointer Function 187(fvec2) + 192: TypeFloat 64 + 193: TypeVector 192(float64_t) 2 + 194: TypePointer Function 193(f64vec2) + 221: TypePointer Function 145(i16vec2) + 249: TypeBool + 250: TypeVector 249(bool) 2 + 251: TypePointer Function 250(bvec2) + 254: 104(int8_t) Constant 1 + 255: 134(i8vec2) ConstantComposite 110 110 + 256: 134(i8vec2) ConstantComposite 254 254 + 259: 118(int8_t) Constant 0 + 260: 118(int8_t) Constant 1 + 261: 131(i8vec2) ConstantComposite 259 259 + 262: 131(i8vec2) ConstantComposite 260 260 + 365: 77(int16_t) Constant 0 + 366: 77(int16_t) Constant 1 + 367:139(i16vec2) ConstantComposite 365 365 + 368:139(i16vec2) ConstantComposite 366 366 + 371: 91(int16_t) Constant 0 + 372: 91(int16_t) Constant 1 + 373:145(i16vec2) ConstantComposite 371 371 + 374:145(i16vec2) ConstantComposite 372 372 + 467: 29(int) Constant 1 + 468: 148(ivec2) ConstantComposite 30 30 + 469: 148(ivec2) ConstantComposite 467 467 + 472: 19(int) Constant 0 + 473: 19(int) Constant 1 + 474: 154(ivec2) ConstantComposite 472 472 + 475: 154(ivec2) ConstantComposite 473 473 + 550: 16(int64_t) Constant 0 0 + 551: 16(int64_t) Constant 1 0 + 552:162(i64vec2) ConstantComposite 550 550 + 553:162(i64vec2) ConstantComposite 551 551 + 556: 38(int64_t) Constant 0 0 + 557: 38(int64_t) Constant 1 0 + 558:167(i64vec2) ConstantComposite 556 556 + 559:167(i64vec2) ConstantComposite 557 557 + 565: TypeVector 77(int16_t) 3 + 566: TypeVector 77(int16_t) 4 + 567: TypeVector 91(int16_t) 3 + 568: TypeVector 91(int16_t) 4 + 569: TypeVector 29(int) 3 + 570: TypeVector 29(int) 4 + 571: TypeVector 19(int) 3 + 572: TypeVector 19(int) 4 + 573(Block): TypeStruct 77(int16_t) 139(i16vec2) 565(i16vec3) 566(i16vec4) 91(int16_t) 145(i16vec2) 567(i16vec3) 568(i16vec4) 29(int) 148(ivec2) 569(ivec3) 570(ivec4) 19(int) 154(ivec2) 571(ivec3) 572(ivec4) + 574: TypePointer Uniform 573(Block) + 575(block): 574(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd + 6(literal(): 2 Function None 3 + 7: Label + 18(i64): 17(ptr) Variable Function + 35(indexable): 34(ptr) Variable Function + 40(u64): 39(ptr) Variable Function + 49(indexable): 48(ptr) Variable Function + 53(i32): 52(ptr) Variable Function + 62(indexable): 61(ptr) Variable Function + 66(u32): 65(ptr) Variable Function + 74(indexable): 73(ptr) Variable Function + 79(i16): 78(ptr) Variable Function + 88(indexable): 87(ptr) Variable Function + 93(u16): 92(ptr) Variable Function + 101(indexable): 100(ptr) Variable Function + 106(i8): 105(ptr) Variable Function + 115(indexable): 114(ptr) Variable Function + 120(u8): 119(ptr) Variable Function + 128(indexable): 127(ptr) Variable Function + 32: 31(ptr) AccessChain 28 30 + 33: 19(int) Load 32 + Store 35(indexable) 25 + 36: 17(ptr) AccessChain 35(indexable) 33 + 37: 16(int64_t) Load 36 + Store 18(i64) 37 + 46: 31(ptr) AccessChain 28 30 + 47: 19(int) Load 46 + Store 49(indexable) 45 + 50: 39(ptr) AccessChain 49(indexable) 47 + 51: 38(int64_t) Load 50 + Store 40(u64) 51 + 59: 31(ptr) AccessChain 28 30 + 60: 19(int) Load 59 + Store 62(indexable) 58 + 63: 52(ptr) AccessChain 62(indexable) 60 + 64: 29(int) Load 63 + Store 53(i32) 64 + 71: 31(ptr) AccessChain 28 30 + 72: 19(int) Load 71 + Store 74(indexable) 70 + 75: 65(ptr) AccessChain 74(indexable) 72 + 76: 19(int) Load 75 + Store 66(u32) 76 + 85: 31(ptr) AccessChain 28 30 + 86: 19(int) Load 85 + Store 88(indexable) 84 + 89: 78(ptr) AccessChain 88(indexable) 86 + 90: 77(int16_t) Load 89 + Store 79(i16) 90 + 98: 31(ptr) AccessChain 28 30 + 99: 19(int) Load 98 + Store 101(indexable) 97 + 102: 92(ptr) AccessChain 101(indexable) 99 + 103: 91(int16_t) Load 102 + Store 93(u16) 103 + 112: 31(ptr) AccessChain 28 30 + 113: 19(int) Load 112 + Store 115(indexable) 111 + 116: 105(ptr) AccessChain 115(indexable) 113 + 117: 104(int8_t) Load 116 + Store 106(i8) 117 + 125: 31(ptr) AccessChain 28 30 + 126: 19(int) Load 125 + Store 128(indexable) 124 + 129: 119(ptr) AccessChain 128(indexable) 126 + 130: 118(int8_t) Load 129 + Store 120(u8) 130 + Return + FunctionEnd + 8(typeCast8(): 2 Function None 3 + 9: Label + 133(u8v): 132(ptr) Variable Function + 136(i8v): 135(ptr) Variable Function + 141(i16v): 140(ptr) Variable Function + 150(i32v): 149(ptr) Variable Function + 158(u32v): 157(ptr) Variable Function + 164(i64v): 163(ptr) Variable Function + 169(u64v): 168(ptr) Variable Function + 183(f16v): 182(ptr) Variable Function + 189(f32v): 188(ptr) Variable Function + 195(f64v): 194(ptr) Variable Function + 222(u16v): 221(ptr) Variable Function + 252(bv): 251(ptr) Variable Function + 137: 134(i8vec2) Load 136(i8v) + 138: 131(i8vec2) Bitcast 137 + Store 133(u8v) 138 + 142: 134(i8vec2) Load 136(i8v) + 143:139(i16vec2) SConvert 142 + Store 141(i16v) 143 + 144: 131(i8vec2) Load 133(u8v) + 146:145(i16vec2) UConvert 144 + 147:139(i16vec2) Bitcast 146 + Store 141(i16v) 147 + 151: 134(i8vec2) Load 136(i8v) + 152: 148(ivec2) SConvert 151 + Store 150(i32v) 152 + 153: 131(i8vec2) Load 133(u8v) + 155: 154(ivec2) UConvert 153 + 156: 148(ivec2) Bitcast 155 + Store 150(i32v) 156 + 159: 134(i8vec2) Load 136(i8v) + 160: 148(ivec2) SConvert 159 + 161: 154(ivec2) Bitcast 160 + Store 158(u32v) 161 + 165: 134(i8vec2) Load 136(i8v) + 166:162(i64vec2) SConvert 165 + Store 164(i64v) 166 + 170: 134(i8vec2) Load 136(i8v) + 171:162(i64vec2) SConvert 170 + 172:167(i64vec2) Bitcast 171 + Store 169(u64v) 172 + 173: 131(i8vec2) Load 133(u8v) + 174: 154(ivec2) UConvert 173 + Store 158(u32v) 174 + 175: 131(i8vec2) Load 133(u8v) + 176:167(i64vec2) UConvert 175 + 177:162(i64vec2) Bitcast 176 + Store 164(i64v) 177 + 178: 131(i8vec2) Load 133(u8v) + 179:167(i64vec2) UConvert 178 + Store 169(u64v) 179 + 184: 134(i8vec2) Load 136(i8v) + 185:181(f16vec2) ConvertSToF 184 + Store 183(f16v) 185 + 190: 134(i8vec2) Load 136(i8v) + 191: 187(fvec2) ConvertSToF 190 + Store 189(f32v) 191 + 196: 134(i8vec2) Load 136(i8v) + 197:193(f64vec2) ConvertSToF 196 + Store 195(f64v) 197 + 198: 131(i8vec2) Load 133(u8v) + 199:181(f16vec2) ConvertUToF 198 + Store 183(f16v) 199 + 200: 131(i8vec2) Load 133(u8v) + 201: 187(fvec2) ConvertUToF 200 + Store 189(f32v) 201 + 202: 131(i8vec2) Load 133(u8v) + 203:193(f64vec2) ConvertUToF 202 + Store 195(f64v) 203 + 204: 131(i8vec2) Load 133(u8v) + 205: 134(i8vec2) Bitcast 204 + Store 136(i8v) 205 + 206: 134(i8vec2) Load 136(i8v) + 207:139(i16vec2) SConvert 206 + Store 141(i16v) 207 + 208: 131(i8vec2) Load 133(u8v) + 209:145(i16vec2) UConvert 208 + 210:139(i16vec2) Bitcast 209 + Store 141(i16v) 210 + 211: 134(i8vec2) Load 136(i8v) + 212: 148(ivec2) SConvert 211 + Store 150(i32v) 212 + 213: 131(i8vec2) Load 133(u8v) + 214: 154(ivec2) UConvert 213 + 215: 148(ivec2) Bitcast 214 + Store 150(i32v) 215 + 216: 134(i8vec2) Load 136(i8v) + 217:162(i64vec2) SConvert 216 + Store 164(i64v) 217 + 218: 134(i8vec2) Load 136(i8v) + 219:162(i64vec2) SConvert 218 + 220:167(i64vec2) Bitcast 219 + Store 169(u64v) 220 + 223: 134(i8vec2) Load 136(i8v) + 224:139(i16vec2) SConvert 223 + 225:145(i16vec2) Bitcast 224 + Store 222(u16v) 225 + 226: 131(i8vec2) Load 133(u8v) + 227:145(i16vec2) UConvert 226 + Store 222(u16v) 227 + 228: 131(i8vec2) Load 133(u8v) + 229: 154(ivec2) UConvert 228 + Store 158(u32v) 229 + 230: 131(i8vec2) Load 133(u8v) + 231:167(i64vec2) UConvert 230 + 232:162(i64vec2) Bitcast 231 + Store 164(i64v) 232 + 233: 131(i8vec2) Load 133(u8v) + 234:167(i64vec2) UConvert 233 + 235:162(i64vec2) Bitcast 234 + 236:167(i64vec2) Bitcast 235 + Store 169(u64v) 236 + 237: 134(i8vec2) Load 136(i8v) + 238:181(f16vec2) ConvertSToF 237 + Store 183(f16v) 238 + 239: 134(i8vec2) Load 136(i8v) + 240: 187(fvec2) ConvertSToF 239 + Store 189(f32v) 240 + 241: 134(i8vec2) Load 136(i8v) + 242:193(f64vec2) ConvertSToF 241 + Store 195(f64v) 242 + 243: 131(i8vec2) Load 133(u8v) + 244:181(f16vec2) ConvertUToF 243 + Store 183(f16v) 244 + 245: 131(i8vec2) Load 133(u8v) + 246: 187(fvec2) ConvertUToF 245 + Store 189(f32v) 246 + 247: 131(i8vec2) Load 133(u8v) + 248:193(f64vec2) ConvertUToF 247 + Store 195(f64v) 248 + 253: 250(bvec2) Load 252(bv) + 257: 134(i8vec2) Select 253 256 255 + Store 136(i8v) 257 + 258: 250(bvec2) Load 252(bv) + 263: 131(i8vec2) Select 258 262 261 + Store 133(u8v) 263 + 264: 134(i8vec2) Load 136(i8v) + 265: 250(bvec2) INotEqual 264 261 + Store 252(bv) 265 + 266: 131(i8vec2) Load 133(u8v) + 267: 250(bvec2) INotEqual 266 261 + Store 252(bv) 267 + Return + FunctionEnd + 10(typeCast16(): 2 Function None 3 + 11: Label + 268(i32v): 149(ptr) Variable Function + 269(i16v): 140(ptr) Variable Function + 272(u16v): 221(ptr) Variable Function + 278(u32v): 157(ptr) Variable Function + 282(i64v): 163(ptr) Variable Function + 285(u64v): 168(ptr) Variable Function + 296(f16v): 182(ptr) Variable Function + 299(f32v): 188(ptr) Variable Function + 302(f64v): 194(ptr) Variable Function + 347(i8v): 135(ptr) Variable Function + 353(u8v): 132(ptr) Variable Function + 363(bv): 251(ptr) Variable Function + 270:139(i16vec2) Load 269(i16v) + 271: 148(ivec2) SConvert 270 + Store 268(i32v) 271 + 273:145(i16vec2) Load 272(u16v) + 274: 154(ivec2) UConvert 273 + 275: 148(ivec2) Bitcast 274 + Store 268(i32v) 275 + 276:139(i16vec2) Load 269(i16v) + 277:145(i16vec2) Bitcast 276 + Store 272(u16v) 277 + 279:139(i16vec2) Load 269(i16v) + 280: 148(ivec2) SConvert 279 + 281: 154(ivec2) Bitcast 280 + Store 278(u32v) 281 + 283:139(i16vec2) Load 269(i16v) + 284:162(i64vec2) SConvert 283 + Store 282(i64v) 284 + 286:139(i16vec2) Load 269(i16v) + 287:162(i64vec2) SConvert 286 + 288:167(i64vec2) Bitcast 287 + Store 285(u64v) 288 + 289:145(i16vec2) Load 272(u16v) + 290: 154(ivec2) UConvert 289 + Store 278(u32v) 290 + 291:145(i16vec2) Load 272(u16v) + 292:167(i64vec2) UConvert 291 + 293:162(i64vec2) Bitcast 292 + Store 282(i64v) 293 + 294:145(i16vec2) Load 272(u16v) + 295:167(i64vec2) UConvert 294 + Store 285(u64v) 295 + 297:139(i16vec2) Load 269(i16v) + 298:181(f16vec2) ConvertSToF 297 + Store 296(f16v) 298 + 300:139(i16vec2) Load 269(i16v) + 301: 187(fvec2) ConvertSToF 300 + Store 299(f32v) 301 + 303:139(i16vec2) Load 269(i16v) + 304:193(f64vec2) ConvertSToF 303 + Store 302(f64v) 304 + 305:145(i16vec2) Load 272(u16v) + 306:181(f16vec2) ConvertUToF 305 + Store 296(f16v) 306 + 307:145(i16vec2) Load 272(u16v) + 308: 187(fvec2) ConvertUToF 307 + Store 299(f32v) 308 + 309:145(i16vec2) Load 272(u16v) + 310:193(f64vec2) ConvertUToF 309 + Store 302(f64v) 310 + 311:139(i16vec2) Load 269(i16v) + 312: 148(ivec2) SConvert 311 + Store 268(i32v) 312 + 313:145(i16vec2) Load 272(u16v) + 314: 154(ivec2) UConvert 313 + 315: 148(ivec2) Bitcast 314 + Store 268(i32v) 315 + 316:139(i16vec2) Load 269(i16v) + 317:145(i16vec2) Bitcast 316 + Store 272(u16v) 317 + 318:139(i16vec2) Load 269(i16v) + 319: 148(ivec2) SConvert 318 + 320: 154(ivec2) Bitcast 319 + Store 278(u32v) 320 + 321:139(i16vec2) Load 269(i16v) + 322:162(i64vec2) SConvert 321 + Store 282(i64v) 322 + 323:139(i16vec2) Load 269(i16v) + 324:162(i64vec2) SConvert 323 + 325:167(i64vec2) Bitcast 324 + Store 285(u64v) 325 + 326:145(i16vec2) Load 272(u16v) + 327: 154(ivec2) UConvert 326 + Store 278(u32v) 327 + 328:145(i16vec2) Load 272(u16v) + 329:167(i64vec2) UConvert 328 + 330:162(i64vec2) Bitcast 329 + Store 282(i64v) 330 + 331:145(i16vec2) Load 272(u16v) + 332:167(i64vec2) UConvert 331 + 333:162(i64vec2) Bitcast 332 + 334:167(i64vec2) Bitcast 333 + Store 285(u64v) 334 + 335:139(i16vec2) Load 269(i16v) + 336:181(f16vec2) ConvertSToF 335 + Store 296(f16v) 336 + 337:139(i16vec2) Load 269(i16v) + 338: 187(fvec2) ConvertSToF 337 + Store 299(f32v) 338 + 339:139(i16vec2) Load 269(i16v) + 340:193(f64vec2) ConvertSToF 339 + Store 302(f64v) 340 + 341:145(i16vec2) Load 272(u16v) + 342:181(f16vec2) ConvertUToF 341 + Store 296(f16v) 342 + 343:145(i16vec2) Load 272(u16v) + 344: 187(fvec2) ConvertUToF 343 + Store 299(f32v) 344 + 345:145(i16vec2) Load 272(u16v) + 346:193(f64vec2) ConvertUToF 345 + Store 302(f64v) 346 + 348:139(i16vec2) Load 269(i16v) + 349: 134(i8vec2) SConvert 348 + Store 347(i8v) 349 + 350:145(i16vec2) Load 272(u16v) + 351: 131(i8vec2) UConvert 350 + 352: 134(i8vec2) Bitcast 351 + Store 347(i8v) 352 + 354:139(i16vec2) Load 269(i16v) + 355: 134(i8vec2) SConvert 354 + 356: 131(i8vec2) Bitcast 355 + Store 353(u8v) 356 + 357:145(i16vec2) Load 272(u16v) + 358: 131(i8vec2) UConvert 357 + Store 353(u8v) 358 + 359:145(i16vec2) Load 272(u16v) + 360: 131(i8vec2) UConvert 359 + 361:145(i16vec2) UConvert 360 + 362:139(i16vec2) Bitcast 361 + Store 269(i16v) 362 + 364: 250(bvec2) Load 363(bv) + 369:139(i16vec2) Select 364 368 367 + Store 269(i16v) 369 + 370: 250(bvec2) Load 363(bv) + 375:145(i16vec2) Select 370 374 373 + Store 272(u16v) 375 + 376:139(i16vec2) Load 269(i16v) + 377: 250(bvec2) INotEqual 376 373 + Store 363(bv) 377 + 378:145(i16vec2) Load 272(u16v) + 379: 250(bvec2) INotEqual 378 373 + Store 363(bv) 379 + Return + FunctionEnd + 12(typeCast32(): 2 Function None 3 + 13: Label + 380(u32v): 157(ptr) Variable Function + 381(i32v): 149(ptr) Variable Function + 384(i64v): 163(ptr) Variable Function + 387(u64v): 168(ptr) Variable Function + 396(f32v): 188(ptr) Variable Function + 399(f64v): 194(ptr) Variable Function + 406(i8v): 135(ptr) Variable Function + 412(i16v): 140(ptr) Variable Function + 429(u8v): 132(ptr) Variable Function + 435(u16v): 221(ptr) Variable Function + 452(f16v): 182(ptr) Variable Function + 465(bv): 251(ptr) Variable Function + 382: 148(ivec2) Load 381(i32v) + 383: 154(ivec2) Bitcast 382 + Store 380(u32v) 383 + 385: 148(ivec2) Load 381(i32v) + 386:162(i64vec2) SConvert 385 + Store 384(i64v) 386 + 388: 148(ivec2) Load 381(i32v) + 389:162(i64vec2) SConvert 388 + 390:167(i64vec2) Bitcast 389 + Store 387(u64v) 390 + 391: 154(ivec2) Load 380(u32v) + 392:167(i64vec2) UConvert 391 + 393:162(i64vec2) Bitcast 392 + Store 384(i64v) 393 + 394: 154(ivec2) Load 380(u32v) + 395:167(i64vec2) UConvert 394 + Store 387(u64v) 395 + 397: 148(ivec2) Load 381(i32v) + 398: 187(fvec2) ConvertSToF 397 + Store 396(f32v) 398 + 400: 148(ivec2) Load 381(i32v) + 401:193(f64vec2) ConvertSToF 400 + Store 399(f64v) 401 + 402: 154(ivec2) Load 380(u32v) + 403: 187(fvec2) ConvertUToF 402 + Store 396(f32v) 403 + 404: 154(ivec2) Load 380(u32v) + 405:193(f64vec2) ConvertUToF 404 + Store 399(f64v) 405 + 407: 148(ivec2) Load 381(i32v) + 408: 134(i8vec2) SConvert 407 + Store 406(i8v) 408 + 409: 154(ivec2) Load 380(u32v) + 410: 131(i8vec2) UConvert 409 + 411: 134(i8vec2) Bitcast 410 + Store 406(i8v) 411 + 413: 148(ivec2) Load 381(i32v) + 414:139(i16vec2) SConvert 413 + Store 412(i16v) 414 + 415: 154(ivec2) Load 380(u32v) + 416:145(i16vec2) UConvert 415 + 417:139(i16vec2) Bitcast 416 + Store 412(i16v) 417 + 418: 148(ivec2) Load 381(i32v) + 419: 29(int) CompositeExtract 418 0 + 420: 29(int) CompositeExtract 418 1 + 421: 148(ivec2) CompositeConstruct 419 420 + Store 381(i32v) 421 + 422: 154(ivec2) Load 380(u32v) + 423: 148(ivec2) Bitcast 422 + Store 381(i32v) 423 + 424: 148(ivec2) Load 381(i32v) + 425:162(i64vec2) SConvert 424 + Store 384(i64v) 425 + 426: 154(ivec2) Load 380(u32v) + 427:167(i64vec2) UConvert 426 + 428:162(i64vec2) Bitcast 427 + Store 384(i64v) 428 + 430: 148(ivec2) Load 381(i32v) + 431: 134(i8vec2) SConvert 430 + 432: 131(i8vec2) Bitcast 431 + Store 429(u8v) 432 + 433: 154(ivec2) Load 380(u32v) + 434: 131(i8vec2) UConvert 433 + Store 429(u8v) 434 + 436: 148(ivec2) Load 381(i32v) + 437:139(i16vec2) SConvert 436 + 438:145(i16vec2) Bitcast 437 + Store 435(u16v) 438 + 439: 154(ivec2) Load 380(u32v) + 440:145(i16vec2) UConvert 439 + Store 435(u16v) 440 + 441: 148(ivec2) Load 381(i32v) + 442: 154(ivec2) Bitcast 441 + Store 380(u32v) 442 + 443: 154(ivec2) Load 380(u32v) + 444: 19(int) CompositeExtract 443 0 + 445: 19(int) CompositeExtract 443 1 + 446: 154(ivec2) CompositeConstruct 444 445 + Store 380(u32v) 446 + 447: 148(ivec2) Load 381(i32v) + 448:162(i64vec2) SConvert 447 + 449:167(i64vec2) Bitcast 448 + Store 387(u64v) 449 + 450: 154(ivec2) Load 380(u32v) + 451:167(i64vec2) UConvert 450 + Store 387(u64v) 451 + 453: 148(ivec2) Load 381(i32v) + 454:181(f16vec2) ConvertSToF 453 + Store 452(f16v) 454 + 455: 148(ivec2) Load 381(i32v) + 456: 187(fvec2) ConvertSToF 455 + Store 396(f32v) 456 + 457: 148(ivec2) Load 381(i32v) + 458:193(f64vec2) ConvertSToF 457 + Store 399(f64v) 458 + 459: 154(ivec2) Load 380(u32v) + 460:181(f16vec2) ConvertUToF 459 + Store 452(f16v) 460 + 461: 154(ivec2) Load 380(u32v) + 462: 187(fvec2) ConvertUToF 461 + Store 396(f32v) 462 + 463: 154(ivec2) Load 380(u32v) + 464:193(f64vec2) ConvertUToF 463 + Store 399(f64v) 464 + 466: 250(bvec2) Load 465(bv) + 470: 148(ivec2) Select 466 469 468 + Store 381(i32v) 470 + 471: 250(bvec2) Load 465(bv) + 476: 154(ivec2) Select 471 475 474 + Store 380(u32v) 476 + 477: 148(ivec2) Load 381(i32v) + 478: 250(bvec2) INotEqual 477 474 + Store 465(bv) 478 + 479: 154(ivec2) Load 380(u32v) + 480: 250(bvec2) INotEqual 479 474 + Store 465(bv) 480 + Return + FunctionEnd + 14(typeCast64(): 2 Function None 3 + 15: Label + 481(u64v): 168(ptr) Variable Function + 482(i64v): 163(ptr) Variable Function + 485(f64v): 194(ptr) Variable Function + 490(i8v): 135(ptr) Variable Function + 496(i16v): 140(ptr) Variable Function + 502(i32v): 149(ptr) Variable Function + 510(u8v): 132(ptr) Variable Function + 516(u16v): 221(ptr) Variable Function + 522(u32v): 157(ptr) Variable Function + 534(f16v): 182(ptr) Variable Function + 537(f32v): 188(ptr) Variable Function + 548(bv): 251(ptr) Variable Function + 483:162(i64vec2) Load 482(i64v) + 484:167(i64vec2) Bitcast 483 + Store 481(u64v) 484 + 486:162(i64vec2) Load 482(i64v) + 487:193(f64vec2) ConvertSToF 486 + Store 485(f64v) 487 + 488:167(i64vec2) Load 481(u64v) + 489:193(f64vec2) ConvertUToF 488 + Store 485(f64v) 489 + 491:162(i64vec2) Load 482(i64v) + 492: 134(i8vec2) SConvert 491 + Store 490(i8v) 492 + 493:167(i64vec2) Load 481(u64v) + 494: 131(i8vec2) UConvert 493 + 495: 134(i8vec2) Bitcast 494 + Store 490(i8v) 495 + 497:162(i64vec2) Load 482(i64v) + 498:139(i16vec2) SConvert 497 + Store 496(i16v) 498 + 499:167(i64vec2) Load 481(u64v) + 500:145(i16vec2) UConvert 499 + 501:139(i16vec2) Bitcast 500 + Store 496(i16v) 501 + 503:162(i64vec2) Load 482(i64v) + 504: 148(ivec2) SConvert 503 + Store 502(i32v) 504 + 505:167(i64vec2) Load 481(u64v) + 506: 154(ivec2) UConvert 505 + 507: 148(ivec2) Bitcast 506 + Store 502(i32v) 507 + 508:167(i64vec2) Load 481(u64v) + 509:162(i64vec2) Bitcast 508 + Store 482(i64v) 509 + 511:162(i64vec2) Load 482(i64v) + 512: 134(i8vec2) SConvert 511 + 513: 131(i8vec2) Bitcast 512 + Store 510(u8v) 513 + 514:167(i64vec2) Load 481(u64v) + 515: 131(i8vec2) UConvert 514 + Store 510(u8v) 515 + 517:162(i64vec2) Load 482(i64v) + 518:139(i16vec2) SConvert 517 + 519:145(i16vec2) Bitcast 518 + Store 516(u16v) 519 + 520:167(i64vec2) Load 481(u64v) + 521:145(i16vec2) UConvert 520 + Store 516(u16v) 521 + 523:162(i64vec2) Load 482(i64v) + 524: 148(ivec2) SConvert 523 + 525: 154(ivec2) Bitcast 524 + Store 522(u32v) 525 + 526:167(i64vec2) Load 481(u64v) + 527: 154(ivec2) UConvert 526 + Store 522(u32v) 527 + 528:162(i64vec2) Load 482(i64v) + 529:167(i64vec2) Bitcast 528 + Store 481(u64v) 529 + 530:167(i64vec2) Load 481(u64v) + 531: 38(int64_t) CompositeExtract 530 0 + 532: 38(int64_t) CompositeExtract 530 1 + 533:167(i64vec2) CompositeConstruct 531 532 + Store 481(u64v) 533 + 535:162(i64vec2) Load 482(i64v) + 536:181(f16vec2) ConvertSToF 535 + Store 534(f16v) 536 + 538:162(i64vec2) Load 482(i64v) + 539: 187(fvec2) ConvertSToF 538 + Store 537(f32v) 539 + 540:162(i64vec2) Load 482(i64v) + 541:193(f64vec2) ConvertSToF 540 + Store 485(f64v) 541 + 542:167(i64vec2) Load 481(u64v) + 543:181(f16vec2) ConvertUToF 542 + Store 534(f16v) 543 + 544:167(i64vec2) Load 481(u64v) + 545: 187(fvec2) ConvertUToF 544 + Store 537(f32v) 545 + 546:167(i64vec2) Load 481(u64v) + 547:193(f64vec2) ConvertUToF 546 + Store 485(f64v) 547 + 549: 250(bvec2) Load 548(bv) + 554:162(i64vec2) Select 549 553 552 + Store 482(i64v) 554 + 555: 250(bvec2) Load 548(bv) + 560:167(i64vec2) Select 555 559 558 + Store 481(u64v) 560 + 561:162(i64vec2) Load 482(i64v) + 562: 250(bvec2) INotEqual 561 558 + Store 548(bv) 562 + 563:167(i64vec2) Load 481(u64v) + 564: 250(bvec2) INotEqual 563 558 + Store 548(bv) 564 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.extPostDepthCoverage.frag.out b/deps/glslang/Test/baseResults/spv.extPostDepthCoverage.frag.out new file mode 100644 index 00000000..85a23593 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.extPostDepthCoverage.frag.out @@ -0,0 +1,23 @@ +spv.extPostDepthCoverage.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 6 + + Capability Shader + Capability SampleMaskPostDepthCoverage + Extension "SPV_KHR_post_depth_coverage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 EarlyFragmentTests + ExecutionMode 4 PostDepthCoverage + Source ESSL 310 + SourceExtension "GL_EXT_post_depth_coverage" + Name 4 "main" + 2: TypeVoid + 3: TypeFunction 2 + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.extPostDepthCoverage_Error.frag.out b/deps/glslang/Test/baseResults/spv.extPostDepthCoverage_Error.frag.out new file mode 100644 index 00000000..9ce299f4 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.extPostDepthCoverage_Error.frag.out @@ -0,0 +1,4 @@ +spv.extPostDepthCoverage_Error.frag +ERROR: Linking fragment stage: post_depth_coverage requires early_fragment_tests + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.float16.frag.out b/deps/glslang/Test/baseResults/spv.float16.frag.out new file mode 100644 index 00000000..37c66390 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.float16.frag.out @@ -0,0 +1,845 @@ +spv.float16.frag +error: SPIRV-Tools Validation Errors +error: Capability Float16 is not allowed by Vulkan 1.0 specification (or requires extension) + OpCapability Float16 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 534 + + Capability Shader + Capability Float16 + Capability Float64 + Capability Int64 + Capability DerivativeControl + Capability InterpolationFunction + Capability StorageUniformBufferBlock16 + Capability StorageUniform16 + Capability StorageInputOutput16 + Extension "SPV_AMD_gpu_shader_half_float" + Extension "SPV_KHR_16bit_storage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 465 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_AMD_gpu_shader_half_float" + SourceExtension "GL_ARB_gpu_shader_int64" + Name 4 "main" + Name 6 "literal(" + Name 8 "operators(" + Name 10 "typeCast(" + Name 12 "builtinAngleTrigFuncs(" + Name 14 "builtinExpFuncs(" + Name 16 "builtinCommonFuncs(" + Name 18 "builtinPackUnpackFuncs(" + Name 20 "builtinGeometryFuncs(" + Name 22 "builtinMatrixFuncs(" + Name 24 "builtinVecRelFuncs(" + Name 26 "builtinFragProcFuncs(" + Name 31 "f16v" + Name 42 "f16v" + Name 64 "f16m" + Name 87 "f16" + Name 111 "b" + Name 153 "f16v" + Name 156 "bv" + Name 167 "fv" + Name 175 "dv" + Name 186 "iv" + Name 193 "uv" + Name 201 "i64v" + Name 209 "u64v" + Name 216 "f16v2" + Name 217 "f16v1" + Name 249 "f16v2" + Name 250 "f16v1" + Name 266 "f16v2" + Name 267 "f16v1" + Name 288 "f16" + Name 292 "f16v3" + Name 332 "bv" + Name 353 "b" + Name 363 "iv" + Name 364 "ResType" + Name 372 "u" + Name 373 "f16v" + Name 378 "f16" + Name 379 "f16v1" + Name 383 "f16v2" + Name 389 "f16v3" + Name 408 "f16m3" + Name 409 "f16m1" + Name 411 "f16m2" + Name 420 "f16v1" + Name 422 "f16v2" + Name 427 "f16m4" + Name 430 "f16" + Name 433 "f16m5" + Name 438 "f16m6" + Name 439 "f16m7" + Name 442 "bv" + Name 443 "f16v1" + Name 445 "f16v2" + Name 463 "f16v" + Name 465 "if16v" + Name 514 "S" + MemberName 514(S) 0 "x" + MemberName 514(S) 1 "y" + MemberName 514(S) 2 "z" + Name 516 "B1" + MemberName 516(B1) 0 "a" + MemberName 516(B1) 1 "b" + MemberName 516(B1) 2 "c" + MemberName 516(B1) 3 "d" + MemberName 516(B1) 4 "e" + MemberName 516(B1) 5 "f" + MemberName 516(B1) 6 "g" + MemberName 516(B1) 7 "h" + Name 518 "" + Name 521 "S" + MemberName 521(S) 0 "x" + MemberName 521(S) 1 "y" + MemberName 521(S) 2 "z" + Name 523 "B2" + MemberName 523(B2) 0 "o" + MemberName 523(B2) 1 "p" + MemberName 523(B2) 2 "q" + MemberName 523(B2) 3 "r" + MemberName 523(B2) 4 "s" + MemberName 523(B2) 5 "t" + MemberName 523(B2) 6 "u" + MemberName 523(B2) 7 "v" + Name 525 "" + Name 526 "sf16" + Name 527 "sf" + Name 528 "sd" + Name 529 "f16_to_f" + Name 531 "f16_to_d" + Name 532 "f_to_f16" + Name 533 "d_to_f16" + Decorate 512 ArrayStride 16 + Decorate 513 ArrayStride 32 + MemberDecorate 514(S) 0 Offset 0 + MemberDecorate 514(S) 1 Offset 4 + MemberDecorate 514(S) 2 Offset 8 + Decorate 515 ArrayStride 16 + MemberDecorate 516(B1) 0 Offset 0 + MemberDecorate 516(B1) 1 Offset 4 + MemberDecorate 516(B1) 2 Offset 8 + MemberDecorate 516(B1) 3 Offset 16 + MemberDecorate 516(B1) 4 ColMajor + MemberDecorate 516(B1) 4 Offset 48 + MemberDecorate 516(B1) 4 MatrixStride 16 + MemberDecorate 516(B1) 5 ColMajor + MemberDecorate 516(B1) 5 Offset 80 + MemberDecorate 516(B1) 5 MatrixStride 16 + MemberDecorate 516(B1) 6 Offset 144 + MemberDecorate 516(B1) 7 Offset 160 + Decorate 516(B1) Block + Decorate 518 DescriptorSet 0 + Decorate 519 ArrayStride 2 + Decorate 520 ArrayStride 12 + MemberDecorate 521(S) 0 Offset 0 + MemberDecorate 521(S) 1 Offset 4 + MemberDecorate 521(S) 2 Offset 8 + Decorate 522 ArrayStride 16 + MemberDecorate 523(B2) 0 Offset 0 + MemberDecorate 523(B2) 1 Offset 4 + MemberDecorate 523(B2) 2 Offset 8 + MemberDecorate 523(B2) 3 Offset 14 + MemberDecorate 523(B2) 4 RowMajor + MemberDecorate 523(B2) 4 Offset 20 + MemberDecorate 523(B2) 4 MatrixStride 4 + MemberDecorate 523(B2) 5 RowMajor + MemberDecorate 523(B2) 5 Offset 32 + MemberDecorate 523(B2) 5 MatrixStride 4 + MemberDecorate 523(B2) 6 Offset 56 + MemberDecorate 523(B2) 7 Offset 72 + Decorate 523(B2) BufferBlock + Decorate 525 DescriptorSet 0 + Decorate 526(sf16) SpecId 100 + Decorate 527(sf) SpecId 101 + Decorate 528(sd) SpecId 102 + 2: TypeVoid + 3: TypeFunction 2 + 28: TypeFloat 16 + 29: TypeVector 28(float16_t) 2 + 30: TypePointer Function 29(f16vec2) + 32:28(float16_t) Constant 16 + 33: TypeInt 32 0 + 34: 33(int) Constant 0 + 35: TypePointer Function 28(float16_t) + 37:28(float16_t) Constant 46080 + 38:28(float16_t) Constant 10158 + 39: 29(f16vec2) ConstantComposite 37 38 + 56:28(float16_t) Constant 15360 + 62: TypeMatrix 29(f16vec2) 2 + 63: TypePointer Function 62 + 90: 33(int) Constant 1 + 109: TypeBool + 110: TypePointer Function 109(bool) + 151: TypeVector 28(float16_t) 3 + 152: TypePointer Function 151(f16vec3) + 154: TypeVector 109(bool) 3 + 155: TypePointer Function 154(bvec3) + 158:28(float16_t) Constant 0 + 159:151(f16vec3) ConstantComposite 158 158 158 + 160:151(f16vec3) ConstantComposite 56 56 56 + 164: TypeFloat 32 + 165: TypeVector 164(float) 3 + 166: TypePointer Function 165(fvec3) + 172: TypeFloat 64 + 173: TypeVector 172(float64_t) 3 + 174: TypePointer Function 173(f64vec3) + 183: TypeInt 32 1 + 184: TypeVector 183(int) 3 + 185: TypePointer Function 184(ivec3) + 191: TypeVector 33(int) 3 + 192: TypePointer Function 191(ivec3) + 198: TypeInt 64 1 + 199: TypeVector 198(int64_t) 3 + 200: TypePointer Function 199(i64vec3) + 206: TypeInt 64 0 + 207: TypeVector 206(int64_t) 3 + 208: TypePointer Function 207(i64vec3) + 214: TypeVector 28(float16_t) 4 + 215: TypePointer Function 214(f16vec4) + 364(ResType): TypeStruct 151(f16vec3) 184(ivec3) + 371: TypePointer Function 33(int) + 406: TypeMatrix 151(f16vec3) 2 + 407: TypePointer Function 406 + 425: TypeMatrix 29(f16vec2) 3 + 426: TypePointer Function 425 + 431: TypeMatrix 151(f16vec3) 3 + 432: TypePointer Function 431 + 436: TypeMatrix 214(f16vec4) 4 + 437: TypePointer Function 436 + 464: TypePointer Input 151(f16vec3) + 465(if16v): 464(ptr) Variable Input + 466: TypePointer Input 28(float16_t) + 503: 183(int) Constant 1 + 508:28(float16_t) Constant 14336 + 509: 29(f16vec2) ConstantComposite 508 508 + 511: 33(int) Constant 2 + 512: TypeArray 28(float16_t) 511 + 513: TypeArray 406 511 + 514(S): TypeStruct 28(float16_t) 29(f16vec2) 151(f16vec3) + 515: TypeArray 514(S) 511 + 516(B1): TypeStruct 28(float16_t) 29(f16vec2) 151(f16vec3) 512 406 513 514(S) 515 + 517: TypePointer Uniform 516(B1) + 518: 517(ptr) Variable Uniform + 519: TypeArray 28(float16_t) 511 + 520: TypeArray 406 511 + 521(S): TypeStruct 28(float16_t) 29(f16vec2) 151(f16vec3) + 522: TypeArray 521(S) 511 + 523(B2): TypeStruct 28(float16_t) 29(f16vec2) 151(f16vec3) 519 406 520 521(S) 522 + 524: TypePointer Uniform 523(B2) + 525: 524(ptr) Variable Uniform + 526(sf16):28(float16_t) SpecConstant 12288 + 527(sf): 164(float) SpecConstant 1048576000 + 528(sd):172(float64_t) SpecConstant 0 1071644672 + 529(f16_to_f): 164(float) SpecConstantOp 115 526(sf16) + 530: 164(float) SpecConstantOp 115 526(sf16) + 531(f16_to_d):172(float64_t) SpecConstantOp 115 530 + 532(f_to_f16):28(float16_t) SpecConstantOp 115 527(sf) + 533(d_to_f16):28(float16_t) SpecConstantOp 115 528(sd) + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd + 6(literal(): 2 Function None 3 + 7: Label + 31(f16v): 30(ptr) Variable Function + 36: 35(ptr) AccessChain 31(f16v) 34 + Store 36 32 + 40: 29(f16vec2) Load 31(f16v) + 41: 29(f16vec2) FAdd 40 39 + Store 31(f16v) 41 + Return + FunctionEnd + 8(operators(): 2 Function None 3 + 9: Label + 42(f16v): 30(ptr) Variable Function + 64(f16m): 63(ptr) Variable Function + 87(f16): 35(ptr) Variable Function + 111(b): 110(ptr) Variable Function + 43: 29(f16vec2) Load 42(f16v) + 44: 29(f16vec2) Load 42(f16v) + 45: 29(f16vec2) FAdd 44 43 + Store 42(f16v) 45 + 46: 29(f16vec2) Load 42(f16v) + 47: 29(f16vec2) Load 42(f16v) + 48: 29(f16vec2) FSub 47 46 + Store 42(f16v) 48 + 49: 29(f16vec2) Load 42(f16v) + 50: 29(f16vec2) Load 42(f16v) + 51: 29(f16vec2) FMul 50 49 + Store 42(f16v) 51 + 52: 29(f16vec2) Load 42(f16v) + 53: 29(f16vec2) Load 42(f16v) + 54: 29(f16vec2) FDiv 53 52 + Store 42(f16v) 54 + 55: 29(f16vec2) Load 42(f16v) + 57: 29(f16vec2) CompositeConstruct 56 56 + 58: 29(f16vec2) FAdd 55 57 + Store 42(f16v) 58 + 59: 29(f16vec2) Load 42(f16v) + 60: 29(f16vec2) CompositeConstruct 56 56 + 61: 29(f16vec2) FSub 59 60 + Store 42(f16v) 61 + 65: 62 Load 64(f16m) + 66: 29(f16vec2) CompositeConstruct 56 56 + 67: 29(f16vec2) CompositeExtract 65 0 + 68: 29(f16vec2) FAdd 67 66 + 69: 29(f16vec2) CompositeExtract 65 1 + 70: 29(f16vec2) FAdd 69 66 + 71: 62 CompositeConstruct 68 70 + Store 64(f16m) 71 + 72: 62 Load 64(f16m) + 73: 29(f16vec2) CompositeConstruct 56 56 + 74: 29(f16vec2) CompositeExtract 72 0 + 75: 29(f16vec2) FSub 74 73 + 76: 29(f16vec2) CompositeExtract 72 1 + 77: 29(f16vec2) FSub 76 73 + 78: 62 CompositeConstruct 75 77 + Store 64(f16m) 78 + 79: 29(f16vec2) Load 42(f16v) + 80: 29(f16vec2) FNegate 79 + Store 42(f16v) 80 + 81: 62 Load 64(f16m) + 82: 29(f16vec2) CompositeExtract 81 0 + 83: 29(f16vec2) FNegate 82 + 84: 29(f16vec2) CompositeExtract 81 1 + 85: 29(f16vec2) FNegate 84 + 86: 62 CompositeConstruct 83 85 + Store 64(f16m) 86 + 88: 35(ptr) AccessChain 42(f16v) 34 + 89:28(float16_t) Load 88 + 91: 35(ptr) AccessChain 42(f16v) 90 + 92:28(float16_t) Load 91 + 93:28(float16_t) FAdd 89 92 + Store 87(f16) 93 + 94: 35(ptr) AccessChain 42(f16v) 34 + 95:28(float16_t) Load 94 + 96: 35(ptr) AccessChain 42(f16v) 90 + 97:28(float16_t) Load 96 + 98:28(float16_t) FSub 95 97 + Store 87(f16) 98 + 99: 35(ptr) AccessChain 42(f16v) 34 + 100:28(float16_t) Load 99 + 101: 35(ptr) AccessChain 42(f16v) 90 + 102:28(float16_t) Load 101 + 103:28(float16_t) FMul 100 102 + Store 87(f16) 103 + 104: 35(ptr) AccessChain 42(f16v) 34 + 105:28(float16_t) Load 104 + 106: 35(ptr) AccessChain 42(f16v) 90 + 107:28(float16_t) Load 106 + 108:28(float16_t) FDiv 105 107 + Store 87(f16) 108 + 112: 35(ptr) AccessChain 42(f16v) 34 + 113:28(float16_t) Load 112 + 114:28(float16_t) Load 87(f16) + 115: 109(bool) FOrdNotEqual 113 114 + Store 111(b) 115 + 116: 35(ptr) AccessChain 42(f16v) 90 + 117:28(float16_t) Load 116 + 118:28(float16_t) Load 87(f16) + 119: 109(bool) FOrdEqual 117 118 + Store 111(b) 119 + 120: 35(ptr) AccessChain 42(f16v) 34 + 121:28(float16_t) Load 120 + 122:28(float16_t) Load 87(f16) + 123: 109(bool) FOrdGreaterThan 121 122 + Store 111(b) 123 + 124: 35(ptr) AccessChain 42(f16v) 90 + 125:28(float16_t) Load 124 + 126:28(float16_t) Load 87(f16) + 127: 109(bool) FOrdLessThan 125 126 + Store 111(b) 127 + 128: 35(ptr) AccessChain 42(f16v) 34 + 129:28(float16_t) Load 128 + 130:28(float16_t) Load 87(f16) + 131: 109(bool) FOrdGreaterThanEqual 129 130 + Store 111(b) 131 + 132: 35(ptr) AccessChain 42(f16v) 90 + 133:28(float16_t) Load 132 + 134:28(float16_t) Load 87(f16) + 135: 109(bool) FOrdLessThanEqual 133 134 + Store 111(b) 135 + 136: 29(f16vec2) Load 42(f16v) + 137:28(float16_t) Load 87(f16) + 138: 29(f16vec2) VectorTimesScalar 136 137 + Store 42(f16v) 138 + 139: 62 Load 64(f16m) + 140:28(float16_t) Load 87(f16) + 141: 62 MatrixTimesScalar 139 140 + Store 64(f16m) 141 + 142: 62 Load 64(f16m) + 143: 29(f16vec2) Load 42(f16v) + 144: 29(f16vec2) MatrixTimesVector 142 143 + Store 42(f16v) 144 + 145: 29(f16vec2) Load 42(f16v) + 146: 62 Load 64(f16m) + 147: 29(f16vec2) VectorTimesMatrix 145 146 + Store 42(f16v) 147 + 148: 62 Load 64(f16m) + 149: 62 Load 64(f16m) + 150: 62 MatrixTimesMatrix 148 149 + Store 64(f16m) 150 + Return + FunctionEnd + 10(typeCast(): 2 Function None 3 + 11: Label + 153(f16v): 152(ptr) Variable Function + 156(bv): 155(ptr) Variable Function + 167(fv): 166(ptr) Variable Function + 175(dv): 174(ptr) Variable Function + 186(iv): 185(ptr) Variable Function + 193(uv): 192(ptr) Variable Function + 201(i64v): 200(ptr) Variable Function + 209(u64v): 208(ptr) Variable Function + 157: 154(bvec3) Load 156(bv) + 161:151(f16vec3) Select 157 160 159 + Store 153(f16v) 161 + 162:151(f16vec3) Load 153(f16v) + 163: 154(bvec3) FOrdNotEqual 162 159 + Store 156(bv) 163 + 168: 165(fvec3) Load 167(fv) + 169:151(f16vec3) FConvert 168 + Store 153(f16v) 169 + 170:151(f16vec3) Load 153(f16v) + 171: 165(fvec3) FConvert 170 + Store 167(fv) 171 + 176:173(f64vec3) Load 175(dv) + 177:151(f16vec3) FConvert 176 + Store 153(f16v) 177 + 178:173(f64vec3) Load 175(dv) + 179:172(float64_t) CompositeExtract 178 0 + 180:172(float64_t) CompositeExtract 178 1 + 181:172(float64_t) CompositeExtract 178 2 + 182:173(f64vec3) CompositeConstruct 179 180 181 + Store 175(dv) 182 + 187: 184(ivec3) Load 186(iv) + 188:151(f16vec3) ConvertSToF 187 + Store 153(f16v) 188 + 189:151(f16vec3) Load 153(f16v) + 190: 184(ivec3) ConvertFToS 189 + Store 186(iv) 190 + 194: 191(ivec3) Load 193(uv) + 195:151(f16vec3) ConvertUToF 194 + Store 153(f16v) 195 + 196:151(f16vec3) Load 153(f16v) + 197: 191(ivec3) ConvertFToU 196 + Store 193(uv) 197 + 202:199(i64vec3) Load 201(i64v) + 203:151(f16vec3) ConvertSToF 202 + Store 153(f16v) 203 + 204:151(f16vec3) Load 153(f16v) + 205:199(i64vec3) ConvertFToS 204 + Store 201(i64v) 205 + 210:207(i64vec3) Load 209(u64v) + 211:151(f16vec3) ConvertUToF 210 + Store 153(f16v) 211 + 212:151(f16vec3) Load 153(f16v) + 213:207(i64vec3) ConvertFToU 212 + Store 209(u64v) 213 + Return + FunctionEnd +12(builtinAngleTrigFuncs(): 2 Function None 3 + 13: Label + 216(f16v2): 215(ptr) Variable Function + 217(f16v1): 215(ptr) Variable Function + 218:214(f16vec4) Load 217(f16v1) + 219:214(f16vec4) ExtInst 1(GLSL.std.450) 11(Radians) 218 + Store 216(f16v2) 219 + 220:214(f16vec4) Load 217(f16v1) + 221:214(f16vec4) ExtInst 1(GLSL.std.450) 12(Degrees) 220 + Store 216(f16v2) 221 + 222:214(f16vec4) Load 217(f16v1) + 223:214(f16vec4) ExtInst 1(GLSL.std.450) 13(Sin) 222 + Store 216(f16v2) 223 + 224:214(f16vec4) Load 217(f16v1) + 225:214(f16vec4) ExtInst 1(GLSL.std.450) 14(Cos) 224 + Store 216(f16v2) 225 + 226:214(f16vec4) Load 217(f16v1) + 227:214(f16vec4) ExtInst 1(GLSL.std.450) 15(Tan) 226 + Store 216(f16v2) 227 + 228:214(f16vec4) Load 217(f16v1) + 229:214(f16vec4) ExtInst 1(GLSL.std.450) 16(Asin) 228 + Store 216(f16v2) 229 + 230:214(f16vec4) Load 217(f16v1) + 231:214(f16vec4) ExtInst 1(GLSL.std.450) 17(Acos) 230 + Store 216(f16v2) 231 + 232:214(f16vec4) Load 217(f16v1) + 233:214(f16vec4) Load 216(f16v2) + 234:214(f16vec4) ExtInst 1(GLSL.std.450) 25(Atan2) 232 233 + Store 216(f16v2) 234 + 235:214(f16vec4) Load 217(f16v1) + 236:214(f16vec4) ExtInst 1(GLSL.std.450) 18(Atan) 235 + Store 216(f16v2) 236 + 237:214(f16vec4) Load 217(f16v1) + 238:214(f16vec4) ExtInst 1(GLSL.std.450) 19(Sinh) 237 + Store 216(f16v2) 238 + 239:214(f16vec4) Load 217(f16v1) + 240:214(f16vec4) ExtInst 1(GLSL.std.450) 20(Cosh) 239 + Store 216(f16v2) 240 + 241:214(f16vec4) Load 217(f16v1) + 242:214(f16vec4) ExtInst 1(GLSL.std.450) 21(Tanh) 241 + Store 216(f16v2) 242 + 243:214(f16vec4) Load 217(f16v1) + 244:214(f16vec4) ExtInst 1(GLSL.std.450) 22(Asinh) 243 + Store 216(f16v2) 244 + 245:214(f16vec4) Load 217(f16v1) + 246:214(f16vec4) ExtInst 1(GLSL.std.450) 23(Acosh) 245 + Store 216(f16v2) 246 + 247:214(f16vec4) Load 217(f16v1) + 248:214(f16vec4) ExtInst 1(GLSL.std.450) 24(Atanh) 247 + Store 216(f16v2) 248 + Return + FunctionEnd +14(builtinExpFuncs(): 2 Function None 3 + 15: Label + 249(f16v2): 30(ptr) Variable Function + 250(f16v1): 30(ptr) Variable Function + 251: 29(f16vec2) Load 250(f16v1) + 252: 29(f16vec2) Load 249(f16v2) + 253: 29(f16vec2) ExtInst 1(GLSL.std.450) 26(Pow) 251 252 + Store 249(f16v2) 253 + 254: 29(f16vec2) Load 250(f16v1) + 255: 29(f16vec2) ExtInst 1(GLSL.std.450) 27(Exp) 254 + Store 249(f16v2) 255 + 256: 29(f16vec2) Load 250(f16v1) + 257: 29(f16vec2) ExtInst 1(GLSL.std.450) 28(Log) 256 + Store 249(f16v2) 257 + 258: 29(f16vec2) Load 250(f16v1) + 259: 29(f16vec2) ExtInst 1(GLSL.std.450) 29(Exp2) 258 + Store 249(f16v2) 259 + 260: 29(f16vec2) Load 250(f16v1) + 261: 29(f16vec2) ExtInst 1(GLSL.std.450) 30(Log2) 260 + Store 249(f16v2) 261 + 262: 29(f16vec2) Load 250(f16v1) + 263: 29(f16vec2) ExtInst 1(GLSL.std.450) 31(Sqrt) 262 + Store 249(f16v2) 263 + 264: 29(f16vec2) Load 250(f16v1) + 265: 29(f16vec2) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 264 + Store 249(f16v2) 265 + Return + FunctionEnd +16(builtinCommonFuncs(): 2 Function None 3 + 17: Label + 266(f16v2): 152(ptr) Variable Function + 267(f16v1): 152(ptr) Variable Function + 288(f16): 35(ptr) Variable Function + 292(f16v3): 152(ptr) Variable Function + 332(bv): 155(ptr) Variable Function + 353(b): 110(ptr) Variable Function + 363(iv): 185(ptr) Variable Function + 268:151(f16vec3) Load 267(f16v1) + 269:151(f16vec3) ExtInst 1(GLSL.std.450) 4(FAbs) 268 + Store 266(f16v2) 269 + 270:151(f16vec3) Load 267(f16v1) + 271:151(f16vec3) ExtInst 1(GLSL.std.450) 6(FSign) 270 + Store 266(f16v2) 271 + 272:151(f16vec3) Load 267(f16v1) + 273:151(f16vec3) ExtInst 1(GLSL.std.450) 8(Floor) 272 + Store 266(f16v2) 273 + 274:151(f16vec3) Load 267(f16v1) + 275:151(f16vec3) ExtInst 1(GLSL.std.450) 3(Trunc) 274 + Store 266(f16v2) 275 + 276:151(f16vec3) Load 267(f16v1) + 277:151(f16vec3) ExtInst 1(GLSL.std.450) 1(Round) 276 + Store 266(f16v2) 277 + 278:151(f16vec3) Load 267(f16v1) + 279:151(f16vec3) ExtInst 1(GLSL.std.450) 2(RoundEven) 278 + Store 266(f16v2) 279 + 280:151(f16vec3) Load 267(f16v1) + 281:151(f16vec3) ExtInst 1(GLSL.std.450) 9(Ceil) 280 + Store 266(f16v2) 281 + 282:151(f16vec3) Load 267(f16v1) + 283:151(f16vec3) ExtInst 1(GLSL.std.450) 10(Fract) 282 + Store 266(f16v2) 283 + 284:151(f16vec3) Load 267(f16v1) + 285:151(f16vec3) Load 266(f16v2) + 286:151(f16vec3) FMod 284 285 + Store 266(f16v2) 286 + 287:151(f16vec3) Load 267(f16v1) + 289:28(float16_t) Load 288(f16) + 290:151(f16vec3) CompositeConstruct 289 289 289 + 291:151(f16vec3) FMod 287 290 + Store 266(f16v2) 291 + 293:151(f16vec3) Load 267(f16v1) + 294:151(f16vec3) ExtInst 1(GLSL.std.450) 35(Modf) 293 266(f16v2) + Store 292(f16v3) 294 + 295:151(f16vec3) Load 267(f16v1) + 296:151(f16vec3) Load 266(f16v2) + 297:151(f16vec3) ExtInst 1(GLSL.std.450) 37(FMin) 295 296 + Store 292(f16v3) 297 + 298:151(f16vec3) Load 267(f16v1) + 299:28(float16_t) Load 288(f16) + 300:151(f16vec3) CompositeConstruct 299 299 299 + 301:151(f16vec3) ExtInst 1(GLSL.std.450) 37(FMin) 298 300 + Store 292(f16v3) 301 + 302:151(f16vec3) Load 267(f16v1) + 303:151(f16vec3) Load 266(f16v2) + 304:151(f16vec3) ExtInst 1(GLSL.std.450) 40(FMax) 302 303 + Store 292(f16v3) 304 + 305:151(f16vec3) Load 267(f16v1) + 306:28(float16_t) Load 288(f16) + 307:151(f16vec3) CompositeConstruct 306 306 306 + 308:151(f16vec3) ExtInst 1(GLSL.std.450) 40(FMax) 305 307 + Store 292(f16v3) 308 + 309:151(f16vec3) Load 267(f16v1) + 310:28(float16_t) Load 288(f16) + 311: 35(ptr) AccessChain 266(f16v2) 34 + 312:28(float16_t) Load 311 + 313:151(f16vec3) CompositeConstruct 310 310 310 + 314:151(f16vec3) CompositeConstruct 312 312 312 + 315:151(f16vec3) ExtInst 1(GLSL.std.450) 43(FClamp) 309 313 314 + Store 292(f16v3) 315 + 316:151(f16vec3) Load 267(f16v1) + 317:151(f16vec3) Load 266(f16v2) + 318:28(float16_t) Load 288(f16) + 319:151(f16vec3) CompositeConstruct 318 318 318 + 320:151(f16vec3) ExtInst 1(GLSL.std.450) 43(FClamp) 316 317 319 + Store 292(f16v3) 320 + 321:151(f16vec3) Load 267(f16v1) + 322:151(f16vec3) Load 266(f16v2) + 323:28(float16_t) Load 288(f16) + 324:151(f16vec3) CompositeConstruct 323 323 323 + 325:151(f16vec3) ExtInst 1(GLSL.std.450) 46(FMix) 321 322 324 + Store 292(f16v3) 325 + 326:151(f16vec3) Load 267(f16v1) + 327:151(f16vec3) Load 266(f16v2) + 328:151(f16vec3) Load 292(f16v3) + 329:151(f16vec3) ExtInst 1(GLSL.std.450) 46(FMix) 326 327 328 + Store 292(f16v3) 329 + 330:151(f16vec3) Load 267(f16v1) + 331:151(f16vec3) Load 266(f16v2) + 333: 154(bvec3) Load 332(bv) + 334:151(f16vec3) Select 333 331 330 + Store 292(f16v3) 334 + 335:151(f16vec3) Load 267(f16v1) + 336:151(f16vec3) Load 266(f16v2) + 337:151(f16vec3) ExtInst 1(GLSL.std.450) 48(Step) 335 336 + Store 292(f16v3) 337 + 338:28(float16_t) Load 288(f16) + 339:151(f16vec3) Load 292(f16v3) + 340:151(f16vec3) CompositeConstruct 338 338 338 + 341:151(f16vec3) ExtInst 1(GLSL.std.450) 48(Step) 340 339 + Store 292(f16v3) 341 + 342:151(f16vec3) Load 267(f16v1) + 343:151(f16vec3) Load 266(f16v2) + 344:151(f16vec3) Load 292(f16v3) + 345:151(f16vec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 342 343 344 + Store 292(f16v3) 345 + 346:28(float16_t) Load 288(f16) + 347: 35(ptr) AccessChain 267(f16v1) 34 + 348:28(float16_t) Load 347 + 349:151(f16vec3) Load 266(f16v2) + 350:151(f16vec3) CompositeConstruct 346 346 346 + 351:151(f16vec3) CompositeConstruct 348 348 348 + 352:151(f16vec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 350 351 349 + Store 292(f16v3) 352 + 354:28(float16_t) Load 288(f16) + 355: 109(bool) IsNan 354 + Store 353(b) 355 + 356:151(f16vec3) Load 267(f16v1) + 357: 154(bvec3) IsInf 356 + Store 332(bv) 357 + 358:151(f16vec3) Load 267(f16v1) + 359:151(f16vec3) Load 266(f16v2) + 360:151(f16vec3) Load 292(f16v3) + 361:151(f16vec3) ExtInst 1(GLSL.std.450) 50(Fma) 358 359 360 + Store 292(f16v3) 361 + 362:151(f16vec3) Load 267(f16v1) + 365:364(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 362 + 366: 184(ivec3) CompositeExtract 365 1 + Store 363(iv) 366 + 367:151(f16vec3) CompositeExtract 365 0 + Store 266(f16v2) 367 + 368:151(f16vec3) Load 267(f16v1) + 369: 184(ivec3) Load 363(iv) + 370:151(f16vec3) ExtInst 1(GLSL.std.450) 53(Ldexp) 368 369 + Store 266(f16v2) 370 + Return + FunctionEnd +18(builtinPackUnpackFuncs(): 2 Function None 3 + 19: Label + 372(u): 371(ptr) Variable Function + 373(f16v): 30(ptr) Variable Function + 374: 29(f16vec2) Load 373(f16v) + 375: 33(int) Bitcast 374 + Store 372(u) 375 + 376: 33(int) Load 372(u) + 377: 29(f16vec2) Bitcast 376 + Store 373(f16v) 377 + Return + FunctionEnd +20(builtinGeometryFuncs(): 2 Function None 3 + 21: Label + 378(f16): 35(ptr) Variable Function + 379(f16v1): 152(ptr) Variable Function + 383(f16v2): 152(ptr) Variable Function + 389(f16v3): 152(ptr) Variable Function + 380:151(f16vec3) Load 379(f16v1) + 381:28(float16_t) ExtInst 1(GLSL.std.450) 66(Length) 380 + Store 378(f16) 381 + 382:151(f16vec3) Load 379(f16v1) + 384:151(f16vec3) Load 383(f16v2) + 385:28(float16_t) ExtInst 1(GLSL.std.450) 67(Distance) 382 384 + Store 378(f16) 385 + 386:151(f16vec3) Load 379(f16v1) + 387:151(f16vec3) Load 383(f16v2) + 388:28(float16_t) Dot 386 387 + Store 378(f16) 388 + 390:151(f16vec3) Load 379(f16v1) + 391:151(f16vec3) Load 383(f16v2) + 392:151(f16vec3) ExtInst 1(GLSL.std.450) 68(Cross) 390 391 + Store 389(f16v3) 392 + 393:151(f16vec3) Load 379(f16v1) + 394:151(f16vec3) ExtInst 1(GLSL.std.450) 69(Normalize) 393 + Store 383(f16v2) 394 + 395:151(f16vec3) Load 379(f16v1) + 396:151(f16vec3) Load 383(f16v2) + 397:151(f16vec3) Load 389(f16v3) + 398:151(f16vec3) ExtInst 1(GLSL.std.450) 70(FaceForward) 395 396 397 + Store 389(f16v3) 398 + 399:151(f16vec3) Load 379(f16v1) + 400:151(f16vec3) Load 383(f16v2) + 401:151(f16vec3) ExtInst 1(GLSL.std.450) 71(Reflect) 399 400 + Store 389(f16v3) 401 + 402:151(f16vec3) Load 379(f16v1) + 403:151(f16vec3) Load 383(f16v2) + 404:28(float16_t) Load 378(f16) + 405:151(f16vec3) ExtInst 1(GLSL.std.450) 72(Refract) 402 403 404 + Store 389(f16v3) 405 + Return + FunctionEnd +22(builtinMatrixFuncs(): 2 Function None 3 + 23: Label + 408(f16m3): 407(ptr) Variable Function + 409(f16m1): 407(ptr) Variable Function + 411(f16m2): 407(ptr) Variable Function + 420(f16v1): 152(ptr) Variable Function + 422(f16v2): 30(ptr) Variable Function + 427(f16m4): 426(ptr) Variable Function + 430(f16): 35(ptr) Variable Function + 433(f16m5): 432(ptr) Variable Function + 438(f16m6): 437(ptr) Variable Function + 439(f16m7): 437(ptr) Variable Function + 410: 406 Load 409(f16m1) + 412: 406 Load 411(f16m2) + 413:151(f16vec3) CompositeExtract 410 0 + 414:151(f16vec3) CompositeExtract 412 0 + 415:151(f16vec3) FMul 413 414 + 416:151(f16vec3) CompositeExtract 410 1 + 417:151(f16vec3) CompositeExtract 412 1 + 418:151(f16vec3) FMul 416 417 + 419: 406 CompositeConstruct 415 418 + Store 408(f16m3) 419 + 421:151(f16vec3) Load 420(f16v1) + 423: 29(f16vec2) Load 422(f16v2) + 424: 406 OuterProduct 421 423 + Store 409(f16m1) 424 + 428: 406 Load 409(f16m1) + 429: 425 Transpose 428 + Store 427(f16m4) 429 + 434: 431 Load 433(f16m5) + 435:28(float16_t) ExtInst 1(GLSL.std.450) 33(Determinant) 434 + Store 430(f16) 435 + 440: 436 Load 439(f16m7) + 441: 436 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 440 + Store 438(f16m6) 441 + Return + FunctionEnd +24(builtinVecRelFuncs(): 2 Function None 3 + 25: Label + 442(bv): 155(ptr) Variable Function + 443(f16v1): 152(ptr) Variable Function + 445(f16v2): 152(ptr) Variable Function + 444:151(f16vec3) Load 443(f16v1) + 446:151(f16vec3) Load 445(f16v2) + 447: 154(bvec3) FOrdLessThan 444 446 + Store 442(bv) 447 + 448:151(f16vec3) Load 443(f16v1) + 449:151(f16vec3) Load 445(f16v2) + 450: 154(bvec3) FOrdLessThanEqual 448 449 + Store 442(bv) 450 + 451:151(f16vec3) Load 443(f16v1) + 452:151(f16vec3) Load 445(f16v2) + 453: 154(bvec3) FOrdGreaterThan 451 452 + Store 442(bv) 453 + 454:151(f16vec3) Load 443(f16v1) + 455:151(f16vec3) Load 445(f16v2) + 456: 154(bvec3) FOrdGreaterThanEqual 454 455 + Store 442(bv) 456 + 457:151(f16vec3) Load 443(f16v1) + 458:151(f16vec3) Load 445(f16v2) + 459: 154(bvec3) FOrdEqual 457 458 + Store 442(bv) 459 + 460:151(f16vec3) Load 443(f16v1) + 461:151(f16vec3) Load 445(f16v2) + 462: 154(bvec3) FOrdNotEqual 460 461 + Store 442(bv) 462 + Return + FunctionEnd +26(builtinFragProcFuncs(): 2 Function None 3 + 27: Label + 463(f16v): 152(ptr) Variable Function + 467: 466(ptr) AccessChain 465(if16v) 34 + 468:28(float16_t) Load 467 + 469:28(float16_t) DPdx 468 + 470: 35(ptr) AccessChain 463(f16v) 34 + Store 470 469 + 471: 466(ptr) AccessChain 465(if16v) 90 + 472:28(float16_t) Load 471 + 473:28(float16_t) DPdy 472 + 474: 35(ptr) AccessChain 463(f16v) 90 + Store 474 473 + 475:151(f16vec3) Load 465(if16v) + 476: 29(f16vec2) VectorShuffle 475 475 0 1 + 477: 29(f16vec2) DPdxFine 476 + 478:151(f16vec3) Load 463(f16v) + 479:151(f16vec3) VectorShuffle 478 477 3 4 2 + Store 463(f16v) 479 + 480:151(f16vec3) Load 465(if16v) + 481: 29(f16vec2) VectorShuffle 480 480 0 1 + 482: 29(f16vec2) DPdyFine 481 + 483:151(f16vec3) Load 463(f16v) + 484:151(f16vec3) VectorShuffle 483 482 3 4 2 + Store 463(f16v) 484 + 485:151(f16vec3) Load 465(if16v) + 486:151(f16vec3) DPdxCoarse 485 + Store 463(f16v) 486 + 487:151(f16vec3) Load 465(if16v) + 488:151(f16vec3) DPdxCoarse 487 + Store 463(f16v) 488 + 489: 466(ptr) AccessChain 465(if16v) 34 + 490:28(float16_t) Load 489 + 491:28(float16_t) Fwidth 490 + 492: 35(ptr) AccessChain 463(f16v) 34 + Store 492 491 + 493:151(f16vec3) Load 465(if16v) + 494: 29(f16vec2) VectorShuffle 493 493 0 1 + 495: 29(f16vec2) FwidthFine 494 + 496:151(f16vec3) Load 463(f16v) + 497:151(f16vec3) VectorShuffle 496 495 3 4 2 + Store 463(f16v) 497 + 498:151(f16vec3) Load 465(if16v) + 499:151(f16vec3) FwidthCoarse 498 + Store 463(f16v) 499 + 500: 466(ptr) AccessChain 465(if16v) 34 + 501:28(float16_t) ExtInst 1(GLSL.std.450) 76(InterpolateAtCentroid) 500 + 502: 35(ptr) AccessChain 463(f16v) 34 + Store 502 501 + 504:151(f16vec3) ExtInst 1(GLSL.std.450) 77(InterpolateAtSample) 465(if16v) 503 + 505: 29(f16vec2) VectorShuffle 504 504 0 1 + 506:151(f16vec3) Load 463(f16v) + 507:151(f16vec3) VectorShuffle 506 505 3 4 2 + Store 463(f16v) 507 + 510:151(f16vec3) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 465(if16v) 509 + Store 463(f16v) 510 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.float16Fetch.frag.out b/deps/glslang/Test/baseResults/spv.float16Fetch.frag.out new file mode 100644 index 00000000..7632737a --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.float16Fetch.frag.out @@ -0,0 +1,7074 @@ +spv.float16Fetch.frag +error: SPIRV-Tools Validation Errors +error: Capability Float16 is not allowed by Vulkan 1.0 specification (or requires extension) + OpCapability Float16 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 5923 + + Capability Shader + Capability Float16 + Capability ImageGatherExtended + Capability StorageImageMultisample + Capability ImageCubeArray + Capability ImageRect + Capability SampledRect + Capability InputAttachment + Capability SparseResidency + Capability MinLod + Capability Sampled1D + Capability Image1D + Capability SampledCubeArray + Capability SampledBuffer + Capability ImageBuffer + Capability ImageMSArray + Capability ImageQuery + Capability StorageInputOutput16 + Capability Float16ImageAMD + Capability ImageGatherBiasLodAMD + Extension "SPV_AMD_gpu_shader_half_float_fetch" + Extension "SPV_AMD_texture_gather_bias_lod" + Extension "SPV_KHR_16bit_storage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 128 135 137 148 156 169 177 215 251 309 565 572 1393 1401 1409 1417 1425 1433 4257 4264 5913 5922 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_AMD_gpu_shader_half_float" + SourceExtension "GL_AMD_gpu_shader_half_float_fetch" + SourceExtension "GL_AMD_texture_gather_bias_lod" + SourceExtension "GL_ARB_sparse_texture2" + SourceExtension "GL_ARB_sparse_texture_clamp" + Name 4 "main" + Name 9 "testTexture(" + Name 11 "testTextureProj(" + Name 13 "testTextureLod(" + Name 15 "testTextureOffset(" + Name 17 "testTextureProjOffset(" + Name 19 "testTextureLodOffset(" + Name 21 "testTextureProjLodOffset(" + Name 23 "testTexelFetch(" + Name 25 "testTexelFetchOffset(" + Name 27 "testTextureGrad(" + Name 29 "testTextureGradOffset(" + Name 31 "testTextureProjGrad(" + Name 33 "testTextureProjGradoffset(" + Name 35 "testTextureGather(" + Name 37 "testTextureGatherOffset(" + Name 39 "testTextureGatherOffsets(" + Name 41 "testTextureGatherLod(" + Name 43 "testTextureGatherLodOffset(" + Name 45 "testTextureGatherLodOffsets(" + Name 50 "testTextureSize(" + Name 55 "testTextureQueryLod(" + Name 58 "testTextureQueryLevels(" + Name 60 "testTextureSamples(" + Name 62 "testImageLoad(" + Name 67 "testImageStore(vf164;" + Name 66 "data" + Name 69 "testSparseTexture(" + Name 71 "testSparseTextureLod(" + Name 73 "testSparseTextureOffset(" + Name 75 "testSparseTextureLodOffset(" + Name 77 "testSparseTextureGrad(" + Name 79 "testSparseTextureGradOffset(" + Name 81 "testSparseTexelFetch(" + Name 83 "testSparseTexelFetchOffset(" + Name 85 "testSparseTextureGather(" + Name 87 "testSparseTextureGatherOffset(" + Name 89 "testSparseTextureGatherOffsets(" + Name 91 "testSparseTextureGatherLod(" + Name 93 "testSparseTextureGatherLodOffset(" + Name 95 "testSparseTextureGatherLodOffsets(" + Name 97 "testSparseImageLoad(" + Name 99 "testSparseTextureClamp(" + Name 101 "testTextureClamp(" + Name 103 "testSparseTextureOffsetClamp(" + Name 105 "testTextureOffsetClamp(" + Name 107 "testSparseTextureGradClamp(" + Name 109 "testTextureGradClamp(" + Name 111 "testSparseTextureGradOffsetClamp(" + Name 113 "testTextureGradOffsetClamp(" + Name 115 "testCombinedTextureSampler(" + Name 117 "testSubpassLoad(" + Name 119 "texel" + Name 125 "s1D" + Name 128 "c1" + Name 135 "f16c1" + Name 137 "f16bias" + Name 145 "s2D" + Name 148 "c2" + Name 156 "f16c2" + Name 165 "s3D" + Name 169 "c3" + Name 177 "f16c3" + Name 186 "sCube" + Name 201 "s1DShadow" + Name 215 "compare" + Name 226 "s2DShadow" + Name 247 "sCubeShadow" + Name 251 "c4" + Name 271 "s1DArray" + Name 286 "s2DArray" + Name 301 "sCubeArray" + Name 309 "f16c4" + Name 318 "s1DArrayShadow" + Name 339 "s2DArrayShadow" + Name 359 "s2DRect" + Name 373 "s2DRectShadow" + Name 393 "sCubeArrayShadow" + Name 413 "texel" + Name 562 "texel" + Name 565 "lod" + Name 572 "f16lod" + Name 706 "texel" + Name 863 "texel" + Name 1012 "texel" + Name 1130 "texel" + Name 1244 "texel" + Name 1300 "sBuffer" + Name 1311 "s2DMS" + Name 1322 "s2DMSArray" + Name 1334 "texel" + Name 1390 "texel" + Name 1393 "dPdxy1" + Name 1401 "f16dPdxy1" + Name 1409 "dPdxy2" + Name 1417 "f16dPdxy2" + Name 1425 "dPdxy3" + Name 1433 "f16dPdxy3" + Name 1632 "texel" + Name 1820 "texel" + Name 2002 "texel" + Name 2184 "texel" + Name 2303 "texel" + Name 2375 "texel" + Name 2450 "texel" + Name 2502 "texel" + Name 2530 "texel" + Name 2559 "size" + Name 2733 "lod" + Name 2869 "levels" + Name 2938 "samples" + Name 2952 "texel" + Name 2955 "i1D" + Name 2964 "i2D" + Name 2973 "i3D" + Name 2982 "i2DRect" + Name 2991 "iCube" + Name 3000 "iBuffer" + Name 3009 "i1DArray" + Name 3018 "i2DArray" + Name 3027 "iCubeArray" + Name 3036 "i2DMS" + Name 3045 "i2DMSArray" + Name 3099 "texel" + Name 3102 "ResType" + Name 3138 "ResType" + Name 3242 "texel" + Name 3322 "texel" + Name 3412 "texel" + Name 3468 "texel" + Name 3628 "texel" + Name 3742 "texel" + Name 3794 "texel" + Name 3832 "texel" + Name 3950 "texel" + Name 4022 "texel" + Name 4094 "texel" + Name 4146 "texel" + Name 4174 "texel" + Name 4202 "texel" + Name 4254 "texel" + Name 4257 "lodClamp" + Name 4264 "f16lodClamp" + Name 4391 "texel" + Name 4598 "texel" + Name 4674 "texel" + Name 4818 "texel" + Name 4962 "texel" + Name 5188 "texel" + Name 5280 "texel" + Name 5452 "texel" + Name 5454 "t1D" + Name 5458 "s" + Name 5474 "t2D" + Name 5491 "t3D" + Name 5508 "tCube" + Name 5525 "sShadow" + Name 5589 "t1DArray" + Name 5606 "t2DArray" + Name 5623 "tCubeArray" + Name 5681 "t2DRect" + Name 5741 "subpass" + Name 5747 "subpassMS" + Name 5753 "result" + Name 5834 "param" + Name 5913 "fragColor" + Name 5917 "tBuffer" + Name 5919 "t2DMS" + Name 5921 "t2DMSArray" + Name 5922 "bias" + Decorate 125(s1D) DescriptorSet 0 + Decorate 125(s1D) Binding 0 + Decorate 128(c1) Location 0 + Decorate 135(f16c1) Location 11 + Decorate 137(f16bias) Location 16 + Decorate 145(s2D) DescriptorSet 0 + Decorate 145(s2D) Binding 1 + Decorate 148(c2) Location 1 + Decorate 156(f16c2) Location 12 + Decorate 165(s3D) DescriptorSet 0 + Decorate 165(s3D) Binding 2 + Decorate 169(c3) Location 2 + Decorate 177(f16c3) Location 13 + Decorate 186(sCube) DescriptorSet 0 + Decorate 186(sCube) Binding 4 + Decorate 201(s1DShadow) DescriptorSet 0 + Decorate 201(s1DShadow) Binding 11 + Decorate 215(compare) Location 4 + Decorate 226(s2DShadow) DescriptorSet 0 + Decorate 226(s2DShadow) Binding 12 + Decorate 247(sCubeShadow) DescriptorSet 0 + Decorate 247(sCubeShadow) Binding 14 + Decorate 251(c4) Location 3 + Decorate 271(s1DArray) DescriptorSet 0 + Decorate 271(s1DArray) Binding 7 + Decorate 286(s2DArray) DescriptorSet 0 + Decorate 286(s2DArray) Binding 8 + Decorate 301(sCubeArray) DescriptorSet 0 + Decorate 301(sCubeArray) Binding 9 + Decorate 309(f16c4) Location 14 + Decorate 318(s1DArrayShadow) DescriptorSet 0 + Decorate 318(s1DArrayShadow) Binding 15 + Decorate 339(s2DArrayShadow) DescriptorSet 0 + Decorate 339(s2DArrayShadow) Binding 16 + Decorate 359(s2DRect) DescriptorSet 0 + Decorate 359(s2DRect) Binding 3 + Decorate 373(s2DRectShadow) DescriptorSet 0 + Decorate 373(s2DRectShadow) Binding 13 + Decorate 393(sCubeArrayShadow) DescriptorSet 0 + Decorate 393(sCubeArrayShadow) Binding 17 + Decorate 565(lod) Location 5 + Decorate 572(f16lod) Location 15 + Decorate 1300(sBuffer) DescriptorSet 0 + Decorate 1300(sBuffer) Binding 5 + Decorate 1311(s2DMS) DescriptorSet 0 + Decorate 1311(s2DMS) Binding 6 + Decorate 1322(s2DMSArray) DescriptorSet 0 + Decorate 1322(s2DMSArray) Binding 10 + Decorate 1393(dPdxy1) Location 8 + Decorate 1401(f16dPdxy1) Location 18 + Decorate 1409(dPdxy2) Location 9 + Decorate 1417(f16dPdxy2) Location 19 + Decorate 1425(dPdxy3) Location 10 + Decorate 1433(f16dPdxy3) Location 20 + Decorate 2955(i1D) DescriptorSet 1 + Decorate 2955(i1D) Binding 0 + Decorate 2964(i2D) DescriptorSet 1 + Decorate 2964(i2D) Binding 1 + Decorate 2973(i3D) DescriptorSet 1 + Decorate 2973(i3D) Binding 2 + Decorate 2982(i2DRect) DescriptorSet 1 + Decorate 2982(i2DRect) Binding 3 + Decorate 2991(iCube) DescriptorSet 1 + Decorate 2991(iCube) Binding 4 + Decorate 3000(iBuffer) DescriptorSet 1 + Decorate 3000(iBuffer) Binding 8 + Decorate 3009(i1DArray) DescriptorSet 1 + Decorate 3009(i1DArray) Binding 5 + Decorate 3018(i2DArray) DescriptorSet 1 + Decorate 3018(i2DArray) Binding 6 + Decorate 3027(iCubeArray) DescriptorSet 1 + Decorate 3027(iCubeArray) Binding 7 + Decorate 3036(i2DMS) DescriptorSet 1 + Decorate 3036(i2DMS) Binding 9 + Decorate 3045(i2DMSArray) DescriptorSet 1 + Decorate 3045(i2DMSArray) Binding 10 + Decorate 4257(lodClamp) Location 7 + Decorate 4264(f16lodClamp) Location 17 + Decorate 5454(t1D) DescriptorSet 2 + Decorate 5454(t1D) Binding 0 + Decorate 5458(s) DescriptorSet 2 + Decorate 5458(s) Binding 11 + Decorate 5474(t2D) DescriptorSet 2 + Decorate 5474(t2D) Binding 1 + Decorate 5491(t3D) DescriptorSet 2 + Decorate 5491(t3D) Binding 2 + Decorate 5508(tCube) DescriptorSet 2 + Decorate 5508(tCube) Binding 4 + Decorate 5525(sShadow) DescriptorSet 2 + Decorate 5525(sShadow) Binding 12 + Decorate 5589(t1DArray) DescriptorSet 2 + Decorate 5589(t1DArray) Binding 5 + Decorate 5606(t2DArray) DescriptorSet 2 + Decorate 5606(t2DArray) Binding 6 + Decorate 5623(tCubeArray) DescriptorSet 2 + Decorate 5623(tCubeArray) Binding 7 + Decorate 5681(t2DRect) DescriptorSet 2 + Decorate 5681(t2DRect) Binding 3 + Decorate 5741(subpass) DescriptorSet 3 + Decorate 5741(subpass) Binding 0 + Decorate 5741(subpass) InputAttachmentIndex 0 + Decorate 5747(subpassMS) DescriptorSet 3 + Decorate 5747(subpassMS) Binding 1 + Decorate 5747(subpassMS) InputAttachmentIndex 0 + Decorate 5913(fragColor) Location 0 + Decorate 5917(tBuffer) DescriptorSet 2 + Decorate 5917(tBuffer) Binding 8 + Decorate 5919(t2DMS) DescriptorSet 2 + Decorate 5919(t2DMS) Binding 9 + Decorate 5921(t2DMSArray) DescriptorSet 2 + Decorate 5921(t2DMSArray) Binding 10 + Decorate 5922(bias) Location 6 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 16 + 7: TypeVector 6(float16_t) 4 + 8: TypeFunction 7(f16vec4) + 47: TypeInt 32 1 + 48: TypeVector 47(int) 4 + 49: TypeFunction 48(ivec4) + 52: TypeFloat 32 + 53: TypeVector 52(float) 2 + 54: TypeFunction 53(fvec2) + 57: TypeFunction 47(int) + 64: TypePointer Function 7(f16vec4) + 65: TypeFunction 2 64(ptr) + 120:6(float16_t) Constant 0 + 121: 7(f16vec4) ConstantComposite 120 120 120 120 + 122: TypeImage 6(float16_t) 1D sampled format:Unknown + 123: TypeSampledImage 122 + 124: TypePointer UniformConstant 123 + 125(s1D): 124(ptr) Variable UniformConstant + 127: TypePointer Input 52(float) + 128(c1): 127(ptr) Variable Input + 134: TypePointer Input 6(float16_t) + 135(f16c1): 134(ptr) Variable Input + 137(f16bias): 134(ptr) Variable Input + 142: TypeImage 6(float16_t) 2D sampled format:Unknown + 143: TypeSampledImage 142 + 144: TypePointer UniformConstant 143 + 145(s2D): 144(ptr) Variable UniformConstant + 147: TypePointer Input 53(fvec2) + 148(c2): 147(ptr) Variable Input + 154: TypeVector 6(float16_t) 2 + 155: TypePointer Input 154(f16vec2) + 156(f16c2): 155(ptr) Variable Input + 162: TypeImage 6(float16_t) 3D sampled format:Unknown + 163: TypeSampledImage 162 + 164: TypePointer UniformConstant 163 + 165(s3D): 164(ptr) Variable UniformConstant + 167: TypeVector 52(float) 3 + 168: TypePointer Input 167(fvec3) + 169(c3): 168(ptr) Variable Input + 175: TypeVector 6(float16_t) 3 + 176: TypePointer Input 175(f16vec3) + 177(f16c3): 176(ptr) Variable Input + 183: TypeImage 6(float16_t) Cube sampled format:Unknown + 184: TypeSampledImage 183 + 185: TypePointer UniformConstant 184 + 186(sCube): 185(ptr) Variable UniformConstant + 198: TypeImage 6(float16_t) 1D depth sampled format:Unknown + 199: TypeSampledImage 198 + 200: TypePointer UniformConstant 199 + 201(s1DShadow): 200(ptr) Variable UniformConstant + 206: TypeInt 32 0 + 207: 206(int) Constant 0 + 208: TypePointer Function 6(float16_t) + 215(compare): 127(ptr) Variable Input + 223: TypeImage 6(float16_t) 2D depth sampled format:Unknown + 224: TypeSampledImage 223 + 225: TypePointer UniformConstant 224 + 226(s2DShadow): 225(ptr) Variable UniformConstant + 244: TypeImage 6(float16_t) Cube depth sampled format:Unknown + 245: TypeSampledImage 244 + 246: TypePointer UniformConstant 245 +247(sCubeShadow): 246(ptr) Variable UniformConstant + 249: TypeVector 52(float) 4 + 250: TypePointer Input 249(fvec4) + 251(c4): 250(ptr) Variable Input + 268: TypeImage 6(float16_t) 1D array sampled format:Unknown + 269: TypeSampledImage 268 + 270: TypePointer UniformConstant 269 + 271(s1DArray): 270(ptr) Variable UniformConstant + 283: TypeImage 6(float16_t) 2D array sampled format:Unknown + 284: TypeSampledImage 283 + 285: TypePointer UniformConstant 284 + 286(s2DArray): 285(ptr) Variable UniformConstant + 298: TypeImage 6(float16_t) Cube array sampled format:Unknown + 299: TypeSampledImage 298 + 300: TypePointer UniformConstant 299 + 301(sCubeArray): 300(ptr) Variable UniformConstant + 308: TypePointer Input 7(f16vec4) + 309(f16c4): 308(ptr) Variable Input + 315: TypeImage 6(float16_t) 1D depth array sampled format:Unknown + 316: TypeSampledImage 315 + 317: TypePointer UniformConstant 316 +318(s1DArrayShadow): 317(ptr) Variable UniformConstant + 336: TypeImage 6(float16_t) 2D depth array sampled format:Unknown + 337: TypeSampledImage 336 + 338: TypePointer UniformConstant 337 +339(s2DArrayShadow): 338(ptr) Variable UniformConstant + 356: TypeImage 6(float16_t) Rect sampled format:Unknown + 357: TypeSampledImage 356 + 358: TypePointer UniformConstant 357 + 359(s2DRect): 358(ptr) Variable UniformConstant + 370: TypeImage 6(float16_t) Rect depth sampled format:Unknown + 371: TypeSampledImage 370 + 372: TypePointer UniformConstant 371 +373(s2DRectShadow): 372(ptr) Variable UniformConstant + 390: TypeImage 6(float16_t) Cube depth array sampled format:Unknown + 391: TypeSampledImage 390 + 392: TypePointer UniformConstant 391 +393(sCubeArrayShadow): 392(ptr) Variable UniformConstant + 565(lod): 127(ptr) Variable Input + 572(f16lod): 134(ptr) Variable Input + 709: 47(int) Constant 1 + 721: TypeVector 47(int) 2 + 722: 721(ivec2) ConstantComposite 709 709 + 734: TypeVector 47(int) 3 + 735: 734(ivec3) ConstantComposite 709 709 709 + 1297: TypeImage 6(float16_t) Buffer sampled format:Unknown + 1298: TypeSampledImage 1297 + 1299: TypePointer UniformConstant 1298 + 1300(sBuffer): 1299(ptr) Variable UniformConstant + 1308: TypeImage 6(float16_t) 2D multi-sampled sampled format:Unknown + 1309: TypeSampledImage 1308 + 1310: TypePointer UniformConstant 1309 + 1311(s2DMS): 1310(ptr) Variable UniformConstant + 1319: TypeImage 6(float16_t) 2D array multi-sampled sampled format:Unknown + 1320: TypeSampledImage 1319 + 1321: TypePointer UniformConstant 1320 +1322(s2DMSArray): 1321(ptr) Variable UniformConstant + 1326: 47(int) Constant 2 + 1393(dPdxy1): 127(ptr) Variable Input + 1401(f16dPdxy1): 134(ptr) Variable Input + 1409(dPdxy2): 147(ptr) Variable Input + 1417(f16dPdxy2): 155(ptr) Variable Input + 1425(dPdxy3): 168(ptr) Variable Input + 1433(f16dPdxy3): 176(ptr) Variable Input + 2187: 47(int) Constant 0 + 2378: 206(int) Constant 4 + 2379: TypeArray 721(ivec2) 2378 + 2380: 2379 ConstantComposite 722 722 722 722 + 2558: TypePointer Function 48(ivec4) + 2560: 48(ivec4) ConstantComposite 2187 2187 2187 2187 + 2566: TypePointer Function 47(int) + 2732: TypePointer Function 53(fvec2) + 2734: 52(float) Constant 0 + 2735: 53(fvec2) ConstantComposite 2734 2734 + 2953: TypeImage 6(float16_t) 1D nonsampled format:Rgba16f + 2954: TypePointer UniformConstant 2953 + 2955(i1D): 2954(ptr) Variable UniformConstant + 2962: TypeImage 6(float16_t) 2D nonsampled format:Rgba16f + 2963: TypePointer UniformConstant 2962 + 2964(i2D): 2963(ptr) Variable UniformConstant + 2971: TypeImage 6(float16_t) 3D nonsampled format:Rgba16f + 2972: TypePointer UniformConstant 2971 + 2973(i3D): 2972(ptr) Variable UniformConstant + 2980: TypeImage 6(float16_t) Rect nonsampled format:Rgba16f + 2981: TypePointer UniformConstant 2980 + 2982(i2DRect): 2981(ptr) Variable UniformConstant + 2989: TypeImage 6(float16_t) Cube nonsampled format:Rgba16f + 2990: TypePointer UniformConstant 2989 + 2991(iCube): 2990(ptr) Variable UniformConstant + 2998: TypeImage 6(float16_t) Buffer nonsampled format:Rgba16f + 2999: TypePointer UniformConstant 2998 + 3000(iBuffer): 2999(ptr) Variable UniformConstant + 3007: TypeImage 6(float16_t) 1D array nonsampled format:Rgba16f + 3008: TypePointer UniformConstant 3007 + 3009(i1DArray): 3008(ptr) Variable UniformConstant + 3016: TypeImage 6(float16_t) 2D array nonsampled format:Rgba16f + 3017: TypePointer UniformConstant 3016 + 3018(i2DArray): 3017(ptr) Variable UniformConstant + 3025: TypeImage 6(float16_t) Cube array nonsampled format:Rgba16f + 3026: TypePointer UniformConstant 3025 +3027(iCubeArray): 3026(ptr) Variable UniformConstant + 3034: TypeImage 6(float16_t) 2D multi-sampled nonsampled format:Rgba16f + 3035: TypePointer UniformConstant 3034 + 3036(i2DMS): 3035(ptr) Variable UniformConstant + 3043: TypeImage 6(float16_t) 2D array multi-sampled nonsampled format:Rgba16f + 3044: TypePointer UniformConstant 3043 +3045(i2DMSArray): 3044(ptr) Variable UniformConstant + 3102(ResType): TypeStruct 47(int) 7(f16vec4) + 3138(ResType): TypeStruct 47(int) 6(float16_t) + 4257(lodClamp): 127(ptr) Variable Input +4264(f16lodClamp): 134(ptr) Variable Input + 5453: TypePointer UniformConstant 122 + 5454(t1D): 5453(ptr) Variable UniformConstant + 5456: TypeSampler + 5457: TypePointer UniformConstant 5456 + 5458(s): 5457(ptr) Variable UniformConstant + 5473: TypePointer UniformConstant 142 + 5474(t2D): 5473(ptr) Variable UniformConstant + 5490: TypePointer UniformConstant 162 + 5491(t3D): 5490(ptr) Variable UniformConstant + 5507: TypePointer UniformConstant 183 + 5508(tCube): 5507(ptr) Variable UniformConstant + 5525(sShadow): 5457(ptr) Variable UniformConstant + 5588: TypePointer UniformConstant 268 + 5589(t1DArray): 5588(ptr) Variable UniformConstant + 5605: TypePointer UniformConstant 283 + 5606(t2DArray): 5605(ptr) Variable UniformConstant + 5622: TypePointer UniformConstant 298 +5623(tCubeArray): 5622(ptr) Variable UniformConstant + 5680: TypePointer UniformConstant 356 + 5681(t2DRect): 5680(ptr) Variable UniformConstant + 5739: TypeImage 6(float16_t) SubpassData nonsampled format:Unknown + 5740: TypePointer UniformConstant 5739 + 5741(subpass): 5740(ptr) Variable UniformConstant + 5743: 721(ivec2) ConstantComposite 2187 2187 + 5745: TypeImage 6(float16_t) SubpassData multi-sampled nonsampled format:Unknown + 5746: TypePointer UniformConstant 5745 + 5747(subpassMS): 5746(ptr) Variable UniformConstant + 5912: TypePointer Output 249(fvec4) + 5913(fragColor): 5912(ptr) Variable Output + 5916: TypePointer UniformConstant 1297 + 5917(tBuffer): 5916(ptr) Variable UniformConstant + 5918: TypePointer UniformConstant 1308 + 5919(t2DMS): 5918(ptr) Variable UniformConstant + 5920: TypePointer UniformConstant 1319 +5921(t2DMSArray): 5920(ptr) Variable UniformConstant + 5922(bias): 127(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 5753(result): 64(ptr) Variable Function + 5834(param): 64(ptr) Variable Function + Store 5753(result) 121 + 5754: 7(f16vec4) FunctionCall 9(testTexture() + 5755: 7(f16vec4) Load 5753(result) + 5756: 7(f16vec4) FAdd 5755 5754 + Store 5753(result) 5756 + 5757: 7(f16vec4) FunctionCall 11(testTextureProj() + 5758: 7(f16vec4) Load 5753(result) + 5759: 7(f16vec4) FAdd 5758 5757 + Store 5753(result) 5759 + 5760: 7(f16vec4) FunctionCall 13(testTextureLod() + 5761: 7(f16vec4) Load 5753(result) + 5762: 7(f16vec4) FAdd 5761 5760 + Store 5753(result) 5762 + 5763: 7(f16vec4) FunctionCall 15(testTextureOffset() + 5764: 7(f16vec4) Load 5753(result) + 5765: 7(f16vec4) FAdd 5764 5763 + Store 5753(result) 5765 + 5766: 7(f16vec4) FunctionCall 19(testTextureLodOffset() + 5767: 7(f16vec4) Load 5753(result) + 5768: 7(f16vec4) FAdd 5767 5766 + Store 5753(result) 5768 + 5769: 7(f16vec4) FunctionCall 21(testTextureProjLodOffset() + 5770: 7(f16vec4) Load 5753(result) + 5771: 7(f16vec4) FAdd 5770 5769 + Store 5753(result) 5771 + 5772: 7(f16vec4) FunctionCall 23(testTexelFetch() + 5773: 7(f16vec4) Load 5753(result) + 5774: 7(f16vec4) FAdd 5773 5772 + Store 5753(result) 5774 + 5775: 7(f16vec4) FunctionCall 25(testTexelFetchOffset() + 5776: 7(f16vec4) Load 5753(result) + 5777: 7(f16vec4) FAdd 5776 5775 + Store 5753(result) 5777 + 5778: 7(f16vec4) FunctionCall 27(testTextureGrad() + 5779: 7(f16vec4) Load 5753(result) + 5780: 7(f16vec4) FAdd 5779 5778 + Store 5753(result) 5780 + 5781: 7(f16vec4) FunctionCall 29(testTextureGradOffset() + 5782: 7(f16vec4) Load 5753(result) + 5783: 7(f16vec4) FAdd 5782 5781 + Store 5753(result) 5783 + 5784: 7(f16vec4) FunctionCall 31(testTextureProjGrad() + 5785: 7(f16vec4) Load 5753(result) + 5786: 7(f16vec4) FAdd 5785 5784 + Store 5753(result) 5786 + 5787: 7(f16vec4) FunctionCall 33(testTextureProjGradoffset() + 5788: 7(f16vec4) Load 5753(result) + 5789: 7(f16vec4) FAdd 5788 5787 + Store 5753(result) 5789 + 5790: 7(f16vec4) FunctionCall 35(testTextureGather() + 5791: 7(f16vec4) Load 5753(result) + 5792: 7(f16vec4) FAdd 5791 5790 + Store 5753(result) 5792 + 5793: 7(f16vec4) FunctionCall 37(testTextureGatherOffset() + 5794: 7(f16vec4) Load 5753(result) + 5795: 7(f16vec4) FAdd 5794 5793 + Store 5753(result) 5795 + 5796: 7(f16vec4) FunctionCall 39(testTextureGatherOffsets() + 5797: 7(f16vec4) Load 5753(result) + 5798: 7(f16vec4) FAdd 5797 5796 + Store 5753(result) 5798 + 5799: 7(f16vec4) FunctionCall 41(testTextureGatherLod() + 5800: 7(f16vec4) Load 5753(result) + 5801: 7(f16vec4) FAdd 5800 5799 + Store 5753(result) 5801 + 5802: 7(f16vec4) FunctionCall 43(testTextureGatherLodOffset() + 5803: 7(f16vec4) Load 5753(result) + 5804: 7(f16vec4) FAdd 5803 5802 + Store 5753(result) 5804 + 5805: 7(f16vec4) FunctionCall 45(testTextureGatherLodOffsets() + 5806: 7(f16vec4) Load 5753(result) + 5807: 7(f16vec4) FAdd 5806 5805 + Store 5753(result) 5807 + 5808: 48(ivec4) FunctionCall 50(testTextureSize() + 5809: 7(f16vec4) ConvertSToF 5808 + 5810: 7(f16vec4) Load 5753(result) + 5811: 7(f16vec4) FAdd 5810 5809 + Store 5753(result) 5811 + 5812: 53(fvec2) FunctionCall 55(testTextureQueryLod() + 5813:154(f16vec2) FConvert 5812 + 5814: 7(f16vec4) Load 5753(result) + 5815:154(f16vec2) VectorShuffle 5814 5814 0 1 + 5816:154(f16vec2) FAdd 5815 5813 + 5817: 7(f16vec4) Load 5753(result) + 5818: 7(f16vec4) VectorShuffle 5817 5816 4 5 2 3 + Store 5753(result) 5818 + 5819: 47(int) FunctionCall 58(testTextureQueryLevels() + 5820:6(float16_t) ConvertSToF 5819 + 5821: 208(ptr) AccessChain 5753(result) 207 + 5822:6(float16_t) Load 5821 + 5823:6(float16_t) FAdd 5822 5820 + 5824: 208(ptr) AccessChain 5753(result) 207 + Store 5824 5823 + 5825: 47(int) FunctionCall 60(testTextureSamples() + 5826:6(float16_t) ConvertSToF 5825 + 5827: 208(ptr) AccessChain 5753(result) 207 + 5828:6(float16_t) Load 5827 + 5829:6(float16_t) FAdd 5828 5826 + 5830: 208(ptr) AccessChain 5753(result) 207 + Store 5830 5829 + 5831: 7(f16vec4) FunctionCall 62(testImageLoad() + 5832: 7(f16vec4) Load 5753(result) + 5833: 7(f16vec4) FAdd 5832 5831 + Store 5753(result) 5833 + 5835: 7(f16vec4) Load 5753(result) + Store 5834(param) 5835 + 5836: 2 FunctionCall 67(testImageStore(vf164;) 5834(param) + 5837: 7(f16vec4) FunctionCall 69(testSparseTexture() + 5838: 7(f16vec4) Load 5753(result) + 5839: 7(f16vec4) FAdd 5838 5837 + Store 5753(result) 5839 + 5840: 7(f16vec4) FunctionCall 71(testSparseTextureLod() + 5841: 7(f16vec4) Load 5753(result) + 5842: 7(f16vec4) FAdd 5841 5840 + Store 5753(result) 5842 + 5843: 7(f16vec4) FunctionCall 73(testSparseTextureOffset() + 5844: 7(f16vec4) Load 5753(result) + 5845: 7(f16vec4) FAdd 5844 5843 + Store 5753(result) 5845 + 5846: 7(f16vec4) FunctionCall 75(testSparseTextureLodOffset() + 5847: 7(f16vec4) Load 5753(result) + 5848: 7(f16vec4) FAdd 5847 5846 + Store 5753(result) 5848 + 5849: 7(f16vec4) FunctionCall 77(testSparseTextureGrad() + 5850: 7(f16vec4) Load 5753(result) + 5851: 7(f16vec4) FAdd 5850 5849 + Store 5753(result) 5851 + 5852: 7(f16vec4) FunctionCall 79(testSparseTextureGradOffset() + 5853: 7(f16vec4) Load 5753(result) + 5854: 7(f16vec4) FAdd 5853 5852 + Store 5753(result) 5854 + 5855: 7(f16vec4) FunctionCall 81(testSparseTexelFetch() + 5856: 7(f16vec4) Load 5753(result) + 5857: 7(f16vec4) FAdd 5856 5855 + Store 5753(result) 5857 + 5858: 7(f16vec4) FunctionCall 83(testSparseTexelFetchOffset() + 5859: 7(f16vec4) Load 5753(result) + 5860: 7(f16vec4) FAdd 5859 5858 + Store 5753(result) 5860 + 5861: 7(f16vec4) FunctionCall 85(testSparseTextureGather() + 5862: 7(f16vec4) Load 5753(result) + 5863: 7(f16vec4) FAdd 5862 5861 + Store 5753(result) 5863 + 5864: 7(f16vec4) FunctionCall 87(testSparseTextureGatherOffset() + 5865: 7(f16vec4) Load 5753(result) + 5866: 7(f16vec4) FAdd 5865 5864 + Store 5753(result) 5866 + 5867: 7(f16vec4) FunctionCall 89(testSparseTextureGatherOffsets() + 5868: 7(f16vec4) Load 5753(result) + 5869: 7(f16vec4) FAdd 5868 5867 + Store 5753(result) 5869 + 5870: 7(f16vec4) FunctionCall 91(testSparseTextureGatherLod() + 5871: 7(f16vec4) Load 5753(result) + 5872: 7(f16vec4) FAdd 5871 5870 + Store 5753(result) 5872 + 5873: 7(f16vec4) FunctionCall 93(testSparseTextureGatherLodOffset() + 5874: 7(f16vec4) Load 5753(result) + 5875: 7(f16vec4) FAdd 5874 5873 + Store 5753(result) 5875 + 5876: 7(f16vec4) FunctionCall 95(testSparseTextureGatherLodOffsets() + 5877: 7(f16vec4) Load 5753(result) + 5878: 7(f16vec4) FAdd 5877 5876 + Store 5753(result) 5878 + 5879: 7(f16vec4) FunctionCall 97(testSparseImageLoad() + 5880: 7(f16vec4) Load 5753(result) + 5881: 7(f16vec4) FAdd 5880 5879 + Store 5753(result) 5881 + 5882: 7(f16vec4) FunctionCall 99(testSparseTextureClamp() + 5883: 7(f16vec4) Load 5753(result) + 5884: 7(f16vec4) FAdd 5883 5882 + Store 5753(result) 5884 + 5885: 7(f16vec4) FunctionCall 101(testTextureClamp() + 5886: 7(f16vec4) Load 5753(result) + 5887: 7(f16vec4) FAdd 5886 5885 + Store 5753(result) 5887 + 5888: 7(f16vec4) FunctionCall 103(testSparseTextureOffsetClamp() + 5889: 7(f16vec4) Load 5753(result) + 5890: 7(f16vec4) FAdd 5889 5888 + Store 5753(result) 5890 + 5891: 7(f16vec4) FunctionCall 105(testTextureOffsetClamp() + 5892: 7(f16vec4) Load 5753(result) + 5893: 7(f16vec4) FAdd 5892 5891 + Store 5753(result) 5893 + 5894: 7(f16vec4) FunctionCall 77(testSparseTextureGrad() + 5895: 7(f16vec4) Load 5753(result) + 5896: 7(f16vec4) FAdd 5895 5894 + Store 5753(result) 5896 + 5897: 7(f16vec4) FunctionCall 27(testTextureGrad() + 5898: 7(f16vec4) Load 5753(result) + 5899: 7(f16vec4) FAdd 5898 5897 + Store 5753(result) 5899 + 5900: 7(f16vec4) FunctionCall 111(testSparseTextureGradOffsetClamp() + 5901: 7(f16vec4) Load 5753(result) + 5902: 7(f16vec4) FAdd 5901 5900 + Store 5753(result) 5902 + 5903: 7(f16vec4) FunctionCall 113(testTextureGradOffsetClamp() + 5904: 7(f16vec4) Load 5753(result) + 5905: 7(f16vec4) FAdd 5904 5903 + Store 5753(result) 5905 + 5906: 7(f16vec4) FunctionCall 115(testCombinedTextureSampler() + 5907: 7(f16vec4) Load 5753(result) + 5908: 7(f16vec4) FAdd 5907 5906 + Store 5753(result) 5908 + 5909: 7(f16vec4) FunctionCall 117(testSubpassLoad() + 5910: 7(f16vec4) Load 5753(result) + 5911: 7(f16vec4) FAdd 5910 5909 + Store 5753(result) 5911 + 5914: 7(f16vec4) Load 5753(result) + 5915: 249(fvec4) FConvert 5914 + Store 5913(fragColor) 5915 + Return + FunctionEnd + 9(testTexture(): 7(f16vec4) Function None 8 + 10: Label + 119(texel): 64(ptr) Variable Function + Store 119(texel) 121 + 126: 123 Load 125(s1D) + 129: 52(float) Load 128(c1) + 130: 7(f16vec4) ImageSampleImplicitLod 126 129 + 131: 7(f16vec4) Load 119(texel) + 132: 7(f16vec4) FAdd 131 130 + Store 119(texel) 132 + 133: 123 Load 125(s1D) + 136:6(float16_t) Load 135(f16c1) + 138:6(float16_t) Load 137(f16bias) + 139: 7(f16vec4) ImageSampleImplicitLod 133 136 Bias 138 + 140: 7(f16vec4) Load 119(texel) + 141: 7(f16vec4) FAdd 140 139 + Store 119(texel) 141 + 146: 143 Load 145(s2D) + 149: 53(fvec2) Load 148(c2) + 150: 7(f16vec4) ImageSampleImplicitLod 146 149 + 151: 7(f16vec4) Load 119(texel) + 152: 7(f16vec4) FAdd 151 150 + Store 119(texel) 152 + 153: 143 Load 145(s2D) + 157:154(f16vec2) Load 156(f16c2) + 158:6(float16_t) Load 137(f16bias) + 159: 7(f16vec4) ImageSampleImplicitLod 153 157 Bias 158 + 160: 7(f16vec4) Load 119(texel) + 161: 7(f16vec4) FAdd 160 159 + Store 119(texel) 161 + 166: 163 Load 165(s3D) + 170: 167(fvec3) Load 169(c3) + 171: 7(f16vec4) ImageSampleImplicitLod 166 170 + 172: 7(f16vec4) Load 119(texel) + 173: 7(f16vec4) FAdd 172 171 + Store 119(texel) 173 + 174: 163 Load 165(s3D) + 178:175(f16vec3) Load 177(f16c3) + 179:6(float16_t) Load 137(f16bias) + 180: 7(f16vec4) ImageSampleImplicitLod 174 178 Bias 179 + 181: 7(f16vec4) Load 119(texel) + 182: 7(f16vec4) FAdd 181 180 + Store 119(texel) 182 + 187: 184 Load 186(sCube) + 188: 167(fvec3) Load 169(c3) + 189: 7(f16vec4) ImageSampleImplicitLod 187 188 + 190: 7(f16vec4) Load 119(texel) + 191: 7(f16vec4) FAdd 190 189 + Store 119(texel) 191 + 192: 184 Load 186(sCube) + 193:175(f16vec3) Load 177(f16c3) + 194:6(float16_t) Load 137(f16bias) + 195: 7(f16vec4) ImageSampleImplicitLod 192 193 Bias 194 + 196: 7(f16vec4) Load 119(texel) + 197: 7(f16vec4) FAdd 196 195 + Store 119(texel) 197 + 202: 199 Load 201(s1DShadow) + 203: 167(fvec3) Load 169(c3) + 204: 52(float) CompositeExtract 203 2 + 205:6(float16_t) ImageSampleDrefImplicitLod 202 203 204 + 209: 208(ptr) AccessChain 119(texel) 207 + 210:6(float16_t) Load 209 + 211:6(float16_t) FAdd 210 205 + 212: 208(ptr) AccessChain 119(texel) 207 + Store 212 211 + 213: 199 Load 201(s1DShadow) + 214:154(f16vec2) Load 156(f16c2) + 216: 52(float) Load 215(compare) + 217:6(float16_t) Load 137(f16bias) + 218:6(float16_t) ImageSampleDrefImplicitLod 213 214 216 Bias 217 + 219: 208(ptr) AccessChain 119(texel) 207 + 220:6(float16_t) Load 219 + 221:6(float16_t) FAdd 220 218 + 222: 208(ptr) AccessChain 119(texel) 207 + Store 222 221 + 227: 224 Load 226(s2DShadow) + 228: 167(fvec3) Load 169(c3) + 229: 52(float) CompositeExtract 228 2 + 230:6(float16_t) ImageSampleDrefImplicitLod 227 228 229 + 231: 208(ptr) AccessChain 119(texel) 207 + 232:6(float16_t) Load 231 + 233:6(float16_t) FAdd 232 230 + 234: 208(ptr) AccessChain 119(texel) 207 + Store 234 233 + 235: 224 Load 226(s2DShadow) + 236:154(f16vec2) Load 156(f16c2) + 237: 52(float) Load 215(compare) + 238:6(float16_t) Load 137(f16bias) + 239:6(float16_t) ImageSampleDrefImplicitLod 235 236 237 Bias 238 + 240: 208(ptr) AccessChain 119(texel) 207 + 241:6(float16_t) Load 240 + 242:6(float16_t) FAdd 241 239 + 243: 208(ptr) AccessChain 119(texel) 207 + Store 243 242 + 248: 245 Load 247(sCubeShadow) + 252: 249(fvec4) Load 251(c4) + 253: 52(float) CompositeExtract 252 3 + 254:6(float16_t) ImageSampleDrefImplicitLod 248 252 253 + 255: 208(ptr) AccessChain 119(texel) 207 + 256:6(float16_t) Load 255 + 257:6(float16_t) FAdd 256 254 + 258: 208(ptr) AccessChain 119(texel) 207 + Store 258 257 + 259: 245 Load 247(sCubeShadow) + 260:175(f16vec3) Load 177(f16c3) + 261: 52(float) Load 215(compare) + 262:6(float16_t) Load 137(f16bias) + 263:6(float16_t) ImageSampleDrefImplicitLod 259 260 261 Bias 262 + 264: 208(ptr) AccessChain 119(texel) 207 + 265:6(float16_t) Load 264 + 266:6(float16_t) FAdd 265 263 + 267: 208(ptr) AccessChain 119(texel) 207 + Store 267 266 + 272: 269 Load 271(s1DArray) + 273: 53(fvec2) Load 148(c2) + 274: 7(f16vec4) ImageSampleImplicitLod 272 273 + 275: 7(f16vec4) Load 119(texel) + 276: 7(f16vec4) FAdd 275 274 + Store 119(texel) 276 + 277: 269 Load 271(s1DArray) + 278:154(f16vec2) Load 156(f16c2) + 279:6(float16_t) Load 137(f16bias) + 280: 7(f16vec4) ImageSampleImplicitLod 277 278 Bias 279 + 281: 7(f16vec4) Load 119(texel) + 282: 7(f16vec4) FAdd 281 280 + Store 119(texel) 282 + 287: 284 Load 286(s2DArray) + 288: 167(fvec3) Load 169(c3) + 289: 7(f16vec4) ImageSampleImplicitLod 287 288 + 290: 7(f16vec4) Load 119(texel) + 291: 7(f16vec4) FAdd 290 289 + Store 119(texel) 291 + 292: 284 Load 286(s2DArray) + 293:175(f16vec3) Load 177(f16c3) + 294:6(float16_t) Load 137(f16bias) + 295: 7(f16vec4) ImageSampleImplicitLod 292 293 Bias 294 + 296: 7(f16vec4) Load 119(texel) + 297: 7(f16vec4) FAdd 296 295 + Store 119(texel) 297 + 302: 299 Load 301(sCubeArray) + 303: 249(fvec4) Load 251(c4) + 304: 7(f16vec4) ImageSampleImplicitLod 302 303 + 305: 7(f16vec4) Load 119(texel) + 306: 7(f16vec4) FAdd 305 304 + Store 119(texel) 306 + 307: 299 Load 301(sCubeArray) + 310: 7(f16vec4) Load 309(f16c4) + 311:6(float16_t) Load 137(f16bias) + 312: 7(f16vec4) ImageSampleImplicitLod 307 310 Bias 311 + 313: 7(f16vec4) Load 119(texel) + 314: 7(f16vec4) FAdd 313 312 + Store 119(texel) 314 + 319: 316 Load 318(s1DArrayShadow) + 320: 167(fvec3) Load 169(c3) + 321: 52(float) CompositeExtract 320 2 + 322:6(float16_t) ImageSampleDrefImplicitLod 319 320 321 + 323: 208(ptr) AccessChain 119(texel) 207 + 324:6(float16_t) Load 323 + 325:6(float16_t) FAdd 324 322 + 326: 208(ptr) AccessChain 119(texel) 207 + Store 326 325 + 327: 316 Load 318(s1DArrayShadow) + 328:154(f16vec2) Load 156(f16c2) + 329: 52(float) Load 215(compare) + 330:6(float16_t) Load 137(f16bias) + 331:6(float16_t) ImageSampleDrefImplicitLod 327 328 329 Bias 330 + 332: 208(ptr) AccessChain 119(texel) 207 + 333:6(float16_t) Load 332 + 334:6(float16_t) FAdd 333 331 + 335: 208(ptr) AccessChain 119(texel) 207 + Store 335 334 + 340: 337 Load 339(s2DArrayShadow) + 341: 249(fvec4) Load 251(c4) + 342: 52(float) CompositeExtract 341 3 + 343:6(float16_t) ImageSampleDrefImplicitLod 340 341 342 + 344: 208(ptr) AccessChain 119(texel) 207 + 345:6(float16_t) Load 344 + 346:6(float16_t) FAdd 345 343 + 347: 208(ptr) AccessChain 119(texel) 207 + Store 347 346 + 348: 337 Load 339(s2DArrayShadow) + 349:175(f16vec3) Load 177(f16c3) + 350: 52(float) Load 215(compare) + 351:6(float16_t) ImageSampleDrefImplicitLod 348 349 350 + 352: 208(ptr) AccessChain 119(texel) 207 + 353:6(float16_t) Load 352 + 354:6(float16_t) FAdd 353 351 + 355: 208(ptr) AccessChain 119(texel) 207 + Store 355 354 + 360: 357 Load 359(s2DRect) + 361: 53(fvec2) Load 148(c2) + 362: 7(f16vec4) ImageSampleImplicitLod 360 361 + 363: 7(f16vec4) Load 119(texel) + 364: 7(f16vec4) FAdd 363 362 + Store 119(texel) 364 + 365: 357 Load 359(s2DRect) + 366:154(f16vec2) Load 156(f16c2) + 367: 7(f16vec4) ImageSampleImplicitLod 365 366 + 368: 7(f16vec4) Load 119(texel) + 369: 7(f16vec4) FAdd 368 367 + Store 119(texel) 369 + 374: 371 Load 373(s2DRectShadow) + 375: 167(fvec3) Load 169(c3) + 376: 52(float) CompositeExtract 375 2 + 377:6(float16_t) ImageSampleDrefImplicitLod 374 375 376 + 378: 208(ptr) AccessChain 119(texel) 207 + 379:6(float16_t) Load 378 + 380:6(float16_t) FAdd 379 377 + 381: 208(ptr) AccessChain 119(texel) 207 + Store 381 380 + 382: 371 Load 373(s2DRectShadow) + 383:154(f16vec2) Load 156(f16c2) + 384: 52(float) Load 215(compare) + 385:6(float16_t) ImageSampleDrefImplicitLod 382 383 384 + 386: 208(ptr) AccessChain 119(texel) 207 + 387:6(float16_t) Load 386 + 388:6(float16_t) FAdd 387 385 + 389: 208(ptr) AccessChain 119(texel) 207 + Store 389 388 + 394: 391 Load 393(sCubeArrayShadow) + 395: 249(fvec4) Load 251(c4) + 396: 52(float) Load 215(compare) + 397:6(float16_t) ImageSampleDrefImplicitLod 394 395 396 + 398: 208(ptr) AccessChain 119(texel) 207 + 399:6(float16_t) Load 398 + 400:6(float16_t) FAdd 399 397 + 401: 208(ptr) AccessChain 119(texel) 207 + Store 401 400 + 402: 391 Load 393(sCubeArrayShadow) + 403: 7(f16vec4) Load 309(f16c4) + 404: 52(float) Load 215(compare) + 405:6(float16_t) ImageSampleDrefImplicitLod 402 403 404 + 406: 208(ptr) AccessChain 119(texel) 207 + 407:6(float16_t) Load 406 + 408:6(float16_t) FAdd 407 405 + 409: 208(ptr) AccessChain 119(texel) 207 + Store 409 408 + 410: 7(f16vec4) Load 119(texel) + ReturnValue 410 + FunctionEnd +11(testTextureProj(): 7(f16vec4) Function None 8 + 12: Label + 413(texel): 64(ptr) Variable Function + Store 413(texel) 121 + 414: 123 Load 125(s1D) + 415: 53(fvec2) Load 148(c2) + 416: 7(f16vec4) ImageSampleProjImplicitLod 414 415 + 417: 7(f16vec4) Load 413(texel) + 418: 7(f16vec4) FAdd 417 416 + Store 413(texel) 418 + 419: 123 Load 125(s1D) + 420:154(f16vec2) Load 156(f16c2) + 421:6(float16_t) Load 137(f16bias) + 422: 7(f16vec4) ImageSampleProjImplicitLod 419 420 Bias 421 + 423: 7(f16vec4) Load 413(texel) + 424: 7(f16vec4) FAdd 423 422 + Store 413(texel) 424 + 425: 123 Load 125(s1D) + 426: 249(fvec4) Load 251(c4) + 427: 52(float) CompositeExtract 426 3 + 428: 249(fvec4) CompositeInsert 427 426 1 + 429: 7(f16vec4) ImageSampleProjImplicitLod 425 428 + 430: 7(f16vec4) Load 413(texel) + 431: 7(f16vec4) FAdd 430 429 + Store 413(texel) 431 + 432: 123 Load 125(s1D) + 433: 7(f16vec4) Load 309(f16c4) + 434:6(float16_t) Load 137(f16bias) + 435:6(float16_t) CompositeExtract 433 3 + 436: 7(f16vec4) CompositeInsert 435 433 1 + 437: 7(f16vec4) ImageSampleProjImplicitLod 432 436 Bias 434 + 438: 7(f16vec4) Load 413(texel) + 439: 7(f16vec4) FAdd 438 437 + Store 413(texel) 439 + 440: 143 Load 145(s2D) + 441: 167(fvec3) Load 169(c3) + 442: 7(f16vec4) ImageSampleProjImplicitLod 440 441 + 443: 7(f16vec4) Load 413(texel) + 444: 7(f16vec4) FAdd 443 442 + Store 413(texel) 444 + 445: 143 Load 145(s2D) + 446:175(f16vec3) Load 177(f16c3) + 447:6(float16_t) Load 137(f16bias) + 448: 7(f16vec4) ImageSampleProjImplicitLod 445 446 Bias 447 + 449: 7(f16vec4) Load 413(texel) + 450: 7(f16vec4) FAdd 449 448 + Store 413(texel) 450 + 451: 143 Load 145(s2D) + 452: 249(fvec4) Load 251(c4) + 453: 52(float) CompositeExtract 452 3 + 454: 249(fvec4) CompositeInsert 453 452 2 + 455: 7(f16vec4) ImageSampleProjImplicitLod 451 454 + 456: 7(f16vec4) Load 413(texel) + 457: 7(f16vec4) FAdd 456 455 + Store 413(texel) 457 + 458: 143 Load 145(s2D) + 459: 7(f16vec4) Load 309(f16c4) + 460:6(float16_t) Load 137(f16bias) + 461:6(float16_t) CompositeExtract 459 3 + 462: 7(f16vec4) CompositeInsert 461 459 2 + 463: 7(f16vec4) ImageSampleProjImplicitLod 458 462 Bias 460 + 464: 7(f16vec4) Load 413(texel) + 465: 7(f16vec4) FAdd 464 463 + Store 413(texel) 465 + 466: 163 Load 165(s3D) + 467: 249(fvec4) Load 251(c4) + 468: 7(f16vec4) ImageSampleProjImplicitLod 466 467 + 469: 7(f16vec4) Load 413(texel) + 470: 7(f16vec4) FAdd 469 468 + Store 413(texel) 470 + 471: 163 Load 165(s3D) + 472: 7(f16vec4) Load 309(f16c4) + 473:6(float16_t) Load 137(f16bias) + 474: 7(f16vec4) ImageSampleProjImplicitLod 471 472 Bias 473 + 475: 7(f16vec4) Load 413(texel) + 476: 7(f16vec4) FAdd 475 474 + Store 413(texel) 476 + 477: 199 Load 201(s1DShadow) + 478: 249(fvec4) Load 251(c4) + 479: 52(float) CompositeExtract 478 2 + 480: 52(float) CompositeExtract 478 3 + 481: 249(fvec4) CompositeInsert 480 478 1 + 482:6(float16_t) ImageSampleProjDrefImplicitLod 477 481 479 + 483: 208(ptr) AccessChain 413(texel) 207 + 484:6(float16_t) Load 483 + 485:6(float16_t) FAdd 484 482 + 486: 208(ptr) AccessChain 413(texel) 207 + Store 486 485 + 487: 199 Load 201(s1DShadow) + 488:175(f16vec3) Load 177(f16c3) + 489: 52(float) Load 215(compare) + 490:6(float16_t) Load 137(f16bias) + 491:6(float16_t) CompositeExtract 488 2 + 492:175(f16vec3) CompositeInsert 491 488 1 + 493:6(float16_t) ImageSampleProjDrefImplicitLod 487 492 489 Bias 490 + 494: 208(ptr) AccessChain 413(texel) 207 + 495:6(float16_t) Load 494 + 496:6(float16_t) FAdd 495 493 + 497: 208(ptr) AccessChain 413(texel) 207 + Store 497 496 + 498: 224 Load 226(s2DShadow) + 499: 249(fvec4) Load 251(c4) + 500: 52(float) CompositeExtract 499 2 + 501: 52(float) CompositeExtract 499 3 + 502: 249(fvec4) CompositeInsert 501 499 2 + 503:6(float16_t) ImageSampleProjDrefImplicitLod 498 502 500 + 504: 208(ptr) AccessChain 413(texel) 207 + 505:6(float16_t) Load 504 + 506:6(float16_t) FAdd 505 503 + 507: 208(ptr) AccessChain 413(texel) 207 + Store 507 506 + 508: 224 Load 226(s2DShadow) + 509:175(f16vec3) Load 177(f16c3) + 510: 52(float) Load 215(compare) + 511:6(float16_t) Load 137(f16bias) + 512:6(float16_t) ImageSampleProjDrefImplicitLod 508 509 510 Bias 511 + 513: 208(ptr) AccessChain 413(texel) 207 + 514:6(float16_t) Load 513 + 515:6(float16_t) FAdd 514 512 + 516: 208(ptr) AccessChain 413(texel) 207 + Store 516 515 + 517: 357 Load 359(s2DRect) + 518: 167(fvec3) Load 169(c3) + 519: 7(f16vec4) ImageSampleProjImplicitLod 517 518 + 520: 7(f16vec4) Load 413(texel) + 521: 7(f16vec4) FAdd 520 519 + Store 413(texel) 521 + 522: 357 Load 359(s2DRect) + 523:175(f16vec3) Load 177(f16c3) + 524: 7(f16vec4) ImageSampleProjImplicitLod 522 523 + 525: 7(f16vec4) Load 413(texel) + 526: 7(f16vec4) FAdd 525 524 + Store 413(texel) 526 + 527: 357 Load 359(s2DRect) + 528: 249(fvec4) Load 251(c4) + 529: 52(float) CompositeExtract 528 3 + 530: 249(fvec4) CompositeInsert 529 528 2 + 531: 7(f16vec4) ImageSampleProjImplicitLod 527 530 + 532: 7(f16vec4) Load 413(texel) + 533: 7(f16vec4) FAdd 532 531 + Store 413(texel) 533 + 534: 357 Load 359(s2DRect) + 535: 7(f16vec4) Load 309(f16c4) + 536:6(float16_t) CompositeExtract 535 3 + 537: 7(f16vec4) CompositeInsert 536 535 2 + 538: 7(f16vec4) ImageSampleProjImplicitLod 534 537 + 539: 7(f16vec4) Load 413(texel) + 540: 7(f16vec4) FAdd 539 538 + Store 413(texel) 540 + 541: 371 Load 373(s2DRectShadow) + 542: 249(fvec4) Load 251(c4) + 543: 52(float) CompositeExtract 542 2 + 544: 52(float) CompositeExtract 542 3 + 545: 249(fvec4) CompositeInsert 544 542 2 + 546:6(float16_t) ImageSampleProjDrefImplicitLod 541 545 543 + 547: 208(ptr) AccessChain 413(texel) 207 + 548:6(float16_t) Load 547 + 549:6(float16_t) FAdd 548 546 + 550: 208(ptr) AccessChain 413(texel) 207 + Store 550 549 + 551: 371 Load 373(s2DRectShadow) + 552:175(f16vec3) Load 177(f16c3) + 553: 52(float) Load 215(compare) + 554:6(float16_t) ImageSampleProjDrefImplicitLod 551 552 553 + 555: 208(ptr) AccessChain 413(texel) 207 + 556:6(float16_t) Load 555 + 557:6(float16_t) FAdd 556 554 + 558: 208(ptr) AccessChain 413(texel) 207 + Store 558 557 + 559: 7(f16vec4) Load 413(texel) + ReturnValue 559 + FunctionEnd +13(testTextureLod(): 7(f16vec4) Function None 8 + 14: Label + 562(texel): 64(ptr) Variable Function + Store 562(texel) 121 + 563: 123 Load 125(s1D) + 564: 52(float) Load 128(c1) + 566: 52(float) Load 565(lod) + 567: 7(f16vec4) ImageSampleExplicitLod 563 564 Lod 566 + 568: 7(f16vec4) Load 562(texel) + 569: 7(f16vec4) FAdd 568 567 + Store 562(texel) 569 + 570: 123 Load 125(s1D) + 571:6(float16_t) Load 135(f16c1) + 573:6(float16_t) Load 572(f16lod) + 574: 7(f16vec4) ImageSampleExplicitLod 570 571 Lod 573 + 575: 7(f16vec4) Load 562(texel) + 576: 7(f16vec4) FAdd 575 574 + Store 562(texel) 576 + 577: 143 Load 145(s2D) + 578: 53(fvec2) Load 148(c2) + 579: 52(float) Load 565(lod) + 580: 7(f16vec4) ImageSampleExplicitLod 577 578 Lod 579 + 581: 7(f16vec4) Load 562(texel) + 582: 7(f16vec4) FAdd 581 580 + Store 562(texel) 582 + 583: 143 Load 145(s2D) + 584:154(f16vec2) Load 156(f16c2) + 585:6(float16_t) Load 572(f16lod) + 586: 7(f16vec4) ImageSampleExplicitLod 583 584 Lod 585 + 587: 7(f16vec4) Load 562(texel) + 588: 7(f16vec4) FAdd 587 586 + Store 562(texel) 588 + 589: 163 Load 165(s3D) + 590: 167(fvec3) Load 169(c3) + 591: 52(float) Load 565(lod) + 592: 7(f16vec4) ImageSampleExplicitLod 589 590 Lod 591 + 593: 7(f16vec4) Load 562(texel) + 594: 7(f16vec4) FAdd 593 592 + Store 562(texel) 594 + 595: 163 Load 165(s3D) + 596:175(f16vec3) Load 177(f16c3) + 597:6(float16_t) Load 572(f16lod) + 598: 7(f16vec4) ImageSampleExplicitLod 595 596 Lod 597 + 599: 7(f16vec4) Load 562(texel) + 600: 7(f16vec4) FAdd 599 598 + Store 562(texel) 600 + 601: 184 Load 186(sCube) + 602: 167(fvec3) Load 169(c3) + 603: 52(float) Load 565(lod) + 604: 7(f16vec4) ImageSampleExplicitLod 601 602 Lod 603 + 605: 7(f16vec4) Load 562(texel) + 606: 7(f16vec4) FAdd 605 604 + Store 562(texel) 606 + 607: 184 Load 186(sCube) + 608:175(f16vec3) Load 177(f16c3) + 609:6(float16_t) Load 572(f16lod) + 610: 7(f16vec4) ImageSampleExplicitLod 607 608 Lod 609 + 611: 7(f16vec4) Load 562(texel) + 612: 7(f16vec4) FAdd 611 610 + Store 562(texel) 612 + 613: 199 Load 201(s1DShadow) + 614: 167(fvec3) Load 169(c3) + 615: 52(float) Load 565(lod) + 616: 52(float) CompositeExtract 614 2 + 617:6(float16_t) ImageSampleDrefExplicitLod 613 614 616 Lod 615 + 618: 208(ptr) AccessChain 562(texel) 207 + 619:6(float16_t) Load 618 + 620:6(float16_t) FAdd 619 617 + 621: 208(ptr) AccessChain 562(texel) 207 + Store 621 620 + 622: 199 Load 201(s1DShadow) + 623:154(f16vec2) Load 156(f16c2) + 624: 52(float) Load 215(compare) + 625:6(float16_t) Load 572(f16lod) + 626:6(float16_t) ImageSampleDrefExplicitLod 622 623 624 Lod 625 + 627: 208(ptr) AccessChain 562(texel) 207 + 628:6(float16_t) Load 627 + 629:6(float16_t) FAdd 628 626 + 630: 208(ptr) AccessChain 562(texel) 207 + Store 630 629 + 631: 224 Load 226(s2DShadow) + 632: 167(fvec3) Load 169(c3) + 633: 52(float) Load 565(lod) + 634: 52(float) CompositeExtract 632 2 + 635:6(float16_t) ImageSampleDrefExplicitLod 631 632 634 Lod 633 + 636: 208(ptr) AccessChain 562(texel) 207 + 637:6(float16_t) Load 636 + 638:6(float16_t) FAdd 637 635 + 639: 208(ptr) AccessChain 562(texel) 207 + Store 639 638 + 640: 224 Load 226(s2DShadow) + 641:154(f16vec2) Load 156(f16c2) + 642: 52(float) Load 215(compare) + 643:6(float16_t) Load 572(f16lod) + 644:6(float16_t) ImageSampleDrefExplicitLod 640 641 642 Lod 643 + 645: 208(ptr) AccessChain 562(texel) 207 + 646:6(float16_t) Load 645 + 647:6(float16_t) FAdd 646 644 + 648: 208(ptr) AccessChain 562(texel) 207 + Store 648 647 + 649: 269 Load 271(s1DArray) + 650: 53(fvec2) Load 148(c2) + 651: 52(float) Load 565(lod) + 652: 7(f16vec4) ImageSampleExplicitLod 649 650 Lod 651 + 653: 7(f16vec4) Load 562(texel) + 654: 7(f16vec4) FAdd 653 652 + Store 562(texel) 654 + 655: 269 Load 271(s1DArray) + 656:154(f16vec2) Load 156(f16c2) + 657:6(float16_t) Load 572(f16lod) + 658: 7(f16vec4) ImageSampleExplicitLod 655 656 Lod 657 + 659: 7(f16vec4) Load 562(texel) + 660: 7(f16vec4) FAdd 659 658 + Store 562(texel) 660 + 661: 284 Load 286(s2DArray) + 662: 167(fvec3) Load 169(c3) + 663: 52(float) Load 565(lod) + 664: 7(f16vec4) ImageSampleExplicitLod 661 662 Lod 663 + 665: 7(f16vec4) Load 562(texel) + 666: 7(f16vec4) FAdd 665 664 + Store 562(texel) 666 + 667: 284 Load 286(s2DArray) + 668:175(f16vec3) Load 177(f16c3) + 669:6(float16_t) Load 572(f16lod) + 670: 7(f16vec4) ImageSampleExplicitLod 667 668 Lod 669 + 671: 7(f16vec4) Load 562(texel) + 672: 7(f16vec4) FAdd 671 670 + Store 562(texel) 672 + 673: 316 Load 318(s1DArrayShadow) + 674: 167(fvec3) Load 169(c3) + 675: 52(float) Load 565(lod) + 676: 52(float) CompositeExtract 674 2 + 677:6(float16_t) ImageSampleDrefExplicitLod 673 674 676 Lod 675 + 678: 208(ptr) AccessChain 562(texel) 207 + 679:6(float16_t) Load 678 + 680:6(float16_t) FAdd 679 677 + 681: 208(ptr) AccessChain 562(texel) 207 + Store 681 680 + 682: 316 Load 318(s1DArrayShadow) + 683:154(f16vec2) Load 156(f16c2) + 684: 52(float) Load 215(compare) + 685:6(float16_t) Load 572(f16lod) + 686:6(float16_t) ImageSampleDrefExplicitLod 682 683 684 Lod 685 + 687: 208(ptr) AccessChain 562(texel) 207 + 688:6(float16_t) Load 687 + 689:6(float16_t) FAdd 688 686 + 690: 208(ptr) AccessChain 562(texel) 207 + Store 690 689 + 691: 299 Load 301(sCubeArray) + 692: 249(fvec4) Load 251(c4) + 693: 52(float) Load 565(lod) + 694: 7(f16vec4) ImageSampleExplicitLod 691 692 Lod 693 + 695: 7(f16vec4) Load 562(texel) + 696: 7(f16vec4) FAdd 695 694 + Store 562(texel) 696 + 697: 299 Load 301(sCubeArray) + 698: 7(f16vec4) Load 309(f16c4) + 699:6(float16_t) Load 572(f16lod) + 700: 7(f16vec4) ImageSampleExplicitLod 697 698 Lod 699 + 701: 7(f16vec4) Load 562(texel) + 702: 7(f16vec4) FAdd 701 700 + Store 562(texel) 702 + 703: 7(f16vec4) Load 562(texel) + ReturnValue 703 + FunctionEnd +15(testTextureOffset(): 7(f16vec4) Function None 8 + 16: Label + 706(texel): 64(ptr) Variable Function + Store 706(texel) 121 + 707: 123 Load 125(s1D) + 708: 52(float) Load 128(c1) + 710: 7(f16vec4) ImageSampleImplicitLod 707 708 ConstOffset 709 + 711: 7(f16vec4) Load 706(texel) + 712: 7(f16vec4) FAdd 711 710 + Store 706(texel) 712 + 713: 123 Load 125(s1D) + 714:6(float16_t) Load 135(f16c1) + 715:6(float16_t) Load 137(f16bias) + 716: 7(f16vec4) ImageSampleImplicitLod 713 714 Bias ConstOffset 715 709 + 717: 7(f16vec4) Load 706(texel) + 718: 7(f16vec4) FAdd 717 716 + Store 706(texel) 718 + 719: 143 Load 145(s2D) + 720: 53(fvec2) Load 148(c2) + 723: 7(f16vec4) ImageSampleImplicitLod 719 720 ConstOffset 722 + 724: 7(f16vec4) Load 706(texel) + 725: 7(f16vec4) FAdd 724 723 + Store 706(texel) 725 + 726: 143 Load 145(s2D) + 727:154(f16vec2) Load 156(f16c2) + 728:6(float16_t) Load 137(f16bias) + 729: 7(f16vec4) ImageSampleImplicitLod 726 727 Bias ConstOffset 728 722 + 730: 7(f16vec4) Load 706(texel) + 731: 7(f16vec4) FAdd 730 729 + Store 706(texel) 731 + 732: 163 Load 165(s3D) + 733: 167(fvec3) Load 169(c3) + 736: 7(f16vec4) ImageSampleImplicitLod 732 733 ConstOffset 735 + 737: 7(f16vec4) Load 706(texel) + 738: 7(f16vec4) FAdd 737 736 + Store 706(texel) 738 + 739: 163 Load 165(s3D) + 740:175(f16vec3) Load 177(f16c3) + 741:6(float16_t) Load 137(f16bias) + 742: 7(f16vec4) ImageSampleImplicitLod 739 740 Bias ConstOffset 741 735 + 743: 7(f16vec4) Load 706(texel) + 744: 7(f16vec4) FAdd 743 742 + Store 706(texel) 744 + 745: 357 Load 359(s2DRect) + 746: 53(fvec2) Load 148(c2) + 747: 7(f16vec4) ImageSampleImplicitLod 745 746 ConstOffset 722 + 748: 7(f16vec4) Load 706(texel) + 749: 7(f16vec4) FAdd 748 747 + Store 706(texel) 749 + 750: 357 Load 359(s2DRect) + 751:154(f16vec2) Load 156(f16c2) + 752: 7(f16vec4) ImageSampleImplicitLod 750 751 ConstOffset 722 + 753: 7(f16vec4) Load 706(texel) + 754: 7(f16vec4) FAdd 753 752 + Store 706(texel) 754 + 755: 371 Load 373(s2DRectShadow) + 756: 167(fvec3) Load 169(c3) + 757: 52(float) CompositeExtract 756 2 + 758:6(float16_t) ImageSampleDrefImplicitLod 755 756 757 ConstOffset 722 + 759: 208(ptr) AccessChain 706(texel) 207 + 760:6(float16_t) Load 759 + 761:6(float16_t) FAdd 760 758 + 762: 208(ptr) AccessChain 706(texel) 207 + Store 762 761 + 763: 371 Load 373(s2DRectShadow) + 764:154(f16vec2) Load 156(f16c2) + 765: 52(float) Load 215(compare) + 766:6(float16_t) ImageSampleDrefImplicitLod 763 764 765 ConstOffset 722 + 767: 208(ptr) AccessChain 706(texel) 207 + 768:6(float16_t) Load 767 + 769:6(float16_t) FAdd 768 766 + 770: 208(ptr) AccessChain 706(texel) 207 + Store 770 769 + 771: 199 Load 201(s1DShadow) + 772: 167(fvec3) Load 169(c3) + 773: 52(float) CompositeExtract 772 2 + 774:6(float16_t) ImageSampleDrefImplicitLod 771 772 773 ConstOffset 709 + 775: 208(ptr) AccessChain 706(texel) 207 + 776:6(float16_t) Load 775 + 777:6(float16_t) FAdd 776 774 + 778: 208(ptr) AccessChain 706(texel) 207 + Store 778 777 + 779: 199 Load 201(s1DShadow) + 780:154(f16vec2) Load 156(f16c2) + 781: 52(float) Load 215(compare) + 782:6(float16_t) Load 137(f16bias) + 783:6(float16_t) ImageSampleDrefImplicitLod 779 780 781 Bias ConstOffset 782 709 + 784: 208(ptr) AccessChain 706(texel) 207 + 785:6(float16_t) Load 784 + 786:6(float16_t) FAdd 785 783 + 787: 208(ptr) AccessChain 706(texel) 207 + Store 787 786 + 788: 224 Load 226(s2DShadow) + 789: 167(fvec3) Load 169(c3) + 790: 52(float) CompositeExtract 789 2 + 791:6(float16_t) ImageSampleDrefImplicitLod 788 789 790 ConstOffset 722 + 792: 208(ptr) AccessChain 706(texel) 207 + 793:6(float16_t) Load 792 + 794:6(float16_t) FAdd 793 791 + 795: 208(ptr) AccessChain 706(texel) 207 + Store 795 794 + 796: 224 Load 226(s2DShadow) + 797:154(f16vec2) Load 156(f16c2) + 798: 52(float) Load 215(compare) + 799:6(float16_t) Load 137(f16bias) + 800:6(float16_t) ImageSampleDrefImplicitLod 796 797 798 Bias ConstOffset 799 722 + 801: 208(ptr) AccessChain 706(texel) 207 + 802:6(float16_t) Load 801 + 803:6(float16_t) FAdd 802 800 + 804: 208(ptr) AccessChain 706(texel) 207 + Store 804 803 + 805: 269 Load 271(s1DArray) + 806: 53(fvec2) Load 148(c2) + 807: 7(f16vec4) ImageSampleImplicitLod 805 806 ConstOffset 709 + 808: 7(f16vec4) Load 706(texel) + 809: 7(f16vec4) FAdd 808 807 + Store 706(texel) 809 + 810: 269 Load 271(s1DArray) + 811:154(f16vec2) Load 156(f16c2) + 812:6(float16_t) Load 137(f16bias) + 813: 7(f16vec4) ImageSampleImplicitLod 810 811 Bias ConstOffset 812 709 + 814: 7(f16vec4) Load 706(texel) + 815: 7(f16vec4) FAdd 814 813 + Store 706(texel) 815 + 816: 284 Load 286(s2DArray) + 817: 167(fvec3) Load 169(c3) + 818: 7(f16vec4) ImageSampleImplicitLod 816 817 ConstOffset 722 + 819: 7(f16vec4) Load 706(texel) + 820: 7(f16vec4) FAdd 819 818 + Store 706(texel) 820 + 821: 284 Load 286(s2DArray) + 822:175(f16vec3) Load 177(f16c3) + 823:6(float16_t) Load 137(f16bias) + 824: 7(f16vec4) ImageSampleImplicitLod 821 822 Bias ConstOffset 823 722 + 825: 7(f16vec4) Load 706(texel) + 826: 7(f16vec4) FAdd 825 824 + Store 706(texel) 826 + 827: 316 Load 318(s1DArrayShadow) + 828: 167(fvec3) Load 169(c3) + 829: 52(float) CompositeExtract 828 2 + 830:6(float16_t) ImageSampleDrefImplicitLod 827 828 829 ConstOffset 709 + 831: 208(ptr) AccessChain 706(texel) 207 + 832:6(float16_t) Load 831 + 833:6(float16_t) FAdd 832 830 + 834: 208(ptr) AccessChain 706(texel) 207 + Store 834 833 + 835: 316 Load 318(s1DArrayShadow) + 836:154(f16vec2) Load 156(f16c2) + 837: 52(float) Load 215(compare) + 838:6(float16_t) Load 137(f16bias) + 839:6(float16_t) ImageSampleDrefImplicitLod 835 836 837 Bias ConstOffset 838 709 + 840: 208(ptr) AccessChain 706(texel) 207 + 841:6(float16_t) Load 840 + 842:6(float16_t) FAdd 841 839 + 843: 208(ptr) AccessChain 706(texel) 207 + Store 843 842 + 844: 337 Load 339(s2DArrayShadow) + 845: 249(fvec4) Load 251(c4) + 846: 52(float) CompositeExtract 845 3 + 847:6(float16_t) ImageSampleDrefImplicitLod 844 845 846 ConstOffset 722 + 848: 208(ptr) AccessChain 706(texel) 207 + 849:6(float16_t) Load 848 + 850:6(float16_t) FAdd 849 847 + 851: 208(ptr) AccessChain 706(texel) 207 + Store 851 850 + 852: 337 Load 339(s2DArrayShadow) + 853:175(f16vec3) Load 177(f16c3) + 854: 52(float) Load 215(compare) + 855:6(float16_t) ImageSampleDrefImplicitLod 852 853 854 ConstOffset 722 + 856: 208(ptr) AccessChain 706(texel) 207 + 857:6(float16_t) Load 856 + 858:6(float16_t) FAdd 857 855 + 859: 208(ptr) AccessChain 706(texel) 207 + Store 859 858 + 860: 7(f16vec4) Load 706(texel) + ReturnValue 860 + FunctionEnd +17(testTextureProjOffset(): 7(f16vec4) Function None 8 + 18: Label + 863(texel): 64(ptr) Variable Function + Store 863(texel) 121 + 864: 123 Load 125(s1D) + 865: 53(fvec2) Load 148(c2) + 866: 7(f16vec4) ImageSampleProjImplicitLod 864 865 ConstOffset 709 + 867: 7(f16vec4) Load 863(texel) + 868: 7(f16vec4) FAdd 867 866 + Store 863(texel) 868 + 869: 123 Load 125(s1D) + 870:154(f16vec2) Load 156(f16c2) + 871:6(float16_t) Load 137(f16bias) + 872: 7(f16vec4) ImageSampleProjImplicitLod 869 870 Bias ConstOffset 871 709 + 873: 7(f16vec4) Load 863(texel) + 874: 7(f16vec4) FAdd 873 872 + Store 863(texel) 874 + 875: 123 Load 125(s1D) + 876: 249(fvec4) Load 251(c4) + 877: 52(float) CompositeExtract 876 3 + 878: 249(fvec4) CompositeInsert 877 876 1 + 879: 7(f16vec4) ImageSampleProjImplicitLod 875 878 ConstOffset 709 + 880: 7(f16vec4) Load 863(texel) + 881: 7(f16vec4) FAdd 880 879 + Store 863(texel) 881 + 882: 123 Load 125(s1D) + 883: 7(f16vec4) Load 309(f16c4) + 884:6(float16_t) Load 137(f16bias) + 885:6(float16_t) CompositeExtract 883 3 + 886: 7(f16vec4) CompositeInsert 885 883 1 + 887: 7(f16vec4) ImageSampleProjImplicitLod 882 886 Bias ConstOffset 884 709 + 888: 7(f16vec4) Load 863(texel) + 889: 7(f16vec4) FAdd 888 887 + Store 863(texel) 889 + 890: 143 Load 145(s2D) + 891: 167(fvec3) Load 169(c3) + 892: 7(f16vec4) ImageSampleProjImplicitLod 890 891 ConstOffset 722 + 893: 7(f16vec4) Load 863(texel) + 894: 7(f16vec4) FAdd 893 892 + Store 863(texel) 894 + 895: 143 Load 145(s2D) + 896:175(f16vec3) Load 177(f16c3) + 897:6(float16_t) Load 137(f16bias) + 898: 7(f16vec4) ImageSampleProjImplicitLod 895 896 Bias ConstOffset 897 722 + 899: 7(f16vec4) Load 863(texel) + 900: 7(f16vec4) FAdd 899 898 + Store 863(texel) 900 + 901: 143 Load 145(s2D) + 902: 249(fvec4) Load 251(c4) + 903: 52(float) CompositeExtract 902 3 + 904: 249(fvec4) CompositeInsert 903 902 2 + 905: 7(f16vec4) ImageSampleProjImplicitLod 901 904 ConstOffset 722 + 906: 7(f16vec4) Load 863(texel) + 907: 7(f16vec4) FAdd 906 905 + Store 863(texel) 907 + 908: 143 Load 145(s2D) + 909: 7(f16vec4) Load 309(f16c4) + 910:6(float16_t) Load 137(f16bias) + 911:6(float16_t) CompositeExtract 909 3 + 912: 7(f16vec4) CompositeInsert 911 909 2 + 913: 7(f16vec4) ImageSampleProjImplicitLod 908 912 Bias ConstOffset 910 722 + 914: 7(f16vec4) Load 863(texel) + 915: 7(f16vec4) FAdd 914 913 + Store 863(texel) 915 + 916: 163 Load 165(s3D) + 917: 249(fvec4) Load 251(c4) + 918: 7(f16vec4) ImageSampleProjImplicitLod 916 917 ConstOffset 735 + 919: 7(f16vec4) Load 863(texel) + 920: 7(f16vec4) FAdd 919 918 + Store 863(texel) 920 + 921: 163 Load 165(s3D) + 922: 7(f16vec4) Load 309(f16c4) + 923:6(float16_t) Load 137(f16bias) + 924: 7(f16vec4) ImageSampleProjImplicitLod 921 922 Bias ConstOffset 923 735 + 925: 7(f16vec4) Load 863(texel) + 926: 7(f16vec4) FAdd 925 924 + Store 863(texel) 926 + 927: 357 Load 359(s2DRect) + 928: 167(fvec3) Load 169(c3) + 929: 7(f16vec4) ImageSampleProjImplicitLod 927 928 ConstOffset 722 + 930: 7(f16vec4) Load 863(texel) + 931: 7(f16vec4) FAdd 930 929 + Store 863(texel) 931 + 932: 357 Load 359(s2DRect) + 933:175(f16vec3) Load 177(f16c3) + 934: 7(f16vec4) ImageSampleProjImplicitLod 932 933 ConstOffset 722 + 935: 7(f16vec4) Load 863(texel) + 936: 7(f16vec4) FAdd 935 934 + Store 863(texel) 936 + 937: 357 Load 359(s2DRect) + 938: 249(fvec4) Load 251(c4) + 939: 52(float) CompositeExtract 938 3 + 940: 249(fvec4) CompositeInsert 939 938 2 + 941: 7(f16vec4) ImageSampleProjImplicitLod 937 940 ConstOffset 722 + 942: 7(f16vec4) Load 863(texel) + 943: 7(f16vec4) FAdd 942 941 + Store 863(texel) 943 + 944: 357 Load 359(s2DRect) + 945: 7(f16vec4) Load 309(f16c4) + 946:6(float16_t) CompositeExtract 945 3 + 947: 7(f16vec4) CompositeInsert 946 945 2 + 948: 7(f16vec4) ImageSampleProjImplicitLod 944 947 ConstOffset 722 + 949: 7(f16vec4) Load 863(texel) + 950: 7(f16vec4) FAdd 949 948 + Store 863(texel) 950 + 951: 371 Load 373(s2DRectShadow) + 952: 249(fvec4) Load 251(c4) + 953: 52(float) CompositeExtract 952 2 + 954: 52(float) CompositeExtract 952 3 + 955: 249(fvec4) CompositeInsert 954 952 2 + 956:6(float16_t) ImageSampleProjDrefImplicitLod 951 955 953 ConstOffset 722 + 957: 208(ptr) AccessChain 863(texel) 207 + 958:6(float16_t) Load 957 + 959:6(float16_t) FAdd 958 956 + 960: 208(ptr) AccessChain 863(texel) 207 + Store 960 959 + 961: 371 Load 373(s2DRectShadow) + 962:175(f16vec3) Load 177(f16c3) + 963: 52(float) Load 215(compare) + 964:6(float16_t) ImageSampleProjDrefImplicitLod 961 962 963 ConstOffset 722 + 965: 208(ptr) AccessChain 863(texel) 207 + 966:6(float16_t) Load 965 + 967:6(float16_t) FAdd 966 964 + 968: 208(ptr) AccessChain 863(texel) 207 + Store 968 967 + 969: 199 Load 201(s1DShadow) + 970: 249(fvec4) Load 251(c4) + 971: 52(float) CompositeExtract 970 2 + 972: 52(float) CompositeExtract 970 3 + 973: 249(fvec4) CompositeInsert 972 970 1 + 974:6(float16_t) ImageSampleProjDrefImplicitLod 969 973 971 ConstOffset 709 + 975: 208(ptr) AccessChain 863(texel) 207 + 976:6(float16_t) Load 975 + 977:6(float16_t) FAdd 976 974 + 978: 208(ptr) AccessChain 863(texel) 207 + Store 978 977 + 979: 199 Load 201(s1DShadow) + 980:175(f16vec3) Load 177(f16c3) + 981: 52(float) Load 215(compare) + 982:6(float16_t) Load 137(f16bias) + 983:6(float16_t) CompositeExtract 980 2 + 984:175(f16vec3) CompositeInsert 983 980 1 + 985:6(float16_t) ImageSampleProjDrefImplicitLod 979 984 981 Bias ConstOffset 982 709 + 986: 208(ptr) AccessChain 863(texel) 207 + 987:6(float16_t) Load 986 + 988:6(float16_t) FAdd 987 985 + 989: 208(ptr) AccessChain 863(texel) 207 + Store 989 988 + 990: 224 Load 226(s2DShadow) + 991: 249(fvec4) Load 251(c4) + 992: 52(float) CompositeExtract 991 2 + 993: 52(float) CompositeExtract 991 3 + 994: 249(fvec4) CompositeInsert 993 991 2 + 995:6(float16_t) ImageSampleProjDrefImplicitLod 990 994 992 ConstOffset 722 + 996: 208(ptr) AccessChain 863(texel) 207 + 997:6(float16_t) Load 996 + 998:6(float16_t) FAdd 997 995 + 999: 208(ptr) AccessChain 863(texel) 207 + Store 999 998 + 1000: 224 Load 226(s2DShadow) + 1001:175(f16vec3) Load 177(f16c3) + 1002: 52(float) Load 215(compare) + 1003:6(float16_t) Load 137(f16bias) + 1004:6(float16_t) ImageSampleProjDrefImplicitLod 1000 1001 1002 Bias ConstOffset 1003 722 + 1005: 208(ptr) AccessChain 863(texel) 207 + 1006:6(float16_t) Load 1005 + 1007:6(float16_t) FAdd 1006 1004 + 1008: 208(ptr) AccessChain 863(texel) 207 + Store 1008 1007 + 1009: 7(f16vec4) Load 863(texel) + ReturnValue 1009 + FunctionEnd +19(testTextureLodOffset(): 7(f16vec4) Function None 8 + 20: Label + 1012(texel): 64(ptr) Variable Function + Store 1012(texel) 121 + 1013: 123 Load 125(s1D) + 1014: 52(float) Load 128(c1) + 1015: 52(float) Load 565(lod) + 1016: 7(f16vec4) ImageSampleExplicitLod 1013 1014 Lod ConstOffset 1015 709 + 1017: 7(f16vec4) Load 1012(texel) + 1018: 7(f16vec4) FAdd 1017 1016 + Store 1012(texel) 1018 + 1019: 123 Load 125(s1D) + 1020:6(float16_t) Load 135(f16c1) + 1021:6(float16_t) Load 572(f16lod) + 1022: 7(f16vec4) ImageSampleExplicitLod 1019 1020 Lod ConstOffset 1021 709 + 1023: 7(f16vec4) Load 1012(texel) + 1024: 7(f16vec4) FAdd 1023 1022 + Store 1012(texel) 1024 + 1025: 143 Load 145(s2D) + 1026: 53(fvec2) Load 148(c2) + 1027: 52(float) Load 565(lod) + 1028: 7(f16vec4) ImageSampleExplicitLod 1025 1026 Lod ConstOffset 1027 722 + 1029: 7(f16vec4) Load 1012(texel) + 1030: 7(f16vec4) FAdd 1029 1028 + Store 1012(texel) 1030 + 1031: 143 Load 145(s2D) + 1032:154(f16vec2) Load 156(f16c2) + 1033:6(float16_t) Load 572(f16lod) + 1034: 7(f16vec4) ImageSampleExplicitLod 1031 1032 Lod ConstOffset 1033 722 + 1035: 7(f16vec4) Load 1012(texel) + 1036: 7(f16vec4) FAdd 1035 1034 + Store 1012(texel) 1036 + 1037: 163 Load 165(s3D) + 1038: 167(fvec3) Load 169(c3) + 1039: 52(float) Load 565(lod) + 1040: 7(f16vec4) ImageSampleExplicitLod 1037 1038 Lod ConstOffset 1039 735 + 1041: 7(f16vec4) Load 1012(texel) + 1042: 7(f16vec4) FAdd 1041 1040 + Store 1012(texel) 1042 + 1043: 163 Load 165(s3D) + 1044:175(f16vec3) Load 177(f16c3) + 1045:6(float16_t) Load 572(f16lod) + 1046: 7(f16vec4) ImageSampleExplicitLod 1043 1044 Lod ConstOffset 1045 735 + 1047: 7(f16vec4) Load 1012(texel) + 1048: 7(f16vec4) FAdd 1047 1046 + Store 1012(texel) 1048 + 1049: 199 Load 201(s1DShadow) + 1050: 167(fvec3) Load 169(c3) + 1051: 52(float) Load 565(lod) + 1052: 52(float) CompositeExtract 1050 2 + 1053:6(float16_t) ImageSampleDrefExplicitLod 1049 1050 1052 Lod ConstOffset 1051 709 + 1054: 208(ptr) AccessChain 1012(texel) 207 + 1055:6(float16_t) Load 1054 + 1056:6(float16_t) FAdd 1055 1053 + 1057: 208(ptr) AccessChain 1012(texel) 207 + Store 1057 1056 + 1058: 199 Load 201(s1DShadow) + 1059:154(f16vec2) Load 156(f16c2) + 1060: 52(float) Load 215(compare) + 1061:6(float16_t) Load 572(f16lod) + 1062:6(float16_t) ImageSampleDrefExplicitLod 1058 1059 1060 Lod ConstOffset 1061 709 + 1063: 208(ptr) AccessChain 1012(texel) 207 + 1064:6(float16_t) Load 1063 + 1065:6(float16_t) FAdd 1064 1062 + 1066: 208(ptr) AccessChain 1012(texel) 207 + Store 1066 1065 + 1067: 224 Load 226(s2DShadow) + 1068: 167(fvec3) Load 169(c3) + 1069: 52(float) Load 565(lod) + 1070: 52(float) CompositeExtract 1068 2 + 1071:6(float16_t) ImageSampleDrefExplicitLod 1067 1068 1070 Lod ConstOffset 1069 722 + 1072: 208(ptr) AccessChain 1012(texel) 207 + 1073:6(float16_t) Load 1072 + 1074:6(float16_t) FAdd 1073 1071 + 1075: 208(ptr) AccessChain 1012(texel) 207 + Store 1075 1074 + 1076: 224 Load 226(s2DShadow) + 1077:154(f16vec2) Load 156(f16c2) + 1078: 52(float) Load 215(compare) + 1079:6(float16_t) Load 572(f16lod) + 1080:6(float16_t) ImageSampleDrefExplicitLod 1076 1077 1078 Lod ConstOffset 1079 722 + 1081: 208(ptr) AccessChain 1012(texel) 207 + 1082:6(float16_t) Load 1081 + 1083:6(float16_t) FAdd 1082 1080 + 1084: 208(ptr) AccessChain 1012(texel) 207 + Store 1084 1083 + 1085: 269 Load 271(s1DArray) + 1086: 53(fvec2) Load 148(c2) + 1087: 52(float) Load 565(lod) + 1088: 7(f16vec4) ImageSampleExplicitLod 1085 1086 Lod ConstOffset 1087 709 + 1089: 7(f16vec4) Load 1012(texel) + 1090: 7(f16vec4) FAdd 1089 1088 + Store 1012(texel) 1090 + 1091: 269 Load 271(s1DArray) + 1092:154(f16vec2) Load 156(f16c2) + 1093:6(float16_t) Load 572(f16lod) + 1094: 7(f16vec4) ImageSampleExplicitLod 1091 1092 Lod ConstOffset 1093 709 + 1095: 7(f16vec4) Load 1012(texel) + 1096: 7(f16vec4) FAdd 1095 1094 + Store 1012(texel) 1096 + 1097: 284 Load 286(s2DArray) + 1098: 167(fvec3) Load 169(c3) + 1099: 52(float) Load 565(lod) + 1100: 7(f16vec4) ImageSampleExplicitLod 1097 1098 Lod ConstOffset 1099 722 + 1101: 7(f16vec4) Load 1012(texel) + 1102: 7(f16vec4) FAdd 1101 1100 + Store 1012(texel) 1102 + 1103: 284 Load 286(s2DArray) + 1104:175(f16vec3) Load 177(f16c3) + 1105:6(float16_t) Load 572(f16lod) + 1106: 7(f16vec4) ImageSampleExplicitLod 1103 1104 Lod ConstOffset 1105 722 + 1107: 7(f16vec4) Load 1012(texel) + 1108: 7(f16vec4) FAdd 1107 1106 + Store 1012(texel) 1108 + 1109: 316 Load 318(s1DArrayShadow) + 1110: 167(fvec3) Load 169(c3) + 1111: 52(float) Load 565(lod) + 1112: 52(float) CompositeExtract 1110 2 + 1113:6(float16_t) ImageSampleDrefExplicitLod 1109 1110 1112 Lod ConstOffset 1111 709 + 1114: 208(ptr) AccessChain 1012(texel) 207 + 1115:6(float16_t) Load 1114 + 1116:6(float16_t) FAdd 1115 1113 + 1117: 208(ptr) AccessChain 1012(texel) 207 + Store 1117 1116 + 1118: 316 Load 318(s1DArrayShadow) + 1119:154(f16vec2) Load 156(f16c2) + 1120: 52(float) Load 215(compare) + 1121:6(float16_t) Load 572(f16lod) + 1122:6(float16_t) ImageSampleDrefExplicitLod 1118 1119 1120 Lod ConstOffset 1121 709 + 1123: 208(ptr) AccessChain 1012(texel) 207 + 1124:6(float16_t) Load 1123 + 1125:6(float16_t) FAdd 1124 1122 + 1126: 208(ptr) AccessChain 1012(texel) 207 + Store 1126 1125 + 1127: 7(f16vec4) Load 1012(texel) + ReturnValue 1127 + FunctionEnd +21(testTextureProjLodOffset(): 7(f16vec4) Function None 8 + 22: Label + 1130(texel): 64(ptr) Variable Function + Store 1130(texel) 121 + 1131: 123 Load 125(s1D) + 1132: 53(fvec2) Load 148(c2) + 1133: 52(float) Load 565(lod) + 1134: 7(f16vec4) ImageSampleProjExplicitLod 1131 1132 Lod ConstOffset 1133 709 + 1135: 7(f16vec4) Load 1130(texel) + 1136: 7(f16vec4) FAdd 1135 1134 + Store 1130(texel) 1136 + 1137: 123 Load 125(s1D) + 1138:154(f16vec2) Load 156(f16c2) + 1139:6(float16_t) Load 572(f16lod) + 1140: 7(f16vec4) ImageSampleProjExplicitLod 1137 1138 Lod ConstOffset 1139 709 + 1141: 7(f16vec4) Load 1130(texel) + 1142: 7(f16vec4) FAdd 1141 1140 + Store 1130(texel) 1142 + 1143: 123 Load 125(s1D) + 1144: 249(fvec4) Load 251(c4) + 1145: 52(float) Load 565(lod) + 1146: 52(float) CompositeExtract 1144 3 + 1147: 249(fvec4) CompositeInsert 1146 1144 1 + 1148: 7(f16vec4) ImageSampleProjExplicitLod 1143 1147 Lod ConstOffset 1145 709 + 1149: 7(f16vec4) Load 1130(texel) + 1150: 7(f16vec4) FAdd 1149 1148 + Store 1130(texel) 1150 + 1151: 123 Load 125(s1D) + 1152: 7(f16vec4) Load 309(f16c4) + 1153:6(float16_t) Load 572(f16lod) + 1154:6(float16_t) CompositeExtract 1152 3 + 1155: 7(f16vec4) CompositeInsert 1154 1152 1 + 1156: 7(f16vec4) ImageSampleProjExplicitLod 1151 1155 Lod ConstOffset 1153 709 + 1157: 7(f16vec4) Load 1130(texel) + 1158: 7(f16vec4) FAdd 1157 1156 + Store 1130(texel) 1158 + 1159: 143 Load 145(s2D) + 1160: 167(fvec3) Load 169(c3) + 1161: 52(float) Load 565(lod) + 1162: 7(f16vec4) ImageSampleProjExplicitLod 1159 1160 Lod ConstOffset 1161 722 + 1163: 7(f16vec4) Load 1130(texel) + 1164: 7(f16vec4) FAdd 1163 1162 + Store 1130(texel) 1164 + 1165: 143 Load 145(s2D) + 1166:175(f16vec3) Load 177(f16c3) + 1167:6(float16_t) Load 572(f16lod) + 1168: 7(f16vec4) ImageSampleProjExplicitLod 1165 1166 Lod ConstOffset 1167 722 + 1169: 7(f16vec4) Load 1130(texel) + 1170: 7(f16vec4) FAdd 1169 1168 + Store 1130(texel) 1170 + 1171: 143 Load 145(s2D) + 1172: 249(fvec4) Load 251(c4) + 1173: 52(float) Load 565(lod) + 1174: 52(float) CompositeExtract 1172 3 + 1175: 249(fvec4) CompositeInsert 1174 1172 2 + 1176: 7(f16vec4) ImageSampleProjExplicitLod 1171 1175 Lod ConstOffset 1173 722 + 1177: 7(f16vec4) Load 1130(texel) + 1178: 7(f16vec4) FAdd 1177 1176 + Store 1130(texel) 1178 + 1179: 143 Load 145(s2D) + 1180: 7(f16vec4) Load 309(f16c4) + 1181:6(float16_t) Load 572(f16lod) + 1182:6(float16_t) CompositeExtract 1180 3 + 1183: 7(f16vec4) CompositeInsert 1182 1180 2 + 1184: 7(f16vec4) ImageSampleProjExplicitLod 1179 1183 Lod ConstOffset 1181 722 + 1185: 7(f16vec4) Load 1130(texel) + 1186: 7(f16vec4) FAdd 1185 1184 + Store 1130(texel) 1186 + 1187: 163 Load 165(s3D) + 1188: 249(fvec4) Load 251(c4) + 1189: 52(float) Load 565(lod) + 1190: 7(f16vec4) ImageSampleProjExplicitLod 1187 1188 Lod ConstOffset 1189 735 + 1191: 7(f16vec4) Load 1130(texel) + 1192: 7(f16vec4) FAdd 1191 1190 + Store 1130(texel) 1192 + 1193: 163 Load 165(s3D) + 1194: 7(f16vec4) Load 309(f16c4) + 1195:6(float16_t) Load 572(f16lod) + 1196: 7(f16vec4) ImageSampleProjExplicitLod 1193 1194 Lod ConstOffset 1195 735 + 1197: 7(f16vec4) Load 1130(texel) + 1198: 7(f16vec4) FAdd 1197 1196 + Store 1130(texel) 1198 + 1199: 199 Load 201(s1DShadow) + 1200: 249(fvec4) Load 251(c4) + 1201: 52(float) Load 565(lod) + 1202: 52(float) CompositeExtract 1200 2 + 1203: 52(float) CompositeExtract 1200 3 + 1204: 249(fvec4) CompositeInsert 1203 1200 1 + 1205:6(float16_t) ImageSampleProjDrefExplicitLod 1199 1204 1202 Lod ConstOffset 1201 709 + 1206: 208(ptr) AccessChain 1130(texel) 207 + 1207:6(float16_t) Load 1206 + 1208:6(float16_t) FAdd 1207 1205 + 1209: 208(ptr) AccessChain 1130(texel) 207 + Store 1209 1208 + 1210: 199 Load 201(s1DShadow) + 1211:175(f16vec3) Load 177(f16c3) + 1212: 52(float) Load 215(compare) + 1213:6(float16_t) Load 572(f16lod) + 1214:6(float16_t) CompositeExtract 1211 2 + 1215:175(f16vec3) CompositeInsert 1214 1211 1 + 1216:6(float16_t) ImageSampleProjDrefExplicitLod 1210 1215 1212 Lod ConstOffset 1213 709 + 1217: 208(ptr) AccessChain 1130(texel) 207 + 1218:6(float16_t) Load 1217 + 1219:6(float16_t) FAdd 1218 1216 + 1220: 208(ptr) AccessChain 1130(texel) 207 + Store 1220 1219 + 1221: 224 Load 226(s2DShadow) + 1222: 249(fvec4) Load 251(c4) + 1223: 52(float) Load 565(lod) + 1224: 52(float) CompositeExtract 1222 2 + 1225: 52(float) CompositeExtract 1222 3 + 1226: 249(fvec4) CompositeInsert 1225 1222 2 + 1227:6(float16_t) ImageSampleProjDrefExplicitLod 1221 1226 1224 Lod ConstOffset 1223 722 + 1228: 208(ptr) AccessChain 1130(texel) 207 + 1229:6(float16_t) Load 1228 + 1230:6(float16_t) FAdd 1229 1227 + 1231: 208(ptr) AccessChain 1130(texel) 207 + Store 1231 1230 + 1232: 224 Load 226(s2DShadow) + 1233:175(f16vec3) Load 177(f16c3) + 1234: 52(float) Load 215(compare) + 1235:6(float16_t) Load 572(f16lod) + 1236:6(float16_t) ImageSampleProjDrefExplicitLod 1232 1233 1234 Lod ConstOffset 1235 722 + 1237: 208(ptr) AccessChain 1130(texel) 207 + 1238:6(float16_t) Load 1237 + 1239:6(float16_t) FAdd 1238 1236 + 1240: 208(ptr) AccessChain 1130(texel) 207 + Store 1240 1239 + 1241: 7(f16vec4) Load 1130(texel) + ReturnValue 1241 + FunctionEnd +23(testTexelFetch(): 7(f16vec4) Function None 8 + 24: Label + 1244(texel): 64(ptr) Variable Function + Store 1244(texel) 121 + 1245: 123 Load 125(s1D) + 1246: 52(float) Load 128(c1) + 1247: 47(int) ConvertFToS 1246 + 1248: 52(float) Load 565(lod) + 1249: 47(int) ConvertFToS 1248 + 1250: 122 Image 1245 + 1251: 7(f16vec4) ImageFetch 1250 1247 Lod 1249 + 1252: 7(f16vec4) Load 1244(texel) + 1253: 7(f16vec4) FAdd 1252 1251 + Store 1244(texel) 1253 + 1254: 143 Load 145(s2D) + 1255: 53(fvec2) Load 148(c2) + 1256: 721(ivec2) ConvertFToS 1255 + 1257: 52(float) Load 565(lod) + 1258: 47(int) ConvertFToS 1257 + 1259: 142 Image 1254 + 1260: 7(f16vec4) ImageFetch 1259 1256 Lod 1258 + 1261: 7(f16vec4) Load 1244(texel) + 1262: 7(f16vec4) FAdd 1261 1260 + Store 1244(texel) 1262 + 1263: 163 Load 165(s3D) + 1264: 167(fvec3) Load 169(c3) + 1265: 734(ivec3) ConvertFToS 1264 + 1266: 52(float) Load 565(lod) + 1267: 47(int) ConvertFToS 1266 + 1268: 162 Image 1263 + 1269: 7(f16vec4) ImageFetch 1268 1265 Lod 1267 + 1270: 7(f16vec4) Load 1244(texel) + 1271: 7(f16vec4) FAdd 1270 1269 + Store 1244(texel) 1271 + 1272: 357 Load 359(s2DRect) + 1273: 53(fvec2) Load 148(c2) + 1274: 721(ivec2) ConvertFToS 1273 + 1275: 356 Image 1272 + 1276: 7(f16vec4) ImageFetch 1275 1274 + 1277: 7(f16vec4) Load 1244(texel) + 1278: 7(f16vec4) FAdd 1277 1276 + Store 1244(texel) 1278 + 1279: 269 Load 271(s1DArray) + 1280: 53(fvec2) Load 148(c2) + 1281: 721(ivec2) ConvertFToS 1280 + 1282: 52(float) Load 565(lod) + 1283: 47(int) ConvertFToS 1282 + 1284: 268 Image 1279 + 1285: 7(f16vec4) ImageFetch 1284 1281 Lod 1283 + 1286: 7(f16vec4) Load 1244(texel) + 1287: 7(f16vec4) FAdd 1286 1285 + Store 1244(texel) 1287 + 1288: 284 Load 286(s2DArray) + 1289: 167(fvec3) Load 169(c3) + 1290: 734(ivec3) ConvertFToS 1289 + 1291: 52(float) Load 565(lod) + 1292: 47(int) ConvertFToS 1291 + 1293: 283 Image 1288 + 1294: 7(f16vec4) ImageFetch 1293 1290 Lod 1292 + 1295: 7(f16vec4) Load 1244(texel) + 1296: 7(f16vec4) FAdd 1295 1294 + Store 1244(texel) 1296 + 1301: 1298 Load 1300(sBuffer) + 1302: 52(float) Load 128(c1) + 1303: 47(int) ConvertFToS 1302 + 1304: 1297 Image 1301 + 1305: 7(f16vec4) ImageFetch 1304 1303 + 1306: 7(f16vec4) Load 1244(texel) + 1307: 7(f16vec4) FAdd 1306 1305 + Store 1244(texel) 1307 + 1312: 1309 Load 1311(s2DMS) + 1313: 53(fvec2) Load 148(c2) + 1314: 721(ivec2) ConvertFToS 1313 + 1315: 1308 Image 1312 + 1316: 7(f16vec4) ImageFetch 1315 1314 Sample 709 + 1317: 7(f16vec4) Load 1244(texel) + 1318: 7(f16vec4) FAdd 1317 1316 + Store 1244(texel) 1318 + 1323: 1320 Load 1322(s2DMSArray) + 1324: 167(fvec3) Load 169(c3) + 1325: 734(ivec3) ConvertFToS 1324 + 1327: 1319 Image 1323 + 1328: 7(f16vec4) ImageFetch 1327 1325 Sample 1326 + 1329: 7(f16vec4) Load 1244(texel) + 1330: 7(f16vec4) FAdd 1329 1328 + Store 1244(texel) 1330 + 1331: 7(f16vec4) Load 1244(texel) + ReturnValue 1331 + FunctionEnd +25(testTexelFetchOffset(): 7(f16vec4) Function None 8 + 26: Label + 1334(texel): 64(ptr) Variable Function + Store 1334(texel) 121 + 1335: 123 Load 125(s1D) + 1336: 52(float) Load 128(c1) + 1337: 47(int) ConvertFToS 1336 + 1338: 52(float) Load 565(lod) + 1339: 47(int) ConvertFToS 1338 + 1340: 122 Image 1335 + 1341: 7(f16vec4) ImageFetch 1340 1337 Lod ConstOffset 1339 709 + 1342: 7(f16vec4) Load 1334(texel) + 1343: 7(f16vec4) FAdd 1342 1341 + Store 1334(texel) 1343 + 1344: 143 Load 145(s2D) + 1345: 53(fvec2) Load 148(c2) + 1346: 721(ivec2) ConvertFToS 1345 + 1347: 52(float) Load 565(lod) + 1348: 47(int) ConvertFToS 1347 + 1349: 142 Image 1344 + 1350: 7(f16vec4) ImageFetch 1349 1346 Lod ConstOffset 1348 722 + 1351: 7(f16vec4) Load 1334(texel) + 1352: 7(f16vec4) FAdd 1351 1350 + Store 1334(texel) 1352 + 1353: 163 Load 165(s3D) + 1354: 167(fvec3) Load 169(c3) + 1355: 734(ivec3) ConvertFToS 1354 + 1356: 52(float) Load 565(lod) + 1357: 47(int) ConvertFToS 1356 + 1358: 162 Image 1353 + 1359: 7(f16vec4) ImageFetch 1358 1355 Lod ConstOffset 1357 735 + 1360: 7(f16vec4) Load 1334(texel) + 1361: 7(f16vec4) FAdd 1360 1359 + Store 1334(texel) 1361 + 1362: 357 Load 359(s2DRect) + 1363: 53(fvec2) Load 148(c2) + 1364: 721(ivec2) ConvertFToS 1363 + 1365: 356 Image 1362 + 1366: 7(f16vec4) ImageFetch 1365 1364 ConstOffset 722 + 1367: 7(f16vec4) Load 1334(texel) + 1368: 7(f16vec4) FAdd 1367 1366 + Store 1334(texel) 1368 + 1369: 269 Load 271(s1DArray) + 1370: 53(fvec2) Load 148(c2) + 1371: 721(ivec2) ConvertFToS 1370 + 1372: 52(float) Load 565(lod) + 1373: 47(int) ConvertFToS 1372 + 1374: 268 Image 1369 + 1375: 7(f16vec4) ImageFetch 1374 1371 Lod ConstOffset 1373 709 + 1376: 7(f16vec4) Load 1334(texel) + 1377: 7(f16vec4) FAdd 1376 1375 + Store 1334(texel) 1377 + 1378: 284 Load 286(s2DArray) + 1379: 167(fvec3) Load 169(c3) + 1380: 734(ivec3) ConvertFToS 1379 + 1381: 52(float) Load 565(lod) + 1382: 47(int) ConvertFToS 1381 + 1383: 283 Image 1378 + 1384: 7(f16vec4) ImageFetch 1383 1380 Lod ConstOffset 1382 722 + 1385: 7(f16vec4) Load 1334(texel) + 1386: 7(f16vec4) FAdd 1385 1384 + Store 1334(texel) 1386 + 1387: 7(f16vec4) Load 1334(texel) + ReturnValue 1387 + FunctionEnd +27(testTextureGrad(): 7(f16vec4) Function None 8 + 28: Label + 1390(texel): 64(ptr) Variable Function + Store 1390(texel) 121 + 1391: 123 Load 125(s1D) + 1392: 52(float) Load 128(c1) + 1394: 52(float) Load 1393(dPdxy1) + 1395: 52(float) Load 1393(dPdxy1) + 1396: 7(f16vec4) ImageSampleExplicitLod 1391 1392 Grad 1394 1395 + 1397: 7(f16vec4) Load 1390(texel) + 1398: 7(f16vec4) FAdd 1397 1396 + Store 1390(texel) 1398 + 1399: 123 Load 125(s1D) + 1400:6(float16_t) Load 135(f16c1) + 1402:6(float16_t) Load 1401(f16dPdxy1) + 1403:6(float16_t) Load 1401(f16dPdxy1) + 1404: 7(f16vec4) ImageSampleExplicitLod 1399 1400 Grad 1402 1403 + 1405: 7(f16vec4) Load 1390(texel) + 1406: 7(f16vec4) FAdd 1405 1404 + Store 1390(texel) 1406 + 1407: 143 Load 145(s2D) + 1408: 53(fvec2) Load 148(c2) + 1410: 53(fvec2) Load 1409(dPdxy2) + 1411: 53(fvec2) Load 1409(dPdxy2) + 1412: 7(f16vec4) ImageSampleExplicitLod 1407 1408 Grad 1410 1411 + 1413: 7(f16vec4) Load 1390(texel) + 1414: 7(f16vec4) FAdd 1413 1412 + Store 1390(texel) 1414 + 1415: 143 Load 145(s2D) + 1416:154(f16vec2) Load 156(f16c2) + 1418:154(f16vec2) Load 1417(f16dPdxy2) + 1419:154(f16vec2) Load 1417(f16dPdxy2) + 1420: 7(f16vec4) ImageSampleExplicitLod 1415 1416 Grad 1418 1419 + 1421: 7(f16vec4) Load 1390(texel) + 1422: 7(f16vec4) FAdd 1421 1420 + Store 1390(texel) 1422 + 1423: 163 Load 165(s3D) + 1424: 167(fvec3) Load 169(c3) + 1426: 167(fvec3) Load 1425(dPdxy3) + 1427: 167(fvec3) Load 1425(dPdxy3) + 1428: 7(f16vec4) ImageSampleExplicitLod 1423 1424 Grad 1426 1427 + 1429: 7(f16vec4) Load 1390(texel) + 1430: 7(f16vec4) FAdd 1429 1428 + Store 1390(texel) 1430 + 1431: 163 Load 165(s3D) + 1432:175(f16vec3) Load 177(f16c3) + 1434:175(f16vec3) Load 1433(f16dPdxy3) + 1435:175(f16vec3) Load 1433(f16dPdxy3) + 1436: 7(f16vec4) ImageSampleExplicitLod 1431 1432 Grad 1434 1435 + 1437: 7(f16vec4) Load 1390(texel) + 1438: 7(f16vec4) FAdd 1437 1436 + Store 1390(texel) 1438 + 1439: 184 Load 186(sCube) + 1440: 167(fvec3) Load 169(c3) + 1441: 167(fvec3) Load 1425(dPdxy3) + 1442: 167(fvec3) Load 1425(dPdxy3) + 1443: 7(f16vec4) ImageSampleExplicitLod 1439 1440 Grad 1441 1442 + 1444: 7(f16vec4) Load 1390(texel) + 1445: 7(f16vec4) FAdd 1444 1443 + Store 1390(texel) 1445 + 1446: 184 Load 186(sCube) + 1447:175(f16vec3) Load 177(f16c3) + 1448:175(f16vec3) Load 1433(f16dPdxy3) + 1449:175(f16vec3) Load 1433(f16dPdxy3) + 1450: 7(f16vec4) ImageSampleExplicitLod 1446 1447 Grad 1448 1449 + 1451: 7(f16vec4) Load 1390(texel) + 1452: 7(f16vec4) FAdd 1451 1450 + Store 1390(texel) 1452 + 1453: 357 Load 359(s2DRect) + 1454: 53(fvec2) Load 148(c2) + 1455: 53(fvec2) Load 1409(dPdxy2) + 1456: 53(fvec2) Load 1409(dPdxy2) + 1457: 7(f16vec4) ImageSampleExplicitLod 1453 1454 Grad 1455 1456 + 1458: 7(f16vec4) Load 1390(texel) + 1459: 7(f16vec4) FAdd 1458 1457 + Store 1390(texel) 1459 + 1460: 357 Load 359(s2DRect) + 1461:154(f16vec2) Load 156(f16c2) + 1462:154(f16vec2) Load 1417(f16dPdxy2) + 1463:154(f16vec2) Load 1417(f16dPdxy2) + 1464: 7(f16vec4) ImageSampleExplicitLod 1460 1461 Grad 1462 1463 + 1465: 7(f16vec4) Load 1390(texel) + 1466: 7(f16vec4) FAdd 1465 1464 + Store 1390(texel) 1466 + 1467: 371 Load 373(s2DRectShadow) + 1468: 167(fvec3) Load 169(c3) + 1469: 53(fvec2) Load 1409(dPdxy2) + 1470: 53(fvec2) Load 1409(dPdxy2) + 1471: 52(float) CompositeExtract 1468 2 + 1472:6(float16_t) ImageSampleDrefExplicitLod 1467 1468 1471 Grad 1469 1470 + 1473: 208(ptr) AccessChain 1390(texel) 207 + 1474:6(float16_t) Load 1473 + 1475:6(float16_t) FAdd 1474 1472 + 1476: 208(ptr) AccessChain 1390(texel) 207 + Store 1476 1475 + 1477: 371 Load 373(s2DRectShadow) + 1478:154(f16vec2) Load 156(f16c2) + 1479: 52(float) Load 215(compare) + 1480:154(f16vec2) Load 1417(f16dPdxy2) + 1481:154(f16vec2) Load 1417(f16dPdxy2) + 1482:6(float16_t) ImageSampleDrefExplicitLod 1477 1478 1479 Grad 1480 1481 + 1483: 208(ptr) AccessChain 1390(texel) 207 + 1484:6(float16_t) Load 1483 + 1485:6(float16_t) FAdd 1484 1482 + 1486: 208(ptr) AccessChain 1390(texel) 207 + Store 1486 1485 + 1487: 199 Load 201(s1DShadow) + 1488: 167(fvec3) Load 169(c3) + 1489: 52(float) Load 1393(dPdxy1) + 1490: 52(float) Load 1393(dPdxy1) + 1491: 52(float) CompositeExtract 1488 2 + 1492:6(float16_t) ImageSampleDrefExplicitLod 1487 1488 1491 Grad 1489 1490 + 1493: 208(ptr) AccessChain 1390(texel) 207 + 1494:6(float16_t) Load 1493 + 1495:6(float16_t) FAdd 1494 1492 + 1496: 208(ptr) AccessChain 1390(texel) 207 + Store 1496 1495 + 1497: 199 Load 201(s1DShadow) + 1498:154(f16vec2) Load 156(f16c2) + 1499: 52(float) Load 215(compare) + 1500:6(float16_t) Load 1401(f16dPdxy1) + 1501:6(float16_t) Load 1401(f16dPdxy1) + 1502:6(float16_t) ImageSampleDrefExplicitLod 1497 1498 1499 Grad 1500 1501 + 1503: 208(ptr) AccessChain 1390(texel) 207 + 1504:6(float16_t) Load 1503 + 1505:6(float16_t) FAdd 1504 1502 + 1506: 208(ptr) AccessChain 1390(texel) 207 + Store 1506 1505 + 1507: 224 Load 226(s2DShadow) + 1508: 167(fvec3) Load 169(c3) + 1509: 53(fvec2) Load 1409(dPdxy2) + 1510: 53(fvec2) Load 1409(dPdxy2) + 1511: 52(float) CompositeExtract 1508 2 + 1512:6(float16_t) ImageSampleDrefExplicitLod 1507 1508 1511 Grad 1509 1510 + 1513: 208(ptr) AccessChain 1390(texel) 207 + 1514:6(float16_t) Load 1513 + 1515:6(float16_t) FAdd 1514 1512 + 1516: 208(ptr) AccessChain 1390(texel) 207 + Store 1516 1515 + 1517: 224 Load 226(s2DShadow) + 1518:154(f16vec2) Load 156(f16c2) + 1519: 52(float) Load 215(compare) + 1520:154(f16vec2) Load 1417(f16dPdxy2) + 1521:154(f16vec2) Load 1417(f16dPdxy2) + 1522:6(float16_t) ImageSampleDrefExplicitLod 1517 1518 1519 Grad 1520 1521 + 1523: 208(ptr) AccessChain 1390(texel) 207 + 1524:6(float16_t) Load 1523 + 1525:6(float16_t) FAdd 1524 1522 + 1526: 208(ptr) AccessChain 1390(texel) 207 + Store 1526 1525 + 1527: 245 Load 247(sCubeShadow) + 1528: 249(fvec4) Load 251(c4) + 1529: 167(fvec3) Load 1425(dPdxy3) + 1530: 167(fvec3) Load 1425(dPdxy3) + 1531: 52(float) CompositeExtract 1528 3 + 1532:6(float16_t) ImageSampleDrefExplicitLod 1527 1528 1531 Grad 1529 1530 + 1533: 208(ptr) AccessChain 1390(texel) 207 + 1534:6(float16_t) Load 1533 + 1535:6(float16_t) FAdd 1534 1532 + 1536: 208(ptr) AccessChain 1390(texel) 207 + Store 1536 1535 + 1537: 245 Load 247(sCubeShadow) + 1538:175(f16vec3) Load 177(f16c3) + 1539: 52(float) Load 215(compare) + 1540:175(f16vec3) Load 1433(f16dPdxy3) + 1541:175(f16vec3) Load 1433(f16dPdxy3) + 1542:6(float16_t) ImageSampleDrefExplicitLod 1537 1538 1539 Grad 1540 1541 + 1543: 208(ptr) AccessChain 1390(texel) 207 + 1544:6(float16_t) Load 1543 + 1545:6(float16_t) FAdd 1544 1542 + 1546: 208(ptr) AccessChain 1390(texel) 207 + Store 1546 1545 + 1547: 269 Load 271(s1DArray) + 1548: 53(fvec2) Load 148(c2) + 1549: 52(float) Load 1393(dPdxy1) + 1550: 52(float) Load 1393(dPdxy1) + 1551: 7(f16vec4) ImageSampleExplicitLod 1547 1548 Grad 1549 1550 + 1552: 7(f16vec4) Load 1390(texel) + 1553: 7(f16vec4) FAdd 1552 1551 + Store 1390(texel) 1553 + 1554: 269 Load 271(s1DArray) + 1555:154(f16vec2) Load 156(f16c2) + 1556:6(float16_t) Load 1401(f16dPdxy1) + 1557:6(float16_t) Load 1401(f16dPdxy1) + 1558: 7(f16vec4) ImageSampleExplicitLod 1554 1555 Grad 1556 1557 + 1559: 7(f16vec4) Load 1390(texel) + 1560: 7(f16vec4) FAdd 1559 1558 + Store 1390(texel) 1560 + 1561: 284 Load 286(s2DArray) + 1562: 167(fvec3) Load 169(c3) + 1563: 53(fvec2) Load 1409(dPdxy2) + 1564: 53(fvec2) Load 1409(dPdxy2) + 1565: 7(f16vec4) ImageSampleExplicitLod 1561 1562 Grad 1563 1564 + 1566: 7(f16vec4) Load 1390(texel) + 1567: 7(f16vec4) FAdd 1566 1565 + Store 1390(texel) 1567 + 1568: 284 Load 286(s2DArray) + 1569:175(f16vec3) Load 177(f16c3) + 1570:154(f16vec2) Load 1417(f16dPdxy2) + 1571:154(f16vec2) Load 1417(f16dPdxy2) + 1572: 7(f16vec4) ImageSampleExplicitLod 1568 1569 Grad 1570 1571 + 1573: 7(f16vec4) Load 1390(texel) + 1574: 7(f16vec4) FAdd 1573 1572 + Store 1390(texel) 1574 + 1575: 316 Load 318(s1DArrayShadow) + 1576: 167(fvec3) Load 169(c3) + 1577: 52(float) Load 1393(dPdxy1) + 1578: 52(float) Load 1393(dPdxy1) + 1579: 52(float) CompositeExtract 1576 2 + 1580:6(float16_t) ImageSampleDrefExplicitLod 1575 1576 1579 Grad 1577 1578 + 1581: 208(ptr) AccessChain 1390(texel) 207 + 1582:6(float16_t) Load 1581 + 1583:6(float16_t) FAdd 1582 1580 + 1584: 208(ptr) AccessChain 1390(texel) 207 + Store 1584 1583 + 1585: 316 Load 318(s1DArrayShadow) + 1586:154(f16vec2) Load 156(f16c2) + 1587: 52(float) Load 215(compare) + 1588:6(float16_t) Load 1401(f16dPdxy1) + 1589:6(float16_t) Load 1401(f16dPdxy1) + 1590:6(float16_t) ImageSampleDrefExplicitLod 1585 1586 1587 Grad 1588 1589 + 1591: 208(ptr) AccessChain 1390(texel) 207 + 1592:6(float16_t) Load 1591 + 1593:6(float16_t) FAdd 1592 1590 + 1594: 208(ptr) AccessChain 1390(texel) 207 + Store 1594 1593 + 1595: 337 Load 339(s2DArrayShadow) + 1596: 249(fvec4) Load 251(c4) + 1597: 53(fvec2) Load 1409(dPdxy2) + 1598: 53(fvec2) Load 1409(dPdxy2) + 1599: 52(float) CompositeExtract 1596 3 + 1600:6(float16_t) ImageSampleDrefExplicitLod 1595 1596 1599 Grad 1597 1598 + 1601: 208(ptr) AccessChain 1390(texel) 207 + 1602:6(float16_t) Load 1601 + 1603:6(float16_t) FAdd 1602 1600 + 1604: 208(ptr) AccessChain 1390(texel) 207 + Store 1604 1603 + 1605: 337 Load 339(s2DArrayShadow) + 1606:175(f16vec3) Load 177(f16c3) + 1607: 52(float) Load 215(compare) + 1608:154(f16vec2) Load 1417(f16dPdxy2) + 1609:154(f16vec2) Load 1417(f16dPdxy2) + 1610:6(float16_t) ImageSampleDrefExplicitLod 1605 1606 1607 Grad 1608 1609 + 1611: 208(ptr) AccessChain 1390(texel) 207 + 1612:6(float16_t) Load 1611 + 1613:6(float16_t) FAdd 1612 1610 + 1614: 208(ptr) AccessChain 1390(texel) 207 + Store 1614 1613 + 1615: 299 Load 301(sCubeArray) + 1616: 249(fvec4) Load 251(c4) + 1617: 167(fvec3) Load 1425(dPdxy3) + 1618: 167(fvec3) Load 1425(dPdxy3) + 1619: 7(f16vec4) ImageSampleExplicitLod 1615 1616 Grad 1617 1618 + 1620: 7(f16vec4) Load 1390(texel) + 1621: 7(f16vec4) FAdd 1620 1619 + Store 1390(texel) 1621 + 1622: 299 Load 301(sCubeArray) + 1623: 7(f16vec4) Load 309(f16c4) + 1624:175(f16vec3) Load 1433(f16dPdxy3) + 1625:175(f16vec3) Load 1433(f16dPdxy3) + 1626: 7(f16vec4) ImageSampleExplicitLod 1622 1623 Grad 1624 1625 + 1627: 7(f16vec4) Load 1390(texel) + 1628: 7(f16vec4) FAdd 1627 1626 + Store 1390(texel) 1628 + 1629: 7(f16vec4) Load 1390(texel) + ReturnValue 1629 + FunctionEnd +29(testTextureGradOffset(): 7(f16vec4) Function None 8 + 30: Label + 1632(texel): 64(ptr) Variable Function + Store 1632(texel) 121 + 1633: 123 Load 125(s1D) + 1634: 52(float) Load 128(c1) + 1635: 52(float) Load 1393(dPdxy1) + 1636: 52(float) Load 1393(dPdxy1) + 1637: 7(f16vec4) ImageSampleExplicitLod 1633 1634 Grad ConstOffset 1635 1636 709 + 1638: 7(f16vec4) Load 1632(texel) + 1639: 7(f16vec4) FAdd 1638 1637 + Store 1632(texel) 1639 + 1640: 123 Load 125(s1D) + 1641:6(float16_t) Load 135(f16c1) + 1642:6(float16_t) Load 1401(f16dPdxy1) + 1643:6(float16_t) Load 1401(f16dPdxy1) + 1644: 7(f16vec4) ImageSampleExplicitLod 1640 1641 Grad ConstOffset 1642 1643 709 + 1645: 7(f16vec4) Load 1632(texel) + 1646: 7(f16vec4) FAdd 1645 1644 + Store 1632(texel) 1646 + 1647: 143 Load 145(s2D) + 1648: 53(fvec2) Load 148(c2) + 1649: 53(fvec2) Load 1409(dPdxy2) + 1650: 53(fvec2) Load 1409(dPdxy2) + 1651: 7(f16vec4) ImageSampleExplicitLod 1647 1648 Grad ConstOffset 1649 1650 722 + 1652: 7(f16vec4) Load 1632(texel) + 1653: 7(f16vec4) FAdd 1652 1651 + Store 1632(texel) 1653 + 1654: 143 Load 145(s2D) + 1655:154(f16vec2) Load 156(f16c2) + 1656:154(f16vec2) Load 1417(f16dPdxy2) + 1657:154(f16vec2) Load 1417(f16dPdxy2) + 1658: 7(f16vec4) ImageSampleExplicitLod 1654 1655 Grad ConstOffset 1656 1657 722 + 1659: 7(f16vec4) Load 1632(texel) + 1660: 7(f16vec4) FAdd 1659 1658 + Store 1632(texel) 1660 + 1661: 163 Load 165(s3D) + 1662: 167(fvec3) Load 169(c3) + 1663: 167(fvec3) Load 1425(dPdxy3) + 1664: 167(fvec3) Load 1425(dPdxy3) + 1665: 7(f16vec4) ImageSampleExplicitLod 1661 1662 Grad ConstOffset 1663 1664 735 + 1666: 7(f16vec4) Load 1632(texel) + 1667: 7(f16vec4) FAdd 1666 1665 + Store 1632(texel) 1667 + 1668: 163 Load 165(s3D) + 1669:175(f16vec3) Load 177(f16c3) + 1670:175(f16vec3) Load 1433(f16dPdxy3) + 1671:175(f16vec3) Load 1433(f16dPdxy3) + 1672: 7(f16vec4) ImageSampleExplicitLod 1668 1669 Grad ConstOffset 1670 1671 735 + 1673: 7(f16vec4) Load 1632(texel) + 1674: 7(f16vec4) FAdd 1673 1672 + Store 1632(texel) 1674 + 1675: 357 Load 359(s2DRect) + 1676: 53(fvec2) Load 148(c2) + 1677: 53(fvec2) Load 1409(dPdxy2) + 1678: 53(fvec2) Load 1409(dPdxy2) + 1679: 7(f16vec4) ImageSampleExplicitLod 1675 1676 Grad ConstOffset 1677 1678 722 + 1680: 7(f16vec4) Load 1632(texel) + 1681: 7(f16vec4) FAdd 1680 1679 + Store 1632(texel) 1681 + 1682: 357 Load 359(s2DRect) + 1683:154(f16vec2) Load 156(f16c2) + 1684:154(f16vec2) Load 1417(f16dPdxy2) + 1685:154(f16vec2) Load 1417(f16dPdxy2) + 1686: 7(f16vec4) ImageSampleExplicitLod 1682 1683 Grad ConstOffset 1684 1685 722 + 1687: 7(f16vec4) Load 1632(texel) + 1688: 7(f16vec4) FAdd 1687 1686 + Store 1632(texel) 1688 + 1689: 371 Load 373(s2DRectShadow) + 1690: 167(fvec3) Load 169(c3) + 1691: 53(fvec2) Load 1409(dPdxy2) + 1692: 53(fvec2) Load 1409(dPdxy2) + 1693: 52(float) CompositeExtract 1690 2 + 1694:6(float16_t) ImageSampleDrefExplicitLod 1689 1690 1693 Grad ConstOffset 1691 1692 722 + 1695: 208(ptr) AccessChain 1632(texel) 207 + 1696:6(float16_t) Load 1695 + 1697:6(float16_t) FAdd 1696 1694 + 1698: 208(ptr) AccessChain 1632(texel) 207 + Store 1698 1697 + 1699: 371 Load 373(s2DRectShadow) + 1700:154(f16vec2) Load 156(f16c2) + 1701: 52(float) Load 215(compare) + 1702:154(f16vec2) Load 1417(f16dPdxy2) + 1703:154(f16vec2) Load 1417(f16dPdxy2) + 1704:6(float16_t) ImageSampleDrefExplicitLod 1699 1700 1701 Grad ConstOffset 1702 1703 722 + 1705: 208(ptr) AccessChain 1632(texel) 207 + 1706:6(float16_t) Load 1705 + 1707:6(float16_t) FAdd 1706 1704 + 1708: 208(ptr) AccessChain 1632(texel) 207 + Store 1708 1707 + 1709: 199 Load 201(s1DShadow) + 1710: 167(fvec3) Load 169(c3) + 1711: 52(float) Load 1393(dPdxy1) + 1712: 52(float) Load 1393(dPdxy1) + 1713: 52(float) CompositeExtract 1710 2 + 1714:6(float16_t) ImageSampleDrefExplicitLod 1709 1710 1713 Grad ConstOffset 1711 1712 709 + 1715: 208(ptr) AccessChain 1632(texel) 207 + 1716:6(float16_t) Load 1715 + 1717:6(float16_t) FAdd 1716 1714 + 1718: 208(ptr) AccessChain 1632(texel) 207 + Store 1718 1717 + 1719: 199 Load 201(s1DShadow) + 1720:154(f16vec2) Load 156(f16c2) + 1721: 52(float) Load 215(compare) + 1722:6(float16_t) Load 1401(f16dPdxy1) + 1723:6(float16_t) Load 1401(f16dPdxy1) + 1724:6(float16_t) ImageSampleDrefExplicitLod 1719 1720 1721 Grad ConstOffset 1722 1723 709 + 1725: 208(ptr) AccessChain 1632(texel) 207 + 1726:6(float16_t) Load 1725 + 1727:6(float16_t) FAdd 1726 1724 + 1728: 208(ptr) AccessChain 1632(texel) 207 + Store 1728 1727 + 1729: 224 Load 226(s2DShadow) + 1730: 167(fvec3) Load 169(c3) + 1731: 53(fvec2) Load 1409(dPdxy2) + 1732: 53(fvec2) Load 1409(dPdxy2) + 1733: 52(float) CompositeExtract 1730 2 + 1734:6(float16_t) ImageSampleDrefExplicitLod 1729 1730 1733 Grad ConstOffset 1731 1732 722 + 1735: 208(ptr) AccessChain 1632(texel) 207 + 1736:6(float16_t) Load 1735 + 1737:6(float16_t) FAdd 1736 1734 + 1738: 208(ptr) AccessChain 1632(texel) 207 + Store 1738 1737 + 1739: 224 Load 226(s2DShadow) + 1740:154(f16vec2) Load 156(f16c2) + 1741: 52(float) Load 215(compare) + 1742:154(f16vec2) Load 1417(f16dPdxy2) + 1743:154(f16vec2) Load 1417(f16dPdxy2) + 1744:6(float16_t) ImageSampleDrefExplicitLod 1739 1740 1741 Grad ConstOffset 1742 1743 722 + 1745: 208(ptr) AccessChain 1632(texel) 207 + 1746:6(float16_t) Load 1745 + 1747:6(float16_t) FAdd 1746 1744 + 1748: 208(ptr) AccessChain 1632(texel) 207 + Store 1748 1747 + 1749: 269 Load 271(s1DArray) + 1750: 53(fvec2) Load 148(c2) + 1751: 52(float) Load 1393(dPdxy1) + 1752: 52(float) Load 1393(dPdxy1) + 1753: 7(f16vec4) ImageSampleExplicitLod 1749 1750 Grad ConstOffset 1751 1752 709 + 1754: 7(f16vec4) Load 1632(texel) + 1755: 7(f16vec4) FAdd 1754 1753 + Store 1632(texel) 1755 + 1756: 269 Load 271(s1DArray) + 1757:154(f16vec2) Load 156(f16c2) + 1758:6(float16_t) Load 1401(f16dPdxy1) + 1759:6(float16_t) Load 1401(f16dPdxy1) + 1760: 7(f16vec4) ImageSampleExplicitLod 1756 1757 Grad ConstOffset 1758 1759 709 + 1761: 7(f16vec4) Load 1632(texel) + 1762: 7(f16vec4) FAdd 1761 1760 + Store 1632(texel) 1762 + 1763: 284 Load 286(s2DArray) + 1764: 167(fvec3) Load 169(c3) + 1765: 53(fvec2) Load 1409(dPdxy2) + 1766: 53(fvec2) Load 1409(dPdxy2) + 1767: 7(f16vec4) ImageSampleExplicitLod 1763 1764 Grad ConstOffset 1765 1766 722 + 1768: 7(f16vec4) Load 1632(texel) + 1769: 7(f16vec4) FAdd 1768 1767 + Store 1632(texel) 1769 + 1770: 284 Load 286(s2DArray) + 1771:175(f16vec3) Load 177(f16c3) + 1772:154(f16vec2) Load 1417(f16dPdxy2) + 1773:154(f16vec2) Load 1417(f16dPdxy2) + 1774: 7(f16vec4) ImageSampleExplicitLod 1770 1771 Grad ConstOffset 1772 1773 722 + 1775: 7(f16vec4) Load 1632(texel) + 1776: 7(f16vec4) FAdd 1775 1774 + Store 1632(texel) 1776 + 1777: 316 Load 318(s1DArrayShadow) + 1778: 167(fvec3) Load 169(c3) + 1779: 52(float) Load 1393(dPdxy1) + 1780: 52(float) Load 1393(dPdxy1) + 1781: 52(float) CompositeExtract 1778 2 + 1782:6(float16_t) ImageSampleDrefExplicitLod 1777 1778 1781 Grad ConstOffset 1779 1780 709 + 1783: 208(ptr) AccessChain 1632(texel) 207 + 1784:6(float16_t) Load 1783 + 1785:6(float16_t) FAdd 1784 1782 + 1786: 208(ptr) AccessChain 1632(texel) 207 + Store 1786 1785 + 1787: 316 Load 318(s1DArrayShadow) + 1788:154(f16vec2) Load 156(f16c2) + 1789: 52(float) Load 215(compare) + 1790:6(float16_t) Load 1401(f16dPdxy1) + 1791:6(float16_t) Load 1401(f16dPdxy1) + 1792:6(float16_t) ImageSampleDrefExplicitLod 1787 1788 1789 Grad ConstOffset 1790 1791 709 + 1793: 208(ptr) AccessChain 1632(texel) 207 + 1794:6(float16_t) Load 1793 + 1795:6(float16_t) FAdd 1794 1792 + 1796: 208(ptr) AccessChain 1632(texel) 207 + Store 1796 1795 + 1797: 337 Load 339(s2DArrayShadow) + 1798: 249(fvec4) Load 251(c4) + 1799: 53(fvec2) Load 1409(dPdxy2) + 1800: 53(fvec2) Load 1409(dPdxy2) + 1801: 52(float) CompositeExtract 1798 3 + 1802:6(float16_t) ImageSampleDrefExplicitLod 1797 1798 1801 Grad ConstOffset 1799 1800 722 + 1803: 208(ptr) AccessChain 1632(texel) 207 + 1804:6(float16_t) Load 1803 + 1805:6(float16_t) FAdd 1804 1802 + 1806: 208(ptr) AccessChain 1632(texel) 207 + Store 1806 1805 + 1807: 337 Load 339(s2DArrayShadow) + 1808:175(f16vec3) Load 177(f16c3) + 1809: 52(float) Load 215(compare) + 1810:154(f16vec2) Load 1417(f16dPdxy2) + 1811:154(f16vec2) Load 1417(f16dPdxy2) + 1812:6(float16_t) ImageSampleDrefExplicitLod 1807 1808 1809 Grad ConstOffset 1810 1811 722 + 1813: 208(ptr) AccessChain 1632(texel) 207 + 1814:6(float16_t) Load 1813 + 1815:6(float16_t) FAdd 1814 1812 + 1816: 208(ptr) AccessChain 1632(texel) 207 + Store 1816 1815 + 1817: 7(f16vec4) Load 1632(texel) + ReturnValue 1817 + FunctionEnd +31(testTextureProjGrad(): 7(f16vec4) Function None 8 + 32: Label + 1820(texel): 64(ptr) Variable Function + Store 1820(texel) 121 + 1821: 123 Load 125(s1D) + 1822: 53(fvec2) Load 148(c2) + 1823: 52(float) Load 1393(dPdxy1) + 1824: 52(float) Load 1393(dPdxy1) + 1825: 7(f16vec4) ImageSampleProjExplicitLod 1821 1822 Grad 1823 1824 + 1826: 7(f16vec4) Load 1820(texel) + 1827: 7(f16vec4) FAdd 1826 1825 + Store 1820(texel) 1827 + 1828: 123 Load 125(s1D) + 1829:154(f16vec2) Load 156(f16c2) + 1830:6(float16_t) Load 1401(f16dPdxy1) + 1831:6(float16_t) Load 1401(f16dPdxy1) + 1832: 7(f16vec4) ImageSampleProjExplicitLod 1828 1829 Grad 1830 1831 + 1833: 7(f16vec4) Load 1820(texel) + 1834: 7(f16vec4) FAdd 1833 1832 + Store 1820(texel) 1834 + 1835: 123 Load 125(s1D) + 1836: 249(fvec4) Load 251(c4) + 1837: 52(float) Load 1393(dPdxy1) + 1838: 52(float) Load 1393(dPdxy1) + 1839: 52(float) CompositeExtract 1836 3 + 1840: 249(fvec4) CompositeInsert 1839 1836 1 + 1841: 7(f16vec4) ImageSampleProjExplicitLod 1835 1840 Grad 1837 1838 + 1842: 7(f16vec4) Load 1820(texel) + 1843: 7(f16vec4) FAdd 1842 1841 + Store 1820(texel) 1843 + 1844: 123 Load 125(s1D) + 1845: 7(f16vec4) Load 309(f16c4) + 1846:6(float16_t) Load 1401(f16dPdxy1) + 1847:6(float16_t) Load 1401(f16dPdxy1) + 1848:6(float16_t) CompositeExtract 1845 3 + 1849: 7(f16vec4) CompositeInsert 1848 1845 1 + 1850: 7(f16vec4) ImageSampleProjExplicitLod 1844 1849 Grad 1846 1847 + 1851: 7(f16vec4) Load 1820(texel) + 1852: 7(f16vec4) FAdd 1851 1850 + Store 1820(texel) 1852 + 1853: 143 Load 145(s2D) + 1854: 167(fvec3) Load 169(c3) + 1855: 53(fvec2) Load 1409(dPdxy2) + 1856: 53(fvec2) Load 1409(dPdxy2) + 1857: 7(f16vec4) ImageSampleProjExplicitLod 1853 1854 Grad 1855 1856 + 1858: 7(f16vec4) Load 1820(texel) + 1859: 7(f16vec4) FAdd 1858 1857 + Store 1820(texel) 1859 + 1860: 143 Load 145(s2D) + 1861:175(f16vec3) Load 177(f16c3) + 1862:154(f16vec2) Load 1417(f16dPdxy2) + 1863:154(f16vec2) Load 1417(f16dPdxy2) + 1864: 7(f16vec4) ImageSampleProjExplicitLod 1860 1861 Grad 1862 1863 + 1865: 7(f16vec4) Load 1820(texel) + 1866: 7(f16vec4) FAdd 1865 1864 + Store 1820(texel) 1866 + 1867: 143 Load 145(s2D) + 1868: 249(fvec4) Load 251(c4) + 1869: 53(fvec2) Load 1409(dPdxy2) + 1870: 53(fvec2) Load 1409(dPdxy2) + 1871: 52(float) CompositeExtract 1868 3 + 1872: 249(fvec4) CompositeInsert 1871 1868 2 + 1873: 7(f16vec4) ImageSampleProjExplicitLod 1867 1872 Grad 1869 1870 + 1874: 7(f16vec4) Load 1820(texel) + 1875: 7(f16vec4) FAdd 1874 1873 + Store 1820(texel) 1875 + 1876: 143 Load 145(s2D) + 1877: 7(f16vec4) Load 309(f16c4) + 1878:154(f16vec2) Load 1417(f16dPdxy2) + 1879:154(f16vec2) Load 1417(f16dPdxy2) + 1880:6(float16_t) CompositeExtract 1877 3 + 1881: 7(f16vec4) CompositeInsert 1880 1877 2 + 1882: 7(f16vec4) ImageSampleProjExplicitLod 1876 1881 Grad 1878 1879 + 1883: 7(f16vec4) Load 1820(texel) + 1884: 7(f16vec4) FAdd 1883 1882 + Store 1820(texel) 1884 + 1885: 163 Load 165(s3D) + 1886: 249(fvec4) Load 251(c4) + 1887: 167(fvec3) Load 1425(dPdxy3) + 1888: 167(fvec3) Load 1425(dPdxy3) + 1889: 7(f16vec4) ImageSampleProjExplicitLod 1885 1886 Grad 1887 1888 + 1890: 7(f16vec4) Load 1820(texel) + 1891: 7(f16vec4) FAdd 1890 1889 + Store 1820(texel) 1891 + 1892: 163 Load 165(s3D) + 1893: 7(f16vec4) Load 309(f16c4) + 1894:175(f16vec3) Load 1433(f16dPdxy3) + 1895:175(f16vec3) Load 1433(f16dPdxy3) + 1896: 7(f16vec4) ImageSampleProjExplicitLod 1892 1893 Grad 1894 1895 + 1897: 7(f16vec4) Load 1820(texel) + 1898: 7(f16vec4) FAdd 1897 1896 + Store 1820(texel) 1898 + 1899: 357 Load 359(s2DRect) + 1900: 167(fvec3) Load 169(c3) + 1901: 53(fvec2) Load 1409(dPdxy2) + 1902: 53(fvec2) Load 1409(dPdxy2) + 1903: 7(f16vec4) ImageSampleProjExplicitLod 1899 1900 Grad 1901 1902 + 1904: 7(f16vec4) Load 1820(texel) + 1905: 7(f16vec4) FAdd 1904 1903 + Store 1820(texel) 1905 + 1906: 357 Load 359(s2DRect) + 1907:175(f16vec3) Load 177(f16c3) + 1908:154(f16vec2) Load 1417(f16dPdxy2) + 1909:154(f16vec2) Load 1417(f16dPdxy2) + 1910: 7(f16vec4) ImageSampleProjExplicitLod 1906 1907 Grad 1908 1909 + 1911: 7(f16vec4) Load 1820(texel) + 1912: 7(f16vec4) FAdd 1911 1910 + Store 1820(texel) 1912 + 1913: 357 Load 359(s2DRect) + 1914: 249(fvec4) Load 251(c4) + 1915: 53(fvec2) Load 1409(dPdxy2) + 1916: 53(fvec2) Load 1409(dPdxy2) + 1917: 52(float) CompositeExtract 1914 3 + 1918: 249(fvec4) CompositeInsert 1917 1914 2 + 1919: 7(f16vec4) ImageSampleProjExplicitLod 1913 1918 Grad 1915 1916 + 1920: 7(f16vec4) Load 1820(texel) + 1921: 7(f16vec4) FAdd 1920 1919 + Store 1820(texel) 1921 + 1922: 357 Load 359(s2DRect) + 1923: 7(f16vec4) Load 309(f16c4) + 1924:154(f16vec2) Load 1417(f16dPdxy2) + 1925:154(f16vec2) Load 1417(f16dPdxy2) + 1926:6(float16_t) CompositeExtract 1923 3 + 1927: 7(f16vec4) CompositeInsert 1926 1923 2 + 1928: 7(f16vec4) ImageSampleProjExplicitLod 1922 1927 Grad 1924 1925 + 1929: 7(f16vec4) Load 1820(texel) + 1930: 7(f16vec4) FAdd 1929 1928 + Store 1820(texel) 1930 + 1931: 371 Load 373(s2DRectShadow) + 1932: 249(fvec4) Load 251(c4) + 1933: 53(fvec2) Load 1409(dPdxy2) + 1934: 53(fvec2) Load 1409(dPdxy2) + 1935: 52(float) CompositeExtract 1932 2 + 1936: 52(float) CompositeExtract 1932 3 + 1937: 249(fvec4) CompositeInsert 1936 1932 2 + 1938:6(float16_t) ImageSampleProjDrefExplicitLod 1931 1937 1935 Grad 1933 1934 + 1939: 208(ptr) AccessChain 1820(texel) 207 + 1940:6(float16_t) Load 1939 + 1941:6(float16_t) FAdd 1940 1938 + 1942: 208(ptr) AccessChain 1820(texel) 207 + Store 1942 1941 + 1943: 371 Load 373(s2DRectShadow) + 1944:175(f16vec3) Load 177(f16c3) + 1945: 52(float) Load 215(compare) + 1946:154(f16vec2) Load 1417(f16dPdxy2) + 1947:154(f16vec2) Load 1417(f16dPdxy2) + 1948:6(float16_t) ImageSampleProjDrefExplicitLod 1943 1944 1945 Grad 1946 1947 + 1949: 208(ptr) AccessChain 1820(texel) 207 + 1950:6(float16_t) Load 1949 + 1951:6(float16_t) FAdd 1950 1948 + 1952: 208(ptr) AccessChain 1820(texel) 207 + Store 1952 1951 + 1953: 199 Load 201(s1DShadow) + 1954: 249(fvec4) Load 251(c4) + 1955: 52(float) Load 1393(dPdxy1) + 1956: 52(float) Load 1393(dPdxy1) + 1957: 52(float) CompositeExtract 1954 2 + 1958: 52(float) CompositeExtract 1954 3 + 1959: 249(fvec4) CompositeInsert 1958 1954 1 + 1960:6(float16_t) ImageSampleProjDrefExplicitLod 1953 1959 1957 Grad 1955 1956 + 1961: 208(ptr) AccessChain 1820(texel) 207 + 1962:6(float16_t) Load 1961 + 1963:6(float16_t) FAdd 1962 1960 + 1964: 208(ptr) AccessChain 1820(texel) 207 + Store 1964 1963 + 1965: 199 Load 201(s1DShadow) + 1966:175(f16vec3) Load 177(f16c3) + 1967: 52(float) Load 215(compare) + 1968:6(float16_t) Load 1401(f16dPdxy1) + 1969:6(float16_t) Load 1401(f16dPdxy1) + 1970:6(float16_t) CompositeExtract 1966 2 + 1971:175(f16vec3) CompositeInsert 1970 1966 1 + 1972:6(float16_t) ImageSampleProjDrefExplicitLod 1965 1971 1967 Grad 1968 1969 + 1973: 208(ptr) AccessChain 1820(texel) 207 + 1974:6(float16_t) Load 1973 + 1975:6(float16_t) FAdd 1974 1972 + 1976: 208(ptr) AccessChain 1820(texel) 207 + Store 1976 1975 + 1977: 224 Load 226(s2DShadow) + 1978: 249(fvec4) Load 251(c4) + 1979: 53(fvec2) Load 1409(dPdxy2) + 1980: 53(fvec2) Load 1409(dPdxy2) + 1981: 52(float) CompositeExtract 1978 2 + 1982: 52(float) CompositeExtract 1978 3 + 1983: 249(fvec4) CompositeInsert 1982 1978 2 + 1984:6(float16_t) ImageSampleProjDrefExplicitLod 1977 1983 1981 Grad 1979 1980 + 1985: 208(ptr) AccessChain 1820(texel) 207 + 1986:6(float16_t) Load 1985 + 1987:6(float16_t) FAdd 1986 1984 + 1988: 208(ptr) AccessChain 1820(texel) 207 + Store 1988 1987 + 1989: 224 Load 226(s2DShadow) + 1990:175(f16vec3) Load 177(f16c3) + 1991: 52(float) Load 215(compare) + 1992:154(f16vec2) Load 1417(f16dPdxy2) + 1993:154(f16vec2) Load 1417(f16dPdxy2) + 1994:6(float16_t) ImageSampleProjDrefExplicitLod 1989 1990 1991 Grad 1992 1993 + 1995: 208(ptr) AccessChain 1820(texel) 207 + 1996:6(float16_t) Load 1995 + 1997:6(float16_t) FAdd 1996 1994 + 1998: 208(ptr) AccessChain 1820(texel) 207 + Store 1998 1997 + 1999: 7(f16vec4) Load 1820(texel) + ReturnValue 1999 + FunctionEnd +33(testTextureProjGradoffset(): 7(f16vec4) Function None 8 + 34: Label + 2002(texel): 64(ptr) Variable Function + Store 2002(texel) 121 + 2003: 123 Load 125(s1D) + 2004: 53(fvec2) Load 148(c2) + 2005: 52(float) Load 1393(dPdxy1) + 2006: 52(float) Load 1393(dPdxy1) + 2007: 7(f16vec4) ImageSampleProjExplicitLod 2003 2004 Grad ConstOffset 2005 2006 709 + 2008: 7(f16vec4) Load 2002(texel) + 2009: 7(f16vec4) FAdd 2008 2007 + Store 2002(texel) 2009 + 2010: 123 Load 125(s1D) + 2011:154(f16vec2) Load 156(f16c2) + 2012:6(float16_t) Load 1401(f16dPdxy1) + 2013:6(float16_t) Load 1401(f16dPdxy1) + 2014: 7(f16vec4) ImageSampleProjExplicitLod 2010 2011 Grad ConstOffset 2012 2013 709 + 2015: 7(f16vec4) Load 2002(texel) + 2016: 7(f16vec4) FAdd 2015 2014 + Store 2002(texel) 2016 + 2017: 123 Load 125(s1D) + 2018: 249(fvec4) Load 251(c4) + 2019: 52(float) Load 1393(dPdxy1) + 2020: 52(float) Load 1393(dPdxy1) + 2021: 52(float) CompositeExtract 2018 3 + 2022: 249(fvec4) CompositeInsert 2021 2018 1 + 2023: 7(f16vec4) ImageSampleProjExplicitLod 2017 2022 Grad ConstOffset 2019 2020 709 + 2024: 7(f16vec4) Load 2002(texel) + 2025: 7(f16vec4) FAdd 2024 2023 + Store 2002(texel) 2025 + 2026: 123 Load 125(s1D) + 2027: 7(f16vec4) Load 309(f16c4) + 2028:6(float16_t) Load 1401(f16dPdxy1) + 2029:6(float16_t) Load 1401(f16dPdxy1) + 2030:6(float16_t) CompositeExtract 2027 3 + 2031: 7(f16vec4) CompositeInsert 2030 2027 1 + 2032: 7(f16vec4) ImageSampleProjExplicitLod 2026 2031 Grad ConstOffset 2028 2029 709 + 2033: 7(f16vec4) Load 2002(texel) + 2034: 7(f16vec4) FAdd 2033 2032 + Store 2002(texel) 2034 + 2035: 143 Load 145(s2D) + 2036: 167(fvec3) Load 169(c3) + 2037: 53(fvec2) Load 1409(dPdxy2) + 2038: 53(fvec2) Load 1409(dPdxy2) + 2039: 7(f16vec4) ImageSampleProjExplicitLod 2035 2036 Grad ConstOffset 2037 2038 722 + 2040: 7(f16vec4) Load 2002(texel) + 2041: 7(f16vec4) FAdd 2040 2039 + Store 2002(texel) 2041 + 2042: 143 Load 145(s2D) + 2043:175(f16vec3) Load 177(f16c3) + 2044:154(f16vec2) Load 1417(f16dPdxy2) + 2045:154(f16vec2) Load 1417(f16dPdxy2) + 2046: 7(f16vec4) ImageSampleProjExplicitLod 2042 2043 Grad ConstOffset 2044 2045 722 + 2047: 7(f16vec4) Load 2002(texel) + 2048: 7(f16vec4) FAdd 2047 2046 + Store 2002(texel) 2048 + 2049: 143 Load 145(s2D) + 2050: 249(fvec4) Load 251(c4) + 2051: 53(fvec2) Load 1409(dPdxy2) + 2052: 53(fvec2) Load 1409(dPdxy2) + 2053: 52(float) CompositeExtract 2050 3 + 2054: 249(fvec4) CompositeInsert 2053 2050 2 + 2055: 7(f16vec4) ImageSampleProjExplicitLod 2049 2054 Grad ConstOffset 2051 2052 722 + 2056: 7(f16vec4) Load 2002(texel) + 2057: 7(f16vec4) FAdd 2056 2055 + Store 2002(texel) 2057 + 2058: 143 Load 145(s2D) + 2059: 7(f16vec4) Load 309(f16c4) + 2060:154(f16vec2) Load 1417(f16dPdxy2) + 2061:154(f16vec2) Load 1417(f16dPdxy2) + 2062:6(float16_t) CompositeExtract 2059 3 + 2063: 7(f16vec4) CompositeInsert 2062 2059 2 + 2064: 7(f16vec4) ImageSampleProjExplicitLod 2058 2063 Grad ConstOffset 2060 2061 722 + 2065: 7(f16vec4) Load 2002(texel) + 2066: 7(f16vec4) FAdd 2065 2064 + Store 2002(texel) 2066 + 2067: 357 Load 359(s2DRect) + 2068: 167(fvec3) Load 169(c3) + 2069: 53(fvec2) Load 1409(dPdxy2) + 2070: 53(fvec2) Load 1409(dPdxy2) + 2071: 7(f16vec4) ImageSampleProjExplicitLod 2067 2068 Grad ConstOffset 2069 2070 722 + 2072: 7(f16vec4) Load 2002(texel) + 2073: 7(f16vec4) FAdd 2072 2071 + Store 2002(texel) 2073 + 2074: 357 Load 359(s2DRect) + 2075:175(f16vec3) Load 177(f16c3) + 2076:154(f16vec2) Load 1417(f16dPdxy2) + 2077:154(f16vec2) Load 1417(f16dPdxy2) + 2078: 7(f16vec4) ImageSampleProjExplicitLod 2074 2075 Grad ConstOffset 2076 2077 722 + 2079: 7(f16vec4) Load 2002(texel) + 2080: 7(f16vec4) FAdd 2079 2078 + Store 2002(texel) 2080 + 2081: 357 Load 359(s2DRect) + 2082: 249(fvec4) Load 251(c4) + 2083: 53(fvec2) Load 1409(dPdxy2) + 2084: 53(fvec2) Load 1409(dPdxy2) + 2085: 52(float) CompositeExtract 2082 3 + 2086: 249(fvec4) CompositeInsert 2085 2082 2 + 2087: 7(f16vec4) ImageSampleProjExplicitLod 2081 2086 Grad ConstOffset 2083 2084 722 + 2088: 7(f16vec4) Load 2002(texel) + 2089: 7(f16vec4) FAdd 2088 2087 + Store 2002(texel) 2089 + 2090: 357 Load 359(s2DRect) + 2091: 7(f16vec4) Load 309(f16c4) + 2092:154(f16vec2) Load 1417(f16dPdxy2) + 2093:154(f16vec2) Load 1417(f16dPdxy2) + 2094:6(float16_t) CompositeExtract 2091 3 + 2095: 7(f16vec4) CompositeInsert 2094 2091 2 + 2096: 7(f16vec4) ImageSampleProjExplicitLod 2090 2095 Grad ConstOffset 2092 2093 722 + 2097: 7(f16vec4) Load 2002(texel) + 2098: 7(f16vec4) FAdd 2097 2096 + Store 2002(texel) 2098 + 2099: 371 Load 373(s2DRectShadow) + 2100: 249(fvec4) Load 251(c4) + 2101: 53(fvec2) Load 1409(dPdxy2) + 2102: 53(fvec2) Load 1409(dPdxy2) + 2103: 52(float) CompositeExtract 2100 2 + 2104: 52(float) CompositeExtract 2100 3 + 2105: 249(fvec4) CompositeInsert 2104 2100 2 + 2106:6(float16_t) ImageSampleProjDrefExplicitLod 2099 2105 2103 Grad ConstOffset 2101 2102 722 + 2107: 208(ptr) AccessChain 2002(texel) 207 + 2108:6(float16_t) Load 2107 + 2109:6(float16_t) FAdd 2108 2106 + 2110: 208(ptr) AccessChain 2002(texel) 207 + Store 2110 2109 + 2111: 371 Load 373(s2DRectShadow) + 2112:175(f16vec3) Load 177(f16c3) + 2113: 52(float) Load 215(compare) + 2114:154(f16vec2) Load 1417(f16dPdxy2) + 2115:154(f16vec2) Load 1417(f16dPdxy2) + 2116:6(float16_t) ImageSampleProjDrefExplicitLod 2111 2112 2113 Grad ConstOffset 2114 2115 722 + 2117: 208(ptr) AccessChain 2002(texel) 207 + 2118:6(float16_t) Load 2117 + 2119:6(float16_t) FAdd 2118 2116 + 2120: 208(ptr) AccessChain 2002(texel) 207 + Store 2120 2119 + 2121: 163 Load 165(s3D) + 2122: 249(fvec4) Load 251(c4) + 2123: 167(fvec3) Load 1425(dPdxy3) + 2124: 167(fvec3) Load 1425(dPdxy3) + 2125: 7(f16vec4) ImageSampleProjExplicitLod 2121 2122 Grad ConstOffset 2123 2124 735 + 2126: 7(f16vec4) Load 2002(texel) + 2127: 7(f16vec4) FAdd 2126 2125 + Store 2002(texel) 2127 + 2128: 163 Load 165(s3D) + 2129: 7(f16vec4) Load 309(f16c4) + 2130:175(f16vec3) Load 1433(f16dPdxy3) + 2131:175(f16vec3) Load 1433(f16dPdxy3) + 2132: 7(f16vec4) ImageSampleProjExplicitLod 2128 2129 Grad ConstOffset 2130 2131 735 + 2133: 7(f16vec4) Load 2002(texel) + 2134: 7(f16vec4) FAdd 2133 2132 + Store 2002(texel) 2134 + 2135: 199 Load 201(s1DShadow) + 2136: 249(fvec4) Load 251(c4) + 2137: 52(float) Load 1393(dPdxy1) + 2138: 52(float) Load 1393(dPdxy1) + 2139: 52(float) CompositeExtract 2136 2 + 2140: 52(float) CompositeExtract 2136 3 + 2141: 249(fvec4) CompositeInsert 2140 2136 1 + 2142:6(float16_t) ImageSampleProjDrefExplicitLod 2135 2141 2139 Grad ConstOffset 2137 2138 709 + 2143: 208(ptr) AccessChain 2002(texel) 207 + 2144:6(float16_t) Load 2143 + 2145:6(float16_t) FAdd 2144 2142 + 2146: 208(ptr) AccessChain 2002(texel) 207 + Store 2146 2145 + 2147: 199 Load 201(s1DShadow) + 2148:175(f16vec3) Load 177(f16c3) + 2149: 52(float) Load 215(compare) + 2150:6(float16_t) Load 1401(f16dPdxy1) + 2151:6(float16_t) Load 1401(f16dPdxy1) + 2152:6(float16_t) CompositeExtract 2148 2 + 2153:175(f16vec3) CompositeInsert 2152 2148 1 + 2154:6(float16_t) ImageSampleProjDrefExplicitLod 2147 2153 2149 Grad ConstOffset 2150 2151 709 + 2155: 208(ptr) AccessChain 2002(texel) 207 + 2156:6(float16_t) Load 2155 + 2157:6(float16_t) FAdd 2156 2154 + 2158: 208(ptr) AccessChain 2002(texel) 207 + Store 2158 2157 + 2159: 224 Load 226(s2DShadow) + 2160: 249(fvec4) Load 251(c4) + 2161: 53(fvec2) Load 1409(dPdxy2) + 2162: 53(fvec2) Load 1409(dPdxy2) + 2163: 52(float) CompositeExtract 2160 2 + 2164: 52(float) CompositeExtract 2160 3 + 2165: 249(fvec4) CompositeInsert 2164 2160 2 + 2166:6(float16_t) ImageSampleProjDrefExplicitLod 2159 2165 2163 Grad ConstOffset 2161 2162 722 + 2167: 208(ptr) AccessChain 2002(texel) 207 + 2168:6(float16_t) Load 2167 + 2169:6(float16_t) FAdd 2168 2166 + 2170: 208(ptr) AccessChain 2002(texel) 207 + Store 2170 2169 + 2171: 224 Load 226(s2DShadow) + 2172:175(f16vec3) Load 177(f16c3) + 2173: 52(float) Load 215(compare) + 2174:154(f16vec2) Load 1417(f16dPdxy2) + 2175:154(f16vec2) Load 1417(f16dPdxy2) + 2176:6(float16_t) ImageSampleProjDrefExplicitLod 2171 2172 2173 Grad ConstOffset 2174 2175 722 + 2177: 208(ptr) AccessChain 2002(texel) 207 + 2178:6(float16_t) Load 2177 + 2179:6(float16_t) FAdd 2178 2176 + 2180: 208(ptr) AccessChain 2002(texel) 207 + Store 2180 2179 + 2181: 7(f16vec4) Load 2002(texel) + ReturnValue 2181 + FunctionEnd +35(testTextureGather(): 7(f16vec4) Function None 8 + 36: Label + 2184(texel): 64(ptr) Variable Function + Store 2184(texel) 121 + 2185: 143 Load 145(s2D) + 2186: 53(fvec2) Load 148(c2) + 2188: 7(f16vec4) ImageGather 2185 2186 2187 + 2189: 7(f16vec4) Load 2184(texel) + 2190: 7(f16vec4) FAdd 2189 2188 + Store 2184(texel) 2190 + 2191: 143 Load 145(s2D) + 2192:154(f16vec2) Load 156(f16c2) + 2193:6(float16_t) Load 137(f16bias) + 2194: 7(f16vec4) ImageGather 2191 2192 2187 Bias 2193 + 2195: 7(f16vec4) Load 2184(texel) + 2196: 7(f16vec4) FAdd 2195 2194 + Store 2184(texel) 2196 + 2197: 284 Load 286(s2DArray) + 2198: 167(fvec3) Load 169(c3) + 2199: 7(f16vec4) ImageGather 2197 2198 2187 + 2200: 7(f16vec4) Load 2184(texel) + 2201: 7(f16vec4) FAdd 2200 2199 + Store 2184(texel) 2201 + 2202: 284 Load 286(s2DArray) + 2203:175(f16vec3) Load 177(f16c3) + 2204:6(float16_t) Load 137(f16bias) + 2205: 7(f16vec4) ImageGather 2202 2203 2187 Bias 2204 + 2206: 7(f16vec4) Load 2184(texel) + 2207: 7(f16vec4) FAdd 2206 2205 + Store 2184(texel) 2207 + 2208: 184 Load 186(sCube) + 2209: 167(fvec3) Load 169(c3) + 2210: 7(f16vec4) ImageGather 2208 2209 2187 + 2211: 7(f16vec4) Load 2184(texel) + 2212: 7(f16vec4) FAdd 2211 2210 + Store 2184(texel) 2212 + 2213: 184 Load 186(sCube) + 2214:175(f16vec3) Load 177(f16c3) + 2215:6(float16_t) Load 137(f16bias) + 2216: 7(f16vec4) ImageGather 2213 2214 2187 Bias 2215 + 2217: 7(f16vec4) Load 2184(texel) + 2218: 7(f16vec4) FAdd 2217 2216 + Store 2184(texel) 2218 + 2219: 299 Load 301(sCubeArray) + 2220: 249(fvec4) Load 251(c4) + 2221: 7(f16vec4) ImageGather 2219 2220 2187 + 2222: 7(f16vec4) Load 2184(texel) + 2223: 7(f16vec4) FAdd 2222 2221 + Store 2184(texel) 2223 + 2224: 299 Load 301(sCubeArray) + 2225: 7(f16vec4) Load 309(f16c4) + 2226:6(float16_t) Load 137(f16bias) + 2227: 7(f16vec4) ImageGather 2224 2225 2187 Bias 2226 + 2228: 7(f16vec4) Load 2184(texel) + 2229: 7(f16vec4) FAdd 2228 2227 + Store 2184(texel) 2229 + 2230: 357 Load 359(s2DRect) + 2231: 53(fvec2) Load 148(c2) + 2232: 7(f16vec4) ImageGather 2230 2231 2187 + 2233: 7(f16vec4) Load 2184(texel) + 2234: 7(f16vec4) FAdd 2233 2232 + Store 2184(texel) 2234 + 2235: 357 Load 359(s2DRect) + 2236:154(f16vec2) Load 156(f16c2) + 2237: 7(f16vec4) ImageGather 2235 2236 2187 + 2238: 7(f16vec4) Load 2184(texel) + 2239: 7(f16vec4) FAdd 2238 2237 + Store 2184(texel) 2239 + 2240: 224 Load 226(s2DShadow) + 2241: 53(fvec2) Load 148(c2) + 2242: 52(float) Load 215(compare) + 2243: 7(f16vec4) ImageDrefGather 2240 2241 2242 + 2244: 7(f16vec4) Load 2184(texel) + 2245: 7(f16vec4) FAdd 2244 2243 + Store 2184(texel) 2245 + 2246: 224 Load 226(s2DShadow) + 2247:154(f16vec2) Load 156(f16c2) + 2248: 52(float) Load 215(compare) + 2249: 7(f16vec4) ImageDrefGather 2246 2247 2248 + 2250: 7(f16vec4) Load 2184(texel) + 2251: 7(f16vec4) FAdd 2250 2249 + Store 2184(texel) 2251 + 2252: 337 Load 339(s2DArrayShadow) + 2253: 167(fvec3) Load 169(c3) + 2254: 52(float) Load 215(compare) + 2255: 7(f16vec4) ImageDrefGather 2252 2253 2254 + 2256: 7(f16vec4) Load 2184(texel) + 2257: 7(f16vec4) FAdd 2256 2255 + Store 2184(texel) 2257 + 2258: 337 Load 339(s2DArrayShadow) + 2259:175(f16vec3) Load 177(f16c3) + 2260: 52(float) Load 215(compare) + 2261: 7(f16vec4) ImageDrefGather 2258 2259 2260 + 2262: 7(f16vec4) Load 2184(texel) + 2263: 7(f16vec4) FAdd 2262 2261 + Store 2184(texel) 2263 + 2264: 245 Load 247(sCubeShadow) + 2265: 167(fvec3) Load 169(c3) + 2266: 52(float) Load 215(compare) + 2267: 7(f16vec4) ImageDrefGather 2264 2265 2266 + 2268: 7(f16vec4) Load 2184(texel) + 2269: 7(f16vec4) FAdd 2268 2267 + Store 2184(texel) 2269 + 2270: 245 Load 247(sCubeShadow) + 2271:175(f16vec3) Load 177(f16c3) + 2272: 52(float) Load 215(compare) + 2273: 7(f16vec4) ImageDrefGather 2270 2271 2272 + 2274: 7(f16vec4) Load 2184(texel) + 2275: 7(f16vec4) FAdd 2274 2273 + Store 2184(texel) 2275 + 2276: 391 Load 393(sCubeArrayShadow) + 2277: 249(fvec4) Load 251(c4) + 2278: 52(float) Load 215(compare) + 2279: 7(f16vec4) ImageDrefGather 2276 2277 2278 + 2280: 7(f16vec4) Load 2184(texel) + 2281: 7(f16vec4) FAdd 2280 2279 + Store 2184(texel) 2281 + 2282: 391 Load 393(sCubeArrayShadow) + 2283: 7(f16vec4) Load 309(f16c4) + 2284: 52(float) Load 215(compare) + 2285: 7(f16vec4) ImageDrefGather 2282 2283 2284 + 2286: 7(f16vec4) Load 2184(texel) + 2287: 7(f16vec4) FAdd 2286 2285 + Store 2184(texel) 2287 + 2288: 371 Load 373(s2DRectShadow) + 2289: 53(fvec2) Load 148(c2) + 2290: 52(float) Load 215(compare) + 2291: 7(f16vec4) ImageDrefGather 2288 2289 2290 + 2292: 7(f16vec4) Load 2184(texel) + 2293: 7(f16vec4) FAdd 2292 2291 + Store 2184(texel) 2293 + 2294: 371 Load 373(s2DRectShadow) + 2295:154(f16vec2) Load 156(f16c2) + 2296: 52(float) Load 215(compare) + 2297: 7(f16vec4) ImageDrefGather 2294 2295 2296 + 2298: 7(f16vec4) Load 2184(texel) + 2299: 7(f16vec4) FAdd 2298 2297 + Store 2184(texel) 2299 + 2300: 7(f16vec4) Load 2184(texel) + ReturnValue 2300 + FunctionEnd +37(testTextureGatherOffset(): 7(f16vec4) Function None 8 + 38: Label + 2303(texel): 64(ptr) Variable Function + Store 2303(texel) 121 + 2304: 143 Load 145(s2D) + 2305: 53(fvec2) Load 148(c2) + 2306: 7(f16vec4) ImageGather 2304 2305 2187 ConstOffset 722 + 2307: 7(f16vec4) Load 2303(texel) + 2308: 7(f16vec4) FAdd 2307 2306 + Store 2303(texel) 2308 + 2309: 143 Load 145(s2D) + 2310:154(f16vec2) Load 156(f16c2) + 2311:6(float16_t) Load 137(f16bias) + 2312: 7(f16vec4) ImageGather 2309 2310 2187 Bias ConstOffset 2311 722 + 2313: 7(f16vec4) Load 2303(texel) + 2314: 7(f16vec4) FAdd 2313 2312 + Store 2303(texel) 2314 + 2315: 284 Load 286(s2DArray) + 2316: 167(fvec3) Load 169(c3) + 2317: 7(f16vec4) ImageGather 2315 2316 2187 ConstOffset 722 + 2318: 7(f16vec4) Load 2303(texel) + 2319: 7(f16vec4) FAdd 2318 2317 + Store 2303(texel) 2319 + 2320: 284 Load 286(s2DArray) + 2321:175(f16vec3) Load 177(f16c3) + 2322:6(float16_t) Load 137(f16bias) + 2323: 7(f16vec4) ImageGather 2320 2321 2187 Bias ConstOffset 2322 722 + 2324: 7(f16vec4) Load 2303(texel) + 2325: 7(f16vec4) FAdd 2324 2323 + Store 2303(texel) 2325 + 2326: 357 Load 359(s2DRect) + 2327: 53(fvec2) Load 148(c2) + 2328: 7(f16vec4) ImageGather 2326 2327 2187 ConstOffset 722 + 2329: 7(f16vec4) Load 2303(texel) + 2330: 7(f16vec4) FAdd 2329 2328 + Store 2303(texel) 2330 + 2331: 357 Load 359(s2DRect) + 2332:154(f16vec2) Load 156(f16c2) + 2333: 7(f16vec4) ImageGather 2331 2332 2187 ConstOffset 722 + 2334: 7(f16vec4) Load 2303(texel) + 2335: 7(f16vec4) FAdd 2334 2333 + Store 2303(texel) 2335 + 2336: 224 Load 226(s2DShadow) + 2337: 53(fvec2) Load 148(c2) + 2338: 52(float) Load 215(compare) + 2339: 7(f16vec4) ImageDrefGather 2336 2337 2338 ConstOffset 722 + 2340: 7(f16vec4) Load 2303(texel) + 2341: 7(f16vec4) FAdd 2340 2339 + Store 2303(texel) 2341 + 2342: 224 Load 226(s2DShadow) + 2343:154(f16vec2) Load 156(f16c2) + 2344: 52(float) Load 215(compare) + 2345: 7(f16vec4) ImageDrefGather 2342 2343 2344 ConstOffset 722 + 2346: 7(f16vec4) Load 2303(texel) + 2347: 7(f16vec4) FAdd 2346 2345 + Store 2303(texel) 2347 + 2348: 337 Load 339(s2DArrayShadow) + 2349: 167(fvec3) Load 169(c3) + 2350: 52(float) Load 215(compare) + 2351: 7(f16vec4) ImageDrefGather 2348 2349 2350 ConstOffset 722 + 2352: 7(f16vec4) Load 2303(texel) + 2353: 7(f16vec4) FAdd 2352 2351 + Store 2303(texel) 2353 + 2354: 337 Load 339(s2DArrayShadow) + 2355:175(f16vec3) Load 177(f16c3) + 2356: 52(float) Load 215(compare) + 2357: 7(f16vec4) ImageDrefGather 2354 2355 2356 ConstOffset 722 + 2358: 7(f16vec4) Load 2303(texel) + 2359: 7(f16vec4) FAdd 2358 2357 + Store 2303(texel) 2359 + 2360: 371 Load 373(s2DRectShadow) + 2361: 53(fvec2) Load 148(c2) + 2362: 52(float) Load 215(compare) + 2363: 7(f16vec4) ImageDrefGather 2360 2361 2362 ConstOffset 722 + 2364: 7(f16vec4) Load 2303(texel) + 2365: 7(f16vec4) FAdd 2364 2363 + Store 2303(texel) 2365 + 2366: 371 Load 373(s2DRectShadow) + 2367:154(f16vec2) Load 156(f16c2) + 2368: 52(float) Load 215(compare) + 2369: 7(f16vec4) ImageDrefGather 2366 2367 2368 ConstOffset 722 + 2370: 7(f16vec4) Load 2303(texel) + 2371: 7(f16vec4) FAdd 2370 2369 + Store 2303(texel) 2371 + 2372: 7(f16vec4) Load 2303(texel) + ReturnValue 2372 + FunctionEnd +39(testTextureGatherOffsets(): 7(f16vec4) Function None 8 + 40: Label + 2375(texel): 64(ptr) Variable Function + Store 2375(texel) 121 + 2376: 143 Load 145(s2D) + 2377: 53(fvec2) Load 148(c2) + 2381: 7(f16vec4) ImageGather 2376 2377 2187 ConstOffsets 2380 + 2382: 7(f16vec4) Load 2375(texel) + 2383: 7(f16vec4) FAdd 2382 2381 + Store 2375(texel) 2383 + 2384: 143 Load 145(s2D) + 2385:154(f16vec2) Load 156(f16c2) + 2386:6(float16_t) Load 137(f16bias) + 2387: 7(f16vec4) ImageGather 2384 2385 2187 Bias ConstOffsets 2386 2380 + 2388: 7(f16vec4) Load 2375(texel) + 2389: 7(f16vec4) FAdd 2388 2387 + Store 2375(texel) 2389 + 2390: 284 Load 286(s2DArray) + 2391: 167(fvec3) Load 169(c3) + 2392: 7(f16vec4) ImageGather 2390 2391 2187 ConstOffsets 2380 + 2393: 7(f16vec4) Load 2375(texel) + 2394: 7(f16vec4) FAdd 2393 2392 + Store 2375(texel) 2394 + 2395: 284 Load 286(s2DArray) + 2396:175(f16vec3) Load 177(f16c3) + 2397:6(float16_t) Load 137(f16bias) + 2398: 7(f16vec4) ImageGather 2395 2396 2187 Bias ConstOffsets 2397 2380 + 2399: 7(f16vec4) Load 2375(texel) + 2400: 7(f16vec4) FAdd 2399 2398 + Store 2375(texel) 2400 + 2401: 357 Load 359(s2DRect) + 2402: 53(fvec2) Load 148(c2) + 2403: 7(f16vec4) ImageGather 2401 2402 2187 ConstOffsets 2380 + 2404: 7(f16vec4) Load 2375(texel) + 2405: 7(f16vec4) FAdd 2404 2403 + Store 2375(texel) 2405 + 2406: 357 Load 359(s2DRect) + 2407:154(f16vec2) Load 156(f16c2) + 2408: 7(f16vec4) ImageGather 2406 2407 2187 ConstOffsets 2380 + 2409: 7(f16vec4) Load 2375(texel) + 2410: 7(f16vec4) FAdd 2409 2408 + Store 2375(texel) 2410 + 2411: 224 Load 226(s2DShadow) + 2412: 53(fvec2) Load 148(c2) + 2413: 52(float) Load 215(compare) + 2414: 7(f16vec4) ImageDrefGather 2411 2412 2413 ConstOffsets 2380 + 2415: 7(f16vec4) Load 2375(texel) + 2416: 7(f16vec4) FAdd 2415 2414 + Store 2375(texel) 2416 + 2417: 224 Load 226(s2DShadow) + 2418:154(f16vec2) Load 156(f16c2) + 2419: 52(float) Load 215(compare) + 2420: 7(f16vec4) ImageDrefGather 2417 2418 2419 ConstOffsets 2380 + 2421: 7(f16vec4) Load 2375(texel) + 2422: 7(f16vec4) FAdd 2421 2420 + Store 2375(texel) 2422 + 2423: 337 Load 339(s2DArrayShadow) + 2424: 167(fvec3) Load 169(c3) + 2425: 52(float) Load 215(compare) + 2426: 7(f16vec4) ImageDrefGather 2423 2424 2425 ConstOffsets 2380 + 2427: 7(f16vec4) Load 2375(texel) + 2428: 7(f16vec4) FAdd 2427 2426 + Store 2375(texel) 2428 + 2429: 337 Load 339(s2DArrayShadow) + 2430:175(f16vec3) Load 177(f16c3) + 2431: 52(float) Load 215(compare) + 2432: 7(f16vec4) ImageDrefGather 2429 2430 2431 ConstOffsets 2380 + 2433: 7(f16vec4) Load 2375(texel) + 2434: 7(f16vec4) FAdd 2433 2432 + Store 2375(texel) 2434 + 2435: 371 Load 373(s2DRectShadow) + 2436: 53(fvec2) Load 148(c2) + 2437: 52(float) Load 215(compare) + 2438: 7(f16vec4) ImageDrefGather 2435 2436 2437 ConstOffsets 2380 + 2439: 7(f16vec4) Load 2375(texel) + 2440: 7(f16vec4) FAdd 2439 2438 + Store 2375(texel) 2440 + 2441: 371 Load 373(s2DRectShadow) + 2442:154(f16vec2) Load 156(f16c2) + 2443: 52(float) Load 215(compare) + 2444: 7(f16vec4) ImageDrefGather 2441 2442 2443 ConstOffsets 2380 + 2445: 7(f16vec4) Load 2375(texel) + 2446: 7(f16vec4) FAdd 2445 2444 + Store 2375(texel) 2446 + 2447: 7(f16vec4) Load 2375(texel) + ReturnValue 2447 + FunctionEnd +41(testTextureGatherLod(): 7(f16vec4) Function None 8 + 42: Label + 2450(texel): 64(ptr) Variable Function + Store 2450(texel) 121 + 2451: 143 Load 145(s2D) + 2452: 53(fvec2) Load 148(c2) + 2453: 52(float) Load 565(lod) + 2454: 7(f16vec4) ImageGather 2451 2452 2187 Lod 2453 + 2455: 7(f16vec4) Load 2450(texel) + 2456: 7(f16vec4) FAdd 2455 2454 + Store 2450(texel) 2456 + 2457: 143 Load 145(s2D) + 2458:154(f16vec2) Load 156(f16c2) + 2459:6(float16_t) Load 572(f16lod) + 2460: 7(f16vec4) ImageGather 2457 2458 2187 Lod 2459 + 2461: 7(f16vec4) Load 2450(texel) + 2462: 7(f16vec4) FAdd 2461 2460 + Store 2450(texel) 2462 + 2463: 284 Load 286(s2DArray) + 2464: 167(fvec3) Load 169(c3) + 2465: 52(float) Load 565(lod) + 2466: 7(f16vec4) ImageGather 2463 2464 2187 Lod 2465 + 2467: 7(f16vec4) Load 2450(texel) + 2468: 7(f16vec4) FAdd 2467 2466 + Store 2450(texel) 2468 + 2469: 284 Load 286(s2DArray) + 2470:175(f16vec3) Load 177(f16c3) + 2471:6(float16_t) Load 572(f16lod) + 2472: 7(f16vec4) ImageGather 2469 2470 2187 Lod 2471 + 2473: 7(f16vec4) Load 2450(texel) + 2474: 7(f16vec4) FAdd 2473 2472 + Store 2450(texel) 2474 + 2475: 184 Load 186(sCube) + 2476: 167(fvec3) Load 169(c3) + 2477: 52(float) Load 565(lod) + 2478: 7(f16vec4) ImageGather 2475 2476 2187 Lod 2477 + 2479: 7(f16vec4) Load 2450(texel) + 2480: 7(f16vec4) FAdd 2479 2478 + Store 2450(texel) 2480 + 2481: 184 Load 186(sCube) + 2482:175(f16vec3) Load 177(f16c3) + 2483:6(float16_t) Load 572(f16lod) + 2484: 7(f16vec4) ImageGather 2481 2482 2187 Lod 2483 + 2485: 7(f16vec4) Load 2450(texel) + 2486: 7(f16vec4) FAdd 2485 2484 + Store 2450(texel) 2486 + 2487: 299 Load 301(sCubeArray) + 2488: 249(fvec4) Load 251(c4) + 2489: 52(float) Load 565(lod) + 2490: 7(f16vec4) ImageGather 2487 2488 2187 Lod 2489 + 2491: 7(f16vec4) Load 2450(texel) + 2492: 7(f16vec4) FAdd 2491 2490 + Store 2450(texel) 2492 + 2493: 299 Load 301(sCubeArray) + 2494: 7(f16vec4) Load 309(f16c4) + 2495:6(float16_t) Load 572(f16lod) + 2496: 7(f16vec4) ImageGather 2493 2494 2187 Lod 2495 + 2497: 7(f16vec4) Load 2450(texel) + 2498: 7(f16vec4) FAdd 2497 2496 + Store 2450(texel) 2498 + 2499: 7(f16vec4) Load 2450(texel) + ReturnValue 2499 + FunctionEnd +43(testTextureGatherLodOffset(): 7(f16vec4) Function None 8 + 44: Label + 2502(texel): 64(ptr) Variable Function + Store 2502(texel) 121 + 2503: 143 Load 145(s2D) + 2504: 53(fvec2) Load 148(c2) + 2505: 52(float) Load 565(lod) + 2506: 7(f16vec4) ImageGather 2503 2504 2187 Lod ConstOffset 2505 722 + 2507: 7(f16vec4) Load 2502(texel) + 2508: 7(f16vec4) FAdd 2507 2506 + Store 2502(texel) 2508 + 2509: 143 Load 145(s2D) + 2510:154(f16vec2) Load 156(f16c2) + 2511:6(float16_t) Load 572(f16lod) + 2512: 7(f16vec4) ImageGather 2509 2510 2187 Lod ConstOffset 2511 722 + 2513: 7(f16vec4) Load 2502(texel) + 2514: 7(f16vec4) FAdd 2513 2512 + Store 2502(texel) 2514 + 2515: 284 Load 286(s2DArray) + 2516: 167(fvec3) Load 169(c3) + 2517: 52(float) Load 565(lod) + 2518: 7(f16vec4) ImageGather 2515 2516 2187 Lod ConstOffset 2517 722 + 2519: 7(f16vec4) Load 2502(texel) + 2520: 7(f16vec4) FAdd 2519 2518 + Store 2502(texel) 2520 + 2521: 284 Load 286(s2DArray) + 2522:175(f16vec3) Load 177(f16c3) + 2523:6(float16_t) Load 572(f16lod) + 2524: 7(f16vec4) ImageGather 2521 2522 2187 Lod ConstOffset 2523 722 + 2525: 7(f16vec4) Load 2502(texel) + 2526: 7(f16vec4) FAdd 2525 2524 + Store 2502(texel) 2526 + 2527: 7(f16vec4) Load 2502(texel) + ReturnValue 2527 + FunctionEnd +45(testTextureGatherLodOffsets(): 7(f16vec4) Function None 8 + 46: Label + 2530(texel): 64(ptr) Variable Function + Store 2530(texel) 121 + 2531: 143 Load 145(s2D) + 2532: 53(fvec2) Load 148(c2) + 2533: 52(float) Load 565(lod) + 2534: 7(f16vec4) ImageGather 2531 2532 2187 Lod ConstOffsets 2533 2380 + 2535: 7(f16vec4) Load 2530(texel) + 2536: 7(f16vec4) FAdd 2535 2534 + Store 2530(texel) 2536 + 2537: 143 Load 145(s2D) + 2538:154(f16vec2) Load 156(f16c2) + 2539:6(float16_t) Load 572(f16lod) + 2540: 7(f16vec4) ImageGather 2537 2538 2187 Lod ConstOffsets 2539 2380 + 2541: 7(f16vec4) Load 2530(texel) + 2542: 7(f16vec4) FAdd 2541 2540 + Store 2530(texel) 2542 + 2543: 284 Load 286(s2DArray) + 2544: 167(fvec3) Load 169(c3) + 2545: 52(float) Load 565(lod) + 2546: 7(f16vec4) ImageGather 2543 2544 2187 Lod ConstOffsets 2545 2380 + 2547: 7(f16vec4) Load 2530(texel) + 2548: 7(f16vec4) FAdd 2547 2546 + Store 2530(texel) 2548 + 2549: 284 Load 286(s2DArray) + 2550:175(f16vec3) Load 177(f16c3) + 2551:6(float16_t) Load 572(f16lod) + 2552: 7(f16vec4) ImageGather 2549 2550 2187 Lod ConstOffsets 2551 2380 + 2553: 7(f16vec4) Load 2530(texel) + 2554: 7(f16vec4) FAdd 2553 2552 + Store 2530(texel) 2554 + 2555: 7(f16vec4) Load 2530(texel) + ReturnValue 2555 + FunctionEnd +50(testTextureSize(): 48(ivec4) Function None 49 + 51: Label + 2559(size): 2558(ptr) Variable Function + Store 2559(size) 2560 + 2561: 123 Load 125(s1D) + 2562: 52(float) Load 565(lod) + 2563: 47(int) ConvertFToS 2562 + 2564: 122 Image 2561 + 2565: 47(int) ImageQuerySizeLod 2564 2563 + 2567: 2566(ptr) AccessChain 2559(size) 207 + 2568: 47(int) Load 2567 + 2569: 47(int) IAdd 2568 2565 + 2570: 2566(ptr) AccessChain 2559(size) 207 + Store 2570 2569 + 2571: 143 Load 145(s2D) + 2572: 52(float) Load 565(lod) + 2573: 47(int) ConvertFToS 2572 + 2574: 142 Image 2571 + 2575: 721(ivec2) ImageQuerySizeLod 2574 2573 + 2576: 48(ivec4) Load 2559(size) + 2577: 721(ivec2) VectorShuffle 2576 2576 0 1 + 2578: 721(ivec2) IAdd 2577 2575 + 2579: 48(ivec4) Load 2559(size) + 2580: 48(ivec4) VectorShuffle 2579 2578 4 5 2 3 + Store 2559(size) 2580 + 2581: 163 Load 165(s3D) + 2582: 52(float) Load 565(lod) + 2583: 47(int) ConvertFToS 2582 + 2584: 162 Image 2581 + 2585: 734(ivec3) ImageQuerySizeLod 2584 2583 + 2586: 48(ivec4) Load 2559(size) + 2587: 734(ivec3) VectorShuffle 2586 2586 0 1 2 + 2588: 734(ivec3) IAdd 2587 2585 + 2589: 48(ivec4) Load 2559(size) + 2590: 48(ivec4) VectorShuffle 2589 2588 4 5 6 3 + Store 2559(size) 2590 + 2591: 184 Load 186(sCube) + 2592: 52(float) Load 565(lod) + 2593: 47(int) ConvertFToS 2592 + 2594: 183 Image 2591 + 2595: 721(ivec2) ImageQuerySizeLod 2594 2593 + 2596: 48(ivec4) Load 2559(size) + 2597: 721(ivec2) VectorShuffle 2596 2596 0 1 + 2598: 721(ivec2) IAdd 2597 2595 + 2599: 48(ivec4) Load 2559(size) + 2600: 48(ivec4) VectorShuffle 2599 2598 4 5 2 3 + Store 2559(size) 2600 + 2601: 199 Load 201(s1DShadow) + 2602: 52(float) Load 565(lod) + 2603: 47(int) ConvertFToS 2602 + 2604: 198 Image 2601 + 2605: 47(int) ImageQuerySizeLod 2604 2603 + 2606: 2566(ptr) AccessChain 2559(size) 207 + 2607: 47(int) Load 2606 + 2608: 47(int) IAdd 2607 2605 + 2609: 2566(ptr) AccessChain 2559(size) 207 + Store 2609 2608 + 2610: 224 Load 226(s2DShadow) + 2611: 52(float) Load 565(lod) + 2612: 47(int) ConvertFToS 2611 + 2613: 223 Image 2610 + 2614: 721(ivec2) ImageQuerySizeLod 2613 2612 + 2615: 48(ivec4) Load 2559(size) + 2616: 721(ivec2) VectorShuffle 2615 2615 0 1 + 2617: 721(ivec2) IAdd 2616 2614 + 2618: 48(ivec4) Load 2559(size) + 2619: 48(ivec4) VectorShuffle 2618 2617 4 5 2 3 + Store 2559(size) 2619 + 2620: 245 Load 247(sCubeShadow) + 2621: 52(float) Load 565(lod) + 2622: 47(int) ConvertFToS 2621 + 2623: 244 Image 2620 + 2624: 721(ivec2) ImageQuerySizeLod 2623 2622 + 2625: 48(ivec4) Load 2559(size) + 2626: 721(ivec2) VectorShuffle 2625 2625 0 1 + 2627: 721(ivec2) IAdd 2626 2624 + 2628: 48(ivec4) Load 2559(size) + 2629: 48(ivec4) VectorShuffle 2628 2627 4 5 2 3 + Store 2559(size) 2629 + 2630: 299 Load 301(sCubeArray) + 2631: 52(float) Load 565(lod) + 2632: 47(int) ConvertFToS 2631 + 2633: 298 Image 2630 + 2634: 734(ivec3) ImageQuerySizeLod 2633 2632 + 2635: 48(ivec4) Load 2559(size) + 2636: 734(ivec3) VectorShuffle 2635 2635 0 1 2 + 2637: 734(ivec3) IAdd 2636 2634 + 2638: 48(ivec4) Load 2559(size) + 2639: 48(ivec4) VectorShuffle 2638 2637 4 5 6 3 + Store 2559(size) 2639 + 2640: 391 Load 393(sCubeArrayShadow) + 2641: 52(float) Load 565(lod) + 2642: 47(int) ConvertFToS 2641 + 2643: 390 Image 2640 + 2644: 734(ivec3) ImageQuerySizeLod 2643 2642 + 2645: 48(ivec4) Load 2559(size) + 2646: 734(ivec3) VectorShuffle 2645 2645 0 1 2 + 2647: 734(ivec3) IAdd 2646 2644 + 2648: 48(ivec4) Load 2559(size) + 2649: 48(ivec4) VectorShuffle 2648 2647 4 5 6 3 + Store 2559(size) 2649 + 2650: 357 Load 359(s2DRect) + 2651: 356 Image 2650 + 2652: 721(ivec2) ImageQuerySize 2651 + 2653: 48(ivec4) Load 2559(size) + 2654: 721(ivec2) VectorShuffle 2653 2653 0 1 + 2655: 721(ivec2) IAdd 2654 2652 + 2656: 48(ivec4) Load 2559(size) + 2657: 48(ivec4) VectorShuffle 2656 2655 4 5 2 3 + Store 2559(size) 2657 + 2658: 371 Load 373(s2DRectShadow) + 2659: 370 Image 2658 + 2660: 721(ivec2) ImageQuerySize 2659 + 2661: 48(ivec4) Load 2559(size) + 2662: 721(ivec2) VectorShuffle 2661 2661 0 1 + 2663: 721(ivec2) IAdd 2662 2660 + 2664: 48(ivec4) Load 2559(size) + 2665: 48(ivec4) VectorShuffle 2664 2663 4 5 2 3 + Store 2559(size) 2665 + 2666: 269 Load 271(s1DArray) + 2667: 52(float) Load 565(lod) + 2668: 47(int) ConvertFToS 2667 + 2669: 268 Image 2666 + 2670: 721(ivec2) ImageQuerySizeLod 2669 2668 + 2671: 48(ivec4) Load 2559(size) + 2672: 721(ivec2) VectorShuffle 2671 2671 0 1 + 2673: 721(ivec2) IAdd 2672 2670 + 2674: 48(ivec4) Load 2559(size) + 2675: 48(ivec4) VectorShuffle 2674 2673 4 5 2 3 + Store 2559(size) 2675 + 2676: 284 Load 286(s2DArray) + 2677: 52(float) Load 565(lod) + 2678: 47(int) ConvertFToS 2677 + 2679: 283 Image 2676 + 2680: 734(ivec3) ImageQuerySizeLod 2679 2678 + 2681: 48(ivec4) Load 2559(size) + 2682: 734(ivec3) VectorShuffle 2681 2681 0 1 2 + 2683: 734(ivec3) IAdd 2682 2680 + 2684: 48(ivec4) Load 2559(size) + 2685: 48(ivec4) VectorShuffle 2684 2683 4 5 6 3 + Store 2559(size) 2685 + 2686: 316 Load 318(s1DArrayShadow) + 2687: 52(float) Load 565(lod) + 2688: 47(int) ConvertFToS 2687 + 2689: 315 Image 2686 + 2690: 721(ivec2) ImageQuerySizeLod 2689 2688 + 2691: 48(ivec4) Load 2559(size) + 2692: 721(ivec2) VectorShuffle 2691 2691 0 1 + 2693: 721(ivec2) IAdd 2692 2690 + 2694: 48(ivec4) Load 2559(size) + 2695: 48(ivec4) VectorShuffle 2694 2693 4 5 2 3 + Store 2559(size) 2695 + 2696: 337 Load 339(s2DArrayShadow) + 2697: 52(float) Load 565(lod) + 2698: 47(int) ConvertFToS 2697 + 2699: 336 Image 2696 + 2700: 734(ivec3) ImageQuerySizeLod 2699 2698 + 2701: 48(ivec4) Load 2559(size) + 2702: 734(ivec3) VectorShuffle 2701 2701 0 1 2 + 2703: 734(ivec3) IAdd 2702 2700 + 2704: 48(ivec4) Load 2559(size) + 2705: 48(ivec4) VectorShuffle 2704 2703 4 5 6 3 + Store 2559(size) 2705 + 2706: 1298 Load 1300(sBuffer) + 2707: 1297 Image 2706 + 2708: 47(int) ImageQuerySize 2707 + 2709: 2566(ptr) AccessChain 2559(size) 207 + 2710: 47(int) Load 2709 + 2711: 47(int) IAdd 2710 2708 + 2712: 2566(ptr) AccessChain 2559(size) 207 + Store 2712 2711 + 2713: 1309 Load 1311(s2DMS) + 2714: 1308 Image 2713 + 2715: 721(ivec2) ImageQuerySize 2714 + 2716: 48(ivec4) Load 2559(size) + 2717: 721(ivec2) VectorShuffle 2716 2716 0 1 + 2718: 721(ivec2) IAdd 2717 2715 + 2719: 48(ivec4) Load 2559(size) + 2720: 48(ivec4) VectorShuffle 2719 2718 4 5 2 3 + Store 2559(size) 2720 + 2721: 1320 Load 1322(s2DMSArray) + 2722: 1319 Image 2721 + 2723: 734(ivec3) ImageQuerySize 2722 + 2724: 48(ivec4) Load 2559(size) + 2725: 734(ivec3) VectorShuffle 2724 2724 0 1 2 + 2726: 734(ivec3) IAdd 2725 2723 + 2727: 48(ivec4) Load 2559(size) + 2728: 48(ivec4) VectorShuffle 2727 2726 4 5 6 3 + Store 2559(size) 2728 + 2729: 48(ivec4) Load 2559(size) + ReturnValue 2729 + FunctionEnd +55(testTextureQueryLod(): 53(fvec2) Function None 54 + 56: Label + 2733(lod): 2732(ptr) Variable Function + Store 2733(lod) 2735 + 2736: 123 Load 125(s1D) + 2737: 52(float) Load 128(c1) + 2738: 53(fvec2) ImageQueryLod 2736 2737 + 2739: 53(fvec2) Load 2733(lod) + 2740: 53(fvec2) FAdd 2739 2738 + Store 2733(lod) 2740 + 2741: 123 Load 125(s1D) + 2742:6(float16_t) Load 135(f16c1) + 2743:154(f16vec2) ImageQueryLod 2741 2742 + 2744: 53(fvec2) Load 2733(lod) + 2745: 53(fvec2) FAdd 2744 2743 + Store 2733(lod) 2745 + 2746: 143 Load 145(s2D) + 2747: 53(fvec2) Load 148(c2) + 2748: 53(fvec2) ImageQueryLod 2746 2747 + 2749: 53(fvec2) Load 2733(lod) + 2750: 53(fvec2) FAdd 2749 2748 + Store 2733(lod) 2750 + 2751: 143 Load 145(s2D) + 2752:154(f16vec2) Load 156(f16c2) + 2753:154(f16vec2) ImageQueryLod 2751 2752 + 2754: 53(fvec2) Load 2733(lod) + 2755: 53(fvec2) FAdd 2754 2753 + Store 2733(lod) 2755 + 2756: 163 Load 165(s3D) + 2757: 167(fvec3) Load 169(c3) + 2758: 53(fvec2) ImageQueryLod 2756 2757 + 2759: 53(fvec2) Load 2733(lod) + 2760: 53(fvec2) FAdd 2759 2758 + Store 2733(lod) 2760 + 2761: 163 Load 165(s3D) + 2762:175(f16vec3) Load 177(f16c3) + 2763:154(f16vec2) ImageQueryLod 2761 2762 + 2764: 53(fvec2) Load 2733(lod) + 2765: 53(fvec2) FAdd 2764 2763 + Store 2733(lod) 2765 + 2766: 184 Load 186(sCube) + 2767: 167(fvec3) Load 169(c3) + 2768: 53(fvec2) ImageQueryLod 2766 2767 + 2769: 53(fvec2) Load 2733(lod) + 2770: 53(fvec2) FAdd 2769 2768 + Store 2733(lod) 2770 + 2771: 184 Load 186(sCube) + 2772:175(f16vec3) Load 177(f16c3) + 2773:154(f16vec2) ImageQueryLod 2771 2772 + 2774: 53(fvec2) Load 2733(lod) + 2775: 53(fvec2) FAdd 2774 2773 + Store 2733(lod) 2775 + 2776: 269 Load 271(s1DArray) + 2777: 52(float) Load 128(c1) + 2778: 53(fvec2) ImageQueryLod 2776 2777 + 2779: 53(fvec2) Load 2733(lod) + 2780: 53(fvec2) FAdd 2779 2778 + Store 2733(lod) 2780 + 2781: 269 Load 271(s1DArray) + 2782:6(float16_t) Load 135(f16c1) + 2783:154(f16vec2) ImageQueryLod 2781 2782 + 2784: 53(fvec2) Load 2733(lod) + 2785: 53(fvec2) FAdd 2784 2783 + Store 2733(lod) 2785 + 2786: 284 Load 286(s2DArray) + 2787: 53(fvec2) Load 148(c2) + 2788: 53(fvec2) ImageQueryLod 2786 2787 + 2789: 53(fvec2) Load 2733(lod) + 2790: 53(fvec2) FAdd 2789 2788 + Store 2733(lod) 2790 + 2791: 284 Load 286(s2DArray) + 2792:154(f16vec2) Load 156(f16c2) + 2793:154(f16vec2) ImageQueryLod 2791 2792 + 2794: 53(fvec2) Load 2733(lod) + 2795: 53(fvec2) FAdd 2794 2793 + Store 2733(lod) 2795 + 2796: 299 Load 301(sCubeArray) + 2797: 167(fvec3) Load 169(c3) + 2798: 53(fvec2) ImageQueryLod 2796 2797 + 2799: 53(fvec2) Load 2733(lod) + 2800: 53(fvec2) FAdd 2799 2798 + Store 2733(lod) 2800 + 2801: 299 Load 301(sCubeArray) + 2802:175(f16vec3) Load 177(f16c3) + 2803:154(f16vec2) ImageQueryLod 2801 2802 + 2804: 53(fvec2) Load 2733(lod) + 2805: 53(fvec2) FAdd 2804 2803 + Store 2733(lod) 2805 + 2806: 199 Load 201(s1DShadow) + 2807: 52(float) Load 128(c1) + 2808: 53(fvec2) ImageQueryLod 2806 2807 + 2809: 53(fvec2) Load 2733(lod) + 2810: 53(fvec2) FAdd 2809 2808 + Store 2733(lod) 2810 + 2811: 199 Load 201(s1DShadow) + 2812:6(float16_t) Load 135(f16c1) + 2813:154(f16vec2) ImageQueryLod 2811 2812 + 2814: 53(fvec2) Load 2733(lod) + 2815: 53(fvec2) FAdd 2814 2813 + Store 2733(lod) 2815 + 2816: 224 Load 226(s2DShadow) + 2817: 53(fvec2) Load 148(c2) + 2818: 53(fvec2) ImageQueryLod 2816 2817 + 2819: 53(fvec2) Load 2733(lod) + 2820: 53(fvec2) FAdd 2819 2818 + Store 2733(lod) 2820 + 2821: 224 Load 226(s2DShadow) + 2822:154(f16vec2) Load 156(f16c2) + 2823:154(f16vec2) ImageQueryLod 2821 2822 + 2824: 53(fvec2) Load 2733(lod) + 2825: 53(fvec2) FAdd 2824 2823 + Store 2733(lod) 2825 + 2826: 391 Load 393(sCubeArrayShadow) + 2827: 167(fvec3) Load 169(c3) + 2828: 53(fvec2) ImageQueryLod 2826 2827 + 2829: 53(fvec2) Load 2733(lod) + 2830: 53(fvec2) FAdd 2829 2828 + Store 2733(lod) 2830 + 2831: 391 Load 393(sCubeArrayShadow) + 2832:175(f16vec3) Load 177(f16c3) + 2833:154(f16vec2) ImageQueryLod 2831 2832 + 2834: 53(fvec2) Load 2733(lod) + 2835: 53(fvec2) FAdd 2834 2833 + Store 2733(lod) 2835 + 2836: 316 Load 318(s1DArrayShadow) + 2837: 52(float) Load 128(c1) + 2838: 53(fvec2) ImageQueryLod 2836 2837 + 2839: 53(fvec2) Load 2733(lod) + 2840: 53(fvec2) FAdd 2839 2838 + Store 2733(lod) 2840 + 2841: 316 Load 318(s1DArrayShadow) + 2842:6(float16_t) Load 135(f16c1) + 2843:154(f16vec2) ImageQueryLod 2841 2842 + 2844: 53(fvec2) Load 2733(lod) + 2845: 53(fvec2) FAdd 2844 2843 + Store 2733(lod) 2845 + 2846: 337 Load 339(s2DArrayShadow) + 2847: 53(fvec2) Load 148(c2) + 2848: 53(fvec2) ImageQueryLod 2846 2847 + 2849: 53(fvec2) Load 2733(lod) + 2850: 53(fvec2) FAdd 2849 2848 + Store 2733(lod) 2850 + 2851: 337 Load 339(s2DArrayShadow) + 2852:154(f16vec2) Load 156(f16c2) + 2853:154(f16vec2) ImageQueryLod 2851 2852 + 2854: 53(fvec2) Load 2733(lod) + 2855: 53(fvec2) FAdd 2854 2853 + Store 2733(lod) 2855 + 2856: 391 Load 393(sCubeArrayShadow) + 2857: 167(fvec3) Load 169(c3) + 2858: 53(fvec2) ImageQueryLod 2856 2857 + 2859: 53(fvec2) Load 2733(lod) + 2860: 53(fvec2) FAdd 2859 2858 + Store 2733(lod) 2860 + 2861: 391 Load 393(sCubeArrayShadow) + 2862:175(f16vec3) Load 177(f16c3) + 2863:154(f16vec2) ImageQueryLod 2861 2862 + 2864: 53(fvec2) Load 2733(lod) + 2865: 53(fvec2) FAdd 2864 2863 + Store 2733(lod) 2865 + 2866: 53(fvec2) Load 2733(lod) + ReturnValue 2866 + FunctionEnd +58(testTextureQueryLevels(): 47(int) Function None 57 + 59: Label + 2869(levels): 2566(ptr) Variable Function + Store 2869(levels) 2187 + 2870: 123 Load 125(s1D) + 2871: 122 Image 2870 + 2872: 47(int) ImageQueryLevels 2871 + 2873: 47(int) Load 2869(levels) + 2874: 47(int) IAdd 2873 2872 + Store 2869(levels) 2874 + 2875: 143 Load 145(s2D) + 2876: 142 Image 2875 + 2877: 47(int) ImageQueryLevels 2876 + 2878: 47(int) Load 2869(levels) + 2879: 47(int) IAdd 2878 2877 + Store 2869(levels) 2879 + 2880: 163 Load 165(s3D) + 2881: 162 Image 2880 + 2882: 47(int) ImageQueryLevels 2881 + 2883: 47(int) Load 2869(levels) + 2884: 47(int) IAdd 2883 2882 + Store 2869(levels) 2884 + 2885: 184 Load 186(sCube) + 2886: 183 Image 2885 + 2887: 47(int) ImageQueryLevels 2886 + 2888: 47(int) Load 2869(levels) + 2889: 47(int) IAdd 2888 2887 + Store 2869(levels) 2889 + 2890: 199 Load 201(s1DShadow) + 2891: 198 Image 2890 + 2892: 47(int) ImageQueryLevels 2891 + 2893: 47(int) Load 2869(levels) + 2894: 47(int) IAdd 2893 2892 + Store 2869(levels) 2894 + 2895: 224 Load 226(s2DShadow) + 2896: 223 Image 2895 + 2897: 47(int) ImageQueryLevels 2896 + 2898: 47(int) Load 2869(levels) + 2899: 47(int) IAdd 2898 2897 + Store 2869(levels) 2899 + 2900: 245 Load 247(sCubeShadow) + 2901: 244 Image 2900 + 2902: 47(int) ImageQueryLevels 2901 + 2903: 47(int) Load 2869(levels) + 2904: 47(int) IAdd 2903 2902 + Store 2869(levels) 2904 + 2905: 299 Load 301(sCubeArray) + 2906: 298 Image 2905 + 2907: 47(int) ImageQueryLevels 2906 + 2908: 47(int) Load 2869(levels) + 2909: 47(int) IAdd 2908 2907 + Store 2869(levels) 2909 + 2910: 391 Load 393(sCubeArrayShadow) + 2911: 390 Image 2910 + 2912: 47(int) ImageQueryLevels 2911 + 2913: 47(int) Load 2869(levels) + 2914: 47(int) IAdd 2913 2912 + Store 2869(levels) 2914 + 2915: 269 Load 271(s1DArray) + 2916: 268 Image 2915 + 2917: 47(int) ImageQueryLevels 2916 + 2918: 47(int) Load 2869(levels) + 2919: 47(int) IAdd 2918 2917 + Store 2869(levels) 2919 + 2920: 284 Load 286(s2DArray) + 2921: 283 Image 2920 + 2922: 47(int) ImageQueryLevels 2921 + 2923: 47(int) Load 2869(levels) + 2924: 47(int) IAdd 2923 2922 + Store 2869(levels) 2924 + 2925: 316 Load 318(s1DArrayShadow) + 2926: 315 Image 2925 + 2927: 47(int) ImageQueryLevels 2926 + 2928: 47(int) Load 2869(levels) + 2929: 47(int) IAdd 2928 2927 + Store 2869(levels) 2929 + 2930: 337 Load 339(s2DArrayShadow) + 2931: 336 Image 2930 + 2932: 47(int) ImageQueryLevels 2931 + 2933: 47(int) Load 2869(levels) + 2934: 47(int) IAdd 2933 2932 + Store 2869(levels) 2934 + 2935: 47(int) Load 2869(levels) + ReturnValue 2935 + FunctionEnd +60(testTextureSamples(): 47(int) Function None 57 + 61: Label + 2938(samples): 2566(ptr) Variable Function + Store 2938(samples) 2187 + 2939: 1309 Load 1311(s2DMS) + 2940: 1308 Image 2939 + 2941: 47(int) ImageQuerySamples 2940 + 2942: 47(int) Load 2938(samples) + 2943: 47(int) IAdd 2942 2941 + Store 2938(samples) 2943 + 2944: 1320 Load 1322(s2DMSArray) + 2945: 1319 Image 2944 + 2946: 47(int) ImageQuerySamples 2945 + 2947: 47(int) Load 2938(samples) + 2948: 47(int) IAdd 2947 2946 + Store 2938(samples) 2948 + 2949: 47(int) Load 2938(samples) + ReturnValue 2949 + FunctionEnd +62(testImageLoad(): 7(f16vec4) Function None 8 + 63: Label + 2952(texel): 64(ptr) Variable Function + Store 2952(texel) 121 + 2956: 2953 Load 2955(i1D) + 2957: 52(float) Load 128(c1) + 2958: 47(int) ConvertFToS 2957 + 2959: 7(f16vec4) ImageRead 2956 2958 + 2960: 7(f16vec4) Load 2952(texel) + 2961: 7(f16vec4) FAdd 2960 2959 + Store 2952(texel) 2961 + 2965: 2962 Load 2964(i2D) + 2966: 53(fvec2) Load 148(c2) + 2967: 721(ivec2) ConvertFToS 2966 + 2968: 7(f16vec4) ImageRead 2965 2967 + 2969: 7(f16vec4) Load 2952(texel) + 2970: 7(f16vec4) FAdd 2969 2968 + Store 2952(texel) 2970 + 2974: 2971 Load 2973(i3D) + 2975: 167(fvec3) Load 169(c3) + 2976: 734(ivec3) ConvertFToS 2975 + 2977: 7(f16vec4) ImageRead 2974 2976 + 2978: 7(f16vec4) Load 2952(texel) + 2979: 7(f16vec4) FAdd 2978 2977 + Store 2952(texel) 2979 + 2983: 2980 Load 2982(i2DRect) + 2984: 53(fvec2) Load 148(c2) + 2985: 721(ivec2) ConvertFToS 2984 + 2986: 7(f16vec4) ImageRead 2983 2985 + 2987: 7(f16vec4) Load 2952(texel) + 2988: 7(f16vec4) FAdd 2987 2986 + Store 2952(texel) 2988 + 2992: 2989 Load 2991(iCube) + 2993: 167(fvec3) Load 169(c3) + 2994: 734(ivec3) ConvertFToS 2993 + 2995: 7(f16vec4) ImageRead 2992 2994 + 2996: 7(f16vec4) Load 2952(texel) + 2997: 7(f16vec4) FAdd 2996 2995 + Store 2952(texel) 2997 + 3001: 2998 Load 3000(iBuffer) + 3002: 52(float) Load 128(c1) + 3003: 47(int) ConvertFToS 3002 + 3004: 7(f16vec4) ImageRead 3001 3003 + 3005: 7(f16vec4) Load 2952(texel) + 3006: 7(f16vec4) FAdd 3005 3004 + Store 2952(texel) 3006 + 3010: 3007 Load 3009(i1DArray) + 3011: 53(fvec2) Load 148(c2) + 3012: 721(ivec2) ConvertFToS 3011 + 3013: 7(f16vec4) ImageRead 3010 3012 + 3014: 7(f16vec4) Load 2952(texel) + 3015: 7(f16vec4) FAdd 3014 3013 + Store 2952(texel) 3015 + 3019: 3016 Load 3018(i2DArray) + 3020: 167(fvec3) Load 169(c3) + 3021: 734(ivec3) ConvertFToS 3020 + 3022: 7(f16vec4) ImageRead 3019 3021 + 3023: 7(f16vec4) Load 2952(texel) + 3024: 7(f16vec4) FAdd 3023 3022 + Store 2952(texel) 3024 + 3028: 3025 Load 3027(iCubeArray) + 3029: 167(fvec3) Load 169(c3) + 3030: 734(ivec3) ConvertFToS 3029 + 3031: 7(f16vec4) ImageRead 3028 3030 + 3032: 7(f16vec4) Load 2952(texel) + 3033: 7(f16vec4) FAdd 3032 3031 + Store 2952(texel) 3033 + 3037: 3034 Load 3036(i2DMS) + 3038: 53(fvec2) Load 148(c2) + 3039: 721(ivec2) ConvertFToS 3038 + 3040: 7(f16vec4) ImageRead 3037 3039 Sample 709 + 3041: 7(f16vec4) Load 2952(texel) + 3042: 7(f16vec4) FAdd 3041 3040 + Store 2952(texel) 3042 + 3046: 3043 Load 3045(i2DMSArray) + 3047: 167(fvec3) Load 169(c3) + 3048: 734(ivec3) ConvertFToS 3047 + 3049: 7(f16vec4) ImageRead 3046 3048 Sample 709 + 3050: 7(f16vec4) Load 2952(texel) + 3051: 7(f16vec4) FAdd 3050 3049 + Store 2952(texel) 3051 + 3052: 7(f16vec4) Load 2952(texel) + ReturnValue 3052 + FunctionEnd +67(testImageStore(vf164;): 2 Function None 65 + 66(data): 64(ptr) FunctionParameter + 68: Label + 3055: 2953 Load 2955(i1D) + 3056: 52(float) Load 128(c1) + 3057: 47(int) ConvertFToS 3056 + 3058: 7(f16vec4) Load 66(data) + ImageWrite 3055 3057 3058 + 3059: 2962 Load 2964(i2D) + 3060: 53(fvec2) Load 148(c2) + 3061: 721(ivec2) ConvertFToS 3060 + 3062: 7(f16vec4) Load 66(data) + ImageWrite 3059 3061 3062 + 3063: 2971 Load 2973(i3D) + 3064: 167(fvec3) Load 169(c3) + 3065: 734(ivec3) ConvertFToS 3064 + 3066: 7(f16vec4) Load 66(data) + ImageWrite 3063 3065 3066 + 3067: 2980 Load 2982(i2DRect) + 3068: 53(fvec2) Load 148(c2) + 3069: 721(ivec2) ConvertFToS 3068 + 3070: 7(f16vec4) Load 66(data) + ImageWrite 3067 3069 3070 + 3071: 2989 Load 2991(iCube) + 3072: 167(fvec3) Load 169(c3) + 3073: 734(ivec3) ConvertFToS 3072 + 3074: 7(f16vec4) Load 66(data) + ImageWrite 3071 3073 3074 + 3075: 2998 Load 3000(iBuffer) + 3076: 52(float) Load 128(c1) + 3077: 47(int) ConvertFToS 3076 + 3078: 7(f16vec4) Load 66(data) + ImageWrite 3075 3077 3078 + 3079: 3007 Load 3009(i1DArray) + 3080: 53(fvec2) Load 148(c2) + 3081: 721(ivec2) ConvertFToS 3080 + 3082: 7(f16vec4) Load 66(data) + ImageWrite 3079 3081 3082 + 3083: 3016 Load 3018(i2DArray) + 3084: 167(fvec3) Load 169(c3) + 3085: 734(ivec3) ConvertFToS 3084 + 3086: 7(f16vec4) Load 66(data) + ImageWrite 3083 3085 3086 + 3087: 3025 Load 3027(iCubeArray) + 3088: 167(fvec3) Load 169(c3) + 3089: 734(ivec3) ConvertFToS 3088 + 3090: 7(f16vec4) Load 66(data) + ImageWrite 3087 3089 3090 + 3091: 3034 Load 3036(i2DMS) + 3092: 53(fvec2) Load 148(c2) + 3093: 721(ivec2) ConvertFToS 3092 + 3094: 7(f16vec4) Load 66(data) + ImageWrite 3091 3093 3094 Sample 709 + 3095: 3043 Load 3045(i2DMSArray) + 3096: 167(fvec3) Load 169(c3) + 3097: 734(ivec3) ConvertFToS 3096 + 3098: 7(f16vec4) Load 66(data) + ImageWrite 3095 3097 3098 Sample 709 + Return + FunctionEnd +69(testSparseTexture(): 7(f16vec4) Function None 8 + 70: Label + 3099(texel): 64(ptr) Variable Function + Store 3099(texel) 121 + 3100: 143 Load 145(s2D) + 3101: 53(fvec2) Load 148(c2) + 3103:3102(ResType) ImageSparseSampleImplicitLod 3100 3101 + 3104: 7(f16vec4) CompositeExtract 3103 1 + Store 3099(texel) 3104 + 3105: 47(int) CompositeExtract 3103 0 + 3106: 143 Load 145(s2D) + 3107:154(f16vec2) Load 156(f16c2) + 3108:6(float16_t) Load 137(f16bias) + 3109:3102(ResType) ImageSparseSampleImplicitLod 3106 3107 Bias 3108 + 3110: 7(f16vec4) CompositeExtract 3109 1 + Store 3099(texel) 3110 + 3111: 47(int) CompositeExtract 3109 0 + 3112: 163 Load 165(s3D) + 3113: 167(fvec3) Load 169(c3) + 3114:3102(ResType) ImageSparseSampleImplicitLod 3112 3113 + 3115: 7(f16vec4) CompositeExtract 3114 1 + Store 3099(texel) 3115 + 3116: 47(int) CompositeExtract 3114 0 + 3117: 163 Load 165(s3D) + 3118:175(f16vec3) Load 177(f16c3) + 3119:6(float16_t) Load 137(f16bias) + 3120:3102(ResType) ImageSparseSampleImplicitLod 3117 3118 Bias 3119 + 3121: 7(f16vec4) CompositeExtract 3120 1 + Store 3099(texel) 3121 + 3122: 47(int) CompositeExtract 3120 0 + 3123: 184 Load 186(sCube) + 3124: 167(fvec3) Load 169(c3) + 3125:3102(ResType) ImageSparseSampleImplicitLod 3123 3124 + 3126: 7(f16vec4) CompositeExtract 3125 1 + Store 3099(texel) 3126 + 3127: 47(int) CompositeExtract 3125 0 + 3128: 184 Load 186(sCube) + 3129:175(f16vec3) Load 177(f16c3) + 3130:6(float16_t) Load 137(f16bias) + 3131:3102(ResType) ImageSparseSampleImplicitLod 3128 3129 Bias 3130 + 3132: 7(f16vec4) CompositeExtract 3131 1 + Store 3099(texel) 3132 + 3133: 47(int) CompositeExtract 3131 0 + 3134: 224 Load 226(s2DShadow) + 3135: 167(fvec3) Load 169(c3) + 3136: 208(ptr) AccessChain 3099(texel) 207 + 3137: 52(float) CompositeExtract 3135 2 + 3139:3138(ResType) ImageSparseSampleDrefImplicitLod 3134 3135 3137 + 3140:6(float16_t) CompositeExtract 3139 1 + Store 3136 3140 + 3141: 47(int) CompositeExtract 3139 0 + 3142: 224 Load 226(s2DShadow) + 3143:154(f16vec2) Load 156(f16c2) + 3144: 52(float) Load 215(compare) + 3145: 208(ptr) AccessChain 3099(texel) 207 + 3146:6(float16_t) Load 137(f16bias) + 3147:3138(ResType) ImageSparseSampleDrefImplicitLod 3142 3143 3144 Bias 3146 + 3148:6(float16_t) CompositeExtract 3147 1 + Store 3145 3148 + 3149: 47(int) CompositeExtract 3147 0 + 3150: 245 Load 247(sCubeShadow) + 3151: 249(fvec4) Load 251(c4) + 3152: 208(ptr) AccessChain 3099(texel) 207 + 3153: 52(float) CompositeExtract 3151 3 + 3154:3138(ResType) ImageSparseSampleDrefImplicitLod 3150 3151 3153 + 3155:6(float16_t) CompositeExtract 3154 1 + Store 3152 3155 + 3156: 47(int) CompositeExtract 3154 0 + 3157: 245 Load 247(sCubeShadow) + 3158:175(f16vec3) Load 177(f16c3) + 3159: 52(float) Load 215(compare) + 3160: 208(ptr) AccessChain 3099(texel) 207 + 3161:6(float16_t) Load 137(f16bias) + 3162:3138(ResType) ImageSparseSampleDrefImplicitLod 3157 3158 3159 Bias 3161 + 3163:6(float16_t) CompositeExtract 3162 1 + Store 3160 3163 + 3164: 47(int) CompositeExtract 3162 0 + 3165: 284 Load 286(s2DArray) + 3166: 167(fvec3) Load 169(c3) + 3167:3102(ResType) ImageSparseSampleImplicitLod 3165 3166 + 3168: 7(f16vec4) CompositeExtract 3167 1 + Store 3099(texel) 3168 + 3169: 47(int) CompositeExtract 3167 0 + 3170: 284 Load 286(s2DArray) + 3171:175(f16vec3) Load 177(f16c3) + 3172:6(float16_t) Load 137(f16bias) + 3173:3102(ResType) ImageSparseSampleImplicitLod 3170 3171 Bias 3172 + 3174: 7(f16vec4) CompositeExtract 3173 1 + Store 3099(texel) 3174 + 3175: 47(int) CompositeExtract 3173 0 + 3176: 299 Load 301(sCubeArray) + 3177: 249(fvec4) Load 251(c4) + 3178:3102(ResType) ImageSparseSampleImplicitLod 3176 3177 + 3179: 7(f16vec4) CompositeExtract 3178 1 + Store 3099(texel) 3179 + 3180: 47(int) CompositeExtract 3178 0 + 3181: 299 Load 301(sCubeArray) + 3182: 7(f16vec4) Load 309(f16c4) + 3183:6(float16_t) Load 137(f16bias) + 3184:3102(ResType) ImageSparseSampleImplicitLod 3181 3182 Bias 3183 + 3185: 7(f16vec4) CompositeExtract 3184 1 + Store 3099(texel) 3185 + 3186: 47(int) CompositeExtract 3184 0 + 3187: 337 Load 339(s2DArrayShadow) + 3188: 249(fvec4) Load 251(c4) + 3189: 208(ptr) AccessChain 3099(texel) 207 + 3190: 52(float) CompositeExtract 3188 3 + 3191:3138(ResType) ImageSparseSampleDrefImplicitLod 3187 3188 3190 + 3192:6(float16_t) CompositeExtract 3191 1 + Store 3189 3192 + 3193: 47(int) CompositeExtract 3191 0 + 3194: 337 Load 339(s2DArrayShadow) + 3195:175(f16vec3) Load 177(f16c3) + 3196: 52(float) Load 215(compare) + 3197: 208(ptr) AccessChain 3099(texel) 207 + 3198:3138(ResType) ImageSparseSampleDrefImplicitLod 3194 3195 3196 + 3199:6(float16_t) CompositeExtract 3198 1 + Store 3197 3199 + 3200: 47(int) CompositeExtract 3198 0 + 3201: 357 Load 359(s2DRect) + 3202: 53(fvec2) Load 148(c2) + 3203:3102(ResType) ImageSparseSampleImplicitLod 3201 3202 + 3204: 7(f16vec4) CompositeExtract 3203 1 + Store 3099(texel) 3204 + 3205: 47(int) CompositeExtract 3203 0 + 3206: 357 Load 359(s2DRect) + 3207:154(f16vec2) Load 156(f16c2) + 3208:3102(ResType) ImageSparseSampleImplicitLod 3206 3207 + 3209: 7(f16vec4) CompositeExtract 3208 1 + Store 3099(texel) 3209 + 3210: 47(int) CompositeExtract 3208 0 + 3211: 371 Load 373(s2DRectShadow) + 3212: 167(fvec3) Load 169(c3) + 3213: 208(ptr) AccessChain 3099(texel) 207 + 3214: 52(float) CompositeExtract 3212 2 + 3215:3138(ResType) ImageSparseSampleDrefImplicitLod 3211 3212 3214 + 3216:6(float16_t) CompositeExtract 3215 1 + Store 3213 3216 + 3217: 47(int) CompositeExtract 3215 0 + 3218: 371 Load 373(s2DRectShadow) + 3219:154(f16vec2) Load 156(f16c2) + 3220: 52(float) Load 215(compare) + 3221: 208(ptr) AccessChain 3099(texel) 207 + 3222:3138(ResType) ImageSparseSampleDrefImplicitLod 3218 3219 3220 + 3223:6(float16_t) CompositeExtract 3222 1 + Store 3221 3223 + 3224: 47(int) CompositeExtract 3222 0 + 3225: 391 Load 393(sCubeArrayShadow) + 3226: 249(fvec4) Load 251(c4) + 3227: 52(float) Load 215(compare) + 3228: 208(ptr) AccessChain 3099(texel) 207 + 3229:3138(ResType) ImageSparseSampleDrefImplicitLod 3225 3226 3227 + 3230:6(float16_t) CompositeExtract 3229 1 + Store 3228 3230 + 3231: 47(int) CompositeExtract 3229 0 + 3232: 391 Load 393(sCubeArrayShadow) + 3233: 7(f16vec4) Load 309(f16c4) + 3234: 52(float) Load 215(compare) + 3235: 208(ptr) AccessChain 3099(texel) 207 + 3236:3138(ResType) ImageSparseSampleDrefImplicitLod 3232 3233 3234 + 3237:6(float16_t) CompositeExtract 3236 1 + Store 3235 3237 + 3238: 47(int) CompositeExtract 3236 0 + 3239: 7(f16vec4) Load 3099(texel) + ReturnValue 3239 + FunctionEnd +71(testSparseTextureLod(): 7(f16vec4) Function None 8 + 72: Label + 3242(texel): 64(ptr) Variable Function + Store 3242(texel) 121 + 3243: 143 Load 145(s2D) + 3244: 53(fvec2) Load 148(c2) + 3245: 52(float) Load 565(lod) + 3246:3102(ResType) ImageSparseSampleExplicitLod 3243 3244 Lod 3245 + 3247: 7(f16vec4) CompositeExtract 3246 1 + Store 3242(texel) 3247 + 3248: 47(int) CompositeExtract 3246 0 + 3249: 143 Load 145(s2D) + 3250:154(f16vec2) Load 156(f16c2) + 3251:6(float16_t) Load 572(f16lod) + 3252:3102(ResType) ImageSparseSampleExplicitLod 3249 3250 Lod 3251 + 3253: 7(f16vec4) CompositeExtract 3252 1 + Store 3242(texel) 3253 + 3254: 47(int) CompositeExtract 3252 0 + 3255: 163 Load 165(s3D) + 3256: 167(fvec3) Load 169(c3) + 3257: 52(float) Load 565(lod) + 3258:3102(ResType) ImageSparseSampleExplicitLod 3255 3256 Lod 3257 + 3259: 7(f16vec4) CompositeExtract 3258 1 + Store 3242(texel) 3259 + 3260: 47(int) CompositeExtract 3258 0 + 3261: 163 Load 165(s3D) + 3262:175(f16vec3) Load 177(f16c3) + 3263:6(float16_t) Load 572(f16lod) + 3264:3102(ResType) ImageSparseSampleExplicitLod 3261 3262 Lod 3263 + 3265: 7(f16vec4) CompositeExtract 3264 1 + Store 3242(texel) 3265 + 3266: 47(int) CompositeExtract 3264 0 + 3267: 184 Load 186(sCube) + 3268: 167(fvec3) Load 169(c3) + 3269: 52(float) Load 565(lod) + 3270:3102(ResType) ImageSparseSampleExplicitLod 3267 3268 Lod 3269 + 3271: 7(f16vec4) CompositeExtract 3270 1 + Store 3242(texel) 3271 + 3272: 47(int) CompositeExtract 3270 0 + 3273: 184 Load 186(sCube) + 3274:175(f16vec3) Load 177(f16c3) + 3275:6(float16_t) Load 572(f16lod) + 3276:3102(ResType) ImageSparseSampleExplicitLod 3273 3274 Lod 3275 + 3277: 7(f16vec4) CompositeExtract 3276 1 + Store 3242(texel) 3277 + 3278: 47(int) CompositeExtract 3276 0 + 3279: 224 Load 226(s2DShadow) + 3280: 167(fvec3) Load 169(c3) + 3281: 52(float) Load 565(lod) + 3282: 208(ptr) AccessChain 3242(texel) 207 + 3283: 52(float) CompositeExtract 3280 2 + 3284:3138(ResType) ImageSparseSampleDrefExplicitLod 3279 3280 3283 Lod 3281 + 3285:6(float16_t) CompositeExtract 3284 1 + Store 3282 3285 + 3286: 47(int) CompositeExtract 3284 0 + 3287: 224 Load 226(s2DShadow) + 3288:154(f16vec2) Load 156(f16c2) + 3289: 52(float) Load 215(compare) + 3290:6(float16_t) Load 572(f16lod) + 3291: 208(ptr) AccessChain 3242(texel) 207 + 3292:3138(ResType) ImageSparseSampleDrefExplicitLod 3287 3288 3289 Lod 3290 + 3293:6(float16_t) CompositeExtract 3292 1 + Store 3291 3293 + 3294: 47(int) CompositeExtract 3292 0 + 3295: 284 Load 286(s2DArray) + 3296: 167(fvec3) Load 169(c3) + 3297: 52(float) Load 565(lod) + 3298:3102(ResType) ImageSparseSampleExplicitLod 3295 3296 Lod 3297 + 3299: 7(f16vec4) CompositeExtract 3298 1 + Store 3242(texel) 3299 + 3300: 47(int) CompositeExtract 3298 0 + 3301: 284 Load 286(s2DArray) + 3302:175(f16vec3) Load 177(f16c3) + 3303:6(float16_t) Load 572(f16lod) + 3304:3102(ResType) ImageSparseSampleExplicitLod 3301 3302 Lod 3303 + 3305: 7(f16vec4) CompositeExtract 3304 1 + Store 3242(texel) 3305 + 3306: 47(int) CompositeExtract 3304 0 + 3307: 299 Load 301(sCubeArray) + 3308: 249(fvec4) Load 251(c4) + 3309: 52(float) Load 565(lod) + 3310:3102(ResType) ImageSparseSampleExplicitLod 3307 3308 Lod 3309 + 3311: 7(f16vec4) CompositeExtract 3310 1 + Store 3242(texel) 3311 + 3312: 47(int) CompositeExtract 3310 0 + 3313: 299 Load 301(sCubeArray) + 3314: 7(f16vec4) Load 309(f16c4) + 3315:6(float16_t) Load 572(f16lod) + 3316:3102(ResType) ImageSparseSampleExplicitLod 3313 3314 Lod 3315 + 3317: 7(f16vec4) CompositeExtract 3316 1 + Store 3242(texel) 3317 + 3318: 47(int) CompositeExtract 3316 0 + 3319: 7(f16vec4) Load 3242(texel) + ReturnValue 3319 + FunctionEnd +73(testSparseTextureOffset(): 7(f16vec4) Function None 8 + 74: Label + 3322(texel): 64(ptr) Variable Function + Store 3322(texel) 121 + 3323: 143 Load 145(s2D) + 3324: 53(fvec2) Load 148(c2) + 3325:3102(ResType) ImageSparseSampleImplicitLod 3323 3324 ConstOffset 722 + 3326: 7(f16vec4) CompositeExtract 3325 1 + Store 3322(texel) 3326 + 3327: 47(int) CompositeExtract 3325 0 + 3328: 143 Load 145(s2D) + 3329:154(f16vec2) Load 156(f16c2) + 3330:6(float16_t) Load 137(f16bias) + 3331:3102(ResType) ImageSparseSampleImplicitLod 3328 3329 Bias ConstOffset 3330 722 + 3332: 7(f16vec4) CompositeExtract 3331 1 + Store 3322(texel) 3332 + 3333: 47(int) CompositeExtract 3331 0 + 3334: 163 Load 165(s3D) + 3335: 167(fvec3) Load 169(c3) + 3336:3102(ResType) ImageSparseSampleImplicitLod 3334 3335 ConstOffset 735 + 3337: 7(f16vec4) CompositeExtract 3336 1 + Store 3322(texel) 3337 + 3338: 47(int) CompositeExtract 3336 0 + 3339: 163 Load 165(s3D) + 3340:175(f16vec3) Load 177(f16c3) + 3341:6(float16_t) Load 137(f16bias) + 3342:3102(ResType) ImageSparseSampleImplicitLod 3339 3340 Bias ConstOffset 3341 735 + 3343: 7(f16vec4) CompositeExtract 3342 1 + Store 3322(texel) 3343 + 3344: 47(int) CompositeExtract 3342 0 + 3345: 357 Load 359(s2DRect) + 3346: 53(fvec2) Load 148(c2) + 3347:3102(ResType) ImageSparseSampleImplicitLod 3345 3346 ConstOffset 722 + 3348: 7(f16vec4) CompositeExtract 3347 1 + Store 3322(texel) 3348 + 3349: 47(int) CompositeExtract 3347 0 + 3350: 357 Load 359(s2DRect) + 3351:154(f16vec2) Load 156(f16c2) + 3352:3102(ResType) ImageSparseSampleImplicitLod 3350 3351 ConstOffset 722 + 3353: 7(f16vec4) CompositeExtract 3352 1 + Store 3322(texel) 3353 + 3354: 47(int) CompositeExtract 3352 0 + 3355: 371 Load 373(s2DRectShadow) + 3356: 167(fvec3) Load 169(c3) + 3357: 208(ptr) AccessChain 3322(texel) 207 + 3358: 52(float) CompositeExtract 3356 2 + 3359:3138(ResType) ImageSparseSampleDrefImplicitLod 3355 3356 3358 ConstOffset 722 + 3360:6(float16_t) CompositeExtract 3359 1 + Store 3357 3360 + 3361: 47(int) CompositeExtract 3359 0 + 3362: 371 Load 373(s2DRectShadow) + 3363:154(f16vec2) Load 156(f16c2) + 3364: 52(float) Load 215(compare) + 3365: 208(ptr) AccessChain 3322(texel) 207 + 3366:3138(ResType) ImageSparseSampleDrefImplicitLod 3362 3363 3364 ConstOffset 722 + 3367:6(float16_t) CompositeExtract 3366 1 + Store 3365 3367 + 3368: 47(int) CompositeExtract 3366 0 + 3369: 224 Load 226(s2DShadow) + 3370: 167(fvec3) Load 169(c3) + 3371: 208(ptr) AccessChain 3322(texel) 207 + 3372: 52(float) CompositeExtract 3370 2 + 3373:3138(ResType) ImageSparseSampleDrefImplicitLod 3369 3370 3372 ConstOffset 722 + 3374:6(float16_t) CompositeExtract 3373 1 + Store 3371 3374 + 3375: 47(int) CompositeExtract 3373 0 + 3376: 224 Load 226(s2DShadow) + 3377:154(f16vec2) Load 156(f16c2) + 3378: 52(float) Load 215(compare) + 3379: 208(ptr) AccessChain 3322(texel) 207 + 3380:6(float16_t) Load 137(f16bias) + 3381:3138(ResType) ImageSparseSampleDrefImplicitLod 3376 3377 3378 Bias ConstOffset 3380 722 + 3382:6(float16_t) CompositeExtract 3381 1 + Store 3379 3382 + 3383: 47(int) CompositeExtract 3381 0 + 3384: 284 Load 286(s2DArray) + 3385: 167(fvec3) Load 169(c3) + 3386:3102(ResType) ImageSparseSampleImplicitLod 3384 3385 ConstOffset 722 + 3387: 7(f16vec4) CompositeExtract 3386 1 + Store 3322(texel) 3387 + 3388: 47(int) CompositeExtract 3386 0 + 3389: 284 Load 286(s2DArray) + 3390:175(f16vec3) Load 177(f16c3) + 3391:6(float16_t) Load 137(f16bias) + 3392:3102(ResType) ImageSparseSampleImplicitLod 3389 3390 Bias ConstOffset 3391 722 + 3393: 7(f16vec4) CompositeExtract 3392 1 + Store 3322(texel) 3393 + 3394: 47(int) CompositeExtract 3392 0 + 3395: 337 Load 339(s2DArrayShadow) + 3396: 249(fvec4) Load 251(c4) + 3397: 208(ptr) AccessChain 3322(texel) 207 + 3398: 52(float) CompositeExtract 3396 3 + 3399:3138(ResType) ImageSparseSampleDrefImplicitLod 3395 3396 3398 ConstOffset 722 + 3400:6(float16_t) CompositeExtract 3399 1 + Store 3397 3400 + 3401: 47(int) CompositeExtract 3399 0 + 3402: 337 Load 339(s2DArrayShadow) + 3403:175(f16vec3) Load 177(f16c3) + 3404: 52(float) Load 215(compare) + 3405: 208(ptr) AccessChain 3322(texel) 207 + 3406:3138(ResType) ImageSparseSampleDrefImplicitLod 3402 3403 3404 ConstOffset 722 + 3407:6(float16_t) CompositeExtract 3406 1 + Store 3405 3407 + 3408: 47(int) CompositeExtract 3406 0 + 3409: 7(f16vec4) Load 3322(texel) + ReturnValue 3409 + FunctionEnd +75(testSparseTextureLodOffset(): 7(f16vec4) Function None 8 + 76: Label + 3412(texel): 64(ptr) Variable Function + Store 3412(texel) 121 + 3413: 143 Load 145(s2D) + 3414: 53(fvec2) Load 148(c2) + 3415: 52(float) Load 565(lod) + 3416:3102(ResType) ImageSparseSampleExplicitLod 3413 3414 Lod ConstOffset 3415 722 + 3417: 7(f16vec4) CompositeExtract 3416 1 + Store 3412(texel) 3417 + 3418: 47(int) CompositeExtract 3416 0 + 3419: 143 Load 145(s2D) + 3420:154(f16vec2) Load 156(f16c2) + 3421:6(float16_t) Load 572(f16lod) + 3422:3102(ResType) ImageSparseSampleExplicitLod 3419 3420 Lod ConstOffset 3421 722 + 3423: 7(f16vec4) CompositeExtract 3422 1 + Store 3412(texel) 3423 + 3424: 47(int) CompositeExtract 3422 0 + 3425: 163 Load 165(s3D) + 3426: 167(fvec3) Load 169(c3) + 3427: 52(float) Load 565(lod) + 3428:3102(ResType) ImageSparseSampleExplicitLod 3425 3426 Lod ConstOffset 3427 735 + 3429: 7(f16vec4) CompositeExtract 3428 1 + Store 3412(texel) 3429 + 3430: 47(int) CompositeExtract 3428 0 + 3431: 163 Load 165(s3D) + 3432:175(f16vec3) Load 177(f16c3) + 3433:6(float16_t) Load 572(f16lod) + 3434:3102(ResType) ImageSparseSampleExplicitLod 3431 3432 Lod ConstOffset 3433 735 + 3435: 7(f16vec4) CompositeExtract 3434 1 + Store 3412(texel) 3435 + 3436: 47(int) CompositeExtract 3434 0 + 3437: 224 Load 226(s2DShadow) + 3438: 167(fvec3) Load 169(c3) + 3439: 52(float) Load 565(lod) + 3440: 208(ptr) AccessChain 3412(texel) 207 + 3441: 52(float) CompositeExtract 3438 2 + 3442:3138(ResType) ImageSparseSampleDrefExplicitLod 3437 3438 3441 Lod ConstOffset 3439 722 + 3443:6(float16_t) CompositeExtract 3442 1 + Store 3440 3443 + 3444: 47(int) CompositeExtract 3442 0 + 3445: 224 Load 226(s2DShadow) + 3446:154(f16vec2) Load 156(f16c2) + 3447: 52(float) Load 215(compare) + 3448:6(float16_t) Load 572(f16lod) + 3449: 208(ptr) AccessChain 3412(texel) 207 + 3450:3138(ResType) ImageSparseSampleDrefExplicitLod 3445 3446 3447 Lod ConstOffset 3448 722 + 3451:6(float16_t) CompositeExtract 3450 1 + Store 3449 3451 + 3452: 47(int) CompositeExtract 3450 0 + 3453: 284 Load 286(s2DArray) + 3454: 167(fvec3) Load 169(c3) + 3455: 52(float) Load 565(lod) + 3456:3102(ResType) ImageSparseSampleExplicitLod 3453 3454 Lod ConstOffset 3455 722 + 3457: 7(f16vec4) CompositeExtract 3456 1 + Store 3412(texel) 3457 + 3458: 47(int) CompositeExtract 3456 0 + 3459: 284 Load 286(s2DArray) + 3460:175(f16vec3) Load 177(f16c3) + 3461:6(float16_t) Load 572(f16lod) + 3462:3102(ResType) ImageSparseSampleExplicitLod 3459 3460 Lod ConstOffset 3461 722 + 3463: 7(f16vec4) CompositeExtract 3462 1 + Store 3412(texel) 3463 + 3464: 47(int) CompositeExtract 3462 0 + 3465: 7(f16vec4) Load 3412(texel) + ReturnValue 3465 + FunctionEnd +77(testSparseTextureGrad(): 7(f16vec4) Function None 8 + 78: Label + 3468(texel): 64(ptr) Variable Function + Store 3468(texel) 121 + 3469: 143 Load 145(s2D) + 3470: 53(fvec2) Load 148(c2) + 3471: 53(fvec2) Load 1409(dPdxy2) + 3472: 53(fvec2) Load 1409(dPdxy2) + 3473:3102(ResType) ImageSparseSampleExplicitLod 3469 3470 Grad 3471 3472 + 3474: 7(f16vec4) CompositeExtract 3473 1 + Store 3468(texel) 3474 + 3475: 47(int) CompositeExtract 3473 0 + 3476: 143 Load 145(s2D) + 3477:154(f16vec2) Load 156(f16c2) + 3478:154(f16vec2) Load 1417(f16dPdxy2) + 3479:154(f16vec2) Load 1417(f16dPdxy2) + 3480:3102(ResType) ImageSparseSampleExplicitLod 3476 3477 Grad 3478 3479 + 3481: 7(f16vec4) CompositeExtract 3480 1 + Store 3468(texel) 3481 + 3482: 47(int) CompositeExtract 3480 0 + 3483: 163 Load 165(s3D) + 3484: 167(fvec3) Load 169(c3) + 3485: 167(fvec3) Load 1425(dPdxy3) + 3486: 167(fvec3) Load 1425(dPdxy3) + 3487:3102(ResType) ImageSparseSampleExplicitLod 3483 3484 Grad 3485 3486 + 3488: 7(f16vec4) CompositeExtract 3487 1 + Store 3468(texel) 3488 + 3489: 47(int) CompositeExtract 3487 0 + 3490: 163 Load 165(s3D) + 3491:175(f16vec3) Load 177(f16c3) + 3492:175(f16vec3) Load 1433(f16dPdxy3) + 3493:175(f16vec3) Load 1433(f16dPdxy3) + 3494:3102(ResType) ImageSparseSampleExplicitLod 3490 3491 Grad 3492 3493 + 3495: 7(f16vec4) CompositeExtract 3494 1 + Store 3468(texel) 3495 + 3496: 47(int) CompositeExtract 3494 0 + 3497: 184 Load 186(sCube) + 3498: 167(fvec3) Load 169(c3) + 3499: 167(fvec3) Load 1425(dPdxy3) + 3500: 167(fvec3) Load 1425(dPdxy3) + 3501:3102(ResType) ImageSparseSampleExplicitLod 3497 3498 Grad 3499 3500 + 3502: 7(f16vec4) CompositeExtract 3501 1 + Store 3468(texel) 3502 + 3503: 47(int) CompositeExtract 3501 0 + 3504: 184 Load 186(sCube) + 3505:175(f16vec3) Load 177(f16c3) + 3506:175(f16vec3) Load 1433(f16dPdxy3) + 3507:175(f16vec3) Load 1433(f16dPdxy3) + 3508:3102(ResType) ImageSparseSampleExplicitLod 3504 3505 Grad 3506 3507 + 3509: 7(f16vec4) CompositeExtract 3508 1 + Store 3468(texel) 3509 + 3510: 47(int) CompositeExtract 3508 0 + 3511: 357 Load 359(s2DRect) + 3512: 53(fvec2) Load 148(c2) + 3513: 53(fvec2) Load 1409(dPdxy2) + 3514: 53(fvec2) Load 1409(dPdxy2) + 3515:3102(ResType) ImageSparseSampleExplicitLod 3511 3512 Grad 3513 3514 + 3516: 7(f16vec4) CompositeExtract 3515 1 + Store 3468(texel) 3516 + 3517: 47(int) CompositeExtract 3515 0 + 3518: 357 Load 359(s2DRect) + 3519:154(f16vec2) Load 156(f16c2) + 3520:154(f16vec2) Load 1417(f16dPdxy2) + 3521:154(f16vec2) Load 1417(f16dPdxy2) + 3522:3102(ResType) ImageSparseSampleExplicitLod 3518 3519 Grad 3520 3521 + 3523: 7(f16vec4) CompositeExtract 3522 1 + Store 3468(texel) 3523 + 3524: 47(int) CompositeExtract 3522 0 + 3525: 371 Load 373(s2DRectShadow) + 3526: 167(fvec3) Load 169(c3) + 3527: 53(fvec2) Load 1409(dPdxy2) + 3528: 53(fvec2) Load 1409(dPdxy2) + 3529: 208(ptr) AccessChain 3468(texel) 207 + 3530: 52(float) CompositeExtract 3526 2 + 3531:3138(ResType) ImageSparseSampleDrefExplicitLod 3525 3526 3530 Grad 3527 3528 + 3532:6(float16_t) CompositeExtract 3531 1 + Store 3529 3532 + 3533: 47(int) CompositeExtract 3531 0 + 3534: 371 Load 373(s2DRectShadow) + 3535:154(f16vec2) Load 156(f16c2) + 3536: 52(float) Load 215(compare) + 3537:154(f16vec2) Load 1417(f16dPdxy2) + 3538:154(f16vec2) Load 1417(f16dPdxy2) + 3539: 208(ptr) AccessChain 3468(texel) 207 + 3540:3138(ResType) ImageSparseSampleDrefExplicitLod 3534 3535 3536 Grad 3537 3538 + 3541:6(float16_t) CompositeExtract 3540 1 + Store 3539 3541 + 3542: 47(int) CompositeExtract 3540 0 + 3543: 224 Load 226(s2DShadow) + 3544: 167(fvec3) Load 169(c3) + 3545: 53(fvec2) Load 1409(dPdxy2) + 3546: 53(fvec2) Load 1409(dPdxy2) + 3547: 208(ptr) AccessChain 3468(texel) 207 + 3548: 52(float) CompositeExtract 3544 2 + 3549:3138(ResType) ImageSparseSampleDrefExplicitLod 3543 3544 3548 Grad 3545 3546 + 3550:6(float16_t) CompositeExtract 3549 1 + Store 3547 3550 + 3551: 47(int) CompositeExtract 3549 0 + 3552: 224 Load 226(s2DShadow) + 3553:154(f16vec2) Load 156(f16c2) + 3554: 52(float) Load 215(compare) + 3555:154(f16vec2) Load 1417(f16dPdxy2) + 3556:154(f16vec2) Load 1417(f16dPdxy2) + 3557: 208(ptr) AccessChain 3468(texel) 207 + 3558:3138(ResType) ImageSparseSampleDrefExplicitLod 3552 3553 3554 Grad 3555 3556 + 3559:6(float16_t) CompositeExtract 3558 1 + Store 3557 3559 + 3560: 47(int) CompositeExtract 3558 0 + 3561: 245 Load 247(sCubeShadow) + 3562: 249(fvec4) Load 251(c4) + 3563: 167(fvec3) Load 1425(dPdxy3) + 3564: 167(fvec3) Load 1425(dPdxy3) + 3565: 208(ptr) AccessChain 3468(texel) 207 + 3566: 52(float) CompositeExtract 3562 3 + 3567:3138(ResType) ImageSparseSampleDrefExplicitLod 3561 3562 3566 Grad 3563 3564 + 3568:6(float16_t) CompositeExtract 3567 1 + Store 3565 3568 + 3569: 47(int) CompositeExtract 3567 0 + 3570: 245 Load 247(sCubeShadow) + 3571:175(f16vec3) Load 177(f16c3) + 3572: 52(float) Load 215(compare) + 3573:175(f16vec3) Load 1433(f16dPdxy3) + 3574:175(f16vec3) Load 1433(f16dPdxy3) + 3575: 208(ptr) AccessChain 3468(texel) 207 + 3576:3138(ResType) ImageSparseSampleDrefExplicitLod 3570 3571 3572 Grad 3573 3574 + 3577:6(float16_t) CompositeExtract 3576 1 + Store 3575 3577 + 3578: 47(int) CompositeExtract 3576 0 + 3579: 284 Load 286(s2DArray) + 3580: 167(fvec3) Load 169(c3) + 3581: 53(fvec2) Load 1409(dPdxy2) + 3582: 53(fvec2) Load 1409(dPdxy2) + 3583:3102(ResType) ImageSparseSampleExplicitLod 3579 3580 Grad 3581 3582 + 3584: 7(f16vec4) CompositeExtract 3583 1 + Store 3468(texel) 3584 + 3585: 47(int) CompositeExtract 3583 0 + 3586: 284 Load 286(s2DArray) + 3587:175(f16vec3) Load 177(f16c3) + 3588:154(f16vec2) Load 1417(f16dPdxy2) + 3589:154(f16vec2) Load 1417(f16dPdxy2) + 3590:3102(ResType) ImageSparseSampleExplicitLod 3586 3587 Grad 3588 3589 + 3591: 7(f16vec4) CompositeExtract 3590 1 + Store 3468(texel) 3591 + 3592: 47(int) CompositeExtract 3590 0 + 3593: 337 Load 339(s2DArrayShadow) + 3594: 249(fvec4) Load 251(c4) + 3595: 53(fvec2) Load 1409(dPdxy2) + 3596: 53(fvec2) Load 1409(dPdxy2) + 3597: 208(ptr) AccessChain 3468(texel) 207 + 3598: 52(float) CompositeExtract 3594 3 + 3599:3138(ResType) ImageSparseSampleDrefExplicitLod 3593 3594 3598 Grad 3595 3596 + 3600:6(float16_t) CompositeExtract 3599 1 + Store 3597 3600 + 3601: 47(int) CompositeExtract 3599 0 + 3602: 337 Load 339(s2DArrayShadow) + 3603:175(f16vec3) Load 177(f16c3) + 3604: 52(float) Load 215(compare) + 3605:154(f16vec2) Load 1417(f16dPdxy2) + 3606:154(f16vec2) Load 1417(f16dPdxy2) + 3607: 208(ptr) AccessChain 3468(texel) 207 + 3608:3138(ResType) ImageSparseSampleDrefExplicitLod 3602 3603 3604 Grad 3605 3606 + 3609:6(float16_t) CompositeExtract 3608 1 + Store 3607 3609 + 3610: 47(int) CompositeExtract 3608 0 + 3611: 299 Load 301(sCubeArray) + 3612: 249(fvec4) Load 251(c4) + 3613: 167(fvec3) Load 1425(dPdxy3) + 3614: 167(fvec3) Load 1425(dPdxy3) + 3615:3102(ResType) ImageSparseSampleExplicitLod 3611 3612 Grad 3613 3614 + 3616: 7(f16vec4) CompositeExtract 3615 1 + Store 3468(texel) 3616 + 3617: 47(int) CompositeExtract 3615 0 + 3618: 299 Load 301(sCubeArray) + 3619: 7(f16vec4) Load 309(f16c4) + 3620:175(f16vec3) Load 1433(f16dPdxy3) + 3621:175(f16vec3) Load 1433(f16dPdxy3) + 3622:3102(ResType) ImageSparseSampleExplicitLod 3618 3619 Grad 3620 3621 + 3623: 7(f16vec4) CompositeExtract 3622 1 + Store 3468(texel) 3623 + 3624: 47(int) CompositeExtract 3622 0 + 3625: 7(f16vec4) Load 3468(texel) + ReturnValue 3625 + FunctionEnd +79(testSparseTextureGradOffset(): 7(f16vec4) Function None 8 + 80: Label + 3628(texel): 64(ptr) Variable Function + Store 3628(texel) 121 + 3629: 143 Load 145(s2D) + 3630: 53(fvec2) Load 148(c2) + 3631: 53(fvec2) Load 1409(dPdxy2) + 3632: 53(fvec2) Load 1409(dPdxy2) + 3633:3102(ResType) ImageSparseSampleExplicitLod 3629 3630 Grad ConstOffset 3631 3632 722 + 3634: 7(f16vec4) CompositeExtract 3633 1 + Store 3628(texel) 3634 + 3635: 47(int) CompositeExtract 3633 0 + 3636: 143 Load 145(s2D) + 3637:154(f16vec2) Load 156(f16c2) + 3638:154(f16vec2) Load 1417(f16dPdxy2) + 3639:154(f16vec2) Load 1417(f16dPdxy2) + 3640:3102(ResType) ImageSparseSampleExplicitLod 3636 3637 Grad ConstOffset 3638 3639 722 + 3641: 7(f16vec4) CompositeExtract 3640 1 + Store 3628(texel) 3641 + 3642: 47(int) CompositeExtract 3640 0 + 3643: 163 Load 165(s3D) + 3644: 167(fvec3) Load 169(c3) + 3645: 167(fvec3) Load 1425(dPdxy3) + 3646: 167(fvec3) Load 1425(dPdxy3) + 3647:3102(ResType) ImageSparseSampleExplicitLod 3643 3644 Grad ConstOffset 3645 3646 735 + 3648: 7(f16vec4) CompositeExtract 3647 1 + Store 3628(texel) 3648 + 3649: 47(int) CompositeExtract 3647 0 + 3650: 163 Load 165(s3D) + 3651:175(f16vec3) Load 177(f16c3) + 3652:175(f16vec3) Load 1433(f16dPdxy3) + 3653:175(f16vec3) Load 1433(f16dPdxy3) + 3654:3102(ResType) ImageSparseSampleExplicitLod 3650 3651 Grad ConstOffset 3652 3653 735 + 3655: 7(f16vec4) CompositeExtract 3654 1 + Store 3628(texel) 3655 + 3656: 47(int) CompositeExtract 3654 0 + 3657: 357 Load 359(s2DRect) + 3658: 53(fvec2) Load 148(c2) + 3659: 53(fvec2) Load 1409(dPdxy2) + 3660: 53(fvec2) Load 1409(dPdxy2) + 3661:3102(ResType) ImageSparseSampleExplicitLod 3657 3658 Grad ConstOffset 3659 3660 722 + 3662: 7(f16vec4) CompositeExtract 3661 1 + Store 3628(texel) 3662 + 3663: 47(int) CompositeExtract 3661 0 + 3664: 357 Load 359(s2DRect) + 3665:154(f16vec2) Load 156(f16c2) + 3666:154(f16vec2) Load 1417(f16dPdxy2) + 3667:154(f16vec2) Load 1417(f16dPdxy2) + 3668:3102(ResType) ImageSparseSampleExplicitLod 3664 3665 Grad ConstOffset 3666 3667 722 + 3669: 7(f16vec4) CompositeExtract 3668 1 + Store 3628(texel) 3669 + 3670: 47(int) CompositeExtract 3668 0 + 3671: 371 Load 373(s2DRectShadow) + 3672: 167(fvec3) Load 169(c3) + 3673: 53(fvec2) Load 1409(dPdxy2) + 3674: 53(fvec2) Load 1409(dPdxy2) + 3675: 208(ptr) AccessChain 3628(texel) 207 + 3676: 52(float) CompositeExtract 3672 2 + 3677:3138(ResType) ImageSparseSampleDrefExplicitLod 3671 3672 3676 Grad ConstOffset 3673 3674 722 + 3678:6(float16_t) CompositeExtract 3677 1 + Store 3675 3678 + 3679: 47(int) CompositeExtract 3677 0 + 3680: 371 Load 373(s2DRectShadow) + 3681:154(f16vec2) Load 156(f16c2) + 3682: 52(float) Load 215(compare) + 3683:154(f16vec2) Load 1417(f16dPdxy2) + 3684:154(f16vec2) Load 1417(f16dPdxy2) + 3685: 208(ptr) AccessChain 3628(texel) 207 + 3686:3138(ResType) ImageSparseSampleDrefExplicitLod 3680 3681 3682 Grad ConstOffset 3683 3684 722 + 3687:6(float16_t) CompositeExtract 3686 1 + Store 3685 3687 + 3688: 47(int) CompositeExtract 3686 0 + 3689: 224 Load 226(s2DShadow) + 3690: 167(fvec3) Load 169(c3) + 3691: 53(fvec2) Load 1409(dPdxy2) + 3692: 53(fvec2) Load 1409(dPdxy2) + 3693: 208(ptr) AccessChain 3628(texel) 207 + 3694: 52(float) CompositeExtract 3690 2 + 3695:3138(ResType) ImageSparseSampleDrefExplicitLod 3689 3690 3694 Grad ConstOffset 3691 3692 722 + 3696:6(float16_t) CompositeExtract 3695 1 + Store 3693 3696 + 3697: 47(int) CompositeExtract 3695 0 + 3698: 224 Load 226(s2DShadow) + 3699:154(f16vec2) Load 156(f16c2) + 3700: 52(float) Load 215(compare) + 3701:154(f16vec2) Load 1417(f16dPdxy2) + 3702:154(f16vec2) Load 1417(f16dPdxy2) + 3703: 208(ptr) AccessChain 3628(texel) 207 + 3704:3138(ResType) ImageSparseSampleDrefExplicitLod 3698 3699 3700 Grad ConstOffset 3701 3702 722 + 3705:6(float16_t) CompositeExtract 3704 1 + Store 3703 3705 + 3706: 47(int) CompositeExtract 3704 0 + 3707: 284 Load 286(s2DArray) + 3708: 167(fvec3) Load 169(c3) + 3709: 53(fvec2) Load 1409(dPdxy2) + 3710: 53(fvec2) Load 1409(dPdxy2) + 3711:3102(ResType) ImageSparseSampleExplicitLod 3707 3708 Grad ConstOffset 3709 3710 722 + 3712: 7(f16vec4) CompositeExtract 3711 1 + Store 3628(texel) 3712 + 3713: 47(int) CompositeExtract 3711 0 + 3714: 284 Load 286(s2DArray) + 3715:175(f16vec3) Load 177(f16c3) + 3716:154(f16vec2) Load 1417(f16dPdxy2) + 3717:154(f16vec2) Load 1417(f16dPdxy2) + 3718:3102(ResType) ImageSparseSampleExplicitLod 3714 3715 Grad ConstOffset 3716 3717 722 + 3719: 7(f16vec4) CompositeExtract 3718 1 + Store 3628(texel) 3719 + 3720: 47(int) CompositeExtract 3718 0 + 3721: 337 Load 339(s2DArrayShadow) + 3722: 249(fvec4) Load 251(c4) + 3723: 53(fvec2) Load 1409(dPdxy2) + 3724: 53(fvec2) Load 1409(dPdxy2) + 3725: 208(ptr) AccessChain 3628(texel) 207 + 3726: 52(float) CompositeExtract 3722 3 + 3727:3138(ResType) ImageSparseSampleDrefExplicitLod 3721 3722 3726 Grad ConstOffset 3723 3724 722 + 3728:6(float16_t) CompositeExtract 3727 1 + Store 3725 3728 + 3729: 47(int) CompositeExtract 3727 0 + 3730: 337 Load 339(s2DArrayShadow) + 3731:175(f16vec3) Load 177(f16c3) + 3732: 52(float) Load 215(compare) + 3733:154(f16vec2) Load 1417(f16dPdxy2) + 3734:154(f16vec2) Load 1417(f16dPdxy2) + 3735: 208(ptr) AccessChain 3628(texel) 207 + 3736:3138(ResType) ImageSparseSampleDrefExplicitLod 3730 3731 3732 Grad ConstOffset 3733 3734 722 + 3737:6(float16_t) CompositeExtract 3736 1 + Store 3735 3737 + 3738: 47(int) CompositeExtract 3736 0 + 3739: 7(f16vec4) Load 3628(texel) + ReturnValue 3739 + FunctionEnd +81(testSparseTexelFetch(): 7(f16vec4) Function None 8 + 82: Label + 3742(texel): 64(ptr) Variable Function + Store 3742(texel) 121 + 3743: 143 Load 145(s2D) + 3744: 53(fvec2) Load 148(c2) + 3745: 721(ivec2) ConvertFToS 3744 + 3746: 52(float) Load 565(lod) + 3747: 47(int) ConvertFToS 3746 + 3748: 142 Image 3743 + 3749:3102(ResType) ImageSparseFetch 3748 3745 Lod 3747 + 3750: 7(f16vec4) CompositeExtract 3749 1 + Store 3742(texel) 3750 + 3751: 47(int) CompositeExtract 3749 0 + 3752: 163 Load 165(s3D) + 3753: 167(fvec3) Load 169(c3) + 3754: 734(ivec3) ConvertFToS 3753 + 3755: 52(float) Load 565(lod) + 3756: 47(int) ConvertFToS 3755 + 3757: 162 Image 3752 + 3758:3102(ResType) ImageSparseFetch 3757 3754 Lod 3756 + 3759: 7(f16vec4) CompositeExtract 3758 1 + Store 3742(texel) 3759 + 3760: 47(int) CompositeExtract 3758 0 + 3761: 357 Load 359(s2DRect) + 3762: 53(fvec2) Load 148(c2) + 3763: 721(ivec2) ConvertFToS 3762 + 3764: 356 Image 3761 + 3765:3102(ResType) ImageSparseFetch 3764 3763 + 3766: 7(f16vec4) CompositeExtract 3765 1 + Store 3742(texel) 3766 + 3767: 47(int) CompositeExtract 3765 0 + 3768: 284 Load 286(s2DArray) + 3769: 167(fvec3) Load 169(c3) + 3770: 734(ivec3) ConvertFToS 3769 + 3771: 52(float) Load 565(lod) + 3772: 47(int) ConvertFToS 3771 + 3773: 283 Image 3768 + 3774:3102(ResType) ImageSparseFetch 3773 3770 Lod 3772 + 3775: 7(f16vec4) CompositeExtract 3774 1 + Store 3742(texel) 3775 + 3776: 47(int) CompositeExtract 3774 0 + 3777: 1309 Load 1311(s2DMS) + 3778: 53(fvec2) Load 148(c2) + 3779: 721(ivec2) ConvertFToS 3778 + 3780: 1308 Image 3777 + 3781:3102(ResType) ImageSparseFetch 3780 3779 Sample 709 + 3782: 7(f16vec4) CompositeExtract 3781 1 + Store 3742(texel) 3782 + 3783: 47(int) CompositeExtract 3781 0 + 3784: 1320 Load 1322(s2DMSArray) + 3785: 167(fvec3) Load 169(c3) + 3786: 734(ivec3) ConvertFToS 3785 + 3787: 1319 Image 3784 + 3788:3102(ResType) ImageSparseFetch 3787 3786 Sample 1326 + 3789: 7(f16vec4) CompositeExtract 3788 1 + Store 3742(texel) 3789 + 3790: 47(int) CompositeExtract 3788 0 + 3791: 7(f16vec4) Load 3742(texel) + ReturnValue 3791 + FunctionEnd +83(testSparseTexelFetchOffset(): 7(f16vec4) Function None 8 + 84: Label + 3794(texel): 64(ptr) Variable Function + Store 3794(texel) 121 + 3795: 143 Load 145(s2D) + 3796: 53(fvec2) Load 148(c2) + 3797: 721(ivec2) ConvertFToS 3796 + 3798: 52(float) Load 565(lod) + 3799: 47(int) ConvertFToS 3798 + 3800: 142 Image 3795 + 3801:3102(ResType) ImageSparseFetch 3800 3797 Lod ConstOffset 3799 722 + 3802: 7(f16vec4) CompositeExtract 3801 1 + Store 3794(texel) 3802 + 3803: 47(int) CompositeExtract 3801 0 + 3804: 163 Load 165(s3D) + 3805: 167(fvec3) Load 169(c3) + 3806: 734(ivec3) ConvertFToS 3805 + 3807: 52(float) Load 565(lod) + 3808: 47(int) ConvertFToS 3807 + 3809: 162 Image 3804 + 3810:3102(ResType) ImageSparseFetch 3809 3806 Lod ConstOffset 3808 735 + 3811: 7(f16vec4) CompositeExtract 3810 1 + Store 3794(texel) 3811 + 3812: 47(int) CompositeExtract 3810 0 + 3813: 357 Load 359(s2DRect) + 3814: 53(fvec2) Load 148(c2) + 3815: 721(ivec2) ConvertFToS 3814 + 3816: 356 Image 3813 + 3817:3102(ResType) ImageSparseFetch 3816 3815 ConstOffset 722 + 3818: 7(f16vec4) CompositeExtract 3817 1 + Store 3794(texel) 3818 + 3819: 47(int) CompositeExtract 3817 0 + 3820: 284 Load 286(s2DArray) + 3821: 167(fvec3) Load 169(c3) + 3822: 734(ivec3) ConvertFToS 3821 + 3823: 52(float) Load 565(lod) + 3824: 47(int) ConvertFToS 3823 + 3825: 283 Image 3820 + 3826:3102(ResType) ImageSparseFetch 3825 3822 Lod ConstOffset 3824 722 + 3827: 7(f16vec4) CompositeExtract 3826 1 + Store 3794(texel) 3827 + 3828: 47(int) CompositeExtract 3826 0 + 3829: 7(f16vec4) Load 3794(texel) + ReturnValue 3829 + FunctionEnd +85(testSparseTextureGather(): 7(f16vec4) Function None 8 + 86: Label + 3832(texel): 64(ptr) Variable Function + Store 3832(texel) 121 + 3833: 143 Load 145(s2D) + 3834: 53(fvec2) Load 148(c2) + 3835:3102(ResType) ImageSparseGather 3833 3834 2187 + 3836: 7(f16vec4) CompositeExtract 3835 1 + Store 3832(texel) 3836 + 3837: 47(int) CompositeExtract 3835 0 + 3838: 143 Load 145(s2D) + 3839:154(f16vec2) Load 156(f16c2) + 3840:6(float16_t) Load 137(f16bias) + 3841:3102(ResType) ImageSparseGather 3838 3839 2187 Bias 3840 + 3842: 7(f16vec4) CompositeExtract 3841 1 + Store 3832(texel) 3842 + 3843: 47(int) CompositeExtract 3841 0 + 3844: 284 Load 286(s2DArray) + 3845: 167(fvec3) Load 169(c3) + 3846:3102(ResType) ImageSparseGather 3844 3845 2187 + 3847: 7(f16vec4) CompositeExtract 3846 1 + Store 3832(texel) 3847 + 3848: 47(int) CompositeExtract 3846 0 + 3849: 284 Load 286(s2DArray) + 3850:175(f16vec3) Load 177(f16c3) + 3851:6(float16_t) Load 137(f16bias) + 3852:3102(ResType) ImageSparseGather 3849 3850 2187 Bias 3851 + 3853: 7(f16vec4) CompositeExtract 3852 1 + Store 3832(texel) 3853 + 3854: 47(int) CompositeExtract 3852 0 + 3855: 184 Load 186(sCube) + 3856: 167(fvec3) Load 169(c3) + 3857:3102(ResType) ImageSparseGather 3855 3856 2187 + 3858: 7(f16vec4) CompositeExtract 3857 1 + Store 3832(texel) 3858 + 3859: 47(int) CompositeExtract 3857 0 + 3860: 184 Load 186(sCube) + 3861:175(f16vec3) Load 177(f16c3) + 3862:6(float16_t) Load 137(f16bias) + 3863:3102(ResType) ImageSparseGather 3860 3861 2187 Bias 3862 + 3864: 7(f16vec4) CompositeExtract 3863 1 + Store 3832(texel) 3864 + 3865: 47(int) CompositeExtract 3863 0 + 3866: 299 Load 301(sCubeArray) + 3867: 249(fvec4) Load 251(c4) + 3868:3102(ResType) ImageSparseGather 3866 3867 2187 + 3869: 7(f16vec4) CompositeExtract 3868 1 + Store 3832(texel) 3869 + 3870: 47(int) CompositeExtract 3868 0 + 3871: 299 Load 301(sCubeArray) + 3872: 7(f16vec4) Load 309(f16c4) + 3873:6(float16_t) Load 137(f16bias) + 3874:3102(ResType) ImageSparseGather 3871 3872 2187 Bias 3873 + 3875: 7(f16vec4) CompositeExtract 3874 1 + Store 3832(texel) 3875 + 3876: 47(int) CompositeExtract 3874 0 + 3877: 357 Load 359(s2DRect) + 3878: 53(fvec2) Load 148(c2) + 3879:3102(ResType) ImageSparseGather 3877 3878 2187 + 3880: 7(f16vec4) CompositeExtract 3879 1 + Store 3832(texel) 3880 + 3881: 47(int) CompositeExtract 3879 0 + 3882: 357 Load 359(s2DRect) + 3883:154(f16vec2) Load 156(f16c2) + 3884:3102(ResType) ImageSparseGather 3882 3883 2187 + 3885: 7(f16vec4) CompositeExtract 3884 1 + Store 3832(texel) 3885 + 3886: 47(int) CompositeExtract 3884 0 + 3887: 224 Load 226(s2DShadow) + 3888: 53(fvec2) Load 148(c2) + 3889: 52(float) Load 215(compare) + 3890:3102(ResType) ImageSparseDrefGather 3887 3888 3889 + 3891: 7(f16vec4) CompositeExtract 3890 1 + Store 3832(texel) 3891 + 3892: 47(int) CompositeExtract 3890 0 + 3893: 224 Load 226(s2DShadow) + 3894:154(f16vec2) Load 156(f16c2) + 3895: 52(float) Load 215(compare) + 3896:3102(ResType) ImageSparseDrefGather 3893 3894 3895 + 3897: 7(f16vec4) CompositeExtract 3896 1 + Store 3832(texel) 3897 + 3898: 47(int) CompositeExtract 3896 0 + 3899: 337 Load 339(s2DArrayShadow) + 3900: 167(fvec3) Load 169(c3) + 3901: 52(float) Load 215(compare) + 3902:3102(ResType) ImageSparseDrefGather 3899 3900 3901 + 3903: 7(f16vec4) CompositeExtract 3902 1 + Store 3832(texel) 3903 + 3904: 47(int) CompositeExtract 3902 0 + 3905: 337 Load 339(s2DArrayShadow) + 3906:175(f16vec3) Load 177(f16c3) + 3907: 52(float) Load 215(compare) + 3908:3102(ResType) ImageSparseDrefGather 3905 3906 3907 + 3909: 7(f16vec4) CompositeExtract 3908 1 + Store 3832(texel) 3909 + 3910: 47(int) CompositeExtract 3908 0 + 3911: 245 Load 247(sCubeShadow) + 3912: 167(fvec3) Load 169(c3) + 3913: 52(float) Load 215(compare) + 3914:3102(ResType) ImageSparseDrefGather 3911 3912 3913 + 3915: 7(f16vec4) CompositeExtract 3914 1 + Store 3832(texel) 3915 + 3916: 47(int) CompositeExtract 3914 0 + 3917: 245 Load 247(sCubeShadow) + 3918:175(f16vec3) Load 177(f16c3) + 3919: 52(float) Load 215(compare) + 3920:3102(ResType) ImageSparseDrefGather 3917 3918 3919 + 3921: 7(f16vec4) CompositeExtract 3920 1 + Store 3832(texel) 3921 + 3922: 47(int) CompositeExtract 3920 0 + 3923: 391 Load 393(sCubeArrayShadow) + 3924: 249(fvec4) Load 251(c4) + 3925: 52(float) Load 215(compare) + 3926:3102(ResType) ImageSparseDrefGather 3923 3924 3925 + 3927: 7(f16vec4) CompositeExtract 3926 1 + Store 3832(texel) 3927 + 3928: 47(int) CompositeExtract 3926 0 + 3929: 391 Load 393(sCubeArrayShadow) + 3930: 7(f16vec4) Load 309(f16c4) + 3931: 52(float) Load 215(compare) + 3932:3102(ResType) ImageSparseDrefGather 3929 3930 3931 + 3933: 7(f16vec4) CompositeExtract 3932 1 + Store 3832(texel) 3933 + 3934: 47(int) CompositeExtract 3932 0 + 3935: 371 Load 373(s2DRectShadow) + 3936: 53(fvec2) Load 148(c2) + 3937: 52(float) Load 215(compare) + 3938:3102(ResType) ImageSparseDrefGather 3935 3936 3937 + 3939: 7(f16vec4) CompositeExtract 3938 1 + Store 3832(texel) 3939 + 3940: 47(int) CompositeExtract 3938 0 + 3941: 371 Load 373(s2DRectShadow) + 3942:154(f16vec2) Load 156(f16c2) + 3943: 52(float) Load 215(compare) + 3944:3102(ResType) ImageSparseDrefGather 3941 3942 3943 + 3945: 7(f16vec4) CompositeExtract 3944 1 + Store 3832(texel) 3945 + 3946: 47(int) CompositeExtract 3944 0 + 3947: 7(f16vec4) Load 3832(texel) + ReturnValue 3947 + FunctionEnd +87(testSparseTextureGatherOffset(): 7(f16vec4) Function None 8 + 88: Label + 3950(texel): 64(ptr) Variable Function + Store 3950(texel) 121 + 3951: 143 Load 145(s2D) + 3952: 53(fvec2) Load 148(c2) + 3953:3102(ResType) ImageSparseGather 3951 3952 2187 ConstOffset 722 + 3954: 7(f16vec4) CompositeExtract 3953 1 + Store 3950(texel) 3954 + 3955: 47(int) CompositeExtract 3953 0 + 3956: 143 Load 145(s2D) + 3957:154(f16vec2) Load 156(f16c2) + 3958:6(float16_t) Load 137(f16bias) + 3959:3102(ResType) ImageSparseGather 3956 3957 2187 Bias ConstOffset 3958 722 + 3960: 7(f16vec4) CompositeExtract 3959 1 + Store 3950(texel) 3960 + 3961: 47(int) CompositeExtract 3959 0 + 3962: 284 Load 286(s2DArray) + 3963: 167(fvec3) Load 169(c3) + 3964:3102(ResType) ImageSparseGather 3962 3963 2187 ConstOffset 722 + 3965: 7(f16vec4) CompositeExtract 3964 1 + Store 3950(texel) 3965 + 3966: 47(int) CompositeExtract 3964 0 + 3967: 284 Load 286(s2DArray) + 3968:175(f16vec3) Load 177(f16c3) + 3969:6(float16_t) Load 137(f16bias) + 3970:3102(ResType) ImageSparseGather 3967 3968 2187 Bias ConstOffset 3969 722 + 3971: 7(f16vec4) CompositeExtract 3970 1 + Store 3950(texel) 3971 + 3972: 47(int) CompositeExtract 3970 0 + 3973: 357 Load 359(s2DRect) + 3974: 53(fvec2) Load 148(c2) + 3975:3102(ResType) ImageSparseGather 3973 3974 2187 ConstOffset 722 + 3976: 7(f16vec4) CompositeExtract 3975 1 + Store 3950(texel) 3976 + 3977: 47(int) CompositeExtract 3975 0 + 3978: 357 Load 359(s2DRect) + 3979:154(f16vec2) Load 156(f16c2) + 3980:3102(ResType) ImageSparseGather 3978 3979 2187 ConstOffset 722 + 3981: 7(f16vec4) CompositeExtract 3980 1 + Store 3950(texel) 3981 + 3982: 47(int) CompositeExtract 3980 0 + 3983: 224 Load 226(s2DShadow) + 3984: 53(fvec2) Load 148(c2) + 3985: 52(float) Load 215(compare) + 3986:3102(ResType) ImageSparseDrefGather 3983 3984 3985 ConstOffset 722 + 3987: 7(f16vec4) CompositeExtract 3986 1 + Store 3950(texel) 3987 + 3988: 47(int) CompositeExtract 3986 0 + 3989: 224 Load 226(s2DShadow) + 3990:154(f16vec2) Load 156(f16c2) + 3991: 52(float) Load 215(compare) + 3992:3102(ResType) ImageSparseDrefGather 3989 3990 3991 ConstOffset 722 + 3993: 7(f16vec4) CompositeExtract 3992 1 + Store 3950(texel) 3993 + 3994: 47(int) CompositeExtract 3992 0 + 3995: 337 Load 339(s2DArrayShadow) + 3996: 167(fvec3) Load 169(c3) + 3997: 52(float) Load 215(compare) + 3998:3102(ResType) ImageSparseDrefGather 3995 3996 3997 ConstOffset 722 + 3999: 7(f16vec4) CompositeExtract 3998 1 + Store 3950(texel) 3999 + 4000: 47(int) CompositeExtract 3998 0 + 4001: 337 Load 339(s2DArrayShadow) + 4002:175(f16vec3) Load 177(f16c3) + 4003: 52(float) Load 215(compare) + 4004:3102(ResType) ImageSparseDrefGather 4001 4002 4003 ConstOffset 722 + 4005: 7(f16vec4) CompositeExtract 4004 1 + Store 3950(texel) 4005 + 4006: 47(int) CompositeExtract 4004 0 + 4007: 371 Load 373(s2DRectShadow) + 4008: 53(fvec2) Load 148(c2) + 4009: 52(float) Load 215(compare) + 4010:3102(ResType) ImageSparseDrefGather 4007 4008 4009 ConstOffset 722 + 4011: 7(f16vec4) CompositeExtract 4010 1 + Store 3950(texel) 4011 + 4012: 47(int) CompositeExtract 4010 0 + 4013: 371 Load 373(s2DRectShadow) + 4014:154(f16vec2) Load 156(f16c2) + 4015: 52(float) Load 215(compare) + 4016:3102(ResType) ImageSparseDrefGather 4013 4014 4015 ConstOffset 722 + 4017: 7(f16vec4) CompositeExtract 4016 1 + Store 3950(texel) 4017 + 4018: 47(int) CompositeExtract 4016 0 + 4019: 7(f16vec4) Load 3950(texel) + ReturnValue 4019 + FunctionEnd +89(testSparseTextureGatherOffsets(): 7(f16vec4) Function None 8 + 90: Label + 4022(texel): 64(ptr) Variable Function + Store 4022(texel) 121 + 4023: 143 Load 145(s2D) + 4024: 53(fvec2) Load 148(c2) + 4025:3102(ResType) ImageSparseGather 4023 4024 2187 ConstOffsets 2380 + 4026: 7(f16vec4) CompositeExtract 4025 1 + Store 4022(texel) 4026 + 4027: 47(int) CompositeExtract 4025 0 + 4028: 143 Load 145(s2D) + 4029:154(f16vec2) Load 156(f16c2) + 4030:6(float16_t) Load 137(f16bias) + 4031:3102(ResType) ImageSparseGather 4028 4029 2187 Bias ConstOffsets 4030 2380 + 4032: 7(f16vec4) CompositeExtract 4031 1 + Store 4022(texel) 4032 + 4033: 47(int) CompositeExtract 4031 0 + 4034: 284 Load 286(s2DArray) + 4035: 167(fvec3) Load 169(c3) + 4036:3102(ResType) ImageSparseGather 4034 4035 2187 ConstOffsets 2380 + 4037: 7(f16vec4) CompositeExtract 4036 1 + Store 4022(texel) 4037 + 4038: 47(int) CompositeExtract 4036 0 + 4039: 284 Load 286(s2DArray) + 4040:175(f16vec3) Load 177(f16c3) + 4041:6(float16_t) Load 137(f16bias) + 4042:3102(ResType) ImageSparseGather 4039 4040 2187 Bias ConstOffsets 4041 2380 + 4043: 7(f16vec4) CompositeExtract 4042 1 + Store 4022(texel) 4043 + 4044: 47(int) CompositeExtract 4042 0 + 4045: 357 Load 359(s2DRect) + 4046: 53(fvec2) Load 148(c2) + 4047:3102(ResType) ImageSparseGather 4045 4046 2187 ConstOffsets 2380 + 4048: 7(f16vec4) CompositeExtract 4047 1 + Store 4022(texel) 4048 + 4049: 47(int) CompositeExtract 4047 0 + 4050: 357 Load 359(s2DRect) + 4051:154(f16vec2) Load 156(f16c2) + 4052:3102(ResType) ImageSparseGather 4050 4051 2187 ConstOffsets 2380 + 4053: 7(f16vec4) CompositeExtract 4052 1 + Store 4022(texel) 4053 + 4054: 47(int) CompositeExtract 4052 0 + 4055: 224 Load 226(s2DShadow) + 4056: 53(fvec2) Load 148(c2) + 4057: 52(float) Load 215(compare) + 4058:3102(ResType) ImageSparseDrefGather 4055 4056 4057 ConstOffsets 2380 + 4059: 7(f16vec4) CompositeExtract 4058 1 + Store 4022(texel) 4059 + 4060: 47(int) CompositeExtract 4058 0 + 4061: 224 Load 226(s2DShadow) + 4062:154(f16vec2) Load 156(f16c2) + 4063: 52(float) Load 215(compare) + 4064:3102(ResType) ImageSparseDrefGather 4061 4062 4063 ConstOffsets 2380 + 4065: 7(f16vec4) CompositeExtract 4064 1 + Store 4022(texel) 4065 + 4066: 47(int) CompositeExtract 4064 0 + 4067: 337 Load 339(s2DArrayShadow) + 4068: 167(fvec3) Load 169(c3) + 4069: 52(float) Load 215(compare) + 4070:3102(ResType) ImageSparseDrefGather 4067 4068 4069 ConstOffsets 2380 + 4071: 7(f16vec4) CompositeExtract 4070 1 + Store 4022(texel) 4071 + 4072: 47(int) CompositeExtract 4070 0 + 4073: 337 Load 339(s2DArrayShadow) + 4074:175(f16vec3) Load 177(f16c3) + 4075: 52(float) Load 215(compare) + 4076:3102(ResType) ImageSparseDrefGather 4073 4074 4075 ConstOffsets 2380 + 4077: 7(f16vec4) CompositeExtract 4076 1 + Store 4022(texel) 4077 + 4078: 47(int) CompositeExtract 4076 0 + 4079: 371 Load 373(s2DRectShadow) + 4080: 53(fvec2) Load 148(c2) + 4081: 52(float) Load 215(compare) + 4082:3102(ResType) ImageSparseDrefGather 4079 4080 4081 ConstOffsets 2380 + 4083: 7(f16vec4) CompositeExtract 4082 1 + Store 4022(texel) 4083 + 4084: 47(int) CompositeExtract 4082 0 + 4085: 371 Load 373(s2DRectShadow) + 4086:154(f16vec2) Load 156(f16c2) + 4087: 52(float) Load 215(compare) + 4088:3102(ResType) ImageSparseDrefGather 4085 4086 4087 ConstOffsets 2380 + 4089: 7(f16vec4) CompositeExtract 4088 1 + Store 4022(texel) 4089 + 4090: 47(int) CompositeExtract 4088 0 + 4091: 7(f16vec4) Load 4022(texel) + ReturnValue 4091 + FunctionEnd +91(testSparseTextureGatherLod(): 7(f16vec4) Function None 8 + 92: Label + 4094(texel): 64(ptr) Variable Function + Store 4094(texel) 121 + 4095: 143 Load 145(s2D) + 4096: 53(fvec2) Load 148(c2) + 4097: 52(float) Load 565(lod) + 4098:3102(ResType) ImageSparseGather 4095 4096 2187 Lod 4097 + 4099: 7(f16vec4) CompositeExtract 4098 1 + Store 4094(texel) 4099 + 4100: 47(int) CompositeExtract 4098 0 + 4101: 143 Load 145(s2D) + 4102:154(f16vec2) Load 156(f16c2) + 4103:6(float16_t) Load 572(f16lod) + 4104:3102(ResType) ImageSparseGather 4101 4102 2187 Lod 4103 + 4105: 7(f16vec4) CompositeExtract 4104 1 + Store 4094(texel) 4105 + 4106: 47(int) CompositeExtract 4104 0 + 4107: 284 Load 286(s2DArray) + 4108: 167(fvec3) Load 169(c3) + 4109: 52(float) Load 565(lod) + 4110:3102(ResType) ImageSparseGather 4107 4108 2187 Lod 4109 + 4111: 7(f16vec4) CompositeExtract 4110 1 + Store 4094(texel) 4111 + 4112: 47(int) CompositeExtract 4110 0 + 4113: 284 Load 286(s2DArray) + 4114:175(f16vec3) Load 177(f16c3) + 4115:6(float16_t) Load 572(f16lod) + 4116:3102(ResType) ImageSparseGather 4113 4114 2187 Lod 4115 + 4117: 7(f16vec4) CompositeExtract 4116 1 + Store 4094(texel) 4117 + 4118: 47(int) CompositeExtract 4116 0 + 4119: 184 Load 186(sCube) + 4120: 167(fvec3) Load 169(c3) + 4121: 52(float) Load 565(lod) + 4122:3102(ResType) ImageSparseGather 4119 4120 2187 Lod 4121 + 4123: 7(f16vec4) CompositeExtract 4122 1 + Store 4094(texel) 4123 + 4124: 47(int) CompositeExtract 4122 0 + 4125: 184 Load 186(sCube) + 4126:175(f16vec3) Load 177(f16c3) + 4127:6(float16_t) Load 572(f16lod) + 4128:3102(ResType) ImageSparseGather 4125 4126 2187 Lod 4127 + 4129: 7(f16vec4) CompositeExtract 4128 1 + Store 4094(texel) 4129 + 4130: 47(int) CompositeExtract 4128 0 + 4131: 299 Load 301(sCubeArray) + 4132: 249(fvec4) Load 251(c4) + 4133: 52(float) Load 565(lod) + 4134:3102(ResType) ImageSparseGather 4131 4132 2187 Lod 4133 + 4135: 7(f16vec4) CompositeExtract 4134 1 + Store 4094(texel) 4135 + 4136: 47(int) CompositeExtract 4134 0 + 4137: 299 Load 301(sCubeArray) + 4138: 7(f16vec4) Load 309(f16c4) + 4139:6(float16_t) Load 572(f16lod) + 4140:3102(ResType) ImageSparseGather 4137 4138 2187 Lod 4139 + 4141: 7(f16vec4) CompositeExtract 4140 1 + Store 4094(texel) 4141 + 4142: 47(int) CompositeExtract 4140 0 + 4143: 7(f16vec4) Load 4094(texel) + ReturnValue 4143 + FunctionEnd +93(testSparseTextureGatherLodOffset(): 7(f16vec4) Function None 8 + 94: Label + 4146(texel): 64(ptr) Variable Function + Store 4146(texel) 121 + 4147: 143 Load 145(s2D) + 4148: 53(fvec2) Load 148(c2) + 4149: 52(float) Load 565(lod) + 4150:3102(ResType) ImageSparseGather 4147 4148 2187 Lod ConstOffset 4149 722 + 4151: 7(f16vec4) CompositeExtract 4150 1 + Store 4146(texel) 4151 + 4152: 47(int) CompositeExtract 4150 0 + 4153: 143 Load 145(s2D) + 4154:154(f16vec2) Load 156(f16c2) + 4155:6(float16_t) Load 572(f16lod) + 4156:3102(ResType) ImageSparseGather 4153 4154 2187 Lod ConstOffset 4155 722 + 4157: 7(f16vec4) CompositeExtract 4156 1 + Store 4146(texel) 4157 + 4158: 47(int) CompositeExtract 4156 0 + 4159: 284 Load 286(s2DArray) + 4160: 167(fvec3) Load 169(c3) + 4161: 52(float) Load 565(lod) + 4162:3102(ResType) ImageSparseGather 4159 4160 2187 Lod ConstOffset 4161 722 + 4163: 7(f16vec4) CompositeExtract 4162 1 + Store 4146(texel) 4163 + 4164: 47(int) CompositeExtract 4162 0 + 4165: 284 Load 286(s2DArray) + 4166:175(f16vec3) Load 177(f16c3) + 4167:6(float16_t) Load 572(f16lod) + 4168:3102(ResType) ImageSparseGather 4165 4166 2187 Lod ConstOffset 4167 722 + 4169: 7(f16vec4) CompositeExtract 4168 1 + Store 4146(texel) 4169 + 4170: 47(int) CompositeExtract 4168 0 + 4171: 7(f16vec4) Load 4146(texel) + ReturnValue 4171 + FunctionEnd +95(testSparseTextureGatherLodOffsets(): 7(f16vec4) Function None 8 + 96: Label + 4174(texel): 64(ptr) Variable Function + Store 4174(texel) 121 + 4175: 143 Load 145(s2D) + 4176: 53(fvec2) Load 148(c2) + 4177: 52(float) Load 565(lod) + 4178:3102(ResType) ImageSparseGather 4175 4176 2187 Lod ConstOffsets 4177 2380 + 4179: 7(f16vec4) CompositeExtract 4178 1 + Store 4174(texel) 4179 + 4180: 47(int) CompositeExtract 4178 0 + 4181: 143 Load 145(s2D) + 4182:154(f16vec2) Load 156(f16c2) + 4183:6(float16_t) Load 572(f16lod) + 4184:3102(ResType) ImageSparseGather 4181 4182 2187 Lod ConstOffsets 4183 2380 + 4185: 7(f16vec4) CompositeExtract 4184 1 + Store 4174(texel) 4185 + 4186: 47(int) CompositeExtract 4184 0 + 4187: 284 Load 286(s2DArray) + 4188: 167(fvec3) Load 169(c3) + 4189: 52(float) Load 565(lod) + 4190:3102(ResType) ImageSparseGather 4187 4188 2187 Lod ConstOffsets 4189 2380 + 4191: 7(f16vec4) CompositeExtract 4190 1 + Store 4174(texel) 4191 + 4192: 47(int) CompositeExtract 4190 0 + 4193: 284 Load 286(s2DArray) + 4194:175(f16vec3) Load 177(f16c3) + 4195:6(float16_t) Load 572(f16lod) + 4196:3102(ResType) ImageSparseGather 4193 4194 2187 Lod ConstOffsets 4195 2380 + 4197: 7(f16vec4) CompositeExtract 4196 1 + Store 4174(texel) 4197 + 4198: 47(int) CompositeExtract 4196 0 + 4199: 7(f16vec4) Load 4174(texel) + ReturnValue 4199 + FunctionEnd +97(testSparseImageLoad(): 7(f16vec4) Function None 8 + 98: Label + 4202(texel): 64(ptr) Variable Function + Store 4202(texel) 121 + 4203: 2962 Load 2964(i2D) + 4204: 53(fvec2) Load 148(c2) + 4205: 721(ivec2) ConvertFToS 4204 + 4206:3102(ResType) ImageSparseRead 4203 4205 + 4207: 7(f16vec4) CompositeExtract 4206 1 + Store 4202(texel) 4207 + 4208: 47(int) CompositeExtract 4206 0 + 4209: 2971 Load 2973(i3D) + 4210: 167(fvec3) Load 169(c3) + 4211: 734(ivec3) ConvertFToS 4210 + 4212:3102(ResType) ImageSparseRead 4209 4211 + 4213: 7(f16vec4) CompositeExtract 4212 1 + Store 4202(texel) 4213 + 4214: 47(int) CompositeExtract 4212 0 + 4215: 2980 Load 2982(i2DRect) + 4216: 53(fvec2) Load 148(c2) + 4217: 721(ivec2) ConvertFToS 4216 + 4218:3102(ResType) ImageSparseRead 4215 4217 + 4219: 7(f16vec4) CompositeExtract 4218 1 + Store 4202(texel) 4219 + 4220: 47(int) CompositeExtract 4218 0 + 4221: 2989 Load 2991(iCube) + 4222: 167(fvec3) Load 169(c3) + 4223: 734(ivec3) ConvertFToS 4222 + 4224:3102(ResType) ImageSparseRead 4221 4223 + 4225: 7(f16vec4) CompositeExtract 4224 1 + Store 4202(texel) 4225 + 4226: 47(int) CompositeExtract 4224 0 + 4227: 3016 Load 3018(i2DArray) + 4228: 167(fvec3) Load 169(c3) + 4229: 734(ivec3) ConvertFToS 4228 + 4230:3102(ResType) ImageSparseRead 4227 4229 + 4231: 7(f16vec4) CompositeExtract 4230 1 + Store 4202(texel) 4231 + 4232: 47(int) CompositeExtract 4230 0 + 4233: 3025 Load 3027(iCubeArray) + 4234: 167(fvec3) Load 169(c3) + 4235: 734(ivec3) ConvertFToS 4234 + 4236:3102(ResType) ImageSparseRead 4233 4235 + 4237: 7(f16vec4) CompositeExtract 4236 1 + Store 4202(texel) 4237 + 4238: 47(int) CompositeExtract 4236 0 + 4239: 3034 Load 3036(i2DMS) + 4240: 53(fvec2) Load 148(c2) + 4241: 721(ivec2) ConvertFToS 4240 + 4242:3102(ResType) ImageSparseRead 4239 4241 Sample 709 + 4243: 7(f16vec4) CompositeExtract 4242 1 + Store 4202(texel) 4243 + 4244: 47(int) CompositeExtract 4242 0 + 4245: 3043 Load 3045(i2DMSArray) + 4246: 167(fvec3) Load 169(c3) + 4247: 734(ivec3) ConvertFToS 4246 + 4248:3102(ResType) ImageSparseRead 4245 4247 Sample 1326 + 4249: 7(f16vec4) CompositeExtract 4248 1 + Store 4202(texel) 4249 + 4250: 47(int) CompositeExtract 4248 0 + 4251: 7(f16vec4) Load 4202(texel) + ReturnValue 4251 + FunctionEnd +99(testSparseTextureClamp(): 7(f16vec4) Function None 8 + 100: Label + 4254(texel): 64(ptr) Variable Function + Store 4254(texel) 121 + 4255: 143 Load 145(s2D) + 4256: 53(fvec2) Load 148(c2) + 4258: 52(float) Load 4257(lodClamp) + 4259:3102(ResType) ImageSparseSampleImplicitLod 4255 4256 MinLod 4258 + 4260: 7(f16vec4) CompositeExtract 4259 1 + Store 4254(texel) 4260 + 4261: 47(int) CompositeExtract 4259 0 + 4262: 143 Load 145(s2D) + 4263:154(f16vec2) Load 156(f16c2) + 4265:6(float16_t) Load 4264(f16lodClamp) + 4266:6(float16_t) Load 137(f16bias) + 4267:3102(ResType) ImageSparseSampleImplicitLod 4262 4263 Bias MinLod 4266 4265 + 4268: 7(f16vec4) CompositeExtract 4267 1 + Store 4254(texel) 4268 + 4269: 47(int) CompositeExtract 4267 0 + 4270: 163 Load 165(s3D) + 4271: 167(fvec3) Load 169(c3) + 4272: 52(float) Load 4257(lodClamp) + 4273:3102(ResType) ImageSparseSampleImplicitLod 4270 4271 MinLod 4272 + 4274: 7(f16vec4) CompositeExtract 4273 1 + Store 4254(texel) 4274 + 4275: 47(int) CompositeExtract 4273 0 + 4276: 163 Load 165(s3D) + 4277:175(f16vec3) Load 177(f16c3) + 4278:6(float16_t) Load 4264(f16lodClamp) + 4279:6(float16_t) Load 137(f16bias) + 4280:3102(ResType) ImageSparseSampleImplicitLod 4276 4277 Bias MinLod 4279 4278 + 4281: 7(f16vec4) CompositeExtract 4280 1 + Store 4254(texel) 4281 + 4282: 47(int) CompositeExtract 4280 0 + 4283: 184 Load 186(sCube) + 4284: 167(fvec3) Load 169(c3) + 4285: 52(float) Load 4257(lodClamp) + 4286:3102(ResType) ImageSparseSampleImplicitLod 4283 4284 MinLod 4285 + 4287: 7(f16vec4) CompositeExtract 4286 1 + Store 4254(texel) 4287 + 4288: 47(int) CompositeExtract 4286 0 + 4289: 184 Load 186(sCube) + 4290:175(f16vec3) Load 177(f16c3) + 4291:6(float16_t) Load 4264(f16lodClamp) + 4292:6(float16_t) Load 137(f16bias) + 4293:3102(ResType) ImageSparseSampleImplicitLod 4289 4290 Bias MinLod 4292 4291 + 4294: 7(f16vec4) CompositeExtract 4293 1 + Store 4254(texel) 4294 + 4295: 47(int) CompositeExtract 4293 0 + 4296: 224 Load 226(s2DShadow) + 4297: 167(fvec3) Load 169(c3) + 4298: 52(float) Load 4257(lodClamp) + 4299: 208(ptr) AccessChain 4254(texel) 207 + 4300: 52(float) CompositeExtract 4297 2 + 4301:3138(ResType) ImageSparseSampleDrefImplicitLod 4296 4297 4300 MinLod 4298 + 4302:6(float16_t) CompositeExtract 4301 1 + Store 4299 4302 + 4303: 47(int) CompositeExtract 4301 0 + 4304: 224 Load 226(s2DShadow) + 4305:154(f16vec2) Load 156(f16c2) + 4306: 52(float) Load 215(compare) + 4307:6(float16_t) Load 4264(f16lodClamp) + 4308: 208(ptr) AccessChain 4254(texel) 207 + 4309:6(float16_t) Load 137(f16bias) + 4310:3138(ResType) ImageSparseSampleDrefImplicitLod 4304 4305 4306 Bias MinLod 4309 4307 + 4311:6(float16_t) CompositeExtract 4310 1 + Store 4308 4311 + 4312: 47(int) CompositeExtract 4310 0 + 4313: 245 Load 247(sCubeShadow) + 4314: 249(fvec4) Load 251(c4) + 4315: 52(float) Load 4257(lodClamp) + 4316: 208(ptr) AccessChain 4254(texel) 207 + 4317: 52(float) CompositeExtract 4314 3 + 4318:3138(ResType) ImageSparseSampleDrefImplicitLod 4313 4314 4317 MinLod 4315 + 4319:6(float16_t) CompositeExtract 4318 1 + Store 4316 4319 + 4320: 47(int) CompositeExtract 4318 0 + 4321: 245 Load 247(sCubeShadow) + 4322:175(f16vec3) Load 177(f16c3) + 4323: 52(float) Load 215(compare) + 4324:6(float16_t) Load 4264(f16lodClamp) + 4325: 208(ptr) AccessChain 4254(texel) 207 + 4326:6(float16_t) Load 137(f16bias) + 4327:3138(ResType) ImageSparseSampleDrefImplicitLod 4321 4322 4323 Bias MinLod 4326 4324 + 4328:6(float16_t) CompositeExtract 4327 1 + Store 4325 4328 + 4329: 47(int) CompositeExtract 4327 0 + 4330: 284 Load 286(s2DArray) + 4331: 167(fvec3) Load 169(c3) + 4332: 52(float) Load 4257(lodClamp) + 4333:3102(ResType) ImageSparseSampleImplicitLod 4330 4331 MinLod 4332 + 4334: 7(f16vec4) CompositeExtract 4333 1 + Store 4254(texel) 4334 + 4335: 47(int) CompositeExtract 4333 0 + 4336: 284 Load 286(s2DArray) + 4337:175(f16vec3) Load 177(f16c3) + 4338:6(float16_t) Load 4264(f16lodClamp) + 4339:6(float16_t) Load 137(f16bias) + 4340:3102(ResType) ImageSparseSampleImplicitLod 4336 4337 Bias MinLod 4339 4338 + 4341: 7(f16vec4) CompositeExtract 4340 1 + Store 4254(texel) 4341 + 4342: 47(int) CompositeExtract 4340 0 + 4343: 299 Load 301(sCubeArray) + 4344: 249(fvec4) Load 251(c4) + 4345: 52(float) Load 4257(lodClamp) + 4346:3102(ResType) ImageSparseSampleImplicitLod 4343 4344 MinLod 4345 + 4347: 7(f16vec4) CompositeExtract 4346 1 + Store 4254(texel) 4347 + 4348: 47(int) CompositeExtract 4346 0 + 4349: 299 Load 301(sCubeArray) + 4350: 7(f16vec4) Load 309(f16c4) + 4351:6(float16_t) Load 4264(f16lodClamp) + 4352:6(float16_t) Load 137(f16bias) + 4353:3102(ResType) ImageSparseSampleImplicitLod 4349 4350 Bias MinLod 4352 4351 + 4354: 7(f16vec4) CompositeExtract 4353 1 + Store 4254(texel) 4354 + 4355: 47(int) CompositeExtract 4353 0 + 4356: 337 Load 339(s2DArrayShadow) + 4357: 249(fvec4) Load 251(c4) + 4358: 52(float) Load 4257(lodClamp) + 4359: 208(ptr) AccessChain 4254(texel) 207 + 4360: 52(float) CompositeExtract 4357 3 + 4361:3138(ResType) ImageSparseSampleDrefImplicitLod 4356 4357 4360 MinLod 4358 + 4362:6(float16_t) CompositeExtract 4361 1 + Store 4359 4362 + 4363: 47(int) CompositeExtract 4361 0 + 4364: 337 Load 339(s2DArrayShadow) + 4365:175(f16vec3) Load 177(f16c3) + 4366: 52(float) Load 215(compare) + 4367:6(float16_t) Load 4264(f16lodClamp) + 4368: 208(ptr) AccessChain 4254(texel) 207 + 4369:3138(ResType) ImageSparseSampleDrefImplicitLod 4364 4365 4366 MinLod 4367 + 4370:6(float16_t) CompositeExtract 4369 1 + Store 4368 4370 + 4371: 47(int) CompositeExtract 4369 0 + 4372: 391 Load 393(sCubeArrayShadow) + 4373: 249(fvec4) Load 251(c4) + 4374: 52(float) Load 215(compare) + 4375: 52(float) Load 4257(lodClamp) + 4376: 208(ptr) AccessChain 4254(texel) 207 + 4377:3138(ResType) ImageSparseSampleDrefImplicitLod 4372 4373 4374 MinLod 4375 + 4378:6(float16_t) CompositeExtract 4377 1 + Store 4376 4378 + 4379: 47(int) CompositeExtract 4377 0 + 4380: 391 Load 393(sCubeArrayShadow) + 4381: 7(f16vec4) Load 309(f16c4) + 4382: 52(float) Load 215(compare) + 4383:6(float16_t) Load 4264(f16lodClamp) + 4384: 208(ptr) AccessChain 4254(texel) 207 + 4385:3138(ResType) ImageSparseSampleDrefImplicitLod 4380 4381 4382 MinLod 4383 + 4386:6(float16_t) CompositeExtract 4385 1 + Store 4384 4386 + 4387: 47(int) CompositeExtract 4385 0 + 4388: 7(f16vec4) Load 4254(texel) + ReturnValue 4388 + FunctionEnd +101(testTextureClamp(): 7(f16vec4) Function None 8 + 102: Label + 4391(texel): 64(ptr) Variable Function + Store 4391(texel) 121 + 4392: 123 Load 125(s1D) + 4393: 52(float) Load 128(c1) + 4394: 52(float) Load 4257(lodClamp) + 4395: 7(f16vec4) ImageSampleImplicitLod 4392 4393 MinLod 4394 + 4396: 7(f16vec4) Load 4391(texel) + 4397: 7(f16vec4) FAdd 4396 4395 + Store 4391(texel) 4397 + 4398: 123 Load 125(s1D) + 4399:6(float16_t) Load 135(f16c1) + 4400:6(float16_t) Load 4264(f16lodClamp) + 4401:6(float16_t) Load 137(f16bias) + 4402: 7(f16vec4) ImageSampleImplicitLod 4398 4399 Bias MinLod 4401 4400 + 4403: 7(f16vec4) Load 4391(texel) + 4404: 7(f16vec4) FAdd 4403 4402 + Store 4391(texel) 4404 + 4405: 143 Load 145(s2D) + 4406: 53(fvec2) Load 148(c2) + 4407: 52(float) Load 4257(lodClamp) + 4408: 7(f16vec4) ImageSampleImplicitLod 4405 4406 MinLod 4407 + 4409: 7(f16vec4) Load 4391(texel) + 4410: 7(f16vec4) FAdd 4409 4408 + Store 4391(texel) 4410 + 4411: 143 Load 145(s2D) + 4412:154(f16vec2) Load 156(f16c2) + 4413:6(float16_t) Load 4264(f16lodClamp) + 4414:6(float16_t) Load 137(f16bias) + 4415: 7(f16vec4) ImageSampleImplicitLod 4411 4412 Bias MinLod 4414 4413 + 4416: 7(f16vec4) Load 4391(texel) + 4417: 7(f16vec4) FAdd 4416 4415 + Store 4391(texel) 4417 + 4418: 163 Load 165(s3D) + 4419: 167(fvec3) Load 169(c3) + 4420: 52(float) Load 4257(lodClamp) + 4421: 7(f16vec4) ImageSampleImplicitLod 4418 4419 MinLod 4420 + 4422: 7(f16vec4) Load 4391(texel) + 4423: 7(f16vec4) FAdd 4422 4421 + Store 4391(texel) 4423 + 4424: 163 Load 165(s3D) + 4425:175(f16vec3) Load 177(f16c3) + 4426:6(float16_t) Load 4264(f16lodClamp) + 4427:6(float16_t) Load 137(f16bias) + 4428: 7(f16vec4) ImageSampleImplicitLod 4424 4425 Bias MinLod 4427 4426 + 4429: 7(f16vec4) Load 4391(texel) + 4430: 7(f16vec4) FAdd 4429 4428 + Store 4391(texel) 4430 + 4431: 184 Load 186(sCube) + 4432: 167(fvec3) Load 169(c3) + 4433: 52(float) Load 4257(lodClamp) + 4434: 7(f16vec4) ImageSampleImplicitLod 4431 4432 MinLod 4433 + 4435: 7(f16vec4) Load 4391(texel) + 4436: 7(f16vec4) FAdd 4435 4434 + Store 4391(texel) 4436 + 4437: 184 Load 186(sCube) + 4438:175(f16vec3) Load 177(f16c3) + 4439:6(float16_t) Load 4264(f16lodClamp) + 4440:6(float16_t) Load 137(f16bias) + 4441: 7(f16vec4) ImageSampleImplicitLod 4437 4438 Bias MinLod 4440 4439 + 4442: 7(f16vec4) Load 4391(texel) + 4443: 7(f16vec4) FAdd 4442 4441 + Store 4391(texel) 4443 + 4444: 199 Load 201(s1DShadow) + 4445: 167(fvec3) Load 169(c3) + 4446: 52(float) Load 4257(lodClamp) + 4447: 52(float) CompositeExtract 4445 2 + 4448:6(float16_t) ImageSampleDrefImplicitLod 4444 4445 4447 MinLod 4446 + 4449: 208(ptr) AccessChain 4391(texel) 207 + 4450:6(float16_t) Load 4449 + 4451:6(float16_t) FAdd 4450 4448 + 4452: 208(ptr) AccessChain 4391(texel) 207 + Store 4452 4451 + 4453: 199 Load 201(s1DShadow) + 4454:154(f16vec2) Load 156(f16c2) + 4455: 52(float) Load 215(compare) + 4456:6(float16_t) Load 4264(f16lodClamp) + 4457:6(float16_t) Load 137(f16bias) + 4458:6(float16_t) ImageSampleDrefImplicitLod 4453 4454 4455 Bias MinLod 4457 4456 + 4459: 208(ptr) AccessChain 4391(texel) 207 + 4460:6(float16_t) Load 4459 + 4461:6(float16_t) FAdd 4460 4458 + 4462: 208(ptr) AccessChain 4391(texel) 207 + Store 4462 4461 + 4463: 224 Load 226(s2DShadow) + 4464: 167(fvec3) Load 169(c3) + 4465: 52(float) Load 4257(lodClamp) + 4466: 52(float) CompositeExtract 4464 2 + 4467:6(float16_t) ImageSampleDrefImplicitLod 4463 4464 4466 MinLod 4465 + 4468: 208(ptr) AccessChain 4391(texel) 207 + 4469:6(float16_t) Load 4468 + 4470:6(float16_t) FAdd 4469 4467 + 4471: 208(ptr) AccessChain 4391(texel) 207 + Store 4471 4470 + 4472: 224 Load 226(s2DShadow) + 4473:154(f16vec2) Load 156(f16c2) + 4474: 52(float) Load 215(compare) + 4475:6(float16_t) Load 4264(f16lodClamp) + 4476:6(float16_t) Load 137(f16bias) + 4477:6(float16_t) ImageSampleDrefImplicitLod 4472 4473 4474 Bias MinLod 4476 4475 + 4478: 208(ptr) AccessChain 4391(texel) 207 + 4479:6(float16_t) Load 4478 + 4480:6(float16_t) FAdd 4479 4477 + 4481: 208(ptr) AccessChain 4391(texel) 207 + Store 4481 4480 + 4482: 245 Load 247(sCubeShadow) + 4483: 249(fvec4) Load 251(c4) + 4484: 52(float) Load 4257(lodClamp) + 4485: 52(float) CompositeExtract 4483 3 + 4486:6(float16_t) ImageSampleDrefImplicitLod 4482 4483 4485 MinLod 4484 + 4487: 208(ptr) AccessChain 4391(texel) 207 + 4488:6(float16_t) Load 4487 + 4489:6(float16_t) FAdd 4488 4486 + 4490: 208(ptr) AccessChain 4391(texel) 207 + Store 4490 4489 + 4491: 245 Load 247(sCubeShadow) + 4492:175(f16vec3) Load 177(f16c3) + 4493: 52(float) Load 215(compare) + 4494:6(float16_t) Load 4264(f16lodClamp) + 4495:6(float16_t) Load 137(f16bias) + 4496:6(float16_t) ImageSampleDrefImplicitLod 4491 4492 4493 Bias MinLod 4495 4494 + 4497: 208(ptr) AccessChain 4391(texel) 207 + 4498:6(float16_t) Load 4497 + 4499:6(float16_t) FAdd 4498 4496 + 4500: 208(ptr) AccessChain 4391(texel) 207 + Store 4500 4499 + 4501: 269 Load 271(s1DArray) + 4502: 53(fvec2) Load 148(c2) + 4503: 52(float) Load 4257(lodClamp) + 4504: 7(f16vec4) ImageSampleImplicitLod 4501 4502 MinLod 4503 + 4505: 7(f16vec4) Load 4391(texel) + 4506: 7(f16vec4) FAdd 4505 4504 + Store 4391(texel) 4506 + 4507: 269 Load 271(s1DArray) + 4508:154(f16vec2) Load 156(f16c2) + 4509:6(float16_t) Load 4264(f16lodClamp) + 4510:6(float16_t) Load 137(f16bias) + 4511: 7(f16vec4) ImageSampleImplicitLod 4507 4508 Bias MinLod 4510 4509 + 4512: 7(f16vec4) Load 4391(texel) + 4513: 7(f16vec4) FAdd 4512 4511 + Store 4391(texel) 4513 + 4514: 284 Load 286(s2DArray) + 4515: 167(fvec3) Load 169(c3) + 4516: 52(float) Load 4257(lodClamp) + 4517: 7(f16vec4) ImageSampleImplicitLod 4514 4515 MinLod 4516 + 4518: 7(f16vec4) Load 4391(texel) + 4519: 7(f16vec4) FAdd 4518 4517 + Store 4391(texel) 4519 + 4520: 284 Load 286(s2DArray) + 4521:175(f16vec3) Load 177(f16c3) + 4522:6(float16_t) Load 4264(f16lodClamp) + 4523:6(float16_t) Load 137(f16bias) + 4524: 7(f16vec4) ImageSampleImplicitLod 4520 4521 Bias MinLod 4523 4522 + 4525: 7(f16vec4) Load 4391(texel) + 4526: 7(f16vec4) FAdd 4525 4524 + Store 4391(texel) 4526 + 4527: 299 Load 301(sCubeArray) + 4528: 249(fvec4) Load 251(c4) + 4529: 52(float) Load 4257(lodClamp) + 4530: 7(f16vec4) ImageSampleImplicitLod 4527 4528 MinLod 4529 + 4531: 7(f16vec4) Load 4391(texel) + 4532: 7(f16vec4) FAdd 4531 4530 + Store 4391(texel) 4532 + 4533: 299 Load 301(sCubeArray) + 4534: 7(f16vec4) Load 309(f16c4) + 4535:6(float16_t) Load 4264(f16lodClamp) + 4536:6(float16_t) Load 137(f16bias) + 4537: 7(f16vec4) ImageSampleImplicitLod 4533 4534 Bias MinLod 4536 4535 + 4538: 7(f16vec4) Load 4391(texel) + 4539: 7(f16vec4) FAdd 4538 4537 + Store 4391(texel) 4539 + 4540: 316 Load 318(s1DArrayShadow) + 4541: 167(fvec3) Load 169(c3) + 4542: 52(float) Load 4257(lodClamp) + 4543: 52(float) CompositeExtract 4541 2 + 4544:6(float16_t) ImageSampleDrefImplicitLod 4540 4541 4543 MinLod 4542 + 4545: 208(ptr) AccessChain 4391(texel) 207 + 4546:6(float16_t) Load 4545 + 4547:6(float16_t) FAdd 4546 4544 + 4548: 208(ptr) AccessChain 4391(texel) 207 + Store 4548 4547 + 4549: 316 Load 318(s1DArrayShadow) + 4550:154(f16vec2) Load 156(f16c2) + 4551: 52(float) Load 215(compare) + 4552:6(float16_t) Load 4264(f16lodClamp) + 4553:6(float16_t) Load 137(f16bias) + 4554:6(float16_t) ImageSampleDrefImplicitLod 4549 4550 4551 Bias MinLod 4553 4552 + 4555: 208(ptr) AccessChain 4391(texel) 207 + 4556:6(float16_t) Load 4555 + 4557:6(float16_t) FAdd 4556 4554 + 4558: 208(ptr) AccessChain 4391(texel) 207 + Store 4558 4557 + 4559: 337 Load 339(s2DArrayShadow) + 4560: 249(fvec4) Load 251(c4) + 4561: 52(float) Load 4257(lodClamp) + 4562: 52(float) CompositeExtract 4560 3 + 4563:6(float16_t) ImageSampleDrefImplicitLod 4559 4560 4562 MinLod 4561 + 4564: 208(ptr) AccessChain 4391(texel) 207 + 4565:6(float16_t) Load 4564 + 4566:6(float16_t) FAdd 4565 4563 + 4567: 208(ptr) AccessChain 4391(texel) 207 + Store 4567 4566 + 4568: 337 Load 339(s2DArrayShadow) + 4569:175(f16vec3) Load 177(f16c3) + 4570: 52(float) Load 215(compare) + 4571:6(float16_t) Load 4264(f16lodClamp) + 4572:6(float16_t) ImageSampleDrefImplicitLod 4568 4569 4570 MinLod 4571 + 4573: 208(ptr) AccessChain 4391(texel) 207 + 4574:6(float16_t) Load 4573 + 4575:6(float16_t) FAdd 4574 4572 + 4576: 208(ptr) AccessChain 4391(texel) 207 + Store 4576 4575 + 4577: 391 Load 393(sCubeArrayShadow) + 4578: 249(fvec4) Load 251(c4) + 4579: 52(float) Load 215(compare) + 4580: 52(float) Load 4257(lodClamp) + 4581:6(float16_t) ImageSampleDrefImplicitLod 4577 4578 4579 MinLod 4580 + 4582: 208(ptr) AccessChain 4391(texel) 207 + 4583:6(float16_t) Load 4582 + 4584:6(float16_t) FAdd 4583 4581 + 4585: 208(ptr) AccessChain 4391(texel) 207 + Store 4585 4584 + 4586: 391 Load 393(sCubeArrayShadow) + 4587: 7(f16vec4) Load 309(f16c4) + 4588: 52(float) Load 215(compare) + 4589:6(float16_t) Load 4264(f16lodClamp) + 4590:6(float16_t) ImageSampleDrefImplicitLod 4586 4587 4588 MinLod 4589 + 4591: 208(ptr) AccessChain 4391(texel) 207 + 4592:6(float16_t) Load 4591 + 4593:6(float16_t) FAdd 4592 4590 + 4594: 208(ptr) AccessChain 4391(texel) 207 + Store 4594 4593 + 4595: 7(f16vec4) Load 4391(texel) + ReturnValue 4595 + FunctionEnd +103(testSparseTextureOffsetClamp(): 7(f16vec4) Function None 8 + 104: Label + 4598(texel): 64(ptr) Variable Function + Store 4598(texel) 121 + 4599: 143 Load 145(s2D) + 4600: 53(fvec2) Load 148(c2) + 4601: 52(float) Load 4257(lodClamp) + 4602:3102(ResType) ImageSparseSampleImplicitLod 4599 4600 ConstOffset MinLod 722 4601 + 4603: 7(f16vec4) CompositeExtract 4602 1 + Store 4598(texel) 4603 + 4604: 47(int) CompositeExtract 4602 0 + 4605: 143 Load 145(s2D) + 4606:154(f16vec2) Load 156(f16c2) + 4607:6(float16_t) Load 4264(f16lodClamp) + 4608:6(float16_t) Load 137(f16bias) + 4609:3102(ResType) ImageSparseSampleImplicitLod 4605 4606 Bias ConstOffset MinLod 4608 722 4607 + 4610: 7(f16vec4) CompositeExtract 4609 1 + Store 4598(texel) 4610 + 4611: 47(int) CompositeExtract 4609 0 + 4612: 163 Load 165(s3D) + 4613: 167(fvec3) Load 169(c3) + 4614: 52(float) Load 4257(lodClamp) + 4615:3102(ResType) ImageSparseSampleImplicitLod 4612 4613 ConstOffset MinLod 735 4614 + 4616: 7(f16vec4) CompositeExtract 4615 1 + Store 4598(texel) 4616 + 4617: 47(int) CompositeExtract 4615 0 + 4618: 163 Load 165(s3D) + 4619:175(f16vec3) Load 177(f16c3) + 4620:6(float16_t) Load 4264(f16lodClamp) + 4621:6(float16_t) Load 137(f16bias) + 4622:3102(ResType) ImageSparseSampleImplicitLod 4618 4619 Bias ConstOffset MinLod 4621 735 4620 + 4623: 7(f16vec4) CompositeExtract 4622 1 + Store 4598(texel) 4623 + 4624: 47(int) CompositeExtract 4622 0 + 4625: 224 Load 226(s2DShadow) + 4626: 167(fvec3) Load 169(c3) + 4627: 52(float) Load 4257(lodClamp) + 4628: 208(ptr) AccessChain 4598(texel) 207 + 4629: 52(float) CompositeExtract 4626 2 + 4630:3138(ResType) ImageSparseSampleDrefImplicitLod 4625 4626 4629 ConstOffset MinLod 722 4627 + 4631:6(float16_t) CompositeExtract 4630 1 + Store 4628 4631 + 4632: 47(int) CompositeExtract 4630 0 + 4633: 224 Load 226(s2DShadow) + 4634:154(f16vec2) Load 156(f16c2) + 4635: 52(float) Load 215(compare) + 4636:6(float16_t) Load 4264(f16lodClamp) + 4637: 208(ptr) AccessChain 4598(texel) 207 + 4638:6(float16_t) Load 137(f16bias) + 4639:3138(ResType) ImageSparseSampleDrefImplicitLod 4633 4634 4635 Bias ConstOffset MinLod 4638 722 4636 + 4640:6(float16_t) CompositeExtract 4639 1 + Store 4637 4640 + 4641: 47(int) CompositeExtract 4639 0 + 4642: 284 Load 286(s2DArray) + 4643: 167(fvec3) Load 169(c3) + 4644: 52(float) Load 4257(lodClamp) + 4645:3102(ResType) ImageSparseSampleImplicitLod 4642 4643 ConstOffset MinLod 722 4644 + 4646: 7(f16vec4) CompositeExtract 4645 1 + Store 4598(texel) 4646 + 4647: 47(int) CompositeExtract 4645 0 + 4648: 284 Load 286(s2DArray) + 4649:175(f16vec3) Load 177(f16c3) + 4650:6(float16_t) Load 4264(f16lodClamp) + 4651:6(float16_t) Load 137(f16bias) + 4652:3102(ResType) ImageSparseSampleImplicitLod 4648 4649 Bias ConstOffset MinLod 4651 722 4650 + 4653: 7(f16vec4) CompositeExtract 4652 1 + Store 4598(texel) 4653 + 4654: 47(int) CompositeExtract 4652 0 + 4655: 337 Load 339(s2DArrayShadow) + 4656: 249(fvec4) Load 251(c4) + 4657: 52(float) Load 4257(lodClamp) + 4658: 208(ptr) AccessChain 4598(texel) 207 + 4659: 52(float) CompositeExtract 4656 3 + 4660:3138(ResType) ImageSparseSampleDrefImplicitLod 4655 4656 4659 ConstOffset MinLod 722 4657 + 4661:6(float16_t) CompositeExtract 4660 1 + Store 4658 4661 + 4662: 47(int) CompositeExtract 4660 0 + 4663: 337 Load 339(s2DArrayShadow) + 4664:175(f16vec3) Load 177(f16c3) + 4665: 52(float) Load 215(compare) + 4666:6(float16_t) Load 4264(f16lodClamp) + 4667: 208(ptr) AccessChain 4598(texel) 207 + 4668:3138(ResType) ImageSparseSampleDrefImplicitLod 4663 4664 4665 ConstOffset MinLod 722 4666 + 4669:6(float16_t) CompositeExtract 4668 1 + Store 4667 4669 + 4670: 47(int) CompositeExtract 4668 0 + 4671: 7(f16vec4) Load 4598(texel) + ReturnValue 4671 + FunctionEnd +105(testTextureOffsetClamp(): 7(f16vec4) Function None 8 + 106: Label + 4674(texel): 64(ptr) Variable Function + Store 4674(texel) 121 + 4675: 123 Load 125(s1D) + 4676: 52(float) Load 128(c1) + 4677: 52(float) Load 4257(lodClamp) + 4678: 7(f16vec4) ImageSampleImplicitLod 4675 4676 ConstOffset MinLod 709 4677 + 4679: 7(f16vec4) Load 4674(texel) + 4680: 7(f16vec4) FAdd 4679 4678 + Store 4674(texel) 4680 + 4681: 123 Load 125(s1D) + 4682:6(float16_t) Load 135(f16c1) + 4683:6(float16_t) Load 4264(f16lodClamp) + 4684:6(float16_t) Load 137(f16bias) + 4685: 7(f16vec4) ImageSampleImplicitLod 4681 4682 Bias ConstOffset MinLod 4684 709 4683 + 4686: 7(f16vec4) Load 4674(texel) + 4687: 7(f16vec4) FAdd 4686 4685 + Store 4674(texel) 4687 + 4688: 143 Load 145(s2D) + 4689: 53(fvec2) Load 148(c2) + 4690: 52(float) Load 4257(lodClamp) + 4691: 7(f16vec4) ImageSampleImplicitLod 4688 4689 ConstOffset MinLod 722 4690 + 4692: 7(f16vec4) Load 4674(texel) + 4693: 7(f16vec4) FAdd 4692 4691 + Store 4674(texel) 4693 + 4694: 143 Load 145(s2D) + 4695:154(f16vec2) Load 156(f16c2) + 4696:6(float16_t) Load 4264(f16lodClamp) + 4697:6(float16_t) Load 137(f16bias) + 4698: 7(f16vec4) ImageSampleImplicitLod 4694 4695 Bias ConstOffset MinLod 4697 722 4696 + 4699: 7(f16vec4) Load 4674(texel) + 4700: 7(f16vec4) FAdd 4699 4698 + Store 4674(texel) 4700 + 4701: 163 Load 165(s3D) + 4702: 167(fvec3) Load 169(c3) + 4703: 52(float) Load 4257(lodClamp) + 4704: 7(f16vec4) ImageSampleImplicitLod 4701 4702 ConstOffset MinLod 735 4703 + 4705: 7(f16vec4) Load 4674(texel) + 4706: 7(f16vec4) FAdd 4705 4704 + Store 4674(texel) 4706 + 4707: 163 Load 165(s3D) + 4708:175(f16vec3) Load 177(f16c3) + 4709:6(float16_t) Load 4264(f16lodClamp) + 4710:6(float16_t) Load 137(f16bias) + 4711: 7(f16vec4) ImageSampleImplicitLod 4707 4708 Bias ConstOffset MinLod 4710 735 4709 + 4712: 7(f16vec4) Load 4674(texel) + 4713: 7(f16vec4) FAdd 4712 4711 + Store 4674(texel) 4713 + 4714: 199 Load 201(s1DShadow) + 4715: 167(fvec3) Load 169(c3) + 4716: 52(float) Load 4257(lodClamp) + 4717: 52(float) CompositeExtract 4715 2 + 4718:6(float16_t) ImageSampleDrefImplicitLod 4714 4715 4717 ConstOffset MinLod 709 4716 + 4719: 208(ptr) AccessChain 4674(texel) 207 + 4720:6(float16_t) Load 4719 + 4721:6(float16_t) FAdd 4720 4718 + 4722: 208(ptr) AccessChain 4674(texel) 207 + Store 4722 4721 + 4723: 199 Load 201(s1DShadow) + 4724:154(f16vec2) Load 156(f16c2) + 4725: 52(float) Load 215(compare) + 4726:6(float16_t) Load 4264(f16lodClamp) + 4727:6(float16_t) Load 137(f16bias) + 4728:6(float16_t) ImageSampleDrefImplicitLod 4723 4724 4725 Bias ConstOffset MinLod 4727 709 4726 + 4729: 208(ptr) AccessChain 4674(texel) 207 + 4730:6(float16_t) Load 4729 + 4731:6(float16_t) FAdd 4730 4728 + 4732: 208(ptr) AccessChain 4674(texel) 207 + Store 4732 4731 + 4733: 224 Load 226(s2DShadow) + 4734: 167(fvec3) Load 169(c3) + 4735: 52(float) Load 4257(lodClamp) + 4736: 52(float) CompositeExtract 4734 2 + 4737:6(float16_t) ImageSampleDrefImplicitLod 4733 4734 4736 ConstOffset MinLod 722 4735 + 4738: 208(ptr) AccessChain 4674(texel) 207 + 4739:6(float16_t) Load 4738 + 4740:6(float16_t) FAdd 4739 4737 + 4741: 208(ptr) AccessChain 4674(texel) 207 + Store 4741 4740 + 4742: 224 Load 226(s2DShadow) + 4743:154(f16vec2) Load 156(f16c2) + 4744: 52(float) Load 215(compare) + 4745:6(float16_t) Load 4264(f16lodClamp) + 4746:6(float16_t) Load 137(f16bias) + 4747:6(float16_t) ImageSampleDrefImplicitLod 4742 4743 4744 Bias ConstOffset MinLod 4746 722 4745 + 4748: 208(ptr) AccessChain 4674(texel) 207 + 4749:6(float16_t) Load 4748 + 4750:6(float16_t) FAdd 4749 4747 + 4751: 208(ptr) AccessChain 4674(texel) 207 + Store 4751 4750 + 4752: 269 Load 271(s1DArray) + 4753: 53(fvec2) Load 148(c2) + 4754: 52(float) Load 4257(lodClamp) + 4755: 7(f16vec4) ImageSampleImplicitLod 4752 4753 ConstOffset MinLod 709 4754 + 4756: 7(f16vec4) Load 4674(texel) + 4757: 7(f16vec4) FAdd 4756 4755 + Store 4674(texel) 4757 + 4758: 269 Load 271(s1DArray) + 4759:154(f16vec2) Load 156(f16c2) + 4760:6(float16_t) Load 4264(f16lodClamp) + 4761:6(float16_t) Load 137(f16bias) + 4762: 7(f16vec4) ImageSampleImplicitLod 4758 4759 Bias ConstOffset MinLod 4761 709 4760 + 4763: 7(f16vec4) Load 4674(texel) + 4764: 7(f16vec4) FAdd 4763 4762 + Store 4674(texel) 4764 + 4765: 284 Load 286(s2DArray) + 4766: 167(fvec3) Load 169(c3) + 4767: 52(float) Load 4257(lodClamp) + 4768: 7(f16vec4) ImageSampleImplicitLod 4765 4766 ConstOffset MinLod 722 4767 + 4769: 7(f16vec4) Load 4674(texel) + 4770: 7(f16vec4) FAdd 4769 4768 + Store 4674(texel) 4770 + 4771: 284 Load 286(s2DArray) + 4772:175(f16vec3) Load 177(f16c3) + 4773:6(float16_t) Load 4264(f16lodClamp) + 4774:6(float16_t) Load 137(f16bias) + 4775: 7(f16vec4) ImageSampleImplicitLod 4771 4772 Bias ConstOffset MinLod 4774 722 4773 + 4776: 7(f16vec4) Load 4674(texel) + 4777: 7(f16vec4) FAdd 4776 4775 + Store 4674(texel) 4777 + 4778: 316 Load 318(s1DArrayShadow) + 4779: 167(fvec3) Load 169(c3) + 4780: 52(float) Load 4257(lodClamp) + 4781: 52(float) CompositeExtract 4779 2 + 4782:6(float16_t) ImageSampleDrefImplicitLod 4778 4779 4781 ConstOffset MinLod 709 4780 + 4783: 208(ptr) AccessChain 4674(texel) 207 + 4784:6(float16_t) Load 4783 + 4785:6(float16_t) FAdd 4784 4782 + 4786: 208(ptr) AccessChain 4674(texel) 207 + Store 4786 4785 + 4787: 316 Load 318(s1DArrayShadow) + 4788:154(f16vec2) Load 156(f16c2) + 4789: 52(float) Load 215(compare) + 4790:6(float16_t) Load 4264(f16lodClamp) + 4791:6(float16_t) Load 137(f16bias) + 4792:6(float16_t) ImageSampleDrefImplicitLod 4787 4788 4789 Bias ConstOffset MinLod 4791 709 4790 + 4793: 208(ptr) AccessChain 4674(texel) 207 + 4794:6(float16_t) Load 4793 + 4795:6(float16_t) FAdd 4794 4792 + 4796: 208(ptr) AccessChain 4674(texel) 207 + Store 4796 4795 + 4797: 337 Load 339(s2DArrayShadow) + 4798: 249(fvec4) Load 251(c4) + 4799: 52(float) Load 4257(lodClamp) + 4800: 52(float) CompositeExtract 4798 3 + 4801:6(float16_t) ImageSampleDrefImplicitLod 4797 4798 4800 ConstOffset MinLod 722 4799 + 4802: 208(ptr) AccessChain 4674(texel) 207 + 4803:6(float16_t) Load 4802 + 4804:6(float16_t) FAdd 4803 4801 + 4805: 208(ptr) AccessChain 4674(texel) 207 + Store 4805 4804 + 4806: 337 Load 339(s2DArrayShadow) + 4807:175(f16vec3) Load 177(f16c3) + 4808: 52(float) Load 215(compare) + 4809:6(float16_t) Load 4264(f16lodClamp) + 4810:6(float16_t) ImageSampleDrefImplicitLod 4806 4807 4808 ConstOffset MinLod 722 4809 + 4811: 208(ptr) AccessChain 4674(texel) 207 + 4812:6(float16_t) Load 4811 + 4813:6(float16_t) FAdd 4812 4810 + 4814: 208(ptr) AccessChain 4674(texel) 207 + Store 4814 4813 + 4815: 7(f16vec4) Load 4674(texel) + ReturnValue 4815 + FunctionEnd +107(testSparseTextureGradClamp(): 7(f16vec4) Function None 8 + 108: Label + 4818(texel): 64(ptr) Variable Function + Store 4818(texel) 121 + 4819: 143 Load 145(s2D) + 4820: 53(fvec2) Load 148(c2) + 4821: 53(fvec2) Load 1409(dPdxy2) + 4822: 53(fvec2) Load 1409(dPdxy2) + 4823: 52(float) Load 4257(lodClamp) + 4824:3102(ResType) ImageSparseSampleExplicitLod 4819 4820 Grad MinLod 4821 4822 4823 + 4825: 7(f16vec4) CompositeExtract 4824 1 + Store 4818(texel) 4825 + 4826: 47(int) CompositeExtract 4824 0 + 4827: 143 Load 145(s2D) + 4828:154(f16vec2) Load 156(f16c2) + 4829:154(f16vec2) Load 1417(f16dPdxy2) + 4830:154(f16vec2) Load 1417(f16dPdxy2) + 4831:6(float16_t) Load 4264(f16lodClamp) + 4832:3102(ResType) ImageSparseSampleExplicitLod 4827 4828 Grad MinLod 4829 4830 4831 + 4833: 7(f16vec4) CompositeExtract 4832 1 + Store 4818(texel) 4833 + 4834: 47(int) CompositeExtract 4832 0 + 4835: 163 Load 165(s3D) + 4836: 167(fvec3) Load 169(c3) + 4837: 167(fvec3) Load 1425(dPdxy3) + 4838: 167(fvec3) Load 1425(dPdxy3) + 4839: 52(float) Load 4257(lodClamp) + 4840:3102(ResType) ImageSparseSampleExplicitLod 4835 4836 Grad MinLod 4837 4838 4839 + 4841: 7(f16vec4) CompositeExtract 4840 1 + Store 4818(texel) 4841 + 4842: 47(int) CompositeExtract 4840 0 + 4843: 163 Load 165(s3D) + 4844:175(f16vec3) Load 177(f16c3) + 4845:175(f16vec3) Load 1433(f16dPdxy3) + 4846:175(f16vec3) Load 1433(f16dPdxy3) + 4847:6(float16_t) Load 4264(f16lodClamp) + 4848:3102(ResType) ImageSparseSampleExplicitLod 4843 4844 Grad MinLod 4845 4846 4847 + 4849: 7(f16vec4) CompositeExtract 4848 1 + Store 4818(texel) 4849 + 4850: 47(int) CompositeExtract 4848 0 + 4851: 184 Load 186(sCube) + 4852: 167(fvec3) Load 169(c3) + 4853: 167(fvec3) Load 1425(dPdxy3) + 4854: 167(fvec3) Load 1425(dPdxy3) + 4855: 52(float) Load 4257(lodClamp) + 4856:3102(ResType) ImageSparseSampleExplicitLod 4851 4852 Grad MinLod 4853 4854 4855 + 4857: 7(f16vec4) CompositeExtract 4856 1 + Store 4818(texel) 4857 + 4858: 47(int) CompositeExtract 4856 0 + 4859: 184 Load 186(sCube) + 4860:175(f16vec3) Load 177(f16c3) + 4861:175(f16vec3) Load 1433(f16dPdxy3) + 4862:175(f16vec3) Load 1433(f16dPdxy3) + 4863:6(float16_t) Load 4264(f16lodClamp) + 4864:3102(ResType) ImageSparseSampleExplicitLod 4859 4860 Grad MinLod 4861 4862 4863 + 4865: 7(f16vec4) CompositeExtract 4864 1 + Store 4818(texel) 4865 + 4866: 47(int) CompositeExtract 4864 0 + 4867: 224 Load 226(s2DShadow) + 4868: 167(fvec3) Load 169(c3) + 4869: 53(fvec2) Load 1409(dPdxy2) + 4870: 53(fvec2) Load 1409(dPdxy2) + 4871: 52(float) Load 4257(lodClamp) + 4872: 208(ptr) AccessChain 4818(texel) 207 + 4873: 52(float) CompositeExtract 4868 2 + 4874:3138(ResType) ImageSparseSampleDrefExplicitLod 4867 4868 4873 Grad MinLod 4869 4870 4871 + 4875:6(float16_t) CompositeExtract 4874 1 + Store 4872 4875 + 4876: 47(int) CompositeExtract 4874 0 + 4877: 224 Load 226(s2DShadow) + 4878:154(f16vec2) Load 156(f16c2) + 4879: 52(float) Load 215(compare) + 4880:154(f16vec2) Load 1417(f16dPdxy2) + 4881:154(f16vec2) Load 1417(f16dPdxy2) + 4882:6(float16_t) Load 4264(f16lodClamp) + 4883: 208(ptr) AccessChain 4818(texel) 207 + 4884:3138(ResType) ImageSparseSampleDrefExplicitLod 4877 4878 4879 Grad MinLod 4880 4881 4882 + 4885:6(float16_t) CompositeExtract 4884 1 + Store 4883 4885 + 4886: 47(int) CompositeExtract 4884 0 + 4887: 245 Load 247(sCubeShadow) + 4888: 249(fvec4) Load 251(c4) + 4889: 167(fvec3) Load 1425(dPdxy3) + 4890: 167(fvec3) Load 1425(dPdxy3) + 4891: 52(float) Load 4257(lodClamp) + 4892: 208(ptr) AccessChain 4818(texel) 207 + 4893: 52(float) CompositeExtract 4888 3 + 4894:3138(ResType) ImageSparseSampleDrefExplicitLod 4887 4888 4893 Grad MinLod 4889 4890 4891 + 4895:6(float16_t) CompositeExtract 4894 1 + Store 4892 4895 + 4896: 47(int) CompositeExtract 4894 0 + 4897: 245 Load 247(sCubeShadow) + 4898:175(f16vec3) Load 177(f16c3) + 4899: 52(float) Load 215(compare) + 4900:175(f16vec3) Load 1433(f16dPdxy3) + 4901:175(f16vec3) Load 1433(f16dPdxy3) + 4902:6(float16_t) Load 4264(f16lodClamp) + 4903: 208(ptr) AccessChain 4818(texel) 207 + 4904:3138(ResType) ImageSparseSampleDrefExplicitLod 4897 4898 4899 Grad MinLod 4900 4901 4902 + 4905:6(float16_t) CompositeExtract 4904 1 + Store 4903 4905 + 4906: 47(int) CompositeExtract 4904 0 + 4907: 284 Load 286(s2DArray) + 4908: 167(fvec3) Load 169(c3) + 4909: 53(fvec2) Load 1409(dPdxy2) + 4910: 53(fvec2) Load 1409(dPdxy2) + 4911: 52(float) Load 4257(lodClamp) + 4912:3102(ResType) ImageSparseSampleExplicitLod 4907 4908 Grad MinLod 4909 4910 4911 + 4913: 7(f16vec4) CompositeExtract 4912 1 + Store 4818(texel) 4913 + 4914: 47(int) CompositeExtract 4912 0 + 4915: 284 Load 286(s2DArray) + 4916:175(f16vec3) Load 177(f16c3) + 4917:154(f16vec2) Load 1417(f16dPdxy2) + 4918:154(f16vec2) Load 1417(f16dPdxy2) + 4919:6(float16_t) Load 4264(f16lodClamp) + 4920:3102(ResType) ImageSparseSampleExplicitLod 4915 4916 Grad MinLod 4917 4918 4919 + 4921: 7(f16vec4) CompositeExtract 4920 1 + Store 4818(texel) 4921 + 4922: 47(int) CompositeExtract 4920 0 + 4923: 337 Load 339(s2DArrayShadow) + 4924: 249(fvec4) Load 251(c4) + 4925: 53(fvec2) Load 1409(dPdxy2) + 4926: 53(fvec2) Load 1409(dPdxy2) + 4927: 52(float) Load 4257(lodClamp) + 4928: 208(ptr) AccessChain 4818(texel) 207 + 4929: 52(float) CompositeExtract 4924 3 + 4930:3138(ResType) ImageSparseSampleDrefExplicitLod 4923 4924 4929 Grad MinLod 4925 4926 4927 + 4931:6(float16_t) CompositeExtract 4930 1 + Store 4928 4931 + 4932: 47(int) CompositeExtract 4930 0 + 4933: 337 Load 339(s2DArrayShadow) + 4934:175(f16vec3) Load 177(f16c3) + 4935: 52(float) Load 215(compare) + 4936:154(f16vec2) Load 1417(f16dPdxy2) + 4937:154(f16vec2) Load 1417(f16dPdxy2) + 4938:6(float16_t) Load 4264(f16lodClamp) + 4939: 208(ptr) AccessChain 4818(texel) 207 + 4940:3138(ResType) ImageSparseSampleDrefExplicitLod 4933 4934 4935 Grad MinLod 4936 4937 4938 + 4941:6(float16_t) CompositeExtract 4940 1 + Store 4939 4941 + 4942: 47(int) CompositeExtract 4940 0 + 4943: 299 Load 301(sCubeArray) + 4944: 249(fvec4) Load 251(c4) + 4945: 167(fvec3) Load 1425(dPdxy3) + 4946: 167(fvec3) Load 1425(dPdxy3) + 4947: 52(float) Load 4257(lodClamp) + 4948:3102(ResType) ImageSparseSampleExplicitLod 4943 4944 Grad MinLod 4945 4946 4947 + 4949: 7(f16vec4) CompositeExtract 4948 1 + Store 4818(texel) 4949 + 4950: 47(int) CompositeExtract 4948 0 + 4951: 299 Load 301(sCubeArray) + 4952: 7(f16vec4) Load 309(f16c4) + 4953:175(f16vec3) Load 1433(f16dPdxy3) + 4954:175(f16vec3) Load 1433(f16dPdxy3) + 4955:6(float16_t) Load 4264(f16lodClamp) + 4956:3102(ResType) ImageSparseSampleExplicitLod 4951 4952 Grad MinLod 4953 4954 4955 + 4957: 7(f16vec4) CompositeExtract 4956 1 + Store 4818(texel) 4957 + 4958: 47(int) CompositeExtract 4956 0 + 4959: 7(f16vec4) Load 4818(texel) + ReturnValue 4959 + FunctionEnd +109(testTextureGradClamp(): 7(f16vec4) Function None 8 + 110: Label + 4962(texel): 64(ptr) Variable Function + Store 4962(texel) 121 + 4963: 123 Load 125(s1D) + 4964: 52(float) Load 128(c1) + 4965: 52(float) Load 1393(dPdxy1) + 4966: 52(float) Load 1393(dPdxy1) + 4967: 52(float) Load 4257(lodClamp) + 4968: 7(f16vec4) ImageSampleExplicitLod 4963 4964 Grad MinLod 4965 4966 4967 + 4969: 7(f16vec4) Load 4962(texel) + 4970: 7(f16vec4) FAdd 4969 4968 + Store 4962(texel) 4970 + 4971: 123 Load 125(s1D) + 4972:6(float16_t) Load 135(f16c1) + 4973:6(float16_t) Load 1401(f16dPdxy1) + 4974:6(float16_t) Load 1401(f16dPdxy1) + 4975:6(float16_t) Load 4264(f16lodClamp) + 4976: 7(f16vec4) ImageSampleExplicitLod 4971 4972 Grad MinLod 4973 4974 4975 + 4977: 7(f16vec4) Load 4962(texel) + 4978: 7(f16vec4) FAdd 4977 4976 + Store 4962(texel) 4978 + 4979: 143 Load 145(s2D) + 4980: 53(fvec2) Load 148(c2) + 4981: 53(fvec2) Load 1409(dPdxy2) + 4982: 53(fvec2) Load 1409(dPdxy2) + 4983: 52(float) Load 4257(lodClamp) + 4984: 7(f16vec4) ImageSampleExplicitLod 4979 4980 Grad MinLod 4981 4982 4983 + 4985: 7(f16vec4) Load 4962(texel) + 4986: 7(f16vec4) FAdd 4985 4984 + Store 4962(texel) 4986 + 4987: 143 Load 145(s2D) + 4988:154(f16vec2) Load 156(f16c2) + 4989:154(f16vec2) Load 1417(f16dPdxy2) + 4990:154(f16vec2) Load 1417(f16dPdxy2) + 4991:6(float16_t) Load 4264(f16lodClamp) + 4992: 7(f16vec4) ImageSampleExplicitLod 4987 4988 Grad MinLod 4989 4990 4991 + 4993: 7(f16vec4) Load 4962(texel) + 4994: 7(f16vec4) FAdd 4993 4992 + Store 4962(texel) 4994 + 4995: 163 Load 165(s3D) + 4996: 167(fvec3) Load 169(c3) + 4997: 167(fvec3) Load 1425(dPdxy3) + 4998: 167(fvec3) Load 1425(dPdxy3) + 4999: 52(float) Load 4257(lodClamp) + 5000: 7(f16vec4) ImageSampleExplicitLod 4995 4996 Grad MinLod 4997 4998 4999 + 5001: 7(f16vec4) Load 4962(texel) + 5002: 7(f16vec4) FAdd 5001 5000 + Store 4962(texel) 5002 + 5003: 163 Load 165(s3D) + 5004:175(f16vec3) Load 177(f16c3) + 5005:175(f16vec3) Load 1433(f16dPdxy3) + 5006:175(f16vec3) Load 1433(f16dPdxy3) + 5007:6(float16_t) Load 4264(f16lodClamp) + 5008: 7(f16vec4) ImageSampleExplicitLod 5003 5004 Grad MinLod 5005 5006 5007 + 5009: 7(f16vec4) Load 4962(texel) + 5010: 7(f16vec4) FAdd 5009 5008 + Store 4962(texel) 5010 + 5011: 184 Load 186(sCube) + 5012: 167(fvec3) Load 169(c3) + 5013: 167(fvec3) Load 1425(dPdxy3) + 5014: 167(fvec3) Load 1425(dPdxy3) + 5015: 52(float) Load 4257(lodClamp) + 5016: 7(f16vec4) ImageSampleExplicitLod 5011 5012 Grad MinLod 5013 5014 5015 + 5017: 7(f16vec4) Load 4962(texel) + 5018: 7(f16vec4) FAdd 5017 5016 + Store 4962(texel) 5018 + 5019: 184 Load 186(sCube) + 5020:175(f16vec3) Load 177(f16c3) + 5021:175(f16vec3) Load 1433(f16dPdxy3) + 5022:175(f16vec3) Load 1433(f16dPdxy3) + 5023:6(float16_t) Load 4264(f16lodClamp) + 5024: 7(f16vec4) ImageSampleExplicitLod 5019 5020 Grad MinLod 5021 5022 5023 + 5025: 7(f16vec4) Load 4962(texel) + 5026: 7(f16vec4) FAdd 5025 5024 + Store 4962(texel) 5026 + 5027: 199 Load 201(s1DShadow) + 5028: 167(fvec3) Load 169(c3) + 5029: 52(float) Load 1393(dPdxy1) + 5030: 52(float) Load 1393(dPdxy1) + 5031: 52(float) Load 4257(lodClamp) + 5032: 52(float) CompositeExtract 5028 2 + 5033:6(float16_t) ImageSampleDrefExplicitLod 5027 5028 5032 Grad MinLod 5029 5030 5031 + 5034: 208(ptr) AccessChain 4962(texel) 207 + 5035:6(float16_t) Load 5034 + 5036:6(float16_t) FAdd 5035 5033 + 5037: 208(ptr) AccessChain 4962(texel) 207 + Store 5037 5036 + 5038: 199 Load 201(s1DShadow) + 5039:154(f16vec2) Load 156(f16c2) + 5040: 52(float) Load 215(compare) + 5041:6(float16_t) Load 1401(f16dPdxy1) + 5042:6(float16_t) Load 1401(f16dPdxy1) + 5043:6(float16_t) Load 4264(f16lodClamp) + 5044:6(float16_t) ImageSampleDrefExplicitLod 5038 5039 5040 Grad MinLod 5041 5042 5043 + 5045: 208(ptr) AccessChain 4962(texel) 207 + 5046:6(float16_t) Load 5045 + 5047:6(float16_t) FAdd 5046 5044 + 5048: 208(ptr) AccessChain 4962(texel) 207 + Store 5048 5047 + 5049: 224 Load 226(s2DShadow) + 5050: 167(fvec3) Load 169(c3) + 5051: 53(fvec2) Load 1409(dPdxy2) + 5052: 53(fvec2) Load 1409(dPdxy2) + 5053: 52(float) Load 4257(lodClamp) + 5054: 52(float) CompositeExtract 5050 2 + 5055:6(float16_t) ImageSampleDrefExplicitLod 5049 5050 5054 Grad MinLod 5051 5052 5053 + 5056: 208(ptr) AccessChain 4962(texel) 207 + 5057:6(float16_t) Load 5056 + 5058:6(float16_t) FAdd 5057 5055 + 5059: 208(ptr) AccessChain 4962(texel) 207 + Store 5059 5058 + 5060: 224 Load 226(s2DShadow) + 5061:154(f16vec2) Load 156(f16c2) + 5062: 52(float) Load 215(compare) + 5063:154(f16vec2) Load 1417(f16dPdxy2) + 5064:154(f16vec2) Load 1417(f16dPdxy2) + 5065:6(float16_t) Load 4264(f16lodClamp) + 5066:6(float16_t) ImageSampleDrefExplicitLod 5060 5061 5062 Grad MinLod 5063 5064 5065 + 5067: 208(ptr) AccessChain 4962(texel) 207 + 5068:6(float16_t) Load 5067 + 5069:6(float16_t) FAdd 5068 5066 + 5070: 208(ptr) AccessChain 4962(texel) 207 + Store 5070 5069 + 5071: 245 Load 247(sCubeShadow) + 5072: 249(fvec4) Load 251(c4) + 5073: 167(fvec3) Load 1425(dPdxy3) + 5074: 167(fvec3) Load 1425(dPdxy3) + 5075: 52(float) Load 4257(lodClamp) + 5076: 52(float) CompositeExtract 5072 3 + 5077:6(float16_t) ImageSampleDrefExplicitLod 5071 5072 5076 Grad MinLod 5073 5074 5075 + 5078: 208(ptr) AccessChain 4962(texel) 207 + 5079:6(float16_t) Load 5078 + 5080:6(float16_t) FAdd 5079 5077 + 5081: 208(ptr) AccessChain 4962(texel) 207 + Store 5081 5080 + 5082: 245 Load 247(sCubeShadow) + 5083:175(f16vec3) Load 177(f16c3) + 5084: 52(float) Load 215(compare) + 5085:175(f16vec3) Load 1433(f16dPdxy3) + 5086:175(f16vec3) Load 1433(f16dPdxy3) + 5087:6(float16_t) Load 4264(f16lodClamp) + 5088:6(float16_t) ImageSampleDrefExplicitLod 5082 5083 5084 Grad MinLod 5085 5086 5087 + 5089: 208(ptr) AccessChain 4962(texel) 207 + 5090:6(float16_t) Load 5089 + 5091:6(float16_t) FAdd 5090 5088 + 5092: 208(ptr) AccessChain 4962(texel) 207 + Store 5092 5091 + 5093: 269 Load 271(s1DArray) + 5094: 53(fvec2) Load 148(c2) + 5095: 52(float) Load 1393(dPdxy1) + 5096: 52(float) Load 1393(dPdxy1) + 5097: 52(float) Load 4257(lodClamp) + 5098: 7(f16vec4) ImageSampleExplicitLod 5093 5094 Grad MinLod 5095 5096 5097 + 5099: 7(f16vec4) Load 4962(texel) + 5100: 7(f16vec4) FAdd 5099 5098 + Store 4962(texel) 5100 + 5101: 269 Load 271(s1DArray) + 5102:154(f16vec2) Load 156(f16c2) + 5103:6(float16_t) Load 1401(f16dPdxy1) + 5104:6(float16_t) Load 1401(f16dPdxy1) + 5105:6(float16_t) Load 4264(f16lodClamp) + 5106: 7(f16vec4) ImageSampleExplicitLod 5101 5102 Grad MinLod 5103 5104 5105 + 5107: 7(f16vec4) Load 4962(texel) + 5108: 7(f16vec4) FAdd 5107 5106 + Store 4962(texel) 5108 + 5109: 284 Load 286(s2DArray) + 5110: 167(fvec3) Load 169(c3) + 5111: 53(fvec2) Load 1409(dPdxy2) + 5112: 53(fvec2) Load 1409(dPdxy2) + 5113: 52(float) Load 4257(lodClamp) + 5114: 7(f16vec4) ImageSampleExplicitLod 5109 5110 Grad MinLod 5111 5112 5113 + 5115: 7(f16vec4) Load 4962(texel) + 5116: 7(f16vec4) FAdd 5115 5114 + Store 4962(texel) 5116 + 5117: 284 Load 286(s2DArray) + 5118:175(f16vec3) Load 177(f16c3) + 5119:154(f16vec2) Load 1417(f16dPdxy2) + 5120:154(f16vec2) Load 1417(f16dPdxy2) + 5121:6(float16_t) Load 4264(f16lodClamp) + 5122: 7(f16vec4) ImageSampleExplicitLod 5117 5118 Grad MinLod 5119 5120 5121 + 5123: 7(f16vec4) Load 4962(texel) + 5124: 7(f16vec4) FAdd 5123 5122 + Store 4962(texel) 5124 + 5125: 316 Load 318(s1DArrayShadow) + 5126: 167(fvec3) Load 169(c3) + 5127: 52(float) Load 1393(dPdxy1) + 5128: 52(float) Load 1393(dPdxy1) + 5129: 52(float) Load 4257(lodClamp) + 5130: 52(float) CompositeExtract 5126 2 + 5131:6(float16_t) ImageSampleDrefExplicitLod 5125 5126 5130 Grad MinLod 5127 5128 5129 + 5132: 208(ptr) AccessChain 4962(texel) 207 + 5133:6(float16_t) Load 5132 + 5134:6(float16_t) FAdd 5133 5131 + 5135: 208(ptr) AccessChain 4962(texel) 207 + Store 5135 5134 + 5136: 316 Load 318(s1DArrayShadow) + 5137:154(f16vec2) Load 156(f16c2) + 5138: 52(float) Load 215(compare) + 5139:6(float16_t) Load 1401(f16dPdxy1) + 5140:6(float16_t) Load 1401(f16dPdxy1) + 5141:6(float16_t) Load 4264(f16lodClamp) + 5142:6(float16_t) ImageSampleDrefExplicitLod 5136 5137 5138 Grad MinLod 5139 5140 5141 + 5143: 208(ptr) AccessChain 4962(texel) 207 + 5144:6(float16_t) Load 5143 + 5145:6(float16_t) FAdd 5144 5142 + 5146: 208(ptr) AccessChain 4962(texel) 207 + Store 5146 5145 + 5147: 337 Load 339(s2DArrayShadow) + 5148: 249(fvec4) Load 251(c4) + 5149: 53(fvec2) Load 1409(dPdxy2) + 5150: 53(fvec2) Load 1409(dPdxy2) + 5151: 52(float) Load 4257(lodClamp) + 5152: 52(float) CompositeExtract 5148 3 + 5153:6(float16_t) ImageSampleDrefExplicitLod 5147 5148 5152 Grad MinLod 5149 5150 5151 + 5154: 208(ptr) AccessChain 4962(texel) 207 + 5155:6(float16_t) Load 5154 + 5156:6(float16_t) FAdd 5155 5153 + 5157: 208(ptr) AccessChain 4962(texel) 207 + Store 5157 5156 + 5158: 337 Load 339(s2DArrayShadow) + 5159:175(f16vec3) Load 177(f16c3) + 5160: 52(float) Load 215(compare) + 5161:154(f16vec2) Load 1417(f16dPdxy2) + 5162:154(f16vec2) Load 1417(f16dPdxy2) + 5163:6(float16_t) Load 4264(f16lodClamp) + 5164:6(float16_t) ImageSampleDrefExplicitLod 5158 5159 5160 Grad MinLod 5161 5162 5163 + 5165: 208(ptr) AccessChain 4962(texel) 207 + 5166:6(float16_t) Load 5165 + 5167:6(float16_t) FAdd 5166 5164 + 5168: 208(ptr) AccessChain 4962(texel) 207 + Store 5168 5167 + 5169: 299 Load 301(sCubeArray) + 5170: 249(fvec4) Load 251(c4) + 5171: 167(fvec3) Load 1425(dPdxy3) + 5172: 167(fvec3) Load 1425(dPdxy3) + 5173: 52(float) Load 4257(lodClamp) + 5174: 7(f16vec4) ImageSampleExplicitLod 5169 5170 Grad MinLod 5171 5172 5173 + 5175: 7(f16vec4) Load 4962(texel) + 5176: 7(f16vec4) FAdd 5175 5174 + Store 4962(texel) 5176 + 5177: 299 Load 301(sCubeArray) + 5178: 7(f16vec4) Load 309(f16c4) + 5179:175(f16vec3) Load 1433(f16dPdxy3) + 5180:175(f16vec3) Load 1433(f16dPdxy3) + 5181:6(float16_t) Load 4264(f16lodClamp) + 5182: 7(f16vec4) ImageSampleExplicitLod 5177 5178 Grad MinLod 5179 5180 5181 + 5183: 7(f16vec4) Load 4962(texel) + 5184: 7(f16vec4) FAdd 5183 5182 + Store 4962(texel) 5184 + 5185: 7(f16vec4) Load 4962(texel) + ReturnValue 5185 + FunctionEnd +111(testSparseTextureGradOffsetClamp(): 7(f16vec4) Function None 8 + 112: Label + 5188(texel): 64(ptr) Variable Function + Store 5188(texel) 121 + 5189: 143 Load 145(s2D) + 5190: 53(fvec2) Load 148(c2) + 5191: 53(fvec2) Load 1409(dPdxy2) + 5192: 53(fvec2) Load 1409(dPdxy2) + 5193: 52(float) Load 4257(lodClamp) + 5194:3102(ResType) ImageSparseSampleExplicitLod 5189 5190 Grad ConstOffset MinLod 5191 5192 722 5193 + 5195: 7(f16vec4) CompositeExtract 5194 1 + Store 5188(texel) 5195 + 5196: 47(int) CompositeExtract 5194 0 + 5197: 143 Load 145(s2D) + 5198:154(f16vec2) Load 156(f16c2) + 5199:154(f16vec2) Load 1417(f16dPdxy2) + 5200:154(f16vec2) Load 1417(f16dPdxy2) + 5201:6(float16_t) Load 4264(f16lodClamp) + 5202:3102(ResType) ImageSparseSampleExplicitLod 5197 5198 Grad ConstOffset MinLod 5199 5200 722 5201 + 5203: 7(f16vec4) CompositeExtract 5202 1 + Store 5188(texel) 5203 + 5204: 47(int) CompositeExtract 5202 0 + 5205: 163 Load 165(s3D) + 5206: 167(fvec3) Load 169(c3) + 5207: 167(fvec3) Load 1425(dPdxy3) + 5208: 167(fvec3) Load 1425(dPdxy3) + 5209: 52(float) Load 4257(lodClamp) + 5210:3102(ResType) ImageSparseSampleExplicitLod 5205 5206 Grad ConstOffset MinLod 5207 5208 735 5209 + 5211: 7(f16vec4) CompositeExtract 5210 1 + Store 5188(texel) 5211 + 5212: 47(int) CompositeExtract 5210 0 + 5213: 163 Load 165(s3D) + 5214:175(f16vec3) Load 177(f16c3) + 5215:175(f16vec3) Load 1433(f16dPdxy3) + 5216:175(f16vec3) Load 1433(f16dPdxy3) + 5217:6(float16_t) Load 4264(f16lodClamp) + 5218:3102(ResType) ImageSparseSampleExplicitLod 5213 5214 Grad ConstOffset MinLod 5215 5216 735 5217 + 5219: 7(f16vec4) CompositeExtract 5218 1 + Store 5188(texel) 5219 + 5220: 47(int) CompositeExtract 5218 0 + 5221: 224 Load 226(s2DShadow) + 5222: 167(fvec3) Load 169(c3) + 5223: 53(fvec2) Load 1409(dPdxy2) + 5224: 53(fvec2) Load 1409(dPdxy2) + 5225: 52(float) Load 4257(lodClamp) + 5226: 208(ptr) AccessChain 5188(texel) 207 + 5227: 52(float) CompositeExtract 5222 2 + 5228:3138(ResType) ImageSparseSampleDrefExplicitLod 5221 5222 5227 Grad ConstOffset MinLod 5223 5224 722 5225 + 5229:6(float16_t) CompositeExtract 5228 1 + Store 5226 5229 + 5230: 47(int) CompositeExtract 5228 0 + 5231: 224 Load 226(s2DShadow) + 5232:154(f16vec2) Load 156(f16c2) + 5233: 52(float) Load 215(compare) + 5234:154(f16vec2) Load 1417(f16dPdxy2) + 5235:154(f16vec2) Load 1417(f16dPdxy2) + 5236:6(float16_t) Load 4264(f16lodClamp) + 5237: 208(ptr) AccessChain 5188(texel) 207 + 5238:3138(ResType) ImageSparseSampleDrefExplicitLod 5231 5232 5233 Grad ConstOffset MinLod 5234 5235 722 5236 + 5239:6(float16_t) CompositeExtract 5238 1 + Store 5237 5239 + 5240: 47(int) CompositeExtract 5238 0 + 5241: 284 Load 286(s2DArray) + 5242: 167(fvec3) Load 169(c3) + 5243: 53(fvec2) Load 1409(dPdxy2) + 5244: 53(fvec2) Load 1409(dPdxy2) + 5245: 52(float) Load 4257(lodClamp) + 5246:3102(ResType) ImageSparseSampleExplicitLod 5241 5242 Grad ConstOffset MinLod 5243 5244 722 5245 + 5247: 7(f16vec4) CompositeExtract 5246 1 + Store 5188(texel) 5247 + 5248: 47(int) CompositeExtract 5246 0 + 5249: 284 Load 286(s2DArray) + 5250:175(f16vec3) Load 177(f16c3) + 5251:154(f16vec2) Load 1417(f16dPdxy2) + 5252:154(f16vec2) Load 1417(f16dPdxy2) + 5253:6(float16_t) Load 4264(f16lodClamp) + 5254:3102(ResType) ImageSparseSampleExplicitLod 5249 5250 Grad ConstOffset MinLod 5251 5252 722 5253 + 5255: 7(f16vec4) CompositeExtract 5254 1 + Store 5188(texel) 5255 + 5256: 47(int) CompositeExtract 5254 0 + 5257: 337 Load 339(s2DArrayShadow) + 5258: 249(fvec4) Load 251(c4) + 5259: 53(fvec2) Load 1409(dPdxy2) + 5260: 53(fvec2) Load 1409(dPdxy2) + 5261: 52(float) Load 4257(lodClamp) + 5262: 208(ptr) AccessChain 5188(texel) 207 + 5263: 52(float) CompositeExtract 5258 3 + 5264:3138(ResType) ImageSparseSampleDrefExplicitLod 5257 5258 5263 Grad ConstOffset MinLod 5259 5260 722 5261 + 5265:6(float16_t) CompositeExtract 5264 1 + Store 5262 5265 + 5266: 47(int) CompositeExtract 5264 0 + 5267: 337 Load 339(s2DArrayShadow) + 5268:175(f16vec3) Load 177(f16c3) + 5269: 52(float) Load 215(compare) + 5270:154(f16vec2) Load 1417(f16dPdxy2) + 5271:154(f16vec2) Load 1417(f16dPdxy2) + 5272:6(float16_t) Load 4264(f16lodClamp) + 5273: 208(ptr) AccessChain 5188(texel) 207 + 5274:3138(ResType) ImageSparseSampleDrefExplicitLod 5267 5268 5269 Grad ConstOffset MinLod 5270 5271 722 5272 + 5275:6(float16_t) CompositeExtract 5274 1 + Store 5273 5275 + 5276: 47(int) CompositeExtract 5274 0 + 5277: 7(f16vec4) Load 5188(texel) + ReturnValue 5277 + FunctionEnd +113(testTextureGradOffsetClamp(): 7(f16vec4) Function None 8 + 114: Label + 5280(texel): 64(ptr) Variable Function + Store 5280(texel) 121 + 5281: 123 Load 125(s1D) + 5282: 52(float) Load 128(c1) + 5283: 52(float) Load 1393(dPdxy1) + 5284: 52(float) Load 1393(dPdxy1) + 5285: 52(float) Load 4257(lodClamp) + 5286: 7(f16vec4) ImageSampleExplicitLod 5281 5282 Grad ConstOffset MinLod 5283 5284 709 5285 + 5287: 7(f16vec4) Load 5280(texel) + 5288: 7(f16vec4) FAdd 5287 5286 + Store 5280(texel) 5288 + 5289: 123 Load 125(s1D) + 5290:6(float16_t) Load 135(f16c1) + 5291:6(float16_t) Load 1401(f16dPdxy1) + 5292:6(float16_t) Load 1401(f16dPdxy1) + 5293:6(float16_t) Load 4264(f16lodClamp) + 5294: 7(f16vec4) ImageSampleExplicitLod 5289 5290 Grad ConstOffset MinLod 5291 5292 709 5293 + 5295: 7(f16vec4) Load 5280(texel) + 5296: 7(f16vec4) FAdd 5295 5294 + Store 5280(texel) 5296 + 5297: 143 Load 145(s2D) + 5298: 53(fvec2) Load 148(c2) + 5299: 53(fvec2) Load 1409(dPdxy2) + 5300: 53(fvec2) Load 1409(dPdxy2) + 5301: 52(float) Load 4257(lodClamp) + 5302: 7(f16vec4) ImageSampleExplicitLod 5297 5298 Grad ConstOffset MinLod 5299 5300 722 5301 + 5303: 7(f16vec4) Load 5280(texel) + 5304: 7(f16vec4) FAdd 5303 5302 + Store 5280(texel) 5304 + 5305: 143 Load 145(s2D) + 5306:154(f16vec2) Load 156(f16c2) + 5307:154(f16vec2) Load 1417(f16dPdxy2) + 5308:154(f16vec2) Load 1417(f16dPdxy2) + 5309:6(float16_t) Load 4264(f16lodClamp) + 5310: 7(f16vec4) ImageSampleExplicitLod 5305 5306 Grad ConstOffset MinLod 5307 5308 722 5309 + 5311: 7(f16vec4) Load 5280(texel) + 5312: 7(f16vec4) FAdd 5311 5310 + Store 5280(texel) 5312 + 5313: 163 Load 165(s3D) + 5314: 167(fvec3) Load 169(c3) + 5315: 167(fvec3) Load 1425(dPdxy3) + 5316: 167(fvec3) Load 1425(dPdxy3) + 5317: 52(float) Load 4257(lodClamp) + 5318: 7(f16vec4) ImageSampleExplicitLod 5313 5314 Grad ConstOffset MinLod 5315 5316 735 5317 + 5319: 7(f16vec4) Load 5280(texel) + 5320: 7(f16vec4) FAdd 5319 5318 + Store 5280(texel) 5320 + 5321: 163 Load 165(s3D) + 5322:175(f16vec3) Load 177(f16c3) + 5323:175(f16vec3) Load 1433(f16dPdxy3) + 5324:175(f16vec3) Load 1433(f16dPdxy3) + 5325:6(float16_t) Load 4264(f16lodClamp) + 5326: 7(f16vec4) ImageSampleExplicitLod 5321 5322 Grad ConstOffset MinLod 5323 5324 735 5325 + 5327: 7(f16vec4) Load 5280(texel) + 5328: 7(f16vec4) FAdd 5327 5326 + Store 5280(texel) 5328 + 5329: 199 Load 201(s1DShadow) + 5330: 167(fvec3) Load 169(c3) + 5331: 52(float) Load 1393(dPdxy1) + 5332: 52(float) Load 1393(dPdxy1) + 5333: 52(float) Load 4257(lodClamp) + 5334: 52(float) CompositeExtract 5330 2 + 5335:6(float16_t) ImageSampleDrefExplicitLod 5329 5330 5334 Grad ConstOffset MinLod 5331 5332 709 5333 + 5336: 208(ptr) AccessChain 5280(texel) 207 + 5337:6(float16_t) Load 5336 + 5338:6(float16_t) FAdd 5337 5335 + 5339: 208(ptr) AccessChain 5280(texel) 207 + Store 5339 5338 + 5340: 199 Load 201(s1DShadow) + 5341:154(f16vec2) Load 156(f16c2) + 5342: 52(float) Load 215(compare) + 5343:6(float16_t) Load 1401(f16dPdxy1) + 5344:6(float16_t) Load 1401(f16dPdxy1) + 5345:6(float16_t) Load 4264(f16lodClamp) + 5346:6(float16_t) ImageSampleDrefExplicitLod 5340 5341 5342 Grad ConstOffset MinLod 5343 5344 709 5345 + 5347: 208(ptr) AccessChain 5280(texel) 207 + 5348:6(float16_t) Load 5347 + 5349:6(float16_t) FAdd 5348 5346 + 5350: 208(ptr) AccessChain 5280(texel) 207 + Store 5350 5349 + 5351: 224 Load 226(s2DShadow) + 5352: 167(fvec3) Load 169(c3) + 5353: 53(fvec2) Load 1409(dPdxy2) + 5354: 53(fvec2) Load 1409(dPdxy2) + 5355: 52(float) Load 4257(lodClamp) + 5356: 52(float) CompositeExtract 5352 2 + 5357:6(float16_t) ImageSampleDrefExplicitLod 5351 5352 5356 Grad ConstOffset MinLod 5353 5354 722 5355 + 5358: 208(ptr) AccessChain 5280(texel) 207 + 5359:6(float16_t) Load 5358 + 5360:6(float16_t) FAdd 5359 5357 + 5361: 208(ptr) AccessChain 5280(texel) 207 + Store 5361 5360 + 5362: 224 Load 226(s2DShadow) + 5363:154(f16vec2) Load 156(f16c2) + 5364: 52(float) Load 215(compare) + 5365:154(f16vec2) Load 1417(f16dPdxy2) + 5366:154(f16vec2) Load 1417(f16dPdxy2) + 5367:6(float16_t) Load 4264(f16lodClamp) + 5368:6(float16_t) ImageSampleDrefExplicitLod 5362 5363 5364 Grad ConstOffset MinLod 5365 5366 722 5367 + 5369: 208(ptr) AccessChain 5280(texel) 207 + 5370:6(float16_t) Load 5369 + 5371:6(float16_t) FAdd 5370 5368 + 5372: 208(ptr) AccessChain 5280(texel) 207 + Store 5372 5371 + 5373: 269 Load 271(s1DArray) + 5374: 53(fvec2) Load 148(c2) + 5375: 52(float) Load 1393(dPdxy1) + 5376: 52(float) Load 1393(dPdxy1) + 5377: 52(float) Load 4257(lodClamp) + 5378: 7(f16vec4) ImageSampleExplicitLod 5373 5374 Grad ConstOffset MinLod 5375 5376 709 5377 + 5379: 7(f16vec4) Load 5280(texel) + 5380: 7(f16vec4) FAdd 5379 5378 + Store 5280(texel) 5380 + 5381: 269 Load 271(s1DArray) + 5382:154(f16vec2) Load 156(f16c2) + 5383:6(float16_t) Load 1401(f16dPdxy1) + 5384:6(float16_t) Load 1401(f16dPdxy1) + 5385:6(float16_t) Load 4264(f16lodClamp) + 5386: 7(f16vec4) ImageSampleExplicitLod 5381 5382 Grad ConstOffset MinLod 5383 5384 709 5385 + 5387: 7(f16vec4) Load 5280(texel) + 5388: 7(f16vec4) FAdd 5387 5386 + Store 5280(texel) 5388 + 5389: 284 Load 286(s2DArray) + 5390: 167(fvec3) Load 169(c3) + 5391: 53(fvec2) Load 1409(dPdxy2) + 5392: 53(fvec2) Load 1409(dPdxy2) + 5393: 52(float) Load 4257(lodClamp) + 5394: 7(f16vec4) ImageSampleExplicitLod 5389 5390 Grad ConstOffset MinLod 5391 5392 722 5393 + 5395: 7(f16vec4) Load 5280(texel) + 5396: 7(f16vec4) FAdd 5395 5394 + Store 5280(texel) 5396 + 5397: 284 Load 286(s2DArray) + 5398:175(f16vec3) Load 177(f16c3) + 5399:154(f16vec2) Load 1417(f16dPdxy2) + 5400:154(f16vec2) Load 1417(f16dPdxy2) + 5401:6(float16_t) Load 4264(f16lodClamp) + 5402: 7(f16vec4) ImageSampleExplicitLod 5397 5398 Grad ConstOffset MinLod 5399 5400 722 5401 + 5403: 7(f16vec4) Load 5280(texel) + 5404: 7(f16vec4) FAdd 5403 5402 + Store 5280(texel) 5404 + 5405: 316 Load 318(s1DArrayShadow) + 5406: 167(fvec3) Load 169(c3) + 5407: 52(float) Load 1393(dPdxy1) + 5408: 52(float) Load 1393(dPdxy1) + 5409: 52(float) Load 4257(lodClamp) + 5410: 52(float) CompositeExtract 5406 2 + 5411:6(float16_t) ImageSampleDrefExplicitLod 5405 5406 5410 Grad ConstOffset MinLod 5407 5408 709 5409 + 5412: 208(ptr) AccessChain 5280(texel) 207 + 5413:6(float16_t) Load 5412 + 5414:6(float16_t) FAdd 5413 5411 + 5415: 208(ptr) AccessChain 5280(texel) 207 + Store 5415 5414 + 5416: 316 Load 318(s1DArrayShadow) + 5417:154(f16vec2) Load 156(f16c2) + 5418: 52(float) Load 215(compare) + 5419:6(float16_t) Load 1401(f16dPdxy1) + 5420:6(float16_t) Load 1401(f16dPdxy1) + 5421:6(float16_t) Load 4264(f16lodClamp) + 5422:6(float16_t) ImageSampleDrefExplicitLod 5416 5417 5418 Grad ConstOffset MinLod 5419 5420 709 5421 + 5423: 208(ptr) AccessChain 5280(texel) 207 + 5424:6(float16_t) Load 5423 + 5425:6(float16_t) FAdd 5424 5422 + 5426: 208(ptr) AccessChain 5280(texel) 207 + Store 5426 5425 + 5427: 337 Load 339(s2DArrayShadow) + 5428: 249(fvec4) Load 251(c4) + 5429: 53(fvec2) Load 1409(dPdxy2) + 5430: 53(fvec2) Load 1409(dPdxy2) + 5431: 52(float) Load 4257(lodClamp) + 5432: 52(float) CompositeExtract 5428 3 + 5433:6(float16_t) ImageSampleDrefExplicitLod 5427 5428 5432 Grad ConstOffset MinLod 5429 5430 722 5431 + 5434: 208(ptr) AccessChain 5280(texel) 207 + 5435:6(float16_t) Load 5434 + 5436:6(float16_t) FAdd 5435 5433 + 5437: 208(ptr) AccessChain 5280(texel) 207 + Store 5437 5436 + 5438: 337 Load 339(s2DArrayShadow) + 5439:175(f16vec3) Load 177(f16c3) + 5440: 52(float) Load 215(compare) + 5441:154(f16vec2) Load 1417(f16dPdxy2) + 5442:154(f16vec2) Load 1417(f16dPdxy2) + 5443:6(float16_t) Load 4264(f16lodClamp) + 5444:6(float16_t) ImageSampleDrefExplicitLod 5438 5439 5440 Grad ConstOffset MinLod 5441 5442 722 5443 + 5445: 208(ptr) AccessChain 5280(texel) 207 + 5446:6(float16_t) Load 5445 + 5447:6(float16_t) FAdd 5446 5444 + 5448: 208(ptr) AccessChain 5280(texel) 207 + Store 5448 5447 + 5449: 7(f16vec4) Load 5280(texel) + ReturnValue 5449 + FunctionEnd +115(testCombinedTextureSampler(): 7(f16vec4) Function None 8 + 116: Label + 5452(texel): 64(ptr) Variable Function + Store 5452(texel) 121 + 5455: 122 Load 5454(t1D) + 5459: 5456 Load 5458(s) + 5460: 123 SampledImage 5455 5459 + 5461: 52(float) Load 128(c1) + 5462: 7(f16vec4) ImageSampleImplicitLod 5460 5461 + 5463: 7(f16vec4) Load 5452(texel) + 5464: 7(f16vec4) FAdd 5463 5462 + Store 5452(texel) 5464 + 5465: 122 Load 5454(t1D) + 5466: 5456 Load 5458(s) + 5467: 123 SampledImage 5465 5466 + 5468:6(float16_t) Load 135(f16c1) + 5469:6(float16_t) Load 137(f16bias) + 5470: 7(f16vec4) ImageSampleImplicitLod 5467 5468 Bias 5469 + 5471: 7(f16vec4) Load 5452(texel) + 5472: 7(f16vec4) FAdd 5471 5470 + Store 5452(texel) 5472 + 5475: 142 Load 5474(t2D) + 5476: 5456 Load 5458(s) + 5477: 143 SampledImage 5475 5476 + 5478: 53(fvec2) Load 148(c2) + 5479: 7(f16vec4) ImageSampleImplicitLod 5477 5478 + 5480: 7(f16vec4) Load 5452(texel) + 5481: 7(f16vec4) FAdd 5480 5479 + Store 5452(texel) 5481 + 5482: 142 Load 5474(t2D) + 5483: 5456 Load 5458(s) + 5484: 143 SampledImage 5482 5483 + 5485:154(f16vec2) Load 156(f16c2) + 5486:6(float16_t) Load 137(f16bias) + 5487: 7(f16vec4) ImageSampleImplicitLod 5484 5485 Bias 5486 + 5488: 7(f16vec4) Load 5452(texel) + 5489: 7(f16vec4) FAdd 5488 5487 + Store 5452(texel) 5489 + 5492: 162 Load 5491(t3D) + 5493: 5456 Load 5458(s) + 5494: 163 SampledImage 5492 5493 + 5495: 167(fvec3) Load 169(c3) + 5496: 7(f16vec4) ImageSampleImplicitLod 5494 5495 + 5497: 7(f16vec4) Load 5452(texel) + 5498: 7(f16vec4) FAdd 5497 5496 + Store 5452(texel) 5498 + 5499: 162 Load 5491(t3D) + 5500: 5456 Load 5458(s) + 5501: 163 SampledImage 5499 5500 + 5502:175(f16vec3) Load 177(f16c3) + 5503:6(float16_t) Load 137(f16bias) + 5504: 7(f16vec4) ImageSampleImplicitLod 5501 5502 Bias 5503 + 5505: 7(f16vec4) Load 5452(texel) + 5506: 7(f16vec4) FAdd 5505 5504 + Store 5452(texel) 5506 + 5509: 183 Load 5508(tCube) + 5510: 5456 Load 5458(s) + 5511: 184 SampledImage 5509 5510 + 5512: 167(fvec3) Load 169(c3) + 5513: 7(f16vec4) ImageSampleImplicitLod 5511 5512 + 5514: 7(f16vec4) Load 5452(texel) + 5515: 7(f16vec4) FAdd 5514 5513 + Store 5452(texel) 5515 + 5516: 183 Load 5508(tCube) + 5517: 5456 Load 5458(s) + 5518: 184 SampledImage 5516 5517 + 5519:175(f16vec3) Load 177(f16c3) + 5520:6(float16_t) Load 137(f16bias) + 5521: 7(f16vec4) ImageSampleImplicitLod 5518 5519 Bias 5520 + 5522: 7(f16vec4) Load 5452(texel) + 5523: 7(f16vec4) FAdd 5522 5521 + Store 5452(texel) 5523 + 5524: 122 Load 5454(t1D) + 5526: 5456 Load 5525(sShadow) + 5527: 199 SampledImage 5524 5526 + 5528: 167(fvec3) Load 169(c3) + 5529: 52(float) CompositeExtract 5528 2 + 5530:6(float16_t) ImageSampleDrefImplicitLod 5527 5528 5529 + 5531: 208(ptr) AccessChain 5452(texel) 207 + 5532:6(float16_t) Load 5531 + 5533:6(float16_t) FAdd 5532 5530 + 5534: 208(ptr) AccessChain 5452(texel) 207 + Store 5534 5533 + 5535: 122 Load 5454(t1D) + 5536: 5456 Load 5525(sShadow) + 5537: 199 SampledImage 5535 5536 + 5538:154(f16vec2) Load 156(f16c2) + 5539: 52(float) Load 215(compare) + 5540:6(float16_t) Load 137(f16bias) + 5541:6(float16_t) ImageSampleDrefImplicitLod 5537 5538 5539 Bias 5540 + 5542: 208(ptr) AccessChain 5452(texel) 207 + 5543:6(float16_t) Load 5542 + 5544:6(float16_t) FAdd 5543 5541 + 5545: 208(ptr) AccessChain 5452(texel) 207 + Store 5545 5544 + 5546: 142 Load 5474(t2D) + 5547: 5456 Load 5525(sShadow) + 5548: 224 SampledImage 5546 5547 + 5549: 167(fvec3) Load 169(c3) + 5550: 52(float) CompositeExtract 5549 2 + 5551:6(float16_t) ImageSampleDrefImplicitLod 5548 5549 5550 + 5552: 208(ptr) AccessChain 5452(texel) 207 + 5553:6(float16_t) Load 5552 + 5554:6(float16_t) FAdd 5553 5551 + 5555: 208(ptr) AccessChain 5452(texel) 207 + Store 5555 5554 + 5556: 142 Load 5474(t2D) + 5557: 5456 Load 5525(sShadow) + 5558: 224 SampledImage 5556 5557 + 5559:154(f16vec2) Load 156(f16c2) + 5560: 52(float) Load 215(compare) + 5561:6(float16_t) Load 137(f16bias) + 5562:6(float16_t) ImageSampleDrefImplicitLod 5558 5559 5560 Bias 5561 + 5563: 208(ptr) AccessChain 5452(texel) 207 + 5564:6(float16_t) Load 5563 + 5565:6(float16_t) FAdd 5564 5562 + 5566: 208(ptr) AccessChain 5452(texel) 207 + Store 5566 5565 + 5567: 183 Load 5508(tCube) + 5568: 5456 Load 5525(sShadow) + 5569: 245 SampledImage 5567 5568 + 5570: 249(fvec4) Load 251(c4) + 5571: 52(float) CompositeExtract 5570 3 + 5572:6(float16_t) ImageSampleDrefImplicitLod 5569 5570 5571 + 5573: 208(ptr) AccessChain 5452(texel) 207 + 5574:6(float16_t) Load 5573 + 5575:6(float16_t) FAdd 5574 5572 + 5576: 208(ptr) AccessChain 5452(texel) 207 + Store 5576 5575 + 5577: 183 Load 5508(tCube) + 5578: 5456 Load 5525(sShadow) + 5579: 245 SampledImage 5577 5578 + 5580:175(f16vec3) Load 177(f16c3) + 5581: 52(float) Load 215(compare) + 5582:6(float16_t) Load 137(f16bias) + 5583:6(float16_t) ImageSampleDrefImplicitLod 5579 5580 5581 Bias 5582 + 5584: 208(ptr) AccessChain 5452(texel) 207 + 5585:6(float16_t) Load 5584 + 5586:6(float16_t) FAdd 5585 5583 + 5587: 208(ptr) AccessChain 5452(texel) 207 + Store 5587 5586 + 5590: 268 Load 5589(t1DArray) + 5591: 5456 Load 5458(s) + 5592: 269 SampledImage 5590 5591 + 5593: 53(fvec2) Load 148(c2) + 5594: 7(f16vec4) ImageSampleImplicitLod 5592 5593 + 5595: 7(f16vec4) Load 5452(texel) + 5596: 7(f16vec4) FAdd 5595 5594 + Store 5452(texel) 5596 + 5597: 268 Load 5589(t1DArray) + 5598: 5456 Load 5458(s) + 5599: 269 SampledImage 5597 5598 + 5600:154(f16vec2) Load 156(f16c2) + 5601:6(float16_t) Load 137(f16bias) + 5602: 7(f16vec4) ImageSampleImplicitLod 5599 5600 Bias 5601 + 5603: 7(f16vec4) Load 5452(texel) + 5604: 7(f16vec4) FAdd 5603 5602 + Store 5452(texel) 5604 + 5607: 283 Load 5606(t2DArray) + 5608: 5456 Load 5458(s) + 5609: 284 SampledImage 5607 5608 + 5610: 167(fvec3) Load 169(c3) + 5611: 7(f16vec4) ImageSampleImplicitLod 5609 5610 + 5612: 7(f16vec4) Load 5452(texel) + 5613: 7(f16vec4) FAdd 5612 5611 + Store 5452(texel) 5613 + 5614: 283 Load 5606(t2DArray) + 5615: 5456 Load 5458(s) + 5616: 284 SampledImage 5614 5615 + 5617:175(f16vec3) Load 177(f16c3) + 5618:6(float16_t) Load 137(f16bias) + 5619: 7(f16vec4) ImageSampleImplicitLod 5616 5617 Bias 5618 + 5620: 7(f16vec4) Load 5452(texel) + 5621: 7(f16vec4) FAdd 5620 5619 + Store 5452(texel) 5621 + 5624: 298 Load 5623(tCubeArray) + 5625: 5456 Load 5458(s) + 5626: 299 SampledImage 5624 5625 + 5627: 249(fvec4) Load 251(c4) + 5628: 7(f16vec4) ImageSampleImplicitLod 5626 5627 + 5629: 7(f16vec4) Load 5452(texel) + 5630: 7(f16vec4) FAdd 5629 5628 + Store 5452(texel) 5630 + 5631: 298 Load 5623(tCubeArray) + 5632: 5456 Load 5458(s) + 5633: 299 SampledImage 5631 5632 + 5634: 7(f16vec4) Load 309(f16c4) + 5635:6(float16_t) Load 137(f16bias) + 5636: 7(f16vec4) ImageSampleImplicitLod 5633 5634 Bias 5635 + 5637: 7(f16vec4) Load 5452(texel) + 5638: 7(f16vec4) FAdd 5637 5636 + Store 5452(texel) 5638 + 5639: 268 Load 5589(t1DArray) + 5640: 5456 Load 5525(sShadow) + 5641: 316 SampledImage 5639 5640 + 5642: 167(fvec3) Load 169(c3) + 5643: 52(float) CompositeExtract 5642 2 + 5644:6(float16_t) ImageSampleDrefImplicitLod 5641 5642 5643 + 5645: 208(ptr) AccessChain 5452(texel) 207 + 5646:6(float16_t) Load 5645 + 5647:6(float16_t) FAdd 5646 5644 + 5648: 208(ptr) AccessChain 5452(texel) 207 + Store 5648 5647 + 5649: 268 Load 5589(t1DArray) + 5650: 5456 Load 5525(sShadow) + 5651: 316 SampledImage 5649 5650 + 5652:154(f16vec2) Load 156(f16c2) + 5653: 52(float) Load 215(compare) + 5654:6(float16_t) Load 137(f16bias) + 5655:6(float16_t) ImageSampleDrefImplicitLod 5651 5652 5653 Bias 5654 + 5656: 208(ptr) AccessChain 5452(texel) 207 + 5657:6(float16_t) Load 5656 + 5658:6(float16_t) FAdd 5657 5655 + 5659: 208(ptr) AccessChain 5452(texel) 207 + Store 5659 5658 + 5660: 283 Load 5606(t2DArray) + 5661: 5456 Load 5525(sShadow) + 5662: 337 SampledImage 5660 5661 + 5663: 249(fvec4) Load 251(c4) + 5664: 52(float) CompositeExtract 5663 3 + 5665:6(float16_t) ImageSampleDrefImplicitLod 5662 5663 5664 + 5666: 208(ptr) AccessChain 5452(texel) 207 + 5667:6(float16_t) Load 5666 + 5668:6(float16_t) FAdd 5667 5665 + 5669: 208(ptr) AccessChain 5452(texel) 207 + Store 5669 5668 + 5670: 283 Load 5606(t2DArray) + 5671: 5456 Load 5525(sShadow) + 5672: 337 SampledImage 5670 5671 + 5673:175(f16vec3) Load 177(f16c3) + 5674: 52(float) Load 215(compare) + 5675:6(float16_t) ImageSampleDrefImplicitLod 5672 5673 5674 + 5676: 208(ptr) AccessChain 5452(texel) 207 + 5677:6(float16_t) Load 5676 + 5678:6(float16_t) FAdd 5677 5675 + 5679: 208(ptr) AccessChain 5452(texel) 207 + Store 5679 5678 + 5682: 356 Load 5681(t2DRect) + 5683: 5456 Load 5458(s) + 5684: 357 SampledImage 5682 5683 + 5685: 53(fvec2) Load 148(c2) + 5686: 7(f16vec4) ImageSampleImplicitLod 5684 5685 + 5687: 7(f16vec4) Load 5452(texel) + 5688: 7(f16vec4) FAdd 5687 5686 + Store 5452(texel) 5688 + 5689: 356 Load 5681(t2DRect) + 5690: 5456 Load 5458(s) + 5691: 357 SampledImage 5689 5690 + 5692:154(f16vec2) Load 156(f16c2) + 5693: 7(f16vec4) ImageSampleImplicitLod 5691 5692 + 5694: 7(f16vec4) Load 5452(texel) + 5695: 7(f16vec4) FAdd 5694 5693 + Store 5452(texel) 5695 + 5696: 356 Load 5681(t2DRect) + 5697: 5456 Load 5525(sShadow) + 5698: 371 SampledImage 5696 5697 + 5699: 167(fvec3) Load 169(c3) + 5700: 52(float) CompositeExtract 5699 2 + 5701:6(float16_t) ImageSampleDrefImplicitLod 5698 5699 5700 + 5702: 208(ptr) AccessChain 5452(texel) 207 + 5703:6(float16_t) Load 5702 + 5704:6(float16_t) FAdd 5703 5701 + 5705: 208(ptr) AccessChain 5452(texel) 207 + Store 5705 5704 + 5706: 356 Load 5681(t2DRect) + 5707: 5456 Load 5525(sShadow) + 5708: 371 SampledImage 5706 5707 + 5709:154(f16vec2) Load 156(f16c2) + 5710: 52(float) Load 215(compare) + 5711:6(float16_t) ImageSampleDrefImplicitLod 5708 5709 5710 + 5712: 208(ptr) AccessChain 5452(texel) 207 + 5713:6(float16_t) Load 5712 + 5714:6(float16_t) FAdd 5713 5711 + 5715: 208(ptr) AccessChain 5452(texel) 207 + Store 5715 5714 + 5716: 298 Load 5623(tCubeArray) + 5717: 5456 Load 5525(sShadow) + 5718: 391 SampledImage 5716 5717 + 5719: 249(fvec4) Load 251(c4) + 5720: 52(float) Load 215(compare) + 5721:6(float16_t) ImageSampleDrefImplicitLod 5718 5719 5720 + 5722: 208(ptr) AccessChain 5452(texel) 207 + 5723:6(float16_t) Load 5722 + 5724:6(float16_t) FAdd 5723 5721 + 5725: 208(ptr) AccessChain 5452(texel) 207 + Store 5725 5724 + 5726: 298 Load 5623(tCubeArray) + 5727: 5456 Load 5525(sShadow) + 5728: 391 SampledImage 5726 5727 + 5729: 7(f16vec4) Load 309(f16c4) + 5730: 52(float) Load 215(compare) + 5731:6(float16_t) ImageSampleDrefImplicitLod 5728 5729 5730 + 5732: 208(ptr) AccessChain 5452(texel) 207 + 5733:6(float16_t) Load 5732 + 5734:6(float16_t) FAdd 5733 5731 + 5735: 208(ptr) AccessChain 5452(texel) 207 + Store 5735 5734 + 5736: 7(f16vec4) Load 5452(texel) + ReturnValue 5736 + FunctionEnd +117(testSubpassLoad(): 7(f16vec4) Function None 8 + 118: Label + 5742: 5739 Load 5741(subpass) + 5744: 7(f16vec4) ImageRead 5742 5743 + 5748: 5745 Load 5747(subpassMS) + 5749: 7(f16vec4) ImageRead 5748 5743 Sample 1326 + 5750: 7(f16vec4) FAdd 5744 5749 + ReturnValue 5750 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.float32.frag.out b/deps/glslang/Test/baseResults/spv.float32.frag.out new file mode 100644 index 00000000..1a325ea1 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.float32.frag.out @@ -0,0 +1,811 @@ +spv.float32.frag +error: SPIRV-Tools Validation Errors +error: Capability Float16 is not allowed by Vulkan 1.1 specification (or requires extension) + OpCapability Float16 + +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 533 + + Capability Shader + Capability Float16 + Capability Float64 + Capability Int64 + Capability Int16 + Capability Int8 + Capability DerivativeControl + Capability InterpolationFunction + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 471 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_KHX_shader_explicit_arithmetic_types" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int8" + Name 4 "main" + Name 6 "literal(" + Name 8 "operators(" + Name 10 "typeCast(" + Name 12 "builtinAngleTrigFuncs(" + Name 14 "builtinExpFuncs(" + Name 16 "builtinCommonFuncs(" + Name 18 "builtinGeometryFuncs(" + Name 20 "builtinMatrixFuncs(" + Name 22 "builtinVecRelFuncs(" + Name 24 "builtinFragProcFuncs(" + Name 29 "f32v" + Name 40 "f32v" + Name 62 "f32m" + Name 85 "f32" + Name 109 "b" + Name 152 "f64v" + Name 155 "f32v" + Name 160 "bv" + Name 175 "f16v" + Name 183 "i8v" + Name 189 "i16v" + Name 195 "i32v" + Name 201 "i64v" + Name 207 "u8v" + Name 213 "u16v" + Name 218 "u32v" + Name 224 "u64v" + Name 229 "f32v2" + Name 230 "f32v1" + Name 262 "f32v2" + Name 263 "f32v1" + Name 279 "f32v2" + Name 280 "f32v1" + Name 301 "f32" + Name 305 "f32v3" + Name 345 "bv" + Name 366 "b" + Name 376 "iv" + Name 377 "ResType" + Name 384 "f32" + Name 385 "f32v1" + Name 389 "f32v2" + Name 395 "f32v3" + Name 414 "f32m3" + Name 415 "f32m1" + Name 417 "f32m2" + Name 426 "f32v1" + Name 428 "f32v2" + Name 433 "f32m4" + Name 436 "f32" + Name 439 "f32m5" + Name 444 "f32m6" + Name 445 "f32m7" + Name 448 "bv" + Name 449 "f32v1" + Name 451 "f32v2" + Name 469 "f32v" + Name 471 "if32v" + Name 520 "S" + MemberName 520(S) 0 "x" + MemberName 520(S) 1 "y" + MemberName 520(S) 2 "z" + Name 522 "B1" + MemberName 522(B1) 0 "a" + MemberName 522(B1) 1 "b" + MemberName 522(B1) 2 "c" + MemberName 522(B1) 3 "d" + MemberName 522(B1) 4 "e" + MemberName 522(B1) 5 "f" + MemberName 522(B1) 6 "g" + MemberName 522(B1) 7 "h" + Name 524 "" + Name 525 "sf16" + Name 526 "sf" + Name 527 "sd" + Name 528 "f16_to_f" + Name 530 "f16_to_d" + Name 531 "f_to_f16" + Name 532 "d_to_f16" + Decorate 518 ArrayStride 16 + Decorate 519 ArrayStride 32 + MemberDecorate 520(S) 0 Offset 0 + MemberDecorate 520(S) 1 Offset 8 + MemberDecorate 520(S) 2 Offset 16 + Decorate 521 ArrayStride 32 + MemberDecorate 522(B1) 0 Offset 0 + MemberDecorate 522(B1) 1 Offset 8 + MemberDecorate 522(B1) 2 Offset 16 + MemberDecorate 522(B1) 3 Offset 32 + MemberDecorate 522(B1) 4 ColMajor + MemberDecorate 522(B1) 4 Offset 64 + MemberDecorate 522(B1) 4 MatrixStride 16 + MemberDecorate 522(B1) 5 ColMajor + MemberDecorate 522(B1) 5 Offset 96 + MemberDecorate 522(B1) 5 MatrixStride 16 + MemberDecorate 522(B1) 6 Offset 160 + MemberDecorate 522(B1) 7 Offset 192 + Decorate 522(B1) Block + Decorate 524 DescriptorSet 0 + Decorate 525(sf16) SpecId 100 + Decorate 526(sf) SpecId 101 + Decorate 527(sd) SpecId 102 + 2: TypeVoid + 3: TypeFunction 2 + 26: TypeFloat 32 + 27: TypeVector 26(float) 2 + 28: TypePointer Function 27(fvec2) + 30: 26(float) Constant 897988541 + 31: TypeInt 32 0 + 32: 31(int) Constant 0 + 33: TypePointer Function 26(float) + 35: 26(float) Constant 3196059648 + 36: 26(float) Constant 1022739087 + 37: 27(fvec2) ConstantComposite 35 36 + 54: 26(float) Constant 1065353216 + 60: TypeMatrix 27(fvec2) 2 + 61: TypePointer Function 60 + 88: 31(int) Constant 1 + 107: TypeBool + 108: TypePointer Function 107(bool) + 149: TypeFloat 64 + 150: TypeVector 149(float64_t) 3 + 151: TypePointer Function 150(f64vec3) + 153: TypeVector 26(float) 3 + 154: TypePointer Function 153(fvec3) + 158: TypeVector 107(bool) 3 + 159: TypePointer Function 158(bvec3) + 162: 26(float) Constant 0 + 163: 153(fvec3) ConstantComposite 162 162 162 + 164: 153(fvec3) ConstantComposite 54 54 54 + 172: TypeFloat 16 + 173: TypeVector 172(float16_t) 3 + 174: TypePointer Function 173(f16vec3) + 180: TypeInt 8 1 + 181: TypeVector 180(int8_t) 3 + 182: TypePointer Function 181(i8vec3) + 186: TypeInt 16 1 + 187: TypeVector 186(int16_t) 3 + 188: TypePointer Function 187(i16vec3) + 192: TypeInt 32 1 + 193: TypeVector 192(int) 3 + 194: TypePointer Function 193(ivec3) + 198: TypeInt 64 1 + 199: TypeVector 198(int64_t) 3 + 200: TypePointer Function 199(i64vec3) + 204: TypeInt 8 0 + 205: TypeVector 204(int8_t) 3 + 206: TypePointer Function 205(i8vec3) + 210: TypeInt 16 0 + 211: TypeVector 210(int16_t) 3 + 212: TypePointer Function 211(i16vec3) + 216: TypeVector 31(int) 3 + 217: TypePointer Function 216(ivec3) + 221: TypeInt 64 0 + 222: TypeVector 221(int64_t) 3 + 223: TypePointer Function 222(i64vec3) + 227: TypeVector 26(float) 4 + 228: TypePointer Function 227(fvec4) + 377(ResType): TypeStruct 153(fvec3) 193(ivec3) + 412: TypeMatrix 153(fvec3) 2 + 413: TypePointer Function 412 + 431: TypeMatrix 27(fvec2) 3 + 432: TypePointer Function 431 + 437: TypeMatrix 153(fvec3) 3 + 438: TypePointer Function 437 + 442: TypeMatrix 227(fvec4) 4 + 443: TypePointer Function 442 + 470: TypePointer Input 153(fvec3) + 471(if32v): 470(ptr) Variable Input + 472: TypePointer Input 26(float) + 509: 192(int) Constant 1 + 514: 26(float) Constant 1056964608 + 515: 27(fvec2) ConstantComposite 514 514 + 517: 31(int) Constant 2 + 518: TypeArray 26(float) 517 + 519: TypeArray 412 517 + 520(S): TypeStruct 26(float) 27(fvec2) 153(fvec3) + 521: TypeArray 520(S) 517 + 522(B1): TypeStruct 26(float) 27(fvec2) 153(fvec3) 518 412 519 520(S) 521 + 523: TypePointer Uniform 522(B1) + 524: 523(ptr) Variable Uniform + 525(sf16):172(float16_t) SpecConstant 12288 + 526(sf): 26(float) SpecConstant 1048576000 + 527(sd):149(float64_t) SpecConstant 0 1071644672 + 528(f16_to_f): 26(float) SpecConstantOp 115 525(sf16) + 529: 26(float) SpecConstantOp 115 525(sf16) + 530(f16_to_d):149(float64_t) SpecConstantOp 115 529 + 531(f_to_f16):172(float16_t) SpecConstantOp 115 526(sf) + 532(d_to_f16):172(float16_t) SpecConstantOp 115 527(sd) + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd + 6(literal(): 2 Function None 3 + 7: Label + 29(f32v): 28(ptr) Variable Function + 34: 33(ptr) AccessChain 29(f32v) 32 + Store 34 30 + 38: 27(fvec2) Load 29(f32v) + 39: 27(fvec2) FAdd 38 37 + Store 29(f32v) 39 + Return + FunctionEnd + 8(operators(): 2 Function None 3 + 9: Label + 40(f32v): 28(ptr) Variable Function + 62(f32m): 61(ptr) Variable Function + 85(f32): 33(ptr) Variable Function + 109(b): 108(ptr) Variable Function + 41: 27(fvec2) Load 40(f32v) + 42: 27(fvec2) Load 40(f32v) + 43: 27(fvec2) FAdd 42 41 + Store 40(f32v) 43 + 44: 27(fvec2) Load 40(f32v) + 45: 27(fvec2) Load 40(f32v) + 46: 27(fvec2) FSub 45 44 + Store 40(f32v) 46 + 47: 27(fvec2) Load 40(f32v) + 48: 27(fvec2) Load 40(f32v) + 49: 27(fvec2) FMul 48 47 + Store 40(f32v) 49 + 50: 27(fvec2) Load 40(f32v) + 51: 27(fvec2) Load 40(f32v) + 52: 27(fvec2) FDiv 51 50 + Store 40(f32v) 52 + 53: 27(fvec2) Load 40(f32v) + 55: 27(fvec2) CompositeConstruct 54 54 + 56: 27(fvec2) FAdd 53 55 + Store 40(f32v) 56 + 57: 27(fvec2) Load 40(f32v) + 58: 27(fvec2) CompositeConstruct 54 54 + 59: 27(fvec2) FSub 57 58 + Store 40(f32v) 59 + 63: 60 Load 62(f32m) + 64: 27(fvec2) CompositeConstruct 54 54 + 65: 27(fvec2) CompositeExtract 63 0 + 66: 27(fvec2) FAdd 65 64 + 67: 27(fvec2) CompositeExtract 63 1 + 68: 27(fvec2) FAdd 67 64 + 69: 60 CompositeConstruct 66 68 + Store 62(f32m) 69 + 70: 60 Load 62(f32m) + 71: 27(fvec2) CompositeConstruct 54 54 + 72: 27(fvec2) CompositeExtract 70 0 + 73: 27(fvec2) FSub 72 71 + 74: 27(fvec2) CompositeExtract 70 1 + 75: 27(fvec2) FSub 74 71 + 76: 60 CompositeConstruct 73 75 + Store 62(f32m) 76 + 77: 27(fvec2) Load 40(f32v) + 78: 27(fvec2) FNegate 77 + Store 40(f32v) 78 + 79: 60 Load 62(f32m) + 80: 27(fvec2) CompositeExtract 79 0 + 81: 27(fvec2) FNegate 80 + 82: 27(fvec2) CompositeExtract 79 1 + 83: 27(fvec2) FNegate 82 + 84: 60 CompositeConstruct 81 83 + Store 62(f32m) 84 + 86: 33(ptr) AccessChain 40(f32v) 32 + 87: 26(float) Load 86 + 89: 33(ptr) AccessChain 40(f32v) 88 + 90: 26(float) Load 89 + 91: 26(float) FAdd 87 90 + Store 85(f32) 91 + 92: 33(ptr) AccessChain 40(f32v) 32 + 93: 26(float) Load 92 + 94: 33(ptr) AccessChain 40(f32v) 88 + 95: 26(float) Load 94 + 96: 26(float) FSub 93 95 + Store 85(f32) 96 + 97: 33(ptr) AccessChain 40(f32v) 32 + 98: 26(float) Load 97 + 99: 33(ptr) AccessChain 40(f32v) 88 + 100: 26(float) Load 99 + 101: 26(float) FMul 98 100 + Store 85(f32) 101 + 102: 33(ptr) AccessChain 40(f32v) 32 + 103: 26(float) Load 102 + 104: 33(ptr) AccessChain 40(f32v) 88 + 105: 26(float) Load 104 + 106: 26(float) FDiv 103 105 + Store 85(f32) 106 + 110: 33(ptr) AccessChain 40(f32v) 32 + 111: 26(float) Load 110 + 112: 26(float) Load 85(f32) + 113: 107(bool) FOrdNotEqual 111 112 + Store 109(b) 113 + 114: 33(ptr) AccessChain 40(f32v) 88 + 115: 26(float) Load 114 + 116: 26(float) Load 85(f32) + 117: 107(bool) FOrdEqual 115 116 + Store 109(b) 117 + 118: 33(ptr) AccessChain 40(f32v) 32 + 119: 26(float) Load 118 + 120: 26(float) Load 85(f32) + 121: 107(bool) FOrdGreaterThan 119 120 + Store 109(b) 121 + 122: 33(ptr) AccessChain 40(f32v) 88 + 123: 26(float) Load 122 + 124: 26(float) Load 85(f32) + 125: 107(bool) FOrdLessThan 123 124 + Store 109(b) 125 + 126: 33(ptr) AccessChain 40(f32v) 32 + 127: 26(float) Load 126 + 128: 26(float) Load 85(f32) + 129: 107(bool) FOrdGreaterThanEqual 127 128 + Store 109(b) 129 + 130: 33(ptr) AccessChain 40(f32v) 88 + 131: 26(float) Load 130 + 132: 26(float) Load 85(f32) + 133: 107(bool) FOrdLessThanEqual 131 132 + Store 109(b) 133 + 134: 27(fvec2) Load 40(f32v) + 135: 26(float) Load 85(f32) + 136: 27(fvec2) VectorTimesScalar 134 135 + Store 40(f32v) 136 + 137: 60 Load 62(f32m) + 138: 26(float) Load 85(f32) + 139: 60 MatrixTimesScalar 137 138 + Store 62(f32m) 139 + 140: 60 Load 62(f32m) + 141: 27(fvec2) Load 40(f32v) + 142: 27(fvec2) MatrixTimesVector 140 141 + Store 40(f32v) 142 + 143: 27(fvec2) Load 40(f32v) + 144: 60 Load 62(f32m) + 145: 27(fvec2) VectorTimesMatrix 143 144 + Store 40(f32v) 145 + 146: 60 Load 62(f32m) + 147: 60 Load 62(f32m) + 148: 60 MatrixTimesMatrix 146 147 + Store 62(f32m) 148 + Return + FunctionEnd + 10(typeCast(): 2 Function None 3 + 11: Label + 152(f64v): 151(ptr) Variable Function + 155(f32v): 154(ptr) Variable Function + 160(bv): 159(ptr) Variable Function + 175(f16v): 174(ptr) Variable Function + 183(i8v): 182(ptr) Variable Function + 189(i16v): 188(ptr) Variable Function + 195(i32v): 194(ptr) Variable Function + 201(i64v): 200(ptr) Variable Function + 207(u8v): 206(ptr) Variable Function + 213(u16v): 212(ptr) Variable Function + 218(u32v): 217(ptr) Variable Function + 224(u64v): 223(ptr) Variable Function + 156: 153(fvec3) Load 155(f32v) + 157:150(f64vec3) FConvert 156 + Store 152(f64v) 157 + 161: 158(bvec3) Load 160(bv) + 165: 153(fvec3) Select 161 164 163 + Store 155(f32v) 165 + 166: 153(fvec3) Load 155(f32v) + 167: 158(bvec3) FOrdNotEqual 166 163 + Store 160(bv) 167 + 168:150(f64vec3) Load 152(f64v) + 169: 153(fvec3) FConvert 168 + Store 155(f32v) 169 + 170: 153(fvec3) Load 155(f32v) + 171:150(f64vec3) FConvert 170 + Store 152(f64v) 171 + 176:173(f16vec3) Load 175(f16v) + 177: 153(fvec3) FConvert 176 + Store 155(f32v) 177 + 178: 153(fvec3) Load 155(f32v) + 179:173(f16vec3) FConvert 178 + Store 175(f16v) 179 + 184: 153(fvec3) Load 155(f32v) + 185: 181(i8vec3) ConvertFToS 184 + Store 183(i8v) 185 + 190: 153(fvec3) Load 155(f32v) + 191:187(i16vec3) ConvertFToS 190 + Store 189(i16v) 191 + 196: 153(fvec3) Load 155(f32v) + 197: 193(ivec3) ConvertFToS 196 + Store 195(i32v) 197 + 202: 153(fvec3) Load 155(f32v) + 203:199(i64vec3) ConvertFToS 202 + Store 201(i64v) 203 + 208: 153(fvec3) Load 155(f32v) + 209: 205(i8vec3) ConvertFToU 208 + Store 207(u8v) 209 + 214: 153(fvec3) Load 155(f32v) + 215:211(i16vec3) ConvertFToU 214 + Store 213(u16v) 215 + 219: 153(fvec3) Load 155(f32v) + 220: 216(ivec3) ConvertFToU 219 + Store 218(u32v) 220 + 225: 153(fvec3) Load 155(f32v) + 226:222(i64vec3) ConvertFToU 225 + Store 224(u64v) 226 + Return + FunctionEnd +12(builtinAngleTrigFuncs(): 2 Function None 3 + 13: Label + 229(f32v2): 228(ptr) Variable Function + 230(f32v1): 228(ptr) Variable Function + 231: 227(fvec4) Load 230(f32v1) + 232: 227(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 231 + Store 229(f32v2) 232 + 233: 227(fvec4) Load 230(f32v1) + 234: 227(fvec4) ExtInst 1(GLSL.std.450) 12(Degrees) 233 + Store 229(f32v2) 234 + 235: 227(fvec4) Load 230(f32v1) + 236: 227(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 235 + Store 229(f32v2) 236 + 237: 227(fvec4) Load 230(f32v1) + 238: 227(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 237 + Store 229(f32v2) 238 + 239: 227(fvec4) Load 230(f32v1) + 240: 227(fvec4) ExtInst 1(GLSL.std.450) 15(Tan) 239 + Store 229(f32v2) 240 + 241: 227(fvec4) Load 230(f32v1) + 242: 227(fvec4) ExtInst 1(GLSL.std.450) 16(Asin) 241 + Store 229(f32v2) 242 + 243: 227(fvec4) Load 230(f32v1) + 244: 227(fvec4) ExtInst 1(GLSL.std.450) 17(Acos) 243 + Store 229(f32v2) 244 + 245: 227(fvec4) Load 230(f32v1) + 246: 227(fvec4) Load 229(f32v2) + 247: 227(fvec4) ExtInst 1(GLSL.std.450) 25(Atan2) 245 246 + Store 229(f32v2) 247 + 248: 227(fvec4) Load 230(f32v1) + 249: 227(fvec4) ExtInst 1(GLSL.std.450) 18(Atan) 248 + Store 229(f32v2) 249 + 250: 227(fvec4) Load 230(f32v1) + 251: 227(fvec4) ExtInst 1(GLSL.std.450) 19(Sinh) 250 + Store 229(f32v2) 251 + 252: 227(fvec4) Load 230(f32v1) + 253: 227(fvec4) ExtInst 1(GLSL.std.450) 20(Cosh) 252 + Store 229(f32v2) 253 + 254: 227(fvec4) Load 230(f32v1) + 255: 227(fvec4) ExtInst 1(GLSL.std.450) 21(Tanh) 254 + Store 229(f32v2) 255 + 256: 227(fvec4) Load 230(f32v1) + 257: 227(fvec4) ExtInst 1(GLSL.std.450) 22(Asinh) 256 + Store 229(f32v2) 257 + 258: 227(fvec4) Load 230(f32v1) + 259: 227(fvec4) ExtInst 1(GLSL.std.450) 23(Acosh) 258 + Store 229(f32v2) 259 + 260: 227(fvec4) Load 230(f32v1) + 261: 227(fvec4) ExtInst 1(GLSL.std.450) 24(Atanh) 260 + Store 229(f32v2) 261 + Return + FunctionEnd +14(builtinExpFuncs(): 2 Function None 3 + 15: Label + 262(f32v2): 28(ptr) Variable Function + 263(f32v1): 28(ptr) Variable Function + 264: 27(fvec2) Load 263(f32v1) + 265: 27(fvec2) Load 262(f32v2) + 266: 27(fvec2) ExtInst 1(GLSL.std.450) 26(Pow) 264 265 + Store 262(f32v2) 266 + 267: 27(fvec2) Load 263(f32v1) + 268: 27(fvec2) ExtInst 1(GLSL.std.450) 27(Exp) 267 + Store 262(f32v2) 268 + 269: 27(fvec2) Load 263(f32v1) + 270: 27(fvec2) ExtInst 1(GLSL.std.450) 28(Log) 269 + Store 262(f32v2) 270 + 271: 27(fvec2) Load 263(f32v1) + 272: 27(fvec2) ExtInst 1(GLSL.std.450) 29(Exp2) 271 + Store 262(f32v2) 272 + 273: 27(fvec2) Load 263(f32v1) + 274: 27(fvec2) ExtInst 1(GLSL.std.450) 30(Log2) 273 + Store 262(f32v2) 274 + 275: 27(fvec2) Load 263(f32v1) + 276: 27(fvec2) ExtInst 1(GLSL.std.450) 31(Sqrt) 275 + Store 262(f32v2) 276 + 277: 27(fvec2) Load 263(f32v1) + 278: 27(fvec2) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 277 + Store 262(f32v2) 278 + Return + FunctionEnd +16(builtinCommonFuncs(): 2 Function None 3 + 17: Label + 279(f32v2): 154(ptr) Variable Function + 280(f32v1): 154(ptr) Variable Function + 301(f32): 33(ptr) Variable Function + 305(f32v3): 154(ptr) Variable Function + 345(bv): 159(ptr) Variable Function + 366(b): 108(ptr) Variable Function + 376(iv): 194(ptr) Variable Function + 281: 153(fvec3) Load 280(f32v1) + 282: 153(fvec3) ExtInst 1(GLSL.std.450) 4(FAbs) 281 + Store 279(f32v2) 282 + 283: 153(fvec3) Load 280(f32v1) + 284: 153(fvec3) ExtInst 1(GLSL.std.450) 6(FSign) 283 + Store 279(f32v2) 284 + 285: 153(fvec3) Load 280(f32v1) + 286: 153(fvec3) ExtInst 1(GLSL.std.450) 8(Floor) 285 + Store 279(f32v2) 286 + 287: 153(fvec3) Load 280(f32v1) + 288: 153(fvec3) ExtInst 1(GLSL.std.450) 3(Trunc) 287 + Store 279(f32v2) 288 + 289: 153(fvec3) Load 280(f32v1) + 290: 153(fvec3) ExtInst 1(GLSL.std.450) 1(Round) 289 + Store 279(f32v2) 290 + 291: 153(fvec3) Load 280(f32v1) + 292: 153(fvec3) ExtInst 1(GLSL.std.450) 2(RoundEven) 291 + Store 279(f32v2) 292 + 293: 153(fvec3) Load 280(f32v1) + 294: 153(fvec3) ExtInst 1(GLSL.std.450) 9(Ceil) 293 + Store 279(f32v2) 294 + 295: 153(fvec3) Load 280(f32v1) + 296: 153(fvec3) ExtInst 1(GLSL.std.450) 10(Fract) 295 + Store 279(f32v2) 296 + 297: 153(fvec3) Load 280(f32v1) + 298: 153(fvec3) Load 279(f32v2) + 299: 153(fvec3) FMod 297 298 + Store 279(f32v2) 299 + 300: 153(fvec3) Load 280(f32v1) + 302: 26(float) Load 301(f32) + 303: 153(fvec3) CompositeConstruct 302 302 302 + 304: 153(fvec3) FMod 300 303 + Store 279(f32v2) 304 + 306: 153(fvec3) Load 280(f32v1) + 307: 153(fvec3) ExtInst 1(GLSL.std.450) 35(Modf) 306 279(f32v2) + Store 305(f32v3) 307 + 308: 153(fvec3) Load 280(f32v1) + 309: 153(fvec3) Load 279(f32v2) + 310: 153(fvec3) ExtInst 1(GLSL.std.450) 37(FMin) 308 309 + Store 305(f32v3) 310 + 311: 153(fvec3) Load 280(f32v1) + 312: 26(float) Load 301(f32) + 313: 153(fvec3) CompositeConstruct 312 312 312 + 314: 153(fvec3) ExtInst 1(GLSL.std.450) 37(FMin) 311 313 + Store 305(f32v3) 314 + 315: 153(fvec3) Load 280(f32v1) + 316: 153(fvec3) Load 279(f32v2) + 317: 153(fvec3) ExtInst 1(GLSL.std.450) 40(FMax) 315 316 + Store 305(f32v3) 317 + 318: 153(fvec3) Load 280(f32v1) + 319: 26(float) Load 301(f32) + 320: 153(fvec3) CompositeConstruct 319 319 319 + 321: 153(fvec3) ExtInst 1(GLSL.std.450) 40(FMax) 318 320 + Store 305(f32v3) 321 + 322: 153(fvec3) Load 280(f32v1) + 323: 26(float) Load 301(f32) + 324: 33(ptr) AccessChain 279(f32v2) 32 + 325: 26(float) Load 324 + 326: 153(fvec3) CompositeConstruct 323 323 323 + 327: 153(fvec3) CompositeConstruct 325 325 325 + 328: 153(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 322 326 327 + Store 305(f32v3) 328 + 329: 153(fvec3) Load 280(f32v1) + 330: 153(fvec3) Load 279(f32v2) + 331: 26(float) Load 301(f32) + 332: 153(fvec3) CompositeConstruct 331 331 331 + 333: 153(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 329 330 332 + Store 305(f32v3) 333 + 334: 153(fvec3) Load 280(f32v1) + 335: 153(fvec3) Load 279(f32v2) + 336: 26(float) Load 301(f32) + 337: 153(fvec3) CompositeConstruct 336 336 336 + 338: 153(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 334 335 337 + Store 305(f32v3) 338 + 339: 153(fvec3) Load 280(f32v1) + 340: 153(fvec3) Load 279(f32v2) + 341: 153(fvec3) Load 305(f32v3) + 342: 153(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 339 340 341 + Store 305(f32v3) 342 + 343: 153(fvec3) Load 280(f32v1) + 344: 153(fvec3) Load 279(f32v2) + 346: 158(bvec3) Load 345(bv) + 347: 153(fvec3) Select 346 344 343 + Store 305(f32v3) 347 + 348: 153(fvec3) Load 280(f32v1) + 349: 153(fvec3) Load 279(f32v2) + 350: 153(fvec3) ExtInst 1(GLSL.std.450) 48(Step) 348 349 + Store 305(f32v3) 350 + 351: 26(float) Load 301(f32) + 352: 153(fvec3) Load 305(f32v3) + 353: 153(fvec3) CompositeConstruct 351 351 351 + 354: 153(fvec3) ExtInst 1(GLSL.std.450) 48(Step) 353 352 + Store 305(f32v3) 354 + 355: 153(fvec3) Load 280(f32v1) + 356: 153(fvec3) Load 279(f32v2) + 357: 153(fvec3) Load 305(f32v3) + 358: 153(fvec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 355 356 357 + Store 305(f32v3) 358 + 359: 26(float) Load 301(f32) + 360: 33(ptr) AccessChain 280(f32v1) 32 + 361: 26(float) Load 360 + 362: 153(fvec3) Load 279(f32v2) + 363: 153(fvec3) CompositeConstruct 359 359 359 + 364: 153(fvec3) CompositeConstruct 361 361 361 + 365: 153(fvec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 363 364 362 + Store 305(f32v3) 365 + 367: 26(float) Load 301(f32) + 368: 107(bool) IsNan 367 + Store 366(b) 368 + 369: 153(fvec3) Load 280(f32v1) + 370: 158(bvec3) IsInf 369 + Store 345(bv) 370 + 371: 153(fvec3) Load 280(f32v1) + 372: 153(fvec3) Load 279(f32v2) + 373: 153(fvec3) Load 305(f32v3) + 374: 153(fvec3) ExtInst 1(GLSL.std.450) 50(Fma) 371 372 373 + Store 305(f32v3) 374 + 375: 153(fvec3) Load 280(f32v1) + 378:377(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 375 + 379: 193(ivec3) CompositeExtract 378 1 + Store 376(iv) 379 + 380: 153(fvec3) CompositeExtract 378 0 + Store 279(f32v2) 380 + 381: 153(fvec3) Load 280(f32v1) + 382: 193(ivec3) Load 376(iv) + 383: 153(fvec3) ExtInst 1(GLSL.std.450) 53(Ldexp) 381 382 + Store 279(f32v2) 383 + Return + FunctionEnd +18(builtinGeometryFuncs(): 2 Function None 3 + 19: Label + 384(f32): 33(ptr) Variable Function + 385(f32v1): 154(ptr) Variable Function + 389(f32v2): 154(ptr) Variable Function + 395(f32v3): 154(ptr) Variable Function + 386: 153(fvec3) Load 385(f32v1) + 387: 26(float) ExtInst 1(GLSL.std.450) 66(Length) 386 + Store 384(f32) 387 + 388: 153(fvec3) Load 385(f32v1) + 390: 153(fvec3) Load 389(f32v2) + 391: 26(float) ExtInst 1(GLSL.std.450) 67(Distance) 388 390 + Store 384(f32) 391 + 392: 153(fvec3) Load 385(f32v1) + 393: 153(fvec3) Load 389(f32v2) + 394: 26(float) Dot 392 393 + Store 384(f32) 394 + 396: 153(fvec3) Load 385(f32v1) + 397: 153(fvec3) Load 389(f32v2) + 398: 153(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 396 397 + Store 395(f32v3) 398 + 399: 153(fvec3) Load 385(f32v1) + 400: 153(fvec3) ExtInst 1(GLSL.std.450) 69(Normalize) 399 + Store 389(f32v2) 400 + 401: 153(fvec3) Load 385(f32v1) + 402: 153(fvec3) Load 389(f32v2) + 403: 153(fvec3) Load 395(f32v3) + 404: 153(fvec3) ExtInst 1(GLSL.std.450) 70(FaceForward) 401 402 403 + Store 395(f32v3) 404 + 405: 153(fvec3) Load 385(f32v1) + 406: 153(fvec3) Load 389(f32v2) + 407: 153(fvec3) ExtInst 1(GLSL.std.450) 71(Reflect) 405 406 + Store 395(f32v3) 407 + 408: 153(fvec3) Load 385(f32v1) + 409: 153(fvec3) Load 389(f32v2) + 410: 26(float) Load 384(f32) + 411: 153(fvec3) ExtInst 1(GLSL.std.450) 72(Refract) 408 409 410 + Store 395(f32v3) 411 + Return + FunctionEnd +20(builtinMatrixFuncs(): 2 Function None 3 + 21: Label + 414(f32m3): 413(ptr) Variable Function + 415(f32m1): 413(ptr) Variable Function + 417(f32m2): 413(ptr) Variable Function + 426(f32v1): 154(ptr) Variable Function + 428(f32v2): 28(ptr) Variable Function + 433(f32m4): 432(ptr) Variable Function + 436(f32): 33(ptr) Variable Function + 439(f32m5): 438(ptr) Variable Function + 444(f32m6): 443(ptr) Variable Function + 445(f32m7): 443(ptr) Variable Function + 416: 412 Load 415(f32m1) + 418: 412 Load 417(f32m2) + 419: 153(fvec3) CompositeExtract 416 0 + 420: 153(fvec3) CompositeExtract 418 0 + 421: 153(fvec3) FMul 419 420 + 422: 153(fvec3) CompositeExtract 416 1 + 423: 153(fvec3) CompositeExtract 418 1 + 424: 153(fvec3) FMul 422 423 + 425: 412 CompositeConstruct 421 424 + Store 414(f32m3) 425 + 427: 153(fvec3) Load 426(f32v1) + 429: 27(fvec2) Load 428(f32v2) + 430: 412 OuterProduct 427 429 + Store 415(f32m1) 430 + 434: 412 Load 415(f32m1) + 435: 431 Transpose 434 + Store 433(f32m4) 435 + 440: 437 Load 439(f32m5) + 441: 26(float) ExtInst 1(GLSL.std.450) 33(Determinant) 440 + Store 436(f32) 441 + 446: 442 Load 445(f32m7) + 447: 442 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 446 + Store 444(f32m6) 447 + Return + FunctionEnd +22(builtinVecRelFuncs(): 2 Function None 3 + 23: Label + 448(bv): 159(ptr) Variable Function + 449(f32v1): 154(ptr) Variable Function + 451(f32v2): 154(ptr) Variable Function + 450: 153(fvec3) Load 449(f32v1) + 452: 153(fvec3) Load 451(f32v2) + 453: 158(bvec3) FOrdLessThan 450 452 + Store 448(bv) 453 + 454: 153(fvec3) Load 449(f32v1) + 455: 153(fvec3) Load 451(f32v2) + 456: 158(bvec3) FOrdLessThanEqual 454 455 + Store 448(bv) 456 + 457: 153(fvec3) Load 449(f32v1) + 458: 153(fvec3) Load 451(f32v2) + 459: 158(bvec3) FOrdGreaterThan 457 458 + Store 448(bv) 459 + 460: 153(fvec3) Load 449(f32v1) + 461: 153(fvec3) Load 451(f32v2) + 462: 158(bvec3) FOrdGreaterThanEqual 460 461 + Store 448(bv) 462 + 463: 153(fvec3) Load 449(f32v1) + 464: 153(fvec3) Load 451(f32v2) + 465: 158(bvec3) FOrdEqual 463 464 + Store 448(bv) 465 + 466: 153(fvec3) Load 449(f32v1) + 467: 153(fvec3) Load 451(f32v2) + 468: 158(bvec3) FOrdNotEqual 466 467 + Store 448(bv) 468 + Return + FunctionEnd +24(builtinFragProcFuncs(): 2 Function None 3 + 25: Label + 469(f32v): 154(ptr) Variable Function + 473: 472(ptr) AccessChain 471(if32v) 32 + 474: 26(float) Load 473 + 475: 26(float) DPdx 474 + 476: 33(ptr) AccessChain 469(f32v) 32 + Store 476 475 + 477: 472(ptr) AccessChain 471(if32v) 88 + 478: 26(float) Load 477 + 479: 26(float) DPdy 478 + 480: 33(ptr) AccessChain 469(f32v) 88 + Store 480 479 + 481: 153(fvec3) Load 471(if32v) + 482: 27(fvec2) VectorShuffle 481 481 0 1 + 483: 27(fvec2) DPdxFine 482 + 484: 153(fvec3) Load 469(f32v) + 485: 153(fvec3) VectorShuffle 484 483 3 4 2 + Store 469(f32v) 485 + 486: 153(fvec3) Load 471(if32v) + 487: 27(fvec2) VectorShuffle 486 486 0 1 + 488: 27(fvec2) DPdyFine 487 + 489: 153(fvec3) Load 469(f32v) + 490: 153(fvec3) VectorShuffle 489 488 3 4 2 + Store 469(f32v) 490 + 491: 153(fvec3) Load 471(if32v) + 492: 153(fvec3) DPdxCoarse 491 + Store 469(f32v) 492 + 493: 153(fvec3) Load 471(if32v) + 494: 153(fvec3) DPdxCoarse 493 + Store 469(f32v) 494 + 495: 472(ptr) AccessChain 471(if32v) 32 + 496: 26(float) Load 495 + 497: 26(float) Fwidth 496 + 498: 33(ptr) AccessChain 469(f32v) 32 + Store 498 497 + 499: 153(fvec3) Load 471(if32v) + 500: 27(fvec2) VectorShuffle 499 499 0 1 + 501: 27(fvec2) FwidthFine 500 + 502: 153(fvec3) Load 469(f32v) + 503: 153(fvec3) VectorShuffle 502 501 3 4 2 + Store 469(f32v) 503 + 504: 153(fvec3) Load 471(if32v) + 505: 153(fvec3) FwidthCoarse 504 + Store 469(f32v) 505 + 506: 472(ptr) AccessChain 471(if32v) 32 + 507: 26(float) ExtInst 1(GLSL.std.450) 76(InterpolateAtCentroid) 506 + 508: 33(ptr) AccessChain 469(f32v) 32 + Store 508 507 + 510: 153(fvec3) ExtInst 1(GLSL.std.450) 77(InterpolateAtSample) 471(if32v) 509 + 511: 27(fvec2) VectorShuffle 510 510 0 1 + 512: 153(fvec3) Load 469(f32v) + 513: 153(fvec3) VectorShuffle 512 511 3 4 2 + Store 469(f32v) 513 + 516: 153(fvec3) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 471(if32v) 515 + Store 469(f32v) 516 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.float64.frag.out b/deps/glslang/Test/baseResults/spv.float64.frag.out new file mode 100644 index 00000000..78dca756 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.float64.frag.out @@ -0,0 +1,799 @@ +spv.float64.frag +error: SPIRV-Tools Validation Errors +error: Capability Float16 is not allowed by Vulkan 1.1 specification (or requires extension) + OpCapability Float16 + +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 524 + + Capability Shader + Capability Float16 + Capability Float64 + Capability Int64 + Capability Int16 + Capability Int8 + Capability DerivativeControl + Capability InterpolationFunction + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 461 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_KHX_shader_explicit_arithmetic_types" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int8" + Name 4 "main" + Name 6 "literal(" + Name 8 "operators(" + Name 10 "typeCast(" + Name 12 "builtinAngleTrigFuncs(" + Name 14 "builtinExpFuncs(" + Name 16 "builtinCommonFuncs(" + Name 18 "builtinGeometryFuncs(" + Name 20 "builtinMatrixFuncs(" + Name 22 "builtinVecRelFuncs(" + Name 24 "builtinFragProcFuncs(" + Name 29 "f64v" + Name 40 "f64v" + Name 62 "f64m" + Name 85 "f64" + Name 109 "b" + Name 151 "f64v" + Name 154 "bv" + Name 165 "f16v" + Name 173 "i8v" + Name 179 "i16v" + Name 185 "i32v" + Name 191 "i64v" + Name 197 "u8v" + Name 203 "u16v" + Name 208 "u32v" + Name 214 "u64v" + Name 219 "f64v2" + Name 220 "f64v1" + Name 252 "f64v2" + Name 253 "f64v1" + Name 269 "f64v2" + Name 270 "f64v1" + Name 291 "f64" + Name 295 "f64v3" + Name 335 "bv" + Name 356 "b" + Name 366 "iv" + Name 367 "ResType" + Name 374 "f64" + Name 375 "f64v1" + Name 379 "f64v2" + Name 385 "f64v3" + Name 404 "f64m3" + Name 405 "f64m1" + Name 407 "f64m2" + Name 416 "f64v1" + Name 418 "f64v2" + Name 423 "f64m4" + Name 426 "f64" + Name 429 "f64m5" + Name 434 "f64m6" + Name 435 "f64m7" + Name 438 "bv" + Name 439 "f64v1" + Name 441 "f64v2" + Name 459 "f64v" + Name 461 "if64v" + Name 510 "S" + MemberName 510(S) 0 "x" + MemberName 510(S) 1 "y" + MemberName 510(S) 2 "z" + Name 512 "B1" + MemberName 512(B1) 0 "a" + MemberName 512(B1) 1 "b" + MemberName 512(B1) 2 "c" + MemberName 512(B1) 3 "d" + MemberName 512(B1) 4 "e" + MemberName 512(B1) 5 "f" + MemberName 512(B1) 6 "g" + MemberName 512(B1) 7 "h" + Name 514 "" + Name 515 "sf16" + Name 517 "sf" + Name 518 "sd" + Name 519 "f16_to_f" + Name 521 "f16_to_d" + Name 522 "f_to_f16" + Name 523 "d_to_f16" + Decorate 461(if64v) Flat + Decorate 508 ArrayStride 16 + Decorate 509 ArrayStride 64 + MemberDecorate 510(S) 0 Offset 0 + MemberDecorate 510(S) 1 Offset 16 + MemberDecorate 510(S) 2 Offset 32 + Decorate 511 ArrayStride 64 + MemberDecorate 512(B1) 0 Offset 0 + MemberDecorate 512(B1) 1 Offset 16 + MemberDecorate 512(B1) 2 Offset 32 + MemberDecorate 512(B1) 3 Offset 64 + MemberDecorate 512(B1) 4 ColMajor + MemberDecorate 512(B1) 4 Offset 96 + MemberDecorate 512(B1) 4 MatrixStride 32 + MemberDecorate 512(B1) 5 ColMajor + MemberDecorate 512(B1) 5 Offset 160 + MemberDecorate 512(B1) 5 MatrixStride 32 + MemberDecorate 512(B1) 6 Offset 288 + MemberDecorate 512(B1) 7 Offset 352 + Decorate 512(B1) Block + Decorate 514 DescriptorSet 0 + Decorate 515(sf16) SpecId 100 + Decorate 517(sf) SpecId 101 + Decorate 518(sd) SpecId 102 + 2: TypeVoid + 3: TypeFunction 2 + 26: TypeFloat 64 + 27: TypeVector 26(float64_t) 2 + 28: TypePointer Function 27(f64vec2) + 30:26(float64_t) Constant 2696277389 1051772663 + 31: TypeInt 32 0 + 32: 31(int) Constant 0 + 33: TypePointer Function 26(float64_t) + 35:26(float64_t) Constant 0 3218079744 + 36:26(float64_t) Constant 3951369912 1067366481 + 37: 27(f64vec2) ConstantComposite 35 36 + 54:26(float64_t) Constant 0 1072693248 + 60: TypeMatrix 27(f64vec2) 2 + 61: TypePointer Function 60 + 88: 31(int) Constant 1 + 107: TypeBool + 108: TypePointer Function 107(bool) + 149: TypeVector 26(float64_t) 3 + 150: TypePointer Function 149(f64vec3) + 152: TypeVector 107(bool) 3 + 153: TypePointer Function 152(bvec3) + 156:26(float64_t) Constant 0 0 + 157:149(f64vec3) ConstantComposite 156 156 156 + 158:149(f64vec3) ConstantComposite 54 54 54 + 162: TypeFloat 16 + 163: TypeVector 162(float16_t) 3 + 164: TypePointer Function 163(f16vec3) + 170: TypeInt 8 1 + 171: TypeVector 170(int8_t) 3 + 172: TypePointer Function 171(i8vec3) + 176: TypeInt 16 1 + 177: TypeVector 176(int16_t) 3 + 178: TypePointer Function 177(i16vec3) + 182: TypeInt 32 1 + 183: TypeVector 182(int) 3 + 184: TypePointer Function 183(ivec3) + 188: TypeInt 64 1 + 189: TypeVector 188(int64_t) 3 + 190: TypePointer Function 189(i64vec3) + 194: TypeInt 8 0 + 195: TypeVector 194(int8_t) 3 + 196: TypePointer Function 195(i8vec3) + 200: TypeInt 16 0 + 201: TypeVector 200(int16_t) 3 + 202: TypePointer Function 201(i16vec3) + 206: TypeVector 31(int) 3 + 207: TypePointer Function 206(ivec3) + 211: TypeInt 64 0 + 212: TypeVector 211(int64_t) 3 + 213: TypePointer Function 212(i64vec3) + 217: TypeVector 26(float64_t) 4 + 218: TypePointer Function 217(f64vec4) + 367(ResType): TypeStruct 149(f64vec3) 183(ivec3) + 402: TypeMatrix 149(f64vec3) 2 + 403: TypePointer Function 402 + 421: TypeMatrix 27(f64vec2) 3 + 422: TypePointer Function 421 + 427: TypeMatrix 149(f64vec3) 3 + 428: TypePointer Function 427 + 432: TypeMatrix 217(f64vec4) 4 + 433: TypePointer Function 432 + 460: TypePointer Input 149(f64vec3) + 461(if64v): 460(ptr) Variable Input + 462: TypePointer Input 26(float64_t) + 499: 182(int) Constant 1 + 504:26(float64_t) Constant 0 1071644672 + 505: 27(f64vec2) ConstantComposite 504 504 + 507: 31(int) Constant 2 + 508: TypeArray 26(float64_t) 507 + 509: TypeArray 402 507 + 510(S): TypeStruct 26(float64_t) 27(f64vec2) 149(f64vec3) + 511: TypeArray 510(S) 507 + 512(B1): TypeStruct 26(float64_t) 27(f64vec2) 149(f64vec3) 508 402 509 510(S) 511 + 513: TypePointer Uniform 512(B1) + 514: 513(ptr) Variable Uniform + 515(sf16):162(float16_t) SpecConstant 12288 + 516: TypeFloat 32 + 517(sf): 516(float) SpecConstant 1048576000 + 518(sd):26(float64_t) SpecConstant 0 1071644672 + 519(f16_to_f): 516(float) SpecConstantOp 115 515(sf16) + 520: 516(float) SpecConstantOp 115 515(sf16) + 521(f16_to_d):26(float64_t) SpecConstantOp 115 520 + 522(f_to_f16):162(float16_t) SpecConstantOp 115 517(sf) + 523(d_to_f16):162(float16_t) SpecConstantOp 115 518(sd) + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd + 6(literal(): 2 Function None 3 + 7: Label + 29(f64v): 28(ptr) Variable Function + 34: 33(ptr) AccessChain 29(f64v) 32 + Store 34 30 + 38: 27(f64vec2) Load 29(f64v) + 39: 27(f64vec2) FAdd 38 37 + Store 29(f64v) 39 + Return + FunctionEnd + 8(operators(): 2 Function None 3 + 9: Label + 40(f64v): 28(ptr) Variable Function + 62(f64m): 61(ptr) Variable Function + 85(f64): 33(ptr) Variable Function + 109(b): 108(ptr) Variable Function + 41: 27(f64vec2) Load 40(f64v) + 42: 27(f64vec2) Load 40(f64v) + 43: 27(f64vec2) FAdd 42 41 + Store 40(f64v) 43 + 44: 27(f64vec2) Load 40(f64v) + 45: 27(f64vec2) Load 40(f64v) + 46: 27(f64vec2) FSub 45 44 + Store 40(f64v) 46 + 47: 27(f64vec2) Load 40(f64v) + 48: 27(f64vec2) Load 40(f64v) + 49: 27(f64vec2) FMul 48 47 + Store 40(f64v) 49 + 50: 27(f64vec2) Load 40(f64v) + 51: 27(f64vec2) Load 40(f64v) + 52: 27(f64vec2) FDiv 51 50 + Store 40(f64v) 52 + 53: 27(f64vec2) Load 40(f64v) + 55: 27(f64vec2) CompositeConstruct 54 54 + 56: 27(f64vec2) FAdd 53 55 + Store 40(f64v) 56 + 57: 27(f64vec2) Load 40(f64v) + 58: 27(f64vec2) CompositeConstruct 54 54 + 59: 27(f64vec2) FSub 57 58 + Store 40(f64v) 59 + 63: 60 Load 62(f64m) + 64: 27(f64vec2) CompositeConstruct 54 54 + 65: 27(f64vec2) CompositeExtract 63 0 + 66: 27(f64vec2) FAdd 65 64 + 67: 27(f64vec2) CompositeExtract 63 1 + 68: 27(f64vec2) FAdd 67 64 + 69: 60 CompositeConstruct 66 68 + Store 62(f64m) 69 + 70: 60 Load 62(f64m) + 71: 27(f64vec2) CompositeConstruct 54 54 + 72: 27(f64vec2) CompositeExtract 70 0 + 73: 27(f64vec2) FSub 72 71 + 74: 27(f64vec2) CompositeExtract 70 1 + 75: 27(f64vec2) FSub 74 71 + 76: 60 CompositeConstruct 73 75 + Store 62(f64m) 76 + 77: 27(f64vec2) Load 40(f64v) + 78: 27(f64vec2) FNegate 77 + Store 40(f64v) 78 + 79: 60 Load 62(f64m) + 80: 27(f64vec2) CompositeExtract 79 0 + 81: 27(f64vec2) FNegate 80 + 82: 27(f64vec2) CompositeExtract 79 1 + 83: 27(f64vec2) FNegate 82 + 84: 60 CompositeConstruct 81 83 + Store 62(f64m) 84 + 86: 33(ptr) AccessChain 40(f64v) 32 + 87:26(float64_t) Load 86 + 89: 33(ptr) AccessChain 40(f64v) 88 + 90:26(float64_t) Load 89 + 91:26(float64_t) FAdd 87 90 + Store 85(f64) 91 + 92: 33(ptr) AccessChain 40(f64v) 32 + 93:26(float64_t) Load 92 + 94: 33(ptr) AccessChain 40(f64v) 88 + 95:26(float64_t) Load 94 + 96:26(float64_t) FSub 93 95 + Store 85(f64) 96 + 97: 33(ptr) AccessChain 40(f64v) 32 + 98:26(float64_t) Load 97 + 99: 33(ptr) AccessChain 40(f64v) 88 + 100:26(float64_t) Load 99 + 101:26(float64_t) FMul 98 100 + Store 85(f64) 101 + 102: 33(ptr) AccessChain 40(f64v) 32 + 103:26(float64_t) Load 102 + 104: 33(ptr) AccessChain 40(f64v) 88 + 105:26(float64_t) Load 104 + 106:26(float64_t) FDiv 103 105 + Store 85(f64) 106 + 110: 33(ptr) AccessChain 40(f64v) 32 + 111:26(float64_t) Load 110 + 112:26(float64_t) Load 85(f64) + 113: 107(bool) FOrdNotEqual 111 112 + Store 109(b) 113 + 114: 33(ptr) AccessChain 40(f64v) 88 + 115:26(float64_t) Load 114 + 116:26(float64_t) Load 85(f64) + 117: 107(bool) FOrdEqual 115 116 + Store 109(b) 117 + 118: 33(ptr) AccessChain 40(f64v) 32 + 119:26(float64_t) Load 118 + 120:26(float64_t) Load 85(f64) + 121: 107(bool) FOrdGreaterThan 119 120 + Store 109(b) 121 + 122: 33(ptr) AccessChain 40(f64v) 88 + 123:26(float64_t) Load 122 + 124:26(float64_t) Load 85(f64) + 125: 107(bool) FOrdLessThan 123 124 + Store 109(b) 125 + 126: 33(ptr) AccessChain 40(f64v) 32 + 127:26(float64_t) Load 126 + 128:26(float64_t) Load 85(f64) + 129: 107(bool) FOrdGreaterThanEqual 127 128 + Store 109(b) 129 + 130: 33(ptr) AccessChain 40(f64v) 88 + 131:26(float64_t) Load 130 + 132:26(float64_t) Load 85(f64) + 133: 107(bool) FOrdLessThanEqual 131 132 + Store 109(b) 133 + 134: 27(f64vec2) Load 40(f64v) + 135:26(float64_t) Load 85(f64) + 136: 27(f64vec2) VectorTimesScalar 134 135 + Store 40(f64v) 136 + 137: 60 Load 62(f64m) + 138:26(float64_t) Load 85(f64) + 139: 60 MatrixTimesScalar 137 138 + Store 62(f64m) 139 + 140: 60 Load 62(f64m) + 141: 27(f64vec2) Load 40(f64v) + 142: 27(f64vec2) MatrixTimesVector 140 141 + Store 40(f64v) 142 + 143: 27(f64vec2) Load 40(f64v) + 144: 60 Load 62(f64m) + 145: 27(f64vec2) VectorTimesMatrix 143 144 + Store 40(f64v) 145 + 146: 60 Load 62(f64m) + 147: 60 Load 62(f64m) + 148: 60 MatrixTimesMatrix 146 147 + Store 62(f64m) 148 + Return + FunctionEnd + 10(typeCast(): 2 Function None 3 + 11: Label + 151(f64v): 150(ptr) Variable Function + 154(bv): 153(ptr) Variable Function + 165(f16v): 164(ptr) Variable Function + 173(i8v): 172(ptr) Variable Function + 179(i16v): 178(ptr) Variable Function + 185(i32v): 184(ptr) Variable Function + 191(i64v): 190(ptr) Variable Function + 197(u8v): 196(ptr) Variable Function + 203(u16v): 202(ptr) Variable Function + 208(u32v): 207(ptr) Variable Function + 214(u64v): 213(ptr) Variable Function + 155: 152(bvec3) Load 154(bv) + 159:149(f64vec3) Select 155 158 157 + Store 151(f64v) 159 + 160:149(f64vec3) Load 151(f64v) + 161: 152(bvec3) FOrdNotEqual 160 157 + Store 154(bv) 161 + 166:163(f16vec3) Load 165(f16v) + 167:149(f64vec3) FConvert 166 + Store 151(f64v) 167 + 168:149(f64vec3) Load 151(f64v) + 169:163(f16vec3) FConvert 168 + Store 165(f16v) 169 + 174:149(f64vec3) Load 151(f64v) + 175: 171(i8vec3) ConvertFToS 174 + Store 173(i8v) 175 + 180:149(f64vec3) Load 151(f64v) + 181:177(i16vec3) ConvertFToS 180 + Store 179(i16v) 181 + 186:149(f64vec3) Load 151(f64v) + 187: 183(ivec3) ConvertFToS 186 + Store 185(i32v) 187 + 192:149(f64vec3) Load 151(f64v) + 193:189(i64vec3) ConvertFToS 192 + Store 191(i64v) 193 + 198:149(f64vec3) Load 151(f64v) + 199: 195(i8vec3) ConvertFToU 198 + Store 197(u8v) 199 + 204:149(f64vec3) Load 151(f64v) + 205:201(i16vec3) ConvertFToU 204 + Store 203(u16v) 205 + 209:149(f64vec3) Load 151(f64v) + 210: 206(ivec3) ConvertFToU 209 + Store 208(u32v) 210 + 215:149(f64vec3) Load 151(f64v) + 216:212(i64vec3) ConvertFToU 215 + Store 214(u64v) 216 + Return + FunctionEnd +12(builtinAngleTrigFuncs(): 2 Function None 3 + 13: Label + 219(f64v2): 218(ptr) Variable Function + 220(f64v1): 218(ptr) Variable Function + 221:217(f64vec4) Load 220(f64v1) + 222:217(f64vec4) ExtInst 1(GLSL.std.450) 11(Radians) 221 + Store 219(f64v2) 222 + 223:217(f64vec4) Load 220(f64v1) + 224:217(f64vec4) ExtInst 1(GLSL.std.450) 12(Degrees) 223 + Store 219(f64v2) 224 + 225:217(f64vec4) Load 220(f64v1) + 226:217(f64vec4) ExtInst 1(GLSL.std.450) 13(Sin) 225 + Store 219(f64v2) 226 + 227:217(f64vec4) Load 220(f64v1) + 228:217(f64vec4) ExtInst 1(GLSL.std.450) 14(Cos) 227 + Store 219(f64v2) 228 + 229:217(f64vec4) Load 220(f64v1) + 230:217(f64vec4) ExtInst 1(GLSL.std.450) 15(Tan) 229 + Store 219(f64v2) 230 + 231:217(f64vec4) Load 220(f64v1) + 232:217(f64vec4) ExtInst 1(GLSL.std.450) 16(Asin) 231 + Store 219(f64v2) 232 + 233:217(f64vec4) Load 220(f64v1) + 234:217(f64vec4) ExtInst 1(GLSL.std.450) 17(Acos) 233 + Store 219(f64v2) 234 + 235:217(f64vec4) Load 220(f64v1) + 236:217(f64vec4) Load 219(f64v2) + 237:217(f64vec4) ExtInst 1(GLSL.std.450) 25(Atan2) 235 236 + Store 219(f64v2) 237 + 238:217(f64vec4) Load 220(f64v1) + 239:217(f64vec4) ExtInst 1(GLSL.std.450) 18(Atan) 238 + Store 219(f64v2) 239 + 240:217(f64vec4) Load 220(f64v1) + 241:217(f64vec4) ExtInst 1(GLSL.std.450) 19(Sinh) 240 + Store 219(f64v2) 241 + 242:217(f64vec4) Load 220(f64v1) + 243:217(f64vec4) ExtInst 1(GLSL.std.450) 20(Cosh) 242 + Store 219(f64v2) 243 + 244:217(f64vec4) Load 220(f64v1) + 245:217(f64vec4) ExtInst 1(GLSL.std.450) 21(Tanh) 244 + Store 219(f64v2) 245 + 246:217(f64vec4) Load 220(f64v1) + 247:217(f64vec4) ExtInst 1(GLSL.std.450) 22(Asinh) 246 + Store 219(f64v2) 247 + 248:217(f64vec4) Load 220(f64v1) + 249:217(f64vec4) ExtInst 1(GLSL.std.450) 23(Acosh) 248 + Store 219(f64v2) 249 + 250:217(f64vec4) Load 220(f64v1) + 251:217(f64vec4) ExtInst 1(GLSL.std.450) 24(Atanh) 250 + Store 219(f64v2) 251 + Return + FunctionEnd +14(builtinExpFuncs(): 2 Function None 3 + 15: Label + 252(f64v2): 28(ptr) Variable Function + 253(f64v1): 28(ptr) Variable Function + 254: 27(f64vec2) Load 253(f64v1) + 255: 27(f64vec2) Load 252(f64v2) + 256: 27(f64vec2) ExtInst 1(GLSL.std.450) 26(Pow) 254 255 + Store 252(f64v2) 256 + 257: 27(f64vec2) Load 253(f64v1) + 258: 27(f64vec2) ExtInst 1(GLSL.std.450) 27(Exp) 257 + Store 252(f64v2) 258 + 259: 27(f64vec2) Load 253(f64v1) + 260: 27(f64vec2) ExtInst 1(GLSL.std.450) 28(Log) 259 + Store 252(f64v2) 260 + 261: 27(f64vec2) Load 253(f64v1) + 262: 27(f64vec2) ExtInst 1(GLSL.std.450) 29(Exp2) 261 + Store 252(f64v2) 262 + 263: 27(f64vec2) Load 253(f64v1) + 264: 27(f64vec2) ExtInst 1(GLSL.std.450) 30(Log2) 263 + Store 252(f64v2) 264 + 265: 27(f64vec2) Load 253(f64v1) + 266: 27(f64vec2) ExtInst 1(GLSL.std.450) 31(Sqrt) 265 + Store 252(f64v2) 266 + 267: 27(f64vec2) Load 253(f64v1) + 268: 27(f64vec2) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 267 + Store 252(f64v2) 268 + Return + FunctionEnd +16(builtinCommonFuncs(): 2 Function None 3 + 17: Label + 269(f64v2): 150(ptr) Variable Function + 270(f64v1): 150(ptr) Variable Function + 291(f64): 33(ptr) Variable Function + 295(f64v3): 150(ptr) Variable Function + 335(bv): 153(ptr) Variable Function + 356(b): 108(ptr) Variable Function + 366(iv): 184(ptr) Variable Function + 271:149(f64vec3) Load 270(f64v1) + 272:149(f64vec3) ExtInst 1(GLSL.std.450) 4(FAbs) 271 + Store 269(f64v2) 272 + 273:149(f64vec3) Load 270(f64v1) + 274:149(f64vec3) ExtInst 1(GLSL.std.450) 6(FSign) 273 + Store 269(f64v2) 274 + 275:149(f64vec3) Load 270(f64v1) + 276:149(f64vec3) ExtInst 1(GLSL.std.450) 8(Floor) 275 + Store 269(f64v2) 276 + 277:149(f64vec3) Load 270(f64v1) + 278:149(f64vec3) ExtInst 1(GLSL.std.450) 3(Trunc) 277 + Store 269(f64v2) 278 + 279:149(f64vec3) Load 270(f64v1) + 280:149(f64vec3) ExtInst 1(GLSL.std.450) 1(Round) 279 + Store 269(f64v2) 280 + 281:149(f64vec3) Load 270(f64v1) + 282:149(f64vec3) ExtInst 1(GLSL.std.450) 2(RoundEven) 281 + Store 269(f64v2) 282 + 283:149(f64vec3) Load 270(f64v1) + 284:149(f64vec3) ExtInst 1(GLSL.std.450) 9(Ceil) 283 + Store 269(f64v2) 284 + 285:149(f64vec3) Load 270(f64v1) + 286:149(f64vec3) ExtInst 1(GLSL.std.450) 10(Fract) 285 + Store 269(f64v2) 286 + 287:149(f64vec3) Load 270(f64v1) + 288:149(f64vec3) Load 269(f64v2) + 289:149(f64vec3) FMod 287 288 + Store 269(f64v2) 289 + 290:149(f64vec3) Load 270(f64v1) + 292:26(float64_t) Load 291(f64) + 293:149(f64vec3) CompositeConstruct 292 292 292 + 294:149(f64vec3) FMod 290 293 + Store 269(f64v2) 294 + 296:149(f64vec3) Load 270(f64v1) + 297:149(f64vec3) ExtInst 1(GLSL.std.450) 35(Modf) 296 269(f64v2) + Store 295(f64v3) 297 + 298:149(f64vec3) Load 270(f64v1) + 299:149(f64vec3) Load 269(f64v2) + 300:149(f64vec3) ExtInst 1(GLSL.std.450) 37(FMin) 298 299 + Store 295(f64v3) 300 + 301:149(f64vec3) Load 270(f64v1) + 302:26(float64_t) Load 291(f64) + 303:149(f64vec3) CompositeConstruct 302 302 302 + 304:149(f64vec3) ExtInst 1(GLSL.std.450) 37(FMin) 301 303 + Store 295(f64v3) 304 + 305:149(f64vec3) Load 270(f64v1) + 306:149(f64vec3) Load 269(f64v2) + 307:149(f64vec3) ExtInst 1(GLSL.std.450) 40(FMax) 305 306 + Store 295(f64v3) 307 + 308:149(f64vec3) Load 270(f64v1) + 309:26(float64_t) Load 291(f64) + 310:149(f64vec3) CompositeConstruct 309 309 309 + 311:149(f64vec3) ExtInst 1(GLSL.std.450) 40(FMax) 308 310 + Store 295(f64v3) 311 + 312:149(f64vec3) Load 270(f64v1) + 313:26(float64_t) Load 291(f64) + 314: 33(ptr) AccessChain 269(f64v2) 32 + 315:26(float64_t) Load 314 + 316:149(f64vec3) CompositeConstruct 313 313 313 + 317:149(f64vec3) CompositeConstruct 315 315 315 + 318:149(f64vec3) ExtInst 1(GLSL.std.450) 43(FClamp) 312 316 317 + Store 295(f64v3) 318 + 319:149(f64vec3) Load 270(f64v1) + 320:149(f64vec3) Load 269(f64v2) + 321:26(float64_t) Load 291(f64) + 322:149(f64vec3) CompositeConstruct 321 321 321 + 323:149(f64vec3) ExtInst 1(GLSL.std.450) 43(FClamp) 319 320 322 + Store 295(f64v3) 323 + 324:149(f64vec3) Load 270(f64v1) + 325:149(f64vec3) Load 269(f64v2) + 326:26(float64_t) Load 291(f64) + 327:149(f64vec3) CompositeConstruct 326 326 326 + 328:149(f64vec3) ExtInst 1(GLSL.std.450) 46(FMix) 324 325 327 + Store 295(f64v3) 328 + 329:149(f64vec3) Load 270(f64v1) + 330:149(f64vec3) Load 269(f64v2) + 331:149(f64vec3) Load 295(f64v3) + 332:149(f64vec3) ExtInst 1(GLSL.std.450) 46(FMix) 329 330 331 + Store 295(f64v3) 332 + 333:149(f64vec3) Load 270(f64v1) + 334:149(f64vec3) Load 269(f64v2) + 336: 152(bvec3) Load 335(bv) + 337:149(f64vec3) Select 336 334 333 + Store 295(f64v3) 337 + 338:149(f64vec3) Load 270(f64v1) + 339:149(f64vec3) Load 269(f64v2) + 340:149(f64vec3) ExtInst 1(GLSL.std.450) 48(Step) 338 339 + Store 295(f64v3) 340 + 341:26(float64_t) Load 291(f64) + 342:149(f64vec3) Load 295(f64v3) + 343:149(f64vec3) CompositeConstruct 341 341 341 + 344:149(f64vec3) ExtInst 1(GLSL.std.450) 48(Step) 343 342 + Store 295(f64v3) 344 + 345:149(f64vec3) Load 270(f64v1) + 346:149(f64vec3) Load 269(f64v2) + 347:149(f64vec3) Load 295(f64v3) + 348:149(f64vec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 345 346 347 + Store 295(f64v3) 348 + 349:26(float64_t) Load 291(f64) + 350: 33(ptr) AccessChain 270(f64v1) 32 + 351:26(float64_t) Load 350 + 352:149(f64vec3) Load 269(f64v2) + 353:149(f64vec3) CompositeConstruct 349 349 349 + 354:149(f64vec3) CompositeConstruct 351 351 351 + 355:149(f64vec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 353 354 352 + Store 295(f64v3) 355 + 357:26(float64_t) Load 291(f64) + 358: 107(bool) IsNan 357 + Store 356(b) 358 + 359:149(f64vec3) Load 270(f64v1) + 360: 152(bvec3) IsInf 359 + Store 335(bv) 360 + 361:149(f64vec3) Load 270(f64v1) + 362:149(f64vec3) Load 269(f64v2) + 363:149(f64vec3) Load 295(f64v3) + 364:149(f64vec3) ExtInst 1(GLSL.std.450) 50(Fma) 361 362 363 + Store 295(f64v3) 364 + 365:149(f64vec3) Load 270(f64v1) + 368:367(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 365 + 369: 183(ivec3) CompositeExtract 368 1 + Store 366(iv) 369 + 370:149(f64vec3) CompositeExtract 368 0 + Store 269(f64v2) 370 + 371:149(f64vec3) Load 270(f64v1) + 372: 183(ivec3) Load 366(iv) + 373:149(f64vec3) ExtInst 1(GLSL.std.450) 53(Ldexp) 371 372 + Store 269(f64v2) 373 + Return + FunctionEnd +18(builtinGeometryFuncs(): 2 Function None 3 + 19: Label + 374(f64): 33(ptr) Variable Function + 375(f64v1): 150(ptr) Variable Function + 379(f64v2): 150(ptr) Variable Function + 385(f64v3): 150(ptr) Variable Function + 376:149(f64vec3) Load 375(f64v1) + 377:26(float64_t) ExtInst 1(GLSL.std.450) 66(Length) 376 + Store 374(f64) 377 + 378:149(f64vec3) Load 375(f64v1) + 380:149(f64vec3) Load 379(f64v2) + 381:26(float64_t) ExtInst 1(GLSL.std.450) 67(Distance) 378 380 + Store 374(f64) 381 + 382:149(f64vec3) Load 375(f64v1) + 383:149(f64vec3) Load 379(f64v2) + 384:26(float64_t) Dot 382 383 + Store 374(f64) 384 + 386:149(f64vec3) Load 375(f64v1) + 387:149(f64vec3) Load 379(f64v2) + 388:149(f64vec3) ExtInst 1(GLSL.std.450) 68(Cross) 386 387 + Store 385(f64v3) 388 + 389:149(f64vec3) Load 375(f64v1) + 390:149(f64vec3) ExtInst 1(GLSL.std.450) 69(Normalize) 389 + Store 379(f64v2) 390 + 391:149(f64vec3) Load 375(f64v1) + 392:149(f64vec3) Load 379(f64v2) + 393:149(f64vec3) Load 385(f64v3) + 394:149(f64vec3) ExtInst 1(GLSL.std.450) 70(FaceForward) 391 392 393 + Store 385(f64v3) 394 + 395:149(f64vec3) Load 375(f64v1) + 396:149(f64vec3) Load 379(f64v2) + 397:149(f64vec3) ExtInst 1(GLSL.std.450) 71(Reflect) 395 396 + Store 385(f64v3) 397 + 398:149(f64vec3) Load 375(f64v1) + 399:149(f64vec3) Load 379(f64v2) + 400:26(float64_t) Load 374(f64) + 401:149(f64vec3) ExtInst 1(GLSL.std.450) 72(Refract) 398 399 400 + Store 385(f64v3) 401 + Return + FunctionEnd +20(builtinMatrixFuncs(): 2 Function None 3 + 21: Label + 404(f64m3): 403(ptr) Variable Function + 405(f64m1): 403(ptr) Variable Function + 407(f64m2): 403(ptr) Variable Function + 416(f64v1): 150(ptr) Variable Function + 418(f64v2): 28(ptr) Variable Function + 423(f64m4): 422(ptr) Variable Function + 426(f64): 33(ptr) Variable Function + 429(f64m5): 428(ptr) Variable Function + 434(f64m6): 433(ptr) Variable Function + 435(f64m7): 433(ptr) Variable Function + 406: 402 Load 405(f64m1) + 408: 402 Load 407(f64m2) + 409:149(f64vec3) CompositeExtract 406 0 + 410:149(f64vec3) CompositeExtract 408 0 + 411:149(f64vec3) FMul 409 410 + 412:149(f64vec3) CompositeExtract 406 1 + 413:149(f64vec3) CompositeExtract 408 1 + 414:149(f64vec3) FMul 412 413 + 415: 402 CompositeConstruct 411 414 + Store 404(f64m3) 415 + 417:149(f64vec3) Load 416(f64v1) + 419: 27(f64vec2) Load 418(f64v2) + 420: 402 OuterProduct 417 419 + Store 405(f64m1) 420 + 424: 402 Load 405(f64m1) + 425: 421 Transpose 424 + Store 423(f64m4) 425 + 430: 427 Load 429(f64m5) + 431:26(float64_t) ExtInst 1(GLSL.std.450) 33(Determinant) 430 + Store 426(f64) 431 + 436: 432 Load 435(f64m7) + 437: 432 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 436 + Store 434(f64m6) 437 + Return + FunctionEnd +22(builtinVecRelFuncs(): 2 Function None 3 + 23: Label + 438(bv): 153(ptr) Variable Function + 439(f64v1): 150(ptr) Variable Function + 441(f64v2): 150(ptr) Variable Function + 440:149(f64vec3) Load 439(f64v1) + 442:149(f64vec3) Load 441(f64v2) + 443: 152(bvec3) FOrdLessThan 440 442 + Store 438(bv) 443 + 444:149(f64vec3) Load 439(f64v1) + 445:149(f64vec3) Load 441(f64v2) + 446: 152(bvec3) FOrdLessThanEqual 444 445 + Store 438(bv) 446 + 447:149(f64vec3) Load 439(f64v1) + 448:149(f64vec3) Load 441(f64v2) + 449: 152(bvec3) FOrdGreaterThan 447 448 + Store 438(bv) 449 + 450:149(f64vec3) Load 439(f64v1) + 451:149(f64vec3) Load 441(f64v2) + 452: 152(bvec3) FOrdGreaterThanEqual 450 451 + Store 438(bv) 452 + 453:149(f64vec3) Load 439(f64v1) + 454:149(f64vec3) Load 441(f64v2) + 455: 152(bvec3) FOrdEqual 453 454 + Store 438(bv) 455 + 456:149(f64vec3) Load 439(f64v1) + 457:149(f64vec3) Load 441(f64v2) + 458: 152(bvec3) FOrdNotEqual 456 457 + Store 438(bv) 458 + Return + FunctionEnd +24(builtinFragProcFuncs(): 2 Function None 3 + 25: Label + 459(f64v): 150(ptr) Variable Function + 463: 462(ptr) AccessChain 461(if64v) 32 + 464:26(float64_t) Load 463 + 465:26(float64_t) DPdx 464 + 466: 33(ptr) AccessChain 459(f64v) 32 + Store 466 465 + 467: 462(ptr) AccessChain 461(if64v) 88 + 468:26(float64_t) Load 467 + 469:26(float64_t) DPdy 468 + 470: 33(ptr) AccessChain 459(f64v) 88 + Store 470 469 + 471:149(f64vec3) Load 461(if64v) + 472: 27(f64vec2) VectorShuffle 471 471 0 1 + 473: 27(f64vec2) DPdxFine 472 + 474:149(f64vec3) Load 459(f64v) + 475:149(f64vec3) VectorShuffle 474 473 3 4 2 + Store 459(f64v) 475 + 476:149(f64vec3) Load 461(if64v) + 477: 27(f64vec2) VectorShuffle 476 476 0 1 + 478: 27(f64vec2) DPdyFine 477 + 479:149(f64vec3) Load 459(f64v) + 480:149(f64vec3) VectorShuffle 479 478 3 4 2 + Store 459(f64v) 480 + 481:149(f64vec3) Load 461(if64v) + 482:149(f64vec3) DPdxCoarse 481 + Store 459(f64v) 482 + 483:149(f64vec3) Load 461(if64v) + 484:149(f64vec3) DPdxCoarse 483 + Store 459(f64v) 484 + 485: 462(ptr) AccessChain 461(if64v) 32 + 486:26(float64_t) Load 485 + 487:26(float64_t) Fwidth 486 + 488: 33(ptr) AccessChain 459(f64v) 32 + Store 488 487 + 489:149(f64vec3) Load 461(if64v) + 490: 27(f64vec2) VectorShuffle 489 489 0 1 + 491: 27(f64vec2) FwidthFine 490 + 492:149(f64vec3) Load 459(f64v) + 493:149(f64vec3) VectorShuffle 492 491 3 4 2 + Store 459(f64v) 493 + 494:149(f64vec3) Load 461(if64v) + 495:149(f64vec3) FwidthCoarse 494 + Store 459(f64v) 495 + 496: 462(ptr) AccessChain 461(if64v) 32 + 497:26(float64_t) ExtInst 1(GLSL.std.450) 76(InterpolateAtCentroid) 496 + 498: 33(ptr) AccessChain 459(f64v) 32 + Store 498 497 + 500:149(f64vec3) ExtInst 1(GLSL.std.450) 77(InterpolateAtSample) 461(if64v) 499 + 501: 27(f64vec2) VectorShuffle 500 500 0 1 + 502:149(f64vec3) Load 459(f64v) + 503:149(f64vec3) VectorShuffle 502 501 3 4 2 + Store 459(f64v) 503 + 506:149(f64vec3) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 461(if64v) 505 + Store 459(f64v) 506 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.flowControl.frag.out b/deps/glslang/Test/baseResults/spv.flowControl.frag.out new file mode 100644 index 00000000..30c2a4b6 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.flowControl.frag.out @@ -0,0 +1,70 @@ +spv.flowControl.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 39 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 11 14 17 19 25 30 35 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 9 "color" + Name 11 "BaseColor" + Name 13 "color2" + Name 14 "otherColor" + Name 17 "c" + Name 19 "d" + Name 25 "bigColor" + Name 30 "smallColor" + Name 35 "gl_FragColor" + Decorate 35(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypePointer Input 7(fvec4) + 11(BaseColor): 10(ptr) Variable Input + 14(otherColor): 10(ptr) Variable Input + 16: TypePointer Input 6(float) + 17(c): 16(ptr) Variable Input + 19(d): 16(ptr) Variable Input + 21: TypeBool + 25(bigColor): 10(ptr) Variable Input + 30(smallColor): 10(ptr) Variable Input + 34: TypePointer Output 7(fvec4) +35(gl_FragColor): 34(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 9(color): 8(ptr) Variable Function + 13(color2): 8(ptr) Variable Function + 12: 7(fvec4) Load 11(BaseColor) + Store 9(color) 12 + 15: 7(fvec4) Load 14(otherColor) + Store 13(color2) 15 + 18: 6(float) Load 17(c) + 20: 6(float) Load 19(d) + 22: 21(bool) FOrdGreaterThan 18 20 + SelectionMerge 24 None + BranchConditional 22 23 29 + 23: Label + 26: 7(fvec4) Load 25(bigColor) + 27: 7(fvec4) Load 9(color) + 28: 7(fvec4) FAdd 27 26 + Store 9(color) 28 + Branch 24 + 29: Label + 31: 7(fvec4) Load 30(smallColor) + 32: 7(fvec4) Load 9(color) + 33: 7(fvec4) FAdd 32 31 + Store 9(color) 33 + Branch 24 + 24: Label + 36: 7(fvec4) Load 9(color) + 37: 7(fvec4) Load 13(color2) + 38: 7(fvec4) FMul 36 37 + Store 35(gl_FragColor) 38 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.for-complex-condition.vert.out b/deps/glslang/Test/baseResults/spv.for-complex-condition.vert.out new file mode 100644 index 00000000..41275a45 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.for-complex-condition.vert.out @@ -0,0 +1,58 @@ +spv.for-complex-condition.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 31 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 17 27 + Source GLSL 450 + Name 4 "main" + Name 8 "i" + Name 17 "flag" + Name 27 "r" + Decorate 17(flag) RelaxedPrecision + Decorate 17(flag) Location 0 + Decorate 18 RelaxedPrecision + Decorate 27(r) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 16: TypePointer Input 6(int) + 17(flag): 16(ptr) Variable Input + 19: 6(int) Constant 1 + 20: TypeBool + 22: 6(int) Constant 10 + 23: 6(int) Constant 15 + 26: TypePointer Output 6(int) + 27(r): 26(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + Store 8(i) 9 + Branch 10 + 10: Label + LoopMerge 12 13 None + Branch 14 + 14: Label + 15: 6(int) Load 8(i) + 18: 6(int) Load 17(flag) + 21: 20(bool) IEqual 18 19 + 24: 6(int) Select 21 22 23 + 25: 20(bool) SLessThan 15 24 + BranchConditional 25 11 12 + 11: Label + 28: 6(int) Load 8(i) + Store 27(r) 28 + Branch 13 + 13: Label + 29: 6(int) Load 8(i) + 30: 6(int) IAdd 29 19 + Store 8(i) 30 + Branch 10 + 12: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.for-continue-break.vert.out b/deps/glslang/Test/baseResults/spv.for-continue-break.vert.out new file mode 100644 index 00000000..ff94a931 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.for-continue-break.vert.out @@ -0,0 +1,81 @@ +spv.for-continue-break.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 45 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" + Source ESSL 310 + Name 4 "main" + Name 8 "i" + Name 19 "A" + Name 27 "B" + Name 29 "C" + Name 36 "D" + Name 38 "E" + Name 39 "F" + Name 43 "G" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 16: 6(int) Constant 10 + 17: TypeBool + 20: 6(int) Constant 1 + 22: 6(int) Constant 2 + 31: 6(int) Constant 3 + 40: 6(int) Constant 12 + 44: 6(int) Constant 99 + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + 19(A): 7(ptr) Variable Function + 27(B): 7(ptr) Variable Function + 29(C): 7(ptr) Variable Function + 36(D): 7(ptr) Variable Function + 38(E): 7(ptr) Variable Function + 39(F): 7(ptr) Variable Function + 43(G): 7(ptr) Variable Function + Store 8(i) 9 + Branch 10 + 10: Label + LoopMerge 12 13 None + Branch 14 + 14: Label + 15: 6(int) Load 8(i) + 18: 17(bool) SLessThan 15 16 + BranchConditional 18 11 12 + 11: Label + Store 19(A) 20 + 21: 6(int) Load 8(i) + 23: 6(int) SMod 21 22 + 24: 17(bool) IEqual 23 9 + SelectionMerge 26 None + BranchConditional 24 25 26 + 25: Label + Store 27(B) 20 + Branch 13 + 26: Label + 30: 6(int) Load 8(i) + 32: 6(int) SMod 30 31 + 33: 17(bool) IEqual 32 9 + SelectionMerge 35 None + BranchConditional 33 34 35 + 34: Label + Store 36(D) 20 + Branch 12 + 35: Label + Store 39(F) 40 + Branch 13 + 13: Label + 41: 6(int) Load 8(i) + 42: 6(int) IAdd 41 20 + Store 8(i) 42 + Branch 10 + 12: Label + Store 43(G) 44 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.for-nobody.vert.out b/deps/glslang/Test/baseResults/spv.for-nobody.vert.out new file mode 100644 index 00000000..2a3bcf40 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.for-nobody.vert.out @@ -0,0 +1,48 @@ +spv.for-nobody.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 25 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 23 + Source GLSL 450 + Name 4 "main" + Name 8 "i" + Name 23 "r" + Decorate 23(r) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 16: 6(int) Constant 10 + 17: TypeBool + 20: 6(int) Constant 1 + 22: TypePointer Output 6(int) + 23(r): 22(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + Store 8(i) 9 + Branch 10 + 10: Label + LoopMerge 12 13 None + Branch 14 + 14: Label + 15: 6(int) Load 8(i) + 18: 17(bool) SLessThan 15 16 + BranchConditional 18 11 12 + 11: Label + Branch 13 + 13: Label + 19: 6(int) Load 8(i) + 21: 6(int) IAdd 19 20 + Store 8(i) 21 + Branch 10 + 12: Label + 24: 6(int) Load 8(i) + Store 23(r) 24 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.for-notest.vert.out b/deps/glslang/Test/baseResults/spv.for-notest.vert.out new file mode 100644 index 00000000..36c4a96a --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.for-notest.vert.out @@ -0,0 +1,42 @@ +spv.for-notest.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 20 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 15 + Source GLSL 450 + Name 4 "main" + Name 8 "i" + Name 15 "r" + Decorate 15(r) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 14: TypePointer Output 6(int) + 15(r): 14(ptr) Variable Output + 18: 6(int) Constant 1 + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + Store 8(i) 9 + Branch 10 + 10: Label + LoopMerge 12 13 None + Branch 11 + 11: Label + 16: 6(int) Load 8(i) + Store 15(r) 16 + Branch 13 + 13: Label + 17: 6(int) Load 8(i) + 19: 6(int) IAdd 17 18 + Store 8(i) 19 + Branch 10 + 12: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.for-simple.vert.out b/deps/glslang/Test/baseResults/spv.for-simple.vert.out new file mode 100644 index 00000000..ecb539f9 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.for-simple.vert.out @@ -0,0 +1,46 @@ +spv.for-simple.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 24 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" + Source ESSL 310 + Name 4 "main" + Name 8 "i" + Name 19 "j" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 16: 6(int) Constant 10 + 17: TypeBool + 20: 6(int) Constant 12 + 22: 6(int) Constant 1 + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + 19(j): 7(ptr) Variable Function + Store 8(i) 9 + Branch 10 + 10: Label + LoopMerge 12 13 None + Branch 14 + 14: Label + 15: 6(int) Load 8(i) + 18: 17(bool) SLessThan 15 16 + BranchConditional 18 11 12 + 11: Label + Store 19(j) 20 + Branch 13 + 13: Label + 21: 6(int) Load 8(i) + 23: 6(int) IAdd 21 22 + Store 8(i) 23 + Branch 10 + 12: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.forLoop.frag.out b/deps/glslang/Test/baseResults/spv.forLoop.frag.out new file mode 100644 index 00000000..a07921ce --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.forLoop.frag.out @@ -0,0 +1,212 @@ +spv.forLoop.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 131 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 11 24 28 36 53 104 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 9 "color" + Name 11 "BaseColor" + Name 15 "i" + Name 24 "Count" + Name 28 "bigColor" + Name 36 "gl_FragColor" + Name 39 "sum" + Name 41 "i" + Name 53 "v4" + Name 63 "i" + Name 71 "tv4" + Name 88 "r" + Name 94 "i" + Name 104 "f" + Name 117 "i" + Decorate 24(Count) Flat + Decorate 36(gl_FragColor) Location 0 + Decorate 53(v4) Flat + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypePointer Input 7(fvec4) + 11(BaseColor): 10(ptr) Variable Input + 13: TypeInt 32 1 + 14: TypePointer Function 13(int) + 16: 13(int) Constant 0 + 23: TypePointer Input 13(int) + 24(Count): 23(ptr) Variable Input + 26: TypeBool + 28(bigColor): 10(ptr) Variable Input + 33: 13(int) Constant 1 + 35: TypePointer Output 7(fvec4) +36(gl_FragColor): 35(ptr) Variable Output + 38: TypePointer Function 6(float) + 40: 6(float) Constant 0 + 48: 13(int) Constant 4 + 50: TypeInt 32 0 + 51: TypeVector 50(int) 4 + 52: TypePointer Input 51(ivec4) + 53(v4): 52(ptr) Variable Input + 55: TypePointer Input 50(int) + 76: 50(int) Constant 4 + 89: TypeVector 6(float) 3 + 103: TypePointer Input 6(float) + 104(f): 103(ptr) Variable Input + 106: 50(int) Constant 3 + 124: 13(int) Constant 16 + 4(main): 2 Function None 3 + 5: Label + 9(color): 8(ptr) Variable Function + 15(i): 14(ptr) Variable Function + 39(sum): 38(ptr) Variable Function + 41(i): 14(ptr) Variable Function + 63(i): 14(ptr) Variable Function + 71(tv4): 8(ptr) Variable Function + 88(r): 8(ptr) Variable Function + 94(i): 14(ptr) Variable Function + 117(i): 14(ptr) Variable Function + 12: 7(fvec4) Load 11(BaseColor) + Store 9(color) 12 + Store 15(i) 16 + Branch 17 + 17: Label + LoopMerge 19 20 None + Branch 21 + 21: Label + 22: 13(int) Load 15(i) + 25: 13(int) Load 24(Count) + 27: 26(bool) SLessThan 22 25 + BranchConditional 27 18 19 + 18: Label + 29: 7(fvec4) Load 28(bigColor) + 30: 7(fvec4) Load 9(color) + 31: 7(fvec4) FAdd 30 29 + Store 9(color) 31 + Branch 20 + 20: Label + 32: 13(int) Load 15(i) + 34: 13(int) IAdd 32 33 + Store 15(i) 34 + Branch 17 + 19: Label + 37: 7(fvec4) Load 9(color) + Store 36(gl_FragColor) 37 + Store 39(sum) 40 + Store 41(i) 16 + Branch 42 + 42: Label + LoopMerge 44 45 None + Branch 46 + 46: Label + 47: 13(int) Load 41(i) + 49: 26(bool) SLessThan 47 48 + BranchConditional 49 43 44 + 43: Label + 54: 13(int) Load 41(i) + 56: 55(ptr) AccessChain 53(v4) 54 + 57: 50(int) Load 56 + 58: 6(float) ConvertUToF 57 + 59: 6(float) Load 39(sum) + 60: 6(float) FAdd 59 58 + Store 39(sum) 60 + Branch 45 + 45: Label + 61: 13(int) Load 41(i) + 62: 13(int) IAdd 61 33 + Store 41(i) 62 + Branch 42 + 44: Label + Store 63(i) 16 + Branch 64 + 64: Label + LoopMerge 66 67 None + Branch 68 + 68: Label + 69: 13(int) Load 63(i) + 70: 26(bool) SLessThan 69 48 + BranchConditional 70 65 66 + 65: Label + 72: 13(int) Load 63(i) + 73: 13(int) Load 63(i) + 74: 55(ptr) AccessChain 53(v4) 73 + 75: 50(int) Load 74 + 77: 50(int) IMul 75 76 + 78: 6(float) ConvertUToF 77 + 79: 38(ptr) AccessChain 71(tv4) 72 + Store 79 78 + Branch 67 + 67: Label + 80: 13(int) Load 63(i) + 81: 13(int) IAdd 80 33 + Store 63(i) 81 + Branch 64 + 66: Label + 82: 6(float) Load 39(sum) + 83: 7(fvec4) CompositeConstruct 82 82 82 82 + 84: 7(fvec4) Load 71(tv4) + 85: 7(fvec4) FAdd 83 84 + 86: 7(fvec4) Load 36(gl_FragColor) + 87: 7(fvec4) FAdd 86 85 + Store 36(gl_FragColor) 87 + 90: 7(fvec4) Load 11(BaseColor) + 91: 89(fvec3) VectorShuffle 90 90 0 1 2 + 92: 7(fvec4) Load 88(r) + 93: 7(fvec4) VectorShuffle 92 91 4 5 6 3 + Store 88(r) 93 + Store 94(i) 16 + Branch 95 + 95: Label + LoopMerge 97 98 None + Branch 99 + 99: Label + 100: 13(int) Load 94(i) + 101: 13(int) Load 24(Count) + 102: 26(bool) SLessThan 100 101 + BranchConditional 102 96 97 + 96: Label + 105: 6(float) Load 104(f) + 107: 38(ptr) AccessChain 88(r) 106 + Store 107 105 + Branch 98 + 98: Label + 108: 13(int) Load 94(i) + 109: 13(int) IAdd 108 33 + Store 94(i) 109 + Branch 95 + 97: Label + 110: 7(fvec4) Load 88(r) + 111: 89(fvec3) VectorShuffle 110 110 0 1 2 + 112: 7(fvec4) Load 36(gl_FragColor) + 113: 89(fvec3) VectorShuffle 112 112 0 1 2 + 114: 89(fvec3) FAdd 113 111 + 115: 7(fvec4) Load 36(gl_FragColor) + 116: 7(fvec4) VectorShuffle 115 114 4 5 6 3 + Store 36(gl_FragColor) 116 + Store 117(i) 16 + Branch 118 + 118: Label + LoopMerge 120 121 None + Branch 122 + 122: Label + 123: 13(int) Load 117(i) + 125: 26(bool) SLessThan 123 124 + BranchConditional 125 119 120 + 119: Label + 126: 6(float) Load 104(f) + 127: 7(fvec4) Load 36(gl_FragColor) + 128: 7(fvec4) VectorTimesScalar 127 126 + Store 36(gl_FragColor) 128 + Branch 121 + 121: Label + 129: 13(int) Load 117(i) + 130: 13(int) IAdd 129 48 + Store 117(i) 130 + Branch 118 + 120: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.forwardFun.frag.out b/deps/glslang/Test/baseResults/spv.forwardFun.frag.out new file mode 100644 index 00000000..32875b2c --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.forwardFun.frag.out @@ -0,0 +1,114 @@ +spv.forwardFun.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 60 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 20 30 36 59 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 6 "bar(" + Name 10 "unreachableReturn(" + Name 16 "foo(vf4;" + Name 15 "bar" + Name 18 "color" + Name 20 "BaseColor" + Name 21 "param" + Name 27 "f" + Name 30 "gl_FragColor" + Name 36 "d" + Name 59 "bigColor" + Decorate 10(unreachableReturn() RelaxedPrecision + Decorate 16(foo(vf4;) RelaxedPrecision + Decorate 15(bar) RelaxedPrecision + Decorate 18(color) RelaxedPrecision + Decorate 20(BaseColor) RelaxedPrecision + Decorate 22 RelaxedPrecision + Decorate 23 RelaxedPrecision + Decorate 24 RelaxedPrecision + Decorate 27(f) RelaxedPrecision + Decorate 28 RelaxedPrecision + Decorate 30(gl_FragColor) RelaxedPrecision + Decorate 30(gl_FragColor) Location 0 + Decorate 31 RelaxedPrecision + Decorate 32 RelaxedPrecision + Decorate 33 RelaxedPrecision + Decorate 36(d) RelaxedPrecision + Decorate 37 RelaxedPrecision + Decorate 52 RelaxedPrecision + Decorate 55 RelaxedPrecision + Decorate 56 RelaxedPrecision + Decorate 59(bigColor) RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 8: TypeFloat 32 + 9: TypeFunction 8(float) + 12: TypeVector 8(float) 4 + 13: TypePointer Function 12(fvec4) + 14: TypeFunction 8(float) 13(ptr) + 19: TypePointer Input 12(fvec4) + 20(BaseColor): 19(ptr) Variable Input + 26: TypePointer Function 8(float) + 29: TypePointer Output 12(fvec4) +30(gl_FragColor): 29(ptr) Variable Output + 35: TypePointer Input 8(float) + 36(d): 35(ptr) Variable Input + 38: 8(float) Constant 1082549862 + 39: TypeBool + 43: 8(float) Constant 1067030938 + 46: 8(float) Constant 1083179008 + 49: TypeInt 32 0 + 50: 49(int) Constant 0 + 53: 49(int) Constant 1 + 59(bigColor): 19(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 18(color): 13(ptr) Variable Function + 21(param): 13(ptr) Variable Function + 27(f): 26(ptr) Variable Function + 22: 12(fvec4) Load 20(BaseColor) + Store 21(param) 22 + 23: 8(float) FunctionCall 16(foo(vf4;) 21(param) + 24: 12(fvec4) CompositeConstruct 23 23 23 23 + Store 18(color) 24 + 25: 2 FunctionCall 6(bar() + 28: 8(float) FunctionCall 10(unreachableReturn() + Store 27(f) 28 + 31: 12(fvec4) Load 18(color) + 32: 8(float) Load 27(f) + 33: 12(fvec4) VectorTimesScalar 31 32 + Store 30(gl_FragColor) 33 + Return + FunctionEnd + 6(bar(): 2 Function None 3 + 7: Label + Return + FunctionEnd +10(unreachableReturn(): 8(float) Function None 9 + 11: Label + 34: 2 FunctionCall 6(bar() + 37: 8(float) Load 36(d) + 40: 39(bool) FOrdLessThan 37 38 + SelectionMerge 42 None + BranchConditional 40 41 45 + 41: Label + ReturnValue 43 + 45: Label + ReturnValue 46 + 42: Label + 48: 8(float) Undef + ReturnValue 48 + FunctionEnd + 16(foo(vf4;): 8(float) Function None 14 + 15(bar): 13(ptr) FunctionParameter + 17: Label + 51: 26(ptr) AccessChain 15(bar) 50 + 52: 8(float) Load 51 + 54: 26(ptr) AccessChain 15(bar) 53 + 55: 8(float) Load 54 + 56: 8(float) FAdd 52 55 + ReturnValue 56 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.fragmentShaderBarycentric.frag.out b/deps/glslang/Test/baseResults/spv.fragmentShaderBarycentric.frag.out new file mode 100644 index 00000000..ffb3527c --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.fragmentShaderBarycentric.frag.out @@ -0,0 +1,69 @@ +spv.fragmentShaderBarycentric.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 43 + + Capability Shader + Capability FragmentBarycentricNV + Extension "SPV_NV_fragment_shader_barycentric" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 8 11 21 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_NV_fragment_shader_barycentric" + Name 4 "main" + Name 8 "value" + Name 11 "gl_BaryCoordNV" + Name 17 "vertices" + MemberName 17(vertices) 0 "attrib" + Name 21 "v" + Decorate 8(value) Location 1 + Decorate 11(gl_BaryCoordNV) BuiltIn BaryCoordNV + Decorate 17(vertices) Block + Decorate 21(v) Location 0 + Decorate 21(v) PerVertexNV + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Output 6(float) + 8(value): 7(ptr) Variable Output + 9: TypeVector 6(float) 3 + 10: TypePointer Input 9(fvec3) +11(gl_BaryCoordNV): 10(ptr) Variable Input + 12: TypeInt 32 0 + 13: 12(int) Constant 0 + 14: TypePointer Input 6(float) + 17(vertices): TypeStruct 6(float) + 18: 12(int) Constant 3 + 19: TypeArray 17(vertices) 18 + 20: TypePointer Input 19 + 21(v): 20(ptr) Variable Input + 22: TypeInt 32 1 + 23: 22(int) Constant 0 + 27: 12(int) Constant 1 + 30: 22(int) Constant 1 + 35: 12(int) Constant 2 + 38: 22(int) Constant 2 + 4(main): 2 Function None 3 + 5: Label + 15: 14(ptr) AccessChain 11(gl_BaryCoordNV) 13 + 16: 6(float) Load 15 + 24: 14(ptr) AccessChain 21(v) 23 23 + 25: 6(float) Load 24 + 26: 6(float) FMul 16 25 + 28: 14(ptr) AccessChain 11(gl_BaryCoordNV) 27 + 29: 6(float) Load 28 + 31: 14(ptr) AccessChain 21(v) 30 23 + 32: 6(float) Load 31 + 33: 6(float) FMul 29 32 + 34: 6(float) FAdd 26 33 + 36: 14(ptr) AccessChain 11(gl_BaryCoordNV) 35 + 37: 6(float) Load 36 + 39: 14(ptr) AccessChain 21(v) 38 23 + 40: 6(float) Load 39 + 41: 6(float) FMul 37 40 + 42: 6(float) FAdd 34 41 + Store 8(value) 42 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.fragmentShaderBarycentric2.frag.out b/deps/glslang/Test/baseResults/spv.fragmentShaderBarycentric2.frag.out new file mode 100644 index 00000000..05dce7a7 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.fragmentShaderBarycentric2.frag.out @@ -0,0 +1,65 @@ +spv.fragmentShaderBarycentric2.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 42 + + Capability Shader + Capability FragmentBarycentricNV + Extension "SPV_NV_fragment_shader_barycentric" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 8 11 20 + ExecutionMode 4 OriginUpperLeft + Source ESSL 320 + SourceExtension "GL_NV_fragment_shader_barycentric" + Name 4 "main" + Name 8 "value" + Name 11 "gl_BaryCoordNoPerspNV" + Name 20 "vertexIDs" + Decorate 8(value) Location 1 + Decorate 11(gl_BaryCoordNoPerspNV) BuiltIn BaryCoordNoPerspNV + Decorate 20(vertexIDs) Location 0 + Decorate 20(vertexIDs) PerVertexNV + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Output 6(float) + 8(value): 7(ptr) Variable Output + 9: TypeVector 6(float) 3 + 10: TypePointer Input 9(fvec3) +11(gl_BaryCoordNoPerspNV): 10(ptr) Variable Input + 12: TypeInt 32 0 + 13: 12(int) Constant 0 + 14: TypePointer Input 6(float) + 17: 12(int) Constant 3 + 18: TypeArray 6(float) 17 + 19: TypePointer Input 18 + 20(vertexIDs): 19(ptr) Variable Input + 21: TypeInt 32 1 + 22: 21(int) Constant 0 + 26: 12(int) Constant 1 + 29: 21(int) Constant 1 + 34: 12(int) Constant 2 + 37: 21(int) Constant 2 + 4(main): 2 Function None 3 + 5: Label + 15: 14(ptr) AccessChain 11(gl_BaryCoordNoPerspNV) 13 + 16: 6(float) Load 15 + 23: 14(ptr) AccessChain 20(vertexIDs) 22 + 24: 6(float) Load 23 + 25: 6(float) FMul 16 24 + 27: 14(ptr) AccessChain 11(gl_BaryCoordNoPerspNV) 26 + 28: 6(float) Load 27 + 30: 14(ptr) AccessChain 20(vertexIDs) 29 + 31: 6(float) Load 30 + 32: 6(float) FMul 28 31 + 33: 6(float) FAdd 25 32 + 35: 14(ptr) AccessChain 11(gl_BaryCoordNoPerspNV) 34 + 36: 6(float) Load 35 + 38: 14(ptr) AccessChain 20(vertexIDs) 37 + 39: 6(float) Load 38 + 40: 6(float) FMul 36 39 + 41: 6(float) FAdd 33 40 + Store 8(value) 41 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.fullyCovered.frag.out b/deps/glslang/Test/baseResults/spv.fullyCovered.frag.out new file mode 100644 index 00000000..76c8e44d --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.fullyCovered.frag.out @@ -0,0 +1,37 @@ +spv.fullyCovered.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 18 + + Capability Shader + Capability FragmentFullyCoveredEXT + Extension "SPV_EXT_fragment_fully_covered" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 12 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_NV_conservative_raster_underestimation" + Name 4 "main" + Name 9 "color" + Name 12 "gl_FragFullyCoveredNV" + Decorate 12(gl_FragFullyCoveredNV) BuiltIn FullyCoveredEXT + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(color): 8(ptr) Variable Output + 10: TypeBool + 11: TypePointer Input 10(bool) +12(gl_FragFullyCoveredNV): 11(ptr) Variable Input + 14: 6(float) Constant 0 + 15: 6(float) Constant 1065353216 + 4(main): 2 Function None 3 + 5: Label + 13: 10(bool) Load 12(gl_FragFullyCoveredNV) + 16: 6(float) Select 13 15 14 + 17: 7(fvec4) CompositeConstruct 16 14 14 14 + Store 9(color) 17 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.functionCall.frag.out b/deps/glslang/Test/baseResults/spv.functionCall.frag.out new file mode 100644 index 00000000..269b74e6 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.functionCall.frag.out @@ -0,0 +1,124 @@ +spv.functionCall.frag +WARNING: 0:3: varying deprecated in version 130; may be removed in future release +WARNING: 0:4: varying deprecated in version 130; may be removed in future release +WARNING: 0:5: varying deprecated in version 130; may be removed in future release + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 76 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 35 58 69 75 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 11 "foo(vf4;" + Name 10 "bar" + Name 13 "bar(" + Name 16 "unreachableReturn(" + Name 18 "missingReturn(" + Name 21 "h" + Name 35 "d" + Name 56 "color" + Name 58 "BaseColor" + Name 59 "param" + Name 64 "f" + Name 66 "g" + Name 69 "gl_FragColor" + Name 75 "bigColor" + Decorate 69(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 6(float) 8(ptr) + 15: TypeFunction 6(float) + 20: TypePointer Private 6(float) + 21(h): 20(ptr) Variable Private + 22: 6(float) Constant 0 + 23: TypeInt 32 0 + 24: 23(int) Constant 0 + 25: TypePointer Function 6(float) + 28: 23(int) Constant 1 + 34: TypePointer Input 6(float) + 35(d): 34(ptr) Variable Input + 37: 6(float) Constant 1082549862 + 38: TypeBool + 42: 6(float) Constant 1067030938 + 45: 6(float) Constant 1083179008 + 53: 6(float) Constant 1081711002 + 57: TypePointer Input 7(fvec4) + 58(BaseColor): 57(ptr) Variable Input + 68: TypePointer Output 7(fvec4) +69(gl_FragColor): 68(ptr) Variable Output + 75(bigColor): 57(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 56(color): 8(ptr) Variable Function + 59(param): 8(ptr) Variable Function + 64(f): 25(ptr) Variable Function + 66(g): 25(ptr) Variable Function + Store 21(h) 22 + 60: 7(fvec4) Load 58(BaseColor) + Store 59(param) 60 + 61: 6(float) FunctionCall 11(foo(vf4;) 59(param) + 62: 7(fvec4) CompositeConstruct 61 61 61 61 + Store 56(color) 62 + 63: 2 FunctionCall 13(bar() + 65: 6(float) FunctionCall 16(unreachableReturn() + Store 64(f) 65 + 67: 6(float) FunctionCall 18(missingReturn() + Store 66(g) 67 + 70: 7(fvec4) Load 56(color) + 71: 6(float) Load 64(f) + 72: 7(fvec4) VectorTimesScalar 70 71 + 73: 6(float) Load 21(h) + 74: 7(fvec4) VectorTimesScalar 72 73 + Store 69(gl_FragColor) 74 + Return + FunctionEnd + 11(foo(vf4;): 6(float) Function None 9 + 10(bar): 8(ptr) FunctionParameter + 12: Label + 26: 25(ptr) AccessChain 10(bar) 24 + 27: 6(float) Load 26 + 29: 25(ptr) AccessChain 10(bar) 28 + 30: 6(float) Load 29 + 31: 6(float) FAdd 27 30 + ReturnValue 31 + FunctionEnd + 13(bar(): 2 Function None 3 + 14: Label + Return + FunctionEnd +16(unreachableReturn(): 6(float) Function None 15 + 17: Label + 36: 6(float) Load 35(d) + 39: 38(bool) FOrdLessThan 36 37 + SelectionMerge 41 None + BranchConditional 39 40 44 + 40: Label + ReturnValue 42 + 44: Label + ReturnValue 45 + 41: Label + 47: 6(float) Undef + ReturnValue 47 + FunctionEnd +18(missingReturn(): 6(float) Function None 15 + 19: Label + 48: 6(float) Load 35(d) + 49: 38(bool) FOrdLessThan 48 45 + SelectionMerge 51 None + BranchConditional 49 50 51 + 50: Label + 52: 6(float) Load 35(d) + Store 21(h) 52 + ReturnValue 53 + 51: Label + 55: 6(float) Undef + ReturnValue 55 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.functionNestedOpaque.vert.out b/deps/glslang/Test/baseResults/spv.functionNestedOpaque.vert.out new file mode 100644 index 00000000..31938f80 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.functionNestedOpaque.vert.out @@ -0,0 +1,70 @@ +spv.functionNestedOpaque.vert +error: SPIRV-Tools Validation Errors +error: From Vulkan spec, section 14.5.2: +Variables identified with the UniformConstant storage class are used only as handles to refer to opaque resources. Such variables must be typed as OpTypeImage, OpTypeSampler, OpTypeSampledImage, OpTypeAccelerationStructureNV, or an array of one of these types. + %si = OpVariable %_ptr_UniformConstant_S UniformConstant + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 39 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" + Source GLSL 450 + Name 4 "main" + Name 12 "foo(s21;" + Name 11 "t" + Name 14 "S" + MemberName 14(S) 0 "s" + Name 18 "barc(struct-S-s211;" + Name 17 "p" + Name 21 "bar(struct-S-s211;" + Name 20 "p" + Name 36 "si" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeImage 6(float) 2D sampled format:Unknown + 8: TypeSampledImage 7 + 9: TypePointer UniformConstant 8 + 10: TypeFunction 2 9(ptr) + 14(S): TypeStruct 8 + 15: TypePointer UniformConstant 14(S) + 16: TypeFunction 2 15(ptr) + 24: TypeVector 6(float) 2 + 25: 6(float) Constant 1056964608 + 26: 24(fvec2) ConstantComposite 25 25 + 27: TypeVector 6(float) 4 + 28: 6(float) Constant 0 + 30: TypeInt 32 1 + 31: 30(int) Constant 0 + 36(si): 15(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 37: 2 FunctionCall 18(barc(struct-S-s211;) 36(si) + 38: 2 FunctionCall 21(bar(struct-S-s211;) 36(si) + Return + FunctionEnd + 12(foo(s21;): 2 Function None 10 + 11(t): 9(ptr) FunctionParameter + 13: Label + 23: 8 Load 11(t) + 29: 27(fvec4) ImageSampleExplicitLod 23 26 Lod 28 + Return + FunctionEnd +18(barc(struct-S-s211;): 2 Function None 16 + 17(p): 15(ptr) FunctionParameter + 19: Label + 32: 9(ptr) AccessChain 17(p) 31 + 33: 2 FunctionCall 12(foo(s21;) 32 + Return + FunctionEnd +21(bar(struct-S-s211;): 2 Function None 16 + 20(p): 15(ptr) FunctionParameter + 22: Label + 34: 9(ptr) AccessChain 20(p) 31 + 35: 2 FunctionCall 12(foo(s21;) 34 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.functionSemantics.frag.out b/deps/glslang/Test/baseResults/spv.functionSemantics.frag.out new file mode 100644 index 00000000..49bdf7cd --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.functionSemantics.frag.out @@ -0,0 +1,227 @@ +spv.functionSemantics.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 156 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 76 152 + ExecutionMode 4 OriginUpperLeft + Source GLSL 400 + Name 4 "main" + Name 15 "foo(i1;i1;i1;i1;i1;i1;" + Name 9 "a" + Name 10 "b" + Name 11 "c" + Name 12 "d" + Name 13 "e" + Name 14 "f" + Name 25 "foo2(f1;vf3;i1;" + Name 22 "a" + Name 23 "b" + Name 24 "r" + Name 28 "foo3(" + Name 30 "sum" + Name 76 "u" + Name 89 "t" + Name 92 "s" + MemberName 92(s) 0 "t" + Name 94 "f" + Name 98 "color" + Name 104 "e" + Name 105 "param" + Name 106 "param" + Name 107 "param" + Name 108 "param" + Name 123 "ret" + Name 125 "tempReturn" + Name 130 "tempArg" + Name 131 "param" + Name 132 "param" + Name 133 "param" + Name 136 "arg" + Name 152 "gl_FragColor" + Decorate 152(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 8: TypeFunction 6(int) 7(ptr) 6(int) 7(ptr) 6(int) 7(ptr) 7(ptr) + 17: TypeFloat 32 + 18: TypePointer Function 17(float) + 19: TypeVector 17(float) 3 + 20: TypePointer Function 19(fvec3) + 21: TypeFunction 6(int) 18(ptr) 20(ptr) 7(ptr) + 27: TypeFunction 6(int) + 38: 6(int) Constant 64 + 43: 6(int) Constant 1024 + 62: 17(float) Constant 1077936128 + 66: 17(float) Constant 1084227584 + 67: TypeInt 32 0 + 68: 67(int) Constant 1 + 75: TypePointer Input 17(float) + 76(u): 75(ptr) Variable Input + 78: 17(float) Constant 1078774989 + 79: TypeBool + 84: 6(int) Constant 1000000 + 86: 6(int) Constant 2000000 + 90: 6(int) Constant 2 + 91: TypeVector 6(int) 4 + 92(s): TypeStruct 91(ivec4) + 93: TypePointer Function 92(s) + 95: 6(int) Constant 0 + 96: 6(int) Constant 32 + 99: 6(int) Constant 1 + 103: 6(int) Constant 8 + 115: 6(int) Constant 128 + 124: TypePointer Private 6(int) + 125(tempReturn): 124(ptr) Variable Private + 126: 17(float) Constant 1082130432 + 127: 17(float) Constant 1065353216 + 128: 17(float) Constant 1073741824 + 129: 19(fvec3) ConstantComposite 127 128 62 + 150: TypeVector 17(float) 4 + 151: TypePointer Output 150(fvec4) +152(gl_FragColor): 151(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 89(t): 7(ptr) Variable Function + 94(f): 93(ptr) Variable Function + 98(color): 7(ptr) Variable Function + 104(e): 7(ptr) Variable Function + 105(param): 7(ptr) Variable Function + 106(param): 7(ptr) Variable Function + 107(param): 7(ptr) Variable Function + 108(param): 7(ptr) Variable Function + 123(ret): 18(ptr) Variable Function + 130(tempArg): 7(ptr) Variable Function + 131(param): 18(ptr) Variable Function + 132(param): 20(ptr) Variable Function + 133(param): 7(ptr) Variable Function + 136(arg): 18(ptr) Variable Function + Store 89(t) 90 + 97: 7(ptr) AccessChain 94(f) 95 68 + Store 97 96 + 100: 6(int) Load 89(t) + 101: 6(int) Load 89(t) + 102: 6(int) IAdd 100 101 + Store 105(param) 99 + Store 106(param) 102 + 109: 7(ptr) AccessChain 94(f) 95 68 + 110: 6(int) Load 109 + Store 108(param) 110 + 111: 6(int) FunctionCall 15(foo(i1;i1;i1;i1;i1;i1;) 105(param) 90 106(param) 103 107(param) 108(param) + 112: 6(int) Load 107(param) + Store 104(e) 112 + 113: 6(int) Load 108(param) + 114: 7(ptr) AccessChain 94(f) 95 68 + Store 114 113 + Store 98(color) 111 + 116: 6(int) Load 104(e) + 117: 7(ptr) AccessChain 94(f) 95 68 + 118: 6(int) Load 117 + 119: 6(int) IAdd 116 118 + 120: 6(int) IMul 115 119 + 121: 6(int) Load 98(color) + 122: 6(int) IAdd 121 120 + Store 98(color) 122 + Store 131(param) 126 + Store 132(param) 129 + 134: 6(int) FunctionCall 25(foo2(f1;vf3;i1;) 131(param) 132(param) 133(param) + 135: 6(int) Load 133(param) + Store 130(tempArg) 135 + Store 125(tempReturn) 134 + 137: 6(int) Load 130(tempArg) + 138: 17(float) ConvertSToF 137 + Store 136(arg) 138 + 139: 6(int) Load 125(tempReturn) + 140: 17(float) ConvertSToF 139 + Store 123(ret) 140 + 141: 17(float) Load 123(ret) + 142: 17(float) Load 136(arg) + 143: 17(float) FAdd 141 142 + 144: 6(int) ConvertFToS 143 + 145: 6(int) Load 98(color) + 146: 6(int) IAdd 145 144 + Store 98(color) 146 + 147: 6(int) FunctionCall 28(foo3() + 148: 6(int) Load 98(color) + 149: 6(int) IAdd 148 147 + Store 98(color) 149 + 153: 6(int) Load 98(color) + 154: 17(float) ConvertSToF 153 + 155: 150(fvec4) CompositeConstruct 154 154 154 154 + Store 152(gl_FragColor) 155 + Return + FunctionEnd +15(foo(i1;i1;i1;i1;i1;i1;): 6(int) Function None 8 + 9(a): 7(ptr) FunctionParameter + 10(b): 6(int) FunctionParameter + 11(c): 7(ptr) FunctionParameter + 12(d): 6(int) FunctionParameter + 13(e): 7(ptr) FunctionParameter + 14(f): 7(ptr) FunctionParameter + 16: Label + 30(sum): 7(ptr) Variable Function + 31: 6(int) Load 9(a) + 32: 6(int) IAdd 31 10(b) + 33: 6(int) Load 11(c) + 34: 6(int) IAdd 32 33 + 35: 6(int) IAdd 34 12(d) + 36: 6(int) Load 14(f) + 37: 6(int) IAdd 35 36 + Store 30(sum) 37 + 39: 6(int) Load 9(a) + 40: 6(int) IMul 39 38 + Store 9(a) 40 + 41: 6(int) Load 11(c) + 42: 6(int) IMul 41 38 + Store 11(c) 42 + Store 13(e) 43 + 44: 6(int) Load 14(f) + 45: 6(int) IMul 44 38 + Store 14(f) 45 + 46: 6(int) Load 9(a) + 47: 6(int) IMul 38 10(b) + 48: 6(int) IAdd 46 47 + 49: 6(int) Load 11(c) + 50: 6(int) IAdd 48 49 + 51: 6(int) IMul 38 12(d) + 52: 6(int) IAdd 50 51 + 53: 6(int) Load 13(e) + 54: 6(int) IAdd 52 53 + 55: 6(int) Load 14(f) + 56: 6(int) IAdd 54 55 + 57: 6(int) Load 30(sum) + 58: 6(int) IAdd 57 56 + Store 30(sum) 58 + 59: 6(int) Load 30(sum) + ReturnValue 59 + FunctionEnd +25(foo2(f1;vf3;i1;): 6(int) Function None 21 + 22(a): 18(ptr) FunctionParameter + 23(b): 20(ptr) FunctionParameter + 24(r): 7(ptr) FunctionParameter + 26: Label + 63: 17(float) Load 22(a) + 64: 17(float) FMul 62 63 + 65: 6(int) ConvertFToS 64 + Store 24(r) 65 + 69: 18(ptr) AccessChain 23(b) 68 + 70: 17(float) Load 69 + 71: 17(float) FMul 66 70 + 72: 6(int) ConvertFToS 71 + ReturnValue 72 + FunctionEnd + 28(foo3(): 6(int) Function None 27 + 29: Label + 77: 17(float) Load 76(u) + 80: 79(bool) FOrdGreaterThan 77 78 + SelectionMerge 82 None + BranchConditional 80 81 82 + 81: Label + Kill + 82: Label + ReturnValue 86 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.glFragColor.frag.out b/deps/glslang/Test/baseResults/spv.glFragColor.frag.out new file mode 100644 index 00000000..55fb24f1 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.glFragColor.frag.out @@ -0,0 +1,27 @@ +spv.glFragColor.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 12 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 + ExecutionMode 4 OriginLowerLeft + Source GLSL 330 + Name 4 "main" + Name 9 "gl_FragColor" + Decorate 9(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(gl_FragColor): 8(ptr) Variable Output + 10: 6(float) Constant 1065353216 + 11: 7(fvec4) ConstantComposite 10 10 10 10 + 4(main): 2 Function None 3 + 5: Label + Store 9(gl_FragColor) 11 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.glsl.register.autoassign.frag.out b/deps/glslang/Test/baseResults/spv.glsl.register.autoassign.frag.out new file mode 100644 index 00000000..079e8d52 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.glsl.register.autoassign.frag.out @@ -0,0 +1,223 @@ +spv.glsl.register.autoassign.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 142 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 137 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "Func1(" + Name 11 "Func2(" + Name 13 "Func2_unused(" + Name 17 "g_tTex1" + Name 21 "g_sSamp1" + Name 27 "g_tTex2" + Name 29 "g_sSamp2" + Name 39 "g_tTex3" + Name 46 "g_sSamp3" + Name 64 "g_tTex4" + Name 69 "g_sSamp4" + Name 84 "g_tTex5" + Name 86 "g_sSamp5" + Name 93 "MyStruct_t" + MemberName 93(MyStruct_t) 0 "a" + MemberName 93(MyStruct_t) 1 "b" + MemberName 93(MyStruct_t) 2 "c" + Name 95 "myblock" + MemberName 95(myblock) 0 "mystruct" + MemberName 95(myblock) 1 "myvec4_a" + MemberName 95(myblock) 2 "myvec4_b" + MemberName 95(myblock) 3 "myint4_a" + Name 97 "" + Name 119 "g_tTex_unused1" + Name 121 "g_sSamp_unused1" + Name 126 "g_tTex_unused2" + Name 128 "g_sSamp_unused2" + Name 137 "FragColor" + Name 141 "g_tTex_unused3" + Decorate 17(g_tTex1) DescriptorSet 0 + Decorate 17(g_tTex1) Binding 11 + Decorate 21(g_sSamp1) DescriptorSet 0 + Decorate 21(g_sSamp1) Binding 5 + Decorate 27(g_tTex2) DescriptorSet 0 + Decorate 27(g_tTex2) Binding 14 + Decorate 29(g_sSamp2) DescriptorSet 0 + Decorate 29(g_sSamp2) Binding 6 + Decorate 39(g_tTex3) DescriptorSet 0 + Decorate 39(g_tTex3) Binding 13 + Decorate 46(g_sSamp3) DescriptorSet 0 + Decorate 46(g_sSamp3) Binding 7 + Decorate 64(g_tTex4) DescriptorSet 0 + Decorate 64(g_tTex4) Binding 15 + Decorate 69(g_sSamp4) DescriptorSet 0 + Decorate 69(g_sSamp4) Binding 8 + Decorate 84(g_tTex5) DescriptorSet 0 + Decorate 84(g_tTex5) Binding 16 + Decorate 86(g_sSamp5) DescriptorSet 0 + Decorate 86(g_sSamp5) Binding 9 + MemberDecorate 93(MyStruct_t) 0 Offset 0 + MemberDecorate 93(MyStruct_t) 1 Offset 4 + MemberDecorate 93(MyStruct_t) 2 Offset 16 + MemberDecorate 95(myblock) 0 Offset 0 + MemberDecorate 95(myblock) 1 Offset 32 + MemberDecorate 95(myblock) 2 Offset 48 + MemberDecorate 95(myblock) 3 Offset 64 + Decorate 95(myblock) Block + Decorate 97 DescriptorSet 0 + Decorate 97 Binding 24 + Decorate 119(g_tTex_unused1) DescriptorSet 0 + Decorate 119(g_tTex_unused1) Binding 10 + Decorate 121(g_sSamp_unused1) DescriptorSet 0 + Decorate 126(g_tTex_unused2) DescriptorSet 0 + Decorate 126(g_tTex_unused2) Binding 12 + Decorate 128(g_sSamp_unused2) DescriptorSet 0 + Decorate 137(FragColor) Location 0 + Decorate 141(g_tTex_unused3) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 15: TypeImage 6(float) 1D sampled format:Unknown + 16: TypePointer UniformConstant 15 + 17(g_tTex1): 16(ptr) Variable UniformConstant + 19: TypeSampler + 20: TypePointer UniformConstant 19 + 21(g_sSamp1): 20(ptr) Variable UniformConstant + 23: TypeSampledImage 15 + 25: 6(float) Constant 1036831949 + 27(g_tTex2): 16(ptr) Variable UniformConstant + 29(g_sSamp2): 20(ptr) Variable UniformConstant + 32: 6(float) Constant 1045220557 + 35: TypeInt 32 0 + 36: 35(int) Constant 2 + 37: TypeArray 15 36 + 38: TypePointer UniformConstant 37 + 39(g_tTex3): 38(ptr) Variable UniformConstant + 40: TypeInt 32 1 + 41: 40(int) Constant 0 + 44: TypeArray 19 36 + 45: TypePointer UniformConstant 44 + 46(g_sSamp3): 45(ptr) Variable UniformConstant + 50: 6(float) Constant 1050253722 + 53: 40(int) Constant 1 + 61: 35(int) Constant 3 + 62: TypeArray 15 61 + 63: TypePointer UniformConstant 62 + 64(g_tTex4): 63(ptr) Variable UniformConstant + 67: TypeArray 19 61 + 68: TypePointer UniformConstant 67 + 69(g_sSamp4): 68(ptr) Variable UniformConstant + 73: 6(float) Constant 1053609165 + 76: 40(int) Constant 2 + 84(g_tTex5): 16(ptr) Variable UniformConstant + 86(g_sSamp5): 20(ptr) Variable UniformConstant + 89: 6(float) Constant 1056964608 + 92: TypeVector 6(float) 3 + 93(MyStruct_t): TypeStruct 40(int) 6(float) 92(fvec3) + 94: TypeVector 40(int) 4 + 95(myblock): TypeStruct 93(MyStruct_t) 7(fvec4) 7(fvec4) 94(ivec4) + 96: TypePointer Uniform 95(myblock) + 97: 96(ptr) Variable Uniform + 98: 35(int) Constant 1 + 99: TypePointer Uniform 6(float) +119(g_tTex_unused1): 16(ptr) Variable UniformConstant +121(g_sSamp_unused1): 20(ptr) Variable UniformConstant + 124: 6(float) Constant 1066192077 +126(g_tTex_unused2): 16(ptr) Variable UniformConstant +128(g_sSamp_unused2): 20(ptr) Variable UniformConstant + 131: 6(float) Constant 1067030938 + 136: TypePointer Output 7(fvec4) + 137(FragColor): 136(ptr) Variable Output +141(g_tTex_unused3): 16(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 138: 7(fvec4) FunctionCall 9(Func1() + 139: 7(fvec4) FunctionCall 11(Func2() + 140: 7(fvec4) FAdd 138 139 + Store 137(FragColor) 140 + Return + FunctionEnd + 9(Func1(): 7(fvec4) Function None 8 + 10: Label + 18: 15 Load 17(g_tTex1) + 22: 19 Load 21(g_sSamp1) + 24: 23 SampledImage 18 22 + 26: 7(fvec4) ImageSampleImplicitLod 24 25 + 28: 15 Load 27(g_tTex2) + 30: 19 Load 29(g_sSamp2) + 31: 23 SampledImage 28 30 + 33: 7(fvec4) ImageSampleImplicitLod 31 32 + 34: 7(fvec4) FAdd 26 33 + 42: 16(ptr) AccessChain 39(g_tTex3) 41 + 43: 15 Load 42 + 47: 20(ptr) AccessChain 46(g_sSamp3) 41 + 48: 19 Load 47 + 49: 23 SampledImage 43 48 + 51: 7(fvec4) ImageSampleImplicitLod 49 50 + 52: 7(fvec4) FAdd 34 51 + 54: 16(ptr) AccessChain 39(g_tTex3) 53 + 55: 15 Load 54 + 56: 20(ptr) AccessChain 46(g_sSamp3) 53 + 57: 19 Load 56 + 58: 23 SampledImage 55 57 + 59: 7(fvec4) ImageSampleImplicitLod 58 50 + 60: 7(fvec4) FAdd 52 59 + 65: 16(ptr) AccessChain 64(g_tTex4) 53 + 66: 15 Load 65 + 70: 20(ptr) AccessChain 69(g_sSamp4) 53 + 71: 19 Load 70 + 72: 23 SampledImage 66 71 + 74: 7(fvec4) ImageSampleImplicitLod 72 73 + 75: 7(fvec4) FAdd 60 74 + 77: 16(ptr) AccessChain 64(g_tTex4) 76 + 78: 15 Load 77 + 79: 20(ptr) AccessChain 69(g_sSamp4) 76 + 80: 19 Load 79 + 81: 23 SampledImage 78 80 + 82: 7(fvec4) ImageSampleImplicitLod 81 73 + 83: 7(fvec4) FAdd 75 82 + 85: 15 Load 84(g_tTex5) + 87: 19 Load 86(g_sSamp5) + 88: 23 SampledImage 85 87 + 90: 7(fvec4) ImageSampleImplicitLod 88 89 + 91: 7(fvec4) FAdd 83 90 + 100: 99(ptr) AccessChain 97 41 76 98 + 101: 6(float) Load 100 + 102: 7(fvec4) CompositeConstruct 101 101 101 101 + 103: 7(fvec4) FAdd 91 102 + ReturnValue 103 + FunctionEnd + 11(Func2(): 7(fvec4) Function None 8 + 12: Label + 106: 15 Load 17(g_tTex1) + 107: 19 Load 21(g_sSamp1) + 108: 23 SampledImage 106 107 + 109: 7(fvec4) ImageSampleImplicitLod 108 25 + 110: 16(ptr) AccessChain 39(g_tTex3) 53 + 111: 15 Load 110 + 112: 20(ptr) AccessChain 46(g_sSamp3) 53 + 113: 19 Load 112 + 114: 23 SampledImage 111 113 + 115: 7(fvec4) ImageSampleImplicitLod 114 50 + 116: 7(fvec4) FAdd 109 115 + ReturnValue 116 + FunctionEnd +13(Func2_unused(): 7(fvec4) Function None 8 + 14: Label + 120: 15 Load 119(g_tTex_unused1) + 122: 19 Load 121(g_sSamp_unused1) + 123: 23 SampledImage 120 122 + 125: 7(fvec4) ImageSampleImplicitLod 123 124 + 127: 15 Load 126(g_tTex_unused2) + 129: 19 Load 128(g_sSamp_unused2) + 130: 23 SampledImage 127 129 + 132: 7(fvec4) ImageSampleImplicitLod 130 131 + 133: 7(fvec4) FAdd 125 132 + ReturnValue 133 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.glsl.register.noautoassign.frag.out b/deps/glslang/Test/baseResults/spv.glsl.register.noautoassign.frag.out new file mode 100644 index 00000000..44d63ed1 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.glsl.register.noautoassign.frag.out @@ -0,0 +1,226 @@ +spv.glsl.register.noautoassign.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 142 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 137 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "Func1(" + Name 11 "Func2(" + Name 13 "Func2_unused(" + Name 17 "g_tTex1" + Name 21 "g_sSamp1" + Name 27 "g_tTex2" + Name 29 "g_sSamp2" + Name 39 "g_tTex3" + Name 46 "g_sSamp3" + Name 64 "g_tTex4" + Name 69 "g_sSamp4" + Name 84 "g_tTex5" + Name 86 "g_sSamp5" + Name 93 "MyStruct_t" + MemberName 93(MyStruct_t) 0 "a" + MemberName 93(MyStruct_t) 1 "b" + MemberName 93(MyStruct_t) 2 "c" + Name 95 "myblock" + MemberName 95(myblock) 0 "mystruct" + MemberName 95(myblock) 1 "myvec4_a" + MemberName 95(myblock) 2 "myvec4_b" + MemberName 95(myblock) 3 "myint4_a" + Name 97 "" + Name 119 "g_tTex_unused1" + Name 121 "g_sSamp_unused1" + Name 126 "g_tTex_unused2" + Name 128 "g_sSamp_unused2" + Name 137 "FragColor" + Name 141 "g_tTex_unused3" + Decorate 17(g_tTex1) DescriptorSet 0 + Decorate 17(g_tTex1) Binding 17 + Decorate 21(g_sSamp1) DescriptorSet 0 + Decorate 21(g_sSamp1) Binding 5 + Decorate 27(g_tTex2) DescriptorSet 0 + Decorate 27(g_tTex2) Binding 18 + Decorate 29(g_sSamp2) DescriptorSet 0 + Decorate 29(g_sSamp2) Binding 6 + Decorate 39(g_tTex3) DescriptorSet 0 + Decorate 39(g_tTex3) Binding 19 + Decorate 46(g_sSamp3) DescriptorSet 0 + Decorate 46(g_sSamp3) Binding 7 + Decorate 64(g_tTex4) DescriptorSet 0 + Decorate 64(g_tTex4) Binding 20 + Decorate 69(g_sSamp4) DescriptorSet 0 + Decorate 69(g_sSamp4) Binding 8 + Decorate 84(g_tTex5) DescriptorSet 0 + Decorate 84(g_tTex5) Binding 21 + Decorate 86(g_sSamp5) DescriptorSet 0 + Decorate 86(g_sSamp5) Binding 9 + MemberDecorate 93(MyStruct_t) 0 Offset 0 + MemberDecorate 93(MyStruct_t) 1 Offset 4 + MemberDecorate 93(MyStruct_t) 2 Offset 16 + MemberDecorate 95(myblock) 0 Offset 0 + MemberDecorate 95(myblock) 1 Offset 32 + MemberDecorate 95(myblock) 2 Offset 48 + MemberDecorate 95(myblock) 3 Offset 64 + Decorate 95(myblock) Block + Decorate 97 DescriptorSet 0 + Decorate 97 Binding 19 + Decorate 119(g_tTex_unused1) DescriptorSet 0 + Decorate 119(g_tTex_unused1) Binding 22 + Decorate 121(g_sSamp_unused1) DescriptorSet 0 + Decorate 121(g_sSamp_unused1) Binding 10 + Decorate 126(g_tTex_unused2) DescriptorSet 0 + Decorate 126(g_tTex_unused2) Binding 23 + Decorate 128(g_sSamp_unused2) DescriptorSet 0 + Decorate 128(g_sSamp_unused2) Binding 11 + Decorate 137(FragColor) Location 0 + Decorate 141(g_tTex_unused3) DescriptorSet 0 + Decorate 141(g_tTex_unused3) Binding 24 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 15: TypeImage 6(float) 1D sampled format:Unknown + 16: TypePointer UniformConstant 15 + 17(g_tTex1): 16(ptr) Variable UniformConstant + 19: TypeSampler + 20: TypePointer UniformConstant 19 + 21(g_sSamp1): 20(ptr) Variable UniformConstant + 23: TypeSampledImage 15 + 25: 6(float) Constant 1036831949 + 27(g_tTex2): 16(ptr) Variable UniformConstant + 29(g_sSamp2): 20(ptr) Variable UniformConstant + 32: 6(float) Constant 1045220557 + 35: TypeInt 32 0 + 36: 35(int) Constant 2 + 37: TypeArray 15 36 + 38: TypePointer UniformConstant 37 + 39(g_tTex3): 38(ptr) Variable UniformConstant + 40: TypeInt 32 1 + 41: 40(int) Constant 0 + 44: TypeArray 19 36 + 45: TypePointer UniformConstant 44 + 46(g_sSamp3): 45(ptr) Variable UniformConstant + 50: 6(float) Constant 1050253722 + 53: 40(int) Constant 1 + 61: 35(int) Constant 3 + 62: TypeArray 15 61 + 63: TypePointer UniformConstant 62 + 64(g_tTex4): 63(ptr) Variable UniformConstant + 67: TypeArray 19 61 + 68: TypePointer UniformConstant 67 + 69(g_sSamp4): 68(ptr) Variable UniformConstant + 73: 6(float) Constant 1053609165 + 76: 40(int) Constant 2 + 84(g_tTex5): 16(ptr) Variable UniformConstant + 86(g_sSamp5): 20(ptr) Variable UniformConstant + 89: 6(float) Constant 1056964608 + 92: TypeVector 6(float) 3 + 93(MyStruct_t): TypeStruct 40(int) 6(float) 92(fvec3) + 94: TypeVector 40(int) 4 + 95(myblock): TypeStruct 93(MyStruct_t) 7(fvec4) 7(fvec4) 94(ivec4) + 96: TypePointer Uniform 95(myblock) + 97: 96(ptr) Variable Uniform + 98: 35(int) Constant 1 + 99: TypePointer Uniform 6(float) +119(g_tTex_unused1): 16(ptr) Variable UniformConstant +121(g_sSamp_unused1): 20(ptr) Variable UniformConstant + 124: 6(float) Constant 1066192077 +126(g_tTex_unused2): 16(ptr) Variable UniformConstant +128(g_sSamp_unused2): 20(ptr) Variable UniformConstant + 131: 6(float) Constant 1067030938 + 136: TypePointer Output 7(fvec4) + 137(FragColor): 136(ptr) Variable Output +141(g_tTex_unused3): 16(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 138: 7(fvec4) FunctionCall 9(Func1() + 139: 7(fvec4) FunctionCall 11(Func2() + 140: 7(fvec4) FAdd 138 139 + Store 137(FragColor) 140 + Return + FunctionEnd + 9(Func1(): 7(fvec4) Function None 8 + 10: Label + 18: 15 Load 17(g_tTex1) + 22: 19 Load 21(g_sSamp1) + 24: 23 SampledImage 18 22 + 26: 7(fvec4) ImageSampleImplicitLod 24 25 + 28: 15 Load 27(g_tTex2) + 30: 19 Load 29(g_sSamp2) + 31: 23 SampledImage 28 30 + 33: 7(fvec4) ImageSampleImplicitLod 31 32 + 34: 7(fvec4) FAdd 26 33 + 42: 16(ptr) AccessChain 39(g_tTex3) 41 + 43: 15 Load 42 + 47: 20(ptr) AccessChain 46(g_sSamp3) 41 + 48: 19 Load 47 + 49: 23 SampledImage 43 48 + 51: 7(fvec4) ImageSampleImplicitLod 49 50 + 52: 7(fvec4) FAdd 34 51 + 54: 16(ptr) AccessChain 39(g_tTex3) 53 + 55: 15 Load 54 + 56: 20(ptr) AccessChain 46(g_sSamp3) 53 + 57: 19 Load 56 + 58: 23 SampledImage 55 57 + 59: 7(fvec4) ImageSampleImplicitLod 58 50 + 60: 7(fvec4) FAdd 52 59 + 65: 16(ptr) AccessChain 64(g_tTex4) 53 + 66: 15 Load 65 + 70: 20(ptr) AccessChain 69(g_sSamp4) 53 + 71: 19 Load 70 + 72: 23 SampledImage 66 71 + 74: 7(fvec4) ImageSampleImplicitLod 72 73 + 75: 7(fvec4) FAdd 60 74 + 77: 16(ptr) AccessChain 64(g_tTex4) 76 + 78: 15 Load 77 + 79: 20(ptr) AccessChain 69(g_sSamp4) 76 + 80: 19 Load 79 + 81: 23 SampledImage 78 80 + 82: 7(fvec4) ImageSampleImplicitLod 81 73 + 83: 7(fvec4) FAdd 75 82 + 85: 15 Load 84(g_tTex5) + 87: 19 Load 86(g_sSamp5) + 88: 23 SampledImage 85 87 + 90: 7(fvec4) ImageSampleImplicitLod 88 89 + 91: 7(fvec4) FAdd 83 90 + 100: 99(ptr) AccessChain 97 41 76 98 + 101: 6(float) Load 100 + 102: 7(fvec4) CompositeConstruct 101 101 101 101 + 103: 7(fvec4) FAdd 91 102 + ReturnValue 103 + FunctionEnd + 11(Func2(): 7(fvec4) Function None 8 + 12: Label + 106: 15 Load 17(g_tTex1) + 107: 19 Load 21(g_sSamp1) + 108: 23 SampledImage 106 107 + 109: 7(fvec4) ImageSampleImplicitLod 108 25 + 110: 16(ptr) AccessChain 39(g_tTex3) 53 + 111: 15 Load 110 + 112: 20(ptr) AccessChain 46(g_sSamp3) 53 + 113: 19 Load 112 + 114: 23 SampledImage 111 113 + 115: 7(fvec4) ImageSampleImplicitLod 114 50 + 116: 7(fvec4) FAdd 109 115 + ReturnValue 116 + FunctionEnd +13(Func2_unused(): 7(fvec4) Function None 8 + 14: Label + 120: 15 Load 119(g_tTex_unused1) + 122: 19 Load 121(g_sSamp_unused1) + 123: 23 SampledImage 120 122 + 125: 7(fvec4) ImageSampleImplicitLod 123 124 + 127: 15 Load 126(g_tTex_unused2) + 129: 19 Load 128(g_sSamp_unused2) + 130: 23 SampledImage 127 129 + 132: 7(fvec4) ImageSampleImplicitLod 130 131 + 133: 7(fvec4) FAdd 125 132 + ReturnValue 133 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.hlslDebugInfo.frag.out b/deps/glslang/Test/baseResults/spv.hlslDebugInfo.frag.out new file mode 100644 index 00000000..9912d4e4 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.hlslDebugInfo.frag.out @@ -0,0 +1,58 @@ +spv.hlslDebugInfo.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 19 + + Capability Shader + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 5 "newMain" 17 + 1: String "spv.hlslDebugInfo.vert" + Source HLSL 500 1 "// OpModuleProcessed entry-point newMain +// OpModuleProcessed shift-sampler-binding 2 +// OpModuleProcessed shift-texture-binding 4 +// OpModuleProcessed shift-image-binding 1 +// OpModuleProcessed shift-UBO-binding 6 +// OpModuleProcessed shift-ssbo-binding 3 +// OpModuleProcessed shift-uav-binding 5 +// OpModuleProcessed flatten-uniform-arrays +// OpModuleProcessed no-storage-format +// OpModuleProcessed resource-set-binding t0 0 0 +// OpModuleProcessed hlsl-iomap +// OpModuleProcessed auto-map-bindings +// OpModuleProcessed auto-map-locations +// OpModuleProcessed client vulkan100 +// OpModuleProcessed target-env vulkan1.0 +// OpModuleProcessed source-entrypoint origMain +// OpModuleProcessed hlsl-offsets +#line 1 +float4 origMain() : SV_Position +{ + return (float4)0; +} +" + Name 5 "newMain" + Name 10 "@newMain(" + Name 17 "@entryPointOutput" + Decorate 17(@entryPointOutput) BuiltIn Position + 3: TypeVoid + 4: TypeFunction 3 + 7: TypeFloat 32 + 8: TypeVector 7(float) 4 + 9: TypeFunction 8(fvec4) + 12: 7(float) Constant 0 + 13: 8(fvec4) ConstantComposite 12 12 12 12 + 16: TypePointer Output 8(fvec4) +17(@entryPointOutput): 16(ptr) Variable Output + 5(newMain): 3 Function None 4 + 6: Label + Line 1 2 0 + 18: 8(fvec4) FunctionCall 10(@newMain() + Store 17(@entryPointOutput) 18 + Return + FunctionEnd + 10(@newMain(): 8(fvec4) Function None 9 + 11: Label + Line 1 3 0 + ReturnValue 13 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.hlslOffsets.vert.out b/deps/glslang/Test/baseResults/spv.hlslOffsets.vert.out new file mode 100644 index 00000000..af59fdbf --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.hlslOffsets.vert.out @@ -0,0 +1,76 @@ +spv.hlslOffsets.vert +Shader version: 450 +0:? Sequence +0:27 Function Definition: main( ( global void) +0:27 Function Parameters: +0:? Linker Objects +0:? 'anon@0' (layout( column_major std430) buffer block{layout( column_major std430) buffer highp float m0, layout( column_major std430) buffer highp 3-component vector of float m4, layout( column_major std430) buffer highp float m16, layout( column_major std430 offset=20) buffer highp 3-component vector of float m20, layout( column_major std430) buffer highp 3-component vector of float m32, layout( column_major std430) buffer highp 2-component vector of float m48, layout( column_major std430) buffer highp 2-component vector of float m56, layout( column_major std430) buffer highp float m64, layout( column_major std430) buffer highp 2-component vector of float m68, layout( column_major std430) buffer highp float m76, layout( column_major std430) buffer highp float m80, layout( column_major std430 offset=88) buffer highp 2-component vector of float m88, layout( column_major std430) buffer highp 2-component vector of float m96, layout( column_major std430) buffer 2-component vector of double m112}) + + +Linked vertex stage: + + +Shader version: 450 +0:? Sequence +0:27 Function Definition: main( ( global void) +0:27 Function Parameters: +0:? Linker Objects +0:? 'anon@0' (layout( column_major std430) buffer block{layout( column_major std430) buffer highp float m0, layout( column_major std430) buffer highp 3-component vector of float m4, layout( column_major std430) buffer highp float m16, layout( column_major std430 offset=20) buffer highp 3-component vector of float m20, layout( column_major std430) buffer highp 3-component vector of float m32, layout( column_major std430) buffer highp 2-component vector of float m48, layout( column_major std430) buffer highp 2-component vector of float m56, layout( column_major std430) buffer highp float m64, layout( column_major std430) buffer highp 2-component vector of float m68, layout( column_major std430) buffer highp float m76, layout( column_major std430) buffer highp float m80, layout( column_major std430 offset=88) buffer highp 2-component vector of float m88, layout( column_major std430) buffer highp 2-component vector of float m96, layout( column_major std430) buffer 2-component vector of double m112}) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 14 + + Capability Shader + Capability Float64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" + Source GLSL 450 + Name 4 "main" + Name 11 "block" + MemberName 11(block) 0 "m0" + MemberName 11(block) 1 "m4" + MemberName 11(block) 2 "m16" + MemberName 11(block) 3 "m20" + MemberName 11(block) 4 "m32" + MemberName 11(block) 5 "m48" + MemberName 11(block) 6 "m56" + MemberName 11(block) 7 "m64" + MemberName 11(block) 8 "m68" + MemberName 11(block) 9 "m76" + MemberName 11(block) 10 "m80" + MemberName 11(block) 11 "m88" + MemberName 11(block) 12 "m96" + MemberName 11(block) 13 "m112" + Name 13 "" + MemberDecorate 11(block) 0 Offset 0 + MemberDecorate 11(block) 1 Offset 4 + MemberDecorate 11(block) 2 Offset 16 + MemberDecorate 11(block) 3 Offset 20 + MemberDecorate 11(block) 4 Offset 32 + MemberDecorate 11(block) 5 Offset 48 + MemberDecorate 11(block) 6 Offset 56 + MemberDecorate 11(block) 7 Offset 64 + MemberDecorate 11(block) 8 Offset 68 + MemberDecorate 11(block) 9 Offset 76 + MemberDecorate 11(block) 10 Offset 80 + MemberDecorate 11(block) 11 Offset 88 + MemberDecorate 11(block) 12 Offset 96 + MemberDecorate 11(block) 13 Offset 112 + Decorate 11(block) BufferBlock + Decorate 13 DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8: TypeVector 6(float) 2 + 9: TypeFloat 64 + 10: TypeVector 9(float64_t) 2 + 11(block): TypeStruct 6(float) 7(fvec3) 6(float) 7(fvec3) 7(fvec3) 8(fvec2) 8(fvec2) 6(float) 8(fvec2) 6(float) 6(float) 8(fvec2) 8(fvec2) 10(f64vec2) + 12: TypePointer Uniform 11(block) + 13: 12(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.image.frag.out b/deps/glslang/Test/baseResults/spv.image.frag.out new file mode 100644 index 00000000..a5441801 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.image.frag.out @@ -0,0 +1,541 @@ +spv.image.frag +error: SPIRV-Tools Validation Errors +error: Capability ImageRect is not allowed by Vulkan 1.0 specification (or requires extension) + OpCapability ImageRect + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 395 + + Capability Shader + Capability StorageImageMultisample + Capability ImageCubeArray + Capability ImageRect + Capability Image1D + Capability ImageBuffer + Capability ImageMSArray + Capability StorageImageExtendedFormats + Capability ImageQuery + Capability StorageImageWriteWithoutFormat + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 132 142 152 248 381 394 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "iv" + Name 15 "i1D" + Name 27 "i2D" + Name 38 "i3D" + Name 45 "iCube" + Name 55 "iCubeArray" + Name 62 "i2DRect" + Name 72 "i1DArray" + Name 82 "i2DArray" + Name 89 "iBuffer" + Name 98 "i2DMS" + Name 108 "i2DMSArray" + Name 127 "v" + Name 132 "ic1D" + Name 142 "ic2D" + Name 152 "ic3D" + Name 229 "ui" + Name 232 "ii1D" + Name 245 "ui2D" + Name 248 "value" + Name 357 "ii2DMS" + Name 367 "ui2DMSArray" + Name 376 "wo2D" + Name 381 "fragData" + Name 394 "ic4D" + Decorate 15(i1D) DescriptorSet 0 + Decorate 15(i1D) Binding 0 + Decorate 27(i2D) DescriptorSet 0 + Decorate 27(i2D) Binding 1 + Decorate 38(i3D) DescriptorSet 0 + Decorate 38(i3D) Binding 2 + Decorate 45(iCube) DescriptorSet 0 + Decorate 45(iCube) Binding 3 + Decorate 55(iCubeArray) DescriptorSet 0 + Decorate 55(iCubeArray) Binding 4 + Decorate 62(i2DRect) DescriptorSet 0 + Decorate 62(i2DRect) Binding 5 + Decorate 72(i1DArray) DescriptorSet 0 + Decorate 72(i1DArray) Binding 6 + Decorate 82(i2DArray) DescriptorSet 0 + Decorate 82(i2DArray) Binding 7 + Decorate 89(iBuffer) DescriptorSet 0 + Decorate 89(iBuffer) Binding 8 + Decorate 98(i2DMS) DescriptorSet 0 + Decorate 98(i2DMS) Binding 9 + Decorate 108(i2DMSArray) DescriptorSet 0 + Decorate 108(i2DMSArray) Binding 10 + Decorate 132(ic1D) Flat + Decorate 142(ic2D) Flat + Decorate 152(ic3D) Flat + Decorate 232(ii1D) DescriptorSet 0 + Decorate 232(ii1D) Binding 11 + Decorate 245(ui2D) DescriptorSet 0 + Decorate 245(ui2D) Binding 12 + Decorate 248(value) Flat + Decorate 357(ii2DMS) DescriptorSet 0 + Decorate 357(ii2DMS) Binding 13 + Decorate 367(ui2DMSArray) DescriptorSet 0 + Decorate 367(ui2DMSArray) Binding 14 + Decorate 376(wo2D) DescriptorSet 0 + Decorate 376(wo2D) Binding 1 + Decorate 376(wo2D) NonReadable + Decorate 394(ic4D) Flat + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 10: 6(int) Constant 0 + 11: 7(ivec3) ConstantComposite 10 10 10 + 12: TypeFloat 32 + 13: TypeImage 12(float) 1D nonsampled format:Rgba32f + 14: TypePointer UniformConstant 13 + 15(i1D): 14(ptr) Variable UniformConstant + 18: TypeInt 32 0 + 19: 18(int) Constant 0 + 20: TypePointer Function 6(int) + 25: TypeImage 12(float) 2D nonsampled format:Rgba32f + 26: TypePointer UniformConstant 25 + 27(i2D): 26(ptr) Variable UniformConstant + 29: TypeVector 6(int) 2 + 36: TypeImage 12(float) 3D nonsampled format:Rgba32f + 37: TypePointer UniformConstant 36 + 38(i3D): 37(ptr) Variable UniformConstant + 43: TypeImage 12(float) Cube nonsampled format:Rgba32f + 44: TypePointer UniformConstant 43 + 45(iCube): 44(ptr) Variable UniformConstant + 53: TypeImage 12(float) Cube array nonsampled format:Rgba32f + 54: TypePointer UniformConstant 53 + 55(iCubeArray): 54(ptr) Variable UniformConstant + 60: TypeImage 12(float) Rect nonsampled format:Rgba32f + 61: TypePointer UniformConstant 60 + 62(i2DRect): 61(ptr) Variable UniformConstant + 70: TypeImage 12(float) 1D array nonsampled format:Rgba32f + 71: TypePointer UniformConstant 70 + 72(i1DArray): 71(ptr) Variable UniformConstant + 80: TypeImage 12(float) 2D array nonsampled format:Rg16 + 81: TypePointer UniformConstant 80 + 82(i2DArray): 81(ptr) Variable UniformConstant + 87: TypeImage 12(float) Buffer nonsampled format:Rgba32f + 88: TypePointer UniformConstant 87 + 89(iBuffer): 88(ptr) Variable UniformConstant + 96: TypeImage 12(float) 2D multi-sampled nonsampled format:Rgba32f + 97: TypePointer UniformConstant 96 + 98(i2DMS): 97(ptr) Variable UniformConstant + 106: TypeImage 12(float) 2D array multi-sampled nonsampled format:Rgba32f + 107: TypePointer UniformConstant 106 + 108(i2DMSArray): 107(ptr) Variable UniformConstant + 125: TypeVector 12(float) 4 + 126: TypePointer Function 125(fvec4) + 128: 12(float) Constant 0 + 129: 125(fvec4) ConstantComposite 128 128 128 128 + 131: TypePointer Input 6(int) + 132(ic1D): 131(ptr) Variable Input + 141: TypePointer Input 29(ivec2) + 142(ic2D): 141(ptr) Variable Input + 151: TypePointer Input 7(ivec3) + 152(ic3D): 151(ptr) Variable Input + 210: 6(int) Constant 1 + 216: 6(int) Constant 2 + 220: 6(int) Constant 3 + 226: 6(int) Constant 4 + 228: TypePointer Function 18(int) + 230: TypeImage 6(int) 1D nonsampled format:R32i + 231: TypePointer UniformConstant 230 + 232(ii1D): 231(ptr) Variable UniformConstant + 234: 6(int) Constant 10 + 235: TypePointer Image 6(int) + 237: 18(int) Constant 1 + 243: TypeImage 18(int) 2D nonsampled format:R32ui + 244: TypePointer UniformConstant 243 + 245(ui2D): 244(ptr) Variable UniformConstant + 247: TypePointer Input 18(int) + 248(value): 247(ptr) Variable Input + 250: TypePointer Image 18(int) + 256: 6(int) Constant 11 + 270: 6(int) Constant 12 + 284: 6(int) Constant 13 + 298: 6(int) Constant 14 + 312: 6(int) Constant 15 + 326: 6(int) Constant 16 + 340: 6(int) Constant 18 + 341: 6(int) Constant 17 + 349: 18(int) Constant 19 + 355: TypeImage 6(int) 2D multi-sampled nonsampled format:R32i + 356: TypePointer UniformConstant 355 + 357(ii2DMS): 356(ptr) Variable UniformConstant + 365: TypeImage 18(int) 2D array multi-sampled nonsampled format:R32ui + 366: TypePointer UniformConstant 365 +367(ui2DMSArray): 366(ptr) Variable UniformConstant + 374: TypeImage 12(float) 2D nonsampled format:Unknown + 375: TypePointer UniformConstant 374 + 376(wo2D): 375(ptr) Variable UniformConstant + 380: TypePointer Output 125(fvec4) + 381(fragData): 380(ptr) Variable Output + 386: TypeBool + 389: TypeVector 386(bool) 4 + 392: TypeVector 6(int) 4 + 393: TypePointer Input 392(ivec4) + 394(ic4D): 393(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 9(iv): 8(ptr) Variable Function + 127(v): 126(ptr) Variable Function + 229(ui): 228(ptr) Variable Function + Store 9(iv) 11 + 16: 13 Load 15(i1D) + 17: 6(int) ImageQuerySize 16 + 21: 20(ptr) AccessChain 9(iv) 19 + 22: 6(int) Load 21 + 23: 6(int) IAdd 22 17 + 24: 20(ptr) AccessChain 9(iv) 19 + Store 24 23 + 28: 25 Load 27(i2D) + 30: 29(ivec2) ImageQuerySize 28 + 31: 7(ivec3) Load 9(iv) + 32: 29(ivec2) VectorShuffle 31 31 0 1 + 33: 29(ivec2) IAdd 32 30 + 34: 7(ivec3) Load 9(iv) + 35: 7(ivec3) VectorShuffle 34 33 3 4 2 + Store 9(iv) 35 + 39: 36 Load 38(i3D) + 40: 7(ivec3) ImageQuerySize 39 + 41: 7(ivec3) Load 9(iv) + 42: 7(ivec3) IAdd 41 40 + Store 9(iv) 42 + 46: 43 Load 45(iCube) + 47: 29(ivec2) ImageQuerySize 46 + 48: 7(ivec3) Load 9(iv) + 49: 29(ivec2) VectorShuffle 48 48 0 1 + 50: 29(ivec2) IAdd 49 47 + 51: 7(ivec3) Load 9(iv) + 52: 7(ivec3) VectorShuffle 51 50 3 4 2 + Store 9(iv) 52 + 56: 53 Load 55(iCubeArray) + 57: 7(ivec3) ImageQuerySize 56 + 58: 7(ivec3) Load 9(iv) + 59: 7(ivec3) IAdd 58 57 + Store 9(iv) 59 + 63: 60 Load 62(i2DRect) + 64: 29(ivec2) ImageQuerySize 63 + 65: 7(ivec3) Load 9(iv) + 66: 29(ivec2) VectorShuffle 65 65 0 1 + 67: 29(ivec2) IAdd 66 64 + 68: 7(ivec3) Load 9(iv) + 69: 7(ivec3) VectorShuffle 68 67 3 4 2 + Store 9(iv) 69 + 73: 70 Load 72(i1DArray) + 74: 29(ivec2) ImageQuerySize 73 + 75: 7(ivec3) Load 9(iv) + 76: 29(ivec2) VectorShuffle 75 75 0 1 + 77: 29(ivec2) IAdd 76 74 + 78: 7(ivec3) Load 9(iv) + 79: 7(ivec3) VectorShuffle 78 77 3 4 2 + Store 9(iv) 79 + 83: 80 Load 82(i2DArray) + 84: 7(ivec3) ImageQuerySize 83 + 85: 7(ivec3) Load 9(iv) + 86: 7(ivec3) IAdd 85 84 + Store 9(iv) 86 + 90: 87 Load 89(iBuffer) + 91: 6(int) ImageQuerySize 90 + 92: 20(ptr) AccessChain 9(iv) 19 + 93: 6(int) Load 92 + 94: 6(int) IAdd 93 91 + 95: 20(ptr) AccessChain 9(iv) 19 + Store 95 94 + 99: 96 Load 98(i2DMS) + 100: 29(ivec2) ImageQuerySize 99 + 101: 7(ivec3) Load 9(iv) + 102: 29(ivec2) VectorShuffle 101 101 0 1 + 103: 29(ivec2) IAdd 102 100 + 104: 7(ivec3) Load 9(iv) + 105: 7(ivec3) VectorShuffle 104 103 3 4 2 + Store 9(iv) 105 + 109: 106 Load 108(i2DMSArray) + 110: 7(ivec3) ImageQuerySize 109 + 111: 7(ivec3) Load 9(iv) + 112: 7(ivec3) IAdd 111 110 + Store 9(iv) 112 + 113: 96 Load 98(i2DMS) + 114: 6(int) ImageQuerySamples 113 + 115: 20(ptr) AccessChain 9(iv) 19 + 116: 6(int) Load 115 + 117: 6(int) IAdd 116 114 + 118: 20(ptr) AccessChain 9(iv) 19 + Store 118 117 + 119: 106 Load 108(i2DMSArray) + 120: 6(int) ImageQuerySamples 119 + 121: 20(ptr) AccessChain 9(iv) 19 + 122: 6(int) Load 121 + 123: 6(int) IAdd 122 120 + 124: 20(ptr) AccessChain 9(iv) 19 + Store 124 123 + Store 127(v) 129 + 130: 13 Load 15(i1D) + 133: 6(int) Load 132(ic1D) + 134: 125(fvec4) ImageRead 130 133 + 135: 125(fvec4) Load 127(v) + 136: 125(fvec4) FAdd 135 134 + Store 127(v) 136 + 137: 13 Load 15(i1D) + 138: 6(int) Load 132(ic1D) + 139: 125(fvec4) Load 127(v) + ImageWrite 137 138 139 + 140: 25 Load 27(i2D) + 143: 29(ivec2) Load 142(ic2D) + 144: 125(fvec4) ImageRead 140 143 + 145: 125(fvec4) Load 127(v) + 146: 125(fvec4) FAdd 145 144 + Store 127(v) 146 + 147: 25 Load 27(i2D) + 148: 29(ivec2) Load 142(ic2D) + 149: 125(fvec4) Load 127(v) + ImageWrite 147 148 149 + 150: 36 Load 38(i3D) + 153: 7(ivec3) Load 152(ic3D) + 154: 125(fvec4) ImageRead 150 153 + 155: 125(fvec4) Load 127(v) + 156: 125(fvec4) FAdd 155 154 + Store 127(v) 156 + 157: 36 Load 38(i3D) + 158: 7(ivec3) Load 152(ic3D) + 159: 125(fvec4) Load 127(v) + ImageWrite 157 158 159 + 160: 43 Load 45(iCube) + 161: 7(ivec3) Load 152(ic3D) + 162: 125(fvec4) ImageRead 160 161 + 163: 125(fvec4) Load 127(v) + 164: 125(fvec4) FAdd 163 162 + Store 127(v) 164 + 165: 43 Load 45(iCube) + 166: 7(ivec3) Load 152(ic3D) + 167: 125(fvec4) Load 127(v) + ImageWrite 165 166 167 + 168: 53 Load 55(iCubeArray) + 169: 7(ivec3) Load 152(ic3D) + 170: 125(fvec4) ImageRead 168 169 + 171: 125(fvec4) Load 127(v) + 172: 125(fvec4) FAdd 171 170 + Store 127(v) 172 + 173: 53 Load 55(iCubeArray) + 174: 7(ivec3) Load 152(ic3D) + 175: 125(fvec4) Load 127(v) + ImageWrite 173 174 175 + 176: 60 Load 62(i2DRect) + 177: 29(ivec2) Load 142(ic2D) + 178: 125(fvec4) ImageRead 176 177 + 179: 125(fvec4) Load 127(v) + 180: 125(fvec4) FAdd 179 178 + Store 127(v) 180 + 181: 60 Load 62(i2DRect) + 182: 29(ivec2) Load 142(ic2D) + 183: 125(fvec4) Load 127(v) + ImageWrite 181 182 183 + 184: 70 Load 72(i1DArray) + 185: 29(ivec2) Load 142(ic2D) + 186: 125(fvec4) ImageRead 184 185 + 187: 125(fvec4) Load 127(v) + 188: 125(fvec4) FAdd 187 186 + Store 127(v) 188 + 189: 70 Load 72(i1DArray) + 190: 29(ivec2) Load 142(ic2D) + 191: 125(fvec4) Load 127(v) + ImageWrite 189 190 191 + 192: 80 Load 82(i2DArray) + 193: 7(ivec3) Load 152(ic3D) + 194: 125(fvec4) ImageRead 192 193 + 195: 125(fvec4) Load 127(v) + 196: 125(fvec4) FAdd 195 194 + Store 127(v) 196 + 197: 80 Load 82(i2DArray) + 198: 7(ivec3) Load 152(ic3D) + 199: 125(fvec4) Load 127(v) + ImageWrite 197 198 199 + 200: 87 Load 89(iBuffer) + 201: 6(int) Load 132(ic1D) + 202: 125(fvec4) ImageRead 200 201 + 203: 125(fvec4) Load 127(v) + 204: 125(fvec4) FAdd 203 202 + Store 127(v) 204 + 205: 87 Load 89(iBuffer) + 206: 6(int) Load 132(ic1D) + 207: 125(fvec4) Load 127(v) + ImageWrite 205 206 207 + 208: 96 Load 98(i2DMS) + 209: 29(ivec2) Load 142(ic2D) + 211: 125(fvec4) ImageRead 208 209 Sample 210 + 212: 125(fvec4) Load 127(v) + 213: 125(fvec4) FAdd 212 211 + Store 127(v) 213 + 214: 96 Load 98(i2DMS) + 215: 29(ivec2) Load 142(ic2D) + 217: 125(fvec4) Load 127(v) + ImageWrite 214 215 217 Sample 216 + 218: 106 Load 108(i2DMSArray) + 219: 7(ivec3) Load 152(ic3D) + 221: 125(fvec4) ImageRead 218 219 Sample 220 + 222: 125(fvec4) Load 127(v) + 223: 125(fvec4) FAdd 222 221 + Store 127(v) 223 + 224: 106 Load 108(i2DMSArray) + 225: 7(ivec3) Load 152(ic3D) + 227: 125(fvec4) Load 127(v) + ImageWrite 224 225 227 Sample 226 + Store 229(ui) 19 + 233: 6(int) Load 132(ic1D) + 236: 235(ptr) ImageTexelPointer 232(ii1D) 233 19 + 238: 6(int) AtomicIAdd 236 237 19 234 + 239: 20(ptr) AccessChain 9(iv) 19 + 240: 6(int) Load 239 + 241: 6(int) IAdd 240 238 + 242: 20(ptr) AccessChain 9(iv) 19 + Store 242 241 + 246: 29(ivec2) Load 142(ic2D) + 249: 18(int) Load 248(value) + 251: 250(ptr) ImageTexelPointer 245(ui2D) 246 19 + 252: 18(int) AtomicIAdd 251 237 19 249 + 253: 18(int) Load 229(ui) + 254: 18(int) IAdd 253 252 + Store 229(ui) 254 + 255: 6(int) Load 132(ic1D) + 257: 235(ptr) ImageTexelPointer 232(ii1D) 255 19 + 258: 6(int) AtomicSMin 257 237 19 256 + 259: 20(ptr) AccessChain 9(iv) 19 + 260: 6(int) Load 259 + 261: 6(int) IAdd 260 258 + 262: 20(ptr) AccessChain 9(iv) 19 + Store 262 261 + 263: 29(ivec2) Load 142(ic2D) + 264: 18(int) Load 248(value) + 265: 250(ptr) ImageTexelPointer 245(ui2D) 263 19 + 266: 18(int) AtomicUMin 265 237 19 264 + 267: 18(int) Load 229(ui) + 268: 18(int) IAdd 267 266 + Store 229(ui) 268 + 269: 6(int) Load 132(ic1D) + 271: 235(ptr) ImageTexelPointer 232(ii1D) 269 19 + 272: 6(int) AtomicSMax 271 237 19 270 + 273: 20(ptr) AccessChain 9(iv) 19 + 274: 6(int) Load 273 + 275: 6(int) IAdd 274 272 + 276: 20(ptr) AccessChain 9(iv) 19 + Store 276 275 + 277: 29(ivec2) Load 142(ic2D) + 278: 18(int) Load 248(value) + 279: 250(ptr) ImageTexelPointer 245(ui2D) 277 19 + 280: 18(int) AtomicUMax 279 237 19 278 + 281: 18(int) Load 229(ui) + 282: 18(int) IAdd 281 280 + Store 229(ui) 282 + 283: 6(int) Load 132(ic1D) + 285: 235(ptr) ImageTexelPointer 232(ii1D) 283 19 + 286: 6(int) AtomicAnd 285 237 19 284 + 287: 20(ptr) AccessChain 9(iv) 19 + 288: 6(int) Load 287 + 289: 6(int) IAdd 288 286 + 290: 20(ptr) AccessChain 9(iv) 19 + Store 290 289 + 291: 29(ivec2) Load 142(ic2D) + 292: 18(int) Load 248(value) + 293: 250(ptr) ImageTexelPointer 245(ui2D) 291 19 + 294: 18(int) AtomicAnd 293 237 19 292 + 295: 18(int) Load 229(ui) + 296: 18(int) IAdd 295 294 + Store 229(ui) 296 + 297: 6(int) Load 132(ic1D) + 299: 235(ptr) ImageTexelPointer 232(ii1D) 297 19 + 300: 6(int) AtomicOr 299 237 19 298 + 301: 20(ptr) AccessChain 9(iv) 19 + 302: 6(int) Load 301 + 303: 6(int) IAdd 302 300 + 304: 20(ptr) AccessChain 9(iv) 19 + Store 304 303 + 305: 29(ivec2) Load 142(ic2D) + 306: 18(int) Load 248(value) + 307: 250(ptr) ImageTexelPointer 245(ui2D) 305 19 + 308: 18(int) AtomicOr 307 237 19 306 + 309: 18(int) Load 229(ui) + 310: 18(int) IAdd 309 308 + Store 229(ui) 310 + 311: 6(int) Load 132(ic1D) + 313: 235(ptr) ImageTexelPointer 232(ii1D) 311 19 + 314: 6(int) AtomicXor 313 237 19 312 + 315: 20(ptr) AccessChain 9(iv) 19 + 316: 6(int) Load 315 + 317: 6(int) IAdd 316 314 + 318: 20(ptr) AccessChain 9(iv) 19 + Store 318 317 + 319: 29(ivec2) Load 142(ic2D) + 320: 18(int) Load 248(value) + 321: 250(ptr) ImageTexelPointer 245(ui2D) 319 19 + 322: 18(int) AtomicXor 321 237 19 320 + 323: 18(int) Load 229(ui) + 324: 18(int) IAdd 323 322 + Store 229(ui) 324 + 325: 6(int) Load 132(ic1D) + 327: 235(ptr) ImageTexelPointer 232(ii1D) 325 19 + 328: 6(int) AtomicExchange 327 237 19 326 + 329: 20(ptr) AccessChain 9(iv) 19 + 330: 6(int) Load 329 + 331: 6(int) IAdd 330 328 + 332: 20(ptr) AccessChain 9(iv) 19 + Store 332 331 + 333: 29(ivec2) Load 142(ic2D) + 334: 18(int) Load 248(value) + 335: 250(ptr) ImageTexelPointer 245(ui2D) 333 19 + 336: 18(int) AtomicExchange 335 237 19 334 + 337: 18(int) Load 229(ui) + 338: 18(int) IAdd 337 336 + Store 229(ui) 338 + 339: 6(int) Load 132(ic1D) + 342: 235(ptr) ImageTexelPointer 232(ii1D) 339 19 + 343: 6(int) AtomicCompareExchange 342 237 19 19 341 340 + 344: 20(ptr) AccessChain 9(iv) 19 + 345: 6(int) Load 344 + 346: 6(int) IAdd 345 343 + 347: 20(ptr) AccessChain 9(iv) 19 + Store 347 346 + 348: 29(ivec2) Load 142(ic2D) + 350: 18(int) Load 248(value) + 351: 250(ptr) ImageTexelPointer 245(ui2D) 348 19 + 352: 18(int) AtomicCompareExchange 351 237 19 19 350 349 + 353: 18(int) Load 229(ui) + 354: 18(int) IAdd 353 352 + Store 229(ui) 354 + 358: 29(ivec2) Load 142(ic2D) + 359: 235(ptr) ImageTexelPointer 357(ii2DMS) 358 216 + 360: 6(int) AtomicCompareExchange 359 237 19 19 341 340 + 361: 20(ptr) AccessChain 9(iv) 19 + 362: 6(int) Load 361 + 363: 6(int) IAdd 362 360 + 364: 20(ptr) AccessChain 9(iv) 19 + Store 364 363 + 368: 7(ivec3) Load 152(ic3D) + 369: 18(int) Load 248(value) + 370: 250(ptr) ImageTexelPointer 367(ui2DMSArray) 368 220 + 371: 18(int) AtomicCompareExchange 370 237 19 19 369 349 + 372: 18(int) Load 229(ui) + 373: 18(int) IAdd 372 371 + Store 229(ui) 373 + 377: 374 Load 376(wo2D) + 378: 29(ivec2) Load 142(ic2D) + 379: 125(fvec4) Load 127(v) + ImageWrite 377 378 379 + 382: 18(int) Load 229(ui) + 383: 20(ptr) AccessChain 9(iv) 237 + 384: 6(int) Load 383 + 385: 18(int) Bitcast 384 + 387: 386(bool) INotEqual 382 385 + 388: 125(fvec4) Load 127(v) + 390: 389(bvec4) CompositeConstruct 387 387 387 387 + 391: 125(fvec4) Select 390 388 129 + Store 381(fragData) 391 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.image.load-formatted.frag.out b/deps/glslang/Test/baseResults/spv.image.load-formatted.frag.out new file mode 100644 index 00000000..172a3a17 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.image.load-formatted.frag.out @@ -0,0 +1,352 @@ +spv.image.load-formatted.frag +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 240 + + Capability Shader + Capability SampledRect + Capability Sampled1D + Capability SampledCubeArray + Capability SampledBuffer + Capability ImageMSArray + Capability ImageQuery + Capability StorageImageReadWithoutFormat + Capability StorageImageWriteWithoutFormat + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 132 142 152 233 237 239 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_shader_image_load_formatted" + Name 4 "main" + Name 9 "iv" + Name 15 "i1D" + Name 27 "i2D" + Name 38 "i3D" + Name 45 "iCube" + Name 55 "iCubeArray" + Name 62 "i2DRect" + Name 72 "i1DArray" + Name 82 "i2DArray" + Name 89 "iBuffer" + Name 98 "i2DMS" + Name 108 "i2DMSArray" + Name 127 "v" + Name 132 "ic1D" + Name 142 "ic2D" + Name 152 "ic3D" + Name 228 "wo2D" + Name 233 "fragData" + Name 237 "ic4D" + Name 239 "value" + Decorate 15(i1D) DescriptorSet 0 + Decorate 15(i1D) Binding 0 + Decorate 27(i2D) DescriptorSet 0 + Decorate 27(i2D) Binding 1 + Decorate 38(i3D) DescriptorSet 0 + Decorate 38(i3D) Binding 2 + Decorate 45(iCube) DescriptorSet 0 + Decorate 45(iCube) Binding 3 + Decorate 55(iCubeArray) DescriptorSet 0 + Decorate 55(iCubeArray) Binding 4 + Decorate 62(i2DRect) DescriptorSet 0 + Decorate 62(i2DRect) Binding 5 + Decorate 72(i1DArray) DescriptorSet 0 + Decorate 72(i1DArray) Binding 6 + Decorate 82(i2DArray) DescriptorSet 0 + Decorate 82(i2DArray) Binding 7 + Decorate 89(iBuffer) DescriptorSet 0 + Decorate 89(iBuffer) Binding 8 + Decorate 98(i2DMS) DescriptorSet 0 + Decorate 98(i2DMS) Binding 9 + Decorate 108(i2DMSArray) DescriptorSet 0 + Decorate 108(i2DMSArray) Binding 10 + Decorate 132(ic1D) Flat + Decorate 142(ic2D) Flat + Decorate 152(ic3D) Flat + Decorate 228(wo2D) DescriptorSet 0 + Decorate 228(wo2D) Binding 1 + Decorate 228(wo2D) NonReadable + Decorate 237(ic4D) Flat + Decorate 239(value) Flat + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 10: 6(int) Constant 0 + 11: 7(ivec3) ConstantComposite 10 10 10 + 12: TypeFloat 32 + 13: TypeImage 12(float) 1D nonsampled format:Unknown + 14: TypePointer UniformConstant 13 + 15(i1D): 14(ptr) Variable UniformConstant + 18: TypeInt 32 0 + 19: 18(int) Constant 0 + 20: TypePointer Function 6(int) + 25: TypeImage 12(float) 2D nonsampled format:Unknown + 26: TypePointer UniformConstant 25 + 27(i2D): 26(ptr) Variable UniformConstant + 29: TypeVector 6(int) 2 + 36: TypeImage 12(float) 3D nonsampled format:Unknown + 37: TypePointer UniformConstant 36 + 38(i3D): 37(ptr) Variable UniformConstant + 43: TypeImage 12(float) Cube nonsampled format:Unknown + 44: TypePointer UniformConstant 43 + 45(iCube): 44(ptr) Variable UniformConstant + 53: TypeImage 12(float) Cube array nonsampled format:Unknown + 54: TypePointer UniformConstant 53 + 55(iCubeArray): 54(ptr) Variable UniformConstant + 60: TypeImage 12(float) Rect nonsampled format:Unknown + 61: TypePointer UniformConstant 60 + 62(i2DRect): 61(ptr) Variable UniformConstant + 70: TypeImage 12(float) 1D array nonsampled format:Unknown + 71: TypePointer UniformConstant 70 + 72(i1DArray): 71(ptr) Variable UniformConstant + 80: TypeImage 12(float) 2D array nonsampled format:Unknown + 81: TypePointer UniformConstant 80 + 82(i2DArray): 81(ptr) Variable UniformConstant + 87: TypeImage 12(float) Buffer nonsampled format:Unknown + 88: TypePointer UniformConstant 87 + 89(iBuffer): 88(ptr) Variable UniformConstant + 96: TypeImage 12(float) 2D multi-sampled nonsampled format:Unknown + 97: TypePointer UniformConstant 96 + 98(i2DMS): 97(ptr) Variable UniformConstant + 106: TypeImage 12(float) 2D array multi-sampled nonsampled format:Unknown + 107: TypePointer UniformConstant 106 + 108(i2DMSArray): 107(ptr) Variable UniformConstant + 125: TypeVector 12(float) 4 + 126: TypePointer Function 125(fvec4) + 128: 12(float) Constant 0 + 129: 125(fvec4) ConstantComposite 128 128 128 128 + 131: TypePointer Input 6(int) + 132(ic1D): 131(ptr) Variable Input + 141: TypePointer Input 29(ivec2) + 142(ic2D): 141(ptr) Variable Input + 151: TypePointer Input 7(ivec3) + 152(ic3D): 151(ptr) Variable Input + 210: 6(int) Constant 1 + 216: 6(int) Constant 2 + 220: 6(int) Constant 3 + 226: 6(int) Constant 4 + 228(wo2D): 26(ptr) Variable UniformConstant + 232: TypePointer Output 125(fvec4) + 233(fragData): 232(ptr) Variable Output + 235: TypeVector 6(int) 4 + 236: TypePointer Input 235(ivec4) + 237(ic4D): 236(ptr) Variable Input + 238: TypePointer Input 18(int) + 239(value): 238(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 9(iv): 8(ptr) Variable Function + 127(v): 126(ptr) Variable Function + Store 9(iv) 11 + 16: 13 Load 15(i1D) + 17: 6(int) ImageQuerySize 16 + 21: 20(ptr) AccessChain 9(iv) 19 + 22: 6(int) Load 21 + 23: 6(int) IAdd 22 17 + 24: 20(ptr) AccessChain 9(iv) 19 + Store 24 23 + 28: 25 Load 27(i2D) + 30: 29(ivec2) ImageQuerySize 28 + 31: 7(ivec3) Load 9(iv) + 32: 29(ivec2) VectorShuffle 31 31 0 1 + 33: 29(ivec2) IAdd 32 30 + 34: 7(ivec3) Load 9(iv) + 35: 7(ivec3) VectorShuffle 34 33 3 4 2 + Store 9(iv) 35 + 39: 36 Load 38(i3D) + 40: 7(ivec3) ImageQuerySize 39 + 41: 7(ivec3) Load 9(iv) + 42: 7(ivec3) IAdd 41 40 + Store 9(iv) 42 + 46: 43 Load 45(iCube) + 47: 29(ivec2) ImageQuerySize 46 + 48: 7(ivec3) Load 9(iv) + 49: 29(ivec2) VectorShuffle 48 48 0 1 + 50: 29(ivec2) IAdd 49 47 + 51: 7(ivec3) Load 9(iv) + 52: 7(ivec3) VectorShuffle 51 50 3 4 2 + Store 9(iv) 52 + 56: 53 Load 55(iCubeArray) + 57: 7(ivec3) ImageQuerySize 56 + 58: 7(ivec3) Load 9(iv) + 59: 7(ivec3) IAdd 58 57 + Store 9(iv) 59 + 63: 60 Load 62(i2DRect) + 64: 29(ivec2) ImageQuerySize 63 + 65: 7(ivec3) Load 9(iv) + 66: 29(ivec2) VectorShuffle 65 65 0 1 + 67: 29(ivec2) IAdd 66 64 + 68: 7(ivec3) Load 9(iv) + 69: 7(ivec3) VectorShuffle 68 67 3 4 2 + Store 9(iv) 69 + 73: 70 Load 72(i1DArray) + 74: 29(ivec2) ImageQuerySize 73 + 75: 7(ivec3) Load 9(iv) + 76: 29(ivec2) VectorShuffle 75 75 0 1 + 77: 29(ivec2) IAdd 76 74 + 78: 7(ivec3) Load 9(iv) + 79: 7(ivec3) VectorShuffle 78 77 3 4 2 + Store 9(iv) 79 + 83: 80 Load 82(i2DArray) + 84: 7(ivec3) ImageQuerySize 83 + 85: 7(ivec3) Load 9(iv) + 86: 7(ivec3) IAdd 85 84 + Store 9(iv) 86 + 90: 87 Load 89(iBuffer) + 91: 6(int) ImageQuerySize 90 + 92: 20(ptr) AccessChain 9(iv) 19 + 93: 6(int) Load 92 + 94: 6(int) IAdd 93 91 + 95: 20(ptr) AccessChain 9(iv) 19 + Store 95 94 + 99: 96 Load 98(i2DMS) + 100: 29(ivec2) ImageQuerySize 99 + 101: 7(ivec3) Load 9(iv) + 102: 29(ivec2) VectorShuffle 101 101 0 1 + 103: 29(ivec2) IAdd 102 100 + 104: 7(ivec3) Load 9(iv) + 105: 7(ivec3) VectorShuffle 104 103 3 4 2 + Store 9(iv) 105 + 109: 106 Load 108(i2DMSArray) + 110: 7(ivec3) ImageQuerySize 109 + 111: 7(ivec3) Load 9(iv) + 112: 7(ivec3) IAdd 111 110 + Store 9(iv) 112 + 113: 96 Load 98(i2DMS) + 114: 6(int) ImageQuerySamples 113 + 115: 20(ptr) AccessChain 9(iv) 19 + 116: 6(int) Load 115 + 117: 6(int) IAdd 116 114 + 118: 20(ptr) AccessChain 9(iv) 19 + Store 118 117 + 119: 106 Load 108(i2DMSArray) + 120: 6(int) ImageQuerySamples 119 + 121: 20(ptr) AccessChain 9(iv) 19 + 122: 6(int) Load 121 + 123: 6(int) IAdd 122 120 + 124: 20(ptr) AccessChain 9(iv) 19 + Store 124 123 + Store 127(v) 129 + 130: 13 Load 15(i1D) + 133: 6(int) Load 132(ic1D) + 134: 125(fvec4) ImageRead 130 133 + 135: 125(fvec4) Load 127(v) + 136: 125(fvec4) FAdd 135 134 + Store 127(v) 136 + 137: 13 Load 15(i1D) + 138: 6(int) Load 132(ic1D) + 139: 125(fvec4) Load 127(v) + ImageWrite 137 138 139 + 140: 25 Load 27(i2D) + 143: 29(ivec2) Load 142(ic2D) + 144: 125(fvec4) ImageRead 140 143 + 145: 125(fvec4) Load 127(v) + 146: 125(fvec4) FAdd 145 144 + Store 127(v) 146 + 147: 25 Load 27(i2D) + 148: 29(ivec2) Load 142(ic2D) + 149: 125(fvec4) Load 127(v) + ImageWrite 147 148 149 + 150: 36 Load 38(i3D) + 153: 7(ivec3) Load 152(ic3D) + 154: 125(fvec4) ImageRead 150 153 + 155: 125(fvec4) Load 127(v) + 156: 125(fvec4) FAdd 155 154 + Store 127(v) 156 + 157: 36 Load 38(i3D) + 158: 7(ivec3) Load 152(ic3D) + 159: 125(fvec4) Load 127(v) + ImageWrite 157 158 159 + 160: 43 Load 45(iCube) + 161: 7(ivec3) Load 152(ic3D) + 162: 125(fvec4) ImageRead 160 161 + 163: 125(fvec4) Load 127(v) + 164: 125(fvec4) FAdd 163 162 + Store 127(v) 164 + 165: 43 Load 45(iCube) + 166: 7(ivec3) Load 152(ic3D) + 167: 125(fvec4) Load 127(v) + ImageWrite 165 166 167 + 168: 53 Load 55(iCubeArray) + 169: 7(ivec3) Load 152(ic3D) + 170: 125(fvec4) ImageRead 168 169 + 171: 125(fvec4) Load 127(v) + 172: 125(fvec4) FAdd 171 170 + Store 127(v) 172 + 173: 53 Load 55(iCubeArray) + 174: 7(ivec3) Load 152(ic3D) + 175: 125(fvec4) Load 127(v) + ImageWrite 173 174 175 + 176: 60 Load 62(i2DRect) + 177: 29(ivec2) Load 142(ic2D) + 178: 125(fvec4) ImageRead 176 177 + 179: 125(fvec4) Load 127(v) + 180: 125(fvec4) FAdd 179 178 + Store 127(v) 180 + 181: 60 Load 62(i2DRect) + 182: 29(ivec2) Load 142(ic2D) + 183: 125(fvec4) Load 127(v) + ImageWrite 181 182 183 + 184: 70 Load 72(i1DArray) + 185: 29(ivec2) Load 142(ic2D) + 186: 125(fvec4) ImageRead 184 185 + 187: 125(fvec4) Load 127(v) + 188: 125(fvec4) FAdd 187 186 + Store 127(v) 188 + 189: 70 Load 72(i1DArray) + 190: 29(ivec2) Load 142(ic2D) + 191: 125(fvec4) Load 127(v) + ImageWrite 189 190 191 + 192: 80 Load 82(i2DArray) + 193: 7(ivec3) Load 152(ic3D) + 194: 125(fvec4) ImageRead 192 193 + 195: 125(fvec4) Load 127(v) + 196: 125(fvec4) FAdd 195 194 + Store 127(v) 196 + 197: 80 Load 82(i2DArray) + 198: 7(ivec3) Load 152(ic3D) + 199: 125(fvec4) Load 127(v) + ImageWrite 197 198 199 + 200: 87 Load 89(iBuffer) + 201: 6(int) Load 132(ic1D) + 202: 125(fvec4) ImageRead 200 201 + 203: 125(fvec4) Load 127(v) + 204: 125(fvec4) FAdd 203 202 + Store 127(v) 204 + 205: 87 Load 89(iBuffer) + 206: 6(int) Load 132(ic1D) + 207: 125(fvec4) Load 127(v) + ImageWrite 205 206 207 + 208: 96 Load 98(i2DMS) + 209: 29(ivec2) Load 142(ic2D) + 211: 125(fvec4) ImageRead 208 209 Sample 210 + 212: 125(fvec4) Load 127(v) + 213: 125(fvec4) FAdd 212 211 + Store 127(v) 213 + 214: 96 Load 98(i2DMS) + 215: 29(ivec2) Load 142(ic2D) + 217: 125(fvec4) Load 127(v) + ImageWrite 214 215 217 Sample 216 + 218: 106 Load 108(i2DMSArray) + 219: 7(ivec3) Load 152(ic3D) + 221: 125(fvec4) ImageRead 218 219 Sample 220 + 222: 125(fvec4) Load 127(v) + 223: 125(fvec4) FAdd 222 221 + Store 127(v) 223 + 224: 106 Load 108(i2DMSArray) + 225: 7(ivec3) Load 152(ic3D) + 227: 125(fvec4) Load 127(v) + ImageWrite 224 225 227 Sample 226 + 229: 25 Load 228(wo2D) + 230: 29(ivec2) Load 142(ic2D) + 231: 125(fvec4) Load 127(v) + ImageWrite 229 230 231 + 234: 125(fvec4) Load 127(v) + Store 233(fragData) 234 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out b/deps/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out new file mode 100644 index 00000000..db9177d0 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out @@ -0,0 +1,139 @@ +spv.imageLoadStoreLod.frag +error: SPIRV-Tools Validation Errors +error: Image Operand Lod can only be used with ExplicitLod opcodes and OpImageFetch + %19 = OpImageRead %v4float %15 %int_1 Lod %int_3 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 82 + + Capability Shader + Capability ImageCubeArray + Capability SparseResidency + Capability Image1D + Capability ImageReadWriteLodAMD + Extension "SPV_AMD_shader_image_load_store_lod" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 77 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_AMD_shader_image_load_store_lod" + Name 4 "main" + Name 9 "f4" + Name 14 "i1D" + Name 24 "i2D" + Name 34 "i3D" + Name 46 "iiCube" + Name 53 "ii1DArray" + Name 60 "ui2DArray" + Name 64 "u4" + Name 65 "ResType" + Name 71 "uiCubeArray" + Name 77 "fragColor" + Decorate 14(i1D) DescriptorSet 0 + Decorate 14(i1D) Binding 0 + Decorate 24(i2D) DescriptorSet 0 + Decorate 24(i2D) Binding 1 + Decorate 34(i3D) DescriptorSet 0 + Decorate 34(i3D) Binding 2 + Decorate 46(iiCube) DescriptorSet 0 + Decorate 46(iiCube) Binding 3 + Decorate 53(ii1DArray) DescriptorSet 0 + Decorate 53(ii1DArray) Binding 4 + Decorate 60(ui2DArray) DescriptorSet 0 + Decorate 60(ui2DArray) Binding 5 + Decorate 71(uiCubeArray) DescriptorSet 0 + Decorate 71(uiCubeArray) Binding 6 + Decorate 77(fragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: 6(float) Constant 0 + 11: 7(fvec4) ConstantComposite 10 10 10 10 + 12: TypeImage 6(float) 1D nonsampled format:Rgba32f + 13: TypePointer UniformConstant 12 + 14(i1D): 13(ptr) Variable UniformConstant + 16: TypeInt 32 1 + 17: 16(int) Constant 1 + 18: 16(int) Constant 3 + 22: TypeImage 6(float) 2D nonsampled format:Rgba32f + 23: TypePointer UniformConstant 22 + 24(i2D): 23(ptr) Variable UniformConstant + 26: TypeVector 16(int) 2 + 27: 16(int) Constant 2 + 28: 26(ivec2) ConstantComposite 27 18 + 32: TypeImage 6(float) 3D nonsampled format:Rgba32f + 33: TypePointer UniformConstant 32 + 34(i3D): 33(ptr) Variable UniformConstant + 36: TypeVector 16(int) 3 + 37: 16(int) Constant 4 + 38: 16(int) Constant 5 + 39: 16(int) Constant 6 + 40: 36(ivec3) ConstantComposite 37 38 39 + 44: TypeImage 16(int) Cube nonsampled format:Rgba32i + 45: TypePointer UniformConstant 44 + 46(iiCube): 45(ptr) Variable UniformConstant + 49: TypeVector 16(int) 4 + 51: TypeImage 16(int) 1D array nonsampled format:Rgba32i + 52: TypePointer UniformConstant 51 + 53(ii1DArray): 52(ptr) Variable UniformConstant + 57: TypeInt 32 0 + 58: TypeImage 57(int) 2D array nonsampled format:Rgba32ui + 59: TypePointer UniformConstant 58 + 60(ui2DArray): 59(ptr) Variable UniformConstant + 62: TypeVector 57(int) 4 + 63: TypePointer Function 62(ivec4) + 65(ResType): TypeStruct 16(int) 62(ivec4) + 69: TypeImage 57(int) Cube array nonsampled format:Rgba32ui + 70: TypePointer UniformConstant 69 + 71(uiCubeArray): 70(ptr) Variable UniformConstant + 76: TypePointer Output 7(fvec4) + 77(fragColor): 76(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 9(f4): 8(ptr) Variable Function + 64(u4): 63(ptr) Variable Function + Store 9(f4) 11 + 15: 12 Load 14(i1D) + 19: 7(fvec4) ImageRead 15 17 Lod 18 + 20: 7(fvec4) Load 9(f4) + 21: 7(fvec4) FAdd 20 19 + Store 9(f4) 21 + 25: 22 Load 24(i2D) + 29: 7(fvec4) ImageRead 25 28 Lod 18 + 30: 7(fvec4) Load 9(f4) + 31: 7(fvec4) FAdd 30 29 + Store 9(f4) 31 + 35: 32 Load 34(i3D) + 41: 7(fvec4) ImageRead 35 40 Lod 18 + 42: 7(fvec4) Load 9(f4) + 43: 7(fvec4) FAdd 42 41 + Store 9(f4) 43 + 47: 44 Load 46(iiCube) + 48: 7(fvec4) Load 9(f4) + 50: 49(ivec4) ConvertFToS 48 + ImageWrite 47 40 50 Lod 18 + 54: 51 Load 53(ii1DArray) + 55: 7(fvec4) Load 9(f4) + 56: 49(ivec4) ConvertFToS 55 + ImageWrite 54 28 56 Lod 18 + 61: 58 Load 60(ui2DArray) + 66: 65(ResType) ImageSparseRead 61 40 Lod 18 + 67: 62(ivec4) CompositeExtract 66 1 + Store 64(u4) 67 + 68: 16(int) CompositeExtract 66 0 + 72: 69 Load 71(uiCubeArray) + 73: 65(ResType) ImageSparseRead 72 40 Lod 18 + 74: 62(ivec4) CompositeExtract 73 1 + Store 64(u4) 74 + 75: 16(int) CompositeExtract 73 0 + 78: 7(fvec4) Load 9(f4) + 79: 62(ivec4) Load 64(u4) + 80: 7(fvec4) ConvertUToF 79 + 81: 7(fvec4) FAdd 78 80 + Store 77(fragColor) 81 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.int16.amd.frag.out b/deps/glslang/Test/baseResults/spv.int16.amd.frag.out new file mode 100644 index 00000000..0e3323bf --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.int16.amd.frag.out @@ -0,0 +1,803 @@ +spv.int16.amd.frag +error: SPIRV-Tools Validation Errors +error: Capability Float16 is not allowed by Vulkan 1.0 specification (or requires extension) + OpCapability Float16 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 560 + + Capability Shader + Capability Float16 + Capability Float64 + Capability Int64 + Capability Int16 + Capability StorageUniform16 + Capability StorageInputOutput16 + Extension "SPV_AMD_gpu_shader_int16" + Extension "SPV_KHR_16bit_storage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 519 521 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_AMD_gpu_shader_half_float" + SourceExtension "GL_AMD_gpu_shader_int16" + SourceExtension "GL_ARB_gpu_shader_int64" + Name 4 "main" + Name 6 "literal(" + Name 8 "operators(" + Name 10 "typeCast(" + Name 12 "builtinFuncs(" + Name 16 "u16" + Name 25 "Uniforms" + MemberName 25(Uniforms) 0 "i" + Name 27 "" + Name 34 "indexable" + Name 45 "indexable" + Name 51 "u16v" + Name 57 "i16" + Name 70 "u16" + Name 127 "b" + Name 148 "u" + Name 159 "i" + Name 189 "i16v" + Name 192 "bv" + Name 200 "u16v" + Name 213 "iv" + Name 226 "uv" + Name 240 "fv" + Name 252 "dv" + Name 264 "f16v" + Name 276 "i64v" + Name 290 "u64v" + Name 305 "i16v" + Name 311 "i16" + Name 319 "u16v" + Name 321 "u16" + Name 393 "f16v" + Name 396 "exp" + Name 397 "ResType" + Name 418 "packi" + Name 423 "packu" + Name 432 "packi64" + Name 441 "packu64" + Name 450 "bv" + Name 515 "Block" + MemberName 515(Block) 0 "i16v" + MemberName 515(Block) 1 "u16" + Name 517 "block" + Name 519 "iu16v" + Name 521 "ii16" + Name 522 "si64" + Name 523 "su64" + Name 524 "si" + Name 525 "su" + Name 526 "sb" + Name 527 "si16" + Name 528 "su16" + Name 529 "i16_to_b" + Name 530 "u16_to_b" + Name 531 "b_to_i16" + Name 532 "b_to_u16" + Name 533 "i16_to_i" + Name 535 "u16_to_i" + Name 536 "i_to_i16" + Name 538 "i_to_u16" + Name 540 "i16_to_u" + Name 541 "u16_to_u" + Name 543 "u_to_i16" + Name 544 "u_to_u16" + Name 545 "i16_to_i64" + Name 548 "u16_to_i64" + Name 549 "i64_to_i16" + Name 551 "i64_to_u16" + Name 553 "i16_to_u64" + Name 554 "u16_to_u64" + Name 556 "u64_to_i16" + Name 557 "u64_to_u16" + Name 558 "i16_to_u16" + Name 559 "u16_to_i16" + MemberDecorate 25(Uniforms) 0 Offset 0 + Decorate 25(Uniforms) Block + Decorate 27 DescriptorSet 0 + Decorate 27 Binding 0 + MemberDecorate 515(Block) 0 Offset 0 + MemberDecorate 515(Block) 1 Offset 6 + Decorate 515(Block) Block + Decorate 517(block) DescriptorSet 0 + Decorate 517(block) Binding 1 + Decorate 519(iu16v) Flat + Decorate 519(iu16v) Location 0 + Decorate 521(ii16) Flat + Decorate 521(ii16) Location 1 + Decorate 522(si64) SpecId 100 + Decorate 523(su64) SpecId 101 + Decorate 524(si) SpecId 102 + Decorate 525(su) SpecId 103 + Decorate 526(sb) SpecId 104 + Decorate 527(si16) SpecId 105 + Decorate 528(su16) SpecId 106 + 2: TypeVoid + 3: TypeFunction 2 + 14: TypeInt 16 0 + 15: TypePointer Function 14(int16_t) + 17: TypeInt 16 1 + 18: TypeInt 32 0 + 19: 18(int) Constant 3 + 20: TypeArray 17(int16_t) 19 + 21: 17(int16_t) Constant 273 + 22: 17(int16_t) Constant 4294967294 + 23: 17(int16_t) Constant 256 + 24: 20 ConstantComposite 21 22 23 + 25(Uniforms): TypeStruct 18(int) + 26: TypePointer Uniform 25(Uniforms) + 27: 26(ptr) Variable Uniform + 28: TypeInt 32 1 + 29: 28(int) Constant 0 + 30: TypePointer Uniform 18(int) + 33: TypePointer Function 20 + 35: TypePointer Function 17(int16_t) + 39: TypeArray 14(int16_t) 19 + 40: 14(int16_t) Constant 65535 + 41: 39 ConstantComposite 40 40 40 + 44: TypePointer Function 39 + 49: TypeVector 14(int16_t) 3 + 50: TypePointer Function 49(i16vec3) + 53: 17(int16_t) Constant 1 + 54: TypeVector 17(int16_t) 3 + 111: 18(int) Constant 1 + 117: 18(int) Constant 2 + 125: TypeBool + 126: TypePointer Function 125(bool) + 128: 18(int) Constant 0 + 147: TypePointer Function 18(int) + 158: TypePointer Function 28(int) + 187: TypeVector 17(int16_t) 2 + 188: TypePointer Function 187(i16vec2) + 190: TypeVector 125(bool) 2 + 191: TypePointer Function 190(bvec2) + 194: 17(int16_t) Constant 0 + 195:187(i16vec2) ConstantComposite 194 194 + 196:187(i16vec2) ConstantComposite 53 53 + 198: TypeVector 14(int16_t) 2 + 199: TypePointer Function 198(i16vec2) + 202: 14(int16_t) Constant 0 + 203: 14(int16_t) Constant 1 + 204:198(i16vec2) ConstantComposite 202 202 + 205:198(i16vec2) ConstantComposite 203 203 + 211: TypeVector 28(int) 2 + 212: TypePointer Function 211(ivec2) + 222: TypeVector 18(int) 2 + 225: TypePointer Function 222(ivec2) + 237: TypeFloat 32 + 238: TypeVector 237(float) 2 + 239: TypePointer Function 238(fvec2) + 249: TypeFloat 64 + 250: TypeVector 249(float64_t) 2 + 251: TypePointer Function 250(f64vec2) + 261: TypeFloat 16 + 262: TypeVector 261(float16_t) 2 + 263: TypePointer Function 262(f16vec2) + 273: TypeInt 64 1 + 274: TypeVector 273(int64_t) 2 + 275: TypePointer Function 274(i64vec2) + 285: TypeInt 64 0 + 286: TypeVector 285(int64_t) 2 + 289: TypePointer Function 286(i64vec2) + 316: 17(int16_t) Constant 4294967295 + 317:187(i16vec2) ConstantComposite 316 316 + 326: 49(i16vec3) ConstantComposite 202 202 202 + 368: 125(bool) ConstantTrue + 375: 125(bool) ConstantFalse + 376: 190(bvec2) ConstantComposite 375 375 + 388: TypeVector 125(bool) 3 + 389: 388(bvec3) ConstantComposite 375 375 375 + 391: TypeVector 261(float16_t) 3 + 392: TypePointer Function 391(f16vec3) + 395: TypePointer Function 54(i16vec3) + 397(ResType): TypeStruct 391(f16vec3) 54(i16vec3) + 407: TypePointer Function 261(float16_t) + 431: TypePointer Function 273(int64_t) + 434: TypeVector 17(int16_t) 4 + 440: TypePointer Function 285(int64_t) + 443: TypeVector 14(int16_t) 4 + 449: TypePointer Function 388(bvec3) + 515(Block): TypeStruct 54(i16vec3) 14(int16_t) + 516: TypePointer Uniform 515(Block) + 517(block): 516(ptr) Variable Uniform + 518: TypePointer Input 49(i16vec3) + 519(iu16v): 518(ptr) Variable Input + 520: TypePointer Input 17(int16_t) + 521(ii16): 520(ptr) Variable Input + 522(si64):273(int64_t) SpecConstant 4294967286 4294967295 + 523(su64):285(int64_t) SpecConstant 20 0 + 524(si): 28(int) SpecConstant 4294967291 + 525(su): 18(int) SpecConstant 4 + 526(sb): 125(bool) SpecConstantTrue + 527(si16): 17(int16_t) SpecConstant 4294967291 + 528(su16): 14(int16_t) SpecConstant 4 + 529(i16_to_b): 125(bool) SpecConstantOp 171 527(si16) 202 + 530(u16_to_b): 125(bool) SpecConstantOp 171 528(su16) 202 + 531(b_to_i16): 17(int16_t) SpecConstantOp 169 526(sb) 53 194 + 532(b_to_u16): 14(int16_t) SpecConstantOp 169 526(sb) 203 202 + 533(i16_to_i): 28(int) SpecConstantOp 114 527(si16) + 534: 18(int) SpecConstantOp 113 528(su16) + 535(u16_to_i): 28(int) SpecConstantOp 128 534 128 + 536(i_to_i16): 17(int16_t) SpecConstantOp 114 524(si) + 537: 17(int16_t) SpecConstantOp 114 524(si) + 538(i_to_u16): 14(int16_t) SpecConstantOp 128 537 202 + 539: 28(int) SpecConstantOp 114 527(si16) + 540(i16_to_u): 18(int) SpecConstantOp 128 539 128 + 541(u16_to_u): 18(int) SpecConstantOp 113 528(su16) + 542: 14(int16_t) SpecConstantOp 113 525(su) + 543(u_to_i16): 17(int16_t) SpecConstantOp 128 542 202 + 544(u_to_u16): 14(int16_t) SpecConstantOp 113 525(su) + 545(i16_to_i64):273(int64_t) SpecConstantOp 114 527(si16) + 546:285(int64_t) SpecConstantOp 113 528(su16) + 547:285(int64_t) Constant 0 0 + 548(u16_to_i64):273(int64_t) SpecConstantOp 128 546 547 + 549(i64_to_i16): 17(int16_t) SpecConstantOp 114 522(si64) + 550: 17(int16_t) SpecConstantOp 114 522(si64) + 551(i64_to_u16): 14(int16_t) SpecConstantOp 128 550 202 + 552:273(int64_t) SpecConstantOp 114 527(si16) + 553(i16_to_u64):285(int64_t) SpecConstantOp 128 552 547 + 554(u16_to_u64):285(int64_t) SpecConstantOp 113 528(su16) + 555: 14(int16_t) SpecConstantOp 113 523(su64) + 556(u64_to_i16): 17(int16_t) SpecConstantOp 128 555 202 + 557(u64_to_u16): 14(int16_t) SpecConstantOp 113 523(su64) + 558(i16_to_u16): 14(int16_t) SpecConstantOp 128 527(si16) 202 + 559(u16_to_i16): 17(int16_t) SpecConstantOp 128 528(su16) 202 + 4(main): 2 Function None 3 + 5: Label + 511: 2 FunctionCall 6(literal() + 512: 2 FunctionCall 8(operators() + 513: 2 FunctionCall 10(typeCast() + 514: 2 FunctionCall 12(builtinFuncs() + Return + FunctionEnd + 6(literal(): 2 Function None 3 + 7: Label + 16(u16): 15(ptr) Variable Function + 34(indexable): 33(ptr) Variable Function + 45(indexable): 44(ptr) Variable Function + 31: 30(ptr) AccessChain 27 29 + 32: 18(int) Load 31 + Store 34(indexable) 24 + 36: 35(ptr) AccessChain 34(indexable) 32 + 37: 17(int16_t) Load 36 + 38: 14(int16_t) Bitcast 37 + 42: 30(ptr) AccessChain 27 29 + 43: 18(int) Load 42 + Store 45(indexable) 41 + 46: 15(ptr) AccessChain 45(indexable) 43 + 47: 14(int16_t) Load 46 + 48: 14(int16_t) IAdd 38 47 + Store 16(u16) 48 + Return + FunctionEnd + 8(operators(): 2 Function None 3 + 9: Label + 51(u16v): 50(ptr) Variable Function + 57(i16): 35(ptr) Variable Function + 70(u16): 15(ptr) Variable Function + 127(b): 126(ptr) Variable Function + 148(u): 147(ptr) Variable Function + 159(i): 158(ptr) Variable Function + 52: 49(i16vec3) Load 51(u16v) + 55: 54(i16vec3) CompositeConstruct 53 53 53 + 56: 49(i16vec3) IAdd 52 55 + Store 51(u16v) 56 + 58: 17(int16_t) Load 57(i16) + 59: 17(int16_t) ISub 58 53 + Store 57(i16) 59 + 60: 17(int16_t) Load 57(i16) + 61: 17(int16_t) IAdd 60 53 + Store 57(i16) 61 + 62: 49(i16vec3) Load 51(u16v) + 63: 54(i16vec3) CompositeConstruct 53 53 53 + 64: 49(i16vec3) ISub 62 63 + Store 51(u16v) 64 + 65: 49(i16vec3) Load 51(u16v) + 66: 49(i16vec3) Not 65 + Store 51(u16v) 66 + 67: 17(int16_t) Load 57(i16) + Store 57(i16) 67 + 68: 49(i16vec3) Load 51(u16v) + 69: 49(i16vec3) SNegate 68 + Store 51(u16v) 69 + 71: 17(int16_t) Load 57(i16) + 72: 14(int16_t) Bitcast 71 + 73: 14(int16_t) Load 70(u16) + 74: 14(int16_t) IAdd 73 72 + Store 70(u16) 74 + 75: 49(i16vec3) Load 51(u16v) + 76: 49(i16vec3) Load 51(u16v) + 77: 49(i16vec3) ISub 76 75 + Store 51(u16v) 77 + 78: 17(int16_t) Load 57(i16) + 79: 17(int16_t) Load 57(i16) + 80: 17(int16_t) IMul 79 78 + Store 57(i16) 80 + 81: 49(i16vec3) Load 51(u16v) + 82: 49(i16vec3) Load 51(u16v) + 83: 49(i16vec3) UDiv 82 81 + Store 51(u16v) 83 + 84: 17(int16_t) Load 57(i16) + 85: 14(int16_t) Bitcast 84 + 86: 49(i16vec3) Load 51(u16v) + 87: 49(i16vec3) CompositeConstruct 85 85 85 + 88: 49(i16vec3) UMod 86 87 + Store 51(u16v) 88 + 89: 49(i16vec3) Load 51(u16v) + 90: 49(i16vec3) Load 51(u16v) + 91: 49(i16vec3) IAdd 89 90 + Store 51(u16v) 91 + 92: 17(int16_t) Load 57(i16) + 93: 14(int16_t) Bitcast 92 + 94: 14(int16_t) Load 70(u16) + 95: 14(int16_t) ISub 93 94 + Store 70(u16) 95 + 96: 49(i16vec3) Load 51(u16v) + 97: 17(int16_t) Load 57(i16) + 98: 14(int16_t) Bitcast 97 + 99: 49(i16vec3) CompositeConstruct 98 98 98 + 100: 49(i16vec3) IMul 96 99 + Store 51(u16v) 100 + 101: 17(int16_t) Load 57(i16) + 102: 17(int16_t) Load 57(i16) + 103: 17(int16_t) IMul 101 102 + Store 57(i16) 103 + 104: 17(int16_t) Load 57(i16) + 105: 17(int16_t) Load 57(i16) + 106: 17(int16_t) SMod 104 105 + Store 57(i16) 106 + 107: 17(int16_t) Load 57(i16) + 108: 49(i16vec3) Load 51(u16v) + 109: 54(i16vec3) CompositeConstruct 107 107 107 + 110: 49(i16vec3) ShiftLeftLogical 108 109 + Store 51(u16v) 110 + 112: 15(ptr) AccessChain 51(u16v) 111 + 113: 14(int16_t) Load 112 + 114: 17(int16_t) Load 57(i16) + 115: 17(int16_t) ShiftRightArithmetic 114 113 + Store 57(i16) 115 + 116: 17(int16_t) Load 57(i16) + 118: 15(ptr) AccessChain 51(u16v) 117 + 119: 14(int16_t) Load 118 + 120: 17(int16_t) ShiftLeftLogical 116 119 + Store 57(i16) 120 + 121: 49(i16vec3) Load 51(u16v) + 122: 17(int16_t) Load 57(i16) + 123: 54(i16vec3) CompositeConstruct 122 122 122 + 124: 49(i16vec3) ShiftLeftLogical 121 123 + Store 51(u16v) 124 + 129: 15(ptr) AccessChain 51(u16v) 128 + 130: 14(int16_t) Load 129 + 131: 17(int16_t) Load 57(i16) + 132: 14(int16_t) Bitcast 131 + 133: 125(bool) INotEqual 130 132 + Store 127(b) 133 + 134: 17(int16_t) Load 57(i16) + 135: 14(int16_t) Bitcast 134 + 136: 15(ptr) AccessChain 51(u16v) 128 + 137: 14(int16_t) Load 136 + 138: 125(bool) IEqual 135 137 + Store 127(b) 138 + 139: 15(ptr) AccessChain 51(u16v) 128 + 140: 14(int16_t) Load 139 + 141: 15(ptr) AccessChain 51(u16v) 111 + 142: 14(int16_t) Load 141 + 143: 125(bool) UGreaterThan 140 142 + Store 127(b) 143 + 144: 17(int16_t) Load 57(i16) + 145: 28(int) SConvert 144 + 146: 18(int) Bitcast 145 + 149: 18(int) Load 148(u) + 150: 125(bool) ULessThan 146 149 + Store 127(b) 150 + 151: 15(ptr) AccessChain 51(u16v) 111 + 152: 14(int16_t) Load 151 + 153: 15(ptr) AccessChain 51(u16v) 128 + 154: 14(int16_t) Load 153 + 155: 125(bool) UGreaterThanEqual 152 154 + Store 127(b) 155 + 156: 17(int16_t) Load 57(i16) + 157: 28(int) SConvert 156 + 160: 28(int) Load 159(i) + 161: 125(bool) SLessThanEqual 157 160 + Store 127(b) 161 + 162: 17(int16_t) Load 57(i16) + 163: 14(int16_t) Bitcast 162 + 164: 49(i16vec3) Load 51(u16v) + 165: 49(i16vec3) CompositeConstruct 163 163 163 + 166: 49(i16vec3) BitwiseOr 164 165 + Store 51(u16v) 166 + 167: 17(int16_t) Load 57(i16) + 168: 14(int16_t) Bitcast 167 + 169: 14(int16_t) Load 70(u16) + 170: 14(int16_t) BitwiseOr 168 169 + Store 70(u16) 170 + 171: 17(int16_t) Load 57(i16) + 172: 17(int16_t) Load 57(i16) + 173: 17(int16_t) BitwiseAnd 172 171 + Store 57(i16) 173 + 174: 49(i16vec3) Load 51(u16v) + 175: 49(i16vec3) Load 51(u16v) + 176: 49(i16vec3) BitwiseAnd 174 175 + Store 51(u16v) 176 + 177: 17(int16_t) Load 57(i16) + 178: 14(int16_t) Bitcast 177 + 179: 49(i16vec3) Load 51(u16v) + 180: 49(i16vec3) CompositeConstruct 178 178 178 + 181: 49(i16vec3) BitwiseXor 179 180 + Store 51(u16v) 181 + 182: 49(i16vec3) Load 51(u16v) + 183: 17(int16_t) Load 57(i16) + 184: 14(int16_t) Bitcast 183 + 185: 49(i16vec3) CompositeConstruct 184 184 184 + 186: 49(i16vec3) BitwiseXor 182 185 + Store 51(u16v) 186 + Return + FunctionEnd + 10(typeCast(): 2 Function None 3 + 11: Label + 189(i16v): 188(ptr) Variable Function + 192(bv): 191(ptr) Variable Function + 200(u16v): 199(ptr) Variable Function + 213(iv): 212(ptr) Variable Function + 226(uv): 225(ptr) Variable Function + 240(fv): 239(ptr) Variable Function + 252(dv): 251(ptr) Variable Function + 264(f16v): 263(ptr) Variable Function + 276(i64v): 275(ptr) Variable Function + 290(u64v): 289(ptr) Variable Function + 193: 190(bvec2) Load 192(bv) + 197:187(i16vec2) Select 193 196 195 + Store 189(i16v) 197 + 201: 190(bvec2) Load 192(bv) + 206:198(i16vec2) Select 201 205 204 + Store 200(u16v) 206 + 207:187(i16vec2) Load 189(i16v) + 208: 190(bvec2) INotEqual 207 204 + Store 192(bv) 208 + 209:198(i16vec2) Load 200(u16v) + 210: 190(bvec2) INotEqual 209 204 + Store 192(bv) 210 + 214: 211(ivec2) Load 213(iv) + 215:187(i16vec2) SConvert 214 + Store 189(i16v) 215 + 216: 211(ivec2) Load 213(iv) + 217:187(i16vec2) SConvert 216 + 218:198(i16vec2) Bitcast 217 + Store 200(u16v) 218 + 219:187(i16vec2) Load 189(i16v) + 220: 211(ivec2) SConvert 219 + Store 213(iv) 220 + 221:198(i16vec2) Load 200(u16v) + 223: 222(ivec2) UConvert 221 + 224: 211(ivec2) Bitcast 223 + Store 213(iv) 224 + 227: 222(ivec2) Load 226(uv) + 228:198(i16vec2) UConvert 227 + 229:187(i16vec2) Bitcast 228 + Store 189(i16v) 229 + 230: 222(ivec2) Load 226(uv) + 231:198(i16vec2) UConvert 230 + Store 200(u16v) 231 + 232:187(i16vec2) Load 189(i16v) + 233: 211(ivec2) SConvert 232 + 234: 222(ivec2) Bitcast 233 + Store 226(uv) 234 + 235:198(i16vec2) Load 200(u16v) + 236: 222(ivec2) UConvert 235 + Store 226(uv) 236 + 241: 238(fvec2) Load 240(fv) + 242:187(i16vec2) ConvertFToS 241 + Store 189(i16v) 242 + 243: 238(fvec2) Load 240(fv) + 244:198(i16vec2) ConvertFToU 243 + Store 200(u16v) 244 + 245:187(i16vec2) Load 189(i16v) + 246: 238(fvec2) ConvertSToF 245 + Store 240(fv) 246 + 247:198(i16vec2) Load 200(u16v) + 248: 238(fvec2) ConvertUToF 247 + Store 240(fv) 248 + 253:250(f64vec2) Load 252(dv) + 254:187(i16vec2) ConvertFToS 253 + Store 189(i16v) 254 + 255:250(f64vec2) Load 252(dv) + 256:198(i16vec2) ConvertFToU 255 + Store 200(u16v) 256 + 257:187(i16vec2) Load 189(i16v) + 258:250(f64vec2) ConvertSToF 257 + Store 252(dv) 258 + 259:198(i16vec2) Load 200(u16v) + 260:250(f64vec2) ConvertUToF 259 + Store 252(dv) 260 + 265:262(f16vec2) Load 264(f16v) + 266:187(i16vec2) ConvertFToS 265 + Store 189(i16v) 266 + 267:262(f16vec2) Load 264(f16v) + 268:198(i16vec2) ConvertFToU 267 + Store 200(u16v) 268 + 269:187(i16vec2) Load 189(i16v) + 270:262(f16vec2) ConvertSToF 269 + Store 264(f16v) 270 + 271:198(i16vec2) Load 200(u16v) + 272:262(f16vec2) ConvertUToF 271 + Store 264(f16v) 272 + 277:274(i64vec2) Load 276(i64v) + 278:187(i16vec2) SConvert 277 + Store 189(i16v) 278 + 279:274(i64vec2) Load 276(i64v) + 280:187(i16vec2) SConvert 279 + 281:198(i16vec2) Bitcast 280 + Store 200(u16v) 281 + 282:187(i16vec2) Load 189(i16v) + 283:274(i64vec2) SConvert 282 + Store 276(i64v) 283 + 284:198(i16vec2) Load 200(u16v) + 287:286(i64vec2) UConvert 284 + 288:274(i64vec2) Bitcast 287 + Store 276(i64v) 288 + 291:286(i64vec2) Load 290(u64v) + 292:198(i16vec2) UConvert 291 + 293:187(i16vec2) Bitcast 292 + Store 189(i16v) 293 + 294:286(i64vec2) Load 290(u64v) + 295:198(i16vec2) UConvert 294 + Store 200(u16v) 295 + 296:187(i16vec2) Load 189(i16v) + 297:274(i64vec2) SConvert 296 + 298:286(i64vec2) Bitcast 297 + Store 290(u64v) 298 + 299:198(i16vec2) Load 200(u16v) + 300:286(i64vec2) UConvert 299 + Store 290(u64v) 300 + 301:198(i16vec2) Load 200(u16v) + 302:187(i16vec2) Bitcast 301 + Store 189(i16v) 302 + 303:187(i16vec2) Load 189(i16v) + 304:198(i16vec2) Bitcast 303 + Store 200(u16v) 304 + Return + FunctionEnd +12(builtinFuncs(): 2 Function None 3 + 13: Label + 305(i16v): 188(ptr) Variable Function + 311(i16): 35(ptr) Variable Function + 319(u16v): 50(ptr) Variable Function + 321(u16): 15(ptr) Variable Function + 393(f16v): 392(ptr) Variable Function + 396(exp): 395(ptr) Variable Function + 418(packi): 158(ptr) Variable Function + 423(packu): 147(ptr) Variable Function + 432(packi64): 431(ptr) Variable Function + 441(packu64): 440(ptr) Variable Function + 450(bv): 449(ptr) Variable Function + 306:187(i16vec2) Load 305(i16v) + 307:187(i16vec2) ExtInst 1(GLSL.std.450) 5(SAbs) 306 + Store 305(i16v) 307 + 308:187(i16vec2) Load 305(i16v) + 309:187(i16vec2) ExtInst 1(GLSL.std.450) 7(SSign) 308 + Store 305(i16v) 309 + 310:187(i16vec2) Load 305(i16v) + 312: 17(int16_t) Load 311(i16) + 313:187(i16vec2) CompositeConstruct 312 312 + 314:187(i16vec2) ExtInst 1(GLSL.std.450) 39(SMin) 310 313 + Store 305(i16v) 314 + 315:187(i16vec2) Load 305(i16v) + 318:187(i16vec2) ExtInst 1(GLSL.std.450) 39(SMin) 315 317 + Store 305(i16v) 318 + 320: 49(i16vec3) Load 319(u16v) + 322: 14(int16_t) Load 321(u16) + 323: 49(i16vec3) CompositeConstruct 322 322 322 + 324: 49(i16vec3) ExtInst 1(GLSL.std.450) 38(UMin) 320 323 + Store 319(u16v) 324 + 325: 49(i16vec3) Load 319(u16v) + 327: 49(i16vec3) ExtInst 1(GLSL.std.450) 38(UMin) 325 326 + Store 319(u16v) 327 + 328:187(i16vec2) Load 305(i16v) + 329: 17(int16_t) Load 311(i16) + 330:187(i16vec2) CompositeConstruct 329 329 + 331:187(i16vec2) ExtInst 1(GLSL.std.450) 42(SMax) 328 330 + Store 305(i16v) 331 + 332:187(i16vec2) Load 305(i16v) + 333:187(i16vec2) ExtInst 1(GLSL.std.450) 42(SMax) 332 317 + Store 305(i16v) 333 + 334: 49(i16vec3) Load 319(u16v) + 335: 14(int16_t) Load 321(u16) + 336: 49(i16vec3) CompositeConstruct 335 335 335 + 337: 49(i16vec3) ExtInst 1(GLSL.std.450) 41(UMax) 334 336 + Store 319(u16v) 337 + 338: 49(i16vec3) Load 319(u16v) + 339: 49(i16vec3) ExtInst 1(GLSL.std.450) 41(UMax) 338 326 + Store 319(u16v) 339 + 340:187(i16vec2) Load 305(i16v) + 341: 17(int16_t) Load 311(i16) + 342: 17(int16_t) SNegate 341 + 343: 17(int16_t) Load 311(i16) + 344:187(i16vec2) CompositeConstruct 342 342 + 345:187(i16vec2) CompositeConstruct 343 343 + 346:187(i16vec2) ExtInst 1(GLSL.std.450) 45(SClamp) 340 344 345 + Store 305(i16v) 346 + 347:187(i16vec2) Load 305(i16v) + 348:187(i16vec2) Load 305(i16v) + 349:187(i16vec2) SNegate 348 + 350:187(i16vec2) Load 305(i16v) + 351:187(i16vec2) ExtInst 1(GLSL.std.450) 45(SClamp) 347 349 350 + Store 305(i16v) 351 + 352: 49(i16vec3) Load 319(u16v) + 353: 14(int16_t) Load 321(u16) + 354: 14(int16_t) SNegate 353 + 355: 14(int16_t) Load 321(u16) + 356: 49(i16vec3) CompositeConstruct 354 354 354 + 357: 49(i16vec3) CompositeConstruct 355 355 355 + 358: 49(i16vec3) ExtInst 1(GLSL.std.450) 44(UClamp) 352 356 357 + Store 319(u16v) 358 + 359: 49(i16vec3) Load 319(u16v) + 360: 49(i16vec3) Load 319(u16v) + 361: 49(i16vec3) SNegate 360 + 362: 49(i16vec3) Load 319(u16v) + 363: 49(i16vec3) ExtInst 1(GLSL.std.450) 44(UClamp) 359 361 362 + Store 319(u16v) 363 + 364: 35(ptr) AccessChain 305(i16v) 128 + 365: 17(int16_t) Load 364 + 366: 35(ptr) AccessChain 305(i16v) 111 + 367: 17(int16_t) Load 366 + 369: 17(int16_t) Select 368 367 365 + Store 311(i16) 369 + 370: 17(int16_t) Load 311(i16) + 371:187(i16vec2) CompositeConstruct 370 370 + 372: 17(int16_t) Load 311(i16) + 373: 17(int16_t) SNegate 372 + 374:187(i16vec2) CompositeConstruct 373 373 + 377:187(i16vec2) Select 376 374 371 + Store 305(i16v) 377 + 378: 15(ptr) AccessChain 319(u16v) 128 + 379: 14(int16_t) Load 378 + 380: 15(ptr) AccessChain 319(u16v) 111 + 381: 14(int16_t) Load 380 + 382: 14(int16_t) Select 368 381 379 + Store 321(u16) 382 + 383: 14(int16_t) Load 321(u16) + 384: 49(i16vec3) CompositeConstruct 383 383 383 + 385: 14(int16_t) Load 321(u16) + 386: 14(int16_t) SNegate 385 + 387: 49(i16vec3) CompositeConstruct 386 386 386 + 390: 49(i16vec3) Select 389 387 384 + Store 319(u16v) 390 + 394:391(f16vec3) Load 393(f16v) + 398:397(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 394 + 399: 54(i16vec3) CompositeExtract 398 1 + Store 396(exp) 399 + 400:391(f16vec3) CompositeExtract 398 0 + Store 393(f16v) 400 + 401:391(f16vec3) Load 393(f16v) + 402: 54(i16vec3) Load 396(exp) + 403:391(f16vec3) ExtInst 1(GLSL.std.450) 53(Ldexp) 401 402 + Store 393(f16v) 403 + 404:391(f16vec3) Load 393(f16v) + 405:262(f16vec2) VectorShuffle 404 404 0 1 + 406:187(i16vec2) Bitcast 405 + Store 305(i16v) 406 + 408: 407(ptr) AccessChain 393(f16v) 117 + 409:261(float16_t) Load 408 + 410: 14(int16_t) Bitcast 409 + 411: 15(ptr) AccessChain 319(u16v) 128 + Store 411 410 + 412:187(i16vec2) Load 305(i16v) + 413:262(f16vec2) Bitcast 412 + 414:391(f16vec3) Load 393(f16v) + 415:391(f16vec3) VectorShuffle 414 413 3 4 2 + Store 393(f16v) 415 + 416: 49(i16vec3) Load 319(u16v) + 417:391(f16vec3) Bitcast 416 + Store 393(f16v) 417 + 419:187(i16vec2) Load 305(i16v) + 420: 28(int) Bitcast 419 + Store 418(packi) 420 + 421: 28(int) Load 418(packi) + 422:187(i16vec2) Bitcast 421 + Store 305(i16v) 422 + 424: 49(i16vec3) Load 319(u16v) + 425:198(i16vec2) VectorShuffle 424 424 0 1 + 426: 18(int) Bitcast 425 + Store 423(packu) 426 + 427: 18(int) Load 423(packu) + 428:198(i16vec2) Bitcast 427 + 429: 49(i16vec3) Load 319(u16v) + 430: 49(i16vec3) VectorShuffle 429 428 3 4 2 + Store 319(u16v) 430 + 433: 17(int16_t) Load 311(i16) + 435:434(i16vec4) CompositeConstruct 433 433 433 433 + 436:273(int64_t) Bitcast 435 + Store 432(packi64) 436 + 437:273(int64_t) Load 432(packi64) + 438:434(i16vec4) Bitcast 437 + 439:187(i16vec2) VectorShuffle 438 438 0 1 + Store 305(i16v) 439 + 442: 14(int16_t) Load 321(u16) + 444:443(i16vec4) CompositeConstruct 442 442 442 442 + 445:285(int64_t) Bitcast 444 + Store 441(packu64) 445 + 446:285(int64_t) Load 441(packu64) + 447:443(i16vec4) Bitcast 446 + 448: 49(i16vec3) VectorShuffle 447 447 0 1 2 + Store 319(u16v) 448 + 451: 49(i16vec3) Load 319(u16v) + 452: 14(int16_t) Load 321(u16) + 453: 49(i16vec3) CompositeConstruct 452 452 452 + 454: 388(bvec3) ULessThan 451 453 + Store 450(bv) 454 + 455:187(i16vec2) Load 305(i16v) + 456: 17(int16_t) Load 311(i16) + 457:187(i16vec2) CompositeConstruct 456 456 + 458: 190(bvec2) SLessThan 455 457 + 459: 388(bvec3) Load 450(bv) + 460: 388(bvec3) VectorShuffle 459 458 3 4 2 + Store 450(bv) 460 + 461: 49(i16vec3) Load 319(u16v) + 462: 14(int16_t) Load 321(u16) + 463: 49(i16vec3) CompositeConstruct 462 462 462 + 464: 388(bvec3) ULessThanEqual 461 463 + Store 450(bv) 464 + 465:187(i16vec2) Load 305(i16v) + 466: 17(int16_t) Load 311(i16) + 467:187(i16vec2) CompositeConstruct 466 466 + 468: 190(bvec2) SLessThanEqual 465 467 + 469: 388(bvec3) Load 450(bv) + 470: 388(bvec3) VectorShuffle 469 468 3 4 2 + Store 450(bv) 470 + 471: 49(i16vec3) Load 319(u16v) + 472: 14(int16_t) Load 321(u16) + 473: 49(i16vec3) CompositeConstruct 472 472 472 + 474: 388(bvec3) UGreaterThan 471 473 + Store 450(bv) 474 + 475:187(i16vec2) Load 305(i16v) + 476: 17(int16_t) Load 311(i16) + 477:187(i16vec2) CompositeConstruct 476 476 + 478: 190(bvec2) SGreaterThan 475 477 + 479: 388(bvec3) Load 450(bv) + 480: 388(bvec3) VectorShuffle 479 478 3 4 2 + Store 450(bv) 480 + 481: 49(i16vec3) Load 319(u16v) + 482: 14(int16_t) Load 321(u16) + 483: 49(i16vec3) CompositeConstruct 482 482 482 + 484: 388(bvec3) UGreaterThanEqual 481 483 + Store 450(bv) 484 + 485:187(i16vec2) Load 305(i16v) + 486: 17(int16_t) Load 311(i16) + 487:187(i16vec2) CompositeConstruct 486 486 + 488: 190(bvec2) SGreaterThanEqual 485 487 + 489: 388(bvec3) Load 450(bv) + 490: 388(bvec3) VectorShuffle 489 488 3 4 2 + Store 450(bv) 490 + 491: 49(i16vec3) Load 319(u16v) + 492: 14(int16_t) Load 321(u16) + 493: 49(i16vec3) CompositeConstruct 492 492 492 + 494: 388(bvec3) IEqual 491 493 + Store 450(bv) 494 + 495:187(i16vec2) Load 305(i16v) + 496: 17(int16_t) Load 311(i16) + 497:187(i16vec2) CompositeConstruct 496 496 + 498: 190(bvec2) IEqual 495 497 + 499: 388(bvec3) Load 450(bv) + 500: 388(bvec3) VectorShuffle 499 498 3 4 2 + Store 450(bv) 500 + 501: 49(i16vec3) Load 319(u16v) + 502: 14(int16_t) Load 321(u16) + 503: 49(i16vec3) CompositeConstruct 502 502 502 + 504: 388(bvec3) INotEqual 501 503 + Store 450(bv) 504 + 505:187(i16vec2) Load 305(i16v) + 506: 17(int16_t) Load 311(i16) + 507:187(i16vec2) CompositeConstruct 506 506 + 508: 190(bvec2) INotEqual 505 507 + 509: 388(bvec3) Load 450(bv) + 510: 388(bvec3) VectorShuffle 509 508 3 4 2 + Store 450(bv) 510 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.int16.frag.out b/deps/glslang/Test/baseResults/spv.int16.frag.out new file mode 100644 index 00000000..3ba5c071 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.int16.frag.out @@ -0,0 +1,746 @@ +spv.int16.frag +error: SPIRV-Tools Validation Errors +error: Capability Float16 is not allowed by Vulkan 1.0 specification (or requires extension) + OpCapability Float16 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 523 + + Capability Shader + Capability Float16 + Capability Float64 + Capability Int64 + Capability Int16 + Capability Int8 + Capability StorageUniform16 + Extension "SPV_KHR_16bit_storage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_KHX_shader_explicit_arithmetic_types" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int8" + Name 4 "main" + Name 6 "literal(" + Name 8 "typeCast16(" + Name 10 "operators(" + Name 12 "builtinFuncs(" + Name 16 "i16" + Name 24 "Uniforms" + MemberName 24(Uniforms) 0 "index" + Name 26 "" + Name 33 "indexable" + Name 38 "u16" + Name 46 "indexable" + Name 51 "i32v" + Name 54 "i16v" + Name 59 "u16v" + Name 67 "u32v" + Name 74 "i64v" + Name 80 "u64v" + Name 94 "f16v" + Name 100 "f32v" + Name 106 "f64v" + Name 154 "i8v" + Name 163 "u8v" + Name 176 "bv" + Name 195 "u16v" + Name 200 "i16" + Name 220 "i" + Name 227 "uv" + Name 243 "i64" + Name 281 "b" + Name 343 "i16v" + Name 346 "i16" + Name 356 "u16v" + Name 358 "u16" + Name 428 "i32" + Name 431 "i64" + Name 434 "i16v4" + Name 437 "u32" + Name 438 "u16v2" + Name 442 "u64" + Name 445 "u16v4" + Name 457 "bv" + Name 518 "Block" + MemberName 518(Block) 0 "i16" + MemberName 518(Block) 1 "i16v2" + MemberName 518(Block) 2 "i16v3" + MemberName 518(Block) 3 "i16v4" + MemberName 518(Block) 4 "u16" + MemberName 518(Block) 5 "u16v2" + MemberName 518(Block) 6 "u16v3" + MemberName 518(Block) 7 "u16v4" + Name 520 "block" + Name 521 "si16" + Name 522 "su16" + MemberDecorate 24(Uniforms) 0 Offset 0 + Decorate 24(Uniforms) Block + Decorate 26 DescriptorSet 0 + Decorate 26 Binding 0 + MemberDecorate 518(Block) 0 Offset 0 + MemberDecorate 518(Block) 1 Offset 4 + MemberDecorate 518(Block) 2 Offset 8 + MemberDecorate 518(Block) 3 Offset 16 + MemberDecorate 518(Block) 4 Offset 24 + MemberDecorate 518(Block) 5 Offset 28 + MemberDecorate 518(Block) 6 Offset 32 + MemberDecorate 518(Block) 7 Offset 40 + Decorate 518(Block) Block + Decorate 520(block) DescriptorSet 0 + Decorate 520(block) Binding 1 + Decorate 521(si16) SpecId 100 + Decorate 522(su16) SpecId 101 + 2: TypeVoid + 3: TypeFunction 2 + 14: TypeInt 16 1 + 15: TypePointer Function 14(int16_t) + 17: TypeInt 32 0 + 18: 17(int) Constant 3 + 19: TypeArray 14(int16_t) 18 + 20: 14(int16_t) Constant 4294962927 + 21: 14(int16_t) Constant 4294967295 + 22: 14(int16_t) Constant 16384 + 23: 19 ConstantComposite 20 21 22 + 24(Uniforms): TypeStruct 17(int) + 25: TypePointer Uniform 24(Uniforms) + 26: 25(ptr) Variable Uniform + 27: TypeInt 32 1 + 28: 27(int) Constant 0 + 29: TypePointer Uniform 17(int) + 32: TypePointer Function 19 + 36: TypeInt 16 0 + 37: TypePointer Function 36(int16_t) + 39: TypeArray 36(int16_t) 18 + 40: 36(int16_t) Constant 65535 + 41: 36(int16_t) Constant 32767 + 42: 39 ConstantComposite 40 40 41 + 45: TypePointer Function 39 + 49: TypeVector 27(int) 2 + 50: TypePointer Function 49(ivec2) + 52: TypeVector 14(int16_t) 2 + 53: TypePointer Function 52(i16vec2) + 57: TypeVector 36(int16_t) 2 + 58: TypePointer Function 57(i16vec2) + 61: TypeVector 17(int) 2 + 66: TypePointer Function 61(ivec2) + 71: TypeInt 64 1 + 72: TypeVector 71(int64_t) 2 + 73: TypePointer Function 72(i64vec2) + 77: TypeInt 64 0 + 78: TypeVector 77(int64_t) 2 + 79: TypePointer Function 78(i64vec2) + 91: TypeFloat 16 + 92: TypeVector 91(float16_t) 2 + 93: TypePointer Function 92(f16vec2) + 97: TypeFloat 32 + 98: TypeVector 97(float) 2 + 99: TypePointer Function 98(fvec2) + 103: TypeFloat 64 + 104: TypeVector 103(float64_t) 2 + 105: TypePointer Function 104(f64vec2) + 151: TypeInt 8 1 + 152: TypeVector 151(int8_t) 2 + 153: TypePointer Function 152(i8vec2) + 158: TypeInt 8 0 + 159: TypeVector 158(int8_t) 2 + 162: TypePointer Function 159(i8vec2) + 173: TypeBool + 174: TypeVector 173(bool) 2 + 175: TypePointer Function 174(bvec2) + 178: 14(int16_t) Constant 0 + 179: 14(int16_t) Constant 1 + 180: 52(i16vec2) ConstantComposite 178 178 + 181: 52(i16vec2) ConstantComposite 179 179 + 184: 36(int16_t) Constant 0 + 185: 36(int16_t) Constant 1 + 186: 57(i16vec2) ConstantComposite 184 184 + 187: 57(i16vec2) ConstantComposite 185 185 + 193: TypeVector 36(int16_t) 3 + 194: TypePointer Function 193(i16vec3) + 197: TypeVector 14(int16_t) 3 + 219: TypePointer Function 27(int) + 225: TypeVector 17(int) 3 + 226: TypePointer Function 225(ivec3) + 242: TypePointer Function 71(int64_t) + 264: 17(int) Constant 1 + 270: 17(int) Constant 2 + 276: TypeVector 27(int) 3 + 280: TypePointer Function 173(bool) + 282: 17(int) Constant 0 + 296: TypePointer Function 17(int) + 354: 52(i16vec2) ConstantComposite 21 21 + 363:193(i16vec3) ConstantComposite 184 184 184 + 405: 173(bool) ConstantTrue + 412: 173(bool) ConstantFalse + 413: 174(bvec2) ConstantComposite 412 412 + 425: TypeVector 173(bool) 3 + 426: 425(bvec3) ConstantComposite 412 412 412 + 432: TypeVector 14(int16_t) 4 + 433: TypePointer Function 432(i16vec4) + 441: TypePointer Function 77(int64_t) + 443: TypeVector 36(int16_t) 4 + 444: TypePointer Function 443(i16vec4) + 456: TypePointer Function 425(bvec3) + 518(Block): TypeStruct 14(int16_t) 52(i16vec2) 197(i16vec3) 432(i16vec4) 36(int16_t) 57(i16vec2) 193(i16vec3) 443(i16vec4) + 519: TypePointer Uniform 518(Block) + 520(block): 519(ptr) Variable Uniform + 521(si16): 14(int16_t) SpecConstant 4294967286 + 522(su16): 36(int16_t) SpecConstant 20 + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd + 6(literal(): 2 Function None 3 + 7: Label + 16(i16): 15(ptr) Variable Function + 33(indexable): 32(ptr) Variable Function + 38(u16): 37(ptr) Variable Function + 46(indexable): 45(ptr) Variable Function + 30: 29(ptr) AccessChain 26 28 + 31: 17(int) Load 30 + Store 33(indexable) 23 + 34: 15(ptr) AccessChain 33(indexable) 31 + 35: 14(int16_t) Load 34 + Store 16(i16) 35 + 43: 29(ptr) AccessChain 26 28 + 44: 17(int) Load 43 + Store 46(indexable) 42 + 47: 37(ptr) AccessChain 46(indexable) 44 + 48: 36(int16_t) Load 47 + Store 38(u16) 48 + Return + FunctionEnd + 8(typeCast16(): 2 Function None 3 + 9: Label + 51(i32v): 50(ptr) Variable Function + 54(i16v): 53(ptr) Variable Function + 59(u16v): 58(ptr) Variable Function + 67(u32v): 66(ptr) Variable Function + 74(i64v): 73(ptr) Variable Function + 80(u64v): 79(ptr) Variable Function + 94(f16v): 93(ptr) Variable Function + 100(f32v): 99(ptr) Variable Function + 106(f64v): 105(ptr) Variable Function + 154(i8v): 153(ptr) Variable Function + 163(u8v): 162(ptr) Variable Function + 176(bv): 175(ptr) Variable Function + 55: 52(i16vec2) Load 54(i16v) + 56: 49(ivec2) SConvert 55 + Store 51(i32v) 56 + 60: 57(i16vec2) Load 59(u16v) + 62: 61(ivec2) UConvert 60 + 63: 49(ivec2) Bitcast 62 + Store 51(i32v) 63 + 64: 52(i16vec2) Load 54(i16v) + 65: 57(i16vec2) Bitcast 64 + Store 59(u16v) 65 + 68: 52(i16vec2) Load 54(i16v) + 69: 49(ivec2) SConvert 68 + 70: 61(ivec2) Bitcast 69 + Store 67(u32v) 70 + 75: 52(i16vec2) Load 54(i16v) + 76: 72(i64vec2) SConvert 75 + Store 74(i64v) 76 + 81: 52(i16vec2) Load 54(i16v) + 82: 72(i64vec2) SConvert 81 + 83: 78(i64vec2) Bitcast 82 + Store 80(u64v) 83 + 84: 57(i16vec2) Load 59(u16v) + 85: 61(ivec2) UConvert 84 + Store 67(u32v) 85 + 86: 57(i16vec2) Load 59(u16v) + 87: 78(i64vec2) UConvert 86 + 88: 72(i64vec2) Bitcast 87 + Store 74(i64v) 88 + 89: 57(i16vec2) Load 59(u16v) + 90: 78(i64vec2) UConvert 89 + Store 80(u64v) 90 + 95: 52(i16vec2) Load 54(i16v) + 96: 92(f16vec2) ConvertSToF 95 + Store 94(f16v) 96 + 101: 52(i16vec2) Load 54(i16v) + 102: 98(fvec2) ConvertSToF 101 + Store 100(f32v) 102 + 107: 52(i16vec2) Load 54(i16v) + 108:104(f64vec2) ConvertSToF 107 + Store 106(f64v) 108 + 109: 57(i16vec2) Load 59(u16v) + 110: 92(f16vec2) ConvertUToF 109 + Store 94(f16v) 110 + 111: 57(i16vec2) Load 59(u16v) + 112: 98(fvec2) ConvertUToF 111 + Store 100(f32v) 112 + 113: 57(i16vec2) Load 59(u16v) + 114:104(f64vec2) ConvertUToF 113 + Store 106(f64v) 114 + 115: 52(i16vec2) Load 54(i16v) + 116: 49(ivec2) SConvert 115 + Store 51(i32v) 116 + 117: 57(i16vec2) Load 59(u16v) + 118: 61(ivec2) UConvert 117 + 119: 49(ivec2) Bitcast 118 + Store 51(i32v) 119 + 120: 52(i16vec2) Load 54(i16v) + 121: 57(i16vec2) Bitcast 120 + Store 59(u16v) 121 + 122: 52(i16vec2) Load 54(i16v) + 123: 49(ivec2) SConvert 122 + 124: 61(ivec2) Bitcast 123 + Store 67(u32v) 124 + 125: 52(i16vec2) Load 54(i16v) + 126: 72(i64vec2) SConvert 125 + Store 74(i64v) 126 + 127: 52(i16vec2) Load 54(i16v) + 128: 72(i64vec2) SConvert 127 + 129: 78(i64vec2) Bitcast 128 + Store 80(u64v) 129 + 130: 57(i16vec2) Load 59(u16v) + 131: 61(ivec2) UConvert 130 + Store 67(u32v) 131 + 132: 57(i16vec2) Load 59(u16v) + 133: 78(i64vec2) UConvert 132 + 134: 72(i64vec2) Bitcast 133 + Store 74(i64v) 134 + 135: 57(i16vec2) Load 59(u16v) + 136: 78(i64vec2) UConvert 135 + 137: 72(i64vec2) Bitcast 136 + 138: 78(i64vec2) Bitcast 137 + Store 80(u64v) 138 + 139: 52(i16vec2) Load 54(i16v) + 140: 92(f16vec2) ConvertSToF 139 + Store 94(f16v) 140 + 141: 52(i16vec2) Load 54(i16v) + 142: 98(fvec2) ConvertSToF 141 + Store 100(f32v) 142 + 143: 52(i16vec2) Load 54(i16v) + 144:104(f64vec2) ConvertSToF 143 + Store 106(f64v) 144 + 145: 57(i16vec2) Load 59(u16v) + 146: 92(f16vec2) ConvertUToF 145 + Store 94(f16v) 146 + 147: 57(i16vec2) Load 59(u16v) + 148: 98(fvec2) ConvertUToF 147 + Store 100(f32v) 148 + 149: 57(i16vec2) Load 59(u16v) + 150:104(f64vec2) ConvertUToF 149 + Store 106(f64v) 150 + 155: 52(i16vec2) Load 54(i16v) + 156: 152(i8vec2) SConvert 155 + Store 154(i8v) 156 + 157: 57(i16vec2) Load 59(u16v) + 160: 159(i8vec2) UConvert 157 + 161: 152(i8vec2) Bitcast 160 + Store 154(i8v) 161 + 164: 52(i16vec2) Load 54(i16v) + 165: 152(i8vec2) SConvert 164 + 166: 159(i8vec2) Bitcast 165 + Store 163(u8v) 166 + 167: 57(i16vec2) Load 59(u16v) + 168: 159(i8vec2) UConvert 167 + Store 163(u8v) 168 + 169: 57(i16vec2) Load 59(u16v) + 170: 159(i8vec2) UConvert 169 + 171: 57(i16vec2) UConvert 170 + 172: 52(i16vec2) Bitcast 171 + Store 54(i16v) 172 + 177: 174(bvec2) Load 176(bv) + 182: 52(i16vec2) Select 177 181 180 + Store 54(i16v) 182 + 183: 174(bvec2) Load 176(bv) + 188: 57(i16vec2) Select 183 187 186 + Store 59(u16v) 188 + 189: 52(i16vec2) Load 54(i16v) + 190: 174(bvec2) INotEqual 189 186 + Store 176(bv) 190 + 191: 57(i16vec2) Load 59(u16v) + 192: 174(bvec2) INotEqual 191 186 + Store 176(bv) 192 + Return + FunctionEnd + 10(operators(): 2 Function None 3 + 11: Label + 195(u16v): 194(ptr) Variable Function + 200(i16): 15(ptr) Variable Function + 220(i): 219(ptr) Variable Function + 227(uv): 226(ptr) Variable Function + 243(i64): 242(ptr) Variable Function + 281(b): 280(ptr) Variable Function + 196:193(i16vec3) Load 195(u16v) + 198:197(i16vec3) CompositeConstruct 179 179 179 + 199:193(i16vec3) IAdd 196 198 + Store 195(u16v) 199 + 201: 14(int16_t) Load 200(i16) + 202: 14(int16_t) ISub 201 179 + Store 200(i16) 202 + 203: 14(int16_t) Load 200(i16) + 204: 14(int16_t) IAdd 203 179 + Store 200(i16) 204 + 205:193(i16vec3) Load 195(u16v) + 206:197(i16vec3) CompositeConstruct 179 179 179 + 207:193(i16vec3) ISub 205 206 + Store 195(u16v) 207 + 208:193(i16vec3) Load 195(u16v) + 209:193(i16vec3) Not 208 + Store 195(u16v) 209 + 210: 14(int16_t) Load 200(i16) + Store 200(i16) 210 + 211:193(i16vec3) Load 195(u16v) + 212:193(i16vec3) SNegate 211 + Store 195(u16v) 212 + 213: 14(int16_t) Load 200(i16) + 214: 14(int16_t) Load 200(i16) + 215: 14(int16_t) IAdd 214 213 + Store 200(i16) 215 + 216:193(i16vec3) Load 195(u16v) + 217:193(i16vec3) Load 195(u16v) + 218:193(i16vec3) ISub 217 216 + Store 195(u16v) 218 + 221: 14(int16_t) Load 200(i16) + 222: 27(int) SConvert 221 + 223: 27(int) Load 220(i) + 224: 27(int) IMul 223 222 + Store 220(i) 224 + 228:193(i16vec3) Load 195(u16v) + 229: 225(ivec3) UConvert 228 + 230: 225(ivec3) Load 227(uv) + 231: 225(ivec3) UDiv 230 229 + Store 227(uv) 231 + 232: 14(int16_t) Load 200(i16) + 233: 27(int) SConvert 232 + 234: 17(int) Bitcast 233 + 235: 225(ivec3) Load 227(uv) + 236: 225(ivec3) CompositeConstruct 234 234 234 + 237: 225(ivec3) UMod 235 236 + Store 227(uv) 237 + 238:193(i16vec3) Load 195(u16v) + 239: 225(ivec3) UConvert 238 + 240: 225(ivec3) Load 227(uv) + 241: 225(ivec3) IAdd 239 240 + Store 227(uv) 241 + 244: 14(int16_t) Load 200(i16) + 245: 71(int64_t) SConvert 244 + 246: 71(int64_t) Load 243(i64) + 247: 71(int64_t) ISub 245 246 + Store 243(i64) 247 + 248:193(i16vec3) Load 195(u16v) + 249: 225(ivec3) UConvert 248 + 250: 225(ivec3) Load 227(uv) + 251: 225(ivec3) IMul 249 250 + Store 227(uv) 251 + 252: 14(int16_t) Load 200(i16) + 253: 71(int64_t) SConvert 252 + 254: 71(int64_t) Load 243(i64) + 255: 71(int64_t) IMul 253 254 + Store 243(i64) 255 + 256: 14(int16_t) Load 200(i16) + 257: 27(int) SConvert 256 + 258: 27(int) Load 220(i) + 259: 27(int) SMod 257 258 + Store 220(i) 259 + 260: 14(int16_t) Load 200(i16) + 261:193(i16vec3) Load 195(u16v) + 262:197(i16vec3) CompositeConstruct 260 260 260 + 263:193(i16vec3) ShiftLeftLogical 261 262 + Store 195(u16v) 263 + 265: 37(ptr) AccessChain 195(u16v) 264 + 266: 36(int16_t) Load 265 + 267: 14(int16_t) Load 200(i16) + 268: 14(int16_t) ShiftRightArithmetic 267 266 + Store 200(i16) 268 + 269: 14(int16_t) Load 200(i16) + 271: 37(ptr) AccessChain 195(u16v) 270 + 272: 36(int16_t) Load 271 + 273: 14(int16_t) ShiftLeftLogical 269 272 + Store 200(i16) 273 + 274:193(i16vec3) Load 195(u16v) + 275: 27(int) Load 220(i) + 277: 276(ivec3) CompositeConstruct 275 275 275 + 278:193(i16vec3) ShiftLeftLogical 274 277 + 279: 225(ivec3) UConvert 278 + Store 227(uv) 279 + 283: 37(ptr) AccessChain 195(u16v) 282 + 284: 36(int16_t) Load 283 + 285: 14(int16_t) Load 200(i16) + 286: 36(int16_t) Bitcast 285 + 287: 173(bool) INotEqual 284 286 + Store 281(b) 287 + 288: 14(int16_t) Load 200(i16) + 289: 36(int16_t) Bitcast 288 + 290: 37(ptr) AccessChain 195(u16v) 282 + 291: 36(int16_t) Load 290 + 292: 173(bool) IEqual 289 291 + Store 281(b) 292 + 293: 37(ptr) AccessChain 195(u16v) 282 + 294: 36(int16_t) Load 293 + 295: 17(int) UConvert 294 + 297: 296(ptr) AccessChain 227(uv) 264 + 298: 17(int) Load 297 + 299: 173(bool) UGreaterThan 295 298 + Store 281(b) 299 + 300: 14(int16_t) Load 200(i16) + 301: 27(int) SConvert 300 + 302: 27(int) Load 220(i) + 303: 173(bool) SLessThan 301 302 + Store 281(b) 303 + 304: 37(ptr) AccessChain 195(u16v) 264 + 305: 36(int16_t) Load 304 + 306: 17(int) UConvert 305 + 307: 296(ptr) AccessChain 227(uv) 282 + 308: 17(int) Load 307 + 309: 173(bool) UGreaterThanEqual 306 308 + Store 281(b) 309 + 310: 14(int16_t) Load 200(i16) + 311: 27(int) SConvert 310 + 312: 27(int) Load 220(i) + 313: 173(bool) SLessThanEqual 311 312 + Store 281(b) 313 + 314: 14(int16_t) Load 200(i16) + 315: 27(int) SConvert 314 + 316: 17(int) Bitcast 315 + 317: 225(ivec3) Load 227(uv) + 318: 225(ivec3) CompositeConstruct 316 316 316 + 319: 225(ivec3) BitwiseOr 317 318 + Store 227(uv) 319 + 320: 14(int16_t) Load 200(i16) + 321: 27(int) SConvert 320 + 322: 27(int) Load 220(i) + 323: 27(int) BitwiseOr 321 322 + Store 220(i) 323 + 324: 14(int16_t) Load 200(i16) + 325: 71(int64_t) SConvert 324 + 326: 71(int64_t) Load 243(i64) + 327: 71(int64_t) BitwiseAnd 326 325 + Store 243(i64) 327 + 328:193(i16vec3) Load 195(u16v) + 329: 225(ivec3) UConvert 328 + 330: 225(ivec3) Load 227(uv) + 331: 225(ivec3) BitwiseAnd 329 330 + Store 227(uv) 331 + 332: 14(int16_t) Load 200(i16) + 333: 27(int) SConvert 332 + 334: 17(int) Bitcast 333 + 335: 225(ivec3) Load 227(uv) + 336: 225(ivec3) CompositeConstruct 334 334 334 + 337: 225(ivec3) BitwiseXor 335 336 + Store 227(uv) 337 + 338:193(i16vec3) Load 195(u16v) + 339: 14(int16_t) Load 200(i16) + 340: 36(int16_t) Bitcast 339 + 341:193(i16vec3) CompositeConstruct 340 340 340 + 342:193(i16vec3) BitwiseXor 338 341 + Store 195(u16v) 342 + Return + FunctionEnd +12(builtinFuncs(): 2 Function None 3 + 13: Label + 343(i16v): 53(ptr) Variable Function + 346(i16): 15(ptr) Variable Function + 356(u16v): 194(ptr) Variable Function + 358(u16): 37(ptr) Variable Function + 428(i32): 219(ptr) Variable Function + 431(i64): 242(ptr) Variable Function + 434(i16v4): 433(ptr) Variable Function + 437(u32): 296(ptr) Variable Function + 438(u16v2): 58(ptr) Variable Function + 442(u64): 441(ptr) Variable Function + 445(u16v4): 444(ptr) Variable Function + 457(bv): 456(ptr) Variable Function + 344: 52(i16vec2) Load 343(i16v) + 345: 52(i16vec2) ExtInst 1(GLSL.std.450) 5(SAbs) 344 + Store 343(i16v) 345 + 347: 14(int16_t) Load 346(i16) + 348: 14(int16_t) ExtInst 1(GLSL.std.450) 7(SSign) 347 + Store 346(i16) 348 + 349: 52(i16vec2) Load 343(i16v) + 350: 14(int16_t) Load 346(i16) + 351: 52(i16vec2) CompositeConstruct 350 350 + 352: 52(i16vec2) ExtInst 1(GLSL.std.450) 39(SMin) 349 351 + Store 343(i16v) 352 + 353: 52(i16vec2) Load 343(i16v) + 355: 52(i16vec2) ExtInst 1(GLSL.std.450) 39(SMin) 353 354 + Store 343(i16v) 355 + 357:193(i16vec3) Load 356(u16v) + 359: 36(int16_t) Load 358(u16) + 360:193(i16vec3) CompositeConstruct 359 359 359 + 361:193(i16vec3) ExtInst 1(GLSL.std.450) 38(UMin) 357 360 + Store 356(u16v) 361 + 362:193(i16vec3) Load 356(u16v) + 364:193(i16vec3) ExtInst 1(GLSL.std.450) 38(UMin) 362 363 + Store 356(u16v) 364 + 365: 52(i16vec2) Load 343(i16v) + 366: 14(int16_t) Load 346(i16) + 367: 52(i16vec2) CompositeConstruct 366 366 + 368: 52(i16vec2) ExtInst 1(GLSL.std.450) 42(SMax) 365 367 + Store 343(i16v) 368 + 369: 52(i16vec2) Load 343(i16v) + 370: 52(i16vec2) ExtInst 1(GLSL.std.450) 42(SMax) 369 354 + Store 343(i16v) 370 + 371:193(i16vec3) Load 356(u16v) + 372: 36(int16_t) Load 358(u16) + 373:193(i16vec3) CompositeConstruct 372 372 372 + 374:193(i16vec3) ExtInst 1(GLSL.std.450) 41(UMax) 371 373 + Store 356(u16v) 374 + 375:193(i16vec3) Load 356(u16v) + 376:193(i16vec3) ExtInst 1(GLSL.std.450) 41(UMax) 375 363 + Store 356(u16v) 376 + 377: 52(i16vec2) Load 343(i16v) + 378: 14(int16_t) Load 346(i16) + 379: 14(int16_t) SNegate 378 + 380: 14(int16_t) Load 346(i16) + 381: 52(i16vec2) CompositeConstruct 379 379 + 382: 52(i16vec2) CompositeConstruct 380 380 + 383: 52(i16vec2) ExtInst 1(GLSL.std.450) 45(SClamp) 377 381 382 + Store 343(i16v) 383 + 384: 52(i16vec2) Load 343(i16v) + 385: 52(i16vec2) Load 343(i16v) + 386: 52(i16vec2) SNegate 385 + 387: 52(i16vec2) Load 343(i16v) + 388: 52(i16vec2) ExtInst 1(GLSL.std.450) 45(SClamp) 384 386 387 + Store 343(i16v) 388 + 389:193(i16vec3) Load 356(u16v) + 390: 36(int16_t) Load 358(u16) + 391: 36(int16_t) SNegate 390 + 392: 36(int16_t) Load 358(u16) + 393:193(i16vec3) CompositeConstruct 391 391 391 + 394:193(i16vec3) CompositeConstruct 392 392 392 + 395:193(i16vec3) ExtInst 1(GLSL.std.450) 44(UClamp) 389 393 394 + Store 356(u16v) 395 + 396:193(i16vec3) Load 356(u16v) + 397:193(i16vec3) Load 356(u16v) + 398:193(i16vec3) SNegate 397 + 399:193(i16vec3) Load 356(u16v) + 400:193(i16vec3) ExtInst 1(GLSL.std.450) 44(UClamp) 396 398 399 + Store 356(u16v) 400 + 401: 15(ptr) AccessChain 343(i16v) 282 + 402: 14(int16_t) Load 401 + 403: 15(ptr) AccessChain 343(i16v) 264 + 404: 14(int16_t) Load 403 + 406: 14(int16_t) Select 405 404 402 + Store 346(i16) 406 + 407: 14(int16_t) Load 346(i16) + 408: 52(i16vec2) CompositeConstruct 407 407 + 409: 14(int16_t) Load 346(i16) + 410: 14(int16_t) SNegate 409 + 411: 52(i16vec2) CompositeConstruct 410 410 + 414: 52(i16vec2) Select 413 411 408 + Store 343(i16v) 414 + 415: 37(ptr) AccessChain 356(u16v) 282 + 416: 36(int16_t) Load 415 + 417: 37(ptr) AccessChain 356(u16v) 264 + 418: 36(int16_t) Load 417 + 419: 36(int16_t) Select 405 418 416 + Store 358(u16) 419 + 420: 36(int16_t) Load 358(u16) + 421:193(i16vec3) CompositeConstruct 420 420 420 + 422: 36(int16_t) Load 358(u16) + 423: 36(int16_t) SNegate 422 + 424:193(i16vec3) CompositeConstruct 423 423 423 + 427:193(i16vec3) Select 426 424 421 + Store 356(u16v) 427 + 429: 52(i16vec2) Load 343(i16v) + 430: 27(int) Bitcast 429 + Store 428(i32) 430 + 435:432(i16vec4) Load 434(i16v4) + 436: 71(int64_t) Bitcast 435 + Store 431(i64) 436 + 439: 57(i16vec2) Load 438(u16v2) + 440: 17(int) Bitcast 439 + Store 437(u32) 440 + 446:443(i16vec4) Load 445(u16v4) + 447: 77(int64_t) Bitcast 446 + Store 442(u64) 447 + 448: 27(int) Load 428(i32) + 449: 52(i16vec2) Bitcast 448 + Store 343(i16v) 449 + 450: 71(int64_t) Load 431(i64) + 451:432(i16vec4) Bitcast 450 + Store 434(i16v4) 451 + 452: 17(int) Load 437(u32) + 453: 57(i16vec2) Bitcast 452 + Store 438(u16v2) 453 + 454: 77(int64_t) Load 442(u64) + 455:443(i16vec4) Bitcast 454 + Store 445(u16v4) 455 + 458:193(i16vec3) Load 356(u16v) + 459: 36(int16_t) Load 358(u16) + 460:193(i16vec3) CompositeConstruct 459 459 459 + 461: 425(bvec3) ULessThan 458 460 + Store 457(bv) 461 + 462: 52(i16vec2) Load 343(i16v) + 463: 14(int16_t) Load 346(i16) + 464: 52(i16vec2) CompositeConstruct 463 463 + 465: 174(bvec2) SLessThan 462 464 + 466: 425(bvec3) Load 457(bv) + 467: 425(bvec3) VectorShuffle 466 465 3 4 2 + Store 457(bv) 467 + 468:193(i16vec3) Load 356(u16v) + 469: 36(int16_t) Load 358(u16) + 470:193(i16vec3) CompositeConstruct 469 469 469 + 471: 425(bvec3) ULessThanEqual 468 470 + Store 457(bv) 471 + 472: 52(i16vec2) Load 343(i16v) + 473: 14(int16_t) Load 346(i16) + 474: 52(i16vec2) CompositeConstruct 473 473 + 475: 174(bvec2) SLessThanEqual 472 474 + 476: 425(bvec3) Load 457(bv) + 477: 425(bvec3) VectorShuffle 476 475 3 4 2 + Store 457(bv) 477 + 478:193(i16vec3) Load 356(u16v) + 479: 36(int16_t) Load 358(u16) + 480:193(i16vec3) CompositeConstruct 479 479 479 + 481: 425(bvec3) UGreaterThan 478 480 + Store 457(bv) 481 + 482: 52(i16vec2) Load 343(i16v) + 483: 14(int16_t) Load 346(i16) + 484: 52(i16vec2) CompositeConstruct 483 483 + 485: 174(bvec2) SGreaterThan 482 484 + 486: 425(bvec3) Load 457(bv) + 487: 425(bvec3) VectorShuffle 486 485 3 4 2 + Store 457(bv) 487 + 488:193(i16vec3) Load 356(u16v) + 489: 36(int16_t) Load 358(u16) + 490:193(i16vec3) CompositeConstruct 489 489 489 + 491: 425(bvec3) UGreaterThanEqual 488 490 + Store 457(bv) 491 + 492: 52(i16vec2) Load 343(i16v) + 493: 14(int16_t) Load 346(i16) + 494: 52(i16vec2) CompositeConstruct 493 493 + 495: 174(bvec2) SGreaterThanEqual 492 494 + 496: 425(bvec3) Load 457(bv) + 497: 425(bvec3) VectorShuffle 496 495 3 4 2 + Store 457(bv) 497 + 498:193(i16vec3) Load 356(u16v) + 499: 36(int16_t) Load 358(u16) + 500:193(i16vec3) CompositeConstruct 499 499 499 + 501: 425(bvec3) IEqual 498 500 + Store 457(bv) 501 + 502: 52(i16vec2) Load 343(i16v) + 503: 14(int16_t) Load 346(i16) + 504: 52(i16vec2) CompositeConstruct 503 503 + 505: 174(bvec2) IEqual 502 504 + 506: 425(bvec3) Load 457(bv) + 507: 425(bvec3) VectorShuffle 506 505 3 4 2 + Store 457(bv) 507 + 508:193(i16vec3) Load 356(u16v) + 509: 36(int16_t) Load 358(u16) + 510:193(i16vec3) CompositeConstruct 509 509 509 + 511: 425(bvec3) INotEqual 508 510 + Store 457(bv) 511 + 512: 52(i16vec2) Load 343(i16v) + 513: 14(int16_t) Load 346(i16) + 514: 52(i16vec2) CompositeConstruct 513 513 + 515: 174(bvec2) INotEqual 512 514 + 516: 425(bvec3) Load 457(bv) + 517: 425(bvec3) VectorShuffle 516 515 3 4 2 + Store 457(bv) 517 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.int32.frag.out b/deps/glslang/Test/baseResults/spv.int32.frag.out new file mode 100644 index 00000000..3b934284 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.int32.frag.out @@ -0,0 +1,716 @@ +spv.int32.frag +error: SPIRV-Tools Validation Errors +error: Capability Float16 is not allowed by Vulkan 1.1 specification (or requires extension) + OpCapability Float16 + +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 493 + + Capability Shader + Capability Float16 + Capability Float64 + Capability Int64 + Capability Int16 + Capability Int8 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_KHX_shader_explicit_arithmetic_types" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int8" + Name 4 "main" + Name 6 "literal(" + Name 8 "typeCast32(" + Name 10 "operators(" + Name 12 "builtinFuncs(" + Name 16 "u32Max" + Name 20 "i32" + Name 27 "Uniforms" + MemberName 27(Uniforms) 0 "index" + Name 29 "" + Name 35 "indexable" + Name 39 "u32" + Name 46 "indexable" + Name 51 "u32v" + Name 54 "i32v" + Name 60 "i64v" + Name 66 "u64v" + Name 78 "f32v" + Name 84 "f64v" + Name 94 "i8v" + Name 105 "i16v" + Name 125 "u8v" + Name 132 "u16v" + Name 152 "f16v" + Name 168 "bv" + Name 186 "u32v" + Name 191 "i32" + Name 210 "i" + Name 214 "uv" + Name 227 "i64" + Name 260 "b" + Name 312 "i32v" + Name 315 "i32" + Name 325 "u32v" + Name 327 "u32" + Name 399 "i8v4" + Name 402 "i16v2" + Name 407 "u8v4" + Name 410 "u16v2" + Name 413 "i64" + Name 416 "u32v2" + Name 418 "u64" + Name 422 "bv" + Name 485 "Block" + MemberName 485(Block) 0 "i32" + MemberName 485(Block) 1 "i32v2" + MemberName 485(Block) 2 "i32v3" + MemberName 485(Block) 3 "i32v4" + MemberName 485(Block) 4 "u32" + MemberName 485(Block) 5 "u32v2" + MemberName 485(Block) 6 "u32v3" + MemberName 485(Block) 7 "u32v4" + Name 487 "block" + Name 488 "si32" + Name 489 "su32" + Name 490 "si" + Name 491 "su" + Name 492 "sb" + MemberDecorate 27(Uniforms) 0 Offset 0 + Decorate 27(Uniforms) Block + Decorate 29 DescriptorSet 0 + Decorate 29 Binding 0 + MemberDecorate 485(Block) 0 Offset 0 + MemberDecorate 485(Block) 1 Offset 8 + MemberDecorate 485(Block) 2 Offset 16 + MemberDecorate 485(Block) 3 Offset 32 + MemberDecorate 485(Block) 4 Offset 48 + MemberDecorate 485(Block) 5 Offset 56 + MemberDecorate 485(Block) 6 Offset 64 + MemberDecorate 485(Block) 7 Offset 80 + Decorate 485(Block) Block + Decorate 487(block) DescriptorSet 0 + Decorate 487(block) Binding 1 + Decorate 488(si32) SpecId 100 + Decorate 489(su32) SpecId 101 + Decorate 490(si) SpecId 102 + Decorate 491(su) SpecId 103 + Decorate 492(sb) SpecId 104 + 2: TypeVoid + 3: TypeFunction 2 + 14: TypeInt 32 0 + 15: TypePointer Private 14(int) + 16(u32Max): 15(ptr) Variable Private + 17: 14(int) Constant 4294967295 + 18: TypeInt 32 1 + 19: TypePointer Function 18(int) + 21: 14(int) Constant 3 + 22: TypeArray 18(int) 21 + 23: 18(int) Constant 4008636143 + 24: 18(int) Constant 4294967295 + 25: 18(int) Constant 536870912 + 26: 22 ConstantComposite 23 24 25 + 27(Uniforms): TypeStruct 14(int) + 28: TypePointer Uniform 27(Uniforms) + 29: 28(ptr) Variable Uniform + 30: 18(int) Constant 0 + 31: TypePointer Uniform 14(int) + 34: TypePointer Function 22 + 38: TypePointer Function 14(int) + 40: TypeArray 14(int) 21 + 41: 14(int) Constant 2147483647 + 42: 40 ConstantComposite 17 17 41 + 45: TypePointer Function 40 + 49: TypeVector 14(int) 2 + 50: TypePointer Function 49(ivec2) + 52: TypeVector 18(int) 2 + 53: TypePointer Function 52(ivec2) + 57: TypeInt 64 1 + 58: TypeVector 57(int64_t) 2 + 59: TypePointer Function 58(i64vec2) + 63: TypeInt 64 0 + 64: TypeVector 63(int64_t) 2 + 65: TypePointer Function 64(i64vec2) + 75: TypeFloat 32 + 76: TypeVector 75(float) 2 + 77: TypePointer Function 76(fvec2) + 81: TypeFloat 64 + 82: TypeVector 81(float64_t) 2 + 83: TypePointer Function 82(f64vec2) + 91: TypeInt 8 1 + 92: TypeVector 91(int8_t) 2 + 93: TypePointer Function 92(i8vec2) + 98: TypeInt 8 0 + 99: TypeVector 98(int8_t) 2 + 102: TypeInt 16 1 + 103: TypeVector 102(int16_t) 2 + 104: TypePointer Function 103(i16vec2) + 109: TypeInt 16 0 + 110: TypeVector 109(int16_t) 2 + 124: TypePointer Function 99(i8vec2) + 131: TypePointer Function 110(i16vec2) + 149: TypeFloat 16 + 150: TypeVector 149(float16_t) 2 + 151: TypePointer Function 150(f16vec2) + 165: TypeBool + 166: TypeVector 165(bool) 2 + 167: TypePointer Function 166(bvec2) + 170: 18(int) Constant 1 + 171: 52(ivec2) ConstantComposite 30 30 + 172: 52(ivec2) ConstantComposite 170 170 + 175: 14(int) Constant 0 + 176: 14(int) Constant 1 + 177: 49(ivec2) ConstantComposite 175 175 + 178: 49(ivec2) ConstantComposite 176 176 + 184: TypeVector 14(int) 3 + 185: TypePointer Function 184(ivec3) + 188: TypeVector 18(int) 3 + 226: TypePointer Function 57(int64_t) + 251: 14(int) Constant 2 + 259: TypePointer Function 165(bool) + 323: 52(ivec2) ConstantComposite 24 24 + 332: 184(ivec3) ConstantComposite 175 175 175 + 374: 165(bool) ConstantTrue + 381: 165(bool) ConstantFalse + 382: 166(bvec2) ConstantComposite 381 381 + 394: TypeVector 165(bool) 3 + 395: 394(bvec3) ConstantComposite 381 381 381 + 397: TypeVector 91(int8_t) 4 + 398: TypePointer Function 397(i8vec4) + 405: TypeVector 98(int8_t) 4 + 406: TypePointer Function 405(i8vec4) + 417: TypePointer Function 63(int64_t) + 421: TypePointer Function 394(bvec3) + 483: TypeVector 18(int) 4 + 484: TypeVector 14(int) 4 + 485(Block): TypeStruct 18(int) 52(ivec2) 188(ivec3) 483(ivec4) 14(int) 49(ivec2) 184(ivec3) 484(ivec4) + 486: TypePointer Uniform 485(Block) + 487(block): 486(ptr) Variable Uniform + 488(si32): 18(int) SpecConstant 4294967286 + 489(su32): 14(int) SpecConstant 20 + 490(si): 18(int) SpecConstant 4294967291 + 491(su): 14(int) SpecConstant 4 + 492(sb): 165(bool) SpecConstantTrue + 4(main): 2 Function None 3 + 5: Label + Store 16(u32Max) 17 + Return + FunctionEnd + 6(literal(): 2 Function None 3 + 7: Label + 20(i32): 19(ptr) Variable Function + 35(indexable): 34(ptr) Variable Function + 39(u32): 38(ptr) Variable Function + 46(indexable): 45(ptr) Variable Function + 32: 31(ptr) AccessChain 29 30 + 33: 14(int) Load 32 + Store 35(indexable) 26 + 36: 19(ptr) AccessChain 35(indexable) 33 + 37: 18(int) Load 36 + Store 20(i32) 37 + 43: 31(ptr) AccessChain 29 30 + 44: 14(int) Load 43 + Store 46(indexable) 42 + 47: 38(ptr) AccessChain 46(indexable) 44 + 48: 14(int) Load 47 + Store 39(u32) 48 + Return + FunctionEnd + 8(typeCast32(): 2 Function None 3 + 9: Label + 51(u32v): 50(ptr) Variable Function + 54(i32v): 53(ptr) Variable Function + 60(i64v): 59(ptr) Variable Function + 66(u64v): 65(ptr) Variable Function + 78(f32v): 77(ptr) Variable Function + 84(f64v): 83(ptr) Variable Function + 94(i8v): 93(ptr) Variable Function + 105(i16v): 104(ptr) Variable Function + 125(u8v): 124(ptr) Variable Function + 132(u16v): 131(ptr) Variable Function + 152(f16v): 151(ptr) Variable Function + 168(bv): 167(ptr) Variable Function + 55: 52(ivec2) Load 54(i32v) + 56: 49(ivec2) Bitcast 55 + Store 51(u32v) 56 + 61: 52(ivec2) Load 54(i32v) + 62: 58(i64vec2) SConvert 61 + Store 60(i64v) 62 + 67: 52(ivec2) Load 54(i32v) + 68: 58(i64vec2) SConvert 67 + 69: 64(i64vec2) Bitcast 68 + Store 66(u64v) 69 + 70: 49(ivec2) Load 51(u32v) + 71: 64(i64vec2) UConvert 70 + 72: 58(i64vec2) Bitcast 71 + Store 60(i64v) 72 + 73: 49(ivec2) Load 51(u32v) + 74: 64(i64vec2) UConvert 73 + Store 66(u64v) 74 + 79: 52(ivec2) Load 54(i32v) + 80: 76(fvec2) ConvertSToF 79 + Store 78(f32v) 80 + 85: 52(ivec2) Load 54(i32v) + 86: 82(f64vec2) ConvertSToF 85 + Store 84(f64v) 86 + 87: 49(ivec2) Load 51(u32v) + 88: 76(fvec2) ConvertUToF 87 + Store 78(f32v) 88 + 89: 49(ivec2) Load 51(u32v) + 90: 82(f64vec2) ConvertUToF 89 + Store 84(f64v) 90 + 95: 52(ivec2) Load 54(i32v) + 96: 92(i8vec2) SConvert 95 + Store 94(i8v) 96 + 97: 49(ivec2) Load 51(u32v) + 100: 99(i8vec2) UConvert 97 + 101: 92(i8vec2) Bitcast 100 + Store 94(i8v) 101 + 106: 52(ivec2) Load 54(i32v) + 107:103(i16vec2) SConvert 106 + Store 105(i16v) 107 + 108: 49(ivec2) Load 51(u32v) + 111:110(i16vec2) UConvert 108 + 112:103(i16vec2) Bitcast 111 + Store 105(i16v) 112 + 113: 52(ivec2) Load 54(i32v) + 114: 18(int) CompositeExtract 113 0 + 115: 18(int) CompositeExtract 113 1 + 116: 52(ivec2) CompositeConstruct 114 115 + Store 54(i32v) 116 + 117: 49(ivec2) Load 51(u32v) + 118: 52(ivec2) Bitcast 117 + Store 54(i32v) 118 + 119: 52(ivec2) Load 54(i32v) + 120: 58(i64vec2) SConvert 119 + Store 60(i64v) 120 + 121: 49(ivec2) Load 51(u32v) + 122: 64(i64vec2) UConvert 121 + 123: 58(i64vec2) Bitcast 122 + Store 60(i64v) 123 + 126: 52(ivec2) Load 54(i32v) + 127: 92(i8vec2) SConvert 126 + 128: 99(i8vec2) Bitcast 127 + Store 125(u8v) 128 + 129: 49(ivec2) Load 51(u32v) + 130: 99(i8vec2) UConvert 129 + Store 125(u8v) 130 + 133: 52(ivec2) Load 54(i32v) + 134:103(i16vec2) SConvert 133 + 135:110(i16vec2) Bitcast 134 + Store 132(u16v) 135 + 136: 49(ivec2) Load 51(u32v) + 137:110(i16vec2) UConvert 136 + Store 132(u16v) 137 + 138: 52(ivec2) Load 54(i32v) + 139: 49(ivec2) Bitcast 138 + Store 51(u32v) 139 + 140: 49(ivec2) Load 51(u32v) + 141: 14(int) CompositeExtract 140 0 + 142: 14(int) CompositeExtract 140 1 + 143: 49(ivec2) CompositeConstruct 141 142 + Store 51(u32v) 143 + 144: 52(ivec2) Load 54(i32v) + 145: 58(i64vec2) SConvert 144 + 146: 64(i64vec2) Bitcast 145 + Store 66(u64v) 146 + 147: 49(ivec2) Load 51(u32v) + 148: 64(i64vec2) UConvert 147 + Store 66(u64v) 148 + 153: 52(ivec2) Load 54(i32v) + 154:150(f16vec2) ConvertSToF 153 + Store 152(f16v) 154 + 155: 52(ivec2) Load 54(i32v) + 156: 76(fvec2) ConvertSToF 155 + Store 78(f32v) 156 + 157: 52(ivec2) Load 54(i32v) + 158: 82(f64vec2) ConvertSToF 157 + Store 84(f64v) 158 + 159: 49(ivec2) Load 51(u32v) + 160:150(f16vec2) ConvertUToF 159 + Store 152(f16v) 160 + 161: 49(ivec2) Load 51(u32v) + 162: 76(fvec2) ConvertUToF 161 + Store 78(f32v) 162 + 163: 49(ivec2) Load 51(u32v) + 164: 82(f64vec2) ConvertUToF 163 + Store 84(f64v) 164 + 169: 166(bvec2) Load 168(bv) + 173: 52(ivec2) Select 169 172 171 + Store 54(i32v) 173 + 174: 166(bvec2) Load 168(bv) + 179: 49(ivec2) Select 174 178 177 + Store 51(u32v) 179 + 180: 52(ivec2) Load 54(i32v) + 181: 166(bvec2) INotEqual 180 177 + Store 168(bv) 181 + 182: 49(ivec2) Load 51(u32v) + 183: 166(bvec2) INotEqual 182 177 + Store 168(bv) 183 + Return + FunctionEnd + 10(operators(): 2 Function None 3 + 11: Label + 186(u32v): 185(ptr) Variable Function + 191(i32): 19(ptr) Variable Function + 210(i): 19(ptr) Variable Function + 214(uv): 185(ptr) Variable Function + 227(i64): 226(ptr) Variable Function + 260(b): 259(ptr) Variable Function + 187: 184(ivec3) Load 186(u32v) + 189: 188(ivec3) CompositeConstruct 170 170 170 + 190: 184(ivec3) IAdd 187 189 + Store 186(u32v) 190 + 192: 18(int) Load 191(i32) + 193: 18(int) ISub 192 170 + Store 191(i32) 193 + 194: 18(int) Load 191(i32) + 195: 18(int) IAdd 194 170 + Store 191(i32) 195 + 196: 184(ivec3) Load 186(u32v) + 197: 188(ivec3) CompositeConstruct 170 170 170 + 198: 184(ivec3) ISub 196 197 + Store 186(u32v) 198 + 199: 184(ivec3) Load 186(u32v) + 200: 184(ivec3) Not 199 + Store 186(u32v) 200 + 201: 18(int) Load 191(i32) + Store 191(i32) 201 + 202: 184(ivec3) Load 186(u32v) + 203: 184(ivec3) SNegate 202 + Store 186(u32v) 203 + 204: 18(int) Load 191(i32) + 205: 18(int) Load 191(i32) + 206: 18(int) IAdd 205 204 + Store 191(i32) 206 + 207: 184(ivec3) Load 186(u32v) + 208: 184(ivec3) Load 186(u32v) + 209: 184(ivec3) ISub 208 207 + Store 186(u32v) 209 + 211: 18(int) Load 191(i32) + 212: 18(int) Load 210(i) + 213: 18(int) IMul 212 211 + Store 210(i) 213 + 215: 184(ivec3) Load 186(u32v) + 216: 184(ivec3) Load 214(uv) + 217: 184(ivec3) UDiv 216 215 + Store 214(uv) 217 + 218: 18(int) Load 191(i32) + 219: 14(int) Bitcast 218 + 220: 184(ivec3) Load 214(uv) + 221: 184(ivec3) CompositeConstruct 219 219 219 + 222: 184(ivec3) UMod 220 221 + Store 214(uv) 222 + 223: 184(ivec3) Load 186(u32v) + 224: 184(ivec3) Load 214(uv) + 225: 184(ivec3) IAdd 223 224 + Store 214(uv) 225 + 228: 18(int) Load 191(i32) + 229: 57(int64_t) SConvert 228 + 230: 57(int64_t) Load 227(i64) + 231: 57(int64_t) ISub 229 230 + Store 227(i64) 231 + 232: 184(ivec3) Load 186(u32v) + 233: 184(ivec3) Load 214(uv) + 234: 184(ivec3) IMul 232 233 + Store 214(uv) 234 + 235: 18(int) Load 191(i32) + 236: 57(int64_t) SConvert 235 + 237: 57(int64_t) Load 227(i64) + 238: 57(int64_t) IMul 236 237 + Store 227(i64) 238 + 239: 18(int) Load 191(i32) + 240: 18(int) Load 210(i) + 241: 18(int) SMod 239 240 + Store 210(i) 241 + 242: 18(int) Load 191(i32) + 243: 184(ivec3) Load 186(u32v) + 244: 188(ivec3) CompositeConstruct 242 242 242 + 245: 184(ivec3) ShiftLeftLogical 243 244 + Store 186(u32v) 245 + 246: 38(ptr) AccessChain 186(u32v) 176 + 247: 14(int) Load 246 + 248: 18(int) Load 191(i32) + 249: 18(int) ShiftRightArithmetic 248 247 + Store 191(i32) 249 + 250: 57(int64_t) Load 227(i64) + 252: 38(ptr) AccessChain 186(u32v) 251 + 253: 14(int) Load 252 + 254: 57(int64_t) ShiftLeftLogical 250 253 + Store 227(i64) 254 + 255: 184(ivec3) Load 186(u32v) + 256: 18(int) Load 210(i) + 257: 188(ivec3) CompositeConstruct 256 256 256 + 258: 184(ivec3) ShiftLeftLogical 255 257 + Store 214(uv) 258 + 261: 38(ptr) AccessChain 186(u32v) 175 + 262: 14(int) Load 261 + 263: 18(int) Load 191(i32) + 264: 14(int) Bitcast 263 + 265: 165(bool) INotEqual 262 264 + Store 260(b) 265 + 266: 18(int) Load 191(i32) + 267: 14(int) Bitcast 266 + 268: 38(ptr) AccessChain 186(u32v) 175 + 269: 14(int) Load 268 + 270: 165(bool) IEqual 267 269 + Store 260(b) 270 + 271: 38(ptr) AccessChain 186(u32v) 175 + 272: 14(int) Load 271 + 273: 38(ptr) AccessChain 214(uv) 176 + 274: 14(int) Load 273 + 275: 165(bool) UGreaterThan 272 274 + Store 260(b) 275 + 276: 18(int) Load 191(i32) + 277: 18(int) Load 210(i) + 278: 165(bool) SLessThan 276 277 + Store 260(b) 278 + 279: 38(ptr) AccessChain 186(u32v) 176 + 280: 14(int) Load 279 + 281: 38(ptr) AccessChain 214(uv) 175 + 282: 14(int) Load 281 + 283: 165(bool) UGreaterThanEqual 280 282 + Store 260(b) 283 + 284: 18(int) Load 191(i32) + 285: 18(int) Load 210(i) + 286: 165(bool) SLessThanEqual 284 285 + Store 260(b) 286 + 287: 18(int) Load 191(i32) + 288: 14(int) Bitcast 287 + 289: 184(ivec3) Load 214(uv) + 290: 184(ivec3) CompositeConstruct 288 288 288 + 291: 184(ivec3) BitwiseOr 289 290 + Store 214(uv) 291 + 292: 18(int) Load 191(i32) + 293: 18(int) Load 210(i) + 294: 18(int) BitwiseOr 292 293 + Store 210(i) 294 + 295: 18(int) Load 191(i32) + 296: 57(int64_t) SConvert 295 + 297: 57(int64_t) Load 227(i64) + 298: 57(int64_t) BitwiseAnd 297 296 + Store 227(i64) 298 + 299: 184(ivec3) Load 186(u32v) + 300: 184(ivec3) Load 214(uv) + 301: 184(ivec3) BitwiseAnd 299 300 + Store 214(uv) 301 + 302: 18(int) Load 191(i32) + 303: 14(int) Bitcast 302 + 304: 184(ivec3) Load 214(uv) + 305: 184(ivec3) CompositeConstruct 303 303 303 + 306: 184(ivec3) BitwiseXor 304 305 + Store 214(uv) 306 + 307: 184(ivec3) Load 186(u32v) + 308: 18(int) Load 191(i32) + 309: 14(int) Bitcast 308 + 310: 184(ivec3) CompositeConstruct 309 309 309 + 311: 184(ivec3) BitwiseXor 307 310 + Store 186(u32v) 311 + Return + FunctionEnd +12(builtinFuncs(): 2 Function None 3 + 13: Label + 312(i32v): 53(ptr) Variable Function + 315(i32): 19(ptr) Variable Function + 325(u32v): 185(ptr) Variable Function + 327(u32): 38(ptr) Variable Function + 399(i8v4): 398(ptr) Variable Function + 402(i16v2): 104(ptr) Variable Function + 407(u8v4): 406(ptr) Variable Function + 410(u16v2): 131(ptr) Variable Function + 413(i64): 226(ptr) Variable Function + 416(u32v2): 50(ptr) Variable Function + 418(u64): 417(ptr) Variable Function + 422(bv): 421(ptr) Variable Function + 313: 52(ivec2) Load 312(i32v) + 314: 52(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 313 + Store 312(i32v) 314 + 316: 18(int) Load 315(i32) + 317: 18(int) ExtInst 1(GLSL.std.450) 7(SSign) 316 + Store 315(i32) 317 + 318: 52(ivec2) Load 312(i32v) + 319: 18(int) Load 315(i32) + 320: 52(ivec2) CompositeConstruct 319 319 + 321: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 318 320 + Store 312(i32v) 321 + 322: 52(ivec2) Load 312(i32v) + 324: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 322 323 + Store 312(i32v) 324 + 326: 184(ivec3) Load 325(u32v) + 328: 14(int) Load 327(u32) + 329: 184(ivec3) CompositeConstruct 328 328 328 + 330: 184(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 326 329 + Store 325(u32v) 330 + 331: 184(ivec3) Load 325(u32v) + 333: 184(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 331 332 + Store 325(u32v) 333 + 334: 52(ivec2) Load 312(i32v) + 335: 18(int) Load 315(i32) + 336: 52(ivec2) CompositeConstruct 335 335 + 337: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 334 336 + Store 312(i32v) 337 + 338: 52(ivec2) Load 312(i32v) + 339: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 338 323 + Store 312(i32v) 339 + 340: 184(ivec3) Load 325(u32v) + 341: 14(int) Load 327(u32) + 342: 184(ivec3) CompositeConstruct 341 341 341 + 343: 184(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 340 342 + Store 325(u32v) 343 + 344: 184(ivec3) Load 325(u32v) + 345: 184(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 344 332 + Store 325(u32v) 345 + 346: 52(ivec2) Load 312(i32v) + 347: 18(int) Load 315(i32) + 348: 18(int) SNegate 347 + 349: 18(int) Load 315(i32) + 350: 52(ivec2) CompositeConstruct 348 348 + 351: 52(ivec2) CompositeConstruct 349 349 + 352: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 346 350 351 + Store 312(i32v) 352 + 353: 52(ivec2) Load 312(i32v) + 354: 52(ivec2) Load 312(i32v) + 355: 52(ivec2) SNegate 354 + 356: 52(ivec2) Load 312(i32v) + 357: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 353 355 356 + Store 312(i32v) 357 + 358: 184(ivec3) Load 325(u32v) + 359: 14(int) Load 327(u32) + 360: 14(int) SNegate 359 + 361: 14(int) Load 327(u32) + 362: 184(ivec3) CompositeConstruct 360 360 360 + 363: 184(ivec3) CompositeConstruct 361 361 361 + 364: 184(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 358 362 363 + Store 325(u32v) 364 + 365: 184(ivec3) Load 325(u32v) + 366: 184(ivec3) Load 325(u32v) + 367: 184(ivec3) SNegate 366 + 368: 184(ivec3) Load 325(u32v) + 369: 184(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 365 367 368 + Store 325(u32v) 369 + 370: 19(ptr) AccessChain 312(i32v) 175 + 371: 18(int) Load 370 + 372: 19(ptr) AccessChain 312(i32v) 176 + 373: 18(int) Load 372 + 375: 18(int) Select 374 373 371 + Store 315(i32) 375 + 376: 18(int) Load 315(i32) + 377: 52(ivec2) CompositeConstruct 376 376 + 378: 18(int) Load 315(i32) + 379: 18(int) SNegate 378 + 380: 52(ivec2) CompositeConstruct 379 379 + 383: 52(ivec2) Select 382 380 377 + Store 312(i32v) 383 + 384: 38(ptr) AccessChain 325(u32v) 175 + 385: 14(int) Load 384 + 386: 38(ptr) AccessChain 325(u32v) 176 + 387: 14(int) Load 386 + 388: 14(int) Select 374 387 385 + Store 327(u32) 388 + 389: 14(int) Load 327(u32) + 390: 184(ivec3) CompositeConstruct 389 389 389 + 391: 14(int) Load 327(u32) + 392: 14(int) SNegate 391 + 393: 184(ivec3) CompositeConstruct 392 392 392 + 396: 184(ivec3) Select 395 393 390 + Store 325(u32v) 396 + 400: 397(i8vec4) Load 399(i8v4) + 401: 18(int) Bitcast 400 + Store 315(i32) 401 + 403:103(i16vec2) Load 402(i16v2) + 404: 18(int) Bitcast 403 + Store 315(i32) 404 + 408: 405(i8vec4) Load 407(u8v4) + 409: 14(int) Bitcast 408 + Store 327(u32) 409 + 411:110(i16vec2) Load 410(u16v2) + 412: 14(int) Bitcast 411 + Store 327(u32) 412 + 414: 57(int64_t) Load 413(i64) + 415: 52(ivec2) Bitcast 414 + Store 312(i32v) 415 + 419: 63(int64_t) Load 418(u64) + 420: 49(ivec2) Bitcast 419 + Store 416(u32v2) 420 + 423: 184(ivec3) Load 325(u32v) + 424: 14(int) Load 327(u32) + 425: 184(ivec3) CompositeConstruct 424 424 424 + 426: 394(bvec3) ULessThan 423 425 + Store 422(bv) 426 + 427: 52(ivec2) Load 312(i32v) + 428: 18(int) Load 315(i32) + 429: 52(ivec2) CompositeConstruct 428 428 + 430: 166(bvec2) SLessThan 427 429 + 431: 394(bvec3) Load 422(bv) + 432: 394(bvec3) VectorShuffle 431 430 3 4 2 + Store 422(bv) 432 + 433: 184(ivec3) Load 325(u32v) + 434: 14(int) Load 327(u32) + 435: 184(ivec3) CompositeConstruct 434 434 434 + 436: 394(bvec3) ULessThanEqual 433 435 + Store 422(bv) 436 + 437: 52(ivec2) Load 312(i32v) + 438: 18(int) Load 315(i32) + 439: 52(ivec2) CompositeConstruct 438 438 + 440: 166(bvec2) SLessThanEqual 437 439 + 441: 394(bvec3) Load 422(bv) + 442: 394(bvec3) VectorShuffle 441 440 3 4 2 + Store 422(bv) 442 + 443: 184(ivec3) Load 325(u32v) + 444: 14(int) Load 327(u32) + 445: 184(ivec3) CompositeConstruct 444 444 444 + 446: 394(bvec3) UGreaterThan 443 445 + Store 422(bv) 446 + 447: 52(ivec2) Load 312(i32v) + 448: 18(int) Load 315(i32) + 449: 52(ivec2) CompositeConstruct 448 448 + 450: 166(bvec2) SGreaterThan 447 449 + 451: 394(bvec3) Load 422(bv) + 452: 394(bvec3) VectorShuffle 451 450 3 4 2 + Store 422(bv) 452 + 453: 184(ivec3) Load 325(u32v) + 454: 14(int) Load 327(u32) + 455: 184(ivec3) CompositeConstruct 454 454 454 + 456: 394(bvec3) UGreaterThanEqual 453 455 + Store 422(bv) 456 + 457: 52(ivec2) Load 312(i32v) + 458: 18(int) Load 315(i32) + 459: 52(ivec2) CompositeConstruct 458 458 + 460: 166(bvec2) SGreaterThanEqual 457 459 + 461: 394(bvec3) Load 422(bv) + 462: 394(bvec3) VectorShuffle 461 460 3 4 2 + Store 422(bv) 462 + 463: 184(ivec3) Load 325(u32v) + 464: 14(int) Load 327(u32) + 465: 184(ivec3) CompositeConstruct 464 464 464 + 466: 394(bvec3) IEqual 463 465 + Store 422(bv) 466 + 467: 52(ivec2) Load 312(i32v) + 468: 18(int) Load 315(i32) + 469: 52(ivec2) CompositeConstruct 468 468 + 470: 166(bvec2) IEqual 467 469 + 471: 394(bvec3) Load 422(bv) + 472: 394(bvec3) VectorShuffle 471 470 3 4 2 + Store 422(bv) 472 + 473: 184(ivec3) Load 325(u32v) + 474: 14(int) Load 327(u32) + 475: 184(ivec3) CompositeConstruct 474 474 474 + 476: 394(bvec3) INotEqual 473 475 + Store 422(bv) 476 + 477: 52(ivec2) Load 312(i32v) + 478: 18(int) Load 315(i32) + 479: 52(ivec2) CompositeConstruct 478 478 + 480: 166(bvec2) INotEqual 477 479 + 481: 394(bvec3) Load 422(bv) + 482: 394(bvec3) VectorShuffle 481 480 3 4 2 + Store 422(bv) 482 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.int64.frag.out b/deps/glslang/Test/baseResults/spv.int64.frag.out new file mode 100644 index 00000000..f2c54f16 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.int64.frag.out @@ -0,0 +1,688 @@ +spv.int64.frag +error: SPIRV-Tools Validation Errors +error: OpDecorate SpecId decoration target '1' is not a scalar specialization constant. + OpDecorate %su64inc SpecId 105 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 489 + + Capability Shader + Capability Float64 + Capability Int64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_ARB_gpu_shader_int64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" + Name 4 "main" + Name 6 "literal(" + Name 8 "typeCast(" + Name 10 "operators(" + Name 12 "builtinFuncs(" + Name 16 "u64Max" + Name 20 "i64" + Name 28 "Uniforms" + MemberName 28(Uniforms) 0 "index" + Name 30 "" + Name 37 "indexable" + Name 41 "u64" + Name 49 "indexable" + Name 54 "i64v" + Name 58 "bv" + Name 67 "u64v" + Name 76 "iv" + Name 83 "uv" + Name 91 "fv" + Name 97 "dv" + Name 134 "u64v" + Name 139 "i64" + Name 159 "i" + Name 166 "uv" + Name 226 "b" + Name 286 "i64v" + Name 289 "i64" + Name 299 "u64v" + Name 301 "u64" + Name 373 "dv" + Name 392 "iv" + Name 397 "uv" + Name 401 "bv" + Name 462 "Block" + MemberName 462(Block) 0 "i64v" + MemberName 462(Block) 1 "u64" + Name 464 "block" + Name 465 "si64" + Name 466 "su64" + Name 467 "si" + Name 468 "su" + Name 469 "sb" + Name 470 "su64inc" + Name 471 "i64_to_b" + Name 472 "u64_to_b" + Name 473 "b_to_i64" + Name 474 "b_to_u64" + Name 475 "i64_to_i" + Name 476 "i_to_i64" + Name 477 "u64_to_u" + Name 478 "u_to_u64" + Name 479 "u64_to_i64" + Name 480 "i64_to_u64" + Name 482 "u64_to_i" + Name 484 "i_to_u64" + Name 486 "i64_to_u" + Name 488 "u_to_i64" + MemberDecorate 28(Uniforms) 0 Offset 0 + Decorate 28(Uniforms) Block + Decorate 30 DescriptorSet 0 + Decorate 30 Binding 0 + MemberDecorate 462(Block) 0 Offset 0 + MemberDecorate 462(Block) 1 Offset 24 + Decorate 462(Block) Block + Decorate 464(block) DescriptorSet 0 + Decorate 464(block) Binding 1 + Decorate 465(si64) SpecId 100 + Decorate 466(su64) SpecId 101 + Decorate 467(si) SpecId 102 + Decorate 468(su) SpecId 103 + Decorate 469(sb) SpecId 104 + Decorate 470(su64inc) SpecId 105 + 2: TypeVoid + 3: TypeFunction 2 + 14: TypeInt 64 0 + 15: TypePointer Private 14(int64_t) + 16(u64Max): 15(ptr) Variable Private + 17: 14(int64_t) Constant 4294967295 4294967295 + 18: TypeInt 64 1 + 19: TypePointer Function 18(int64_t) + 21: TypeInt 32 0 + 22: 21(int) Constant 3 + 23: TypeArray 18(int64_t) 22 + 24: 18(int64_t) Constant 4008636143 4008636142 + 25: 18(int64_t) Constant 4294967295 4294967295 + 26: 18(int64_t) Constant 0 1 + 27: 23 ConstantComposite 24 25 26 + 28(Uniforms): TypeStruct 21(int) + 29: TypePointer Uniform 28(Uniforms) + 30: 29(ptr) Variable Uniform + 31: TypeInt 32 1 + 32: 31(int) Constant 0 + 33: TypePointer Uniform 21(int) + 36: TypePointer Function 23 + 40: TypePointer Function 14(int64_t) + 42: TypeArray 14(int64_t) 22 + 43: 14(int64_t) Constant 0 1 + 44: 14(int64_t) Constant 4294967295 1 + 45: 42 ConstantComposite 17 43 44 + 48: TypePointer Function 42 + 52: TypeVector 18(int64_t) 2 + 53: TypePointer Function 52(i64vec2) + 55: TypeBool + 56: TypeVector 55(bool) 2 + 57: TypePointer Function 56(bvec2) + 60: 18(int64_t) Constant 0 0 + 61: 18(int64_t) Constant 1 0 + 62: 52(i64vec2) ConstantComposite 60 60 + 63: 52(i64vec2) ConstantComposite 61 61 + 65: TypeVector 14(int64_t) 2 + 66: TypePointer Function 65(i64vec2) + 69: 14(int64_t) Constant 0 0 + 70: 14(int64_t) Constant 1 0 + 71: 65(i64vec2) ConstantComposite 69 69 + 72: 65(i64vec2) ConstantComposite 70 70 + 74: TypeVector 31(int) 2 + 75: TypePointer Function 74(ivec2) + 81: TypeVector 21(int) 2 + 82: TypePointer Function 81(ivec2) + 88: TypeFloat 32 + 89: TypeVector 88(float) 2 + 90: TypePointer Function 89(fvec2) + 94: TypeFloat 64 + 95: TypeVector 94(float64_t) 2 + 96: TypePointer Function 95(f64vec2) + 132: TypeVector 14(int64_t) 3 + 133: TypePointer Function 132(i64vec3) + 136: TypeVector 18(int64_t) 3 + 158: TypePointer Function 31(int) + 164: TypeVector 21(int) 3 + 165: TypePointer Function 164(ivec3) + 199: TypeVector 31(int) 3 + 203: 21(int) Constant 1 + 204: TypePointer Function 21(int) + 217: 21(int) Constant 2 + 225: TypePointer Function 55(bool) + 227: 21(int) Constant 0 + 297: 52(i64vec2) ConstantComposite 25 25 + 306:132(i64vec3) ConstantComposite 69 69 69 + 348: 55(bool) ConstantTrue + 355: 55(bool) ConstantFalse + 356: 56(bvec2) ConstantComposite 355 355 + 368: TypeVector 55(bool) 3 + 369: 368(bvec3) ConstantComposite 355 355 355 + 371: TypeVector 94(float64_t) 3 + 372: TypePointer Function 371(f64vec3) + 377: TypePointer Function 94(float64_t) + 388: 31(int) Constant 1 + 389: 31(int) Constant 2 + 390: 74(ivec2) ConstantComposite 388 389 + 395: 81(ivec2) ConstantComposite 217 22 + 400: TypePointer Function 368(bvec3) + 462(Block): TypeStruct 136(i64vec3) 14(int64_t) + 463: TypePointer Uniform 462(Block) + 464(block): 463(ptr) Variable Uniform + 465(si64): 18(int64_t) SpecConstant 4294967286 4294967295 + 466(su64): 14(int64_t) SpecConstant 20 0 + 467(si): 31(int) SpecConstant 4294967291 + 468(su): 21(int) SpecConstant 4 + 469(sb): 55(bool) SpecConstantTrue + 470(su64inc): 14(int64_t) SpecConstantOp 128 466(su64) 70 + 471(i64_to_b): 55(bool) SpecConstantOp 171 465(si64) 69 + 472(u64_to_b): 55(bool) SpecConstantOp 171 466(su64) 69 + 473(b_to_i64): 18(int64_t) SpecConstantOp 169 469(sb) 61 60 + 474(b_to_u64): 14(int64_t) SpecConstantOp 169 469(sb) 70 69 + 475(i64_to_i): 31(int) SpecConstantOp 114 465(si64) + 476(i_to_i64): 18(int64_t) SpecConstantOp 114 467(si) + 477(u64_to_u): 21(int) SpecConstantOp 113 466(su64) + 478(u_to_u64): 14(int64_t) SpecConstantOp 113 468(su) + 479(u64_to_i64): 18(int64_t) SpecConstantOp 128 466(su64) 69 + 480(i64_to_u64): 14(int64_t) SpecConstantOp 128 465(si64) 69 + 481: 21(int) SpecConstantOp 113 466(su64) + 482(u64_to_i): 31(int) SpecConstantOp 128 481 227 + 483: 18(int64_t) SpecConstantOp 114 467(si) + 484(i_to_u64): 14(int64_t) SpecConstantOp 128 483 69 + 485: 31(int) SpecConstantOp 114 465(si64) + 486(i64_to_u): 21(int) SpecConstantOp 128 485 227 + 487: 14(int64_t) SpecConstantOp 113 468(su) + 488(u_to_i64): 18(int64_t) SpecConstantOp 128 487 69 + 4(main): 2 Function None 3 + 5: Label + Store 16(u64Max) 17 + Return + FunctionEnd + 6(literal(): 2 Function None 3 + 7: Label + 20(i64): 19(ptr) Variable Function + 37(indexable): 36(ptr) Variable Function + 41(u64): 40(ptr) Variable Function + 49(indexable): 48(ptr) Variable Function + 34: 33(ptr) AccessChain 30 32 + 35: 21(int) Load 34 + Store 37(indexable) 27 + 38: 19(ptr) AccessChain 37(indexable) 35 + 39: 18(int64_t) Load 38 + Store 20(i64) 39 + 46: 33(ptr) AccessChain 30 32 + 47: 21(int) Load 46 + Store 49(indexable) 45 + 50: 40(ptr) AccessChain 49(indexable) 47 + 51: 14(int64_t) Load 50 + Store 41(u64) 51 + Return + FunctionEnd + 8(typeCast(): 2 Function None 3 + 9: Label + 54(i64v): 53(ptr) Variable Function + 58(bv): 57(ptr) Variable Function + 67(u64v): 66(ptr) Variable Function + 76(iv): 75(ptr) Variable Function + 83(uv): 82(ptr) Variable Function + 91(fv): 90(ptr) Variable Function + 97(dv): 96(ptr) Variable Function + 59: 56(bvec2) Load 58(bv) + 64: 52(i64vec2) Select 59 63 62 + Store 54(i64v) 64 + 68: 56(bvec2) Load 58(bv) + 73: 65(i64vec2) Select 68 72 71 + Store 67(u64v) 73 + 77: 74(ivec2) Load 76(iv) + 78: 52(i64vec2) SConvert 77 + Store 54(i64v) 78 + 79: 52(i64vec2) Load 54(i64v) + 80: 74(ivec2) SConvert 79 + Store 76(iv) 80 + 84: 81(ivec2) Load 83(uv) + 85: 65(i64vec2) UConvert 84 + Store 67(u64v) 85 + 86: 65(i64vec2) Load 67(u64v) + 87: 81(ivec2) UConvert 86 + Store 83(uv) 87 + 92: 52(i64vec2) Load 54(i64v) + 93: 89(fvec2) ConvertSToF 92 + Store 91(fv) 93 + 98: 52(i64vec2) Load 54(i64v) + 99: 95(f64vec2) ConvertSToF 98 + Store 97(dv) 99 + 100: 65(i64vec2) Load 67(u64v) + 101: 89(fvec2) ConvertUToF 100 + Store 91(fv) 101 + 102: 65(i64vec2) Load 67(u64v) + 103: 95(f64vec2) ConvertUToF 102 + Store 97(dv) 103 + 104: 89(fvec2) Load 91(fv) + 105: 52(i64vec2) ConvertFToS 104 + Store 54(i64v) 105 + 106: 95(f64vec2) Load 97(dv) + 107: 52(i64vec2) ConvertFToS 106 + Store 54(i64v) 107 + 108: 89(fvec2) Load 91(fv) + 109: 65(i64vec2) ConvertFToU 108 + Store 67(u64v) 109 + 110: 95(f64vec2) Load 97(dv) + 111: 65(i64vec2) ConvertFToU 110 + Store 67(u64v) 111 + 112: 52(i64vec2) Load 54(i64v) + 113: 56(bvec2) INotEqual 112 71 + Store 58(bv) 113 + 114: 65(i64vec2) Load 67(u64v) + 115: 56(bvec2) INotEqual 114 71 + Store 58(bv) 115 + 116: 52(i64vec2) Load 54(i64v) + 117: 65(i64vec2) Bitcast 116 + Store 67(u64v) 117 + 118: 65(i64vec2) Load 67(u64v) + 119: 52(i64vec2) Bitcast 118 + Store 54(i64v) 119 + 120: 52(i64vec2) Load 54(i64v) + 121: 74(ivec2) SConvert 120 + 122: 81(ivec2) Bitcast 121 + Store 83(uv) 122 + 123: 81(ivec2) Load 83(uv) + 124: 65(i64vec2) UConvert 123 + 125: 52(i64vec2) Bitcast 124 + Store 54(i64v) 125 + 126: 65(i64vec2) Load 67(u64v) + 127: 81(ivec2) UConvert 126 + 128: 74(ivec2) Bitcast 127 + Store 76(iv) 128 + 129: 74(ivec2) Load 76(iv) + 130: 52(i64vec2) SConvert 129 + 131: 65(i64vec2) Bitcast 130 + Store 67(u64v) 131 + Return + FunctionEnd + 10(operators(): 2 Function None 3 + 11: Label + 134(u64v): 133(ptr) Variable Function + 139(i64): 19(ptr) Variable Function + 159(i): 158(ptr) Variable Function + 166(uv): 165(ptr) Variable Function + 226(b): 225(ptr) Variable Function + 135:132(i64vec3) Load 134(u64v) + 137:136(i64vec3) CompositeConstruct 61 61 61 + 138:132(i64vec3) IAdd 135 137 + Store 134(u64v) 138 + 140: 18(int64_t) Load 139(i64) + 141: 18(int64_t) ISub 140 61 + Store 139(i64) 141 + 142: 18(int64_t) Load 139(i64) + 143: 18(int64_t) IAdd 142 61 + Store 139(i64) 143 + 144:132(i64vec3) Load 134(u64v) + 145:136(i64vec3) CompositeConstruct 61 61 61 + 146:132(i64vec3) ISub 144 145 + Store 134(u64v) 146 + 147:132(i64vec3) Load 134(u64v) + 148:132(i64vec3) Not 147 + Store 134(u64v) 148 + 149: 18(int64_t) Load 139(i64) + Store 139(i64) 149 + 150:132(i64vec3) Load 134(u64v) + 151:132(i64vec3) SNegate 150 + Store 134(u64v) 151 + 152: 18(int64_t) Load 139(i64) + 153: 18(int64_t) Load 139(i64) + 154: 18(int64_t) IAdd 153 152 + Store 139(i64) 154 + 155:132(i64vec3) Load 134(u64v) + 156:132(i64vec3) Load 134(u64v) + 157:132(i64vec3) ISub 156 155 + Store 134(u64v) 157 + 160: 31(int) Load 159(i) + 161: 18(int64_t) SConvert 160 + 162: 18(int64_t) Load 139(i64) + 163: 18(int64_t) IMul 162 161 + Store 139(i64) 163 + 167: 164(ivec3) Load 166(uv) + 168:132(i64vec3) UConvert 167 + 169:132(i64vec3) Load 134(u64v) + 170:132(i64vec3) UDiv 169 168 + Store 134(u64v) 170 + 171: 31(int) Load 159(i) + 172: 18(int64_t) SConvert 171 + 173: 14(int64_t) Bitcast 172 + 174:132(i64vec3) Load 134(u64v) + 175:132(i64vec3) CompositeConstruct 173 173 173 + 176:132(i64vec3) UMod 174 175 + Store 134(u64v) 176 + 177:132(i64vec3) Load 134(u64v) + 178: 164(ivec3) Load 166(uv) + 179:132(i64vec3) UConvert 178 + 180:132(i64vec3) IAdd 177 179 + Store 134(u64v) 180 + 181: 18(int64_t) Load 139(i64) + 182: 31(int) Load 159(i) + 183: 18(int64_t) SConvert 182 + 184: 18(int64_t) ISub 181 183 + Store 139(i64) 184 + 185:132(i64vec3) Load 134(u64v) + 186: 164(ivec3) Load 166(uv) + 187:132(i64vec3) UConvert 186 + 188:132(i64vec3) IMul 185 187 + Store 134(u64v) 188 + 189: 18(int64_t) Load 139(i64) + 190: 31(int) Load 159(i) + 191: 18(int64_t) SConvert 190 + 192: 18(int64_t) IMul 189 191 + Store 139(i64) 192 + 193: 18(int64_t) Load 139(i64) + 194: 31(int) Load 159(i) + 195: 18(int64_t) SConvert 194 + 196: 18(int64_t) SMod 193 195 + Store 139(i64) 196 + 197:132(i64vec3) Load 134(u64v) + 198: 31(int) Load 159(i) + 200: 199(ivec3) CompositeConstruct 198 198 198 + 201:132(i64vec3) ShiftLeftLogical 197 200 + Store 134(u64v) 201 + 202: 18(int64_t) Load 139(i64) + 205: 204(ptr) AccessChain 166(uv) 203 + 206: 21(int) Load 205 + 207: 18(int64_t) ShiftRightArithmetic 202 206 + Store 139(i64) 207 + 208: 31(int) Load 159(i) + 209:132(i64vec3) Load 134(u64v) + 210: 199(ivec3) CompositeConstruct 208 208 208 + 211:132(i64vec3) ShiftLeftLogical 209 210 + Store 134(u64v) 211 + 212: 204(ptr) AccessChain 166(uv) 203 + 213: 21(int) Load 212 + 214: 18(int64_t) Load 139(i64) + 215: 18(int64_t) ShiftRightArithmetic 214 213 + Store 139(i64) 215 + 216: 18(int64_t) Load 139(i64) + 218: 40(ptr) AccessChain 134(u64v) 217 + 219: 14(int64_t) Load 218 + 220: 18(int64_t) ShiftLeftLogical 216 219 + Store 139(i64) 220 + 221:132(i64vec3) Load 134(u64v) + 222: 18(int64_t) Load 139(i64) + 223:136(i64vec3) CompositeConstruct 222 222 222 + 224:132(i64vec3) ShiftLeftLogical 221 223 + Store 134(u64v) 224 + 228: 40(ptr) AccessChain 134(u64v) 227 + 229: 14(int64_t) Load 228 + 230: 18(int64_t) Load 139(i64) + 231: 14(int64_t) Bitcast 230 + 232: 55(bool) INotEqual 229 231 + Store 226(b) 232 + 233: 18(int64_t) Load 139(i64) + 234: 14(int64_t) Bitcast 233 + 235: 40(ptr) AccessChain 134(u64v) 227 + 236: 14(int64_t) Load 235 + 237: 55(bool) IEqual 234 236 + Store 226(b) 237 + 238: 40(ptr) AccessChain 134(u64v) 227 + 239: 14(int64_t) Load 238 + 240: 204(ptr) AccessChain 166(uv) 203 + 241: 21(int) Load 240 + 242: 14(int64_t) UConvert 241 + 243: 55(bool) UGreaterThan 239 242 + Store 226(b) 243 + 244: 18(int64_t) Load 139(i64) + 245: 31(int) Load 159(i) + 246: 18(int64_t) SConvert 245 + 247: 55(bool) SLessThan 244 246 + Store 226(b) 247 + 248: 40(ptr) AccessChain 134(u64v) 203 + 249: 14(int64_t) Load 248 + 250: 204(ptr) AccessChain 166(uv) 227 + 251: 21(int) Load 250 + 252: 14(int64_t) UConvert 251 + 253: 55(bool) UGreaterThanEqual 249 252 + Store 226(b) 253 + 254: 18(int64_t) Load 139(i64) + 255: 31(int) Load 159(i) + 256: 18(int64_t) SConvert 255 + 257: 55(bool) SLessThanEqual 254 256 + Store 226(b) 257 + 258: 31(int) Load 159(i) + 259: 18(int64_t) SConvert 258 + 260: 14(int64_t) Bitcast 259 + 261:132(i64vec3) Load 134(u64v) + 262:132(i64vec3) CompositeConstruct 260 260 260 + 263:132(i64vec3) BitwiseOr 261 262 + Store 134(u64v) 263 + 264: 18(int64_t) Load 139(i64) + 265: 31(int) Load 159(i) + 266: 18(int64_t) SConvert 265 + 267: 18(int64_t) BitwiseOr 264 266 + Store 139(i64) 267 + 268: 31(int) Load 159(i) + 269: 18(int64_t) SConvert 268 + 270: 18(int64_t) Load 139(i64) + 271: 18(int64_t) BitwiseAnd 270 269 + Store 139(i64) 271 + 272:132(i64vec3) Load 134(u64v) + 273: 164(ivec3) Load 166(uv) + 274:132(i64vec3) UConvert 273 + 275:132(i64vec3) BitwiseAnd 272 274 + Store 134(u64v) 275 + 276: 18(int64_t) Load 139(i64) + 277: 14(int64_t) Bitcast 276 + 278:132(i64vec3) Load 134(u64v) + 279:132(i64vec3) CompositeConstruct 277 277 277 + 280:132(i64vec3) BitwiseXor 278 279 + Store 134(u64v) 280 + 281:132(i64vec3) Load 134(u64v) + 282: 18(int64_t) Load 139(i64) + 283: 14(int64_t) Bitcast 282 + 284:132(i64vec3) CompositeConstruct 283 283 283 + 285:132(i64vec3) BitwiseXor 281 284 + Store 134(u64v) 285 + Return + FunctionEnd +12(builtinFuncs(): 2 Function None 3 + 13: Label + 286(i64v): 53(ptr) Variable Function + 289(i64): 19(ptr) Variable Function + 299(u64v): 133(ptr) Variable Function + 301(u64): 40(ptr) Variable Function + 373(dv): 372(ptr) Variable Function + 392(iv): 75(ptr) Variable Function + 397(uv): 82(ptr) Variable Function + 401(bv): 400(ptr) Variable Function + 287: 52(i64vec2) Load 286(i64v) + 288: 52(i64vec2) ExtInst 1(GLSL.std.450) 5(SAbs) 287 + Store 286(i64v) 288 + 290: 18(int64_t) Load 289(i64) + 291: 18(int64_t) ExtInst 1(GLSL.std.450) 7(SSign) 290 + Store 289(i64) 291 + 292: 52(i64vec2) Load 286(i64v) + 293: 18(int64_t) Load 289(i64) + 294: 52(i64vec2) CompositeConstruct 293 293 + 295: 52(i64vec2) ExtInst 1(GLSL.std.450) 39(SMin) 292 294 + Store 286(i64v) 295 + 296: 52(i64vec2) Load 286(i64v) + 298: 52(i64vec2) ExtInst 1(GLSL.std.450) 39(SMin) 296 297 + Store 286(i64v) 298 + 300:132(i64vec3) Load 299(u64v) + 302: 14(int64_t) Load 301(u64) + 303:132(i64vec3) CompositeConstruct 302 302 302 + 304:132(i64vec3) ExtInst 1(GLSL.std.450) 38(UMin) 300 303 + Store 299(u64v) 304 + 305:132(i64vec3) Load 299(u64v) + 307:132(i64vec3) ExtInst 1(GLSL.std.450) 38(UMin) 305 306 + Store 299(u64v) 307 + 308: 52(i64vec2) Load 286(i64v) + 309: 18(int64_t) Load 289(i64) + 310: 52(i64vec2) CompositeConstruct 309 309 + 311: 52(i64vec2) ExtInst 1(GLSL.std.450) 42(SMax) 308 310 + Store 286(i64v) 311 + 312: 52(i64vec2) Load 286(i64v) + 313: 52(i64vec2) ExtInst 1(GLSL.std.450) 42(SMax) 312 297 + Store 286(i64v) 313 + 314:132(i64vec3) Load 299(u64v) + 315: 14(int64_t) Load 301(u64) + 316:132(i64vec3) CompositeConstruct 315 315 315 + 317:132(i64vec3) ExtInst 1(GLSL.std.450) 41(UMax) 314 316 + Store 299(u64v) 317 + 318:132(i64vec3) Load 299(u64v) + 319:132(i64vec3) ExtInst 1(GLSL.std.450) 41(UMax) 318 306 + Store 299(u64v) 319 + 320: 52(i64vec2) Load 286(i64v) + 321: 18(int64_t) Load 289(i64) + 322: 18(int64_t) SNegate 321 + 323: 18(int64_t) Load 289(i64) + 324: 52(i64vec2) CompositeConstruct 322 322 + 325: 52(i64vec2) CompositeConstruct 323 323 + 326: 52(i64vec2) ExtInst 1(GLSL.std.450) 45(SClamp) 320 324 325 + Store 286(i64v) 326 + 327: 52(i64vec2) Load 286(i64v) + 328: 52(i64vec2) Load 286(i64v) + 329: 52(i64vec2) SNegate 328 + 330: 52(i64vec2) Load 286(i64v) + 331: 52(i64vec2) ExtInst 1(GLSL.std.450) 45(SClamp) 327 329 330 + Store 286(i64v) 331 + 332:132(i64vec3) Load 299(u64v) + 333: 14(int64_t) Load 301(u64) + 334: 14(int64_t) SNegate 333 + 335: 14(int64_t) Load 301(u64) + 336:132(i64vec3) CompositeConstruct 334 334 334 + 337:132(i64vec3) CompositeConstruct 335 335 335 + 338:132(i64vec3) ExtInst 1(GLSL.std.450) 44(UClamp) 332 336 337 + Store 299(u64v) 338 + 339:132(i64vec3) Load 299(u64v) + 340:132(i64vec3) Load 299(u64v) + 341:132(i64vec3) SNegate 340 + 342:132(i64vec3) Load 299(u64v) + 343:132(i64vec3) ExtInst 1(GLSL.std.450) 44(UClamp) 339 341 342 + Store 299(u64v) 343 + 344: 19(ptr) AccessChain 286(i64v) 227 + 345: 18(int64_t) Load 344 + 346: 19(ptr) AccessChain 286(i64v) 203 + 347: 18(int64_t) Load 346 + 349: 18(int64_t) Select 348 347 345 + Store 289(i64) 349 + 350: 18(int64_t) Load 289(i64) + 351: 52(i64vec2) CompositeConstruct 350 350 + 352: 18(int64_t) Load 289(i64) + 353: 18(int64_t) SNegate 352 + 354: 52(i64vec2) CompositeConstruct 353 353 + 357: 52(i64vec2) Select 356 354 351 + Store 286(i64v) 357 + 358: 40(ptr) AccessChain 299(u64v) 227 + 359: 14(int64_t) Load 358 + 360: 40(ptr) AccessChain 299(u64v) 203 + 361: 14(int64_t) Load 360 + 362: 14(int64_t) Select 348 361 359 + Store 301(u64) 362 + 363: 14(int64_t) Load 301(u64) + 364:132(i64vec3) CompositeConstruct 363 363 363 + 365: 14(int64_t) Load 301(u64) + 366: 14(int64_t) SNegate 365 + 367:132(i64vec3) CompositeConstruct 366 366 366 + 370:132(i64vec3) Select 369 367 364 + Store 299(u64v) 370 + 374:371(f64vec3) Load 373(dv) + 375: 95(f64vec2) VectorShuffle 374 374 0 1 + 376: 52(i64vec2) Bitcast 375 + Store 286(i64v) 376 + 378: 377(ptr) AccessChain 373(dv) 217 + 379:94(float64_t) Load 378 + 380: 14(int64_t) Bitcast 379 + 381: 40(ptr) AccessChain 299(u64v) 227 + Store 381 380 + 382: 52(i64vec2) Load 286(i64v) + 383: 95(f64vec2) Bitcast 382 + 384:371(f64vec3) Load 373(dv) + 385:371(f64vec3) VectorShuffle 384 383 3 4 2 + Store 373(dv) 385 + 386:132(i64vec3) Load 299(u64v) + 387:371(f64vec3) Bitcast 386 + Store 373(dv) 387 + 391: 18(int64_t) Bitcast 390 + Store 289(i64) 391 + 393: 18(int64_t) Load 289(i64) + 394: 74(ivec2) Bitcast 393 + Store 392(iv) 394 + 396: 14(int64_t) Bitcast 395 + Store 301(u64) 396 + 398: 14(int64_t) Load 301(u64) + 399: 81(ivec2) Bitcast 398 + Store 397(uv) 399 + 402:132(i64vec3) Load 299(u64v) + 403: 14(int64_t) Load 301(u64) + 404:132(i64vec3) CompositeConstruct 403 403 403 + 405: 368(bvec3) ULessThan 402 404 + Store 401(bv) 405 + 406: 52(i64vec2) Load 286(i64v) + 407: 18(int64_t) Load 289(i64) + 408: 52(i64vec2) CompositeConstruct 407 407 + 409: 56(bvec2) SLessThan 406 408 + 410: 368(bvec3) Load 401(bv) + 411: 368(bvec3) VectorShuffle 410 409 3 4 2 + Store 401(bv) 411 + 412:132(i64vec3) Load 299(u64v) + 413: 14(int64_t) Load 301(u64) + 414:132(i64vec3) CompositeConstruct 413 413 413 + 415: 368(bvec3) ULessThanEqual 412 414 + Store 401(bv) 415 + 416: 52(i64vec2) Load 286(i64v) + 417: 18(int64_t) Load 289(i64) + 418: 52(i64vec2) CompositeConstruct 417 417 + 419: 56(bvec2) SLessThanEqual 416 418 + 420: 368(bvec3) Load 401(bv) + 421: 368(bvec3) VectorShuffle 420 419 3 4 2 + Store 401(bv) 421 + 422:132(i64vec3) Load 299(u64v) + 423: 14(int64_t) Load 301(u64) + 424:132(i64vec3) CompositeConstruct 423 423 423 + 425: 368(bvec3) UGreaterThan 422 424 + Store 401(bv) 425 + 426: 52(i64vec2) Load 286(i64v) + 427: 18(int64_t) Load 289(i64) + 428: 52(i64vec2) CompositeConstruct 427 427 + 429: 56(bvec2) SGreaterThan 426 428 + 430: 368(bvec3) Load 401(bv) + 431: 368(bvec3) VectorShuffle 430 429 3 4 2 + Store 401(bv) 431 + 432:132(i64vec3) Load 299(u64v) + 433: 14(int64_t) Load 301(u64) + 434:132(i64vec3) CompositeConstruct 433 433 433 + 435: 368(bvec3) UGreaterThanEqual 432 434 + Store 401(bv) 435 + 436: 52(i64vec2) Load 286(i64v) + 437: 18(int64_t) Load 289(i64) + 438: 52(i64vec2) CompositeConstruct 437 437 + 439: 56(bvec2) SGreaterThanEqual 436 438 + 440: 368(bvec3) Load 401(bv) + 441: 368(bvec3) VectorShuffle 440 439 3 4 2 + Store 401(bv) 441 + 442:132(i64vec3) Load 299(u64v) + 443: 14(int64_t) Load 301(u64) + 444:132(i64vec3) CompositeConstruct 443 443 443 + 445: 368(bvec3) IEqual 442 444 + Store 401(bv) 445 + 446: 52(i64vec2) Load 286(i64v) + 447: 18(int64_t) Load 289(i64) + 448: 52(i64vec2) CompositeConstruct 447 447 + 449: 56(bvec2) IEqual 446 448 + 450: 368(bvec3) Load 401(bv) + 451: 368(bvec3) VectorShuffle 450 449 3 4 2 + Store 401(bv) 451 + 452:132(i64vec3) Load 299(u64v) + 453: 14(int64_t) Load 301(u64) + 454:132(i64vec3) CompositeConstruct 453 453 453 + 455: 368(bvec3) INotEqual 452 454 + Store 401(bv) 455 + 456: 52(i64vec2) Load 286(i64v) + 457: 18(int64_t) Load 289(i64) + 458: 52(i64vec2) CompositeConstruct 457 457 + 459: 56(bvec2) INotEqual 456 458 + 460: 368(bvec3) Load 401(bv) + 461: 368(bvec3) VectorShuffle 460 459 3 4 2 + Store 401(bv) 461 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.int8.frag.out b/deps/glslang/Test/baseResults/spv.int8.frag.out new file mode 100644 index 00000000..1c65384f --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.int8.frag.out @@ -0,0 +1,741 @@ +spv.int8.frag +error: SPIRV-Tools Validation Errors +error: Capability Float16 is not allowed by Vulkan 1.1 specification (or requires extension) + OpCapability Float16 + +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 518 + + Capability Shader + Capability Float16 + Capability Float64 + Capability Int64 + Capability Int16 + Capability Int8 + Capability CapabilityUniformAndStorageBuffer8BitAccess + Extension "SPV_KHR_8bit_storage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_KHX_shader_explicit_arithmetic_types" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int8" + Name 4 "main" + Name 6 "literal(" + Name 8 "typeCast8(" + Name 10 "operators(" + Name 12 "builtinFuncs(" + Name 16 "i8" + Name 24 "Uniforms" + MemberName 24(Uniforms) 0 "index" + Name 26 "" + Name 33 "indexable" + Name 38 "u8" + Name 46 "indexable" + Name 51 "u8v" + Name 54 "i8v" + Name 60 "i16v" + Name 70 "i32v" + Name 78 "u32v" + Name 85 "i64v" + Name 91 "u64v" + Name 105 "f16v" + Name 111 "f32v" + Name 117 "f64v" + Name 144 "u16v" + Name 174 "bv" + Name 192 "u8v" + Name 197 "i8" + Name 217 "i" + Name 224 "uv" + Name 240 "i16" + Name 276 "b" + Name 338 "i8v" + Name 341 "i8" + Name 351 "u8v" + Name 353 "u8" + Name 423 "i16" + Name 426 "i32" + Name 429 "i8v4" + Name 433 "u16" + Name 434 "u8v2" + Name 437 "u32" + Name 440 "u8v4" + Name 452 "bv" + Name 513 "Block" + MemberName 513(Block) 0 "i8" + MemberName 513(Block) 1 "i8v2" + MemberName 513(Block) 2 "i8v3" + MemberName 513(Block) 3 "i8v4" + MemberName 513(Block) 4 "u8" + MemberName 513(Block) 5 "u8v2" + MemberName 513(Block) 6 "u8v3" + MemberName 513(Block) 7 "u8v4" + Name 515 "block" + Name 516 "si8" + Name 517 "su8" + MemberDecorate 24(Uniforms) 0 Offset 0 + Decorate 24(Uniforms) Block + Decorate 26 DescriptorSet 0 + Decorate 26 Binding 0 + MemberDecorate 513(Block) 0 Offset 0 + MemberDecorate 513(Block) 1 Offset 2 + MemberDecorate 513(Block) 2 Offset 4 + MemberDecorate 513(Block) 3 Offset 8 + MemberDecorate 513(Block) 4 Offset 12 + MemberDecorate 513(Block) 5 Offset 14 + MemberDecorate 513(Block) 6 Offset 16 + MemberDecorate 513(Block) 7 Offset 20 + Decorate 513(Block) Block + Decorate 515(block) DescriptorSet 0 + Decorate 515(block) Binding 1 + Decorate 516(si8) SpecId 100 + Decorate 517(su8) SpecId 101 + 2: TypeVoid + 3: TypeFunction 2 + 14: TypeInt 8 1 + 15: TypePointer Function 14(int8_t) + 17: TypeInt 32 0 + 18: 17(int) Constant 3 + 19: TypeArray 14(int8_t) 18 + 20: 14(int8_t) Constant 4294967279 + 21: 14(int8_t) Constant 4294967295 + 22: 14(int8_t) Constant 0 + 23: 19 ConstantComposite 20 21 22 + 24(Uniforms): TypeStruct 17(int) + 25: TypePointer Uniform 24(Uniforms) + 26: 25(ptr) Variable Uniform + 27: TypeInt 32 1 + 28: 27(int) Constant 0 + 29: TypePointer Uniform 17(int) + 32: TypePointer Function 19 + 36: TypeInt 8 0 + 37: TypePointer Function 36(int8_t) + 39: TypeArray 36(int8_t) 18 + 40: 36(int8_t) Constant 255 + 41: 36(int8_t) Constant 127 + 42: 39 ConstantComposite 40 40 41 + 45: TypePointer Function 39 + 49: TypeVector 36(int8_t) 2 + 50: TypePointer Function 49(i8vec2) + 52: TypeVector 14(int8_t) 2 + 53: TypePointer Function 52(i8vec2) + 57: TypeInt 16 1 + 58: TypeVector 57(int16_t) 2 + 59: TypePointer Function 58(i16vec2) + 64: TypeInt 16 0 + 65: TypeVector 64(int16_t) 2 + 68: TypeVector 27(int) 2 + 69: TypePointer Function 68(ivec2) + 74: TypeVector 17(int) 2 + 77: TypePointer Function 74(ivec2) + 82: TypeInt 64 1 + 83: TypeVector 82(int64_t) 2 + 84: TypePointer Function 83(i64vec2) + 88: TypeInt 64 0 + 89: TypeVector 88(int64_t) 2 + 90: TypePointer Function 89(i64vec2) + 102: TypeFloat 16 + 103: TypeVector 102(float16_t) 2 + 104: TypePointer Function 103(f16vec2) + 108: TypeFloat 32 + 109: TypeVector 108(float) 2 + 110: TypePointer Function 109(fvec2) + 114: TypeFloat 64 + 115: TypeVector 114(float64_t) 2 + 116: TypePointer Function 115(f64vec2) + 143: TypePointer Function 65(i16vec2) + 171: TypeBool + 172: TypeVector 171(bool) 2 + 173: TypePointer Function 172(bvec2) + 176: 14(int8_t) Constant 1 + 177: 52(i8vec2) ConstantComposite 22 22 + 178: 52(i8vec2) ConstantComposite 176 176 + 181: 36(int8_t) Constant 0 + 182: 36(int8_t) Constant 1 + 183: 49(i8vec2) ConstantComposite 181 181 + 184: 49(i8vec2) ConstantComposite 182 182 + 190: TypeVector 36(int8_t) 3 + 191: TypePointer Function 190(i8vec3) + 194: TypeVector 14(int8_t) 3 + 216: TypePointer Function 27(int) + 222: TypeVector 17(int) 3 + 223: TypePointer Function 222(ivec3) + 239: TypePointer Function 57(int16_t) + 261: 17(int) Constant 1 + 267: 17(int) Constant 2 + 275: TypePointer Function 171(bool) + 277: 17(int) Constant 0 + 291: TypePointer Function 17(int) + 349: 52(i8vec2) ConstantComposite 21 21 + 358: 190(i8vec3) ConstantComposite 181 181 181 + 400: 171(bool) ConstantTrue + 407: 171(bool) ConstantFalse + 408: 172(bvec2) ConstantComposite 407 407 + 420: TypeVector 171(bool) 3 + 421: 420(bvec3) ConstantComposite 407 407 407 + 427: TypeVector 14(int8_t) 4 + 428: TypePointer Function 427(i8vec4) + 432: TypePointer Function 64(int16_t) + 438: TypeVector 36(int8_t) 4 + 439: TypePointer Function 438(i8vec4) + 451: TypePointer Function 420(bvec3) + 513(Block): TypeStruct 14(int8_t) 52(i8vec2) 194(i8vec3) 427(i8vec4) 36(int8_t) 49(i8vec2) 190(i8vec3) 438(i8vec4) + 514: TypePointer Uniform 513(Block) + 515(block): 514(ptr) Variable Uniform + 516(si8): 14(int8_t) SpecConstant 4294967286 + 517(su8): 36(int8_t) SpecConstant 20 + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd + 6(literal(): 2 Function None 3 + 7: Label + 16(i8): 15(ptr) Variable Function + 33(indexable): 32(ptr) Variable Function + 38(u8): 37(ptr) Variable Function + 46(indexable): 45(ptr) Variable Function + 30: 29(ptr) AccessChain 26 28 + 31: 17(int) Load 30 + Store 33(indexable) 23 + 34: 15(ptr) AccessChain 33(indexable) 31 + 35: 14(int8_t) Load 34 + Store 16(i8) 35 + 43: 29(ptr) AccessChain 26 28 + 44: 17(int) Load 43 + Store 46(indexable) 42 + 47: 37(ptr) AccessChain 46(indexable) 44 + 48: 36(int8_t) Load 47 + Store 38(u8) 48 + Return + FunctionEnd + 8(typeCast8(): 2 Function None 3 + 9: Label + 51(u8v): 50(ptr) Variable Function + 54(i8v): 53(ptr) Variable Function + 60(i16v): 59(ptr) Variable Function + 70(i32v): 69(ptr) Variable Function + 78(u32v): 77(ptr) Variable Function + 85(i64v): 84(ptr) Variable Function + 91(u64v): 90(ptr) Variable Function + 105(f16v): 104(ptr) Variable Function + 111(f32v): 110(ptr) Variable Function + 117(f64v): 116(ptr) Variable Function + 144(u16v): 143(ptr) Variable Function + 174(bv): 173(ptr) Variable Function + 55: 52(i8vec2) Load 54(i8v) + 56: 49(i8vec2) Bitcast 55 + Store 51(u8v) 56 + 61: 52(i8vec2) Load 54(i8v) + 62: 58(i16vec2) SConvert 61 + Store 60(i16v) 62 + 63: 49(i8vec2) Load 51(u8v) + 66: 65(i16vec2) UConvert 63 + 67: 58(i16vec2) Bitcast 66 + Store 60(i16v) 67 + 71: 52(i8vec2) Load 54(i8v) + 72: 68(ivec2) SConvert 71 + Store 70(i32v) 72 + 73: 49(i8vec2) Load 51(u8v) + 75: 74(ivec2) UConvert 73 + 76: 68(ivec2) Bitcast 75 + Store 70(i32v) 76 + 79: 52(i8vec2) Load 54(i8v) + 80: 68(ivec2) SConvert 79 + 81: 74(ivec2) Bitcast 80 + Store 78(u32v) 81 + 86: 52(i8vec2) Load 54(i8v) + 87: 83(i64vec2) SConvert 86 + Store 85(i64v) 87 + 92: 52(i8vec2) Load 54(i8v) + 93: 83(i64vec2) SConvert 92 + 94: 89(i64vec2) Bitcast 93 + Store 91(u64v) 94 + 95: 49(i8vec2) Load 51(u8v) + 96: 74(ivec2) UConvert 95 + Store 78(u32v) 96 + 97: 49(i8vec2) Load 51(u8v) + 98: 89(i64vec2) UConvert 97 + 99: 83(i64vec2) Bitcast 98 + Store 85(i64v) 99 + 100: 49(i8vec2) Load 51(u8v) + 101: 89(i64vec2) UConvert 100 + Store 91(u64v) 101 + 106: 52(i8vec2) Load 54(i8v) + 107:103(f16vec2) ConvertSToF 106 + Store 105(f16v) 107 + 112: 52(i8vec2) Load 54(i8v) + 113: 109(fvec2) ConvertSToF 112 + Store 111(f32v) 113 + 118: 52(i8vec2) Load 54(i8v) + 119:115(f64vec2) ConvertSToF 118 + Store 117(f64v) 119 + 120: 49(i8vec2) Load 51(u8v) + 121:103(f16vec2) ConvertUToF 120 + Store 105(f16v) 121 + 122: 49(i8vec2) Load 51(u8v) + 123: 109(fvec2) ConvertUToF 122 + Store 111(f32v) 123 + 124: 49(i8vec2) Load 51(u8v) + 125:115(f64vec2) ConvertUToF 124 + Store 117(f64v) 125 + 126: 49(i8vec2) Load 51(u8v) + 127: 52(i8vec2) Bitcast 126 + Store 54(i8v) 127 + 128: 52(i8vec2) Load 54(i8v) + 129: 58(i16vec2) SConvert 128 + Store 60(i16v) 129 + 130: 49(i8vec2) Load 51(u8v) + 131: 65(i16vec2) UConvert 130 + 132: 58(i16vec2) Bitcast 131 + Store 60(i16v) 132 + 133: 52(i8vec2) Load 54(i8v) + 134: 68(ivec2) SConvert 133 + Store 70(i32v) 134 + 135: 49(i8vec2) Load 51(u8v) + 136: 74(ivec2) UConvert 135 + 137: 68(ivec2) Bitcast 136 + Store 70(i32v) 137 + 138: 52(i8vec2) Load 54(i8v) + 139: 83(i64vec2) SConvert 138 + Store 85(i64v) 139 + 140: 52(i8vec2) Load 54(i8v) + 141: 83(i64vec2) SConvert 140 + 142: 89(i64vec2) Bitcast 141 + Store 91(u64v) 142 + 145: 52(i8vec2) Load 54(i8v) + 146: 58(i16vec2) SConvert 145 + 147: 65(i16vec2) Bitcast 146 + Store 144(u16v) 147 + 148: 49(i8vec2) Load 51(u8v) + 149: 65(i16vec2) UConvert 148 + Store 144(u16v) 149 + 150: 49(i8vec2) Load 51(u8v) + 151: 74(ivec2) UConvert 150 + Store 78(u32v) 151 + 152: 49(i8vec2) Load 51(u8v) + 153: 89(i64vec2) UConvert 152 + 154: 83(i64vec2) Bitcast 153 + Store 85(i64v) 154 + 155: 49(i8vec2) Load 51(u8v) + 156: 89(i64vec2) UConvert 155 + 157: 83(i64vec2) Bitcast 156 + 158: 89(i64vec2) Bitcast 157 + Store 91(u64v) 158 + 159: 52(i8vec2) Load 54(i8v) + 160:103(f16vec2) ConvertSToF 159 + Store 105(f16v) 160 + 161: 52(i8vec2) Load 54(i8v) + 162: 109(fvec2) ConvertSToF 161 + Store 111(f32v) 162 + 163: 52(i8vec2) Load 54(i8v) + 164:115(f64vec2) ConvertSToF 163 + Store 117(f64v) 164 + 165: 49(i8vec2) Load 51(u8v) + 166:103(f16vec2) ConvertUToF 165 + Store 105(f16v) 166 + 167: 49(i8vec2) Load 51(u8v) + 168: 109(fvec2) ConvertUToF 167 + Store 111(f32v) 168 + 169: 49(i8vec2) Load 51(u8v) + 170:115(f64vec2) ConvertUToF 169 + Store 117(f64v) 170 + 175: 172(bvec2) Load 174(bv) + 179: 52(i8vec2) Select 175 178 177 + Store 54(i8v) 179 + 180: 172(bvec2) Load 174(bv) + 185: 49(i8vec2) Select 180 184 183 + Store 51(u8v) 185 + 186: 52(i8vec2) Load 54(i8v) + 187: 172(bvec2) INotEqual 186 183 + Store 174(bv) 187 + 188: 49(i8vec2) Load 51(u8v) + 189: 172(bvec2) INotEqual 188 183 + Store 174(bv) 189 + Return + FunctionEnd + 10(operators(): 2 Function None 3 + 11: Label + 192(u8v): 191(ptr) Variable Function + 197(i8): 15(ptr) Variable Function + 217(i): 216(ptr) Variable Function + 224(uv): 223(ptr) Variable Function + 240(i16): 239(ptr) Variable Function + 276(b): 275(ptr) Variable Function + 193: 190(i8vec3) Load 192(u8v) + 195: 194(i8vec3) CompositeConstruct 176 176 176 + 196: 190(i8vec3) IAdd 193 195 + Store 192(u8v) 196 + 198: 14(int8_t) Load 197(i8) + 199: 14(int8_t) ISub 198 176 + Store 197(i8) 199 + 200: 14(int8_t) Load 197(i8) + 201: 14(int8_t) IAdd 200 176 + Store 197(i8) 201 + 202: 190(i8vec3) Load 192(u8v) + 203: 194(i8vec3) CompositeConstruct 176 176 176 + 204: 190(i8vec3) ISub 202 203 + Store 192(u8v) 204 + 205: 190(i8vec3) Load 192(u8v) + 206: 190(i8vec3) Not 205 + Store 192(u8v) 206 + 207: 14(int8_t) Load 197(i8) + Store 197(i8) 207 + 208: 190(i8vec3) Load 192(u8v) + 209: 190(i8vec3) SNegate 208 + Store 192(u8v) 209 + 210: 14(int8_t) Load 197(i8) + 211: 14(int8_t) Load 197(i8) + 212: 14(int8_t) IAdd 211 210 + Store 197(i8) 212 + 213: 190(i8vec3) Load 192(u8v) + 214: 190(i8vec3) Load 192(u8v) + 215: 190(i8vec3) ISub 214 213 + Store 192(u8v) 215 + 218: 14(int8_t) Load 197(i8) + 219: 27(int) SConvert 218 + 220: 27(int) Load 217(i) + 221: 27(int) IMul 220 219 + Store 217(i) 221 + 225: 190(i8vec3) Load 192(u8v) + 226: 222(ivec3) UConvert 225 + 227: 222(ivec3) Load 224(uv) + 228: 222(ivec3) UDiv 227 226 + Store 224(uv) 228 + 229: 14(int8_t) Load 197(i8) + 230: 27(int) SConvert 229 + 231: 17(int) Bitcast 230 + 232: 222(ivec3) Load 224(uv) + 233: 222(ivec3) CompositeConstruct 231 231 231 + 234: 222(ivec3) UMod 232 233 + Store 224(uv) 234 + 235: 190(i8vec3) Load 192(u8v) + 236: 222(ivec3) UConvert 235 + 237: 222(ivec3) Load 224(uv) + 238: 222(ivec3) IAdd 236 237 + Store 224(uv) 238 + 241: 14(int8_t) Load 197(i8) + 242: 57(int16_t) SConvert 241 + 243: 57(int16_t) Load 240(i16) + 244: 57(int16_t) ISub 242 243 + Store 240(i16) 244 + 245: 190(i8vec3) Load 192(u8v) + 246: 222(ivec3) UConvert 245 + 247: 222(ivec3) Load 224(uv) + 248: 222(ivec3) IMul 246 247 + Store 224(uv) 248 + 249: 14(int8_t) Load 197(i8) + 250: 57(int16_t) SConvert 249 + 251: 57(int16_t) Load 240(i16) + 252: 57(int16_t) IMul 250 251 + Store 240(i16) 252 + 253: 14(int8_t) Load 197(i8) + 254: 27(int) SConvert 253 + 255: 27(int) Load 217(i) + 256: 27(int) SMod 254 255 + Store 217(i) 256 + 257: 14(int8_t) Load 197(i8) + 258: 190(i8vec3) Load 192(u8v) + 259: 194(i8vec3) CompositeConstruct 257 257 257 + 260: 190(i8vec3) ShiftLeftLogical 258 259 + Store 192(u8v) 260 + 262: 37(ptr) AccessChain 192(u8v) 261 + 263: 36(int8_t) Load 262 + 264: 14(int8_t) Load 197(i8) + 265: 14(int8_t) ShiftRightArithmetic 264 263 + Store 197(i8) 265 + 266: 14(int8_t) Load 197(i8) + 268: 37(ptr) AccessChain 192(u8v) 267 + 269: 36(int8_t) Load 268 + 270: 14(int8_t) ShiftLeftLogical 266 269 + Store 197(i8) 270 + 271: 190(i8vec3) Load 192(u8v) + 272: 14(int8_t) Load 197(i8) + 273: 194(i8vec3) CompositeConstruct 272 272 272 + 274: 190(i8vec3) ShiftLeftLogical 271 273 + Store 192(u8v) 274 + 278: 37(ptr) AccessChain 192(u8v) 277 + 279: 36(int8_t) Load 278 + 280: 14(int8_t) Load 197(i8) + 281: 36(int8_t) Bitcast 280 + 282: 171(bool) INotEqual 279 281 + Store 276(b) 282 + 283: 14(int8_t) Load 197(i8) + 284: 36(int8_t) Bitcast 283 + 285: 37(ptr) AccessChain 192(u8v) 277 + 286: 36(int8_t) Load 285 + 287: 171(bool) IEqual 284 286 + Store 276(b) 287 + 288: 37(ptr) AccessChain 192(u8v) 277 + 289: 36(int8_t) Load 288 + 290: 17(int) UConvert 289 + 292: 291(ptr) AccessChain 224(uv) 261 + 293: 17(int) Load 292 + 294: 171(bool) UGreaterThan 290 293 + Store 276(b) 294 + 295: 14(int8_t) Load 197(i8) + 296: 27(int) SConvert 295 + 297: 27(int) Load 217(i) + 298: 171(bool) SLessThan 296 297 + Store 276(b) 298 + 299: 37(ptr) AccessChain 192(u8v) 261 + 300: 36(int8_t) Load 299 + 301: 17(int) UConvert 300 + 302: 291(ptr) AccessChain 224(uv) 277 + 303: 17(int) Load 302 + 304: 171(bool) UGreaterThanEqual 301 303 + Store 276(b) 304 + 305: 14(int8_t) Load 197(i8) + 306: 27(int) SConvert 305 + 307: 27(int) Load 217(i) + 308: 171(bool) SLessThanEqual 306 307 + Store 276(b) 308 + 309: 14(int8_t) Load 197(i8) + 310: 27(int) SConvert 309 + 311: 17(int) Bitcast 310 + 312: 222(ivec3) Load 224(uv) + 313: 222(ivec3) CompositeConstruct 311 311 311 + 314: 222(ivec3) BitwiseOr 312 313 + Store 224(uv) 314 + 315: 14(int8_t) Load 197(i8) + 316: 27(int) SConvert 315 + 317: 27(int) Load 217(i) + 318: 27(int) BitwiseOr 316 317 + Store 217(i) 318 + 319: 14(int8_t) Load 197(i8) + 320: 57(int16_t) SConvert 319 + 321: 57(int16_t) Load 240(i16) + 322: 57(int16_t) BitwiseAnd 321 320 + Store 240(i16) 322 + 323: 190(i8vec3) Load 192(u8v) + 324: 222(ivec3) UConvert 323 + 325: 222(ivec3) Load 224(uv) + 326: 222(ivec3) BitwiseAnd 324 325 + Store 224(uv) 326 + 327: 14(int8_t) Load 197(i8) + 328: 27(int) SConvert 327 + 329: 17(int) Bitcast 328 + 330: 222(ivec3) Load 224(uv) + 331: 222(ivec3) CompositeConstruct 329 329 329 + 332: 222(ivec3) BitwiseXor 330 331 + Store 224(uv) 332 + 333: 190(i8vec3) Load 192(u8v) + 334: 14(int8_t) Load 197(i8) + 335: 36(int8_t) Bitcast 334 + 336: 190(i8vec3) CompositeConstruct 335 335 335 + 337: 190(i8vec3) BitwiseXor 333 336 + Store 192(u8v) 337 + Return + FunctionEnd +12(builtinFuncs(): 2 Function None 3 + 13: Label + 338(i8v): 53(ptr) Variable Function + 341(i8): 15(ptr) Variable Function + 351(u8v): 191(ptr) Variable Function + 353(u8): 37(ptr) Variable Function + 423(i16): 239(ptr) Variable Function + 426(i32): 216(ptr) Variable Function + 429(i8v4): 428(ptr) Variable Function + 433(u16): 432(ptr) Variable Function + 434(u8v2): 50(ptr) Variable Function + 437(u32): 291(ptr) Variable Function + 440(u8v4): 439(ptr) Variable Function + 452(bv): 451(ptr) Variable Function + 339: 52(i8vec2) Load 338(i8v) + 340: 52(i8vec2) ExtInst 1(GLSL.std.450) 5(SAbs) 339 + Store 338(i8v) 340 + 342: 14(int8_t) Load 341(i8) + 343: 14(int8_t) ExtInst 1(GLSL.std.450) 7(SSign) 342 + Store 341(i8) 343 + 344: 52(i8vec2) Load 338(i8v) + 345: 14(int8_t) Load 341(i8) + 346: 52(i8vec2) CompositeConstruct 345 345 + 347: 52(i8vec2) ExtInst 1(GLSL.std.450) 39(SMin) 344 346 + Store 338(i8v) 347 + 348: 52(i8vec2) Load 338(i8v) + 350: 52(i8vec2) ExtInst 1(GLSL.std.450) 39(SMin) 348 349 + Store 338(i8v) 350 + 352: 190(i8vec3) Load 351(u8v) + 354: 36(int8_t) Load 353(u8) + 355: 190(i8vec3) CompositeConstruct 354 354 354 + 356: 190(i8vec3) ExtInst 1(GLSL.std.450) 38(UMin) 352 355 + Store 351(u8v) 356 + 357: 190(i8vec3) Load 351(u8v) + 359: 190(i8vec3) ExtInst 1(GLSL.std.450) 38(UMin) 357 358 + Store 351(u8v) 359 + 360: 52(i8vec2) Load 338(i8v) + 361: 14(int8_t) Load 341(i8) + 362: 52(i8vec2) CompositeConstruct 361 361 + 363: 52(i8vec2) ExtInst 1(GLSL.std.450) 42(SMax) 360 362 + Store 338(i8v) 363 + 364: 52(i8vec2) Load 338(i8v) + 365: 52(i8vec2) ExtInst 1(GLSL.std.450) 42(SMax) 364 349 + Store 338(i8v) 365 + 366: 190(i8vec3) Load 351(u8v) + 367: 36(int8_t) Load 353(u8) + 368: 190(i8vec3) CompositeConstruct 367 367 367 + 369: 190(i8vec3) ExtInst 1(GLSL.std.450) 41(UMax) 366 368 + Store 351(u8v) 369 + 370: 190(i8vec3) Load 351(u8v) + 371: 190(i8vec3) ExtInst 1(GLSL.std.450) 41(UMax) 370 358 + Store 351(u8v) 371 + 372: 52(i8vec2) Load 338(i8v) + 373: 14(int8_t) Load 341(i8) + 374: 14(int8_t) SNegate 373 + 375: 14(int8_t) Load 341(i8) + 376: 52(i8vec2) CompositeConstruct 374 374 + 377: 52(i8vec2) CompositeConstruct 375 375 + 378: 52(i8vec2) ExtInst 1(GLSL.std.450) 45(SClamp) 372 376 377 + Store 338(i8v) 378 + 379: 52(i8vec2) Load 338(i8v) + 380: 52(i8vec2) Load 338(i8v) + 381: 52(i8vec2) SNegate 380 + 382: 52(i8vec2) Load 338(i8v) + 383: 52(i8vec2) ExtInst 1(GLSL.std.450) 45(SClamp) 379 381 382 + Store 338(i8v) 383 + 384: 190(i8vec3) Load 351(u8v) + 385: 36(int8_t) Load 353(u8) + 386: 36(int8_t) SNegate 385 + 387: 36(int8_t) Load 353(u8) + 388: 190(i8vec3) CompositeConstruct 386 386 386 + 389: 190(i8vec3) CompositeConstruct 387 387 387 + 390: 190(i8vec3) ExtInst 1(GLSL.std.450) 44(UClamp) 384 388 389 + Store 351(u8v) 390 + 391: 190(i8vec3) Load 351(u8v) + 392: 190(i8vec3) Load 351(u8v) + 393: 190(i8vec3) SNegate 392 + 394: 190(i8vec3) Load 351(u8v) + 395: 190(i8vec3) ExtInst 1(GLSL.std.450) 44(UClamp) 391 393 394 + Store 351(u8v) 395 + 396: 15(ptr) AccessChain 338(i8v) 277 + 397: 14(int8_t) Load 396 + 398: 15(ptr) AccessChain 338(i8v) 261 + 399: 14(int8_t) Load 398 + 401: 14(int8_t) Select 400 399 397 + Store 341(i8) 401 + 402: 14(int8_t) Load 341(i8) + 403: 52(i8vec2) CompositeConstruct 402 402 + 404: 14(int8_t) Load 341(i8) + 405: 14(int8_t) SNegate 404 + 406: 52(i8vec2) CompositeConstruct 405 405 + 409: 52(i8vec2) Select 408 406 403 + Store 338(i8v) 409 + 410: 37(ptr) AccessChain 351(u8v) 277 + 411: 36(int8_t) Load 410 + 412: 37(ptr) AccessChain 351(u8v) 261 + 413: 36(int8_t) Load 412 + 414: 36(int8_t) Select 400 413 411 + Store 353(u8) 414 + 415: 36(int8_t) Load 353(u8) + 416: 190(i8vec3) CompositeConstruct 415 415 415 + 417: 36(int8_t) Load 353(u8) + 418: 36(int8_t) SNegate 417 + 419: 190(i8vec3) CompositeConstruct 418 418 418 + 422: 190(i8vec3) Select 421 419 416 + Store 351(u8v) 422 + 424: 52(i8vec2) Load 338(i8v) + 425: 57(int16_t) Bitcast 424 + Store 423(i16) 425 + 430: 427(i8vec4) Load 429(i8v4) + 431: 27(int) Bitcast 430 + Store 426(i32) 431 + 435: 49(i8vec2) Load 434(u8v2) + 436: 64(int16_t) Bitcast 435 + Store 433(u16) 436 + 441: 438(i8vec4) Load 440(u8v4) + 442: 17(int) Bitcast 441 + Store 437(u32) 442 + 443: 57(int16_t) Load 423(i16) + 444: 52(i8vec2) Bitcast 443 + Store 338(i8v) 444 + 445: 27(int) Load 426(i32) + 446: 427(i8vec4) Bitcast 445 + Store 429(i8v4) 446 + 447: 64(int16_t) Load 433(u16) + 448: 49(i8vec2) Bitcast 447 + Store 434(u8v2) 448 + 449: 17(int) Load 437(u32) + 450: 438(i8vec4) Bitcast 449 + Store 440(u8v4) 450 + 453: 190(i8vec3) Load 351(u8v) + 454: 36(int8_t) Load 353(u8) + 455: 190(i8vec3) CompositeConstruct 454 454 454 + 456: 420(bvec3) ULessThan 453 455 + Store 452(bv) 456 + 457: 52(i8vec2) Load 338(i8v) + 458: 14(int8_t) Load 341(i8) + 459: 52(i8vec2) CompositeConstruct 458 458 + 460: 172(bvec2) SLessThan 457 459 + 461: 420(bvec3) Load 452(bv) + 462: 420(bvec3) VectorShuffle 461 460 3 4 2 + Store 452(bv) 462 + 463: 190(i8vec3) Load 351(u8v) + 464: 36(int8_t) Load 353(u8) + 465: 190(i8vec3) CompositeConstruct 464 464 464 + 466: 420(bvec3) ULessThanEqual 463 465 + Store 452(bv) 466 + 467: 52(i8vec2) Load 338(i8v) + 468: 14(int8_t) Load 341(i8) + 469: 52(i8vec2) CompositeConstruct 468 468 + 470: 172(bvec2) SLessThanEqual 467 469 + 471: 420(bvec3) Load 452(bv) + 472: 420(bvec3) VectorShuffle 471 470 3 4 2 + Store 452(bv) 472 + 473: 190(i8vec3) Load 351(u8v) + 474: 36(int8_t) Load 353(u8) + 475: 190(i8vec3) CompositeConstruct 474 474 474 + 476: 420(bvec3) UGreaterThan 473 475 + Store 452(bv) 476 + 477: 52(i8vec2) Load 338(i8v) + 478: 14(int8_t) Load 341(i8) + 479: 52(i8vec2) CompositeConstruct 478 478 + 480: 172(bvec2) SGreaterThan 477 479 + 481: 420(bvec3) Load 452(bv) + 482: 420(bvec3) VectorShuffle 481 480 3 4 2 + Store 452(bv) 482 + 483: 190(i8vec3) Load 351(u8v) + 484: 36(int8_t) Load 353(u8) + 485: 190(i8vec3) CompositeConstruct 484 484 484 + 486: 420(bvec3) UGreaterThanEqual 483 485 + Store 452(bv) 486 + 487: 52(i8vec2) Load 338(i8v) + 488: 14(int8_t) Load 341(i8) + 489: 52(i8vec2) CompositeConstruct 488 488 + 490: 172(bvec2) SGreaterThanEqual 487 489 + 491: 420(bvec3) Load 452(bv) + 492: 420(bvec3) VectorShuffle 491 490 3 4 2 + Store 452(bv) 492 + 493: 190(i8vec3) Load 351(u8v) + 494: 36(int8_t) Load 353(u8) + 495: 190(i8vec3) CompositeConstruct 494 494 494 + 496: 420(bvec3) IEqual 493 495 + Store 452(bv) 496 + 497: 52(i8vec2) Load 338(i8v) + 498: 14(int8_t) Load 341(i8) + 499: 52(i8vec2) CompositeConstruct 498 498 + 500: 172(bvec2) IEqual 497 499 + 501: 420(bvec3) Load 452(bv) + 502: 420(bvec3) VectorShuffle 501 500 3 4 2 + Store 452(bv) 502 + 503: 190(i8vec3) Load 351(u8v) + 504: 36(int8_t) Load 353(u8) + 505: 190(i8vec3) CompositeConstruct 504 504 504 + 506: 420(bvec3) INotEqual 503 505 + Store 452(bv) 506 + 507: 52(i8vec2) Load 338(i8v) + 508: 14(int8_t) Load 341(i8) + 509: 52(i8vec2) CompositeConstruct 508 508 + 510: 172(bvec2) INotEqual 507 509 + 511: 420(bvec3) Load 452(bv) + 512: 420(bvec3) VectorShuffle 511 510 3 4 2 + Store 452(bv) 512 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.intOps.vert.out b/deps/glslang/Test/baseResults/spv.intOps.vert.out new file mode 100644 index 00000000..2a637832 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.intOps.vert.out @@ -0,0 +1,347 @@ +spv.intOps.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 268 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 9 15 21 26 47 67 83 100 121 142 146 156 173 182 247 + Source ESSL 310 + Name 4 "main" + Name 9 "iout" + Name 15 "uout" + Name 21 "fout" + Name 26 "u2" + Name 30 "u2out" + Name 31 "ResType" + Name 47 "u1" + Name 51 "u1out" + Name 52 "ResType" + Name 67 "u4" + Name 71 "u4outHi" + Name 72 "u4outLow" + Name 73 "ResType" + Name 83 "i4" + Name 87 "i4outHi" + Name 88 "i4outLow" + Name 89 "ResType" + Name 100 "v3" + Name 104 "i3out" + Name 105 "ResType" + Name 121 "v1" + Name 124 "i1out" + Name 125 "ResType" + Name 142 "v2" + Name 146 "i2" + Name 156 "i1" + Name 173 "u3" + Name 182 "i3" + Name 247 "v4" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeVector 6(int) 4 + 8: TypePointer Output 7(ivec4) + 9(iout): 8(ptr) Variable Output + 10: 6(int) Constant 0 + 11: 7(ivec4) ConstantComposite 10 10 10 10 + 12: TypeInt 32 0 + 13: TypeVector 12(int) 4 + 14: TypePointer Output 13(ivec4) + 15(uout): 14(ptr) Variable Output + 16: 12(int) Constant 0 + 17: 13(ivec4) ConstantComposite 16 16 16 16 + 18: TypeFloat 32 + 19: TypeVector 18(float) 4 + 20: TypePointer Output 19(fvec4) + 21(fout): 20(ptr) Variable Output + 22: 18(float) Constant 0 + 23: 19(fvec4) ConstantComposite 22 22 22 22 + 24: TypeVector 12(int) 2 + 25: TypePointer Input 24(ivec2) + 26(u2): 25(ptr) Variable Input + 29: TypePointer Function 24(ivec2) + 31(ResType): TypeStruct 24(ivec2) 24(ivec2) + 46: TypePointer Input 12(int) + 47(u1): 46(ptr) Variable Input + 50: TypePointer Function 12(int) + 52(ResType): TypeStruct 12(int) 12(int) + 56: TypePointer Output 12(int) + 66: TypePointer Input 13(ivec4) + 67(u4): 66(ptr) Variable Input + 70: TypePointer Function 13(ivec4) + 73(ResType): TypeStruct 13(ivec4) 13(ivec4) + 82: TypePointer Input 7(ivec4) + 83(i4): 82(ptr) Variable Input + 86: TypePointer Function 7(ivec4) + 89(ResType): TypeStruct 7(ivec4) 7(ivec4) + 98: TypeVector 18(float) 3 + 99: TypePointer Input 98(fvec3) + 100(v3): 99(ptr) Variable Input + 102: TypeVector 6(int) 3 + 103: TypePointer Function 102(ivec3) + 105(ResType): TypeStruct 98(fvec3) 102(ivec3) + 120: TypePointer Input 18(float) + 121(v1): 120(ptr) Variable Input + 123: TypePointer Function 6(int) + 125(ResType): TypeStruct 18(float) 6(int) + 129: TypePointer Output 18(float) + 135: TypePointer Output 6(int) + 140: TypeVector 18(float) 2 + 141: TypePointer Input 140(fvec2) + 142(v2): 141(ptr) Variable Input + 144: TypeVector 6(int) 2 + 145: TypePointer Input 144(ivec2) + 146(i2): 145(ptr) Variable Input + 155: TypePointer Input 6(int) + 156(i1): 155(ptr) Variable Input + 164: 6(int) Constant 4 + 165: 6(int) Constant 5 + 171: TypeVector 12(int) 3 + 172: TypePointer Input 171(ivec3) + 173(u3): 172(ptr) Variable Input + 181: TypePointer Input 102(ivec3) + 182(i3): 181(ptr) Variable Input + 246: TypePointer Input 19(fvec4) + 247(v4): 246(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 30(u2out): 29(ptr) Variable Function + 51(u1out): 50(ptr) Variable Function + 71(u4outHi): 70(ptr) Variable Function + 72(u4outLow): 70(ptr) Variable Function + 87(i4outHi): 86(ptr) Variable Function + 88(i4outLow): 86(ptr) Variable Function + 104(i3out): 103(ptr) Variable Function + 124(i1out): 123(ptr) Variable Function + Store 9(iout) 11 + Store 15(uout) 17 + Store 21(fout) 23 + 27: 24(ivec2) Load 26(u2) + 28: 24(ivec2) Load 26(u2) + 32: 31(ResType) IAddCarry 27 28 + 33: 24(ivec2) CompositeExtract 32 1 + Store 30(u2out) 33 + 34: 24(ivec2) CompositeExtract 32 0 + 35: 13(ivec4) Load 15(uout) + 36: 24(ivec2) VectorShuffle 35 35 0 1 + 37: 24(ivec2) IAdd 36 34 + 38: 13(ivec4) Load 15(uout) + 39: 13(ivec4) VectorShuffle 38 37 4 5 2 3 + Store 15(uout) 39 + 40: 24(ivec2) Load 30(u2out) + 41: 13(ivec4) Load 15(uout) + 42: 24(ivec2) VectorShuffle 41 41 0 1 + 43: 24(ivec2) IAdd 42 40 + 44: 13(ivec4) Load 15(uout) + 45: 13(ivec4) VectorShuffle 44 43 4 5 2 3 + Store 15(uout) 45 + 48: 12(int) Load 47(u1) + 49: 12(int) Load 47(u1) + 53: 52(ResType) ISubBorrow 48 49 + 54: 12(int) CompositeExtract 53 1 + Store 51(u1out) 54 + 55: 12(int) CompositeExtract 53 0 + 57: 56(ptr) AccessChain 15(uout) 16 + 58: 12(int) Load 57 + 59: 12(int) IAdd 58 55 + 60: 56(ptr) AccessChain 15(uout) 16 + Store 60 59 + 61: 12(int) Load 51(u1out) + 62: 56(ptr) AccessChain 15(uout) 16 + 63: 12(int) Load 62 + 64: 12(int) IAdd 63 61 + 65: 56(ptr) AccessChain 15(uout) 16 + Store 65 64 + 68: 13(ivec4) Load 67(u4) + 69: 13(ivec4) Load 67(u4) + 74: 73(ResType) UMulExtended 68 69 + 75: 13(ivec4) CompositeExtract 74 0 + Store 72(u4outLow) 75 + 76: 13(ivec4) CompositeExtract 74 1 + Store 71(u4outHi) 76 + 77: 13(ivec4) Load 71(u4outHi) + 78: 13(ivec4) Load 72(u4outLow) + 79: 13(ivec4) IAdd 77 78 + 80: 13(ivec4) Load 15(uout) + 81: 13(ivec4) IAdd 80 79 + Store 15(uout) 81 + 84: 7(ivec4) Load 83(i4) + 85: 7(ivec4) Load 83(i4) + 90: 89(ResType) SMulExtended 84 85 + 91: 7(ivec4) CompositeExtract 90 0 + Store 88(i4outLow) 91 + 92: 7(ivec4) CompositeExtract 90 1 + Store 87(i4outHi) 92 + 93: 7(ivec4) Load 88(i4outLow) + 94: 7(ivec4) Load 87(i4outHi) + 95: 7(ivec4) IAdd 93 94 + 96: 7(ivec4) Load 9(iout) + 97: 7(ivec4) IAdd 96 95 + Store 9(iout) 97 + 101: 98(fvec3) Load 100(v3) + 106:105(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 101 + 107: 102(ivec3) CompositeExtract 106 1 + Store 104(i3out) 107 + 108: 98(fvec3) CompositeExtract 106 0 + 109: 19(fvec4) Load 21(fout) + 110: 98(fvec3) VectorShuffle 109 109 0 1 2 + 111: 98(fvec3) FAdd 110 108 + 112: 19(fvec4) Load 21(fout) + 113: 19(fvec4) VectorShuffle 112 111 4 5 6 3 + Store 21(fout) 113 + 114: 102(ivec3) Load 104(i3out) + 115: 7(ivec4) Load 9(iout) + 116: 102(ivec3) VectorShuffle 115 115 0 1 2 + 117: 102(ivec3) IAdd 116 114 + 118: 7(ivec4) Load 9(iout) + 119: 7(ivec4) VectorShuffle 118 117 4 5 6 3 + Store 9(iout) 119 + 122: 18(float) Load 121(v1) + 126:125(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 122 + 127: 6(int) CompositeExtract 126 1 + Store 124(i1out) 127 + 128: 18(float) CompositeExtract 126 0 + 130: 129(ptr) AccessChain 21(fout) 16 + 131: 18(float) Load 130 + 132: 18(float) FAdd 131 128 + 133: 129(ptr) AccessChain 21(fout) 16 + Store 133 132 + 134: 6(int) Load 124(i1out) + 136: 135(ptr) AccessChain 9(iout) 16 + 137: 6(int) Load 136 + 138: 6(int) IAdd 137 134 + 139: 135(ptr) AccessChain 9(iout) 16 + Store 139 138 + 143: 140(fvec2) Load 142(v2) + 147: 144(ivec2) Load 146(i2) + 148: 140(fvec2) ExtInst 1(GLSL.std.450) 53(Ldexp) 143 147 + 149: 19(fvec4) Load 21(fout) + 150: 140(fvec2) VectorShuffle 149 149 0 1 + 151: 140(fvec2) FAdd 150 148 + 152: 19(fvec4) Load 21(fout) + 153: 19(fvec4) VectorShuffle 152 151 4 5 2 3 + Store 21(fout) 153 + 154: 18(float) Load 121(v1) + 157: 6(int) Load 156(i1) + 158: 18(float) ExtInst 1(GLSL.std.450) 53(Ldexp) 154 157 + 159: 129(ptr) AccessChain 21(fout) 16 + 160: 18(float) Load 159 + 161: 18(float) FAdd 160 158 + 162: 129(ptr) AccessChain 21(fout) 16 + Store 162 161 + 163: 6(int) Load 156(i1) + 166: 6(int) BitFieldSExtract 163 164 165 + 167: 135(ptr) AccessChain 9(iout) 16 + 168: 6(int) Load 167 + 169: 6(int) IAdd 168 166 + 170: 135(ptr) AccessChain 9(iout) 16 + Store 170 169 + 174: 171(ivec3) Load 173(u3) + 175: 171(ivec3) BitFieldUExtract 174 164 165 + 176: 13(ivec4) Load 15(uout) + 177: 171(ivec3) VectorShuffle 176 176 0 1 2 + 178: 171(ivec3) IAdd 177 175 + 179: 13(ivec4) Load 15(uout) + 180: 13(ivec4) VectorShuffle 179 178 4 5 6 3 + Store 15(uout) 180 + 183: 102(ivec3) Load 182(i3) + 184: 102(ivec3) Load 182(i3) + 185: 102(ivec3) BitFieldInsert 183 184 164 165 + 186: 7(ivec4) Load 9(iout) + 187: 102(ivec3) VectorShuffle 186 186 0 1 2 + 188: 102(ivec3) IAdd 187 185 + 189: 7(ivec4) Load 9(iout) + 190: 7(ivec4) VectorShuffle 189 188 4 5 6 3 + Store 9(iout) 190 + 191: 12(int) Load 47(u1) + 192: 12(int) Load 47(u1) + 193: 12(int) BitFieldInsert 191 192 164 165 + 194: 56(ptr) AccessChain 15(uout) 16 + 195: 12(int) Load 194 + 196: 12(int) IAdd 195 193 + 197: 56(ptr) AccessChain 15(uout) 16 + Store 197 196 + 198: 144(ivec2) Load 146(i2) + 199: 144(ivec2) BitReverse 198 + 200: 7(ivec4) Load 9(iout) + 201: 144(ivec2) VectorShuffle 200 200 0 1 + 202: 144(ivec2) IAdd 201 199 + 203: 7(ivec4) Load 9(iout) + 204: 7(ivec4) VectorShuffle 203 202 4 5 2 3 + Store 9(iout) 204 + 205: 13(ivec4) Load 67(u4) + 206: 13(ivec4) BitReverse 205 + 207: 13(ivec4) Load 15(uout) + 208: 13(ivec4) IAdd 207 206 + Store 15(uout) 208 + 209: 6(int) Load 156(i1) + 210: 6(int) BitCount 209 + 211: 135(ptr) AccessChain 9(iout) 16 + 212: 6(int) Load 211 + 213: 6(int) IAdd 212 210 + 214: 135(ptr) AccessChain 9(iout) 16 + Store 214 213 + 215: 171(ivec3) Load 173(u3) + 216: 102(ivec3) BitCount 215 + 217: 7(ivec4) Load 9(iout) + 218: 102(ivec3) VectorShuffle 217 217 0 1 2 + 219: 102(ivec3) IAdd 218 216 + 220: 7(ivec4) Load 9(iout) + 221: 7(ivec4) VectorShuffle 220 219 4 5 6 3 + Store 9(iout) 221 + 222: 144(ivec2) Load 146(i2) + 223: 144(ivec2) ExtInst 1(GLSL.std.450) 73(FindILsb) 222 + 224: 7(ivec4) Load 9(iout) + 225: 144(ivec2) VectorShuffle 224 224 0 1 + 226: 144(ivec2) IAdd 225 223 + 227: 7(ivec4) Load 9(iout) + 228: 7(ivec4) VectorShuffle 227 226 4 5 2 3 + Store 9(iout) 228 + 229: 13(ivec4) Load 67(u4) + 230: 7(ivec4) ExtInst 1(GLSL.std.450) 73(FindILsb) 229 + 231: 7(ivec4) Load 9(iout) + 232: 7(ivec4) IAdd 231 230 + Store 9(iout) 232 + 233: 6(int) Load 156(i1) + 234: 6(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 233 + 235: 135(ptr) AccessChain 9(iout) 16 + 236: 6(int) Load 235 + 237: 6(int) IAdd 236 234 + 238: 135(ptr) AccessChain 9(iout) 16 + Store 238 237 + 239: 24(ivec2) Load 26(u2) + 240: 144(ivec2) ExtInst 1(GLSL.std.450) 75(FindUMsb) 239 + 241: 7(ivec4) Load 9(iout) + 242: 144(ivec2) VectorShuffle 241 241 0 1 + 243: 144(ivec2) IAdd 242 240 + 244: 7(ivec4) Load 9(iout) + 245: 7(ivec4) VectorShuffle 244 243 4 5 2 3 + Store 9(iout) 245 + 248: 19(fvec4) Load 247(v4) + 249: 12(int) ExtInst 1(GLSL.std.450) 55(PackUnorm4x8) 248 + 250: 56(ptr) AccessChain 15(uout) 16 + 251: 12(int) Load 250 + 252: 12(int) IAdd 251 249 + 253: 56(ptr) AccessChain 15(uout) 16 + Store 253 252 + 254: 19(fvec4) Load 247(v4) + 255: 12(int) ExtInst 1(GLSL.std.450) 54(PackSnorm4x8) 254 + 256: 56(ptr) AccessChain 15(uout) 16 + 257: 12(int) Load 256 + 258: 12(int) IAdd 257 255 + 259: 56(ptr) AccessChain 15(uout) 16 + Store 259 258 + 260: 12(int) Load 47(u1) + 261: 19(fvec4) ExtInst 1(GLSL.std.450) 64(UnpackUnorm4x8) 260 + 262: 19(fvec4) Load 21(fout) + 263: 19(fvec4) FAdd 262 261 + Store 21(fout) 263 + 264: 12(int) Load 47(u1) + 265: 19(fvec4) ExtInst 1(GLSL.std.450) 63(UnpackSnorm4x8) 264 + 266: 19(fvec4) Load 21(fout) + 267: 19(fvec4) FAdd 266 265 + Store 21(fout) 267 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.interpOps.frag.out b/deps/glslang/Test/baseResults/spv.interpOps.frag.out new file mode 100644 index 00000000..699524dd --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.interpOps.frag.out @@ -0,0 +1,137 @@ +spv.interpOps.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 100 + + Capability Shader + Capability InterpolationFunction + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 13 24 33 41 47 72 98 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "f4" + Name 13 "if1" + Name 24 "if2" + Name 33 "if3" + Name 41 "if4" + Name 47 "samp" + Name 72 "offset" + Name 98 "fragColor" + Decorate 47(samp) Flat + Decorate 72(offset) Flat + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: 6(float) Constant 0 + 11: 7(fvec4) ConstantComposite 10 10 10 10 + 12: TypePointer Input 6(float) + 13(if1): 12(ptr) Variable Input + 15: TypeInt 32 0 + 16: 15(int) Constant 0 + 17: TypePointer Function 6(float) + 22: TypeVector 6(float) 2 + 23: TypePointer Input 22(fvec2) + 24(if2): 23(ptr) Variable Input + 31: TypeVector 6(float) 3 + 32: TypePointer Input 31(fvec3) + 33(if3): 32(ptr) Variable Input + 40: TypePointer Input 7(fvec4) + 41(if4): 40(ptr) Variable Input + 45: TypeInt 32 1 + 46: TypePointer Input 45(int) + 47(samp): 46(ptr) Variable Input + 72(offset): 23(ptr) Variable Input + 97: TypePointer Output 7(fvec4) + 98(fragColor): 97(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 9(f4): 8(ptr) Variable Function + Store 9(f4) 11 + 14: 6(float) ExtInst 1(GLSL.std.450) 76(InterpolateAtCentroid) 13(if1) + 18: 17(ptr) AccessChain 9(f4) 16 + 19: 6(float) Load 18 + 20: 6(float) FAdd 19 14 + 21: 17(ptr) AccessChain 9(f4) 16 + Store 21 20 + 25: 22(fvec2) ExtInst 1(GLSL.std.450) 76(InterpolateAtCentroid) 24(if2) + 26: 7(fvec4) Load 9(f4) + 27: 22(fvec2) VectorShuffle 26 26 0 1 + 28: 22(fvec2) FAdd 27 25 + 29: 7(fvec4) Load 9(f4) + 30: 7(fvec4) VectorShuffle 29 28 4 5 2 3 + Store 9(f4) 30 + 34: 31(fvec3) ExtInst 1(GLSL.std.450) 76(InterpolateAtCentroid) 33(if3) + 35: 7(fvec4) Load 9(f4) + 36: 31(fvec3) VectorShuffle 35 35 0 1 2 + 37: 31(fvec3) FAdd 36 34 + 38: 7(fvec4) Load 9(f4) + 39: 7(fvec4) VectorShuffle 38 37 4 5 6 3 + Store 9(f4) 39 + 42: 7(fvec4) ExtInst 1(GLSL.std.450) 76(InterpolateAtCentroid) 41(if4) + 43: 7(fvec4) Load 9(f4) + 44: 7(fvec4) FAdd 43 42 + Store 9(f4) 44 + 48: 45(int) Load 47(samp) + 49: 6(float) ExtInst 1(GLSL.std.450) 77(InterpolateAtSample) 13(if1) 48 + 50: 17(ptr) AccessChain 9(f4) 16 + 51: 6(float) Load 50 + 52: 6(float) FAdd 51 49 + 53: 17(ptr) AccessChain 9(f4) 16 + Store 53 52 + 54: 45(int) Load 47(samp) + 55: 22(fvec2) ExtInst 1(GLSL.std.450) 77(InterpolateAtSample) 24(if2) 54 + 56: 7(fvec4) Load 9(f4) + 57: 22(fvec2) VectorShuffle 56 56 0 1 + 58: 22(fvec2) FAdd 57 55 + 59: 7(fvec4) Load 9(f4) + 60: 7(fvec4) VectorShuffle 59 58 4 5 2 3 + Store 9(f4) 60 + 61: 45(int) Load 47(samp) + 62: 31(fvec3) ExtInst 1(GLSL.std.450) 77(InterpolateAtSample) 33(if3) 61 + 63: 7(fvec4) Load 9(f4) + 64: 31(fvec3) VectorShuffle 63 63 0 1 2 + 65: 31(fvec3) FAdd 64 62 + 66: 7(fvec4) Load 9(f4) + 67: 7(fvec4) VectorShuffle 66 65 4 5 6 3 + Store 9(f4) 67 + 68: 45(int) Load 47(samp) + 69: 7(fvec4) ExtInst 1(GLSL.std.450) 77(InterpolateAtSample) 41(if4) 68 + 70: 7(fvec4) Load 9(f4) + 71: 7(fvec4) FAdd 70 69 + Store 9(f4) 71 + 73: 22(fvec2) Load 72(offset) + 74: 6(float) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 13(if1) 73 + 75: 17(ptr) AccessChain 9(f4) 16 + 76: 6(float) Load 75 + 77: 6(float) FAdd 76 74 + 78: 17(ptr) AccessChain 9(f4) 16 + Store 78 77 + 79: 22(fvec2) Load 72(offset) + 80: 22(fvec2) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 24(if2) 79 + 81: 7(fvec4) Load 9(f4) + 82: 22(fvec2) VectorShuffle 81 81 0 1 + 83: 22(fvec2) FAdd 82 80 + 84: 7(fvec4) Load 9(f4) + 85: 7(fvec4) VectorShuffle 84 83 4 5 2 3 + Store 9(f4) 85 + 86: 22(fvec2) Load 72(offset) + 87: 31(fvec3) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 33(if3) 86 + 88: 7(fvec4) Load 9(f4) + 89: 31(fvec3) VectorShuffle 88 88 0 1 2 + 90: 31(fvec3) FAdd 89 87 + 91: 7(fvec4) Load 9(f4) + 92: 7(fvec4) VectorShuffle 91 90 4 5 6 3 + Store 9(f4) 92 + 93: 22(fvec2) Load 72(offset) + 94: 7(fvec4) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 41(if4) 93 + 95: 7(fvec4) Load 9(f4) + 96: 7(fvec4) FAdd 95 94 + Store 9(f4) 96 + 99: 7(fvec4) Load 9(f4) + Store 98(fragColor) 99 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.layoutNested.vert.out b/deps/glslang/Test/baseResults/spv.layoutNested.vert.out new file mode 100644 index 00000000..b5ef8834 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.layoutNested.vert.out @@ -0,0 +1,241 @@ +spv.layoutNested.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 66 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 62 65 + Source GLSL 450 + Name 4 "main" + Name 14 "S" + MemberName 14(S) 0 "a" + MemberName 14(S) 1 "b" + MemberName 14(S) 2 "c" + Name 19 "Block140" + MemberName 19(Block140) 0 "u" + MemberName 19(Block140) 1 "s" + MemberName 19(Block140) 2 "v" + Name 21 "inst140" + Name 23 "S" + MemberName 23(S) 0 "a" + MemberName 23(S) 1 "b" + MemberName 23(S) 2 "c" + Name 26 "Block430" + MemberName 26(Block430) 0 "u" + MemberName 26(Block430) 1 "s" + MemberName 26(Block430) 2 "v" + Name 28 "inst430" + Name 29 "S" + MemberName 29(S) 0 "a" + MemberName 29(S) 1 "b" + MemberName 29(S) 2 "c" + Name 31 "s" + Name 32 "T" + MemberName 32(T) 0 "m" + MemberName 32(T) 1 "a" + Name 34 "t" + Name 35 "T" + MemberName 35(T) 0 "m" + MemberName 35(T) 1 "a" + Name 36 "Nestor" + MemberName 36(Nestor) 0 "nestorT" + Name 37 "Bt1" + MemberName 37(Bt1) 0 "nt" + Name 39 "Btn1" + Name 40 "T" + MemberName 40(T) 0 "m" + MemberName 40(T) 1 "a" + Name 41 "Nestor" + MemberName 41(Nestor) 0 "nestorT" + Name 42 "Bt2" + MemberName 42(Bt2) 0 "nt" + Name 44 "Btn2" + Name 45 "Bt3" + MemberName 45(Bt3) 0 "ntcol" + MemberName 45(Bt3) 1 "ntrow" + Name 47 "Btn3" + Name 48 "T" + MemberName 48(T) 0 "m" + MemberName 48(T) 1 "a" + Name 49 "Nestor" + MemberName 49(Nestor) 0 "nestorT" + Name 50 "bBt1" + MemberName 50(bBt1) 0 "nt" + Name 52 "bBtn1" + Name 53 "T" + MemberName 53(T) 0 "m" + MemberName 53(T) 1 "a" + Name 54 "Nestor" + MemberName 54(Nestor) 0 "nestorT" + Name 55 "bBt2" + MemberName 55(bBt2) 0 "nt" + Name 57 "bBtn2" + Name 58 "bBt3" + MemberName 58(bBt3) 0 "ntcol" + MemberName 58(bBt3) 1 "ntrow" + Name 60 "bBtn3" + Name 62 "sout" + Name 63 "S" + MemberName 63(S) 0 "a" + MemberName 63(S) 1 "b" + MemberName 63(S) 2 "c" + Name 65 "soutinv" + Decorate 13 ArrayStride 32 + MemberDecorate 14(S) 0 Offset 0 + MemberDecorate 14(S) 1 ColMajor + MemberDecorate 14(S) 1 RelaxedPrecision + MemberDecorate 14(S) 1 Offset 16 + MemberDecorate 14(S) 1 MatrixStride 16 + MemberDecorate 14(S) 2 RelaxedPrecision + MemberDecorate 14(S) 2 Offset 144 + Decorate 16 ArrayStride 160 + Decorate 18 ArrayStride 480 + MemberDecorate 19(Block140) 0 RelaxedPrecision + MemberDecorate 19(Block140) 0 Offset 0 + MemberDecorate 19(Block140) 1 Offset 16 + MemberDecorate 19(Block140) 2 RelaxedPrecision + MemberDecorate 19(Block140) 2 Offset 976 + Decorate 19(Block140) Block + Decorate 21(inst140) DescriptorSet 0 + Decorate 21(inst140) Binding 0 + Decorate 22 ArrayStride 16 + MemberDecorate 23(S) 0 Offset 0 + MemberDecorate 23(S) 1 ColMajor + MemberDecorate 23(S) 1 RelaxedPrecision + MemberDecorate 23(S) 1 Offset 16 + MemberDecorate 23(S) 1 MatrixStride 8 + MemberDecorate 23(S) 2 RelaxedPrecision + MemberDecorate 23(S) 2 Offset 80 + Decorate 24 ArrayStride 96 + Decorate 25 ArrayStride 288 + MemberDecorate 26(Block430) 0 RelaxedPrecision + MemberDecorate 26(Block430) 0 Offset 0 + MemberDecorate 26(Block430) 1 Offset 16 + MemberDecorate 26(Block430) 2 RelaxedPrecision + MemberDecorate 26(Block430) 2 Offset 592 + Decorate 26(Block430) BufferBlock + Decorate 28(inst430) DescriptorSet 0 + Decorate 28(inst430) Binding 1 + MemberDecorate 29(S) 1 RelaxedPrecision + MemberDecorate 29(S) 2 RelaxedPrecision + MemberDecorate 35(T) 0 RowMajor + MemberDecorate 35(T) 0 Offset 0 + MemberDecorate 35(T) 0 MatrixStride 16 + MemberDecorate 35(T) 1 Offset 32 + MemberDecorate 36(Nestor) 0 Offset 0 + MemberDecorate 37(Bt1) 0 Offset 0 + Decorate 37(Bt1) Block + Decorate 39(Btn1) DescriptorSet 1 + Decorate 39(Btn1) Binding 0 + MemberDecorate 40(T) 0 ColMajor + MemberDecorate 40(T) 0 Offset 0 + MemberDecorate 40(T) 0 MatrixStride 16 + MemberDecorate 40(T) 1 Offset 32 + MemberDecorate 41(Nestor) 0 Offset 0 + MemberDecorate 42(Bt2) 0 Offset 0 + Decorate 42(Bt2) Block + Decorate 44(Btn2) DescriptorSet 1 + Decorate 44(Btn2) Binding 0 + MemberDecorate 45(Bt3) 0 Offset 0 + MemberDecorate 45(Bt3) 1 Offset 48 + Decorate 45(Bt3) Block + Decorate 47(Btn3) DescriptorSet 1 + Decorate 47(Btn3) Binding 0 + MemberDecorate 48(T) 0 RowMajor + MemberDecorate 48(T) 0 Offset 0 + MemberDecorate 48(T) 0 MatrixStride 8 + MemberDecorate 48(T) 1 Offset 16 + MemberDecorate 49(Nestor) 0 Offset 0 + MemberDecorate 50(bBt1) 0 Offset 0 + Decorate 50(bBt1) BufferBlock + Decorate 52(bBtn1) DescriptorSet 1 + Decorate 52(bBtn1) Binding 0 + MemberDecorate 53(T) 0 ColMajor + MemberDecorate 53(T) 0 Offset 0 + MemberDecorate 53(T) 0 MatrixStride 8 + MemberDecorate 53(T) 1 Offset 16 + MemberDecorate 54(Nestor) 0 Offset 0 + MemberDecorate 55(bBt2) 0 Offset 0 + Decorate 55(bBt2) BufferBlock + Decorate 57(bBtn2) DescriptorSet 1 + Decorate 57(bBtn2) Binding 0 + MemberDecorate 58(bBt3) 0 Offset 0 + MemberDecorate 58(bBt3) 1 Offset 24 + Decorate 58(bBt3) BufferBlock + Decorate 60(bBtn3) DescriptorSet 1 + Decorate 60(bBtn3) Binding 0 + Decorate 62(sout) Flat + MemberDecorate 63(S) 0 Invariant + MemberDecorate 63(S) 1 RelaxedPrecision + MemberDecorate 63(S) 1 Invariant + MemberDecorate 63(S) 2 RelaxedPrecision + MemberDecorate 63(S) 2 Invariant + Decorate 65(soutinv) Invariant + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeInt 32 0 + 8: TypeVector 7(int) 3 + 9: TypeFloat 32 + 10: TypeVector 9(float) 2 + 11: TypeMatrix 10(fvec2) 2 + 12: 7(int) Constant 4 + 13: TypeArray 11 12 + 14(S): TypeStruct 8(ivec3) 13 7(int) + 15: 7(int) Constant 3 + 16: TypeArray 14(S) 15 + 17: 7(int) Constant 2 + 18: TypeArray 16 17 + 19(Block140): TypeStruct 6(int) 18 10(fvec2) + 20: TypePointer Uniform 19(Block140) + 21(inst140): 20(ptr) Variable Uniform + 22: TypeArray 11 12 + 23(S): TypeStruct 8(ivec3) 22 7(int) + 24: TypeArray 23(S) 15 + 25: TypeArray 24 17 + 26(Block430): TypeStruct 6(int) 25 10(fvec2) + 27: TypePointer Uniform 26(Block430) + 28(inst430): 27(ptr) Variable Uniform + 29(S): TypeStruct 8(ivec3) 13 7(int) + 30: TypePointer Private 29(S) + 31(s): 30(ptr) Variable Private + 32(T): TypeStruct 11 6(int) + 33: TypePointer Private 32(T) + 34(t): 33(ptr) Variable Private + 35(T): TypeStruct 11 6(int) + 36(Nestor): TypeStruct 35(T) + 37(Bt1): TypeStruct 36(Nestor) + 38: TypePointer Uniform 37(Bt1) + 39(Btn1): 38(ptr) Variable Uniform + 40(T): TypeStruct 11 6(int) + 41(Nestor): TypeStruct 40(T) + 42(Bt2): TypeStruct 41(Nestor) + 43: TypePointer Uniform 42(Bt2) + 44(Btn2): 43(ptr) Variable Uniform + 45(Bt3): TypeStruct 41(Nestor) 36(Nestor) + 46: TypePointer Uniform 45(Bt3) + 47(Btn3): 46(ptr) Variable Uniform + 48(T): TypeStruct 11 6(int) + 49(Nestor): TypeStruct 48(T) + 50(bBt1): TypeStruct 49(Nestor) + 51: TypePointer Uniform 50(bBt1) + 52(bBtn1): 51(ptr) Variable Uniform + 53(T): TypeStruct 11 6(int) + 54(Nestor): TypeStruct 53(T) + 55(bBt2): TypeStruct 54(Nestor) + 56: TypePointer Uniform 55(bBt2) + 57(bBtn2): 56(ptr) Variable Uniform + 58(bBt3): TypeStruct 49(Nestor) 54(Nestor) + 59: TypePointer Uniform 58(bBt3) + 60(bBtn3): 59(ptr) Variable Uniform + 61: TypePointer Output 29(S) + 62(sout): 61(ptr) Variable Output + 63(S): TypeStruct 8(ivec3) 13 7(int) + 64: TypePointer Output 63(S) + 65(soutinv): 64(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.length.frag.out b/deps/glslang/Test/baseResults/spv.length.frag.out new file mode 100644 index 00000000..8e799fbb --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.length.frag.out @@ -0,0 +1,52 @@ +spv.length.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 33 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 14 26 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 9 "t" + Name 14 "v" + Name 26 "gl_FragColor" + Name 32 "u" + Decorate 26(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypePointer Function 7(fvec2) + 10: TypeInt 32 0 + 11: 10(int) Constant 2 + 12: TypeArray 7(fvec2) 11 + 13: TypePointer Input 12 + 14(v): 13(ptr) Variable Input + 15: TypeInt 32 1 + 16: 15(int) Constant 0 + 17: TypePointer Input 7(fvec2) + 20: 15(int) Constant 1 + 24: TypeVector 6(float) 4 + 25: TypePointer Output 24(fvec4) +26(gl_FragColor): 25(ptr) Variable Output + 27: 6(float) Constant 1106247680 + 28: 24(fvec4) ConstantComposite 27 27 27 27 + 29: 10(int) Constant 3 + 30: TypeArray 24(fvec4) 29 + 31: TypePointer Private 30 + 32(u): 31(ptr) Variable Private + 4(main): 2 Function None 3 + 5: Label + 9(t): 8(ptr) Variable Function + 18: 17(ptr) AccessChain 14(v) 16 + 19: 7(fvec2) Load 18 + 21: 17(ptr) AccessChain 14(v) 20 + 22: 7(fvec2) Load 21 + 23: 7(fvec2) FAdd 19 22 + Store 9(t) 23 + Store 26(gl_FragColor) 28 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.localAggregates.frag.out b/deps/glslang/Test/baseResults/spv.localAggregates.frag.out new file mode 100644 index 00000000..5f89611e --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.localAggregates.frag.out @@ -0,0 +1,215 @@ +spv.localAggregates.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 136 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 15 40 90 98 108 134 135 + ExecutionMode 4 OriginUpperLeft + Source GLSL 400 + Name 4 "main" + Name 8 "s1" + MemberName 8(s1) 0 "i" + MemberName 8(s1) 1 "f" + Name 10 "s2" + MemberName 10(s2) 0 "i" + MemberName 10(s2) 1 "f" + MemberName 10(s2) 2 "s1_1" + MemberName 10(s2) 3 "bleh" + Name 12 "locals2" + Name 13 "s3" + MemberName 13(s3) 0 "s2_1" + MemberName 13(s3) 1 "i" + MemberName 13(s3) 2 "f" + MemberName 13(s3) 3 "s1_1" + Name 15 "foo3" + Name 36 "localFArray" + Name 40 "coord" + Name 49 "localIArray" + Name 68 "x" + Name 70 "localArray" + Name 75 "i" + Name 84 "a" + Name 90 "condition" + Name 98 "color" + Name 108 "gl_FragColor" + Name 128 "samp2D" + Name 134 "foo" + Name 135 "foo2" + Decorate 15(foo3) Flat + Decorate 90(condition) Flat + Decorate 108(gl_FragColor) Location 0 + Decorate 128(samp2D) DescriptorSet 0 + Decorate 134(foo) Flat + Decorate 135(foo2) Flat + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeFloat 32 + 8(s1): TypeStruct 6(int) 7(float) + 9: TypeVector 7(float) 4 + 10(s2): TypeStruct 6(int) 7(float) 8(s1) 9(fvec4) + 11: TypePointer Function 10(s2) + 13(s3): TypeStruct 10(s2) 6(int) 7(float) 8(s1) + 14: TypePointer Input 13(s3) + 15(foo3): 14(ptr) Variable Input + 16: 6(int) Constant 0 + 17: TypePointer Input 10(s2) + 20: TypePointer Input 6(int) + 23: TypeBool + 27: 6(int) Constant 2 + 28: 6(int) Constant 1 + 29: 7(float) Constant 1065353216 + 30: TypePointer Function 7(float) + 32: TypeInt 32 0 + 33: 32(int) Constant 16 + 34: TypeArray 7(float) 33 + 35: TypePointer Function 34 + 37: 6(int) Constant 4 + 38: TypeVector 7(float) 2 + 39: TypePointer Input 38(fvec2) + 40(coord): 39(ptr) Variable Input + 41: 32(int) Constant 0 + 42: TypePointer Input 7(float) + 46: 32(int) Constant 8 + 47: TypeArray 6(int) 46 + 48: TypePointer Function 47 + 52: TypePointer Function 6(int) + 69: 6(int) Constant 5 + 82: 6(int) Constant 16 + 86: 7(float) Constant 0 + 90(condition): 20(ptr) Variable Input + 96: 6(int) Constant 3 + 97: TypePointer Input 9(fvec4) + 98(color): 97(ptr) Variable Input + 100: TypePointer Function 9(fvec4) + 102: 32(int) Constant 1 + 105: 32(int) Constant 2 + 107: TypePointer Output 9(fvec4) +108(gl_FragColor): 107(ptr) Variable Output + 125: TypeImage 7(float) 2D sampled format:Unknown + 126: TypeSampledImage 125 + 127: TypePointer UniformConstant 126 + 128(samp2D): 127(ptr) Variable UniformConstant + 133: TypePointer Input 8(s1) + 134(foo): 133(ptr) Variable Input + 135(foo2): 17(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 12(locals2): 11(ptr) Variable Function + 36(localFArray): 35(ptr) Variable Function + 49(localIArray): 48(ptr) Variable Function + 68(x): 52(ptr) Variable Function + 70(localArray): 35(ptr) Variable Function + 75(i): 52(ptr) Variable Function + 84(a): 35(ptr) Variable Function + 18: 17(ptr) AccessChain 15(foo3) 16 + 19: 10(s2) Load 18 + Store 12(locals2) 19 + 21: 20(ptr) AccessChain 15(foo3) 16 16 + 22: 6(int) Load 21 + 24: 23(bool) SGreaterThan 22 16 + SelectionMerge 26 None + BranchConditional 24 25 54 + 25: Label + 31: 30(ptr) AccessChain 12(locals2) 27 28 + Store 31 29 + 43: 42(ptr) AccessChain 40(coord) 41 + 44: 7(float) Load 43 + 45: 30(ptr) AccessChain 36(localFArray) 37 + Store 45 44 + 50: 20(ptr) AccessChain 15(foo3) 16 16 + 51: 6(int) Load 50 + 53: 52(ptr) AccessChain 49(localIArray) 27 + Store 53 51 + Branch 26 + 54: Label + 55: 42(ptr) AccessChain 40(coord) 41 + 56: 7(float) Load 55 + 57: 30(ptr) AccessChain 12(locals2) 27 28 + Store 57 56 + 58: 30(ptr) AccessChain 36(localFArray) 37 + Store 58 29 + 59: 52(ptr) AccessChain 49(localIArray) 27 + Store 59 16 + Branch 26 + 26: Label + 60: 52(ptr) AccessChain 49(localIArray) 27 + 61: 6(int) Load 60 + 62: 23(bool) IEqual 61 16 + SelectionMerge 64 None + BranchConditional 62 63 64 + 63: Label + 65: 30(ptr) AccessChain 36(localFArray) 37 + 66: 7(float) Load 65 + 67: 7(float) FAdd 66 29 + Store 65 67 + Branch 64 + 64: Label + Store 68(x) 69 + 71: 6(int) Load 68(x) + 72: 42(ptr) AccessChain 40(coord) 41 + 73: 7(float) Load 72 + 74: 30(ptr) AccessChain 70(localArray) 71 + Store 74 73 + Store 75(i) 16 + Branch 76 + 76: Label + LoopMerge 78 79 None + Branch 80 + 80: Label + 81: 6(int) Load 75(i) + 83: 23(bool) SLessThan 81 82 + BranchConditional 83 77 78 + 77: Label + 85: 6(int) Load 75(i) + 87: 30(ptr) AccessChain 84(a) 85 + Store 87 86 + Branch 79 + 79: Label + 88: 6(int) Load 75(i) + 89: 6(int) IAdd 88 28 + Store 75(i) 89 + Branch 76 + 78: Label + 91: 6(int) Load 90(condition) + 92: 23(bool) IEqual 91 28 + SelectionMerge 94 None + BranchConditional 92 93 94 + 93: Label + 95: 34 Load 70(localArray) + Store 84(a) 95 + Branch 94 + 94: Label + 99: 9(fvec4) Load 98(color) + 101: 100(ptr) AccessChain 12(locals2) 96 + Store 101 99 + 103: 42(ptr) AccessChain 40(coord) 102 + 104: 7(float) Load 103 + 106: 30(ptr) AccessChain 12(locals2) 96 105 + Store 106 104 + 109: 100(ptr) AccessChain 12(locals2) 96 + 110: 9(fvec4) Load 109 + 111: 30(ptr) AccessChain 36(localFArray) 37 + 112: 7(float) Load 111 + 113: 30(ptr) AccessChain 12(locals2) 27 28 + 114: 7(float) Load 113 + 115: 7(float) FAdd 112 114 + 116: 6(int) Load 68(x) + 117: 30(ptr) AccessChain 70(localArray) 116 + 118: 7(float) Load 117 + 119: 7(float) FAdd 115 118 + 120: 6(int) Load 68(x) + 121: 30(ptr) AccessChain 84(a) 120 + 122: 7(float) Load 121 + 123: 7(float) FAdd 119 122 + 124: 9(fvec4) VectorTimesScalar 110 123 + 129: 126 Load 128(samp2D) + 130: 38(fvec2) Load 40(coord) + 131: 9(fvec4) ImageSampleImplicitLod 129 130 + 132: 9(fvec4) FMul 124 131 + Store 108(gl_FragColor) 132 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.loops.frag.out b/deps/glslang/Test/baseResults/spv.loops.frag.out new file mode 100644 index 00000000..046360f6 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.loops.frag.out @@ -0,0 +1,1105 @@ +spv.loops.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 725 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 11 54 57 71 106 114 118 131 137 157 160 171 308 344 350 366 380 418 450 469 512 544 552 562 588 615 624 629 649 687 698 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 9 "color" + Name 11 "BaseColor" + Name 54 "d" + Name 57 "bigColor" + Name 71 "bigColor1_1" + Name 106 "d2" + Name 114 "d3" + Name 118 "bigColor1_2" + Name 131 "bigColor1_3" + Name 137 "d4" + Name 148 "i" + Name 157 "Count" + Name 160 "bigColor2" + Name 171 "bigColor3" + Name 179 "i" + Name 195 "i" + Name 231 "i" + Name 254 "i" + Name 279 "i" + Name 308 "bigColor4" + Name 344 "bigColor5" + Name 350 "d5" + Name 366 "d6" + Name 380 "bigColor6" + Name 418 "d7" + Name 450 "bigColor7" + Name 469 "d8" + Name 512 "d9" + Name 544 "d10" + Name 552 "d11" + Name 562 "d12" + Name 588 "bigColor8" + Name 615 "gl_FragColor" + Name 624 "d14" + Name 629 "d15" + Name 649 "d16" + Name 687 "d18" + Name 698 "d17" + Decorate 157(Count) Flat + Decorate 615(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypePointer Input 7(fvec4) + 11(BaseColor): 10(ptr) Variable Input + 18: TypeBool + 19: 18(bool) ConstantTrue + 20: TypeInt 32 0 + 21: 20(int) Constant 0 + 22: TypePointer Function 6(float) + 25: 6(float) Constant 1051260355 + 29: 7(fvec4) ConstantComposite 25 25 25 25 + 35: 6(float) Constant 1059648963 + 39: 7(fvec4) ConstantComposite 35 35 35 35 + 53: TypePointer Input 6(float) + 54(d): 53(ptr) Variable Input + 57(bigColor): 10(ptr) Variable Input + 66: 20(int) Constant 2 + 71(bigColor1_1): 10(ptr) Variable Input + 75: 20(int) Constant 3 + 93: 6(float) Constant 1109917696 + 96: 6(float) Constant 1065353216 + 106(d2): 53(ptr) Variable Input + 111: 20(int) Constant 1 + 114(d3): 53(ptr) Variable Input +118(bigColor1_2): 10(ptr) Variable Input +131(bigColor1_3): 10(ptr) Variable Input + 137(d4): 53(ptr) Variable Input + 146: TypeInt 32 1 + 147: TypePointer Function 146(int) + 149: 146(int) Constant 0 + 156: TypePointer Input 146(int) + 157(Count): 156(ptr) Variable Input + 160(bigColor2): 10(ptr) Variable Input + 165: 146(int) Constant 1 + 171(bigColor3): 10(ptr) Variable Input + 186: 146(int) Constant 42 + 202: 146(int) Constant 100 + 206: 6(float) Constant 1101004800 + 238: 146(int) Constant 120 + 308(bigColor4): 10(ptr) Variable Input + 344(bigColor5): 10(ptr) Variable Input + 350(d5): 53(ptr) Variable Input + 366(d6): 53(ptr) Variable Input + 380(bigColor6): 10(ptr) Variable Input + 418(d7): 53(ptr) Variable Input + 445: 6(float) Constant 0 + 450(bigColor7): 10(ptr) Variable Input + 469(d8): 53(ptr) Variable Input + 486: 6(float) Constant 1073741824 + 512(d9): 53(ptr) Variable Input + 528: 6(float) Constant 1084227584 + 544(d10): 53(ptr) Variable Input + 552(d11): 53(ptr) Variable Input + 562(d12): 53(ptr) Variable Input + 586: 6(float) Constant 1092616192 + 588(bigColor8): 10(ptr) Variable Input + 614: TypePointer Output 7(fvec4) +615(gl_FragColor): 614(ptr) Variable Output + 624(d14): 53(ptr) Variable Input + 629(d15): 53(ptr) Variable Input + 649(d16): 53(ptr) Variable Input + 687(d18): 53(ptr) Variable Input + 698(d17): 53(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 9(color): 8(ptr) Variable Function + 148(i): 147(ptr) Variable Function + 179(i): 147(ptr) Variable Function + 195(i): 147(ptr) Variable Function + 231(i): 147(ptr) Variable Function + 254(i): 147(ptr) Variable Function + 279(i): 147(ptr) Variable Function + 12: 7(fvec4) Load 11(BaseColor) + Store 9(color) 12 + Branch 13 + 13: Label + LoopMerge 15 16 None + Branch 17 + 17: Label + BranchConditional 19 14 15 + 14: Label + 23: 22(ptr) AccessChain 9(color) 21 + 24: 6(float) Load 23 + 26: 18(bool) FOrdLessThan 24 25 + SelectionMerge 28 None + BranchConditional 26 27 28 + 27: Label + 30: 7(fvec4) Load 9(color) + 31: 7(fvec4) FAdd 30 29 + Store 9(color) 31 + Branch 15 + 28: Label + 33: 22(ptr) AccessChain 9(color) 21 + 34: 6(float) Load 33 + 36: 18(bool) FOrdLessThan 34 35 + SelectionMerge 38 None + BranchConditional 36 37 38 + 37: Label + 40: 7(fvec4) Load 9(color) + 41: 7(fvec4) FAdd 40 39 + Store 9(color) 41 + Branch 15 + 38: Label + 43: 7(fvec4) Load 9(color) + 44: 7(fvec4) FAdd 43 29 + Store 9(color) 44 + Branch 15 + 16: Label + Branch 13 + 15: Label + Branch 46 + 46: Label + LoopMerge 48 49 None + Branch 50 + 50: Label + 51: 22(ptr) AccessChain 9(color) 21 + 52: 6(float) Load 51 + 55: 6(float) Load 54(d) + 56: 18(bool) FOrdLessThan 52 55 + BranchConditional 56 47 48 + 47: Label + 58: 7(fvec4) Load 57(bigColor) + 59: 7(fvec4) Load 9(color) + 60: 7(fvec4) FAdd 59 58 + Store 9(color) 60 + Branch 49 + 49: Label + Branch 46 + 48: Label + Branch 61 + 61: Label + LoopMerge 63 64 None + Branch 65 + 65: Label + 67: 22(ptr) AccessChain 9(color) 66 + 68: 6(float) Load 67 + 69: 6(float) Load 54(d) + 70: 18(bool) FOrdLessThan 68 69 + BranchConditional 70 62 63 + 62: Label + 72: 7(fvec4) Load 71(bigColor1_1) + 73: 7(fvec4) Load 9(color) + 74: 7(fvec4) FAdd 73 72 + Store 9(color) 74 + 76: 22(ptr) AccessChain 9(color) 75 + 77: 6(float) Load 76 + 78: 6(float) Load 54(d) + 79: 18(bool) FOrdLessThan 77 78 + SelectionMerge 81 None + BranchConditional 79 80 81 + 80: Label + Branch 64 + 81: Label + 83: 7(fvec4) Load 71(bigColor1_1) + 84: 7(fvec4) Load 9(color) + 85: 7(fvec4) FAdd 84 83 + Store 9(color) 85 + Branch 64 + 64: Label + Branch 61 + 63: Label + Branch 86 + 86: Label + LoopMerge 88 89 None + Branch 90 + 90: Label + 91: 22(ptr) AccessChain 9(color) 21 + 92: 6(float) Load 91 + 94: 18(bool) FOrdLessThan 92 93 + BranchConditional 94 87 88 + 87: Label + 95: 7(fvec4) Load 9(color) + 97: 7(fvec4) CompositeConstruct 96 96 96 96 + 98: 7(fvec4) FAdd 95 97 + Store 9(color) 98 + Branch 89 + 89: Label + Branch 86 + 88: Label + Branch 99 + 99: Label + LoopMerge 101 102 None + Branch 103 + 103: Label + 104: 22(ptr) AccessChain 9(color) 75 + 105: 6(float) Load 104 + 107: 6(float) Load 106(d2) + 108: 18(bool) FOrdLessThan 105 107 + SelectionMerge 110 None + BranchConditional 108 109 110 + 109: Label + 112: 22(ptr) AccessChain 9(color) 111 + 113: 6(float) Load 112 + 115: 6(float) Load 114(d3) + 116: 18(bool) FOrdLessThan 113 115 + Branch 110 + 110: Label + 117: 18(bool) Phi 108 103 116 109 + BranchConditional 117 100 101 + 100: Label + 119: 7(fvec4) Load 118(bigColor1_2) + 120: 7(fvec4) Load 9(color) + 121: 7(fvec4) FAdd 120 119 + Store 9(color) 121 + Branch 102 + 102: Label + Branch 99 + 101: Label + Branch 122 + 122: Label + LoopMerge 124 125 None + Branch 126 + 126: Label + 127: 22(ptr) AccessChain 9(color) 66 + 128: 6(float) Load 127 + 129: 6(float) Load 114(d3) + 130: 18(bool) FOrdLessThan 128 129 + BranchConditional 130 123 124 + 123: Label + 132: 7(fvec4) Load 131(bigColor1_3) + 133: 7(fvec4) Load 9(color) + 134: 7(fvec4) FAdd 133 132 + Store 9(color) 134 + 135: 22(ptr) AccessChain 9(color) 111 + 136: 6(float) Load 135 + 138: 6(float) Load 137(d4) + 139: 18(bool) FOrdLessThan 136 138 + SelectionMerge 141 None + BranchConditional 139 140 141 + 140: Label + Branch 124 + 141: Label + 143: 7(fvec4) Load 131(bigColor1_3) + 144: 7(fvec4) Load 9(color) + 145: 7(fvec4) FAdd 144 143 + Store 9(color) 145 + Branch 125 + 125: Label + Branch 122 + 124: Label + Store 148(i) 149 + Branch 150 + 150: Label + LoopMerge 152 153 None + Branch 154 + 154: Label + 155: 146(int) Load 148(i) + 158: 146(int) Load 157(Count) + 159: 18(bool) SLessThan 155 158 + BranchConditional 159 151 152 + 151: Label + 161: 7(fvec4) Load 160(bigColor2) + 162: 7(fvec4) Load 9(color) + 163: 7(fvec4) FAdd 162 161 + Store 9(color) 163 + Branch 153 + 153: Label + 164: 146(int) Load 148(i) + 166: 146(int) IAdd 164 165 + Store 148(i) 166 + Branch 150 + 152: Label + Branch 167 + 167: Label + LoopMerge 169 170 None + Branch 168 + 168: Label + 172: 7(fvec4) Load 171(bigColor3) + 173: 7(fvec4) Load 9(color) + 174: 7(fvec4) FAdd 173 172 + Store 9(color) 174 + Branch 170 + 170: Label + 175: 22(ptr) AccessChain 9(color) 21 + 176: 6(float) Load 175 + 177: 6(float) Load 106(d2) + 178: 18(bool) FOrdLessThan 176 177 + BranchConditional 178 167 169 + 169: Label + Store 179(i) 149 + Branch 180 + 180: Label + LoopMerge 182 183 None + Branch 184 + 184: Label + 185: 146(int) Load 179(i) + 187: 18(bool) SLessThan 185 186 + BranchConditional 187 181 182 + 181: Label + 188: 6(float) Load 114(d3) + 189: 22(ptr) AccessChain 9(color) 66 + 190: 6(float) Load 189 + 191: 6(float) FAdd 190 188 + 192: 22(ptr) AccessChain 9(color) 66 + Store 192 191 + Branch 183 + 183: Label + 193: 146(int) Load 179(i) + 194: 146(int) IAdd 193 165 + Store 179(i) 194 + Branch 180 + 182: Label + Store 195(i) 149 + Branch 196 + 196: Label + LoopMerge 198 199 None + Branch 200 + 200: Label + 201: 146(int) Load 195(i) + 203: 18(bool) SLessThan 201 202 + BranchConditional 203 197 198 + 197: Label + 204: 22(ptr) AccessChain 9(color) 66 + 205: 6(float) Load 204 + 207: 18(bool) FOrdLessThan 205 206 + SelectionMerge 209 None + BranchConditional 207 208 213 + 208: Label + 210: 22(ptr) AccessChain 9(color) 21 + 211: 6(float) Load 210 + 212: 6(float) FAdd 211 96 + Store 210 212 + Branch 209 + 213: Label + 214: 22(ptr) AccessChain 9(color) 111 + 215: 6(float) Load 214 + 216: 6(float) FAdd 215 96 + Store 214 216 + Branch 209 + 209: Label + 217: 22(ptr) AccessChain 9(color) 75 + 218: 6(float) Load 217 + 219: 18(bool) FOrdLessThan 218 206 + SelectionMerge 221 None + BranchConditional 219 220 221 + 220: Label + 222: 22(ptr) AccessChain 9(color) 66 + 223: 6(float) Load 222 + 224: 22(ptr) AccessChain 9(color) 111 + 225: 6(float) Load 224 + 226: 18(bool) FOrdGreaterThan 223 225 + SelectionMerge 228 None + BranchConditional 226 227 228 + 227: Label + Branch 228 + 228: Label + Branch 221 + 221: Label + Branch 199 + 199: Label + 229: 146(int) Load 195(i) + 230: 146(int) IAdd 229 165 + Store 195(i) 230 + Branch 196 + 198: Label + Store 231(i) 149 + Branch 232 + 232: Label + LoopMerge 234 235 None + Branch 236 + 236: Label + 237: 146(int) Load 231(i) + 239: 18(bool) SLessThan 237 238 + BranchConditional 239 233 234 + 233: Label + 240: 22(ptr) AccessChain 9(color) 66 + 241: 6(float) Load 240 + 242: 18(bool) FOrdLessThan 241 206 + SelectionMerge 244 None + BranchConditional 242 243 248 + 243: Label + 245: 22(ptr) AccessChain 9(color) 21 + 246: 6(float) Load 245 + 247: 6(float) FAdd 246 96 + Store 245 247 + Branch 244 + 248: Label + 249: 22(ptr) AccessChain 9(color) 111 + 250: 6(float) Load 249 + 251: 6(float) FAdd 250 96 + Store 249 251 + Branch 244 + 244: Label + Branch 235 + 235: Label + 252: 146(int) Load 231(i) + 253: 146(int) IAdd 252 165 + Store 231(i) 253 + Branch 232 + 234: Label + Store 254(i) 149 + Branch 255 + 255: Label + LoopMerge 257 258 None + Branch 259 + 259: Label + 260: 146(int) Load 254(i) + 261: 18(bool) SLessThan 260 186 + BranchConditional 261 256 257 + 256: Label + 262: 6(float) Load 114(d3) + 263: 22(ptr) AccessChain 9(color) 66 + 264: 6(float) Load 263 + 265: 6(float) FAdd 264 262 + 266: 22(ptr) AccessChain 9(color) 66 + Store 266 265 + 267: 22(ptr) AccessChain 9(color) 21 + 268: 6(float) Load 267 + 269: 6(float) Load 137(d4) + 270: 18(bool) FOrdLessThan 268 269 + SelectionMerge 272 None + BranchConditional 270 271 272 + 271: Label + Branch 258 + 272: Label + 274: 22(ptr) AccessChain 9(color) 75 + 275: 6(float) Load 274 + 276: 6(float) FAdd 275 96 + Store 274 276 + Branch 258 + 258: Label + 277: 146(int) Load 254(i) + 278: 146(int) IAdd 277 165 + Store 254(i) 278 + Branch 255 + 257: Label + Store 279(i) 149 + Branch 280 + 280: Label + LoopMerge 282 283 None + Branch 284 + 284: Label + 285: 146(int) Load 279(i) + 286: 18(bool) SLessThan 285 186 + BranchConditional 286 281 282 + 281: Label + 287: 6(float) Load 114(d3) + 288: 22(ptr) AccessChain 9(color) 66 + 289: 6(float) Load 288 + 290: 6(float) FAdd 289 287 + 291: 22(ptr) AccessChain 9(color) 66 + Store 291 290 + 292: 22(ptr) AccessChain 9(color) 21 + 293: 6(float) Load 292 + 294: 6(float) Load 137(d4) + 295: 18(bool) FOrdLessThan 293 294 + SelectionMerge 297 None + BranchConditional 295 296 297 + 296: Label + Branch 282 + 297: Label + 299: 22(ptr) AccessChain 9(color) 75 + 300: 6(float) Load 299 + 301: 6(float) FAdd 300 96 + Store 299 301 + Branch 283 + 283: Label + 302: 146(int) Load 279(i) + 303: 146(int) IAdd 302 165 + Store 279(i) 303 + Branch 280 + 282: Label + Branch 304 + 304: Label + LoopMerge 306 307 None + Branch 305 + 305: Label + 309: 7(fvec4) Load 308(bigColor4) + 310: 7(fvec4) Load 9(color) + 311: 7(fvec4) FAdd 310 309 + Store 9(color) 311 + 312: 22(ptr) AccessChain 9(color) 21 + 313: 6(float) Load 312 + 314: 6(float) Load 137(d4) + 315: 18(bool) FOrdLessThan 313 314 + SelectionMerge 317 None + BranchConditional 315 316 317 + 316: Label + Branch 307 + 317: Label + 319: 22(ptr) AccessChain 9(color) 111 + 320: 6(float) Load 319 + 321: 6(float) Load 137(d4) + 322: 18(bool) FOrdLessThan 320 321 + SelectionMerge 324 None + BranchConditional 322 323 330 + 323: Label + 325: 6(float) Load 137(d4) + 326: 22(ptr) AccessChain 9(color) 111 + 327: 6(float) Load 326 + 328: 6(float) FAdd 327 325 + 329: 22(ptr) AccessChain 9(color) 111 + Store 329 328 + Branch 324 + 330: Label + 331: 6(float) Load 137(d4) + 332: 22(ptr) AccessChain 9(color) 21 + 333: 6(float) Load 332 + 334: 6(float) FAdd 333 331 + 335: 22(ptr) AccessChain 9(color) 21 + Store 335 334 + Branch 324 + 324: Label + Branch 307 + 307: Label + 336: 22(ptr) AccessChain 9(color) 66 + 337: 6(float) Load 336 + 338: 6(float) Load 137(d4) + 339: 18(bool) FOrdLessThan 337 338 + BranchConditional 339 304 306 + 306: Label + Branch 340 + 340: Label + LoopMerge 342 343 None + Branch 341 + 341: Label + 345: 7(fvec4) Load 344(bigColor5) + 346: 7(fvec4) Load 9(color) + 347: 7(fvec4) FAdd 346 345 + Store 9(color) 347 + 348: 22(ptr) AccessChain 9(color) 111 + 349: 6(float) Load 348 + 351: 6(float) Load 350(d5) + 352: 18(bool) FOrdLessThan 349 351 + SelectionMerge 354 None + BranchConditional 352 353 354 + 353: Label + 355: 6(float) Load 350(d5) + 356: 22(ptr) AccessChain 9(color) 111 + 357: 6(float) Load 356 + 358: 6(float) FAdd 357 355 + 359: 22(ptr) AccessChain 9(color) 111 + Store 359 358 + Branch 354 + 354: Label + Branch 343 + 343: Label + 360: 22(ptr) AccessChain 9(color) 21 + 361: 6(float) Load 360 + 362: 6(float) Load 350(d5) + 363: 18(bool) FOrdLessThan 361 362 + BranchConditional 363 340 342 + 342: Label + 364: 22(ptr) AccessChain 9(color) 21 + 365: 6(float) Load 364 + 367: 6(float) Load 366(d6) + 368: 18(bool) FOrdLessThan 365 367 + SelectionMerge 370 None + BranchConditional 368 369 384 + 369: Label + Branch 371 + 371: Label + LoopMerge 373 374 None + Branch 375 + 375: Label + 376: 22(ptr) AccessChain 9(color) 111 + 377: 6(float) Load 376 + 378: 6(float) Load 366(d6) + 379: 18(bool) FOrdLessThan 377 378 + BranchConditional 379 372 373 + 372: Label + 381: 7(fvec4) Load 380(bigColor6) + 382: 7(fvec4) Load 9(color) + 383: 7(fvec4) FAdd 382 381 + Store 9(color) 383 + Branch 374 + 374: Label + Branch 371 + 373: Label + Branch 370 + 384: Label + Branch 385 + 385: Label + LoopMerge 387 388 None + Branch 389 + 389: Label + 390: 22(ptr) AccessChain 9(color) 66 + 391: 6(float) Load 390 + 392: 6(float) Load 366(d6) + 393: 18(bool) FOrdLessThan 391 392 + BranchConditional 393 386 387 + 386: Label + 394: 53(ptr) AccessChain 380(bigColor6) 66 + 395: 6(float) Load 394 + 396: 22(ptr) AccessChain 9(color) 66 + 397: 6(float) Load 396 + 398: 6(float) FAdd 397 395 + 399: 22(ptr) AccessChain 9(color) 66 + Store 399 398 + Branch 388 + 388: Label + Branch 385 + 387: Label + Branch 370 + 370: Label + 400: 22(ptr) AccessChain 9(color) 21 + 401: 6(float) Load 400 + 402: 6(float) Load 366(d6) + 403: 18(bool) FOrdLessThan 401 402 + SelectionMerge 405 None + BranchConditional 403 404 424 + 404: Label + Branch 406 + 406: Label + LoopMerge 408 409 None + Branch 410 + 410: Label + 411: 22(ptr) AccessChain 9(color) 111 + 412: 6(float) Load 411 + 413: 6(float) Load 366(d6) + 414: 18(bool) FOrdLessThan 412 413 + BranchConditional 414 407 408 + 407: Label + 415: 7(fvec4) Load 380(bigColor6) + 416: 7(fvec4) Load 9(color) + 417: 7(fvec4) FAdd 416 415 + Store 9(color) 417 + 419: 6(float) Load 418(d7) + 420: 18(bool) FOrdLessThan 419 96 + SelectionMerge 422 None + BranchConditional 420 421 422 + 421: Label + Branch 408 + 422: Label + Branch 409 + 409: Label + Branch 406 + 408: Label + Branch 405 + 424: Label + Branch 425 + 425: Label + LoopMerge 427 428 None + Branch 429 + 429: Label + 430: 22(ptr) AccessChain 9(color) 66 + 431: 6(float) Load 430 + 432: 6(float) Load 366(d6) + 433: 18(bool) FOrdLessThan 431 432 + BranchConditional 433 426 427 + 426: Label + 434: 53(ptr) AccessChain 380(bigColor6) 66 + 435: 6(float) Load 434 + 436: 22(ptr) AccessChain 9(color) 66 + 437: 6(float) Load 436 + 438: 6(float) FAdd 437 435 + 439: 22(ptr) AccessChain 9(color) 66 + Store 439 438 + Branch 428 + 428: Label + Branch 425 + 427: Label + Branch 405 + 405: Label + Branch 440 + 440: Label + LoopMerge 442 443 None + Branch 441 + 441: Label + 444: 6(float) Load 418(d7) + 446: 18(bool) FOrdLessThan 444 445 + SelectionMerge 448 None + BranchConditional 446 447 448 + 447: Label + Branch 442 + 448: Label + 451: 7(fvec4) Load 450(bigColor7) + 452: 7(fvec4) Load 9(color) + 453: 7(fvec4) FAdd 452 451 + Store 9(color) 453 + 454: 6(float) Load 418(d7) + 455: 18(bool) FOrdLessThan 454 96 + SelectionMerge 457 None + BranchConditional 455 456 457 + 456: Label + 458: 22(ptr) AccessChain 9(color) 66 + 459: 6(float) Load 458 + 460: 6(float) FAdd 459 96 + Store 458 460 + Branch 442 + 457: Label + 462: 7(fvec4) Load 11(BaseColor) + 463: 7(fvec4) Load 9(color) + 464: 7(fvec4) FAdd 463 462 + Store 9(color) 464 + Branch 443 + 443: Label + BranchConditional 19 440 442 + 442: Label + Branch 465 + 465: Label + LoopMerge 467 468 None + Branch 466 + 466: Label + 470: 6(float) Load 469(d8) + 471: 18(bool) FOrdLessThan 470 445 + SelectionMerge 473 None + BranchConditional 471 472 473 + 472: Label + Branch 467 + 473: Label + 475: 7(fvec4) Load 450(bigColor7) + 476: 7(fvec4) Load 9(color) + 477: 7(fvec4) FAdd 476 475 + Store 9(color) 477 + 478: 6(float) Load 469(d8) + 479: 18(bool) FOrdLessThan 478 96 + SelectionMerge 481 None + BranchConditional 479 480 481 + 480: Label + 482: 22(ptr) AccessChain 9(color) 66 + 483: 6(float) Load 482 + 484: 6(float) FAdd 483 96 + Store 482 484 + 485: 6(float) Load 469(d8) + 487: 18(bool) FOrdLessThan 485 486 + SelectionMerge 489 None + BranchConditional 487 488 493 + 488: Label + 490: 22(ptr) AccessChain 9(color) 111 + 491: 6(float) Load 490 + 492: 6(float) FAdd 491 96 + Store 490 492 + Branch 489 + 493: Label + 494: 22(ptr) AccessChain 9(color) 21 + 495: 6(float) Load 494 + 496: 6(float) FAdd 495 96 + Store 494 496 + Branch 489 + 489: Label + Branch 467 + 481: Label + 498: 7(fvec4) Load 11(BaseColor) + 499: 7(fvec4) Load 9(color) + 500: 7(fvec4) FAdd 499 498 + Store 9(color) 500 + Branch 468 + 468: Label + 501: 22(ptr) AccessChain 9(color) 66 + 502: 6(float) Load 501 + 503: 6(float) Load 469(d8) + 504: 18(bool) FOrdLessThan 502 503 + BranchConditional 504 465 467 + 467: Label + Branch 505 + 505: Label + LoopMerge 507 508 None + Branch 509 + 509: Label + 510: 22(ptr) AccessChain 9(color) 75 + 511: 6(float) Load 510 + 513: 6(float) Load 512(d9) + 514: 18(bool) FOrdLessThan 511 513 + BranchConditional 514 506 507 + 506: Label + 515: 6(float) Load 512(d9) + 516: 6(float) Load 469(d8) + 517: 18(bool) FOrdGreaterThan 515 516 + SelectionMerge 519 None + BranchConditional 517 518 519 + 518: Label + 520: 22(ptr) AccessChain 9(color) 21 + 521: 6(float) Load 520 + 522: 6(float) Load 418(d7) + 523: 18(bool) FOrdLessThanEqual 521 522 + SelectionMerge 525 None + BranchConditional 523 524 525 + 524: Label + 526: 22(ptr) AccessChain 9(color) 66 + 527: 6(float) Load 526 + 529: 18(bool) FOrdEqual 527 528 + SelectionMerge 531 None + BranchConditional 529 530 535 + 530: Label + 532: 22(ptr) AccessChain 9(color) 75 + 533: 6(float) Load 532 + 534: 6(float) FAdd 533 96 + Store 532 534 + Branch 531 + 535: Label + Branch 507 + 531: Label + Branch 525 + 525: Label + Branch 519 + 519: Label + Branch 508 + 508: Label + Branch 505 + 507: Label + Branch 537 + 537: Label + LoopMerge 539 540 None + Branch 541 + 541: Label + 542: 22(ptr) AccessChain 9(color) 66 + 543: 6(float) Load 542 + 545: 6(float) Load 544(d10) + 546: 18(bool) FOrdLessThan 543 545 + BranchConditional 546 538 539 + 538: Label + 547: 22(ptr) AccessChain 9(color) 111 + 548: 6(float) Load 547 + 549: 6(float) FAdd 548 96 + Store 547 549 + 550: 22(ptr) AccessChain 9(color) 111 + 551: 6(float) Load 550 + 553: 6(float) Load 552(d11) + 554: 18(bool) FOrdLessThan 551 553 + SelectionMerge 556 None + BranchConditional 554 555 556 + 555: Label + 557: 22(ptr) AccessChain 9(color) 66 + 558: 6(float) Load 557 + 559: 6(float) FAdd 558 96 + Store 557 559 + 560: 22(ptr) AccessChain 9(color) 75 + 561: 6(float) Load 560 + 563: 6(float) Load 562(d12) + 564: 18(bool) FOrdLessThan 561 563 + SelectionMerge 566 None + BranchConditional 564 565 570 + 565: Label + 567: 22(ptr) AccessChain 9(color) 75 + 568: 6(float) Load 567 + 569: 6(float) FAdd 568 96 + Store 567 569 + Branch 566 + 570: Label + 571: 22(ptr) AccessChain 9(color) 21 + 572: 6(float) Load 571 + 573: 6(float) FAdd 572 96 + Store 571 573 + Branch 566 + 566: Label + Branch 540 + 556: Label + 575: 7(fvec4) Load 9(color) + 576: 7(fvec4) CompositeConstruct 96 96 96 96 + 577: 7(fvec4) FAdd 575 576 + Store 9(color) 577 + Branch 539 + 540: Label + Branch 537 + 539: Label + Branch 579 + 579: Label + LoopMerge 581 582 None + Branch 583 + 583: Label + 584: 22(ptr) AccessChain 9(color) 21 + 585: 6(float) Load 584 + 587: 18(bool) FOrdLessThan 585 586 + BranchConditional 587 580 581 + 580: Label + 589: 7(fvec4) Load 588(bigColor8) + 590: 7(fvec4) Load 9(color) + 591: 7(fvec4) FAdd 590 589 + Store 9(color) 591 + 592: 22(ptr) AccessChain 9(color) 66 + 593: 6(float) Load 592 + 594: 6(float) Load 469(d8) + 595: 18(bool) FOrdLessThan 593 594 + SelectionMerge 597 None + BranchConditional 595 596 597 + 596: Label + 598: 22(ptr) AccessChain 9(color) 75 + 599: 6(float) Load 598 + 600: 6(float) Load 366(d6) + 601: 18(bool) FOrdLessThan 599 600 + SelectionMerge 603 None + BranchConditional 601 602 603 + 602: Label + Branch 582 + 603: Label + Branch 597 + 597: Label + 605: 53(ptr) AccessChain 588(bigColor8) 21 + 606: 6(float) Load 605 + 607: 22(ptr) AccessChain 9(color) 111 + 608: 6(float) Load 607 + 609: 6(float) FAdd 608 606 + 610: 22(ptr) AccessChain 9(color) 111 + Store 610 609 + Branch 582 + 582: Label + Branch 579 + 581: Label + 611: 7(fvec4) Load 9(color) + 612: 7(fvec4) CompositeConstruct 96 96 96 96 + 613: 7(fvec4) FAdd 611 612 + Store 9(color) 613 + 616: 7(fvec4) Load 9(color) + Store 615(gl_FragColor) 616 + Branch 617 + 617: Label + LoopMerge 619 620 None + Branch 621 + 621: Label + 622: 22(ptr) AccessChain 9(color) 21 + 623: 6(float) Load 622 + 625: 6(float) Load 624(d14) + 626: 18(bool) FOrdLessThan 623 625 + BranchConditional 626 618 619 + 618: Label + 627: 22(ptr) AccessChain 9(color) 111 + 628: 6(float) Load 627 + 630: 6(float) Load 629(d15) + 631: 18(bool) FOrdLessThan 628 630 + SelectionMerge 633 None + BranchConditional 631 632 635 + 632: Label + Return + 635: Label + 636: 7(fvec4) Load 9(color) + 637: 7(fvec4) CompositeConstruct 96 96 96 96 + 638: 7(fvec4) FAdd 636 637 + Store 9(color) 638 + Branch 633 + 633: Label + Branch 620 + 620: Label + Branch 617 + 619: Label + 639: 7(fvec4) Load 9(color) + 640: 7(fvec4) CompositeConstruct 96 96 96 96 + 641: 7(fvec4) FAdd 639 640 + Store 9(color) 641 + Branch 642 + 642: Label + LoopMerge 644 645 None + Branch 646 + 646: Label + 647: 22(ptr) AccessChain 9(color) 75 + 648: 6(float) Load 647 + 650: 6(float) Load 649(d16) + 651: 18(bool) FOrdLessThan 648 650 + BranchConditional 651 643 644 + 643: Label + 652: 22(ptr) AccessChain 9(color) 75 + 653: 6(float) Load 652 + 654: 6(float) FAdd 653 96 + Store 652 654 + Branch 645 + 645: Label + Branch 642 + 644: Label + Branch 655 + 655: Label + LoopMerge 657 658 None + Branch 659 + 659: Label + 660: 22(ptr) AccessChain 9(color) 75 + 661: 6(float) Load 660 + 662: 6(float) Load 106(d2) + 663: 18(bool) FOrdLessThan 661 662 + SelectionMerge 665 None + BranchConditional 663 664 665 + 664: Label + 666: 22(ptr) AccessChain 9(color) 111 + 667: 6(float) Load 666 + 668: 6(float) Load 114(d3) + 669: 18(bool) FOrdLessThan 667 668 + Branch 665 + 665: Label + 670: 18(bool) Phi 663 659 669 664 + BranchConditional 670 656 657 + 656: Label + 671: 7(fvec4) Load 118(bigColor1_2) + 672: 7(fvec4) Load 9(color) + 673: 7(fvec4) FAdd 672 671 + Store 9(color) 673 + 674: 22(ptr) AccessChain 9(color) 66 + 675: 6(float) Load 674 + 676: 6(float) Load 114(d3) + 677: 18(bool) FOrdLessThan 675 676 + SelectionMerge 679 None + BranchConditional 677 678 679 + 678: Label + Return + 679: Label + Branch 658 + 658: Label + Branch 655 + 657: Label + Branch 681 + 681: Label + LoopMerge 683 684 None + Branch 682 + 682: Label + 685: 22(ptr) AccessChain 9(color) 111 + 686: 6(float) Load 685 + 688: 6(float) Load 687(d18) + 689: 18(bool) FOrdLessThan 686 688 + SelectionMerge 691 None + BranchConditional 689 690 691 + 690: Label + Return + 691: Label + 693: 7(fvec4) Load 9(color) + 694: 7(fvec4) CompositeConstruct 96 96 96 96 + 695: 7(fvec4) FAdd 693 694 + Store 9(color) 695 + Branch 684 + 684: Label + 696: 22(ptr) AccessChain 9(color) 21 + 697: 6(float) Load 696 + 699: 6(float) Load 698(d17) + 700: 18(bool) FOrdLessThan 697 699 + BranchConditional 700 681 683 + 683: Label + Branch 701 + 701: Label + LoopMerge 703 704 None + Branch 705 + 705: Label + 706: 22(ptr) AccessChain 9(color) 111 + 707: 6(float) Load 706 + 708: 6(float) Load 649(d16) + 709: 18(bool) FOrdLessThan 707 708 + BranchConditional 709 702 703 + 702: Label + 710: 22(ptr) AccessChain 9(color) 75 + 711: 6(float) Load 710 + 712: 6(float) Load 649(d16) + 713: 18(bool) FOrdLessThan 711 712 + SelectionMerge 715 None + BranchConditional 713 714 717 + 714: Label + Kill + 717: Label + 718: 7(fvec4) Load 9(color) + 719: 7(fvec4) CompositeConstruct 96 96 96 96 + 720: 7(fvec4) FAdd 718 719 + Store 9(color) 720 + Branch 715 + 715: Label + Branch 704 + 704: Label + Branch 701 + 703: Label + 721: 7(fvec4) Load 9(color) + 722: 7(fvec4) CompositeConstruct 96 96 96 96 + 723: 7(fvec4) FAdd 721 722 + Store 9(color) 723 + 724: 7(fvec4) Load 9(color) + Store 615(gl_FragColor) 724 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.loopsArtificial.frag.out b/deps/glslang/Test/baseResults/spv.loopsArtificial.frag.out new file mode 100644 index 00000000..d0d60542 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.loopsArtificial.frag.out @@ -0,0 +1,240 @@ +spv.loopsArtificial.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 158 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 11 17 27 80 140 142 143 144 145 146 147 148 149 150 151 152 153 154 157 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 9 "color" + Name 11 "BaseColor" + Name 17 "bigColor4" + Name 27 "d4" + Name 80 "d13" + Name 140 "gl_FragColor" + Name 142 "bigColor" + Name 143 "bigColor1_1" + Name 144 "bigColor1_2" + Name 145 "bigColor1_3" + Name 146 "bigColor2" + Name 147 "bigColor3" + Name 148 "bigColor5" + Name 149 "bigColor6" + Name 150 "bigColor7" + Name 151 "bigColor8" + Name 152 "d" + Name 153 "d2" + Name 154 "d3" + Name 157 "Count" + Decorate 140(gl_FragColor) Location 0 + Decorate 157(Count) Flat + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypePointer Input 7(fvec4) + 11(BaseColor): 10(ptr) Variable Input + 17(bigColor4): 10(ptr) Variable Input + 21: TypeInt 32 0 + 22: 21(int) Constant 0 + 23: TypePointer Function 6(float) + 26: TypePointer Input 6(float) + 27(d4): 26(ptr) Variable Input + 29: TypeBool + 33: 6(float) Constant 1073741824 + 34: 21(int) Constant 2 + 47: 6(float) Constant 1065353216 + 50: 21(int) Constant 1 + 77: 21(int) Constant 3 + 80(d13): 26(ptr) Variable Input + 139: TypePointer Output 7(fvec4) +140(gl_FragColor): 139(ptr) Variable Output + 142(bigColor): 10(ptr) Variable Input +143(bigColor1_1): 10(ptr) Variable Input +144(bigColor1_2): 10(ptr) Variable Input +145(bigColor1_3): 10(ptr) Variable Input + 146(bigColor2): 10(ptr) Variable Input + 147(bigColor3): 10(ptr) Variable Input + 148(bigColor5): 10(ptr) Variable Input + 149(bigColor6): 10(ptr) Variable Input + 150(bigColor7): 10(ptr) Variable Input + 151(bigColor8): 10(ptr) Variable Input + 152(d): 26(ptr) Variable Input + 153(d2): 26(ptr) Variable Input + 154(d3): 26(ptr) Variable Input + 155: TypeInt 32 1 + 156: TypePointer Input 155(int) + 157(Count): 156(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 9(color): 8(ptr) Variable Function + 12: 7(fvec4) Load 11(BaseColor) + Store 9(color) 12 + Branch 13 + 13: Label + LoopMerge 15 16 None + Branch 14 + 14: Label + 18: 7(fvec4) Load 17(bigColor4) + 19: 7(fvec4) Load 9(color) + 20: 7(fvec4) FAdd 19 18 + Store 9(color) 20 + 24: 23(ptr) AccessChain 9(color) 22 + 25: 6(float) Load 24 + 28: 6(float) Load 27(d4) + 30: 29(bool) FOrdLessThan 25 28 + SelectionMerge 32 None + BranchConditional 30 31 32 + 31: Label + 35: 23(ptr) AccessChain 9(color) 34 + 36: 6(float) Load 35 + 37: 6(float) FAdd 36 33 + 38: 23(ptr) AccessChain 9(color) 34 + Store 38 37 + 39: 23(ptr) AccessChain 9(color) 34 + 40: 6(float) Load 39 + 41: 6(float) Load 27(d4) + 42: 29(bool) FOrdLessThan 40 41 + SelectionMerge 44 None + BranchConditional 42 43 44 + 43: Label + 45: 23(ptr) AccessChain 9(color) 22 + 46: 6(float) Load 45 + 48: 6(float) FAdd 46 47 + Store 45 48 + Branch 16 + 44: Label + Branch 32 + 32: Label + 51: 23(ptr) AccessChain 9(color) 50 + 52: 6(float) Load 51 + 53: 6(float) Load 27(d4) + 54: 29(bool) FOrdLessThan 52 53 + SelectionMerge 56 None + BranchConditional 54 55 62 + 55: Label + 57: 6(float) Load 27(d4) + 58: 23(ptr) AccessChain 9(color) 50 + 59: 6(float) Load 58 + 60: 6(float) FAdd 59 57 + 61: 23(ptr) AccessChain 9(color) 50 + Store 61 60 + Branch 56 + 62: Label + 63: 6(float) Load 27(d4) + 64: 23(ptr) AccessChain 9(color) 22 + 65: 6(float) Load 64 + 66: 6(float) FAdd 65 63 + 67: 23(ptr) AccessChain 9(color) 22 + Store 67 66 + Branch 56 + 56: Label + Branch 16 + 16: Label + 68: 23(ptr) AccessChain 9(color) 34 + 69: 6(float) Load 68 + 70: 6(float) Load 27(d4) + 71: 29(bool) FOrdLessThan 69 70 + BranchConditional 71 13 15 + 15: Label + Branch 72 + 72: Label + LoopMerge 74 75 None + Branch 76 + 76: Label + 78: 23(ptr) AccessChain 9(color) 77 + 79: 6(float) Load 78 + 81: 6(float) Load 80(d13) + 82: 29(bool) FOrdLessThan 79 81 + BranchConditional 82 73 74 + 73: Label + 83: 23(ptr) AccessChain 9(color) 34 + 84: 6(float) Load 83 + 85: 6(float) Load 80(d13) + 86: 29(bool) FOrdLessThan 84 85 + SelectionMerge 88 None + BranchConditional 86 87 92 + 87: Label + 89: 7(fvec4) Load 9(color) + 90: 7(fvec4) CompositeConstruct 47 47 47 47 + 91: 7(fvec4) FAdd 89 90 + Store 9(color) 91 + Branch 88 + 92: Label + 93: 7(fvec4) Load 9(color) + 94: 7(fvec4) CompositeConstruct 47 47 47 47 + 95: 7(fvec4) FSub 93 94 + Store 9(color) 95 + Branch 88 + 88: Label + 96: 7(fvec4) Load 17(bigColor4) + 97: 7(fvec4) Load 9(color) + 98: 7(fvec4) FAdd 97 96 + Store 9(color) 98 + 99: 23(ptr) AccessChain 9(color) 22 + 100: 6(float) Load 99 + 101: 6(float) Load 27(d4) + 102: 29(bool) FOrdLessThan 100 101 + SelectionMerge 104 None + BranchConditional 102 103 104 + 103: Label + 105: 23(ptr) AccessChain 9(color) 34 + 106: 6(float) Load 105 + 107: 6(float) FAdd 106 33 + 108: 23(ptr) AccessChain 9(color) 34 + Store 108 107 + 109: 23(ptr) AccessChain 9(color) 34 + 110: 6(float) Load 109 + 111: 6(float) Load 27(d4) + 112: 29(bool) FOrdLessThan 110 111 + SelectionMerge 114 None + BranchConditional 112 113 114 + 113: Label + 115: 23(ptr) AccessChain 9(color) 22 + 116: 6(float) Load 115 + 117: 6(float) FAdd 116 47 + Store 115 117 + Branch 75 + 114: Label + Branch 104 + 104: Label + 119: 23(ptr) AccessChain 9(color) 50 + 120: 6(float) Load 119 + 121: 6(float) Load 27(d4) + 122: 29(bool) FOrdLessThan 120 121 + SelectionMerge 124 None + BranchConditional 122 123 130 + 123: Label + 125: 6(float) Load 27(d4) + 126: 23(ptr) AccessChain 9(color) 50 + 127: 6(float) Load 126 + 128: 6(float) FAdd 127 125 + 129: 23(ptr) AccessChain 9(color) 50 + Store 129 128 + Branch 124 + 130: Label + 131: 6(float) Load 27(d4) + 132: 23(ptr) AccessChain 9(color) 22 + 133: 6(float) Load 132 + 134: 6(float) FAdd 133 131 + 135: 23(ptr) AccessChain 9(color) 22 + Store 135 134 + Branch 124 + 124: Label + Branch 75 + 75: Label + Branch 72 + 74: Label + 136: 7(fvec4) Load 9(color) + 137: 7(fvec4) CompositeConstruct 47 47 47 47 + 138: 7(fvec4) FAdd 136 137 + Store 9(color) 138 + 141: 7(fvec4) Load 9(color) + Store 140(gl_FragColor) 141 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.looseUniformNoLoc.vert.out b/deps/glslang/Test/baseResults/spv.looseUniformNoLoc.vert.out new file mode 100644 index 00000000..55d1639c --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.looseUniformNoLoc.vert.out @@ -0,0 +1,8 @@ +spv.looseUniformNoLoc.vert +ERROR: spv.looseUniformNoLoc.vert:9: 'uv' : non-opaque uniform variables need a layout(location=L) +ERROR: 1 compilation errors. No code generated. + + +ERROR: Linking vertex stage: Missing entry point: Each stage requires one entry point + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.matFun.vert.out b/deps/glslang/Test/baseResults/spv.matFun.vert.out new file mode 100644 index 00000000..47b692f7 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.matFun.vert.out @@ -0,0 +1,155 @@ +spv.matFun.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 103 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 76 81 + Source GLSL 400 + Name 4 "main" + Name 14 "xf(mf33;vf3;" + Name 12 "m" + Name 13 "v" + Name 21 "Mat3(mf44;" + Name 20 "m" + Name 26 "mxv(mf44;vf3;" + Name 24 "m4" + Name 25 "v" + Name 65 "param" + Name 74 "gl_PerVertex" + MemberName 74(gl_PerVertex) 0 "gl_Position" + MemberName 74(gl_PerVertex) 1 "gl_PointSize" + MemberName 74(gl_PerVertex) 2 "gl_ClipDistance" + Name 76 "" + Name 77 "bl" + MemberName 77(bl) 0 "m4" + MemberName 77(bl) 1 "m3" + Name 79 "bName" + Name 81 "v3" + Name 82 "param" + Name 86 "param" + Name 89 "param" + Name 93 "param" + MemberDecorate 74(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 74(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 74(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 74(gl_PerVertex) Block + MemberDecorate 77(bl) 0 ColMajor + MemberDecorate 77(bl) 0 Offset 0 + MemberDecorate 77(bl) 0 MatrixStride 16 + MemberDecorate 77(bl) 1 ColMajor + MemberDecorate 77(bl) 1 Offset 64 + MemberDecorate 77(bl) 1 MatrixStride 16 + Decorate 77(bl) Block + Decorate 79(bName) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8: TypeMatrix 7(fvec3) 3 + 9: TypePointer Function 8 + 10: TypePointer Function 7(fvec3) + 11: TypeFunction 7(fvec3) 9(ptr) 10(ptr) + 16: TypeVector 6(float) 4 + 17: TypeMatrix 16(fvec4) 4 + 18: TypePointer Function 17 + 19: TypeFunction 8 18(ptr) + 23: TypeFunction 7(fvec3) 18(ptr) 10(ptr) + 33: TypeInt 32 1 + 34: 33(int) Constant 0 + 35: TypePointer Function 16(fvec4) + 39: 33(int) Constant 1 + 43: 33(int) Constant 2 + 47: 6(float) Constant 1065353216 + 48: 6(float) Constant 0 + 71: TypeInt 32 0 + 72: 71(int) Constant 1 + 73: TypeArray 6(float) 72 +74(gl_PerVertex): TypeStruct 16(fvec4) 6(float) 73 + 75: TypePointer Output 74(gl_PerVertex) + 76: 75(ptr) Variable Output + 77(bl): TypeStruct 17 8 + 78: TypePointer Uniform 77(bl) + 79(bName): 78(ptr) Variable Uniform + 80: TypePointer Input 7(fvec3) + 81(v3): 80(ptr) Variable Input + 83: TypePointer Uniform 17 + 90: TypePointer Uniform 8 + 101: TypePointer Output 16(fvec4) + 4(main): 2 Function None 3 + 5: Label + 82(param): 18(ptr) Variable Function + 86(param): 10(ptr) Variable Function + 89(param): 9(ptr) Variable Function + 93(param): 10(ptr) Variable Function + 84: 83(ptr) AccessChain 79(bName) 34 + 85: 17 Load 84 + Store 82(param) 85 + 87: 7(fvec3) Load 81(v3) + Store 86(param) 87 + 88: 7(fvec3) FunctionCall 26(mxv(mf44;vf3;) 82(param) 86(param) + 91: 90(ptr) AccessChain 79(bName) 39 + 92: 8 Load 91 + Store 89(param) 92 + 94: 7(fvec3) Load 81(v3) + Store 93(param) 94 + 95: 7(fvec3) FunctionCall 14(xf(mf33;vf3;) 89(param) 93(param) + 96: 7(fvec3) FAdd 88 95 + 97: 6(float) CompositeExtract 96 0 + 98: 6(float) CompositeExtract 96 1 + 99: 6(float) CompositeExtract 96 2 + 100: 16(fvec4) CompositeConstruct 97 98 99 47 + 102: 101(ptr) AccessChain 76 34 + Store 102 100 + Return + FunctionEnd +14(xf(mf33;vf3;): 7(fvec3) Function None 11 + 12(m): 9(ptr) FunctionParameter + 13(v): 10(ptr) FunctionParameter + 15: Label + 28: 7(fvec3) Load 13(v) + 29: 8 Load 12(m) + 30: 7(fvec3) VectorTimesMatrix 28 29 + ReturnValue 30 + FunctionEnd + 21(Mat3(mf44;): 8 Function None 19 + 20(m): 18(ptr) FunctionParameter + 22: Label + 36: 35(ptr) AccessChain 20(m) 34 + 37: 16(fvec4) Load 36 + 38: 7(fvec3) VectorShuffle 37 37 0 1 2 + 40: 35(ptr) AccessChain 20(m) 39 + 41: 16(fvec4) Load 40 + 42: 7(fvec3) VectorShuffle 41 41 0 1 2 + 44: 35(ptr) AccessChain 20(m) 43 + 45: 16(fvec4) Load 44 + 46: 7(fvec3) VectorShuffle 45 45 0 1 2 + 49: 6(float) CompositeExtract 38 0 + 50: 6(float) CompositeExtract 38 1 + 51: 6(float) CompositeExtract 38 2 + 52: 6(float) CompositeExtract 42 0 + 53: 6(float) CompositeExtract 42 1 + 54: 6(float) CompositeExtract 42 2 + 55: 6(float) CompositeExtract 46 0 + 56: 6(float) CompositeExtract 46 1 + 57: 6(float) CompositeExtract 46 2 + 58: 7(fvec3) CompositeConstruct 49 50 51 + 59: 7(fvec3) CompositeConstruct 52 53 54 + 60: 7(fvec3) CompositeConstruct 55 56 57 + 61: 8 CompositeConstruct 58 59 60 + ReturnValue 61 + FunctionEnd +26(mxv(mf44;vf3;): 7(fvec3) Function None 23 + 24(m4): 18(ptr) FunctionParameter + 25(v): 10(ptr) FunctionParameter + 27: Label + 65(param): 18(ptr) Variable Function + 64: 7(fvec3) Load 25(v) + 66: 17 Load 24(m4) + Store 65(param) 66 + 67: 8 FunctionCall 21(Mat3(mf44;) 65(param) + 68: 7(fvec3) VectorTimesMatrix 64 67 + ReturnValue 68 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.matrix.frag.out b/deps/glslang/Test/baseResults/spv.matrix.frag.out new file mode 100644 index 00000000..c2b4a1f6 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.matrix.frag.out @@ -0,0 +1,334 @@ +spv.matrix.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 286 + + Capability Shader + Capability Float64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 12 14 28 161 169 187 + ExecutionMode 4 OriginUpperLeft + Source GLSL 420 + Name 4 "main" + Name 10 "sum34" + Name 12 "m1" + Name 14 "m2" + Name 28 "f" + Name 140 "dm" + Name 159 "sum3" + Name 161 "v4" + Name 166 "sum4" + Name 169 "v3" + Name 174 "m43" + Name 179 "m4" + Name 187 "color" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeMatrix 7(fvec4) 3 + 9: TypePointer Function 8 + 11: TypePointer Input 8 + 12(m1): 11(ptr) Variable Input + 14(m2): 11(ptr) Variable Input + 27: TypePointer Input 6(float) + 28(f): 27(ptr) Variable Input + 81: 6(float) Constant 1065353216 + 136: TypeFloat 64 + 137: TypeVector 136(float64_t) 4 + 138: TypeMatrix 137(f64vec4) 3 + 139: TypePointer Function 138 + 157: TypeVector 6(float) 3 + 158: TypePointer Function 157(fvec3) + 160: TypePointer Input 7(fvec4) + 161(v4): 160(ptr) Variable Input + 165: TypePointer Function 7(fvec4) + 168: TypePointer Input 157(fvec3) + 169(v3): 168(ptr) Variable Input + 172: TypeMatrix 157(fvec3) 4 + 173: TypePointer Function 172 + 177: TypeMatrix 7(fvec4) 4 + 178: TypePointer Function 177 + 186: TypePointer Output 7(fvec4) + 187(color): 186(ptr) Variable Output + 208: 6(float) Constant 0 + 270: TypeVector 6(float) 2 + 271: TypeMatrix 270(fvec2) 2 + 279: 6(float) Constant 1088841318 + 4(main): 2 Function None 3 + 5: Label + 10(sum34): 9(ptr) Variable Function + 140(dm): 139(ptr) Variable Function + 159(sum3): 158(ptr) Variable Function + 166(sum4): 165(ptr) Variable Function + 174(m43): 173(ptr) Variable Function + 179(m4): 178(ptr) Variable Function + 13: 8 Load 12(m1) + 15: 8 Load 14(m2) + 16: 7(fvec4) CompositeExtract 13 0 + 17: 7(fvec4) CompositeExtract 15 0 + 18: 7(fvec4) FSub 16 17 + 19: 7(fvec4) CompositeExtract 13 1 + 20: 7(fvec4) CompositeExtract 15 1 + 21: 7(fvec4) FSub 19 20 + 22: 7(fvec4) CompositeExtract 13 2 + 23: 7(fvec4) CompositeExtract 15 2 + 24: 7(fvec4) FSub 22 23 + 25: 8 CompositeConstruct 18 21 24 + Store 10(sum34) 25 + 26: 8 Load 12(m1) + 29: 6(float) Load 28(f) + 30: 8 MatrixTimesScalar 26 29 + 31: 8 Load 10(sum34) + 32: 7(fvec4) CompositeExtract 31 0 + 33: 7(fvec4) CompositeExtract 30 0 + 34: 7(fvec4) FAdd 32 33 + 35: 7(fvec4) CompositeExtract 31 1 + 36: 7(fvec4) CompositeExtract 30 1 + 37: 7(fvec4) FAdd 35 36 + 38: 7(fvec4) CompositeExtract 31 2 + 39: 7(fvec4) CompositeExtract 30 2 + 40: 7(fvec4) FAdd 38 39 + 41: 8 CompositeConstruct 34 37 40 + Store 10(sum34) 41 + 42: 6(float) Load 28(f) + 43: 8 Load 12(m1) + 44: 8 MatrixTimesScalar 43 42 + 45: 8 Load 10(sum34) + 46: 7(fvec4) CompositeExtract 45 0 + 47: 7(fvec4) CompositeExtract 44 0 + 48: 7(fvec4) FAdd 46 47 + 49: 7(fvec4) CompositeExtract 45 1 + 50: 7(fvec4) CompositeExtract 44 1 + 51: 7(fvec4) FAdd 49 50 + 52: 7(fvec4) CompositeExtract 45 2 + 53: 7(fvec4) CompositeExtract 44 2 + 54: 7(fvec4) FAdd 52 53 + 55: 8 CompositeConstruct 48 51 54 + Store 10(sum34) 55 + 56: 8 Load 12(m1) + 57: 8 Load 14(m2) + 58: 7(fvec4) CompositeExtract 56 0 + 59: 7(fvec4) CompositeExtract 57 0 + 60: 7(fvec4) FMul 58 59 + 61: 7(fvec4) CompositeExtract 56 1 + 62: 7(fvec4) CompositeExtract 57 1 + 63: 7(fvec4) FMul 61 62 + 64: 7(fvec4) CompositeExtract 56 2 + 65: 7(fvec4) CompositeExtract 57 2 + 66: 7(fvec4) FMul 64 65 + 67: 8 CompositeConstruct 60 63 66 + 68: 8 Load 10(sum34) + 69: 7(fvec4) CompositeExtract 68 0 + 70: 7(fvec4) CompositeExtract 67 0 + 71: 7(fvec4) FDiv 69 70 + 72: 7(fvec4) CompositeExtract 68 1 + 73: 7(fvec4) CompositeExtract 67 1 + 74: 7(fvec4) FDiv 72 73 + 75: 7(fvec4) CompositeExtract 68 2 + 76: 7(fvec4) CompositeExtract 67 2 + 77: 7(fvec4) FDiv 75 76 + 78: 8 CompositeConstruct 71 74 77 + Store 10(sum34) 78 + 79: 8 Load 12(m1) + 80: 6(float) Load 28(f) + 82: 6(float) FDiv 81 80 + 83: 8 MatrixTimesScalar 79 82 + 84: 8 Load 10(sum34) + 85: 7(fvec4) CompositeExtract 84 0 + 86: 7(fvec4) CompositeExtract 83 0 + 87: 7(fvec4) FAdd 85 86 + 88: 7(fvec4) CompositeExtract 84 1 + 89: 7(fvec4) CompositeExtract 83 1 + 90: 7(fvec4) FAdd 88 89 + 91: 7(fvec4) CompositeExtract 84 2 + 92: 7(fvec4) CompositeExtract 83 2 + 93: 7(fvec4) FAdd 91 92 + 94: 8 CompositeConstruct 87 90 93 + Store 10(sum34) 94 + 95: 6(float) Load 28(f) + 96: 8 Load 12(m1) + 97: 7(fvec4) CompositeConstruct 95 95 95 95 + 98: 7(fvec4) CompositeExtract 96 0 + 99: 7(fvec4) FDiv 97 98 + 100: 7(fvec4) CompositeExtract 96 1 + 101: 7(fvec4) FDiv 97 100 + 102: 7(fvec4) CompositeExtract 96 2 + 103: 7(fvec4) FDiv 97 102 + 104: 8 CompositeConstruct 99 101 103 + 105: 8 Load 10(sum34) + 106: 7(fvec4) CompositeExtract 105 0 + 107: 7(fvec4) CompositeExtract 104 0 + 108: 7(fvec4) FAdd 106 107 + 109: 7(fvec4) CompositeExtract 105 1 + 110: 7(fvec4) CompositeExtract 104 1 + 111: 7(fvec4) FAdd 109 110 + 112: 7(fvec4) CompositeExtract 105 2 + 113: 7(fvec4) CompositeExtract 104 2 + 114: 7(fvec4) FAdd 112 113 + 115: 8 CompositeConstruct 108 111 114 + Store 10(sum34) 115 + 116: 6(float) Load 28(f) + 117: 8 Load 10(sum34) + 118: 7(fvec4) CompositeConstruct 116 116 116 116 + 119: 7(fvec4) CompositeExtract 117 0 + 120: 7(fvec4) FAdd 119 118 + 121: 7(fvec4) CompositeExtract 117 1 + 122: 7(fvec4) FAdd 121 118 + 123: 7(fvec4) CompositeExtract 117 2 + 124: 7(fvec4) FAdd 123 118 + 125: 8 CompositeConstruct 120 122 124 + Store 10(sum34) 125 + 126: 6(float) Load 28(f) + 127: 8 Load 10(sum34) + 128: 7(fvec4) CompositeConstruct 126 126 126 126 + 129: 7(fvec4) CompositeExtract 127 0 + 130: 7(fvec4) FSub 129 128 + 131: 7(fvec4) CompositeExtract 127 1 + 132: 7(fvec4) FSub 131 128 + 133: 7(fvec4) CompositeExtract 127 2 + 134: 7(fvec4) FSub 133 128 + 135: 8 CompositeConstruct 130 132 134 + Store 10(sum34) 135 + 141: 8 Load 10(sum34) + 142: 7(fvec4) CompositeExtract 141 0 + 143:137(f64vec4) FConvert 142 + 144: 7(fvec4) CompositeExtract 141 1 + 145:137(f64vec4) FConvert 144 + 146: 7(fvec4) CompositeExtract 141 2 + 147:137(f64vec4) FConvert 146 + 148: 138 CompositeConstruct 143 145 147 + Store 140(dm) 148 + 149: 138 Load 140(dm) + 150:137(f64vec4) CompositeExtract 149 0 + 151: 7(fvec4) FConvert 150 + 152:137(f64vec4) CompositeExtract 149 1 + 153: 7(fvec4) FConvert 152 + 154:137(f64vec4) CompositeExtract 149 2 + 155: 7(fvec4) FConvert 154 + 156: 8 CompositeConstruct 151 153 155 + Store 10(sum34) 156 + 162: 7(fvec4) Load 161(v4) + 163: 8 Load 14(m2) + 164: 157(fvec3) VectorTimesMatrix 162 163 + Store 159(sum3) 164 + 167: 8 Load 14(m2) + 170: 157(fvec3) Load 169(v3) + 171: 7(fvec4) MatrixTimesVector 167 170 + Store 166(sum4) 171 + 175: 8 Load 10(sum34) + 176: 172 Transpose 175 + Store 174(m43) 176 + 180: 8 Load 12(m1) + 181: 172 Load 174(m43) + 182: 177 MatrixTimesMatrix 180 181 + Store 179(m4) 182 + 183: 7(fvec4) Load 161(v4) + 184: 177 Load 179(m4) + 185: 7(fvec4) VectorTimesMatrix 183 184 + Store 166(sum4) 185 + 188: 7(fvec4) Load 166(sum4) + Store 187(color) 188 + 189: 8 Load 10(sum34) + 190: 7(fvec4) CompositeConstruct 81 81 81 81 + 191: 7(fvec4) CompositeExtract 189 0 + 192: 7(fvec4) FAdd 191 190 + 193: 7(fvec4) CompositeExtract 189 1 + 194: 7(fvec4) FAdd 193 190 + 195: 7(fvec4) CompositeExtract 189 2 + 196: 7(fvec4) FAdd 195 190 + 197: 8 CompositeConstruct 192 194 196 + Store 10(sum34) 197 + 198: 8 Load 10(sum34) + 199: 7(fvec4) CompositeConstruct 81 81 81 81 + 200: 7(fvec4) CompositeExtract 198 0 + 201: 7(fvec4) FSub 200 199 + 202: 7(fvec4) CompositeExtract 198 1 + 203: 7(fvec4) FSub 202 199 + 204: 7(fvec4) CompositeExtract 198 2 + 205: 7(fvec4) FSub 204 199 + 206: 8 CompositeConstruct 201 203 205 + Store 10(sum34) 206 + 207: 6(float) Load 28(f) + 209: 7(fvec4) CompositeConstruct 207 208 208 208 + 210: 7(fvec4) CompositeConstruct 208 207 208 208 + 211: 7(fvec4) CompositeConstruct 208 208 207 208 + 212: 8 CompositeConstruct 209 210 211 + 213: 8 Load 10(sum34) + 214: 7(fvec4) CompositeExtract 213 0 + 215: 7(fvec4) CompositeExtract 212 0 + 216: 7(fvec4) FAdd 214 215 + 217: 7(fvec4) CompositeExtract 213 1 + 218: 7(fvec4) CompositeExtract 212 1 + 219: 7(fvec4) FAdd 217 218 + 220: 7(fvec4) CompositeExtract 213 2 + 221: 7(fvec4) CompositeExtract 212 2 + 222: 7(fvec4) FAdd 220 221 + 223: 8 CompositeConstruct 216 219 222 + Store 10(sum34) 223 + 224: 157(fvec3) Load 169(v3) + 225: 6(float) Load 28(f) + 226: 157(fvec3) Load 169(v3) + 227: 6(float) Load 28(f) + 228: 157(fvec3) Load 169(v3) + 229: 6(float) Load 28(f) + 230: 6(float) CompositeExtract 224 0 + 231: 6(float) CompositeExtract 224 1 + 232: 6(float) CompositeExtract 224 2 + 233: 6(float) CompositeExtract 226 0 + 234: 6(float) CompositeExtract 226 1 + 235: 6(float) CompositeExtract 226 2 + 236: 6(float) CompositeExtract 228 0 + 237: 6(float) CompositeExtract 228 1 + 238: 6(float) CompositeExtract 228 2 + 239: 7(fvec4) CompositeConstruct 230 231 232 225 + 240: 7(fvec4) CompositeConstruct 233 234 235 227 + 241: 7(fvec4) CompositeConstruct 236 237 238 229 + 242: 8 CompositeConstruct 239 240 241 + 243: 8 Load 10(sum34) + 244: 7(fvec4) CompositeExtract 243 0 + 245: 7(fvec4) CompositeExtract 242 0 + 246: 7(fvec4) FAdd 244 245 + 247: 7(fvec4) CompositeExtract 243 1 + 248: 7(fvec4) CompositeExtract 242 1 + 249: 7(fvec4) FAdd 247 248 + 250: 7(fvec4) CompositeExtract 243 2 + 251: 7(fvec4) CompositeExtract 242 2 + 252: 7(fvec4) FAdd 250 251 + 253: 8 CompositeConstruct 246 249 252 + Store 10(sum34) 253 + 254: 157(fvec3) Load 159(sum3) + 255: 172 Load 174(m43) + 256: 7(fvec4) VectorTimesMatrix 254 255 + 257: 7(fvec4) Load 166(sum4) + 258: 7(fvec4) FAdd 256 257 + 259: 7(fvec4) Load 187(color) + 260: 7(fvec4) FAdd 259 258 + Store 187(color) 260 + 261: 172 Load 174(m43) + 262: 6(float) CompositeExtract 261 0 0 + 263: 6(float) CompositeExtract 261 0 1 + 264: 6(float) CompositeExtract 261 0 2 + 265: 6(float) CompositeExtract 261 1 0 + 266: 7(fvec4) CompositeConstruct 262 263 264 265 + 267: 7(fvec4) Load 187(color) + 268: 7(fvec4) FAdd 267 266 + Store 187(color) 268 + 269: 6(float) Load 28(f) + 272: 270(fvec2) CompositeConstruct 269 208 + 273: 270(fvec2) CompositeConstruct 208 269 + 274: 271 CompositeConstruct 272 273 + 275: 6(float) CompositeExtract 274 0 0 + 276: 6(float) CompositeExtract 274 0 1 + 277: 6(float) CompositeExtract 274 1 0 + 278: 157(fvec3) CompositeConstruct 275 276 277 + 280: 6(float) CompositeExtract 278 0 + 281: 6(float) CompositeExtract 278 1 + 282: 6(float) CompositeExtract 278 2 + 283: 7(fvec4) CompositeConstruct 280 281 282 279 + 284: 7(fvec4) Load 187(color) + 285: 7(fvec4) FAdd 284 283 + Store 187(color) 285 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.matrix2.frag.out b/deps/glslang/Test/baseResults/spv.matrix2.frag.out new file mode 100644 index 00000000..dc574a40 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.matrix2.frag.out @@ -0,0 +1,269 @@ +spv.matrix2.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 221 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 12 16 37 38 65 87 147 158 181 218 219 220 + ExecutionMode 4 OriginUpperLeft + Source GLSL 150 + Name 4 "main" + Name 10 "m34" + Name 12 "v" + Name 16 "u" + Name 37 "FragColor" + Name 38 "Color" + Name 63 "m44" + Name 65 "un34" + Name 87 "um43" + Name 147 "um4" + Name 156 "inv" + Name 158 "um2" + Name 179 "inv3" + Name 181 "um3" + Name 190 "inv4" + Name 218 "colorTransform" + Name 219 "m" + Name 220 "n" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeMatrix 7(fvec4) 3 + 9: TypePointer Function 8 + 11: TypePointer Input 7(fvec4) + 12(v): 11(ptr) Variable Input + 14: TypeVector 6(float) 3 + 15: TypePointer Input 14(fvec3) + 16(u): 15(ptr) Variable Input + 19: 6(float) Constant 1082759578 + 20: 6(float) Constant 0 + 21: 7(fvec4) ConstantComposite 19 20 20 20 + 22: 7(fvec4) ConstantComposite 20 19 20 20 + 23: 7(fvec4) ConstantComposite 20 20 19 20 + 24: 8 ConstantComposite 21 22 23 + 36: TypePointer Output 7(fvec4) + 37(FragColor): 36(ptr) Variable Output + 38(Color): 15(ptr) Variable Input + 40: 6(float) Constant 1065353216 + 54: TypeInt 32 0 + 55: 54(int) Constant 0 + 56: TypePointer Input 6(float) + 61: TypeMatrix 7(fvec4) 4 + 62: TypePointer Function 61 + 64: TypePointer Input 8 + 65(un34): 64(ptr) Variable Input + 85: TypeMatrix 14(fvec3) 4 + 86: TypePointer Input 85 + 87(um43): 86(ptr) Variable Input + 146: TypePointer Input 61 + 147(um4): 146(ptr) Variable Input + 153: TypeVector 6(float) 2 + 154: TypeMatrix 153(fvec2) 2 + 155: TypePointer Function 154 + 157: TypePointer Input 154 + 158(um2): 157(ptr) Variable Input + 161: TypeInt 32 1 + 162: 161(int) Constant 0 + 163: TypePointer Function 6(float) + 166: 161(int) Constant 1 + 169: 54(int) Constant 1 + 177: TypeMatrix 14(fvec3) 3 + 178: TypePointer Function 177 + 180: TypePointer Input 177 + 181(um3): 180(ptr) Variable Input + 184: 161(int) Constant 2 + 210: 54(int) Constant 3 + 211: TypePointer Output 6(float) +218(colorTransform): 180(ptr) Variable Input + 219(m): 146(ptr) Variable Input + 220(n): 146(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 10(m34): 9(ptr) Variable Function + 63(m44): 62(ptr) Variable Function + 156(inv): 155(ptr) Variable Function + 179(inv3): 178(ptr) Variable Function + 190(inv4): 62(ptr) Variable Function + 13: 7(fvec4) Load 12(v) + 17: 14(fvec3) Load 16(u) + 18: 8 OuterProduct 13 17 + Store 10(m34) 18 + 25: 8 Load 10(m34) + 26: 7(fvec4) CompositeExtract 25 0 + 27: 7(fvec4) CompositeExtract 24 0 + 28: 7(fvec4) FAdd 26 27 + 29: 7(fvec4) CompositeExtract 25 1 + 30: 7(fvec4) CompositeExtract 24 1 + 31: 7(fvec4) FAdd 29 30 + 32: 7(fvec4) CompositeExtract 25 2 + 33: 7(fvec4) CompositeExtract 24 2 + 34: 7(fvec4) FAdd 32 33 + 35: 8 CompositeConstruct 28 31 34 + Store 10(m34) 35 + 39: 14(fvec3) Load 38(Color) + 41: 6(float) CompositeExtract 39 0 + 42: 6(float) CompositeExtract 39 1 + 43: 6(float) CompositeExtract 39 2 + 44: 7(fvec4) CompositeConstruct 41 42 43 40 + Store 37(FragColor) 44 + 45: 7(fvec4) Load 37(FragColor) + 46: 8 Load 10(m34) + 47: 14(fvec3) VectorTimesMatrix 45 46 + 48: 6(float) CompositeExtract 47 0 + 49: 6(float) CompositeExtract 47 1 + 50: 6(float) CompositeExtract 47 2 + 51: 7(fvec4) CompositeConstruct 48 49 50 40 + 52: 7(fvec4) Load 37(FragColor) + 53: 7(fvec4) FMul 52 51 + Store 37(FragColor) 53 + 57: 56(ptr) AccessChain 12(v) 55 + 58: 6(float) Load 57 + 59: 8 Load 10(m34) + 60: 8 MatrixTimesScalar 59 58 + Store 10(m34) 60 + 66: 8 Load 65(un34) + 67: 6(float) CompositeExtract 66 0 0 + 68: 6(float) CompositeExtract 66 0 1 + 69: 6(float) CompositeExtract 66 0 2 + 70: 6(float) CompositeExtract 66 0 3 + 71: 6(float) CompositeExtract 66 1 0 + 72: 6(float) CompositeExtract 66 1 1 + 73: 6(float) CompositeExtract 66 1 2 + 74: 6(float) CompositeExtract 66 1 3 + 75: 6(float) CompositeExtract 66 2 0 + 76: 6(float) CompositeExtract 66 2 1 + 77: 6(float) CompositeExtract 66 2 2 + 78: 6(float) CompositeExtract 66 2 3 + 79: 7(fvec4) CompositeConstruct 67 68 69 70 + 80: 7(fvec4) CompositeConstruct 71 72 73 74 + 81: 7(fvec4) CompositeConstruct 75 76 77 78 + 82: 7(fvec4) CompositeConstruct 20 20 20 40 + 83: 61 CompositeConstruct 79 80 81 82 + Store 63(m44) 83 + 84: 8 Load 10(m34) + 88: 85 Load 87(um43) + 89: 61 MatrixTimesMatrix 84 88 + 90: 61 Load 63(m44) + 91: 7(fvec4) CompositeExtract 90 0 + 92: 7(fvec4) CompositeExtract 89 0 + 93: 7(fvec4) FAdd 91 92 + 94: 7(fvec4) CompositeExtract 90 1 + 95: 7(fvec4) CompositeExtract 89 1 + 96: 7(fvec4) FAdd 94 95 + 97: 7(fvec4) CompositeExtract 90 2 + 98: 7(fvec4) CompositeExtract 89 2 + 99: 7(fvec4) FAdd 97 98 + 100: 7(fvec4) CompositeExtract 90 3 + 101: 7(fvec4) CompositeExtract 89 3 + 102: 7(fvec4) FAdd 100 101 + 103: 61 CompositeConstruct 93 96 99 102 + Store 63(m44) 103 + 104: 61 Load 63(m44) + 105: 7(fvec4) CompositeExtract 104 0 + 106: 7(fvec4) FNegate 105 + 107: 7(fvec4) CompositeExtract 104 1 + 108: 7(fvec4) FNegate 107 + 109: 7(fvec4) CompositeExtract 104 2 + 110: 7(fvec4) FNegate 109 + 111: 7(fvec4) CompositeExtract 104 3 + 112: 7(fvec4) FNegate 111 + 113: 61 CompositeConstruct 106 108 110 112 + 114: 7(fvec4) Load 12(v) + 115: 7(fvec4) MatrixTimesVector 113 114 + 116: 7(fvec4) Load 37(FragColor) + 117: 7(fvec4) FAdd 116 115 + Store 37(FragColor) 117 + 118: 61 Load 63(m44) + 119: 61 Load 63(m44) + 120: 7(fvec4) CompositeExtract 118 0 + 121: 7(fvec4) CompositeExtract 119 0 + 122: 7(fvec4) FMul 120 121 + 123: 7(fvec4) CompositeExtract 118 1 + 124: 7(fvec4) CompositeExtract 119 1 + 125: 7(fvec4) FMul 123 124 + 126: 7(fvec4) CompositeExtract 118 2 + 127: 7(fvec4) CompositeExtract 119 2 + 128: 7(fvec4) FMul 126 127 + 129: 7(fvec4) CompositeExtract 118 3 + 130: 7(fvec4) CompositeExtract 119 3 + 131: 7(fvec4) FMul 129 130 + 132: 61 CompositeConstruct 122 125 128 131 + 133: 7(fvec4) Load 37(FragColor) + 134: 7(fvec4) VectorTimesMatrix 133 132 + Store 37(FragColor) 134 + 135: 85 Load 87(um43) + 136: 8 Transpose 135 + Store 10(m34) 136 + 137: 7(fvec4) Load 37(FragColor) + 138: 8 Load 10(m34) + 139: 14(fvec3) VectorTimesMatrix 137 138 + 140: 6(float) CompositeExtract 139 0 + 141: 6(float) CompositeExtract 139 1 + 142: 6(float) CompositeExtract 139 2 + 143: 7(fvec4) CompositeConstruct 140 141 142 40 + 144: 7(fvec4) Load 37(FragColor) + 145: 7(fvec4) FMul 144 143 + Store 37(FragColor) 145 + 148: 61 Load 147(um4) + 149: 6(float) ExtInst 1(GLSL.std.450) 33(Determinant) 148 + 150: 7(fvec4) CompositeConstruct 149 149 149 149 + 151: 7(fvec4) Load 37(FragColor) + 152: 7(fvec4) FMul 151 150 + Store 37(FragColor) 152 + 159: 154 Load 158(um2) + 160: 154 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 159 + Store 156(inv) 160 + 164: 163(ptr) AccessChain 156(inv) 162 55 + 165: 6(float) Load 164 + 167: 163(ptr) AccessChain 156(inv) 166 55 + 168: 6(float) Load 167 + 170: 163(ptr) AccessChain 156(inv) 162 169 + 171: 6(float) Load 170 + 172: 163(ptr) AccessChain 156(inv) 166 169 + 173: 6(float) Load 172 + 174: 7(fvec4) CompositeConstruct 165 168 171 173 + 175: 7(fvec4) Load 37(FragColor) + 176: 7(fvec4) FMul 175 174 + Store 37(FragColor) 176 + 182: 177 Load 181(um3) + 183: 177 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 182 + Store 179(inv3) 183 + 185: 163(ptr) AccessChain 179(inv3) 184 169 + 186: 6(float) Load 185 + 187: 7(fvec4) CompositeConstruct 186 186 186 186 + 188: 7(fvec4) Load 37(FragColor) + 189: 7(fvec4) FMul 188 187 + Store 37(FragColor) 189 + 191: 61 Load 147(um4) + 192: 61 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 191 + Store 190(inv4) 192 + 193: 61 Load 190(inv4) + 194: 7(fvec4) Load 37(FragColor) + 195: 7(fvec4) VectorTimesMatrix 194 193 + Store 37(FragColor) 195 + 196: 7(fvec4) Load 37(FragColor) + 197: 8 Load 65(un34) + 198: 8 Load 65(un34) + 199: 7(fvec4) CompositeExtract 197 0 + 200: 7(fvec4) CompositeExtract 198 0 + 201: 7(fvec4) FMul 199 200 + 202: 7(fvec4) CompositeExtract 197 1 + 203: 7(fvec4) CompositeExtract 198 1 + 204: 7(fvec4) FMul 202 203 + 205: 7(fvec4) CompositeExtract 197 2 + 206: 7(fvec4) CompositeExtract 198 2 + 207: 7(fvec4) FMul 205 206 + 208: 8 CompositeConstruct 201 204 207 + 209: 14(fvec3) VectorTimesMatrix 196 208 + 212: 211(ptr) AccessChain 37(FragColor) 210 + 213: 6(float) Load 212 + 214: 6(float) CompositeExtract 209 0 + 215: 6(float) CompositeExtract 209 1 + 216: 6(float) CompositeExtract 209 2 + 217: 7(fvec4) CompositeConstruct 214 215 216 213 + Store 37(FragColor) 217 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.memoryQualifier.frag.out b/deps/glslang/Test/baseResults/spv.memoryQualifier.frag.out new file mode 100644 index 00000000..4113cc95 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.memoryQualifier.frag.out @@ -0,0 +1,179 @@ +spv.memoryQualifier.frag +error: SPIRV-Tools Validation Errors +error: Capability ImageRect is not allowed by Vulkan 1.0 specification (or requires extension) + OpCapability ImageRect + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 97 + + Capability Shader + Capability ImageRect + Capability Image1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "texel" + Name 12 "i1D" + Name 19 "i2D" + Name 28 "i2DRect" + Name 35 "i3D" + Name 44 "iCube" + Name 49 "Data" + MemberName 49(Data) 0 "f1" + MemberName 49(Data) 1 "f2" + Name 50 "Buffer" + MemberName 50(Buffer) 0 "f1" + MemberName 50(Buffer) 1 "f2" + MemberName 50(Buffer) 2 "f3" + MemberName 50(Buffer) 3 "f4" + MemberName 50(Buffer) 4 "i1" + MemberName 50(Buffer) 5 "data" + Name 52 "" + Decorate 12(i1D) DescriptorSet 0 + Decorate 12(i1D) Binding 0 + Decorate 12(i1D) Coherent + Decorate 19(i2D) DescriptorSet 0 + Decorate 19(i2D) Binding 1 + Decorate 19(i2D) Volatile + Decorate 19(i2D) Coherent + Decorate 28(i2DRect) DescriptorSet 0 + Decorate 28(i2DRect) Binding 2 + Decorate 28(i2DRect) Restrict + Decorate 35(i3D) DescriptorSet 0 + Decorate 35(i3D) Binding 3 + Decorate 35(i3D) NonWritable + Decorate 44(iCube) DescriptorSet 0 + Decorate 44(iCube) Binding 3 + Decorate 44(iCube) NonReadable + MemberDecorate 49(Data) 0 Offset 0 + MemberDecorate 49(Data) 1 Offset 8 + MemberDecorate 50(Buffer) 0 Coherent + MemberDecorate 50(Buffer) 0 Volatile + MemberDecorate 50(Buffer) 0 Coherent + MemberDecorate 50(Buffer) 0 Offset 0 + MemberDecorate 50(Buffer) 1 Coherent + MemberDecorate 50(Buffer) 1 Restrict + MemberDecorate 50(Buffer) 1 Offset 8 + MemberDecorate 50(Buffer) 2 Coherent + MemberDecorate 50(Buffer) 2 NonWritable + MemberDecorate 50(Buffer) 2 Offset 16 + MemberDecorate 50(Buffer) 3 Coherent + MemberDecorate 50(Buffer) 3 NonReadable + MemberDecorate 50(Buffer) 3 Offset 32 + MemberDecorate 50(Buffer) 4 Coherent + MemberDecorate 50(Buffer) 4 Offset 48 + MemberDecorate 50(Buffer) 5 Coherent + MemberDecorate 50(Buffer) 5 Offset 56 + Decorate 50(Buffer) BufferBlock + Decorate 52 DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypeImage 6(float) 1D nonsampled format:R32f + 11: TypePointer UniformConstant 10 + 12(i1D): 11(ptr) Variable UniformConstant + 14: TypeInt 32 1 + 15: 14(int) Constant 1 + 17: TypeImage 6(float) 2D nonsampled format:R32f + 18: TypePointer UniformConstant 17 + 19(i2D): 18(ptr) Variable UniformConstant + 21: TypeVector 14(int) 2 + 22: 21(ivec2) ConstantComposite 15 15 + 26: TypeImage 6(float) Rect nonsampled format:R32f + 27: TypePointer UniformConstant 26 + 28(i2DRect): 27(ptr) Variable UniformConstant + 33: TypeImage 6(float) 3D nonsampled format:R32f + 34: TypePointer UniformConstant 33 + 35(i3D): 34(ptr) Variable UniformConstant + 37: TypeVector 14(int) 3 + 38: 37(ivec3) ConstantComposite 15 15 15 + 42: TypeImage 6(float) Cube nonsampled format:R32f + 43: TypePointer UniformConstant 42 + 44(iCube): 43(ptr) Variable UniformConstant + 47: TypeVector 6(float) 2 + 48: TypeVector 6(float) 3 + 49(Data): TypeStruct 6(float) 47(fvec2) + 50(Buffer): TypeStruct 6(float) 47(fvec2) 48(fvec3) 7(fvec4) 14(int) 49(Data) + 51: TypePointer Uniform 50(Buffer) + 52: 51(ptr) Variable Uniform + 53: 14(int) Constant 4 + 54: TypePointer Uniform 14(int) + 57: 14(int) Constant 0 + 58: TypePointer Uniform 6(float) + 61: TypePointer Function 6(float) + 63: TypePointer Uniform 47(fvec2) + 71: 14(int) Constant 2 + 72: TypePointer Uniform 48(fvec3) + 80: 14(int) Constant 5 + 83: TypeInt 32 0 + 84: 83(int) Constant 1 + 88: 83(int) Constant 3 + 93: 14(int) Constant 3 + 95: TypePointer Uniform 7(fvec4) + 4(main): 2 Function None 3 + 5: Label + 9(texel): 8(ptr) Variable Function + 13: 10 Load 12(i1D) + 16: 7(fvec4) ImageRead 13 15 + Store 9(texel) 16 + 20: 17 Load 19(i2D) + 23: 7(fvec4) ImageRead 20 22 + 24: 7(fvec4) Load 9(texel) + 25: 7(fvec4) FAdd 24 23 + Store 9(texel) 25 + 29: 26 Load 28(i2DRect) + 30: 7(fvec4) ImageRead 29 22 + 31: 7(fvec4) Load 9(texel) + 32: 7(fvec4) FAdd 31 30 + Store 9(texel) 32 + 36: 33 Load 35(i3D) + 39: 7(fvec4) ImageRead 36 38 + 40: 7(fvec4) Load 9(texel) + 41: 7(fvec4) FAdd 40 39 + Store 9(texel) 41 + 45: 42 Load 44(iCube) + 46: 7(fvec4) Load 9(texel) + ImageWrite 45 38 46 + 55: 54(ptr) AccessChain 52 53 + 56: 14(int) Load 55 + 59: 58(ptr) AccessChain 52 57 + 60: 6(float) Load 59 + 62: 61(ptr) AccessChain 9(texel) 56 + Store 62 60 + 64: 63(ptr) AccessChain 52 15 + 65: 47(fvec2) Load 64 + 66: 7(fvec4) Load 9(texel) + 67: 47(fvec2) VectorShuffle 66 66 0 1 + 68: 47(fvec2) FAdd 67 65 + 69: 7(fvec4) Load 9(texel) + 70: 7(fvec4) VectorShuffle 69 68 4 5 2 3 + Store 9(texel) 70 + 73: 72(ptr) AccessChain 52 71 + 74: 48(fvec3) Load 73 + 75: 7(fvec4) Load 9(texel) + 76: 48(fvec3) VectorShuffle 75 75 0 1 2 + 77: 48(fvec3) FSub 76 74 + 78: 7(fvec4) Load 9(texel) + 79: 7(fvec4) VectorShuffle 78 77 4 5 6 3 + Store 9(texel) 79 + 81: 58(ptr) AccessChain 52 80 57 + 82: 6(float) Load 81 + 85: 58(ptr) AccessChain 52 80 15 84 + 86: 6(float) Load 85 + 87: 6(float) FAdd 82 86 + 89: 61(ptr) AccessChain 9(texel) 88 + 90: 6(float) Load 89 + 91: 6(float) FAdd 90 87 + 92: 61(ptr) AccessChain 9(texel) 88 + Store 92 91 + 94: 7(fvec4) Load 9(texel) + 96: 95(ptr) AccessChain 52 93 + Store 96 94 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.memoryScopeSemantics.comp.out b/deps/glslang/Test/baseResults/spv.memoryScopeSemantics.comp.out new file mode 100644 index 00000000..46f9a078 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.memoryScopeSemantics.comp.out @@ -0,0 +1,239 @@ +spv.memoryScopeSemantics.comp +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 142 + + Capability Shader + Capability Int64 + Capability Int64Atomics + Capability CapabilityVulkanMemoryModelKHR + Capability CapabilityVulkanMemoryModelDeviceScopeKHR + Extension "SPV_KHR_vulkan_memory_model" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical VulkanKHR + EntryPoint GLCompute 4 "main" + ExecutionMode 4 LocalSize 1 1 1 + Source GLSL 450 + SourceExtension "GL_ARB_gpu_shader_int64" + SourceExtension "GL_KHR_memory_scope_semantics" + Name 4 "main" + Name 8 "origi" + Name 10 "atomi" + Name 21 "origu" + Name 23 "atomu" + Name 24 "value" + Name 36 "imagei" + Name 45 "imageu" + Name 65 "BufferU" + MemberName 65(BufferU) 0 "x" + Name 67 "bufferu" + Name 72 "y" + Name 77 "BufferI" + MemberName 77(BufferI) 0 "x" + Name 79 "bufferi" + Name 83 "A" + MemberName 83(A) 0 "x" + Name 84 "BufferJ" + MemberName 84(BufferJ) 0 "a" + Name 87 "bufferj" + Name 98 "BufferK" + MemberName 98(BufferK) 0 "x" + Name 100 "bufferk" + Name 109 "imagej" + Name 121 "samp" + Name 132 "atomu64" + Name 137 "atomi64" + Decorate 36(imagei) DescriptorSet 0 + Decorate 36(imagei) Binding 1 + Decorate 45(imageu) DescriptorSet 0 + Decorate 45(imageu) Binding 0 + MemberDecorate 65(BufferU) 0 Offset 0 + Decorate 65(BufferU) BufferBlock + Decorate 67(bufferu) DescriptorSet 0 + Decorate 67(bufferu) Binding 2 + MemberDecorate 77(BufferI) 0 Offset 0 + Decorate 77(BufferI) BufferBlock + Decorate 79(bufferi) DescriptorSet 0 + Decorate 79(bufferi) Binding 3 + Decorate 82 ArrayStride 4 + MemberDecorate 83(A) 0 Offset 0 + MemberDecorate 84(BufferJ) 0 Offset 0 + Decorate 84(BufferJ) BufferBlock + Decorate 87(bufferj) DescriptorSet 0 + Decorate 87(bufferj) Binding 4 + MemberDecorate 98(BufferK) 0 Offset 0 + Decorate 98(BufferK) Block + Decorate 100(bufferk) DescriptorSet 0 + Decorate 100(bufferk) Binding 7 + Decorate 109(imagej) DescriptorSet 0 + Decorate 109(imagej) Binding 5 + Decorate 121(samp) DescriptorSet 0 + Decorate 121(samp) Binding 6 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: TypePointer Workgroup 6(int) + 10(atomi): 9(ptr) Variable Workgroup + 11: 6(int) Constant 3 + 12: 6(int) Constant 1 + 13: 6(int) Constant 320 + 14: 6(int) Constant 4 + 15: TypeInt 32 0 + 16: 15(int) Constant 5 + 17: 15(int) Constant 0 + 18: 15(int) Constant 324 + 20: TypePointer Function 15(int) + 22: TypePointer Workgroup 15(int) + 23(atomu): 22(ptr) Variable Workgroup + 24(value): 22(ptr) Variable Workgroup + 26: 15(int) Constant 2 + 28: 6(int) Constant 64 + 29: 6(int) Constant 2 + 30: 15(int) Constant 66 + 33: 15(int) Constant 68 + 34: TypeImage 6(int) 2D nonsampled format:R32i + 35: TypePointer UniformConstant 34 + 36(imagei): 35(ptr) Variable UniformConstant + 37: TypeVector 6(int) 2 + 38: 6(int) Constant 0 + 39: 37(ivec2) ConstantComposite 38 38 + 40: TypePointer Image 6(int) + 43: TypeImage 15(int) 2D nonsampled format:R32ui + 44: TypePointer UniformConstant 43 + 45(imageu): 44(ptr) Variable UniformConstant + 46: 15(int) Constant 3 + 47: TypePointer Image 15(int) + 50: 15(int) Constant 4 + 52: 15(int) Constant 7 + 57: 6(int) Constant 7 + 61: 15(int) Constant 10 + 63: 15(int) Constant 322 + 65(BufferU): TypeStruct 15(int) + 66: TypePointer Uniform 65(BufferU) + 67(bufferu): 66(ptr) Variable Uniform + 68: TypePointer Uniform 15(int) + 70: 15(int) Constant 1 + 77(BufferI): TypeStruct 15(int) + 78: TypePointer Uniform 77(BufferI) + 79(bufferi): 78(ptr) Variable Uniform + 82: TypeArray 15(int) 26 + 83(A): TypeStruct 82 + 84(BufferJ): TypeStruct 83(A) + 85: TypeArray 84(BufferJ) 26 + 86: TypePointer Uniform 85 + 87(bufferj): 86(ptr) Variable Uniform + 94: TypePointer Uniform 83(A) + 98(BufferK): TypeStruct 15(int) + 99: TypePointer Uniform 98(BufferK) + 100(bufferk): 99(ptr) Variable Uniform + 105: TypeVector 6(int) 4 + 107: TypeArray 34 26 + 108: TypePointer UniformConstant 107 + 109(imagej): 108(ptr) Variable UniformConstant + 115: 105(ivec4) ConstantComposite 38 38 38 38 + 116: TypeFloat 32 + 117: TypeImage 116(float) 2D sampled format:Unknown + 118: TypeSampledImage 117 + 119: TypeArray 118 26 + 120: TypePointer UniformConstant 119 + 121(samp): 120(ptr) Variable UniformConstant + 122: TypePointer UniformConstant 118 + 125: TypeVector 116(float) 2 + 126: 116(float) Constant 0 + 127: 125(fvec2) ConstantComposite 126 126 + 128: TypeVector 116(float) 4 + 130: TypeInt 64 0 + 131: TypePointer Workgroup 130(int64_t) + 132(atomu64): 131(ptr) Variable Workgroup + 133:130(int64_t) Constant 7 0 + 135: TypeInt 64 1 + 136: TypePointer Workgroup 135(int64_t) + 137(atomi64): 136(ptr) Variable Workgroup + 138:135(int64_t) Constant 10 0 + 4(main): 2 Function None 3 + 5: Label + 8(origi): 7(ptr) Variable Function + 21(origu): 20(ptr) Variable Function + 72(y): 20(ptr) Variable Function + 19: 6(int) AtomicIAdd 10(atomi) 12 18 11 + Store 8(origi) 19 + 25: 15(int) Load 24(value) MakePointerVisibleKHR NonPrivatePointerKHR 26 + 27: 15(int) AtomicAnd 23(atomu) 16 17 25 + Store 21(origu) 27 + 31: 6(int) AtomicLoad 10(atomi) 12 30 + Store 8(origi) 31 + 32: 15(int) Load 24(value) MakePointerVisibleKHR NonPrivatePointerKHR 26 + AtomicStore 23(atomu) 12 33 32 + 41: 40(ptr) ImageTexelPointer 36(imagei) 39 17 + 42: 6(int) AtomicLoad 41 12 30 + Store 8(origi) 42 + 48: 47(ptr) ImageTexelPointer 45(imageu) 39 17 + 49: 15(int) AtomicIAdd 48 12 30 46 + Store 21(origu) 49 + 51: 47(ptr) ImageTexelPointer 45(imageu) 39 17 + AtomicStore 51 12 33 50 + 53: 15(int) AtomicOr 23(atomu) 12 17 52 + Store 21(origu) 53 + 54: 15(int) AtomicXor 23(atomu) 12 17 52 + Store 21(origu) 54 + 55: 15(int) Load 24(value) MakePointerVisibleKHR NonPrivatePointerKHR 26 + 56: 15(int) AtomicUMin 23(atomu) 12 17 55 + Store 21(origu) 56 + 58: 6(int) AtomicSMax 10(atomi) 12 17 57 + Store 8(origi) 58 + 59: 6(int) Load 8(origi) + 60: 6(int) AtomicExchange 10(atomi) 12 17 59 + Store 8(origi) 60 + 62: 15(int) Load 24(value) MakePointerVisibleKHR NonPrivatePointerKHR 26 + 64: 15(int) AtomicCompareExchange 23(atomu) 12 63 63 62 61 + Store 21(origu) 64 + 69: 68(ptr) AccessChain 67(bufferu) 38 + 71: 15(int) AtomicIAdd 69 12 18 70 + MemoryBarrier 26 18 + ControlBarrier 26 26 63 + ControlBarrier 26 26 17 + 73: 68(ptr) AccessChain 67(bufferu) 38 + 74: 15(int) Load 73 MakePointerVisibleKHR NonPrivatePointerKHR 26 + Store 72(y) 74 + 75: 15(int) Load 72(y) + 76: 68(ptr) AccessChain 67(bufferu) 38 + Store 76 75 MakePointerAvailableKHR NonPrivatePointerKHR 26 + 80: 68(ptr) AccessChain 79(bufferi) 38 + 81: 15(int) Load 80 MakePointerVisibleKHR NonPrivatePointerKHR 16 + Store 72(y) 81 + 88: 68(ptr) AccessChain 87(bufferj) 38 38 38 12 + 89: 15(int) Load 88 Volatile MakePointerVisibleKHR NonPrivatePointerKHR 46 + Store 72(y) 89 + 90: 15(int) Load 72(y) + 91: 68(ptr) AccessChain 79(bufferi) 38 + Store 91 90 MakePointerAvailableKHR NonPrivatePointerKHR 16 + 92: 15(int) Load 72(y) + 93: 68(ptr) AccessChain 87(bufferj) 38 38 38 12 + Store 93 92 Volatile MakePointerAvailableKHR NonPrivatePointerKHR 46 + 95: 94(ptr) AccessChain 87(bufferj) 12 38 + 96: 83(A) Load 95 Volatile MakePointerVisibleKHR NonPrivatePointerKHR 46 + 97: 94(ptr) AccessChain 87(bufferj) 38 38 + Store 97 96 Volatile MakePointerAvailableKHR NonPrivatePointerKHR 46 + 101: 68(ptr) AccessChain 100(bufferk) 38 + 102: 15(int) Load 101 NonPrivatePointerKHR + 103: 68(ptr) AccessChain 79(bufferi) 38 + Store 103 102 MakePointerAvailableKHR NonPrivatePointerKHR 16 + 104: 34 Load 36(imagei) + 106: 105(ivec4) ImageRead 104 39 MakeTexelVisibleKHR NonPrivateTexelKHR VolatileTexelKHR 16 + 110: 35(ptr) AccessChain 109(imagej) 38 + 111: 34 Load 110 + 112: 105(ivec4) ImageRead 111 39 NonPrivateTexelKHR + 113: 35(ptr) AccessChain 109(imagej) 12 + 114: 34 Load 113 + ImageWrite 114 39 115 NonPrivateTexelKHR + 123: 122(ptr) AccessChain 121(samp) 38 + 124: 118 Load 123 + 129: 128(fvec4) ImageSampleExplicitLod 124 127 Lod NonPrivateTexelKHR 126 + 134:130(int64_t) AtomicUMax 132(atomu64) 12 17 133 + Store 132(atomu64) 134 MakePointerAvailableKHR NonPrivatePointerKHR 26 + 139:130(int64_t) Load 132(atomu64) MakePointerVisibleKHR NonPrivatePointerKHR 26 + 140:135(int64_t) Bitcast 139 + 141:135(int64_t) AtomicCompareExchange 137(atomi64) 12 63 63 140 138 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.memoryScopeSemantics_Error.comp.out b/deps/glslang/Test/baseResults/spv.memoryScopeSemantics_Error.comp.out new file mode 100644 index 00000000..c4149d87 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.memoryScopeSemantics_Error.comp.out @@ -0,0 +1,17 @@ +spv.memoryScopeSemantics_Error.comp +ERROR: 0:15: 'atomicStore' : gl_SemanticsAcquire must not be used with (image) atomic store +ERROR: 0:16: 'imageAtomicLoad' : gl_SemanticsRelease must not be used with (image) atomic load +ERROR: 0:17: 'atomicStore' : gl_SemanticsAcquireRelease must not be used with (image) atomic load/store +ERROR: 0:18: 'atomicStore' : Invalid semantics value +ERROR: 0:19: 'imageAtomicLoad' : Invalid storage class semantics value +ERROR: 0:20: 'memoryBarrier' : Semantics must include exactly one of gl_SemanticsRelease, gl_SemanticsAcquire, or gl_SemanticsAcquireRelease +ERROR: 0:21: 'memoryBarrier' : Storage class semantics must not be zero +ERROR: 0:22: 'memoryBarrier' : Semantics must include exactly one of gl_SemanticsRelease, gl_SemanticsAcquire, or gl_SemanticsAcquireRelease +ERROR: 0:23: 'atomicAdd' : Semantics must not include multiple of gl_SemanticsRelease, gl_SemanticsAcquire, or gl_SemanticsAcquireRelease +ERROR: 0:24: 'atomicCompSwap' : semUnequal must not be gl_SemanticsRelease or gl_SemanticsAcquireRelease +ERROR: 0:25: 'memoryBarrier' : gl_SemanticsMakeVisible requires gl_SemanticsAcquire or gl_SemanticsAcquireRelease +ERROR: 0:26: 'memoryBarrier' : gl_SemanticsMakeAvailable requires gl_SemanticsRelease or gl_SemanticsAcquireRelease +ERROR: 12 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.merge-unreachable.frag.out b/deps/glslang/Test/baseResults/spv.merge-unreachable.frag.out new file mode 100644 index 00000000..7ec0f33d --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.merge-unreachable.frag.out @@ -0,0 +1,41 @@ +spv.merge-unreachable.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 25 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "v" + Decorate 9(v) Location 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Input 7(fvec4) + 9(v): 8(ptr) Variable Input + 11: 6(float) Constant 1036831949 + 12: 6(float) Constant 1045220557 + 13: 6(float) Constant 1050253722 + 14: 6(float) Constant 1053609165 + 15: 7(fvec4) ConstantComposite 11 12 13 14 + 16: TypeBool + 17: TypeVector 16(bool) 4 + 4(main): 2 Function None 3 + 5: Label + 10: 7(fvec4) Load 9(v) + 18: 17(bvec4) FOrdEqual 10 15 + 19: 16(bool) All 18 + SelectionMerge 21 None + BranchConditional 19 20 23 + 20: Label + Kill + 23: Label + Return + 21: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.meshShaderBuiltins.mesh.out b/deps/glslang/Test/baseResults/spv.meshShaderBuiltins.mesh.out new file mode 100644 index 00000000..8090f7bf --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.meshShaderBuiltins.mesh.out @@ -0,0 +1,258 @@ +spv.meshShaderBuiltins.mesh +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 146 + + Capability ClipDistance + Capability CullDistance + Capability MultiViewport + Capability DrawParameters + Capability ShaderViewportMaskNV + Capability MeshShadingNV + Extension "SPV_KHR_shader_draw_parameters" + Extension "SPV_NV_mesh_shader" + Extension "SPV_NV_viewport_array2" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint MeshNV 4 "main" 11 17 34 88 128 139 143 + ExecutionMode 4 LocalSize 32 1 1 + ExecutionMode 4 OutputVertices 81 + ExecutionMode 4 OutputPrimitivesNV 32 + ExecutionMode 4 OutputTrianglesNV + Source GLSL 460 + SourceExtension "GL_NV_mesh_shader" + Name 4 "main" + Name 8 "iid" + Name 11 "gl_LocalInvocationID" + Name 16 "gid" + Name 17 "gl_WorkGroupID" + Name 30 "gl_MeshPerVertexNV" + MemberName 30(gl_MeshPerVertexNV) 0 "gl_Position" + MemberName 30(gl_MeshPerVertexNV) 1 "gl_PointSize" + MemberName 30(gl_MeshPerVertexNV) 2 "gl_ClipDistance" + MemberName 30(gl_MeshPerVertexNV) 3 "gl_CullDistance" + MemberName 30(gl_MeshPerVertexNV) 4 "gl_PositionPerViewNV" + MemberName 30(gl_MeshPerVertexNV) 5 "gl_ClipDistancePerViewNV" + MemberName 30(gl_MeshPerVertexNV) 6 "gl_CullDistancePerViewNV" + Name 34 "gl_MeshVerticesNV" + Name 84 "gl_MeshPerPrimitiveNV" + MemberName 84(gl_MeshPerPrimitiveNV) 0 "gl_PrimitiveID" + MemberName 84(gl_MeshPerPrimitiveNV) 1 "gl_Layer" + MemberName 84(gl_MeshPerPrimitiveNV) 2 "gl_ViewportIndex" + MemberName 84(gl_MeshPerPrimitiveNV) 3 "gl_ViewportMask" + MemberName 84(gl_MeshPerPrimitiveNV) 4 "gl_LayerPerViewNV" + MemberName 84(gl_MeshPerPrimitiveNV) 5 "gl_ViewportMaskPerViewNV" + Name 88 "gl_MeshPrimitivesNV" + Name 128 "gl_PrimitiveIndicesNV" + Name 139 "gl_DrawID" + Name 143 "gl_PrimitiveCountNV" + Decorate 11(gl_LocalInvocationID) BuiltIn LocalInvocationId + Decorate 17(gl_WorkGroupID) BuiltIn WorkgroupId + MemberDecorate 30(gl_MeshPerVertexNV) 0 BuiltIn Position + MemberDecorate 30(gl_MeshPerVertexNV) 1 BuiltIn PointSize + MemberDecorate 30(gl_MeshPerVertexNV) 2 BuiltIn ClipDistance + MemberDecorate 30(gl_MeshPerVertexNV) 3 BuiltIn CullDistance + MemberDecorate 30(gl_MeshPerVertexNV) 4 PerViewNV + MemberDecorate 30(gl_MeshPerVertexNV) 4 BuiltIn PositionPerViewNV + MemberDecorate 30(gl_MeshPerVertexNV) 5 PerViewNV + MemberDecorate 30(gl_MeshPerVertexNV) 5 BuiltIn ClipDistancePerViewNV + MemberDecorate 30(gl_MeshPerVertexNV) 6 PerViewNV + MemberDecorate 30(gl_MeshPerVertexNV) 6 BuiltIn CullDistancePerViewNV + Decorate 30(gl_MeshPerVertexNV) Block + MemberDecorate 84(gl_MeshPerPrimitiveNV) 0 PerPrimitiveNV + MemberDecorate 84(gl_MeshPerPrimitiveNV) 0 BuiltIn PrimitiveId + MemberDecorate 84(gl_MeshPerPrimitiveNV) 1 PerPrimitiveNV + MemberDecorate 84(gl_MeshPerPrimitiveNV) 1 BuiltIn Layer + MemberDecorate 84(gl_MeshPerPrimitiveNV) 2 PerPrimitiveNV + MemberDecorate 84(gl_MeshPerPrimitiveNV) 2 BuiltIn ViewportIndex + MemberDecorate 84(gl_MeshPerPrimitiveNV) 3 PerPrimitiveNV + MemberDecorate 84(gl_MeshPerPrimitiveNV) 3 BuiltIn ViewportMaskNV + MemberDecorate 84(gl_MeshPerPrimitiveNV) 4 PerPrimitiveNV + MemberDecorate 84(gl_MeshPerPrimitiveNV) 4 PerViewNV + MemberDecorate 84(gl_MeshPerPrimitiveNV) 4 BuiltIn LayerPerViewNV + MemberDecorate 84(gl_MeshPerPrimitiveNV) 5 PerPrimitiveNV + MemberDecorate 84(gl_MeshPerPrimitiveNV) 5 PerViewNV + MemberDecorate 84(gl_MeshPerPrimitiveNV) 5 BuiltIn ViewportMaskPerViewNV + Decorate 84(gl_MeshPerPrimitiveNV) Block + Decorate 128(gl_PrimitiveIndicesNV) BuiltIn PrimitiveIndicesNV + Decorate 139(gl_DrawID) BuiltIn DrawIndex + Decorate 143(gl_PrimitiveCountNV) BuiltIn PrimitiveCountNV + Decorate 145 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypeVector 6(int) 3 + 10: TypePointer Input 9(ivec3) +11(gl_LocalInvocationID): 10(ptr) Variable Input + 12: 6(int) Constant 0 + 13: TypePointer Input 6(int) +17(gl_WorkGroupID): 10(ptr) Variable Input + 20: TypeFloat 32 + 21: TypeVector 20(float) 4 + 22: 6(int) Constant 4 + 23: TypeArray 20(float) 22 + 24: 6(int) Constant 3 + 25: TypeArray 20(float) 24 + 26: TypeArray 21(fvec4) 22 + 27: 6(int) Constant 1 + 28: TypeArray 20(float) 27 + 29: TypeArray 28 22 +30(gl_MeshPerVertexNV): TypeStruct 21(fvec4) 20(float) 23 25 26 29 29 + 31: 6(int) Constant 81 + 32: TypeArray 30(gl_MeshPerVertexNV) 31 + 33: TypePointer Output 32 +34(gl_MeshVerticesNV): 33(ptr) Variable Output + 36: TypeInt 32 1 + 37: 36(int) Constant 0 + 38: 20(float) Constant 1065353216 + 39: 21(fvec4) ConstantComposite 38 38 38 38 + 40: TypePointer Output 21(fvec4) + 43: 36(int) Constant 1 + 44: 20(float) Constant 1073741824 + 45: TypePointer Output 20(float) + 48: 36(int) Constant 2 + 49: 36(int) Constant 3 + 50: 20(float) Constant 1077936128 + 53: 20(float) Constant 1082130432 + 55: 6(int) Constant 264 + 56: 6(int) Constant 2 + 81: TypeArray 36(int) 27 + 82: TypeArray 36(int) 22 + 83: TypeArray 81 22 +84(gl_MeshPerPrimitiveNV): TypeStruct 36(int) 36(int) 36(int) 81 82 83 + 85: 6(int) Constant 32 + 86: TypeArray 84(gl_MeshPerPrimitiveNV) 85 + 87: TypePointer Output 86 +88(gl_MeshPrimitivesNV): 87(ptr) Variable Output + 90: 36(int) Constant 6 + 91: TypePointer Output 36(int) + 94: 36(int) Constant 7 + 97: 36(int) Constant 8 + 100: 36(int) Constant 9 + 126: TypeArray 6(int) 31 + 127: TypePointer Output 126 +128(gl_PrimitiveIndicesNV): 127(ptr) Variable Output + 129: 6(int) Constant 257 + 130: TypePointer Output 6(int) + 138: TypePointer Input 36(int) + 139(gl_DrawID): 138(ptr) Variable Input + 142: 6(int) Constant 16909060 +143(gl_PrimitiveCountNV): 130(ptr) Variable Output + 144: 6(int) Constant 96 + 145: 9(ivec3) ConstantComposite 85 27 27 + 4(main): 2 Function None 3 + 5: Label + 8(iid): 7(ptr) Variable Function + 16(gid): 7(ptr) Variable Function + 14: 13(ptr) AccessChain 11(gl_LocalInvocationID) 12 + 15: 6(int) Load 14 + Store 8(iid) 15 + 18: 13(ptr) AccessChain 17(gl_WorkGroupID) 12 + 19: 6(int) Load 18 + Store 16(gid) 19 + 35: 6(int) Load 8(iid) + 41: 40(ptr) AccessChain 34(gl_MeshVerticesNV) 35 37 + Store 41 39 + 42: 6(int) Load 8(iid) + 46: 45(ptr) AccessChain 34(gl_MeshVerticesNV) 42 43 + Store 46 44 + 47: 6(int) Load 8(iid) + 51: 45(ptr) AccessChain 34(gl_MeshVerticesNV) 47 48 49 + Store 51 50 + 52: 6(int) Load 8(iid) + 54: 45(ptr) AccessChain 34(gl_MeshVerticesNV) 52 49 48 + Store 54 53 + MemoryBarrier 27 55 + ControlBarrier 56 56 55 + 57: 6(int) Load 8(iid) + 58: 6(int) IAdd 57 27 + 59: 6(int) Load 8(iid) + 60: 40(ptr) AccessChain 34(gl_MeshVerticesNV) 59 37 + 61: 21(fvec4) Load 60 + 62: 40(ptr) AccessChain 34(gl_MeshVerticesNV) 58 37 + Store 62 61 + 63: 6(int) Load 8(iid) + 64: 6(int) IAdd 63 27 + 65: 6(int) Load 8(iid) + 66: 45(ptr) AccessChain 34(gl_MeshVerticesNV) 65 43 + 67: 20(float) Load 66 + 68: 45(ptr) AccessChain 34(gl_MeshVerticesNV) 64 43 + Store 68 67 + 69: 6(int) Load 8(iid) + 70: 6(int) IAdd 69 27 + 71: 6(int) Load 8(iid) + 72: 45(ptr) AccessChain 34(gl_MeshVerticesNV) 71 48 49 + 73: 20(float) Load 72 + 74: 45(ptr) AccessChain 34(gl_MeshVerticesNV) 70 48 49 + Store 74 73 + 75: 6(int) Load 8(iid) + 76: 6(int) IAdd 75 27 + 77: 6(int) Load 8(iid) + 78: 45(ptr) AccessChain 34(gl_MeshVerticesNV) 77 49 48 + 79: 20(float) Load 78 + 80: 45(ptr) AccessChain 34(gl_MeshVerticesNV) 76 49 48 + Store 80 79 + MemoryBarrier 27 55 + ControlBarrier 56 56 55 + 89: 6(int) Load 8(iid) + 92: 91(ptr) AccessChain 88(gl_MeshPrimitivesNV) 89 37 + Store 92 90 + 93: 6(int) Load 8(iid) + 95: 91(ptr) AccessChain 88(gl_MeshPrimitivesNV) 93 43 + Store 95 94 + 96: 6(int) Load 8(iid) + 98: 91(ptr) AccessChain 88(gl_MeshPrimitivesNV) 96 48 + Store 98 97 + 99: 6(int) Load 8(iid) + 101: 91(ptr) AccessChain 88(gl_MeshPrimitivesNV) 99 49 37 + Store 101 100 + MemoryBarrier 27 55 + ControlBarrier 56 56 55 + 102: 6(int) Load 8(iid) + 103: 6(int) IAdd 102 27 + 104: 6(int) Load 8(iid) + 105: 91(ptr) AccessChain 88(gl_MeshPrimitivesNV) 104 37 + 106: 36(int) Load 105 + 107: 91(ptr) AccessChain 88(gl_MeshPrimitivesNV) 103 37 + Store 107 106 + 108: 6(int) Load 8(iid) + 109: 6(int) IAdd 108 27 + 110: 6(int) Load 8(iid) + 111: 91(ptr) AccessChain 88(gl_MeshPrimitivesNV) 110 43 + 112: 36(int) Load 111 + 113: 91(ptr) AccessChain 88(gl_MeshPrimitivesNV) 109 43 + Store 113 112 + 114: 6(int) Load 8(iid) + 115: 6(int) IAdd 114 27 + 116: 6(int) Load 8(iid) + 117: 91(ptr) AccessChain 88(gl_MeshPrimitivesNV) 116 48 + 118: 36(int) Load 117 + 119: 91(ptr) AccessChain 88(gl_MeshPrimitivesNV) 115 48 + Store 119 118 + 120: 6(int) Load 8(iid) + 121: 6(int) IAdd 120 27 + 122: 6(int) Load 8(iid) + 123: 91(ptr) AccessChain 88(gl_MeshPrimitivesNV) 122 49 37 + 124: 36(int) Load 123 + 125: 91(ptr) AccessChain 88(gl_MeshPrimitivesNV) 121 49 37 + Store 125 124 + MemoryBarrier 27 55 + ControlBarrier 56 56 55 + 131: 130(ptr) AccessChain 128(gl_PrimitiveIndicesNV) 37 + Store 131 129 + 132: 6(int) Load 16(gid) + 133: 6(int) Load 16(gid) + 134: 6(int) ISub 133 27 + 135: 130(ptr) AccessChain 128(gl_PrimitiveIndicesNV) 134 + 136: 6(int) Load 135 + 137: 130(ptr) AccessChain 128(gl_PrimitiveIndicesNV) 132 + Store 137 136 + 140: 36(int) Load 139(gl_DrawID) + 141: 6(int) Bitcast 140 + 142: 141 WritePackedPrimitiveIndices4x8NV + Store 143(gl_PrimitiveCountNV) 144 + MemoryBarrier 27 55 + ControlBarrier 56 56 55 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.meshShaderPerViewBuiltins.mesh.out b/deps/glslang/Test/baseResults/spv.meshShaderPerViewBuiltins.mesh.out new file mode 100644 index 00000000..b912acaf --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.meshShaderPerViewBuiltins.mesh.out @@ -0,0 +1,214 @@ +spv.meshShaderPerViewBuiltins.mesh +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 126 + + Capability MultiViewport + Capability PerViewAttributesNV + Capability MeshShadingNV + Extension "SPV_NVX_multiview_per_view_attributes" + Extension "SPV_NV_mesh_shader" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint MeshNV 4 "main" 11 20 21 40 72 + ExecutionMode 4 LocalSize 32 1 1 + ExecutionMode 4 OutputVertices 81 + ExecutionMode 4 OutputPrimitivesNV 32 + ExecutionMode 4 OutputTrianglesNV + Source GLSL 450 + SourceExtension "GL_NV_mesh_shader" + Name 4 "main" + Name 8 "iid" + Name 11 "gl_LocalInvocationID" + Name 16 "viewID" + Name 20 "gl_MeshViewIndicesNV" + Name 21 "gl_MeshViewCountNV" + Name 36 "gl_MeshPerVertexNV" + MemberName 36(gl_MeshPerVertexNV) 0 "gl_Position" + MemberName 36(gl_MeshPerVertexNV) 1 "gl_PointSize" + MemberName 36(gl_MeshPerVertexNV) 2 "gl_ClipDistance" + MemberName 36(gl_MeshPerVertexNV) 3 "gl_CullDistance" + MemberName 36(gl_MeshPerVertexNV) 4 "gl_PositionPerViewNV" + MemberName 36(gl_MeshPerVertexNV) 5 "gl_ClipDistancePerViewNV" + MemberName 36(gl_MeshPerVertexNV) 6 "gl_CullDistancePerViewNV" + Name 40 "gl_MeshVerticesNV" + Name 68 "gl_MeshPerPrimitiveNV" + MemberName 68(gl_MeshPerPrimitiveNV) 0 "gl_PrimitiveID" + MemberName 68(gl_MeshPerPrimitiveNV) 1 "gl_Layer" + MemberName 68(gl_MeshPerPrimitiveNV) 2 "gl_ViewportIndex" + MemberName 68(gl_MeshPerPrimitiveNV) 3 "gl_ViewportMask" + MemberName 68(gl_MeshPerPrimitiveNV) 4 "gl_LayerPerViewNV" + MemberName 68(gl_MeshPerPrimitiveNV) 5 "gl_ViewportMaskPerViewNV" + Name 72 "gl_MeshPrimitivesNV" + Decorate 11(gl_LocalInvocationID) BuiltIn LocalInvocationId + Decorate 20(gl_MeshViewIndicesNV) BuiltIn MeshViewIndicesNV + Decorate 21(gl_MeshViewCountNV) BuiltIn MeshViewCountNV + MemberDecorate 36(gl_MeshPerVertexNV) 0 BuiltIn Position + MemberDecorate 36(gl_MeshPerVertexNV) 1 BuiltIn PointSize + MemberDecorate 36(gl_MeshPerVertexNV) 2 BuiltIn ClipDistance + MemberDecorate 36(gl_MeshPerVertexNV) 3 BuiltIn CullDistance + MemberDecorate 36(gl_MeshPerVertexNV) 4 PerViewNV + MemberDecorate 36(gl_MeshPerVertexNV) 4 BuiltIn PositionPerViewNV + MemberDecorate 36(gl_MeshPerVertexNV) 5 PerViewNV + MemberDecorate 36(gl_MeshPerVertexNV) 5 BuiltIn ClipDistancePerViewNV + MemberDecorate 36(gl_MeshPerVertexNV) 6 PerViewNV + MemberDecorate 36(gl_MeshPerVertexNV) 6 BuiltIn CullDistancePerViewNV + Decorate 36(gl_MeshPerVertexNV) Block + MemberDecorate 68(gl_MeshPerPrimitiveNV) 0 PerPrimitiveNV + MemberDecorate 68(gl_MeshPerPrimitiveNV) 0 BuiltIn PrimitiveId + MemberDecorate 68(gl_MeshPerPrimitiveNV) 1 PerPrimitiveNV + MemberDecorate 68(gl_MeshPerPrimitiveNV) 1 BuiltIn Layer + MemberDecorate 68(gl_MeshPerPrimitiveNV) 2 PerPrimitiveNV + MemberDecorate 68(gl_MeshPerPrimitiveNV) 2 BuiltIn ViewportIndex + MemberDecorate 68(gl_MeshPerPrimitiveNV) 3 PerPrimitiveNV + MemberDecorate 68(gl_MeshPerPrimitiveNV) 3 BuiltIn ViewportMaskNV + MemberDecorate 68(gl_MeshPerPrimitiveNV) 4 PerPrimitiveNV + MemberDecorate 68(gl_MeshPerPrimitiveNV) 4 PerViewNV + MemberDecorate 68(gl_MeshPerPrimitiveNV) 4 BuiltIn LayerPerViewNV + MemberDecorate 68(gl_MeshPerPrimitiveNV) 5 PerPrimitiveNV + MemberDecorate 68(gl_MeshPerPrimitiveNV) 5 PerViewNV + MemberDecorate 68(gl_MeshPerPrimitiveNV) 5 BuiltIn ViewportMaskPerViewNV + Decorate 68(gl_MeshPerPrimitiveNV) Block + Decorate 125 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypeVector 6(int) 3 + 10: TypePointer Input 9(ivec3) +11(gl_LocalInvocationID): 10(ptr) Variable Input + 12: 6(int) Constant 0 + 13: TypePointer Input 6(int) + 17: 6(int) Constant 4 + 18: TypeArray 6(int) 17 + 19: TypePointer Input 18 +20(gl_MeshViewIndicesNV): 19(ptr) Variable Input +21(gl_MeshViewCountNV): 13(ptr) Variable Input + 26: TypeFloat 32 + 27: TypeVector 26(float) 4 + 28: 6(int) Constant 1 + 29: TypeArray 26(float) 28 + 30: TypeArray 27(fvec4) 17 + 31: 6(int) Constant 3 + 32: TypeArray 26(float) 31 + 33: TypeArray 32 17 + 34: TypeArray 26(float) 17 + 35: TypeArray 34 17 +36(gl_MeshPerVertexNV): TypeStruct 27(fvec4) 26(float) 29 29 30 33 35 + 37: 6(int) Constant 81 + 38: TypeArray 36(gl_MeshPerVertexNV) 37 + 39: TypePointer Output 38 +40(gl_MeshVerticesNV): 39(ptr) Variable Output + 42: TypeInt 32 1 + 43: 42(int) Constant 4 + 45: 26(float) Constant 1065353216 + 46: 26(float) Constant 1073741824 + 47: 26(float) Constant 1077936128 + 48: 26(float) Constant 1082130432 + 49: 27(fvec4) ConstantComposite 45 46 47 48 + 50: TypePointer Output 27(fvec4) + 53: 42(int) Constant 5 + 55: 42(int) Constant 2 + 56: 26(float) Constant 1084227584 + 57: TypePointer Output 26(float) + 60: 42(int) Constant 6 + 62: 42(int) Constant 3 + 63: 26(float) Constant 1086324736 + 65: TypeArray 42(int) 28 + 66: TypeArray 42(int) 17 + 67: TypeArray 65 17 +68(gl_MeshPerPrimitiveNV): TypeStruct 42(int) 42(int) 42(int) 65 66 67 + 69: 6(int) Constant 32 + 70: TypeArray 68(gl_MeshPerPrimitiveNV) 69 + 71: TypePointer Output 70 +72(gl_MeshPrimitivesNV): 71(ptr) Variable Output + 75: 42(int) Constant 7 + 76: TypePointer Output 42(int) + 80: 42(int) Constant 0 + 81: 42(int) Constant 8 + 83: 6(int) Constant 264 + 84: 6(int) Constant 2 + 125: 9(ivec3) ConstantComposite 69 28 28 + 4(main): 2 Function None 3 + 5: Label + 8(iid): 7(ptr) Variable Function + 16(viewID): 7(ptr) Variable Function + 14: 13(ptr) AccessChain 11(gl_LocalInvocationID) 12 + 15: 6(int) Load 14 + Store 8(iid) 15 + 22: 6(int) Load 21(gl_MeshViewCountNV) + 23: 6(int) UMod 22 17 + 24: 13(ptr) AccessChain 20(gl_MeshViewIndicesNV) 23 + 25: 6(int) Load 24 + Store 16(viewID) 25 + 41: 6(int) Load 8(iid) + 44: 6(int) Load 16(viewID) + 51: 50(ptr) AccessChain 40(gl_MeshVerticesNV) 41 43 44 + Store 51 49 + 52: 6(int) Load 8(iid) + 54: 6(int) Load 16(viewID) + 58: 57(ptr) AccessChain 40(gl_MeshVerticesNV) 52 53 54 55 + Store 58 56 + 59: 6(int) Load 8(iid) + 61: 6(int) Load 16(viewID) + 64: 57(ptr) AccessChain 40(gl_MeshVerticesNV) 59 60 61 62 + Store 64 63 + 73: 6(int) Load 8(iid) + 74: 6(int) Load 16(viewID) + 77: 76(ptr) AccessChain 72(gl_MeshPrimitivesNV) 73 43 74 + Store 77 75 + 78: 6(int) Load 8(iid) + 79: 6(int) Load 16(viewID) + 82: 76(ptr) AccessChain 72(gl_MeshPrimitivesNV) 78 53 79 80 + Store 82 81 + MemoryBarrier 28 83 + ControlBarrier 84 84 83 + 85: 6(int) Load 8(iid) + 86: 6(int) IAdd 85 28 + 87: 6(int) Load 16(viewID) + 88: 6(int) Load 8(iid) + 89: 6(int) Load 16(viewID) + 90: 50(ptr) AccessChain 40(gl_MeshVerticesNV) 88 43 89 + 91: 27(fvec4) Load 90 + 92: 50(ptr) AccessChain 40(gl_MeshVerticesNV) 86 43 87 + Store 92 91 + 93: 6(int) Load 8(iid) + 94: 6(int) IAdd 93 28 + 95: 6(int) Load 16(viewID) + 96: 6(int) Load 8(iid) + 97: 6(int) Load 16(viewID) + 98: 57(ptr) AccessChain 40(gl_MeshVerticesNV) 96 53 97 55 + 99: 26(float) Load 98 + 100: 57(ptr) AccessChain 40(gl_MeshVerticesNV) 94 53 95 55 + Store 100 99 + 101: 6(int) Load 8(iid) + 102: 6(int) IAdd 101 28 + 103: 6(int) Load 16(viewID) + 104: 6(int) Load 8(iid) + 105: 6(int) Load 16(viewID) + 106: 57(ptr) AccessChain 40(gl_MeshVerticesNV) 104 60 105 62 + 107: 26(float) Load 106 + 108: 57(ptr) AccessChain 40(gl_MeshVerticesNV) 102 60 103 62 + Store 108 107 + 109: 6(int) Load 8(iid) + 110: 6(int) IAdd 109 28 + 111: 6(int) Load 16(viewID) + 112: 6(int) Load 8(iid) + 113: 6(int) Load 16(viewID) + 114: 76(ptr) AccessChain 72(gl_MeshPrimitivesNV) 112 43 113 + 115: 42(int) Load 114 + 116: 76(ptr) AccessChain 72(gl_MeshPrimitivesNV) 110 43 111 + Store 116 115 + 117: 6(int) Load 8(iid) + 118: 6(int) IAdd 117 28 + 119: 6(int) Load 16(viewID) + 120: 6(int) Load 8(iid) + 121: 6(int) Load 16(viewID) + 122: 76(ptr) AccessChain 72(gl_MeshPrimitivesNV) 120 53 121 80 + 123: 42(int) Load 122 + 124: 76(ptr) AccessChain 72(gl_MeshPrimitivesNV) 118 53 119 80 + Store 124 123 + MemoryBarrier 28 83 + ControlBarrier 84 84 83 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.meshShaderPerViewUserDefined.mesh.out b/deps/glslang/Test/baseResults/spv.meshShaderPerViewUserDefined.mesh.out new file mode 100644 index 00000000..7e7a37db --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.meshShaderPerViewUserDefined.mesh.out @@ -0,0 +1,156 @@ +spv.meshShaderPerViewUserDefined.mesh +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 90 + + Capability MeshShadingNV + Extension "SPV_NV_mesh_shader" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint MeshNV 4 "main" 11 20 21 35 67 + ExecutionMode 4 LocalSize 32 1 1 + ExecutionMode 4 OutputVertices 81 + ExecutionMode 4 OutputPrimitivesNV 32 + ExecutionMode 4 OutputTrianglesNV + Source GLSL 450 + SourceExtension "GL_NV_mesh_shader" + Name 4 "main" + Name 8 "iid" + Name 11 "gl_LocalInvocationID" + Name 16 "viewID" + Name 20 "gl_MeshViewIndicesNV" + Name 21 "gl_MeshViewCountNV" + Name 31 "block" + MemberName 31(block) 0 "color1" + MemberName 31(block) 1 "color2" + MemberName 31(block) 2 "color3" + MemberName 31(block) 3 "color4" + Name 35 "b" + Name 64 "perviewBlock" + MemberName 64(perviewBlock) 0 "color5" + MemberName 64(perviewBlock) 1 "color6" + MemberName 64(perviewBlock) 2 "color7" + MemberName 64(perviewBlock) 3 "color8" + Name 67 "b2" + Decorate 11(gl_LocalInvocationID) BuiltIn LocalInvocationId + Decorate 20(gl_MeshViewIndicesNV) BuiltIn MeshViewIndicesNV + Decorate 21(gl_MeshViewCountNV) BuiltIn MeshViewCountNV + MemberDecorate 31(block) 0 PerPrimitiveNV + MemberDecorate 31(block) 0 PerViewNV + MemberDecorate 31(block) 1 PerPrimitiveNV + MemberDecorate 31(block) 2 PerViewNV + Decorate 31(block) Block + Decorate 35(b) Location 0 + MemberDecorate 64(perviewBlock) 0 PerPrimitiveNV + MemberDecorate 64(perviewBlock) 0 PerViewNV + MemberDecorate 64(perviewBlock) 1 PerPrimitiveNV + MemberDecorate 64(perviewBlock) 1 PerViewNV + MemberDecorate 64(perviewBlock) 2 PerViewNV + MemberDecorate 64(perviewBlock) 3 PerViewNV + Decorate 64(perviewBlock) Block + Decorate 67(b2) Location 10 + Decorate 89 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypeVector 6(int) 3 + 10: TypePointer Input 9(ivec3) +11(gl_LocalInvocationID): 10(ptr) Variable Input + 12: 6(int) Constant 0 + 13: TypePointer Input 6(int) + 17: 6(int) Constant 4 + 18: TypeArray 6(int) 17 + 19: TypePointer Input 18 +20(gl_MeshViewIndicesNV): 19(ptr) Variable Input +21(gl_MeshViewCountNV): 13(ptr) Variable Input + 26: TypeFloat 32 + 27: TypeVector 26(float) 4 + 28: 6(int) Constant 3 + 29: TypeArray 27(fvec4) 28 + 30: TypeArray 29 17 + 31(block): TypeStruct 30 29 30 27(fvec4) + 32: 6(int) Constant 81 + 33: TypeArray 31(block) 32 + 34: TypePointer Output 33 + 35(b): 34(ptr) Variable Output + 37: TypeInt 32 1 + 38: 37(int) Constant 0 + 40: 37(int) Constant 2 + 41: 26(float) Constant 1065353216 + 42: 27(fvec4) ConstantComposite 41 41 41 41 + 43: TypePointer Output 27(fvec4) + 46: 37(int) Constant 1 + 47: 26(float) Constant 1073741824 + 48: 27(fvec4) ConstantComposite 47 47 47 47 + 52: 26(float) Constant 1077936128 + 53: 27(fvec4) ConstantComposite 52 52 52 52 + 56: 37(int) Constant 3 + 57: 26(float) Constant 1082130432 + 58: 27(fvec4) ConstantComposite 57 57 57 57 + 60: 6(int) Constant 1 + 61: 6(int) Constant 264 + 62: 6(int) Constant 2 + 63: TypeArray 27(fvec4) 17 +64(perviewBlock): TypeStruct 63 30 30 63 + 65: TypeArray 64(perviewBlock) 32 + 66: TypePointer Output 65 + 67(b2): 66(ptr) Variable Output + 70: 26(float) Constant 1084227584 + 71: 27(fvec4) ConstantComposite 70 70 70 70 + 75: 26(float) Constant 1086324736 + 76: 27(fvec4) ConstantComposite 75 75 75 75 + 80: 26(float) Constant 1088421888 + 81: 27(fvec4) ConstantComposite 80 80 80 80 + 85: 26(float) Constant 1090519040 + 86: 27(fvec4) ConstantComposite 85 85 85 85 + 88: 6(int) Constant 32 + 89: 9(ivec3) ConstantComposite 88 60 60 + 4(main): 2 Function None 3 + 5: Label + 8(iid): 7(ptr) Variable Function + 16(viewID): 7(ptr) Variable Function + 14: 13(ptr) AccessChain 11(gl_LocalInvocationID) 12 + 15: 6(int) Load 14 + Store 8(iid) 15 + 22: 6(int) Load 21(gl_MeshViewCountNV) + 23: 6(int) UMod 22 17 + 24: 13(ptr) AccessChain 20(gl_MeshViewIndicesNV) 23 + 25: 6(int) Load 24 + Store 16(viewID) 25 + 36: 6(int) Load 8(iid) + 39: 6(int) Load 16(viewID) + 44: 43(ptr) AccessChain 35(b) 36 38 39 40 + Store 44 42 + 45: 6(int) Load 8(iid) + 49: 43(ptr) AccessChain 35(b) 45 46 46 + Store 49 48 + 50: 6(int) Load 8(iid) + 51: 6(int) Load 16(viewID) + 54: 43(ptr) AccessChain 35(b) 50 40 51 40 + Store 54 53 + 55: 6(int) Load 8(iid) + 59: 43(ptr) AccessChain 35(b) 55 56 + Store 59 58 + MemoryBarrier 60 61 + ControlBarrier 62 62 61 + 68: 6(int) Load 8(iid) + 69: 6(int) Load 16(viewID) + 72: 43(ptr) AccessChain 67(b2) 68 38 69 + Store 72 71 + 73: 6(int) Load 8(iid) + 74: 6(int) Load 16(viewID) + 77: 43(ptr) AccessChain 67(b2) 73 46 74 46 + Store 77 76 + 78: 6(int) Load 8(iid) + 79: 6(int) Load 16(viewID) + 82: 43(ptr) AccessChain 67(b2) 78 40 79 40 + Store 82 81 + 83: 6(int) Load 8(iid) + 84: 6(int) Load 16(viewID) + 87: 43(ptr) AccessChain 67(b2) 83 56 84 + Store 87 86 + MemoryBarrier 60 61 + ControlBarrier 62 62 61 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.meshShaderRedeclBuiltins.mesh.out b/deps/glslang/Test/baseResults/spv.meshShaderRedeclBuiltins.mesh.out new file mode 100644 index 00000000..f4491c0e --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.meshShaderRedeclBuiltins.mesh.out @@ -0,0 +1,201 @@ +spv.meshShaderRedeclBuiltins.mesh +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 120 + + Capability ClipDistance + Capability CullDistance + Capability MultiViewport + Capability ShaderViewportMaskNV + Capability MeshShadingNV + Extension "SPV_NV_mesh_shader" + Extension "SPV_NV_viewport_array2" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint MeshNV 4 "main" 11 17 28 81 + ExecutionMode 4 LocalSize 32 1 1 + ExecutionMode 4 OutputVertices 81 + ExecutionMode 4 OutputPrimitivesNV 32 + ExecutionMode 4 OutputTrianglesNV + Source GLSL 460 + SourceExtension "GL_NV_mesh_shader" + Name 4 "main" + Name 8 "iid" + Name 11 "gl_LocalInvocationID" + Name 16 "gid" + Name 17 "gl_WorkGroupID" + Name 24 "gl_MeshPerVertexNV" + MemberName 24(gl_MeshPerVertexNV) 0 "gl_Position" + MemberName 24(gl_MeshPerVertexNV) 1 "gl_PointSize" + MemberName 24(gl_MeshPerVertexNV) 2 "gl_ClipDistance" + MemberName 24(gl_MeshPerVertexNV) 3 "gl_CullDistance" + Name 28 "gl_MeshVerticesNV" + Name 77 "gl_MeshPerPrimitiveNV" + MemberName 77(gl_MeshPerPrimitiveNV) 0 "gl_PrimitiveID" + MemberName 77(gl_MeshPerPrimitiveNV) 1 "gl_Layer" + MemberName 77(gl_MeshPerPrimitiveNV) 2 "gl_ViewportIndex" + MemberName 77(gl_MeshPerPrimitiveNV) 3 "gl_ViewportMask" + Name 81 "gl_MeshPrimitivesNV" + Decorate 11(gl_LocalInvocationID) BuiltIn LocalInvocationId + Decorate 17(gl_WorkGroupID) BuiltIn WorkgroupId + MemberDecorate 24(gl_MeshPerVertexNV) 0 BuiltIn Position + MemberDecorate 24(gl_MeshPerVertexNV) 1 BuiltIn PointSize + MemberDecorate 24(gl_MeshPerVertexNV) 2 BuiltIn ClipDistance + MemberDecorate 24(gl_MeshPerVertexNV) 3 BuiltIn CullDistance + Decorate 24(gl_MeshPerVertexNV) Block + MemberDecorate 77(gl_MeshPerPrimitiveNV) 0 PerPrimitiveNV + MemberDecorate 77(gl_MeshPerPrimitiveNV) 0 BuiltIn PrimitiveId + MemberDecorate 77(gl_MeshPerPrimitiveNV) 1 PerPrimitiveNV + MemberDecorate 77(gl_MeshPerPrimitiveNV) 1 BuiltIn Layer + MemberDecorate 77(gl_MeshPerPrimitiveNV) 2 PerPrimitiveNV + MemberDecorate 77(gl_MeshPerPrimitiveNV) 2 BuiltIn ViewportIndex + MemberDecorate 77(gl_MeshPerPrimitiveNV) 3 PerPrimitiveNV + MemberDecorate 77(gl_MeshPerPrimitiveNV) 3 BuiltIn ViewportMaskNV + Decorate 77(gl_MeshPerPrimitiveNV) Block + Decorate 119 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypeVector 6(int) 3 + 10: TypePointer Input 9(ivec3) +11(gl_LocalInvocationID): 10(ptr) Variable Input + 12: 6(int) Constant 0 + 13: TypePointer Input 6(int) +17(gl_WorkGroupID): 10(ptr) Variable Input + 20: TypeFloat 32 + 21: TypeVector 20(float) 4 + 22: 6(int) Constant 4 + 23: TypeArray 20(float) 22 +24(gl_MeshPerVertexNV): TypeStruct 21(fvec4) 20(float) 23 23 + 25: 6(int) Constant 81 + 26: TypeArray 24(gl_MeshPerVertexNV) 25 + 27: TypePointer Output 26 +28(gl_MeshVerticesNV): 27(ptr) Variable Output + 30: TypeInt 32 1 + 31: 30(int) Constant 0 + 32: 20(float) Constant 1065353216 + 33: 21(fvec4) ConstantComposite 32 32 32 32 + 34: TypePointer Output 21(fvec4) + 37: 30(int) Constant 1 + 38: 20(float) Constant 1073741824 + 39: TypePointer Output 20(float) + 42: 30(int) Constant 2 + 43: 30(int) Constant 3 + 44: 20(float) Constant 1077936128 + 47: 20(float) Constant 1082130432 + 49: 6(int) Constant 1 + 50: 6(int) Constant 264 + 51: 6(int) Constant 2 + 76: TypeArray 30(int) 49 +77(gl_MeshPerPrimitiveNV): TypeStruct 30(int) 30(int) 30(int) 76 + 78: 6(int) Constant 32 + 79: TypeArray 77(gl_MeshPerPrimitiveNV) 78 + 80: TypePointer Output 79 +81(gl_MeshPrimitivesNV): 80(ptr) Variable Output + 83: 30(int) Constant 6 + 84: TypePointer Output 30(int) + 87: 30(int) Constant 7 + 90: 30(int) Constant 8 + 93: 30(int) Constant 9 + 119: 9(ivec3) ConstantComposite 78 49 49 + 4(main): 2 Function None 3 + 5: Label + 8(iid): 7(ptr) Variable Function + 16(gid): 7(ptr) Variable Function + 14: 13(ptr) AccessChain 11(gl_LocalInvocationID) 12 + 15: 6(int) Load 14 + Store 8(iid) 15 + 18: 13(ptr) AccessChain 17(gl_WorkGroupID) 12 + 19: 6(int) Load 18 + Store 16(gid) 19 + 29: 6(int) Load 8(iid) + 35: 34(ptr) AccessChain 28(gl_MeshVerticesNV) 29 31 + Store 35 33 + 36: 6(int) Load 8(iid) + 40: 39(ptr) AccessChain 28(gl_MeshVerticesNV) 36 37 + Store 40 38 + 41: 6(int) Load 8(iid) + 45: 39(ptr) AccessChain 28(gl_MeshVerticesNV) 41 42 43 + Store 45 44 + 46: 6(int) Load 8(iid) + 48: 39(ptr) AccessChain 28(gl_MeshVerticesNV) 46 43 42 + Store 48 47 + MemoryBarrier 49 50 + ControlBarrier 51 51 50 + 52: 6(int) Load 8(iid) + 53: 6(int) IAdd 52 49 + 54: 6(int) Load 8(iid) + 55: 34(ptr) AccessChain 28(gl_MeshVerticesNV) 54 31 + 56: 21(fvec4) Load 55 + 57: 34(ptr) AccessChain 28(gl_MeshVerticesNV) 53 31 + Store 57 56 + 58: 6(int) Load 8(iid) + 59: 6(int) IAdd 58 49 + 60: 6(int) Load 8(iid) + 61: 39(ptr) AccessChain 28(gl_MeshVerticesNV) 60 37 + 62: 20(float) Load 61 + 63: 39(ptr) AccessChain 28(gl_MeshVerticesNV) 59 37 + Store 63 62 + 64: 6(int) Load 8(iid) + 65: 6(int) IAdd 64 49 + 66: 6(int) Load 8(iid) + 67: 39(ptr) AccessChain 28(gl_MeshVerticesNV) 66 42 43 + 68: 20(float) Load 67 + 69: 39(ptr) AccessChain 28(gl_MeshVerticesNV) 65 42 43 + Store 69 68 + 70: 6(int) Load 8(iid) + 71: 6(int) IAdd 70 49 + 72: 6(int) Load 8(iid) + 73: 39(ptr) AccessChain 28(gl_MeshVerticesNV) 72 43 42 + 74: 20(float) Load 73 + 75: 39(ptr) AccessChain 28(gl_MeshVerticesNV) 71 43 42 + Store 75 74 + MemoryBarrier 49 50 + ControlBarrier 51 51 50 + 82: 6(int) Load 8(iid) + 85: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 82 31 + Store 85 83 + 86: 6(int) Load 8(iid) + 88: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 86 37 + Store 88 87 + 89: 6(int) Load 8(iid) + 91: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 89 42 + Store 91 90 + 92: 6(int) Load 8(iid) + 94: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 92 43 31 + Store 94 93 + MemoryBarrier 49 50 + ControlBarrier 51 51 50 + 95: 6(int) Load 8(iid) + 96: 6(int) IAdd 95 49 + 97: 6(int) Load 8(iid) + 98: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 97 31 + 99: 30(int) Load 98 + 100: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 96 31 + Store 100 99 + 101: 6(int) Load 8(iid) + 102: 6(int) IAdd 101 49 + 103: 6(int) Load 8(iid) + 104: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 103 37 + 105: 30(int) Load 104 + 106: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 102 37 + Store 106 105 + 107: 6(int) Load 8(iid) + 108: 6(int) IAdd 107 49 + 109: 6(int) Load 8(iid) + 110: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 109 42 + 111: 30(int) Load 110 + 112: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 108 42 + Store 112 111 + 113: 6(int) Load 8(iid) + 114: 6(int) IAdd 113 49 + 115: 6(int) Load 8(iid) + 116: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 115 43 31 + 117: 30(int) Load 116 + 118: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 114 43 31 + Store 118 117 + MemoryBarrier 49 50 + ControlBarrier 51 51 50 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.meshShaderRedeclPerViewBuiltins.mesh.out b/deps/glslang/Test/baseResults/spv.meshShaderRedeclPerViewBuiltins.mesh.out new file mode 100644 index 00000000..6672dc24 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.meshShaderRedeclPerViewBuiltins.mesh.out @@ -0,0 +1,187 @@ +spv.meshShaderRedeclPerViewBuiltins.mesh +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 120 + + Capability PerViewAttributesNV + Capability MeshShadingNV + Extension "SPV_NVX_multiview_per_view_attributes" + Extension "SPV_NV_mesh_shader" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint MeshNV 4 "main" 11 20 21 35 67 + ExecutionMode 4 LocalSize 32 1 1 + ExecutionMode 4 OutputVertices 81 + ExecutionMode 4 OutputPrimitivesNV 32 + ExecutionMode 4 OutputTrianglesNV + Source GLSL 450 + SourceExtension "GL_NV_mesh_shader" + Name 4 "main" + Name 8 "iid" + Name 11 "gl_LocalInvocationID" + Name 16 "viewID" + Name 20 "gl_MeshViewIndicesNV" + Name 21 "gl_MeshViewCountNV" + Name 31 "gl_MeshPerVertexNV" + MemberName 31(gl_MeshPerVertexNV) 0 "gl_PositionPerViewNV" + MemberName 31(gl_MeshPerVertexNV) 1 "gl_ClipDistancePerViewNV" + MemberName 31(gl_MeshPerVertexNV) 2 "gl_CullDistancePerViewNV" + Name 35 "gl_MeshVerticesNV" + Name 63 "gl_MeshPerPrimitiveNV" + MemberName 63(gl_MeshPerPrimitiveNV) 0 "gl_LayerPerViewNV" + MemberName 63(gl_MeshPerPrimitiveNV) 1 "gl_ViewportMaskPerViewNV" + Name 67 "gl_MeshPrimitivesNV" + Decorate 11(gl_LocalInvocationID) BuiltIn LocalInvocationId + Decorate 20(gl_MeshViewIndicesNV) BuiltIn MeshViewIndicesNV + Decorate 21(gl_MeshViewCountNV) BuiltIn MeshViewCountNV + MemberDecorate 31(gl_MeshPerVertexNV) 0 PerViewNV + MemberDecorate 31(gl_MeshPerVertexNV) 0 BuiltIn PositionPerViewNV + MemberDecorate 31(gl_MeshPerVertexNV) 1 PerViewNV + MemberDecorate 31(gl_MeshPerVertexNV) 1 BuiltIn ClipDistancePerViewNV + MemberDecorate 31(gl_MeshPerVertexNV) 2 PerViewNV + MemberDecorate 31(gl_MeshPerVertexNV) 2 BuiltIn CullDistancePerViewNV + Decorate 31(gl_MeshPerVertexNV) Block + MemberDecorate 63(gl_MeshPerPrimitiveNV) 0 PerPrimitiveNV + MemberDecorate 63(gl_MeshPerPrimitiveNV) 0 PerViewNV + MemberDecorate 63(gl_MeshPerPrimitiveNV) 0 BuiltIn LayerPerViewNV + MemberDecorate 63(gl_MeshPerPrimitiveNV) 1 PerPrimitiveNV + MemberDecorate 63(gl_MeshPerPrimitiveNV) 1 PerViewNV + MemberDecorate 63(gl_MeshPerPrimitiveNV) 1 BuiltIn ViewportMaskPerViewNV + Decorate 63(gl_MeshPerPrimitiveNV) Block + Decorate 119 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypeVector 6(int) 3 + 10: TypePointer Input 9(ivec3) +11(gl_LocalInvocationID): 10(ptr) Variable Input + 12: 6(int) Constant 0 + 13: TypePointer Input 6(int) + 17: 6(int) Constant 4 + 18: TypeArray 6(int) 17 + 19: TypePointer Input 18 +20(gl_MeshViewIndicesNV): 19(ptr) Variable Input +21(gl_MeshViewCountNV): 13(ptr) Variable Input + 26: TypeFloat 32 + 27: TypeVector 26(float) 4 + 28: TypeArray 27(fvec4) 17 + 29: TypeArray 26(float) 17 + 30: TypeArray 29 17 +31(gl_MeshPerVertexNV): TypeStruct 28 30 30 + 32: 6(int) Constant 81 + 33: TypeArray 31(gl_MeshPerVertexNV) 32 + 34: TypePointer Output 33 +35(gl_MeshVerticesNV): 34(ptr) Variable Output + 37: TypeInt 32 1 + 38: 37(int) Constant 0 + 40: 26(float) Constant 1065353216 + 41: 26(float) Constant 1073741824 + 42: 26(float) Constant 1077936128 + 43: 26(float) Constant 1082130432 + 44: 27(fvec4) ConstantComposite 40 41 42 43 + 45: TypePointer Output 27(fvec4) + 48: 37(int) Constant 1 + 50: 37(int) Constant 2 + 51: 26(float) Constant 1084227584 + 52: TypePointer Output 26(float) + 56: 37(int) Constant 3 + 57: 26(float) Constant 1086324736 + 59: TypeArray 37(int) 17 + 60: 6(int) Constant 1 + 61: TypeArray 37(int) 60 + 62: TypeArray 61 17 +63(gl_MeshPerPrimitiveNV): TypeStruct 59 62 + 64: 6(int) Constant 32 + 65: TypeArray 63(gl_MeshPerPrimitiveNV) 64 + 66: TypePointer Output 65 +67(gl_MeshPrimitivesNV): 66(ptr) Variable Output + 70: 37(int) Constant 7 + 71: TypePointer Output 37(int) + 75: 37(int) Constant 8 + 77: 6(int) Constant 264 + 78: 6(int) Constant 2 + 119: 9(ivec3) ConstantComposite 64 60 60 + 4(main): 2 Function None 3 + 5: Label + 8(iid): 7(ptr) Variable Function + 16(viewID): 7(ptr) Variable Function + 14: 13(ptr) AccessChain 11(gl_LocalInvocationID) 12 + 15: 6(int) Load 14 + Store 8(iid) 15 + 22: 6(int) Load 21(gl_MeshViewCountNV) + 23: 6(int) UMod 22 17 + 24: 13(ptr) AccessChain 20(gl_MeshViewIndicesNV) 23 + 25: 6(int) Load 24 + Store 16(viewID) 25 + 36: 6(int) Load 8(iid) + 39: 6(int) Load 16(viewID) + 46: 45(ptr) AccessChain 35(gl_MeshVerticesNV) 36 38 39 + Store 46 44 + 47: 6(int) Load 8(iid) + 49: 6(int) Load 16(viewID) + 53: 52(ptr) AccessChain 35(gl_MeshVerticesNV) 47 48 49 50 + Store 53 51 + 54: 6(int) Load 8(iid) + 55: 6(int) Load 16(viewID) + 58: 52(ptr) AccessChain 35(gl_MeshVerticesNV) 54 50 55 56 + Store 58 57 + 68: 6(int) Load 8(iid) + 69: 6(int) Load 16(viewID) + 72: 71(ptr) AccessChain 67(gl_MeshPrimitivesNV) 68 38 69 + Store 72 70 + 73: 6(int) Load 8(iid) + 74: 6(int) Load 16(viewID) + 76: 71(ptr) AccessChain 67(gl_MeshPrimitivesNV) 73 48 74 38 + Store 76 75 + MemoryBarrier 60 77 + ControlBarrier 78 78 77 + 79: 6(int) Load 8(iid) + 80: 6(int) IAdd 79 60 + 81: 6(int) Load 16(viewID) + 82: 6(int) Load 8(iid) + 83: 6(int) Load 16(viewID) + 84: 45(ptr) AccessChain 35(gl_MeshVerticesNV) 82 38 83 + 85: 27(fvec4) Load 84 + 86: 45(ptr) AccessChain 35(gl_MeshVerticesNV) 80 38 81 + Store 86 85 + 87: 6(int) Load 8(iid) + 88: 6(int) IAdd 87 60 + 89: 6(int) Load 16(viewID) + 90: 6(int) Load 8(iid) + 91: 6(int) Load 16(viewID) + 92: 52(ptr) AccessChain 35(gl_MeshVerticesNV) 90 48 91 50 + 93: 26(float) Load 92 + 94: 52(ptr) AccessChain 35(gl_MeshVerticesNV) 88 48 89 50 + Store 94 93 + 95: 6(int) Load 8(iid) + 96: 6(int) IAdd 95 60 + 97: 6(int) Load 16(viewID) + 98: 6(int) Load 8(iid) + 99: 6(int) Load 16(viewID) + 100: 52(ptr) AccessChain 35(gl_MeshVerticesNV) 98 50 99 56 + 101: 26(float) Load 100 + 102: 52(ptr) AccessChain 35(gl_MeshVerticesNV) 96 50 97 56 + Store 102 101 + 103: 6(int) Load 8(iid) + 104: 6(int) IAdd 103 60 + 105: 6(int) Load 16(viewID) + 106: 6(int) Load 8(iid) + 107: 6(int) Load 16(viewID) + 108: 71(ptr) AccessChain 67(gl_MeshPrimitivesNV) 106 38 107 + 109: 37(int) Load 108 + 110: 71(ptr) AccessChain 67(gl_MeshPrimitivesNV) 104 38 105 + Store 110 109 + 111: 6(int) Load 8(iid) + 112: 6(int) IAdd 111 60 + 113: 6(int) Load 16(viewID) + 114: 6(int) Load 8(iid) + 115: 6(int) Load 16(viewID) + 116: 71(ptr) AccessChain 67(gl_MeshPrimitivesNV) 114 48 115 38 + 117: 37(int) Load 116 + 118: 71(ptr) AccessChain 67(gl_MeshPrimitivesNV) 112 48 113 38 + Store 118 117 + MemoryBarrier 60 77 + ControlBarrier 78 78 77 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.meshShaderSharedMem.mesh.out b/deps/glslang/Test/baseResults/spv.meshShaderSharedMem.mesh.out new file mode 100644 index 00000000..198f8129 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.meshShaderSharedMem.mesh.out @@ -0,0 +1,128 @@ +spv.meshShaderSharedMem.mesh +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 77 + + Capability StorageImageWriteWithoutFormat + Capability MeshShadingNV + Extension "SPV_NV_mesh_shader" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint MeshNV 4 "main" 11 17 + ExecutionMode 4 LocalSize 32 1 1 + ExecutionMode 4 OutputVertices 81 + ExecutionMode 4 OutputPrimitivesNV 32 + ExecutionMode 4 OutputTrianglesNV + Source GLSL 450 + SourceExtension "GL_NV_mesh_shader" + Name 4 "main" + Name 8 "iid" + Name 11 "gl_LocalInvocationID" + Name 16 "gid" + Name 17 "gl_WorkGroupID" + Name 20 "i" + Name 34 "mem" + Name 37 "block0" + MemberName 37(block0) 0 "uni_value" + Name 39 "" + Name 55 "uni_image" + Decorate 11(gl_LocalInvocationID) BuiltIn LocalInvocationId + Decorate 17(gl_WorkGroupID) BuiltIn WorkgroupId + MemberDecorate 37(block0) 0 Offset 0 + Decorate 37(block0) Block + Decorate 39 DescriptorSet 0 + Decorate 55(uni_image) DescriptorSet 0 + Decorate 55(uni_image) NonReadable + Decorate 76 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypeVector 6(int) 3 + 10: TypePointer Input 9(ivec3) +11(gl_LocalInvocationID): 10(ptr) Variable Input + 12: 6(int) Constant 0 + 13: TypePointer Input 6(int) +17(gl_WorkGroupID): 10(ptr) Variable Input + 27: 6(int) Constant 10 + 28: TypeBool + 30: TypeFloat 32 + 31: TypeVector 30(float) 4 + 32: TypeArray 31(fvec4) 27 + 33: TypePointer Workgroup 32 + 34(mem): 33(ptr) Variable Workgroup + 37(block0): TypeStruct 6(int) + 38: TypePointer Uniform 37(block0) + 39: 38(ptr) Variable Uniform + 40: TypeInt 32 1 + 41: 40(int) Constant 0 + 42: TypePointer Uniform 6(int) + 48: TypePointer Workgroup 31(fvec4) + 51: 40(int) Constant 1 + 53: TypeImage 30(float) 2D nonsampled format:Unknown + 54: TypePointer UniformConstant 53 + 55(uni_image): 54(ptr) Variable UniformConstant + 59: TypeVector 40(int) 2 + 69: 6(int) Constant 1 + 73: 6(int) Constant 264 + 74: 6(int) Constant 2 + 75: 6(int) Constant 32 + 76: 9(ivec3) ConstantComposite 75 69 69 + 4(main): 2 Function None 3 + 5: Label + 8(iid): 7(ptr) Variable Function + 16(gid): 7(ptr) Variable Function + 20(i): 7(ptr) Variable Function + 14: 13(ptr) AccessChain 11(gl_LocalInvocationID) 12 + 15: 6(int) Load 14 + Store 8(iid) 15 + 18: 13(ptr) AccessChain 17(gl_WorkGroupID) 12 + 19: 6(int) Load 18 + Store 16(gid) 19 + Store 20(i) 12 + Branch 21 + 21: Label + LoopMerge 23 24 None + Branch 25 + 25: Label + 26: 6(int) Load 20(i) + 29: 28(bool) ULessThan 26 27 + BranchConditional 29 22 23 + 22: Label + 35: 6(int) Load 20(i) + 36: 6(int) Load 20(i) + 43: 42(ptr) AccessChain 39 41 + 44: 6(int) Load 43 + 45: 6(int) IAdd 36 44 + 46: 30(float) ConvertUToF 45 + 47: 31(fvec4) CompositeConstruct 46 46 46 46 + 49: 48(ptr) AccessChain 34(mem) 35 + Store 49 47 + Branch 24 + 24: Label + 50: 6(int) Load 20(i) + 52: 6(int) IAdd 50 51 + Store 20(i) 52 + Branch 21 + 23: Label + 56: 53 Load 55(uni_image) + 57: 6(int) Load 8(iid) + 58: 40(int) Bitcast 57 + 60: 59(ivec2) CompositeConstruct 58 58 + 61: 6(int) Load 16(gid) + 62: 48(ptr) AccessChain 34(mem) 61 + 63: 31(fvec4) Load 62 + ImageWrite 56 60 63 + 64: 53 Load 55(uni_image) + 65: 6(int) Load 8(iid) + 66: 40(int) Bitcast 65 + 67: 59(ivec2) CompositeConstruct 66 66 + 68: 6(int) Load 16(gid) + 70: 6(int) IAdd 68 69 + 71: 48(ptr) AccessChain 34(mem) 70 + 72: 31(fvec4) Load 71 + ImageWrite 64 67 72 + MemoryBarrier 69 73 + ControlBarrier 74 74 73 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.meshShaderTaskMem.mesh.out b/deps/glslang/Test/baseResults/spv.meshShaderTaskMem.mesh.out new file mode 100644 index 00000000..93b2a457 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.meshShaderTaskMem.mesh.out @@ -0,0 +1,107 @@ +spv.meshShaderTaskMem.mesh +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 58 + + Capability MeshShadingNV + Extension "SPV_NV_mesh_shader" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint MeshNV 4 "main" 11 22 30 + ExecutionMode 4 LocalSize 32 1 1 + ExecutionMode 4 OutputVertices 81 + ExecutionMode 4 OutputPrimitivesNV 32 + ExecutionMode 4 OutputTrianglesNV + Source GLSL 450 + SourceExtension "GL_NV_mesh_shader" + Name 4 "main" + Name 8 "iid" + Name 11 "gl_LocalInvocationID" + Name 18 "outBlock" + MemberName 18(outBlock) 0 "gid5" + MemberName 18(outBlock) 1 "gid6" + Name 22 "myblk" + Name 28 "taskBlock" + MemberName 28(taskBlock) 0 "gid1" + MemberName 28(taskBlock) 1 "gid2" + Name 30 "mytask" + Name 36 "bufferBlock" + MemberName 36(bufferBlock) 0 "gid3" + MemberName 36(bufferBlock) 1 "gid4" + Name 38 "mybuf" + Decorate 11(gl_LocalInvocationID) BuiltIn LocalInvocationId + Decorate 18(outBlock) Block + Decorate 22(myblk) Location 0 + Decorate 27 ArrayStride 4 + MemberDecorate 28(taskBlock) 0 PerTaskNV + MemberDecorate 28(taskBlock) 0 Offset 0 + MemberDecorate 28(taskBlock) 1 PerTaskNV + MemberDecorate 28(taskBlock) 1 Offset 16 + Decorate 28(taskBlock) Block + Decorate 35 ArrayStride 4 + MemberDecorate 36(bufferBlock) 0 Offset 0 + MemberDecorate 36(bufferBlock) 1 Offset 16 + Decorate 36(bufferBlock) BufferBlock + Decorate 38(mybuf) DescriptorSet 0 + Decorate 57 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypeVector 6(int) 3 + 10: TypePointer Input 9(ivec3) +11(gl_LocalInvocationID): 10(ptr) Variable Input + 12: 6(int) Constant 0 + 13: TypePointer Input 6(int) + 16: TypeFloat 32 + 17: TypeVector 16(float) 4 + 18(outBlock): TypeStruct 16(float) 17(fvec4) + 19: 6(int) Constant 81 + 20: TypeArray 18(outBlock) 19 + 21: TypePointer Output 20 + 22(myblk): 21(ptr) Variable Output + 24: TypeInt 32 1 + 25: 24(int) Constant 0 + 26: 6(int) Constant 2 + 27: TypeArray 16(float) 26 + 28(taskBlock): TypeStruct 27 17(fvec4) + 29: TypePointer Input 28(taskBlock) + 30(mytask): 29(ptr) Variable Input + 31: 24(int) Constant 1 + 32: TypePointer Input 16(float) + 35: TypeArray 16(float) 26 + 36(bufferBlock): TypeStruct 35 17(fvec4) + 37: TypePointer Uniform 36(bufferBlock) + 38(mybuf): 37(ptr) Variable Uniform + 39: TypePointer Uniform 16(float) + 43: TypePointer Output 16(float) + 46: TypePointer Input 17(fvec4) + 49: TypePointer Uniform 17(fvec4) + 53: TypePointer Output 17(fvec4) + 55: 6(int) Constant 32 + 56: 6(int) Constant 1 + 57: 9(ivec3) ConstantComposite 55 56 56 + 4(main): 2 Function None 3 + 5: Label + 8(iid): 7(ptr) Variable Function + 14: 13(ptr) AccessChain 11(gl_LocalInvocationID) 12 + 15: 6(int) Load 14 + Store 8(iid) 15 + 23: 6(int) Load 8(iid) + 33: 32(ptr) AccessChain 30(mytask) 25 31 + 34: 16(float) Load 33 + 40: 39(ptr) AccessChain 38(mybuf) 25 31 + 41: 16(float) Load 40 + 42: 16(float) FAdd 34 41 + 44: 43(ptr) AccessChain 22(myblk) 23 25 + Store 44 42 + 45: 6(int) Load 8(iid) + 47: 46(ptr) AccessChain 30(mytask) 31 + 48: 17(fvec4) Load 47 + 50: 49(ptr) AccessChain 38(mybuf) 31 + 51: 17(fvec4) Load 50 + 52: 17(fvec4) FAdd 48 51 + 54: 53(ptr) AccessChain 22(myblk) 45 31 + Store 54 52 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.meshShaderUserDefined.mesh.out b/deps/glslang/Test/baseResults/spv.meshShaderUserDefined.mesh.out new file mode 100644 index 00000000..c3ec9150 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.meshShaderUserDefined.mesh.out @@ -0,0 +1,203 @@ +spv.meshShaderUserDefined.mesh +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 138 + + Capability MeshShadingNV + Extension "SPV_NV_mesh_shader" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint MeshNV 4 "main" 11 17 34 101 + ExecutionMode 4 LocalSize 32 1 1 + ExecutionMode 4 OutputVertices 81 + ExecutionMode 4 OutputPrimitivesNV 32 + ExecutionMode 4 OutputTrianglesNV + Source GLSL 450 + SourceExtension "GL_NV_mesh_shader" + Name 4 "main" + Name 8 "iid" + Name 11 "gl_LocalInvocationID" + Name 16 "gid" + Name 17 "gl_WorkGroupID" + Name 30 "myblock" + MemberName 30(myblock) 0 "f" + MemberName 30(myblock) 1 "fArr" + MemberName 30(myblock) 2 "pos" + MemberName 30(myblock) 3 "posArr" + MemberName 30(myblock) 4 "m" + MemberName 30(myblock) 5 "mArr" + Name 34 "blk" + Name 97 "myblock2" + MemberName 97(myblock2) 0 "f" + MemberName 97(myblock2) 1 "pos" + MemberName 97(myblock2) 2 "m" + Name 101 "blk2" + Decorate 11(gl_LocalInvocationID) BuiltIn LocalInvocationId + Decorate 17(gl_WorkGroupID) BuiltIn WorkgroupId + MemberDecorate 30(myblock) 0 PerPrimitiveNV + MemberDecorate 30(myblock) 1 PerPrimitiveNV + MemberDecorate 30(myblock) 2 PerPrimitiveNV + MemberDecorate 30(myblock) 3 PerPrimitiveNV + MemberDecorate 30(myblock) 4 PerPrimitiveNV + MemberDecorate 30(myblock) 5 PerPrimitiveNV + Decorate 30(myblock) Block + Decorate 34(blk) Location 0 + Decorate 97(myblock2) Block + Decorate 101(blk2) Location 20 + Decorate 137 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypeVector 6(int) 3 + 10: TypePointer Input 9(ivec3) +11(gl_LocalInvocationID): 10(ptr) Variable Input + 12: 6(int) Constant 0 + 13: TypePointer Input 6(int) +17(gl_WorkGroupID): 10(ptr) Variable Input + 20: TypeFloat 32 + 21: 6(int) Constant 4 + 22: TypeArray 20(float) 21 + 23: TypeVector 20(float) 3 + 24: TypeVector 20(float) 4 + 25: TypeArray 24(fvec4) 21 + 26: TypeMatrix 24(fvec4) 4 + 27: TypeMatrix 23(fvec3) 3 + 28: 6(int) Constant 2 + 29: TypeArray 27 28 + 30(myblock): TypeStruct 20(float) 22 23(fvec3) 25 26 29 + 31: 6(int) Constant 32 + 32: TypeArray 30(myblock) 31 + 33: TypePointer Output 32 + 34(blk): 33(ptr) Variable Output + 36: TypeInt 32 1 + 37: 36(int) Constant 0 + 38: 20(float) Constant 1093664768 + 39: TypePointer Output 20(float) + 42: 6(int) Constant 1 + 44: 36(int) Constant 1 + 52: 36(int) Constant 2 + 53: 20(float) Constant 1096810496 + 54: 20(float) Constant 1097859072 + 55: 20(float) Constant 1095761920 + 56: 23(fvec3) ConstantComposite 53 54 55 + 57: TypePointer Output 23(fvec3) + 63: 36(int) Constant 3 + 68: TypePointer Output 24(fvec4) + 74: 36(int) Constant 4 + 75: 20(float) Constant 1098907648 + 76: 24(fvec4) ConstantComposite 55 53 54 75 + 81: 36(int) Constant 5 + 84: 6(int) Constant 3 + 91: 20(float) Constant 1099431936 + 92: 20(float) Constant 1099956224 + 93: 20(float) Constant 1100480512 + 94: 23(fvec3) ConstantComposite 91 92 93 + 96: 6(int) Constant 264 + 97(myblock2): TypeStruct 20(float) 24(fvec4) 26 + 98: 6(int) Constant 81 + 99: TypeArray 97(myblock2) 98 + 100: TypePointer Output 99 + 101(blk2): 100(ptr) Variable Output + 107: 20(float) Constant 1101004800 + 111: 20(float) Constant 1101529088 + 112: 20(float) Constant 1102053376 + 113: 20(float) Constant 1102577664 + 114: 20(float) Constant 1103101952 + 115: 24(fvec4) ConstantComposite 111 112 113 114 + 127: 20(float) Constant 1105723392 + 137: 9(ivec3) ConstantComposite 31 42 42 + 4(main): 2 Function None 3 + 5: Label + 8(iid): 7(ptr) Variable Function + 16(gid): 7(ptr) Variable Function + 14: 13(ptr) AccessChain 11(gl_LocalInvocationID) 12 + 15: 6(int) Load 14 + Store 8(iid) 15 + 18: 13(ptr) AccessChain 17(gl_WorkGroupID) 12 + 19: 6(int) Load 18 + Store 16(gid) 19 + 35: 6(int) Load 8(iid) + 40: 39(ptr) AccessChain 34(blk) 35 37 + Store 40 38 + 41: 6(int) Load 8(iid) + 43: 6(int) IAdd 41 42 + 45: 6(int) Load 16(gid) + 46: 6(int) Load 8(iid) + 47: 39(ptr) AccessChain 34(blk) 46 37 + 48: 20(float) Load 47 + 49: 39(ptr) AccessChain 34(blk) 43 44 45 + Store 49 48 + 50: 6(int) Load 8(iid) + 51: 6(int) UDiv 50 28 + 58: 57(ptr) AccessChain 34(blk) 51 52 + 59: 23(fvec3) Load 58 + 60: 23(fvec3) VectorShuffle 59 56 5 3 4 + Store 58 60 + 61: 6(int) Load 8(iid) + 62: 6(int) IMul 61 28 + 64: 6(int) Load 8(iid) + 65: 6(int) UDiv 64 28 + 66: 57(ptr) AccessChain 34(blk) 65 52 + 67: 23(fvec3) Load 66 + 69: 68(ptr) AccessChain 34(blk) 62 63 44 + 70: 24(fvec4) Load 69 + 71: 24(fvec4) VectorShuffle 70 67 0 4 5 6 + Store 69 71 + 72: 6(int) Load 8(iid) + 73: 6(int) UDiv 72 21 + 77: 68(ptr) AccessChain 34(blk) 73 74 52 + 78: 24(fvec4) Load 77 + 79: 24(fvec4) VectorShuffle 78 76 7 6 5 4 + Store 77 79 + 80: 6(int) Load 8(iid) + 82: 6(int) Load 8(iid) + 83: 6(int) UDiv 82 21 + 85: 39(ptr) AccessChain 34(blk) 83 74 52 84 + 86: 20(float) Load 85 + 87: 39(ptr) AccessChain 34(blk) 80 81 37 44 42 + Store 87 86 + 88: 6(int) Load 8(iid) + 89: 6(int) IMul 88 21 + 90: 6(int) Load 16(gid) + 95: 57(ptr) AccessChain 34(blk) 89 81 44 90 + Store 95 94 + MemoryBarrier 42 96 + ControlBarrier 28 28 96 + 102: 6(int) Load 8(iid) + 103: 6(int) Load 8(iid) + 104: 6(int) ISub 103 42 + 105: 39(ptr) AccessChain 101(blk2) 104 37 + 106: 20(float) Load 105 + 108: 20(float) FAdd 106 107 + 109: 39(ptr) AccessChain 101(blk2) 102 37 + Store 109 108 + 110: 6(int) Load 8(iid) + 116: 68(ptr) AccessChain 101(blk2) 110 44 + Store 116 115 + 117: 6(int) Load 8(iid) + 118: 6(int) IAdd 117 42 + 119: 6(int) Load 16(gid) + 120: 6(int) Load 8(iid) + 121: 68(ptr) AccessChain 101(blk2) 120 44 + 122: 24(fvec4) Load 121 + 123: 68(ptr) AccessChain 101(blk2) 118 52 119 + Store 123 122 + 124: 6(int) Load 8(iid) + 125: 6(int) IAdd 124 42 + 126: 6(int) Load 16(gid) + 128: 39(ptr) AccessChain 101(blk2) 125 52 126 28 + Store 128 127 + 129: 6(int) Load 8(iid) + 130: 6(int) IAdd 129 28 + 131: 6(int) Load 8(iid) + 132: 6(int) IAdd 131 42 + 133: 6(int) Load 16(gid) + 134: 68(ptr) AccessChain 101(blk2) 132 52 133 + 135: 24(fvec4) Load 134 + 136: 68(ptr) AccessChain 101(blk2) 130 52 63 + Store 136 135 + MemoryBarrier 42 96 + ControlBarrier 28 28 96 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.meshTaskShader.task.out b/deps/glslang/Test/baseResults/spv.meshTaskShader.task.out new file mode 100644 index 00000000..9ac27fa9 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.meshTaskShader.task.out @@ -0,0 +1,172 @@ +spv.meshTaskShader.task +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 104 + + Capability StorageImageWriteWithoutFormat + Capability MeshShadingNV + Extension "SPV_NV_mesh_shader" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TaskNV 4 "main" 11 17 80 101 + ExecutionMode 4 LocalSize 32 1 1 + Source GLSL 450 + SourceExtension "GL_NV_mesh_shader" + Name 4 "main" + Name 8 "iid" + Name 11 "gl_LocalInvocationID" + Name 16 "gid" + Name 17 "gl_WorkGroupID" + Name 20 "i" + Name 34 "mem" + Name 37 "block0" + MemberName 37(block0) 0 "uni_value" + Name 39 "" + Name 55 "uni_image" + Name 78 "Task" + MemberName 78(Task) 0 "dummy" + MemberName 78(Task) 1 "submesh" + Name 80 "mytask" + Name 101 "gl_TaskCountNV" + Decorate 11(gl_LocalInvocationID) BuiltIn LocalInvocationId + Decorate 17(gl_WorkGroupID) BuiltIn WorkgroupId + MemberDecorate 37(block0) 0 Offset 0 + Decorate 37(block0) Block + Decorate 39 DescriptorSet 0 + Decorate 55(uni_image) DescriptorSet 0 + Decorate 55(uni_image) Binding 0 + Decorate 55(uni_image) NonReadable + Decorate 77 ArrayStride 8 + MemberDecorate 78(Task) 0 PerTaskNV + MemberDecorate 78(Task) 0 Offset 0 + MemberDecorate 78(Task) 1 PerTaskNV + MemberDecorate 78(Task) 1 Offset 8 + Decorate 78(Task) Block + Decorate 101(gl_TaskCountNV) BuiltIn TaskCountNV + Decorate 103 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypeVector 6(int) 3 + 10: TypePointer Input 9(ivec3) +11(gl_LocalInvocationID): 10(ptr) Variable Input + 12: 6(int) Constant 0 + 13: TypePointer Input 6(int) +17(gl_WorkGroupID): 10(ptr) Variable Input + 27: 6(int) Constant 10 + 28: TypeBool + 30: TypeFloat 32 + 31: TypeVector 30(float) 4 + 32: TypeArray 31(fvec4) 27 + 33: TypePointer Workgroup 32 + 34(mem): 33(ptr) Variable Workgroup + 37(block0): TypeStruct 6(int) + 38: TypePointer Uniform 37(block0) + 39: 38(ptr) Variable Uniform + 40: TypeInt 32 1 + 41: 40(int) Constant 0 + 42: TypePointer Uniform 6(int) + 48: TypePointer Workgroup 31(fvec4) + 51: 40(int) Constant 1 + 53: TypeImage 30(float) 2D nonsampled format:Unknown + 54: TypePointer UniformConstant 53 + 55(uni_image): 54(ptr) Variable UniformConstant + 59: TypeVector 40(int) 2 + 69: 6(int) Constant 1 + 73: 6(int) Constant 264 + 74: 6(int) Constant 2 + 75: TypeVector 30(float) 2 + 76: 6(int) Constant 3 + 77: TypeArray 75(fvec2) 76 + 78(Task): TypeStruct 75(fvec2) 77 + 79: TypePointer Output 78(Task) + 80(mytask): 79(ptr) Variable Output + 81: 30(float) Constant 1106247680 + 82: 30(float) Constant 1106771968 + 83: 75(fvec2) ConstantComposite 81 82 + 84: TypePointer Output 75(fvec2) + 86: 30(float) Constant 1107296256 + 87: 30(float) Constant 1107558400 + 88: 75(fvec2) ConstantComposite 86 87 + 90: 30(float) Constant 1107820544 + 91: 30(float) Constant 1108082688 + 92: 75(fvec2) ConstantComposite 90 91 + 94: 40(int) Constant 2 + 100: TypePointer Output 6(int) +101(gl_TaskCountNV): 100(ptr) Variable Output + 102: 6(int) Constant 32 + 103: 9(ivec3) ConstantComposite 102 69 69 + 4(main): 2 Function None 3 + 5: Label + 8(iid): 7(ptr) Variable Function + 16(gid): 7(ptr) Variable Function + 20(i): 7(ptr) Variable Function + 14: 13(ptr) AccessChain 11(gl_LocalInvocationID) 12 + 15: 6(int) Load 14 + Store 8(iid) 15 + 18: 13(ptr) AccessChain 17(gl_WorkGroupID) 12 + 19: 6(int) Load 18 + Store 16(gid) 19 + Store 20(i) 12 + Branch 21 + 21: Label + LoopMerge 23 24 None + Branch 25 + 25: Label + 26: 6(int) Load 20(i) + 29: 28(bool) ULessThan 26 27 + BranchConditional 29 22 23 + 22: Label + 35: 6(int) Load 20(i) + 36: 6(int) Load 20(i) + 43: 42(ptr) AccessChain 39 41 + 44: 6(int) Load 43 + 45: 6(int) IAdd 36 44 + 46: 30(float) ConvertUToF 45 + 47: 31(fvec4) CompositeConstruct 46 46 46 46 + 49: 48(ptr) AccessChain 34(mem) 35 + Store 49 47 + Branch 24 + 24: Label + 50: 6(int) Load 20(i) + 52: 6(int) IAdd 50 51 + Store 20(i) 52 + Branch 21 + 23: Label + 56: 53 Load 55(uni_image) + 57: 6(int) Load 8(iid) + 58: 40(int) Bitcast 57 + 60: 59(ivec2) CompositeConstruct 58 58 + 61: 6(int) Load 16(gid) + 62: 48(ptr) AccessChain 34(mem) 61 + 63: 31(fvec4) Load 62 + ImageWrite 56 60 63 + 64: 53 Load 55(uni_image) + 65: 6(int) Load 8(iid) + 66: 40(int) Bitcast 65 + 67: 59(ivec2) CompositeConstruct 66 66 + 68: 6(int) Load 16(gid) + 70: 6(int) IAdd 68 69 + 71: 48(ptr) AccessChain 34(mem) 70 + 72: 31(fvec4) Load 71 + ImageWrite 64 67 72 + MemoryBarrier 69 73 + ControlBarrier 74 74 73 + 85: 84(ptr) AccessChain 80(mytask) 41 + Store 85 83 + 89: 84(ptr) AccessChain 80(mytask) 51 41 + Store 89 88 + 93: 84(ptr) AccessChain 80(mytask) 51 51 + Store 93 92 + 95: 6(int) Load 16(gid) + 96: 6(int) UMod 95 74 + 97: 84(ptr) AccessChain 80(mytask) 51 96 + 98: 75(fvec2) Load 97 + 99: 84(ptr) AccessChain 80(mytask) 51 94 + Store 99 98 + MemoryBarrier 69 73 + ControlBarrier 74 74 73 + Store 101(gl_TaskCountNV) 76 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.multiStruct.comp.out b/deps/glslang/Test/baseResults/spv.multiStruct.comp.out new file mode 100644 index 00000000..7e88a590 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.multiStruct.comp.out @@ -0,0 +1,266 @@ +spv.multiStruct.comp +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 161 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" + ExecutionMode 4 LocalSize 1 1 1 + Source GLSL 450 + Name 4 "main" + Name 12 "MyStruct" + MemberName 12(MyStruct) 0 "foo" + MemberName 12(MyStruct) 1 "sb" + Name 14 "t" + Name 16 "MyStruct" + MemberName 16(MyStruct) 0 "foo" + MemberName 16(MyStruct) 1 "sb" + Name 17 "SSBO0" + MemberName 17(SSBO0) 0 "a" + Name 19 "inBuf" + Name 39 "SSBO1" + MemberName 39(SSBO1) 0 "b" + Name 41 "outBuf" + Name 58 "MyStruct" + MemberName 58(MyStruct) 0 "foo" + MemberName 58(MyStruct) 1 "sb" + Name 59 "UBO" + MemberName 59(UBO) 0 "c" + Name 61 "uBuf" + Name 86 "Nested" + MemberName 86(Nested) 0 "f" + MemberName 86(Nested) 1 "S" + Name 88 "n" + Name 90 "Nested" + MemberName 90(Nested) 0 "f" + MemberName 90(Nested) 1 "S" + Name 91 "UBON" + MemberName 91(UBON) 0 "N1" + Name 93 "uBufN" + Name 126 "Nested" + MemberName 126(Nested) 0 "f" + MemberName 126(Nested) 1 "S" + Name 127 "SSBO1N" + MemberName 127(SSBO1N) 0 "N2" + Name 129 "outBufN" + Decorate 15 ArrayStride 8 + MemberDecorate 16(MyStruct) 0 Offset 0 + MemberDecorate 16(MyStruct) 1 Offset 16 + MemberDecorate 17(SSBO0) 0 Offset 0 + Decorate 17(SSBO0) BufferBlock + Decorate 19(inBuf) DescriptorSet 0 + Decorate 19(inBuf) Binding 0 + MemberDecorate 39(SSBO1) 0 Offset 0 + Decorate 39(SSBO1) BufferBlock + Decorate 41(outBuf) DescriptorSet 0 + Decorate 41(outBuf) Binding 1 + Decorate 57 ArrayStride 16 + MemberDecorate 58(MyStruct) 0 Offset 0 + MemberDecorate 58(MyStruct) 1 Offset 32 + MemberDecorate 59(UBO) 0 Offset 0 + Decorate 59(UBO) Block + Decorate 61(uBuf) DescriptorSet 0 + Decorate 61(uBuf) Binding 2 + Decorate 89 ArrayStride 48 + MemberDecorate 90(Nested) 0 Offset 0 + MemberDecorate 90(Nested) 1 Offset 16 + MemberDecorate 91(UBON) 0 Offset 0 + Decorate 91(UBON) Block + Decorate 93(uBufN) DescriptorSet 0 + Decorate 93(uBufN) Binding 2 + Decorate 125 ArrayStride 24 + MemberDecorate 126(Nested) 0 Offset 0 + MemberDecorate 126(Nested) 1 Offset 8 + MemberDecorate 127(SSBO1N) 0 Offset 0 + Decorate 127(SSBO1N) BufferBlock + Decorate 129(outBufN) DescriptorSet 0 + Decorate 129(outBufN) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypeInt 32 0 + 9: 8(int) Constant 2 + 10: TypeArray 7(fvec2) 9 + 11: TypeBool + 12(MyStruct): TypeStruct 10 11(bool) + 13: TypePointer Function 12(MyStruct) + 15: TypeArray 7(fvec2) 9 + 16(MyStruct): TypeStruct 15 8(int) + 17(SSBO0): TypeStruct 16(MyStruct) + 18: TypePointer Uniform 17(SSBO0) + 19(inBuf): 18(ptr) Variable Uniform + 20: TypeInt 32 1 + 21: 20(int) Constant 0 + 22: TypePointer Uniform 16(MyStruct) + 26: TypePointer Function 10 + 29: TypePointer Function 7(fvec2) + 32: 20(int) Constant 1 + 35: 8(int) Constant 0 + 37: TypePointer Function 11(bool) + 39(SSBO1): TypeStruct 16(MyStruct) + 40: TypePointer Uniform 39(SSBO1) + 41(outBuf): 40(ptr) Variable Uniform + 45: TypePointer Uniform 15 + 48: TypePointer Uniform 7(fvec2) + 53: 8(int) Constant 1 + 55: TypePointer Uniform 8(int) + 57: TypeArray 7(fvec2) 9 + 58(MyStruct): TypeStruct 57 8(int) + 59(UBO): TypeStruct 58(MyStruct) + 60: TypePointer Uniform 59(UBO) + 61(uBuf): 60(ptr) Variable Uniform + 62: TypePointer Uniform 58(MyStruct) + 85: TypeArray 12(MyStruct) 9 + 86(Nested): TypeStruct 6(float) 85 + 87: TypePointer Function 86(Nested) + 89: TypeArray 58(MyStruct) 9 + 90(Nested): TypeStruct 6(float) 89 + 91(UBON): TypeStruct 90(Nested) + 92: TypePointer Uniform 91(UBON) + 93(uBufN): 92(ptr) Variable Uniform + 94: TypePointer Uniform 90(Nested) + 98: TypePointer Function 6(float) + 101: TypePointer Function 85 + 125: TypeArray 16(MyStruct) 9 + 126(Nested): TypeStruct 6(float) 125 + 127(SSBO1N): TypeStruct 126(Nested) + 128: TypePointer Uniform 127(SSBO1N) + 129(outBufN): 128(ptr) Variable Uniform + 131: TypePointer Uniform 126(Nested) + 134: TypePointer Uniform 6(float) + 137: TypePointer Uniform 125 + 4(main): 2 Function None 3 + 5: Label + 14(t): 13(ptr) Variable Function + 88(n): 87(ptr) Variable Function + 23: 22(ptr) AccessChain 19(inBuf) 21 + 24:16(MyStruct) Load 23 + 25: 15 CompositeExtract 24 0 + 27: 26(ptr) AccessChain 14(t) 21 + 28: 7(fvec2) CompositeExtract 25 0 + 30: 29(ptr) AccessChain 27 21 + Store 30 28 + 31: 7(fvec2) CompositeExtract 25 1 + 33: 29(ptr) AccessChain 27 32 + Store 33 31 + 34: 8(int) CompositeExtract 24 1 + 36: 11(bool) INotEqual 34 35 + 38: 37(ptr) AccessChain 14(t) 32 + Store 38 36 + 42:12(MyStruct) Load 14(t) + 43: 22(ptr) AccessChain 41(outBuf) 21 + 44: 10 CompositeExtract 42 0 + 46: 45(ptr) AccessChain 43 21 + 47: 7(fvec2) CompositeExtract 44 0 + 49: 48(ptr) AccessChain 46 21 + Store 49 47 + 50: 7(fvec2) CompositeExtract 44 1 + 51: 48(ptr) AccessChain 46 32 + Store 51 50 + 52: 11(bool) CompositeExtract 42 1 + 54: 8(int) Select 52 53 35 + 56: 55(ptr) AccessChain 43 32 + Store 56 54 + 63: 62(ptr) AccessChain 61(uBuf) 21 + 64:58(MyStruct) Load 63 + 65: 57 CompositeExtract 64 0 + 66: 26(ptr) AccessChain 14(t) 21 + 67: 7(fvec2) CompositeExtract 65 0 + 68: 29(ptr) AccessChain 66 21 + Store 68 67 + 69: 7(fvec2) CompositeExtract 65 1 + 70: 29(ptr) AccessChain 66 32 + Store 70 69 + 71: 8(int) CompositeExtract 64 1 + 72: 11(bool) INotEqual 71 35 + 73: 37(ptr) AccessChain 14(t) 32 + Store 73 72 + 74:12(MyStruct) Load 14(t) + 75: 22(ptr) AccessChain 41(outBuf) 21 + 76: 10 CompositeExtract 74 0 + 77: 45(ptr) AccessChain 75 21 + 78: 7(fvec2) CompositeExtract 76 0 + 79: 48(ptr) AccessChain 77 21 + Store 79 78 + 80: 7(fvec2) CompositeExtract 76 1 + 81: 48(ptr) AccessChain 77 32 + Store 81 80 + 82: 11(bool) CompositeExtract 74 1 + 83: 8(int) Select 82 53 35 + 84: 55(ptr) AccessChain 75 32 + Store 84 83 + 95: 94(ptr) AccessChain 93(uBufN) 21 + 96: 90(Nested) Load 95 + 97: 6(float) CompositeExtract 96 0 + 99: 98(ptr) AccessChain 88(n) 21 + Store 99 97 + 100: 89 CompositeExtract 96 1 + 102: 101(ptr) AccessChain 88(n) 32 + 103:58(MyStruct) CompositeExtract 100 0 + 104: 13(ptr) AccessChain 102 21 + 105: 57 CompositeExtract 103 0 + 106: 26(ptr) AccessChain 104 21 + 107: 7(fvec2) CompositeExtract 105 0 + 108: 29(ptr) AccessChain 106 21 + Store 108 107 + 109: 7(fvec2) CompositeExtract 105 1 + 110: 29(ptr) AccessChain 106 32 + Store 110 109 + 111: 8(int) CompositeExtract 103 1 + 112: 11(bool) INotEqual 111 35 + 113: 37(ptr) AccessChain 104 32 + Store 113 112 + 114:58(MyStruct) CompositeExtract 100 1 + 115: 13(ptr) AccessChain 102 32 + 116: 57 CompositeExtract 114 0 + 117: 26(ptr) AccessChain 115 21 + 118: 7(fvec2) CompositeExtract 116 0 + 119: 29(ptr) AccessChain 117 21 + Store 119 118 + 120: 7(fvec2) CompositeExtract 116 1 + 121: 29(ptr) AccessChain 117 32 + Store 121 120 + 122: 8(int) CompositeExtract 114 1 + 123: 11(bool) INotEqual 122 35 + 124: 37(ptr) AccessChain 115 32 + Store 124 123 + 130: 86(Nested) Load 88(n) + 132: 131(ptr) AccessChain 129(outBufN) 21 + 133: 6(float) CompositeExtract 130 0 + 135: 134(ptr) AccessChain 132 21 + Store 135 133 + 136: 85 CompositeExtract 130 1 + 138: 137(ptr) AccessChain 132 32 + 139:12(MyStruct) CompositeExtract 136 0 + 140: 22(ptr) AccessChain 138 21 + 141: 10 CompositeExtract 139 0 + 142: 45(ptr) AccessChain 140 21 + 143: 7(fvec2) CompositeExtract 141 0 + 144: 48(ptr) AccessChain 142 21 + Store 144 143 + 145: 7(fvec2) CompositeExtract 141 1 + 146: 48(ptr) AccessChain 142 32 + Store 146 145 + 147: 11(bool) CompositeExtract 139 1 + 148: 8(int) Select 147 53 35 + 149: 55(ptr) AccessChain 140 32 + Store 149 148 + 150:12(MyStruct) CompositeExtract 136 1 + 151: 22(ptr) AccessChain 138 32 + 152: 10 CompositeExtract 150 0 + 153: 45(ptr) AccessChain 151 21 + 154: 7(fvec2) CompositeExtract 152 0 + 155: 48(ptr) AccessChain 153 21 + Store 155 154 + 156: 7(fvec2) CompositeExtract 152 1 + 157: 48(ptr) AccessChain 153 32 + Store 157 156 + 158: 11(bool) CompositeExtract 150 1 + 159: 8(int) Select 158 53 35 + 160: 55(ptr) AccessChain 151 32 + Store 160 159 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.multiStructFuncall.frag.out b/deps/glslang/Test/baseResults/spv.multiStructFuncall.frag.out new file mode 100644 index 00000000..14c851ca --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.multiStructFuncall.frag.out @@ -0,0 +1,119 @@ +spv.multiStructFuncall.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 66 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "S" + MemberName 9(S) 0 "m" + Name 12 "fooConst(struct-S-mf441;" + Name 11 "s" + Name 17 "foo(struct-S-mf441;" + Name 16 "s" + Name 20 "fooOut(struct-S-mf441;" + Name 19 "s" + Name 22 "S" + MemberName 22(S) 0 "m" + Name 23 "blockName" + MemberName 23(blockName) 0 "s1" + Name 25 "" + Name 31 "S" + MemberName 31(S) 0 "m" + Name 32 "arg" + Name 39 "s2" + Name 42 "param" + Name 48 "param" + Name 51 "param" + Name 62 "param" + MemberDecorate 22(S) 0 ColMajor + MemberDecorate 22(S) 0 Offset 0 + MemberDecorate 22(S) 0 MatrixStride 16 + MemberDecorate 23(blockName) 0 Offset 0 + Decorate 23(blockName) BufferBlock + Decorate 25 DescriptorSet 0 + MemberDecorate 31(S) 0 ColMajor + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeMatrix 7(fvec4) 4 + 9(S): TypeStruct 8 + 10: TypeFunction 2 9(S) + 14: TypePointer Function 9(S) + 15: TypeFunction 2 14(ptr) + 22(S): TypeStruct 8 + 23(blockName): TypeStruct 22(S) + 24: TypePointer Uniform 23(blockName) + 25: 24(ptr) Variable Uniform + 26: TypeInt 32 1 + 27: 26(int) Constant 0 + 28: TypePointer Uniform 22(S) + 31(S): TypeStruct 8 + 34: TypePointer Function 8 + 38: TypePointer Private 9(S) + 39(s2): 38(ptr) Variable Private + 60: TypePointer Uniform 8 + 4(main): 2 Function None 3 + 5: Label + 32(arg): 14(ptr) Variable Function + 42(param): 14(ptr) Variable Function + 48(param): 14(ptr) Variable Function + 51(param): 14(ptr) Variable Function + 62(param): 14(ptr) Variable Function + 29: 28(ptr) AccessChain 25 27 + 30: 22(S) Load 29 + 33: 8 CompositeExtract 30 0 + 35: 34(ptr) AccessChain 32(arg) 27 + Store 35 33 + 36: 9(S) Load 32(arg) + 37: 2 FunctionCall 12(fooConst(struct-S-mf441;) 36 + 40: 9(S) Load 39(s2) + 41: 2 FunctionCall 12(fooConst(struct-S-mf441;) 40 + 43: 28(ptr) AccessChain 25 27 + 44: 22(S) Load 43 + 45: 8 CompositeExtract 44 0 + 46: 34(ptr) AccessChain 42(param) 27 + Store 46 45 + 47: 2 FunctionCall 17(foo(struct-S-mf441;) 42(param) + 49: 9(S) Load 39(s2) + Store 48(param) 49 + 50: 2 FunctionCall 17(foo(struct-S-mf441;) 48(param) + 52: 28(ptr) AccessChain 25 27 + 53: 22(S) Load 52 + 54: 8 CompositeExtract 53 0 + 55: 34(ptr) AccessChain 51(param) 27 + Store 55 54 + 56: 2 FunctionCall 20(fooOut(struct-S-mf441;) 51(param) + 57: 9(S) Load 51(param) + 58: 28(ptr) AccessChain 25 27 + 59: 8 CompositeExtract 57 0 + 61: 60(ptr) AccessChain 58 27 + Store 61 59 + 63: 9(S) Load 39(s2) + Store 62(param) 63 + 64: 2 FunctionCall 20(fooOut(struct-S-mf441;) 62(param) + 65: 9(S) Load 62(param) + Store 39(s2) 65 + Return + FunctionEnd +12(fooConst(struct-S-mf441;): 2 Function None 10 + 11(s): 9(S) FunctionParameter + 13: Label + Return + FunctionEnd +17(foo(struct-S-mf441;): 2 Function None 15 + 16(s): 14(ptr) FunctionParameter + 18: Label + Return + FunctionEnd +20(fooOut(struct-S-mf441;): 2 Function None 15 + 19(s): 14(ptr) FunctionParameter + 21: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.multiView.frag.out b/deps/glslang/Test/baseResults/spv.multiView.frag.out new file mode 100644 index 00000000..9dbd36b9 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.multiView.frag.out @@ -0,0 +1,36 @@ +spv.multiView.frag +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 17 + + Capability Shader + Capability MultiView + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 12 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_multiview" + Name 4 "main" + Name 9 "color" + Name 12 "gl_ViewIndex" + Decorate 12(gl_ViewIndex) Flat + Decorate 12(gl_ViewIndex) BuiltIn ViewIndex + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(color): 8(ptr) Variable Output + 10: TypeInt 32 1 + 11: TypePointer Input 10(int) +12(gl_ViewIndex): 11(ptr) Variable Input + 15: 6(float) Constant 0 + 4(main): 2 Function None 3 + 5: Label + 13: 10(int) Load 12(gl_ViewIndex) + 14: 6(float) ConvertSToF 13 + 16: 7(fvec4) CompositeConstruct 14 15 15 15 + Store 9(color) 16 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.multiviewPerViewAttributes.tesc.out b/deps/glslang/Test/baseResults/spv.multiviewPerViewAttributes.tesc.out new file mode 100644 index 00000000..7874b946 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.multiviewPerViewAttributes.tesc.out @@ -0,0 +1,79 @@ +spv.multiviewPerViewAttributes.tesc +error: SPIRV-Tools Validation Errors +error: OpMemberName Member '5' index is larger than Type '27[gl_PositionPerViewNV]'s member count. + OpMemberName %gl_PerVertex_0 5 "gl_PositionPerViewNV" + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 37 + + Capability Tessellation + Capability PerViewAttributesNV + Extension "SPV_NVX_multiview_per_view_attributes" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "main" 17 19 31 + ExecutionMode 4 OutputVertices 4 + Source GLSL 450 + SourceExtension "GL_NVX_multiview_per_view_attributes" + Name 4 "main" + Name 13 "gl_PerVertex" + MemberName 13(gl_PerVertex) 0 "gl_PositionPerViewNV" + MemberName 13(gl_PerVertex) 1 "gl_ViewportMaskPerViewNV" + Name 17 "gl_out" + Name 19 "gl_InvocationID" + Name 27 "gl_PerVertex" + MemberName 27(gl_PerVertex) 0 "gl_Position" + MemberName 27(gl_PerVertex) 1 "gl_PointSize" + MemberName 27(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 27(gl_PerVertex) 3 "gl_CullDistance" + MemberName 27(gl_PerVertex) 5 "gl_PositionPerViewNV" + Name 31 "gl_in" + MemberDecorate 13(gl_PerVertex) 0 BuiltIn PositionPerViewNV + MemberDecorate 13(gl_PerVertex) 1 BuiltIn ViewportMaskPerViewNV + Decorate 13(gl_PerVertex) Block + Decorate 19(gl_InvocationID) BuiltIn InvocationId + MemberDecorate 27(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 27(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 27(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 27(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 27(gl_PerVertex) Block + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 0 + 9: 8(int) Constant 1 + 10: TypeArray 7(fvec4) 9 + 11: TypeInt 32 1 + 12: TypeArray 11(int) 9 +13(gl_PerVertex): TypeStruct 10 12 + 14: 8(int) Constant 4 + 15: TypeArray 13(gl_PerVertex) 14 + 16: TypePointer Output 15 + 17(gl_out): 16(ptr) Variable Output + 18: TypePointer Input 11(int) +19(gl_InvocationID): 18(ptr) Variable Input + 21: 11(int) Constant 1 + 22: 11(int) Constant 0 + 23: TypePointer Output 11(int) + 26: TypeArray 6(float) 9 +27(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 26 26 10 + 28: 8(int) Constant 32 + 29: TypeArray 27(gl_PerVertex) 28 + 30: TypePointer Input 29 + 31(gl_in): 30(ptr) Variable Input + 32: TypePointer Input 7(fvec4) + 35: TypePointer Output 7(fvec4) + 4(main): 2 Function None 3 + 5: Label + 20: 11(int) Load 19(gl_InvocationID) + 24: 23(ptr) AccessChain 17(gl_out) 20 21 22 + Store 24 21 + 25: 11(int) Load 19(gl_InvocationID) + 33: 32(ptr) AccessChain 31(gl_in) 21 22 + 34: 7(fvec4) Load 33 + 36: 35(ptr) AccessChain 17(gl_out) 25 22 22 + Store 36 34 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.multiviewPerViewAttributes.vert.out b/deps/glslang/Test/baseResults/spv.multiviewPerViewAttributes.vert.out new file mode 100644 index 00000000..c8377cfa --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.multiviewPerViewAttributes.vert.out @@ -0,0 +1,60 @@ +spv.multiviewPerViewAttributes.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 29 + + Capability Shader + Capability PerViewAttributesNV + Extension "SPV_NVX_multiview_per_view_attributes" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 11 20 24 + Source GLSL 450 + SourceExtension "GL_NVX_multiview_per_view_attributes" + Name 4 "main" + Name 11 "gl_ViewportMaskPerViewNV" + Name 20 "gl_PositionPerViewNV" + Name 22 "gl_PerVertex" + MemberName 22(gl_PerVertex) 0 "gl_Position" + MemberName 22(gl_PerVertex) 1 "gl_PointSize" + MemberName 22(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 22(gl_PerVertex) 3 "gl_CullDistance" + Name 24 "" + Decorate 11(gl_ViewportMaskPerViewNV) BuiltIn ViewportMaskPerViewNV + Decorate 20(gl_PositionPerViewNV) BuiltIn PositionPerViewNV + MemberDecorate 22(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 22(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 22(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 22(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 22(gl_PerVertex) Block + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeInt 32 0 + 8: 7(int) Constant 1 + 9: TypeArray 6(int) 8 + 10: TypePointer Output 9 +11(gl_ViewportMaskPerViewNV): 10(ptr) Variable Output + 12: 6(int) Constant 0 + 13: 6(int) Constant 1 + 14: TypePointer Output 6(int) + 16: TypeFloat 32 + 17: TypeVector 16(float) 4 + 18: TypeArray 17(fvec4) 8 + 19: TypePointer Output 18 +20(gl_PositionPerViewNV): 19(ptr) Variable Output + 21: TypeArray 16(float) 8 +22(gl_PerVertex): TypeStruct 17(fvec4) 16(float) 21 21 + 23: TypePointer Output 22(gl_PerVertex) + 24: 23(ptr) Variable Output + 25: TypePointer Output 17(fvec4) + 4(main): 2 Function None 3 + 5: Label + 15: 14(ptr) AccessChain 11(gl_ViewportMaskPerViewNV) 12 + Store 15 13 + 26: 25(ptr) AccessChain 24 12 + 27: 17(fvec4) Load 26 + 28: 25(ptr) AccessChain 20(gl_PositionPerViewNV) 12 + Store 28 27 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.newTexture.frag.out b/deps/glslang/Test/baseResults/spv.newTexture.frag.out new file mode 100644 index 00000000..5e462bed --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.newTexture.frag.out @@ -0,0 +1,385 @@ +spv.newTexture.frag +error: SPIRV-Tools Validation Errors +error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension) + OpCapability SampledRect + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 284 + + Capability Shader + Capability SampledRect + Capability SampledCubeArray + Capability ImageQuery + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 17 26 29 55 81 84 92 253 283 + ExecutionMode 4 OriginUpperLeft + Source GLSL 430 + Name 4 "main" + Name 9 "v" + Name 13 "s2D" + Name 17 "c2D" + Name 23 "sCubeArrayShadow" + Name 26 "c4D" + Name 29 "c1D" + Name 42 "s3D" + Name 51 "s2DArray" + Name 55 "c3D" + Name 64 "s2DShadow" + Name 81 "ic3D" + Name 84 "ic1D" + Name 92 "ic2D" + Name 102 "sr" + Name 128 "sCube" + Name 139 "s2DArrayShadow" + Name 167 "iv" + Name 171 "is2D" + Name 208 "is3D" + Name 220 "isCube" + Name 232 "is2DArray" + Name 243 "iv2" + Name 247 "sCubeShadow" + Name 253 "FragData" + Name 265 "is2Dms" + Name 269 "us2D" + Name 273 "us3D" + Name 277 "usCube" + Name 281 "us2DArray" + Name 283 "ic4D" + Decorate 13(s2D) DescriptorSet 0 + Decorate 23(sCubeArrayShadow) DescriptorSet 0 + Decorate 42(s3D) DescriptorSet 0 + Decorate 51(s2DArray) DescriptorSet 0 + Decorate 64(s2DShadow) DescriptorSet 0 + Decorate 81(ic3D) Flat + Decorate 84(ic1D) Flat + Decorate 92(ic2D) Flat + Decorate 102(sr) DescriptorSet 0 + Decorate 128(sCube) DescriptorSet 0 + Decorate 139(s2DArrayShadow) DescriptorSet 0 + Decorate 171(is2D) DescriptorSet 0 + Decorate 208(is3D) DescriptorSet 0 + Decorate 220(isCube) DescriptorSet 0 + Decorate 232(is2DArray) DescriptorSet 0 + Decorate 247(sCubeShadow) DescriptorSet 0 + Decorate 265(is2Dms) DescriptorSet 0 + Decorate 269(us2D) DescriptorSet 0 + Decorate 273(us3D) DescriptorSet 0 + Decorate 277(usCube) DescriptorSet 0 + Decorate 281(us2DArray) DescriptorSet 0 + Decorate 283(ic4D) Flat + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypeImage 6(float) 2D sampled format:Unknown + 11: TypeSampledImage 10 + 12: TypePointer UniformConstant 11 + 13(s2D): 12(ptr) Variable UniformConstant + 15: TypeVector 6(float) 2 + 16: TypePointer Input 15(fvec2) + 17(c2D): 16(ptr) Variable Input + 20: TypeImage 6(float) Cube depth array sampled format:Unknown + 21: TypeSampledImage 20 + 22: TypePointer UniformConstant 21 +23(sCubeArrayShadow): 22(ptr) Variable UniformConstant + 25: TypePointer Input 7(fvec4) + 26(c4D): 25(ptr) Variable Input + 28: TypePointer Input 6(float) + 29(c1D): 28(ptr) Variable Input + 32: TypeInt 32 0 + 33: 32(int) Constant 1 + 34: TypePointer Function 6(float) + 39: TypeImage 6(float) 3D sampled format:Unknown + 40: TypeSampledImage 39 + 41: TypePointer UniformConstant 40 + 42(s3D): 41(ptr) Variable UniformConstant + 48: TypeImage 6(float) 2D array sampled format:Unknown + 49: TypeSampledImage 48 + 50: TypePointer UniformConstant 49 + 51(s2DArray): 50(ptr) Variable UniformConstant + 53: TypeVector 6(float) 3 + 54: TypePointer Input 53(fvec3) + 55(c3D): 54(ptr) Variable Input + 57: 6(float) Constant 1067030938 + 61: TypeImage 6(float) 2D depth sampled format:Unknown + 62: TypeSampledImage 61 + 63: TypePointer UniformConstant 62 + 64(s2DShadow): 63(ptr) Variable UniformConstant + 67: TypeInt 32 1 + 68: TypeVector 67(int) 2 + 69: 67(int) Constant 3 + 70: 68(ivec2) ConstantComposite 69 69 + 79: TypeVector 67(int) 3 + 80: TypePointer Input 79(ivec3) + 81(ic3D): 80(ptr) Variable Input + 83: TypePointer Input 67(int) + 84(ic1D): 83(ptr) Variable Input + 91: TypePointer Input 68(ivec2) + 92(ic2D): 91(ptr) Variable Input + 94: 67(int) Constant 4 + 99: TypeImage 6(float) Rect sampled format:Unknown + 100: TypeSampledImage 99 + 101: TypePointer UniformConstant 100 + 102(sr): 101(ptr) Variable UniformConstant + 105: 68(ivec2) ConstantComposite 94 94 + 125: TypeImage 6(float) Cube sampled format:Unknown + 126: TypeSampledImage 125 + 127: TypePointer UniformConstant 126 + 128(sCube): 127(ptr) Variable UniformConstant + 136: TypeImage 6(float) 2D depth array sampled format:Unknown + 137: TypeSampledImage 136 + 138: TypePointer UniformConstant 137 +139(s2DArrayShadow): 138(ptr) Variable UniformConstant + 146: 32(int) Constant 0 + 165: TypeVector 67(int) 4 + 166: TypePointer Function 165(ivec4) + 168: TypeImage 67(int) 2D sampled format:Unknown + 169: TypeSampledImage 168 + 170: TypePointer UniformConstant 169 + 171(is2D): 170(ptr) Variable UniformConstant + 205: TypeImage 67(int) 3D sampled format:Unknown + 206: TypeSampledImage 205 + 207: TypePointer UniformConstant 206 + 208(is3D): 207(ptr) Variable UniformConstant + 211: 6(float) Constant 1082549862 + 217: TypeImage 67(int) Cube sampled format:Unknown + 218: TypeSampledImage 217 + 219: TypePointer UniformConstant 218 + 220(isCube): 219(ptr) Variable UniformConstant + 229: TypeImage 67(int) 2D array sampled format:Unknown + 230: TypeSampledImage 229 + 231: TypePointer UniformConstant 230 + 232(is2DArray): 231(ptr) Variable UniformConstant + 242: TypePointer Function 68(ivec2) + 244: TypeImage 6(float) Cube depth sampled format:Unknown + 245: TypeSampledImage 244 + 246: TypePointer UniformConstant 245 +247(sCubeShadow): 246(ptr) Variable UniformConstant + 249: 67(int) Constant 2 + 252: TypePointer Output 7(fvec4) + 253(FragData): 252(ptr) Variable Output + 257: 6(float) Constant 0 + 262: TypeImage 67(int) 2D multi-sampled sampled format:Unknown + 263: TypeSampledImage 262 + 264: TypePointer UniformConstant 263 + 265(is2Dms): 264(ptr) Variable UniformConstant + 266: TypeImage 32(int) 2D sampled format:Unknown + 267: TypeSampledImage 266 + 268: TypePointer UniformConstant 267 + 269(us2D): 268(ptr) Variable UniformConstant + 270: TypeImage 32(int) 3D sampled format:Unknown + 271: TypeSampledImage 270 + 272: TypePointer UniformConstant 271 + 273(us3D): 272(ptr) Variable UniformConstant + 274: TypeImage 32(int) Cube sampled format:Unknown + 275: TypeSampledImage 274 + 276: TypePointer UniformConstant 275 + 277(usCube): 276(ptr) Variable UniformConstant + 278: TypeImage 32(int) 2D array sampled format:Unknown + 279: TypeSampledImage 278 + 280: TypePointer UniformConstant 279 + 281(us2DArray): 280(ptr) Variable UniformConstant + 282: TypePointer Input 165(ivec4) + 283(ic4D): 282(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 9(v): 8(ptr) Variable Function + 167(iv): 166(ptr) Variable Function + 243(iv2): 242(ptr) Variable Function + 14: 11 Load 13(s2D) + 18: 15(fvec2) Load 17(c2D) + 19: 7(fvec4) ImageSampleImplicitLod 14 18 + Store 9(v) 19 + 24: 21 Load 23(sCubeArrayShadow) + 27: 7(fvec4) Load 26(c4D) + 30: 6(float) Load 29(c1D) + 31: 6(float) ImageSampleDrefImplicitLod 24 27 30 + 35: 34(ptr) AccessChain 9(v) 33 + 36: 6(float) Load 35 + 37: 6(float) FAdd 36 31 + 38: 34(ptr) AccessChain 9(v) 33 + Store 38 37 + 43: 40 Load 42(s3D) + 44: 7(fvec4) Load 26(c4D) + 45: 7(fvec4) ImageSampleProjImplicitLod 43 44 + 46: 7(fvec4) Load 9(v) + 47: 7(fvec4) FAdd 46 45 + Store 9(v) 47 + 52: 49 Load 51(s2DArray) + 56: 53(fvec3) Load 55(c3D) + 58: 7(fvec4) ImageSampleExplicitLod 52 56 Lod 57 + 59: 7(fvec4) Load 9(v) + 60: 7(fvec4) FAdd 59 58 + Store 9(v) 60 + 65: 62 Load 64(s2DShadow) + 66: 53(fvec3) Load 55(c3D) + 71: 6(float) Load 29(c1D) + 72: 6(float) CompositeExtract 66 2 + 73: 6(float) ImageSampleDrefImplicitLod 65 66 72 Bias ConstOffset 71 70 + 74: 34(ptr) AccessChain 9(v) 33 + 75: 6(float) Load 74 + 76: 6(float) FAdd 75 73 + 77: 34(ptr) AccessChain 9(v) 33 + Store 77 76 + 78: 40 Load 42(s3D) + 82: 79(ivec3) Load 81(ic3D) + 85: 67(int) Load 84(ic1D) + 86: 39 Image 78 + 87: 7(fvec4) ImageFetch 86 82 Lod 85 + 88: 7(fvec4) Load 9(v) + 89: 7(fvec4) FAdd 88 87 + Store 9(v) 89 + 90: 11 Load 13(s2D) + 93: 68(ivec2) Load 92(ic2D) + 95: 10 Image 90 + 96: 7(fvec4) ImageFetch 95 93 Lod ConstOffset 94 70 + 97: 7(fvec4) Load 9(v) + 98: 7(fvec4) FAdd 97 96 + Store 9(v) 98 + 103: 100 Load 102(sr) + 104: 68(ivec2) Load 92(ic2D) + 106: 99 Image 103 + 107: 7(fvec4) ImageFetch 106 104 ConstOffset 105 + 108: 7(fvec4) Load 9(v) + 109: 7(fvec4) FAdd 108 107 + Store 9(v) 109 + 110: 62 Load 64(s2DShadow) + 111: 53(fvec3) Load 55(c3D) + 112: 6(float) Load 29(c1D) + 113: 6(float) CompositeExtract 111 2 + 114: 6(float) ImageSampleDrefExplicitLod 110 111 113 Lod ConstOffset 112 70 + 115: 34(ptr) AccessChain 9(v) 33 + 116: 6(float) Load 115 + 117: 6(float) FAdd 116 114 + 118: 34(ptr) AccessChain 9(v) 33 + Store 118 117 + 119: 11 Load 13(s2D) + 120: 53(fvec3) Load 55(c3D) + 121: 6(float) Load 29(c1D) + 122: 7(fvec4) ImageSampleProjExplicitLod 119 120 Lod ConstOffset 121 70 + 123: 7(fvec4) Load 9(v) + 124: 7(fvec4) FAdd 123 122 + Store 9(v) 124 + 129: 126 Load 128(sCube) + 130: 53(fvec3) Load 55(c3D) + 131: 53(fvec3) Load 55(c3D) + 132: 53(fvec3) Load 55(c3D) + 133: 7(fvec4) ImageSampleExplicitLod 129 130 Grad 131 132 + 134: 7(fvec4) Load 9(v) + 135: 7(fvec4) FAdd 134 133 + Store 9(v) 135 + 140: 137 Load 139(s2DArrayShadow) + 141: 7(fvec4) Load 26(c4D) + 142: 15(fvec2) Load 17(c2D) + 143: 15(fvec2) Load 17(c2D) + 144: 6(float) CompositeExtract 141 3 + 145: 6(float) ImageSampleDrefExplicitLod 140 141 144 Grad ConstOffset 142 143 70 + 147: 34(ptr) AccessChain 9(v) 146 + 148: 6(float) Load 147 + 149: 6(float) FAdd 148 145 + 150: 34(ptr) AccessChain 9(v) 146 + Store 150 149 + 151: 40 Load 42(s3D) + 152: 7(fvec4) Load 26(c4D) + 153: 53(fvec3) Load 55(c3D) + 154: 53(fvec3) Load 55(c3D) + 155: 7(fvec4) ImageSampleProjExplicitLod 151 152 Grad 153 154 + 156: 7(fvec4) Load 9(v) + 157: 7(fvec4) FAdd 156 155 + Store 9(v) 157 + 158: 11 Load 13(s2D) + 159: 53(fvec3) Load 55(c3D) + 160: 15(fvec2) Load 17(c2D) + 161: 15(fvec2) Load 17(c2D) + 162: 7(fvec4) ImageSampleProjExplicitLod 158 159 Grad ConstOffset 160 161 70 + 163: 7(fvec4) Load 9(v) + 164: 7(fvec4) FAdd 163 162 + Store 9(v) 164 + 172: 169 Load 171(is2D) + 173: 15(fvec2) Load 17(c2D) + 174: 165(ivec4) ImageSampleImplicitLod 172 173 + Store 167(iv) 174 + 175: 165(ivec4) Load 167(iv) + 176: 7(fvec4) ConvertSToF 175 + 177: 7(fvec4) Load 9(v) + 178: 7(fvec4) FAdd 177 176 + Store 9(v) 178 + 179: 169 Load 171(is2D) + 180: 7(fvec4) Load 26(c4D) + 181: 6(float) CompositeExtract 180 3 + 182: 7(fvec4) CompositeInsert 181 180 2 + 183: 165(ivec4) ImageSampleProjImplicitLod 179 182 ConstOffset 70 + Store 167(iv) 183 + 184: 165(ivec4) Load 167(iv) + 185: 7(fvec4) ConvertSToF 184 + 186: 7(fvec4) Load 9(v) + 187: 7(fvec4) FAdd 186 185 + Store 9(v) 187 + 188: 169 Load 171(is2D) + 189: 53(fvec3) Load 55(c3D) + 190: 6(float) Load 29(c1D) + 191: 165(ivec4) ImageSampleProjExplicitLod 188 189 Lod 190 + Store 167(iv) 191 + 192: 165(ivec4) Load 167(iv) + 193: 7(fvec4) ConvertSToF 192 + 194: 7(fvec4) Load 9(v) + 195: 7(fvec4) FAdd 194 193 + Store 9(v) 195 + 196: 169 Load 171(is2D) + 197: 53(fvec3) Load 55(c3D) + 198: 15(fvec2) Load 17(c2D) + 199: 15(fvec2) Load 17(c2D) + 200: 165(ivec4) ImageSampleProjExplicitLod 196 197 Grad 198 199 + Store 167(iv) 200 + 201: 165(ivec4) Load 167(iv) + 202: 7(fvec4) ConvertSToF 201 + 203: 7(fvec4) Load 9(v) + 204: 7(fvec4) FAdd 203 202 + Store 9(v) 204 + 209: 206 Load 208(is3D) + 210: 53(fvec3) Load 55(c3D) + 212: 165(ivec4) ImageSampleImplicitLod 209 210 Bias 211 + Store 167(iv) 212 + 213: 165(ivec4) Load 167(iv) + 214: 7(fvec4) ConvertSToF 213 + 215: 7(fvec4) Load 9(v) + 216: 7(fvec4) FAdd 215 214 + Store 9(v) 216 + 221: 218 Load 220(isCube) + 222: 53(fvec3) Load 55(c3D) + 223: 6(float) Load 29(c1D) + 224: 165(ivec4) ImageSampleExplicitLod 221 222 Lod 223 + Store 167(iv) 224 + 225: 165(ivec4) Load 167(iv) + 226: 7(fvec4) ConvertSToF 225 + 227: 7(fvec4) Load 9(v) + 228: 7(fvec4) FAdd 227 226 + Store 9(v) 228 + 233: 230 Load 232(is2DArray) + 234: 79(ivec3) Load 81(ic3D) + 235: 67(int) Load 84(ic1D) + 236: 229 Image 233 + 237: 165(ivec4) ImageFetch 236 234 Lod 235 + Store 167(iv) 237 + 238: 165(ivec4) Load 167(iv) + 239: 7(fvec4) ConvertSToF 238 + 240: 7(fvec4) Load 9(v) + 241: 7(fvec4) FAdd 240 239 + Store 9(v) 241 + 248: 245 Load 247(sCubeShadow) + 250: 244 Image 248 + 251: 68(ivec2) ImageQuerySizeLod 250 249 + Store 243(iv2) 251 + 254: 7(fvec4) Load 9(v) + 255: 68(ivec2) Load 243(iv2) + 256: 15(fvec2) ConvertSToF 255 + 258: 6(float) CompositeExtract 256 0 + 259: 6(float) CompositeExtract 256 1 + 260: 7(fvec4) CompositeConstruct 258 259 257 257 + 261: 7(fvec4) FAdd 254 260 + Store 253(FragData) 261 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.noBuiltInLoc.vert.out b/deps/glslang/Test/baseResults/spv.noBuiltInLoc.vert.out new file mode 100644 index 00000000..066f81f7 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.noBuiltInLoc.vert.out @@ -0,0 +1,81 @@ +spv.noBuiltInLoc.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 35 + + Capability Shader + Capability AtomicStorage + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 9 11 18 33 34 + Source GLSL 450 + Name 4 "main" + Name 9 "bar" + Name 11 "foo" + Name 16 "gl_PerVertex" + MemberName 16(gl_PerVertex) 0 "gl_Position" + MemberName 16(gl_PerVertex) 1 "gl_PointSize" + MemberName 16(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 16(gl_PerVertex) 3 "gl_CullDistance" + Name 18 "" + Name 24 "uv1" + Name 26 "uv2" + Name 29 "uv3" + Name 31 "a_uint" + Name 33 "gl_VertexID" + Name 34 "gl_InstanceID" + Decorate 9(bar) Location 0 + Decorate 11(foo) Location 0 + MemberDecorate 16(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 16(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 16(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 16(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 16(gl_PerVertex) Block + Decorate 24(uv1) Location 0 + Decorate 24(uv1) DescriptorSet 0 + Decorate 26(uv2) Location 1 + Decorate 26(uv2) DescriptorSet 0 + Decorate 29(uv3) Location 2 + Decorate 29(uv3) DescriptorSet 0 + Decorate 31(a_uint) Offset 0 + Decorate 31(a_uint) DescriptorSet 0 + Decorate 31(a_uint) Binding 0 + Decorate 33(gl_VertexID) BuiltIn VertexId + Decorate 34(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(bar): 8(ptr) Variable Output + 10: TypePointer Input 7(fvec4) + 11(foo): 10(ptr) Variable Input + 13: TypeInt 32 0 + 14: 13(int) Constant 1 + 15: TypeArray 6(float) 14 +16(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 15 15 + 17: TypePointer Output 16(gl_PerVertex) + 18: 17(ptr) Variable Output + 19: TypeInt 32 1 + 20: 19(int) Constant 0 + 23: TypePointer UniformConstant 7(fvec4) + 24(uv1): 23(ptr) Variable UniformConstant + 25: TypePointer UniformConstant 6(float) + 26(uv2): 25(ptr) Variable UniformConstant + 27: TypeVector 6(float) 3 + 28: TypePointer UniformConstant 27(fvec3) + 29(uv3): 28(ptr) Variable UniformConstant + 30: TypePointer AtomicCounter 13(int) + 31(a_uint): 30(ptr) Variable AtomicCounter + 32: TypePointer Input 19(int) + 33(gl_VertexID): 32(ptr) Variable Input +34(gl_InstanceID): 32(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 12: 7(fvec4) Load 11(foo) + Store 9(bar) 12 + 21: 7(fvec4) Load 11(foo) + 22: 8(ptr) AccessChain 18 20 + Store 22 21 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.noDeadDecorations.vert.out b/deps/glslang/Test/baseResults/spv.noDeadDecorations.vert.out new file mode 100644 index 00000000..d7e37027 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.noDeadDecorations.vert.out @@ -0,0 +1,58 @@ +spv.noDeadDecorations.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 32 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 22 + Source ESSL 310 + Name 4 "main" + Name 10 "func(f1;" + Name 9 "a" + Name 20 "gl_PerVertex" + MemberName 20(gl_PerVertex) 0 "gl_Position" + MemberName 20(gl_PerVertex) 1 "gl_PointSize" + Name 22 "" + Name 26 "param" + Decorate 10(func(f1;) RelaxedPrecision + Decorate 9(a) RelaxedPrecision + Decorate 12 RelaxedPrecision + Decorate 13 RelaxedPrecision + MemberDecorate 20(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 20(gl_PerVertex) 1 BuiltIn PointSize + Decorate 20(gl_PerVertex) Block + Decorate 27 RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeFunction 6(float) 7(ptr) + 16: 6(float) Constant 3212836864 + 19: TypeVector 6(float) 4 +20(gl_PerVertex): TypeStruct 19(fvec4) 6(float) + 21: TypePointer Output 20(gl_PerVertex) + 22: 21(ptr) Variable Output + 23: TypeInt 32 1 + 24: 23(int) Constant 0 + 25: 6(float) Constant 0 + 28: TypeInt 32 0 + 29: 28(int) Constant 0 + 30: TypePointer Output 6(float) + 4(main): 2 Function None 3 + 5: Label + 26(param): 7(ptr) Variable Function + Store 26(param) 25 + 27: 6(float) FunctionCall 10(func(f1;) 26(param) + 31: 30(ptr) AccessChain 22 24 29 + Store 31 27 + Return + FunctionEnd + 10(func(f1;): 6(float) Function None 8 + 9(a): 7(ptr) FunctionParameter + 11: Label + 12: 6(float) Load 9(a) + 13: 6(float) FNegate 12 + ReturnValue 13 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.noLocation.vert.out b/deps/glslang/Test/baseResults/spv.noLocation.vert.out new file mode 100644 index 00000000..7a664745 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.noLocation.vert.out @@ -0,0 +1,10 @@ +spv.noLocation.vert +ERROR: spv.noLocation.vert:4: 'location' : SPIR-V requires location for user input/output +ERROR: spv.noLocation.vert:8: 'location' : SPIR-V requires location for user input/output +ERROR: spv.noLocation.vert:19: 'location' : SPIR-V requires location for user input/output +ERROR: spv.noLocation.vert:25: 'location' : SPIR-V requires location for user input/output +ERROR: spv.noLocation.vert:29: 'location' : SPIR-V requires location for user input/output +ERROR: 5 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.noWorkgroup.comp.out b/deps/glslang/Test/baseResults/spv.noWorkgroup.comp.out new file mode 100644 index 00000000..2624fdcd --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.noWorkgroup.comp.out @@ -0,0 +1,28 @@ +spv.noWorkgroup.comp +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 12 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" + ExecutionMode 4 LocalSize 1 1 1 + Source GLSL 450 + Name 4 "main" + Decorate 7 SpecId 18 + Decorate 8 SpecId 10 + Decorate 9 SpecId 19 + Decorate 11 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: 6(int) SpecConstant 1 + 8: 6(int) SpecConstant 1 + 9: 6(int) SpecConstant 1 + 10: TypeVector 6(int) 3 + 11: 10(ivec3) SpecConstantComposite 7 8 9 + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.nonSquare.vert.out b/deps/glslang/Test/baseResults/spv.nonSquare.vert.out new file mode 100644 index 00000000..679a5f0f --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.nonSquare.vert.out @@ -0,0 +1,112 @@ +spv.nonSquare.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 90 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 12 22 28 55 + Source GLSL 140 + Name 4 "main" + Name 9 "a" + Name 12 "v3" + Name 16 "m23" + Name 19 "b" + Name 22 "m32" + Name 28 "gl_Position" + Name 55 "v4" + Decorate 28(gl_Position) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypePointer Function 7(fvec2) + 10: TypeVector 6(float) 3 + 11: TypePointer Input 10(fvec3) + 12(v3): 11(ptr) Variable Input + 14: TypeMatrix 10(fvec3) 2 + 15: TypePointer Function 14 + 20: TypeMatrix 7(fvec2) 3 + 21: TypePointer Output 20 + 22(m32): 21(ptr) Variable Output + 26: TypeVector 6(float) 4 + 27: TypePointer Output 26(fvec4) + 28(gl_Position): 27(ptr) Variable Output + 31: TypeMatrix 10(fvec3) 3 + 35: 6(float) Constant 0 + 40: TypeMatrix 26(fvec4) 4 + 41: 6(float) Constant 1077936128 + 42: 6(float) Constant 1086324736 + 43: 26(fvec4) ConstantComposite 41 42 35 35 + 44: 6(float) Constant 1091567616 + 45: 6(float) Constant 1094713344 + 46: 26(fvec4) ConstantComposite 44 45 35 35 + 47: 6(float) Constant 1097859072 + 48: 6(float) Constant 1099956224 + 49: 26(fvec4) ConstantComposite 47 48 35 35 + 50: 6(float) Constant 1101529088 + 51: 6(float) Constant 1103101952 + 52: 26(fvec4) ConstantComposite 50 51 35 35 + 53: 40 ConstantComposite 43 46 49 52 + 54: TypePointer Input 26(fvec4) + 55(v4): 54(ptr) Variable Input + 59: 6(float) Constant 1112014848 + 60: 6(float) Constant 1121714176 + 61: 6(float) Constant 1126825984 + 62: 6(float) Constant 1130758144 + 63: 26(fvec4) ConstantComposite 59 60 61 62 + 65: 6(float) Constant 1106247680 + 66: 6(float) Constant 1114636288 + 67: 26(fvec4) ConstantComposite 65 66 35 35 + 69: 6(float) Constant 1101004800 + 70: 6(float) Constant 1092616192 + 71: 6(float) Constant 1084227584 + 72: 26(fvec4) ConstantComposite 69 70 42 71 + 74: 7(fvec2) ConstantComposite 70 69 + 75: TypeMatrix 26(fvec4) 2 + 76: 26(fvec4) ConstantComposite 41 35 35 35 + 77: 26(fvec4) ConstantComposite 35 41 35 35 + 78: 75 ConstantComposite 76 77 + 79: TypeMatrix 7(fvec2) 4 + 80: 6(float) Constant 1065353216 + 81: 6(float) Constant 1073741824 + 82: 7(fvec2) ConstantComposite 80 81 + 83: 6(float) Constant 1082130432 + 84: 7(fvec2) ConstantComposite 41 83 + 85: 7(fvec2) ConstantComposite 71 42 + 86: 6(float) Constant 1088421888 + 87: 6(float) Constant 1090519040 + 88: 7(fvec2) ConstantComposite 86 87 + 89: 79 ConstantComposite 82 84 85 88 + 4(main): 2 Function None 3 + 5: Label + 9(a): 8(ptr) Variable Function + 16(m23): 15(ptr) Variable Function + 19(b): 8(ptr) Variable Function + 13: 10(fvec3) Load 12(v3) + 17: 14 Load 16(m23) + 18: 7(fvec2) VectorTimesMatrix 13 17 + Store 9(a) 18 + 23: 20 Load 22(m32) + 24: 10(fvec3) Load 12(v3) + 25: 7(fvec2) MatrixTimesVector 23 24 + Store 19(b) 25 + 29: 14 Load 16(m23) + 30: 20 Load 22(m32) + 32: 31 MatrixTimesMatrix 29 30 + 33: 10(fvec3) Load 12(v3) + 34: 10(fvec3) MatrixTimesVector 32 33 + 36: 6(float) CompositeExtract 34 0 + 37: 6(float) CompositeExtract 34 1 + 38: 6(float) CompositeExtract 34 2 + 39: 26(fvec4) CompositeConstruct 36 37 38 35 + 56: 26(fvec4) Load 55(v4) + 57: 26(fvec4) MatrixTimesVector 53 56 + 58: 26(fvec4) FAdd 39 57 + 64: 26(fvec4) FAdd 58 63 + 68: 26(fvec4) FAdd 64 67 + 73: 26(fvec4) FAdd 68 72 + Store 28(gl_Position) 73 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.nonuniform.frag.out b/deps/glslang/Test/baseResults/spv.nonuniform.frag.out new file mode 100644 index 00000000..972276a6 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.nonuniform.frag.out @@ -0,0 +1,359 @@ +spv.nonuniform.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 210 + + Capability Shader + Capability InputAttachment + Capability SampledBuffer + Capability ImageBuffer + Capability CapabilityShaderNonUniformEXT + Capability CapabilityRuntimeDescriptorArrayEXT + Capability CapabilityInputAttachmentArrayDynamicIndexingEXT + Capability CapabilityUniformTexelBufferArrayDynamicIndexingEXT + Capability CapabilityStorageTexelBufferArrayDynamicIndexingEXT + Capability CapabilityUniformBufferArrayNonUniformIndexingEXT + Capability CapabilitySampledImageArrayNonUniformIndexingEXT + Capability CapabilityStorageBufferArrayNonUniformIndexingEXT + Capability CapabilityStorageImageArrayNonUniformIndexingEXT + Capability CapabilityInputAttachmentArrayNonUniformIndexingEXT + Capability CapabilityUniformTexelBufferArrayNonUniformIndexingEXT + Capability CapabilityStorageTexelBufferArrayNonUniformIndexingEXT + Extension "SPV_EXT_descriptor_indexing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 33 90 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_nonuniform_qualifier" + Name 4 "main" + Name 11 "foo(i1;i1;" + Name 9 "nupi" + Name 10 "f" + Name 16 "a" + Name 17 "nu_li" + Name 18 "param" + Name 20 "param" + Name 30 "b" + Name 33 "nu_inv4" + Name 39 "nu_gf" + Name 45 "inputAttachmentDyn" + Name 46 "dyn_i" + Name 62 "uniformTexelBufferDyn" + Name 76 "storageTexelBufferDyn" + Name 85 "uname" + MemberName 85(uname) 0 "a" + Name 88 "uniformBuffer" + Name 90 "nu_ii" + Name 97 "bname" + MemberName 97(bname) 0 "b" + Name 100 "storageBuffer" + Name 110 "sampledImage" + Name 125 "storageImage" + Name 137 "inputAttachment" + Name 147 "uniformTexelBuffer" + Name 158 "storageTexelBuffer" + Name 168 "v" + Name 183 "uv" + Name 193 "m" + Name 201 "S" + MemberName 201(S) 0 "a" + Name 203 "s" + Decorate 13 DecorationNonUniformEXT + Decorate 17(nu_li) DecorationNonUniformEXT + Decorate 19 DecorationNonUniformEXT + Decorate 23 DecorationNonUniformEXT + Decorate 26 DecorationNonUniformEXT + Decorate 27 DecorationNonUniformEXT + Decorate 33(nu_inv4) Location 0 + Decorate 33(nu_inv4) DecorationNonUniformEXT + Decorate 38 DecorationNonUniformEXT + Decorate 39(nu_gf) DecorationNonUniformEXT + Decorate 40 DecorationNonUniformEXT + Decorate 41 DecorationNonUniformEXT + Decorate 45(inputAttachmentDyn) DescriptorSet 0 + Decorate 45(inputAttachmentDyn) Binding 0 + Decorate 45(inputAttachmentDyn) InputAttachmentIndex 0 + Decorate 62(uniformTexelBufferDyn) DescriptorSet 0 + Decorate 62(uniformTexelBufferDyn) Binding 1 + Decorate 76(storageTexelBufferDyn) DescriptorSet 0 + Decorate 76(storageTexelBufferDyn) Binding 2 + MemberDecorate 85(uname) 0 Offset 0 + Decorate 85(uname) Block + Decorate 88(uniformBuffer) DescriptorSet 0 + Decorate 88(uniformBuffer) Binding 3 + Decorate 90(nu_ii) Flat + Decorate 90(nu_ii) Location 1 + Decorate 90(nu_ii) DecorationNonUniformEXT + Decorate 91 DecorationNonUniformEXT + Decorate 94 DecorationNonUniformEXT + MemberDecorate 97(bname) 0 Offset 0 + Decorate 97(bname) BufferBlock + Decorate 100(storageBuffer) DescriptorSet 0 + Decorate 100(storageBuffer) Binding 4 + Decorate 101 DecorationNonUniformEXT + Decorate 103 DecorationNonUniformEXT + Decorate 110(sampledImage) DescriptorSet 0 + Decorate 110(sampledImage) Binding 5 + Decorate 111 DecorationNonUniformEXT + Decorate 114 DecorationNonUniformEXT + Decorate 125(storageImage) DescriptorSet 0 + Decorate 125(storageImage) Binding 6 + Decorate 126 DecorationNonUniformEXT + Decorate 129 DecorationNonUniformEXT + Decorate 137(inputAttachment) DescriptorSet 0 + Decorate 137(inputAttachment) Binding 7 + Decorate 137(inputAttachment) InputAttachmentIndex 1 + Decorate 138 DecorationNonUniformEXT + Decorate 140 DecorationNonUniformEXT + Decorate 147(uniformTexelBuffer) DescriptorSet 0 + Decorate 147(uniformTexelBuffer) Binding 8 + Decorate 148 DecorationNonUniformEXT + Decorate 150 DecorationNonUniformEXT + Decorate 158(storageTexelBuffer) DescriptorSet 0 + Decorate 158(storageTexelBuffer) Binding 9 + Decorate 159 DecorationNonUniformEXT + Decorate 161 DecorationNonUniformEXT + Decorate 168(v) DecorationNonUniformEXT + Decorate 171 DecorationNonUniformEXT + Decorate 173 DecorationNonUniformEXT + Decorate 178 DecorationNonUniformEXT + Decorate 180 DecorationNonUniformEXT + Decorate 184 DecorationNonUniformEXT + Decorate 186 DecorationNonUniformEXT + Decorate 188 DecorationNonUniformEXT + Decorate 193(m) DecorationNonUniformEXT + Decorate 195 DecorationNonUniformEXT + Decorate 203(s) DecorationNonUniformEXT + Decorate 205 DecorationNonUniformEXT + Decorate 207 DecorationNonUniformEXT + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 8: TypeFunction 6(int) 7(ptr) 7(ptr) + 25: 6(int) Constant 2 + 28: TypeFloat 32 + 29: TypePointer Function 28(float) + 31: TypeVector 28(float) 4 + 32: TypePointer Input 31(fvec4) + 33(nu_inv4): 32(ptr) Variable Input + 34: TypeInt 32 0 + 35: 34(int) Constant 0 + 36: TypePointer Input 28(float) + 42: TypeImage 28(float) SubpassData nonsampled format:Unknown + 43: TypeRuntimeArray 42 + 44: TypePointer UniformConstant 43 +45(inputAttachmentDyn): 44(ptr) Variable UniformConstant + 48: TypePointer UniformConstant 42 + 51: 6(int) Constant 0 + 52: TypeVector 6(int) 2 + 53: 52(ivec2) ConstantComposite 51 51 + 58: TypeImage 28(float) Buffer sampled format:Unknown + 59: TypeSampledImage 58 + 60: TypeRuntimeArray 59 + 61: TypePointer UniformConstant 60 +62(uniformTexelBufferDyn): 61(ptr) Variable UniformConstant + 64: TypePointer UniformConstant 59 + 67: 6(int) Constant 1 + 73: TypeImage 28(float) Buffer nonsampled format:R32f + 74: TypeRuntimeArray 73 + 75: TypePointer UniformConstant 74 +76(storageTexelBufferDyn): 75(ptr) Variable UniformConstant + 78: TypePointer UniformConstant 73 + 85(uname): TypeStruct 28(float) + 86: TypeRuntimeArray 85(uname) + 87: TypePointer Uniform 86 +88(uniformBuffer): 87(ptr) Variable Uniform + 89: TypePointer Input 6(int) + 90(nu_ii): 89(ptr) Variable Input + 92: TypePointer Uniform 28(float) + 97(bname): TypeStruct 28(float) + 98: TypeRuntimeArray 97(bname) + 99: TypePointer Uniform 98 +100(storageBuffer): 99(ptr) Variable Uniform + 106: TypeImage 28(float) 2D sampled format:Unknown + 107: TypeSampledImage 106 + 108: TypeRuntimeArray 107 + 109: TypePointer UniformConstant 108 +110(sampledImage): 109(ptr) Variable UniformConstant + 112: TypePointer UniformConstant 107 + 115: TypeVector 28(float) 2 + 116: 28(float) Constant 1056964608 + 117: 115(fvec2) ConstantComposite 116 116 + 122: TypeImage 28(float) 2D nonsampled format:R32f + 123: TypeRuntimeArray 122 + 124: TypePointer UniformConstant 123 +125(storageImage): 124(ptr) Variable UniformConstant + 127: TypePointer UniformConstant 122 + 130: 52(ivec2) ConstantComposite 67 67 + 135: TypeRuntimeArray 42 + 136: TypePointer UniformConstant 135 +137(inputAttachment): 136(ptr) Variable UniformConstant + 145: TypeRuntimeArray 59 + 146: TypePointer UniformConstant 145 +147(uniformTexelBuffer): 146(ptr) Variable UniformConstant + 156: TypeRuntimeArray 73 + 157: TypePointer UniformConstant 156 +158(storageTexelBuffer): 157(ptr) Variable UniformConstant + 166: TypeVector 6(int) 4 + 167: TypePointer Function 166(ivec4) + 169: 34(int) Constant 1 + 176: 34(int) Constant 2 + 191: TypeMatrix 31(fvec4) 4 + 192: TypePointer Function 191 + 201(S): TypeStruct 6(int) + 202: TypePointer Function 201(S) + 4(main): 2 Function None 3 + 5: Label + 16(a): 7(ptr) Variable Function + 17(nu_li): 7(ptr) Variable Function + 18(param): 7(ptr) Variable Function + 20(param): 7(ptr) Variable Function + 30(b): 29(ptr) Variable Function + 39(nu_gf): 29(ptr) Variable Function + 46(dyn_i): 7(ptr) Variable Function + 168(v): 167(ptr) Variable Function + 183(uv): 167(ptr) Variable Function + 193(m): 192(ptr) Variable Function + 203(s): 202(ptr) Variable Function + 19: 6(int) Load 17(nu_li) + Store 18(param) 19 + 21: 6(int) FunctionCall 11(foo(i1;i1;) 18(param) 20(param) + 22: 6(int) Load 20(param) + Store 17(nu_li) 22 + Store 16(a) 21 + 23: 6(int) Load 16(a) + 24: 6(int) Load 16(a) + 26: 6(int) IMul 24 25 + 27: 6(int) IAdd 23 26 + Store 17(nu_li) 27 + 37: 36(ptr) AccessChain 33(nu_inv4) 35 + 38: 28(float) Load 37 + 40: 28(float) Load 39(nu_gf) + 41: 28(float) FMul 38 40 + Store 30(b) 41 + 47: 6(int) Load 46(dyn_i) + 49: 48(ptr) AccessChain 45(inputAttachmentDyn) 47 + 50: 42 Load 49 + 54: 31(fvec4) ImageRead 50 53 + 55: 28(float) CompositeExtract 54 0 + 56: 28(float) Load 30(b) + 57: 28(float) FAdd 56 55 + Store 30(b) 57 + 63: 6(int) Load 46(dyn_i) + 65: 64(ptr) AccessChain 62(uniformTexelBufferDyn) 63 + 66: 59 Load 65 + 68: 58 Image 66 + 69: 31(fvec4) ImageFetch 68 67 + 70: 28(float) CompositeExtract 69 0 + 71: 28(float) Load 30(b) + 72: 28(float) FAdd 71 70 + Store 30(b) 72 + 77: 6(int) Load 46(dyn_i) + 79: 78(ptr) AccessChain 76(storageTexelBufferDyn) 77 + 80: 73 Load 79 + 81: 31(fvec4) ImageRead 80 67 + 82: 28(float) CompositeExtract 81 0 + 83: 28(float) Load 30(b) + 84: 28(float) FAdd 83 82 + Store 30(b) 84 + 91: 6(int) Load 90(nu_ii) + 93: 92(ptr) AccessChain 88(uniformBuffer) 91 51 + 94: 28(float) Load 93 + 95: 28(float) Load 30(b) + 96: 28(float) FAdd 95 94 + Store 30(b) 96 + 101: 6(int) Load 90(nu_ii) + 102: 92(ptr) AccessChain 100(storageBuffer) 101 51 + 103: 28(float) Load 102 + 104: 28(float) Load 30(b) + 105: 28(float) FAdd 104 103 + Store 30(b) 105 + 111: 6(int) Load 90(nu_ii) + 113: 112(ptr) AccessChain 110(sampledImage) 111 + 114: 107 Load 113 + 118: 31(fvec4) ImageSampleImplicitLod 114 117 + 119: 28(float) CompositeExtract 118 0 + 120: 28(float) Load 30(b) + 121: 28(float) FAdd 120 119 + Store 30(b) 121 + 126: 6(int) Load 90(nu_ii) + 128: 127(ptr) AccessChain 125(storageImage) 126 + 129: 122 Load 128 + 131: 31(fvec4) ImageRead 129 130 + 132: 28(float) CompositeExtract 131 0 + 133: 28(float) Load 30(b) + 134: 28(float) FAdd 133 132 + Store 30(b) 134 + 138: 6(int) Load 90(nu_ii) + 139: 48(ptr) AccessChain 137(inputAttachment) 138 + 140: 42 Load 139 + 141: 31(fvec4) ImageRead 140 53 + 142: 28(float) CompositeExtract 141 0 + 143: 28(float) Load 30(b) + 144: 28(float) FAdd 143 142 + Store 30(b) 144 + 148: 6(int) Load 90(nu_ii) + 149: 64(ptr) AccessChain 147(uniformTexelBuffer) 148 + 150: 59 Load 149 + 151: 58 Image 150 + 152: 31(fvec4) ImageFetch 151 67 + 153: 28(float) CompositeExtract 152 0 + 154: 28(float) Load 30(b) + 155: 28(float) FAdd 154 153 + Store 30(b) 155 + 159: 6(int) Load 90(nu_ii) + 160: 78(ptr) AccessChain 158(storageTexelBuffer) 159 + 161: 73 Load 160 + 162: 31(fvec4) ImageRead 161 67 + 163: 28(float) CompositeExtract 162 0 + 164: 28(float) Load 30(b) + 165: 28(float) FAdd 164 163 + Store 30(b) 165 + 170: 7(ptr) AccessChain 168(v) 169 + 171: 6(int) Load 170 + 172: 92(ptr) AccessChain 88(uniformBuffer) 171 51 + 173: 28(float) Load 172 + 174: 28(float) Load 30(b) + 175: 28(float) FAdd 174 173 + Store 30(b) 175 + 177: 7(ptr) AccessChain 168(v) 176 + 178: 6(int) Load 177 + 179: 92(ptr) AccessChain 88(uniformBuffer) 178 51 + 180: 28(float) Load 179 + 181: 28(float) Load 30(b) + 182: 28(float) FAdd 181 180 + Store 30(b) 182 + 184: 6(int) Load 90(nu_ii) + 185: 7(ptr) AccessChain 183(uv) 184 + 186: 6(int) Load 185 + 187: 92(ptr) AccessChain 88(uniformBuffer) 186 51 + 188: 28(float) Load 187 + 189: 28(float) Load 30(b) + 190: 28(float) FAdd 189 188 + Store 30(b) 190 + 194: 29(ptr) AccessChain 193(m) 25 176 + 195: 28(float) Load 194 + 196: 6(int) ConvertFToS 195 + 197: 92(ptr) AccessChain 88(uniformBuffer) 196 51 + 198: 28(float) Load 197 + 199: 28(float) Load 30(b) + 200: 28(float) FAdd 199 198 + Store 30(b) 200 + 204: 7(ptr) AccessChain 203(s) 51 + 205: 6(int) Load 204 + 206: 92(ptr) AccessChain 88(uniformBuffer) 205 51 + 207: 28(float) Load 206 + 208: 28(float) Load 30(b) + 209: 28(float) FAdd 208 207 + Store 30(b) 209 + Return + FunctionEnd + 11(foo(i1;i1;): 6(int) Function None 8 + 9(nupi): 7(ptr) FunctionParameter + 10(f): 7(ptr) FunctionParameter + 12: Label + 13: 6(int) Load 9(nupi) + ReturnValue 13 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.offsets.frag.out b/deps/glslang/Test/baseResults/spv.offsets.frag.out new file mode 100644 index 00000000..17d7b86e --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.offsets.frag.out @@ -0,0 +1,53 @@ +spv.offsets.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 15 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 7 "n1" + MemberName 7(n1) 0 "a" + MemberName 7(n1) 1 "b" + MemberName 7(n1) 2 "c" + MemberName 7(n1) 3 "d" + Name 9 "i1" + Name 12 "n2" + MemberName 12(n2) 0 "e" + MemberName 12(n2) 1 "f" + MemberName 12(n2) 2 "g" + MemberName 12(n2) 3 "h" + Name 14 "i2" + MemberDecorate 7(n1) 0 Offset 8 + MemberDecorate 7(n1) 1 Offset 4 + MemberDecorate 7(n1) 2 Offset 0 + MemberDecorate 7(n1) 3 Offset 12 + Decorate 7(n1) Block + Decorate 9(i1) DescriptorSet 0 + Decorate 9(i1) Binding 0 + MemberDecorate 12(n2) 0 Offset 32 + MemberDecorate 12(n2) 1 Offset 48 + MemberDecorate 12(n2) 2 Offset 16 + MemberDecorate 12(n2) 3 Offset 0 + Decorate 12(n2) BufferBlock + Decorate 14(i2) DescriptorSet 0 + Decorate 14(i2) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7(n1): TypeStruct 6(int) 6(int) 6(int) 6(int) + 8: TypePointer Uniform 7(n1) + 9(i1): 8(ptr) Variable Uniform + 10: TypeFloat 32 + 11: TypeVector 10(float) 3 + 12(n2): TypeStruct 11(fvec3) 11(fvec3) 11(fvec3) 11(fvec3) + 13: TypePointer Uniform 12(n2) + 14(i2): 13(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.paramMemory.frag.out b/deps/glslang/Test/baseResults/spv.paramMemory.frag.out new file mode 100644 index 00000000..a7e627a2 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.paramMemory.frag.out @@ -0,0 +1,141 @@ +spv.paramMemory.frag +error: SPIRV-Tools Validation Errors +error: OpFunctionCall Argument '38[image1]'s type does not match Function '8's parameter type. + %41 = OpFunctionCall %v4float %image_load_I21_vi2_ %image1 %param + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 69 + + Capability Shader + Capability StorageImageReadWithoutFormat + Capability StorageImageWriteWithoutFormat + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 27 66 + ExecutionMode 4 OriginUpperLeft + Source ESSL 310 + Name 4 "main" + Name 16 "image_load(I21;vi2;" + Name 14 "image" + Name 15 "coords" + Name 23 "image_store(I21;vi2;vf4;" + Name 20 "image" + Name 21 "coords" + Name 22 "data" + Name 27 "in_coords" + Name 35 "read1" + Name 38 "image1" + Name 39 "param" + Name 42 "read2" + Name 45 "image2" + Name 46 "param" + Name 49 "image3" + Name 53 "param" + Name 55 "param" + Name 57 "image4" + Name 61 "param" + Name 63 "param" + Name 66 "out_color" + Decorate 14(image) Coherent + Decorate 14(image) NonWritable + Decorate 20(image) Coherent + Decorate 20(image) NonReadable + Decorate 27(in_coords) Flat + Decorate 27(in_coords) Location 0 + Decorate 38(image1) DescriptorSet 0 + Decorate 38(image1) Binding 0 + Decorate 38(image1) Coherent + Decorate 38(image1) NonWritable + Decorate 45(image2) DescriptorSet 0 + Decorate 45(image2) Binding 2 + Decorate 45(image2) NonWritable + Decorate 49(image3) DescriptorSet 0 + Decorate 49(image3) Binding 1 + Decorate 49(image3) Coherent + Decorate 49(image3) NonReadable + Decorate 57(image4) DescriptorSet 0 + Decorate 57(image4) Binding 3 + Decorate 57(image4) NonReadable + Decorate 66(out_color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeImage 6(float) 2D nonsampled format:Unknown + 8: TypePointer UniformConstant 7 + 9: TypeInt 32 1 + 10: TypeVector 9(int) 2 + 11: TypePointer Function 10(ivec2) + 12: TypeVector 6(float) 4 + 13: TypeFunction 12(fvec4) 8(ptr) 11(ptr) + 18: TypePointer Function 12(fvec4) + 19: TypeFunction 2 8(ptr) 11(ptr) 18(ptr) + 26: TypePointer Input 10(ivec2) + 27(in_coords): 26(ptr) Variable Input + 36: TypeImage 6(float) 2D nonsampled format:Rgba32f + 37: TypePointer UniformConstant 36 + 38(image1): 37(ptr) Variable UniformConstant + 43: TypeImage 6(float) 2D nonsampled format:Rgba16f + 44: TypePointer UniformConstant 43 + 45(image2): 44(ptr) Variable UniformConstant + 49(image3): 37(ptr) Variable UniformConstant + 51: 6(float) Constant 1056964608 + 57(image4): 44(ptr) Variable UniformConstant + 59: 6(float) Constant 1073741824 + 65: TypePointer Output 12(fvec4) + 66(out_color): 65(ptr) Variable Output + 67: 6(float) Constant 0 + 68: 12(fvec4) ConstantComposite 67 67 67 67 + 4(main): 2 Function None 3 + 5: Label + 35(read1): 18(ptr) Variable Function + 39(param): 11(ptr) Variable Function + 42(read2): 18(ptr) Variable Function + 46(param): 11(ptr) Variable Function + 53(param): 11(ptr) Variable Function + 55(param): 18(ptr) Variable Function + 61(param): 11(ptr) Variable Function + 63(param): 18(ptr) Variable Function + 40: 10(ivec2) Load 27(in_coords) + Store 39(param) 40 + 41: 12(fvec4) FunctionCall 16(image_load(I21;vi2;) 38(image1) 39(param) + Store 35(read1) 41 + 47: 10(ivec2) Load 27(in_coords) + Store 46(param) 47 + 48: 12(fvec4) FunctionCall 16(image_load(I21;vi2;) 45(image2) 46(param) + Store 42(read2) 48 + 50: 12(fvec4) Load 35(read1) + 52: 12(fvec4) VectorTimesScalar 50 51 + 54: 10(ivec2) Load 27(in_coords) + Store 53(param) 54 + Store 55(param) 52 + 56: 2 FunctionCall 23(image_store(I21;vi2;vf4;) 49(image3) 53(param) 55(param) + 58: 12(fvec4) Load 42(read2) + 60: 12(fvec4) VectorTimesScalar 58 59 + 62: 10(ivec2) Load 27(in_coords) + Store 61(param) 62 + Store 63(param) 60 + 64: 2 FunctionCall 23(image_store(I21;vi2;vf4;) 57(image4) 61(param) 63(param) + Store 66(out_color) 68 + Return + FunctionEnd +16(image_load(I21;vi2;): 12(fvec4) Function None 13 + 14(image): 8(ptr) FunctionParameter + 15(coords): 11(ptr) FunctionParameter + 17: Label + 25: 7 Load 14(image) + 28: 10(ivec2) Load 27(in_coords) + 29: 12(fvec4) ImageRead 25 28 + ReturnValue 29 + FunctionEnd +23(image_store(I21;vi2;vf4;): 2 Function None 19 + 20(image): 8(ptr) FunctionParameter + 21(coords): 11(ptr) FunctionParameter + 22(data): 18(ptr) FunctionParameter + 24: Label + 32: 7 Load 20(image) + 33: 10(ivec2) Load 27(in_coords) + 34: 12(fvec4) Load 22(data) + ImageWrite 32 33 34 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.perprimitiveNV.frag.out b/deps/glslang/Test/baseResults/spv.perprimitiveNV.frag.out new file mode 100644 index 00000000..eaff400c --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.perprimitiveNV.frag.out @@ -0,0 +1,54 @@ +spv.perprimitiveNV.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 23 + + Capability Shader + Capability MeshShadingNV + Extension "SPV_NV_mesh_shader" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 8 11 19 + ExecutionMode 4 OriginUpperLeft + Source GLSL 460 + SourceExtension "GL_NV_mesh_shader" + Name 4 "main" + Name 8 "g" + Name 9 "B" + MemberName 9(B) 0 "f" + Name 11 "" + Name 17 "C" + MemberName 17(C) 0 "h" + Name 19 "" + Decorate 8(g) Location 8 + MemberDecorate 9(B) 0 PerPrimitiveNV + Decorate 9(B) Block + Decorate 11 Location 0 + MemberDecorate 17(C) 0 Flat + MemberDecorate 17(C) 0 Centroid + Decorate 17(C) Block + Decorate 19 Location 4 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Output 6(float) + 8(g): 7(ptr) Variable Output + 9(B): TypeStruct 6(float) + 10: TypePointer Input 9(B) + 11: 10(ptr) Variable Input + 12: TypeInt 32 1 + 13: 12(int) Constant 0 + 14: TypePointer Input 6(float) + 17(C): TypeStruct 6(float) + 18: TypePointer Input 17(C) + 19: 18(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 15: 14(ptr) AccessChain 11 13 + 16: 6(float) Load 15 + 20: 14(ptr) AccessChain 19 13 + 21: 6(float) Load 20 + 22: 6(float) FAdd 16 21 + Store 8(g) 22 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.precise.tesc.out b/deps/glslang/Test/baseResults/spv.precise.tesc.out new file mode 100644 index 00000000..95a048fc --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.precise.tesc.out @@ -0,0 +1,116 @@ +spv.precise.tesc +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 72 + + Capability Tessellation + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "main" 12 15 20 30 40 45 + ExecutionMode 4 OutputVertices 3 + Source ESSL 310 + SourceExtension "GL_EXT_gpu_shader5" + SourceExtension "GL_EXT_shader_io_blocks" + SourceExtension "GL_EXT_tessellation_shader" + Name 4 "main" + Name 12 "in_te_position" + Name 15 "gl_InvocationID" + Name 20 "in_tc_position" + Name 30 "gl_TessLevelInner" + Name 40 "gl_TessLevelOuter" + Name 45 "in_tc_tessParam" + Decorate 12(in_te_position) Location 0 + Decorate 15(gl_InvocationID) BuiltIn InvocationId + Decorate 20(in_tc_position) Location 0 + Decorate 30(gl_TessLevelInner) Patch + Decorate 30(gl_TessLevelInner) BuiltIn TessLevelInner + Decorate 40(gl_TessLevelOuter) Patch + Decorate 40(gl_TessLevelOuter) BuiltIn TessLevelOuter + Decorate 45(in_tc_tessParam) Location 1 + Decorate 52 NoContraction + Decorate 53 NoContraction + Decorate 54 NoContraction + Decorate 60 NoContraction + Decorate 61 NoContraction + Decorate 62 NoContraction + Decorate 68 NoContraction + Decorate 69 NoContraction + Decorate 70 NoContraction + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypeInt 32 0 + 9: 8(int) Constant 3 + 10: TypeArray 7(fvec2) 9 + 11: TypePointer Output 10 +12(in_te_position): 11(ptr) Variable Output + 13: TypeInt 32 1 + 14: TypePointer Input 13(int) +15(gl_InvocationID): 14(ptr) Variable Input + 17: 8(int) Constant 32 + 18: TypeArray 7(fvec2) 17 + 19: TypePointer Input 18 +20(in_tc_position): 19(ptr) Variable Input + 22: TypePointer Input 7(fvec2) + 25: TypePointer Output 7(fvec2) + 27: 8(int) Constant 2 + 28: TypeArray 6(float) 27 + 29: TypePointer Output 28 +30(gl_TessLevelInner): 29(ptr) Variable Output + 31: 13(int) Constant 0 + 32: 6(float) Constant 1084227584 + 33: TypePointer Output 6(float) + 35: 13(int) Constant 1 + 37: 8(int) Constant 4 + 38: TypeArray 6(float) 37 + 39: TypePointer Output 38 +40(gl_TessLevelOuter): 39(ptr) Variable Output + 41: 6(float) Constant 1065353216 + 42: 6(float) Constant 1105985536 + 43: TypeArray 6(float) 17 + 44: TypePointer Input 43 +45(in_tc_tessParam): 44(ptr) Variable Input + 46: TypePointer Input 6(float) + 49: 13(int) Constant 2 + 4(main): 2 Function None 3 + 5: Label + 16: 13(int) Load 15(gl_InvocationID) + 21: 13(int) Load 15(gl_InvocationID) + 23: 22(ptr) AccessChain 20(in_tc_position) 21 + 24: 7(fvec2) Load 23 + 26: 25(ptr) AccessChain 12(in_te_position) 16 + Store 26 24 + 34: 33(ptr) AccessChain 30(gl_TessLevelInner) 31 + Store 34 32 + 36: 33(ptr) AccessChain 30(gl_TessLevelInner) 35 + Store 36 32 + 47: 46(ptr) AccessChain 45(in_tc_tessParam) 35 + 48: 6(float) Load 47 + 50: 46(ptr) AccessChain 45(in_tc_tessParam) 49 + 51: 6(float) Load 50 + 52: 6(float) FAdd 48 51 + 53: 6(float) FMul 42 52 + 54: 6(float) FAdd 41 53 + 55: 33(ptr) AccessChain 40(gl_TessLevelOuter) 31 + Store 55 54 + 56: 46(ptr) AccessChain 45(in_tc_tessParam) 49 + 57: 6(float) Load 56 + 58: 46(ptr) AccessChain 45(in_tc_tessParam) 31 + 59: 6(float) Load 58 + 60: 6(float) FAdd 57 59 + 61: 6(float) FMul 42 60 + 62: 6(float) FAdd 41 61 + 63: 33(ptr) AccessChain 40(gl_TessLevelOuter) 35 + Store 63 62 + 64: 46(ptr) AccessChain 45(in_tc_tessParam) 31 + 65: 6(float) Load 64 + 66: 46(ptr) AccessChain 45(in_tc_tessParam) 35 + 67: 6(float) Load 66 + 68: 6(float) FAdd 65 67 + 69: 6(float) FMul 42 68 + 70: 6(float) FAdd 41 69 + 71: 33(ptr) AccessChain 40(gl_TessLevelOuter) 49 + Store 71 70 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.precise.tese.out b/deps/glslang/Test/baseResults/spv.precise.tese.out new file mode 100644 index 00000000..a73cbd83 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.precise.tese.out @@ -0,0 +1,185 @@ +spv.precise.tese +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 119 + + Capability Tessellation + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationEvaluation 4 "main" 12 21 62 112 + ExecutionMode 4 Triangles + ExecutionMode 4 SpacingEqual + ExecutionMode 4 VertexOrderCcw + Source ESSL 310 + SourceExtension "GL_EXT_gpu_shader5" + SourceExtension "GL_EXT_shader_io_blocks" + SourceExtension "GL_EXT_tessellation_shader" + Name 4 "main" + Name 9 "pos" + Name 12 "gl_TessCoord" + Name 21 "in_te_position" + Name 45 "f" + Name 62 "in_f_color" + Name 73 "bits" + Name 77 "numBits" + Name 78 "i" + Name 110 "gl_PerVertex" + MemberName 110(gl_PerVertex) 0 "gl_Position" + MemberName 110(gl_PerVertex) 1 "gl_PointSize" + Name 112 "" + Decorate 12(gl_TessCoord) BuiltIn TessCoord + Decorate 21(in_te_position) Location 0 + Decorate 27 NoContraction + Decorate 34 NoContraction + Decorate 35 NoContraction + Decorate 42 NoContraction + Decorate 43 NoContraction + Decorate 62(in_f_color) RelaxedPrecision + Decorate 62(in_f_color) Location 0 + Decorate 67 RelaxedPrecision + Decorate 68 RelaxedPrecision + Decorate 69 RelaxedPrecision + Decorate 70 RelaxedPrecision + Decorate 97 NoContraction + Decorate 99 NoContraction + Decorate 101 NoContraction + Decorate 106 NoContraction + Decorate 109 NoContraction + MemberDecorate 110(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 110(gl_PerVertex) 1 BuiltIn PointSize + Decorate 110(gl_PerVertex) Block + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypePointer Function 7(fvec2) + 10: TypeVector 6(float) 3 + 11: TypePointer Input 10(fvec3) +12(gl_TessCoord): 11(ptr) Variable Input + 13: TypeInt 32 0 + 14: 13(int) Constant 0 + 15: TypePointer Input 6(float) + 18: 13(int) Constant 32 + 19: TypeArray 7(fvec2) 18 + 20: TypePointer Input 19 +21(in_te_position): 20(ptr) Variable Input + 22: TypeInt 32 1 + 23: 22(int) Constant 0 + 24: TypePointer Input 7(fvec2) + 28: 13(int) Constant 1 + 31: 22(int) Constant 1 + 36: 13(int) Constant 2 + 39: 22(int) Constant 2 + 44: TypePointer Function 6(float) + 46: 6(float) Constant 1077936128 + 57: 6(float) Constant 1056964608 + 60: TypeVector 6(float) 4 + 61: TypePointer Output 60(fvec4) + 62(in_f_color): 61(ptr) Variable Output + 66: 6(float) Constant 1065353216 + 71: TypeVector 13(int) 2 + 72: TypePointer Function 71(ivec2) + 76: TypePointer Function 13(int) + 85: TypeBool + 105: 6(float) Constant 1025758986 +110(gl_PerVertex): TypeStruct 60(fvec4) 6(float) + 111: TypePointer Output 110(gl_PerVertex) + 112: 111(ptr) Variable Output + 114: 6(float) Constant 0 + 4(main): 2 Function None 3 + 5: Label + 9(pos): 8(ptr) Variable Function + 45(f): 44(ptr) Variable Function + 73(bits): 72(ptr) Variable Function + 77(numBits): 76(ptr) Variable Function + 78(i): 76(ptr) Variable Function + 16: 15(ptr) AccessChain 12(gl_TessCoord) 14 + 17: 6(float) Load 16 + 25: 24(ptr) AccessChain 21(in_te_position) 23 + 26: 7(fvec2) Load 25 + 27: 7(fvec2) VectorTimesScalar 26 17 + 29: 15(ptr) AccessChain 12(gl_TessCoord) 28 + 30: 6(float) Load 29 + 32: 24(ptr) AccessChain 21(in_te_position) 31 + 33: 7(fvec2) Load 32 + 34: 7(fvec2) VectorTimesScalar 33 30 + 35: 7(fvec2) FAdd 27 34 + 37: 15(ptr) AccessChain 12(gl_TessCoord) 36 + 38: 6(float) Load 37 + 40: 24(ptr) AccessChain 21(in_te_position) 39 + 41: 7(fvec2) Load 40 + 42: 7(fvec2) VectorTimesScalar 41 38 + 43: 7(fvec2) FAdd 35 42 + Store 9(pos) 43 + 47: 15(ptr) AccessChain 12(gl_TessCoord) 14 + 48: 6(float) Load 47 + 49: 15(ptr) AccessChain 12(gl_TessCoord) 28 + 50: 6(float) Load 49 + 51: 15(ptr) AccessChain 12(gl_TessCoord) 36 + 52: 6(float) Load 51 + 53: 6(float) ExtInst 1(GLSL.std.450) 37(FMin) 50 52 + 54: 6(float) ExtInst 1(GLSL.std.450) 37(FMin) 48 53 + 55: 6(float) FMul 46 54 + 56: 6(float) ExtInst 1(GLSL.std.450) 31(Sqrt) 55 + 58: 6(float) FMul 56 57 + 59: 6(float) FAdd 58 57 + Store 45(f) 59 + 63: 10(fvec3) Load 12(gl_TessCoord) + 64: 6(float) Load 45(f) + 65: 10(fvec3) VectorTimesScalar 63 64 + 67: 6(float) CompositeExtract 65 0 + 68: 6(float) CompositeExtract 65 1 + 69: 6(float) CompositeExtract 65 2 + 70: 60(fvec4) CompositeConstruct 67 68 69 66 + Store 62(in_f_color) 70 + 74: 7(fvec2) Load 9(pos) + 75: 71(ivec2) Bitcast 74 + Store 73(bits) 75 + Store 77(numBits) 14 + Store 78(i) 14 + Branch 79 + 79: Label + LoopMerge 81 82 None + Branch 83 + 83: Label + 84: 13(int) Load 78(i) + 86: 85(bool) ULessThan 84 18 + BranchConditional 86 80 81 + 80: Label + 87: 76(ptr) AccessChain 73(bits) 14 + 88: 13(int) Load 87 + 89: 13(int) Load 78(i) + 90: 13(int) ShiftLeftLogical 88 89 + 91: 13(int) BitwiseAnd 90 28 + 92: 76(ptr) AccessChain 73(bits) 28 + 93: 13(int) Load 92 + 94: 13(int) Load 78(i) + 95: 13(int) ShiftLeftLogical 93 94 + 96: 13(int) BitwiseAnd 95 28 + 97: 13(int) IAdd 91 96 + 98: 13(int) Load 77(numBits) + 99: 13(int) IAdd 98 97 + Store 77(numBits) 99 + Branch 82 + 82: Label + 100: 13(int) Load 78(i) + 101: 13(int) IAdd 100 31 + Store 78(i) 101 + Branch 79 + 81: Label + 102: 13(int) Load 77(numBits) + 103: 13(int) BitwiseAnd 102 28 + 104: 6(float) ConvertUToF 103 + 106: 6(float) FMul 104 105 + 107: 7(fvec2) Load 9(pos) + 108: 7(fvec2) CompositeConstruct 106 106 + 109: 7(fvec2) FAdd 107 108 + Store 9(pos) 109 + 113: 7(fvec2) Load 9(pos) + 115: 6(float) CompositeExtract 113 0 + 116: 6(float) CompositeExtract 113 1 + 117: 60(fvec4) CompositeConstruct 115 116 114 66 + 118: 61(ptr) AccessChain 112 23 + Store 118 117 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.precision.frag.out b/deps/glslang/Test/baseResults/spv.precision.frag.out new file mode 100644 index 00000000..5ddb4927 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.precision.frag.out @@ -0,0 +1,228 @@ +spv.precision.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 127 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 23 59 61 73 116 + ExecutionMode 4 OriginUpperLeft + Source ESSL 310 + Name 4 "main" + Name 12 "foo(vf3;" + Name 11 "mv3" + Name 19 "boolfun(vb2;" + Name 18 "bv2" + Name 23 "highfin" + Name 38 "sum" + Name 40 "uniform_medium" + Name 42 "uniform_high" + Name 48 "uniform_low" + Name 53 "arg1" + Name 55 "arg2" + Name 57 "d" + Name 59 "lowfin" + Name 61 "mediumfin" + Name 65 "global_highp" + Name 69 "local_highp" + Name 73 "mediumfout" + Name 104 "ub2" + Name 105 "param" + Name 114 "S" + MemberName 114(S) 0 "a" + MemberName 114(S) 1 "b" + Name 116 "s" + Decorate 12(foo(vf3;) RelaxedPrecision + Decorate 11(mv3) RelaxedPrecision + Decorate 38(sum) RelaxedPrecision + Decorate 40(uniform_medium) RelaxedPrecision + Decorate 41 RelaxedPrecision + Decorate 46 RelaxedPrecision + Decorate 48(uniform_low) RelaxedPrecision + Decorate 49 RelaxedPrecision + Decorate 50 RelaxedPrecision + Decorate 51 RelaxedPrecision + Decorate 53(arg1) RelaxedPrecision + Decorate 55(arg2) RelaxedPrecision + Decorate 57(d) RelaxedPrecision + Decorate 59(lowfin) RelaxedPrecision + Decorate 60 RelaxedPrecision + Decorate 61(mediumfin) RelaxedPrecision + Decorate 62 RelaxedPrecision + Decorate 63 RelaxedPrecision + Decorate 73(mediumfout) RelaxedPrecision + Decorate 74 RelaxedPrecision + Decorate 75 RelaxedPrecision + Decorate 76 RelaxedPrecision + Decorate 77 RelaxedPrecision + Decorate 78 RelaxedPrecision + Decorate 79 RelaxedPrecision + Decorate 83 RelaxedPrecision + Decorate 85 RelaxedPrecision + Decorate 87 RelaxedPrecision + Decorate 88 RelaxedPrecision + Decorate 90 RelaxedPrecision + Decorate 91 RelaxedPrecision + Decorate 94 RelaxedPrecision + Decorate 95 RelaxedPrecision + Decorate 96 RelaxedPrecision + Decorate 97 RelaxedPrecision + Decorate 98 RelaxedPrecision + Decorate 99 RelaxedPrecision + Decorate 100 RelaxedPrecision + Decorate 101 RelaxedPrecision + Decorate 102 RelaxedPrecision + Decorate 110 RelaxedPrecision + Decorate 112 RelaxedPrecision + Decorate 113 RelaxedPrecision + MemberDecorate 114(S) 1 RelaxedPrecision + Decorate 120 RelaxedPrecision + Decorate 124 RelaxedPrecision + Decorate 125 RelaxedPrecision + Decorate 126 RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8: TypePointer Function 7(fvec3) + 9: TypeVector 6(float) 2 + 10: TypeFunction 9(fvec2) 8(ptr) + 14: TypeBool + 15: TypeVector 14(bool) 2 + 16: TypePointer Function 15(bvec2) + 17: TypeFunction 14(bool) 16(ptr) + 21: TypeVector 6(float) 4 + 22: TypePointer Input 21(fvec4) + 23(highfin): 22(ptr) Variable Input + 29: 14(bool) ConstantFalse + 30: 14(bool) ConstantTrue + 31: 15(bvec2) ConstantComposite 29 30 + 36: TypeInt 32 1 + 37: TypePointer Function 36(int) + 39: TypePointer Private 36(int) +40(uniform_medium): 39(ptr) Variable Private +42(uniform_high): 39(ptr) Variable Private + 48(uniform_low): 39(ptr) Variable Private + 52: TypePointer Function 6(float) + 54: 6(float) Constant 1078774989 + 56: 6(float) Constant 1232730691 + 58: TypePointer Input 6(float) + 59(lowfin): 58(ptr) Variable Input + 61(mediumfin): 58(ptr) Variable Input + 64: TypePointer Private 6(float) +65(global_highp): 64(ptr) Variable Private + 68: TypePointer Function 21(fvec4) + 72: TypePointer Output 21(fvec4) + 73(mediumfout): 72(ptr) Variable Output + 82: 36(int) Constant 4 + 84: TypeVector 36(int) 2 + 92: TypeInt 32 0 + 93: 92(int) Constant 0 + 103: TypePointer Private 15(bvec2) + 104(ub2): 103(ptr) Variable Private + 111: 6(float) Constant 1065353216 + 114(S): TypeStruct 6(float) 6(float) + 115: TypePointer Input 114(S) + 116(s): 115(ptr) Variable Input + 117: 36(int) Constant 0 + 122: 36(int) Constant 1 + 4(main): 2 Function None 3 + 5: Label + 38(sum): 37(ptr) Variable Function + 53(arg1): 52(ptr) Variable Function + 55(arg2): 52(ptr) Variable Function + 57(d): 52(ptr) Variable Function + 69(local_highp): 68(ptr) Variable Function + 105(param): 16(ptr) Variable Function + 41: 36(int) Load 40(uniform_medium) + 43: 36(int) Load 42(uniform_high) + 44: 36(int) IAdd 41 43 + Store 38(sum) 44 + 45: 36(int) Load 42(uniform_high) + 46: 36(int) Load 38(sum) + 47: 36(int) IAdd 46 45 + Store 38(sum) 47 + 49: 36(int) Load 48(uniform_low) + 50: 36(int) Load 38(sum) + 51: 36(int) IAdd 50 49 + Store 38(sum) 51 + Store 53(arg1) 54 + Store 55(arg2) 56 + 60: 6(float) Load 59(lowfin) + 62: 6(float) Load 61(mediumfin) + 63: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 60 62 + Store 57(d) 63 + 66: 21(fvec4) Load 23(highfin) + 67: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 66 + Store 65(global_highp) 67 + 70: 6(float) Load 65(global_highp) + 71: 21(fvec4) CompositeConstruct 70 70 70 70 + Store 69(local_highp) 71 + 74: 6(float) Load 57(d) + 75: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 74 + 76: 21(fvec4) CompositeConstruct 75 75 75 75 + 77: 6(float) Load 55(arg2) + 78: 21(fvec4) CompositeConstruct 77 77 77 77 + 79: 21(fvec4) FAdd 76 78 + 80: 21(fvec4) Load 69(local_highp) + 81: 21(fvec4) FAdd 79 80 + Store 73(mediumfout) 81 + 83: 36(int) Load 48(uniform_low) + 85: 84(ivec2) CompositeConstruct 83 83 + 86: 36(int) Load 42(uniform_high) + 87: 84(ivec2) CompositeConstruct 86 86 + 88: 84(ivec2) IMul 85 87 + 89: 36(int) Load 42(uniform_high) + 90: 84(ivec2) CompositeConstruct 89 89 + 91: 84(ivec2) IAdd 88 90 + 94: 36(int) CompositeExtract 91 0 + 95: 36(int) IAdd 82 94 + 96: 36(int) Load 38(sum) + 97: 36(int) IAdd 96 95 + Store 38(sum) 97 + 98: 36(int) Load 38(sum) + 99: 6(float) ConvertSToF 98 + 100: 21(fvec4) CompositeConstruct 99 99 99 99 + 101: 21(fvec4) Load 73(mediumfout) + 102: 21(fvec4) FAdd 101 100 + Store 73(mediumfout) 102 + 106: 15(bvec2) Load 104(ub2) + Store 105(param) 106 + 107: 14(bool) FunctionCall 19(boolfun(vb2;) 105(param) + SelectionMerge 109 None + BranchConditional 107 108 109 + 108: Label + 110: 21(fvec4) Load 73(mediumfout) + 112: 21(fvec4) CompositeConstruct 111 111 111 111 + 113: 21(fvec4) FAdd 110 112 + Store 73(mediumfout) 113 + Branch 109 + 109: Label + 118: 58(ptr) AccessChain 116(s) 117 + 119: 6(float) Load 118 + 120: 21(fvec4) Load 73(mediumfout) + 121: 21(fvec4) VectorTimesScalar 120 119 + Store 73(mediumfout) 121 + 123: 58(ptr) AccessChain 116(s) 122 + 124: 6(float) Load 123 + 125: 21(fvec4) Load 73(mediumfout) + 126: 21(fvec4) VectorTimesScalar 125 124 + Store 73(mediumfout) 126 + Return + FunctionEnd + 12(foo(vf3;): 9(fvec2) Function None 10 + 11(mv3): 8(ptr) FunctionParameter + 13: Label + 24: 21(fvec4) Load 23(highfin) + 25: 9(fvec2) VectorShuffle 24 24 0 1 + ReturnValue 25 + FunctionEnd +19(boolfun(vb2;): 14(bool) Function None 17 + 18(bv2): 16(ptr) FunctionParameter + 20: Label + 28: 15(bvec2) Load 18(bv2) + 32: 15(bvec2) LogicalEqual 28 31 + 33: 14(bool) All 32 + ReturnValue 33 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.precisionNonESSamp.frag.out b/deps/glslang/Test/baseResults/spv.precisionNonESSamp.frag.out new file mode 100644 index 00000000..92220018 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.precisionNonESSamp.frag.out @@ -0,0 +1,98 @@ +spv.precisionNonESSamp.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 47 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 17 27 39 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "color" + Name 13 "s" + Name 17 "v2" + Name 23 "t" + Name 27 "v3" + Name 31 "vi1" + Name 34 "i1" + Name 39 "iv2" + Name 42 "vi2" + Name 43 "i2" + Decorate 9(color) RelaxedPrecision + Decorate 9(color) Location 0 + Decorate 13(s) RelaxedPrecision + Decorate 13(s) DescriptorSet 0 + Decorate 14 RelaxedPrecision + Decorate 17(v2) RelaxedPrecision + Decorate 17(v2) Location 0 + Decorate 18 RelaxedPrecision + Decorate 19 RelaxedPrecision + Decorate 23(t) DescriptorSet 0 + Decorate 27(v3) RelaxedPrecision + Decorate 27(v3) Location 1 + Decorate 28 RelaxedPrecision + Decorate 31(vi1) RelaxedPrecision + Decorate 34(i1) RelaxedPrecision + Decorate 34(i1) DescriptorSet 0 + Decorate 35 RelaxedPrecision + Decorate 39(iv2) RelaxedPrecision + Decorate 39(iv2) Flat + Decorate 39(iv2) Location 3 + Decorate 40 RelaxedPrecision + Decorate 41 RelaxedPrecision + Decorate 42(vi2) RelaxedPrecision + Decorate 43(i2) DescriptorSet 0 + Decorate 45 RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(color): 8(ptr) Variable Output + 10: TypeImage 6(float) 2D sampled format:Unknown + 11: TypeSampledImage 10 + 12: TypePointer UniformConstant 11 + 13(s): 12(ptr) Variable UniformConstant + 15: TypeVector 6(float) 2 + 16: TypePointer Input 15(fvec2) + 17(v2): 16(ptr) Variable Input + 20: TypeImage 6(float) 3D sampled format:Unknown + 21: TypeSampledImage 20 + 22: TypePointer UniformConstant 21 + 23(t): 22(ptr) Variable UniformConstant + 25: TypeVector 6(float) 3 + 26: TypePointer Input 25(fvec3) + 27(v3): 26(ptr) Variable Input + 30: TypePointer Function 7(fvec4) + 32: TypeImage 6(float) 2D nonsampled format:Rgba32f + 33: TypePointer UniformConstant 32 + 34(i1): 33(ptr) Variable UniformConstant + 36: TypeInt 32 1 + 37: TypeVector 36(int) 2 + 38: TypePointer Input 37(ivec2) + 39(iv2): 38(ptr) Variable Input + 43(i2): 33(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 31(vi1): 30(ptr) Variable Function + 42(vi2): 30(ptr) Variable Function + 14: 11 Load 13(s) + 18: 15(fvec2) Load 17(v2) + 19: 7(fvec4) ImageSampleImplicitLod 14 18 + Store 9(color) 19 + 24: 21 Load 23(t) + 28: 25(fvec3) Load 27(v3) + 29: 7(fvec4) ImageSampleImplicitLod 24 28 + Store 9(color) 29 + 35: 32 Load 34(i1) + 40: 37(ivec2) Load 39(iv2) + 41: 7(fvec4) ImageRead 35 40 + Store 31(vi1) 41 + 44: 32 Load 43(i2) + 45: 37(ivec2) Load 39(iv2) + 46: 7(fvec4) ImageRead 44 45 + Store 42(vi2) 46 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.prepost.frag.out b/deps/glslang/Test/baseResults/spv.prepost.frag.out new file mode 100644 index 00000000..3b4bfd8a --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.prepost.frag.out @@ -0,0 +1,144 @@ +spv.prepost.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 94 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 90 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 8 "index" + Name 14 "s" + MemberName 14(s) 0 "y" + Name 16 "str" + Name 22 "t" + Name 50 "x" + Name 61 "y" + Name 66 "z" + Name 73 "v" + Name 90 "gl_FragColor" + Decorate 90(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 5 + 10: TypeFloat 32 + 11: TypeInt 32 0 + 12: 11(int) Constant 5 + 13: TypeArray 10(float) 12 + 14(s): TypeStruct 13 + 15: TypePointer Function 14(s) + 17: 6(int) Constant 0 + 18: 6(int) Constant 4 + 19: 10(float) Constant 1073741824 + 20: TypePointer Function 10(float) + 24: 6(int) Constant 1 + 28: 10(float) Constant 1065353216 + 71: TypeVector 10(float) 4 + 72: TypePointer Function 71(fvec4) + 74: 10(float) Constant 1077936128 + 75: 10(float) Constant 1082130432 + 76: 71(fvec4) ConstantComposite 28 19 74 75 + 77: 11(int) Constant 2 + 81: 11(int) Constant 1 + 83: 11(int) Constant 3 + 87: 11(int) Constant 0 + 89: TypePointer Output 71(fvec4) +90(gl_FragColor): 89(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 8(index): 7(ptr) Variable Function + 16(str): 15(ptr) Variable Function + 22(t): 20(ptr) Variable Function + 50(x): 20(ptr) Variable Function + 61(y): 20(ptr) Variable Function + 66(z): 20(ptr) Variable Function + 73(v): 72(ptr) Variable Function + Store 8(index) 9 + 21: 20(ptr) AccessChain 16(str) 17 18 + Store 21 19 + 23: 6(int) Load 8(index) + 25: 6(int) ISub 23 24 + Store 8(index) 25 + 26: 20(ptr) AccessChain 16(str) 17 25 + 27: 10(float) Load 26 + 29: 10(float) FAdd 27 28 + Store 26 29 + Store 22(t) 29 + 30: 10(float) Load 22(t) + 31: 20(ptr) AccessChain 16(str) 17 18 + 32: 10(float) Load 31 + 33: 10(float) FAdd 32 30 + 34: 20(ptr) AccessChain 16(str) 17 18 + Store 34 33 + 35: 20(ptr) AccessChain 16(str) 17 18 + 36: 10(float) Load 35 + 37: 10(float) FSub 36 28 + Store 35 37 + Store 22(t) 36 + 38: 6(int) Load 8(index) + 39: 6(int) IAdd 38 24 + Store 8(index) 39 + 40: 10(float) Load 22(t) + 41: 20(ptr) AccessChain 16(str) 17 38 + 42: 10(float) Load 41 + 43: 10(float) FAdd 42 40 + 44: 20(ptr) AccessChain 16(str) 17 38 + Store 44 43 + 45: 6(int) Load 8(index) + 46: 6(int) ISub 45 24 + Store 8(index) 46 + 47: 20(ptr) AccessChain 16(str) 17 46 + 48: 10(float) Load 47 + 49: 10(float) FSub 48 28 + Store 47 49 + 51: 20(ptr) AccessChain 16(str) 17 18 + 52: 10(float) Load 51 + Store 50(x) 52 + 53: 10(float) Load 50(x) + 54: 10(float) FAdd 53 28 + Store 50(x) 54 + 55: 10(float) Load 50(x) + 56: 10(float) FSub 55 28 + Store 50(x) 56 + 57: 10(float) Load 50(x) + 58: 10(float) FAdd 57 28 + Store 50(x) 58 + 59: 10(float) Load 50(x) + 60: 10(float) FSub 59 28 + Store 50(x) 60 + 62: 10(float) Load 50(x) + 63: 10(float) Load 50(x) + 64: 10(float) FAdd 63 28 + Store 50(x) 64 + 65: 10(float) FMul 62 64 + Store 61(y) 65 + 67: 10(float) Load 61(y) + 68: 10(float) Load 50(x) + 69: 10(float) FSub 68 28 + Store 50(x) 69 + 70: 10(float) FMul 67 68 + Store 66(z) 70 + Store 73(v) 76 + 78: 20(ptr) AccessChain 73(v) 77 + 79: 10(float) Load 78 + 80: 10(float) FSub 79 28 + Store 78 80 + 82: 20(ptr) AccessChain 73(v) 81 + Store 82 79 + 84: 20(ptr) AccessChain 73(v) 83 + 85: 10(float) Load 84 + 86: 10(float) FSub 85 28 + Store 84 86 + 88: 20(ptr) AccessChain 73(v) 87 + Store 88 86 + 91: 10(float) Load 66(z) + 92: 71(fvec4) Load 73(v) + 93: 71(fvec4) VectorTimesScalar 92 91 + Store 90(gl_FragColor) 93 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.pushConstant.vert.out b/deps/glslang/Test/baseResults/spv.pushConstant.vert.out new file mode 100644 index 00000000..40ee3284 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.pushConstant.vert.out @@ -0,0 +1,61 @@ +spv.pushConstant.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 35 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 24 + Source GLSL 400 + Name 4 "main" + Name 11 "Material" + MemberName 11(Material) 0 "kind" + MemberName 11(Material) 1 "fa" + Name 13 "matInst" + Name 24 "color" + Decorate 10 ArrayStride 4 + MemberDecorate 11(Material) 0 Offset 0 + MemberDecorate 11(Material) 1 Offset 4 + Decorate 11(Material) Block + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeFloat 32 + 8: TypeInt 32 0 + 9: 8(int) Constant 3 + 10: TypeArray 7(float) 9 + 11(Material): TypeStruct 6(int) 10 + 12: TypePointer PushConstant 11(Material) + 13(matInst): 12(ptr) Variable PushConstant + 14: 6(int) Constant 0 + 15: TypePointer PushConstant 6(int) + 22: TypeVector 7(float) 4 + 23: TypePointer Output 22(fvec4) + 24(color): 23(ptr) Variable Output + 25: 7(float) Constant 1045220557 + 26: 22(fvec4) ConstantComposite 25 25 25 25 + 28: 7(float) Constant 1056964608 + 29: 22(fvec4) ConstantComposite 28 28 28 28 + 31: 7(float) Constant 0 + 32: 22(fvec4) ConstantComposite 31 31 31 31 + 4(main): 2 Function None 3 + 5: Label + 16: 15(ptr) AccessChain 13(matInst) 14 + 17: 6(int) Load 16 + SelectionMerge 21 None + Switch 17 20 + case 1: 18 + case 2: 19 + 20: Label + Store 24(color) 32 + Branch 21 + 18: Label + Store 24(color) 26 + Branch 21 + 19: Label + Store 24(color) 29 + Branch 21 + 21: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.pushConstantAnon.vert.out b/deps/glslang/Test/baseResults/spv.pushConstantAnon.vert.out new file mode 100644 index 00000000..b03855da --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.pushConstantAnon.vert.out @@ -0,0 +1,64 @@ +spv.pushConstantAnon.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 38 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 24 + Source GLSL 400 + Name 4 "main" + Name 11 "Material" + MemberName 11(Material) 0 "kind" + MemberName 11(Material) 1 "fa" + Name 13 "" + Name 24 "color" + Decorate 10 ArrayStride 4 + MemberDecorate 11(Material) 0 Offset 0 + MemberDecorate 11(Material) 1 Offset 4 + Decorate 11(Material) Block + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeFloat 32 + 8: TypeInt 32 0 + 9: 8(int) Constant 3 + 10: TypeArray 7(float) 9 + 11(Material): TypeStruct 6(int) 10 + 12: TypePointer PushConstant 11(Material) + 13: 12(ptr) Variable PushConstant + 14: 6(int) Constant 0 + 15: TypePointer PushConstant 6(int) + 22: TypeVector 7(float) 4 + 23: TypePointer Output 22(fvec4) + 24(color): 23(ptr) Variable Output + 25: 7(float) Constant 1045220557 + 26: 22(fvec4) ConstantComposite 25 25 25 25 + 28: 7(float) Constant 1056964608 + 29: 22(fvec4) ConstantComposite 28 28 28 28 + 31: 6(int) Constant 1 + 32: TypePointer PushConstant 7(float) + 4(main): 2 Function None 3 + 5: Label + 16: 15(ptr) AccessChain 13 14 + 17: 6(int) Load 16 + SelectionMerge 21 None + Switch 17 20 + case 1: 18 + case 2: 19 + 20: Label + 33: 32(ptr) AccessChain 13 31 31 + 34: 7(float) Load 33 + 35: 22(fvec4) CompositeConstruct 34 34 34 34 + Store 24(color) 35 + Branch 21 + 18: Label + Store 24(color) 26 + Branch 21 + 19: Label + Store 24(color) 29 + Branch 21 + 21: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.qualifiers.vert.out b/deps/glslang/Test/baseResults/spv.qualifiers.vert.out new file mode 100644 index 00000000..ffdc6f80 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.qualifiers.vert.out @@ -0,0 +1,48 @@ +spv.qualifiers.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 21 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 9 11 13 15 17 19 + Source GLSL 430 + Name 4 "main" + Name 9 "outVc" + Name 11 "inV" + Name 13 "outVs" + Name 15 "outVf" + Name 17 "outVn" + Name 19 "outVcn" + Decorate 9(outVc) Centroid + Decorate 15(outVf) Flat + Decorate 17(outVn) NoPerspective + Decorate 19(outVcn) NoPerspective + Decorate 19(outVcn) Centroid + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(outVc): 8(ptr) Variable Output + 10: TypePointer Input 7(fvec4) + 11(inV): 10(ptr) Variable Input + 13(outVs): 8(ptr) Variable Output + 15(outVf): 8(ptr) Variable Output + 17(outVn): 8(ptr) Variable Output + 19(outVcn): 8(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 12: 7(fvec4) Load 11(inV) + Store 9(outVc) 12 + 14: 7(fvec4) Load 11(inV) + Store 13(outVs) 14 + 16: 7(fvec4) Load 11(inV) + Store 15(outVf) 16 + 18: 7(fvec4) Load 11(inV) + Store 17(outVn) 18 + 20: 7(fvec4) Load 11(inV) + Store 19(outVcn) 20 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.queryL.frag.out b/deps/glslang/Test/baseResults/spv.queryL.frag.out new file mode 100644 index 00000000..b737a35b --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.queryL.frag.out @@ -0,0 +1,316 @@ +spv.queryL.frag +error: SPIRV-Tools Validation Errors +error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension) + OpCapability SampledRect + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 224 + + Capability Shader + Capability SampledRect + Capability Sampled1D + Capability SampledCubeArray + Capability SampledBuffer + Capability ImageQuery + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 430 + Name 4 "main" + Name 9 "lod" + Name 13 "samp1D" + Name 16 "pf" + Name 23 "isamp2D" + Name 25 "pf2" + Name 34 "usamp3D" + Name 38 "pf3" + Name 46 "sampCube" + Name 55 "isamp1DA" + Name 64 "usamp2DA" + Name 73 "isampCubeA" + Name 82 "samp1Ds" + Name 91 "samp2Ds" + Name 100 "sampCubes" + Name 109 "samp1DAs" + Name 118 "samp2DAs" + Name 127 "sampCubeAs" + Name 134 "levels" + Name 141 "usamp2D" + Name 150 "isamp3D" + Name 159 "isampCube" + Name 173 "samp2DA" + Name 182 "usampCubeA" + Name 219 "sampBuf" + Name 223 "sampRect" + Decorate 13(samp1D) DescriptorSet 0 + Decorate 23(isamp2D) DescriptorSet 0 + Decorate 34(usamp3D) DescriptorSet 0 + Decorate 46(sampCube) DescriptorSet 0 + Decorate 55(isamp1DA) DescriptorSet 0 + Decorate 64(usamp2DA) DescriptorSet 0 + Decorate 73(isampCubeA) DescriptorSet 0 + Decorate 82(samp1Ds) DescriptorSet 0 + Decorate 91(samp2Ds) DescriptorSet 0 + Decorate 100(sampCubes) DescriptorSet 0 + Decorate 109(samp1DAs) DescriptorSet 0 + Decorate 118(samp2DAs) DescriptorSet 0 + Decorate 127(sampCubeAs) DescriptorSet 0 + Decorate 141(usamp2D) DescriptorSet 0 + Decorate 150(isamp3D) DescriptorSet 0 + Decorate 159(isampCube) DescriptorSet 0 + Decorate 173(samp2DA) DescriptorSet 0 + Decorate 182(usampCubeA) DescriptorSet 0 + Decorate 219(sampBuf) DescriptorSet 0 + Decorate 223(sampRect) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypePointer Function 7(fvec2) + 10: TypeImage 6(float) 1D sampled format:Unknown + 11: TypeSampledImage 10 + 12: TypePointer UniformConstant 11 + 13(samp1D): 12(ptr) Variable UniformConstant + 15: TypePointer Function 6(float) + 19: TypeInt 32 1 + 20: TypeImage 19(int) 2D sampled format:Unknown + 21: TypeSampledImage 20 + 22: TypePointer UniformConstant 21 + 23(isamp2D): 22(ptr) Variable UniformConstant + 30: TypeInt 32 0 + 31: TypeImage 30(int) 3D sampled format:Unknown + 32: TypeSampledImage 31 + 33: TypePointer UniformConstant 32 + 34(usamp3D): 33(ptr) Variable UniformConstant + 36: TypeVector 6(float) 3 + 37: TypePointer Function 36(fvec3) + 43: TypeImage 6(float) Cube sampled format:Unknown + 44: TypeSampledImage 43 + 45: TypePointer UniformConstant 44 + 46(sampCube): 45(ptr) Variable UniformConstant + 52: TypeImage 19(int) 1D array sampled format:Unknown + 53: TypeSampledImage 52 + 54: TypePointer UniformConstant 53 + 55(isamp1DA): 54(ptr) Variable UniformConstant + 61: TypeImage 30(int) 2D array sampled format:Unknown + 62: TypeSampledImage 61 + 63: TypePointer UniformConstant 62 + 64(usamp2DA): 63(ptr) Variable UniformConstant + 70: TypeImage 19(int) Cube array sampled format:Unknown + 71: TypeSampledImage 70 + 72: TypePointer UniformConstant 71 + 73(isampCubeA): 72(ptr) Variable UniformConstant + 79: TypeImage 6(float) 1D depth sampled format:Unknown + 80: TypeSampledImage 79 + 81: TypePointer UniformConstant 80 + 82(samp1Ds): 81(ptr) Variable UniformConstant + 88: TypeImage 6(float) 2D depth sampled format:Unknown + 89: TypeSampledImage 88 + 90: TypePointer UniformConstant 89 + 91(samp2Ds): 90(ptr) Variable UniformConstant + 97: TypeImage 6(float) Cube depth sampled format:Unknown + 98: TypeSampledImage 97 + 99: TypePointer UniformConstant 98 + 100(sampCubes): 99(ptr) Variable UniformConstant + 106: TypeImage 6(float) 1D depth array sampled format:Unknown + 107: TypeSampledImage 106 + 108: TypePointer UniformConstant 107 + 109(samp1DAs): 108(ptr) Variable UniformConstant + 115: TypeImage 6(float) 2D depth array sampled format:Unknown + 116: TypeSampledImage 115 + 117: TypePointer UniformConstant 116 + 118(samp2DAs): 117(ptr) Variable UniformConstant + 124: TypeImage 6(float) Cube depth array sampled format:Unknown + 125: TypeSampledImage 124 + 126: TypePointer UniformConstant 125 + 127(sampCubeAs): 126(ptr) Variable UniformConstant + 133: TypePointer Function 19(int) + 138: TypeImage 30(int) 2D sampled format:Unknown + 139: TypeSampledImage 138 + 140: TypePointer UniformConstant 139 + 141(usamp2D): 140(ptr) Variable UniformConstant + 147: TypeImage 19(int) 3D sampled format:Unknown + 148: TypeSampledImage 147 + 149: TypePointer UniformConstant 148 + 150(isamp3D): 149(ptr) Variable UniformConstant + 156: TypeImage 19(int) Cube sampled format:Unknown + 157: TypeSampledImage 156 + 158: TypePointer UniformConstant 157 + 159(isampCube): 158(ptr) Variable UniformConstant + 170: TypeImage 6(float) 2D array sampled format:Unknown + 171: TypeSampledImage 170 + 172: TypePointer UniformConstant 171 + 173(samp2DA): 172(ptr) Variable UniformConstant + 179: TypeImage 30(int) Cube array sampled format:Unknown + 180: TypeSampledImage 179 + 181: TypePointer UniformConstant 180 + 182(usampCubeA): 181(ptr) Variable UniformConstant + 216: TypeImage 6(float) Buffer sampled format:Unknown + 217: TypeSampledImage 216 + 218: TypePointer UniformConstant 217 + 219(sampBuf): 218(ptr) Variable UniformConstant + 220: TypeImage 6(float) Rect sampled format:Unknown + 221: TypeSampledImage 220 + 222: TypePointer UniformConstant 221 + 223(sampRect): 222(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 9(lod): 8(ptr) Variable Function + 16(pf): 15(ptr) Variable Function + 25(pf2): 8(ptr) Variable Function + 38(pf3): 37(ptr) Variable Function + 134(levels): 133(ptr) Variable Function + 14: 11 Load 13(samp1D) + 17: 6(float) Load 16(pf) + 18: 7(fvec2) ImageQueryLod 14 17 + Store 9(lod) 18 + 24: 21 Load 23(isamp2D) + 26: 7(fvec2) Load 25(pf2) + 27: 7(fvec2) ImageQueryLod 24 26 + 28: 7(fvec2) Load 9(lod) + 29: 7(fvec2) FAdd 28 27 + Store 9(lod) 29 + 35: 32 Load 34(usamp3D) + 39: 36(fvec3) Load 38(pf3) + 40: 7(fvec2) ImageQueryLod 35 39 + 41: 7(fvec2) Load 9(lod) + 42: 7(fvec2) FAdd 41 40 + Store 9(lod) 42 + 47: 44 Load 46(sampCube) + 48: 36(fvec3) Load 38(pf3) + 49: 7(fvec2) ImageQueryLod 47 48 + 50: 7(fvec2) Load 9(lod) + 51: 7(fvec2) FAdd 50 49 + Store 9(lod) 51 + 56: 53 Load 55(isamp1DA) + 57: 6(float) Load 16(pf) + 58: 7(fvec2) ImageQueryLod 56 57 + 59: 7(fvec2) Load 9(lod) + 60: 7(fvec2) FAdd 59 58 + Store 9(lod) 60 + 65: 62 Load 64(usamp2DA) + 66: 7(fvec2) Load 25(pf2) + 67: 7(fvec2) ImageQueryLod 65 66 + 68: 7(fvec2) Load 9(lod) + 69: 7(fvec2) FAdd 68 67 + Store 9(lod) 69 + 74: 71 Load 73(isampCubeA) + 75: 36(fvec3) Load 38(pf3) + 76: 7(fvec2) ImageQueryLod 74 75 + 77: 7(fvec2) Load 9(lod) + 78: 7(fvec2) FAdd 77 76 + Store 9(lod) 78 + 83: 80 Load 82(samp1Ds) + 84: 6(float) Load 16(pf) + 85: 7(fvec2) ImageQueryLod 83 84 + 86: 7(fvec2) Load 9(lod) + 87: 7(fvec2) FAdd 86 85 + Store 9(lod) 87 + 92: 89 Load 91(samp2Ds) + 93: 7(fvec2) Load 25(pf2) + 94: 7(fvec2) ImageQueryLod 92 93 + 95: 7(fvec2) Load 9(lod) + 96: 7(fvec2) FAdd 95 94 + Store 9(lod) 96 + 101: 98 Load 100(sampCubes) + 102: 36(fvec3) Load 38(pf3) + 103: 7(fvec2) ImageQueryLod 101 102 + 104: 7(fvec2) Load 9(lod) + 105: 7(fvec2) FAdd 104 103 + Store 9(lod) 105 + 110: 107 Load 109(samp1DAs) + 111: 6(float) Load 16(pf) + 112: 7(fvec2) ImageQueryLod 110 111 + 113: 7(fvec2) Load 9(lod) + 114: 7(fvec2) FAdd 113 112 + Store 9(lod) 114 + 119: 116 Load 118(samp2DAs) + 120: 7(fvec2) Load 25(pf2) + 121: 7(fvec2) ImageQueryLod 119 120 + 122: 7(fvec2) Load 9(lod) + 123: 7(fvec2) FAdd 122 121 + Store 9(lod) 123 + 128: 125 Load 127(sampCubeAs) + 129: 36(fvec3) Load 38(pf3) + 130: 7(fvec2) ImageQueryLod 128 129 + 131: 7(fvec2) Load 9(lod) + 132: 7(fvec2) FAdd 131 130 + Store 9(lod) 132 + 135: 11 Load 13(samp1D) + 136: 10 Image 135 + 137: 19(int) ImageQueryLevels 136 + Store 134(levels) 137 + 142: 139 Load 141(usamp2D) + 143: 138 Image 142 + 144: 19(int) ImageQueryLevels 143 + 145: 19(int) Load 134(levels) + 146: 19(int) IAdd 145 144 + Store 134(levels) 146 + 151: 148 Load 150(isamp3D) + 152: 147 Image 151 + 153: 19(int) ImageQueryLevels 152 + 154: 19(int) Load 134(levels) + 155: 19(int) IAdd 154 153 + Store 134(levels) 155 + 160: 157 Load 159(isampCube) + 161: 156 Image 160 + 162: 19(int) ImageQueryLevels 161 + 163: 19(int) Load 134(levels) + 164: 19(int) IAdd 163 162 + Store 134(levels) 164 + 165: 53 Load 55(isamp1DA) + 166: 52 Image 165 + 167: 19(int) ImageQueryLevels 166 + 168: 19(int) Load 134(levels) + 169: 19(int) IAdd 168 167 + Store 134(levels) 169 + 174: 171 Load 173(samp2DA) + 175: 170 Image 174 + 176: 19(int) ImageQueryLevels 175 + 177: 19(int) Load 134(levels) + 178: 19(int) IAdd 177 176 + Store 134(levels) 178 + 183: 180 Load 182(usampCubeA) + 184: 179 Image 183 + 185: 19(int) ImageQueryLevels 184 + 186: 19(int) Load 134(levels) + 187: 19(int) IAdd 186 185 + Store 134(levels) 187 + 188: 80 Load 82(samp1Ds) + 189: 79 Image 188 + 190: 19(int) ImageQueryLevels 189 + Store 134(levels) 190 + 191: 89 Load 91(samp2Ds) + 192: 88 Image 191 + 193: 19(int) ImageQueryLevels 192 + 194: 19(int) Load 134(levels) + 195: 19(int) IAdd 194 193 + Store 134(levels) 195 + 196: 98 Load 100(sampCubes) + 197: 97 Image 196 + 198: 19(int) ImageQueryLevels 197 + 199: 19(int) Load 134(levels) + 200: 19(int) IAdd 199 198 + Store 134(levels) 200 + 201: 107 Load 109(samp1DAs) + 202: 106 Image 201 + 203: 19(int) ImageQueryLevels 202 + 204: 19(int) Load 134(levels) + 205: 19(int) IAdd 204 203 + Store 134(levels) 205 + 206: 116 Load 118(samp2DAs) + 207: 115 Image 206 + 208: 19(int) ImageQueryLevels 207 + 209: 19(int) Load 134(levels) + 210: 19(int) IAdd 209 208 + Store 134(levels) 210 + 211: 125 Load 127(sampCubeAs) + 212: 124 Image 211 + 213: 19(int) ImageQueryLevels 212 + 214: 19(int) Load 134(levels) + 215: 19(int) IAdd 214 213 + Store 134(levels) 215 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.rankShift.comp.out b/deps/glslang/Test/baseResults/spv.rankShift.comp.out new file mode 100644 index 00000000..3ca75145 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.rankShift.comp.out @@ -0,0 +1,57 @@ +spv.rankShift.comp +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 33 + + Capability Shader + Capability Int64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" + ExecutionMode 4 LocalSize 54 1 1 + Source GLSL 450 + SourceExtension "GL_ARB_gpu_shader_int64" + Name 4 "main" + Name 8 "result" + Name 11 "arg0" + Name 15 "arg1" + Decorate 11(arg0) Location 4 + Decorate 15(arg1) Location 5 + Decorate 32 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 64 0 + 7: TypePointer Function 6(int64_t) + 9: TypeInt 64 1 + 10: TypePointer UniformConstant 9(int64_t) + 11(arg0): 10(ptr) Variable UniformConstant + 13: TypeInt 32 0 + 14: TypePointer UniformConstant 13(int) + 15(arg1): 14(ptr) Variable UniformConstant + 29: TypeVector 13(int) 3 + 30: 13(int) Constant 54 + 31: 13(int) Constant 1 + 32: 29(ivec3) ConstantComposite 30 31 31 + 4(main): 2 Function None 3 + 5: Label + 8(result): 7(ptr) Variable Function + 12: 9(int64_t) Load 11(arg0) + 16: 13(int) Load 15(arg1) + 17: 9(int64_t) ShiftLeftLogical 12 16 + 18: 6(int64_t) Bitcast 17 + Store 8(result) 18 + 19: 9(int64_t) Load 11(arg0) + 20: 13(int) Load 15(arg1) + 21: 9(int64_t) ShiftRightArithmetic 19 20 + 22: 6(int64_t) Bitcast 21 + Store 8(result) 22 + 23: 13(int) Load 15(arg1) + 24: 6(int64_t) Load 8(result) + 25: 6(int64_t) ShiftLeftLogical 24 23 + Store 8(result) 25 + 26: 13(int) Load 15(arg1) + 27: 6(int64_t) Load 8(result) + 28: 6(int64_t) ShiftRightLogical 27 26 + Store 8(result) 28 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.register.autoassign-2.frag.out b/deps/glslang/Test/baseResults/spv.register.autoassign-2.frag.out new file mode 100644 index 00000000..533e3880 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.register.autoassign-2.frag.out @@ -0,0 +1,81 @@ +spv.register.autoassign-2.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 47 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 44 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + Name 12 "@main(struct-PS_OUTPUT-vf41;" + Name 11 "psout" + Name 18 "g_tScene[0]" + Name 22 "g_tSamp" + Name 31 "g_tScene[1]" + Name 39 "psout" + Name 40 "param" + Name 44 "psout.Color" + Decorate 18(g_tScene[0]) DescriptorSet 0 + Decorate 18(g_tScene[0]) Binding 10 + Decorate 22(g_tSamp) DescriptorSet 0 + Decorate 22(g_tSamp) Binding 5 + Decorate 31(g_tScene[1]) DescriptorSet 0 + Decorate 31(g_tScene[1]) Binding 11 + Decorate 44(psout.Color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypePointer Function 8(PS_OUTPUT) + 10: TypeFunction 2 9(ptr) + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16: TypeImage 6(float) 2D sampled format:Unknown + 17: TypePointer UniformConstant 16 + 18(g_tScene[0]): 17(ptr) Variable UniformConstant + 20: TypeSampler + 21: TypePointer UniformConstant 20 + 22(g_tSamp): 21(ptr) Variable UniformConstant + 24: TypeSampledImage 16 + 26: TypeVector 6(float) 2 + 27: 6(float) Constant 1050253722 + 28: 6(float) Constant 1053609165 + 29: 26(fvec2) ConstantComposite 27 28 + 31(g_tScene[1]): 17(ptr) Variable UniformConstant + 37: TypePointer Function 7(fvec4) + 43: TypePointer Output 7(fvec4) + 44(psout.Color): 43(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 39(psout): 9(ptr) Variable Function + 40(param): 9(ptr) Variable Function + 41: 2 FunctionCall 12(@main(struct-PS_OUTPUT-vf41;) 40(param) + 42:8(PS_OUTPUT) Load 40(param) + Store 39(psout) 42 + 45: 37(ptr) AccessChain 39(psout) 15 + 46: 7(fvec4) Load 45 + Store 44(psout.Color) 46 + Return + FunctionEnd +12(@main(struct-PS_OUTPUT-vf41;): 2 Function None 10 + 11(psout): 9(ptr) FunctionParameter + 13: Label + 19: 16 Load 18(g_tScene[0]) + 23: 20 Load 22(g_tSamp) + 25: 24 SampledImage 19 23 + 30: 7(fvec4) ImageSampleImplicitLod 25 29 + 32: 16 Load 31(g_tScene[1]) + 33: 20 Load 22(g_tSamp) + 34: 24 SampledImage 32 33 + 35: 7(fvec4) ImageSampleImplicitLod 34 29 + 36: 7(fvec4) FAdd 30 35 + 38: 37(ptr) AccessChain 11(psout) 15 + Store 38 36 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.register.autoassign.frag.out b/deps/glslang/Test/baseResults/spv.register.autoassign.frag.out new file mode 100644 index 00000000..683ae08d --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.register.autoassign.frag.out @@ -0,0 +1,241 @@ +spv.register.autoassign.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 155 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main_ep" 151 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main_ep" + Name 9 "Func1(" + Name 11 "Func2(" + Name 13 "Func2_unused(" + Name 15 "PS_OUTPUT" + MemberName 15(PS_OUTPUT) 0 "Color" + Name 17 "@main_ep(" + Name 21 "g_tTex1" + Name 25 "g_sSamp1" + Name 31 "g_tTex2" + Name 33 "g_sSamp2" + Name 43 "g_tTex3" + Name 50 "g_sSamp3" + Name 68 "g_tTex4" + Name 73 "g_sSamp4" + Name 88 "g_tTex5" + Name 90 "g_sSamp5" + Name 97 "MyStruct_t" + MemberName 97(MyStruct_t) 0 "a" + MemberName 97(MyStruct_t) 1 "b" + MemberName 97(MyStruct_t) 2 "c" + Name 99 "$Global" + MemberName 99($Global) 0 "mystruct" + MemberName 99($Global) 1 "myfloat4_a" + MemberName 99($Global) 2 "myfloat4_b" + MemberName 99($Global) 3 "myint4_a" + Name 101 "" + Name 123 "g_tTex_unused1" + Name 125 "g_sSamp_unused1" + Name 130 "g_tTex_unused2" + Name 132 "g_sSamp_unused2" + Name 141 "psout" + Name 151 "@entryPointOutput.Color" + Name 154 "g_tTex_unused3" + Decorate 21(g_tTex1) DescriptorSet 0 + Decorate 21(g_tTex1) Binding 11 + Decorate 25(g_sSamp1) DescriptorSet 0 + Decorate 25(g_sSamp1) Binding 5 + Decorate 31(g_tTex2) DescriptorSet 0 + Decorate 31(g_tTex2) Binding 14 + Decorate 33(g_sSamp2) DescriptorSet 0 + Decorate 33(g_sSamp2) Binding 6 + Decorate 43(g_tTex3) DescriptorSet 0 + Decorate 43(g_tTex3) Binding 13 + Decorate 50(g_sSamp3) DescriptorSet 0 + Decorate 50(g_sSamp3) Binding 7 + Decorate 68(g_tTex4) DescriptorSet 0 + Decorate 68(g_tTex4) Binding 15 + Decorate 73(g_sSamp4) DescriptorSet 0 + Decorate 73(g_sSamp4) Binding 8 + Decorate 88(g_tTex5) DescriptorSet 0 + Decorate 88(g_tTex5) Binding 16 + Decorate 90(g_sSamp5) DescriptorSet 0 + Decorate 90(g_sSamp5) Binding 9 + MemberDecorate 97(MyStruct_t) 0 Offset 0 + MemberDecorate 97(MyStruct_t) 1 Offset 4 + MemberDecorate 97(MyStruct_t) 2 Offset 16 + MemberDecorate 99($Global) 0 Offset 0 + MemberDecorate 99($Global) 1 Offset 32 + MemberDecorate 99($Global) 2 Offset 48 + MemberDecorate 99($Global) 3 Offset 64 + Decorate 99($Global) Block + Decorate 101 DescriptorSet 0 + Decorate 101 Binding 20 + Decorate 123(g_tTex_unused1) DescriptorSet 0 + Decorate 123(g_tTex_unused1) Binding 10 + Decorate 125(g_sSamp_unused1) DescriptorSet 0 + Decorate 130(g_tTex_unused2) DescriptorSet 0 + Decorate 130(g_tTex_unused2) Binding 12 + Decorate 132(g_sSamp_unused2) DescriptorSet 0 + Decorate 151(@entryPointOutput.Color) Location 0 + Decorate 154(g_tTex_unused3) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 15(PS_OUTPUT): TypeStruct 7(fvec4) + 16: TypeFunction 15(PS_OUTPUT) + 19: TypeImage 6(float) 1D sampled format:Unknown + 20: TypePointer UniformConstant 19 + 21(g_tTex1): 20(ptr) Variable UniformConstant + 23: TypeSampler + 24: TypePointer UniformConstant 23 + 25(g_sSamp1): 24(ptr) Variable UniformConstant + 27: TypeSampledImage 19 + 29: 6(float) Constant 1036831949 + 31(g_tTex2): 20(ptr) Variable UniformConstant + 33(g_sSamp2): 24(ptr) Variable UniformConstant + 36: 6(float) Constant 1045220557 + 39: TypeInt 32 0 + 40: 39(int) Constant 2 + 41: TypeArray 19 40 + 42: TypePointer UniformConstant 41 + 43(g_tTex3): 42(ptr) Variable UniformConstant + 44: TypeInt 32 1 + 45: 44(int) Constant 0 + 48: TypeArray 23 40 + 49: TypePointer UniformConstant 48 + 50(g_sSamp3): 49(ptr) Variable UniformConstant + 54: 6(float) Constant 1050253722 + 57: 44(int) Constant 1 + 65: 39(int) Constant 3 + 66: TypeArray 19 65 + 67: TypePointer UniformConstant 66 + 68(g_tTex4): 67(ptr) Variable UniformConstant + 71: TypeArray 23 65 + 72: TypePointer UniformConstant 71 + 73(g_sSamp4): 72(ptr) Variable UniformConstant + 77: 6(float) Constant 1053609165 + 80: 44(int) Constant 2 + 88(g_tTex5): 20(ptr) Variable UniformConstant + 90(g_sSamp5): 24(ptr) Variable UniformConstant + 93: 6(float) Constant 1056964608 + 96: TypeVector 6(float) 3 + 97(MyStruct_t): TypeStruct 44(int) 6(float) 96(fvec3) + 98: TypeVector 44(int) 4 + 99($Global): TypeStruct 97(MyStruct_t) 7(fvec4) 7(fvec4) 98(ivec4) + 100: TypePointer Uniform 99($Global) + 101: 100(ptr) Variable Uniform + 102: 39(int) Constant 1 + 103: TypePointer Uniform 6(float) +123(g_tTex_unused1): 20(ptr) Variable UniformConstant +125(g_sSamp_unused1): 24(ptr) Variable UniformConstant + 128: 6(float) Constant 1066192077 +130(g_tTex_unused2): 20(ptr) Variable UniformConstant +132(g_sSamp_unused2): 24(ptr) Variable UniformConstant + 135: 6(float) Constant 1067030938 + 140: TypePointer Function 15(PS_OUTPUT) + 145: TypePointer Function 7(fvec4) + 150: TypePointer Output 7(fvec4) +151(@entryPointOutput.Color): 150(ptr) Variable Output +154(g_tTex_unused3): 20(ptr) Variable UniformConstant + 4(main_ep): 2 Function None 3 + 5: Label + 152:15(PS_OUTPUT) FunctionCall 17(@main_ep() + 153: 7(fvec4) CompositeExtract 152 0 + Store 151(@entryPointOutput.Color) 153 + Return + FunctionEnd + 9(Func1(): 7(fvec4) Function None 8 + 10: Label + 22: 19 Load 21(g_tTex1) + 26: 23 Load 25(g_sSamp1) + 28: 27 SampledImage 22 26 + 30: 7(fvec4) ImageSampleImplicitLod 28 29 + 32: 19 Load 31(g_tTex2) + 34: 23 Load 33(g_sSamp2) + 35: 27 SampledImage 32 34 + 37: 7(fvec4) ImageSampleImplicitLod 35 36 + 38: 7(fvec4) FAdd 30 37 + 46: 20(ptr) AccessChain 43(g_tTex3) 45 + 47: 19 Load 46 + 51: 24(ptr) AccessChain 50(g_sSamp3) 45 + 52: 23 Load 51 + 53: 27 SampledImage 47 52 + 55: 7(fvec4) ImageSampleImplicitLod 53 54 + 56: 7(fvec4) FAdd 38 55 + 58: 20(ptr) AccessChain 43(g_tTex3) 57 + 59: 19 Load 58 + 60: 24(ptr) AccessChain 50(g_sSamp3) 57 + 61: 23 Load 60 + 62: 27 SampledImage 59 61 + 63: 7(fvec4) ImageSampleImplicitLod 62 54 + 64: 7(fvec4) FAdd 56 63 + 69: 20(ptr) AccessChain 68(g_tTex4) 57 + 70: 19 Load 69 + 74: 24(ptr) AccessChain 73(g_sSamp4) 57 + 75: 23 Load 74 + 76: 27 SampledImage 70 75 + 78: 7(fvec4) ImageSampleImplicitLod 76 77 + 79: 7(fvec4) FAdd 64 78 + 81: 20(ptr) AccessChain 68(g_tTex4) 80 + 82: 19 Load 81 + 83: 24(ptr) AccessChain 73(g_sSamp4) 80 + 84: 23 Load 83 + 85: 27 SampledImage 82 84 + 86: 7(fvec4) ImageSampleImplicitLod 85 77 + 87: 7(fvec4) FAdd 79 86 + 89: 19 Load 88(g_tTex5) + 91: 23 Load 90(g_sSamp5) + 92: 27 SampledImage 89 91 + 94: 7(fvec4) ImageSampleImplicitLod 92 93 + 95: 7(fvec4) FAdd 87 94 + 104: 103(ptr) AccessChain 101 45 80 102 + 105: 6(float) Load 104 + 106: 7(fvec4) CompositeConstruct 105 105 105 105 + 107: 7(fvec4) FAdd 95 106 + ReturnValue 107 + FunctionEnd + 11(Func2(): 7(fvec4) Function None 8 + 12: Label + 110: 19 Load 21(g_tTex1) + 111: 23 Load 25(g_sSamp1) + 112: 27 SampledImage 110 111 + 113: 7(fvec4) ImageSampleImplicitLod 112 29 + 114: 20(ptr) AccessChain 43(g_tTex3) 57 + 115: 19 Load 114 + 116: 24(ptr) AccessChain 50(g_sSamp3) 57 + 117: 23 Load 116 + 118: 27 SampledImage 115 117 + 119: 7(fvec4) ImageSampleImplicitLod 118 54 + 120: 7(fvec4) FAdd 113 119 + ReturnValue 120 + FunctionEnd +13(Func2_unused(): 7(fvec4) Function None 8 + 14: Label + 124: 19 Load 123(g_tTex_unused1) + 126: 23 Load 125(g_sSamp_unused1) + 127: 27 SampledImage 124 126 + 129: 7(fvec4) ImageSampleImplicitLod 127 128 + 131: 19 Load 130(g_tTex_unused2) + 133: 23 Load 132(g_sSamp_unused2) + 134: 27 SampledImage 131 133 + 136: 7(fvec4) ImageSampleImplicitLod 134 135 + 137: 7(fvec4) FAdd 129 136 + ReturnValue 137 + FunctionEnd + 17(@main_ep():15(PS_OUTPUT) Function None 16 + 18: Label + 141(psout): 140(ptr) Variable Function + 142: 7(fvec4) FunctionCall 9(Func1() + 143: 7(fvec4) FunctionCall 11(Func2() + 144: 7(fvec4) FAdd 142 143 + 146: 145(ptr) AccessChain 141(psout) 45 + Store 146 144 + 147:15(PS_OUTPUT) Load 141(psout) + ReturnValue 147 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.register.autoassign.rangetest.frag.out b/deps/glslang/Test/baseResults/spv.register.autoassign.rangetest.frag.out new file mode 100644 index 00000000..8eb76c9b --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.register.autoassign.rangetest.frag.out @@ -0,0 +1,5 @@ +spv.register.autoassign.rangetest.frag +INTERNAL ERROR: mapped binding out of range: g_tSamp +INTERNAL ERROR: mapped binding out of range: g_tScene + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.register.noautoassign.frag.out b/deps/glslang/Test/baseResults/spv.register.noautoassign.frag.out new file mode 100644 index 00000000..166d92d9 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.register.noautoassign.frag.out @@ -0,0 +1,234 @@ +spv.register.noautoassign.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 155 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main_ep" 151 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main_ep" + Name 9 "Func1(" + Name 11 "Func2(" + Name 13 "Func2_unused(" + Name 15 "PS_OUTPUT" + MemberName 15(PS_OUTPUT) 0 "Color" + Name 17 "@main_ep(" + Name 21 "g_tTex1" + Name 25 "g_sSamp1" + Name 31 "g_tTex2" + Name 33 "g_sSamp2" + Name 43 "g_tTex3" + Name 50 "g_sSamp3" + Name 68 "g_tTex4" + Name 73 "g_sSamp4" + Name 88 "g_tTex5" + Name 90 "g_sSamp5" + Name 97 "MyStruct_t" + MemberName 97(MyStruct_t) 0 "a" + MemberName 97(MyStruct_t) 1 "b" + MemberName 97(MyStruct_t) 2 "c" + Name 99 "$Global" + MemberName 99($Global) 0 "mystruct" + MemberName 99($Global) 1 "myfloat4_a" + MemberName 99($Global) 2 "myfloat4_b" + MemberName 99($Global) 3 "myint4_a" + Name 101 "" + Name 123 "g_tTex_unused1" + Name 125 "g_sSamp_unused1" + Name 130 "g_tTex_unused2" + Name 132 "g_sSamp_unused2" + Name 141 "psout" + Name 151 "@entryPointOutput.Color" + Name 154 "g_tTex_unused3" + Decorate 21(g_tTex1) DescriptorSet 0 + Decorate 21(g_tTex1) Binding 11 + Decorate 25(g_sSamp1) DescriptorSet 0 + Decorate 25(g_sSamp1) Binding 5 + Decorate 31(g_tTex2) DescriptorSet 0 + Decorate 33(g_sSamp2) DescriptorSet 0 + Decorate 43(g_tTex3) DescriptorSet 0 + Decorate 43(g_tTex3) Binding 13 + Decorate 50(g_sSamp3) DescriptorSet 0 + Decorate 50(g_sSamp3) Binding 7 + Decorate 68(g_tTex4) DescriptorSet 0 + Decorate 73(g_sSamp4) DescriptorSet 0 + Decorate 88(g_tTex5) DescriptorSet 0 + Decorate 90(g_sSamp5) DescriptorSet 0 + MemberDecorate 97(MyStruct_t) 0 Offset 0 + MemberDecorate 97(MyStruct_t) 1 Offset 4 + MemberDecorate 97(MyStruct_t) 2 Offset 16 + MemberDecorate 99($Global) 0 Offset 0 + MemberDecorate 99($Global) 1 Offset 32 + MemberDecorate 99($Global) 2 Offset 48 + MemberDecorate 99($Global) 3 Offset 64 + Decorate 99($Global) Block + Decorate 101 DescriptorSet 0 + Decorate 123(g_tTex_unused1) DescriptorSet 0 + Decorate 123(g_tTex_unused1) Binding 10 + Decorate 125(g_sSamp_unused1) DescriptorSet 0 + Decorate 130(g_tTex_unused2) DescriptorSet 0 + Decorate 130(g_tTex_unused2) Binding 12 + Decorate 132(g_sSamp_unused2) DescriptorSet 0 + Decorate 151(@entryPointOutput.Color) Location 0 + Decorate 154(g_tTex_unused3) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 15(PS_OUTPUT): TypeStruct 7(fvec4) + 16: TypeFunction 15(PS_OUTPUT) + 19: TypeImage 6(float) 1D sampled format:Unknown + 20: TypePointer UniformConstant 19 + 21(g_tTex1): 20(ptr) Variable UniformConstant + 23: TypeSampler + 24: TypePointer UniformConstant 23 + 25(g_sSamp1): 24(ptr) Variable UniformConstant + 27: TypeSampledImage 19 + 29: 6(float) Constant 1036831949 + 31(g_tTex2): 20(ptr) Variable UniformConstant + 33(g_sSamp2): 24(ptr) Variable UniformConstant + 36: 6(float) Constant 1045220557 + 39: TypeInt 32 0 + 40: 39(int) Constant 2 + 41: TypeArray 19 40 + 42: TypePointer UniformConstant 41 + 43(g_tTex3): 42(ptr) Variable UniformConstant + 44: TypeInt 32 1 + 45: 44(int) Constant 0 + 48: TypeArray 23 40 + 49: TypePointer UniformConstant 48 + 50(g_sSamp3): 49(ptr) Variable UniformConstant + 54: 6(float) Constant 1050253722 + 57: 44(int) Constant 1 + 65: 39(int) Constant 3 + 66: TypeArray 19 65 + 67: TypePointer UniformConstant 66 + 68(g_tTex4): 67(ptr) Variable UniformConstant + 71: TypeArray 23 65 + 72: TypePointer UniformConstant 71 + 73(g_sSamp4): 72(ptr) Variable UniformConstant + 77: 6(float) Constant 1053609165 + 80: 44(int) Constant 2 + 88(g_tTex5): 20(ptr) Variable UniformConstant + 90(g_sSamp5): 24(ptr) Variable UniformConstant + 93: 6(float) Constant 1056964608 + 96: TypeVector 6(float) 3 + 97(MyStruct_t): TypeStruct 44(int) 6(float) 96(fvec3) + 98: TypeVector 44(int) 4 + 99($Global): TypeStruct 97(MyStruct_t) 7(fvec4) 7(fvec4) 98(ivec4) + 100: TypePointer Uniform 99($Global) + 101: 100(ptr) Variable Uniform + 102: 39(int) Constant 1 + 103: TypePointer Uniform 6(float) +123(g_tTex_unused1): 20(ptr) Variable UniformConstant +125(g_sSamp_unused1): 24(ptr) Variable UniformConstant + 128: 6(float) Constant 1066192077 +130(g_tTex_unused2): 20(ptr) Variable UniformConstant +132(g_sSamp_unused2): 24(ptr) Variable UniformConstant + 135: 6(float) Constant 1067030938 + 140: TypePointer Function 15(PS_OUTPUT) + 145: TypePointer Function 7(fvec4) + 150: TypePointer Output 7(fvec4) +151(@entryPointOutput.Color): 150(ptr) Variable Output +154(g_tTex_unused3): 20(ptr) Variable UniformConstant + 4(main_ep): 2 Function None 3 + 5: Label + 152:15(PS_OUTPUT) FunctionCall 17(@main_ep() + 153: 7(fvec4) CompositeExtract 152 0 + Store 151(@entryPointOutput.Color) 153 + Return + FunctionEnd + 9(Func1(): 7(fvec4) Function None 8 + 10: Label + 22: 19 Load 21(g_tTex1) + 26: 23 Load 25(g_sSamp1) + 28: 27 SampledImage 22 26 + 30: 7(fvec4) ImageSampleImplicitLod 28 29 + 32: 19 Load 31(g_tTex2) + 34: 23 Load 33(g_sSamp2) + 35: 27 SampledImage 32 34 + 37: 7(fvec4) ImageSampleImplicitLod 35 36 + 38: 7(fvec4) FAdd 30 37 + 46: 20(ptr) AccessChain 43(g_tTex3) 45 + 47: 19 Load 46 + 51: 24(ptr) AccessChain 50(g_sSamp3) 45 + 52: 23 Load 51 + 53: 27 SampledImage 47 52 + 55: 7(fvec4) ImageSampleImplicitLod 53 54 + 56: 7(fvec4) FAdd 38 55 + 58: 20(ptr) AccessChain 43(g_tTex3) 57 + 59: 19 Load 58 + 60: 24(ptr) AccessChain 50(g_sSamp3) 57 + 61: 23 Load 60 + 62: 27 SampledImage 59 61 + 63: 7(fvec4) ImageSampleImplicitLod 62 54 + 64: 7(fvec4) FAdd 56 63 + 69: 20(ptr) AccessChain 68(g_tTex4) 57 + 70: 19 Load 69 + 74: 24(ptr) AccessChain 73(g_sSamp4) 57 + 75: 23 Load 74 + 76: 27 SampledImage 70 75 + 78: 7(fvec4) ImageSampleImplicitLod 76 77 + 79: 7(fvec4) FAdd 64 78 + 81: 20(ptr) AccessChain 68(g_tTex4) 80 + 82: 19 Load 81 + 83: 24(ptr) AccessChain 73(g_sSamp4) 80 + 84: 23 Load 83 + 85: 27 SampledImage 82 84 + 86: 7(fvec4) ImageSampleImplicitLod 85 77 + 87: 7(fvec4) FAdd 79 86 + 89: 19 Load 88(g_tTex5) + 91: 23 Load 90(g_sSamp5) + 92: 27 SampledImage 89 91 + 94: 7(fvec4) ImageSampleImplicitLod 92 93 + 95: 7(fvec4) FAdd 87 94 + 104: 103(ptr) AccessChain 101 45 80 102 + 105: 6(float) Load 104 + 106: 7(fvec4) CompositeConstruct 105 105 105 105 + 107: 7(fvec4) FAdd 95 106 + ReturnValue 107 + FunctionEnd + 11(Func2(): 7(fvec4) Function None 8 + 12: Label + 110: 19 Load 21(g_tTex1) + 111: 23 Load 25(g_sSamp1) + 112: 27 SampledImage 110 111 + 113: 7(fvec4) ImageSampleImplicitLod 112 29 + 114: 20(ptr) AccessChain 43(g_tTex3) 57 + 115: 19 Load 114 + 116: 24(ptr) AccessChain 50(g_sSamp3) 57 + 117: 23 Load 116 + 118: 27 SampledImage 115 117 + 119: 7(fvec4) ImageSampleImplicitLod 118 54 + 120: 7(fvec4) FAdd 113 119 + ReturnValue 120 + FunctionEnd +13(Func2_unused(): 7(fvec4) Function None 8 + 14: Label + 124: 19 Load 123(g_tTex_unused1) + 126: 23 Load 125(g_sSamp_unused1) + 127: 27 SampledImage 124 126 + 129: 7(fvec4) ImageSampleImplicitLod 127 128 + 131: 19 Load 130(g_tTex_unused2) + 133: 23 Load 132(g_sSamp_unused2) + 134: 27 SampledImage 131 133 + 136: 7(fvec4) ImageSampleImplicitLod 134 135 + 137: 7(fvec4) FAdd 129 136 + ReturnValue 137 + FunctionEnd + 17(@main_ep():15(PS_OUTPUT) Function None 16 + 18: Label + 141(psout): 140(ptr) Variable Function + 142: 7(fvec4) FunctionCall 9(Func1() + 143: 7(fvec4) FunctionCall 11(Func2() + 144: 7(fvec4) FAdd 142 143 + 146: 145(ptr) AccessChain 141(psout) 45 + Store 146 144 + 147:15(PS_OUTPUT) Load 141(psout) + ReturnValue 147 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.register.subpass.frag.out b/deps/glslang/Test/baseResults/spv.register.subpass.frag.out new file mode 100644 index 00000000..c42832a9 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.register.subpass.frag.out @@ -0,0 +1,75 @@ +spv.register.subpass.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 40 + + Capability Shader + Capability InputAttachment + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 38 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 12 "result00" + Name 15 "subpass_f4" + Name 22 "result10" + Name 25 "subpass_ms_f4" + Name 29 "result73" + Name 30 "subpass_2" + Name 38 "@entryPointOutput" + Decorate 15(subpass_f4) DescriptorSet 0 + Decorate 15(subpass_f4) Binding 21 + Decorate 15(subpass_f4) InputAttachmentIndex 1 + Decorate 25(subpass_ms_f4) DescriptorSet 0 + Decorate 25(subpass_ms_f4) Binding 20 + Decorate 25(subpass_ms_f4) InputAttachmentIndex 4 + Decorate 30(subpass_2) DescriptorSet 0 + Decorate 30(subpass_2) Binding 22 + Decorate 30(subpass_2) InputAttachmentIndex 7 + Decorate 38(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypePointer Function 7(fvec4) + 13: TypeImage 6(float) SubpassData nonsampled format:Unknown + 14: TypePointer UniformConstant 13 + 15(subpass_f4): 14(ptr) Variable UniformConstant + 17: TypeInt 32 1 + 18: 17(int) Constant 0 + 19: TypeVector 17(int) 2 + 20: 19(ivec2) ConstantComposite 18 18 + 23: TypeImage 6(float) SubpassData multi-sampled nonsampled format:Unknown + 24: TypePointer UniformConstant 23 +25(subpass_ms_f4): 24(ptr) Variable UniformConstant + 27: 17(int) Constant 3 + 30(subpass_2): 14(ptr) Variable UniformConstant + 33: 6(float) Constant 0 + 34: 7(fvec4) ConstantComposite 33 33 33 33 + 37: TypePointer Output 7(fvec4) +38(@entryPointOutput): 37(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 39: 7(fvec4) FunctionCall 9(@main() + Store 38(@entryPointOutput) 39 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 12(result00): 11(ptr) Variable Function + 22(result10): 11(ptr) Variable Function + 29(result73): 11(ptr) Variable Function + 16: 13 Load 15(subpass_f4) + 21: 7(fvec4) ImageRead 16 20 + Store 12(result00) 21 + 26: 23 Load 25(subpass_ms_f4) + 28: 7(fvec4) ImageRead 26 20 Sample 27 + Store 22(result10) 28 + 31: 13 Load 30(subpass_2) + 32: 7(fvec4) ImageRead 31 20 + Store 29(result73) 32 + ReturnValue 34 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.rw.autoassign.frag.out b/deps/glslang/Test/baseResults/spv.rw.autoassign.frag.out new file mode 100644 index 00000000..2ee30bc5 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.rw.autoassign.frag.out @@ -0,0 +1,74 @@ +spv.rw.autoassign.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 42 + + Capability Shader + Capability Image1D + Capability ImageBuffer + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 39 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "PS_OUTPUT" + MemberName 8(PS_OUTPUT) 0 "Color" + Name 10 "@main(" + Name 13 "r00" + Name 16 "g_tTex1df1" + Name 23 "r01" + Name 26 "g_tBuf1du1" + Name 30 "psout" + Name 39 "@entryPointOutput.Color" + Decorate 16(g_tTex1df1) DescriptorSet 0 + Decorate 16(g_tTex1df1) Binding 20 + Decorate 26(g_tBuf1du1) DescriptorSet 0 + Decorate 26(g_tBuf1du1) Binding 21 + Decorate 39(@entryPointOutput.Color) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(PS_OUTPUT): TypeStruct 7(fvec4) + 9: TypeFunction 8(PS_OUTPUT) + 12: TypePointer Function 6(float) + 14: TypeImage 6(float) 1D nonsampled format:R32f + 15: TypePointer UniformConstant 14 + 16(g_tTex1df1): 15(ptr) Variable UniformConstant + 18: TypeInt 32 1 + 19: 18(int) Constant 0 + 21: TypeInt 32 0 + 22: TypePointer Function 21(int) + 24: TypeImage 21(int) Buffer nonsampled format:R32ui + 25: TypePointer UniformConstant 24 + 26(g_tBuf1du1): 25(ptr) Variable UniformConstant + 29: TypePointer Function 8(PS_OUTPUT) + 31: 6(float) Constant 0 + 32: 7(fvec4) ConstantComposite 31 31 31 31 + 33: TypePointer Function 7(fvec4) + 38: TypePointer Output 7(fvec4) +39(@entryPointOutput.Color): 38(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 40:8(PS_OUTPUT) FunctionCall 10(@main() + 41: 7(fvec4) CompositeExtract 40 0 + Store 39(@entryPointOutput.Color) 41 + Return + FunctionEnd + 10(@main():8(PS_OUTPUT) Function None 9 + 11: Label + 13(r00): 12(ptr) Variable Function + 23(r01): 22(ptr) Variable Function + 30(psout): 29(ptr) Variable Function + 17: 14 Load 16(g_tTex1df1) + 20: 6(float) ImageRead 17 19 + Store 13(r00) 20 + 27: 24 Load 26(g_tBuf1du1) + 28: 21(int) ImageRead 27 19 + Store 23(r01) 28 + 34: 33(ptr) AccessChain 30(psout) 19 + Store 34 32 + 35:8(PS_OUTPUT) Load 30(psout) + ReturnValue 35 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.sample.frag.out b/deps/glslang/Test/baseResults/spv.sample.frag.out new file mode 100644 index 00000000..e4d38f35 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.sample.frag.out @@ -0,0 +1,32 @@ +spv.sample.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 13 + + Capability Shader + Capability SampleRateShading + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 11 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "color" + Name 11 "samp" + Decorate 9(color) Location 0 + Decorate 11(samp) Sample + Decorate 11(samp) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(color): 8(ptr) Variable Output + 10: TypePointer Input 7(fvec4) + 11(samp): 10(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 12: 7(fvec4) Load 11(samp) + Store 9(color) 12 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.sampleId.frag.out b/deps/glslang/Test/baseResults/spv.sampleId.frag.out new file mode 100644 index 00000000..894d8db8 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.sampleId.frag.out @@ -0,0 +1,52 @@ +spv.sampleId.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 26 + + Capability Shader + Capability SampleRateShading + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 8 18 20 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 8 "gl_SampleID" + Name 18 "color" + Name 20 "samp" + Decorate 8(gl_SampleID) Flat + Decorate 8(gl_SampleID) BuiltIn SampleId + Decorate 18(color) Location 0 + Decorate 20(samp) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Input 6(int) + 8(gl_SampleID): 7(ptr) Variable Input + 10: 6(int) Constant 3 + 11: TypeBool + 15: TypeFloat 32 + 16: TypeVector 15(float) 4 + 17: TypePointer Output 16(fvec4) + 18(color): 17(ptr) Variable Output + 19: TypePointer Input 16(fvec4) + 20(samp): 19(ptr) Variable Input + 23: 15(float) Constant 1073741824 + 4(main): 2 Function None 3 + 5: Label + 9: 6(int) Load 8(gl_SampleID) + 12: 11(bool) SLessThan 9 10 + SelectionMerge 14 None + BranchConditional 12 13 22 + 13: Label + 21: 16(fvec4) Load 20(samp) + Store 18(color) 21 + Branch 14 + 22: Label + 24: 16(fvec4) Load 20(samp) + 25: 16(fvec4) VectorTimesScalar 24 23 + Store 18(color) 25 + Branch 14 + 14: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.sampleMaskOverrideCoverage.frag.out b/deps/glslang/Test/baseResults/spv.sampleMaskOverrideCoverage.frag.out new file mode 100644 index 00000000..ae7e8241 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.sampleMaskOverrideCoverage.frag.out @@ -0,0 +1,43 @@ +spv.sampleMaskOverrideCoverage.frag +error: SPIRV-Tools Validation Errors +error: Operand 2 of Decorate requires one of these capabilities: SampleMaskOverrideCoverageNV + OpDecorate %gl_SampleMask OverrideCoverageNV + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 20 + + Capability Shader + Extension "SPV_NV_sample_mask_override_coverage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 11 19 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_NV_sample_mask_override_coverage" + Name 4 "main" + Name 11 "gl_SampleMask" + Name 19 "color" + Decorate 11(gl_SampleMask) BuiltIn SampleMask + Decorate 11(gl_SampleMask) OverrideCoverageNV + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeInt 32 0 + 8: 7(int) Constant 1 + 9: TypeArray 6(int) 8 + 10: TypePointer Output 9 +11(gl_SampleMask): 10(ptr) Variable Output + 12: 6(int) Constant 0 + 13: 6(int) Constant 4294967295 + 14: TypePointer Output 6(int) + 16: TypeFloat 32 + 17: TypeVector 16(float) 4 + 18: TypePointer Input 17(fvec4) + 19(color): 18(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 15: 14(ptr) AccessChain 11(gl_SampleMask) 12 + Store 15 13 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.samplePosition.frag.out b/deps/glslang/Test/baseResults/spv.samplePosition.frag.out new file mode 100644 index 00000000..882423ee --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.samplePosition.frag.out @@ -0,0 +1,55 @@ +spv.samplePosition.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 30 + + Capability Shader + Capability SampleRateShading + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 22 24 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "gl_SamplePosition" + Name 22 "color" + Name 24 "samp" + Decorate 9(gl_SamplePosition) BuiltIn SamplePosition + Decorate 22(color) Location 0 + Decorate 24(samp) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypePointer Input 7(fvec2) +9(gl_SamplePosition): 8(ptr) Variable Input + 10: TypeInt 32 0 + 11: 10(int) Constant 1 + 12: TypePointer Input 6(float) + 15: 6(float) Constant 1056964608 + 16: TypeBool + 20: TypeVector 6(float) 4 + 21: TypePointer Output 20(fvec4) + 22(color): 21(ptr) Variable Output + 23: TypePointer Input 20(fvec4) + 24(samp): 23(ptr) Variable Input + 27: 6(float) Constant 1073741824 + 4(main): 2 Function None 3 + 5: Label + 13: 12(ptr) AccessChain 9(gl_SamplePosition) 11 + 14: 6(float) Load 13 + 17: 16(bool) FOrdLessThan 14 15 + SelectionMerge 19 None + BranchConditional 17 18 26 + 18: Label + 25: 20(fvec4) Load 24(samp) + Store 22(color) 25 + Branch 19 + 26: Label + 28: 20(fvec4) Load 24(samp) + 29: 20(fvec4) VectorTimesScalar 28 27 + Store 22(color) 29 + Branch 19 + 19: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.samplerlessTextureFunctions.frag.out b/deps/glslang/Test/baseResults/spv.samplerlessTextureFunctions.frag.out new file mode 100644 index 00000000..0f09b43e --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.samplerlessTextureFunctions.frag.out @@ -0,0 +1,93 @@ +spv.samplerlessTextureFunctions.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 51 + + Capability Shader + Capability SampledBuffer + Capability ImageQuery + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_samplerless_texture_functions" + Name 4 "main" + Name 9 "tex2DFetch" + Name 12 "tex2D" + Name 19 "texMSFetch" + Name 22 "texMS" + Name 25 "bufFetch" + Name 28 "buf" + Name 31 "tex2DFetchOffset" + Name 35 "tex2DSize" + Name 38 "texMSSize" + Name 42 "bufSize" + Name 45 "tex2DLevels" + Name 48 "texMSSamples" + Decorate 12(tex2D) DescriptorSet 0 + Decorate 12(tex2D) Binding 1 + Decorate 22(texMS) DescriptorSet 0 + Decorate 22(texMS) Binding 1 + Decorate 28(buf) DescriptorSet 0 + Decorate 28(buf) Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypeImage 6(float) 2D sampled format:Unknown + 11: TypePointer UniformConstant 10 + 12(tex2D): 11(ptr) Variable UniformConstant + 14: TypeInt 32 1 + 15: TypeVector 14(int) 2 + 16: 14(int) Constant 0 + 17: 15(ivec2) ConstantComposite 16 16 + 20: TypeImage 6(float) 2D multi-sampled sampled format:Unknown + 21: TypePointer UniformConstant 20 + 22(texMS): 21(ptr) Variable UniformConstant + 26: TypeImage 6(float) Buffer sampled format:Unknown + 27: TypePointer UniformConstant 26 + 28(buf): 27(ptr) Variable UniformConstant + 34: TypePointer Function 15(ivec2) + 41: TypePointer Function 14(int) + 4(main): 2 Function None 3 + 5: Label + 9(tex2DFetch): 8(ptr) Variable Function + 19(texMSFetch): 8(ptr) Variable Function + 25(bufFetch): 8(ptr) Variable Function +31(tex2DFetchOffset): 8(ptr) Variable Function + 35(tex2DSize): 34(ptr) Variable Function + 38(texMSSize): 34(ptr) Variable Function + 42(bufSize): 41(ptr) Variable Function + 45(tex2DLevels): 41(ptr) Variable Function +48(texMSSamples): 41(ptr) Variable Function + 13: 10 Load 12(tex2D) + 18: 7(fvec4) ImageFetch 13 17 Lod 16 + Store 9(tex2DFetch) 18 + 23: 20 Load 22(texMS) + 24: 7(fvec4) ImageFetch 23 17 Sample 16 + Store 19(texMSFetch) 24 + 29: 26 Load 28(buf) + 30: 7(fvec4) ImageFetch 29 16 + Store 25(bufFetch) 30 + 32: 10 Load 12(tex2D) + 33: 7(fvec4) ImageFetch 32 17 Lod ConstOffset 16 17 + Store 31(tex2DFetchOffset) 33 + 36: 10 Load 12(tex2D) + 37: 15(ivec2) ImageQuerySizeLod 36 16 + Store 35(tex2DSize) 37 + 39: 20 Load 22(texMS) + 40: 15(ivec2) ImageQuerySize 39 + Store 38(texMSSize) 40 + 43: 26 Load 28(buf) + 44: 14(int) ImageQuerySize 43 + Store 42(bufSize) 44 + 46: 10 Load 12(tex2D) + 47: 14(int) ImageQueryLevels 46 + Store 45(tex2DLevels) 47 + 49: 20 Load 22(texMS) + 50: 14(int) ImageQuerySamples 49 + Store 48(texMSSamples) 50 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.separate.frag.out b/deps/glslang/Test/baseResults/spv.separate.frag.out new file mode 100644 index 00000000..b9fefd70 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.separate.frag.out @@ -0,0 +1,424 @@ +spv.separate.frag +error: SPIRV-Tools Validation Errors +error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension) + OpCapability SampledRect + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 319 + + Capability Shader + Capability SampledRect + Capability Sampled1D + Capability SampledCubeArray + Capability SampledBuffer + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 11 34 + ExecutionMode 4 OriginUpperLeft + Source GLSL 400 + Name 4 "main" + Name 6 "foo(" + Name 11 "color" + Name 14 "t2d" + Name 18 "s" + Name 31 "t3d" + Name 34 "i" + Name 41 "sA" + Name 58 "tex2D" + Name 64 "texCube" + Name 71 "texCubeArray" + Name 77 "sShadow" + Name 84 "itexCubeArray" + Name 91 "utexCubeArray" + Name 98 "tex1DArray" + Name 105 "itex1DArray" + Name 112 "utex1D" + Name 119 "itex1D" + Name 126 "utex1DArray" + Name 133 "texBuffer" + Name 145 "tex2DArray" + Name 157 "itex2D" + Name 164 "itex3D" + Name 171 "itexCube" + Name 178 "itex2DArray" + Name 185 "utex2D" + Name 192 "utex3D" + Name 199 "utexCube" + Name 206 "utex2DArray" + Name 213 "itex2DRect" + Name 220 "utex2DRect" + Name 227 "itexBuffer" + Name 234 "utexBuffer" + Name 241 "tex2DMS" + Name 248 "itex2DMS" + Name 255 "utex2DMS" + Name 262 "tex2DMSArray" + Name 269 "itex2DMSArray" + Name 276 "utex2DMSArray" + Name 283 "tex1D" + Name 293 "tex3D" + Name 304 "tex2DRect" + Decorate 14(t2d) DescriptorSet 0 + Decorate 18(s) DescriptorSet 0 + Decorate 31(t3d) DescriptorSet 0 + Decorate 34(i) Flat + Decorate 41(sA) DescriptorSet 0 + Decorate 58(tex2D) DescriptorSet 0 + Decorate 64(texCube) DescriptorSet 0 + Decorate 71(texCubeArray) DescriptorSet 0 + Decorate 77(sShadow) DescriptorSet 0 + Decorate 84(itexCubeArray) DescriptorSet 0 + Decorate 91(utexCubeArray) DescriptorSet 0 + Decorate 98(tex1DArray) DescriptorSet 0 + Decorate 105(itex1DArray) DescriptorSet 0 + Decorate 112(utex1D) DescriptorSet 0 + Decorate 119(itex1D) DescriptorSet 0 + Decorate 126(utex1DArray) DescriptorSet 0 + Decorate 133(texBuffer) DescriptorSet 0 + Decorate 145(tex2DArray) DescriptorSet 0 + Decorate 157(itex2D) DescriptorSet 0 + Decorate 164(itex3D) DescriptorSet 0 + Decorate 171(itexCube) DescriptorSet 0 + Decorate 178(itex2DArray) DescriptorSet 0 + Decorate 185(utex2D) DescriptorSet 0 + Decorate 192(utex3D) DescriptorSet 0 + Decorate 199(utexCube) DescriptorSet 0 + Decorate 206(utex2DArray) DescriptorSet 0 + Decorate 213(itex2DRect) DescriptorSet 0 + Decorate 220(utex2DRect) DescriptorSet 0 + Decorate 227(itexBuffer) DescriptorSet 0 + Decorate 234(utexBuffer) DescriptorSet 0 + Decorate 241(tex2DMS) DescriptorSet 0 + Decorate 248(itex2DMS) DescriptorSet 0 + Decorate 255(utex2DMS) DescriptorSet 0 + Decorate 262(tex2DMSArray) DescriptorSet 0 + Decorate 269(itex2DMSArray) DescriptorSet 0 + Decorate 276(utex2DMSArray) DescriptorSet 0 + Decorate 283(tex1D) DescriptorSet 0 + Decorate 293(tex3D) DescriptorSet 0 + Decorate 304(tex2DRect) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypePointer Output 9(fvec4) + 11(color): 10(ptr) Variable Output + 12: TypeImage 8(float) 2D sampled format:Unknown + 13: TypePointer UniformConstant 12 + 14(t2d): 13(ptr) Variable UniformConstant + 16: TypeSampler + 17: TypePointer UniformConstant 16 + 18(s): 17(ptr) Variable UniformConstant + 20: TypeSampledImage 12 + 22: TypeVector 8(float) 2 + 23: 8(float) Constant 1056964608 + 24: 22(fvec2) ConstantComposite 23 23 + 26: TypeImage 8(float) 3D sampled format:Unknown + 27: TypeInt 32 0 + 28: 27(int) Constant 4 + 29: TypeArray 26 28 + 30: TypePointer UniformConstant 29 + 31(t3d): 30(ptr) Variable UniformConstant + 32: TypeInt 32 1 + 33: TypePointer Input 32(int) + 34(i): 33(ptr) Variable Input + 36: TypePointer UniformConstant 26 + 39: TypeArray 16 28 + 40: TypePointer UniformConstant 39 + 41(sA): 40(ptr) Variable UniformConstant + 42: 32(int) Constant 2 + 45: TypeSampledImage 26 + 47: TypeVector 8(float) 3 + 48: 47(fvec3) ConstantComposite 23 23 23 + 58(tex2D): 13(ptr) Variable UniformConstant + 62: TypeImage 8(float) Cube sampled format:Unknown + 63: TypePointer UniformConstant 62 + 64(texCube): 63(ptr) Variable UniformConstant + 67: TypeSampledImage 62 + 69: TypeImage 8(float) Cube array sampled format:Unknown + 70: TypePointer UniformConstant 69 +71(texCubeArray): 70(ptr) Variable UniformConstant + 74: TypeSampledImage 69 + 77(sShadow): 17(ptr) Variable UniformConstant + 79: TypeImage 8(float) Cube depth array sampled format:Unknown + 80: TypeSampledImage 79 + 82: TypeImage 32(int) Cube array sampled format:Unknown + 83: TypePointer UniformConstant 82 +84(itexCubeArray): 83(ptr) Variable UniformConstant + 87: TypeSampledImage 82 + 89: TypeImage 27(int) Cube array sampled format:Unknown + 90: TypePointer UniformConstant 89 +91(utexCubeArray): 90(ptr) Variable UniformConstant + 94: TypeSampledImage 89 + 96: TypeImage 8(float) 1D depth array sampled format:Unknown + 97: TypePointer UniformConstant 96 + 98(tex1DArray): 97(ptr) Variable UniformConstant + 101: TypeSampledImage 96 + 103: TypeImage 32(int) 1D array sampled format:Unknown + 104: TypePointer UniformConstant 103 +105(itex1DArray): 104(ptr) Variable UniformConstant + 108: TypeSampledImage 103 + 110: TypeImage 27(int) 1D sampled format:Unknown + 111: TypePointer UniformConstant 110 + 112(utex1D): 111(ptr) Variable UniformConstant + 115: TypeSampledImage 110 + 117: TypeImage 32(int) 1D sampled format:Unknown + 118: TypePointer UniformConstant 117 + 119(itex1D): 118(ptr) Variable UniformConstant + 122: TypeSampledImage 117 + 124: TypeImage 27(int) 1D array sampled format:Unknown + 125: TypePointer UniformConstant 124 +126(utex1DArray): 125(ptr) Variable UniformConstant + 129: TypeSampledImage 124 + 131: TypeImage 8(float) Buffer sampled format:Unknown + 132: TypePointer UniformConstant 131 + 133(texBuffer): 132(ptr) Variable UniformConstant + 136: TypeSampledImage 131 + 140: TypeImage 8(float) Cube depth sampled format:Unknown + 141: TypeSampledImage 140 + 143: TypeImage 8(float) 2D array sampled format:Unknown + 144: TypePointer UniformConstant 143 + 145(tex2DArray): 144(ptr) Variable UniformConstant + 148: TypeSampledImage 143 + 152: TypeImage 8(float) 2D depth array sampled format:Unknown + 153: TypeSampledImage 152 + 155: TypeImage 32(int) 2D sampled format:Unknown + 156: TypePointer UniformConstant 155 + 157(itex2D): 156(ptr) Variable UniformConstant + 160: TypeSampledImage 155 + 162: TypeImage 32(int) 3D sampled format:Unknown + 163: TypePointer UniformConstant 162 + 164(itex3D): 163(ptr) Variable UniformConstant + 167: TypeSampledImage 162 + 169: TypeImage 32(int) Cube sampled format:Unknown + 170: TypePointer UniformConstant 169 + 171(itexCube): 170(ptr) Variable UniformConstant + 174: TypeSampledImage 169 + 176: TypeImage 32(int) 2D array sampled format:Unknown + 177: TypePointer UniformConstant 176 +178(itex2DArray): 177(ptr) Variable UniformConstant + 181: TypeSampledImage 176 + 183: TypeImage 27(int) 2D sampled format:Unknown + 184: TypePointer UniformConstant 183 + 185(utex2D): 184(ptr) Variable UniformConstant + 188: TypeSampledImage 183 + 190: TypeImage 27(int) 3D sampled format:Unknown + 191: TypePointer UniformConstant 190 + 192(utex3D): 191(ptr) Variable UniformConstant + 195: TypeSampledImage 190 + 197: TypeImage 27(int) Cube sampled format:Unknown + 198: TypePointer UniformConstant 197 + 199(utexCube): 198(ptr) Variable UniformConstant + 202: TypeSampledImage 197 + 204: TypeImage 27(int) 2D array sampled format:Unknown + 205: TypePointer UniformConstant 204 +206(utex2DArray): 205(ptr) Variable UniformConstant + 209: TypeSampledImage 204 + 211: TypeImage 32(int) Rect sampled format:Unknown + 212: TypePointer UniformConstant 211 + 213(itex2DRect): 212(ptr) Variable UniformConstant + 216: TypeSampledImage 211 + 218: TypeImage 27(int) Rect sampled format:Unknown + 219: TypePointer UniformConstant 218 + 220(utex2DRect): 219(ptr) Variable UniformConstant + 223: TypeSampledImage 218 + 225: TypeImage 32(int) Buffer sampled format:Unknown + 226: TypePointer UniformConstant 225 + 227(itexBuffer): 226(ptr) Variable UniformConstant + 230: TypeSampledImage 225 + 232: TypeImage 27(int) Buffer sampled format:Unknown + 233: TypePointer UniformConstant 232 + 234(utexBuffer): 233(ptr) Variable UniformConstant + 237: TypeSampledImage 232 + 239: TypeImage 8(float) 2D multi-sampled sampled format:Unknown + 240: TypePointer UniformConstant 239 + 241(tex2DMS): 240(ptr) Variable UniformConstant + 244: TypeSampledImage 239 + 246: TypeImage 32(int) 2D multi-sampled sampled format:Unknown + 247: TypePointer UniformConstant 246 + 248(itex2DMS): 247(ptr) Variable UniformConstant + 251: TypeSampledImage 246 + 253: TypeImage 27(int) 2D multi-sampled sampled format:Unknown + 254: TypePointer UniformConstant 253 + 255(utex2DMS): 254(ptr) Variable UniformConstant + 258: TypeSampledImage 253 + 260: TypeImage 8(float) 2D array multi-sampled sampled format:Unknown + 261: TypePointer UniformConstant 260 +262(tex2DMSArray): 261(ptr) Variable UniformConstant + 265: TypeSampledImage 260 + 267: TypeImage 32(int) 2D array multi-sampled sampled format:Unknown + 268: TypePointer UniformConstant 267 +269(itex2DMSArray): 268(ptr) Variable UniformConstant + 272: TypeSampledImage 267 + 274: TypeImage 27(int) 2D array multi-sampled sampled format:Unknown + 275: TypePointer UniformConstant 274 +276(utex2DMSArray): 275(ptr) Variable UniformConstant + 279: TypeSampledImage 274 + 281: TypeImage 8(float) 1D sampled format:Unknown + 282: TypePointer UniformConstant 281 + 283(tex1D): 282(ptr) Variable UniformConstant + 286: TypeSampledImage 281 + 290: TypeImage 8(float) 1D depth sampled format:Unknown + 291: TypeSampledImage 290 + 293(tex3D): 36(ptr) Variable UniformConstant + 299: TypeImage 8(float) 2D depth sampled format:Unknown + 300: TypeSampledImage 299 + 302: TypeImage 8(float) Rect sampled format:Unknown + 303: TypePointer UniformConstant 302 + 304(tex2DRect): 303(ptr) Variable UniformConstant + 307: TypeSampledImage 302 + 311: TypeImage 8(float) Rect depth sampled format:Unknown + 312: TypeSampledImage 311 + 316: TypeImage 8(float) 1D array sampled format:Unknown + 317: TypeSampledImage 316 + 4(main): 2 Function None 3 + 5: Label + 15: 12 Load 14(t2d) + 19: 16 Load 18(s) + 21: 20 SampledImage 15 19 + 25: 9(fvec4) ImageSampleImplicitLod 21 24 + Store 11(color) 25 + 35: 32(int) Load 34(i) + 37: 36(ptr) AccessChain 31(t3d) 35 + 38: 26 Load 37 + 43: 17(ptr) AccessChain 41(sA) 42 + 44: 16 Load 43 + 46: 45 SampledImage 38 44 + 49: 9(fvec4) ImageSampleImplicitLod 46 48 + 50: 9(fvec4) Load 11(color) + 51: 9(fvec4) FAdd 50 49 + Store 11(color) 51 + 52: 12 Load 14(t2d) + 53: 16 Load 18(s) + 54: 20 SampledImage 52 53 + 55: 9(fvec4) ImageSampleImplicitLod 54 24 + 56: 9(fvec4) Load 11(color) + 57: 9(fvec4) FAdd 56 55 + Store 11(color) 57 + Return + FunctionEnd + 6(foo(): 2 Function None 3 + 7: Label + 59: 12 Load 58(tex2D) + 60: 16 Load 18(s) + 61: 20 SampledImage 59 60 + 65: 62 Load 64(texCube) + 66: 16 Load 18(s) + 68: 67 SampledImage 65 66 + 72: 69 Load 71(texCubeArray) + 73: 16 Load 18(s) + 75: 74 SampledImage 72 73 + 76: 69 Load 71(texCubeArray) + 78: 16 Load 77(sShadow) + 81: 80 SampledImage 76 78 + 85: 82 Load 84(itexCubeArray) + 86: 16 Load 18(s) + 88: 87 SampledImage 85 86 + 92: 89 Load 91(utexCubeArray) + 93: 16 Load 18(s) + 95: 94 SampledImage 92 93 + 99: 96 Load 98(tex1DArray) + 100: 16 Load 77(sShadow) + 102: 101 SampledImage 99 100 + 106: 103 Load 105(itex1DArray) + 107: 16 Load 18(s) + 109: 108 SampledImage 106 107 + 113: 110 Load 112(utex1D) + 114: 16 Load 18(s) + 116: 115 SampledImage 113 114 + 120: 117 Load 119(itex1D) + 121: 16 Load 18(s) + 123: 122 SampledImage 120 121 + 127: 124 Load 126(utex1DArray) + 128: 16 Load 18(s) + 130: 129 SampledImage 127 128 + 134: 131 Load 133(texBuffer) + 135: 16 Load 18(s) + 137: 136 SampledImage 134 135 + 138: 62 Load 64(texCube) + 139: 16 Load 77(sShadow) + 142: 141 SampledImage 138 139 + 146: 143 Load 145(tex2DArray) + 147: 16 Load 18(s) + 149: 148 SampledImage 146 147 + 150: 143 Load 145(tex2DArray) + 151: 16 Load 77(sShadow) + 154: 153 SampledImage 150 151 + 158: 155 Load 157(itex2D) + 159: 16 Load 18(s) + 161: 160 SampledImage 158 159 + 165: 162 Load 164(itex3D) + 166: 16 Load 18(s) + 168: 167 SampledImage 165 166 + 172: 169 Load 171(itexCube) + 173: 16 Load 18(s) + 175: 174 SampledImage 172 173 + 179: 176 Load 178(itex2DArray) + 180: 16 Load 18(s) + 182: 181 SampledImage 179 180 + 186: 183 Load 185(utex2D) + 187: 16 Load 18(s) + 189: 188 SampledImage 186 187 + 193: 190 Load 192(utex3D) + 194: 16 Load 18(s) + 196: 195 SampledImage 193 194 + 200: 197 Load 199(utexCube) + 201: 16 Load 18(s) + 203: 202 SampledImage 200 201 + 207: 204 Load 206(utex2DArray) + 208: 16 Load 18(s) + 210: 209 SampledImage 207 208 + 214: 211 Load 213(itex2DRect) + 215: 16 Load 18(s) + 217: 216 SampledImage 214 215 + 221: 218 Load 220(utex2DRect) + 222: 16 Load 18(s) + 224: 223 SampledImage 221 222 + 228: 225 Load 227(itexBuffer) + 229: 16 Load 18(s) + 231: 230 SampledImage 228 229 + 235: 232 Load 234(utexBuffer) + 236: 16 Load 18(s) + 238: 237 SampledImage 235 236 + 242: 239 Load 241(tex2DMS) + 243: 16 Load 18(s) + 245: 244 SampledImage 242 243 + 249: 246 Load 248(itex2DMS) + 250: 16 Load 18(s) + 252: 251 SampledImage 249 250 + 256: 253 Load 255(utex2DMS) + 257: 16 Load 18(s) + 259: 258 SampledImage 256 257 + 263: 260 Load 262(tex2DMSArray) + 264: 16 Load 18(s) + 266: 265 SampledImage 263 264 + 270: 267 Load 269(itex2DMSArray) + 271: 16 Load 18(s) + 273: 272 SampledImage 270 271 + 277: 274 Load 276(utex2DMSArray) + 278: 16 Load 18(s) + 280: 279 SampledImage 277 278 + 284: 281 Load 283(tex1D) + 285: 16 Load 18(s) + 287: 286 SampledImage 284 285 + 288: 281 Load 283(tex1D) + 289: 16 Load 77(sShadow) + 292: 291 SampledImage 288 289 + 294: 26 Load 293(tex3D) + 295: 16 Load 18(s) + 296: 45 SampledImage 294 295 + 297: 12 Load 58(tex2D) + 298: 16 Load 77(sShadow) + 301: 300 SampledImage 297 298 + 305: 302 Load 304(tex2DRect) + 306: 16 Load 18(s) + 308: 307 SampledImage 305 306 + 309: 302 Load 304(tex2DRect) + 310: 16 Load 77(sShadow) + 313: 312 SampledImage 309 310 + 314: 96 Load 98(tex1DArray) + 315: 16 Load 18(s) + 318: 317 SampledImage 314 315 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.set.vert.out b/deps/glslang/Test/baseResults/spv.set.vert.out new file mode 100644 index 00000000..16d771fc --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.set.vert.out @@ -0,0 +1,45 @@ +spv.set.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 22 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 9 + Source GLSL 450 + Name 4 "main" + Name 9 "color" + Name 10 "setBuf" + MemberName 10(setBuf) 0 "color" + Name 12 "setBufInst" + Name 21 "samp2D" + MemberDecorate 10(setBuf) 0 Offset 0 + Decorate 10(setBuf) BufferBlock + Decorate 12(setBufInst) DescriptorSet 0 + Decorate 12(setBufInst) Binding 8 + Decorate 21(samp2D) DescriptorSet 4 + Decorate 21(samp2D) Binding 7 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(color): 8(ptr) Variable Output + 10(setBuf): TypeStruct 7(fvec4) + 11: TypePointer Uniform 10(setBuf) + 12(setBufInst): 11(ptr) Variable Uniform + 13: TypeInt 32 1 + 14: 13(int) Constant 0 + 15: TypePointer Uniform 7(fvec4) + 18: TypeImage 6(float) 2D sampled format:Unknown + 19: TypeSampledImage 18 + 20: TypePointer UniformConstant 19 + 21(samp2D): 20(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 16: 15(ptr) AccessChain 12(setBufInst) 14 + 17: 7(fvec4) Load 16 + Store 9(color) 17 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.shaderBallot.comp.out b/deps/glslang/Test/baseResults/spv.shaderBallot.comp.out new file mode 100644 index 00000000..2f0e5a0b --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.shaderBallot.comp.out @@ -0,0 +1,373 @@ +spv.shaderBallot.comp +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 298 + + Capability Shader + Capability Int64 + Capability SubgroupBallotKHR + Extension "SPV_KHR_shader_ballot" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 10 12 21 23 26 29 32 + ExecutionMode 4 LocalSize 8 8 1 + Source GLSL 450 + SourceExtension "GL_ARB_gpu_shader_int64" + SourceExtension "GL_ARB_shader_ballot" + Name 4 "main" + Name 8 "invocation" + Name 10 "gl_SubGroupInvocationARB" + Name 12 "gl_SubGroupSizeARB" + Name 19 "relMask" + Name 21 "gl_SubGroupEqMaskARB" + Name 23 "gl_SubGroupGeMaskARB" + Name 26 "gl_SubGroupGtMaskARB" + Name 29 "gl_SubGroupLeMaskARB" + Name 32 "gl_SubGroupLtMaskARB" + Name 52 "Buffers" + MemberName 52(Buffers) 0 "f4" + MemberName 52(Buffers) 1 "i4" + MemberName 52(Buffers) 2 "u4" + Name 55 "data" + Decorate 10(gl_SubGroupInvocationARB) BuiltIn SubgroupLocalInvocationId + Decorate 12(gl_SubGroupSizeARB) BuiltIn SubgroupSize + Decorate 21(gl_SubGroupEqMaskARB) BuiltIn SubgroupEqMaskKHR + Decorate 23(gl_SubGroupGeMaskARB) BuiltIn SubgroupGeMaskKHR + Decorate 26(gl_SubGroupGtMaskARB) BuiltIn SubgroupGtMaskKHR + Decorate 29(gl_SubGroupLeMaskARB) BuiltIn SubgroupLeMaskKHR + Decorate 32(gl_SubGroupLtMaskARB) BuiltIn SubgroupLtMaskKHR + MemberDecorate 52(Buffers) 0 Offset 0 + MemberDecorate 52(Buffers) 1 Offset 16 + MemberDecorate 52(Buffers) 2 Offset 32 + Decorate 52(Buffers) BufferBlock + Decorate 55(data) DescriptorSet 0 + Decorate 55(data) Binding 0 + Decorate 297 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypePointer Input 6(int) +10(gl_SubGroupInvocationARB): 9(ptr) Variable Input +12(gl_SubGroupSizeARB): 9(ptr) Variable Input + 15: 6(int) Constant 4 + 17: TypeInt 64 0 + 18: TypePointer Function 17(int64_t) + 20: TypePointer Input 17(int64_t) +21(gl_SubGroupEqMaskARB): 20(ptr) Variable Input +23(gl_SubGroupGeMaskARB): 20(ptr) Variable Input +26(gl_SubGroupGtMaskARB): 20(ptr) Variable Input +29(gl_SubGroupLeMaskARB): 20(ptr) Variable Input +32(gl_SubGroupLtMaskARB): 20(ptr) Variable Input + 36: TypeBool + 37: 36(bool) ConstantTrue + 38: TypeVector 6(int) 4 + 42: TypeVector 6(int) 2 + 48: TypeFloat 32 + 49: TypeVector 48(float) 4 + 50: TypeInt 32 1 + 51: TypeVector 50(int) 4 + 52(Buffers): TypeStruct 49(fvec4) 51(ivec4) 38(ivec4) + 53: TypeArray 52(Buffers) 15 + 54: TypePointer Uniform 53 + 55(data): 54(ptr) Variable Uniform + 57: 50(int) Constant 0 + 58: 6(int) Constant 0 + 59: TypePointer Uniform 48(float) + 66: 50(int) Constant 1 + 67: TypeVector 48(float) 2 + 68: TypePointer Uniform 49(fvec4) + 82: 50(int) Constant 2 + 83: TypeVector 48(float) 3 + 99: 50(int) Constant 3 + 114: TypePointer Uniform 50(int) + 121: TypeVector 50(int) 2 + 122: TypePointer Uniform 51(ivec4) + 136: TypeVector 50(int) 3 + 166: TypePointer Uniform 6(int) + 173: TypePointer Uniform 38(ivec4) + 187: TypeVector 6(int) 3 + 295: 6(int) Constant 8 + 296: 6(int) Constant 1 + 297: 187(ivec3) ConstantComposite 295 295 296 + 4(main): 2 Function None 3 + 5: Label + 8(invocation): 7(ptr) Variable Function + 19(relMask): 18(ptr) Variable Function + 11: 6(int) Load 10(gl_SubGroupInvocationARB) + 13: 6(int) Load 12(gl_SubGroupSizeARB) + 14: 6(int) IAdd 11 13 + 16: 6(int) UMod 14 15 + Store 8(invocation) 16 + 22: 17(int64_t) Load 21(gl_SubGroupEqMaskARB) + 24: 17(int64_t) Load 23(gl_SubGroupGeMaskARB) + 25: 17(int64_t) IAdd 22 24 + 27: 17(int64_t) Load 26(gl_SubGroupGtMaskARB) + 28: 17(int64_t) IAdd 25 27 + 30: 17(int64_t) Load 29(gl_SubGroupLeMaskARB) + 31: 17(int64_t) IAdd 28 30 + 33: 17(int64_t) Load 32(gl_SubGroupLtMaskARB) + 34: 17(int64_t) IAdd 31 33 + Store 19(relMask) 34 + 35: 17(int64_t) Load 19(relMask) + 39: 38(ivec4) SubgroupBallotKHR 37 + 40: 6(int) CompositeExtract 39 0 + 41: 6(int) CompositeExtract 39 1 + 43: 42(ivec2) CompositeConstruct 40 41 + 44: 17(int64_t) Bitcast 43 + 45: 36(bool) IEqual 35 44 + SelectionMerge 47 None + BranchConditional 45 46 216 + 46: Label + 56: 6(int) Load 8(invocation) + 60: 59(ptr) AccessChain 55(data) 57 57 58 + 61: 48(float) Load 60 + 62: 6(int) Load 8(invocation) + 63: 48(float) SubgroupReadInvocationKHR 61 62 + 64: 59(ptr) AccessChain 55(data) 56 57 58 + Store 64 63 + 65: 6(int) Load 8(invocation) + 69: 68(ptr) AccessChain 55(data) 66 57 + 70: 49(fvec4) Load 69 + 71: 67(fvec2) VectorShuffle 70 70 0 1 + 72: 6(int) Load 8(invocation) + 73: 48(float) CompositeExtract 71 0 + 74: 48(float) SubgroupReadInvocationKHR 73 72 + 75: 48(float) CompositeExtract 71 1 + 76: 48(float) SubgroupReadInvocationKHR 75 72 + 77: 67(fvec2) CompositeConstruct 74 76 + 78: 68(ptr) AccessChain 55(data) 65 57 + 79: 49(fvec4) Load 78 + 80: 49(fvec4) VectorShuffle 79 77 4 5 2 3 + Store 78 80 + 81: 6(int) Load 8(invocation) + 84: 68(ptr) AccessChain 55(data) 82 57 + 85: 49(fvec4) Load 84 + 86: 83(fvec3) VectorShuffle 85 85 0 1 2 + 87: 6(int) Load 8(invocation) + 88: 48(float) CompositeExtract 86 0 + 89: 48(float) SubgroupReadInvocationKHR 88 87 + 90: 48(float) CompositeExtract 86 1 + 91: 48(float) SubgroupReadInvocationKHR 90 87 + 92: 48(float) CompositeExtract 86 2 + 93: 48(float) SubgroupReadInvocationKHR 92 87 + 94: 83(fvec3) CompositeConstruct 89 91 93 + 95: 68(ptr) AccessChain 55(data) 81 57 + 96: 49(fvec4) Load 95 + 97: 49(fvec4) VectorShuffle 96 94 4 5 6 3 + Store 95 97 + 98: 6(int) Load 8(invocation) + 100: 68(ptr) AccessChain 55(data) 99 57 + 101: 49(fvec4) Load 100 + 102: 6(int) Load 8(invocation) + 103: 48(float) CompositeExtract 101 0 + 104: 48(float) SubgroupReadInvocationKHR 103 102 + 105: 48(float) CompositeExtract 101 1 + 106: 48(float) SubgroupReadInvocationKHR 105 102 + 107: 48(float) CompositeExtract 101 2 + 108: 48(float) SubgroupReadInvocationKHR 107 102 + 109: 48(float) CompositeExtract 101 3 + 110: 48(float) SubgroupReadInvocationKHR 109 102 + 111: 49(fvec4) CompositeConstruct 104 106 108 110 + 112: 68(ptr) AccessChain 55(data) 98 57 + Store 112 111 + 113: 6(int) Load 8(invocation) + 115: 114(ptr) AccessChain 55(data) 57 66 58 + 116: 50(int) Load 115 + 117: 6(int) Load 8(invocation) + 118: 50(int) SubgroupReadInvocationKHR 116 117 + 119: 114(ptr) AccessChain 55(data) 113 66 58 + Store 119 118 + 120: 6(int) Load 8(invocation) + 123: 122(ptr) AccessChain 55(data) 66 66 + 124: 51(ivec4) Load 123 + 125: 121(ivec2) VectorShuffle 124 124 0 1 + 126: 6(int) Load 8(invocation) + 127: 50(int) CompositeExtract 125 0 + 128: 50(int) SubgroupReadInvocationKHR 127 126 + 129: 50(int) CompositeExtract 125 1 + 130: 50(int) SubgroupReadInvocationKHR 129 126 + 131: 121(ivec2) CompositeConstruct 128 130 + 132: 122(ptr) AccessChain 55(data) 120 66 + 133: 51(ivec4) Load 132 + 134: 51(ivec4) VectorShuffle 133 131 4 5 2 3 + Store 132 134 + 135: 6(int) Load 8(invocation) + 137: 122(ptr) AccessChain 55(data) 82 66 + 138: 51(ivec4) Load 137 + 139: 136(ivec3) VectorShuffle 138 138 0 1 2 + 140: 6(int) Load 8(invocation) + 141: 50(int) CompositeExtract 139 0 + 142: 50(int) SubgroupReadInvocationKHR 141 140 + 143: 50(int) CompositeExtract 139 1 + 144: 50(int) SubgroupReadInvocationKHR 143 140 + 145: 50(int) CompositeExtract 139 2 + 146: 50(int) SubgroupReadInvocationKHR 145 140 + 147: 136(ivec3) CompositeConstruct 142 144 146 + 148: 122(ptr) AccessChain 55(data) 135 66 + 149: 51(ivec4) Load 148 + 150: 51(ivec4) VectorShuffle 149 147 4 5 6 3 + Store 148 150 + 151: 6(int) Load 8(invocation) + 152: 122(ptr) AccessChain 55(data) 99 66 + 153: 51(ivec4) Load 152 + 154: 6(int) Load 8(invocation) + 155: 50(int) CompositeExtract 153 0 + 156: 50(int) SubgroupReadInvocationKHR 155 154 + 157: 50(int) CompositeExtract 153 1 + 158: 50(int) SubgroupReadInvocationKHR 157 154 + 159: 50(int) CompositeExtract 153 2 + 160: 50(int) SubgroupReadInvocationKHR 159 154 + 161: 50(int) CompositeExtract 153 3 + 162: 50(int) SubgroupReadInvocationKHR 161 154 + 163: 51(ivec4) CompositeConstruct 156 158 160 162 + 164: 122(ptr) AccessChain 55(data) 151 66 + Store 164 163 + 165: 6(int) Load 8(invocation) + 167: 166(ptr) AccessChain 55(data) 57 82 58 + 168: 6(int) Load 167 + 169: 6(int) Load 8(invocation) + 170: 6(int) SubgroupReadInvocationKHR 168 169 + 171: 166(ptr) AccessChain 55(data) 165 82 58 + Store 171 170 + 172: 6(int) Load 8(invocation) + 174: 173(ptr) AccessChain 55(data) 66 82 + 175: 38(ivec4) Load 174 + 176: 42(ivec2) VectorShuffle 175 175 0 1 + 177: 6(int) Load 8(invocation) + 178: 6(int) CompositeExtract 176 0 + 179: 6(int) SubgroupReadInvocationKHR 178 177 + 180: 6(int) CompositeExtract 176 1 + 181: 6(int) SubgroupReadInvocationKHR 180 177 + 182: 42(ivec2) CompositeConstruct 179 181 + 183: 173(ptr) AccessChain 55(data) 172 82 + 184: 38(ivec4) Load 183 + 185: 38(ivec4) VectorShuffle 184 182 4 5 2 3 + Store 183 185 + 186: 6(int) Load 8(invocation) + 188: 173(ptr) AccessChain 55(data) 82 82 + 189: 38(ivec4) Load 188 + 190: 187(ivec3) VectorShuffle 189 189 0 1 2 + 191: 6(int) Load 8(invocation) + 192: 6(int) CompositeExtract 190 0 + 193: 6(int) SubgroupReadInvocationKHR 192 191 + 194: 6(int) CompositeExtract 190 1 + 195: 6(int) SubgroupReadInvocationKHR 194 191 + 196: 6(int) CompositeExtract 190 2 + 197: 6(int) SubgroupReadInvocationKHR 196 191 + 198: 187(ivec3) CompositeConstruct 193 195 197 + 199: 173(ptr) AccessChain 55(data) 186 82 + 200: 38(ivec4) Load 199 + 201: 38(ivec4) VectorShuffle 200 198 4 5 6 3 + Store 199 201 + 202: 6(int) Load 8(invocation) + 203: 173(ptr) AccessChain 55(data) 99 82 + 204: 38(ivec4) Load 203 + 205: 6(int) Load 8(invocation) + 206: 6(int) CompositeExtract 204 0 + 207: 6(int) SubgroupReadInvocationKHR 206 205 + 208: 6(int) CompositeExtract 204 1 + 209: 6(int) SubgroupReadInvocationKHR 208 205 + 210: 6(int) CompositeExtract 204 2 + 211: 6(int) SubgroupReadInvocationKHR 210 205 + 212: 6(int) CompositeExtract 204 3 + 213: 6(int) SubgroupReadInvocationKHR 212 205 + 214: 38(ivec4) CompositeConstruct 207 209 211 213 + 215: 173(ptr) AccessChain 55(data) 202 82 + Store 215 214 + Branch 47 + 216: Label + 217: 6(int) Load 8(invocation) + 218: 59(ptr) AccessChain 55(data) 57 57 58 + 219: 48(float) Load 218 + 220: 48(float) SubgroupFirstInvocationKHR 219 + 221: 59(ptr) AccessChain 55(data) 217 57 58 + Store 221 220 + 222: 6(int) Load 8(invocation) + 223: 68(ptr) AccessChain 55(data) 66 57 + 224: 49(fvec4) Load 223 + 225: 67(fvec2) VectorShuffle 224 224 0 1 + 226: 67(fvec2) SubgroupFirstInvocationKHR 225 + 227: 68(ptr) AccessChain 55(data) 222 57 + 228: 49(fvec4) Load 227 + 229: 49(fvec4) VectorShuffle 228 226 4 5 2 3 + Store 227 229 + 230: 6(int) Load 8(invocation) + 231: 68(ptr) AccessChain 55(data) 82 57 + 232: 49(fvec4) Load 231 + 233: 83(fvec3) VectorShuffle 232 232 0 1 2 + 234: 83(fvec3) SubgroupFirstInvocationKHR 233 + 235: 68(ptr) AccessChain 55(data) 230 57 + 236: 49(fvec4) Load 235 + 237: 49(fvec4) VectorShuffle 236 234 4 5 6 3 + Store 235 237 + 238: 6(int) Load 8(invocation) + 239: 68(ptr) AccessChain 55(data) 99 57 + 240: 49(fvec4) Load 239 + 241: 49(fvec4) SubgroupFirstInvocationKHR 240 + 242: 68(ptr) AccessChain 55(data) 238 57 + Store 242 241 + 243: 6(int) Load 8(invocation) + 244: 114(ptr) AccessChain 55(data) 57 66 58 + 245: 50(int) Load 244 + 246: 50(int) SubgroupFirstInvocationKHR 245 + 247: 114(ptr) AccessChain 55(data) 243 66 58 + Store 247 246 + 248: 6(int) Load 8(invocation) + 249: 122(ptr) AccessChain 55(data) 66 66 + 250: 51(ivec4) Load 249 + 251: 121(ivec2) VectorShuffle 250 250 0 1 + 252: 121(ivec2) SubgroupFirstInvocationKHR 251 + 253: 122(ptr) AccessChain 55(data) 248 66 + 254: 51(ivec4) Load 253 + 255: 51(ivec4) VectorShuffle 254 252 4 5 2 3 + Store 253 255 + 256: 6(int) Load 8(invocation) + 257: 122(ptr) AccessChain 55(data) 82 66 + 258: 51(ivec4) Load 257 + 259: 136(ivec3) VectorShuffle 258 258 0 1 2 + 260: 136(ivec3) SubgroupFirstInvocationKHR 259 + 261: 122(ptr) AccessChain 55(data) 256 66 + 262: 51(ivec4) Load 261 + 263: 51(ivec4) VectorShuffle 262 260 4 5 6 3 + Store 261 263 + 264: 6(int) Load 8(invocation) + 265: 122(ptr) AccessChain 55(data) 99 66 + 266: 51(ivec4) Load 265 + 267: 51(ivec4) SubgroupFirstInvocationKHR 266 + 268: 122(ptr) AccessChain 55(data) 264 66 + Store 268 267 + 269: 6(int) Load 8(invocation) + 270: 166(ptr) AccessChain 55(data) 57 82 58 + 271: 6(int) Load 270 + 272: 6(int) SubgroupFirstInvocationKHR 271 + 273: 166(ptr) AccessChain 55(data) 269 82 58 + Store 273 272 + 274: 6(int) Load 8(invocation) + 275: 173(ptr) AccessChain 55(data) 66 82 + 276: 38(ivec4) Load 275 + 277: 42(ivec2) VectorShuffle 276 276 0 1 + 278: 42(ivec2) SubgroupFirstInvocationKHR 277 + 279: 173(ptr) AccessChain 55(data) 274 82 + 280: 38(ivec4) Load 279 + 281: 38(ivec4) VectorShuffle 280 278 4 5 2 3 + Store 279 281 + 282: 6(int) Load 8(invocation) + 283: 173(ptr) AccessChain 55(data) 82 82 + 284: 38(ivec4) Load 283 + 285: 187(ivec3) VectorShuffle 284 284 0 1 2 + 286: 187(ivec3) SubgroupFirstInvocationKHR 285 + 287: 173(ptr) AccessChain 55(data) 282 82 + 288: 38(ivec4) Load 287 + 289: 38(ivec4) VectorShuffle 288 286 4 5 6 3 + Store 287 289 + 290: 6(int) Load 8(invocation) + 291: 173(ptr) AccessChain 55(data) 99 82 + 292: 38(ivec4) Load 291 + 293: 38(ivec4) SubgroupFirstInvocationKHR 292 + 294: 173(ptr) AccessChain 55(data) 290 82 + Store 294 293 + Branch 47 + 47: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.shaderBallotAMD.comp.out b/deps/glslang/Test/baseResults/spv.shaderBallotAMD.comp.out new file mode 100644 index 00000000..5219a3a4 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.shaderBallotAMD.comp.out @@ -0,0 +1,1557 @@ +spv.shaderBallotAMD.comp +error: SPIRV-Tools Validation Errors +error: Capability Float16 is not allowed by Vulkan 1.0 specification (or requires extension) + OpCapability Float16 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 1343 + + Capability Shader + Capability Float16 + Capability Float64 + Capability Int64 + Capability Groups + Capability Int16 + Capability StorageUniformBufferBlock16 + Extension "SPV_AMD_shader_ballot" + Extension "SPV_KHR_16bit_storage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" + ExecutionMode 4 LocalSize 8 8 1 + Source GLSL 450 + SourceExtension "GL_AMD_gpu_shader_half_float" + SourceExtension "GL_AMD_gpu_shader_int16" + SourceExtension "GL_AMD_shader_ballot" + SourceExtension "GL_ARB_gpu_shader_int64" + Name 4 "main" + Name 21 "Buffers" + MemberName 21(Buffers) 0 "i" + MemberName 21(Buffers) 1 "uv" + MemberName 21(Buffers) 2 "fv" + MemberName 21(Buffers) 3 "dv" + MemberName 21(Buffers) 4 "i64" + MemberName 21(Buffers) 5 "u64v" + MemberName 21(Buffers) 6 "f16v" + MemberName 21(Buffers) 7 "i16v" + MemberName 21(Buffers) 8 "u16" + Name 23 "" + MemberDecorate 21(Buffers) 0 Offset 0 + MemberDecorate 21(Buffers) 1 Offset 8 + MemberDecorate 21(Buffers) 2 Offset 16 + MemberDecorate 21(Buffers) 3 Offset 32 + MemberDecorate 21(Buffers) 4 Offset 64 + MemberDecorate 21(Buffers) 5 Offset 80 + MemberDecorate 21(Buffers) 6 Offset 96 + MemberDecorate 21(Buffers) 7 Offset 104 + MemberDecorate 21(Buffers) 8 Offset 112 + Decorate 21(Buffers) BufferBlock + Decorate 23 DescriptorSet 0 + Decorate 23 Binding 0 + Decorate 1342 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeInt 32 0 + 8: TypeVector 7(int) 2 + 9: TypeFloat 32 + 10: TypeVector 9(float) 3 + 11: TypeFloat 64 + 12: TypeVector 11(float64_t) 4 + 13: TypeInt 64 1 + 14: TypeInt 64 0 + 15: TypeVector 14(int64_t) 2 + 16: TypeFloat 16 + 17: TypeVector 16(float16_t) 3 + 18: TypeInt 16 1 + 19: TypeVector 18(int16_t) 4 + 20: TypeInt 16 0 + 21(Buffers): TypeStruct 6(int) 8(ivec2) 10(fvec3) 12(f64vec4) 13(int64_t) 15(i64vec2) 17(f16vec3) 19(i16vec4) 20(int16_t) + 22: TypePointer Uniform 21(Buffers) + 23: 22(ptr) Variable Uniform + 24: 6(int) Constant 0 + 25: TypePointer Uniform 6(int) + 28: 7(int) Constant 3 + 31: 6(int) Constant 1 + 32: TypePointer Uniform 8(ivec2) + 41: 6(int) Constant 2 + 42: TypePointer Uniform 10(fvec3) + 53: 6(int) Constant 3 + 54: TypePointer Uniform 12(f64vec4) + 67: 6(int) Constant 4 + 68: TypePointer Uniform 13(int64_t) + 73: 6(int) Constant 5 + 74: TypePointer Uniform 15(i64vec2) + 83: 6(int) Constant 6 + 84: TypePointer Uniform 17(f16vec3) + 95: 6(int) Constant 7 + 96: TypePointer Uniform 19(i16vec4) + 109: 6(int) Constant 8 + 110: TypePointer Uniform 20(int16_t) + 1339: TypeVector 7(int) 3 + 1340: 7(int) Constant 8 + 1341: 7(int) Constant 1 + 1342: 1339(ivec3) ConstantComposite 1340 1340 1341 + 4(main): 2 Function None 3 + 5: Label + 26: 25(ptr) AccessChain 23 24 + 27: 6(int) Load 26 + 29: 6(int) GroupSMin 28 Reduce 27 + 30: 25(ptr) AccessChain 23 24 + Store 30 29 + 33: 32(ptr) AccessChain 23 31 + 34: 8(ivec2) Load 33 + 35: 7(int) CompositeExtract 34 0 + 36: 7(int) GroupUMin 28 Reduce 35 + 37: 7(int) CompositeExtract 34 1 + 38: 7(int) GroupUMin 28 Reduce 37 + 39: 8(ivec2) CompositeConstruct 36 38 + 40: 32(ptr) AccessChain 23 31 + Store 40 39 + 43: 42(ptr) AccessChain 23 41 + 44: 10(fvec3) Load 43 + 45: 9(float) CompositeExtract 44 0 + 46: 9(float) GroupFMin 28 Reduce 45 + 47: 9(float) CompositeExtract 44 1 + 48: 9(float) GroupFMin 28 Reduce 47 + 49: 9(float) CompositeExtract 44 2 + 50: 9(float) GroupFMin 28 Reduce 49 + 51: 10(fvec3) CompositeConstruct 46 48 50 + 52: 42(ptr) AccessChain 23 41 + Store 52 51 + 55: 54(ptr) AccessChain 23 53 + 56: 12(f64vec4) Load 55 + 57:11(float64_t) CompositeExtract 56 0 + 58:11(float64_t) GroupFMin 28 Reduce 57 + 59:11(float64_t) CompositeExtract 56 1 + 60:11(float64_t) GroupFMin 28 Reduce 59 + 61:11(float64_t) CompositeExtract 56 2 + 62:11(float64_t) GroupFMin 28 Reduce 61 + 63:11(float64_t) CompositeExtract 56 3 + 64:11(float64_t) GroupFMin 28 Reduce 63 + 65: 12(f64vec4) CompositeConstruct 58 60 62 64 + 66: 54(ptr) AccessChain 23 53 + Store 66 65 + 69: 68(ptr) AccessChain 23 67 + 70: 13(int64_t) Load 69 + 71: 13(int64_t) GroupSMin 28 Reduce 70 + 72: 68(ptr) AccessChain 23 67 + Store 72 71 + 75: 74(ptr) AccessChain 23 73 + 76: 15(i64vec2) Load 75 + 77: 14(int64_t) CompositeExtract 76 0 + 78: 14(int64_t) GroupUMin 28 Reduce 77 + 79: 14(int64_t) CompositeExtract 76 1 + 80: 14(int64_t) GroupUMin 28 Reduce 79 + 81: 15(i64vec2) CompositeConstruct 78 80 + 82: 74(ptr) AccessChain 23 73 + Store 82 81 + 85: 84(ptr) AccessChain 23 83 + 86: 17(f16vec3) Load 85 + 87:16(float16_t) CompositeExtract 86 0 + 88:16(float16_t) GroupFMin 28 Reduce 87 + 89:16(float16_t) CompositeExtract 86 1 + 90:16(float16_t) GroupFMin 28 Reduce 89 + 91:16(float16_t) CompositeExtract 86 2 + 92:16(float16_t) GroupFMin 28 Reduce 91 + 93: 17(f16vec3) CompositeConstruct 88 90 92 + 94: 84(ptr) AccessChain 23 83 + Store 94 93 + 97: 96(ptr) AccessChain 23 95 + 98: 19(i16vec4) Load 97 + 99: 18(int16_t) CompositeExtract 98 0 + 100: 18(int16_t) GroupSMin 28 Reduce 99 + 101: 18(int16_t) CompositeExtract 98 1 + 102: 18(int16_t) GroupSMin 28 Reduce 101 + 103: 18(int16_t) CompositeExtract 98 2 + 104: 18(int16_t) GroupSMin 28 Reduce 103 + 105: 18(int16_t) CompositeExtract 98 3 + 106: 18(int16_t) GroupSMin 28 Reduce 105 + 107: 19(i16vec4) CompositeConstruct 100 102 104 106 + 108: 96(ptr) AccessChain 23 95 + Store 108 107 + 111: 110(ptr) AccessChain 23 109 + 112: 20(int16_t) Load 111 + 113: 20(int16_t) GroupUMin 28 Reduce 112 + 114: 110(ptr) AccessChain 23 109 + Store 114 113 + 115: 25(ptr) AccessChain 23 24 + 116: 6(int) Load 115 + 117: 6(int) GroupSMax 28 Reduce 116 + 118: 25(ptr) AccessChain 23 24 + Store 118 117 + 119: 32(ptr) AccessChain 23 31 + 120: 8(ivec2) Load 119 + 121: 7(int) CompositeExtract 120 0 + 122: 7(int) GroupUMax 28 Reduce 121 + 123: 7(int) CompositeExtract 120 1 + 124: 7(int) GroupUMax 28 Reduce 123 + 125: 8(ivec2) CompositeConstruct 122 124 + 126: 32(ptr) AccessChain 23 31 + Store 126 125 + 127: 42(ptr) AccessChain 23 41 + 128: 10(fvec3) Load 127 + 129: 9(float) CompositeExtract 128 0 + 130: 9(float) GroupFMax 28 Reduce 129 + 131: 9(float) CompositeExtract 128 1 + 132: 9(float) GroupFMax 28 Reduce 131 + 133: 9(float) CompositeExtract 128 2 + 134: 9(float) GroupFMax 28 Reduce 133 + 135: 10(fvec3) CompositeConstruct 130 132 134 + 136: 42(ptr) AccessChain 23 41 + Store 136 135 + 137: 54(ptr) AccessChain 23 53 + 138: 12(f64vec4) Load 137 + 139:11(float64_t) CompositeExtract 138 0 + 140:11(float64_t) GroupFMax 28 Reduce 139 + 141:11(float64_t) CompositeExtract 138 1 + 142:11(float64_t) GroupFMax 28 Reduce 141 + 143:11(float64_t) CompositeExtract 138 2 + 144:11(float64_t) GroupFMax 28 Reduce 143 + 145:11(float64_t) CompositeExtract 138 3 + 146:11(float64_t) GroupFMax 28 Reduce 145 + 147: 12(f64vec4) CompositeConstruct 140 142 144 146 + 148: 54(ptr) AccessChain 23 53 + Store 148 147 + 149: 68(ptr) AccessChain 23 67 + 150: 13(int64_t) Load 149 + 151: 13(int64_t) GroupSMax 28 Reduce 150 + 152: 68(ptr) AccessChain 23 67 + Store 152 151 + 153: 74(ptr) AccessChain 23 73 + 154: 15(i64vec2) Load 153 + 155: 14(int64_t) CompositeExtract 154 0 + 156: 14(int64_t) GroupUMax 28 Reduce 155 + 157: 14(int64_t) CompositeExtract 154 1 + 158: 14(int64_t) GroupUMax 28 Reduce 157 + 159: 15(i64vec2) CompositeConstruct 156 158 + 160: 74(ptr) AccessChain 23 73 + Store 160 159 + 161: 84(ptr) AccessChain 23 83 + 162: 17(f16vec3) Load 161 + 163:16(float16_t) CompositeExtract 162 0 + 164:16(float16_t) GroupFMax 28 Reduce 163 + 165:16(float16_t) CompositeExtract 162 1 + 166:16(float16_t) GroupFMax 28 Reduce 165 + 167:16(float16_t) CompositeExtract 162 2 + 168:16(float16_t) GroupFMax 28 Reduce 167 + 169: 17(f16vec3) CompositeConstruct 164 166 168 + 170: 84(ptr) AccessChain 23 83 + Store 170 169 + 171: 96(ptr) AccessChain 23 95 + 172: 19(i16vec4) Load 171 + 173: 18(int16_t) CompositeExtract 172 0 + 174: 18(int16_t) GroupSMax 28 Reduce 173 + 175: 18(int16_t) CompositeExtract 172 1 + 176: 18(int16_t) GroupSMax 28 Reduce 175 + 177: 18(int16_t) CompositeExtract 172 2 + 178: 18(int16_t) GroupSMax 28 Reduce 177 + 179: 18(int16_t) CompositeExtract 172 3 + 180: 18(int16_t) GroupSMax 28 Reduce 179 + 181: 19(i16vec4) CompositeConstruct 174 176 178 180 + 182: 96(ptr) AccessChain 23 95 + Store 182 181 + 183: 110(ptr) AccessChain 23 109 + 184: 20(int16_t) Load 183 + 185: 20(int16_t) GroupUMax 28 Reduce 184 + 186: 110(ptr) AccessChain 23 109 + Store 186 185 + 187: 25(ptr) AccessChain 23 24 + 188: 6(int) Load 187 + 189: 6(int) GroupIAdd 28 Reduce 188 + 190: 25(ptr) AccessChain 23 24 + Store 190 189 + 191: 32(ptr) AccessChain 23 31 + 192: 8(ivec2) Load 191 + 193: 7(int) CompositeExtract 192 0 + 194: 7(int) GroupIAdd 28 Reduce 193 + 195: 7(int) CompositeExtract 192 1 + 196: 7(int) GroupIAdd 28 Reduce 195 + 197: 8(ivec2) CompositeConstruct 194 196 + 198: 32(ptr) AccessChain 23 31 + Store 198 197 + 199: 42(ptr) AccessChain 23 41 + 200: 10(fvec3) Load 199 + 201: 9(float) CompositeExtract 200 0 + 202: 9(float) GroupFAdd 28 Reduce 201 + 203: 9(float) CompositeExtract 200 1 + 204: 9(float) GroupFAdd 28 Reduce 203 + 205: 9(float) CompositeExtract 200 2 + 206: 9(float) GroupFAdd 28 Reduce 205 + 207: 10(fvec3) CompositeConstruct 202 204 206 + 208: 42(ptr) AccessChain 23 41 + Store 208 207 + 209: 54(ptr) AccessChain 23 53 + 210: 12(f64vec4) Load 209 + 211:11(float64_t) CompositeExtract 210 0 + 212:11(float64_t) GroupFAdd 28 Reduce 211 + 213:11(float64_t) CompositeExtract 210 1 + 214:11(float64_t) GroupFAdd 28 Reduce 213 + 215:11(float64_t) CompositeExtract 210 2 + 216:11(float64_t) GroupFAdd 28 Reduce 215 + 217:11(float64_t) CompositeExtract 210 3 + 218:11(float64_t) GroupFAdd 28 Reduce 217 + 219: 12(f64vec4) CompositeConstruct 212 214 216 218 + 220: 54(ptr) AccessChain 23 53 + Store 220 219 + 221: 68(ptr) AccessChain 23 67 + 222: 13(int64_t) Load 221 + 223: 13(int64_t) GroupIAdd 28 Reduce 222 + 224: 68(ptr) AccessChain 23 67 + Store 224 223 + 225: 74(ptr) AccessChain 23 73 + 226: 15(i64vec2) Load 225 + 227: 14(int64_t) CompositeExtract 226 0 + 228: 14(int64_t) GroupIAdd 28 Reduce 227 + 229: 14(int64_t) CompositeExtract 226 1 + 230: 14(int64_t) GroupIAdd 28 Reduce 229 + 231: 15(i64vec2) CompositeConstruct 228 230 + 232: 74(ptr) AccessChain 23 73 + Store 232 231 + 233: 84(ptr) AccessChain 23 83 + 234: 17(f16vec3) Load 233 + 235:16(float16_t) CompositeExtract 234 0 + 236:16(float16_t) GroupFAdd 28 Reduce 235 + 237:16(float16_t) CompositeExtract 234 1 + 238:16(float16_t) GroupFAdd 28 Reduce 237 + 239:16(float16_t) CompositeExtract 234 2 + 240:16(float16_t) GroupFAdd 28 Reduce 239 + 241: 17(f16vec3) CompositeConstruct 236 238 240 + 242: 84(ptr) AccessChain 23 83 + Store 242 241 + 243: 96(ptr) AccessChain 23 95 + 244: 19(i16vec4) Load 243 + 245: 18(int16_t) CompositeExtract 244 0 + 246: 18(int16_t) GroupIAdd 28 Reduce 245 + 247: 18(int16_t) CompositeExtract 244 1 + 248: 18(int16_t) GroupIAdd 28 Reduce 247 + 249: 18(int16_t) CompositeExtract 244 2 + 250: 18(int16_t) GroupIAdd 28 Reduce 249 + 251: 18(int16_t) CompositeExtract 244 3 + 252: 18(int16_t) GroupIAdd 28 Reduce 251 + 253: 19(i16vec4) CompositeConstruct 246 248 250 252 + 254: 96(ptr) AccessChain 23 95 + Store 254 253 + 255: 110(ptr) AccessChain 23 109 + 256: 20(int16_t) Load 255 + 257: 20(int16_t) GroupIAdd 28 Reduce 256 + 258: 110(ptr) AccessChain 23 109 + Store 258 257 + 259: 25(ptr) AccessChain 23 24 + 260: 6(int) Load 259 + 261: 6(int) GroupSMinNonUniformAMD 28 Reduce 260 + 262: 25(ptr) AccessChain 23 24 + Store 262 261 + 263: 32(ptr) AccessChain 23 31 + 264: 8(ivec2) Load 263 + 265: 7(int) CompositeExtract 264 0 + 266: 7(int) GroupUMinNonUniformAMD 28 Reduce 265 + 267: 7(int) CompositeExtract 264 1 + 268: 7(int) GroupUMinNonUniformAMD 28 Reduce 267 + 269: 8(ivec2) CompositeConstruct 266 268 + 270: 32(ptr) AccessChain 23 31 + Store 270 269 + 271: 42(ptr) AccessChain 23 41 + 272: 10(fvec3) Load 271 + 273: 9(float) CompositeExtract 272 0 + 274: 9(float) GroupFMinNonUniformAMD 28 Reduce 273 + 275: 9(float) CompositeExtract 272 1 + 276: 9(float) GroupFMinNonUniformAMD 28 Reduce 275 + 277: 9(float) CompositeExtract 272 2 + 278: 9(float) GroupFMinNonUniformAMD 28 Reduce 277 + 279: 10(fvec3) CompositeConstruct 274 276 278 + 280: 42(ptr) AccessChain 23 41 + Store 280 279 + 281: 54(ptr) AccessChain 23 53 + 282: 12(f64vec4) Load 281 + 283:11(float64_t) CompositeExtract 282 0 + 284:11(float64_t) GroupFMinNonUniformAMD 28 Reduce 283 + 285:11(float64_t) CompositeExtract 282 1 + 286:11(float64_t) GroupFMinNonUniformAMD 28 Reduce 285 + 287:11(float64_t) CompositeExtract 282 2 + 288:11(float64_t) GroupFMinNonUniformAMD 28 Reduce 287 + 289:11(float64_t) CompositeExtract 282 3 + 290:11(float64_t) GroupFMinNonUniformAMD 28 Reduce 289 + 291: 12(f64vec4) CompositeConstruct 284 286 288 290 + 292: 54(ptr) AccessChain 23 53 + Store 292 291 + 293: 68(ptr) AccessChain 23 67 + 294: 13(int64_t) Load 293 + 295: 13(int64_t) GroupSMinNonUniformAMD 28 Reduce 294 + 296: 68(ptr) AccessChain 23 67 + Store 296 295 + 297: 74(ptr) AccessChain 23 73 + 298: 15(i64vec2) Load 297 + 299: 14(int64_t) CompositeExtract 298 0 + 300: 14(int64_t) GroupUMinNonUniformAMD 28 Reduce 299 + 301: 14(int64_t) CompositeExtract 298 1 + 302: 14(int64_t) GroupUMinNonUniformAMD 28 Reduce 301 + 303: 15(i64vec2) CompositeConstruct 300 302 + 304: 74(ptr) AccessChain 23 73 + Store 304 303 + 305: 84(ptr) AccessChain 23 83 + 306: 17(f16vec3) Load 305 + 307:16(float16_t) CompositeExtract 306 0 + 308:16(float16_t) GroupFMinNonUniformAMD 28 Reduce 307 + 309:16(float16_t) CompositeExtract 306 1 + 310:16(float16_t) GroupFMinNonUniformAMD 28 Reduce 309 + 311:16(float16_t) CompositeExtract 306 2 + 312:16(float16_t) GroupFMinNonUniformAMD 28 Reduce 311 + 313: 17(f16vec3) CompositeConstruct 308 310 312 + 314: 84(ptr) AccessChain 23 83 + Store 314 313 + 315: 96(ptr) AccessChain 23 95 + 316: 19(i16vec4) Load 315 + 317: 18(int16_t) CompositeExtract 316 0 + 318: 18(int16_t) GroupSMinNonUniformAMD 28 Reduce 317 + 319: 18(int16_t) CompositeExtract 316 1 + 320: 18(int16_t) GroupSMinNonUniformAMD 28 Reduce 319 + 321: 18(int16_t) CompositeExtract 316 2 + 322: 18(int16_t) GroupSMinNonUniformAMD 28 Reduce 321 + 323: 18(int16_t) CompositeExtract 316 3 + 324: 18(int16_t) GroupSMinNonUniformAMD 28 Reduce 323 + 325: 19(i16vec4) CompositeConstruct 318 320 322 324 + 326: 96(ptr) AccessChain 23 95 + Store 326 325 + 327: 110(ptr) AccessChain 23 109 + 328: 20(int16_t) Load 327 + 329: 20(int16_t) GroupUMinNonUniformAMD 28 Reduce 328 + 330: 110(ptr) AccessChain 23 109 + Store 330 329 + 331: 25(ptr) AccessChain 23 24 + 332: 6(int) Load 331 + 333: 6(int) GroupSMaxNonUniformAMD 28 Reduce 332 + 334: 25(ptr) AccessChain 23 24 + Store 334 333 + 335: 32(ptr) AccessChain 23 31 + 336: 8(ivec2) Load 335 + 337: 7(int) CompositeExtract 336 0 + 338: 7(int) GroupUMaxNonUniformAMD 28 Reduce 337 + 339: 7(int) CompositeExtract 336 1 + 340: 7(int) GroupUMaxNonUniformAMD 28 Reduce 339 + 341: 8(ivec2) CompositeConstruct 338 340 + 342: 32(ptr) AccessChain 23 31 + Store 342 341 + 343: 42(ptr) AccessChain 23 41 + 344: 10(fvec3) Load 343 + 345: 9(float) CompositeExtract 344 0 + 346: 9(float) GroupFMaxNonUniformAMD 28 Reduce 345 + 347: 9(float) CompositeExtract 344 1 + 348: 9(float) GroupFMaxNonUniformAMD 28 Reduce 347 + 349: 9(float) CompositeExtract 344 2 + 350: 9(float) GroupFMaxNonUniformAMD 28 Reduce 349 + 351: 10(fvec3) CompositeConstruct 346 348 350 + 352: 42(ptr) AccessChain 23 41 + Store 352 351 + 353: 54(ptr) AccessChain 23 53 + 354: 12(f64vec4) Load 353 + 355:11(float64_t) CompositeExtract 354 0 + 356:11(float64_t) GroupFMaxNonUniformAMD 28 Reduce 355 + 357:11(float64_t) CompositeExtract 354 1 + 358:11(float64_t) GroupFMaxNonUniformAMD 28 Reduce 357 + 359:11(float64_t) CompositeExtract 354 2 + 360:11(float64_t) GroupFMaxNonUniformAMD 28 Reduce 359 + 361:11(float64_t) CompositeExtract 354 3 + 362:11(float64_t) GroupFMaxNonUniformAMD 28 Reduce 361 + 363: 12(f64vec4) CompositeConstruct 356 358 360 362 + 364: 54(ptr) AccessChain 23 53 + Store 364 363 + 365: 68(ptr) AccessChain 23 67 + 366: 13(int64_t) Load 365 + 367: 13(int64_t) GroupSMaxNonUniformAMD 28 Reduce 366 + 368: 68(ptr) AccessChain 23 67 + Store 368 367 + 369: 74(ptr) AccessChain 23 73 + 370: 15(i64vec2) Load 369 + 371: 14(int64_t) CompositeExtract 370 0 + 372: 14(int64_t) GroupUMaxNonUniformAMD 28 Reduce 371 + 373: 14(int64_t) CompositeExtract 370 1 + 374: 14(int64_t) GroupUMaxNonUniformAMD 28 Reduce 373 + 375: 15(i64vec2) CompositeConstruct 372 374 + 376: 74(ptr) AccessChain 23 73 + Store 376 375 + 377: 84(ptr) AccessChain 23 83 + 378: 17(f16vec3) Load 377 + 379:16(float16_t) CompositeExtract 378 0 + 380:16(float16_t) GroupFMaxNonUniformAMD 28 Reduce 379 + 381:16(float16_t) CompositeExtract 378 1 + 382:16(float16_t) GroupFMaxNonUniformAMD 28 Reduce 381 + 383:16(float16_t) CompositeExtract 378 2 + 384:16(float16_t) GroupFMaxNonUniformAMD 28 Reduce 383 + 385: 17(f16vec3) CompositeConstruct 380 382 384 + 386: 84(ptr) AccessChain 23 83 + Store 386 385 + 387: 96(ptr) AccessChain 23 95 + 388: 19(i16vec4) Load 387 + 389: 18(int16_t) CompositeExtract 388 0 + 390: 18(int16_t) GroupSMaxNonUniformAMD 28 Reduce 389 + 391: 18(int16_t) CompositeExtract 388 1 + 392: 18(int16_t) GroupSMaxNonUniformAMD 28 Reduce 391 + 393: 18(int16_t) CompositeExtract 388 2 + 394: 18(int16_t) GroupSMaxNonUniformAMD 28 Reduce 393 + 395: 18(int16_t) CompositeExtract 388 3 + 396: 18(int16_t) GroupSMaxNonUniformAMD 28 Reduce 395 + 397: 19(i16vec4) CompositeConstruct 390 392 394 396 + 398: 96(ptr) AccessChain 23 95 + Store 398 397 + 399: 110(ptr) AccessChain 23 109 + 400: 20(int16_t) Load 399 + 401: 20(int16_t) GroupUMaxNonUniformAMD 28 Reduce 400 + 402: 110(ptr) AccessChain 23 109 + Store 402 401 + 403: 25(ptr) AccessChain 23 24 + 404: 6(int) Load 403 + 405: 6(int) GroupIAddNonUniformAMD 28 Reduce 404 + 406: 25(ptr) AccessChain 23 24 + Store 406 405 + 407: 32(ptr) AccessChain 23 31 + 408: 8(ivec2) Load 407 + 409: 7(int) CompositeExtract 408 0 + 410: 7(int) GroupIAddNonUniformAMD 28 Reduce 409 + 411: 7(int) CompositeExtract 408 1 + 412: 7(int) GroupIAddNonUniformAMD 28 Reduce 411 + 413: 8(ivec2) CompositeConstruct 410 412 + 414: 32(ptr) AccessChain 23 31 + Store 414 413 + 415: 42(ptr) AccessChain 23 41 + 416: 10(fvec3) Load 415 + 417: 9(float) CompositeExtract 416 0 + 418: 9(float) GroupFAddNonUniformAMD 28 Reduce 417 + 419: 9(float) CompositeExtract 416 1 + 420: 9(float) GroupFAddNonUniformAMD 28 Reduce 419 + 421: 9(float) CompositeExtract 416 2 + 422: 9(float) GroupFAddNonUniformAMD 28 Reduce 421 + 423: 10(fvec3) CompositeConstruct 418 420 422 + 424: 42(ptr) AccessChain 23 41 + Store 424 423 + 425: 54(ptr) AccessChain 23 53 + 426: 12(f64vec4) Load 425 + 427:11(float64_t) CompositeExtract 426 0 + 428:11(float64_t) GroupFAddNonUniformAMD 28 Reduce 427 + 429:11(float64_t) CompositeExtract 426 1 + 430:11(float64_t) GroupFAddNonUniformAMD 28 Reduce 429 + 431:11(float64_t) CompositeExtract 426 2 + 432:11(float64_t) GroupFAddNonUniformAMD 28 Reduce 431 + 433:11(float64_t) CompositeExtract 426 3 + 434:11(float64_t) GroupFAddNonUniformAMD 28 Reduce 433 + 435: 12(f64vec4) CompositeConstruct 428 430 432 434 + 436: 54(ptr) AccessChain 23 53 + Store 436 435 + 437: 68(ptr) AccessChain 23 67 + 438: 13(int64_t) Load 437 + 439: 13(int64_t) GroupIAddNonUniformAMD 28 Reduce 438 + 440: 68(ptr) AccessChain 23 67 + Store 440 439 + 441: 74(ptr) AccessChain 23 73 + 442: 15(i64vec2) Load 441 + 443: 14(int64_t) CompositeExtract 442 0 + 444: 14(int64_t) GroupIAddNonUniformAMD 28 Reduce 443 + 445: 14(int64_t) CompositeExtract 442 1 + 446: 14(int64_t) GroupIAddNonUniformAMD 28 Reduce 445 + 447: 15(i64vec2) CompositeConstruct 444 446 + 448: 74(ptr) AccessChain 23 73 + Store 448 447 + 449: 84(ptr) AccessChain 23 83 + 450: 17(f16vec3) Load 449 + 451:16(float16_t) CompositeExtract 450 0 + 452:16(float16_t) GroupFAddNonUniformAMD 28 Reduce 451 + 453:16(float16_t) CompositeExtract 450 1 + 454:16(float16_t) GroupFAddNonUniformAMD 28 Reduce 453 + 455:16(float16_t) CompositeExtract 450 2 + 456:16(float16_t) GroupFAddNonUniformAMD 28 Reduce 455 + 457: 17(f16vec3) CompositeConstruct 452 454 456 + 458: 84(ptr) AccessChain 23 83 + Store 458 457 + 459: 96(ptr) AccessChain 23 95 + 460: 19(i16vec4) Load 459 + 461: 18(int16_t) CompositeExtract 460 0 + 462: 18(int16_t) GroupIAddNonUniformAMD 28 Reduce 461 + 463: 18(int16_t) CompositeExtract 460 1 + 464: 18(int16_t) GroupIAddNonUniformAMD 28 Reduce 463 + 465: 18(int16_t) CompositeExtract 460 2 + 466: 18(int16_t) GroupIAddNonUniformAMD 28 Reduce 465 + 467: 18(int16_t) CompositeExtract 460 3 + 468: 18(int16_t) GroupIAddNonUniformAMD 28 Reduce 467 + 469: 19(i16vec4) CompositeConstruct 462 464 466 468 + 470: 96(ptr) AccessChain 23 95 + Store 470 469 + 471: 110(ptr) AccessChain 23 109 + 472: 20(int16_t) Load 471 + 473: 20(int16_t) GroupIAddNonUniformAMD 28 Reduce 472 + 474: 110(ptr) AccessChain 23 109 + Store 474 473 + 475: 25(ptr) AccessChain 23 24 + 476: 6(int) Load 475 + 477: 6(int) GroupSMin 28 InclusiveScan 476 + 478: 25(ptr) AccessChain 23 24 + Store 478 477 + 479: 32(ptr) AccessChain 23 31 + 480: 8(ivec2) Load 479 + 481: 7(int) CompositeExtract 480 0 + 482: 7(int) GroupUMin 28 InclusiveScan 481 + 483: 7(int) CompositeExtract 480 1 + 484: 7(int) GroupUMin 28 InclusiveScan 483 + 485: 8(ivec2) CompositeConstruct 482 484 + 486: 32(ptr) AccessChain 23 31 + Store 486 485 + 487: 42(ptr) AccessChain 23 41 + 488: 10(fvec3) Load 487 + 489: 9(float) CompositeExtract 488 0 + 490: 9(float) GroupFMin 28 InclusiveScan 489 + 491: 9(float) CompositeExtract 488 1 + 492: 9(float) GroupFMin 28 InclusiveScan 491 + 493: 9(float) CompositeExtract 488 2 + 494: 9(float) GroupFMin 28 InclusiveScan 493 + 495: 10(fvec3) CompositeConstruct 490 492 494 + 496: 42(ptr) AccessChain 23 41 + Store 496 495 + 497: 54(ptr) AccessChain 23 53 + 498: 12(f64vec4) Load 497 + 499:11(float64_t) CompositeExtract 498 0 + 500:11(float64_t) GroupFMin 28 InclusiveScan 499 + 501:11(float64_t) CompositeExtract 498 1 + 502:11(float64_t) GroupFMin 28 InclusiveScan 501 + 503:11(float64_t) CompositeExtract 498 2 + 504:11(float64_t) GroupFMin 28 InclusiveScan 503 + 505:11(float64_t) CompositeExtract 498 3 + 506:11(float64_t) GroupFMin 28 InclusiveScan 505 + 507: 12(f64vec4) CompositeConstruct 500 502 504 506 + 508: 54(ptr) AccessChain 23 53 + Store 508 507 + 509: 68(ptr) AccessChain 23 67 + 510: 13(int64_t) Load 509 + 511: 13(int64_t) GroupSMin 28 InclusiveScan 510 + 512: 68(ptr) AccessChain 23 67 + Store 512 511 + 513: 74(ptr) AccessChain 23 73 + 514: 15(i64vec2) Load 513 + 515: 14(int64_t) CompositeExtract 514 0 + 516: 14(int64_t) GroupUMin 28 InclusiveScan 515 + 517: 14(int64_t) CompositeExtract 514 1 + 518: 14(int64_t) GroupUMin 28 InclusiveScan 517 + 519: 15(i64vec2) CompositeConstruct 516 518 + 520: 74(ptr) AccessChain 23 73 + Store 520 519 + 521: 84(ptr) AccessChain 23 83 + 522: 17(f16vec3) Load 521 + 523:16(float16_t) CompositeExtract 522 0 + 524:16(float16_t) GroupFMin 28 InclusiveScan 523 + 525:16(float16_t) CompositeExtract 522 1 + 526:16(float16_t) GroupFMin 28 InclusiveScan 525 + 527:16(float16_t) CompositeExtract 522 2 + 528:16(float16_t) GroupFMin 28 InclusiveScan 527 + 529: 17(f16vec3) CompositeConstruct 524 526 528 + 530: 84(ptr) AccessChain 23 83 + Store 530 529 + 531: 96(ptr) AccessChain 23 95 + 532: 19(i16vec4) Load 531 + 533: 18(int16_t) CompositeExtract 532 0 + 534: 18(int16_t) GroupSMin 28 InclusiveScan 533 + 535: 18(int16_t) CompositeExtract 532 1 + 536: 18(int16_t) GroupSMin 28 InclusiveScan 535 + 537: 18(int16_t) CompositeExtract 532 2 + 538: 18(int16_t) GroupSMin 28 InclusiveScan 537 + 539: 18(int16_t) CompositeExtract 532 3 + 540: 18(int16_t) GroupSMin 28 InclusiveScan 539 + 541: 19(i16vec4) CompositeConstruct 534 536 538 540 + 542: 96(ptr) AccessChain 23 95 + Store 542 541 + 543: 110(ptr) AccessChain 23 109 + 544: 20(int16_t) Load 543 + 545: 20(int16_t) GroupUMin 28 InclusiveScan 544 + 546: 110(ptr) AccessChain 23 109 + Store 546 545 + 547: 25(ptr) AccessChain 23 24 + 548: 6(int) Load 547 + 549: 6(int) GroupSMax 28 InclusiveScan 548 + 550: 25(ptr) AccessChain 23 24 + Store 550 549 + 551: 32(ptr) AccessChain 23 31 + 552: 8(ivec2) Load 551 + 553: 7(int) CompositeExtract 552 0 + 554: 7(int) GroupUMax 28 InclusiveScan 553 + 555: 7(int) CompositeExtract 552 1 + 556: 7(int) GroupUMax 28 InclusiveScan 555 + 557: 8(ivec2) CompositeConstruct 554 556 + 558: 32(ptr) AccessChain 23 31 + Store 558 557 + 559: 42(ptr) AccessChain 23 41 + 560: 10(fvec3) Load 559 + 561: 9(float) CompositeExtract 560 0 + 562: 9(float) GroupFMax 28 InclusiveScan 561 + 563: 9(float) CompositeExtract 560 1 + 564: 9(float) GroupFMax 28 InclusiveScan 563 + 565: 9(float) CompositeExtract 560 2 + 566: 9(float) GroupFMax 28 InclusiveScan 565 + 567: 10(fvec3) CompositeConstruct 562 564 566 + 568: 42(ptr) AccessChain 23 41 + Store 568 567 + 569: 54(ptr) AccessChain 23 53 + 570: 12(f64vec4) Load 569 + 571:11(float64_t) CompositeExtract 570 0 + 572:11(float64_t) GroupFMax 28 InclusiveScan 571 + 573:11(float64_t) CompositeExtract 570 1 + 574:11(float64_t) GroupFMax 28 InclusiveScan 573 + 575:11(float64_t) CompositeExtract 570 2 + 576:11(float64_t) GroupFMax 28 InclusiveScan 575 + 577:11(float64_t) CompositeExtract 570 3 + 578:11(float64_t) GroupFMax 28 InclusiveScan 577 + 579: 12(f64vec4) CompositeConstruct 572 574 576 578 + 580: 54(ptr) AccessChain 23 53 + Store 580 579 + 581: 68(ptr) AccessChain 23 67 + 582: 13(int64_t) Load 581 + 583: 13(int64_t) GroupSMax 28 InclusiveScan 582 + 584: 68(ptr) AccessChain 23 67 + Store 584 583 + 585: 74(ptr) AccessChain 23 73 + 586: 15(i64vec2) Load 585 + 587: 14(int64_t) CompositeExtract 586 0 + 588: 14(int64_t) GroupUMax 28 InclusiveScan 587 + 589: 14(int64_t) CompositeExtract 586 1 + 590: 14(int64_t) GroupUMax 28 InclusiveScan 589 + 591: 15(i64vec2) CompositeConstruct 588 590 + 592: 74(ptr) AccessChain 23 73 + Store 592 591 + 593: 84(ptr) AccessChain 23 83 + 594: 17(f16vec3) Load 593 + 595:16(float16_t) CompositeExtract 594 0 + 596:16(float16_t) GroupFMax 28 InclusiveScan 595 + 597:16(float16_t) CompositeExtract 594 1 + 598:16(float16_t) GroupFMax 28 InclusiveScan 597 + 599:16(float16_t) CompositeExtract 594 2 + 600:16(float16_t) GroupFMax 28 InclusiveScan 599 + 601: 17(f16vec3) CompositeConstruct 596 598 600 + 602: 84(ptr) AccessChain 23 83 + Store 602 601 + 603: 96(ptr) AccessChain 23 95 + 604: 19(i16vec4) Load 603 + 605: 18(int16_t) CompositeExtract 604 0 + 606: 18(int16_t) GroupSMax 28 InclusiveScan 605 + 607: 18(int16_t) CompositeExtract 604 1 + 608: 18(int16_t) GroupSMax 28 InclusiveScan 607 + 609: 18(int16_t) CompositeExtract 604 2 + 610: 18(int16_t) GroupSMax 28 InclusiveScan 609 + 611: 18(int16_t) CompositeExtract 604 3 + 612: 18(int16_t) GroupSMax 28 InclusiveScan 611 + 613: 19(i16vec4) CompositeConstruct 606 608 610 612 + 614: 96(ptr) AccessChain 23 95 + Store 614 613 + 615: 110(ptr) AccessChain 23 109 + 616: 20(int16_t) Load 615 + 617: 20(int16_t) GroupUMax 28 InclusiveScan 616 + 618: 110(ptr) AccessChain 23 109 + Store 618 617 + 619: 25(ptr) AccessChain 23 24 + 620: 6(int) Load 619 + 621: 6(int) GroupIAdd 28 InclusiveScan 620 + 622: 25(ptr) AccessChain 23 24 + Store 622 621 + 623: 32(ptr) AccessChain 23 31 + 624: 8(ivec2) Load 623 + 625: 7(int) CompositeExtract 624 0 + 626: 7(int) GroupIAdd 28 InclusiveScan 625 + 627: 7(int) CompositeExtract 624 1 + 628: 7(int) GroupIAdd 28 InclusiveScan 627 + 629: 8(ivec2) CompositeConstruct 626 628 + 630: 32(ptr) AccessChain 23 31 + Store 630 629 + 631: 42(ptr) AccessChain 23 41 + 632: 10(fvec3) Load 631 + 633: 9(float) CompositeExtract 632 0 + 634: 9(float) GroupFAdd 28 InclusiveScan 633 + 635: 9(float) CompositeExtract 632 1 + 636: 9(float) GroupFAdd 28 InclusiveScan 635 + 637: 9(float) CompositeExtract 632 2 + 638: 9(float) GroupFAdd 28 InclusiveScan 637 + 639: 10(fvec3) CompositeConstruct 634 636 638 + 640: 42(ptr) AccessChain 23 41 + Store 640 639 + 641: 54(ptr) AccessChain 23 53 + 642: 12(f64vec4) Load 641 + 643:11(float64_t) CompositeExtract 642 0 + 644:11(float64_t) GroupFAdd 28 InclusiveScan 643 + 645:11(float64_t) CompositeExtract 642 1 + 646:11(float64_t) GroupFAdd 28 InclusiveScan 645 + 647:11(float64_t) CompositeExtract 642 2 + 648:11(float64_t) GroupFAdd 28 InclusiveScan 647 + 649:11(float64_t) CompositeExtract 642 3 + 650:11(float64_t) GroupFAdd 28 InclusiveScan 649 + 651: 12(f64vec4) CompositeConstruct 644 646 648 650 + 652: 54(ptr) AccessChain 23 53 + Store 652 651 + 653: 68(ptr) AccessChain 23 67 + 654: 13(int64_t) Load 653 + 655: 13(int64_t) GroupIAdd 28 InclusiveScan 654 + 656: 68(ptr) AccessChain 23 67 + Store 656 655 + 657: 74(ptr) AccessChain 23 73 + 658: 15(i64vec2) Load 657 + 659: 14(int64_t) CompositeExtract 658 0 + 660: 14(int64_t) GroupIAdd 28 InclusiveScan 659 + 661: 14(int64_t) CompositeExtract 658 1 + 662: 14(int64_t) GroupIAdd 28 InclusiveScan 661 + 663: 15(i64vec2) CompositeConstruct 660 662 + 664: 74(ptr) AccessChain 23 73 + Store 664 663 + 665: 84(ptr) AccessChain 23 83 + 666: 17(f16vec3) Load 665 + 667:16(float16_t) CompositeExtract 666 0 + 668:16(float16_t) GroupFAdd 28 InclusiveScan 667 + 669:16(float16_t) CompositeExtract 666 1 + 670:16(float16_t) GroupFAdd 28 InclusiveScan 669 + 671:16(float16_t) CompositeExtract 666 2 + 672:16(float16_t) GroupFAdd 28 InclusiveScan 671 + 673: 17(f16vec3) CompositeConstruct 668 670 672 + 674: 84(ptr) AccessChain 23 83 + Store 674 673 + 675: 96(ptr) AccessChain 23 95 + 676: 19(i16vec4) Load 675 + 677: 18(int16_t) CompositeExtract 676 0 + 678: 18(int16_t) GroupIAdd 28 InclusiveScan 677 + 679: 18(int16_t) CompositeExtract 676 1 + 680: 18(int16_t) GroupIAdd 28 InclusiveScan 679 + 681: 18(int16_t) CompositeExtract 676 2 + 682: 18(int16_t) GroupIAdd 28 InclusiveScan 681 + 683: 18(int16_t) CompositeExtract 676 3 + 684: 18(int16_t) GroupIAdd 28 InclusiveScan 683 + 685: 19(i16vec4) CompositeConstruct 678 680 682 684 + 686: 96(ptr) AccessChain 23 95 + Store 686 685 + 687: 110(ptr) AccessChain 23 109 + 688: 20(int16_t) Load 687 + 689: 20(int16_t) GroupIAdd 28 InclusiveScan 688 + 690: 110(ptr) AccessChain 23 109 + Store 690 689 + 691: 25(ptr) AccessChain 23 24 + 692: 6(int) Load 691 + 693: 6(int) GroupSMin 28 ExclusiveScan 692 + 694: 25(ptr) AccessChain 23 24 + Store 694 693 + 695: 32(ptr) AccessChain 23 31 + 696: 8(ivec2) Load 695 + 697: 7(int) CompositeExtract 696 0 + 698: 7(int) GroupUMin 28 ExclusiveScan 697 + 699: 7(int) CompositeExtract 696 1 + 700: 7(int) GroupUMin 28 ExclusiveScan 699 + 701: 8(ivec2) CompositeConstruct 698 700 + 702: 32(ptr) AccessChain 23 31 + Store 702 701 + 703: 42(ptr) AccessChain 23 41 + 704: 10(fvec3) Load 703 + 705: 9(float) CompositeExtract 704 0 + 706: 9(float) GroupFMin 28 ExclusiveScan 705 + 707: 9(float) CompositeExtract 704 1 + 708: 9(float) GroupFMin 28 ExclusiveScan 707 + 709: 9(float) CompositeExtract 704 2 + 710: 9(float) GroupFMin 28 ExclusiveScan 709 + 711: 10(fvec3) CompositeConstruct 706 708 710 + 712: 42(ptr) AccessChain 23 41 + Store 712 711 + 713: 54(ptr) AccessChain 23 53 + 714: 12(f64vec4) Load 713 + 715:11(float64_t) CompositeExtract 714 0 + 716:11(float64_t) GroupFMin 28 ExclusiveScan 715 + 717:11(float64_t) CompositeExtract 714 1 + 718:11(float64_t) GroupFMin 28 ExclusiveScan 717 + 719:11(float64_t) CompositeExtract 714 2 + 720:11(float64_t) GroupFMin 28 ExclusiveScan 719 + 721:11(float64_t) CompositeExtract 714 3 + 722:11(float64_t) GroupFMin 28 ExclusiveScan 721 + 723: 12(f64vec4) CompositeConstruct 716 718 720 722 + 724: 54(ptr) AccessChain 23 53 + Store 724 723 + 725: 68(ptr) AccessChain 23 67 + 726: 13(int64_t) Load 725 + 727: 13(int64_t) GroupSMin 28 ExclusiveScan 726 + 728: 68(ptr) AccessChain 23 67 + Store 728 727 + 729: 74(ptr) AccessChain 23 73 + 730: 15(i64vec2) Load 729 + 731: 14(int64_t) CompositeExtract 730 0 + 732: 14(int64_t) GroupUMin 28 ExclusiveScan 731 + 733: 14(int64_t) CompositeExtract 730 1 + 734: 14(int64_t) GroupUMin 28 ExclusiveScan 733 + 735: 15(i64vec2) CompositeConstruct 732 734 + 736: 74(ptr) AccessChain 23 73 + Store 736 735 + 737: 84(ptr) AccessChain 23 83 + 738: 17(f16vec3) Load 737 + 739:16(float16_t) CompositeExtract 738 0 + 740:16(float16_t) GroupFMin 28 ExclusiveScan 739 + 741:16(float16_t) CompositeExtract 738 1 + 742:16(float16_t) GroupFMin 28 ExclusiveScan 741 + 743:16(float16_t) CompositeExtract 738 2 + 744:16(float16_t) GroupFMin 28 ExclusiveScan 743 + 745: 17(f16vec3) CompositeConstruct 740 742 744 + 746: 84(ptr) AccessChain 23 83 + Store 746 745 + 747: 96(ptr) AccessChain 23 95 + 748: 19(i16vec4) Load 747 + 749: 18(int16_t) CompositeExtract 748 0 + 750: 18(int16_t) GroupSMin 28 ExclusiveScan 749 + 751: 18(int16_t) CompositeExtract 748 1 + 752: 18(int16_t) GroupSMin 28 ExclusiveScan 751 + 753: 18(int16_t) CompositeExtract 748 2 + 754: 18(int16_t) GroupSMin 28 ExclusiveScan 753 + 755: 18(int16_t) CompositeExtract 748 3 + 756: 18(int16_t) GroupSMin 28 ExclusiveScan 755 + 757: 19(i16vec4) CompositeConstruct 750 752 754 756 + 758: 96(ptr) AccessChain 23 95 + Store 758 757 + 759: 110(ptr) AccessChain 23 109 + 760: 20(int16_t) Load 759 + 761: 20(int16_t) GroupUMin 28 ExclusiveScan 760 + 762: 110(ptr) AccessChain 23 109 + Store 762 761 + 763: 25(ptr) AccessChain 23 24 + 764: 6(int) Load 763 + 765: 6(int) GroupSMax 28 ExclusiveScan 764 + 766: 25(ptr) AccessChain 23 24 + Store 766 765 + 767: 32(ptr) AccessChain 23 31 + 768: 8(ivec2) Load 767 + 769: 7(int) CompositeExtract 768 0 + 770: 7(int) GroupUMax 28 ExclusiveScan 769 + 771: 7(int) CompositeExtract 768 1 + 772: 7(int) GroupUMax 28 ExclusiveScan 771 + 773: 8(ivec2) CompositeConstruct 770 772 + 774: 32(ptr) AccessChain 23 31 + Store 774 773 + 775: 42(ptr) AccessChain 23 41 + 776: 10(fvec3) Load 775 + 777: 9(float) CompositeExtract 776 0 + 778: 9(float) GroupFMax 28 ExclusiveScan 777 + 779: 9(float) CompositeExtract 776 1 + 780: 9(float) GroupFMax 28 ExclusiveScan 779 + 781: 9(float) CompositeExtract 776 2 + 782: 9(float) GroupFMax 28 ExclusiveScan 781 + 783: 10(fvec3) CompositeConstruct 778 780 782 + 784: 42(ptr) AccessChain 23 41 + Store 784 783 + 785: 54(ptr) AccessChain 23 53 + 786: 12(f64vec4) Load 785 + 787:11(float64_t) CompositeExtract 786 0 + 788:11(float64_t) GroupFMax 28 ExclusiveScan 787 + 789:11(float64_t) CompositeExtract 786 1 + 790:11(float64_t) GroupFMax 28 ExclusiveScan 789 + 791:11(float64_t) CompositeExtract 786 2 + 792:11(float64_t) GroupFMax 28 ExclusiveScan 791 + 793:11(float64_t) CompositeExtract 786 3 + 794:11(float64_t) GroupFMax 28 ExclusiveScan 793 + 795: 12(f64vec4) CompositeConstruct 788 790 792 794 + 796: 54(ptr) AccessChain 23 53 + Store 796 795 + 797: 68(ptr) AccessChain 23 67 + 798: 13(int64_t) Load 797 + 799: 13(int64_t) GroupSMax 28 ExclusiveScan 798 + 800: 68(ptr) AccessChain 23 67 + Store 800 799 + 801: 74(ptr) AccessChain 23 73 + 802: 15(i64vec2) Load 801 + 803: 14(int64_t) CompositeExtract 802 0 + 804: 14(int64_t) GroupUMax 28 ExclusiveScan 803 + 805: 14(int64_t) CompositeExtract 802 1 + 806: 14(int64_t) GroupUMax 28 ExclusiveScan 805 + 807: 15(i64vec2) CompositeConstruct 804 806 + 808: 74(ptr) AccessChain 23 73 + Store 808 807 + 809: 84(ptr) AccessChain 23 83 + 810: 17(f16vec3) Load 809 + 811:16(float16_t) CompositeExtract 810 0 + 812:16(float16_t) GroupFMax 28 ExclusiveScan 811 + 813:16(float16_t) CompositeExtract 810 1 + 814:16(float16_t) GroupFMax 28 ExclusiveScan 813 + 815:16(float16_t) CompositeExtract 810 2 + 816:16(float16_t) GroupFMax 28 ExclusiveScan 815 + 817: 17(f16vec3) CompositeConstruct 812 814 816 + 818: 84(ptr) AccessChain 23 83 + Store 818 817 + 819: 96(ptr) AccessChain 23 95 + 820: 19(i16vec4) Load 819 + 821: 18(int16_t) CompositeExtract 820 0 + 822: 18(int16_t) GroupSMax 28 ExclusiveScan 821 + 823: 18(int16_t) CompositeExtract 820 1 + 824: 18(int16_t) GroupSMax 28 ExclusiveScan 823 + 825: 18(int16_t) CompositeExtract 820 2 + 826: 18(int16_t) GroupSMax 28 ExclusiveScan 825 + 827: 18(int16_t) CompositeExtract 820 3 + 828: 18(int16_t) GroupSMax 28 ExclusiveScan 827 + 829: 19(i16vec4) CompositeConstruct 822 824 826 828 + 830: 96(ptr) AccessChain 23 95 + Store 830 829 + 831: 110(ptr) AccessChain 23 109 + 832: 20(int16_t) Load 831 + 833: 20(int16_t) GroupUMax 28 ExclusiveScan 832 + 834: 110(ptr) AccessChain 23 109 + Store 834 833 + 835: 25(ptr) AccessChain 23 24 + 836: 6(int) Load 835 + 837: 6(int) GroupIAdd 28 ExclusiveScan 836 + 838: 25(ptr) AccessChain 23 24 + Store 838 837 + 839: 32(ptr) AccessChain 23 31 + 840: 8(ivec2) Load 839 + 841: 7(int) CompositeExtract 840 0 + 842: 7(int) GroupIAdd 28 ExclusiveScan 841 + 843: 7(int) CompositeExtract 840 1 + 844: 7(int) GroupIAdd 28 ExclusiveScan 843 + 845: 8(ivec2) CompositeConstruct 842 844 + 846: 32(ptr) AccessChain 23 31 + Store 846 845 + 847: 42(ptr) AccessChain 23 41 + 848: 10(fvec3) Load 847 + 849: 9(float) CompositeExtract 848 0 + 850: 9(float) GroupFAdd 28 ExclusiveScan 849 + 851: 9(float) CompositeExtract 848 1 + 852: 9(float) GroupFAdd 28 ExclusiveScan 851 + 853: 9(float) CompositeExtract 848 2 + 854: 9(float) GroupFAdd 28 ExclusiveScan 853 + 855: 10(fvec3) CompositeConstruct 850 852 854 + 856: 42(ptr) AccessChain 23 41 + Store 856 855 + 857: 54(ptr) AccessChain 23 53 + 858: 12(f64vec4) Load 857 + 859:11(float64_t) CompositeExtract 858 0 + 860:11(float64_t) GroupFAdd 28 ExclusiveScan 859 + 861:11(float64_t) CompositeExtract 858 1 + 862:11(float64_t) GroupFAdd 28 ExclusiveScan 861 + 863:11(float64_t) CompositeExtract 858 2 + 864:11(float64_t) GroupFAdd 28 ExclusiveScan 863 + 865:11(float64_t) CompositeExtract 858 3 + 866:11(float64_t) GroupFAdd 28 ExclusiveScan 865 + 867: 12(f64vec4) CompositeConstruct 860 862 864 866 + 868: 54(ptr) AccessChain 23 53 + Store 868 867 + 869: 68(ptr) AccessChain 23 67 + 870: 13(int64_t) Load 869 + 871: 13(int64_t) GroupIAdd 28 ExclusiveScan 870 + 872: 68(ptr) AccessChain 23 67 + Store 872 871 + 873: 74(ptr) AccessChain 23 73 + 874: 15(i64vec2) Load 873 + 875: 14(int64_t) CompositeExtract 874 0 + 876: 14(int64_t) GroupIAdd 28 ExclusiveScan 875 + 877: 14(int64_t) CompositeExtract 874 1 + 878: 14(int64_t) GroupIAdd 28 ExclusiveScan 877 + 879: 15(i64vec2) CompositeConstruct 876 878 + 880: 74(ptr) AccessChain 23 73 + Store 880 879 + 881: 84(ptr) AccessChain 23 83 + 882: 17(f16vec3) Load 881 + 883:16(float16_t) CompositeExtract 882 0 + 884:16(float16_t) GroupFAdd 28 ExclusiveScan 883 + 885:16(float16_t) CompositeExtract 882 1 + 886:16(float16_t) GroupFAdd 28 ExclusiveScan 885 + 887:16(float16_t) CompositeExtract 882 2 + 888:16(float16_t) GroupFAdd 28 ExclusiveScan 887 + 889: 17(f16vec3) CompositeConstruct 884 886 888 + 890: 84(ptr) AccessChain 23 83 + Store 890 889 + 891: 96(ptr) AccessChain 23 95 + 892: 19(i16vec4) Load 891 + 893: 18(int16_t) CompositeExtract 892 0 + 894: 18(int16_t) GroupIAdd 28 ExclusiveScan 893 + 895: 18(int16_t) CompositeExtract 892 1 + 896: 18(int16_t) GroupIAdd 28 ExclusiveScan 895 + 897: 18(int16_t) CompositeExtract 892 2 + 898: 18(int16_t) GroupIAdd 28 ExclusiveScan 897 + 899: 18(int16_t) CompositeExtract 892 3 + 900: 18(int16_t) GroupIAdd 28 ExclusiveScan 899 + 901: 19(i16vec4) CompositeConstruct 894 896 898 900 + 902: 96(ptr) AccessChain 23 95 + Store 902 901 + 903: 110(ptr) AccessChain 23 109 + 904: 20(int16_t) Load 903 + 905: 20(int16_t) GroupIAdd 28 ExclusiveScan 904 + 906: 110(ptr) AccessChain 23 109 + Store 906 905 + 907: 25(ptr) AccessChain 23 24 + 908: 6(int) Load 907 + 909: 6(int) GroupSMinNonUniformAMD 28 InclusiveScan 908 + 910: 25(ptr) AccessChain 23 24 + Store 910 909 + 911: 32(ptr) AccessChain 23 31 + 912: 8(ivec2) Load 911 + 913: 7(int) CompositeExtract 912 0 + 914: 7(int) GroupUMinNonUniformAMD 28 InclusiveScan 913 + 915: 7(int) CompositeExtract 912 1 + 916: 7(int) GroupUMinNonUniformAMD 28 InclusiveScan 915 + 917: 8(ivec2) CompositeConstruct 914 916 + 918: 32(ptr) AccessChain 23 31 + Store 918 917 + 919: 42(ptr) AccessChain 23 41 + 920: 10(fvec3) Load 919 + 921: 9(float) CompositeExtract 920 0 + 922: 9(float) GroupFMinNonUniformAMD 28 InclusiveScan 921 + 923: 9(float) CompositeExtract 920 1 + 924: 9(float) GroupFMinNonUniformAMD 28 InclusiveScan 923 + 925: 9(float) CompositeExtract 920 2 + 926: 9(float) GroupFMinNonUniformAMD 28 InclusiveScan 925 + 927: 10(fvec3) CompositeConstruct 922 924 926 + 928: 42(ptr) AccessChain 23 41 + Store 928 927 + 929: 54(ptr) AccessChain 23 53 + 930: 12(f64vec4) Load 929 + 931:11(float64_t) CompositeExtract 930 0 + 932:11(float64_t) GroupFMinNonUniformAMD 28 InclusiveScan 931 + 933:11(float64_t) CompositeExtract 930 1 + 934:11(float64_t) GroupFMinNonUniformAMD 28 InclusiveScan 933 + 935:11(float64_t) CompositeExtract 930 2 + 936:11(float64_t) GroupFMinNonUniformAMD 28 InclusiveScan 935 + 937:11(float64_t) CompositeExtract 930 3 + 938:11(float64_t) GroupFMinNonUniformAMD 28 InclusiveScan 937 + 939: 12(f64vec4) CompositeConstruct 932 934 936 938 + 940: 54(ptr) AccessChain 23 53 + Store 940 939 + 941: 68(ptr) AccessChain 23 67 + 942: 13(int64_t) Load 941 + 943: 13(int64_t) GroupSMinNonUniformAMD 28 InclusiveScan 942 + 944: 68(ptr) AccessChain 23 67 + Store 944 943 + 945: 74(ptr) AccessChain 23 73 + 946: 15(i64vec2) Load 945 + 947: 14(int64_t) CompositeExtract 946 0 + 948: 14(int64_t) GroupUMinNonUniformAMD 28 InclusiveScan 947 + 949: 14(int64_t) CompositeExtract 946 1 + 950: 14(int64_t) GroupUMinNonUniformAMD 28 InclusiveScan 949 + 951: 15(i64vec2) CompositeConstruct 948 950 + 952: 74(ptr) AccessChain 23 73 + Store 952 951 + 953: 84(ptr) AccessChain 23 83 + 954: 17(f16vec3) Load 953 + 955:16(float16_t) CompositeExtract 954 0 + 956:16(float16_t) GroupFMinNonUniformAMD 28 InclusiveScan 955 + 957:16(float16_t) CompositeExtract 954 1 + 958:16(float16_t) GroupFMinNonUniformAMD 28 InclusiveScan 957 + 959:16(float16_t) CompositeExtract 954 2 + 960:16(float16_t) GroupFMinNonUniformAMD 28 InclusiveScan 959 + 961: 17(f16vec3) CompositeConstruct 956 958 960 + 962: 84(ptr) AccessChain 23 83 + Store 962 961 + 963: 96(ptr) AccessChain 23 95 + 964: 19(i16vec4) Load 963 + 965: 18(int16_t) CompositeExtract 964 0 + 966: 18(int16_t) GroupSMinNonUniformAMD 28 InclusiveScan 965 + 967: 18(int16_t) CompositeExtract 964 1 + 968: 18(int16_t) GroupSMinNonUniformAMD 28 InclusiveScan 967 + 969: 18(int16_t) CompositeExtract 964 2 + 970: 18(int16_t) GroupSMinNonUniformAMD 28 InclusiveScan 969 + 971: 18(int16_t) CompositeExtract 964 3 + 972: 18(int16_t) GroupSMinNonUniformAMD 28 InclusiveScan 971 + 973: 19(i16vec4) CompositeConstruct 966 968 970 972 + 974: 96(ptr) AccessChain 23 95 + Store 974 973 + 975: 110(ptr) AccessChain 23 109 + 976: 20(int16_t) Load 975 + 977: 20(int16_t) GroupUMinNonUniformAMD 28 InclusiveScan 976 + 978: 110(ptr) AccessChain 23 109 + Store 978 977 + 979: 25(ptr) AccessChain 23 24 + 980: 6(int) Load 979 + 981: 6(int) GroupSMaxNonUniformAMD 28 InclusiveScan 980 + 982: 25(ptr) AccessChain 23 24 + Store 982 981 + 983: 32(ptr) AccessChain 23 31 + 984: 8(ivec2) Load 983 + 985: 7(int) CompositeExtract 984 0 + 986: 7(int) GroupUMaxNonUniformAMD 28 InclusiveScan 985 + 987: 7(int) CompositeExtract 984 1 + 988: 7(int) GroupUMaxNonUniformAMD 28 InclusiveScan 987 + 989: 8(ivec2) CompositeConstruct 986 988 + 990: 32(ptr) AccessChain 23 31 + Store 990 989 + 991: 42(ptr) AccessChain 23 41 + 992: 10(fvec3) Load 991 + 993: 9(float) CompositeExtract 992 0 + 994: 9(float) GroupFMaxNonUniformAMD 28 InclusiveScan 993 + 995: 9(float) CompositeExtract 992 1 + 996: 9(float) GroupFMaxNonUniformAMD 28 InclusiveScan 995 + 997: 9(float) CompositeExtract 992 2 + 998: 9(float) GroupFMaxNonUniformAMD 28 InclusiveScan 997 + 999: 10(fvec3) CompositeConstruct 994 996 998 + 1000: 42(ptr) AccessChain 23 41 + Store 1000 999 + 1001: 54(ptr) AccessChain 23 53 + 1002: 12(f64vec4) Load 1001 + 1003:11(float64_t) CompositeExtract 1002 0 + 1004:11(float64_t) GroupFMaxNonUniformAMD 28 InclusiveScan 1003 + 1005:11(float64_t) CompositeExtract 1002 1 + 1006:11(float64_t) GroupFMaxNonUniformAMD 28 InclusiveScan 1005 + 1007:11(float64_t) CompositeExtract 1002 2 + 1008:11(float64_t) GroupFMaxNonUniformAMD 28 InclusiveScan 1007 + 1009:11(float64_t) CompositeExtract 1002 3 + 1010:11(float64_t) GroupFMaxNonUniformAMD 28 InclusiveScan 1009 + 1011: 12(f64vec4) CompositeConstruct 1004 1006 1008 1010 + 1012: 54(ptr) AccessChain 23 53 + Store 1012 1011 + 1013: 68(ptr) AccessChain 23 67 + 1014: 13(int64_t) Load 1013 + 1015: 13(int64_t) GroupSMaxNonUniformAMD 28 InclusiveScan 1014 + 1016: 68(ptr) AccessChain 23 67 + Store 1016 1015 + 1017: 74(ptr) AccessChain 23 73 + 1018: 15(i64vec2) Load 1017 + 1019: 14(int64_t) CompositeExtract 1018 0 + 1020: 14(int64_t) GroupUMaxNonUniformAMD 28 InclusiveScan 1019 + 1021: 14(int64_t) CompositeExtract 1018 1 + 1022: 14(int64_t) GroupUMaxNonUniformAMD 28 InclusiveScan 1021 + 1023: 15(i64vec2) CompositeConstruct 1020 1022 + 1024: 74(ptr) AccessChain 23 73 + Store 1024 1023 + 1025: 84(ptr) AccessChain 23 83 + 1026: 17(f16vec3) Load 1025 + 1027:16(float16_t) CompositeExtract 1026 0 + 1028:16(float16_t) GroupFMaxNonUniformAMD 28 InclusiveScan 1027 + 1029:16(float16_t) CompositeExtract 1026 1 + 1030:16(float16_t) GroupFMaxNonUniformAMD 28 InclusiveScan 1029 + 1031:16(float16_t) CompositeExtract 1026 2 + 1032:16(float16_t) GroupFMaxNonUniformAMD 28 InclusiveScan 1031 + 1033: 17(f16vec3) CompositeConstruct 1028 1030 1032 + 1034: 84(ptr) AccessChain 23 83 + Store 1034 1033 + 1035: 96(ptr) AccessChain 23 95 + 1036: 19(i16vec4) Load 1035 + 1037: 18(int16_t) CompositeExtract 1036 0 + 1038: 18(int16_t) GroupSMaxNonUniformAMD 28 InclusiveScan 1037 + 1039: 18(int16_t) CompositeExtract 1036 1 + 1040: 18(int16_t) GroupSMaxNonUniformAMD 28 InclusiveScan 1039 + 1041: 18(int16_t) CompositeExtract 1036 2 + 1042: 18(int16_t) GroupSMaxNonUniformAMD 28 InclusiveScan 1041 + 1043: 18(int16_t) CompositeExtract 1036 3 + 1044: 18(int16_t) GroupSMaxNonUniformAMD 28 InclusiveScan 1043 + 1045: 19(i16vec4) CompositeConstruct 1038 1040 1042 1044 + 1046: 96(ptr) AccessChain 23 95 + Store 1046 1045 + 1047: 110(ptr) AccessChain 23 109 + 1048: 20(int16_t) Load 1047 + 1049: 20(int16_t) GroupUMaxNonUniformAMD 28 InclusiveScan 1048 + 1050: 110(ptr) AccessChain 23 109 + Store 1050 1049 + 1051: 25(ptr) AccessChain 23 24 + 1052: 6(int) Load 1051 + 1053: 6(int) GroupIAddNonUniformAMD 28 InclusiveScan 1052 + 1054: 25(ptr) AccessChain 23 24 + Store 1054 1053 + 1055: 32(ptr) AccessChain 23 31 + 1056: 8(ivec2) Load 1055 + 1057: 7(int) CompositeExtract 1056 0 + 1058: 7(int) GroupIAddNonUniformAMD 28 InclusiveScan 1057 + 1059: 7(int) CompositeExtract 1056 1 + 1060: 7(int) GroupIAddNonUniformAMD 28 InclusiveScan 1059 + 1061: 8(ivec2) CompositeConstruct 1058 1060 + 1062: 32(ptr) AccessChain 23 31 + Store 1062 1061 + 1063: 42(ptr) AccessChain 23 41 + 1064: 10(fvec3) Load 1063 + 1065: 9(float) CompositeExtract 1064 0 + 1066: 9(float) GroupFAddNonUniformAMD 28 InclusiveScan 1065 + 1067: 9(float) CompositeExtract 1064 1 + 1068: 9(float) GroupFAddNonUniformAMD 28 InclusiveScan 1067 + 1069: 9(float) CompositeExtract 1064 2 + 1070: 9(float) GroupFAddNonUniformAMD 28 InclusiveScan 1069 + 1071: 10(fvec3) CompositeConstruct 1066 1068 1070 + 1072: 42(ptr) AccessChain 23 41 + Store 1072 1071 + 1073: 54(ptr) AccessChain 23 53 + 1074: 12(f64vec4) Load 1073 + 1075:11(float64_t) CompositeExtract 1074 0 + 1076:11(float64_t) GroupFAddNonUniformAMD 28 InclusiveScan 1075 + 1077:11(float64_t) CompositeExtract 1074 1 + 1078:11(float64_t) GroupFAddNonUniformAMD 28 InclusiveScan 1077 + 1079:11(float64_t) CompositeExtract 1074 2 + 1080:11(float64_t) GroupFAddNonUniformAMD 28 InclusiveScan 1079 + 1081:11(float64_t) CompositeExtract 1074 3 + 1082:11(float64_t) GroupFAddNonUniformAMD 28 InclusiveScan 1081 + 1083: 12(f64vec4) CompositeConstruct 1076 1078 1080 1082 + 1084: 54(ptr) AccessChain 23 53 + Store 1084 1083 + 1085: 68(ptr) AccessChain 23 67 + 1086: 13(int64_t) Load 1085 + 1087: 13(int64_t) GroupIAddNonUniformAMD 28 InclusiveScan 1086 + 1088: 68(ptr) AccessChain 23 67 + Store 1088 1087 + 1089: 74(ptr) AccessChain 23 73 + 1090: 15(i64vec2) Load 1089 + 1091: 14(int64_t) CompositeExtract 1090 0 + 1092: 14(int64_t) GroupIAddNonUniformAMD 28 InclusiveScan 1091 + 1093: 14(int64_t) CompositeExtract 1090 1 + 1094: 14(int64_t) GroupIAddNonUniformAMD 28 InclusiveScan 1093 + 1095: 15(i64vec2) CompositeConstruct 1092 1094 + 1096: 74(ptr) AccessChain 23 73 + Store 1096 1095 + 1097: 84(ptr) AccessChain 23 83 + 1098: 17(f16vec3) Load 1097 + 1099:16(float16_t) CompositeExtract 1098 0 + 1100:16(float16_t) GroupFAddNonUniformAMD 28 InclusiveScan 1099 + 1101:16(float16_t) CompositeExtract 1098 1 + 1102:16(float16_t) GroupFAddNonUniformAMD 28 InclusiveScan 1101 + 1103:16(float16_t) CompositeExtract 1098 2 + 1104:16(float16_t) GroupFAddNonUniformAMD 28 InclusiveScan 1103 + 1105: 17(f16vec3) CompositeConstruct 1100 1102 1104 + 1106: 84(ptr) AccessChain 23 83 + Store 1106 1105 + 1107: 96(ptr) AccessChain 23 95 + 1108: 19(i16vec4) Load 1107 + 1109: 18(int16_t) CompositeExtract 1108 0 + 1110: 18(int16_t) GroupIAddNonUniformAMD 28 InclusiveScan 1109 + 1111: 18(int16_t) CompositeExtract 1108 1 + 1112: 18(int16_t) GroupIAddNonUniformAMD 28 InclusiveScan 1111 + 1113: 18(int16_t) CompositeExtract 1108 2 + 1114: 18(int16_t) GroupIAddNonUniformAMD 28 InclusiveScan 1113 + 1115: 18(int16_t) CompositeExtract 1108 3 + 1116: 18(int16_t) GroupIAddNonUniformAMD 28 InclusiveScan 1115 + 1117: 19(i16vec4) CompositeConstruct 1110 1112 1114 1116 + 1118: 96(ptr) AccessChain 23 95 + Store 1118 1117 + 1119: 110(ptr) AccessChain 23 109 + 1120: 20(int16_t) Load 1119 + 1121: 20(int16_t) GroupIAddNonUniformAMD 28 InclusiveScan 1120 + 1122: 110(ptr) AccessChain 23 109 + Store 1122 1121 + 1123: 25(ptr) AccessChain 23 24 + 1124: 6(int) Load 1123 + 1125: 6(int) GroupSMinNonUniformAMD 28 ExclusiveScan 1124 + 1126: 25(ptr) AccessChain 23 24 + Store 1126 1125 + 1127: 32(ptr) AccessChain 23 31 + 1128: 8(ivec2) Load 1127 + 1129: 7(int) CompositeExtract 1128 0 + 1130: 7(int) GroupUMinNonUniformAMD 28 ExclusiveScan 1129 + 1131: 7(int) CompositeExtract 1128 1 + 1132: 7(int) GroupUMinNonUniformAMD 28 ExclusiveScan 1131 + 1133: 8(ivec2) CompositeConstruct 1130 1132 + 1134: 32(ptr) AccessChain 23 31 + Store 1134 1133 + 1135: 42(ptr) AccessChain 23 41 + 1136: 10(fvec3) Load 1135 + 1137: 9(float) CompositeExtract 1136 0 + 1138: 9(float) GroupFMinNonUniformAMD 28 ExclusiveScan 1137 + 1139: 9(float) CompositeExtract 1136 1 + 1140: 9(float) GroupFMinNonUniformAMD 28 ExclusiveScan 1139 + 1141: 9(float) CompositeExtract 1136 2 + 1142: 9(float) GroupFMinNonUniformAMD 28 ExclusiveScan 1141 + 1143: 10(fvec3) CompositeConstruct 1138 1140 1142 + 1144: 42(ptr) AccessChain 23 41 + Store 1144 1143 + 1145: 54(ptr) AccessChain 23 53 + 1146: 12(f64vec4) Load 1145 + 1147:11(float64_t) CompositeExtract 1146 0 + 1148:11(float64_t) GroupFMinNonUniformAMD 28 ExclusiveScan 1147 + 1149:11(float64_t) CompositeExtract 1146 1 + 1150:11(float64_t) GroupFMinNonUniformAMD 28 ExclusiveScan 1149 + 1151:11(float64_t) CompositeExtract 1146 2 + 1152:11(float64_t) GroupFMinNonUniformAMD 28 ExclusiveScan 1151 + 1153:11(float64_t) CompositeExtract 1146 3 + 1154:11(float64_t) GroupFMinNonUniformAMD 28 ExclusiveScan 1153 + 1155: 12(f64vec4) CompositeConstruct 1148 1150 1152 1154 + 1156: 54(ptr) AccessChain 23 53 + Store 1156 1155 + 1157: 68(ptr) AccessChain 23 67 + 1158: 13(int64_t) Load 1157 + 1159: 13(int64_t) GroupSMinNonUniformAMD 28 ExclusiveScan 1158 + 1160: 68(ptr) AccessChain 23 67 + Store 1160 1159 + 1161: 74(ptr) AccessChain 23 73 + 1162: 15(i64vec2) Load 1161 + 1163: 14(int64_t) CompositeExtract 1162 0 + 1164: 14(int64_t) GroupUMinNonUniformAMD 28 ExclusiveScan 1163 + 1165: 14(int64_t) CompositeExtract 1162 1 + 1166: 14(int64_t) GroupUMinNonUniformAMD 28 ExclusiveScan 1165 + 1167: 15(i64vec2) CompositeConstruct 1164 1166 + 1168: 74(ptr) AccessChain 23 73 + Store 1168 1167 + 1169: 84(ptr) AccessChain 23 83 + 1170: 17(f16vec3) Load 1169 + 1171:16(float16_t) CompositeExtract 1170 0 + 1172:16(float16_t) GroupFMinNonUniformAMD 28 ExclusiveScan 1171 + 1173:16(float16_t) CompositeExtract 1170 1 + 1174:16(float16_t) GroupFMinNonUniformAMD 28 ExclusiveScan 1173 + 1175:16(float16_t) CompositeExtract 1170 2 + 1176:16(float16_t) GroupFMinNonUniformAMD 28 ExclusiveScan 1175 + 1177: 17(f16vec3) CompositeConstruct 1172 1174 1176 + 1178: 84(ptr) AccessChain 23 83 + Store 1178 1177 + 1179: 96(ptr) AccessChain 23 95 + 1180: 19(i16vec4) Load 1179 + 1181: 18(int16_t) CompositeExtract 1180 0 + 1182: 18(int16_t) GroupSMinNonUniformAMD 28 ExclusiveScan 1181 + 1183: 18(int16_t) CompositeExtract 1180 1 + 1184: 18(int16_t) GroupSMinNonUniformAMD 28 ExclusiveScan 1183 + 1185: 18(int16_t) CompositeExtract 1180 2 + 1186: 18(int16_t) GroupSMinNonUniformAMD 28 ExclusiveScan 1185 + 1187: 18(int16_t) CompositeExtract 1180 3 + 1188: 18(int16_t) GroupSMinNonUniformAMD 28 ExclusiveScan 1187 + 1189: 19(i16vec4) CompositeConstruct 1182 1184 1186 1188 + 1190: 96(ptr) AccessChain 23 95 + Store 1190 1189 + 1191: 110(ptr) AccessChain 23 109 + 1192: 20(int16_t) Load 1191 + 1193: 20(int16_t) GroupUMinNonUniformAMD 28 ExclusiveScan 1192 + 1194: 110(ptr) AccessChain 23 109 + Store 1194 1193 + 1195: 25(ptr) AccessChain 23 24 + 1196: 6(int) Load 1195 + 1197: 6(int) GroupSMaxNonUniformAMD 28 ExclusiveScan 1196 + 1198: 25(ptr) AccessChain 23 24 + Store 1198 1197 + 1199: 32(ptr) AccessChain 23 31 + 1200: 8(ivec2) Load 1199 + 1201: 7(int) CompositeExtract 1200 0 + 1202: 7(int) GroupUMaxNonUniformAMD 28 ExclusiveScan 1201 + 1203: 7(int) CompositeExtract 1200 1 + 1204: 7(int) GroupUMaxNonUniformAMD 28 ExclusiveScan 1203 + 1205: 8(ivec2) CompositeConstruct 1202 1204 + 1206: 32(ptr) AccessChain 23 31 + Store 1206 1205 + 1207: 42(ptr) AccessChain 23 41 + 1208: 10(fvec3) Load 1207 + 1209: 9(float) CompositeExtract 1208 0 + 1210: 9(float) GroupFMaxNonUniformAMD 28 ExclusiveScan 1209 + 1211: 9(float) CompositeExtract 1208 1 + 1212: 9(float) GroupFMaxNonUniformAMD 28 ExclusiveScan 1211 + 1213: 9(float) CompositeExtract 1208 2 + 1214: 9(float) GroupFMaxNonUniformAMD 28 ExclusiveScan 1213 + 1215: 10(fvec3) CompositeConstruct 1210 1212 1214 + 1216: 42(ptr) AccessChain 23 41 + Store 1216 1215 + 1217: 54(ptr) AccessChain 23 53 + 1218: 12(f64vec4) Load 1217 + 1219:11(float64_t) CompositeExtract 1218 0 + 1220:11(float64_t) GroupFMaxNonUniformAMD 28 ExclusiveScan 1219 + 1221:11(float64_t) CompositeExtract 1218 1 + 1222:11(float64_t) GroupFMaxNonUniformAMD 28 ExclusiveScan 1221 + 1223:11(float64_t) CompositeExtract 1218 2 + 1224:11(float64_t) GroupFMaxNonUniformAMD 28 ExclusiveScan 1223 + 1225:11(float64_t) CompositeExtract 1218 3 + 1226:11(float64_t) GroupFMaxNonUniformAMD 28 ExclusiveScan 1225 + 1227: 12(f64vec4) CompositeConstruct 1220 1222 1224 1226 + 1228: 54(ptr) AccessChain 23 53 + Store 1228 1227 + 1229: 68(ptr) AccessChain 23 67 + 1230: 13(int64_t) Load 1229 + 1231: 13(int64_t) GroupSMaxNonUniformAMD 28 ExclusiveScan 1230 + 1232: 68(ptr) AccessChain 23 67 + Store 1232 1231 + 1233: 74(ptr) AccessChain 23 73 + 1234: 15(i64vec2) Load 1233 + 1235: 14(int64_t) CompositeExtract 1234 0 + 1236: 14(int64_t) GroupUMaxNonUniformAMD 28 ExclusiveScan 1235 + 1237: 14(int64_t) CompositeExtract 1234 1 + 1238: 14(int64_t) GroupUMaxNonUniformAMD 28 ExclusiveScan 1237 + 1239: 15(i64vec2) CompositeConstruct 1236 1238 + 1240: 74(ptr) AccessChain 23 73 + Store 1240 1239 + 1241: 84(ptr) AccessChain 23 83 + 1242: 17(f16vec3) Load 1241 + 1243:16(float16_t) CompositeExtract 1242 0 + 1244:16(float16_t) GroupFMaxNonUniformAMD 28 ExclusiveScan 1243 + 1245:16(float16_t) CompositeExtract 1242 1 + 1246:16(float16_t) GroupFMaxNonUniformAMD 28 ExclusiveScan 1245 + 1247:16(float16_t) CompositeExtract 1242 2 + 1248:16(float16_t) GroupFMaxNonUniformAMD 28 ExclusiveScan 1247 + 1249: 17(f16vec3) CompositeConstruct 1244 1246 1248 + 1250: 84(ptr) AccessChain 23 83 + Store 1250 1249 + 1251: 96(ptr) AccessChain 23 95 + 1252: 19(i16vec4) Load 1251 + 1253: 18(int16_t) CompositeExtract 1252 0 + 1254: 18(int16_t) GroupSMaxNonUniformAMD 28 ExclusiveScan 1253 + 1255: 18(int16_t) CompositeExtract 1252 1 + 1256: 18(int16_t) GroupSMaxNonUniformAMD 28 ExclusiveScan 1255 + 1257: 18(int16_t) CompositeExtract 1252 2 + 1258: 18(int16_t) GroupSMaxNonUniformAMD 28 ExclusiveScan 1257 + 1259: 18(int16_t) CompositeExtract 1252 3 + 1260: 18(int16_t) GroupSMaxNonUniformAMD 28 ExclusiveScan 1259 + 1261: 19(i16vec4) CompositeConstruct 1254 1256 1258 1260 + 1262: 96(ptr) AccessChain 23 95 + Store 1262 1261 + 1263: 110(ptr) AccessChain 23 109 + 1264: 20(int16_t) Load 1263 + 1265: 20(int16_t) GroupUMaxNonUniformAMD 28 ExclusiveScan 1264 + 1266: 110(ptr) AccessChain 23 109 + Store 1266 1265 + 1267: 25(ptr) AccessChain 23 24 + 1268: 6(int) Load 1267 + 1269: 6(int) GroupIAddNonUniformAMD 28 ExclusiveScan 1268 + 1270: 25(ptr) AccessChain 23 24 + Store 1270 1269 + 1271: 32(ptr) AccessChain 23 31 + 1272: 8(ivec2) Load 1271 + 1273: 7(int) CompositeExtract 1272 0 + 1274: 7(int) GroupIAddNonUniformAMD 28 ExclusiveScan 1273 + 1275: 7(int) CompositeExtract 1272 1 + 1276: 7(int) GroupIAddNonUniformAMD 28 ExclusiveScan 1275 + 1277: 8(ivec2) CompositeConstruct 1274 1276 + 1278: 32(ptr) AccessChain 23 31 + Store 1278 1277 + 1279: 42(ptr) AccessChain 23 41 + 1280: 10(fvec3) Load 1279 + 1281: 9(float) CompositeExtract 1280 0 + 1282: 9(float) GroupFAddNonUniformAMD 28 ExclusiveScan 1281 + 1283: 9(float) CompositeExtract 1280 1 + 1284: 9(float) GroupFAddNonUniformAMD 28 ExclusiveScan 1283 + 1285: 9(float) CompositeExtract 1280 2 + 1286: 9(float) GroupFAddNonUniformAMD 28 ExclusiveScan 1285 + 1287: 10(fvec3) CompositeConstruct 1282 1284 1286 + 1288: 42(ptr) AccessChain 23 41 + Store 1288 1287 + 1289: 54(ptr) AccessChain 23 53 + 1290: 12(f64vec4) Load 1289 + 1291:11(float64_t) CompositeExtract 1290 0 + 1292:11(float64_t) GroupFAddNonUniformAMD 28 ExclusiveScan 1291 + 1293:11(float64_t) CompositeExtract 1290 1 + 1294:11(float64_t) GroupFAddNonUniformAMD 28 ExclusiveScan 1293 + 1295:11(float64_t) CompositeExtract 1290 2 + 1296:11(float64_t) GroupFAddNonUniformAMD 28 ExclusiveScan 1295 + 1297:11(float64_t) CompositeExtract 1290 3 + 1298:11(float64_t) GroupFAddNonUniformAMD 28 ExclusiveScan 1297 + 1299: 12(f64vec4) CompositeConstruct 1292 1294 1296 1298 + 1300: 54(ptr) AccessChain 23 53 + Store 1300 1299 + 1301: 68(ptr) AccessChain 23 67 + 1302: 13(int64_t) Load 1301 + 1303: 13(int64_t) GroupIAddNonUniformAMD 28 ExclusiveScan 1302 + 1304: 68(ptr) AccessChain 23 67 + Store 1304 1303 + 1305: 74(ptr) AccessChain 23 73 + 1306: 15(i64vec2) Load 1305 + 1307: 14(int64_t) CompositeExtract 1306 0 + 1308: 14(int64_t) GroupIAddNonUniformAMD 28 ExclusiveScan 1307 + 1309: 14(int64_t) CompositeExtract 1306 1 + 1310: 14(int64_t) GroupIAddNonUniformAMD 28 ExclusiveScan 1309 + 1311: 15(i64vec2) CompositeConstruct 1308 1310 + 1312: 74(ptr) AccessChain 23 73 + Store 1312 1311 + 1313: 84(ptr) AccessChain 23 83 + 1314: 17(f16vec3) Load 1313 + 1315:16(float16_t) CompositeExtract 1314 0 + 1316:16(float16_t) GroupFAddNonUniformAMD 28 ExclusiveScan 1315 + 1317:16(float16_t) CompositeExtract 1314 1 + 1318:16(float16_t) GroupFAddNonUniformAMD 28 ExclusiveScan 1317 + 1319:16(float16_t) CompositeExtract 1314 2 + 1320:16(float16_t) GroupFAddNonUniformAMD 28 ExclusiveScan 1319 + 1321: 17(f16vec3) CompositeConstruct 1316 1318 1320 + 1322: 84(ptr) AccessChain 23 83 + Store 1322 1321 + 1323: 96(ptr) AccessChain 23 95 + 1324: 19(i16vec4) Load 1323 + 1325: 18(int16_t) CompositeExtract 1324 0 + 1326: 18(int16_t) GroupIAddNonUniformAMD 28 ExclusiveScan 1325 + 1327: 18(int16_t) CompositeExtract 1324 1 + 1328: 18(int16_t) GroupIAddNonUniformAMD 28 ExclusiveScan 1327 + 1329: 18(int16_t) CompositeExtract 1324 2 + 1330: 18(int16_t) GroupIAddNonUniformAMD 28 ExclusiveScan 1329 + 1331: 18(int16_t) CompositeExtract 1324 3 + 1332: 18(int16_t) GroupIAddNonUniformAMD 28 ExclusiveScan 1331 + 1333: 19(i16vec4) CompositeConstruct 1326 1328 1330 1332 + 1334: 96(ptr) AccessChain 23 95 + Store 1334 1333 + 1335: 110(ptr) AccessChain 23 109 + 1336: 20(int16_t) Load 1335 + 1337: 20(int16_t) GroupIAddNonUniformAMD 28 ExclusiveScan 1336 + 1338: 110(ptr) AccessChain 23 109 + Store 1338 1337 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.shaderDrawParams.vert.out b/deps/glslang/Test/baseResults/spv.shaderDrawParams.vert.out new file mode 100644 index 00000000..d6b43e8f --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.shaderDrawParams.vert.out @@ -0,0 +1,102 @@ +spv.shaderDrawParams.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 53 + + Capability Shader + Capability DrawParameters + Extension "SPV_KHR_shader_draw_parameters" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 9 16 29 37 + Source GLSL 450 + SourceExtension "GL_ARB_shader_draw_parameters" + Name 4 "main" + Name 9 "gl_BaseVertexARB" + Name 16 "gl_BaseInstanceARB" + Name 27 "gl_PerVertex" + MemberName 27(gl_PerVertex) 0 "gl_Position" + MemberName 27(gl_PerVertex) 1 "gl_PointSize" + MemberName 27(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 27(gl_PerVertex) 3 "gl_CullDistance" + Name 29 "" + Name 34 "Block" + MemberName 34(Block) 0 "pos" + Name 36 "block" + Name 37 "gl_DrawIDARB" + Decorate 9(gl_BaseVertexARB) BuiltIn BaseVertex + Decorate 16(gl_BaseInstanceARB) BuiltIn BaseInstance + MemberDecorate 27(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 27(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 27(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 27(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 27(gl_PerVertex) Block + Decorate 31 ArrayStride 16 + Decorate 33 ArrayStride 64 + MemberDecorate 34(Block) 0 Offset 0 + Decorate 34(Block) Block + Decorate 36(block) DescriptorSet 0 + Decorate 36(block) Binding 0 + Decorate 37(gl_DrawIDARB) BuiltIn DrawIndex + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeBool + 7: TypeInt 32 1 + 8: TypePointer Input 7(int) +9(gl_BaseVertexARB): 8(ptr) Variable Input + 11: 7(int) Constant 0 +16(gl_BaseInstanceARB): 8(ptr) Variable Input + 22: TypeFloat 32 + 23: TypeVector 22(float) 4 + 24: TypeInt 32 0 + 25: 24(int) Constant 1 + 26: TypeArray 22(float) 25 +27(gl_PerVertex): TypeStruct 23(fvec4) 22(float) 26 26 + 28: TypePointer Output 27(gl_PerVertex) + 29: 28(ptr) Variable Output + 30: 24(int) Constant 4 + 31: TypeArray 23(fvec4) 30 + 32: 24(int) Constant 2 + 33: TypeArray 31 32 + 34(Block): TypeStruct 33 + 35: TypePointer Uniform 34(Block) + 36(block): 35(ptr) Variable Uniform +37(gl_DrawIDARB): 8(ptr) Variable Input + 39: 7(int) Constant 4 + 41: TypePointer Uniform 23(fvec4) + 44: TypePointer Output 23(fvec4) + 47: 7(int) Constant 1 + 4(main): 2 Function None 3 + 5: Label + 10: 7(int) Load 9(gl_BaseVertexARB) + 12: 6(bool) SGreaterThan 10 11 + 13: 6(bool) LogicalNot 12 + SelectionMerge 15 None + BranchConditional 13 14 15 + 14: Label + 17: 7(int) Load 16(gl_BaseInstanceARB) + 18: 6(bool) SGreaterThan 17 11 + Branch 15 + 15: Label + 19: 6(bool) Phi 12 5 18 14 + SelectionMerge 21 None + BranchConditional 19 20 46 + 20: Label + 38: 7(int) Load 37(gl_DrawIDARB) + 40: 7(int) SMod 38 39 + 42: 41(ptr) AccessChain 36(block) 11 11 40 + 43: 23(fvec4) Load 42 + 45: 44(ptr) AccessChain 29 11 + Store 45 43 + Branch 21 + 46: Label + 48: 7(int) Load 37(gl_DrawIDARB) + 49: 7(int) SMod 48 39 + 50: 41(ptr) AccessChain 36(block) 11 47 49 + 51: 23(fvec4) Load 50 + 52: 44(ptr) AccessChain 29 11 + Store 52 51 + Branch 21 + 21: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.shaderFragMaskAMD.frag.out b/deps/glslang/Test/baseResults/spv.shaderFragMaskAMD.frag.out new file mode 100644 index 00000000..788d3ee6 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.shaderFragMaskAMD.frag.out @@ -0,0 +1,122 @@ +spv.shaderFragMaskAMD.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 80 + + Capability Shader + Capability InputAttachment + Capability FragmentMaskAMD + Extension "SPV_AMD_shader_fragment_mask" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 78 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_AMD_shader_fragment_mask" + Name 4 "main" + Name 9 "f4" + Name 14 "fragMask" + Name 18 "s2DMS" + Name 27 "fragIndex" + Name 42 "is2DMSArray" + Name 62 "usubpassMS" + Name 78 "fragColor" + Decorate 18(s2DMS) DescriptorSet 0 + Decorate 18(s2DMS) Binding 0 + Decorate 42(is2DMSArray) DescriptorSet 0 + Decorate 42(is2DMSArray) Binding 1 + Decorate 62(usubpassMS) DescriptorSet 0 + Decorate 62(usubpassMS) Binding 2 + Decorate 62(usubpassMS) InputAttachmentIndex 0 + Decorate 78(fragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: 6(float) Constant 0 + 11: 7(fvec4) ConstantComposite 10 10 10 10 + 12: TypeInt 32 0 + 13: TypePointer Function 12(int) + 15: TypeImage 6(float) 2D multi-sampled sampled format:Unknown + 16: TypeSampledImage 15 + 17: TypePointer UniformConstant 16 + 18(s2DMS): 17(ptr) Variable UniformConstant + 20: TypeInt 32 1 + 21: TypeVector 20(int) 2 + 22: 20(int) Constant 2 + 23: 20(int) Constant 3 + 24: 21(ivec2) ConstantComposite 22 23 + 29: 12(int) Constant 240 + 31: 20(int) Constant 4 + 34: 12(int) Constant 1 + 39: TypeImage 20(int) 2D array multi-sampled sampled format:Unknown + 40: TypeSampledImage 39 + 41: TypePointer UniformConstant 40 + 42(is2DMSArray): 41(ptr) Variable UniformConstant + 44: TypeVector 20(int) 3 + 45: 20(int) Constant 1 + 46: 44(ivec3) ConstantComposite 22 23 45 + 55: TypeVector 20(int) 4 + 60: TypeImage 12(int) SubpassData multi-sampled nonsampled format:Unknown + 61: TypePointer UniformConstant 60 + 62(usubpassMS): 61(ptr) Variable UniformConstant + 64: 20(int) Constant 0 + 65: 21(ivec2) ConstantComposite 64 64 + 72: TypeVector 12(int) 4 + 77: TypePointer Output 7(fvec4) + 78(fragColor): 77(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 9(f4): 8(ptr) Variable Function + 14(fragMask): 13(ptr) Variable Function + 27(fragIndex): 13(ptr) Variable Function + Store 9(f4) 11 + 19: 16 Load 18(s2DMS) + 25: 15 Image 19 + 26: 12(int) FragmentMaskFetchAMD 25 24 + Store 14(fragMask) 26 + 28: 12(int) Load 14(fragMask) + 30: 12(int) BitwiseAnd 28 29 + 32: 12(int) ShiftRightLogical 30 31 + Store 27(fragIndex) 32 + 33: 16 Load 18(s2DMS) + 35: 15 Image 33 + 36: 7(fvec4) FragmentFetchAMD 35 24 34 + 37: 7(fvec4) Load 9(f4) + 38: 7(fvec4) FAdd 37 36 + Store 9(f4) 38 + 43: 40 Load 42(is2DMSArray) + 47: 39 Image 43 + 48: 12(int) FragmentMaskFetchAMD 47 46 + Store 14(fragMask) 48 + 49: 12(int) Load 14(fragMask) + 50: 12(int) BitwiseAnd 49 29 + 51: 12(int) ShiftRightLogical 50 31 + Store 27(fragIndex) 51 + 52: 40 Load 42(is2DMSArray) + 53: 12(int) Load 27(fragIndex) + 54: 39 Image 52 + 56: 55(ivec4) FragmentFetchAMD 54 46 53 + 57: 7(fvec4) ConvertSToF 56 + 58: 7(fvec4) Load 9(f4) + 59: 7(fvec4) FAdd 58 57 + Store 9(f4) 59 + 63: 60 Load 62(usubpassMS) + 66: 12(int) FragmentMaskFetchAMD 63 65 + Store 14(fragMask) 66 + 67: 12(int) Load 14(fragMask) + 68: 12(int) BitwiseAnd 67 29 + 69: 12(int) ShiftRightLogical 68 31 + Store 27(fragIndex) 69 + 70: 60 Load 62(usubpassMS) + 71: 12(int) Load 27(fragIndex) + 73: 72(ivec4) FragmentFetchAMD 70 65 71 + 74: 7(fvec4) ConvertUToF 73 + 75: 7(fvec4) Load 9(f4) + 76: 7(fvec4) FAdd 75 74 + Store 9(f4) 76 + 79: 7(fvec4) Load 9(f4) + Store 78(fragColor) 79 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.shaderGroupVote.comp.out b/deps/glslang/Test/baseResults/spv.shaderGroupVote.comp.out new file mode 100644 index 00000000..e45f5858 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.shaderGroupVote.comp.out @@ -0,0 +1,62 @@ +spv.shaderGroupVote.comp +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 33 + + Capability Shader + Capability SubgroupVoteKHR + Extension "SPV_KHR_subgroup_vote" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" + ExecutionMode 4 LocalSize 4 4 1 + Source GLSL 450 + SourceExtension "GL_ARB_shader_group_vote" + Name 4 "main" + Name 8 "b1" + Name 10 "Buffers" + MemberName 10(Buffers) 0 "b" + Name 12 "" + MemberDecorate 10(Buffers) 0 Offset 0 + Decorate 10(Buffers) BufferBlock + Decorate 12 DescriptorSet 0 + Decorate 12 Binding 0 + Decorate 32 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeBool + 7: TypePointer Function 6(bool) + 9: TypeInt 32 0 + 10(Buffers): TypeStruct 9(int) + 11: TypePointer Uniform 10(Buffers) + 12: 11(ptr) Variable Uniform + 13: TypeInt 32 1 + 14: 13(int) Constant 0 + 15: TypePointer Uniform 9(int) + 18: 9(int) Constant 0 + 27: 9(int) Constant 1 + 30: TypeVector 9(int) 3 + 31: 9(int) Constant 4 + 32: 30(ivec3) ConstantComposite 31 31 27 + 4(main): 2 Function None 3 + 5: Label + 8(b1): 7(ptr) Variable Function + 16: 15(ptr) AccessChain 12 14 + 17: 9(int) Load 16 + 19: 6(bool) INotEqual 17 18 + Store 8(b1) 19 + 20: 6(bool) Load 8(b1) + 21: 6(bool) SubgroupAnyKHR 20 + Store 8(b1) 21 + 22: 6(bool) Load 8(b1) + 23: 6(bool) SubgroupAllKHR 22 + Store 8(b1) 23 + 24: 6(bool) Load 8(b1) + 25: 6(bool) SubgroupAllEqualKHR 24 + Store 8(b1) 25 + 26: 6(bool) Load 8(b1) + 28: 9(int) Select 26 27 18 + 29: 15(ptr) AccessChain 12 14 + Store 29 28 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.shaderImageFootprint.frag.out b/deps/glslang/Test/baseResults/spv.shaderImageFootprint.frag.out new file mode 100644 index 00000000..2ada2b5a --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.shaderImageFootprint.frag.out @@ -0,0 +1,849 @@ +spv.shaderImageFootprint.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 622 + + Capability Shader + Capability MinLod + Capability Bad + Extension "SPV_NV_shader_image_footprint" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 21 24 76 125 225 275 277 387 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_NV_shader_texture_footprint" + Name 4 "main" + Name 8 "result2D" + MemberName 8(result2D) 0 "ret2D" + MemberName 8(result2D) 1 "anchor2D" + MemberName 8(result2D) 2 "offset2D" + MemberName 8(result2D) 3 "mask2D" + MemberName 8(result2D) 4 "lod2D" + MemberName 8(result2D) 5 "granularity2D" + Name 10 "" + Name 17 "sample2D" + Name 21 "P2" + Name 24 "granularity" + Name 28 "gl_TextureFootprint2DNV" + MemberName 28(gl_TextureFootprint2DNV) 0 "anchor" + MemberName 28(gl_TextureFootprint2DNV) 1 "offset" + MemberName 28(gl_TextureFootprint2DNV) 2 "mask" + MemberName 28(gl_TextureFootprint2DNV) 3 "lod" + MemberName 28(gl_TextureFootprint2DNV) 4 "granularity" + Name 30 "fp2D" + Name 31 "ResType" + Name 76 "bias" + Name 78 "ResType" + Name 125 "lodClamp" + Name 128 "ResType" + Name 178 "ResType" + Name 225 "lod" + Name 228 "ResType" + Name 275 "dx" + Name 277 "dy" + Name 280 "ResType" + Name 331 "ResType" + Name 377 "result3D" + MemberName 377(result3D) 0 "ret3D" + MemberName 377(result3D) 1 "anchor3D" + MemberName 377(result3D) 2 "offset3D" + MemberName 377(result3D) 3 "mask3D" + MemberName 377(result3D) 4 "lod3D" + MemberName 377(result3D) 5 "granularity3D" + Name 379 "" + Name 383 "sample3D" + Name 387 "P3" + Name 390 "gl_TextureFootprint3DNV" + MemberName 390(gl_TextureFootprint3DNV) 0 "anchor" + MemberName 390(gl_TextureFootprint3DNV) 1 "offset" + MemberName 390(gl_TextureFootprint3DNV) 2 "mask" + MemberName 390(gl_TextureFootprint3DNV) 3 "lod" + MemberName 390(gl_TextureFootprint3DNV) 4 "granularity" + Name 392 "fp3D" + Name 393 "ResType" + Name 429 "ResType" + Name 478 "ResType" + Name 528 "ResType" + Name 577 "ResType" + MemberDecorate 8(result2D) 0 Offset 0 + MemberDecorate 8(result2D) 1 Offset 8 + MemberDecorate 8(result2D) 2 Offset 16 + MemberDecorate 8(result2D) 3 Offset 24 + MemberDecorate 8(result2D) 4 Offset 32 + MemberDecorate 8(result2D) 5 Offset 36 + Decorate 8(result2D) BufferBlock + Decorate 10 DescriptorSet 0 + Decorate 17(sample2D) DescriptorSet 0 + Decorate 21(P2) Location 0 + Decorate 24(granularity) Flat + Decorate 24(granularity) Location 3 + Decorate 76(bias) Location 9 + Decorate 125(lodClamp) Location 4 + Decorate 225(lod) Location 5 + Decorate 275(dx) Location 6 + Decorate 277(dy) Location 8 + MemberDecorate 377(result3D) 0 Offset 0 + MemberDecorate 377(result3D) 1 Offset 16 + MemberDecorate 377(result3D) 2 Offset 32 + MemberDecorate 377(result3D) 3 Offset 48 + MemberDecorate 377(result3D) 4 Offset 56 + MemberDecorate 377(result3D) 5 Offset 60 + Decorate 377(result3D) BufferBlock + Decorate 379 DescriptorSet 0 + Decorate 383(sample3D) DescriptorSet 0 + Decorate 387(P3) Location 2 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 2 + 8(result2D): TypeStruct 6(int) 7(ivec2) 7(ivec2) 7(ivec2) 6(int) 6(int) + 9: TypePointer Uniform 8(result2D) + 10: 9(ptr) Variable Uniform + 11: TypeInt 32 1 + 12: 11(int) Constant 0 + 13: TypeFloat 32 + 14: TypeImage 13(float) 2D sampled format:Unknown + 15: TypeSampledImage 14 + 16: TypePointer UniformConstant 15 + 17(sample2D): 16(ptr) Variable UniformConstant + 19: TypeVector 13(float) 2 + 20: TypePointer Input 19(fvec2) + 21(P2): 20(ptr) Variable Input + 23: TypePointer Input 11(int) + 24(granularity): 23(ptr) Variable Input + 26: TypeBool + 27: 26(bool) ConstantTrue +28(gl_TextureFootprint2DNV): TypeStruct 7(ivec2) 7(ivec2) 7(ivec2) 6(int) 6(int) + 29: TypePointer Function 28(gl_TextureFootprint2DNV) + 31(ResType): TypeStruct 26(bool) 7(ivec2) 7(ivec2) 7(ivec2) 6(int) 6(int) + 34: TypePointer Function 7(ivec2) + 36: 11(int) Constant 1 + 39: 11(int) Constant 2 + 42: 11(int) Constant 3 + 44: TypePointer Function 6(int) + 46: 11(int) Constant 4 + 50: 6(int) Constant 1 + 51: 6(int) Constant 0 + 53: TypePointer Uniform 6(int) + 57: TypePointer Uniform 7(ivec2) + 68: 11(int) Constant 5 + 75: TypePointer Input 13(float) + 76(bias): 75(ptr) Variable Input + 78(ResType): TypeStruct 26(bool) 7(ivec2) 7(ivec2) 7(ivec2) 6(int) 6(int) + 125(lodClamp): 75(ptr) Variable Input + 128(ResType): TypeStruct 26(bool) 7(ivec2) 7(ivec2) 7(ivec2) 6(int) 6(int) + 178(ResType): TypeStruct 26(bool) 7(ivec2) 7(ivec2) 7(ivec2) 6(int) 6(int) + 225(lod): 75(ptr) Variable Input + 228(ResType): TypeStruct 26(bool) 7(ivec2) 7(ivec2) 7(ivec2) 6(int) 6(int) + 275(dx): 20(ptr) Variable Input + 277(dy): 20(ptr) Variable Input + 280(ResType): TypeStruct 26(bool) 7(ivec2) 7(ivec2) 7(ivec2) 6(int) 6(int) + 331(ResType): TypeStruct 26(bool) 7(ivec2) 7(ivec2) 7(ivec2) 6(int) 6(int) + 376: TypeVector 6(int) 3 + 377(result3D): TypeStruct 6(int) 376(ivec3) 376(ivec3) 7(ivec2) 6(int) 6(int) + 378: TypePointer Uniform 377(result3D) + 379: 378(ptr) Variable Uniform + 380: TypeImage 13(float) 3D sampled format:Unknown + 381: TypeSampledImage 380 + 382: TypePointer UniformConstant 381 + 383(sample3D): 382(ptr) Variable UniformConstant + 385: TypeVector 13(float) 3 + 386: TypePointer Input 385(fvec3) + 387(P3): 386(ptr) Variable Input +390(gl_TextureFootprint3DNV): TypeStruct 376(ivec3) 376(ivec3) 7(ivec2) 6(int) 6(int) + 391: TypePointer Function 390(gl_TextureFootprint3DNV) + 393(ResType): TypeStruct 26(bool) 376(ivec3) 376(ivec3) 7(ivec2) 6(int) 6(int) + 396: TypePointer Function 376(ivec3) + 411: TypePointer Uniform 376(ivec3) + 429(ResType): TypeStruct 26(bool) 376(ivec3) 376(ivec3) 7(ivec2) 6(int) 6(int) + 478(ResType): TypeStruct 26(bool) 376(ivec3) 376(ivec3) 7(ivec2) 6(int) 6(int) + 528(ResType): TypeStruct 26(bool) 376(ivec3) 376(ivec3) 7(ivec2) 6(int) 6(int) + 577(ResType): TypeStruct 26(bool) 376(ivec3) 376(ivec3) 7(ivec2) 6(int) 6(int) + 4(main): 2 Function None 3 + 5: Label + 30(fp2D): 29(ptr) Variable Function + 392(fp3D): 391(ptr) Variable Function + 18: 15 Load 17(sample2D) + 22: 19(fvec2) Load 21(P2) + 25: 11(int) Load 24(granularity) + 32: 31(ResType) ImageSampleFootprintNV 18 22 25 27 + 33: 7(ivec2) CompositeExtract 32 1 + 35: 34(ptr) AccessChain 30(fp2D) 12 + Store 35 33 + 37: 7(ivec2) CompositeExtract 32 2 + 38: 34(ptr) AccessChain 30(fp2D) 36 + Store 38 37 + 40: 7(ivec2) CompositeExtract 32 3 + 41: 34(ptr) AccessChain 30(fp2D) 39 + Store 41 40 + 43: 6(int) CompositeExtract 32 4 + 45: 44(ptr) AccessChain 30(fp2D) 42 + Store 45 43 + 47: 6(int) CompositeExtract 32 5 + 48: 44(ptr) AccessChain 30(fp2D) 46 + Store 48 47 + 49: 26(bool) CompositeExtract 32 0 + 52: 6(int) Select 49 50 51 + 54: 53(ptr) AccessChain 10 12 + Store 54 52 + 55: 34(ptr) AccessChain 30(fp2D) 12 + 56: 7(ivec2) Load 55 + 58: 57(ptr) AccessChain 10 36 + Store 58 56 + 59: 34(ptr) AccessChain 30(fp2D) 36 + 60: 7(ivec2) Load 59 + 61: 57(ptr) AccessChain 10 39 + Store 61 60 + 62: 34(ptr) AccessChain 30(fp2D) 39 + 63: 7(ivec2) Load 62 + 64: 57(ptr) AccessChain 10 42 + Store 64 63 + 65: 44(ptr) AccessChain 30(fp2D) 42 + 66: 6(int) Load 65 + 67: 53(ptr) AccessChain 10 46 + Store 67 66 + 69: 44(ptr) AccessChain 30(fp2D) 46 + 70: 6(int) Load 69 + 71: 53(ptr) AccessChain 10 68 + Store 71 70 + 72: 15 Load 17(sample2D) + 73: 19(fvec2) Load 21(P2) + 74: 11(int) Load 24(granularity) + 77: 13(float) Load 76(bias) + 79: 78(ResType) ImageSampleFootprintNV 72 73 74 27 Bias 77 + 80: 7(ivec2) CompositeExtract 79 1 + 81: 34(ptr) AccessChain 30(fp2D) 12 + Store 81 80 + 82: 7(ivec2) CompositeExtract 79 2 + 83: 34(ptr) AccessChain 30(fp2D) 36 + Store 83 82 + 84: 7(ivec2) CompositeExtract 79 3 + 85: 34(ptr) AccessChain 30(fp2D) 39 + Store 85 84 + 86: 6(int) CompositeExtract 79 4 + 87: 44(ptr) AccessChain 30(fp2D) 42 + Store 87 86 + 88: 6(int) CompositeExtract 79 5 + 89: 44(ptr) AccessChain 30(fp2D) 46 + Store 89 88 + 90: 26(bool) CompositeExtract 79 0 + 91: 6(int) Select 90 50 51 + 92: 53(ptr) AccessChain 10 12 + Store 92 91 + 93: 34(ptr) AccessChain 30(fp2D) 12 + 94: 7(ivec2) Load 93 + 95: 57(ptr) AccessChain 10 36 + 96: 7(ivec2) Load 95 + 97: 7(ivec2) IAdd 96 94 + 98: 57(ptr) AccessChain 10 36 + Store 98 97 + 99: 34(ptr) AccessChain 30(fp2D) 36 + 100: 7(ivec2) Load 99 + 101: 57(ptr) AccessChain 10 39 + 102: 7(ivec2) Load 101 + 103: 7(ivec2) IAdd 102 100 + 104: 57(ptr) AccessChain 10 39 + Store 104 103 + 105: 34(ptr) AccessChain 30(fp2D) 39 + 106: 7(ivec2) Load 105 + 107: 57(ptr) AccessChain 10 42 + 108: 7(ivec2) Load 107 + 109: 7(ivec2) IAdd 108 106 + 110: 57(ptr) AccessChain 10 42 + Store 110 109 + 111: 44(ptr) AccessChain 30(fp2D) 42 + 112: 6(int) Load 111 + 113: 53(ptr) AccessChain 10 46 + 114: 6(int) Load 113 + 115: 6(int) IAdd 114 112 + 116: 53(ptr) AccessChain 10 46 + Store 116 115 + 117: 44(ptr) AccessChain 30(fp2D) 46 + 118: 6(int) Load 117 + 119: 53(ptr) AccessChain 10 68 + 120: 6(int) Load 119 + 121: 6(int) IAdd 120 118 + 122: 53(ptr) AccessChain 10 68 + Store 122 121 + 123: 15 Load 17(sample2D) + 124: 19(fvec2) Load 21(P2) + 126: 13(float) Load 125(lodClamp) + 127: 11(int) Load 24(granularity) + 129:128(ResType) ImageSampleFootprintNV 123 124 127 27 MinLod 126 + 130: 7(ivec2) CompositeExtract 129 1 + 131: 34(ptr) AccessChain 30(fp2D) 12 + Store 131 130 + 132: 7(ivec2) CompositeExtract 129 2 + 133: 34(ptr) AccessChain 30(fp2D) 36 + Store 133 132 + 134: 7(ivec2) CompositeExtract 129 3 + 135: 34(ptr) AccessChain 30(fp2D) 39 + Store 135 134 + 136: 6(int) CompositeExtract 129 4 + 137: 44(ptr) AccessChain 30(fp2D) 42 + Store 137 136 + 138: 6(int) CompositeExtract 129 5 + 139: 44(ptr) AccessChain 30(fp2D) 46 + Store 139 138 + 140: 26(bool) CompositeExtract 129 0 + 141: 6(int) Select 140 50 51 + 142: 53(ptr) AccessChain 10 12 + Store 142 141 + 143: 34(ptr) AccessChain 30(fp2D) 12 + 144: 7(ivec2) Load 143 + 145: 57(ptr) AccessChain 10 36 + 146: 7(ivec2) Load 145 + 147: 7(ivec2) IAdd 146 144 + 148: 57(ptr) AccessChain 10 36 + Store 148 147 + 149: 34(ptr) AccessChain 30(fp2D) 36 + 150: 7(ivec2) Load 149 + 151: 57(ptr) AccessChain 10 39 + 152: 7(ivec2) Load 151 + 153: 7(ivec2) IAdd 152 150 + 154: 57(ptr) AccessChain 10 39 + Store 154 153 + 155: 34(ptr) AccessChain 30(fp2D) 39 + 156: 7(ivec2) Load 155 + 157: 57(ptr) AccessChain 10 42 + 158: 7(ivec2) Load 157 + 159: 7(ivec2) IAdd 158 156 + 160: 57(ptr) AccessChain 10 42 + Store 160 159 + 161: 44(ptr) AccessChain 30(fp2D) 42 + 162: 6(int) Load 161 + 163: 53(ptr) AccessChain 10 46 + 164: 6(int) Load 163 + 165: 6(int) IAdd 164 162 + 166: 53(ptr) AccessChain 10 46 + Store 166 165 + 167: 44(ptr) AccessChain 30(fp2D) 46 + 168: 6(int) Load 167 + 169: 53(ptr) AccessChain 10 68 + 170: 6(int) Load 169 + 171: 6(int) IAdd 170 168 + 172: 53(ptr) AccessChain 10 68 + Store 172 171 + 173: 15 Load 17(sample2D) + 174: 19(fvec2) Load 21(P2) + 175: 13(float) Load 125(lodClamp) + 176: 11(int) Load 24(granularity) + 177: 13(float) Load 76(bias) + 179:178(ResType) ImageSampleFootprintNV 173 174 176 27 Bias MinLod 177 175 + 180: 7(ivec2) CompositeExtract 179 1 + 181: 34(ptr) AccessChain 30(fp2D) 12 + Store 181 180 + 182: 7(ivec2) CompositeExtract 179 2 + 183: 34(ptr) AccessChain 30(fp2D) 36 + Store 183 182 + 184: 7(ivec2) CompositeExtract 179 3 + 185: 34(ptr) AccessChain 30(fp2D) 39 + Store 185 184 + 186: 6(int) CompositeExtract 179 4 + 187: 44(ptr) AccessChain 30(fp2D) 42 + Store 187 186 + 188: 6(int) CompositeExtract 179 5 + 189: 44(ptr) AccessChain 30(fp2D) 46 + Store 189 188 + 190: 26(bool) CompositeExtract 179 0 + 191: 6(int) Select 190 50 51 + 192: 53(ptr) AccessChain 10 12 + Store 192 191 + 193: 34(ptr) AccessChain 30(fp2D) 12 + 194: 7(ivec2) Load 193 + 195: 57(ptr) AccessChain 10 36 + 196: 7(ivec2) Load 195 + 197: 7(ivec2) IAdd 196 194 + 198: 57(ptr) AccessChain 10 36 + Store 198 197 + 199: 34(ptr) AccessChain 30(fp2D) 36 + 200: 7(ivec2) Load 199 + 201: 57(ptr) AccessChain 10 39 + 202: 7(ivec2) Load 201 + 203: 7(ivec2) IAdd 202 200 + 204: 57(ptr) AccessChain 10 39 + Store 204 203 + 205: 34(ptr) AccessChain 30(fp2D) 39 + 206: 7(ivec2) Load 205 + 207: 57(ptr) AccessChain 10 42 + 208: 7(ivec2) Load 207 + 209: 7(ivec2) IAdd 208 206 + 210: 57(ptr) AccessChain 10 42 + Store 210 209 + 211: 44(ptr) AccessChain 30(fp2D) 42 + 212: 6(int) Load 211 + 213: 53(ptr) AccessChain 10 46 + 214: 6(int) Load 213 + 215: 6(int) IAdd 214 212 + 216: 53(ptr) AccessChain 10 46 + Store 216 215 + 217: 44(ptr) AccessChain 30(fp2D) 46 + 218: 6(int) Load 217 + 219: 53(ptr) AccessChain 10 68 + 220: 6(int) Load 219 + 221: 6(int) IAdd 220 218 + 222: 53(ptr) AccessChain 10 68 + Store 222 221 + 223: 15 Load 17(sample2D) + 224: 19(fvec2) Load 21(P2) + 226: 13(float) Load 225(lod) + 227: 11(int) Load 24(granularity) + 229:228(ResType) ImageSampleFootprintNV 223 224 227 27 Lod 226 + 230: 7(ivec2) CompositeExtract 229 1 + 231: 34(ptr) AccessChain 30(fp2D) 12 + Store 231 230 + 232: 7(ivec2) CompositeExtract 229 2 + 233: 34(ptr) AccessChain 30(fp2D) 36 + Store 233 232 + 234: 7(ivec2) CompositeExtract 229 3 + 235: 34(ptr) AccessChain 30(fp2D) 39 + Store 235 234 + 236: 6(int) CompositeExtract 229 4 + 237: 44(ptr) AccessChain 30(fp2D) 42 + Store 237 236 + 238: 6(int) CompositeExtract 229 5 + 239: 44(ptr) AccessChain 30(fp2D) 46 + Store 239 238 + 240: 26(bool) CompositeExtract 229 0 + 241: 6(int) Select 240 50 51 + 242: 53(ptr) AccessChain 10 12 + Store 242 241 + 243: 34(ptr) AccessChain 30(fp2D) 12 + 244: 7(ivec2) Load 243 + 245: 57(ptr) AccessChain 10 36 + 246: 7(ivec2) Load 245 + 247: 7(ivec2) IAdd 246 244 + 248: 57(ptr) AccessChain 10 36 + Store 248 247 + 249: 34(ptr) AccessChain 30(fp2D) 36 + 250: 7(ivec2) Load 249 + 251: 57(ptr) AccessChain 10 39 + 252: 7(ivec2) Load 251 + 253: 7(ivec2) IAdd 252 250 + 254: 57(ptr) AccessChain 10 39 + Store 254 253 + 255: 34(ptr) AccessChain 30(fp2D) 39 + 256: 7(ivec2) Load 255 + 257: 57(ptr) AccessChain 10 42 + 258: 7(ivec2) Load 257 + 259: 7(ivec2) IAdd 258 256 + 260: 57(ptr) AccessChain 10 42 + Store 260 259 + 261: 44(ptr) AccessChain 30(fp2D) 42 + 262: 6(int) Load 261 + 263: 53(ptr) AccessChain 10 46 + 264: 6(int) Load 263 + 265: 6(int) IAdd 264 262 + 266: 53(ptr) AccessChain 10 46 + Store 266 265 + 267: 44(ptr) AccessChain 30(fp2D) 46 + 268: 6(int) Load 267 + 269: 53(ptr) AccessChain 10 68 + 270: 6(int) Load 269 + 271: 6(int) IAdd 270 268 + 272: 53(ptr) AccessChain 10 68 + Store 272 271 + 273: 15 Load 17(sample2D) + 274: 19(fvec2) Load 21(P2) + 276: 19(fvec2) Load 275(dx) + 278: 19(fvec2) Load 277(dy) + 279: 11(int) Load 24(granularity) + 281:280(ResType) ImageSampleFootprintNV 273 274 279 27 Grad 276 278 + 282: 7(ivec2) CompositeExtract 281 1 + 283: 34(ptr) AccessChain 30(fp2D) 12 + Store 283 282 + 284: 7(ivec2) CompositeExtract 281 2 + 285: 34(ptr) AccessChain 30(fp2D) 36 + Store 285 284 + 286: 7(ivec2) CompositeExtract 281 3 + 287: 34(ptr) AccessChain 30(fp2D) 39 + Store 287 286 + 288: 6(int) CompositeExtract 281 4 + 289: 44(ptr) AccessChain 30(fp2D) 42 + Store 289 288 + 290: 6(int) CompositeExtract 281 5 + 291: 44(ptr) AccessChain 30(fp2D) 46 + Store 291 290 + 292: 26(bool) CompositeExtract 281 0 + 293: 6(int) Select 292 50 51 + 294: 53(ptr) AccessChain 10 12 + Store 294 293 + 295: 34(ptr) AccessChain 30(fp2D) 12 + 296: 7(ivec2) Load 295 + 297: 57(ptr) AccessChain 10 36 + 298: 7(ivec2) Load 297 + 299: 7(ivec2) IAdd 298 296 + 300: 57(ptr) AccessChain 10 36 + Store 300 299 + 301: 34(ptr) AccessChain 30(fp2D) 36 + 302: 7(ivec2) Load 301 + 303: 57(ptr) AccessChain 10 39 + 304: 7(ivec2) Load 303 + 305: 7(ivec2) IAdd 304 302 + 306: 57(ptr) AccessChain 10 39 + Store 306 305 + 307: 34(ptr) AccessChain 30(fp2D) 39 + 308: 7(ivec2) Load 307 + 309: 57(ptr) AccessChain 10 42 + 310: 7(ivec2) Load 309 + 311: 7(ivec2) IAdd 310 308 + 312: 57(ptr) AccessChain 10 42 + Store 312 311 + 313: 44(ptr) AccessChain 30(fp2D) 42 + 314: 6(int) Load 313 + 315: 53(ptr) AccessChain 10 46 + 316: 6(int) Load 315 + 317: 6(int) IAdd 316 314 + 318: 53(ptr) AccessChain 10 46 + Store 318 317 + 319: 44(ptr) AccessChain 30(fp2D) 46 + 320: 6(int) Load 319 + 321: 53(ptr) AccessChain 10 68 + 322: 6(int) Load 321 + 323: 6(int) IAdd 322 320 + 324: 53(ptr) AccessChain 10 68 + Store 324 323 + 325: 15 Load 17(sample2D) + 326: 19(fvec2) Load 21(P2) + 327: 19(fvec2) Load 275(dx) + 328: 19(fvec2) Load 277(dy) + 329: 13(float) Load 125(lodClamp) + 330: 11(int) Load 24(granularity) + 332:331(ResType) ImageSampleFootprintNV 325 326 330 27 Grad MinLod 327 328 329 + 333: 7(ivec2) CompositeExtract 332 1 + 334: 34(ptr) AccessChain 30(fp2D) 12 + Store 334 333 + 335: 7(ivec2) CompositeExtract 332 2 + 336: 34(ptr) AccessChain 30(fp2D) 36 + Store 336 335 + 337: 7(ivec2) CompositeExtract 332 3 + 338: 34(ptr) AccessChain 30(fp2D) 39 + Store 338 337 + 339: 6(int) CompositeExtract 332 4 + 340: 44(ptr) AccessChain 30(fp2D) 42 + Store 340 339 + 341: 6(int) CompositeExtract 332 5 + 342: 44(ptr) AccessChain 30(fp2D) 46 + Store 342 341 + 343: 26(bool) CompositeExtract 332 0 + 344: 6(int) Select 343 50 51 + 345: 53(ptr) AccessChain 10 12 + Store 345 344 + 346: 34(ptr) AccessChain 30(fp2D) 12 + 347: 7(ivec2) Load 346 + 348: 57(ptr) AccessChain 10 36 + 349: 7(ivec2) Load 348 + 350: 7(ivec2) IAdd 349 347 + 351: 57(ptr) AccessChain 10 36 + Store 351 350 + 352: 34(ptr) AccessChain 30(fp2D) 36 + 353: 7(ivec2) Load 352 + 354: 57(ptr) AccessChain 10 39 + 355: 7(ivec2) Load 354 + 356: 7(ivec2) IAdd 355 353 + 357: 57(ptr) AccessChain 10 39 + Store 357 356 + 358: 34(ptr) AccessChain 30(fp2D) 39 + 359: 7(ivec2) Load 358 + 360: 57(ptr) AccessChain 10 42 + 361: 7(ivec2) Load 360 + 362: 7(ivec2) IAdd 361 359 + 363: 57(ptr) AccessChain 10 42 + Store 363 362 + 364: 44(ptr) AccessChain 30(fp2D) 42 + 365: 6(int) Load 364 + 366: 53(ptr) AccessChain 10 46 + 367: 6(int) Load 366 + 368: 6(int) IAdd 367 365 + 369: 53(ptr) AccessChain 10 46 + Store 369 368 + 370: 44(ptr) AccessChain 30(fp2D) 46 + 371: 6(int) Load 370 + 372: 53(ptr) AccessChain 10 68 + 373: 6(int) Load 372 + 374: 6(int) IAdd 373 371 + 375: 53(ptr) AccessChain 10 68 + Store 375 374 + 384: 381 Load 383(sample3D) + 388: 385(fvec3) Load 387(P3) + 389: 11(int) Load 24(granularity) + 394:393(ResType) ImageSampleFootprintNV 384 388 389 27 + 395: 376(ivec3) CompositeExtract 394 1 + 397: 396(ptr) AccessChain 392(fp3D) 12 + Store 397 395 + 398: 376(ivec3) CompositeExtract 394 2 + 399: 396(ptr) AccessChain 392(fp3D) 36 + Store 399 398 + 400: 7(ivec2) CompositeExtract 394 3 + 401: 34(ptr) AccessChain 392(fp3D) 39 + Store 401 400 + 402: 6(int) CompositeExtract 394 4 + 403: 44(ptr) AccessChain 392(fp3D) 42 + Store 403 402 + 404: 6(int) CompositeExtract 394 5 + 405: 44(ptr) AccessChain 392(fp3D) 46 + Store 405 404 + 406: 26(bool) CompositeExtract 394 0 + 407: 6(int) Select 406 50 51 + 408: 53(ptr) AccessChain 379 12 + Store 408 407 + 409: 396(ptr) AccessChain 392(fp3D) 12 + 410: 376(ivec3) Load 409 + 412: 411(ptr) AccessChain 379 36 + Store 412 410 + 413: 396(ptr) AccessChain 392(fp3D) 36 + 414: 376(ivec3) Load 413 + 415: 411(ptr) AccessChain 379 39 + Store 415 414 + 416: 34(ptr) AccessChain 392(fp3D) 39 + 417: 7(ivec2) Load 416 + 418: 57(ptr) AccessChain 379 42 + Store 418 417 + 419: 44(ptr) AccessChain 392(fp3D) 42 + 420: 6(int) Load 419 + 421: 53(ptr) AccessChain 379 46 + Store 421 420 + 422: 44(ptr) AccessChain 392(fp3D) 46 + 423: 6(int) Load 422 + 424: 53(ptr) AccessChain 379 68 + Store 424 423 + 425: 381 Load 383(sample3D) + 426: 385(fvec3) Load 387(P3) + 427: 11(int) Load 24(granularity) + 428: 13(float) Load 76(bias) + 430:429(ResType) ImageSampleFootprintNV 425 426 427 27 Bias 428 + 431: 376(ivec3) CompositeExtract 430 1 + 432: 396(ptr) AccessChain 392(fp3D) 12 + Store 432 431 + 433: 376(ivec3) CompositeExtract 430 2 + 434: 396(ptr) AccessChain 392(fp3D) 36 + Store 434 433 + 435: 7(ivec2) CompositeExtract 430 3 + 436: 34(ptr) AccessChain 392(fp3D) 39 + Store 436 435 + 437: 6(int) CompositeExtract 430 4 + 438: 44(ptr) AccessChain 392(fp3D) 42 + Store 438 437 + 439: 6(int) CompositeExtract 430 5 + 440: 44(ptr) AccessChain 392(fp3D) 46 + Store 440 439 + 441: 26(bool) CompositeExtract 430 0 + 442: 6(int) Select 441 50 51 + 443: 53(ptr) AccessChain 379 12 + Store 443 442 + 444: 396(ptr) AccessChain 392(fp3D) 12 + 445: 376(ivec3) Load 444 + 446: 411(ptr) AccessChain 379 36 + 447: 376(ivec3) Load 446 + 448: 376(ivec3) IAdd 447 445 + 449: 411(ptr) AccessChain 379 36 + Store 449 448 + 450: 396(ptr) AccessChain 392(fp3D) 36 + 451: 376(ivec3) Load 450 + 452: 411(ptr) AccessChain 379 39 + 453: 376(ivec3) Load 452 + 454: 376(ivec3) IAdd 453 451 + 455: 411(ptr) AccessChain 379 39 + Store 455 454 + 456: 34(ptr) AccessChain 392(fp3D) 39 + 457: 7(ivec2) Load 456 + 458: 57(ptr) AccessChain 379 42 + 459: 7(ivec2) Load 458 + 460: 7(ivec2) IAdd 459 457 + 461: 57(ptr) AccessChain 379 42 + Store 461 460 + 462: 44(ptr) AccessChain 392(fp3D) 42 + 463: 6(int) Load 462 + 464: 53(ptr) AccessChain 379 46 + 465: 6(int) Load 464 + 466: 6(int) IAdd 465 463 + 467: 53(ptr) AccessChain 379 46 + Store 467 466 + 468: 44(ptr) AccessChain 392(fp3D) 46 + 469: 6(int) Load 468 + 470: 53(ptr) AccessChain 379 68 + 471: 6(int) Load 470 + 472: 6(int) IAdd 471 469 + 473: 53(ptr) AccessChain 379 68 + Store 473 472 + 474: 381 Load 383(sample3D) + 475: 385(fvec3) Load 387(P3) + 476: 13(float) Load 125(lodClamp) + 477: 11(int) Load 24(granularity) + 479:478(ResType) ImageSampleFootprintNV 474 475 477 27 MinLod 476 + 480: 376(ivec3) CompositeExtract 479 1 + 481: 396(ptr) AccessChain 392(fp3D) 12 + Store 481 480 + 482: 376(ivec3) CompositeExtract 479 2 + 483: 396(ptr) AccessChain 392(fp3D) 36 + Store 483 482 + 484: 7(ivec2) CompositeExtract 479 3 + 485: 34(ptr) AccessChain 392(fp3D) 39 + Store 485 484 + 486: 6(int) CompositeExtract 479 4 + 487: 44(ptr) AccessChain 392(fp3D) 42 + Store 487 486 + 488: 6(int) CompositeExtract 479 5 + 489: 44(ptr) AccessChain 392(fp3D) 46 + Store 489 488 + 490: 26(bool) CompositeExtract 479 0 + 491: 6(int) Select 490 50 51 + 492: 53(ptr) AccessChain 379 12 + Store 492 491 + 493: 396(ptr) AccessChain 392(fp3D) 12 + 494: 376(ivec3) Load 493 + 495: 411(ptr) AccessChain 379 36 + 496: 376(ivec3) Load 495 + 497: 376(ivec3) IAdd 496 494 + 498: 411(ptr) AccessChain 379 36 + Store 498 497 + 499: 396(ptr) AccessChain 392(fp3D) 36 + 500: 376(ivec3) Load 499 + 501: 411(ptr) AccessChain 379 39 + 502: 376(ivec3) Load 501 + 503: 376(ivec3) IAdd 502 500 + 504: 411(ptr) AccessChain 379 39 + Store 504 503 + 505: 34(ptr) AccessChain 392(fp3D) 39 + 506: 7(ivec2) Load 505 + 507: 57(ptr) AccessChain 379 42 + 508: 7(ivec2) Load 507 + 509: 7(ivec2) IAdd 508 506 + 510: 57(ptr) AccessChain 379 42 + Store 510 509 + 511: 44(ptr) AccessChain 392(fp3D) 42 + 512: 6(int) Load 511 + 513: 53(ptr) AccessChain 379 46 + 514: 6(int) Load 513 + 515: 6(int) IAdd 514 512 + 516: 53(ptr) AccessChain 379 46 + Store 516 515 + 517: 44(ptr) AccessChain 392(fp3D) 46 + 518: 6(int) Load 517 + 519: 53(ptr) AccessChain 379 68 + 520: 6(int) Load 519 + 521: 6(int) IAdd 520 518 + 522: 53(ptr) AccessChain 379 68 + Store 522 521 + 523: 381 Load 383(sample3D) + 524: 385(fvec3) Load 387(P3) + 525: 13(float) Load 125(lodClamp) + 526: 11(int) Load 24(granularity) + 527: 13(float) Load 76(bias) + 529:528(ResType) ImageSampleFootprintNV 523 524 526 27 Bias MinLod 527 525 + 530: 376(ivec3) CompositeExtract 529 1 + 531: 396(ptr) AccessChain 392(fp3D) 12 + Store 531 530 + 532: 376(ivec3) CompositeExtract 529 2 + 533: 396(ptr) AccessChain 392(fp3D) 36 + Store 533 532 + 534: 7(ivec2) CompositeExtract 529 3 + 535: 34(ptr) AccessChain 392(fp3D) 39 + Store 535 534 + 536: 6(int) CompositeExtract 529 4 + 537: 44(ptr) AccessChain 392(fp3D) 42 + Store 537 536 + 538: 6(int) CompositeExtract 529 5 + 539: 44(ptr) AccessChain 392(fp3D) 46 + Store 539 538 + 540: 26(bool) CompositeExtract 529 0 + 541: 6(int) Select 540 50 51 + 542: 53(ptr) AccessChain 379 12 + Store 542 541 + 543: 396(ptr) AccessChain 392(fp3D) 12 + 544: 376(ivec3) Load 543 + 545: 411(ptr) AccessChain 379 36 + 546: 376(ivec3) Load 545 + 547: 376(ivec3) IAdd 546 544 + 548: 411(ptr) AccessChain 379 36 + Store 548 547 + 549: 396(ptr) AccessChain 392(fp3D) 36 + 550: 376(ivec3) Load 549 + 551: 411(ptr) AccessChain 379 39 + 552: 376(ivec3) Load 551 + 553: 376(ivec3) IAdd 552 550 + 554: 411(ptr) AccessChain 379 39 + Store 554 553 + 555: 34(ptr) AccessChain 392(fp3D) 39 + 556: 7(ivec2) Load 555 + 557: 57(ptr) AccessChain 379 42 + 558: 7(ivec2) Load 557 + 559: 7(ivec2) IAdd 558 556 + 560: 57(ptr) AccessChain 379 42 + Store 560 559 + 561: 44(ptr) AccessChain 392(fp3D) 42 + 562: 6(int) Load 561 + 563: 53(ptr) AccessChain 379 46 + 564: 6(int) Load 563 + 565: 6(int) IAdd 564 562 + 566: 53(ptr) AccessChain 379 46 + Store 566 565 + 567: 44(ptr) AccessChain 392(fp3D) 46 + 568: 6(int) Load 567 + 569: 53(ptr) AccessChain 379 68 + 570: 6(int) Load 569 + 571: 6(int) IAdd 570 568 + 572: 53(ptr) AccessChain 379 68 + Store 572 571 + 573: 381 Load 383(sample3D) + 574: 385(fvec3) Load 387(P3) + 575: 13(float) Load 225(lod) + 576: 11(int) Load 24(granularity) + 578:577(ResType) ImageSampleFootprintNV 573 574 576 27 Lod 575 + 579: 376(ivec3) CompositeExtract 578 1 + 580: 396(ptr) AccessChain 392(fp3D) 12 + Store 580 579 + 581: 376(ivec3) CompositeExtract 578 2 + 582: 396(ptr) AccessChain 392(fp3D) 36 + Store 582 581 + 583: 7(ivec2) CompositeExtract 578 3 + 584: 34(ptr) AccessChain 392(fp3D) 39 + Store 584 583 + 585: 6(int) CompositeExtract 578 4 + 586: 44(ptr) AccessChain 392(fp3D) 42 + Store 586 585 + 587: 6(int) CompositeExtract 578 5 + 588: 44(ptr) AccessChain 392(fp3D) 46 + Store 588 587 + 589: 26(bool) CompositeExtract 578 0 + 590: 6(int) Select 589 50 51 + 591: 53(ptr) AccessChain 379 12 + Store 591 590 + 592: 396(ptr) AccessChain 392(fp3D) 12 + 593: 376(ivec3) Load 592 + 594: 411(ptr) AccessChain 379 36 + 595: 376(ivec3) Load 594 + 596: 376(ivec3) IAdd 595 593 + 597: 411(ptr) AccessChain 379 36 + Store 597 596 + 598: 396(ptr) AccessChain 392(fp3D) 36 + 599: 376(ivec3) Load 598 + 600: 411(ptr) AccessChain 379 39 + 601: 376(ivec3) Load 600 + 602: 376(ivec3) IAdd 601 599 + 603: 411(ptr) AccessChain 379 39 + Store 603 602 + 604: 34(ptr) AccessChain 392(fp3D) 39 + 605: 7(ivec2) Load 604 + 606: 57(ptr) AccessChain 379 42 + 607: 7(ivec2) Load 606 + 608: 7(ivec2) IAdd 607 605 + 609: 57(ptr) AccessChain 379 42 + Store 609 608 + 610: 44(ptr) AccessChain 392(fp3D) 42 + 611: 6(int) Load 610 + 612: 53(ptr) AccessChain 379 46 + 613: 6(int) Load 612 + 614: 6(int) IAdd 613 611 + 615: 53(ptr) AccessChain 379 46 + Store 615 614 + 616: 44(ptr) AccessChain 392(fp3D) 46 + 617: 6(int) Load 616 + 618: 53(ptr) AccessChain 379 68 + 619: 6(int) Load 618 + 620: 6(int) IAdd 619 617 + 621: 53(ptr) AccessChain 379 68 + Store 621 620 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.shaderStencilExport.frag.out b/deps/glslang/Test/baseResults/spv.shaderStencilExport.frag.out new file mode 100644 index 00000000..8fc691ee --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.shaderStencilExport.frag.out @@ -0,0 +1,28 @@ +spv.shaderStencilExport.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 10 + + Capability Shader + Capability StencilExportEXT + Extension "SPV_EXT_shader_stencil_export" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 8 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_ARB_shader_stencil_export" + Name 4 "main" + Name 8 "gl_FragStencilRefARB" + Decorate 8(gl_FragStencilRefARB) BuiltIn FragStencilRefEXT + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Output 6(int) +8(gl_FragStencilRefARB): 7(ptr) Variable Output + 9: 6(int) Constant 100 + 4(main): 2 Function None 3 + 5: Label + Store 8(gl_FragStencilRefARB) 9 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.shadingRate.frag.out b/deps/glslang/Test/baseResults/spv.shadingRate.frag.out new file mode 100644 index 00000000..2b6bd31d --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.shadingRate.frag.out @@ -0,0 +1,48 @@ +spv.shadingRate.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 21 + + Capability Shader + Capability ShadingRateNV + Extension "SPV_NV_shading_rate" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 13 17 19 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_NV_shading_rate_image" + Name 4 "main" + Name 9 "FragmentSize" + Name 13 "gl_FragmentSizeNV" + Name 17 "InvocationsPerPixel" + Name 19 "gl_InvocationsPerPixelNV" + Decorate 9(FragmentSize) Location 0 + Decorate 13(gl_FragmentSizeNV) Flat + Decorate 13(gl_FragmentSizeNV) BuiltIn FragmentSizeNV + Decorate 17(InvocationsPerPixel) Location 2 + Decorate 19(gl_InvocationsPerPixelNV) Flat + Decorate 19(gl_InvocationsPerPixelNV) BuiltIn InvocationsPerPixelNV + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypePointer Output 7(fvec2) + 9(FragmentSize): 8(ptr) Variable Output + 10: TypeInt 32 1 + 11: TypeVector 10(int) 2 + 12: TypePointer Input 11(ivec2) +13(gl_FragmentSizeNV): 12(ptr) Variable Input + 16: TypePointer Output 10(int) +17(InvocationsPerPixel): 16(ptr) Variable Output + 18: TypePointer Input 10(int) +19(gl_InvocationsPerPixelNV): 18(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 14: 11(ivec2) Load 13(gl_FragmentSizeNV) + 15: 7(fvec2) ConvertSToF 14 + Store 9(FragmentSize) 15 + 20: 10(int) Load 19(gl_InvocationsPerPixelNV) + Store 17(InvocationsPerPixel) 20 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.shiftOps.frag.out b/deps/glslang/Test/baseResults/spv.shiftOps.frag.out new file mode 100644 index 00000000..3085a55d --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.shiftOps.frag.out @@ -0,0 +1,64 @@ +spv.shiftOps.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 38 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 11 15 25 27 30 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "icolor" + Name 11 "i3" + Name 15 "u1" + Name 25 "ucolor" + Name 27 "u3" + Name 30 "i1" + Decorate 11(i3) Flat + Decorate 15(u1) Flat + Decorate 27(u3) Flat + Decorate 30(i1) Flat + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeVector 6(int) 3 + 8: TypePointer Output 7(ivec3) + 9(icolor): 8(ptr) Variable Output + 10: TypePointer Input 7(ivec3) + 11(i3): 10(ptr) Variable Input + 13: TypeInt 32 0 + 14: TypePointer Input 13(int) + 15(u1): 14(ptr) Variable Input + 17: TypeVector 13(int) 3 + 20: 13(int) Constant 4 + 24: TypePointer Output 17(ivec3) + 25(ucolor): 24(ptr) Variable Output + 26: TypePointer Input 17(ivec3) + 27(u3): 26(ptr) Variable Input + 29: TypePointer Input 6(int) + 30(i1): 29(ptr) Variable Input + 34: 6(int) Constant 5 + 4(main): 2 Function None 3 + 5: Label + 12: 7(ivec3) Load 11(i3) + 16: 13(int) Load 15(u1) + 18: 17(ivec3) CompositeConstruct 16 16 16 + 19: 7(ivec3) ShiftLeftLogical 12 18 + Store 9(icolor) 19 + 21: 7(ivec3) Load 9(icolor) + 22: 17(ivec3) CompositeConstruct 20 20 20 + 23: 7(ivec3) ShiftLeftLogical 21 22 + Store 9(icolor) 23 + 28: 17(ivec3) Load 27(u3) + 31: 6(int) Load 30(i1) + 32: 7(ivec3) CompositeConstruct 31 31 31 + 33: 17(ivec3) ShiftRightLogical 28 32 + Store 25(ucolor) 33 + 35: 17(ivec3) Load 25(ucolor) + 36: 7(ivec3) CompositeConstruct 34 34 34 + 37: 17(ivec3) ShiftRightLogical 35 36 + Store 25(ucolor) 37 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.shortCircuit.frag.out b/deps/glslang/Test/baseResults/spv.shortCircuit.frag.out new file mode 100644 index 00000000..d6518245 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.shortCircuit.frag.out @@ -0,0 +1,235 @@ +spv.shortCircuit.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 147 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 12 24 34 113 140 142 + ExecutionMode 4 OriginUpperLeft + Source GLSL 400 + Name 4 "main" + Name 8 "foo(" + Name 12 "of1" + Name 24 "of4" + Name 27 "ub" + Name 34 "ui" + Name 44 "uba" + Name 113 "uf" + Name 140 "uiv4" + Name 142 "uv4" + Name 145 "ub41" + Name 146 "ub42" + Decorate 34(ui) Flat + Decorate 140(uiv4) Flat + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeBool + 7: TypeFunction 6(bool) + 10: TypeFloat 32 + 11: TypePointer Output 10(float) + 12(of1): 11(ptr) Variable Output + 14: 10(float) Constant 1065353216 + 17: 10(float) Constant 1092616192 + 21: 10(float) Constant 0 + 22: TypeVector 10(float) 4 + 23: TypePointer Output 22(fvec4) + 24(of4): 23(ptr) Variable Output + 25: 22(fvec4) ConstantComposite 21 21 21 21 + 26: TypePointer Private 6(bool) + 27(ub): 26(ptr) Variable Private + 32: TypeInt 32 1 + 33: TypePointer Input 32(int) + 34(ui): 33(ptr) Variable Input + 36: 32(int) Constant 2 + 44(uba): 26(ptr) Variable Private + 112: TypePointer Input 10(float) + 113(uf): 112(ptr) Variable Input + 116: 10(float) Constant 1082130432 + 138: TypeVector 32(int) 4 + 139: TypePointer Input 138(ivec4) + 140(uiv4): 139(ptr) Variable Input + 141: TypePointer Input 22(fvec4) + 142(uv4): 141(ptr) Variable Input + 143: TypeVector 6(bool) 4 + 144: TypePointer Private 143(bvec4) + 145(ub41): 144(ptr) Variable Private + 146(ub42): 144(ptr) Variable Private + 4(main): 2 Function None 3 + 5: Label + Store 12(of1) 21 + Store 24(of4) 25 + 28: 6(bool) Load 27(ub) + 29: 6(bool) LogicalNot 28 + SelectionMerge 31 None + BranchConditional 29 30 31 + 30: Label + 35: 32(int) Load 34(ui) + 37: 6(bool) SGreaterThan 35 36 + Branch 31 + 31: Label + 38: 6(bool) Phi 28 5 37 30 + SelectionMerge 40 None + BranchConditional 38 39 40 + 39: Label + 41: 10(float) Load 12(of1) + 42: 10(float) FAdd 41 14 + Store 12(of1) 42 + Branch 40 + 40: Label + 43: 6(bool) Load 27(ub) + 45: 6(bool) Load 44(uba) + 46: 6(bool) LogicalNot 45 + 47: 6(bool) LogicalAnd 43 46 + SelectionMerge 49 None + BranchConditional 47 48 49 + 48: Label + 50: 10(float) Load 12(of1) + 51: 10(float) FAdd 50 14 + Store 12(of1) 51 + Branch 49 + 49: Label + 52: 6(bool) Load 27(ub) + 53: 6(bool) LogicalNot 52 + SelectionMerge 55 None + BranchConditional 53 54 55 + 54: Label + 56: 6(bool) FunctionCall 8(foo() + Branch 55 + 55: Label + 57: 6(bool) Phi 52 49 56 54 + SelectionMerge 59 None + BranchConditional 57 58 59 + 58: Label + 60: 10(float) Load 12(of1) + 61: 10(float) FAdd 60 14 + Store 12(of1) 61 + Branch 59 + 59: Label + 62: 6(bool) Load 27(ub) + SelectionMerge 64 None + BranchConditional 62 63 64 + 63: Label + 65: 6(bool) FunctionCall 8(foo() + Branch 64 + 64: Label + 66: 6(bool) Phi 62 59 65 63 + SelectionMerge 68 None + BranchConditional 66 67 68 + 67: Label + 69: 10(float) Load 12(of1) + 70: 10(float) FAdd 69 14 + Store 12(of1) 70 + Branch 68 + 68: Label + 71: 6(bool) FunctionCall 8(foo() + 72: 6(bool) Load 27(ub) + 73: 6(bool) LogicalOr 71 72 + SelectionMerge 75 None + BranchConditional 73 74 75 + 74: Label + 76: 10(float) Load 12(of1) + 77: 10(float) FAdd 76 14 + Store 12(of1) 77 + Branch 75 + 75: Label + 78: 6(bool) FunctionCall 8(foo() + 79: 6(bool) Load 27(ub) + 80: 6(bool) LogicalAnd 78 79 + SelectionMerge 82 None + BranchConditional 80 81 82 + 81: Label + 83: 10(float) Load 12(of1) + 84: 10(float) FAdd 83 14 + Store 12(of1) 84 + Branch 82 + 82: Label + 85: 6(bool) Load 27(ub) + 86: 6(bool) LogicalNot 85 + SelectionMerge 88 None + BranchConditional 86 87 88 + 87: Label + 89: 10(float) Load 12(of1) + 90: 10(float) FAdd 89 14 + Store 12(of1) 90 + 91: 6(bool) FOrdGreaterThan 90 14 + Branch 88 + 88: Label + 92: 6(bool) Phi 85 82 91 87 + SelectionMerge 94 None + BranchConditional 92 93 94 + 93: Label + 95: 22(fvec4) Load 24(of4) + 96: 22(fvec4) CompositeConstruct 14 14 14 14 + 97: 22(fvec4) FAdd 95 96 + Store 24(of4) 97 + Branch 94 + 94: Label + 98: 10(float) Load 12(of1) + 99: 10(float) FAdd 98 14 + Store 12(of1) 99 + 100: 6(bool) FOrdGreaterThan 99 14 + 101: 6(bool) Load 27(ub) + 102: 6(bool) LogicalOr 100 101 + SelectionMerge 104 None + BranchConditional 102 103 104 + 103: Label + 105: 22(fvec4) Load 24(of4) + 106: 22(fvec4) CompositeConstruct 14 14 14 14 + 107: 22(fvec4) FAdd 105 106 + Store 24(of4) 107 + Branch 104 + 104: Label + 108: 6(bool) Load 27(ub) + 109: 6(bool) LogicalNot 108 + SelectionMerge 111 None + BranchConditional 109 110 111 + 110: Label + 114: 10(float) Load 113(uf) + 115: 10(float) ExtInst 1(GLSL.std.450) 13(Sin) 114 + 117: 10(float) FMul 115 116 + 118: 10(float) Load 12(of1) + 119: 6(bool) FOrdGreaterThan 117 118 + Branch 111 + 111: Label + 120: 6(bool) Phi 108 104 119 110 + SelectionMerge 122 None + BranchConditional 120 121 122 + 121: Label + 123: 10(float) Load 12(of1) + 124: 10(float) FAdd 123 14 + Store 12(of1) 124 + Branch 122 + 122: Label + 125: 6(bool) Load 27(ub) + SelectionMerge 127 None + BranchConditional 125 126 127 + 126: Label + 128: 10(float) Load 113(uf) + 129: 10(float) ExtInst 1(GLSL.std.450) 13(Sin) 128 + 130: 10(float) FMul 129 116 + 131: 10(float) Load 12(of1) + 132: 6(bool) FOrdGreaterThan 130 131 + Branch 127 + 127: Label + 133: 6(bool) Phi 125 122 132 126 + SelectionMerge 135 None + BranchConditional 133 134 135 + 134: Label + 136: 10(float) Load 12(of1) + 137: 10(float) FAdd 136 14 + Store 12(of1) 137 + Branch 135 + 135: Label + Return + FunctionEnd + 8(foo(): 6(bool) Function None 7 + 9: Label + 13: 10(float) Load 12(of1) + 15: 10(float) FAdd 13 14 + Store 12(of1) 15 + 16: 10(float) Load 12(of1) + 18: 6(bool) FOrdGreaterThan 16 17 + ReturnValue 18 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.simpleFunctionCall.frag.out b/deps/glslang/Test/baseResults/spv.simpleFunctionCall.frag.out new file mode 100644 index 00000000..627b31c1 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.simpleFunctionCall.frag.out @@ -0,0 +1,36 @@ +spv.simpleFunctionCall.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 19 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 12 17 + ExecutionMode 4 OriginUpperLeft + Source GLSL 150 + Name 4 "main" + Name 9 "foo(" + Name 12 "BaseColor" + Name 17 "gl_FragColor" + Decorate 17(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypePointer Input 7(fvec4) + 12(BaseColor): 11(ptr) Variable Input + 16: TypePointer Output 7(fvec4) +17(gl_FragColor): 16(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 18: 7(fvec4) FunctionCall 9(foo() + Store 17(gl_FragColor) 18 + Return + FunctionEnd + 9(foo(): 7(fvec4) Function None 8 + 10: Label + 13: 7(fvec4) Load 12(BaseColor) + ReturnValue 13 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.simpleMat.vert.out b/deps/glslang/Test/baseResults/spv.simpleMat.vert.out new file mode 100644 index 00000000..85574585 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.simpleMat.vert.out @@ -0,0 +1,60 @@ +spv.simpleMat.vert +WARNING: 0:3: varying deprecated in version 130; may be removed in future release + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 39 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 9 12 15 19 23 34 + Source GLSL 330 + Name 4 "main" + Name 9 "glPos" + Name 12 "mvp" + Name 15 "v" + Name 19 "f" + Name 23 "am3" + Name 34 "arraym" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(glPos): 8(ptr) Variable Output + 10: TypeMatrix 7(fvec4) 4 + 11: TypePointer Output 10 + 12(mvp): 11(ptr) Variable Output + 14: TypePointer Input 7(fvec4) + 15(v): 14(ptr) Variable Input + 18: TypePointer Output 6(float) + 19(f): 18(ptr) Variable Output + 20: TypeVector 6(float) 3 + 21: TypeMatrix 20(fvec3) 3 + 22: TypePointer Input 21 + 23(am3): 22(ptr) Variable Input + 24: TypeInt 32 1 + 25: 24(int) Constant 2 + 26: TypeInt 32 0 + 27: 26(int) Constant 1 + 28: TypePointer Input 6(float) + 31: 26(int) Constant 3 + 32: TypeArray 10 31 + 33: TypePointer Input 32 + 34(arraym): 33(ptr) Variable Input + 35: 24(int) Constant 1 + 4(main): 2 Function None 3 + 5: Label + 13: 10 Load 12(mvp) + 16: 7(fvec4) Load 15(v) + 17: 7(fvec4) MatrixTimesVector 13 16 + Store 9(glPos) 17 + 29: 28(ptr) AccessChain 23(am3) 25 27 + 30: 6(float) Load 29 + 36: 28(ptr) AccessChain 34(arraym) 35 25 31 + 37: 6(float) Load 36 + 38: 6(float) FAdd 30 37 + Store 19(f) 38 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.sparseTexture.frag.out b/deps/glslang/Test/baseResults/spv.sparseTexture.frag.out new file mode 100644 index 00000000..78a2c2e7 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.sparseTexture.frag.out @@ -0,0 +1,593 @@ +spv.sparseTexture.frag +error: SPIRV-Tools Validation Errors +error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension) + OpCapability SampledRect + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 438 + + Capability Shader + Capability ImageGatherExtended + Capability StorageImageMultisample + Capability SampledRect + Capability SparseResidency + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 33 48 89 365 393 405 423 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_ARB_sparse_texture2" + Name 4 "main" + Name 8 "resident" + Name 13 "texel" + Name 18 "itexel" + Name 23 "utexel" + Name 29 "s2D" + Name 33 "c2" + Name 35 "ResType" + Name 44 "s3D" + Name 48 "c3" + Name 59 "isCube" + Name 62 "ResType" + Name 71 "s2DShadow" + Name 77 "ResType" + Name 86 "sCubeArrayShadow" + Name 89 "c4" + Name 108 "usCubeArray" + Name 111 "ResType" + Name 140 "us2DRect" + Name 154 "s2DArrayShadow" + Name 188 "s2DMS" + Name 228 "is2DArray" + Name 261 "sCubeShadow" + Name 294 "s2DRectShadow" + Name 365 "offsets" + Name 390 "i2D" + Name 393 "ic2" + Name 402 "ii3D" + Name 405 "ic3" + Name 414 "i2DMS" + Name 423 "outColor" + Decorate 29(s2D) DescriptorSet 0 + Decorate 44(s3D) DescriptorSet 0 + Decorate 59(isCube) DescriptorSet 0 + Decorate 71(s2DShadow) DescriptorSet 0 + Decorate 86(sCubeArrayShadow) DescriptorSet 0 + Decorate 108(usCubeArray) DescriptorSet 0 + Decorate 140(us2DRect) DescriptorSet 0 + Decorate 154(s2DArrayShadow) DescriptorSet 0 + Decorate 188(s2DMS) DescriptorSet 0 + Decorate 228(is2DArray) DescriptorSet 0 + Decorate 261(sCubeShadow) DescriptorSet 0 + Decorate 294(s2DRectShadow) DescriptorSet 0 + Decorate 365(offsets) Flat + Decorate 390(i2D) DescriptorSet 0 + Decorate 393(ic2) Flat + Decorate 402(ii3D) DescriptorSet 0 + Decorate 405(ic3) Flat + Decorate 414(i2DMS) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 10: TypeFloat 32 + 11: TypeVector 10(float) 4 + 12: TypePointer Function 11(fvec4) + 14: 10(float) Constant 0 + 15: 11(fvec4) ConstantComposite 14 14 14 14 + 16: TypeVector 6(int) 4 + 17: TypePointer Function 16(ivec4) + 19: 16(ivec4) ConstantComposite 9 9 9 9 + 20: TypeInt 32 0 + 21: TypeVector 20(int) 4 + 22: TypePointer Function 21(ivec4) + 24: 20(int) Constant 0 + 25: 21(ivec4) ConstantComposite 24 24 24 24 + 26: TypeImage 10(float) 2D sampled format:Unknown + 27: TypeSampledImage 26 + 28: TypePointer UniformConstant 27 + 29(s2D): 28(ptr) Variable UniformConstant + 31: TypeVector 10(float) 2 + 32: TypePointer Input 31(fvec2) + 33(c2): 32(ptr) Variable Input + 35(ResType): TypeStruct 6(int) 11(fvec4) + 41: TypeImage 10(float) 3D sampled format:Unknown + 42: TypeSampledImage 41 + 43: TypePointer UniformConstant 42 + 44(s3D): 43(ptr) Variable UniformConstant + 46: TypeVector 10(float) 3 + 47: TypePointer Input 46(fvec3) + 48(c3): 47(ptr) Variable Input + 50: 10(float) Constant 1073741824 + 56: TypeImage 6(int) Cube sampled format:Unknown + 57: TypeSampledImage 56 + 58: TypePointer UniformConstant 57 + 59(isCube): 58(ptr) Variable UniformConstant + 62(ResType): TypeStruct 6(int) 16(ivec4) + 68: TypeImage 10(float) 2D depth sampled format:Unknown + 69: TypeSampledImage 68 + 70: TypePointer UniformConstant 69 + 71(s2DShadow): 70(ptr) Variable UniformConstant + 74: TypePointer Function 10(float) + 77(ResType): TypeStruct 6(int) 10(float) + 83: TypeImage 10(float) Cube depth array sampled format:Unknown + 84: TypeSampledImage 83 + 85: TypePointer UniformConstant 84 +86(sCubeArrayShadow): 85(ptr) Variable UniformConstant + 88: TypePointer Input 11(fvec4) + 89(c4): 88(ptr) Variable Input + 91: 10(float) Constant 1065353216 + 105: TypeImage 20(int) Cube array sampled format:Unknown + 106: TypeSampledImage 105 + 107: TypePointer UniformConstant 106 +108(usCubeArray): 107(ptr) Variable UniformConstant + 111(ResType): TypeStruct 6(int) 21(ivec4) + 119: 20(int) Constant 1 + 129: TypeVector 6(int) 3 + 130: 6(int) Constant 2 + 131: 129(ivec3) ConstantComposite 130 130 130 + 137: TypeImage 20(int) Rect sampled format:Unknown + 138: TypeSampledImage 137 + 139: TypePointer UniformConstant 138 + 140(us2DRect): 139(ptr) Variable UniformConstant + 143: TypeVector 6(int) 2 + 144: 6(int) Constant 3 + 145: 143(ivec2) ConstantComposite 144 144 + 151: TypeImage 10(float) 2D depth array sampled format:Unknown + 152: TypeSampledImage 151 + 153: TypePointer UniformConstant 152 +154(s2DArrayShadow): 153(ptr) Variable UniformConstant + 157: 6(int) Constant 5 + 158: 143(ivec2) ConstantComposite 157 157 + 159: 20(int) Constant 2 + 185: TypeImage 10(float) 2D multi-sampled sampled format:Unknown + 186: TypeSampledImage 185 + 187: TypePointer UniformConstant 186 + 188(s2DMS): 187(ptr) Variable UniformConstant + 192: 6(int) Constant 4 + 202: 129(ivec3) ConstantComposite 192 192 192 + 225: TypeImage 6(int) 2D array sampled format:Unknown + 226: TypeSampledImage 225 + 227: TypePointer UniformConstant 226 + 228(is2DArray): 227(ptr) Variable UniformConstant + 231: 6(int) Constant 6 + 232: 143(ivec2) ConstantComposite 231 231 + 240: 6(int) Constant 7 + 241: 143(ivec2) ConstantComposite 240 240 + 258: TypeImage 10(float) Cube depth sampled format:Unknown + 259: TypeSampledImage 258 + 260: TypePointer UniformConstant 259 +261(sCubeShadow): 260(ptr) Variable UniformConstant + 291: TypeImage 10(float) Rect depth sampled format:Unknown + 292: TypeSampledImage 291 + 293: TypePointer UniformConstant 292 +294(s2DRectShadow): 293(ptr) Variable UniformConstant + 299: 20(int) Constant 3 + 311: 143(ivec2) ConstantComposite 130 130 + 340: 143(ivec2) ConstantComposite 192 192 + 362: 20(int) Constant 4 + 363: TypeArray 143(ivec2) 362 + 364: TypePointer Input 363 + 365(offsets): 364(ptr) Variable Input + 388: TypeImage 10(float) 2D nonsampled format:Rgba32f + 389: TypePointer UniformConstant 388 + 390(i2D): 389(ptr) Variable UniformConstant + 392: TypePointer Input 143(ivec2) + 393(ic2): 392(ptr) Variable Input + 400: TypeImage 6(int) 3D nonsampled format:Rgba32i + 401: TypePointer UniformConstant 400 + 402(ii3D): 401(ptr) Variable UniformConstant + 404: TypePointer Input 129(ivec3) + 405(ic3): 404(ptr) Variable Input + 412: TypeImage 10(float) 2D multi-sampled nonsampled format:Rgba32f + 413: TypePointer UniformConstant 412 + 414(i2DMS): 413(ptr) Variable UniformConstant + 422: TypePointer Output 11(fvec4) + 423(outColor): 422(ptr) Variable Output + 425: TypeBool + 4(main): 2 Function None 3 + 5: Label + 8(resident): 7(ptr) Variable Function + 13(texel): 12(ptr) Variable Function + 18(itexel): 17(ptr) Variable Function + 23(utexel): 22(ptr) Variable Function + 427: 12(ptr) Variable Function + Store 8(resident) 9 + Store 13(texel) 15 + Store 18(itexel) 19 + Store 23(utexel) 25 + 30: 27 Load 29(s2D) + 34: 31(fvec2) Load 33(c2) + 36: 35(ResType) ImageSparseSampleImplicitLod 30 34 + 37: 11(fvec4) CompositeExtract 36 1 + Store 13(texel) 37 + 38: 6(int) CompositeExtract 36 0 + 39: 6(int) Load 8(resident) + 40: 6(int) BitwiseOr 39 38 + Store 8(resident) 40 + 45: 42 Load 44(s3D) + 49: 46(fvec3) Load 48(c3) + 51: 35(ResType) ImageSparseSampleImplicitLod 45 49 Bias 50 + 52: 11(fvec4) CompositeExtract 51 1 + Store 13(texel) 52 + 53: 6(int) CompositeExtract 51 0 + 54: 6(int) Load 8(resident) + 55: 6(int) BitwiseOr 54 53 + Store 8(resident) 55 + 60: 57 Load 59(isCube) + 61: 46(fvec3) Load 48(c3) + 63: 62(ResType) ImageSparseSampleImplicitLod 60 61 + 64: 16(ivec4) CompositeExtract 63 1 + Store 18(itexel) 64 + 65: 6(int) CompositeExtract 63 0 + 66: 6(int) Load 8(resident) + 67: 6(int) BitwiseOr 66 65 + Store 8(resident) 67 + 72: 69 Load 71(s2DShadow) + 73: 46(fvec3) Load 48(c3) + 75: 74(ptr) AccessChain 13(texel) 24 + 76: 10(float) CompositeExtract 73 2 + 78: 77(ResType) ImageSparseSampleDrefImplicitLod 72 73 76 + 79: 10(float) CompositeExtract 78 1 + Store 75 79 + 80: 6(int) CompositeExtract 78 0 + 81: 6(int) Load 8(resident) + 82: 6(int) BitwiseOr 81 80 + Store 8(resident) 82 + 87: 84 Load 86(sCubeArrayShadow) + 90: 11(fvec4) Load 89(c4) + 92: 74(ptr) AccessChain 13(texel) 24 + 93: 77(ResType) ImageSparseSampleDrefImplicitLod 87 90 91 + 94: 10(float) CompositeExtract 93 1 + Store 92 94 + 95: 6(int) CompositeExtract 93 0 + 96: 6(int) Load 8(resident) + 97: 6(int) BitwiseOr 96 95 + Store 8(resident) 97 + 98: 27 Load 29(s2D) + 99: 31(fvec2) Load 33(c2) + 100: 35(ResType) ImageSparseSampleExplicitLod 98 99 Lod 50 + 101: 11(fvec4) CompositeExtract 100 1 + Store 13(texel) 101 + 102: 6(int) CompositeExtract 100 0 + 103: 6(int) Load 8(resident) + 104: 6(int) BitwiseOr 103 102 + Store 8(resident) 104 + 109: 106 Load 108(usCubeArray) + 110: 11(fvec4) Load 89(c4) + 112:111(ResType) ImageSparseSampleExplicitLod 109 110 Lod 91 + 113: 21(ivec4) CompositeExtract 112 1 + Store 23(utexel) 113 + 114: 6(int) CompositeExtract 112 0 + 115: 6(int) Load 8(resident) + 116: 6(int) BitwiseOr 115 114 + Store 8(resident) 116 + 117: 69 Load 71(s2DShadow) + 118: 46(fvec3) Load 48(c3) + 120: 74(ptr) AccessChain 13(texel) 119 + 121: 10(float) CompositeExtract 118 2 + 122: 77(ResType) ImageSparseSampleDrefExplicitLod 117 118 121 Lod 50 + 123: 10(float) CompositeExtract 122 1 + Store 120 123 + 124: 6(int) CompositeExtract 122 0 + 125: 6(int) Load 8(resident) + 126: 6(int) BitwiseOr 125 124 + Store 8(resident) 126 + 127: 42 Load 44(s3D) + 128: 46(fvec3) Load 48(c3) + 132: 35(ResType) ImageSparseSampleImplicitLod 127 128 Bias ConstOffset 50 131 + 133: 11(fvec4) CompositeExtract 132 1 + Store 13(texel) 133 + 134: 6(int) CompositeExtract 132 0 + 135: 6(int) Load 8(resident) + 136: 6(int) BitwiseOr 135 134 + Store 8(resident) 136 + 141: 138 Load 140(us2DRect) + 142: 31(fvec2) Load 33(c2) + 146:111(ResType) ImageSparseSampleImplicitLod 141 142 ConstOffset 145 + 147: 21(ivec4) CompositeExtract 146 1 + Store 23(utexel) 147 + 148: 6(int) CompositeExtract 146 0 + 149: 6(int) Load 8(resident) + 150: 6(int) BitwiseOr 149 148 + Store 8(resident) 150 + 155: 152 Load 154(s2DArrayShadow) + 156: 11(fvec4) Load 89(c4) + 160: 74(ptr) AccessChain 13(texel) 159 + 161: 10(float) CompositeExtract 156 3 + 162: 77(ResType) ImageSparseSampleDrefImplicitLod 155 156 161 ConstOffset 158 + 163: 10(float) CompositeExtract 162 1 + Store 160 163 + 164: 6(int) CompositeExtract 162 0 + 165: 6(int) Load 8(resident) + 166: 6(int) BitwiseOr 165 164 + Store 8(resident) 166 + 167: 27 Load 29(s2D) + 168: 31(fvec2) Load 33(c2) + 169: 143(ivec2) ConvertFToS 168 + 170: 26 Image 167 + 171: 35(ResType) ImageSparseFetch 170 169 Lod 130 + 172: 11(fvec4) CompositeExtract 171 1 + Store 13(texel) 172 + 173: 6(int) CompositeExtract 171 0 + 174: 6(int) Load 8(resident) + 175: 6(int) BitwiseOr 174 173 + Store 8(resident) 175 + 176: 138 Load 140(us2DRect) + 177: 31(fvec2) Load 33(c2) + 178: 143(ivec2) ConvertFToS 177 + 179: 137 Image 176 + 180:111(ResType) ImageSparseFetch 179 178 + 181: 21(ivec4) CompositeExtract 180 1 + Store 23(utexel) 181 + 182: 6(int) CompositeExtract 180 0 + 183: 6(int) Load 8(resident) + 184: 6(int) BitwiseOr 183 182 + Store 8(resident) 184 + 189: 186 Load 188(s2DMS) + 190: 31(fvec2) Load 33(c2) + 191: 143(ivec2) ConvertFToS 190 + 193: 185 Image 189 + 194: 35(ResType) ImageSparseFetch 193 191 Sample 192 + 195: 11(fvec4) CompositeExtract 194 1 + Store 13(texel) 195 + 196: 6(int) CompositeExtract 194 0 + 197: 6(int) Load 8(resident) + 198: 6(int) BitwiseOr 197 196 + Store 8(resident) 198 + 199: 42 Load 44(s3D) + 200: 46(fvec3) Load 48(c3) + 201: 129(ivec3) ConvertFToS 200 + 203: 41 Image 199 + 204: 35(ResType) ImageSparseFetch 203 201 Lod ConstOffset 130 202 + 205: 11(fvec4) CompositeExtract 204 1 + Store 13(texel) 205 + 206: 6(int) CompositeExtract 204 0 + 207: 6(int) Load 8(resident) + 208: 6(int) BitwiseOr 207 206 + Store 8(resident) 208 + 209: 138 Load 140(us2DRect) + 210: 31(fvec2) Load 33(c2) + 211: 143(ivec2) ConvertFToS 210 + 212: 137 Image 209 + 213:111(ResType) ImageSparseFetch 212 211 ConstOffset 145 + 214: 21(ivec4) CompositeExtract 213 1 + Store 23(utexel) 214 + 215: 6(int) CompositeExtract 213 0 + 216: 6(int) Load 8(resident) + 217: 6(int) BitwiseOr 216 215 + Store 8(resident) 217 + 218: 27 Load 29(s2D) + 219: 31(fvec2) Load 33(c2) + 220: 35(ResType) ImageSparseSampleExplicitLod 218 219 Lod ConstOffset 50 158 + 221: 11(fvec4) CompositeExtract 220 1 + Store 13(texel) 221 + 222: 6(int) CompositeExtract 220 0 + 223: 6(int) Load 8(resident) + 224: 6(int) BitwiseOr 223 222 + Store 8(resident) 224 + 229: 226 Load 228(is2DArray) + 230: 46(fvec3) Load 48(c3) + 233: 62(ResType) ImageSparseSampleExplicitLod 229 230 Lod ConstOffset 50 232 + 234: 16(ivec4) CompositeExtract 233 1 + Store 18(itexel) 234 + 235: 6(int) CompositeExtract 233 0 + 236: 6(int) Load 8(resident) + 237: 6(int) BitwiseOr 236 235 + Store 8(resident) 237 + 238: 69 Load 71(s2DShadow) + 239: 46(fvec3) Load 48(c3) + 242: 74(ptr) AccessChain 13(texel) 159 + 243: 10(float) CompositeExtract 239 2 + 244: 77(ResType) ImageSparseSampleDrefExplicitLod 238 239 243 Lod ConstOffset 50 241 + 245: 10(float) CompositeExtract 244 1 + Store 242 245 + 246: 6(int) CompositeExtract 244 0 + 247: 6(int) Load 8(resident) + 248: 6(int) BitwiseOr 247 246 + Store 8(resident) 248 + 249: 42 Load 44(s3D) + 250: 46(fvec3) Load 48(c3) + 251: 46(fvec3) Load 48(c3) + 252: 46(fvec3) Load 48(c3) + 253: 35(ResType) ImageSparseSampleExplicitLod 249 250 Grad 251 252 + 254: 11(fvec4) CompositeExtract 253 1 + Store 13(texel) 254 + 255: 6(int) CompositeExtract 253 0 + 256: 6(int) Load 8(resident) + 257: 6(int) BitwiseOr 256 255 + Store 8(resident) 257 + 262: 259 Load 261(sCubeShadow) + 263: 11(fvec4) Load 89(c4) + 264: 46(fvec3) Load 48(c3) + 265: 46(fvec3) Load 48(c3) + 266: 74(ptr) AccessChain 13(texel) 119 + 267: 10(float) CompositeExtract 263 3 + 268: 77(ResType) ImageSparseSampleDrefExplicitLod 262 263 267 Grad 264 265 + 269: 10(float) CompositeExtract 268 1 + Store 266 269 + 270: 6(int) CompositeExtract 268 0 + 271: 6(int) Load 8(resident) + 272: 6(int) BitwiseOr 271 270 + Store 8(resident) 272 + 273: 106 Load 108(usCubeArray) + 274: 11(fvec4) Load 89(c4) + 275: 46(fvec3) Load 48(c3) + 276: 46(fvec3) Load 48(c3) + 277:111(ResType) ImageSparseSampleExplicitLod 273 274 Grad 275 276 + 278: 21(ivec4) CompositeExtract 277 1 + Store 23(utexel) 278 + 279: 6(int) CompositeExtract 277 0 + 280: 6(int) Load 8(resident) + 281: 6(int) BitwiseOr 280 279 + Store 8(resident) 281 + 282: 27 Load 29(s2D) + 283: 31(fvec2) Load 33(c2) + 284: 31(fvec2) Load 33(c2) + 285: 31(fvec2) Load 33(c2) + 286: 35(ResType) ImageSparseSampleExplicitLod 282 283 Grad ConstOffset 284 285 158 + 287: 11(fvec4) CompositeExtract 286 1 + Store 13(texel) 287 + 288: 6(int) CompositeExtract 286 0 + 289: 6(int) Load 8(resident) + 290: 6(int) BitwiseOr 289 288 + Store 8(resident) 290 + 295: 292 Load 294(s2DRectShadow) + 296: 46(fvec3) Load 48(c3) + 297: 31(fvec2) Load 33(c2) + 298: 31(fvec2) Load 33(c2) + 300: 74(ptr) AccessChain 13(texel) 299 + 301: 10(float) CompositeExtract 296 2 + 302: 77(ResType) ImageSparseSampleDrefExplicitLod 295 296 301 Grad ConstOffset 297 298 232 + 303: 10(float) CompositeExtract 302 1 + Store 300 303 + 304: 6(int) CompositeExtract 302 0 + 305: 6(int) Load 8(resident) + 306: 6(int) BitwiseOr 305 304 + Store 8(resident) 306 + 307: 226 Load 228(is2DArray) + 308: 46(fvec3) Load 48(c3) + 309: 31(fvec2) Load 33(c2) + 310: 31(fvec2) Load 33(c2) + 312: 62(ResType) ImageSparseSampleExplicitLod 307 308 Grad ConstOffset 309 310 311 + 313: 16(ivec4) CompositeExtract 312 1 + Store 18(itexel) 313 + 314: 6(int) CompositeExtract 312 0 + 315: 6(int) Load 8(resident) + 316: 6(int) BitwiseOr 315 314 + Store 8(resident) 316 + 317: 27 Load 29(s2D) + 318: 31(fvec2) Load 33(c2) + 319: 35(ResType) ImageSparseGather 317 318 9 + 320: 11(fvec4) CompositeExtract 319 1 + Store 13(texel) 320 + 321: 6(int) CompositeExtract 319 0 + 322: 6(int) Load 8(resident) + 323: 6(int) BitwiseOr 322 321 + Store 8(resident) 323 + 324: 226 Load 228(is2DArray) + 325: 46(fvec3) Load 48(c3) + 326: 62(ResType) ImageSparseGather 324 325 130 + 327: 16(ivec4) CompositeExtract 326 1 + Store 18(itexel) 327 + 328: 6(int) CompositeExtract 326 0 + 329: 6(int) Load 8(resident) + 330: 6(int) BitwiseOr 329 328 + Store 8(resident) 330 + 331: 152 Load 154(s2DArrayShadow) + 332: 46(fvec3) Load 48(c3) + 333: 35(ResType) ImageSparseDrefGather 331 332 50 + 334: 11(fvec4) CompositeExtract 333 1 + Store 13(texel) 334 + 335: 6(int) CompositeExtract 333 0 + 336: 6(int) Load 8(resident) + 337: 6(int) BitwiseOr 336 335 + Store 8(resident) 337 + 338: 27 Load 29(s2D) + 339: 31(fvec2) Load 33(c2) + 341: 35(ResType) ImageSparseGather 338 339 9 ConstOffset 340 + 342: 11(fvec4) CompositeExtract 341 1 + Store 13(texel) 342 + 343: 6(int) CompositeExtract 341 0 + 344: 6(int) Load 8(resident) + 345: 6(int) BitwiseOr 344 343 + Store 8(resident) 345 + 346: 226 Load 228(is2DArray) + 347: 46(fvec3) Load 48(c3) + 348: 62(ResType) ImageSparseGather 346 347 130 ConstOffset 158 + 349: 16(ivec4) CompositeExtract 348 1 + Store 18(itexel) 349 + 350: 6(int) CompositeExtract 348 0 + 351: 6(int) Load 8(resident) + 352: 6(int) BitwiseOr 351 350 + Store 8(resident) 352 + 353: 292 Load 294(s2DRectShadow) + 354: 31(fvec2) Load 33(c2) + 355: 35(ResType) ImageSparseDrefGather 353 354 50 ConstOffset 241 + 356: 11(fvec4) CompositeExtract 355 1 + Store 13(texel) 356 + 357: 6(int) CompositeExtract 355 0 + 358: 6(int) Load 8(resident) + 359: 6(int) BitwiseOr 358 357 + Store 8(resident) 359 + 360: 27 Load 29(s2D) + 361: 31(fvec2) Load 33(c2) + 366: 363 Load 365(offsets) + 367: 35(ResType) ImageSparseGather 360 361 9 ConstOffsets 366 + 368: 11(fvec4) CompositeExtract 367 1 + Store 13(texel) 368 + 369: 6(int) CompositeExtract 367 0 + 370: 6(int) Load 8(resident) + 371: 6(int) BitwiseOr 370 369 + Store 8(resident) 371 + 372: 226 Load 228(is2DArray) + 373: 46(fvec3) Load 48(c3) + 374: 363 Load 365(offsets) + 375: 62(ResType) ImageSparseGather 372 373 130 ConstOffsets 374 + 376: 16(ivec4) CompositeExtract 375 1 + Store 18(itexel) 376 + 377: 6(int) CompositeExtract 375 0 + 378: 6(int) Load 8(resident) + 379: 6(int) BitwiseOr 378 377 + Store 8(resident) 379 + 380: 292 Load 294(s2DRectShadow) + 381: 31(fvec2) Load 33(c2) + 382: 363 Load 365(offsets) + 383: 35(ResType) ImageSparseDrefGather 380 381 50 ConstOffsets 382 + 384: 11(fvec4) CompositeExtract 383 1 + Store 13(texel) 384 + 385: 6(int) CompositeExtract 383 0 + 386: 6(int) Load 8(resident) + 387: 6(int) BitwiseOr 386 385 + Store 8(resident) 387 + 391: 388 Load 390(i2D) + 394: 143(ivec2) Load 393(ic2) + 395: 35(ResType) ImageSparseRead 391 394 + 396: 11(fvec4) CompositeExtract 395 1 + Store 13(texel) 396 + 397: 6(int) CompositeExtract 395 0 + 398: 6(int) Load 8(resident) + 399: 6(int) BitwiseOr 398 397 + Store 8(resident) 399 + 403: 400 Load 402(ii3D) + 406: 129(ivec3) Load 405(ic3) + 407: 62(ResType) ImageSparseRead 403 406 + 408: 16(ivec4) CompositeExtract 407 1 + Store 18(itexel) 408 + 409: 6(int) CompositeExtract 407 0 + 410: 6(int) Load 8(resident) + 411: 6(int) BitwiseOr 410 409 + Store 8(resident) 411 + 415: 412 Load 414(i2DMS) + 416: 143(ivec2) Load 393(ic2) + 417: 35(ResType) ImageSparseRead 415 416 Sample 144 + 418: 11(fvec4) CompositeExtract 417 1 + Store 13(texel) 418 + 419: 6(int) CompositeExtract 417 0 + 420: 6(int) Load 8(resident) + 421: 6(int) BitwiseOr 420 419 + Store 8(resident) 421 + 424: 6(int) Load 8(resident) + 426: 425(bool) ImageSparseTexelsResident 424 + SelectionMerge 429 None + BranchConditional 426 428 431 + 428: Label + 430: 11(fvec4) Load 13(texel) + Store 427 430 + Branch 429 + 431: Label + 432: 16(ivec4) Load 18(itexel) + 433: 11(fvec4) ConvertSToF 432 + 434: 21(ivec4) Load 23(utexel) + 435: 11(fvec4) ConvertUToF 434 + 436: 11(fvec4) FAdd 433 435 + Store 427 436 + Branch 429 + 429: Label + 437: 11(fvec4) Load 427 + Store 423(outColor) 437 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.sparseTextureClamp.frag.out b/deps/glslang/Test/baseResults/spv.sparseTextureClamp.frag.out new file mode 100644 index 00000000..fe210f74 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.sparseTextureClamp.frag.out @@ -0,0 +1,469 @@ +spv.sparseTextureClamp.frag +error: SPIRV-Tools Validation Errors +error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension) + OpCapability SampledRect + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 360 + + Capability Shader + Capability SampledRect + Capability SparseResidency + Capability MinLod + Capability SampledCubeArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 33 36 51 95 345 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_ARB_sparse_texture_clamp" + Name 4 "main" + Name 8 "resident" + Name 13 "texel" + Name 18 "itexel" + Name 23 "utexel" + Name 29 "s2D" + Name 33 "c2" + Name 36 "lodClamp" + Name 38 "ResType" + Name 47 "s3D" + Name 51 "c3" + Name 63 "isCube" + Name 67 "ResType" + Name 76 "s2DShadow" + Name 83 "ResType" + Name 92 "sCubeArrayShadow" + Name 95 "c4" + Name 154 "us2DRect" + Name 161 "ResType" + Name 170 "s2DArrayShadow" + Name 218 "sCubeShadow" + Name 235 "usCubeArray" + Name 286 "s2DRectShadow" + Name 305 "is2DArray" + Name 345 "outColor" + Decorate 29(s2D) DescriptorSet 0 + Decorate 47(s3D) DescriptorSet 0 + Decorate 63(isCube) DescriptorSet 0 + Decorate 76(s2DShadow) DescriptorSet 0 + Decorate 92(sCubeArrayShadow) DescriptorSet 0 + Decorate 154(us2DRect) DescriptorSet 0 + Decorate 170(s2DArrayShadow) DescriptorSet 0 + Decorate 218(sCubeShadow) DescriptorSet 0 + Decorate 235(usCubeArray) DescriptorSet 0 + Decorate 286(s2DRectShadow) DescriptorSet 0 + Decorate 305(is2DArray) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 10: TypeFloat 32 + 11: TypeVector 10(float) 4 + 12: TypePointer Function 11(fvec4) + 14: 10(float) Constant 0 + 15: 11(fvec4) ConstantComposite 14 14 14 14 + 16: TypeVector 6(int) 4 + 17: TypePointer Function 16(ivec4) + 19: 16(ivec4) ConstantComposite 9 9 9 9 + 20: TypeInt 32 0 + 21: TypeVector 20(int) 4 + 22: TypePointer Function 21(ivec4) + 24: 20(int) Constant 0 + 25: 21(ivec4) ConstantComposite 24 24 24 24 + 26: TypeImage 10(float) 2D sampled format:Unknown + 27: TypeSampledImage 26 + 28: TypePointer UniformConstant 27 + 29(s2D): 28(ptr) Variable UniformConstant + 31: TypeVector 10(float) 2 + 32: TypePointer Input 31(fvec2) + 33(c2): 32(ptr) Variable Input + 35: TypePointer Input 10(float) + 36(lodClamp): 35(ptr) Variable Input + 38(ResType): TypeStruct 6(int) 11(fvec4) + 44: TypeImage 10(float) 3D sampled format:Unknown + 45: TypeSampledImage 44 + 46: TypePointer UniformConstant 45 + 47(s3D): 46(ptr) Variable UniformConstant + 49: TypeVector 10(float) 3 + 50: TypePointer Input 49(fvec3) + 51(c3): 50(ptr) Variable Input + 54: 10(float) Constant 1073741824 + 60: TypeImage 6(int) Cube sampled format:Unknown + 61: TypeSampledImage 60 + 62: TypePointer UniformConstant 61 + 63(isCube): 62(ptr) Variable UniformConstant + 67(ResType): TypeStruct 6(int) 16(ivec4) + 73: TypeImage 10(float) 2D depth sampled format:Unknown + 74: TypeSampledImage 73 + 75: TypePointer UniformConstant 74 + 76(s2DShadow): 75(ptr) Variable UniformConstant + 80: TypePointer Function 10(float) + 83(ResType): TypeStruct 6(int) 10(float) + 89: TypeImage 10(float) Cube depth array sampled format:Unknown + 90: TypeSampledImage 89 + 91: TypePointer UniformConstant 90 +92(sCubeArrayShadow): 91(ptr) Variable UniformConstant + 94: TypePointer Input 11(fvec4) + 95(c4): 94(ptr) Variable Input + 97: 10(float) Constant 1065353216 + 142: TypeVector 6(int) 3 + 143: 6(int) Constant 2 + 144: 142(ivec3) ConstantComposite 143 143 143 + 151: TypeImage 20(int) Rect sampled format:Unknown + 152: TypeSampledImage 151 + 153: TypePointer UniformConstant 152 + 154(us2DRect): 153(ptr) Variable UniformConstant + 157: TypeVector 6(int) 2 + 158: 6(int) Constant 3 + 159: 157(ivec2) ConstantComposite 158 158 + 161(ResType): TypeStruct 6(int) 21(ivec4) + 167: TypeImage 10(float) 2D depth array sampled format:Unknown + 168: TypeSampledImage 167 + 169: TypePointer UniformConstant 168 +170(s2DArrayShadow): 169(ptr) Variable UniformConstant + 173: 6(int) Constant 5 + 174: 157(ivec2) ConstantComposite 173 173 + 176: 20(int) Constant 2 + 215: TypeImage 10(float) Cube depth sampled format:Unknown + 216: TypeSampledImage 215 + 217: TypePointer UniformConstant 216 +218(sCubeShadow): 217(ptr) Variable UniformConstant + 224: 20(int) Constant 1 + 232: TypeImage 20(int) Cube array sampled format:Unknown + 233: TypeSampledImage 232 + 234: TypePointer UniformConstant 233 +235(usCubeArray): 234(ptr) Variable UniformConstant + 283: TypeImage 10(float) Rect depth sampled format:Unknown + 284: TypeSampledImage 283 + 285: TypePointer UniformConstant 284 +286(s2DRectShadow): 285(ptr) Variable UniformConstant + 291: 6(int) Constant 6 + 292: 157(ivec2) ConstantComposite 291 291 + 294: 20(int) Constant 3 + 302: TypeImage 6(int) 2D array sampled format:Unknown + 303: TypeSampledImage 302 + 304: TypePointer UniformConstant 303 + 305(is2DArray): 304(ptr) Variable UniformConstant + 310: 157(ivec2) ConstantComposite 143 143 + 344: TypePointer Output 11(fvec4) + 345(outColor): 344(ptr) Variable Output + 347: TypeBool + 4(main): 2 Function None 3 + 5: Label + 8(resident): 7(ptr) Variable Function + 13(texel): 12(ptr) Variable Function + 18(itexel): 17(ptr) Variable Function + 23(utexel): 22(ptr) Variable Function + 349: 12(ptr) Variable Function + Store 8(resident) 9 + Store 13(texel) 15 + Store 18(itexel) 19 + Store 23(utexel) 25 + 30: 27 Load 29(s2D) + 34: 31(fvec2) Load 33(c2) + 37: 10(float) Load 36(lodClamp) + 39: 38(ResType) ImageSparseSampleImplicitLod 30 34 MinLod 37 + 40: 11(fvec4) CompositeExtract 39 1 + Store 13(texel) 40 + 41: 6(int) CompositeExtract 39 0 + 42: 6(int) Load 8(resident) + 43: 6(int) BitwiseOr 42 41 + Store 8(resident) 43 + 48: 45 Load 47(s3D) + 52: 49(fvec3) Load 51(c3) + 53: 10(float) Load 36(lodClamp) + 55: 38(ResType) ImageSparseSampleImplicitLod 48 52 Bias MinLod 54 53 + 56: 11(fvec4) CompositeExtract 55 1 + Store 13(texel) 56 + 57: 6(int) CompositeExtract 55 0 + 58: 6(int) Load 8(resident) + 59: 6(int) BitwiseOr 58 57 + Store 8(resident) 59 + 64: 61 Load 63(isCube) + 65: 49(fvec3) Load 51(c3) + 66: 10(float) Load 36(lodClamp) + 68: 67(ResType) ImageSparseSampleImplicitLod 64 65 MinLod 66 + 69: 16(ivec4) CompositeExtract 68 1 + Store 18(itexel) 69 + 70: 6(int) CompositeExtract 68 0 + 71: 6(int) Load 8(resident) + 72: 6(int) BitwiseOr 71 70 + Store 8(resident) 72 + 77: 74 Load 76(s2DShadow) + 78: 49(fvec3) Load 51(c3) + 79: 10(float) Load 36(lodClamp) + 81: 80(ptr) AccessChain 13(texel) 24 + 82: 10(float) CompositeExtract 78 2 + 84: 83(ResType) ImageSparseSampleDrefImplicitLod 77 78 82 MinLod 79 + 85: 10(float) CompositeExtract 84 1 + Store 81 85 + 86: 6(int) CompositeExtract 84 0 + 87: 6(int) Load 8(resident) + 88: 6(int) BitwiseOr 87 86 + Store 8(resident) 88 + 93: 90 Load 92(sCubeArrayShadow) + 96: 11(fvec4) Load 95(c4) + 98: 10(float) Load 36(lodClamp) + 99: 80(ptr) AccessChain 13(texel) 24 + 100: 83(ResType) ImageSparseSampleDrefImplicitLod 93 96 97 MinLod 98 + 101: 10(float) CompositeExtract 100 1 + Store 99 101 + 102: 6(int) CompositeExtract 100 0 + 103: 6(int) Load 8(resident) + 104: 6(int) BitwiseOr 103 102 + Store 8(resident) 104 + 105: 27 Load 29(s2D) + 106: 31(fvec2) Load 33(c2) + 107: 10(float) Load 36(lodClamp) + 108: 11(fvec4) ImageSampleImplicitLod 105 106 MinLod 107 + 109: 11(fvec4) Load 13(texel) + 110: 11(fvec4) FAdd 109 108 + Store 13(texel) 110 + 111: 45 Load 47(s3D) + 112: 49(fvec3) Load 51(c3) + 113: 10(float) Load 36(lodClamp) + 114: 11(fvec4) ImageSampleImplicitLod 111 112 Bias MinLod 54 113 + 115: 11(fvec4) Load 13(texel) + 116: 11(fvec4) FAdd 115 114 + Store 13(texel) 116 + 117: 61 Load 63(isCube) + 118: 49(fvec3) Load 51(c3) + 119: 10(float) Load 36(lodClamp) + 120: 16(ivec4) ImageSampleImplicitLod 117 118 MinLod 119 + 121: 16(ivec4) Load 18(itexel) + 122: 16(ivec4) IAdd 121 120 + Store 18(itexel) 122 + 123: 74 Load 76(s2DShadow) + 124: 49(fvec3) Load 51(c3) + 125: 10(float) Load 36(lodClamp) + 126: 10(float) CompositeExtract 124 2 + 127: 10(float) ImageSampleDrefImplicitLod 123 124 126 MinLod 125 + 128: 80(ptr) AccessChain 13(texel) 24 + 129: 10(float) Load 128 + 130: 10(float) FAdd 129 127 + 131: 80(ptr) AccessChain 13(texel) 24 + Store 131 130 + 132: 90 Load 92(sCubeArrayShadow) + 133: 11(fvec4) Load 95(c4) + 134: 10(float) Load 36(lodClamp) + 135: 10(float) ImageSampleDrefImplicitLod 132 133 97 MinLod 134 + 136: 80(ptr) AccessChain 13(texel) 24 + 137: 10(float) Load 136 + 138: 10(float) FAdd 137 135 + 139: 80(ptr) AccessChain 13(texel) 24 + Store 139 138 + 140: 45 Load 47(s3D) + 141: 49(fvec3) Load 51(c3) + 145: 10(float) Load 36(lodClamp) + 146: 38(ResType) ImageSparseSampleImplicitLod 140 141 Bias ConstOffset MinLod 54 144 145 + 147: 11(fvec4) CompositeExtract 146 1 + Store 13(texel) 147 + 148: 6(int) CompositeExtract 146 0 + 149: 6(int) Load 8(resident) + 150: 6(int) BitwiseOr 149 148 + Store 8(resident) 150 + 155: 152 Load 154(us2DRect) + 156: 31(fvec2) Load 33(c2) + 160: 10(float) Load 36(lodClamp) + 162:161(ResType) ImageSparseSampleImplicitLod 155 156 ConstOffset MinLod 159 160 + 163: 21(ivec4) CompositeExtract 162 1 + Store 23(utexel) 163 + 164: 6(int) CompositeExtract 162 0 + 165: 6(int) Load 8(resident) + 166: 6(int) BitwiseOr 165 164 + Store 8(resident) 166 + 171: 168 Load 170(s2DArrayShadow) + 172: 11(fvec4) Load 95(c4) + 175: 10(float) Load 36(lodClamp) + 177: 80(ptr) AccessChain 13(texel) 176 + 178: 10(float) CompositeExtract 172 3 + 179: 83(ResType) ImageSparseSampleDrefImplicitLod 171 172 178 ConstOffset MinLod 174 175 + 180: 10(float) CompositeExtract 179 1 + Store 177 180 + 181: 6(int) CompositeExtract 179 0 + 182: 6(int) Load 8(resident) + 183: 6(int) BitwiseOr 182 181 + Store 8(resident) 183 + 184: 45 Load 47(s3D) + 185: 49(fvec3) Load 51(c3) + 186: 10(float) Load 36(lodClamp) + 187: 11(fvec4) ImageSampleImplicitLod 184 185 Bias ConstOffset MinLod 54 144 186 + 188: 11(fvec4) Load 13(texel) + 189: 11(fvec4) FAdd 188 187 + Store 13(texel) 189 + 190: 152 Load 154(us2DRect) + 191: 31(fvec2) Load 33(c2) + 192: 10(float) Load 36(lodClamp) + 193: 21(ivec4) ImageSampleImplicitLod 190 191 ConstOffset MinLod 159 192 + 194: 21(ivec4) Load 23(utexel) + 195: 21(ivec4) IAdd 194 193 + Store 23(utexel) 195 + 196: 168 Load 170(s2DArrayShadow) + 197: 11(fvec4) Load 95(c4) + 198: 10(float) Load 36(lodClamp) + 199: 10(float) CompositeExtract 197 3 + 200: 10(float) ImageSampleDrefImplicitLod 196 197 199 ConstOffset MinLod 174 198 + 201: 80(ptr) AccessChain 13(texel) 176 + 202: 10(float) Load 201 + 203: 10(float) FAdd 202 200 + 204: 80(ptr) AccessChain 13(texel) 176 + Store 204 203 + 205: 45 Load 47(s3D) + 206: 49(fvec3) Load 51(c3) + 207: 49(fvec3) Load 51(c3) + 208: 49(fvec3) Load 51(c3) + 209: 10(float) Load 36(lodClamp) + 210: 38(ResType) ImageSparseSampleExplicitLod 205 206 Grad MinLod 207 208 209 + 211: 11(fvec4) CompositeExtract 210 1 + Store 13(texel) 211 + 212: 6(int) CompositeExtract 210 0 + 213: 6(int) Load 8(resident) + 214: 6(int) BitwiseOr 213 212 + Store 8(resident) 214 + 219: 216 Load 218(sCubeShadow) + 220: 11(fvec4) Load 95(c4) + 221: 49(fvec3) Load 51(c3) + 222: 49(fvec3) Load 51(c3) + 223: 10(float) Load 36(lodClamp) + 225: 80(ptr) AccessChain 13(texel) 224 + 226: 10(float) CompositeExtract 220 3 + 227: 83(ResType) ImageSparseSampleDrefExplicitLod 219 220 226 Grad MinLod 221 222 223 + 228: 10(float) CompositeExtract 227 1 + Store 225 228 + 229: 6(int) CompositeExtract 227 0 + 230: 6(int) Load 8(resident) + 231: 6(int) BitwiseOr 230 229 + Store 8(resident) 231 + 236: 233 Load 235(usCubeArray) + 237: 11(fvec4) Load 95(c4) + 238: 49(fvec3) Load 51(c3) + 239: 49(fvec3) Load 51(c3) + 240: 10(float) Load 36(lodClamp) + 241:161(ResType) ImageSparseSampleExplicitLod 236 237 Grad MinLod 238 239 240 + 242: 21(ivec4) CompositeExtract 241 1 + Store 23(utexel) 242 + 243: 6(int) CompositeExtract 241 0 + 244: 6(int) Load 8(resident) + 245: 6(int) BitwiseOr 244 243 + Store 8(resident) 245 + 246: 45 Load 47(s3D) + 247: 49(fvec3) Load 51(c3) + 248: 49(fvec3) Load 51(c3) + 249: 49(fvec3) Load 51(c3) + 250: 10(float) Load 36(lodClamp) + 251: 11(fvec4) ImageSampleExplicitLod 246 247 Grad MinLod 248 249 250 + 252: 11(fvec4) Load 13(texel) + 253: 11(fvec4) FAdd 252 251 + Store 13(texel) 253 + 254: 216 Load 218(sCubeShadow) + 255: 11(fvec4) Load 95(c4) + 256: 49(fvec3) Load 51(c3) + 257: 49(fvec3) Load 51(c3) + 258: 10(float) Load 36(lodClamp) + 259: 10(float) CompositeExtract 255 3 + 260: 10(float) ImageSampleDrefExplicitLod 254 255 259 Grad MinLod 256 257 258 + 261: 80(ptr) AccessChain 13(texel) 224 + 262: 10(float) Load 261 + 263: 10(float) FAdd 262 260 + 264: 80(ptr) AccessChain 13(texel) 224 + Store 264 263 + 265: 233 Load 235(usCubeArray) + 266: 11(fvec4) Load 95(c4) + 267: 49(fvec3) Load 51(c3) + 268: 49(fvec3) Load 51(c3) + 269: 10(float) Load 36(lodClamp) + 270: 21(ivec4) ImageSampleExplicitLod 265 266 Grad MinLod 267 268 269 + 271: 21(ivec4) Load 23(utexel) + 272: 21(ivec4) IAdd 271 270 + Store 23(utexel) 272 + 273: 27 Load 29(s2D) + 274: 31(fvec2) Load 33(c2) + 275: 31(fvec2) Load 33(c2) + 276: 31(fvec2) Load 33(c2) + 277: 10(float) Load 36(lodClamp) + 278: 38(ResType) ImageSparseSampleExplicitLod 273 274 Grad ConstOffset MinLod 275 276 174 277 + 279: 11(fvec4) CompositeExtract 278 1 + Store 13(texel) 279 + 280: 6(int) CompositeExtract 278 0 + 281: 6(int) Load 8(resident) + 282: 6(int) BitwiseOr 281 280 + Store 8(resident) 282 + 287: 284 Load 286(s2DRectShadow) + 288: 49(fvec3) Load 51(c3) + 289: 31(fvec2) Load 33(c2) + 290: 31(fvec2) Load 33(c2) + 293: 10(float) Load 36(lodClamp) + 295: 80(ptr) AccessChain 13(texel) 294 + 296: 10(float) CompositeExtract 288 2 + 297: 83(ResType) ImageSparseSampleDrefExplicitLod 287 288 296 Grad ConstOffset MinLod 289 290 292 293 + 298: 10(float) CompositeExtract 297 1 + Store 295 298 + 299: 6(int) CompositeExtract 297 0 + 300: 6(int) Load 8(resident) + 301: 6(int) BitwiseOr 300 299 + Store 8(resident) 301 + 306: 303 Load 305(is2DArray) + 307: 49(fvec3) Load 51(c3) + 308: 31(fvec2) Load 33(c2) + 309: 31(fvec2) Load 33(c2) + 311: 10(float) Load 36(lodClamp) + 312: 67(ResType) ImageSparseSampleExplicitLod 306 307 Grad ConstOffset MinLod 308 309 310 311 + 313: 16(ivec4) CompositeExtract 312 1 + Store 18(itexel) 313 + 314: 6(int) CompositeExtract 312 0 + 315: 6(int) Load 8(resident) + 316: 6(int) BitwiseOr 315 314 + Store 8(resident) 316 + 317: 27 Load 29(s2D) + 318: 31(fvec2) Load 33(c2) + 319: 31(fvec2) Load 33(c2) + 320: 31(fvec2) Load 33(c2) + 321: 10(float) Load 36(lodClamp) + 322: 11(fvec4) ImageSampleExplicitLod 317 318 Grad ConstOffset MinLod 319 320 174 321 + 323: 11(fvec4) Load 13(texel) + 324: 11(fvec4) FAdd 323 322 + Store 13(texel) 324 + 325: 284 Load 286(s2DRectShadow) + 326: 49(fvec3) Load 51(c3) + 327: 31(fvec2) Load 33(c2) + 328: 31(fvec2) Load 33(c2) + 329: 10(float) Load 36(lodClamp) + 330: 10(float) CompositeExtract 326 2 + 331: 10(float) ImageSampleDrefExplicitLod 325 326 330 Grad ConstOffset MinLod 327 328 292 329 + 332: 80(ptr) AccessChain 13(texel) 294 + 333: 10(float) Load 332 + 334: 10(float) FAdd 333 331 + 335: 80(ptr) AccessChain 13(texel) 294 + Store 335 334 + 336: 303 Load 305(is2DArray) + 337: 49(fvec3) Load 51(c3) + 338: 31(fvec2) Load 33(c2) + 339: 31(fvec2) Load 33(c2) + 340: 10(float) Load 36(lodClamp) + 341: 16(ivec4) ImageSampleExplicitLod 336 337 Grad ConstOffset MinLod 338 339 310 340 + 342: 16(ivec4) Load 18(itexel) + 343: 16(ivec4) IAdd 342 341 + Store 18(itexel) 343 + 346: 6(int) Load 8(resident) + 348: 347(bool) ImageSparseTexelsResident 346 + SelectionMerge 351 None + BranchConditional 348 350 353 + 350: Label + 352: 11(fvec4) Load 13(texel) + Store 349 352 + Branch 351 + 353: Label + 354: 16(ivec4) Load 18(itexel) + 355: 11(fvec4) ConvertSToF 354 + 356: 21(ivec4) Load 23(utexel) + 357: 11(fvec4) ConvertUToF 356 + 358: 11(fvec4) FAdd 355 357 + Store 349 358 + Branch 351 + 351: Label + 359: 11(fvec4) Load 349 + Store 345(outColor) 359 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.specConst.vert.out b/deps/glslang/Test/baseResults/spv.specConst.vert.out new file mode 100644 index 00000000..70fbd09e --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.specConst.vert.out @@ -0,0 +1,56 @@ +spv.specConst.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 27 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 13 25 26 + Source GLSL 450 + Name 4 "main" + Name 11 "gl_PerVertex" + MemberName 11(gl_PerVertex) 0 "gl_Position" + MemberName 11(gl_PerVertex) 1 "gl_PointSize" + MemberName 11(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 11(gl_PerVertex) 3 "gl_CullDistance" + Name 13 "" + Name 18 "a" + Name 25 "gl_VertexID" + Name 26 "gl_InstanceID" + MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 11(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 11(gl_PerVertex) Block + Decorate 18(a) SpecId 11 + Decorate 25(gl_VertexID) BuiltIn VertexId + Decorate 26(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 0 + 9: 8(int) Constant 1 + 10: TypeArray 6(float) 9 +11(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 10 10 + 12: TypePointer Output 11(gl_PerVertex) + 13: 12(ptr) Variable Output + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16: 6(float) Constant 1065353216 + 17: 7(fvec4) ConstantComposite 16 16 16 16 + 18(a): 14(int) SpecConstant 8 + 22: TypePointer Output 7(fvec4) + 24: TypePointer Input 14(int) + 25(gl_VertexID): 24(ptr) Variable Input +26(gl_InstanceID): 24(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 19: 6(float) ConvertSToF 18(a) + 20: 7(fvec4) CompositeConstruct 19 19 19 19 + 21: 7(fvec4) FDiv 17 20 + 23: 22(ptr) AccessChain 13 15 + Store 23 21 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.specConstant.comp.out b/deps/glslang/Test/baseResults/spv.specConstant.comp.out new file mode 100644 index 00000000..b8aa3ddf --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.specConstant.comp.out @@ -0,0 +1,49 @@ +spv.specConstant.comp +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 27 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" + ExecutionMode 4 LocalSize 32 32 1 + Source GLSL 450 + Name 4 "main" + Name 7 "bn" + MemberName 7(bn) 0 "a" + Name 9 "bi" + MemberDecorate 7(bn) 0 Offset 0 + Decorate 7(bn) BufferBlock + Decorate 9(bi) DescriptorSet 0 + Decorate 12 SpecId 18 + Decorate 14 SpecId 19 + Decorate 16 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7(bn): TypeStruct 6(int) + 8: TypePointer Uniform 7(bn) + 9(bi): 8(ptr) Variable Uniform + 10: TypeInt 32 1 + 11: 10(int) Constant 0 + 12: 6(int) SpecConstant 32 + 13: 6(int) Constant 32 + 14: 6(int) SpecConstant 1 + 15: TypeVector 6(int) 3 + 16: 15(ivec3) SpecConstantComposite 12 13 14 + 17: 6(int) Constant 0 + 18: 6(int) SpecConstantOp 81 16 0 + 19: 6(int) Constant 1 + 20: 6(int) SpecConstantOp 81 16 1(GLSL.std.450) + 21: 6(int) SpecConstantOp 132 18 20 + 22: 6(int) Constant 2 + 23: 6(int) SpecConstantOp 81 16 2 + 24: 6(int) SpecConstantOp 132 21 23 + 25: TypePointer Uniform 6(int) + 4(main): 2 Function None 3 + 5: Label + 26: 25(ptr) AccessChain 9(bi) 11 + Store 26 24 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.specConstant.vert.out b/deps/glslang/Test/baseResults/spv.specConstant.vert.out new file mode 100644 index 00000000..0d47dce7 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.specConstant.vert.out @@ -0,0 +1,142 @@ +spv.specConstant.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 81 + + Capability Shader + Capability Float64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 20 22 28 53 + Source GLSL 400 + Name 4 "main" + Name 9 "arraySize" + Name 14 "foo(vf4[s2765];" + Name 13 "p" + Name 17 "builtin_spec_constant(" + Name 20 "color" + Name 22 "ucol" + Name 28 "size" + Name 30 "spBool" + Name 34 "scale" + Name 39 "spDouble" + Name 40 "spFloat" + Name 47 "param" + Name 50 "dupArraySize" + Name 53 "dupUcol" + Name 60 "spDupBool" + Name 63 "dupScale" + Name 67 "spDupDouble" + Name 68 "spDupFloat" + Name 76 "result" + Name 77 "gl_MaxImageUnits" + Decorate 9(arraySize) SpecId 16 + Decorate 30(spBool) SpecId 17 + Decorate 34(scale) SpecId 22 + Decorate 39(spDouble) SpecId 19 + Decorate 40(spFloat) SpecId 18 + Decorate 50(dupArraySize) SpecId 116 + Decorate 60(spDupBool) SpecId 117 + Decorate 63(dupScale) SpecId 122 + Decorate 67(spDupDouble) SpecId 119 + Decorate 68(spDupFloat) SpecId 118 + Decorate 77(gl_MaxImageUnits) SpecId 24 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 1 + 9(arraySize): 8(int) SpecConstant 5 + 10: TypeArray 7(fvec4) 9(arraySize) + 11: TypePointer Function 10 + 12: TypeFunction 2 11(ptr) + 16: TypeFunction 8(int) + 19: TypePointer Output 7(fvec4) + 20(color): 19(ptr) Variable Output + 21: TypePointer Input 10 + 22(ucol): 21(ptr) Variable Input + 23: 8(int) Constant 2 + 24: TypePointer Input 7(fvec4) + 27: TypePointer Output 8(int) + 28(size): 27(ptr) Variable Output + 29: TypeBool + 30(spBool): 29(bool) SpecConstantTrue + 33: TypeInt 32 0 + 34(scale): 33(int) SpecConstant 2 + 38: TypeFloat 64 + 39(spDouble):38(float64_t) SpecConstant 1413754136 1074340347 + 40(spFloat): 6(float) SpecConstant 1078523331 + 41:38(float64_t) SpecConstantOp 115 40(spFloat) +50(dupArraySize): 8(int) SpecConstant 12 + 51: TypeArray 7(fvec4) 50(dupArraySize) + 52: TypePointer Input 51 + 53(dupUcol): 52(ptr) Variable Input + 60(spDupBool): 29(bool) SpecConstantTrue + 63(dupScale): 33(int) SpecConstant 2 + 67(spDupDouble):38(float64_t) SpecConstant 1413754136 1074340347 + 68(spDupFloat): 6(float) SpecConstant 1078523331 + 69:38(float64_t) SpecConstantOp 115 68(spDupFloat) + 75: TypePointer Function 8(int) +77(gl_MaxImageUnits): 8(int) SpecConstant 8 + 4(main): 2 Function None 3 + 5: Label + 47(param): 11(ptr) Variable Function + 25: 24(ptr) AccessChain 22(ucol) 23 + 26: 7(fvec4) Load 25 + Store 20(color) 26 + Store 28(size) 9(arraySize) + SelectionMerge 32 None + BranchConditional 30(spBool) 31 32 + 31: Label + 35: 6(float) ConvertUToF 34(scale) + 36: 7(fvec4) Load 20(color) + 37: 7(fvec4) VectorTimesScalar 36 35 + Store 20(color) 37 + Branch 32 + 32: Label + 42:38(float64_t) FDiv 39(spDouble) 41 + 43: 6(float) FConvert 42 + 44: 7(fvec4) Load 20(color) + 45: 7(fvec4) CompositeConstruct 43 43 43 43 + 46: 7(fvec4) FAdd 44 45 + Store 20(color) 46 + 48: 10 Load 22(ucol) + Store 47(param) 48 + 49: 2 FunctionCall 14(foo(vf4[s2765];) 47(param) + Return + FunctionEnd +14(foo(vf4[s2765];): 2 Function None 12 + 13(p): 11(ptr) FunctionParameter + 15: Label + 54: 24(ptr) AccessChain 53(dupUcol) 23 + 55: 7(fvec4) Load 54 + 56: 7(fvec4) Load 20(color) + 57: 7(fvec4) FAdd 56 55 + Store 20(color) 57 + 58: 8(int) Load 28(size) + 59: 8(int) IAdd 58 50(dupArraySize) + Store 28(size) 59 + SelectionMerge 62 None + BranchConditional 60(spDupBool) 61 62 + 61: Label + 64: 6(float) ConvertUToF 63(dupScale) + 65: 7(fvec4) Load 20(color) + 66: 7(fvec4) VectorTimesScalar 65 64 + Store 20(color) 66 + Branch 62 + 62: Label + 70:38(float64_t) FDiv 67(spDupDouble) 69 + 71: 6(float) FConvert 70 + 72: 7(fvec4) Load 20(color) + 73: 7(fvec4) CompositeConstruct 71 71 71 71 + 74: 7(fvec4) FAdd 72 73 + Store 20(color) 74 + Return + FunctionEnd +17(builtin_spec_constant(): 8(int) Function None 16 + 18: Label + 76(result): 75(ptr) Variable Function + Store 76(result) 77(gl_MaxImageUnits) + 78: 8(int) Load 76(result) + ReturnValue 78 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.specConstantComposite.vert.out b/deps/glslang/Test/baseResults/spv.specConstantComposite.vert.out new file mode 100644 index 00000000..58d4b6a3 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.specConstantComposite.vert.out @@ -0,0 +1,87 @@ +spv.specConstantComposite.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 43 + + Capability Shader + Capability Float64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 27 42 + Source GLSL 450 + Name 4 "main" + Name 6 "refer_primary_spec_const(" + Name 8 "refer_composite_spec_const(" + Name 10 "refer_copmosite_dot_dereference(" + Name 12 "refer_composite_bracket_dereference(" + Name 16 "refer_spec_const_array_length(" + Name 18 "declare_spec_const_in_func(" + Name 21 "spec_bool" + Name 27 "color" + Name 28 "spec_int" + Name 33 "len" + Name 37 "spec_float" + Name 39 "spec_double" + Name 42 "global_vec4_array_with_spec_length" + Decorate 21(spec_bool) SpecId 203 + Decorate 28(spec_int) SpecId 200 + Decorate 37(spec_float) SpecId 201 + Decorate 39(spec_double) SpecId 202 + 2: TypeVoid + 3: TypeFunction 2 + 14: TypeInt 32 1 + 15: TypeFunction 14(int) + 20: TypeBool + 21(spec_bool): 20(bool) SpecConstantTrue + 24: TypeFloat 32 + 25: TypeVector 24(float) 4 + 26: TypePointer Output 25(fvec4) + 27(color): 26(ptr) Variable Output + 28(spec_int): 14(int) SpecConstant 3 + 32: TypePointer Function 14(int) + 37(spec_float): 24(float) SpecConstant 1078523331 + 38: TypeFloat 64 + 39(spec_double):38(float64_t) SpecConstant 1413754136 1074340347 + 40: TypeArray 25(fvec4) 28(spec_int) + 41: TypePointer Input 40 +42(global_vec4_array_with_spec_length): 41(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd +6(refer_primary_spec_const(): 2 Function None 3 + 7: Label + SelectionMerge 23 None + BranchConditional 21(spec_bool) 22 23 + 22: Label + 29: 24(float) ConvertSToF 28(spec_int) + 30: 25(fvec4) Load 27(color) + 31: 25(fvec4) VectorTimesScalar 30 29 + Store 27(color) 31 + Branch 23 + 23: Label + Return + FunctionEnd +8(refer_composite_spec_const(): 2 Function None 3 + 9: Label + Return + FunctionEnd +10(refer_copmosite_dot_dereference(): 2 Function None 3 + 11: Label + Return + FunctionEnd +12(refer_composite_bracket_dereference(): 2 Function None 3 + 13: Label + Return + FunctionEnd +16(refer_spec_const_array_length(): 14(int) Function None 15 + 17: Label + 33(len): 32(ptr) Variable Function + Store 33(len) 28(spec_int) + 34: 14(int) Load 33(len) + ReturnValue 34 + FunctionEnd +18(declare_spec_const_in_func(): 2 Function None 3 + 19: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.specConstantOperations.vert.out b/deps/glslang/Test/baseResults/spv.specConstantOperations.vert.out new file mode 100644 index 00000000..0f141e38 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.specConstantOperations.vert.out @@ -0,0 +1,261 @@ +spv.specConstantOperations.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 162 + + Capability Shader + Capability Float64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" + Source GLSL 450 + Name 4 "main" + Name 8 "non_const_array_size_from_spec_const(" + Name 11 "i" + Name 19 "sp_int" + Name 27 "array" + Name 40 "sp_float" + Name 42 "sp_uint" + Name 43 "sp_sint" + Name 45 "sp_double" + Name 46 "float_from_double" + Name 47 "double_from_float" + Name 49 "bool_from_int" + Name 50 "bool_from_uint" + Name 51 "int_from_bool" + Name 53 "uint_from_bool" + Name 54 "sp_uint_from_sint" + Name 55 "sp_sint_from_uint" + Name 56 "negate_int" + Name 57 "not_int" + Name 58 "sp_int_add_two" + Name 61 "sp_int_add_two_sub_three" + Name 63 "sp_int_add_two_sub_four" + Name 64 "sp_sint_mul_two" + Name 66 "sp_uint_mul_two" + Name 68 "sp_sint_mul_two_div_five" + Name 70 "sp_uint_mul_two_div_five" + Name 71 "sp_sint_rem_four" + Name 73 "sp_uint_rem_four" + Name 75 "sp_sint_mul_three_div_five" + Name 77 "sp_sint_shift_right_arithmetic" + Name 79 "sp_uint_shift_right_arithmetic" + Name 80 "sp_sint_shift_left" + Name 81 "sp_uint_shift_left" + Name 83 "sp_sint_or_256" + Name 85 "sp_uint_xor_512" + Name 86 "sp_int_lt_sp_sint" + Name 87 "sp_uint_equal_sp_uint" + Name 88 "sp_int_gt_sp_sint" + Name 91 "iv" + Name 95 "uv" + Name 98 "bv_from_iv" + Name 99 "bv_from_uv" + Name 102 "iv_from_bv" + Name 104 "uv_from_bv" + Name 105 "uv_from_iv" + Name 106 "iv_from_uv" + Name 107 "not_iv" + Name 108 "negate_iv" + Name 110 "iv_add_two" + Name 113 "iv_add_two_sub_three" + Name 115 "iv_add_two_sub_four" + Name 116 "iv_mul_two" + Name 118 "iv_mul_two_div_five" + Name 119 "iv_rem_four" + Name 121 "iv_shift_right_arithmetic" + Name 122 "iv_shift_left" + Name 125 "iv_or_1024" + Name 128 "uv_xor_2048" + Name 129 "iv_x" + Name 131 "iv_yx" + Name 133 "iv_zyx" + Name 134 "iv_yzxw" + Name 135 "a" + Name 136 "b" + Name 137 "c" + Name 142 "ternayArray1" + Name 145 "t1" + Name 146 "t2" + Name 148 "t3" + Name 152 "t4" + Name 161 "v2" + Decorate 19(sp_int) SpecId 201 + Decorate 40(sp_float) SpecId 200 + Decorate 42(sp_uint) SpecId 202 + Decorate 43(sp_sint) SpecId 203 + Decorate 45(sp_double) SpecId 204 + Decorate 135(a) SpecId 210 + Decorate 136(b) SpecId 211 + Decorate 137(c) SpecId 212 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeFunction 6(int) + 10: TypePointer Function 6(int) + 12: 6(int) Constant 0 + 19(sp_int): 6(int) SpecConstant 10 + 20: 6(int) Constant 2 + 21: 6(int) SpecConstantOp 128 19(sp_int) 20 + 22: TypeBool + 24: 6(int) SpecConstantOp 128 19(sp_int) 20 + 25: TypeArray 6(int) 24 + 26: TypePointer Function 25 + 29: 6(int) Constant 1023 + 32: 6(int) Constant 1 + 34: 6(int) SpecConstantOp 128 19(sp_int) 32 + 39: TypeFloat 32 + 40(sp_float): 39(float) SpecConstant 1078530010 + 41: TypeInt 32 0 + 42(sp_uint): 41(int) SpecConstant 100 + 43(sp_sint): 6(int) SpecConstant 4294967286 + 44: TypeFloat 64 + 45(sp_double):44(float64_t) SpecConstant 2333366019 1074118410 +46(float_from_double): 39(float) SpecConstantOp 115 45(sp_double) +47(double_from_float):44(float64_t) SpecConstantOp 115 40(sp_float) + 48: 41(int) Constant 0 +49(bool_from_int): 22(bool) SpecConstantOp 171 19(sp_int) 48 +50(bool_from_uint): 22(bool) SpecConstantOp 171 42(sp_uint) 48 +51(int_from_bool): 6(int) SpecConstantOp 169 49(bool_from_int) 32 12 + 52: 41(int) Constant 1 +53(uint_from_bool): 41(int) SpecConstantOp 169 49(bool_from_int) 52 48 +54(sp_uint_from_sint): 41(int) SpecConstantOp 128 43(sp_sint) 48 +55(sp_sint_from_uint): 6(int) SpecConstantOp 128 42(sp_uint) 48 + 56(negate_int): 6(int) SpecConstantOp 126 19(sp_int) + 57(not_int): 6(int) SpecConstantOp 200 19(sp_int) +58(sp_int_add_two): 6(int) SpecConstantOp 128 19(sp_int) 20 + 59: 6(int) SpecConstantOp 128 19(sp_int) 20 + 60: 6(int) Constant 3 +61(sp_int_add_two_sub_three): 6(int) SpecConstantOp 130 59 60 + 62: 6(int) Constant 4 +63(sp_int_add_two_sub_four): 6(int) SpecConstantOp 130 58(sp_int_add_two) 62 +64(sp_sint_mul_two): 6(int) SpecConstantOp 132 43(sp_sint) 20 + 65: 41(int) Constant 2 +66(sp_uint_mul_two): 41(int) SpecConstantOp 132 42(sp_uint) 65 + 67: 6(int) Constant 5 +68(sp_sint_mul_two_div_five): 6(int) SpecConstantOp 135 64(sp_sint_mul_two) 67 + 69: 41(int) Constant 5 +70(sp_uint_mul_two_div_five): 41(int) SpecConstantOp 134 66(sp_uint_mul_two) 69 +71(sp_sint_rem_four): 6(int) SpecConstantOp 139 43(sp_sint) 62 + 72: 41(int) Constant 4 +73(sp_uint_rem_four): 41(int) SpecConstantOp 137 42(sp_uint) 72 + 74: 6(int) SpecConstantOp 132 43(sp_sint) 60 +75(sp_sint_mul_three_div_five): 6(int) SpecConstantOp 135 74 67 + 76: 6(int) Constant 10 +77(sp_sint_shift_right_arithmetic): 6(int) SpecConstantOp 195 43(sp_sint) 76 + 78: 6(int) Constant 20 +79(sp_uint_shift_right_arithmetic): 41(int) SpecConstantOp 194 42(sp_uint) 78 +80(sp_sint_shift_left): 6(int) SpecConstantOp 196 43(sp_sint) 32 +81(sp_uint_shift_left): 41(int) SpecConstantOp 196 42(sp_uint) 20 + 82: 6(int) Constant 256 +83(sp_sint_or_256): 6(int) SpecConstantOp 197 43(sp_sint) 82 + 84: 41(int) Constant 512 +85(sp_uint_xor_512): 41(int) SpecConstantOp 198 42(sp_uint) 84 +86(sp_int_lt_sp_sint): 22(bool) SpecConstantOp 177 19(sp_int) 43(sp_sint) +87(sp_uint_equal_sp_uint): 22(bool) SpecConstantOp 170 42(sp_uint) 42(sp_uint) +88(sp_int_gt_sp_sint): 22(bool) SpecConstantOp 173 19(sp_int) 43(sp_sint) + 89: 6(int) Constant 30 + 90: TypeVector 6(int) 4 + 91(iv): 90(ivec4) SpecConstantComposite 78 89 19(sp_int) 19(sp_int) + 92: 41(int) Constant 4294967295 + 93: 41(int) Constant 4294967294 + 94: TypeVector 41(int) 4 + 95(uv): 94(ivec4) SpecConstantComposite 42(sp_uint) 42(sp_uint) 92 93 + 96: TypeVector 22(bool) 4 + 97: 94(ivec4) ConstantComposite 48 48 48 48 + 98(bv_from_iv): 96(bvec4) SpecConstantOp 171 91(iv) 97 + 99(bv_from_uv): 96(bvec4) SpecConstantOp 171 95(uv) 97 + 100: 90(ivec4) ConstantComposite 12 12 12 12 + 101: 90(ivec4) ConstantComposite 32 32 32 32 + 102(iv_from_bv): 90(ivec4) SpecConstantOp 169 98(bv_from_iv) 101 100 + 103: 94(ivec4) ConstantComposite 52 52 52 52 + 104(uv_from_bv): 94(ivec4) SpecConstantOp 169 98(bv_from_iv) 103 97 + 105(uv_from_iv): 94(ivec4) SpecConstantOp 128 91(iv) 97 + 106(iv_from_uv): 90(ivec4) SpecConstantOp 128 95(uv) 97 + 107(not_iv): 90(ivec4) SpecConstantOp 200 91(iv) + 108(negate_iv): 90(ivec4) SpecConstantOp 126 91(iv) + 109: 90(ivec4) ConstantComposite 20 20 20 20 + 110(iv_add_two): 90(ivec4) SpecConstantOp 128 91(iv) 109 + 111: 90(ivec4) SpecConstantOp 128 91(iv) 109 + 112: 90(ivec4) ConstantComposite 60 60 60 60 +113(iv_add_two_sub_three): 90(ivec4) SpecConstantOp 130 111 112 + 114: 90(ivec4) ConstantComposite 62 62 62 62 +115(iv_add_two_sub_four): 90(ivec4) SpecConstantOp 130 113(iv_add_two_sub_three) 114 + 116(iv_mul_two): 90(ivec4) SpecConstantOp 132 91(iv) 109 + 117: 90(ivec4) ConstantComposite 67 67 67 67 +118(iv_mul_two_div_five): 90(ivec4) SpecConstantOp 135 116(iv_mul_two) 117 +119(iv_rem_four): 90(ivec4) SpecConstantOp 139 91(iv) 114 + 120: 90(ivec4) ConstantComposite 76 76 76 76 +121(iv_shift_right_arithmetic): 90(ivec4) SpecConstantOp 195 91(iv) 120 +122(iv_shift_left): 90(ivec4) SpecConstantOp 196 91(iv) 109 + 123: 6(int) Constant 1024 + 124: 90(ivec4) ConstantComposite 123 123 123 123 + 125(iv_or_1024): 90(ivec4) SpecConstantOp 197 91(iv) 124 + 126: 41(int) Constant 2048 + 127: 94(ivec4) ConstantComposite 126 126 126 126 +128(uv_xor_2048): 94(ivec4) SpecConstantOp 198 95(uv) 127 + 129(iv_x): 6(int) SpecConstantOp 81 91(iv) 0 + 130: TypeVector 6(int) 2 + 131(iv_yx): 130(ivec2) SpecConstantOp 79 91(iv) 91(iv) 1(GLSL.std.450) 0 + 132: TypeVector 6(int) 3 + 133(iv_zyx): 132(ivec3) SpecConstantOp 79 91(iv) 91(iv) 2 1(GLSL.std.450) 0 + 134(iv_yzxw): 90(ivec4) SpecConstantOp 79 91(iv) 91(iv) 1(GLSL.std.450) 2 0 3 + 135(a): 6(int) SpecConstant 4 + 136(b): 6(int) SpecConstant 6 + 137(c): 22(bool) SpecConstantTrue + 138: 22(bool) SpecConstantOp 173 135(a) 136(b) + 139: 6(int) SpecConstantOp 169 138 135(a) 136(b) + 140: TypeArray 6(int) 139 + 141: TypePointer Private 140 +142(ternayArray1): 141(ptr) Variable Private + 143: 6(int) Constant 13 + 144: 6(int) Constant 17 + 145(t1): 6(int) SpecConstantOp 169 137(c) 143 144 + 146(t2): 6(int) SpecConstantOp 169 137(c) 135(a) 144 + 147: 22(bool) ConstantTrue + 148(t3): 6(int) SpecConstantOp 169 147 135(a) 144 + 149: 22(bool) SpecConstantOp 173 135(a) 136(b) + 150: 6(int) SpecConstantOp 128 143 135(a) + 151: 6(int) SpecConstantOp 132 144 136(b) + 152(t4): 6(int) SpecConstantOp 169 149 150 151 + 153: 22(bool) SpecConstantOp 168 137(c) + 154: TypeVector 39(float) 2 + 155: 39(float) Constant 1065353216 + 156: 154(fvec2) ConstantComposite 155 155 + 157: 39(float) Constant 1073741824 + 158: 154(fvec2) ConstantComposite 157 157 + 159: TypeVector 22(bool) 2 + 160: 159(bvec2) SpecConstantComposite 153 153 + 161(v2): 154(fvec2) SpecConstantOp 169 160 156 158 + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd +8(non_const_array_size_from_spec_const(): 6(int) Function None 7 + 9: Label + 11(i): 10(ptr) Variable Function + 27(array): 26(ptr) Variable Function + Store 11(i) 12 + Branch 13 + 13: Label + LoopMerge 15 16 None + Branch 17 + 17: Label + 18: 6(int) Load 11(i) + 23: 22(bool) SLessThan 18 21 + BranchConditional 23 14 15 + 14: Label + 28: 6(int) Load 11(i) + 30: 10(ptr) AccessChain 27(array) 28 + Store 30 29 + Branch 16 + 16: Label + 31: 6(int) Load 11(i) + 33: 6(int) IAdd 31 32 + Store 11(i) 33 + Branch 13 + 15: Label + 35: 10(ptr) AccessChain 27(array) 34 + 36: 6(int) Load 35 + ReturnValue 36 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.ssbo.autoassign.frag.out b/deps/glslang/Test/baseResults/spv.ssbo.autoassign.frag.out new file mode 100644 index 00000000..40afa15f --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.ssbo.autoassign.frag.out @@ -0,0 +1,156 @@ +spv.ssbo.autoassign.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 99 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 92 95 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vf4;" + Name 10 "pos" + Name 13 "vTmp" + Name 14 "BufType" + MemberName 14(BufType) 0 "va" + MemberName 14(BufType) 1 "vb" + Name 16 "SB0" + MemberName 16(SB0) 0 "@data" + Name 18 "SB0" + Name 26 "TestCB" + MemberName 26(TestCB) 0 "W" + MemberName 26(TestCB) 1 "H" + Name 28 "" + Name 57 "SB1" + MemberName 57(SB1) 0 "@data" + Name 59 "SB1" + Name 90 "pos" + Name 92 "pos" + Name 95 "@entryPointOutput" + Name 96 "param" + MemberDecorate 14(BufType) 0 Offset 0 + MemberDecorate 14(BufType) 1 Offset 16 + Decorate 15 ArrayStride 32 + MemberDecorate 16(SB0) 0 NonWritable + MemberDecorate 16(SB0) 0 Offset 0 + Decorate 16(SB0) BufferBlock + Decorate 18(SB0) DescriptorSet 0 + Decorate 18(SB0) Binding 30 + MemberDecorate 26(TestCB) 0 Offset 0 + MemberDecorate 26(TestCB) 1 Offset 4 + Decorate 26(TestCB) Block + Decorate 28 DescriptorSet 0 + Decorate 28 Binding 15 + Decorate 56 ArrayStride 32 + MemberDecorate 57(SB1) 0 Offset 0 + Decorate 57(SB1) BufferBlock + Decorate 59(SB1) DescriptorSet 0 + Decorate 59(SB1) Binding 31 + Decorate 92(pos) Location 0 + Decorate 95(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) + 14(BufType): TypeStruct 7(fvec4) 7(fvec4) + 15: TypeRuntimeArray 14(BufType) + 16(SB0): TypeStruct 15 + 17: TypePointer Uniform 16(SB0) + 18(SB0): 17(ptr) Variable Uniform + 19: TypeInt 32 1 + 20: 19(int) Constant 0 + 21: TypeInt 32 0 + 22: 21(int) Constant 1 + 23: TypePointer Function 6(float) + 26(TestCB): TypeStruct 21(int) 21(int) + 27: TypePointer Uniform 26(TestCB) + 28: 27(ptr) Variable Uniform + 29: TypePointer Uniform 21(int) + 34: 21(int) Constant 0 + 39: TypePointer Uniform 7(fvec4) + 52: 19(int) Constant 1 + 56: TypeRuntimeArray 14(BufType) + 57(SB1): TypeStruct 56 + 58: TypePointer Uniform 57(SB1) + 59(SB1): 58(ptr) Variable Uniform + 91: TypePointer Input 7(fvec4) + 92(pos): 91(ptr) Variable Input + 94: TypePointer Output 7(fvec4) +95(@entryPointOutput): 94(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 90(pos): 8(ptr) Variable Function + 96(param): 8(ptr) Variable Function + 93: 7(fvec4) Load 92(pos) + Store 90(pos) 93 + 97: 7(fvec4) Load 90(pos) + Store 96(param) 97 + 98: 7(fvec4) FunctionCall 11(@main(vf4;) 96(param) + Store 95(@entryPointOutput) 98 + Return + FunctionEnd + 11(@main(vf4;): 7(fvec4) Function None 9 + 10(pos): 8(ptr) FunctionParameter + 12: Label + 13(vTmp): 8(ptr) Variable Function + 24: 23(ptr) AccessChain 10(pos) 22 + 25: 6(float) Load 24 + 30: 29(ptr) AccessChain 28 20 + 31: 21(int) Load 30 + 32: 6(float) ConvertUToF 31 + 33: 6(float) FMul 25 32 + 35: 23(ptr) AccessChain 10(pos) 34 + 36: 6(float) Load 35 + 37: 6(float) FAdd 33 36 + 38: 21(int) ConvertFToU 37 + 40: 39(ptr) AccessChain 18(SB0) 20 38 20 + 41: 7(fvec4) Load 40 + 42: 23(ptr) AccessChain 10(pos) 22 + 43: 6(float) Load 42 + 44: 29(ptr) AccessChain 28 20 + 45: 21(int) Load 44 + 46: 6(float) ConvertUToF 45 + 47: 6(float) FMul 43 46 + 48: 23(ptr) AccessChain 10(pos) 34 + 49: 6(float) Load 48 + 50: 6(float) FAdd 47 49 + 51: 21(int) ConvertFToU 50 + 53: 39(ptr) AccessChain 18(SB0) 20 51 52 + 54: 7(fvec4) Load 53 + 55: 7(fvec4) FAdd 41 54 + Store 13(vTmp) 55 + 60: 23(ptr) AccessChain 10(pos) 22 + 61: 6(float) Load 60 + 62: 29(ptr) AccessChain 28 20 + 63: 21(int) Load 62 + 64: 6(float) ConvertUToF 63 + 65: 6(float) FMul 61 64 + 66: 23(ptr) AccessChain 10(pos) 34 + 67: 6(float) Load 66 + 68: 6(float) FAdd 65 67 + 69: 21(int) ConvertFToU 68 + 70: 39(ptr) AccessChain 59(SB1) 20 69 20 + 71: 7(fvec4) Load 70 + 72: 23(ptr) AccessChain 10(pos) 22 + 73: 6(float) Load 72 + 74: 29(ptr) AccessChain 28 20 + 75: 21(int) Load 74 + 76: 6(float) ConvertUToF 75 + 77: 6(float) FMul 73 76 + 78: 23(ptr) AccessChain 10(pos) 34 + 79: 6(float) Load 78 + 80: 6(float) FAdd 77 79 + 81: 21(int) ConvertFToU 80 + 82: 39(ptr) AccessChain 59(SB1) 20 81 52 + 83: 7(fvec4) Load 82 + 84: 7(fvec4) FAdd 71 83 + 85: 7(fvec4) Load 13(vTmp) + 86: 7(fvec4) FAdd 85 84 + Store 13(vTmp) 86 + 87: 7(fvec4) Load 13(vTmp) + ReturnValue 87 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.ssboAlias.frag.out b/deps/glslang/Test/baseResults/spv.ssboAlias.frag.out new file mode 100644 index 00000000..f03d2ca9 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.ssboAlias.frag.out @@ -0,0 +1,86 @@ +spv.ssboAlias.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 44 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 41 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 13 "Buf1" + MemberName 13(Buf1) 0 "@data" + Name 15 "Buf1" + Name 18 "Buf1@count" + MemberName 18(Buf1@count) 0 "@count" + Name 20 "Buf1@count" + Name 28 "Buf2" + Name 29 "Buf2@count" + Name 41 "@entryPointOutput" + Name 43 "Buf3" + Decorate 12 ArrayStride 4 + MemberDecorate 13(Buf1) 0 Offset 0 + Decorate 13(Buf1) BufferBlock + Decorate 15(Buf1) DescriptorSet 0 + Decorate 15(Buf1) Binding 84 + MemberDecorate 18(Buf1@count) 0 Offset 0 + Decorate 18(Buf1@count) BufferBlock + Decorate 20(Buf1@count) DescriptorSet 0 + Decorate 20(Buf1@count) Binding 83 + Decorate 28(Buf2) DescriptorSet 0 + Decorate 28(Buf2) Binding 85 + Decorate 29(Buf2@count) DescriptorSet 0 + Decorate 29(Buf2@count) Binding 86 + Decorate 41(@entryPointOutput) Location 0 + Decorate 43(Buf3) DescriptorSet 0 + Decorate 43(Buf3) Binding 84 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeInt 32 0 + 12: TypeRuntimeArray 11(int) + 13(Buf1): TypeStruct 12 + 14: TypePointer Uniform 13(Buf1) + 15(Buf1): 14(ptr) Variable Uniform + 16: TypeInt 32 1 + 17: 16(int) Constant 0 + 18(Buf1@count): TypeStruct 11(int) + 19: TypePointer Uniform 18(Buf1@count) + 20(Buf1@count): 19(ptr) Variable Uniform + 21: TypePointer Uniform 11(int) + 23: 11(int) Constant 1 + 24: 11(int) Constant 0 + 26: 11(int) Constant 10 + 28(Buf2): 14(ptr) Variable Uniform + 29(Buf2@count): 19(ptr) Variable Uniform + 32: 11(int) Constant 20 + 34: 6(float) Constant 1065353216 + 35: 6(float) Constant 1077936128 + 36: 6(float) Constant 1084227584 + 37: 7(fvec4) ConstantComposite 34 35 36 34 + 40: TypePointer Output 7(fvec4) +41(@entryPointOutput): 40(ptr) Variable Output + 43(Buf3): 14(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + 42: 7(fvec4) FunctionCall 9(@main() + Store 41(@entryPointOutput) 42 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 22: 21(ptr) AccessChain 20(Buf1@count) 17 + 25: 11(int) AtomicIAdd 22 23 24 23 + 27: 21(ptr) AccessChain 15(Buf1) 17 25 + Store 27 26 + 30: 21(ptr) AccessChain 29(Buf2@count) 17 + 31: 11(int) AtomicIAdd 30 23 24 23 + 33: 21(ptr) AccessChain 28(Buf2) 17 31 + Store 33 32 + ReturnValue 37 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.stereoViewRendering.tesc.out b/deps/glslang/Test/baseResults/spv.stereoViewRendering.tesc.out new file mode 100644 index 00000000..732e5b4c --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.stereoViewRendering.tesc.out @@ -0,0 +1,90 @@ +spv.stereoViewRendering.tesc +error: SPIRV-Tools Validation Errors +error: When BuiltIn decoration is applied to a structure-type member, all members of that structure type must also be decorated with BuiltIn (No allowed mixing of built-in variables and non-built-in variables within a single structure). Structure id 27 does not meet this requirement. + %gl_PerVertex_0 = OpTypeStruct %v4float %float %_arr_float_uint_1 %_arr_float_uint_1 %v4float + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 38 + + Capability Geometry + Capability Tessellation + Capability ShaderViewportIndexLayerNV + Capability ShaderViewportMaskNV + Capability ShaderStereoViewNV + Extension "SPV_EXT_shader_viewport_index_layer" + Extension "SPV_NV_stereo_view_rendering" + Extension "SPV_NV_viewport_array2" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "main" 16 18 31 37 + ExecutionMode 4 OutputVertices 4 + Source GLSL 450 + SourceExtension "GL_NV_stereo_view_rendering" + SourceExtension "GL_NV_viewport_array2" + Name 4 "main" + Name 12 "gl_PerVertex" + MemberName 12(gl_PerVertex) 0 "gl_SecondaryPositionNV" + MemberName 12(gl_PerVertex) 1 "gl_SecondaryViewportMaskNV" + Name 16 "gl_out" + Name 18 "gl_InvocationID" + Name 27 "gl_PerVertex" + MemberName 27(gl_PerVertex) 0 "gl_Position" + MemberName 27(gl_PerVertex) 1 "gl_PointSize" + MemberName 27(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 27(gl_PerVertex) 3 "gl_CullDistance" + MemberName 27(gl_PerVertex) 4 "gl_SecondaryPositionNV" + Name 31 "gl_in" + Name 37 "gl_Layer" + MemberDecorate 12(gl_PerVertex) 0 BuiltIn SecondaryPositionNV + MemberDecorate 12(gl_PerVertex) 1 BuiltIn SecondaryViewportMaskNV + Decorate 12(gl_PerVertex) Block + Decorate 18(gl_InvocationID) BuiltIn InvocationId + MemberDecorate 27(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 27(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 27(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 27(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 27(gl_PerVertex) Block + Decorate 37(gl_Layer) BuiltIn Layer + Decorate 37(gl_Layer) ViewportRelativeNV + Decorate 37(gl_Layer) SecondaryViewportRelativeNV 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 1 + 9: TypeInt 32 0 + 10: 9(int) Constant 2 + 11: TypeArray 8(int) 10 +12(gl_PerVertex): TypeStruct 7(fvec4) 11 + 13: 9(int) Constant 4 + 14: TypeArray 12(gl_PerVertex) 13 + 15: TypePointer Output 14 + 16(gl_out): 15(ptr) Variable Output + 17: TypePointer Input 8(int) +18(gl_InvocationID): 17(ptr) Variable Input + 20: 8(int) Constant 1 + 21: 8(int) Constant 0 + 22: TypePointer Output 8(int) + 25: 9(int) Constant 1 + 26: TypeArray 6(float) 25 +27(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 26 26 7(fvec4) + 28: 9(int) Constant 32 + 29: TypeArray 27(gl_PerVertex) 28 + 30: TypePointer Input 29 + 31(gl_in): 30(ptr) Variable Input + 32: TypePointer Input 7(fvec4) + 35: TypePointer Output 7(fvec4) + 37(gl_Layer): 22(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 19: 8(int) Load 18(gl_InvocationID) + 23: 22(ptr) AccessChain 16(gl_out) 19 20 21 + Store 23 20 + 24: 8(int) Load 18(gl_InvocationID) + 33: 32(ptr) AccessChain 31(gl_in) 20 21 + 34: 7(fvec4) Load 33 + 36: 35(ptr) AccessChain 16(gl_out) 24 21 + Store 36 34 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.stereoViewRendering.vert.out b/deps/glslang/Test/baseResults/spv.stereoViewRendering.vert.out new file mode 100644 index 00000000..afd8c75a --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.stereoViewRendering.vert.out @@ -0,0 +1,68 @@ +spv.stereoViewRendering.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 27 + + Capability Shader + Capability Geometry + Capability ShaderViewportIndexLayerNV + Capability ShaderViewportMaskNV + Capability ShaderStereoViewNV + Extension "SPV_EXT_shader_viewport_index_layer" + Extension "SPV_NV_stereo_view_rendering" + Extension "SPV_NV_viewport_array2" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 11 19 23 26 + Source GLSL 450 + SourceExtension "GL_NV_stereo_view_rendering" + SourceExtension "GL_NV_viewport_array2" + Name 4 "main" + Name 11 "gl_SecondaryViewportMaskNV" + Name 19 "gl_SecondaryPositionNV" + Name 21 "gl_PerVertex" + MemberName 21(gl_PerVertex) 0 "gl_Position" + MemberName 21(gl_PerVertex) 1 "gl_PointSize" + MemberName 21(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 21(gl_PerVertex) 3 "gl_CullDistance" + Name 23 "" + Name 26 "gl_Layer" + Decorate 11(gl_SecondaryViewportMaskNV) BuiltIn SecondaryViewportMaskNV + Decorate 19(gl_SecondaryPositionNV) BuiltIn SecondaryPositionNV + MemberDecorate 21(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 21(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 21(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 21(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 21(gl_PerVertex) Block + Decorate 26(gl_Layer) BuiltIn Layer + Decorate 26(gl_Layer) ViewportRelativeNV + Decorate 26(gl_Layer) SecondaryViewportRelativeNV 2 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeInt 32 0 + 8: 7(int) Constant 1 + 9: TypeArray 6(int) 8 + 10: TypePointer Output 9 +11(gl_SecondaryViewportMaskNV): 10(ptr) Variable Output + 12: 6(int) Constant 0 + 13: 6(int) Constant 1 + 14: TypePointer Output 6(int) + 16: TypeFloat 32 + 17: TypeVector 16(float) 4 + 18: TypePointer Output 17(fvec4) +19(gl_SecondaryPositionNV): 18(ptr) Variable Output + 20: TypeArray 16(float) 8 +21(gl_PerVertex): TypeStruct 17(fvec4) 16(float) 20 20 + 22: TypePointer Output 21(gl_PerVertex) + 23: 22(ptr) Variable Output + 26(gl_Layer): 14(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 15: 14(ptr) AccessChain 11(gl_SecondaryViewportMaskNV) 12 + Store 15 13 + 24: 18(ptr) AccessChain 23 12 + 25: 17(fvec4) Load 24 + Store 19(gl_SecondaryPositionNV) 25 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.storageBuffer.vert.out b/deps/glslang/Test/baseResults/spv.storageBuffer.vert.out new file mode 100644 index 00000000..71c3bf28 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.storageBuffer.vert.out @@ -0,0 +1,67 @@ +spv.storageBuffer.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 31 + + Capability Shader + Extension "SPV_KHR_storage_buffer_storage_class" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 13 + Source GLSL 450 + Name 4 "main" + Name 11 "gl_PerVertex" + MemberName 11(gl_PerVertex) 0 "gl_Position" + MemberName 11(gl_PerVertex) 1 "gl_PointSize" + MemberName 11(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 11(gl_PerVertex) 3 "gl_CullDistance" + Name 13 "" + Name 16 "ub" + MemberName 16(ub) 0 "a" + Name 18 "ubi" + Name 22 "bb" + MemberName 22(bb) 0 "b" + Name 24 "bbi" + MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 11(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 11(gl_PerVertex) Block + MemberDecorate 16(ub) 0 Offset 0 + Decorate 16(ub) Block + Decorate 18(ubi) DescriptorSet 0 + MemberDecorate 22(bb) 0 Offset 0 + Decorate 22(bb) Block + Decorate 24(bbi) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 0 + 9: 8(int) Constant 1 + 10: TypeArray 6(float) 9 +11(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 10 10 + 12: TypePointer Output 11(gl_PerVertex) + 13: 12(ptr) Variable Output + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16(ub): TypeStruct 7(fvec4) + 17: TypePointer Uniform 16(ub) + 18(ubi): 17(ptr) Variable Uniform + 19: TypePointer Uniform 7(fvec4) + 22(bb): TypeStruct 7(fvec4) + 23: TypePointer StorageBuffer 22(bb) + 24(bbi): 23(ptr) Variable StorageBuffer + 25: TypePointer StorageBuffer 7(fvec4) + 29: TypePointer Output 7(fvec4) + 4(main): 2 Function None 3 + 5: Label + 20: 19(ptr) AccessChain 18(ubi) 15 + 21: 7(fvec4) Load 20 + 26: 25(ptr) AccessChain 24(bbi) 15 + 27: 7(fvec4) Load 26 + 28: 7(fvec4) FAdd 21 27 + 30: 29(ptr) AccessChain 13 15 + Store 30 28 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.structAssignment.frag.out b/deps/glslang/Test/baseResults/spv.structAssignment.frag.out new file mode 100644 index 00000000..ec771cc3 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.structAssignment.frag.out @@ -0,0 +1,99 @@ +spv.structAssignment.frag +WARNING: 0:6: '' : all default precisions are highp; use precision statements to quiet warning, e.g.: + "precision mediump int; precision highp float;" + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 50 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 31 44 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 8 "lunarStruct1" + MemberName 8(lunarStruct1) 0 "i" + MemberName 8(lunarStruct1) 1 "f" + Name 9 "lunarStruct2" + MemberName 9(lunarStruct2) 0 "i" + MemberName 9(lunarStruct2) 1 "f" + MemberName 9(lunarStruct2) 2 "s1_1" + Name 10 "lunarStruct3" + MemberName 10(lunarStruct3) 0 "s2_1" + MemberName 10(lunarStruct3) 1 "i" + MemberName 10(lunarStruct3) 2 "f" + MemberName 10(lunarStruct3) 3 "s1_1" + Name 12 "foo3" + Name 22 "locals2" + Name 27 "foo2" + Name 31 "gl_FragColor" + Name 40 "samp2D" + Name 44 "coord" + Name 49 "foo" + MemberDecorate 8(lunarStruct1) 0 RelaxedPrecision + MemberDecorate 9(lunarStruct2) 0 RelaxedPrecision + MemberDecorate 10(lunarStruct3) 1 RelaxedPrecision + Decorate 16 RelaxedPrecision + Decorate 31(gl_FragColor) Location 0 + Decorate 40(samp2D) DescriptorSet 0 + Decorate 44(coord) RelaxedPrecision + Decorate 45 RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeFloat 32 + 8(lunarStruct1): TypeStruct 6(int) 7(float) + 9(lunarStruct2): TypeStruct 6(int) 7(float) 8(lunarStruct1) +10(lunarStruct3): TypeStruct 9(lunarStruct2) 6(int) 7(float) 8(lunarStruct1) + 11: TypePointer Private 10(lunarStruct3) + 12(foo3): 11(ptr) Variable Private + 13: 6(int) Constant 0 + 14: TypePointer Private 6(int) + 17: TypeBool + 21: TypePointer Function 9(lunarStruct2) + 23: TypePointer Private 9(lunarStruct2) + 27(foo2): 23(ptr) Variable Private + 29: TypeVector 7(float) 4 + 30: TypePointer Output 29(fvec4) +31(gl_FragColor): 30(ptr) Variable Output + 32: 6(int) Constant 2 + 33: 6(int) Constant 1 + 34: TypePointer Function 7(float) + 37: TypeImage 7(float) 2D sampled format:Unknown + 38: TypeSampledImage 37 + 39: TypePointer UniformConstant 38 + 40(samp2D): 39(ptr) Variable UniformConstant + 42: TypeVector 7(float) 2 + 43: TypePointer Input 42(fvec2) + 44(coord): 43(ptr) Variable Input + 48: TypePointer Private 8(lunarStruct1) + 49(foo): 48(ptr) Variable Private + 4(main): 2 Function None 3 + 5: Label + 22(locals2): 21(ptr) Variable Function + 15: 14(ptr) AccessChain 12(foo3) 13 13 + 16: 6(int) Load 15 + 18: 17(bool) SGreaterThan 16 13 + SelectionMerge 20 None + BranchConditional 18 19 26 + 19: Label + 24: 23(ptr) AccessChain 12(foo3) 13 + 25:9(lunarStruct2) Load 24 + Store 22(locals2) 25 + Branch 20 + 26: Label + 28:9(lunarStruct2) Load 27(foo2) + Store 22(locals2) 28 + Branch 20 + 20: Label + 35: 34(ptr) AccessChain 22(locals2) 32 33 + 36: 7(float) Load 35 + 41: 38 Load 40(samp2D) + 45: 42(fvec2) Load 44(coord) + 46: 29(fvec4) ImageSampleImplicitLod 41 45 + 47: 29(fvec4) VectorTimesScalar 46 36 + Store 31(gl_FragColor) 47 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.structDeref.frag.out b/deps/glslang/Test/baseResults/spv.structDeref.frag.out new file mode 100644 index 00000000..a7915b40 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.structDeref.frag.out @@ -0,0 +1,188 @@ +spv.structDeref.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 123 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 61 99 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 8 "s0" + MemberName 8(s0) 0 "i" + Name 9 "s1" + MemberName 9(s1) 0 "i" + MemberName 9(s1) 1 "f" + MemberName 9(s1) 2 "s0_1" + Name 10 "s2" + MemberName 10(s2) 0 "i" + MemberName 10(s2) 1 "f" + MemberName 10(s2) 2 "s1_1" + Name 14 "s3" + MemberName 14(s3) 0 "s2_1" + MemberName 14(s3) 1 "i" + MemberName 14(s3) 2 "f" + MemberName 14(s3) 3 "s1_1" + Name 16 "foo3" + Name 27 "locals2" + Name 40 "fArray" + Name 46 "locals1Array" + Name 49 "foo1" + Name 53 "locals0" + Name 54 "s00" + MemberName 54(s00) 0 "s0_0" + Name 56 "locals00" + Name 61 "coord" + Name 71 "foo0" + Name 86 "foo00" + Name 99 "gl_FragColor" + Name 116 "samp2D" + Name 122 "foo2" + Decorate 99(gl_FragColor) Location 0 + Decorate 116(samp2D) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeFloat 32 + 8(s0): TypeStruct 6(int) + 9(s1): TypeStruct 6(int) 7(float) 8(s0) + 10(s2): TypeStruct 6(int) 7(float) 9(s1) + 11: TypeInt 32 0 + 12: 11(int) Constant 12 + 13: TypeArray 10(s2) 12 + 14(s3): TypeStruct 13 6(int) 7(float) 9(s1) + 15: TypePointer Private 14(s3) + 16(foo3): 15(ptr) Variable Private + 17: 6(int) Constant 0 + 18: 6(int) Constant 9 + 19: TypePointer Private 6(int) + 22: TypeBool + 26: TypePointer Function 10(s2) + 28: 6(int) Constant 1 + 29: 7(float) Constant 1065353216 + 30: TypePointer Function 7(float) + 32: 6(int) Constant 2 + 33: 8(s0) ConstantComposite 17 + 34: 9(s1) ConstantComposite 17 29 33 + 35: TypePointer Function 9(s1) + 37: 11(int) Constant 6 + 38: TypeArray 7(float) 37 + 39: TypePointer Function 38 + 41: 7(float) Constant 0 + 42: 38 ConstantComposite 41 41 41 41 41 41 + 43: 11(int) Constant 10 + 44: TypeArray 9(s1) 43 + 45: TypePointer Function 44 + 47: 6(int) Constant 6 + 48: TypePointer Private 9(s1) + 49(foo1): 48(ptr) Variable Private + 52: TypePointer Function 8(s0) + 54(s00): TypeStruct 8(s0) + 55: TypePointer Function 54(s00) + 57: 54(s00) ConstantComposite 33 + 59: TypeVector 7(float) 2 + 60: TypePointer Input 59(fvec2) + 61(coord): 60(ptr) Variable Input + 62: 11(int) Constant 0 + 63: TypePointer Input 7(float) + 67: 11(int) Constant 1 + 70: TypePointer Private 8(s0) + 71(foo0): 70(ptr) Variable Private + 75: 7(float) Constant 1073741824 + 76: 7(float) Constant 1077936128 + 77: 7(float) Constant 1082130432 + 78: 7(float) Constant 1084227584 + 79: 38 ConstantComposite 41 29 75 76 77 78 + 85: TypePointer Private 54(s00) + 86(foo00): 85(ptr) Variable Private + 88: TypePointer Function 6(int) + 91: 6(int) Constant 5 + 97: TypeVector 7(float) 4 + 98: TypePointer Output 97(fvec4) +99(gl_FragColor): 98(ptr) Variable Output + 106: 6(int) Constant 3 + 113: TypeImage 7(float) 2D sampled format:Unknown + 114: TypeSampledImage 113 + 115: TypePointer UniformConstant 114 + 116(samp2D): 115(ptr) Variable UniformConstant + 121: TypePointer Private 10(s2) + 122(foo2): 121(ptr) Variable Private + 4(main): 2 Function None 3 + 5: Label + 27(locals2): 26(ptr) Variable Function + 40(fArray): 39(ptr) Variable Function +46(locals1Array): 45(ptr) Variable Function + 53(locals0): 52(ptr) Variable Function + 56(locals00): 55(ptr) Variable Function + 20: 19(ptr) AccessChain 16(foo3) 17 18 17 + 21: 6(int) Load 20 + 23: 22(bool) SGreaterThan 21 17 + SelectionMerge 25 None + BranchConditional 23 24 58 + 24: Label + 31: 30(ptr) AccessChain 27(locals2) 28 + Store 31 29 + 36: 35(ptr) AccessChain 27(locals2) 32 + Store 36 34 + Store 40(fArray) 42 + 50: 9(s1) Load 49(foo1) + 51: 35(ptr) AccessChain 46(locals1Array) 47 + Store 51 50 + Store 53(locals0) 33 + Store 56(locals00) 57 + Branch 25 + 58: Label + 64: 63(ptr) AccessChain 61(coord) 62 + 65: 7(float) Load 64 + 66: 30(ptr) AccessChain 27(locals2) 28 + Store 66 65 + 68: 63(ptr) AccessChain 61(coord) 67 + 69: 7(float) Load 68 + 72: 8(s0) Load 71(foo0) + 73: 9(s1) CompositeConstruct 28 69 72 + 74: 35(ptr) AccessChain 27(locals2) 32 + Store 74 73 + Store 40(fArray) 79 + 80: 35(ptr) AccessChain 27(locals2) 32 + 81: 9(s1) Load 80 + 82: 35(ptr) AccessChain 46(locals1Array) 47 + Store 82 81 + 83: 70(ptr) AccessChain 49(foo1) 32 + 84: 8(s0) Load 83 + Store 53(locals0) 84 + 87: 54(s00) Load 86(foo00) + Store 56(locals00) 87 + Branch 25 + 25: Label + 89: 88(ptr) AccessChain 53(locals0) 17 + 90: 6(int) Load 89 + 92: 22(bool) SGreaterThan 90 91 + SelectionMerge 94 None + BranchConditional 92 93 94 + 93: Label + 95: 52(ptr) AccessChain 56(locals00) 17 + 96: 8(s0) Load 95 + Store 53(locals0) 96 + Branch 94 + 94: Label + 100: 88(ptr) AccessChain 53(locals0) 17 + 101: 6(int) Load 100 + 102: 7(float) ConvertSToF 101 + 103: 30(ptr) AccessChain 46(locals1Array) 47 28 + 104: 7(float) Load 103 + 105: 7(float) FAdd 102 104 + 107: 30(ptr) AccessChain 40(fArray) 106 + 108: 7(float) Load 107 + 109: 7(float) FAdd 105 108 + 110: 30(ptr) AccessChain 27(locals2) 32 28 + 111: 7(float) Load 110 + 112: 7(float) FAdd 109 111 + 117: 114 Load 116(samp2D) + 118: 59(fvec2) Load 61(coord) + 119: 97(fvec4) ImageSampleImplicitLod 117 118 + 120: 97(fvec4) VectorTimesScalar 119 112 + Store 99(gl_FragColor) 120 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.structure.frag.out b/deps/glslang/Test/baseResults/spv.structure.frag.out new file mode 100644 index 00000000..0592084b --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.structure.frag.out @@ -0,0 +1,96 @@ +spv.structure.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 60 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 45 54 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 8 "scale" + Name 18 "lunarStruct1" + MemberName 18(lunarStruct1) 0 "i" + MemberName 18(lunarStruct1) 1 "f" + MemberName 18(lunarStruct1) 2 "color" + Name 21 "lunarStruct2" + MemberName 21(lunarStruct2) 0 "i" + MemberName 21(lunarStruct2) 1 "f" + MemberName 21(lunarStruct2) 2 "s1_1" + Name 24 "foo2" + Name 45 "gl_FragColor" + Name 50 "samp2D" + Name 54 "coord" + Name 59 "foo" + Decorate 45(gl_FragColor) Location 0 + Decorate 50(samp2D) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 9: 6(float) Constant 0 + 10: TypeInt 32 1 + 11: TypeInt 32 0 + 12: 11(int) Constant 5 + 13: TypeArray 10(int) 12 + 14: 11(int) Constant 4 + 15: TypeArray 6(float) 14 + 16: TypeVector 6(float) 4 + 17: TypeArray 16(fvec4) 12 +18(lunarStruct1): TypeStruct 10(int) 15 17 + 19: 11(int) Constant 7 + 20: TypeArray 18(lunarStruct1) 19 +21(lunarStruct2): TypeStruct 13 6(float) 20 + 22: TypeArray 21(lunarStruct2) 12 + 23: TypePointer Private 22 + 24(foo2): 23(ptr) Variable Private + 25: 10(int) Constant 3 + 26: 10(int) Constant 0 + 27: 10(int) Constant 4 + 28: TypePointer Private 10(int) + 31: TypeBool + 35: 10(int) Constant 2 + 36: 11(int) Constant 0 + 37: TypePointer Private 6(float) + 41: 10(int) Constant 1 + 44: TypePointer Output 16(fvec4) +45(gl_FragColor): 44(ptr) Variable Output + 47: TypeImage 6(float) 2D sampled format:Unknown + 48: TypeSampledImage 47 + 49: TypePointer UniformConstant 48 + 50(samp2D): 49(ptr) Variable UniformConstant + 52: TypeVector 6(float) 2 + 53: TypePointer Input 52(fvec2) + 54(coord): 53(ptr) Variable Input + 58: TypePointer Private 18(lunarStruct1) + 59(foo): 58(ptr) Variable Private + 4(main): 2 Function None 3 + 5: Label + 8(scale): 7(ptr) Variable Function + Store 8(scale) 9 + 29: 28(ptr) AccessChain 24(foo2) 25 26 27 + 30: 10(int) Load 29 + 32: 31(bool) SGreaterThan 30 26 + SelectionMerge 34 None + BranchConditional 32 33 40 + 33: Label + 38: 37(ptr) AccessChain 24(foo2) 25 35 35 35 25 36 + 39: 6(float) Load 38 + Store 8(scale) 39 + Branch 34 + 40: Label + 42: 37(ptr) AccessChain 24(foo2) 25 35 35 41 25 + 43: 6(float) Load 42 + Store 8(scale) 43 + Branch 34 + 34: Label + 46: 6(float) Load 8(scale) + 51: 48 Load 50(samp2D) + 55: 52(fvec2) Load 54(coord) + 56: 16(fvec4) ImageSampleImplicitLod 51 55 + 57: 16(fvec4) VectorTimesScalar 56 46 + Store 45(gl_FragColor) 57 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.subgroup.frag.out b/deps/glslang/Test/baseResults/spv.subgroup.frag.out new file mode 100644 index 00000000..4dd636e5 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.subgroup.frag.out @@ -0,0 +1,44 @@ +spv.subgroup.frag +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 17 + + Capability Shader + Capability GroupNonUniform + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 11 13 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + Name 4 "main" + Name 9 "data" + Name 11 "gl_SubgroupSize" + Name 13 "gl_SubgroupInvocationID" + Decorate 9(data) Location 0 + Decorate 11(gl_SubgroupSize) RelaxedPrecision + Decorate 11(gl_SubgroupSize) Flat + Decorate 11(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 12 RelaxedPrecision + Decorate 13(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 13(gl_SubgroupInvocationID) Flat + Decorate 13(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 14 RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 4 + 8: TypePointer Output 7(ivec4) + 9(data): 8(ptr) Variable Output + 10: TypePointer Input 6(int) +11(gl_SubgroupSize): 10(ptr) Variable Input +13(gl_SubgroupInvocationID): 10(ptr) Variable Input + 15: 6(int) Constant 0 + 4(main): 2 Function None 3 + 5: Label + 12: 6(int) Load 11(gl_SubgroupSize) + 14: 6(int) Load 13(gl_SubgroupInvocationID) + 16: 7(ivec4) CompositeConstruct 12 14 15 15 + Store 9(data) 16 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.subgroup.geom.out b/deps/glslang/Test/baseResults/spv.subgroup.geom.out new file mode 100644 index 00000000..a68343af --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.subgroup.geom.out @@ -0,0 +1,62 @@ +spv.subgroup.geom +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 26 + + Capability Geometry + Capability GroupNonUniform + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 15 18 20 + ExecutionMode 4 InputPoints + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputPoints + ExecutionMode 4 OutputVertices 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + Name 4 "main" + Name 9 "Output" + MemberName 9(Output) 0 "result" + Name 11 "" + Name 15 "gl_PrimitiveIDIn" + Name 18 "gl_SubgroupSize" + Name 20 "gl_SubgroupInvocationID" + Decorate 8 ArrayStride 16 + MemberDecorate 9(Output) 0 Offset 0 + Decorate 9(Output) Block + Decorate 11 DescriptorSet 0 + Decorate 11 Binding 0 + Decorate 15(gl_PrimitiveIDIn) BuiltIn PrimitiveId + Decorate 18(gl_SubgroupSize) RelaxedPrecision + Decorate 18(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 19 RelaxedPrecision + Decorate 20(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 20(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 21 RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 4 + 8: TypeRuntimeArray 7(ivec4) + 9(Output): TypeStruct 8 + 10: TypePointer StorageBuffer 9(Output) + 11: 10(ptr) Variable StorageBuffer + 12: TypeInt 32 1 + 13: 12(int) Constant 0 + 14: TypePointer Input 12(int) +15(gl_PrimitiveIDIn): 14(ptr) Variable Input + 17: TypePointer Input 6(int) +18(gl_SubgroupSize): 17(ptr) Variable Input +20(gl_SubgroupInvocationID): 17(ptr) Variable Input + 22: 6(int) Constant 0 + 24: TypePointer StorageBuffer 7(ivec4) + 4(main): 2 Function None 3 + 5: Label + 16: 12(int) Load 15(gl_PrimitiveIDIn) + 19: 6(int) Load 18(gl_SubgroupSize) + 21: 6(int) Load 20(gl_SubgroupInvocationID) + 23: 7(ivec4) CompositeConstruct 19 21 22 22 + 25: 24(ptr) AccessChain 11 13 16 + Store 25 23 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.subgroup.tesc.out b/deps/glslang/Test/baseResults/spv.subgroup.tesc.out new file mode 100644 index 00000000..4e362e2d --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.subgroup.tesc.out @@ -0,0 +1,59 @@ +spv.subgroup.tesc +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 26 + + Capability Tessellation + Capability GroupNonUniform + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "main" 15 18 20 + ExecutionMode 4 OutputVertices 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + Name 4 "main" + Name 9 "Output" + MemberName 9(Output) 0 "result" + Name 11 "" + Name 15 "gl_PrimitiveID" + Name 18 "gl_SubgroupSize" + Name 20 "gl_SubgroupInvocationID" + Decorate 8 ArrayStride 16 + MemberDecorate 9(Output) 0 Offset 0 + Decorate 9(Output) Block + Decorate 11 DescriptorSet 0 + Decorate 11 Binding 0 + Decorate 15(gl_PrimitiveID) BuiltIn PrimitiveId + Decorate 18(gl_SubgroupSize) RelaxedPrecision + Decorate 18(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 19 RelaxedPrecision + Decorate 20(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 20(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 21 RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 4 + 8: TypeRuntimeArray 7(ivec4) + 9(Output): TypeStruct 8 + 10: TypePointer StorageBuffer 9(Output) + 11: 10(ptr) Variable StorageBuffer + 12: TypeInt 32 1 + 13: 12(int) Constant 0 + 14: TypePointer Input 12(int) +15(gl_PrimitiveID): 14(ptr) Variable Input + 17: TypePointer Input 6(int) +18(gl_SubgroupSize): 17(ptr) Variable Input +20(gl_SubgroupInvocationID): 17(ptr) Variable Input + 22: 6(int) Constant 0 + 24: TypePointer StorageBuffer 7(ivec4) + 4(main): 2 Function None 3 + 5: Label + 16: 12(int) Load 15(gl_PrimitiveID) + 19: 6(int) Load 18(gl_SubgroupSize) + 21: 6(int) Load 20(gl_SubgroupInvocationID) + 23: 7(ivec4) CompositeConstruct 19 21 22 22 + 25: 24(ptr) AccessChain 11 13 16 + Store 25 23 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.subgroup.tese.out b/deps/glslang/Test/baseResults/spv.subgroup.tese.out new file mode 100644 index 00000000..e09f558d --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.subgroup.tese.out @@ -0,0 +1,61 @@ +spv.subgroup.tese +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 26 + + Capability Tessellation + Capability GroupNonUniform + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationEvaluation 4 "main" 15 18 20 + ExecutionMode 4 Isolines + ExecutionMode 4 SpacingEqual + ExecutionMode 4 VertexOrderCcw + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + Name 4 "main" + Name 9 "Output" + MemberName 9(Output) 0 "result" + Name 11 "" + Name 15 "gl_PrimitiveID" + Name 18 "gl_SubgroupSize" + Name 20 "gl_SubgroupInvocationID" + Decorate 8 ArrayStride 16 + MemberDecorate 9(Output) 0 Offset 0 + Decorate 9(Output) Block + Decorate 11 DescriptorSet 0 + Decorate 11 Binding 0 + Decorate 15(gl_PrimitiveID) BuiltIn PrimitiveId + Decorate 18(gl_SubgroupSize) RelaxedPrecision + Decorate 18(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 19 RelaxedPrecision + Decorate 20(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 20(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 21 RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 4 + 8: TypeRuntimeArray 7(ivec4) + 9(Output): TypeStruct 8 + 10: TypePointer StorageBuffer 9(Output) + 11: 10(ptr) Variable StorageBuffer + 12: TypeInt 32 1 + 13: 12(int) Constant 0 + 14: TypePointer Input 12(int) +15(gl_PrimitiveID): 14(ptr) Variable Input + 17: TypePointer Input 6(int) +18(gl_SubgroupSize): 17(ptr) Variable Input +20(gl_SubgroupInvocationID): 17(ptr) Variable Input + 22: 6(int) Constant 0 + 24: TypePointer StorageBuffer 7(ivec4) + 4(main): 2 Function None 3 + 5: Label + 16: 12(int) Load 15(gl_PrimitiveID) + 19: 6(int) Load 18(gl_SubgroupSize) + 21: 6(int) Load 20(gl_SubgroupInvocationID) + 23: 7(ivec4) CompositeConstruct 19 21 22 22 + 25: 24(ptr) AccessChain 11 13 16 + Store 25 23 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.subgroup.vert.out b/deps/glslang/Test/baseResults/spv.subgroup.vert.out new file mode 100644 index 00000000..2fbc92ba --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.subgroup.vert.out @@ -0,0 +1,58 @@ +spv.subgroup.vert +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 26 + + Capability Shader + Capability GroupNonUniform + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 15 18 20 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + Name 4 "main" + Name 9 "Output" + MemberName 9(Output) 0 "result" + Name 11 "" + Name 15 "gl_VertexIndex" + Name 18 "gl_SubgroupSize" + Name 20 "gl_SubgroupInvocationID" + Decorate 8 ArrayStride 16 + MemberDecorate 9(Output) 0 Offset 0 + Decorate 9(Output) Block + Decorate 11 DescriptorSet 0 + Decorate 11 Binding 0 + Decorate 15(gl_VertexIndex) BuiltIn VertexIndex + Decorate 18(gl_SubgroupSize) RelaxedPrecision + Decorate 18(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 19 RelaxedPrecision + Decorate 20(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 20(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 21 RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 4 + 8: TypeRuntimeArray 7(ivec4) + 9(Output): TypeStruct 8 + 10: TypePointer StorageBuffer 9(Output) + 11: 10(ptr) Variable StorageBuffer + 12: TypeInt 32 1 + 13: 12(int) Constant 0 + 14: TypePointer Input 12(int) +15(gl_VertexIndex): 14(ptr) Variable Input + 17: TypePointer Input 6(int) +18(gl_SubgroupSize): 17(ptr) Variable Input +20(gl_SubgroupInvocationID): 17(ptr) Variable Input + 22: 6(int) Constant 0 + 24: TypePointer StorageBuffer 7(ivec4) + 4(main): 2 Function None 3 + 5: Label + 16: 12(int) Load 15(gl_VertexIndex) + 19: 6(int) Load 18(gl_SubgroupSize) + 21: 6(int) Load 20(gl_SubgroupInvocationID) + 23: 7(ivec4) CompositeConstruct 19 21 22 22 + 25: 24(ptr) AccessChain 11 13 16 + Store 25 23 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.subgroupArithmetic.comp.out b/deps/glslang/Test/baseResults/spv.subgroupArithmetic.comp.out new file mode 100644 index 00000000..f4e251a0 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.subgroupArithmetic.comp.out @@ -0,0 +1,2428 @@ +spv.subgroupArithmetic.comp +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 2085 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformArithmetic + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 10 12 + ExecutionMode 4 LocalSize 8 1 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_arithmetic" + SourceExtension "GL_KHR_shader_subgroup_basic" + Name 4 "main" + Name 8 "invocation" + Name 10 "gl_SubgroupInvocationID" + Name 12 "gl_SubgroupSize" + Name 24 "Buffers" + MemberName 24(Buffers) 0 "f4" + MemberName 24(Buffers) 1 "i4" + MemberName 24(Buffers) 2 "u4" + MemberName 24(Buffers) 3 "d4" + Name 27 "data" + Decorate 10(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 10(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 11 RelaxedPrecision + Decorate 12(gl_SubgroupSize) RelaxedPrecision + Decorate 12(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 13 RelaxedPrecision + Decorate 14 RelaxedPrecision + Decorate 16 RelaxedPrecision + MemberDecorate 24(Buffers) 0 Offset 0 + MemberDecorate 24(Buffers) 1 Offset 16 + MemberDecorate 24(Buffers) 2 Offset 32 + MemberDecorate 24(Buffers) 3 Offset 64 + Decorate 24(Buffers) Block + Decorate 27(data) DescriptorSet 0 + Decorate 27(data) Binding 0 + Decorate 2084 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypePointer Input 6(int) +10(gl_SubgroupInvocationID): 9(ptr) Variable Input +12(gl_SubgroupSize): 9(ptr) Variable Input + 15: 6(int) Constant 4 + 17: TypeFloat 32 + 18: TypeVector 17(float) 4 + 19: TypeInt 32 1 + 20: TypeVector 19(int) 4 + 21: TypeVector 6(int) 4 + 22: TypeFloat 64 + 23: TypeVector 22(float64_t) 4 + 24(Buffers): TypeStruct 18(fvec4) 20(ivec4) 21(ivec4) 23(f64vec4) + 25: TypeArray 24(Buffers) 15 + 26: TypePointer StorageBuffer 25 + 27(data): 26(ptr) Variable StorageBuffer + 29: 19(int) Constant 0 + 30: 6(int) Constant 0 + 31: TypePointer StorageBuffer 17(float) + 34: 6(int) Constant 3 + 38: 19(int) Constant 1 + 39: TypeVector 17(float) 2 + 40: TypePointer StorageBuffer 18(fvec4) + 49: 19(int) Constant 2 + 50: TypeVector 17(float) 3 + 59: 19(int) Constant 3 + 65: TypePointer StorageBuffer 19(int) + 71: TypeVector 19(int) 2 + 72: TypePointer StorageBuffer 20(ivec4) + 81: TypeVector 19(int) 3 + 95: TypePointer StorageBuffer 6(int) + 101: TypeVector 6(int) 2 + 102: TypePointer StorageBuffer 21(ivec4) + 111: TypeVector 6(int) 3 + 125: TypePointer StorageBuffer 22(float64_t) + 131: TypeVector 22(float64_t) 2 + 132: TypePointer StorageBuffer 23(f64vec4) + 141: TypeVector 22(float64_t) 3 + 521: TypeBool + 530: 71(ivec2) ConstantComposite 29 29 + 531: TypeVector 521(bool) 2 + 534: 71(ivec2) ConstantComposite 38 38 + 543: 81(ivec3) ConstantComposite 29 29 29 + 544: TypeVector 521(bool) 3 + 547: 81(ivec3) ConstantComposite 38 38 38 + 555: 20(ivec4) ConstantComposite 29 29 29 29 + 556: TypeVector 521(bool) 4 + 559: 20(ivec4) ConstantComposite 38 38 38 38 + 2082: 6(int) Constant 8 + 2083: 6(int) Constant 1 + 2084: 111(ivec3) ConstantComposite 2082 2083 2083 + 4(main): 2 Function None 3 + 5: Label + 8(invocation): 7(ptr) Variable Function + 11: 6(int) Load 10(gl_SubgroupInvocationID) + 13: 6(int) Load 12(gl_SubgroupSize) + 14: 6(int) IAdd 11 13 + 16: 6(int) UMod 14 15 + Store 8(invocation) 16 + 28: 6(int) Load 8(invocation) + 32: 31(ptr) AccessChain 27(data) 29 29 30 + 33: 17(float) Load 32 + 35: 17(float) GroupNonUniformFAdd 34 Reduce 33 + 36: 31(ptr) AccessChain 27(data) 28 29 30 + Store 36 35 + 37: 6(int) Load 8(invocation) + 41: 40(ptr) AccessChain 27(data) 38 29 + 42: 18(fvec4) Load 41 + 43: 39(fvec2) VectorShuffle 42 42 0 1 + 44: 39(fvec2) GroupNonUniformFAdd 34 Reduce 43 + 45: 40(ptr) AccessChain 27(data) 37 29 + 46: 18(fvec4) Load 45 + 47: 18(fvec4) VectorShuffle 46 44 4 5 2 3 + Store 45 47 + 48: 6(int) Load 8(invocation) + 51: 40(ptr) AccessChain 27(data) 49 29 + 52: 18(fvec4) Load 51 + 53: 50(fvec3) VectorShuffle 52 52 0 1 2 + 54: 50(fvec3) GroupNonUniformFAdd 34 Reduce 53 + 55: 40(ptr) AccessChain 27(data) 48 29 + 56: 18(fvec4) Load 55 + 57: 18(fvec4) VectorShuffle 56 54 4 5 6 3 + Store 55 57 + 58: 6(int) Load 8(invocation) + 60: 40(ptr) AccessChain 27(data) 59 29 + 61: 18(fvec4) Load 60 + 62: 18(fvec4) GroupNonUniformFAdd 34 Reduce 61 + 63: 40(ptr) AccessChain 27(data) 58 29 + Store 63 62 + 64: 6(int) Load 8(invocation) + 66: 65(ptr) AccessChain 27(data) 29 38 30 + 67: 19(int) Load 66 + 68: 19(int) GroupNonUniformIAdd 34 Reduce 67 + 69: 65(ptr) AccessChain 27(data) 64 38 30 + Store 69 68 + 70: 6(int) Load 8(invocation) + 73: 72(ptr) AccessChain 27(data) 38 38 + 74: 20(ivec4) Load 73 + 75: 71(ivec2) VectorShuffle 74 74 0 1 + 76: 71(ivec2) GroupNonUniformIAdd 34 Reduce 75 + 77: 72(ptr) AccessChain 27(data) 70 38 + 78: 20(ivec4) Load 77 + 79: 20(ivec4) VectorShuffle 78 76 4 5 2 3 + Store 77 79 + 80: 6(int) Load 8(invocation) + 82: 72(ptr) AccessChain 27(data) 49 38 + 83: 20(ivec4) Load 82 + 84: 81(ivec3) VectorShuffle 83 83 0 1 2 + 85: 81(ivec3) GroupNonUniformIAdd 34 Reduce 84 + 86: 72(ptr) AccessChain 27(data) 80 38 + 87: 20(ivec4) Load 86 + 88: 20(ivec4) VectorShuffle 87 85 4 5 6 3 + Store 86 88 + 89: 6(int) Load 8(invocation) + 90: 72(ptr) AccessChain 27(data) 59 38 + 91: 20(ivec4) Load 90 + 92: 20(ivec4) GroupNonUniformIAdd 34 Reduce 91 + 93: 72(ptr) AccessChain 27(data) 89 38 + Store 93 92 + 94: 6(int) Load 8(invocation) + 96: 95(ptr) AccessChain 27(data) 29 49 30 + 97: 6(int) Load 96 + 98: 6(int) GroupNonUniformIAdd 34 Reduce 97 + 99: 95(ptr) AccessChain 27(data) 94 49 30 + Store 99 98 + 100: 6(int) Load 8(invocation) + 103: 102(ptr) AccessChain 27(data) 38 49 + 104: 21(ivec4) Load 103 + 105: 101(ivec2) VectorShuffle 104 104 0 1 + 106: 101(ivec2) GroupNonUniformIAdd 34 Reduce 105 + 107: 102(ptr) AccessChain 27(data) 100 49 + 108: 21(ivec4) Load 107 + 109: 21(ivec4) VectorShuffle 108 106 4 5 2 3 + Store 107 109 + 110: 6(int) Load 8(invocation) + 112: 102(ptr) AccessChain 27(data) 49 49 + 113: 21(ivec4) Load 112 + 114: 111(ivec3) VectorShuffle 113 113 0 1 2 + 115: 111(ivec3) GroupNonUniformIAdd 34 Reduce 114 + 116: 102(ptr) AccessChain 27(data) 110 49 + 117: 21(ivec4) Load 116 + 118: 21(ivec4) VectorShuffle 117 115 4 5 6 3 + Store 116 118 + 119: 6(int) Load 8(invocation) + 120: 102(ptr) AccessChain 27(data) 59 49 + 121: 21(ivec4) Load 120 + 122: 21(ivec4) GroupNonUniformIAdd 34 Reduce 121 + 123: 102(ptr) AccessChain 27(data) 119 49 + Store 123 122 + 124: 6(int) Load 8(invocation) + 126: 125(ptr) AccessChain 27(data) 29 59 30 + 127:22(float64_t) Load 126 + 128:22(float64_t) GroupNonUniformFAdd 34 Reduce 127 + 129: 125(ptr) AccessChain 27(data) 124 59 30 + Store 129 128 + 130: 6(int) Load 8(invocation) + 133: 132(ptr) AccessChain 27(data) 38 59 + 134: 23(f64vec4) Load 133 + 135:131(f64vec2) VectorShuffle 134 134 0 1 + 136:131(f64vec2) GroupNonUniformFAdd 34 Reduce 135 + 137: 132(ptr) AccessChain 27(data) 130 59 + 138: 23(f64vec4) Load 137 + 139: 23(f64vec4) VectorShuffle 138 136 4 5 2 3 + Store 137 139 + 140: 6(int) Load 8(invocation) + 142: 132(ptr) AccessChain 27(data) 49 59 + 143: 23(f64vec4) Load 142 + 144:141(f64vec3) VectorShuffle 143 143 0 1 2 + 145:141(f64vec3) GroupNonUniformFAdd 34 Reduce 144 + 146: 132(ptr) AccessChain 27(data) 140 59 + 147: 23(f64vec4) Load 146 + 148: 23(f64vec4) VectorShuffle 147 145 4 5 6 3 + Store 146 148 + 149: 6(int) Load 8(invocation) + 150: 132(ptr) AccessChain 27(data) 59 59 + 151: 23(f64vec4) Load 150 + 152: 23(f64vec4) GroupNonUniformFAdd 34 Reduce 151 + 153: 132(ptr) AccessChain 27(data) 149 59 + Store 153 152 + 154: 6(int) Load 8(invocation) + 155: 31(ptr) AccessChain 27(data) 29 29 30 + 156: 17(float) Load 155 + 157: 17(float) GroupNonUniformFMul 34 Reduce 156 + 158: 31(ptr) AccessChain 27(data) 154 29 30 + Store 158 157 + 159: 6(int) Load 8(invocation) + 160: 40(ptr) AccessChain 27(data) 38 29 + 161: 18(fvec4) Load 160 + 162: 39(fvec2) VectorShuffle 161 161 0 1 + 163: 39(fvec2) GroupNonUniformFMul 34 Reduce 162 + 164: 40(ptr) AccessChain 27(data) 159 29 + 165: 18(fvec4) Load 164 + 166: 18(fvec4) VectorShuffle 165 163 4 5 2 3 + Store 164 166 + 167: 6(int) Load 8(invocation) + 168: 40(ptr) AccessChain 27(data) 49 29 + 169: 18(fvec4) Load 168 + 170: 50(fvec3) VectorShuffle 169 169 0 1 2 + 171: 50(fvec3) GroupNonUniformFMul 34 Reduce 170 + 172: 40(ptr) AccessChain 27(data) 167 29 + 173: 18(fvec4) Load 172 + 174: 18(fvec4) VectorShuffle 173 171 4 5 6 3 + Store 172 174 + 175: 6(int) Load 8(invocation) + 176: 40(ptr) AccessChain 27(data) 59 29 + 177: 18(fvec4) Load 176 + 178: 18(fvec4) GroupNonUniformFMul 34 Reduce 177 + 179: 40(ptr) AccessChain 27(data) 175 29 + Store 179 178 + 180: 6(int) Load 8(invocation) + 181: 65(ptr) AccessChain 27(data) 29 38 30 + 182: 19(int) Load 181 + 183: 19(int) GroupNonUniformIMul 34 Reduce 182 + 184: 65(ptr) AccessChain 27(data) 180 38 30 + Store 184 183 + 185: 6(int) Load 8(invocation) + 186: 72(ptr) AccessChain 27(data) 38 38 + 187: 20(ivec4) Load 186 + 188: 71(ivec2) VectorShuffle 187 187 0 1 + 189: 71(ivec2) GroupNonUniformIMul 34 Reduce 188 + 190: 72(ptr) AccessChain 27(data) 185 38 + 191: 20(ivec4) Load 190 + 192: 20(ivec4) VectorShuffle 191 189 4 5 2 3 + Store 190 192 + 193: 6(int) Load 8(invocation) + 194: 72(ptr) AccessChain 27(data) 49 38 + 195: 20(ivec4) Load 194 + 196: 81(ivec3) VectorShuffle 195 195 0 1 2 + 197: 81(ivec3) GroupNonUniformIMul 34 Reduce 196 + 198: 72(ptr) AccessChain 27(data) 193 38 + 199: 20(ivec4) Load 198 + 200: 20(ivec4) VectorShuffle 199 197 4 5 6 3 + Store 198 200 + 201: 6(int) Load 8(invocation) + 202: 72(ptr) AccessChain 27(data) 59 38 + 203: 20(ivec4) Load 202 + 204: 20(ivec4) GroupNonUniformIMul 34 Reduce 203 + 205: 72(ptr) AccessChain 27(data) 201 38 + Store 205 204 + 206: 6(int) Load 8(invocation) + 207: 95(ptr) AccessChain 27(data) 29 49 30 + 208: 6(int) Load 207 + 209: 6(int) GroupNonUniformIMul 34 Reduce 208 + 210: 95(ptr) AccessChain 27(data) 206 49 30 + Store 210 209 + 211: 6(int) Load 8(invocation) + 212: 102(ptr) AccessChain 27(data) 38 49 + 213: 21(ivec4) Load 212 + 214: 101(ivec2) VectorShuffle 213 213 0 1 + 215: 101(ivec2) GroupNonUniformIMul 34 Reduce 214 + 216: 102(ptr) AccessChain 27(data) 211 49 + 217: 21(ivec4) Load 216 + 218: 21(ivec4) VectorShuffle 217 215 4 5 2 3 + Store 216 218 + 219: 6(int) Load 8(invocation) + 220: 102(ptr) AccessChain 27(data) 49 49 + 221: 21(ivec4) Load 220 + 222: 111(ivec3) VectorShuffle 221 221 0 1 2 + 223: 111(ivec3) GroupNonUniformIMul 34 Reduce 222 + 224: 102(ptr) AccessChain 27(data) 219 49 + 225: 21(ivec4) Load 224 + 226: 21(ivec4) VectorShuffle 225 223 4 5 6 3 + Store 224 226 + 227: 6(int) Load 8(invocation) + 228: 102(ptr) AccessChain 27(data) 59 49 + 229: 21(ivec4) Load 228 + 230: 21(ivec4) GroupNonUniformIMul 34 Reduce 229 + 231: 102(ptr) AccessChain 27(data) 227 49 + Store 231 230 + 232: 6(int) Load 8(invocation) + 233: 125(ptr) AccessChain 27(data) 29 59 30 + 234:22(float64_t) Load 233 + 235:22(float64_t) GroupNonUniformFMul 34 Reduce 234 + 236: 125(ptr) AccessChain 27(data) 232 59 30 + Store 236 235 + 237: 6(int) Load 8(invocation) + 238: 132(ptr) AccessChain 27(data) 38 59 + 239: 23(f64vec4) Load 238 + 240:131(f64vec2) VectorShuffle 239 239 0 1 + 241:131(f64vec2) GroupNonUniformFMul 34 Reduce 240 + 242: 132(ptr) AccessChain 27(data) 237 59 + 243: 23(f64vec4) Load 242 + 244: 23(f64vec4) VectorShuffle 243 241 4 5 2 3 + Store 242 244 + 245: 6(int) Load 8(invocation) + 246: 132(ptr) AccessChain 27(data) 49 59 + 247: 23(f64vec4) Load 246 + 248:141(f64vec3) VectorShuffle 247 247 0 1 2 + 249:141(f64vec3) GroupNonUniformFMul 34 Reduce 248 + 250: 132(ptr) AccessChain 27(data) 245 59 + 251: 23(f64vec4) Load 250 + 252: 23(f64vec4) VectorShuffle 251 249 4 5 6 3 + Store 250 252 + 253: 6(int) Load 8(invocation) + 254: 132(ptr) AccessChain 27(data) 59 59 + 255: 23(f64vec4) Load 254 + 256: 23(f64vec4) GroupNonUniformFMul 34 Reduce 255 + 257: 132(ptr) AccessChain 27(data) 253 59 + Store 257 256 + 258: 6(int) Load 8(invocation) + 259: 31(ptr) AccessChain 27(data) 29 29 30 + 260: 17(float) Load 259 + 261: 17(float) GroupNonUniformFMin 34 Reduce 260 + 262: 31(ptr) AccessChain 27(data) 258 29 30 + Store 262 261 + 263: 6(int) Load 8(invocation) + 264: 40(ptr) AccessChain 27(data) 38 29 + 265: 18(fvec4) Load 264 + 266: 39(fvec2) VectorShuffle 265 265 0 1 + 267: 39(fvec2) GroupNonUniformFMin 34 Reduce 266 + 268: 40(ptr) AccessChain 27(data) 263 29 + 269: 18(fvec4) Load 268 + 270: 18(fvec4) VectorShuffle 269 267 4 5 2 3 + Store 268 270 + 271: 6(int) Load 8(invocation) + 272: 40(ptr) AccessChain 27(data) 49 29 + 273: 18(fvec4) Load 272 + 274: 50(fvec3) VectorShuffle 273 273 0 1 2 + 275: 50(fvec3) GroupNonUniformFMin 34 Reduce 274 + 276: 40(ptr) AccessChain 27(data) 271 29 + 277: 18(fvec4) Load 276 + 278: 18(fvec4) VectorShuffle 277 275 4 5 6 3 + Store 276 278 + 279: 6(int) Load 8(invocation) + 280: 40(ptr) AccessChain 27(data) 59 29 + 281: 18(fvec4) Load 280 + 282: 18(fvec4) GroupNonUniformFMin 34 Reduce 281 + 283: 40(ptr) AccessChain 27(data) 279 29 + Store 283 282 + 284: 6(int) Load 8(invocation) + 285: 65(ptr) AccessChain 27(data) 29 38 30 + 286: 19(int) Load 285 + 287: 19(int) GroupNonUniformSMin 34 Reduce 286 + 288: 65(ptr) AccessChain 27(data) 284 38 30 + Store 288 287 + 289: 6(int) Load 8(invocation) + 290: 72(ptr) AccessChain 27(data) 38 38 + 291: 20(ivec4) Load 290 + 292: 71(ivec2) VectorShuffle 291 291 0 1 + 293: 71(ivec2) GroupNonUniformSMin 34 Reduce 292 + 294: 72(ptr) AccessChain 27(data) 289 38 + 295: 20(ivec4) Load 294 + 296: 20(ivec4) VectorShuffle 295 293 4 5 2 3 + Store 294 296 + 297: 6(int) Load 8(invocation) + 298: 72(ptr) AccessChain 27(data) 49 38 + 299: 20(ivec4) Load 298 + 300: 81(ivec3) VectorShuffle 299 299 0 1 2 + 301: 81(ivec3) GroupNonUniformSMin 34 Reduce 300 + 302: 72(ptr) AccessChain 27(data) 297 38 + 303: 20(ivec4) Load 302 + 304: 20(ivec4) VectorShuffle 303 301 4 5 6 3 + Store 302 304 + 305: 6(int) Load 8(invocation) + 306: 72(ptr) AccessChain 27(data) 59 38 + 307: 20(ivec4) Load 306 + 308: 20(ivec4) GroupNonUniformSMin 34 Reduce 307 + 309: 72(ptr) AccessChain 27(data) 305 38 + Store 309 308 + 310: 6(int) Load 8(invocation) + 311: 95(ptr) AccessChain 27(data) 29 49 30 + 312: 6(int) Load 311 + 313: 6(int) GroupNonUniformUMin 34 Reduce 312 + 314: 95(ptr) AccessChain 27(data) 310 49 30 + Store 314 313 + 315: 6(int) Load 8(invocation) + 316: 102(ptr) AccessChain 27(data) 38 49 + 317: 21(ivec4) Load 316 + 318: 101(ivec2) VectorShuffle 317 317 0 1 + 319: 101(ivec2) GroupNonUniformUMin 34 Reduce 318 + 320: 102(ptr) AccessChain 27(data) 315 49 + 321: 21(ivec4) Load 320 + 322: 21(ivec4) VectorShuffle 321 319 4 5 2 3 + Store 320 322 + 323: 6(int) Load 8(invocation) + 324: 102(ptr) AccessChain 27(data) 49 49 + 325: 21(ivec4) Load 324 + 326: 111(ivec3) VectorShuffle 325 325 0 1 2 + 327: 111(ivec3) GroupNonUniformUMin 34 Reduce 326 + 328: 102(ptr) AccessChain 27(data) 323 49 + 329: 21(ivec4) Load 328 + 330: 21(ivec4) VectorShuffle 329 327 4 5 6 3 + Store 328 330 + 331: 6(int) Load 8(invocation) + 332: 102(ptr) AccessChain 27(data) 59 49 + 333: 21(ivec4) Load 332 + 334: 21(ivec4) GroupNonUniformUMin 34 Reduce 333 + 335: 102(ptr) AccessChain 27(data) 331 49 + Store 335 334 + 336: 6(int) Load 8(invocation) + 337: 125(ptr) AccessChain 27(data) 29 59 30 + 338:22(float64_t) Load 337 + 339:22(float64_t) GroupNonUniformFMin 34 Reduce 338 + 340: 125(ptr) AccessChain 27(data) 336 59 30 + Store 340 339 + 341: 6(int) Load 8(invocation) + 342: 132(ptr) AccessChain 27(data) 38 59 + 343: 23(f64vec4) Load 342 + 344:131(f64vec2) VectorShuffle 343 343 0 1 + 345:131(f64vec2) GroupNonUniformFMin 34 Reduce 344 + 346: 132(ptr) AccessChain 27(data) 341 59 + 347: 23(f64vec4) Load 346 + 348: 23(f64vec4) VectorShuffle 347 345 4 5 2 3 + Store 346 348 + 349: 6(int) Load 8(invocation) + 350: 132(ptr) AccessChain 27(data) 49 59 + 351: 23(f64vec4) Load 350 + 352:141(f64vec3) VectorShuffle 351 351 0 1 2 + 353:141(f64vec3) GroupNonUniformFMin 34 Reduce 352 + 354: 132(ptr) AccessChain 27(data) 349 59 + 355: 23(f64vec4) Load 354 + 356: 23(f64vec4) VectorShuffle 355 353 4 5 6 3 + Store 354 356 + 357: 6(int) Load 8(invocation) + 358: 132(ptr) AccessChain 27(data) 59 59 + 359: 23(f64vec4) Load 358 + 360: 23(f64vec4) GroupNonUniformFMin 34 Reduce 359 + 361: 132(ptr) AccessChain 27(data) 357 59 + Store 361 360 + 362: 6(int) Load 8(invocation) + 363: 31(ptr) AccessChain 27(data) 29 29 30 + 364: 17(float) Load 363 + 365: 17(float) GroupNonUniformFMax 34 Reduce 364 + 366: 31(ptr) AccessChain 27(data) 362 29 30 + Store 366 365 + 367: 6(int) Load 8(invocation) + 368: 40(ptr) AccessChain 27(data) 38 29 + 369: 18(fvec4) Load 368 + 370: 39(fvec2) VectorShuffle 369 369 0 1 + 371: 39(fvec2) GroupNonUniformFMax 34 Reduce 370 + 372: 40(ptr) AccessChain 27(data) 367 29 + 373: 18(fvec4) Load 372 + 374: 18(fvec4) VectorShuffle 373 371 4 5 2 3 + Store 372 374 + 375: 6(int) Load 8(invocation) + 376: 40(ptr) AccessChain 27(data) 49 29 + 377: 18(fvec4) Load 376 + 378: 50(fvec3) VectorShuffle 377 377 0 1 2 + 379: 50(fvec3) GroupNonUniformFMax 34 Reduce 378 + 380: 40(ptr) AccessChain 27(data) 375 29 + 381: 18(fvec4) Load 380 + 382: 18(fvec4) VectorShuffle 381 379 4 5 6 3 + Store 380 382 + 383: 6(int) Load 8(invocation) + 384: 40(ptr) AccessChain 27(data) 59 29 + 385: 18(fvec4) Load 384 + 386: 18(fvec4) GroupNonUniformFMax 34 Reduce 385 + 387: 40(ptr) AccessChain 27(data) 383 29 + Store 387 386 + 388: 6(int) Load 8(invocation) + 389: 65(ptr) AccessChain 27(data) 29 38 30 + 390: 19(int) Load 389 + 391: 19(int) GroupNonUniformSMax 34 Reduce 390 + 392: 65(ptr) AccessChain 27(data) 388 38 30 + Store 392 391 + 393: 6(int) Load 8(invocation) + 394: 72(ptr) AccessChain 27(data) 38 38 + 395: 20(ivec4) Load 394 + 396: 71(ivec2) VectorShuffle 395 395 0 1 + 397: 71(ivec2) GroupNonUniformSMax 34 Reduce 396 + 398: 72(ptr) AccessChain 27(data) 393 38 + 399: 20(ivec4) Load 398 + 400: 20(ivec4) VectorShuffle 399 397 4 5 2 3 + Store 398 400 + 401: 6(int) Load 8(invocation) + 402: 72(ptr) AccessChain 27(data) 49 38 + 403: 20(ivec4) Load 402 + 404: 81(ivec3) VectorShuffle 403 403 0 1 2 + 405: 81(ivec3) GroupNonUniformSMax 34 Reduce 404 + 406: 72(ptr) AccessChain 27(data) 401 38 + 407: 20(ivec4) Load 406 + 408: 20(ivec4) VectorShuffle 407 405 4 5 6 3 + Store 406 408 + 409: 6(int) Load 8(invocation) + 410: 72(ptr) AccessChain 27(data) 59 38 + 411: 20(ivec4) Load 410 + 412: 20(ivec4) GroupNonUniformSMax 34 Reduce 411 + 413: 72(ptr) AccessChain 27(data) 409 38 + Store 413 412 + 414: 6(int) Load 8(invocation) + 415: 95(ptr) AccessChain 27(data) 29 49 30 + 416: 6(int) Load 415 + 417: 6(int) GroupNonUniformUMax 34 Reduce 416 + 418: 95(ptr) AccessChain 27(data) 414 49 30 + Store 418 417 + 419: 6(int) Load 8(invocation) + 420: 102(ptr) AccessChain 27(data) 38 49 + 421: 21(ivec4) Load 420 + 422: 101(ivec2) VectorShuffle 421 421 0 1 + 423: 101(ivec2) GroupNonUniformUMax 34 Reduce 422 + 424: 102(ptr) AccessChain 27(data) 419 49 + 425: 21(ivec4) Load 424 + 426: 21(ivec4) VectorShuffle 425 423 4 5 2 3 + Store 424 426 + 427: 6(int) Load 8(invocation) + 428: 102(ptr) AccessChain 27(data) 49 49 + 429: 21(ivec4) Load 428 + 430: 111(ivec3) VectorShuffle 429 429 0 1 2 + 431: 111(ivec3) GroupNonUniformUMax 34 Reduce 430 + 432: 102(ptr) AccessChain 27(data) 427 49 + 433: 21(ivec4) Load 432 + 434: 21(ivec4) VectorShuffle 433 431 4 5 6 3 + Store 432 434 + 435: 6(int) Load 8(invocation) + 436: 102(ptr) AccessChain 27(data) 59 49 + 437: 21(ivec4) Load 436 + 438: 21(ivec4) GroupNonUniformUMax 34 Reduce 437 + 439: 102(ptr) AccessChain 27(data) 435 49 + Store 439 438 + 440: 6(int) Load 8(invocation) + 441: 125(ptr) AccessChain 27(data) 29 59 30 + 442:22(float64_t) Load 441 + 443:22(float64_t) GroupNonUniformFMax 34 Reduce 442 + 444: 125(ptr) AccessChain 27(data) 440 59 30 + Store 444 443 + 445: 6(int) Load 8(invocation) + 446: 132(ptr) AccessChain 27(data) 38 59 + 447: 23(f64vec4) Load 446 + 448:131(f64vec2) VectorShuffle 447 447 0 1 + 449:131(f64vec2) GroupNonUniformFMax 34 Reduce 448 + 450: 132(ptr) AccessChain 27(data) 445 59 + 451: 23(f64vec4) Load 450 + 452: 23(f64vec4) VectorShuffle 451 449 4 5 2 3 + Store 450 452 + 453: 6(int) Load 8(invocation) + 454: 132(ptr) AccessChain 27(data) 49 59 + 455: 23(f64vec4) Load 454 + 456:141(f64vec3) VectorShuffle 455 455 0 1 2 + 457:141(f64vec3) GroupNonUniformFMax 34 Reduce 456 + 458: 132(ptr) AccessChain 27(data) 453 59 + 459: 23(f64vec4) Load 458 + 460: 23(f64vec4) VectorShuffle 459 457 4 5 6 3 + Store 458 460 + 461: 6(int) Load 8(invocation) + 462: 132(ptr) AccessChain 27(data) 59 59 + 463: 23(f64vec4) Load 462 + 464: 23(f64vec4) GroupNonUniformFMax 34 Reduce 463 + 465: 132(ptr) AccessChain 27(data) 461 59 + Store 465 464 + 466: 6(int) Load 8(invocation) + 467: 65(ptr) AccessChain 27(data) 29 38 30 + 468: 19(int) Load 467 + 469: 19(int) GroupNonUniformBitwiseAnd 34 Reduce 468 + 470: 65(ptr) AccessChain 27(data) 466 38 30 + Store 470 469 + 471: 6(int) Load 8(invocation) + 472: 72(ptr) AccessChain 27(data) 38 38 + 473: 20(ivec4) Load 472 + 474: 71(ivec2) VectorShuffle 473 473 0 1 + 475: 71(ivec2) GroupNonUniformBitwiseAnd 34 Reduce 474 + 476: 72(ptr) AccessChain 27(data) 471 38 + 477: 20(ivec4) Load 476 + 478: 20(ivec4) VectorShuffle 477 475 4 5 2 3 + Store 476 478 + 479: 6(int) Load 8(invocation) + 480: 72(ptr) AccessChain 27(data) 49 38 + 481: 20(ivec4) Load 480 + 482: 81(ivec3) VectorShuffle 481 481 0 1 2 + 483: 81(ivec3) GroupNonUniformBitwiseAnd 34 Reduce 482 + 484: 72(ptr) AccessChain 27(data) 479 38 + 485: 20(ivec4) Load 484 + 486: 20(ivec4) VectorShuffle 485 483 4 5 6 3 + Store 484 486 + 487: 6(int) Load 8(invocation) + 488: 72(ptr) AccessChain 27(data) 59 38 + 489: 20(ivec4) Load 488 + 490: 20(ivec4) GroupNonUniformBitwiseAnd 34 Reduce 489 + 491: 72(ptr) AccessChain 27(data) 487 38 + Store 491 490 + 492: 6(int) Load 8(invocation) + 493: 95(ptr) AccessChain 27(data) 29 49 30 + 494: 6(int) Load 493 + 495: 6(int) GroupNonUniformBitwiseAnd 34 Reduce 494 + 496: 95(ptr) AccessChain 27(data) 492 49 30 + Store 496 495 + 497: 6(int) Load 8(invocation) + 498: 102(ptr) AccessChain 27(data) 38 49 + 499: 21(ivec4) Load 498 + 500: 101(ivec2) VectorShuffle 499 499 0 1 + 501: 101(ivec2) GroupNonUniformBitwiseAnd 34 Reduce 500 + 502: 102(ptr) AccessChain 27(data) 497 49 + 503: 21(ivec4) Load 502 + 504: 21(ivec4) VectorShuffle 503 501 4 5 2 3 + Store 502 504 + 505: 6(int) Load 8(invocation) + 506: 102(ptr) AccessChain 27(data) 49 49 + 507: 21(ivec4) Load 506 + 508: 111(ivec3) VectorShuffle 507 507 0 1 2 + 509: 111(ivec3) GroupNonUniformBitwiseAnd 34 Reduce 508 + 510: 102(ptr) AccessChain 27(data) 505 49 + 511: 21(ivec4) Load 510 + 512: 21(ivec4) VectorShuffle 511 509 4 5 6 3 + Store 510 512 + 513: 6(int) Load 8(invocation) + 514: 102(ptr) AccessChain 27(data) 59 49 + 515: 21(ivec4) Load 514 + 516: 21(ivec4) GroupNonUniformBitwiseAnd 34 Reduce 515 + 517: 102(ptr) AccessChain 27(data) 513 49 + Store 517 516 + 518: 6(int) Load 8(invocation) + 519: 65(ptr) AccessChain 27(data) 29 38 30 + 520: 19(int) Load 519 + 522: 521(bool) SLessThan 520 29 + 523: 521(bool) GroupNonUniformLogicalAnd 34 Reduce 522 + 524: 19(int) Select 523 38 29 + 525: 65(ptr) AccessChain 27(data) 518 38 30 + Store 525 524 + 526: 6(int) Load 8(invocation) + 527: 72(ptr) AccessChain 27(data) 38 38 + 528: 20(ivec4) Load 527 + 529: 71(ivec2) VectorShuffle 528 528 0 1 + 532: 531(bvec2) SLessThan 529 530 + 533: 531(bvec2) GroupNonUniformLogicalAnd 34 Reduce 532 + 535: 71(ivec2) Select 533 534 530 + 536: 72(ptr) AccessChain 27(data) 526 38 + 537: 20(ivec4) Load 536 + 538: 20(ivec4) VectorShuffle 537 535 4 5 2 3 + Store 536 538 + 539: 6(int) Load 8(invocation) + 540: 72(ptr) AccessChain 27(data) 38 38 + 541: 20(ivec4) Load 540 + 542: 81(ivec3) VectorShuffle 541 541 0 1 2 + 545: 544(bvec3) SLessThan 542 543 + 546: 544(bvec3) GroupNonUniformLogicalAnd 34 Reduce 545 + 548: 81(ivec3) Select 546 547 543 + 549: 72(ptr) AccessChain 27(data) 539 38 + 550: 20(ivec4) Load 549 + 551: 20(ivec4) VectorShuffle 550 548 4 5 6 3 + Store 549 551 + 552: 6(int) Load 8(invocation) + 553: 72(ptr) AccessChain 27(data) 38 38 + 554: 20(ivec4) Load 553 + 557: 556(bvec4) SLessThan 554 555 + 558: 556(bvec4) GroupNonUniformLogicalAnd 34 Reduce 557 + 560: 20(ivec4) Select 558 559 555 + 561: 72(ptr) AccessChain 27(data) 552 38 + Store 561 560 + 562: 6(int) Load 8(invocation) + 563: 65(ptr) AccessChain 27(data) 29 38 30 + 564: 19(int) Load 563 + 565: 19(int) GroupNonUniformBitwiseOr 34 Reduce 564 + 566: 65(ptr) AccessChain 27(data) 562 38 30 + Store 566 565 + 567: 6(int) Load 8(invocation) + 568: 72(ptr) AccessChain 27(data) 38 38 + 569: 20(ivec4) Load 568 + 570: 71(ivec2) VectorShuffle 569 569 0 1 + 571: 71(ivec2) GroupNonUniformBitwiseOr 34 Reduce 570 + 572: 72(ptr) AccessChain 27(data) 567 38 + 573: 20(ivec4) Load 572 + 574: 20(ivec4) VectorShuffle 573 571 4 5 2 3 + Store 572 574 + 575: 6(int) Load 8(invocation) + 576: 72(ptr) AccessChain 27(data) 49 38 + 577: 20(ivec4) Load 576 + 578: 81(ivec3) VectorShuffle 577 577 0 1 2 + 579: 81(ivec3) GroupNonUniformBitwiseOr 34 Reduce 578 + 580: 72(ptr) AccessChain 27(data) 575 38 + 581: 20(ivec4) Load 580 + 582: 20(ivec4) VectorShuffle 581 579 4 5 6 3 + Store 580 582 + 583: 6(int) Load 8(invocation) + 584: 72(ptr) AccessChain 27(data) 59 38 + 585: 20(ivec4) Load 584 + 586: 20(ivec4) GroupNonUniformBitwiseOr 34 Reduce 585 + 587: 72(ptr) AccessChain 27(data) 583 38 + Store 587 586 + 588: 6(int) Load 8(invocation) + 589: 95(ptr) AccessChain 27(data) 29 49 30 + 590: 6(int) Load 589 + 591: 6(int) GroupNonUniformBitwiseOr 34 Reduce 590 + 592: 95(ptr) AccessChain 27(data) 588 49 30 + Store 592 591 + 593: 6(int) Load 8(invocation) + 594: 102(ptr) AccessChain 27(data) 38 49 + 595: 21(ivec4) Load 594 + 596: 101(ivec2) VectorShuffle 595 595 0 1 + 597: 101(ivec2) GroupNonUniformBitwiseOr 34 Reduce 596 + 598: 102(ptr) AccessChain 27(data) 593 49 + 599: 21(ivec4) Load 598 + 600: 21(ivec4) VectorShuffle 599 597 4 5 2 3 + Store 598 600 + 601: 6(int) Load 8(invocation) + 602: 102(ptr) AccessChain 27(data) 49 49 + 603: 21(ivec4) Load 602 + 604: 111(ivec3) VectorShuffle 603 603 0 1 2 + 605: 111(ivec3) GroupNonUniformBitwiseOr 34 Reduce 604 + 606: 102(ptr) AccessChain 27(data) 601 49 + 607: 21(ivec4) Load 606 + 608: 21(ivec4) VectorShuffle 607 605 4 5 6 3 + Store 606 608 + 609: 6(int) Load 8(invocation) + 610: 102(ptr) AccessChain 27(data) 59 49 + 611: 21(ivec4) Load 610 + 612: 21(ivec4) GroupNonUniformBitwiseOr 34 Reduce 611 + 613: 102(ptr) AccessChain 27(data) 609 49 + Store 613 612 + 614: 6(int) Load 8(invocation) + 615: 65(ptr) AccessChain 27(data) 29 38 30 + 616: 19(int) Load 615 + 617: 521(bool) SLessThan 616 29 + 618: 521(bool) GroupNonUniformLogicalOr 34 Reduce 617 + 619: 19(int) Select 618 38 29 + 620: 65(ptr) AccessChain 27(data) 614 38 30 + Store 620 619 + 621: 6(int) Load 8(invocation) + 622: 72(ptr) AccessChain 27(data) 38 38 + 623: 20(ivec4) Load 622 + 624: 71(ivec2) VectorShuffle 623 623 0 1 + 625: 531(bvec2) SLessThan 624 530 + 626: 531(bvec2) GroupNonUniformLogicalOr 34 Reduce 625 + 627: 71(ivec2) Select 626 534 530 + 628: 72(ptr) AccessChain 27(data) 621 38 + 629: 20(ivec4) Load 628 + 630: 20(ivec4) VectorShuffle 629 627 4 5 2 3 + Store 628 630 + 631: 6(int) Load 8(invocation) + 632: 72(ptr) AccessChain 27(data) 38 38 + 633: 20(ivec4) Load 632 + 634: 81(ivec3) VectorShuffle 633 633 0 1 2 + 635: 544(bvec3) SLessThan 634 543 + 636: 544(bvec3) GroupNonUniformLogicalOr 34 Reduce 635 + 637: 81(ivec3) Select 636 547 543 + 638: 72(ptr) AccessChain 27(data) 631 38 + 639: 20(ivec4) Load 638 + 640: 20(ivec4) VectorShuffle 639 637 4 5 6 3 + Store 638 640 + 641: 6(int) Load 8(invocation) + 642: 72(ptr) AccessChain 27(data) 38 38 + 643: 20(ivec4) Load 642 + 644: 556(bvec4) SLessThan 643 555 + 645: 556(bvec4) GroupNonUniformLogicalOr 34 Reduce 644 + 646: 20(ivec4) Select 645 559 555 + 647: 72(ptr) AccessChain 27(data) 641 38 + Store 647 646 + 648: 6(int) Load 8(invocation) + 649: 65(ptr) AccessChain 27(data) 29 38 30 + 650: 19(int) Load 649 + 651: 19(int) GroupNonUniformBitwiseXor 34 Reduce 650 + 652: 65(ptr) AccessChain 27(data) 648 38 30 + Store 652 651 + 653: 6(int) Load 8(invocation) + 654: 72(ptr) AccessChain 27(data) 38 38 + 655: 20(ivec4) Load 654 + 656: 71(ivec2) VectorShuffle 655 655 0 1 + 657: 71(ivec2) GroupNonUniformBitwiseXor 34 Reduce 656 + 658: 72(ptr) AccessChain 27(data) 653 38 + 659: 20(ivec4) Load 658 + 660: 20(ivec4) VectorShuffle 659 657 4 5 2 3 + Store 658 660 + 661: 6(int) Load 8(invocation) + 662: 72(ptr) AccessChain 27(data) 49 38 + 663: 20(ivec4) Load 662 + 664: 81(ivec3) VectorShuffle 663 663 0 1 2 + 665: 81(ivec3) GroupNonUniformBitwiseXor 34 Reduce 664 + 666: 72(ptr) AccessChain 27(data) 661 38 + 667: 20(ivec4) Load 666 + 668: 20(ivec4) VectorShuffle 667 665 4 5 6 3 + Store 666 668 + 669: 6(int) Load 8(invocation) + 670: 72(ptr) AccessChain 27(data) 59 38 + 671: 20(ivec4) Load 670 + 672: 20(ivec4) GroupNonUniformBitwiseXor 34 Reduce 671 + 673: 72(ptr) AccessChain 27(data) 669 38 + Store 673 672 + 674: 6(int) Load 8(invocation) + 675: 95(ptr) AccessChain 27(data) 29 49 30 + 676: 6(int) Load 675 + 677: 6(int) GroupNonUniformBitwiseXor 34 Reduce 676 + 678: 95(ptr) AccessChain 27(data) 674 49 30 + Store 678 677 + 679: 6(int) Load 8(invocation) + 680: 102(ptr) AccessChain 27(data) 38 49 + 681: 21(ivec4) Load 680 + 682: 101(ivec2) VectorShuffle 681 681 0 1 + 683: 101(ivec2) GroupNonUniformBitwiseXor 34 Reduce 682 + 684: 102(ptr) AccessChain 27(data) 679 49 + 685: 21(ivec4) Load 684 + 686: 21(ivec4) VectorShuffle 685 683 4 5 2 3 + Store 684 686 + 687: 6(int) Load 8(invocation) + 688: 102(ptr) AccessChain 27(data) 49 49 + 689: 21(ivec4) Load 688 + 690: 111(ivec3) VectorShuffle 689 689 0 1 2 + 691: 111(ivec3) GroupNonUniformBitwiseXor 34 Reduce 690 + 692: 102(ptr) AccessChain 27(data) 687 49 + 693: 21(ivec4) Load 692 + 694: 21(ivec4) VectorShuffle 693 691 4 5 6 3 + Store 692 694 + 695: 6(int) Load 8(invocation) + 696: 102(ptr) AccessChain 27(data) 59 49 + 697: 21(ivec4) Load 696 + 698: 21(ivec4) GroupNonUniformBitwiseXor 34 Reduce 697 + 699: 102(ptr) AccessChain 27(data) 695 49 + Store 699 698 + 700: 6(int) Load 8(invocation) + 701: 65(ptr) AccessChain 27(data) 29 38 30 + 702: 19(int) Load 701 + 703: 521(bool) SLessThan 702 29 + 704: 521(bool) GroupNonUniformLogicalXor 34 Reduce 703 + 705: 19(int) Select 704 38 29 + 706: 65(ptr) AccessChain 27(data) 700 38 30 + Store 706 705 + 707: 6(int) Load 8(invocation) + 708: 72(ptr) AccessChain 27(data) 38 38 + 709: 20(ivec4) Load 708 + 710: 71(ivec2) VectorShuffle 709 709 0 1 + 711: 531(bvec2) SLessThan 710 530 + 712: 531(bvec2) GroupNonUniformLogicalXor 34 Reduce 711 + 713: 71(ivec2) Select 712 534 530 + 714: 72(ptr) AccessChain 27(data) 707 38 + 715: 20(ivec4) Load 714 + 716: 20(ivec4) VectorShuffle 715 713 4 5 2 3 + Store 714 716 + 717: 6(int) Load 8(invocation) + 718: 72(ptr) AccessChain 27(data) 38 38 + 719: 20(ivec4) Load 718 + 720: 81(ivec3) VectorShuffle 719 719 0 1 2 + 721: 544(bvec3) SLessThan 720 543 + 722: 544(bvec3) GroupNonUniformLogicalXor 34 Reduce 721 + 723: 81(ivec3) Select 722 547 543 + 724: 72(ptr) AccessChain 27(data) 717 38 + 725: 20(ivec4) Load 724 + 726: 20(ivec4) VectorShuffle 725 723 4 5 6 3 + Store 724 726 + 727: 6(int) Load 8(invocation) + 728: 72(ptr) AccessChain 27(data) 38 38 + 729: 20(ivec4) Load 728 + 730: 556(bvec4) SLessThan 729 555 + 731: 556(bvec4) GroupNonUniformLogicalXor 34 Reduce 730 + 732: 20(ivec4) Select 731 559 555 + 733: 72(ptr) AccessChain 27(data) 727 38 + Store 733 732 + 734: 6(int) Load 8(invocation) + 735: 31(ptr) AccessChain 27(data) 29 29 30 + 736: 17(float) Load 735 + 737: 17(float) GroupNonUniformFAdd 34 InclusiveScan 736 + 738: 31(ptr) AccessChain 27(data) 734 29 30 + Store 738 737 + 739: 6(int) Load 8(invocation) + 740: 40(ptr) AccessChain 27(data) 38 29 + 741: 18(fvec4) Load 740 + 742: 39(fvec2) VectorShuffle 741 741 0 1 + 743: 39(fvec2) GroupNonUniformFAdd 34 InclusiveScan 742 + 744: 40(ptr) AccessChain 27(data) 739 29 + 745: 18(fvec4) Load 744 + 746: 18(fvec4) VectorShuffle 745 743 4 5 2 3 + Store 744 746 + 747: 6(int) Load 8(invocation) + 748: 40(ptr) AccessChain 27(data) 49 29 + 749: 18(fvec4) Load 748 + 750: 50(fvec3) VectorShuffle 749 749 0 1 2 + 751: 50(fvec3) GroupNonUniformFAdd 34 InclusiveScan 750 + 752: 40(ptr) AccessChain 27(data) 747 29 + 753: 18(fvec4) Load 752 + 754: 18(fvec4) VectorShuffle 753 751 4 5 6 3 + Store 752 754 + 755: 6(int) Load 8(invocation) + 756: 40(ptr) AccessChain 27(data) 59 29 + 757: 18(fvec4) Load 756 + 758: 18(fvec4) GroupNonUniformFAdd 34 InclusiveScan 757 + 759: 40(ptr) AccessChain 27(data) 755 29 + Store 759 758 + 760: 6(int) Load 8(invocation) + 761: 65(ptr) AccessChain 27(data) 29 38 30 + 762: 19(int) Load 761 + 763: 19(int) GroupNonUniformIAdd 34 InclusiveScan 762 + 764: 65(ptr) AccessChain 27(data) 760 38 30 + Store 764 763 + 765: 6(int) Load 8(invocation) + 766: 72(ptr) AccessChain 27(data) 38 38 + 767: 20(ivec4) Load 766 + 768: 71(ivec2) VectorShuffle 767 767 0 1 + 769: 71(ivec2) GroupNonUniformIAdd 34 InclusiveScan 768 + 770: 72(ptr) AccessChain 27(data) 765 38 + 771: 20(ivec4) Load 770 + 772: 20(ivec4) VectorShuffle 771 769 4 5 2 3 + Store 770 772 + 773: 6(int) Load 8(invocation) + 774: 72(ptr) AccessChain 27(data) 49 38 + 775: 20(ivec4) Load 774 + 776: 81(ivec3) VectorShuffle 775 775 0 1 2 + 777: 81(ivec3) GroupNonUniformIAdd 34 InclusiveScan 776 + 778: 72(ptr) AccessChain 27(data) 773 38 + 779: 20(ivec4) Load 778 + 780: 20(ivec4) VectorShuffle 779 777 4 5 6 3 + Store 778 780 + 781: 6(int) Load 8(invocation) + 782: 72(ptr) AccessChain 27(data) 59 38 + 783: 20(ivec4) Load 782 + 784: 20(ivec4) GroupNonUniformIAdd 34 InclusiveScan 783 + 785: 72(ptr) AccessChain 27(data) 781 38 + Store 785 784 + 786: 6(int) Load 8(invocation) + 787: 95(ptr) AccessChain 27(data) 29 49 30 + 788: 6(int) Load 787 + 789: 6(int) GroupNonUniformIAdd 34 InclusiveScan 788 + 790: 95(ptr) AccessChain 27(data) 786 49 30 + Store 790 789 + 791: 6(int) Load 8(invocation) + 792: 102(ptr) AccessChain 27(data) 38 49 + 793: 21(ivec4) Load 792 + 794: 101(ivec2) VectorShuffle 793 793 0 1 + 795: 101(ivec2) GroupNonUniformIAdd 34 InclusiveScan 794 + 796: 102(ptr) AccessChain 27(data) 791 49 + 797: 21(ivec4) Load 796 + 798: 21(ivec4) VectorShuffle 797 795 4 5 2 3 + Store 796 798 + 799: 6(int) Load 8(invocation) + 800: 102(ptr) AccessChain 27(data) 49 49 + 801: 21(ivec4) Load 800 + 802: 111(ivec3) VectorShuffle 801 801 0 1 2 + 803: 111(ivec3) GroupNonUniformIAdd 34 InclusiveScan 802 + 804: 102(ptr) AccessChain 27(data) 799 49 + 805: 21(ivec4) Load 804 + 806: 21(ivec4) VectorShuffle 805 803 4 5 6 3 + Store 804 806 + 807: 6(int) Load 8(invocation) + 808: 102(ptr) AccessChain 27(data) 59 49 + 809: 21(ivec4) Load 808 + 810: 21(ivec4) GroupNonUniformIAdd 34 InclusiveScan 809 + 811: 102(ptr) AccessChain 27(data) 807 49 + Store 811 810 + 812: 6(int) Load 8(invocation) + 813: 125(ptr) AccessChain 27(data) 29 59 30 + 814:22(float64_t) Load 813 + 815:22(float64_t) GroupNonUniformFAdd 34 InclusiveScan 814 + 816: 125(ptr) AccessChain 27(data) 812 59 30 + Store 816 815 + 817: 6(int) Load 8(invocation) + 818: 132(ptr) AccessChain 27(data) 38 59 + 819: 23(f64vec4) Load 818 + 820:131(f64vec2) VectorShuffle 819 819 0 1 + 821:131(f64vec2) GroupNonUniformFAdd 34 InclusiveScan 820 + 822: 132(ptr) AccessChain 27(data) 817 59 + 823: 23(f64vec4) Load 822 + 824: 23(f64vec4) VectorShuffle 823 821 4 5 2 3 + Store 822 824 + 825: 6(int) Load 8(invocation) + 826: 132(ptr) AccessChain 27(data) 49 59 + 827: 23(f64vec4) Load 826 + 828:141(f64vec3) VectorShuffle 827 827 0 1 2 + 829:141(f64vec3) GroupNonUniformFAdd 34 InclusiveScan 828 + 830: 132(ptr) AccessChain 27(data) 825 59 + 831: 23(f64vec4) Load 830 + 832: 23(f64vec4) VectorShuffle 831 829 4 5 6 3 + Store 830 832 + 833: 6(int) Load 8(invocation) + 834: 132(ptr) AccessChain 27(data) 59 59 + 835: 23(f64vec4) Load 834 + 836: 23(f64vec4) GroupNonUniformFAdd 34 InclusiveScan 835 + 837: 132(ptr) AccessChain 27(data) 833 59 + Store 837 836 + 838: 6(int) Load 8(invocation) + 839: 31(ptr) AccessChain 27(data) 29 29 30 + 840: 17(float) Load 839 + 841: 17(float) GroupNonUniformFMul 34 InclusiveScan 840 + 842: 31(ptr) AccessChain 27(data) 838 29 30 + Store 842 841 + 843: 6(int) Load 8(invocation) + 844: 40(ptr) AccessChain 27(data) 38 29 + 845: 18(fvec4) Load 844 + 846: 39(fvec2) VectorShuffle 845 845 0 1 + 847: 39(fvec2) GroupNonUniformFMul 34 InclusiveScan 846 + 848: 40(ptr) AccessChain 27(data) 843 29 + 849: 18(fvec4) Load 848 + 850: 18(fvec4) VectorShuffle 849 847 4 5 2 3 + Store 848 850 + 851: 6(int) Load 8(invocation) + 852: 40(ptr) AccessChain 27(data) 49 29 + 853: 18(fvec4) Load 852 + 854: 50(fvec3) VectorShuffle 853 853 0 1 2 + 855: 50(fvec3) GroupNonUniformFMul 34 InclusiveScan 854 + 856: 40(ptr) AccessChain 27(data) 851 29 + 857: 18(fvec4) Load 856 + 858: 18(fvec4) VectorShuffle 857 855 4 5 6 3 + Store 856 858 + 859: 6(int) Load 8(invocation) + 860: 40(ptr) AccessChain 27(data) 59 29 + 861: 18(fvec4) Load 860 + 862: 18(fvec4) GroupNonUniformFMul 34 InclusiveScan 861 + 863: 40(ptr) AccessChain 27(data) 859 29 + Store 863 862 + 864: 6(int) Load 8(invocation) + 865: 65(ptr) AccessChain 27(data) 29 38 30 + 866: 19(int) Load 865 + 867: 19(int) GroupNonUniformIMul 34 InclusiveScan 866 + 868: 65(ptr) AccessChain 27(data) 864 38 30 + Store 868 867 + 869: 6(int) Load 8(invocation) + 870: 72(ptr) AccessChain 27(data) 38 38 + 871: 20(ivec4) Load 870 + 872: 71(ivec2) VectorShuffle 871 871 0 1 + 873: 71(ivec2) GroupNonUniformIMul 34 InclusiveScan 872 + 874: 72(ptr) AccessChain 27(data) 869 38 + 875: 20(ivec4) Load 874 + 876: 20(ivec4) VectorShuffle 875 873 4 5 2 3 + Store 874 876 + 877: 6(int) Load 8(invocation) + 878: 72(ptr) AccessChain 27(data) 49 38 + 879: 20(ivec4) Load 878 + 880: 81(ivec3) VectorShuffle 879 879 0 1 2 + 881: 81(ivec3) GroupNonUniformIMul 34 InclusiveScan 880 + 882: 72(ptr) AccessChain 27(data) 877 38 + 883: 20(ivec4) Load 882 + 884: 20(ivec4) VectorShuffle 883 881 4 5 6 3 + Store 882 884 + 885: 6(int) Load 8(invocation) + 886: 72(ptr) AccessChain 27(data) 59 38 + 887: 20(ivec4) Load 886 + 888: 20(ivec4) GroupNonUniformIMul 34 InclusiveScan 887 + 889: 72(ptr) AccessChain 27(data) 885 38 + Store 889 888 + 890: 6(int) Load 8(invocation) + 891: 95(ptr) AccessChain 27(data) 29 49 30 + 892: 6(int) Load 891 + 893: 6(int) GroupNonUniformIMul 34 InclusiveScan 892 + 894: 95(ptr) AccessChain 27(data) 890 49 30 + Store 894 893 + 895: 6(int) Load 8(invocation) + 896: 102(ptr) AccessChain 27(data) 38 49 + 897: 21(ivec4) Load 896 + 898: 101(ivec2) VectorShuffle 897 897 0 1 + 899: 101(ivec2) GroupNonUniformIMul 34 InclusiveScan 898 + 900: 102(ptr) AccessChain 27(data) 895 49 + 901: 21(ivec4) Load 900 + 902: 21(ivec4) VectorShuffle 901 899 4 5 2 3 + Store 900 902 + 903: 6(int) Load 8(invocation) + 904: 102(ptr) AccessChain 27(data) 49 49 + 905: 21(ivec4) Load 904 + 906: 111(ivec3) VectorShuffle 905 905 0 1 2 + 907: 111(ivec3) GroupNonUniformIMul 34 InclusiveScan 906 + 908: 102(ptr) AccessChain 27(data) 903 49 + 909: 21(ivec4) Load 908 + 910: 21(ivec4) VectorShuffle 909 907 4 5 6 3 + Store 908 910 + 911: 6(int) Load 8(invocation) + 912: 102(ptr) AccessChain 27(data) 59 49 + 913: 21(ivec4) Load 912 + 914: 21(ivec4) GroupNonUniformIMul 34 InclusiveScan 913 + 915: 102(ptr) AccessChain 27(data) 911 49 + Store 915 914 + 916: 6(int) Load 8(invocation) + 917: 125(ptr) AccessChain 27(data) 29 59 30 + 918:22(float64_t) Load 917 + 919:22(float64_t) GroupNonUniformFMul 34 InclusiveScan 918 + 920: 125(ptr) AccessChain 27(data) 916 59 30 + Store 920 919 + 921: 6(int) Load 8(invocation) + 922: 132(ptr) AccessChain 27(data) 38 59 + 923: 23(f64vec4) Load 922 + 924:131(f64vec2) VectorShuffle 923 923 0 1 + 925:131(f64vec2) GroupNonUniformFMul 34 InclusiveScan 924 + 926: 132(ptr) AccessChain 27(data) 921 59 + 927: 23(f64vec4) Load 926 + 928: 23(f64vec4) VectorShuffle 927 925 4 5 2 3 + Store 926 928 + 929: 6(int) Load 8(invocation) + 930: 132(ptr) AccessChain 27(data) 49 59 + 931: 23(f64vec4) Load 930 + 932:141(f64vec3) VectorShuffle 931 931 0 1 2 + 933:141(f64vec3) GroupNonUniformFMul 34 InclusiveScan 932 + 934: 132(ptr) AccessChain 27(data) 929 59 + 935: 23(f64vec4) Load 934 + 936: 23(f64vec4) VectorShuffle 935 933 4 5 6 3 + Store 934 936 + 937: 6(int) Load 8(invocation) + 938: 132(ptr) AccessChain 27(data) 59 59 + 939: 23(f64vec4) Load 938 + 940: 23(f64vec4) GroupNonUniformFMul 34 InclusiveScan 939 + 941: 132(ptr) AccessChain 27(data) 937 59 + Store 941 940 + 942: 6(int) Load 8(invocation) + 943: 31(ptr) AccessChain 27(data) 29 29 30 + 944: 17(float) Load 943 + 945: 17(float) GroupNonUniformFMin 34 InclusiveScan 944 + 946: 31(ptr) AccessChain 27(data) 942 29 30 + Store 946 945 + 947: 6(int) Load 8(invocation) + 948: 40(ptr) AccessChain 27(data) 38 29 + 949: 18(fvec4) Load 948 + 950: 39(fvec2) VectorShuffle 949 949 0 1 + 951: 39(fvec2) GroupNonUniformFMin 34 InclusiveScan 950 + 952: 40(ptr) AccessChain 27(data) 947 29 + 953: 18(fvec4) Load 952 + 954: 18(fvec4) VectorShuffle 953 951 4 5 2 3 + Store 952 954 + 955: 6(int) Load 8(invocation) + 956: 40(ptr) AccessChain 27(data) 49 29 + 957: 18(fvec4) Load 956 + 958: 50(fvec3) VectorShuffle 957 957 0 1 2 + 959: 50(fvec3) GroupNonUniformFMin 34 InclusiveScan 958 + 960: 40(ptr) AccessChain 27(data) 955 29 + 961: 18(fvec4) Load 960 + 962: 18(fvec4) VectorShuffle 961 959 4 5 6 3 + Store 960 962 + 963: 6(int) Load 8(invocation) + 964: 40(ptr) AccessChain 27(data) 59 29 + 965: 18(fvec4) Load 964 + 966: 18(fvec4) GroupNonUniformFMin 34 InclusiveScan 965 + 967: 40(ptr) AccessChain 27(data) 963 29 + Store 967 966 + 968: 6(int) Load 8(invocation) + 969: 65(ptr) AccessChain 27(data) 29 38 30 + 970: 19(int) Load 969 + 971: 19(int) GroupNonUniformSMin 34 InclusiveScan 970 + 972: 65(ptr) AccessChain 27(data) 968 38 30 + Store 972 971 + 973: 6(int) Load 8(invocation) + 974: 72(ptr) AccessChain 27(data) 38 38 + 975: 20(ivec4) Load 974 + 976: 71(ivec2) VectorShuffle 975 975 0 1 + 977: 71(ivec2) GroupNonUniformSMin 34 InclusiveScan 976 + 978: 72(ptr) AccessChain 27(data) 973 38 + 979: 20(ivec4) Load 978 + 980: 20(ivec4) VectorShuffle 979 977 4 5 2 3 + Store 978 980 + 981: 6(int) Load 8(invocation) + 982: 72(ptr) AccessChain 27(data) 49 38 + 983: 20(ivec4) Load 982 + 984: 81(ivec3) VectorShuffle 983 983 0 1 2 + 985: 81(ivec3) GroupNonUniformSMin 34 InclusiveScan 984 + 986: 72(ptr) AccessChain 27(data) 981 38 + 987: 20(ivec4) Load 986 + 988: 20(ivec4) VectorShuffle 987 985 4 5 6 3 + Store 986 988 + 989: 6(int) Load 8(invocation) + 990: 72(ptr) AccessChain 27(data) 59 38 + 991: 20(ivec4) Load 990 + 992: 20(ivec4) GroupNonUniformSMin 34 InclusiveScan 991 + 993: 72(ptr) AccessChain 27(data) 989 38 + Store 993 992 + 994: 6(int) Load 8(invocation) + 995: 95(ptr) AccessChain 27(data) 29 49 30 + 996: 6(int) Load 995 + 997: 6(int) GroupNonUniformUMin 34 InclusiveScan 996 + 998: 95(ptr) AccessChain 27(data) 994 49 30 + Store 998 997 + 999: 6(int) Load 8(invocation) + 1000: 102(ptr) AccessChain 27(data) 38 49 + 1001: 21(ivec4) Load 1000 + 1002: 101(ivec2) VectorShuffle 1001 1001 0 1 + 1003: 101(ivec2) GroupNonUniformUMin 34 InclusiveScan 1002 + 1004: 102(ptr) AccessChain 27(data) 999 49 + 1005: 21(ivec4) Load 1004 + 1006: 21(ivec4) VectorShuffle 1005 1003 4 5 2 3 + Store 1004 1006 + 1007: 6(int) Load 8(invocation) + 1008: 102(ptr) AccessChain 27(data) 49 49 + 1009: 21(ivec4) Load 1008 + 1010: 111(ivec3) VectorShuffle 1009 1009 0 1 2 + 1011: 111(ivec3) GroupNonUniformUMin 34 InclusiveScan 1010 + 1012: 102(ptr) AccessChain 27(data) 1007 49 + 1013: 21(ivec4) Load 1012 + 1014: 21(ivec4) VectorShuffle 1013 1011 4 5 6 3 + Store 1012 1014 + 1015: 6(int) Load 8(invocation) + 1016: 102(ptr) AccessChain 27(data) 59 49 + 1017: 21(ivec4) Load 1016 + 1018: 21(ivec4) GroupNonUniformUMin 34 InclusiveScan 1017 + 1019: 102(ptr) AccessChain 27(data) 1015 49 + Store 1019 1018 + 1020: 6(int) Load 8(invocation) + 1021: 125(ptr) AccessChain 27(data) 29 59 30 + 1022:22(float64_t) Load 1021 + 1023:22(float64_t) GroupNonUniformFMin 34 InclusiveScan 1022 + 1024: 125(ptr) AccessChain 27(data) 1020 59 30 + Store 1024 1023 + 1025: 6(int) Load 8(invocation) + 1026: 132(ptr) AccessChain 27(data) 38 59 + 1027: 23(f64vec4) Load 1026 + 1028:131(f64vec2) VectorShuffle 1027 1027 0 1 + 1029:131(f64vec2) GroupNonUniformFMin 34 InclusiveScan 1028 + 1030: 132(ptr) AccessChain 27(data) 1025 59 + 1031: 23(f64vec4) Load 1030 + 1032: 23(f64vec4) VectorShuffle 1031 1029 4 5 2 3 + Store 1030 1032 + 1033: 6(int) Load 8(invocation) + 1034: 132(ptr) AccessChain 27(data) 49 59 + 1035: 23(f64vec4) Load 1034 + 1036:141(f64vec3) VectorShuffle 1035 1035 0 1 2 + 1037:141(f64vec3) GroupNonUniformFMin 34 InclusiveScan 1036 + 1038: 132(ptr) AccessChain 27(data) 1033 59 + 1039: 23(f64vec4) Load 1038 + 1040: 23(f64vec4) VectorShuffle 1039 1037 4 5 6 3 + Store 1038 1040 + 1041: 6(int) Load 8(invocation) + 1042: 132(ptr) AccessChain 27(data) 59 59 + 1043: 23(f64vec4) Load 1042 + 1044: 23(f64vec4) GroupNonUniformFMin 34 InclusiveScan 1043 + 1045: 132(ptr) AccessChain 27(data) 1041 59 + Store 1045 1044 + 1046: 6(int) Load 8(invocation) + 1047: 31(ptr) AccessChain 27(data) 29 29 30 + 1048: 17(float) Load 1047 + 1049: 17(float) GroupNonUniformFMax 34 InclusiveScan 1048 + 1050: 31(ptr) AccessChain 27(data) 1046 29 30 + Store 1050 1049 + 1051: 6(int) Load 8(invocation) + 1052: 40(ptr) AccessChain 27(data) 38 29 + 1053: 18(fvec4) Load 1052 + 1054: 39(fvec2) VectorShuffle 1053 1053 0 1 + 1055: 39(fvec2) GroupNonUniformFMax 34 InclusiveScan 1054 + 1056: 40(ptr) AccessChain 27(data) 1051 29 + 1057: 18(fvec4) Load 1056 + 1058: 18(fvec4) VectorShuffle 1057 1055 4 5 2 3 + Store 1056 1058 + 1059: 6(int) Load 8(invocation) + 1060: 40(ptr) AccessChain 27(data) 49 29 + 1061: 18(fvec4) Load 1060 + 1062: 50(fvec3) VectorShuffle 1061 1061 0 1 2 + 1063: 50(fvec3) GroupNonUniformFMax 34 InclusiveScan 1062 + 1064: 40(ptr) AccessChain 27(data) 1059 29 + 1065: 18(fvec4) Load 1064 + 1066: 18(fvec4) VectorShuffle 1065 1063 4 5 6 3 + Store 1064 1066 + 1067: 6(int) Load 8(invocation) + 1068: 40(ptr) AccessChain 27(data) 59 29 + 1069: 18(fvec4) Load 1068 + 1070: 18(fvec4) GroupNonUniformFMax 34 InclusiveScan 1069 + 1071: 40(ptr) AccessChain 27(data) 1067 29 + Store 1071 1070 + 1072: 6(int) Load 8(invocation) + 1073: 65(ptr) AccessChain 27(data) 29 38 30 + 1074: 19(int) Load 1073 + 1075: 19(int) GroupNonUniformSMax 34 InclusiveScan 1074 + 1076: 65(ptr) AccessChain 27(data) 1072 38 30 + Store 1076 1075 + 1077: 6(int) Load 8(invocation) + 1078: 72(ptr) AccessChain 27(data) 38 38 + 1079: 20(ivec4) Load 1078 + 1080: 71(ivec2) VectorShuffle 1079 1079 0 1 + 1081: 71(ivec2) GroupNonUniformSMax 34 InclusiveScan 1080 + 1082: 72(ptr) AccessChain 27(data) 1077 38 + 1083: 20(ivec4) Load 1082 + 1084: 20(ivec4) VectorShuffle 1083 1081 4 5 2 3 + Store 1082 1084 + 1085: 6(int) Load 8(invocation) + 1086: 72(ptr) AccessChain 27(data) 49 38 + 1087: 20(ivec4) Load 1086 + 1088: 81(ivec3) VectorShuffle 1087 1087 0 1 2 + 1089: 81(ivec3) GroupNonUniformSMax 34 InclusiveScan 1088 + 1090: 72(ptr) AccessChain 27(data) 1085 38 + 1091: 20(ivec4) Load 1090 + 1092: 20(ivec4) VectorShuffle 1091 1089 4 5 6 3 + Store 1090 1092 + 1093: 6(int) Load 8(invocation) + 1094: 72(ptr) AccessChain 27(data) 59 38 + 1095: 20(ivec4) Load 1094 + 1096: 20(ivec4) GroupNonUniformSMax 34 InclusiveScan 1095 + 1097: 72(ptr) AccessChain 27(data) 1093 38 + Store 1097 1096 + 1098: 6(int) Load 8(invocation) + 1099: 95(ptr) AccessChain 27(data) 29 49 30 + 1100: 6(int) Load 1099 + 1101: 6(int) GroupNonUniformUMax 34 InclusiveScan 1100 + 1102: 95(ptr) AccessChain 27(data) 1098 49 30 + Store 1102 1101 + 1103: 6(int) Load 8(invocation) + 1104: 102(ptr) AccessChain 27(data) 38 49 + 1105: 21(ivec4) Load 1104 + 1106: 101(ivec2) VectorShuffle 1105 1105 0 1 + 1107: 101(ivec2) GroupNonUniformUMax 34 InclusiveScan 1106 + 1108: 102(ptr) AccessChain 27(data) 1103 49 + 1109: 21(ivec4) Load 1108 + 1110: 21(ivec4) VectorShuffle 1109 1107 4 5 2 3 + Store 1108 1110 + 1111: 6(int) Load 8(invocation) + 1112: 102(ptr) AccessChain 27(data) 49 49 + 1113: 21(ivec4) Load 1112 + 1114: 111(ivec3) VectorShuffle 1113 1113 0 1 2 + 1115: 111(ivec3) GroupNonUniformUMax 34 InclusiveScan 1114 + 1116: 102(ptr) AccessChain 27(data) 1111 49 + 1117: 21(ivec4) Load 1116 + 1118: 21(ivec4) VectorShuffle 1117 1115 4 5 6 3 + Store 1116 1118 + 1119: 6(int) Load 8(invocation) + 1120: 102(ptr) AccessChain 27(data) 59 49 + 1121: 21(ivec4) Load 1120 + 1122: 21(ivec4) GroupNonUniformUMax 34 InclusiveScan 1121 + 1123: 102(ptr) AccessChain 27(data) 1119 49 + Store 1123 1122 + 1124: 6(int) Load 8(invocation) + 1125: 125(ptr) AccessChain 27(data) 29 59 30 + 1126:22(float64_t) Load 1125 + 1127:22(float64_t) GroupNonUniformFMax 34 InclusiveScan 1126 + 1128: 125(ptr) AccessChain 27(data) 1124 59 30 + Store 1128 1127 + 1129: 6(int) Load 8(invocation) + 1130: 132(ptr) AccessChain 27(data) 38 59 + 1131: 23(f64vec4) Load 1130 + 1132:131(f64vec2) VectorShuffle 1131 1131 0 1 + 1133:131(f64vec2) GroupNonUniformFMax 34 InclusiveScan 1132 + 1134: 132(ptr) AccessChain 27(data) 1129 59 + 1135: 23(f64vec4) Load 1134 + 1136: 23(f64vec4) VectorShuffle 1135 1133 4 5 2 3 + Store 1134 1136 + 1137: 6(int) Load 8(invocation) + 1138: 132(ptr) AccessChain 27(data) 49 59 + 1139: 23(f64vec4) Load 1138 + 1140:141(f64vec3) VectorShuffle 1139 1139 0 1 2 + 1141:141(f64vec3) GroupNonUniformFMax 34 InclusiveScan 1140 + 1142: 132(ptr) AccessChain 27(data) 1137 59 + 1143: 23(f64vec4) Load 1142 + 1144: 23(f64vec4) VectorShuffle 1143 1141 4 5 6 3 + Store 1142 1144 + 1145: 6(int) Load 8(invocation) + 1146: 132(ptr) AccessChain 27(data) 59 59 + 1147: 23(f64vec4) Load 1146 + 1148: 23(f64vec4) GroupNonUniformFMax 34 InclusiveScan 1147 + 1149: 132(ptr) AccessChain 27(data) 1145 59 + Store 1149 1148 + 1150: 6(int) Load 8(invocation) + 1151: 65(ptr) AccessChain 27(data) 29 38 30 + 1152: 19(int) Load 1151 + 1153: 19(int) GroupNonUniformBitwiseAnd 34 InclusiveScan 1152 + 1154: 65(ptr) AccessChain 27(data) 1150 38 30 + Store 1154 1153 + 1155: 6(int) Load 8(invocation) + 1156: 72(ptr) AccessChain 27(data) 38 38 + 1157: 20(ivec4) Load 1156 + 1158: 71(ivec2) VectorShuffle 1157 1157 0 1 + 1159: 71(ivec2) GroupNonUniformBitwiseAnd 34 InclusiveScan 1158 + 1160: 72(ptr) AccessChain 27(data) 1155 38 + 1161: 20(ivec4) Load 1160 + 1162: 20(ivec4) VectorShuffle 1161 1159 4 5 2 3 + Store 1160 1162 + 1163: 6(int) Load 8(invocation) + 1164: 72(ptr) AccessChain 27(data) 49 38 + 1165: 20(ivec4) Load 1164 + 1166: 81(ivec3) VectorShuffle 1165 1165 0 1 2 + 1167: 81(ivec3) GroupNonUniformBitwiseAnd 34 InclusiveScan 1166 + 1168: 72(ptr) AccessChain 27(data) 1163 38 + 1169: 20(ivec4) Load 1168 + 1170: 20(ivec4) VectorShuffle 1169 1167 4 5 6 3 + Store 1168 1170 + 1171: 6(int) Load 8(invocation) + 1172: 72(ptr) AccessChain 27(data) 59 38 + 1173: 20(ivec4) Load 1172 + 1174: 20(ivec4) GroupNonUniformBitwiseAnd 34 InclusiveScan 1173 + 1175: 72(ptr) AccessChain 27(data) 1171 38 + Store 1175 1174 + 1176: 6(int) Load 8(invocation) + 1177: 95(ptr) AccessChain 27(data) 29 49 30 + 1178: 6(int) Load 1177 + 1179: 6(int) GroupNonUniformBitwiseAnd 34 InclusiveScan 1178 + 1180: 95(ptr) AccessChain 27(data) 1176 49 30 + Store 1180 1179 + 1181: 6(int) Load 8(invocation) + 1182: 102(ptr) AccessChain 27(data) 38 49 + 1183: 21(ivec4) Load 1182 + 1184: 101(ivec2) VectorShuffle 1183 1183 0 1 + 1185: 101(ivec2) GroupNonUniformBitwiseAnd 34 InclusiveScan 1184 + 1186: 102(ptr) AccessChain 27(data) 1181 49 + 1187: 21(ivec4) Load 1186 + 1188: 21(ivec4) VectorShuffle 1187 1185 4 5 2 3 + Store 1186 1188 + 1189: 6(int) Load 8(invocation) + 1190: 102(ptr) AccessChain 27(data) 49 49 + 1191: 21(ivec4) Load 1190 + 1192: 111(ivec3) VectorShuffle 1191 1191 0 1 2 + 1193: 111(ivec3) GroupNonUniformBitwiseAnd 34 InclusiveScan 1192 + 1194: 102(ptr) AccessChain 27(data) 1189 49 + 1195: 21(ivec4) Load 1194 + 1196: 21(ivec4) VectorShuffle 1195 1193 4 5 6 3 + Store 1194 1196 + 1197: 6(int) Load 8(invocation) + 1198: 102(ptr) AccessChain 27(data) 59 49 + 1199: 21(ivec4) Load 1198 + 1200: 21(ivec4) GroupNonUniformBitwiseAnd 34 InclusiveScan 1199 + 1201: 102(ptr) AccessChain 27(data) 1197 49 + Store 1201 1200 + 1202: 6(int) Load 8(invocation) + 1203: 65(ptr) AccessChain 27(data) 29 38 30 + 1204: 19(int) Load 1203 + 1205: 521(bool) SLessThan 1204 29 + 1206: 521(bool) GroupNonUniformLogicalAnd 34 InclusiveScan 1205 + 1207: 19(int) Select 1206 38 29 + 1208: 65(ptr) AccessChain 27(data) 1202 38 30 + Store 1208 1207 + 1209: 6(int) Load 8(invocation) + 1210: 72(ptr) AccessChain 27(data) 38 38 + 1211: 20(ivec4) Load 1210 + 1212: 71(ivec2) VectorShuffle 1211 1211 0 1 + 1213: 531(bvec2) SLessThan 1212 530 + 1214: 531(bvec2) GroupNonUniformLogicalAnd 34 InclusiveScan 1213 + 1215: 71(ivec2) Select 1214 534 530 + 1216: 72(ptr) AccessChain 27(data) 1209 38 + 1217: 20(ivec4) Load 1216 + 1218: 20(ivec4) VectorShuffle 1217 1215 4 5 2 3 + Store 1216 1218 + 1219: 6(int) Load 8(invocation) + 1220: 72(ptr) AccessChain 27(data) 38 38 + 1221: 20(ivec4) Load 1220 + 1222: 81(ivec3) VectorShuffle 1221 1221 0 1 2 + 1223: 544(bvec3) SLessThan 1222 543 + 1224: 544(bvec3) GroupNonUniformLogicalAnd 34 InclusiveScan 1223 + 1225: 81(ivec3) Select 1224 547 543 + 1226: 72(ptr) AccessChain 27(data) 1219 38 + 1227: 20(ivec4) Load 1226 + 1228: 20(ivec4) VectorShuffle 1227 1225 4 5 6 3 + Store 1226 1228 + 1229: 6(int) Load 8(invocation) + 1230: 72(ptr) AccessChain 27(data) 38 38 + 1231: 20(ivec4) Load 1230 + 1232: 556(bvec4) SLessThan 1231 555 + 1233: 556(bvec4) GroupNonUniformLogicalAnd 34 InclusiveScan 1232 + 1234: 20(ivec4) Select 1233 559 555 + 1235: 72(ptr) AccessChain 27(data) 1229 38 + Store 1235 1234 + 1236: 6(int) Load 8(invocation) + 1237: 65(ptr) AccessChain 27(data) 29 38 30 + 1238: 19(int) Load 1237 + 1239: 19(int) GroupNonUniformBitwiseOr 34 InclusiveScan 1238 + 1240: 65(ptr) AccessChain 27(data) 1236 38 30 + Store 1240 1239 + 1241: 6(int) Load 8(invocation) + 1242: 72(ptr) AccessChain 27(data) 38 38 + 1243: 20(ivec4) Load 1242 + 1244: 71(ivec2) VectorShuffle 1243 1243 0 1 + 1245: 71(ivec2) GroupNonUniformBitwiseOr 34 InclusiveScan 1244 + 1246: 72(ptr) AccessChain 27(data) 1241 38 + 1247: 20(ivec4) Load 1246 + 1248: 20(ivec4) VectorShuffle 1247 1245 4 5 2 3 + Store 1246 1248 + 1249: 6(int) Load 8(invocation) + 1250: 72(ptr) AccessChain 27(data) 49 38 + 1251: 20(ivec4) Load 1250 + 1252: 81(ivec3) VectorShuffle 1251 1251 0 1 2 + 1253: 81(ivec3) GroupNonUniformBitwiseOr 34 InclusiveScan 1252 + 1254: 72(ptr) AccessChain 27(data) 1249 38 + 1255: 20(ivec4) Load 1254 + 1256: 20(ivec4) VectorShuffle 1255 1253 4 5 6 3 + Store 1254 1256 + 1257: 6(int) Load 8(invocation) + 1258: 72(ptr) AccessChain 27(data) 59 38 + 1259: 20(ivec4) Load 1258 + 1260: 20(ivec4) GroupNonUniformBitwiseOr 34 InclusiveScan 1259 + 1261: 72(ptr) AccessChain 27(data) 1257 38 + Store 1261 1260 + 1262: 6(int) Load 8(invocation) + 1263: 95(ptr) AccessChain 27(data) 29 49 30 + 1264: 6(int) Load 1263 + 1265: 6(int) GroupNonUniformBitwiseOr 34 InclusiveScan 1264 + 1266: 95(ptr) AccessChain 27(data) 1262 49 30 + Store 1266 1265 + 1267: 6(int) Load 8(invocation) + 1268: 102(ptr) AccessChain 27(data) 38 49 + 1269: 21(ivec4) Load 1268 + 1270: 101(ivec2) VectorShuffle 1269 1269 0 1 + 1271: 101(ivec2) GroupNonUniformBitwiseOr 34 InclusiveScan 1270 + 1272: 102(ptr) AccessChain 27(data) 1267 49 + 1273: 21(ivec4) Load 1272 + 1274: 21(ivec4) VectorShuffle 1273 1271 4 5 2 3 + Store 1272 1274 + 1275: 6(int) Load 8(invocation) + 1276: 102(ptr) AccessChain 27(data) 49 49 + 1277: 21(ivec4) Load 1276 + 1278: 111(ivec3) VectorShuffle 1277 1277 0 1 2 + 1279: 111(ivec3) GroupNonUniformBitwiseOr 34 InclusiveScan 1278 + 1280: 102(ptr) AccessChain 27(data) 1275 49 + 1281: 21(ivec4) Load 1280 + 1282: 21(ivec4) VectorShuffle 1281 1279 4 5 6 3 + Store 1280 1282 + 1283: 6(int) Load 8(invocation) + 1284: 102(ptr) AccessChain 27(data) 59 49 + 1285: 21(ivec4) Load 1284 + 1286: 21(ivec4) GroupNonUniformBitwiseOr 34 InclusiveScan 1285 + 1287: 102(ptr) AccessChain 27(data) 1283 49 + Store 1287 1286 + 1288: 6(int) Load 8(invocation) + 1289: 65(ptr) AccessChain 27(data) 29 38 30 + 1290: 19(int) Load 1289 + 1291: 521(bool) SLessThan 1290 29 + 1292: 521(bool) GroupNonUniformLogicalOr 34 InclusiveScan 1291 + 1293: 19(int) Select 1292 38 29 + 1294: 65(ptr) AccessChain 27(data) 1288 38 30 + Store 1294 1293 + 1295: 6(int) Load 8(invocation) + 1296: 72(ptr) AccessChain 27(data) 38 38 + 1297: 20(ivec4) Load 1296 + 1298: 71(ivec2) VectorShuffle 1297 1297 0 1 + 1299: 531(bvec2) SLessThan 1298 530 + 1300: 531(bvec2) GroupNonUniformLogicalOr 34 InclusiveScan 1299 + 1301: 71(ivec2) Select 1300 534 530 + 1302: 72(ptr) AccessChain 27(data) 1295 38 + 1303: 20(ivec4) Load 1302 + 1304: 20(ivec4) VectorShuffle 1303 1301 4 5 2 3 + Store 1302 1304 + 1305: 6(int) Load 8(invocation) + 1306: 72(ptr) AccessChain 27(data) 38 38 + 1307: 20(ivec4) Load 1306 + 1308: 81(ivec3) VectorShuffle 1307 1307 0 1 2 + 1309: 544(bvec3) SLessThan 1308 543 + 1310: 544(bvec3) GroupNonUniformLogicalOr 34 InclusiveScan 1309 + 1311: 81(ivec3) Select 1310 547 543 + 1312: 72(ptr) AccessChain 27(data) 1305 38 + 1313: 20(ivec4) Load 1312 + 1314: 20(ivec4) VectorShuffle 1313 1311 4 5 6 3 + Store 1312 1314 + 1315: 6(int) Load 8(invocation) + 1316: 72(ptr) AccessChain 27(data) 38 38 + 1317: 20(ivec4) Load 1316 + 1318: 556(bvec4) SLessThan 1317 555 + 1319: 556(bvec4) GroupNonUniformLogicalOr 34 InclusiveScan 1318 + 1320: 20(ivec4) Select 1319 559 555 + 1321: 72(ptr) AccessChain 27(data) 1315 38 + Store 1321 1320 + 1322: 6(int) Load 8(invocation) + 1323: 65(ptr) AccessChain 27(data) 29 38 30 + 1324: 19(int) Load 1323 + 1325: 19(int) GroupNonUniformBitwiseXor 34 InclusiveScan 1324 + 1326: 65(ptr) AccessChain 27(data) 1322 38 30 + Store 1326 1325 + 1327: 6(int) Load 8(invocation) + 1328: 72(ptr) AccessChain 27(data) 38 38 + 1329: 20(ivec4) Load 1328 + 1330: 71(ivec2) VectorShuffle 1329 1329 0 1 + 1331: 71(ivec2) GroupNonUniformBitwiseXor 34 InclusiveScan 1330 + 1332: 72(ptr) AccessChain 27(data) 1327 38 + 1333: 20(ivec4) Load 1332 + 1334: 20(ivec4) VectorShuffle 1333 1331 4 5 2 3 + Store 1332 1334 + 1335: 6(int) Load 8(invocation) + 1336: 72(ptr) AccessChain 27(data) 49 38 + 1337: 20(ivec4) Load 1336 + 1338: 81(ivec3) VectorShuffle 1337 1337 0 1 2 + 1339: 81(ivec3) GroupNonUniformBitwiseXor 34 InclusiveScan 1338 + 1340: 72(ptr) AccessChain 27(data) 1335 38 + 1341: 20(ivec4) Load 1340 + 1342: 20(ivec4) VectorShuffle 1341 1339 4 5 6 3 + Store 1340 1342 + 1343: 6(int) Load 8(invocation) + 1344: 72(ptr) AccessChain 27(data) 59 38 + 1345: 20(ivec4) Load 1344 + 1346: 20(ivec4) GroupNonUniformBitwiseXor 34 InclusiveScan 1345 + 1347: 72(ptr) AccessChain 27(data) 1343 38 + Store 1347 1346 + 1348: 6(int) Load 8(invocation) + 1349: 95(ptr) AccessChain 27(data) 29 49 30 + 1350: 6(int) Load 1349 + 1351: 6(int) GroupNonUniformBitwiseXor 34 InclusiveScan 1350 + 1352: 95(ptr) AccessChain 27(data) 1348 49 30 + Store 1352 1351 + 1353: 6(int) Load 8(invocation) + 1354: 102(ptr) AccessChain 27(data) 38 49 + 1355: 21(ivec4) Load 1354 + 1356: 101(ivec2) VectorShuffle 1355 1355 0 1 + 1357: 101(ivec2) GroupNonUniformBitwiseXor 34 InclusiveScan 1356 + 1358: 102(ptr) AccessChain 27(data) 1353 49 + 1359: 21(ivec4) Load 1358 + 1360: 21(ivec4) VectorShuffle 1359 1357 4 5 2 3 + Store 1358 1360 + 1361: 6(int) Load 8(invocation) + 1362: 102(ptr) AccessChain 27(data) 49 49 + 1363: 21(ivec4) Load 1362 + 1364: 111(ivec3) VectorShuffle 1363 1363 0 1 2 + 1365: 111(ivec3) GroupNonUniformBitwiseXor 34 InclusiveScan 1364 + 1366: 102(ptr) AccessChain 27(data) 1361 49 + 1367: 21(ivec4) Load 1366 + 1368: 21(ivec4) VectorShuffle 1367 1365 4 5 6 3 + Store 1366 1368 + 1369: 6(int) Load 8(invocation) + 1370: 102(ptr) AccessChain 27(data) 59 49 + 1371: 21(ivec4) Load 1370 + 1372: 21(ivec4) GroupNonUniformBitwiseXor 34 InclusiveScan 1371 + 1373: 102(ptr) AccessChain 27(data) 1369 49 + Store 1373 1372 + 1374: 6(int) Load 8(invocation) + 1375: 65(ptr) AccessChain 27(data) 29 38 30 + 1376: 19(int) Load 1375 + 1377: 521(bool) SLessThan 1376 29 + 1378: 521(bool) GroupNonUniformLogicalXor 34 InclusiveScan 1377 + 1379: 19(int) Select 1378 38 29 + 1380: 65(ptr) AccessChain 27(data) 1374 38 30 + Store 1380 1379 + 1381: 6(int) Load 8(invocation) + 1382: 72(ptr) AccessChain 27(data) 38 38 + 1383: 20(ivec4) Load 1382 + 1384: 71(ivec2) VectorShuffle 1383 1383 0 1 + 1385: 531(bvec2) SLessThan 1384 530 + 1386: 531(bvec2) GroupNonUniformLogicalXor 34 InclusiveScan 1385 + 1387: 71(ivec2) Select 1386 534 530 + 1388: 72(ptr) AccessChain 27(data) 1381 38 + 1389: 20(ivec4) Load 1388 + 1390: 20(ivec4) VectorShuffle 1389 1387 4 5 2 3 + Store 1388 1390 + 1391: 6(int) Load 8(invocation) + 1392: 72(ptr) AccessChain 27(data) 38 38 + 1393: 20(ivec4) Load 1392 + 1394: 81(ivec3) VectorShuffle 1393 1393 0 1 2 + 1395: 544(bvec3) SLessThan 1394 543 + 1396: 544(bvec3) GroupNonUniformLogicalXor 34 InclusiveScan 1395 + 1397: 81(ivec3) Select 1396 547 543 + 1398: 72(ptr) AccessChain 27(data) 1391 38 + 1399: 20(ivec4) Load 1398 + 1400: 20(ivec4) VectorShuffle 1399 1397 4 5 6 3 + Store 1398 1400 + 1401: 6(int) Load 8(invocation) + 1402: 72(ptr) AccessChain 27(data) 38 38 + 1403: 20(ivec4) Load 1402 + 1404: 556(bvec4) SLessThan 1403 555 + 1405: 556(bvec4) GroupNonUniformLogicalXor 34 InclusiveScan 1404 + 1406: 20(ivec4) Select 1405 559 555 + 1407: 72(ptr) AccessChain 27(data) 1401 38 + Store 1407 1406 + 1408: 6(int) Load 8(invocation) + 1409: 31(ptr) AccessChain 27(data) 29 29 30 + 1410: 17(float) Load 1409 + 1411: 17(float) GroupNonUniformFAdd 34 ExclusiveScan 1410 + 1412: 31(ptr) AccessChain 27(data) 1408 29 30 + Store 1412 1411 + 1413: 6(int) Load 8(invocation) + 1414: 40(ptr) AccessChain 27(data) 38 29 + 1415: 18(fvec4) Load 1414 + 1416: 39(fvec2) VectorShuffle 1415 1415 0 1 + 1417: 39(fvec2) GroupNonUniformFAdd 34 ExclusiveScan 1416 + 1418: 40(ptr) AccessChain 27(data) 1413 29 + 1419: 18(fvec4) Load 1418 + 1420: 18(fvec4) VectorShuffle 1419 1417 4 5 2 3 + Store 1418 1420 + 1421: 6(int) Load 8(invocation) + 1422: 40(ptr) AccessChain 27(data) 49 29 + 1423: 18(fvec4) Load 1422 + 1424: 50(fvec3) VectorShuffle 1423 1423 0 1 2 + 1425: 50(fvec3) GroupNonUniformFAdd 34 ExclusiveScan 1424 + 1426: 40(ptr) AccessChain 27(data) 1421 29 + 1427: 18(fvec4) Load 1426 + 1428: 18(fvec4) VectorShuffle 1427 1425 4 5 6 3 + Store 1426 1428 + 1429: 6(int) Load 8(invocation) + 1430: 40(ptr) AccessChain 27(data) 59 29 + 1431: 18(fvec4) Load 1430 + 1432: 18(fvec4) GroupNonUniformFAdd 34 ExclusiveScan 1431 + 1433: 40(ptr) AccessChain 27(data) 1429 29 + Store 1433 1432 + 1434: 6(int) Load 8(invocation) + 1435: 65(ptr) AccessChain 27(data) 29 38 30 + 1436: 19(int) Load 1435 + 1437: 19(int) GroupNonUniformIAdd 34 ExclusiveScan 1436 + 1438: 65(ptr) AccessChain 27(data) 1434 38 30 + Store 1438 1437 + 1439: 6(int) Load 8(invocation) + 1440: 72(ptr) AccessChain 27(data) 38 38 + 1441: 20(ivec4) Load 1440 + 1442: 71(ivec2) VectorShuffle 1441 1441 0 1 + 1443: 71(ivec2) GroupNonUniformIAdd 34 ExclusiveScan 1442 + 1444: 72(ptr) AccessChain 27(data) 1439 38 + 1445: 20(ivec4) Load 1444 + 1446: 20(ivec4) VectorShuffle 1445 1443 4 5 2 3 + Store 1444 1446 + 1447: 6(int) Load 8(invocation) + 1448: 72(ptr) AccessChain 27(data) 49 38 + 1449: 20(ivec4) Load 1448 + 1450: 81(ivec3) VectorShuffle 1449 1449 0 1 2 + 1451: 81(ivec3) GroupNonUniformIAdd 34 ExclusiveScan 1450 + 1452: 72(ptr) AccessChain 27(data) 1447 38 + 1453: 20(ivec4) Load 1452 + 1454: 20(ivec4) VectorShuffle 1453 1451 4 5 6 3 + Store 1452 1454 + 1455: 6(int) Load 8(invocation) + 1456: 72(ptr) AccessChain 27(data) 59 38 + 1457: 20(ivec4) Load 1456 + 1458: 20(ivec4) GroupNonUniformIAdd 34 ExclusiveScan 1457 + 1459: 72(ptr) AccessChain 27(data) 1455 38 + Store 1459 1458 + 1460: 6(int) Load 8(invocation) + 1461: 95(ptr) AccessChain 27(data) 29 49 30 + 1462: 6(int) Load 1461 + 1463: 6(int) GroupNonUniformIAdd 34 ExclusiveScan 1462 + 1464: 95(ptr) AccessChain 27(data) 1460 49 30 + Store 1464 1463 + 1465: 6(int) Load 8(invocation) + 1466: 102(ptr) AccessChain 27(data) 38 49 + 1467: 21(ivec4) Load 1466 + 1468: 101(ivec2) VectorShuffle 1467 1467 0 1 + 1469: 101(ivec2) GroupNonUniformIAdd 34 ExclusiveScan 1468 + 1470: 102(ptr) AccessChain 27(data) 1465 49 + 1471: 21(ivec4) Load 1470 + 1472: 21(ivec4) VectorShuffle 1471 1469 4 5 2 3 + Store 1470 1472 + 1473: 6(int) Load 8(invocation) + 1474: 102(ptr) AccessChain 27(data) 49 49 + 1475: 21(ivec4) Load 1474 + 1476: 111(ivec3) VectorShuffle 1475 1475 0 1 2 + 1477: 111(ivec3) GroupNonUniformIAdd 34 ExclusiveScan 1476 + 1478: 102(ptr) AccessChain 27(data) 1473 49 + 1479: 21(ivec4) Load 1478 + 1480: 21(ivec4) VectorShuffle 1479 1477 4 5 6 3 + Store 1478 1480 + 1481: 6(int) Load 8(invocation) + 1482: 102(ptr) AccessChain 27(data) 59 49 + 1483: 21(ivec4) Load 1482 + 1484: 21(ivec4) GroupNonUniformIAdd 34 ExclusiveScan 1483 + 1485: 102(ptr) AccessChain 27(data) 1481 49 + Store 1485 1484 + 1486: 6(int) Load 8(invocation) + 1487: 125(ptr) AccessChain 27(data) 29 59 30 + 1488:22(float64_t) Load 1487 + 1489:22(float64_t) GroupNonUniformFAdd 34 ExclusiveScan 1488 + 1490: 125(ptr) AccessChain 27(data) 1486 59 30 + Store 1490 1489 + 1491: 6(int) Load 8(invocation) + 1492: 132(ptr) AccessChain 27(data) 38 59 + 1493: 23(f64vec4) Load 1492 + 1494:131(f64vec2) VectorShuffle 1493 1493 0 1 + 1495:131(f64vec2) GroupNonUniformFAdd 34 ExclusiveScan 1494 + 1496: 132(ptr) AccessChain 27(data) 1491 59 + 1497: 23(f64vec4) Load 1496 + 1498: 23(f64vec4) VectorShuffle 1497 1495 4 5 2 3 + Store 1496 1498 + 1499: 6(int) Load 8(invocation) + 1500: 132(ptr) AccessChain 27(data) 49 59 + 1501: 23(f64vec4) Load 1500 + 1502:141(f64vec3) VectorShuffle 1501 1501 0 1 2 + 1503:141(f64vec3) GroupNonUniformFAdd 34 ExclusiveScan 1502 + 1504: 132(ptr) AccessChain 27(data) 1499 59 + 1505: 23(f64vec4) Load 1504 + 1506: 23(f64vec4) VectorShuffle 1505 1503 4 5 6 3 + Store 1504 1506 + 1507: 6(int) Load 8(invocation) + 1508: 132(ptr) AccessChain 27(data) 59 59 + 1509: 23(f64vec4) Load 1508 + 1510: 23(f64vec4) GroupNonUniformFAdd 34 ExclusiveScan 1509 + 1511: 132(ptr) AccessChain 27(data) 1507 59 + Store 1511 1510 + 1512: 6(int) Load 8(invocation) + 1513: 31(ptr) AccessChain 27(data) 29 29 30 + 1514: 17(float) Load 1513 + 1515: 17(float) GroupNonUniformFMul 34 ExclusiveScan 1514 + 1516: 31(ptr) AccessChain 27(data) 1512 29 30 + Store 1516 1515 + 1517: 6(int) Load 8(invocation) + 1518: 40(ptr) AccessChain 27(data) 38 29 + 1519: 18(fvec4) Load 1518 + 1520: 39(fvec2) VectorShuffle 1519 1519 0 1 + 1521: 39(fvec2) GroupNonUniformFMul 34 ExclusiveScan 1520 + 1522: 40(ptr) AccessChain 27(data) 1517 29 + 1523: 18(fvec4) Load 1522 + 1524: 18(fvec4) VectorShuffle 1523 1521 4 5 2 3 + Store 1522 1524 + 1525: 6(int) Load 8(invocation) + 1526: 40(ptr) AccessChain 27(data) 49 29 + 1527: 18(fvec4) Load 1526 + 1528: 50(fvec3) VectorShuffle 1527 1527 0 1 2 + 1529: 50(fvec3) GroupNonUniformFMul 34 ExclusiveScan 1528 + 1530: 40(ptr) AccessChain 27(data) 1525 29 + 1531: 18(fvec4) Load 1530 + 1532: 18(fvec4) VectorShuffle 1531 1529 4 5 6 3 + Store 1530 1532 + 1533: 6(int) Load 8(invocation) + 1534: 40(ptr) AccessChain 27(data) 59 29 + 1535: 18(fvec4) Load 1534 + 1536: 18(fvec4) GroupNonUniformFMul 34 ExclusiveScan 1535 + 1537: 40(ptr) AccessChain 27(data) 1533 29 + Store 1537 1536 + 1538: 6(int) Load 8(invocation) + 1539: 65(ptr) AccessChain 27(data) 29 38 30 + 1540: 19(int) Load 1539 + 1541: 19(int) GroupNonUniformIMul 34 ExclusiveScan 1540 + 1542: 65(ptr) AccessChain 27(data) 1538 38 30 + Store 1542 1541 + 1543: 6(int) Load 8(invocation) + 1544: 72(ptr) AccessChain 27(data) 38 38 + 1545: 20(ivec4) Load 1544 + 1546: 71(ivec2) VectorShuffle 1545 1545 0 1 + 1547: 71(ivec2) GroupNonUniformIMul 34 ExclusiveScan 1546 + 1548: 72(ptr) AccessChain 27(data) 1543 38 + 1549: 20(ivec4) Load 1548 + 1550: 20(ivec4) VectorShuffle 1549 1547 4 5 2 3 + Store 1548 1550 + 1551: 6(int) Load 8(invocation) + 1552: 72(ptr) AccessChain 27(data) 49 38 + 1553: 20(ivec4) Load 1552 + 1554: 81(ivec3) VectorShuffle 1553 1553 0 1 2 + 1555: 81(ivec3) GroupNonUniformIMul 34 ExclusiveScan 1554 + 1556: 72(ptr) AccessChain 27(data) 1551 38 + 1557: 20(ivec4) Load 1556 + 1558: 20(ivec4) VectorShuffle 1557 1555 4 5 6 3 + Store 1556 1558 + 1559: 6(int) Load 8(invocation) + 1560: 72(ptr) AccessChain 27(data) 59 38 + 1561: 20(ivec4) Load 1560 + 1562: 20(ivec4) GroupNonUniformIMul 34 ExclusiveScan 1561 + 1563: 72(ptr) AccessChain 27(data) 1559 38 + Store 1563 1562 + 1564: 6(int) Load 8(invocation) + 1565: 95(ptr) AccessChain 27(data) 29 49 30 + 1566: 6(int) Load 1565 + 1567: 6(int) GroupNonUniformIMul 34 ExclusiveScan 1566 + 1568: 95(ptr) AccessChain 27(data) 1564 49 30 + Store 1568 1567 + 1569: 6(int) Load 8(invocation) + 1570: 102(ptr) AccessChain 27(data) 38 49 + 1571: 21(ivec4) Load 1570 + 1572: 101(ivec2) VectorShuffle 1571 1571 0 1 + 1573: 101(ivec2) GroupNonUniformIMul 34 ExclusiveScan 1572 + 1574: 102(ptr) AccessChain 27(data) 1569 49 + 1575: 21(ivec4) Load 1574 + 1576: 21(ivec4) VectorShuffle 1575 1573 4 5 2 3 + Store 1574 1576 + 1577: 6(int) Load 8(invocation) + 1578: 102(ptr) AccessChain 27(data) 49 49 + 1579: 21(ivec4) Load 1578 + 1580: 111(ivec3) VectorShuffle 1579 1579 0 1 2 + 1581: 111(ivec3) GroupNonUniformIMul 34 ExclusiveScan 1580 + 1582: 102(ptr) AccessChain 27(data) 1577 49 + 1583: 21(ivec4) Load 1582 + 1584: 21(ivec4) VectorShuffle 1583 1581 4 5 6 3 + Store 1582 1584 + 1585: 6(int) Load 8(invocation) + 1586: 102(ptr) AccessChain 27(data) 59 49 + 1587: 21(ivec4) Load 1586 + 1588: 21(ivec4) GroupNonUniformIMul 34 ExclusiveScan 1587 + 1589: 102(ptr) AccessChain 27(data) 1585 49 + Store 1589 1588 + 1590: 6(int) Load 8(invocation) + 1591: 125(ptr) AccessChain 27(data) 29 59 30 + 1592:22(float64_t) Load 1591 + 1593:22(float64_t) GroupNonUniformFMul 34 ExclusiveScan 1592 + 1594: 125(ptr) AccessChain 27(data) 1590 59 30 + Store 1594 1593 + 1595: 6(int) Load 8(invocation) + 1596: 132(ptr) AccessChain 27(data) 38 59 + 1597: 23(f64vec4) Load 1596 + 1598:131(f64vec2) VectorShuffle 1597 1597 0 1 + 1599:131(f64vec2) GroupNonUniformFMul 34 ExclusiveScan 1598 + 1600: 132(ptr) AccessChain 27(data) 1595 59 + 1601: 23(f64vec4) Load 1600 + 1602: 23(f64vec4) VectorShuffle 1601 1599 4 5 2 3 + Store 1600 1602 + 1603: 6(int) Load 8(invocation) + 1604: 132(ptr) AccessChain 27(data) 49 59 + 1605: 23(f64vec4) Load 1604 + 1606:141(f64vec3) VectorShuffle 1605 1605 0 1 2 + 1607:141(f64vec3) GroupNonUniformFMul 34 ExclusiveScan 1606 + 1608: 132(ptr) AccessChain 27(data) 1603 59 + 1609: 23(f64vec4) Load 1608 + 1610: 23(f64vec4) VectorShuffle 1609 1607 4 5 6 3 + Store 1608 1610 + 1611: 6(int) Load 8(invocation) + 1612: 132(ptr) AccessChain 27(data) 59 59 + 1613: 23(f64vec4) Load 1612 + 1614: 23(f64vec4) GroupNonUniformFMul 34 ExclusiveScan 1613 + 1615: 132(ptr) AccessChain 27(data) 1611 59 + Store 1615 1614 + 1616: 6(int) Load 8(invocation) + 1617: 31(ptr) AccessChain 27(data) 29 29 30 + 1618: 17(float) Load 1617 + 1619: 17(float) GroupNonUniformFMin 34 ExclusiveScan 1618 + 1620: 31(ptr) AccessChain 27(data) 1616 29 30 + Store 1620 1619 + 1621: 6(int) Load 8(invocation) + 1622: 40(ptr) AccessChain 27(data) 38 29 + 1623: 18(fvec4) Load 1622 + 1624: 39(fvec2) VectorShuffle 1623 1623 0 1 + 1625: 39(fvec2) GroupNonUniformFMin 34 ExclusiveScan 1624 + 1626: 40(ptr) AccessChain 27(data) 1621 29 + 1627: 18(fvec4) Load 1626 + 1628: 18(fvec4) VectorShuffle 1627 1625 4 5 2 3 + Store 1626 1628 + 1629: 6(int) Load 8(invocation) + 1630: 40(ptr) AccessChain 27(data) 49 29 + 1631: 18(fvec4) Load 1630 + 1632: 50(fvec3) VectorShuffle 1631 1631 0 1 2 + 1633: 50(fvec3) GroupNonUniformFMin 34 ExclusiveScan 1632 + 1634: 40(ptr) AccessChain 27(data) 1629 29 + 1635: 18(fvec4) Load 1634 + 1636: 18(fvec4) VectorShuffle 1635 1633 4 5 6 3 + Store 1634 1636 + 1637: 6(int) Load 8(invocation) + 1638: 40(ptr) AccessChain 27(data) 59 29 + 1639: 18(fvec4) Load 1638 + 1640: 18(fvec4) GroupNonUniformFMin 34 ExclusiveScan 1639 + 1641: 40(ptr) AccessChain 27(data) 1637 29 + Store 1641 1640 + 1642: 6(int) Load 8(invocation) + 1643: 65(ptr) AccessChain 27(data) 29 38 30 + 1644: 19(int) Load 1643 + 1645: 19(int) GroupNonUniformSMin 34 ExclusiveScan 1644 + 1646: 65(ptr) AccessChain 27(data) 1642 38 30 + Store 1646 1645 + 1647: 6(int) Load 8(invocation) + 1648: 72(ptr) AccessChain 27(data) 38 38 + 1649: 20(ivec4) Load 1648 + 1650: 71(ivec2) VectorShuffle 1649 1649 0 1 + 1651: 71(ivec2) GroupNonUniformSMin 34 ExclusiveScan 1650 + 1652: 72(ptr) AccessChain 27(data) 1647 38 + 1653: 20(ivec4) Load 1652 + 1654: 20(ivec4) VectorShuffle 1653 1651 4 5 2 3 + Store 1652 1654 + 1655: 6(int) Load 8(invocation) + 1656: 72(ptr) AccessChain 27(data) 49 38 + 1657: 20(ivec4) Load 1656 + 1658: 81(ivec3) VectorShuffle 1657 1657 0 1 2 + 1659: 81(ivec3) GroupNonUniformSMin 34 ExclusiveScan 1658 + 1660: 72(ptr) AccessChain 27(data) 1655 38 + 1661: 20(ivec4) Load 1660 + 1662: 20(ivec4) VectorShuffle 1661 1659 4 5 6 3 + Store 1660 1662 + 1663: 6(int) Load 8(invocation) + 1664: 72(ptr) AccessChain 27(data) 59 38 + 1665: 20(ivec4) Load 1664 + 1666: 20(ivec4) GroupNonUniformSMin 34 ExclusiveScan 1665 + 1667: 72(ptr) AccessChain 27(data) 1663 38 + Store 1667 1666 + 1668: 6(int) Load 8(invocation) + 1669: 95(ptr) AccessChain 27(data) 29 49 30 + 1670: 6(int) Load 1669 + 1671: 6(int) GroupNonUniformUMin 34 ExclusiveScan 1670 + 1672: 95(ptr) AccessChain 27(data) 1668 49 30 + Store 1672 1671 + 1673: 6(int) Load 8(invocation) + 1674: 102(ptr) AccessChain 27(data) 38 49 + 1675: 21(ivec4) Load 1674 + 1676: 101(ivec2) VectorShuffle 1675 1675 0 1 + 1677: 101(ivec2) GroupNonUniformUMin 34 ExclusiveScan 1676 + 1678: 102(ptr) AccessChain 27(data) 1673 49 + 1679: 21(ivec4) Load 1678 + 1680: 21(ivec4) VectorShuffle 1679 1677 4 5 2 3 + Store 1678 1680 + 1681: 6(int) Load 8(invocation) + 1682: 102(ptr) AccessChain 27(data) 49 49 + 1683: 21(ivec4) Load 1682 + 1684: 111(ivec3) VectorShuffle 1683 1683 0 1 2 + 1685: 111(ivec3) GroupNonUniformUMin 34 ExclusiveScan 1684 + 1686: 102(ptr) AccessChain 27(data) 1681 49 + 1687: 21(ivec4) Load 1686 + 1688: 21(ivec4) VectorShuffle 1687 1685 4 5 6 3 + Store 1686 1688 + 1689: 6(int) Load 8(invocation) + 1690: 102(ptr) AccessChain 27(data) 59 49 + 1691: 21(ivec4) Load 1690 + 1692: 21(ivec4) GroupNonUniformUMin 34 ExclusiveScan 1691 + 1693: 102(ptr) AccessChain 27(data) 1689 49 + Store 1693 1692 + 1694: 6(int) Load 8(invocation) + 1695: 125(ptr) AccessChain 27(data) 29 59 30 + 1696:22(float64_t) Load 1695 + 1697:22(float64_t) GroupNonUniformFMin 34 ExclusiveScan 1696 + 1698: 125(ptr) AccessChain 27(data) 1694 59 30 + Store 1698 1697 + 1699: 6(int) Load 8(invocation) + 1700: 132(ptr) AccessChain 27(data) 38 59 + 1701: 23(f64vec4) Load 1700 + 1702:131(f64vec2) VectorShuffle 1701 1701 0 1 + 1703:131(f64vec2) GroupNonUniformFMin 34 ExclusiveScan 1702 + 1704: 132(ptr) AccessChain 27(data) 1699 59 + 1705: 23(f64vec4) Load 1704 + 1706: 23(f64vec4) VectorShuffle 1705 1703 4 5 2 3 + Store 1704 1706 + 1707: 6(int) Load 8(invocation) + 1708: 132(ptr) AccessChain 27(data) 49 59 + 1709: 23(f64vec4) Load 1708 + 1710:141(f64vec3) VectorShuffle 1709 1709 0 1 2 + 1711:141(f64vec3) GroupNonUniformFMin 34 ExclusiveScan 1710 + 1712: 132(ptr) AccessChain 27(data) 1707 59 + 1713: 23(f64vec4) Load 1712 + 1714: 23(f64vec4) VectorShuffle 1713 1711 4 5 6 3 + Store 1712 1714 + 1715: 6(int) Load 8(invocation) + 1716: 132(ptr) AccessChain 27(data) 59 59 + 1717: 23(f64vec4) Load 1716 + 1718: 23(f64vec4) GroupNonUniformFMin 34 ExclusiveScan 1717 + 1719: 132(ptr) AccessChain 27(data) 1715 59 + Store 1719 1718 + 1720: 6(int) Load 8(invocation) + 1721: 31(ptr) AccessChain 27(data) 29 29 30 + 1722: 17(float) Load 1721 + 1723: 17(float) GroupNonUniformFMax 34 ExclusiveScan 1722 + 1724: 31(ptr) AccessChain 27(data) 1720 29 30 + Store 1724 1723 + 1725: 6(int) Load 8(invocation) + 1726: 40(ptr) AccessChain 27(data) 38 29 + 1727: 18(fvec4) Load 1726 + 1728: 39(fvec2) VectorShuffle 1727 1727 0 1 + 1729: 39(fvec2) GroupNonUniformFMax 34 ExclusiveScan 1728 + 1730: 40(ptr) AccessChain 27(data) 1725 29 + 1731: 18(fvec4) Load 1730 + 1732: 18(fvec4) VectorShuffle 1731 1729 4 5 2 3 + Store 1730 1732 + 1733: 6(int) Load 8(invocation) + 1734: 40(ptr) AccessChain 27(data) 49 29 + 1735: 18(fvec4) Load 1734 + 1736: 50(fvec3) VectorShuffle 1735 1735 0 1 2 + 1737: 50(fvec3) GroupNonUniformFMax 34 ExclusiveScan 1736 + 1738: 40(ptr) AccessChain 27(data) 1733 29 + 1739: 18(fvec4) Load 1738 + 1740: 18(fvec4) VectorShuffle 1739 1737 4 5 6 3 + Store 1738 1740 + 1741: 6(int) Load 8(invocation) + 1742: 40(ptr) AccessChain 27(data) 59 29 + 1743: 18(fvec4) Load 1742 + 1744: 18(fvec4) GroupNonUniformFMax 34 ExclusiveScan 1743 + 1745: 40(ptr) AccessChain 27(data) 1741 29 + Store 1745 1744 + 1746: 6(int) Load 8(invocation) + 1747: 65(ptr) AccessChain 27(data) 29 38 30 + 1748: 19(int) Load 1747 + 1749: 19(int) GroupNonUniformSMax 34 ExclusiveScan 1748 + 1750: 65(ptr) AccessChain 27(data) 1746 38 30 + Store 1750 1749 + 1751: 6(int) Load 8(invocation) + 1752: 72(ptr) AccessChain 27(data) 38 38 + 1753: 20(ivec4) Load 1752 + 1754: 71(ivec2) VectorShuffle 1753 1753 0 1 + 1755: 71(ivec2) GroupNonUniformSMax 34 ExclusiveScan 1754 + 1756: 72(ptr) AccessChain 27(data) 1751 38 + 1757: 20(ivec4) Load 1756 + 1758: 20(ivec4) VectorShuffle 1757 1755 4 5 2 3 + Store 1756 1758 + 1759: 6(int) Load 8(invocation) + 1760: 72(ptr) AccessChain 27(data) 49 38 + 1761: 20(ivec4) Load 1760 + 1762: 81(ivec3) VectorShuffle 1761 1761 0 1 2 + 1763: 81(ivec3) GroupNonUniformSMax 34 ExclusiveScan 1762 + 1764: 72(ptr) AccessChain 27(data) 1759 38 + 1765: 20(ivec4) Load 1764 + 1766: 20(ivec4) VectorShuffle 1765 1763 4 5 6 3 + Store 1764 1766 + 1767: 6(int) Load 8(invocation) + 1768: 72(ptr) AccessChain 27(data) 59 38 + 1769: 20(ivec4) Load 1768 + 1770: 20(ivec4) GroupNonUniformSMax 34 ExclusiveScan 1769 + 1771: 72(ptr) AccessChain 27(data) 1767 38 + Store 1771 1770 + 1772: 6(int) Load 8(invocation) + 1773: 95(ptr) AccessChain 27(data) 29 49 30 + 1774: 6(int) Load 1773 + 1775: 6(int) GroupNonUniformUMax 34 ExclusiveScan 1774 + 1776: 95(ptr) AccessChain 27(data) 1772 49 30 + Store 1776 1775 + 1777: 6(int) Load 8(invocation) + 1778: 102(ptr) AccessChain 27(data) 38 49 + 1779: 21(ivec4) Load 1778 + 1780: 101(ivec2) VectorShuffle 1779 1779 0 1 + 1781: 101(ivec2) GroupNonUniformUMax 34 ExclusiveScan 1780 + 1782: 102(ptr) AccessChain 27(data) 1777 49 + 1783: 21(ivec4) Load 1782 + 1784: 21(ivec4) VectorShuffle 1783 1781 4 5 2 3 + Store 1782 1784 + 1785: 6(int) Load 8(invocation) + 1786: 102(ptr) AccessChain 27(data) 49 49 + 1787: 21(ivec4) Load 1786 + 1788: 111(ivec3) VectorShuffle 1787 1787 0 1 2 + 1789: 111(ivec3) GroupNonUniformUMax 34 ExclusiveScan 1788 + 1790: 102(ptr) AccessChain 27(data) 1785 49 + 1791: 21(ivec4) Load 1790 + 1792: 21(ivec4) VectorShuffle 1791 1789 4 5 6 3 + Store 1790 1792 + 1793: 6(int) Load 8(invocation) + 1794: 102(ptr) AccessChain 27(data) 59 49 + 1795: 21(ivec4) Load 1794 + 1796: 21(ivec4) GroupNonUniformUMax 34 ExclusiveScan 1795 + 1797: 102(ptr) AccessChain 27(data) 1793 49 + Store 1797 1796 + 1798: 6(int) Load 8(invocation) + 1799: 125(ptr) AccessChain 27(data) 29 59 30 + 1800:22(float64_t) Load 1799 + 1801:22(float64_t) GroupNonUniformFMax 34 ExclusiveScan 1800 + 1802: 125(ptr) AccessChain 27(data) 1798 59 30 + Store 1802 1801 + 1803: 6(int) Load 8(invocation) + 1804: 132(ptr) AccessChain 27(data) 38 59 + 1805: 23(f64vec4) Load 1804 + 1806:131(f64vec2) VectorShuffle 1805 1805 0 1 + 1807:131(f64vec2) GroupNonUniformFMax 34 ExclusiveScan 1806 + 1808: 132(ptr) AccessChain 27(data) 1803 59 + 1809: 23(f64vec4) Load 1808 + 1810: 23(f64vec4) VectorShuffle 1809 1807 4 5 2 3 + Store 1808 1810 + 1811: 6(int) Load 8(invocation) + 1812: 132(ptr) AccessChain 27(data) 49 59 + 1813: 23(f64vec4) Load 1812 + 1814:141(f64vec3) VectorShuffle 1813 1813 0 1 2 + 1815:141(f64vec3) GroupNonUniformFMax 34 ExclusiveScan 1814 + 1816: 132(ptr) AccessChain 27(data) 1811 59 + 1817: 23(f64vec4) Load 1816 + 1818: 23(f64vec4) VectorShuffle 1817 1815 4 5 6 3 + Store 1816 1818 + 1819: 6(int) Load 8(invocation) + 1820: 132(ptr) AccessChain 27(data) 59 59 + 1821: 23(f64vec4) Load 1820 + 1822: 23(f64vec4) GroupNonUniformFMax 34 ExclusiveScan 1821 + 1823: 132(ptr) AccessChain 27(data) 1819 59 + Store 1823 1822 + 1824: 6(int) Load 8(invocation) + 1825: 65(ptr) AccessChain 27(data) 29 38 30 + 1826: 19(int) Load 1825 + 1827: 19(int) GroupNonUniformBitwiseAnd 34 ExclusiveScan 1826 + 1828: 65(ptr) AccessChain 27(data) 1824 38 30 + Store 1828 1827 + 1829: 6(int) Load 8(invocation) + 1830: 72(ptr) AccessChain 27(data) 38 38 + 1831: 20(ivec4) Load 1830 + 1832: 71(ivec2) VectorShuffle 1831 1831 0 1 + 1833: 71(ivec2) GroupNonUniformBitwiseAnd 34 ExclusiveScan 1832 + 1834: 72(ptr) AccessChain 27(data) 1829 38 + 1835: 20(ivec4) Load 1834 + 1836: 20(ivec4) VectorShuffle 1835 1833 4 5 2 3 + Store 1834 1836 + 1837: 6(int) Load 8(invocation) + 1838: 72(ptr) AccessChain 27(data) 49 38 + 1839: 20(ivec4) Load 1838 + 1840: 81(ivec3) VectorShuffle 1839 1839 0 1 2 + 1841: 81(ivec3) GroupNonUniformBitwiseAnd 34 ExclusiveScan 1840 + 1842: 72(ptr) AccessChain 27(data) 1837 38 + 1843: 20(ivec4) Load 1842 + 1844: 20(ivec4) VectorShuffle 1843 1841 4 5 6 3 + Store 1842 1844 + 1845: 6(int) Load 8(invocation) + 1846: 72(ptr) AccessChain 27(data) 59 38 + 1847: 20(ivec4) Load 1846 + 1848: 20(ivec4) GroupNonUniformBitwiseAnd 34 ExclusiveScan 1847 + 1849: 72(ptr) AccessChain 27(data) 1845 38 + Store 1849 1848 + 1850: 6(int) Load 8(invocation) + 1851: 95(ptr) AccessChain 27(data) 29 49 30 + 1852: 6(int) Load 1851 + 1853: 6(int) GroupNonUniformBitwiseAnd 34 ExclusiveScan 1852 + 1854: 95(ptr) AccessChain 27(data) 1850 49 30 + Store 1854 1853 + 1855: 6(int) Load 8(invocation) + 1856: 102(ptr) AccessChain 27(data) 38 49 + 1857: 21(ivec4) Load 1856 + 1858: 101(ivec2) VectorShuffle 1857 1857 0 1 + 1859: 101(ivec2) GroupNonUniformBitwiseAnd 34 ExclusiveScan 1858 + 1860: 102(ptr) AccessChain 27(data) 1855 49 + 1861: 21(ivec4) Load 1860 + 1862: 21(ivec4) VectorShuffle 1861 1859 4 5 2 3 + Store 1860 1862 + 1863: 6(int) Load 8(invocation) + 1864: 102(ptr) AccessChain 27(data) 49 49 + 1865: 21(ivec4) Load 1864 + 1866: 111(ivec3) VectorShuffle 1865 1865 0 1 2 + 1867: 111(ivec3) GroupNonUniformBitwiseAnd 34 ExclusiveScan 1866 + 1868: 102(ptr) AccessChain 27(data) 1863 49 + 1869: 21(ivec4) Load 1868 + 1870: 21(ivec4) VectorShuffle 1869 1867 4 5 6 3 + Store 1868 1870 + 1871: 6(int) Load 8(invocation) + 1872: 102(ptr) AccessChain 27(data) 59 49 + 1873: 21(ivec4) Load 1872 + 1874: 21(ivec4) GroupNonUniformBitwiseAnd 34 ExclusiveScan 1873 + 1875: 102(ptr) AccessChain 27(data) 1871 49 + Store 1875 1874 + 1876: 6(int) Load 8(invocation) + 1877: 65(ptr) AccessChain 27(data) 29 38 30 + 1878: 19(int) Load 1877 + 1879: 521(bool) SLessThan 1878 29 + 1880: 521(bool) GroupNonUniformLogicalAnd 34 ExclusiveScan 1879 + 1881: 19(int) Select 1880 38 29 + 1882: 65(ptr) AccessChain 27(data) 1876 38 30 + Store 1882 1881 + 1883: 6(int) Load 8(invocation) + 1884: 72(ptr) AccessChain 27(data) 38 38 + 1885: 20(ivec4) Load 1884 + 1886: 71(ivec2) VectorShuffle 1885 1885 0 1 + 1887: 531(bvec2) SLessThan 1886 530 + 1888: 531(bvec2) GroupNonUniformLogicalAnd 34 ExclusiveScan 1887 + 1889: 71(ivec2) Select 1888 534 530 + 1890: 72(ptr) AccessChain 27(data) 1883 38 + 1891: 20(ivec4) Load 1890 + 1892: 20(ivec4) VectorShuffle 1891 1889 4 5 2 3 + Store 1890 1892 + 1893: 6(int) Load 8(invocation) + 1894: 72(ptr) AccessChain 27(data) 38 38 + 1895: 20(ivec4) Load 1894 + 1896: 81(ivec3) VectorShuffle 1895 1895 0 1 2 + 1897: 544(bvec3) SLessThan 1896 543 + 1898: 544(bvec3) GroupNonUniformLogicalAnd 34 ExclusiveScan 1897 + 1899: 81(ivec3) Select 1898 547 543 + 1900: 72(ptr) AccessChain 27(data) 1893 38 + 1901: 20(ivec4) Load 1900 + 1902: 20(ivec4) VectorShuffle 1901 1899 4 5 6 3 + Store 1900 1902 + 1903: 6(int) Load 8(invocation) + 1904: 72(ptr) AccessChain 27(data) 38 38 + 1905: 20(ivec4) Load 1904 + 1906: 556(bvec4) SLessThan 1905 555 + 1907: 556(bvec4) GroupNonUniformLogicalAnd 34 ExclusiveScan 1906 + 1908: 20(ivec4) Select 1907 559 555 + 1909: 72(ptr) AccessChain 27(data) 1903 38 + Store 1909 1908 + 1910: 6(int) Load 8(invocation) + 1911: 65(ptr) AccessChain 27(data) 29 38 30 + 1912: 19(int) Load 1911 + 1913: 19(int) GroupNonUniformBitwiseOr 34 ExclusiveScan 1912 + 1914: 65(ptr) AccessChain 27(data) 1910 38 30 + Store 1914 1913 + 1915: 6(int) Load 8(invocation) + 1916: 72(ptr) AccessChain 27(data) 38 38 + 1917: 20(ivec4) Load 1916 + 1918: 71(ivec2) VectorShuffle 1917 1917 0 1 + 1919: 71(ivec2) GroupNonUniformBitwiseOr 34 ExclusiveScan 1918 + 1920: 72(ptr) AccessChain 27(data) 1915 38 + 1921: 20(ivec4) Load 1920 + 1922: 20(ivec4) VectorShuffle 1921 1919 4 5 2 3 + Store 1920 1922 + 1923: 6(int) Load 8(invocation) + 1924: 72(ptr) AccessChain 27(data) 49 38 + 1925: 20(ivec4) Load 1924 + 1926: 81(ivec3) VectorShuffle 1925 1925 0 1 2 + 1927: 81(ivec3) GroupNonUniformBitwiseOr 34 ExclusiveScan 1926 + 1928: 72(ptr) AccessChain 27(data) 1923 38 + 1929: 20(ivec4) Load 1928 + 1930: 20(ivec4) VectorShuffle 1929 1927 4 5 6 3 + Store 1928 1930 + 1931: 6(int) Load 8(invocation) + 1932: 72(ptr) AccessChain 27(data) 59 38 + 1933: 20(ivec4) Load 1932 + 1934: 20(ivec4) GroupNonUniformBitwiseOr 34 ExclusiveScan 1933 + 1935: 72(ptr) AccessChain 27(data) 1931 38 + Store 1935 1934 + 1936: 6(int) Load 8(invocation) + 1937: 95(ptr) AccessChain 27(data) 29 49 30 + 1938: 6(int) Load 1937 + 1939: 6(int) GroupNonUniformBitwiseOr 34 ExclusiveScan 1938 + 1940: 95(ptr) AccessChain 27(data) 1936 49 30 + Store 1940 1939 + 1941: 6(int) Load 8(invocation) + 1942: 102(ptr) AccessChain 27(data) 38 49 + 1943: 21(ivec4) Load 1942 + 1944: 101(ivec2) VectorShuffle 1943 1943 0 1 + 1945: 101(ivec2) GroupNonUniformBitwiseOr 34 ExclusiveScan 1944 + 1946: 102(ptr) AccessChain 27(data) 1941 49 + 1947: 21(ivec4) Load 1946 + 1948: 21(ivec4) VectorShuffle 1947 1945 4 5 2 3 + Store 1946 1948 + 1949: 6(int) Load 8(invocation) + 1950: 102(ptr) AccessChain 27(data) 49 49 + 1951: 21(ivec4) Load 1950 + 1952: 111(ivec3) VectorShuffle 1951 1951 0 1 2 + 1953: 111(ivec3) GroupNonUniformBitwiseOr 34 ExclusiveScan 1952 + 1954: 102(ptr) AccessChain 27(data) 1949 49 + 1955: 21(ivec4) Load 1954 + 1956: 21(ivec4) VectorShuffle 1955 1953 4 5 6 3 + Store 1954 1956 + 1957: 6(int) Load 8(invocation) + 1958: 102(ptr) AccessChain 27(data) 59 49 + 1959: 21(ivec4) Load 1958 + 1960: 21(ivec4) GroupNonUniformBitwiseOr 34 ExclusiveScan 1959 + 1961: 102(ptr) AccessChain 27(data) 1957 49 + Store 1961 1960 + 1962: 6(int) Load 8(invocation) + 1963: 65(ptr) AccessChain 27(data) 29 38 30 + 1964: 19(int) Load 1963 + 1965: 521(bool) SLessThan 1964 29 + 1966: 521(bool) GroupNonUniformLogicalOr 34 ExclusiveScan 1965 + 1967: 19(int) Select 1966 38 29 + 1968: 65(ptr) AccessChain 27(data) 1962 38 30 + Store 1968 1967 + 1969: 6(int) Load 8(invocation) + 1970: 72(ptr) AccessChain 27(data) 38 38 + 1971: 20(ivec4) Load 1970 + 1972: 71(ivec2) VectorShuffle 1971 1971 0 1 + 1973: 531(bvec2) SLessThan 1972 530 + 1974: 531(bvec2) GroupNonUniformLogicalOr 34 ExclusiveScan 1973 + 1975: 71(ivec2) Select 1974 534 530 + 1976: 72(ptr) AccessChain 27(data) 1969 38 + 1977: 20(ivec4) Load 1976 + 1978: 20(ivec4) VectorShuffle 1977 1975 4 5 2 3 + Store 1976 1978 + 1979: 6(int) Load 8(invocation) + 1980: 72(ptr) AccessChain 27(data) 38 38 + 1981: 20(ivec4) Load 1980 + 1982: 81(ivec3) VectorShuffle 1981 1981 0 1 2 + 1983: 544(bvec3) SLessThan 1982 543 + 1984: 544(bvec3) GroupNonUniformLogicalOr 34 ExclusiveScan 1983 + 1985: 81(ivec3) Select 1984 547 543 + 1986: 72(ptr) AccessChain 27(data) 1979 38 + 1987: 20(ivec4) Load 1986 + 1988: 20(ivec4) VectorShuffle 1987 1985 4 5 6 3 + Store 1986 1988 + 1989: 6(int) Load 8(invocation) + 1990: 72(ptr) AccessChain 27(data) 38 38 + 1991: 20(ivec4) Load 1990 + 1992: 556(bvec4) SLessThan 1991 555 + 1993: 556(bvec4) GroupNonUniformLogicalOr 34 ExclusiveScan 1992 + 1994: 20(ivec4) Select 1993 559 555 + 1995: 72(ptr) AccessChain 27(data) 1989 38 + Store 1995 1994 + 1996: 6(int) Load 8(invocation) + 1997: 65(ptr) AccessChain 27(data) 29 38 30 + 1998: 19(int) Load 1997 + 1999: 19(int) GroupNonUniformBitwiseXor 34 ExclusiveScan 1998 + 2000: 65(ptr) AccessChain 27(data) 1996 38 30 + Store 2000 1999 + 2001: 6(int) Load 8(invocation) + 2002: 72(ptr) AccessChain 27(data) 38 38 + 2003: 20(ivec4) Load 2002 + 2004: 71(ivec2) VectorShuffle 2003 2003 0 1 + 2005: 71(ivec2) GroupNonUniformBitwiseXor 34 ExclusiveScan 2004 + 2006: 72(ptr) AccessChain 27(data) 2001 38 + 2007: 20(ivec4) Load 2006 + 2008: 20(ivec4) VectorShuffle 2007 2005 4 5 2 3 + Store 2006 2008 + 2009: 6(int) Load 8(invocation) + 2010: 72(ptr) AccessChain 27(data) 49 38 + 2011: 20(ivec4) Load 2010 + 2012: 81(ivec3) VectorShuffle 2011 2011 0 1 2 + 2013: 81(ivec3) GroupNonUniformBitwiseXor 34 ExclusiveScan 2012 + 2014: 72(ptr) AccessChain 27(data) 2009 38 + 2015: 20(ivec4) Load 2014 + 2016: 20(ivec4) VectorShuffle 2015 2013 4 5 6 3 + Store 2014 2016 + 2017: 6(int) Load 8(invocation) + 2018: 72(ptr) AccessChain 27(data) 59 38 + 2019: 20(ivec4) Load 2018 + 2020: 20(ivec4) GroupNonUniformBitwiseXor 34 ExclusiveScan 2019 + 2021: 72(ptr) AccessChain 27(data) 2017 38 + Store 2021 2020 + 2022: 6(int) Load 8(invocation) + 2023: 95(ptr) AccessChain 27(data) 29 49 30 + 2024: 6(int) Load 2023 + 2025: 6(int) GroupNonUniformBitwiseXor 34 ExclusiveScan 2024 + 2026: 95(ptr) AccessChain 27(data) 2022 49 30 + Store 2026 2025 + 2027: 6(int) Load 8(invocation) + 2028: 102(ptr) AccessChain 27(data) 38 49 + 2029: 21(ivec4) Load 2028 + 2030: 101(ivec2) VectorShuffle 2029 2029 0 1 + 2031: 101(ivec2) GroupNonUniformBitwiseXor 34 ExclusiveScan 2030 + 2032: 102(ptr) AccessChain 27(data) 2027 49 + 2033: 21(ivec4) Load 2032 + 2034: 21(ivec4) VectorShuffle 2033 2031 4 5 2 3 + Store 2032 2034 + 2035: 6(int) Load 8(invocation) + 2036: 102(ptr) AccessChain 27(data) 49 49 + 2037: 21(ivec4) Load 2036 + 2038: 111(ivec3) VectorShuffle 2037 2037 0 1 2 + 2039: 111(ivec3) GroupNonUniformBitwiseXor 34 ExclusiveScan 2038 + 2040: 102(ptr) AccessChain 27(data) 2035 49 + 2041: 21(ivec4) Load 2040 + 2042: 21(ivec4) VectorShuffle 2041 2039 4 5 6 3 + Store 2040 2042 + 2043: 6(int) Load 8(invocation) + 2044: 102(ptr) AccessChain 27(data) 59 49 + 2045: 21(ivec4) Load 2044 + 2046: 21(ivec4) GroupNonUniformBitwiseXor 34 ExclusiveScan 2045 + 2047: 102(ptr) AccessChain 27(data) 2043 49 + Store 2047 2046 + 2048: 6(int) Load 8(invocation) + 2049: 65(ptr) AccessChain 27(data) 29 38 30 + 2050: 19(int) Load 2049 + 2051: 521(bool) SLessThan 2050 29 + 2052: 521(bool) GroupNonUniformLogicalXor 34 ExclusiveScan 2051 + 2053: 19(int) Select 2052 38 29 + 2054: 65(ptr) AccessChain 27(data) 2048 38 30 + Store 2054 2053 + 2055: 6(int) Load 8(invocation) + 2056: 72(ptr) AccessChain 27(data) 38 38 + 2057: 20(ivec4) Load 2056 + 2058: 71(ivec2) VectorShuffle 2057 2057 0 1 + 2059: 531(bvec2) SLessThan 2058 530 + 2060: 531(bvec2) GroupNonUniformLogicalXor 34 ExclusiveScan 2059 + 2061: 71(ivec2) Select 2060 534 530 + 2062: 72(ptr) AccessChain 27(data) 2055 38 + 2063: 20(ivec4) Load 2062 + 2064: 20(ivec4) VectorShuffle 2063 2061 4 5 2 3 + Store 2062 2064 + 2065: 6(int) Load 8(invocation) + 2066: 72(ptr) AccessChain 27(data) 38 38 + 2067: 20(ivec4) Load 2066 + 2068: 81(ivec3) VectorShuffle 2067 2067 0 1 2 + 2069: 544(bvec3) SLessThan 2068 543 + 2070: 544(bvec3) GroupNonUniformLogicalXor 34 ExclusiveScan 2069 + 2071: 81(ivec3) Select 2070 547 543 + 2072: 72(ptr) AccessChain 27(data) 2065 38 + 2073: 20(ivec4) Load 2072 + 2074: 20(ivec4) VectorShuffle 2073 2071 4 5 6 3 + Store 2072 2074 + 2075: 6(int) Load 8(invocation) + 2076: 72(ptr) AccessChain 27(data) 38 38 + 2077: 20(ivec4) Load 2076 + 2078: 556(bvec4) SLessThan 2077 555 + 2079: 556(bvec4) GroupNonUniformLogicalXor 34 ExclusiveScan 2078 + 2080: 20(ivec4) Select 2079 559 555 + 2081: 72(ptr) AccessChain 27(data) 2075 38 + Store 2081 2080 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.subgroupBallot.comp.out b/deps/glslang/Test/baseResults/spv.subgroupBallot.comp.out new file mode 100644 index 00000000..23a59132 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.subgroupBallot.comp.out @@ -0,0 +1,525 @@ +spv.subgroupBallot.comp +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 417 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformBallot + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 10 12 21 23 26 29 32 + ExecutionMode 4 LocalSize 8 8 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_ballot" + SourceExtension "GL_KHR_shader_subgroup_basic" + Name 4 "main" + Name 8 "invocation" + Name 10 "gl_SubgroupInvocationID" + Name 12 "gl_SubgroupSize" + Name 19 "relMask" + Name 21 "gl_SubgroupEqMask" + Name 23 "gl_SubgroupGeMask" + Name 26 "gl_SubgroupGtMask" + Name 29 "gl_SubgroupLeMask" + Name 32 "gl_SubgroupLtMask" + Name 35 "result" + Name 46 "Buffers" + MemberName 46(Buffers) 0 "f4" + MemberName 46(Buffers) 1 "i4" + MemberName 46(Buffers) 2 "u4" + MemberName 46(Buffers) 3 "d4" + Name 49 "data" + Decorate 10(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 10(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 11 RelaxedPrecision + Decorate 12(gl_SubgroupSize) RelaxedPrecision + Decorate 12(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 13 RelaxedPrecision + Decorate 14 RelaxedPrecision + Decorate 16 RelaxedPrecision + Decorate 21(gl_SubgroupEqMask) BuiltIn SubgroupEqMaskKHR + Decorate 23(gl_SubgroupGeMask) BuiltIn SubgroupGeMaskKHR + Decorate 26(gl_SubgroupGtMask) BuiltIn SubgroupGtMaskKHR + Decorate 29(gl_SubgroupLeMask) BuiltIn SubgroupLeMaskKHR + Decorate 32(gl_SubgroupLtMask) BuiltIn SubgroupLtMaskKHR + MemberDecorate 46(Buffers) 0 Offset 0 + MemberDecorate 46(Buffers) 1 Offset 16 + MemberDecorate 46(Buffers) 2 Offset 32 + MemberDecorate 46(Buffers) 3 Offset 64 + Decorate 46(Buffers) Block + Decorate 49(data) DescriptorSet 0 + Decorate 49(data) Binding 0 + Decorate 416 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypePointer Input 6(int) +10(gl_SubgroupInvocationID): 9(ptr) Variable Input +12(gl_SubgroupSize): 9(ptr) Variable Input + 15: 6(int) Constant 4 + 17: TypeVector 6(int) 4 + 18: TypePointer Function 17(ivec4) + 20: TypePointer Input 17(ivec4) +21(gl_SubgroupEqMask): 20(ptr) Variable Input +23(gl_SubgroupGeMask): 20(ptr) Variable Input +26(gl_SubgroupGtMask): 20(ptr) Variable Input +29(gl_SubgroupLeMask): 20(ptr) Variable Input +32(gl_SubgroupLtMask): 20(ptr) Variable Input + 36: TypeBool + 37: 36(bool) ConstantTrue + 38: 6(int) Constant 3 + 40: TypeFloat 32 + 41: TypeVector 40(float) 4 + 42: TypeInt 32 1 + 43: TypeVector 42(int) 4 + 44: TypeFloat 64 + 45: TypeVector 44(float64_t) 4 + 46(Buffers): TypeStruct 41(fvec4) 43(ivec4) 17(ivec4) 45(f64vec4) + 47: TypeArray 46(Buffers) 15 + 48: TypePointer StorageBuffer 47 + 49(data): 48(ptr) Variable StorageBuffer + 51: 42(int) Constant 2 + 54: 6(int) Constant 0 + 55: TypePointer StorageBuffer 6(int) + 60: 42(int) Constant 1 + 61: 42(int) Constant 0 + 64: 6(int) Constant 1 + 72: 6(int) Constant 2 + 83: TypeVector 36(bool) 4 + 88: TypePointer StorageBuffer 17(ivec4) + 96: TypePointer StorageBuffer 40(float) + 103: TypeVector 40(float) 2 + 104: TypePointer StorageBuffer 41(fvec4) + 114: TypeVector 40(float) 3 + 124: 42(int) Constant 3 + 131: TypePointer StorageBuffer 42(int) + 138: TypeVector 42(int) 2 + 139: TypePointer StorageBuffer 43(ivec4) + 149: TypeVector 42(int) 3 + 171: TypeVector 6(int) 2 + 181: TypeVector 6(int) 3 + 197: TypePointer StorageBuffer 44(float64_t) + 204: TypeVector 44(float64_t) 2 + 205: TypePointer StorageBuffer 45(f64vec4) + 215: TypeVector 44(float64_t) 3 + 242: 138(ivec2) ConstantComposite 61 61 + 243: TypeVector 36(bool) 2 + 247: 138(ivec2) ConstantComposite 60 60 + 256: 149(ivec3) ConstantComposite 61 61 61 + 257: TypeVector 36(bool) 3 + 261: 149(ivec3) ConstantComposite 60 60 60 + 269: 43(ivec4) ConstantComposite 61 61 61 61 + 273: 43(ivec4) ConstantComposite 60 60 60 60 + 415: 6(int) Constant 8 + 416: 181(ivec3) ConstantComposite 415 415 64 + 4(main): 2 Function None 3 + 5: Label + 8(invocation): 7(ptr) Variable Function + 19(relMask): 18(ptr) Variable Function + 35(result): 18(ptr) Variable Function + 11: 6(int) Load 10(gl_SubgroupInvocationID) + 13: 6(int) Load 12(gl_SubgroupSize) + 14: 6(int) IAdd 11 13 + 16: 6(int) UMod 14 15 + Store 8(invocation) 16 + 22: 17(ivec4) Load 21(gl_SubgroupEqMask) + 24: 17(ivec4) Load 23(gl_SubgroupGeMask) + 25: 17(ivec4) IAdd 22 24 + 27: 17(ivec4) Load 26(gl_SubgroupGtMask) + 28: 17(ivec4) IAdd 25 27 + 30: 17(ivec4) Load 29(gl_SubgroupLeMask) + 31: 17(ivec4) IAdd 28 30 + 33: 17(ivec4) Load 32(gl_SubgroupLtMask) + 34: 17(ivec4) IAdd 31 33 + Store 19(relMask) 34 + 39: 17(ivec4) GroupNonUniformBallot 38 37 + Store 35(result) 39 + 50: 6(int) Load 8(invocation) + 52: 17(ivec4) Load 35(result) + 53: 6(int) GroupNonUniformBallotBitCount 38 Reduce 52 + 56: 55(ptr) AccessChain 49(data) 50 51 54 + Store 56 53 + 57: 6(int) Load 8(invocation) + 58: 17(ivec4) Load 35(result) + 59: 36(bool) GroupNonUniformBallotBitExtract 38 58 54 + 62: 42(int) Select 59 60 61 + 63: 6(int) Bitcast 62 + 65: 55(ptr) AccessChain 49(data) 57 51 64 + Store 65 63 + 66: 6(int) Load 8(invocation) + 67: 17(ivec4) Load 35(result) + 68: 6(int) GroupNonUniformBallotBitCount 38 InclusiveScan 67 + 69: 17(ivec4) Load 35(result) + 70: 6(int) GroupNonUniformBallotBitCount 38 ExclusiveScan 69 + 71: 6(int) IAdd 68 70 + 73: 55(ptr) AccessChain 49(data) 66 51 72 + Store 73 71 + 74: 6(int) Load 8(invocation) + 75: 17(ivec4) Load 35(result) + 76: 6(int) GroupNonUniformBallotFindLSB 38 75 + 77: 17(ivec4) Load 35(result) + 78: 6(int) GroupNonUniformBallotFindMSB 38 77 + 79: 6(int) IAdd 76 78 + 80: 55(ptr) AccessChain 49(data) 74 51 38 + Store 80 79 + 81: 17(ivec4) Load 19(relMask) + 82: 17(ivec4) Load 35(result) + 84: 83(bvec4) IEqual 81 82 + 85: 36(bool) All 84 + SelectionMerge 87 None + BranchConditional 85 86 87 + 86: Label + 89: 88(ptr) AccessChain 49(data) 61 51 + 90: 17(ivec4) Load 89 + 91: 36(bool) GroupNonUniformInverseBallot 38 90 + Branch 87 + 87: Label + 92: 36(bool) Phi 85 5 91 86 + SelectionMerge 94 None + BranchConditional 92 93 276 + 93: Label + 95: 6(int) Load 8(invocation) + 97: 96(ptr) AccessChain 49(data) 61 61 54 + 98: 40(float) Load 97 + 99: 6(int) Load 8(invocation) + 100: 40(float) GroupNonUniformBroadcast 38 98 99 + 101: 96(ptr) AccessChain 49(data) 95 61 54 + Store 101 100 + 102: 6(int) Load 8(invocation) + 105: 104(ptr) AccessChain 49(data) 60 61 + 106: 41(fvec4) Load 105 + 107: 103(fvec2) VectorShuffle 106 106 0 1 + 108: 6(int) Load 8(invocation) + 109: 103(fvec2) GroupNonUniformBroadcast 38 107 108 + 110: 104(ptr) AccessChain 49(data) 102 61 + 111: 41(fvec4) Load 110 + 112: 41(fvec4) VectorShuffle 111 109 4 5 2 3 + Store 110 112 + 113: 6(int) Load 8(invocation) + 115: 104(ptr) AccessChain 49(data) 51 61 + 116: 41(fvec4) Load 115 + 117: 114(fvec3) VectorShuffle 116 116 0 1 2 + 118: 6(int) Load 8(invocation) + 119: 114(fvec3) GroupNonUniformBroadcast 38 117 118 + 120: 104(ptr) AccessChain 49(data) 113 61 + 121: 41(fvec4) Load 120 + 122: 41(fvec4) VectorShuffle 121 119 4 5 6 3 + Store 120 122 + 123: 6(int) Load 8(invocation) + 125: 104(ptr) AccessChain 49(data) 124 61 + 126: 41(fvec4) Load 125 + 127: 6(int) Load 8(invocation) + 128: 41(fvec4) GroupNonUniformBroadcast 38 126 127 + 129: 104(ptr) AccessChain 49(data) 123 61 + Store 129 128 + 130: 6(int) Load 8(invocation) + 132: 131(ptr) AccessChain 49(data) 61 60 54 + 133: 42(int) Load 132 + 134: 6(int) Load 8(invocation) + 135: 42(int) GroupNonUniformBroadcast 38 133 134 + 136: 131(ptr) AccessChain 49(data) 130 60 54 + Store 136 135 + 137: 6(int) Load 8(invocation) + 140: 139(ptr) AccessChain 49(data) 60 60 + 141: 43(ivec4) Load 140 + 142: 138(ivec2) VectorShuffle 141 141 0 1 + 143: 6(int) Load 8(invocation) + 144: 138(ivec2) GroupNonUniformBroadcast 38 142 143 + 145: 139(ptr) AccessChain 49(data) 137 60 + 146: 43(ivec4) Load 145 + 147: 43(ivec4) VectorShuffle 146 144 4 5 2 3 + Store 145 147 + 148: 6(int) Load 8(invocation) + 150: 139(ptr) AccessChain 49(data) 51 60 + 151: 43(ivec4) Load 150 + 152: 149(ivec3) VectorShuffle 151 151 0 1 2 + 153: 6(int) Load 8(invocation) + 154: 149(ivec3) GroupNonUniformBroadcast 38 152 153 + 155: 139(ptr) AccessChain 49(data) 148 60 + 156: 43(ivec4) Load 155 + 157: 43(ivec4) VectorShuffle 156 154 4 5 6 3 + Store 155 157 + 158: 6(int) Load 8(invocation) + 159: 139(ptr) AccessChain 49(data) 124 60 + 160: 43(ivec4) Load 159 + 161: 6(int) Load 8(invocation) + 162: 43(ivec4) GroupNonUniformBroadcast 38 160 161 + 163: 139(ptr) AccessChain 49(data) 158 60 + Store 163 162 + 164: 6(int) Load 8(invocation) + 165: 55(ptr) AccessChain 49(data) 61 51 54 + 166: 6(int) Load 165 + 167: 6(int) Load 8(invocation) + 168: 6(int) GroupNonUniformBroadcast 38 166 167 + 169: 55(ptr) AccessChain 49(data) 164 51 54 + Store 169 168 + 170: 6(int) Load 8(invocation) + 172: 88(ptr) AccessChain 49(data) 60 51 + 173: 17(ivec4) Load 172 + 174: 171(ivec2) VectorShuffle 173 173 0 1 + 175: 6(int) Load 8(invocation) + 176: 171(ivec2) GroupNonUniformBroadcast 38 174 175 + 177: 88(ptr) AccessChain 49(data) 170 51 + 178: 17(ivec4) Load 177 + 179: 17(ivec4) VectorShuffle 178 176 4 5 2 3 + Store 177 179 + 180: 6(int) Load 8(invocation) + 182: 88(ptr) AccessChain 49(data) 51 51 + 183: 17(ivec4) Load 182 + 184: 181(ivec3) VectorShuffle 183 183 0 1 2 + 185: 6(int) Load 8(invocation) + 186: 181(ivec3) GroupNonUniformBroadcast 38 184 185 + 187: 88(ptr) AccessChain 49(data) 180 51 + 188: 17(ivec4) Load 187 + 189: 17(ivec4) VectorShuffle 188 186 4 5 6 3 + Store 187 189 + 190: 6(int) Load 8(invocation) + 191: 88(ptr) AccessChain 49(data) 124 51 + 192: 17(ivec4) Load 191 + 193: 6(int) Load 8(invocation) + 194: 17(ivec4) GroupNonUniformBroadcast 38 192 193 + 195: 88(ptr) AccessChain 49(data) 190 51 + Store 195 194 + 196: 6(int) Load 8(invocation) + 198: 197(ptr) AccessChain 49(data) 61 124 54 + 199:44(float64_t) Load 198 + 200: 6(int) Load 8(invocation) + 201:44(float64_t) GroupNonUniformBroadcast 38 199 200 + 202: 197(ptr) AccessChain 49(data) 196 124 54 + Store 202 201 + 203: 6(int) Load 8(invocation) + 206: 205(ptr) AccessChain 49(data) 60 124 + 207: 45(f64vec4) Load 206 + 208:204(f64vec2) VectorShuffle 207 207 0 1 + 209: 6(int) Load 8(invocation) + 210:204(f64vec2) GroupNonUniformBroadcast 38 208 209 + 211: 205(ptr) AccessChain 49(data) 203 124 + 212: 45(f64vec4) Load 211 + 213: 45(f64vec4) VectorShuffle 212 210 4 5 2 3 + Store 211 213 + 214: 6(int) Load 8(invocation) + 216: 205(ptr) AccessChain 49(data) 51 124 + 217: 45(f64vec4) Load 216 + 218:215(f64vec3) VectorShuffle 217 217 0 1 2 + 219: 6(int) Load 8(invocation) + 220:215(f64vec3) GroupNonUniformBroadcast 38 218 219 + 221: 205(ptr) AccessChain 49(data) 214 124 + 222: 45(f64vec4) Load 221 + 223: 45(f64vec4) VectorShuffle 222 220 4 5 6 3 + Store 221 223 + 224: 6(int) Load 8(invocation) + 225: 205(ptr) AccessChain 49(data) 124 124 + 226: 45(f64vec4) Load 225 + 227: 6(int) Load 8(invocation) + 228: 45(f64vec4) GroupNonUniformBroadcast 38 226 227 + 229: 205(ptr) AccessChain 49(data) 224 124 + Store 229 228 + 230: 6(int) Load 8(invocation) + 231: 131(ptr) AccessChain 49(data) 61 60 54 + 232: 42(int) Load 231 + 233: 36(bool) SLessThan 232 61 + 234: 6(int) Load 8(invocation) + 235: 36(bool) GroupNonUniformBroadcast 38 233 234 + 236: 42(int) Select 235 60 61 + 237: 131(ptr) AccessChain 49(data) 230 60 54 + Store 237 236 + 238: 6(int) Load 8(invocation) + 239: 139(ptr) AccessChain 49(data) 60 60 + 240: 43(ivec4) Load 239 + 241: 138(ivec2) VectorShuffle 240 240 0 1 + 244: 243(bvec2) SLessThan 241 242 + 245: 6(int) Load 8(invocation) + 246: 243(bvec2) GroupNonUniformBroadcast 38 244 245 + 248: 138(ivec2) Select 246 247 242 + 249: 139(ptr) AccessChain 49(data) 238 60 + 250: 43(ivec4) Load 249 + 251: 43(ivec4) VectorShuffle 250 248 4 5 2 3 + Store 249 251 + 252: 6(int) Load 8(invocation) + 253: 139(ptr) AccessChain 49(data) 60 60 + 254: 43(ivec4) Load 253 + 255: 149(ivec3) VectorShuffle 254 254 0 1 2 + 258: 257(bvec3) SLessThan 255 256 + 259: 6(int) Load 8(invocation) + 260: 257(bvec3) GroupNonUniformBroadcast 38 258 259 + 262: 149(ivec3) Select 260 261 256 + 263: 139(ptr) AccessChain 49(data) 252 60 + 264: 43(ivec4) Load 263 + 265: 43(ivec4) VectorShuffle 264 262 4 5 6 3 + Store 263 265 + 266: 6(int) Load 8(invocation) + 267: 139(ptr) AccessChain 49(data) 60 60 + 268: 43(ivec4) Load 267 + 270: 83(bvec4) SLessThan 268 269 + 271: 6(int) Load 8(invocation) + 272: 83(bvec4) GroupNonUniformBroadcast 38 270 271 + 274: 43(ivec4) Select 272 273 269 + 275: 139(ptr) AccessChain 49(data) 266 60 + Store 275 274 + Branch 94 + 276: Label + 277: 6(int) Load 8(invocation) + 278: 96(ptr) AccessChain 49(data) 61 61 54 + 279: 40(float) Load 278 + 280: 40(float) GroupNonUniformBroadcastFirst 38 279 + 281: 96(ptr) AccessChain 49(data) 277 61 54 + Store 281 280 + 282: 6(int) Load 8(invocation) + 283: 104(ptr) AccessChain 49(data) 60 61 + 284: 41(fvec4) Load 283 + 285: 103(fvec2) VectorShuffle 284 284 0 1 + 286: 103(fvec2) GroupNonUniformBroadcastFirst 38 285 + 287: 104(ptr) AccessChain 49(data) 282 61 + 288: 41(fvec4) Load 287 + 289: 41(fvec4) VectorShuffle 288 286 4 5 2 3 + Store 287 289 + 290: 6(int) Load 8(invocation) + 291: 104(ptr) AccessChain 49(data) 51 61 + 292: 41(fvec4) Load 291 + 293: 114(fvec3) VectorShuffle 292 292 0 1 2 + 294: 114(fvec3) GroupNonUniformBroadcastFirst 38 293 + 295: 104(ptr) AccessChain 49(data) 290 61 + 296: 41(fvec4) Load 295 + 297: 41(fvec4) VectorShuffle 296 294 4 5 6 3 + Store 295 297 + 298: 6(int) Load 8(invocation) + 299: 104(ptr) AccessChain 49(data) 124 61 + 300: 41(fvec4) Load 299 + 301: 41(fvec4) GroupNonUniformBroadcastFirst 38 300 + 302: 104(ptr) AccessChain 49(data) 298 61 + Store 302 301 + 303: 6(int) Load 8(invocation) + 304: 131(ptr) AccessChain 49(data) 61 60 54 + 305: 42(int) Load 304 + 306: 42(int) GroupNonUniformBroadcastFirst 38 305 + 307: 131(ptr) AccessChain 49(data) 303 60 54 + Store 307 306 + 308: 6(int) Load 8(invocation) + 309: 139(ptr) AccessChain 49(data) 60 60 + 310: 43(ivec4) Load 309 + 311: 138(ivec2) VectorShuffle 310 310 0 1 + 312: 138(ivec2) GroupNonUniformBroadcastFirst 38 311 + 313: 139(ptr) AccessChain 49(data) 308 60 + 314: 43(ivec4) Load 313 + 315: 43(ivec4) VectorShuffle 314 312 4 5 2 3 + Store 313 315 + 316: 6(int) Load 8(invocation) + 317: 139(ptr) AccessChain 49(data) 51 60 + 318: 43(ivec4) Load 317 + 319: 149(ivec3) VectorShuffle 318 318 0 1 2 + 320: 149(ivec3) GroupNonUniformBroadcastFirst 38 319 + 321: 139(ptr) AccessChain 49(data) 316 60 + 322: 43(ivec4) Load 321 + 323: 43(ivec4) VectorShuffle 322 320 4 5 6 3 + Store 321 323 + 324: 6(int) Load 8(invocation) + 325: 139(ptr) AccessChain 49(data) 124 60 + 326: 43(ivec4) Load 325 + 327: 43(ivec4) GroupNonUniformBroadcastFirst 38 326 + 328: 139(ptr) AccessChain 49(data) 324 60 + Store 328 327 + 329: 6(int) Load 8(invocation) + 330: 55(ptr) AccessChain 49(data) 61 51 54 + 331: 6(int) Load 330 + 332: 6(int) GroupNonUniformBroadcastFirst 38 331 + 333: 55(ptr) AccessChain 49(data) 329 51 54 + Store 333 332 + 334: 6(int) Load 8(invocation) + 335: 88(ptr) AccessChain 49(data) 60 51 + 336: 17(ivec4) Load 335 + 337: 171(ivec2) VectorShuffle 336 336 0 1 + 338: 171(ivec2) GroupNonUniformBroadcastFirst 38 337 + 339: 88(ptr) AccessChain 49(data) 334 51 + 340: 17(ivec4) Load 339 + 341: 17(ivec4) VectorShuffle 340 338 4 5 2 3 + Store 339 341 + 342: 6(int) Load 8(invocation) + 343: 88(ptr) AccessChain 49(data) 51 51 + 344: 17(ivec4) Load 343 + 345: 181(ivec3) VectorShuffle 344 344 0 1 2 + 346: 181(ivec3) GroupNonUniformBroadcastFirst 38 345 + 347: 88(ptr) AccessChain 49(data) 342 51 + 348: 17(ivec4) Load 347 + 349: 17(ivec4) VectorShuffle 348 346 4 5 6 3 + Store 347 349 + 350: 6(int) Load 8(invocation) + 351: 88(ptr) AccessChain 49(data) 124 51 + 352: 17(ivec4) Load 351 + 353: 17(ivec4) GroupNonUniformBroadcastFirst 38 352 + 354: 88(ptr) AccessChain 49(data) 350 51 + Store 354 353 + 355: 6(int) Load 8(invocation) + 356: 197(ptr) AccessChain 49(data) 61 124 54 + 357:44(float64_t) Load 356 + 358:44(float64_t) GroupNonUniformBroadcastFirst 38 357 + 359: 197(ptr) AccessChain 49(data) 355 124 54 + Store 359 358 + 360: 6(int) Load 8(invocation) + 361: 205(ptr) AccessChain 49(data) 60 124 + 362: 45(f64vec4) Load 361 + 363:204(f64vec2) VectorShuffle 362 362 0 1 + 364:204(f64vec2) GroupNonUniformBroadcastFirst 38 363 + 365: 205(ptr) AccessChain 49(data) 360 124 + 366: 45(f64vec4) Load 365 + 367: 45(f64vec4) VectorShuffle 366 364 4 5 2 3 + Store 365 367 + 368: 6(int) Load 8(invocation) + 369: 205(ptr) AccessChain 49(data) 51 124 + 370: 45(f64vec4) Load 369 + 371:215(f64vec3) VectorShuffle 370 370 0 1 2 + 372:215(f64vec3) GroupNonUniformBroadcastFirst 38 371 + 373: 205(ptr) AccessChain 49(data) 368 124 + 374: 45(f64vec4) Load 373 + 375: 45(f64vec4) VectorShuffle 374 372 4 5 6 3 + Store 373 375 + 376: 6(int) Load 8(invocation) + 377: 205(ptr) AccessChain 49(data) 124 124 + 378: 45(f64vec4) Load 377 + 379: 45(f64vec4) GroupNonUniformBroadcastFirst 38 378 + 380: 205(ptr) AccessChain 49(data) 376 124 + Store 380 379 + 381: 6(int) Load 8(invocation) + 382: 131(ptr) AccessChain 49(data) 61 60 54 + 383: 42(int) Load 382 + 384: 36(bool) SLessThan 383 61 + 385: 36(bool) GroupNonUniformBroadcastFirst 38 384 + 386: 42(int) Select 385 60 61 + 387: 131(ptr) AccessChain 49(data) 381 60 54 + Store 387 386 + 388: 6(int) Load 8(invocation) + 389: 139(ptr) AccessChain 49(data) 60 60 + 390: 43(ivec4) Load 389 + 391: 138(ivec2) VectorShuffle 390 390 0 1 + 392: 243(bvec2) SLessThan 391 242 + 393: 243(bvec2) GroupNonUniformBroadcastFirst 38 392 + 394: 138(ivec2) Select 393 247 242 + 395: 139(ptr) AccessChain 49(data) 388 60 + 396: 43(ivec4) Load 395 + 397: 43(ivec4) VectorShuffle 396 394 4 5 2 3 + Store 395 397 + 398: 6(int) Load 8(invocation) + 399: 139(ptr) AccessChain 49(data) 60 60 + 400: 43(ivec4) Load 399 + 401: 149(ivec3) VectorShuffle 400 400 0 1 2 + 402: 257(bvec3) SLessThan 401 256 + 403: 257(bvec3) GroupNonUniformBroadcastFirst 38 402 + 404: 149(ivec3) Select 403 261 256 + 405: 139(ptr) AccessChain 49(data) 398 60 + 406: 43(ivec4) Load 405 + 407: 43(ivec4) VectorShuffle 406 404 4 5 6 3 + Store 405 407 + 408: 6(int) Load 8(invocation) + 409: 139(ptr) AccessChain 49(data) 60 60 + 410: 43(ivec4) Load 409 + 411: 83(bvec4) SLessThan 410 269 + 412: 83(bvec4) GroupNonUniformBroadcastFirst 38 411 + 413: 43(ivec4) Select 412 273 269 + 414: 139(ptr) AccessChain 49(data) 408 60 + Store 414 413 + Branch 94 + 94: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.subgroupBasic.comp.out b/deps/glslang/Test/baseResults/spv.subgroupBasic.comp.out new file mode 100644 index 00000000..641534d5 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.subgroupBasic.comp.out @@ -0,0 +1,84 @@ +spv.subgroupBasic.comp +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 40 + + Capability Shader + Capability GroupNonUniform + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 14 19 22 25 + ExecutionMode 4 LocalSize 8 8 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + Name 4 "main" + Name 8 "Buffer" + MemberName 8(Buffer) 0 "a" + Name 10 "data" + Name 14 "gl_SubgroupSize" + Name 19 "gl_SubgroupInvocationID" + Name 22 "gl_NumSubgroups" + Name 25 "gl_SubgroupID" + Decorate 7 ArrayStride 4 + MemberDecorate 8(Buffer) 0 Offset 0 + Decorate 8(Buffer) Block + Decorate 10(data) DescriptorSet 0 + Decorate 10(data) Binding 0 + Decorate 14(gl_SubgroupSize) RelaxedPrecision + Decorate 14(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 15 RelaxedPrecision + Decorate 19(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 19(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 20 RelaxedPrecision + Decorate 22(gl_NumSubgroups) BuiltIn NumSubgroups + Decorate 25(gl_SubgroupID) BuiltIn SubgroupId + Decorate 39 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeRuntimeArray 6(int) + 8(Buffer): TypeStruct 7 + 9: TypePointer StorageBuffer 8(Buffer) + 10(data): 9(ptr) Variable StorageBuffer + 11: 6(int) Constant 0 + 12: TypeInt 32 0 + 13: TypePointer Input 12(int) +14(gl_SubgroupSize): 13(ptr) Variable Input + 16: 6(int) Constant 1 + 17: TypePointer StorageBuffer 6(int) +19(gl_SubgroupInvocationID): 13(ptr) Variable Input +22(gl_NumSubgroups): 13(ptr) Variable Input +25(gl_SubgroupID): 13(ptr) Variable Input + 27: TypeBool + 28: 12(int) Constant 3 + 32: 12(int) Constant 3400 + 33: 12(int) Constant 72 + 34: 12(int) Constant 264 + 35: 12(int) Constant 2056 + 36: TypeVector 12(int) 3 + 37: 12(int) Constant 8 + 38: 12(int) Constant 1 + 39: 36(ivec3) ConstantComposite 37 37 38 + 4(main): 2 Function None 3 + 5: Label + 15: 12(int) Load 14(gl_SubgroupSize) + 18: 17(ptr) AccessChain 10(data) 11 15 + Store 18 16 + 20: 12(int) Load 19(gl_SubgroupInvocationID) + 21: 17(ptr) AccessChain 10(data) 11 20 + Store 21 16 + 23: 12(int) Load 22(gl_NumSubgroups) + 24: 17(ptr) AccessChain 10(data) 11 23 + Store 24 16 + 26: 12(int) Load 25(gl_SubgroupID) + 29: 27(bool) GroupNonUniformElect 28 + 30: 6(int) Select 29 16 11 + 31: 17(ptr) AccessChain 10(data) 11 26 + Store 31 30 + ControlBarrier 28 28 32 + MemoryBarrier 28 32 + MemoryBarrier 28 33 + MemoryBarrier 28 34 + MemoryBarrier 28 35 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.subgroupClustered.comp.out b/deps/glslang/Test/baseResults/spv.subgroupClustered.comp.out new file mode 100644 index 00000000..150eb8aa --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.subgroupClustered.comp.out @@ -0,0 +1,880 @@ +spv.subgroupClustered.comp +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 737 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformClustered + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 10 12 + ExecutionMode 4 LocalSize 8 1 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + SourceExtension "GL_KHR_shader_subgroup_clustered" + Name 4 "main" + Name 8 "invocation" + Name 10 "gl_SubgroupInvocationID" + Name 12 "gl_SubgroupSize" + Name 24 "Buffers" + MemberName 24(Buffers) 0 "f4" + MemberName 24(Buffers) 1 "i4" + MemberName 24(Buffers) 2 "u4" + MemberName 24(Buffers) 3 "d4" + Name 27 "data" + Decorate 10(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 10(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 11 RelaxedPrecision + Decorate 12(gl_SubgroupSize) RelaxedPrecision + Decorate 12(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 13 RelaxedPrecision + Decorate 14 RelaxedPrecision + Decorate 16 RelaxedPrecision + MemberDecorate 24(Buffers) 0 Offset 0 + MemberDecorate 24(Buffers) 1 Offset 16 + MemberDecorate 24(Buffers) 2 Offset 32 + MemberDecorate 24(Buffers) 3 Offset 64 + Decorate 24(Buffers) Block + Decorate 27(data) DescriptorSet 0 + Decorate 27(data) Binding 0 + Decorate 736 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypePointer Input 6(int) +10(gl_SubgroupInvocationID): 9(ptr) Variable Input +12(gl_SubgroupSize): 9(ptr) Variable Input + 15: 6(int) Constant 4 + 17: TypeFloat 32 + 18: TypeVector 17(float) 4 + 19: TypeInt 32 1 + 20: TypeVector 19(int) 4 + 21: TypeVector 6(int) 4 + 22: TypeFloat 64 + 23: TypeVector 22(float64_t) 4 + 24(Buffers): TypeStruct 18(fvec4) 20(ivec4) 21(ivec4) 23(f64vec4) + 25: TypeArray 24(Buffers) 15 + 26: TypePointer StorageBuffer 25 + 27(data): 26(ptr) Variable StorageBuffer + 29: 19(int) Constant 0 + 30: 6(int) Constant 0 + 31: TypePointer StorageBuffer 17(float) + 34: 6(int) Constant 1 + 35: 6(int) Constant 3 + 39: 19(int) Constant 1 + 40: TypeVector 17(float) 2 + 41: TypePointer StorageBuffer 18(fvec4) + 50: 19(int) Constant 2 + 51: TypeVector 17(float) 3 + 60: 19(int) Constant 3 + 66: TypePointer StorageBuffer 19(int) + 72: TypeVector 19(int) 2 + 73: TypePointer StorageBuffer 20(ivec4) + 82: TypeVector 19(int) 3 + 96: TypePointer StorageBuffer 6(int) + 102: TypeVector 6(int) 2 + 103: TypePointer StorageBuffer 21(ivec4) + 112: TypeVector 6(int) 3 + 126: TypePointer StorageBuffer 22(float64_t) + 132: TypeVector 22(float64_t) 2 + 133: TypePointer StorageBuffer 23(f64vec4) + 142: TypeVector 22(float64_t) 3 + 522: TypeBool + 531: 72(ivec2) ConstantComposite 29 29 + 532: TypeVector 522(bool) 2 + 535: 72(ivec2) ConstantComposite 39 39 + 544: 82(ivec3) ConstantComposite 29 29 29 + 545: TypeVector 522(bool) 3 + 548: 82(ivec3) ConstantComposite 39 39 39 + 556: 20(ivec4) ConstantComposite 29 29 29 29 + 557: TypeVector 522(bool) 4 + 560: 20(ivec4) ConstantComposite 39 39 39 39 + 735: 6(int) Constant 8 + 736: 112(ivec3) ConstantComposite 735 34 34 + 4(main): 2 Function None 3 + 5: Label + 8(invocation): 7(ptr) Variable Function + 11: 6(int) Load 10(gl_SubgroupInvocationID) + 13: 6(int) Load 12(gl_SubgroupSize) + 14: 6(int) IAdd 11 13 + 16: 6(int) UMod 14 15 + Store 8(invocation) 16 + 28: 6(int) Load 8(invocation) + 32: 31(ptr) AccessChain 27(data) 29 29 30 + 33: 17(float) Load 32 + 36: 17(float) GroupNonUniformFAdd 35 ClusteredReduce 33 34 + 37: 31(ptr) AccessChain 27(data) 28 29 30 + Store 37 36 + 38: 6(int) Load 8(invocation) + 42: 41(ptr) AccessChain 27(data) 39 29 + 43: 18(fvec4) Load 42 + 44: 40(fvec2) VectorShuffle 43 43 0 1 + 45: 40(fvec2) GroupNonUniformFAdd 35 ClusteredReduce 44 34 + 46: 41(ptr) AccessChain 27(data) 38 29 + 47: 18(fvec4) Load 46 + 48: 18(fvec4) VectorShuffle 47 45 4 5 2 3 + Store 46 48 + 49: 6(int) Load 8(invocation) + 52: 41(ptr) AccessChain 27(data) 50 29 + 53: 18(fvec4) Load 52 + 54: 51(fvec3) VectorShuffle 53 53 0 1 2 + 55: 51(fvec3) GroupNonUniformFAdd 35 ClusteredReduce 54 34 + 56: 41(ptr) AccessChain 27(data) 49 29 + 57: 18(fvec4) Load 56 + 58: 18(fvec4) VectorShuffle 57 55 4 5 6 3 + Store 56 58 + 59: 6(int) Load 8(invocation) + 61: 41(ptr) AccessChain 27(data) 60 29 + 62: 18(fvec4) Load 61 + 63: 18(fvec4) GroupNonUniformFAdd 35 ClusteredReduce 62 34 + 64: 41(ptr) AccessChain 27(data) 59 29 + Store 64 63 + 65: 6(int) Load 8(invocation) + 67: 66(ptr) AccessChain 27(data) 29 39 30 + 68: 19(int) Load 67 + 69: 19(int) GroupNonUniformIAdd 35 ClusteredReduce 68 34 + 70: 66(ptr) AccessChain 27(data) 65 39 30 + Store 70 69 + 71: 6(int) Load 8(invocation) + 74: 73(ptr) AccessChain 27(data) 39 39 + 75: 20(ivec4) Load 74 + 76: 72(ivec2) VectorShuffle 75 75 0 1 + 77: 72(ivec2) GroupNonUniformIAdd 35 ClusteredReduce 76 34 + 78: 73(ptr) AccessChain 27(data) 71 39 + 79: 20(ivec4) Load 78 + 80: 20(ivec4) VectorShuffle 79 77 4 5 2 3 + Store 78 80 + 81: 6(int) Load 8(invocation) + 83: 73(ptr) AccessChain 27(data) 50 39 + 84: 20(ivec4) Load 83 + 85: 82(ivec3) VectorShuffle 84 84 0 1 2 + 86: 82(ivec3) GroupNonUniformIAdd 35 ClusteredReduce 85 34 + 87: 73(ptr) AccessChain 27(data) 81 39 + 88: 20(ivec4) Load 87 + 89: 20(ivec4) VectorShuffle 88 86 4 5 6 3 + Store 87 89 + 90: 6(int) Load 8(invocation) + 91: 73(ptr) AccessChain 27(data) 60 39 + 92: 20(ivec4) Load 91 + 93: 20(ivec4) GroupNonUniformIAdd 35 ClusteredReduce 92 34 + 94: 73(ptr) AccessChain 27(data) 90 39 + Store 94 93 + 95: 6(int) Load 8(invocation) + 97: 96(ptr) AccessChain 27(data) 29 50 30 + 98: 6(int) Load 97 + 99: 6(int) GroupNonUniformIAdd 35 ClusteredReduce 98 34 + 100: 96(ptr) AccessChain 27(data) 95 50 30 + Store 100 99 + 101: 6(int) Load 8(invocation) + 104: 103(ptr) AccessChain 27(data) 39 50 + 105: 21(ivec4) Load 104 + 106: 102(ivec2) VectorShuffle 105 105 0 1 + 107: 102(ivec2) GroupNonUniformIAdd 35 ClusteredReduce 106 34 + 108: 103(ptr) AccessChain 27(data) 101 50 + 109: 21(ivec4) Load 108 + 110: 21(ivec4) VectorShuffle 109 107 4 5 2 3 + Store 108 110 + 111: 6(int) Load 8(invocation) + 113: 103(ptr) AccessChain 27(data) 50 50 + 114: 21(ivec4) Load 113 + 115: 112(ivec3) VectorShuffle 114 114 0 1 2 + 116: 112(ivec3) GroupNonUniformIAdd 35 ClusteredReduce 115 34 + 117: 103(ptr) AccessChain 27(data) 111 50 + 118: 21(ivec4) Load 117 + 119: 21(ivec4) VectorShuffle 118 116 4 5 6 3 + Store 117 119 + 120: 6(int) Load 8(invocation) + 121: 103(ptr) AccessChain 27(data) 60 50 + 122: 21(ivec4) Load 121 + 123: 21(ivec4) GroupNonUniformIAdd 35 ClusteredReduce 122 34 + 124: 103(ptr) AccessChain 27(data) 120 50 + Store 124 123 + 125: 6(int) Load 8(invocation) + 127: 126(ptr) AccessChain 27(data) 29 60 30 + 128:22(float64_t) Load 127 + 129:22(float64_t) GroupNonUniformFAdd 35 ClusteredReduce 128 34 + 130: 126(ptr) AccessChain 27(data) 125 60 30 + Store 130 129 + 131: 6(int) Load 8(invocation) + 134: 133(ptr) AccessChain 27(data) 39 60 + 135: 23(f64vec4) Load 134 + 136:132(f64vec2) VectorShuffle 135 135 0 1 + 137:132(f64vec2) GroupNonUniformFAdd 35 ClusteredReduce 136 34 + 138: 133(ptr) AccessChain 27(data) 131 60 + 139: 23(f64vec4) Load 138 + 140: 23(f64vec4) VectorShuffle 139 137 4 5 2 3 + Store 138 140 + 141: 6(int) Load 8(invocation) + 143: 133(ptr) AccessChain 27(data) 50 60 + 144: 23(f64vec4) Load 143 + 145:142(f64vec3) VectorShuffle 144 144 0 1 2 + 146:142(f64vec3) GroupNonUniformFAdd 35 ClusteredReduce 145 34 + 147: 133(ptr) AccessChain 27(data) 141 60 + 148: 23(f64vec4) Load 147 + 149: 23(f64vec4) VectorShuffle 148 146 4 5 6 3 + Store 147 149 + 150: 6(int) Load 8(invocation) + 151: 133(ptr) AccessChain 27(data) 60 60 + 152: 23(f64vec4) Load 151 + 153: 23(f64vec4) GroupNonUniformFAdd 35 ClusteredReduce 152 34 + 154: 133(ptr) AccessChain 27(data) 150 60 + Store 154 153 + 155: 6(int) Load 8(invocation) + 156: 31(ptr) AccessChain 27(data) 29 29 30 + 157: 17(float) Load 156 + 158: 17(float) GroupNonUniformFMul 35 ClusteredReduce 157 34 + 159: 31(ptr) AccessChain 27(data) 155 29 30 + Store 159 158 + 160: 6(int) Load 8(invocation) + 161: 41(ptr) AccessChain 27(data) 39 29 + 162: 18(fvec4) Load 161 + 163: 40(fvec2) VectorShuffle 162 162 0 1 + 164: 40(fvec2) GroupNonUniformFMul 35 ClusteredReduce 163 34 + 165: 41(ptr) AccessChain 27(data) 160 29 + 166: 18(fvec4) Load 165 + 167: 18(fvec4) VectorShuffle 166 164 4 5 2 3 + Store 165 167 + 168: 6(int) Load 8(invocation) + 169: 41(ptr) AccessChain 27(data) 50 29 + 170: 18(fvec4) Load 169 + 171: 51(fvec3) VectorShuffle 170 170 0 1 2 + 172: 51(fvec3) GroupNonUniformFMul 35 ClusteredReduce 171 34 + 173: 41(ptr) AccessChain 27(data) 168 29 + 174: 18(fvec4) Load 173 + 175: 18(fvec4) VectorShuffle 174 172 4 5 6 3 + Store 173 175 + 176: 6(int) Load 8(invocation) + 177: 41(ptr) AccessChain 27(data) 60 29 + 178: 18(fvec4) Load 177 + 179: 18(fvec4) GroupNonUniformFMul 35 ClusteredReduce 178 34 + 180: 41(ptr) AccessChain 27(data) 176 29 + Store 180 179 + 181: 6(int) Load 8(invocation) + 182: 66(ptr) AccessChain 27(data) 29 39 30 + 183: 19(int) Load 182 + 184: 19(int) GroupNonUniformIMul 35 ClusteredReduce 183 34 + 185: 66(ptr) AccessChain 27(data) 181 39 30 + Store 185 184 + 186: 6(int) Load 8(invocation) + 187: 73(ptr) AccessChain 27(data) 39 39 + 188: 20(ivec4) Load 187 + 189: 72(ivec2) VectorShuffle 188 188 0 1 + 190: 72(ivec2) GroupNonUniformIMul 35 ClusteredReduce 189 34 + 191: 73(ptr) AccessChain 27(data) 186 39 + 192: 20(ivec4) Load 191 + 193: 20(ivec4) VectorShuffle 192 190 4 5 2 3 + Store 191 193 + 194: 6(int) Load 8(invocation) + 195: 73(ptr) AccessChain 27(data) 50 39 + 196: 20(ivec4) Load 195 + 197: 82(ivec3) VectorShuffle 196 196 0 1 2 + 198: 82(ivec3) GroupNonUniformIMul 35 ClusteredReduce 197 34 + 199: 73(ptr) AccessChain 27(data) 194 39 + 200: 20(ivec4) Load 199 + 201: 20(ivec4) VectorShuffle 200 198 4 5 6 3 + Store 199 201 + 202: 6(int) Load 8(invocation) + 203: 73(ptr) AccessChain 27(data) 60 39 + 204: 20(ivec4) Load 203 + 205: 20(ivec4) GroupNonUniformIMul 35 ClusteredReduce 204 34 + 206: 73(ptr) AccessChain 27(data) 202 39 + Store 206 205 + 207: 6(int) Load 8(invocation) + 208: 96(ptr) AccessChain 27(data) 29 50 30 + 209: 6(int) Load 208 + 210: 6(int) GroupNonUniformIMul 35 ClusteredReduce 209 34 + 211: 96(ptr) AccessChain 27(data) 207 50 30 + Store 211 210 + 212: 6(int) Load 8(invocation) + 213: 103(ptr) AccessChain 27(data) 39 50 + 214: 21(ivec4) Load 213 + 215: 102(ivec2) VectorShuffle 214 214 0 1 + 216: 102(ivec2) GroupNonUniformIMul 35 ClusteredReduce 215 34 + 217: 103(ptr) AccessChain 27(data) 212 50 + 218: 21(ivec4) Load 217 + 219: 21(ivec4) VectorShuffle 218 216 4 5 2 3 + Store 217 219 + 220: 6(int) Load 8(invocation) + 221: 103(ptr) AccessChain 27(data) 50 50 + 222: 21(ivec4) Load 221 + 223: 112(ivec3) VectorShuffle 222 222 0 1 2 + 224: 112(ivec3) GroupNonUniformIMul 35 ClusteredReduce 223 34 + 225: 103(ptr) AccessChain 27(data) 220 50 + 226: 21(ivec4) Load 225 + 227: 21(ivec4) VectorShuffle 226 224 4 5 6 3 + Store 225 227 + 228: 6(int) Load 8(invocation) + 229: 103(ptr) AccessChain 27(data) 60 50 + 230: 21(ivec4) Load 229 + 231: 21(ivec4) GroupNonUniformIMul 35 ClusteredReduce 230 34 + 232: 103(ptr) AccessChain 27(data) 228 50 + Store 232 231 + 233: 6(int) Load 8(invocation) + 234: 126(ptr) AccessChain 27(data) 29 60 30 + 235:22(float64_t) Load 234 + 236:22(float64_t) GroupNonUniformFMul 35 ClusteredReduce 235 34 + 237: 126(ptr) AccessChain 27(data) 233 60 30 + Store 237 236 + 238: 6(int) Load 8(invocation) + 239: 133(ptr) AccessChain 27(data) 39 60 + 240: 23(f64vec4) Load 239 + 241:132(f64vec2) VectorShuffle 240 240 0 1 + 242:132(f64vec2) GroupNonUniformFMul 35 ClusteredReduce 241 34 + 243: 133(ptr) AccessChain 27(data) 238 60 + 244: 23(f64vec4) Load 243 + 245: 23(f64vec4) VectorShuffle 244 242 4 5 2 3 + Store 243 245 + 246: 6(int) Load 8(invocation) + 247: 133(ptr) AccessChain 27(data) 50 60 + 248: 23(f64vec4) Load 247 + 249:142(f64vec3) VectorShuffle 248 248 0 1 2 + 250:142(f64vec3) GroupNonUniformFMul 35 ClusteredReduce 249 34 + 251: 133(ptr) AccessChain 27(data) 246 60 + 252: 23(f64vec4) Load 251 + 253: 23(f64vec4) VectorShuffle 252 250 4 5 6 3 + Store 251 253 + 254: 6(int) Load 8(invocation) + 255: 133(ptr) AccessChain 27(data) 60 60 + 256: 23(f64vec4) Load 255 + 257: 23(f64vec4) GroupNonUniformFMul 35 ClusteredReduce 256 34 + 258: 133(ptr) AccessChain 27(data) 254 60 + Store 258 257 + 259: 6(int) Load 8(invocation) + 260: 31(ptr) AccessChain 27(data) 29 29 30 + 261: 17(float) Load 260 + 262: 17(float) GroupNonUniformFMin 35 ClusteredReduce 261 34 + 263: 31(ptr) AccessChain 27(data) 259 29 30 + Store 263 262 + 264: 6(int) Load 8(invocation) + 265: 41(ptr) AccessChain 27(data) 39 29 + 266: 18(fvec4) Load 265 + 267: 40(fvec2) VectorShuffle 266 266 0 1 + 268: 40(fvec2) GroupNonUniformFMin 35 ClusteredReduce 267 34 + 269: 41(ptr) AccessChain 27(data) 264 29 + 270: 18(fvec4) Load 269 + 271: 18(fvec4) VectorShuffle 270 268 4 5 2 3 + Store 269 271 + 272: 6(int) Load 8(invocation) + 273: 41(ptr) AccessChain 27(data) 50 29 + 274: 18(fvec4) Load 273 + 275: 51(fvec3) VectorShuffle 274 274 0 1 2 + 276: 51(fvec3) GroupNonUniformFMin 35 ClusteredReduce 275 34 + 277: 41(ptr) AccessChain 27(data) 272 29 + 278: 18(fvec4) Load 277 + 279: 18(fvec4) VectorShuffle 278 276 4 5 6 3 + Store 277 279 + 280: 6(int) Load 8(invocation) + 281: 41(ptr) AccessChain 27(data) 60 29 + 282: 18(fvec4) Load 281 + 283: 18(fvec4) GroupNonUniformFMin 35 ClusteredReduce 282 34 + 284: 41(ptr) AccessChain 27(data) 280 29 + Store 284 283 + 285: 6(int) Load 8(invocation) + 286: 66(ptr) AccessChain 27(data) 29 39 30 + 287: 19(int) Load 286 + 288: 19(int) GroupNonUniformSMin 35 ClusteredReduce 287 34 + 289: 66(ptr) AccessChain 27(data) 285 39 30 + Store 289 288 + 290: 6(int) Load 8(invocation) + 291: 73(ptr) AccessChain 27(data) 39 39 + 292: 20(ivec4) Load 291 + 293: 72(ivec2) VectorShuffle 292 292 0 1 + 294: 72(ivec2) GroupNonUniformSMin 35 ClusteredReduce 293 34 + 295: 73(ptr) AccessChain 27(data) 290 39 + 296: 20(ivec4) Load 295 + 297: 20(ivec4) VectorShuffle 296 294 4 5 2 3 + Store 295 297 + 298: 6(int) Load 8(invocation) + 299: 73(ptr) AccessChain 27(data) 50 39 + 300: 20(ivec4) Load 299 + 301: 82(ivec3) VectorShuffle 300 300 0 1 2 + 302: 82(ivec3) GroupNonUniformSMin 35 ClusteredReduce 301 34 + 303: 73(ptr) AccessChain 27(data) 298 39 + 304: 20(ivec4) Load 303 + 305: 20(ivec4) VectorShuffle 304 302 4 5 6 3 + Store 303 305 + 306: 6(int) Load 8(invocation) + 307: 73(ptr) AccessChain 27(data) 60 39 + 308: 20(ivec4) Load 307 + 309: 20(ivec4) GroupNonUniformSMin 35 ClusteredReduce 308 34 + 310: 73(ptr) AccessChain 27(data) 306 39 + Store 310 309 + 311: 6(int) Load 8(invocation) + 312: 96(ptr) AccessChain 27(data) 29 50 30 + 313: 6(int) Load 312 + 314: 6(int) GroupNonUniformUMin 35 ClusteredReduce 313 34 + 315: 96(ptr) AccessChain 27(data) 311 50 30 + Store 315 314 + 316: 6(int) Load 8(invocation) + 317: 103(ptr) AccessChain 27(data) 39 50 + 318: 21(ivec4) Load 317 + 319: 102(ivec2) VectorShuffle 318 318 0 1 + 320: 102(ivec2) GroupNonUniformUMin 35 ClusteredReduce 319 34 + 321: 103(ptr) AccessChain 27(data) 316 50 + 322: 21(ivec4) Load 321 + 323: 21(ivec4) VectorShuffle 322 320 4 5 2 3 + Store 321 323 + 324: 6(int) Load 8(invocation) + 325: 103(ptr) AccessChain 27(data) 50 50 + 326: 21(ivec4) Load 325 + 327: 112(ivec3) VectorShuffle 326 326 0 1 2 + 328: 112(ivec3) GroupNonUniformUMin 35 ClusteredReduce 327 34 + 329: 103(ptr) AccessChain 27(data) 324 50 + 330: 21(ivec4) Load 329 + 331: 21(ivec4) VectorShuffle 330 328 4 5 6 3 + Store 329 331 + 332: 6(int) Load 8(invocation) + 333: 103(ptr) AccessChain 27(data) 60 50 + 334: 21(ivec4) Load 333 + 335: 21(ivec4) GroupNonUniformUMin 35 ClusteredReduce 334 34 + 336: 103(ptr) AccessChain 27(data) 332 50 + Store 336 335 + 337: 6(int) Load 8(invocation) + 338: 126(ptr) AccessChain 27(data) 29 60 30 + 339:22(float64_t) Load 338 + 340:22(float64_t) GroupNonUniformFMin 35 ClusteredReduce 339 34 + 341: 126(ptr) AccessChain 27(data) 337 60 30 + Store 341 340 + 342: 6(int) Load 8(invocation) + 343: 133(ptr) AccessChain 27(data) 39 60 + 344: 23(f64vec4) Load 343 + 345:132(f64vec2) VectorShuffle 344 344 0 1 + 346:132(f64vec2) GroupNonUniformFMin 35 ClusteredReduce 345 34 + 347: 133(ptr) AccessChain 27(data) 342 60 + 348: 23(f64vec4) Load 347 + 349: 23(f64vec4) VectorShuffle 348 346 4 5 2 3 + Store 347 349 + 350: 6(int) Load 8(invocation) + 351: 133(ptr) AccessChain 27(data) 50 60 + 352: 23(f64vec4) Load 351 + 353:142(f64vec3) VectorShuffle 352 352 0 1 2 + 354:142(f64vec3) GroupNonUniformFMin 35 ClusteredReduce 353 34 + 355: 133(ptr) AccessChain 27(data) 350 60 + 356: 23(f64vec4) Load 355 + 357: 23(f64vec4) VectorShuffle 356 354 4 5 6 3 + Store 355 357 + 358: 6(int) Load 8(invocation) + 359: 133(ptr) AccessChain 27(data) 60 60 + 360: 23(f64vec4) Load 359 + 361: 23(f64vec4) GroupNonUniformFMin 35 ClusteredReduce 360 34 + 362: 133(ptr) AccessChain 27(data) 358 60 + Store 362 361 + 363: 6(int) Load 8(invocation) + 364: 31(ptr) AccessChain 27(data) 29 29 30 + 365: 17(float) Load 364 + 366: 17(float) GroupNonUniformFMax 35 ClusteredReduce 365 34 + 367: 31(ptr) AccessChain 27(data) 363 29 30 + Store 367 366 + 368: 6(int) Load 8(invocation) + 369: 41(ptr) AccessChain 27(data) 39 29 + 370: 18(fvec4) Load 369 + 371: 40(fvec2) VectorShuffle 370 370 0 1 + 372: 40(fvec2) GroupNonUniformFMax 35 ClusteredReduce 371 34 + 373: 41(ptr) AccessChain 27(data) 368 29 + 374: 18(fvec4) Load 373 + 375: 18(fvec4) VectorShuffle 374 372 4 5 2 3 + Store 373 375 + 376: 6(int) Load 8(invocation) + 377: 41(ptr) AccessChain 27(data) 50 29 + 378: 18(fvec4) Load 377 + 379: 51(fvec3) VectorShuffle 378 378 0 1 2 + 380: 51(fvec3) GroupNonUniformFMax 35 ClusteredReduce 379 34 + 381: 41(ptr) AccessChain 27(data) 376 29 + 382: 18(fvec4) Load 381 + 383: 18(fvec4) VectorShuffle 382 380 4 5 6 3 + Store 381 383 + 384: 6(int) Load 8(invocation) + 385: 41(ptr) AccessChain 27(data) 60 29 + 386: 18(fvec4) Load 385 + 387: 18(fvec4) GroupNonUniformFMax 35 ClusteredReduce 386 34 + 388: 41(ptr) AccessChain 27(data) 384 29 + Store 388 387 + 389: 6(int) Load 8(invocation) + 390: 66(ptr) AccessChain 27(data) 29 39 30 + 391: 19(int) Load 390 + 392: 19(int) GroupNonUniformSMax 35 ClusteredReduce 391 34 + 393: 66(ptr) AccessChain 27(data) 389 39 30 + Store 393 392 + 394: 6(int) Load 8(invocation) + 395: 73(ptr) AccessChain 27(data) 39 39 + 396: 20(ivec4) Load 395 + 397: 72(ivec2) VectorShuffle 396 396 0 1 + 398: 72(ivec2) GroupNonUniformSMax 35 ClusteredReduce 397 34 + 399: 73(ptr) AccessChain 27(data) 394 39 + 400: 20(ivec4) Load 399 + 401: 20(ivec4) VectorShuffle 400 398 4 5 2 3 + Store 399 401 + 402: 6(int) Load 8(invocation) + 403: 73(ptr) AccessChain 27(data) 50 39 + 404: 20(ivec4) Load 403 + 405: 82(ivec3) VectorShuffle 404 404 0 1 2 + 406: 82(ivec3) GroupNonUniformSMax 35 ClusteredReduce 405 34 + 407: 73(ptr) AccessChain 27(data) 402 39 + 408: 20(ivec4) Load 407 + 409: 20(ivec4) VectorShuffle 408 406 4 5 6 3 + Store 407 409 + 410: 6(int) Load 8(invocation) + 411: 73(ptr) AccessChain 27(data) 60 39 + 412: 20(ivec4) Load 411 + 413: 20(ivec4) GroupNonUniformSMax 35 ClusteredReduce 412 34 + 414: 73(ptr) AccessChain 27(data) 410 39 + Store 414 413 + 415: 6(int) Load 8(invocation) + 416: 96(ptr) AccessChain 27(data) 29 50 30 + 417: 6(int) Load 416 + 418: 6(int) GroupNonUniformUMax 35 ClusteredReduce 417 34 + 419: 96(ptr) AccessChain 27(data) 415 50 30 + Store 419 418 + 420: 6(int) Load 8(invocation) + 421: 103(ptr) AccessChain 27(data) 39 50 + 422: 21(ivec4) Load 421 + 423: 102(ivec2) VectorShuffle 422 422 0 1 + 424: 102(ivec2) GroupNonUniformUMax 35 ClusteredReduce 423 34 + 425: 103(ptr) AccessChain 27(data) 420 50 + 426: 21(ivec4) Load 425 + 427: 21(ivec4) VectorShuffle 426 424 4 5 2 3 + Store 425 427 + 428: 6(int) Load 8(invocation) + 429: 103(ptr) AccessChain 27(data) 50 50 + 430: 21(ivec4) Load 429 + 431: 112(ivec3) VectorShuffle 430 430 0 1 2 + 432: 112(ivec3) GroupNonUniformUMax 35 ClusteredReduce 431 34 + 433: 103(ptr) AccessChain 27(data) 428 50 + 434: 21(ivec4) Load 433 + 435: 21(ivec4) VectorShuffle 434 432 4 5 6 3 + Store 433 435 + 436: 6(int) Load 8(invocation) + 437: 103(ptr) AccessChain 27(data) 60 50 + 438: 21(ivec4) Load 437 + 439: 21(ivec4) GroupNonUniformUMax 35 ClusteredReduce 438 34 + 440: 103(ptr) AccessChain 27(data) 436 50 + Store 440 439 + 441: 6(int) Load 8(invocation) + 442: 126(ptr) AccessChain 27(data) 29 60 30 + 443:22(float64_t) Load 442 + 444:22(float64_t) GroupNonUniformFMax 35 ClusteredReduce 443 34 + 445: 126(ptr) AccessChain 27(data) 441 60 30 + Store 445 444 + 446: 6(int) Load 8(invocation) + 447: 133(ptr) AccessChain 27(data) 39 60 + 448: 23(f64vec4) Load 447 + 449:132(f64vec2) VectorShuffle 448 448 0 1 + 450:132(f64vec2) GroupNonUniformFMax 35 ClusteredReduce 449 34 + 451: 133(ptr) AccessChain 27(data) 446 60 + 452: 23(f64vec4) Load 451 + 453: 23(f64vec4) VectorShuffle 452 450 4 5 2 3 + Store 451 453 + 454: 6(int) Load 8(invocation) + 455: 133(ptr) AccessChain 27(data) 50 60 + 456: 23(f64vec4) Load 455 + 457:142(f64vec3) VectorShuffle 456 456 0 1 2 + 458:142(f64vec3) GroupNonUniformFMax 35 ClusteredReduce 457 34 + 459: 133(ptr) AccessChain 27(data) 454 60 + 460: 23(f64vec4) Load 459 + 461: 23(f64vec4) VectorShuffle 460 458 4 5 6 3 + Store 459 461 + 462: 6(int) Load 8(invocation) + 463: 133(ptr) AccessChain 27(data) 60 60 + 464: 23(f64vec4) Load 463 + 465: 23(f64vec4) GroupNonUniformFMax 35 ClusteredReduce 464 34 + 466: 133(ptr) AccessChain 27(data) 462 60 + Store 466 465 + 467: 6(int) Load 8(invocation) + 468: 66(ptr) AccessChain 27(data) 29 39 30 + 469: 19(int) Load 468 + 470: 19(int) GroupNonUniformBitwiseAnd 35 ClusteredReduce 469 34 + 471: 66(ptr) AccessChain 27(data) 467 39 30 + Store 471 470 + 472: 6(int) Load 8(invocation) + 473: 73(ptr) AccessChain 27(data) 39 39 + 474: 20(ivec4) Load 473 + 475: 72(ivec2) VectorShuffle 474 474 0 1 + 476: 72(ivec2) GroupNonUniformBitwiseAnd 35 ClusteredReduce 475 34 + 477: 73(ptr) AccessChain 27(data) 472 39 + 478: 20(ivec4) Load 477 + 479: 20(ivec4) VectorShuffle 478 476 4 5 2 3 + Store 477 479 + 480: 6(int) Load 8(invocation) + 481: 73(ptr) AccessChain 27(data) 50 39 + 482: 20(ivec4) Load 481 + 483: 82(ivec3) VectorShuffle 482 482 0 1 2 + 484: 82(ivec3) GroupNonUniformBitwiseAnd 35 ClusteredReduce 483 34 + 485: 73(ptr) AccessChain 27(data) 480 39 + 486: 20(ivec4) Load 485 + 487: 20(ivec4) VectorShuffle 486 484 4 5 6 3 + Store 485 487 + 488: 6(int) Load 8(invocation) + 489: 73(ptr) AccessChain 27(data) 60 39 + 490: 20(ivec4) Load 489 + 491: 20(ivec4) GroupNonUniformBitwiseAnd 35 ClusteredReduce 490 34 + 492: 73(ptr) AccessChain 27(data) 488 39 + Store 492 491 + 493: 6(int) Load 8(invocation) + 494: 96(ptr) AccessChain 27(data) 29 50 30 + 495: 6(int) Load 494 + 496: 6(int) GroupNonUniformBitwiseAnd 35 ClusteredReduce 495 34 + 497: 96(ptr) AccessChain 27(data) 493 50 30 + Store 497 496 + 498: 6(int) Load 8(invocation) + 499: 103(ptr) AccessChain 27(data) 39 50 + 500: 21(ivec4) Load 499 + 501: 102(ivec2) VectorShuffle 500 500 0 1 + 502: 102(ivec2) GroupNonUniformBitwiseAnd 35 ClusteredReduce 501 34 + 503: 103(ptr) AccessChain 27(data) 498 50 + 504: 21(ivec4) Load 503 + 505: 21(ivec4) VectorShuffle 504 502 4 5 2 3 + Store 503 505 + 506: 6(int) Load 8(invocation) + 507: 103(ptr) AccessChain 27(data) 50 50 + 508: 21(ivec4) Load 507 + 509: 112(ivec3) VectorShuffle 508 508 0 1 2 + 510: 112(ivec3) GroupNonUniformBitwiseAnd 35 ClusteredReduce 509 34 + 511: 103(ptr) AccessChain 27(data) 506 50 + 512: 21(ivec4) Load 511 + 513: 21(ivec4) VectorShuffle 512 510 4 5 6 3 + Store 511 513 + 514: 6(int) Load 8(invocation) + 515: 103(ptr) AccessChain 27(data) 60 50 + 516: 21(ivec4) Load 515 + 517: 21(ivec4) GroupNonUniformBitwiseAnd 35 ClusteredReduce 516 34 + 518: 103(ptr) AccessChain 27(data) 514 50 + Store 518 517 + 519: 6(int) Load 8(invocation) + 520: 66(ptr) AccessChain 27(data) 29 39 30 + 521: 19(int) Load 520 + 523: 522(bool) SLessThan 521 29 + 524: 522(bool) GroupNonUniformLogicalAnd 35 ClusteredReduce 523 34 + 525: 19(int) Select 524 39 29 + 526: 66(ptr) AccessChain 27(data) 519 39 30 + Store 526 525 + 527: 6(int) Load 8(invocation) + 528: 73(ptr) AccessChain 27(data) 39 39 + 529: 20(ivec4) Load 528 + 530: 72(ivec2) VectorShuffle 529 529 0 1 + 533: 532(bvec2) SLessThan 530 531 + 534: 532(bvec2) GroupNonUniformLogicalAnd 35 ClusteredReduce 533 34 + 536: 72(ivec2) Select 534 535 531 + 537: 73(ptr) AccessChain 27(data) 527 39 + 538: 20(ivec4) Load 537 + 539: 20(ivec4) VectorShuffle 538 536 4 5 2 3 + Store 537 539 + 540: 6(int) Load 8(invocation) + 541: 73(ptr) AccessChain 27(data) 39 39 + 542: 20(ivec4) Load 541 + 543: 82(ivec3) VectorShuffle 542 542 0 1 2 + 546: 545(bvec3) SLessThan 543 544 + 547: 545(bvec3) GroupNonUniformLogicalAnd 35 ClusteredReduce 546 34 + 549: 82(ivec3) Select 547 548 544 + 550: 73(ptr) AccessChain 27(data) 540 39 + 551: 20(ivec4) Load 550 + 552: 20(ivec4) VectorShuffle 551 549 4 5 6 3 + Store 550 552 + 553: 6(int) Load 8(invocation) + 554: 73(ptr) AccessChain 27(data) 39 39 + 555: 20(ivec4) Load 554 + 558: 557(bvec4) SLessThan 555 556 + 559: 557(bvec4) GroupNonUniformLogicalAnd 35 ClusteredReduce 558 34 + 561: 20(ivec4) Select 559 560 556 + 562: 73(ptr) AccessChain 27(data) 553 39 + Store 562 561 + 563: 6(int) Load 8(invocation) + 564: 66(ptr) AccessChain 27(data) 29 39 30 + 565: 19(int) Load 564 + 566: 19(int) GroupNonUniformBitwiseOr 35 ClusteredReduce 565 34 + 567: 66(ptr) AccessChain 27(data) 563 39 30 + Store 567 566 + 568: 6(int) Load 8(invocation) + 569: 73(ptr) AccessChain 27(data) 39 39 + 570: 20(ivec4) Load 569 + 571: 72(ivec2) VectorShuffle 570 570 0 1 + 572: 72(ivec2) GroupNonUniformBitwiseOr 35 ClusteredReduce 571 34 + 573: 73(ptr) AccessChain 27(data) 568 39 + 574: 20(ivec4) Load 573 + 575: 20(ivec4) VectorShuffle 574 572 4 5 2 3 + Store 573 575 + 576: 6(int) Load 8(invocation) + 577: 73(ptr) AccessChain 27(data) 50 39 + 578: 20(ivec4) Load 577 + 579: 82(ivec3) VectorShuffle 578 578 0 1 2 + 580: 82(ivec3) GroupNonUniformBitwiseOr 35 ClusteredReduce 579 34 + 581: 73(ptr) AccessChain 27(data) 576 39 + 582: 20(ivec4) Load 581 + 583: 20(ivec4) VectorShuffle 582 580 4 5 6 3 + Store 581 583 + 584: 6(int) Load 8(invocation) + 585: 73(ptr) AccessChain 27(data) 60 39 + 586: 20(ivec4) Load 585 + 587: 20(ivec4) GroupNonUniformBitwiseOr 35 ClusteredReduce 586 34 + 588: 73(ptr) AccessChain 27(data) 584 39 + Store 588 587 + 589: 6(int) Load 8(invocation) + 590: 96(ptr) AccessChain 27(data) 29 50 30 + 591: 6(int) Load 590 + 592: 6(int) GroupNonUniformBitwiseOr 35 ClusteredReduce 591 34 + 593: 96(ptr) AccessChain 27(data) 589 50 30 + Store 593 592 + 594: 6(int) Load 8(invocation) + 595: 103(ptr) AccessChain 27(data) 39 50 + 596: 21(ivec4) Load 595 + 597: 102(ivec2) VectorShuffle 596 596 0 1 + 598: 102(ivec2) GroupNonUniformBitwiseOr 35 ClusteredReduce 597 34 + 599: 103(ptr) AccessChain 27(data) 594 50 + 600: 21(ivec4) Load 599 + 601: 21(ivec4) VectorShuffle 600 598 4 5 2 3 + Store 599 601 + 602: 6(int) Load 8(invocation) + 603: 103(ptr) AccessChain 27(data) 50 50 + 604: 21(ivec4) Load 603 + 605: 112(ivec3) VectorShuffle 604 604 0 1 2 + 606: 112(ivec3) GroupNonUniformBitwiseOr 35 ClusteredReduce 605 34 + 607: 103(ptr) AccessChain 27(data) 602 50 + 608: 21(ivec4) Load 607 + 609: 21(ivec4) VectorShuffle 608 606 4 5 6 3 + Store 607 609 + 610: 6(int) Load 8(invocation) + 611: 103(ptr) AccessChain 27(data) 60 50 + 612: 21(ivec4) Load 611 + 613: 21(ivec4) GroupNonUniformBitwiseOr 35 ClusteredReduce 612 34 + 614: 103(ptr) AccessChain 27(data) 610 50 + Store 614 613 + 615: 6(int) Load 8(invocation) + 616: 66(ptr) AccessChain 27(data) 29 39 30 + 617: 19(int) Load 616 + 618: 522(bool) SLessThan 617 29 + 619: 522(bool) GroupNonUniformLogicalOr 35 ClusteredReduce 618 34 + 620: 19(int) Select 619 39 29 + 621: 66(ptr) AccessChain 27(data) 615 39 30 + Store 621 620 + 622: 6(int) Load 8(invocation) + 623: 73(ptr) AccessChain 27(data) 39 39 + 624: 20(ivec4) Load 623 + 625: 72(ivec2) VectorShuffle 624 624 0 1 + 626: 532(bvec2) SLessThan 625 531 + 627: 532(bvec2) GroupNonUniformLogicalOr 35 ClusteredReduce 626 34 + 628: 72(ivec2) Select 627 535 531 + 629: 73(ptr) AccessChain 27(data) 622 39 + 630: 20(ivec4) Load 629 + 631: 20(ivec4) VectorShuffle 630 628 4 5 2 3 + Store 629 631 + 632: 6(int) Load 8(invocation) + 633: 73(ptr) AccessChain 27(data) 39 39 + 634: 20(ivec4) Load 633 + 635: 82(ivec3) VectorShuffle 634 634 0 1 2 + 636: 545(bvec3) SLessThan 635 544 + 637: 545(bvec3) GroupNonUniformLogicalOr 35 ClusteredReduce 636 34 + 638: 82(ivec3) Select 637 548 544 + 639: 73(ptr) AccessChain 27(data) 632 39 + 640: 20(ivec4) Load 639 + 641: 20(ivec4) VectorShuffle 640 638 4 5 6 3 + Store 639 641 + 642: 6(int) Load 8(invocation) + 643: 73(ptr) AccessChain 27(data) 39 39 + 644: 20(ivec4) Load 643 + 645: 557(bvec4) SLessThan 644 556 + 646: 557(bvec4) GroupNonUniformLogicalOr 35 ClusteredReduce 645 34 + 647: 20(ivec4) Select 646 560 556 + 648: 73(ptr) AccessChain 27(data) 642 39 + Store 648 647 + 649: 6(int) Load 8(invocation) + 650: 66(ptr) AccessChain 27(data) 29 39 30 + 651: 19(int) Load 650 + 652: 19(int) GroupNonUniformBitwiseXor 35 ClusteredReduce 651 34 + 653: 66(ptr) AccessChain 27(data) 649 39 30 + Store 653 652 + 654: 6(int) Load 8(invocation) + 655: 73(ptr) AccessChain 27(data) 39 39 + 656: 20(ivec4) Load 655 + 657: 72(ivec2) VectorShuffle 656 656 0 1 + 658: 72(ivec2) GroupNonUniformBitwiseXor 35 ClusteredReduce 657 34 + 659: 73(ptr) AccessChain 27(data) 654 39 + 660: 20(ivec4) Load 659 + 661: 20(ivec4) VectorShuffle 660 658 4 5 2 3 + Store 659 661 + 662: 6(int) Load 8(invocation) + 663: 73(ptr) AccessChain 27(data) 50 39 + 664: 20(ivec4) Load 663 + 665: 82(ivec3) VectorShuffle 664 664 0 1 2 + 666: 82(ivec3) GroupNonUniformBitwiseXor 35 ClusteredReduce 665 34 + 667: 73(ptr) AccessChain 27(data) 662 39 + 668: 20(ivec4) Load 667 + 669: 20(ivec4) VectorShuffle 668 666 4 5 6 3 + Store 667 669 + 670: 6(int) Load 8(invocation) + 671: 73(ptr) AccessChain 27(data) 60 39 + 672: 20(ivec4) Load 671 + 673: 20(ivec4) GroupNonUniformBitwiseXor 35 ClusteredReduce 672 34 + 674: 73(ptr) AccessChain 27(data) 670 39 + Store 674 673 + 675: 6(int) Load 8(invocation) + 676: 96(ptr) AccessChain 27(data) 29 50 30 + 677: 6(int) Load 676 + 678: 6(int) GroupNonUniformBitwiseXor 35 ClusteredReduce 677 34 + 679: 96(ptr) AccessChain 27(data) 675 50 30 + Store 679 678 + 680: 6(int) Load 8(invocation) + 681: 103(ptr) AccessChain 27(data) 39 50 + 682: 21(ivec4) Load 681 + 683: 102(ivec2) VectorShuffle 682 682 0 1 + 684: 102(ivec2) GroupNonUniformBitwiseXor 35 ClusteredReduce 683 34 + 685: 103(ptr) AccessChain 27(data) 680 50 + 686: 21(ivec4) Load 685 + 687: 21(ivec4) VectorShuffle 686 684 4 5 2 3 + Store 685 687 + 688: 6(int) Load 8(invocation) + 689: 103(ptr) AccessChain 27(data) 50 50 + 690: 21(ivec4) Load 689 + 691: 112(ivec3) VectorShuffle 690 690 0 1 2 + 692: 112(ivec3) GroupNonUniformBitwiseXor 35 ClusteredReduce 691 34 + 693: 103(ptr) AccessChain 27(data) 688 50 + 694: 21(ivec4) Load 693 + 695: 21(ivec4) VectorShuffle 694 692 4 5 6 3 + Store 693 695 + 696: 6(int) Load 8(invocation) + 697: 103(ptr) AccessChain 27(data) 60 50 + 698: 21(ivec4) Load 697 + 699: 21(ivec4) GroupNonUniformBitwiseXor 35 ClusteredReduce 698 34 + 700: 103(ptr) AccessChain 27(data) 696 50 + Store 700 699 + 701: 6(int) Load 8(invocation) + 702: 66(ptr) AccessChain 27(data) 29 39 30 + 703: 19(int) Load 702 + 704: 522(bool) SLessThan 703 29 + 705: 522(bool) GroupNonUniformLogicalXor 35 ClusteredReduce 704 34 + 706: 19(int) Select 705 39 29 + 707: 66(ptr) AccessChain 27(data) 701 39 30 + Store 707 706 + 708: 6(int) Load 8(invocation) + 709: 73(ptr) AccessChain 27(data) 39 39 + 710: 20(ivec4) Load 709 + 711: 72(ivec2) VectorShuffle 710 710 0 1 + 712: 532(bvec2) SLessThan 711 531 + 713: 532(bvec2) GroupNonUniformLogicalXor 35 ClusteredReduce 712 34 + 714: 72(ivec2) Select 713 535 531 + 715: 73(ptr) AccessChain 27(data) 708 39 + 716: 20(ivec4) Load 715 + 717: 20(ivec4) VectorShuffle 716 714 4 5 2 3 + Store 715 717 + 718: 6(int) Load 8(invocation) + 719: 73(ptr) AccessChain 27(data) 39 39 + 720: 20(ivec4) Load 719 + 721: 82(ivec3) VectorShuffle 720 720 0 1 2 + 722: 545(bvec3) SLessThan 721 544 + 723: 545(bvec3) GroupNonUniformLogicalXor 35 ClusteredReduce 722 34 + 724: 82(ivec3) Select 723 548 544 + 725: 73(ptr) AccessChain 27(data) 718 39 + 726: 20(ivec4) Load 725 + 727: 20(ivec4) VectorShuffle 726 724 4 5 6 3 + Store 725 727 + 728: 6(int) Load 8(invocation) + 729: 73(ptr) AccessChain 27(data) 39 39 + 730: 20(ivec4) Load 729 + 731: 557(bvec4) SLessThan 730 556 + 732: 557(bvec4) GroupNonUniformLogicalXor 35 ClusteredReduce 731 34 + 733: 20(ivec4) Select 732 560 556 + 734: 73(ptr) AccessChain 27(data) 728 39 + Store 734 733 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.subgroupClusteredNeg.comp.out b/deps/glslang/Test/baseResults/spv.subgroupClusteredNeg.comp.out new file mode 100644 index 00000000..911ff72d --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.subgroupClusteredNeg.comp.out @@ -0,0 +1,13 @@ +spv.subgroupClusteredNeg.comp +ERROR: 0:22: 'cluster size' : argument must be at least 1 +ERROR: 0:24: 'cluster size' : argument must be a power of 2 +ERROR: 0:27: 'cluster size' : argument must be a power of 2 +ERROR: 0:29: 'cluster size' : argument must be at least 1 +ERROR: 0:31: 'cluster size' : argument must be at least 1 +ERROR: 0:33: 'cluster size' : argument must be compile-time constant +ERROR: 0:36: 'cluster size' : argument must be compile-time constant +ERROR: 0:37: 'cluster size' : argument must be compile-time constant +ERROR: 8 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out b/deps/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out new file mode 100644 index 00000000..e967df4a --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out @@ -0,0 +1,2876 @@ +spv.subgroupPartitioned.comp +error: SPIRV-Tools Validation Errors +error: Opcode GroupNonUniformFAdd requires one of these capabilities: GroupNonUniformArithmetic GroupNonUniformClustered + %179 = OpGroupNonUniformFAdd %float %uint_3 PartitionedReduceNV %176 %177 + +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 2506 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformPartitionedNV + Extension "SPV_NV_shader_subgroup_partitioned" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 10 12 + ExecutionMode 4 LocalSize 8 1 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + SourceExtension "GL_NV_shader_subgroup_partitioned" + Name 4 "main" + Name 8 "invocation" + Name 10 "gl_SubgroupInvocationID" + Name 12 "gl_SubgroupSize" + Name 19 "ballot" + Name 28 "Buffers" + MemberName 28(Buffers) 0 "f4" + MemberName 28(Buffers) 1 "i4" + MemberName 28(Buffers) 2 "u4" + MemberName 28(Buffers) 3 "d4" + Name 31 "data" + Decorate 10(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 10(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 11 RelaxedPrecision + Decorate 12(gl_SubgroupSize) RelaxedPrecision + Decorate 12(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 13 RelaxedPrecision + Decorate 14 RelaxedPrecision + Decorate 16 RelaxedPrecision + MemberDecorate 28(Buffers) 0 Offset 0 + MemberDecorate 28(Buffers) 1 Offset 16 + MemberDecorate 28(Buffers) 2 Offset 32 + MemberDecorate 28(Buffers) 3 Offset 64 + Decorate 28(Buffers) Block + Decorate 31(data) DescriptorSet 0 + Decorate 31(data) Binding 0 + Decorate 2505 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypePointer Input 6(int) +10(gl_SubgroupInvocationID): 9(ptr) Variable Input +12(gl_SubgroupSize): 9(ptr) Variable Input + 15: 6(int) Constant 4 + 17: TypeVector 6(int) 4 + 18: TypePointer Function 17(ivec4) + 22: TypeFloat 32 + 23: TypeVector 22(float) 4 + 24: TypeInt 32 1 + 25: TypeVector 24(int) 4 + 26: TypeFloat 64 + 27: TypeVector 26(float64_t) 4 + 28(Buffers): TypeStruct 23(fvec4) 25(ivec4) 17(ivec4) 27(f64vec4) + 29: TypeArray 28(Buffers) 15 + 30: TypePointer StorageBuffer 29 + 31(data): 30(ptr) Variable StorageBuffer + 33: 24(int) Constant 2 + 34: 24(int) Constant 0 + 35: 6(int) Constant 0 + 36: TypePointer StorageBuffer 22(float) + 40: TypePointer StorageBuffer 17(ivec4) + 43: TypeVector 22(float) 2 + 44: TypePointer StorageBuffer 23(fvec4) + 51: TypeVector 22(float) 3 + 63: 24(int) Constant 1 + 64: TypePointer StorageBuffer 24(int) + 70: TypeVector 24(int) 2 + 71: TypePointer StorageBuffer 25(ivec4) + 78: TypeVector 24(int) 3 + 90: TypePointer StorageBuffer 6(int) + 96: TypeVector 6(int) 2 + 103: TypeVector 6(int) 3 + 115: 24(int) Constant 3 + 116: TypePointer StorageBuffer 26(float64_t) + 122: TypeVector 26(float64_t) 2 + 123: TypePointer StorageBuffer 27(f64vec4) + 130: TypeVector 26(float64_t) 3 + 144: TypeBool + 152: TypeVector 144(bool) 2 + 153: 96(ivec2) ConstantComposite 35 35 + 161: TypeVector 144(bool) 3 + 162: 103(ivec3) ConstantComposite 35 35 35 + 169: TypeVector 144(bool) 4 + 170: 17(ivec4) ConstantComposite 35 35 35 35 + 178: 6(int) Constant 3 + 727: 70(ivec2) ConstantComposite 34 34 + 731: 70(ivec2) ConstantComposite 63 63 + 740: 78(ivec3) ConstantComposite 34 34 34 + 744: 78(ivec3) ConstantComposite 63 63 63 + 752: 25(ivec4) ConstantComposite 34 34 34 34 + 756: 25(ivec4) ConstantComposite 63 63 63 63 + 2503: 6(int) Constant 8 + 2504: 6(int) Constant 1 + 2505: 103(ivec3) ConstantComposite 2503 2504 2504 + 4(main): 2 Function None 3 + 5: Label + 8(invocation): 7(ptr) Variable Function + 19(ballot): 18(ptr) Variable Function + 11: 6(int) Load 10(gl_SubgroupInvocationID) + 13: 6(int) Load 12(gl_SubgroupSize) + 14: 6(int) IAdd 11 13 + 16: 6(int) UMod 14 15 + Store 8(invocation) 16 + 20: 6(int) Load 8(invocation) + 21: 17(ivec4) GroupNonUniformPartitionNV 20 + Store 19(ballot) 21 + 32: 6(int) Load 8(invocation) + 37: 36(ptr) AccessChain 31(data) 34 34 35 + 38: 22(float) Load 37 + 39: 17(ivec4) GroupNonUniformPartitionNV 38 + 41: 40(ptr) AccessChain 31(data) 32 33 + Store 41 39 + 42: 6(int) Load 8(invocation) + 45: 44(ptr) AccessChain 31(data) 34 34 + 46: 23(fvec4) Load 45 + 47: 43(fvec2) VectorShuffle 46 46 0 1 + 48: 17(ivec4) GroupNonUniformPartitionNV 47 + 49: 40(ptr) AccessChain 31(data) 42 33 + Store 49 48 + 50: 6(int) Load 8(invocation) + 52: 44(ptr) AccessChain 31(data) 34 34 + 53: 23(fvec4) Load 52 + 54: 51(fvec3) VectorShuffle 53 53 0 1 2 + 55: 17(ivec4) GroupNonUniformPartitionNV 54 + 56: 40(ptr) AccessChain 31(data) 50 33 + Store 56 55 + 57: 6(int) Load 8(invocation) + 58: 44(ptr) AccessChain 31(data) 34 34 + 59: 23(fvec4) Load 58 + 60: 17(ivec4) GroupNonUniformPartitionNV 59 + 61: 40(ptr) AccessChain 31(data) 57 33 + Store 61 60 + 62: 6(int) Load 8(invocation) + 65: 64(ptr) AccessChain 31(data) 34 63 35 + 66: 24(int) Load 65 + 67: 17(ivec4) GroupNonUniformPartitionNV 66 + 68: 40(ptr) AccessChain 31(data) 62 33 + Store 68 67 + 69: 6(int) Load 8(invocation) + 72: 71(ptr) AccessChain 31(data) 34 63 + 73: 25(ivec4) Load 72 + 74: 70(ivec2) VectorShuffle 73 73 0 1 + 75: 17(ivec4) GroupNonUniformPartitionNV 74 + 76: 40(ptr) AccessChain 31(data) 69 33 + Store 76 75 + 77: 6(int) Load 8(invocation) + 79: 71(ptr) AccessChain 31(data) 34 63 + 80: 25(ivec4) Load 79 + 81: 78(ivec3) VectorShuffle 80 80 0 1 2 + 82: 17(ivec4) GroupNonUniformPartitionNV 81 + 83: 40(ptr) AccessChain 31(data) 77 33 + Store 83 82 + 84: 6(int) Load 8(invocation) + 85: 71(ptr) AccessChain 31(data) 34 63 + 86: 25(ivec4) Load 85 + 87: 17(ivec4) GroupNonUniformPartitionNV 86 + 88: 40(ptr) AccessChain 31(data) 84 33 + Store 88 87 + 89: 6(int) Load 8(invocation) + 91: 90(ptr) AccessChain 31(data) 34 33 35 + 92: 6(int) Load 91 + 93: 17(ivec4) GroupNonUniformPartitionNV 92 + 94: 40(ptr) AccessChain 31(data) 89 33 + Store 94 93 + 95: 6(int) Load 8(invocation) + 97: 40(ptr) AccessChain 31(data) 34 33 + 98: 17(ivec4) Load 97 + 99: 96(ivec2) VectorShuffle 98 98 0 1 + 100: 17(ivec4) GroupNonUniformPartitionNV 99 + 101: 40(ptr) AccessChain 31(data) 95 33 + Store 101 100 + 102: 6(int) Load 8(invocation) + 104: 40(ptr) AccessChain 31(data) 34 33 + 105: 17(ivec4) Load 104 + 106: 103(ivec3) VectorShuffle 105 105 0 1 2 + 107: 17(ivec4) GroupNonUniformPartitionNV 106 + 108: 40(ptr) AccessChain 31(data) 102 33 + Store 108 107 + 109: 6(int) Load 8(invocation) + 110: 40(ptr) AccessChain 31(data) 34 33 + 111: 17(ivec4) Load 110 + 112: 17(ivec4) GroupNonUniformPartitionNV 111 + 113: 40(ptr) AccessChain 31(data) 109 33 + Store 113 112 + 114: 6(int) Load 8(invocation) + 117: 116(ptr) AccessChain 31(data) 34 115 35 + 118:26(float64_t) Load 117 + 119: 17(ivec4) GroupNonUniformPartitionNV 118 + 120: 40(ptr) AccessChain 31(data) 114 33 + Store 120 119 + 121: 6(int) Load 8(invocation) + 124: 123(ptr) AccessChain 31(data) 34 115 + 125: 27(f64vec4) Load 124 + 126:122(f64vec2) VectorShuffle 125 125 0 1 + 127: 17(ivec4) GroupNonUniformPartitionNV 126 + 128: 40(ptr) AccessChain 31(data) 121 33 + Store 128 127 + 129: 6(int) Load 8(invocation) + 131: 123(ptr) AccessChain 31(data) 34 115 + 132: 27(f64vec4) Load 131 + 133:130(f64vec3) VectorShuffle 132 132 0 1 2 + 134: 17(ivec4) GroupNonUniformPartitionNV 133 + 135: 40(ptr) AccessChain 31(data) 129 33 + Store 135 134 + 136: 6(int) Load 8(invocation) + 137: 123(ptr) AccessChain 31(data) 34 115 + 138: 27(f64vec4) Load 137 + 139: 17(ivec4) GroupNonUniformPartitionNV 138 + 140: 40(ptr) AccessChain 31(data) 136 33 + Store 140 139 + 141: 6(int) Load 8(invocation) + 142: 64(ptr) AccessChain 31(data) 34 63 35 + 143: 24(int) Load 142 + 145: 144(bool) INotEqual 143 35 + 146: 17(ivec4) GroupNonUniformPartitionNV 145 + 147: 40(ptr) AccessChain 31(data) 141 33 + Store 147 146 + 148: 6(int) Load 8(invocation) + 149: 71(ptr) AccessChain 31(data) 34 63 + 150: 25(ivec4) Load 149 + 151: 70(ivec2) VectorShuffle 150 150 0 1 + 154: 152(bvec2) INotEqual 151 153 + 155: 17(ivec4) GroupNonUniformPartitionNV 154 + 156: 40(ptr) AccessChain 31(data) 148 33 + Store 156 155 + 157: 6(int) Load 8(invocation) + 158: 71(ptr) AccessChain 31(data) 34 63 + 159: 25(ivec4) Load 158 + 160: 78(ivec3) VectorShuffle 159 159 0 1 2 + 163: 161(bvec3) INotEqual 160 162 + 164: 17(ivec4) GroupNonUniformPartitionNV 163 + 165: 40(ptr) AccessChain 31(data) 157 33 + Store 165 164 + 166: 6(int) Load 8(invocation) + 167: 71(ptr) AccessChain 31(data) 34 63 + 168: 25(ivec4) Load 167 + 171: 169(bvec4) INotEqual 168 170 + 172: 17(ivec4) GroupNonUniformPartitionNV 171 + 173: 40(ptr) AccessChain 31(data) 166 33 + Store 173 172 + 174: 6(int) Load 8(invocation) + 175: 36(ptr) AccessChain 31(data) 34 34 35 + 176: 22(float) Load 175 + 177: 17(ivec4) Load 19(ballot) + 179: 22(float) GroupNonUniformFAdd 178 PartitionedReduceNV 176 177 + 180: 36(ptr) AccessChain 31(data) 174 34 35 + Store 180 179 + 181: 6(int) Load 8(invocation) + 182: 44(ptr) AccessChain 31(data) 63 34 + 183: 23(fvec4) Load 182 + 184: 43(fvec2) VectorShuffle 183 183 0 1 + 185: 17(ivec4) Load 19(ballot) + 186: 43(fvec2) GroupNonUniformFAdd 178 PartitionedReduceNV 184 185 + 187: 44(ptr) AccessChain 31(data) 181 34 + 188: 23(fvec4) Load 187 + 189: 23(fvec4) VectorShuffle 188 186 4 5 2 3 + Store 187 189 + 190: 6(int) Load 8(invocation) + 191: 44(ptr) AccessChain 31(data) 33 34 + 192: 23(fvec4) Load 191 + 193: 51(fvec3) VectorShuffle 192 192 0 1 2 + 194: 17(ivec4) Load 19(ballot) + 195: 51(fvec3) GroupNonUniformFAdd 178 PartitionedReduceNV 193 194 + 196: 44(ptr) AccessChain 31(data) 190 34 + 197: 23(fvec4) Load 196 + 198: 23(fvec4) VectorShuffle 197 195 4 5 6 3 + Store 196 198 + 199: 6(int) Load 8(invocation) + 200: 44(ptr) AccessChain 31(data) 115 34 + 201: 23(fvec4) Load 200 + 202: 17(ivec4) Load 19(ballot) + 203: 23(fvec4) GroupNonUniformFAdd 178 PartitionedReduceNV 201 202 + 204: 44(ptr) AccessChain 31(data) 199 34 + Store 204 203 + 205: 6(int) Load 8(invocation) + 206: 64(ptr) AccessChain 31(data) 34 63 35 + 207: 24(int) Load 206 + 208: 17(ivec4) Load 19(ballot) + 209: 24(int) GroupNonUniformIAdd 178 PartitionedReduceNV 207 208 + 210: 64(ptr) AccessChain 31(data) 205 63 35 + Store 210 209 + 211: 6(int) Load 8(invocation) + 212: 71(ptr) AccessChain 31(data) 63 63 + 213: 25(ivec4) Load 212 + 214: 70(ivec2) VectorShuffle 213 213 0 1 + 215: 17(ivec4) Load 19(ballot) + 216: 70(ivec2) GroupNonUniformIAdd 178 PartitionedReduceNV 214 215 + 217: 71(ptr) AccessChain 31(data) 211 63 + 218: 25(ivec4) Load 217 + 219: 25(ivec4) VectorShuffle 218 216 4 5 2 3 + Store 217 219 + 220: 6(int) Load 8(invocation) + 221: 71(ptr) AccessChain 31(data) 33 63 + 222: 25(ivec4) Load 221 + 223: 78(ivec3) VectorShuffle 222 222 0 1 2 + 224: 17(ivec4) Load 19(ballot) + 225: 78(ivec3) GroupNonUniformIAdd 178 PartitionedReduceNV 223 224 + 226: 71(ptr) AccessChain 31(data) 220 63 + 227: 25(ivec4) Load 226 + 228: 25(ivec4) VectorShuffle 227 225 4 5 6 3 + Store 226 228 + 229: 6(int) Load 8(invocation) + 230: 71(ptr) AccessChain 31(data) 115 63 + 231: 25(ivec4) Load 230 + 232: 17(ivec4) Load 19(ballot) + 233: 25(ivec4) GroupNonUniformIAdd 178 PartitionedReduceNV 231 232 + 234: 71(ptr) AccessChain 31(data) 229 63 + Store 234 233 + 235: 6(int) Load 8(invocation) + 236: 90(ptr) AccessChain 31(data) 34 33 35 + 237: 6(int) Load 236 + 238: 17(ivec4) Load 19(ballot) + 239: 6(int) GroupNonUniformIAdd 178 PartitionedReduceNV 237 238 + 240: 90(ptr) AccessChain 31(data) 235 33 35 + Store 240 239 + 241: 6(int) Load 8(invocation) + 242: 40(ptr) AccessChain 31(data) 63 33 + 243: 17(ivec4) Load 242 + 244: 96(ivec2) VectorShuffle 243 243 0 1 + 245: 17(ivec4) Load 19(ballot) + 246: 96(ivec2) GroupNonUniformIAdd 178 PartitionedReduceNV 244 245 + 247: 40(ptr) AccessChain 31(data) 241 33 + 248: 17(ivec4) Load 247 + 249: 17(ivec4) VectorShuffle 248 246 4 5 2 3 + Store 247 249 + 250: 6(int) Load 8(invocation) + 251: 40(ptr) AccessChain 31(data) 33 33 + 252: 17(ivec4) Load 251 + 253: 103(ivec3) VectorShuffle 252 252 0 1 2 + 254: 17(ivec4) Load 19(ballot) + 255: 103(ivec3) GroupNonUniformIAdd 178 PartitionedReduceNV 253 254 + 256: 40(ptr) AccessChain 31(data) 250 33 + 257: 17(ivec4) Load 256 + 258: 17(ivec4) VectorShuffle 257 255 4 5 6 3 + Store 256 258 + 259: 6(int) Load 8(invocation) + 260: 40(ptr) AccessChain 31(data) 115 33 + 261: 17(ivec4) Load 260 + 262: 17(ivec4) Load 19(ballot) + 263: 17(ivec4) GroupNonUniformIAdd 178 PartitionedReduceNV 261 262 + 264: 40(ptr) AccessChain 31(data) 259 33 + Store 264 263 + 265: 6(int) Load 8(invocation) + 266: 116(ptr) AccessChain 31(data) 34 115 35 + 267:26(float64_t) Load 266 + 268: 17(ivec4) Load 19(ballot) + 269:26(float64_t) GroupNonUniformFAdd 178 PartitionedReduceNV 267 268 + 270: 116(ptr) AccessChain 31(data) 265 115 35 + Store 270 269 + 271: 6(int) Load 8(invocation) + 272: 123(ptr) AccessChain 31(data) 63 115 + 273: 27(f64vec4) Load 272 + 274:122(f64vec2) VectorShuffle 273 273 0 1 + 275: 17(ivec4) Load 19(ballot) + 276:122(f64vec2) GroupNonUniformFAdd 178 PartitionedReduceNV 274 275 + 277: 123(ptr) AccessChain 31(data) 271 115 + 278: 27(f64vec4) Load 277 + 279: 27(f64vec4) VectorShuffle 278 276 4 5 2 3 + Store 277 279 + 280: 6(int) Load 8(invocation) + 281: 123(ptr) AccessChain 31(data) 33 115 + 282: 27(f64vec4) Load 281 + 283:130(f64vec3) VectorShuffle 282 282 0 1 2 + 284: 17(ivec4) Load 19(ballot) + 285:130(f64vec3) GroupNonUniformFAdd 178 PartitionedReduceNV 283 284 + 286: 123(ptr) AccessChain 31(data) 280 115 + 287: 27(f64vec4) Load 286 + 288: 27(f64vec4) VectorShuffle 287 285 4 5 6 3 + Store 286 288 + 289: 6(int) Load 8(invocation) + 290: 123(ptr) AccessChain 31(data) 115 115 + 291: 27(f64vec4) Load 290 + 292: 17(ivec4) Load 19(ballot) + 293: 27(f64vec4) GroupNonUniformFAdd 178 PartitionedReduceNV 291 292 + 294: 123(ptr) AccessChain 31(data) 289 115 + Store 294 293 + 295: 6(int) Load 8(invocation) + 296: 36(ptr) AccessChain 31(data) 34 34 35 + 297: 22(float) Load 296 + 298: 17(ivec4) Load 19(ballot) + 299: 22(float) GroupNonUniformFMul 178 PartitionedReduceNV 297 298 + 300: 36(ptr) AccessChain 31(data) 295 34 35 + Store 300 299 + 301: 6(int) Load 8(invocation) + 302: 44(ptr) AccessChain 31(data) 63 34 + 303: 23(fvec4) Load 302 + 304: 43(fvec2) VectorShuffle 303 303 0 1 + 305: 17(ivec4) Load 19(ballot) + 306: 43(fvec2) GroupNonUniformFMul 178 PartitionedReduceNV 304 305 + 307: 44(ptr) AccessChain 31(data) 301 34 + 308: 23(fvec4) Load 307 + 309: 23(fvec4) VectorShuffle 308 306 4 5 2 3 + Store 307 309 + 310: 6(int) Load 8(invocation) + 311: 44(ptr) AccessChain 31(data) 33 34 + 312: 23(fvec4) Load 311 + 313: 51(fvec3) VectorShuffle 312 312 0 1 2 + 314: 17(ivec4) Load 19(ballot) + 315: 51(fvec3) GroupNonUniformFMul 178 PartitionedReduceNV 313 314 + 316: 44(ptr) AccessChain 31(data) 310 34 + 317: 23(fvec4) Load 316 + 318: 23(fvec4) VectorShuffle 317 315 4 5 6 3 + Store 316 318 + 319: 6(int) Load 8(invocation) + 320: 44(ptr) AccessChain 31(data) 115 34 + 321: 23(fvec4) Load 320 + 322: 17(ivec4) Load 19(ballot) + 323: 23(fvec4) GroupNonUniformFMul 178 PartitionedReduceNV 321 322 + 324: 44(ptr) AccessChain 31(data) 319 34 + Store 324 323 + 325: 6(int) Load 8(invocation) + 326: 64(ptr) AccessChain 31(data) 34 63 35 + 327: 24(int) Load 326 + 328: 17(ivec4) Load 19(ballot) + 329: 24(int) GroupNonUniformIMul 178 PartitionedReduceNV 327 328 + 330: 64(ptr) AccessChain 31(data) 325 63 35 + Store 330 329 + 331: 6(int) Load 8(invocation) + 332: 71(ptr) AccessChain 31(data) 63 63 + 333: 25(ivec4) Load 332 + 334: 70(ivec2) VectorShuffle 333 333 0 1 + 335: 17(ivec4) Load 19(ballot) + 336: 70(ivec2) GroupNonUniformIMul 178 PartitionedReduceNV 334 335 + 337: 71(ptr) AccessChain 31(data) 331 63 + 338: 25(ivec4) Load 337 + 339: 25(ivec4) VectorShuffle 338 336 4 5 2 3 + Store 337 339 + 340: 6(int) Load 8(invocation) + 341: 71(ptr) AccessChain 31(data) 33 63 + 342: 25(ivec4) Load 341 + 343: 78(ivec3) VectorShuffle 342 342 0 1 2 + 344: 17(ivec4) Load 19(ballot) + 345: 78(ivec3) GroupNonUniformIMul 178 PartitionedReduceNV 343 344 + 346: 71(ptr) AccessChain 31(data) 340 63 + 347: 25(ivec4) Load 346 + 348: 25(ivec4) VectorShuffle 347 345 4 5 6 3 + Store 346 348 + 349: 6(int) Load 8(invocation) + 350: 71(ptr) AccessChain 31(data) 115 63 + 351: 25(ivec4) Load 350 + 352: 17(ivec4) Load 19(ballot) + 353: 25(ivec4) GroupNonUniformIMul 178 PartitionedReduceNV 351 352 + 354: 71(ptr) AccessChain 31(data) 349 63 + Store 354 353 + 355: 6(int) Load 8(invocation) + 356: 90(ptr) AccessChain 31(data) 34 33 35 + 357: 6(int) Load 356 + 358: 17(ivec4) Load 19(ballot) + 359: 6(int) GroupNonUniformIMul 178 PartitionedReduceNV 357 358 + 360: 90(ptr) AccessChain 31(data) 355 33 35 + Store 360 359 + 361: 6(int) Load 8(invocation) + 362: 40(ptr) AccessChain 31(data) 63 33 + 363: 17(ivec4) Load 362 + 364: 96(ivec2) VectorShuffle 363 363 0 1 + 365: 17(ivec4) Load 19(ballot) + 366: 96(ivec2) GroupNonUniformIMul 178 PartitionedReduceNV 364 365 + 367: 40(ptr) AccessChain 31(data) 361 33 + 368: 17(ivec4) Load 367 + 369: 17(ivec4) VectorShuffle 368 366 4 5 2 3 + Store 367 369 + 370: 6(int) Load 8(invocation) + 371: 40(ptr) AccessChain 31(data) 33 33 + 372: 17(ivec4) Load 371 + 373: 103(ivec3) VectorShuffle 372 372 0 1 2 + 374: 17(ivec4) Load 19(ballot) + 375: 103(ivec3) GroupNonUniformIMul 178 PartitionedReduceNV 373 374 + 376: 40(ptr) AccessChain 31(data) 370 33 + 377: 17(ivec4) Load 376 + 378: 17(ivec4) VectorShuffle 377 375 4 5 6 3 + Store 376 378 + 379: 6(int) Load 8(invocation) + 380: 40(ptr) AccessChain 31(data) 115 33 + 381: 17(ivec4) Load 380 + 382: 17(ivec4) Load 19(ballot) + 383: 17(ivec4) GroupNonUniformIMul 178 PartitionedReduceNV 381 382 + 384: 40(ptr) AccessChain 31(data) 379 33 + Store 384 383 + 385: 6(int) Load 8(invocation) + 386: 116(ptr) AccessChain 31(data) 34 115 35 + 387:26(float64_t) Load 386 + 388: 17(ivec4) Load 19(ballot) + 389:26(float64_t) GroupNonUniformFMul 178 PartitionedReduceNV 387 388 + 390: 116(ptr) AccessChain 31(data) 385 115 35 + Store 390 389 + 391: 6(int) Load 8(invocation) + 392: 123(ptr) AccessChain 31(data) 63 115 + 393: 27(f64vec4) Load 392 + 394:122(f64vec2) VectorShuffle 393 393 0 1 + 395: 17(ivec4) Load 19(ballot) + 396:122(f64vec2) GroupNonUniformFMul 178 PartitionedReduceNV 394 395 + 397: 123(ptr) AccessChain 31(data) 391 115 + 398: 27(f64vec4) Load 397 + 399: 27(f64vec4) VectorShuffle 398 396 4 5 2 3 + Store 397 399 + 400: 6(int) Load 8(invocation) + 401: 123(ptr) AccessChain 31(data) 33 115 + 402: 27(f64vec4) Load 401 + 403:130(f64vec3) VectorShuffle 402 402 0 1 2 + 404: 17(ivec4) Load 19(ballot) + 405:130(f64vec3) GroupNonUniformFMul 178 PartitionedReduceNV 403 404 + 406: 123(ptr) AccessChain 31(data) 400 115 + 407: 27(f64vec4) Load 406 + 408: 27(f64vec4) VectorShuffle 407 405 4 5 6 3 + Store 406 408 + 409: 6(int) Load 8(invocation) + 410: 123(ptr) AccessChain 31(data) 115 115 + 411: 27(f64vec4) Load 410 + 412: 17(ivec4) Load 19(ballot) + 413: 27(f64vec4) GroupNonUniformFMul 178 PartitionedReduceNV 411 412 + 414: 123(ptr) AccessChain 31(data) 409 115 + Store 414 413 + 415: 6(int) Load 8(invocation) + 416: 36(ptr) AccessChain 31(data) 34 34 35 + 417: 22(float) Load 416 + 418: 17(ivec4) Load 19(ballot) + 419: 22(float) GroupNonUniformFMin 178 PartitionedReduceNV 417 418 + 420: 36(ptr) AccessChain 31(data) 415 34 35 + Store 420 419 + 421: 6(int) Load 8(invocation) + 422: 44(ptr) AccessChain 31(data) 63 34 + 423: 23(fvec4) Load 422 + 424: 43(fvec2) VectorShuffle 423 423 0 1 + 425: 17(ivec4) Load 19(ballot) + 426: 43(fvec2) GroupNonUniformFMin 178 PartitionedReduceNV 424 425 + 427: 44(ptr) AccessChain 31(data) 421 34 + 428: 23(fvec4) Load 427 + 429: 23(fvec4) VectorShuffle 428 426 4 5 2 3 + Store 427 429 + 430: 6(int) Load 8(invocation) + 431: 44(ptr) AccessChain 31(data) 33 34 + 432: 23(fvec4) Load 431 + 433: 51(fvec3) VectorShuffle 432 432 0 1 2 + 434: 17(ivec4) Load 19(ballot) + 435: 51(fvec3) GroupNonUniformFMin 178 PartitionedReduceNV 433 434 + 436: 44(ptr) AccessChain 31(data) 430 34 + 437: 23(fvec4) Load 436 + 438: 23(fvec4) VectorShuffle 437 435 4 5 6 3 + Store 436 438 + 439: 6(int) Load 8(invocation) + 440: 44(ptr) AccessChain 31(data) 115 34 + 441: 23(fvec4) Load 440 + 442: 17(ivec4) Load 19(ballot) + 443: 23(fvec4) GroupNonUniformFMin 178 PartitionedReduceNV 441 442 + 444: 44(ptr) AccessChain 31(data) 439 34 + Store 444 443 + 445: 6(int) Load 8(invocation) + 446: 64(ptr) AccessChain 31(data) 34 63 35 + 447: 24(int) Load 446 + 448: 17(ivec4) Load 19(ballot) + 449: 24(int) GroupNonUniformSMin 178 PartitionedReduceNV 447 448 + 450: 64(ptr) AccessChain 31(data) 445 63 35 + Store 450 449 + 451: 6(int) Load 8(invocation) + 452: 71(ptr) AccessChain 31(data) 63 63 + 453: 25(ivec4) Load 452 + 454: 70(ivec2) VectorShuffle 453 453 0 1 + 455: 17(ivec4) Load 19(ballot) + 456: 70(ivec2) GroupNonUniformSMin 178 PartitionedReduceNV 454 455 + 457: 71(ptr) AccessChain 31(data) 451 63 + 458: 25(ivec4) Load 457 + 459: 25(ivec4) VectorShuffle 458 456 4 5 2 3 + Store 457 459 + 460: 6(int) Load 8(invocation) + 461: 71(ptr) AccessChain 31(data) 33 63 + 462: 25(ivec4) Load 461 + 463: 78(ivec3) VectorShuffle 462 462 0 1 2 + 464: 17(ivec4) Load 19(ballot) + 465: 78(ivec3) GroupNonUniformSMin 178 PartitionedReduceNV 463 464 + 466: 71(ptr) AccessChain 31(data) 460 63 + 467: 25(ivec4) Load 466 + 468: 25(ivec4) VectorShuffle 467 465 4 5 6 3 + Store 466 468 + 469: 6(int) Load 8(invocation) + 470: 71(ptr) AccessChain 31(data) 115 63 + 471: 25(ivec4) Load 470 + 472: 17(ivec4) Load 19(ballot) + 473: 25(ivec4) GroupNonUniformSMin 178 PartitionedReduceNV 471 472 + 474: 71(ptr) AccessChain 31(data) 469 63 + Store 474 473 + 475: 6(int) Load 8(invocation) + 476: 90(ptr) AccessChain 31(data) 34 33 35 + 477: 6(int) Load 476 + 478: 17(ivec4) Load 19(ballot) + 479: 6(int) GroupNonUniformUMin 178 PartitionedReduceNV 477 478 + 480: 90(ptr) AccessChain 31(data) 475 33 35 + Store 480 479 + 481: 6(int) Load 8(invocation) + 482: 40(ptr) AccessChain 31(data) 63 33 + 483: 17(ivec4) Load 482 + 484: 96(ivec2) VectorShuffle 483 483 0 1 + 485: 17(ivec4) Load 19(ballot) + 486: 96(ivec2) GroupNonUniformUMin 178 PartitionedReduceNV 484 485 + 487: 40(ptr) AccessChain 31(data) 481 33 + 488: 17(ivec4) Load 487 + 489: 17(ivec4) VectorShuffle 488 486 4 5 2 3 + Store 487 489 + 490: 6(int) Load 8(invocation) + 491: 40(ptr) AccessChain 31(data) 33 33 + 492: 17(ivec4) Load 491 + 493: 103(ivec3) VectorShuffle 492 492 0 1 2 + 494: 17(ivec4) Load 19(ballot) + 495: 103(ivec3) GroupNonUniformUMin 178 PartitionedReduceNV 493 494 + 496: 40(ptr) AccessChain 31(data) 490 33 + 497: 17(ivec4) Load 496 + 498: 17(ivec4) VectorShuffle 497 495 4 5 6 3 + Store 496 498 + 499: 6(int) Load 8(invocation) + 500: 40(ptr) AccessChain 31(data) 115 33 + 501: 17(ivec4) Load 500 + 502: 17(ivec4) Load 19(ballot) + 503: 17(ivec4) GroupNonUniformUMin 178 PartitionedReduceNV 501 502 + 504: 40(ptr) AccessChain 31(data) 499 33 + Store 504 503 + 505: 6(int) Load 8(invocation) + 506: 116(ptr) AccessChain 31(data) 34 115 35 + 507:26(float64_t) Load 506 + 508: 17(ivec4) Load 19(ballot) + 509:26(float64_t) GroupNonUniformFMin 178 PartitionedReduceNV 507 508 + 510: 116(ptr) AccessChain 31(data) 505 115 35 + Store 510 509 + 511: 6(int) Load 8(invocation) + 512: 123(ptr) AccessChain 31(data) 63 115 + 513: 27(f64vec4) Load 512 + 514:122(f64vec2) VectorShuffle 513 513 0 1 + 515: 17(ivec4) Load 19(ballot) + 516:122(f64vec2) GroupNonUniformFMin 178 PartitionedReduceNV 514 515 + 517: 123(ptr) AccessChain 31(data) 511 115 + 518: 27(f64vec4) Load 517 + 519: 27(f64vec4) VectorShuffle 518 516 4 5 2 3 + Store 517 519 + 520: 6(int) Load 8(invocation) + 521: 123(ptr) AccessChain 31(data) 33 115 + 522: 27(f64vec4) Load 521 + 523:130(f64vec3) VectorShuffle 522 522 0 1 2 + 524: 17(ivec4) Load 19(ballot) + 525:130(f64vec3) GroupNonUniformFMin 178 PartitionedReduceNV 523 524 + 526: 123(ptr) AccessChain 31(data) 520 115 + 527: 27(f64vec4) Load 526 + 528: 27(f64vec4) VectorShuffle 527 525 4 5 6 3 + Store 526 528 + 529: 6(int) Load 8(invocation) + 530: 123(ptr) AccessChain 31(data) 115 115 + 531: 27(f64vec4) Load 530 + 532: 17(ivec4) Load 19(ballot) + 533: 27(f64vec4) GroupNonUniformFMin 178 PartitionedReduceNV 531 532 + 534: 123(ptr) AccessChain 31(data) 529 115 + Store 534 533 + 535: 6(int) Load 8(invocation) + 536: 36(ptr) AccessChain 31(data) 34 34 35 + 537: 22(float) Load 536 + 538: 17(ivec4) Load 19(ballot) + 539: 22(float) GroupNonUniformFMax 178 PartitionedReduceNV 537 538 + 540: 36(ptr) AccessChain 31(data) 535 34 35 + Store 540 539 + 541: 6(int) Load 8(invocation) + 542: 44(ptr) AccessChain 31(data) 63 34 + 543: 23(fvec4) Load 542 + 544: 43(fvec2) VectorShuffle 543 543 0 1 + 545: 17(ivec4) Load 19(ballot) + 546: 43(fvec2) GroupNonUniformFMax 178 PartitionedReduceNV 544 545 + 547: 44(ptr) AccessChain 31(data) 541 34 + 548: 23(fvec4) Load 547 + 549: 23(fvec4) VectorShuffle 548 546 4 5 2 3 + Store 547 549 + 550: 6(int) Load 8(invocation) + 551: 44(ptr) AccessChain 31(data) 33 34 + 552: 23(fvec4) Load 551 + 553: 51(fvec3) VectorShuffle 552 552 0 1 2 + 554: 17(ivec4) Load 19(ballot) + 555: 51(fvec3) GroupNonUniformFMax 178 PartitionedReduceNV 553 554 + 556: 44(ptr) AccessChain 31(data) 550 34 + 557: 23(fvec4) Load 556 + 558: 23(fvec4) VectorShuffle 557 555 4 5 6 3 + Store 556 558 + 559: 6(int) Load 8(invocation) + 560: 44(ptr) AccessChain 31(data) 115 34 + 561: 23(fvec4) Load 560 + 562: 17(ivec4) Load 19(ballot) + 563: 23(fvec4) GroupNonUniformFMax 178 PartitionedReduceNV 561 562 + 564: 44(ptr) AccessChain 31(data) 559 34 + Store 564 563 + 565: 6(int) Load 8(invocation) + 566: 64(ptr) AccessChain 31(data) 34 63 35 + 567: 24(int) Load 566 + 568: 17(ivec4) Load 19(ballot) + 569: 24(int) GroupNonUniformSMax 178 PartitionedReduceNV 567 568 + 570: 64(ptr) AccessChain 31(data) 565 63 35 + Store 570 569 + 571: 6(int) Load 8(invocation) + 572: 71(ptr) AccessChain 31(data) 63 63 + 573: 25(ivec4) Load 572 + 574: 70(ivec2) VectorShuffle 573 573 0 1 + 575: 17(ivec4) Load 19(ballot) + 576: 70(ivec2) GroupNonUniformSMax 178 PartitionedReduceNV 574 575 + 577: 71(ptr) AccessChain 31(data) 571 63 + 578: 25(ivec4) Load 577 + 579: 25(ivec4) VectorShuffle 578 576 4 5 2 3 + Store 577 579 + 580: 6(int) Load 8(invocation) + 581: 71(ptr) AccessChain 31(data) 33 63 + 582: 25(ivec4) Load 581 + 583: 78(ivec3) VectorShuffle 582 582 0 1 2 + 584: 17(ivec4) Load 19(ballot) + 585: 78(ivec3) GroupNonUniformSMax 178 PartitionedReduceNV 583 584 + 586: 71(ptr) AccessChain 31(data) 580 63 + 587: 25(ivec4) Load 586 + 588: 25(ivec4) VectorShuffle 587 585 4 5 6 3 + Store 586 588 + 589: 6(int) Load 8(invocation) + 590: 71(ptr) AccessChain 31(data) 115 63 + 591: 25(ivec4) Load 590 + 592: 17(ivec4) Load 19(ballot) + 593: 25(ivec4) GroupNonUniformSMax 178 PartitionedReduceNV 591 592 + 594: 71(ptr) AccessChain 31(data) 589 63 + Store 594 593 + 595: 6(int) Load 8(invocation) + 596: 90(ptr) AccessChain 31(data) 34 33 35 + 597: 6(int) Load 596 + 598: 17(ivec4) Load 19(ballot) + 599: 6(int) GroupNonUniformUMax 178 PartitionedReduceNV 597 598 + 600: 90(ptr) AccessChain 31(data) 595 33 35 + Store 600 599 + 601: 6(int) Load 8(invocation) + 602: 40(ptr) AccessChain 31(data) 63 33 + 603: 17(ivec4) Load 602 + 604: 96(ivec2) VectorShuffle 603 603 0 1 + 605: 17(ivec4) Load 19(ballot) + 606: 96(ivec2) GroupNonUniformUMax 178 PartitionedReduceNV 604 605 + 607: 40(ptr) AccessChain 31(data) 601 33 + 608: 17(ivec4) Load 607 + 609: 17(ivec4) VectorShuffle 608 606 4 5 2 3 + Store 607 609 + 610: 6(int) Load 8(invocation) + 611: 40(ptr) AccessChain 31(data) 33 33 + 612: 17(ivec4) Load 611 + 613: 103(ivec3) VectorShuffle 612 612 0 1 2 + 614: 17(ivec4) Load 19(ballot) + 615: 103(ivec3) GroupNonUniformUMax 178 PartitionedReduceNV 613 614 + 616: 40(ptr) AccessChain 31(data) 610 33 + 617: 17(ivec4) Load 616 + 618: 17(ivec4) VectorShuffle 617 615 4 5 6 3 + Store 616 618 + 619: 6(int) Load 8(invocation) + 620: 40(ptr) AccessChain 31(data) 115 33 + 621: 17(ivec4) Load 620 + 622: 17(ivec4) Load 19(ballot) + 623: 17(ivec4) GroupNonUniformUMax 178 PartitionedReduceNV 621 622 + 624: 40(ptr) AccessChain 31(data) 619 33 + Store 624 623 + 625: 6(int) Load 8(invocation) + 626: 116(ptr) AccessChain 31(data) 34 115 35 + 627:26(float64_t) Load 626 + 628: 17(ivec4) Load 19(ballot) + 629:26(float64_t) GroupNonUniformFMax 178 PartitionedReduceNV 627 628 + 630: 116(ptr) AccessChain 31(data) 625 115 35 + Store 630 629 + 631: 6(int) Load 8(invocation) + 632: 123(ptr) AccessChain 31(data) 63 115 + 633: 27(f64vec4) Load 632 + 634:122(f64vec2) VectorShuffle 633 633 0 1 + 635: 17(ivec4) Load 19(ballot) + 636:122(f64vec2) GroupNonUniformFMax 178 PartitionedReduceNV 634 635 + 637: 123(ptr) AccessChain 31(data) 631 115 + 638: 27(f64vec4) Load 637 + 639: 27(f64vec4) VectorShuffle 638 636 4 5 2 3 + Store 637 639 + 640: 6(int) Load 8(invocation) + 641: 123(ptr) AccessChain 31(data) 33 115 + 642: 27(f64vec4) Load 641 + 643:130(f64vec3) VectorShuffle 642 642 0 1 2 + 644: 17(ivec4) Load 19(ballot) + 645:130(f64vec3) GroupNonUniformFMax 178 PartitionedReduceNV 643 644 + 646: 123(ptr) AccessChain 31(data) 640 115 + 647: 27(f64vec4) Load 646 + 648: 27(f64vec4) VectorShuffle 647 645 4 5 6 3 + Store 646 648 + 649: 6(int) Load 8(invocation) + 650: 123(ptr) AccessChain 31(data) 115 115 + 651: 27(f64vec4) Load 650 + 652: 17(ivec4) Load 19(ballot) + 653: 27(f64vec4) GroupNonUniformFMax 178 PartitionedReduceNV 651 652 + 654: 123(ptr) AccessChain 31(data) 649 115 + Store 654 653 + 655: 6(int) Load 8(invocation) + 656: 64(ptr) AccessChain 31(data) 34 63 35 + 657: 24(int) Load 656 + 658: 17(ivec4) Load 19(ballot) + 659: 24(int) GroupNonUniformBitwiseAnd 178 PartitionedReduceNV 657 658 + 660: 64(ptr) AccessChain 31(data) 655 63 35 + Store 660 659 + 661: 6(int) Load 8(invocation) + 662: 71(ptr) AccessChain 31(data) 63 63 + 663: 25(ivec4) Load 662 + 664: 70(ivec2) VectorShuffle 663 663 0 1 + 665: 17(ivec4) Load 19(ballot) + 666: 70(ivec2) GroupNonUniformBitwiseAnd 178 PartitionedReduceNV 664 665 + 667: 71(ptr) AccessChain 31(data) 661 63 + 668: 25(ivec4) Load 667 + 669: 25(ivec4) VectorShuffle 668 666 4 5 2 3 + Store 667 669 + 670: 6(int) Load 8(invocation) + 671: 71(ptr) AccessChain 31(data) 33 63 + 672: 25(ivec4) Load 671 + 673: 78(ivec3) VectorShuffle 672 672 0 1 2 + 674: 17(ivec4) Load 19(ballot) + 675: 78(ivec3) GroupNonUniformBitwiseAnd 178 PartitionedReduceNV 673 674 + 676: 71(ptr) AccessChain 31(data) 670 63 + 677: 25(ivec4) Load 676 + 678: 25(ivec4) VectorShuffle 677 675 4 5 6 3 + Store 676 678 + 679: 6(int) Load 8(invocation) + 680: 71(ptr) AccessChain 31(data) 115 63 + 681: 25(ivec4) Load 680 + 682: 17(ivec4) Load 19(ballot) + 683: 25(ivec4) GroupNonUniformBitwiseAnd 178 PartitionedReduceNV 681 682 + 684: 71(ptr) AccessChain 31(data) 679 63 + Store 684 683 + 685: 6(int) Load 8(invocation) + 686: 90(ptr) AccessChain 31(data) 34 33 35 + 687: 6(int) Load 686 + 688: 17(ivec4) Load 19(ballot) + 689: 6(int) GroupNonUniformBitwiseAnd 178 PartitionedReduceNV 687 688 + 690: 90(ptr) AccessChain 31(data) 685 33 35 + Store 690 689 + 691: 6(int) Load 8(invocation) + 692: 40(ptr) AccessChain 31(data) 63 33 + 693: 17(ivec4) Load 692 + 694: 96(ivec2) VectorShuffle 693 693 0 1 + 695: 17(ivec4) Load 19(ballot) + 696: 96(ivec2) GroupNonUniformBitwiseAnd 178 PartitionedReduceNV 694 695 + 697: 40(ptr) AccessChain 31(data) 691 33 + 698: 17(ivec4) Load 697 + 699: 17(ivec4) VectorShuffle 698 696 4 5 2 3 + Store 697 699 + 700: 6(int) Load 8(invocation) + 701: 40(ptr) AccessChain 31(data) 33 33 + 702: 17(ivec4) Load 701 + 703: 103(ivec3) VectorShuffle 702 702 0 1 2 + 704: 17(ivec4) Load 19(ballot) + 705: 103(ivec3) GroupNonUniformBitwiseAnd 178 PartitionedReduceNV 703 704 + 706: 40(ptr) AccessChain 31(data) 700 33 + 707: 17(ivec4) Load 706 + 708: 17(ivec4) VectorShuffle 707 705 4 5 6 3 + Store 706 708 + 709: 6(int) Load 8(invocation) + 710: 40(ptr) AccessChain 31(data) 115 33 + 711: 17(ivec4) Load 710 + 712: 17(ivec4) Load 19(ballot) + 713: 17(ivec4) GroupNonUniformBitwiseAnd 178 PartitionedReduceNV 711 712 + 714: 40(ptr) AccessChain 31(data) 709 33 + Store 714 713 + 715: 6(int) Load 8(invocation) + 716: 64(ptr) AccessChain 31(data) 34 63 35 + 717: 24(int) Load 716 + 718: 144(bool) SLessThan 717 34 + 719: 17(ivec4) Load 19(ballot) + 720: 144(bool) GroupNonUniformLogicalAnd 178 PartitionedReduceNV 718 719 + 721: 24(int) Select 720 63 34 + 722: 64(ptr) AccessChain 31(data) 715 63 35 + Store 722 721 + 723: 6(int) Load 8(invocation) + 724: 71(ptr) AccessChain 31(data) 63 63 + 725: 25(ivec4) Load 724 + 726: 70(ivec2) VectorShuffle 725 725 0 1 + 728: 152(bvec2) SLessThan 726 727 + 729: 17(ivec4) Load 19(ballot) + 730: 152(bvec2) GroupNonUniformLogicalAnd 178 PartitionedReduceNV 728 729 + 732: 70(ivec2) Select 730 731 727 + 733: 71(ptr) AccessChain 31(data) 723 63 + 734: 25(ivec4) Load 733 + 735: 25(ivec4) VectorShuffle 734 732 4 5 2 3 + Store 733 735 + 736: 6(int) Load 8(invocation) + 737: 71(ptr) AccessChain 31(data) 63 63 + 738: 25(ivec4) Load 737 + 739: 78(ivec3) VectorShuffle 738 738 0 1 2 + 741: 161(bvec3) SLessThan 739 740 + 742: 17(ivec4) Load 19(ballot) + 743: 161(bvec3) GroupNonUniformLogicalAnd 178 PartitionedReduceNV 741 742 + 745: 78(ivec3) Select 743 744 740 + 746: 71(ptr) AccessChain 31(data) 736 63 + 747: 25(ivec4) Load 746 + 748: 25(ivec4) VectorShuffle 747 745 4 5 6 3 + Store 746 748 + 749: 6(int) Load 8(invocation) + 750: 71(ptr) AccessChain 31(data) 63 63 + 751: 25(ivec4) Load 750 + 753: 169(bvec4) SLessThan 751 752 + 754: 17(ivec4) Load 19(ballot) + 755: 169(bvec4) GroupNonUniformLogicalAnd 178 PartitionedReduceNV 753 754 + 757: 25(ivec4) Select 755 756 752 + 758: 71(ptr) AccessChain 31(data) 749 63 + Store 758 757 + 759: 6(int) Load 8(invocation) + 760: 64(ptr) AccessChain 31(data) 34 63 35 + 761: 24(int) Load 760 + 762: 17(ivec4) Load 19(ballot) + 763: 24(int) GroupNonUniformBitwiseOr 178 PartitionedReduceNV 761 762 + 764: 64(ptr) AccessChain 31(data) 759 63 35 + Store 764 763 + 765: 6(int) Load 8(invocation) + 766: 71(ptr) AccessChain 31(data) 63 63 + 767: 25(ivec4) Load 766 + 768: 70(ivec2) VectorShuffle 767 767 0 1 + 769: 17(ivec4) Load 19(ballot) + 770: 70(ivec2) GroupNonUniformBitwiseOr 178 PartitionedReduceNV 768 769 + 771: 71(ptr) AccessChain 31(data) 765 63 + 772: 25(ivec4) Load 771 + 773: 25(ivec4) VectorShuffle 772 770 4 5 2 3 + Store 771 773 + 774: 6(int) Load 8(invocation) + 775: 71(ptr) AccessChain 31(data) 33 63 + 776: 25(ivec4) Load 775 + 777: 78(ivec3) VectorShuffle 776 776 0 1 2 + 778: 17(ivec4) Load 19(ballot) + 779: 78(ivec3) GroupNonUniformBitwiseOr 178 PartitionedReduceNV 777 778 + 780: 71(ptr) AccessChain 31(data) 774 63 + 781: 25(ivec4) Load 780 + 782: 25(ivec4) VectorShuffle 781 779 4 5 6 3 + Store 780 782 + 783: 6(int) Load 8(invocation) + 784: 71(ptr) AccessChain 31(data) 115 63 + 785: 25(ivec4) Load 784 + 786: 17(ivec4) Load 19(ballot) + 787: 25(ivec4) GroupNonUniformBitwiseOr 178 PartitionedReduceNV 785 786 + 788: 71(ptr) AccessChain 31(data) 783 63 + Store 788 787 + 789: 6(int) Load 8(invocation) + 790: 90(ptr) AccessChain 31(data) 34 33 35 + 791: 6(int) Load 790 + 792: 17(ivec4) Load 19(ballot) + 793: 6(int) GroupNonUniformBitwiseOr 178 PartitionedReduceNV 791 792 + 794: 90(ptr) AccessChain 31(data) 789 33 35 + Store 794 793 + 795: 6(int) Load 8(invocation) + 796: 40(ptr) AccessChain 31(data) 63 33 + 797: 17(ivec4) Load 796 + 798: 96(ivec2) VectorShuffle 797 797 0 1 + 799: 17(ivec4) Load 19(ballot) + 800: 96(ivec2) GroupNonUniformBitwiseOr 178 PartitionedReduceNV 798 799 + 801: 40(ptr) AccessChain 31(data) 795 33 + 802: 17(ivec4) Load 801 + 803: 17(ivec4) VectorShuffle 802 800 4 5 2 3 + Store 801 803 + 804: 6(int) Load 8(invocation) + 805: 40(ptr) AccessChain 31(data) 33 33 + 806: 17(ivec4) Load 805 + 807: 103(ivec3) VectorShuffle 806 806 0 1 2 + 808: 17(ivec4) Load 19(ballot) + 809: 103(ivec3) GroupNonUniformBitwiseOr 178 PartitionedReduceNV 807 808 + 810: 40(ptr) AccessChain 31(data) 804 33 + 811: 17(ivec4) Load 810 + 812: 17(ivec4) VectorShuffle 811 809 4 5 6 3 + Store 810 812 + 813: 6(int) Load 8(invocation) + 814: 40(ptr) AccessChain 31(data) 115 33 + 815: 17(ivec4) Load 814 + 816: 17(ivec4) Load 19(ballot) + 817: 17(ivec4) GroupNonUniformBitwiseOr 178 PartitionedReduceNV 815 816 + 818: 40(ptr) AccessChain 31(data) 813 33 + Store 818 817 + 819: 6(int) Load 8(invocation) + 820: 64(ptr) AccessChain 31(data) 34 63 35 + 821: 24(int) Load 820 + 822: 144(bool) SLessThan 821 34 + 823: 17(ivec4) Load 19(ballot) + 824: 144(bool) GroupNonUniformLogicalOr 178 PartitionedReduceNV 822 823 + 825: 24(int) Select 824 63 34 + 826: 64(ptr) AccessChain 31(data) 819 63 35 + Store 826 825 + 827: 6(int) Load 8(invocation) + 828: 71(ptr) AccessChain 31(data) 63 63 + 829: 25(ivec4) Load 828 + 830: 70(ivec2) VectorShuffle 829 829 0 1 + 831: 152(bvec2) SLessThan 830 727 + 832: 17(ivec4) Load 19(ballot) + 833: 152(bvec2) GroupNonUniformLogicalOr 178 PartitionedReduceNV 831 832 + 834: 70(ivec2) Select 833 731 727 + 835: 71(ptr) AccessChain 31(data) 827 63 + 836: 25(ivec4) Load 835 + 837: 25(ivec4) VectorShuffle 836 834 4 5 2 3 + Store 835 837 + 838: 6(int) Load 8(invocation) + 839: 71(ptr) AccessChain 31(data) 63 63 + 840: 25(ivec4) Load 839 + 841: 78(ivec3) VectorShuffle 840 840 0 1 2 + 842: 161(bvec3) SLessThan 841 740 + 843: 17(ivec4) Load 19(ballot) + 844: 161(bvec3) GroupNonUniformLogicalOr 178 PartitionedReduceNV 842 843 + 845: 78(ivec3) Select 844 744 740 + 846: 71(ptr) AccessChain 31(data) 838 63 + 847: 25(ivec4) Load 846 + 848: 25(ivec4) VectorShuffle 847 845 4 5 6 3 + Store 846 848 + 849: 6(int) Load 8(invocation) + 850: 71(ptr) AccessChain 31(data) 63 63 + 851: 25(ivec4) Load 850 + 852: 169(bvec4) SLessThan 851 752 + 853: 17(ivec4) Load 19(ballot) + 854: 169(bvec4) GroupNonUniformLogicalOr 178 PartitionedReduceNV 852 853 + 855: 25(ivec4) Select 854 756 752 + 856: 71(ptr) AccessChain 31(data) 849 63 + Store 856 855 + 857: 6(int) Load 8(invocation) + 858: 64(ptr) AccessChain 31(data) 34 63 35 + 859: 24(int) Load 858 + 860: 17(ivec4) Load 19(ballot) + 861: 24(int) GroupNonUniformBitwiseXor 178 PartitionedReduceNV 859 860 + 862: 64(ptr) AccessChain 31(data) 857 63 35 + Store 862 861 + 863: 6(int) Load 8(invocation) + 864: 71(ptr) AccessChain 31(data) 63 63 + 865: 25(ivec4) Load 864 + 866: 70(ivec2) VectorShuffle 865 865 0 1 + 867: 17(ivec4) Load 19(ballot) + 868: 70(ivec2) GroupNonUniformBitwiseXor 178 PartitionedReduceNV 866 867 + 869: 71(ptr) AccessChain 31(data) 863 63 + 870: 25(ivec4) Load 869 + 871: 25(ivec4) VectorShuffle 870 868 4 5 2 3 + Store 869 871 + 872: 6(int) Load 8(invocation) + 873: 71(ptr) AccessChain 31(data) 33 63 + 874: 25(ivec4) Load 873 + 875: 78(ivec3) VectorShuffle 874 874 0 1 2 + 876: 17(ivec4) Load 19(ballot) + 877: 78(ivec3) GroupNonUniformBitwiseXor 178 PartitionedReduceNV 875 876 + 878: 71(ptr) AccessChain 31(data) 872 63 + 879: 25(ivec4) Load 878 + 880: 25(ivec4) VectorShuffle 879 877 4 5 6 3 + Store 878 880 + 881: 6(int) Load 8(invocation) + 882: 71(ptr) AccessChain 31(data) 115 63 + 883: 25(ivec4) Load 882 + 884: 17(ivec4) Load 19(ballot) + 885: 25(ivec4) GroupNonUniformBitwiseXor 178 PartitionedReduceNV 883 884 + 886: 71(ptr) AccessChain 31(data) 881 63 + Store 886 885 + 887: 6(int) Load 8(invocation) + 888: 90(ptr) AccessChain 31(data) 34 33 35 + 889: 6(int) Load 888 + 890: 17(ivec4) Load 19(ballot) + 891: 6(int) GroupNonUniformBitwiseXor 178 PartitionedReduceNV 889 890 + 892: 90(ptr) AccessChain 31(data) 887 33 35 + Store 892 891 + 893: 6(int) Load 8(invocation) + 894: 40(ptr) AccessChain 31(data) 63 33 + 895: 17(ivec4) Load 894 + 896: 96(ivec2) VectorShuffle 895 895 0 1 + 897: 17(ivec4) Load 19(ballot) + 898: 96(ivec2) GroupNonUniformBitwiseXor 178 PartitionedReduceNV 896 897 + 899: 40(ptr) AccessChain 31(data) 893 33 + 900: 17(ivec4) Load 899 + 901: 17(ivec4) VectorShuffle 900 898 4 5 2 3 + Store 899 901 + 902: 6(int) Load 8(invocation) + 903: 40(ptr) AccessChain 31(data) 33 33 + 904: 17(ivec4) Load 903 + 905: 103(ivec3) VectorShuffle 904 904 0 1 2 + 906: 17(ivec4) Load 19(ballot) + 907: 103(ivec3) GroupNonUniformBitwiseXor 178 PartitionedReduceNV 905 906 + 908: 40(ptr) AccessChain 31(data) 902 33 + 909: 17(ivec4) Load 908 + 910: 17(ivec4) VectorShuffle 909 907 4 5 6 3 + Store 908 910 + 911: 6(int) Load 8(invocation) + 912: 40(ptr) AccessChain 31(data) 115 33 + 913: 17(ivec4) Load 912 + 914: 17(ivec4) Load 19(ballot) + 915: 17(ivec4) GroupNonUniformBitwiseXor 178 PartitionedReduceNV 913 914 + 916: 40(ptr) AccessChain 31(data) 911 33 + Store 916 915 + 917: 6(int) Load 8(invocation) + 918: 64(ptr) AccessChain 31(data) 34 63 35 + 919: 24(int) Load 918 + 920: 144(bool) SLessThan 919 34 + 921: 17(ivec4) Load 19(ballot) + 922: 144(bool) GroupNonUniformLogicalXor 178 PartitionedReduceNV 920 921 + 923: 24(int) Select 922 63 34 + 924: 64(ptr) AccessChain 31(data) 917 63 35 + Store 924 923 + 925: 6(int) Load 8(invocation) + 926: 71(ptr) AccessChain 31(data) 63 63 + 927: 25(ivec4) Load 926 + 928: 70(ivec2) VectorShuffle 927 927 0 1 + 929: 152(bvec2) SLessThan 928 727 + 930: 17(ivec4) Load 19(ballot) + 931: 152(bvec2) GroupNonUniformLogicalXor 178 PartitionedReduceNV 929 930 + 932: 70(ivec2) Select 931 731 727 + 933: 71(ptr) AccessChain 31(data) 925 63 + 934: 25(ivec4) Load 933 + 935: 25(ivec4) VectorShuffle 934 932 4 5 2 3 + Store 933 935 + 936: 6(int) Load 8(invocation) + 937: 71(ptr) AccessChain 31(data) 63 63 + 938: 25(ivec4) Load 937 + 939: 78(ivec3) VectorShuffle 938 938 0 1 2 + 940: 161(bvec3) SLessThan 939 740 + 941: 17(ivec4) Load 19(ballot) + 942: 161(bvec3) GroupNonUniformLogicalXor 178 PartitionedReduceNV 940 941 + 943: 78(ivec3) Select 942 744 740 + 944: 71(ptr) AccessChain 31(data) 936 63 + 945: 25(ivec4) Load 944 + 946: 25(ivec4) VectorShuffle 945 943 4 5 6 3 + Store 944 946 + 947: 6(int) Load 8(invocation) + 948: 71(ptr) AccessChain 31(data) 63 63 + 949: 25(ivec4) Load 948 + 950: 169(bvec4) SLessThan 949 752 + 951: 17(ivec4) Load 19(ballot) + 952: 169(bvec4) GroupNonUniformLogicalXor 178 PartitionedReduceNV 950 951 + 953: 25(ivec4) Select 952 756 752 + 954: 71(ptr) AccessChain 31(data) 947 63 + Store 954 953 + 955: 6(int) Load 8(invocation) + 956: 36(ptr) AccessChain 31(data) 34 34 35 + 957: 22(float) Load 956 + 958: 17(ivec4) Load 19(ballot) + 959: 22(float) GroupNonUniformFAdd 178 PartitionedInclusiveScanNV 957 958 + 960: 36(ptr) AccessChain 31(data) 955 34 35 + Store 960 959 + 961: 6(int) Load 8(invocation) + 962: 44(ptr) AccessChain 31(data) 63 34 + 963: 23(fvec4) Load 962 + 964: 43(fvec2) VectorShuffle 963 963 0 1 + 965: 17(ivec4) Load 19(ballot) + 966: 43(fvec2) GroupNonUniformFAdd 178 PartitionedInclusiveScanNV 964 965 + 967: 44(ptr) AccessChain 31(data) 961 34 + 968: 23(fvec4) Load 967 + 969: 23(fvec4) VectorShuffle 968 966 4 5 2 3 + Store 967 969 + 970: 6(int) Load 8(invocation) + 971: 44(ptr) AccessChain 31(data) 33 34 + 972: 23(fvec4) Load 971 + 973: 51(fvec3) VectorShuffle 972 972 0 1 2 + 974: 17(ivec4) Load 19(ballot) + 975: 51(fvec3) GroupNonUniformFAdd 178 PartitionedInclusiveScanNV 973 974 + 976: 44(ptr) AccessChain 31(data) 970 34 + 977: 23(fvec4) Load 976 + 978: 23(fvec4) VectorShuffle 977 975 4 5 6 3 + Store 976 978 + 979: 6(int) Load 8(invocation) + 980: 44(ptr) AccessChain 31(data) 115 34 + 981: 23(fvec4) Load 980 + 982: 17(ivec4) Load 19(ballot) + 983: 23(fvec4) GroupNonUniformFAdd 178 PartitionedInclusiveScanNV 981 982 + 984: 44(ptr) AccessChain 31(data) 979 34 + Store 984 983 + 985: 6(int) Load 8(invocation) + 986: 64(ptr) AccessChain 31(data) 34 63 35 + 987: 24(int) Load 986 + 988: 17(ivec4) Load 19(ballot) + 989: 24(int) GroupNonUniformIAdd 178 PartitionedInclusiveScanNV 987 988 + 990: 64(ptr) AccessChain 31(data) 985 63 35 + Store 990 989 + 991: 6(int) Load 8(invocation) + 992: 71(ptr) AccessChain 31(data) 63 63 + 993: 25(ivec4) Load 992 + 994: 70(ivec2) VectorShuffle 993 993 0 1 + 995: 17(ivec4) Load 19(ballot) + 996: 70(ivec2) GroupNonUniformIAdd 178 PartitionedInclusiveScanNV 994 995 + 997: 71(ptr) AccessChain 31(data) 991 63 + 998: 25(ivec4) Load 997 + 999: 25(ivec4) VectorShuffle 998 996 4 5 2 3 + Store 997 999 + 1000: 6(int) Load 8(invocation) + 1001: 71(ptr) AccessChain 31(data) 33 63 + 1002: 25(ivec4) Load 1001 + 1003: 78(ivec3) VectorShuffle 1002 1002 0 1 2 + 1004: 17(ivec4) Load 19(ballot) + 1005: 78(ivec3) GroupNonUniformIAdd 178 PartitionedInclusiveScanNV 1003 1004 + 1006: 71(ptr) AccessChain 31(data) 1000 63 + 1007: 25(ivec4) Load 1006 + 1008: 25(ivec4) VectorShuffle 1007 1005 4 5 6 3 + Store 1006 1008 + 1009: 6(int) Load 8(invocation) + 1010: 71(ptr) AccessChain 31(data) 115 63 + 1011: 25(ivec4) Load 1010 + 1012: 17(ivec4) Load 19(ballot) + 1013: 25(ivec4) GroupNonUniformIAdd 178 PartitionedInclusiveScanNV 1011 1012 + 1014: 71(ptr) AccessChain 31(data) 1009 63 + Store 1014 1013 + 1015: 6(int) Load 8(invocation) + 1016: 90(ptr) AccessChain 31(data) 34 33 35 + 1017: 6(int) Load 1016 + 1018: 17(ivec4) Load 19(ballot) + 1019: 6(int) GroupNonUniformIAdd 178 PartitionedInclusiveScanNV 1017 1018 + 1020: 90(ptr) AccessChain 31(data) 1015 33 35 + Store 1020 1019 + 1021: 6(int) Load 8(invocation) + 1022: 40(ptr) AccessChain 31(data) 63 33 + 1023: 17(ivec4) Load 1022 + 1024: 96(ivec2) VectorShuffle 1023 1023 0 1 + 1025: 17(ivec4) Load 19(ballot) + 1026: 96(ivec2) GroupNonUniformIAdd 178 PartitionedInclusiveScanNV 1024 1025 + 1027: 40(ptr) AccessChain 31(data) 1021 33 + 1028: 17(ivec4) Load 1027 + 1029: 17(ivec4) VectorShuffle 1028 1026 4 5 2 3 + Store 1027 1029 + 1030: 6(int) Load 8(invocation) + 1031: 40(ptr) AccessChain 31(data) 33 33 + 1032: 17(ivec4) Load 1031 + 1033: 103(ivec3) VectorShuffle 1032 1032 0 1 2 + 1034: 17(ivec4) Load 19(ballot) + 1035: 103(ivec3) GroupNonUniformIAdd 178 PartitionedInclusiveScanNV 1033 1034 + 1036: 40(ptr) AccessChain 31(data) 1030 33 + 1037: 17(ivec4) Load 1036 + 1038: 17(ivec4) VectorShuffle 1037 1035 4 5 6 3 + Store 1036 1038 + 1039: 6(int) Load 8(invocation) + 1040: 40(ptr) AccessChain 31(data) 115 33 + 1041: 17(ivec4) Load 1040 + 1042: 17(ivec4) Load 19(ballot) + 1043: 17(ivec4) GroupNonUniformIAdd 178 PartitionedInclusiveScanNV 1041 1042 + 1044: 40(ptr) AccessChain 31(data) 1039 33 + Store 1044 1043 + 1045: 6(int) Load 8(invocation) + 1046: 116(ptr) AccessChain 31(data) 34 115 35 + 1047:26(float64_t) Load 1046 + 1048: 17(ivec4) Load 19(ballot) + 1049:26(float64_t) GroupNonUniformFAdd 178 PartitionedInclusiveScanNV 1047 1048 + 1050: 116(ptr) AccessChain 31(data) 1045 115 35 + Store 1050 1049 + 1051: 6(int) Load 8(invocation) + 1052: 123(ptr) AccessChain 31(data) 63 115 + 1053: 27(f64vec4) Load 1052 + 1054:122(f64vec2) VectorShuffle 1053 1053 0 1 + 1055: 17(ivec4) Load 19(ballot) + 1056:122(f64vec2) GroupNonUniformFAdd 178 PartitionedInclusiveScanNV 1054 1055 + 1057: 123(ptr) AccessChain 31(data) 1051 115 + 1058: 27(f64vec4) Load 1057 + 1059: 27(f64vec4) VectorShuffle 1058 1056 4 5 2 3 + Store 1057 1059 + 1060: 6(int) Load 8(invocation) + 1061: 123(ptr) AccessChain 31(data) 33 115 + 1062: 27(f64vec4) Load 1061 + 1063:130(f64vec3) VectorShuffle 1062 1062 0 1 2 + 1064: 17(ivec4) Load 19(ballot) + 1065:130(f64vec3) GroupNonUniformFAdd 178 PartitionedInclusiveScanNV 1063 1064 + 1066: 123(ptr) AccessChain 31(data) 1060 115 + 1067: 27(f64vec4) Load 1066 + 1068: 27(f64vec4) VectorShuffle 1067 1065 4 5 6 3 + Store 1066 1068 + 1069: 6(int) Load 8(invocation) + 1070: 123(ptr) AccessChain 31(data) 115 115 + 1071: 27(f64vec4) Load 1070 + 1072: 17(ivec4) Load 19(ballot) + 1073: 27(f64vec4) GroupNonUniformFAdd 178 PartitionedInclusiveScanNV 1071 1072 + 1074: 123(ptr) AccessChain 31(data) 1069 115 + Store 1074 1073 + 1075: 6(int) Load 8(invocation) + 1076: 36(ptr) AccessChain 31(data) 34 34 35 + 1077: 22(float) Load 1076 + 1078: 17(ivec4) Load 19(ballot) + 1079: 22(float) GroupNonUniformFMul 178 PartitionedInclusiveScanNV 1077 1078 + 1080: 36(ptr) AccessChain 31(data) 1075 34 35 + Store 1080 1079 + 1081: 6(int) Load 8(invocation) + 1082: 44(ptr) AccessChain 31(data) 63 34 + 1083: 23(fvec4) Load 1082 + 1084: 43(fvec2) VectorShuffle 1083 1083 0 1 + 1085: 17(ivec4) Load 19(ballot) + 1086: 43(fvec2) GroupNonUniformFMul 178 PartitionedInclusiveScanNV 1084 1085 + 1087: 44(ptr) AccessChain 31(data) 1081 34 + 1088: 23(fvec4) Load 1087 + 1089: 23(fvec4) VectorShuffle 1088 1086 4 5 2 3 + Store 1087 1089 + 1090: 6(int) Load 8(invocation) + 1091: 44(ptr) AccessChain 31(data) 33 34 + 1092: 23(fvec4) Load 1091 + 1093: 51(fvec3) VectorShuffle 1092 1092 0 1 2 + 1094: 17(ivec4) Load 19(ballot) + 1095: 51(fvec3) GroupNonUniformFMul 178 PartitionedInclusiveScanNV 1093 1094 + 1096: 44(ptr) AccessChain 31(data) 1090 34 + 1097: 23(fvec4) Load 1096 + 1098: 23(fvec4) VectorShuffle 1097 1095 4 5 6 3 + Store 1096 1098 + 1099: 6(int) Load 8(invocation) + 1100: 44(ptr) AccessChain 31(data) 115 34 + 1101: 23(fvec4) Load 1100 + 1102: 17(ivec4) Load 19(ballot) + 1103: 23(fvec4) GroupNonUniformFMul 178 PartitionedInclusiveScanNV 1101 1102 + 1104: 44(ptr) AccessChain 31(data) 1099 34 + Store 1104 1103 + 1105: 6(int) Load 8(invocation) + 1106: 64(ptr) AccessChain 31(data) 34 63 35 + 1107: 24(int) Load 1106 + 1108: 17(ivec4) Load 19(ballot) + 1109: 24(int) GroupNonUniformIMul 178 PartitionedInclusiveScanNV 1107 1108 + 1110: 64(ptr) AccessChain 31(data) 1105 63 35 + Store 1110 1109 + 1111: 6(int) Load 8(invocation) + 1112: 71(ptr) AccessChain 31(data) 63 63 + 1113: 25(ivec4) Load 1112 + 1114: 70(ivec2) VectorShuffle 1113 1113 0 1 + 1115: 17(ivec4) Load 19(ballot) + 1116: 70(ivec2) GroupNonUniformIMul 178 PartitionedInclusiveScanNV 1114 1115 + 1117: 71(ptr) AccessChain 31(data) 1111 63 + 1118: 25(ivec4) Load 1117 + 1119: 25(ivec4) VectorShuffle 1118 1116 4 5 2 3 + Store 1117 1119 + 1120: 6(int) Load 8(invocation) + 1121: 71(ptr) AccessChain 31(data) 33 63 + 1122: 25(ivec4) Load 1121 + 1123: 78(ivec3) VectorShuffle 1122 1122 0 1 2 + 1124: 17(ivec4) Load 19(ballot) + 1125: 78(ivec3) GroupNonUniformIMul 178 PartitionedInclusiveScanNV 1123 1124 + 1126: 71(ptr) AccessChain 31(data) 1120 63 + 1127: 25(ivec4) Load 1126 + 1128: 25(ivec4) VectorShuffle 1127 1125 4 5 6 3 + Store 1126 1128 + 1129: 6(int) Load 8(invocation) + 1130: 71(ptr) AccessChain 31(data) 115 63 + 1131: 25(ivec4) Load 1130 + 1132: 17(ivec4) Load 19(ballot) + 1133: 25(ivec4) GroupNonUniformIMul 178 PartitionedInclusiveScanNV 1131 1132 + 1134: 71(ptr) AccessChain 31(data) 1129 63 + Store 1134 1133 + 1135: 6(int) Load 8(invocation) + 1136: 90(ptr) AccessChain 31(data) 34 33 35 + 1137: 6(int) Load 1136 + 1138: 17(ivec4) Load 19(ballot) + 1139: 6(int) GroupNonUniformIMul 178 PartitionedInclusiveScanNV 1137 1138 + 1140: 90(ptr) AccessChain 31(data) 1135 33 35 + Store 1140 1139 + 1141: 6(int) Load 8(invocation) + 1142: 40(ptr) AccessChain 31(data) 63 33 + 1143: 17(ivec4) Load 1142 + 1144: 96(ivec2) VectorShuffle 1143 1143 0 1 + 1145: 17(ivec4) Load 19(ballot) + 1146: 96(ivec2) GroupNonUniformIMul 178 PartitionedInclusiveScanNV 1144 1145 + 1147: 40(ptr) AccessChain 31(data) 1141 33 + 1148: 17(ivec4) Load 1147 + 1149: 17(ivec4) VectorShuffle 1148 1146 4 5 2 3 + Store 1147 1149 + 1150: 6(int) Load 8(invocation) + 1151: 40(ptr) AccessChain 31(data) 33 33 + 1152: 17(ivec4) Load 1151 + 1153: 103(ivec3) VectorShuffle 1152 1152 0 1 2 + 1154: 17(ivec4) Load 19(ballot) + 1155: 103(ivec3) GroupNonUniformIMul 178 PartitionedInclusiveScanNV 1153 1154 + 1156: 40(ptr) AccessChain 31(data) 1150 33 + 1157: 17(ivec4) Load 1156 + 1158: 17(ivec4) VectorShuffle 1157 1155 4 5 6 3 + Store 1156 1158 + 1159: 6(int) Load 8(invocation) + 1160: 40(ptr) AccessChain 31(data) 115 33 + 1161: 17(ivec4) Load 1160 + 1162: 17(ivec4) Load 19(ballot) + 1163: 17(ivec4) GroupNonUniformIMul 178 PartitionedInclusiveScanNV 1161 1162 + 1164: 40(ptr) AccessChain 31(data) 1159 33 + Store 1164 1163 + 1165: 6(int) Load 8(invocation) + 1166: 116(ptr) AccessChain 31(data) 34 115 35 + 1167:26(float64_t) Load 1166 + 1168: 17(ivec4) Load 19(ballot) + 1169:26(float64_t) GroupNonUniformFMul 178 PartitionedInclusiveScanNV 1167 1168 + 1170: 116(ptr) AccessChain 31(data) 1165 115 35 + Store 1170 1169 + 1171: 6(int) Load 8(invocation) + 1172: 123(ptr) AccessChain 31(data) 63 115 + 1173: 27(f64vec4) Load 1172 + 1174:122(f64vec2) VectorShuffle 1173 1173 0 1 + 1175: 17(ivec4) Load 19(ballot) + 1176:122(f64vec2) GroupNonUniformFMul 178 PartitionedInclusiveScanNV 1174 1175 + 1177: 123(ptr) AccessChain 31(data) 1171 115 + 1178: 27(f64vec4) Load 1177 + 1179: 27(f64vec4) VectorShuffle 1178 1176 4 5 2 3 + Store 1177 1179 + 1180: 6(int) Load 8(invocation) + 1181: 123(ptr) AccessChain 31(data) 33 115 + 1182: 27(f64vec4) Load 1181 + 1183:130(f64vec3) VectorShuffle 1182 1182 0 1 2 + 1184: 17(ivec4) Load 19(ballot) + 1185:130(f64vec3) GroupNonUniformFMul 178 PartitionedInclusiveScanNV 1183 1184 + 1186: 123(ptr) AccessChain 31(data) 1180 115 + 1187: 27(f64vec4) Load 1186 + 1188: 27(f64vec4) VectorShuffle 1187 1185 4 5 6 3 + Store 1186 1188 + 1189: 6(int) Load 8(invocation) + 1190: 123(ptr) AccessChain 31(data) 115 115 + 1191: 27(f64vec4) Load 1190 + 1192: 17(ivec4) Load 19(ballot) + 1193: 27(f64vec4) GroupNonUniformFMul 178 PartitionedInclusiveScanNV 1191 1192 + 1194: 123(ptr) AccessChain 31(data) 1189 115 + Store 1194 1193 + 1195: 6(int) Load 8(invocation) + 1196: 36(ptr) AccessChain 31(data) 34 34 35 + 1197: 22(float) Load 1196 + 1198: 17(ivec4) Load 19(ballot) + 1199: 22(float) GroupNonUniformFMin 178 PartitionedInclusiveScanNV 1197 1198 + 1200: 36(ptr) AccessChain 31(data) 1195 34 35 + Store 1200 1199 + 1201: 6(int) Load 8(invocation) + 1202: 44(ptr) AccessChain 31(data) 63 34 + 1203: 23(fvec4) Load 1202 + 1204: 43(fvec2) VectorShuffle 1203 1203 0 1 + 1205: 17(ivec4) Load 19(ballot) + 1206: 43(fvec2) GroupNonUniformFMin 178 PartitionedInclusiveScanNV 1204 1205 + 1207: 44(ptr) AccessChain 31(data) 1201 34 + 1208: 23(fvec4) Load 1207 + 1209: 23(fvec4) VectorShuffle 1208 1206 4 5 2 3 + Store 1207 1209 + 1210: 6(int) Load 8(invocation) + 1211: 44(ptr) AccessChain 31(data) 33 34 + 1212: 23(fvec4) Load 1211 + 1213: 51(fvec3) VectorShuffle 1212 1212 0 1 2 + 1214: 17(ivec4) Load 19(ballot) + 1215: 51(fvec3) GroupNonUniformFMin 178 PartitionedInclusiveScanNV 1213 1214 + 1216: 44(ptr) AccessChain 31(data) 1210 34 + 1217: 23(fvec4) Load 1216 + 1218: 23(fvec4) VectorShuffle 1217 1215 4 5 6 3 + Store 1216 1218 + 1219: 6(int) Load 8(invocation) + 1220: 44(ptr) AccessChain 31(data) 115 34 + 1221: 23(fvec4) Load 1220 + 1222: 17(ivec4) Load 19(ballot) + 1223: 23(fvec4) GroupNonUniformFMin 178 PartitionedInclusiveScanNV 1221 1222 + 1224: 44(ptr) AccessChain 31(data) 1219 34 + Store 1224 1223 + 1225: 6(int) Load 8(invocation) + 1226: 64(ptr) AccessChain 31(data) 34 63 35 + 1227: 24(int) Load 1226 + 1228: 17(ivec4) Load 19(ballot) + 1229: 24(int) GroupNonUniformSMin 178 PartitionedInclusiveScanNV 1227 1228 + 1230: 64(ptr) AccessChain 31(data) 1225 63 35 + Store 1230 1229 + 1231: 6(int) Load 8(invocation) + 1232: 71(ptr) AccessChain 31(data) 63 63 + 1233: 25(ivec4) Load 1232 + 1234: 70(ivec2) VectorShuffle 1233 1233 0 1 + 1235: 17(ivec4) Load 19(ballot) + 1236: 70(ivec2) GroupNonUniformSMin 178 PartitionedInclusiveScanNV 1234 1235 + 1237: 71(ptr) AccessChain 31(data) 1231 63 + 1238: 25(ivec4) Load 1237 + 1239: 25(ivec4) VectorShuffle 1238 1236 4 5 2 3 + Store 1237 1239 + 1240: 6(int) Load 8(invocation) + 1241: 71(ptr) AccessChain 31(data) 33 63 + 1242: 25(ivec4) Load 1241 + 1243: 78(ivec3) VectorShuffle 1242 1242 0 1 2 + 1244: 17(ivec4) Load 19(ballot) + 1245: 78(ivec3) GroupNonUniformSMin 178 PartitionedInclusiveScanNV 1243 1244 + 1246: 71(ptr) AccessChain 31(data) 1240 63 + 1247: 25(ivec4) Load 1246 + 1248: 25(ivec4) VectorShuffle 1247 1245 4 5 6 3 + Store 1246 1248 + 1249: 6(int) Load 8(invocation) + 1250: 71(ptr) AccessChain 31(data) 115 63 + 1251: 25(ivec4) Load 1250 + 1252: 17(ivec4) Load 19(ballot) + 1253: 25(ivec4) GroupNonUniformSMin 178 PartitionedInclusiveScanNV 1251 1252 + 1254: 71(ptr) AccessChain 31(data) 1249 63 + Store 1254 1253 + 1255: 6(int) Load 8(invocation) + 1256: 90(ptr) AccessChain 31(data) 34 33 35 + 1257: 6(int) Load 1256 + 1258: 17(ivec4) Load 19(ballot) + 1259: 6(int) GroupNonUniformUMin 178 PartitionedInclusiveScanNV 1257 1258 + 1260: 90(ptr) AccessChain 31(data) 1255 33 35 + Store 1260 1259 + 1261: 6(int) Load 8(invocation) + 1262: 40(ptr) AccessChain 31(data) 63 33 + 1263: 17(ivec4) Load 1262 + 1264: 96(ivec2) VectorShuffle 1263 1263 0 1 + 1265: 17(ivec4) Load 19(ballot) + 1266: 96(ivec2) GroupNonUniformUMin 178 PartitionedInclusiveScanNV 1264 1265 + 1267: 40(ptr) AccessChain 31(data) 1261 33 + 1268: 17(ivec4) Load 1267 + 1269: 17(ivec4) VectorShuffle 1268 1266 4 5 2 3 + Store 1267 1269 + 1270: 6(int) Load 8(invocation) + 1271: 40(ptr) AccessChain 31(data) 33 33 + 1272: 17(ivec4) Load 1271 + 1273: 103(ivec3) VectorShuffle 1272 1272 0 1 2 + 1274: 17(ivec4) Load 19(ballot) + 1275: 103(ivec3) GroupNonUniformUMin 178 PartitionedInclusiveScanNV 1273 1274 + 1276: 40(ptr) AccessChain 31(data) 1270 33 + 1277: 17(ivec4) Load 1276 + 1278: 17(ivec4) VectorShuffle 1277 1275 4 5 6 3 + Store 1276 1278 + 1279: 6(int) Load 8(invocation) + 1280: 40(ptr) AccessChain 31(data) 115 33 + 1281: 17(ivec4) Load 1280 + 1282: 17(ivec4) Load 19(ballot) + 1283: 17(ivec4) GroupNonUniformUMin 178 PartitionedInclusiveScanNV 1281 1282 + 1284: 40(ptr) AccessChain 31(data) 1279 33 + Store 1284 1283 + 1285: 6(int) Load 8(invocation) + 1286: 116(ptr) AccessChain 31(data) 34 115 35 + 1287:26(float64_t) Load 1286 + 1288: 17(ivec4) Load 19(ballot) + 1289:26(float64_t) GroupNonUniformFMin 178 PartitionedInclusiveScanNV 1287 1288 + 1290: 116(ptr) AccessChain 31(data) 1285 115 35 + Store 1290 1289 + 1291: 6(int) Load 8(invocation) + 1292: 123(ptr) AccessChain 31(data) 63 115 + 1293: 27(f64vec4) Load 1292 + 1294:122(f64vec2) VectorShuffle 1293 1293 0 1 + 1295: 17(ivec4) Load 19(ballot) + 1296:122(f64vec2) GroupNonUniformFMin 178 PartitionedInclusiveScanNV 1294 1295 + 1297: 123(ptr) AccessChain 31(data) 1291 115 + 1298: 27(f64vec4) Load 1297 + 1299: 27(f64vec4) VectorShuffle 1298 1296 4 5 2 3 + Store 1297 1299 + 1300: 6(int) Load 8(invocation) + 1301: 123(ptr) AccessChain 31(data) 33 115 + 1302: 27(f64vec4) Load 1301 + 1303:130(f64vec3) VectorShuffle 1302 1302 0 1 2 + 1304: 17(ivec4) Load 19(ballot) + 1305:130(f64vec3) GroupNonUniformFMin 178 PartitionedInclusiveScanNV 1303 1304 + 1306: 123(ptr) AccessChain 31(data) 1300 115 + 1307: 27(f64vec4) Load 1306 + 1308: 27(f64vec4) VectorShuffle 1307 1305 4 5 6 3 + Store 1306 1308 + 1309: 6(int) Load 8(invocation) + 1310: 123(ptr) AccessChain 31(data) 115 115 + 1311: 27(f64vec4) Load 1310 + 1312: 17(ivec4) Load 19(ballot) + 1313: 27(f64vec4) GroupNonUniformFMin 178 PartitionedInclusiveScanNV 1311 1312 + 1314: 123(ptr) AccessChain 31(data) 1309 115 + Store 1314 1313 + 1315: 6(int) Load 8(invocation) + 1316: 36(ptr) AccessChain 31(data) 34 34 35 + 1317: 22(float) Load 1316 + 1318: 17(ivec4) Load 19(ballot) + 1319: 22(float) GroupNonUniformFMax 178 PartitionedInclusiveScanNV 1317 1318 + 1320: 36(ptr) AccessChain 31(data) 1315 34 35 + Store 1320 1319 + 1321: 6(int) Load 8(invocation) + 1322: 44(ptr) AccessChain 31(data) 63 34 + 1323: 23(fvec4) Load 1322 + 1324: 43(fvec2) VectorShuffle 1323 1323 0 1 + 1325: 17(ivec4) Load 19(ballot) + 1326: 43(fvec2) GroupNonUniformFMax 178 PartitionedInclusiveScanNV 1324 1325 + 1327: 44(ptr) AccessChain 31(data) 1321 34 + 1328: 23(fvec4) Load 1327 + 1329: 23(fvec4) VectorShuffle 1328 1326 4 5 2 3 + Store 1327 1329 + 1330: 6(int) Load 8(invocation) + 1331: 44(ptr) AccessChain 31(data) 33 34 + 1332: 23(fvec4) Load 1331 + 1333: 51(fvec3) VectorShuffle 1332 1332 0 1 2 + 1334: 17(ivec4) Load 19(ballot) + 1335: 51(fvec3) GroupNonUniformFMax 178 PartitionedInclusiveScanNV 1333 1334 + 1336: 44(ptr) AccessChain 31(data) 1330 34 + 1337: 23(fvec4) Load 1336 + 1338: 23(fvec4) VectorShuffle 1337 1335 4 5 6 3 + Store 1336 1338 + 1339: 6(int) Load 8(invocation) + 1340: 44(ptr) AccessChain 31(data) 115 34 + 1341: 23(fvec4) Load 1340 + 1342: 17(ivec4) Load 19(ballot) + 1343: 23(fvec4) GroupNonUniformFMax 178 PartitionedInclusiveScanNV 1341 1342 + 1344: 44(ptr) AccessChain 31(data) 1339 34 + Store 1344 1343 + 1345: 6(int) Load 8(invocation) + 1346: 64(ptr) AccessChain 31(data) 34 63 35 + 1347: 24(int) Load 1346 + 1348: 17(ivec4) Load 19(ballot) + 1349: 24(int) GroupNonUniformSMax 178 PartitionedInclusiveScanNV 1347 1348 + 1350: 64(ptr) AccessChain 31(data) 1345 63 35 + Store 1350 1349 + 1351: 6(int) Load 8(invocation) + 1352: 71(ptr) AccessChain 31(data) 63 63 + 1353: 25(ivec4) Load 1352 + 1354: 70(ivec2) VectorShuffle 1353 1353 0 1 + 1355: 17(ivec4) Load 19(ballot) + 1356: 70(ivec2) GroupNonUniformSMax 178 PartitionedInclusiveScanNV 1354 1355 + 1357: 71(ptr) AccessChain 31(data) 1351 63 + 1358: 25(ivec4) Load 1357 + 1359: 25(ivec4) VectorShuffle 1358 1356 4 5 2 3 + Store 1357 1359 + 1360: 6(int) Load 8(invocation) + 1361: 71(ptr) AccessChain 31(data) 33 63 + 1362: 25(ivec4) Load 1361 + 1363: 78(ivec3) VectorShuffle 1362 1362 0 1 2 + 1364: 17(ivec4) Load 19(ballot) + 1365: 78(ivec3) GroupNonUniformSMax 178 PartitionedInclusiveScanNV 1363 1364 + 1366: 71(ptr) AccessChain 31(data) 1360 63 + 1367: 25(ivec4) Load 1366 + 1368: 25(ivec4) VectorShuffle 1367 1365 4 5 6 3 + Store 1366 1368 + 1369: 6(int) Load 8(invocation) + 1370: 71(ptr) AccessChain 31(data) 115 63 + 1371: 25(ivec4) Load 1370 + 1372: 17(ivec4) Load 19(ballot) + 1373: 25(ivec4) GroupNonUniformSMax 178 PartitionedInclusiveScanNV 1371 1372 + 1374: 71(ptr) AccessChain 31(data) 1369 63 + Store 1374 1373 + 1375: 6(int) Load 8(invocation) + 1376: 90(ptr) AccessChain 31(data) 34 33 35 + 1377: 6(int) Load 1376 + 1378: 17(ivec4) Load 19(ballot) + 1379: 6(int) GroupNonUniformUMax 178 PartitionedInclusiveScanNV 1377 1378 + 1380: 90(ptr) AccessChain 31(data) 1375 33 35 + Store 1380 1379 + 1381: 6(int) Load 8(invocation) + 1382: 40(ptr) AccessChain 31(data) 63 33 + 1383: 17(ivec4) Load 1382 + 1384: 96(ivec2) VectorShuffle 1383 1383 0 1 + 1385: 17(ivec4) Load 19(ballot) + 1386: 96(ivec2) GroupNonUniformUMax 178 PartitionedInclusiveScanNV 1384 1385 + 1387: 40(ptr) AccessChain 31(data) 1381 33 + 1388: 17(ivec4) Load 1387 + 1389: 17(ivec4) VectorShuffle 1388 1386 4 5 2 3 + Store 1387 1389 + 1390: 6(int) Load 8(invocation) + 1391: 40(ptr) AccessChain 31(data) 33 33 + 1392: 17(ivec4) Load 1391 + 1393: 103(ivec3) VectorShuffle 1392 1392 0 1 2 + 1394: 17(ivec4) Load 19(ballot) + 1395: 103(ivec3) GroupNonUniformUMax 178 PartitionedInclusiveScanNV 1393 1394 + 1396: 40(ptr) AccessChain 31(data) 1390 33 + 1397: 17(ivec4) Load 1396 + 1398: 17(ivec4) VectorShuffle 1397 1395 4 5 6 3 + Store 1396 1398 + 1399: 6(int) Load 8(invocation) + 1400: 40(ptr) AccessChain 31(data) 115 33 + 1401: 17(ivec4) Load 1400 + 1402: 17(ivec4) Load 19(ballot) + 1403: 17(ivec4) GroupNonUniformUMax 178 PartitionedInclusiveScanNV 1401 1402 + 1404: 40(ptr) AccessChain 31(data) 1399 33 + Store 1404 1403 + 1405: 6(int) Load 8(invocation) + 1406: 116(ptr) AccessChain 31(data) 34 115 35 + 1407:26(float64_t) Load 1406 + 1408: 17(ivec4) Load 19(ballot) + 1409:26(float64_t) GroupNonUniformFMax 178 PartitionedInclusiveScanNV 1407 1408 + 1410: 116(ptr) AccessChain 31(data) 1405 115 35 + Store 1410 1409 + 1411: 6(int) Load 8(invocation) + 1412: 123(ptr) AccessChain 31(data) 63 115 + 1413: 27(f64vec4) Load 1412 + 1414:122(f64vec2) VectorShuffle 1413 1413 0 1 + 1415: 17(ivec4) Load 19(ballot) + 1416:122(f64vec2) GroupNonUniformFMax 178 PartitionedInclusiveScanNV 1414 1415 + 1417: 123(ptr) AccessChain 31(data) 1411 115 + 1418: 27(f64vec4) Load 1417 + 1419: 27(f64vec4) VectorShuffle 1418 1416 4 5 2 3 + Store 1417 1419 + 1420: 6(int) Load 8(invocation) + 1421: 123(ptr) AccessChain 31(data) 33 115 + 1422: 27(f64vec4) Load 1421 + 1423:130(f64vec3) VectorShuffle 1422 1422 0 1 2 + 1424: 17(ivec4) Load 19(ballot) + 1425:130(f64vec3) GroupNonUniformFMax 178 PartitionedInclusiveScanNV 1423 1424 + 1426: 123(ptr) AccessChain 31(data) 1420 115 + 1427: 27(f64vec4) Load 1426 + 1428: 27(f64vec4) VectorShuffle 1427 1425 4 5 6 3 + Store 1426 1428 + 1429: 6(int) Load 8(invocation) + 1430: 123(ptr) AccessChain 31(data) 115 115 + 1431: 27(f64vec4) Load 1430 + 1432: 17(ivec4) Load 19(ballot) + 1433: 27(f64vec4) GroupNonUniformFMax 178 PartitionedInclusiveScanNV 1431 1432 + 1434: 123(ptr) AccessChain 31(data) 1429 115 + Store 1434 1433 + 1435: 6(int) Load 8(invocation) + 1436: 64(ptr) AccessChain 31(data) 34 63 35 + 1437: 24(int) Load 1436 + 1438: 17(ivec4) Load 19(ballot) + 1439: 24(int) GroupNonUniformBitwiseAnd 178 PartitionedInclusiveScanNV 1437 1438 + 1440: 64(ptr) AccessChain 31(data) 1435 63 35 + Store 1440 1439 + 1441: 6(int) Load 8(invocation) + 1442: 71(ptr) AccessChain 31(data) 63 63 + 1443: 25(ivec4) Load 1442 + 1444: 70(ivec2) VectorShuffle 1443 1443 0 1 + 1445: 17(ivec4) Load 19(ballot) + 1446: 70(ivec2) GroupNonUniformBitwiseAnd 178 PartitionedInclusiveScanNV 1444 1445 + 1447: 71(ptr) AccessChain 31(data) 1441 63 + 1448: 25(ivec4) Load 1447 + 1449: 25(ivec4) VectorShuffle 1448 1446 4 5 2 3 + Store 1447 1449 + 1450: 6(int) Load 8(invocation) + 1451: 71(ptr) AccessChain 31(data) 33 63 + 1452: 25(ivec4) Load 1451 + 1453: 78(ivec3) VectorShuffle 1452 1452 0 1 2 + 1454: 17(ivec4) Load 19(ballot) + 1455: 78(ivec3) GroupNonUniformBitwiseAnd 178 PartitionedInclusiveScanNV 1453 1454 + 1456: 71(ptr) AccessChain 31(data) 1450 63 + 1457: 25(ivec4) Load 1456 + 1458: 25(ivec4) VectorShuffle 1457 1455 4 5 6 3 + Store 1456 1458 + 1459: 6(int) Load 8(invocation) + 1460: 71(ptr) AccessChain 31(data) 115 63 + 1461: 25(ivec4) Load 1460 + 1462: 17(ivec4) Load 19(ballot) + 1463: 25(ivec4) GroupNonUniformBitwiseAnd 178 PartitionedInclusiveScanNV 1461 1462 + 1464: 71(ptr) AccessChain 31(data) 1459 63 + Store 1464 1463 + 1465: 6(int) Load 8(invocation) + 1466: 90(ptr) AccessChain 31(data) 34 33 35 + 1467: 6(int) Load 1466 + 1468: 17(ivec4) Load 19(ballot) + 1469: 6(int) GroupNonUniformBitwiseAnd 178 PartitionedInclusiveScanNV 1467 1468 + 1470: 90(ptr) AccessChain 31(data) 1465 33 35 + Store 1470 1469 + 1471: 6(int) Load 8(invocation) + 1472: 40(ptr) AccessChain 31(data) 63 33 + 1473: 17(ivec4) Load 1472 + 1474: 96(ivec2) VectorShuffle 1473 1473 0 1 + 1475: 17(ivec4) Load 19(ballot) + 1476: 96(ivec2) GroupNonUniformBitwiseAnd 178 PartitionedInclusiveScanNV 1474 1475 + 1477: 40(ptr) AccessChain 31(data) 1471 33 + 1478: 17(ivec4) Load 1477 + 1479: 17(ivec4) VectorShuffle 1478 1476 4 5 2 3 + Store 1477 1479 + 1480: 6(int) Load 8(invocation) + 1481: 40(ptr) AccessChain 31(data) 33 33 + 1482: 17(ivec4) Load 1481 + 1483: 103(ivec3) VectorShuffle 1482 1482 0 1 2 + 1484: 17(ivec4) Load 19(ballot) + 1485: 103(ivec3) GroupNonUniformBitwiseAnd 178 PartitionedInclusiveScanNV 1483 1484 + 1486: 40(ptr) AccessChain 31(data) 1480 33 + 1487: 17(ivec4) Load 1486 + 1488: 17(ivec4) VectorShuffle 1487 1485 4 5 6 3 + Store 1486 1488 + 1489: 6(int) Load 8(invocation) + 1490: 40(ptr) AccessChain 31(data) 115 33 + 1491: 17(ivec4) Load 1490 + 1492: 17(ivec4) Load 19(ballot) + 1493: 17(ivec4) GroupNonUniformBitwiseAnd 178 PartitionedInclusiveScanNV 1491 1492 + 1494: 40(ptr) AccessChain 31(data) 1489 33 + Store 1494 1493 + 1495: 6(int) Load 8(invocation) + 1496: 64(ptr) AccessChain 31(data) 34 63 35 + 1497: 24(int) Load 1496 + 1498: 144(bool) SLessThan 1497 34 + 1499: 17(ivec4) Load 19(ballot) + 1500: 144(bool) GroupNonUniformLogicalAnd 178 PartitionedInclusiveScanNV 1498 1499 + 1501: 24(int) Select 1500 63 34 + 1502: 64(ptr) AccessChain 31(data) 1495 63 35 + Store 1502 1501 + 1503: 6(int) Load 8(invocation) + 1504: 71(ptr) AccessChain 31(data) 63 63 + 1505: 25(ivec4) Load 1504 + 1506: 70(ivec2) VectorShuffle 1505 1505 0 1 + 1507: 152(bvec2) SLessThan 1506 727 + 1508: 17(ivec4) Load 19(ballot) + 1509: 152(bvec2) GroupNonUniformLogicalAnd 178 PartitionedInclusiveScanNV 1507 1508 + 1510: 70(ivec2) Select 1509 731 727 + 1511: 71(ptr) AccessChain 31(data) 1503 63 + 1512: 25(ivec4) Load 1511 + 1513: 25(ivec4) VectorShuffle 1512 1510 4 5 2 3 + Store 1511 1513 + 1514: 6(int) Load 8(invocation) + 1515: 71(ptr) AccessChain 31(data) 63 63 + 1516: 25(ivec4) Load 1515 + 1517: 78(ivec3) VectorShuffle 1516 1516 0 1 2 + 1518: 161(bvec3) SLessThan 1517 740 + 1519: 17(ivec4) Load 19(ballot) + 1520: 161(bvec3) GroupNonUniformLogicalAnd 178 PartitionedInclusiveScanNV 1518 1519 + 1521: 78(ivec3) Select 1520 744 740 + 1522: 71(ptr) AccessChain 31(data) 1514 63 + 1523: 25(ivec4) Load 1522 + 1524: 25(ivec4) VectorShuffle 1523 1521 4 5 6 3 + Store 1522 1524 + 1525: 6(int) Load 8(invocation) + 1526: 71(ptr) AccessChain 31(data) 63 63 + 1527: 25(ivec4) Load 1526 + 1528: 169(bvec4) SLessThan 1527 752 + 1529: 17(ivec4) Load 19(ballot) + 1530: 169(bvec4) GroupNonUniformLogicalAnd 178 PartitionedInclusiveScanNV 1528 1529 + 1531: 25(ivec4) Select 1530 756 752 + 1532: 71(ptr) AccessChain 31(data) 1525 63 + Store 1532 1531 + 1533: 6(int) Load 8(invocation) + 1534: 64(ptr) AccessChain 31(data) 34 63 35 + 1535: 24(int) Load 1534 + 1536: 17(ivec4) Load 19(ballot) + 1537: 24(int) GroupNonUniformBitwiseOr 178 PartitionedInclusiveScanNV 1535 1536 + 1538: 64(ptr) AccessChain 31(data) 1533 63 35 + Store 1538 1537 + 1539: 6(int) Load 8(invocation) + 1540: 71(ptr) AccessChain 31(data) 63 63 + 1541: 25(ivec4) Load 1540 + 1542: 70(ivec2) VectorShuffle 1541 1541 0 1 + 1543: 17(ivec4) Load 19(ballot) + 1544: 70(ivec2) GroupNonUniformBitwiseOr 178 PartitionedInclusiveScanNV 1542 1543 + 1545: 71(ptr) AccessChain 31(data) 1539 63 + 1546: 25(ivec4) Load 1545 + 1547: 25(ivec4) VectorShuffle 1546 1544 4 5 2 3 + Store 1545 1547 + 1548: 6(int) Load 8(invocation) + 1549: 71(ptr) AccessChain 31(data) 33 63 + 1550: 25(ivec4) Load 1549 + 1551: 78(ivec3) VectorShuffle 1550 1550 0 1 2 + 1552: 17(ivec4) Load 19(ballot) + 1553: 78(ivec3) GroupNonUniformBitwiseOr 178 PartitionedInclusiveScanNV 1551 1552 + 1554: 71(ptr) AccessChain 31(data) 1548 63 + 1555: 25(ivec4) Load 1554 + 1556: 25(ivec4) VectorShuffle 1555 1553 4 5 6 3 + Store 1554 1556 + 1557: 6(int) Load 8(invocation) + 1558: 71(ptr) AccessChain 31(data) 115 63 + 1559: 25(ivec4) Load 1558 + 1560: 17(ivec4) Load 19(ballot) + 1561: 25(ivec4) GroupNonUniformBitwiseOr 178 PartitionedInclusiveScanNV 1559 1560 + 1562: 71(ptr) AccessChain 31(data) 1557 63 + Store 1562 1561 + 1563: 6(int) Load 8(invocation) + 1564: 90(ptr) AccessChain 31(data) 34 33 35 + 1565: 6(int) Load 1564 + 1566: 17(ivec4) Load 19(ballot) + 1567: 6(int) GroupNonUniformBitwiseOr 178 PartitionedInclusiveScanNV 1565 1566 + 1568: 90(ptr) AccessChain 31(data) 1563 33 35 + Store 1568 1567 + 1569: 6(int) Load 8(invocation) + 1570: 40(ptr) AccessChain 31(data) 63 33 + 1571: 17(ivec4) Load 1570 + 1572: 96(ivec2) VectorShuffle 1571 1571 0 1 + 1573: 17(ivec4) Load 19(ballot) + 1574: 96(ivec2) GroupNonUniformBitwiseOr 178 PartitionedInclusiveScanNV 1572 1573 + 1575: 40(ptr) AccessChain 31(data) 1569 33 + 1576: 17(ivec4) Load 1575 + 1577: 17(ivec4) VectorShuffle 1576 1574 4 5 2 3 + Store 1575 1577 + 1578: 6(int) Load 8(invocation) + 1579: 40(ptr) AccessChain 31(data) 33 33 + 1580: 17(ivec4) Load 1579 + 1581: 103(ivec3) VectorShuffle 1580 1580 0 1 2 + 1582: 17(ivec4) Load 19(ballot) + 1583: 103(ivec3) GroupNonUniformBitwiseOr 178 PartitionedInclusiveScanNV 1581 1582 + 1584: 40(ptr) AccessChain 31(data) 1578 33 + 1585: 17(ivec4) Load 1584 + 1586: 17(ivec4) VectorShuffle 1585 1583 4 5 6 3 + Store 1584 1586 + 1587: 6(int) Load 8(invocation) + 1588: 40(ptr) AccessChain 31(data) 115 33 + 1589: 17(ivec4) Load 1588 + 1590: 17(ivec4) Load 19(ballot) + 1591: 17(ivec4) GroupNonUniformBitwiseOr 178 PartitionedInclusiveScanNV 1589 1590 + 1592: 40(ptr) AccessChain 31(data) 1587 33 + Store 1592 1591 + 1593: 6(int) Load 8(invocation) + 1594: 64(ptr) AccessChain 31(data) 34 63 35 + 1595: 24(int) Load 1594 + 1596: 144(bool) SLessThan 1595 34 + 1597: 17(ivec4) Load 19(ballot) + 1598: 144(bool) GroupNonUniformLogicalOr 178 PartitionedInclusiveScanNV 1596 1597 + 1599: 24(int) Select 1598 63 34 + 1600: 64(ptr) AccessChain 31(data) 1593 63 35 + Store 1600 1599 + 1601: 6(int) Load 8(invocation) + 1602: 71(ptr) AccessChain 31(data) 63 63 + 1603: 25(ivec4) Load 1602 + 1604: 70(ivec2) VectorShuffle 1603 1603 0 1 + 1605: 152(bvec2) SLessThan 1604 727 + 1606: 17(ivec4) Load 19(ballot) + 1607: 152(bvec2) GroupNonUniformLogicalOr 178 PartitionedInclusiveScanNV 1605 1606 + 1608: 70(ivec2) Select 1607 731 727 + 1609: 71(ptr) AccessChain 31(data) 1601 63 + 1610: 25(ivec4) Load 1609 + 1611: 25(ivec4) VectorShuffle 1610 1608 4 5 2 3 + Store 1609 1611 + 1612: 6(int) Load 8(invocation) + 1613: 71(ptr) AccessChain 31(data) 63 63 + 1614: 25(ivec4) Load 1613 + 1615: 78(ivec3) VectorShuffle 1614 1614 0 1 2 + 1616: 161(bvec3) SLessThan 1615 740 + 1617: 17(ivec4) Load 19(ballot) + 1618: 161(bvec3) GroupNonUniformLogicalOr 178 PartitionedInclusiveScanNV 1616 1617 + 1619: 78(ivec3) Select 1618 744 740 + 1620: 71(ptr) AccessChain 31(data) 1612 63 + 1621: 25(ivec4) Load 1620 + 1622: 25(ivec4) VectorShuffle 1621 1619 4 5 6 3 + Store 1620 1622 + 1623: 6(int) Load 8(invocation) + 1624: 71(ptr) AccessChain 31(data) 63 63 + 1625: 25(ivec4) Load 1624 + 1626: 169(bvec4) SLessThan 1625 752 + 1627: 17(ivec4) Load 19(ballot) + 1628: 169(bvec4) GroupNonUniformLogicalOr 178 PartitionedInclusiveScanNV 1626 1627 + 1629: 25(ivec4) Select 1628 756 752 + 1630: 71(ptr) AccessChain 31(data) 1623 63 + Store 1630 1629 + 1631: 6(int) Load 8(invocation) + 1632: 64(ptr) AccessChain 31(data) 34 63 35 + 1633: 24(int) Load 1632 + 1634: 17(ivec4) Load 19(ballot) + 1635: 24(int) GroupNonUniformBitwiseXor 178 PartitionedInclusiveScanNV 1633 1634 + 1636: 64(ptr) AccessChain 31(data) 1631 63 35 + Store 1636 1635 + 1637: 6(int) Load 8(invocation) + 1638: 71(ptr) AccessChain 31(data) 63 63 + 1639: 25(ivec4) Load 1638 + 1640: 70(ivec2) VectorShuffle 1639 1639 0 1 + 1641: 17(ivec4) Load 19(ballot) + 1642: 70(ivec2) GroupNonUniformBitwiseXor 178 PartitionedInclusiveScanNV 1640 1641 + 1643: 71(ptr) AccessChain 31(data) 1637 63 + 1644: 25(ivec4) Load 1643 + 1645: 25(ivec4) VectorShuffle 1644 1642 4 5 2 3 + Store 1643 1645 + 1646: 6(int) Load 8(invocation) + 1647: 71(ptr) AccessChain 31(data) 33 63 + 1648: 25(ivec4) Load 1647 + 1649: 78(ivec3) VectorShuffle 1648 1648 0 1 2 + 1650: 17(ivec4) Load 19(ballot) + 1651: 78(ivec3) GroupNonUniformBitwiseXor 178 PartitionedInclusiveScanNV 1649 1650 + 1652: 71(ptr) AccessChain 31(data) 1646 63 + 1653: 25(ivec4) Load 1652 + 1654: 25(ivec4) VectorShuffle 1653 1651 4 5 6 3 + Store 1652 1654 + 1655: 6(int) Load 8(invocation) + 1656: 71(ptr) AccessChain 31(data) 115 63 + 1657: 25(ivec4) Load 1656 + 1658: 17(ivec4) Load 19(ballot) + 1659: 25(ivec4) GroupNonUniformBitwiseXor 178 PartitionedInclusiveScanNV 1657 1658 + 1660: 71(ptr) AccessChain 31(data) 1655 63 + Store 1660 1659 + 1661: 6(int) Load 8(invocation) + 1662: 90(ptr) AccessChain 31(data) 34 33 35 + 1663: 6(int) Load 1662 + 1664: 17(ivec4) Load 19(ballot) + 1665: 6(int) GroupNonUniformBitwiseXor 178 PartitionedInclusiveScanNV 1663 1664 + 1666: 90(ptr) AccessChain 31(data) 1661 33 35 + Store 1666 1665 + 1667: 6(int) Load 8(invocation) + 1668: 40(ptr) AccessChain 31(data) 63 33 + 1669: 17(ivec4) Load 1668 + 1670: 96(ivec2) VectorShuffle 1669 1669 0 1 + 1671: 17(ivec4) Load 19(ballot) + 1672: 96(ivec2) GroupNonUniformBitwiseXor 178 PartitionedInclusiveScanNV 1670 1671 + 1673: 40(ptr) AccessChain 31(data) 1667 33 + 1674: 17(ivec4) Load 1673 + 1675: 17(ivec4) VectorShuffle 1674 1672 4 5 2 3 + Store 1673 1675 + 1676: 6(int) Load 8(invocation) + 1677: 40(ptr) AccessChain 31(data) 33 33 + 1678: 17(ivec4) Load 1677 + 1679: 103(ivec3) VectorShuffle 1678 1678 0 1 2 + 1680: 17(ivec4) Load 19(ballot) + 1681: 103(ivec3) GroupNonUniformBitwiseXor 178 PartitionedInclusiveScanNV 1679 1680 + 1682: 40(ptr) AccessChain 31(data) 1676 33 + 1683: 17(ivec4) Load 1682 + 1684: 17(ivec4) VectorShuffle 1683 1681 4 5 6 3 + Store 1682 1684 + 1685: 6(int) Load 8(invocation) + 1686: 40(ptr) AccessChain 31(data) 115 33 + 1687: 17(ivec4) Load 1686 + 1688: 17(ivec4) Load 19(ballot) + 1689: 17(ivec4) GroupNonUniformBitwiseXor 178 PartitionedInclusiveScanNV 1687 1688 + 1690: 40(ptr) AccessChain 31(data) 1685 33 + Store 1690 1689 + 1691: 6(int) Load 8(invocation) + 1692: 64(ptr) AccessChain 31(data) 34 63 35 + 1693: 24(int) Load 1692 + 1694: 144(bool) SLessThan 1693 34 + 1695: 17(ivec4) Load 19(ballot) + 1696: 144(bool) GroupNonUniformLogicalXor 178 PartitionedInclusiveScanNV 1694 1695 + 1697: 24(int) Select 1696 63 34 + 1698: 64(ptr) AccessChain 31(data) 1691 63 35 + Store 1698 1697 + 1699: 6(int) Load 8(invocation) + 1700: 71(ptr) AccessChain 31(data) 63 63 + 1701: 25(ivec4) Load 1700 + 1702: 70(ivec2) VectorShuffle 1701 1701 0 1 + 1703: 152(bvec2) SLessThan 1702 727 + 1704: 17(ivec4) Load 19(ballot) + 1705: 152(bvec2) GroupNonUniformLogicalXor 178 PartitionedInclusiveScanNV 1703 1704 + 1706: 70(ivec2) Select 1705 731 727 + 1707: 71(ptr) AccessChain 31(data) 1699 63 + 1708: 25(ivec4) Load 1707 + 1709: 25(ivec4) VectorShuffle 1708 1706 4 5 2 3 + Store 1707 1709 + 1710: 6(int) Load 8(invocation) + 1711: 71(ptr) AccessChain 31(data) 63 63 + 1712: 25(ivec4) Load 1711 + 1713: 78(ivec3) VectorShuffle 1712 1712 0 1 2 + 1714: 161(bvec3) SLessThan 1713 740 + 1715: 17(ivec4) Load 19(ballot) + 1716: 161(bvec3) GroupNonUniformLogicalXor 178 PartitionedInclusiveScanNV 1714 1715 + 1717: 78(ivec3) Select 1716 744 740 + 1718: 71(ptr) AccessChain 31(data) 1710 63 + 1719: 25(ivec4) Load 1718 + 1720: 25(ivec4) VectorShuffle 1719 1717 4 5 6 3 + Store 1718 1720 + 1721: 6(int) Load 8(invocation) + 1722: 71(ptr) AccessChain 31(data) 63 63 + 1723: 25(ivec4) Load 1722 + 1724: 169(bvec4) SLessThan 1723 752 + 1725: 17(ivec4) Load 19(ballot) + 1726: 169(bvec4) GroupNonUniformLogicalXor 178 PartitionedInclusiveScanNV 1724 1725 + 1727: 25(ivec4) Select 1726 756 752 + 1728: 71(ptr) AccessChain 31(data) 1721 63 + Store 1728 1727 + 1729: 6(int) Load 8(invocation) + 1730: 36(ptr) AccessChain 31(data) 34 34 35 + 1731: 22(float) Load 1730 + 1732: 17(ivec4) Load 19(ballot) + 1733: 22(float) GroupNonUniformFAdd 178 PartitionedExclusiveScanNV 1731 1732 + 1734: 36(ptr) AccessChain 31(data) 1729 34 35 + Store 1734 1733 + 1735: 6(int) Load 8(invocation) + 1736: 44(ptr) AccessChain 31(data) 63 34 + 1737: 23(fvec4) Load 1736 + 1738: 43(fvec2) VectorShuffle 1737 1737 0 1 + 1739: 17(ivec4) Load 19(ballot) + 1740: 43(fvec2) GroupNonUniformFAdd 178 PartitionedExclusiveScanNV 1738 1739 + 1741: 44(ptr) AccessChain 31(data) 1735 34 + 1742: 23(fvec4) Load 1741 + 1743: 23(fvec4) VectorShuffle 1742 1740 4 5 2 3 + Store 1741 1743 + 1744: 6(int) Load 8(invocation) + 1745: 44(ptr) AccessChain 31(data) 33 34 + 1746: 23(fvec4) Load 1745 + 1747: 51(fvec3) VectorShuffle 1746 1746 0 1 2 + 1748: 17(ivec4) Load 19(ballot) + 1749: 51(fvec3) GroupNonUniformFAdd 178 PartitionedExclusiveScanNV 1747 1748 + 1750: 44(ptr) AccessChain 31(data) 1744 34 + 1751: 23(fvec4) Load 1750 + 1752: 23(fvec4) VectorShuffle 1751 1749 4 5 6 3 + Store 1750 1752 + 1753: 6(int) Load 8(invocation) + 1754: 44(ptr) AccessChain 31(data) 115 34 + 1755: 23(fvec4) Load 1754 + 1756: 17(ivec4) Load 19(ballot) + 1757: 23(fvec4) GroupNonUniformFAdd 178 PartitionedExclusiveScanNV 1755 1756 + 1758: 44(ptr) AccessChain 31(data) 1753 34 + Store 1758 1757 + 1759: 6(int) Load 8(invocation) + 1760: 64(ptr) AccessChain 31(data) 34 63 35 + 1761: 24(int) Load 1760 + 1762: 17(ivec4) Load 19(ballot) + 1763: 24(int) GroupNonUniformIAdd 178 PartitionedExclusiveScanNV 1761 1762 + 1764: 64(ptr) AccessChain 31(data) 1759 63 35 + Store 1764 1763 + 1765: 6(int) Load 8(invocation) + 1766: 71(ptr) AccessChain 31(data) 63 63 + 1767: 25(ivec4) Load 1766 + 1768: 70(ivec2) VectorShuffle 1767 1767 0 1 + 1769: 17(ivec4) Load 19(ballot) + 1770: 70(ivec2) GroupNonUniformIAdd 178 PartitionedExclusiveScanNV 1768 1769 + 1771: 71(ptr) AccessChain 31(data) 1765 63 + 1772: 25(ivec4) Load 1771 + 1773: 25(ivec4) VectorShuffle 1772 1770 4 5 2 3 + Store 1771 1773 + 1774: 6(int) Load 8(invocation) + 1775: 71(ptr) AccessChain 31(data) 33 63 + 1776: 25(ivec4) Load 1775 + 1777: 78(ivec3) VectorShuffle 1776 1776 0 1 2 + 1778: 17(ivec4) Load 19(ballot) + 1779: 78(ivec3) GroupNonUniformIAdd 178 PartitionedExclusiveScanNV 1777 1778 + 1780: 71(ptr) AccessChain 31(data) 1774 63 + 1781: 25(ivec4) Load 1780 + 1782: 25(ivec4) VectorShuffle 1781 1779 4 5 6 3 + Store 1780 1782 + 1783: 6(int) Load 8(invocation) + 1784: 71(ptr) AccessChain 31(data) 115 63 + 1785: 25(ivec4) Load 1784 + 1786: 17(ivec4) Load 19(ballot) + 1787: 25(ivec4) GroupNonUniformIAdd 178 PartitionedExclusiveScanNV 1785 1786 + 1788: 71(ptr) AccessChain 31(data) 1783 63 + Store 1788 1787 + 1789: 6(int) Load 8(invocation) + 1790: 90(ptr) AccessChain 31(data) 34 33 35 + 1791: 6(int) Load 1790 + 1792: 17(ivec4) Load 19(ballot) + 1793: 6(int) GroupNonUniformIAdd 178 PartitionedExclusiveScanNV 1791 1792 + 1794: 90(ptr) AccessChain 31(data) 1789 33 35 + Store 1794 1793 + 1795: 6(int) Load 8(invocation) + 1796: 40(ptr) AccessChain 31(data) 63 33 + 1797: 17(ivec4) Load 1796 + 1798: 96(ivec2) VectorShuffle 1797 1797 0 1 + 1799: 17(ivec4) Load 19(ballot) + 1800: 96(ivec2) GroupNonUniformIAdd 178 PartitionedExclusiveScanNV 1798 1799 + 1801: 40(ptr) AccessChain 31(data) 1795 33 + 1802: 17(ivec4) Load 1801 + 1803: 17(ivec4) VectorShuffle 1802 1800 4 5 2 3 + Store 1801 1803 + 1804: 6(int) Load 8(invocation) + 1805: 40(ptr) AccessChain 31(data) 33 33 + 1806: 17(ivec4) Load 1805 + 1807: 103(ivec3) VectorShuffle 1806 1806 0 1 2 + 1808: 17(ivec4) Load 19(ballot) + 1809: 103(ivec3) GroupNonUniformIAdd 178 PartitionedExclusiveScanNV 1807 1808 + 1810: 40(ptr) AccessChain 31(data) 1804 33 + 1811: 17(ivec4) Load 1810 + 1812: 17(ivec4) VectorShuffle 1811 1809 4 5 6 3 + Store 1810 1812 + 1813: 6(int) Load 8(invocation) + 1814: 40(ptr) AccessChain 31(data) 115 33 + 1815: 17(ivec4) Load 1814 + 1816: 17(ivec4) Load 19(ballot) + 1817: 17(ivec4) GroupNonUniformIAdd 178 PartitionedExclusiveScanNV 1815 1816 + 1818: 40(ptr) AccessChain 31(data) 1813 33 + Store 1818 1817 + 1819: 6(int) Load 8(invocation) + 1820: 116(ptr) AccessChain 31(data) 34 115 35 + 1821:26(float64_t) Load 1820 + 1822: 17(ivec4) Load 19(ballot) + 1823:26(float64_t) GroupNonUniformFAdd 178 PartitionedExclusiveScanNV 1821 1822 + 1824: 116(ptr) AccessChain 31(data) 1819 115 35 + Store 1824 1823 + 1825: 6(int) Load 8(invocation) + 1826: 123(ptr) AccessChain 31(data) 63 115 + 1827: 27(f64vec4) Load 1826 + 1828:122(f64vec2) VectorShuffle 1827 1827 0 1 + 1829: 17(ivec4) Load 19(ballot) + 1830:122(f64vec2) GroupNonUniformFAdd 178 PartitionedExclusiveScanNV 1828 1829 + 1831: 123(ptr) AccessChain 31(data) 1825 115 + 1832: 27(f64vec4) Load 1831 + 1833: 27(f64vec4) VectorShuffle 1832 1830 4 5 2 3 + Store 1831 1833 + 1834: 6(int) Load 8(invocation) + 1835: 123(ptr) AccessChain 31(data) 33 115 + 1836: 27(f64vec4) Load 1835 + 1837:130(f64vec3) VectorShuffle 1836 1836 0 1 2 + 1838: 17(ivec4) Load 19(ballot) + 1839:130(f64vec3) GroupNonUniformFAdd 178 PartitionedExclusiveScanNV 1837 1838 + 1840: 123(ptr) AccessChain 31(data) 1834 115 + 1841: 27(f64vec4) Load 1840 + 1842: 27(f64vec4) VectorShuffle 1841 1839 4 5 6 3 + Store 1840 1842 + 1843: 6(int) Load 8(invocation) + 1844: 123(ptr) AccessChain 31(data) 115 115 + 1845: 27(f64vec4) Load 1844 + 1846: 17(ivec4) Load 19(ballot) + 1847: 27(f64vec4) GroupNonUniformFAdd 178 PartitionedExclusiveScanNV 1845 1846 + 1848: 123(ptr) AccessChain 31(data) 1843 115 + Store 1848 1847 + 1849: 6(int) Load 8(invocation) + 1850: 36(ptr) AccessChain 31(data) 34 34 35 + 1851: 22(float) Load 1850 + 1852: 17(ivec4) Load 19(ballot) + 1853: 22(float) GroupNonUniformFMul 178 PartitionedExclusiveScanNV 1851 1852 + 1854: 36(ptr) AccessChain 31(data) 1849 34 35 + Store 1854 1853 + 1855: 6(int) Load 8(invocation) + 1856: 44(ptr) AccessChain 31(data) 63 34 + 1857: 23(fvec4) Load 1856 + 1858: 43(fvec2) VectorShuffle 1857 1857 0 1 + 1859: 17(ivec4) Load 19(ballot) + 1860: 43(fvec2) GroupNonUniformFMul 178 PartitionedExclusiveScanNV 1858 1859 + 1861: 44(ptr) AccessChain 31(data) 1855 34 + 1862: 23(fvec4) Load 1861 + 1863: 23(fvec4) VectorShuffle 1862 1860 4 5 2 3 + Store 1861 1863 + 1864: 6(int) Load 8(invocation) + 1865: 44(ptr) AccessChain 31(data) 33 34 + 1866: 23(fvec4) Load 1865 + 1867: 51(fvec3) VectorShuffle 1866 1866 0 1 2 + 1868: 17(ivec4) Load 19(ballot) + 1869: 51(fvec3) GroupNonUniformFMul 178 PartitionedExclusiveScanNV 1867 1868 + 1870: 44(ptr) AccessChain 31(data) 1864 34 + 1871: 23(fvec4) Load 1870 + 1872: 23(fvec4) VectorShuffle 1871 1869 4 5 6 3 + Store 1870 1872 + 1873: 6(int) Load 8(invocation) + 1874: 44(ptr) AccessChain 31(data) 115 34 + 1875: 23(fvec4) Load 1874 + 1876: 17(ivec4) Load 19(ballot) + 1877: 23(fvec4) GroupNonUniformFMul 178 PartitionedExclusiveScanNV 1875 1876 + 1878: 44(ptr) AccessChain 31(data) 1873 34 + Store 1878 1877 + 1879: 6(int) Load 8(invocation) + 1880: 64(ptr) AccessChain 31(data) 34 63 35 + 1881: 24(int) Load 1880 + 1882: 17(ivec4) Load 19(ballot) + 1883: 24(int) GroupNonUniformIMul 178 PartitionedExclusiveScanNV 1881 1882 + 1884: 64(ptr) AccessChain 31(data) 1879 63 35 + Store 1884 1883 + 1885: 6(int) Load 8(invocation) + 1886: 71(ptr) AccessChain 31(data) 63 63 + 1887: 25(ivec4) Load 1886 + 1888: 70(ivec2) VectorShuffle 1887 1887 0 1 + 1889: 17(ivec4) Load 19(ballot) + 1890: 70(ivec2) GroupNonUniformIMul 178 PartitionedExclusiveScanNV 1888 1889 + 1891: 71(ptr) AccessChain 31(data) 1885 63 + 1892: 25(ivec4) Load 1891 + 1893: 25(ivec4) VectorShuffle 1892 1890 4 5 2 3 + Store 1891 1893 + 1894: 6(int) Load 8(invocation) + 1895: 71(ptr) AccessChain 31(data) 33 63 + 1896: 25(ivec4) Load 1895 + 1897: 78(ivec3) VectorShuffle 1896 1896 0 1 2 + 1898: 17(ivec4) Load 19(ballot) + 1899: 78(ivec3) GroupNonUniformIMul 178 PartitionedExclusiveScanNV 1897 1898 + 1900: 71(ptr) AccessChain 31(data) 1894 63 + 1901: 25(ivec4) Load 1900 + 1902: 25(ivec4) VectorShuffle 1901 1899 4 5 6 3 + Store 1900 1902 + 1903: 6(int) Load 8(invocation) + 1904: 71(ptr) AccessChain 31(data) 115 63 + 1905: 25(ivec4) Load 1904 + 1906: 17(ivec4) Load 19(ballot) + 1907: 25(ivec4) GroupNonUniformIMul 178 PartitionedExclusiveScanNV 1905 1906 + 1908: 71(ptr) AccessChain 31(data) 1903 63 + Store 1908 1907 + 1909: 6(int) Load 8(invocation) + 1910: 90(ptr) AccessChain 31(data) 34 33 35 + 1911: 6(int) Load 1910 + 1912: 17(ivec4) Load 19(ballot) + 1913: 6(int) GroupNonUniformIMul 178 PartitionedExclusiveScanNV 1911 1912 + 1914: 90(ptr) AccessChain 31(data) 1909 33 35 + Store 1914 1913 + 1915: 6(int) Load 8(invocation) + 1916: 40(ptr) AccessChain 31(data) 63 33 + 1917: 17(ivec4) Load 1916 + 1918: 96(ivec2) VectorShuffle 1917 1917 0 1 + 1919: 17(ivec4) Load 19(ballot) + 1920: 96(ivec2) GroupNonUniformIMul 178 PartitionedExclusiveScanNV 1918 1919 + 1921: 40(ptr) AccessChain 31(data) 1915 33 + 1922: 17(ivec4) Load 1921 + 1923: 17(ivec4) VectorShuffle 1922 1920 4 5 2 3 + Store 1921 1923 + 1924: 6(int) Load 8(invocation) + 1925: 40(ptr) AccessChain 31(data) 33 33 + 1926: 17(ivec4) Load 1925 + 1927: 103(ivec3) VectorShuffle 1926 1926 0 1 2 + 1928: 17(ivec4) Load 19(ballot) + 1929: 103(ivec3) GroupNonUniformIMul 178 PartitionedExclusiveScanNV 1927 1928 + 1930: 40(ptr) AccessChain 31(data) 1924 33 + 1931: 17(ivec4) Load 1930 + 1932: 17(ivec4) VectorShuffle 1931 1929 4 5 6 3 + Store 1930 1932 + 1933: 6(int) Load 8(invocation) + 1934: 40(ptr) AccessChain 31(data) 115 33 + 1935: 17(ivec4) Load 1934 + 1936: 17(ivec4) Load 19(ballot) + 1937: 17(ivec4) GroupNonUniformIMul 178 PartitionedExclusiveScanNV 1935 1936 + 1938: 40(ptr) AccessChain 31(data) 1933 33 + Store 1938 1937 + 1939: 6(int) Load 8(invocation) + 1940: 116(ptr) AccessChain 31(data) 34 115 35 + 1941:26(float64_t) Load 1940 + 1942: 17(ivec4) Load 19(ballot) + 1943:26(float64_t) GroupNonUniformFMul 178 PartitionedExclusiveScanNV 1941 1942 + 1944: 116(ptr) AccessChain 31(data) 1939 115 35 + Store 1944 1943 + 1945: 6(int) Load 8(invocation) + 1946: 123(ptr) AccessChain 31(data) 63 115 + 1947: 27(f64vec4) Load 1946 + 1948:122(f64vec2) VectorShuffle 1947 1947 0 1 + 1949: 17(ivec4) Load 19(ballot) + 1950:122(f64vec2) GroupNonUniformFMul 178 PartitionedExclusiveScanNV 1948 1949 + 1951: 123(ptr) AccessChain 31(data) 1945 115 + 1952: 27(f64vec4) Load 1951 + 1953: 27(f64vec4) VectorShuffle 1952 1950 4 5 2 3 + Store 1951 1953 + 1954: 6(int) Load 8(invocation) + 1955: 123(ptr) AccessChain 31(data) 33 115 + 1956: 27(f64vec4) Load 1955 + 1957:130(f64vec3) VectorShuffle 1956 1956 0 1 2 + 1958: 17(ivec4) Load 19(ballot) + 1959:130(f64vec3) GroupNonUniformFMul 178 PartitionedExclusiveScanNV 1957 1958 + 1960: 123(ptr) AccessChain 31(data) 1954 115 + 1961: 27(f64vec4) Load 1960 + 1962: 27(f64vec4) VectorShuffle 1961 1959 4 5 6 3 + Store 1960 1962 + 1963: 6(int) Load 8(invocation) + 1964: 123(ptr) AccessChain 31(data) 115 115 + 1965: 27(f64vec4) Load 1964 + 1966: 17(ivec4) Load 19(ballot) + 1967: 27(f64vec4) GroupNonUniformFMul 178 PartitionedExclusiveScanNV 1965 1966 + 1968: 123(ptr) AccessChain 31(data) 1963 115 + Store 1968 1967 + 1969: 6(int) Load 8(invocation) + 1970: 36(ptr) AccessChain 31(data) 34 34 35 + 1971: 22(float) Load 1970 + 1972: 17(ivec4) Load 19(ballot) + 1973: 22(float) GroupNonUniformFMin 178 PartitionedExclusiveScanNV 1971 1972 + 1974: 36(ptr) AccessChain 31(data) 1969 34 35 + Store 1974 1973 + 1975: 6(int) Load 8(invocation) + 1976: 44(ptr) AccessChain 31(data) 63 34 + 1977: 23(fvec4) Load 1976 + 1978: 43(fvec2) VectorShuffle 1977 1977 0 1 + 1979: 17(ivec4) Load 19(ballot) + 1980: 43(fvec2) GroupNonUniformFMin 178 PartitionedExclusiveScanNV 1978 1979 + 1981: 44(ptr) AccessChain 31(data) 1975 34 + 1982: 23(fvec4) Load 1981 + 1983: 23(fvec4) VectorShuffle 1982 1980 4 5 2 3 + Store 1981 1983 + 1984: 6(int) Load 8(invocation) + 1985: 44(ptr) AccessChain 31(data) 33 34 + 1986: 23(fvec4) Load 1985 + 1987: 51(fvec3) VectorShuffle 1986 1986 0 1 2 + 1988: 17(ivec4) Load 19(ballot) + 1989: 51(fvec3) GroupNonUniformFMin 178 PartitionedExclusiveScanNV 1987 1988 + 1990: 44(ptr) AccessChain 31(data) 1984 34 + 1991: 23(fvec4) Load 1990 + 1992: 23(fvec4) VectorShuffle 1991 1989 4 5 6 3 + Store 1990 1992 + 1993: 6(int) Load 8(invocation) + 1994: 44(ptr) AccessChain 31(data) 115 34 + 1995: 23(fvec4) Load 1994 + 1996: 17(ivec4) Load 19(ballot) + 1997: 23(fvec4) GroupNonUniformFMin 178 PartitionedExclusiveScanNV 1995 1996 + 1998: 44(ptr) AccessChain 31(data) 1993 34 + Store 1998 1997 + 1999: 6(int) Load 8(invocation) + 2000: 64(ptr) AccessChain 31(data) 34 63 35 + 2001: 24(int) Load 2000 + 2002: 17(ivec4) Load 19(ballot) + 2003: 24(int) GroupNonUniformSMin 178 PartitionedExclusiveScanNV 2001 2002 + 2004: 64(ptr) AccessChain 31(data) 1999 63 35 + Store 2004 2003 + 2005: 6(int) Load 8(invocation) + 2006: 71(ptr) AccessChain 31(data) 63 63 + 2007: 25(ivec4) Load 2006 + 2008: 70(ivec2) VectorShuffle 2007 2007 0 1 + 2009: 17(ivec4) Load 19(ballot) + 2010: 70(ivec2) GroupNonUniformSMin 178 PartitionedExclusiveScanNV 2008 2009 + 2011: 71(ptr) AccessChain 31(data) 2005 63 + 2012: 25(ivec4) Load 2011 + 2013: 25(ivec4) VectorShuffle 2012 2010 4 5 2 3 + Store 2011 2013 + 2014: 6(int) Load 8(invocation) + 2015: 71(ptr) AccessChain 31(data) 33 63 + 2016: 25(ivec4) Load 2015 + 2017: 78(ivec3) VectorShuffle 2016 2016 0 1 2 + 2018: 17(ivec4) Load 19(ballot) + 2019: 78(ivec3) GroupNonUniformSMin 178 PartitionedExclusiveScanNV 2017 2018 + 2020: 71(ptr) AccessChain 31(data) 2014 63 + 2021: 25(ivec4) Load 2020 + 2022: 25(ivec4) VectorShuffle 2021 2019 4 5 6 3 + Store 2020 2022 + 2023: 6(int) Load 8(invocation) + 2024: 71(ptr) AccessChain 31(data) 115 63 + 2025: 25(ivec4) Load 2024 + 2026: 17(ivec4) Load 19(ballot) + 2027: 25(ivec4) GroupNonUniformSMin 178 PartitionedExclusiveScanNV 2025 2026 + 2028: 71(ptr) AccessChain 31(data) 2023 63 + Store 2028 2027 + 2029: 6(int) Load 8(invocation) + 2030: 90(ptr) AccessChain 31(data) 34 33 35 + 2031: 6(int) Load 2030 + 2032: 17(ivec4) Load 19(ballot) + 2033: 6(int) GroupNonUniformUMin 178 PartitionedExclusiveScanNV 2031 2032 + 2034: 90(ptr) AccessChain 31(data) 2029 33 35 + Store 2034 2033 + 2035: 6(int) Load 8(invocation) + 2036: 40(ptr) AccessChain 31(data) 63 33 + 2037: 17(ivec4) Load 2036 + 2038: 96(ivec2) VectorShuffle 2037 2037 0 1 + 2039: 17(ivec4) Load 19(ballot) + 2040: 96(ivec2) GroupNonUniformUMin 178 PartitionedExclusiveScanNV 2038 2039 + 2041: 40(ptr) AccessChain 31(data) 2035 33 + 2042: 17(ivec4) Load 2041 + 2043: 17(ivec4) VectorShuffle 2042 2040 4 5 2 3 + Store 2041 2043 + 2044: 6(int) Load 8(invocation) + 2045: 40(ptr) AccessChain 31(data) 33 33 + 2046: 17(ivec4) Load 2045 + 2047: 103(ivec3) VectorShuffle 2046 2046 0 1 2 + 2048: 17(ivec4) Load 19(ballot) + 2049: 103(ivec3) GroupNonUniformUMin 178 PartitionedExclusiveScanNV 2047 2048 + 2050: 40(ptr) AccessChain 31(data) 2044 33 + 2051: 17(ivec4) Load 2050 + 2052: 17(ivec4) VectorShuffle 2051 2049 4 5 6 3 + Store 2050 2052 + 2053: 6(int) Load 8(invocation) + 2054: 40(ptr) AccessChain 31(data) 115 33 + 2055: 17(ivec4) Load 2054 + 2056: 17(ivec4) Load 19(ballot) + 2057: 17(ivec4) GroupNonUniformUMin 178 PartitionedExclusiveScanNV 2055 2056 + 2058: 40(ptr) AccessChain 31(data) 2053 33 + Store 2058 2057 + 2059: 6(int) Load 8(invocation) + 2060: 116(ptr) AccessChain 31(data) 34 115 35 + 2061:26(float64_t) Load 2060 + 2062: 17(ivec4) Load 19(ballot) + 2063:26(float64_t) GroupNonUniformFMin 178 PartitionedExclusiveScanNV 2061 2062 + 2064: 116(ptr) AccessChain 31(data) 2059 115 35 + Store 2064 2063 + 2065: 6(int) Load 8(invocation) + 2066: 123(ptr) AccessChain 31(data) 63 115 + 2067: 27(f64vec4) Load 2066 + 2068:122(f64vec2) VectorShuffle 2067 2067 0 1 + 2069: 17(ivec4) Load 19(ballot) + 2070:122(f64vec2) GroupNonUniformFMin 178 PartitionedExclusiveScanNV 2068 2069 + 2071: 123(ptr) AccessChain 31(data) 2065 115 + 2072: 27(f64vec4) Load 2071 + 2073: 27(f64vec4) VectorShuffle 2072 2070 4 5 2 3 + Store 2071 2073 + 2074: 6(int) Load 8(invocation) + 2075: 123(ptr) AccessChain 31(data) 33 115 + 2076: 27(f64vec4) Load 2075 + 2077:130(f64vec3) VectorShuffle 2076 2076 0 1 2 + 2078: 17(ivec4) Load 19(ballot) + 2079:130(f64vec3) GroupNonUniformFMin 178 PartitionedExclusiveScanNV 2077 2078 + 2080: 123(ptr) AccessChain 31(data) 2074 115 + 2081: 27(f64vec4) Load 2080 + 2082: 27(f64vec4) VectorShuffle 2081 2079 4 5 6 3 + Store 2080 2082 + 2083: 6(int) Load 8(invocation) + 2084: 123(ptr) AccessChain 31(data) 115 115 + 2085: 27(f64vec4) Load 2084 + 2086: 17(ivec4) Load 19(ballot) + 2087: 27(f64vec4) GroupNonUniformFMin 178 PartitionedExclusiveScanNV 2085 2086 + 2088: 123(ptr) AccessChain 31(data) 2083 115 + Store 2088 2087 + 2089: 6(int) Load 8(invocation) + 2090: 36(ptr) AccessChain 31(data) 34 34 35 + 2091: 22(float) Load 2090 + 2092: 17(ivec4) Load 19(ballot) + 2093: 22(float) GroupNonUniformFMax 178 PartitionedExclusiveScanNV 2091 2092 + 2094: 36(ptr) AccessChain 31(data) 2089 34 35 + Store 2094 2093 + 2095: 6(int) Load 8(invocation) + 2096: 44(ptr) AccessChain 31(data) 63 34 + 2097: 23(fvec4) Load 2096 + 2098: 43(fvec2) VectorShuffle 2097 2097 0 1 + 2099: 17(ivec4) Load 19(ballot) + 2100: 43(fvec2) GroupNonUniformFMax 178 PartitionedExclusiveScanNV 2098 2099 + 2101: 44(ptr) AccessChain 31(data) 2095 34 + 2102: 23(fvec4) Load 2101 + 2103: 23(fvec4) VectorShuffle 2102 2100 4 5 2 3 + Store 2101 2103 + 2104: 6(int) Load 8(invocation) + 2105: 44(ptr) AccessChain 31(data) 33 34 + 2106: 23(fvec4) Load 2105 + 2107: 51(fvec3) VectorShuffle 2106 2106 0 1 2 + 2108: 17(ivec4) Load 19(ballot) + 2109: 51(fvec3) GroupNonUniformFMax 178 PartitionedExclusiveScanNV 2107 2108 + 2110: 44(ptr) AccessChain 31(data) 2104 34 + 2111: 23(fvec4) Load 2110 + 2112: 23(fvec4) VectorShuffle 2111 2109 4 5 6 3 + Store 2110 2112 + 2113: 6(int) Load 8(invocation) + 2114: 44(ptr) AccessChain 31(data) 115 34 + 2115: 23(fvec4) Load 2114 + 2116: 17(ivec4) Load 19(ballot) + 2117: 23(fvec4) GroupNonUniformFMax 178 PartitionedExclusiveScanNV 2115 2116 + 2118: 44(ptr) AccessChain 31(data) 2113 34 + Store 2118 2117 + 2119: 6(int) Load 8(invocation) + 2120: 64(ptr) AccessChain 31(data) 34 63 35 + 2121: 24(int) Load 2120 + 2122: 17(ivec4) Load 19(ballot) + 2123: 24(int) GroupNonUniformSMax 178 PartitionedExclusiveScanNV 2121 2122 + 2124: 64(ptr) AccessChain 31(data) 2119 63 35 + Store 2124 2123 + 2125: 6(int) Load 8(invocation) + 2126: 71(ptr) AccessChain 31(data) 63 63 + 2127: 25(ivec4) Load 2126 + 2128: 70(ivec2) VectorShuffle 2127 2127 0 1 + 2129: 17(ivec4) Load 19(ballot) + 2130: 70(ivec2) GroupNonUniformSMax 178 PartitionedExclusiveScanNV 2128 2129 + 2131: 71(ptr) AccessChain 31(data) 2125 63 + 2132: 25(ivec4) Load 2131 + 2133: 25(ivec4) VectorShuffle 2132 2130 4 5 2 3 + Store 2131 2133 + 2134: 6(int) Load 8(invocation) + 2135: 71(ptr) AccessChain 31(data) 33 63 + 2136: 25(ivec4) Load 2135 + 2137: 78(ivec3) VectorShuffle 2136 2136 0 1 2 + 2138: 17(ivec4) Load 19(ballot) + 2139: 78(ivec3) GroupNonUniformSMax 178 PartitionedExclusiveScanNV 2137 2138 + 2140: 71(ptr) AccessChain 31(data) 2134 63 + 2141: 25(ivec4) Load 2140 + 2142: 25(ivec4) VectorShuffle 2141 2139 4 5 6 3 + Store 2140 2142 + 2143: 6(int) Load 8(invocation) + 2144: 71(ptr) AccessChain 31(data) 115 63 + 2145: 25(ivec4) Load 2144 + 2146: 17(ivec4) Load 19(ballot) + 2147: 25(ivec4) GroupNonUniformSMax 178 PartitionedExclusiveScanNV 2145 2146 + 2148: 71(ptr) AccessChain 31(data) 2143 63 + Store 2148 2147 + 2149: 6(int) Load 8(invocation) + 2150: 90(ptr) AccessChain 31(data) 34 33 35 + 2151: 6(int) Load 2150 + 2152: 17(ivec4) Load 19(ballot) + 2153: 6(int) GroupNonUniformUMax 178 PartitionedExclusiveScanNV 2151 2152 + 2154: 90(ptr) AccessChain 31(data) 2149 33 35 + Store 2154 2153 + 2155: 6(int) Load 8(invocation) + 2156: 40(ptr) AccessChain 31(data) 63 33 + 2157: 17(ivec4) Load 2156 + 2158: 96(ivec2) VectorShuffle 2157 2157 0 1 + 2159: 17(ivec4) Load 19(ballot) + 2160: 96(ivec2) GroupNonUniformUMax 178 PartitionedExclusiveScanNV 2158 2159 + 2161: 40(ptr) AccessChain 31(data) 2155 33 + 2162: 17(ivec4) Load 2161 + 2163: 17(ivec4) VectorShuffle 2162 2160 4 5 2 3 + Store 2161 2163 + 2164: 6(int) Load 8(invocation) + 2165: 40(ptr) AccessChain 31(data) 33 33 + 2166: 17(ivec4) Load 2165 + 2167: 103(ivec3) VectorShuffle 2166 2166 0 1 2 + 2168: 17(ivec4) Load 19(ballot) + 2169: 103(ivec3) GroupNonUniformUMax 178 PartitionedExclusiveScanNV 2167 2168 + 2170: 40(ptr) AccessChain 31(data) 2164 33 + 2171: 17(ivec4) Load 2170 + 2172: 17(ivec4) VectorShuffle 2171 2169 4 5 6 3 + Store 2170 2172 + 2173: 6(int) Load 8(invocation) + 2174: 40(ptr) AccessChain 31(data) 115 33 + 2175: 17(ivec4) Load 2174 + 2176: 17(ivec4) Load 19(ballot) + 2177: 17(ivec4) GroupNonUniformUMax 178 PartitionedExclusiveScanNV 2175 2176 + 2178: 40(ptr) AccessChain 31(data) 2173 33 + Store 2178 2177 + 2179: 6(int) Load 8(invocation) + 2180: 116(ptr) AccessChain 31(data) 34 115 35 + 2181:26(float64_t) Load 2180 + 2182: 17(ivec4) Load 19(ballot) + 2183:26(float64_t) GroupNonUniformFMax 178 PartitionedExclusiveScanNV 2181 2182 + 2184: 116(ptr) AccessChain 31(data) 2179 115 35 + Store 2184 2183 + 2185: 6(int) Load 8(invocation) + 2186: 123(ptr) AccessChain 31(data) 63 115 + 2187: 27(f64vec4) Load 2186 + 2188:122(f64vec2) VectorShuffle 2187 2187 0 1 + 2189: 17(ivec4) Load 19(ballot) + 2190:122(f64vec2) GroupNonUniformFMax 178 PartitionedExclusiveScanNV 2188 2189 + 2191: 123(ptr) AccessChain 31(data) 2185 115 + 2192: 27(f64vec4) Load 2191 + 2193: 27(f64vec4) VectorShuffle 2192 2190 4 5 2 3 + Store 2191 2193 + 2194: 6(int) Load 8(invocation) + 2195: 123(ptr) AccessChain 31(data) 33 115 + 2196: 27(f64vec4) Load 2195 + 2197:130(f64vec3) VectorShuffle 2196 2196 0 1 2 + 2198: 17(ivec4) Load 19(ballot) + 2199:130(f64vec3) GroupNonUniformFMax 178 PartitionedExclusiveScanNV 2197 2198 + 2200: 123(ptr) AccessChain 31(data) 2194 115 + 2201: 27(f64vec4) Load 2200 + 2202: 27(f64vec4) VectorShuffle 2201 2199 4 5 6 3 + Store 2200 2202 + 2203: 6(int) Load 8(invocation) + 2204: 123(ptr) AccessChain 31(data) 115 115 + 2205: 27(f64vec4) Load 2204 + 2206: 17(ivec4) Load 19(ballot) + 2207: 27(f64vec4) GroupNonUniformFMax 178 PartitionedExclusiveScanNV 2205 2206 + 2208: 123(ptr) AccessChain 31(data) 2203 115 + Store 2208 2207 + 2209: 6(int) Load 8(invocation) + 2210: 64(ptr) AccessChain 31(data) 34 63 35 + 2211: 24(int) Load 2210 + 2212: 17(ivec4) Load 19(ballot) + 2213: 24(int) GroupNonUniformBitwiseAnd 178 PartitionedExclusiveScanNV 2211 2212 + 2214: 64(ptr) AccessChain 31(data) 2209 63 35 + Store 2214 2213 + 2215: 6(int) Load 8(invocation) + 2216: 71(ptr) AccessChain 31(data) 63 63 + 2217: 25(ivec4) Load 2216 + 2218: 70(ivec2) VectorShuffle 2217 2217 0 1 + 2219: 17(ivec4) Load 19(ballot) + 2220: 70(ivec2) GroupNonUniformBitwiseAnd 178 PartitionedExclusiveScanNV 2218 2219 + 2221: 71(ptr) AccessChain 31(data) 2215 63 + 2222: 25(ivec4) Load 2221 + 2223: 25(ivec4) VectorShuffle 2222 2220 4 5 2 3 + Store 2221 2223 + 2224: 6(int) Load 8(invocation) + 2225: 71(ptr) AccessChain 31(data) 33 63 + 2226: 25(ivec4) Load 2225 + 2227: 78(ivec3) VectorShuffle 2226 2226 0 1 2 + 2228: 17(ivec4) Load 19(ballot) + 2229: 78(ivec3) GroupNonUniformBitwiseAnd 178 PartitionedExclusiveScanNV 2227 2228 + 2230: 71(ptr) AccessChain 31(data) 2224 63 + 2231: 25(ivec4) Load 2230 + 2232: 25(ivec4) VectorShuffle 2231 2229 4 5 6 3 + Store 2230 2232 + 2233: 6(int) Load 8(invocation) + 2234: 71(ptr) AccessChain 31(data) 115 63 + 2235: 25(ivec4) Load 2234 + 2236: 17(ivec4) Load 19(ballot) + 2237: 25(ivec4) GroupNonUniformBitwiseAnd 178 PartitionedExclusiveScanNV 2235 2236 + 2238: 71(ptr) AccessChain 31(data) 2233 63 + Store 2238 2237 + 2239: 6(int) Load 8(invocation) + 2240: 90(ptr) AccessChain 31(data) 34 33 35 + 2241: 6(int) Load 2240 + 2242: 17(ivec4) Load 19(ballot) + 2243: 6(int) GroupNonUniformBitwiseAnd 178 PartitionedExclusiveScanNV 2241 2242 + 2244: 90(ptr) AccessChain 31(data) 2239 33 35 + Store 2244 2243 + 2245: 6(int) Load 8(invocation) + 2246: 40(ptr) AccessChain 31(data) 63 33 + 2247: 17(ivec4) Load 2246 + 2248: 96(ivec2) VectorShuffle 2247 2247 0 1 + 2249: 17(ivec4) Load 19(ballot) + 2250: 96(ivec2) GroupNonUniformBitwiseAnd 178 PartitionedExclusiveScanNV 2248 2249 + 2251: 40(ptr) AccessChain 31(data) 2245 33 + 2252: 17(ivec4) Load 2251 + 2253: 17(ivec4) VectorShuffle 2252 2250 4 5 2 3 + Store 2251 2253 + 2254: 6(int) Load 8(invocation) + 2255: 40(ptr) AccessChain 31(data) 33 33 + 2256: 17(ivec4) Load 2255 + 2257: 103(ivec3) VectorShuffle 2256 2256 0 1 2 + 2258: 17(ivec4) Load 19(ballot) + 2259: 103(ivec3) GroupNonUniformBitwiseAnd 178 PartitionedExclusiveScanNV 2257 2258 + 2260: 40(ptr) AccessChain 31(data) 2254 33 + 2261: 17(ivec4) Load 2260 + 2262: 17(ivec4) VectorShuffle 2261 2259 4 5 6 3 + Store 2260 2262 + 2263: 6(int) Load 8(invocation) + 2264: 40(ptr) AccessChain 31(data) 115 33 + 2265: 17(ivec4) Load 2264 + 2266: 17(ivec4) Load 19(ballot) + 2267: 17(ivec4) GroupNonUniformBitwiseAnd 178 PartitionedExclusiveScanNV 2265 2266 + 2268: 40(ptr) AccessChain 31(data) 2263 33 + Store 2268 2267 + 2269: 6(int) Load 8(invocation) + 2270: 64(ptr) AccessChain 31(data) 34 63 35 + 2271: 24(int) Load 2270 + 2272: 144(bool) SLessThan 2271 34 + 2273: 17(ivec4) Load 19(ballot) + 2274: 144(bool) GroupNonUniformLogicalAnd 178 PartitionedExclusiveScanNV 2272 2273 + 2275: 24(int) Select 2274 63 34 + 2276: 64(ptr) AccessChain 31(data) 2269 63 35 + Store 2276 2275 + 2277: 6(int) Load 8(invocation) + 2278: 71(ptr) AccessChain 31(data) 63 63 + 2279: 25(ivec4) Load 2278 + 2280: 70(ivec2) VectorShuffle 2279 2279 0 1 + 2281: 152(bvec2) SLessThan 2280 727 + 2282: 17(ivec4) Load 19(ballot) + 2283: 152(bvec2) GroupNonUniformLogicalAnd 178 PartitionedExclusiveScanNV 2281 2282 + 2284: 70(ivec2) Select 2283 731 727 + 2285: 71(ptr) AccessChain 31(data) 2277 63 + 2286: 25(ivec4) Load 2285 + 2287: 25(ivec4) VectorShuffle 2286 2284 4 5 2 3 + Store 2285 2287 + 2288: 6(int) Load 8(invocation) + 2289: 71(ptr) AccessChain 31(data) 63 63 + 2290: 25(ivec4) Load 2289 + 2291: 78(ivec3) VectorShuffle 2290 2290 0 1 2 + 2292: 161(bvec3) SLessThan 2291 740 + 2293: 17(ivec4) Load 19(ballot) + 2294: 161(bvec3) GroupNonUniformLogicalAnd 178 PartitionedExclusiveScanNV 2292 2293 + 2295: 78(ivec3) Select 2294 744 740 + 2296: 71(ptr) AccessChain 31(data) 2288 63 + 2297: 25(ivec4) Load 2296 + 2298: 25(ivec4) VectorShuffle 2297 2295 4 5 6 3 + Store 2296 2298 + 2299: 6(int) Load 8(invocation) + 2300: 71(ptr) AccessChain 31(data) 63 63 + 2301: 25(ivec4) Load 2300 + 2302: 169(bvec4) SLessThan 2301 752 + 2303: 17(ivec4) Load 19(ballot) + 2304: 169(bvec4) GroupNonUniformLogicalAnd 178 PartitionedExclusiveScanNV 2302 2303 + 2305: 25(ivec4) Select 2304 756 752 + 2306: 71(ptr) AccessChain 31(data) 2299 63 + Store 2306 2305 + 2307: 6(int) Load 8(invocation) + 2308: 64(ptr) AccessChain 31(data) 34 63 35 + 2309: 24(int) Load 2308 + 2310: 17(ivec4) Load 19(ballot) + 2311: 24(int) GroupNonUniformBitwiseOr 178 PartitionedExclusiveScanNV 2309 2310 + 2312: 64(ptr) AccessChain 31(data) 2307 63 35 + Store 2312 2311 + 2313: 6(int) Load 8(invocation) + 2314: 71(ptr) AccessChain 31(data) 63 63 + 2315: 25(ivec4) Load 2314 + 2316: 70(ivec2) VectorShuffle 2315 2315 0 1 + 2317: 17(ivec4) Load 19(ballot) + 2318: 70(ivec2) GroupNonUniformBitwiseOr 178 PartitionedExclusiveScanNV 2316 2317 + 2319: 71(ptr) AccessChain 31(data) 2313 63 + 2320: 25(ivec4) Load 2319 + 2321: 25(ivec4) VectorShuffle 2320 2318 4 5 2 3 + Store 2319 2321 + 2322: 6(int) Load 8(invocation) + 2323: 71(ptr) AccessChain 31(data) 33 63 + 2324: 25(ivec4) Load 2323 + 2325: 78(ivec3) VectorShuffle 2324 2324 0 1 2 + 2326: 17(ivec4) Load 19(ballot) + 2327: 78(ivec3) GroupNonUniformBitwiseOr 178 PartitionedExclusiveScanNV 2325 2326 + 2328: 71(ptr) AccessChain 31(data) 2322 63 + 2329: 25(ivec4) Load 2328 + 2330: 25(ivec4) VectorShuffle 2329 2327 4 5 6 3 + Store 2328 2330 + 2331: 6(int) Load 8(invocation) + 2332: 71(ptr) AccessChain 31(data) 115 63 + 2333: 25(ivec4) Load 2332 + 2334: 17(ivec4) Load 19(ballot) + 2335: 25(ivec4) GroupNonUniformBitwiseOr 178 PartitionedExclusiveScanNV 2333 2334 + 2336: 71(ptr) AccessChain 31(data) 2331 63 + Store 2336 2335 + 2337: 6(int) Load 8(invocation) + 2338: 90(ptr) AccessChain 31(data) 34 33 35 + 2339: 6(int) Load 2338 + 2340: 17(ivec4) Load 19(ballot) + 2341: 6(int) GroupNonUniformBitwiseOr 178 PartitionedExclusiveScanNV 2339 2340 + 2342: 90(ptr) AccessChain 31(data) 2337 33 35 + Store 2342 2341 + 2343: 6(int) Load 8(invocation) + 2344: 40(ptr) AccessChain 31(data) 63 33 + 2345: 17(ivec4) Load 2344 + 2346: 96(ivec2) VectorShuffle 2345 2345 0 1 + 2347: 17(ivec4) Load 19(ballot) + 2348: 96(ivec2) GroupNonUniformBitwiseOr 178 PartitionedExclusiveScanNV 2346 2347 + 2349: 40(ptr) AccessChain 31(data) 2343 33 + 2350: 17(ivec4) Load 2349 + 2351: 17(ivec4) VectorShuffle 2350 2348 4 5 2 3 + Store 2349 2351 + 2352: 6(int) Load 8(invocation) + 2353: 40(ptr) AccessChain 31(data) 33 33 + 2354: 17(ivec4) Load 2353 + 2355: 103(ivec3) VectorShuffle 2354 2354 0 1 2 + 2356: 17(ivec4) Load 19(ballot) + 2357: 103(ivec3) GroupNonUniformBitwiseOr 178 PartitionedExclusiveScanNV 2355 2356 + 2358: 40(ptr) AccessChain 31(data) 2352 33 + 2359: 17(ivec4) Load 2358 + 2360: 17(ivec4) VectorShuffle 2359 2357 4 5 6 3 + Store 2358 2360 + 2361: 6(int) Load 8(invocation) + 2362: 40(ptr) AccessChain 31(data) 115 33 + 2363: 17(ivec4) Load 2362 + 2364: 17(ivec4) Load 19(ballot) + 2365: 17(ivec4) GroupNonUniformBitwiseOr 178 PartitionedExclusiveScanNV 2363 2364 + 2366: 40(ptr) AccessChain 31(data) 2361 33 + Store 2366 2365 + 2367: 6(int) Load 8(invocation) + 2368: 64(ptr) AccessChain 31(data) 34 63 35 + 2369: 24(int) Load 2368 + 2370: 144(bool) SLessThan 2369 34 + 2371: 17(ivec4) Load 19(ballot) + 2372: 144(bool) GroupNonUniformLogicalOr 178 PartitionedExclusiveScanNV 2370 2371 + 2373: 24(int) Select 2372 63 34 + 2374: 64(ptr) AccessChain 31(data) 2367 63 35 + Store 2374 2373 + 2375: 6(int) Load 8(invocation) + 2376: 71(ptr) AccessChain 31(data) 63 63 + 2377: 25(ivec4) Load 2376 + 2378: 70(ivec2) VectorShuffle 2377 2377 0 1 + 2379: 152(bvec2) SLessThan 2378 727 + 2380: 17(ivec4) Load 19(ballot) + 2381: 152(bvec2) GroupNonUniformLogicalOr 178 PartitionedExclusiveScanNV 2379 2380 + 2382: 70(ivec2) Select 2381 731 727 + 2383: 71(ptr) AccessChain 31(data) 2375 63 + 2384: 25(ivec4) Load 2383 + 2385: 25(ivec4) VectorShuffle 2384 2382 4 5 2 3 + Store 2383 2385 + 2386: 6(int) Load 8(invocation) + 2387: 71(ptr) AccessChain 31(data) 63 63 + 2388: 25(ivec4) Load 2387 + 2389: 78(ivec3) VectorShuffle 2388 2388 0 1 2 + 2390: 161(bvec3) SLessThan 2389 740 + 2391: 17(ivec4) Load 19(ballot) + 2392: 161(bvec3) GroupNonUniformLogicalOr 178 PartitionedExclusiveScanNV 2390 2391 + 2393: 78(ivec3) Select 2392 744 740 + 2394: 71(ptr) AccessChain 31(data) 2386 63 + 2395: 25(ivec4) Load 2394 + 2396: 25(ivec4) VectorShuffle 2395 2393 4 5 6 3 + Store 2394 2396 + 2397: 6(int) Load 8(invocation) + 2398: 71(ptr) AccessChain 31(data) 63 63 + 2399: 25(ivec4) Load 2398 + 2400: 169(bvec4) SLessThan 2399 752 + 2401: 17(ivec4) Load 19(ballot) + 2402: 169(bvec4) GroupNonUniformLogicalOr 178 PartitionedExclusiveScanNV 2400 2401 + 2403: 25(ivec4) Select 2402 756 752 + 2404: 71(ptr) AccessChain 31(data) 2397 63 + Store 2404 2403 + 2405: 6(int) Load 8(invocation) + 2406: 64(ptr) AccessChain 31(data) 34 63 35 + 2407: 24(int) Load 2406 + 2408: 17(ivec4) Load 19(ballot) + 2409: 24(int) GroupNonUniformBitwiseXor 178 PartitionedExclusiveScanNV 2407 2408 + 2410: 64(ptr) AccessChain 31(data) 2405 63 35 + Store 2410 2409 + 2411: 6(int) Load 8(invocation) + 2412: 71(ptr) AccessChain 31(data) 63 63 + 2413: 25(ivec4) Load 2412 + 2414: 70(ivec2) VectorShuffle 2413 2413 0 1 + 2415: 17(ivec4) Load 19(ballot) + 2416: 70(ivec2) GroupNonUniformBitwiseXor 178 PartitionedExclusiveScanNV 2414 2415 + 2417: 71(ptr) AccessChain 31(data) 2411 63 + 2418: 25(ivec4) Load 2417 + 2419: 25(ivec4) VectorShuffle 2418 2416 4 5 2 3 + Store 2417 2419 + 2420: 6(int) Load 8(invocation) + 2421: 71(ptr) AccessChain 31(data) 33 63 + 2422: 25(ivec4) Load 2421 + 2423: 78(ivec3) VectorShuffle 2422 2422 0 1 2 + 2424: 17(ivec4) Load 19(ballot) + 2425: 78(ivec3) GroupNonUniformBitwiseXor 178 PartitionedExclusiveScanNV 2423 2424 + 2426: 71(ptr) AccessChain 31(data) 2420 63 + 2427: 25(ivec4) Load 2426 + 2428: 25(ivec4) VectorShuffle 2427 2425 4 5 6 3 + Store 2426 2428 + 2429: 6(int) Load 8(invocation) + 2430: 71(ptr) AccessChain 31(data) 115 63 + 2431: 25(ivec4) Load 2430 + 2432: 17(ivec4) Load 19(ballot) + 2433: 25(ivec4) GroupNonUniformBitwiseXor 178 PartitionedExclusiveScanNV 2431 2432 + 2434: 71(ptr) AccessChain 31(data) 2429 63 + Store 2434 2433 + 2435: 6(int) Load 8(invocation) + 2436: 90(ptr) AccessChain 31(data) 34 33 35 + 2437: 6(int) Load 2436 + 2438: 17(ivec4) Load 19(ballot) + 2439: 6(int) GroupNonUniformBitwiseXor 178 PartitionedExclusiveScanNV 2437 2438 + 2440: 90(ptr) AccessChain 31(data) 2435 33 35 + Store 2440 2439 + 2441: 6(int) Load 8(invocation) + 2442: 40(ptr) AccessChain 31(data) 63 33 + 2443: 17(ivec4) Load 2442 + 2444: 96(ivec2) VectorShuffle 2443 2443 0 1 + 2445: 17(ivec4) Load 19(ballot) + 2446: 96(ivec2) GroupNonUniformBitwiseXor 178 PartitionedExclusiveScanNV 2444 2445 + 2447: 40(ptr) AccessChain 31(data) 2441 33 + 2448: 17(ivec4) Load 2447 + 2449: 17(ivec4) VectorShuffle 2448 2446 4 5 2 3 + Store 2447 2449 + 2450: 6(int) Load 8(invocation) + 2451: 40(ptr) AccessChain 31(data) 33 33 + 2452: 17(ivec4) Load 2451 + 2453: 103(ivec3) VectorShuffle 2452 2452 0 1 2 + 2454: 17(ivec4) Load 19(ballot) + 2455: 103(ivec3) GroupNonUniformBitwiseXor 178 PartitionedExclusiveScanNV 2453 2454 + 2456: 40(ptr) AccessChain 31(data) 2450 33 + 2457: 17(ivec4) Load 2456 + 2458: 17(ivec4) VectorShuffle 2457 2455 4 5 6 3 + Store 2456 2458 + 2459: 6(int) Load 8(invocation) + 2460: 40(ptr) AccessChain 31(data) 115 33 + 2461: 17(ivec4) Load 2460 + 2462: 17(ivec4) Load 19(ballot) + 2463: 17(ivec4) GroupNonUniformBitwiseXor 178 PartitionedExclusiveScanNV 2461 2462 + 2464: 40(ptr) AccessChain 31(data) 2459 33 + Store 2464 2463 + 2465: 6(int) Load 8(invocation) + 2466: 64(ptr) AccessChain 31(data) 34 63 35 + 2467: 24(int) Load 2466 + 2468: 144(bool) SLessThan 2467 34 + 2469: 17(ivec4) Load 19(ballot) + 2470: 144(bool) GroupNonUniformLogicalXor 178 PartitionedExclusiveScanNV 2468 2469 + 2471: 24(int) Select 2470 63 34 + 2472: 64(ptr) AccessChain 31(data) 2465 63 35 + Store 2472 2471 + 2473: 6(int) Load 8(invocation) + 2474: 71(ptr) AccessChain 31(data) 63 63 + 2475: 25(ivec4) Load 2474 + 2476: 70(ivec2) VectorShuffle 2475 2475 0 1 + 2477: 152(bvec2) SLessThan 2476 727 + 2478: 17(ivec4) Load 19(ballot) + 2479: 152(bvec2) GroupNonUniformLogicalXor 178 PartitionedExclusiveScanNV 2477 2478 + 2480: 70(ivec2) Select 2479 731 727 + 2481: 71(ptr) AccessChain 31(data) 2473 63 + 2482: 25(ivec4) Load 2481 + 2483: 25(ivec4) VectorShuffle 2482 2480 4 5 2 3 + Store 2481 2483 + 2484: 6(int) Load 8(invocation) + 2485: 71(ptr) AccessChain 31(data) 63 63 + 2486: 25(ivec4) Load 2485 + 2487: 78(ivec3) VectorShuffle 2486 2486 0 1 2 + 2488: 161(bvec3) SLessThan 2487 740 + 2489: 17(ivec4) Load 19(ballot) + 2490: 161(bvec3) GroupNonUniformLogicalXor 178 PartitionedExclusiveScanNV 2488 2489 + 2491: 78(ivec3) Select 2490 744 740 + 2492: 71(ptr) AccessChain 31(data) 2484 63 + 2493: 25(ivec4) Load 2492 + 2494: 25(ivec4) VectorShuffle 2493 2491 4 5 6 3 + Store 2492 2494 + 2495: 6(int) Load 8(invocation) + 2496: 71(ptr) AccessChain 31(data) 63 63 + 2497: 25(ivec4) Load 2496 + 2498: 169(bvec4) SLessThan 2497 752 + 2499: 17(ivec4) Load 19(ballot) + 2500: 169(bvec4) GroupNonUniformLogicalXor 178 PartitionedExclusiveScanNV 2498 2499 + 2501: 25(ivec4) Select 2500 756 752 + 2502: 71(ptr) AccessChain 31(data) 2495 63 + Store 2502 2501 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.subgroupQuad.comp.out b/deps/glslang/Test/baseResults/spv.subgroupQuad.comp.out new file mode 100644 index 00000000..435c490f --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.subgroupQuad.comp.out @@ -0,0 +1,739 @@ +spv.subgroupQuad.comp +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 616 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformQuad + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 10 12 + ExecutionMode 4 LocalSize 8 1 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + SourceExtension "GL_KHR_shader_subgroup_quad" + Name 4 "main" + Name 8 "invocation" + Name 10 "gl_SubgroupInvocationID" + Name 12 "gl_SubgroupSize" + Name 24 "Buffers" + MemberName 24(Buffers) 0 "f4" + MemberName 24(Buffers) 1 "i4" + MemberName 24(Buffers) 2 "u4" + MemberName 24(Buffers) 3 "d4" + Name 27 "data" + Decorate 10(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 10(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 11 RelaxedPrecision + Decorate 12(gl_SubgroupSize) RelaxedPrecision + Decorate 12(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 13 RelaxedPrecision + Decorate 14 RelaxedPrecision + Decorate 16 RelaxedPrecision + MemberDecorate 24(Buffers) 0 Offset 0 + MemberDecorate 24(Buffers) 1 Offset 16 + MemberDecorate 24(Buffers) 2 Offset 32 + MemberDecorate 24(Buffers) 3 Offset 64 + Decorate 24(Buffers) Block + Decorate 27(data) DescriptorSet 0 + Decorate 27(data) Binding 0 + Decorate 615 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypePointer Input 6(int) +10(gl_SubgroupInvocationID): 9(ptr) Variable Input +12(gl_SubgroupSize): 9(ptr) Variable Input + 15: 6(int) Constant 4 + 17: TypeFloat 32 + 18: TypeVector 17(float) 4 + 19: TypeInt 32 1 + 20: TypeVector 19(int) 4 + 21: TypeVector 6(int) 4 + 22: TypeFloat 64 + 23: TypeVector 22(float64_t) 4 + 24(Buffers): TypeStruct 18(fvec4) 20(ivec4) 21(ivec4) 23(f64vec4) + 25: TypeArray 24(Buffers) 15 + 26: TypePointer StorageBuffer 25 + 27(data): 26(ptr) Variable StorageBuffer + 29: 19(int) Constant 0 + 30: 6(int) Constant 0 + 31: TypePointer StorageBuffer 17(float) + 34: 6(int) Constant 1 + 35: 6(int) Constant 3 + 39: 19(int) Constant 1 + 40: TypeVector 17(float) 2 + 41: TypePointer StorageBuffer 18(fvec4) + 50: 19(int) Constant 2 + 51: TypeVector 17(float) 3 + 60: 19(int) Constant 3 + 66: TypePointer StorageBuffer 19(int) + 72: TypeVector 19(int) 2 + 73: TypePointer StorageBuffer 20(ivec4) + 82: TypeVector 19(int) 3 + 96: TypePointer StorageBuffer 6(int) + 102: TypeVector 6(int) 2 + 103: TypePointer StorageBuffer 21(ivec4) + 112: TypeVector 6(int) 3 + 126: TypePointer StorageBuffer 22(float64_t) + 132: TypeVector 22(float64_t) 2 + 133: TypePointer StorageBuffer 23(f64vec4) + 142: TypeVector 22(float64_t) 3 + 158: TypeBool + 167: 72(ivec2) ConstantComposite 29 29 + 168: TypeVector 158(bool) 2 + 171: 72(ivec2) ConstantComposite 39 39 + 180: 82(ivec3) ConstantComposite 29 29 29 + 181: TypeVector 158(bool) 3 + 184: 82(ivec3) ConstantComposite 39 39 39 + 192: 20(ivec4) ConstantComposite 29 29 29 29 + 193: TypeVector 158(bool) 4 + 196: 20(ivec4) ConstantComposite 39 39 39 39 + 478: 6(int) Constant 2 + 614: 6(int) Constant 8 + 615: 112(ivec3) ConstantComposite 614 34 34 + 4(main): 2 Function None 3 + 5: Label + 8(invocation): 7(ptr) Variable Function + 11: 6(int) Load 10(gl_SubgroupInvocationID) + 13: 6(int) Load 12(gl_SubgroupSize) + 14: 6(int) IAdd 11 13 + 16: 6(int) UMod 14 15 + Store 8(invocation) 16 + 28: 6(int) Load 8(invocation) + 32: 31(ptr) AccessChain 27(data) 29 29 30 + 33: 17(float) Load 32 + 36: 17(float) GroupNonUniformQuadBroadcast 35 33 34 + 37: 31(ptr) AccessChain 27(data) 28 29 30 + Store 37 36 + 38: 6(int) Load 8(invocation) + 42: 41(ptr) AccessChain 27(data) 39 29 + 43: 18(fvec4) Load 42 + 44: 40(fvec2) VectorShuffle 43 43 0 1 + 45: 40(fvec2) GroupNonUniformQuadBroadcast 35 44 34 + 46: 41(ptr) AccessChain 27(data) 38 29 + 47: 18(fvec4) Load 46 + 48: 18(fvec4) VectorShuffle 47 45 4 5 2 3 + Store 46 48 + 49: 6(int) Load 8(invocation) + 52: 41(ptr) AccessChain 27(data) 50 29 + 53: 18(fvec4) Load 52 + 54: 51(fvec3) VectorShuffle 53 53 0 1 2 + 55: 51(fvec3) GroupNonUniformQuadBroadcast 35 54 34 + 56: 41(ptr) AccessChain 27(data) 49 29 + 57: 18(fvec4) Load 56 + 58: 18(fvec4) VectorShuffle 57 55 4 5 6 3 + Store 56 58 + 59: 6(int) Load 8(invocation) + 61: 41(ptr) AccessChain 27(data) 60 29 + 62: 18(fvec4) Load 61 + 63: 18(fvec4) GroupNonUniformQuadBroadcast 35 62 34 + 64: 41(ptr) AccessChain 27(data) 59 29 + Store 64 63 + 65: 6(int) Load 8(invocation) + 67: 66(ptr) AccessChain 27(data) 29 39 30 + 68: 19(int) Load 67 + 69: 19(int) GroupNonUniformQuadBroadcast 35 68 34 + 70: 66(ptr) AccessChain 27(data) 65 39 30 + Store 70 69 + 71: 6(int) Load 8(invocation) + 74: 73(ptr) AccessChain 27(data) 39 39 + 75: 20(ivec4) Load 74 + 76: 72(ivec2) VectorShuffle 75 75 0 1 + 77: 72(ivec2) GroupNonUniformQuadBroadcast 35 76 34 + 78: 73(ptr) AccessChain 27(data) 71 39 + 79: 20(ivec4) Load 78 + 80: 20(ivec4) VectorShuffle 79 77 4 5 2 3 + Store 78 80 + 81: 6(int) Load 8(invocation) + 83: 73(ptr) AccessChain 27(data) 50 39 + 84: 20(ivec4) Load 83 + 85: 82(ivec3) VectorShuffle 84 84 0 1 2 + 86: 82(ivec3) GroupNonUniformQuadBroadcast 35 85 34 + 87: 73(ptr) AccessChain 27(data) 81 39 + 88: 20(ivec4) Load 87 + 89: 20(ivec4) VectorShuffle 88 86 4 5 6 3 + Store 87 89 + 90: 6(int) Load 8(invocation) + 91: 73(ptr) AccessChain 27(data) 60 39 + 92: 20(ivec4) Load 91 + 93: 20(ivec4) GroupNonUniformQuadBroadcast 35 92 34 + 94: 73(ptr) AccessChain 27(data) 90 39 + Store 94 93 + 95: 6(int) Load 8(invocation) + 97: 96(ptr) AccessChain 27(data) 29 50 30 + 98: 6(int) Load 97 + 99: 6(int) GroupNonUniformQuadBroadcast 35 98 34 + 100: 96(ptr) AccessChain 27(data) 95 50 30 + Store 100 99 + 101: 6(int) Load 8(invocation) + 104: 103(ptr) AccessChain 27(data) 39 50 + 105: 21(ivec4) Load 104 + 106: 102(ivec2) VectorShuffle 105 105 0 1 + 107: 102(ivec2) GroupNonUniformQuadBroadcast 35 106 34 + 108: 103(ptr) AccessChain 27(data) 101 50 + 109: 21(ivec4) Load 108 + 110: 21(ivec4) VectorShuffle 109 107 4 5 2 3 + Store 108 110 + 111: 6(int) Load 8(invocation) + 113: 103(ptr) AccessChain 27(data) 50 50 + 114: 21(ivec4) Load 113 + 115: 112(ivec3) VectorShuffle 114 114 0 1 2 + 116: 112(ivec3) GroupNonUniformQuadBroadcast 35 115 34 + 117: 103(ptr) AccessChain 27(data) 111 50 + 118: 21(ivec4) Load 117 + 119: 21(ivec4) VectorShuffle 118 116 4 5 6 3 + Store 117 119 + 120: 6(int) Load 8(invocation) + 121: 103(ptr) AccessChain 27(data) 60 50 + 122: 21(ivec4) Load 121 + 123: 21(ivec4) GroupNonUniformQuadBroadcast 35 122 34 + 124: 103(ptr) AccessChain 27(data) 120 50 + Store 124 123 + 125: 6(int) Load 8(invocation) + 127: 126(ptr) AccessChain 27(data) 29 60 30 + 128:22(float64_t) Load 127 + 129:22(float64_t) GroupNonUniformQuadBroadcast 35 128 34 + 130: 126(ptr) AccessChain 27(data) 125 60 30 + Store 130 129 + 131: 6(int) Load 8(invocation) + 134: 133(ptr) AccessChain 27(data) 39 60 + 135: 23(f64vec4) Load 134 + 136:132(f64vec2) VectorShuffle 135 135 0 1 + 137:132(f64vec2) GroupNonUniformQuadBroadcast 35 136 34 + 138: 133(ptr) AccessChain 27(data) 131 60 + 139: 23(f64vec4) Load 138 + 140: 23(f64vec4) VectorShuffle 139 137 4 5 2 3 + Store 138 140 + 141: 6(int) Load 8(invocation) + 143: 133(ptr) AccessChain 27(data) 50 60 + 144: 23(f64vec4) Load 143 + 145:142(f64vec3) VectorShuffle 144 144 0 1 2 + 146:142(f64vec3) GroupNonUniformQuadBroadcast 35 145 34 + 147: 133(ptr) AccessChain 27(data) 141 60 + 148: 23(f64vec4) Load 147 + 149: 23(f64vec4) VectorShuffle 148 146 4 5 6 3 + Store 147 149 + 150: 6(int) Load 8(invocation) + 151: 133(ptr) AccessChain 27(data) 60 60 + 152: 23(f64vec4) Load 151 + 153: 23(f64vec4) GroupNonUniformQuadBroadcast 35 152 34 + 154: 133(ptr) AccessChain 27(data) 150 60 + Store 154 153 + 155: 6(int) Load 8(invocation) + 156: 66(ptr) AccessChain 27(data) 29 39 30 + 157: 19(int) Load 156 + 159: 158(bool) SLessThan 157 29 + 160: 158(bool) GroupNonUniformQuadBroadcast 35 159 34 + 161: 19(int) Select 160 39 29 + 162: 66(ptr) AccessChain 27(data) 155 39 30 + Store 162 161 + 163: 6(int) Load 8(invocation) + 164: 73(ptr) AccessChain 27(data) 39 39 + 165: 20(ivec4) Load 164 + 166: 72(ivec2) VectorShuffle 165 165 0 1 + 169: 168(bvec2) SLessThan 166 167 + 170: 168(bvec2) GroupNonUniformQuadBroadcast 35 169 34 + 172: 72(ivec2) Select 170 171 167 + 173: 73(ptr) AccessChain 27(data) 163 39 + 174: 20(ivec4) Load 173 + 175: 20(ivec4) VectorShuffle 174 172 4 5 2 3 + Store 173 175 + 176: 6(int) Load 8(invocation) + 177: 73(ptr) AccessChain 27(data) 39 39 + 178: 20(ivec4) Load 177 + 179: 82(ivec3) VectorShuffle 178 178 0 1 2 + 182: 181(bvec3) SLessThan 179 180 + 183: 181(bvec3) GroupNonUniformQuadBroadcast 35 182 34 + 185: 82(ivec3) Select 183 184 180 + 186: 73(ptr) AccessChain 27(data) 176 39 + 187: 20(ivec4) Load 186 + 188: 20(ivec4) VectorShuffle 187 185 4 5 6 3 + Store 186 188 + 189: 6(int) Load 8(invocation) + 190: 73(ptr) AccessChain 27(data) 39 39 + 191: 20(ivec4) Load 190 + 194: 193(bvec4) SLessThan 191 192 + 195: 193(bvec4) GroupNonUniformQuadBroadcast 35 194 34 + 197: 20(ivec4) Select 195 196 192 + 198: 73(ptr) AccessChain 27(data) 189 39 + Store 198 197 + 199: 6(int) Load 8(invocation) + 200: 31(ptr) AccessChain 27(data) 29 29 30 + 201: 17(float) Load 200 + 202: 17(float) GroupNonUniformQuadSwap 35 201 30 + 203: 31(ptr) AccessChain 27(data) 199 29 30 + Store 203 202 + 204: 6(int) Load 8(invocation) + 205: 41(ptr) AccessChain 27(data) 39 29 + 206: 18(fvec4) Load 205 + 207: 40(fvec2) VectorShuffle 206 206 0 1 + 208: 40(fvec2) GroupNonUniformQuadSwap 35 207 30 + 209: 41(ptr) AccessChain 27(data) 204 29 + 210: 18(fvec4) Load 209 + 211: 18(fvec4) VectorShuffle 210 208 4 5 2 3 + Store 209 211 + 212: 6(int) Load 8(invocation) + 213: 41(ptr) AccessChain 27(data) 50 29 + 214: 18(fvec4) Load 213 + 215: 51(fvec3) VectorShuffle 214 214 0 1 2 + 216: 51(fvec3) GroupNonUniformQuadSwap 35 215 30 + 217: 41(ptr) AccessChain 27(data) 212 29 + 218: 18(fvec4) Load 217 + 219: 18(fvec4) VectorShuffle 218 216 4 5 6 3 + Store 217 219 + 220: 6(int) Load 8(invocation) + 221: 41(ptr) AccessChain 27(data) 60 29 + 222: 18(fvec4) Load 221 + 223: 18(fvec4) GroupNonUniformQuadSwap 35 222 30 + 224: 41(ptr) AccessChain 27(data) 220 29 + Store 224 223 + 225: 6(int) Load 8(invocation) + 226: 66(ptr) AccessChain 27(data) 29 39 30 + 227: 19(int) Load 226 + 228: 19(int) GroupNonUniformQuadSwap 35 227 30 + 229: 66(ptr) AccessChain 27(data) 225 39 30 + Store 229 228 + 230: 6(int) Load 8(invocation) + 231: 73(ptr) AccessChain 27(data) 39 39 + 232: 20(ivec4) Load 231 + 233: 72(ivec2) VectorShuffle 232 232 0 1 + 234: 72(ivec2) GroupNonUniformQuadSwap 35 233 30 + 235: 73(ptr) AccessChain 27(data) 230 39 + 236: 20(ivec4) Load 235 + 237: 20(ivec4) VectorShuffle 236 234 4 5 2 3 + Store 235 237 + 238: 6(int) Load 8(invocation) + 239: 73(ptr) AccessChain 27(data) 50 39 + 240: 20(ivec4) Load 239 + 241: 82(ivec3) VectorShuffle 240 240 0 1 2 + 242: 82(ivec3) GroupNonUniformQuadSwap 35 241 30 + 243: 73(ptr) AccessChain 27(data) 238 39 + 244: 20(ivec4) Load 243 + 245: 20(ivec4) VectorShuffle 244 242 4 5 6 3 + Store 243 245 + 246: 6(int) Load 8(invocation) + 247: 73(ptr) AccessChain 27(data) 60 39 + 248: 20(ivec4) Load 247 + 249: 20(ivec4) GroupNonUniformQuadSwap 35 248 30 + 250: 73(ptr) AccessChain 27(data) 246 39 + Store 250 249 + 251: 6(int) Load 8(invocation) + 252: 96(ptr) AccessChain 27(data) 29 50 30 + 253: 6(int) Load 252 + 254: 6(int) GroupNonUniformQuadSwap 35 253 30 + 255: 96(ptr) AccessChain 27(data) 251 50 30 + Store 255 254 + 256: 6(int) Load 8(invocation) + 257: 103(ptr) AccessChain 27(data) 39 50 + 258: 21(ivec4) Load 257 + 259: 102(ivec2) VectorShuffle 258 258 0 1 + 260: 102(ivec2) GroupNonUniformQuadSwap 35 259 30 + 261: 103(ptr) AccessChain 27(data) 256 50 + 262: 21(ivec4) Load 261 + 263: 21(ivec4) VectorShuffle 262 260 4 5 2 3 + Store 261 263 + 264: 6(int) Load 8(invocation) + 265: 103(ptr) AccessChain 27(data) 50 50 + 266: 21(ivec4) Load 265 + 267: 112(ivec3) VectorShuffle 266 266 0 1 2 + 268: 112(ivec3) GroupNonUniformQuadSwap 35 267 30 + 269: 103(ptr) AccessChain 27(data) 264 50 + 270: 21(ivec4) Load 269 + 271: 21(ivec4) VectorShuffle 270 268 4 5 6 3 + Store 269 271 + 272: 6(int) Load 8(invocation) + 273: 103(ptr) AccessChain 27(data) 60 50 + 274: 21(ivec4) Load 273 + 275: 21(ivec4) GroupNonUniformQuadSwap 35 274 30 + 276: 103(ptr) AccessChain 27(data) 272 50 + Store 276 275 + 277: 6(int) Load 8(invocation) + 278: 126(ptr) AccessChain 27(data) 29 60 30 + 279:22(float64_t) Load 278 + 280:22(float64_t) GroupNonUniformQuadSwap 35 279 30 + 281: 126(ptr) AccessChain 27(data) 277 60 30 + Store 281 280 + 282: 6(int) Load 8(invocation) + 283: 133(ptr) AccessChain 27(data) 39 60 + 284: 23(f64vec4) Load 283 + 285:132(f64vec2) VectorShuffle 284 284 0 1 + 286:132(f64vec2) GroupNonUniformQuadSwap 35 285 30 + 287: 133(ptr) AccessChain 27(data) 282 60 + 288: 23(f64vec4) Load 287 + 289: 23(f64vec4) VectorShuffle 288 286 4 5 2 3 + Store 287 289 + 290: 6(int) Load 8(invocation) + 291: 133(ptr) AccessChain 27(data) 50 60 + 292: 23(f64vec4) Load 291 + 293:142(f64vec3) VectorShuffle 292 292 0 1 2 + 294:142(f64vec3) GroupNonUniformQuadSwap 35 293 30 + 295: 133(ptr) AccessChain 27(data) 290 60 + 296: 23(f64vec4) Load 295 + 297: 23(f64vec4) VectorShuffle 296 294 4 5 6 3 + Store 295 297 + 298: 6(int) Load 8(invocation) + 299: 133(ptr) AccessChain 27(data) 60 60 + 300: 23(f64vec4) Load 299 + 301: 23(f64vec4) GroupNonUniformQuadSwap 35 300 30 + 302: 133(ptr) AccessChain 27(data) 298 60 + Store 302 301 + 303: 6(int) Load 8(invocation) + 304: 66(ptr) AccessChain 27(data) 29 39 30 + 305: 19(int) Load 304 + 306: 158(bool) SLessThan 305 29 + 307: 158(bool) GroupNonUniformQuadSwap 35 306 30 + 308: 19(int) Select 307 39 29 + 309: 66(ptr) AccessChain 27(data) 303 39 30 + Store 309 308 + 310: 6(int) Load 8(invocation) + 311: 73(ptr) AccessChain 27(data) 39 39 + 312: 20(ivec4) Load 311 + 313: 72(ivec2) VectorShuffle 312 312 0 1 + 314: 168(bvec2) SLessThan 313 167 + 315: 168(bvec2) GroupNonUniformQuadSwap 35 314 30 + 316: 72(ivec2) Select 315 171 167 + 317: 73(ptr) AccessChain 27(data) 310 39 + 318: 20(ivec4) Load 317 + 319: 20(ivec4) VectorShuffle 318 316 4 5 2 3 + Store 317 319 + 320: 6(int) Load 8(invocation) + 321: 73(ptr) AccessChain 27(data) 39 39 + 322: 20(ivec4) Load 321 + 323: 82(ivec3) VectorShuffle 322 322 0 1 2 + 324: 181(bvec3) SLessThan 323 180 + 325: 181(bvec3) GroupNonUniformQuadSwap 35 324 30 + 326: 82(ivec3) Select 325 184 180 + 327: 73(ptr) AccessChain 27(data) 320 39 + 328: 20(ivec4) Load 327 + 329: 20(ivec4) VectorShuffle 328 326 4 5 6 3 + Store 327 329 + 330: 6(int) Load 8(invocation) + 331: 73(ptr) AccessChain 27(data) 39 39 + 332: 20(ivec4) Load 331 + 333: 193(bvec4) SLessThan 332 192 + 334: 193(bvec4) GroupNonUniformQuadSwap 35 333 30 + 335: 20(ivec4) Select 334 196 192 + 336: 73(ptr) AccessChain 27(data) 330 39 + Store 336 335 + 337: 6(int) Load 8(invocation) + 338: 31(ptr) AccessChain 27(data) 29 29 30 + 339: 17(float) Load 338 + 340: 17(float) GroupNonUniformQuadSwap 35 339 34 + 341: 31(ptr) AccessChain 27(data) 337 29 30 + Store 341 340 + 342: 6(int) Load 8(invocation) + 343: 41(ptr) AccessChain 27(data) 39 29 + 344: 18(fvec4) Load 343 + 345: 40(fvec2) VectorShuffle 344 344 0 1 + 346: 40(fvec2) GroupNonUniformQuadSwap 35 345 34 + 347: 41(ptr) AccessChain 27(data) 342 29 + 348: 18(fvec4) Load 347 + 349: 18(fvec4) VectorShuffle 348 346 4 5 2 3 + Store 347 349 + 350: 6(int) Load 8(invocation) + 351: 41(ptr) AccessChain 27(data) 50 29 + 352: 18(fvec4) Load 351 + 353: 51(fvec3) VectorShuffle 352 352 0 1 2 + 354: 51(fvec3) GroupNonUniformQuadSwap 35 353 34 + 355: 41(ptr) AccessChain 27(data) 350 29 + 356: 18(fvec4) Load 355 + 357: 18(fvec4) VectorShuffle 356 354 4 5 6 3 + Store 355 357 + 358: 6(int) Load 8(invocation) + 359: 41(ptr) AccessChain 27(data) 60 29 + 360: 18(fvec4) Load 359 + 361: 18(fvec4) GroupNonUniformQuadSwap 35 360 34 + 362: 41(ptr) AccessChain 27(data) 358 29 + Store 362 361 + 363: 6(int) Load 8(invocation) + 364: 66(ptr) AccessChain 27(data) 29 39 30 + 365: 19(int) Load 364 + 366: 19(int) GroupNonUniformQuadSwap 35 365 34 + 367: 66(ptr) AccessChain 27(data) 363 39 30 + Store 367 366 + 368: 6(int) Load 8(invocation) + 369: 73(ptr) AccessChain 27(data) 39 39 + 370: 20(ivec4) Load 369 + 371: 72(ivec2) VectorShuffle 370 370 0 1 + 372: 72(ivec2) GroupNonUniformQuadSwap 35 371 34 + 373: 73(ptr) AccessChain 27(data) 368 39 + 374: 20(ivec4) Load 373 + 375: 20(ivec4) VectorShuffle 374 372 4 5 2 3 + Store 373 375 + 376: 6(int) Load 8(invocation) + 377: 73(ptr) AccessChain 27(data) 50 39 + 378: 20(ivec4) Load 377 + 379: 82(ivec3) VectorShuffle 378 378 0 1 2 + 380: 82(ivec3) GroupNonUniformQuadSwap 35 379 34 + 381: 73(ptr) AccessChain 27(data) 376 39 + 382: 20(ivec4) Load 381 + 383: 20(ivec4) VectorShuffle 382 380 4 5 6 3 + Store 381 383 + 384: 6(int) Load 8(invocation) + 385: 73(ptr) AccessChain 27(data) 60 39 + 386: 20(ivec4) Load 385 + 387: 20(ivec4) GroupNonUniformQuadSwap 35 386 34 + 388: 73(ptr) AccessChain 27(data) 384 39 + Store 388 387 + 389: 6(int) Load 8(invocation) + 390: 96(ptr) AccessChain 27(data) 29 50 30 + 391: 6(int) Load 390 + 392: 6(int) GroupNonUniformQuadSwap 35 391 34 + 393: 96(ptr) AccessChain 27(data) 389 50 30 + Store 393 392 + 394: 6(int) Load 8(invocation) + 395: 103(ptr) AccessChain 27(data) 39 50 + 396: 21(ivec4) Load 395 + 397: 102(ivec2) VectorShuffle 396 396 0 1 + 398: 102(ivec2) GroupNonUniformQuadSwap 35 397 34 + 399: 103(ptr) AccessChain 27(data) 394 50 + 400: 21(ivec4) Load 399 + 401: 21(ivec4) VectorShuffle 400 398 4 5 2 3 + Store 399 401 + 402: 6(int) Load 8(invocation) + 403: 103(ptr) AccessChain 27(data) 50 50 + 404: 21(ivec4) Load 403 + 405: 112(ivec3) VectorShuffle 404 404 0 1 2 + 406: 112(ivec3) GroupNonUniformQuadSwap 35 405 34 + 407: 103(ptr) AccessChain 27(data) 402 50 + 408: 21(ivec4) Load 407 + 409: 21(ivec4) VectorShuffle 408 406 4 5 6 3 + Store 407 409 + 410: 6(int) Load 8(invocation) + 411: 103(ptr) AccessChain 27(data) 60 50 + 412: 21(ivec4) Load 411 + 413: 21(ivec4) GroupNonUniformQuadSwap 35 412 34 + 414: 103(ptr) AccessChain 27(data) 410 50 + Store 414 413 + 415: 6(int) Load 8(invocation) + 416: 126(ptr) AccessChain 27(data) 29 60 30 + 417:22(float64_t) Load 416 + 418:22(float64_t) GroupNonUniformQuadSwap 35 417 34 + 419: 126(ptr) AccessChain 27(data) 415 60 30 + Store 419 418 + 420: 6(int) Load 8(invocation) + 421: 133(ptr) AccessChain 27(data) 39 60 + 422: 23(f64vec4) Load 421 + 423:132(f64vec2) VectorShuffle 422 422 0 1 + 424:132(f64vec2) GroupNonUniformQuadSwap 35 423 34 + 425: 133(ptr) AccessChain 27(data) 420 60 + 426: 23(f64vec4) Load 425 + 427: 23(f64vec4) VectorShuffle 426 424 4 5 2 3 + Store 425 427 + 428: 6(int) Load 8(invocation) + 429: 133(ptr) AccessChain 27(data) 50 60 + 430: 23(f64vec4) Load 429 + 431:142(f64vec3) VectorShuffle 430 430 0 1 2 + 432:142(f64vec3) GroupNonUniformQuadSwap 35 431 34 + 433: 133(ptr) AccessChain 27(data) 428 60 + 434: 23(f64vec4) Load 433 + 435: 23(f64vec4) VectorShuffle 434 432 4 5 6 3 + Store 433 435 + 436: 6(int) Load 8(invocation) + 437: 133(ptr) AccessChain 27(data) 60 60 + 438: 23(f64vec4) Load 437 + 439: 23(f64vec4) GroupNonUniformQuadSwap 35 438 34 + 440: 133(ptr) AccessChain 27(data) 436 60 + Store 440 439 + 441: 6(int) Load 8(invocation) + 442: 66(ptr) AccessChain 27(data) 29 39 30 + 443: 19(int) Load 442 + 444: 158(bool) SLessThan 443 29 + 445: 158(bool) GroupNonUniformQuadSwap 35 444 34 + 446: 19(int) Select 445 39 29 + 447: 66(ptr) AccessChain 27(data) 441 39 30 + Store 447 446 + 448: 6(int) Load 8(invocation) + 449: 73(ptr) AccessChain 27(data) 39 39 + 450: 20(ivec4) Load 449 + 451: 72(ivec2) VectorShuffle 450 450 0 1 + 452: 168(bvec2) SLessThan 451 167 + 453: 168(bvec2) GroupNonUniformQuadSwap 35 452 34 + 454: 72(ivec2) Select 453 171 167 + 455: 73(ptr) AccessChain 27(data) 448 39 + 456: 20(ivec4) Load 455 + 457: 20(ivec4) VectorShuffle 456 454 4 5 2 3 + Store 455 457 + 458: 6(int) Load 8(invocation) + 459: 73(ptr) AccessChain 27(data) 39 39 + 460: 20(ivec4) Load 459 + 461: 82(ivec3) VectorShuffle 460 460 0 1 2 + 462: 181(bvec3) SLessThan 461 180 + 463: 181(bvec3) GroupNonUniformQuadSwap 35 462 34 + 464: 82(ivec3) Select 463 184 180 + 465: 73(ptr) AccessChain 27(data) 458 39 + 466: 20(ivec4) Load 465 + 467: 20(ivec4) VectorShuffle 466 464 4 5 6 3 + Store 465 467 + 468: 6(int) Load 8(invocation) + 469: 73(ptr) AccessChain 27(data) 39 39 + 470: 20(ivec4) Load 469 + 471: 193(bvec4) SLessThan 470 192 + 472: 193(bvec4) GroupNonUniformQuadSwap 35 471 34 + 473: 20(ivec4) Select 472 196 192 + 474: 73(ptr) AccessChain 27(data) 468 39 + Store 474 473 + 475: 6(int) Load 8(invocation) + 476: 31(ptr) AccessChain 27(data) 29 29 30 + 477: 17(float) Load 476 + 479: 17(float) GroupNonUniformQuadSwap 35 477 478 + 480: 31(ptr) AccessChain 27(data) 475 29 30 + Store 480 479 + 481: 6(int) Load 8(invocation) + 482: 41(ptr) AccessChain 27(data) 39 29 + 483: 18(fvec4) Load 482 + 484: 40(fvec2) VectorShuffle 483 483 0 1 + 485: 40(fvec2) GroupNonUniformQuadSwap 35 484 478 + 486: 41(ptr) AccessChain 27(data) 481 29 + 487: 18(fvec4) Load 486 + 488: 18(fvec4) VectorShuffle 487 485 4 5 2 3 + Store 486 488 + 489: 6(int) Load 8(invocation) + 490: 41(ptr) AccessChain 27(data) 50 29 + 491: 18(fvec4) Load 490 + 492: 51(fvec3) VectorShuffle 491 491 0 1 2 + 493: 51(fvec3) GroupNonUniformQuadSwap 35 492 478 + 494: 41(ptr) AccessChain 27(data) 489 29 + 495: 18(fvec4) Load 494 + 496: 18(fvec4) VectorShuffle 495 493 4 5 6 3 + Store 494 496 + 497: 6(int) Load 8(invocation) + 498: 41(ptr) AccessChain 27(data) 60 29 + 499: 18(fvec4) Load 498 + 500: 18(fvec4) GroupNonUniformQuadSwap 35 499 478 + 501: 41(ptr) AccessChain 27(data) 497 29 + Store 501 500 + 502: 6(int) Load 8(invocation) + 503: 66(ptr) AccessChain 27(data) 29 39 30 + 504: 19(int) Load 503 + 505: 19(int) GroupNonUniformQuadSwap 35 504 478 + 506: 66(ptr) AccessChain 27(data) 502 39 30 + Store 506 505 + 507: 6(int) Load 8(invocation) + 508: 73(ptr) AccessChain 27(data) 39 39 + 509: 20(ivec4) Load 508 + 510: 72(ivec2) VectorShuffle 509 509 0 1 + 511: 72(ivec2) GroupNonUniformQuadSwap 35 510 478 + 512: 73(ptr) AccessChain 27(data) 507 39 + 513: 20(ivec4) Load 512 + 514: 20(ivec4) VectorShuffle 513 511 4 5 2 3 + Store 512 514 + 515: 6(int) Load 8(invocation) + 516: 73(ptr) AccessChain 27(data) 50 39 + 517: 20(ivec4) Load 516 + 518: 82(ivec3) VectorShuffle 517 517 0 1 2 + 519: 82(ivec3) GroupNonUniformQuadSwap 35 518 478 + 520: 73(ptr) AccessChain 27(data) 515 39 + 521: 20(ivec4) Load 520 + 522: 20(ivec4) VectorShuffle 521 519 4 5 6 3 + Store 520 522 + 523: 6(int) Load 8(invocation) + 524: 73(ptr) AccessChain 27(data) 60 39 + 525: 20(ivec4) Load 524 + 526: 20(ivec4) GroupNonUniformQuadSwap 35 525 478 + 527: 73(ptr) AccessChain 27(data) 523 39 + Store 527 526 + 528: 6(int) Load 8(invocation) + 529: 96(ptr) AccessChain 27(data) 29 50 30 + 530: 6(int) Load 529 + 531: 6(int) GroupNonUniformQuadSwap 35 530 478 + 532: 96(ptr) AccessChain 27(data) 528 50 30 + Store 532 531 + 533: 6(int) Load 8(invocation) + 534: 103(ptr) AccessChain 27(data) 39 50 + 535: 21(ivec4) Load 534 + 536: 102(ivec2) VectorShuffle 535 535 0 1 + 537: 102(ivec2) GroupNonUniformQuadSwap 35 536 478 + 538: 103(ptr) AccessChain 27(data) 533 50 + 539: 21(ivec4) Load 538 + 540: 21(ivec4) VectorShuffle 539 537 4 5 2 3 + Store 538 540 + 541: 6(int) Load 8(invocation) + 542: 103(ptr) AccessChain 27(data) 50 50 + 543: 21(ivec4) Load 542 + 544: 112(ivec3) VectorShuffle 543 543 0 1 2 + 545: 112(ivec3) GroupNonUniformQuadSwap 35 544 478 + 546: 103(ptr) AccessChain 27(data) 541 50 + 547: 21(ivec4) Load 546 + 548: 21(ivec4) VectorShuffle 547 545 4 5 6 3 + Store 546 548 + 549: 6(int) Load 8(invocation) + 550: 103(ptr) AccessChain 27(data) 60 50 + 551: 21(ivec4) Load 550 + 552: 21(ivec4) GroupNonUniformQuadSwap 35 551 478 + 553: 103(ptr) AccessChain 27(data) 549 50 + Store 553 552 + 554: 6(int) Load 8(invocation) + 555: 126(ptr) AccessChain 27(data) 29 60 30 + 556:22(float64_t) Load 555 + 557:22(float64_t) GroupNonUniformQuadSwap 35 556 478 + 558: 126(ptr) AccessChain 27(data) 554 60 30 + Store 558 557 + 559: 6(int) Load 8(invocation) + 560: 133(ptr) AccessChain 27(data) 39 60 + 561: 23(f64vec4) Load 560 + 562:132(f64vec2) VectorShuffle 561 561 0 1 + 563:132(f64vec2) GroupNonUniformQuadSwap 35 562 478 + 564: 133(ptr) AccessChain 27(data) 559 60 + 565: 23(f64vec4) Load 564 + 566: 23(f64vec4) VectorShuffle 565 563 4 5 2 3 + Store 564 566 + 567: 6(int) Load 8(invocation) + 568: 133(ptr) AccessChain 27(data) 50 60 + 569: 23(f64vec4) Load 568 + 570:142(f64vec3) VectorShuffle 569 569 0 1 2 + 571:142(f64vec3) GroupNonUniformQuadSwap 35 570 478 + 572: 133(ptr) AccessChain 27(data) 567 60 + 573: 23(f64vec4) Load 572 + 574: 23(f64vec4) VectorShuffle 573 571 4 5 6 3 + Store 572 574 + 575: 6(int) Load 8(invocation) + 576: 133(ptr) AccessChain 27(data) 60 60 + 577: 23(f64vec4) Load 576 + 578: 23(f64vec4) GroupNonUniformQuadSwap 35 577 478 + 579: 133(ptr) AccessChain 27(data) 575 60 + Store 579 578 + 580: 6(int) Load 8(invocation) + 581: 66(ptr) AccessChain 27(data) 29 39 30 + 582: 19(int) Load 581 + 583: 158(bool) SLessThan 582 29 + 584: 158(bool) GroupNonUniformQuadSwap 35 583 478 + 585: 19(int) Select 584 39 29 + 586: 66(ptr) AccessChain 27(data) 580 39 30 + Store 586 585 + 587: 6(int) Load 8(invocation) + 588: 73(ptr) AccessChain 27(data) 39 39 + 589: 20(ivec4) Load 588 + 590: 72(ivec2) VectorShuffle 589 589 0 1 + 591: 168(bvec2) SLessThan 590 167 + 592: 168(bvec2) GroupNonUniformQuadSwap 35 591 478 + 593: 72(ivec2) Select 592 171 167 + 594: 73(ptr) AccessChain 27(data) 587 39 + 595: 20(ivec4) Load 594 + 596: 20(ivec4) VectorShuffle 595 593 4 5 2 3 + Store 594 596 + 597: 6(int) Load 8(invocation) + 598: 73(ptr) AccessChain 27(data) 39 39 + 599: 20(ivec4) Load 598 + 600: 82(ivec3) VectorShuffle 599 599 0 1 2 + 601: 181(bvec3) SLessThan 600 180 + 602: 181(bvec3) GroupNonUniformQuadSwap 35 601 478 + 603: 82(ivec3) Select 602 184 180 + 604: 73(ptr) AccessChain 27(data) 597 39 + 605: 20(ivec4) Load 604 + 606: 20(ivec4) VectorShuffle 605 603 4 5 6 3 + Store 604 606 + 607: 6(int) Load 8(invocation) + 608: 73(ptr) AccessChain 27(data) 39 39 + 609: 20(ivec4) Load 608 + 610: 193(bvec4) SLessThan 609 192 + 611: 193(bvec4) GroupNonUniformQuadSwap 35 610 478 + 612: 20(ivec4) Select 611 196 192 + 613: 73(ptr) AccessChain 27(data) 607 39 + Store 613 612 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.subgroupShuffle.comp.out b/deps/glslang/Test/baseResults/spv.subgroupShuffle.comp.out new file mode 100644 index 00000000..991c6fa7 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.subgroupShuffle.comp.out @@ -0,0 +1,462 @@ +spv.subgroupShuffle.comp +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 379 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformShuffle + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 10 12 + ExecutionMode 4 LocalSize 8 8 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + SourceExtension "GL_KHR_shader_subgroup_shuffle" + Name 4 "main" + Name 8 "invocation" + Name 10 "gl_SubgroupInvocationID" + Name 12 "gl_SubgroupSize" + Name 24 "Buffers" + MemberName 24(Buffers) 0 "f4" + MemberName 24(Buffers) 1 "i4" + MemberName 24(Buffers) 2 "u4" + MemberName 24(Buffers) 3 "d4" + Name 27 "data" + Decorate 10(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 10(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 11 RelaxedPrecision + Decorate 12(gl_SubgroupSize) RelaxedPrecision + Decorate 12(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 13 RelaxedPrecision + Decorate 14 RelaxedPrecision + Decorate 16 RelaxedPrecision + MemberDecorate 24(Buffers) 0 Offset 0 + MemberDecorate 24(Buffers) 1 Offset 16 + MemberDecorate 24(Buffers) 2 Offset 32 + MemberDecorate 24(Buffers) 3 Offset 64 + Decorate 24(Buffers) Block + Decorate 27(data) DescriptorSet 0 + Decorate 27(data) Binding 0 + Decorate 378 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypePointer Input 6(int) +10(gl_SubgroupInvocationID): 9(ptr) Variable Input +12(gl_SubgroupSize): 9(ptr) Variable Input + 15: 6(int) Constant 4 + 17: TypeFloat 32 + 18: TypeVector 17(float) 4 + 19: TypeInt 32 1 + 20: TypeVector 19(int) 4 + 21: TypeVector 6(int) 4 + 22: TypeFloat 64 + 23: TypeVector 22(float64_t) 4 + 24(Buffers): TypeStruct 18(fvec4) 20(ivec4) 21(ivec4) 23(f64vec4) + 25: TypeArray 24(Buffers) 15 + 26: TypePointer StorageBuffer 25 + 27(data): 26(ptr) Variable StorageBuffer + 29: 19(int) Constant 0 + 30: 6(int) Constant 0 + 31: TypePointer StorageBuffer 17(float) + 35: 6(int) Constant 3 + 39: 19(int) Constant 1 + 40: TypeVector 17(float) 2 + 41: TypePointer StorageBuffer 18(fvec4) + 51: 19(int) Constant 2 + 52: TypeVector 17(float) 3 + 62: 19(int) Constant 3 + 69: TypePointer StorageBuffer 19(int) + 76: TypeVector 19(int) 2 + 77: TypePointer StorageBuffer 20(ivec4) + 87: TypeVector 19(int) 3 + 103: TypePointer StorageBuffer 6(int) + 110: TypeVector 6(int) 2 + 111: TypePointer StorageBuffer 21(ivec4) + 121: TypeVector 6(int) 3 + 137: TypePointer StorageBuffer 22(float64_t) + 144: TypeVector 22(float64_t) 2 + 145: TypePointer StorageBuffer 23(f64vec4) + 155: TypeVector 22(float64_t) 3 + 173: TypeBool + 183: 76(ivec2) ConstantComposite 29 29 + 184: TypeVector 173(bool) 2 + 188: 76(ivec2) ConstantComposite 39 39 + 197: 87(ivec3) ConstantComposite 29 29 29 + 198: TypeVector 173(bool) 3 + 202: 87(ivec3) ConstantComposite 39 39 39 + 210: 20(ivec4) ConstantComposite 29 29 29 29 + 211: TypeVector 173(bool) 4 + 215: 20(ivec4) ConstantComposite 39 39 39 39 + 376: 6(int) Constant 8 + 377: 6(int) Constant 1 + 378: 121(ivec3) ConstantComposite 376 376 377 + 4(main): 2 Function None 3 + 5: Label + 8(invocation): 7(ptr) Variable Function + 11: 6(int) Load 10(gl_SubgroupInvocationID) + 13: 6(int) Load 12(gl_SubgroupSize) + 14: 6(int) IAdd 11 13 + 16: 6(int) UMod 14 15 + Store 8(invocation) 16 + 28: 6(int) Load 8(invocation) + 32: 31(ptr) AccessChain 27(data) 29 29 30 + 33: 17(float) Load 32 + 34: 6(int) Load 8(invocation) + 36: 17(float) GroupNonUniformShuffle 35 33 34 + 37: 31(ptr) AccessChain 27(data) 28 29 30 + Store 37 36 + 38: 6(int) Load 8(invocation) + 42: 41(ptr) AccessChain 27(data) 39 29 + 43: 18(fvec4) Load 42 + 44: 40(fvec2) VectorShuffle 43 43 0 1 + 45: 6(int) Load 8(invocation) + 46: 40(fvec2) GroupNonUniformShuffle 35 44 45 + 47: 41(ptr) AccessChain 27(data) 38 29 + 48: 18(fvec4) Load 47 + 49: 18(fvec4) VectorShuffle 48 46 4 5 2 3 + Store 47 49 + 50: 6(int) Load 8(invocation) + 53: 41(ptr) AccessChain 27(data) 51 29 + 54: 18(fvec4) Load 53 + 55: 52(fvec3) VectorShuffle 54 54 0 1 2 + 56: 6(int) Load 8(invocation) + 57: 52(fvec3) GroupNonUniformShuffle 35 55 56 + 58: 41(ptr) AccessChain 27(data) 50 29 + 59: 18(fvec4) Load 58 + 60: 18(fvec4) VectorShuffle 59 57 4 5 6 3 + Store 58 60 + 61: 6(int) Load 8(invocation) + 63: 41(ptr) AccessChain 27(data) 62 29 + 64: 18(fvec4) Load 63 + 65: 6(int) Load 8(invocation) + 66: 18(fvec4) GroupNonUniformShuffle 35 64 65 + 67: 41(ptr) AccessChain 27(data) 61 29 + Store 67 66 + 68: 6(int) Load 8(invocation) + 70: 69(ptr) AccessChain 27(data) 29 39 30 + 71: 19(int) Load 70 + 72: 6(int) Load 8(invocation) + 73: 19(int) GroupNonUniformShuffle 35 71 72 + 74: 69(ptr) AccessChain 27(data) 68 39 30 + Store 74 73 + 75: 6(int) Load 8(invocation) + 78: 77(ptr) AccessChain 27(data) 39 39 + 79: 20(ivec4) Load 78 + 80: 76(ivec2) VectorShuffle 79 79 0 1 + 81: 6(int) Load 8(invocation) + 82: 76(ivec2) GroupNonUniformShuffle 35 80 81 + 83: 77(ptr) AccessChain 27(data) 75 39 + 84: 20(ivec4) Load 83 + 85: 20(ivec4) VectorShuffle 84 82 4 5 2 3 + Store 83 85 + 86: 6(int) Load 8(invocation) + 88: 77(ptr) AccessChain 27(data) 51 39 + 89: 20(ivec4) Load 88 + 90: 87(ivec3) VectorShuffle 89 89 0 1 2 + 91: 6(int) Load 8(invocation) + 92: 87(ivec3) GroupNonUniformShuffle 35 90 91 + 93: 77(ptr) AccessChain 27(data) 86 39 + 94: 20(ivec4) Load 93 + 95: 20(ivec4) VectorShuffle 94 92 4 5 6 3 + Store 93 95 + 96: 6(int) Load 8(invocation) + 97: 77(ptr) AccessChain 27(data) 62 39 + 98: 20(ivec4) Load 97 + 99: 6(int) Load 8(invocation) + 100: 20(ivec4) GroupNonUniformShuffle 35 98 99 + 101: 77(ptr) AccessChain 27(data) 96 39 + Store 101 100 + 102: 6(int) Load 8(invocation) + 104: 103(ptr) AccessChain 27(data) 29 51 30 + 105: 6(int) Load 104 + 106: 6(int) Load 8(invocation) + 107: 6(int) GroupNonUniformShuffle 35 105 106 + 108: 103(ptr) AccessChain 27(data) 102 51 30 + Store 108 107 + 109: 6(int) Load 8(invocation) + 112: 111(ptr) AccessChain 27(data) 39 51 + 113: 21(ivec4) Load 112 + 114: 110(ivec2) VectorShuffle 113 113 0 1 + 115: 6(int) Load 8(invocation) + 116: 110(ivec2) GroupNonUniformShuffle 35 114 115 + 117: 111(ptr) AccessChain 27(data) 109 51 + 118: 21(ivec4) Load 117 + 119: 21(ivec4) VectorShuffle 118 116 4 5 2 3 + Store 117 119 + 120: 6(int) Load 8(invocation) + 122: 111(ptr) AccessChain 27(data) 51 51 + 123: 21(ivec4) Load 122 + 124: 121(ivec3) VectorShuffle 123 123 0 1 2 + 125: 6(int) Load 8(invocation) + 126: 121(ivec3) GroupNonUniformShuffle 35 124 125 + 127: 111(ptr) AccessChain 27(data) 120 51 + 128: 21(ivec4) Load 127 + 129: 21(ivec4) VectorShuffle 128 126 4 5 6 3 + Store 127 129 + 130: 6(int) Load 8(invocation) + 131: 111(ptr) AccessChain 27(data) 62 51 + 132: 21(ivec4) Load 131 + 133: 6(int) Load 8(invocation) + 134: 21(ivec4) GroupNonUniformShuffle 35 132 133 + 135: 111(ptr) AccessChain 27(data) 130 51 + Store 135 134 + 136: 6(int) Load 8(invocation) + 138: 137(ptr) AccessChain 27(data) 29 62 30 + 139:22(float64_t) Load 138 + 140: 6(int) Load 8(invocation) + 141:22(float64_t) GroupNonUniformShuffle 35 139 140 + 142: 137(ptr) AccessChain 27(data) 136 62 30 + Store 142 141 + 143: 6(int) Load 8(invocation) + 146: 145(ptr) AccessChain 27(data) 39 62 + 147: 23(f64vec4) Load 146 + 148:144(f64vec2) VectorShuffle 147 147 0 1 + 149: 6(int) Load 8(invocation) + 150:144(f64vec2) GroupNonUniformShuffle 35 148 149 + 151: 145(ptr) AccessChain 27(data) 143 62 + 152: 23(f64vec4) Load 151 + 153: 23(f64vec4) VectorShuffle 152 150 4 5 2 3 + Store 151 153 + 154: 6(int) Load 8(invocation) + 156: 145(ptr) AccessChain 27(data) 51 62 + 157: 23(f64vec4) Load 156 + 158:155(f64vec3) VectorShuffle 157 157 0 1 2 + 159: 6(int) Load 8(invocation) + 160:155(f64vec3) GroupNonUniformShuffle 35 158 159 + 161: 145(ptr) AccessChain 27(data) 154 62 + 162: 23(f64vec4) Load 161 + 163: 23(f64vec4) VectorShuffle 162 160 4 5 6 3 + Store 161 163 + 164: 6(int) Load 8(invocation) + 165: 145(ptr) AccessChain 27(data) 62 62 + 166: 23(f64vec4) Load 165 + 167: 6(int) Load 8(invocation) + 168: 23(f64vec4) GroupNonUniformShuffle 35 166 167 + 169: 145(ptr) AccessChain 27(data) 164 62 + Store 169 168 + 170: 6(int) Load 8(invocation) + 171: 69(ptr) AccessChain 27(data) 29 39 30 + 172: 19(int) Load 171 + 174: 173(bool) SLessThan 172 29 + 175: 6(int) Load 8(invocation) + 176: 173(bool) GroupNonUniformShuffle 35 174 175 + 177: 19(int) Select 176 39 29 + 178: 69(ptr) AccessChain 27(data) 170 39 30 + Store 178 177 + 179: 6(int) Load 8(invocation) + 180: 77(ptr) AccessChain 27(data) 39 39 + 181: 20(ivec4) Load 180 + 182: 76(ivec2) VectorShuffle 181 181 0 1 + 185: 184(bvec2) SLessThan 182 183 + 186: 6(int) Load 8(invocation) + 187: 184(bvec2) GroupNonUniformShuffle 35 185 186 + 189: 76(ivec2) Select 187 188 183 + 190: 77(ptr) AccessChain 27(data) 179 39 + 191: 20(ivec4) Load 190 + 192: 20(ivec4) VectorShuffle 191 189 4 5 2 3 + Store 190 192 + 193: 6(int) Load 8(invocation) + 194: 77(ptr) AccessChain 27(data) 39 39 + 195: 20(ivec4) Load 194 + 196: 87(ivec3) VectorShuffle 195 195 0 1 2 + 199: 198(bvec3) SLessThan 196 197 + 200: 6(int) Load 8(invocation) + 201: 198(bvec3) GroupNonUniformShuffle 35 199 200 + 203: 87(ivec3) Select 201 202 197 + 204: 77(ptr) AccessChain 27(data) 193 39 + 205: 20(ivec4) Load 204 + 206: 20(ivec4) VectorShuffle 205 203 4 5 6 3 + Store 204 206 + 207: 6(int) Load 8(invocation) + 208: 77(ptr) AccessChain 27(data) 39 39 + 209: 20(ivec4) Load 208 + 212: 211(bvec4) SLessThan 209 210 + 213: 6(int) Load 8(invocation) + 214: 211(bvec4) GroupNonUniformShuffle 35 212 213 + 216: 20(ivec4) Select 214 215 210 + 217: 77(ptr) AccessChain 27(data) 207 39 + Store 217 216 + 218: 6(int) Load 8(invocation) + 219: 31(ptr) AccessChain 27(data) 29 29 30 + 220: 17(float) Load 219 + 221: 6(int) Load 8(invocation) + 222: 17(float) GroupNonUniformShuffleXor 35 220 221 + 223: 31(ptr) AccessChain 27(data) 218 29 30 + Store 223 222 + 224: 6(int) Load 8(invocation) + 225: 41(ptr) AccessChain 27(data) 39 29 + 226: 18(fvec4) Load 225 + 227: 40(fvec2) VectorShuffle 226 226 0 1 + 228: 6(int) Load 8(invocation) + 229: 40(fvec2) GroupNonUniformShuffleXor 35 227 228 + 230: 41(ptr) AccessChain 27(data) 224 29 + 231: 18(fvec4) Load 230 + 232: 18(fvec4) VectorShuffle 231 229 4 5 2 3 + Store 230 232 + 233: 6(int) Load 8(invocation) + 234: 41(ptr) AccessChain 27(data) 51 29 + 235: 18(fvec4) Load 234 + 236: 52(fvec3) VectorShuffle 235 235 0 1 2 + 237: 6(int) Load 8(invocation) + 238: 52(fvec3) GroupNonUniformShuffleXor 35 236 237 + 239: 41(ptr) AccessChain 27(data) 233 29 + 240: 18(fvec4) Load 239 + 241: 18(fvec4) VectorShuffle 240 238 4 5 6 3 + Store 239 241 + 242: 6(int) Load 8(invocation) + 243: 41(ptr) AccessChain 27(data) 62 29 + 244: 18(fvec4) Load 243 + 245: 6(int) Load 8(invocation) + 246: 18(fvec4) GroupNonUniformShuffleXor 35 244 245 + 247: 41(ptr) AccessChain 27(data) 242 29 + Store 247 246 + 248: 6(int) Load 8(invocation) + 249: 69(ptr) AccessChain 27(data) 29 39 30 + 250: 19(int) Load 249 + 251: 6(int) Load 8(invocation) + 252: 19(int) GroupNonUniformShuffleXor 35 250 251 + 253: 69(ptr) AccessChain 27(data) 248 39 30 + Store 253 252 + 254: 6(int) Load 8(invocation) + 255: 77(ptr) AccessChain 27(data) 39 39 + 256: 20(ivec4) Load 255 + 257: 76(ivec2) VectorShuffle 256 256 0 1 + 258: 6(int) Load 8(invocation) + 259: 76(ivec2) GroupNonUniformShuffleXor 35 257 258 + 260: 77(ptr) AccessChain 27(data) 254 39 + 261: 20(ivec4) Load 260 + 262: 20(ivec4) VectorShuffle 261 259 4 5 2 3 + Store 260 262 + 263: 6(int) Load 8(invocation) + 264: 77(ptr) AccessChain 27(data) 51 39 + 265: 20(ivec4) Load 264 + 266: 87(ivec3) VectorShuffle 265 265 0 1 2 + 267: 6(int) Load 8(invocation) + 268: 87(ivec3) GroupNonUniformShuffleXor 35 266 267 + 269: 77(ptr) AccessChain 27(data) 263 39 + 270: 20(ivec4) Load 269 + 271: 20(ivec4) VectorShuffle 270 268 4 5 6 3 + Store 269 271 + 272: 6(int) Load 8(invocation) + 273: 77(ptr) AccessChain 27(data) 62 39 + 274: 20(ivec4) Load 273 + 275: 6(int) Load 8(invocation) + 276: 20(ivec4) GroupNonUniformShuffleXor 35 274 275 + 277: 77(ptr) AccessChain 27(data) 272 39 + Store 277 276 + 278: 6(int) Load 8(invocation) + 279: 103(ptr) AccessChain 27(data) 29 51 30 + 280: 6(int) Load 279 + 281: 6(int) Load 8(invocation) + 282: 6(int) GroupNonUniformShuffleXor 35 280 281 + 283: 103(ptr) AccessChain 27(data) 278 51 30 + Store 283 282 + 284: 6(int) Load 8(invocation) + 285: 111(ptr) AccessChain 27(data) 39 51 + 286: 21(ivec4) Load 285 + 287: 110(ivec2) VectorShuffle 286 286 0 1 + 288: 6(int) Load 8(invocation) + 289: 110(ivec2) GroupNonUniformShuffleXor 35 287 288 + 290: 111(ptr) AccessChain 27(data) 284 51 + 291: 21(ivec4) Load 290 + 292: 21(ivec4) VectorShuffle 291 289 4 5 2 3 + Store 290 292 + 293: 6(int) Load 8(invocation) + 294: 111(ptr) AccessChain 27(data) 51 51 + 295: 21(ivec4) Load 294 + 296: 121(ivec3) VectorShuffle 295 295 0 1 2 + 297: 6(int) Load 8(invocation) + 298: 121(ivec3) GroupNonUniformShuffleXor 35 296 297 + 299: 111(ptr) AccessChain 27(data) 293 51 + 300: 21(ivec4) Load 299 + 301: 21(ivec4) VectorShuffle 300 298 4 5 6 3 + Store 299 301 + 302: 6(int) Load 8(invocation) + 303: 111(ptr) AccessChain 27(data) 62 51 + 304: 21(ivec4) Load 303 + 305: 6(int) Load 8(invocation) + 306: 21(ivec4) GroupNonUniformShuffleXor 35 304 305 + 307: 111(ptr) AccessChain 27(data) 302 51 + Store 307 306 + 308: 6(int) Load 8(invocation) + 309: 137(ptr) AccessChain 27(data) 29 62 30 + 310:22(float64_t) Load 309 + 311: 6(int) Load 8(invocation) + 312:22(float64_t) GroupNonUniformShuffleXor 35 310 311 + 313: 137(ptr) AccessChain 27(data) 308 62 30 + Store 313 312 + 314: 6(int) Load 8(invocation) + 315: 145(ptr) AccessChain 27(data) 39 62 + 316: 23(f64vec4) Load 315 + 317:144(f64vec2) VectorShuffle 316 316 0 1 + 318: 6(int) Load 8(invocation) + 319:144(f64vec2) GroupNonUniformShuffleXor 35 317 318 + 320: 145(ptr) AccessChain 27(data) 314 62 + 321: 23(f64vec4) Load 320 + 322: 23(f64vec4) VectorShuffle 321 319 4 5 2 3 + Store 320 322 + 323: 6(int) Load 8(invocation) + 324: 145(ptr) AccessChain 27(data) 51 62 + 325: 23(f64vec4) Load 324 + 326:155(f64vec3) VectorShuffle 325 325 0 1 2 + 327: 6(int) Load 8(invocation) + 328:155(f64vec3) GroupNonUniformShuffleXor 35 326 327 + 329: 145(ptr) AccessChain 27(data) 323 62 + 330: 23(f64vec4) Load 329 + 331: 23(f64vec4) VectorShuffle 330 328 4 5 6 3 + Store 329 331 + 332: 6(int) Load 8(invocation) + 333: 145(ptr) AccessChain 27(data) 62 62 + 334: 23(f64vec4) Load 333 + 335: 6(int) Load 8(invocation) + 336: 23(f64vec4) GroupNonUniformShuffleXor 35 334 335 + 337: 145(ptr) AccessChain 27(data) 332 62 + Store 337 336 + 338: 6(int) Load 8(invocation) + 339: 69(ptr) AccessChain 27(data) 29 39 30 + 340: 19(int) Load 339 + 341: 173(bool) SLessThan 340 29 + 342: 6(int) Load 8(invocation) + 343: 173(bool) GroupNonUniformShuffleXor 35 341 342 + 344: 19(int) Select 343 39 29 + 345: 69(ptr) AccessChain 27(data) 338 39 30 + Store 345 344 + 346: 6(int) Load 8(invocation) + 347: 77(ptr) AccessChain 27(data) 39 39 + 348: 20(ivec4) Load 347 + 349: 76(ivec2) VectorShuffle 348 348 0 1 + 350: 184(bvec2) SLessThan 349 183 + 351: 6(int) Load 8(invocation) + 352: 184(bvec2) GroupNonUniformShuffleXor 35 350 351 + 353: 76(ivec2) Select 352 188 183 + 354: 77(ptr) AccessChain 27(data) 346 39 + 355: 20(ivec4) Load 354 + 356: 20(ivec4) VectorShuffle 355 353 4 5 2 3 + Store 354 356 + 357: 6(int) Load 8(invocation) + 358: 77(ptr) AccessChain 27(data) 39 39 + 359: 20(ivec4) Load 358 + 360: 87(ivec3) VectorShuffle 359 359 0 1 2 + 361: 198(bvec3) SLessThan 360 197 + 362: 6(int) Load 8(invocation) + 363: 198(bvec3) GroupNonUniformShuffleXor 35 361 362 + 364: 87(ivec3) Select 363 202 197 + 365: 77(ptr) AccessChain 27(data) 357 39 + 366: 20(ivec4) Load 365 + 367: 20(ivec4) VectorShuffle 366 364 4 5 6 3 + Store 365 367 + 368: 6(int) Load 8(invocation) + 369: 77(ptr) AccessChain 27(data) 39 39 + 370: 20(ivec4) Load 369 + 371: 211(bvec4) SLessThan 370 210 + 372: 6(int) Load 8(invocation) + 373: 211(bvec4) GroupNonUniformShuffleXor 35 371 372 + 374: 20(ivec4) Select 373 215 210 + 375: 77(ptr) AccessChain 27(data) 368 39 + Store 375 374 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.subgroupShuffleRelative.comp.out b/deps/glslang/Test/baseResults/spv.subgroupShuffleRelative.comp.out new file mode 100644 index 00000000..3aad7605 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.subgroupShuffleRelative.comp.out @@ -0,0 +1,462 @@ +spv.subgroupShuffleRelative.comp +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 379 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformShuffleRelative + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 10 12 + ExecutionMode 4 LocalSize 8 8 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + SourceExtension "GL_KHR_shader_subgroup_shuffle_relative" + Name 4 "main" + Name 8 "invocation" + Name 10 "gl_SubgroupInvocationID" + Name 12 "gl_SubgroupSize" + Name 24 "Buffers" + MemberName 24(Buffers) 0 "f4" + MemberName 24(Buffers) 1 "i4" + MemberName 24(Buffers) 2 "u4" + MemberName 24(Buffers) 3 "d4" + Name 27 "data" + Decorate 10(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 10(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 11 RelaxedPrecision + Decorate 12(gl_SubgroupSize) RelaxedPrecision + Decorate 12(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 13 RelaxedPrecision + Decorate 14 RelaxedPrecision + Decorate 16 RelaxedPrecision + MemberDecorate 24(Buffers) 0 Offset 0 + MemberDecorate 24(Buffers) 1 Offset 16 + MemberDecorate 24(Buffers) 2 Offset 32 + MemberDecorate 24(Buffers) 3 Offset 64 + Decorate 24(Buffers) Block + Decorate 27(data) DescriptorSet 0 + Decorate 27(data) Binding 0 + Decorate 378 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypePointer Input 6(int) +10(gl_SubgroupInvocationID): 9(ptr) Variable Input +12(gl_SubgroupSize): 9(ptr) Variable Input + 15: 6(int) Constant 4 + 17: TypeFloat 32 + 18: TypeVector 17(float) 4 + 19: TypeInt 32 1 + 20: TypeVector 19(int) 4 + 21: TypeVector 6(int) 4 + 22: TypeFloat 64 + 23: TypeVector 22(float64_t) 4 + 24(Buffers): TypeStruct 18(fvec4) 20(ivec4) 21(ivec4) 23(f64vec4) + 25: TypeArray 24(Buffers) 15 + 26: TypePointer StorageBuffer 25 + 27(data): 26(ptr) Variable StorageBuffer + 29: 19(int) Constant 0 + 30: 6(int) Constant 0 + 31: TypePointer StorageBuffer 17(float) + 35: 6(int) Constant 3 + 39: 19(int) Constant 1 + 40: TypeVector 17(float) 2 + 41: TypePointer StorageBuffer 18(fvec4) + 51: 19(int) Constant 2 + 52: TypeVector 17(float) 3 + 62: 19(int) Constant 3 + 69: TypePointer StorageBuffer 19(int) + 76: TypeVector 19(int) 2 + 77: TypePointer StorageBuffer 20(ivec4) + 87: TypeVector 19(int) 3 + 103: TypePointer StorageBuffer 6(int) + 110: TypeVector 6(int) 2 + 111: TypePointer StorageBuffer 21(ivec4) + 121: TypeVector 6(int) 3 + 137: TypePointer StorageBuffer 22(float64_t) + 144: TypeVector 22(float64_t) 2 + 145: TypePointer StorageBuffer 23(f64vec4) + 155: TypeVector 22(float64_t) 3 + 173: TypeBool + 183: 76(ivec2) ConstantComposite 29 29 + 184: TypeVector 173(bool) 2 + 188: 76(ivec2) ConstantComposite 39 39 + 197: 87(ivec3) ConstantComposite 29 29 29 + 198: TypeVector 173(bool) 3 + 202: 87(ivec3) ConstantComposite 39 39 39 + 210: 20(ivec4) ConstantComposite 29 29 29 29 + 211: TypeVector 173(bool) 4 + 215: 20(ivec4) ConstantComposite 39 39 39 39 + 376: 6(int) Constant 8 + 377: 6(int) Constant 1 + 378: 121(ivec3) ConstantComposite 376 376 377 + 4(main): 2 Function None 3 + 5: Label + 8(invocation): 7(ptr) Variable Function + 11: 6(int) Load 10(gl_SubgroupInvocationID) + 13: 6(int) Load 12(gl_SubgroupSize) + 14: 6(int) IAdd 11 13 + 16: 6(int) UMod 14 15 + Store 8(invocation) 16 + 28: 6(int) Load 8(invocation) + 32: 31(ptr) AccessChain 27(data) 29 29 30 + 33: 17(float) Load 32 + 34: 6(int) Load 8(invocation) + 36: 17(float) GroupNonUniformShuffleUp 35 33 34 + 37: 31(ptr) AccessChain 27(data) 28 29 30 + Store 37 36 + 38: 6(int) Load 8(invocation) + 42: 41(ptr) AccessChain 27(data) 39 29 + 43: 18(fvec4) Load 42 + 44: 40(fvec2) VectorShuffle 43 43 0 1 + 45: 6(int) Load 8(invocation) + 46: 40(fvec2) GroupNonUniformShuffleUp 35 44 45 + 47: 41(ptr) AccessChain 27(data) 38 29 + 48: 18(fvec4) Load 47 + 49: 18(fvec4) VectorShuffle 48 46 4 5 2 3 + Store 47 49 + 50: 6(int) Load 8(invocation) + 53: 41(ptr) AccessChain 27(data) 51 29 + 54: 18(fvec4) Load 53 + 55: 52(fvec3) VectorShuffle 54 54 0 1 2 + 56: 6(int) Load 8(invocation) + 57: 52(fvec3) GroupNonUniformShuffleUp 35 55 56 + 58: 41(ptr) AccessChain 27(data) 50 29 + 59: 18(fvec4) Load 58 + 60: 18(fvec4) VectorShuffle 59 57 4 5 6 3 + Store 58 60 + 61: 6(int) Load 8(invocation) + 63: 41(ptr) AccessChain 27(data) 62 29 + 64: 18(fvec4) Load 63 + 65: 6(int) Load 8(invocation) + 66: 18(fvec4) GroupNonUniformShuffleUp 35 64 65 + 67: 41(ptr) AccessChain 27(data) 61 29 + Store 67 66 + 68: 6(int) Load 8(invocation) + 70: 69(ptr) AccessChain 27(data) 29 39 30 + 71: 19(int) Load 70 + 72: 6(int) Load 8(invocation) + 73: 19(int) GroupNonUniformShuffleUp 35 71 72 + 74: 69(ptr) AccessChain 27(data) 68 39 30 + Store 74 73 + 75: 6(int) Load 8(invocation) + 78: 77(ptr) AccessChain 27(data) 39 39 + 79: 20(ivec4) Load 78 + 80: 76(ivec2) VectorShuffle 79 79 0 1 + 81: 6(int) Load 8(invocation) + 82: 76(ivec2) GroupNonUniformShuffleUp 35 80 81 + 83: 77(ptr) AccessChain 27(data) 75 39 + 84: 20(ivec4) Load 83 + 85: 20(ivec4) VectorShuffle 84 82 4 5 2 3 + Store 83 85 + 86: 6(int) Load 8(invocation) + 88: 77(ptr) AccessChain 27(data) 51 39 + 89: 20(ivec4) Load 88 + 90: 87(ivec3) VectorShuffle 89 89 0 1 2 + 91: 6(int) Load 8(invocation) + 92: 87(ivec3) GroupNonUniformShuffleUp 35 90 91 + 93: 77(ptr) AccessChain 27(data) 86 39 + 94: 20(ivec4) Load 93 + 95: 20(ivec4) VectorShuffle 94 92 4 5 6 3 + Store 93 95 + 96: 6(int) Load 8(invocation) + 97: 77(ptr) AccessChain 27(data) 62 39 + 98: 20(ivec4) Load 97 + 99: 6(int) Load 8(invocation) + 100: 20(ivec4) GroupNonUniformShuffleUp 35 98 99 + 101: 77(ptr) AccessChain 27(data) 96 39 + Store 101 100 + 102: 6(int) Load 8(invocation) + 104: 103(ptr) AccessChain 27(data) 29 51 30 + 105: 6(int) Load 104 + 106: 6(int) Load 8(invocation) + 107: 6(int) GroupNonUniformShuffleUp 35 105 106 + 108: 103(ptr) AccessChain 27(data) 102 51 30 + Store 108 107 + 109: 6(int) Load 8(invocation) + 112: 111(ptr) AccessChain 27(data) 39 51 + 113: 21(ivec4) Load 112 + 114: 110(ivec2) VectorShuffle 113 113 0 1 + 115: 6(int) Load 8(invocation) + 116: 110(ivec2) GroupNonUniformShuffleUp 35 114 115 + 117: 111(ptr) AccessChain 27(data) 109 51 + 118: 21(ivec4) Load 117 + 119: 21(ivec4) VectorShuffle 118 116 4 5 2 3 + Store 117 119 + 120: 6(int) Load 8(invocation) + 122: 111(ptr) AccessChain 27(data) 51 51 + 123: 21(ivec4) Load 122 + 124: 121(ivec3) VectorShuffle 123 123 0 1 2 + 125: 6(int) Load 8(invocation) + 126: 121(ivec3) GroupNonUniformShuffleUp 35 124 125 + 127: 111(ptr) AccessChain 27(data) 120 51 + 128: 21(ivec4) Load 127 + 129: 21(ivec4) VectorShuffle 128 126 4 5 6 3 + Store 127 129 + 130: 6(int) Load 8(invocation) + 131: 111(ptr) AccessChain 27(data) 62 51 + 132: 21(ivec4) Load 131 + 133: 6(int) Load 8(invocation) + 134: 21(ivec4) GroupNonUniformShuffleUp 35 132 133 + 135: 111(ptr) AccessChain 27(data) 130 51 + Store 135 134 + 136: 6(int) Load 8(invocation) + 138: 137(ptr) AccessChain 27(data) 29 62 30 + 139:22(float64_t) Load 138 + 140: 6(int) Load 8(invocation) + 141:22(float64_t) GroupNonUniformShuffleUp 35 139 140 + 142: 137(ptr) AccessChain 27(data) 136 62 30 + Store 142 141 + 143: 6(int) Load 8(invocation) + 146: 145(ptr) AccessChain 27(data) 39 62 + 147: 23(f64vec4) Load 146 + 148:144(f64vec2) VectorShuffle 147 147 0 1 + 149: 6(int) Load 8(invocation) + 150:144(f64vec2) GroupNonUniformShuffleUp 35 148 149 + 151: 145(ptr) AccessChain 27(data) 143 62 + 152: 23(f64vec4) Load 151 + 153: 23(f64vec4) VectorShuffle 152 150 4 5 2 3 + Store 151 153 + 154: 6(int) Load 8(invocation) + 156: 145(ptr) AccessChain 27(data) 51 62 + 157: 23(f64vec4) Load 156 + 158:155(f64vec3) VectorShuffle 157 157 0 1 2 + 159: 6(int) Load 8(invocation) + 160:155(f64vec3) GroupNonUniformShuffleUp 35 158 159 + 161: 145(ptr) AccessChain 27(data) 154 62 + 162: 23(f64vec4) Load 161 + 163: 23(f64vec4) VectorShuffle 162 160 4 5 6 3 + Store 161 163 + 164: 6(int) Load 8(invocation) + 165: 145(ptr) AccessChain 27(data) 62 62 + 166: 23(f64vec4) Load 165 + 167: 6(int) Load 8(invocation) + 168: 23(f64vec4) GroupNonUniformShuffleUp 35 166 167 + 169: 145(ptr) AccessChain 27(data) 164 62 + Store 169 168 + 170: 6(int) Load 8(invocation) + 171: 69(ptr) AccessChain 27(data) 29 39 30 + 172: 19(int) Load 171 + 174: 173(bool) SLessThan 172 29 + 175: 6(int) Load 8(invocation) + 176: 173(bool) GroupNonUniformShuffleUp 35 174 175 + 177: 19(int) Select 176 39 29 + 178: 69(ptr) AccessChain 27(data) 170 39 30 + Store 178 177 + 179: 6(int) Load 8(invocation) + 180: 77(ptr) AccessChain 27(data) 39 39 + 181: 20(ivec4) Load 180 + 182: 76(ivec2) VectorShuffle 181 181 0 1 + 185: 184(bvec2) SLessThan 182 183 + 186: 6(int) Load 8(invocation) + 187: 184(bvec2) GroupNonUniformShuffleUp 35 185 186 + 189: 76(ivec2) Select 187 188 183 + 190: 77(ptr) AccessChain 27(data) 179 39 + 191: 20(ivec4) Load 190 + 192: 20(ivec4) VectorShuffle 191 189 4 5 2 3 + Store 190 192 + 193: 6(int) Load 8(invocation) + 194: 77(ptr) AccessChain 27(data) 39 39 + 195: 20(ivec4) Load 194 + 196: 87(ivec3) VectorShuffle 195 195 0 1 2 + 199: 198(bvec3) SLessThan 196 197 + 200: 6(int) Load 8(invocation) + 201: 198(bvec3) GroupNonUniformShuffleUp 35 199 200 + 203: 87(ivec3) Select 201 202 197 + 204: 77(ptr) AccessChain 27(data) 193 39 + 205: 20(ivec4) Load 204 + 206: 20(ivec4) VectorShuffle 205 203 4 5 6 3 + Store 204 206 + 207: 6(int) Load 8(invocation) + 208: 77(ptr) AccessChain 27(data) 39 39 + 209: 20(ivec4) Load 208 + 212: 211(bvec4) SLessThan 209 210 + 213: 6(int) Load 8(invocation) + 214: 211(bvec4) GroupNonUniformShuffleUp 35 212 213 + 216: 20(ivec4) Select 214 215 210 + 217: 77(ptr) AccessChain 27(data) 207 39 + Store 217 216 + 218: 6(int) Load 8(invocation) + 219: 31(ptr) AccessChain 27(data) 29 29 30 + 220: 17(float) Load 219 + 221: 6(int) Load 8(invocation) + 222: 17(float) GroupNonUniformShuffleDown 35 220 221 + 223: 31(ptr) AccessChain 27(data) 218 29 30 + Store 223 222 + 224: 6(int) Load 8(invocation) + 225: 41(ptr) AccessChain 27(data) 39 29 + 226: 18(fvec4) Load 225 + 227: 40(fvec2) VectorShuffle 226 226 0 1 + 228: 6(int) Load 8(invocation) + 229: 40(fvec2) GroupNonUniformShuffleDown 35 227 228 + 230: 41(ptr) AccessChain 27(data) 224 29 + 231: 18(fvec4) Load 230 + 232: 18(fvec4) VectorShuffle 231 229 4 5 2 3 + Store 230 232 + 233: 6(int) Load 8(invocation) + 234: 41(ptr) AccessChain 27(data) 51 29 + 235: 18(fvec4) Load 234 + 236: 52(fvec3) VectorShuffle 235 235 0 1 2 + 237: 6(int) Load 8(invocation) + 238: 52(fvec3) GroupNonUniformShuffleDown 35 236 237 + 239: 41(ptr) AccessChain 27(data) 233 29 + 240: 18(fvec4) Load 239 + 241: 18(fvec4) VectorShuffle 240 238 4 5 6 3 + Store 239 241 + 242: 6(int) Load 8(invocation) + 243: 41(ptr) AccessChain 27(data) 62 29 + 244: 18(fvec4) Load 243 + 245: 6(int) Load 8(invocation) + 246: 18(fvec4) GroupNonUniformShuffleDown 35 244 245 + 247: 41(ptr) AccessChain 27(data) 242 29 + Store 247 246 + 248: 6(int) Load 8(invocation) + 249: 69(ptr) AccessChain 27(data) 29 39 30 + 250: 19(int) Load 249 + 251: 6(int) Load 8(invocation) + 252: 19(int) GroupNonUniformShuffleDown 35 250 251 + 253: 69(ptr) AccessChain 27(data) 248 39 30 + Store 253 252 + 254: 6(int) Load 8(invocation) + 255: 77(ptr) AccessChain 27(data) 39 39 + 256: 20(ivec4) Load 255 + 257: 76(ivec2) VectorShuffle 256 256 0 1 + 258: 6(int) Load 8(invocation) + 259: 76(ivec2) GroupNonUniformShuffleDown 35 257 258 + 260: 77(ptr) AccessChain 27(data) 254 39 + 261: 20(ivec4) Load 260 + 262: 20(ivec4) VectorShuffle 261 259 4 5 2 3 + Store 260 262 + 263: 6(int) Load 8(invocation) + 264: 77(ptr) AccessChain 27(data) 51 39 + 265: 20(ivec4) Load 264 + 266: 87(ivec3) VectorShuffle 265 265 0 1 2 + 267: 6(int) Load 8(invocation) + 268: 87(ivec3) GroupNonUniformShuffleDown 35 266 267 + 269: 77(ptr) AccessChain 27(data) 263 39 + 270: 20(ivec4) Load 269 + 271: 20(ivec4) VectorShuffle 270 268 4 5 6 3 + Store 269 271 + 272: 6(int) Load 8(invocation) + 273: 77(ptr) AccessChain 27(data) 62 39 + 274: 20(ivec4) Load 273 + 275: 6(int) Load 8(invocation) + 276: 20(ivec4) GroupNonUniformShuffleDown 35 274 275 + 277: 77(ptr) AccessChain 27(data) 272 39 + Store 277 276 + 278: 6(int) Load 8(invocation) + 279: 103(ptr) AccessChain 27(data) 29 51 30 + 280: 6(int) Load 279 + 281: 6(int) Load 8(invocation) + 282: 6(int) GroupNonUniformShuffleDown 35 280 281 + 283: 103(ptr) AccessChain 27(data) 278 51 30 + Store 283 282 + 284: 6(int) Load 8(invocation) + 285: 111(ptr) AccessChain 27(data) 39 51 + 286: 21(ivec4) Load 285 + 287: 110(ivec2) VectorShuffle 286 286 0 1 + 288: 6(int) Load 8(invocation) + 289: 110(ivec2) GroupNonUniformShuffleDown 35 287 288 + 290: 111(ptr) AccessChain 27(data) 284 51 + 291: 21(ivec4) Load 290 + 292: 21(ivec4) VectorShuffle 291 289 4 5 2 3 + Store 290 292 + 293: 6(int) Load 8(invocation) + 294: 111(ptr) AccessChain 27(data) 51 51 + 295: 21(ivec4) Load 294 + 296: 121(ivec3) VectorShuffle 295 295 0 1 2 + 297: 6(int) Load 8(invocation) + 298: 121(ivec3) GroupNonUniformShuffleDown 35 296 297 + 299: 111(ptr) AccessChain 27(data) 293 51 + 300: 21(ivec4) Load 299 + 301: 21(ivec4) VectorShuffle 300 298 4 5 6 3 + Store 299 301 + 302: 6(int) Load 8(invocation) + 303: 111(ptr) AccessChain 27(data) 62 51 + 304: 21(ivec4) Load 303 + 305: 6(int) Load 8(invocation) + 306: 21(ivec4) GroupNonUniformShuffleDown 35 304 305 + 307: 111(ptr) AccessChain 27(data) 302 51 + Store 307 306 + 308: 6(int) Load 8(invocation) + 309: 137(ptr) AccessChain 27(data) 29 62 30 + 310:22(float64_t) Load 309 + 311: 6(int) Load 8(invocation) + 312:22(float64_t) GroupNonUniformShuffleDown 35 310 311 + 313: 137(ptr) AccessChain 27(data) 308 62 30 + Store 313 312 + 314: 6(int) Load 8(invocation) + 315: 145(ptr) AccessChain 27(data) 39 62 + 316: 23(f64vec4) Load 315 + 317:144(f64vec2) VectorShuffle 316 316 0 1 + 318: 6(int) Load 8(invocation) + 319:144(f64vec2) GroupNonUniformShuffleDown 35 317 318 + 320: 145(ptr) AccessChain 27(data) 314 62 + 321: 23(f64vec4) Load 320 + 322: 23(f64vec4) VectorShuffle 321 319 4 5 2 3 + Store 320 322 + 323: 6(int) Load 8(invocation) + 324: 145(ptr) AccessChain 27(data) 51 62 + 325: 23(f64vec4) Load 324 + 326:155(f64vec3) VectorShuffle 325 325 0 1 2 + 327: 6(int) Load 8(invocation) + 328:155(f64vec3) GroupNonUniformShuffleDown 35 326 327 + 329: 145(ptr) AccessChain 27(data) 323 62 + 330: 23(f64vec4) Load 329 + 331: 23(f64vec4) VectorShuffle 330 328 4 5 6 3 + Store 329 331 + 332: 6(int) Load 8(invocation) + 333: 145(ptr) AccessChain 27(data) 62 62 + 334: 23(f64vec4) Load 333 + 335: 6(int) Load 8(invocation) + 336: 23(f64vec4) GroupNonUniformShuffleDown 35 334 335 + 337: 145(ptr) AccessChain 27(data) 332 62 + Store 337 336 + 338: 6(int) Load 8(invocation) + 339: 69(ptr) AccessChain 27(data) 29 39 30 + 340: 19(int) Load 339 + 341: 173(bool) SLessThan 340 29 + 342: 6(int) Load 8(invocation) + 343: 173(bool) GroupNonUniformShuffleDown 35 341 342 + 344: 19(int) Select 343 39 29 + 345: 69(ptr) AccessChain 27(data) 338 39 30 + Store 345 344 + 346: 6(int) Load 8(invocation) + 347: 77(ptr) AccessChain 27(data) 39 39 + 348: 20(ivec4) Load 347 + 349: 76(ivec2) VectorShuffle 348 348 0 1 + 350: 184(bvec2) SLessThan 349 183 + 351: 6(int) Load 8(invocation) + 352: 184(bvec2) GroupNonUniformShuffleDown 35 350 351 + 353: 76(ivec2) Select 352 188 183 + 354: 77(ptr) AccessChain 27(data) 346 39 + 355: 20(ivec4) Load 354 + 356: 20(ivec4) VectorShuffle 355 353 4 5 2 3 + Store 354 356 + 357: 6(int) Load 8(invocation) + 358: 77(ptr) AccessChain 27(data) 39 39 + 359: 20(ivec4) Load 358 + 360: 87(ivec3) VectorShuffle 359 359 0 1 2 + 361: 198(bvec3) SLessThan 360 197 + 362: 6(int) Load 8(invocation) + 363: 198(bvec3) GroupNonUniformShuffleDown 35 361 362 + 364: 87(ivec3) Select 363 202 197 + 365: 77(ptr) AccessChain 27(data) 357 39 + 366: 20(ivec4) Load 365 + 367: 20(ivec4) VectorShuffle 366 364 4 5 6 3 + Store 365 367 + 368: 6(int) Load 8(invocation) + 369: 77(ptr) AccessChain 27(data) 39 39 + 370: 20(ivec4) Load 369 + 371: 211(bvec4) SLessThan 370 210 + 372: 6(int) Load 8(invocation) + 373: 211(bvec4) GroupNonUniformShuffleDown 35 371 372 + 374: 20(ivec4) Select 373 215 210 + 375: 77(ptr) AccessChain 27(data) 368 39 + Store 375 374 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.subgroupVote.comp.out b/deps/glslang/Test/baseResults/spv.subgroupVote.comp.out new file mode 100644 index 00000000..4fdbb0be --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.subgroupVote.comp.out @@ -0,0 +1,288 @@ +spv.subgroupVote.comp +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 216 + + Capability Shader + Capability Float64 + Capability GroupNonUniform + Capability GroupNonUniformVote + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 10 12 + ExecutionMode 4 LocalSize 8 8 1 + Source GLSL 450 + SourceExtension "GL_KHR_shader_subgroup_basic" + SourceExtension "GL_KHR_shader_subgroup_vote" + Name 4 "main" + Name 8 "invocation" + Name 10 "gl_SubgroupInvocationID" + Name 12 "gl_SubgroupSize" + Name 24 "Buffers" + MemberName 24(Buffers) 0 "f4" + MemberName 24(Buffers) 1 "i4" + MemberName 24(Buffers) 2 "u4" + MemberName 24(Buffers) 3 "d4" + MemberName 24(Buffers) 4 "r" + Name 27 "data" + Decorate 10(gl_SubgroupInvocationID) RelaxedPrecision + Decorate 10(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId + Decorate 11 RelaxedPrecision + Decorate 12(gl_SubgroupSize) RelaxedPrecision + Decorate 12(gl_SubgroupSize) BuiltIn SubgroupSize + Decorate 13 RelaxedPrecision + Decorate 14 RelaxedPrecision + Decorate 16 RelaxedPrecision + MemberDecorate 24(Buffers) 0 Offset 0 + MemberDecorate 24(Buffers) 1 Offset 16 + MemberDecorate 24(Buffers) 2 Offset 32 + MemberDecorate 24(Buffers) 3 Offset 64 + MemberDecorate 24(Buffers) 4 Offset 96 + Decorate 24(Buffers) Block + Decorate 27(data) DescriptorSet 0 + Decorate 27(data) Binding 0 + Decorate 215 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypePointer Input 6(int) +10(gl_SubgroupInvocationID): 9(ptr) Variable Input +12(gl_SubgroupSize): 9(ptr) Variable Input + 15: 6(int) Constant 4 + 17: TypeFloat 32 + 18: TypeVector 17(float) 4 + 19: TypeInt 32 1 + 20: TypeVector 19(int) 4 + 21: TypeVector 6(int) 4 + 22: TypeFloat 64 + 23: TypeVector 22(float64_t) 4 + 24(Buffers): TypeStruct 18(fvec4) 20(ivec4) 21(ivec4) 23(f64vec4) 19(int) + 25: TypeArray 24(Buffers) 15 + 26: TypePointer StorageBuffer 25 + 27(data): 26(ptr) Variable StorageBuffer + 29: 19(int) Constant 4 + 30: TypePointer StorageBuffer 19(int) + 33: 19(int) Constant 0 + 34: TypeBool + 36: 6(int) Constant 3 + 41: 6(int) Constant 0 + 42: TypePointer StorageBuffer 17(float) + 46: 19(int) Constant 1 + 50: TypeVector 17(float) 2 + 51: TypePointer StorageBuffer 18(fvec4) + 59: 19(int) Constant 2 + 60: TypeVector 17(float) 3 + 68: 19(int) Constant 3 + 81: TypeVector 19(int) 2 + 82: TypePointer StorageBuffer 20(ivec4) + 90: TypeVector 19(int) 3 + 104: TypePointer StorageBuffer 6(int) + 111: TypeVector 6(int) 2 + 112: TypePointer StorageBuffer 21(ivec4) + 120: TypeVector 6(int) 3 + 142: TypePointer StorageBuffer 22(float64_t) + 149: TypeVector 22(float64_t) 2 + 150: TypePointer StorageBuffer 23(f64vec4) + 158: TypeVector 22(float64_t) 3 + 182: 81(ivec2) ConstantComposite 33 33 + 183: TypeVector 34(bool) 2 + 194: 90(ivec3) ConstantComposite 33 33 33 + 195: TypeVector 34(bool) 3 + 205: 20(ivec4) ConstantComposite 33 33 33 33 + 206: TypeVector 34(bool) 4 + 213: 6(int) Constant 8 + 214: 6(int) Constant 1 + 215: 120(ivec3) ConstantComposite 213 213 214 + 4(main): 2 Function None 3 + 5: Label + 8(invocation): 7(ptr) Variable Function + 11: 6(int) Load 10(gl_SubgroupInvocationID) + 13: 6(int) Load 12(gl_SubgroupSize) + 14: 6(int) IAdd 11 13 + 16: 6(int) UMod 14 15 + Store 8(invocation) 16 + 28: 6(int) Load 8(invocation) + 31: 30(ptr) AccessChain 27(data) 28 29 + 32: 19(int) Load 31 + 35: 34(bool) SLessThan 32 33 + 37: 34(bool) GroupNonUniformAll 36 35 + SelectionMerge 39 None + BranchConditional 37 38 133 + 38: Label + 40: 6(int) Load 8(invocation) + 43: 42(ptr) AccessChain 27(data) 33 33 41 + 44: 17(float) Load 43 + 45: 34(bool) GroupNonUniformAllEqual 36 44 + 47: 19(int) Select 45 46 33 + 48: 30(ptr) AccessChain 27(data) 40 29 + Store 48 47 + 49: 6(int) Load 8(invocation) + 52: 51(ptr) AccessChain 27(data) 46 33 + 53: 18(fvec4) Load 52 + 54: 50(fvec2) VectorShuffle 53 53 0 1 + 55: 34(bool) GroupNonUniformAllEqual 36 54 + 56: 19(int) Select 55 46 33 + 57: 30(ptr) AccessChain 27(data) 49 29 + Store 57 56 + 58: 6(int) Load 8(invocation) + 61: 51(ptr) AccessChain 27(data) 59 33 + 62: 18(fvec4) Load 61 + 63: 60(fvec3) VectorShuffle 62 62 0 1 2 + 64: 34(bool) GroupNonUniformAllEqual 36 63 + 65: 19(int) Select 64 46 33 + 66: 30(ptr) AccessChain 27(data) 58 29 + Store 66 65 + 67: 6(int) Load 8(invocation) + 69: 51(ptr) AccessChain 27(data) 68 33 + 70: 18(fvec4) Load 69 + 71: 34(bool) GroupNonUniformAllEqual 36 70 + 72: 19(int) Select 71 46 33 + 73: 30(ptr) AccessChain 27(data) 67 29 + Store 73 72 + 74: 6(int) Load 8(invocation) + 75: 30(ptr) AccessChain 27(data) 33 46 41 + 76: 19(int) Load 75 + 77: 34(bool) GroupNonUniformAllEqual 36 76 + 78: 19(int) Select 77 46 33 + 79: 30(ptr) AccessChain 27(data) 74 29 + Store 79 78 + 80: 6(int) Load 8(invocation) + 83: 82(ptr) AccessChain 27(data) 46 46 + 84: 20(ivec4) Load 83 + 85: 81(ivec2) VectorShuffle 84 84 0 1 + 86: 34(bool) GroupNonUniformAllEqual 36 85 + 87: 19(int) Select 86 46 33 + 88: 30(ptr) AccessChain 27(data) 80 29 + Store 88 87 + 89: 6(int) Load 8(invocation) + 91: 82(ptr) AccessChain 27(data) 59 46 + 92: 20(ivec4) Load 91 + 93: 90(ivec3) VectorShuffle 92 92 0 1 2 + 94: 34(bool) GroupNonUniformAllEqual 36 93 + 95: 19(int) Select 94 46 33 + 96: 30(ptr) AccessChain 27(data) 89 29 + Store 96 95 + 97: 6(int) Load 8(invocation) + 98: 82(ptr) AccessChain 27(data) 68 46 + 99: 20(ivec4) Load 98 + 100: 34(bool) GroupNonUniformAllEqual 36 99 + 101: 19(int) Select 100 46 33 + 102: 30(ptr) AccessChain 27(data) 97 29 + Store 102 101 + 103: 6(int) Load 8(invocation) + 105: 104(ptr) AccessChain 27(data) 33 59 41 + 106: 6(int) Load 105 + 107: 34(bool) GroupNonUniformAllEqual 36 106 + 108: 19(int) Select 107 46 33 + 109: 30(ptr) AccessChain 27(data) 103 29 + Store 109 108 + 110: 6(int) Load 8(invocation) + 113: 112(ptr) AccessChain 27(data) 46 59 + 114: 21(ivec4) Load 113 + 115: 111(ivec2) VectorShuffle 114 114 0 1 + 116: 34(bool) GroupNonUniformAllEqual 36 115 + 117: 19(int) Select 116 46 33 + 118: 30(ptr) AccessChain 27(data) 110 29 + Store 118 117 + 119: 6(int) Load 8(invocation) + 121: 112(ptr) AccessChain 27(data) 59 59 + 122: 21(ivec4) Load 121 + 123: 120(ivec3) VectorShuffle 122 122 0 1 2 + 124: 34(bool) GroupNonUniformAllEqual 36 123 + 125: 19(int) Select 124 46 33 + 126: 30(ptr) AccessChain 27(data) 119 29 + Store 126 125 + 127: 6(int) Load 8(invocation) + 128: 112(ptr) AccessChain 27(data) 68 59 + 129: 21(ivec4) Load 128 + 130: 34(bool) GroupNonUniformAllEqual 36 129 + 131: 19(int) Select 130 46 33 + 132: 30(ptr) AccessChain 27(data) 127 29 + Store 132 131 + Branch 39 + 133: Label + 134: 6(int) Load 8(invocation) + 135: 30(ptr) AccessChain 27(data) 134 29 + 136: 19(int) Load 135 + 137: 34(bool) SLessThan 136 33 + 138: 34(bool) GroupNonUniformAny 36 137 + SelectionMerge 140 None + BranchConditional 138 139 140 + 139: Label + 141: 6(int) Load 8(invocation) + 143: 142(ptr) AccessChain 27(data) 33 68 41 + 144:22(float64_t) Load 143 + 145: 34(bool) GroupNonUniformAllEqual 36 144 + 146: 19(int) Select 145 46 33 + 147: 30(ptr) AccessChain 27(data) 141 29 + Store 147 146 + 148: 6(int) Load 8(invocation) + 151: 150(ptr) AccessChain 27(data) 46 68 + 152: 23(f64vec4) Load 151 + 153:149(f64vec2) VectorShuffle 152 152 0 1 + 154: 34(bool) GroupNonUniformAllEqual 36 153 + 155: 19(int) Select 154 46 33 + 156: 30(ptr) AccessChain 27(data) 148 29 + Store 156 155 + 157: 6(int) Load 8(invocation) + 159: 150(ptr) AccessChain 27(data) 59 68 + 160: 23(f64vec4) Load 159 + 161:158(f64vec3) VectorShuffle 160 160 0 1 2 + 162: 34(bool) GroupNonUniformAllEqual 36 161 + 163: 19(int) Select 162 46 33 + 164: 30(ptr) AccessChain 27(data) 157 29 + Store 164 163 + 165: 6(int) Load 8(invocation) + 166: 150(ptr) AccessChain 27(data) 68 68 + 167: 23(f64vec4) Load 166 + 168: 34(bool) GroupNonUniformAllEqual 36 167 + 169: 19(int) Select 168 46 33 + 170: 30(ptr) AccessChain 27(data) 165 29 + Store 170 169 + 171: 6(int) Load 8(invocation) + 172: 30(ptr) AccessChain 27(data) 33 46 41 + 173: 19(int) Load 172 + 174: 34(bool) SLessThan 173 33 + 175: 34(bool) GroupNonUniformAllEqual 36 174 + 176: 19(int) Select 175 46 33 + 177: 30(ptr) AccessChain 27(data) 171 29 + Store 177 176 + 178: 6(int) Load 8(invocation) + 179: 82(ptr) AccessChain 27(data) 46 46 + 180: 20(ivec4) Load 179 + 181: 81(ivec2) VectorShuffle 180 180 0 1 + 184: 183(bvec2) SLessThan 181 182 + 185: 34(bool) GroupNonUniformAllEqual 36 184 + 186: 19(int) Select 185 46 33 + 187: 81(ivec2) CompositeConstruct 186 186 + 188: 19(int) CompositeExtract 187 0 + 189: 30(ptr) AccessChain 27(data) 178 29 + Store 189 188 + 190: 6(int) Load 8(invocation) + 191: 82(ptr) AccessChain 27(data) 46 46 + 192: 20(ivec4) Load 191 + 193: 90(ivec3) VectorShuffle 192 192 0 1 2 + 196: 195(bvec3) SLessThan 193 194 + 197: 34(bool) GroupNonUniformAllEqual 36 196 + 198: 19(int) Select 197 46 33 + 199: 90(ivec3) CompositeConstruct 198 198 198 + 200: 19(int) CompositeExtract 199 0 + 201: 30(ptr) AccessChain 27(data) 190 29 + Store 201 200 + 202: 6(int) Load 8(invocation) + 203: 82(ptr) AccessChain 27(data) 46 46 + 204: 20(ivec4) Load 203 + 207: 206(bvec4) SLessThan 204 205 + 208: 34(bool) GroupNonUniformAllEqual 36 207 + 209: 19(int) Select 208 46 33 + 210: 20(ivec4) CompositeConstruct 209 209 209 209 + 211: 19(int) CompositeExtract 210 0 + 212: 30(ptr) AccessChain 27(data) 202 29 + Store 212 211 + Branch 140 + 140: Label + Branch 39 + 39: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.subpass.frag.out b/deps/glslang/Test/baseResults/spv.subpass.frag.out new file mode 100644 index 00000000..044243e2 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.subpass.frag.out @@ -0,0 +1,112 @@ +spv.subpass.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 67 + + Capability Shader + Capability InputAttachment + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 15 27 53 + ExecutionMode 4 OriginUpperLeft + Source GLSL 400 + Name 4 "main" + Name 11 "foo(iIPM1;" + Name 10 "sb" + Name 15 "icolor" + Name 27 "color" + Name 30 "sub" + Name 35 "subMS" + Name 42 "isub" + Name 45 "isubMS" + Name 53 "ucolor" + Name 56 "usub" + Name 61 "usubMS" + Decorate 30(sub) DescriptorSet 0 + Decorate 30(sub) InputAttachmentIndex 1 + Decorate 35(subMS) DescriptorSet 0 + Decorate 35(subMS) InputAttachmentIndex 2 + Decorate 42(isub) DescriptorSet 0 + Decorate 42(isub) InputAttachmentIndex 3 + Decorate 45(isubMS) DescriptorSet 0 + Decorate 45(isubMS) InputAttachmentIndex 4 + Decorate 56(usub) DescriptorSet 0 + Decorate 56(usub) InputAttachmentIndex 5 + Decorate 61(usubMS) DescriptorSet 0 + Decorate 61(usubMS) InputAttachmentIndex 6 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeImage 6(int) SubpassData multi-sampled nonsampled format:Unknown + 8: TypePointer UniformConstant 7 + 9: TypeFunction 2 8(ptr) + 13: TypeVector 6(int) 4 + 14: TypePointer Output 13(ivec4) + 15(icolor): 14(ptr) Variable Output + 17: 6(int) Constant 3 + 18: 6(int) Constant 0 + 19: TypeVector 6(int) 2 + 20: 19(ivec2) ConstantComposite 18 18 + 24: TypeFloat 32 + 25: TypeVector 24(float) 4 + 26: TypePointer Output 25(fvec4) + 27(color): 26(ptr) Variable Output + 28: TypeImage 24(float) SubpassData nonsampled format:Unknown + 29: TypePointer UniformConstant 28 + 30(sub): 29(ptr) Variable UniformConstant + 33: TypeImage 24(float) SubpassData multi-sampled nonsampled format:Unknown + 34: TypePointer UniformConstant 33 + 35(subMS): 34(ptr) Variable UniformConstant + 40: TypeImage 6(int) SubpassData nonsampled format:Unknown + 41: TypePointer UniformConstant 40 + 42(isub): 41(ptr) Variable UniformConstant + 45(isubMS): 8(ptr) Variable UniformConstant + 50: TypeInt 32 0 + 51: TypeVector 50(int) 4 + 52: TypePointer Output 51(ivec4) + 53(ucolor): 52(ptr) Variable Output + 54: TypeImage 50(int) SubpassData nonsampled format:Unknown + 55: TypePointer UniformConstant 54 + 56(usub): 55(ptr) Variable UniformConstant + 59: TypeImage 50(int) SubpassData multi-sampled nonsampled format:Unknown + 60: TypePointer UniformConstant 59 + 61(usubMS): 60(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 31: 28 Load 30(sub) + 32: 25(fvec4) ImageRead 31 20 + Store 27(color) 32 + 36: 33 Load 35(subMS) + 37: 25(fvec4) ImageRead 36 20 Sample 17 + 38: 25(fvec4) Load 27(color) + 39: 25(fvec4) FAdd 38 37 + Store 27(color) 39 + 43: 40 Load 42(isub) + 44: 13(ivec4) ImageRead 43 20 + Store 15(icolor) 44 + 46: 7 Load 45(isubMS) + 47: 13(ivec4) ImageRead 46 20 Sample 17 + 48: 13(ivec4) Load 15(icolor) + 49: 13(ivec4) IAdd 48 47 + Store 15(icolor) 49 + 57: 54 Load 56(usub) + 58: 51(ivec4) ImageRead 57 20 + Store 53(ucolor) 58 + 62: 59 Load 61(usubMS) + 63: 51(ivec4) ImageRead 62 20 Sample 17 + 64: 51(ivec4) Load 53(ucolor) + 65: 51(ivec4) IAdd 64 63 + Store 53(ucolor) 65 + 66: 2 FunctionCall 11(foo(iIPM1;) 45(isubMS) + Return + FunctionEnd + 11(foo(iIPM1;): 2 Function None 9 + 10(sb): 8(ptr) FunctionParameter + 12: Label + 16: 7 Load 10(sb) + 21: 13(ivec4) ImageRead 16 20 Sample 17 + 22: 13(ivec4) Load 15(icolor) + 23: 13(ivec4) IAdd 22 21 + Store 15(icolor) 23 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.switch.frag.out b/deps/glslang/Test/baseResults/spv.switch.frag.out new file mode 100644 index 00000000..47cc5d4c --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.switch.frag.out @@ -0,0 +1,527 @@ +spv.switch.frag +WARNING: 0:121: 'switch' : last case/default label not followed by statements +WARNING: 0:134: 'switch' : last case/default label not followed by statements +WARNING: 0:139: 'switch' : last case/default label not followed by statements + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 269 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 62 75 129 227 233 + ExecutionMode 4 OriginUpperLeft + Source ESSL 310 + Name 4 "main" + Name 15 "foo1(vf4;vf4;i1;" + Name 12 "v1" + Name 13 "v2" + Name 14 "i1" + Name 20 "foo2(vf4;vf4;i1;" + Name 17 "v1" + Name 18 "v2" + Name 19 "i1" + Name 60 "local" + Name 62 "c" + Name 73 "f" + Name 75 "x" + Name 129 "d" + Name 155 "i" + Name 175 "j" + Name 227 "color" + Name 233 "v" + Name 234 "param" + Name 236 "param" + Name 238 "param" + Name 246 "param" + Name 248 "param" + Name 250 "param" + Decorate 15(foo1(vf4;vf4;i1;) RelaxedPrecision + Decorate 12(v1) RelaxedPrecision + Decorate 13(v2) RelaxedPrecision + Decorate 14(i1) RelaxedPrecision + Decorate 20(foo2(vf4;vf4;i1;) RelaxedPrecision + Decorate 17(v1) RelaxedPrecision + Decorate 18(v2) RelaxedPrecision + Decorate 19(i1) RelaxedPrecision + Decorate 22 RelaxedPrecision + Decorate 27 RelaxedPrecision + Decorate 29 RelaxedPrecision + Decorate 31 RelaxedPrecision + Decorate 32 RelaxedPrecision + Decorate 33 RelaxedPrecision + Decorate 40 RelaxedPrecision + Decorate 46 RelaxedPrecision + Decorate 51 RelaxedPrecision + Decorate 53 RelaxedPrecision + Decorate 54 RelaxedPrecision + Decorate 55 RelaxedPrecision + Decorate 60(local) RelaxedPrecision + Decorate 62(c) RelaxedPrecision + Decorate 62(c) Flat + Decorate 63 RelaxedPrecision + Decorate 64 RelaxedPrecision + Decorate 66 RelaxedPrecision + Decorate 67 RelaxedPrecision + Decorate 73(f) RelaxedPrecision + Decorate 75(x) RelaxedPrecision + Decorate 76 RelaxedPrecision + Decorate 77 RelaxedPrecision + Decorate 79 RelaxedPrecision + Decorate 80 RelaxedPrecision + Decorate 82 RelaxedPrecision + Decorate 83 RelaxedPrecision + Decorate 85 RelaxedPrecision + Decorate 90 RelaxedPrecision + Decorate 91 RelaxedPrecision + Decorate 92 RelaxedPrecision + Decorate 93 RelaxedPrecision + Decorate 94 RelaxedPrecision + Decorate 95 RelaxedPrecision + Decorate 96 RelaxedPrecision + Decorate 97 RelaxedPrecision + Decorate 99 RelaxedPrecision + Decorate 100 RelaxedPrecision + Decorate 101 RelaxedPrecision + Decorate 102 RelaxedPrecision + Decorate 104 RelaxedPrecision + Decorate 108 RelaxedPrecision + Decorate 109 RelaxedPrecision + Decorate 110 RelaxedPrecision + Decorate 111 RelaxedPrecision + Decorate 113 RelaxedPrecision + Decorate 114 RelaxedPrecision + Decorate 115 RelaxedPrecision + Decorate 116 RelaxedPrecision + Decorate 119 RelaxedPrecision + Decorate 124 RelaxedPrecision + Decorate 125 RelaxedPrecision + Decorate 126 RelaxedPrecision + Decorate 127 RelaxedPrecision + Decorate 129(d) RelaxedPrecision + Decorate 129(d) Flat + Decorate 130 RelaxedPrecision + Decorate 134 RelaxedPrecision + Decorate 135 RelaxedPrecision + Decorate 136 RelaxedPrecision + Decorate 137 RelaxedPrecision + Decorate 138 RelaxedPrecision + Decorate 139 RelaxedPrecision + Decorate 140 RelaxedPrecision + Decorate 142 RelaxedPrecision + Decorate 143 RelaxedPrecision + Decorate 144 RelaxedPrecision + Decorate 145 RelaxedPrecision + Decorate 146 RelaxedPrecision + Decorate 150 RelaxedPrecision + Decorate 151 RelaxedPrecision + Decorate 152 RelaxedPrecision + Decorate 153 RelaxedPrecision + Decorate 155(i) RelaxedPrecision + Decorate 162 RelaxedPrecision + Decorate 166 RelaxedPrecision + Decorate 171 RelaxedPrecision + Decorate 172 RelaxedPrecision + Decorate 173 RelaxedPrecision + Decorate 174 RelaxedPrecision + Decorate 175(j) RelaxedPrecision + Decorate 182 RelaxedPrecision + Decorate 185 RelaxedPrecision + Decorate 186 RelaxedPrecision + Decorate 187 RelaxedPrecision + Decorate 193 RelaxedPrecision + Decorate 194 RelaxedPrecision + Decorate 196 RelaxedPrecision + Decorate 197 RelaxedPrecision + Decorate 198 RelaxedPrecision + Decorate 199 RelaxedPrecision + Decorate 202 RelaxedPrecision + Decorate 203 RelaxedPrecision + Decorate 204 RelaxedPrecision + Decorate 205 RelaxedPrecision + Decorate 207 RelaxedPrecision + Decorate 213 RelaxedPrecision + Decorate 214 RelaxedPrecision + Decorate 215 RelaxedPrecision + Decorate 219 RelaxedPrecision + Decorate 220 RelaxedPrecision + Decorate 221 RelaxedPrecision + Decorate 222 RelaxedPrecision + Decorate 227(color) RelaxedPrecision + Decorate 228 RelaxedPrecision + Decorate 229 RelaxedPrecision + Decorate 230 RelaxedPrecision + Decorate 231 RelaxedPrecision + Decorate 233(v) RelaxedPrecision + Decorate 235 RelaxedPrecision + Decorate 237 RelaxedPrecision + Decorate 239 RelaxedPrecision + Decorate 240 RelaxedPrecision + Decorate 243 RelaxedPrecision + Decorate 244 RelaxedPrecision + Decorate 245 RelaxedPrecision + Decorate 247 RelaxedPrecision + Decorate 249 RelaxedPrecision + Decorate 251 RelaxedPrecision + Decorate 252 RelaxedPrecision + Decorate 254 RelaxedPrecision + Decorate 255 RelaxedPrecision + Decorate 256 RelaxedPrecision + Decorate 257 RelaxedPrecision + Decorate 264 RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeInt 32 1 + 10: TypePointer Function 9(int) + 11: TypeFunction 7(fvec4) 8(ptr) 8(ptr) 10(ptr) + 36: 6(float) Constant 0 + 37: 7(fvec4) ConstantComposite 36 36 36 36 + 48: 6(float) Constant 1065353216 + 49: 7(fvec4) ConstantComposite 48 48 48 48 + 61: TypePointer Input 9(int) + 62(c): 61(ptr) Variable Input + 65: 9(int) Constant 1 + 72: TypePointer Function 6(float) + 74: TypePointer Input 6(float) + 75(x): 74(ptr) Variable Input + 129(d): 61(ptr) Variable Input + 156: 9(int) Constant 0 + 163: 9(int) Constant 10 + 164: TypeBool + 176: 9(int) Constant 20 + 183: 9(int) Constant 30 + 188: 6(float) Constant 1120429670 + 208: 6(float) Constant 1079739679 + 226: TypePointer Output 6(float) + 227(color): 226(ptr) Variable Output + 232: TypePointer Input 7(fvec4) + 233(v): 232(ptr) Variable Input + 241: TypeInt 32 0 + 242: 241(int) Constant 1 + 253: 241(int) Constant 2 + 4(main): 2 Function None 3 + 5: Label + 60(local): 10(ptr) Variable Function + 73(f): 72(ptr) Variable Function + 155(i): 10(ptr) Variable Function + 175(j): 10(ptr) Variable Function + 234(param): 8(ptr) Variable Function + 236(param): 8(ptr) Variable Function + 238(param): 10(ptr) Variable Function + 246(param): 8(ptr) Variable Function + 248(param): 8(ptr) Variable Function + 250(param): 10(ptr) Variable Function + 63: 9(int) Load 62(c) + Store 60(local) 63 + 64: 9(int) Load 60(local) + 66: 9(int) IAdd 64 65 + Store 60(local) 66 + 67: 9(int) Load 62(c) + SelectionMerge 71 None + Switch 67 70 + case 1: 68 + case 2: 69 + 70: Label + 82: 6(float) Load 75(x) + 83: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 82 + Store 73(f) 83 + Branch 71 + 68: Label + 76: 6(float) Load 75(x) + 77: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 76 + Store 73(f) 77 + Branch 71 + 69: Label + 79: 6(float) Load 75(x) + 80: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 79 + Store 73(f) 80 + Branch 71 + 71: Label + 85: 9(int) Load 62(c) + SelectionMerge 89 None + Switch 85 88 + case 1: 86 + case 2: 87 + 88: Label + 99: 6(float) Load 75(x) + 100: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 99 + 101: 6(float) Load 73(f) + 102: 6(float) FAdd 101 100 + Store 73(f) 102 + Branch 89 + 86: Label + 90: 6(float) Load 75(x) + 91: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 90 + 92: 6(float) Load 73(f) + 93: 6(float) FAdd 92 91 + Store 73(f) 93 + Branch 87 + 87: Label + 94: 6(float) Load 75(x) + 95: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 94 + 96: 6(float) Load 73(f) + 97: 6(float) FAdd 96 95 + Store 73(f) 97 + Branch 89 + 89: Label + 104: 9(int) Load 62(c) + SelectionMerge 107 None + Switch 104 107 + case 1: 105 + case 2: 106 + 105: Label + 108: 6(float) Load 75(x) + 109: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 108 + 110: 6(float) Load 73(f) + 111: 6(float) FAdd 110 109 + Store 73(f) 111 + Branch 107 + 106: Label + 113: 6(float) Load 75(x) + 114: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 113 + 115: 6(float) Load 73(f) + 116: 6(float) FAdd 115 114 + Store 73(f) 116 + Branch 107 + 107: Label + 119: 9(int) Load 62(c) + SelectionMerge 123 None + Switch 119 122 + case 1: 120 + case 2: 121 + 122: Label + 150: 6(float) Load 75(x) + 151: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 150 + 152: 6(float) Load 73(f) + 153: 6(float) FAdd 152 151 + Store 73(f) 153 + Branch 123 + 120: Label + 124: 6(float) Load 75(x) + 125: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 124 + 126: 6(float) Load 73(f) + 127: 6(float) FAdd 126 125 + Store 73(f) 127 + Branch 123 + 121: Label + 130: 9(int) Load 129(d) + SelectionMerge 133 None + Switch 130 133 + case 1: 131 + case 2: 132 + 131: Label + 134: 6(float) Load 75(x) + 135: 6(float) Load 75(x) + 136: 6(float) FMul 134 135 + 137: 6(float) Load 75(x) + 138: 6(float) FMul 136 137 + 139: 6(float) Load 73(f) + 140: 6(float) FAdd 139 138 + Store 73(f) 140 + Branch 133 + 132: Label + 142: 6(float) Load 75(x) + 143: 6(float) Load 75(x) + 144: 6(float) FMul 142 143 + 145: 6(float) Load 73(f) + 146: 6(float) FAdd 145 144 + Store 73(f) 146 + Branch 133 + 133: Label + Branch 123 + 123: Label + Store 155(i) 156 + Branch 157 + 157: Label + LoopMerge 159 160 None + Branch 161 + 161: Label + 162: 9(int) Load 155(i) + 165: 164(bool) SLessThan 162 163 + BranchConditional 165 158 159 + 158: Label + 166: 9(int) Load 62(c) + SelectionMerge 170 None + Switch 166 169 + case 1: 167 + case 2: 168 + 169: Label + 202: 6(float) Load 75(x) + 203: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 202 + 204: 6(float) Load 73(f) + 205: 6(float) FAdd 204 203 + Store 73(f) 205 + Branch 170 + 167: Label + 171: 6(float) Load 75(x) + 172: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 171 + 173: 6(float) Load 73(f) + 174: 6(float) FAdd 173 172 + Store 73(f) 174 + Store 175(j) 176 + Branch 177 + 177: Label + LoopMerge 179 180 None + Branch 181 + 181: Label + 182: 9(int) Load 175(j) + 184: 164(bool) SLessThan 182 183 + BranchConditional 184 178 179 + 178: Label + 185: 6(float) Load 73(f) + 186: 6(float) FAdd 185 48 + Store 73(f) 186 + 187: 6(float) Load 73(f) + 189: 164(bool) FOrdLessThan 187 188 + SelectionMerge 191 None + BranchConditional 189 190 191 + 190: Label + Branch 179 + 191: Label + Branch 180 + 180: Label + 193: 9(int) Load 175(j) + 194: 9(int) IAdd 193 65 + Store 175(j) 194 + Branch 177 + 179: Label + Branch 170 + 168: Label + 196: 6(float) Load 75(x) + 197: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 196 + 198: 6(float) Load 73(f) + 199: 6(float) FAdd 198 197 + Store 73(f) 199 + Branch 170 + 170: Label + 207: 6(float) Load 73(f) + 209: 164(bool) FOrdLessThan 207 208 + SelectionMerge 211 None + BranchConditional 209 210 211 + 210: Label + Branch 159 + 211: Label + Branch 160 + 160: Label + 213: 9(int) Load 155(i) + 214: 9(int) IAdd 213 65 + Store 155(i) 214 + Branch 157 + 159: Label + 215: 9(int) Load 62(c) + SelectionMerge 218 None + Switch 215 218 + case 1: 216 + case 2: 217 + 216: Label + 219: 6(float) Load 75(x) + 220: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 219 + 221: 6(float) Load 73(f) + 222: 6(float) FAdd 221 220 + Store 73(f) 222 + Branch 218 + 217: Label + Branch 218 + 218: Label + 228: 6(float) Load 73(f) + 229: 9(int) Load 60(local) + 230: 6(float) ConvertSToF 229 + 231: 6(float) FAdd 228 230 + Store 227(color) 231 + 235: 7(fvec4) Load 233(v) + Store 234(param) 235 + 237: 7(fvec4) Load 233(v) + Store 236(param) 237 + 239: 9(int) Load 62(c) + Store 238(param) 239 + 240: 7(fvec4) FunctionCall 15(foo1(vf4;vf4;i1;) 234(param) 236(param) 238(param) + 243: 6(float) CompositeExtract 240 1 + 244: 6(float) Load 227(color) + 245: 6(float) FAdd 244 243 + Store 227(color) 245 + 247: 7(fvec4) Load 233(v) + Store 246(param) 247 + 249: 7(fvec4) Load 233(v) + Store 248(param) 249 + 251: 9(int) Load 62(c) + Store 250(param) 251 + 252: 7(fvec4) FunctionCall 20(foo2(vf4;vf4;i1;) 246(param) 248(param) 250(param) + 254: 6(float) CompositeExtract 252 2 + 255: 6(float) Load 227(color) + 256: 6(float) FAdd 255 254 + Store 227(color) 256 + 257: 9(int) Load 62(c) + SelectionMerge 260 None + Switch 257 259 + case 0: 258 + 259: Label + Branch 260 + 258: Label + Branch 260 + 260: Label + 264: 9(int) Load 62(c) + SelectionMerge 266 None + Switch 264 265 + 265: Label + Branch 266 + 266: Label + Return + FunctionEnd +15(foo1(vf4;vf4;i1;): 7(fvec4) Function None 11 + 12(v1): 8(ptr) FunctionParameter + 13(v2): 8(ptr) FunctionParameter + 14(i1): 10(ptr) FunctionParameter + 16: Label + 22: 9(int) Load 14(i1) + SelectionMerge 26 None + Switch 22 26 + case 0: 23 + case 2: 24 + case 1: 24 + case 3: 25 + 23: Label + 27: 7(fvec4) Load 12(v1) + ReturnValue 27 + 24: Label + 29: 7(fvec4) Load 13(v2) + ReturnValue 29 + 25: Label + 31: 7(fvec4) Load 12(v1) + 32: 7(fvec4) Load 13(v2) + 33: 7(fvec4) FMul 31 32 + ReturnValue 33 + 26: Label + ReturnValue 37 + FunctionEnd +20(foo2(vf4;vf4;i1;): 7(fvec4) Function None 11 + 17(v1): 8(ptr) FunctionParameter + 18(v2): 8(ptr) FunctionParameter + 19(i1): 10(ptr) FunctionParameter + 21: Label + 40: 9(int) Load 19(i1) + SelectionMerge 45 None + Switch 40 45 + case 0: 41 + case 2: 42 + case 1: 43 + case 3: 44 + 41: Label + 46: 7(fvec4) Load 17(v1) + ReturnValue 46 + 42: Label + ReturnValue 49 + 43: Label + 51: 7(fvec4) Load 18(v2) + ReturnValue 51 + 44: Label + 53: 7(fvec4) Load 17(v1) + 54: 7(fvec4) Load 18(v2) + 55: 7(fvec4) FMul 53 54 + ReturnValue 55 + 45: Label + ReturnValue 37 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.swizzle.frag.out b/deps/glslang/Test/baseResults/spv.swizzle.frag.out new file mode 100644 index 00000000..2a132d58 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.swizzle.frag.out @@ -0,0 +1,167 @@ +spv.swizzle.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 108 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 14 30 69 107 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 8 "blendscale" + Name 12 "w" + Name 14 "u" + Name 16 "w_dep" + Name 18 "w_reorder" + Name 20 "w2" + Name 22 "w_flow" + Name 30 "t" + Name 49 "w_undef" + Name 56 "p" + Name 69 "gl_FragColor" + Name 81 "c" + Name 83 "rep" + Name 107 "blend" + Decorate 69(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 9: 6(float) Constant 1071971828 + 10: TypeVector 6(float) 4 + 11: TypePointer Function 10(fvec4) + 13: TypePointer Input 10(fvec4) + 14(u): 13(ptr) Variable Input + 25: TypeInt 32 0 + 26: 25(int) Constant 2 + 28: TypeVector 6(float) 2 + 29: TypePointer Input 28(fvec2) + 30(t): 29(ptr) Variable Input + 35: 25(int) Constant 0 + 40: 25(int) Constant 1 + 54: TypeBool + 55: TypePointer Private 54(bool) + 56(p): 55(ptr) Variable Private + 60: TypePointer Input 6(float) + 68: TypePointer Output 10(fvec4) +69(gl_FragColor): 68(ptr) Variable Output + 80: TypePointer Function 28(fvec2) + 84: 6(float) Constant 0 + 85: 6(float) Constant 1065353216 + 86: 10(fvec4) ConstantComposite 84 84 84 85 + 92: 6(float) Constant 3212836864 + 102: 6(float) Constant 1079613850 + 107(blend): 60(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 8(blendscale): 7(ptr) Variable Function + 12(w): 11(ptr) Variable Function + 16(w_dep): 11(ptr) Variable Function + 18(w_reorder): 11(ptr) Variable Function + 20(w2): 11(ptr) Variable Function + 22(w_flow): 11(ptr) Variable Function + 49(w_undef): 11(ptr) Variable Function + 81(c): 80(ptr) Variable Function + 83(rep): 11(ptr) Variable Function + Store 8(blendscale) 9 + 15: 10(fvec4) Load 14(u) + Store 12(w) 15 + 17: 10(fvec4) Load 14(u) + Store 16(w_dep) 17 + 19: 10(fvec4) Load 14(u) + Store 18(w_reorder) 19 + 21: 10(fvec4) Load 14(u) + Store 20(w2) 21 + 23: 10(fvec4) Load 14(u) + Store 22(w_flow) 23 + 24: 6(float) Load 8(blendscale) + 27: 7(ptr) AccessChain 18(w_reorder) 26 + Store 27 24 + 31: 28(fvec2) Load 30(t) + 32: 10(fvec4) Load 12(w) + 33: 10(fvec4) VectorShuffle 32 31 0 5 2 4 + Store 12(w) 33 + 34: 6(float) Load 8(blendscale) + 36: 7(ptr) AccessChain 18(w_reorder) 35 + Store 36 34 + 37: 10(fvec4) Load 14(u) + 38: 10(fvec4) VectorShuffle 37 37 2 3 0 1 + Store 20(w2) 38 + 39: 6(float) Load 8(blendscale) + 41: 7(ptr) AccessChain 18(w_reorder) 40 + Store 41 39 + 42: 10(fvec4) Load 20(w2) + 43: 28(fvec2) VectorShuffle 42 42 0 2 + 44: 10(fvec4) Load 16(w_dep) + 45: 10(fvec4) VectorShuffle 44 43 4 5 2 3 + Store 16(w_dep) 45 + 46: 28(fvec2) Load 30(t) + 47: 10(fvec4) Load 16(w_dep) + 48: 10(fvec4) VectorShuffle 47 46 0 1 4 5 + Store 16(w_dep) 48 + 50: 10(fvec4) Load 14(u) + 51: 28(fvec2) VectorShuffle 50 50 2 3 + 52: 10(fvec4) Load 49(w_undef) + 53: 10(fvec4) VectorShuffle 52 51 4 5 2 3 + Store 49(w_undef) 53 + 57: 54(bool) Load 56(p) + SelectionMerge 59 None + BranchConditional 57 58 64 + 58: Label + 61: 60(ptr) AccessChain 30(t) 35 + 62: 6(float) Load 61 + 63: 7(ptr) AccessChain 22(w_flow) 35 + Store 63 62 + Branch 59 + 64: Label + 65: 60(ptr) AccessChain 30(t) 40 + 66: 6(float) Load 65 + 67: 7(ptr) AccessChain 22(w_flow) 35 + Store 67 66 + Branch 59 + 59: Label + 70: 10(fvec4) Load 18(w_reorder) + 71: 10(fvec4) Load 49(w_undef) + 72: 10(fvec4) Load 12(w) + 73: 10(fvec4) Load 20(w2) + 74: 10(fvec4) FMul 72 73 + 75: 10(fvec4) Load 16(w_dep) + 76: 10(fvec4) FMul 74 75 + 77: 10(fvec4) Load 22(w_flow) + 78: 10(fvec4) FMul 76 77 + 79: 10(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 70 71 78 + Store 69(gl_FragColor) 79 + 82: 28(fvec2) Load 30(t) + Store 81(c) 82 + Store 83(rep) 86 + 87: 7(ptr) AccessChain 81(c) 35 + 88: 6(float) Load 87 + 89: 54(bool) FOrdLessThan 88 84 + SelectionMerge 91 None + BranchConditional 89 90 91 + 90: Label + 93: 7(ptr) AccessChain 81(c) 35 + 94: 6(float) Load 93 + 95: 6(float) FMul 94 92 + 96: 7(ptr) AccessChain 81(c) 35 + Store 96 95 + Branch 91 + 91: Label + 97: 7(ptr) AccessChain 81(c) 35 + 98: 6(float) Load 97 + 99: 54(bool) FOrdLessThanEqual 98 85 + SelectionMerge 101 None + BranchConditional 99 100 101 + 100: Label + 103: 7(ptr) AccessChain 83(rep) 35 + Store 103 102 + Branch 101 + 101: Label + 104: 10(fvec4) Load 83(rep) + 105: 10(fvec4) Load 69(gl_FragColor) + 106: 10(fvec4) FAdd 105 104 + Store 69(gl_FragColor) 106 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.swizzleInversion.frag.out b/deps/glslang/Test/baseResults/spv.swizzleInversion.frag.out new file mode 100644 index 00000000..0aee7ae7 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.swizzleInversion.frag.out @@ -0,0 +1,75 @@ +spv.swizzleInversion.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 46 + + Capability Shader + Capability InterpolationFunction + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 12 37 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "v43" + Name 12 "in4" + Name 17 "v42" + Name 23 "v44" + Name 29 "v41" + Name 35 "v33" + Name 37 "in3" + Name 40 "v32" + Name 43 "v31" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8: TypePointer Function 7(fvec3) + 10: TypeVector 6(float) 4 + 11: TypePointer Input 10(fvec4) + 12(in4): 11(ptr) Variable Input + 15: TypeVector 6(float) 2 + 16: TypePointer Function 15(fvec2) + 18: TypeInt 32 1 + 19: 18(int) Constant 1 + 22: TypePointer Function 10(fvec4) + 24: 6(float) Constant 1073741824 + 25: 15(fvec2) ConstantComposite 24 24 + 28: TypePointer Function 6(float) + 30: TypeInt 32 0 + 31: 30(int) Constant 1 + 32: TypePointer Input 6(float) + 36: TypePointer Input 7(fvec3) + 37(in3): 36(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 9(v43): 8(ptr) Variable Function + 17(v42): 16(ptr) Variable Function + 23(v44): 22(ptr) Variable Function + 29(v41): 28(ptr) Variable Function + 35(v33): 8(ptr) Variable Function + 40(v32): 16(ptr) Variable Function + 43(v31): 28(ptr) Variable Function + 13: 10(fvec4) ExtInst 1(GLSL.std.450) 76(InterpolateAtCentroid) 12(in4) + 14: 7(fvec3) VectorShuffle 13 13 3 2 0 + Store 9(v43) 14 + 20: 10(fvec4) ExtInst 1(GLSL.std.450) 77(InterpolateAtSample) 12(in4) 19 + 21: 15(fvec2) VectorShuffle 20 20 2 0 + Store 17(v42) 21 + 26: 10(fvec4) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 12(in4) 25 + 27: 10(fvec4) VectorShuffle 26 26 2 1 0 3 + Store 23(v44) 27 + 33: 32(ptr) AccessChain 12(in4) 31 + 34: 6(float) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 33 25 + Store 29(v41) 34 + 38: 7(fvec3) ExtInst 1(GLSL.std.450) 76(InterpolateAtCentroid) 37(in3) + 39: 7(fvec3) VectorShuffle 38 38 1 2 0 + Store 35(v33) 39 + 41: 7(fvec3) ExtInst 1(GLSL.std.450) 77(InterpolateAtSample) 37(in3) 19 + 42: 15(fvec2) VectorShuffle 41 41 2 0 + Store 40(v32) 42 + 44: 32(ptr) AccessChain 12(in4) 31 + 45: 6(float) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 44 25 + Store 43(v31) 45 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.test.frag.out b/deps/glslang/Test/baseResults/spv.test.frag.out new file mode 100644 index 00000000..b5fccc32 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.test.frag.out @@ -0,0 +1,85 @@ +spv.test.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 55 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 20 22 37 43 46 49 + ExecutionMode 4 OriginUpperLeft + Source GLSL 400 + Name 4 "main" + Name 8 "blendscale" + Name 12 "v" + Name 16 "texSampler2D" + Name 20 "t" + Name 22 "scale" + Name 29 "w" + Name 33 "texSampler3D" + Name 37 "coords" + Name 43 "gl_FragColor" + Name 46 "u" + Name 49 "blend" + Decorate 16(texSampler2D) DescriptorSet 0 + Decorate 33(texSampler3D) DescriptorSet 0 + Decorate 43(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 9: 6(float) Constant 1071971828 + 10: TypeVector 6(float) 4 + 11: TypePointer Function 10(fvec4) + 13: TypeImage 6(float) 2D sampled format:Unknown + 14: TypeSampledImage 13 + 15: TypePointer UniformConstant 14 +16(texSampler2D): 15(ptr) Variable UniformConstant + 18: TypeVector 6(float) 2 + 19: TypePointer Input 18(fvec2) + 20(t): 19(ptr) Variable Input + 22(scale): 19(ptr) Variable Input + 30: TypeImage 6(float) 3D sampled format:Unknown + 31: TypeSampledImage 30 + 32: TypePointer UniformConstant 31 +33(texSampler3D): 32(ptr) Variable UniformConstant + 35: TypeVector 6(float) 3 + 36: TypePointer Input 35(fvec3) + 37(coords): 36(ptr) Variable Input + 42: TypePointer Output 10(fvec4) +43(gl_FragColor): 42(ptr) Variable Output + 45: TypePointer Input 10(fvec4) + 46(u): 45(ptr) Variable Input + 48: TypePointer Input 6(float) + 49(blend): 48(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 8(blendscale): 7(ptr) Variable Function + 12(v): 11(ptr) Variable Function + 29(w): 11(ptr) Variable Function + Store 8(blendscale) 9 + 17: 14 Load 16(texSampler2D) + 21: 18(fvec2) Load 20(t) + 23: 18(fvec2) Load 22(scale) + 24: 18(fvec2) FAdd 21 23 + 25: 18(fvec2) Load 22(scale) + 26: 18(fvec2) FDiv 24 25 + 27: 10(fvec4) ImageSampleImplicitLod 17 26 + 28: 10(fvec4) VectorShuffle 27 27 3 2 1 0 + Store 12(v) 28 + 34: 31 Load 33(texSampler3D) + 38: 35(fvec3) Load 37(coords) + 39: 10(fvec4) ImageSampleImplicitLod 34 38 + 40: 10(fvec4) Load 12(v) + 41: 10(fvec4) FAdd 39 40 + Store 29(w) 41 + 44: 10(fvec4) Load 29(w) + 47: 10(fvec4) Load 46(u) + 50: 6(float) Load 49(blend) + 51: 6(float) Load 8(blendscale) + 52: 6(float) FMul 50 51 + 53: 10(fvec4) CompositeConstruct 52 52 52 52 + 54: 10(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 44 47 53 + Store 43(gl_FragColor) 54 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.test.vert.out b/deps/glslang/Test/baseResults/spv.test.vert.out new file mode 100644 index 00000000..3303c88b --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.test.vert.out @@ -0,0 +1,45 @@ +spv.test.vert +WARNING: 0:5: attribute deprecated in version 130; may be removed in future release + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 24 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 9 11 15 18 21 + Source GLSL 140 + Name 4 "main" + Name 9 "uv" + Name 11 "uv_in" + Name 15 "gl_Position" + Name 18 "transform" + Name 21 "position" + Decorate 15(gl_Position) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypePointer Output 7(fvec2) + 9(uv): 8(ptr) Variable Output + 10: TypePointer Input 7(fvec2) + 11(uv_in): 10(ptr) Variable Input + 13: TypeVector 6(float) 4 + 14: TypePointer Output 13(fvec4) + 15(gl_Position): 14(ptr) Variable Output + 16: TypeMatrix 13(fvec4) 4 + 17: TypePointer Input 16 + 18(transform): 17(ptr) Variable Input + 20: TypePointer Input 13(fvec4) + 21(position): 20(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 12: 7(fvec2) Load 11(uv_in) + Store 9(uv) 12 + 19: 16 Load 18(transform) + 22: 13(fvec4) Load 21(position) + 23: 13(fvec4) MatrixTimesVector 19 22 + Store 15(gl_Position) 23 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.texture.frag.out b/deps/glslang/Test/baseResults/spv.texture.frag.out new file mode 100644 index 00000000..e685018f --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.texture.frag.out @@ -0,0 +1,396 @@ +spv.texture.frag +WARNING: 0:10: varying deprecated in version 130; may be removed in future release +WARNING: 0:11: varying deprecated in version 130; may be removed in future release +WARNING: 0:12: varying deprecated in version 130; may be removed in future release + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 305 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 47 291 294 297 303 304 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 8 "blendscale" + Name 10 "bias" + Name 12 "lod" + Name 14 "proj" + Name 15 "coords1D" + Name 18 "coords3D" + Name 24 "coords4D" + Name 26 "color" + Name 32 "texSampler1D" + Name 47 "coords2D" + Name 76 "texSampler2D" + Name 104 "texSampler3D" + Name 130 "texSamplerCube" + Name 145 "shadowSampler1D" + Name 164 "shadowSampler2D" + Name 221 "iCoords2D" + Name 226 "iLod" + Name 236 "gradX" + Name 239 "gradY" + Name 291 "gl_FragColor" + Name 294 "u" + Name 297 "blend" + Name 303 "scale" + Name 304 "t" + Decorate 32(texSampler1D) DescriptorSet 0 + Decorate 76(texSampler2D) DescriptorSet 0 + Decorate 104(texSampler3D) DescriptorSet 0 + Decorate 130(texSamplerCube) DescriptorSet 0 + Decorate 145(shadowSampler1D) DescriptorSet 0 + Decorate 164(shadowSampler2D) DescriptorSet 0 + Decorate 291(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 9: 6(float) Constant 1071971828 + 11: 6(float) Constant 1073741824 + 13: 6(float) Constant 1077936128 + 16: TypeVector 6(float) 3 + 17: TypePointer Function 16(fvec3) + 19: 6(float) Constant 1076753334 + 20: 6(float) Constant 1079836148 + 21: 16(fvec3) ConstantComposite 9 19 20 + 22: TypeVector 6(float) 4 + 23: TypePointer Function 22(fvec4) + 25: 22(fvec4) ConstantComposite 9 19 20 11 + 27: 6(float) Constant 0 + 28: 22(fvec4) ConstantComposite 27 27 27 27 + 29: TypeImage 6(float) 1D sampled format:Unknown + 30: TypeSampledImage 29 + 31: TypePointer UniformConstant 30 +32(texSampler1D): 31(ptr) Variable UniformConstant + 45: TypeVector 6(float) 2 + 46: TypePointer Input 45(fvec2) + 47(coords2D): 46(ptr) Variable Input + 73: TypeImage 6(float) 2D sampled format:Unknown + 74: TypeSampledImage 73 + 75: TypePointer UniformConstant 74 +76(texSampler2D): 75(ptr) Variable UniformConstant + 101: TypeImage 6(float) 3D sampled format:Unknown + 102: TypeSampledImage 101 + 103: TypePointer UniformConstant 102 +104(texSampler3D): 103(ptr) Variable UniformConstant + 127: TypeImage 6(float) Cube sampled format:Unknown + 128: TypeSampledImage 127 + 129: TypePointer UniformConstant 128 +130(texSamplerCube): 129(ptr) Variable UniformConstant + 142: TypeImage 6(float) 1D depth sampled format:Unknown + 143: TypeSampledImage 142 + 144: TypePointer UniformConstant 143 +145(shadowSampler1D): 144(ptr) Variable UniformConstant + 161: TypeImage 6(float) 2D depth sampled format:Unknown + 162: TypeSampledImage 161 + 163: TypePointer UniformConstant 162 +164(shadowSampler2D): 163(ptr) Variable UniformConstant + 218: TypeInt 32 1 + 219: TypeVector 218(int) 2 + 220: TypePointer Function 219(ivec2) + 222: 218(int) Constant 0 + 223: 218(int) Constant 5 + 224: 219(ivec2) ConstantComposite 222 223 + 225: TypePointer Function 218(int) + 227: 218(int) Constant 1 + 235: TypePointer Function 45(fvec2) + 264: 218(int) Constant 3 + 265: 218(int) Constant 4294967289 + 266: 219(ivec2) ConstantComposite 264 265 + 290: TypePointer Output 22(fvec4) +291(gl_FragColor): 290(ptr) Variable Output + 293: TypePointer Input 22(fvec4) + 294(u): 293(ptr) Variable Input + 296: TypePointer Input 6(float) + 297(blend): 296(ptr) Variable Input + 303(scale): 46(ptr) Variable Input + 304(t): 46(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 8(blendscale): 7(ptr) Variable Function + 10(bias): 7(ptr) Variable Function + 12(lod): 7(ptr) Variable Function + 14(proj): 7(ptr) Variable Function + 15(coords1D): 7(ptr) Variable Function + 18(coords3D): 17(ptr) Variable Function + 24(coords4D): 23(ptr) Variable Function + 26(color): 23(ptr) Variable Function + 221(iCoords2D): 220(ptr) Variable Function + 226(iLod): 225(ptr) Variable Function + 236(gradX): 235(ptr) Variable Function + 239(gradY): 235(ptr) Variable Function + Store 8(blendscale) 9 + Store 10(bias) 11 + Store 12(lod) 13 + Store 14(proj) 11 + Store 15(coords1D) 9 + Store 18(coords3D) 21 + Store 24(coords4D) 25 + Store 26(color) 28 + 33: 30 Load 32(texSampler1D) + 34: 6(float) Load 15(coords1D) + 35: 22(fvec4) ImageSampleImplicitLod 33 34 + 36: 22(fvec4) Load 26(color) + 37: 22(fvec4) FAdd 36 35 + Store 26(color) 37 + 38: 30 Load 32(texSampler1D) + 39: 6(float) Load 15(coords1D) + 40: 6(float) Load 10(bias) + 41: 22(fvec4) ImageSampleImplicitLod 38 39 Bias 40 + 42: 22(fvec4) Load 26(color) + 43: 22(fvec4) FAdd 42 41 + Store 26(color) 43 + 44: 30 Load 32(texSampler1D) + 48: 45(fvec2) Load 47(coords2D) + 49: 22(fvec4) ImageSampleProjImplicitLod 44 48 + 50: 22(fvec4) Load 26(color) + 51: 22(fvec4) FAdd 50 49 + Store 26(color) 51 + 52: 30 Load 32(texSampler1D) + 53: 22(fvec4) Load 24(coords4D) + 54: 6(float) CompositeExtract 53 3 + 55: 22(fvec4) CompositeInsert 54 53 1 + 56: 22(fvec4) ImageSampleProjImplicitLod 52 55 + 57: 22(fvec4) Load 26(color) + 58: 22(fvec4) FAdd 57 56 + Store 26(color) 58 + 59: 30 Load 32(texSampler1D) + 60: 45(fvec2) Load 47(coords2D) + 61: 6(float) Load 10(bias) + 62: 22(fvec4) ImageSampleProjImplicitLod 59 60 Bias 61 + 63: 22(fvec4) Load 26(color) + 64: 22(fvec4) FAdd 63 62 + Store 26(color) 64 + 65: 30 Load 32(texSampler1D) + 66: 22(fvec4) Load 24(coords4D) + 67: 6(float) Load 10(bias) + 68: 6(float) CompositeExtract 66 3 + 69: 22(fvec4) CompositeInsert 68 66 1 + 70: 22(fvec4) ImageSampleProjImplicitLod 65 69 Bias 67 + 71: 22(fvec4) Load 26(color) + 72: 22(fvec4) FAdd 71 70 + Store 26(color) 72 + 77: 74 Load 76(texSampler2D) + 78: 45(fvec2) Load 47(coords2D) + 79: 22(fvec4) ImageSampleImplicitLod 77 78 + 80: 22(fvec4) Load 26(color) + 81: 22(fvec4) FAdd 80 79 + Store 26(color) 81 + 82: 74 Load 76(texSampler2D) + 83: 45(fvec2) Load 47(coords2D) + 84: 6(float) Load 10(bias) + 85: 22(fvec4) ImageSampleImplicitLod 82 83 Bias 84 + 86: 22(fvec4) Load 26(color) + 87: 22(fvec4) FAdd 86 85 + Store 26(color) 87 + 88: 74 Load 76(texSampler2D) + 89: 16(fvec3) Load 18(coords3D) + 90: 22(fvec4) ImageSampleProjImplicitLod 88 89 + 91: 22(fvec4) Load 26(color) + 92: 22(fvec4) FAdd 91 90 + Store 26(color) 92 + 93: 74 Load 76(texSampler2D) + 94: 22(fvec4) Load 24(coords4D) + 95: 6(float) Load 10(bias) + 96: 6(float) CompositeExtract 94 3 + 97: 22(fvec4) CompositeInsert 96 94 2 + 98: 22(fvec4) ImageSampleProjImplicitLod 93 97 Bias 95 + 99: 22(fvec4) Load 26(color) + 100: 22(fvec4) FAdd 99 98 + Store 26(color) 100 + 105: 102 Load 104(texSampler3D) + 106: 16(fvec3) Load 18(coords3D) + 107: 22(fvec4) ImageSampleImplicitLod 105 106 + 108: 22(fvec4) Load 26(color) + 109: 22(fvec4) FAdd 108 107 + Store 26(color) 109 + 110: 102 Load 104(texSampler3D) + 111: 16(fvec3) Load 18(coords3D) + 112: 6(float) Load 10(bias) + 113: 22(fvec4) ImageSampleImplicitLod 110 111 Bias 112 + 114: 22(fvec4) Load 26(color) + 115: 22(fvec4) FAdd 114 113 + Store 26(color) 115 + 116: 102 Load 104(texSampler3D) + 117: 22(fvec4) Load 24(coords4D) + 118: 22(fvec4) ImageSampleProjImplicitLod 116 117 + 119: 22(fvec4) Load 26(color) + 120: 22(fvec4) FAdd 119 118 + Store 26(color) 120 + 121: 102 Load 104(texSampler3D) + 122: 22(fvec4) Load 24(coords4D) + 123: 6(float) Load 10(bias) + 124: 22(fvec4) ImageSampleProjImplicitLod 121 122 Bias 123 + 125: 22(fvec4) Load 26(color) + 126: 22(fvec4) FAdd 125 124 + Store 26(color) 126 + 131: 128 Load 130(texSamplerCube) + 132: 16(fvec3) Load 18(coords3D) + 133: 22(fvec4) ImageSampleImplicitLod 131 132 + 134: 22(fvec4) Load 26(color) + 135: 22(fvec4) FAdd 134 133 + Store 26(color) 135 + 136: 128 Load 130(texSamplerCube) + 137: 16(fvec3) Load 18(coords3D) + 138: 6(float) Load 10(bias) + 139: 22(fvec4) ImageSampleImplicitLod 136 137 Bias 138 + 140: 22(fvec4) Load 26(color) + 141: 22(fvec4) FAdd 140 139 + Store 26(color) 141 + 146: 143 Load 145(shadowSampler1D) + 147: 16(fvec3) Load 18(coords3D) + 148: 6(float) CompositeExtract 147 2 + 149: 6(float) ImageSampleDrefImplicitLod 146 147 148 + 150: 22(fvec4) Load 26(color) + 151: 22(fvec4) CompositeConstruct 149 149 149 149 + 152: 22(fvec4) FAdd 150 151 + Store 26(color) 152 + 153: 143 Load 145(shadowSampler1D) + 154: 16(fvec3) Load 18(coords3D) + 155: 6(float) Load 10(bias) + 156: 6(float) CompositeExtract 154 2 + 157: 6(float) ImageSampleDrefImplicitLod 153 154 156 Bias 155 + 158: 22(fvec4) Load 26(color) + 159: 22(fvec4) CompositeConstruct 157 157 157 157 + 160: 22(fvec4) FAdd 158 159 + Store 26(color) 160 + 165: 162 Load 164(shadowSampler2D) + 166: 16(fvec3) Load 18(coords3D) + 167: 6(float) CompositeExtract 166 2 + 168: 6(float) ImageSampleDrefImplicitLod 165 166 167 + 169: 22(fvec4) Load 26(color) + 170: 22(fvec4) CompositeConstruct 168 168 168 168 + 171: 22(fvec4) FAdd 169 170 + Store 26(color) 171 + 172: 162 Load 164(shadowSampler2D) + 173: 16(fvec3) Load 18(coords3D) + 174: 6(float) Load 10(bias) + 175: 6(float) CompositeExtract 173 2 + 176: 6(float) ImageSampleDrefImplicitLod 172 173 175 Bias 174 + 177: 22(fvec4) Load 26(color) + 178: 22(fvec4) CompositeConstruct 176 176 176 176 + 179: 22(fvec4) FAdd 177 178 + Store 26(color) 179 + 180: 143 Load 145(shadowSampler1D) + 181: 22(fvec4) Load 24(coords4D) + 182: 6(float) CompositeExtract 181 2 + 183: 6(float) CompositeExtract 181 3 + 184: 22(fvec4) CompositeInsert 183 181 1 + 185: 6(float) ImageSampleProjDrefImplicitLod 180 184 182 + 186: 22(fvec4) Load 26(color) + 187: 22(fvec4) CompositeConstruct 185 185 185 185 + 188: 22(fvec4) FAdd 186 187 + Store 26(color) 188 + 189: 143 Load 145(shadowSampler1D) + 190: 22(fvec4) Load 24(coords4D) + 191: 6(float) Load 10(bias) + 192: 6(float) CompositeExtract 190 2 + 193: 6(float) CompositeExtract 190 3 + 194: 22(fvec4) CompositeInsert 193 190 1 + 195: 6(float) ImageSampleProjDrefImplicitLod 189 194 192 Bias 191 + 196: 22(fvec4) Load 26(color) + 197: 22(fvec4) CompositeConstruct 195 195 195 195 + 198: 22(fvec4) FAdd 196 197 + Store 26(color) 198 + 199: 162 Load 164(shadowSampler2D) + 200: 22(fvec4) Load 24(coords4D) + 201: 6(float) CompositeExtract 200 2 + 202: 6(float) CompositeExtract 200 3 + 203: 22(fvec4) CompositeInsert 202 200 2 + 204: 6(float) ImageSampleProjDrefImplicitLod 199 203 201 + 205: 22(fvec4) Load 26(color) + 206: 22(fvec4) CompositeConstruct 204 204 204 204 + 207: 22(fvec4) FAdd 205 206 + Store 26(color) 207 + 208: 162 Load 164(shadowSampler2D) + 209: 22(fvec4) Load 24(coords4D) + 210: 6(float) Load 10(bias) + 211: 6(float) CompositeExtract 209 2 + 212: 6(float) CompositeExtract 209 3 + 213: 22(fvec4) CompositeInsert 212 209 2 + 214: 6(float) ImageSampleProjDrefImplicitLod 208 213 211 Bias 210 + 215: 22(fvec4) Load 26(color) + 216: 22(fvec4) CompositeConstruct 214 214 214 214 + 217: 22(fvec4) FAdd 215 216 + Store 26(color) 217 + Store 221(iCoords2D) 224 + Store 226(iLod) 227 + 228: 74 Load 76(texSampler2D) + 229: 219(ivec2) Load 221(iCoords2D) + 230: 218(int) Load 226(iLod) + 231: 73 Image 228 + 232: 22(fvec4) ImageFetch 231 229 Lod 230 + 233: 22(fvec4) Load 26(color) + 234: 22(fvec4) FAdd 233 232 + Store 26(color) 234 + 237: 45(fvec2) Load 47(coords2D) + 238: 45(fvec2) DPdx 237 + Store 236(gradX) 238 + 240: 45(fvec2) Load 47(coords2D) + 241: 45(fvec2) DPdy 240 + Store 239(gradY) 241 + 242: 74 Load 76(texSampler2D) + 243: 45(fvec2) Load 47(coords2D) + 244: 45(fvec2) Load 236(gradX) + 245: 45(fvec2) Load 239(gradY) + 246: 22(fvec4) ImageSampleExplicitLod 242 243 Grad 244 245 + 247: 22(fvec4) Load 26(color) + 248: 22(fvec4) FAdd 247 246 + Store 26(color) 248 + 249: 74 Load 76(texSampler2D) + 250: 45(fvec2) Load 47(coords2D) + 251: 6(float) Load 14(proj) + 252: 6(float) CompositeExtract 250 0 + 253: 6(float) CompositeExtract 250 1 + 254: 16(fvec3) CompositeConstruct 252 253 251 + 255: 45(fvec2) Load 236(gradX) + 256: 45(fvec2) Load 239(gradY) + 257: 22(fvec4) ImageSampleProjExplicitLod 249 254 Grad 255 256 + 258: 22(fvec4) Load 26(color) + 259: 22(fvec4) FAdd 258 257 + Store 26(color) 259 + 260: 74 Load 76(texSampler2D) + 261: 45(fvec2) Load 47(coords2D) + 262: 45(fvec2) Load 236(gradX) + 263: 45(fvec2) Load 239(gradY) + 267: 22(fvec4) ImageSampleExplicitLod 260 261 Grad ConstOffset 262 263 266 + 268: 22(fvec4) Load 26(color) + 269: 22(fvec4) FAdd 268 267 + Store 26(color) 269 + 270: 74 Load 76(texSampler2D) + 271: 16(fvec3) Load 18(coords3D) + 272: 45(fvec2) Load 236(gradX) + 273: 45(fvec2) Load 239(gradY) + 274: 22(fvec4) ImageSampleProjExplicitLod 270 271 Grad ConstOffset 272 273 266 + 275: 22(fvec4) Load 26(color) + 276: 22(fvec4) FAdd 275 274 + Store 26(color) 276 + 277: 162 Load 164(shadowSampler2D) + 278: 45(fvec2) Load 47(coords2D) + 279: 6(float) Load 12(lod) + 280: 6(float) CompositeExtract 278 0 + 281: 6(float) CompositeExtract 278 1 + 282: 16(fvec3) CompositeConstruct 280 281 279 + 283: 45(fvec2) Load 236(gradX) + 284: 45(fvec2) Load 239(gradY) + 285: 6(float) CompositeExtract 282 2 + 286: 6(float) ImageSampleDrefExplicitLod 277 282 285 Grad 283 284 + 287: 22(fvec4) Load 26(color) + 288: 22(fvec4) CompositeConstruct 286 286 286 286 + 289: 22(fvec4) FAdd 287 288 + Store 26(color) 289 + 292: 22(fvec4) Load 26(color) + 295: 22(fvec4) Load 294(u) + 298: 6(float) Load 297(blend) + 299: 6(float) Load 8(blendscale) + 300: 6(float) FMul 298 299 + 301: 22(fvec4) CompositeConstruct 300 300 300 300 + 302: 22(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 292 295 301 + Store 291(gl_FragColor) 302 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.texture.sampler.transform.frag.out b/deps/glslang/Test/baseResults/spv.texture.sampler.transform.frag.out new file mode 100644 index 00000000..ef8bbf6a --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.texture.sampler.transform.frag.out @@ -0,0 +1,37 @@ +spv.texture.sampler.transform.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 20 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 17 + ExecutionMode 4 OriginUpperLeft + Source GLSL 440 + Name 4 "main" + Name 9 "color" + Name 13 "tex" + Name 17 "coord" + Decorate 13(tex) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(color): 8(ptr) Variable Output + 10: TypeImage 6(float) 2D sampled format:Unknown + 11: TypeSampledImage 10 + 12: TypePointer UniformConstant 11 + 13(tex): 12(ptr) Variable UniformConstant + 15: TypeVector 6(float) 2 + 16: TypePointer Input 15(fvec2) + 17(coord): 16(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 14: 11 Load 13(tex) + 18: 15(fvec2) Load 17(coord) + 19: 7(fvec4) ImageSampleImplicitLod 14 18 + Store 9(color) 19 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.texture.vert.out b/deps/glslang/Test/baseResults/spv.texture.vert.out new file mode 100644 index 00000000..0c1b7a14 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.texture.vert.out @@ -0,0 +1,201 @@ +spv.texture.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 150 + + Capability Shader + Capability Sampled1D + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 39 148 + Source GLSL 140 + Name 4 "main" + Name 8 "lod" + Name 10 "coords1D" + Name 14 "coords3D" + Name 20 "coords4D" + Name 23 "color" + Name 29 "texSampler1D" + Name 39 "coords2D" + Name 56 "texSampler2D" + Name 80 "texSampler3D" + Name 96 "texSamplerCube" + Name 106 "shadowSampler1D" + Name 118 "shadowSampler2D" + Name 148 "gl_Position" + Decorate 29(texSampler1D) DescriptorSet 0 + Decorate 56(texSampler2D) DescriptorSet 0 + Decorate 80(texSampler3D) DescriptorSet 0 + Decorate 96(texSamplerCube) DescriptorSet 0 + Decorate 106(shadowSampler1D) DescriptorSet 0 + Decorate 118(shadowSampler2D) DescriptorSet 0 + Decorate 148(gl_Position) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 9: 6(float) Constant 1077936128 + 11: 6(float) Constant 1071971828 + 12: TypeVector 6(float) 3 + 13: TypePointer Function 12(fvec3) + 15: 6(float) Constant 1076753334 + 16: 6(float) Constant 1079836148 + 17: 12(fvec3) ConstantComposite 11 15 16 + 18: TypeVector 6(float) 4 + 19: TypePointer Function 18(fvec4) + 21: 6(float) Constant 1073741824 + 22: 18(fvec4) ConstantComposite 11 15 16 21 + 24: 6(float) Constant 0 + 25: 18(fvec4) ConstantComposite 24 24 24 24 + 26: TypeImage 6(float) 1D sampled format:Unknown + 27: TypeSampledImage 26 + 28: TypePointer UniformConstant 27 +29(texSampler1D): 28(ptr) Variable UniformConstant + 37: TypeVector 6(float) 2 + 38: TypePointer Input 37(fvec2) + 39(coords2D): 38(ptr) Variable Input + 53: TypeImage 6(float) 2D sampled format:Unknown + 54: TypeSampledImage 53 + 55: TypePointer UniformConstant 54 +56(texSampler2D): 55(ptr) Variable UniformConstant + 77: TypeImage 6(float) 3D sampled format:Unknown + 78: TypeSampledImage 77 + 79: TypePointer UniformConstant 78 +80(texSampler3D): 79(ptr) Variable UniformConstant + 93: TypeImage 6(float) Cube sampled format:Unknown + 94: TypeSampledImage 93 + 95: TypePointer UniformConstant 94 +96(texSamplerCube): 95(ptr) Variable UniformConstant + 103: TypeImage 6(float) 1D depth sampled format:Unknown + 104: TypeSampledImage 103 + 105: TypePointer UniformConstant 104 +106(shadowSampler1D): 105(ptr) Variable UniformConstant + 115: TypeImage 6(float) 2D depth sampled format:Unknown + 116: TypeSampledImage 115 + 117: TypePointer UniformConstant 116 +118(shadowSampler2D): 117(ptr) Variable UniformConstant + 147: TypePointer Output 18(fvec4) +148(gl_Position): 147(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 8(lod): 7(ptr) Variable Function + 10(coords1D): 7(ptr) Variable Function + 14(coords3D): 13(ptr) Variable Function + 20(coords4D): 19(ptr) Variable Function + 23(color): 19(ptr) Variable Function + Store 8(lod) 9 + Store 10(coords1D) 11 + Store 14(coords3D) 17 + Store 20(coords4D) 22 + Store 23(color) 25 + 30: 27 Load 29(texSampler1D) + 31: 6(float) Load 10(coords1D) + 32: 6(float) Load 8(lod) + 33: 18(fvec4) ImageSampleExplicitLod 30 31 Lod 32 + 34: 18(fvec4) Load 23(color) + 35: 18(fvec4) FAdd 34 33 + Store 23(color) 35 + 36: 27 Load 29(texSampler1D) + 40: 37(fvec2) Load 39(coords2D) + 41: 6(float) Load 8(lod) + 42: 18(fvec4) ImageSampleProjExplicitLod 36 40 Lod 41 + 43: 18(fvec4) Load 23(color) + 44: 18(fvec4) FAdd 43 42 + Store 23(color) 44 + 45: 27 Load 29(texSampler1D) + 46: 18(fvec4) Load 20(coords4D) + 47: 6(float) Load 8(lod) + 48: 6(float) CompositeExtract 46 3 + 49: 18(fvec4) CompositeInsert 48 46 1 + 50: 18(fvec4) ImageSampleProjExplicitLod 45 49 Lod 47 + 51: 18(fvec4) Load 23(color) + 52: 18(fvec4) FAdd 51 50 + Store 23(color) 52 + 57: 54 Load 56(texSampler2D) + 58: 37(fvec2) Load 39(coords2D) + 59: 6(float) Load 8(lod) + 60: 18(fvec4) ImageSampleExplicitLod 57 58 Lod 59 + 61: 18(fvec4) Load 23(color) + 62: 18(fvec4) FAdd 61 60 + Store 23(color) 62 + 63: 54 Load 56(texSampler2D) + 64: 12(fvec3) Load 14(coords3D) + 65: 6(float) Load 8(lod) + 66: 18(fvec4) ImageSampleProjExplicitLod 63 64 Lod 65 + 67: 18(fvec4) Load 23(color) + 68: 18(fvec4) FAdd 67 66 + Store 23(color) 68 + 69: 54 Load 56(texSampler2D) + 70: 18(fvec4) Load 20(coords4D) + 71: 6(float) Load 8(lod) + 72: 6(float) CompositeExtract 70 3 + 73: 18(fvec4) CompositeInsert 72 70 2 + 74: 18(fvec4) ImageSampleProjExplicitLod 69 73 Lod 71 + 75: 18(fvec4) Load 23(color) + 76: 18(fvec4) FAdd 75 74 + Store 23(color) 76 + 81: 78 Load 80(texSampler3D) + 82: 12(fvec3) Load 14(coords3D) + 83: 6(float) Load 8(lod) + 84: 18(fvec4) ImageSampleExplicitLod 81 82 Lod 83 + 85: 18(fvec4) Load 23(color) + 86: 18(fvec4) FAdd 85 84 + Store 23(color) 86 + 87: 78 Load 80(texSampler3D) + 88: 18(fvec4) Load 20(coords4D) + 89: 6(float) Load 8(lod) + 90: 18(fvec4) ImageSampleProjExplicitLod 87 88 Lod 89 + 91: 18(fvec4) Load 23(color) + 92: 18(fvec4) FAdd 91 90 + Store 23(color) 92 + 97: 94 Load 96(texSamplerCube) + 98: 12(fvec3) Load 14(coords3D) + 99: 6(float) Load 8(lod) + 100: 18(fvec4) ImageSampleExplicitLod 97 98 Lod 99 + 101: 18(fvec4) Load 23(color) + 102: 18(fvec4) FAdd 101 100 + Store 23(color) 102 + 107: 104 Load 106(shadowSampler1D) + 108: 12(fvec3) Load 14(coords3D) + 109: 6(float) Load 8(lod) + 110: 6(float) CompositeExtract 108 2 + 111: 6(float) ImageSampleDrefExplicitLod 107 108 110 Lod 109 + 112: 18(fvec4) Load 23(color) + 113: 18(fvec4) CompositeConstruct 111 111 111 111 + 114: 18(fvec4) FAdd 112 113 + Store 23(color) 114 + 119: 116 Load 118(shadowSampler2D) + 120: 12(fvec3) Load 14(coords3D) + 121: 6(float) Load 8(lod) + 122: 6(float) CompositeExtract 120 2 + 123: 6(float) ImageSampleDrefExplicitLod 119 120 122 Lod 121 + 124: 18(fvec4) Load 23(color) + 125: 18(fvec4) CompositeConstruct 123 123 123 123 + 126: 18(fvec4) FAdd 124 125 + Store 23(color) 126 + 127: 104 Load 106(shadowSampler1D) + 128: 18(fvec4) Load 20(coords4D) + 129: 6(float) Load 8(lod) + 130: 6(float) CompositeExtract 128 2 + 131: 6(float) CompositeExtract 128 3 + 132: 18(fvec4) CompositeInsert 131 128 1 + 133: 6(float) ImageSampleProjDrefExplicitLod 127 132 130 Lod 129 + 134: 18(fvec4) Load 23(color) + 135: 18(fvec4) CompositeConstruct 133 133 133 133 + 136: 18(fvec4) FAdd 134 135 + Store 23(color) 136 + 137: 116 Load 118(shadowSampler2D) + 138: 18(fvec4) Load 20(coords4D) + 139: 6(float) Load 8(lod) + 140: 6(float) CompositeExtract 138 2 + 141: 6(float) CompositeExtract 138 3 + 142: 18(fvec4) CompositeInsert 141 138 2 + 143: 6(float) ImageSampleProjDrefExplicitLod 137 142 140 Lod 139 + 144: 18(fvec4) Load 23(color) + 145: 18(fvec4) CompositeConstruct 143 143 143 143 + 146: 18(fvec4) FAdd 144 145 + Store 23(color) 146 + 149: 18(fvec4) Load 23(color) + Store 148(gl_Position) 149 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.textureBuffer.vert.out b/deps/glslang/Test/baseResults/spv.textureBuffer.vert.out new file mode 100644 index 00000000..e327cb48 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.textureBuffer.vert.out @@ -0,0 +1,64 @@ +spv.textureBuffer.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 42 + + Capability Shader + Capability SampledBuffer + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" + Source GLSL 450 + Name 4 "main" + Name 9 "tBuf" + Name 13 "s" + Name 23 "sBuf" + Name 32 "utBuf" + Name 38 "itBuf" + Decorate 9(tBuf) DescriptorSet 0 + Decorate 13(s) DescriptorSet 0 + Decorate 23(sBuf) DescriptorSet 0 + Decorate 32(utBuf) DescriptorSet 0 + Decorate 38(itBuf) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeImage 6(float) Buffer sampled format:Unknown + 8: TypePointer UniformConstant 7 + 9(tBuf): 8(ptr) Variable UniformConstant + 11: TypeSampler + 12: TypePointer UniformConstant 11 + 13(s): 12(ptr) Variable UniformConstant + 15: TypeSampledImage 7 + 17: TypeInt 32 1 + 18: 17(int) Constant 13 + 20: TypeVector 6(float) 4 + 22: TypePointer UniformConstant 15 + 23(sBuf): 22(ptr) Variable UniformConstant + 29: TypeInt 32 0 + 30: TypeImage 29(int) Buffer sampled format:Unknown + 31: TypePointer UniformConstant 30 + 32(utBuf): 31(ptr) Variable UniformConstant + 34: TypeVector 29(int) 4 + 36: TypeImage 17(int) Buffer sampled format:Unknown + 37: TypePointer UniformConstant 36 + 38(itBuf): 37(ptr) Variable UniformConstant + 40: TypeVector 17(int) 4 + 4(main): 2 Function None 3 + 5: Label + 10: 7 Load 9(tBuf) + 14: 11 Load 13(s) + 16: 15 SampledImage 10 14 + 19: 7 Image 16 + 21: 20(fvec4) ImageFetch 19 18 + 24: 15 Load 23(sBuf) + 25: 7 Image 24 + 26: 20(fvec4) ImageFetch 25 18 + 27: 7 Load 9(tBuf) + 28: 20(fvec4) ImageFetch 27 18 + 33: 30 Load 32(utBuf) + 35: 34(ivec4) ImageFetch 33 18 + 39: 36 Load 38(itBuf) + 41: 40(ivec4) ImageFetch 39 18 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.textureGatherBiasLod.frag.out b/deps/glslang/Test/baseResults/spv.textureGatherBiasLod.frag.out new file mode 100644 index 00000000..d01515dc --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.textureGatherBiasLod.frag.out @@ -0,0 +1,389 @@ +spv.textureGatherBiasLod.frag +error: SPIRV-Tools Validation Errors +error: Image Operand Bias can only be used with ImplicitLod opcodes + %27 = OpImageGather %v4float %17 %21 %int_0 Bias %26 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 298 + + Capability Shader + Capability ImageGatherExtended + Capability SparseResidency + Capability SampledCubeArray + Capability ImageGatherBiasLodAMD + Extension "SPV_AMD_texture_gather_bias_lod" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 20 25 37 61 176 296 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_AMD_texture_gather_bias_lod" + SourceExtension "GL_ARB_sparse_texture2" + Name 4 "main" + Name 9 "texel" + Name 12 "result" + Name 16 "s2D" + Name 20 "c2" + Name 25 "bias" + Name 33 "s2DArray" + Name 37 "c3" + Name 47 "sCube" + Name 58 "sCubeArray" + Name 61 "c4" + Name 104 "ResType" + Name 176 "lod" + Name 296 "fragColor" + Decorate 16(s2D) DescriptorSet 0 + Decorate 33(s2DArray) DescriptorSet 0 + Decorate 47(sCube) DescriptorSet 0 + Decorate 58(sCubeArray) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: 6(float) Constant 0 + 11: 7(fvec4) ConstantComposite 10 10 10 10 + 13: TypeImage 6(float) 2D sampled format:Unknown + 14: TypeSampledImage 13 + 15: TypePointer UniformConstant 14 + 16(s2D): 15(ptr) Variable UniformConstant + 18: TypeVector 6(float) 2 + 19: TypePointer Input 18(fvec2) + 20(c2): 19(ptr) Variable Input + 22: TypeInt 32 1 + 23: 22(int) Constant 0 + 24: TypePointer Input 6(float) + 25(bias): 24(ptr) Variable Input + 30: TypeImage 6(float) 2D array sampled format:Unknown + 31: TypeSampledImage 30 + 32: TypePointer UniformConstant 31 + 33(s2DArray): 32(ptr) Variable UniformConstant + 35: TypeVector 6(float) 3 + 36: TypePointer Input 35(fvec3) + 37(c3): 36(ptr) Variable Input + 39: 22(int) Constant 1 + 44: TypeImage 6(float) Cube sampled format:Unknown + 45: TypeSampledImage 44 + 46: TypePointer UniformConstant 45 + 47(sCube): 46(ptr) Variable UniformConstant + 50: 22(int) Constant 2 + 55: TypeImage 6(float) Cube array sampled format:Unknown + 56: TypeSampledImage 55 + 57: TypePointer UniformConstant 56 + 58(sCubeArray): 57(ptr) Variable UniformConstant + 60: TypePointer Input 7(fvec4) + 61(c4): 60(ptr) Variable Input + 63: 22(int) Constant 3 + 70: TypeVector 22(int) 2 + 71: 70(ivec2) ConstantComposite 23 23 + 78: 70(ivec2) ConstantComposite 23 39 + 85: TypeInt 32 0 + 86: 85(int) Constant 4 + 87: TypeArray 70(ivec2) 86 + 88: 70(ivec2) ConstantComposite 39 23 + 89: 70(ivec2) ConstantComposite 39 39 + 90: 87 ConstantComposite 71 78 88 89 + 104(ResType): TypeStruct 22(int) 7(fvec4) + 176(lod): 24(ptr) Variable Input + 295: TypePointer Output 7(fvec4) + 296(fragColor): 295(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 9(texel): 8(ptr) Variable Function + 12(result): 8(ptr) Variable Function + Store 9(texel) 11 + Store 12(result) 11 + 17: 14 Load 16(s2D) + 21: 18(fvec2) Load 20(c2) + 26: 6(float) Load 25(bias) + 27: 7(fvec4) ImageGather 17 21 23 Bias 26 + 28: 7(fvec4) Load 9(texel) + 29: 7(fvec4) FAdd 28 27 + Store 9(texel) 29 + 34: 31 Load 33(s2DArray) + 38: 35(fvec3) Load 37(c3) + 40: 6(float) Load 25(bias) + 41: 7(fvec4) ImageGather 34 38 39 Bias 40 + 42: 7(fvec4) Load 9(texel) + 43: 7(fvec4) FAdd 42 41 + Store 9(texel) 43 + 48: 45 Load 47(sCube) + 49: 35(fvec3) Load 37(c3) + 51: 6(float) Load 25(bias) + 52: 7(fvec4) ImageGather 48 49 50 Bias 51 + 53: 7(fvec4) Load 9(texel) + 54: 7(fvec4) FAdd 53 52 + Store 9(texel) 54 + 59: 56 Load 58(sCubeArray) + 62: 7(fvec4) Load 61(c4) + 64: 6(float) Load 25(bias) + 65: 7(fvec4) ImageGather 59 62 63 Bias 64 + 66: 7(fvec4) Load 9(texel) + 67: 7(fvec4) FAdd 66 65 + Store 9(texel) 67 + 68: 14 Load 16(s2D) + 69: 18(fvec2) Load 20(c2) + 72: 6(float) Load 25(bias) + 73: 7(fvec4) ImageGather 68 69 23 Bias ConstOffset 72 71 + 74: 7(fvec4) Load 9(texel) + 75: 7(fvec4) FAdd 74 73 + Store 9(texel) 75 + 76: 31 Load 33(s2DArray) + 77: 35(fvec3) Load 37(c3) + 79: 6(float) Load 25(bias) + 80: 7(fvec4) ImageGather 76 77 39 Bias ConstOffset 79 78 + 81: 7(fvec4) Load 9(texel) + 82: 7(fvec4) FAdd 81 80 + Store 9(texel) 82 + 83: 14 Load 16(s2D) + 84: 18(fvec2) Load 20(c2) + 91: 6(float) Load 25(bias) + 92: 7(fvec4) ImageGather 83 84 23 Bias ConstOffsets 91 90 + 93: 7(fvec4) Load 9(texel) + 94: 7(fvec4) FAdd 93 92 + Store 9(texel) 94 + 95: 31 Load 33(s2DArray) + 96: 35(fvec3) Load 37(c3) + 97: 6(float) Load 25(bias) + 98: 7(fvec4) ImageGather 95 96 39 Bias ConstOffsets 97 90 + 99: 7(fvec4) Load 9(texel) + 100: 7(fvec4) FAdd 99 98 + Store 9(texel) 100 + 101: 14 Load 16(s2D) + 102: 18(fvec2) Load 20(c2) + 103: 6(float) Load 25(bias) + 105:104(ResType) ImageSparseGather 101 102 23 Bias 103 + 106: 7(fvec4) CompositeExtract 105 1 + Store 12(result) 106 + 107: 22(int) CompositeExtract 105 0 + 108: 7(fvec4) Load 12(result) + 109: 7(fvec4) Load 9(texel) + 110: 7(fvec4) FAdd 109 108 + Store 9(texel) 110 + 111: 31 Load 33(s2DArray) + 112: 35(fvec3) Load 37(c3) + 113: 6(float) Load 25(bias) + 114:104(ResType) ImageSparseGather 111 112 39 Bias 113 + 115: 7(fvec4) CompositeExtract 114 1 + Store 12(result) 115 + 116: 22(int) CompositeExtract 114 0 + 117: 7(fvec4) Load 12(result) + 118: 7(fvec4) Load 9(texel) + 119: 7(fvec4) FAdd 118 117 + Store 9(texel) 119 + 120: 45 Load 47(sCube) + 121: 35(fvec3) Load 37(c3) + 122: 6(float) Load 25(bias) + 123:104(ResType) ImageSparseGather 120 121 50 Bias 122 + 124: 7(fvec4) CompositeExtract 123 1 + Store 12(result) 124 + 125: 22(int) CompositeExtract 123 0 + 126: 7(fvec4) Load 12(result) + 127: 7(fvec4) Load 9(texel) + 128: 7(fvec4) FAdd 127 126 + Store 9(texel) 128 + 129: 56 Load 58(sCubeArray) + 130: 7(fvec4) Load 61(c4) + 131: 6(float) Load 25(bias) + 132:104(ResType) ImageSparseGather 129 130 50 Bias 131 + 133: 7(fvec4) CompositeExtract 132 1 + Store 12(result) 133 + 134: 22(int) CompositeExtract 132 0 + 135: 7(fvec4) Load 12(result) + 136: 7(fvec4) Load 9(texel) + 137: 7(fvec4) FAdd 136 135 + Store 9(texel) 137 + 138: 14 Load 16(s2D) + 139: 18(fvec2) Load 20(c2) + 140: 6(float) Load 25(bias) + 141:104(ResType) ImageSparseGather 138 139 23 Bias ConstOffset 140 71 + 142: 7(fvec4) CompositeExtract 141 1 + Store 12(result) 142 + 143: 22(int) CompositeExtract 141 0 + 144: 7(fvec4) Load 12(result) + 145: 7(fvec4) Load 9(texel) + 146: 7(fvec4) FAdd 145 144 + Store 9(texel) 146 + 147: 31 Load 33(s2DArray) + 148: 35(fvec3) Load 37(c3) + 149: 6(float) Load 25(bias) + 150:104(ResType) ImageSparseGather 147 148 39 Bias ConstOffset 149 78 + 151: 7(fvec4) CompositeExtract 150 1 + Store 12(result) 151 + 152: 22(int) CompositeExtract 150 0 + 153: 7(fvec4) Load 12(result) + 154: 7(fvec4) Load 9(texel) + 155: 7(fvec4) FAdd 154 153 + Store 9(texel) 155 + 156: 14 Load 16(s2D) + 157: 18(fvec2) Load 20(c2) + 158: 6(float) Load 25(bias) + 159:104(ResType) ImageSparseGather 156 157 23 Bias ConstOffsets 158 90 + 160: 7(fvec4) CompositeExtract 159 1 + Store 12(result) 160 + 161: 22(int) CompositeExtract 159 0 + 162: 7(fvec4) Load 12(result) + 163: 7(fvec4) Load 9(texel) + 164: 7(fvec4) FAdd 163 162 + Store 9(texel) 164 + 165: 31 Load 33(s2DArray) + 166: 35(fvec3) Load 37(c3) + 167: 6(float) Load 25(bias) + 168:104(ResType) ImageSparseGather 165 166 39 Bias ConstOffsets 167 90 + 169: 7(fvec4) CompositeExtract 168 1 + Store 12(result) 169 + 170: 22(int) CompositeExtract 168 0 + 171: 7(fvec4) Load 12(result) + 172: 7(fvec4) Load 9(texel) + 173: 7(fvec4) FAdd 172 171 + Store 9(texel) 173 + 174: 14 Load 16(s2D) + 175: 18(fvec2) Load 20(c2) + 177: 6(float) Load 176(lod) + 178: 7(fvec4) ImageGather 174 175 23 Lod 177 + 179: 7(fvec4) Load 9(texel) + 180: 7(fvec4) FAdd 179 178 + Store 9(texel) 180 + 181: 31 Load 33(s2DArray) + 182: 35(fvec3) Load 37(c3) + 183: 6(float) Load 176(lod) + 184: 7(fvec4) ImageGather 181 182 39 Lod 183 + 185: 7(fvec4) Load 9(texel) + 186: 7(fvec4) FAdd 185 184 + Store 9(texel) 186 + 187: 45 Load 47(sCube) + 188: 35(fvec3) Load 37(c3) + 189: 6(float) Load 176(lod) + 190: 7(fvec4) ImageGather 187 188 50 Lod 189 + 191: 7(fvec4) Load 9(texel) + 192: 7(fvec4) FAdd 191 190 + Store 9(texel) 192 + 193: 56 Load 58(sCubeArray) + 194: 7(fvec4) Load 61(c4) + 195: 6(float) Load 176(lod) + 196: 7(fvec4) ImageGather 193 194 63 Lod 195 + 197: 7(fvec4) Load 9(texel) + 198: 7(fvec4) FAdd 197 196 + Store 9(texel) 198 + 199: 14 Load 16(s2D) + 200: 18(fvec2) Load 20(c2) + 201: 6(float) Load 176(lod) + 202: 7(fvec4) ImageGather 199 200 23 Lod ConstOffset 201 71 + 203: 7(fvec4) Load 9(texel) + 204: 7(fvec4) FAdd 203 202 + Store 9(texel) 204 + 205: 31 Load 33(s2DArray) + 206: 35(fvec3) Load 37(c3) + 207: 6(float) Load 176(lod) + 208: 7(fvec4) ImageGather 205 206 39 Lod ConstOffset 207 78 + 209: 7(fvec4) Load 9(texel) + 210: 7(fvec4) FAdd 209 208 + Store 9(texel) 210 + 211: 14 Load 16(s2D) + 212: 18(fvec2) Load 20(c2) + 213: 6(float) Load 176(lod) + 214: 7(fvec4) ImageGather 211 212 23 Lod ConstOffsets 213 90 + 215: 7(fvec4) Load 9(texel) + 216: 7(fvec4) FAdd 215 214 + Store 9(texel) 216 + 217: 31 Load 33(s2DArray) + 218: 35(fvec3) Load 37(c3) + 219: 6(float) Load 176(lod) + 220: 7(fvec4) ImageGather 217 218 39 Lod ConstOffsets 219 90 + 221: 7(fvec4) Load 9(texel) + 222: 7(fvec4) FAdd 221 220 + Store 9(texel) 222 + 223: 14 Load 16(s2D) + 224: 18(fvec2) Load 20(c2) + 225: 6(float) Load 176(lod) + 226:104(ResType) ImageSparseGather 223 224 23 Lod 225 + 227: 7(fvec4) CompositeExtract 226 1 + Store 12(result) 227 + 228: 22(int) CompositeExtract 226 0 + 229: 7(fvec4) Load 12(result) + 230: 7(fvec4) Load 9(texel) + 231: 7(fvec4) FAdd 230 229 + Store 9(texel) 231 + 232: 31 Load 33(s2DArray) + 233: 35(fvec3) Load 37(c3) + 234: 6(float) Load 176(lod) + 235:104(ResType) ImageSparseGather 232 233 39 Lod 234 + 236: 7(fvec4) CompositeExtract 235 1 + Store 12(result) 236 + 237: 22(int) CompositeExtract 235 0 + 238: 7(fvec4) Load 12(result) + 239: 7(fvec4) Load 9(texel) + 240: 7(fvec4) FAdd 239 238 + Store 9(texel) 240 + 241: 45 Load 47(sCube) + 242: 35(fvec3) Load 37(c3) + 243: 6(float) Load 176(lod) + 244:104(ResType) ImageSparseGather 241 242 50 Lod 243 + 245: 7(fvec4) CompositeExtract 244 1 + Store 12(result) 245 + 246: 22(int) CompositeExtract 244 0 + 247: 7(fvec4) Load 12(result) + 248: 7(fvec4) Load 9(texel) + 249: 7(fvec4) FAdd 248 247 + Store 9(texel) 249 + 250: 56 Load 58(sCubeArray) + 251: 7(fvec4) Load 61(c4) + 252: 6(float) Load 176(lod) + 253:104(ResType) ImageSparseGather 250 251 50 Lod 252 + 254: 7(fvec4) CompositeExtract 253 1 + Store 12(result) 254 + 255: 22(int) CompositeExtract 253 0 + 256: 7(fvec4) Load 12(result) + 257: 7(fvec4) Load 9(texel) + 258: 7(fvec4) FAdd 257 256 + Store 9(texel) 258 + 259: 14 Load 16(s2D) + 260: 18(fvec2) Load 20(c2) + 261: 6(float) Load 176(lod) + 262:104(ResType) ImageSparseGather 259 260 23 Lod ConstOffset 261 71 + 263: 7(fvec4) CompositeExtract 262 1 + Store 12(result) 263 + 264: 22(int) CompositeExtract 262 0 + 265: 7(fvec4) Load 12(result) + 266: 7(fvec4) Load 9(texel) + 267: 7(fvec4) FAdd 266 265 + Store 9(texel) 267 + 268: 31 Load 33(s2DArray) + 269: 35(fvec3) Load 37(c3) + 270: 6(float) Load 176(lod) + 271:104(ResType) ImageSparseGather 268 269 39 Lod ConstOffset 270 78 + 272: 7(fvec4) CompositeExtract 271 1 + Store 12(result) 272 + 273: 22(int) CompositeExtract 271 0 + 274: 7(fvec4) Load 12(result) + 275: 7(fvec4) Load 9(texel) + 276: 7(fvec4) FAdd 275 274 + Store 9(texel) 276 + 277: 14 Load 16(s2D) + 278: 18(fvec2) Load 20(c2) + 279: 6(float) Load 176(lod) + 280:104(ResType) ImageSparseGather 277 278 23 Lod ConstOffsets 279 90 + 281: 7(fvec4) CompositeExtract 280 1 + Store 12(result) 281 + 282: 22(int) CompositeExtract 280 0 + 283: 7(fvec4) Load 12(result) + 284: 7(fvec4) Load 9(texel) + 285: 7(fvec4) FAdd 284 283 + Store 9(texel) 285 + 286: 31 Load 33(s2DArray) + 287: 35(fvec3) Load 37(c3) + 288: 6(float) Load 176(lod) + 289:104(ResType) ImageSparseGather 286 287 39 Lod ConstOffsets 288 90 + 290: 7(fvec4) CompositeExtract 289 1 + Store 12(result) 290 + 291: 22(int) CompositeExtract 289 0 + 292: 7(fvec4) Load 12(result) + 293: 7(fvec4) Load 9(texel) + 294: 7(fvec4) FAdd 293 292 + Store 9(texel) 294 + 297: 7(fvec4) Load 9(texel) + Store 296(fragColor) 297 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.types.frag.out b/deps/glslang/Test/baseResults/spv.types.frag.out new file mode 100644 index 00000000..e6fd3e0c --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.types.frag.out @@ -0,0 +1,337 @@ +spv.types.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 260 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 96 98 105 107 114 116 123 125 132 134 141 143 150 152 159 161 165 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 8 "b" + Name 10 "u_b" + Name 12 "i_b" + Name 17 "b2" + Name 19 "u_b2" + Name 24 "i_b2" + Name 38 "b3" + Name 40 "u_b3" + Name 43 "i_b3" + Name 63 "b4" + Name 65 "u_b4" + Name 68 "i_b4" + Name 94 "i" + Name 96 "u_i" + Name 98 "i_i" + Name 103 "i2" + Name 105 "u_i2" + Name 107 "i_i2" + Name 112 "i3" + Name 114 "u_i3" + Name 116 "i_i3" + Name 121 "i4" + Name 123 "u_i4" + Name 125 "i_i4" + Name 130 "f" + Name 132 "u_f" + Name 134 "i_f" + Name 139 "f2" + Name 141 "u_f2" + Name 143 "i_f2" + Name 148 "f3" + Name 150 "u_f3" + Name 152 "i_f3" + Name 157 "f4" + Name 159 "u_f4" + Name 161 "i_f4" + Name 165 "gl_FragColor" + Decorate 96(u_i) Flat + Decorate 98(i_i) Flat + Decorate 105(u_i2) Flat + Decorate 107(i_i2) Flat + Decorate 114(u_i3) Flat + Decorate 116(i_i3) Flat + Decorate 123(u_i4) Flat + Decorate 125(i_i4) Flat + Decorate 165(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeBool + 7: TypePointer Function 6(bool) + 9: TypePointer Private 6(bool) + 10(u_b): 9(ptr) Variable Private + 12(i_b): 9(ptr) Variable Private + 15: TypeVector 6(bool) 2 + 16: TypePointer Function 15(bvec2) + 18: TypePointer Private 15(bvec2) + 19(u_b2): 18(ptr) Variable Private + 20: TypeInt 32 0 + 21: 20(int) Constant 0 + 24(i_b2): 18(ptr) Variable Private + 28: 20(int) Constant 1 + 36: TypeVector 6(bool) 3 + 37: TypePointer Function 36(bvec3) + 39: TypePointer Private 36(bvec3) + 40(u_b3): 39(ptr) Variable Private + 43(i_b3): 39(ptr) Variable Private + 53: 20(int) Constant 2 + 61: TypeVector 6(bool) 4 + 62: TypePointer Function 61(bvec4) + 64: TypePointer Private 61(bvec4) + 65(u_b4): 64(ptr) Variable Private + 68(i_b4): 64(ptr) Variable Private + 84: 20(int) Constant 3 + 92: TypeInt 32 1 + 93: TypePointer Function 92(int) + 95: TypePointer Input 92(int) + 96(u_i): 95(ptr) Variable Input + 98(i_i): 95(ptr) Variable Input + 101: TypeVector 92(int) 2 + 102: TypePointer Function 101(ivec2) + 104: TypePointer Input 101(ivec2) + 105(u_i2): 104(ptr) Variable Input + 107(i_i2): 104(ptr) Variable Input + 110: TypeVector 92(int) 3 + 111: TypePointer Function 110(ivec3) + 113: TypePointer Input 110(ivec3) + 114(u_i3): 113(ptr) Variable Input + 116(i_i3): 113(ptr) Variable Input + 119: TypeVector 92(int) 4 + 120: TypePointer Function 119(ivec4) + 122: TypePointer Input 119(ivec4) + 123(u_i4): 122(ptr) Variable Input + 125(i_i4): 122(ptr) Variable Input + 128: TypeFloat 32 + 129: TypePointer Function 128(float) + 131: TypePointer Input 128(float) + 132(u_f): 131(ptr) Variable Input + 134(i_f): 131(ptr) Variable Input + 137: TypeVector 128(float) 2 + 138: TypePointer Function 137(fvec2) + 140: TypePointer Input 137(fvec2) + 141(u_f2): 140(ptr) Variable Input + 143(i_f2): 140(ptr) Variable Input + 146: TypeVector 128(float) 3 + 147: TypePointer Function 146(fvec3) + 149: TypePointer Input 146(fvec3) + 150(u_f3): 149(ptr) Variable Input + 152(i_f3): 149(ptr) Variable Input + 155: TypeVector 128(float) 4 + 156: TypePointer Function 155(fvec4) + 158: TypePointer Input 155(fvec4) + 159(u_f4): 158(ptr) Variable Input + 161(i_f4): 158(ptr) Variable Input + 164: TypePointer Output 155(fvec4) +165(gl_FragColor): 164(ptr) Variable Output + 257: 128(float) Constant 1065353216 + 258: 155(fvec4) ConstantComposite 257 257 257 257 + 4(main): 2 Function None 3 + 5: Label + 8(b): 7(ptr) Variable Function + 17(b2): 16(ptr) Variable Function + 38(b3): 37(ptr) Variable Function + 63(b4): 62(ptr) Variable Function + 94(i): 93(ptr) Variable Function + 103(i2): 102(ptr) Variable Function + 112(i3): 111(ptr) Variable Function + 121(i4): 120(ptr) Variable Function + 130(f): 129(ptr) Variable Function + 139(f2): 138(ptr) Variable Function + 148(f3): 147(ptr) Variable Function + 157(f4): 156(ptr) Variable Function + 194: 156(ptr) Variable Function + 11: 6(bool) Load 10(u_b) + 13: 6(bool) Load 12(i_b) + 14: 6(bool) LogicalAnd 11 13 + Store 8(b) 14 + 22: 9(ptr) AccessChain 19(u_b2) 21 + 23: 6(bool) Load 22 + 25: 9(ptr) AccessChain 24(i_b2) 21 + 26: 6(bool) Load 25 + 27: 6(bool) LogicalAnd 23 26 + 29: 9(ptr) AccessChain 19(u_b2) 28 + 30: 6(bool) Load 29 + 31: 6(bool) LogicalAnd 27 30 + 32: 9(ptr) AccessChain 24(i_b2) 28 + 33: 6(bool) Load 32 + 34: 6(bool) LogicalAnd 31 33 + 35: 15(bvec2) CompositeConstruct 34 34 + Store 17(b2) 35 + 41: 9(ptr) AccessChain 40(u_b3) 21 + 42: 6(bool) Load 41 + 44: 9(ptr) AccessChain 43(i_b3) 21 + 45: 6(bool) Load 44 + 46: 6(bool) LogicalAnd 42 45 + 47: 9(ptr) AccessChain 40(u_b3) 28 + 48: 6(bool) Load 47 + 49: 6(bool) LogicalAnd 46 48 + 50: 9(ptr) AccessChain 43(i_b3) 28 + 51: 6(bool) Load 50 + 52: 6(bool) LogicalAnd 49 51 + 54: 9(ptr) AccessChain 40(u_b3) 53 + 55: 6(bool) Load 54 + 56: 6(bool) LogicalAnd 52 55 + 57: 9(ptr) AccessChain 43(i_b3) 53 + 58: 6(bool) Load 57 + 59: 6(bool) LogicalAnd 56 58 + 60: 36(bvec3) CompositeConstruct 59 59 59 + Store 38(b3) 60 + 66: 9(ptr) AccessChain 65(u_b4) 21 + 67: 6(bool) Load 66 + 69: 9(ptr) AccessChain 68(i_b4) 21 + 70: 6(bool) Load 69 + 71: 6(bool) LogicalAnd 67 70 + 72: 9(ptr) AccessChain 65(u_b4) 28 + 73: 6(bool) Load 72 + 74: 6(bool) LogicalAnd 71 73 + 75: 9(ptr) AccessChain 68(i_b4) 28 + 76: 6(bool) Load 75 + 77: 6(bool) LogicalAnd 74 76 + 78: 9(ptr) AccessChain 65(u_b4) 53 + 79: 6(bool) Load 78 + 80: 6(bool) LogicalAnd 77 79 + 81: 9(ptr) AccessChain 68(i_b4) 53 + 82: 6(bool) Load 81 + 83: 6(bool) LogicalAnd 80 82 + 85: 9(ptr) AccessChain 65(u_b4) 84 + 86: 6(bool) Load 85 + 87: 6(bool) LogicalAnd 83 86 + 88: 9(ptr) AccessChain 68(i_b4) 84 + 89: 6(bool) Load 88 + 90: 6(bool) LogicalAnd 87 89 + 91: 61(bvec4) CompositeConstruct 90 90 90 90 + Store 63(b4) 91 + 97: 92(int) Load 96(u_i) + 99: 92(int) Load 98(i_i) + 100: 92(int) IAdd 97 99 + Store 94(i) 100 + 106: 101(ivec2) Load 105(u_i2) + 108: 101(ivec2) Load 107(i_i2) + 109: 101(ivec2) IAdd 106 108 + Store 103(i2) 109 + 115: 110(ivec3) Load 114(u_i3) + 117: 110(ivec3) Load 116(i_i3) + 118: 110(ivec3) IAdd 115 117 + Store 112(i3) 118 + 124: 119(ivec4) Load 123(u_i4) + 126: 119(ivec4) Load 125(i_i4) + 127: 119(ivec4) IAdd 124 126 + Store 121(i4) 127 + 133: 128(float) Load 132(u_f) + 135: 128(float) Load 134(i_f) + 136: 128(float) FAdd 133 135 + Store 130(f) 136 + 142: 137(fvec2) Load 141(u_f2) + 144: 137(fvec2) Load 143(i_f2) + 145: 137(fvec2) FAdd 142 144 + Store 139(f2) 145 + 151: 146(fvec3) Load 150(u_f3) + 153: 146(fvec3) Load 152(i_f3) + 154: 146(fvec3) FAdd 151 153 + Store 148(f3) 154 + 160: 155(fvec4) Load 159(u_f4) + 162: 155(fvec4) Load 161(i_f4) + 163: 155(fvec4) FAdd 160 162 + Store 157(f4) 163 + 166: 6(bool) Load 8(b) + 167: 7(ptr) AccessChain 17(b2) 21 + 168: 6(bool) Load 167 + 169: 6(bool) LogicalOr 166 168 + 170: 7(ptr) AccessChain 17(b2) 28 + 171: 6(bool) Load 170 + 172: 6(bool) LogicalOr 169 171 + 173: 7(ptr) AccessChain 38(b3) 21 + 174: 6(bool) Load 173 + 175: 6(bool) LogicalOr 172 174 + 176: 7(ptr) AccessChain 38(b3) 28 + 177: 6(bool) Load 176 + 178: 6(bool) LogicalOr 175 177 + 179: 7(ptr) AccessChain 38(b3) 53 + 180: 6(bool) Load 179 + 181: 6(bool) LogicalOr 178 180 + 182: 7(ptr) AccessChain 63(b4) 21 + 183: 6(bool) Load 182 + 184: 6(bool) LogicalOr 181 183 + 185: 7(ptr) AccessChain 63(b4) 28 + 186: 6(bool) Load 185 + 187: 6(bool) LogicalOr 184 186 + 188: 7(ptr) AccessChain 63(b4) 53 + 189: 6(bool) Load 188 + 190: 6(bool) LogicalOr 187 189 + 191: 7(ptr) AccessChain 63(b4) 84 + 192: 6(bool) Load 191 + 193: 6(bool) LogicalOr 190 192 + SelectionMerge 196 None + BranchConditional 193 195 256 + 195: Label + 197: 92(int) Load 94(i) + 198: 93(ptr) AccessChain 103(i2) 21 + 199: 92(int) Load 198 + 200: 92(int) IAdd 197 199 + 201: 93(ptr) AccessChain 103(i2) 28 + 202: 92(int) Load 201 + 203: 92(int) IAdd 200 202 + 204: 93(ptr) AccessChain 112(i3) 21 + 205: 92(int) Load 204 + 206: 92(int) IAdd 203 205 + 207: 93(ptr) AccessChain 112(i3) 28 + 208: 92(int) Load 207 + 209: 92(int) IAdd 206 208 + 210: 93(ptr) AccessChain 112(i3) 53 + 211: 92(int) Load 210 + 212: 92(int) IAdd 209 211 + 213: 93(ptr) AccessChain 121(i4) 21 + 214: 92(int) Load 213 + 215: 92(int) IAdd 212 214 + 216: 93(ptr) AccessChain 121(i4) 28 + 217: 92(int) Load 216 + 218: 92(int) IAdd 215 217 + 219: 93(ptr) AccessChain 121(i4) 53 + 220: 92(int) Load 219 + 221: 92(int) IAdd 218 220 + 222: 93(ptr) AccessChain 121(i4) 84 + 223: 92(int) Load 222 + 224: 92(int) IAdd 221 223 + 225: 128(float) ConvertSToF 224 + 226: 128(float) Load 130(f) + 227: 128(float) FAdd 225 226 + 228: 129(ptr) AccessChain 139(f2) 21 + 229: 128(float) Load 228 + 230: 128(float) FAdd 227 229 + 231: 129(ptr) AccessChain 139(f2) 28 + 232: 128(float) Load 231 + 233: 128(float) FAdd 230 232 + 234: 129(ptr) AccessChain 148(f3) 21 + 235: 128(float) Load 234 + 236: 128(float) FAdd 233 235 + 237: 129(ptr) AccessChain 148(f3) 28 + 238: 128(float) Load 237 + 239: 128(float) FAdd 236 238 + 240: 129(ptr) AccessChain 148(f3) 53 + 241: 128(float) Load 240 + 242: 128(float) FAdd 239 241 + 243: 129(ptr) AccessChain 157(f4) 21 + 244: 128(float) Load 243 + 245: 128(float) FAdd 242 244 + 246: 129(ptr) AccessChain 157(f4) 28 + 247: 128(float) Load 246 + 248: 128(float) FAdd 245 247 + 249: 129(ptr) AccessChain 157(f4) 53 + 250: 128(float) Load 249 + 251: 128(float) FAdd 248 250 + 252: 129(ptr) AccessChain 157(f4) 84 + 253: 128(float) Load 252 + 254: 128(float) FAdd 251 253 + 255: 155(fvec4) CompositeConstruct 254 254 254 254 + Store 194 255 + Branch 196 + 256: Label + Store 194 258 + Branch 196 + 196: Label + 259: 155(fvec4) Load 194 + Store 165(gl_FragColor) 259 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.uint.frag.out b/deps/glslang/Test/baseResults/spv.uint.frag.out new file mode 100644 index 00000000..af0ad85a --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.uint.frag.out @@ -0,0 +1,441 @@ +spv.uint.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 213 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 15 68 77 206 208 210 + ExecutionMode 4 OriginUpperLeft + Source ESSL 310 + Name 4 "main" + Name 8 "count" + Name 12 "u" + Name 15 "t" + Name 55 "shiftedii" + Name 57 "shiftedui" + Name 59 "shiftediu" + Name 60 "shifteduu" + Name 68 "c" + Name 72 "usampler" + Name 77 "tc" + Name 111 "af" + Name 115 "ab" + Name 118 "ai" + Name 152 "mask1" + Name 154 "mask2" + Name 156 "mask3" + Name 160 "mask4" + Name 206 "f" + Name 208 "v" + Name 210 "i" + Name 212 "b" + Decorate 8(count) RelaxedPrecision + Decorate 12(u) RelaxedPrecision + Decorate 15(t) RelaxedPrecision + Decorate 15(t) Flat + Decorate 19 RelaxedPrecision + Decorate 21 RelaxedPrecision + Decorate 27 RelaxedPrecision + Decorate 28 RelaxedPrecision + Decorate 32 RelaxedPrecision + Decorate 33 RelaxedPrecision + Decorate 38 RelaxedPrecision + Decorate 39 RelaxedPrecision + Decorate 43 RelaxedPrecision + Decorate 44 RelaxedPrecision + Decorate 48 RelaxedPrecision + Decorate 49 RelaxedPrecision + Decorate 53 RelaxedPrecision + Decorate 54 RelaxedPrecision + Decorate 55(shiftedii) RelaxedPrecision + Decorate 57(shiftedui) RelaxedPrecision + Decorate 59(shiftediu) RelaxedPrecision + Decorate 60(shifteduu) RelaxedPrecision + Decorate 61 RelaxedPrecision + Decorate 62 RelaxedPrecision + Decorate 68(c) RelaxedPrecision + Decorate 72(usampler) RelaxedPrecision + Decorate 72(usampler) DescriptorSet 0 + Decorate 73 RelaxedPrecision + Decorate 77(tc) RelaxedPrecision + Decorate 78 RelaxedPrecision + Decorate 79 RelaxedPrecision + Decorate 80 RelaxedPrecision + Decorate 81 RelaxedPrecision + Decorate 85 RelaxedPrecision + Decorate 86 RelaxedPrecision + Decorate 88 RelaxedPrecision + Decorate 89 RelaxedPrecision + Decorate 90 RelaxedPrecision + Decorate 91 RelaxedPrecision + Decorate 92 RelaxedPrecision + Decorate 97 RelaxedPrecision + Decorate 98 RelaxedPrecision + Decorate 101 RelaxedPrecision + Decorate 102 RelaxedPrecision + Decorate 105 RelaxedPrecision + Decorate 111(af) RelaxedPrecision + Decorate 112 RelaxedPrecision + Decorate 113 RelaxedPrecision + Decorate 116 RelaxedPrecision + Decorate 118(ai) RelaxedPrecision + Decorate 119 RelaxedPrecision + Decorate 120 RelaxedPrecision + Decorate 121 RelaxedPrecision + Decorate 122 RelaxedPrecision + Decorate 124 RelaxedPrecision + Decorate 125 RelaxedPrecision + Decorate 126 RelaxedPrecision + Decorate 127 RelaxedPrecision + Decorate 128 RelaxedPrecision + Decorate 129 RelaxedPrecision + Decorate 130 RelaxedPrecision + Decorate 131 RelaxedPrecision + Decorate 135 RelaxedPrecision + Decorate 136 RelaxedPrecision + Decorate 140 RelaxedPrecision + Decorate 141 RelaxedPrecision + Decorate 145 RelaxedPrecision + Decorate 146 RelaxedPrecision + Decorate 150 RelaxedPrecision + Decorate 151 RelaxedPrecision + Decorate 152(mask1) RelaxedPrecision + Decorate 154(mask2) RelaxedPrecision + Decorate 156(mask3) RelaxedPrecision + Decorate 157 RelaxedPrecision + Decorate 159 RelaxedPrecision + Decorate 160(mask4) RelaxedPrecision + Decorate 162 RelaxedPrecision + Decorate 163 RelaxedPrecision + Decorate 167 RelaxedPrecision + Decorate 168 RelaxedPrecision + Decorate 169 RelaxedPrecision + Decorate 170 RelaxedPrecision + Decorate 171 RelaxedPrecision + Decorate 175 RelaxedPrecision + Decorate 176 RelaxedPrecision + Decorate 177 RelaxedPrecision + Decorate 178 RelaxedPrecision + Decorate 179 RelaxedPrecision + Decorate 180 RelaxedPrecision + Decorate 184 RelaxedPrecision + Decorate 185 RelaxedPrecision + Decorate 186 RelaxedPrecision + Decorate 187 RelaxedPrecision + Decorate 188 RelaxedPrecision + Decorate 192 RelaxedPrecision + Decorate 193 RelaxedPrecision + Decorate 194 RelaxedPrecision + Decorate 195 RelaxedPrecision + Decorate 196 RelaxedPrecision + Decorate 197 RelaxedPrecision + Decorate 198 RelaxedPrecision + Decorate 202 RelaxedPrecision + Decorate 203 RelaxedPrecision + Decorate 206(f) RelaxedPrecision + Decorate 208(v) RelaxedPrecision + Decorate 208(v) Flat + Decorate 210(i) RelaxedPrecision + Decorate 210(i) Flat + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 1 + 10: TypeInt 32 0 + 11: TypePointer Function 10(int) + 13: TypeVector 10(int) 2 + 14: TypePointer Input 13(ivec2) + 15(t): 14(ptr) Variable Input + 16: 10(int) Constant 1 + 17: TypePointer Input 10(int) + 20: 10(int) Constant 3 + 22: TypeBool + 23: 22(bool) ConstantTrue + 26: 6(int) Constant 2 + 31: 6(int) Constant 3 + 34: 22(bool) ConstantFalse + 37: 6(int) Constant 5 + 42: 6(int) Constant 7 + 47: 6(int) Constant 11 + 52: 6(int) Constant 13 + 56: 6(int) Constant 4294967295 + 58: 10(int) Constant 4194303 + 66: TypeVector 10(int) 4 + 67: TypePointer Output 66(ivec4) + 68(c): 67(ptr) Variable Output + 69: TypeImage 10(int) 2D sampled format:Unknown + 70: TypeSampledImage 69 + 71: TypePointer UniformConstant 70 + 72(usampler): 71(ptr) Variable UniformConstant + 74: TypeFloat 32 + 75: TypeVector 74(float) 2 + 76: TypePointer Input 75(fvec2) + 77(tc): 76(ptr) Variable Input + 87: 74(float) Constant 1065353216 + 99: 74(float) Constant 1073741824 + 100: 75(fvec2) ConstantComposite 99 99 + 103: 10(int) Constant 0 + 106: 10(int) Constant 4 + 110: TypePointer Function 74(float) + 114: TypePointer Function 22(bool) + 134: 6(int) Constant 17 + 139: 6(int) Constant 19 + 144: 6(int) Constant 23 + 149: 6(int) Constant 27 + 153: 10(int) Constant 161 + 155: 10(int) Constant 2576 + 158: 6(int) Constant 4 + 161: 10(int) Constant 2737 + 199: 10(int) Constant 4294967295 + 200: TypePointer Output 10(int) + 205: TypePointer Input 74(float) + 206(f): 205(ptr) Variable Input + 207: TypePointer Input 66(ivec4) + 208(v): 207(ptr) Variable Input + 209: TypePointer Input 6(int) + 210(i): 209(ptr) Variable Input + 211: TypePointer Private 22(bool) + 212(b): 211(ptr) Variable Private + 4(main): 2 Function None 3 + 5: Label + 8(count): 7(ptr) Variable Function + 12(u): 11(ptr) Variable Function + 55(shiftedii): 7(ptr) Variable Function + 57(shiftedui): 11(ptr) Variable Function + 59(shiftediu): 7(ptr) Variable Function + 60(shifteduu): 11(ptr) Variable Function + 111(af): 110(ptr) Variable Function + 115(ab): 114(ptr) Variable Function + 118(ai): 7(ptr) Variable Function + 152(mask1): 11(ptr) Variable Function + 154(mask2): 11(ptr) Variable Function + 156(mask3): 11(ptr) Variable Function + 160(mask4): 11(ptr) Variable Function + Store 8(count) 9 + 18: 17(ptr) AccessChain 15(t) 16 + 19: 10(int) Load 18 + 21: 10(int) IAdd 19 20 + Store 12(u) 21 + SelectionMerge 25 None + BranchConditional 23 24 25 + 24: Label + 27: 6(int) Load 8(count) + 28: 6(int) IMul 27 26 + Store 8(count) 28 + Branch 25 + 25: Label + SelectionMerge 30 None + BranchConditional 23 29 30 + 29: Label + 32: 6(int) Load 8(count) + 33: 6(int) IMul 32 31 + Store 8(count) 33 + Branch 30 + 30: Label + SelectionMerge 36 None + BranchConditional 34 35 36 + 35: Label + 38: 6(int) Load 8(count) + 39: 6(int) IMul 38 37 + Store 8(count) 39 + Branch 36 + 36: Label + SelectionMerge 41 None + BranchConditional 23 40 41 + 40: Label + 43: 6(int) Load 8(count) + 44: 6(int) IMul 43 42 + Store 8(count) 44 + Branch 41 + 41: Label + SelectionMerge 46 None + BranchConditional 23 45 46 + 45: Label + 48: 6(int) Load 8(count) + 49: 6(int) IMul 48 47 + Store 8(count) 49 + Branch 46 + 46: Label + SelectionMerge 51 None + BranchConditional 34 50 51 + 50: Label + 53: 6(int) Load 8(count) + 54: 6(int) IMul 53 52 + Store 8(count) 54 + Branch 51 + 51: Label + Store 55(shiftedii) 56 + Store 57(shiftedui) 58 + Store 59(shiftediu) 56 + Store 60(shifteduu) 58 + 61: 6(int) Load 55(shiftedii) + 62: 6(int) Load 59(shiftediu) + 63: 22(bool) IEqual 61 62 + SelectionMerge 65 None + BranchConditional 63 64 65 + 64: Label + 73: 70 Load 72(usampler) + 78: 75(fvec2) Load 77(tc) + 79: 66(ivec4) ImageSampleImplicitLod 73 78 + Store 68(c) 79 + Branch 65 + 65: Label + 80: 10(int) Load 57(shiftedui) + 81: 10(int) Load 60(shifteduu) + 82: 22(bool) IEqual 80 81 + SelectionMerge 84 None + BranchConditional 82 83 84 + 83: Label + 85: 70 Load 72(usampler) + 86: 75(fvec2) Load 77(tc) + 88: 75(fvec2) CompositeConstruct 87 87 + 89: 75(fvec2) FAdd 86 88 + 90: 66(ivec4) ImageSampleImplicitLod 85 89 + Store 68(c) 90 + Branch 84 + 84: Label + 91: 6(int) Load 55(shiftedii) + 92: 10(int) Load 57(shiftedui) + 93: 6(int) Bitcast 92 + 94: 22(bool) IEqual 91 93 + SelectionMerge 96 None + BranchConditional 94 95 96 + 95: Label + 97: 70 Load 72(usampler) + 98: 75(fvec2) Load 77(tc) + 101: 75(fvec2) FSub 98 100 + 102: 66(ivec4) ImageSampleImplicitLod 97 101 + Store 68(c) 102 + Branch 96 + 96: Label + 104: 17(ptr) AccessChain 15(t) 103 + 105: 10(int) Load 104 + 107: 22(bool) UGreaterThan 105 106 + SelectionMerge 109 None + BranchConditional 107 108 109 + 108: Label + 112: 10(int) Load 12(u) + 113: 74(float) ConvertUToF 112 + Store 111(af) 113 + 116: 10(int) Load 12(u) + 117: 22(bool) INotEqual 116 103 + Store 115(ab) 117 + 119: 10(int) Load 12(u) + 120: 6(int) Bitcast 119 + Store 118(ai) 120 + 121: 74(float) Load 111(af) + 122: 10(int) ConvertFToU 121 + 123: 22(bool) Load 115(ab) + 124: 10(int) Select 123 16 103 + 125: 6(int) Load 118(ai) + 126: 10(int) Bitcast 125 + 127: 6(int) Load 8(count) + 128: 10(int) Bitcast 127 + 129: 66(ivec4) CompositeConstruct 122 124 126 128 + 130: 66(ivec4) Load 68(c) + 131: 66(ivec4) IAdd 130 129 + Store 68(c) 131 + Branch 109 + 109: Label + SelectionMerge 133 None + BranchConditional 23 132 133 + 132: Label + 135: 6(int) Load 8(count) + 136: 6(int) IMul 135 134 + Store 8(count) 136 + Branch 133 + 133: Label + SelectionMerge 138 None + BranchConditional 34 137 138 + 137: Label + 140: 6(int) Load 8(count) + 141: 6(int) IMul 140 139 + Store 8(count) 141 + Branch 138 + 138: Label + SelectionMerge 143 None + BranchConditional 23 142 143 + 142: Label + 145: 6(int) Load 8(count) + 146: 6(int) IMul 145 144 + Store 8(count) 146 + Branch 143 + 143: Label + SelectionMerge 148 None + BranchConditional 23 147 148 + 147: Label + 150: 6(int) Load 8(count) + 151: 6(int) IMul 150 149 + Store 8(count) 151 + Branch 148 + 148: Label + Store 152(mask1) 153 + Store 154(mask2) 155 + 157: 10(int) Load 152(mask1) + 159: 10(int) ShiftLeftLogical 157 158 + Store 156(mask3) 159 + Store 160(mask4) 161 + 162: 10(int) Load 156(mask3) + 163: 10(int) Load 154(mask2) + 164: 22(bool) IEqual 162 163 + SelectionMerge 166 None + BranchConditional 164 165 166 + 165: Label + 167: 6(int) Load 8(count) + 168: 6(int) IMul 167 26 + Store 8(count) 168 + Branch 166 + 166: Label + 169: 10(int) Load 156(mask3) + 170: 10(int) Load 152(mask1) + 171: 10(int) BitwiseAnd 169 170 + 172: 22(bool) INotEqual 171 103 + SelectionMerge 174 None + BranchConditional 172 173 174 + 173: Label + 175: 6(int) Load 8(count) + 176: 6(int) IMul 175 31 + Store 8(count) 176 + Branch 174 + 174: Label + 177: 10(int) Load 152(mask1) + 178: 10(int) Load 156(mask3) + 179: 10(int) BitwiseOr 177 178 + 180: 10(int) Load 160(mask4) + 181: 22(bool) IEqual 179 180 + SelectionMerge 183 None + BranchConditional 181 182 183 + 182: Label + 184: 6(int) Load 8(count) + 185: 6(int) IMul 184 37 + Store 8(count) 185 + Branch 183 + 183: Label + 186: 10(int) Load 152(mask1) + 187: 10(int) Load 160(mask4) + 188: 10(int) BitwiseXor 186 187 + 189: 22(bool) IEqual 188 155 + SelectionMerge 191 None + BranchConditional 189 190 191 + 190: Label + 192: 6(int) Load 8(count) + 193: 6(int) IMul 192 42 + Store 8(count) 193 + Branch 191 + 191: Label + 194: 6(int) Load 8(count) + 195: 10(int) Bitcast 194 + 196: 66(ivec4) CompositeConstruct 195 195 195 195 + 197: 66(ivec4) Load 68(c) + 198: 66(ivec4) IAdd 197 196 + Store 68(c) 198 + 201: 200(ptr) AccessChain 68(c) 103 + 202: 10(int) Load 201 + 203: 10(int) IAdd 202 199 + 204: 200(ptr) AccessChain 68(c) 103 + Store 204 203 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.uniformArray.frag.out b/deps/glslang/Test/baseResults/spv.uniformArray.frag.out new file mode 100644 index 00000000..ff5855c1 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.uniformArray.frag.out @@ -0,0 +1,77 @@ +spv.uniformArray.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 53 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 14 25 35 47 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 9 "texColor" + Name 14 "color" + Name 25 "inColor" + Name 35 "alpha" + Name 47 "gl_FragColor" + Name 52 "texSampler2D" + Decorate 47(gl_FragColor) Location 0 + Decorate 52(texSampler2D) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypeInt 32 0 + 11: 10(int) Constant 6 + 12: TypeArray 7(fvec4) 11 + 13: TypePointer Input 12 + 14(color): 13(ptr) Variable Input + 15: TypeInt 32 1 + 16: 15(int) Constant 1 + 17: TypePointer Input 7(fvec4) + 23: TypeVector 6(float) 3 + 24: TypePointer Input 23(fvec3) + 25(inColor): 24(ptr) Variable Input + 32: 10(int) Constant 16 + 33: TypeArray 6(float) 32 + 34: TypePointer Input 33 + 35(alpha): 34(ptr) Variable Input + 36: 15(int) Constant 12 + 37: TypePointer Input 6(float) + 40: 10(int) Constant 3 + 41: TypePointer Function 6(float) + 46: TypePointer Output 7(fvec4) +47(gl_FragColor): 46(ptr) Variable Output + 49: TypeImage 6(float) 2D sampled format:Unknown + 50: TypeSampledImage 49 + 51: TypePointer UniformConstant 50 +52(texSampler2D): 51(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 9(texColor): 8(ptr) Variable Function + 18: 17(ptr) AccessChain 14(color) 16 + 19: 7(fvec4) Load 18 + 20: 17(ptr) AccessChain 14(color) 16 + 21: 7(fvec4) Load 20 + 22: 7(fvec4) FAdd 19 21 + Store 9(texColor) 22 + 26: 23(fvec3) Load 25(inColor) + 27: 7(fvec4) Load 9(texColor) + 28: 23(fvec3) VectorShuffle 27 27 0 1 2 + 29: 23(fvec3) FAdd 28 26 + 30: 7(fvec4) Load 9(texColor) + 31: 7(fvec4) VectorShuffle 30 29 4 5 6 3 + Store 9(texColor) 31 + 38: 37(ptr) AccessChain 35(alpha) 36 + 39: 6(float) Load 38 + 42: 41(ptr) AccessChain 9(texColor) 40 + 43: 6(float) Load 42 + 44: 6(float) FAdd 43 39 + 45: 41(ptr) AccessChain 9(texColor) 40 + Store 45 44 + 48: 7(fvec4) Load 9(texColor) + Store 47(gl_FragColor) 48 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.unit1.frag.out b/deps/glslang/Test/baseResults/spv.unit1.frag.out new file mode 100644 index 00000000..d64d437f --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.unit1.frag.out @@ -0,0 +1,298 @@ +spv.unit1.frag +Shader version: 460 +gl_FragCoord origin is upper left +0:? Sequence +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 move second child to first child ( temp highp float) +0:12 'f' ( global highp float) +0:12 Constant: +0:12 10.000000 +0:13 Sequence +0:13 move second child to first child ( temp highp float) +0:13 'g' ( temp highp float) +0:13 Function Call: foo( ( global highp float) +0:14 add second child into first child ( temp highp float) +0:14 'f' ( global highp float) +0:14 'g' ( temp highp float) +0:15 add second child into first child ( temp highp float) +0:15 'f' ( global highp float) +0:15 direct index ( temp highp float) +0:15 'gl_FragCoord' ( gl_FragCoord highp 4-component vector of float FragCoord) +0:15 Constant: +0:15 1 (const int) +0:? Linker Objects +0:? 'f' ( global highp float) +0:? 'a1' ( global highp float) +0:? 'cout' ( out highp float) + +spv.unit2.frag +Shader version: 410 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: foo( ( global highp float) +0:12 Function Parameters: +0:14 Sequence +0:14 Sequence +0:14 move second child to first child ( temp highp float) +0:14 'h2' ( temp highp float) +0:14 add ( temp highp float) +0:14 component-wise multiply ( temp highp float) +0:14 Constant: +0:14 2.000000 +0:14 'f' ( global highp float) +0:14 'cin' ( smooth in highp float) +0:15 Sequence +0:15 move second child to first child ( temp highp float) +0:15 'g2' ( temp highp float) +0:15 Function Call: bar( ( global highp float) +0:16 Branch: Return with expression +0:16 add ( temp highp float) +0:16 add ( temp highp float) +0:16 'h2' ( temp highp float) +0:16 'g2' ( temp highp float) +0:16 direct index ( temp highp float) +0:16 'gl_FragCoord' ( gl_FragCoord highp 4-component vector of float FragCoord) +0:16 Constant: +0:16 1 (const int) +0:? Linker Objects +0:? 'a2' ( global highp float) +0:? 'f' ( global highp float) +0:? 'cout' ( out highp float) +0:? 'cin' ( smooth in highp float) + +spv.unit3.frag +Shader version: 460 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Sequence +0:4 move second child to first child ( temp highp float) +0:4 'h3' ( global highp float) +0:4 Constant: +0:4 3.000000 +0:9 Function Definition: bar( ( global highp float) +0:9 Function Parameters: +0:11 Sequence +0:11 multiply second child into first child ( temp highp float) +0:11 'h3' ( global highp float) +0:11 'f' ( global highp float) +0:12 Sequence +0:12 move second child to first child ( temp highp float) +0:12 'g3' ( temp highp float) +0:12 component-wise multiply ( temp highp float) +0:12 Constant: +0:12 2.000000 +0:12 'h3' ( global highp float) +0:13 move second child to first child ( temp highp float) +0:13 'cout' ( out highp float) +0:13 'g3' ( temp highp float) +0:14 Branch: Return with expression +0:14 add ( temp highp float) +0:14 add ( temp highp float) +0:14 'h3' ( global highp float) +0:14 'g3' ( temp highp float) +0:14 direct index ( temp highp float) +0:14 'gl_FragCoord' ( gl_FragCoord highp 4-component vector of float FragCoord) +0:14 Constant: +0:14 1 (const int) +0:? Linker Objects +0:? 'f' ( global highp float) +0:? 'h3' ( global highp float) +0:? 'cout' ( out highp float) +0:? 'cin' ( smooth in highp float) + + +Linked fragment stage: + + +Shader version: 460 +gl_FragCoord origin is upper left +0:? Sequence +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 move second child to first child ( temp highp float) +0:12 'f' ( global highp float) +0:12 Constant: +0:12 10.000000 +0:13 Sequence +0:13 move second child to first child ( temp highp float) +0:13 'g' ( temp highp float) +0:13 Function Call: foo( ( global highp float) +0:14 add second child into first child ( temp highp float) +0:14 'f' ( global highp float) +0:14 'g' ( temp highp float) +0:15 add second child into first child ( temp highp float) +0:15 'f' ( global highp float) +0:15 direct index ( temp highp float) +0:15 'gl_FragCoord' ( gl_FragCoord highp 4-component vector of float FragCoord) +0:15 Constant: +0:15 1 (const int) +0:12 Function Definition: foo( ( global highp float) +0:12 Function Parameters: +0:14 Sequence +0:14 Sequence +0:14 move second child to first child ( temp highp float) +0:14 'h2' ( temp highp float) +0:14 add ( temp highp float) +0:14 component-wise multiply ( temp highp float) +0:14 Constant: +0:14 2.000000 +0:14 'f' ( global highp float) +0:14 'cin' ( smooth in highp float) +0:15 Sequence +0:15 move second child to first child ( temp highp float) +0:15 'g2' ( temp highp float) +0:15 Function Call: bar( ( global highp float) +0:16 Branch: Return with expression +0:16 add ( temp highp float) +0:16 add ( temp highp float) +0:16 'h2' ( temp highp float) +0:16 'g2' ( temp highp float) +0:16 direct index ( temp highp float) +0:16 'gl_FragCoord' ( gl_FragCoord highp 4-component vector of float FragCoord) +0:16 Constant: +0:16 1 (const int) +0:4 Sequence +0:4 move second child to first child ( temp highp float) +0:4 'h3' ( global highp float) +0:4 Constant: +0:4 3.000000 +0:9 Function Definition: bar( ( global highp float) +0:9 Function Parameters: +0:11 Sequence +0:11 multiply second child into first child ( temp highp float) +0:11 'h3' ( global highp float) +0:11 'f' ( global highp float) +0:12 Sequence +0:12 move second child to first child ( temp highp float) +0:12 'g3' ( temp highp float) +0:12 component-wise multiply ( temp highp float) +0:12 Constant: +0:12 2.000000 +0:12 'h3' ( global highp float) +0:13 move second child to first child ( temp highp float) +0:13 'cout' ( out highp float) +0:13 'g3' ( temp highp float) +0:14 Branch: Return with expression +0:14 add ( temp highp float) +0:14 add ( temp highp float) +0:14 'h3' ( global highp float) +0:14 'g3' ( temp highp float) +0:14 direct index ( temp highp float) +0:14 'gl_FragCoord' ( gl_FragCoord highp 4-component vector of float FragCoord) +0:14 Constant: +0:14 1 (const int) +0:? Linker Objects +0:? 'f' ( global highp float) +0:? 'a1' ( global highp float) +0:? 'cout' ( out highp float) +0:? 'a2' ( global highp float) +0:? 'cin' ( smooth in highp float) +0:? 'h3' ( global highp float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 69 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 25 37 57 + ExecutionMode 4 OriginUpperLeft + Source GLSL 460 + Name 4 "main" + Name 8 "foo(" + Name 10 "bar(" + Name 13 "h3" + Name 15 "f" + Name 18 "g" + Name 25 "gl_FragCoord" + Name 33 "h2" + Name 37 "cin" + Name 40 "g2" + Name 53 "g3" + Name 57 "cout" + Name 67 "a1" + Name 68 "a2" + Decorate 25(gl_FragCoord) BuiltIn FragCoord + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeFunction 6(float) + 12: TypePointer Private 6(float) + 13(h3): 12(ptr) Variable Private + 14: 6(float) Constant 1077936128 + 15(f): 12(ptr) Variable Private + 16: 6(float) Constant 1092616192 + 17: TypePointer Function 6(float) + 23: TypeVector 6(float) 4 + 24: TypePointer Input 23(fvec4) +25(gl_FragCoord): 24(ptr) Variable Input + 26: TypeInt 32 0 + 27: 26(int) Constant 1 + 28: TypePointer Input 6(float) + 34: 6(float) Constant 1073741824 + 37(cin): 28(ptr) Variable Input + 56: TypePointer Output 6(float) + 57(cout): 56(ptr) Variable Output + 67(a1): 12(ptr) Variable Private + 68(a2): 12(ptr) Variable Private + 4(main): 2 Function None 3 + 5: Label + 18(g): 17(ptr) Variable Function + Store 13(h3) 14 + Store 15(f) 16 + 19: 6(float) FunctionCall 8(foo() + Store 18(g) 19 + 20: 6(float) Load 18(g) + 21: 6(float) Load 15(f) + 22: 6(float) FAdd 21 20 + Store 15(f) 22 + 29: 28(ptr) AccessChain 25(gl_FragCoord) 27 + 30: 6(float) Load 29 + 31: 6(float) Load 15(f) + 32: 6(float) FAdd 31 30 + Store 15(f) 32 + Return + FunctionEnd + 8(foo(): 6(float) Function None 7 + 9: Label + 33(h2): 17(ptr) Variable Function + 40(g2): 17(ptr) Variable Function + 35: 6(float) Load 15(f) + 36: 6(float) FMul 34 35 + 38: 6(float) Load 37(cin) + 39: 6(float) FAdd 36 38 + Store 33(h2) 39 + 41: 6(float) FunctionCall 10(bar() + Store 40(g2) 41 + 42: 6(float) Load 33(h2) + 43: 6(float) Load 40(g2) + 44: 6(float) FAdd 42 43 + 45: 28(ptr) AccessChain 25(gl_FragCoord) 27 + 46: 6(float) Load 45 + 47: 6(float) FAdd 44 46 + ReturnValue 47 + FunctionEnd + 10(bar(): 6(float) Function None 7 + 11: Label + 53(g3): 17(ptr) Variable Function + 50: 6(float) Load 15(f) + 51: 6(float) Load 13(h3) + 52: 6(float) FMul 51 50 + Store 13(h3) 52 + 54: 6(float) Load 13(h3) + 55: 6(float) FMul 34 54 + Store 53(g3) 55 + 58: 6(float) Load 53(g3) + Store 57(cout) 58 + 59: 6(float) Load 13(h3) + 60: 6(float) Load 53(g3) + 61: 6(float) FAdd 59 60 + 62: 28(ptr) AccessChain 25(gl_FragCoord) 27 + 63: 6(float) Load 62 + 64: 6(float) FAdd 61 63 + ReturnValue 64 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.variableArrayIndex.frag.out b/deps/glslang/Test/baseResults/spv.variableArrayIndex.frag.out new file mode 100644 index 00000000..e0010dfc --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.variableArrayIndex.frag.out @@ -0,0 +1,144 @@ +spv.variableArrayIndex.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 93 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 10 20 34 36 54 63 + ExecutionMode 4 OriginUpperLeft + Source GLSL 400 + Name 4 "main" + Name 8 "iLocal" + Name 10 "Count" + Name 13 "lunarStruct1" + MemberName 13(lunarStruct1) 0 "i" + MemberName 13(lunarStruct1) 1 "f" + Name 14 "lunarStruct2" + MemberName 14(lunarStruct2) 0 "i" + MemberName 14(lunarStruct2) 1 "f" + MemberName 14(lunarStruct2) 2 "s1_1" + Name 18 "lunarStruct3" + MemberName 18(lunarStruct3) 0 "s2_1" + MemberName 18(lunarStruct3) 1 "i" + MemberName 18(lunarStruct3) 2 "f" + MemberName 18(lunarStruct3) 3 "s1_1" + Name 20 "foo3" + Name 30 "scale" + Name 34 "foo2" + Name 36 "foo" + Name 54 "gl_FragColor" + Name 59 "samp2D" + Name 63 "coord" + Name 69 "constructed" + Decorate 10(Count) Flat + Decorate 20(foo3) Flat + Decorate 34(foo2) Flat + Decorate 36(foo) Flat + Decorate 54(gl_FragColor) Location 0 + Decorate 59(samp2D) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: TypePointer Input 6(int) + 10(Count): 9(ptr) Variable Input + 12: TypeFloat 32 +13(lunarStruct1): TypeStruct 6(int) 12(float) +14(lunarStruct2): TypeStruct 6(int) 12(float) 13(lunarStruct1) + 15: TypeInt 32 0 + 16: 15(int) Constant 3 + 17: TypeArray 14(lunarStruct2) 16 +18(lunarStruct3): TypeStruct 17 6(int) 12(float) 13(lunarStruct1) + 19: TypePointer Input 18(lunarStruct3) + 20(foo3): 19(ptr) Variable Input + 21: 6(int) Constant 0 + 22: 6(int) Constant 1 + 25: TypeBool + 29: TypePointer Function 12(float) + 31: 15(int) Constant 5 + 32: TypeArray 14(lunarStruct2) 31 + 33: TypePointer Input 32 + 34(foo2): 33(ptr) Variable Input + 35: TypePointer Input 13(lunarStruct1) + 36(foo): 35(ptr) Variable Input + 41: 6(int) Constant 2 + 46: TypePointer Input 12(float) + 52: TypeVector 12(float) 4 + 53: TypePointer Output 52(fvec4) +54(gl_FragColor): 53(ptr) Variable Output + 56: TypeImage 12(float) 2D sampled format:Unknown + 57: TypeSampledImage 56 + 58: TypePointer UniformConstant 57 + 59(samp2D): 58(ptr) Variable UniformConstant + 61: TypeVector 12(float) 2 + 62: TypePointer Input 61(fvec2) + 63(coord): 62(ptr) Variable Input + 67: TypeArray 61(fvec2) 16 + 68: TypePointer Function 67 + 73: 12(float) Constant 1065353216 + 74: 12(float) Constant 1073741824 + 75: 61(fvec2) ConstantComposite 73 74 + 79: TypePointer Function 61(fvec2) + 4(main): 2 Function None 3 + 5: Label + 8(iLocal): 7(ptr) Variable Function + 30(scale): 29(ptr) Variable Function + 69(constructed): 68(ptr) Variable Function + 11: 6(int) Load 10(Count) + Store 8(iLocal) 11 + 23: 9(ptr) AccessChain 20(foo3) 21 22 21 + 24: 6(int) Load 23 + 26: 25(bool) SGreaterThan 24 21 + SelectionMerge 28 None + BranchConditional 26 27 49 + 27: Label + 37: 9(ptr) AccessChain 36(foo) 21 + 38: 6(int) Load 37 + 39: 9(ptr) AccessChain 20(foo3) 21 38 21 + 40: 6(int) Load 39 + 42: 6(int) IAdd 40 41 + 43: 6(int) Load 8(iLocal) + 44: 6(int) IAdd 43 22 + Store 8(iLocal) 44 + 45: 6(int) IAdd 42 44 + 47: 46(ptr) AccessChain 34(foo2) 45 41 22 + 48: 12(float) Load 47 + Store 30(scale) 48 + Branch 28 + 49: Label + 50: 46(ptr) AccessChain 20(foo3) 21 21 41 22 + 51: 12(float) Load 50 + Store 30(scale) 51 + Branch 28 + 28: Label + 55: 12(float) Load 30(scale) + 60: 57 Load 59(samp2D) + 64: 61(fvec2) Load 63(coord) + 65: 52(fvec4) ImageSampleImplicitLod 60 64 + 66: 52(fvec4) VectorTimesScalar 65 55 + Store 54(gl_FragColor) 66 + 70: 61(fvec2) Load 63(coord) + 71: 12(float) Load 30(scale) + 72: 61(fvec2) CompositeConstruct 71 71 + 76: 67 CompositeConstruct 70 72 75 + Store 69(constructed) 76 + 77: 9(ptr) AccessChain 36(foo) 21 + 78: 6(int) Load 77 + 80: 79(ptr) AccessChain 69(constructed) 78 + 81: 61(fvec2) Load 80 + 82: 9(ptr) AccessChain 36(foo) 21 + 83: 6(int) Load 82 + 84: 79(ptr) AccessChain 69(constructed) 83 + 85: 61(fvec2) Load 84 + 86: 12(float) CompositeExtract 81 0 + 87: 12(float) CompositeExtract 81 1 + 88: 12(float) CompositeExtract 85 0 + 89: 12(float) CompositeExtract 85 1 + 90: 52(fvec4) CompositeConstruct 86 87 88 89 + 91: 52(fvec4) Load 54(gl_FragColor) + 92: 52(fvec4) FAdd 91 90 + Store 54(gl_FragColor) 92 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.varyingArray.frag.out b/deps/glslang/Test/baseResults/spv.varyingArray.frag.out new file mode 100644 index 00000000..0acfdd92 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.varyingArray.frag.out @@ -0,0 +1,86 @@ +spv.varyingArray.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 61 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 19 34 39 45 48 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 9 "texColor" + Name 13 "texSampler2D" + Name 19 "TexCoord" + Name 34 "color" + Name 39 "alpha" + Name 45 "gl_FragColor" + Name 48 "foo" + Decorate 13(texSampler2D) DescriptorSet 0 + Decorate 45(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypeImage 6(float) 2D sampled format:Unknown + 11: TypeSampledImage 10 + 12: TypePointer UniformConstant 11 +13(texSampler2D): 12(ptr) Variable UniformConstant + 15: TypeInt 32 0 + 16: 15(int) Constant 6 + 17: TypeArray 7(fvec4) 16 + 18: TypePointer Input 17 + 19(TexCoord): 18(ptr) Variable Input + 20: TypeInt 32 1 + 21: 20(int) Constant 4 + 22: TypePointer Input 7(fvec4) + 25: 20(int) Constant 5 + 29: TypeVector 6(float) 2 + 34(color): 22(ptr) Variable Input + 38: TypePointer Input 6(float) + 39(alpha): 38(ptr) Variable Input + 41: 15(int) Constant 3 + 42: TypePointer Function 6(float) + 44: TypePointer Output 7(fvec4) +45(gl_FragColor): 44(ptr) Variable Output + 46: TypeArray 7(fvec4) 41 + 47: TypePointer Input 46 + 48(foo): 47(ptr) Variable Input + 49: 20(int) Constant 1 + 52: 20(int) Constant 0 + 4(main): 2 Function None 3 + 5: Label + 9(texColor): 8(ptr) Variable Function + 14: 11 Load 13(texSampler2D) + 23: 22(ptr) AccessChain 19(TexCoord) 21 + 24: 7(fvec4) Load 23 + 26: 22(ptr) AccessChain 19(TexCoord) 25 + 27: 7(fvec4) Load 26 + 28: 7(fvec4) FAdd 24 27 + 30: 6(float) CompositeExtract 28 0 + 31: 6(float) CompositeExtract 28 1 + 32: 29(fvec2) CompositeConstruct 30 31 + 33: 7(fvec4) ImageSampleImplicitLod 14 32 + Store 9(texColor) 33 + 35: 7(fvec4) Load 34(color) + 36: 7(fvec4) Load 9(texColor) + 37: 7(fvec4) FAdd 36 35 + Store 9(texColor) 37 + 40: 6(float) Load 39(alpha) + 43: 42(ptr) AccessChain 9(texColor) 41 + Store 43 40 + 50: 22(ptr) AccessChain 48(foo) 49 + 51: 7(fvec4) Load 50 + 53: 22(ptr) AccessChain 19(TexCoord) 52 + 54: 7(fvec4) Load 53 + 55: 7(fvec4) FAdd 51 54 + 56: 22(ptr) AccessChain 19(TexCoord) 21 + 57: 7(fvec4) Load 56 + 58: 7(fvec4) FAdd 55 57 + 59: 7(fvec4) Load 9(texColor) + 60: 7(fvec4) FAdd 58 59 + Store 45(gl_FragColor) 60 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.varyingArrayIndirect.frag.out b/deps/glslang/Test/baseResults/spv.varyingArrayIndirect.frag.out new file mode 100644 index 00000000..ffe78591 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.varyingArrayIndirect.frag.out @@ -0,0 +1,99 @@ +spv.varyingArrayIndirect.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 70 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 19 22 30 31 45 50 56 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 9 "texColor" + Name 13 "texSampler2D" + Name 19 "userIn" + Name 22 "b" + Name 30 "TexCoord" + Name 31 "a" + Name 45 "color" + Name 50 "alpha" + Name 56 "gl_FragColor" + Decorate 13(texSampler2D) DescriptorSet 0 + Decorate 22(b) Flat + Decorate 31(a) Flat + Decorate 56(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypeImage 6(float) 2D sampled format:Unknown + 11: TypeSampledImage 10 + 12: TypePointer UniformConstant 11 +13(texSampler2D): 12(ptr) Variable UniformConstant + 15: TypeInt 32 0 + 16: 15(int) Constant 2 + 17: TypeArray 7(fvec4) 16 + 18: TypePointer Input 17 + 19(userIn): 18(ptr) Variable Input + 20: TypeInt 32 1 + 21: TypePointer Input 20(int) + 22(b): 21(ptr) Variable Input + 24: TypePointer Input 7(fvec4) + 27: 15(int) Constant 6 + 28: TypeArray 7(fvec4) 27 + 29: TypePointer Input 28 + 30(TexCoord): 29(ptr) Variable Input + 31(a): 21(ptr) Variable Input + 36: 20(int) Constant 5 + 40: TypeVector 6(float) 2 + 45(color): 24(ptr) Variable Input + 49: TypePointer Input 6(float) + 50(alpha): 49(ptr) Variable Input + 52: 15(int) Constant 3 + 53: TypePointer Function 6(float) + 55: TypePointer Output 7(fvec4) +56(gl_FragColor): 55(ptr) Variable Output + 57: 20(int) Constant 0 + 4(main): 2 Function None 3 + 5: Label + 9(texColor): 8(ptr) Variable Function + 14: 11 Load 13(texSampler2D) + 23: 20(int) Load 22(b) + 25: 24(ptr) AccessChain 19(userIn) 23 + 26: 7(fvec4) Load 25 + 32: 20(int) Load 31(a) + 33: 24(ptr) AccessChain 30(TexCoord) 32 + 34: 7(fvec4) Load 33 + 35: 7(fvec4) FAdd 26 34 + 37: 24(ptr) AccessChain 30(TexCoord) 36 + 38: 7(fvec4) Load 37 + 39: 7(fvec4) FAdd 35 38 + 41: 6(float) CompositeExtract 39 0 + 42: 6(float) CompositeExtract 39 1 + 43: 40(fvec2) CompositeConstruct 41 42 + 44: 7(fvec4) ImageSampleImplicitLod 14 43 + Store 9(texColor) 44 + 46: 7(fvec4) Load 45(color) + 47: 7(fvec4) Load 9(texColor) + 48: 7(fvec4) FAdd 47 46 + Store 9(texColor) 48 + 51: 6(float) Load 50(alpha) + 54: 53(ptr) AccessChain 9(texColor) 52 + Store 54 51 + 58: 24(ptr) AccessChain 30(TexCoord) 57 + 59: 7(fvec4) Load 58 + 60: 20(int) Load 22(b) + 61: 24(ptr) AccessChain 30(TexCoord) 60 + 62: 7(fvec4) Load 61 + 63: 7(fvec4) FAdd 59 62 + 64: 7(fvec4) Load 9(texColor) + 65: 7(fvec4) FAdd 63 64 + 66: 20(int) Load 31(a) + 67: 24(ptr) AccessChain 19(userIn) 66 + 68: 7(fvec4) Load 67 + 69: 7(fvec4) FAdd 65 68 + Store 56(gl_FragColor) 69 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.vecMatConstruct.frag.out b/deps/glslang/Test/baseResults/spv.vecMatConstruct.frag.out new file mode 100644 index 00000000..57ecd67e --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.vecMatConstruct.frag.out @@ -0,0 +1,87 @@ +spv.vecMatConstruct.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 62 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "v2" + Name 13 "m" + Name 19 "v3" + Name 27 "v4" + Name 37 "iv2" + Name 45 "iv3" + Name 54 "iv4" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypePointer Function 7(fvec2) + 10: TypeVector 6(float) 3 + 11: TypeMatrix 10(fvec3) 4 + 12: TypePointer Function 11 + 18: TypePointer Function 10(fvec3) + 25: TypeVector 6(float) 4 + 26: TypePointer Function 25(fvec4) + 34: TypeInt 32 1 + 35: TypeVector 34(int) 2 + 36: TypePointer Function 35(ivec2) + 43: TypeVector 34(int) 3 + 44: TypePointer Function 43(ivec3) + 52: TypeVector 34(int) 4 + 53: TypePointer Function 52(ivec4) + 4(main): 2 Function None 3 + 5: Label + 9(v2): 8(ptr) Variable Function + 13(m): 12(ptr) Variable Function + 19(v3): 18(ptr) Variable Function + 27(v4): 26(ptr) Variable Function + 37(iv2): 36(ptr) Variable Function + 45(iv3): 44(ptr) Variable Function + 54(iv4): 53(ptr) Variable Function + 14: 11 Load 13(m) + 15: 6(float) CompositeExtract 14 0 0 + 16: 6(float) CompositeExtract 14 0 1 + 17: 7(fvec2) CompositeConstruct 15 16 + Store 9(v2) 17 + 20: 11 Load 13(m) + 21: 6(float) CompositeExtract 20 0 0 + 22: 6(float) CompositeExtract 20 0 1 + 23: 6(float) CompositeExtract 20 0 2 + 24: 10(fvec3) CompositeConstruct 21 22 23 + Store 19(v3) 24 + 28: 11 Load 13(m) + 29: 6(float) CompositeExtract 28 0 0 + 30: 6(float) CompositeExtract 28 0 1 + 31: 6(float) CompositeExtract 28 0 2 + 32: 6(float) CompositeExtract 28 1 0 + 33: 25(fvec4) CompositeConstruct 29 30 31 32 + Store 27(v4) 33 + 38: 11 Load 13(m) + 39: 6(float) CompositeExtract 38 0 0 + 40: 6(float) CompositeExtract 38 0 1 + 41: 7(fvec2) CompositeConstruct 39 40 + 42: 35(ivec2) ConvertFToS 41 + Store 37(iv2) 42 + 46: 11 Load 13(m) + 47: 6(float) CompositeExtract 46 0 0 + 48: 6(float) CompositeExtract 46 0 1 + 49: 6(float) CompositeExtract 46 0 2 + 50: 10(fvec3) CompositeConstruct 47 48 49 + 51: 43(ivec3) ConvertFToS 50 + Store 45(iv3) 51 + 55: 11 Load 13(m) + 56: 6(float) CompositeExtract 55 0 0 + 57: 6(float) CompositeExtract 55 0 1 + 58: 6(float) CompositeExtract 55 0 2 + 59: 6(float) CompositeExtract 55 1 0 + 60: 25(fvec4) CompositeConstruct 56 57 58 59 + 61: 52(ivec4) ConvertFToS 60 + Store 54(iv4) 61 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.viewportArray2.tesc.out b/deps/glslang/Test/baseResults/spv.viewportArray2.tesc.out new file mode 100644 index 00000000..b14179ec --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.viewportArray2.tesc.out @@ -0,0 +1,62 @@ +spv.viewportArray2.tesc +error: SPIRV-Tools Validation Errors +error: Vulkan spec allows BuiltIn ViewportIndex to be used only with Vertex, TessellationEvaluation, Geometry, or Fragment execution models. ID <0> (OpStore) is referencing ID <22> (OpVariable) which is decorated with BuiltIn ViewportIndex in function <4> called with execution model TessellationControl. + OpStore %gl_ViewportIndex %int_2 + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 25 + + Capability Geometry + Capability Tessellation + Capability MultiViewport + Capability ShaderViewportIndexLayerNV + Capability ShaderViewportMaskNV + Extension "SPV_EXT_shader_viewport_index_layer" + Extension "SPV_NV_viewport_array2" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "main" 14 16 22 24 + ExecutionMode 4 OutputVertices 4 + Source GLSL 450 + SourceExtension "GL_NV_viewport_array2" + Name 4 "main" + Name 10 "gl_PerVertex" + MemberName 10(gl_PerVertex) 0 "gl_ViewportMask" + Name 14 "gl_out" + Name 16 "gl_InvocationID" + Name 22 "gl_ViewportIndex" + Name 24 "gl_Layer" + MemberDecorate 10(gl_PerVertex) 0 BuiltIn ViewportMaskNV + Decorate 10(gl_PerVertex) Block + Decorate 16(gl_InvocationID) BuiltIn InvocationId + Decorate 22(gl_ViewportIndex) BuiltIn ViewportIndex + Decorate 24(gl_Layer) BuiltIn Layer + Decorate 24(gl_Layer) ViewportRelativeNV + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeInt 32 0 + 8: 7(int) Constant 2 + 9: TypeArray 6(int) 8 +10(gl_PerVertex): TypeStruct 9 + 11: 7(int) Constant 4 + 12: TypeArray 10(gl_PerVertex) 11 + 13: TypePointer Output 12 + 14(gl_out): 13(ptr) Variable Output + 15: TypePointer Input 6(int) +16(gl_InvocationID): 15(ptr) Variable Input + 18: 6(int) Constant 0 + 19: 6(int) Constant 1 + 20: TypePointer Output 6(int) +22(gl_ViewportIndex): 20(ptr) Variable Output + 23: 6(int) Constant 2 + 24(gl_Layer): 20(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 17: 6(int) Load 16(gl_InvocationID) + 21: 20(ptr) AccessChain 14(gl_out) 17 18 18 + Store 21 19 + Store 22(gl_ViewportIndex) 23 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.viewportArray2.vert.out b/deps/glslang/Test/baseResults/spv.viewportArray2.vert.out new file mode 100644 index 00000000..df116cfc --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.viewportArray2.vert.out @@ -0,0 +1,47 @@ +spv.viewportArray2.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 19 + + Capability Shader + Capability Geometry + Capability MultiViewport + Capability ShaderViewportIndexLayerNV + Capability ShaderViewportMaskNV + Extension "SPV_EXT_shader_viewport_index_layer" + Extension "SPV_NV_viewport_array2" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 11 16 18 + Source GLSL 450 + SourceExtension "GL_ARB_shader_viewport_layer_array" + SourceExtension "GL_NV_viewport_array2" + Name 4 "main" + Name 11 "gl_ViewportMask" + Name 16 "gl_ViewportIndex" + Name 18 "gl_Layer" + Decorate 11(gl_ViewportMask) BuiltIn ViewportMaskNV + Decorate 16(gl_ViewportIndex) BuiltIn ViewportIndex + Decorate 18(gl_Layer) BuiltIn Layer + Decorate 18(gl_Layer) ViewportRelativeNV + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeInt 32 0 + 8: 7(int) Constant 1 + 9: TypeArray 6(int) 8 + 10: TypePointer Output 9 +11(gl_ViewportMask): 10(ptr) Variable Output + 12: 6(int) Constant 0 + 13: 6(int) Constant 1 + 14: TypePointer Output 6(int) +16(gl_ViewportIndex): 14(ptr) Variable Output + 17: 6(int) Constant 2 + 18(gl_Layer): 14(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 15: 14(ptr) AccessChain 11(gl_ViewportMask) 12 + Store 15 13 + Store 16(gl_ViewportIndex) 17 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.voidFunction.frag.out b/deps/glslang/Test/baseResults/spv.voidFunction.frag.out new file mode 100644 index 00000000..fbaee878 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.voidFunction.frag.out @@ -0,0 +1,72 @@ +spv.voidFunction.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 43 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 24 37 40 42 + ExecutionMode 4 OriginUpperLeft + Source GLSL 400 + Name 4 "main" + Name 6 "foo(" + Name 8 "foo2(" + Name 12 "bar" + Name 22 "outColor" + Name 24 "bigColor" + Name 37 "gl_FragColor" + Name 40 "BaseColor" + Name 42 "d" + Decorate 37(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 10: TypeFloat 32 + 11: TypePointer Private 10(float) + 12(bar): 11(ptr) Variable Private + 13: 10(float) Constant 1073741824 + 15: 10(float) Constant 1065353216 + 20: TypeVector 10(float) 4 + 21: TypePointer Function 20(fvec4) + 23: TypePointer Input 20(fvec4) + 24(bigColor): 23(ptr) Variable Input + 29: TypeInt 32 0 + 30: 29(int) Constant 0 + 31: TypePointer Function 10(float) + 36: TypePointer Output 20(fvec4) +37(gl_FragColor): 36(ptr) Variable Output + 40(BaseColor): 23(ptr) Variable Input + 41: TypePointer Input 10(float) + 42(d): 41(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 22(outColor): 21(ptr) Variable Function + Store 12(bar) 13 + 25: 20(fvec4) Load 24(bigColor) + Store 22(outColor) 25 + 26: 2 FunctionCall 6(foo() + 27: 2 FunctionCall 8(foo2() + 28: 10(float) Load 12(bar) + 32: 31(ptr) AccessChain 22(outColor) 30 + 33: 10(float) Load 32 + 34: 10(float) FAdd 33 28 + 35: 31(ptr) AccessChain 22(outColor) 30 + Store 35 34 + 38: 20(fvec4) Load 22(outColor) + Store 37(gl_FragColor) 38 + Return + FunctionEnd + 6(foo(): 2 Function None 3 + 7: Label + 14: 10(float) Load 12(bar) + 16: 10(float) FAdd 14 15 + Store 12(bar) 16 + Return + FunctionEnd + 8(foo2(): 2 Function None 3 + 9: Label + 18: 10(float) Load 12(bar) + 19: 10(float) FAdd 18 15 + Store 12(bar) 19 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.vulkan100.subgroupArithmetic.comp.out b/deps/glslang/Test/baseResults/spv.vulkan100.subgroupArithmetic.comp.out new file mode 100644 index 00000000..9955053d --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.vulkan100.subgroupArithmetic.comp.out @@ -0,0 +1,305 @@ +spv.vulkan100.subgroupArithmetic.comp +ERROR: 0:19: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:20: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:21: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:22: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:24: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:25: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:26: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:27: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:29: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:30: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:31: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:32: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:34: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:35: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:36: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:37: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:39: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:40: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:41: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:42: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:44: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:45: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:46: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:47: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:49: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:50: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:51: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:52: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:54: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:55: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:56: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:57: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:59: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:60: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:61: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:62: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:64: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:65: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:66: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:67: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:69: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:70: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:71: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:72: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:74: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:75: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:76: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:77: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:79: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:80: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:81: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:82: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:84: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:85: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:86: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:87: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:89: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:90: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:91: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:92: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:94: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:95: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:96: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:97: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:99: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:100: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:101: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:102: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:104: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:105: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:106: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:107: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:109: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:110: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:111: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:112: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:114: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:115: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:116: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:117: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:119: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:120: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:121: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:122: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:124: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:125: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:126: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:127: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:129: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:130: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:131: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:132: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:134: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:135: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:136: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:137: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:139: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:140: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:141: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:142: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:144: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:145: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:146: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:147: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:149: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:150: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:151: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:152: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:154: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:155: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:156: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:157: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:159: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:160: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:161: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:162: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:164: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:165: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:166: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:167: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:169: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:170: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:171: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:172: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:174: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:175: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:176: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:177: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:179: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:180: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:181: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:182: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:184: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:185: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:186: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:187: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:189: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:190: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:191: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:192: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:194: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:195: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:196: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:197: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:199: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:200: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:201: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:202: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:204: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:205: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:206: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:207: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:209: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:210: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:211: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:212: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:214: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:215: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:216: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:217: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:219: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:220: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:221: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:222: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:224: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:225: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:226: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:227: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:229: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:230: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:231: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:232: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:234: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:235: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:236: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:237: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:239: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:240: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:241: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:242: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:244: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:245: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:246: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:247: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:249: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:250: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:251: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:252: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:254: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:255: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:256: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:257: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:259: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:260: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:261: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:262: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:264: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:265: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:266: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:267: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:269: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:270: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:271: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:272: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:274: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:275: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:276: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:277: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:279: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:280: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:281: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:282: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:284: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:285: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:286: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:287: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:289: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:290: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:291: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:292: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:294: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:295: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:296: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:297: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:299: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:300: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:301: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:302: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:304: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:305: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:306: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:307: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:309: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:310: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:311: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:312: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:314: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:315: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:316: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:317: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:319: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:320: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:321: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:322: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:324: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:325: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:326: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:327: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:329: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:330: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:331: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:332: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:334: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:335: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:336: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:337: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:339: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:340: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:341: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:342: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:344: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:345: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:346: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:347: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:349: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:350: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:351: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:352: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:354: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:355: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:356: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:357: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:359: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:360: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:361: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:362: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:364: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:365: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:366: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:367: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:369: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:370: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:371: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:372: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:374: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:375: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:376: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:377: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:379: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:380: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:381: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:382: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:384: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:385: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:386: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:387: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:389: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:390: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:391: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:392: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 300 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.vulkan100.subgroupPartitioned.comp.out b/deps/glslang/Test/baseResults/spv.vulkan100.subgroupPartitioned.comp.out new file mode 100644 index 00000000..3116ac11 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.vulkan100.subgroupPartitioned.comp.out @@ -0,0 +1,326 @@ +spv.vulkan100.subgroupPartitioned.comp +ERROR: 0:19: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:21: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:22: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:23: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:24: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:26: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:27: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:28: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:29: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:31: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:32: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:33: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:34: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:36: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:37: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:38: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:39: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:41: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:42: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:43: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:44: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:46: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:47: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:48: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:49: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:51: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:52: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:53: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:54: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:56: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:57: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:58: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:59: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:61: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:62: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:63: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:64: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:66: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:67: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:68: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:69: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:71: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:72: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:73: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:74: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:76: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:77: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:78: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:79: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:81: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:82: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:83: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:84: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:86: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:87: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:88: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:89: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:91: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:92: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:93: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:94: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:96: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:97: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:98: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:99: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:101: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:102: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:103: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:104: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:106: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:107: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:108: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:109: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:111: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:112: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:113: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:114: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:116: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:117: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:118: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:119: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:121: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:122: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:123: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:124: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:126: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:127: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:128: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:129: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:131: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:132: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:133: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:134: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:136: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:137: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:138: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:139: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:141: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:142: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:143: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:144: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:146: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:147: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:148: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:149: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:151: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:152: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:153: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:154: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:156: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:157: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:158: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:159: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:161: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:162: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:163: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:164: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:166: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:167: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:168: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:169: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:171: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:172: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:173: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:174: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:176: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:177: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:178: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:179: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:181: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:182: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:183: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:184: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:186: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:187: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:188: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:189: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:191: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:192: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:193: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:194: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:196: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:197: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:198: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:199: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:201: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:202: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:203: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:204: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:206: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:207: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:208: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:209: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:211: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:212: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:213: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:214: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:216: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:217: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:218: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:219: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:221: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:222: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:223: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:224: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:226: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:227: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:228: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:229: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:231: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:232: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:233: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:234: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:236: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:237: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:238: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:239: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:241: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:242: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:243: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:244: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:246: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:247: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:248: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:249: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:251: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:252: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:253: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:254: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:256: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:257: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:258: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:259: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:261: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:262: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:263: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:264: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:266: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:267: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:268: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:269: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:271: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:272: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:273: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:274: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:276: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:277: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:278: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:279: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:281: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:282: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:283: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:284: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:286: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:287: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:288: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:289: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:291: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:292: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:293: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:294: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:296: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:297: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:298: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:299: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:301: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:302: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:303: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:304: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:306: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:307: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:308: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:309: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:311: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:312: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:313: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:314: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:316: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:317: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:318: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:319: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:321: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:322: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:323: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:324: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:326: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:327: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:328: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:329: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:331: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:332: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:333: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:334: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:336: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:337: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:338: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:339: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:341: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:342: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:343: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:344: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:346: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:347: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:348: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:349: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:351: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:352: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:353: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:354: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:356: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:357: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:358: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:359: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:361: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:362: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:363: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:364: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:366: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:367: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:368: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:369: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:371: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:372: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:373: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:374: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:376: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:377: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:378: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:379: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:381: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:382: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:383: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:384: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:386: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:387: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:388: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:389: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:391: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:392: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:393: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:394: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:396: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:397: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:398: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:399: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:401: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:402: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:403: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:404: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:406: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:407: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:408: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:409: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:411: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:412: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:413: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:414: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:416: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:417: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:418: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 0:419: 'subgroup op' : requires SPIR-V 1.3 +ERROR: 321 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.vulkan110.int16.frag.out b/deps/glslang/Test/baseResults/spv.vulkan110.int16.frag.out new file mode 100644 index 00000000..9141e4ec --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.vulkan110.int16.frag.out @@ -0,0 +1,745 @@ +spv.vulkan110.int16.frag +error: SPIRV-Tools Validation Errors +error: Capability Float16 is not allowed by Vulkan 1.1 specification (or requires extension) + OpCapability Float16 + +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 523 + + Capability Shader + Capability Float16 + Capability Float64 + Capability Int64 + Capability Int16 + Capability Int8 + Capability StorageUniform16 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_KHX_shader_explicit_arithmetic_types" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int16" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int32" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int8" + Name 4 "main" + Name 6 "literal(" + Name 8 "typeCast16(" + Name 10 "operators(" + Name 12 "builtinFuncs(" + Name 16 "i16" + Name 24 "Uniforms" + MemberName 24(Uniforms) 0 "index" + Name 26 "" + Name 33 "indexable" + Name 38 "u16" + Name 46 "indexable" + Name 51 "i32v" + Name 54 "i16v" + Name 59 "u16v" + Name 67 "u32v" + Name 74 "i64v" + Name 80 "u64v" + Name 94 "f16v" + Name 100 "f32v" + Name 106 "f64v" + Name 154 "i8v" + Name 163 "u8v" + Name 176 "bv" + Name 195 "u16v" + Name 200 "i16" + Name 220 "i" + Name 227 "uv" + Name 243 "i64" + Name 281 "b" + Name 343 "i16v" + Name 346 "i16" + Name 356 "u16v" + Name 358 "u16" + Name 428 "i32" + Name 431 "i64" + Name 434 "i16v4" + Name 437 "u32" + Name 438 "u16v2" + Name 442 "u64" + Name 445 "u16v4" + Name 457 "bv" + Name 518 "Block" + MemberName 518(Block) 0 "i16" + MemberName 518(Block) 1 "i16v2" + MemberName 518(Block) 2 "i16v3" + MemberName 518(Block) 3 "i16v4" + MemberName 518(Block) 4 "u16" + MemberName 518(Block) 5 "u16v2" + MemberName 518(Block) 6 "u16v3" + MemberName 518(Block) 7 "u16v4" + Name 520 "block" + Name 521 "si16" + Name 522 "su16" + MemberDecorate 24(Uniforms) 0 Offset 0 + Decorate 24(Uniforms) Block + Decorate 26 DescriptorSet 0 + Decorate 26 Binding 0 + MemberDecorate 518(Block) 0 Offset 0 + MemberDecorate 518(Block) 1 Offset 4 + MemberDecorate 518(Block) 2 Offset 8 + MemberDecorate 518(Block) 3 Offset 16 + MemberDecorate 518(Block) 4 Offset 24 + MemberDecorate 518(Block) 5 Offset 28 + MemberDecorate 518(Block) 6 Offset 32 + MemberDecorate 518(Block) 7 Offset 40 + Decorate 518(Block) Block + Decorate 520(block) DescriptorSet 0 + Decorate 520(block) Binding 1 + Decorate 521(si16) SpecId 100 + Decorate 522(su16) SpecId 101 + 2: TypeVoid + 3: TypeFunction 2 + 14: TypeInt 16 1 + 15: TypePointer Function 14(int16_t) + 17: TypeInt 32 0 + 18: 17(int) Constant 3 + 19: TypeArray 14(int16_t) 18 + 20: 14(int16_t) Constant 4294962927 + 21: 14(int16_t) Constant 4294967295 + 22: 14(int16_t) Constant 16384 + 23: 19 ConstantComposite 20 21 22 + 24(Uniforms): TypeStruct 17(int) + 25: TypePointer Uniform 24(Uniforms) + 26: 25(ptr) Variable Uniform + 27: TypeInt 32 1 + 28: 27(int) Constant 0 + 29: TypePointer Uniform 17(int) + 32: TypePointer Function 19 + 36: TypeInt 16 0 + 37: TypePointer Function 36(int16_t) + 39: TypeArray 36(int16_t) 18 + 40: 36(int16_t) Constant 65535 + 41: 36(int16_t) Constant 32767 + 42: 39 ConstantComposite 40 40 41 + 45: TypePointer Function 39 + 49: TypeVector 27(int) 2 + 50: TypePointer Function 49(ivec2) + 52: TypeVector 14(int16_t) 2 + 53: TypePointer Function 52(i16vec2) + 57: TypeVector 36(int16_t) 2 + 58: TypePointer Function 57(i16vec2) + 61: TypeVector 17(int) 2 + 66: TypePointer Function 61(ivec2) + 71: TypeInt 64 1 + 72: TypeVector 71(int64_t) 2 + 73: TypePointer Function 72(i64vec2) + 77: TypeInt 64 0 + 78: TypeVector 77(int64_t) 2 + 79: TypePointer Function 78(i64vec2) + 91: TypeFloat 16 + 92: TypeVector 91(float16_t) 2 + 93: TypePointer Function 92(f16vec2) + 97: TypeFloat 32 + 98: TypeVector 97(float) 2 + 99: TypePointer Function 98(fvec2) + 103: TypeFloat 64 + 104: TypeVector 103(float64_t) 2 + 105: TypePointer Function 104(f64vec2) + 151: TypeInt 8 1 + 152: TypeVector 151(int8_t) 2 + 153: TypePointer Function 152(i8vec2) + 158: TypeInt 8 0 + 159: TypeVector 158(int8_t) 2 + 162: TypePointer Function 159(i8vec2) + 173: TypeBool + 174: TypeVector 173(bool) 2 + 175: TypePointer Function 174(bvec2) + 178: 14(int16_t) Constant 0 + 179: 14(int16_t) Constant 1 + 180: 52(i16vec2) ConstantComposite 178 178 + 181: 52(i16vec2) ConstantComposite 179 179 + 184: 36(int16_t) Constant 0 + 185: 36(int16_t) Constant 1 + 186: 57(i16vec2) ConstantComposite 184 184 + 187: 57(i16vec2) ConstantComposite 185 185 + 193: TypeVector 36(int16_t) 3 + 194: TypePointer Function 193(i16vec3) + 197: TypeVector 14(int16_t) 3 + 219: TypePointer Function 27(int) + 225: TypeVector 17(int) 3 + 226: TypePointer Function 225(ivec3) + 242: TypePointer Function 71(int64_t) + 264: 17(int) Constant 1 + 270: 17(int) Constant 2 + 276: TypeVector 27(int) 3 + 280: TypePointer Function 173(bool) + 282: 17(int) Constant 0 + 296: TypePointer Function 17(int) + 354: 52(i16vec2) ConstantComposite 21 21 + 363:193(i16vec3) ConstantComposite 184 184 184 + 405: 173(bool) ConstantTrue + 412: 173(bool) ConstantFalse + 413: 174(bvec2) ConstantComposite 412 412 + 425: TypeVector 173(bool) 3 + 426: 425(bvec3) ConstantComposite 412 412 412 + 432: TypeVector 14(int16_t) 4 + 433: TypePointer Function 432(i16vec4) + 441: TypePointer Function 77(int64_t) + 443: TypeVector 36(int16_t) 4 + 444: TypePointer Function 443(i16vec4) + 456: TypePointer Function 425(bvec3) + 518(Block): TypeStruct 14(int16_t) 52(i16vec2) 197(i16vec3) 432(i16vec4) 36(int16_t) 57(i16vec2) 193(i16vec3) 443(i16vec4) + 519: TypePointer Uniform 518(Block) + 520(block): 519(ptr) Variable Uniform + 521(si16): 14(int16_t) SpecConstant 4294967286 + 522(su16): 36(int16_t) SpecConstant 20 + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd + 6(literal(): 2 Function None 3 + 7: Label + 16(i16): 15(ptr) Variable Function + 33(indexable): 32(ptr) Variable Function + 38(u16): 37(ptr) Variable Function + 46(indexable): 45(ptr) Variable Function + 30: 29(ptr) AccessChain 26 28 + 31: 17(int) Load 30 + Store 33(indexable) 23 + 34: 15(ptr) AccessChain 33(indexable) 31 + 35: 14(int16_t) Load 34 + Store 16(i16) 35 + 43: 29(ptr) AccessChain 26 28 + 44: 17(int) Load 43 + Store 46(indexable) 42 + 47: 37(ptr) AccessChain 46(indexable) 44 + 48: 36(int16_t) Load 47 + Store 38(u16) 48 + Return + FunctionEnd + 8(typeCast16(): 2 Function None 3 + 9: Label + 51(i32v): 50(ptr) Variable Function + 54(i16v): 53(ptr) Variable Function + 59(u16v): 58(ptr) Variable Function + 67(u32v): 66(ptr) Variable Function + 74(i64v): 73(ptr) Variable Function + 80(u64v): 79(ptr) Variable Function + 94(f16v): 93(ptr) Variable Function + 100(f32v): 99(ptr) Variable Function + 106(f64v): 105(ptr) Variable Function + 154(i8v): 153(ptr) Variable Function + 163(u8v): 162(ptr) Variable Function + 176(bv): 175(ptr) Variable Function + 55: 52(i16vec2) Load 54(i16v) + 56: 49(ivec2) SConvert 55 + Store 51(i32v) 56 + 60: 57(i16vec2) Load 59(u16v) + 62: 61(ivec2) UConvert 60 + 63: 49(ivec2) Bitcast 62 + Store 51(i32v) 63 + 64: 52(i16vec2) Load 54(i16v) + 65: 57(i16vec2) Bitcast 64 + Store 59(u16v) 65 + 68: 52(i16vec2) Load 54(i16v) + 69: 49(ivec2) SConvert 68 + 70: 61(ivec2) Bitcast 69 + Store 67(u32v) 70 + 75: 52(i16vec2) Load 54(i16v) + 76: 72(i64vec2) SConvert 75 + Store 74(i64v) 76 + 81: 52(i16vec2) Load 54(i16v) + 82: 72(i64vec2) SConvert 81 + 83: 78(i64vec2) Bitcast 82 + Store 80(u64v) 83 + 84: 57(i16vec2) Load 59(u16v) + 85: 61(ivec2) UConvert 84 + Store 67(u32v) 85 + 86: 57(i16vec2) Load 59(u16v) + 87: 78(i64vec2) UConvert 86 + 88: 72(i64vec2) Bitcast 87 + Store 74(i64v) 88 + 89: 57(i16vec2) Load 59(u16v) + 90: 78(i64vec2) UConvert 89 + Store 80(u64v) 90 + 95: 52(i16vec2) Load 54(i16v) + 96: 92(f16vec2) ConvertSToF 95 + Store 94(f16v) 96 + 101: 52(i16vec2) Load 54(i16v) + 102: 98(fvec2) ConvertSToF 101 + Store 100(f32v) 102 + 107: 52(i16vec2) Load 54(i16v) + 108:104(f64vec2) ConvertSToF 107 + Store 106(f64v) 108 + 109: 57(i16vec2) Load 59(u16v) + 110: 92(f16vec2) ConvertUToF 109 + Store 94(f16v) 110 + 111: 57(i16vec2) Load 59(u16v) + 112: 98(fvec2) ConvertUToF 111 + Store 100(f32v) 112 + 113: 57(i16vec2) Load 59(u16v) + 114:104(f64vec2) ConvertUToF 113 + Store 106(f64v) 114 + 115: 52(i16vec2) Load 54(i16v) + 116: 49(ivec2) SConvert 115 + Store 51(i32v) 116 + 117: 57(i16vec2) Load 59(u16v) + 118: 61(ivec2) UConvert 117 + 119: 49(ivec2) Bitcast 118 + Store 51(i32v) 119 + 120: 52(i16vec2) Load 54(i16v) + 121: 57(i16vec2) Bitcast 120 + Store 59(u16v) 121 + 122: 52(i16vec2) Load 54(i16v) + 123: 49(ivec2) SConvert 122 + 124: 61(ivec2) Bitcast 123 + Store 67(u32v) 124 + 125: 52(i16vec2) Load 54(i16v) + 126: 72(i64vec2) SConvert 125 + Store 74(i64v) 126 + 127: 52(i16vec2) Load 54(i16v) + 128: 72(i64vec2) SConvert 127 + 129: 78(i64vec2) Bitcast 128 + Store 80(u64v) 129 + 130: 57(i16vec2) Load 59(u16v) + 131: 61(ivec2) UConvert 130 + Store 67(u32v) 131 + 132: 57(i16vec2) Load 59(u16v) + 133: 78(i64vec2) UConvert 132 + 134: 72(i64vec2) Bitcast 133 + Store 74(i64v) 134 + 135: 57(i16vec2) Load 59(u16v) + 136: 78(i64vec2) UConvert 135 + 137: 72(i64vec2) Bitcast 136 + 138: 78(i64vec2) Bitcast 137 + Store 80(u64v) 138 + 139: 52(i16vec2) Load 54(i16v) + 140: 92(f16vec2) ConvertSToF 139 + Store 94(f16v) 140 + 141: 52(i16vec2) Load 54(i16v) + 142: 98(fvec2) ConvertSToF 141 + Store 100(f32v) 142 + 143: 52(i16vec2) Load 54(i16v) + 144:104(f64vec2) ConvertSToF 143 + Store 106(f64v) 144 + 145: 57(i16vec2) Load 59(u16v) + 146: 92(f16vec2) ConvertUToF 145 + Store 94(f16v) 146 + 147: 57(i16vec2) Load 59(u16v) + 148: 98(fvec2) ConvertUToF 147 + Store 100(f32v) 148 + 149: 57(i16vec2) Load 59(u16v) + 150:104(f64vec2) ConvertUToF 149 + Store 106(f64v) 150 + 155: 52(i16vec2) Load 54(i16v) + 156: 152(i8vec2) SConvert 155 + Store 154(i8v) 156 + 157: 57(i16vec2) Load 59(u16v) + 160: 159(i8vec2) UConvert 157 + 161: 152(i8vec2) Bitcast 160 + Store 154(i8v) 161 + 164: 52(i16vec2) Load 54(i16v) + 165: 152(i8vec2) SConvert 164 + 166: 159(i8vec2) Bitcast 165 + Store 163(u8v) 166 + 167: 57(i16vec2) Load 59(u16v) + 168: 159(i8vec2) UConvert 167 + Store 163(u8v) 168 + 169: 57(i16vec2) Load 59(u16v) + 170: 159(i8vec2) UConvert 169 + 171: 57(i16vec2) UConvert 170 + 172: 52(i16vec2) Bitcast 171 + Store 54(i16v) 172 + 177: 174(bvec2) Load 176(bv) + 182: 52(i16vec2) Select 177 181 180 + Store 54(i16v) 182 + 183: 174(bvec2) Load 176(bv) + 188: 57(i16vec2) Select 183 187 186 + Store 59(u16v) 188 + 189: 52(i16vec2) Load 54(i16v) + 190: 174(bvec2) INotEqual 189 186 + Store 176(bv) 190 + 191: 57(i16vec2) Load 59(u16v) + 192: 174(bvec2) INotEqual 191 186 + Store 176(bv) 192 + Return + FunctionEnd + 10(operators(): 2 Function None 3 + 11: Label + 195(u16v): 194(ptr) Variable Function + 200(i16): 15(ptr) Variable Function + 220(i): 219(ptr) Variable Function + 227(uv): 226(ptr) Variable Function + 243(i64): 242(ptr) Variable Function + 281(b): 280(ptr) Variable Function + 196:193(i16vec3) Load 195(u16v) + 198:197(i16vec3) CompositeConstruct 179 179 179 + 199:193(i16vec3) IAdd 196 198 + Store 195(u16v) 199 + 201: 14(int16_t) Load 200(i16) + 202: 14(int16_t) ISub 201 179 + Store 200(i16) 202 + 203: 14(int16_t) Load 200(i16) + 204: 14(int16_t) IAdd 203 179 + Store 200(i16) 204 + 205:193(i16vec3) Load 195(u16v) + 206:197(i16vec3) CompositeConstruct 179 179 179 + 207:193(i16vec3) ISub 205 206 + Store 195(u16v) 207 + 208:193(i16vec3) Load 195(u16v) + 209:193(i16vec3) Not 208 + Store 195(u16v) 209 + 210: 14(int16_t) Load 200(i16) + Store 200(i16) 210 + 211:193(i16vec3) Load 195(u16v) + 212:193(i16vec3) SNegate 211 + Store 195(u16v) 212 + 213: 14(int16_t) Load 200(i16) + 214: 14(int16_t) Load 200(i16) + 215: 14(int16_t) IAdd 214 213 + Store 200(i16) 215 + 216:193(i16vec3) Load 195(u16v) + 217:193(i16vec3) Load 195(u16v) + 218:193(i16vec3) ISub 217 216 + Store 195(u16v) 218 + 221: 14(int16_t) Load 200(i16) + 222: 27(int) SConvert 221 + 223: 27(int) Load 220(i) + 224: 27(int) IMul 223 222 + Store 220(i) 224 + 228:193(i16vec3) Load 195(u16v) + 229: 225(ivec3) UConvert 228 + 230: 225(ivec3) Load 227(uv) + 231: 225(ivec3) UDiv 230 229 + Store 227(uv) 231 + 232: 14(int16_t) Load 200(i16) + 233: 27(int) SConvert 232 + 234: 17(int) Bitcast 233 + 235: 225(ivec3) Load 227(uv) + 236: 225(ivec3) CompositeConstruct 234 234 234 + 237: 225(ivec3) UMod 235 236 + Store 227(uv) 237 + 238:193(i16vec3) Load 195(u16v) + 239: 225(ivec3) UConvert 238 + 240: 225(ivec3) Load 227(uv) + 241: 225(ivec3) IAdd 239 240 + Store 227(uv) 241 + 244: 14(int16_t) Load 200(i16) + 245: 71(int64_t) SConvert 244 + 246: 71(int64_t) Load 243(i64) + 247: 71(int64_t) ISub 245 246 + Store 243(i64) 247 + 248:193(i16vec3) Load 195(u16v) + 249: 225(ivec3) UConvert 248 + 250: 225(ivec3) Load 227(uv) + 251: 225(ivec3) IMul 249 250 + Store 227(uv) 251 + 252: 14(int16_t) Load 200(i16) + 253: 71(int64_t) SConvert 252 + 254: 71(int64_t) Load 243(i64) + 255: 71(int64_t) IMul 253 254 + Store 243(i64) 255 + 256: 14(int16_t) Load 200(i16) + 257: 27(int) SConvert 256 + 258: 27(int) Load 220(i) + 259: 27(int) SMod 257 258 + Store 220(i) 259 + 260: 14(int16_t) Load 200(i16) + 261:193(i16vec3) Load 195(u16v) + 262:197(i16vec3) CompositeConstruct 260 260 260 + 263:193(i16vec3) ShiftLeftLogical 261 262 + Store 195(u16v) 263 + 265: 37(ptr) AccessChain 195(u16v) 264 + 266: 36(int16_t) Load 265 + 267: 14(int16_t) Load 200(i16) + 268: 14(int16_t) ShiftRightArithmetic 267 266 + Store 200(i16) 268 + 269: 14(int16_t) Load 200(i16) + 271: 37(ptr) AccessChain 195(u16v) 270 + 272: 36(int16_t) Load 271 + 273: 14(int16_t) ShiftLeftLogical 269 272 + Store 200(i16) 273 + 274:193(i16vec3) Load 195(u16v) + 275: 27(int) Load 220(i) + 277: 276(ivec3) CompositeConstruct 275 275 275 + 278:193(i16vec3) ShiftLeftLogical 274 277 + 279: 225(ivec3) UConvert 278 + Store 227(uv) 279 + 283: 37(ptr) AccessChain 195(u16v) 282 + 284: 36(int16_t) Load 283 + 285: 14(int16_t) Load 200(i16) + 286: 36(int16_t) Bitcast 285 + 287: 173(bool) INotEqual 284 286 + Store 281(b) 287 + 288: 14(int16_t) Load 200(i16) + 289: 36(int16_t) Bitcast 288 + 290: 37(ptr) AccessChain 195(u16v) 282 + 291: 36(int16_t) Load 290 + 292: 173(bool) IEqual 289 291 + Store 281(b) 292 + 293: 37(ptr) AccessChain 195(u16v) 282 + 294: 36(int16_t) Load 293 + 295: 17(int) UConvert 294 + 297: 296(ptr) AccessChain 227(uv) 264 + 298: 17(int) Load 297 + 299: 173(bool) UGreaterThan 295 298 + Store 281(b) 299 + 300: 14(int16_t) Load 200(i16) + 301: 27(int) SConvert 300 + 302: 27(int) Load 220(i) + 303: 173(bool) SLessThan 301 302 + Store 281(b) 303 + 304: 37(ptr) AccessChain 195(u16v) 264 + 305: 36(int16_t) Load 304 + 306: 17(int) UConvert 305 + 307: 296(ptr) AccessChain 227(uv) 282 + 308: 17(int) Load 307 + 309: 173(bool) UGreaterThanEqual 306 308 + Store 281(b) 309 + 310: 14(int16_t) Load 200(i16) + 311: 27(int) SConvert 310 + 312: 27(int) Load 220(i) + 313: 173(bool) SLessThanEqual 311 312 + Store 281(b) 313 + 314: 14(int16_t) Load 200(i16) + 315: 27(int) SConvert 314 + 316: 17(int) Bitcast 315 + 317: 225(ivec3) Load 227(uv) + 318: 225(ivec3) CompositeConstruct 316 316 316 + 319: 225(ivec3) BitwiseOr 317 318 + Store 227(uv) 319 + 320: 14(int16_t) Load 200(i16) + 321: 27(int) SConvert 320 + 322: 27(int) Load 220(i) + 323: 27(int) BitwiseOr 321 322 + Store 220(i) 323 + 324: 14(int16_t) Load 200(i16) + 325: 71(int64_t) SConvert 324 + 326: 71(int64_t) Load 243(i64) + 327: 71(int64_t) BitwiseAnd 326 325 + Store 243(i64) 327 + 328:193(i16vec3) Load 195(u16v) + 329: 225(ivec3) UConvert 328 + 330: 225(ivec3) Load 227(uv) + 331: 225(ivec3) BitwiseAnd 329 330 + Store 227(uv) 331 + 332: 14(int16_t) Load 200(i16) + 333: 27(int) SConvert 332 + 334: 17(int) Bitcast 333 + 335: 225(ivec3) Load 227(uv) + 336: 225(ivec3) CompositeConstruct 334 334 334 + 337: 225(ivec3) BitwiseXor 335 336 + Store 227(uv) 337 + 338:193(i16vec3) Load 195(u16v) + 339: 14(int16_t) Load 200(i16) + 340: 36(int16_t) Bitcast 339 + 341:193(i16vec3) CompositeConstruct 340 340 340 + 342:193(i16vec3) BitwiseXor 338 341 + Store 195(u16v) 342 + Return + FunctionEnd +12(builtinFuncs(): 2 Function None 3 + 13: Label + 343(i16v): 53(ptr) Variable Function + 346(i16): 15(ptr) Variable Function + 356(u16v): 194(ptr) Variable Function + 358(u16): 37(ptr) Variable Function + 428(i32): 219(ptr) Variable Function + 431(i64): 242(ptr) Variable Function + 434(i16v4): 433(ptr) Variable Function + 437(u32): 296(ptr) Variable Function + 438(u16v2): 58(ptr) Variable Function + 442(u64): 441(ptr) Variable Function + 445(u16v4): 444(ptr) Variable Function + 457(bv): 456(ptr) Variable Function + 344: 52(i16vec2) Load 343(i16v) + 345: 52(i16vec2) ExtInst 1(GLSL.std.450) 5(SAbs) 344 + Store 343(i16v) 345 + 347: 14(int16_t) Load 346(i16) + 348: 14(int16_t) ExtInst 1(GLSL.std.450) 7(SSign) 347 + Store 346(i16) 348 + 349: 52(i16vec2) Load 343(i16v) + 350: 14(int16_t) Load 346(i16) + 351: 52(i16vec2) CompositeConstruct 350 350 + 352: 52(i16vec2) ExtInst 1(GLSL.std.450) 39(SMin) 349 351 + Store 343(i16v) 352 + 353: 52(i16vec2) Load 343(i16v) + 355: 52(i16vec2) ExtInst 1(GLSL.std.450) 39(SMin) 353 354 + Store 343(i16v) 355 + 357:193(i16vec3) Load 356(u16v) + 359: 36(int16_t) Load 358(u16) + 360:193(i16vec3) CompositeConstruct 359 359 359 + 361:193(i16vec3) ExtInst 1(GLSL.std.450) 38(UMin) 357 360 + Store 356(u16v) 361 + 362:193(i16vec3) Load 356(u16v) + 364:193(i16vec3) ExtInst 1(GLSL.std.450) 38(UMin) 362 363 + Store 356(u16v) 364 + 365: 52(i16vec2) Load 343(i16v) + 366: 14(int16_t) Load 346(i16) + 367: 52(i16vec2) CompositeConstruct 366 366 + 368: 52(i16vec2) ExtInst 1(GLSL.std.450) 42(SMax) 365 367 + Store 343(i16v) 368 + 369: 52(i16vec2) Load 343(i16v) + 370: 52(i16vec2) ExtInst 1(GLSL.std.450) 42(SMax) 369 354 + Store 343(i16v) 370 + 371:193(i16vec3) Load 356(u16v) + 372: 36(int16_t) Load 358(u16) + 373:193(i16vec3) CompositeConstruct 372 372 372 + 374:193(i16vec3) ExtInst 1(GLSL.std.450) 41(UMax) 371 373 + Store 356(u16v) 374 + 375:193(i16vec3) Load 356(u16v) + 376:193(i16vec3) ExtInst 1(GLSL.std.450) 41(UMax) 375 363 + Store 356(u16v) 376 + 377: 52(i16vec2) Load 343(i16v) + 378: 14(int16_t) Load 346(i16) + 379: 14(int16_t) SNegate 378 + 380: 14(int16_t) Load 346(i16) + 381: 52(i16vec2) CompositeConstruct 379 379 + 382: 52(i16vec2) CompositeConstruct 380 380 + 383: 52(i16vec2) ExtInst 1(GLSL.std.450) 45(SClamp) 377 381 382 + Store 343(i16v) 383 + 384: 52(i16vec2) Load 343(i16v) + 385: 52(i16vec2) Load 343(i16v) + 386: 52(i16vec2) SNegate 385 + 387: 52(i16vec2) Load 343(i16v) + 388: 52(i16vec2) ExtInst 1(GLSL.std.450) 45(SClamp) 384 386 387 + Store 343(i16v) 388 + 389:193(i16vec3) Load 356(u16v) + 390: 36(int16_t) Load 358(u16) + 391: 36(int16_t) SNegate 390 + 392: 36(int16_t) Load 358(u16) + 393:193(i16vec3) CompositeConstruct 391 391 391 + 394:193(i16vec3) CompositeConstruct 392 392 392 + 395:193(i16vec3) ExtInst 1(GLSL.std.450) 44(UClamp) 389 393 394 + Store 356(u16v) 395 + 396:193(i16vec3) Load 356(u16v) + 397:193(i16vec3) Load 356(u16v) + 398:193(i16vec3) SNegate 397 + 399:193(i16vec3) Load 356(u16v) + 400:193(i16vec3) ExtInst 1(GLSL.std.450) 44(UClamp) 396 398 399 + Store 356(u16v) 400 + 401: 15(ptr) AccessChain 343(i16v) 282 + 402: 14(int16_t) Load 401 + 403: 15(ptr) AccessChain 343(i16v) 264 + 404: 14(int16_t) Load 403 + 406: 14(int16_t) Select 405 404 402 + Store 346(i16) 406 + 407: 14(int16_t) Load 346(i16) + 408: 52(i16vec2) CompositeConstruct 407 407 + 409: 14(int16_t) Load 346(i16) + 410: 14(int16_t) SNegate 409 + 411: 52(i16vec2) CompositeConstruct 410 410 + 414: 52(i16vec2) Select 413 411 408 + Store 343(i16v) 414 + 415: 37(ptr) AccessChain 356(u16v) 282 + 416: 36(int16_t) Load 415 + 417: 37(ptr) AccessChain 356(u16v) 264 + 418: 36(int16_t) Load 417 + 419: 36(int16_t) Select 405 418 416 + Store 358(u16) 419 + 420: 36(int16_t) Load 358(u16) + 421:193(i16vec3) CompositeConstruct 420 420 420 + 422: 36(int16_t) Load 358(u16) + 423: 36(int16_t) SNegate 422 + 424:193(i16vec3) CompositeConstruct 423 423 423 + 427:193(i16vec3) Select 426 424 421 + Store 356(u16v) 427 + 429: 52(i16vec2) Load 343(i16v) + 430: 27(int) Bitcast 429 + Store 428(i32) 430 + 435:432(i16vec4) Load 434(i16v4) + 436: 71(int64_t) Bitcast 435 + Store 431(i64) 436 + 439: 57(i16vec2) Load 438(u16v2) + 440: 17(int) Bitcast 439 + Store 437(u32) 440 + 446:443(i16vec4) Load 445(u16v4) + 447: 77(int64_t) Bitcast 446 + Store 442(u64) 447 + 448: 27(int) Load 428(i32) + 449: 52(i16vec2) Bitcast 448 + Store 343(i16v) 449 + 450: 71(int64_t) Load 431(i64) + 451:432(i16vec4) Bitcast 450 + Store 434(i16v4) 451 + 452: 17(int) Load 437(u32) + 453: 57(i16vec2) Bitcast 452 + Store 438(u16v2) 453 + 454: 77(int64_t) Load 442(u64) + 455:443(i16vec4) Bitcast 454 + Store 445(u16v4) 455 + 458:193(i16vec3) Load 356(u16v) + 459: 36(int16_t) Load 358(u16) + 460:193(i16vec3) CompositeConstruct 459 459 459 + 461: 425(bvec3) ULessThan 458 460 + Store 457(bv) 461 + 462: 52(i16vec2) Load 343(i16v) + 463: 14(int16_t) Load 346(i16) + 464: 52(i16vec2) CompositeConstruct 463 463 + 465: 174(bvec2) SLessThan 462 464 + 466: 425(bvec3) Load 457(bv) + 467: 425(bvec3) VectorShuffle 466 465 3 4 2 + Store 457(bv) 467 + 468:193(i16vec3) Load 356(u16v) + 469: 36(int16_t) Load 358(u16) + 470:193(i16vec3) CompositeConstruct 469 469 469 + 471: 425(bvec3) ULessThanEqual 468 470 + Store 457(bv) 471 + 472: 52(i16vec2) Load 343(i16v) + 473: 14(int16_t) Load 346(i16) + 474: 52(i16vec2) CompositeConstruct 473 473 + 475: 174(bvec2) SLessThanEqual 472 474 + 476: 425(bvec3) Load 457(bv) + 477: 425(bvec3) VectorShuffle 476 475 3 4 2 + Store 457(bv) 477 + 478:193(i16vec3) Load 356(u16v) + 479: 36(int16_t) Load 358(u16) + 480:193(i16vec3) CompositeConstruct 479 479 479 + 481: 425(bvec3) UGreaterThan 478 480 + Store 457(bv) 481 + 482: 52(i16vec2) Load 343(i16v) + 483: 14(int16_t) Load 346(i16) + 484: 52(i16vec2) CompositeConstruct 483 483 + 485: 174(bvec2) SGreaterThan 482 484 + 486: 425(bvec3) Load 457(bv) + 487: 425(bvec3) VectorShuffle 486 485 3 4 2 + Store 457(bv) 487 + 488:193(i16vec3) Load 356(u16v) + 489: 36(int16_t) Load 358(u16) + 490:193(i16vec3) CompositeConstruct 489 489 489 + 491: 425(bvec3) UGreaterThanEqual 488 490 + Store 457(bv) 491 + 492: 52(i16vec2) Load 343(i16v) + 493: 14(int16_t) Load 346(i16) + 494: 52(i16vec2) CompositeConstruct 493 493 + 495: 174(bvec2) SGreaterThanEqual 492 494 + 496: 425(bvec3) Load 457(bv) + 497: 425(bvec3) VectorShuffle 496 495 3 4 2 + Store 457(bv) 497 + 498:193(i16vec3) Load 356(u16v) + 499: 36(int16_t) Load 358(u16) + 500:193(i16vec3) CompositeConstruct 499 499 499 + 501: 425(bvec3) IEqual 498 500 + Store 457(bv) 501 + 502: 52(i16vec2) Load 343(i16v) + 503: 14(int16_t) Load 346(i16) + 504: 52(i16vec2) CompositeConstruct 503 503 + 505: 174(bvec2) IEqual 502 504 + 506: 425(bvec3) Load 457(bv) + 507: 425(bvec3) VectorShuffle 506 505 3 4 2 + Store 457(bv) 507 + 508:193(i16vec3) Load 356(u16v) + 509: 36(int16_t) Load 358(u16) + 510:193(i16vec3) CompositeConstruct 509 509 509 + 511: 425(bvec3) INotEqual 508 510 + Store 457(bv) 511 + 512: 52(i16vec2) Load 343(i16v) + 513: 14(int16_t) Load 346(i16) + 514: 52(i16vec2) CompositeConstruct 513 513 + 515: 174(bvec2) INotEqual 512 514 + 516: 425(bvec3) Load 457(bv) + 517: 425(bvec3) VectorShuffle 516 515 3 4 2 + Store 457(bv) 517 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.vulkan110.storageBuffer.vert.out b/deps/glslang/Test/baseResults/spv.vulkan110.storageBuffer.vert.out new file mode 100644 index 00000000..77eafc24 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.vulkan110.storageBuffer.vert.out @@ -0,0 +1,66 @@ +spv.vulkan110.storageBuffer.vert +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 31 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 13 + Source GLSL 450 + Name 4 "main" + Name 11 "gl_PerVertex" + MemberName 11(gl_PerVertex) 0 "gl_Position" + MemberName 11(gl_PerVertex) 1 "gl_PointSize" + MemberName 11(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 11(gl_PerVertex) 3 "gl_CullDistance" + Name 13 "" + Name 16 "ub" + MemberName 16(ub) 0 "a" + Name 18 "ubi" + Name 22 "bb" + MemberName 22(bb) 0 "b" + Name 24 "bbi" + MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 11(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 11(gl_PerVertex) Block + MemberDecorate 16(ub) 0 Offset 0 + Decorate 16(ub) Block + Decorate 18(ubi) DescriptorSet 0 + MemberDecorate 22(bb) 0 Offset 0 + Decorate 22(bb) Block + Decorate 24(bbi) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 0 + 9: 8(int) Constant 1 + 10: TypeArray 6(float) 9 +11(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 10 10 + 12: TypePointer Output 11(gl_PerVertex) + 13: 12(ptr) Variable Output + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16(ub): TypeStruct 7(fvec4) + 17: TypePointer Uniform 16(ub) + 18(ubi): 17(ptr) Variable Uniform + 19: TypePointer Uniform 7(fvec4) + 22(bb): TypeStruct 7(fvec4) + 23: TypePointer StorageBuffer 22(bb) + 24(bbi): 23(ptr) Variable StorageBuffer + 25: TypePointer StorageBuffer 7(fvec4) + 29: TypePointer Output 7(fvec4) + 4(main): 2 Function None 3 + 5: Label + 20: 19(ptr) AccessChain 18(ubi) 15 + 21: 7(fvec4) Load 20 + 26: 25(ptr) AccessChain 24(bbi) 15 + 27: 7(fvec4) Load 26 + 28: 7(fvec4) FAdd 21 27 + 30: 29(ptr) AccessChain 13 15 + Store 30 28 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.while-continue-break.vert.out b/deps/glslang/Test/baseResults/spv.while-continue-break.vert.out new file mode 100644 index 00000000..d49bca09 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.while-continue-break.vert.out @@ -0,0 +1,73 @@ +spv.while-continue-break.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 41 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" + Source ESSL 310 + Name 4 "main" + Name 8 "i" + Name 19 "A" + Name 27 "B" + Name 29 "C" + Name 39 "D" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 16: 6(int) Constant 10 + 17: TypeBool + 20: 6(int) Constant 1 + 22: 6(int) Constant 2 + 31: 6(int) Constant 5 + 40: 6(int) Constant 3 + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + 19(A): 7(ptr) Variable Function + 27(B): 7(ptr) Variable Function + 29(C): 7(ptr) Variable Function + 39(D): 7(ptr) Variable Function + Store 8(i) 9 + Branch 10 + 10: Label + LoopMerge 12 13 None + Branch 14 + 14: Label + 15: 6(int) Load 8(i) + 18: 17(bool) SLessThan 15 16 + BranchConditional 18 11 12 + 11: Label + Store 19(A) 20 + 21: 6(int) Load 8(i) + 23: 6(int) SMod 21 22 + 24: 17(bool) IEqual 23 9 + SelectionMerge 26 None + BranchConditional 24 25 26 + 25: Label + Store 27(B) 22 + Branch 13 + 26: Label + 30: 6(int) Load 8(i) + 32: 6(int) SMod 30 31 + 33: 17(bool) IEqual 32 9 + SelectionMerge 35 None + BranchConditional 33 34 35 + 34: Label + Store 27(B) 22 + Branch 12 + 35: Label + 37: 6(int) Load 8(i) + 38: 6(int) IAdd 37 20 + Store 8(i) 38 + Branch 13 + 13: Label + Branch 10 + 12: Label + Store 39(D) 40 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.while-simple.vert.out b/deps/glslang/Test/baseResults/spv.while-simple.vert.out new file mode 100644 index 00000000..b507da3e --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.while-simple.vert.out @@ -0,0 +1,42 @@ +spv.while-simple.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 22 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" + Source ESSL 310 + Name 4 "main" + Name 8 "i" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 16: 6(int) Constant 10 + 17: TypeBool + 20: 6(int) Constant 1 + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + Store 8(i) 9 + Branch 10 + 10: Label + LoopMerge 12 13 None + Branch 14 + 14: Label + 15: 6(int) Load 8(i) + 18: 17(bool) SLessThan 15 16 + BranchConditional 18 11 12 + 11: Label + 19: 6(int) Load 8(i) + 21: 6(int) IAdd 19 20 + Store 8(i) 21 + Branch 13 + 13: Label + Branch 10 + 12: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.whileLoop.frag.out b/deps/glslang/Test/baseResults/spv.whileLoop.frag.out new file mode 100644 index 00000000..e2949723 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.whileLoop.frag.out @@ -0,0 +1,62 @@ +spv.whileLoop.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 35 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 11 24 28 33 + ExecutionMode 4 OriginUpperLeft + Source GLSL 140 + Name 4 "main" + Name 9 "color" + Name 11 "BaseColor" + Name 24 "d" + Name 28 "bigColor" + Name 33 "gl_FragColor" + Decorate 33(gl_FragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypePointer Input 7(fvec4) + 11(BaseColor): 10(ptr) Variable Input + 18: TypeInt 32 0 + 19: 18(int) Constant 0 + 20: TypePointer Function 6(float) + 23: TypePointer Input 6(float) + 24(d): 23(ptr) Variable Input + 26: TypeBool + 28(bigColor): 10(ptr) Variable Input + 32: TypePointer Output 7(fvec4) +33(gl_FragColor): 32(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 9(color): 8(ptr) Variable Function + 12: 7(fvec4) Load 11(BaseColor) + Store 9(color) 12 + Branch 13 + 13: Label + LoopMerge 15 16 None + Branch 17 + 17: Label + 21: 20(ptr) AccessChain 9(color) 19 + 22: 6(float) Load 21 + 25: 6(float) Load 24(d) + 27: 26(bool) FOrdLessThan 22 25 + BranchConditional 27 14 15 + 14: Label + 29: 7(fvec4) Load 28(bigColor) + 30: 7(fvec4) Load 9(color) + 31: 7(fvec4) FAdd 30 29 + Store 9(color) 31 + Branch 16 + 16: Label + Branch 13 + 15: Label + 34: 7(fvec4) Load 9(color) + Store 33(gl_FragColor) 34 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.xfb.vert.out b/deps/glslang/Test/baseResults/spv.xfb.vert.out new file mode 100644 index 00000000..68633e1f --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.xfb.vert.out @@ -0,0 +1,59 @@ +spv.xfb.vert +error: SPIRV-Tools Validation Errors +error: Capability TransformFeedback is not allowed by Vulkan 1.0 specification (or requires extension) + OpCapability TransformFeedback + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 16 + + Capability Shader + Capability TransformFeedback + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 8 11 14 15 + ExecutionMode 4 Xfb + Source GLSL 450 + Name 4 "main" + Name 8 "out1" + Name 9 "outXfb" + MemberName 9(outXfb) 0 "out2" + Name 11 "" + Name 12 "outXfb2" + MemberName 12(outXfb2) 0 "out3" + Name 14 "" + Name 15 "out4" + Decorate 8(out1) Location 0 + Decorate 8(out1) XfbBuffer 3 + Decorate 8(out1) XfbStride 48 + Decorate 8(out1) Offset 12 + MemberDecorate 9(outXfb) 0 Offset 8 + Decorate 9(outXfb) Block + Decorate 11 Location 1 + Decorate 11 XfbBuffer 2 + Decorate 11 XfbStride 32 + MemberDecorate 12(outXfb2) 0 Offset 60 + Decorate 12(outXfb2) Block + Decorate 14 Location 3 + Decorate 14 XfbBuffer 1 + Decorate 14 XfbStride 64 + Decorate 15(out4) Location 4 + Decorate 15(out4) XfbBuffer 0 + Decorate 15(out4) XfbStride 8 + Decorate 15(out4) Offset 4 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Output 6(float) + 8(out1): 7(ptr) Variable Output + 9(outXfb): TypeStruct 6(float) + 10: TypePointer Output 9(outXfb) + 11: 10(ptr) Variable Output + 12(outXfb2): TypeStruct 6(float) + 13: TypePointer Output 12(outXfb2) + 14: 13(ptr) Variable Output + 15(out4): 7(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.xfb2.vert.out b/deps/glslang/Test/baseResults/spv.xfb2.vert.out new file mode 100644 index 00000000..6dc39872 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.xfb2.vert.out @@ -0,0 +1,72 @@ +spv.xfb2.vert +error: SPIRV-Tools Validation Errors +error: Capability TransformFeedback is not allowed by Vulkan 1.0 specification (or requires extension) + OpCapability TransformFeedback + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 35 + + Capability Shader + Capability TransformFeedback + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 10 14 + ExecutionMode 4 Xfb + Source GLSL 450 + Name 4 "main" + Name 8 "gl_PerVertex" + MemberName 8(gl_PerVertex) 0 "gl_Position" + Name 10 "" + Name 14 "position" + Name 17 "ComponentsBlock" + MemberName 17(ComponentsBlock) 0 "c1" + MemberName 17(ComponentsBlock) 1 "c2" + Name 19 "components" + MemberDecorate 8(gl_PerVertex) 0 Offset 16 + MemberDecorate 8(gl_PerVertex) 0 BuiltIn Position + Decorate 8(gl_PerVertex) Block + Decorate 10 XfbBuffer 3 + Decorate 10 XfbStride 32 + Decorate 14(position) Location 0 + MemberDecorate 17(ComponentsBlock) 0 Offset 0 + MemberDecorate 17(ComponentsBlock) 1 Offset 16 + Decorate 17(ComponentsBlock) Block + Decorate 19(components) DescriptorSet 0 + Decorate 19(components) Binding 5 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(gl_PerVertex): TypeStruct 7(fvec4) + 9: TypePointer Output 8(gl_PerVertex) + 10: 9(ptr) Variable Output + 11: TypeInt 32 1 + 12: 11(int) Constant 0 + 13: TypePointer Input 7(fvec4) + 14(position): 13(ptr) Variable Input + 16: TypeVector 6(float) 2 +17(ComponentsBlock): TypeStruct 7(fvec4) 16(fvec2) + 18: TypePointer Uniform 17(ComponentsBlock) + 19(components): 18(ptr) Variable Uniform + 20: TypePointer Uniform 7(fvec4) + 24: 11(int) Constant 1 + 25: TypePointer Uniform 16(fvec2) + 28: 6(float) Constant 0 + 33: TypePointer Output 7(fvec4) + 4(main): 2 Function None 3 + 5: Label + 15: 7(fvec4) Load 14(position) + 21: 20(ptr) AccessChain 19(components) 12 + 22: 7(fvec4) Load 21 + 23: 7(fvec4) FAdd 15 22 + 26: 25(ptr) AccessChain 19(components) 24 + 27: 16(fvec2) Load 26 + 29: 6(float) CompositeExtract 27 0 + 30: 6(float) CompositeExtract 27 1 + 31: 7(fvec4) CompositeConstruct 29 30 28 28 + 32: 7(fvec4) FAdd 23 31 + 34: 33(ptr) AccessChain 10 12 + Store 34 32 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.xfb3.vert.out b/deps/glslang/Test/baseResults/spv.xfb3.vert.out new file mode 100644 index 00000000..1d526aa9 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.xfb3.vert.out @@ -0,0 +1,72 @@ +spv.xfb3.vert +error: SPIRV-Tools Validation Errors +error: Capability TransformFeedback is not allowed by Vulkan 1.0 specification (or requires extension) + OpCapability TransformFeedback + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 35 + + Capability Shader + Capability TransformFeedback + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 10 14 + ExecutionMode 4 Xfb + Source GLSL 450 + Name 4 "main" + Name 8 "gl_PerVertex" + MemberName 8(gl_PerVertex) 0 "gl_Position" + Name 10 "" + Name 14 "position" + Name 17 "ComponentsBlock" + MemberName 17(ComponentsBlock) 0 "c1" + MemberName 17(ComponentsBlock) 1 "c2" + Name 19 "components" + MemberDecorate 8(gl_PerVertex) 0 Offset 16 + MemberDecorate 8(gl_PerVertex) 0 BuiltIn Position + Decorate 8(gl_PerVertex) Block + Decorate 10 XfbBuffer 3 + Decorate 10 XfbStride 80 + Decorate 14(position) Location 0 + MemberDecorate 17(ComponentsBlock) 0 Offset 0 + MemberDecorate 17(ComponentsBlock) 1 Offset 16 + Decorate 17(ComponentsBlock) Block + Decorate 19(components) DescriptorSet 0 + Decorate 19(components) Binding 5 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(gl_PerVertex): TypeStruct 7(fvec4) + 9: TypePointer Output 8(gl_PerVertex) + 10: 9(ptr) Variable Output + 11: TypeInt 32 1 + 12: 11(int) Constant 0 + 13: TypePointer Input 7(fvec4) + 14(position): 13(ptr) Variable Input + 16: TypeVector 6(float) 2 +17(ComponentsBlock): TypeStruct 7(fvec4) 16(fvec2) + 18: TypePointer Uniform 17(ComponentsBlock) + 19(components): 18(ptr) Variable Uniform + 20: TypePointer Uniform 7(fvec4) + 24: 11(int) Constant 1 + 25: TypePointer Uniform 16(fvec2) + 28: 6(float) Constant 0 + 33: TypePointer Output 7(fvec4) + 4(main): 2 Function None 3 + 5: Label + 15: 7(fvec4) Load 14(position) + 21: 20(ptr) AccessChain 19(components) 12 + 22: 7(fvec4) Load 21 + 23: 7(fvec4) FAdd 15 22 + 26: 25(ptr) AccessChain 19(components) 24 + 27: 16(fvec2) Load 26 + 29: 6(float) CompositeExtract 27 0 + 30: 6(float) CompositeExtract 27 1 + 31: 7(fvec4) CompositeConstruct 29 30 28 28 + 32: 7(fvec4) FAdd 23 31 + 34: 33(ptr) AccessChain 10 12 + Store 34 32 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.xfbOffsetOnStructMembersAssignment.vert.out b/deps/glslang/Test/baseResults/spv.xfbOffsetOnStructMembersAssignment.vert.out new file mode 100644 index 00000000..7eb45934 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.xfbOffsetOnStructMembersAssignment.vert.out @@ -0,0 +1,93 @@ +spv.xfbOffsetOnStructMembersAssignment.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 40 + + Capability Shader + Capability TransformFeedback + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 9 21 34 38 39 + ExecutionMode 4 Xfb + Source GLSL 450 + Name 4 "main" + Name 7 "S" + MemberName 7(S) 0 "x1_out" + MemberName 7(S) 1 "x2_out" + Name 9 "s1" + Name 19 "S2" + MemberName 19(S2) 0 "y1_out" + MemberName 19(S2) 1 "y2_out" + Name 21 "s2" + Name 32 "gl_PerVertex" + MemberName 32(gl_PerVertex) 0 "gl_Position" + MemberName 32(gl_PerVertex) 1 "gl_PointSize" + MemberName 32(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 32(gl_PerVertex) 3 "gl_CullDistance" + Name 34 "" + Name 38 "gl_VertexID" + Name 39 "gl_InstanceID" + MemberDecorate 7(S) 0 Offset 16 + MemberDecorate 7(S) 1 Offset 20 + Decorate 9(s1) Location 0 + Decorate 9(s1) XfbBuffer 2 + Decorate 9(s1) XfbStride 24 + MemberDecorate 19(S2) 0 Offset 8 + MemberDecorate 19(S2) 1 Offset 12 + Decorate 21(s2) Location 5 + Decorate 21(s2) XfbBuffer 1 + Decorate 21(s2) XfbStride 28 + MemberDecorate 32(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 32(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 32(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 32(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 32(gl_PerVertex) Block + Decorate 34 XfbBuffer 0 + Decorate 34 XfbStride 0 + Decorate 38(gl_VertexID) BuiltIn VertexId + Decorate 39(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7(S): TypeStruct 6(float) 6(float) + 8: TypePointer Output 7(S) + 9(s1): 8(ptr) Variable Output + 10: TypeInt 32 1 + 11: 10(int) Constant 0 + 12: 6(float) Constant 1084227584 + 13: TypePointer Output 6(float) + 15: 10(int) Constant 1 + 16: 6(float) Constant 1086324736 + 18: TypeVector 6(float) 4 + 19(S2): TypeStruct 6(float) 18(fvec4) + 20: TypePointer Output 19(S2) + 21(s2): 20(ptr) Variable Output + 22: 6(float) Constant 1088421888 + 24: 6(float) Constant 1065353216 + 25: 6(float) Constant 0 + 26: 18(fvec4) ConstantComposite 24 25 25 24 + 27: TypePointer Output 18(fvec4) + 29: TypeInt 32 0 + 30: 29(int) Constant 1 + 31: TypeArray 6(float) 30 +32(gl_PerVertex): TypeStruct 18(fvec4) 6(float) 31 31 + 33: TypePointer Output 32(gl_PerVertex) + 34: 33(ptr) Variable Output + 35: 18(fvec4) ConstantComposite 25 25 25 25 + 37: TypePointer Input 10(int) + 38(gl_VertexID): 37(ptr) Variable Input +39(gl_InstanceID): 37(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 14: 13(ptr) AccessChain 9(s1) 11 + Store 14 12 + 17: 13(ptr) AccessChain 9(s1) 15 + Store 17 16 + 23: 13(ptr) AccessChain 21(s2) 11 + Store 23 22 + 28: 27(ptr) AccessChain 21(s2) 15 + Store 28 26 + 36: 27(ptr) AccessChain 34 11 + Store 36 35 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/stringToDouble.vert.out b/deps/glslang/Test/baseResults/stringToDouble.vert.out new file mode 100644 index 00000000..a799d0a4 --- /dev/null +++ b/deps/glslang/Test/baseResults/stringToDouble.vert.out @@ -0,0 +1,1045 @@ +stringToDouble.vert +Shader version: 460 +Requested GL_KHX_shader_explicit_arithmetic_types_float16 +0:? Sequence +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:5 Sequence +0:5 Sequence +0:5 move second child to first child ( temp float) +0:5 'w1' ( temp float) +0:5 Constant: +0:5 0.000000 +0:6 Sequence +0:6 move second child to first child ( temp float) +0:6 'w2' ( temp float) +0:6 Constant: +0:6 1.000000 +0:7 Sequence +0:7 move second child to first child ( temp float) +0:7 'w3' ( temp float) +0:7 Constant: +0:7 7.000000 +0:8 Sequence +0:8 move second child to first child ( temp float) +0:8 'w4' ( temp float) +0:8 Constant: +0:8 130000.000000 +0:9 Sequence +0:9 move second child to first child ( temp float) +0:9 'w5' ( temp float) +0:9 Constant: +0:9 123456789.000000 +0:10 Sequence +0:10 move second child to first child ( temp double) +0:10 'w6' ( temp double) +0:10 Constant: +0:10 1.2345678901235e+15 +0:11 Sequence +0:11 move second child to first child ( temp double) +0:11 'w7' ( temp double) +0:11 Constant: +0:11 1.2345678901235e+16 +0:12 Sequence +0:12 move second child to first child ( temp double) +0:12 'w8' ( temp double) +0:12 Constant: +0:12 1.2345678901235e+17 +0:13 Sequence +0:13 move second child to first child ( temp double) +0:13 'w9' ( temp double) +0:13 Constant: +0:13 1.2345678901235e+19 +0:14 Sequence +0:14 move second child to first child ( temp double) +0:14 'w10' ( temp double) +0:14 Constant: +0:14 1.2345678901235e+24 +0:16 Sequence +0:16 move second child to first child ( temp float) +0:16 'e1' ( temp float) +0:16 Constant: +0:16 0.000000 +0:17 Sequence +0:17 move second child to first child ( temp float) +0:17 'e2' ( temp float) +0:17 Constant: +0:17 1.000000 +0:18 Sequence +0:18 move second child to first child ( temp float) +0:18 'e3' ( temp float) +0:18 Constant: +0:18 0.000000 +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'e4' ( temp float) +0:19 Constant: +0:19 1.0000000000000e+15 +0:20 Sequence +0:20 move second child to first child ( temp float) +0:20 'e5' ( temp float) +0:20 Constant: +0:20 1.0000000000000e+16 +0:21 Sequence +0:21 move second child to first child ( temp float) +0:21 'e6' ( temp float) +0:21 Constant: +0:21 0.000000 +0:22 Sequence +0:22 move second child to first child ( temp float) +0:22 'e7' ( temp float) +0:22 Constant: +0:22 1.0000000000000e-15 +0:23 Sequence +0:23 move second child to first child ( temp float) +0:23 'e8' ( temp float) +0:23 Constant: +0:23 1.0000000000000e-16 +0:24 Sequence +0:24 move second child to first child ( temp double) +0:24 'e9' ( temp double) +0:24 Constant: +0:24 1.0000000000000e+100 +0:25 Sequence +0:25 move second child to first child ( temp double) +0:25 'e10' ( temp double) +0:25 Constant: +0:25 1.0000000000000e+308 +0:26 Sequence +0:26 move second child to first child ( temp double) +0:26 'e11' ( temp double) +0:26 Constant: +0:26 1.0000000000000e-307 +0:27 Sequence +0:27 move second child to first child ( temp double) +0:27 'e12' ( temp double) +0:27 Constant: +0:27 +1.#INF +0:28 Sequence +0:28 move second child to first child ( temp double) +0:28 'e13' ( temp double) +0:28 Constant: +0:28 0.000000 +0:29 Sequence +0:29 move second child to first child ( temp double) +0:29 'e24' ( temp double) +0:29 Constant: +0:29 +1.#INF +0:30 Sequence +0:30 move second child to first child ( temp double) +0:30 'e25' ( temp double) +0:30 Constant: +0:30 0.000000 +0:32 Sequence +0:32 move second child to first child ( temp double) +0:32 'f1' ( temp double) +0:32 Constant: +0:32 0.500000 +0:33 Sequence +0:33 move second child to first child ( temp double) +0:33 'f2' ( temp double) +0:33 Constant: +0:33 0.125000 +0:34 Sequence +0:34 move second child to first child ( temp double) +0:34 'f31' ( temp double) +0:34 Constant: +0:34 0.100000 +0:35 Sequence +0:35 move second child to first child ( temp double) +0:35 'f32' ( temp double) +0:35 Constant: +0:35 0.200000 +0:36 Sequence +0:36 move second child to first child ( temp double) +0:36 'f33' ( temp double) +0:36 Constant: +0:36 0.300000 +0:37 Sequence +0:37 move second child to first child ( temp double) +0:37 'f34' ( temp double) +0:37 Constant: +0:37 0.400000 +0:38 Sequence +0:38 move second child to first child ( temp double) +0:38 'f35' ( temp double) +0:38 Constant: +0:38 0.500000 +0:39 Sequence +0:39 move second child to first child ( temp double) +0:39 'f36' ( temp double) +0:39 Constant: +0:39 0.600000 +0:40 Sequence +0:40 move second child to first child ( temp double) +0:40 'f37' ( temp double) +0:40 Constant: +0:40 0.700000 +0:41 Sequence +0:41 move second child to first child ( temp double) +0:41 'f38' ( temp double) +0:41 Constant: +0:41 0.800000 +0:42 Sequence +0:42 move second child to first child ( temp double) +0:42 'f39' ( temp double) +0:42 Constant: +0:42 0.900000 +0:43 Sequence +0:43 move second child to first child ( temp double) +0:43 'f4' ( temp double) +0:43 Constant: +0:43 0.333333 +0:44 Sequence +0:44 move second child to first child ( temp double) +0:44 'f51' ( temp double) +0:44 Constant: +0:44 7.8347500000000e-37 +0:45 Sequence +0:45 move second child to first child ( temp double) +0:45 'f52' ( temp double) +0:45 Constant: +0:45 7.8347500000000e-37 +0:46 Sequence +0:46 move second child to first child ( temp double) +0:46 'f53' ( temp double) +0:46 Constant: +0:46 7.8347500000000e-37 +0:47 Sequence +0:47 move second child to first child ( temp double) +0:47 'f54' ( temp double) +0:47 Constant: +0:47 7.8347500000000e-37 +0:48 Sequence +0:48 move second child to first child ( temp double) +0:48 'f61' ( temp double) +0:48 Constant: +0:48 4.000000 +0:49 Sequence +0:49 move second child to first child ( temp double) +0:49 'f62' ( temp double) +0:49 Constant: +0:49 40.000000 +0:50 Sequence +0:50 move second child to first child ( temp double) +0:50 'f63' ( temp double) +0:50 Constant: +0:50 0.000000 +0:51 Sequence +0:51 move second child to first child ( temp double) +0:51 'f64' ( temp double) +0:51 Constant: +0:51 4.000000 +0:52 Sequence +0:52 move second child to first child ( temp double) +0:52 'f65' ( temp double) +0:52 Constant: +0:52 0.000000 +0:53 Sequence +0:53 move second child to first child ( temp double) +0:53 'f66' ( temp double) +0:53 Constant: +0:53 0.004000 +0:54 Sequence +0:54 move second child to first child ( temp double) +0:54 'f67' ( temp double) +0:54 Constant: +0:54 0.400000 +0:55 Sequence +0:55 move second child to first child ( temp double) +0:55 'f68' ( temp double) +0:55 Constant: +0:55 0.040000 +0:57 Sequence +0:57 move second child to first child ( temp double) +0:57 'c1' ( temp double) +0:57 Constant: +0:57 0.000810 +0:58 Sequence +0:58 move second child to first child ( temp double) +0:58 'c2' ( temp double) +0:58 Constant: +0:58 7.300000 +0:59 Sequence +0:59 move second child to first child ( temp double) +0:59 'c3' ( temp double) +0:59 Constant: +0:59 3.450000 +0:60 Sequence +0:60 move second child to first child ( temp double) +0:60 'c4' ( temp double) +0:60 Constant: +0:60 0.003570 +0:61 Sequence +0:61 move second child to first child ( temp double) +0:61 'c5' ( temp double) +0:61 Constant: +0:61 439.000000 +0:62 Sequence +0:62 move second child to first child ( temp double) +0:62 'c6' ( temp double) +0:62 Constant: +0:62 522000.000000 +0:63 Sequence +0:63 move second child to first child ( temp double) +0:63 'c7' ( temp double) +0:63 Constant: +0:63 61000000.000000 +0:64 Sequence +0:64 move second child to first child ( temp double) +0:64 'c8' ( temp double) +0:64 Constant: +0:64 0.610000 +0:65 Sequence +0:65 move second child to first child ( temp double) +0:65 'c9' ( temp double) +0:65 Constant: +0:65 1.2345678901235e+18 +0:66 Sequence +0:66 move second child to first child ( temp double) +0:66 'c10' ( temp double) +0:66 Constant: +0:66 1.0000000000000e+21 +0:67 Sequence +0:67 move second child to first child ( temp double) +0:67 'c11' ( temp double) +0:67 Constant: +0:67 1230000.004560 +0:68 Sequence +0:68 move second child to first child ( temp double) +0:68 'c12' ( temp double) +0:68 Constant: +0:68 1230.000004 +0:69 Sequence +0:69 move second child to first child ( temp double) +0:69 'c13' ( temp double) +0:69 Constant: +0:69 123.000000 +0:70 Sequence +0:70 move second child to first child ( temp double) +0:70 'c14' ( temp double) +0:70 Constant: +0:70 102.300000 +0:71 Sequence +0:71 move second child to first child ( temp double) +0:71 'c15' ( temp double) +0:71 Constant: +0:71 1.2003000000456e+12 +0:72 Sequence +0:72 move second child to first child ( temp double) +0:72 'c16' ( temp double) +0:72 Constant: +0:72 123000000456.000000 +0:73 Sequence +0:73 move second child to first child ( temp double) +0:73 'c17' ( temp double) +0:73 Constant: +0:73 1.2300000045600e+12 +0:74 Sequence +0:74 move second child to first child ( temp double) +0:74 'c18' ( temp double) +0:74 Constant: +0:74 1.2300000045601e+12 +0:76 Sequence +0:76 move second child to first child ( temp double) +0:76 'b11' ( temp double) +0:76 Constant: +0:76 7.2057594037928e+16 +0:77 Sequence +0:77 move second child to first child ( temp double) +0:77 'b12' ( temp double) +0:77 Constant: +0:77 7.2057594037928e+16 +0:78 Sequence +0:78 move second child to first child ( temp double) +0:78 'b13' ( temp double) +0:78 Constant: +0:78 7.2057594037928e+16 +0:79 Sequence +0:79 move second child to first child ( temp double) +0:79 'b14' ( temp double) +0:79 Constant: +0:79 7.2057594037928e+16 +0:80 Sequence +0:80 move second child to first child ( temp double) +0:80 'b15' ( temp double) +0:80 Constant: +0:80 7.2057594037928e+16 +0:81 Sequence +0:81 move second child to first child ( temp double) +0:81 'b21' ( temp double) +0:81 Constant: +0:81 9.2233720368548e+18 +0:82 Sequence +0:82 move second child to first child ( temp double) +0:82 'b22' ( temp double) +0:82 Constant: +0:82 9.2233720368548e+18 +0:83 Sequence +0:83 move second child to first child ( temp double) +0:83 'b23' ( temp double) +0:83 Constant: +0:83 9.2233720368548e+18 +0:84 Sequence +0:84 move second child to first child ( temp double) +0:84 'b24' ( temp double) +0:84 Constant: +0:84 9.2233720368548e+18 +0:85 Sequence +0:85 move second child to first child ( temp double) +0:85 'b25' ( temp double) +0:85 Constant: +0:85 9.2233720368548e+18 +0:86 Sequence +0:86 move second child to first child ( temp double) +0:86 'b31' ( temp double) +0:86 Constant: +0:86 1.0141204801826e+31 +0:87 Sequence +0:87 move second child to first child ( temp double) +0:87 'b32' ( temp double) +0:87 Constant: +0:87 1.0141204801826e+31 +0:88 Sequence +0:88 move second child to first child ( temp double) +0:88 'b33' ( temp double) +0:88 Constant: +0:88 1.0141204801826e+31 +0:89 Sequence +0:89 move second child to first child ( temp double) +0:89 'b34' ( temp double) +0:89 Constant: +0:89 1.0141204801826e+31 +0:90 Sequence +0:90 move second child to first child ( temp double) +0:90 'b35' ( temp double) +0:90 Constant: +0:90 1.0141204801826e+31 +0:91 Sequence +0:91 move second child to first child ( temp double) +0:91 'b41' ( temp double) +0:91 Constant: +0:91 5.7089907708238e+45 +0:92 Sequence +0:92 move second child to first child ( temp double) +0:92 'b42' ( temp double) +0:92 Constant: +0:92 5.7089907708238e+45 +0:93 Sequence +0:93 move second child to first child ( temp double) +0:93 'b43' ( temp double) +0:93 Constant: +0:93 5.7089907708238e+45 +0:94 Sequence +0:94 move second child to first child ( temp double) +0:94 'b44' ( temp double) +0:94 Constant: +0:94 5.7089907708238e+45 +0:95 Sequence +0:95 move second child to first child ( temp double) +0:95 'b45' ( temp double) +0:95 Constant: +0:95 5.7089907708238e+45 +0:97 Sequence +0:97 move second child to first child ( temp float) +0:97 'pi1' ( temp float) +0:97 Constant: +0:97 3.141593 +0:98 Sequence +0:98 move second child to first child ( temp float) +0:98 'pi2' ( temp float) +0:98 Constant: +0:98 3.141593 +0:99 Sequence +0:99 move second child to first child ( temp float) +0:99 'pi3' ( temp float) +0:99 Constant: +0:99 3.141593 +0:101 Sequence +0:101 move second child to first child ( temp double) +0:101 'dpi1' ( temp double) +0:101 Constant: +0:101 3.141593 +0:102 Sequence +0:102 move second child to first child ( temp double) +0:102 'dpi2' ( temp double) +0:102 Constant: +0:102 3.141593 +0:103 Sequence +0:103 move second child to first child ( temp double) +0:103 'dpi3' ( temp double) +0:103 Constant: +0:103 3.141593 +0:105 Sequence +0:105 move second child to first child ( temp float) +0:105 'dfpi1' ( temp float) +0:105 Constant: +0:105 3.141593 +0:106 Sequence +0:106 move second child to first child ( temp float) +0:106 'dfpi2' ( temp float) +0:106 Constant: +0:106 3.141593 +0:107 Sequence +0:107 move second child to first child ( temp float) +0:107 'dfpi3' ( temp float) +0:107 Constant: +0:107 3.141593 +0:109 Sequence +0:109 move second child to first child ( temp double) +0:109 'lfpi1' ( temp double) +0:109 Constant: +0:109 3.141593 +0:110 Sequence +0:110 move second child to first child ( temp double) +0:110 'lfpi2' ( temp double) +0:110 Constant: +0:110 3.141593 +0:111 Sequence +0:111 move second child to first child ( temp double) +0:111 'lfpi3' ( temp double) +0:111 Constant: +0:111 3.141593 +0:113 Sequence +0:113 move second child to first child ( temp double) +0:113 'hfpi1' ( temp double) +0:113 Constant: +0:113 3.141593 +0:114 Sequence +0:114 move second child to first child ( temp double) +0:114 'hfpi2' ( temp double) +0:114 Constant: +0:114 3.141593 +0:115 Sequence +0:115 move second child to first child ( temp double) +0:115 'hfpi3' ( temp double) +0:115 Constant: +0:115 3.141593 +0:? Linker Objects +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 460 +Requested GL_KHX_shader_explicit_arithmetic_types_float16 +0:? Sequence +0:3 Function Definition: main( ( global void) +0:3 Function Parameters: +0:5 Sequence +0:5 Sequence +0:5 move second child to first child ( temp float) +0:5 'w1' ( temp float) +0:5 Constant: +0:5 0.000000 +0:6 Sequence +0:6 move second child to first child ( temp float) +0:6 'w2' ( temp float) +0:6 Constant: +0:6 1.000000 +0:7 Sequence +0:7 move second child to first child ( temp float) +0:7 'w3' ( temp float) +0:7 Constant: +0:7 7.000000 +0:8 Sequence +0:8 move second child to first child ( temp float) +0:8 'w4' ( temp float) +0:8 Constant: +0:8 130000.000000 +0:9 Sequence +0:9 move second child to first child ( temp float) +0:9 'w5' ( temp float) +0:9 Constant: +0:9 123456789.000000 +0:10 Sequence +0:10 move second child to first child ( temp double) +0:10 'w6' ( temp double) +0:10 Constant: +0:10 1.2345678901235e+15 +0:11 Sequence +0:11 move second child to first child ( temp double) +0:11 'w7' ( temp double) +0:11 Constant: +0:11 1.2345678901235e+16 +0:12 Sequence +0:12 move second child to first child ( temp double) +0:12 'w8' ( temp double) +0:12 Constant: +0:12 1.2345678901235e+17 +0:13 Sequence +0:13 move second child to first child ( temp double) +0:13 'w9' ( temp double) +0:13 Constant: +0:13 1.2345678901235e+19 +0:14 Sequence +0:14 move second child to first child ( temp double) +0:14 'w10' ( temp double) +0:14 Constant: +0:14 1.2345678901235e+24 +0:16 Sequence +0:16 move second child to first child ( temp float) +0:16 'e1' ( temp float) +0:16 Constant: +0:16 0.000000 +0:17 Sequence +0:17 move second child to first child ( temp float) +0:17 'e2' ( temp float) +0:17 Constant: +0:17 1.000000 +0:18 Sequence +0:18 move second child to first child ( temp float) +0:18 'e3' ( temp float) +0:18 Constant: +0:18 0.000000 +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'e4' ( temp float) +0:19 Constant: +0:19 1.0000000000000e+15 +0:20 Sequence +0:20 move second child to first child ( temp float) +0:20 'e5' ( temp float) +0:20 Constant: +0:20 1.0000000000000e+16 +0:21 Sequence +0:21 move second child to first child ( temp float) +0:21 'e6' ( temp float) +0:21 Constant: +0:21 0.000000 +0:22 Sequence +0:22 move second child to first child ( temp float) +0:22 'e7' ( temp float) +0:22 Constant: +0:22 1.0000000000000e-15 +0:23 Sequence +0:23 move second child to first child ( temp float) +0:23 'e8' ( temp float) +0:23 Constant: +0:23 1.0000000000000e-16 +0:24 Sequence +0:24 move second child to first child ( temp double) +0:24 'e9' ( temp double) +0:24 Constant: +0:24 1.0000000000000e+100 +0:25 Sequence +0:25 move second child to first child ( temp double) +0:25 'e10' ( temp double) +0:25 Constant: +0:25 1.0000000000000e+308 +0:26 Sequence +0:26 move second child to first child ( temp double) +0:26 'e11' ( temp double) +0:26 Constant: +0:26 1.0000000000000e-307 +0:27 Sequence +0:27 move second child to first child ( temp double) +0:27 'e12' ( temp double) +0:27 Constant: +0:27 +1.#INF +0:28 Sequence +0:28 move second child to first child ( temp double) +0:28 'e13' ( temp double) +0:28 Constant: +0:28 0.000000 +0:29 Sequence +0:29 move second child to first child ( temp double) +0:29 'e24' ( temp double) +0:29 Constant: +0:29 +1.#INF +0:30 Sequence +0:30 move second child to first child ( temp double) +0:30 'e25' ( temp double) +0:30 Constant: +0:30 0.000000 +0:32 Sequence +0:32 move second child to first child ( temp double) +0:32 'f1' ( temp double) +0:32 Constant: +0:32 0.500000 +0:33 Sequence +0:33 move second child to first child ( temp double) +0:33 'f2' ( temp double) +0:33 Constant: +0:33 0.125000 +0:34 Sequence +0:34 move second child to first child ( temp double) +0:34 'f31' ( temp double) +0:34 Constant: +0:34 0.100000 +0:35 Sequence +0:35 move second child to first child ( temp double) +0:35 'f32' ( temp double) +0:35 Constant: +0:35 0.200000 +0:36 Sequence +0:36 move second child to first child ( temp double) +0:36 'f33' ( temp double) +0:36 Constant: +0:36 0.300000 +0:37 Sequence +0:37 move second child to first child ( temp double) +0:37 'f34' ( temp double) +0:37 Constant: +0:37 0.400000 +0:38 Sequence +0:38 move second child to first child ( temp double) +0:38 'f35' ( temp double) +0:38 Constant: +0:38 0.500000 +0:39 Sequence +0:39 move second child to first child ( temp double) +0:39 'f36' ( temp double) +0:39 Constant: +0:39 0.600000 +0:40 Sequence +0:40 move second child to first child ( temp double) +0:40 'f37' ( temp double) +0:40 Constant: +0:40 0.700000 +0:41 Sequence +0:41 move second child to first child ( temp double) +0:41 'f38' ( temp double) +0:41 Constant: +0:41 0.800000 +0:42 Sequence +0:42 move second child to first child ( temp double) +0:42 'f39' ( temp double) +0:42 Constant: +0:42 0.900000 +0:43 Sequence +0:43 move second child to first child ( temp double) +0:43 'f4' ( temp double) +0:43 Constant: +0:43 0.333333 +0:44 Sequence +0:44 move second child to first child ( temp double) +0:44 'f51' ( temp double) +0:44 Constant: +0:44 7.8347500000000e-37 +0:45 Sequence +0:45 move second child to first child ( temp double) +0:45 'f52' ( temp double) +0:45 Constant: +0:45 7.8347500000000e-37 +0:46 Sequence +0:46 move second child to first child ( temp double) +0:46 'f53' ( temp double) +0:46 Constant: +0:46 7.8347500000000e-37 +0:47 Sequence +0:47 move second child to first child ( temp double) +0:47 'f54' ( temp double) +0:47 Constant: +0:47 7.8347500000000e-37 +0:48 Sequence +0:48 move second child to first child ( temp double) +0:48 'f61' ( temp double) +0:48 Constant: +0:48 4.000000 +0:49 Sequence +0:49 move second child to first child ( temp double) +0:49 'f62' ( temp double) +0:49 Constant: +0:49 40.000000 +0:50 Sequence +0:50 move second child to first child ( temp double) +0:50 'f63' ( temp double) +0:50 Constant: +0:50 0.000000 +0:51 Sequence +0:51 move second child to first child ( temp double) +0:51 'f64' ( temp double) +0:51 Constant: +0:51 4.000000 +0:52 Sequence +0:52 move second child to first child ( temp double) +0:52 'f65' ( temp double) +0:52 Constant: +0:52 0.000000 +0:53 Sequence +0:53 move second child to first child ( temp double) +0:53 'f66' ( temp double) +0:53 Constant: +0:53 0.004000 +0:54 Sequence +0:54 move second child to first child ( temp double) +0:54 'f67' ( temp double) +0:54 Constant: +0:54 0.400000 +0:55 Sequence +0:55 move second child to first child ( temp double) +0:55 'f68' ( temp double) +0:55 Constant: +0:55 0.040000 +0:57 Sequence +0:57 move second child to first child ( temp double) +0:57 'c1' ( temp double) +0:57 Constant: +0:57 0.000810 +0:58 Sequence +0:58 move second child to first child ( temp double) +0:58 'c2' ( temp double) +0:58 Constant: +0:58 7.300000 +0:59 Sequence +0:59 move second child to first child ( temp double) +0:59 'c3' ( temp double) +0:59 Constant: +0:59 3.450000 +0:60 Sequence +0:60 move second child to first child ( temp double) +0:60 'c4' ( temp double) +0:60 Constant: +0:60 0.003570 +0:61 Sequence +0:61 move second child to first child ( temp double) +0:61 'c5' ( temp double) +0:61 Constant: +0:61 439.000000 +0:62 Sequence +0:62 move second child to first child ( temp double) +0:62 'c6' ( temp double) +0:62 Constant: +0:62 522000.000000 +0:63 Sequence +0:63 move second child to first child ( temp double) +0:63 'c7' ( temp double) +0:63 Constant: +0:63 61000000.000000 +0:64 Sequence +0:64 move second child to first child ( temp double) +0:64 'c8' ( temp double) +0:64 Constant: +0:64 0.610000 +0:65 Sequence +0:65 move second child to first child ( temp double) +0:65 'c9' ( temp double) +0:65 Constant: +0:65 1.2345678901235e+18 +0:66 Sequence +0:66 move second child to first child ( temp double) +0:66 'c10' ( temp double) +0:66 Constant: +0:66 1.0000000000000e+21 +0:67 Sequence +0:67 move second child to first child ( temp double) +0:67 'c11' ( temp double) +0:67 Constant: +0:67 1230000.004560 +0:68 Sequence +0:68 move second child to first child ( temp double) +0:68 'c12' ( temp double) +0:68 Constant: +0:68 1230.000004 +0:69 Sequence +0:69 move second child to first child ( temp double) +0:69 'c13' ( temp double) +0:69 Constant: +0:69 123.000000 +0:70 Sequence +0:70 move second child to first child ( temp double) +0:70 'c14' ( temp double) +0:70 Constant: +0:70 102.300000 +0:71 Sequence +0:71 move second child to first child ( temp double) +0:71 'c15' ( temp double) +0:71 Constant: +0:71 1.2003000000456e+12 +0:72 Sequence +0:72 move second child to first child ( temp double) +0:72 'c16' ( temp double) +0:72 Constant: +0:72 123000000456.000000 +0:73 Sequence +0:73 move second child to first child ( temp double) +0:73 'c17' ( temp double) +0:73 Constant: +0:73 1.2300000045600e+12 +0:74 Sequence +0:74 move second child to first child ( temp double) +0:74 'c18' ( temp double) +0:74 Constant: +0:74 1.2300000045601e+12 +0:76 Sequence +0:76 move second child to first child ( temp double) +0:76 'b11' ( temp double) +0:76 Constant: +0:76 7.2057594037928e+16 +0:77 Sequence +0:77 move second child to first child ( temp double) +0:77 'b12' ( temp double) +0:77 Constant: +0:77 7.2057594037928e+16 +0:78 Sequence +0:78 move second child to first child ( temp double) +0:78 'b13' ( temp double) +0:78 Constant: +0:78 7.2057594037928e+16 +0:79 Sequence +0:79 move second child to first child ( temp double) +0:79 'b14' ( temp double) +0:79 Constant: +0:79 7.2057594037928e+16 +0:80 Sequence +0:80 move second child to first child ( temp double) +0:80 'b15' ( temp double) +0:80 Constant: +0:80 7.2057594037928e+16 +0:81 Sequence +0:81 move second child to first child ( temp double) +0:81 'b21' ( temp double) +0:81 Constant: +0:81 9.2233720368548e+18 +0:82 Sequence +0:82 move second child to first child ( temp double) +0:82 'b22' ( temp double) +0:82 Constant: +0:82 9.2233720368548e+18 +0:83 Sequence +0:83 move second child to first child ( temp double) +0:83 'b23' ( temp double) +0:83 Constant: +0:83 9.2233720368548e+18 +0:84 Sequence +0:84 move second child to first child ( temp double) +0:84 'b24' ( temp double) +0:84 Constant: +0:84 9.2233720368548e+18 +0:85 Sequence +0:85 move second child to first child ( temp double) +0:85 'b25' ( temp double) +0:85 Constant: +0:85 9.2233720368548e+18 +0:86 Sequence +0:86 move second child to first child ( temp double) +0:86 'b31' ( temp double) +0:86 Constant: +0:86 1.0141204801826e+31 +0:87 Sequence +0:87 move second child to first child ( temp double) +0:87 'b32' ( temp double) +0:87 Constant: +0:87 1.0141204801826e+31 +0:88 Sequence +0:88 move second child to first child ( temp double) +0:88 'b33' ( temp double) +0:88 Constant: +0:88 1.0141204801826e+31 +0:89 Sequence +0:89 move second child to first child ( temp double) +0:89 'b34' ( temp double) +0:89 Constant: +0:89 1.0141204801826e+31 +0:90 Sequence +0:90 move second child to first child ( temp double) +0:90 'b35' ( temp double) +0:90 Constant: +0:90 1.0141204801826e+31 +0:91 Sequence +0:91 move second child to first child ( temp double) +0:91 'b41' ( temp double) +0:91 Constant: +0:91 5.7089907708238e+45 +0:92 Sequence +0:92 move second child to first child ( temp double) +0:92 'b42' ( temp double) +0:92 Constant: +0:92 5.7089907708238e+45 +0:93 Sequence +0:93 move second child to first child ( temp double) +0:93 'b43' ( temp double) +0:93 Constant: +0:93 5.7089907708238e+45 +0:94 Sequence +0:94 move second child to first child ( temp double) +0:94 'b44' ( temp double) +0:94 Constant: +0:94 5.7089907708238e+45 +0:95 Sequence +0:95 move second child to first child ( temp double) +0:95 'b45' ( temp double) +0:95 Constant: +0:95 5.7089907708238e+45 +0:97 Sequence +0:97 move second child to first child ( temp float) +0:97 'pi1' ( temp float) +0:97 Constant: +0:97 3.141593 +0:98 Sequence +0:98 move second child to first child ( temp float) +0:98 'pi2' ( temp float) +0:98 Constant: +0:98 3.141593 +0:99 Sequence +0:99 move second child to first child ( temp float) +0:99 'pi3' ( temp float) +0:99 Constant: +0:99 3.141593 +0:101 Sequence +0:101 move second child to first child ( temp double) +0:101 'dpi1' ( temp double) +0:101 Constant: +0:101 3.141593 +0:102 Sequence +0:102 move second child to first child ( temp double) +0:102 'dpi2' ( temp double) +0:102 Constant: +0:102 3.141593 +0:103 Sequence +0:103 move second child to first child ( temp double) +0:103 'dpi3' ( temp double) +0:103 Constant: +0:103 3.141593 +0:105 Sequence +0:105 move second child to first child ( temp float) +0:105 'dfpi1' ( temp float) +0:105 Constant: +0:105 3.141593 +0:106 Sequence +0:106 move second child to first child ( temp float) +0:106 'dfpi2' ( temp float) +0:106 Constant: +0:106 3.141593 +0:107 Sequence +0:107 move second child to first child ( temp float) +0:107 'dfpi3' ( temp float) +0:107 Constant: +0:107 3.141593 +0:109 Sequence +0:109 move second child to first child ( temp double) +0:109 'lfpi1' ( temp double) +0:109 Constant: +0:109 3.141593 +0:110 Sequence +0:110 move second child to first child ( temp double) +0:110 'lfpi2' ( temp double) +0:110 Constant: +0:110 3.141593 +0:111 Sequence +0:111 move second child to first child ( temp double) +0:111 'lfpi3' ( temp double) +0:111 Constant: +0:111 3.141593 +0:113 Sequence +0:113 move second child to first child ( temp double) +0:113 'hfpi1' ( temp double) +0:113 Constant: +0:113 3.141593 +0:114 Sequence +0:114 move second child to first child ( temp double) +0:114 'hfpi2' ( temp double) +0:114 Constant: +0:114 3.141593 +0:115 Sequence +0:115 move second child to first child ( temp double) +0:115 'hfpi3' ( temp double) +0:115 Constant: +0:115 3.141593 +0:? Linker Objects +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/structAssignment.frag.out b/deps/glslang/Test/baseResults/structAssignment.frag.out new file mode 100644 index 00000000..5bd2ca89 --- /dev/null +++ b/deps/glslang/Test/baseResults/structAssignment.frag.out @@ -0,0 +1,103 @@ +structAssignment.frag +WARNING: 0:4: varying deprecated in version 130; may be removed in future release + +Shader version: 130 +0:? Sequence +0:29 Function Definition: main( ( global void) +0:29 Function Parameters: +0:? Sequence +0:33 Test condition and select ( temp void) +0:33 Condition +0:33 Compare Greater Than ( temp bool) +0:33 i: direct index for structure ( global int) +0:33 s2_1: direct index for structure ( global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:33 'foo3' ( uniform structure{ global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 0 (const int) +0:33 true case +0:34 move second child to first child ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:34 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:34 s2_1: direct index for structure ( global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:34 'foo3' ( uniform structure{ global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:34 Constant: +0:34 0 (const int) +0:33 false case +0:36 move second child to first child ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:36 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:36 'foo2' ( uniform structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:38 move second child to first child ( temp 4-component vector of float) +0:38 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:38 vector-scale ( temp 4-component vector of float) +0:38 f: direct index for structure ( global float) +0:38 s1_1: direct index for structure ( global structure{ global int i, global float f}) +0:38 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:38 Constant: +0:38 2 (const int) +0:38 Constant: +0:38 1 (const int) +0:38 texture ( global 4-component vector of float) +0:38 'sampler' ( uniform sampler2D) +0:38 'coord' ( smooth in 2-component vector of float) +0:? Linker Objects +0:? 'sampler' ( uniform sampler2D) +0:? 'coord' ( smooth in 2-component vector of float) +0:? 'foo' ( uniform structure{ global int i, global float f}) +0:? 'foo2' ( uniform structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:? 'foo3' ( uniform structure{ global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) + + +Linked fragment stage: + + +Shader version: 130 +0:? Sequence +0:29 Function Definition: main( ( global void) +0:29 Function Parameters: +0:? Sequence +0:33 Test condition and select ( temp void) +0:33 Condition +0:33 Compare Greater Than ( temp bool) +0:33 i: direct index for structure ( global int) +0:33 s2_1: direct index for structure ( global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:33 'foo3' ( uniform structure{ global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 0 (const int) +0:33 true case +0:34 move second child to first child ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:34 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:34 s2_1: direct index for structure ( global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:34 'foo3' ( uniform structure{ global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:34 Constant: +0:34 0 (const int) +0:33 false case +0:36 move second child to first child ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:36 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:36 'foo2' ( uniform structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:38 move second child to first child ( temp 4-component vector of float) +0:38 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:38 vector-scale ( temp 4-component vector of float) +0:38 f: direct index for structure ( global float) +0:38 s1_1: direct index for structure ( global structure{ global int i, global float f}) +0:38 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:38 Constant: +0:38 2 (const int) +0:38 Constant: +0:38 1 (const int) +0:38 texture ( global 4-component vector of float) +0:38 'sampler' ( uniform sampler2D) +0:38 'coord' ( smooth in 2-component vector of float) +0:? Linker Objects +0:? 'sampler' ( uniform sampler2D) +0:? 'coord' ( smooth in 2-component vector of float) +0:? 'foo' ( uniform structure{ global int i, global float f}) +0:? 'foo2' ( uniform structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:? 'foo3' ( uniform structure{ global structure{ global int i, global float f, global structure{ global int i, global float f} s1_1} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) + diff --git a/deps/glslang/Test/baseResults/structDeref.frag.out b/deps/glslang/Test/baseResults/structDeref.frag.out new file mode 100644 index 00000000..c3f964c7 --- /dev/null +++ b/deps/glslang/Test/baseResults/structDeref.frag.out @@ -0,0 +1,345 @@ +structDeref.frag +WARNING: 0:4: varying deprecated in version 130; may be removed in future release + +Shader version: 130 +0:? Sequence +0:41 Function Definition: main( ( global void) +0:41 Function Parameters: +0:? Sequence +0:51 Test condition and select ( temp void) +0:51 Condition +0:51 Compare Greater Than ( temp bool) +0:51 i: direct index for structure ( global int) +0:51 direct index ( temp structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:51 s2_1: direct index for structure ( global 12-element array of structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:51 'foo3' ( uniform structure{ global 12-element array of structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1} s2_1, global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 9 (const int) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 0 (const int) +0:51 true case +0:52 Sequence +0:52 move second child to first child ( temp float) +0:52 f: direct index for structure ( global float) +0:52 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 1.000000 +0:53 move second child to first child ( temp structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:53 s1_1: direct index for structure ( global structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:53 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:53 Constant: +0:53 2 (const int) +0:53 Constant: +0:53 0 (const int) +0:53 1.000000 +0:53 0 (const int) +0:54 move second child to first child ( temp 6-element array of float) +0:54 'fArray' ( temp 6-element array of float) +0:54 Constant: +0:54 0.000000 +0:54 0.000000 +0:54 0.000000 +0:54 0.000000 +0:54 0.000000 +0:54 0.000000 +0:55 move second child to first child ( temp structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:55 direct index ( temp structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:55 'locals1Array' ( temp 10-element array of structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:55 Constant: +0:55 6 (const int) +0:55 'foo1' ( uniform structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:56 move second child to first child ( temp structure{ global int i}) +0:56 'locals0' ( temp structure{ global int i}) +0:56 Constant: +0:56 0 (const int) +0:57 move second child to first child ( temp structure{ global structure{ global int i} s0_0}) +0:57 'locals00' ( temp structure{ global structure{ global int i} s0_0}) +0:57 Constant: +0:57 0 (const int) +0:51 false case +0:59 Sequence +0:59 move second child to first child ( temp float) +0:59 f: direct index for structure ( global float) +0:59 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:59 Constant: +0:59 1 (const int) +0:59 direct index ( temp float) +0:59 'coord' ( smooth in 2-component vector of float) +0:59 Constant: +0:59 0 (const int) +0:60 move second child to first child ( temp structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:60 s1_1: direct index for structure ( global structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:60 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:60 Constant: +0:60 2 (const int) +0:60 Construct structure ( temp structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:60 Constant: +0:60 1 (const int) +0:60 direct index ( temp float) +0:60 'coord' ( smooth in 2-component vector of float) +0:60 Constant: +0:60 1 (const int) +0:60 'foo0' ( uniform structure{ global int i}) +0:61 move second child to first child ( temp 6-element array of float) +0:61 'fArray' ( temp 6-element array of float) +0:61 Constant: +0:61 0.000000 +0:61 1.000000 +0:61 2.000000 +0:61 3.000000 +0:61 4.000000 +0:61 5.000000 +0:62 move second child to first child ( temp structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:62 direct index ( temp structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:62 'locals1Array' ( temp 10-element array of structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:62 Constant: +0:62 6 (const int) +0:62 s1_1: direct index for structure ( global structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:62 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:62 Constant: +0:62 2 (const int) +0:63 move second child to first child ( temp structure{ global int i}) +0:63 'locals0' ( temp structure{ global int i}) +0:63 s0_1: direct index for structure ( global structure{ global int i}) +0:63 'foo1' ( uniform structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:63 Constant: +0:63 2 (const int) +0:64 move second child to first child ( temp structure{ global structure{ global int i} s0_0}) +0:64 'locals00' ( temp structure{ global structure{ global int i} s0_0}) +0:64 'foo00' ( uniform structure{ global structure{ global int i} s0_0}) +0:67 Test condition and select ( temp void) +0:67 Condition +0:67 Compare Greater Than ( temp bool) +0:67 i: direct index for structure ( global int) +0:67 'locals0' ( temp structure{ global int i}) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 5 (const int) +0:67 true case +0:68 move second child to first child ( temp structure{ global int i}) +0:68 'locals0' ( temp structure{ global int i}) +0:68 s0_0: direct index for structure ( global structure{ global int i}) +0:68 'locals00' ( temp structure{ global structure{ global int i} s0_0}) +0:68 Constant: +0:68 0 (const int) +0:70 move second child to first child ( temp 4-component vector of float) +0:70 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:70 vector-scale ( temp 4-component vector of float) +0:70 add ( temp float) +0:70 add ( temp float) +0:70 add ( temp float) +0:70 Convert int to float ( temp float) +0:70 i: direct index for structure ( global int) +0:70 'locals0' ( temp structure{ global int i}) +0:70 Constant: +0:70 0 (const int) +0:70 f: direct index for structure ( global float) +0:70 direct index ( temp structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:70 'locals1Array' ( temp 10-element array of structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:70 Constant: +0:70 6 (const int) +0:70 Constant: +0:70 1 (const int) +0:70 direct index ( temp float) +0:70 'fArray' ( temp 6-element array of float) +0:70 Constant: +0:70 3 (const int) +0:70 f: direct index for structure ( global float) +0:70 s1_1: direct index for structure ( global structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:70 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:70 Constant: +0:70 2 (const int) +0:70 Constant: +0:70 1 (const int) +0:70 texture ( global 4-component vector of float) +0:70 'sampler' ( uniform sampler2D) +0:70 'coord' ( smooth in 2-component vector of float) +0:? Linker Objects +0:? 'sampler' ( uniform sampler2D) +0:? 'coord' ( smooth in 2-component vector of float) +0:? 'foo0' ( uniform structure{ global int i}) +0:? 'foo1' ( uniform structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:? 'foo2' ( uniform structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:? 'foo3' ( uniform structure{ global 12-element array of structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1} s2_1, global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:? 'foo00' ( uniform structure{ global structure{ global int i} s0_0}) + + +Linked fragment stage: + + +Shader version: 130 +0:? Sequence +0:41 Function Definition: main( ( global void) +0:41 Function Parameters: +0:? Sequence +0:51 Test condition and select ( temp void) +0:51 Condition +0:51 Compare Greater Than ( temp bool) +0:51 i: direct index for structure ( global int) +0:51 direct index ( temp structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:51 s2_1: direct index for structure ( global 12-element array of structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:51 'foo3' ( uniform structure{ global 12-element array of structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1} s2_1, global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 9 (const int) +0:51 Constant: +0:51 0 (const int) +0:51 Constant: +0:51 0 (const int) +0:51 true case +0:52 Sequence +0:52 move second child to first child ( temp float) +0:52 f: direct index for structure ( global float) +0:52 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:52 Constant: +0:52 1 (const int) +0:52 Constant: +0:52 1.000000 +0:53 move second child to first child ( temp structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:53 s1_1: direct index for structure ( global structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:53 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:53 Constant: +0:53 2 (const int) +0:53 Constant: +0:53 0 (const int) +0:53 1.000000 +0:53 0 (const int) +0:54 move second child to first child ( temp 6-element array of float) +0:54 'fArray' ( temp 6-element array of float) +0:54 Constant: +0:54 0.000000 +0:54 0.000000 +0:54 0.000000 +0:54 0.000000 +0:54 0.000000 +0:54 0.000000 +0:55 move second child to first child ( temp structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:55 direct index ( temp structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:55 'locals1Array' ( temp 10-element array of structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:55 Constant: +0:55 6 (const int) +0:55 'foo1' ( uniform structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:56 move second child to first child ( temp structure{ global int i}) +0:56 'locals0' ( temp structure{ global int i}) +0:56 Constant: +0:56 0 (const int) +0:57 move second child to first child ( temp structure{ global structure{ global int i} s0_0}) +0:57 'locals00' ( temp structure{ global structure{ global int i} s0_0}) +0:57 Constant: +0:57 0 (const int) +0:51 false case +0:59 Sequence +0:59 move second child to first child ( temp float) +0:59 f: direct index for structure ( global float) +0:59 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:59 Constant: +0:59 1 (const int) +0:59 direct index ( temp float) +0:59 'coord' ( smooth in 2-component vector of float) +0:59 Constant: +0:59 0 (const int) +0:60 move second child to first child ( temp structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:60 s1_1: direct index for structure ( global structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:60 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:60 Constant: +0:60 2 (const int) +0:60 Construct structure ( temp structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:60 Constant: +0:60 1 (const int) +0:60 direct index ( temp float) +0:60 'coord' ( smooth in 2-component vector of float) +0:60 Constant: +0:60 1 (const int) +0:60 'foo0' ( uniform structure{ global int i}) +0:61 move second child to first child ( temp 6-element array of float) +0:61 'fArray' ( temp 6-element array of float) +0:61 Constant: +0:61 0.000000 +0:61 1.000000 +0:61 2.000000 +0:61 3.000000 +0:61 4.000000 +0:61 5.000000 +0:62 move second child to first child ( temp structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:62 direct index ( temp structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:62 'locals1Array' ( temp 10-element array of structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:62 Constant: +0:62 6 (const int) +0:62 s1_1: direct index for structure ( global structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:62 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:62 Constant: +0:62 2 (const int) +0:63 move second child to first child ( temp structure{ global int i}) +0:63 'locals0' ( temp structure{ global int i}) +0:63 s0_1: direct index for structure ( global structure{ global int i}) +0:63 'foo1' ( uniform structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:63 Constant: +0:63 2 (const int) +0:64 move second child to first child ( temp structure{ global structure{ global int i} s0_0}) +0:64 'locals00' ( temp structure{ global structure{ global int i} s0_0}) +0:64 'foo00' ( uniform structure{ global structure{ global int i} s0_0}) +0:67 Test condition and select ( temp void) +0:67 Condition +0:67 Compare Greater Than ( temp bool) +0:67 i: direct index for structure ( global int) +0:67 'locals0' ( temp structure{ global int i}) +0:67 Constant: +0:67 0 (const int) +0:67 Constant: +0:67 5 (const int) +0:67 true case +0:68 move second child to first child ( temp structure{ global int i}) +0:68 'locals0' ( temp structure{ global int i}) +0:68 s0_0: direct index for structure ( global structure{ global int i}) +0:68 'locals00' ( temp structure{ global structure{ global int i} s0_0}) +0:68 Constant: +0:68 0 (const int) +0:70 move second child to first child ( temp 4-component vector of float) +0:70 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:70 vector-scale ( temp 4-component vector of float) +0:70 add ( temp float) +0:70 add ( temp float) +0:70 add ( temp float) +0:70 Convert int to float ( temp float) +0:70 i: direct index for structure ( global int) +0:70 'locals0' ( temp structure{ global int i}) +0:70 Constant: +0:70 0 (const int) +0:70 f: direct index for structure ( global float) +0:70 direct index ( temp structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:70 'locals1Array' ( temp 10-element array of structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:70 Constant: +0:70 6 (const int) +0:70 Constant: +0:70 1 (const int) +0:70 direct index ( temp float) +0:70 'fArray' ( temp 6-element array of float) +0:70 Constant: +0:70 3 (const int) +0:70 f: direct index for structure ( global float) +0:70 s1_1: direct index for structure ( global structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:70 'locals2' ( temp structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:70 Constant: +0:70 2 (const int) +0:70 Constant: +0:70 1 (const int) +0:70 texture ( global 4-component vector of float) +0:70 'sampler' ( uniform sampler2D) +0:70 'coord' ( smooth in 2-component vector of float) +0:? Linker Objects +0:? 'sampler' ( uniform sampler2D) +0:? 'coord' ( smooth in 2-component vector of float) +0:? 'foo0' ( uniform structure{ global int i}) +0:? 'foo1' ( uniform structure{ global int i, global float f, global structure{ global int i} s0_1}) +0:? 'foo2' ( uniform structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:? 'foo3' ( uniform structure{ global 12-element array of structure{ global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1} s2_1, global int i, global float f, global structure{ global int i, global float f, global structure{ global int i} s0_1} s1_1}) +0:? 'foo00' ( uniform structure{ global structure{ global int i} s0_0}) + diff --git a/deps/glslang/Test/baseResults/structure.frag.out b/deps/glslang/Test/baseResults/structure.frag.out new file mode 100644 index 00000000..d12dceb4 --- /dev/null +++ b/deps/glslang/Test/baseResults/structure.frag.out @@ -0,0 +1,165 @@ +structure.frag +WARNING: 0:3: varying deprecated in version 130; may be removed in future release + +Shader version: 130 +0:? Sequence +0:20 Function Definition: main( ( global void) +0:20 Function Parameters: +0:22 Sequence +0:22 Sequence +0:22 move second child to first child ( temp float) +0:22 'scale' ( temp float) +0:22 Constant: +0:22 0.000000 +0:24 Test condition and select ( temp void) +0:24 Condition +0:24 Compare Greater Than ( temp bool) +0:24 direct index ( temp int) +0:24 i: direct index for structure ( global 5-element array of int) +0:24 direct index ( temp structure{ global 5-element array of int i, global float f, global 7-element array of structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color} s1_1}) +0:24 'foo2' ( uniform 5-element array of structure{ global 5-element array of int i, global float f, global 7-element array of structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color} s1_1}) +0:24 Constant: +0:24 3 (const int) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 4 (const int) +0:24 Constant: +0:24 0 (const int) +0:24 true case +0:25 move second child to first child ( temp float) +0:25 'scale' ( temp float) +0:25 direct index ( temp float) +0:25 direct index ( temp 4-component vector of float) +0:25 color: direct index for structure ( global 5-element array of 4-component vector of float) +0:25 direct index ( temp structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color}) +0:25 s1_1: direct index for structure ( global 7-element array of structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color}) +0:25 direct index ( temp structure{ global 5-element array of int i, global float f, global 7-element array of structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color} s1_1}) +0:25 'foo2' ( uniform 5-element array of structure{ global 5-element array of int i, global float f, global 7-element array of structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color} s1_1}) +0:25 Constant: +0:25 3 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 3 (const int) +0:25 Constant: +0:25 0 (const int) +0:24 false case +0:27 move second child to first child ( temp float) +0:27 'scale' ( temp float) +0:27 direct index ( temp float) +0:27 f: direct index for structure ( global 4-element array of float) +0:27 direct index ( temp structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color}) +0:27 s1_1: direct index for structure ( global 7-element array of structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color}) +0:27 direct index ( temp structure{ global 5-element array of int i, global float f, global 7-element array of structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color} s1_1}) +0:27 'foo2' ( uniform 5-element array of structure{ global 5-element array of int i, global float f, global 7-element array of structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color} s1_1}) +0:27 Constant: +0:27 3 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 3 (const int) +0:29 move second child to first child ( temp 4-component vector of float) +0:29 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:29 vector-scale ( temp 4-component vector of float) +0:29 'scale' ( temp float) +0:29 texture ( global 4-component vector of float) +0:29 'sampler' ( uniform sampler2D) +0:29 'coord' ( smooth in 2-component vector of float) +0:? Linker Objects +0:? 'sampler' ( uniform sampler2D) +0:? 'coord' ( smooth in 2-component vector of float) +0:? 'foo' ( uniform structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color}) +0:? 'foo2' ( uniform 5-element array of structure{ global 5-element array of int i, global float f, global 7-element array of structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color} s1_1}) + + +Linked fragment stage: + + +Shader version: 130 +0:? Sequence +0:20 Function Definition: main( ( global void) +0:20 Function Parameters: +0:22 Sequence +0:22 Sequence +0:22 move second child to first child ( temp float) +0:22 'scale' ( temp float) +0:22 Constant: +0:22 0.000000 +0:24 Test condition and select ( temp void) +0:24 Condition +0:24 Compare Greater Than ( temp bool) +0:24 direct index ( temp int) +0:24 i: direct index for structure ( global 5-element array of int) +0:24 direct index ( temp structure{ global 5-element array of int i, global float f, global 7-element array of structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color} s1_1}) +0:24 'foo2' ( uniform 5-element array of structure{ global 5-element array of int i, global float f, global 7-element array of structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color} s1_1}) +0:24 Constant: +0:24 3 (const int) +0:24 Constant: +0:24 0 (const int) +0:24 Constant: +0:24 4 (const int) +0:24 Constant: +0:24 0 (const int) +0:24 true case +0:25 move second child to first child ( temp float) +0:25 'scale' ( temp float) +0:25 direct index ( temp float) +0:25 direct index ( temp 4-component vector of float) +0:25 color: direct index for structure ( global 5-element array of 4-component vector of float) +0:25 direct index ( temp structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color}) +0:25 s1_1: direct index for structure ( global 7-element array of structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color}) +0:25 direct index ( temp structure{ global 5-element array of int i, global float f, global 7-element array of structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color} s1_1}) +0:25 'foo2' ( uniform 5-element array of structure{ global 5-element array of int i, global float f, global 7-element array of structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color} s1_1}) +0:25 Constant: +0:25 3 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 2 (const int) +0:25 Constant: +0:25 3 (const int) +0:25 Constant: +0:25 0 (const int) +0:24 false case +0:27 move second child to first child ( temp float) +0:27 'scale' ( temp float) +0:27 direct index ( temp float) +0:27 f: direct index for structure ( global 4-element array of float) +0:27 direct index ( temp structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color}) +0:27 s1_1: direct index for structure ( global 7-element array of structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color}) +0:27 direct index ( temp structure{ global 5-element array of int i, global float f, global 7-element array of structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color} s1_1}) +0:27 'foo2' ( uniform 5-element array of structure{ global 5-element array of int i, global float f, global 7-element array of structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color} s1_1}) +0:27 Constant: +0:27 3 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Constant: +0:27 2 (const int) +0:27 Constant: +0:27 1 (const int) +0:27 Constant: +0:27 3 (const int) +0:29 move second child to first child ( temp 4-component vector of float) +0:29 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:29 vector-scale ( temp 4-component vector of float) +0:29 'scale' ( temp float) +0:29 texture ( global 4-component vector of float) +0:29 'sampler' ( uniform sampler2D) +0:29 'coord' ( smooth in 2-component vector of float) +0:? Linker Objects +0:? 'sampler' ( uniform sampler2D) +0:? 'coord' ( smooth in 2-component vector of float) +0:? 'foo' ( uniform structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color}) +0:? 'foo2' ( uniform 5-element array of structure{ global 5-element array of int i, global float f, global 7-element array of structure{ global int i, global 4-element array of float f, global 5-element array of 4-component vector of float color} s1_1}) + diff --git a/deps/glslang/Test/baseResults/switch.frag.out b/deps/glslang/Test/baseResults/switch.frag.out new file mode 100644 index 00000000..9649c9bb --- /dev/null +++ b/deps/glslang/Test/baseResults/switch.frag.out @@ -0,0 +1,691 @@ +switch.frag +ERROR: 0:11: 'switch' : condition must be a scalar integer expression +ERROR: 0:14: 'switch' : condition must be a scalar integer expression +ERROR: 0:21: 'switch' : last case/default label not followed by statements +ERROR: 0:28: 'switch' : cannot have statements before first case/default label +ERROR: 0:43: 'default' : duplicate label +ERROR: 0:63: 'case' : duplicated value +ERROR: 0:65: 'case' : scalar integer expression required +ERROR: 0:67: 'case' : constant expression required +ERROR: 0:89: '' : break statement only allowed in switch and loops +ERROR: 0:99: 'case' : cannot be nested inside control flow +ERROR: 0:104: 'case' : cannot be nested inside control flow +ERROR: 0:108: 'case' : cannot be nested inside control flow +ERROR: 0:115: 'default' : cannot be nested inside control flow +ERROR: 0:119: 'case' : cannot appear outside switch statement +ERROR: 0:120: 'default' : cannot appear outside switch statement +ERROR: 0:126: 'onlyInSwitch' : undeclared identifier +ERROR: 0:128: 'switch' : last case/default label not followed by statements +ERROR: 0:140: 'nestedX' : undeclared identifier +ERROR: 0:157: 'nestedZ' : undeclared identifier +ERROR: 19 compilation errors. No code generated. + + +Shader version: 300 +ERROR: node is still EOpNull! +0:6 Function Definition: main( ( global void) +0:6 Function Parameters: +0:? Sequence +0:11 'f' ( temp highp float) +0:14 'a' ( temp 2-element array of mediump int) +0:17 'c' ( uniform mediump int) +0:21 switch +0:21 condition +0:21 'c' ( uniform mediump int) +0:21 body +0:21 Sequence +0:23 case: with expression +0:23 Constant: +0:23 2 (const int) +0:21 Sequence +0:21 Branch: Break +0:26 switch +0:26 condition +0:26 'c' ( uniform mediump int) +0:26 body +0:26 Sequence +0:28 Sequence +0:28 move second child to first child ( temp highp float) +0:28 'f' ( temp highp float) +0:28 sine ( global highp float) +0:28 'x' ( smooth in highp float) +0:29 case: with expression +0:29 Constant: +0:29 2 (const int) +0:? Sequence +0:30 move second child to first child ( temp highp float) +0:30 'f' ( temp highp float) +0:30 cosine ( global highp float) +0:30 'x' ( smooth in highp float) +0:31 Branch: Break +0:34 switch +0:34 condition +0:34 'c' ( uniform mediump int) +0:34 body +0:34 Sequence +0:35 default: +0:? Sequence +0:36 Branch: Break +0:37 case: with expression +0:37 Constant: +0:37 1 (const int) +0:? Sequence +0:38 move second child to first child ( temp highp float) +0:38 'f' ( temp highp float) +0:38 sine ( global highp float) +0:38 'x' ( smooth in highp float) +0:39 Branch: Break +0:40 case: with expression +0:40 Constant: +0:40 2 (const int) +0:? Sequence +0:41 move second child to first child ( temp highp float) +0:41 'f' ( temp highp float) +0:41 cosine ( global highp float) +0:41 'x' ( smooth in highp float) +0:42 Branch: Break +0:43 default: +0:? Sequence +0:44 move second child to first child ( temp highp float) +0:44 'f' ( temp highp float) +0:44 tangent ( global highp float) +0:44 'x' ( smooth in highp float) +0:47 switch +0:47 condition +0:47 'c' ( uniform mediump int) +0:47 body +0:47 Sequence +0:48 case: with expression +0:48 Constant: +0:48 1 (const int) +0:? Sequence +0:49 move second child to first child ( temp highp float) +0:49 'f' ( temp highp float) +0:49 sine ( global highp float) +0:49 'x' ( smooth in highp float) +0:50 Branch: Break +0:51 case: with expression +0:51 Constant: +0:51 2 (const int) +0:? Sequence +0:52 switch +0:52 condition +0:52 'd' ( uniform mediump int) +0:52 body +0:52 Sequence +0:53 case: with expression +0:53 Constant: +0:53 1 (const int) +0:? Sequence +0:54 move second child to first child ( temp highp float) +0:54 'f' ( temp highp float) +0:54 component-wise multiply ( temp highp float) +0:54 component-wise multiply ( temp highp float) +0:54 'x' ( smooth in highp float) +0:54 'x' ( smooth in highp float) +0:54 'x' ( smooth in highp float) +0:55 Branch: Break +0:56 case: with expression +0:56 Constant: +0:56 2 (const int) +0:? Sequence +0:57 move second child to first child ( temp highp float) +0:57 'f' ( temp highp float) +0:57 component-wise multiply ( temp highp float) +0:57 'x' ( smooth in highp float) +0:57 'x' ( smooth in highp float) +0:58 Branch: Break +0:60 Branch: Break +0:61 default: +0:? Sequence +0:62 move second child to first child ( temp highp float) +0:62 'f' ( temp highp float) +0:62 tangent ( global highp float) +0:62 'x' ( smooth in highp float) +0:63 case: with expression +0:63 Constant: +0:63 1 (const int) +0:? Sequence +0:64 Branch: Break +0:65 case: with expression +0:65 Constant: +0:65 3.800000 +0:? Sequence +0:66 Branch: Break +0:67 case: with expression +0:67 'c' ( uniform mediump int) +0:? Sequence +0:68 Branch: Break +0:71 switch +0:71 condition +0:71 'c' ( uniform mediump int) +0:71 body +0:71 Sequence +0:72 case: with expression +0:72 Constant: +0:72 1 (const int) +0:? Sequence +0:73 move second child to first child ( temp highp float) +0:73 'f' ( temp highp float) +0:73 sine ( global highp float) +0:73 'x' ( smooth in highp float) +0:74 Branch: Break +0:75 case: with expression +0:75 Constant: +0:75 2 (const int) +0:? Sequence +0:76 switch +0:76 condition +0:76 'd' ( uniform mediump int) +0:76 body +0:76 Sequence +0:77 case: with expression +0:77 Constant: +0:77 1 (const int) +0:? Sequence +0:78 move second child to first child ( temp highp float) +0:78 'f' ( temp highp float) +0:78 component-wise multiply ( temp highp float) +0:78 component-wise multiply ( temp highp float) +0:78 'x' ( smooth in highp float) +0:78 'x' ( smooth in highp float) +0:78 'x' ( smooth in highp float) +0:79 Branch: Break +0:80 case: with expression +0:80 Constant: +0:80 2 (const int) +0:? Sequence +0:81 move second child to first child ( temp highp float) +0:81 'f' ( temp highp float) +0:81 component-wise multiply ( temp highp float) +0:81 'x' ( smooth in highp float) +0:81 'x' ( smooth in highp float) +0:82 Branch: Break +0:84 Branch: Break +0:85 default: +0:? Sequence +0:86 move second child to first child ( temp highp float) +0:86 'f' ( temp highp float) +0:86 tangent ( global highp float) +0:86 'x' ( smooth in highp float) +0:89 Branch: Break +0:91 switch +0:91 condition +0:91 'c' ( uniform mediump int) +0:91 body +0:91 Sequence +0:92 case: with expression +0:92 Constant: +0:92 1 (const int) +0:? Sequence +0:93 move second child to first child ( temp highp float) +0:93 'f' ( temp highp float) +0:93 sine ( global highp float) +0:93 'x' ( smooth in highp float) +0:94 Branch: Break +0:95 case: with expression +0:95 Constant: +0:95 2 (const int) +0:? Sequence +0:96 switch +0:96 condition +0:96 'd' ( uniform mediump int) +0:96 body +0:96 Sequence +0:97 case: with expression +0:97 Constant: +0:97 1 (const int) +0:? Sequence +0:? Sequence +0:100 Branch: Break +0:102 move second child to first child ( temp highp float) +0:102 'f' ( temp highp float) +0:102 component-wise multiply ( temp highp float) +0:102 component-wise multiply ( temp highp float) +0:102 'x' ( smooth in highp float) +0:102 'x' ( smooth in highp float) +0:102 'x' ( smooth in highp float) +0:103 Test condition and select ( temp void) +0:103 Condition +0:103 Compare Less Than ( temp bool) +0:103 'c' ( uniform mediump int) +0:103 'd' ( uniform mediump int) +0:103 true case +0:? Sequence +0:105 move second child to first child ( temp highp float) +0:105 'f' ( temp highp float) +0:105 component-wise multiply ( temp highp float) +0:105 'x' ( smooth in highp float) +0:105 'x' ( smooth in highp float) +0:107 Test condition and select ( temp void) +0:107 Condition +0:107 Compare Less Than ( temp bool) +0:107 'd' ( uniform mediump int) +0:107 'c' ( uniform mediump int) +0:107 true case is null +0:109 Branch: Break +0:111 Branch: Break +0:112 case: with expression +0:112 Constant: +0:112 4 (const int) +0:? Sequence +0:113 move second child to first child ( temp highp float) +0:113 'f' ( temp highp float) +0:113 tangent ( global highp float) +0:113 'x' ( smooth in highp float) +0:114 Test condition and select ( temp void) +0:114 Condition +0:114 Compare Less Than ( temp bool) +0:114 'f' ( temp highp float) +0:114 Constant: +0:114 0.000000 +0:114 true case is null +0:116 Branch: Break +0:122 switch +0:122 condition +0:122 Constant: +0:122 0 (const int) +0:122 body +0:122 Sequence +0:123 default: +0:? Sequence +0:124 Sequence +0:124 move second child to first child ( temp mediump int) +0:124 'onlyInSwitch' ( temp mediump int) +0:124 Constant: +0:124 0 (const int) +0:126 'onlyInSwitch' ( temp float) +0:128 switch +0:128 condition +0:128 Constant: +0:128 0 (const int) +0:128 body +0:128 Sequence +0:129 default: +0:128 Sequence +0:128 Branch: Break +0:133 switch +0:133 condition +0:133 'c' ( uniform mediump int) +0:133 body +0:133 Sequence +0:134 case: with expression +0:134 Constant: +0:134 1 (const int) +0:? Sequence +0:? Sequence +0:137 Branch: Break +0:139 case: with expression +0:139 Constant: +0:139 2 (const int) +0:? Sequence +0:140 'nestedX' ( temp float) +0:143 Branch: Break +0:144 case: with expression +0:144 Constant: +0:144 3 (const int) +0:? Sequence +0:146 Branch: Break +0:147 Branch: Break +0:148 case: with expression +0:148 Constant: +0:148 4 (const int) +0:? Sequence +0:149 Sequence +0:149 move second child to first child ( temp mediump int) +0:149 'linearY' ( temp mediump int) +0:149 'linearZ' ( temp mediump int) +0:150 Branch: Break +0:151 case: with expression +0:151 Constant: +0:151 5 (const int) +0:? Sequence +0:153 Branch: Break +0:154 case: with expression +0:154 Constant: +0:154 6 (const int) +0:? Sequence +0:155 Constant: +0:155 4 (const int) +0:157 'nestedZ' ( temp float) +0:? Linker Objects +0:? 'c' ( uniform mediump int) +0:? 'd' ( uniform mediump int) +0:? 'x' ( smooth in highp float) + + +Linked fragment stage: + + +Shader version: 300 +ERROR: node is still EOpNull! +0:6 Function Definition: main( ( global void) +0:6 Function Parameters: +0:? Sequence +0:11 'f' ( temp highp float) +0:14 'a' ( temp 2-element array of mediump int) +0:17 'c' ( uniform mediump int) +0:21 switch +0:21 condition +0:21 'c' ( uniform mediump int) +0:21 body +0:21 Sequence +0:23 case: with expression +0:23 Constant: +0:23 2 (const int) +0:21 Sequence +0:21 Branch: Break +0:26 switch +0:26 condition +0:26 'c' ( uniform mediump int) +0:26 body +0:26 Sequence +0:28 Sequence +0:28 move second child to first child ( temp highp float) +0:28 'f' ( temp highp float) +0:28 sine ( global highp float) +0:28 'x' ( smooth in highp float) +0:29 case: with expression +0:29 Constant: +0:29 2 (const int) +0:? Sequence +0:30 move second child to first child ( temp highp float) +0:30 'f' ( temp highp float) +0:30 cosine ( global highp float) +0:30 'x' ( smooth in highp float) +0:31 Branch: Break +0:34 switch +0:34 condition +0:34 'c' ( uniform mediump int) +0:34 body +0:34 Sequence +0:35 default: +0:? Sequence +0:36 Branch: Break +0:37 case: with expression +0:37 Constant: +0:37 1 (const int) +0:? Sequence +0:38 move second child to first child ( temp highp float) +0:38 'f' ( temp highp float) +0:38 sine ( global highp float) +0:38 'x' ( smooth in highp float) +0:39 Branch: Break +0:40 case: with expression +0:40 Constant: +0:40 2 (const int) +0:? Sequence +0:41 move second child to first child ( temp highp float) +0:41 'f' ( temp highp float) +0:41 cosine ( global highp float) +0:41 'x' ( smooth in highp float) +0:42 Branch: Break +0:43 default: +0:? Sequence +0:44 move second child to first child ( temp highp float) +0:44 'f' ( temp highp float) +0:44 tangent ( global highp float) +0:44 'x' ( smooth in highp float) +0:47 switch +0:47 condition +0:47 'c' ( uniform mediump int) +0:47 body +0:47 Sequence +0:48 case: with expression +0:48 Constant: +0:48 1 (const int) +0:? Sequence +0:49 move second child to first child ( temp highp float) +0:49 'f' ( temp highp float) +0:49 sine ( global highp float) +0:49 'x' ( smooth in highp float) +0:50 Branch: Break +0:51 case: with expression +0:51 Constant: +0:51 2 (const int) +0:? Sequence +0:52 switch +0:52 condition +0:52 'd' ( uniform mediump int) +0:52 body +0:52 Sequence +0:53 case: with expression +0:53 Constant: +0:53 1 (const int) +0:? Sequence +0:54 move second child to first child ( temp highp float) +0:54 'f' ( temp highp float) +0:54 component-wise multiply ( temp highp float) +0:54 component-wise multiply ( temp highp float) +0:54 'x' ( smooth in highp float) +0:54 'x' ( smooth in highp float) +0:54 'x' ( smooth in highp float) +0:55 Branch: Break +0:56 case: with expression +0:56 Constant: +0:56 2 (const int) +0:? Sequence +0:57 move second child to first child ( temp highp float) +0:57 'f' ( temp highp float) +0:57 component-wise multiply ( temp highp float) +0:57 'x' ( smooth in highp float) +0:57 'x' ( smooth in highp float) +0:58 Branch: Break +0:60 Branch: Break +0:61 default: +0:? Sequence +0:62 move second child to first child ( temp highp float) +0:62 'f' ( temp highp float) +0:62 tangent ( global highp float) +0:62 'x' ( smooth in highp float) +0:63 case: with expression +0:63 Constant: +0:63 1 (const int) +0:? Sequence +0:64 Branch: Break +0:65 case: with expression +0:65 Constant: +0:65 3.800000 +0:? Sequence +0:66 Branch: Break +0:67 case: with expression +0:67 'c' ( uniform mediump int) +0:? Sequence +0:68 Branch: Break +0:71 switch +0:71 condition +0:71 'c' ( uniform mediump int) +0:71 body +0:71 Sequence +0:72 case: with expression +0:72 Constant: +0:72 1 (const int) +0:? Sequence +0:73 move second child to first child ( temp highp float) +0:73 'f' ( temp highp float) +0:73 sine ( global highp float) +0:73 'x' ( smooth in highp float) +0:74 Branch: Break +0:75 case: with expression +0:75 Constant: +0:75 2 (const int) +0:? Sequence +0:76 switch +0:76 condition +0:76 'd' ( uniform mediump int) +0:76 body +0:76 Sequence +0:77 case: with expression +0:77 Constant: +0:77 1 (const int) +0:? Sequence +0:78 move second child to first child ( temp highp float) +0:78 'f' ( temp highp float) +0:78 component-wise multiply ( temp highp float) +0:78 component-wise multiply ( temp highp float) +0:78 'x' ( smooth in highp float) +0:78 'x' ( smooth in highp float) +0:78 'x' ( smooth in highp float) +0:79 Branch: Break +0:80 case: with expression +0:80 Constant: +0:80 2 (const int) +0:? Sequence +0:81 move second child to first child ( temp highp float) +0:81 'f' ( temp highp float) +0:81 component-wise multiply ( temp highp float) +0:81 'x' ( smooth in highp float) +0:81 'x' ( smooth in highp float) +0:82 Branch: Break +0:84 Branch: Break +0:85 default: +0:? Sequence +0:86 move second child to first child ( temp highp float) +0:86 'f' ( temp highp float) +0:86 tangent ( global highp float) +0:86 'x' ( smooth in highp float) +0:89 Branch: Break +0:91 switch +0:91 condition +0:91 'c' ( uniform mediump int) +0:91 body +0:91 Sequence +0:92 case: with expression +0:92 Constant: +0:92 1 (const int) +0:? Sequence +0:93 move second child to first child ( temp highp float) +0:93 'f' ( temp highp float) +0:93 sine ( global highp float) +0:93 'x' ( smooth in highp float) +0:94 Branch: Break +0:95 case: with expression +0:95 Constant: +0:95 2 (const int) +0:? Sequence +0:96 switch +0:96 condition +0:96 'd' ( uniform mediump int) +0:96 body +0:96 Sequence +0:97 case: with expression +0:97 Constant: +0:97 1 (const int) +0:? Sequence +0:? Sequence +0:100 Branch: Break +0:102 move second child to first child ( temp highp float) +0:102 'f' ( temp highp float) +0:102 component-wise multiply ( temp highp float) +0:102 component-wise multiply ( temp highp float) +0:102 'x' ( smooth in highp float) +0:102 'x' ( smooth in highp float) +0:102 'x' ( smooth in highp float) +0:103 Test condition and select ( temp void) +0:103 Condition +0:103 Compare Less Than ( temp bool) +0:103 'c' ( uniform mediump int) +0:103 'd' ( uniform mediump int) +0:103 true case +0:? Sequence +0:105 move second child to first child ( temp highp float) +0:105 'f' ( temp highp float) +0:105 component-wise multiply ( temp highp float) +0:105 'x' ( smooth in highp float) +0:105 'x' ( smooth in highp float) +0:107 Test condition and select ( temp void) +0:107 Condition +0:107 Compare Less Than ( temp bool) +0:107 'd' ( uniform mediump int) +0:107 'c' ( uniform mediump int) +0:107 true case is null +0:109 Branch: Break +0:111 Branch: Break +0:112 case: with expression +0:112 Constant: +0:112 4 (const int) +0:? Sequence +0:113 move second child to first child ( temp highp float) +0:113 'f' ( temp highp float) +0:113 tangent ( global highp float) +0:113 'x' ( smooth in highp float) +0:114 Test condition and select ( temp void) +0:114 Condition +0:114 Compare Less Than ( temp bool) +0:114 'f' ( temp highp float) +0:114 Constant: +0:114 0.000000 +0:114 true case is null +0:116 Branch: Break +0:122 switch +0:122 condition +0:122 Constant: +0:122 0 (const int) +0:122 body +0:122 Sequence +0:123 default: +0:? Sequence +0:124 Sequence +0:124 move second child to first child ( temp mediump int) +0:124 'onlyInSwitch' ( temp mediump int) +0:124 Constant: +0:124 0 (const int) +0:126 'onlyInSwitch' ( temp float) +0:128 switch +0:128 condition +0:128 Constant: +0:128 0 (const int) +0:128 body +0:128 Sequence +0:129 default: +0:128 Sequence +0:128 Branch: Break +0:133 switch +0:133 condition +0:133 'c' ( uniform mediump int) +0:133 body +0:133 Sequence +0:134 case: with expression +0:134 Constant: +0:134 1 (const int) +0:? Sequence +0:? Sequence +0:137 Branch: Break +0:139 case: with expression +0:139 Constant: +0:139 2 (const int) +0:? Sequence +0:140 'nestedX' ( temp float) +0:143 Branch: Break +0:144 case: with expression +0:144 Constant: +0:144 3 (const int) +0:? Sequence +0:146 Branch: Break +0:147 Branch: Break +0:148 case: with expression +0:148 Constant: +0:148 4 (const int) +0:? Sequence +0:149 Sequence +0:149 move second child to first child ( temp mediump int) +0:149 'linearY' ( temp mediump int) +0:149 'linearZ' ( temp mediump int) +0:150 Branch: Break +0:151 case: with expression +0:151 Constant: +0:151 5 (const int) +0:? Sequence +0:153 Branch: Break +0:154 case: with expression +0:154 Constant: +0:154 6 (const int) +0:? Sequence +0:155 Constant: +0:155 4 (const int) +0:157 'nestedZ' ( temp float) +0:? Linker Objects +0:? 'c' ( uniform mediump int) +0:? 'd' ( uniform mediump int) +0:? 'x' ( smooth in highp float) + diff --git a/deps/glslang/Test/baseResults/swizzle.frag.out b/deps/glslang/Test/baseResults/swizzle.frag.out new file mode 100644 index 00000000..b66a945d --- /dev/null +++ b/deps/glslang/Test/baseResults/swizzle.frag.out @@ -0,0 +1,423 @@ +swizzle.frag +Shader version: 110 +0:? Sequence +0:9 Function Definition: main( ( global void) +0:9 Function Parameters: +0:11 Sequence +0:11 Sequence +0:11 move second child to first child ( temp float) +0:11 'blendscale' ( temp float) +0:11 Constant: +0:11 1.789000 +0:13 Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 'w' ( temp 4-component vector of float) +0:13 'u' ( uniform 4-component vector of float) +0:15 Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:15 'w_dep' ( temp 4-component vector of float) +0:15 'u' ( uniform 4-component vector of float) +0:16 Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:16 'w_reorder' ( temp 4-component vector of float) +0:16 'u' ( uniform 4-component vector of float) +0:17 Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:17 'w2' ( temp 4-component vector of float) +0:17 'u' ( uniform 4-component vector of float) +0:18 Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:18 'w_flow' ( temp 4-component vector of float) +0:18 'u' ( uniform 4-component vector of float) +0:20 move second child to first child ( temp float) +0:20 direct index ( temp float) +0:20 'w_reorder' ( temp 4-component vector of float) +0:20 Constant: +0:20 2 (const int) +0:20 'blendscale' ( temp float) +0:22 move second child to first child ( temp 2-component vector of float) +0:22 vector swizzle ( temp 2-component vector of float) +0:22 'w' ( temp 4-component vector of float) +0:22 Sequence +0:22 Constant: +0:22 3 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 't' ( smooth in 2-component vector of float) +0:24 move second child to first child ( temp float) +0:24 direct index ( temp float) +0:24 'w_reorder' ( temp 4-component vector of float) +0:24 Constant: +0:24 0 (const int) +0:24 'blendscale' ( temp float) +0:26 move second child to first child ( temp 4-component vector of float) +0:26 vector swizzle ( temp 4-component vector of float) +0:26 'w2' ( temp 4-component vector of float) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Constant: +0:26 3 (const int) +0:26 vector swizzle ( temp 4-component vector of float) +0:26 'u' ( uniform 4-component vector of float) +0:26 Sequence +0:26 Constant: +0:26 2 (const int) +0:26 Constant: +0:26 3 (const int) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:28 move second child to first child ( temp float) +0:28 direct index ( temp float) +0:28 'w_reorder' ( temp 4-component vector of float) +0:28 Constant: +0:28 1 (const int) +0:28 'blendscale' ( temp float) +0:30 move second child to first child ( temp 2-component vector of float) +0:30 vector swizzle ( temp 2-component vector of float) +0:30 'w_dep' ( temp 4-component vector of float) +0:30 Sequence +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 1 (const int) +0:30 vector swizzle ( temp 2-component vector of float) +0:30 'w2' ( temp 4-component vector of float) +0:30 Sequence +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 2 (const int) +0:31 move second child to first child ( temp 2-component vector of float) +0:31 vector swizzle ( temp 2-component vector of float) +0:31 'w_dep' ( temp 4-component vector of float) +0:31 Sequence +0:31 Constant: +0:31 2 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 't' ( smooth in 2-component vector of float) +0:33 move second child to first child ( temp 2-component vector of float) +0:33 vector swizzle ( temp 2-component vector of float) +0:33 'w_undef' ( temp 4-component vector of float) +0:33 Sequence +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 1 (const int) +0:33 vector swizzle ( temp 2-component vector of float) +0:33 'u' ( uniform 4-component vector of float) +0:33 Sequence +0:33 Constant: +0:33 2 (const int) +0:33 Constant: +0:33 3 (const int) +0:35 Test condition and select ( temp void) +0:35 Condition +0:35 'p' ( uniform bool) +0:35 true case +0:36 move second child to first child ( temp float) +0:36 direct index ( temp float) +0:36 'w_flow' ( temp 4-component vector of float) +0:36 Constant: +0:36 0 (const int) +0:36 direct index ( temp float) +0:36 't' ( smooth in 2-component vector of float) +0:36 Constant: +0:36 0 (const int) +0:35 false case +0:38 move second child to first child ( temp float) +0:38 direct index ( temp float) +0:38 'w_flow' ( temp 4-component vector of float) +0:38 Constant: +0:38 0 (const int) +0:38 direct index ( temp float) +0:38 't' ( smooth in 2-component vector of float) +0:38 Constant: +0:38 1 (const int) +0:40 move second child to first child ( temp 4-component vector of float) +0:40 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:40 mix ( global 4-component vector of float) +0:40 'w_reorder' ( temp 4-component vector of float) +0:40 'w_undef' ( temp 4-component vector of float) +0:40 component-wise multiply ( temp 4-component vector of float) +0:40 component-wise multiply ( temp 4-component vector of float) +0:40 component-wise multiply ( temp 4-component vector of float) +0:40 'w' ( temp 4-component vector of float) +0:40 'w2' ( temp 4-component vector of float) +0:40 'w_dep' ( temp 4-component vector of float) +0:40 'w_flow' ( temp 4-component vector of float) +0:42 Sequence +0:42 move second child to first child ( temp 2-component vector of float) +0:42 'c' ( temp 2-component vector of float) +0:42 't' ( smooth in 2-component vector of float) +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of float) +0:43 'rep' ( temp 4-component vector of float) +0:43 Constant: +0:43 0.000000 +0:43 0.000000 +0:43 0.000000 +0:43 1.000000 +0:45 Test condition and select ( temp void) +0:45 Condition +0:45 Compare Less Than ( temp bool) +0:45 direct index ( temp float) +0:45 'c' ( temp 2-component vector of float) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 0.000000 +0:45 true case +0:46 multiply second child into first child ( temp float) +0:46 direct index ( temp float) +0:46 'c' ( temp 2-component vector of float) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 -1.000000 +0:48 Test condition and select ( temp void) +0:48 Condition +0:48 Compare Less Than or Equal ( temp bool) +0:48 direct index ( temp float) +0:48 'c' ( temp 2-component vector of float) +0:48 Constant: +0:48 0 (const int) +0:48 Constant: +0:48 1.000000 +0:48 true case +0:49 move second child to first child ( temp float) +0:49 direct index ( temp float) +0:49 'rep' ( temp 4-component vector of float) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3.400000 +0:51 add second child into first child ( temp 4-component vector of float) +0:51 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:51 'rep' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'blend' ( uniform float) +0:? 'u' ( uniform 4-component vector of float) +0:? 'p' ( uniform bool) +0:? 't' ( smooth in 2-component vector of float) + + +Linked fragment stage: + + +Shader version: 110 +0:? Sequence +0:9 Function Definition: main( ( global void) +0:9 Function Parameters: +0:11 Sequence +0:11 Sequence +0:11 move second child to first child ( temp float) +0:11 'blendscale' ( temp float) +0:11 Constant: +0:11 1.789000 +0:13 Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 'w' ( temp 4-component vector of float) +0:13 'u' ( uniform 4-component vector of float) +0:15 Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:15 'w_dep' ( temp 4-component vector of float) +0:15 'u' ( uniform 4-component vector of float) +0:16 Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:16 'w_reorder' ( temp 4-component vector of float) +0:16 'u' ( uniform 4-component vector of float) +0:17 Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:17 'w2' ( temp 4-component vector of float) +0:17 'u' ( uniform 4-component vector of float) +0:18 Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:18 'w_flow' ( temp 4-component vector of float) +0:18 'u' ( uniform 4-component vector of float) +0:20 move second child to first child ( temp float) +0:20 direct index ( temp float) +0:20 'w_reorder' ( temp 4-component vector of float) +0:20 Constant: +0:20 2 (const int) +0:20 'blendscale' ( temp float) +0:22 move second child to first child ( temp 2-component vector of float) +0:22 vector swizzle ( temp 2-component vector of float) +0:22 'w' ( temp 4-component vector of float) +0:22 Sequence +0:22 Constant: +0:22 3 (const int) +0:22 Constant: +0:22 1 (const int) +0:22 't' ( smooth in 2-component vector of float) +0:24 move second child to first child ( temp float) +0:24 direct index ( temp float) +0:24 'w_reorder' ( temp 4-component vector of float) +0:24 Constant: +0:24 0 (const int) +0:24 'blendscale' ( temp float) +0:26 move second child to first child ( temp 4-component vector of float) +0:26 vector swizzle ( temp 4-component vector of float) +0:26 'w2' ( temp 4-component vector of float) +0:26 Sequence +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:26 Constant: +0:26 2 (const int) +0:26 Constant: +0:26 3 (const int) +0:26 vector swizzle ( temp 4-component vector of float) +0:26 'u' ( uniform 4-component vector of float) +0:26 Sequence +0:26 Constant: +0:26 2 (const int) +0:26 Constant: +0:26 3 (const int) +0:26 Constant: +0:26 0 (const int) +0:26 Constant: +0:26 1 (const int) +0:28 move second child to first child ( temp float) +0:28 direct index ( temp float) +0:28 'w_reorder' ( temp 4-component vector of float) +0:28 Constant: +0:28 1 (const int) +0:28 'blendscale' ( temp float) +0:30 move second child to first child ( temp 2-component vector of float) +0:30 vector swizzle ( temp 2-component vector of float) +0:30 'w_dep' ( temp 4-component vector of float) +0:30 Sequence +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 1 (const int) +0:30 vector swizzle ( temp 2-component vector of float) +0:30 'w2' ( temp 4-component vector of float) +0:30 Sequence +0:30 Constant: +0:30 0 (const int) +0:30 Constant: +0:30 2 (const int) +0:31 move second child to first child ( temp 2-component vector of float) +0:31 vector swizzle ( temp 2-component vector of float) +0:31 'w_dep' ( temp 4-component vector of float) +0:31 Sequence +0:31 Constant: +0:31 2 (const int) +0:31 Constant: +0:31 3 (const int) +0:31 't' ( smooth in 2-component vector of float) +0:33 move second child to first child ( temp 2-component vector of float) +0:33 vector swizzle ( temp 2-component vector of float) +0:33 'w_undef' ( temp 4-component vector of float) +0:33 Sequence +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 1 (const int) +0:33 vector swizzle ( temp 2-component vector of float) +0:33 'u' ( uniform 4-component vector of float) +0:33 Sequence +0:33 Constant: +0:33 2 (const int) +0:33 Constant: +0:33 3 (const int) +0:35 Test condition and select ( temp void) +0:35 Condition +0:35 'p' ( uniform bool) +0:35 true case +0:36 move second child to first child ( temp float) +0:36 direct index ( temp float) +0:36 'w_flow' ( temp 4-component vector of float) +0:36 Constant: +0:36 0 (const int) +0:36 direct index ( temp float) +0:36 't' ( smooth in 2-component vector of float) +0:36 Constant: +0:36 0 (const int) +0:35 false case +0:38 move second child to first child ( temp float) +0:38 direct index ( temp float) +0:38 'w_flow' ( temp 4-component vector of float) +0:38 Constant: +0:38 0 (const int) +0:38 direct index ( temp float) +0:38 't' ( smooth in 2-component vector of float) +0:38 Constant: +0:38 1 (const int) +0:40 move second child to first child ( temp 4-component vector of float) +0:40 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:40 mix ( global 4-component vector of float) +0:40 'w_reorder' ( temp 4-component vector of float) +0:40 'w_undef' ( temp 4-component vector of float) +0:40 component-wise multiply ( temp 4-component vector of float) +0:40 component-wise multiply ( temp 4-component vector of float) +0:40 component-wise multiply ( temp 4-component vector of float) +0:40 'w' ( temp 4-component vector of float) +0:40 'w2' ( temp 4-component vector of float) +0:40 'w_dep' ( temp 4-component vector of float) +0:40 'w_flow' ( temp 4-component vector of float) +0:42 Sequence +0:42 move second child to first child ( temp 2-component vector of float) +0:42 'c' ( temp 2-component vector of float) +0:42 't' ( smooth in 2-component vector of float) +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of float) +0:43 'rep' ( temp 4-component vector of float) +0:43 Constant: +0:43 0.000000 +0:43 0.000000 +0:43 0.000000 +0:43 1.000000 +0:45 Test condition and select ( temp void) +0:45 Condition +0:45 Compare Less Than ( temp bool) +0:45 direct index ( temp float) +0:45 'c' ( temp 2-component vector of float) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 0.000000 +0:45 true case +0:46 multiply second child into first child ( temp float) +0:46 direct index ( temp float) +0:46 'c' ( temp 2-component vector of float) +0:46 Constant: +0:46 0 (const int) +0:46 Constant: +0:46 -1.000000 +0:48 Test condition and select ( temp void) +0:48 Condition +0:48 Compare Less Than or Equal ( temp bool) +0:48 direct index ( temp float) +0:48 'c' ( temp 2-component vector of float) +0:48 Constant: +0:48 0 (const int) +0:48 Constant: +0:48 1.000000 +0:48 true case +0:49 move second child to first child ( temp float) +0:49 direct index ( temp float) +0:49 'rep' ( temp 4-component vector of float) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 3.400000 +0:51 add second child into first child ( temp 4-component vector of float) +0:51 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:51 'rep' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'blend' ( uniform float) +0:? 'u' ( uniform 4-component vector of float) +0:? 'p' ( uniform bool) +0:? 't' ( smooth in 2-component vector of float) + diff --git a/deps/glslang/Test/baseResults/syntaxError.frag.out b/deps/glslang/Test/baseResults/syntaxError.frag.out new file mode 100644 index 00000000..b6ebea3e --- /dev/null +++ b/deps/glslang/Test/baseResults/syntaxError.frag.out @@ -0,0 +1,24 @@ +syntaxError.frag +ERROR: 0:9: 'vec5' : undeclared identifier +ERROR: 0:9: '' : syntax error, unexpected IDENTIFIER, expecting COMMA or SEMICOLON +ERROR: 2 compilation errors. No code generated. + + +Shader version: 120 +ERROR: node is still EOpNull! +0:? Linker Objects +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'd' ( uniform float) + + +Linked fragment stage: + + +Shader version: 120 +ERROR: node is still EOpNull! +0:? Linker Objects +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'd' ( uniform float) + diff --git a/deps/glslang/Test/baseResults/test.conf b/deps/glslang/Test/baseResults/test.conf new file mode 100644 index 00000000..cff77168 --- /dev/null +++ b/deps/glslang/Test/baseResults/test.conf @@ -0,0 +1,101 @@ +MaxLights 32 +MaxClipPlanes 6 +MaxTextureUnits 32 +MaxTextureCoords 32 +MaxVertexAttribs 64 +MaxVertexUniformComponents 4096 +MaxVaryingFloats 64 +MaxVertexTextureImageUnits 32 +MaxCombinedTextureImageUnits 80 +MaxTextureImageUnits 32 +MaxFragmentUniformComponents 4096 +MaxDrawBuffers 32 +MaxVertexUniformVectors 128 +MaxVaryingVectors 8 +MaxFragmentUniformVectors 16 +MaxVertexOutputVectors 16 +MaxFragmentInputVectors 15 +MinProgramTexelOffset -8 +MaxProgramTexelOffset 7 +MaxClipDistances 8 +MaxComputeWorkGroupCountX 65535 +MaxComputeWorkGroupCountY 65535 +MaxComputeWorkGroupCountZ 65535 +MaxComputeWorkGroupSizeX 1024 +MaxComputeWorkGroupSizeY 1024 +MaxComputeWorkGroupSizeZ 64 +MaxComputeUniformComponents 1024 +MaxComputeTextureImageUnits 16 +MaxComputeImageUniforms 8 +MaxComputeAtomicCounters 8 +MaxComputeAtomicCounterBuffers 1 +MaxVaryingComponents 60 +MaxVertexOutputComponents 64 +MaxGeometryInputComponents 64 +MaxGeometryOutputComponents 128 +MaxFragmentInputComponents 128 +MaxImageUnits 8 +MaxCombinedImageUnitsAndFragmentOutputs 8 +MaxCombinedShaderOutputResources 8 +MaxImageSamples 0 +MaxVertexImageUniforms 0 +MaxTessControlImageUniforms 0 +MaxTessEvaluationImageUniforms 0 +MaxGeometryImageUniforms 0 +MaxFragmentImageUniforms 8 +MaxCombinedImageUniforms 8 +MaxGeometryTextureImageUnits 16 +MaxGeometryOutputVertices 256 +MaxGeometryTotalOutputComponents 1024 +MaxGeometryUniformComponents 1024 +MaxGeometryVaryingComponents 64 +MaxTessControlInputComponents 128 +MaxTessControlOutputComponents 128 +MaxTessControlTextureImageUnits 16 +MaxTessControlUniformComponents 1024 +MaxTessControlTotalOutputComponents 4096 +MaxTessEvaluationInputComponents 128 +MaxTessEvaluationOutputComponents 128 +MaxTessEvaluationTextureImageUnits 16 +MaxTessEvaluationUniformComponents 1024 +MaxTessPatchComponents 120 +MaxPatchVertices 32 +MaxTessGenLevel 64 +MaxViewports 16 +MaxVertexAtomicCounters 0 +MaxTessControlAtomicCounters 0 +MaxTessEvaluationAtomicCounters 0 +MaxGeometryAtomicCounters 0 +MaxFragmentAtomicCounters 8 +MaxCombinedAtomicCounters 8 +MaxAtomicCounterBindings 1 +MaxVertexAtomicCounterBuffers 0 +MaxTessControlAtomicCounterBuffers 0 +MaxTessEvaluationAtomicCounterBuffers 0 +MaxGeometryAtomicCounterBuffers 0 +MaxFragmentAtomicCounterBuffers 1 +MaxCombinedAtomicCounterBuffers 1 +MaxAtomicCounterBufferSize 16384 +MaxTransformFeedbackBuffers 4 +MaxTransformFeedbackInterleavedComponents 64 +MaxCullDistances 8 +MaxCombinedClipAndCullDistances 8 +MaxSamples 4 +MaxMeshOutputVerticesNV 256 +MaxMeshOutputPrimitivesNV 512 +MaxMeshWorkGroupSizeX_NV 32 +MaxMeshWorkGroupSizeY_NV 1 +MaxMeshWorkGroupSizeZ_NV 1 +MaxTaskWorkGroupSizeX_NV 32 +MaxTaskWorkGroupSizeY_NV 1 +MaxTaskWorkGroupSizeZ_NV 1 +MaxMeshViewCountNV 4 +nonInductiveForLoops 1 +whileLoops 1 +doWhileLoops 1 +generalUniformIndexing 1 +generalAttributeMatrixVectorIndexing 1 +generalVaryingIndexing 1 +generalSamplerIndexing 1 +generalVariableIndexing 1 +generalConstantMatrixVectorIndexing 1 diff --git a/deps/glslang/Test/baseResults/test.frag.out b/deps/glslang/Test/baseResults/test.frag.out new file mode 100644 index 00000000..4f6faaf9 --- /dev/null +++ b/deps/glslang/Test/baseResults/test.frag.out @@ -0,0 +1,115 @@ +test.frag +Shader version: 110 +0:? Sequence +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:15 Sequence +0:15 Sequence +0:15 move second child to first child ( temp float) +0:15 'blendscale' ( temp float) +0:15 Constant: +0:15 1.789000 +0:17 Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:17 'v' ( temp 4-component vector of float) +0:17 vector swizzle ( temp 4-component vector of float) +0:17 texture ( global 4-component vector of float) +0:17 'texSampler2D' ( uniform sampler2D) +0:17 divide ( temp 2-component vector of float) +0:17 add ( temp 2-component vector of float) +0:17 't' ( smooth in 2-component vector of float) +0:17 'scale' ( uniform 2-component vector of float) +0:17 'scale' ( uniform 2-component vector of float) +0:17 Sequence +0:17 Constant: +0:17 3 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 0 (const int) +0:19 Sequence +0:19 move second child to first child ( temp 4-component vector of float) +0:19 'w' ( temp 4-component vector of float) +0:19 add ( temp 4-component vector of float) +0:19 texture ( global 4-component vector of float) +0:19 'texSampler3D' ( uniform sampler3D) +0:19 'coords' ( smooth in 3-component vector of float) +0:19 'v' ( temp 4-component vector of float) +0:21 move second child to first child ( temp 4-component vector of float) +0:21 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:21 mix ( global 4-component vector of float) +0:21 'w' ( temp 4-component vector of float) +0:21 'u' ( uniform 4-component vector of float) +0:21 component-wise multiply ( temp float) +0:21 'blend' ( uniform float) +0:21 'blendscale' ( temp float) +0:? Linker Objects +0:? 'texSampler2D' ( uniform sampler2D) +0:? 'texSampler3D' ( uniform sampler3D) +0:? 'blend' ( uniform float) +0:? 'scale' ( uniform 2-component vector of float) +0:? 'u' ( uniform 4-component vector of float) +0:? 't' ( smooth in 2-component vector of float) +0:? 'coords' ( smooth in 3-component vector of float) + + +Linked fragment stage: + + +Shader version: 110 +0:? Sequence +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:15 Sequence +0:15 Sequence +0:15 move second child to first child ( temp float) +0:15 'blendscale' ( temp float) +0:15 Constant: +0:15 1.789000 +0:17 Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:17 'v' ( temp 4-component vector of float) +0:17 vector swizzle ( temp 4-component vector of float) +0:17 texture ( global 4-component vector of float) +0:17 'texSampler2D' ( uniform sampler2D) +0:17 divide ( temp 2-component vector of float) +0:17 add ( temp 2-component vector of float) +0:17 't' ( smooth in 2-component vector of float) +0:17 'scale' ( uniform 2-component vector of float) +0:17 'scale' ( uniform 2-component vector of float) +0:17 Sequence +0:17 Constant: +0:17 3 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 1 (const int) +0:17 Constant: +0:17 0 (const int) +0:19 Sequence +0:19 move second child to first child ( temp 4-component vector of float) +0:19 'w' ( temp 4-component vector of float) +0:19 add ( temp 4-component vector of float) +0:19 texture ( global 4-component vector of float) +0:19 'texSampler3D' ( uniform sampler3D) +0:19 'coords' ( smooth in 3-component vector of float) +0:19 'v' ( temp 4-component vector of float) +0:21 move second child to first child ( temp 4-component vector of float) +0:21 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:21 mix ( global 4-component vector of float) +0:21 'w' ( temp 4-component vector of float) +0:21 'u' ( uniform 4-component vector of float) +0:21 component-wise multiply ( temp float) +0:21 'blend' ( uniform float) +0:21 'blendscale' ( temp float) +0:? Linker Objects +0:? 'texSampler2D' ( uniform sampler2D) +0:? 'texSampler3D' ( uniform sampler3D) +0:? 'blend' ( uniform float) +0:? 'scale' ( uniform 2-component vector of float) +0:? 'u' ( uniform 4-component vector of float) +0:? 't' ( smooth in 2-component vector of float) +0:? 'coords' ( smooth in 3-component vector of float) + diff --git a/deps/glslang/Test/baseResults/texture.frag.out b/deps/glslang/Test/baseResults/texture.frag.out new file mode 100644 index 00000000..8e9a7105 --- /dev/null +++ b/deps/glslang/Test/baseResults/texture.frag.out @@ -0,0 +1,564 @@ +texture.frag +WARNING: 0:14: varying deprecated in version 130; may be removed in future release +WARNING: 0:15: varying deprecated in version 130; may be removed in future release + +Shader version: 130 +0:? Sequence +0:17 Function Definition: main( ( global void) +0:17 Function Parameters: +0:19 Sequence +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'blendscale' ( temp float) +0:19 Constant: +0:19 1.789000 +0:20 Sequence +0:20 move second child to first child ( temp float) +0:20 'bias' ( temp float) +0:20 Constant: +0:20 2.000000 +0:21 Sequence +0:21 move second child to first child ( temp float) +0:21 'lod' ( temp float) +0:21 Constant: +0:21 3.000000 +0:22 Sequence +0:22 move second child to first child ( temp float) +0:22 'proj' ( temp float) +0:22 Constant: +0:22 2.000000 +0:23 Sequence +0:23 move second child to first child ( temp float) +0:23 'coords1D' ( temp float) +0:23 Constant: +0:23 1.789000 +0:24 Sequence +0:24 move second child to first child ( temp 3-component vector of float) +0:24 'coords3D' ( temp 3-component vector of float) +0:24 Constant: +0:24 1.789000 +0:24 2.718000 +0:24 3.453000 +0:25 Sequence +0:25 move second child to first child ( temp 4-component vector of float) +0:25 'coords4D' ( temp 4-component vector of float) +0:25 Constant: +0:25 1.789000 +0:25 2.718000 +0:25 3.453000 +0:25 2.000000 +0:26 Sequence +0:26 move second child to first child ( temp 4-component vector of float) +0:26 'color' ( temp 4-component vector of float) +0:26 Constant: +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:28 add second child into first child ( temp 4-component vector of float) +0:28 'color' ( temp 4-component vector of float) +0:28 texture ( global 4-component vector of float) +0:28 'texSampler1D' ( uniform sampler1D) +0:28 'coords1D' ( temp float) +0:29 add second child into first child ( temp 4-component vector of float) +0:29 'color' ( temp 4-component vector of float) +0:29 texture ( global 4-component vector of float) +0:29 'texSampler1D' ( uniform sampler1D) +0:29 'coords1D' ( temp float) +0:29 'bias' ( temp float) +0:30 add second child into first child ( temp 4-component vector of float) +0:30 'color' ( temp 4-component vector of float) +0:30 textureProj ( global 4-component vector of float) +0:30 'texSampler1D' ( uniform sampler1D) +0:30 'coords2D' ( smooth in 2-component vector of float) +0:31 add second child into first child ( temp 4-component vector of float) +0:31 'color' ( temp 4-component vector of float) +0:31 textureProj ( global 4-component vector of float) +0:31 'texSampler1D' ( uniform sampler1D) +0:31 'coords4D' ( temp 4-component vector of float) +0:32 add second child into first child ( temp 4-component vector of float) +0:32 'color' ( temp 4-component vector of float) +0:32 textureProj ( global 4-component vector of float) +0:32 'texSampler1D' ( uniform sampler1D) +0:32 'coords2D' ( smooth in 2-component vector of float) +0:32 'bias' ( temp float) +0:33 add second child into first child ( temp 4-component vector of float) +0:33 'color' ( temp 4-component vector of float) +0:33 textureProj ( global 4-component vector of float) +0:33 'texSampler1D' ( uniform sampler1D) +0:33 'coords4D' ( temp 4-component vector of float) +0:33 'bias' ( temp float) +0:35 add second child into first child ( temp 4-component vector of float) +0:35 'color' ( temp 4-component vector of float) +0:35 texture ( global 4-component vector of float) +0:35 'texSampler2D' ( uniform sampler2D) +0:35 'coords2D' ( smooth in 2-component vector of float) +0:36 add second child into first child ( temp 4-component vector of float) +0:36 'color' ( temp 4-component vector of float) +0:36 texture ( global 4-component vector of float) +0:36 'texSampler2D' ( uniform sampler2D) +0:36 'coords2D' ( smooth in 2-component vector of float) +0:36 'bias' ( temp float) +0:37 add second child into first child ( temp 4-component vector of float) +0:37 'color' ( temp 4-component vector of float) +0:37 textureProj ( global 4-component vector of float) +0:37 'texSampler2D' ( uniform sampler2D) +0:37 'coords3D' ( temp 3-component vector of float) +0:38 add second child into first child ( temp 4-component vector of float) +0:38 'color' ( temp 4-component vector of float) +0:38 textureProj ( global 4-component vector of float) +0:38 'texSampler2D' ( uniform sampler2D) +0:38 'coords4D' ( temp 4-component vector of float) +0:38 'bias' ( temp float) +0:40 add second child into first child ( temp 4-component vector of float) +0:40 'color' ( temp 4-component vector of float) +0:40 texture ( global 4-component vector of float) +0:40 'texSampler3D' ( uniform sampler3D) +0:40 'coords3D' ( temp 3-component vector of float) +0:41 add second child into first child ( temp 4-component vector of float) +0:41 'color' ( temp 4-component vector of float) +0:41 texture ( global 4-component vector of float) +0:41 'texSampler3D' ( uniform sampler3D) +0:41 'coords3D' ( temp 3-component vector of float) +0:41 'bias' ( temp float) +0:42 add second child into first child ( temp 4-component vector of float) +0:42 'color' ( temp 4-component vector of float) +0:42 textureProj ( global 4-component vector of float) +0:42 'texSampler3D' ( uniform sampler3D) +0:42 'coords4D' ( temp 4-component vector of float) +0:43 add second child into first child ( temp 4-component vector of float) +0:43 'color' ( temp 4-component vector of float) +0:43 textureProj ( global 4-component vector of float) +0:43 'texSampler3D' ( uniform sampler3D) +0:43 'coords4D' ( temp 4-component vector of float) +0:43 'bias' ( temp float) +0:45 add second child into first child ( temp 4-component vector of float) +0:45 'color' ( temp 4-component vector of float) +0:45 texture ( global 4-component vector of float) +0:45 'texSamplerCube' ( uniform samplerCube) +0:45 'coords3D' ( temp 3-component vector of float) +0:46 add second child into first child ( temp 4-component vector of float) +0:46 'color' ( temp 4-component vector of float) +0:46 texture ( global 4-component vector of float) +0:46 'texSamplerCube' ( uniform samplerCube) +0:46 'coords3D' ( temp 3-component vector of float) +0:46 'bias' ( temp float) +0:48 add second child into first child ( temp 4-component vector of float) +0:48 'color' ( temp 4-component vector of float) +0:48 texture ( global 4-component vector of float) +0:48 'shadowSampler1D' ( uniform sampler1DShadow) +0:48 'coords3D' ( temp 3-component vector of float) +0:49 add second child into first child ( temp 4-component vector of float) +0:49 'color' ( temp 4-component vector of float) +0:49 texture ( global 4-component vector of float) +0:49 'shadowSampler1D' ( uniform sampler1DShadow) +0:49 'coords3D' ( temp 3-component vector of float) +0:49 'bias' ( temp float) +0:50 add second child into first child ( temp 4-component vector of float) +0:50 'color' ( temp 4-component vector of float) +0:50 texture ( global 4-component vector of float) +0:50 'shadowSampler2D' ( uniform sampler2DShadow) +0:50 'coords3D' ( temp 3-component vector of float) +0:51 add second child into first child ( temp 4-component vector of float) +0:51 'color' ( temp 4-component vector of float) +0:51 texture ( global 4-component vector of float) +0:51 'shadowSampler2D' ( uniform sampler2DShadow) +0:51 'coords3D' ( temp 3-component vector of float) +0:51 'bias' ( temp float) +0:52 add second child into first child ( temp 4-component vector of float) +0:52 'color' ( temp 4-component vector of float) +0:52 textureProj ( global 4-component vector of float) +0:52 'shadowSampler1D' ( uniform sampler1DShadow) +0:52 'coords4D' ( temp 4-component vector of float) +0:53 add second child into first child ( temp 4-component vector of float) +0:53 'color' ( temp 4-component vector of float) +0:53 textureProj ( global 4-component vector of float) +0:53 'shadowSampler1D' ( uniform sampler1DShadow) +0:53 'coords4D' ( temp 4-component vector of float) +0:53 'bias' ( temp float) +0:54 add second child into first child ( temp 4-component vector of float) +0:54 'color' ( temp 4-component vector of float) +0:54 textureProj ( global 4-component vector of float) +0:54 'shadowSampler2D' ( uniform sampler2DShadow) +0:54 'coords4D' ( temp 4-component vector of float) +0:55 add second child into first child ( temp 4-component vector of float) +0:55 'color' ( temp 4-component vector of float) +0:55 textureProj ( global 4-component vector of float) +0:55 'shadowSampler2D' ( uniform sampler2DShadow) +0:55 'coords4D' ( temp 4-component vector of float) +0:55 'bias' ( temp float) +0:57 Sequence +0:57 move second child to first child ( temp 2-component vector of int) +0:57 'iCoords2D' ( temp 2-component vector of int) +0:57 Constant: +0:57 0 (const int) +0:57 5 (const int) +0:58 Sequence +0:58 move second child to first child ( temp int) +0:58 'iLod' ( temp int) +0:58 Constant: +0:58 1 (const int) +0:60 add second child into first child ( temp 4-component vector of float) +0:60 'color' ( temp 4-component vector of float) +0:60 textureFetch ( global 4-component vector of float) +0:60 'texSampler2D' ( uniform sampler2D) +0:60 'iCoords2D' ( temp 2-component vector of int) +0:60 'iLod' ( temp int) +0:62 Sequence +0:62 move second child to first child ( temp 2-component vector of float) +0:62 'gradX' ( temp 2-component vector of float) +0:62 dPdx ( global 2-component vector of float) +0:62 'coords2D' ( smooth in 2-component vector of float) +0:63 Sequence +0:63 move second child to first child ( temp 2-component vector of float) +0:63 'gradY' ( temp 2-component vector of float) +0:63 dPdy ( global 2-component vector of float) +0:63 'coords2D' ( smooth in 2-component vector of float) +0:66 add second child into first child ( temp 4-component vector of float) +0:66 'color' ( temp 4-component vector of float) +0:66 textureGrad ( global 4-component vector of float) +0:66 'texSampler2D' ( uniform sampler2D) +0:66 'coords2D' ( smooth in 2-component vector of float) +0:66 'gradX' ( temp 2-component vector of float) +0:66 'gradY' ( temp 2-component vector of float) +0:67 add second child into first child ( temp 4-component vector of float) +0:67 'color' ( temp 4-component vector of float) +0:67 textureProjGrad ( global 4-component vector of float) +0:67 'texSampler2D' ( uniform sampler2D) +0:67 Construct vec3 ( temp 3-component vector of float) +0:67 'coords2D' ( smooth in 2-component vector of float) +0:67 'proj' ( temp float) +0:67 'gradX' ( temp 2-component vector of float) +0:67 'gradY' ( temp 2-component vector of float) +0:68 add second child into first child ( temp 4-component vector of float) +0:68 'color' ( temp 4-component vector of float) +0:68 textureGradOffset ( global 4-component vector of float) +0:68 'texSampler2D' ( uniform sampler2D) +0:68 'coords2D' ( smooth in 2-component vector of float) +0:68 'gradX' ( temp 2-component vector of float) +0:68 'gradY' ( temp 2-component vector of float) +0:68 Constant: +0:68 3 (const int) +0:68 -7 (const int) +0:69 add second child into first child ( temp 4-component vector of float) +0:69 'color' ( temp 4-component vector of float) +0:69 textureProjGradOffset ( global 4-component vector of float) +0:69 'texSampler2D' ( uniform sampler2D) +0:69 'coords3D' ( temp 3-component vector of float) +0:69 'gradX' ( temp 2-component vector of float) +0:69 'gradY' ( temp 2-component vector of float) +0:69 Constant: +0:69 3 (const int) +0:69 -7 (const int) +0:70 add second child into first child ( temp 4-component vector of float) +0:70 'color' ( temp 4-component vector of float) +0:70 textureGrad ( global float) +0:70 'shadowSampler2D' ( uniform sampler2DShadow) +0:70 Construct vec3 ( temp 3-component vector of float) +0:70 'coords2D' ( smooth in 2-component vector of float) +0:70 'lod' ( temp float) +0:70 'gradX' ( temp 2-component vector of float) +0:70 'gradY' ( temp 2-component vector of float) +0:72 move second child to first child ( temp 4-component vector of float) +0:72 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:72 mix ( global 4-component vector of float) +0:72 'color' ( temp 4-component vector of float) +0:72 'u' ( uniform 4-component vector of float) +0:72 component-wise multiply ( temp float) +0:72 'blend' ( uniform float) +0:72 'blendscale' ( temp float) +0:? Linker Objects +0:? 'texSampler1D' ( uniform sampler1D) +0:? 'texSampler2D' ( uniform sampler2D) +0:? 'texSampler3D' ( uniform sampler3D) +0:? 'texSamplerCube' ( uniform samplerCube) +0:? 'shadowSampler1D' ( uniform sampler1DShadow) +0:? 'shadowSampler2D' ( uniform sampler2DShadow) +0:? 'blend' ( uniform float) +0:? 'scale' ( uniform 2-component vector of float) +0:? 'u' ( uniform 4-component vector of float) +0:? 't' ( smooth in 2-component vector of float) +0:? 'coords2D' ( smooth in 2-component vector of float) + + +Linked fragment stage: + + +Shader version: 130 +0:? Sequence +0:17 Function Definition: main( ( global void) +0:17 Function Parameters: +0:19 Sequence +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'blendscale' ( temp float) +0:19 Constant: +0:19 1.789000 +0:20 Sequence +0:20 move second child to first child ( temp float) +0:20 'bias' ( temp float) +0:20 Constant: +0:20 2.000000 +0:21 Sequence +0:21 move second child to first child ( temp float) +0:21 'lod' ( temp float) +0:21 Constant: +0:21 3.000000 +0:22 Sequence +0:22 move second child to first child ( temp float) +0:22 'proj' ( temp float) +0:22 Constant: +0:22 2.000000 +0:23 Sequence +0:23 move second child to first child ( temp float) +0:23 'coords1D' ( temp float) +0:23 Constant: +0:23 1.789000 +0:24 Sequence +0:24 move second child to first child ( temp 3-component vector of float) +0:24 'coords3D' ( temp 3-component vector of float) +0:24 Constant: +0:24 1.789000 +0:24 2.718000 +0:24 3.453000 +0:25 Sequence +0:25 move second child to first child ( temp 4-component vector of float) +0:25 'coords4D' ( temp 4-component vector of float) +0:25 Constant: +0:25 1.789000 +0:25 2.718000 +0:25 3.453000 +0:25 2.000000 +0:26 Sequence +0:26 move second child to first child ( temp 4-component vector of float) +0:26 'color' ( temp 4-component vector of float) +0:26 Constant: +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:26 0.000000 +0:28 add second child into first child ( temp 4-component vector of float) +0:28 'color' ( temp 4-component vector of float) +0:28 texture ( global 4-component vector of float) +0:28 'texSampler1D' ( uniform sampler1D) +0:28 'coords1D' ( temp float) +0:29 add second child into first child ( temp 4-component vector of float) +0:29 'color' ( temp 4-component vector of float) +0:29 texture ( global 4-component vector of float) +0:29 'texSampler1D' ( uniform sampler1D) +0:29 'coords1D' ( temp float) +0:29 'bias' ( temp float) +0:30 add second child into first child ( temp 4-component vector of float) +0:30 'color' ( temp 4-component vector of float) +0:30 textureProj ( global 4-component vector of float) +0:30 'texSampler1D' ( uniform sampler1D) +0:30 'coords2D' ( smooth in 2-component vector of float) +0:31 add second child into first child ( temp 4-component vector of float) +0:31 'color' ( temp 4-component vector of float) +0:31 textureProj ( global 4-component vector of float) +0:31 'texSampler1D' ( uniform sampler1D) +0:31 'coords4D' ( temp 4-component vector of float) +0:32 add second child into first child ( temp 4-component vector of float) +0:32 'color' ( temp 4-component vector of float) +0:32 textureProj ( global 4-component vector of float) +0:32 'texSampler1D' ( uniform sampler1D) +0:32 'coords2D' ( smooth in 2-component vector of float) +0:32 'bias' ( temp float) +0:33 add second child into first child ( temp 4-component vector of float) +0:33 'color' ( temp 4-component vector of float) +0:33 textureProj ( global 4-component vector of float) +0:33 'texSampler1D' ( uniform sampler1D) +0:33 'coords4D' ( temp 4-component vector of float) +0:33 'bias' ( temp float) +0:35 add second child into first child ( temp 4-component vector of float) +0:35 'color' ( temp 4-component vector of float) +0:35 texture ( global 4-component vector of float) +0:35 'texSampler2D' ( uniform sampler2D) +0:35 'coords2D' ( smooth in 2-component vector of float) +0:36 add second child into first child ( temp 4-component vector of float) +0:36 'color' ( temp 4-component vector of float) +0:36 texture ( global 4-component vector of float) +0:36 'texSampler2D' ( uniform sampler2D) +0:36 'coords2D' ( smooth in 2-component vector of float) +0:36 'bias' ( temp float) +0:37 add second child into first child ( temp 4-component vector of float) +0:37 'color' ( temp 4-component vector of float) +0:37 textureProj ( global 4-component vector of float) +0:37 'texSampler2D' ( uniform sampler2D) +0:37 'coords3D' ( temp 3-component vector of float) +0:38 add second child into first child ( temp 4-component vector of float) +0:38 'color' ( temp 4-component vector of float) +0:38 textureProj ( global 4-component vector of float) +0:38 'texSampler2D' ( uniform sampler2D) +0:38 'coords4D' ( temp 4-component vector of float) +0:38 'bias' ( temp float) +0:40 add second child into first child ( temp 4-component vector of float) +0:40 'color' ( temp 4-component vector of float) +0:40 texture ( global 4-component vector of float) +0:40 'texSampler3D' ( uniform sampler3D) +0:40 'coords3D' ( temp 3-component vector of float) +0:41 add second child into first child ( temp 4-component vector of float) +0:41 'color' ( temp 4-component vector of float) +0:41 texture ( global 4-component vector of float) +0:41 'texSampler3D' ( uniform sampler3D) +0:41 'coords3D' ( temp 3-component vector of float) +0:41 'bias' ( temp float) +0:42 add second child into first child ( temp 4-component vector of float) +0:42 'color' ( temp 4-component vector of float) +0:42 textureProj ( global 4-component vector of float) +0:42 'texSampler3D' ( uniform sampler3D) +0:42 'coords4D' ( temp 4-component vector of float) +0:43 add second child into first child ( temp 4-component vector of float) +0:43 'color' ( temp 4-component vector of float) +0:43 textureProj ( global 4-component vector of float) +0:43 'texSampler3D' ( uniform sampler3D) +0:43 'coords4D' ( temp 4-component vector of float) +0:43 'bias' ( temp float) +0:45 add second child into first child ( temp 4-component vector of float) +0:45 'color' ( temp 4-component vector of float) +0:45 texture ( global 4-component vector of float) +0:45 'texSamplerCube' ( uniform samplerCube) +0:45 'coords3D' ( temp 3-component vector of float) +0:46 add second child into first child ( temp 4-component vector of float) +0:46 'color' ( temp 4-component vector of float) +0:46 texture ( global 4-component vector of float) +0:46 'texSamplerCube' ( uniform samplerCube) +0:46 'coords3D' ( temp 3-component vector of float) +0:46 'bias' ( temp float) +0:48 add second child into first child ( temp 4-component vector of float) +0:48 'color' ( temp 4-component vector of float) +0:48 texture ( global 4-component vector of float) +0:48 'shadowSampler1D' ( uniform sampler1DShadow) +0:48 'coords3D' ( temp 3-component vector of float) +0:49 add second child into first child ( temp 4-component vector of float) +0:49 'color' ( temp 4-component vector of float) +0:49 texture ( global 4-component vector of float) +0:49 'shadowSampler1D' ( uniform sampler1DShadow) +0:49 'coords3D' ( temp 3-component vector of float) +0:49 'bias' ( temp float) +0:50 add second child into first child ( temp 4-component vector of float) +0:50 'color' ( temp 4-component vector of float) +0:50 texture ( global 4-component vector of float) +0:50 'shadowSampler2D' ( uniform sampler2DShadow) +0:50 'coords3D' ( temp 3-component vector of float) +0:51 add second child into first child ( temp 4-component vector of float) +0:51 'color' ( temp 4-component vector of float) +0:51 texture ( global 4-component vector of float) +0:51 'shadowSampler2D' ( uniform sampler2DShadow) +0:51 'coords3D' ( temp 3-component vector of float) +0:51 'bias' ( temp float) +0:52 add second child into first child ( temp 4-component vector of float) +0:52 'color' ( temp 4-component vector of float) +0:52 textureProj ( global 4-component vector of float) +0:52 'shadowSampler1D' ( uniform sampler1DShadow) +0:52 'coords4D' ( temp 4-component vector of float) +0:53 add second child into first child ( temp 4-component vector of float) +0:53 'color' ( temp 4-component vector of float) +0:53 textureProj ( global 4-component vector of float) +0:53 'shadowSampler1D' ( uniform sampler1DShadow) +0:53 'coords4D' ( temp 4-component vector of float) +0:53 'bias' ( temp float) +0:54 add second child into first child ( temp 4-component vector of float) +0:54 'color' ( temp 4-component vector of float) +0:54 textureProj ( global 4-component vector of float) +0:54 'shadowSampler2D' ( uniform sampler2DShadow) +0:54 'coords4D' ( temp 4-component vector of float) +0:55 add second child into first child ( temp 4-component vector of float) +0:55 'color' ( temp 4-component vector of float) +0:55 textureProj ( global 4-component vector of float) +0:55 'shadowSampler2D' ( uniform sampler2DShadow) +0:55 'coords4D' ( temp 4-component vector of float) +0:55 'bias' ( temp float) +0:57 Sequence +0:57 move second child to first child ( temp 2-component vector of int) +0:57 'iCoords2D' ( temp 2-component vector of int) +0:57 Constant: +0:57 0 (const int) +0:57 5 (const int) +0:58 Sequence +0:58 move second child to first child ( temp int) +0:58 'iLod' ( temp int) +0:58 Constant: +0:58 1 (const int) +0:60 add second child into first child ( temp 4-component vector of float) +0:60 'color' ( temp 4-component vector of float) +0:60 textureFetch ( global 4-component vector of float) +0:60 'texSampler2D' ( uniform sampler2D) +0:60 'iCoords2D' ( temp 2-component vector of int) +0:60 'iLod' ( temp int) +0:62 Sequence +0:62 move second child to first child ( temp 2-component vector of float) +0:62 'gradX' ( temp 2-component vector of float) +0:62 dPdx ( global 2-component vector of float) +0:62 'coords2D' ( smooth in 2-component vector of float) +0:63 Sequence +0:63 move second child to first child ( temp 2-component vector of float) +0:63 'gradY' ( temp 2-component vector of float) +0:63 dPdy ( global 2-component vector of float) +0:63 'coords2D' ( smooth in 2-component vector of float) +0:66 add second child into first child ( temp 4-component vector of float) +0:66 'color' ( temp 4-component vector of float) +0:66 textureGrad ( global 4-component vector of float) +0:66 'texSampler2D' ( uniform sampler2D) +0:66 'coords2D' ( smooth in 2-component vector of float) +0:66 'gradX' ( temp 2-component vector of float) +0:66 'gradY' ( temp 2-component vector of float) +0:67 add second child into first child ( temp 4-component vector of float) +0:67 'color' ( temp 4-component vector of float) +0:67 textureProjGrad ( global 4-component vector of float) +0:67 'texSampler2D' ( uniform sampler2D) +0:67 Construct vec3 ( temp 3-component vector of float) +0:67 'coords2D' ( smooth in 2-component vector of float) +0:67 'proj' ( temp float) +0:67 'gradX' ( temp 2-component vector of float) +0:67 'gradY' ( temp 2-component vector of float) +0:68 add second child into first child ( temp 4-component vector of float) +0:68 'color' ( temp 4-component vector of float) +0:68 textureGradOffset ( global 4-component vector of float) +0:68 'texSampler2D' ( uniform sampler2D) +0:68 'coords2D' ( smooth in 2-component vector of float) +0:68 'gradX' ( temp 2-component vector of float) +0:68 'gradY' ( temp 2-component vector of float) +0:68 Constant: +0:68 3 (const int) +0:68 -7 (const int) +0:69 add second child into first child ( temp 4-component vector of float) +0:69 'color' ( temp 4-component vector of float) +0:69 textureProjGradOffset ( global 4-component vector of float) +0:69 'texSampler2D' ( uniform sampler2D) +0:69 'coords3D' ( temp 3-component vector of float) +0:69 'gradX' ( temp 2-component vector of float) +0:69 'gradY' ( temp 2-component vector of float) +0:69 Constant: +0:69 3 (const int) +0:69 -7 (const int) +0:70 add second child into first child ( temp 4-component vector of float) +0:70 'color' ( temp 4-component vector of float) +0:70 textureGrad ( global float) +0:70 'shadowSampler2D' ( uniform sampler2DShadow) +0:70 Construct vec3 ( temp 3-component vector of float) +0:70 'coords2D' ( smooth in 2-component vector of float) +0:70 'lod' ( temp float) +0:70 'gradX' ( temp 2-component vector of float) +0:70 'gradY' ( temp 2-component vector of float) +0:72 move second child to first child ( temp 4-component vector of float) +0:72 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:72 mix ( global 4-component vector of float) +0:72 'color' ( temp 4-component vector of float) +0:72 'u' ( uniform 4-component vector of float) +0:72 component-wise multiply ( temp float) +0:72 'blend' ( uniform float) +0:72 'blendscale' ( temp float) +0:? Linker Objects +0:? 'texSampler1D' ( uniform sampler1D) +0:? 'texSampler2D' ( uniform sampler2D) +0:? 'texSampler3D' ( uniform sampler3D) +0:? 'texSamplerCube' ( uniform samplerCube) +0:? 'shadowSampler1D' ( uniform sampler1DShadow) +0:? 'shadowSampler2D' ( uniform sampler2DShadow) +0:? 'blend' ( uniform float) +0:? 'scale' ( uniform 2-component vector of float) +0:? 'u' ( uniform 4-component vector of float) +0:? 't' ( smooth in 2-component vector of float) +0:? 'coords2D' ( smooth in 2-component vector of float) + diff --git a/deps/glslang/Test/baseResults/tokenLength.vert.out b/deps/glslang/Test/baseResults/tokenLength.vert.out new file mode 100644 index 00000000..8c31da92 --- /dev/null +++ b/deps/glslang/Test/baseResults/tokenLength.vert.out @@ -0,0 +1,220 @@ +tokenLength.vert +ERROR: 0:9: '' : numeric literal too big +ERROR: 0:10: '' : numeric literal too big +ERROR: 0:13: '' : octal literal too big +ERROR: 0:14: '' : hexadecimal literal too big +ERROR: 0:23: '' : float literal too long +ERROR: 0:32: '' : name too long +ERROR: 0:33: '' : hexadecimal literal too big +ERROR: 0:34: '' : numeric literal too long +ERROR: 0:34: '' : octal literal too big +ERROR: 0:35: '' : numeric literal too long +ERROR: 0:35: '' : numeric literal too big +ERROR: 0:36: '' : float literal too long +WARNING: 0:39: '#extension' : extension not supported: a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhooooooooooooooooooooooooooooooohhhhhhhhhhhhhhhhh01234 +ERROR: 0:40: '' : name too long +WARNING: 0:40: '#extension' : extension not supported: a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhooooooooooooooooooooooooooooooohhhhhhhhhhhhhhhhh01234 +ERROR: 0:43: '' : name too long +ERROR: 0:44: '#extension' : ':' missing after extension name +ERROR: 0:47: '#error' : in long non - zero # if +ERROR: 0:50: '#error' : in long zero # if +ERROR: 0:52: '' : numeric literal too long +ERROR: 0:53: '#error' : in too long # if +ERROR: 0:56: 'preprocessor evaluation' : undefined macro in expression not allowed in es profile A000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 +ERROR: 0:59: 'preprocessor evaluation' : undefined macro in expression not allowed in es profile A000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +ERROR: 0:62: '' : name too long +ERROR: 0:62: 'preprocessor evaluation' : undefined macro in expression not allowed in es profile A000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +ERROR: 0:67: '' : numeric literal too long +ERROR: 0:70: '' : name too long +ERROR: 0:70: 'preprocessor evaluation' : undefined macro in expression not allowed in es profile A000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +ERROR: 26 compilation errors. No code generated. + + +Shader version: 300 +ERROR: node is still EOpNull! +0:9 Sequence +0:9 move second child to first child ( temp highp int) +0:9 'E1' ( global highp int) +0:9 Constant: +0:9 -1 (const int) +0:10 Sequence +0:10 move second child to first child ( temp highp int) +0:10 'E2' ( global highp int) +0:10 Constant: +0:10 -1 (const int) +0:11 Sequence +0:11 move second child to first child ( temp highp int) +0:11 'B' ( global highp int) +0:11 Constant: +0:11 -1 (const int) +0:13 Sequence +0:13 move second child to first child ( temp highp int) +0:13 'OE' ( global highp int) +0:13 Constant: +0:13 -1 (const int) +0:14 Sequence +0:14 move second child to first child ( temp highp int) +0:14 'HE' ( global highp int) +0:14 Constant: +0:14 -1 (const int) +0:17 Sequence +0:17 move second child to first child ( temp highp float) +0:17 'F' ( global highp float) +0:17 Constant: +0:17 1.012346 +0:20 Sequence +0:20 move second child to first child ( temp highp float) +0:20 'G' ( global highp float) +0:20 Constant: +0:20 1.012346 +0:23 Sequence +0:23 move second child to first child ( temp highp float) +0:23 'E3' ( global highp float) +0:23 Constant: +0:23 1.012346 +0:25 Function Definition: main( ( global void) +0:25 Function Parameters: +0:27 Sequence +0:27 move second child to first child ( temp highp 4-component vector of float) +0:27 'gl_Position' ( gl_Position highp 4-component vector of float Position) +0:28 Construct vec4 ( temp highp 4-component vector of float) +0:27 'ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789' ( in highp float) +0:28 Convert int to float ( temp highp float) +0:28 'B' ( global highp int) +0:28 'F' ( global highp float) +0:28 'G' ( global highp float) +0:33 Sequence +0:33 move second child to first child ( temp highp int) +0:33 'superH' ( global highp int) +0:33 Constant: +0:33 -1 (const int) +0:34 Sequence +0:34 move second child to first child ( temp highp int) +0:34 'superO' ( global highp int) +0:34 Constant: +0:34 -1 (const int) +0:35 Sequence +0:35 move second child to first child ( temp highp int) +0:35 'superI' ( global highp int) +0:35 Constant: +0:35 -1 (const int) +0:36 Sequence +0:36 move second child to first child ( temp highp float) +0:36 'superF' ( global highp float) +0:36 Constant: +0:36 1.012346 +0:? Linker Objects +0:? 'BCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789' ( in highp float) +0:? 'ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789' ( in highp float) +0:? 'E1' ( global highp int) +0:? 'E2' ( global highp int) +0:? 'B' ( global highp int) +0:? 'OE' ( global highp int) +0:? 'HE' ( global highp int) +0:? 'F' ( global highp float) +0:? 'G' ( global highp float) +0:? 'E3' ( global highp float) +0:? 'BCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789B' ( global highp float) +0:? 'superH' ( global highp int) +0:? 'superO' ( global highp int) +0:? 'superI' ( global highp int) +0:? 'superF' ( global highp float) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + + +Linked vertex stage: + + +Shader version: 300 +ERROR: node is still EOpNull! +0:9 Sequence +0:9 move second child to first child ( temp highp int) +0:9 'E1' ( global highp int) +0:9 Constant: +0:9 -1 (const int) +0:10 Sequence +0:10 move second child to first child ( temp highp int) +0:10 'E2' ( global highp int) +0:10 Constant: +0:10 -1 (const int) +0:11 Sequence +0:11 move second child to first child ( temp highp int) +0:11 'B' ( global highp int) +0:11 Constant: +0:11 -1 (const int) +0:13 Sequence +0:13 move second child to first child ( temp highp int) +0:13 'OE' ( global highp int) +0:13 Constant: +0:13 -1 (const int) +0:14 Sequence +0:14 move second child to first child ( temp highp int) +0:14 'HE' ( global highp int) +0:14 Constant: +0:14 -1 (const int) +0:17 Sequence +0:17 move second child to first child ( temp highp float) +0:17 'F' ( global highp float) +0:17 Constant: +0:17 1.012346 +0:20 Sequence +0:20 move second child to first child ( temp highp float) +0:20 'G' ( global highp float) +0:20 Constant: +0:20 1.012346 +0:23 Sequence +0:23 move second child to first child ( temp highp float) +0:23 'E3' ( global highp float) +0:23 Constant: +0:23 1.012346 +0:25 Function Definition: main( ( global void) +0:25 Function Parameters: +0:27 Sequence +0:27 move second child to first child ( temp highp 4-component vector of float) +0:27 'gl_Position' ( gl_Position highp 4-component vector of float Position) +0:28 Construct vec4 ( temp highp 4-component vector of float) +0:27 'ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789' ( in highp float) +0:28 Convert int to float ( temp highp float) +0:28 'B' ( global highp int) +0:28 'F' ( global highp float) +0:28 'G' ( global highp float) +0:33 Sequence +0:33 move second child to first child ( temp highp int) +0:33 'superH' ( global highp int) +0:33 Constant: +0:33 -1 (const int) +0:34 Sequence +0:34 move second child to first child ( temp highp int) +0:34 'superO' ( global highp int) +0:34 Constant: +0:34 -1 (const int) +0:35 Sequence +0:35 move second child to first child ( temp highp int) +0:35 'superI' ( global highp int) +0:35 Constant: +0:35 -1 (const int) +0:36 Sequence +0:36 move second child to first child ( temp highp float) +0:36 'superF' ( global highp float) +0:36 Constant: +0:36 1.012346 +0:? Linker Objects +0:? 'BCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789' ( in highp float) +0:? 'ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789' ( in highp float) +0:? 'E1' ( global highp int) +0:? 'E2' ( global highp int) +0:? 'B' ( global highp int) +0:? 'OE' ( global highp int) +0:? 'HE' ( global highp int) +0:? 'F' ( global highp float) +0:? 'G' ( global highp float) +0:? 'E3' ( global highp float) +0:? 'BCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789B' ( global highp float) +0:? 'superH' ( global highp int) +0:? 'superO' ( global highp int) +0:? 'superI' ( global highp int) +0:? 'superF' ( global highp float) +0:? 'gl_VertexID' ( gl_VertexId highp int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId) + diff --git a/deps/glslang/Test/baseResults/tokenPaste.vert.out b/deps/glslang/Test/baseResults/tokenPaste.vert.out new file mode 100644 index 00000000..b5ba9a5f --- /dev/null +++ b/deps/glslang/Test/baseResults/tokenPaste.vert.out @@ -0,0 +1,119 @@ +tokenPaste.vert +ERROR: 0:38: '##' : unexpected location +ERROR: 0:40: '##' : unexpected location; end of replacement list +ERROR: 0:49: '##' : combined tokens are too long +ERROR: 0:52: '##' : not supported for these tokens +ERROR: 0:69: '##' : combined token is invalid +ERROR: 0:82: 'macro expansion' : Too few args in Macro rec +ERROR: 0:82: '##' : unexpected location +ERROR: 0:82: '##' : unexpected location +ERROR: 0:86: '##' : unexpected location; end of argument +ERROR: 9 compilation errors. No code generated. + + +Shader version: 450 +ERROR: node is still EOpNull! +0:52 Sequence +0:52 move second child to first child ( temp int) +0:52 'a' ( global int) +0:52 Constant: +0:52 11 (const int) +0:58 Sequence +0:58 move second child to first child ( temp int) +0:58 'cop' ( global int) +0:58 Constant: +0:58 160 (const int) +0:59 Sequence +0:59 move second child to first child ( temp bool) +0:59 'dop' ( global bool) +0:59 Constant: +0:59 true (const bool) +0:63 Function Definition: ShouldntExpandToThis( ( global void) +0:63 Function Parameters: +0:65 Sequence +0:65 Sequence +0:65 move second child to first child ( temp int) +0:65 'e' ( temp int) +0:65 Constant: +0:65 16 (const int) +0:66 right shift second child into first child ( temp int) +0:66 'e' ( temp int) +0:66 Constant: +0:66 2 (const int) +0:69 Sequence +0:69 move second child to first child ( temp bool) +0:69 'f' ( temp bool) +0:69 Compare Greater Than ( temp bool) +0:69 'e' ( temp int) +0:69 Constant: +0:69 5 (const int) +0:? Linker Objects +0:? 'SecondExpansion' ( global int) +0:? 'PostPasteExpansion' ( global int) +0:? 'foo27' ( global float) +0:? 'foo155' ( uniform float) +0:? 'foo719' ( global float) +0:? 'barfoo' ( uniform float) +0:? 'argless' ( global float) +0:? 'dc1' ( global float) +0:? 'dc2' ( global float) +0:? 'foo875' ( uniform float) +0:? 'ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF012345' ( global float) +0:? 'a' ( global int) +0:? 'aop' ( const int) +0:? 10 (const int) +0:? 'bop' ( const int) +0:? 4 (const int) +0:? 'cop' ( global int) +0:? 'dop' ( global bool) +0:? 'argPaste2' ( uniform int) +0:? 'argPaste20suff' ( uniform int) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + +ERROR: Linking vertex stage: Missing entry point: Each stage requires one entry point + +Shader version: 450 +ERROR: node is still EOpNull! +0:52 Sequence +0:52 move second child to first child ( temp int) +0:52 'a' ( global int) +0:52 Constant: +0:52 11 (const int) +0:58 Sequence +0:58 move second child to first child ( temp int) +0:58 'cop' ( global int) +0:58 Constant: +0:58 160 (const int) +0:59 Sequence +0:59 move second child to first child ( temp bool) +0:59 'dop' ( global bool) +0:59 Constant: +0:59 true (const bool) +0:? Linker Objects +0:? 'SecondExpansion' ( global int) +0:? 'PostPasteExpansion' ( global int) +0:? 'foo27' ( global float) +0:? 'foo155' ( uniform float) +0:? 'foo719' ( global float) +0:? 'barfoo' ( uniform float) +0:? 'argless' ( global float) +0:? 'dc1' ( global float) +0:? 'dc2' ( global float) +0:? 'foo875' ( uniform float) +0:? 'ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF012345' ( global float) +0:? 'a' ( global int) +0:? 'aop' ( const int) +0:? 10 (const int) +0:? 'bop' ( const int) +0:? 4 (const int) +0:? 'cop' ( global int) +0:? 'dop' ( global bool) +0:? 'argPaste2' ( uniform int) +0:? 'argPaste20suff' ( uniform int) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/types.frag.out b/deps/glslang/Test/baseResults/types.frag.out new file mode 100644 index 00000000..94815b66 --- /dev/null +++ b/deps/glslang/Test/baseResults/types.frag.out @@ -0,0 +1,677 @@ +types.frag +Shader version: 130 +0:? Sequence +0:33 Function Definition: main( ( global void) +0:33 Function Parameters: +0:35 Sequence +0:35 Sequence +0:35 move second child to first child ( temp bool) +0:35 'b' ( temp bool) +0:35 logical-and ( temp bool) +0:35 'u_b' ( uniform bool) +0:35 'i_b' ( uniform bool) +0:36 Sequence +0:36 move second child to first child ( temp 2-component vector of bool) +0:36 'b2' ( temp 2-component vector of bool) +0:36 Construct bvec2 ( temp 2-component vector of bool) +0:36 logical-and ( temp bool) +0:36 logical-and ( temp bool) +0:36 logical-and ( temp bool) +0:36 direct index ( temp bool) +0:36 'u_b2' ( uniform 2-component vector of bool) +0:36 Constant: +0:36 0 (const int) +0:36 direct index ( temp bool) +0:36 'i_b2' ( uniform 2-component vector of bool) +0:36 Constant: +0:36 0 (const int) +0:36 direct index ( temp bool) +0:36 'u_b2' ( uniform 2-component vector of bool) +0:36 Constant: +0:36 1 (const int) +0:36 direct index ( temp bool) +0:36 'i_b2' ( uniform 2-component vector of bool) +0:36 Constant: +0:36 1 (const int) +0:37 Sequence +0:37 move second child to first child ( temp 3-component vector of bool) +0:37 'b3' ( temp 3-component vector of bool) +0:37 Construct bvec3 ( temp 3-component vector of bool) +0:37 logical-and ( temp bool) +0:37 logical-and ( temp bool) +0:37 logical-and ( temp bool) +0:37 logical-and ( temp bool) +0:37 logical-and ( temp bool) +0:37 direct index ( temp bool) +0:37 'u_b3' ( uniform 3-component vector of bool) +0:37 Constant: +0:37 0 (const int) +0:37 direct index ( temp bool) +0:37 'i_b3' ( uniform 3-component vector of bool) +0:37 Constant: +0:37 0 (const int) +0:37 direct index ( temp bool) +0:37 'u_b3' ( uniform 3-component vector of bool) +0:37 Constant: +0:37 1 (const int) +0:37 direct index ( temp bool) +0:37 'i_b3' ( uniform 3-component vector of bool) +0:37 Constant: +0:37 1 (const int) +0:37 direct index ( temp bool) +0:37 'u_b3' ( uniform 3-component vector of bool) +0:37 Constant: +0:37 2 (const int) +0:37 direct index ( temp bool) +0:37 'i_b3' ( uniform 3-component vector of bool) +0:37 Constant: +0:37 2 (const int) +0:38 Sequence +0:38 move second child to first child ( temp 4-component vector of bool) +0:38 'b4' ( temp 4-component vector of bool) +0:38 Construct bvec4 ( temp 4-component vector of bool) +0:38 logical-and ( temp bool) +0:38 logical-and ( temp bool) +0:38 logical-and ( temp bool) +0:38 logical-and ( temp bool) +0:38 logical-and ( temp bool) +0:38 logical-and ( temp bool) +0:38 logical-and ( temp bool) +0:38 direct index ( temp bool) +0:38 'u_b4' ( uniform 4-component vector of bool) +0:38 Constant: +0:38 0 (const int) +0:38 direct index ( temp bool) +0:38 'i_b4' ( uniform 4-component vector of bool) +0:38 Constant: +0:38 0 (const int) +0:38 direct index ( temp bool) +0:38 'u_b4' ( uniform 4-component vector of bool) +0:38 Constant: +0:38 1 (const int) +0:38 direct index ( temp bool) +0:38 'i_b4' ( uniform 4-component vector of bool) +0:38 Constant: +0:38 1 (const int) +0:38 direct index ( temp bool) +0:38 'u_b4' ( uniform 4-component vector of bool) +0:38 Constant: +0:38 2 (const int) +0:38 direct index ( temp bool) +0:38 'i_b4' ( uniform 4-component vector of bool) +0:38 Constant: +0:38 2 (const int) +0:38 direct index ( temp bool) +0:38 'u_b4' ( uniform 4-component vector of bool) +0:38 Constant: +0:38 3 (const int) +0:38 direct index ( temp bool) +0:38 'i_b4' ( uniform 4-component vector of bool) +0:38 Constant: +0:38 3 (const int) +0:40 Sequence +0:40 move second child to first child ( temp int) +0:40 'i' ( temp int) +0:40 add ( temp int) +0:40 'u_i' ( uniform int) +0:40 'i_i' ( flat in int) +0:41 Sequence +0:41 move second child to first child ( temp 2-component vector of int) +0:41 'i2' ( temp 2-component vector of int) +0:41 add ( temp 2-component vector of int) +0:41 'u_i2' ( uniform 2-component vector of int) +0:41 'i_i2' ( flat in 2-component vector of int) +0:42 Sequence +0:42 move second child to first child ( temp 3-component vector of int) +0:42 'i3' ( temp 3-component vector of int) +0:42 add ( temp 3-component vector of int) +0:42 'u_i3' ( uniform 3-component vector of int) +0:42 'i_i3' ( flat in 3-component vector of int) +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of int) +0:43 'i4' ( temp 4-component vector of int) +0:43 add ( temp 4-component vector of int) +0:43 'u_i4' ( uniform 4-component vector of int) +0:43 'i_i4' ( flat in 4-component vector of int) +0:45 Sequence +0:45 move second child to first child ( temp float) +0:45 'f' ( temp float) +0:45 add ( temp float) +0:45 'u_f' ( uniform float) +0:45 'i_f' ( smooth in float) +0:46 Sequence +0:46 move second child to first child ( temp 2-component vector of float) +0:46 'f2' ( temp 2-component vector of float) +0:46 add ( temp 2-component vector of float) +0:46 'u_f2' ( uniform 2-component vector of float) +0:46 'i_f2' ( smooth in 2-component vector of float) +0:47 Sequence +0:47 move second child to first child ( temp 3-component vector of float) +0:47 'f3' ( temp 3-component vector of float) +0:47 add ( temp 3-component vector of float) +0:47 'u_f3' ( uniform 3-component vector of float) +0:47 'i_f3' ( smooth in 3-component vector of float) +0:48 Sequence +0:48 move second child to first child ( temp 4-component vector of float) +0:48 'f4' ( temp 4-component vector of float) +0:48 add ( temp 4-component vector of float) +0:48 'u_f4' ( uniform 4-component vector of float) +0:48 'i_f4' ( smooth in 4-component vector of float) +0:50 move second child to first child ( temp 4-component vector of float) +0:50 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:60 Test condition and select ( temp 4-component vector of float) +0:60 Condition +0:59 logical-or ( temp bool) +0:58 logical-or ( temp bool) +0:57 logical-or ( temp bool) +0:56 logical-or ( temp bool) +0:55 logical-or ( temp bool) +0:54 logical-or ( temp bool) +0:53 logical-or ( temp bool) +0:52 logical-or ( temp bool) +0:51 logical-or ( temp bool) +0:51 'b' ( temp bool) +0:52 direct index ( temp bool) +0:52 'b2' ( temp 2-component vector of bool) +0:52 Constant: +0:52 0 (const int) +0:53 direct index ( temp bool) +0:53 'b2' ( temp 2-component vector of bool) +0:53 Constant: +0:53 1 (const int) +0:54 direct index ( temp bool) +0:54 'b3' ( temp 3-component vector of bool) +0:54 Constant: +0:54 0 (const int) +0:55 direct index ( temp bool) +0:55 'b3' ( temp 3-component vector of bool) +0:55 Constant: +0:55 1 (const int) +0:56 direct index ( temp bool) +0:56 'b3' ( temp 3-component vector of bool) +0:56 Constant: +0:56 2 (const int) +0:57 direct index ( temp bool) +0:57 'b4' ( temp 4-component vector of bool) +0:57 Constant: +0:57 0 (const int) +0:58 direct index ( temp bool) +0:58 'b4' ( temp 4-component vector of bool) +0:58 Constant: +0:58 1 (const int) +0:59 direct index ( temp bool) +0:59 'b4' ( temp 4-component vector of bool) +0:59 Constant: +0:59 2 (const int) +0:60 direct index ( temp bool) +0:60 'b4' ( temp 4-component vector of bool) +0:60 Constant: +0:60 3 (const int) +0:60 true case +0:79 Construct vec4 ( temp 4-component vector of float) +0:79 add ( temp float) +0:78 add ( temp float) +0:77 add ( temp float) +0:76 add ( temp float) +0:75 add ( temp float) +0:74 add ( temp float) +0:73 add ( temp float) +0:72 add ( temp float) +0:71 add ( temp float) +0:70 add ( temp float) +0:69 Convert int to float ( temp float) +0:69 add ( temp int) +0:68 add ( temp int) +0:67 add ( temp int) +0:66 add ( temp int) +0:65 add ( temp int) +0:64 add ( temp int) +0:63 add ( temp int) +0:62 add ( temp int) +0:61 add ( temp int) +0:61 'i' ( temp int) +0:62 direct index ( temp int) +0:62 'i2' ( temp 2-component vector of int) +0:62 Constant: +0:62 0 (const int) +0:63 direct index ( temp int) +0:63 'i2' ( temp 2-component vector of int) +0:63 Constant: +0:63 1 (const int) +0:64 direct index ( temp int) +0:64 'i3' ( temp 3-component vector of int) +0:64 Constant: +0:64 0 (const int) +0:65 direct index ( temp int) +0:65 'i3' ( temp 3-component vector of int) +0:65 Constant: +0:65 1 (const int) +0:66 direct index ( temp int) +0:66 'i3' ( temp 3-component vector of int) +0:66 Constant: +0:66 2 (const int) +0:67 direct index ( temp int) +0:67 'i4' ( temp 4-component vector of int) +0:67 Constant: +0:67 0 (const int) +0:68 direct index ( temp int) +0:68 'i4' ( temp 4-component vector of int) +0:68 Constant: +0:68 1 (const int) +0:69 direct index ( temp int) +0:69 'i4' ( temp 4-component vector of int) +0:69 Constant: +0:69 2 (const int) +0:70 direct index ( temp int) +0:70 'i4' ( temp 4-component vector of int) +0:70 Constant: +0:70 3 (const int) +0:71 'f' ( temp float) +0:72 direct index ( temp float) +0:72 'f2' ( temp 2-component vector of float) +0:72 Constant: +0:72 0 (const int) +0:73 direct index ( temp float) +0:73 'f2' ( temp 2-component vector of float) +0:73 Constant: +0:73 1 (const int) +0:74 direct index ( temp float) +0:74 'f3' ( temp 3-component vector of float) +0:74 Constant: +0:74 0 (const int) +0:75 direct index ( temp float) +0:75 'f3' ( temp 3-component vector of float) +0:75 Constant: +0:75 1 (const int) +0:76 direct index ( temp float) +0:76 'f3' ( temp 3-component vector of float) +0:76 Constant: +0:76 2 (const int) +0:77 direct index ( temp float) +0:77 'f4' ( temp 4-component vector of float) +0:77 Constant: +0:77 0 (const int) +0:78 direct index ( temp float) +0:78 'f4' ( temp 4-component vector of float) +0:78 Constant: +0:78 1 (const int) +0:79 direct index ( temp float) +0:79 'f4' ( temp 4-component vector of float) +0:79 Constant: +0:79 2 (const int) +0:80 direct index ( temp float) +0:80 'f4' ( temp 4-component vector of float) +0:80 Constant: +0:80 3 (const int) +0:60 false case +0:80 Constant: +0:80 1.000000 +0:80 1.000000 +0:80 1.000000 +0:80 1.000000 +0:? Linker Objects +0:? 'u_b' ( uniform bool) +0:? 'u_b2' ( uniform 2-component vector of bool) +0:? 'u_b3' ( uniform 3-component vector of bool) +0:? 'u_b4' ( uniform 4-component vector of bool) +0:? 'u_i' ( uniform int) +0:? 'u_i2' ( uniform 2-component vector of int) +0:? 'u_i3' ( uniform 3-component vector of int) +0:? 'u_i4' ( uniform 4-component vector of int) +0:? 'u_f' ( uniform float) +0:? 'u_f2' ( uniform 2-component vector of float) +0:? 'u_f3' ( uniform 3-component vector of float) +0:? 'u_f4' ( uniform 4-component vector of float) +0:? 'i_b' ( uniform bool) +0:? 'i_b2' ( uniform 2-component vector of bool) +0:? 'i_b3' ( uniform 3-component vector of bool) +0:? 'i_b4' ( uniform 4-component vector of bool) +0:? 'i_i' ( flat in int) +0:? 'i_i2' ( flat in 2-component vector of int) +0:? 'i_i3' ( flat in 3-component vector of int) +0:? 'i_i4' ( flat in 4-component vector of int) +0:? 'i_f' ( smooth in float) +0:? 'i_f2' ( smooth in 2-component vector of float) +0:? 'i_f3' ( smooth in 3-component vector of float) +0:? 'i_f4' ( smooth in 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 130 +0:? Sequence +0:33 Function Definition: main( ( global void) +0:33 Function Parameters: +0:35 Sequence +0:35 Sequence +0:35 move second child to first child ( temp bool) +0:35 'b' ( temp bool) +0:35 logical-and ( temp bool) +0:35 'u_b' ( uniform bool) +0:35 'i_b' ( uniform bool) +0:36 Sequence +0:36 move second child to first child ( temp 2-component vector of bool) +0:36 'b2' ( temp 2-component vector of bool) +0:36 Construct bvec2 ( temp 2-component vector of bool) +0:36 logical-and ( temp bool) +0:36 logical-and ( temp bool) +0:36 logical-and ( temp bool) +0:36 direct index ( temp bool) +0:36 'u_b2' ( uniform 2-component vector of bool) +0:36 Constant: +0:36 0 (const int) +0:36 direct index ( temp bool) +0:36 'i_b2' ( uniform 2-component vector of bool) +0:36 Constant: +0:36 0 (const int) +0:36 direct index ( temp bool) +0:36 'u_b2' ( uniform 2-component vector of bool) +0:36 Constant: +0:36 1 (const int) +0:36 direct index ( temp bool) +0:36 'i_b2' ( uniform 2-component vector of bool) +0:36 Constant: +0:36 1 (const int) +0:37 Sequence +0:37 move second child to first child ( temp 3-component vector of bool) +0:37 'b3' ( temp 3-component vector of bool) +0:37 Construct bvec3 ( temp 3-component vector of bool) +0:37 logical-and ( temp bool) +0:37 logical-and ( temp bool) +0:37 logical-and ( temp bool) +0:37 logical-and ( temp bool) +0:37 logical-and ( temp bool) +0:37 direct index ( temp bool) +0:37 'u_b3' ( uniform 3-component vector of bool) +0:37 Constant: +0:37 0 (const int) +0:37 direct index ( temp bool) +0:37 'i_b3' ( uniform 3-component vector of bool) +0:37 Constant: +0:37 0 (const int) +0:37 direct index ( temp bool) +0:37 'u_b3' ( uniform 3-component vector of bool) +0:37 Constant: +0:37 1 (const int) +0:37 direct index ( temp bool) +0:37 'i_b3' ( uniform 3-component vector of bool) +0:37 Constant: +0:37 1 (const int) +0:37 direct index ( temp bool) +0:37 'u_b3' ( uniform 3-component vector of bool) +0:37 Constant: +0:37 2 (const int) +0:37 direct index ( temp bool) +0:37 'i_b3' ( uniform 3-component vector of bool) +0:37 Constant: +0:37 2 (const int) +0:38 Sequence +0:38 move second child to first child ( temp 4-component vector of bool) +0:38 'b4' ( temp 4-component vector of bool) +0:38 Construct bvec4 ( temp 4-component vector of bool) +0:38 logical-and ( temp bool) +0:38 logical-and ( temp bool) +0:38 logical-and ( temp bool) +0:38 logical-and ( temp bool) +0:38 logical-and ( temp bool) +0:38 logical-and ( temp bool) +0:38 logical-and ( temp bool) +0:38 direct index ( temp bool) +0:38 'u_b4' ( uniform 4-component vector of bool) +0:38 Constant: +0:38 0 (const int) +0:38 direct index ( temp bool) +0:38 'i_b4' ( uniform 4-component vector of bool) +0:38 Constant: +0:38 0 (const int) +0:38 direct index ( temp bool) +0:38 'u_b4' ( uniform 4-component vector of bool) +0:38 Constant: +0:38 1 (const int) +0:38 direct index ( temp bool) +0:38 'i_b4' ( uniform 4-component vector of bool) +0:38 Constant: +0:38 1 (const int) +0:38 direct index ( temp bool) +0:38 'u_b4' ( uniform 4-component vector of bool) +0:38 Constant: +0:38 2 (const int) +0:38 direct index ( temp bool) +0:38 'i_b4' ( uniform 4-component vector of bool) +0:38 Constant: +0:38 2 (const int) +0:38 direct index ( temp bool) +0:38 'u_b4' ( uniform 4-component vector of bool) +0:38 Constant: +0:38 3 (const int) +0:38 direct index ( temp bool) +0:38 'i_b4' ( uniform 4-component vector of bool) +0:38 Constant: +0:38 3 (const int) +0:40 Sequence +0:40 move second child to first child ( temp int) +0:40 'i' ( temp int) +0:40 add ( temp int) +0:40 'u_i' ( uniform int) +0:40 'i_i' ( flat in int) +0:41 Sequence +0:41 move second child to first child ( temp 2-component vector of int) +0:41 'i2' ( temp 2-component vector of int) +0:41 add ( temp 2-component vector of int) +0:41 'u_i2' ( uniform 2-component vector of int) +0:41 'i_i2' ( flat in 2-component vector of int) +0:42 Sequence +0:42 move second child to first child ( temp 3-component vector of int) +0:42 'i3' ( temp 3-component vector of int) +0:42 add ( temp 3-component vector of int) +0:42 'u_i3' ( uniform 3-component vector of int) +0:42 'i_i3' ( flat in 3-component vector of int) +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of int) +0:43 'i4' ( temp 4-component vector of int) +0:43 add ( temp 4-component vector of int) +0:43 'u_i4' ( uniform 4-component vector of int) +0:43 'i_i4' ( flat in 4-component vector of int) +0:45 Sequence +0:45 move second child to first child ( temp float) +0:45 'f' ( temp float) +0:45 add ( temp float) +0:45 'u_f' ( uniform float) +0:45 'i_f' ( smooth in float) +0:46 Sequence +0:46 move second child to first child ( temp 2-component vector of float) +0:46 'f2' ( temp 2-component vector of float) +0:46 add ( temp 2-component vector of float) +0:46 'u_f2' ( uniform 2-component vector of float) +0:46 'i_f2' ( smooth in 2-component vector of float) +0:47 Sequence +0:47 move second child to first child ( temp 3-component vector of float) +0:47 'f3' ( temp 3-component vector of float) +0:47 add ( temp 3-component vector of float) +0:47 'u_f3' ( uniform 3-component vector of float) +0:47 'i_f3' ( smooth in 3-component vector of float) +0:48 Sequence +0:48 move second child to first child ( temp 4-component vector of float) +0:48 'f4' ( temp 4-component vector of float) +0:48 add ( temp 4-component vector of float) +0:48 'u_f4' ( uniform 4-component vector of float) +0:48 'i_f4' ( smooth in 4-component vector of float) +0:50 move second child to first child ( temp 4-component vector of float) +0:50 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:60 Test condition and select ( temp 4-component vector of float) +0:60 Condition +0:59 logical-or ( temp bool) +0:58 logical-or ( temp bool) +0:57 logical-or ( temp bool) +0:56 logical-or ( temp bool) +0:55 logical-or ( temp bool) +0:54 logical-or ( temp bool) +0:53 logical-or ( temp bool) +0:52 logical-or ( temp bool) +0:51 logical-or ( temp bool) +0:51 'b' ( temp bool) +0:52 direct index ( temp bool) +0:52 'b2' ( temp 2-component vector of bool) +0:52 Constant: +0:52 0 (const int) +0:53 direct index ( temp bool) +0:53 'b2' ( temp 2-component vector of bool) +0:53 Constant: +0:53 1 (const int) +0:54 direct index ( temp bool) +0:54 'b3' ( temp 3-component vector of bool) +0:54 Constant: +0:54 0 (const int) +0:55 direct index ( temp bool) +0:55 'b3' ( temp 3-component vector of bool) +0:55 Constant: +0:55 1 (const int) +0:56 direct index ( temp bool) +0:56 'b3' ( temp 3-component vector of bool) +0:56 Constant: +0:56 2 (const int) +0:57 direct index ( temp bool) +0:57 'b4' ( temp 4-component vector of bool) +0:57 Constant: +0:57 0 (const int) +0:58 direct index ( temp bool) +0:58 'b4' ( temp 4-component vector of bool) +0:58 Constant: +0:58 1 (const int) +0:59 direct index ( temp bool) +0:59 'b4' ( temp 4-component vector of bool) +0:59 Constant: +0:59 2 (const int) +0:60 direct index ( temp bool) +0:60 'b4' ( temp 4-component vector of bool) +0:60 Constant: +0:60 3 (const int) +0:60 true case +0:79 Construct vec4 ( temp 4-component vector of float) +0:79 add ( temp float) +0:78 add ( temp float) +0:77 add ( temp float) +0:76 add ( temp float) +0:75 add ( temp float) +0:74 add ( temp float) +0:73 add ( temp float) +0:72 add ( temp float) +0:71 add ( temp float) +0:70 add ( temp float) +0:69 Convert int to float ( temp float) +0:69 add ( temp int) +0:68 add ( temp int) +0:67 add ( temp int) +0:66 add ( temp int) +0:65 add ( temp int) +0:64 add ( temp int) +0:63 add ( temp int) +0:62 add ( temp int) +0:61 add ( temp int) +0:61 'i' ( temp int) +0:62 direct index ( temp int) +0:62 'i2' ( temp 2-component vector of int) +0:62 Constant: +0:62 0 (const int) +0:63 direct index ( temp int) +0:63 'i2' ( temp 2-component vector of int) +0:63 Constant: +0:63 1 (const int) +0:64 direct index ( temp int) +0:64 'i3' ( temp 3-component vector of int) +0:64 Constant: +0:64 0 (const int) +0:65 direct index ( temp int) +0:65 'i3' ( temp 3-component vector of int) +0:65 Constant: +0:65 1 (const int) +0:66 direct index ( temp int) +0:66 'i3' ( temp 3-component vector of int) +0:66 Constant: +0:66 2 (const int) +0:67 direct index ( temp int) +0:67 'i4' ( temp 4-component vector of int) +0:67 Constant: +0:67 0 (const int) +0:68 direct index ( temp int) +0:68 'i4' ( temp 4-component vector of int) +0:68 Constant: +0:68 1 (const int) +0:69 direct index ( temp int) +0:69 'i4' ( temp 4-component vector of int) +0:69 Constant: +0:69 2 (const int) +0:70 direct index ( temp int) +0:70 'i4' ( temp 4-component vector of int) +0:70 Constant: +0:70 3 (const int) +0:71 'f' ( temp float) +0:72 direct index ( temp float) +0:72 'f2' ( temp 2-component vector of float) +0:72 Constant: +0:72 0 (const int) +0:73 direct index ( temp float) +0:73 'f2' ( temp 2-component vector of float) +0:73 Constant: +0:73 1 (const int) +0:74 direct index ( temp float) +0:74 'f3' ( temp 3-component vector of float) +0:74 Constant: +0:74 0 (const int) +0:75 direct index ( temp float) +0:75 'f3' ( temp 3-component vector of float) +0:75 Constant: +0:75 1 (const int) +0:76 direct index ( temp float) +0:76 'f3' ( temp 3-component vector of float) +0:76 Constant: +0:76 2 (const int) +0:77 direct index ( temp float) +0:77 'f4' ( temp 4-component vector of float) +0:77 Constant: +0:77 0 (const int) +0:78 direct index ( temp float) +0:78 'f4' ( temp 4-component vector of float) +0:78 Constant: +0:78 1 (const int) +0:79 direct index ( temp float) +0:79 'f4' ( temp 4-component vector of float) +0:79 Constant: +0:79 2 (const int) +0:80 direct index ( temp float) +0:80 'f4' ( temp 4-component vector of float) +0:80 Constant: +0:80 3 (const int) +0:60 false case +0:80 Constant: +0:80 1.000000 +0:80 1.000000 +0:80 1.000000 +0:80 1.000000 +0:? Linker Objects +0:? 'u_b' ( uniform bool) +0:? 'u_b2' ( uniform 2-component vector of bool) +0:? 'u_b3' ( uniform 3-component vector of bool) +0:? 'u_b4' ( uniform 4-component vector of bool) +0:? 'u_i' ( uniform int) +0:? 'u_i2' ( uniform 2-component vector of int) +0:? 'u_i3' ( uniform 3-component vector of int) +0:? 'u_i4' ( uniform 4-component vector of int) +0:? 'u_f' ( uniform float) +0:? 'u_f2' ( uniform 2-component vector of float) +0:? 'u_f3' ( uniform 3-component vector of float) +0:? 'u_f4' ( uniform 4-component vector of float) +0:? 'i_b' ( uniform bool) +0:? 'i_b2' ( uniform 2-component vector of bool) +0:? 'i_b3' ( uniform 3-component vector of bool) +0:? 'i_b4' ( uniform 4-component vector of bool) +0:? 'i_i' ( flat in int) +0:? 'i_i2' ( flat in 2-component vector of int) +0:? 'i_i3' ( flat in 3-component vector of int) +0:? 'i_i4' ( flat in 4-component vector of int) +0:? 'i_f' ( smooth in float) +0:? 'i_f2' ( smooth in 2-component vector of float) +0:? 'i_f3' ( smooth in 3-component vector of float) +0:? 'i_f4' ( smooth in 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/uint.frag.out b/deps/glslang/Test/baseResults/uint.frag.out new file mode 100644 index 00000000..3a12d6b7 --- /dev/null +++ b/deps/glslang/Test/baseResults/uint.frag.out @@ -0,0 +1,607 @@ +uint.frag +ERROR: 0:2: 'uint' : must be qualified as flat in +ERROR: 0:6: 'in' : cannot be bool +ERROR: 0:20: 'const' : non-matching or non-convertible constant type for const initializer +ERROR: 0:24: 'const' : non-matching or non-convertible constant type for const initializer +ERROR: 0:34: 'const' : non-matching or non-convertible constant type for const initializer +ERROR: 0:37: 'const' : non-matching or non-convertible constant type for const initializer +ERROR: 0:48: '=' : cannot convert from ' const int' to ' temp mediump uint' +ERROR: 0:51: '=' : cannot convert from ' const int' to ' temp mediump uint' +ERROR: 0:63: 'float' : type requires declaration of default precision qualifier +ERROR: 9 compilation errors. No code generated. + + +Shader version: 300 +ERROR: node is still EOpNull! +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:17 Sequence +0:17 Sequence +0:17 move second child to first child ( temp mediump int) +0:17 'count' ( temp mediump int) +0:17 Constant: +0:17 1 (const int) +0:19 Sequence +0:19 move second child to first child ( temp mediump uint) +0:19 'u' ( temp mediump uint) +0:19 add ( temp mediump uint) +0:19 direct index ( temp mediump uint) +0:19 't' ( flat in mediump 2-component vector of uint) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 3 (const uint) +0:27 Test condition and select ( temp void) +0:27 Condition +0:27 Constant: +0:27 true (const bool) +0:27 true case +0:28 multiply second child into first child ( temp mediump int) +0:28 'count' ( temp mediump int) +0:28 Constant: +0:28 2 (const int) +0:29 Test condition and select ( temp void) +0:29 Condition +0:29 Constant: +0:29 true (const bool) +0:29 true case +0:30 multiply second child into first child ( temp mediump int) +0:30 'count' ( temp mediump int) +0:30 Constant: +0:30 3 (const int) +0:31 Test condition and select ( temp void) +0:31 Condition +0:31 Constant: +0:31 false (const bool) +0:31 true case +0:32 multiply second child into first child ( temp mediump int) +0:32 'count' ( temp mediump int) +0:32 Constant: +0:32 5 (const int) +0:41 Test condition and select ( temp void) +0:41 Condition +0:41 Constant: +0:41 true (const bool) +0:41 true case +0:42 multiply second child into first child ( temp mediump int) +0:42 'count' ( temp mediump int) +0:42 Constant: +0:42 7 (const int) +0:43 Test condition and select ( temp void) +0:43 Condition +0:43 Constant: +0:43 true (const bool) +0:43 true case +0:44 multiply second child into first child ( temp mediump int) +0:44 'count' ( temp mediump int) +0:44 Constant: +0:44 11 (const int) +0:45 Test condition and select ( temp void) +0:45 Condition +0:45 Constant: +0:45 false (const bool) +0:45 true case +0:46 multiply second child into first child ( temp mediump int) +0:46 'count' ( temp mediump int) +0:46 Constant: +0:46 13 (const int) +0:49 Sequence +0:49 move second child to first child ( temp mediump int) +0:49 'shiftedii' ( temp mediump int) +0:49 Constant: +0:49 -1 (const int) +0:50 Sequence +0:50 move second child to first child ( temp mediump uint) +0:50 'shiftedui' ( temp mediump uint) +0:50 Constant: +0:50 4194303 (const uint) +0:52 Sequence +0:52 move second child to first child ( temp mediump int) +0:52 'shiftediu' ( temp mediump int) +0:52 Constant: +0:52 -1 (const int) +0:53 Sequence +0:53 move second child to first child ( temp mediump uint) +0:53 'shifteduu' ( temp mediump uint) +0:53 Constant: +0:53 4194303 (const uint) +0:55 Test condition and select ( temp void) +0:55 Condition +0:55 Compare Equal ( temp bool) +0:55 'shiftedii' ( temp mediump int) +0:55 'shiftediu' ( temp mediump int) +0:55 true case +0:56 move second child to first child ( temp mediump 4-component vector of uint) +0:56 'c' ( out mediump 4-component vector of uint) +0:56 texture ( global lowp 4-component vector of uint, operation at highp) +0:56 'usampler' ( uniform lowp usampler2D) +0:56 'tc' ( smooth in highp 2-component vector of float) +0:57 Test condition and select ( temp void) +0:57 Condition +0:57 Compare Equal ( temp bool) +0:57 'shiftedui' ( temp mediump uint) +0:57 'shifteduu' ( temp mediump uint) +0:57 true case +0:58 move second child to first child ( temp mediump 4-component vector of uint) +0:58 'c' ( out mediump 4-component vector of uint) +0:58 texture ( global lowp 4-component vector of uint, operation at highp) +0:58 'usampler' ( uniform lowp usampler2D) +0:58 add ( temp highp 2-component vector of float) +0:58 'tc' ( smooth in highp 2-component vector of float) +0:58 Constant: +0:58 1.000000 +0:59 Test condition and select ( temp void) +0:59 Condition +0:59 Compare Equal ( temp bool) +0:59 'shiftedii' ( temp mediump int) +0:59 Convert uint to int ( temp int) +0:59 'shiftedui' ( temp mediump uint) +0:59 true case +0:60 move second child to first child ( temp mediump 4-component vector of uint) +0:60 'c' ( out mediump 4-component vector of uint) +0:60 texture ( global lowp 4-component vector of uint, operation at highp) +0:60 'usampler' ( uniform lowp usampler2D) +0:60 subtract ( temp highp 2-component vector of float) +0:60 'tc' ( smooth in highp 2-component vector of float) +0:60 Constant: +0:60 2.000000 +0:60 2.000000 +0:62 Test condition and select ( temp void) +0:62 Condition +0:62 Compare Greater Than ( temp bool) +0:62 direct index ( temp mediump uint) +0:62 't' ( flat in mediump 2-component vector of uint) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 4 (const uint) +0:62 true case +0:63 Sequence +0:63 Sequence +0:63 move second child to first child ( temp mediump float) +0:63 'af' ( temp mediump float) +0:63 Convert uint to float ( temp mediump float) +0:63 'u' ( temp mediump uint) +0:64 Sequence +0:64 move second child to first child ( temp bool) +0:64 'ab' ( temp bool) +0:64 Convert uint to bool ( temp bool) +0:64 'u' ( temp mediump uint) +0:65 Sequence +0:65 move second child to first child ( temp mediump int) +0:65 'ai' ( temp mediump int) +0:65 Convert uint to int ( temp mediump int) +0:65 'u' ( temp mediump uint) +0:67 add second child into first child ( temp mediump 4-component vector of uint) +0:67 'c' ( out mediump 4-component vector of uint) +0:67 Construct uvec4 ( temp mediump 4-component vector of uint) +0:67 Convert float to uint ( temp mediump uint) +0:67 'af' ( temp mediump float) +0:67 Convert bool to uint ( temp mediump uint) +0:67 'ab' ( temp bool) +0:67 Convert int to uint ( temp mediump uint) +0:67 'ai' ( temp mediump int) +0:67 Convert int to uint ( temp mediump uint) +0:67 'count' ( temp mediump int) +0:75 Test condition and select ( temp void) +0:75 Condition +0:75 Constant: +0:75 true (const bool) +0:75 true case +0:76 multiply second child into first child ( temp mediump int) +0:76 'count' ( temp mediump int) +0:76 Constant: +0:76 17 (const int) +0:78 Test condition and select ( temp void) +0:78 Condition +0:78 Constant: +0:78 false (const bool) +0:78 true case +0:79 multiply second child into first child ( temp mediump int) +0:79 'count' ( temp mediump int) +0:79 Constant: +0:79 19 (const int) +0:81 Test condition and select ( temp void) +0:81 Condition +0:81 Constant: +0:81 true (const bool) +0:81 true case +0:82 multiply second child into first child ( temp mediump int) +0:82 'count' ( temp mediump int) +0:82 Constant: +0:82 23 (const int) +0:84 Test condition and select ( temp void) +0:84 Condition +0:84 Constant: +0:84 true (const bool) +0:84 true case +0:85 multiply second child into first child ( temp mediump int) +0:85 'count' ( temp mediump int) +0:85 Constant: +0:85 27 (const int) +0:87 Sequence +0:87 move second child to first child ( temp mediump uint) +0:87 'mask1' ( temp mediump uint) +0:87 Constant: +0:87 161 (const uint) +0:88 Sequence +0:88 move second child to first child ( temp mediump uint) +0:88 'mask2' ( temp mediump uint) +0:88 Constant: +0:88 2576 (const uint) +0:89 Sequence +0:89 move second child to first child ( temp mediump uint) +0:89 'mask3' ( temp mediump uint) +0:89 left-shift ( temp mediump uint) +0:89 'mask1' ( temp mediump uint) +0:89 Constant: +0:89 4 (const int) +0:90 Sequence +0:90 move second child to first child ( temp mediump uint) +0:90 'mask4' ( temp mediump uint) +0:90 Constant: +0:90 2737 (const uint) +0:92 Test condition and select ( temp void) +0:92 Condition +0:92 Compare Equal ( temp bool) +0:92 'mask3' ( temp mediump uint) +0:92 'mask2' ( temp mediump uint) +0:92 true case +0:93 multiply second child into first child ( temp mediump int) +0:93 'count' ( temp mediump int) +0:93 Constant: +0:93 100 (const int) +0:95 Test condition and select ( temp void) +0:95 Condition +0:95 Compare Not Equal ( temp bool) +0:95 bitwise and ( temp mediump uint) +0:95 'mask3' ( temp mediump uint) +0:95 'mask1' ( temp mediump uint) +0:95 Constant: +0:95 0 (const uint) +0:95 true case +0:96 multiply second child into first child ( temp mediump int) +0:96 'count' ( temp mediump int) +0:96 Constant: +0:96 101 (const int) +0:98 Test condition and select ( temp void) +0:98 Condition +0:98 Compare Equal ( temp bool) +0:98 inclusive-or ( temp mediump uint) +0:98 'mask1' ( temp mediump uint) +0:98 'mask3' ( temp mediump uint) +0:98 'mask4' ( temp mediump uint) +0:98 true case +0:99 multiply second child into first child ( temp mediump int) +0:99 'count' ( temp mediump int) +0:99 Constant: +0:99 102 (const int) +0:101 Test condition and select ( temp void) +0:101 Condition +0:101 Compare Equal ( temp bool) +0:101 exclusive-or ( temp mediump uint) +0:101 'mask1' ( temp mediump uint) +0:101 'mask4' ( temp mediump uint) +0:101 Constant: +0:101 2576 (const uint) +0:101 true case +0:102 multiply second child into first child ( temp mediump int) +0:102 'count' ( temp mediump int) +0:102 Constant: +0:102 103 (const int) +0:104 add second child into first child ( temp mediump 4-component vector of uint) +0:104 'c' ( out mediump 4-component vector of uint) +0:104 Construct uvec4 ( temp mediump 4-component vector of uint) +0:104 Convert int to uint ( temp mediump uint) +0:104 'count' ( temp mediump int) +0:? Linker Objects +0:? 'badu' ( smooth in mediump 2-component vector of uint) +0:? 't' ( flat in mediump 2-component vector of uint) +0:? 'f' ( smooth in highp float) +0:? 'tc' ( smooth in highp 2-component vector of float) +0:? 'bad' ( smooth in bool) +0:? 'v' ( uniform mediump 4-component vector of uint) +0:? 'i' ( uniform mediump int) +0:? 'b' ( uniform bool) +0:? 'c' ( out mediump 4-component vector of uint) +0:? 'usampler' ( uniform lowp usampler2D) + + +Linked fragment stage: + + +Shader version: 300 +ERROR: node is still EOpNull! +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:17 Sequence +0:17 Sequence +0:17 move second child to first child ( temp mediump int) +0:17 'count' ( temp mediump int) +0:17 Constant: +0:17 1 (const int) +0:19 Sequence +0:19 move second child to first child ( temp mediump uint) +0:19 'u' ( temp mediump uint) +0:19 add ( temp mediump uint) +0:19 direct index ( temp mediump uint) +0:19 't' ( flat in mediump 2-component vector of uint) +0:19 Constant: +0:19 1 (const int) +0:19 Constant: +0:19 3 (const uint) +0:27 Test condition and select ( temp void) +0:27 Condition +0:27 Constant: +0:27 true (const bool) +0:27 true case +0:28 multiply second child into first child ( temp mediump int) +0:28 'count' ( temp mediump int) +0:28 Constant: +0:28 2 (const int) +0:29 Test condition and select ( temp void) +0:29 Condition +0:29 Constant: +0:29 true (const bool) +0:29 true case +0:30 multiply second child into first child ( temp mediump int) +0:30 'count' ( temp mediump int) +0:30 Constant: +0:30 3 (const int) +0:31 Test condition and select ( temp void) +0:31 Condition +0:31 Constant: +0:31 false (const bool) +0:31 true case +0:32 multiply second child into first child ( temp mediump int) +0:32 'count' ( temp mediump int) +0:32 Constant: +0:32 5 (const int) +0:41 Test condition and select ( temp void) +0:41 Condition +0:41 Constant: +0:41 true (const bool) +0:41 true case +0:42 multiply second child into first child ( temp mediump int) +0:42 'count' ( temp mediump int) +0:42 Constant: +0:42 7 (const int) +0:43 Test condition and select ( temp void) +0:43 Condition +0:43 Constant: +0:43 true (const bool) +0:43 true case +0:44 multiply second child into first child ( temp mediump int) +0:44 'count' ( temp mediump int) +0:44 Constant: +0:44 11 (const int) +0:45 Test condition and select ( temp void) +0:45 Condition +0:45 Constant: +0:45 false (const bool) +0:45 true case +0:46 multiply second child into first child ( temp mediump int) +0:46 'count' ( temp mediump int) +0:46 Constant: +0:46 13 (const int) +0:49 Sequence +0:49 move second child to first child ( temp mediump int) +0:49 'shiftedii' ( temp mediump int) +0:49 Constant: +0:49 -1 (const int) +0:50 Sequence +0:50 move second child to first child ( temp mediump uint) +0:50 'shiftedui' ( temp mediump uint) +0:50 Constant: +0:50 4194303 (const uint) +0:52 Sequence +0:52 move second child to first child ( temp mediump int) +0:52 'shiftediu' ( temp mediump int) +0:52 Constant: +0:52 -1 (const int) +0:53 Sequence +0:53 move second child to first child ( temp mediump uint) +0:53 'shifteduu' ( temp mediump uint) +0:53 Constant: +0:53 4194303 (const uint) +0:55 Test condition and select ( temp void) +0:55 Condition +0:55 Compare Equal ( temp bool) +0:55 'shiftedii' ( temp mediump int) +0:55 'shiftediu' ( temp mediump int) +0:55 true case +0:56 move second child to first child ( temp mediump 4-component vector of uint) +0:56 'c' ( out mediump 4-component vector of uint) +0:56 texture ( global lowp 4-component vector of uint, operation at highp) +0:56 'usampler' ( uniform lowp usampler2D) +0:56 'tc' ( smooth in highp 2-component vector of float) +0:57 Test condition and select ( temp void) +0:57 Condition +0:57 Compare Equal ( temp bool) +0:57 'shiftedui' ( temp mediump uint) +0:57 'shifteduu' ( temp mediump uint) +0:57 true case +0:58 move second child to first child ( temp mediump 4-component vector of uint) +0:58 'c' ( out mediump 4-component vector of uint) +0:58 texture ( global lowp 4-component vector of uint, operation at highp) +0:58 'usampler' ( uniform lowp usampler2D) +0:58 add ( temp highp 2-component vector of float) +0:58 'tc' ( smooth in highp 2-component vector of float) +0:58 Constant: +0:58 1.000000 +0:59 Test condition and select ( temp void) +0:59 Condition +0:59 Compare Equal ( temp bool) +0:59 'shiftedii' ( temp mediump int) +0:59 Convert uint to int ( temp int) +0:59 'shiftedui' ( temp mediump uint) +0:59 true case +0:60 move second child to first child ( temp mediump 4-component vector of uint) +0:60 'c' ( out mediump 4-component vector of uint) +0:60 texture ( global lowp 4-component vector of uint, operation at highp) +0:60 'usampler' ( uniform lowp usampler2D) +0:60 subtract ( temp highp 2-component vector of float) +0:60 'tc' ( smooth in highp 2-component vector of float) +0:60 Constant: +0:60 2.000000 +0:60 2.000000 +0:62 Test condition and select ( temp void) +0:62 Condition +0:62 Compare Greater Than ( temp bool) +0:62 direct index ( temp mediump uint) +0:62 't' ( flat in mediump 2-component vector of uint) +0:62 Constant: +0:62 0 (const int) +0:62 Constant: +0:62 4 (const uint) +0:62 true case +0:63 Sequence +0:63 Sequence +0:63 move second child to first child ( temp mediump float) +0:63 'af' ( temp mediump float) +0:63 Convert uint to float ( temp mediump float) +0:63 'u' ( temp mediump uint) +0:64 Sequence +0:64 move second child to first child ( temp bool) +0:64 'ab' ( temp bool) +0:64 Convert uint to bool ( temp bool) +0:64 'u' ( temp mediump uint) +0:65 Sequence +0:65 move second child to first child ( temp mediump int) +0:65 'ai' ( temp mediump int) +0:65 Convert uint to int ( temp mediump int) +0:65 'u' ( temp mediump uint) +0:67 add second child into first child ( temp mediump 4-component vector of uint) +0:67 'c' ( out mediump 4-component vector of uint) +0:67 Construct uvec4 ( temp mediump 4-component vector of uint) +0:67 Convert float to uint ( temp mediump uint) +0:67 'af' ( temp mediump float) +0:67 Convert bool to uint ( temp mediump uint) +0:67 'ab' ( temp bool) +0:67 Convert int to uint ( temp mediump uint) +0:67 'ai' ( temp mediump int) +0:67 Convert int to uint ( temp mediump uint) +0:67 'count' ( temp mediump int) +0:75 Test condition and select ( temp void) +0:75 Condition +0:75 Constant: +0:75 true (const bool) +0:75 true case +0:76 multiply second child into first child ( temp mediump int) +0:76 'count' ( temp mediump int) +0:76 Constant: +0:76 17 (const int) +0:78 Test condition and select ( temp void) +0:78 Condition +0:78 Constant: +0:78 false (const bool) +0:78 true case +0:79 multiply second child into first child ( temp mediump int) +0:79 'count' ( temp mediump int) +0:79 Constant: +0:79 19 (const int) +0:81 Test condition and select ( temp void) +0:81 Condition +0:81 Constant: +0:81 true (const bool) +0:81 true case +0:82 multiply second child into first child ( temp mediump int) +0:82 'count' ( temp mediump int) +0:82 Constant: +0:82 23 (const int) +0:84 Test condition and select ( temp void) +0:84 Condition +0:84 Constant: +0:84 true (const bool) +0:84 true case +0:85 multiply second child into first child ( temp mediump int) +0:85 'count' ( temp mediump int) +0:85 Constant: +0:85 27 (const int) +0:87 Sequence +0:87 move second child to first child ( temp mediump uint) +0:87 'mask1' ( temp mediump uint) +0:87 Constant: +0:87 161 (const uint) +0:88 Sequence +0:88 move second child to first child ( temp mediump uint) +0:88 'mask2' ( temp mediump uint) +0:88 Constant: +0:88 2576 (const uint) +0:89 Sequence +0:89 move second child to first child ( temp mediump uint) +0:89 'mask3' ( temp mediump uint) +0:89 left-shift ( temp mediump uint) +0:89 'mask1' ( temp mediump uint) +0:89 Constant: +0:89 4 (const int) +0:90 Sequence +0:90 move second child to first child ( temp mediump uint) +0:90 'mask4' ( temp mediump uint) +0:90 Constant: +0:90 2737 (const uint) +0:92 Test condition and select ( temp void) +0:92 Condition +0:92 Compare Equal ( temp bool) +0:92 'mask3' ( temp mediump uint) +0:92 'mask2' ( temp mediump uint) +0:92 true case +0:93 multiply second child into first child ( temp mediump int) +0:93 'count' ( temp mediump int) +0:93 Constant: +0:93 100 (const int) +0:95 Test condition and select ( temp void) +0:95 Condition +0:95 Compare Not Equal ( temp bool) +0:95 bitwise and ( temp mediump uint) +0:95 'mask3' ( temp mediump uint) +0:95 'mask1' ( temp mediump uint) +0:95 Constant: +0:95 0 (const uint) +0:95 true case +0:96 multiply second child into first child ( temp mediump int) +0:96 'count' ( temp mediump int) +0:96 Constant: +0:96 101 (const int) +0:98 Test condition and select ( temp void) +0:98 Condition +0:98 Compare Equal ( temp bool) +0:98 inclusive-or ( temp mediump uint) +0:98 'mask1' ( temp mediump uint) +0:98 'mask3' ( temp mediump uint) +0:98 'mask4' ( temp mediump uint) +0:98 true case +0:99 multiply second child into first child ( temp mediump int) +0:99 'count' ( temp mediump int) +0:99 Constant: +0:99 102 (const int) +0:101 Test condition and select ( temp void) +0:101 Condition +0:101 Compare Equal ( temp bool) +0:101 exclusive-or ( temp mediump uint) +0:101 'mask1' ( temp mediump uint) +0:101 'mask4' ( temp mediump uint) +0:101 Constant: +0:101 2576 (const uint) +0:101 true case +0:102 multiply second child into first child ( temp mediump int) +0:102 'count' ( temp mediump int) +0:102 Constant: +0:102 103 (const int) +0:104 add second child into first child ( temp mediump 4-component vector of uint) +0:104 'c' ( out mediump 4-component vector of uint) +0:104 Construct uvec4 ( temp mediump 4-component vector of uint) +0:104 Convert int to uint ( temp mediump uint) +0:104 'count' ( temp mediump int) +0:? Linker Objects +0:? 'badu' ( smooth in mediump 2-component vector of uint) +0:? 't' ( flat in mediump 2-component vector of uint) +0:? 'f' ( smooth in highp float) +0:? 'tc' ( smooth in highp 2-component vector of float) +0:? 'bad' ( smooth in bool) +0:? 'v' ( uniform mediump 4-component vector of uint) +0:? 'i' ( uniform mediump int) +0:? 'b' ( uniform bool) +0:? 'c' ( out mediump 4-component vector of uint) +0:? 'usampler' ( uniform lowp usampler2D) + diff --git a/deps/glslang/Test/baseResults/uniformArray.frag.out b/deps/glslang/Test/baseResults/uniformArray.frag.out new file mode 100644 index 00000000..51b9ff03 --- /dev/null +++ b/deps/glslang/Test/baseResults/uniformArray.frag.out @@ -0,0 +1,97 @@ +uniformArray.frag +Shader version: 130 +0:? Sequence +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:9 Sequence +0:9 Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:9 'texColor' ( temp 4-component vector of float) +0:9 add ( temp 4-component vector of float) +0:9 direct index ( temp 4-component vector of float) +0:9 'color' ( uniform 6-element array of 4-component vector of float) +0:9 Constant: +0:9 1 (const int) +0:9 direct index ( temp 4-component vector of float) +0:9 'color' ( uniform 6-element array of 4-component vector of float) +0:9 Constant: +0:9 1 (const int) +0:11 add second child into first child ( temp 3-component vector of float) +0:11 vector swizzle ( temp 3-component vector of float) +0:11 'texColor' ( temp 4-component vector of float) +0:11 Sequence +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 'inColor' ( uniform 3-component vector of float) +0:13 add second child into first child ( temp float) +0:13 direct index ( temp float) +0:13 'texColor' ( temp 4-component vector of float) +0:13 Constant: +0:13 3 (const int) +0:13 direct index ( temp float) +0:13 'alpha' ( uniform 16-element array of float) +0:13 Constant: +0:13 12 (const int) +0:15 move second child to first child ( temp 4-component vector of float) +0:15 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:15 'texColor' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'texSampler2D' ( uniform sampler2D) +0:? 'inColor' ( uniform 3-component vector of float) +0:? 'color' ( uniform 6-element array of 4-component vector of float) +0:? 'alpha' ( uniform 16-element array of float) + + +Linked fragment stage: + + +Shader version: 130 +0:? Sequence +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:9 Sequence +0:9 Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:9 'texColor' ( temp 4-component vector of float) +0:9 add ( temp 4-component vector of float) +0:9 direct index ( temp 4-component vector of float) +0:9 'color' ( uniform 6-element array of 4-component vector of float) +0:9 Constant: +0:9 1 (const int) +0:9 direct index ( temp 4-component vector of float) +0:9 'color' ( uniform 6-element array of 4-component vector of float) +0:9 Constant: +0:9 1 (const int) +0:11 add second child into first child ( temp 3-component vector of float) +0:11 vector swizzle ( temp 3-component vector of float) +0:11 'texColor' ( temp 4-component vector of float) +0:11 Sequence +0:11 Constant: +0:11 0 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 'inColor' ( uniform 3-component vector of float) +0:13 add second child into first child ( temp float) +0:13 direct index ( temp float) +0:13 'texColor' ( temp 4-component vector of float) +0:13 Constant: +0:13 3 (const int) +0:13 direct index ( temp float) +0:13 'alpha' ( uniform 16-element array of float) +0:13 Constant: +0:13 12 (const int) +0:15 move second child to first child ( temp 4-component vector of float) +0:15 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:15 'texColor' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'texSampler2D' ( uniform sampler2D) +0:? 'inColor' ( uniform 3-component vector of float) +0:? 'color' ( uniform 6-element array of 4-component vector of float) +0:? 'alpha' ( uniform 16-element array of float) + diff --git a/deps/glslang/Test/baseResults/variableArrayIndex.frag.out b/deps/glslang/Test/baseResults/variableArrayIndex.frag.out new file mode 100644 index 00000000..ddfb25bf --- /dev/null +++ b/deps/glslang/Test/baseResults/variableArrayIndex.frag.out @@ -0,0 +1,225 @@ +variableArrayIndex.frag +WARNING: 0:3: varying deprecated in version 130; may be removed in future release + +Shader version: 130 +0:? Sequence +0:29 Function Definition: main( ( global void) +0:29 Function Parameters: +0:? Sequence +0:32 Sequence +0:32 move second child to first child ( temp int) +0:32 'iLocal' ( temp int) +0:32 'Count' ( uniform int) +0:34 Test condition and select ( temp void) +0:34 Condition +0:34 Compare Greater Than ( temp bool) +0:34 i: direct index for structure ( global int) +0:34 direct index ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:34 s2_1: direct index for structure ( global 3-element array of structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:34 'foo3' ( uniform structure{ global 3-element array of structure{ global int i, global float f, global structure{ global int i, global float f} s1_1} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 1 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 true case +0:35 move second child to first child ( temp float) +0:35 'scale' ( temp float) +0:35 f: direct index for structure ( global float) +0:35 s1_1: direct index for structure ( global structure{ global int i, global float f}) +0:35 indirect index ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:35 'foo2' ( uniform 5-element array of structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:35 add ( temp int) +0:35 add ( temp int) +0:35 i: direct index for structure ( global int) +0:35 indirect index ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:35 s2_1: direct index for structure ( global 3-element array of structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:35 'foo3' ( uniform structure{ global 3-element array of structure{ global int i, global float f, global structure{ global int i, global float f} s1_1} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:35 Constant: +0:35 0 (const int) +0:35 i: direct index for structure ( global int) +0:35 'foo' ( uniform structure{ global int i, global float f}) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 2 (const int) +0:35 Pre-Increment ( temp int) +0:35 'iLocal' ( temp int) +0:35 Constant: +0:35 2 (const int) +0:35 Constant: +0:35 1 (const int) +0:34 false case +0:37 move second child to first child ( temp float) +0:37 'scale' ( temp float) +0:37 f: direct index for structure ( global float) +0:37 s1_1: direct index for structure ( global structure{ global int i, global float f}) +0:37 direct index ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:37 s2_1: direct index for structure ( global 3-element array of structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:37 'foo3' ( uniform structure{ global 3-element array of structure{ global int i, global float f, global structure{ global int i, global float f} s1_1} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 Constant: +0:37 1 (const int) +0:43 move second child to first child ( temp 4-component vector of float) +0:43 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:43 vector-scale ( temp 4-component vector of float) +0:43 'scale' ( temp float) +0:43 texture ( global 4-component vector of float) +0:43 'sampler' ( uniform sampler2D) +0:43 'coord' ( smooth in 2-component vector of float) +0:45 Sequence +0:45 move second child to first child ( temp 3-element array of 2-component vector of float) +0:45 'constructed' ( temp 3-element array of 2-component vector of float) +0:45 Construct vec2 ( temp 3-element array of 2-component vector of float) +0:45 'coord' ( smooth in 2-component vector of float) +0:45 Construct vec2 ( temp 2-component vector of float) +0:45 'scale' ( temp float) +0:45 Constant: +0:45 1.000000 +0:45 2.000000 +0:46 add second child into first child ( temp 4-component vector of float) +0:46 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:46 Construct vec4 ( temp 4-component vector of float) +0:46 indirect index ( temp 2-component vector of float) +0:46 'constructed' ( temp 3-element array of 2-component vector of float) +0:46 i: direct index for structure ( global int) +0:46 'foo' ( uniform structure{ global int i, global float f}) +0:46 Constant: +0:46 0 (const int) +0:46 indirect index ( temp 2-component vector of float) +0:46 'constructed' ( temp 3-element array of 2-component vector of float) +0:46 i: direct index for structure ( global int) +0:46 'foo' ( uniform structure{ global int i, global float f}) +0:46 Constant: +0:46 0 (const int) +0:? Linker Objects +0:? 'sampler' ( uniform sampler2D) +0:? 'coord' ( smooth in 2-component vector of float) +0:? 'foo' ( uniform structure{ global int i, global float f}) +0:? 'foo2' ( uniform 5-element array of structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:? 'foo3' ( uniform structure{ global 3-element array of structure{ global int i, global float f, global structure{ global int i, global float f} s1_1} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:? 'Count' ( uniform int) + + +Linked fragment stage: + + +Shader version: 130 +0:? Sequence +0:29 Function Definition: main( ( global void) +0:29 Function Parameters: +0:? Sequence +0:32 Sequence +0:32 move second child to first child ( temp int) +0:32 'iLocal' ( temp int) +0:32 'Count' ( uniform int) +0:34 Test condition and select ( temp void) +0:34 Condition +0:34 Compare Greater Than ( temp bool) +0:34 i: direct index for structure ( global int) +0:34 direct index ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:34 s2_1: direct index for structure ( global 3-element array of structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:34 'foo3' ( uniform structure{ global 3-element array of structure{ global int i, global float f, global structure{ global int i, global float f} s1_1} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 1 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 Constant: +0:34 0 (const int) +0:34 true case +0:35 move second child to first child ( temp float) +0:35 'scale' ( temp float) +0:35 f: direct index for structure ( global float) +0:35 s1_1: direct index for structure ( global structure{ global int i, global float f}) +0:35 indirect index ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:35 'foo2' ( uniform 5-element array of structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:35 add ( temp int) +0:35 add ( temp int) +0:35 i: direct index for structure ( global int) +0:35 indirect index ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:35 s2_1: direct index for structure ( global 3-element array of structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:35 'foo3' ( uniform structure{ global 3-element array of structure{ global int i, global float f, global structure{ global int i, global float f} s1_1} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:35 Constant: +0:35 0 (const int) +0:35 i: direct index for structure ( global int) +0:35 'foo' ( uniform structure{ global int i, global float f}) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 0 (const int) +0:35 Constant: +0:35 2 (const int) +0:35 Pre-Increment ( temp int) +0:35 'iLocal' ( temp int) +0:35 Constant: +0:35 2 (const int) +0:35 Constant: +0:35 1 (const int) +0:34 false case +0:37 move second child to first child ( temp float) +0:37 'scale' ( temp float) +0:37 f: direct index for structure ( global float) +0:37 s1_1: direct index for structure ( global structure{ global int i, global float f}) +0:37 direct index ( temp structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:37 s2_1: direct index for structure ( global 3-element array of structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:37 'foo3' ( uniform structure{ global 3-element array of structure{ global int i, global float f, global structure{ global int i, global float f} s1_1} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 0 (const int) +0:37 Constant: +0:37 2 (const int) +0:37 Constant: +0:37 1 (const int) +0:43 move second child to first child ( temp 4-component vector of float) +0:43 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:43 vector-scale ( temp 4-component vector of float) +0:43 'scale' ( temp float) +0:43 texture ( global 4-component vector of float) +0:43 'sampler' ( uniform sampler2D) +0:43 'coord' ( smooth in 2-component vector of float) +0:45 Sequence +0:45 move second child to first child ( temp 3-element array of 2-component vector of float) +0:45 'constructed' ( temp 3-element array of 2-component vector of float) +0:45 Construct vec2 ( temp 3-element array of 2-component vector of float) +0:45 'coord' ( smooth in 2-component vector of float) +0:45 Construct vec2 ( temp 2-component vector of float) +0:45 'scale' ( temp float) +0:45 Constant: +0:45 1.000000 +0:45 2.000000 +0:46 add second child into first child ( temp 4-component vector of float) +0:46 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:46 Construct vec4 ( temp 4-component vector of float) +0:46 indirect index ( temp 2-component vector of float) +0:46 'constructed' ( temp 3-element array of 2-component vector of float) +0:46 i: direct index for structure ( global int) +0:46 'foo' ( uniform structure{ global int i, global float f}) +0:46 Constant: +0:46 0 (const int) +0:46 indirect index ( temp 2-component vector of float) +0:46 'constructed' ( temp 3-element array of 2-component vector of float) +0:46 i: direct index for structure ( global int) +0:46 'foo' ( uniform structure{ global int i, global float f}) +0:46 Constant: +0:46 0 (const int) +0:? Linker Objects +0:? 'sampler' ( uniform sampler2D) +0:? 'coord' ( smooth in 2-component vector of float) +0:? 'foo' ( uniform structure{ global int i, global float f}) +0:? 'foo2' ( uniform 5-element array of structure{ global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:? 'foo3' ( uniform structure{ global 3-element array of structure{ global int i, global float f, global structure{ global int i, global float f} s1_1} s2_1, global int i, global float f, global structure{ global int i, global float f} s1_1}) +0:? 'Count' ( uniform int) + diff --git a/deps/glslang/Test/baseResults/varyingArray.frag.out b/deps/glslang/Test/baseResults/varyingArray.frag.out new file mode 100644 index 00000000..a7b9d23d --- /dev/null +++ b/deps/glslang/Test/baseResults/varyingArray.frag.out @@ -0,0 +1,118 @@ +varyingArray.frag +WARNING: 0:3: varying deprecated in version 130; may be removed in future release +WARNING: 0:4: varying deprecated in version 130; may be removed in future release +WARNING: 0:6: varying deprecated in version 130; may be removed in future release +WARNING: 0:8: varying deprecated in version 130; may be removed in future release + +Shader version: 130 +0:? Sequence +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:12 'texColor' ( temp 4-component vector of float) +0:12 texture ( global 4-component vector of float) +0:12 'texSampler2D' ( uniform sampler2D) +0:12 Construct vec2 ( temp 2-component vector of float) +0:12 add ( temp 4-component vector of float) +0:12 direct index ( smooth temp 4-component vector of float TexCoord) +0:12 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:12 Constant: +0:12 4 (const int) +0:12 direct index ( smooth temp 4-component vector of float TexCoord) +0:12 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:12 Constant: +0:12 5 (const int) +0:14 add second child into first child ( temp 4-component vector of float) +0:14 'texColor' ( temp 4-component vector of float) +0:14 'color' ( smooth in 4-component vector of float) +0:16 move second child to first child ( temp float) +0:16 direct index ( temp float) +0:16 'texColor' ( temp 4-component vector of float) +0:16 Constant: +0:16 3 (const int) +0:16 'alpha' ( smooth in float) +0:18 move second child to first child ( temp 4-component vector of float) +0:18 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:18 add ( temp 4-component vector of float) +0:18 add ( temp 4-component vector of float) +0:18 add ( temp 4-component vector of float) +0:18 direct index ( smooth temp 4-component vector of float) +0:18 'foo' ( smooth in 3-element array of 4-component vector of float) +0:18 Constant: +0:18 1 (const int) +0:18 direct index ( smooth temp 4-component vector of float TexCoord) +0:18 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:18 Constant: +0:18 0 (const int) +0:18 direct index ( smooth temp 4-component vector of float TexCoord) +0:18 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:18 Constant: +0:18 4 (const int) +0:18 'texColor' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'texSampler2D' ( uniform sampler2D) +0:? 'color' ( smooth in 4-component vector of float) +0:? 'alpha' ( smooth in float) +0:? 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:? 'foo' ( smooth in 3-element array of 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 130 +0:? Sequence +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:12 'texColor' ( temp 4-component vector of float) +0:12 texture ( global 4-component vector of float) +0:12 'texSampler2D' ( uniform sampler2D) +0:12 Construct vec2 ( temp 2-component vector of float) +0:12 add ( temp 4-component vector of float) +0:12 direct index ( smooth temp 4-component vector of float TexCoord) +0:12 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:12 Constant: +0:12 4 (const int) +0:12 direct index ( smooth temp 4-component vector of float TexCoord) +0:12 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:12 Constant: +0:12 5 (const int) +0:14 add second child into first child ( temp 4-component vector of float) +0:14 'texColor' ( temp 4-component vector of float) +0:14 'color' ( smooth in 4-component vector of float) +0:16 move second child to first child ( temp float) +0:16 direct index ( temp float) +0:16 'texColor' ( temp 4-component vector of float) +0:16 Constant: +0:16 3 (const int) +0:16 'alpha' ( smooth in float) +0:18 move second child to first child ( temp 4-component vector of float) +0:18 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:18 add ( temp 4-component vector of float) +0:18 add ( temp 4-component vector of float) +0:18 add ( temp 4-component vector of float) +0:18 direct index ( smooth temp 4-component vector of float) +0:18 'foo' ( smooth in 3-element array of 4-component vector of float) +0:18 Constant: +0:18 1 (const int) +0:18 direct index ( smooth temp 4-component vector of float TexCoord) +0:18 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:18 Constant: +0:18 0 (const int) +0:18 direct index ( smooth temp 4-component vector of float TexCoord) +0:18 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:18 Constant: +0:18 4 (const int) +0:18 'texColor' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'texSampler2D' ( uniform sampler2D) +0:? 'color' ( smooth in 4-component vector of float) +0:? 'alpha' ( smooth in float) +0:? 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:? 'foo' ( smooth in 3-element array of 4-component vector of float) + diff --git a/deps/glslang/Test/baseResults/varyingArrayIndirect.frag.out b/deps/glslang/Test/baseResults/varyingArrayIndirect.frag.out new file mode 100644 index 00000000..23872b41 --- /dev/null +++ b/deps/glslang/Test/baseResults/varyingArrayIndirect.frag.out @@ -0,0 +1,124 @@ +varyingArrayIndirect.frag +WARNING: 0:3: varying deprecated in version 130; may be removed in future release +WARNING: 0:4: varying deprecated in version 130; may be removed in future release +WARNING: 0:6: varying deprecated in version 130; may be removed in future release +WARNING: 0:8: varying deprecated in version 130; may be removed in future release + +Shader version: 130 +0:? Sequence +0:12 Function Definition: main( ( global void) +0:12 Function Parameters: +0:14 Sequence +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 'texColor' ( temp 4-component vector of float) +0:14 texture ( global 4-component vector of float) +0:14 'texSampler2D' ( uniform sampler2D) +0:14 Construct vec2 ( temp 2-component vector of float) +0:14 add ( temp 4-component vector of float) +0:14 add ( temp 4-component vector of float) +0:14 indirect index ( smooth temp 4-component vector of float) +0:14 'userIn' ( smooth in 2-element array of 4-component vector of float) +0:14 'b' ( uniform int) +0:14 indirect index ( smooth temp 4-component vector of float TexCoord) +0:14 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:14 'a' ( uniform int) +0:14 direct index ( smooth temp 4-component vector of float TexCoord) +0:14 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:14 Constant: +0:14 5 (const int) +0:16 add second child into first child ( temp 4-component vector of float) +0:16 'texColor' ( temp 4-component vector of float) +0:16 'color' ( smooth in 4-component vector of float) +0:18 move second child to first child ( temp float) +0:18 direct index ( temp float) +0:18 'texColor' ( temp 4-component vector of float) +0:18 Constant: +0:18 3 (const int) +0:18 'alpha' ( smooth in float) +0:20 move second child to first child ( temp 4-component vector of float) +0:20 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:20 add ( temp 4-component vector of float) +0:20 add ( temp 4-component vector of float) +0:20 add ( temp 4-component vector of float) +0:20 direct index ( smooth temp 4-component vector of float TexCoord) +0:20 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:20 Constant: +0:20 0 (const int) +0:20 indirect index ( smooth temp 4-component vector of float TexCoord) +0:20 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:20 'b' ( uniform int) +0:20 'texColor' ( temp 4-component vector of float) +0:20 indirect index ( smooth temp 4-component vector of float) +0:20 'userIn' ( smooth in 2-element array of 4-component vector of float) +0:20 'a' ( uniform int) +0:? Linker Objects +0:? 'texSampler2D' ( uniform sampler2D) +0:? 'color' ( smooth in 4-component vector of float) +0:? 'alpha' ( smooth in float) +0:? 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:? 'userIn' ( smooth in 2-element array of 4-component vector of float) +0:? 'a' ( uniform int) +0:? 'b' ( uniform int) + + +Linked fragment stage: + + +Shader version: 130 +0:? Sequence +0:12 Function Definition: main( ( global void) +0:12 Function Parameters: +0:14 Sequence +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 'texColor' ( temp 4-component vector of float) +0:14 texture ( global 4-component vector of float) +0:14 'texSampler2D' ( uniform sampler2D) +0:14 Construct vec2 ( temp 2-component vector of float) +0:14 add ( temp 4-component vector of float) +0:14 add ( temp 4-component vector of float) +0:14 indirect index ( smooth temp 4-component vector of float) +0:14 'userIn' ( smooth in 2-element array of 4-component vector of float) +0:14 'b' ( uniform int) +0:14 indirect index ( smooth temp 4-component vector of float TexCoord) +0:14 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:14 'a' ( uniform int) +0:14 direct index ( smooth temp 4-component vector of float TexCoord) +0:14 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:14 Constant: +0:14 5 (const int) +0:16 add second child into first child ( temp 4-component vector of float) +0:16 'texColor' ( temp 4-component vector of float) +0:16 'color' ( smooth in 4-component vector of float) +0:18 move second child to first child ( temp float) +0:18 direct index ( temp float) +0:18 'texColor' ( temp 4-component vector of float) +0:18 Constant: +0:18 3 (const int) +0:18 'alpha' ( smooth in float) +0:20 move second child to first child ( temp 4-component vector of float) +0:20 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:20 add ( temp 4-component vector of float) +0:20 add ( temp 4-component vector of float) +0:20 add ( temp 4-component vector of float) +0:20 direct index ( smooth temp 4-component vector of float TexCoord) +0:20 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:20 Constant: +0:20 0 (const int) +0:20 indirect index ( smooth temp 4-component vector of float TexCoord) +0:20 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:20 'b' ( uniform int) +0:20 'texColor' ( temp 4-component vector of float) +0:20 indirect index ( smooth temp 4-component vector of float) +0:20 'userIn' ( smooth in 2-element array of 4-component vector of float) +0:20 'a' ( uniform int) +0:? Linker Objects +0:? 'texSampler2D' ( uniform sampler2D) +0:? 'color' ( smooth in 4-component vector of float) +0:? 'alpha' ( smooth in float) +0:? 'gl_TexCoord' ( smooth in 6-element array of 4-component vector of float TexCoord) +0:? 'userIn' ( smooth in 2-element array of 4-component vector of float) +0:? 'a' ( uniform int) +0:? 'b' ( uniform int) + diff --git a/deps/glslang/Test/baseResults/versionsClean.frag.out b/deps/glslang/Test/baseResults/versionsClean.frag.out new file mode 100644 index 00000000..721d73c0 --- /dev/null +++ b/deps/glslang/Test/baseResults/versionsClean.frag.out @@ -0,0 +1,44 @@ +versionsClean.frag +ERROR: #version: statement must appear first in es-profile shader; before comments or newlines +ERROR: 0:34: '#version' : must occur first in shader +ERROR: 2 compilation errors. No code generated. + + +Shader version: 300 +ERROR: node is still EOpNull! +0:41 Function Definition: main( ( global void) +0:41 Function Parameters: +0:43 Sequence +0:43 move second child to first child ( temp highp 4-component vector of float) +0:43 'foo' ( out highp 4-component vector of float) +0:43 Construct vec4 ( temp highp 4-component vector of float) +0:43 'color' ( smooth in highp 3-component vector of float) +0:43 Constant: +0:43 142.000000 +0:44 Branch: Kill +0:? Linker Objects +0:? 'color' ( smooth in highp 3-component vector of float) +0:? 'foo' ( out highp 4-component vector of float) +0:? 'bar' ( uniform highp sampler2DArrayShadow) + + +Linked fragment stage: + + +Shader version: 300 +ERROR: node is still EOpNull! +0:41 Function Definition: main( ( global void) +0:41 Function Parameters: +0:43 Sequence +0:43 move second child to first child ( temp highp 4-component vector of float) +0:43 'foo' ( out highp 4-component vector of float) +0:43 Construct vec4 ( temp highp 4-component vector of float) +0:43 'color' ( smooth in highp 3-component vector of float) +0:43 Constant: +0:43 142.000000 +0:44 Branch: Kill +0:? Linker Objects +0:? 'color' ( smooth in highp 3-component vector of float) +0:? 'foo' ( out highp 4-component vector of float) +0:? 'bar' ( uniform highp sampler2DArrayShadow) + diff --git a/deps/glslang/Test/baseResults/versionsClean.vert.out b/deps/glslang/Test/baseResults/versionsClean.vert.out new file mode 100644 index 00000000..4b098be7 --- /dev/null +++ b/deps/glslang/Test/baseResults/versionsClean.vert.out @@ -0,0 +1,47 @@ +versionsClean.vert +Shader version: 420 +0:? Sequence +0:40 Function Definition: main( ( global void) +0:40 Function Parameters: +0:42 Sequence +0:42 move second child to first child ( temp 4-component vector of float) +0:42 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:42 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:42 Constant: +0:42 0 (const uint) +0:42 Construct vec4 ( temp 4-component vector of float) +0:42 'color' ( in 3-component vector of float) +0:42 Constant: +0:42 142.000000 +0:? Linker Objects +0:? 'color' ( in 3-component vector of float) +0:? 'foo' ( uniform sampler2DRect) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 420 +0:? Sequence +0:40 Function Definition: main( ( global void) +0:40 Function Parameters: +0:42 Sequence +0:42 move second child to first child ( temp 4-component vector of float) +0:42 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:42 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:42 Constant: +0:42 0 (const uint) +0:42 Construct vec4 ( temp 4-component vector of float) +0:42 'color' ( in 3-component vector of float) +0:42 Constant: +0:42 142.000000 +0:? Linker Objects +0:? 'color' ( in 3-component vector of float) +0:? 'foo' ( uniform sampler2DRect) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/versionsErrors.frag.out b/deps/glslang/Test/baseResults/versionsErrors.frag.out new file mode 100644 index 00000000..dbeb941a --- /dev/null +++ b/deps/glslang/Test/baseResults/versionsErrors.frag.out @@ -0,0 +1,44 @@ +versionsErrors.frag +ERROR: #version: versions before 150 do not allow a profile token +ERROR: 0:38: 'attribute' : not supported in this stage: fragment +ERROR: 0:40: 'sampler2DRect' : Reserved word. +ERROR: 0:44: 'floating-point suffix' : not supported for this version or the enabled extensions +ERROR: 4 compilation errors. No code generated. + + +Shader version: 110 +ERROR: node is still EOpNull! +0:42 Function Definition: main( ( global void) +0:42 Function Parameters: +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of float) +0:44 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:44 Construct vec4 ( temp 4-component vector of float) +0:44 'color' ( smooth in 3-component vector of float) +0:44 Constant: +0:44 142.000000 +0:45 Branch: Kill +0:? Linker Objects +0:? 'color' ( smooth in 3-component vector of float) +0:? 'foo' ( uniform sampler2DRect) + + +Linked fragment stage: + + +Shader version: 110 +ERROR: node is still EOpNull! +0:42 Function Definition: main( ( global void) +0:42 Function Parameters: +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of float) +0:44 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:44 Construct vec4 ( temp 4-component vector of float) +0:44 'color' ( smooth in 3-component vector of float) +0:44 Constant: +0:44 142.000000 +0:45 Branch: Kill +0:? Linker Objects +0:? 'color' ( smooth in 3-component vector of float) +0:? 'foo' ( uniform sampler2DRect) + diff --git a/deps/glslang/Test/baseResults/versionsErrors.vert.out b/deps/glslang/Test/baseResults/versionsErrors.vert.out new file mode 100644 index 00000000..6551364e --- /dev/null +++ b/deps/glslang/Test/baseResults/versionsErrors.vert.out @@ -0,0 +1,57 @@ +versionsErrors.vert +WARNING: 0:38: attribute deprecated in version 130; may be removed in future release +ERROR: 0:38: 'attribute' : no longer supported in core profile; removed in version 420 +ERROR: 0:45: 'discard' : not supported in this stage: vertex +ERROR: 2 compilation errors. No code generated. + + +Shader version: 420 +Requested GL_ARB_texture_rectangle +ERROR: node is still EOpNull! +0:42 Function Definition: main( ( global void) +0:42 Function Parameters: +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of float) +0:44 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:44 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:44 Constant: +0:44 0 (const uint) +0:44 Construct vec4 ( temp 4-component vector of float) +0:44 'color' ( in 3-component vector of float) +0:44 Constant: +0:44 142.000000 +0:45 Branch: Kill +0:? Linker Objects +0:? 'color' ( in 3-component vector of float) +0:? 'foo' ( uniform sampler2DRect) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 420 +Requested GL_ARB_texture_rectangle +ERROR: node is still EOpNull! +0:42 Function Definition: main( ( global void) +0:42 Function Parameters: +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of float) +0:44 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:44 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:44 Constant: +0:44 0 (const uint) +0:44 Construct vec4 ( temp 4-component vector of float) +0:44 'color' ( in 3-component vector of float) +0:44 Constant: +0:44 142.000000 +0:45 Branch: Kill +0:? Linker Objects +0:? 'color' ( in 3-component vector of float) +0:? 'foo' ( uniform sampler2DRect) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/deps/glslang/Test/baseResults/voidFunction.frag.out b/deps/glslang/Test/baseResults/voidFunction.frag.out new file mode 100644 index 00000000..a38509f8 --- /dev/null +++ b/deps/glslang/Test/baseResults/voidFunction.frag.out @@ -0,0 +1,91 @@ +voidFunction.frag +Shader version: 120 +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp float) +0:7 'bar' ( global float) +0:7 Constant: +0:7 2.000000 +0:9 Function Definition: foo( ( global void) +0:9 Function Parameters: +0:11 Sequence +0:11 Post-Increment ( temp float) +0:11 'bar' ( global float) +0:13 Branch: Return +0:16 Function Definition: foo2( ( global void) +0:16 Function Parameters: +0:18 Sequence +0:18 Post-Increment ( temp float) +0:18 'bar' ( global float) +0:21 Function Definition: main( ( global void) +0:21 Function Parameters: +0:23 Sequence +0:23 Sequence +0:23 move second child to first child ( temp 4-component vector of float) +0:23 'outColor' ( temp 4-component vector of float) +0:23 'bigColor' ( uniform 4-component vector of float) +0:25 Function Call: foo( ( global void) +0:27 Function Call: foo2( ( global void) +0:29 add second child into first child ( temp float) +0:29 direct index ( temp float) +0:29 'outColor' ( temp 4-component vector of float) +0:29 Constant: +0:29 0 (const int) +0:29 'bar' ( global float) +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:31 'outColor' ( temp 4-component vector of float) +0:33 Branch: Return +0:? Linker Objects +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'd' ( uniform float) +0:? 'bar' ( global float) + + +Linked fragment stage: + + +Shader version: 120 +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp float) +0:7 'bar' ( global float) +0:7 Constant: +0:7 2.000000 +0:9 Function Definition: foo( ( global void) +0:9 Function Parameters: +0:11 Sequence +0:11 Post-Increment ( temp float) +0:11 'bar' ( global float) +0:13 Branch: Return +0:16 Function Definition: foo2( ( global void) +0:16 Function Parameters: +0:18 Sequence +0:18 Post-Increment ( temp float) +0:18 'bar' ( global float) +0:21 Function Definition: main( ( global void) +0:21 Function Parameters: +0:23 Sequence +0:23 Sequence +0:23 move second child to first child ( temp 4-component vector of float) +0:23 'outColor' ( temp 4-component vector of float) +0:23 'bigColor' ( uniform 4-component vector of float) +0:25 Function Call: foo( ( global void) +0:27 Function Call: foo2( ( global void) +0:29 add second child into first child ( temp float) +0:29 direct index ( temp float) +0:29 'outColor' ( temp 4-component vector of float) +0:29 Constant: +0:29 0 (const int) +0:29 'bar' ( global float) +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:31 'outColor' ( temp 4-component vector of float) +0:33 Branch: Return +0:? Linker Objects +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'd' ( uniform float) +0:? 'bar' ( global float) + diff --git a/deps/glslang/Test/baseResults/vulkan.ast.vert.out b/deps/glslang/Test/baseResults/vulkan.ast.vert.out new file mode 100644 index 00000000..72a45705 --- /dev/null +++ b/deps/glslang/Test/baseResults/vulkan.ast.vert.out @@ -0,0 +1,325 @@ +vulkan.ast.vert +Shader version: 450 +0:? Sequence +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:9 Sequence +0:9 Convert float to bool ( temp bool) +0:9 'scf1' ( specialization-constant const highp float) +0:9 1.000000 +0:10 Construct bool ( specialization-constant const bool) +0:10 'scbt' ( specialization-constant const bool) +0:10 true (const bool) +0:11 Convert int to bool ( specialization-constant const bool) +0:11 'sci2' ( specialization-constant const highp int) +0:11 2 (const int) +0:13 Construct float ( temp float) +0:13 'scf1' ( specialization-constant const highp float) +0:13 1.000000 +0:14 Convert bool to float ( temp float) +0:14 'scbt' ( specialization-constant const bool) +0:14 true (const bool) +0:15 Convert int to float ( temp float) +0:15 'sci2' ( specialization-constant const highp int) +0:15 2 (const int) +0:17 Convert float to int ( temp int) +0:17 'scf1' ( specialization-constant const highp float) +0:17 1.000000 +0:18 Convert bool to int ( specialization-constant const int) +0:18 'scbt' ( specialization-constant const bool) +0:18 true (const bool) +0:19 Construct int ( specialization-constant const int) +0:19 'sci2' ( specialization-constant const highp int) +0:19 2 (const int) +0:21 component-wise multiply ( temp highp float) +0:21 'scf1' ( specialization-constant const highp float) +0:21 1.000000 +0:21 'scf1' ( specialization-constant const highp float) +0:21 1.000000 +0:22 logical-or ( specialization-constant const bool) +0:22 'scbt' ( specialization-constant const bool) +0:22 true (const bool) +0:22 'scbt' ( specialization-constant const bool) +0:22 true (const bool) +0:23 component-wise multiply ( specialization-constant const highp int) +0:23 'sci2' ( specialization-constant const highp int) +0:23 2 (const int) +0:23 'sci2' ( specialization-constant const highp int) +0:23 2 (const int) +0:24 add ( temp highp float) +0:24 'scf1' ( specialization-constant const highp float) +0:24 1.000000 +0:24 Convert int to float ( temp highp float) +0:24 'sci2' ( specialization-constant const highp int) +0:24 2 (const int) +0:26 Negate value ( temp highp float) +0:26 'scf1' ( specialization-constant const highp float) +0:26 1.000000 +0:27 Negate conditional ( specialization-constant const bool) +0:27 'scbt' ( specialization-constant const bool) +0:27 true (const bool) +0:28 Negate value ( specialization-constant const highp int) +0:28 'sci2' ( specialization-constant const highp int) +0:28 2 (const int) +0:30 Compare Greater Than ( temp bool) +0:30 'scf1' ( specialization-constant const highp float) +0:30 1.000000 +0:30 'scf1' ( specialization-constant const highp float) +0:30 1.000000 +0:31 Compare Greater Than ( specialization-constant const bool) +0:31 'sci2' ( specialization-constant const highp int) +0:31 2 (const int) +0:31 'sci2' ( specialization-constant const highp int) +0:31 2 (const int) +0:33 Compare Not Equal ( temp bool) +0:33 'scf1' ( specialization-constant const highp float) +0:33 1.000000 +0:33 'scf1' ( specialization-constant const highp float) +0:33 1.000000 +0:34 Compare Not Equal ( specialization-constant const bool) +0:34 'scbt' ( specialization-constant const bool) +0:34 true (const bool) +0:34 'scbt' ( specialization-constant const bool) +0:34 true (const bool) +0:35 Compare Not Equal ( specialization-constant const bool) +0:35 'sci2' ( specialization-constant const highp int) +0:35 2 (const int) +0:35 'sci2' ( specialization-constant const highp int) +0:35 2 (const int) +0:37 Construct ivec2 ( specialization-constant const 2-component vector of int) +0:37 'sci2' ( specialization-constant const highp int) +0:37 2 (const int) +0:37 'sci2' ( specialization-constant const highp int) +0:37 2 (const int) +0:38 Construct ivec2 ( temp 2-element array of 2-component vector of int) +0:38 Construct ivec2 ( specialization-constant const 2-component vector of int) +0:38 'sci2' ( specialization-constant const highp int) +0:38 2 (const int) +0:38 'sci2' ( specialization-constant const highp int) +0:38 2 (const int) +0:38 Construct ivec2 ( specialization-constant const 2-component vector of int) +0:38 'sci2' ( specialization-constant const highp int) +0:38 2 (const int) +0:38 'sci2' ( specialization-constant const highp int) +0:38 2 (const int) +0:40 Construct vec2 ( temp 2-component vector of float) +0:40 'scf1' ( specialization-constant const highp float) +0:40 1.000000 +0:40 'scf1' ( specialization-constant const highp float) +0:40 1.000000 +0:41 Construct vec2 ( temp 2-element array of 2-component vector of float) +0:41 Construct vec2 ( temp 2-component vector of float) +0:41 'scf1' ( specialization-constant const highp float) +0:41 1.000000 +0:41 'scf1' ( specialization-constant const highp float) +0:41 1.000000 +0:41 Construct vec2 ( temp 2-component vector of float) +0:41 'scf1' ( specialization-constant const highp float) +0:41 1.000000 +0:41 'scf1' ( specialization-constant const highp float) +0:41 1.000000 +0:? Linker Objects +0:? 'scf1' ( specialization-constant const highp float) +0:? 1.000000 +0:? 'scbt' ( specialization-constant const bool) +0:? true (const bool) +0:? 'sci2' ( specialization-constant const highp int) +0:? 2 (const int) + + +Linked vertex stage: + + +Shader version: 450 +0:? Sequence +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:9 Sequence +0:9 Convert float to bool ( temp bool) +0:9 'scf1' ( specialization-constant const highp float) +0:9 1.000000 +0:10 Construct bool ( specialization-constant const bool) +0:10 'scbt' ( specialization-constant const bool) +0:10 true (const bool) +0:11 Convert int to bool ( specialization-constant const bool) +0:11 'sci2' ( specialization-constant const highp int) +0:11 2 (const int) +0:13 Construct float ( temp float) +0:13 'scf1' ( specialization-constant const highp float) +0:13 1.000000 +0:14 Convert bool to float ( temp float) +0:14 'scbt' ( specialization-constant const bool) +0:14 true (const bool) +0:15 Convert int to float ( temp float) +0:15 'sci2' ( specialization-constant const highp int) +0:15 2 (const int) +0:17 Convert float to int ( temp int) +0:17 'scf1' ( specialization-constant const highp float) +0:17 1.000000 +0:18 Convert bool to int ( specialization-constant const int) +0:18 'scbt' ( specialization-constant const bool) +0:18 true (const bool) +0:19 Construct int ( specialization-constant const int) +0:19 'sci2' ( specialization-constant const highp int) +0:19 2 (const int) +0:21 component-wise multiply ( temp highp float) +0:21 'scf1' ( specialization-constant const highp float) +0:21 1.000000 +0:21 'scf1' ( specialization-constant const highp float) +0:21 1.000000 +0:22 logical-or ( specialization-constant const bool) +0:22 'scbt' ( specialization-constant const bool) +0:22 true (const bool) +0:22 'scbt' ( specialization-constant const bool) +0:22 true (const bool) +0:23 component-wise multiply ( specialization-constant const highp int) +0:23 'sci2' ( specialization-constant const highp int) +0:23 2 (const int) +0:23 'sci2' ( specialization-constant const highp int) +0:23 2 (const int) +0:24 add ( temp highp float) +0:24 'scf1' ( specialization-constant const highp float) +0:24 1.000000 +0:24 Convert int to float ( temp highp float) +0:24 'sci2' ( specialization-constant const highp int) +0:24 2 (const int) +0:26 Negate value ( temp highp float) +0:26 'scf1' ( specialization-constant const highp float) +0:26 1.000000 +0:27 Negate conditional ( specialization-constant const bool) +0:27 'scbt' ( specialization-constant const bool) +0:27 true (const bool) +0:28 Negate value ( specialization-constant const highp int) +0:28 'sci2' ( specialization-constant const highp int) +0:28 2 (const int) +0:30 Compare Greater Than ( temp bool) +0:30 'scf1' ( specialization-constant const highp float) +0:30 1.000000 +0:30 'scf1' ( specialization-constant const highp float) +0:30 1.000000 +0:31 Compare Greater Than ( specialization-constant const bool) +0:31 'sci2' ( specialization-constant const highp int) +0:31 2 (const int) +0:31 'sci2' ( specialization-constant const highp int) +0:31 2 (const int) +0:33 Compare Not Equal ( temp bool) +0:33 'scf1' ( specialization-constant const highp float) +0:33 1.000000 +0:33 'scf1' ( specialization-constant const highp float) +0:33 1.000000 +0:34 Compare Not Equal ( specialization-constant const bool) +0:34 'scbt' ( specialization-constant const bool) +0:34 true (const bool) +0:34 'scbt' ( specialization-constant const bool) +0:34 true (const bool) +0:35 Compare Not Equal ( specialization-constant const bool) +0:35 'sci2' ( specialization-constant const highp int) +0:35 2 (const int) +0:35 'sci2' ( specialization-constant const highp int) +0:35 2 (const int) +0:37 Construct ivec2 ( specialization-constant const 2-component vector of int) +0:37 'sci2' ( specialization-constant const highp int) +0:37 2 (const int) +0:37 'sci2' ( specialization-constant const highp int) +0:37 2 (const int) +0:38 Construct ivec2 ( temp 2-element array of 2-component vector of int) +0:38 Construct ivec2 ( specialization-constant const 2-component vector of int) +0:38 'sci2' ( specialization-constant const highp int) +0:38 2 (const int) +0:38 'sci2' ( specialization-constant const highp int) +0:38 2 (const int) +0:38 Construct ivec2 ( specialization-constant const 2-component vector of int) +0:38 'sci2' ( specialization-constant const highp int) +0:38 2 (const int) +0:38 'sci2' ( specialization-constant const highp int) +0:38 2 (const int) +0:40 Construct vec2 ( temp 2-component vector of float) +0:40 'scf1' ( specialization-constant const highp float) +0:40 1.000000 +0:40 'scf1' ( specialization-constant const highp float) +0:40 1.000000 +0:41 Construct vec2 ( temp 2-element array of 2-component vector of float) +0:41 Construct vec2 ( temp 2-component vector of float) +0:41 'scf1' ( specialization-constant const highp float) +0:41 1.000000 +0:41 'scf1' ( specialization-constant const highp float) +0:41 1.000000 +0:41 Construct vec2 ( temp 2-component vector of float) +0:41 'scf1' ( specialization-constant const highp float) +0:41 1.000000 +0:41 'scf1' ( specialization-constant const highp float) +0:41 1.000000 +0:? Linker Objects +0:? 'scf1' ( specialization-constant const highp float) +0:? 1.000000 +0:? 'scbt' ( specialization-constant const bool) +0:? true (const bool) +0:? 'sci2' ( specialization-constant const highp int) +0:? 2 (const int) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 50 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" + Source GLSL 450 + Name 4 "main" + Name 7 "scf1" + Name 11 "scbt" + Name 13 "sci2" + Decorate 7(scf1) SpecId 200 + Decorate 11(scbt) SpecId 201 + Decorate 13(sci2) SpecId 202 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7(scf1): 6(float) SpecConstant 1065353216 + 8: TypeBool + 9: 6(float) Constant 0 + 11(scbt): 8(bool) SpecConstantTrue + 12: TypeInt 32 1 + 13(sci2): 12(int) SpecConstant 2 + 14: TypeInt 32 0 + 15: 14(int) Constant 0 + 16: 8(bool) SpecConstantOp 171 13(sci2) 15 + 17: 6(float) Constant 1065353216 + 21: 12(int) Constant 0 + 22: 12(int) Constant 1 + 23: 12(int) SpecConstantOp 169 11(scbt) 22 21 + 25: 8(bool) SpecConstantOp 166 11(scbt) 11(scbt) + 26: 12(int) SpecConstantOp 132 13(sci2) 13(sci2) + 30: 8(bool) SpecConstantOp 168 11(scbt) + 31: 12(int) SpecConstantOp 126 13(sci2) + 33: 8(bool) SpecConstantOp 173 13(sci2) 13(sci2) + 35: 8(bool) SpecConstantOp 165 11(scbt) 11(scbt) + 36: 8(bool) SpecConstantOp 171 13(sci2) 13(sci2) + 37: TypeVector 12(int) 2 + 38: 37(ivec2) SpecConstantComposite 13(sci2) 13(sci2) + 39: 37(ivec2) SpecConstantComposite 13(sci2) 13(sci2) + 40: 37(ivec2) SpecConstantComposite 13(sci2) 13(sci2) + 41: 14(int) Constant 2 + 42: TypeArray 37(ivec2) 41 + 44: TypeVector 6(float) 2 + 48: TypeArray 44(fvec2) 41 + 4(main): 2 Function None 3 + 5: Label + 10: 8(bool) FOrdNotEqual 7(scf1) 9 + 18: 6(float) Select 11(scbt) 17 9 + 19: 6(float) ConvertSToF 13(sci2) + 20: 12(int) ConvertFToS 7(scf1) + 24: 6(float) FMul 7(scf1) 7(scf1) + 27: 6(float) ConvertSToF 13(sci2) + 28: 6(float) FAdd 7(scf1) 27 + 29: 6(float) FNegate 7(scf1) + 32: 8(bool) FOrdGreaterThan 7(scf1) 7(scf1) + 34: 8(bool) FOrdNotEqual 7(scf1) 7(scf1) + 43: 42 CompositeConstruct 39 40 + 45: 44(fvec2) CompositeConstruct 7(scf1) 7(scf1) + 46: 44(fvec2) CompositeConstruct 7(scf1) 7(scf1) + 47: 44(fvec2) CompositeConstruct 7(scf1) 7(scf1) + 49: 48 CompositeConstruct 46 47 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/vulkan.comp.out b/deps/glslang/Test/baseResults/vulkan.comp.out new file mode 100644 index 00000000..e56dca48 --- /dev/null +++ b/deps/glslang/Test/baseResults/vulkan.comp.out @@ -0,0 +1,6 @@ +vulkan.comp +ERROR: 0:5: 'local_size' : cannot change previously set size +ERROR: 1 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/vulkan.frag.out b/deps/glslang/Test/baseResults/vulkan.frag.out new file mode 100644 index 00000000..c81ed25a --- /dev/null +++ b/deps/glslang/Test/baseResults/vulkan.frag.out @@ -0,0 +1,62 @@ +vulkan.frag +ERROR: 0:3: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:4: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:5: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:6: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:8: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:9: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:10: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:14: 'sampler2D' : sampler-constructor requires two arguments +ERROR: 0:15: 'sampler2D' : sampler-constructor first argument must be a scalar textureXXX type +ERROR: 0:16: 'sampler2D' : sampler-constructor first argument must be a scalar textureXXX type +ERROR: 0:17: 'sampler2D' : sampler-constructor second argument must be a scalar type 'sampler' +ERROR: 0:18: 'sampler2D' : sampler-constructor second argument must be a scalar type 'sampler' +ERROR: 0:19: 'sampler2D' : sampler-constructor second argument must be a scalar type 'sampler' +ERROR: 0:21: 'sampler3D' : sampler-constructor cannot make an array of samplers +ERROR: 0:22: 'sampler2D' : sampler-constructor first argument must be a scalar textureXXX type +ERROR: 0:23: 'sampler2D' : sampler-constructor first argument must match type and dimensionality of constructor type +ERROR: 0:28: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: s2D +ERROR: 0:29: 'sampler3D' : sampler-constructor cannot make an array of samplers +ERROR: 0:29: 'sampler3D' : sampler/image types can only be used in uniform variables or function parameters: s3d +ERROR: 0:29: '=' : cannot convert from ' const float' to ' global 4-element array of highp sampler3D' +ERROR: 0:31: 'location' : SPIR-V requires location for user input/output +ERROR: 0:39: 'push_constant' : can only be used with a uniform +ERROR: 0:43: 'non-opaque uniforms outside a block' : not allowed when using GLSL for Vulkan +ERROR: 0:43: 'push_constant' : can only be used with a block +ERROR: 0:45: 'push_constant' : cannot declare a default, can only be used on a block +ERROR: 0:51: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:52: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:52: 'input_attachment_index' : can only be used with a subpass +ERROR: 0:53: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:53: 'input_attachment_index' : can only be used with a subpass +ERROR: 0:54: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:54: 'subpass' : requires an input_attachment_index layout qualifier +ERROR: 0:55: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:60: 'subpassLoadMS' : no matching overloaded function found +ERROR: 0:61: 'subpassLoad' : no matching overloaded function found +ERROR: 0:63: 'subpassLoadMS' : no matching overloaded function found +ERROR: 0:66: 'subroutine' : not allowed when generating SPIR-V +ERROR: 0:66: 'subroutine' : feature not yet implemented +ERROR: 0:67: 'subroutine' : not allowed when generating SPIR-V +ERROR: 0:67: 'subroutine' : feature not yet implemented +ERROR: 0:69: 'non-opaque uniforms outside a block' : not allowed when using GLSL for Vulkan +ERROR: 0:73: 'texture' : no matching overloaded function found +ERROR: 0:74: 'imageStore' : no matching overloaded function found +WARNING: 0:82: '' : all default precisions are highp; use precision statements to quiet warning, e.g.: + "precision mediump int; precision highp float;" +ERROR: 0:91: 'call argument' : sampler constructor must appear at point of use +ERROR: 0:92: 'call argument' : sampler constructor must appear at point of use +ERROR: 0:93: ',' : sampler constructor must appear at point of use +ERROR: 0:94: ':' : wrong operand types: no operation ':' exists that takes a left-hand operand of type ' temp sampler2D' and a right operand of type ' temp sampler2D' (or there is no acceptable conversion) +ERROR: 0:94: 'call argument' : sampler constructor must appear at point of use +ERROR: 0:96: 'gl_NumSamples' : undeclared identifier +ERROR: 0:101: 'noise1' : no matching overloaded function found +ERROR: 0:102: 'noise2' : no matching overloaded function found +ERROR: 0:103: 'noise3' : no matching overloaded function found +ERROR: 0:104: 'noise4' : no matching overloaded function found +ERROR: 53 compilation errors. No code generated. + + +ERROR: Linking fragment stage: Only one push_constant block is allowed per stage + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/vulkan.vert.out b/deps/glslang/Test/baseResults/vulkan.vert.out new file mode 100644 index 00000000..19fdade5 --- /dev/null +++ b/deps/glslang/Test/baseResults/vulkan.vert.out @@ -0,0 +1,43 @@ +vulkan.vert +ERROR: 0:3: 'subpass input' : not supported in this stage: vertex +ERROR: 0:3: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:4: 'subpass input' : not supported in this stage: vertex +ERROR: 0:4: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:5: 'subpass input' : not supported in this stage: vertex +ERROR: 0:5: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:6: 'subpass input' : not supported in this stage: vertex +ERROR: 0:6: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:7: 'subpass input' : not supported in this stage: vertex +ERROR: 0:7: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:8: 'subpass input' : not supported in this stage: vertex +ERROR: 0:8: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:10: 'location' : SPIR-V requires location for user input/output +ERROR: 0:12: 'constant_id' : can only be applied to a scalar +ERROR: 0:13: 'constant_id' : specialization-constant id already used +ERROR: 0:13: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:13: 'constant_id' : can only be applied to 'const'-qualified scalar +ERROR: 0:13: 'constant_id' : cannot be applied to this type +ERROR: 0:14: 'constant_id' : specialization-constant id is too large +ERROR: 0:15: 'constant_id' : can only be applied to a scalar +ERROR: 0:16: 'constant_id' : specialization-constant id already used +ERROR: 0:16: 'constant_id' : cannot declare a default, can only be used on a scalar +ERROR: 0:20: 'subpassLoad' : no matching overloaded function found +ERROR: 0:20: 'assign' : cannot convert from ' const float' to ' smooth out highp 4-component vector of float' +ERROR: 0:23: 'atomic counter types' : not allowed when using GLSL for Vulkan +ERROR: 0:24: 'shared' : not allowed when generating SPIR-V +ERROR: 0:25: 'packed' : not allowed when generating SPIR-V +ERROR: 0:32: 'initializer' : can't use with types containing arrays sized with a specialization constant +ERROR: 0:34: '=' : can't use with types containing arrays sized with a specialization constant +ERROR: 0:35: '==' : can't use with types containing arrays sized with a specialization constant +ERROR: 0:39: 'set' : cannot be used with push_constant +ERROR: 0:49: '[]' : only outermost dimension of an array of arrays can be a specialization constant +ERROR: 0:50: '[]' : only outermost dimension of an array of arrays can be a specialization constant +ERROR: 0:51: '[]' : only outermost dimension of an array of arrays can be a specialization constant +ERROR: 0:54: '[]' : only outermost dimension of an array of arrays can be a specialization constant +ERROR: 0:54: 'location' : SPIR-V requires location for user input/output +ERROR: 0:58: 'location' : SPIR-V requires location for user input/output +ERROR: 0:65: 'location' : overlapping use of location 10 +ERROR: 38 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/whileLoop.frag.out b/deps/glslang/Test/baseResults/whileLoop.frag.out new file mode 100644 index 00000000..cfe972da --- /dev/null +++ b/deps/glslang/Test/baseResults/whileLoop.frag.out @@ -0,0 +1,65 @@ +whileLoop.frag +Shader version: 110 +0:? Sequence +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:9 Sequence +0:9 Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:9 'color' ( temp 4-component vector of float) +0:9 'BaseColor' ( smooth in 4-component vector of float) +0:11 Loop with condition tested first +0:11 Loop Condition +0:11 Compare Less Than ( temp bool) +0:11 direct index ( temp float) +0:11 'color' ( temp 4-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 'd' ( uniform float) +0:11 Loop Body +0:12 Sequence +0:12 add second child into first child ( temp 4-component vector of float) +0:12 'color' ( temp 4-component vector of float) +0:12 'bigColor' ( uniform 4-component vector of float) +0:15 move second child to first child ( temp 4-component vector of float) +0:15 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:15 'color' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'd' ( uniform float) + + +Linked fragment stage: + + +Shader version: 110 +0:? Sequence +0:7 Function Definition: main( ( global void) +0:7 Function Parameters: +0:9 Sequence +0:9 Sequence +0:9 move second child to first child ( temp 4-component vector of float) +0:9 'color' ( temp 4-component vector of float) +0:9 'BaseColor' ( smooth in 4-component vector of float) +0:11 Loop with condition tested first +0:11 Loop Condition +0:11 Compare Less Than ( temp bool) +0:11 direct index ( temp float) +0:11 'color' ( temp 4-component vector of float) +0:11 Constant: +0:11 0 (const int) +0:11 'd' ( uniform float) +0:11 Loop Body +0:12 Sequence +0:12 add second child into first child ( temp 4-component vector of float) +0:12 'color' ( temp 4-component vector of float) +0:12 'bigColor' ( uniform 4-component vector of float) +0:15 move second child to first child ( temp 4-component vector of float) +0:15 'gl_FragColor' ( fragColor 4-component vector of float FragColor) +0:15 'color' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'bigColor' ( uniform 4-component vector of float) +0:? 'BaseColor' ( smooth in 4-component vector of float) +0:? 'd' ( uniform float) + diff --git a/deps/glslang/Test/bump b/deps/glslang/Test/bump new file mode 100644 index 00000000..03df6327 --- /dev/null +++ b/deps/glslang/Test/bump @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +cp localResults/* baseResults/ + diff --git a/deps/glslang/Test/comment.frag b/deps/glslang/Test/comment.frag new file mode 100644 index 00000000..f5c565c2 --- /dev/null +++ b/deps/glslang/Test/comment.frag @@ -0,0 +1,19 @@ + + // +/* anotehn t* ontuh * / tnoahnt /* oo */ +/* multi line... + +ao */ +/* no escape \ +oanot */ +// escape nothing \o oeu +// escape newline \ +still in a comment +// escape newline \ + +// a different comment +#version 430 core +in vec4 v; +void main() {} + + diff --git a/deps/glslang/Test/compoundsuffix.frag.hlsl b/deps/glslang/Test/compoundsuffix.frag.hlsl new file mode 100644 index 00000000..59322acd --- /dev/null +++ b/deps/glslang/Test/compoundsuffix.frag.hlsl @@ -0,0 +1,6 @@ +void main(out float4 fragColor : SV_TARGET0) +{ + fragColor = 1; +} + + diff --git a/deps/glslang/Test/compoundsuffix.vert.glsl b/deps/glslang/Test/compoundsuffix.vert.glsl new file mode 100644 index 00000000..26862fff --- /dev/null +++ b/deps/glslang/Test/compoundsuffix.vert.glsl @@ -0,0 +1,4 @@ +void main() +{ + gl_Position = vec4(1.0); +} \ No newline at end of file diff --git a/deps/glslang/Test/conditionalDiscard.frag b/deps/glslang/Test/conditionalDiscard.frag new file mode 100644 index 00000000..58e6fa5d --- /dev/null +++ b/deps/glslang/Test/conditionalDiscard.frag @@ -0,0 +1,14 @@ +#version 110 + +uniform sampler2D tex; +varying vec2 coord; + +void main (void) +{ + vec4 v = texture2D(tex, coord); + + if (v == vec4(0.1,0.2,0.3,0.4)) + discard; + + gl_FragColor = v; +} diff --git a/deps/glslang/Test/constErrors.frag b/deps/glslang/Test/constErrors.frag new file mode 100644 index 00000000..0067af11 --- /dev/null +++ b/deps/glslang/Test/constErrors.frag @@ -0,0 +1,35 @@ +#version 330 + +in vec4 inVar; +out vec4 outVar; + +const int constInt = 3; + +uniform int uniformInt; + +void main() +{ + const int a1 = 2; // okay + const int a2 = constInt; // okay + const int a3 = uniformInt; // error + + vec4 c[constInt]; // okay + vec4 d[uniformInt]; // error + vec4 e[constInt + uniformInt]; // error + vec4 f[uniformInt + constInt]; // error + + vec4 g[int(sin(0.3)) + 1]; // okay +} + +const struct S { + vec3 v3; + ivec2 iv2; +} s = S(vec3(3.0), ivec2(3, constInt + uniformInt)); // ERROR, non-const y componenent + +const struct S2 { + vec3 v3; + ivec2 iv2; + mat2x4 m; +} s2 = S2(vec3(3.0), ivec2(3, constInt), mat2x4(1.0, 2.0, 3.0, inVar.x, 5.0, 6.0, 7.0, 8.0)); // ERROR, non-constant matrix + +const float f = 3; // okay, type conversion diff --git a/deps/glslang/Test/constFold.frag b/deps/glslang/Test/constFold.frag new file mode 100644 index 00000000..daecaa2a --- /dev/null +++ b/deps/glslang/Test/constFold.frag @@ -0,0 +1,148 @@ +#version 430 + +const int a = 1; +const int b = 2; +const int c = a + b; // 3 +const int d = c - a; // 2 +const float e = float(d); // 2.0 +const float f = e * float(c); // 6.0 +const float g = f / float(d); // 3.0 + +const vec2 pytho = vec2(3.0, 4.0); + +in vec4 inv; +out vec4 FragColor; +out vec2 out2; +out vec4 out3; +out vec4 out4; +out ivec4 out5; +out vec3 out6; +out vec4 out7; +out vec4 out8; +out vec4 out9; +out vec4 out10; +out vec4 out11; +out ivec2 out12; +out uvec3 out13; + +void main() +{ + vec4 dx = dFdx(inv); + const ivec4 v = ivec4(a, b, c, d); + vec4 array2[v.y]; // 2 + const ivec4 u = ~v; + + const float h = degrees(g); // 171.88 + + FragColor = vec4(e, f, g, h); // 2, 6, 3, 171.88 + + vec4 array3[c]; // 3 + vec4 arrayMax[int(max(float(array2.length()), float(array3.length())))]; + vec4 arrayMin[int(min(float(array2.length()), float(array3.length())))]; + FragColor = vec4(arrayMax.length(), arrayMin.length(), sin(3.14), cos(3.14)); // 3, 2, .00159, -.999 + out2 = length(pytho) + normalize(pytho) + dFdx(pytho) + dFdy(pytho) + fwidth(pytho); // 5+3/5, 5+4/5 + out3 = vec4(exp(3.0), log(10.0), exp2(4.0), log2(256.0)); // 20.08, 2.3, 16, 8 + out4 = vec4(sqrt(100.0), inversesqrt(100.0), abs(-4.7), abs(10.9)); // 10, .1, 4.7, 10.9 + out5 = ivec4(abs(-8) + sign(0), abs(17), sign(-12), sign(9)); // 8, 17, -1, 1 + out6 = vec3(sign(-8.8), sign(18.0), sign(0.0)); // -1.0, 1.0, 0.0 + out7 = vec4(floor(4.2), ceil(-4.1), trunc(5.9), trunc(-5.9)); // 4, -4, 5, -5 + out8 = vec4(round(4.4), round(4.6), roundEven(4.5), roundEven(-5.5)); // 4, 5, 4, -6 + out9 = vec4(roundEven(7.5), roundEven(-4.5), fract(2.345), fract(-2.6)); // 8, -4, .345, 0.4 + out10 = vec4(isinf(4.0/0.0), isinf(-3.0/0.0), isinf(0.0/0.0), isinf(-93048593405938405938405.0)); // true, true, false, false -> 1.0, 1.0, 0.0, 0.0 + out11 = vec4(isnan(4.0/0.0), isnan(-3.0/0.0), isnan(0.0/0.0), isnan(-93048593405938405938405.0)); // false, false, true, false -> 0.0, 1.0, 0.0, 0.0 + out11 = vec4(tan(0.8), atan(1.029), atan(8.0, 10.0), atan(10000.0)); // 1.029, 0.8, 0.6747, 1.57 + out11 = vec4(asin(0.0), asin(0.5), acos(0.0), acos(0.5)); // 0.0, .523599, 1.57, 1.047 + + const vec4 v1 = vec4(1.0, 0.0, 0.5, -0.2); + const vec4 v2 = vec4(0.2, 0.3, 0.4, 0.5); + out11 = atan(v1, v2); // 1.373401, 0.0, 0.896055, -0.380506 + + const ivec2 v3 = ivec2(15.0, 17.0); + const ivec2 v4 = ivec2(17.0, 15.0); + out12 = min(v3, 16); // 15, 16 + out12 = max(v3, v4); // 17, 17 + out2 = pow(vec2(v3), vec2(2.5, 3.0)); // 871.4, 4913 + out13 = clamp(uvec3(1, 20, 50), 10u, 30u); // 10, 20, 30 + out2 = mix(vec2(3.0, 4.0), vec2(5.0, 6.0), bvec2(false, true)); // 3.0, 6.0 + out2 = mix(vec2(3.0, 4.0), vec2(5.0, 6.0), 0.25); // 3.5, 4.5 + out2 = step(0.5, vec2(0.2, 0.6)); // 0.0, 1.0 + out11 = smoothstep(50.0, 60.0, vec4(40.0, 51.0, 55.0, 70.0)); // 0.0, 0.028, 0.5, 1.0 +} + +const struct S { + vec3 v3; + ivec2 iv2; + mat2x4 m; +} s = S(vec3(3.0), ivec2(3, a + b), mat2x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0)); + +void foo() +{ + float a[s.iv2.y]; // 3 element array + a[0] = s.m[1].z; // 7.0 + b % 0; // int + b / 0; + e / 0; -e / 0; 0.0 / 0.0; + const uint ua = 5; + const uvec2 ub = uvec2(6, 7); + const uint uc = 8; + ub % 4u; + 0u % uc; + ub % 0u; +} + +const mat2 m2 = mat2(2, 3, 4, 5); +const mat3 m3 = mat3(m2); +const int mc = int(m3[2][2]); +float a1[mc]; +float a2[int(m3[2][1]) + 2]; // size 2 +float a3[int(m3[1][0])]; // size 4 +const vec2 v2 = vec2(1, 2); +const vec3 v3 = vec3(3, 4, 5); +float a4[uint(mat3(v2, v3, v2, v2)[2][2])]; // size 2 + +void foo2() +{ + a1[0]; // array size 1 + a2[0]; // array size 2 + a3[0]; // array size 4 + a4[0]; // array size 2 + v2[-1]; // ERROR + v3[4]; // ERROR + m3[0][-2]; // ERROR + m2[-1][1]; // ERROR + m3[1][3]; // ERROR + m3[3][1]; // ERROR + int p; + p = -2147483647 / -1; + p = -2147483648 / -1; + p = 2147483647 / -1; + float f = vec4(7.8 < 2.4 ? -1.333 : 1.444).a; + f = vec4(inv.x < 2.4 ? -1.0 : 1.0).a; // not folded, ensuring no propagation +} + +const mat2 mm2 = mat2(1.0, 2.0, 3.0, 4.0); +const mat3x2 mm32 = mat3x2(10.0, 11.0, 12.0, 13.0, 14.0, 15.0); + +void foo3() +{ + mat3x2 r32 = mm2 * mm32; +} + +struct cag { + int i; + float f; + bool b; +}; +const cag a0[3] = cag[3](cag(3, 2.0, true), cag(1, 5.0, true), cag(1, 9.0, false)); + +void foo4() +{ + int a = int(a0[2].f); +} + +const bool cval1 = all(bvec4(true, true, true, true)); +const bool cval2 = all(bvec4(false, false, false, false)); +const bool cval3 = all(bvec4(true, true, false, true)); +const bool cval4 = any(bvec4(true, true, true, true)); +const bool cval5 = any(bvec4(false, false, false, false)); +const bool cval6 = any(bvec4(false, true, false, false)); diff --git a/deps/glslang/Test/constFoldIntMin.frag b/deps/glslang/Test/constFoldIntMin.frag new file mode 100644 index 00000000..68618326 --- /dev/null +++ b/deps/glslang/Test/constFoldIntMin.frag @@ -0,0 +1,12 @@ +#version 460 core +#extension GL_AMD_gpu_shader_int16 : enable +#extension GL_ARB_gpu_shader_int64 : enable + +void a(){ + int16_t u = -32768S / -1S; // SHRT_MIN + int v = -2147483648 / -1; // INT_MIN + int64_t w = -9223372036854775808L / -1L; // LLONG_MIN + int16_t x = -32768S % -1S; // SHRT_MIN + int y = -2147483648 % -1; // INT_MIN + int64_t z = -9223372036854775808L % -1L; // LLONG_MIN +} \ No newline at end of file diff --git a/deps/glslang/Test/conversion.frag b/deps/glslang/Test/conversion.frag new file mode 100644 index 00000000..f17293b8 --- /dev/null +++ b/deps/glslang/Test/conversion.frag @@ -0,0 +1,112 @@ +#version 130 + +uniform bool u_b; +uniform bvec2 u_b2; +uniform bvec3 u_b3; +uniform bvec4 u_b4; + +uniform int u_i; +uniform ivec2 u_i2; +uniform ivec3 u_i3; +uniform ivec4 u_i4; + +uniform float u_f; +uniform vec2 u_f2; +uniform vec3 u_f3; +uniform vec4 u_f4; + +uniform bool i_b; +uniform bvec2 i_b2; +uniform bvec3 i_b3; +uniform bvec4 i_b4; + +flat in int i_i; +flat in ivec2 i_i2; +flat in ivec3 i_i3; +flat in ivec4 i_i4; + +in float i_f; +in vec2 i_f2; +in vec3 i_f3; +in vec4 i_f4; + +void main() +{ + bool b = bool(u_i) ^^ bool(u_f); + bvec2 b2 = bvec2(u_i, u_f); + bvec3 b3 = bvec3(u_i, u_f, i_i); + bvec4 b4 = bvec4(u_i, u_f, i_i, i_f); + + int i = int(u_f) + int(b); + ivec2 i2 = ivec2(u_f2) + ivec2(b2); + ivec3 i3 = ivec3(u_f3) + ivec3(b3); + ivec4 i4 = ivec4(u_f4) + ivec4(b4); + + float f = i; + vec2 f2 = i2; + vec3 f3 = i3; + vec4 f4 = i4; + + f += (float(i) + float(b)); + f2 -= vec2(i2) + vec2(b2); + f3 /= vec3(i3) + vec3(b3); + f4 += vec4(i4) + vec4(b4); + + f4 += vec4(bvec4(i_i4)); + f4 += vec4(bvec4(u_f4)); + + f += f - i; + f2 += vec2(f, i) + i2; + f3 += i3 + vec3(f, i, f); + f4 += vec4(b, i, f, i) + i4; + + f2 += vec2(f, i) * i; + f3 += vec3(f, i, f) + i; + f4 += i - vec4(b, i, f, i); + + i2 += ivec2(f, i); + i3 += ivec3(f, i, f); + i4 += ivec4(b, i, f, i); + + if (f < i || i < f || + f2 == i2 || + i3 != f3) + f = (b ? i : f2.x) + (b2.x ? f3.x : i2.y); + + gl_FragColor = + b || + b2.x || + b2.y || + b3.x || + b3.y || + b3.z || + b4.x || + b4.y || + b4.z || + b4.w ? vec4( + i + + i2.x + + i2.y + + i3.x + + i3.y + + i3.z + + i4.x + + i4.y + + i4.z + + i4.w + + f + + f2.x + + f2.y + + f3.x + + f3.y + + f3.z + + f4.x + + f4.y + + f4.z + + f4.w) : vec4(1.0); + + // with constants... + ivec4 cv2 = ivec4(1.0); + bvec4 cv5 = bvec4(cv2); + gl_FragColor += float(cv5); +} diff --git a/deps/glslang/Test/cppBad.vert b/deps/glslang/Test/cppBad.vert new file mode 100644 index 00000000..0044c44f --- /dev/null +++ b/deps/glslang/Test/cppBad.vert @@ -0,0 +1,5 @@ +#define m#0# +#if m +#endif +#define n() +int n" \ No newline at end of file diff --git a/deps/glslang/Test/cppBad2.vert b/deps/glslang/Test/cppBad2.vert new file mode 100644 index 00000000..5e61b49e --- /dev/null +++ b/deps/glslang/Test/cppBad2.vert @@ -0,0 +1,3 @@ +#define a b( +#define b(x) +b(a) \ No newline at end of file diff --git a/deps/glslang/Test/cppComplexExpr.vert b/deps/glslang/Test/cppComplexExpr.vert new file mode 100644 index 00000000..bce5ffa3 --- /dev/null +++ b/deps/glslang/Test/cppComplexExpr.vert @@ -0,0 +1,183 @@ +#version 300 es +#define ON1 +#define ON2 +float sum = 0.0; + +void main() +{ +#if defined(ON1) && (defined(OFF) || defined(ON2)) +//yes + sum += 1.0; +#endif + +#if !defined(ON1) || (defined(OFF) || (!defined(OFF2) && defined(ON2))) +//yes + sum += 20.0; +#endif + +#if defined(ON1) && (defined(OFF) || !defined(ON2)) +//no + sum += 0.1; +#endif + +#if !defined(ON1) || (defined(OFF) || !defined(OFF2) && !defined(ON2)) +//no + sum += 0.2; +#endif + +#if !defined(ON1) || !defined(OFF) || defined(ON2) && defined(OFF2) +//yes + sum += 300.0; +#endif + +#if (!defined(ON1) || !defined(OFF) || defined(ON2)) && defined(OFF2) +//no + sum += 0.4; +#endif + +// sum should be 321.0 + gl_Position = vec4(sum); +} + +#define ADD(a, b) a + b + ((a) + ((b))); + +float foo() +{ + return ADD(gl_Position.xyxwx, 3.0) // ERROR, should be this line number + return ADD(gl_Position.y, 3.0) +} + +#define BIG aonetuhanoethuanoenaoethu snaoetuhs onethausoentuas hnoethaueohnatuoeh santuoehsantouhe snathoensuta hsnoethuasntoe hsnuathoesnuathoenstuh nsoethantseuh toae ua \ + antoeh uantheount oentahoent uahnsoethasnutoehansteuo santhu sneoathu snoethasnut oesanthoesna thusenotha nsthasunoeth ausntehsunathoensuathoesnta uhnsoetha usntoeh uanhs unosethu \ + antoehunatoehu natoehua oentha neotuhan toehu natoehu ntahoe nutah eu natoheunathoen uasoenuasoent asntoehsan tuosnthnu aohenuath eontha untoh eunth unth anth unth nth nth nt \ + a ntoehanu tunth nsont uhansoethausn oehsanthnt heauo eanthuo sh nahnoethansu tohe sanuthoe snathuoesntha snuothe anthusonehtasuntoeh asnuthonsa teauhntoeha onetuha nth \ + anoethuan toentauh noethauntohe anuthoe nathu noethaun oethanuthoe nathuoe ntahu enotha unetha ntuhenaothu enotahun eotha ntoehu aoehuntha enotuh aonethau noethu anoethuna toheua \ + ontehanutoe hnuathoena aoteha aonetuha + +// identical +#define BIG aonetuhanoethuanoenaoethu snaoetuhs onethausoentuas hnoethaueohnatuoeh santuoehsantouhe snathoensuta hsnoethuasntoe hsnuathoesnuathoenstuh nsoethantseuh toae ua \ + antoeh uantheount oentahoent uahnsoethasnutoehansteuo santhu sneoathu snoethasnut oesanthoesna thusenotha nsthasunoeth ausntehsunathoensuathoesnta uhnsoetha usntoeh uanhs unosethu \ + antoehunatoehu natoehua oentha neotuhan toehu natoehu ntahoe nutah eu natoheunathoen uasoenuasoent asntoehsan tuosnthnu aohenuath eontha untoh eunth unth anth unth nth nth nt \ + a ntoehanu tunth nsont uhansoethausn oehsanthnt heauo eanthuo sh nahnoethansu tohe sanuthoe snathuoesntha snuothe anthusonehtasuntoeh asnuthonsa teauhntoeha onetuha nth \ + anoethuan toentauh noethauntohe anuthoe nathu noethaun oethanuthoe nathuoe ntahu enotha unetha ntuhenaothu enotahun eotha ntoehu aoehuntha enotuh aonethau noethu anoethuna toheua \ + ontehanutoe hnuathoena aoteha aonetuha + +// ERROR, one character different +#define BIG aonetuhanoethuanoenaoethu snaoetuhs onethausoentuas hnoethaueohnatuoeh santuoehsantouhe snathoensuta hsnoethuasntoe hsnuathoesnuathoenstuh nsoethantseuh toae ua \ + antoeh uantheount oentahoent uahnsoethasnutoehansteuo santhu sneoathu snoethasnut oesanthoesna thusenotha nsthasunoeth ausntehsunathoensuathoesnta uhnsoetha usntoeh uanhs unosethu \ + antoehunatoehu natoehua oentha neotuhan toehu natoehu ntahoe nutah eu natoheunathoen uasoenuasoent asntoehsan tuosnthnu aohenuath eontha untoh eunth unth anth unth nth nth nt \ + a ntoehanu tunth nsont uhansoethasn oehsanthnt heauo eanthuo sh nahnoethansu tohe sanuthoe snathuoesntha snuothe anthusonehtasuntoeh asnuthonsa teauhntoeha onetuha nth \ + anoethuan toentauh noethauntohe anuthoe nathu noethaun oethanuthoe nathuoe ntahu enotha unetha ntuhenaothu enotahun eotha ntoehu aoehuntha enotuh aonethau noethu anoethuna toheua \ + ontehanutoe hnuathoena aoteha aonetuha + +#define BIGARGS1(aonthanotehu, bonthanotehu, conthanotehu, donthanotehu, eonthanotehu, fonthanotehu, gonthanotehu, honthanotehu, ionthanotehu, jonthanotehu, konthanotehu) jonthanotehu +#define BIGARGS2(aonthanotehu, bonthanotehu, conthanotehu, donthanotehu, eonthanotehu, fonthanotehu, gonthanotehu, honthanotehu, ionthanotehu, jonthanotehu, konthanotehu) jonthanotehu +#define BIGARGS3(aonthanotehu, bonthanotehu, conthanotehu, donthanotehu, eonthanotehu, fonthanotehu, gonthanotehu, honthanotehu, ionthanotehu, jonthanotehu, konthanotehu) jonthanotehu +#define BIGARGS4(aonthanotehu, bonthanotehu, conthanotehu, donthanotehu, eonthanotehu, fonthanotehu, gonthanotehu, honthanotehu, ionthanotehu, jonthanotehu, konthanotehu) jonthanotehu + + +#define foobar(a, b) a + b + +#if foobar(1.1, 2.2) +#error good macro +#else +#error bad macro +#endif + +#if foobar(1 +; +# +# +#endif +#if foobar(1, +; +# +# +#endif +float c = foobar(1.1, 2.2 + ); +#if foobar(1.1, 2.2 +) +#if foobar(1.1, 2.2 +#endif +#endif + +#define VAL0 0 +#define VAL1 1 + +#if UNDEF +#error bad 0 +#else +#error good 0 +#endif + +#if VAL1 || UNDEF +#error good 1 +#else +#error bad 1 +#endif + +#if VAL1 && UNDEF // UNDEF ERROR +#endif + +#if VAL0 || UNDEF // UNDEF ERROR +#endif + +#if VAL0 && UNDEF +#error bad 2 +#else +#error good 1 +#endif + +#if VAL1 || (VAL1 && UNDEF) +#error good 3 +#else +#error bad 3 +#endif + +#if VAL1 && (VAL1 || UNDEF) +#error good 4 +#else +#error bad 4 +#endif + +#if VAL1 < VAL1 || VAL1 > VAL1 || UNDEF // UNDEF ERROR +#endif + +#if VAL1 < VAL1 || VAL1 > VAL1 && UNDEF +#endif + +#if VAL1 || UNDEF && UNDEF2 +#endif + +#if VAL0 || UNDEF && UNDEF2 // UNDEF ERROR +#endif + +#if (VAL1 || UNDEF) && UNDEF2 // UNDEF2 ERROR +#endif + +#if (VAL0 && UNDEF) || UNDEF2 // UNDEF2 ERROR +#endif + +#line 3000 +#error line of this error should be 3000 + +#define __LINE__ 30 +#define __FILE__ +#define __VERSION__ +#define GL_SOME_EXTENSION +#undef __LINE__ +#undef __FILE__ +#undef __VERSION__ +#undef GL_SOME_EXTENSION + +#line 4000 +#line 200 % 0 // ERROR, div by 0 +#if __LINE__ / 0 // ERROR, div by 0 +#endif + +#if 7% // ERROR incomplete expression + +#line 10000 +#if 0 +// ERROR, EOF \ No newline at end of file diff --git a/deps/glslang/Test/cppDeepNest.frag b/deps/glslang/Test/cppDeepNest.frag new file mode 100644 index 00000000..51c436e4 --- /dev/null +++ b/deps/glslang/Test/cppDeepNest.frag @@ -0,0 +1,117 @@ +#ifdef O +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#endif diff --git a/deps/glslang/Test/cppIndent.vert b/deps/glslang/Test/cppIndent.vert new file mode 100644 index 00000000..41bb12e4 --- /dev/null +++ b/deps/glslang/Test/cppIndent.vert @@ -0,0 +1,61 @@ +#version 110 + +#define ON + +float sum = 0.0; + +void main() +{ + +#ifdef ON +//yes +sum += 1.0; +#endif + +#ifdef OFF + //no + sum += 20.0; +#endif + + #if defined(ON) + //yes + sum += 300.0; + #endif + + #if defined(OFF) + //no + sum += 4000.0; + #endif + + #if !defined(ON) + //no + sum += 50000.0; + #endif + + #if !defined(OFF) + //yes + sum += 600000.0; + #endif + + #if defined (ON) && defined (OFF) +//no +sum += 7000000.0; + #endif + +#if defined ( ON ) && ! defined(OFF) +//yes +sum += 80000000.0; +#endif + +#if defined(OFF) || defined(ON) +//yes +sum += 900000000.0; +#endif + +// sum should be 980600301.0 + gl_Position = vec4(sum); +} + +#define FUNC(a,b) a+b +// needs to be last test in file due to syntax error +void foo986(){ FUNC( (((2)))), 4); } // ERROR, too few arguments ) diff --git a/deps/glslang/Test/cppIntMinOverNegativeOne.frag b/deps/glslang/Test/cppIntMinOverNegativeOne.frag new file mode 100644 index 00000000..b7e0a953 --- /dev/null +++ b/deps/glslang/Test/cppIntMinOverNegativeOne.frag @@ -0,0 +1,6 @@ +#if (-2147483648 / -1) != 0 +#error INT_MIN / -1 should yield 0, something went wrong. +#endif +#if (-2147483648 % -1) != 0 +#error INT_MIN % -1 should yield 0, something went wrong. +#endif \ No newline at end of file diff --git a/deps/glslang/Test/cppNest.vert b/deps/glslang/Test/cppNest.vert new file mode 100644 index 00000000..26038ea9 --- /dev/null +++ b/deps/glslang/Test/cppNest.vert @@ -0,0 +1,177 @@ +#version 110 + +#define ON + +float sum = 0.0; + +void main() +{ + +#ifdef ON +//yes +sum += 1.0; + + #ifdef OFF + //no + sum += 20.0; + #endif + + #if defined(ON) + //yes + sum += 300.0; + #endif + +#endif + + +#if defined(OFF) +//no +sum += 4000.0; + +#if !defined(ON) +//no +sum += 50000.0; +#endif + + //no + sum += 0.1; + #ifdef ON + //no + sum += 0.2; + #endif + + //no + sum += 0.01; + #ifdef ON + //no + sum += 0.02; + #else + //no + sum += 0.03; + #endif + +//no + sum + 0.3; + +#endif + + +#if !defined(OFF) +//yes +sum += 600000.0; + + #if defined(ON) && !defined(OFF) + //yes + sum += 80000000.0; + + #if defined(OFF) || defined(ON) + //yes + sum += 900000000.0; + + #if defined(ON) && defined(OFF) + //no + sum += 0.7; + #elif !defined(OFF) + //yes + sum += 7000000.0; + #endif + + #endif + + #endif + +#endif + +// sum should be 987600301.0 + gl_Position = vec4(sum); +} + +#define A 1 +#define C 0 +#define E 0 +#define F 1 +#if A + #if C + #if E + int selected4 = 1; + #elif F + int selected4 = 2; + #else + int selected4 = 3; + #endif + #endif + int selected4 = 4; +#endif + +#define ZA 1 +#define ZC 1 +#define ZE 0 +#define ZF 1 +#if ZA + #if ZC + #if ZE + int selected2 = 1; + #elif ZF + int selected2 = 2; + #else + int selected2 = 3; + #endif + #endif +#endif + +#define AZA 1 +#define AZC 1 +#define AZE 0 +#define AZF 0 +#if AZA + #if AZC + #if AZE + int selected3 = 1; + #elif AZF + int selected3 = 2; + #else + int selected3 = 3; + #endif + #endif +#endif + +// ERROR cases... + +#if 0 +int; +#else +int; +#elif 1 +int; +#endif + +#if 0 +int; +#else +int; +#else +int; +#endif + +#if 0 + #if 0 + int; + #else + int; + #elif 1 + int; + #endif + + #if 0 + int; + #else + int; + #else + int; + #endif +#endif + +#define FUNC(a,b) a+b +void foo985(){ FUNC( (((2))), ((3),4)); } +// needs to be last test in file +void foo987(){ FUNC(((); } // ERROR, EOF in argument diff --git a/deps/glslang/Test/cppPassMacroName.frag b/deps/glslang/Test/cppPassMacroName.frag new file mode 100644 index 00000000..046629f2 --- /dev/null +++ b/deps/glslang/Test/cppPassMacroName.frag @@ -0,0 +1,30 @@ +#define f1(i) ((i)*(i)) +#define I2(f, n) f(n) + f(n+1) +#define I3(f, n) I2(f, n) + f(n+2) + +#define FL_f1(i) ((i)*(i)) +#define FL_I2(f, n) f(n) + f(n+0.2) +#define FL_I3(f, n) FL_I2(f, n) + f(n+0.5) + +void main() +{ + int f1 = 4; + int f2 = f1; + int f3 = f1(3); + int f4 = I2(f1, 0); + int f5 = I3(f1, 0); + + highp float fl_f5 = FL_I3(FL_f1, 0.1); +} + +// f5 = I3(f1, 0) +// = I2(f1, 0) + f1(0 + 2) +// = f1(0) + f1(0+1) + f1(0+2) +// = 0*0 + 1*1 + 2*2 +// = 5 + +// fl_f5 = FL_I3(FL_f1, 0.1) +// = FL_I2(FL_f1, 0.1) + FL_f1(0.1 + 0.5) +// = FL_f1(0.1) + FL_f1(0.1 + 0.2) + FL_f1(0.1 + 0.5) +// = 0.1*0.1 + 0.3*0.3 + 0.6*0.6 +// = 0.46 diff --git a/deps/glslang/Test/cppRelaxSkipTokensErrors.vert b/deps/glslang/Test/cppRelaxSkipTokensErrors.vert new file mode 100644 index 00000000..b30af0c9 --- /dev/null +++ b/deps/glslang/Test/cppRelaxSkipTokensErrors.vert @@ -0,0 +1,14 @@ +#version 110 + +#if 0 +3.5L +3.5h +2034h +1.#INF +0x1234567812345L +12323394203923879234L +0123s; +123s; +0123456712345671234L +"string" +#endif diff --git a/deps/glslang/Test/cppSimple.vert b/deps/glslang/Test/cppSimple.vert new file mode 100644 index 00000000..2f7de30f --- /dev/null +++ b/deps/glslang/Test/cppSimple.vert @@ -0,0 +1,353 @@ +#version 400 + +#define ON + +float sum = 0.0; + +void main() +{ + +#ifdef ON +//yes +sum += 1.0; +#endif + +#ifdef OFF +//no +sum += 20.0; +#endif + +#if defined(ON) +//yes +sum += 300.0; +#endif + +#if defined(OFF) +//no +sum += 4000.0; +#endif + +#if !defined(ON) +//no +sum += 50000.0; +#endif + +#ifndef OFF +//yes +sum += 600000.0; +#else +//no +sum += 0.6; +#endif + +#if defined(ON) && defined(OFF) +//no +sum += 0.7; +#elif !defined(OFF) +//yes +sum += 7000000.0; +#endif + +#if defined(ON) && !defined(OFF) +//yes +sum += 80000000.0; +#endif + +#if defined(OFF) || defined(ON) +//yes +sum += 900000000.0; +#endif + +#if NEVER_DEFINED +//no +sum += 0.04; +#else +sum += 0.05; +#endif + +// sum should be 987600301.7 + gl_Position = vec4(sum); +} + +#define A 0 +# define B 0 + # define C 0 + +#if (A == B) || (A == C) +#error good1 +#endif + +#if A == B || (A == C) +#error good2 +#endif + +#if (A == B || (A == C)) +#error good3 +#endif + +#if (AA == BB) || (AA == CC) +#error good4 +#endif + +#if AA == BB || (AA == CC) +#error good5 +#endif + +#if ((AA == BB || (AA == CC))) +#error good6 +#endif + +#if (A == B || (A == C) +#error bad1 +#endif + +#if A == B || A == C) +#error bad2 +#endif + +#if (A == B || (A == C) +#error bad3 +#endif + +#if AA == BB) || (AA == CC) +#error bad4 +#endif + +#if AA == BB || (AA == CC +#error bad5 +#endif + +#if ((AA == BB || (AA == CC)))) +#error bad6 +#endif extra tokens + +int linenumber = __LINE__; +int filenumber = __FILE__; +int version = __VERSION__; + +#define PI (3.14) +#define TWOPI (2.0 * PI) +float twoPi = TWOPI; + +//#define PASTE(a,b) a ## b +//float PASTE(tod, ay) = 17; + +"boo" // ERROR +int a = length("aoenatuh"); // ERROR +#define QUOTE "abcd" // okay +'int'; // ERROR +#define SINGLE 'a' // okay +// ERROR: all the following are reserved +#define GL_ +#define GL_Macro 1 +#define __M +#define M__ +#define ABC__DE abc + +#if 4 +#else extra +#elif +// ERROR elif after else +#endif + +#if blah + #if 0 + #else extra + #ifdef M + #else + #else + // ERROR else after else + #endif extra + #endif +#endif + +#define m1(a,a) // ERROR +#define m2(a,b) + +// okay +#define m3 (a) +#define m3 (a) + +// ERROR +#define m4(b) +#define m4 + +// ERROR +#define m5 (b) +#define m5(b) + +// ERROR +#define m6(a) +#define m6(a,b) + +// ERROR (whitespace) +#define m7 (a) +#define m7 ( a) + +#define m80(a,b) is + exactly m3 the same +#define m80(a,b) is + exactly m3 the same + +// ERROR +#define m8(a,b) almost + exactly m3 the same +#define m8(a,b) almost + exactly m3 thee same + +// ERROR +#define m9(a,b,c) aoe +#define m9(a,d,c) aoe + +#define n1 0xf +int n = n1; + +#define f1 .08e-2Lf +double f = f1; + +#undef __VERSION__ +#undef GL_ARB_texture_rectangle + +# + # + # +## +# # +# 0x25 +#### +####ff +#########ff fg 0x25 +#pragma +#pragma(aoent) + # pragma +#pragma STDGL +#pragma optimize( on) +#pragma optimize(off) +#pragma debug( on) +#pragma debug(off ) +#pragma optimize( on) anoteun +#pragma optimize(off +#pragma debug( on) ( +#pragma debug(off aoeua) +#pragma optimize( on) +#pragma optimize(off,) +#pragma debug( on, aoeu) +#pragma debugoff ) +#pragma aontheu natoeh uantheo uasotea noeahuonea uonethau onethuanoeth aunotehau noeth anthoeua anoethuantoeh uantoehu natoehu naoteh unotaehu noethua onetuh aou +# \ + +# \ + error good continuation + +#flizbit + +#define directive error + +#directive directive was expanded + +#line 12000 +#error line should be 12000 +#line 13000 7 +#error line should be 13000, string 7 +#define L1 14000 +#define L2 13 +#define F1 5 +#define F2 7 +#line L1 + L2 +#error line should be 14013, string 7 +#line L1 + L2 F1 + F2 // antoeuh sat comment +#error line should be 14013, string 12 +#line L1 + L2 + F1 + F2 +#error line should be 14025, string 12 +#line 1234 F1 + F2 extra +#define empty_extra +#line 1235 F1 + F2 empty_extra +#define moreEmpty empty_extra +#line 1236 F1 + F2 moreEmpty empty_extra // okay, lots of nothin +#line 1237 F1 + F2 moreEmpty empty_extra extra // ERROR, 'extra' +#line 1238 F1 + F2 moreEmpty empty_extra +#line 1239 empty_extra F1 empty_extra + empty_extra F2 empty_extra moreEmpty empty_extra +#line (20000) +#error line should be 20000 +#line (20000+10) +#error line should be 20010 +#line +20020 +#error line should be 20020 + +#define VAL1 1.0 +#define VAL2 2.0 + +#define RES2 /* test a multiline + comment in a macro definition */ (RES1 * VAL2) +#define RES1 (VAL2 / VAL1) +#define RES2 /* comment */(RES1 * VAL2) +#define /* */SUM_VALUES (RES2 + RES1) + +void foo234() +{ + gl_Position = vec4(SUM_VALUES); +} + +// more whitespace recording tests +#define SPACE_AT_END(a,b) spaceAtEndIsOkay +#define SPACE_AT_END(a,b) spaceAtEndIsOkay // space at end + +#define SPACE_AT_BEGIN(a,b)spaceAtBeginIsOkay +#define SPACE_AT_BEGIN(a,b) spaceAtBeginIsOkay + +// space in middle is an error +#define SPACE_IN_MIDDLE(a,b) space +in middle +#define SPACE_IN_MIDDLE(a,b) space + in middle + +#define FIRSTPART 17 +#define SECONDPART + 5 + +#if FIRSTPART SECONDPART == 22 +#error good evaluation 1 +#endif + +#if moreEmpty FIRSTPART moreEmpty SECONDPART moreEmpty == moreEmpty 22 moreEmpty +#error good evaluation 2 +#endif + +// ERRORS... +#line 9000 +#if defined(OUNH +#endif +#if defined OUNH) +#endif + +// recursion (okay) +#define RECURSE RECURSE +int RECURSE; +#define R2 R1 +#define R1 R2 +#undef RECURSE +int R1 = RECURSE; + +#define FOOOM(a,b) a + b +int aoeua = FOOOM; +#if FOOOM +#endif + +#line 9500 +#if\376 +#endif +#if \376 +#endif +#if \377 +#endif +#error\377 +#error \ 376 +#error \377 + +// ERROR for macro expansion to yield 'defined' +#line 9600 +#define DEF_MAC +#define DEF_DEFINED defined +#if DEF_DEFINED DEF_MAC +#error DEF_DEFINED then +#else +#error DEF_DEFINED else +#endif + +#line 10000 +#if 1 +#else +// ERROR, missing #endif \ No newline at end of file diff --git a/deps/glslang/Test/dataOut.frag b/deps/glslang/Test/dataOut.frag new file mode 100644 index 00000000..258f534e --- /dev/null +++ b/deps/glslang/Test/dataOut.frag @@ -0,0 +1,8 @@ +#version 130 + +varying vec4 Color; + +void main() +{ + gl_FragData[1] = Color; +} diff --git a/deps/glslang/Test/dataOutIndirect.frag b/deps/glslang/Test/dataOutIndirect.frag new file mode 100644 index 00000000..d6b8667d --- /dev/null +++ b/deps/glslang/Test/dataOutIndirect.frag @@ -0,0 +1,10 @@ +#version 130 + +varying vec4 Color; + +uniform int i; + +void main() +{ + gl_FragData[i] = Color; +} diff --git a/deps/glslang/Test/dce.frag b/deps/glslang/Test/dce.frag new file mode 100644 index 00000000..119a98dd --- /dev/null +++ b/deps/glslang/Test/dce.frag @@ -0,0 +1,56 @@ +#version 400 + +const bool flag = false; + +int c = 0; + +void bar() +{ + if (flag) + ++c; // should still show up in AST + else + ++c; + + flag ? ++c : ++c; // both should still show up in AST + + switch (c) { + case 1: + ++c; + break; + ++c; // should still show up in AST + case 2: + break; + ++c; // should still show up in AST + default: + break; + } + + for (int i = 0; i < 0; ++i) + ++c; // should still show up in AST + + for (int i = 0; i < 10; ++i) { + if (c < 3) { + break; + ++c; // should still show up in AST + } else { + continue; + ++c; // should still show up in AST + } + } + + return; + + ++c; // should still show up in AST +} + +int foo() // not called, but should still show up in AST +{ + if (c > 4) { + return 4; + ++c; // should still show up in AST + } + + return 5; + + ++c; // should still show up in AST +} diff --git a/deps/glslang/Test/decls.frag b/deps/glslang/Test/decls.frag new file mode 100644 index 00000000..486e7963 --- /dev/null +++ b/deps/glslang/Test/decls.frag @@ -0,0 +1,49 @@ +#version 120 + +int a; +int b, c; +int d1 = 1; +int e2 = 2, f; +int g, h3 = 3; + +int i4[4]; +int j, k5[5]; +int m6[6], m7[7]; +int n8[8], p; + +int ii4[4] = int[](1, 2, 3, 4); +int ij, ik5[5] = int[](5, 6, 7, 8, 9); +int im2[2] = int[](10, 11), im3[3] = int[](12, 13, 14); +int in8[4] = int[](21, 22, 23, 24), ip; + +void vi4[4] = int[](1, 2, 3, 4); +void vj, vk5[5] = int[](5, 6, 7, 8, 9); +void vm2[2] = int[](10, 11), vm3[3] = int[](12, 13, 14); +void vn8[4] = int[](21, 22, 23, 24), vp; + +const int cii4[4] = int[](1, 2, 3, 4); +const int cij, cik5[5] = int[](5, 6, 7, 8, 9); +const int cim2[2] = int[](10, 11), cim3[3] = int[](12, 13, 14); +const int cin8[4] = int[](21, 22, 23, 24), cip; + +uniform int uii4[4] = int[](1, 2, 3, 4); +uniform int uij, uik5[5] = int[](5, 6, 7, 8, 9); +uniform int uim2[2] = int[](10, 11), uim3[3] = int[](12, 13, 14); +uniform int uin8[4] = int[](21, 22, 23, 24), uip; + +int gl_vi4[4] = int[](1, 2, 3, 4); +int gl_vj, gl_vk5[5] = int[](5, 6, 7, 8, 9); +int gl_vm2[2] = int[](10, 11), gl_vm3[3] = int[](12, 13, 14); +int gl_vn8[4] = int[](21, 22, 23, 24), gl_vp; + +void main() +{ + while (bool cond = b < c); + while (int icond = b); + while (bool gl_cond = b < c); +} + +int foob__vi4[4] = int[](1, 2, 3, 4); +int foob__vj, foob__vk5[5] = int[](5, 6, 7, 8, 9); +int __foobvm2[2] = int[](10, 11), __foobvm3[3] = int[](12, 13, 14); +int foob__vn8[4] = int[](21, 22, 23, 24), foob__vp; diff --git a/deps/glslang/Test/deepRvalue.frag b/deps/glslang/Test/deepRvalue.frag new file mode 100644 index 00000000..4d880866 --- /dev/null +++ b/deps/glslang/Test/deepRvalue.frag @@ -0,0 +1,36 @@ +#version 120 + +uniform sampler2D sampler; + +vec4 v1 = vec4(2.0, 3.0, 5.0, 7.0); +vec4 v2 = vec4(11.0, 13.0, 17.0, 19.0); +vec4 v3 = vec4(23.0, 29.0, 31.0, 37.0); +vec4 v4 = vec4(41.0, 43.0, 47.0, 53.0); + +struct str { + int a; + vec2 b[3]; + bool c; +}; + +void main() +{ + mat4 m = mat4(v1, v2, v3, v4); + + mat4 mm = matrixCompMult(m, m); + float f = mm[1].w; // should be 19 * 19 = 361 + + // do a deep access to a spontaneous r-value + float g = matrixCompMult(m, m)[2].y; // should be 29 * 29 = 841 + + float h = str(1, vec2[3](vec2(2.0, 3.0), vec2(4.0, 5.0), vec2(6.0, 7.0)), true).b[1][1]; // should be 5.0 + + float i = texture2D(sampler, vec2(0.5,0.5)).y; + + i += (i > 0.1 ? v1 : v2)[3]; + + str t; + i += (t = str(1, vec2[3](vec2(2.0, 3.0), vec2(4.0, 5.0), vec2(6.0, 7.0)), true)).b[2].y; // should be 7.0 + + gl_FragColor = vec4(f, g, h, i); +} diff --git a/deps/glslang/Test/depthOut.frag b/deps/glslang/Test/depthOut.frag new file mode 100644 index 00000000..5a892710 --- /dev/null +++ b/deps/glslang/Test/depthOut.frag @@ -0,0 +1,10 @@ +#version 130 + +varying vec4 Color; +varying float Depth; + +void main() +{ + gl_FragDepth = Depth; + gl_FragColor = Color; +} diff --git a/deps/glslang/Test/discard-dce.frag b/deps/glslang/Test/discard-dce.frag new file mode 100644 index 00000000..f2fef4d1 --- /dev/null +++ b/deps/glslang/Test/discard-dce.frag @@ -0,0 +1,35 @@ +#version 110 +varying vec2 tex_coord; + +void main (void) +{ + vec4 white = vec4(1.0); + vec4 black = vec4(0.2); + vec4 color = white; + + // First, cut out our circle + float x = tex_coord.x*2.0 - 1.0; + float y = tex_coord.y*2.0 - 1.0; + + float radius = sqrt(x*x + y*y); + if (radius > 1.0) { + if (radius > 1.1) { + ++color; + } + + gl_FragColor = color; + + if (radius > 1.2) { + ++color; + } + + discard; + } + + // If we're near an edge, darken us a tiny bit + if (radius >= 0.75) + color -= abs(pow(radius, 16.0)/2.0); + + gl_FragColor = color; + +} diff --git a/deps/glslang/Test/doWhileLoop.frag b/deps/glslang/Test/doWhileLoop.frag new file mode 100644 index 00000000..3d6f93c5 --- /dev/null +++ b/deps/glslang/Test/doWhileLoop.frag @@ -0,0 +1,16 @@ +#version 110 + +uniform vec4 bigColor; +varying vec4 BaseColor; +uniform float d; + +void main() +{ + vec4 color = BaseColor; + + do { + color += bigColor; + } while (color.x < d); + + gl_FragColor = color; +} diff --git a/deps/glslang/Test/earlyReturnDiscard.frag b/deps/glslang/Test/earlyReturnDiscard.frag new file mode 100644 index 00000000..718ea72f --- /dev/null +++ b/deps/glslang/Test/earlyReturnDiscard.frag @@ -0,0 +1,102 @@ +#version 110 + +uniform float d; +uniform vec4 bigColor, smallColor; +uniform vec4 otherColor; + +varying float c; + +uniform float threshhold; +uniform float threshhold2; +uniform float threshhold3; + +uniform float minimum; + +varying vec4 BaseColor; + +uniform bool b; + +void main() +{ + vec4 color = BaseColor; + vec4 color2; + + color2 = otherColor; + + if (c > d) + color += bigColor; + else + color += smallColor; + + if (color.z < minimum) + return; + + color.z++; + + if (color.z > threshhold) + discard; + + color++; + + // Two path, different rest + if (color.w > threshhold2) { + if (color.z > threshhold2) + return; + else if (b) + color.z++; + else { + if (color.x < minimum) { + discard; + } else { + color++; + } + } + } else { + if (b) + discard; + else + return; + } + + + // // Two path, shared rest + // if (color.w > threshhold2) { + // if (color.z > threshhold2) + // return; + // else if (b) + // color++; + // else { + // if (color.x < minimum) { + // discard; + // } else { + // color++; + // } + // } + // } else { + // if (b) + // discard; + // else + // return; + // } + + + // // One path + // if (color.w > threshhold2) { + // if (color.z > threshhold2) + // return; + // else { + // if (color.x < minimum) { + // discard; + // } else { + // color++; + // } + // } + // } else { + // if (b) + // discard; + // else + // return; + // } + + gl_FragColor = color * color2; +} diff --git a/deps/glslang/Test/empty.frag b/deps/glslang/Test/empty.frag new file mode 100644 index 00000000..e69de29b diff --git a/deps/glslang/Test/empty2.frag b/deps/glslang/Test/empty2.frag new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/deps/glslang/Test/empty2.frag @@ -0,0 +1 @@ + diff --git a/deps/glslang/Test/empty3.frag b/deps/glslang/Test/empty3.frag new file mode 100644 index 00000000..14cd83d7 --- /dev/null +++ b/deps/glslang/Test/empty3.frag @@ -0,0 +1 @@ +#version 110 diff --git a/deps/glslang/Test/errors.frag b/deps/glslang/Test/errors.frag new file mode 100644 index 00000000..99cf2b93 --- /dev/null +++ b/deps/glslang/Test/errors.frag @@ -0,0 +1,4 @@ +int main(int foo) +{ + return 1; +} diff --git a/deps/glslang/Test/es-link1.frag b/deps/glslang/Test/es-link1.frag new file mode 100644 index 00000000..fe4da41d --- /dev/null +++ b/deps/glslang/Test/es-link1.frag @@ -0,0 +1,8 @@ +#version 100 + +mediump vec4 calculateColor(); + +void main() +{ + gl_FragColor = calculateColor(); +} diff --git a/deps/glslang/Test/es-link2.frag b/deps/glslang/Test/es-link2.frag new file mode 100644 index 00000000..e7b5a477 --- /dev/null +++ b/deps/glslang/Test/es-link2.frag @@ -0,0 +1,8 @@ +#version 100 + +varying mediump vec4 varyingColor; + +mediump vec4 calculateColor() +{ + return varyingColor * 0.5; +} diff --git a/deps/glslang/Test/findFunction.frag b/deps/glslang/Test/findFunction.frag new file mode 100644 index 00000000..7e180650 --- /dev/null +++ b/deps/glslang/Test/findFunction.frag @@ -0,0 +1,46 @@ +#version 450 + +#extension GL_KHX_shader_explicit_arithmetic_types: enable + +int64_t func(int8_t a, int16_t b, int16_t c) +{ + return int64_t(a | b + c); +} + +int64_t func(int8_t a, int16_t b, int32_t c) +{ + return int64_t(a | b - c); +} + +int64_t func(int32_t a, int32_t b, int32_t c) +{ + return int64_t(a / b + c); +} + +int64_t func(float16_t a, float16_t b, float32_t c) +{ + return int64_t(a - b * c); +} + +int64_t func(float16_t a, int16_t b, float32_t c) +{ + return int64_t(a - b * c); +} + +void main() +{ + int8_t x; + int16_t y; + int32_t z; + int64_t w; + float16_t f16; + float64_t f64; + int64_t b1 = func(x, y, z); + int64_t b2 = func(y, y, z); // tie + int64_t b3 = func(y, y, w); // No match + int64_t b4 = func(y, z, f16); // No match + int64_t b5 = func(y, y, f16); + int64_t b7 = func(f16, f16, y); + int64_t b8 = func(f16, f16, f64); // No match + int64_t b9 = func(f16, x, f16); // tie +} diff --git a/deps/glslang/Test/flowControl.frag b/deps/glslang/Test/flowControl.frag new file mode 100644 index 00000000..eaa6fb1d --- /dev/null +++ b/deps/glslang/Test/flowControl.frag @@ -0,0 +1,23 @@ +#version 120 + +uniform float d; +uniform vec4 bigColor, smallColor; +uniform vec4 otherColor; + +varying float c; +varying vec4 BaseColor; + +void main() +{ + vec4 color = BaseColor; + vec4 color2; + + color2 = otherColor; + + if (c > d) + color += bigColor; + else + color += smallColor; + + gl_FragColor = color * color2; +} diff --git a/deps/glslang/Test/foo.h b/deps/glslang/Test/foo.h new file mode 100644 index 00000000..7f79340b --- /dev/null +++ b/deps/glslang/Test/foo.h @@ -0,0 +1 @@ +#error should not be included \ No newline at end of file diff --git a/deps/glslang/Test/forLoop.frag b/deps/glslang/Test/forLoop.frag new file mode 100644 index 00000000..117ecad1 --- /dev/null +++ b/deps/glslang/Test/forLoop.frag @@ -0,0 +1,41 @@ +#version 130 + +uniform vec4 bigColor; +in vec4 BaseColor; +in float f; + +uniform int Count; +uniform uvec4 v4; + +void main() +{ + vec4 color = BaseColor; + + for (int i = 0; i < Count; ++i) { + color += bigColor; + } + + gl_FragColor = color; + + float sum = 0.0; + for (int i = 0; i < 4; ++i) + sum += v4[i]; + + vec4 tv4; + + for (int i = 0; i < 4; ++i) + tv4[i] = v4[i] * 4u; + + gl_FragColor += vec4(sum) + tv4; + + vec4 r; + r.xyz = BaseColor.xyz; + + for (int i = 0; i < Count; ++i) + r.w = f; + + gl_FragColor.xyz += r.xyz; + + for (int i = 0; i < 16; i += 4) + gl_FragColor *= f; +} diff --git a/deps/glslang/Test/forwardRef.frag b/deps/glslang/Test/forwardRef.frag new file mode 100644 index 00000000..49f3504e --- /dev/null +++ b/deps/glslang/Test/forwardRef.frag @@ -0,0 +1,37 @@ +#version 110 + +uniform vec4 bigColor; +varying vec4 BaseColor; +uniform float d; + +void bar(); +float foo(vec4); +float unreachableReturn(); + +void main() +{ + vec4 color = vec4(foo(BaseColor)); + + bar(); + float f = unreachableReturn(); + + gl_FragColor = color * f; +} + +void bar() +{ +} + +float unreachableReturn() +{ + bar(); + if (d < 4.2) + return 1.2; + else + return 4.5; +} + +float foo(vec4 bar) +{ + return bar.x + bar.y; +} diff --git a/deps/glslang/Test/functionCall.frag b/deps/glslang/Test/functionCall.frag new file mode 100644 index 00000000..e1fc0e07 --- /dev/null +++ b/deps/glslang/Test/functionCall.frag @@ -0,0 +1,44 @@ +#version 130 + +uniform vec4 bigColor; +varying vec4 BaseColor; +uniform float d; + +float h = 0.0; + +float foo(vec4 bar) +{ + return bar.x + bar.y; +} + +void bar() +{ +} + +float unreachableReturn() +{ + if (d < 4.2) + return 1.2; + else + return 4.5; + // might be another return inserted here by builders, has to be correct type +} + +float missingReturn() +{ + if (d < 4.5) { + h = d; + return 3.9; + } +} + +void main() +{ + vec4 color = vec4(foo(BaseColor)); + + bar(); + float f = unreachableReturn(); + float g = missingReturn(); + + gl_FragColor = color * f * h; +} diff --git a/deps/glslang/Test/functionSemantics.frag b/deps/glslang/Test/functionSemantics.frag new file mode 100644 index 00000000..e5c3ed00 --- /dev/null +++ b/deps/glslang/Test/functionSemantics.frag @@ -0,0 +1,75 @@ +#version 400 + +uniform float u; + +int foo(int a, const int b, in int c, const in int d, out int e, inout int f) +{ + int sum = a + b + c + d + f; // no e, it is out only + // sum should be 47 now + + a *= 64; + // no b, it is read only + c *= 64; + // no d, it is read only + e = 64 * 16; // e starts undefined + f *= 64; + + sum += a + 64 * b + c + 64 * d + e + f; // everything has a value now, totaling of 64(1+2+4+8+16+32) = 64*63 = 4032 + // sum should be 4032 + 47 = 4079 + + return sum; +} + +int foo2(float a, vec3 b, out int r) +{ + r = int(3.0 * a); + return int(5.0 * b.y); +} + +int foo3() +{ + if (u > 3.2) { + discard; + return 1000000; + } + + return 2000000; +} + +void main() +{ + int e; + int t = 2; + struct s { + ivec4 t; + } f; + f.t.y = 32; + + // test the different qualifers + int color = foo(1, 2, t+t, 8, e, f.t.y); + + color += 128 * (e + f.t.y); // right side should be 128(64(16 + 32)) = 393216 + // sum should be 4079 + 393216 = 397295 + + // test conversions + float arg; + float ret; + ret = foo2(4, ivec3(1,2,3), arg); // ret = 10, param = 12.0 + color += int(ret + arg); // adds 22, for total of 397317 + + color += foo3(); // theoretically, add 2000000, for total of 2397317 + + gl_FragColor = vec4(color); +} + +vec3 m(vec2); +void aggCall() +{ + float F; + m(ivec2(F)); // test input conversion of single argument that's an aggregate; other function tests in 120.vert +} + +vec4 badConv() +{ + return u; // ERROR, can change scalar to vector +} \ No newline at end of file diff --git a/deps/glslang/Test/glsl.-D-U.frag b/deps/glslang/Test/glsl.-D-U.frag new file mode 100644 index 00000000..4d2325f1 --- /dev/null +++ b/deps/glslang/Test/glsl.-D-U.frag @@ -0,0 +1,32 @@ +#version 450 + +#define IN_SHADER + +layout(location=0) out vec4 color; + +void main() +{ +#if FOO==200 + color = vec4(1.0); +#else + #error expected FOO 200 +#endif + +#ifdef IN_SHADER + color++; +#else + #error IN_SHADER was undef +#endif + +#ifdef UNDEFED + #error UNDEFED defined +#else + color *= 3.0; +#endif + +#if MUL == 400 + color *= MUL; +#else + #error bad MUL +#endif +} diff --git a/deps/glslang/Test/glsl.entryPointRename.vert b/deps/glslang/Test/glsl.entryPointRename.vert new file mode 100644 index 00000000..7fc6b7a1 --- /dev/null +++ b/deps/glslang/Test/glsl.entryPointRename.vert @@ -0,0 +1,11 @@ +#version 460 + +void bar() +{ + gl_Position = vec4(1); +} + +void main() +{ + gl_Position = vec4(1); +} diff --git a/deps/glslang/Test/glsl.entryPointRename2.vert b/deps/glslang/Test/glsl.entryPointRename2.vert new file mode 100644 index 00000000..0473e9bc --- /dev/null +++ b/deps/glslang/Test/glsl.entryPointRename2.vert @@ -0,0 +1,6 @@ +#version 460 + +void bar() +{ + gl_Position = vec4(1); +} diff --git a/deps/glslang/Test/glslangValidator b/deps/glslang/Test/glslangValidator new file mode 100644 index 00000000..856aa1a9 --- /dev/null +++ b/deps/glslang/Test/glslangValidator @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +../build/install/bin/glslangValidator $* diff --git a/deps/glslang/Test/glspv.esversion.vert b/deps/glslang/Test/glspv.esversion.vert new file mode 100644 index 00000000..23501bf6 --- /dev/null +++ b/deps/glslang/Test/glspv.esversion.vert @@ -0,0 +1,5 @@ +#version 310 es + +void main() +{ +} diff --git a/deps/glslang/Test/glspv.frag b/deps/glslang/Test/glspv.frag new file mode 100644 index 00000000..7a73cb8d --- /dev/null +++ b/deps/glslang/Test/glspv.frag @@ -0,0 +1,28 @@ +#version 450 + +#ifdef GL_SPIRV +#error GL_SPIRV is set ( correct, not an error ) +#if GL_SPIRV == 100 +#error GL_SPIR is 100 +#endif +#endif + +void main() +{ +} + +uniform float f; // ERROR, no location +layout(location = 2) uniform float g; +uniform sampler2D s1; // ERROR, no binding +layout(location = 3) uniform sampler2D s2; // ERROR, no binding + +void noise() +{ + noise1(vec4(1)); + noise2(4.0); + noise3(vec2(3)); + noise4(1); +} + +uniform atomic_uint atomic; // ERROR, no binding +layout(input_attachment_index = 1) uniform subpassInput sub; // ERROR, no inputs diff --git a/deps/glslang/Test/glspv.version.frag b/deps/glslang/Test/glspv.version.frag new file mode 100644 index 00000000..c9c6779e --- /dev/null +++ b/deps/glslang/Test/glspv.version.frag @@ -0,0 +1,5 @@ +#version 330 compatibility + +void main() +{ +} diff --git a/deps/glslang/Test/glspv.version.vert b/deps/glslang/Test/glspv.version.vert new file mode 100644 index 00000000..c8573b7b --- /dev/null +++ b/deps/glslang/Test/glspv.version.vert @@ -0,0 +1,5 @@ +#version 150 + +void main() +{ +} diff --git a/deps/glslang/Test/glspv.vert b/deps/glslang/Test/glspv.vert new file mode 100644 index 00000000..b4481465 --- /dev/null +++ b/deps/glslang/Test/glspv.vert @@ -0,0 +1,20 @@ +#version 450 + +layout(push_constant) uniform Material { int a; } mat; // ERROR, can't use push_constant + +layout(set = 0, binding = 0, std140) uniform Bt1 { int a; } bt1; +layout(set = 1, binding = 0, std140) uniform Bt2 { int a; } bt2; // ERROR, set has to be 0 + +layout(shared) uniform Bt3 { int a; } bt3; // ERROR, no shared, no binding +layout(packed) uniform Bt4 { int a; } bt4; // ERROR, no shared, no binding + +void main() +{ + gl_VertexIndex; // ERROR, not preset + gl_InstanceIndex; // ERROR, not present + gl_VertexID; + gl_InstanceID; + gl_DepthRangeParameters; // ERROR, not present +} + +uniform sampler s; // ERROR, no sampler diff --git a/deps/glslang/Test/hlsl.-D-U.frag b/deps/glslang/Test/hlsl.-D-U.frag new file mode 100644 index 00000000..0a022220 --- /dev/null +++ b/deps/glslang/Test/hlsl.-D-U.frag @@ -0,0 +1,31 @@ + +#define IN_SHADER + +static float4 color; + +void main() +{ +#if FOO==200 + color = 1.0; +#else + #error expected FOO 200 +#endif + +#ifdef FOO + color -= 5.0; +#else + #error expected FOO 200 +#endif + +#ifdef IN_SHADER + color++; +#else + #error IN_SHADER was undef +#endif + +#ifdef UNDEFED + #error UNDEFED defined +#else + color *= 3.0; +#endif +} diff --git a/deps/glslang/Test/hlsl.PointSize.geom b/deps/glslang/Test/hlsl.PointSize.geom new file mode 100644 index 00000000..ef66fc89 --- /dev/null +++ b/deps/glslang/Test/hlsl.PointSize.geom @@ -0,0 +1,11 @@ +struct S { + [[vk::builtin("PointSize")]] float ps : PSIZE; +}; + +[maxvertexcount(4)] +void main([[vk::builtin("PointSize")]] triangle in uint ps[3], + inout LineStream OutputStream) +{ + S s; + OutputStream.Append(s); +} diff --git a/deps/glslang/Test/hlsl.PointSize.vert b/deps/glslang/Test/hlsl.PointSize.vert new file mode 100644 index 00000000..4b357e07 --- /dev/null +++ b/deps/glslang/Test/hlsl.PointSize.vert @@ -0,0 +1,4 @@ +[[vk::builtin("PointSize")]] float main() +{ + return 2.3; +} \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.aliasOpaque.frag b/deps/glslang/Test/hlsl.aliasOpaque.frag new file mode 100644 index 00000000..8b1cceff --- /dev/null +++ b/deps/glslang/Test/hlsl.aliasOpaque.frag @@ -0,0 +1,29 @@ +struct OS { + SamplerState ss; + float a; + Texture2D tex; +}; + +SamplerState gss; +SamplerState gss2; +Texture2D gtex; + +float4 osCall(OS s) +{ + return s.a * s.tex.Sample(s.ss, float2(0.2, 0.3)); +} + +float4 main() : SV_TARGET0 +{ + OS os; + os.ss = gss2; + os.ss = gss; + os.tex = gtex; + os.a = 3.0; + + // this should give an error + //SamplerState localss; + //localss = gss2; + + return osCall(os); +} diff --git a/deps/glslang/Test/hlsl.amend.frag b/deps/glslang/Test/hlsl.amend.frag new file mode 100644 index 00000000..7c182739 --- /dev/null +++ b/deps/glslang/Test/hlsl.amend.frag @@ -0,0 +1,28 @@ +float4 a; +float b; +static float4 m = a * b; +void f1() +{ + a * b; +} + +float3 c; + +void f2() +{ + a.x + b + c.x; +} + +void f3() +{ + c; +} + +int d; + +void f4() +{ + d * a; +} + +int e; \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.array.flatten.frag b/deps/glslang/Test/hlsl.array.flatten.frag new file mode 100644 index 00000000..987ce1bf --- /dev/null +++ b/deps/glslang/Test/hlsl.array.flatten.frag @@ -0,0 +1,38 @@ + +// uniform Texture1D g_tex3[3][2]; // TODO: legal in HLSL, but we don't handle it yet. + +uniform Texture1D g_tex[3]; +uniform Texture1D g_tex_explicit[3] : register(t1); + +SamplerState g_samp[3]; +SamplerState g_samp_explicit[3] : register(s5); + +uniform float3x3 g_mats[4]; +uniform float3x3 g_mats_explicit[4] : register(b10); +uniform float g_floats[4]; + +// uniform float g_floats[4] = { 10, 11, 12, 13 }; // TODO: ... add when initializer lists can be flattened. + +float4 TestFn1() +{ + return g_tex[1].Sample(g_samp[1], 0.2); +} + +float4 TestFn2(Texture1D l_tex[3], SamplerState l_samp[3]) +{ + return l_tex[2].Sample(l_samp[2], 0.2); +} + +static int not_flattened_a[5] = { 1, 2, 3, 4, 5 }; + +struct PS_OUTPUT { float4 color : SV_Target0; }; + +void main(out PS_OUTPUT ps_output) +{ + // test flattening for local assignment initialization + SamplerState local_sampler_array[3] = g_samp; + Texture1D local_texture_array[3] = g_tex; + float local_float_array[4] = g_floats; + + ps_output.color = TestFn1() + TestFn2(g_tex, g_samp); +} diff --git a/deps/glslang/Test/hlsl.array.frag b/deps/glslang/Test/hlsl.array.frag new file mode 100644 index 00000000..ff0004fd --- /dev/null +++ b/deps/glslang/Test/hlsl.array.frag @@ -0,0 +1,18 @@ +float4 a[4]; + +struct { + float4 m[7]; +} s[11]; + +static float4 C = float4(1,2,3,4); +float4 a1[1] = { float4(1,2,3,4) }; +float4 a2[2] = { float4(1,2,3,4), float4(5,2,3,4), }; +const float4 c1[1] = { float4(1,2,3,4) }; +static const float4 c2[2] = { C, float4(1,2,3,4), }; + +float4 PixelShaderFunction(int i : sem1, float4 input[3] : sem2) : SV_TARGET0 +{ + float4 b[10] = { C, C, C, C, C, C, C, C, C, C }; + float4 tmp = C + a1[0] + c1[0] + a2[i] + c2[i]; + return a[1] + a[i] + input[2] + input[i] + b[5] + b[i] + s[i].m[i] + tmp; +} diff --git a/deps/glslang/Test/hlsl.array.implicit-size.frag b/deps/glslang/Test/hlsl.array.implicit-size.frag new file mode 100644 index 00000000..e7a54f46 --- /dev/null +++ b/deps/glslang/Test/hlsl.array.implicit-size.frag @@ -0,0 +1,32 @@ + +// array size from initializer +static float g_array [ ] = { 1, 2, 3, 4, 5 }; + +// Unused: array size from initializer +static float g_array_unused [ ] = { 1, 2, 3, 4, 5, 6, 7 }; + +// Test initializer sizing for arrayed structs +static struct mystruct { + int i; + float f; +} g_mystruct[] = { + { 1, 2.0 }, + { 3, 4.0 }, +}; + +struct PS_OUTPUT { float4 color : SV_Target0; }; + +// INVALID: implicit size requires an initializer expression. +// uniform float bad[]; + +// INVALID: function parameters cannot be implicitly sized +// void BadFunction(int a[]) { } + +void main(out PS_OUTPUT ps_output) +{ + // local array sized from initializers + float l_array[] = { 1, 2, 3 }; + int idx; + + ps_output.color = g_array[0] + g_array[4] + l_array[1] + g_mystruct[0].f + g_array[idx]; +} diff --git a/deps/glslang/Test/hlsl.array.multidim.frag b/deps/glslang/Test/hlsl.array.multidim.frag new file mode 100644 index 00000000..524a8896 --- /dev/null +++ b/deps/glslang/Test/hlsl.array.multidim.frag @@ -0,0 +1,20 @@ + +float float_array[5][4][3]; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +PS_OUTPUT main() +{ + float4 float4_array_1[2][3]; + float4 float4_array_2[5][3]; + + float4_array_1[1][2] = float_array[2][3][1]; + float4_array_2[1] = float4_array_1[0]; + + PS_OUTPUT psout; + psout.Color = float4_array_1[1][2]; + return psout; +} diff --git a/deps/glslang/Test/hlsl.assoc.frag b/deps/glslang/Test/hlsl.assoc.frag new file mode 100644 index 00000000..8ce1050c --- /dev/null +++ b/deps/glslang/Test/hlsl.assoc.frag @@ -0,0 +1,11 @@ +float4 PixelShaderFunction( + float4 a1, + float4 a2, + float4 a3, + float4 a4, + float4 a5 + ) : COLOR0 +{ + a1 = a2 = a3 = a4 = a5; + return a1 + a2 + a3 + a4 + a5; +} diff --git a/deps/glslang/Test/hlsl.attribute.expression.comp b/deps/glslang/Test/hlsl.attribute.expression.comp new file mode 100644 index 00000000..535fbad4 --- /dev/null +++ b/deps/glslang/Test/hlsl.attribute.expression.comp @@ -0,0 +1,15 @@ + +uniform int bound; + +#define FOO 3 +#define BAR 2 + +[numthreads(2+2, 2*3, (1+FOO)*BAR)] +float4 main() : SV_TARGET +{ + [unroll(5*2 + 1) ] + for (int x=0; x buffer1; + +[[vk::binding(3, 2)]] +StructuredBuffer buffer3; + +[[vk::input_attachment_index(4)]] +Texture2D attach; + +[[vk::constant_id(13)]] const int ci = 11; + +[[vk::push_constant]] cbuffer pcBuf { int a; }; + +[[vk::location(7)]] float4 +main([[vk::location(8)]] float4 input: A) : B +{ + return input + attach.Load(float2(0.5));// * a; +} diff --git a/deps/glslang/Test/hlsl.attributeGlobalBuffer.frag b/deps/glslang/Test/hlsl.attributeGlobalBuffer.frag new file mode 100644 index 00000000..a1177dab --- /dev/null +++ b/deps/glslang/Test/hlsl.attributeGlobalBuffer.frag @@ -0,0 +1,8 @@ +[[vk::global_cbuffer_binding(5, 2)]] +float4 u1; +float4 u2; + +float4 main() : SV_Target0 +{ + return u1 + u2; +} \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.automap.frag b/deps/glslang/Test/hlsl.automap.frag new file mode 100644 index 00000000..da1e885f --- /dev/null +++ b/deps/glslang/Test/hlsl.automap.frag @@ -0,0 +1,57 @@ +// Test register class offsets for different resource types + +SamplerState s1 : register(s1); +SamplerComparisonState s2 : register(s2); + +Texture1D t1 : register(t1); +Texture2D t2 : register(t2); +Texture3D t3 : register(t3); +StructuredBuffer t4 : register(t4); +ByteAddressBuffer t5 : register(t5); +Buffer t6 : register(t6); + +RWTexture1D u1 : register(u1); +RWTexture2D u2 : register(u2); +RWTexture3D u3 : register(u3); + +RWBuffer u4 : register(u4); +RWByteAddressBuffer u5 : register(u5); +RWStructuredBuffer u6 : register(u6); +AppendStructuredBuffer u7 : register(u7); +ConsumeStructuredBuffer u8 : register(u8); + +cbuffer cb : register(b1) { + int cb1; +}; + +tbuffer tb : register(t7) { + int tb1; +}; + +float4 main() : SV_Target0 +{ + t1; + t2; + t3; + t4[0]; + t5.Load(0); + t6; + + s1; + s2; + + u1; + u2; + u3; + + u4[0]; + u5.Load(0); + u6[0]; + u7; + u8; + + cb1; + tb1; + + return 0; +} diff --git a/deps/glslang/Test/hlsl.basic.comp b/deps/glslang/Test/hlsl.basic.comp new file mode 100644 index 00000000..1d95239e --- /dev/null +++ b/deps/glslang/Test/hlsl.basic.comp @@ -0,0 +1,6 @@ +groupshared float4 a[100]; + +void main(int dti : SV_DispatchThreadID, int gti : SV_GroupThreadID) +{ + dti - gti; +} diff --git a/deps/glslang/Test/hlsl.basic.geom b/deps/glslang/Test/hlsl.basic.geom new file mode 100644 index 00000000..79b061ee --- /dev/null +++ b/deps/glslang/Test/hlsl.basic.geom @@ -0,0 +1,25 @@ +struct PSInput +{ + float myfloat : SOME_SEMANTIC; + int something : ANOTHER_SEMANTIC; +}; + +struct nametest { + int Append; // these are valid names even though they are also method names. + int RestartStrip; // ... +}; + +[maxvertexcount(4)] +void main(triangle in uint VertexID[3] : VertexID, + triangle uint test[3] : FOO, + inout LineStream OutputStream) +{ + PSInput Vert; + + Vert.myfloat = test[0] + test[1] + test[2]; + Vert.something = VertexID[0]; + + OutputStream.Append(Vert); + OutputStream.Append(Vert); + OutputStream.RestartStrip(); +} diff --git a/deps/glslang/Test/hlsl.boolConv.vert b/deps/glslang/Test/hlsl.boolConv.vert new file mode 100644 index 00000000..6182b296 --- /dev/null +++ b/deps/glslang/Test/hlsl.boolConv.vert @@ -0,0 +1,20 @@ +static bool a, b = true; +float4 main() : SV_Position +{ + int r = 0; + + r += a + b; + r += a - b; + r += a * b; + r += a / b; + r += a % b; + + r += a & b; + r += a | b; + r += a ^ b; + + r += a << b; + r += a >> b; + + return r; +} diff --git a/deps/glslang/Test/hlsl.buffer.frag b/deps/glslang/Test/hlsl.buffer.frag new file mode 100644 index 00000000..73f42e8f --- /dev/null +++ b/deps/glslang/Test/hlsl.buffer.frag @@ -0,0 +1,47 @@ +cbuffer buf1 { + float4 v1; +}; // extraneous ; + +tbuffer buf2 { + float4 v2; +}; // extraneous ; + +cbuffer cbufName { + float4 v3 : packoffset(c0); + int i3 : packoffset(c1.y); +} + +tbuffer tbufName : register(t8) { + float4 v4 : packoffset(c1); + int i4 : packoffset(c3); + float f1 : packoffset(c3.w); + float f3 : packoffset(c4.x); + float f4 : packoffset(c4.y); + float f5 : packoffset(c4.z); + float f6 : packoffset(c); + float f7 : packoffset(c8); + float3x4 m1 : packoffset(c7); + row_major float3x4 m2 : packoffset(c11); + column_major float3x4 m3 : packoffset(c15); + float3x4 m4 : packoffset(c19); +} + +float foo() // float looks like identifier, but can't be part of tbuffer +{ + return 1.0; +} + +struct id { + float4 a; +}; + +cbuffer cbufName2 { + float4 v24; +} + +id PixelShaderFunction(float4 input : SV_POSITION) : SV_TARGET0 // id looks like id for cbuffer name, but can't be +{ + id ret; + ret.a = v24 + (input + v1 + v2 + v3 + v4) * foo(); + return ret; +} diff --git a/deps/glslang/Test/hlsl.calculatelod.dx10.frag b/deps/glslang/Test/hlsl.calculatelod.dx10.frag new file mode 100644 index 00000000..0fb76072 --- /dev/null +++ b/deps/glslang/Test/hlsl.calculatelod.dx10.frag @@ -0,0 +1,44 @@ +SamplerState g_sSamp : register(s0); + +Texture1DArray g_tTex1df4a : register(t1); + +uniform Texture1DArray g_tTex1df4 : register(t0); +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // LOD queries do not pass array level in coordinate. + float txval10 = g_tTex1df4a . CalculateLevelOfDetail(g_sSamp, 0.1); + float txval11 = g_tTex1di4a . CalculateLevelOfDetail(g_sSamp, 0.2); + float txval12 = g_tTex1du4a . CalculateLevelOfDetail(g_sSamp, 0.3); + + float txval20 = g_tTex2df4a . CalculateLevelOfDetail(g_sSamp, float2(0.1, 0.2)); + float txval21 = g_tTex2di4a . CalculateLevelOfDetail(g_sSamp, float2(0.3, 0.4)); + float txval22 = g_tTex2du4a . CalculateLevelOfDetail(g_sSamp, float2(0.5, 0.6)); + + float txval40 = g_tTexcdf4a . CalculateLevelOfDetail(g_sSamp, float3(0.1, 0.2, 0.3)); + float txval41 = g_tTexcdi4a . CalculateLevelOfDetail(g_sSamp, float3(0.4, 0.5, 0.6)); + float txval42 = g_tTexcdu4a . CalculateLevelOfDetail(g_sSamp, float3(0.7, 0.8, 0.9)); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.calculatelodunclamped.dx10.frag b/deps/glslang/Test/hlsl.calculatelodunclamped.dx10.frag new file mode 100644 index 00000000..4c79aed8 --- /dev/null +++ b/deps/glslang/Test/hlsl.calculatelodunclamped.dx10.frag @@ -0,0 +1,44 @@ +SamplerState g_sSamp : register(s0); + +Texture1DArray g_tTex1df4a : register(t1); + +uniform Texture1DArray g_tTex1df4 : register(t0); +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // LOD queries do not pass array level in coordinate. + float txval10 = g_tTex1df4a . CalculateLevelOfDetailUnclamped(g_sSamp, 0.1); + float txval11 = g_tTex1di4a . CalculateLevelOfDetailUnclamped(g_sSamp, 0.2); + float txval12 = g_tTex1du4a . CalculateLevelOfDetailUnclamped(g_sSamp, 0.3); + + float txval20 = g_tTex2df4a . CalculateLevelOfDetailUnclamped(g_sSamp, float2(0.1, 0.2)); + float txval21 = g_tTex2di4a . CalculateLevelOfDetailUnclamped(g_sSamp, float2(0.3, 0.4)); + float txval22 = g_tTex2du4a . CalculateLevelOfDetailUnclamped(g_sSamp, float2(0.5, 0.6)); + + float txval40 = g_tTexcdf4a . CalculateLevelOfDetailUnclamped(g_sSamp, float3(0.1, 0.2, 0.3)); + float txval41 = g_tTexcdi4a . CalculateLevelOfDetailUnclamped(g_sSamp, float3(0.4, 0.5, 0.6)); + float txval42 = g_tTexcdu4a . CalculateLevelOfDetailUnclamped(g_sSamp, float3(0.7, 0.8, 0.9)); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.cast.frag b/deps/glslang/Test/hlsl.cast.frag new file mode 100644 index 00000000..c8dc8212 --- /dev/null +++ b/deps/glslang/Test/hlsl.cast.frag @@ -0,0 +1,4 @@ +float4 PixelShaderFunction(float4 input) : COLOR0 +{ + return (float4)input + (int4)input + (float4)1.198; +} diff --git a/deps/glslang/Test/hlsl.cbuffer-identifier.vert b/deps/glslang/Test/hlsl.cbuffer-identifier.vert new file mode 100644 index 00000000..8362f5ca --- /dev/null +++ b/deps/glslang/Test/hlsl.cbuffer-identifier.vert @@ -0,0 +1,32 @@ + +cbuffer ConstantBuffer : register( b0 ) +{ + matrix World; + matrix View; + matrix Projection; +}; + +struct VS_INPUT +{ + float4 Pos : POSITION; + float3 Norm : NORMAL; +}; + +struct PS_INPUT +{ + float4 Pos : SV_POSITION; + float3 Norm : TEXCOORD0; +}; + +PS_INPUT main( VS_INPUT input ) +{ + int ConstantBuffer = 42; // test ConstantBuffer as an identifier + + PS_INPUT output = (PS_INPUT)0; + output.Pos = mul( input.Pos, World ); + output.Pos = mul( output.Pos, View ); + output.Pos = mul( output.Pos, Projection ); + output.Norm = mul( input.Norm, World ); // Work when output.Norm = mul( input.Norm, (float3x3)World ); + + return output; +} diff --git a/deps/glslang/Test/hlsl.charLit.vert b/deps/glslang/Test/hlsl.charLit.vert new file mode 100644 index 00000000..36c4a1e5 --- /dev/null +++ b/deps/glslang/Test/hlsl.charLit.vert @@ -0,0 +1,17 @@ +float4 main() : SV_Position +{ + uint a1 = 'A'; + int a2 = '0'; + + int a3 = '\a'; + a3 += '\b'; + a3 += '\t'; + a3 += '\n'; + a3 += '\v'; + a3 += '\f'; + a3 += '\r'; + + int a10 = '\c'; + + return a1 + a2 + a3 + a10; +} diff --git a/deps/glslang/Test/hlsl.clip.frag b/deps/glslang/Test/hlsl.clip.frag new file mode 100644 index 00000000..a44c9e95 --- /dev/null +++ b/deps/glslang/Test/hlsl.clip.frag @@ -0,0 +1,12 @@ + +float GetEntitySelectClip() +{ + return 1.0f; +} + +float4 main() : SV_TARGET +{ + clip(GetEntitySelectClip()); + + return 0; +} diff --git a/deps/glslang/Test/hlsl.clipdistance-1.frag b/deps/glslang/Test/hlsl.clipdistance-1.frag new file mode 100644 index 00000000..10813b30 --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-1.frag @@ -0,0 +1,6 @@ +float4 main(in float4 pos : SV_Position, + in float clip : SV_ClipDistance, + in float cull : SV_CullDistance) : SV_Target0 +{ + return pos + clip + cull; +} diff --git a/deps/glslang/Test/hlsl.clipdistance-1.geom b/deps/glslang/Test/hlsl.clipdistance-1.geom new file mode 100644 index 00000000..76c34b35 --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-1.geom @@ -0,0 +1,19 @@ +struct S { + float4 pos : SV_Position; + float2 clip : SV_ClipDistance0; +}; + +[maxvertexcount(3)] +void main(triangle in float4 pos[3] : SV_Position, + triangle in uint VertexID[3] : VertexID, + inout LineStream OutputStream, + triangle in float4 clip[3] : SV_ClipDistance) // externally: an array 3 of array 4 (not vec4!) of float. +{ + S s; + + s.pos = pos[0]; + s.clip = clip[0].xy; + + OutputStream.Append(s); +} + diff --git a/deps/glslang/Test/hlsl.clipdistance-1.vert b/deps/glslang/Test/hlsl.clipdistance-1.vert new file mode 100644 index 00000000..bcebafc3 --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-1.vert @@ -0,0 +1,8 @@ +void main(out float4 pos : SV_Position, + out float clip : SV_ClipDistance, // scalar float + out float cull : SV_CullDistance) // scalar float +{ + pos = 1.0f.xxxx; + clip = 0.5f; + cull = 0.51f; +} diff --git a/deps/glslang/Test/hlsl.clipdistance-2.frag b/deps/glslang/Test/hlsl.clipdistance-2.frag new file mode 100644 index 00000000..b6f88d56 --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-2.frag @@ -0,0 +1,7 @@ +float4 main(in float4 pos : SV_Position, + in float2 clip[2] : SV_ClipDistance, // array of vector float + in float2 cull[2] : SV_CullDistance) : SV_Target0 // array of vector float +{ + + return pos + clip[0][0] + cull[0][0]; +} diff --git a/deps/glslang/Test/hlsl.clipdistance-2.geom b/deps/glslang/Test/hlsl.clipdistance-2.geom new file mode 100644 index 00000000..90f047fe --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-2.geom @@ -0,0 +1,19 @@ +struct S { + float4 pos : SV_Position; + float2 clip[2] : SV_ClipDistance0; +}; + +[maxvertexcount(3)] +void main(triangle in float4 pos[3] : SV_Position, + triangle in uint VertexID[3] : VertexID, + inout LineStream OutputStream, + triangle in float2 clip[3][2] : SV_ClipDistance) // externally: an array 3 of array 4 of float. +{ + S s; + + s.pos = pos[0]; + s.clip[0] = clip[0][0]; + s.clip[1] = clip[0][1]; + + OutputStream.Append(s); +} diff --git a/deps/glslang/Test/hlsl.clipdistance-2.vert b/deps/glslang/Test/hlsl.clipdistance-2.vert new file mode 100644 index 00000000..bf8c0ee0 --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-2.vert @@ -0,0 +1,15 @@ +void main(out float4 pos : SV_Position, + out float2 clip[2] : SV_ClipDistance, // array of vector float + out float2 cull[2] : SV_CullDistance) // array of vector float +{ + pos = 1.0f.xxxx; + clip[0].x = 0.5f; + clip[0].y = 0.6f; + clip[1].x = 0.7f; + clip[1].y = 0.8f; + + cull[0].x = 0.525f; + cull[0].y = 0.625f; + cull[1].x = 0.725f; + cull[1].y = 0.825f; +} diff --git a/deps/glslang/Test/hlsl.clipdistance-3.frag b/deps/glslang/Test/hlsl.clipdistance-3.frag new file mode 100644 index 00000000..e2b6b862 --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-3.frag @@ -0,0 +1,6 @@ +float4 main(in float4 pos : SV_Position, + in float clip[2] : SV_ClipDistance, // array of scalar float + in float cull[2] : SV_CullDistance) : SV_Target0 // array of scalar float +{ + return pos + clip[0] + cull[0]; +} diff --git a/deps/glslang/Test/hlsl.clipdistance-3.geom b/deps/glslang/Test/hlsl.clipdistance-3.geom new file mode 100644 index 00000000..2aa4cd46 --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-3.geom @@ -0,0 +1,20 @@ +struct S { + float4 pos : SV_Position; + float2 clip0 : SV_ClipDistance0; // clip0 and clip1 form an array of float[4] externally. + float2 clip1 : SV_ClipDistance1; +}; + +[maxvertexcount(3)] +void main(triangle in float4 pos[3] : SV_Position, + triangle in uint VertexID[3] : VertexID, + inout LineStream OutputStream, + triangle in float4 clip[3] : SV_ClipDistance) // externally: an array 3 of array 4 (not vec4!) of float. +{ + S s; + + s.pos = pos[0]; + s.clip0 = clip[0].xy; + s.clip1 = clip[0].zw; + + OutputStream.Append(s); +} diff --git a/deps/glslang/Test/hlsl.clipdistance-3.vert b/deps/glslang/Test/hlsl.clipdistance-3.vert new file mode 100644 index 00000000..a759a9cc --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-3.vert @@ -0,0 +1,13 @@ +void main(out float4 pos : SV_Position, + out float clip[2] : SV_ClipDistance, // array of scalar float + out float cull[2] : SV_CullDistance) // array of scalar float +{ + pos = 1.0f.xxxx; + clip[0] = 0.5f; + clip[1] = 0.6f; + + cull[0] = 0.525f; + cull[1] = 0.625f; +} + + diff --git a/deps/glslang/Test/hlsl.clipdistance-4.frag b/deps/glslang/Test/hlsl.clipdistance-4.frag new file mode 100644 index 00000000..61441604 --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-4.frag @@ -0,0 +1,9 @@ +struct VS_OUTPUT { + float4 Position : SV_Position; + float4 ClipRect : SV_ClipDistance0; // vector in split struct +}; + +float4 main(const VS_OUTPUT v) : SV_Target0 +{ + return v.Position + v.ClipRect; +} diff --git a/deps/glslang/Test/hlsl.clipdistance-4.geom b/deps/glslang/Test/hlsl.clipdistance-4.geom new file mode 100644 index 00000000..ff296a88 --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-4.geom @@ -0,0 +1,21 @@ +struct S { + float4 pos : SV_Position; + float2 clip0 : SV_ClipDistance0; // clip0 and clip1 form an array of float[4] externally. + float2 clip1 : SV_ClipDistance1; +}; + +[maxvertexcount(3)] +void main(triangle in float4 pos[3] : SV_Position, + triangle in uint VertexID[3] : VertexID, + inout LineStream OutputStream, + triangle in float2 clip0[3] : SV_ClipDistance0, // test input arrayed semantic vars + triangle in float2 clip1[3] : SV_ClipDistance1) +{ + S s; + + s.pos = pos[0]; + s.clip0 = clip0[0]; + s.clip1 = clip1[0]; + + OutputStream.Append(s); +} diff --git a/deps/glslang/Test/hlsl.clipdistance-4.vert b/deps/glslang/Test/hlsl.clipdistance-4.vert new file mode 100644 index 00000000..5e0d082f --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-4.vert @@ -0,0 +1,21 @@ +struct VS_INPUT { + float4 Position : POSITION; +}; + +struct VS_OUTPUT { + float4 Position : SV_Position; + float4 ClipRect : SV_ClipDistance0; // vector in split struct +}; + +VS_OUTPUT main(const VS_INPUT v) +{ + VS_OUTPUT Output; + Output.Position = 0; + + Output.ClipRect.x = 1; + Output.ClipRect.y = 2; + Output.ClipRect.z = 3; + Output.ClipRect.w = 4; + + return Output; +} diff --git a/deps/glslang/Test/hlsl.clipdistance-5.frag b/deps/glslang/Test/hlsl.clipdistance-5.frag new file mode 100644 index 00000000..47229994 --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-5.frag @@ -0,0 +1,9 @@ +struct VS_OUTPUT { + float4 Position : SV_Position; + float2 ClipRect[2] : SV_ClipDistance0; // array of float2 in split struct +}; + +float4 main(const VS_OUTPUT v) : SV_Target0 +{ + return v.Position + v.ClipRect[0].x + v.ClipRect[1].x; +} diff --git a/deps/glslang/Test/hlsl.clipdistance-5.vert b/deps/glslang/Test/hlsl.clipdistance-5.vert new file mode 100644 index 00000000..02fb8627 --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-5.vert @@ -0,0 +1,21 @@ +struct VS_INPUT { + float4 Position : POSITION; +}; + +struct VS_OUTPUT { + float4 Position : SV_Position; + float2 ClipRect[2] : SV_ClipDistance0; // array of float2 in split struct +}; + +VS_OUTPUT main(const VS_INPUT v) +{ + VS_OUTPUT Output; + Output.Position = 0; + + Output.ClipRect[0].x = 1; + Output.ClipRect[0].y = 2; + Output.ClipRect[1].x = 3; + Output.ClipRect[1].y = 4; + + return Output; +} diff --git a/deps/glslang/Test/hlsl.clipdistance-6.frag b/deps/glslang/Test/hlsl.clipdistance-6.frag new file mode 100644 index 00000000..646197be --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-6.frag @@ -0,0 +1,10 @@ +struct VS_OUTPUT { + float4 Position : SV_Position; + float4 clip0 : SV_ClipDistance0; // multiple semantic IDs, two vec4s (no extra packing) + float4 clip1 : SV_ClipDistance1; // ... +}; + +float4 main(VS_OUTPUT v) : SV_Target0 +{ + return v.Position + v.clip0 + v.clip1; +} diff --git a/deps/glslang/Test/hlsl.clipdistance-6.vert b/deps/glslang/Test/hlsl.clipdistance-6.vert new file mode 100644 index 00000000..d68c2254 --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-6.vert @@ -0,0 +1,23 @@ +struct VS_OUTPUT { + float4 Position : SV_Position; + float4 clip0 : SV_ClipDistance0; // multiple semantic IDs, two vec4s (no extra packing) + float4 clip1 : SV_ClipDistance1; // ... +}; + +VS_OUTPUT main() +{ + VS_OUTPUT Output; + Output.Position = 0; + + Output.clip0.x = 0; + Output.clip0.y = 1; + Output.clip0.z = 2; + Output.clip0.w = 3; + + Output.clip1.x = 4; + Output.clip1.y = 5; + Output.clip1.z = 6; + Output.clip1.w = 7; + + return Output; +} diff --git a/deps/glslang/Test/hlsl.clipdistance-7.frag b/deps/glslang/Test/hlsl.clipdistance-7.frag new file mode 100644 index 00000000..1a26df8a --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-7.frag @@ -0,0 +1,10 @@ +struct VS_OUTPUT { + float4 Position : SV_Position; + float3 clip0 : SV_ClipDistance0; // multiple semantic IDs, vec3+vec4 (skip) + float4 clip1 : SV_ClipDistance1; // ... +}; + +float4 main(VS_OUTPUT v) : SV_Target0 +{ + return v.Position + v.clip0.x + v.clip1.x; +} diff --git a/deps/glslang/Test/hlsl.clipdistance-7.vert b/deps/glslang/Test/hlsl.clipdistance-7.vert new file mode 100644 index 00000000..c615d1f8 --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-7.vert @@ -0,0 +1,23 @@ +struct VS_OUTPUT { + float4 Position : SV_Position; + float3 clip0 : SV_ClipDistance0; // multiple semantic IDs, vec3+vec4 (skip) + float4 clip1 : SV_ClipDistance1; // ... +}; + +VS_OUTPUT main() +{ + VS_OUTPUT Output; + Output.Position = 0; + + Output.clip0.x = 0; + Output.clip0.y = 1; + Output.clip0.z = 2; + // Position 3 is skipped + + Output.clip1.x = 4; + Output.clip1.y = 5; + Output.clip1.z = 6; + Output.clip1.w = 7; + + return Output; +} diff --git a/deps/glslang/Test/hlsl.clipdistance-8.frag b/deps/glslang/Test/hlsl.clipdistance-8.frag new file mode 100644 index 00000000..2edf1948 --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-8.frag @@ -0,0 +1,10 @@ +struct VS_OUTPUT { + float4 Position : SV_Position; + float3 clip0 : SV_ClipDistance0; // multiple semantic IDs, vec3+float (pack) + float clip1 : SV_ClipDistance1; // ... +}; + +float4 main(VS_OUTPUT v) : SV_Target0 +{ + return v.Position + v.clip0.x + v.clip1; +} diff --git a/deps/glslang/Test/hlsl.clipdistance-8.vert b/deps/glslang/Test/hlsl.clipdistance-8.vert new file mode 100644 index 00000000..c6377d2d --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-8.vert @@ -0,0 +1,20 @@ +struct VS_OUTPUT { + float4 Position : SV_Position; + float3 clip0 : SV_ClipDistance0; // multiple semantic IDs, vec3+float (pack) + float clip1 : SV_ClipDistance1; // ... +}; + +VS_OUTPUT main() +{ + VS_OUTPUT Output; + Output.Position = 0; + + Output.clip0.x = 0; + Output.clip0.y = 1; + Output.clip0.z = 2; + + // Position 3 is packed from clip1's float + Output.clip1 = 3; + + return Output; +} diff --git a/deps/glslang/Test/hlsl.clipdistance-9.frag b/deps/glslang/Test/hlsl.clipdistance-9.frag new file mode 100644 index 00000000..cbe940af --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-9.frag @@ -0,0 +1,8 @@ + +// Test packing 0 and 1 semantics into single array[4], from in fn params. +float4 main(in float4 Position : SV_Position, + in float3 clip0 : SV_ClipDistance0, + in float clip1 : SV_ClipDistance1) : SV_Target0 +{ + return Position + clip0.x + clip1; +} diff --git a/deps/glslang/Test/hlsl.clipdistance-9.vert b/deps/glslang/Test/hlsl.clipdistance-9.vert new file mode 100644 index 00000000..d4883070 --- /dev/null +++ b/deps/glslang/Test/hlsl.clipdistance-9.vert @@ -0,0 +1,19 @@ +struct VS_OUTPUT { + float4 Position : SV_Position; +}; + +// Test packing 0 and 1 semantics into single array[4] output, from out fn params. +VS_OUTPUT main(out float3 clip0 : SV_ClipDistance0, out float clip1 : SV_ClipDistance1) +{ + VS_OUTPUT Output; + Output.Position = 0; + + clip0.x = 0; + clip0.y = 1; + clip0.z = 2; + + // Position 3 is packed from clip1's float + clip1 = 3; + + return Output; +} diff --git a/deps/glslang/Test/hlsl.color.hull.tesc b/deps/glslang/Test/hlsl.color.hull.tesc new file mode 100644 index 00000000..73d9ad03 --- /dev/null +++ b/deps/glslang/Test/hlsl.color.hull.tesc @@ -0,0 +1,74 @@ +///////////// +// GLOBALS // +///////////// +cbuffer TessellationBuffer : register(b0) +{ + float tessellationAmount; + float3 padding; +}; + + +////////////// +// TYPEDEFS // +////////////// +struct HullInputType +{ + float3 position : POSITION; + float4 color : COLOR; +}; + +struct ConstantOutputType +{ + float edges[3] : SV_TessFactor; + float inside : SV_InsideTessFactor; +}; + +struct HullOutputType +{ + float3 position : POSITION; + float4 color : COLOR; +}; + + +//////////////////////////////////////////////////////////////////////////////// +// Patch Constant Function +//////////////////////////////////////////////////////////////////////////////// +ConstantOutputType ColorPatchConstantFunction(InputPatch inputPatch, uint patchId : SV_PrimitiveID) +{ + ConstantOutputType output; + + + // Set the tessellation factors for the three edges of the triangle. + output.edges[0] = tessellationAmount; + output.edges[1] = tessellationAmount; + output.edges[2] = tessellationAmount; + + // Set the tessellation factor for tessallating inside the triangle. + output.inside = tessellationAmount; + + return output; +} + + +//////////////////////////////////////////////////////////////////////////////// +// Hull Shader +//////////////////////////////////////////////////////////////////////////////// +[domain("tri")] +[partitioning("integer")] +[outputtopology("triangle_cw")] +[outputcontrolpoints(3)] +[patchconstantfunc("ColorPatchConstantFunction")] + +HullOutputType main(InputPatch patch, uint pointId : SV_OutputControlPointID, uint patchId : SV_PrimitiveID) +{ + HullOutputType output; + + // Set the position for this control point as the output position. + output.position = patch[pointId].position; + + // Set the input color as the output color. + output.color = patch[pointId].color; + + return output; +} + diff --git a/deps/glslang/Test/hlsl.comparison.vec.frag b/deps/glslang/Test/hlsl.comparison.vec.frag new file mode 100644 index 00000000..b8f93c9f --- /dev/null +++ b/deps/glslang/Test/hlsl.comparison.vec.frag @@ -0,0 +1,34 @@ +uniform float4 uf4; + +void Bug1( float4 a ) +{ + float4 v04 = float4( 0.0, 0.0, 0.0, 0.0 ); + float v01 = 0.0; + + bool4 r00 = a == v04; + bool4 r01 = a != v04; + bool4 r02 = a < v04; + bool4 r03 = a > v04; + + bool4 r10 = a == v01; + bool4 r11 = a != v01; + bool4 r12 = a < v01; + bool4 r13 = a > v01; + + bool4 r20 = v01 == a; + bool4 r21 = v01 != a; + bool4 r22 = v01 < a; + bool4 r23 = v01 > a; +} + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + psout.Color = 0; + return psout; +} diff --git a/deps/glslang/Test/hlsl.conditional.frag b/deps/glslang/Test/hlsl.conditional.frag new file mode 100644 index 00000000..91f75eec --- /dev/null +++ b/deps/glslang/Test/hlsl.conditional.frag @@ -0,0 +1,42 @@ +float4 c4; +float4 t4; +float4 f4; +float t; +float f; + +float4 vectorCond() +{ + return (c4 ? t4 : f4) + + (c4 ? t : f ) + + (t4 < f4 ? t4 : f4) + + (c4 ? t : f4); +} + +float4 scalarCond() +{ + float4 ret = t != f ? t * f4 : 1; + return ret; +} + +float2 fbSelect(bool2 cnd, float2 src0, float2 src1) +{ + return cnd ? src0 : src1; +} + +float4 PixelShaderFunction(float4 input) : COLOR0 +{ + int a = 1 < 2 ? 3 < 4 ? 5 : 6 : 7; + int b = 1 < 2 ? 3 > 4 ? 5 : 6 : 7; + int c = 1 > 2 ? 3 > 4 ? 5 : 6 : 7; + int d = 1 > 2 ? 3 < 4 ? 5 : 6 : 7; + float4 ret = a * input + + b * input + + c * input + + d * input; + int e; + e = a = b ? c = d : 10, b = a ? d = c : 11; + float4 f; + f = ret.x < input.y ? c * input : d * input; + return e * ret + f + vectorCond() + scalarCond() + + float4(fbSelect(bool2(true, false), float2(1.0, 2.0), float2(3.0, 4.0)), 10.0, 10.0); +} diff --git a/deps/glslang/Test/hlsl.constantbuffer.frag b/deps/glslang/Test/hlsl.constantbuffer.frag new file mode 100644 index 00000000..c2b3a00c --- /dev/null +++ b/deps/glslang/Test/hlsl.constantbuffer.frag @@ -0,0 +1,26 @@ + +struct c1_t { + float4 x; +}; + +struct c2_t { + bool x; + float y; +}; + +ConstantBuffer cb1 : register(b12); +ConstantBuffer cb2[3]; +ConstantBuffer cb3[2][4]; + +cbuffer cbuff { + int c1; +}; + +float4 main() : SV_Target0 +{ + if (cb3[1][2].x) + return cb1.x + cb2[1].y + c1; + else + return cb3[1][3].y; +} + diff --git a/deps/glslang/Test/hlsl.constructArray.vert b/deps/glslang/Test/hlsl.constructArray.vert new file mode 100644 index 00000000..52c4b6f0 --- /dev/null +++ b/deps/glslang/Test/hlsl.constructArray.vert @@ -0,0 +1,10 @@ +float4 main() : SV_POSITION +{ + int4 int4_array[3]; + float4 float4_array_times[2] = (float4[2])int4_array; + float2 float2_array_times2[4] = (float2[4])int4_array; + int4 int4_array2[2] = (int4[2])int4_array; + int int1_array[2] = (int[2])int4_array; + + return (float4)0.0; +} diff --git a/deps/glslang/Test/hlsl.constructexpr.frag b/deps/glslang/Test/hlsl.constructexpr.frag new file mode 100644 index 00000000..7048f62c --- /dev/null +++ b/deps/glslang/Test/hlsl.constructexpr.frag @@ -0,0 +1,17 @@ +struct PS_OUTPUT { float4 color : SV_Target0; }; + +PS_OUTPUT main() +{ + // Evaluates to a sequence: 3, 4, 5, 6, 7, 8, and a float2(9,10), float2(11,12) sequence + (int(3)); + (int(3) + int(1)); + (int(3) + int(1) + int(1)); + (((int(6)))); + (int(7.0)); + ((int((2)) ? 8 : 8)); + (float2(9, 10), float2(11, 12)); + + PS_OUTPUT ps_output; + ps_output.color = 1.0; + return ps_output; +} diff --git a/deps/glslang/Test/hlsl.constructimat.frag b/deps/glslang/Test/hlsl.constructimat.frag new file mode 100644 index 00000000..f320ba15 --- /dev/null +++ b/deps/glslang/Test/hlsl.constructimat.frag @@ -0,0 +1,52 @@ +int main() : SV_TARGET +{ + // integer mat constructors + const int4x4 var441 = { 0,1,0,0, 1,1,0,0, 1,0,0,0, 0,0,0,0 }; + const int4x4 var442 = int4x4( 0,1,0,0, 1,1,0,0, 1,0,0,0, 0,0,0,0 ); + int4x4 var443 = { 0,1,0,0, 1,1,0,0, 1,0,0,0, 0,0,0,0 }; + int4x4 var444 = int4x4( 0,1,0,0, 1,1,0,0, 1,0,0,0, 0,0,0,0 ); + + const int4x2 var421 = { 0,1, 1,1, 1,0, 0,0 }; + const int4x2 var422 = int4x2( 0,1, 1,1, 1,0, 0,0 ); + int4x2 var423 = { 0,1, 1,1, 1,0, 0,0 }; + int4x2 var424 = int4x2( 0,1, 1,1, 1,0, 0,0 ); + + const int3x2 var321 = { 0,1, 1,1, 1,0 }; + const int3x2 var322 = int3x2( 0,1, 1,1, 1,0 ); + int3x2 var323 = { 0,1, 1,1, 1,0 }; + int3x2 var234 = int3x2( 0,1, 1,1, 1,0); + + // unsigned integer mat constructors + const uint4x4 uvar441 = { 0,1,0,0, 1,1,0,0, 1,0,0,0, 0,0,0,0 }; + const uint4x4 uvar442 = uint4x4( 0,1,0,0, 1,1,0,0, 1,0,0,0, 0,0,0,0 ); + uint4x4 uvar443 = { 0,1,0,0, 1,1,0,0, 1,0,0,0, 0,0,0,0 }; + uint4x4 uvar444 = uint4x4( 0,1,0,0, 1,1,0,0, 1,0,0,0, 0,0,0,0 ); + + const uint4x2 uvar421 = { 0,1, 1,1, 1,0, 0,0 }; + const uint4x2 uvar422 = uint4x2( 0,1, 1,1, 1,0, 0,0 ); + uint4x2 uvar423 = { 0,1, 1,1, 1,0, 0,0 }; + uint4x2 uvar424 = uint4x2( 0,1, 1,1, 1,0, 0,0 ); + + const uint3x2 uvar321 = { 0,1, 1,1, 1,0 }; + const uint3x2 uvar322 = uint3x2( 0,1, 1,1, 1,0 ); + uint3x2 uvar323 = { 0,1, 1,1, 1,0 }; + uint3x2 uvar234 = uint3x2( 0,1, 1,1, 1,0); + + // boolean mat constructors + const bool4x4 bvar441 = { 0,1,0,0, 1,1,0,0, 1,0,0,0, 0,0,0,0 }; + const bool4x4 bvar442 = bool4x4( 0,1,0,0, 1,1,0,0, 1,0,0,0, 0,0,0,0 ); + bool4x4 bvar443 = { 0,1,0,0, 1,1,0,0, 1,0,0,0, 0,0,0,0 }; + bool4x4 bvar444 = bool4x4( 0,1,0,0, 1,1,0,0, 1,0,0,0, 0,0,0,0 ); + + const bool4x2 bvar421 = { 0,1, 1,1, 1,0, 0,0 }; + const bool4x2 bvar422 = bool4x2( 0,1, 1,1, 1,0, 0,0 ); + bool4x2 bvar423 = { 0,1, 1,1, 1,0, 0,0 }; + bool4x2 bvar424 = bool4x2( 0,1, 1,1, 1,0, 0,0 ); + + const bool3x2 bvar321 = { 0,1, 1,1, 1,0 }; + const bool3x2 bvar322 = bool3x2( 0,1, 1,1, 1,0 ); + bool3x2 bvar323 = { 0,1, 1,1, 1,0 }; + bool3x2 bvar234 = bool3x2( 0,1, 1,1, 1,0); + + return 0; +} diff --git a/deps/glslang/Test/hlsl.coverage.frag b/deps/glslang/Test/hlsl.coverage.frag new file mode 100644 index 00000000..c6cd0194 --- /dev/null +++ b/deps/glslang/Test/hlsl.coverage.frag @@ -0,0 +1,20 @@ + +// Verify that coverage mask is an array, as required by SPIR-V. + +struct PS_INPUT +{ +}; + +struct PS_OUTPUT +{ + float4 vColor : SV_Target0; + uint nCoverageMask : SV_Coverage; +}; + +PS_OUTPUT main( PS_INPUT i ) +{ + PS_OUTPUT o; + o.vColor = float4(1.0, 0.0, 0.0, 1.0); + o.nCoverageMask = 0; + return o; +} diff --git a/deps/glslang/Test/hlsl.dashI.vert b/deps/glslang/Test/hlsl.dashI.vert new file mode 100644 index 00000000..a432be51 --- /dev/null +++ b/deps/glslang/Test/hlsl.dashI.vert @@ -0,0 +1,13 @@ +// For -Iinc1/path1 -Iinc1/path2 +// bar.h from local directory will define i1, while the ones from inc1/path1 and inc1/path2 will not. +// notHere.h is only in inc1/path1 and inc2/path2, and only inc1/path1 defines p1, p2, and p3 +// parent.h is local again, and defines i4 + +#include "bar.h" +#include "notHere.h" +#include "parent.h" + +float4 main() : SV_Position +{ + return i1 + i4 + p1 + p2 + p3; +} diff --git a/deps/glslang/Test/hlsl.deadFunctionMissingBody.vert b/deps/glslang/Test/hlsl.deadFunctionMissingBody.vert new file mode 100644 index 00000000..a5f965ab --- /dev/null +++ b/deps/glslang/Test/hlsl.deadFunctionMissingBody.vert @@ -0,0 +1,8 @@ +float4 main(): SV_Target0 { return 0; } +struct Surface { float3 albedo; }; +Surface surfaceShader(float fade); +Surface surfaceShaderExec() +{ + float fade = 0; + return surfaceShader(0); +} diff --git a/deps/glslang/Test/hlsl.depthGreater.frag b/deps/glslang/Test/hlsl.depthGreater.frag new file mode 100644 index 00000000..ca41f089 --- /dev/null +++ b/deps/glslang/Test/hlsl.depthGreater.frag @@ -0,0 +1,4 @@ +void PixelShaderFunction(out float depth : SV_DepthGreaterEqual) +{ + depth = 0.2; +} diff --git a/deps/glslang/Test/hlsl.depthLess.frag b/deps/glslang/Test/hlsl.depthLess.frag new file mode 100644 index 00000000..aca7dbb8 --- /dev/null +++ b/deps/glslang/Test/hlsl.depthLess.frag @@ -0,0 +1,4 @@ +float PixelShaderFunction() : SV_DepthLessEqual +{ + return 0.2; +} diff --git a/deps/glslang/Test/hlsl.discard.frag b/deps/glslang/Test/hlsl.discard.frag new file mode 100644 index 00000000..7d9271c9 --- /dev/null +++ b/deps/glslang/Test/hlsl.discard.frag @@ -0,0 +1,14 @@ +void foo(float f) +{ + if (f < 1.0) + discard; +} + +void PixelShaderFunction(float4 input) : COLOR0 +{ + foo(input.z); + if (input.x) + discard; + float f = input.x; + discard; +} diff --git a/deps/glslang/Test/hlsl.doLoop.frag b/deps/glslang/Test/hlsl.doLoop.frag new file mode 100644 index 00000000..0318dc8f --- /dev/null +++ b/deps/glslang/Test/hlsl.doLoop.frag @@ -0,0 +1,9 @@ +float4 PixelShaderFunction(float input) : COLOR0 +{ + [unroll] do {} while (false); + [unroll] do {;} while (false); + do { return (float4)input; } while (input > 2.0); + do ++input; while (input < 10.0); + do while (++input < 10.0); while (++input < 10.0); // nest while inside do-while + return (float4)input; +} diff --git a/deps/glslang/Test/hlsl.domain.1.tese b/deps/glslang/Test/hlsl.domain.1.tese new file mode 100644 index 00000000..7366e9bc --- /dev/null +++ b/deps/glslang/Test/hlsl.domain.1.tese @@ -0,0 +1,32 @@ + +struct ds_in_t +{ + float4 pos : POSITION; + float3 norm : TEXCOORD0; +}; + +struct pcf_in_t +{ + float flTessFactor [3] : SV_TessFactor; + float flInsideTessFactor : SV_InsideTessFactor; +}; + +struct gs_in_t +{ + float4 pos : POSITION; + float3 norm : TEXCOORD0; +}; + +[domain ( "tri" )] +gs_in_t main (const OutputPatch i, float f : msem, float3 tesscoord : SV_DomainLocation, pcf_in_t pcf_data ) +{ + gs_in_t o; + + o.pos = i[0].pos + tesscoord.x * f; + o.norm = i[0].norm + tesscoord.y; + + tesscoord.z; + + return o; +} + diff --git a/deps/glslang/Test/hlsl.domain.2.tese b/deps/glslang/Test/hlsl.domain.2.tese new file mode 100644 index 00000000..ffb53f1f --- /dev/null +++ b/deps/glslang/Test/hlsl.domain.2.tese @@ -0,0 +1,35 @@ +// This will test having the PCF input to the domain shader not be given at the end of +// the argument list. We must move it to the end of the linkage in this case. + +struct ds_in_t +{ + float4 pos : POSITION; + float3 norm : TEXCOORD0; +}; + +struct pcf_in_t +{ + float flTessFactor [3] : SV_TessFactor; + float flInsideTessFactor : SV_InsideTessFactor; + float foo : PCF_FOO; +}; + +struct gs_in_t +{ + float4 pos : POSITION; + float3 norm : TEXCOORD0; +}; + +[domain ( "tri" )] +gs_in_t main (pcf_in_t pcf_data, const OutputPatch i, float3 tesscoord : SV_DomainLocation) +{ + gs_in_t o; + + o.pos = i[0].pos + tesscoord.x; + o.norm = i[0].norm + tesscoord.y; + + tesscoord.z; + + return o; +} + diff --git a/deps/glslang/Test/hlsl.domain.3.tese b/deps/glslang/Test/hlsl.domain.3.tese new file mode 100644 index 00000000..aeceedac --- /dev/null +++ b/deps/glslang/Test/hlsl.domain.3.tese @@ -0,0 +1,31 @@ +// Test vec2 tessellation coordinate: the IO form should be a vec3, copied to a vec2 +// at the entry point boundary. + +struct ds_in_t +{ + float4 pos : POSITION; + float3 norm : TEXCOORD0; +}; + +struct pcf_in_t +{ + float flTessFactor [3] : SV_TessFactor; + float flInsideTessFactor : SV_InsideTessFactor; +}; + +struct gs_in_t +{ + float4 pos : POSITION; + float3 norm : TEXCOORD0; +}; + +[domain ( "isoline" )] +gs_in_t main (const OutputPatch i, float2 tesscoord : SV_DomainLocation, pcf_in_t pcf_data ) +{ + gs_in_t o; + + o.pos = i[0].pos + tesscoord.x; + o.norm = i[0].norm + tesscoord.y; + + return o; +} diff --git a/deps/glslang/Test/hlsl.emptystruct.init.vert b/deps/glslang/Test/hlsl.emptystruct.init.vert new file mode 100644 index 00000000..02050f8b --- /dev/null +++ b/deps/glslang/Test/hlsl.emptystruct.init.vert @@ -0,0 +1,8 @@ +struct Test { }; + +static const Test Test_Empty; + +float4 main(in uint vertexIndex : VERTEXID) : VS_OUT_POSITION +{ + return 0; +} diff --git a/deps/glslang/Test/hlsl.emptystructreturn.frag b/deps/glslang/Test/hlsl.emptystructreturn.frag new file mode 100644 index 00000000..f6a772a3 --- /dev/null +++ b/deps/glslang/Test/hlsl.emptystructreturn.frag @@ -0,0 +1,13 @@ +struct ps_in +{ +}; + +struct ps_out +{ +}; + +ps_out main (ps_in i) +{ + ps_out o; + return o; +} diff --git a/deps/glslang/Test/hlsl.emptystructreturn.vert b/deps/glslang/Test/hlsl.emptystructreturn.vert new file mode 100644 index 00000000..8ac6578e --- /dev/null +++ b/deps/glslang/Test/hlsl.emptystructreturn.vert @@ -0,0 +1,13 @@ +struct vs_in +{ +}; + +struct vs_out +{ +}; + +vs_out main (vs_in i) +{ + vs_out o; + return o; +} diff --git a/deps/glslang/Test/hlsl.entry-in.frag b/deps/glslang/Test/hlsl.entry-in.frag new file mode 100644 index 00000000..e15955dd --- /dev/null +++ b/deps/glslang/Test/hlsl.entry-in.frag @@ -0,0 +1,20 @@ +struct InParam { + float2 v; + float4 fragCoord : SV_POSITION; + int2 i2; +}; + +float fun(InParam p) +{ + return p.v.y + p.fragCoord.x; +} + +float4 PixelShaderFunction(InParam i) : COLOR0 +{ + InParam local; + local = i; + float ret1 = fun(local); + float ret2 = fun(i); + + return local.fragCoord * ret1 * ret2; +} diff --git a/deps/glslang/Test/hlsl.entry-out.frag b/deps/glslang/Test/hlsl.entry-out.frag new file mode 100644 index 00000000..27b4dd64 --- /dev/null +++ b/deps/glslang/Test/hlsl.entry-out.frag @@ -0,0 +1,23 @@ +struct OutParam { + float2 v; + int2 i; +}; + +void fun(out OutParam op) +{ + op.v = float2(0.4); + op.i = int2(7); +} + +float4 PixelShaderFunction(float4 input, out float4 out1, out OutParam out2, out OutParam out3) : COLOR0 +{ + out1 = input; + out2.v = 2.0; + out2.i = 3; + OutParam local; + local.v = 12.0; + local.i = 13; + fun(out3); + + return out1; +} diff --git a/deps/glslang/Test/hlsl.entry.rename.frag b/deps/glslang/Test/hlsl.entry.rename.frag new file mode 100644 index 00000000..188dfc58 --- /dev/null +++ b/deps/glslang/Test/hlsl.entry.rename.frag @@ -0,0 +1,15 @@ + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +void not_the_entry_point() { } +int also_not_the_entry_point; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + psout.Color = 0; + return psout; +} diff --git a/deps/glslang/Test/hlsl.explicitDescriptorSet.frag b/deps/glslang/Test/hlsl.explicitDescriptorSet.frag new file mode 100644 index 00000000..1cff8d30 --- /dev/null +++ b/deps/glslang/Test/hlsl.explicitDescriptorSet.frag @@ -0,0 +1,15 @@ +SamplerState g_sSamp : register(s1); + +Texture1D g_tTex1df4 : register(t0); + +SamplerState g_sSamp2_amb; +uniform float floatval_amb; + +Buffer floatbuff; + +float4 main() : SV_Target0 +{ + g_sSamp2_amb; + + return 0; +} diff --git a/deps/glslang/Test/hlsl.flatten.return.frag b/deps/glslang/Test/hlsl.flatten.return.frag new file mode 100644 index 00000000..4aa3f501 --- /dev/null +++ b/deps/glslang/Test/hlsl.flatten.return.frag @@ -0,0 +1,18 @@ + +struct PS_OUTPUT +{ + float4 color : SV_Target0; + float other_struct_member1; + float other_struct_member2; + float other_struct_member3; +}; + +PS_OUTPUT Func1() +{ + return PS_OUTPUT(float4(1,1,1,1), 2, 3, 4); +} + +PS_OUTPUT main() +{ + return Func1(); +} diff --git a/deps/glslang/Test/hlsl.flattenOpaque.frag b/deps/glslang/Test/hlsl.flattenOpaque.frag new file mode 100644 index 00000000..279be8a0 --- /dev/null +++ b/deps/glslang/Test/hlsl.flattenOpaque.frag @@ -0,0 +1,40 @@ +struct os { + sampler2D s2D; +}; + +struct os2 { + sampler2D s2D; + Texture2D tex; +}; + +Texture2D tex; +os s; +os2 s2; + +float4 osCall1(os s) +{ + return tex.Sample(s.s2D, float2(0.2, 0.3)); +} + +float4 osCall2(os s, float2 f2) +{ + return tex.Sample(s.s2D, f2); +} + +float4 os2Call1(os2 s) +{ + return s.tex.Sample(s.s2D, float2(0.2, 0.3)); +} + +float4 os2Call2(os2 s, float2 f2) +{ + return s.tex.Sample(s.s2D, f2); +} + +float4 main() : SV_TARGET0 +{ + return osCall1(s) + + osCall2(s, float2(0.2, 0.3)) + + os2Call1(s2) + + os2Call2(s2, float2(0.2, 0.3)); +} diff --git a/deps/glslang/Test/hlsl.flattenOpaqueInit.vert b/deps/glslang/Test/hlsl.flattenOpaqueInit.vert new file mode 100644 index 00000000..9ed8bc7a --- /dev/null +++ b/deps/glslang/Test/hlsl.flattenOpaqueInit.vert @@ -0,0 +1,27 @@ +struct FxaaTex { SamplerState smpl; Texture2D tex; }; +SamplerState g_tInputTexture_sampler; Texture2D g_tInputTexture; + +float4 lookUp(FxaaTex tex) +{ + return tex.tex.Sample(tex.smpl, float2(0.3, 0.4)); +} + +FxaaTex fillOpaque() +{ + FxaaTex t; + t.smpl = g_tInputTexture_sampler; + t.tex = g_tInputTexture; + return t; +} + +float4 main() : SV_TARGET0 +{ + FxaaTex tex1 = { g_tInputTexture_sampler, g_tInputTexture }; + float4 res = lookUp(tex1); + FxaaTex tex2 = fillOpaque(); + res += lookUp(tex2); + FxaaTex tex3 = tex1; + res += lookUp(tex3); + + return res; +} diff --git a/deps/glslang/Test/hlsl.flattenOpaqueInitMix.vert b/deps/glslang/Test/hlsl.flattenOpaqueInitMix.vert new file mode 100644 index 00000000..2e712ee5 --- /dev/null +++ b/deps/glslang/Test/hlsl.flattenOpaqueInitMix.vert @@ -0,0 +1,13 @@ +struct FxaaTex { SamplerState smpl; Texture2D tex; float f; }; +SamplerState g_tInputTexture_sampler; Texture2D g_tInputTexture; + +float4 lookUp(FxaaTex tex) +{ + return tex.tex.Sample(tex.smpl, float2(tex.f, tex.f)); +} + +float4 main() : SV_TARGET0 +{ + FxaaTex tex = { g_tInputTexture_sampler, g_tInputTexture, 0.5 }; + return lookUp(tex); +} \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.flattenSubset.frag b/deps/glslang/Test/hlsl.flattenSubset.frag new file mode 100644 index 00000000..c80e093c --- /dev/null +++ b/deps/glslang/Test/hlsl.flattenSubset.frag @@ -0,0 +1,36 @@ +struct S0 +{ + int x; + int y; + SamplerState ss; +}; + +struct S1 +{ + float b; + SamplerState samplerState; + S0 s0; + int a; +}; + +struct S2 +{ + int a1; + int a2; + int a3; + int a4; + int a5; + S1 resources; +}; + +SamplerState samp; +Texture2D tex; + +float4 main(float4 vpos : VPOS) : COLOR0 +{ + S1 s1; + S2 s2; + s1.s0.ss = samp; + s2.resources = s1; + return tex.Sample(s2.resources.s0.ss, float2(0.5)); +} diff --git a/deps/glslang/Test/hlsl.flattenSubset2.frag b/deps/glslang/Test/hlsl.flattenSubset2.frag new file mode 100644 index 00000000..753475dc --- /dev/null +++ b/deps/glslang/Test/hlsl.flattenSubset2.frag @@ -0,0 +1,24 @@ +struct Nested { float y; Texture2D texNested; }; +struct A { Nested n; float x; }; +struct B { Nested n; Texture2D tex; }; + +Texture2D someTex; + +float4 main(float4 vpos : VPOS) : COLOR0 +{ + A a1, a2; + B b; + + // Assignment of nested structs to nested structs + a1.n = a2.n; + b .n = a1.n; + + // Assignment of nested struct to standalone + Nested n = b.n; + + // Assignment to nestested struct members + a2.n.texNested = someTex; + a1.n.y = 1.0; + + return float4(0,0,0,0); +} diff --git a/deps/glslang/Test/hlsl.float1.frag b/deps/glslang/Test/hlsl.float1.frag new file mode 100644 index 00000000..f9c0a6e0 --- /dev/null +++ b/deps/glslang/Test/hlsl.float1.frag @@ -0,0 +1,7 @@ +static float1 f1 = float1(1.0); +static float scalar = 2.0; + +float1 ShaderFunction(float1 inFloat1 : COLOR, float inScalar) : COLOR0 +{ + return f1 * scalar + inFloat1 * inScalar; +} diff --git a/deps/glslang/Test/hlsl.float4.frag b/deps/glslang/Test/hlsl.float4.frag new file mode 100644 index 00000000..b541f5d3 --- /dev/null +++ b/deps/glslang/Test/hlsl.float4.frag @@ -0,0 +1,11 @@ +float4 AmbientColor = float4(1, 0.5, 0, 1); + +bool ff1 : SV_IsFrontFace; +float ff2 : packoffset(c1.y); +float4 ff3 : packoffset(c2) : register(ps_5_0, s0) ; +float4 ff4 : VPOS : packoffset(c3) : register(ps_5_0, s1) ; + +float4 ShaderFunction(float4 input) : COLOR0 +{ + return input * AmbientColor; +} diff --git a/deps/glslang/Test/hlsl.forLoop.frag b/deps/glslang/Test/hlsl.forLoop.frag new file mode 100644 index 00000000..9cf60ee4 --- /dev/null +++ b/deps/glslang/Test/hlsl.forLoop.frag @@ -0,0 +1,17 @@ +float4 PixelShaderFunction(float4 input) : COLOR0 +{ + for (;;) ; + for (++input; ; ) ; + [unroll] for (; any(input != input); ) {} + for (; any(input != input); ) { return -input; } + for (--input; any(input != input); input += 2) { return -input; } + for (;;) if (input.x > 2.0) break; + for (;;) if (input.x > 2.0) continue; + float ii; + for (int ii = -1; ii < 3; ++ii) if (ii == 2) continue; + --ii; + for (int first = 0, second = 1; ;) first + second; + for ( int i = 0, count = int(ii); i < count; i++ ); + for (float first = 0, second[2], third; first < second[0]; ++second[1]) first + second[1] + third; + for (--ii, --ii, --ii;;) ii; +} diff --git a/deps/glslang/Test/hlsl.frag b/deps/glslang/Test/hlsl.frag new file mode 100644 index 00000000..1620ed58 --- /dev/null +++ b/deps/glslang/Test/hlsl.frag @@ -0,0 +1,12 @@ +float4 AmbientColor = float4(1, 0.5, 0, 1); +float AmbientIntensity = 0.1; + +float4 PixelShaderFunction(float4 input) : COLOR0 +{ + return input * AmbientIntensity + AmbientColor; + return input * input + input * input; + return input + input * input + input; + return ++input * -+-+--input; + return input++ + ++input; + return sin(input); +} diff --git a/deps/glslang/Test/hlsl.fraggeom.frag b/deps/glslang/Test/hlsl.fraggeom.frag new file mode 100644 index 00000000..5592e857 --- /dev/null +++ b/deps/glslang/Test/hlsl.fraggeom.frag @@ -0,0 +1,17 @@ +// test geometry shader in fragment shader. GS attributes should be successfully ignored. + +struct myVertex { + float4 pos : SV_Position; +}; + +[maxvertexcount(1)] +void GS_Draw(point myVertex IN, inout PointStream OutputStream) +{ + OutputStream.Append(IN); + OutputStream.RestartStrip(); +} + +float4 main() : SV_TARGET +{ + return 0; +} diff --git a/deps/glslang/Test/hlsl.function.frag b/deps/glslang/Test/hlsl.function.frag new file mode 100644 index 00000000..5834b319 --- /dev/null +++ b/deps/glslang/Test/hlsl.function.frag @@ -0,0 +1,25 @@ +float4 fun0() +{ + return 1.0f; +} + +uint fun2(float4 col) +{ + return 7; +} + +float4 fun4(uint id1, uniform uint id2) +{ + return id1 * id2; +} + +float4 fun1(int index) +{ + uint entityId = fun2(fun0()); + return fun4(entityId, entityId); +} + +int main() : SV_TARGET +{ + return fun1; +} \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.gather.array.dx10.frag b/deps/glslang/Test/hlsl.gather.array.dx10.frag new file mode 100644 index 00000000..788c333b --- /dev/null +++ b/deps/glslang/Test/hlsl.gather.array.dx10.frag @@ -0,0 +1,43 @@ +SamplerState g_sSamp : register(s0); + +Texture1DArray g_tTex1df4a : register(t1); + +uniform Texture1DArray g_tTex1df4 : register(t0); +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // No 1D gathers + + float4 txval20 = g_tTex2df4a . Gather(g_sSamp, float3(0.1, 0.2, 0.3)); + int4 txval21 = g_tTex2di4a . Gather(g_sSamp, float3(0.3, 0.4, 0.5)); + uint4 txval22 = g_tTex2du4a . Gather(g_sSamp, float3(0.5, 0.6, 0.7)); + + // no 3D gathers + + float4 txval40 = g_tTexcdf4a . Gather(g_sSamp, float4(0.1, 0.2, 0.3, 0.4)); + int4 txval41 = g_tTexcdi4a . Gather(g_sSamp, float4(0.4, 0.5, 0.6, 0.7)); + uint4 txval42 = g_tTexcdu4a . Gather(g_sSamp, float4(0.7, 0.8, 0.9, 1.0)); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.gather.basic.dx10.frag b/deps/glslang/Test/hlsl.gather.basic.dx10.frag new file mode 100644 index 00000000..be0cd31f --- /dev/null +++ b/deps/glslang/Test/hlsl.gather.basic.dx10.frag @@ -0,0 +1,48 @@ +SamplerState g_sSamp : register(s0); +uniform sampler2D g_sSamp2d; + +Texture1D g_tTex1df4a : register(t1); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // no 1D gathers + + float4 txval20 = g_tTex2df4 . Gather(g_sSamp, float2(0.1, 0.2)); + int4 txval21 = g_tTex2di4 . Gather(g_sSamp, float2(0.3, 0.4)); + uint4 txval22 = g_tTex2du4 . Gather(g_sSamp, float2(0.5, 0.6)); + + // no 3D gathers + + float4 txval40 = g_tTexcdf4 . Gather(g_sSamp, float3(0.1, 0.2, 0.3)); + int4 txval41 = g_tTexcdi4 . Gather(g_sSamp, float3(0.4, 0.5, 0.6)); + uint4 txval42 = g_tTexcdu4 . Gather(g_sSamp, float3(0.7, 0.8, 0.9)); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.gather.basic.dx10.vert b/deps/glslang/Test/hlsl.gather.basic.dx10.vert new file mode 100644 index 00000000..4996f18c --- /dev/null +++ b/deps/glslang/Test/hlsl.gather.basic.dx10.vert @@ -0,0 +1,46 @@ +SamplerState g_sSamp : register(s0); +uniform sampler2D g_sSamp2d; + +Texture1D g_tTex1df4a : register(t1); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +struct VS_OUTPUT +{ + float4 Pos : SV_Position; +}; + +VS_OUTPUT main() +{ + VS_OUTPUT vsout; + + // no 1D gathers + + float4 txval20 = g_tTex2df4 . Gather(g_sSamp, float2(0.1, 0.2)); + int4 txval21 = g_tTex2di4 . Gather(g_sSamp, float2(0.3, 0.4)); + uint4 txval22 = g_tTex2du4 . Gather(g_sSamp, float2(0.5, 0.6)); + + // no 3D gathers + + float4 txval40 = g_tTexcdf4 . Gather(g_sSamp, float3(0.1, 0.2, 0.3)); + int4 txval41 = g_tTexcdi4 . Gather(g_sSamp, float3(0.4, 0.5, 0.6)); + uint4 txval42 = g_tTexcdu4 . Gather(g_sSamp, float3(0.7, 0.8, 0.9)); + + vsout.Pos = float4(0,0,0,0); + + return vsout; +} diff --git a/deps/glslang/Test/hlsl.gather.offset.dx10.frag b/deps/glslang/Test/hlsl.gather.offset.dx10.frag new file mode 100644 index 00000000..4d095c0e --- /dev/null +++ b/deps/glslang/Test/hlsl.gather.offset.dx10.frag @@ -0,0 +1,44 @@ +SamplerState g_sSamp : register(s0); + +Texture1D g_tTex1df4a : register(t1); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // no 1D Gathers + + float4 txval20 = g_tTex2df4 . Gather(g_sSamp, float2(0.1, 0.2), int2(1,0)); + int4 txval21 = g_tTex2di4 . Gather(g_sSamp, float2(0.3, 0.4), int2(1,1)); + uint4 txval22 = g_tTex2du4 . Gather(g_sSamp, float2(0.5, 0.6), int2(1,-1)); + + // no 3D gathers + // No Cube offset gathers + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.gather.offsetarray.dx10.frag b/deps/glslang/Test/hlsl.gather.offsetarray.dx10.frag new file mode 100644 index 00000000..5cc92525 --- /dev/null +++ b/deps/glslang/Test/hlsl.gather.offsetarray.dx10.frag @@ -0,0 +1,36 @@ +SamplerState g_sSamp : register(s0); + +Texture1DArray g_tTex1df4a : register(t1); + +uniform Texture1DArray g_tTex1df4 : register(t0); +Texture1DArray g_tTex1di4; +Texture1DArray g_tTex1du4; + +Texture2DArray g_tTex2df4; +Texture2DArray g_tTex2di4; +Texture2DArray g_tTex2du4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // No 1D gathers + + float4 txval20 = g_tTex2df4 . Gather(g_sSamp, float3(0.1, 0.2, 0.3), int2(1,0)); + int4 txval21 = g_tTex2di4 . Gather(g_sSamp, float3(0.3, 0.4, 0.4), int2(1,1)); + uint4 txval22 = g_tTex2du4 . Gather(g_sSamp, float3(0.5, 0.6, 0.7), int2(1,-1)); + + // No 3D gathers + // No Cube offset gathers + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.gatherRGBA.array.dx10.frag b/deps/glslang/Test/hlsl.gatherRGBA.array.dx10.frag new file mode 100644 index 00000000..279b6d60 --- /dev/null +++ b/deps/glslang/Test/hlsl.gatherRGBA.array.dx10.frag @@ -0,0 +1,71 @@ +SamplerState g_sSamp : register(s0); +uniform sampler2D g_sSamp2d; + +uniform Texture1DArray g_tTex1df4a : register(t0); +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +uniform float c1; +uniform float2 c2; +uniform float3 c3; +uniform float4 c4; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // no 1D gathers + + float4 txval00 = g_tTex2df4a . GatherRed(g_sSamp, c3); + int4 txval01 = g_tTex2di4a . GatherRed(g_sSamp, c3); + uint4 txval02 = g_tTex2du4a . GatherRed(g_sSamp, c3); + + float4 txval10 = g_tTex2df4a . GatherGreen(g_sSamp, c3); + int4 txval11 = g_tTex2di4a . GatherGreen(g_sSamp, c3); + uint4 txval12 = g_tTex2du4a . GatherGreen(g_sSamp, c3); + + float4 txval20 = g_tTex2df4a . GatherBlue(g_sSamp, c3); + int4 txval21 = g_tTex2di4a . GatherBlue(g_sSamp, c3); + uint4 txval22 = g_tTex2du4a . GatherBlue(g_sSamp, c3); + + float4 txval30 = g_tTex2df4a . GatherAlpha(g_sSamp, c3); + int4 txval31 = g_tTex2di4a . GatherAlpha(g_sSamp, c3); + uint4 txval32 = g_tTex2du4a . GatherAlpha(g_sSamp, c3); + + // no 3D gathers + + float4 txval40 = g_tTexcdf4a . GatherRed(g_sSamp, c4); + int4 txval41 = g_tTexcdi4a . GatherRed(g_sSamp, c4); + uint4 txval42 = g_tTexcdu4a . GatherRed(g_sSamp, c4); + + float4 txval50 = g_tTexcdf4a . GatherGreen(g_sSamp, c4); + int4 txval51 = g_tTexcdi4a . GatherGreen(g_sSamp, c4); + uint4 txval52 = g_tTexcdu4a . GatherGreen(g_sSamp, c4); + + float4 txval60 = g_tTexcdf4a . GatherBlue(g_sSamp, c4); + int4 txval61 = g_tTexcdi4a . GatherBlue(g_sSamp, c4); + uint4 txval62 = g_tTexcdu4a . GatherBlue(g_sSamp, c4); + + float4 txval70 = g_tTexcdf4a . GatherAlpha(g_sSamp, c4); + int4 txval71 = g_tTexcdi4a . GatherAlpha(g_sSamp, c4); + uint4 txval72 = g_tTexcdu4a . GatherAlpha(g_sSamp, c4); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.gatherRGBA.basic.dx10.frag b/deps/glslang/Test/hlsl.gatherRGBA.basic.dx10.frag new file mode 100644 index 00000000..17fae193 --- /dev/null +++ b/deps/glslang/Test/hlsl.gatherRGBA.basic.dx10.frag @@ -0,0 +1,77 @@ +SamplerState g_sSamp : register(s0); +uniform sampler2D g_sSamp2d; + +Texture1D g_tTex1df4a : register(t1); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +uniform float c1; +uniform float2 c2; +uniform float3 c3; +uniform float4 c4; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // no 1D gathers + + float4 txval00 = g_tTex2df4 . GatherRed(g_sSamp, c2); + int4 txval01 = g_tTex2di4 . GatherRed(g_sSamp, c2); + uint4 txval02 = g_tTex2du4 . GatherRed(g_sSamp, c2); + + float4 txval10 = g_tTex2df4 . GatherGreen(g_sSamp, c2); + int4 txval11 = g_tTex2di4 . GatherGreen(g_sSamp, c2); + uint4 txval12 = g_tTex2du4 . GatherGreen(g_sSamp, c2); + + float4 txval20 = g_tTex2df4 . GatherBlue(g_sSamp, c2); + int4 txval21 = g_tTex2di4 . GatherBlue(g_sSamp, c2); + uint4 txval22 = g_tTex2du4 . GatherBlue(g_sSamp, c2); + + float4 txval30 = g_tTex2df4 . GatherAlpha(g_sSamp, c2); + int4 txval31 = g_tTex2di4 . GatherAlpha(g_sSamp, c2); + uint4 txval32 = g_tTex2du4 . GatherAlpha(g_sSamp, c2); + + // no 3D gathers + + float4 txval40 = g_tTexcdf4 . GatherRed(g_sSamp, c3); + int4 txval41 = g_tTexcdi4 . GatherRed(g_sSamp, c3); + uint4 txval42 = g_tTexcdu4 . GatherRed(g_sSamp, c3); + + float4 txval50 = g_tTexcdf4 . GatherGreen(g_sSamp, c3); + int4 txval51 = g_tTexcdi4 . GatherGreen(g_sSamp, c3); + uint4 txval52 = g_tTexcdu4 . GatherGreen(g_sSamp, c3); + + float4 txval60 = g_tTexcdf4 . GatherBlue(g_sSamp, c3); + int4 txval61 = g_tTexcdi4 . GatherBlue(g_sSamp, c3); + uint4 txval62 = g_tTexcdu4 . GatherBlue(g_sSamp, c3); + + float4 txval70 = g_tTexcdf4 . GatherAlpha(g_sSamp, c3); + int4 txval71 = g_tTexcdi4 . GatherAlpha(g_sSamp, c3); + uint4 txval72 = g_tTexcdu4 . GatherAlpha(g_sSamp, c3); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.gatherRGBA.offset.dx10.frag b/deps/glslang/Test/hlsl.gatherRGBA.offset.dx10.frag new file mode 100644 index 00000000..a8909b4a --- /dev/null +++ b/deps/glslang/Test/hlsl.gatherRGBA.offset.dx10.frag @@ -0,0 +1,116 @@ +SamplerState g_sSamp : register(s0); +uniform sampler2D g_sSamp2d; + +Texture1D g_tTex1df4a : register(t1); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +uniform float c1; +uniform float2 c2; +uniform float3 c3; +uniform float4 c4; + +uniform int o1; +uniform int2 o2; +uniform int3 o3; +uniform int4 o4; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + uint status; + + // no 1D gathers + + float4 txval001 = g_tTex2df4 . GatherRed(g_sSamp, c2, o2); + int4 txval011 = g_tTex2di4 . GatherRed(g_sSamp, c2, o2); + uint4 txval021 = g_tTex2du4 . GatherRed(g_sSamp, c2, o2); + + float4 txval004 = g_tTex2df4 . GatherRed(g_sSamp, c2, o2, o2, o2, o2); + int4 txval014 = g_tTex2di4 . GatherRed(g_sSamp, c2, o2, o2, o2, o2); + uint4 txval024 = g_tTex2du4 . GatherRed(g_sSamp, c2, o2, o2, o2, o2); + + // float4 txval00s = g_tTex2df4 . GatherRed(g_sSamp, c2, o2, status); + // int4 txval01s = g_tTex2di4 . GatherRed(g_sSamp, c2, o2, status); + // uint4 txval02s = g_tTex2du4 . GatherRed(g_sSamp, c2, o2, status); + + // float4 txval004s = g_tTex2df4 . GatherRed(g_sSamp, c2, o2, o2, o2, o2, status); + // int4 txval014s = g_tTex2di4 . GatherRed(g_sSamp, c2, o2, o2, o2, o2, status); + // uint4 txval024s = g_tTex2du4 . GatherRed(g_sSamp, c2, o2, o2, o2, o2, status); + + float4 txval101 = g_tTex2df4 . GatherGreen(g_sSamp, c2, o2); + int4 txval111 = g_tTex2di4 . GatherGreen(g_sSamp, c2, o2); + uint4 txval121 = g_tTex2du4 . GatherGreen(g_sSamp, c2, o2); + + float4 txval104 = g_tTex2df4 . GatherGreen(g_sSamp, c2, o2, o2, o2, o2); + int4 txval114 = g_tTex2di4 . GatherGreen(g_sSamp, c2, o2, o2, o2, o2); + uint4 txval124 = g_tTex2du4 . GatherGreen(g_sSamp, c2, o2, o2, o2, o2); + + // float4 txval10s = g_tTex2df4 . GatherGreen(g_sSamp, c2, o2, status); + // int4 txval11s = g_tTex2di4 . GatherGreen(g_sSamp, c2, o2, status); + // uint4 txval12s = g_tTex2du4 . GatherGreen(g_sSamp, c2, o2, status); + + // float4 txval104 = g_tTex2df4 . GatherGreen(g_sSamp, c2, o2, o2, o2, o2, status); + // int4 txval114 = g_tTex2di4 . GatherGreen(g_sSamp, c2, o2, o2, o2, o2, status); + // uint4 txval124 = g_tTex2du4 . GatherGreen(g_sSamp, c2, o2, o2, o2, o2, status); + + float4 txval201 = g_tTex2df4 . GatherBlue(g_sSamp, c2, o2); + int4 txval211 = g_tTex2di4 . GatherBlue(g_sSamp, c2, o2); + uint4 txval221 = g_tTex2du4 . GatherBlue(g_sSamp, c2, o2); + + float4 txval204 = g_tTex2df4 . GatherBlue(g_sSamp, c2, o2, o2, o2, o2); + int4 txval214 = g_tTex2di4 . GatherBlue(g_sSamp, c2, o2, o2, o2, o2); + uint4 txval224 = g_tTex2du4 . GatherBlue(g_sSamp, c2, o2, o2, o2, o2); + + // float4 txval204s = g_tTex2df4 . GatherBlue(g_sSamp, c2, o2, o2, o2, o2, status); + // int4 txval214s = g_tTex2di4 . GatherBlue(g_sSamp, c2, o2, o2, o2, o2, status); + // uint4 txval224s = g_tTex2du4 . GatherBlue(g_sSamp, c2, o2, o2, o2, o2, status); + + // float4 txval20s = g_tTex2df4 . GatherBlue(g_sSamp, c2, o2, status); + // int4 txval21s = g_tTex2di4 . GatherBlue(g_sSamp, c2, o2, status); + // uint4 txval22s = g_tTex2du4 . GatherBlue(g_sSamp, c2, o2, status); + + float4 txval301 = g_tTex2df4 . GatherAlpha(g_sSamp, c2, o2); + int4 txval311 = g_tTex2di4 . GatherAlpha(g_sSamp, c2, o2); + uint4 txval321 = g_tTex2du4 . GatherAlpha(g_sSamp, c2, o2); + + float4 txval304 = g_tTex2df4 . GatherAlpha(g_sSamp, c2, o2, o2, o2, o2); + int4 txval314 = g_tTex2di4 . GatherAlpha(g_sSamp, c2, o2, o2, o2, o2); + uint4 txval324 = g_tTex2du4 . GatherAlpha(g_sSamp, c2, o2, o2, o2, o2); + + // float4 txval304s = g_tTex2df4 . GatherAlpha(g_sSamp, c2, o2, o2, o2, o2, status); + // int4 txval314s = g_tTex2di4 . GatherAlpha(g_sSamp, c2, o2, o2, o2, o2, status); + // uint4 txval324s = g_tTex2du4 . GatherAlpha(g_sSamp, c2, o2, o2, o2, o2, status); + + // float4 txval30s = g_tTex2df4 . GatherAlpha(g_sSamp, c2, o2, status); + // int4 txval31s = g_tTex2di4 . GatherAlpha(g_sSamp, c2, o2, status); + // uint4 txval32s = g_tTex2du4 . GatherAlpha(g_sSamp, c2, o2, status); + + // no 3D gathers with offset + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.gatherRGBA.offsetarray.dx10.frag b/deps/glslang/Test/hlsl.gatherRGBA.offsetarray.dx10.frag new file mode 100644 index 00000000..ca32f56b --- /dev/null +++ b/deps/glslang/Test/hlsl.gatherRGBA.offsetarray.dx10.frag @@ -0,0 +1,110 @@ +SamplerState g_sSamp : register(s0); +uniform sampler2D g_sSamp2d; + +uniform Texture1DArray g_tTex1df4a : register(t0); +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +uniform float c1; +uniform float2 c2; +uniform float3 c3; +uniform float4 c4; + +uniform int o1; +uniform int2 o2; +uniform int3 o3; +uniform int4 o4; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + uint status; + + // no 1D gathers + + float4 txval001 = g_tTex2df4a . GatherRed(g_sSamp, c3, o2); + int4 txval011 = g_tTex2di4a . GatherRed(g_sSamp, c3, o2); + uint4 txval021 = g_tTex2du4a . GatherRed(g_sSamp, c3, o2); + + float4 txval004 = g_tTex2df4a . GatherRed(g_sSamp, c3, o2, o2, o2, o2); + int4 txval014 = g_tTex2di4a . GatherRed(g_sSamp, c3, o2, o2, o2, o2); + uint4 txval024 = g_tTex2du4a . GatherRed(g_sSamp, c3, o2, o2, o2, o2); + + // float4 txval00s = g_tTex2df4a . GatherRed(g_sSamp, c3, o2, status); + // int4 txval01s = g_tTex2di4a . GatherRed(g_sSamp, c3, o2, status); + // uint4 txval02s = g_tTex2du4a . GatherRed(g_sSamp, c3, o2, status); + + // float4 txval004s = g_tTex2df4a . GatherRed(g_sSamp, c3, o2, o2, o2, o2, status); + // int4 txval014s = g_tTex2di4a . GatherRed(g_sSamp, c3, o2, o2, o2, o2, status); + // uint4 txval024s = g_tTex2du4a . GatherRed(g_sSamp, c3, o2, o2, o2, o2, status); + + float4 txval101 = g_tTex2df4a . GatherGreen(g_sSamp, c3, o2); + int4 txval111 = g_tTex2di4a . GatherGreen(g_sSamp, c3, o2); + uint4 txval121 = g_tTex2du4a . GatherGreen(g_sSamp, c3, o2); + + float4 txval104 = g_tTex2df4a . GatherGreen(g_sSamp, c3, o2, o2, o2, o2); + int4 txval114 = g_tTex2di4a . GatherGreen(g_sSamp, c3, o2, o2, o2, o2); + uint4 txval124 = g_tTex2du4a . GatherGreen(g_sSamp, c3, o2, o2, o2, o2); + + // float4 txval10s = g_tTex2df4a . GatherGreen(g_sSamp, c3, o2, status); + // int4 txval11s = g_tTex2di4a . GatherGreen(g_sSamp, c3, o2, status); + // uint4 txval12s = g_tTex2du4a . GatherGreen(g_sSamp, c3, o2, status); + + // float4 txval104 = g_tTex2df4a . GatherGreen(g_sSamp, c3, o2, o2, o2, o2, status); + // int4 txval114 = g_tTex2di4a . GatherGreen(g_sSamp, c3, o2, o2, o2, o2, status); + // uint4 txval124 = g_tTex2du4a . GatherGreen(g_sSamp, c3, o2, o2, o2, o2, status); + + float4 txval201 = g_tTex2df4a . GatherBlue(g_sSamp, c3, o2); + int4 txval211 = g_tTex2di4a . GatherBlue(g_sSamp, c3, o2); + uint4 txval221 = g_tTex2du4a . GatherBlue(g_sSamp, c3, o2); + + float4 txval204 = g_tTex2df4a . GatherBlue(g_sSamp, c3, o2, o2, o2, o2); + int4 txval214 = g_tTex2di4a . GatherBlue(g_sSamp, c3, o2, o2, o2, o2); + uint4 txval224 = g_tTex2du4a . GatherBlue(g_sSamp, c3, o2, o2, o2, o2); + + // float4 txval204s = g_tTex2df4a . GatherBlue(g_sSamp, c3, o2, o2, o2, o2, status); + // int4 txval214s = g_tTex2di4a . GatherBlue(g_sSamp, c3, o2, o2, o2, o2, status); + // uint4 txval224s = g_tTex2du4a . GatherBlue(g_sSamp, c3, o2, o2, o2, o2, status); + + // float4 txval20s = g_tTex2df4a . GatherBlue(g_sSamp, c3, o2, status); + // int4 txval21s = g_tTex2di4a . GatherBlue(g_sSamp, c3, o2, status); + // uint4 txval22s = g_tTex2du4a . GatherBlue(g_sSamp, c3, o2, status); + + float4 txval301 = g_tTex2df4a . GatherAlpha(g_sSamp, c3, o2); + int4 txval311 = g_tTex2di4a . GatherAlpha(g_sSamp, c3, o2); + uint4 txval321 = g_tTex2du4a . GatherAlpha(g_sSamp, c3, o2); + + float4 txval304 = g_tTex2df4a . GatherAlpha(g_sSamp, c3, o2, o2, o2, o2); + int4 txval314 = g_tTex2di4a . GatherAlpha(g_sSamp, c3, o2, o2, o2, o2); + uint4 txval324 = g_tTex2du4a . GatherAlpha(g_sSamp, c3, o2, o2, o2, o2); + + // float4 txval304s = g_tTex2df4a . GatherAlpha(g_sSamp, c3, o2, o2, o2, o2, status); + // int4 txval314s = g_tTex2di4a . GatherAlpha(g_sSamp, c3, o2, o2, o2, o2, status); + // uint4 txval324s = g_tTex2du4a . GatherAlpha(g_sSamp, c3, o2, o2, o2, o2, status); + + // float4 txval30s = g_tTex2df4a . GatherAlpha(g_sSamp, c3, o2, status); + // int4 txval31s = g_tTex2di4a . GatherAlpha(g_sSamp, c3, o2, status); + // uint4 txval32s = g_tTex2du4a . GatherAlpha(g_sSamp, c3, o2, status); + + // no 3D gathers with offset + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.gathercmpRGBA.array.dx10.frag b/deps/glslang/Test/hlsl.gathercmpRGBA.array.dx10.frag new file mode 100644 index 00000000..b6310acb --- /dev/null +++ b/deps/glslang/Test/hlsl.gathercmpRGBA.array.dx10.frag @@ -0,0 +1,74 @@ +SamplerComparisonState g_sSampCmp : register(s0); + +uniform Texture1DArray g_tTex1df4a : register(t0); +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +uniform float c1; +uniform float2 c2; +uniform float3 c3; +uniform float4 c4; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // no 1D gathers + + float4 txval80 = g_tTex2df4a . GatherCmp(g_sSampCmp, c3, .75); + int4 txval81 = g_tTex2di4a . GatherCmp(g_sSampCmp, c3, .75); + uint4 txval82 = g_tTex2du4a . GatherCmp(g_sSampCmp, c3, .75); + + float4 txval00 = g_tTex2df4a . GatherCmpRed(g_sSampCmp, c3, .75); + int4 txval01 = g_tTex2di4a . GatherCmpRed(g_sSampCmp, c3, .75); + uint4 txval02 = g_tTex2du4a . GatherCmpRed(g_sSampCmp, c3, .75); + + float4 txval10 = g_tTex2df4a . GatherCmpGreen(g_sSampCmp, c3, .75); + int4 txval11 = g_tTex2di4a . GatherCmpGreen(g_sSampCmp, c3, .75); + uint4 txval12 = g_tTex2du4a . GatherCmpGreen(g_sSampCmp, c3, .75); + + float4 txval20 = g_tTex2df4a . GatherCmpBlue(g_sSampCmp, c3, .75); + int4 txval21 = g_tTex2di4a . GatherCmpBlue(g_sSampCmp, c3, .75); + uint4 txval22 = g_tTex2du4a . GatherCmpBlue(g_sSampCmp, c3, .75); + + float4 txval30 = g_tTex2df4a . GatherCmpAlpha(g_sSampCmp, c3, .75); + int4 txval31 = g_tTex2di4a . GatherCmpAlpha(g_sSampCmp, c3, .75); + uint4 txval32 = g_tTex2du4a . GatherCmpAlpha(g_sSampCmp, c3, .75); + + // no 3D gathers + + float4 txval40 = g_tTexcdf4a . GatherCmpRed(g_sSampCmp, c4, .75); + int4 txval41 = g_tTexcdi4a . GatherCmpRed(g_sSampCmp, c4, .75); + uint4 txval42 = g_tTexcdu4a . GatherCmpRed(g_sSampCmp, c4, .75); + + float4 txval50 = g_tTexcdf4a . GatherCmpGreen(g_sSampCmp, c4, .75); + int4 txval51 = g_tTexcdi4a . GatherCmpGreen(g_sSampCmp, c4, .75); + uint4 txval52 = g_tTexcdu4a . GatherCmpGreen(g_sSampCmp, c4, .75); + + float4 txval60 = g_tTexcdf4a . GatherCmpBlue(g_sSampCmp, c4, .75); + int4 txval61 = g_tTexcdi4a . GatherCmpBlue(g_sSampCmp, c4, .75); + uint4 txval62 = g_tTexcdu4a . GatherCmpBlue(g_sSampCmp, c4, .75); + + float4 txval70 = g_tTexcdf4a . GatherCmpAlpha(g_sSampCmp, c4, .75); + int4 txval71 = g_tTexcdi4a . GatherCmpAlpha(g_sSampCmp, c4, .75); + uint4 txval72 = g_tTexcdu4a . GatherCmpAlpha(g_sSampCmp, c4, .75); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.gathercmpRGBA.basic.dx10.frag b/deps/glslang/Test/hlsl.gathercmpRGBA.basic.dx10.frag new file mode 100644 index 00000000..94ef576d --- /dev/null +++ b/deps/glslang/Test/hlsl.gathercmpRGBA.basic.dx10.frag @@ -0,0 +1,84 @@ +SamplerComparisonState g_sSampCmp : register(s0); + +Texture1D g_tTex1df4a : register(t1); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +uniform float c1; +uniform float2 c2; +uniform float3 c3; +uniform float4 c4; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // no 1D gathers + + float4 txval00 = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75); + int4 txval01 = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75); + uint4 txval02 = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75); + + float4 txval10 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75); + int4 txval11 = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75); + uint4 txval12 = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75); + + float4 txval20 = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75); + int4 txval21 = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75); + uint4 txval22 = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75); + + float4 txval30 = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75); + int4 txval31 = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75); + uint4 txval32 = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75); + + float4 txval80 = g_tTex2df4 . GatherCmp(g_sSampCmp, c2, 0.75); + int4 txval81 = g_tTex2di4 . GatherCmp(g_sSampCmp, c2, 0.75); + uint4 txval82 = g_tTex2du4 . GatherCmp(g_sSampCmp, c2, 0.75); + + // no 3D gathers + + float4 txval40 = g_tTexcdf4 . GatherCmpRed(g_sSampCmp, c3, 0.75); + int4 txval41 = g_tTexcdi4 . GatherCmpRed(g_sSampCmp, c3, 0.75); + uint4 txval42 = g_tTexcdu4 . GatherCmpRed(g_sSampCmp, c3, 0.75); + + float4 txval50 = g_tTexcdf4 . GatherCmpGreen(g_sSampCmp, c3, 0.75); + int4 txval51 = g_tTexcdi4 . GatherCmpGreen(g_sSampCmp, c3, 0.75); + uint4 txval52 = g_tTexcdu4 . GatherCmpGreen(g_sSampCmp, c3, 0.75); + + float4 txval60 = g_tTexcdf4 . GatherCmpBlue(g_sSampCmp, c3, 0.75); + int4 txval61 = g_tTexcdi4 . GatherCmpBlue(g_sSampCmp, c3, 0.75); + uint4 txval62 = g_tTexcdu4 . GatherCmpBlue(g_sSampCmp, c3, 0.75); + + float4 txval70 = g_tTexcdf4 . GatherCmpAlpha(g_sSampCmp, c3, 0.75); + int4 txval71 = g_tTexcdi4 . GatherCmpAlpha(g_sSampCmp, c3, 0.75); + uint4 txval72 = g_tTexcdu4 . GatherCmpAlpha(g_sSampCmp, c3, 0.75); + + float4 txval90 = g_tTexcdf4 . GatherCmp(g_sSampCmp, c3, 0.75); + int4 txval91 = g_tTexcdi4 . GatherCmp(g_sSampCmp, c3, 0.75); + uint4 txval92 = g_tTexcdu4 . GatherCmp(g_sSampCmp, c3, 0.75); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.gathercmpRGBA.offset.dx10.frag b/deps/glslang/Test/hlsl.gathercmpRGBA.offset.dx10.frag new file mode 100644 index 00000000..7287fe48 --- /dev/null +++ b/deps/glslang/Test/hlsl.gathercmpRGBA.offset.dx10.frag @@ -0,0 +1,114 @@ +SamplerComparisonState g_sSampCmp : register(s0); + +Texture1D g_tTex1df4a : register(t1); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +uniform float c1; +uniform float2 c2; +uniform float3 c3; +uniform float4 c4; + + + + + + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + uint status; + + // no 1D gathers + + float4 txval001 = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0)); + int4 txval011 = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,-1)); + uint4 txval021 = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,1)); + + float4 txval004 = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0)); + int4 txval014 = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,-1), int2(1,-1), int2(1,-1), int2(1,-1)); + uint4 txval024 = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,1), int2(1,1), int2(1,1), int2(1,1)); + + float4 txval401 = g_tTex2df4 . GatherCmp(g_sSampCmp, c2, 0.75, int2(1,0)); + int4 txval411 = g_tTex2di4 . GatherCmp(g_sSampCmp, c2, 0.75, int2(1,-1)); + uint4 txval421 = g_tTex2du4 . GatherCmp(g_sSampCmp, c2, 0.75, int2(1,1)); + + // GatherCmpGreen not implemented pending OpImageDrefGather component input + // float4 txval101 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0)); + // int4 txval111 = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0)); + // uint4 txval121 = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0)); + + // float4 txval104 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0)); + // int4 txval114 = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0)); + // uint4 txval124 = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0)); + + // float4 txval10s = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), status); + // int4 txval11s = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), status); + // uint4 txval12s = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), status); + + // float4 txval104 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status); + // int4 txval114 = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status); + // uint4 txval124 = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status); + + // GatherCmpBlue not implemented pending OpImageDrefGather component input + // float4 txval201 = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0)); + // int4 txval211 = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0)); + // uint4 txval221 = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0)); + + // float4 txval204 = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0)); + // int4 txval214 = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0)); + // uint4 txval224 = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0)); + + // float4 txval204s = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status); + // int4 txval214s = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status); + // uint4 txval224s = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status); + + // float4 txval20s = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), status); + // int4 txval21s = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), status); + // uint4 txval22s = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), status); + + // GatherCmpAlpha not implemented pending OpImageDrefGather component input + // float4 txval301 = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0)); + // int4 txval311 = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0)); + // uint4 txval321 = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0)); + + // float4 txval304 = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0)); + // int4 txval314 = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0)); + // uint4 txval324 = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0)); + + // float4 txval304s = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status); + // int4 txval314s = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status); + // uint4 txval324s = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status); + + // float4 txval30s = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), status); + // int4 txval31s = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), status); + // uint4 txval32s = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), status); + + // no 3D gathers with offset + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.gathercmpRGBA.offsetarray.dx10.frag b/deps/glslang/Test/hlsl.gathercmpRGBA.offsetarray.dx10.frag new file mode 100644 index 00000000..7f381bb1 --- /dev/null +++ b/deps/glslang/Test/hlsl.gathercmpRGBA.offsetarray.dx10.frag @@ -0,0 +1,113 @@ +SamplerComparisonState g_sSampCmp : register(s0); + +uniform Texture1DArray g_tTex1df4a : register(t0); +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +uniform float c1; +uniform float2 c2; +uniform float3 c3; +uniform float4 c4; + +uniform int o1; +uniform int2 o2; +uniform int3 o3; +uniform int4 o4; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + uint status; + + // no 1D gathers + + float4 txval401 = g_tTex2df4a . GatherCmp(g_sSampCmp, c3, 0.75, o2); + int4 txval411 = g_tTex2di4a . GatherCmp(g_sSampCmp, c3, 0.75, o2); + uint4 txval421 = g_tTex2du4a . GatherCmp(g_sSampCmp, c3, 0.75, o2); + + float4 txval001 = g_tTex2df4a . GatherCmpRed(g_sSampCmp, c3, 0.75, o2); + int4 txval011 = g_tTex2di4a . GatherCmpRed(g_sSampCmp, c3, 0.75, o2); + uint4 txval021 = g_tTex2du4a . GatherCmpRed(g_sSampCmp, c3, 0.75, o2); + + float4 txval004 = g_tTex2df4a . GatherCmpRed(g_sSampCmp, c3, 0.75, o2, o2, o2, o2); + int4 txval014 = g_tTex2di4a . GatherCmpRed(g_sSampCmp, c3, 0.75, o2, o2, o2, o2); + uint4 txval024 = g_tTex2du4a . GatherCmpRed(g_sSampCmp, c3, 0.75, o2, o2, o2, o2); + + // float4 txval00s = g_tTex2df4a . GatherCmpRed(g_sSampCmp, c3, 0.75, o2, status); + // int4 txval01s = g_tTex2di4a . GatherCmpRed(g_sSampCmp, c3, 0.75, o2, status); + // uint4 txval02s = g_tTex2du4a . GatherCmpRed(g_sSampCmp, c3, 0.75, o2, status); + + // float4 txval004s = g_tTex2df4a . GatherCmpRed(g_sSampCmp, c3, 0.75, o2, o2, o2, o2, status); + // int4 txval014s = g_tTex2di4a . GatherCmpRed(g_sSampCmp, c3, 0.75, o2, o2, o2, o2, status); + // uint4 txval024s = g_tTex2du4a . GatherCmpRed(g_sSampCmp, c3, 0.75, o2, o2, o2, o2, status); + + float4 txval101 = g_tTex2df4a . GatherCmpGreen(g_sSampCmp, c3, 0.75, o2); + int4 txval111 = g_tTex2di4a . GatherCmpGreen(g_sSampCmp, c3, 0.75, o2); + uint4 txval121 = g_tTex2du4a . GatherCmpGreen(g_sSampCmp, c3, 0.75, o2); + + float4 txval104 = g_tTex2df4a . GatherCmpGreen(g_sSampCmp, c3, 0.75, o2, o2, o2, o2); + int4 txval114 = g_tTex2di4a . GatherCmpGreen(g_sSampCmp, c3, 0.75, o2, o2, o2, o2); + uint4 txval124 = g_tTex2du4a . GatherCmpGreen(g_sSampCmp, c3, 0.75, o2, o2, o2, o2); + + // float4 txval10s = g_tTex2df4a . GatherCmpGreen(g_sSampCmp, c3, 0.75, o2, status); + // int4 txval11s = g_tTex2di4a . GatherCmpGreen(g_sSampCmp, c3, 0.75, o2, status); + // uint4 txval12s = g_tTex2du4a . GatherCmpGreen(g_sSampCmp, c3, 0.75, o2, status); + + // float4 txval104 = g_tTex2df4a . GatherCmpGreen(g_sSampCmp, c3, 0.75, o2, o2, o2, o2, status); + // int4 txval114 = g_tTex2di4a . GatherCmpGreen(g_sSampCmp, c3, 0.75, o2, o2, o2, o2, status); + // uint4 txval124 = g_tTex2du4a . GatherCmpGreen(g_sSampCmp, c3, 0.75, o2, o2, o2, o2, status); + + float4 txval201 = g_tTex2df4a . GatherCmpBlue(g_sSampCmp, c3, 0.75, o2); + int4 txval211 = g_tTex2di4a . GatherCmpBlue(g_sSampCmp, c3, 0.75, o2); + uint4 txval221 = g_tTex2du4a . GatherCmpBlue(g_sSampCmp, c3, 0.75, o2); + + float4 txval204 = g_tTex2df4a . GatherCmpBlue(g_sSampCmp, c3, 0.75, o2, o2, o2, o2); + int4 txval214 = g_tTex2di4a . GatherCmpBlue(g_sSampCmp, c3, 0.75, o2, o2, o2, o2); + uint4 txval224 = g_tTex2du4a . GatherCmpBlue(g_sSampCmp, c3, 0.75, o2, o2, o2, o2); + + // float4 txval204s = g_tTex2df4a . GatherCmpBlue(g_sSampCmp, c3, 0.75, o2, o2, o2, o2, status); + // int4 txval214s = g_tTex2di4a . GatherCmpBlue(g_sSampCmp, c3, 0.75, o2, o2, o2, o2, status); + // uint4 txval224s = g_tTex2du4a . GatherCmpBlue(g_sSampCmp, c3, 0.75, o2, o2, o2, o2, status); + + // float4 txval20s = g_tTex2df4a . GatherCmpBlue(g_sSampCmp, c3, 0.75, o2, status); + // int4 txval21s = g_tTex2di4a . GatherCmpBlue(g_sSampCmp, c3, 0.75, o2, status); + // uint4 txval22s = g_tTex2du4a . GatherCmpBlue(g_sSampCmp, c3, 0.75, o2, status); + + float4 txval301 = g_tTex2df4a . GatherCmpAlpha(g_sSampCmp, c3, 0.75, o2); + int4 txval311 = g_tTex2di4a . GatherCmpAlpha(g_sSampCmp, c3, 0.75, o2); + uint4 txval321 = g_tTex2du4a . GatherCmpAlpha(g_sSampCmp, c3, 0.75, o2); + + float4 txval304 = g_tTex2df4a . GatherCmpAlpha(g_sSampCmp, c3, 0.75, o2, o2, o2, o2); + int4 txval314 = g_tTex2di4a . GatherCmpAlpha(g_sSampCmp, c3, 0.75, o2, o2, o2, o2); + uint4 txval324 = g_tTex2du4a . GatherCmpAlpha(g_sSampCmp, c3, 0.75, o2, o2, o2, o2); + + // float4 txval304s = g_tTex2df4a . GatherCmpAlpha(g_sSampCmp, c3, 0.75, o2, o2, o2, o2, status); + // int4 txval314s = g_tTex2di4a . GatherCmpAlpha(g_sSampCmp, c3, 0.75, o2, o2, o2, o2, status); + // uint4 txval324s = g_tTex2du4a . GatherCmpAlpha(g_sSampCmp, c3, 0.75, o2, o2, o2, o2, status); + + // float4 txval30s = g_tTex2df4a . GatherCmpAlpha(g_sSampCmp, c3, 0.75, o2, status); + // int4 txval31s = g_tTex2di4a . GatherCmpAlpha(g_sSampCmp, c3, 0.75, o2, status); + // uint4 txval32s = g_tTex2du4a . GatherCmpAlpha(g_sSampCmp, c3, 0.75, o2, status); + + // no 3D gathers with offset + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.getdimensions.dx10.frag b/deps/glslang/Test/hlsl.getdimensions.dx10.frag new file mode 100644 index 00000000..bd9cc3b9 --- /dev/null +++ b/deps/glslang/Test/hlsl.getdimensions.dx10.frag @@ -0,0 +1,280 @@ +SamplerState g_sSamp : register(s0); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +Texture1DArray g_tTex1df4a; +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +Texture2DMS g_tTex2dmsf4; +Texture2DMS g_tTex2dmsi4; +Texture2DMS g_tTex2dmsu4; + +Texture2DMSArray g_tTex2dmsf4a; +Texture2DMSArray g_tTex2dmsi4a; +Texture2DMSArray g_tTex2dmsu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + uint MipLevel; + uint WidthU; + uint HeightU; + uint ElementsU; + uint DepthU; + uint NumberOfLevelsU; + uint NumberOfSamplesU; + + float WidthF; + float HeightF; + float ElementsF; + float DepthF; + float NumberOfLevelsF; + float NumberOfSamplesF; + + // 1D, float tx, uint params + g_tTex1df4 . GetDimensions(WidthU); + g_tTex1df4 . GetDimensions(6, WidthU, NumberOfLevelsU); + + // 1D, int, uint params + g_tTex1di4 . GetDimensions(WidthU); + g_tTex1di4 . GetDimensions(6, WidthU, NumberOfLevelsU); + + // 1D, uint, uint params + g_tTex1du4 . GetDimensions(WidthU); + g_tTex1du4 . GetDimensions(6, WidthU, NumberOfLevelsU); + + // 1DArray, float tx, uint params + g_tTex1df4a . GetDimensions(WidthU, ElementsU); + g_tTex1df4a . GetDimensions(6, WidthU, ElementsU, NumberOfLevelsU); + + // 1DArray, int, uint params + g_tTex1di4a . GetDimensions(WidthU, ElementsU); + g_tTex1di4a . GetDimensions(6, WidthU, ElementsU, NumberOfLevelsU); + + // 1DArray, uint, uint params + g_tTex1du4a . GetDimensions(WidthU, ElementsU); + g_tTex1du4a . GetDimensions(6, WidthU, ElementsU, NumberOfLevelsU); + + // 2D, float tx, uint params + g_tTex2df4 . GetDimensions(WidthU, HeightU); + g_tTex2df4 . GetDimensions(6, WidthU, HeightU, NumberOfLevelsU); + + // 2D, int, uint params + g_tTex2di4 . GetDimensions(WidthU, HeightU); + g_tTex2di4 . GetDimensions(6, WidthU, HeightU, NumberOfLevelsU); + + // 2D, uint, uint params + g_tTex2du4 . GetDimensions(WidthU, HeightU); + g_tTex2du4 . GetDimensions(6, WidthU, HeightU, NumberOfLevelsU); + + // 2Darray, float tx, uint params + g_tTex2df4a . GetDimensions(WidthU, HeightU, ElementsU); + g_tTex2df4a . GetDimensions(6, WidthU, HeightU, ElementsU, NumberOfLevelsU); + + // 2Darray, int, uint params + g_tTex2di4a . GetDimensions(WidthU, HeightU, ElementsU); + g_tTex2di4a . GetDimensions(6, WidthU, HeightU, ElementsU, NumberOfLevelsU); + + // 2Darray, uint, uint params + g_tTex2du4a . GetDimensions(WidthU, HeightU, ElementsU); + g_tTex2du4a . GetDimensions(6, WidthU, HeightU, ElementsU, NumberOfLevelsU); + + // 3D, float tx, uint params + g_tTex3df4 . GetDimensions(WidthU, HeightU, DepthU); + g_tTex3df4 . GetDimensions(6, WidthU, HeightU, DepthU, NumberOfLevelsU); + + // 3D, int, uint params + g_tTex3di4 . GetDimensions(WidthU, HeightU, DepthU); + g_tTex3di4 . GetDimensions(6, WidthU, HeightU, DepthU, NumberOfLevelsU); + + // 3D, uint, uint params + g_tTex3du4 . GetDimensions(WidthU, HeightU, DepthU); + g_tTex3du4 . GetDimensions(6, WidthU, HeightU, DepthU, NumberOfLevelsU); + + // Cube, float tx, uint params + g_tTexcdf4 . GetDimensions(WidthU, HeightU); + g_tTexcdf4 . GetDimensions(6, WidthU, HeightU, NumberOfLevelsU); + + // Cube, int, uint params + g_tTexcdi4 . GetDimensions(WidthU, HeightU); + g_tTexcdi4 . GetDimensions(6, WidthU, HeightU, NumberOfLevelsU); + + // Cube, uint, uint params + g_tTexcdu4 . GetDimensions(WidthU, HeightU); + g_tTexcdu4 . GetDimensions(6, WidthU, HeightU, NumberOfLevelsU); + + // Cubearray, float tx, uint params + g_tTexcdf4a . GetDimensions(WidthU, HeightU, ElementsU); + g_tTexcdf4a . GetDimensions(6, WidthU, HeightU, ElementsU, NumberOfLevelsU); + + // Cubearray, int, uint params + g_tTexcdi4a . GetDimensions(WidthU, HeightU, ElementsU); + g_tTexcdi4a . GetDimensions(6, WidthU, HeightU, ElementsU, NumberOfLevelsU); + + // Cubearray, uint, uint params + g_tTexcdu4a . GetDimensions(WidthU, HeightU, ElementsU); + g_tTexcdu4a . GetDimensions(6, WidthU, HeightU, ElementsU, NumberOfLevelsU); + + // 2DMS, float tx, uint params + g_tTex2dmsf4 . GetDimensions(WidthU, HeightU, NumberOfSamplesU); + + // 2DMS, int tx, uint params + g_tTex2dmsi4 . GetDimensions(WidthU, HeightU, NumberOfSamplesU); + + // 2DMS, uint tx, uint params + g_tTex2dmsu4 . GetDimensions(WidthU, HeightU, NumberOfSamplesU); + + // 2DMSArray, float tx, uint params + g_tTex2dmsf4a . GetDimensions(WidthU, HeightU, ElementsU, NumberOfSamplesU); + + // 2DMSArray, int tx, uint params + g_tTex2dmsi4a . GetDimensions(WidthU, HeightU, ElementsU, NumberOfSamplesU); + + // 2DMSArray, uint tx, uint params + g_tTex2dmsu4a . GetDimensions(WidthU, HeightU, ElementsU, NumberOfSamplesU); + + // TODO: *************************************************** + // Change this to 1 to enable float overloads when the HLSL + // function overload resolution is fixed. +#define OVERLOAD_FIX 0 + + // TODO: enable when function overload resolution rules are fixed +#if OVERLOAD_FIX + // 1D, float tx, float params + g_tTex1df4 . GetDimensions(WidthF); + g_tTex1df4 . GetDimensions(6, WidthF, NumberOfLevelsF); + + // 1D, int, float params + g_tTex1di4 . GetDimensions(WidthF); + g_tTex1di4 . GetDimensions(6, WidthF, NumberOfLevelsF); + + // 1D, uint, float params + g_tTex1du4 . GetDimensions(WidthF); + g_tTex1du4 . GetDimensions(6, WidthF, NumberOfLevelsF); + + // 1DArray, float tx, float params + g_tTex1df4a . GetDimensions(WidthF, ElementsF); + g_tTex1df4a . GetDimensions(6, WidthF, ElementsF, NumberOfLevelsF); + + // 1DArray, int, float params + g_tTex1di4a . GetDimensions(WidthF, ElementsF); + g_tTex1di4a . GetDimensions(6, WidthF, ElementsF, NumberOfLevelsF); + + // 1DArray, uint, float params + g_tTex1du4a . GetDimensions(WidthF, ElementsF); + g_tTex1du4a . GetDimensions(6, WidthF, ElementsF, NumberOfLevelsF); + + // 2D, float tx, float params + g_tTex2df4 . GetDimensions(WidthF, HeightF); + g_tTex2df4 . GetDimensions(6, WidthF, HeightF, NumberOfLevelsF); + + // 2D, int, float params + g_tTex2di4 . GetDimensions(WidthF, HeightF); + g_tTex2di4 . GetDimensions(6, WidthF, HeightF, NumberOfLevelsF); + + // 2D, uint, float params + g_tTex2du4 . GetDimensions(WidthF, HeightF); + g_tTex2du4 . GetDimensions(6, WidthF, HeightF, NumberOfLevelsF); + + // 2Darray, float tx, float params + g_tTex2df4a . GetDimensions(WidthF, HeightF, ElementsF); + g_tTex2df4a . GetDimensions(6, WidthF, HeightF, ElementsF, NumberOfLevelsF); + + // 2Darray, int, float params + g_tTex2di4a . GetDimensions(WidthF, HeightF, ElementsF); + g_tTex2di4a . GetDimensions(6, WidthF, HeightF, ElementsF, NumberOfLevelsF); + + // 2Darray, uint, float params + g_tTex2du4a . GetDimensions(WidthF, HeightF, ElementsF); + g_tTex2du4a . GetDimensions(6, WidthF, HeightF, ElementsF, NumberOfLevelsF); + + // 3D, float tx, float params + g_tTex3df4 . GetDimensions(WidthF, HeightF, DepthF); + g_tTex3df4 . GetDimensions(6, WidthF, HeightF, DepthF, NumberOfLevelsF); + + // 3D, int, float params + g_tTex3di4 . GetDimensions(WidthF, HeightF, DepthF); + g_tTex3di4 . GetDimensions(6, WidthF, HeightF, DepthF, NumberOfLevelsF); + + // 3D, uint, float params + g_tTex3du4 . GetDimensions(WidthF, HeightF, DepthF); + g_tTex3du4 . GetDimensions(6, WidthF, HeightF, DepthF, NumberOfLevelsF); + + // Cube, float tx, float params + g_tTexcdf4 . GetDimensions(WidthF, HeightF); + g_tTexcdf4 . GetDimensions(6, WidthF, HeightF, NumberOfLevelsF); + + // Cube, int, float params + g_tTexcdi4 . GetDimensions(WidthF, HeightF); + g_tTexcdi4 . GetDimensions(6, WidthF, HeightF, NumberOfLevelsF); + + // Cube, uint, float params + g_tTexcdu4 . GetDimensions(WidthF, HeightF); + g_tTexcdu4 . GetDimensions(6, WidthF, HeightF, NumberOfLevelsF); + + // Cubearray, float tx, float params + g_tTexcdf4a . GetDimensions(WidthF, HeightF, ElementsF); + g_tTexcdf4a . GetDimensions(6, WidthF, HeightF, ElementsF, NumberOfLevelsF); + + // Cubearray, int, float params + g_tTexcdi4a . GetDimensions(WidthF, HeightF, ElementsF); + g_tTexcdi4a . GetDimensions(6, WidthF, HeightF, ElementsF, NumberOfLevelsF); + + // Cubearray, uint, float params + g_tTexcdu4a . GetDimensions(WidthF, HeightF, ElementsF); + g_tTexcdu4a . GetDimensions(6, WidthF, HeightF, ElementsF, NumberOfLevelsF); + + // 2DMS, float tx, uint params + g_tTex2dmsf4 . GetDimensions(WidthF, HeightF, NumberOfSamplesF); + + // 2DMS, int tx, uint params + g_tTex2dmsi4 . GetDimensions(WidthF, HeightF, NumberOfSamplesF); + + // 2DMS, uint tx, uint params + g_tTex2dmsu4 . GetDimensions(WidthF, HeightF, NumberOfSamplesF); + + // 2DMSArray, float tx, uint params + g_tTex2dmsf4a . GetDimensions(WidthF, HeightF, ElementsF, NumberOfSamplesF); + + // 2DMSArray, int tx, uint params + g_tTex2dmsi4a . GetDimensions(WidthF, HeightF, ElementsF, NumberOfSamplesF); + + // 2DMSArray, uint tx, uint params + g_tTex2dmsu4a . GetDimensions(WidthF, HeightF, ElementsF, NumberOfSamplesF); +#endif // OVERLOAD_FIX + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.getdimensions.dx10.vert b/deps/glslang/Test/hlsl.getdimensions.dx10.vert new file mode 100644 index 00000000..0249b1c2 --- /dev/null +++ b/deps/glslang/Test/hlsl.getdimensions.dx10.vert @@ -0,0 +1,27 @@ +SamplerState g_sSamp : register(s0); + +uniform Texture1D g_tTex1df4 : register(t0); + +struct VS_OUTPUT +{ + float4 Pos : SV_Position; +}; + +VS_OUTPUT main() +{ + VS_OUTPUT vsout; + + uint WidthU; + uint NumberOfLevelsU; + + // Most of the tests are in the hlsl.getdimensions.dx10.frag on the fragment side. + // This is just to establish that GetDimensions appears in the vertex stage. + + // 1D, float tx, uint params + g_tTex1df4 . GetDimensions(WidthU); + g_tTex1df4 . GetDimensions(6, WidthU, NumberOfLevelsU); + + vsout.Pos = float4(0,0,0,0); + + return vsout; +} diff --git a/deps/glslang/Test/hlsl.getdimensions.rw.dx10.frag b/deps/glslang/Test/hlsl.getdimensions.rw.dx10.frag new file mode 100644 index 00000000..957a8082 --- /dev/null +++ b/deps/glslang/Test/hlsl.getdimensions.rw.dx10.frag @@ -0,0 +1,96 @@ +SamplerState g_sSamp : register(s0); + +RWTexture1D g_tTex1df4 : register(t0); +RWTexture1D g_tTex1di4; +RWTexture1D g_tTex1du4; + +RWTexture2D g_tTex2df4; +RWTexture2D g_tTex2di4; +RWTexture2D g_tTex2du4; + +RWTexture3D g_tTex3df4; +RWTexture3D g_tTex3di4; +RWTexture3D g_tTex3du4; + +RWTexture1DArray g_tTex1df4a; +RWTexture1DArray g_tTex1di4a; +RWTexture1DArray g_tTex1du4a; + +RWTexture2DArray g_tTex2df4a; +RWTexture2DArray g_tTex2di4a; +RWTexture2DArray g_tTex2du4a; + +RWBuffer g_tBuffF; +RWBuffer g_tBuffI; +RWBuffer g_tBuffU; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +uniform int c1; +uniform int2 c2; +uniform int3 c3; +uniform int4 c4; + +uniform int o1; +uniform int2 o2; +uniform int3 o3; +uniform int4 o4; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + uint MipLevel; + uint WidthU; + uint HeightU; + uint ElementsU; + uint DepthU; + uint NumberOfLevelsU; + uint NumberOfSamplesU; + + float WidthF; + float HeightF; + float ElementsF; + float DepthF; + float NumberOfLevelsF; + float NumberOfSamplesF; + + // 1D, float/int/uint, uint params + g_tTex1df4.GetDimensions(WidthU); + g_tTex1di4.GetDimensions(WidthU); + g_tTex1du4.GetDimensions(WidthU); + + // buffer, float/int/uint, uint params + g_tBuffF.GetDimensions(WidthU); + g_tBuffI.GetDimensions(WidthU); + g_tBuffU.GetDimensions(WidthU); + + // 1DArray, float/int/uint, uint params + g_tTex1df4a.GetDimensions(WidthU, ElementsU); + g_tTex1di4a.GetDimensions(WidthU, ElementsU); + g_tTex1du4a.GetDimensions(WidthU, ElementsU); + + // 2D, float/int/uint, uint params + g_tTex2df4.GetDimensions(WidthU, HeightU); + g_tTex2di4.GetDimensions(WidthU, HeightU); + g_tTex2du4.GetDimensions(WidthU, HeightU); + + // 2DArray, float/int/uint, uint params + g_tTex2df4a.GetDimensions(WidthU, HeightU, ElementsU); + g_tTex2di4a.GetDimensions(WidthU, HeightU, ElementsU); + g_tTex2du4a.GetDimensions(WidthU, HeightU, ElementsU); + + // 3D, float/int/uint, uint params + g_tTex3df4.GetDimensions(WidthU, HeightU, DepthU); + g_tTex3di4.GetDimensions(WidthU, HeightU, DepthU); + g_tTex3du4.GetDimensions(WidthU, HeightU, DepthU); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.getsampleposition.dx10.frag b/deps/glslang/Test/hlsl.getsampleposition.dx10.frag new file mode 100644 index 00000000..a1182fb6 --- /dev/null +++ b/deps/glslang/Test/hlsl.getsampleposition.dx10.frag @@ -0,0 +1,23 @@ +SamplerState g_sSamp : register(s0); + +Texture2DMS g_tTex2dmsf4; +Texture2DMSArray g_tTex2dmsf4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main(int sample : SAMPLE) +{ + PS_OUTPUT psout; + + float2 r00 = g_tTex2dmsf4.GetSamplePosition(sample); + float2 r01 = g_tTex2dmsf4a.GetSamplePosition(sample); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.global-const-init.frag b/deps/glslang/Test/hlsl.global-const-init.frag new file mode 100644 index 00000000..d8f36c96 --- /dev/null +++ b/deps/glslang/Test/hlsl.global-const-init.frag @@ -0,0 +1,14 @@ + +cbuffer CB { + float4 foo; +}; + +static const float4 bar = foo; // test const (in the immutable sense) initializer from non-const. + +static const float2 a1[2] = { { 1, 2 }, { foo.x, 4 } }; // not entirely constant +static const float2 a2[2] = { { 5, 6 }, { 7, 8 } }; // entirely constant + +float4 main() : SV_Target0 +{ + return bar; +} diff --git a/deps/glslang/Test/hlsl.groupid.comp b/deps/glslang/Test/hlsl.groupid.comp new file mode 100644 index 00000000..e5b0de42 --- /dev/null +++ b/deps/glslang/Test/hlsl.groupid.comp @@ -0,0 +1,9 @@ +RWTexture2D < float4 > OutputTexture; + +// Test conversion between SPIR-V required uint3 group id, and sub-vec3 shader declaration. + +[ numthreads ( 8 , 8 , 1 ) ] +void main ( uint2 vGroupId : SV_GroupID ) +{ + OutputTexture[ vGroupId . xy ] = float4(1.0, 0.0, 0.0, 1.0); +} diff --git a/deps/glslang/Test/hlsl.gs-hs-mix.tesc b/deps/glslang/Test/hlsl.gs-hs-mix.tesc new file mode 100644 index 00000000..45196961 --- /dev/null +++ b/deps/glslang/Test/hlsl.gs-hs-mix.tesc @@ -0,0 +1,119 @@ +cbuffer UniformBlock0 : register(b0) +{ + float4x4 model_view_matrix; + float4x4 proj_matrix; + float4x4 model_view_proj_matrix; + float3x3 normal_matrix; + float3 color; + float3 view_dir; + float3 tess_factor; +}; + +// ============================================================================= +// Hull Shader +// ============================================================================= +struct HSInput { + float3 PositionWS : POSITION; + float3 NormalWS : NORMAL; +}; + +struct HSOutput { + float3 PositionWS : POSITION; +}; + +struct HSTrianglePatchConstant { + float EdgeTessFactor[3] : SV_TessFactor; + float InsideTessFactor : SV_InsideTessFactor; + float3 NormalWS[3] : NORMAL; +}; + +HSTrianglePatchConstant HSPatchConstant(InputPatch patch) +{ + float3 roundedEdgeTessFactor = tess_factor; + float roundedInsideTessFactor = 3; + float insideTessFactor = 1; + + HSTrianglePatchConstant result; + + // Edge and inside tessellation factors + result.EdgeTessFactor[0] = roundedEdgeTessFactor.x; + result.EdgeTessFactor[1] = roundedEdgeTessFactor.y; + result.EdgeTessFactor[2] = roundedEdgeTessFactor.z; + result.InsideTessFactor = roundedInsideTessFactor; + + // Constant data + result.NormalWS[0] = patch[0].NormalWS; + result.NormalWS[1] = patch[1].NormalWS; + result.NormalWS[2] = patch[2].NormalWS; + + return result; +} + +[domain("tri")] +[partitioning("fractional_odd")] +[outputtopology("triangle_ccw")] +[outputcontrolpoints(3)] +[patchconstantfunc("HSPatchConstant")] +HSOutput HSMain( + InputPatch patch, + uint id : SV_OutputControlPointID +) +{ + HSOutput output; + output.PositionWS = patch[id].PositionWS; + return output; +} + +// ============================================================================= +// Geometry Shader +// ============================================================================= +struct GSVertexInput { + float3 PositionWS : POSITION; + float3 NormalWS : NORMAL; +}; + +struct GSVertexOutput { + float4 PositionCS : SV_POSITION; +}; + +[maxvertexcount(6)] +void GSMain( + triangle GSVertexInput input[3], + inout LineStream output +) +{ + + float3 P0 = input[0].PositionWS.xyz; + float3 P1 = input[1].PositionWS.xyz; + float3 P2 = input[2].PositionWS.xyz; + + GSVertexOutput vertex; + // Totally hacky... + P0.z += 0.001; + P1.z += 0.001; + P2.z += 0.001; + float4 Q0 = mul(proj_matrix, float4(P0, 1.0)); + float4 Q1 = mul(proj_matrix, float4(P1, 1.0)); + float4 Q2 = mul(proj_matrix, float4(P2, 1.0)); + + // Edge 0 + vertex.PositionCS = Q0; + output.Append(vertex); + vertex.PositionCS = Q1; + output.Append(vertex); + output.RestartStrip(); + + // Edge 1 + vertex.PositionCS = Q1; + output.Append(vertex); + vertex.PositionCS = Q2; + output.Append(vertex); + output.RestartStrip(); + + // Edge 2 + vertex.PositionCS = Q2; + output.Append(vertex); + vertex.PositionCS = Q0; + output.Append(vertex); + output.RestartStrip(); +} diff --git a/deps/glslang/Test/hlsl.hlslOffset.vert b/deps/glslang/Test/hlsl.hlslOffset.vert new file mode 100644 index 00000000..aa95f6a3 --- /dev/null +++ b/deps/glslang/Test/hlsl.hlslOffset.vert @@ -0,0 +1,20 @@ +cbuffer b { + float m0; + float3 m4; + ////// + float m16; + float3 m20 : packoffset(c1.y); + ///// + float3 m36 : packoffset(c2.y); + ///// + float2 m56 : packoffset(c3.z); + ///// + float m64; + float2 m68; + float m76; + ////// + float m80; + float2 m96[1]; +}; + +void main() {} diff --git a/deps/glslang/Test/hlsl.hull.1.tesc b/deps/glslang/Test/hlsl.hull.1.tesc new file mode 100644 index 00000000..4959b453 --- /dev/null +++ b/deps/glslang/Test/hlsl.hull.1.tesc @@ -0,0 +1,39 @@ +// *** +// invocation ID coming from input to entry point +// *** + +struct VS_OUT +{ + float3 cpoint : CPOINT; +}; + +struct HS_CONSTANT_OUT +{ + float edges[2] : SV_TessFactor; +}; + +struct HS_OUT +{ + float3 cpoint : CPOINT; +}; + +[domain("isoline")] +[partitioning("integer")] +[outputtopology("line")] +[outputcontrolpoints(4)] +[patchconstantfunc("PCF")] +HS_OUT main(InputPatch ip, uint m_cpid : SV_OutputControlPointID) +{ + HS_OUT output; + output.cpoint = ip[0].cpoint; + return output; +} + +HS_CONSTANT_OUT PCF(uint pid : SV_PrimitiveId) +{ + HS_CONSTANT_OUT output; + + output.edges[0] = 2.0f; + output.edges[1] = 8.0f; + return output; +} diff --git a/deps/glslang/Test/hlsl.hull.2.tesc b/deps/glslang/Test/hlsl.hull.2.tesc new file mode 100644 index 00000000..3c0afcc5 --- /dev/null +++ b/deps/glslang/Test/hlsl.hull.2.tesc @@ -0,0 +1,39 @@ +// *** +// invocation ID coming from synthesized variable +// *** + +struct VS_OUT +{ + float3 cpoint : CPOINT; +}; + +struct HS_CONSTANT_OUT +{ + float edges[2] : SV_TessFactor; +}; + +struct HS_OUT +{ + float3 cpoint : CPOINT; +}; + +[domain("isoline")] +[partitioning("integer")] +[outputtopology("line")] +[outputcontrolpoints(4)] +[patchconstantfunc("PCF")] +HS_OUT main(InputPatch ip) +{ + HS_OUT output; + output.cpoint = ip[0].cpoint; + return output; +} + +HS_CONSTANT_OUT PCF(uint pid : SV_PrimitiveId, float4 pos : SV_Position) +{ + HS_CONSTANT_OUT output; + + output.edges[0] = 2.0f; + output.edges[1] = 8.0f; + return output; +} diff --git a/deps/glslang/Test/hlsl.hull.3.tesc b/deps/glslang/Test/hlsl.hull.3.tesc new file mode 100644 index 00000000..8509dca1 --- /dev/null +++ b/deps/glslang/Test/hlsl.hull.3.tesc @@ -0,0 +1,39 @@ +// *** +// invocation ID coming from synthesized variable +// *** + +struct VS_OUT +{ + float3 cpoint : CPOINT; +}; + +struct HS_CONSTANT_OUT +{ + float edges[2] : SV_TessFactor; +}; + +struct HS_OUT +{ + float3 cpoint : CPOINT; +}; + +[domain("tri")] +[partitioning("integer")] +[outputtopology("point")] +[outputcontrolpoints(4)] +[patchconstantfunc("PCF")] +HS_OUT main(InputPatch ip) +{ + HS_OUT output; + output.cpoint = ip[0].cpoint; + return output; +} + +HS_CONSTANT_OUT PCF(uint pid : SV_PrimitiveId, float4 pos : SV_Position) +{ + HS_CONSTANT_OUT output; + + output.edges[0] = 2.0f; + output.edges[1] = 8.0f; + return output; +} diff --git a/deps/glslang/Test/hlsl.hull.4.tesc b/deps/glslang/Test/hlsl.hull.4.tesc new file mode 100644 index 00000000..cd2b0944 --- /dev/null +++ b/deps/glslang/Test/hlsl.hull.4.tesc @@ -0,0 +1,43 @@ + +// Test mixed InputPatch structure: user and builtin members. Hull shaders involve extra +// logic in this case due to patch constant function call synthesis. + +// This example tests the main EP and the PCF EP both having an input patch. + +struct HS_Main_Output +{ + float4 m_Position : SV_POSITION ; +}; + +struct HS_Output +{ + float fTessFactor [ 3 ] : SV_TessFactor ; + float fInsideTessFactor : SV_InsideTessFactor ; +}; + +struct HS_Input +{ + float4 m_Position : SV_POSITION; + float4 m_Normal : TEXCOORD2; +}; + +HS_Output HS_ConstFunc ( InputPatch < HS_Input , 3 > I ) +{ + HS_Output O = (HS_Output)0; + + O.fInsideTessFactor = I [ 0 ].m_Position.w + I [ 0 ].m_Normal.w; + + return O; +} + +[ domain ( "tri" ) ] +[ partitioning ( "fractional_odd" ) ] +[ outputtopology ( "triangle_cw" ) ] +[ patchconstantfunc ( "HS_ConstFunc" ) ] +[ outputcontrolpoints ( 3 ) ] +HS_Main_Output main( InputPatch < HS_Input , 3 > I , uint cpid : SV_OutputControlPointID ) +{ + HS_Main_Output output = ( HS_Main_Output ) 0 ; + output.m_Position = 0; + return output ; +} diff --git a/deps/glslang/Test/hlsl.hull.5.tesc b/deps/glslang/Test/hlsl.hull.5.tesc new file mode 100644 index 00000000..c9e511eb --- /dev/null +++ b/deps/glslang/Test/hlsl.hull.5.tesc @@ -0,0 +1,43 @@ + +// Test mixed InputPatch structure: user and builtin members. Hull shaders involve extra +// logic in this case due to patch constant function call synthesis. + +// This example tests the PCF EP having an InputPatch, but the main EP does not. + +struct HS_Main_Output +{ + float4 m_Position : SV_POSITION ; +}; + +struct HS_Output +{ + float fTessFactor [ 3 ] : SV_TessFactor ; + float fInsideTessFactor : SV_InsideTessFactor ; +}; + +struct HS_Input +{ + float4 m_Position : SV_POSITION; + float4 m_Normal : TEXCOORD2; +}; + +HS_Output HS_ConstFunc ( InputPatch < HS_Input , 3 > I ) +{ + HS_Output O = (HS_Output)0; + + O.fInsideTessFactor = I [ 0 ].m_Position.w + I [ 0 ].m_Normal.w; + + return O; +} + +[ domain ( "tri" ) ] +[ partitioning ( "fractional_odd" ) ] +[ outputtopology ( "triangle_cw" ) ] +[ patchconstantfunc ( "HS_ConstFunc" ) ] +[ outputcontrolpoints ( 3 ) ] +HS_Main_Output main( uint cpid : SV_OutputControlPointID ) +{ + HS_Main_Output output = ( HS_Main_Output ) 0 ; + output.m_Position = 0; + return output ; +} diff --git a/deps/glslang/Test/hlsl.hull.ctrlpt-1.tesc b/deps/glslang/Test/hlsl.hull.ctrlpt-1.tesc new file mode 100644 index 00000000..3e329f25 --- /dev/null +++ b/deps/glslang/Test/hlsl.hull.ctrlpt-1.tesc @@ -0,0 +1,43 @@ +// *** +// per-control-point invocation of PCF from entry point return value +// *** + +struct hs_in_t +{ + float3 val : TEXCOORD0; +}; + +struct hs_pcf_t +{ + float tfactor[3] : SV_TessFactor; // must turn into a size 4 array in SPIR-V + float flInFactor : SV_InsideTessFactor; // must turn into a size 2 array in SPIR-V +}; + +struct hs_out_t +{ + float3 val : TEXCOORD0; +}; + +[ domain ("tri") ] +[ partitioning ("fractional_odd") ] +[ outputtopology ("triangle_cw") ] +[ outputcontrolpoints (3) ] +[ patchconstantfunc ( "PCF" ) ] +hs_out_t main (InputPatch i , uint cpid : SV_OutputControlPointID) +{ + hs_out_t o; + o.val = cpid; + return o; +} + +hs_pcf_t PCF( const OutputPatch pcf_out) +{ + hs_pcf_t o; + + o.tfactor[0] = pcf_out[0].val.x; + o.tfactor[1] = pcf_out[1].val.x; + o.tfactor[2] = pcf_out[2].val.x; + o.flInFactor = 4; + + return o; +} diff --git a/deps/glslang/Test/hlsl.hull.ctrlpt-2.tesc b/deps/glslang/Test/hlsl.hull.ctrlpt-2.tesc new file mode 100644 index 00000000..1f65ce4b --- /dev/null +++ b/deps/glslang/Test/hlsl.hull.ctrlpt-2.tesc @@ -0,0 +1,47 @@ +// *** +// per-control-point invocation of PCF from entry point return value with +// both OutputPatch and InputPatch given to PCF. +// *** + +struct hs_in_t +{ + float3 val : TEXCOORD0; +}; + +struct hs_pcf_t +{ + float tfactor[3] : SV_TessFactor; // must turn into a size 4 array in SPIR-V + float flInFactor : SV_InsideTessFactor; // must turn into a size 2 array in SPIR-V +}; + +struct hs_out_t +{ + float3 val : TEXCOORD0; +}; + +[ domain ("tri") ] +[ partitioning ("fractional_odd") ] +[ outputtopology ("triangle_cw") ] +[ outputcontrolpoints (3) ] +[ patchconstantfunc ( "PCF" ) ] +hs_out_t main (InputPatch i , uint cpid : SV_OutputControlPointID) +{ + i[0].val; + + hs_out_t o; + o.val = cpid; + return o; +} + +hs_pcf_t PCF( const OutputPatch pcf_out, + const InputPatch pcf_in) +{ + hs_pcf_t o; + + o.tfactor[0] = pcf_out[0].val.x; + o.tfactor[1] = pcf_out[1].val.x; + o.tfactor[2] = pcf_out[2].val.x; + o.flInFactor = 4; + + return o; +} diff --git a/deps/glslang/Test/hlsl.hull.void.tesc b/deps/glslang/Test/hlsl.hull.void.tesc new file mode 100644 index 00000000..c96ecb43 --- /dev/null +++ b/deps/glslang/Test/hlsl.hull.void.tesc @@ -0,0 +1,34 @@ +// *** +// void patchconstantfunction input and return +// *** + +struct VS_OUT +{ + float3 cpoint : CPOINT; +}; + +struct HS_CONSTANT_OUT +{ + float edges[2] : SV_TessFactor; +}; + +struct HS_OUT +{ + float3 cpoint : CPOINT; +}; + +[domain("tri")] +[partitioning("fractional_even")] +[outputtopology("triangle_ccw")] +[outputcontrolpoints(3)] +[patchconstantfunc("PCF")] +HS_OUT main(InputPatch ip) +{ + HS_OUT output; + output.cpoint = ip[0].cpoint; + return output; +} + +void PCF() +{ +} diff --git a/deps/glslang/Test/hlsl.identifier.sample.frag b/deps/glslang/Test/hlsl.identifier.sample.frag new file mode 100644 index 00000000..d3f82427 --- /dev/null +++ b/deps/glslang/Test/hlsl.identifier.sample.frag @@ -0,0 +1,18 @@ + +struct MyStruct { + sample float a; + noperspective float b; + linear float c; + centroid float d; +}; + +int sample(int x) { return x; } // HLSL allows this as an identifier as well. + +float4 main() : SV_Target0 +{ + // HLSL allows this as an identifier as well. + // However, this is not true of other qualifier keywords such as "linear". + float4 sample = float4(3,4,5,6); + + return sample.rgba; // 'sample' can participate in an expression. +} diff --git a/deps/glslang/Test/hlsl.if.frag b/deps/glslang/Test/hlsl.if.frag new file mode 100644 index 00000000..b62eda15 --- /dev/null +++ b/deps/glslang/Test/hlsl.if.frag @@ -0,0 +1,35 @@ +float4 PixelShaderFunction(float4 input) : COLOR0 +{ + if (all(input == input)) + return input; + + if (all(input == input)) + return input; + else + return -input; + + if (all(input == input)) + ; + + if (all(input == input)) + ; + else + ; + + [flatten] if (all(input == input)) { + return input; + } + + if (all(input == input)) { + return input; + } else { + return -input; + } + + int ii; + if (float ii = input.z) + ++ii; + ++ii; + if (float(ii) == 1.0) + ++ii; +} diff --git a/deps/glslang/Test/hlsl.imagefetch-subvec4.comp b/deps/glslang/Test/hlsl.imagefetch-subvec4.comp new file mode 100644 index 00000000..2a83dd27 --- /dev/null +++ b/deps/glslang/Test/hlsl.imagefetch-subvec4.comp @@ -0,0 +1,8 @@ +Texture3D IN: register(t0); +RWTexture3D OUT: register(u1); + +[numthreads(8,8,8)] +void main(uint3 tid: SV_DispatchThreadID) +{ + OUT[tid] = IN[tid]; +} diff --git a/deps/glslang/Test/hlsl.implicitBool.frag b/deps/glslang/Test/hlsl.implicitBool.frag new file mode 100644 index 00000000..c6aea9d1 --- /dev/null +++ b/deps/glslang/Test/hlsl.implicitBool.frag @@ -0,0 +1,32 @@ +float condf; +int condi; +float1 condf1; +int1 condi1; + +float4 main() : SV_Target0 +{ + float4 a = float4(2.0, 2.0, 2.0, 2.0); + if (condi) + return a + 1.0; + if (condf) + return a + 2.0; + if (condf1) + return a + 3.0; + if (condi1) + return a + 4.0; + if (condi && condf || condf1) + return a + 5.0; + + float f = condf; + while (f) { --f; } + + int i = condi; + do { --i; } while (i); + + for (; i; ) { --i; } + + float g = condf ? 7.0 : 8.0; + a += g; + + return a - 1.0; +} \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.include.vert b/deps/glslang/Test/hlsl.include.vert new file mode 100644 index 00000000..683398e5 --- /dev/null +++ b/deps/glslang/Test/hlsl.include.vert @@ -0,0 +1,8 @@ +#include "bar.h" +#include "./inc1/bar.h" +#include "inc2\bar.h" + +float4 main() : SV_Position +{ + return i1 + i2 + i3 + i4 + i5 + i6; +} diff --git a/deps/glslang/Test/hlsl.includeNegative.vert b/deps/glslang/Test/hlsl.includeNegative.vert new file mode 100644 index 00000000..64d31fab --- /dev/null +++ b/deps/glslang/Test/hlsl.includeNegative.vert @@ -0,0 +1,8 @@ +#include "foo.h" +#include "inc2/../foo.h" +#include "inc1/badInc.h" + +float4 main() : SV_Position +{ +#error in main +} diff --git a/deps/glslang/Test/hlsl.inf.vert b/deps/glslang/Test/hlsl.inf.vert new file mode 100644 index 00000000..d57b8379 --- /dev/null +++ b/deps/glslang/Test/hlsl.inf.vert @@ -0,0 +1,11 @@ +float4 main() : SV_Position +{ + float f1 = -1.#INF; + float f2 = 1.#INF; + float f3 = +1.#INF; + float f4 = f2 * 1.#INF + 1.#INF; + const float f5 = -1.#INF; + const float f6 = f5 * 0.0f; + + return (float4)(f1 + f2 + f3 + f4 + f5 + f6); +} \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.init.frag b/deps/glslang/Test/hlsl.init.frag new file mode 100644 index 00000000..8caf3c7d --- /dev/null +++ b/deps/glslang/Test/hlsl.init.frag @@ -0,0 +1,41 @@ +static float4 a1 = float4(1, 0.5, 0, 1), b1 = float4(2.0, 2.5, 2.1, 2.2); +static float4 a1i = {1, 0.5, 0, 1}, b1i = {2.0, 2.5, 2.1, 2.2}; +static float a2 = 0.2, b2; +static float a3, b3 = 0.3; +static float a4, b4 = 0.4, c4; +static float a5 = 0.5, b5, c5 = 1.5; + +struct Single1 { int f; }; +static Single1 single1 = { 10 }; + +struct Single2 { uint2 v; }; +static Single2 single2 = { { 1, 2 } }; + +struct Single3 { Single1 s1; }; +static Single3 single3 = { { 3 } }; + +struct Single4 { Single2 s1; }; +static Single4 single4 = { { { 4u, 5u } } }; + +float4 ShaderFunction(float4 input) : COLOR0 +{ + float4 a2 = float4(0.2, 0.3, 0.4, 0.5); + struct S1 { + float f; + int i; + }; + struct S2 { + int j; + float g; + S1 s1; + }; + S2 s2i = { 9, a5, { (a3,a4), 12} }, s2 = S2(9, a5, S1((a3,a4), 12)); + float a8 = (a2, b2), a9 = a5; + + return input * a1; +} + +cbuffer Constants +{ + float a = 1.0f, b, c = 2.0f; +}; diff --git a/deps/glslang/Test/hlsl.init2.frag b/deps/glslang/Test/hlsl.init2.frag new file mode 100644 index 00000000..2b9b7e68 --- /dev/null +++ b/deps/glslang/Test/hlsl.init2.frag @@ -0,0 +1,51 @@ + +void Test1() +{ + struct mystruct { float2 a; }; + mystruct test1 = { + { 1, 2, }, // test trailing commas in list + }; + + mystruct test2 = { + float2(3, 4), + }; + + // mystruct test3 = { + // { { 5, 6, } }, // TODO: test unneeded levels + // }; + + float test4 = { 7, } ; // test scalar initialization + + struct mystruct2 { float a; float b; float c; }; + mystruct2 test5 = { {8,}, {9,}, {10}, }; + const mystruct2 constTest5 = { {8,}, {9,}, {10}, }; + constTest5.c; + + const float step = 1.f; + float n = 0; + const float3 a[8] = { + normalize(float3(1, 1, 1)) * (n += step), + normalize(float3(-1, -1, -1)) * (n += step), + normalize(float3(-1, -1, 1)) * (n += step), + normalize(float3(-1, 1, -1)) * (n += step), + normalize(float3(-1, 1, 1)) * (n += step), + normalize(float3(1, -1, -1)) * (n += step), + normalize(float3(1, -1, 1)) * (n += step), + normalize(float3(1, 1, -1)) * (n += step) }; + + const struct one { float3 a; } oneNonConst = { normalize(float3(-1, 1, 1)) * (n += step) }; + const struct two { float3 a; + float3 b; } twoNonConst = { normalize(float3(-1, 1, 1)) * (n += step), + normalize(float3(-1, 1, 1)) * (n += step) }; +} + +struct PS_OUTPUT { float4 color : SV_Target0; }; + +PS_OUTPUT main() +{ + Test1(); + + PS_OUTPUT ps_output; + ps_output.color = 1.0; + return ps_output; +} diff --git a/deps/glslang/Test/hlsl.inoutquals.frag b/deps/glslang/Test/hlsl.inoutquals.frag new file mode 100644 index 00000000..6a124f8d --- /dev/null +++ b/deps/glslang/Test/hlsl.inoutquals.frag @@ -0,0 +1,26 @@ +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +inline void MyFunc(in float x, out float y, inout float z, in out float w) +{ + y = x; + z = y; + x = -1; // no effect since x = in param + w *= 1; +} + +PS_OUTPUT main(noperspective in float4 inpos : SV_Position, out int sampleMask : SV_Coverage) +{ + PS_OUTPUT psout; + + float x = 7, y, z = 3; + MyFunc(x, y, z, inpos.w); + + psout.Color = float4(x, y, z, 1); + psout.Depth = inpos.w; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.intrinsic.frexp.frag b/deps/glslang/Test/hlsl.intrinsic.frexp.frag new file mode 100644 index 00000000..fde87c9d --- /dev/null +++ b/deps/glslang/Test/hlsl.intrinsic.frexp.frag @@ -0,0 +1,37 @@ + +float PixelShaderFunctionS(float inF0, float inF1) +{ + float r000 = frexp(inF0, inF1); + return 0.0; +} + +float2 PixelShaderFunction2(float2 inF0, float2 inF1) +{ + float2 r000 = frexp(inF0, inF1); + return float2(1,2); +} + +float3 PixelShaderFunction3(float3 inF0, float3 inF1) +{ + float3 r000 = frexp(inF0, inF1); + return float3(1,2,3); +} + +float4 PixelShaderFunction(float4 inF0, float4 inF1) +{ + float4 r000 = frexp(inF0, inF1); + return float4(1,2,3,4); +} + +// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. +#define MATFNS(MT) \ + MT r000 = frexp(inF0, inF1); + +struct PS_OUTPUT { float4 color : SV_Target0; }; + +PS_OUTPUT main() +{ + PS_OUTPUT ps_output; + ps_output.color = 1.0; + return ps_output; +}; diff --git a/deps/glslang/Test/hlsl.intrinsic.frexp.vert b/deps/glslang/Test/hlsl.intrinsic.frexp.vert new file mode 100644 index 00000000..f0fd5e00 --- /dev/null +++ b/deps/glslang/Test/hlsl.intrinsic.frexp.vert @@ -0,0 +1,28 @@ +float VertexShaderFunctionS(float inF0, float inF1) +{ + frexp(inF0, inF1); + return 0.0; +} + +float2 VertexShaderFunction2(float2 inF0, float2 inF1) +{ + frexp(inF0, inF1); + return float2(1,2); +} + +float3 VertexShaderFunction3(float3 inF0, float3 inF1) +{ + frexp(inF0, inF1); + return float3(1,2,3); +} + +float4 VertexShaderFunction4(float4 inF0, float4 inF1) +{ + frexp(inF0, inF1); + return float4(1,2,3,4); +} + +// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. +#define MATFNS() \ + frexp(inF0, inF1); + diff --git a/deps/glslang/Test/hlsl.intrinsics.barriers.comp b/deps/glslang/Test/hlsl.intrinsics.barriers.comp new file mode 100644 index 00000000..c9f6a8d7 --- /dev/null +++ b/deps/glslang/Test/hlsl.intrinsics.barriers.comp @@ -0,0 +1,13 @@ + +float ComputeShaderFunction() +{ + AllMemoryBarrier(); + AllMemoryBarrierWithGroupSync(); + DeviceMemoryBarrier(); + DeviceMemoryBarrierWithGroupSync(); + GroupMemoryBarrier(); + GroupMemoryBarrierWithGroupSync(); + + return 0.0; +} + diff --git a/deps/glslang/Test/hlsl.intrinsics.comp b/deps/glslang/Test/hlsl.intrinsics.comp new file mode 100644 index 00000000..bce2d27d --- /dev/null +++ b/deps/glslang/Test/hlsl.intrinsics.comp @@ -0,0 +1,129 @@ + + +groupshared uint gs_ua; +groupshared uint gs_ub; +groupshared uint gs_uc; +groupshared uint2 gs_ua2; +groupshared uint2 gs_ub2; +groupshared uint2 gs_uc2; +groupshared uint3 gs_ua3; +groupshared uint3 gs_ub3; +groupshared uint3 gs_uc3; +groupshared uint4 gs_ua4; +groupshared uint4 gs_ub4; +groupshared uint4 gs_uc4; + +float ComputeShaderFunctionS(float inF0, float inF1, float inF2, uint inU0, uint inU1) +{ + uint out_u1; + + // Don't repeat all the pixel/vertex fns - just one for sanity. + all(inF0); + + // Test atomics + InterlockedAdd(gs_ua, gs_ub); + InterlockedAdd(gs_ua, gs_ub, out_u1); + InterlockedAnd(gs_ua, gs_ub); + InterlockedAnd(gs_ua, gs_ub, out_u1); + InterlockedCompareExchange(gs_ua, gs_ub, gs_uc, out_u1); + InterlockedExchange(gs_ua, gs_ub, out_u1); + InterlockedMax(gs_ua, gs_ub); + InterlockedMax(gs_ua, gs_ub, out_u1); + InterlockedMin(gs_ua, gs_ub); + InterlockedMin(gs_ua, gs_ub, out_u1); + InterlockedOr(gs_ua, gs_ub); + InterlockedOr(gs_ua, gs_ub, out_u1); + InterlockedXor(gs_ua, gs_ub); + InterlockedXor(gs_ua, gs_ub, out_u1); + + // CheckAccessFullyMapped(3); // TODO: ... + + return 0.0; +} + +float1 ComputeShaderFunction1(float1 inF0, float1 inF1, float1 inF2) +{ + // TODO: ... add when float1 prototypes are generated + return 0.0; +} + +float2 ComputeShaderFunction2(float2 inF0, float2 inF1, float2 inF2, uint2 inU0, uint2 inU1) +{ + uint2 out_u2; + + // Don't repeat all the pixel/vertex fns - just one for sanity. + all(inF0); + + // Test atomics + InterlockedAdd(gs_ua2, gs_ub2); + InterlockedAdd(gs_ua2, gs_ub2, out_u2); + InterlockedAnd(gs_ua2, gs_ub2); + InterlockedAnd(gs_ua2, gs_ub2, out_u2); + InterlockedCompareExchange(gs_ua2, gs_ub2, gs_uc2, out_u2); + InterlockedExchange(gs_ua2, gs_ub2, out_u2); + InterlockedMax(gs_ua2, gs_ub2); + InterlockedMax(gs_ua2, gs_ub2, out_u2); + InterlockedMin(gs_ua2, gs_ub2); + InterlockedMin(gs_ua2, gs_ub2, out_u2); + InterlockedOr(gs_ua2, gs_ub2); + InterlockedOr(gs_ua2, gs_ub2, out_u2); + InterlockedXor(gs_ua2, gs_ub2); + InterlockedXor(gs_ua2, gs_ub2, out_u2); + + // TODO: ... add when float1 prototypes are generated + return float2(1,2); +} + +float3 ComputeShaderFunction3(float3 inF0, float3 inF1, float3 inF2, uint3 inU0, uint3 inU1) +{ + uint3 out_u3; + + // Don't repeat all the pixel/vertex fns - just one for sanity. + all(inF0); + + // Test atomics + InterlockedAdd(gs_ua3, gs_ub3); + InterlockedAdd(gs_ua3, gs_ub3, out_u3); + InterlockedAnd(gs_ua3, gs_ub3); + InterlockedAnd(gs_ua3, gs_ub3, out_u3); + InterlockedCompareExchange(gs_ua3, gs_ub3, gs_uc3, out_u3); + InterlockedExchange(gs_ua3, gs_ub3, out_u3); + InterlockedMax(gs_ua3, gs_ub3); + InterlockedMax(gs_ua3, gs_ub3, out_u3); + InterlockedMin(gs_ua3, gs_ub3); + InterlockedMin(gs_ua3, gs_ub3, out_u3); + InterlockedOr(gs_ua3, gs_ub3); + InterlockedOr(gs_ua3, gs_ub3, out_u3); + InterlockedXor(gs_ua3, gs_ub3); + InterlockedXor(gs_ua3, gs_ub3, out_u3); + + // TODO: ... add when float1 prototypes are generated + return float3(1,2,3); +} + +float4 ComputeShaderFunction(float4 inF0, float4 inF1, float4 inF2, uint4 inU0, uint4 inU1) +{ + uint4 out_u4; + + // Don't repeat all the pixel/vertex fns - just one for sanity. + all(inF0); + + // Test atomics + InterlockedAdd(gs_ua4, gs_ub4); + InterlockedAdd(gs_ua4, gs_ub4, out_u4); + InterlockedAnd(gs_ua4, gs_ub4); + InterlockedAnd(gs_ua4, gs_ub4, out_u4); + InterlockedCompareExchange(gs_ua4, gs_ub4, gs_uc4, out_u4); + InterlockedExchange(gs_ua4, gs_ub4, out_u4); + InterlockedMax(gs_ua4, gs_ub4); + InterlockedMax(gs_ua4, gs_ub4, out_u4); + InterlockedMin(gs_ua4, gs_ub4); + InterlockedMin(gs_ua4, gs_ub4, out_u4); + InterlockedOr(gs_ua4, gs_ub4); + InterlockedOr(gs_ua4, gs_ub4, out_u4); + InterlockedXor(gs_ua4, gs_ub4); + InterlockedXor(gs_ua4, gs_ub4, out_u4); + + // TODO: ... add when float1 prototypes are generated + return float4(1,2,3,4); +} diff --git a/deps/glslang/Test/hlsl.intrinsics.d3dcolortoubyte4.frag b/deps/glslang/Test/hlsl.intrinsics.d3dcolortoubyte4.frag new file mode 100644 index 00000000..295374fb --- /dev/null +++ b/deps/glslang/Test/hlsl.intrinsics.d3dcolortoubyte4.frag @@ -0,0 +1,7 @@ + +uniform float4 col4; + +int4 main() : SV_Target0 +{ + return D3DCOLORtoUBYTE4(col4); +} diff --git a/deps/glslang/Test/hlsl.intrinsics.double.frag b/deps/glslang/Test/hlsl.intrinsics.double.frag new file mode 100644 index 00000000..013422a8 --- /dev/null +++ b/deps/glslang/Test/hlsl.intrinsics.double.frag @@ -0,0 +1,11 @@ + +float PixelShaderFunction(double inDV1a, double inDV1b, double inDV1c, + double2 inDV2, double3 inDV3, double4 inDV4, + uint inU1a, uint inU1b) +{ + double r00 = fma(inDV1a, inDV1b, inDV1c); + double r01 = asdouble(inU1a, inU1b); + + return 0.0; +} + diff --git a/deps/glslang/Test/hlsl.intrinsics.evalfns.frag b/deps/glslang/Test/hlsl.intrinsics.evalfns.frag new file mode 100644 index 00000000..96387068 --- /dev/null +++ b/deps/glslang/Test/hlsl.intrinsics.evalfns.frag @@ -0,0 +1,10 @@ + +void main(float inF1, float2 inF2, float3 inF3, float4 inF4, int2 inI2) : COLOR +{ + EvaluateAttributeSnapped(inF1, int2(8,15)); + EvaluateAttributeSnapped(inF2, int2(0,1)); + EvaluateAttributeSnapped(inF3, int2(3,10)); + EvaluateAttributeSnapped(inF4, int2(7,8)); + + EvaluateAttributeSnapped(inF1, inI2); +} diff --git a/deps/glslang/Test/hlsl.intrinsics.f1632.frag b/deps/glslang/Test/hlsl.intrinsics.f1632.frag new file mode 100644 index 00000000..f406860e --- /dev/null +++ b/deps/glslang/Test/hlsl.intrinsics.f1632.frag @@ -0,0 +1,29 @@ +float PixelShaderFunctionS(uint inF0) +{ + return f16tof32(inF0); +} + +float1 PixelShaderFunction1(uint1 inF0) +{ + return f16tof32(inF0); +} + +float2 PixelShaderFunction2(uint2 inF0) +{ + return f16tof32(inF0); +} + +float3 PixelShaderFunction3(uint3 inF0) +{ + return f16tof32(inF0); +} + +float4 PixelShaderFunction(uint4 inF0) +{ + return f16tof32(inF0); +} + +float4 main() : SV_Target0 +{ + return 0; +} diff --git a/deps/glslang/Test/hlsl.intrinsics.f3216.frag b/deps/glslang/Test/hlsl.intrinsics.f3216.frag new file mode 100644 index 00000000..f31136d9 --- /dev/null +++ b/deps/glslang/Test/hlsl.intrinsics.f3216.frag @@ -0,0 +1,29 @@ +uint PixelShaderFunctionS(float inF0) +{ + return f32tof16(inF0); +} + +uint1 PixelShaderFunction1(float1 inF0) +{ + return f32tof16(inF0); +} + +uint2 PixelShaderFunction2(float2 inF0) +{ + return f32tof16(inF0); +} + +uint3 PixelShaderFunction3(float3 inF0) +{ + return f32tof16(inF0); +} + +uint4 PixelShaderFunction(float4 inF0) +{ + return f32tof16(inF0); +} + +float4 main() : SV_Target0 +{ + return 0; +} diff --git a/deps/glslang/Test/hlsl.intrinsics.frag b/deps/glslang/Test/hlsl.intrinsics.frag new file mode 100644 index 00000000..ffa3c254 --- /dev/null +++ b/deps/glslang/Test/hlsl.intrinsics.frag @@ -0,0 +1,493 @@ + + +groupshared uint gs_ua; +groupshared uint gs_ub; +groupshared uint gs_uc; +groupshared uint2 gs_ua2; +groupshared uint2 gs_ub2; +groupshared uint2 gs_uc2; +groupshared uint3 gs_ua3; +groupshared uint3 gs_ub3; +groupshared uint3 gs_uc3; +groupshared uint4 gs_ua4; +groupshared uint4 gs_ub4; +groupshared uint4 gs_uc4; + +float PixelShaderFunctionS(float inF0, float inF1, float inF2, uint inU0, int inU1) +{ + uint out_u1; + + bool r000 = all(inF0); + float r001 = abs(inF0); + float r002 = acos(inF0); + bool r003 = any(inF0); + float r004 = asin(inF0); + int r005 = asint(inF0); + uint r006 = asuint(inU1); + float r007 = asfloat(inU0); + // asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics + float r009 = atan(inF0); + float r010 = atan2(inF0, inF1); + float r011 = ceil(inF0); + float r012 = clamp(inF0, inF1, inF2); + clip(inF0); + clip(r005); + float r014 = cos(inF0); + float r015 = cosh(inF0); + int r016 = countbits(7); + float r017 = ddx(inF0); + float r018 = ddx_coarse(inF0); + float r019 = ddx_fine(inF0); + float r020 = ddy(inF0); + float r021 = ddy_coarse(inF0); + float r022 = ddy_fine(inF0); + float r023 = degrees(inF0); + float r024 = distance(inF0, inF1); + // EvaluateAttributeAtCentroid(inF0); + // EvaluateAttributeAtSample(inF0, 0); + // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); + float r027 = exp(inF0); + float r028 = exp2(inF0); + uint r029 = firstbithigh(7); + uint r030 = firstbitlow(7); + float r031 = floor(inF0); + // TODO: fma(inD0, inD1, inD2); + float r033 = fmod(inF0, inF1); + float r034 = frac(inF0); + float r036 = fwidth(inF0); + bool r037 = isinf(inF0); + bool r038 = isnan(inF0); + float r039 = ldexp(inF0, inF1); + float r039a = lerp(inF0, inF1, inF2); + float r040 = log(inF0); + float r041 = log10(inF0); + float r042 = log2(inF0); + float r043 = max(inF0, inF1); + float r044 = min(inF0, inF1); + float r045 = pow(inF0, inF1); + float r046 = radians(inF0); + float r047 = rcp(inF0); + uint r048 = reversebits(2); + float r049 = round(inF0); + float r050 = rsqrt(inF0); + float r051 = saturate(inF0); + float r052 = sign(inF0); + float r053 = sin(inF0); + sincos(inF0, inF1, inF2); + float r055 = sinh(inF0); + float r056 = smoothstep(inF0, inF1, inF2); + float r057 = sqrt(inF0); + float r058 = step(inF0, inF1); + float r059 = tan(inF0); + float r060 = tanh(inF0); + // TODO: sampler intrinsics, when we can declare the types. + float r061 = trunc(inF0); + + return 0.0; +} + +float1 PixelShaderFunction1(float1 inF0, float1 inF1, float1 inF2) +{ + // TODO: ... add when float1 prototypes are generated + return 0.0; +} + +float2 PixelShaderFunction2(float2 inF0, float2 inF1, float2 inF2, uint2 inU0, uint2 inU1) +{ + uint2 out_u2; + + bool r000 = all(inF0); + float2 r001 = abs(inF0); + float2 r002 = acos(inF0); + bool r003 = any(inF0); + float2 r004 = asin(inF0); + int2 r005 = asint(inF0); + uint2 r006 = asuint(inF0); + float2 r007 = asfloat(inU0); + // asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics + float2 r009 = atan(inF0); + float2 r010 = atan2(inF0, inF1); + float2 r011 = ceil(inF0); + float2 r012 = clamp(inF0, inF1, inF2); + clip(inF0); + clip(inU0); + float2 r013 = cos(inF0); + float2 r015 = cosh(inF0); + int2 r016 = countbits(int2(7,3)); + float2 r017 = ddx(inF0); + float2 r018 = ddx_coarse(inF0); + float2 r019 = ddx_fine(inF0); + float2 r020 = ddy(inF0); + float2 r021 = ddy_coarse(inF0); + float2 r022 = ddy_fine(inF0); + float2 r023 = degrees(inF0); + // EvaluateAttributeAtCentroid(inF0); + // EvaluateAttributeAtSample(inF0, 0); + // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); + float r026 = distance(inF0, inF1); + float r027 = dot(inF0, inF1); + // EvaluateAttributeAtCentroid(inF0); + // EvaluateAttributeAtSample(inF0, 0); + // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); + float2 r028 = exp(inF0); + float2 r029 = exp2(inF0); + float2 r030 = faceforward(inF0, inF1, inF2); + uint2 r031 = firstbithigh(uint2(7,8)); + uint2 r032 = firstbitlow(uint2(7,8)); + float2 r033 = floor(inF0); + // TODO: fma(inD0, inD1, inD2); + float2 r035 = fmod(inF0, inF1); + float2 r036 = frac(inF0); + float2 r038 = fwidth(inF0); + bool2 r039 = isinf(inF0); + bool2 r040 = isnan(inF0); + float2 r041 = ldexp(inF0, inF1); + float2 r039a = lerp(inF0, inF1, inF2); + float r042 = length(inF0); + float2 r043 = log(inF0); + float2 r044 = log10(inF0); + float2 r045 = log2(inF0); + float2 r046 = max(inF0, inF1); + float2 r047 = min(inF0, inF1); + float2 r048 = normalize(inF0); + float2 r049 = pow(inF0, inF1); + float2 r050 = radians(inF0); + float2 r051 = rcp(inF0); + float2 r052 = reflect(inF0, inF1); + float2 r053 = refract(inF0, inF1, 2.0); + uint2 r054 = reversebits(uint2(1,2)); + float2 r055 = round(inF0); + float2 r056 = rsqrt(inF0); + float2 r057 = saturate(inF0); + float2 r058 = sign(inF0); + float2 r059 = sin(inF0); + sincos(inF0, inF1, inF2); + float2 r060 = sinh(inF0); + float2 r061 = smoothstep(inF0, inF1, inF2); + float2 r062 = sqrt(inF0); + float2 r063 = step(inF0, inF1); + float2 r064 = tan(inF0); + float2 r065 = tanh(inF0); + // TODO: sampler intrinsics, when we can declare the types. + float2 r066 = trunc(inF0); + + // TODO: ... add when float1 prototypes are generated + return float2(1,2); +} + +float3 PixelShaderFunction3(float3 inF0, float3 inF1, float3 inF2, uint3 inU0, uint3 inU1) +{ + uint3 out_u3; + + bool r000 = all(inF0); + float3 r001 = abs(inF0); + float3 r002 = acos(inF0); + bool r003 = any(inF0); + float3 r004 = asin(inF0); + int3 r005 = asint(inF0); + uint3 r006 = asuint(inF0); + float3 r007 = asfloat(inU0); + // asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics + float3 r009 = atan(inF0); + float3 r010 = atan2(inF0, inF1); + float3 r011 = ceil(inF0); + float3 r012 = clamp(inF0, inF1, inF2); + clip(inF0); + clip(inU0); + float3 r013 = cos(inF0); + float3 r014 = cosh(inF0); + uint3 r015 = countbits(uint3(7,3,5)); + float3 r016 = cross(inF0, inF1); + float3 r017 = ddx(inF0); + float3 r018 = ddx_coarse(inF0); + float3 r019 = ddx_fine(inF0); + float3 r020 = ddy(inF0); + float3 r021 = ddy_coarse(inF0); + float3 r022 = ddy_fine(inF0); + float3 r023 = degrees(inF0); + float r024 = distance(inF0, inF1); + float r025 = dot(inF0, inF1); + // EvaluateAttributeAtCentroid(inF0); + // EvaluateAttributeAtSample(inF0, 0); + // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); + float3 r029 = exp(inF0); + float3 r030 = exp2(inF0); + float3 r031 = faceforward(inF0, inF1, inF2); + uint3 r032 = firstbithigh(uint3(2,3,4)); + uint3 r033 = firstbitlow(uint3(2,3,4)); + float3 r034 = floor(inF0); + // TODO: fma(inD0, inD1, inD2); + float3 r036 = fmod(inF0, inF1); + float3 r037 = frac(inF0); + float3 r039 = fwidth(inF0); + bool3 r040 = isinf(inF0); + bool3 r041 = isnan(inF0); + float3 r042 = ldexp(inF0, inF1); + float3 r039a = lerp(inF0, inF1, inF2); + float3 r039b = lerp(inF0, inF1, 0.3); // test vec,vec,scalar lerp + float r043 = length(inF0); + float3 r044 = log(inF0); + float3 r045 = log10(inF0); + float3 r046 = log2(inF0); + float3 r047 = max(inF0, inF1); + float3 r048 = min(inF0, inF1); + float3 r049 = normalize(inF0); + float3 r050 = pow(inF0, inF1); + float3 r051 = radians(inF0); + float3 r052 = rcp(inF0); + float3 r053 = reflect(inF0, inF1); + float3 r054 = refract(inF0, inF1, 2.0); + uint3 r055 = reversebits(uint3(1,2,3)); + float3 r056 = round(inF0); + float3 r057 = rsqrt(inF0); + float3 r058 = saturate(inF0); + float3 r059 = sign(inF0); + float3 r060 = sin(inF0); + sincos(inF0, inF1, inF2); + float3 r061 = sinh(inF0); + float3 r062 = smoothstep(inF0, inF1, inF2); + float3 r063 = sqrt(inF0); + float3 r064 = step(inF0, inF1); + float3 r065 = tan(inF0); + float3 r066 = tanh(inF0); + // TODO: sampler intrinsics, when we can declare the types. + float3 r067 = trunc(inF0); + + // TODO: ... add when float1 prototypes are generated + return float3(1,2,3); +} + +float4 PixelShaderFunction(float4 inF0, float4 inF1, float4 inF2, uint4 inU0, uint4 inU1) +{ + uint4 out_u4; + + bool r000 = all(inF0); + float4 r001 = abs(inF0); + float4 r002 = acos(inF0); + bool r003 = any(inF0); + float4 r004 = asin(inF0); + int4 r005 = asint(inF0); + uint4 r006 = asuint(inF0); + float4 r007 = asfloat(inU0); + // asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics + float4 r009 = atan(inF0); + float4 r010 = atan2(inF0, inF1); + float4 r011 = ceil(inF0); + float4 r012 = clamp(inF0, inF1, inF2); + clip(inF0); + clip(inU0); + float4 r013 = cos(inF0); + float4 r014 = cosh(inF0); + uint4 r015 = countbits(uint4(7,3,5,2)); + float4 r016 = ddx(inF0); + float4 r017 = ddx_coarse(inF0); + float4 r018 = ddx_fine(inF0); + float4 r019 = ddy(inF0); + float4 r020 = ddy_coarse(inF0); + float4 r021 = ddy_fine(inF0); + float4 r022 = degrees(inF0); + float r023 = distance(inF0, inF1); + float r024 = dot(inF0, inF1); + float4 r025 = dst(inF0, inF1); + // EvaluateAttributeAtCentroid(inF0); + // EvaluateAttributeAtSample(inF0, 0); + // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); + float4 r029 = exp(inF0); + float4 r030 = exp2(inF0); + float4 r031 = faceforward(inF0, inF1, inF2); + uint4 r032 = firstbithigh(uint4(7,8,9,10)); + uint4 r033 = firstbitlow(uint4(7,8,9,10)); + float4 r034 = floor(inF0); + // TODO: fma(inD0, inD1, inD2); + float4 r036 = fmod(inF0, inF1); + float4 r037 = frac(inF0); + float4 r039 = fwidth(inF0); + bool4 r040 = isinf(inF0); + bool4 r041 = isnan(inF0); + float4 r042 = ldexp(inF0, inF1); + float4 r039a = lerp(inF0, inF1, inF2); + float r043 = length(inF0); + float4 r044 = log(inF0); + float4 r045 = log10(inF0); + float4 r046 = log2(inF0); + float4 r047 = max(inF0, inF1); + float4 r048 = min(inF0, inF1); + float4 r049 = normalize(inF0); + float4 r050 = pow(inF0, inF1); + float4 r051 = radians(inF0); + float4 r052 = rcp(inF0); + float4 r053 = reflect(inF0, inF1); + float4 r054 = refract(inF0, inF1, 2.0); + uint4 r055 = reversebits(uint4(1,2,3,4)); + float4 r056 = round(inF0); + float4 r057 = rsqrt(inF0); + float4 r058 = saturate(inF0); + float4 r059 = sign(inF0); + float4 r060 = sin(inF0); + sincos(inF0, inF1, inF2); + float4 r061 = sinh(inF0); + float4 r062 = smoothstep(inF0, inF1, inF2); + float4 r063 = sqrt(inF0); + float4 r064 = step(inF0, inF1); + float4 r065 = tan(inF0); + float4 r066 = tanh(inF0); + // TODO: sampler intrinsics, when we can declare the types. + float4 r067 = trunc(inF0); + + // TODO: ... add when float1 prototypes are generated + return float4(1,2,3,4); +} + +// TODO: for mats: +// asfloat(inU0); \ +// asint(inF0); \ +// asuint(inF0); \ + +// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. +#define MATFNS(MT) \ + bool r000 = all(inF0); \ + MT r001 = abs(inF0); \ + acos(inF0); \ + bool r003 = any(inF0); \ + MT r004 = asin(inF0); \ + MT r005 = atan(inF0); \ + MT r006 = atan2(inF0, inF1); \ + MT r007 = ceil(inF0); \ + clip(inF0); \ + MT r008 = clamp(inF0, inF1, inF2); \ + MT r009 = cos(inF0); \ + MT r010 = cosh(inF0); \ + MT r011 = ddx(inF0); \ + MT r012 = ddx_coarse(inF0); \ + MT r013 = ddx_fine(inF0); \ + MT r014 = ddy(inF0); \ + MT r015 = ddy_coarse(inF0); \ + MT r016 = ddy_fine(inF0); \ + MT r017 = degrees(inF0); \ + float r018 = determinant(inF0); \ + MT r019 = exp(inF0); \ + MT R020 = exp2(inF0); \ + MT r021 = floor(inF0); \ + MT r022 = fmod(inF0, inF1); \ + MT r023 = frac(inF0); \ + MT r025 = fwidth(inF0); \ + MT r026 = ldexp(inF0, inF1); \ + MT r026a = lerp(inF0, inF1, inF2); \ + MT r027 = log(inF0); \ + MT r028 = log10(inF0); \ + MT r029 = log2(inF0); \ + MT r030 = max(inF0, inF1); \ + MT r031 = min(inF0, inF1); \ + MT r032 = pow(inF0, inF1); \ + MT r033 = radians(inF0); \ + MT r034 = round(inF0); \ + MT r035 = rsqrt(inF0); \ + MT r036 = saturate(inF0); \ + MT r037 = sign(inF0); \ + MT r038 = sin(inF0); \ + sincos(inF0, inF1, inF2); \ + MT r039 = sinh(inF0); \ + MT r049 = smoothstep(inF0, inF1, inF2); \ + MT r041 = sqrt(inF0); \ + MT r042 = step(inF0, inF1); \ + MT r043 = tan(inF0); \ + MT r044 = tanh(inF0); \ + transpose(inF0); \ + MT r046 = trunc(inF0); + +// TODO: turn on non-square matrix tests when protos are available. + +float2x2 PixelShaderFunction2x2(float2x2 inF0, float2x2 inF1, float2x2 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS(float2x2); + + // TODO: ... add when float1 prototypes are generated + return float2x2(2,2,2,2); +} + +float3x3 PixelShaderFunction3x3(float3x3 inF0, float3x3 inF1, float3x3 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS(float3x3); + + // TODO: ... add when float1 prototypes are generated + return float3x3(3,3,3,3,3,3,3,3,3); +} + +float4x4 PixelShaderFunction4x4(float4x4 inF0, float4x4 inF1, float4x4 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS(float4x4); + + // TODO: ... add when float1 prototypes are generated + return float4x4(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4); +} + +#define TESTGENMUL(ST, VT, MT) \ + ST r0 = mul(inF0, inF1); \ + VT r1 = mul(inFV0, inF0); \ + VT r2 = mul(inF0, inFV0); \ + ST r3 = mul(inFV0, inFV1); \ + VT r4 = mul(inFM0, inFV0); \ + VT r5 = mul(inFV0, inFM0); \ + MT r6 = mul(inFM0, inF0); \ + MT r7 = mul(inF0, inFM0); \ + MT r8 = mul(inFM0, inFM1); + + +void TestGenMul2(float inF0, float inF1, + float2 inFV0, float2 inFV1, + float2x2 inFM0, float2x2 inFM1) +{ + TESTGENMUL(float, float2, float2x2); +} + +void TestGenMul3(float inF0, float inF1, + float3 inFV0, float3 inFV1, + float3x3 inFM0, float3x3 inFM1) +{ + TESTGENMUL(float, float3, float3x3); +} + +void TestGenMul4(float inF0, float inF1, + float4 inFV0, float4 inFV1, + float4x4 inFM0, float4x4 inFM1) +{ + TESTGENMUL(float, float4, float4x4); +} + +// Test some non-square mats +void TestGenMulNxM(float inF0, float inF1, + float2 inFV2, float3 inFV3, + float2x3 inFM2x3, float3x2 inFM3x2, + float3x3 inFM3x3, float3x4 inFM3x4, + float2x4 inFM2x4) +{ + float r00 = mul(inF0, inF1); // S=S*S + float2 r01 = mul(inFV2, inF0); // V=V*S + float3 r02 = mul(inFV3, inF0); // V=V*S + float2 r03 = mul(inF0, inFV2); // V=S*V + float3 r04 = mul(inF0, inFV3); // V=S*V + float r05 = mul(inFV2, inFV2); // S=V*V + float r06 = mul(inFV3, inFV3); // S=V*V + float3 r07 = mul(inFV2, inFM2x3); // V=V*M (return V dim is Mcols) + float2 r08 = mul(inFV3, inFM3x2); // V=V*M (return V dim is Mcols) + float2 r09 = mul(inFM2x3, inFV3); // V=M*V (return V dim is Mrows) + float3 r10 = mul(inFM3x2, inFV2); // V=M*V (return V dim is Mrows) + float2x3 r11 = mul(inFM2x3, inF0); + float3x2 r12 = mul(inFM3x2, inF0); + float2x2 r13 = mul(inFM2x3, inFM3x2); + float2x3 r14 = mul(inFM2x3, inFM3x3); + float2x4 r15 = mul(inFM2x3, inFM3x4); + float3x4 r16 = mul(inFM3x2, inFM2x4); +} + +struct PS_OUTPUT { float4 color : SV_Target0; }; + +PS_OUTPUT main() +{ + PS_OUTPUT ps_output; + ps_output.color = 1.0; + return ps_output; +}; diff --git a/deps/glslang/Test/hlsl.intrinsics.lit.frag b/deps/glslang/Test/hlsl.intrinsics.lit.frag new file mode 100644 index 00000000..bf4069a8 --- /dev/null +++ b/deps/glslang/Test/hlsl.intrinsics.lit.frag @@ -0,0 +1,4 @@ +void PixelShaderFunction(float n_dot_l, float n_dot_h, float m) +{ + float4 r0 = lit(n_dot_l, n_dot_h, m); +} diff --git a/deps/glslang/Test/hlsl.intrinsics.negative.comp b/deps/glslang/Test/hlsl.intrinsics.negative.comp new file mode 100644 index 00000000..fe612d6e --- /dev/null +++ b/deps/glslang/Test/hlsl.intrinsics.negative.comp @@ -0,0 +1,201 @@ +float ComputeShaderFunctionS(float inF0, float inF1, float inF2, int inI0) +{ + uint out_u1; + + // AllMemoryBarrier(); // invalid in fragment stage TODO: parser currently crashes on empty arg list + // AllMemoryBarrierWithGroupSync(); // invalid in fragment stage TODO: parser currently crashes on empty arg list + // asdouble(inF0, inF1); // expected error: only integer inputs + // CheckAccessFullyMapped(3.0); // expected error: only valid on integers + // clip(inF0); // expected error: only valid in pixel stage + // countbits(inF0); // expected error: only integer inputs + // cross(inF0, inF1); // expected error: only on float3 inputs + // D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs + // ddx(inF0); // expected error: only valid in pixel stage + // ddx_coarse(inF0); // expected error: only valid in pixel stage + // ddx_fine(inF0); // expected error: only valid in pixel stage + // ddy(inF0); // expected error: only valid in pixel stage + // ddy_coarse(inF0); // expected error: only valid in pixel stage + // ddy_fine(inF0); // expected error: only valid in pixel stage + // determinant(inF0); // expected error: only valid on mats + // EvaluateAttributeAtCentroid(inF0); // expected error: only interpolant + // EvaluateAttributeAtSample(inF0, 2); // expected error: only interpolant + // EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only interpolant + // f16tof32(inF0); // expected error: only integer inputs + // firstbithigh(inF0); // expected error: only integer inputs + // firstbitlow(inF0); // expected error: only integer inputs + // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC + // fwidth(inF0); // expected error: only valid in pixel stage + // InterlockedAdd(gs_ua, gs_ub); // expected error: only valid in pixel stage + // InterlockedAdd(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage + // InterlockedAnd(gs_ua, gs_ub); // expected error: only valid in pixel stage + // InterlockedAnd(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage + // InterlockedCompareExchange(gs_ua, gs_ub, gs_uc, out_u1); // expected error: only valid in pixel stage + // InterlockedExchange(gs_ua, gs_ub, out_u1);// expected error: only valid in pixel stage + // InterlockedMax(gs_ua, gs_ub); // expected error: only valid in pixel stage + // InterlockedMax(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage + // InterlockedMin(gs_ua, gs_ub); // expected error: only valid in pixel stage + // InterlockedMin(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage + // InterlockedOr(gs_ua, gs_ub); // expected error: only valid in pixel stage + // InterlockedOr(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage + // InterlockedXor(gs_ua, gs_ub); // expected error: only valid in pixel stage + // InterlockedXor(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage + // length(inF0); // expect error: invalid on scalars + // msad4(inF0, float2(0), float4(0)); // expected error: only integer inputs + // normalize(inF0); // expect error: invalid on scalars + // reflect(inF0, inF1); // expect error: invalid on scalars + // refract(inF0, inF1, inF2); // expect error: invalid on scalars + // refract(float2(0), float2(0), float2(0)); // expected error: last parameter only scalar + // reversebits(inF0); // expected error: only integer inputs + // transpose(inF0); // expect error: only valid on mats + + // TODO: texture intrinsics, when we can declare samplers. + + return 0.0; +} + +float1 ComputeShaderFunction1(float1 inF0, float1 inF1, float1 inF2, int1 inI0) +{ + // TODO: ... add when float1 prototypes are generated + + // GetRenderTargetSamplePosition(inF0); // expected error: only integer inputs + + return 0.0; +} + +float2 ComputeShaderFunction2(float2 inF0, float2 inF1, float2 inF2, int2 inI0) +{ + uint2 out_u2; + + // asdouble(inF0, inF1); // expected error: only integer inputs + // CheckAccessFullyMapped(inF0); // expect error: only valid on scalars + // countbits(inF0); // expected error: only integer inputs + // cross(inF0, inF1); // expected error: only on float3 inputs + // D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs + // ddx(inF0); // only valid in pixel stage + // ddx_coarse(inF0); // only valid in pixel stage + // ddx_fine(inF0); // only valid in pixel stage + // ddy(inF0); // only valid in pixel stage + // ddy_coarse(inF0); // only valid in pixel stage + // ddy_fine(inF0); // only valid in pixel stage + // determinant(inF0); // expect error: only valid on mats + // EvaluateAttributeAtCentroid(inF0); // expected error: only interpolant + // EvaluateAttributeAtSample(inF0, 2); // expected error: only interpolant + // EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only interpolant + // f16tof32(inF0); // expected error: only integer inputs + // firstbithigh(inF0); // expected error: only integer inputs + // firstbitlow(inF0); // expected error: only integer inputs + // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC + // fwidth(inF0); // expected error: only valid in pixel stage + // InterlockedAdd(gs_ua2, gs_ub2); // expected error: only valid in pixel stage + // InterlockedAdd(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage + // InterlockedAnd(gs_ua2, gs_ub2); // expected error: only valid in pixel stage + // InterlockedAnd(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage + // InterlockedCompareExchange(gs_ua2, gs_ub2, gs_uc2, out_u2); // expected error: only valid in pixel stage + // InterlockedExchange(gs_ua2, gs_ub2, out_u2);// expected error: only valid in pixel stage + // InterlockedMax(gs_ua2, gs_ub2); // expected error: only valid in pixel stage + // InterlockedMax(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage + // InterlockedMin(gs_ua2, gs_ub2); // expected error: only valid in pixel stage + // InterlockedMin(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage + // InterlockedOr(gs_ua2, gs_ub2); // expected error: only valid in pixel stage + // InterlockedOr(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage + // InterlockedXor(gs_ua2, gs_ub2); // expected error: only valid in pixel stage + // InterlockedXor(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage + // noise(inF0); // expected error: only valid in pixel stage + // reversebits(inF0); // expected error: only integer inputs + // transpose(inF0); // expect error: only valid on mats + + // TODO: texture intrinsics, when we can declare samplers. + + return float2(1,2); +} + +float3 ComputeShaderFunction3(float3 inF0, float3 inF1, float3 inF2, int3 inI0) +{ + uint3 out_u3; + + // CheckAccessFullyMapped(inF0); // expect error: only valid on scalars + // countbits(inF0); // expected error: only integer inputs + // ddx(inF0); // only valid in pixel stage + // ddx_coarse(inF0); // only valid in pixel stage + // ddx_fine(inF0); // only valid in pixel stage + // ddy(inF0); // only valid in pixel stage + // ddy_coarse(inF0); // only valid in pixel stage + // ddy_fine(inF0); // only valid in pixel stage + // D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs + // determinant(inF0); // expect error: only valid on mats + // EvaluateAttributeAtCentroid(inF0); // expected error: only interpolant + // EvaluateAttributeAtSample(inF0, 2); // expected error: only interpolant + // EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only interpolant + // f16tof32(inF0); // expected error: only integer inputs + // firstbithigh(inF0); // expected error: only integer inputs + // firstbitlow(inF0); // expected error: only integer inputs + // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC + // fwidth(inF0); // expected error: only valid in pixel stage + // InterlockedAdd(gs_ua3, gs_ub3); // expected error: only valid in pixel stage + // InterlockedAdd(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage + // InterlockedAnd(gs_ua3, gs_ub3); // expected error: only valid in pixel stage + // InterlockedAnd(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage + // InterlockedCompareExchange(gs_ua3, gs_ub3, gs_uc3, out_u3); // expected error: only valid in pixel stage + // InterlockedExchange(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage + // InterlockedMax(gs_ua3, gs_ub3); // expected error: only valid in pixel stage + // InterlockedMax(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage + // InterlockedMin(gs_ua3, gs_ub3); // expected error: only valid in pixel stage + // InterlockedMin(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage + // InterlockedOr(gs_ua3, gs_ub3); // expected error: only valid in pixel stage + // InterlockedOr(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage + // InterlockedXor(gs_ua3, gs_ub3); // expected error: only valid in pixel stage + // InterlockedXor(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage + // noise(inF0); // expected error: only valid in pixel stage + // reversebits(inF0); // expected error: only integer inputs + // transpose(inF0); // expect error: only valid on mats + + // TODO: texture intrinsics, when we can declare samplers. + + return float3(1,2,3); +} + +float4 ComputeShaderFunction(float4 inF0, float4 inF1, float4 inF2, int4 inI0) +{ + uint4 out_u4; + + // CheckAccessFullyMapped(inF0); // expect error: only valid on scalars + // countbits(inF0); // expected error: only integer inputs + // cross(inF0, inF1); // expected error: only on float3 inputs + // determinant(inF0); // expect error: only valid on mats + // ddx(inF0); // only valid in pixel stage + // ddx_coarse(inF0); // only valid in pixel stage + // ddx_fine(inF0); // only valid in pixel stage + // ddy(inF0); // only valid in pixel stage + // ddy_coarse(inF0); // only valid in pixel stage + // ddy_fine(inF0); // only valid in pixel stage + // EvaluateAttributeAtCentroid(inF0); // expected error: only valid in pixel stage + // EvaluateAttributeAtSample(inF0, 2); // expected error: only valid in pixel stage + // EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only valid in pixel stage + // f16tof32(inF0); // expected error: only integer inputs + // firstbithigh(inF0); // expected error: only integer inputs + // firstbitlow(inF0); // expected error: only integer inputs + // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC + // fwidth(inF0); // expected error: only valid in pixel stage + // InterlockedAdd(gs_ua4, gs_ub4); // expected error: only valid in pixel stage + // InterlockedAdd(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage + // InterlockedAnd(gs_ua4, gs_ub4); // expected error: only valid in pixel stage + // InterlockedAnd(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage + // InterlockedCompareExchange(gs_ua4, gs_ub4, gs_uc4, out_u4); // expected error: only valid in pixel stage + // InterlockedExchange(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage + // InterlockedMax(gs_ua4, gs_ub4); // expected error: only valid in pixel stage + // InterlockedMax(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage + // InterlockedMin(gs_ua4, gs_ub4); // expected error: only valid in pixel stage + // InterlockedMin(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage + // InterlockedOr(gs_ua4, gs_ub4); // expected error: only valid in pixel stage + // InterlockedOr(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage + // InterlockedXor(gs_ua4, gs_ub4); // expected error: only valid in pixel stage + // InterlockedXor(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage + // noise(inF0); // expected error: only valid in pixel stage + // reversebits(inF0); // expected error: only integer inputs + // transpose(inF0); // expect error: only valid on mats + + // TODO: texture intrinsics, when we can declare samplers. + + return float4(1,2,3,4); +} + diff --git a/deps/glslang/Test/hlsl.intrinsics.negative.frag b/deps/glslang/Test/hlsl.intrinsics.negative.frag new file mode 100644 index 00000000..8afaf877 --- /dev/null +++ b/deps/glslang/Test/hlsl.intrinsics.negative.frag @@ -0,0 +1,136 @@ +float PixelShaderFunctionS(float inF0, float inF1, float inF2, int inI0) +{ + // AllMemoryBarrier(); // TODO: expected error: invalid in fragment stage + // AllMemoryBarrierWithGroupSync(); // TODO: expected error: invalid in fragment stage + asdouble(inF0, inF1); // expected error: only integer inputs + CheckAccessFullyMapped(3.0); // expected error: only valid on integers + countbits(inF0); // expected error: only integer inputs + cross(inF0, inF1); // expected error: only on float3 inputs + D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs + determinant(inF0); // expected error: only valid on mats + // DeviceMemoryBarrierWithGroupSync(); // TODO: expected error: only valid in compute stage + f16tof32(inF0); // expected error: only integer inputs + firstbithigh(inF0); // expected error: only integer inputs + firstbitlow(inF0); // expected error: only integer inputs + // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC + // InterlockedAdd(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator + // InterlockedAnd(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out i // InterlockedMax(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator + // InterlockedMin(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator + // InterlockedOor(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator + // InterlockedXor(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator + // GroupMemoryBarrier(); // TODO: expected error: invalid in fragment stage + // GroupMemoryBarrierWithGroupSync(); // TODO: expected error: invalid in fragment stage + length(inF0); // expected error: invalid on scalars + msad4(inF0, float2(0), float4(0)); // expected error: only integer inputs + normalize(inF0); // expected error: invalid on scalars + reflect(inF0, inF1); // expected error: invalid on scalars + refract(inF0, inF1, inF2); // expected error: invalid on scalars + refract(float2(0), float2(0), float2(0)); // expected error: last parameter only scalar + reversebits(inF0); // expected error: only integer inputs + transpose(inF0); // expected error: only valid on mats + + return 0.0; +} + +float1 PixelShaderFunction1(float1 inF0, float1 inF1, float1 inF2, int1 inI0) +{ + // TODO: ... add when float1 prototypes are generated + + GetRenderTargetSamplePosition(inF0); // expected error: only integer inputs + + return 0.0; +} + +float2 PixelShaderFunction2(float2 inF0, float2 inF1, float2 inF2, int2 inI0) +{ + asdouble(inF0, inF1); // expected error: only integer inputs + CheckAccessFullyMapped(inF0); // expected error: only valid on scalars + countbits(inF0); // expected error: only integer inputs + cross(inF0, inF1); // expected error: only on float3 inputs + D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs + determinant(inF0); // expected error: only valid on mats + f16tof32(inF0); // expected error: only integer inputs + firstbithigh(inF0); // expected error: only integer inputs + firstbitlow(inF0); // expected error: only integer inputs + // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC + reversebits(inF0); // expected error: only integer inputs + transpose(inF0); // expected error: only valid on mats + + return float2(1,2); +} + +float3 PixelShaderFunction3(float3 inF0, float3 inF1, float3 inF2, int3 inI0) +{ + CheckAccessFullyMapped(inF0); // expected error: only valid on scalars + countbits(inF0); // expected error: only integer inputs + D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs + determinant(inF0); // expected error: only valid on mats + f16tof32(inF0); // expected error: only integer inputs + firstbithigh(inF0); // expected error: only integer inputs + firstbitlow(inF0); // expected error: only integer inputs + // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC + reversebits(inF0); // expected error: only integer inputs + transpose(inF0); // expected error: only valid on mats + + + return float3(1,2,3); +} + +float4 PixelShaderFunction(float4 inF0, float4 inF1, float4 inF2, int4 inI0) +{ + CheckAccessFullyMapped(inF0); // expected error: only valid on scalars + countbits(inF0); // expected error: only integer inputs + cross(inF0, inF1); // expected error: only on float3 inputs + determinant(inF0); // expected error: only valid on mats + f16tof32(inF0); // expected error: only integer inputs + firstbithigh(inF0); // expected error: only integer inputs + firstbitlow(inF0); // expected error: only integer inputs + // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC + reversebits(inF0); // expected error: only integer inputs + transpose(inF0); // expected error: only valid on mats + + return float4(1,2,3,4); +} + +// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. +#define MATFNS() \ + countbits(inF0); \ + D3DCOLORtoUBYTE4(inF0); \ + cross(inF0, inF1); \ + f16tof32(inF0); \ + firstbithigh(inF0); \ + firstbitlow(inF0); \ + reversebits(inF0); \ + length(inF0); \ + noise(inF0); \ + normalize(inF0); \ + reflect(inF0, inF1); \ + refract(inF0, inF1, 1.0); \ + reversebits(inF0); \ + + +// TODO: turn on non-square matrix tests when protos are available. + +float2x2 PixelShaderFunction2x2(float2x2 inF0, float2x2 inF1, float2x2 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS() + + return float2x2(2,2,2,2); +} + +float3x3 PixelShaderFunction3x3(float3x3 inF0, float3x3 inF1, float3x3 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS() + + return float3x3(3,3,3,3,3,3,3,3,3); +} + +float4x4 PixelShaderFunction4x4(float4x4 inF0, float4x4 inF1, float4x4 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS() + + return float4x4(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4); +} diff --git a/deps/glslang/Test/hlsl.intrinsics.negative.vert b/deps/glslang/Test/hlsl.intrinsics.negative.vert new file mode 100644 index 00000000..6224b25e --- /dev/null +++ b/deps/glslang/Test/hlsl.intrinsics.negative.vert @@ -0,0 +1,247 @@ +static uint gs_ua; +static uint gs_ub; +static uint gs_uc; +static uint2 gs_ua2; +static uint2 gs_ub2; +static uint2 gs_uc2; +static uint3 gs_ua3; +static uint3 gs_ub3; +static uint3 gs_uc3; +static uint4 gs_ua4; +static uint4 gs_ub4; +static uint4 gs_uc4; + +float VertexShaderFunctionS(float inF0, float inF1, float inF2, int inI0) +{ + uint out_u1; + + // AllMemoryBarrier(); // expected error: only valid in compute stage + // AllMemoryBarrierWithGroupSync(); // expected error: only valid in compute stage + // asdouble(inF0, inF1); // expected error: only integer inputs + // CheckAccessFullyMapped(3.0); // expected error: only valid on integers + // CheckAccessFullyMapped(3); // expected error: only valid in pixel & compute stages + // clip(inF0); // expected error: only valid in pixel stage + // countbits(inF0); // expected error: only integer inputs + // cross(inF0, inF1); // expected error: only on float3 inputs + // D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs + // DeviceMemoryBarrier(); // expected error: only valid in pixel & compute stages + // DeviceMemoryBarrierWithGroupSync(); // expected error: only valid in compute stage + // ddx(inF0); // expected error: only valid in pixel stage + // ddx_coarse(inF0); // expected error: only valid in pixel stage + // ddx_fine(inF0); // expected error: only valid in pixel stage + // ddy(inF0); // expected error: only valid in pixel stage + // ddy_coarse(inF0); // expected error: only valid in pixel stage + // ddy_fine(inF0); // expected error: only valid in pixel stage + // determinant(inF0); // expected error: only valid on mats + // EvaluateAttributeAtCentroid(inF0); // expected error: only interpolant + // EvaluateAttributeAtSample(inF0, 2); // expected error: only interpolant + // EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only interpolant + // f16tof32(inF0); // expected error: only integer inputs + // firstbithigh(inF0); // expected error: only integer inputs + // firstbitlow(inF0); // expected error: only integer inputs + // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC + // fwidth(inF0); // expected error: only valid in pixel stage + // InterlockedAdd(gs_ua, gs_ub); // expected error: only valid in pixel stage + // InterlockedAdd(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage + // InterlockedAnd(gs_ua, gs_ub); // expected error: only valid in pixel stage + // InterlockedAnd(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage + // InterlockedCompareExchange(gs_ua, gs_ub, gs_uc, out_u1); // expected error: only valid in pixel stage + // InterlockedExchange(gs_ua, gs_ub, out_u1);// expected error: only valid in pixel stage + // InterlockedMax(gs_ua, gs_ub); // expected error: only valid in pixel stage + // InterlockedMax(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage + // InterlockedMin(gs_ua, gs_ub); // expected error: only valid in pixel stage + // InterlockedMin(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage + // InterlockedOr(gs_ua, gs_ub); // expected error: only valid in pixel stage + // InterlockedOr(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage + // InterlockedXor(gs_ua, gs_ub); // expected error: only valid in pixel stage + // InterlockedXor(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage + // GroupMemoryBarrier(); // expected error: only valid in compute stage + // GroupMemoryBarrierWithGroupSync(); // expected error: only valid in compute stage + // length(inF0); // expect error: invalid on scalars + // msad4(inF0, float2(0), float4(0)); // expected error: only integer inputs + // normalize(inF0); // expect error: invalid on scalars + // reflect(inF0, inF1); // expect error: invalid on scalars + // refract(inF0, inF1, inF2); // expect error: invalid on scalars + // refract(float2(0), float2(0), float2(0)); // expected error: last parameter only scalar + // reversebits(inF0); // expected error: only integer inputs + // transpose(inF0); // expect error: only valid on mats + + // TODO: texture intrinsics, when we can declare samplers. + + return 0.0; +} + +float1 VertexShaderFunction1(float1 inF0, float1 inF1, float1 inF2, int1 inI0) +{ + // TODO: ... add when float1 prototypes are generated + + // GetRenderTargetSamplePosition(inF0); // expected error: only integer inputs + + return 0.0; +} + +float2 VertexShaderFunction2(float2 inF0, float2 inF1, float2 inF2, int2 inI0) +{ + uint2 out_u2; + + // asdouble(inF0, inF1); // expected error: only integer inputs + // CheckAccessFullyMapped(inF0); // expect error: only valid on scalars + // countbits(inF0); // expected error: only integer inputs + // cross(inF0, inF1); // expected error: only on float3 inputs + // D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs + // ddx(inF0); // only valid in pixel stage + // ddx_coarse(inF0); // only valid in pixel stage + // ddx_fine(inF0); // only valid in pixel stage + // ddy(inF0); // only valid in pixel stage + // ddy_coarse(inF0); // only valid in pixel stage + // ddy_fine(inF0); // only valid in pixel stage + // determinant(inF0); // expect error: only valid on mats + // EvaluateAttributeAtCentroid(inF0); // expected error: only interpolant + // EvaluateAttributeAtSample(inF0, 2); // expected error: only interpolant + // EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only interpolant + // f16tof32(inF0); // expected error: only integer inputs + // firstbithigh(inF0); // expected error: only integer inputs + // firstbitlow(inF0); // expected error: only integer inputs + // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC + // fwidth(inF0); // expected error: only valid in pixel stage + // InterlockedAdd(gs_ua2, gs_ub2); // expected error: only valid in pixel stage + // InterlockedAdd(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage + // InterlockedAnd(gs_ua2, gs_ub2); // expected error: only valid in pixel stage + // InterlockedAnd(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage + // InterlockedCompareExchange(gs_ua2, gs_ub2, gs_uc2, out_u2); // expected error: only valid in pixel stage + // InterlockedExchange(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage + // InterlockedMax(gs_ua2, gs_ub2); // expected error: only valid in pixel stage + // InterlockedMax(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage + // InterlockedMin(gs_ua2, gs_ub2); // expected error: only valid in pixel stage + // InterlockedMin(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage + // InterlockedOr(gs_ua2, gs_ub2); // expected error: only valid in pixel stage + // InterlockedOr(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage + // InterlockedXor(gs_ua2, gs_ub2); // expected error: only valid in pixel stage + // InterlockedXor(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage + // noise(inF0); // expected error: only valid in pixel stage + // reversebits(inF0); // expected error: only integer inputs + // transpose(inF0); // expect error: only valid on mats + + // TODO: texture intrinsics, when we can declare samplers. + + return float2(1,2); +} + +float3 VertexShaderFunction3(float3 inF0, float3 inF1, float3 inF2, int3 inI0) +{ + uint3 out_u3; + + // CheckAccessFullyMapped(inF0); // expect error: only valid on scalars + // countbits(inF0); // expected error: only integer inputs + // ddx(inF0); // only valid in pixel stage + // ddx_coarse(inF0); // only valid in pixel stage + // ddx_fine(inF0); // only valid in pixel stage + // ddy(inF0); // only valid in pixel stage + // ddy_coarse(inF0); // only valid in pixel stage + // ddy_fine(inF0); // only valid in pixel stage + // D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs + // determinant(inF0); // expect error: only valid on mats + // EvaluateAttributeAtCentroid(inF0); // expected error: only interpolant + // EvaluateAttributeAtSample(inF0, 2); // expected error: only interpolant + // EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only interpolant + // f16tof32(inF0); // expected error: only integer inputs + // firstbithigh(inF0); // expected error: only integer inputs + // firstbitlow(inF0); // expected error: only integer inputs + // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC + // fwidth(inF0); // expected error: only valid in pixel stage + // InterlockedAdd(gs_ua3, gs_ub3); // expected error: only valid in pixel stage + // InterlockedAdd(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage + // InterlockedAnd(gs_ua3, gs_ub3); // expected error: only valid in pixel stage + // InterlockedAnd(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage + // InterlockedCompareExchange(gs_ua3, gs_ub3, gs_uc3, out_u3); // expected error: only valid in pixel stage + // InterlockedExchange(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage + // InterlockedMax(gs_ua3, gs_ub3); // expected error: only valid in pixel stage + // InterlockedMax(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage + // InterlockedMin(gs_ua3, gs_ub3); // expected error: only valid in pixel stage + // InterlockedMin(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage + // InterlockedOr(gs_ua3, gs_ub3); // expected error: only valid in pixel stage + // InterlockedOr(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage + // InterlockedXor(gs_ua3, gs_ub3); // expected error: only valid in pixel stage + // InterlockedXor(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage + // noise(inF0); // expected error: only valid in pixel stage + // reversebits(inF0); // expected error: only integer inputs + // transpose(inF0); // expect error: only valid on mats + + // TODO: texture intrinsics, when we can declare samplers. + + return float3(1,2,3); +} + +float4 VertexShaderFunction(float4 inF0, float4 inF1, float4 inF2, int4 inI0) +{ + uint4 out_u4; + + // CheckAccessFullyMapped(inF0); // expect error: only valid on scalars + // countbits(inF0); // expected error: only integer inputs + // cross(inF0, inF1); // expected error: only on float3 inputs + // determinant(inF0); // expect error: only valid on mats + // ddx(inF0); // only valid in pixel stage + // ddx_coarse(inF0); // only valid in pixel stage + // ddx_fine(inF0); // only valid in pixel stage + // ddy(inF0); // only valid in pixel stage + // ddy_coarse(inF0); // only valid in pixel stage + // ddy_fine(inF0); // only valid in pixel stage + // EvaluateAttributeAtCentroid(inF0); // expected error: only interpolant + // EvaluateAttributeAtSample(inF0, 2); // expected error: only interpolant + // EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only interpolant + // f16tof32(inF0); // expected error: only integer inputs + // firstbithigh(inF0); // expected error: only integer inputs + // firstbitlow(inF0); // expected error: only integer inputs + // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC + // fwidth(inF0); // expected error: only valid in pixel stage + // InterlockedAdd(gs_ua4, gs_ub4); // expected error: only valid in pixel stage + // InterlockedAdd(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage + // InterlockedAnd(gs_ua4, gs_ub4); // expected error: only valid in pixel stage + // InterlockedAnd(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage + // InterlockedCompareExchange(gs_ua4, gs_ub4, gs_uc4, out_u4); // expected error: only valid in pixel stage + // InterlockedExchange(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage + // InterlockedMax(gs_ua4, gs_ub4); // expected error: only valid in pixel stage + // InterlockedMax(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage + // InterlockedMin(gs_ua4, gs_ub4); // expected error: only valid in pixel stage + // InterlockedMin(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage + // InterlockedOr(gs_ua4, gs_ub4); // expected error: only valid in pixel stage + // InterlockedOr(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage + // InterlockedXor(gs_ua4, gs_ub4); // expected error: only valid in pixel stage + // InterlockedXor(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage + // noise(inF0); // expected error: only valid in pixel stage + // reversebits(inF0); // expected error: only integer inputs + // transpose(inF0); // expect error: only valid on mats + + // TODO: texture intrinsics, when we can declare samplers. + + return float4(1,2,3,4); +} + +// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. +#define MATFNS() + +// TODO: turn on non-square matrix tests when protos are available. + +float2x2 VertexShaderFunction2x2(float2x2 inF0, float2x2 inF1, float2x2 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS() + + return float2x2(2,2,2,2); +} + +float3x3 VertexShaderFunction3x3(float3x3 inF0, float3x3 inF1, float3x3 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS() + + return float3x3(3,3,3,3,3,3,3,3,3); +} + +float4x4 VertexShaderFunction4x4(float4x4 inF0, float4x4 inF1, float4x4 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS() + + return float4x4(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4); +} diff --git a/deps/glslang/Test/hlsl.intrinsics.promote.down.frag b/deps/glslang/Test/hlsl.intrinsics.promote.down.frag new file mode 100644 index 00000000..5f4882b2 --- /dev/null +++ b/deps/glslang/Test/hlsl.intrinsics.promote.down.frag @@ -0,0 +1,22 @@ + +struct PS_OUTPUT { float4 color : SV_Target0; }; + +int i; +uint u; +float f; +bool b; + +int2 i2; +uint2 u2; +float2 f2; +bool2 b2; + +PS_OUTPUT main() +{ + uint r00 = countbits(f); + uint2 r01 = reversebits(f2); + + PS_OUTPUT ps_output; + ps_output.color = float4(0,0,0,0); + return ps_output; +}; diff --git a/deps/glslang/Test/hlsl.intrinsics.promote.frag b/deps/glslang/Test/hlsl.intrinsics.promote.frag new file mode 100644 index 00000000..89d3e680 --- /dev/null +++ b/deps/glslang/Test/hlsl.intrinsics.promote.frag @@ -0,0 +1,79 @@ + +struct PS_OUTPUT { float4 color : SV_Target0; }; + +int i; +uint u; +float f; +bool b; + +int2 i2; +uint2 u2; +float2 f2; +bool2 b2; + +Buffer g_tTexbfs; +Texture1D g_tTex1df4; +uint upos; +float fpos; + +PS_OUTPUT main() +{ + // Same shapes: + + float r00 = max(b, f); + uint r01 = max(b, u); + int r02 = max(b, i); + float r03 = max(i, f); + float r04 = max(u, f); + + float2 r10 = max(b2, f2); + uint2 r11 = max(b2, u2); + int2 r12 = max(b2, i2); + float2 r13 = max(i2, f2); + float2 r14 = max(u2, f2); + + float2 r20 = clamp(i2, u2, f2); // 3 args, converts all to best type. + uint2 r21 = clamp(b2, u2, b2); + float2 r22 = clamp(b2, f2, b2); + + // Mixed shapes: + float2 r30 = max(b, f2); + uint2 r31 = max(b, u2); + int2 r32 = max(b, i2); + float2 r33 = max(i, f2); + float2 r34 = max(u, f2); + + float2 r40 = clamp(i, u2, f2); // 3 args, converts all to best type. + uint2 r41 = clamp(b2, u, b2); + float2 r42 = clamp(b2, f, b); + int2 r43 = clamp(i, i2, u2); + + float r50 = g_tTexbfs.Load(upos); + float r51 = g_tTexbfs.Load(fpos); + + int MipLevel; + + uint WidthU; + uint HeightU; + uint ElementsU; + uint DepthU; + uint NumberOfLevelsU; + uint NumberOfSamplesU; + + int WidthI; + int HeightI; + int ElementsI; + int DepthI; + int NumberOfLevelsI; + int NumberOfSamplesI; + + g_tTex1df4 . GetDimensions(WidthI); + g_tTex1df4 . GetDimensions(6, WidthI, NumberOfLevelsU); + g_tTex1df4 . GetDimensions(6, WidthU, NumberOfLevelsI); + g_tTex1df4 . GetDimensions(6, WidthI, NumberOfLevelsI); + + // max(i2, f2); + PS_OUTPUT ps_output; + ps_output.color = r00; + return ps_output; +}; diff --git a/deps/glslang/Test/hlsl.intrinsics.promote.outputs.frag b/deps/glslang/Test/hlsl.intrinsics.promote.outputs.frag new file mode 100644 index 00000000..42fa3e80 --- /dev/null +++ b/deps/glslang/Test/hlsl.intrinsics.promote.outputs.frag @@ -0,0 +1,49 @@ + +struct PS_OUTPUT { float4 color : SV_Target0; }; + +int i; +uint u; +float f; +bool b; + +int2 i2; +uint2 u2; +float2 f2; +bool2 b2; + +Buffer g_tTexbfs; +Texture1D g_tTex1df4; +uint upos; +float fpos; + +PS_OUTPUT main() +{ + int MipLevel; + + uint WidthU; + uint HeightU; + uint ElementsU; + uint DepthU; + uint NumberOfLevelsU; + uint NumberOfSamplesU; + + int WidthI; + int HeightI; + int ElementsI; + int DepthI; + int NumberOfLevelsI; + int NumberOfSamplesI; + + saturate(fpos); + + // Test output promotions + g_tTex1df4 . GetDimensions(WidthI); + g_tTex1df4 . GetDimensions(6, WidthI, NumberOfLevelsU); + g_tTex1df4 . GetDimensions(6, WidthU, NumberOfLevelsI); + g_tTex1df4 . GetDimensions(6, WidthI, NumberOfLevelsI); + + // max(i2, f2); + PS_OUTPUT ps_output; + ps_output.color = 0; + return ps_output; +}; diff --git a/deps/glslang/Test/hlsl.intrinsics.vert b/deps/glslang/Test/hlsl.intrinsics.vert new file mode 100644 index 00000000..c442f16a --- /dev/null +++ b/deps/glslang/Test/hlsl.intrinsics.vert @@ -0,0 +1,414 @@ +float VertexShaderFunctionS(float inF0, float inF1, float inF2, uint inU0, uint inU1) +{ + all(inF0); + abs(inF0); + acos(inF0); + any(inF0); + asin(inF0); + asint(inF0); + asuint(inF0); + asfloat(inU0); + // asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics + atan(inF0); + atan2(inF0, inF1); + ceil(inF0); + clamp(inF0, inF1, inF2); + cos(inF0); + cosh(inF0); + countbits(7); + degrees(inF0); + // EvaluateAttributeAtCentroid(inF0); + // EvaluateAttributeAtSample(inF0, 0); + // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); + exp(inF0); + exp2(inF0); + firstbithigh(7); + firstbitlow(7); + floor(inF0); + // TODO: fma(inD0, inD1, inD2); + fmod(inF0, inF1); + frac(inF0); + isinf(inF0); + isnan(inF0); + ldexp(inF0, inF1); + lerp(inF0, inF1, inF2); + log(inF0); + log10(inF0); + log2(inF0); + max(inF0, inF1); + min(inF0, inF1); + // TODO: mul(inF0, inF1); + pow(inF0, inF1); + radians(inF0); + reversebits(2); + round(inF0); + rsqrt(inF0); + saturate(inF0); + sign(inF0); + sin(inF0); + sincos(inF0, inF1, inF2); + sinh(inF0); + smoothstep(inF0, inF1, inF2); + sqrt(inF0); + step(inF0, inF1); + tan(inF0); + tanh(inF0); + // TODO: sampler intrinsics, when we can declare the types. + trunc(inF0); + + return 0.0; +} + +float1 VertexShaderFunction1(float1 inF0, float1 inF1, float1 inF2) +{ + // TODO: ... add when float1 prototypes are generated + return 0.0; +} + +float2 VertexShaderFunction2(float2 inF0, float2 inF1, float2 inF2, uint2 inU0, uint2 inU1) +{ + all(inF0); + abs(inF0); + acos(inF0); + any(inF0); + asin(inF0); + asint(inF0); + asuint(inF0); + asfloat(inU0); + // asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics + atan(inF0); + atan2(inF0, inF1); + ceil(inF0); + clamp(inF0, inF1, inF2); + cos(inF0); + cosh(inF0); + countbits(int2(7,3)); + degrees(inF0); + distance(inF0, inF1); + dot(inF0, inF1); + // EvaluateAttributeAtCentroid(inF0); + // EvaluateAttributeAtSample(inF0, 0); + // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); + exp(inF0); + exp2(inF0); + faceforward(inF0, inF1, inF2); + firstbithigh(7); + firstbitlow(7); + floor(inF0); + // TODO: fma(inD0, inD1, inD2); + fmod(inF0, inF1); + frac(inF0); + isinf(inF0); + isnan(inF0); + ldexp(inF0, inF1); + lerp(inF0, inF1, inF2); + length(inF0); + log(inF0); + log10(inF0); + log2(inF0); + max(inF0, inF1); + min(inF0, inF1); + // TODO: mul(inF0, inF1); + normalize(inF0); + pow(inF0, inF1); + radians(inF0); + reflect(inF0, inF1); + refract(inF0, inF1, 2.0); + reversebits(int2(1,2)); + round(inF0); + rsqrt(inF0); + saturate(inF0); + sign(inF0); + sin(inF0); + sincos(inF0, inF1, inF2); + sinh(inF0); + smoothstep(inF0, inF1, inF2); + sqrt(inF0); + step(inF0, inF1); + tan(inF0); + tanh(inF0); + // TODO: sampler intrinsics, when we can declare the types. + trunc(inF0); + + // TODO: ... add when float1 prototypes are generated + return float2(1,2); +} + +float3 VertexShaderFunction3(float3 inF0, float3 inF1, float3 inF2, uint3 inU0, uint3 inU1) +{ + all(inF0); + abs(inF0); + acos(inF0); + any(inF0); + asin(inF0); + asint(inF0); + asuint(inF0); + asfloat(inU0); + // asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics + atan(inF0); + atan2(inF0, inF1); + ceil(inF0); + clamp(inF0, inF1, inF2); + cos(inF0); + cosh(inF0); + countbits(int3(7,3,5)); + cross(inF0, inF1); + degrees(inF0); + distance(inF0, inF1); + dot(inF0, inF1); + // EvaluateAttributeAtCentroid(inF0); + // EvaluateAttributeAtSample(inF0, 0); + // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); + exp(inF0); + exp2(inF0); + faceforward(inF0, inF1, inF2); + firstbithigh(7); + firstbitlow(7); + floor(inF0); + // TODO: fma(inD0, inD1, inD2); + fmod(inF0, inF1); + frac(inF0); + isinf(inF0); + isnan(inF0); + ldexp(inF0, inF1); + lerp(inF0, inF1, inF2); + length(inF0); + log(inF0); + log10(inF0); + log2(inF0); + max(inF0, inF1); + min(inF0, inF1); + // TODO: mul(inF0, inF1); + normalize(inF0); + pow(inF0, inF1); + radians(inF0); + reflect(inF0, inF1); + refract(inF0, inF1, 2.0); + reversebits(int3(1,2,3)); + round(inF0); + rsqrt(inF0); + saturate(inF0); + sign(inF0); + sin(inF0); + sincos(inF0, inF1, inF2); + sinh(inF0); + smoothstep(inF0, inF1, inF2); + sqrt(inF0); + step(inF0, inF1); + tan(inF0); + tanh(inF0); + // TODO: sampler intrinsics, when we can declare the types. + trunc(inF0); + + // TODO: ... add when float1 prototypes are generated + return float3(1,2,3); +} + +float4 VertexShaderFunction4(float4 inF0, float4 inF1, float4 inF2, uint4 inU0, uint4 inU1) +{ + all(inF0); + abs(inF0); + acos(inF0); + any(inF0); + asin(inF0); + asint(inF0); + asuint(inF0); + asfloat(inU0); + // asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics + atan(inF0); + atan2(inF0, inF1); + ceil(inF0); + clamp(inF0, inF1, inF2); + cos(inF0); + cosh(inF0); + countbits(int4(7,3,5,2)); + degrees(inF0); + distance(inF0, inF1); + dot(inF0, inF1); + dst(inF0, inF1); + // EvaluateAttributeAtCentroid(inF0); + // EvaluateAttributeAtSample(inF0, 0); + // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); + exp(inF0); + exp2(inF0); + faceforward(inF0, inF1, inF2); + firstbithigh(7); + firstbitlow(7); + floor(inF0); + // TODO: fma(inD0, inD1, inD2); + fmod(inF0, inF1); + frac(inF0); + isinf(inF0); + isnan(inF0); + ldexp(inF0, inF1); + lerp(inF0, inF1, inF2); + length(inF0); + log(inF0); + log10(inF0); + log2(inF0); + max(inF0, inF1); + min(inF0, inF1); + // TODO: mul(inF0, inF1); + normalize(inF0); + pow(inF0, inF1); + radians(inF0); + reflect(inF0, inF1); + refract(inF0, inF1, 2.0); + reversebits(int4(1,2,3,4)); + round(inF0); + rsqrt(inF0); + saturate(inF0); + sign(inF0); + sin(inF0); + sincos(inF0, inF1, inF2); + sinh(inF0); + smoothstep(inF0, inF1, inF2); + sqrt(inF0); + step(inF0, inF1); + tan(inF0); + tanh(inF0); + // TODO: sampler intrinsics, when we can declare the types. + trunc(inF0); + + // TODO: ... add when float1 prototypes are generated + return float4(1,2,3,4); +} + +// TODO: for mats: +// asfloat(inU0); \ +// asint(inF0); \ +// asuint(inF0); \ + +// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. +#define MATFNS() \ + all(inF0); \ + abs(inF0); \ + acos(inF0); \ + any(inF0); \ + asin(inF0); \ + atan(inF0); \ + atan2(inF0, inF1); \ + ceil(inF0); \ + clamp(inF0, inF1, inF2); \ + cos(inF0); \ + cosh(inF0); \ + degrees(inF0); \ + determinant(inF0); \ + exp(inF0); \ + exp2(inF0); \ + firstbithigh(7); \ + firstbitlow(7); \ + floor(inF0); \ + fmod(inF0, inF1); \ + frac(inF0); \ + ldexp(inF0, inF1); \ + lerp(inF0, inF1, inF2); \ + log(inF0); \ + log10(inF0); \ + log2(inF0); \ + max(inF0, inF1); \ + min(inF0, inF1); \ + pow(inF0, inF1); \ + radians(inF0); \ + round(inF0); \ + rsqrt(inF0); \ + saturate(inF0); \ + sign(inF0); \ + sin(inF0); \ + sincos(inF0, inF1, inF2); \ + sinh(inF0); \ + smoothstep(inF0, inF1, inF2); \ + sqrt(inF0); \ + step(inF0, inF1); \ + tan(inF0); \ + tanh(inF0); \ + transpose(inF0); \ + trunc(inF0); + +// TODO: turn on non-square matrix tests when protos are available. + +float2x2 VertexShaderFunction2x2(float2x2 inF0, float2x2 inF1, float2x2 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS(); + + // TODO: ... add when float1 prototypes are generated + return float2x2(2,2,2,2); +} + +float3x3 VertexShaderFunction3x3(float3x3 inF0, float3x3 inF1, float3x3 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS(); + + // TODO: ... add when float1 prototypes are generated + return float3x3(3,3,3,3,3,3,3,3,3); +} + +float4x4 VertexShaderFunction4x4(float4x4 inF0, float4x4 inF1, float4x4 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS(); + + // TODO: ... add when float1 prototypes are generated + return float4x4(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4); +} + +#define TESTGENMUL(ST, VT, MT) \ + ST r0 = mul(inF0, inF1); \ + VT r1 = mul(inFV0, inF0); \ + VT r2 = mul(inF0, inFV0); \ + ST r3 = mul(inFV0, inFV1); \ + VT r4 = mul(inFM0, inFV0); \ + VT r5 = mul(inFV0, inFM0); \ + MT r6 = mul(inFM0, inF0); \ + MT r7 = mul(inF0, inFM0); \ + MT r8 = mul(inFM0, inFM1); + + +void TestGenMul2(float inF0, float inF1, + float2 inFV0, float2 inFV1, + float2x2 inFM0, float2x2 inFM1) +{ + TESTGENMUL(float, float2, float2x2); +} + +void TestGenMul3(float inF0, float inF1, + float3 inFV0, float3 inFV1, + float3x3 inFM0, float3x3 inFM1) +{ + TESTGENMUL(float, float3, float3x3); +} + +void TestGenMul4(float inF0, float inF1, + float4 inFV0, float4 inFV1, + float4x4 inFM0, float4x4 inFM1) +{ + TESTGENMUL(float, float4, float4x4); +} + +// Test some non-square mats +void TestGenMulNxM(float inF0, float inF1, + float2 inFV2, float3 inFV3, + float2x3 inFM2x3, float3x2 inFM3x2, + float3x3 inFM3x3, float3x4 inFM3x4, + float2x4 inFM2x4) +{ + float r00 = mul(inF0, inF1); // S=S*S + float2 r01 = mul(inFV2, inF0); // V=V*S + float3 r02 = mul(inFV3, inF0); // V=V*S + float2 r03 = mul(inF0, inFV2); // V=S*V + float3 r04 = mul(inF0, inFV3); // V=S*V + float r05 = mul(inFV2, inFV2); // S=V*V + float r06 = mul(inFV3, inFV3); // S=V*V + float3 r07 = mul(inFV2, inFM2x3); // V=V*M (return V dim is Mcols) + float2 r08 = mul(inFV3, inFM3x2); // V=V*M (return V dim is Mcols) + float2 r09 = mul(inFM2x3, inFV3); // V=M*V (return V dim is Mrows) + float3 r10 = mul(inFM3x2, inFV2); // V=M*V (return V dim is Mrows) + float2x3 r11 = mul(inFM2x3, inF0); + float3x2 r12 = mul(inFM3x2, inF0); + float2x2 r13 = mul(inFM2x3, inFM3x2); + float2x3 r14 = mul(inFM2x3, inFM3x3); + float2x4 r15 = mul(inFM2x3, inFM3x4); + float3x4 r16 = mul(inFM3x2, inFM2x4); +} diff --git a/deps/glslang/Test/hlsl.isfinite.frag b/deps/glslang/Test/hlsl.isfinite.frag new file mode 100644 index 00000000..6e40f6a8 --- /dev/null +++ b/deps/glslang/Test/hlsl.isfinite.frag @@ -0,0 +1,18 @@ + +uniform float f; +uniform float2 f2; +uniform float3 f3; + +bool test1(float v) +{ + return !isnan(v) && isfinite(v); +} + +float4 main() : SV_Target0 +{ + isfinite(f); + isfinite(f2); + isfinite(f3); + + return 0; +} diff --git a/deps/glslang/Test/hlsl.layout.frag b/deps/glslang/Test/hlsl.layout.frag new file mode 100644 index 00000000..a4fa5af2 --- /dev/null +++ b/deps/glslang/Test/hlsl.layout.frag @@ -0,0 +1,19 @@ +layout(set=3,binding=5) tbuffer tbufName { + layout(offset = 16) float4 v1; +}; + +layout(push_constant) tbuffer tbufName2 { + float4 v5; +}; + +layout(constant_id=17) const int specConst = 10; + +tbuffer tbufName2 : layout(set=4,binding=7) { + layout(offset = 16) float4 v1PostLayout; +}; + +float4 PixelShaderFunction(float4 input) : COLOR0 +{ + float4 layout = 2.0; + return input + v1 + v5 + v1PostLayout * layout; +} diff --git a/deps/glslang/Test/hlsl.layoutOverride.vert b/deps/glslang/Test/hlsl.layoutOverride.vert new file mode 100644 index 00000000..4c006018 --- /dev/null +++ b/deps/glslang/Test/hlsl.layoutOverride.vert @@ -0,0 +1,7 @@ +layout(set=2,binding=0) Texture2D tex : register(t16); +SamplerState samp; + +float4 main() : SV_Position +{ + return tex.Sample(samp, float2(0.2, 0.3)); +} \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.load.2dms.dx10.frag b/deps/glslang/Test/hlsl.load.2dms.dx10.frag new file mode 100644 index 00000000..29974f58 --- /dev/null +++ b/deps/glslang/Test/hlsl.load.2dms.dx10.frag @@ -0,0 +1,56 @@ +SamplerState g_sSamp : register(s0); + +Texture2DMS g_tTex2dmsf4; +Texture2DMS g_tTex2dmsi4; +Texture2DMS g_tTex2dmsu4; + +Texture2DMSArray g_tTex2dmsf4a; +Texture2DMSArray g_tTex2dmsi4a; +Texture2DMSArray g_tTex2dmsu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +uniform int c1; +uniform int2 c2; +uniform int3 c3; +uniform int4 c4; + +uniform int o1; +uniform int2 o2; +uniform int3 o3; +uniform int4 o4; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // 2DMS, no offset + g_tTex2dmsf4.Load(c2, 3); + g_tTex2dmsi4.Load(c2, 3); + g_tTex2dmsu4.Load(c2, 3); + + // 2DMS, offset + g_tTex2dmsf4.Load(c2, 3, o2); + g_tTex2dmsi4.Load(c2, 3, o2); + g_tTex2dmsu4.Load(c2, 3, o2); + + // 2DMSArray, no offset + g_tTex2dmsf4a.Load(c3, 3); + g_tTex2dmsi4a.Load(c3, 3); + g_tTex2dmsu4a.Load(c3, 3); + + // 2DMSArray, offset + g_tTex2dmsf4a.Load(c3, 3, o2); + g_tTex2dmsi4a.Load(c3, 3, o2); + g_tTex2dmsu4a.Load(c3, 3, o2); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} + diff --git a/deps/glslang/Test/hlsl.load.array.dx10.frag b/deps/glslang/Test/hlsl.load.array.dx10.frag new file mode 100644 index 00000000..253de3e2 --- /dev/null +++ b/deps/glslang/Test/hlsl.load.array.dx10.frag @@ -0,0 +1,71 @@ +SamplerState g_sSamp : register(s0); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +Texture1DArray g_tTex1df4a; +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +uniform int c1; +uniform int2 c2; +uniform int3 c3; +uniform int4 c4; + +uniform int o1; +uniform int2 o2; +uniform int3 o3; +uniform int4 o4; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // 1DArray + g_tTex1df4a.Load(c3); + g_tTex1di4a.Load(c3); + g_tTex1du4a.Load(c3); + + // 2DArray + g_tTex2df4a.Load(c4); + g_tTex2di4a.Load(c4); + g_tTex2du4a.Load(c4); + + // Offset has no Cube or CubeArray forms + + // TODO: + // Load, SampleIndex + // Load, SampleIndex, Offset + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.load.basic.dx10.frag b/deps/glslang/Test/hlsl.load.basic.dx10.frag new file mode 100644 index 00000000..abb594e3 --- /dev/null +++ b/deps/glslang/Test/hlsl.load.basic.dx10.frag @@ -0,0 +1,76 @@ +SamplerState g_sSamp : register(s0); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +Texture1DArray g_tTex1df4a; +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +uniform int c1; +uniform int2 c2; +uniform int3 c3; +uniform int4 c4; + +uniform int o1; +uniform int2 o2; +uniform int3 o3; +uniform int4 o4; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // 1D + g_tTex1df4.Load(c2); + g_tTex1di4.Load(c2); + g_tTex1du4.Load(c2); + + // 2D + g_tTex2df4.Load(c3); + g_tTex2di4.Load(c3); + g_tTex2du4.Load(c3); + + // 3D + g_tTex3df4.Load(c4); + g_tTex3di4.Load(c4); + g_tTex3du4.Load(c4); + + // Offset has no Cube or CubeArray forms + + // TODO: + // Load, SampleIndex + // Load, SampleIndex, Offset + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.load.basic.dx10.vert b/deps/glslang/Test/hlsl.load.basic.dx10.vert new file mode 100644 index 00000000..750b9840 --- /dev/null +++ b/deps/glslang/Test/hlsl.load.basic.dx10.vert @@ -0,0 +1,70 @@ +SamplerState g_sSamp : register(s0); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +Texture1DArray g_tTex1df4a; +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +struct VS_OUTPUT +{ + float4 Pos : SV_Position; +}; + +uniform int c1; +uniform int2 c2; +uniform int3 c3; +uniform int4 c4; + +uniform int o1; +uniform int2 o2; +uniform int3 o3; +uniform int4 o4; + +VS_OUTPUT main() +{ + VS_OUTPUT vsout; + + // 1D + g_tTex1df4.Load(c2); + g_tTex1di4.Load(c2); + g_tTex1du4.Load(c2); + + // 2D + g_tTex2df4.Load(c3); + g_tTex2di4.Load(c3); + g_tTex2du4.Load(c3); + + // 3D + g_tTex3df4.Load(c4); + g_tTex3di4.Load(c4); + g_tTex3du4.Load(c4); + + // Offset has no Cube or CubeArray forms + + vsout.Pos = float4(0,0,0,0); + + return vsout; +} diff --git a/deps/glslang/Test/hlsl.load.buffer.dx10.frag b/deps/glslang/Test/hlsl.load.buffer.dx10.frag new file mode 100644 index 00000000..60a61df6 --- /dev/null +++ b/deps/glslang/Test/hlsl.load.buffer.dx10.frag @@ -0,0 +1,38 @@ +uniform Buffer g_tTexbf4_test : register(t0); + +Buffer g_tTexbf4; // default is float4 +Buffer g_tTexbi4; +Buffer g_tTexbu4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +uniform int c1; +uniform int2 c2; +uniform int3 c3; +uniform int4 c4; + +uniform int o1; +uniform int2 o2; +uniform int3 o3; +uniform int4 o4; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // Buffer + float4 r00 = g_tTexbf4.Load(c1); + int4 r01 = g_tTexbi4.Load(c1); + uint4 r02 = g_tTexbu4.Load(c1); + + // TODO: other types that can be put in sampler buffers, like float2x2, and float3. + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.load.buffer.float.dx10.frag b/deps/glslang/Test/hlsl.load.buffer.float.dx10.frag new file mode 100644 index 00000000..eeea9a63 --- /dev/null +++ b/deps/glslang/Test/hlsl.load.buffer.float.dx10.frag @@ -0,0 +1,38 @@ +uniform Buffer g_tTexbfs_test : register(t0); + +Buffer g_tTexbfs; +Buffer g_tTexbis; +Buffer g_tTexbus; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +uniform int c1; +uniform int2 c2; +uniform int3 c3; +uniform int4 c4; + +uniform int o1; +uniform int2 o2; +uniform int3 o3; +uniform int4 o4; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // Buffer + float r00 = g_tTexbfs.Load(c1); + int r01 = g_tTexbis.Load(c1); + uint r02 = g_tTexbus.Load(c1); + + // TODO: other types that can be put in sampler buffers, like float2x2, and float3. + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.load.offset.dx10.frag b/deps/glslang/Test/hlsl.load.offset.dx10.frag new file mode 100644 index 00000000..bc946eea --- /dev/null +++ b/deps/glslang/Test/hlsl.load.offset.dx10.frag @@ -0,0 +1,76 @@ +SamplerState g_sSamp : register(s0); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +Texture1DArray g_tTex1df4a; +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +uniform int c1; +uniform int2 c2; +uniform int3 c3; +uniform int4 c4; + +uniform int o1; +uniform int2 o2; +uniform int3 o3; +uniform int4 o4; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // 1D + g_tTex1df4.Load(c2, o1); + g_tTex1di4.Load(c2, o1); + g_tTex1du4.Load(c2, o1); + + // 2D + g_tTex2df4.Load(c3, o2); + g_tTex2di4.Load(c3, o2); + g_tTex2du4.Load(c3, o2); + + // 3D + g_tTex3df4.Load(c4, o3); + g_tTex3di4.Load(c4, o3); + g_tTex3du4.Load(c4, o3); + + // Offset has no Cube or CubeArray forms + + // TODO: + // Load, SampleIndex + // Load, SampleIndex, Offset + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.load.offsetarray.dx10.frag b/deps/glslang/Test/hlsl.load.offsetarray.dx10.frag new file mode 100644 index 00000000..12b6a9e5 --- /dev/null +++ b/deps/glslang/Test/hlsl.load.offsetarray.dx10.frag @@ -0,0 +1,69 @@ +SamplerState g_sSamp : register(s0); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +Texture1DArray g_tTex1df4a; +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +uniform int c1; +uniform int2 c2; +uniform int3 c3; +uniform int4 c4; + +uniform int o1; +uniform int2 o2; +uniform int3 o3; +uniform int4 o4; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // 1DArray + g_tTex1df4a.Load(c3, o1); + g_tTex1di4a.Load(c3, o1); + g_tTex1du4a.Load(c3, o1); + + // 2DArray + g_tTex2df4a.Load(c4, o2); + g_tTex2di4a.Load(c4, o2); + g_tTex2du4a.Load(c4, o2); + + // TODO: + // Load, SampleIndex + // Load, SampleIndex, Offset + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.load.rwbuffer.dx10.frag b/deps/glslang/Test/hlsl.load.rwbuffer.dx10.frag new file mode 100644 index 00000000..accd5f0c --- /dev/null +++ b/deps/glslang/Test/hlsl.load.rwbuffer.dx10.frag @@ -0,0 +1,32 @@ + +RWBuffer g_tBuffF; +RWBuffer g_tBuffI; +RWBuffer g_tBuffU; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +uniform int c1; +uniform int2 c2; +uniform int3 c3; +uniform int4 c4; + +uniform int o1; +uniform int2 o2; +uniform int3 o3; +uniform int4 o4; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + g_tBuffF.Load(c1); + g_tBuffU.Load(c1); + g_tBuffI.Load(c1); + + psout.Color = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.load.rwtexture.array.dx10.frag b/deps/glslang/Test/hlsl.load.rwtexture.array.dx10.frag new file mode 100644 index 00000000..38e29096 --- /dev/null +++ b/deps/glslang/Test/hlsl.load.rwtexture.array.dx10.frag @@ -0,0 +1,57 @@ +SamplerState g_sSamp : register(s0); + +RWTexture1D g_tTex1df4 : register(t0); +RWTexture1D g_tTex1di4; +RWTexture1D g_tTex1du4; + +RWTexture2D g_tTex2df4; +RWTexture2D g_tTex2di4; +RWTexture2D g_tTex2du4; + +RWTexture3D g_tTex3df4; +RWTexture3D g_tTex3di4; +RWTexture3D g_tTex3du4; + +RWTexture1DArray g_tTex1df4a; +RWTexture1DArray g_tTex1di4a; +RWTexture1DArray g_tTex1du4a; + +RWTexture2DArray g_tTex2df4a; +RWTexture2DArray g_tTex2di4a; +RWTexture2DArray g_tTex2du4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +uniform int c1; +uniform int2 c2; +uniform int3 c3; +uniform int4 c4; + +uniform int o1; +uniform int2 o2; +uniform int3 o3; +uniform int4 o4; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // 1D + g_tTex1df4a.Load(c2); + g_tTex1di4a.Load(c2); + g_tTex1du4a.Load(c2); + + // 2D + g_tTex2df4a.Load(c3); + g_tTex2di4a.Load(c3); + g_tTex2du4a.Load(c3); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.load.rwtexture.dx10.frag b/deps/glslang/Test/hlsl.load.rwtexture.dx10.frag new file mode 100644 index 00000000..c0950776 --- /dev/null +++ b/deps/glslang/Test/hlsl.load.rwtexture.dx10.frag @@ -0,0 +1,62 @@ +SamplerState g_sSamp : register(s0); + +RWTexture1D g_tTex1df4 : register(t0); +RWTexture1D g_tTex1di4; +RWTexture1D g_tTex1du4; + +RWTexture2D g_tTex2df4; +RWTexture2D g_tTex2di4; +RWTexture2D g_tTex2du4; + +RWTexture3D g_tTex3df4; +RWTexture3D g_tTex3di4; +RWTexture3D g_tTex3du4; + +RWTexture1DArray g_tTex1df4a; +RWTexture1DArray g_tTex1di4a; +RWTexture1DArray g_tTex1du4a; + +RWTexture2DArray g_tTex2df4a; +RWTexture2DArray g_tTex2di4a; +RWTexture2DArray g_tTex2du4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +uniform int c1; +uniform int2 c2; +uniform int3 c3; +uniform int4 c4; + +uniform int o1; +uniform int2 o2; +uniform int3 o3; +uniform int4 o4; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // 1D + g_tTex1df4.Load(c1); + g_tTex1di4.Load(c1); + g_tTex1du4.Load(c1); + + // 2D + g_tTex2df4.Load(c2); + g_tTex2di4.Load(c2); + g_tTex2du4.Load(c2); + + // 3D + g_tTex3df4.Load(c3); + g_tTex3di4.Load(c3); + g_tTex3du4.Load(c3); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.localStructuredBuffer.comp b/deps/glslang/Test/hlsl.localStructuredBuffer.comp new file mode 100644 index 00000000..34e06e00 --- /dev/null +++ b/deps/glslang/Test/hlsl.localStructuredBuffer.comp @@ -0,0 +1,4 @@ +RWStructuredBuffer srt0; +void main() { + RWStructuredBuffer srt0Local = srt0; +} \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.logical.binary.frag b/deps/glslang/Test/hlsl.logical.binary.frag new file mode 100644 index 00000000..06bc9f2f --- /dev/null +++ b/deps/glslang/Test/hlsl.logical.binary.frag @@ -0,0 +1,21 @@ +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +uniform int ival; +uniform int4 ival4; +uniform float fval; +uniform float4 fval4; + +PS_OUTPUT main() +{ + if (ival && fval); + if (ival || fval); + + PS_OUTPUT psout; + psout.Color = 1.0; + return psout; +} + + diff --git a/deps/glslang/Test/hlsl.logical.binary.vec.frag b/deps/glslang/Test/hlsl.logical.binary.vec.frag new file mode 100644 index 00000000..e94c8f5b --- /dev/null +++ b/deps/glslang/Test/hlsl.logical.binary.vec.frag @@ -0,0 +1,24 @@ +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +uniform bool4 b4a, b4b; +uniform bool b1a, b1b; + +PS_OUTPUT main() +{ + bool4 r00 = !b4a; + bool4 r01 = b4a && b4b; // vec, vec + bool4 r02 = b4a || b4b; // vec, vec + + bool4 r10 = b1a && b4b; // scalar, vec + bool4 r11 = b1a || b4b; // scalar, vec + + bool4 r20 = b4a && b1b; // vec, scalar + bool4 r21 = b4a || b1b; // vec, scalar + + PS_OUTPUT psout; + psout.Color = r00 || r01 || r02 || r10 || r11 || r20 || r21; + return psout; +} diff --git a/deps/glslang/Test/hlsl.logical.unary.frag b/deps/glslang/Test/hlsl.logical.unary.frag new file mode 100644 index 00000000..cbcb3bfc --- /dev/null +++ b/deps/glslang/Test/hlsl.logical.unary.frag @@ -0,0 +1,29 @@ +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +uniform int ival; +uniform int4 ival4; +uniform float fval; +uniform float4 fval4; + +PS_OUTPUT main() +{ + !ival; // scalar int + !ival4; // vector int + + !fval; // scalar float + !fval4; // vector float + + if (ival); + if (fval); + if (!ival); + if (!fval); + + PS_OUTPUT psout; + psout.Color = 1.0; + return psout; +} + + diff --git a/deps/glslang/Test/hlsl.logicalConvert.frag b/deps/glslang/Test/hlsl.logicalConvert.frag new file mode 100644 index 00000000..b353eb1e --- /dev/null +++ b/deps/glslang/Test/hlsl.logicalConvert.frag @@ -0,0 +1,23 @@ +float4 main() : SV_TARGET +{ + if (!(0) && (0) || (!1)) + return 0.0.xxxx; + if (0) + return 0.0.xxxx; + if (!(bool)0) + return 0.0.xxxx; + if (!0) + return 0.0.xxxx; + if (!(bool)1) + return 0.0.xxxx; + if (!1) + return 0.0.xxxx; + if (0 || 1) + return 0.0.xxxx; + if (1 && 0) + return 0.0.xxxx; + if (1 || false) + return 0.0.xxxx; + if (true && 1) + return 0.0.xxxx; +} \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.loopattr.frag b/deps/glslang/Test/hlsl.loopattr.frag new file mode 100644 index 00000000..5b4d374f --- /dev/null +++ b/deps/glslang/Test/hlsl.loopattr.frag @@ -0,0 +1,14 @@ + +float4 main() : SV_Target0 +{ + // Unroll hint + [unroll(5) ] for (int x=0; x<5; ++x); + + // Don't unroll hint + [loop] for (int y=0; y<5; ++y); + + // No hint + for (int z=0; z<5; ++z); + + return 0; +} diff --git a/deps/glslang/Test/hlsl.matNx1.frag b/deps/glslang/Test/hlsl.matNx1.frag new file mode 100644 index 00000000..515bd470 --- /dev/null +++ b/deps/glslang/Test/hlsl.matNx1.frag @@ -0,0 +1,31 @@ + +void TestMatNx1() +{ + float1x1 f1x1; + float2x1 f2x1; + float3x1 f3x1; + float4x1 f4x1; + + float1x2 f1x2; + float1x3 f1x3; + float1x4 f1x4; + + float1x1 r00 = transpose(f1x1); + float1x2 r01 = transpose(f2x1); + float1x3 r02 = transpose(f3x1); + float1x4 r03 = transpose(f4x1); + + float1x1 r10 = transpose(f1x1); + float2x1 r11 = transpose(f1x2); + float3x1 r12 = transpose(f1x3); + float4x1 r13 = transpose(f1x4); +} + +struct PS_OUTPUT { float4 color : SV_Target0; }; + +PS_OUTPUT main() +{ + PS_OUTPUT ps_output; + ps_output.color = 1.0; + return ps_output; +}; diff --git a/deps/glslang/Test/hlsl.matType.bool.frag b/deps/glslang/Test/hlsl.matType.bool.frag new file mode 100644 index 00000000..e4a62e36 --- /dev/null +++ b/deps/glslang/Test/hlsl.matType.bool.frag @@ -0,0 +1,53 @@ + +void TestBoolMatTypes() +{ + bool1x1 b1x1; + bool2x1 b2x1; + bool3x1 b3x1; + bool4x1 b4x1; + + bool1x2 b1x2; + bool2x2 b2x2; + bool3x2 b3x2; + bool4x2 b4x2; + + bool1x3 b1x3; + bool2x3 b2x3; + bool3x3 b3x3; + bool4x3 b4x3; + + bool1x4 b1x4; + bool2x4 b2x4; + bool3x4 b3x4; + bool4x4 b4x4; + + // TODO: Currently SPIR-V disallows Nx1 or 1xN mats. + bool1x1 r00 = transpose(b1x1); + bool1x2 r01 = transpose(b2x1); + bool1x3 r02 = transpose(b3x1); + bool1x4 r03 = transpose(b4x1); + + bool2x1 r10 = transpose(b1x2); + bool2x2 r11 = transpose(b2x2); + bool2x3 r12 = transpose(b3x2); + bool2x4 r13 = transpose(b4x2); + + bool3x1 r20 = transpose(b1x3); + bool3x2 r21 = transpose(b2x3); + bool3x3 r22 = transpose(b3x3); + bool3x4 r23 = transpose(b4x3); + + bool4x1 r30 = transpose(b1x4); + bool4x2 r31 = transpose(b2x4); + bool4x3 r32 = transpose(b3x4); + bool4x4 r33 = transpose(b4x4); +} + +struct PS_OUTPUT { float4 color : SV_Target0; }; + +PS_OUTPUT main() +{ + PS_OUTPUT ps_output; + ps_output.color = float4(0,0,0,0); + return ps_output; +}; diff --git a/deps/glslang/Test/hlsl.matType.frag b/deps/glslang/Test/hlsl.matType.frag new file mode 100644 index 00000000..ee7c0476 --- /dev/null +++ b/deps/glslang/Test/hlsl.matType.frag @@ -0,0 +1,11 @@ +float1 f1 = float1(1.0); +float1x1 fmat11; +float4x1 fmat41; +float1x2 fmat12; +double2x3 dmat23; +int4x4 int44; + +float1 ShaderFunction(float1 inFloat1, float inScalar) : COLOR0 +{ + return inFloat1; +} diff --git a/deps/glslang/Test/hlsl.matType.int.frag b/deps/glslang/Test/hlsl.matType.int.frag new file mode 100644 index 00000000..09e9f2ad --- /dev/null +++ b/deps/glslang/Test/hlsl.matType.int.frag @@ -0,0 +1,97 @@ + +void TestIntMatTypes() +{ + int1x1 i1x1; + int2x1 i2x1; + int3x1 i3x1; + int4x1 i4x1; + + int1x2 i1x2; + int2x2 i2x2; + int3x2 i3x2; + int4x2 i4x2; + + int1x3 i1x3; + int2x3 i2x3; + int3x3 i3x3; + int4x3 i4x3; + + int1x4 i1x4; + int2x4 i2x4; + int3x4 i3x4; + int4x4 i4x4; + + // TODO: Currently SPIR-V disallows Nx1 or 1xN mats. + int1x1 r00 = transpose(i1x1); + int1x2 r01 = transpose(i2x1); + int1x3 r02 = transpose(i3x1); + int1x4 r03 = transpose(i4x1); + + int2x1 r10 = transpose(i1x2); + int2x2 r11 = transpose(i2x2); + int2x3 r12 = transpose(i3x2); + int2x4 r13 = transpose(i4x2); + + int3x1 r20 = transpose(i1x3); + int3x2 r21 = transpose(i2x3); + int3x3 r22 = transpose(i3x3); + int3x4 r23 = transpose(i4x3); + + int4x1 r30 = transpose(i1x4); + int4x2 r31 = transpose(i2x4); + int4x3 r32 = transpose(i3x4); + int4x4 r33 = transpose(i4x4); +} + +void TestUintMatTypes() +{ + uint1x1 u1x1; + uint2x1 u2x1; + uint3x1 u3x1; + uint4x1 u4x1; + + uint1x2 u1x2; + uint2x2 u2x2; + uint3x2 u3x2; + uint4x2 u4x2; + + uint1x3 u1x3; + uint2x3 u2x3; + uint3x3 u3x3; + uint4x3 u4x3; + + uint1x4 u1x4; + uint2x4 u2x4; + uint3x4 u3x4; + uint4x4 u4x4; + + // TODO: Currently SPIR-V disallows Nx1 or 1xN mats. + uint1x1 r00 = transpose(u1x1); + uint1x2 r01 = transpose(u2x1); + uint1x3 r02 = transpose(u3x1); + uint1x4 r03 = transpose(u4x1); + + uint2x1 r10 = transpose(u1x2); + uint2x2 r11 = transpose(u2x2); + uint2x3 r12 = transpose(u3x2); + uint2x4 r13 = transpose(u4x2); + + uint3x1 r20 = transpose(u1x3); + uint3x2 r21 = transpose(u2x3); + uint3x3 r22 = transpose(u3x3); + uint3x4 r23 = transpose(u4x3); + + uint4x1 r30 = transpose(u1x4); + uint4x2 r31 = transpose(u2x4); + uint4x3 r32 = transpose(u3x4); + uint4x4 r33 = transpose(u4x4); +} + +struct PS_OUTPUT { float4 color : SV_Target0; }; + +PS_OUTPUT main() +{ + PS_OUTPUT ps_output; + ps_output.color = float4(0,0,0,0); + return ps_output; +}; diff --git a/deps/glslang/Test/hlsl.matpack-1.frag b/deps/glslang/Test/hlsl.matpack-1.frag new file mode 100644 index 00000000..5d02a3e4 --- /dev/null +++ b/deps/glslang/Test/hlsl.matpack-1.frag @@ -0,0 +1,27 @@ +struct MyBuffer1 +{ + column_major float4x4 mat1; + row_major float4x4 mat2; + float4 vec1; + float foo; +}; + +struct MyBuffer2 +{ + row_major float4x4 mat1; + float4 vec1; +}; + +cbuffer Example +{ + MyBuffer1 g_MyBuffer1; + MyBuffer2 g_MyBuffer2; + column_major float4x4 mat1a; +}; + +float4 main() : SV_Target0 +{ + return mul(g_MyBuffer1.mat1, g_MyBuffer1.vec1) + + mul(g_MyBuffer2.mat1, g_MyBuffer2.vec1); +} + diff --git a/deps/glslang/Test/hlsl.matpack-pragma.frag b/deps/glslang/Test/hlsl.matpack-pragma.frag new file mode 100644 index 00000000..a9a28335 --- /dev/null +++ b/deps/glslang/Test/hlsl.matpack-pragma.frag @@ -0,0 +1,33 @@ +#pragma pack_matrix(row_major) + +struct MyBuffer1 +{ + column_major float4x4 mat1; + row_major float4x4 mat2; + /*floating*/ float4x4 mat3; +}; + +#pragma pack_matrix(column_major) + +struct MyBuffer2 +{ + column_major float4x4 mat1; + row_major float4x4 mat2; + /*floating*/ float4x4 mat3; +}; + +#pragma pack_matrix(random_string_foo) + +cbuffer Example +{ + MyBuffer1 g_MyBuffer1; + MyBuffer2 g_MyBuffer2; + column_major float4x4 mat1a; +}; + +float4 main() : SV_Target0 +{ + return + g_MyBuffer1.mat1[0] + g_MyBuffer1.mat2[0] + g_MyBuffer1.mat3[0] + + g_MyBuffer2.mat1[0] + g_MyBuffer2.mat2[0] + g_MyBuffer2.mat3[0]; +} diff --git a/deps/glslang/Test/hlsl.matrixSwizzle.vert b/deps/glslang/Test/hlsl.matrixSwizzle.vert new file mode 100644 index 00000000..c06996b3 --- /dev/null +++ b/deps/glslang/Test/hlsl.matrixSwizzle.vert @@ -0,0 +1,33 @@ +void ShaderFunction(float inf) : COLOR0 +{ + float3x4 m; + + // tests that convert to non-matrix swizzles + + m._34 = 1.0; // AST should have a normal component select + m._m23 = 2.0; // same code + m[2][3] = 2.0; // same code + + m._11_12_13_14 = float4(3.0); // AST should have normal column selection (first row) + m._m10_m11_m12_m13 = float4(3.0); // AST should have normal column selection (second row) + m[1] = float4(3.0); // same code + + // tests that stay as matrix swizzles + + float3 f3; + m._11_22_23 = f3; + m._21_12_31 = float3(5.0); + m._11_12_21 = 2 * f3; + + // r-value + f3 = m._21_12_31; +} + +float3x3 createMat3x3(float3 a, float3 b, float3 c) +{ + float3x3 m; + m._11_21_31 = a; + m._12_22_32 = b; + m._13_23_33 = c; + return m; +} diff --git a/deps/glslang/Test/hlsl.matrixindex.frag b/deps/glslang/Test/hlsl.matrixindex.frag new file mode 100644 index 00000000..f352c0e5 --- /dev/null +++ b/deps/glslang/Test/hlsl.matrixindex.frag @@ -0,0 +1,49 @@ +uniform int idx; +uniform float3x2 um; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +PS_OUTPUT main() +{ + // matrices of 3 rows, 2 columns (regardless of row vs col major storage) + const float3x2 m1 = { { 10, 11 }, // row-wise initialization + { 12, 13 }, + { 14, 15 } }; + + const float3x2 m2 = { 20, 21, 22, 23, 24, 25 }; // component-wise matrix initialization is allowed + const float3x2 m3 = { 30, 31, 33, 33, 34, 35 }; // component-wise matrix initialization is allowed + + // These can be observed in the AST post-const folding to ensure we obtain the right value, + // as given in comments to the right of each line. Note that the first indirection into a + // matrix returns a row vector. + float e1_00 = m1[0][0]; // 10 + float e1_01 = m1[0][1]; // 11 + float e1_10 = m1[1][0]; // 12 + float e1_11 = m1[1][1]; // 13 + float e1_20 = m1[2][0]; // 14 + float e1_21 = m1[2][1]; // 15 + + float e2_00 = m2[0][0]; // 20 + float e2_01 = m2[0][1]; // 21 + float e2_10 = m2[1][0]; // 22 + float e2_11 = m2[1][1]; // 23 + float e2_20 = m2[2][0]; // 24 + float e2_21 = m2[2][1]; // 25 + + // float e3a_00 = m3._m00; // TODO... also as an lvalue for a non-const matrix + // float e3b_00 = m3._11; // TODO... also as an lvalue for a non-const matrix + + float2 r0a = m1[0]; // row0: 10,11: types must match: constant index into constant + float2 r1a = m1[1]; // row1: 12,13: ... + float2 r2a = m1[2]; // row2: 14,15: ... + + float2 r0b = m2[idx]; // types should match: variable index into constant + float2 r0c = um[idx]; // types should match: variable index into variable + + PS_OUTPUT psout; + psout.Color = e2_11; // 23 + return psout; +} diff --git a/deps/glslang/Test/hlsl.max.frag b/deps/glslang/Test/hlsl.max.frag new file mode 100644 index 00000000..6d1ea0b1 --- /dev/null +++ b/deps/glslang/Test/hlsl.max.frag @@ -0,0 +1,4 @@ +float4 PixelShaderFunction(float4 input1, float4 input2) : COLOR0 +{ + return max(input1, input2); +} diff --git a/deps/glslang/Test/hlsl.memberFunCall.frag b/deps/glslang/Test/hlsl.memberFunCall.frag new file mode 100644 index 00000000..27d3f6e0 --- /dev/null +++ b/deps/glslang/Test/hlsl.memberFunCall.frag @@ -0,0 +1,16 @@ +float method3(float a) { return 1.0; } + +struct myContext { + float method1() { return method2(); } + float method2() { return method3(1.0); } + float method3(float a) { return method4(a, a); } + float method4(float a, float b) { return a + b + f; } + float f; +}; + +float4 main() : SV_TARGET0 +{ + myContext context; + context.f = 3.0; + return (float4)context.method1(); +} diff --git a/deps/glslang/Test/hlsl.mintypes.frag b/deps/glslang/Test/hlsl.mintypes.frag new file mode 100644 index 00000000..ad47e68e --- /dev/null +++ b/deps/glslang/Test/hlsl.mintypes.frag @@ -0,0 +1,49 @@ +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +uniform min16float b1a, b1b; + +PS_OUTPUT main() +{ + min16float mf16; + min16float1 mf16_1; + min16float2 mf16_2; + min16float3 mf16_3; + min16float4 mf16_4; + + min10float mf10; + min10float1 mf10_1; + min10float2 mf10_2; + min10float3 mf10_3; + min10float4 mf12_4; + + min16int mi16; + min16int1 mi16_1; + min16int2 mi16_2; + min16int3 mi16_3; + min16int4 mi16_4; + + min12int mi12; + min12int1 mi12_1; + min12int2 mi12_2; + min12int3 mi12_3; + min12int4 mi12_4; + + min16uint mu16; + min16uint1 mu16_1; + min16uint2 mu16_2; + min16uint3 mu16_3; + min16uint4 mu16_4; + + mf16_2 + mf16; + mf10_2 + mf10; + mi16_2 + mi16; + mi12_2 + mi12; + mu16_2 + mu16; + + PS_OUTPUT psout; + psout.Color = 0; + return psout; +} diff --git a/deps/glslang/Test/hlsl.mip.negative.frag b/deps/glslang/Test/hlsl.mip.negative.frag new file mode 100644 index 00000000..900d3850 --- /dev/null +++ b/deps/glslang/Test/hlsl.mip.negative.frag @@ -0,0 +1,9 @@ +Texture2D g_tTex2df4; + +float4 main() : SV_Target0 +{ + g_tTex2df4.mips.mips[2][uint2(3, 4)]; // error to chain like this + + return 0; +} + diff --git a/deps/glslang/Test/hlsl.mip.negative2.frag b/deps/glslang/Test/hlsl.mip.negative2.frag new file mode 100644 index 00000000..c07179eb --- /dev/null +++ b/deps/glslang/Test/hlsl.mip.negative2.frag @@ -0,0 +1,9 @@ +Texture2D g_tTex2df4; + +float4 main() : SV_Target0 +{ + g_tTex2df4.r[2][uint2(3, 4)]; // '.r' not valid on texture object + + return 0; +} + diff --git a/deps/glslang/Test/hlsl.mip.operator.frag b/deps/glslang/Test/hlsl.mip.operator.frag new file mode 100644 index 00000000..af4f1501 --- /dev/null +++ b/deps/glslang/Test/hlsl.mip.operator.frag @@ -0,0 +1,14 @@ +Texture2DArray g_tTex2df4a; +Texture2D g_tTex2df4; + +float4 main() : SV_Target0 +{ + return g_tTex2df4.mips[2][uint2(3, 4)] + + + // test float->uint cast on the mip arg + g_tTex2df4a.mips[5.2][uint3(6, 7, 8)] + + + // Test nesting involving .mips operators: + // ....outer operator mip level...... .....outer operator coordinate.... + g_tTex2df4.mips[ g_tTex2df4.mips[9][uint2(10,11)][0] ][ g_tTex2df4.mips[13][uint2(14,15)].xy ]; +} diff --git a/deps/glslang/Test/hlsl.mul-truncate.frag b/deps/glslang/Test/hlsl.mul-truncate.frag new file mode 100644 index 00000000..7ce2c22d --- /dev/null +++ b/deps/glslang/Test/hlsl.mul-truncate.frag @@ -0,0 +1,38 @@ + +// Test v*v, v*m, m*v, and m*m argument clamping. + +cbuffer Matrix +{ + float4x4 m44; + float4x3 m43; + float3x4 m34; + float3x3 m33; + float2x4 m24; + float4x2 m42; + float4 v4; + float3 v3; + float2 v2; +} + +float4 main() : SV_Target0 +{ + // v*v: + float r00 = mul(v2, v3); // float = float2*float3; // clamp to float2 dot product + float r01 = mul(v4, v2); // float = float4*float2; // clamp to float2 dot product + + // v*m + float4 r10 = mul(v3, m44); // float4 = float3 * float4x4; // clamp mat to float3x4; + float4 r11 = mul(v4, m34); // truncate vector to vec3 + + // m*v + float4 r20 = mul(m44, v3); // float4 = float4x4 * float3; // clamp mat to float4x3; + float4 r21 = mul(m43, v4); // truncate vector to vec3 + + // m*m + float2x3 r30 = mul(m24, m33); // float2x3 = float2x4 * float3x3; + float3x4 r31 = mul(m33, m24); // float3x4 = float3x3 * float2x4; + float3x2 r32 = mul(m33, m42); // float3x2 = float3x3 * float4x2; + float4x3 r33 = mul(m42, m33); // float4x3 = float4x2 * float3x3; + + return r10 + r11 + r20 + r21 + r00 + r01 + r30[0].x + r31[0] + r32[0].x + transpose(r33)[0]; +} diff --git a/deps/glslang/Test/hlsl.multiDescriptorSet.frag b/deps/glslang/Test/hlsl.multiDescriptorSet.frag new file mode 100644 index 00000000..6c4be21e --- /dev/null +++ b/deps/glslang/Test/hlsl.multiDescriptorSet.frag @@ -0,0 +1,45 @@ +Texture2D txDiffuseA : register( t0 ); +Texture2D txDiffuseB : register( t1 ); + +SamplerState samLinearA : register( s0 ); +SamplerState samLinearB : register( s1 ); + +cbuffer cbNeverChanges : register( b0 ) +{ + matrix View; +}; + +cbuffer cbChangeOnResize : register( b1 ) +{ + matrix Projection; +}; + +cbuffer cbChangesEveryFrame : register( b2 ) +{ + matrix World; + float4 vMeshColor; +}; + + +struct VS_INPUT +{ + float4 Pos : POSITION; + float2 Tex : TEXCOORD0; +}; + +struct PS_INPUT +{ + float4 Pos : SV_POSITION; + float2 Tex : TEXCOORD0; +}; + + +float4 main( PS_INPUT input) : SV_Target +{ + PS_INPUT output = (PS_INPUT)0; + output.Pos = mul( input.Pos, World ); + output.Pos = mul( output.Pos, View ); + output.Pos = mul( output.Pos, Projection ); + output.Tex = input.Tex; + return txDiffuseA.Sample( samLinearA, output.Tex ) * vMeshColor; +} diff --git a/deps/glslang/Test/hlsl.multiEntry.vert b/deps/glslang/Test/hlsl.multiEntry.vert new file mode 100644 index 00000000..d155c26d --- /dev/null +++ b/deps/glslang/Test/hlsl.multiEntry.vert @@ -0,0 +1,11 @@ +Buffer Position; + +float4 FakeEntrypoint(uint Index : SV_VERTEXID) : SV_POSITION +{ + return Position.Load(Index); +} + +float4 RealEntrypoint(uint Index : SV_VERTEXID) : SV_POSITION +{ + return FakeEntrypoint(Index); +} \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.multiReturn.frag b/deps/glslang/Test/hlsl.multiReturn.frag new file mode 100644 index 00000000..fdab7721 --- /dev/null +++ b/deps/glslang/Test/hlsl.multiReturn.frag @@ -0,0 +1,19 @@ +struct S { + float f; + float3 v; + float3x3 m; +}; + +cbuffer bufName { + S s; +}; + +S foo() +{ + return s; +} + +void main() +{ + foo(); +} diff --git a/deps/glslang/Test/hlsl.namespace.frag b/deps/glslang/Test/hlsl.namespace.frag new file mode 100644 index 00000000..76c3062d --- /dev/null +++ b/deps/glslang/Test/hlsl.namespace.frag @@ -0,0 +1,23 @@ +static float4 v1; +static float4 v2; + +namespace N1 { + float4 getVec() { return v1; } +} + +namespace N2 { + static float gf; + float4 getVec() { return v2; } + namespace N3 { + float4 getVec() { return v2; } + + class C1 { + float4 getVec() { return v2; } + }; + } +} + +float4 main() : SV_Target0 +{ + return N1::getVec() + N2::getVec() + N2::N3::getVec() + N2::N3::C1::getVec() * N2::gf; +} diff --git a/deps/glslang/Test/hlsl.noSemantic.functionality1.comp b/deps/glslang/Test/hlsl.noSemantic.functionality1.comp new file mode 100644 index 00000000..ac9a7a93 --- /dev/null +++ b/deps/glslang/Test/hlsl.noSemantic.functionality1.comp @@ -0,0 +1,7 @@ +AppendStructuredBuffer Buf : register(u0); + +[numthreads(1, 1, 1)] +void main() +{ + Buf.Append(1.0f.xxxx); +} \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.nonint-index.frag b/deps/glslang/Test/hlsl.nonint-index.frag new file mode 100644 index 00000000..c7a751e3 --- /dev/null +++ b/deps/glslang/Test/hlsl.nonint-index.frag @@ -0,0 +1,9 @@ +static const float array[3] = { 1, 2, 3 }; + +float main(float input : IN) : SV_Target0 +{ + // non-integer indexes get converted to uints: + // uint(input) 3.0 2.0 1.0 + return array[input] + array[2.0] + array[true] + array[false]; +} + diff --git a/deps/glslang/Test/hlsl.nonstaticMemberFunction.frag b/deps/glslang/Test/hlsl.nonstaticMemberFunction.frag new file mode 100644 index 00000000..3655ed0f --- /dev/null +++ b/deps/glslang/Test/hlsl.nonstaticMemberFunction.frag @@ -0,0 +1,35 @@ +static float2 i = float2(1.0, 2.0); + +struct type1 +{ + void setmem(float4 m) { memVar = m; } + void seti(int si) { i = si; } + float4 memVar; + float4 memFun(float4 a) : SV_Position + { + return i * a + memVar; + } + int memFun(int a) : SV_Position + { + return i + a - memVar.z; + } + int i; +}; + +static float2 j = i; + +struct type2 +{ + float2 memFun() { return i; } +}; + +float4 main() : SV_Target0 +{ + type1 test; + test.setmem(float4(2.0,2.0,2.0,2.0)); + test.seti(17); + float4 f4 = float4(1.0,1.0,1.0,1.0); + f4 += test.memFun(float4(5.0f,5.0f,5.0f,5.0f)); + f4 += test.memFun(7); + return f4; +} diff --git a/deps/glslang/Test/hlsl.numericsuffixes.frag b/deps/glslang/Test/hlsl.numericsuffixes.frag new file mode 100644 index 00000000..bccb786d --- /dev/null +++ b/deps/glslang/Test/hlsl.numericsuffixes.frag @@ -0,0 +1,24 @@ + +struct PS_OUTPUT { float4 color : SV_Target0; }; + +PS_OUTPUT main() +{ + // Test numeric suffixes + float r00 = 1.0f; // float + uint r01 = 1u; // lower uint + uint r02 = 2U; // upper uint + uint r03 = 0xabcu; // lower hex uint + uint r04 = 0xABCU; // upper hex uint (upper 0X is not accepted) + int r05 = 5l; // lower long int + int r06 = 6L; // upper long int + int r07 = 071; // octal + uint r08 = 072u; // unsigned octal + float r09 = 1.h; // half + float r10 = 1.H; // half + float r11 = 1.1h; // half + float r12 = 1.1H; // half + + PS_OUTPUT ps_output; + ps_output.color = r07; // gets 71 octal = 57 decimal + return ps_output; +} diff --git a/deps/glslang/Test/hlsl.numthreads.comp b/deps/glslang/Test/hlsl.numthreads.comp new file mode 100644 index 00000000..0871d3f7 --- /dev/null +++ b/deps/glslang/Test/hlsl.numthreads.comp @@ -0,0 +1,11 @@ + +[numthreads(8,8,1)] +void main(uint3 tid : SV_DispatchThreadID ) +{ +} + +[numthreads(1,4,8)] +void main_aux2(uint3 tid : SV_DispatchThreadID ) +{ +} + diff --git a/deps/glslang/Test/hlsl.opaque-type-bug.frag b/deps/glslang/Test/hlsl.opaque-type-bug.frag new file mode 100644 index 00000000..f4ccaea2 --- /dev/null +++ b/deps/glslang/Test/hlsl.opaque-type-bug.frag @@ -0,0 +1,16 @@ + +Texture2D MyTexture : register(t0); + +//---------------------------------------------------------------------------------------- +void TexFunc(in const Texture2D t2D, out float3 RGB) +{ + RGB = 0; +} + +//----------------------------------------------------------------------------------- +void main() +{ + float3 final_RGB; + + TexFunc(MyTexture, final_RGB); +} diff --git a/deps/glslang/Test/hlsl.overload.frag b/deps/glslang/Test/hlsl.overload.frag new file mode 100644 index 00000000..b5ddf493 --- /dev/null +++ b/deps/glslang/Test/hlsl.overload.frag @@ -0,0 +1,142 @@ +// function selection under type conversion +void foo1(double a, bool b) {} +void foo1(double a, uint b) {} +void foo1(double a, int b) {} +void foo1(double a, float b) {} +void foo1(double a, double b){} + +// uint -> int +void foo2(int a, bool b) {} +void foo2(int a, uint b) {} +void foo2(int a, int b) {} +void foo2(int a, float b) {} +void foo2(int a, double b){} + +// everything can promote +void foo3(bool b) {} +void foo4(uint b) {} +void foo5(int b) {} +void foo6(float b) {} +void foo7(double b){} + +// shorter forward chain better than longer or backward chain +void foo8(float) {} +void foo8(double) {} +void foo9(int) {} +void foo9(uint) {} +void foo10(bool) {} +void foo10(int) {} + +// shape change is worse +void foo11(float3) {} +void foo11(double) {} +void foo11(int3) {} +void foo11(uint) {} +void foo12(float1) {} +void foo12(double3) {} +void foo16(uint) {} +void foo16(uint2) {} + +// shape change +void foo13(float3) {} +void foo14(int1) {} +void foo15(bool1) {} + +float4 PixelShaderFunction(float4 input) : COLOR0 +{ + bool b; + double d; + uint u; + int i; + float f; + + foo1(d, b); + foo1(d, d); + foo1(d, u); + foo1(d, i); + foo1(d, f); + + foo1(f, b); + foo1(f, d); + foo1(f, u); + foo1(f, i); + foo1(f, f); + + foo1(u, b); + foo1(u, d); + foo1(u, u); + foo1(u, i); + foo1(u, f); + + foo1(i, b); + foo1(i, d); + foo1(i, u); + foo1(i, i); + foo1(i, f); + + foo2(u, b); + foo2(u, d); + foo2(u, u); + foo2(u, i); + foo2(u, f); + + foo2(i, b); + foo2(i, d); + foo2(i, u); + foo2(i, i); + foo2(i, f); + + foo3(b); + foo3(d); + foo3(u); + foo3(i); + foo3(f); + + foo4(b); + foo4(d); + foo4(u); + foo4(i); + foo4(f); + + foo5(b); + foo5(d); + foo5(u); + foo5(i); + foo5(f); + + foo6(b); + foo6(d); + foo6(u); + foo6(i); + foo6(f); + + foo7(b); + foo7(d); + foo7(u); + foo7(i); + foo7(f); + + foo8(b); + foo8(u); + foo8(i); + + foo9(b); + foo9(f); + foo9(d); + + foo10(u); + foo10(f); + foo10(d); + + foo11(b); + foo11(f); + foo12(float3(f)); + foo16(int2(i,i)); + + foo13(f); + foo14(int4(i)); + foo15(b); + foo15(bool3(b)); + + return input; +} diff --git a/deps/glslang/Test/hlsl.params.default.frag b/deps/glslang/Test/hlsl.params.default.frag new file mode 100644 index 00000000..42ad84f8 --- /dev/null +++ b/deps/glslang/Test/hlsl.params.default.frag @@ -0,0 +1,51 @@ +uniform int4 ui4; + +static const int cia = -4; +static const int cib = -42; + +// ERROR: Ambiguous with fn1 below. +// int4 fn1(int4 p0) { return int4(1,2,3,4); } + +int4 fn1(int4 p0, bool b1, bool b2 = false) { + return p0; +} + +int4 fn1(int4 p0, + int4 p1 : FOO = int4(-1,-2,-3, cia), + int p2[2] : BAR = { int(1), 2 }, + int p3 = abs(cib) ) +{ + return p0 + p1 + p2[0] + p3; +} + +// These should not be ambiguous if given either an int or a float explicit second parameter. +int4 fn2(int4 p0, int x = 3) +{ + return int4(10,11,12,13); +} + +int4 fn2(int4 p0, float x = sin(3.3)) // OK to have a const expression as a default value +{ + return p0 + int4(20,21,22,23); +} + +void fn3(int p0 = 3) { } + + +int4 main() : SV_Target0 +{ + int myarray[2] = {30,31}; + + fn3(); + fn3(5); + + return fn1(100) + + fn1(101, ui4) + + fn1(102, ui4, myarray) + + fn1(103, ui4, myarray, 99) + + fn1(104, false) + + fn1(105, false, true) + + + fn2(110, 11.11) + // calls int4, float form + fn2(111, 12); // calls int4, int form +} diff --git a/deps/glslang/Test/hlsl.params.default.negative.frag b/deps/glslang/Test/hlsl.params.default.negative.frag new file mode 100644 index 00000000..c9ff330b --- /dev/null +++ b/deps/glslang/Test/hlsl.params.default.negative.frag @@ -0,0 +1,50 @@ +uniform int4 ui4; +uniform float ufvar; + +static const int cia = -4; +static const int cib = -42; + +int4 fn1(int4 p0) { return int4(1,2,3,4); } + +int4 fn1(int4 p0, bool b1, bool b2 = false) { + return p0; +} + +int4 fn1(int4 p0, + int4 p1 : FOO = int4(-1,-2,-3, cia), + int p2[2] : BAR = { int(1), 2 }, + int p3 = abs(cib) ) +{ + return p0 + p1 + p2[0] + p3; +} + +// These should not be ambiguous if given either an int or a float explicit second parameter. +int4 fn2(int4 p0, int x = 3) +{ + return int4(10,11,12,13); +} + +int4 fn2(int4 p0, float x = ufvar) // ERROR: non-const expression +{ + return p0 + int4(20,21,22,23); +} + +void fn3(int p0 = 5, int p1) // ERROR no-default param after default param +{ +} + +int4 main() : SV_Target0 +{ + int myarray[2] = {30,31}; + + return fn1(100) + // ERROR: ambiguous + fn1(101, ui4) + + fn1(102, ui4, myarray) + + fn1(103, ui4, myarray, 99) + + fn1(104, false) + + fn1(105, false, true) + + + fn2(112) + // ERROR: ambiguous + fn2(110, 11.11) + // calls int4, float form + fn2(111, 12); // calls int4, int form +} diff --git a/deps/glslang/Test/hlsl.partialFlattenLocal.vert b/deps/glslang/Test/hlsl.partialFlattenLocal.vert new file mode 100644 index 00000000..9d6cdc90 --- /dev/null +++ b/deps/glslang/Test/hlsl.partialFlattenLocal.vert @@ -0,0 +1,27 @@ +Texture2D tex; + +struct Packed { + Texture2D tex; + float3 pos[3]; + float2 uv[2]; + float x; + int n; +}; + +float4 main(float4 pos : POSITION) : SV_POSITION +{ + Packed packed; + packed.tex = tex; + packed.pos[0] = float3(0, 0, 0); + packed.uv[0] = float2(0, 1); + packed.x = 1.0; + packed.n = 3; + + for (int i = 0; i < 1; ++i) { + packed.pos[i].xy += packed.uv[i]; + } + + Packed packed2 = packed; + + return pos + float4(packed2.pos[0], 0); +} \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.partialFlattenMixed.vert b/deps/glslang/Test/hlsl.partialFlattenMixed.vert new file mode 100644 index 00000000..3fc9d68e --- /dev/null +++ b/deps/glslang/Test/hlsl.partialFlattenMixed.vert @@ -0,0 +1,16 @@ +Texture2D tex[2]; + +struct Packed { + int a; + Texture2D membTex[2]; + int b; +}; + +float4 main(float4 pos : POSITION) : SV_POSITION +{ + Packed packed; + + packed.membTex = tex; + + return pos; +} \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.partialInit.frag b/deps/glslang/Test/hlsl.partialInit.frag new file mode 100644 index 00000000..01aee8e6 --- /dev/null +++ b/deps/glslang/Test/hlsl.partialInit.frag @@ -0,0 +1,36 @@ +struct outs { + int a; + float b; + bool c; + float4 v; +}; + +static float4 gv = {0,0,1}; +static float gfa[3] = {0,0}; + +struct Nest { + float4x3 m; + outs os; + bool b; +}; + +outs PixelShaderFunction(float4 input) : COLOR0 +{ + outs o2 = { 3 }; + outs o4; + o4.v = gv * gfa[2]; + outs o1 = { }; + outs o3 = (outs)0; + o4 = (outs)0; + o4.c = o1.c; + Nest nest = (Nest)0; + + float2 gf2a[4] = { }; + int cgi = { }; + o4.b = gf2a[2].y * cgi; + + return o4; +} + +static const float2 cgf2a[3]; +static const int ci; diff --git a/deps/glslang/Test/hlsl.pp.expand.frag b/deps/glslang/Test/hlsl.pp.expand.frag new file mode 100644 index 00000000..d5318a02 --- /dev/null +++ b/deps/glslang/Test/hlsl.pp.expand.frag @@ -0,0 +1,18 @@ +#define EMP1(a) +#define EMP2(a, b) + +#define EXP1(a) = a +#define EXP2(a, b) = a, b + +struct A +{ + float4 a EMP1({1,2,3,4}); // No PP arg errors + float4 b EMP2({({{(({1,2,3,4}))}})}, {{1,2,3,4}}); // No PP arg errors + float4 c EXP1({1,2,3,4}); // ERROR: No PP arg errors, but init error + float4 d EXP2({({{(({1,2,3,4}))}})}, {{1,2,3,4}}); // ERROR: No PP arg errors, but init error +}; + +void main() +{ + "a string" +} diff --git a/deps/glslang/Test/hlsl.pp.line.frag b/deps/glslang/Test/hlsl.pp.line.frag new file mode 100644 index 00000000..6f0273dc --- /dev/null +++ b/deps/glslang/Test/hlsl.pp.line.frag @@ -0,0 +1,24 @@ + +#line 1 + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +#line 2 + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + +#line 123 "SomeFile.frag" + + int thisLineIs = __LINE__; // gets 124 + + psout.Color = float4(thisLineIs, 0, 0, 1); + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.pp.tokenpasting.frag b/deps/glslang/Test/hlsl.pp.tokenpasting.frag new file mode 100644 index 00000000..5415670f --- /dev/null +++ b/deps/glslang/Test/hlsl.pp.tokenpasting.frag @@ -0,0 +1,18 @@ + +#define foobarblee zzzz + +#define ar qqqq + +#define MACRO1(x,y) foo##x##y +// #define MACRO2 abc##def + +// #define SPACE_IN_MACRO int var1 + +float4 main() : SV_Target0 +{ + // float MACRO2 = 10; + float MACRO1(b##ar,blee) = 3; + + return float4(foobarblee,0,0,0); +} + diff --git a/deps/glslang/Test/hlsl.pp.vert b/deps/glslang/Test/hlsl.pp.vert new file mode 100644 index 00000000..4b0a4512 --- /dev/null +++ b/deps/glslang/Test/hlsl.pp.vert @@ -0,0 +1,17 @@ +#define A defined(B) + +#if A +int badGlobal1; +#else +int goodGlobal1; +#endif + +#define B + +#if A +int goodGlobal2; +#else +int badGlobal2; +#endif + +void main() {} diff --git a/deps/glslang/Test/hlsl.precedence.frag b/deps/glslang/Test/hlsl.precedence.frag new file mode 100644 index 00000000..6ed71739 --- /dev/null +++ b/deps/glslang/Test/hlsl.precedence.frag @@ -0,0 +1,9 @@ +float4 PixelShaderFunction( + float4 a1, + float4 a2, + float4 a3, + float4 a4 + ) : COLOR0 +{ + return a1 + a2 * a3 + a4 + float4(a1.rgb * a2.rgb, a3.a); +} diff --git a/deps/glslang/Test/hlsl.precedence2.frag b/deps/glslang/Test/hlsl.precedence2.frag new file mode 100644 index 00000000..0d3f583a --- /dev/null +++ b/deps/glslang/Test/hlsl.precedence2.frag @@ -0,0 +1,9 @@ +int PixelShaderFunction( + int a1, + int a2, + int a3, + int a4 + ) : COLOR0 +{ + return (a1 * a2 + a3 << a4) + (a1 << a2 + a3 * a4); +} diff --git a/deps/glslang/Test/hlsl.precise.frag b/deps/glslang/Test/hlsl.precise.frag new file mode 100644 index 00000000..77454e07 --- /dev/null +++ b/deps/glslang/Test/hlsl.precise.frag @@ -0,0 +1,14 @@ + +struct PS_OUTPUT { precise float4 color : SV_Target0; }; + +static precise float precisefloat; + +void MyFunction(in precise float myfloat, out precise float3 myfloat3) { } + +PS_OUTPUT main() +{ + PS_OUTPUT ps_output; + ps_output.color = 1.0; + return ps_output; +} + diff --git a/deps/glslang/Test/hlsl.preprocessor.frag b/deps/glslang/Test/hlsl.preprocessor.frag new file mode 100644 index 00000000..dba341ef --- /dev/null +++ b/deps/glslang/Test/hlsl.preprocessor.frag @@ -0,0 +1,13 @@ +#define DEFINE_TEXTURE(name) Texture2D name; SamplerState name##_ss; +#define SAMPLE_TEXTURE(name, uv) name.Sample(name##_ss, (uv).xy) + +#define test_texture2 test_texture + +DEFINE_TEXTURE(test_texture) + +float4 main(float4 input : TEXCOORD0) : SV_TARGET +{ + float4 tex = SAMPLE_TEXTURE(test_texture2, input.xy); + return tex; +} + diff --git a/deps/glslang/Test/hlsl.promote.atomic.frag b/deps/glslang/Test/hlsl.promote.atomic.frag new file mode 100644 index 00000000..2b46225b --- /dev/null +++ b/deps/glslang/Test/hlsl.promote.atomic.frag @@ -0,0 +1,17 @@ + +RWBuffer s_uintbuff; // UINT RWBuffer ... + +float4 main() : SV_Target +{ + int Loc; // ... with INT variables + int Inc; + int Orig; + + // This must select the uint flavor of SPIR-V atomic op, and promote + // the other arguments as required. The output value from the + // imageAtomicAdd AST will be converted to an int for 'Orig'. + InterlockedAdd(s_uintbuff[Loc], Inc, Orig); + + return float4(0,0,0,0); +} + diff --git a/deps/glslang/Test/hlsl.promote.binary.frag b/deps/glslang/Test/hlsl.promote.binary.frag new file mode 100644 index 00000000..0203bed9 --- /dev/null +++ b/deps/glslang/Test/hlsl.promote.binary.frag @@ -0,0 +1,28 @@ +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +uniform bool bval; +uniform bool4 bval4; +uniform int ival; +uniform int4 ival4; +uniform float fval; +uniform float4 fval4; + +PS_OUTPUT main() +{ + ival % fval; + ival4 % fval4; + + bval % fval; + bval4 % fval4; + + int l_int = 1; + l_int %= fval; + + PS_OUTPUT psout; + psout.Color = 0; + return psout; +} + diff --git a/deps/glslang/Test/hlsl.promote.vec1.frag b/deps/glslang/Test/hlsl.promote.vec1.frag new file mode 100644 index 00000000..a674ccba --- /dev/null +++ b/deps/glslang/Test/hlsl.promote.vec1.frag @@ -0,0 +1,16 @@ + +float4 main() : SV_Target +{ + float f1a; + float1 f1b; + + f1a = f1b; // convert float1 to float + f1b = f1a; // convert float to float1 + + float3 f3; + step(0.0, f3); + + sin(f1b); // test 1-vectors in intrinsics + + return float4(0,0,0,0); +} diff --git a/deps/glslang/Test/hlsl.promotions.frag b/deps/glslang/Test/hlsl.promotions.frag new file mode 100644 index 00000000..647096d4 --- /dev/null +++ b/deps/glslang/Test/hlsl.promotions.frag @@ -0,0 +1,201 @@ + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +uniform int3 i3; +uniform bool3 b3; +uniform float3 f3; +uniform uint3 u3; +uniform double3 d3; + +uniform int is; +uniform bool bs; +uniform float fs; +uniform uint us; +uniform double ds; + +void Fn_F3(float3 x) { } +void Fn_I3(int3 x) { } +void Fn_U3(uint3 x) { } +void Fn_B3(bool3 x) { } +void Fn_D3(double3 x) { } + +// ----------- Test implicit conversions on function returns ----------- +float3 Fn_R_F3I(out float3 p) { p = i3; return i3; } +float3 Fn_R_F3U(out float3 p) { p = u3; return u3; } +float3 Fn_R_F3B(out float3 p) { p = b3; return b3; } +float3 Fn_R_F3D(out float3 p) { p = d3; return d3; } // valid, but loss of precision on downconversion. + +int3 Fn_R_I3U(out int3 p) { p = u3; return u3; } +int3 Fn_R_I3B(out int3 p) { p = b3; return b3; } +int3 Fn_R_I3F(out int3 p) { p = f3; return f3; } +int3 Fn_R_I3D(out int3 p) { p = d3; return d3; } // valid, but loss of precision on downconversion. + +uint3 Fn_R_U3I(out uint3 p) { p = i3; return i3; } +uint3 Fn_R_U3F(out uint3 p) { p = f3; return f3; } +uint3 Fn_R_U3B(out uint3 p) { p = b3; return b3; } +uint3 Fn_R_U3D(out uint3 p) { p = d3; return d3; } // valid, but loss of precision on downconversion. + +bool3 Fn_R_B3I(out bool3 p) { p = i3; return i3; } +bool3 Fn_R_B3U(out bool3 p) { p = u3; return u3; } +bool3 Fn_R_B3F(out bool3 p) { p = f3; return f3; } +bool3 Fn_R_B3D(out bool3 p) { p = d3; return d3; } + +double3 Fn_R_D3I(out double3 p) { p = i3; return i3; } +double3 Fn_R_D3U(out double3 p) { p = u3; return u3; } +double3 Fn_R_D3B(out double3 p) { p = b3; return b3; } +double3 Fn_R_D3F(out double3 p) { p = f3; return f3; } + +PS_OUTPUT main() +{ + // ----------- assignment conversions ----------- + float3 r00 = i3; + float3 r01 = b3; + float3 r02 = u3; + float3 r03 = d3; // valid, but loss of precision on downconversion. + + int3 r10 = b3; + int3 r11 = u3; + int3 r12 = f3; + int3 r13 = d3; // valid, but loss of precision on downconversion. + + uint3 r20 = b3; + uint3 r21 = i3; + uint3 r22 = f3; + uint3 r23 = d3; // valid, but loss of precision on downconversion. + + bool3 r30 = i3; + bool3 r31 = u3; + bool3 r32 = f3; + bool3 r33 = d3; + + double3 r40 = i3; + double3 r41 = u3; + double3 r42 = f3; + double3 r43 = b3; + + // ----------- assign ops: vector times vector ----------- + r00 *= i3; + r01 *= b3; + r02 *= u3; + r03 *= d3; // valid, but loss of precision on downconversion. + + r10 *= b3; + r11 *= u3; + r12 *= f3; + r13 *= d3; // valid, but loss of precision on downconversion. + + r20 *= b3; + r21 *= i3; + r22 *= f3; + r23 *= d3; // valid, but loss of precision on downconversion. + + // No mul operator for bools + + r40 *= i3; + r41 *= u3; + r42 *= f3; + r43 *= b3; + + // ----------- assign ops: vector times scalar ----------- + r00 *= is; + r01 *= bs; + r02 *= us; + r03 *= ds; // valid, but loss of precision on downconversion. + + r10 *= bs; + r11 *= us; + r12 *= fs; + r13 *= ds; // valid, but loss of precision on downconversion. + + r20 *= bs; + r21 *= is; + r22 *= fs; + r23 *= ds; // valid, but loss of precision on downconversion. + + // No mul operator for bools + + r40 *= is; + r41 *= us; + r42 *= fs; + r43 *= bs; + + +#define FN_OVERLOADS 0 // change to 1 when overloads under promotions are in place + +#if FN_OVERLOADS + Fn_F3(i3); + Fn_F3(u3); + Fn_F3(f3); + Fn_F3(b3); + Fn_F3(d3); // valid, but loss of precision on downconversion. + + Fn_I3(i3); + Fn_I3(u3); + Fn_I3(f3); + Fn_I3(b3); + Fn_I3(d3); // valid, but loss of precision on downconversion. + + Fn_U3(i3); + Fn_U3(u3); + Fn_U3(f3); + Fn_U3(b3); + Fn_U3(d3); // valid, but loss of precision on downconversion. + + Fn_B3(i3); + Fn_B3(u3); + Fn_B3(f3); + Fn_B3(b3); + Fn_B3(d3); + + Fn_D3(i3); + Fn_D3(u3); + Fn_D3(f3); + Fn_D3(b3); + Fn_D3(d3); + + Fn_F3(i3.x); + Fn_F3(u3.x); + Fn_F3(f3.x); + Fn_F3(b3.x); + Fn_F3(d3.x); // valid, but loss of precision on downconversion. + + Fn_I3(i3.x); + Fn_I3(u3.x); + Fn_I3(f3.x); + Fn_I3(b3.x); + Fn_I3(d3.x); // valid, but loss of precision on downconversion. + + Fn_U3(i3.x); + Fn_U3(u3.x); + Fn_U3(f3.x); + Fn_U3(b3.x); + Fn_U3(d3.x); // valid, but loss of precision on downconversion. + + Fn_B3(i3.x); + Fn_B3(u3.x); + Fn_B3(f3.x); + Fn_B3(b3.x); + Fn_B3(d3.x); + + Fn_D3(i3.x); + Fn_D3(u3.x); + Fn_D3(f3.x); + Fn_D3(b3.x); + Fn_D3(d3.x); +#endif + + const int si = 3; + const float sf = 1.2; + + int c1 = si * sf; // 3.6 (not 3!) + int c2 = sf * si; // 3.6 (not 3!) + + float4 outval = float4(si * sf, sf*si, c1, c2); + + PS_OUTPUT psout; + psout.Color = outval; + return psout; +} diff --git a/deps/glslang/Test/hlsl.reflection.binding.frag b/deps/glslang/Test/hlsl.reflection.binding.frag new file mode 100644 index 00000000..25b22c97 --- /dev/null +++ b/deps/glslang/Test/hlsl.reflection.binding.frag @@ -0,0 +1,34 @@ + +uniform float u1 : register(b2); + +uniform SamplerState s1 : register(s5); +uniform SamplerState s1a[3] : register(s6); + +uniform Texture1D t1 : register(t15); +uniform Texture1D t1a[3] : register(t16); + +cbuffer cbuff1 : register(b2) { + float4 c1_a; + int c1_b; + float c1_c; +}; + +cbuffer cbuff2 : register(b3) { + float4 c2_a; + int c2_b; + float c2_c; +}; + +struct PS_OUTPUT +{ + float4 Color : Sv_Target0; +}; + +void main(out PS_OUTPUT psout) +{ + psout.Color = + t1.Sample(s1, 0.3) + + t1a[0].Sample(s1a[0], 0.3) + + c1_a + c1_b + c1_c + + c2_a + c2_b + c2_c; +} diff --git a/deps/glslang/Test/hlsl.reflection.vert b/deps/glslang/Test/hlsl.reflection.vert new file mode 100644 index 00000000..06207c74 --- /dev/null +++ b/deps/glslang/Test/hlsl.reflection.vert @@ -0,0 +1,138 @@ + +cbuffer nameless { + float3 anonMember1; + float3x2 m23; + int scalarAfterm23; + float4 anonDeadMember2; + float4 anonMember3; + int scalarBeforeArray; + float floatArray[5]; + int scalarAfterArray; + float2x2 m22[9]; +}; + +cbuffer c_nameless { + float3 c_anonMember1; + float3x2 c_m23; + int c_scalarAfterm23; + float4 c_anonDeadMember2; + float4 c_anonMember3; +}; + +cbuffer namelessdead { + int a; +}; + +struct N1 { + float a; +}; + +struct N2 { + float b; + float c; + float d; +}; + +struct N3 { + N1 n1; + N2 n2; +}; + +cbuffer nested { + N3 foo; +} + +struct TS { + int a; + int dead; +}; + +uniform TS s; + +uniform float uf1; +uniform float uf2; +uniform float ufDead3; +uniform float ufDead4; + +uniform float2x2 dm22[10]; + +struct deep1 { + float2 va[3]; + bool b; +}; + +struct deep2 { + int i; + deep1 d1[4]; +}; + +struct deep3 { + float4 iv4; + deep2 d2; + int3 v3; +}; + +uniform deep3 deepA[2], deepB[2], deepC[3], deepD[2]; + +const bool control = true; + +void deadFunction() +{ + float4 v = anonDeadMember2; + float f = ufDead4; +} + +void liveFunction2() +{ + float3 v = anonMember1; + float f = uf1; +} + +tbuffer abl { + float foo1; +} + +tbuffer abl2 { + float foo2; +} + +void flizv(in float attributeFloat, in float2 attributeFloat2, in float3 attributeFloat3, in float4 attributeFloat4, in float4x4 attributeMat4) +{ + liveFunction2(); + + if (! control) + deadFunction(); + + float f; + int i; + if (control) { + liveFunction2(); + f = anonMember3.z; + f = s.a; + f = m23[1].y + scalarAfterm23; + f = c_m23[1].y + c_scalarAfterm23; + f += scalarBeforeArray; + f += floatArray[2]; + f += floatArray[4]; + f += scalarAfterArray; + f += m22[i][1][0]; + f += dm22[3][0][1]; + f += m22[2][1].y; + f += foo.n1.a + foo.n2.b + foo.n2.c + foo.n2.d; + f += deepA[i].d2.d1[2].va[1].x; + f += deepB[1].d2.d1[i].va[1].x; + f += deepB[i].d2.d1[i].va[1].x; + deep3 d = deepC[1]; + deep3 da[2] = deepD; + } else + f = ufDead3; + + f += foo1 + foo2; + f += foo2; + + f += attributeFloat; + f += attributeFloat2.x; + f += attributeFloat3.x; + f += attributeFloat4.x; + f += attributeMat4[0][1]; +} diff --git a/deps/glslang/Test/hlsl.rw.atomics.frag b/deps/glslang/Test/hlsl.rw.atomics.frag new file mode 100644 index 00000000..930d6501 --- /dev/null +++ b/deps/glslang/Test/hlsl.rw.atomics.frag @@ -0,0 +1,244 @@ +SamplerState g_sSamp; + +RWTexture1D g_tTex1df1; +RWTexture1D g_tTex1di1; +RWTexture1D g_tTex1du1; + +RWTexture2D g_tTex2df1; +RWTexture2D g_tTex2di1; +RWTexture2D g_tTex2du1; + +RWTexture3D g_tTex3df1; +RWTexture3D g_tTex3di1; +RWTexture3D g_tTex3du1; + +RWTexture1DArray g_tTex1df1a; +RWTexture1DArray g_tTex1di1a; +RWTexture1DArray g_tTex1du1a; + +RWTexture2DArray g_tTex2df1a; +RWTexture2DArray g_tTex2di1a; +RWTexture2DArray g_tTex2du1a; + +RWBuffer g_tBuffF; +RWBuffer g_tBuffI; +RWBuffer g_tBuffU; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +uniform uint u1; +uniform uint2 u2; +uniform uint3 u3; +uniform uint u1b; +uniform uint u1c; + +uniform int i1; +uniform int2 i2; +uniform int3 i3; +uniform int i1b; +uniform int i1c; + +PS_OUTPUT main() +{ + uint out_u1; + int out_i1; + + // 1D int + InterlockedAdd(g_tTex1di1[i1], i1b); + InterlockedAdd(g_tTex1di1[i1], i1, out_i1); + InterlockedAnd(g_tTex1di1[i1], i1b); + InterlockedAnd(g_tTex1di1[i1], i1, out_i1); + InterlockedCompareExchange(g_tTex1di1[i1], i1b, i1c, out_i1); + InterlockedExchange(g_tTex1di1[i1], i1, out_i1); + InterlockedMax(g_tTex1di1[i1], i1b); + InterlockedMax(g_tTex1di1[i1], i1, out_i1); + InterlockedMin(g_tTex1di1[i1], i1b); + InterlockedMin(g_tTex1di1[i1], i1, out_i1); + InterlockedOr(g_tTex1di1[i1], i1b); + InterlockedOr(g_tTex1di1[i1], i1, out_i1); + InterlockedXor(g_tTex1di1[i1], i1b); + InterlockedXor(g_tTex1di1[i1], i1, out_i1); + + // 1D uint + InterlockedAdd(g_tTex1du1[u1], u1); + InterlockedAdd(g_tTex1du1[u1], u1, out_u1); + InterlockedAnd(g_tTex1du1[u1], u1); + InterlockedAnd(g_tTex1du1[u1], u1, out_u1); + InterlockedCompareExchange(g_tTex1du1[u1], u1b, u1c, out_u1); + InterlockedExchange(g_tTex1du1[u1], u1, out_u1); + InterlockedMax(g_tTex1du1[u1], u1); + InterlockedMax(g_tTex1du1[u1], u1, out_u1); + InterlockedMin(g_tTex1du1[u1], u1); + InterlockedMin(g_tTex1du1[u1], u1, out_u1); + InterlockedOr(g_tTex1du1[u1], u1); + InterlockedOr(g_tTex1du1[u1], u1, out_u1); + InterlockedXor(g_tTex1du1[u1], u1); + InterlockedXor(g_tTex1du1[u1], u1, out_u1); + + // 2D int + InterlockedAdd(g_tTex2di1[i2], i1b); + InterlockedAdd(g_tTex2di1[i2], i1, out_i1); + InterlockedAnd(g_tTex2di1[i2], i1b); + InterlockedAnd(g_tTex2di1[i2], i1, out_i1); + InterlockedCompareExchange(g_tTex2di1[i2], i1b, i1c, out_i1); + InterlockedExchange(g_tTex2di1[i2], i1, out_i1); + InterlockedMax(g_tTex2di1[i2], i1b); + InterlockedMax(g_tTex2di1[i2], i1, out_i1); + InterlockedMin(g_tTex2di1[i2], i1b); + InterlockedMin(g_tTex2di1[i2], i1, out_i1); + InterlockedOr(g_tTex2di1[i2], i1b); + InterlockedOr(g_tTex2di1[i2], i1, out_i1); + InterlockedXor(g_tTex2di1[i2], i1b); + InterlockedXor(g_tTex2di1[i2], i1, out_i1); + + // 2D uint + InterlockedAdd(g_tTex2du1[u2], u1); + InterlockedAdd(g_tTex2du1[u2], u1, out_u1); + InterlockedAnd(g_tTex2du1[u2], u1); + InterlockedAnd(g_tTex2du1[u2], u1, out_u1); + InterlockedCompareExchange(g_tTex2du1[u2], u1b, u1c, out_u1); + InterlockedExchange(g_tTex2du1[u2], u1, out_u1); + InterlockedMax(g_tTex2du1[u2], u1); + InterlockedMax(g_tTex2du1[u2], u1, out_u1); + InterlockedMin(g_tTex2du1[u2], u1); + InterlockedMin(g_tTex2du1[u2], u1, out_u1); + InterlockedOr(g_tTex2du1[u2], u1); + InterlockedOr(g_tTex2du1[u2], u1, out_u1); + InterlockedXor(g_tTex2du1[u2], u1); + InterlockedXor(g_tTex2du1[u2], u1, out_u1); + + // 3D int + InterlockedAdd(g_tTex3di1[i3], i1b); + InterlockedAdd(g_tTex3di1[i3], i1, out_i1); + InterlockedAnd(g_tTex3di1[i3], i1b); + InterlockedAnd(g_tTex3di1[i3], i1, out_i1); + InterlockedCompareExchange(g_tTex3di1[i3], i1b, i1c, out_i1); + InterlockedExchange(g_tTex3di1[i3], i1, out_i1); + InterlockedMax(g_tTex3di1[i3], i1b); + InterlockedMax(g_tTex3di1[i3], i1, out_i1); + InterlockedMin(g_tTex3di1[i3], i1b); + InterlockedMin(g_tTex3di1[i3], i1, out_i1); + InterlockedOr(g_tTex3di1[i3], i1b); + InterlockedOr(g_tTex3di1[i3], i1, out_i1); + InterlockedXor(g_tTex3di1[i3], i1b); + InterlockedXor(g_tTex3di1[i3], i1, out_i1); + + // 3D uint + InterlockedAdd(g_tTex3du1[u3], u1); + InterlockedAdd(g_tTex3du1[u3], u1, out_u1); + InterlockedAnd(g_tTex3du1[u3], u1); + InterlockedAnd(g_tTex3du1[u3], u1, out_u1); + InterlockedCompareExchange(g_tTex3du1[u3], u1b, u1c, out_u1); + InterlockedExchange(g_tTex3du1[u3], u1, out_u1); + InterlockedMax(g_tTex3du1[u3], u1); + InterlockedMax(g_tTex3du1[u3], u1, out_u1); + InterlockedMin(g_tTex3du1[u3], u1); + InterlockedMin(g_tTex3du1[u3], u1, out_u1); + InterlockedOr(g_tTex3du1[u3], u1); + InterlockedOr(g_tTex3du1[u3], u1, out_u1); + InterlockedXor(g_tTex3du1[u3], u1); + InterlockedXor(g_tTex3du1[u3], u1, out_u1); + + // 1D array int + InterlockedAdd(g_tTex1di1a[i2], i1b); + InterlockedAdd(g_tTex1di1a[i2], i1, out_i1); + InterlockedAnd(g_tTex1di1a[i2], i1b); + InterlockedAnd(g_tTex1di1a[i2], i1, out_i1); + InterlockedCompareExchange(g_tTex1di1a[i2], i1b, i1c, out_i1); + InterlockedExchange(g_tTex1di1a[i2], i1, out_i1); + InterlockedMax(g_tTex1di1a[i2], i1b); + InterlockedMax(g_tTex1di1a[i2], i1, out_i1); + InterlockedMin(g_tTex1di1a[i2], i1b); + InterlockedMin(g_tTex1di1a[i2], i1, out_i1); + InterlockedOr(g_tTex1di1a[i2], i1b); + InterlockedOr(g_tTex1di1a[i2], i1, out_i1); + InterlockedXor(g_tTex1di1a[i2], i1b); + InterlockedXor(g_tTex1di1a[i2], i1, out_i1); + + // 1D array uint + InterlockedAdd(g_tTex1du1a[u2], u1); + InterlockedAdd(g_tTex1du1a[u2], u1, out_u1); + InterlockedAnd(g_tTex1du1a[u2], u1); + InterlockedAnd(g_tTex1du1a[u2], u1, out_u1); + InterlockedCompareExchange(g_tTex1du1a[u2], u1b, u1c, out_u1); + InterlockedExchange(g_tTex1du1a[u2], u1, out_u1); + InterlockedMax(g_tTex1du1a[u2], u1); + InterlockedMax(g_tTex1du1a[u2], u1, out_u1); + InterlockedMin(g_tTex1du1a[u2], u1); + InterlockedMin(g_tTex1du1a[u2], u1, out_u1); + InterlockedOr(g_tTex1du1a[u2], u1); + InterlockedOr(g_tTex1du1a[u2], u1, out_u1); + InterlockedXor(g_tTex1du1a[u2], u1); + InterlockedXor(g_tTex1du1a[u2], u1, out_u1); + + // 2D array int + InterlockedAdd(g_tTex1di1a[i2], i1b); + InterlockedAdd(g_tTex1di1a[i2], i1, out_i1); + InterlockedAnd(g_tTex1di1a[i2], i1b); + InterlockedAnd(g_tTex1di1a[i2], i1, out_i1); + InterlockedCompareExchange(g_tTex1di1a[i2], i1b, i1c, out_i1); + InterlockedExchange(g_tTex1di1a[i2], i1, out_i1); + InterlockedMax(g_tTex1di1a[i2], i1b); + InterlockedMax(g_tTex1di1a[i2], i1, out_i1); + InterlockedMin(g_tTex1di1a[i2], i1b); + InterlockedMin(g_tTex1di1a[i2], i1, out_i1); + InterlockedOr(g_tTex1di1a[i2], i1b); + InterlockedOr(g_tTex1di1a[i2], i1, out_i1); + InterlockedXor(g_tTex1di1a[i2], i1b); + InterlockedXor(g_tTex1di1a[i2], i1, out_i1); + + // 2D array uint + InterlockedAdd(g_tTex1du1a[u2], u1); + InterlockedAdd(g_tTex1du1a[u2], u1, out_u1); + InterlockedAnd(g_tTex1du1a[u2], u1); + InterlockedAnd(g_tTex1du1a[u2], u1, out_u1); + InterlockedCompareExchange(g_tTex1du1a[u2], u1b, u1c, out_u1); + InterlockedExchange(g_tTex1du1a[u2], u1, out_u1); + InterlockedMax(g_tTex1du1a[u2], u1); + InterlockedMax(g_tTex1du1a[u2], u1, out_u1); + InterlockedMin(g_tTex1du1a[u2], u1); + InterlockedMin(g_tTex1du1a[u2], u1, out_u1); + InterlockedOr(g_tTex1du1a[u2], u1); + InterlockedOr(g_tTex1du1a[u2], u1, out_u1); + InterlockedXor(g_tTex1du1a[u2], u1); + InterlockedXor(g_tTex1du1a[u2], u1, out_u1); + + // buffer int + InterlockedAdd(g_tBuffI[i1], i1b); + InterlockedAdd(g_tBuffI[i1], i1, out_i1); + InterlockedAnd(g_tBuffI[i1], i1b); + InterlockedAnd(g_tBuffI[i1], i1, out_i1); + InterlockedCompareExchange(g_tBuffI[i1], i1b, i1c, out_i1); + InterlockedExchange(g_tBuffI[i1], i1, out_i1); + InterlockedMax(g_tBuffI[i1], i1b); + InterlockedMax(g_tBuffI[i1], i1, out_i1); + InterlockedMin(g_tBuffI[i1], i1b); + InterlockedMin(g_tBuffI[i1], i1, out_i1); + InterlockedOr(g_tBuffI[i1], i1b); + InterlockedOr(g_tBuffI[i1], i1, out_i1); + InterlockedXor(g_tBuffI[i1], i1b); + InterlockedXor(g_tBuffI[i1], i1, out_i1); + + // buffer uint + InterlockedAdd(g_tBuffU[u1], u1); + InterlockedAdd(g_tBuffU[u1], u1, out_u1); + InterlockedAnd(g_tBuffU[u1], u1); + InterlockedAnd(g_tBuffU[u1], u1, out_u1); + InterlockedCompareExchange(g_tBuffU[u1], u1b, u1c, out_u1); + InterlockedExchange(g_tBuffU[u1], u1, out_u1); + InterlockedMax(g_tBuffU[u1], u1); + InterlockedMax(g_tBuffU[u1], u1, out_u1); + InterlockedMin(g_tBuffU[u1], u1); + InterlockedMin(g_tBuffU[u1], u1, out_u1); + InterlockedOr(g_tBuffU[u1], u1); + InterlockedOr(g_tBuffU[u1], u1, out_u1); + InterlockedXor(g_tBuffU[u1], u1); + InterlockedXor(g_tBuffU[u1], u1, out_u1); + + PS_OUTPUT psout; + psout.Color = 1.0; + return psout; +} diff --git a/deps/glslang/Test/hlsl.rw.bracket.frag b/deps/glslang/Test/hlsl.rw.bracket.frag new file mode 100644 index 00000000..9390e8de --- /dev/null +++ b/deps/glslang/Test/hlsl.rw.bracket.frag @@ -0,0 +1,140 @@ +SamplerState g_sSamp : register(s0); + +RWTexture1D g_tTex1df4 : register(t0); +RWTexture1D g_tTex1di4; +RWTexture1D g_tTex1du4; + +RWTexture2D g_tTex2df4; +RWTexture2D g_tTex2di4; +RWTexture2D g_tTex2du4; + +RWTexture3D g_tTex3df4; +RWTexture3D g_tTex3di4; +RWTexture3D g_tTex3du4; + +RWTexture1DArray g_tTex1df4a; +RWTexture1DArray g_tTex1di4a; +RWTexture1DArray g_tTex1du4a; + +RWTexture2DArray g_tTex2df4a; +RWTexture2DArray g_tTex2di4a; +RWTexture2DArray g_tTex2du4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +uniform int c1; +uniform int2 c2; +uniform int3 c3; +uniform int4 c4; + +uniform int o1; +uniform int2 o2; +uniform int3 o3; +uniform int4 o4; + +uniform float4 uf4; +uniform int4 ui4; +uniform uint4 uu4; + +int4 Fn1(in int4 x) { return x; } +uint4 Fn1(in uint4 x) { return x; } +float4 Fn1(in float4 x) { return x; } + +void Fn2(out int4 x) { x = int4(0); } +void Fn2(out uint4 x) { x = uint4(0); } +void Fn2(out float4 x) { x = float4(0); } + +float4 SomeValue() { return c4; } + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // 1D + g_tTex1df4[c1]; + + float4 r00 = g_tTex1df4[c1]; + int4 r01 = g_tTex1di4[c1]; + uint4 r02 = g_tTex1du4[c1]; + + // 2D + float4 r10 = g_tTex2df4[c2]; + int4 r11 = g_tTex2di4[c2]; + uint4 r12 = g_tTex2du4[c2]; + + // 3D + float4 r20 = g_tTex3df4[c3]; + int4 r21 = g_tTex3di4[c3]; + uint4 r22 = g_tTex3du4[c3]; + + float4 lf4 = uf4; + + // Test as L-values + // 1D + g_tTex1df4[c1] = SomeValue(); // complex R-value + g_tTex1df4[c1] = lf4; + g_tTex1di4[c1] = int4(2,2,3,4); + g_tTex1du4[c1] = uint4(3,2,3,4); + + // Test some operator= things, which need to do both a load and a store. + float4 val1 = (g_tTex1df4[c1] *= 2.0); + g_tTex1df4[c1] -= 3.0; + g_tTex1df4[c1] += 4.0; + + g_tTex1di4[c1] /= 2; + g_tTex1di4[c1] %= 2; + g_tTex1di4[c1] &= 0xffff; + g_tTex1di4[c1] |= 0xf0f0; + g_tTex1di4[c1] <<= 2; + g_tTex1di4[c1] >>= 2; + + // 2D + g_tTex2df4[c2] = SomeValue(); // complex L-value + g_tTex2df4[c2] = lf4; + g_tTex2di4[c2] = int4(5,2,3,4); + g_tTex2du4[c2] = uint4(6,2,3,4); + + // 3D + g_tTex3df4[c3] = SomeValue(); // complex L-value + g_tTex3df4[c3] = lf4; + g_tTex3di4[c3] = int4(8,6,7,8); + g_tTex3du4[c3] = uint4(9,2,3,4); + + // Test function calling + Fn1(g_tTex1df4[c1]); // in + Fn1(g_tTex1di4[c1]); // in + Fn1(g_tTex1du4[c1]); // in + + Fn2(g_tTex1df4[c1]); // out + Fn2(g_tTex1di4[c1]); // out + Fn2(g_tTex1du4[c1]); // out + + // Test increment operators + // pre-ops + ++g_tTex1df4[c1]; + ++g_tTex1di4[c1]; + ++g_tTex1du4[c1]; + + --g_tTex1df4[c1]; + --g_tTex1di4[c1]; + --g_tTex1du4[c1]; + + // post-ops + g_tTex1df4[c1]++; + g_tTex1du4[c1]--; + g_tTex1di4[c1]++; + + g_tTex1df4[c1]--; + g_tTex1di4[c1]++; + g_tTex1du4[c1]--; + + // read and write + g_tTex1df4[1] = g_tTex2df4[int2(2,3)]; + + psout.Color = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.rw.register.frag b/deps/glslang/Test/hlsl.rw.register.frag new file mode 100644 index 00000000..e82e419a --- /dev/null +++ b/deps/glslang/Test/hlsl.rw.register.frag @@ -0,0 +1,18 @@ + +RWTexture1D g_tTex1df1 : register(u2); +RWBuffer g_tBuf1du1 : register(U3); + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +PS_OUTPUT main() +{ + float r00 = g_tTex1df1[0]; + uint r01 = g_tBuf1du1[0]; + + PS_OUTPUT psout; + psout.Color = 1.0; + return psout; +} diff --git a/deps/glslang/Test/hlsl.rw.scalar.bracket.frag b/deps/glslang/Test/hlsl.rw.scalar.bracket.frag new file mode 100644 index 00000000..e185f05d --- /dev/null +++ b/deps/glslang/Test/hlsl.rw.scalar.bracket.frag @@ -0,0 +1,140 @@ +SamplerState g_sSamp : register(s0); + +RWTexture1D g_tTex1df1; +RWTexture1D g_tTex1di1; +RWTexture1D g_tTex1du1; + +RWTexture2D g_tTex2df1; +RWTexture2D g_tTex2di1; +RWTexture2D g_tTex2du1; + +RWTexture3D g_tTex3df1; +RWTexture3D g_tTex3di1; +RWTexture3D g_tTex3du1; + +RWTexture1DArray g_tTex1df1a; +RWTexture1DArray g_tTex1di1a; +RWTexture1DArray g_tTex1du1a; + +RWTexture2DArray g_tTex2df1a; +RWTexture2DArray g_tTex2di1a; +RWTexture2DArray g_tTex2du1a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +uniform int c1; +uniform int2 c2; +uniform int3 c3; +uniform int4 c4; + +uniform int o1; +uniform int2 o2; +uniform int3 o3; +uniform int4 o4; + +uniform float uf1; +uniform int ui1; +uniform uint uu1; + +int Fn1(in int x) { return x; } +uint Fn1(in uint x) { return x; } +float Fn1(in float x) { return x; } + +void Fn2(out int x) { x = int(0); } +void Fn2(out uint x) { x = uint(0); } +void Fn2(out float x) { x = float(0); } + +float SomeValue() { return c1; } + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // 1D + g_tTex1df1[c1]; + + float r00 = g_tTex1df1[c1]; + int r01 = g_tTex1di1[c1]; + uint r02 = g_tTex1du1[c1]; + + // 2D + float r10 = g_tTex2df1[c2]; + int r11 = g_tTex2di1[c2]; + uint r12 = g_tTex2du1[c2]; + + // 3D + float r20 = g_tTex3df1[c3]; + int r21 = g_tTex3di1[c3]; + uint r22 = g_tTex3du1[c3]; + + float lf1 = uf1; + + // Test as L-values + // 1D + g_tTex1df1[c1] = SomeValue(); // complex R-value + g_tTex1df1[c1] = lf1; + g_tTex1di1[c1] = int(2); + g_tTex1du1[c1] = uint(3); + + // Test some operator= things, which need to do both a load and a store. + float val1 = (g_tTex1df1[c1] *= 2.0); + g_tTex1df1[c1] -= 3.0; + g_tTex1df1[c1] += 4.0; + + g_tTex1di1[c1] /= 2; + g_tTex1di1[c1] %= 2; + g_tTex1di1[c1] &= 0xffff; + g_tTex1di1[c1] |= 0xf0f0; + g_tTex1di1[c1] <<= 2; + g_tTex1di1[c1] >>= 2; + + // 2D + g_tTex2df1[c2] = SomeValue(); // complex L-value + g_tTex2df1[c2] = lf1; + g_tTex2di1[c2] = int(5); + g_tTex2du1[c2] = uint(6); + + // 3D + g_tTex3df1[c3] = SomeValue(); // complex L-value + g_tTex3df1[c3] = lf1; + g_tTex3di1[c3] = int(8); + g_tTex3du1[c3] = uint(9); + + // Test function calling + Fn1(g_tTex1df1[c1]); // in + Fn1(g_tTex1di1[c1]); // in + Fn1(g_tTex1du1[c1]); // in + + Fn2(g_tTex1df1[c1]); // out + Fn2(g_tTex1di1[c1]); // out + Fn2(g_tTex1du1[c1]); // out + + // Test increment operators + // pre-ops + ++g_tTex1df1[c1]; + ++g_tTex1di1[c1]; + ++g_tTex1du1[c1]; + + --g_tTex1df1[c1]; + --g_tTex1di1[c1]; + --g_tTex1du1[c1]; + + // post-ops + g_tTex1df1[c1]++; + g_tTex1du1[c1]--; + g_tTex1di1[c1]++; + + g_tTex1df1[c1]--; + g_tTex1di1[c1]++; + g_tTex1du1[c1]--; + + // read and write + g_tTex1df1[1] = g_tTex2df1[int2(2, 3)]; + + psout.Color = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.rw.swizzle.frag b/deps/glslang/Test/hlsl.rw.swizzle.frag new file mode 100644 index 00000000..356ed73d --- /dev/null +++ b/deps/glslang/Test/hlsl.rw.swizzle.frag @@ -0,0 +1,28 @@ +RWTexture2D rwtx; +RWBuffer buf; + +float3 SomeValue() { return float3(1,2,3); } + +float4 main() : SV_Target0 +{ + int2 tc2 = { 0, 0 }; + int tc = 0; + + // Test swizzles and partial updates of L-values when writing to buffers and writable textures. + rwtx[tc2].zyx = float3(1,2,3); // full swizzle, simple RHS + rwtx[tc2].zyx = SomeValue(); // full swizzle, complex RHS + rwtx[tc2].zyx = 2; // full swizzle, modify op + + // Partial updates not yet supported. + // Partial values, which will use swizzles. + // buf[tc].yz = 42; // partial swizzle, simple RHS + // buf[tc].yz = SomeValue().x; // partial swizzle, complex RHS + // buf[tc].yz += 43; // partial swizzle, modify op + + // // Partial values, which will use index. + // buf[tc].y = 44; // single index, simple RHS + // buf[tc].y = SomeValue().x; // single index, complex RHS + // buf[tc].y += 45; // single index, modify op + + return 0.0; +} diff --git a/deps/glslang/Test/hlsl.rw.vec2.bracket.frag b/deps/glslang/Test/hlsl.rw.vec2.bracket.frag new file mode 100644 index 00000000..7b4a10a8 --- /dev/null +++ b/deps/glslang/Test/hlsl.rw.vec2.bracket.frag @@ -0,0 +1,140 @@ +SamplerState g_sSamp : register(s0); + +RWTexture1D g_tTex1df2; +RWTexture1D g_tTex1di2; +RWTexture1D g_tTex1du2; + +RWTexture2D g_tTex2df2; +RWTexture2D g_tTex2di2; +RWTexture2D g_tTex2du2; + +RWTexture3D g_tTex3df2; +RWTexture3D g_tTex3di2; +RWTexture3D g_tTex3du2; + +RWTexture1DArray g_tTex1df2a; +RWTexture1DArray g_tTex1di2a; +RWTexture1DArray g_tTex1du2a; + +RWTexture2DArray g_tTex2df2a; +RWTexture2DArray g_tTex2di2a; +RWTexture2DArray g_tTex2du2a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +uniform int c1; +uniform int2 c2; +uniform int3 c3; +uniform int4 c4; + +uniform int o1; +uniform int2 o2; +uniform int3 o3; +uniform int4 o4; + +uniform float2 uf2; +uniform int2 ui2; +uniform uint2 uu2; + +int2 Fn1(in int2 x) { return x; } +uint2 Fn1(in uint2 x) { return x; } +float2 Fn1(in float2 x) { return x; } + +void Fn2(out int2 x) { x = int2(0,0); } +void Fn2(out uint2 x) { x = uint2(0,0); } +void Fn2(out float2 x) { x = float2(0,0); } + +float2 SomeValue() { return c2; } + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // 1D + g_tTex1df2[c1]; + + float2 r00 = g_tTex1df2[c1]; + int2 r01 = g_tTex1di2[c1]; + uint2 r02 = g_tTex1du2[c1]; + + // 2D + float2 r10 = g_tTex2df2[c2]; + int2 r11 = g_tTex2di2[c2]; + uint2 r12 = g_tTex2du2[c2]; + + // 3D + float2 r20 = g_tTex3df2[c3]; + int2 r21 = g_tTex3di2[c3]; + uint2 r22 = g_tTex3du2[c3]; + + float2 lf2 = uf2; + + // Test as L-values + // 1D + g_tTex1df2[c1] = SomeValue(); // complex R-value + g_tTex1df2[c1] = lf2; + g_tTex1di2[c1] = int2(2,2); + g_tTex1du2[c1] = uint2(3,2); + + // Test some operator= things, which need to do both a load and a store. + float2 val1 = (g_tTex1df2[c1] *= 2.0); + g_tTex1df2[c1] -= 3.0; + g_tTex1df2[c1] += 4.0; + + g_tTex1di2[c1] /= 2; + g_tTex1di2[c1] %= 2; + g_tTex1di2[c1] &= 0xffff; + g_tTex1di2[c1] |= 0xf0f0; + g_tTex1di2[c1] <<= 2; + g_tTex1di2[c1] >>= 2; + + // 2D + g_tTex2df2[c2] = SomeValue(); // complex L-value + g_tTex2df2[c2] = lf2; + g_tTex2di2[c2] = int2(5,2); + g_tTex2du2[c2] = uint2(6,2); + + // 3D + g_tTex3df2[c3] = SomeValue(); // complex L-value + g_tTex3df2[c3] = lf2; + g_tTex3di2[c3] = int2(8,6); + g_tTex3du2[c3] = uint2(9,2); + + // Test function calling + Fn1(g_tTex1df2[c1]); // in + Fn1(g_tTex1di2[c1]); // in + Fn1(g_tTex1du2[c1]); // in + + Fn2(g_tTex1df2[c1]); // out + Fn2(g_tTex1di2[c1]); // out + Fn2(g_tTex1du2[c1]); // out + + // Test increment operators + // pre-ops + ++g_tTex1df2[c1]; + ++g_tTex1di2[c1]; + ++g_tTex1du2[c1]; + + --g_tTex1df2[c1]; + --g_tTex1di2[c1]; + --g_tTex1du2[c1]; + + // post-ops + g_tTex1df2[c1]++; + g_tTex1du2[c1]--; + g_tTex1di2[c1]++; + + g_tTex1df2[c1]--; + g_tTex1di2[c1]++; + g_tTex1du2[c1]--; + + // read and write + g_tTex1df2[1] = g_tTex2df2[int2(2,3)]; + + psout.Color = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.sample.array.dx10.frag b/deps/glslang/Test/hlsl.sample.array.dx10.frag new file mode 100644 index 00000000..2c680045 --- /dev/null +++ b/deps/glslang/Test/hlsl.sample.array.dx10.frag @@ -0,0 +1,43 @@ +SamplerState g_sSamp : register(s0); + +Texture1DArray g_tTex1df4a : register(t1); + +uniform Texture1DArray g_tTex1df4 : register(t0); +Texture1DArray g_tTex1di4; +Texture1DArray g_tTex1du4; + +Texture2DArray g_tTex2df4; +Texture2DArray g_tTex2di4; +Texture2DArray g_tTex2du4; + +TextureCubeArray g_tTexcdf4; +TextureCubeArray g_tTexcdi4; +TextureCubeArray g_tTexcdu4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + float4 txval10 = g_tTex1df4 . Sample(g_sSamp, float2(0.1, 0.2)); + int4 txval11 = g_tTex1di4 . Sample(g_sSamp, float2(0.2, 0.3)); + uint4 txval12 = g_tTex1du4 . Sample(g_sSamp, float2(0.3, 0.4)); + + float4 txval20 = g_tTex2df4 . Sample(g_sSamp, float3(0.1, 0.2, 0.3)); + int4 txval21 = g_tTex2di4 . Sample(g_sSamp, float3(0.3, 0.4, 0.5)); + uint4 txval22 = g_tTex2du4 . Sample(g_sSamp, float3(0.5, 0.6, 0.7)); + + float4 txval40 = g_tTexcdf4 . Sample(g_sSamp, float4(0.1, 0.2, 0.3, 0.4)); + int4 txval41 = g_tTexcdi4 . Sample(g_sSamp, float4(0.4, 0.5, 0.6, 0.7)); + uint4 txval42 = g_tTexcdu4 . Sample(g_sSamp, float4(0.7, 0.8, 0.9, 1.0)); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.sample.basic.dx10.frag b/deps/glslang/Test/hlsl.sample.basic.dx10.frag new file mode 100644 index 00000000..03e83ef9 --- /dev/null +++ b/deps/glslang/Test/hlsl.sample.basic.dx10.frag @@ -0,0 +1,90 @@ +SamplerState g_sSamp : register(s0); +uniform sampler2D g_sSamp2d +{ + AddressU = MIRROR; + AddressV = WRAP; + MinLOD = 0; + MaxLOD = 10; + MaxAnisotropy = 2; + MipLodBias = 0.2; +}, g_sSamp2D_b; + +Texture1D g_tTex1df4a : register(t1); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +struct MemberTest +{ + int Sample; // in HLSL, method names are valid struct members. + int CalculateLevelOfDetail; // ... + int CalculateLevelOfDetailUnclamped; // ... + int Gather; // ... + int GetDimensions; // ... + int GetSamplePosition; // ... + int Load; // ... + int SampleBias; // ... + int SampleCmp; // ... + int SampleCmpLevelZero; // ... + int SampleGrad; // ... + int SampleLevel; // ... +}; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + MemberTest mtest; + mtest.CalculateLevelOfDetail = 1; // in HLSL, method names are valid struct members. + mtest.CalculateLevelOfDetailUnclamped = 1; // ... + mtest.Gather = 1; // ... + mtest.GetDimensions = 1; // ... + mtest.GetSamplePosition = 1; // ... + mtest.Load = 1; // ... + mtest.Sample = 1; // ... + mtest.SampleBias = 1; // ... + mtest.SampleCmp = 1; // ... + mtest.SampleCmpLevelZero = 1; // ... + mtest.SampleGrad = 1; // ... + mtest.SampleLevel = 1; // ... + + float4 txval10 = g_tTex1df4 . Sample(g_sSamp, 0.1); + int4 txval11 = g_tTex1di4 . Sample(g_sSamp, 0.2); + uint4 txval12 = g_tTex1du4 . Sample(g_sSamp, 0.3); + + float4 txval20 = g_tTex2df4 . Sample(g_sSamp, float2(0.1, 0.2)); + int4 txval21 = g_tTex2di4 . Sample(g_sSamp, float2(0.3, 0.4)); + uint4 txval22 = g_tTex2du4 . Sample(g_sSamp, float2(0.5, 0.6)); + + float4 txval30 = g_tTex3df4 . Sample(g_sSamp, float3(0.1, 0.2, 0.3)); + int4 txval31 = g_tTex3di4 . Sample(g_sSamp, float3(0.4, 0.5, 0.6)); + uint4 txval32 = g_tTex3du4 . Sample(g_sSamp, float3(0.7, 0.8, 0.9)); + + float4 txval40 = g_tTexcdf4 . Sample(g_sSamp, float3(0.1, 0.2, 0.3)); + int4 txval41 = g_tTexcdi4 . Sample(g_sSamp, float3(0.4, 0.5, 0.6)); + uint4 txval42 = g_tTexcdu4 . Sample(g_sSamp, float3(0.7, 0.8, 0.9)); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.sample.offset.dx10.frag b/deps/glslang/Test/hlsl.sample.offset.dx10.frag new file mode 100644 index 00000000..65ce7e48 --- /dev/null +++ b/deps/glslang/Test/hlsl.sample.offset.dx10.frag @@ -0,0 +1,49 @@ +SamplerState g_sSamp : register(s0); + +Texture1D g_tTex1df4a : register(t1); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + float4 txval10 = g_tTex1df4 . Sample(g_sSamp, 0.1, 1); + int4 txval11 = g_tTex1di4 . Sample(g_sSamp, 0.2, 1); + uint4 txval12 = g_tTex1du4 . Sample(g_sSamp, 0.3, 1); + + float4 txval20 = g_tTex2df4 . Sample(g_sSamp, float2(0.1, 0.2), int2(1,0)); + int4 txval21 = g_tTex2di4 . Sample(g_sSamp, float2(0.3, 0.4), int2(1,1)); + uint4 txval22 = g_tTex2du4 . Sample(g_sSamp, float2(0.5, 0.6), int2(1,-1)); + + float4 txval30 = g_tTex3df4 . Sample(g_sSamp, float3(0.1, 0.2, 0.3), int3(1,0,1)); + int4 txval31 = g_tTex3di4 . Sample(g_sSamp, float3(0.4, 0.5, 0.6), int3(1,1,1)); + uint4 txval32 = g_tTex3du4 . Sample(g_sSamp, float3(0.7, 0.8, 0.9), int3(1,0,-1)); + + // There are no offset forms of cube textures, so we do not test them. + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.sample.offsetarray.dx10.frag b/deps/glslang/Test/hlsl.sample.offsetarray.dx10.frag new file mode 100644 index 00000000..616c8ddd --- /dev/null +++ b/deps/glslang/Test/hlsl.sample.offsetarray.dx10.frag @@ -0,0 +1,37 @@ +SamplerState g_sSamp : register(s0); + +Texture1DArray g_tTex1df4a : register(t1); + +uniform Texture1DArray g_tTex1df4 : register(t0); +Texture1DArray g_tTex1di4; +Texture1DArray g_tTex1du4; + +Texture2DArray g_tTex2df4; +Texture2DArray g_tTex2di4; +Texture2DArray g_tTex2du4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + float4 txval10 = g_tTex1df4 . Sample(g_sSamp, float2(0.1, 0.2), 0); + int4 txval11 = g_tTex1di4 . Sample(g_sSamp, float2(0.2, 0.3), 1); + uint4 txval12 = g_tTex1du4 . Sample(g_sSamp, float2(0.3, 0.4), 2); + + float4 txval20 = g_tTex2df4 . Sample(g_sSamp, float3(0.1, 0.2, 0.3), int2(0,0)); + int4 txval21 = g_tTex2di4 . Sample(g_sSamp, float3(0.3, 0.4, 0.5), int2(0,0)); + uint4 txval22 = g_tTex2du4 . Sample(g_sSamp, float3(0.5, 0.6, 0.7), int2(0,1)); + + // No offset array forms for 3D or cube + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.sample.sub-vec4.dx10.frag b/deps/glslang/Test/hlsl.sample.sub-vec4.dx10.frag new file mode 100644 index 00000000..991d976a --- /dev/null +++ b/deps/glslang/Test/hlsl.sample.sub-vec4.dx10.frag @@ -0,0 +1,24 @@ +SamplerState g_sSamp : register(s0); + +Texture1D g_tTex1df1; +Texture1D g_tTex1df2; +Texture1D g_tTex1df3; +Texture1D g_tTex1df4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + float txval10 = g_tTex1df1 . Sample(g_sSamp, 0.1); + float2 txval11 = g_tTex1df2 . Sample(g_sSamp, 0.2); + float3 txval12 = g_tTex1df3 . Sample(g_sSamp, 0.2); + float4 txval13 = g_tTex1df4 . Sample(g_sSamp, 0.2); + + psout.Color = 1.0; + return psout; +} diff --git a/deps/glslang/Test/hlsl.samplebias.array.dx10.frag b/deps/glslang/Test/hlsl.samplebias.array.dx10.frag new file mode 100644 index 00000000..ba4e197f --- /dev/null +++ b/deps/glslang/Test/hlsl.samplebias.array.dx10.frag @@ -0,0 +1,43 @@ +SamplerState g_sSamp : register(s0); + +Texture1DArray g_tTex1df4a : register(t1); + +uniform Texture1DArray g_tTex1df4 : register(t0); +Texture1DArray g_tTex1di4; +Texture1DArray g_tTex1du4; + +Texture2DArray g_tTex2df4; +Texture2DArray g_tTex2di4; +Texture2DArray g_tTex2du4; + +TextureCubeArray g_tTexcdf4; +TextureCubeArray g_tTexcdi4; +TextureCubeArray g_tTexcdu4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + float4 txval10 = g_tTex1df4 . SampleBias(g_sSamp, float2(0.1, 0.2), 0.5); + int4 txval11 = g_tTex1di4 . SampleBias(g_sSamp, float2(0.2, 0.3), 0.5); + uint4 txval12 = g_tTex1du4 . SampleBias(g_sSamp, float2(0.3, 0.4), 0.5); + + float4 txval20 = g_tTex2df4 . SampleBias(g_sSamp, float3(0.1, 0.2, 0.3), 0.5); + int4 txval21 = g_tTex2di4 . SampleBias(g_sSamp, float3(0.3, 0.4, 0.5), 0.5); + uint4 txval22 = g_tTex2du4 . SampleBias(g_sSamp, float3(0.5, 0.6, 0.7), 0.5); + + float4 txval40 = g_tTexcdf4 . SampleBias(g_sSamp, float4(0.1, 0.2, 0.3, 0.4), 0.5); + int4 txval41 = g_tTexcdi4 . SampleBias(g_sSamp, float4(0.4, 0.5, 0.6, 0.7), 0.5); + uint4 txval42 = g_tTexcdu4 . SampleBias(g_sSamp, float4(0.7, 0.8, 0.9, 1.0), 0.5); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.samplebias.basic.dx10.frag b/deps/glslang/Test/hlsl.samplebias.basic.dx10.frag new file mode 100644 index 00000000..09138616 --- /dev/null +++ b/deps/glslang/Test/hlsl.samplebias.basic.dx10.frag @@ -0,0 +1,51 @@ +SamplerState g_sSamp : register(s0); + +Texture1D g_tTex1df4a : register(t1); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + float4 txval10 = g_tTex1df4 . SampleBias(g_sSamp, 0.1, 0.5); + int4 txval11 = g_tTex1di4 . SampleBias(g_sSamp, 0.2, 0.5); + uint4 txval12 = g_tTex1du4 . SampleBias(g_sSamp, 0.3, 0.5); + + float4 txval20 = g_tTex2df4 . SampleBias(g_sSamp, float2(0.1, 0.2), 0.5); + int4 txval21 = g_tTex2di4 . SampleBias(g_sSamp, float2(0.3, 0.4), 0.5); + uint4 txval22 = g_tTex2du4 . SampleBias(g_sSamp, float2(0.5, 0.6), 0.5); + + float4 txval30 = g_tTex3df4 . SampleBias(g_sSamp, float3(0.1, 0.2, 0.3), 0.5); + int4 txval31 = g_tTex3di4 . SampleBias(g_sSamp, float3(0.4, 0.5, 0.6), 0.5); + uint4 txval32 = g_tTex3du4 . SampleBias(g_sSamp, float3(0.7, 0.8, 0.9), 0.5); + + float4 txval40 = g_tTexcdf4 . SampleBias(g_sSamp, float3(0.1, 0.2, 0.3), 0.5); + int4 txval41 = g_tTexcdi4 . SampleBias(g_sSamp, float3(0.4, 0.5, 0.6), 0.5); + uint4 txval42 = g_tTexcdu4 . SampleBias(g_sSamp, float3(0.7, 0.8, 0.9), 0.5); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.samplebias.offset.dx10.frag b/deps/glslang/Test/hlsl.samplebias.offset.dx10.frag new file mode 100644 index 00000000..6f2f94c8 --- /dev/null +++ b/deps/glslang/Test/hlsl.samplebias.offset.dx10.frag @@ -0,0 +1,49 @@ +SamplerState g_sSamp : register(s0); + +Texture1D g_tTex1df4a : register(t1); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + float4 txval10 = g_tTex1df4 . SampleBias(g_sSamp, 0.1, 0.5, 1); + int4 txval11 = g_tTex1di4 . SampleBias(g_sSamp, 0.2, 0.5, 1); + uint4 txval12 = g_tTex1du4 . SampleBias(g_sSamp, 0.3, 0.5, 1); + + float4 txval20 = g_tTex2df4 . SampleBias(g_sSamp, float2(0.1, 0.2), 0.5, int2(1,0)); + int4 txval21 = g_tTex2di4 . SampleBias(g_sSamp, float2(0.3, 0.4), 0.5, int2(1,1)); + uint4 txval22 = g_tTex2du4 . SampleBias(g_sSamp, float2(0.5, 0.6), 0.5, int2(1,-1)); + + float4 txval30 = g_tTex3df4 . SampleBias(g_sSamp, float3(0.1, 0.2, 0.3), 0.5, int3(1,0,1)); + int4 txval31 = g_tTex3di4 . SampleBias(g_sSamp, float3(0.4, 0.5, 0.6), 0.5, int3(1,1,1)); + uint4 txval32 = g_tTex3du4 . SampleBias(g_sSamp, float3(0.7, 0.8, 0.9), 0.5, int3(1,0,-1)); + + // There are no offset forms of cube textures, so we do not test them. + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.samplebias.offsetarray.dx10.frag b/deps/glslang/Test/hlsl.samplebias.offsetarray.dx10.frag new file mode 100644 index 00000000..b5f62968 --- /dev/null +++ b/deps/glslang/Test/hlsl.samplebias.offsetarray.dx10.frag @@ -0,0 +1,37 @@ +SamplerState g_sSamp : register(s0); + +Texture1DArray g_tTex1df4a : register(t1); + +uniform Texture1DArray g_tTex1df4 : register(t0); +Texture1DArray g_tTex1di4; +Texture1DArray g_tTex1du4; + +Texture2DArray g_tTex2df4; +Texture2DArray g_tTex2di4; +Texture2DArray g_tTex2du4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + float4 txval10 = g_tTex1df4 . SampleBias(g_sSamp, float2(0.1, 0.2), 0.5, 0); + int4 txval11 = g_tTex1di4 . SampleBias(g_sSamp, float2(0.2, 0.3), 0.5, 1); + uint4 txval12 = g_tTex1du4 . SampleBias(g_sSamp, float2(0.3, 0.4), 0.5, 2); + + float4 txval20 = g_tTex2df4 . SampleBias(g_sSamp, float3(0.1, 0.2, 0.3), 0.5, int2(0,0)); + int4 txval21 = g_tTex2di4 . SampleBias(g_sSamp, float3(0.3, 0.4, 0.5), 0.5, int2(0,0)); + uint4 txval22 = g_tTex2du4 . SampleBias(g_sSamp, float3(0.5, 0.6, 0.7), 0.5, int2(0,1)); + + // No offset array forms for 3D or cube + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.samplecmp.array.dx10.frag b/deps/glslang/Test/hlsl.samplecmp.array.dx10.frag new file mode 100644 index 00000000..f0e0a3dc --- /dev/null +++ b/deps/glslang/Test/hlsl.samplecmp.array.dx10.frag @@ -0,0 +1,60 @@ +SamplerComparisonState g_sSamp : register(s0); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +Texture1DArray g_tTex1df4a; +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // 1DArray + float r10 = g_tTex1df4a . SampleCmp(g_sSamp, float2(0.1, 0.2), 0.75); + float r12 = g_tTex1di4a . SampleCmp(g_sSamp, float2(0.1, 0.2), 0.75); + float r14 = g_tTex1du4a . SampleCmp(g_sSamp, float2(0.1, 0.2), 0.75); + + // 2DArray + float r30 = g_tTex2df4a . SampleCmp(g_sSamp, float3(0.1, 0.2, 0.3), 0.75); + float r32 = g_tTex2di4a . SampleCmp(g_sSamp, float3(0.1, 0.2, 0.3), 0.75); + float r34 = g_tTex2du4a . SampleCmp(g_sSamp, float3(0.1, 0.2, 0.3), 0.75); + + // CubeArray + float r60 = g_tTexcdf4a . SampleCmp(g_sSamp, float4(0.1, 0.2, 0.3, 0.4), 0.75); + float r62 = g_tTexcdi4a . SampleCmp(g_sSamp, float4(0.1, 0.2, 0.3, 0.4), 0.75); + float r64 = g_tTexcdu4a . SampleCmp(g_sSamp, float4(0.1, 0.2, 0.3, 0.4), 0.75); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.samplecmp.basic.dx10.frag b/deps/glslang/Test/hlsl.samplecmp.basic.dx10.frag new file mode 100644 index 00000000..cb73e14f --- /dev/null +++ b/deps/glslang/Test/hlsl.samplecmp.basic.dx10.frag @@ -0,0 +1,61 @@ +SamplerComparisonState g_sSamp : register(s0); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +Texture1DArray g_tTex1df4a; +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // 1D + float r00 = g_tTex1df4 . SampleCmp(g_sSamp, 0.1, 0.75); + float r02 = g_tTex1di4 . SampleCmp(g_sSamp, 0.1, 0.75); + float r04 = g_tTex1du4 . SampleCmp(g_sSamp, 0.1, 0.75); + + // 2D + float r20 = g_tTex2df4 . SampleCmp(g_sSamp, float2(0.1, 0.2), 0.75); + float r22 = g_tTex2di4 . SampleCmp(g_sSamp, float2(0.1, 0.2), 0.75); + float r24 = g_tTex2du4 . SampleCmp(g_sSamp, float2(0.1, 0.2), 0.75); + + // *** There's no SampleCmp on 3D textures + + float r50 = g_tTexcdf4 . SampleCmp(g_sSamp, float3(0.1, 0.2, 0.3), 0.75); + float r52 = g_tTexcdi4 . SampleCmp(g_sSamp, float3(0.1, 0.2, 0.3), 0.75); + float r54 = g_tTexcdu4 . SampleCmp(g_sSamp, float3(0.1, 0.2, 0.3), 0.75); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.samplecmp.dualmode.frag b/deps/glslang/Test/hlsl.samplecmp.dualmode.frag new file mode 100644 index 00000000..5b600f3b --- /dev/null +++ b/deps/glslang/Test/hlsl.samplecmp.dualmode.frag @@ -0,0 +1,14 @@ +SamplerState g_sSamp : register(s0); +SamplerComparisonState g_sSampCmp : register(s1); + +uniform Texture1D g_tTex : register(t3); + +float4 main() : SV_Target0 +{ + // This texture is used with both shadow modes. It will need post-compilation + // legalization. + g_tTex.SampleCmp(g_sSampCmp, 0.1, 0.75); + g_tTex.Sample(g_sSamp, 0.1); + + return 0; +} diff --git a/deps/glslang/Test/hlsl.samplecmp.negative.frag b/deps/glslang/Test/hlsl.samplecmp.negative.frag new file mode 100644 index 00000000..88519821 --- /dev/null +++ b/deps/glslang/Test/hlsl.samplecmp.negative.frag @@ -0,0 +1,13 @@ + +Texture2D g_nonShadowTex; +Texture2D g_shadowTex; +SamplerState g_shadowSampler; +SamplerComparisonState g_shadowSamplerComp; + +float4 main() : SV_Target0 +{ + g_shadowTex.SampleCmp(g_shadowSamplerComp, float2(0,0), 0); // OK + g_nonShadowTex.SampleCmp(g_shadowSampler, float2(0,0), 0); // ERROR (should be comparison sampler) + + return 0; +} diff --git a/deps/glslang/Test/hlsl.samplecmp.negative2.frag b/deps/glslang/Test/hlsl.samplecmp.negative2.frag new file mode 100644 index 00000000..33a2133a --- /dev/null +++ b/deps/glslang/Test/hlsl.samplecmp.negative2.frag @@ -0,0 +1,10 @@ + +Texture2D g_shadowTex; +SamplerState g_shadowSampler; + +float4 main() : SV_Target0 +{ + g_shadowTex.GatherCmpRed(g_shadowSampler, float2(0,0), 0, int2(0,0)); // ERROR (should be comparison sampler) + + return 0; +} diff --git a/deps/glslang/Test/hlsl.samplecmp.offset.dx10.frag b/deps/glslang/Test/hlsl.samplecmp.offset.dx10.frag new file mode 100644 index 00000000..444dac8e --- /dev/null +++ b/deps/glslang/Test/hlsl.samplecmp.offset.dx10.frag @@ -0,0 +1,66 @@ +SamplerComparisonState g_sSamp : register(s0); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +Texture1DArray g_tTex1df4a; +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // 1D + float r01 = g_tTex1df4 . SampleCmp(g_sSamp, 0.1, 0.75, 2); + float r03 = g_tTex1di4 . SampleCmp(g_sSamp, 0.1, 0.75, 2); + float r05 = g_tTex1du4 . SampleCmp(g_sSamp, 0.1, 0.75, 2); + + // 2D + float r21 = g_tTex2df4 . SampleCmp(g_sSamp, float2(0.1, 0.2), 0.75, int2(2,3)); + float r23 = g_tTex2di4 . SampleCmp(g_sSamp, float2(0.1, 0.2), 0.75, int2(2,3)); + float r25 = g_tTex2du4 . SampleCmp(g_sSamp, float2(0.1, 0.2), 0.75, int2(2,3)); + + // *** There's no SampleCmp on 3D textures + + // This page: https://msdn.microsoft.com/en-us/library/windows/desktop/bb509696(v=vs.85).aspx + // claims offset is supported for cube textures, but FXC does not accept it, and that does + // not match other methods, so it may be a documentation bug. Those lines are commented + // out below. + // Cube + // float r51 = g_tTexcdf4 . SampleCmp(g_sSamp, float3(0.1, 0.2, 0.3), 0.75, int3(2,3,4)); + // float r53 = g_tTexcdi4 . SampleCmp(g_sSamp, float3(0.1, 0.2, 0.3), 0.75, int3(2,3,4)); + // float r55 = g_tTexcdu4 . SampleCmp(g_sSamp, float3(0.1, 0.2, 0.3), 0.75, int3(2,3,4)); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.samplecmp.offsetarray.dx10.frag b/deps/glslang/Test/hlsl.samplecmp.offsetarray.dx10.frag new file mode 100644 index 00000000..319d5cdd --- /dev/null +++ b/deps/glslang/Test/hlsl.samplecmp.offsetarray.dx10.frag @@ -0,0 +1,67 @@ +SamplerComparisonState g_sSamp : register(s0); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +Texture1DArray g_tTex1df4a; +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // 1DArray + float r11 = g_tTex1df4a . SampleCmp(g_sSamp, float2(0.1, 0.2), 0.75, 2); + float r13 = g_tTex1di4a . SampleCmp(g_sSamp, float2(0.1, 0.2), 0.75, 2); + float r15 = g_tTex1du4a . SampleCmp(g_sSamp, float2(0.1, 0.2), 0.75, 2); + + // 2DArray + float r31 = g_tTex2df4a . SampleCmp(g_sSamp, float3(0.1, 0.2, 0.3), 0.75, int2(2,3)); + float r33 = g_tTex2di4a . SampleCmp(g_sSamp, float3(0.1, 0.2, 0.3), 0.75, int2(2,3)); + float r35 = g_tTex2du4a . SampleCmp(g_sSamp, float3(0.1, 0.2, 0.3), 0.75, int2(2,3)); + + // *** There's no SampleCmp on 3D textures + + // This page: https://msdn.microsoft.com/en-us/library/windows/desktop/bb509696(v=vs.85).aspx + // claims offset is supported for cube textures, but FXC does not accept it, and that does + // not match other methods, so it may be a documentation bug. Those lines are commented + // out below. + + // CubeArray + // float r61 = g_tTexcdf4a . SampleCmp(g_sSamp, float4(0.1, 0.2, 0.3, 0.4), 0.75, int3(2,3,4)); + // float r63 = g_tTexcdi4a . SampleCmp(g_sSamp, float4(0.1, 0.2, 0.3, 0.4), 0.75, int3(2,3,4)); + // float r65 = g_tTexcdu4a . SampleCmp(g_sSamp, float4(0.1, 0.2, 0.3, 0.4), 0.75, int3(2,3,4)); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.samplecmplevelzero.array.dx10.frag b/deps/glslang/Test/hlsl.samplecmplevelzero.array.dx10.frag new file mode 100644 index 00000000..41b6a793 --- /dev/null +++ b/deps/glslang/Test/hlsl.samplecmplevelzero.array.dx10.frag @@ -0,0 +1,60 @@ +SamplerComparisonState g_sSamp : register(s0); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +Texture1DArray g_tTex1df4a; +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // 1DArray + float r10 = g_tTex1df4a . SampleCmpLevelZero(g_sSamp, float2(0.1, 0.2), 0.75); + float r12 = g_tTex1di4a . SampleCmpLevelZero(g_sSamp, float2(0.1, 0.2), 0.75); + float r14 = g_tTex1du4a . SampleCmpLevelZero(g_sSamp, float2(0.1, 0.2), 0.75); + + // 2DArray + float r30 = g_tTex2df4a . SampleCmpLevelZero(g_sSamp, float3(0.1, 0.2, 0.3), 0.75); + float r32 = g_tTex2di4a . SampleCmpLevelZero(g_sSamp, float3(0.1, 0.2, 0.3), 0.75); + float r34 = g_tTex2du4a . SampleCmpLevelZero(g_sSamp, float3(0.1, 0.2, 0.3), 0.75); + + // CubeArray + float r60 = g_tTexcdf4a . SampleCmpLevelZero(g_sSamp, float4(0.1, 0.2, 0.3, 0.4), 0.75); + float r62 = g_tTexcdi4a . SampleCmpLevelZero(g_sSamp, float4(0.1, 0.2, 0.3, 0.4), 0.75); + float r64 = g_tTexcdu4a . SampleCmpLevelZero(g_sSamp, float4(0.1, 0.2, 0.3, 0.4), 0.75); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.samplecmplevelzero.basic.dx10.frag b/deps/glslang/Test/hlsl.samplecmplevelzero.basic.dx10.frag new file mode 100644 index 00000000..841530a1 --- /dev/null +++ b/deps/glslang/Test/hlsl.samplecmplevelzero.basic.dx10.frag @@ -0,0 +1,61 @@ +SamplerComparisonState g_sSamp : register(s0); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +Texture1DArray g_tTex1df4a; +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // 1D + float r00 = g_tTex1df4 . SampleCmpLevelZero(g_sSamp, 0.1, 0.75); + float r02 = g_tTex1di4 . SampleCmpLevelZero(g_sSamp, 0.1, 0.75); + float r04 = g_tTex1du4 . SampleCmpLevelZero(g_sSamp, 0.1, 0.75); + + // 2D + float r20 = g_tTex2df4 . SampleCmpLevelZero(g_sSamp, float2(0.1, 0.2), 0.75); + float r22 = g_tTex2di4 . SampleCmpLevelZero(g_sSamp, float2(0.1, 0.2), 0.75); + float r24 = g_tTex2du4 . SampleCmpLevelZero(g_sSamp, float2(0.1, 0.2), 0.75); + + // *** There's no SampleCmpLevelZero on 3D textures + + float r50 = g_tTexcdf4 . SampleCmpLevelZero(g_sSamp, float3(0.1, 0.2, 0.3), 0.75); + float r52 = g_tTexcdi4 . SampleCmpLevelZero(g_sSamp, float3(0.1, 0.2, 0.3), 0.75); + float r54 = g_tTexcdu4 . SampleCmpLevelZero(g_sSamp, float3(0.1, 0.2, 0.3), 0.75); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.samplecmplevelzero.offset.dx10.frag b/deps/glslang/Test/hlsl.samplecmplevelzero.offset.dx10.frag new file mode 100644 index 00000000..290774e2 --- /dev/null +++ b/deps/glslang/Test/hlsl.samplecmplevelzero.offset.dx10.frag @@ -0,0 +1,66 @@ +SamplerComparisonState g_sSamp : register(s0); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +Texture1DArray g_tTex1df4a; +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // 1D + float r01 = g_tTex1df4 . SampleCmpLevelZero(g_sSamp, 0.1, 0.75, 2); + float r03 = g_tTex1di4 . SampleCmpLevelZero(g_sSamp, 0.1, 0.75, 2); + float r05 = g_tTex1du4 . SampleCmpLevelZero(g_sSamp, 0.1, 0.75, 2); + + // 2D + float r21 = g_tTex2df4 . SampleCmpLevelZero(g_sSamp, float2(0.1, 0.2), 0.75, int2(2,3)); + float r23 = g_tTex2di4 . SampleCmpLevelZero(g_sSamp, float2(0.1, 0.2), 0.75, int2(2,3)); + float r25 = g_tTex2du4 . SampleCmpLevelZero(g_sSamp, float2(0.1, 0.2), 0.75, int2(2,3)); + + // *** There's no SampleCmpLevelZero on 3D textures + + // This page: https://msdn.microsoft.com/en-us/library/windows/desktop/bb509696(v=vs.85).aspx + // claims offset is supported for cube textures, but FXC does not accept it, and that does + // not match other methods, so it may be a documentation bug. Those lines are commented + // out below. + // Cube + // float r51 = g_tTexcdf4 . SampleCmpLevelZero(g_sSamp, float3(0.1, 0.2, 0.3), 0.75, int2(2,3)); + // float r53 = g_tTexcdi4 . SampleCmpLevelZero(g_sSamp, float3(0.1, 0.2, 0.3), 0.75, int2(2,3)); + // float r55 = g_tTexcdu4 . SampleCmpLevelZero(g_sSamp, float3(0.1, 0.2, 0.3), 0.75, int2(2,3)); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.samplecmplevelzero.offsetarray.dx10.frag b/deps/glslang/Test/hlsl.samplecmplevelzero.offsetarray.dx10.frag new file mode 100644 index 00000000..b57502ea --- /dev/null +++ b/deps/glslang/Test/hlsl.samplecmplevelzero.offsetarray.dx10.frag @@ -0,0 +1,67 @@ +SamplerComparisonState g_sSamp : register(s0); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +Texture1DArray g_tTex1df4a; +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // 1DArray + float r11 = g_tTex1df4a . SampleCmpLevelZero(g_sSamp, float2(0.1, 0.2), 0.75, 2); + float r13 = g_tTex1di4a . SampleCmpLevelZero(g_sSamp, float2(0.1, 0.2), 0.75, 2); + float r15 = g_tTex1du4a . SampleCmpLevelZero(g_sSamp, float2(0.1, 0.2), 0.75, 2); + + // 2DArray + float r31 = g_tTex2df4a . SampleCmpLevelZero(g_sSamp, float3(0.1, 0.2, 0.3), 0.75, int2(2,3)); + float r33 = g_tTex2di4a . SampleCmpLevelZero(g_sSamp, float3(0.1, 0.2, 0.3), 0.75, int2(2,3)); + float r35 = g_tTex2du4a . SampleCmpLevelZero(g_sSamp, float3(0.1, 0.2, 0.3), 0.75, int2(2,3)); + + // *** There's no SampleCmpLevelZero on 3D textures + + // This page: https://msdn.microsoft.com/en-us/library/windows/desktop/bb509696(v=vs.85).aspx + // claims offset is supported for cube textures, but FXC does not accept it, and that does + // not match other methods, so it may be a documentation bug. Those lines are commented + // out below. + + // CubeArray + // float r61 = g_tTexcdf4a . SampleCmpLevelZero(g_sSamp, float4(0.1, 0.2, 0.3, 0.4), 0.75, int3(2,3,4)); + // float r63 = g_tTexcdi4a . SampleCmpLevelZero(g_sSamp, float4(0.1, 0.2, 0.3, 0.4), 0.75, int3(2,3,4)); + // float r65 = g_tTexcdu4a . SampleCmpLevelZero(g_sSamp, float4(0.1, 0.2, 0.3, 0.4), 0.75, int3(2,3,4)); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.samplegrad.array.dx10.frag b/deps/glslang/Test/hlsl.samplegrad.array.dx10.frag new file mode 100644 index 00000000..c442b7f8 --- /dev/null +++ b/deps/glslang/Test/hlsl.samplegrad.array.dx10.frag @@ -0,0 +1,43 @@ +SamplerState g_sSamp : register(s0); + +Texture1DArray g_tTex1df4a : register(t1); + +uniform Texture1DArray g_tTex1df4 : register(t0); +Texture1DArray g_tTex1di4; +Texture1DArray g_tTex1du4; + +Texture2DArray g_tTex2df4; +Texture2DArray g_tTex2di4; +Texture2DArray g_tTex2du4; + +TextureCubeArray g_tTexcdf4; +TextureCubeArray g_tTexcdi4; +TextureCubeArray g_tTexcdu4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + float4 txval10 = g_tTex1df4 . SampleGrad(g_sSamp, float2(0.1, 0.2), 1.1, 1.2); + int4 txval11 = g_tTex1di4 . SampleGrad(g_sSamp, float2(0.1, 0.2), 1.1, 1.2); + uint4 txval12 = g_tTex1du4 . SampleGrad(g_sSamp, float2(0.1, 0.2), 1.1, 1.2); + + float4 txval20 = g_tTex2df4 . SampleGrad(g_sSamp, float3(0.1, 0.2, 0.3), float2(1.1, 1.2), float2(1.1, 1.2)); + int4 txval21 = g_tTex2di4 . SampleGrad(g_sSamp, float3(0.1, 0.2, 0.3), float2(1.1, 1.2), float2(1.1, 1.2)); + uint4 txval22 = g_tTex2du4 . SampleGrad(g_sSamp, float3(0.1, 0.2, 0.3), float2(1.1, 1.2), float2(1.1, 1.2)); + + float4 txval40 = g_tTexcdf4 . SampleGrad(g_sSamp, float4(0.1, 0.2, 0.3, 0.4), float3(1.1, 1.2, 1.3), float3(1.1, 1.2, 1.3)); + int4 txval41 = g_tTexcdi4 . SampleGrad(g_sSamp, float4(0.1, 0.2, 0.3, 0.4), float3(1.1, 1.2, 1.3), float3(1.1, 1.2, 1.3)); + uint4 txval42 = g_tTexcdu4 . SampleGrad(g_sSamp, float4(0.1, 0.2, 0.3, 0.4), float3(1.1, 1.2, 1.3), float3(1.1, 1.2, 1.3)); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.samplegrad.basic.dx10.frag b/deps/glslang/Test/hlsl.samplegrad.basic.dx10.frag new file mode 100644 index 00000000..84236f2a --- /dev/null +++ b/deps/glslang/Test/hlsl.samplegrad.basic.dx10.frag @@ -0,0 +1,51 @@ +SamplerState g_sSamp : register(s0); + +Texture1D g_tTex1df4a : register(t1); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + float4 txval10 = g_tTex1df4 . SampleGrad(g_sSamp, 0.1, 1.1, 1.2); + int4 txval11 = g_tTex1di4 . SampleGrad(g_sSamp, 0.2, 1.1, 1.2); + uint4 txval12 = g_tTex1du4 . SampleGrad(g_sSamp, 0.3, 1.1, 1.2); + + float4 txval20 = g_tTex2df4 . SampleGrad(g_sSamp, float2(0.1, 0.2), float2(1.1, 1.2), float2(1.1, 1.2)); + int4 txval21 = g_tTex2di4 . SampleGrad(g_sSamp, float2(0.3, 0.4), float2(1.1, 1.2), float2(1.1, 1.2)); + uint4 txval22 = g_tTex2du4 . SampleGrad(g_sSamp, float2(0.5, 0.6), float2(1.1, 1.2), float2(1.1, 1.2)); + + float4 txval30 = g_tTex3df4 . SampleGrad(g_sSamp, float3(0.1, 0.2, 0.3), float3(1.1, 1.2, 1.3), float3(1.1, 1.2, 1.3)); + int4 txval31 = g_tTex3di4 . SampleGrad(g_sSamp, float3(0.4, 0.5, 0.6), float3(1.1, 1.2, 1.3), float3(1.1, 1.2, 1.3)); + uint4 txval32 = g_tTex3du4 . SampleGrad(g_sSamp, float3(0.7, 0.8, 0.9), float3(1.1, 1.2, 1.3), float3(1.1, 1.2, 1.3)); + + float4 txval40 = g_tTexcdf4 . SampleGrad(g_sSamp, float3(0.1, 0.2, 0.3), float3(1.1, 1.2, 1.3), float3(1.1, 1.2, 1.3)); + int4 txval41 = g_tTexcdi4 . SampleGrad(g_sSamp, float3(0.4, 0.5, 0.6), float3(1.1, 1.2, 1.3), float3(1.1, 1.2, 1.3)); + uint4 txval42 = g_tTexcdu4 . SampleGrad(g_sSamp, float3(0.7, 0.8, 0.9), float3(1.1, 1.2, 1.3), float3(1.1, 1.2, 1.3)); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.samplegrad.basic.dx10.vert b/deps/glslang/Test/hlsl.samplegrad.basic.dx10.vert new file mode 100644 index 00000000..43ec6213 --- /dev/null +++ b/deps/glslang/Test/hlsl.samplegrad.basic.dx10.vert @@ -0,0 +1,49 @@ +SamplerState g_sSamp : register(s0); + +Texture1D g_tTex1df4a : register(t1); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +struct VS_OUTPUT +{ + float4 Pos : SV_Position; +}; + +VS_OUTPUT main() +{ + VS_OUTPUT vsout; + + float4 txval10 = g_tTex1df4 . SampleGrad(g_sSamp, 0.1, 1.1, 1.2); + int4 txval11 = g_tTex1di4 . SampleGrad(g_sSamp, 0.2, 1.1, 1.2); + uint4 txval12 = g_tTex1du4 . SampleGrad(g_sSamp, 0.3, 1.1, 1.2); + + float4 txval20 = g_tTex2df4 . SampleGrad(g_sSamp, float2(0.1, 0.2), float2(1.1, 1.2), float2(1.1, 1.2)); + int4 txval21 = g_tTex2di4 . SampleGrad(g_sSamp, float2(0.3, 0.4), float2(1.1, 1.2), float2(1.1, 1.2)); + uint4 txval22 = g_tTex2du4 . SampleGrad(g_sSamp, float2(0.5, 0.6), float2(1.1, 1.2), float2(1.1, 1.2)); + + float4 txval30 = g_tTex3df4 . SampleGrad(g_sSamp, float3(0.1, 0.2, 0.3), float3(1.1, 1.2, 1.3), float3(1.1, 1.2, 1.3)); + int4 txval31 = g_tTex3di4 . SampleGrad(g_sSamp, float3(0.4, 0.5, 0.6), float3(1.1, 1.2, 1.3), float3(1.1, 1.2, 1.3)); + uint4 txval32 = g_tTex3du4 . SampleGrad(g_sSamp, float3(0.7, 0.8, 0.9), float3(1.1, 1.2, 1.3), float3(1.1, 1.2, 1.3)); + + float4 txval40 = g_tTexcdf4 . SampleGrad(g_sSamp, float3(0.1, 0.2, 0.3), float3(1.1, 1.2, 1.3), float3(1.1, 1.2, 1.3)); + int4 txval41 = g_tTexcdi4 . SampleGrad(g_sSamp, float3(0.4, 0.5, 0.6), float3(1.1, 1.2, 1.3), float3(1.1, 1.2, 1.3)); + uint4 txval42 = g_tTexcdu4 . SampleGrad(g_sSamp, float3(0.7, 0.8, 0.9), float3(1.1, 1.2, 1.3), float3(1.1, 1.2, 1.3)); + + vsout.Pos = float4(0,0,0,0); + + return vsout; +} diff --git a/deps/glslang/Test/hlsl.samplegrad.offset.dx10.frag b/deps/glslang/Test/hlsl.samplegrad.offset.dx10.frag new file mode 100644 index 00000000..c643be25 --- /dev/null +++ b/deps/glslang/Test/hlsl.samplegrad.offset.dx10.frag @@ -0,0 +1,49 @@ +SamplerState g_sSamp : register(s0); + +Texture1D g_tTex1df4a : register(t1); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + float4 txval10 = g_tTex1df4 . SampleGrad(g_sSamp, 0.1, 1.1, 1.2, 1); + int4 txval11 = g_tTex1di4 . SampleGrad(g_sSamp, 0.2, 1.1, 1.2, 1); + uint4 txval12 = g_tTex1du4 . SampleGrad(g_sSamp, 0.3, 1.1, 1.2, 1); + + float4 txval20 = g_tTex2df4 . SampleGrad(g_sSamp, float2(0.1, 0.2), float2(0.1, 0.2), float2(1.1, 1.2), int2(1,0)); + int4 txval21 = g_tTex2di4 . SampleGrad(g_sSamp, float2(0.3, 0.4), float2(0.1, 0.2), float2(1.1, 1.2), int2(1,1)); + uint4 txval22 = g_tTex2du4 . SampleGrad(g_sSamp, float2(0.5, 0.6), float2(0.1, 0.2), float2(1.1, 1.2), int2(1,-1)); + + float4 txval30 = g_tTex3df4 . SampleGrad(g_sSamp, float3(0.1, 0.2, 0.3), float3(1.1, 1.2, 1.3), float3(1.1, 1.2, 1.3), int3(1,0,1)); + int4 txval31 = g_tTex3di4 . SampleGrad(g_sSamp, float3(0.4, 0.5, 0.6), float3(1.1, 1.2, 1.3), float3(1.1, 1.2, 1.3), int3(1,1,1)); + uint4 txval32 = g_tTex3du4 . SampleGrad(g_sSamp, float3(0.7, 0.8, 0.9), float3(1.1, 1.2, 1.3), float3(1.1, 1.2, 1.3), int3(1,0,-1)); + + // There are no offset forms of cube textures, so we do not test them. + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.samplegrad.offsetarray.dx10.frag b/deps/glslang/Test/hlsl.samplegrad.offsetarray.dx10.frag new file mode 100644 index 00000000..3adcd184 --- /dev/null +++ b/deps/glslang/Test/hlsl.samplegrad.offsetarray.dx10.frag @@ -0,0 +1,39 @@ +SamplerState g_sSamp : register(s0); + +Texture1DArray g_tTex1df4a : register(t1); + +uniform Texture1DArray g_tTex1df4 : register(t0); +Texture1DArray g_tTex1di4; +Texture1DArray g_tTex1du4; + +Texture2DArray g_tTex2df4; +Texture2DArray g_tTex2di4; +Texture2DArray g_tTex2du4; + +TextureCubeArray g_tTexcdf4; +TextureCubeArray g_tTexcdi4; +TextureCubeArray g_tTexcdu4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + float4 txval10 = g_tTex1df4 . SampleGrad(g_sSamp, float2(0.1, 0.2), 1.1, 1.2, 1); + int4 txval11 = g_tTex1di4 . SampleGrad(g_sSamp, float2(0.1, 0.2), 1.1, 1.2, 1); + uint4 txval12 = g_tTex1du4 . SampleGrad(g_sSamp, float2(0.1, 0.2), 1.1, 1.2, 1); + + float4 txval20 = g_tTex2df4 . SampleGrad(g_sSamp, float3(0.1, 0.2, 0.3), float2(1.1, 1.2), float2(1.1, 1.2), int2(1,0)); + int4 txval21 = g_tTex2di4 . SampleGrad(g_sSamp, float3(0.1, 0.2, 0.3), float2(1.1, 1.2), float2(1.1, 1.2), int2(1,0)); + uint4 txval22 = g_tTex2du4 . SampleGrad(g_sSamp, float3(0.1, 0.2, 0.3), float2(1.1, 1.2), float2(1.1, 1.2), int2(1,0)); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.samplelevel.array.dx10.frag b/deps/glslang/Test/hlsl.samplelevel.array.dx10.frag new file mode 100644 index 00000000..c52aeb29 --- /dev/null +++ b/deps/glslang/Test/hlsl.samplelevel.array.dx10.frag @@ -0,0 +1,43 @@ +SamplerState g_sSamp : register(s0); + +Texture1DArray g_tTex1df4a : register(t1); + +uniform Texture1DArray g_tTex1df4 : register(t0); +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +TextureCubeArray g_tTexcdf4a; +TextureCubeArray g_tTexcdi4a; +TextureCubeArray g_tTexcdu4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + float4 txval10 = g_tTex1df4a . SampleLevel(g_sSamp, float2(0.1, 0.2), 0.75); + int4 txval11 = g_tTex1di4a . SampleLevel(g_sSamp, float2(0.2, 0.3), 0.75); + uint4 txval12 = g_tTex1du4a . SampleLevel(g_sSamp, float2(0.3, 0.4), 0.75); + + float4 txval20 = g_tTex2df4a . SampleLevel(g_sSamp, float3(0.1, 0.2, 0.3), 0.75); + int4 txval21 = g_tTex2di4a . SampleLevel(g_sSamp, float3(0.3, 0.4, 0.5), 0.75); + uint4 txval22 = g_tTex2du4a . SampleLevel(g_sSamp, float3(0.5, 0.6, 0.7), 0.75); + + float4 txval40 = g_tTexcdf4a . SampleLevel(g_sSamp, float4(0.1, 0.2, 0.3, 0.4), 0.75); + int4 txval41 = g_tTexcdi4a . SampleLevel(g_sSamp, float4(0.4, 0.5, 0.6, 0.7), 0.75); + uint4 txval42 = g_tTexcdu4a . SampleLevel(g_sSamp, float4(0.7, 0.8, 0.9, 1.0), 0.75); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.samplelevel.basic.dx10.frag b/deps/glslang/Test/hlsl.samplelevel.basic.dx10.frag new file mode 100644 index 00000000..fb363ae8 --- /dev/null +++ b/deps/glslang/Test/hlsl.samplelevel.basic.dx10.frag @@ -0,0 +1,52 @@ +SamplerState g_sSamp : register(s0); +uniform sampler2D g_sSamp2d; + +Texture1D g_tTex1df4a : register(t1); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + float4 txval10 = g_tTex1df4 . SampleLevel(g_sSamp, 0.1, 0.75); + int4 txval11 = g_tTex1di4 . SampleLevel(g_sSamp, 0.2, 0.75); + uint4 txval12 = g_tTex1du4 . SampleLevel(g_sSamp, 0.3, 0.75); + + float4 txval20 = g_tTex2df4 . SampleLevel(g_sSamp, float2(0.1, 0.2), 0.75); + int4 txval21 = g_tTex2di4 . SampleLevel(g_sSamp, float2(0.3, 0.4), 0.75); + uint4 txval22 = g_tTex2du4 . SampleLevel(g_sSamp, float2(0.5, 0.6), 0.75); + + float4 txval30 = g_tTex3df4 . SampleLevel(g_sSamp, float3(0.1, 0.2, 0.3), 0.75); + int4 txval31 = g_tTex3di4 . SampleLevel(g_sSamp, float3(0.4, 0.5, 0.6), 0.75); + uint4 txval32 = g_tTex3du4 . SampleLevel(g_sSamp, float3(0.7, 0.8, 0.9), 0.75); + + float4 txval40 = g_tTexcdf4 . SampleLevel(g_sSamp, float3(0.1, 0.2, 0.3), 0.75); + int4 txval41 = g_tTexcdi4 . SampleLevel(g_sSamp, float3(0.4, 0.5, 0.6), 0.75); + uint4 txval42 = g_tTexcdu4 . SampleLevel(g_sSamp, float3(0.7, 0.8, 0.9), 0.75); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.samplelevel.basic.dx10.vert b/deps/glslang/Test/hlsl.samplelevel.basic.dx10.vert new file mode 100644 index 00000000..03febcff --- /dev/null +++ b/deps/glslang/Test/hlsl.samplelevel.basic.dx10.vert @@ -0,0 +1,49 @@ +SamplerState g_sSamp : register(s0); + +Texture1D g_tTex1df4a : register(t1); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +struct VS_OUTPUT +{ + float4 Pos : SV_Position; +}; + +VS_OUTPUT main() +{ + VS_OUTPUT vsout; + + float4 txval10 = g_tTex1df4 . SampleLevel(g_sSamp, 0.1, 0.75); + int4 txval11 = g_tTex1di4 . SampleLevel(g_sSamp, 0.2, 0.75); + uint4 txval12 = g_tTex1du4 . SampleLevel(g_sSamp, 0.3, 0.75); + + float4 txval20 = g_tTex2df4 . SampleLevel(g_sSamp, float2(0.1, 0.2), 0.75); + int4 txval21 = g_tTex2di4 . SampleLevel(g_sSamp, float2(0.3, 0.4), 0.75); + uint4 txval22 = g_tTex2du4 . SampleLevel(g_sSamp, float2(0.5, 0.6), 0.75); + + float4 txval30 = g_tTex3df4 . SampleLevel(g_sSamp, float3(0.1, 0.2, 0.3), 0.75); + int4 txval31 = g_tTex3di4 . SampleLevel(g_sSamp, float3(0.4, 0.5, 0.6), 0.75); + uint4 txval32 = g_tTex3du4 . SampleLevel(g_sSamp, float3(0.7, 0.8, 0.9), 0.75); + + float4 txval40 = g_tTexcdf4 . SampleLevel(g_sSamp, float3(0.1, 0.2, 0.3), 0.75); + int4 txval41 = g_tTexcdi4 . SampleLevel(g_sSamp, float3(0.4, 0.5, 0.6), 0.75); + uint4 txval42 = g_tTexcdu4 . SampleLevel(g_sSamp, float3(0.7, 0.8, 0.9), 0.75); + + vsout.Pos = float4(0,0,0,0); + + return vsout; +} diff --git a/deps/glslang/Test/hlsl.samplelevel.offset.dx10.frag b/deps/glslang/Test/hlsl.samplelevel.offset.dx10.frag new file mode 100644 index 00000000..14906116 --- /dev/null +++ b/deps/glslang/Test/hlsl.samplelevel.offset.dx10.frag @@ -0,0 +1,49 @@ +SamplerState g_sSamp : register(s0); + +Texture1D g_tTex1df4a : register(t1); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + float4 txval10 = g_tTex1df4 . SampleLevel(g_sSamp, 0.1, 0.75, 1); + int4 txval11 = g_tTex1di4 . SampleLevel(g_sSamp, 0.2, 0.75, 1); + uint4 txval12 = g_tTex1du4 . SampleLevel(g_sSamp, 0.3, 0.75, 1); + + float4 txval20 = g_tTex2df4 . SampleLevel(g_sSamp, float2(0.1, 0.2), 0.75, int2(1,0)); + int4 txval21 = g_tTex2di4 . SampleLevel(g_sSamp, float2(0.3, 0.4), 0.75, int2(1,1)); + uint4 txval22 = g_tTex2du4 . SampleLevel(g_sSamp, float2(0.5, 0.6), 0.75, int2(1,-1)); + + float4 txval30 = g_tTex3df4 . SampleLevel(g_sSamp, float3(0.1, 0.2, 0.3), 0.75, int3(1,0,1)); + int4 txval31 = g_tTex3di4 . SampleLevel(g_sSamp, float3(0.4, 0.5, 0.6), 0.75, int3(1,1,1)); + uint4 txval32 = g_tTex3du4 . SampleLevel(g_sSamp, float3(0.7, 0.8, 0.9), 0.75, int3(1,0,-1)); + + // There are no offset forms of cube textures, so we do not test them. + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.samplelevel.offsetarray.dx10.frag b/deps/glslang/Test/hlsl.samplelevel.offsetarray.dx10.frag new file mode 100644 index 00000000..5c7bd71a --- /dev/null +++ b/deps/glslang/Test/hlsl.samplelevel.offsetarray.dx10.frag @@ -0,0 +1,37 @@ +SamplerState g_sSamp : register(s0); + +Texture1DArray g_tTex1df4a : register(t1); + +uniform Texture1DArray g_tTex1df4 : register(t0); +Texture1DArray g_tTex1di4; +Texture1DArray g_tTex1du4; + +Texture2DArray g_tTex2df4; +Texture2DArray g_tTex2di4; +Texture2DArray g_tTex2du4; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + float4 txval10 = g_tTex1df4 . SampleLevel(g_sSamp, float2(0.1, 0.2), 0.75, 0); + int4 txval11 = g_tTex1di4 . SampleLevel(g_sSamp, float2(0.2, 0.3), 0.75, 1); + uint4 txval12 = g_tTex1du4 . SampleLevel(g_sSamp, float2(0.3, 0.4), 0.75, 2); + + float4 txval20 = g_tTex2df4 . SampleLevel(g_sSamp, float3(0.1, 0.2, 0.3), 0.75, int2(0,0)); + int4 txval21 = g_tTex2di4 . SampleLevel(g_sSamp, float3(0.3, 0.4, 0.5), 0.75, int2(0,0)); + uint4 txval22 = g_tTex2du4 . SampleLevel(g_sSamp, float3(0.5, 0.6, 0.7), 0.75, int2(0,1)); + + // No offset array forms for 3D or cube + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.scalar-length.frag b/deps/glslang/Test/hlsl.scalar-length.frag new file mode 100644 index 00000000..2b7ebdb9 --- /dev/null +++ b/deps/glslang/Test/hlsl.scalar-length.frag @@ -0,0 +1,6 @@ +float4 main() : SV_Target0 +{ + float4 test = { 0, 1, 2, 3 }; + + return length(test.a); +} diff --git a/deps/glslang/Test/hlsl.scalar2matrix.frag b/deps/glslang/Test/hlsl.scalar2matrix.frag new file mode 100644 index 00000000..40688757 --- /dev/null +++ b/deps/glslang/Test/hlsl.scalar2matrix.frag @@ -0,0 +1,28 @@ + +void Fn1(float4x4 p) { } + +float4 main() : SV_TARGET +{ + const float4x4 mat1c = 0.20; + const float4x4 mat2c = {2, 2.1, 2.2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + const float4x4 mat3c = (float4x4)float1(0.1); + + float4x4 mat1 = 0.25; + float4x4 mat2 = {3, 3.1, 3.2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + float4x4 mat3 = (float4x4)0.375; + // float4x4 mat5 = (float4x4)Fn2(); // TODO: enable when compex rvalue handling is in place + + float4x4 mat4; + mat4 = 0.75; + mat4 = float4x4(4, 4.1, 4.2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + mat4 = (float4x4)0.5; + + mat4 *= 0.75; + mat4 += 0.75; + mat4 -= 0.5; + mat4 /= 2.0; + + Fn1(5.0); // test calling fn accepting matrix with scalar type + + return mat1c[0] + mat3c[0] + mat1[1] + mat4[2]; +} diff --git a/deps/glslang/Test/hlsl.scalarCast.vert b/deps/glslang/Test/hlsl.scalarCast.vert new file mode 100644 index 00000000..83bfd6eb --- /dev/null +++ b/deps/glslang/Test/hlsl.scalarCast.vert @@ -0,0 +1,37 @@ +struct VertexOut { + float4 position : SV_Position; + float2 texCoord : TEXCOORD; +}; +VertexOut r0() { + const float f = 2.0; + return (VertexOut)f; +} +VertexOut r1() { + const float f = 2.0; + return (VertexOut)(f + 1.0); +} +VertexOut r2() { + const float f = 2.0; + return (VertexOut)(sin(f)); +} +VertexOut r3() { + float f = 2.0; + return (VertexOut)f; +} +VertexOut r4() { + float f = 2.0; + return (VertexOut)(f + 1.0); +} +VertexOut r5() { + float f = 2.0; + return (VertexOut)(sin(f)); +} +VertexOut main() { + VertexOut v0 = r0(); + VertexOut v1 = r1(); + VertexOut v2 = r2(); + VertexOut v3 = r3(); + VertexOut v4 = r4(); + VertexOut v5 = r5(); + return (VertexOut)1; +} diff --git a/deps/glslang/Test/hlsl.scope.frag b/deps/glslang/Test/hlsl.scope.frag new file mode 100644 index 00000000..a5309ca2 --- /dev/null +++ b/deps/glslang/Test/hlsl.scope.frag @@ -0,0 +1,30 @@ +void PixelShaderFunction(float4 input) : COLOR0 +{ + int x; + x; + { + float x; + x; + { + bool x; + x; + { + float3 x; + x; + } + x; + } + x; + } + x; + + if (x > 0) + bool x; + + while (x > 0) + bool x; + + do { + bool x; + } while (x > 0); +} diff --git a/deps/glslang/Test/hlsl.self_cast.frag b/deps/glslang/Test/hlsl.self_cast.frag new file mode 100644 index 00000000..8ef40270 --- /dev/null +++ b/deps/glslang/Test/hlsl.self_cast.frag @@ -0,0 +1,25 @@ +struct Test0 {}; +struct Test1 { float f; }; + +void main() +{ + { + Test0 a; + Test0 b = (Test0)a; + } + + { + Test1 a; + Test1 b = (Test1)a; + } + + { + Test0 a[2]; + Test0 b[2] = (Test0[2])a; + } + + { + Test1 a[2]; + Test1 b[2] = (Test1[2])a; + } +} diff --git a/deps/glslang/Test/hlsl.semantic-1.vert b/deps/glslang/Test/hlsl.semantic-1.vert new file mode 100644 index 00000000..ec92428c --- /dev/null +++ b/deps/glslang/Test/hlsl.semantic-1.vert @@ -0,0 +1,24 @@ +#define DLAYER 3 + +#define DMACRO1 TEXCOORD1 +#define DMACRO(num) TEXCOORD##num + +struct S { + float4 pos : POSITION; + float2 UV0 : TEXCOORD0; + float2 UV1 : DMACRO1; + float2 UV2 : DMACRO(2); + float2 UV3 : DMACRO(DLAYER); +}; + + +S main(float4 v : POSITION) +{ + S s; + s.pos = v; + s.UV0 = float2(v.x,v.x); + s.UV1 = float2(v.y,v.y); + s.UV2 = float2(v.z,v.z); + s.UV3 = float2(v.w,v.w); + return s; +} diff --git a/deps/glslang/Test/hlsl.semantic.geom b/deps/glslang/Test/hlsl.semantic.geom new file mode 100644 index 00000000..fc6a53ab --- /dev/null +++ b/deps/glslang/Test/hlsl.semantic.geom @@ -0,0 +1,16 @@ +struct S { + float clip0 : SV_Position; + float clip0 : SV_ClipDistance0; + float cull0 : SV_CullDistance0; + uint vpai : SV_ViewportArrayIndex; + uint rtai : SV_RenderTargetArrayIndex; + int ii : SV_InstanceID; +}; + +[maxvertexcount(4)] +void main(triangle in uint VertexID[3] : VertexID, + inout LineStream OutputStream) +{ + S s; + OutputStream.Append(s); +} diff --git a/deps/glslang/Test/hlsl.semantic.vert b/deps/glslang/Test/hlsl.semantic.vert new file mode 100644 index 00000000..1845dc3c --- /dev/null +++ b/deps/glslang/Test/hlsl.semantic.vert @@ -0,0 +1,13 @@ +struct S { + float clip0 : SV_ClipDistance0; + float clip1 : SV_ClipDistance1; + float cull0 : SV_CullDistance0; + float cull1 : SV_CullDistance1; + int ii : SV_InstanceID; +}; + +S main(S ins) +{ + S s; + return s; +} diff --git a/deps/glslang/Test/hlsl.semicolons.frag b/deps/glslang/Test/hlsl.semicolons.frag new file mode 100644 index 00000000..28fdedd9 --- /dev/null +++ b/deps/glslang/Test/hlsl.semicolons.frag @@ -0,0 +1,19 @@ + +void MyFunc() { } + +;;; +; +; ; ; // HLSL allows stray global scope semicolons. + +void MyFunc2() {;;;}; + +struct PS_OUTPUT { float4 color : SV_Target0; };;;;; + +;PS_OUTPUT main() +{ + PS_OUTPUT ps_output;;; + ; + ps_output.color = 1.0; + return ps_output; +}; + diff --git a/deps/glslang/Test/hlsl.shapeConv.frag b/deps/glslang/Test/hlsl.shapeConv.frag new file mode 100644 index 00000000..bc09d80a --- /dev/null +++ b/deps/glslang/Test/hlsl.shapeConv.frag @@ -0,0 +1,49 @@ +float4 PixelShaderFunction(float4 input, float f) : COLOR0 +{ + float4 v; + v = 1; + v = 2.0; + v = f; + float3 u; + u = float(1); + u = float(2.0); + u = float(f); + float2 w = 2.0; + float V = 1; + float3 MyVal = V; + + float3 foo; + foo > 4.0; + foo >= 5.0; + 6.0 < foo; + 7.0 <= foo; + + all(v.x == v); + any(f != v); + + float1 f1; + + f1 == v; + v < f1; + f1.x; + f1.xxx; + + const float4 f4 = 3.0; + + uint ui; + uint3 ui3; + + ui >> ui3; + ui3 >> ui; + + v *= f1; + f1 *= v; + + float3 mixed = u * v; + f = u; + f1 = u; + float sf = v; + float1 sf1 = v; + + return input * f4; +} diff --git a/deps/glslang/Test/hlsl.shapeConvRet.frag b/deps/glslang/Test/hlsl.shapeConvRet.frag new file mode 100644 index 00000000..7d775582 --- /dev/null +++ b/deps/glslang/Test/hlsl.shapeConvRet.frag @@ -0,0 +1,9 @@ +int3 foo() +{ + return 13; +} + +float4 main(float f) +{ + return f; +} diff --git a/deps/glslang/Test/hlsl.shift.per-set.frag b/deps/glslang/Test/hlsl.shift.per-set.frag new file mode 100644 index 00000000..d7c0243e --- /dev/null +++ b/deps/glslang/Test/hlsl.shift.per-set.frag @@ -0,0 +1,60 @@ +// Test register class offsets for different resource types + +SamplerState s1 : register(s1, space1); +SamplerComparisonState s2 : register(s2, space2); + +Texture1D t1 : register(t1, space1); +Texture2D t2 : register(t2, space1); +Texture3D t3 : register(t1, space2); +Texture3D ts6 : register(t1, space6); +StructuredBuffer t4 : register(t1, space3); + +ByteAddressBuffer t5 : register(t2, space3); +Buffer t6 : register(t3, space3); + +RWTexture1D u1 : register(u1, space1); +RWTexture2D u2 : register(u2, space2); +RWTexture3D u3 : register(u3, space2); + +RWBuffer u4 : register(u4, space1); +RWByteAddressBuffer u5 : register(u4, space2); +RWStructuredBuffer u6 : register(u4, space3); +AppendStructuredBuffer u7 : register(u4, space4); +ConsumeStructuredBuffer u8 : register(u4, space5); + +cbuffer cb : register(b1, space6) { + int cb1; +}; + +tbuffer tb : register(t7) { + int tb1; +}; + +float4 main() : SV_Target0 +{ + t1; + t2; + t3; + t4[0]; + t5.Load(0); + t6; + + s1; + s2; + + u1; + u2; + u3; + + u4[0]; + u5.Load(0); + u6[0]; + u7; + u8; + + cb1; + tb1; + ts6; + + return 0; +} diff --git a/deps/glslang/Test/hlsl.sin.frag b/deps/glslang/Test/hlsl.sin.frag new file mode 100644 index 00000000..edf087de --- /dev/null +++ b/deps/glslang/Test/hlsl.sin.frag @@ -0,0 +1,4 @@ +float4 PixelShaderFunction(float4 input) : COLOR0 +{ + return sin(input); +} diff --git a/deps/glslang/Test/hlsl.snorm.uav.comp b/deps/glslang/Test/hlsl.snorm.uav.comp new file mode 100644 index 00000000..c6cafebe --- /dev/null +++ b/deps/glslang/Test/hlsl.snorm.uav.comp @@ -0,0 +1,15 @@ + +unorm float4 uf4; + +Texture3D ResultInU: register(t0); +RWTexture3D ResultOutU: register(u0); + +Texture3D ResultInS: register(t1); +RWTexture3D ResultOutS: register(u1); + +[numthreads(16, 16, 1)] +void main(uint3 tid: SV_DispatchThreadID) +{ + ResultOutS[tid] = ResultInS[tid] + uf4; + ResultOutU[tid] = ResultInU[tid]; +} diff --git a/deps/glslang/Test/hlsl.staticFuncInit.frag b/deps/glslang/Test/hlsl.staticFuncInit.frag new file mode 100644 index 00000000..f61c5661 --- /dev/null +++ b/deps/glslang/Test/hlsl.staticFuncInit.frag @@ -0,0 +1,20 @@ +static float x = 1.0; + +float f1() +{ + static float x = 2.0; + x += 10.0; + return x; +} + +float f2(float p) +{ + static float x = 7.0; + x += p; + return x; +} + +float4 main() : SV_TARGET +{ + return x + f1() + f1() + f2(5.0) + f2(x); +} diff --git a/deps/glslang/Test/hlsl.staticMemberFunction.frag b/deps/glslang/Test/hlsl.staticMemberFunction.frag new file mode 100644 index 00000000..700aa82c --- /dev/null +++ b/deps/glslang/Test/hlsl.staticMemberFunction.frag @@ -0,0 +1,22 @@ +struct Test +{ + float4 memVar; + static float4 staticMemFun(float4 a) : SV_Position + { + return 2 * a; + } + static int staticMemFun(int a) : SV_Position + { + return 2 + a; + } + int i; +}; + +float4 main() : SV_Target0 +{ + Test test; + float4 f4 = float4(1.0,1.0,1.0,1.0); + f4 += Test::staticMemFun(float4(5.0f,5.0f,5.0f,5.0f)); + f4 += Test::staticMemFun(7); + return f4; +} diff --git a/deps/glslang/Test/hlsl.store.rwbyteaddressbuffer.type.comp b/deps/glslang/Test/hlsl.store.rwbyteaddressbuffer.type.comp new file mode 100644 index 00000000..5400d81f --- /dev/null +++ b/deps/glslang/Test/hlsl.store.rwbyteaddressbuffer.type.comp @@ -0,0 +1,8 @@ +RWByteAddressBuffer buffer; + +[numthreads(64, 1, 1)] +void main( uint3 dispatchThreadID : SV_DispatchThreadID) +{ + if(dispatchThreadID.x == 0) + buffer.Store(0, 2); +} \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.string.frag b/deps/glslang/Test/hlsl.string.frag new file mode 100644 index 00000000..572e73b7 --- /dev/null +++ b/deps/glslang/Test/hlsl.string.frag @@ -0,0 +1,12 @@ +string s = "string1"; +string e = ""; +string bracket < string a = "nested" ; > ; +string brackets < string b = "nest1" ; string c = "nest2" ; float test [ 4 ] = { 1.0 , 1.0 , 1.0 , 1.0 } ; vector a = float3(2.0); > ; +string brackete1 < > ; +string brackete2 < ; > ; +string brackete3 < ; ; > ; + +float main(float f) +{ + return f; +} \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.stringtoken.frag b/deps/glslang/Test/hlsl.stringtoken.frag new file mode 100644 index 00000000..fe785e6d --- /dev/null +++ b/deps/glslang/Test/hlsl.stringtoken.frag @@ -0,0 +1,20 @@ + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +Texture2D TestTexture < + string TestAttribute1 = "TestAttribute"; + string TestAttribute2 = "false"; + int TestAttribute3 = 3; +>; + +uniform float4 TestUF ; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + psout.Color = float4(0,0,0,1); + return psout; +} diff --git a/deps/glslang/Test/hlsl.struct.frag b/deps/glslang/Test/hlsl.struct.frag new file mode 100644 index 00000000..33199e06 --- /dev/null +++ b/deps/glslang/Test/hlsl.struct.frag @@ -0,0 +1,53 @@ +struct { +}; + +struct { + bool b; +}; + +struct myS { + bool b, c; + float4 a, d; +}; + +myS s1; + +static class { + float4 i; +} s2; + +struct IN_S { + linear float4 a; + nointerpolation bool b; + noperspective centroid float1 c; + sample centroid float2 d; + bool ff1 : SV_IsFrontFace; + bool ff2 : packoffset(c0.y); + bool ff3 : packoffset(c0.y) : register(ps_5_0, s0) ; + float4 ff4 : VPOS : packoffset(c0.y) : register(ps_5_0, s0) ; +}; + +float ff5 : packoffset(c101.y) : register(ps_5_0, s[5]); +float ff6 : packoffset(c102.y) : register(s3[5]); + +struct empty {}; + +struct containEmpty { + empty e; +}; + +float4 PixelShaderFunction(float4 input, IN_S s) : COLOR0 +{ + class FS { + bool3 b3; + } s3; + + s3 == s3; + s2.i = s.ff4; + + containEmpty ce; + empty e; + e = ce.e; + + return input; +} diff --git a/deps/glslang/Test/hlsl.struct.split-1.vert b/deps/glslang/Test/hlsl.struct.split-1.vert new file mode 100644 index 00000000..ce5f51f9 --- /dev/null +++ b/deps/glslang/Test/hlsl.struct.split-1.vert @@ -0,0 +1,25 @@ + +struct VS_INPUT +{ + int x0_in : foo0; + float4 Pos_in : SV_Position; + int x1_in : foo1; +}; + +struct VS_OUTPUT +{ + int x0_out : foo0; + float4 Pos_out : SV_Position; + int x1_out : foo1; +}; + +VS_OUTPUT main(VS_INPUT vsin, float4 Pos_loose : SV_Position) +{ + VS_OUTPUT vsout; + + vsout.x0_out = vsin.x0_in; + vsout.Pos_out = vsin.Pos_in + Pos_loose; + vsout.x1_out = vsin.x1_in; + + return vsout; +} diff --git a/deps/glslang/Test/hlsl.struct.split.array.geom b/deps/glslang/Test/hlsl.struct.split.array.geom new file mode 100644 index 00000000..9008df16 --- /dev/null +++ b/deps/glslang/Test/hlsl.struct.split.array.geom @@ -0,0 +1,21 @@ +struct PSInput +{ + float4 Pos : SV_POSITION; + float2 TexCoord : TEXCOORD; + float3 TerrainPos : TERRAINPOS; + uint VertexID : VertexID; +}; + +typedef PSInput foo_t[2][3]; + +[maxvertexcount(4)] +void main(point uint v[1] : VertexID, inout TriangleStream OutputStream) +{ + foo_t Verts; + + PSInput Out = (PSInput) 0; + + for (int x=0; x<2; ++x) + for (int y=0; y<2; ++y) + Verts[x][y] = Out; +} diff --git a/deps/glslang/Test/hlsl.struct.split.assign.frag b/deps/glslang/Test/hlsl.struct.split.assign.frag new file mode 100644 index 00000000..d9921f30 --- /dev/null +++ b/deps/glslang/Test/hlsl.struct.split.assign.frag @@ -0,0 +1,12 @@ +struct S { + float f; + float4 pos : SV_Position; +}; + +float4 main(int i, S input[3]) : COLOR0 +{ + S a[3]; + input = a; + + return a[1].pos; +} diff --git a/deps/glslang/Test/hlsl.struct.split.call.vert b/deps/glslang/Test/hlsl.struct.split.call.vert new file mode 100644 index 00000000..543adebb --- /dev/null +++ b/deps/glslang/Test/hlsl.struct.split.call.vert @@ -0,0 +1,32 @@ +// Test passing split structs to functions. + +struct VS_INPUT +{ + int x0_in : foo0; + float4 Pos_in : SV_Position; + int x1_in : foo1; +}; + +struct VS_OUTPUT +{ + int x0_out : foo0; + float4 Pos_out : SV_Position; + int x1_out : foo1; +}; + +void Fn1(VS_INPUT fn1_in, VS_OUTPUT fn1_out) { + fn1_in.Pos_in + fn1_out.Pos_out; +} + +VS_OUTPUT main(VS_INPUT vsin) +{ + VS_OUTPUT vsout; + + vsout.x0_out = vsin.x0_in; + vsout.Pos_out = vsin.Pos_in; + vsout.x1_out = vsin.x1_in; + + Fn1(vsin, vsout); + + return vsout; +} diff --git a/deps/glslang/Test/hlsl.struct.split.nested.geom b/deps/glslang/Test/hlsl.struct.split.nested.geom new file mode 100644 index 00000000..8bcc5b99 --- /dev/null +++ b/deps/glslang/Test/hlsl.struct.split.nested.geom @@ -0,0 +1,34 @@ + +struct STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO +{ + float m0_array[2] : mysemA; + int m1 : mysemB; +}; + +struct PS_IN +{ + float4 pos : SV_Position; + float2 tc : TEXCOORD0; + // float c : SV_ClipDistance0; +}; + +struct GS_OUT +{ + PS_IN psIn; + STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO contains_no_builtin_io; +}; + + +[maxvertexcount(3)] +void main(triangle PS_IN tin[3], inout TriangleStream ts ) +{ + GS_OUT o; + + o.psIn.pos = float4(1,2,3,4); + o.psIn.tc = float2(5,6); + o.contains_no_builtin_io.m0_array[0] = 2.3; + o.contains_no_builtin_io.m0_array[1] = 2.3; + o.contains_no_builtin_io.m1 = 2; + + ts.Append(o); +} diff --git a/deps/glslang/Test/hlsl.struct.split.trivial.geom b/deps/glslang/Test/hlsl.struct.split.trivial.geom new file mode 100644 index 00000000..343da38e --- /dev/null +++ b/deps/glslang/Test/hlsl.struct.split.trivial.geom @@ -0,0 +1,21 @@ + +struct PS_IN +{ + float4 pos : SV_Position; +}; + +struct GS_OUT +{ + float4 pos : SV_Position; +}; + +[maxvertexcount(3)] +void main(triangle PS_IN i[3], inout TriangleStream ts) +{ + GS_OUT o; + + for (int x=0; x<3; ++x) { + o.pos = i[x].pos; + ts.Append(o); + } +} diff --git a/deps/glslang/Test/hlsl.struct.split.trivial.vert b/deps/glslang/Test/hlsl.struct.split.trivial.vert new file mode 100644 index 00000000..351e4182 --- /dev/null +++ b/deps/glslang/Test/hlsl.struct.split.trivial.vert @@ -0,0 +1,22 @@ + +// Test trivial case for structure splitting: the IN and OUT structs have ONLY an interstage IO. +// This should fall back to flattening, and not produce any empty structures. + +struct VS_INPUT +{ + float4 Pos_in : SV_Position; +}; + +struct VS_OUTPUT +{ + float4 Pos : SV_Position; +}; + +VS_OUTPUT main(VS_INPUT vsin, float4 Pos_loose : SV_Position) +{ + VS_OUTPUT vsout; + + vsout.Pos = vsin.Pos_in + Pos_loose; + + return vsout; +} diff --git a/deps/glslang/Test/hlsl.structIoFourWay.frag b/deps/glslang/Test/hlsl.structIoFourWay.frag new file mode 100644 index 00000000..bca135e7 --- /dev/null +++ b/deps/glslang/Test/hlsl.structIoFourWay.frag @@ -0,0 +1,18 @@ +struct T { + float f : packoffset(c4.y); // artificial, but validates all different treatments: uniform offset + centroid float g; // interpolant input + float d: SV_DepthGreaterEqual; // fragment output + float4 normal; // non-IO +}; + +T s; // loose uniform + +cbuffer buff { + T t : packoffset(c5.z); +}; + +T main(T t : myInput) : SV_Target0 +{ + T local; + return local; +} diff --git a/deps/glslang/Test/hlsl.structStructName.frag b/deps/glslang/Test/hlsl.structStructName.frag new file mode 100644 index 00000000..f8bf90c7 --- /dev/null +++ b/deps/glslang/Test/hlsl.structStructName.frag @@ -0,0 +1,7 @@ +struct S { int s; }; + +int main() +{ + struct S t; + return t.s; +} diff --git a/deps/glslang/Test/hlsl.structarray.flatten.frag b/deps/glslang/Test/hlsl.structarray.flatten.frag new file mode 100644 index 00000000..eedb931d --- /dev/null +++ b/deps/glslang/Test/hlsl.structarray.flatten.frag @@ -0,0 +1,28 @@ +SamplerState g_samp; +Texture1D g_tex; + +struct tex_t { + SamplerState samp; + Texture1D tex; + int nonopaque_thing; +}; + +struct tex_with_arrays_t { + SamplerState samp[2]; + Texture1D tex[2]; + int nonopaque_thing; +}; + +uniform tex_t g_texdata; +uniform tex_t g_texdata_array[3]; +uniform tex_with_arrays_t g_texdata_array2[3]; + +struct PS_OUTPUT { float4 color : SV_Target0; }; + +void main(out PS_OUTPUT ps_output) +{ + ps_output.color = + g_texdata.tex.Sample(g_texdata.samp, 0.5) + + g_texdata_array[1].tex.Sample(g_texdata_array[1].samp, 0.4) + + g_texdata_array2[1].tex[0].Sample(g_texdata_array2[1].samp[0], 0.3); +} diff --git a/deps/glslang/Test/hlsl.structarray.flatten.geom b/deps/glslang/Test/hlsl.structarray.flatten.geom new file mode 100644 index 00000000..990532d3 --- /dev/null +++ b/deps/glslang/Test/hlsl.structarray.flatten.geom @@ -0,0 +1,23 @@ + +struct VertexData { + float4 position : POSITION; + float4 color : COLOR0; + float2 uv : TEXCOORD0; +}; + +struct PS_IN { + float4 position : SV_POSITION; + float4 color : COLOR0; + float2 uv : TEXCOORD0; +}; + +[maxvertexcount(4)] +void main(line VertexData vin[2], inout TriangleStream outStream) +{ + PS_IN vout; + + vout.color = vin[1].color; + vout.uv = vin[1].uv; + vout.position = vin[1].position; + outStream.Append(vout); +} diff --git a/deps/glslang/Test/hlsl.structbuffer.append.fn.frag b/deps/glslang/Test/hlsl.structbuffer.append.fn.frag new file mode 100644 index 00000000..668bc1e8 --- /dev/null +++ b/deps/glslang/Test/hlsl.structbuffer.append.fn.frag @@ -0,0 +1,23 @@ + +// float4 Fn1(ConsumeStructuredBuffer arg_c) +// { +// return arg_c.Consume(); +// } + +float4 Fn2(AppendStructuredBuffer arg_a, ConsumeStructuredBuffer arg_c) +{ + arg_a.Append(float4(1,2,3,4)); + return arg_c.Consume(); +} + +AppendStructuredBuffer sbuf_a; +ConsumeStructuredBuffer sbuf_c; + +AppendStructuredBuffer sbuf_unused; + +float4 main(uint pos : FOO) : SV_Target0 +{ + // Fn1(sbuf_c); + + return Fn2(sbuf_a, sbuf_c); +} diff --git a/deps/glslang/Test/hlsl.structbuffer.append.frag b/deps/glslang/Test/hlsl.structbuffer.append.frag new file mode 100644 index 00000000..4c4bc3fc --- /dev/null +++ b/deps/glslang/Test/hlsl.structbuffer.append.frag @@ -0,0 +1,11 @@ +AppendStructuredBuffer sbuf_a; +ConsumeStructuredBuffer sbuf_c; + +AppendStructuredBuffer sbuf_unused; + +float4 main(uint pos : FOO) : SV_Target0 +{ + sbuf_a.Append(float4(1,2,3,4)); + + return sbuf_c.Consume(); +} diff --git a/deps/glslang/Test/hlsl.structbuffer.atomics.frag b/deps/glslang/Test/hlsl.structbuffer.atomics.frag new file mode 100644 index 00000000..f389e279 --- /dev/null +++ b/deps/glslang/Test/hlsl.structbuffer.atomics.frag @@ -0,0 +1,25 @@ + +RWByteAddressBuffer sbuf; + +float4 main(uint pos : FOO) : SV_Target0 +{ + uint u; + + sbuf.InterlockedAdd(8, 1); + sbuf.InterlockedAdd(8, 1, u); + sbuf.InterlockedAnd(8, 1); + sbuf.InterlockedAnd(8, 1, u); + sbuf.InterlockedCompareExchange(8, 1, 2, u); + // sbuf.InterlockedCompareStore(8, 1, 2); // TODO: ... + sbuf.InterlockedExchange(8, 1, u); + sbuf.InterlockedMax(8, 1); + sbuf.InterlockedMax(8, 1, u); + sbuf.InterlockedMin(8, 1); + sbuf.InterlockedMin(8, 1, u); + sbuf.InterlockedOr(8, 1); + sbuf.InterlockedOr(8, 1, u); + sbuf.InterlockedXor(8, 1); + sbuf.InterlockedXor(8, 1, u); + + return sbuf.Load(pos); +} diff --git a/deps/glslang/Test/hlsl.structbuffer.byte.frag b/deps/glslang/Test/hlsl.structbuffer.byte.frag new file mode 100644 index 00000000..2d504da1 --- /dev/null +++ b/deps/glslang/Test/hlsl.structbuffer.byte.frag @@ -0,0 +1,13 @@ + +ByteAddressBuffer sbuf; + +float4 main(uint pos : FOO) : SV_Target0 +{ + uint size; + sbuf.GetDimensions(size); + + return sbuf.Load(pos) + + float4(sbuf.Load2(pos+4), 0, 0) + + float4(sbuf.Load3(pos+8), 0) + + sbuf.Load4(pos+12); +} diff --git a/deps/glslang/Test/hlsl.structbuffer.coherent.frag b/deps/glslang/Test/hlsl.structbuffer.coherent.frag new file mode 100644 index 00000000..1c60ef5a --- /dev/null +++ b/deps/glslang/Test/hlsl.structbuffer.coherent.frag @@ -0,0 +1,23 @@ +struct sb_t +{ + float3 color; + bool test; +}; + + +globallycoherent RWStructuredBuffer sbuf; +globallycoherent RWStructuredBuffer sbuf2; + +float4 main(uint pos : FOO) : SV_Target0 +{ + sbuf2[pos+1] = 42; + + uint size; + uint stride; + sbuf.GetDimensions(size, stride); + + if (sbuf[pos].test) + return float4(sbuf[pos].color + sbuf2[pos], 0); + else + return size + stride; +} diff --git a/deps/glslang/Test/hlsl.structbuffer.floatidx.comp b/deps/glslang/Test/hlsl.structbuffer.floatidx.comp new file mode 100644 index 00000000..0ddf0c21 --- /dev/null +++ b/deps/glslang/Test/hlsl.structbuffer.floatidx.comp @@ -0,0 +1,19 @@ +struct sb_t +{ + float4 color; + uint2 threadId; +}; + +RWTexture2D outtx; +ConsumeStructuredBuffer csb : register(u1); +RWStructuredBuffer rwsb; + +[numthreads(1, 1, 1)] +void main(uint3 nThreadId : SV_DispatchThreadID) +{ + sb_t data = csb.Consume(); + float2 coord = float2(data.threadId.xy); + outtx[coord] = data.color; + + rwsb[coord.x] = rwsb.Load(coord.y); +} diff --git a/deps/glslang/Test/hlsl.structbuffer.fn.frag b/deps/glslang/Test/hlsl.structbuffer.fn.frag new file mode 100644 index 00000000..d043d3b5 --- /dev/null +++ b/deps/glslang/Test/hlsl.structbuffer.fn.frag @@ -0,0 +1,24 @@ + +StructuredBuffer sbuf : register(t10); + +uint4 get(in StructuredBuffer sb, uint bufferOffset) +{ + return sb[bufferOffset]; +} + +void set(in RWStructuredBuffer sb, uint bufferOffset, uint4 data) +{ + sb[bufferOffset] = data; +} + +RWStructuredBuffer sbuf2; + +// Not shared, because of type difference. +StructuredBuffer sbuf3 : register(t12); + +float4 main(uint pos : FOO) : SV_Target0 +{ + set(sbuf2, 2, get(sbuf, 3)); + + return 0; +} diff --git a/deps/glslang/Test/hlsl.structbuffer.fn2.comp b/deps/glslang/Test/hlsl.structbuffer.fn2.comp new file mode 100644 index 00000000..e651e919 --- /dev/null +++ b/deps/glslang/Test/hlsl.structbuffer.fn2.comp @@ -0,0 +1,15 @@ +ByteAddressBuffer g_input: register(t0); +RWBuffer g_output : register(u1); + +uint2 testLoad(uint loc, ByteAddressBuffer buffer) +{ + uint2 result = buffer.Load2(loc); + return result; +} + +[numthreads(256, 1, 1)] +void main(uint dispatchId : SV_DispatchThreadID) +{ + uint2 result = testLoad(dispatchId, g_input); + g_output[dispatchId] = result; +} diff --git a/deps/glslang/Test/hlsl.structbuffer.frag b/deps/glslang/Test/hlsl.structbuffer.frag new file mode 100644 index 00000000..dd522a69 --- /dev/null +++ b/deps/glslang/Test/hlsl.structbuffer.frag @@ -0,0 +1,23 @@ +struct sb_t +{ + float3 color; + bool test; + bool test2; +}; // stride = 20 + +StructuredBuffer sbuf : register(t10); +StructuredBuffer sbuf2; + +float4 main(uint pos : FOO) : SV_Target0 +{ + sb_t mydata = sbuf.Load(pos); + + uint size; + uint stride; + sbuf.GetDimensions(size, stride); + + if (sbuf[pos].test) + return float4(sbuf[pos].color + sbuf2[pos], 0); + else + return mydata.color.x + size + stride; +} diff --git a/deps/glslang/Test/hlsl.structbuffer.incdec.frag b/deps/glslang/Test/hlsl.structbuffer.incdec.frag new file mode 100644 index 00000000..108dcb61 --- /dev/null +++ b/deps/glslang/Test/hlsl.structbuffer.incdec.frag @@ -0,0 +1,19 @@ +RWStructuredBuffer sbuf_rw_i; +RWStructuredBuffer sbuf_rw_d; + +RWStructuredBuffer sbuf_rw_nocounter; // doesn't use inc or dec + +float4 main(uint pos : FOO) : SV_Target0 +{ + uint4 result = 0; + + sbuf_rw_i[7]; + sbuf_rw_d[7]; + + sbuf_rw_nocounter[5] = 2; + + uint c1 = sbuf_rw_i.IncrementCounter(); + uint c2 = sbuf_rw_d.DecrementCounter(); + + return float4(result.x, result.y, c1, c2); +} diff --git a/deps/glslang/Test/hlsl.structbuffer.rw.frag b/deps/glslang/Test/hlsl.structbuffer.rw.frag new file mode 100644 index 00000000..31104847 --- /dev/null +++ b/deps/glslang/Test/hlsl.structbuffer.rw.frag @@ -0,0 +1,23 @@ +struct sb_t +{ + float3 color; + bool test; +}; + + +RWStructuredBuffer sbuf; +RWStructuredBuffer sbuf2; + +float4 main(uint pos : FOO) : SV_Target0 +{ + sbuf2[pos+1] = 42; + + uint size; + uint stride; + sbuf.GetDimensions(size, stride); + + if (sbuf[pos].test) + return float4(sbuf[pos].color + sbuf2[pos], 0); + else + return size + stride; +} diff --git a/deps/glslang/Test/hlsl.structbuffer.rwbyte.frag b/deps/glslang/Test/hlsl.structbuffer.rwbyte.frag new file mode 100644 index 00000000..d0b957d7 --- /dev/null +++ b/deps/glslang/Test/hlsl.structbuffer.rwbyte.frag @@ -0,0 +1,15 @@ + +RWByteAddressBuffer sbuf; + +float4 main(uint pos : FOO) : SV_Target0 +{ + uint size; + sbuf.GetDimensions(size); + + sbuf.Store(pos, sbuf.Load(pos)); + sbuf.Store2(pos, sbuf.Load2(pos)); + sbuf.Store3(pos, sbuf.Load3(pos)); + sbuf.Store4(pos, sbuf.Load4(pos)); + + return sbuf.Load(pos); +} diff --git a/deps/glslang/Test/hlsl.structin.vert b/deps/glslang/Test/hlsl.structin.vert new file mode 100644 index 00000000..20a26dd9 --- /dev/null +++ b/deps/glslang/Test/hlsl.structin.vert @@ -0,0 +1,17 @@ +struct VI { + float4 m[2] : mysemA; + float4 coord : SV_POSITION; + linear float4 b : mysemB; +}; + +VI main(float4 d : mysem, VI vi, float4 e : mysem) +{ + VI local; + + local.b = vi.m[1] + vi.m[0] + (float4)vi.coord.x + d + e; + local.coord = (float4)1; + local.m[0] = (float4)2; + local.m[1] = (float4)3; + + return local; +} diff --git a/deps/glslang/Test/hlsl.subpass.frag b/deps/glslang/Test/hlsl.subpass.frag new file mode 100644 index 00000000..20a717f8 --- /dev/null +++ b/deps/glslang/Test/hlsl.subpass.frag @@ -0,0 +1,113 @@ + +layout(input_attachment_index = 1) SubpassInput subpass_f4 : register(t1); +layout(input_attachment_index = 2) SubpassInput subpass_i4; +layout(input_attachment_index = 3) SubpassInput subpass_u4; + +layout(input_attachment_index = 4) SubpassInputMS subpass_ms_f4; +layout(input_attachment_index = 5) SubpassInputMS subpass_ms_i4; +layout(input_attachment_index = 6) SubpassInputMS subpass_ms_u4; + +layout(input_attachment_index = 1) SubpassInput subpass_f3; +layout(input_attachment_index = 2) SubpassInput subpass_i3; +layout(input_attachment_index = 3) SubpassInput subpass_u3; + +layout(input_attachment_index = 4) SubpassInputMS subpass_ms_f3; +layout(input_attachment_index = 5) SubpassInputMS subpass_ms_i3; +layout(input_attachment_index = 6) SubpassInputMS subpass_ms_u3; + +layout(input_attachment_index = 1) SubpassInput subpass_f2; +layout(input_attachment_index = 2) SubpassInput subpass_i2; +layout(input_attachment_index = 3) SubpassInput subpass_u2; + +layout(input_attachment_index = 4) SubpassInputMS subpass_ms_f2; +layout(input_attachment_index = 5) SubpassInputMS subpass_ms_i2; +layout(input_attachment_index = 6) SubpassInputMS subpass_ms_u2; + +layout(input_attachment_index = 1) SubpassInput subpass_f; +layout(input_attachment_index = 2) SubpassInput subpass_i; +layout(input_attachment_index = 3) SubpassInput subpass_u; + +layout(input_attachment_index = 4) SubpassInputMS subpass_ms_f; +layout(input_attachment_index = 5) SubpassInputMS subpass_ms_i; +layout(input_attachment_index = 6) SubpassInputMS subpass_ms_u; + +[[vk::input_attachment_index(7)]] SubpassInput subpass_2; + +struct mystruct_f_t +{ + float c0; + float2 c1; + float c2; +}; + +struct mystruct_i_t +{ + int c0; + int2 c1; + int c2; +}; + +struct mystruct_u_t +{ + uint c0; + uint2 c1; + uint c2; +}; + +// TODO: ... +// layout(input_attachment_index = 7) SubpassInput subpass_fs; +// layout(input_attachment_index = 8) SubpassInputMS subpass_ms_fs; + +// layout(input_attachment_index = 7) SubpassInput subpass_is; +// layout(input_attachment_index = 8) SubpassInputMS subpass_ms_is; + +// layout(input_attachment_index = 7) SubpassInput subpass_us; +// layout(input_attachment_index = 8) SubpassInputMS subpass_ms_us; + +float4 main() : SV_Target0 +{ + float4 result00 = subpass_f4.SubpassLoad(); + int4 result01 = subpass_i4.SubpassLoad(); + uint4 result02 = subpass_u4.SubpassLoad(); + + float4 result10 = subpass_ms_f4.SubpassLoad(3); + int4 result11 = subpass_ms_i4.SubpassLoad(3); + uint4 result12 = subpass_ms_u4.SubpassLoad(3); + + float3 result20 = subpass_f3.SubpassLoad(); + int3 result21 = subpass_i3.SubpassLoad(); + uint3 result22 = subpass_u3.SubpassLoad(); + + float3 result30 = subpass_ms_f3.SubpassLoad(3); + int3 result31 = subpass_ms_i3.SubpassLoad(3); + uint3 result32 = subpass_ms_u3.SubpassLoad(3); + + float2 result40 = subpass_f2.SubpassLoad(); + int2 result41 = subpass_i2.SubpassLoad(); + uint2 result42 = subpass_u2.SubpassLoad(); + + float2 result50 = subpass_ms_f2.SubpassLoad(2); + int2 result51 = subpass_ms_i2.SubpassLoad(2); + uint2 result52 = subpass_ms_u2.SubpassLoad(2); + + float result60 = subpass_f.SubpassLoad(); + int result61 = subpass_i.SubpassLoad(); + uint result62 = subpass_u.SubpassLoad(); + + float result70 = subpass_ms_f.SubpassLoad(2); + int result71 = subpass_ms_i.SubpassLoad(2); + uint result72 = subpass_ms_u.SubpassLoad(2); + + float4 result73 = subpass_2.SubpassLoad(); + + // TODO: + // mystruct_f_t result80 = subpass_fs.SubpassLoad(); + // mystruct_i_t result81 = subpass_is.SubpassLoad(); + // mystruct_u_t result82 = subpass_us.SubpassLoad(); + + // mystruct_f_t result90 = subpass_ms_sf.SubpassLoad(2); + // mystruct_i_t result91 = subpass_ms_if.SubpassLoad(2); + // mystruct_u_t result92 = subpass_ms_uf.SubpassLoad(2); + + return 0; +} diff --git a/deps/glslang/Test/hlsl.switch.frag b/deps/glslang/Test/hlsl.switch.frag new file mode 100644 index 00000000..78ebfef3 --- /dev/null +++ b/deps/glslang/Test/hlsl.switch.frag @@ -0,0 +1,55 @@ +float4 PixelShaderFunction(float4 input, int c, int d) : COLOR0 +{ + switch(c) + { + } + + switch(c) + { + default: + } + + switch (c) { + case 1: + ++input; + break; + case 2: + --input; + break; + } + + [branch] switch (c) { + case 1: + ++input; + break; + case 2: + switch (d) { + case 2: + input += 2.0; + break; + case 3: + input += 3.0; + break; + } + break; + default: + input += 4.0; + } + + switch (c) { + case 1: + } + + switch (c) { + case 1: + case 2: + case 3: + ++input; + break; + case 4: + case 5: + --input; + } + + return input; +} diff --git a/deps/glslang/Test/hlsl.swizzle.frag b/deps/glslang/Test/hlsl.swizzle.frag new file mode 100644 index 00000000..9e87c6d7 --- /dev/null +++ b/deps/glslang/Test/hlsl.swizzle.frag @@ -0,0 +1,6 @@ +static float4 AmbientColor = float4(1, 0.5, 0, 1); + +float4 ShaderFunction(float4 input) : COLOR0 +{ + return input.wwyx * float4(AmbientColor.z); +} diff --git a/deps/glslang/Test/hlsl.synthesizeInput.frag b/deps/glslang/Test/hlsl.synthesizeInput.frag new file mode 100644 index 00000000..c4b2fa4c --- /dev/null +++ b/deps/glslang/Test/hlsl.synthesizeInput.frag @@ -0,0 +1,9 @@ +struct PSInput { + float interp; + uint no_interp; +}; + +float4 main(PSInput input : INPUT) : SV_TARGET +{ + return float4(float(input.no_interp), input.interp, 0, 1); +} \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.target.frag b/deps/glslang/Test/hlsl.target.frag new file mode 100644 index 00000000..5317236a --- /dev/null +++ b/deps/glslang/Test/hlsl.target.frag @@ -0,0 +1,10 @@ +struct PSInput { + float interp; + uint no_interp; +}; + +void main(PSInput input : INPUT, out float4 out1 : SV_TARGET1, out float4 out2 : SV_TARGET3) +{ + out1 = 1; + out2 = 0; +} \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.targetStruct1.frag b/deps/glslang/Test/hlsl.targetStruct1.frag new file mode 100644 index 00000000..7fcc0827 --- /dev/null +++ b/deps/glslang/Test/hlsl.targetStruct1.frag @@ -0,0 +1,19 @@ +struct PSInput { + float interp; + uint no_interp; +}; + +struct PSOutput { + float4 o1 : SV_TARGET2; + float4 o2 : SV_TARGET1; +}; + +PSOutput main(PSInput input : INPUT, out float4 po : SV_TARGET0) +{ + PSOutput pso; + pso.o1 = float4(float(input.no_interp), input.interp, 0, 1); + pso.o2 = 1; + po = 0; + + return pso; +} \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.targetStruct2.frag b/deps/glslang/Test/hlsl.targetStruct2.frag new file mode 100644 index 00000000..e62ba0f6 --- /dev/null +++ b/deps/glslang/Test/hlsl.targetStruct2.frag @@ -0,0 +1,19 @@ +struct PSInput { + float interp; + uint no_interp; +}; + +struct PSOutput { + float4 o1 : SV_TARGET1; + float4 o2 : SV_TARGET0; +}; + +PSOutput main(PSInput input : INPUT, out float4 po : SV_TARGET0) : SV_TARGET2 +{ + PSOutput pso; + pso.o1 = float4(float(input.no_interp), input.interp, 0, 1); + pso.o2 = 1; + po = 0; + + return pso; +} \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.templatetypes.frag b/deps/glslang/Test/hlsl.templatetypes.frag new file mode 100644 index 00000000..379120d9 --- /dev/null +++ b/deps/glslang/Test/hlsl.templatetypes.frag @@ -0,0 +1,47 @@ + +float PixelShaderFunction() +{ + vector r00 = float4(1,2,3,4); // vector means float4 + float4 r01 = vector(2,3,4,5); // vector means float4 + + vector r12 = bool1(false); + vector r13 = int1(1); + vector r14 = float1(1); + vector r15 = double1(1); + vector r16 = uint1(1); + + vector r20 = bool2(false, true); + vector r21 = int2(1,2); + vector r22 = float2(1,2); + vector r23 = double2(1,2); + vector r24 = uint2(1,2); + + vector r30 = bool3(false, true, true); + vector r31 = int3(1,2,3); + vector r32 = float3(1,2,3); + vector r33 = double3(1,2,3); + vector r34 = uint3(1,2,3); + + vector r40 = bool4(false, true, true, false); + vector r41 = int4(1,2,3,4); + vector r42 = float4(1,2,3,4); + vector r43 = double4(1,2,3,4); + vector r44 = uint4(1,2,3,4); + + matrix r50 = float4x4(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); // matrix means float4x4 + float4x4 r51 = matrix(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); // matrix means float4x4 + + // matrix r60 = bool2x3(false, true, false, true, false, true); // TODO: + matrix r61 = float2x3(1,2,3,4,5,6); + matrix r62 = float3x2(1,2,3,4,5,6); + // matrix r63 = float4x1(1,2,3,4); // TODO: + // matrix r64 = float1x4(1,2,3,4); // TODO: + matrix r65 = float4x2(1,2,3,4,5,6,7,8); + matrix r66 = float4x3(1,2,3,4,5,6,7,8,9,10,11,12); + + // TODO: bool mats + // TODO: int mats + + return 0.0; +} + diff --git a/deps/glslang/Test/hlsl.templatetypes.negative.frag b/deps/glslang/Test/hlsl.templatetypes.negative.frag new file mode 100644 index 00000000..aa54f3c6 --- /dev/null +++ b/deps/glslang/Test/hlsl.templatetypes.negative.frag @@ -0,0 +1,23 @@ + +float PixelShaderFunction() +{ + // TODO: All of the below should fail, although presently the first failure + // aborts compilation and the rest are skipped. Having a separate test for + // each would be cumbersome. + + vector r00; // cannot declare vectors of voids + matrix r01; // cannot declare matrices of voids + + vector r02; // too many parameters to vector + matrix r03; // not enough parameters to matrix + + int three = 3; + vector r04; // size must be a literal constant integer + matrix r05; // size must be a literal constant integer + + vector, 3> r06; // type must be a simple scalar + vector r07; // type must be a simple scalar + + return 0.0; +} + diff --git a/deps/glslang/Test/hlsl.texture.struct.frag b/deps/glslang/Test/hlsl.texture.struct.frag new file mode 100644 index 00000000..461469cd --- /dev/null +++ b/deps/glslang/Test/hlsl.texture.struct.frag @@ -0,0 +1,55 @@ +struct s1_t { + float c0; + float2 c1; + float c2; +}; + +struct s2_t { + float c0; + float3 c1; +}; + +struct s3_t { + float2 c0; + float1 c1; +}; + +struct s4_t { + int c0; + int2 c1; + int c2; +}; + +struct s5_t { + uint c0; + uint c1; +}; + +SamplerState g_sSamp; +Texture2D g_tTex2s1; +Texture2D g_tTex2s2; +Texture2D g_tTex2s3; +Texture2D g_tTex2s4; +Texture2D g_tTex2s5; + +Texture2D g_tTex2s1a; // same type as g_tTex2s1, to test fn signature matching. + +// function overloading to test name mangling with textures templatized on structs +s1_t fn1(Texture2D t1) { return t1 . Sample(g_sSamp, float2(0.6, 0.61)); } +s2_t fn1(Texture2D t2) { return t2 . Sample(g_sSamp, float2(0.6, 0.61)); } + +float4 main() : SV_Target0 +{ + s1_t s1 = g_tTex2s1 . Sample(g_sSamp, float2(0.1, 0.11)); + s2_t s2 = g_tTex2s2 . Sample(g_sSamp, float2(0.2, 0.21)); + s3_t s3 = g_tTex2s3 . Sample(g_sSamp, float2(0.3, 0.31)); + s4_t s4 = g_tTex2s4 . Sample(g_sSamp, float2(0.4, 0.41)); + s5_t s5 = g_tTex2s5 . Sample(g_sSamp, float2(0.5, 0.51)); + + s1_t r0 = fn1(g_tTex2s1); + s2_t r1 = fn1(g_tTex2s2); + s1_t r2 = fn1(g_tTex2s1a); + + return 0; +} + diff --git a/deps/glslang/Test/hlsl.texture.subvec4.frag b/deps/glslang/Test/hlsl.texture.subvec4.frag new file mode 100644 index 00000000..56fd4106 --- /dev/null +++ b/deps/glslang/Test/hlsl.texture.subvec4.frag @@ -0,0 +1,41 @@ + +Texture2DMS g_tTex2dmsf1; +Texture2DMS g_tTex2dmsf2; +Texture2DMS g_tTex2dmsf3; +Texture2DMS g_tTex2dmsf4; + +Texture2D g_tTex2df1; +Texture2D g_tTex2df2; +Texture2D g_tTex2df3; +Texture2D g_tTex2df4; + +SamplerState g_sSamp; + +float4 main() : SV_Target0 +{ + uint MipLevel; + uint WidthU; + uint HeightU; + uint ElementsU; + uint DepthU; + uint NumberOfLevelsU; + uint NumberOfSamplesU; + + g_tTex2dmsf1 . GetDimensions(WidthU, HeightU, NumberOfSamplesU); + g_tTex2dmsf2 . GetDimensions(WidthU, HeightU, NumberOfSamplesU); + g_tTex2dmsf3 . GetDimensions(WidthU, HeightU, NumberOfSamplesU); + g_tTex2dmsf4 . GetDimensions(WidthU, HeightU, NumberOfSamplesU); + + g_tTex2dmsf1 . Load(int2(1,2), 3); + g_tTex2dmsf2 . Load(int2(1,2), 3); + g_tTex2dmsf3 . Load(int2(1,2), 3); + g_tTex2dmsf4 . Load(int2(1,2), 3); + + g_tTex2df1 . Sample(g_sSamp, float2(.1, .2)); + g_tTex2df2 . Sample(g_sSamp, float2(.1, .2)); + g_tTex2df3 . Sample(g_sSamp, float2(.1, .2)); + g_tTex2df4 . Sample(g_sSamp, float2(.1, .2)); + + return 0; +} + diff --git a/deps/glslang/Test/hlsl.texturebuffer.frag b/deps/glslang/Test/hlsl.texturebuffer.frag new file mode 100644 index 00000000..d0697465 --- /dev/null +++ b/deps/glslang/Test/hlsl.texturebuffer.frag @@ -0,0 +1,17 @@ + +struct Data { + float4 f; + int4 i; +}; + +TextureBuffer TextureBuffer_var : register(t0); + +tbuffer tbuf2 { + float4 f2; + int4 i2; +}; + +float4 main(float4 pos : SV_POSITION) : SV_TARGET +{ + return TextureBuffer_var.f + f2; +} diff --git a/deps/glslang/Test/hlsl.this.frag b/deps/glslang/Test/hlsl.this.frag new file mode 100644 index 00000000..645fe513 --- /dev/null +++ b/deps/glslang/Test/hlsl.this.frag @@ -0,0 +1,29 @@ +static float2 var = float2(1.0, 2.0); + +struct type1 +{ + int memFun1(int3 var) + { + return var.z + this.var + var2; + } + int memFun2(int a) + { + int3 var = int3(1,2,3); + return var.z + (int)bar.y + this.var2; + } + float2 bar; + int var; + int var2; +}; + +float4 main() : SV_Target0 +{ + type1 T; + T.bar = var; + T.var = 7; + T.var2 = 9; + int i = T.memFun1(int3(10,11,12)); + i += T.memFun2(17); + + return float4(i,i,i,i); +} diff --git a/deps/glslang/Test/hlsl.tristream-append.geom b/deps/glslang/Test/hlsl.tristream-append.geom new file mode 100644 index 00000000..208607d3 --- /dev/null +++ b/deps/glslang/Test/hlsl.tristream-append.geom @@ -0,0 +1,18 @@ +struct GSPS_INPUT +{ +}; + +// Test Append() method appearing before declaration of entry point's stream output. + +void EmitVertex(in GSPS_INPUT output, inout TriangleStream TriStream) +{ + TriStream.Append( output ); +} + +[maxvertexcount(3)] +void main( triangle GSPS_INPUT input[3], inout TriangleStream TriStream ) +{ + EmitVertex(input[0], TriStream); + EmitVertex(input[1], TriStream); + EmitVertex(input[2], TriStream); +} diff --git a/deps/glslang/Test/hlsl.tx.bracket.frag b/deps/glslang/Test/hlsl.tx.bracket.frag new file mode 100644 index 00000000..0d3d81f8 --- /dev/null +++ b/deps/glslang/Test/hlsl.tx.bracket.frag @@ -0,0 +1,73 @@ +SamplerState g_sSamp : register(s0); + +Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +Texture1DArray g_tTex1df4a; +Texture1DArray g_tTex1di4a; +Texture1DArray g_tTex1du4a; + +Texture2DArray g_tTex2df4a; +Texture2DArray g_tTex2di4a; +Texture2DArray g_tTex2du4a; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +uniform int c1; +uniform int2 c2; +uniform int3 c3; +uniform int4 c4; + +uniform int o1; +uniform int2 o2; +uniform int3 o3; +uniform int4 o4; + +int4 Fn1(in int4 x) { return x; } +uint4 Fn1(in uint4 x) { return x; } +float4 Fn1(in float4 x) { return x; } + +float4 SomeValue() { return c4; } + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + // 1D + g_tTex1df4[c1]; + + float4 r00 = g_tTex1df4[c1]; + int4 r01 = g_tTex1di4[c1]; + uint4 r02 = g_tTex1du4[c1]; + + // 2D + float4 r10 = g_tTex2df4[c2]; + int4 r11 = g_tTex2di4[c2]; + uint4 r12 = g_tTex2du4[c2]; + + // 3D + float4 r20 = g_tTex3df4[c3]; + int4 r21 = g_tTex3di4[c3]; + uint4 r22 = g_tTex3du4[c3]; + + // Test function calling + Fn1(g_tTex1df4[c1]); // in + Fn1(g_tTex1di4[c1]); // in + Fn1(g_tTex1du4[c1]); // in + + psout.Color = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.tx.overload.frag b/deps/glslang/Test/hlsl.tx.overload.frag new file mode 100644 index 00000000..8b83ddfc --- /dev/null +++ b/deps/glslang/Test/hlsl.tx.overload.frag @@ -0,0 +1,17 @@ + +Texture2D tf1; +Texture2D tf4; + +RWTexture2D twf1; +RWTexture2D twf4; + +float Func(Texture2D DummyTex) { return 1.0f; } +float4 Func(Texture2D DummyTex) { return float4(0,0,0,0); } + +float Func(RWTexture2D DummyTex) { return 1.0f; } +float4 Func(RWTexture2D DummyTex) { return float4(0,0,0,0); } + +float4 main() : SV_TARGET +{ + return Func(tf1) + Func(tf4) + Func(twf1) + Func(twf4); +} diff --git a/deps/glslang/Test/hlsl.type.half.frag b/deps/glslang/Test/hlsl.type.half.frag new file mode 100644 index 00000000..a78afabf --- /dev/null +++ b/deps/glslang/Test/hlsl.type.half.frag @@ -0,0 +1,28 @@ + +float4 main() : SV_Target0 +{ + half h0 = 0; + half1 h1 = 1; + half2 h2 = 2; + half3 h3 = 3; + half4 h4 = 4; + + half1x1 h11; + half1x2 h12; + half1x3 h13; + half1x4 h14; + half2x1 h21; + half2x2 h22 = half2x2(1,2,3,4); + half2x3 h23 = (half2x3)4.9; + half2x4 h24; + half3x1 h31; + half3x2 h32; + half3x3 h33; + half3x4 h34; + half4x1 h41; + half4x2 h42; + half4x3 h43; + half4x4 h44; + + return h23._11 + h4.y + h0; +} diff --git a/deps/glslang/Test/hlsl.type.identifier.frag b/deps/glslang/Test/hlsl.type.identifier.frag new file mode 100644 index 00000000..4e53a82f --- /dev/null +++ b/deps/glslang/Test/hlsl.type.identifier.frag @@ -0,0 +1,31 @@ + +struct foo_t { + float float; +}; + +float fn(float float) { return float; } + +float4 main() : SV_Target0 +{ + float float = 7; + bool bool[2] = { float, float }; + int int = bool[1]; + uint uint = float + int; + min16float min16float = uint; + min10float min10float = min16float; + half half = 0.5; + + { + foo_t float; + float.float = 42; + } + + bool[0] = bool[1]; + + float = float + int + uint + min16float + min10float + (bool[0] ? int : float) + fn(float); + + half2x3 half2x3; + half2x3._11 = (float) * float; + + return float + half2x3._11; +} diff --git a/deps/glslang/Test/hlsl.type.type.conversion.all.frag b/deps/glslang/Test/hlsl.type.type.conversion.all.frag new file mode 100644 index 00000000..1883b018 --- /dev/null +++ b/deps/glslang/Test/hlsl.type.type.conversion.all.frag @@ -0,0 +1,190 @@ +#define zeros 0 +#define zeros1 0 +#define zeros2 0, 0 +#define zeros3 0, 0, 0 +#define zeros4 0, 0, 0, 0 +#define zeros5 0, 0, 0, 0, 0 +#define zeros6 0, 0, 0, 0, 0, 0 +#define zeros7 0, 0, 0, 0, 0, 0, 0 +#define zeros8 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros9 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros10 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros11 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros12 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros13 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros14 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros15 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros16 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +float4 main() : SV_Target { + float var0 = float(zeros1); + float2 var13 = float(zeros1); + float2 var14 = float2(zeros2); + float3 var26 = float(zeros1); + float3 var28 = float3(zeros3); + float4 var39 = float(zeros1); + float4 var42 = float4(zeros4); + float4 var43 = float2x2(zeros4); + float2x2 var52 = float(zeros1); + float2x2 var55 = float4(zeros4); + float2x2 var56 = float2x2(zeros4); + float2x3 var65 = float(zeros1); + float2x3 var70 = float2x3(zeros6); + float2x4 var78 = float(zeros1); + float2x4 var84 = float2x4(zeros8); + float3x2 var91 = float(zeros1); + float3x2 var98 = float3x2(zeros6); + float3x3 var104 = float(zeros1); + float3x3 var112 = float3x3(zeros9); + float3x4 var117 = float(zeros1); + float3x4 var126 = float3x4(zeros12); + float4x2 var130 = float(zeros1); + float4x2 var140 = float4x2(zeros8); + float4x3 var143 = float(zeros1); + float4x3 var154 = float4x3(zeros12); + float4x4 var156 = float(zeros1); + float4x4 var168 = float4x4(zeros16); + float var1 = float2(zeros2);// warning X3206: implicit truncation of vector type + float var2 = float3(zeros3);// warning X3206: implicit truncation of vector type + float var3 = float4(zeros4);// warning X3206: implicit truncation of vector type + float var4 = float2x2(zeros4);// warning X3206: implicit truncation of vector type + float var5 = float2x3(zeros6);// warning X3206: implicit truncation of vector type + float var6 = float2x4(zeros8);// warning X3206: implicit truncation of vector type + float var7 = float3x2(zeros6);// warning X3206: implicit truncation of vector type + float var8 = float3x3(zeros9);// warning X3206: implicit truncation of vector type + float var9 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float var10 = float4x2(zeros8);// warning X3206: implicit truncation of vector type + float var11 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float var12 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float2 var15 = float3(zeros3);// warning X3206: implicit truncation of vector type + float2 var16 = float4(zeros4);// warning X3206: implicit truncation of vector type + float3 var29 = float4(zeros4);// warning X3206: implicit truncation of vector type + float2x2 var57 = float2x3(zeros6);// warning X3206: implicit truncation of vector type + float2x2 var58 = float2x4(zeros8);// warning X3206: implicit truncation of vector type + float2x2 var59 = float3x2(zeros6);// warning X3206: implicit truncation of vector type + float2x2 var60 = float3x3(zeros9);// warning X3206: implicit truncation of vector type + float2x2 var61 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float2x2 var62 = float4x2(zeros8);// warning X3206: implicit truncation of vector type + float2x2 var63 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float2x2 var64 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float2x3 var71 = float2x4(zeros8);// warning X3206: implicit truncation of vector type + float2x3 var73 = float3x3(zeros9);// warning X3206: implicit truncation of vector type + float2x3 var74 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float2x3 var76 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float2x3 var77 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float2x4 var87 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float2x4 var90 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float3x2 var99 = float3x3(zeros9);// warning X3206: implicit truncation of vector type + float3x2 var100 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float3x2 var101 = float4x2(zeros8);// warning X3206: implicit truncation of vector type + float3x2 var102 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float3x2 var103 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float3x3 var113 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float3x3 var115 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float3x3 var116 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float3x4 var129 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float4x2 var141 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float4x2 var142 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float4x3 var155 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float2 var17 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float2' + float2 var18 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float2' + float2 var19 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float2' + float2 var20 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float2' + float2 var21 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float2' + float2 var22 = float3x4(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x4' to 'float2' + float2 var23 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float2' + float2 var24 = float4x3(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x3' to 'float2' + float2 var25 = float4x4(zeros16);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x4' to 'float2' + float3 var27 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float3' + float3 var30 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float3' + float3 var31 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float3' + float3 var32 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float3' + float3 var33 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float3' + float3 var34 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float3' + float3 var35 = float3x4(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x4' to 'float3' + float3 var36 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float3' + float3 var37 = float4x3(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x3' to 'float3' + float3 var38 = float4x4(zeros16);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x4' to 'float3' + float4 var40 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float4' + float4 var41 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float4' + float4 var44 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float4' + float4 var45 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float4' + float4 var46 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float4' + float4 var47 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float4' + float4 var48 = float3x4(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x4' to 'float4' + float4 var49 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float4' + float4 var50 = float4x3(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x3' to 'float4' + float4 var51 = float4x4(zeros16);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x4' to 'float4' + float2x2 var53 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float2x2' + float2x2 var54 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float2x2' + float2x3 var66 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float2x3' + float2x3 var67 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float2x3' + float2x3 var68 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float2x3' + float2x3 var69 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float2x3' + float2x3 var72 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float2x3' + float2x3 var75 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float2x3' + float2x4 var79 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float2x4' + float2x4 var80 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float2x4' + float2x4 var81 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float2x4' + float2x4 var82 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float2x4' + float2x4 var83 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float2x4' + float2x4 var85 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float2x4' + float2x4 var86 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float2x4' + float2x4 var88 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float2x4' + float2x4 var89 = float4x3(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x3' to 'float2x4' + float3x2 var92 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float3x2' + float3x2 var93 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float3x2' + float3x2 var94 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float3x2' + float3x2 var95 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float3x2' + float3x2 var96 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float3x2' + float3x2 var97 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float3x2' + float3x3 var105 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float3x3' + float3x3 var106 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float3x3' + float3x3 var107 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float3x3' + float3x3 var108 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float3x3' + float3x3 var109 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float3x3' + float3x3 var110 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float3x3' + float3x3 var111 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float3x3' + float3x3 var114 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float3x3' + float3x4 var118 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float3x4' + float3x4 var119 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float3x4' + float3x4 var120 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float3x4' + float3x4 var121 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float3x4' + float3x4 var122 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float3x4' + float3x4 var123 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float3x4' + float3x4 var124 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float3x4' + float3x4 var125 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float3x4' + float3x4 var127 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float3x4' + float3x4 var128 = float4x3(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x3' to 'float3x4' + float4x2 var131 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float4x2' + float4x2 var132 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float4x2' + float4x2 var133 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float4x2' + float4x2 var134 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float4x2' + float4x2 var135 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float4x2' + float4x2 var136 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float4x2' + float4x2 var137 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float4x2' + float4x2 var138 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float4x2' + float4x2 var139 = float3x4(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x4' to 'float4x2' + float4x3 var144 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float4x3' + float4x3 var145 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float4x3' + float4x3 var146 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float4x3' + float4x3 var147 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float4x3' + float4x3 var148 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float4x3' + float4x3 var149 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float4x3' + float4x3 var150 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float4x3' + float4x3 var151 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float4x3' + float4x3 var152 = float3x4(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x4' to 'float4x3' + float4x3 var153 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float4x3' + float4x4 var157 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float4x4' + float4x4 var158 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float4x4' + float4x4 var159 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float4x4' + float4x4 var160 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float4x4' + float4x4 var161 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float4x4' + float4x4 var162 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float4x4' + float4x4 var163 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float4x4' + float4x4 var164 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float4x4' + float4x4 var165 = float3x4(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x4' to 'float4x4' + float4x4 var166 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float4x4' + float4x4 var167 = float4x3(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x3' to 'float4x4' + return 0; +} + diff --git a/deps/glslang/Test/hlsl.type.type.conversion.valid.frag b/deps/glslang/Test/hlsl.type.type.conversion.valid.frag new file mode 100644 index 00000000..114edbcc --- /dev/null +++ b/deps/glslang/Test/hlsl.type.type.conversion.valid.frag @@ -0,0 +1,90 @@ +#define zeros 0 +#define zeros1 0 +#define zeros2 0, 0 +#define zeros3 0, 0, 0 +#define zeros4 0, 0, 0, 0 +#define zeros5 0, 0, 0, 0, 0 +#define zeros6 0, 0, 0, 0, 0, 0 +#define zeros7 0, 0, 0, 0, 0, 0, 0 +#define zeros8 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros9 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros10 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros11 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros12 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros13 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros14 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros15 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros16 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +float4 main() : SV_Target { + float var0 = float(zeros1); + float2 var13 = float(zeros1); + float2 var14 = float2(zeros2); + float3 var26 = float(zeros1); + float3 var28 = float3(zeros3); + float4 var39 = float(zeros1); + float4 var42 = float4(zeros4); + float4 var43 = float2x2(zeros4); + float2x2 var52 = float(zeros1); + float2x2 var55 = float4(zeros4); + float2x2 var56 = float2x2(zeros4); + float2x3 var65 = float(zeros1); + float2x3 var70 = float2x3(zeros6); + float2x4 var78 = float(zeros1); + float2x4 var84 = float2x4(zeros8); + float3x2 var91 = float(zeros1); + float3x2 var98 = float3x2(zeros6); + float3x3 var104 = float(zeros1); + float3x3 var112 = float3x3(zeros9); + float3x4 var117 = float(zeros1); + float3x4 var126 = float3x4(zeros12); + float4x2 var130 = float(zeros1); + float4x2 var140 = float4x2(zeros8); + float4x3 var143 = float(zeros1); + float4x3 var154 = float4x3(zeros12); + float4x4 var156 = float(zeros1); + float4x4 var168 = float4x4(zeros16); + float var1 = float2(zeros2);// warning X3206: implicit truncation of vector type + float var2 = float3(zeros3);// warning X3206: implicit truncation of vector type + float var3 = float4(zeros4);// warning X3206: implicit truncation of vector type + float var4 = float2x2(zeros4);// warning X3206: implicit truncation of vector type + float var5 = float2x3(zeros6);// warning X3206: implicit truncation of vector type + float var6 = float2x4(zeros8);// warning X3206: implicit truncation of vector type + float var7 = float3x2(zeros6);// warning X3206: implicit truncation of vector type + float var8 = float3x3(zeros9);// warning X3206: implicit truncation of vector type + float var9 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float var10 = float4x2(zeros8);// warning X3206: implicit truncation of vector type + float var11 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float var12 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float2 var15 = float3(zeros3);// warning X3206: implicit truncation of vector type + float2 var16 = float4(zeros4);// warning X3206: implicit truncation of vector type + float3 var29 = float4(zeros4);// warning X3206: implicit truncation of vector type + float2x2 var57 = float2x3(zeros6);// warning X3206: implicit truncation of vector type + float2x2 var58 = float2x4(zeros8);// warning X3206: implicit truncation of vector type + float2x2 var59 = float3x2(zeros6);// warning X3206: implicit truncation of vector type + float2x2 var60 = float3x3(zeros9);// warning X3206: implicit truncation of vector type + float2x2 var61 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float2x2 var62 = float4x2(zeros8);// warning X3206: implicit truncation of vector type + float2x2 var63 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float2x2 var64 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float2x3 var71 = float2x4(zeros8);// warning X3206: implicit truncation of vector type + float2x3 var73 = float3x3(zeros9);// warning X3206: implicit truncation of vector type + float2x3 var74 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float2x3 var76 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float2x3 var77 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float2x4 var87 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float2x4 var90 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float3x2 var99 = float3x3(zeros9);// warning X3206: implicit truncation of vector type + float3x2 var100 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float3x2 var101 = float4x2(zeros8);// warning X3206: implicit truncation of vector type + float3x2 var102 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float3x2 var103 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float3x3 var113 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float3x3 var115 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float3x3 var116 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float3x4 var129 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float4x2 var141 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float4x2 var142 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float4x3 var155 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + return 0; +} + diff --git a/deps/glslang/Test/hlsl.typeGraphCopy.vert b/deps/glslang/Test/hlsl.typeGraphCopy.vert new file mode 100644 index 00000000..a4677c10 --- /dev/null +++ b/deps/glslang/Test/hlsl.typeGraphCopy.vert @@ -0,0 +1,24 @@ +struct N1 { + int a; + float b; +}; + +struct N2 { + N1 s1; + N1 s2; +}; + +struct N3 { + N2 t1; + N1 t2; + N2 t3; +}; + +typedef N3 T3; + +T3 foo; + +float main() +{ + return foo.t3.s2.b; +} diff --git a/deps/glslang/Test/hlsl.typedef.frag b/deps/glslang/Test/hlsl.typedef.frag new file mode 100644 index 00000000..b09785e6 --- /dev/null +++ b/deps/glslang/Test/hlsl.typedef.frag @@ -0,0 +1,11 @@ +typedef float4 myVec4; + +float4 ShaderFunction(float4 input, int ii) : COLOR0 +{ + typedef int myInt; + myVec4 a1 = myVec4(1.0); + myInt i = 2; + typedef myInt myInt2; + myInt2 j = ii; + return input * a1 + myVec4(i + j); +} diff --git a/deps/glslang/Test/hlsl.void.frag b/deps/glslang/Test/hlsl.void.frag new file mode 100644 index 00000000..950bbd75 --- /dev/null +++ b/deps/glslang/Test/hlsl.void.frag @@ -0,0 +1,9 @@ +void foo1() {} +void foo2(void) {} + +void PixelShaderFunction(float4 input) : COLOR0 +{ + foo1(); + foo2(); + return; +} \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.wavebroadcast.comp b/deps/glslang/Test/hlsl.wavebroadcast.comp new file mode 100644 index 00000000..4498305c --- /dev/null +++ b/deps/glslang/Test/hlsl.wavebroadcast.comp @@ -0,0 +1,53 @@ +struct Types +{ + uint4 u; + int4 i; + float4 f; + double4 d; +}; + +RWStructuredBuffer data; + +[numthreads(32, 16, 1)] +void CSMain(uint3 dti : SV_DispatchThreadID) +{ + data[dti.x].u = WaveReadLaneAt(data[dti.x].u, 13); + data[dti.x].u.x = WaveReadLaneAt(data[dti.x].u.x, 13); + data[dti.x].u.xy = WaveReadLaneAt(data[dti.x].u.xy, 13); + data[dti.x].u.xyz = WaveReadLaneAt(data[dti.x].u.xyz, 13); + + data[dti.x].i = WaveReadLaneAt(data[dti.x].i, 13); + data[dti.x].i.x = WaveReadLaneAt(data[dti.x].i.x, 13); + data[dti.x].i.xy = WaveReadLaneAt(data[dti.x].i.xy, 13); + data[dti.x].i.xyz = WaveReadLaneAt(data[dti.x].i.xyz, 13); + + data[dti.x].f = WaveReadLaneAt(data[dti.x].f, 13); + data[dti.x].f.x = WaveReadLaneAt(data[dti.x].f.x, 13); + data[dti.x].f.xy = WaveReadLaneAt(data[dti.x].f.xy, 13); + data[dti.x].f.xyz = WaveReadLaneAt(data[dti.x].f.xyz, 13); + + data[dti.x].d = WaveReadLaneFirst(data[dti.x].d); + data[dti.x].d.x = WaveReadLaneFirst(data[dti.x].d.x); + data[dti.x].d.xy = WaveReadLaneFirst(data[dti.x].d.xy); + data[dti.x].d.xyz = WaveReadLaneFirst(data[dti.x].d.xyz); + + data[dti.x].u = WaveReadLaneFirst(data[dti.x].u); + data[dti.x].u.x = WaveReadLaneFirst(data[dti.x].u.x); + data[dti.x].u.xy = WaveReadLaneFirst(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveReadLaneFirst(data[dti.x].u.xyz); + + data[dti.x].i = WaveReadLaneFirst(data[dti.x].i); + data[dti.x].i.x = WaveReadLaneFirst(data[dti.x].i.x); + data[dti.x].i.xy = WaveReadLaneFirst(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveReadLaneFirst(data[dti.x].i.xyz); + + data[dti.x].f = WaveReadLaneFirst(data[dti.x].f); + data[dti.x].f.x = WaveReadLaneFirst(data[dti.x].f.x); + data[dti.x].f.xy = WaveReadLaneFirst(data[dti.x].f.xy); + data[dti.x].f.xyz = WaveReadLaneFirst(data[dti.x].f.xyz); + + data[dti.x].d = WaveReadLaneFirst(data[dti.x].d); + data[dti.x].d.x = WaveReadLaneFirst(data[dti.x].d.x); + data[dti.x].d.xy = WaveReadLaneFirst(data[dti.x].d.xy); + data[dti.x].d.xyz = WaveReadLaneFirst(data[dti.x].d.xyz); +} diff --git a/deps/glslang/Test/hlsl.waveprefix.comp b/deps/glslang/Test/hlsl.waveprefix.comp new file mode 100644 index 00000000..e4b4367d --- /dev/null +++ b/deps/glslang/Test/hlsl.waveprefix.comp @@ -0,0 +1,55 @@ +struct Types +{ + uint4 u; + int4 i; + float4 f; + double4 d; +}; + +RWStructuredBuffer data; + +[numthreads(32, 16, 1)] +void CSMain(uint3 dti : SV_DispatchThreadID) +{ + data[dti.x].u = WavePrefixSum(data[dti.x].u); + data[dti.x].u.x = WavePrefixSum(data[dti.x].u.x); + data[dti.x].u.xy = WavePrefixSum(data[dti.x].u.xy); + data[dti.x].u.xyz = WavePrefixSum(data[dti.x].u.xyz); + + data[dti.x].i = WavePrefixSum(data[dti.x].i); + data[dti.x].i.x = WavePrefixSum(data[dti.x].i.x); + data[dti.x].i.xy = WavePrefixSum(data[dti.x].i.xy); + data[dti.x].i.xyz = WavePrefixSum(data[dti.x].i.xyz); + + data[dti.x].f = WavePrefixSum(data[dti.x].f); + data[dti.x].f.x = WavePrefixSum(data[dti.x].f.x); + data[dti.x].f.xy = WavePrefixSum(data[dti.x].f.xy); + data[dti.x].f.xyz = WavePrefixSum(data[dti.x].f.xyz); + + data[dti.x].d = WavePrefixSum(data[dti.x].d); + data[dti.x].d.x = WavePrefixSum(data[dti.x].d.x); + data[dti.x].d.xy = WavePrefixSum(data[dti.x].d.xy); + data[dti.x].d.xyz = WavePrefixSum(data[dti.x].d.xyz); + + data[dti.x].u = WavePrefixProduct(data[dti.x].u); + data[dti.x].u.x = WavePrefixProduct(data[dti.x].u.x); + data[dti.x].u.xy = WavePrefixProduct(data[dti.x].u.xy); + data[dti.x].u.xyz = WavePrefixProduct(data[dti.x].u.xyz); + + data[dti.x].i = WavePrefixProduct(data[dti.x].i); + data[dti.x].i.x = WavePrefixProduct(data[dti.x].i.x); + data[dti.x].i.xy = WavePrefixProduct(data[dti.x].i.xy); + data[dti.x].i.xyz = WavePrefixProduct(data[dti.x].i.xyz); + + data[dti.x].f = WavePrefixProduct(data[dti.x].f); + data[dti.x].f.x = WavePrefixProduct(data[dti.x].f.x); + data[dti.x].f.xy = WavePrefixProduct(data[dti.x].f.xy); + data[dti.x].f.xyz = WavePrefixProduct(data[dti.x].f.xyz); + + data[dti.x].d = WavePrefixProduct(data[dti.x].d); + data[dti.x].d.x = WavePrefixProduct(data[dti.x].d.x); + data[dti.x].d.xy = WavePrefixProduct(data[dti.x].d.xy); + data[dti.x].d.xyz = WavePrefixProduct(data[dti.x].d.xyz); + + data[dti.x].u.x = WavePrefixCountBits(data[dti.x].u.x == 0); +} diff --git a/deps/glslang/Test/hlsl.wavequad.comp b/deps/glslang/Test/hlsl.wavequad.comp new file mode 100644 index 00000000..34e8b782 --- /dev/null +++ b/deps/glslang/Test/hlsl.wavequad.comp @@ -0,0 +1,153 @@ +struct Types +{ + uint4 u; + int4 i; + float4 f; + double4 d; +}; + +RWStructuredBuffer data; + +[numthreads(32, 16, 1)] +void CSMain(uint3 dti : SV_DispatchThreadID) +{ + data[dti.x].u = QuadReadLaneAt(data[dti.x].u, 0); + data[dti.x].u.x = QuadReadLaneAt(data[dti.x].u.x, 0); + data[dti.x].u.xy = QuadReadLaneAt(data[dti.x].u.xy, 0); + data[dti.x].u.xyz = QuadReadLaneAt(data[dti.x].u.xyz, 0); + + data[dti.x].i = QuadReadLaneAt(data[dti.x].i, 0); + data[dti.x].i.x = QuadReadLaneAt(data[dti.x].i.x, 0); + data[dti.x].i.xy = QuadReadLaneAt(data[dti.x].i.xy, 0); + data[dti.x].i.xyz = QuadReadLaneAt(data[dti.x].i.xyz, 0); + + data[dti.x].f = QuadReadLaneAt(data[dti.x].f, 0); + data[dti.x].f.x = QuadReadLaneAt(data[dti.x].f.x, 0); + data[dti.x].f.xy = QuadReadLaneAt(data[dti.x].f.xy, 0); + data[dti.x].f.xyz = QuadReadLaneAt(data[dti.x].f.xyz, 0); + + data[dti.x].d = QuadReadLaneAt(data[dti.x].d, 0); + data[dti.x].d.x = QuadReadLaneAt(data[dti.x].d.x, 0); + data[dti.x].d.xy = QuadReadLaneAt(data[dti.x].d.xy, 0); + data[dti.x].d.xyz = QuadReadLaneAt(data[dti.x].d.xyz, 0); + + data[dti.x].u = QuadReadLaneAt(data[dti.x].u, 1); + data[dti.x].u.x = QuadReadLaneAt(data[dti.x].u.x, 1); + data[dti.x].u.xy = QuadReadLaneAt(data[dti.x].u.xy, 1); + data[dti.x].u.xyz = QuadReadLaneAt(data[dti.x].u.xyz, 1); + + data[dti.x].i = QuadReadLaneAt(data[dti.x].i, 1); + data[dti.x].i.x = QuadReadLaneAt(data[dti.x].i.x, 1); + data[dti.x].i.xy = QuadReadLaneAt(data[dti.x].i.xy, 1); + data[dti.x].i.xyz = QuadReadLaneAt(data[dti.x].i.xyz, 1); + + data[dti.x].f = QuadReadLaneAt(data[dti.x].f, 1); + data[dti.x].f.x = QuadReadLaneAt(data[dti.x].f.x, 1); + data[dti.x].f.xy = QuadReadLaneAt(data[dti.x].f.xy, 1); + data[dti.x].f.xyz = QuadReadLaneAt(data[dti.x].f.xyz, 1); + + data[dti.x].d = QuadReadLaneAt(data[dti.x].d, 1); + data[dti.x].d.x = QuadReadLaneAt(data[dti.x].d.x, 1); + data[dti.x].d.xy = QuadReadLaneAt(data[dti.x].d.xy, 1); + data[dti.x].d.xyz = QuadReadLaneAt(data[dti.x].d.xyz, 1); + + data[dti.x].u = QuadReadLaneAt(data[dti.x].u, 2); + data[dti.x].u.x = QuadReadLaneAt(data[dti.x].u.x, 2); + data[dti.x].u.xy = QuadReadLaneAt(data[dti.x].u.xy, 2); + data[dti.x].u.xyz = QuadReadLaneAt(data[dti.x].u.xyz, 2); + + data[dti.x].i = QuadReadLaneAt(data[dti.x].i, 2); + data[dti.x].i.x = QuadReadLaneAt(data[dti.x].i.x, 2); + data[dti.x].i.xy = QuadReadLaneAt(data[dti.x].i.xy, 2); + data[dti.x].i.xyz = QuadReadLaneAt(data[dti.x].i.xyz, 2); + + data[dti.x].f = QuadReadLaneAt(data[dti.x].f, 2); + data[dti.x].f.x = QuadReadLaneAt(data[dti.x].f.x, 2); + data[dti.x].f.xy = QuadReadLaneAt(data[dti.x].f.xy, 2); + data[dti.x].f.xyz = QuadReadLaneAt(data[dti.x].f.xyz, 2); + + data[dti.x].d = QuadReadLaneAt(data[dti.x].d, 2); + data[dti.x].d.x = QuadReadLaneAt(data[dti.x].d.x, 2); + data[dti.x].d.xy = QuadReadLaneAt(data[dti.x].d.xy, 2); + data[dti.x].d.xyz = QuadReadLaneAt(data[dti.x].d.xyz, 2); + + data[dti.x].u = QuadReadLaneAt(data[dti.x].u, 3); + data[dti.x].u.x = QuadReadLaneAt(data[dti.x].u.x, 3); + data[dti.x].u.xy = QuadReadLaneAt(data[dti.x].u.xy, 3); + data[dti.x].u.xyz = QuadReadLaneAt(data[dti.x].u.xyz, 3); + + data[dti.x].i = QuadReadLaneAt(data[dti.x].i, 3); + data[dti.x].i.x = QuadReadLaneAt(data[dti.x].i.x, 3); + data[dti.x].i.xy = QuadReadLaneAt(data[dti.x].i.xy, 3); + data[dti.x].i.xyz = QuadReadLaneAt(data[dti.x].i.xyz, 3); + + data[dti.x].f = QuadReadLaneAt(data[dti.x].f, 3); + data[dti.x].f.x = QuadReadLaneAt(data[dti.x].f.x, 3); + data[dti.x].f.xy = QuadReadLaneAt(data[dti.x].f.xy, 3); + data[dti.x].f.xyz = QuadReadLaneAt(data[dti.x].f.xyz, 3); + + data[dti.x].d = QuadReadLaneAt(data[dti.x].d, 3); + data[dti.x].d.x = QuadReadLaneAt(data[dti.x].d.x, 3); + data[dti.x].d.xy = QuadReadLaneAt(data[dti.x].d.xy, 3); + data[dti.x].d.xyz = QuadReadLaneAt(data[dti.x].d.xyz, 3); + + data[dti.x].u = QuadReadAcrossX(data[dti.x].u); + data[dti.x].u.x = QuadReadAcrossX(data[dti.x].u.x); + data[dti.x].u.xy = QuadReadAcrossX(data[dti.x].u.xy); + data[dti.x].u.xyz = QuadReadAcrossX(data[dti.x].u.xyz); + + data[dti.x].i = QuadReadAcrossX(data[dti.x].i); + data[dti.x].i.x = QuadReadAcrossX(data[dti.x].i.x); + data[dti.x].i.xy = QuadReadAcrossX(data[dti.x].i.xy); + data[dti.x].i.xyz = QuadReadAcrossX(data[dti.x].i.xyz); + + data[dti.x].f = QuadReadAcrossX(data[dti.x].f); + data[dti.x].f.x = QuadReadAcrossX(data[dti.x].f.x); + data[dti.x].f.xy = QuadReadAcrossX(data[dti.x].f.xy); + data[dti.x].f.xyz = QuadReadAcrossX(data[dti.x].f.xyz); + + data[dti.x].d = QuadReadAcrossX(data[dti.x].d); + data[dti.x].d.x = QuadReadAcrossX(data[dti.x].d.x); + data[dti.x].d.xy = QuadReadAcrossX(data[dti.x].d.xy); + data[dti.x].d.xyz = QuadReadAcrossX(data[dti.x].d.xyz); + + data[dti.x].u = QuadReadAcrossY(data[dti.x].u); + data[dti.x].u.x = QuadReadAcrossY(data[dti.x].u.x); + data[dti.x].u.xy = QuadReadAcrossY(data[dti.x].u.xy); + data[dti.x].u.xyz = QuadReadAcrossY(data[dti.x].u.xyz); + + data[dti.x].i = QuadReadAcrossY(data[dti.x].i); + data[dti.x].i.x = QuadReadAcrossY(data[dti.x].i.x); + data[dti.x].i.xy = QuadReadAcrossY(data[dti.x].i.xy); + data[dti.x].i.xyz = QuadReadAcrossY(data[dti.x].i.xyz); + + data[dti.x].f = QuadReadAcrossY(data[dti.x].f); + data[dti.x].f.x = QuadReadAcrossY(data[dti.x].f.x); + data[dti.x].f.xy = QuadReadAcrossY(data[dti.x].f.xy); + data[dti.x].f.xyz = QuadReadAcrossY(data[dti.x].f.xyz); + + data[dti.x].d = QuadReadAcrossY(data[dti.x].d); + data[dti.x].d.x = QuadReadAcrossY(data[dti.x].d.x); + data[dti.x].d.xy = QuadReadAcrossY(data[dti.x].d.xy); + data[dti.x].d.xyz = QuadReadAcrossY(data[dti.x].d.xyz); + + data[dti.x].u = QuadReadAcrossDiagonal(data[dti.x].u); + data[dti.x].u.x = QuadReadAcrossDiagonal(data[dti.x].u.x); + data[dti.x].u.xy = QuadReadAcrossDiagonal(data[dti.x].u.xy); + data[dti.x].u.xyz = QuadReadAcrossDiagonal(data[dti.x].u.xyz); + + data[dti.x].i = QuadReadAcrossDiagonal(data[dti.x].i); + data[dti.x].i.x = QuadReadAcrossDiagonal(data[dti.x].i.x); + data[dti.x].i.xy = QuadReadAcrossDiagonal(data[dti.x].i.xy); + data[dti.x].i.xyz = QuadReadAcrossDiagonal(data[dti.x].i.xyz); + + data[dti.x].f = QuadReadAcrossDiagonal(data[dti.x].f); + data[dti.x].f.x = QuadReadAcrossDiagonal(data[dti.x].f.x); + data[dti.x].f.xy = QuadReadAcrossDiagonal(data[dti.x].f.xy); + data[dti.x].f.xyz = QuadReadAcrossDiagonal(data[dti.x].f.xyz); + + data[dti.x].d = QuadReadAcrossDiagonal(data[dti.x].d); + data[dti.x].d.x = QuadReadAcrossDiagonal(data[dti.x].d.x); + data[dti.x].d.xy = QuadReadAcrossDiagonal(data[dti.x].d.xy); + data[dti.x].d.xyz = QuadReadAcrossDiagonal(data[dti.x].d.xyz); +} diff --git a/deps/glslang/Test/hlsl.wavequery.comp b/deps/glslang/Test/hlsl.wavequery.comp new file mode 100644 index 00000000..a689e119 --- /dev/null +++ b/deps/glslang/Test/hlsl.wavequery.comp @@ -0,0 +1,7 @@ +RWStructuredBuffer data; + +[numthreads(32, 16, 1)] +void CSMain() +{ + data[WaveGetLaneIndex()] = (WaveIsFirstLane()) ? WaveGetLaneCount() : 0; +} diff --git a/deps/glslang/Test/hlsl.wavequery.frag b/deps/glslang/Test/hlsl.wavequery.frag new file mode 100644 index 00000000..d1437f06 --- /dev/null +++ b/deps/glslang/Test/hlsl.wavequery.frag @@ -0,0 +1,11 @@ +float4 PixelShaderFunction() : COLOR0 +{ + if (WaveIsFirstLane()) + { + return float4(1, 2, 3, 4); + } + else + { + return float4(4, 3, 2, 1); + } +} diff --git a/deps/glslang/Test/hlsl.wavereduction.comp b/deps/glslang/Test/hlsl.wavereduction.comp new file mode 100644 index 00000000..b7604ad9 --- /dev/null +++ b/deps/glslang/Test/hlsl.wavereduction.comp @@ -0,0 +1,125 @@ +struct Types +{ + uint4 u; + int4 i; + float4 f; + double4 d; +}; + +RWStructuredBuffer data; + +[numthreads(32, 16, 1)] +void CSMain(uint3 dti : SV_DispatchThreadID) +{ + data[dti.x].u = WaveActiveSum(data[dti.x].u); + data[dti.x].u.x = WaveActiveSum(data[dti.x].u.x); + data[dti.x].u.xy = WaveActiveSum(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveActiveSum(data[dti.x].u.xyz); + + data[dti.x].i = WaveActiveSum(data[dti.x].i); + data[dti.x].i.x = WaveActiveSum(data[dti.x].i.x); + data[dti.x].i.xy = WaveActiveSum(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveActiveSum(data[dti.x].i.xyz); + + data[dti.x].f = WaveActiveSum(data[dti.x].f); + data[dti.x].f.x = WaveActiveSum(data[dti.x].f.x); + data[dti.x].f.xy = WaveActiveSum(data[dti.x].f.xy); + data[dti.x].f.xyz = WaveActiveSum(data[dti.x].f.xyz); + + data[dti.x].d = WaveActiveSum(data[dti.x].d); + data[dti.x].d.x = WaveActiveSum(data[dti.x].d.x); + data[dti.x].d.xy = WaveActiveSum(data[dti.x].d.xy); + data[dti.x].d.xyz = WaveActiveSum(data[dti.x].d.xyz); + + data[dti.x].u = WaveActiveProduct(data[dti.x].u); + data[dti.x].u.x = WaveActiveProduct(data[dti.x].u.x); + data[dti.x].u.xy = WaveActiveProduct(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveActiveProduct(data[dti.x].u.xyz); + + data[dti.x].i = WaveActiveProduct(data[dti.x].i); + data[dti.x].i.x = WaveActiveProduct(data[dti.x].i.x); + data[dti.x].i.xy = WaveActiveProduct(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveActiveProduct(data[dti.x].i.xyz); + + data[dti.x].f = WaveActiveProduct(data[dti.x].f); + data[dti.x].f.x = WaveActiveProduct(data[dti.x].f.x); + data[dti.x].f.xy = WaveActiveProduct(data[dti.x].f.xy); + data[dti.x].f.xyz = WaveActiveProduct(data[dti.x].f.xyz); + + data[dti.x].d = WaveActiveProduct(data[dti.x].d); + data[dti.x].d.x = WaveActiveProduct(data[dti.x].d.x); + data[dti.x].d.xy = WaveActiveProduct(data[dti.x].d.xy); + data[dti.x].d.xyz = WaveActiveProduct(data[dti.x].d.xyz); + + data[dti.x].u = WaveActiveMin(data[dti.x].u); + data[dti.x].u.x = WaveActiveMin(data[dti.x].u.x); + data[dti.x].u.xy = WaveActiveMin(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveActiveMin(data[dti.x].u.xyz); + + data[dti.x].i = WaveActiveMin(data[dti.x].i); + data[dti.x].i.x = WaveActiveMin(data[dti.x].i.x); + data[dti.x].i.xy = WaveActiveMin(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveActiveMin(data[dti.x].i.xyz); + + data[dti.x].f = WaveActiveMin(data[dti.x].f); + data[dti.x].f.x = WaveActiveMin(data[dti.x].f.x); + data[dti.x].f.xy = WaveActiveMin(data[dti.x].f.xy); + data[dti.x].f.xyz = WaveActiveMin(data[dti.x].f.xyz); + + data[dti.x].d = WaveActiveMin(data[dti.x].d); + data[dti.x].d.x = WaveActiveMin(data[dti.x].d.x); + data[dti.x].d.xy = WaveActiveMin(data[dti.x].d.xy); + data[dti.x].d.xyz = WaveActiveMin(data[dti.x].d.xyz); + + data[dti.x].u = WaveActiveMax(data[dti.x].u); + data[dti.x].u.x = WaveActiveMax(data[dti.x].u.x); + data[dti.x].u.xy = WaveActiveMax(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveActiveMax(data[dti.x].u.xyz); + + data[dti.x].i = WaveActiveMax(data[dti.x].i); + data[dti.x].i.x = WaveActiveMax(data[dti.x].i.x); + data[dti.x].i.xy = WaveActiveMax(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveActiveMax(data[dti.x].i.xyz); + + data[dti.x].f = WaveActiveMax(data[dti.x].f); + data[dti.x].f.x = WaveActiveMax(data[dti.x].f.x); + data[dti.x].f.xy = WaveActiveMax(data[dti.x].f.xy); + data[dti.x].f.xyz = WaveActiveMax(data[dti.x].f.xyz); + + data[dti.x].d = WaveActiveMax(data[dti.x].d); + data[dti.x].d.x = WaveActiveMax(data[dti.x].d.x); + data[dti.x].d.xy = WaveActiveMax(data[dti.x].d.xy); + data[dti.x].d.xyz = WaveActiveMax(data[dti.x].d.xyz); + + data[dti.x].u = WaveActiveBitAnd(data[dti.x].u); + data[dti.x].u.x = WaveActiveBitAnd(data[dti.x].u.x); + data[dti.x].u.xy = WaveActiveBitAnd(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveActiveBitAnd(data[dti.x].u.xyz); + + data[dti.x].i = WaveActiveBitAnd(data[dti.x].i); + data[dti.x].i.x = WaveActiveBitAnd(data[dti.x].i.x); + data[dti.x].i.xy = WaveActiveBitAnd(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveActiveBitAnd(data[dti.x].i.xyz); + + data[dti.x].u = WaveActiveBitOr(data[dti.x].u); + data[dti.x].u.x = WaveActiveBitOr(data[dti.x].u.x); + data[dti.x].u.xy = WaveActiveBitOr(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveActiveBitOr(data[dti.x].u.xyz); + + data[dti.x].i = WaveActiveBitOr(data[dti.x].i); + data[dti.x].i.x = WaveActiveBitOr(data[dti.x].i.x); + data[dti.x].i.xy = WaveActiveBitOr(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveActiveBitOr(data[dti.x].i.xyz); + + data[dti.x].u = WaveActiveBitXor(data[dti.x].u); + data[dti.x].u.x = WaveActiveBitXor(data[dti.x].u.x); + data[dti.x].u.xy = WaveActiveBitXor(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveActiveBitXor(data[dti.x].u.xyz); + + data[dti.x].i = WaveActiveBitXor(data[dti.x].i); + data[dti.x].i.x = WaveActiveBitXor(data[dti.x].i.x); + data[dti.x].i.xy = WaveActiveBitXor(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveActiveBitXor(data[dti.x].i.xyz); + + data[dti.x].u.x = WaveActiveCountBits(data[dti.x].u.x == 0); +} diff --git a/deps/glslang/Test/hlsl.wavevote.comp b/deps/glslang/Test/hlsl.wavevote.comp new file mode 100644 index 00000000..0370e69b --- /dev/null +++ b/deps/glslang/Test/hlsl.wavevote.comp @@ -0,0 +1,10 @@ +RWStructuredBuffer data; + +[numthreads(32, 16, 1)] +void CSMain(uint3 dti : SV_DispatchThreadID) +{ + data[dti.x] = WaveActiveBallot(WaveActiveAnyTrue(dti.x == 0)); + data[dti.y] = WaveActiveBallot(WaveActiveAllTrue(dti.y == 0)); + data[dti.z] = WaveActiveBallot(WaveActiveAllEqualBool(dti.z == 0)); + data[dti.z] = WaveActiveBallot(WaveActiveAllEqual(dti.z)); +} diff --git a/deps/glslang/Test/hlsl.whileLoop.frag b/deps/glslang/Test/hlsl.whileLoop.frag new file mode 100644 index 00000000..e4084ae7 --- /dev/null +++ b/deps/glslang/Test/hlsl.whileLoop.frag @@ -0,0 +1,7 @@ +float4 PixelShaderFunction(float4 input) : COLOR0 +{ + while (any(input != input)) { return input; } + while (false) ; + [unroll] while (false) { } + while ((false)) { } +} diff --git a/deps/glslang/Test/hlsl.y-negate-1.vert b/deps/glslang/Test/hlsl.y-negate-1.vert new file mode 100644 index 00000000..ee62ec24 --- /dev/null +++ b/deps/glslang/Test/hlsl.y-negate-1.vert @@ -0,0 +1,9 @@ + +// Test Y negation from entry point return + +float4 pos; + +float4 main() : SV_Position +{ + return pos; +} diff --git a/deps/glslang/Test/hlsl.y-negate-2.vert b/deps/glslang/Test/hlsl.y-negate-2.vert new file mode 100644 index 00000000..01fa6ce7 --- /dev/null +++ b/deps/glslang/Test/hlsl.y-negate-2.vert @@ -0,0 +1,8 @@ +// Test Y negation from entry point out parameter + +float4 pos; + +void main(out float4 position : SV_Position) +{ + position = pos; +} diff --git a/deps/glslang/Test/hlsl.y-negate-3.vert b/deps/glslang/Test/hlsl.y-negate-3.vert new file mode 100644 index 00000000..a0c4a8d6 --- /dev/null +++ b/deps/glslang/Test/hlsl.y-negate-3.vert @@ -0,0 +1,18 @@ +// Test Y negation from entry point out parameter + +float4 position; + +struct VS_OUT { + float4 pos : SV_Position; + int somethingelse; +}; + +VS_OUT main() +{ + VS_OUT vsout; + + vsout.pos = position; + vsout.somethingelse = 42; + + return vsout; +} diff --git a/deps/glslang/Test/implicitInnerAtomicUint.frag b/deps/glslang/Test/implicitInnerAtomicUint.frag new file mode 100644 index 00000000..bb76516f --- /dev/null +++ b/deps/glslang/Test/implicitInnerAtomicUint.frag @@ -0,0 +1,2 @@ +#version 460 +layout(binding = 0) uniform atomic_uint c[1][]; \ No newline at end of file diff --git a/deps/glslang/Test/inc1/badInc.h b/deps/glslang/Test/inc1/badInc.h new file mode 100644 index 00000000..a7713553 --- /dev/null +++ b/deps/glslang/Test/inc1/badInc.h @@ -0,0 +1 @@ +#include "parentBad" diff --git a/deps/glslang/Test/inc1/bar.h b/deps/glslang/Test/inc1/bar.h new file mode 100644 index 00000000..1a650fb6 --- /dev/null +++ b/deps/glslang/Test/inc1/bar.h @@ -0,0 +1,3 @@ +float4 i2; + +#include "foo.h" diff --git a/deps/glslang/Test/inc1/foo.h b/deps/glslang/Test/inc1/foo.h new file mode 100644 index 00000000..1819034d --- /dev/null +++ b/deps/glslang/Test/inc1/foo.h @@ -0,0 +1,3 @@ +#include "parent.h" + +float4 i3; diff --git a/deps/glslang/Test/inc1/path1/bar.h b/deps/glslang/Test/inc1/path1/bar.h new file mode 100644 index 00000000..46141dd1 --- /dev/null +++ b/deps/glslang/Test/inc1/path1/bar.h @@ -0,0 +1 @@ +float4 i9991; diff --git a/deps/glslang/Test/inc1/path1/local.h b/deps/glslang/Test/inc1/path1/local.h new file mode 100644 index 00000000..b3aac8e3 --- /dev/null +++ b/deps/glslang/Test/inc1/path1/local.h @@ -0,0 +1 @@ +float4 p2; diff --git a/deps/glslang/Test/inc1/path1/notHere.h b/deps/glslang/Test/inc1/path1/notHere.h new file mode 100644 index 00000000..2e7d56a6 --- /dev/null +++ b/deps/glslang/Test/inc1/path1/notHere.h @@ -0,0 +1,4 @@ +float4 p1; + +#include "local.h" +#include "remote.h" diff --git a/deps/glslang/Test/inc1/path2/bar.h b/deps/glslang/Test/inc1/path2/bar.h new file mode 100644 index 00000000..46141dd1 --- /dev/null +++ b/deps/glslang/Test/inc1/path2/bar.h @@ -0,0 +1 @@ +float4 i9991; diff --git a/deps/glslang/Test/inc1/path2/notHere.h b/deps/glslang/Test/inc1/path2/notHere.h new file mode 100644 index 00000000..63f4ca47 --- /dev/null +++ b/deps/glslang/Test/inc1/path2/notHere.h @@ -0,0 +1 @@ +float4 paoeu1; diff --git a/deps/glslang/Test/inc1/path2/remote.h b/deps/glslang/Test/inc1/path2/remote.h new file mode 100644 index 00000000..c925d27a --- /dev/null +++ b/deps/glslang/Test/inc1/path2/remote.h @@ -0,0 +1 @@ +float4 p3; diff --git a/deps/glslang/Test/inc2/bar.h b/deps/glslang/Test/inc2/bar.h new file mode 100644 index 00000000..901c058e --- /dev/null +++ b/deps/glslang/Test/inc2/bar.h @@ -0,0 +1,2 @@ +#include "foo.h" +float4 i5; diff --git a/deps/glslang/Test/inc2/foo.h b/deps/glslang/Test/inc2/foo.h new file mode 100644 index 00000000..fd09e808 --- /dev/null +++ b/deps/glslang/Test/inc2/foo.h @@ -0,0 +1 @@ +float4 i6; \ No newline at end of file diff --git a/deps/glslang/Test/include.vert b/deps/glslang/Test/include.vert new file mode 100644 index 00000000..192a4891 --- /dev/null +++ b/deps/glslang/Test/include.vert @@ -0,0 +1,16 @@ +#version 450 + +#extension GL_GOOGLE_include_directive : enable + +#define float4 vec4 + +#include "bar.h" +#include "./inc1/bar.h" +#include "inc2\bar.h" + +out vec4 color; + +void main() +{ + color = i1 + i2 + i3 + i4 + i5 + i6; +} diff --git a/deps/glslang/Test/invalidSwizzle.vert b/deps/glslang/Test/invalidSwizzle.vert new file mode 100644 index 00000000..799ff872 --- /dev/null +++ b/deps/glslang/Test/invalidSwizzle.vert @@ -0,0 +1,10 @@ +#version 420 + +void f(); +uniform sampler2D s; + +void main() { + vec2 v = s.rr; // Swizzles do not apply to samplers + f().xx; // Scalar swizzle does not apply to void + f().xy; // Vector swizzle does not apply either +} \ No newline at end of file diff --git a/deps/glslang/Test/length.frag b/deps/glslang/Test/length.frag new file mode 100644 index 00000000..74c286f3 --- /dev/null +++ b/deps/glslang/Test/length.frag @@ -0,0 +1,18 @@ +#version 120 + +uniform vec4 u[3]; + +#ifdef TEST_POST_110 +varying vec2 v[]; +#else +varying vec2 v[2]; +#endif + +void main() +{ + int a[5]; + + vec2 t = v[0] + v[1]; + + gl_FragColor = vec4(u.length() * v.length() * a.length()); +} diff --git a/deps/glslang/Test/lineContinuation.vert b/deps/glslang/Test/lineContinuation.vert new file mode 100644 index 00000000..471f3a34 --- /dev/null +++ b/deps/glslang/Test/lineContinuation.vert @@ -0,0 +1,151 @@ +#version 300 es + +// this file cont\ +ains no errors other than the #error which are there to see if line numbering for errors is correct + +#error e1 + +float f\ +oo; // same as 'float foo;' + +#error e2 + +#define MAIN void main() \ + { \ +gl_Position = vec4(foo); \ +} + +#error e3 + +MAIN + +vec4 foo2(vec4 a) +{ + vec4 b = a; \ + return b; +} + +// aoeuntheo unatehutna \ antaehnathe +// anteonuth $ natohe " ' +// anteonuth natohe + +#define FOO int /* \ +*/ goodDecl; + +FOO + +#define A int q1 = \ 1 +#define B int q2 = \1 +#define C int q3 = $ 1 +#define D int q4 = @ 1 + +const highp int a1 = \ 4; // ERROR +const highp int a2 = @ 3; // ERROR +const highp int a3 = $4; // ERROR +const highp int a4 = a2\; // ERROR + +A; +B; +C; +D; + +# \ + +# \ + error good continuation + +#define AA1 a \ b +#define AA2 a \\ b +#define AA3 a \\\ b +#define AA4 a \\\\ b + +// anoetuh nonaetu \\\\\\ +still in comment + +const int abdece = 10; +const int aoeuntaoehu = abd\ +\ +\ +\ +\ +\ +ece; + +float funkyf = \ +.\ +1\ +2\ +3\ +e\ ++\ +1\ +7\ +;\ +int funkyh\ +=\ +0\ +x\ +f\ +4\ +; +int funkyo =\ +0\ +4\ +2\ +; +int c = \ +11; +int d = 1\ +2; + +#define FOOM(a,b) a + b + +#if FO\ +OM(2\ +,\ +3) +int bar103 = 17; +#endif + +// ERROR +#if FOOM(2, +3) +int bar104 = 19; +#endif + +// ERROR +#if FOOM( +2,3) +int bar105 = 19; +#endif + +int bar106 = FOOM(5,7); +int bar107 = FOOM // okay + ( + 2 + , + 3 + ) + ; + +void foo203209409() +{ + bar107 \ ++= 37; + bar107 *\ += 38; + bar107 /=\ +39; + bar107 +\ +41; +} + +#define QUOTE "ab\ +cd" + +void foo230920394() +{ + // syntax error + bar107 +\ + = 42; +} diff --git a/deps/glslang/Test/lineContinuation100.vert b/deps/glslang/Test/lineContinuation100.vert new file mode 100644 index 00000000..e632023c --- /dev/null +++ b/deps/glslang/Test/lineContinuation100.vert @@ -0,0 +1,56 @@ +#version 100 + +// non-line continuation comment \ +#error good error + + + +float f\ +oo; // same as 'float foo;' + +#error e2 + +#define MAIN void main() \ + { \ +gl_Position = vec4(foo); \ +} + +#error e3 + +MAIN + +vec4 foo2(vec4 a) +{ + vec4 b = a; \ + return b; +} + +// aoeuntheo unatehutna \ antaehnathe +// anteonuth $ natohe " ' +// anteonuth natohe +/*@*/ +/* *@/*/ +//@ + +#define A int q1 = \ 1 +#define B int q2 = \1 +#define C int q3 = $ 1 +#define D int q4 = @ 1 + +const highp int a1 = \ 4; // ERROR +const highp int a2 = @ 3; // ERROR +const highp int a3 = $4; // ERROR +const highp int a4 = a2\; // ERROR + +A; +B; +C; +D; + +# \ + +# \ + error bad continuation + +#define QUOTE "ab\ +cd" diff --git a/deps/glslang/Test/link1.frag b/deps/glslang/Test/link1.frag new file mode 100644 index 00000000..2b8d95a8 --- /dev/null +++ b/deps/glslang/Test/link1.frag @@ -0,0 +1,38 @@ +#version 130 + +uniform vec4 uv4; +uniform vec3 glass; + +const int ci = 8; + +vec4 a = ci * uv4; + +in vec3 iv3; +in vec4 cup; + +void main() +{ +} + +vec4 b = ci * a; + +ivec2 foo(mat2 m) +{ + return ivec2(m[0]); +} + +vec4 c = b * b; + +const vec3 cv3 = vec3(43.0, 0.34, 9.9); +const vec3 cv3n = vec3(43.0, 0.34, 9.9); +const vec3 cv3e = vec3(43.0, 0.34, 9.9); +uniform mat2 um2 = mat2(4.0); +uniform mat2 um2n = mat2(4.0); +uniform mat2 um2e = mat2(4.0); +struct S { + int a; + float b; +}; +uniform S s = S(82, 3.9); +uniform S sn; +uniform S se = S(82, 3.9); diff --git a/deps/glslang/Test/link1.vk.frag b/deps/glslang/Test/link1.vk.frag new file mode 100644 index 00000000..167e78ee --- /dev/null +++ b/deps/glslang/Test/link1.vk.frag @@ -0,0 +1,24 @@ +#version 450 + +vec4 getColor(); + +layout(location=0) out vec4 color; + +int a1[]; // max size from link1 +int a2[]; // max size from link2 +int b[5]; +int c[]; +int i; + +buffer bnameRuntime { float r[]; }; +buffer bnameImplicit { float m[]; }; + +void main() +{ + color = getColor(); + + a1[8] = 1; + a2[1] = 1; + b[i] = 1; + c[3] = 1; +} diff --git a/deps/glslang/Test/link2.frag b/deps/glslang/Test/link2.frag new file mode 100644 index 00000000..7c698917 --- /dev/null +++ b/deps/glslang/Test/link2.frag @@ -0,0 +1,36 @@ +#version 130 + +uniform vec4 uv4; +uniform vec2 glass; + +const int ci = 8; + +vec4 d = ci * uv4; + +in vec3 iv3; +flat in vec4 cup; + +vec4 e = ci * d; + +ivec2 foo() +{ + return ivec2(2); +} + +vec4 f = e * e; + +const vec3 cv3 = vec3(43.0, 0.34, 9.9); +const vec3 cv3e = vec3(43.0, 0.34, 2.9); +uniform mat2 um2 = mat2(4.0); +uniform mat2 um2n; +uniform mat2 um2e = mat2(3.0); +struct S { + int a; + float b; +}; +uniform S s = S(82, 3.9); +uniform S sn = S(82, 3.9); +uniform S se = S(81, 3.9); + +#extension GL_OES_texture_3D : enable +#extension GL_OES_standard_derivatives : enable diff --git a/deps/glslang/Test/link2.vk.frag b/deps/glslang/Test/link2.vk.frag new file mode 100644 index 00000000..b80402ca --- /dev/null +++ b/deps/glslang/Test/link2.vk.frag @@ -0,0 +1,23 @@ +#version 450 + +layout(binding=1) uniform sampler2D s2D; + +int a1[]; // max size from link1 +int a2[]; // max size from link2 +int b[]; +int c[7]; +int i; + +buffer bnameRuntime { float r[]; }; +buffer bnameImplicit { float m[4]; }; + +vec4 getColor() +{ + a1[2] = 1; + a2[9] = 1; + b[2] = 1; + c[3] = 1; + c[i] = 1; + + return texture(s2D, vec2(0.5)); +} diff --git a/deps/glslang/Test/link3.frag b/deps/glslang/Test/link3.frag new file mode 100644 index 00000000..f886b23f --- /dev/null +++ b/deps/glslang/Test/link3.frag @@ -0,0 +1,9 @@ +#version 300 es + +precision highp float; + +in vec2 iv3; + +#extension GL_OES_standard_derivatives : enable +#extension GL_OES_EGL_image_external : require +#extension GL_OES_texture_3D : enable diff --git a/deps/glslang/Test/localAggregates.frag b/deps/glslang/Test/localAggregates.frag new file mode 100644 index 00000000..d8a7fb18 --- /dev/null +++ b/deps/glslang/Test/localAggregates.frag @@ -0,0 +1,72 @@ +#version 130 + +uniform sampler2D sampler; +varying vec2 coord; +varying vec4 color; + +struct s1 { + int i; + float f; +}; + +struct s2 { + int i; + float f; + s1 s1_1; + vec4 bleh; +}; + +struct s3 { + s2 s2_1; + int i; + float f; + s1 s1_1; +}; + + +uniform s1 foo; +uniform s2 foo2; +uniform s3 foo3; + +uniform float[16] uFloatArray; +uniform int condition; + +void main() +{ + s2 locals2; + s3 locals3; + float localFArray[16]; + int localIArray[8]; + + locals2 = foo3.s2_1; + + if (foo3.s2_1.i > 0) { + locals2.s1_1.f = 1.0; + localFArray[4] = coord.x; + localIArray[2] = foo3.s2_1.i; + } else { + locals2.s1_1.f = coord.x; + localFArray[4] = 1.0; + localIArray[2] = 0; + } + + if (localIArray[2] == 0) + ++localFArray[4]; + + float localArray[16]; + int x = 5; + localArray[x] = coord.x; + + float[16] a; + + for (int i = 0; i < 16; i++) + a[i] = 0.0; + + if (condition == 1) + a = localArray; + + locals2.bleh = color; + locals2.bleh.z = coord.y; + + gl_FragColor = locals2.bleh * (localFArray[4] + locals2.s1_1.f + localArray[x] + a[x]) * texture2D(sampler, coord); +} diff --git a/deps/glslang/Test/loops.frag b/deps/glslang/Test/loops.frag new file mode 100644 index 00000000..ce2d2a0b --- /dev/null +++ b/deps/glslang/Test/loops.frag @@ -0,0 +1,320 @@ +#version 130 +uniform vec4 bigColor; +uniform vec4 bigColor1_1; +uniform vec4 bigColor1_2; +uniform vec4 bigColor1_3; +uniform vec4 bigColor2; +uniform vec4 bigColor3; +uniform vec4 bigColor4; +uniform vec4 bigColor5; +uniform vec4 bigColor6; +uniform vec4 bigColor7; +uniform vec4 bigColor8; + +varying vec4 BaseColor; + +uniform float d; +uniform float d2; +uniform float d3; +uniform float d4; +uniform float d5; +uniform float d6; +uniform float d7; +uniform float d8; +uniform float d9; +uniform float d10; +uniform float d11; +uniform float d12; +uniform float d13; +uniform float d14; +uniform float d15; +uniform float d16; +uniform float d17; +uniform float d18; +uniform float d19; +uniform float d20; +uniform float d21; +uniform float d22; +uniform float d23; +uniform float d24; +uniform float d25; +uniform float d26; +uniform float d27; +uniform float d28; +uniform float d29; +uniform float d30; +uniform float d31; +uniform float d32; +uniform float d33; +uniform float d34; + +uniform int Count; + +void main() +{ + vec4 color = BaseColor; + + // Not a real loop + while (true) { + if (color.x < 0.33) { + color += vec4(0.33); + break; + } + if (color.x < 0.66) { + color += vec4(0.66); + break; + } + + color += vec4(0.33); + break; + } + + // While + while (color.x < d) { + color += bigColor; + } + + // While (latchy) + while (color.z < d) { + color += bigColor1_1; + if (color.w < d) + continue; + + color += bigColor1_1; + } + + // While (constant) + while (color.x < 42.0) { + ++color; + } + + // While (complicated-conditional) + while (color.w < d2 && color.y < d3) { + color += bigColor1_2; + } + + // While (multi-exit) + while (color.z < d3) { + color += bigColor1_3; + if (color.y < d4) + break; + color += bigColor1_3; + } + + // For (dynamic) + for (int i = 0; i < Count; ++i) { + color += bigColor2; + } + + // Do while + do { + color += bigColor3; + } while (color.x < d2); + + // For (static) + for (int i = 0; i < 42; ++i) { + color.z += d3; + } + + // For (static) flow-control + for (int i = 0; i < 100; ++i) { + if (color.z < 20.0) + color.x++; + else + color.y++; + if (color.w < 20.0) + if (color.z > color.y) + 0; // do nothing + } + + // For (static) flow-control with latch merge + for (int i = 0; i < 120; ++i) { + if (color.z < 20.0) + color.x++; + else + color.y++; + } + + // For (static) latchy + for (int i = 0; i < 42; ++i) { + color.z += d3; + if (color.x < d4) + continue; + ++color.w; + } + + // For (static) multi-exit + for (int i = 0; i < 42; ++i) { + color.z += d3; + if (color.x < d4) + break; + ++color.w; + } + + // Latchy + do { + color += bigColor4; + if (color.x < d4) + continue; + if (color.y < d4) + color.y += d4; + else + color.x += d4; + } while (color.z < d4); + + // Do while flow control + do { + color += bigColor5; + if (color.y < d5) + color.y += d5; + } while (color.x < d5); + + // If then loop + if (color.x < d6) { + while (color.y < d6) + color += bigColor6; + } else { + while (color.z < d6) + color.z += bigColor6.z; + } + + // If then multi-exit + if (color.x < d6) { + while (color.y < d6) { + color += bigColor6; + if (d7 < 1.0) + break; + } + + } else { + while (color.z < d6) + color.z += bigColor6.z; + } + + + // Multi-exit + do { + if (d7 < 0.0) + break; + + color += bigColor7; + + if (d7 < 1.0) { + color.z++; + break; + } + + color += BaseColor; + + } while (true); + + + // Multi-exit2 + do { + // invariant conditional break at the top of the loop. This could be a + // situation where unswitching the loop has no real increases in code + // size. + if (d8 < 0.0) + break; + + color += bigColor7; + + if (d8 < 1.0) { + color.z++; + if (d8 < 2.0) { + color.y++; + } else { + color.x++; + } + break; + } + + color += BaseColor; + + } while (color.z < d8); + + // Deep exit + while (color.w < d9) { + if (d9 > d8) { + if (color.x <= d7) { + if (color.z == 5.0) + color.w++; + else + break; + } + } + + } + + // No end loop-back. + while (color.z < d10) { + color.y++; + if (color.y < d11) { + color.z++; + if (color.w < d12) + color.w++; + else + color.x++; + continue; + } + + color++; + break; + } + + // Multi-continue + while (color.x < 10.0) { + color += bigColor8; + + if (color.z < d8) + if (color.w < d6) + continue; + + color.y += bigColor8.x; + } + + color++; + gl_FragColor = color; + + // Early Return + while (color.x < d14) { + if (color.y < d15) { + return; + } + else + color++; + } + + color++; + + while (color.w < d16) { + color.w++; + } + + + // While (complicated-conditional) + while (color.w < d2 && color.y < d3) { + color += bigColor1_2; + if (color.z < d3) + return; + } + + + do { + if (color.y < d18) + return; + color++; + } while (color.x < d17); + + // Early Discard + while (color.y < d16) { + if (color.w < d16) { + discard; + } else + color++; + } + + color++; + + gl_FragColor = color; +} diff --git a/deps/glslang/Test/loopsArtificial.frag b/deps/glslang/Test/loopsArtificial.frag new file mode 100644 index 00000000..2f196af8 --- /dev/null +++ b/deps/glslang/Test/loopsArtificial.frag @@ -0,0 +1,96 @@ +#version 130 +uniform vec4 bigColor; +uniform vec4 bigColor1_1; +uniform vec4 bigColor1_2; +uniform vec4 bigColor1_3; +uniform vec4 bigColor2; +uniform vec4 bigColor3; +uniform vec4 bigColor4; +uniform vec4 bigColor5; +uniform vec4 bigColor6; +uniform vec4 bigColor7; +uniform vec4 bigColor8; + +varying vec4 BaseColor; + +uniform float d; +uniform float d2; +uniform float d3; +uniform float d4; +uniform float d5; +uniform float d6; +uniform float d7; +uniform float d8; +uniform float d9; +uniform float d10; +uniform float d11; +uniform float d12; +uniform float d13; +uniform float d14; +uniform float d15; +uniform float d16; +uniform float d17; +uniform float d18; +uniform float d19; +uniform float d20; +uniform float d21; +uniform float d22; +uniform float d23; +uniform float d24; +uniform float d25; +uniform float d26; +uniform float d27; +uniform float d28; +uniform float d29; +uniform float d30; +uniform float d31; +uniform float d32; +uniform float d33; +uniform float d34; + +uniform int Count; + +void main() +{ + vec4 color = BaseColor; + + // Latchy2 + do { + color += bigColor4; + if (color.x < d4) { + color.z += 2.0; + if (color.z < d4) { + color.x++; + continue; + } + } + if (color.y < d4) + color.y += d4; + else + color.x += d4; + } while (color.z < d4); + + // Immediate dominator + while (color.w < d13) { + if (color.z < d13) + color++; + else + color--; + // code from Latchy 2 + color += bigColor4; + if (color.x < d4) { + color.z += 2.0; + if (color.z < d4) { + color.x++; + continue; + } + } + if (color.y < d4) + color.y += d4; + else + color.x += d4; + } + + color++; + gl_FragColor = color; +} diff --git a/deps/glslang/Test/mains.frag b/deps/glslang/Test/mains.frag new file mode 100644 index 00000000..5756a3e1 --- /dev/null +++ b/deps/glslang/Test/mains.frag @@ -0,0 +1,9 @@ +#version 300 es + +void main() +{ +} + +void main() +{ +} diff --git a/deps/glslang/Test/mains1.frag b/deps/glslang/Test/mains1.frag new file mode 100644 index 00000000..e0de2e1e --- /dev/null +++ b/deps/glslang/Test/mains1.frag @@ -0,0 +1,5 @@ +#version 110 + +void main() +{ +} diff --git a/deps/glslang/Test/mains2.frag b/deps/glslang/Test/mains2.frag new file mode 100644 index 00000000..e0de2e1e --- /dev/null +++ b/deps/glslang/Test/mains2.frag @@ -0,0 +1,5 @@ +#version 110 + +void main() +{ +} diff --git a/deps/glslang/Test/makeDoc b/deps/glslang/Test/makeDoc new file mode 100644 index 00000000..c9d598ec --- /dev/null +++ b/deps/glslang/Test/makeDoc @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +./glslangValidator -p > instDesc +asciidoc --backend=html5 instDesc diff --git a/deps/glslang/Test/matrix.frag b/deps/glslang/Test/matrix.frag new file mode 100644 index 00000000..150e0434 --- /dev/null +++ b/deps/glslang/Test/matrix.frag @@ -0,0 +1,55 @@ +#version 130 + +//#define TEST_POST_110 + +uniform mat3 colorTransform; +varying vec3 Color; +uniform mat4 m, n; + +#ifdef TEST_POST_110 +uniform mat4x3 um43; +uniform mat3x4 un34; +#else +uniform mat4 um43; +uniform mat4 un34; +#endif + +varying vec4 v; + +#ifdef TEST_POST_110 +varying vec3 u; +#else +varying vec4 u; +#endif + +void main() +{ + gl_FragColor = vec4(un34[1]); + gl_FragColor += vec4(Color * colorTransform, 1.0); + + if (m != n) + gl_FragColor += v; + else { + gl_FragColor += m * v; + gl_FragColor += v * (m - n); + } + +#ifdef TEST_POST_110 + mat3x4 m34 = outerProduct(v, u); + m34 += mat4(v.x); + m34 += mat4(u, u.x, u, u.x, u, u.x, u.x); +#else + mat4 m34 = mat4(v.x*u.x, v.x*u.y, v.x*u.z, v.x*u.w, + v.y*u.x, v.y*u.y, v.y*u.z, v.y*u.w, + v.z*u.x, v.z*u.y, v.z*u.z, v.z*u.w, + v.w*u.x, v.w*u.y, v.w*u.z, v.w*u.w); + m34 += mat4(v.x); + m34 += mat4(u, u.x, u, u.x, u, u.x, u.x); + +#endif + + if (m34 == un34) + gl_FragColor += m34 * u; + else + gl_FragColor += (un34 * um43) * v; +} diff --git a/deps/glslang/Test/matrix2.frag b/deps/glslang/Test/matrix2.frag new file mode 100644 index 00000000..df658044 --- /dev/null +++ b/deps/glslang/Test/matrix2.frag @@ -0,0 +1,51 @@ +#version 150 + +uniform mat3 colorTransform; +varying vec3 Color; +uniform mat4 m, n; + +uniform mat4x3 um43; +uniform mat3x4 un34; +uniform mat2 um2; +uniform mat3 um3; +uniform mat4 um4; + +varying vec4 v; + +varying vec3 u; + +out vec4 FragColor; + +void main() +{ + mat3x4 m34 = outerProduct(v, u); + + m34 += mat3x4(4.3); + + FragColor = vec4(Color, 1.0); + FragColor *= vec4(FragColor * m34, 1.0); + + m34 *= v.x; + + mat4 m44 = mat4(un34); + + m44 += m34 * um43; + + FragColor += (-m44) * v; + + FragColor *= matrixCompMult(m44, m44); + + m34 = transpose(um43); + FragColor *= vec4(FragColor * m34, 1.0); + FragColor *= vec4(determinant(um4)); + mat2 inv = inverse(um2); + FragColor *= vec4(inv[0][0], inv[1][0], inv[0][1], inv[1][1]); + mat3 inv3 = inverse(um3); + FragColor *= vec4(inv3[2][1]); + + mat4 inv4 = inverse(um4); + FragColor *= inv4; + + FragColor = vec4(FragColor * matrixCompMult(un34, un34), FragColor.w); + m34 *= colorTransform; +} diff --git a/deps/glslang/Test/matrixError.vert b/deps/glslang/Test/matrixError.vert new file mode 100644 index 00000000..0ad145b2 --- /dev/null +++ b/deps/glslang/Test/matrixError.vert @@ -0,0 +1,24 @@ +#version 120 + +attribute vec3 v3; + +uniform mat3x2 m32; + +const mat2x4 m24 = mat2x4(1.0, 2.0, + 3.0, 4.0, + 3.0, 4.0, + 3.0, 4.0, 5.0); // ERROR, too many arguments + +void main() +{ + mat2x3 m23; + vec3 a, b; + + a = v3 * m23; // ERROR, type mismatch + b = m32 * v3; // ERROR, type mismatch + m23.xy; // ERROR, can't use . + + gl_Position = vec4(m23 * m32 * v3, m24[2][4]); // ERROR, 2 and 4 are out of range + m23 *= m23; // ERROR, right side needs to be square + m23 *= m32; // ERROR, left columns must match right rows +} diff --git a/deps/glslang/Test/maxClipDistances.vert b/deps/glslang/Test/maxClipDistances.vert new file mode 100644 index 00000000..62ddfeb9 --- /dev/null +++ b/deps/glslang/Test/maxClipDistances.vert @@ -0,0 +1,7 @@ +#version 130 + +out float gl_ClipDistance[8]; // OK, 8 is gl_MaxClipDistances + +void main() +{ +} diff --git a/deps/glslang/Test/max_vertices_0.geom b/deps/glslang/Test/max_vertices_0.geom new file mode 100644 index 00000000..4a420be1 --- /dev/null +++ b/deps/glslang/Test/max_vertices_0.geom @@ -0,0 +1,12 @@ +#version 330 + +layout(points) in; +layout(triangle_strip, max_vertices = 0) out; +in highp vec4 v_geom_FragColor[]; +out highp vec4 v_frag_FragColor; + +void main (void) +{ + EndPrimitive(); + EndPrimitive(); +} diff --git a/deps/glslang/Test/missingBodies.vert b/deps/glslang/Test/missingBodies.vert new file mode 100644 index 00000000..04b71815 --- /dev/null +++ b/deps/glslang/Test/missingBodies.vert @@ -0,0 +1,24 @@ +#version 450 + +void bar(); +void foo() { bar(); } + +void B(); +void C(int); +void C(int, int) { } +void C(bool); +void A() { B(); C(1); C(true); C(1, 2); } + +void main() +{ + foo(); + C(true); +} + +int ret1(); + +int f1 = ret1(); + +int ret2() { return 3; } + +int f2 = ret2(); diff --git a/deps/glslang/Test/mixedArrayDecls.frag b/deps/glslang/Test/mixedArrayDecls.frag new file mode 100644 index 00000000..aff4f78a --- /dev/null +++ b/deps/glslang/Test/mixedArrayDecls.frag @@ -0,0 +1,30 @@ +#version 450 + +struct S { + int[3] a[2], b[5]; +}; + +S s; + +int[5] c[4], d[8]; +int[9] e[], f[]; +int e[11][9]; +int f[13][9]; + +int[14] g[], h[]; + +int [14][15][6] foo(int[6] p[14][15]) { return p; } + +void main() +{ + g[3]; + h[2]; +} + +float[4][3][2] bar() { float[3][2] a[4]; return a; } + +in inbname { + float[7] f[8][9]; +} inbinst[4][5][6]; + +float[3][2] barm[4]() { float[3][2] a[4]; return a; } // ERROR diff --git a/deps/glslang/Test/negativeArraySize.comp b/deps/glslang/Test/negativeArraySize.comp new file mode 100644 index 00000000..20636c0a --- /dev/null +++ b/deps/glslang/Test/negativeArraySize.comp @@ -0,0 +1,10 @@ +#version 310 es + +#ifdef GL_ES +precision mediump float; +#endif + +void main() +{ + float f[-2]; // cannot declare arrays with negative size +} diff --git a/deps/glslang/Test/newTexture.frag b/deps/glslang/Test/newTexture.frag new file mode 100644 index 00000000..30e77dce --- /dev/null +++ b/deps/glslang/Test/newTexture.frag @@ -0,0 +1,75 @@ +#version 430 + +uniform samplerBuffer sb; +uniform sampler2DRect sr; +uniform sampler2D s2D; +uniform sampler3D s3D; +uniform samplerCube sCube; +uniform samplerCubeShadow sCubeShadow; +uniform sampler2DShadow s2DShadow; +uniform sampler2DArray s2DArray; +uniform sampler2DArrayShadow s2DArrayShadow; + +uniform isampler2D is2D; +uniform isampler3D is3D; +uniform isamplerCube isCube; +uniform isampler2DArray is2DArray; +uniform isampler2DMS is2Dms; + +uniform usampler2D us2D; +uniform usampler3D us3D; +uniform usamplerCube usCube; +uniform usampler2DArray us2DArray; + +in float c1D; +in vec2 c2D; +in vec3 c3D; +in vec4 c4D; + +flat in int ic1D; +flat in ivec2 ic2D; +flat in ivec3 ic3D; +flat in ivec4 ic4D; + +out vec4 FragData; + +void main() +{ + vec4 v = texture(s2D, c2D); + v += textureProj(s3D, c4D); + v += textureLod(s2DArray, c3D, 1.2); + v.y += textureOffset(s2DShadow, c3D, ivec2(3), c1D); + v += texelFetch(s3D, ic3D, ic1D); + v += texelFetchOffset(s2D, ic2D, 4, ivec2(3)); + v += texelFetchOffset(sr, ic2D, ivec2(4)); + v.y += textureLodOffset(s2DShadow, c3D, c1D, ivec2(3)); + v += textureProjLodOffset(s2D, c3D, c1D, ivec2(3)); + v += textureGrad(sCube, c3D, c3D, c3D); + v.x += textureGradOffset(s2DArrayShadow, c4D, c2D, c2D, ivec2(3)); + v += textureProjGrad(s3D, c4D, c3D, c3D); + v += textureProjGradOffset(s2D, c3D, c2D, c2D, ivec2(3)); + + ivec4 iv = texture(is2D, c2D); + v += vec4(iv); + iv = textureProjOffset(is2D, c4D, ivec2(3)); + v += vec4(iv); + iv = textureProjLod(is2D, c3D, c1D); + v += vec4(iv); + iv = textureProjGrad(is2D, c3D, c2D, c2D); + v += vec4(iv); + iv = texture(is3D, c3D, 4.2); + v += vec4(iv); + iv = textureLod(isCube, c3D, c1D); + v += vec4(iv); + iv = texelFetch(is2DArray, ic3D, ic1D); + v += vec4(iv); + iv += texelFetch(is2Dms, ic2D, ic1D); + v += vec4(iv); + v += texelFetch(sb, ic1D); + v += texelFetch(sr, ic2D); + + ivec2 iv2 = textureSize(sCubeShadow, 2); + // iv2 += textureSize(is2Dms); + + FragData = v + vec4(iv2, 0.0, 0.0); +} diff --git a/deps/glslang/Test/noMain.vert b/deps/glslang/Test/noMain.vert new file mode 100644 index 00000000..e83be047 --- /dev/null +++ b/deps/glslang/Test/noMain.vert @@ -0,0 +1,5 @@ +#version 300 es + +void foo() +{ +} diff --git a/deps/glslang/Test/noMain1.geom b/deps/glslang/Test/noMain1.geom new file mode 100644 index 00000000..ab0834f9 --- /dev/null +++ b/deps/glslang/Test/noMain1.geom @@ -0,0 +1,7 @@ +#version 110 + +void foo() +{ +} + +layout(points) out; \ No newline at end of file diff --git a/deps/glslang/Test/noMain2.geom b/deps/glslang/Test/noMain2.geom new file mode 100644 index 00000000..9fb5fd7d --- /dev/null +++ b/deps/glslang/Test/noMain2.geom @@ -0,0 +1,7 @@ +#version 150 + +void bar() +{ +} + +layout(line_strip) out; diff --git a/deps/glslang/Test/nonSquare.vert b/deps/glslang/Test/nonSquare.vert new file mode 100644 index 00000000..09744259 --- /dev/null +++ b/deps/glslang/Test/nonSquare.vert @@ -0,0 +1,25 @@ +#version 120 + +attribute vec3 v3; +attribute vec4 v4; + +uniform mat3x2 m32; + +const vec2 cv2 = vec2(10.0, 20.0); +const mat2x4 m24 = mat2x4(3.0); +const mat4x2 m42 = mat4x2(1.0, 2.0, + 3.0, 4.0, + 5.0, 6.0, + 7.0, 8.0); + +void main() +{ + mat2x3 m23; + vec2 a, b; + + a = v3 * m23; + b = m32 * v3; + + gl_Position = vec4(m23 * m32 * v3, m24[1][3]) + + (m24 * m42) * v4 + cv2 * m42 + m24 * cv2 + vec4(cv2[1], cv2.x, m42[2][1], m42[2][0]); +} diff --git a/deps/glslang/Test/nonVulkan.frag b/deps/glslang/Test/nonVulkan.frag new file mode 100644 index 00000000..425e8402 --- /dev/null +++ b/deps/glslang/Test/nonVulkan.frag @@ -0,0 +1,9 @@ +#version 450 + +layout(constant_id = 17) const int arraySize = 12; // ERROR +layout(input_attachment_index = 1) int foo; // ERROR +layout(push_constant) uniform ubn { int a; } ubi; // ERROR + +#ifdef VULKAN +#error VULKAN should not be defined +#endif diff --git a/deps/glslang/Test/nonuniform.frag b/deps/glslang/Test/nonuniform.frag new file mode 100644 index 00000000..3f3dd67a --- /dev/null +++ b/deps/glslang/Test/nonuniform.frag @@ -0,0 +1,33 @@ +#version 450 + +int nonuniformEXT; + +#extension GL_EXT_nonuniform_qualifier : enable + +nonuniformEXT in vec4 nu_inv4; +nonuniformEXT float nu_gf; + +nonuniformEXT out vec4 nu_outv4; // ERROR, out +nonuniformEXT uniform vec4 nu_uv4; // ERROR, uniform +nonuniformEXT const float nu_constf = 1.0; // ERROR, const + +nonuniformEXT int foo(nonuniformEXT int nupi, nonuniformEXT out int f) +{ + return nupi; +} + +void main() +{ + nonuniformEXT int nu_li; + nonuniformEXT const int nu_ci = 2; // ERROR, const + + foo(nu_li, nu_li); + + int a; + nu_li = nonuniformEXT(a) + nonuniformEXT(a * 2); + nu_li = nonuniformEXT(a, a); // ERROR, too many arguments + nu_li = nonuniformEXT(); // ERROR, no arguments +} + +layout(location=1) in struct S { float a; nonuniformEXT float b; } ins; // ERROR, not on member +layout(location=3) in inbName { float a; nonuniformEXT float b; } inb; // ERROR, not on member diff --git a/deps/glslang/Test/nosuffix b/deps/glslang/Test/nosuffix new file mode 100644 index 00000000..26862fff --- /dev/null +++ b/deps/glslang/Test/nosuffix @@ -0,0 +1,4 @@ +void main() +{ + gl_Position = vec4(1.0); +} \ No newline at end of file diff --git a/deps/glslang/Test/numeral.frag b/deps/glslang/Test/numeral.frag new file mode 100644 index 00000000..39814f4e --- /dev/null +++ b/deps/glslang/Test/numeral.frag @@ -0,0 +1,106 @@ +#version 400 + +void main() +{ + int o00 = 00; + int o000 = 000; + int o0000 = 0000; + int o5 = 05; + int o05 = 005; + int o006 = 0006; + int o7 = 07; + int o58 = 072; + int omax = 037777777777; + int o8 = 08; // ERROR + int o08 = 008; // ERROR + int o009 = 0009; // ERROR + int obig = 07324327323472347234; // ERROR + int omax1 = 040000000000; // ERROR + + uint uo5 = 05u; + uint uo6 = 06u; + uint uo7 = 07u; + uint uo8 = 08u; // ERROR + uint uo9 = 09u; // ERROR + + int h0 = 0x0; + int h00 = 0x00; + int h000 = 0x000; + int h1 = 0x1; + int h2 = 0x00000002; + int h300 = 0x000300; + int hABCDEF = 0xAbCdEF; + int hFFFFFFFF = 0xFFFFFFFF; + int h12345678 = 0xBC614E; + int hToBeOrNotToBe = 0x2b | ~0x2B; + + uint uh0 = 0x0u; + uint uhg = (0xcu); + uint uh000 = 0x000u; + uint uh1 = 0x1u; + uint uh2 = 0x00000002u; + uint uh300 = 0x000300u; + uint uhABCDEF = 0xAbCdEFu; + uint uhFFFFFFFF = 0xFFFFFFFFu; + uint uh12345678 = 0xBC614Eu; + uint uhToBeOrNotToBe = 0x2bu | ~0x2BU; + + //int he1 = 0xG; // ERROR + int he2 = 0x; // ERROR + int hbig = 0xFFFFFFFF1; // ERROR + + float f1 = 1.0; + float f2 = 2.; + float f3 = 3e0; + float f4 = 40e-1; + float f5 = 05.; + float f6 = 006.; + float f7 = .7e1; + float f8 = 08e0; + float f9 = .9e+1; + float f10 = 10.0; + float f11 = .011e+3; + float f12 = .0012e4; + float f543 = 000000543.; + float f6789 = 00006789.; + float f88 = 0000088.; + + float g1 = 5.3876e4; + float g2 = 4000000000e-11; + float g3 = 1e+5; + float g4 = 7.321E-3; + float g5 = 3.2E+4; + float g6 = 0.5e-5; + float g7 = 0.45; + float g8 = 6.e10; + + double gf1 = 1.0lf; + double gf2 = 2.Lf; + double gf3 = .3e1lF; + double gf4 = .4e1LF; + float gf5 = 5.f; + float gf6 = 6.F; + + //float e1 = 1..; // ERROR + //float e2 = 2.l; // ERROR + //float e3 = ..3; // ERROR + //float e4 = 4ee1; // ERROR + float e5 = 5f; // ERROR +} + +layout (location = 2) out vec4 c2; +layout (location = 3u) out vec4 c3; +layout (location = 04) out vec4 c4; +layout (location = 005u) out vec4 c5; +layout (location = 0x6) out vec4 c6; +layout (location = 0x7u) out vec4 c7; + +uint g1 = 4294967296u; // ERROR, too big +uint g2 = 4294967295u; +uint g3 = 4294967294u; +int g4 = 4294967296; // ERROR, too big +int g5 = 4294967295; +int g6 = 4294967294; +float inf1 = -1.#INF; +float inf2 = 1.#INF; +float inf3 = +1.#INF; diff --git a/deps/glslang/Test/nvShaderNoperspectiveInterpolation.frag b/deps/glslang/Test/nvShaderNoperspectiveInterpolation.frag new file mode 100644 index 00000000..15c191d0 --- /dev/null +++ b/deps/glslang/Test/nvShaderNoperspectiveInterpolation.frag @@ -0,0 +1,15 @@ +#version 300 es + +precision mediump float; + +noperspective in vec4 bad; // ERROR + +#extension GL_NV_shader_noperspective_interpolation : enable + +noperspective in vec4 color; + +out vec4 fragColor; + +void main() { + fragColor = color; +} \ No newline at end of file diff --git a/deps/glslang/Test/overlongLiteral.frag b/deps/glslang/Test/overlongLiteral.frag new file mode 100644 index 00000000..c351ed6b --- /dev/null +++ b/deps/glslang/Test/overlongLiteral.frag @@ -0,0 +1 @@ +0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000; diff --git a/deps/glslang/Test/parent.h b/deps/glslang/Test/parent.h new file mode 100644 index 00000000..9ef68e0b --- /dev/null +++ b/deps/glslang/Test/parent.h @@ -0,0 +1 @@ +float4 i4; diff --git a/deps/glslang/Test/parentBad b/deps/glslang/Test/parentBad new file mode 100644 index 00000000..e54c10d0 --- /dev/null +++ b/deps/glslang/Test/parentBad @@ -0,0 +1,3 @@ +int a; + +#error bad parent diff --git a/deps/glslang/Test/pointCoord.frag b/deps/glslang/Test/pointCoord.frag new file mode 100644 index 00000000..8dc9e746 --- /dev/null +++ b/deps/glslang/Test/pointCoord.frag @@ -0,0 +1,15 @@ +precision highp float; + +uniform sampler2D sampler; + +void main() +{ + vec4 color; + + if (length(gl_PointCoord) < 0.3) + color = texture2D(sampler, gl_PointCoord); + else + color = vec4(0.0); + + gl_FragColor = color; +} diff --git a/deps/glslang/Test/precise.tesc b/deps/glslang/Test/precise.tesc new file mode 100644 index 00000000..c541540c --- /dev/null +++ b/deps/glslang/Test/precise.tesc @@ -0,0 +1,109 @@ +#version 450 +#extension GL_EXT_tessellation_shader : require +#extension GL_EXT_gpu_shader5 : require + +float minimal() { + precise float result = 5.0; + float a = 10.0; + float b = 20.0; + float c = 30.0; + float d = 40.0; + result = a * b + c * d; // c * d, a * b and rvalue1 + rvalue2 should be 'noContraction'. + return result; +} + +void continuous_assignment() { + precise float result = 5.0; + float a = 10.0; + float b = 20.0; + result = a = b + 4; // b + 4 should be 'noContraction'. +} + +void convert() { + precise double result; + float a = 10.0; + float b = 20.0; + b = a + b; // a + b should be 'noContraction'. + result = double(b); // convert operation should not be 'noContraction'. +} + +float loop_for() { + precise float r1 = 5.0; + precise float r2 = 10.0; + int a = 10; + int b = 20; + int c = 30; + for (int i = 0; i < a; i++) { + r1 += 3.12 + b + i; // 'noContration', this make i++ also 'noContraction' + c += 1; // 'noContration' + } + a += 1; // a + 1 should not be 'noContraction'. + r2 = c; // The calculation of c should be 'noContration'. + return float(r1 + r2); // conversion should not be 'noContration'. +} + +void loop_array(void) { + precise float result; + + int x = 22; + int y = 33; + + float a0[3]; + result += float(x) + float(y); // x + y should be 'noContraction' also result + rvalue. + + for (int i = 0; i < 3; ++i) { + // a's dereference + 2 should be 'noContraction'. + result += a0[i] + 2; + // result + 1 and 3 - rvalue should be 'noContraction'. + a0[i] = 3 - result++; + } +} + +void loop_while() { + precise float result = 5.0; + int a = 10; + int b = 20; + while (result < 10) { + result += 3.12 + b; // result + 3.12 should be 'noContraction'. + } + result = a + b + 5; // b + 5 should not be 'noCtraction' because all operands are integers. + result = 11.1; +} + +float fma_not_decorated() { + precise float result; + float a = 1.0; + float b = 2.0; + float c = 3.0; + b = b + c; // b + c should be decorated with 'noContraction' + result = fma(a, b, c); // fma() should not be decorated with 'noContradtion' + return result; +} + +precise float precise_return_exp_func() { + float a = 1.0; + float b = 2.0; + return a + b; // the ADD operation should be 'noContraction' +} + +precise float precise_return_val_func() { + float a = 1.0; + float b = 2.0; + float result = a + b; // the ADD operation should be 'noContraction' + return result; +} + +float precise_func_parameter(float b, precise out float c) { + float a = 0.5; + c = a + b; // noContration + return a - b; // Not noContraction +} + +mat3 matrix (mat2x3 a, mat3x2 b) { + mat2x3 c = mat2x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0); + precise mat3 result; + result = (a + c) * b; // should be noContraction + return result; +} + +void main(){} diff --git a/deps/glslang/Test/precise_struct_block.vert b/deps/glslang/Test/precise_struct_block.vert new file mode 100644 index 00000000..279b4b09 --- /dev/null +++ b/deps/glslang/Test/precise_struct_block.vert @@ -0,0 +1,89 @@ +#version 450 + +struct T { + float f1; + float f2; +}; + +out B1 {precise T s; float x;} partial_precise_block; +precise out B2 {T s; float x;} all_precise_block; + +float struct_member() { + float a = 1.0; + float b = 2.0; + float c = 3.0; + float d = 4.0; + + precise float result; + + T S, S2, S3; + + S2.f1 = a + 0.2; // NoContraction + S2.f2 = b + 0.2; // NOT NoContraction + S3.f1 = a + b; // NOT NoContraction + S = S2; // "precise" propagated through parent object nodes + result = S.f1 + 0.1; // the ADD operation should be NoContraction + + return result; +} + +float complex_array_struct() { + precise float result; + struct T1 { + float t1_array[3]; + float t1_scalar; + }; + struct T2 { + T1 t1a[5]; + T1 t1b[6]; + T1 t1c[7]; + }; + struct T3 {float f; T2 t2; vec4 v; int p;}; + T3 t3[10]; + for(int i=0; i<10; i++) { + t3[i].f = i / 3.0; // Not NoContraction + t3[i].v = vec4(i * 1.5); // NoContraction + t3[i].p = i + 1; + for(int j=0; j<5; j++) { + for(int k = 0; k<3; k++) { + t3[i].t2.t1a[j].t1_array[k] = i * j + k; // Not NoContraction + } + t3[i].t2.t1a[j].t1_scalar = j * 2.0 / i; // Not NoContration + } + + for(int j=0; j<6; j++) { + for(int k = 0; k<3; k++) { + t3[i].t2.t1b[j].t1_array[k] = i * j + k; // Not NoContraction + } + t3[i].t2.t1b[j].t1_scalar = j * 2.0 / i; // NoContraction + } + + for(int j=0; j<6; j++) { + for(int k = 0; k<3; k++) { + t3[i].t2.t1c[j].t1_array[k] = i * j + k; // Not NoContraction because all operands are integers + } + t3[i].t2.t1c[j].t1_scalar = j * 2.0 / i; // Not NoContraction + } + } + int i = 2; + result = t3[5].t2.t1c[6].t1_array[1] + + t3[2].t2.t1b[1].t1_scalar + + t3[i - 1].v.xy.x; // NoContraction + return result; +} + +float out_block() { + float a = 0.1; + float b = 0.2; + partial_precise_block.s.f1 = a + b; // NoContraction + partial_precise_block.s.f2 = a - b; // NoContraction + partial_precise_block.x = a * b; // Not NoContraction + + all_precise_block.s.f1 = a + b + 1.0; // NoContraction + all_precise_block.s.f2 = a - b - 1.0; // NoContraction + all_precise_block.x = a * b * 2.0; // Also NoContraction + + return a + b; // Not NoContraction +} + +void main(){} diff --git a/deps/glslang/Test/precision.frag b/deps/glslang/Test/precision.frag new file mode 100644 index 00000000..e24fa52c --- /dev/null +++ b/deps/glslang/Test/precision.frag @@ -0,0 +1,76 @@ +#version 100 + +varying vec3 color; // ERRROR, there is no default qualifier for float + +lowp vec2 foo(mediump vec3 mv3) +{ + highp vec4 hv4; + return hv4.xy; +} + +int global_medium; + +uniform lowp sampler2D samplerLow; +uniform mediump sampler2D samplerMed; +uniform highp sampler2D samplerHigh; + +precision highp int; +precision highp ivec2; // ERROR +precision mediump int[2]; // ERROR +vec4 uint; // okay +precision mediump vec4; // ERROR + +int global_high; + +void main() +{ + lowp int sum = global_medium + global_high; + + gl_FragColor = vec4(color, 1.0); + + int level1_high; + sum += level1_high; + + precision lowp int; + int level1_low; + sum += level1_low; + + // test maxing precisions of args to get precision of builtin + lowp float arg1; + mediump float arg2; + lowp float d = distance(arg1, arg2); + + { + int level2_low; + sum += level2_low; + + precision highp int; + int level2_high; + sum += level2_high; + do { + if (true) { + precision mediump int; + int level4_medium; + sum += level4_medium; + } + int level3_high; + sum += level3_high; + } while (true); + int level2_high2; + sum += level2_high2; + } + int level1_low3; + sum += level1_low3; + + sum += 4 + ((ivec2(level1_low3) * ivec2(level1_high) + ivec2((/* comma operator */level1_low3, level1_high)))).x; + + texture2D(samplerLow, vec2(0.1, 0.2)); + texture2D(samplerMed, vec2(0.1, 0.2)); + texture2D(samplerHigh, vec2(0.1, 0.2)); +} + +precision mediump bool; // ERROR +//precision mediump struct { int a; } s; // ERROR +struct s {int a;}; +precision mediump s; // ERROR +mediump bvec2 b2; // ERROR diff --git a/deps/glslang/Test/precision.vert b/deps/glslang/Test/precision.vert new file mode 100644 index 00000000..5d073488 --- /dev/null +++ b/deps/glslang/Test/precision.vert @@ -0,0 +1,25 @@ +#version 300 es + +in vec4 pos; + +uniform sampler2D s2D; +uniform samplerCube sCube; +uniform isampler2DArray is2DAbad; // ERROR, no default precision +uniform sampler2DArrayShadow s2dASbad; // ERROR, no default precision + +precision highp sampler2D; +precision mediump sampler2DArrayShadow; + +uniform sampler2DArrayShadow s2dAS; +uniform isampler2DArray is2DAbad2; // ERROR, still no default precision + +uniform sampler2D s2Dhigh; + +void main() +{ + vec4 t = texture(s2D, vec2(0.1, 0.2)); + t += texture(s2Dhigh, vec2(0.1, 0.2)); + t += texture(s2dAS, vec4(0.5)); + + gl_Position = pos; +} diff --git a/deps/glslang/Test/prepost.frag b/deps/glslang/Test/prepost.frag new file mode 100644 index 00000000..dfd45666 --- /dev/null +++ b/deps/glslang/Test/prepost.frag @@ -0,0 +1,38 @@ +#version 140 + +void main() +{ + struct s { + float y[5]; + } str; + + float t; + int index = 5; // all indexing is 4 + + str.y[4] = 2.0; // 2.0 + t = ++str.y[--index]; // 3.0 + str.y[4] += t; // 6.0 + t = str.y[4]--; // 5.0 (t = 6.0) + str.y[index++] += t; // 11.0 + --str.y[--index]; // 10.0 + + float x = str.y[4]; + ++x; + --x; + x++; + x--; + + // x is 10.0 + + float y = x * ++x; // 10 * 11 + float z = y * x--; // 110 * 11 + + // x is 10.0 + // z is 1210.0 + + vec4 v = vec4(1.0, 2.0, 3.0, 4.0); + v.y = v.z--; // (1,3,2,4) + v.x = --v.w; // (3,3,2,3) + + gl_FragColor = z * v;// (3630.0, 3630.0, 2420.0, 3630.0) +} diff --git a/deps/glslang/Test/preprocessor.bad_arg.vert b/deps/glslang/Test/preprocessor.bad_arg.vert new file mode 100644 index 00000000..344fc4b1 --- /dev/null +++ b/deps/glslang/Test/preprocessor.bad_arg.vert @@ -0,0 +1,8 @@ +#define M(a) a +int M(aou + = 2) // Okay, one argument, split across newline + ; + +// end of file during an argument +#define EXP2(a, b) +EXP2(((((1,2,3,4))), ); diff --git a/deps/glslang/Test/preprocessor.cpp_style___FILE__.vert b/deps/glslang/Test/preprocessor.cpp_style___FILE__.vert new file mode 100644 index 00000000..6d2bc1d8 --- /dev/null +++ b/deps/glslang/Test/preprocessor.cpp_style___FILE__.vert @@ -0,0 +1,36 @@ +#extension GL_GOOGLE_cpp_style_line_directive : enable + +__FILE__ + +#line 150 "a.h" +__FILE__ + +#line 24 +__FILE__ + +#line 42 +__FILE__ + +#line 30 "b.cc" +__FILE__ + +#line 10 3 +__FILE__ + +#line 48 +__FILE__ + +#line 4 +__FILE__ + +#line 55 100 +__FILE__ + +#line 1000 "c" +__FILE__ + +#line 42 1 +__FILE__ + +#line 42 "this-is-a-quite-long-name-maybe-i-should-shorten-it" +__FILE__ diff --git a/deps/glslang/Test/preprocessor.cpp_style_line_directive.vert b/deps/glslang/Test/preprocessor.cpp_style_line_directive.vert new file mode 100644 index 00000000..90fb2614 --- /dev/null +++ b/deps/glslang/Test/preprocessor.cpp_style_line_directive.vert @@ -0,0 +1,36 @@ +#extension GL_GOOGLE_cpp_style_line_directive : enable + +#error at "0:3" + +#line 150 "a.h" +#error at "a.h:150" + +#line 24 +#error at "a.h:24" + +#line 42 +#error at "a.h:42" + +#line 30 "b.cc" +#error at "b.cc:30" + +#line 10 3 +#error at "3:10" + +#line 48 +#error at "3:48" + +#line 4 +#error at "3:4" + +#line 55 100 +#error at "100:55" + +#line 1000 "c" +#error at "c:1000" + +#line 42 1 +#error at "1:42" + +#line 42 "this-is-a-quite-long-name-maybe-i-should-shorten-it" +#error at "this-is-a-quite-long-name-maybe-i-should-shorten-it:42" diff --git a/deps/glslang/Test/preprocessor.defined.vert b/deps/glslang/Test/preprocessor.defined.vert new file mode 100644 index 00000000..375e4d3d --- /dev/null +++ b/deps/glslang/Test/preprocessor.defined.vert @@ -0,0 +1,2 @@ +#define defined_not_really +#define defined // ERROR: "defined" can't be (un)defined: diff --git a/deps/glslang/Test/preprocessor.edge_cases.vert b/deps/glslang/Test/preprocessor.edge_cases.vert new file mode 100644 index 00000000..95bfbb3a --- /dev/null +++ b/deps/glslang/Test/preprocessor.edge_cases.vert @@ -0,0 +1,15 @@ +#version 310 es +#define X(Y) /* + */ Y + 2 + +#define Y(Z) 2 * Z// asdf + +#define Z(Y) /* + */ \ + 2 /* + */ + 3 \ + * Y + +void main() { + gl_Position = vec4(X(3) + Y(4) + Z(2)); +} diff --git a/deps/glslang/Test/preprocessor.eof_missing.vert b/deps/glslang/Test/preprocessor.eof_missing.vert new file mode 100644 index 00000000..91773148 --- /dev/null +++ b/deps/glslang/Test/preprocessor.eof_missing.vert @@ -0,0 +1 @@ +noEOF \ No newline at end of file diff --git a/deps/glslang/Test/preprocessor.errors.vert b/deps/glslang/Test/preprocessor.errors.vert new file mode 100644 index 00000000..ca83848f --- /dev/null +++ b/deps/glslang/Test/preprocessor.errors.vert @@ -0,0 +1,20 @@ +#version 310 es + +#define X 1 + +#if X + #ifdef Y + #error This should not show up in pp output. + #endif + #error This should show up in pp output. +#else + #error This should not show up in pp output. +#endif + +#def X +#if Y + +#extension a + +int main() { +} diff --git a/deps/glslang/Test/preprocessor.extensions.vert b/deps/glslang/Test/preprocessor.extensions.vert new file mode 100644 index 00000000..07455d54 --- /dev/null +++ b/deps/glslang/Test/preprocessor.extensions.vert @@ -0,0 +1,12 @@ +#version 310 es + +#extension GL_EXT_geometry_shader: enable +#extension GL_EXT_frag_depth: disable +#extension GL_EXT_gpu_shader5: require +#extension GL_EXT_shader_texture_image_samples: warn + +#extension unknown_extension: require + +int main() { +} + diff --git a/deps/glslang/Test/preprocessor.function_macro.vert b/deps/glslang/Test/preprocessor.function_macro.vert new file mode 100644 index 00000000..577ea7e3 --- /dev/null +++ b/deps/glslang/Test/preprocessor.function_macro.vert @@ -0,0 +1,20 @@ +#version 310 es + + +#define X(n) n + 1 +#define Y(n, z) n + z +#define Z(f) X(f) + +#define REALLY_LONG_MACRO_NAME_WITH_MANY_PARAMETERS(X1, X2, X3, X4, X5, X6, X7,\ + X8, X9, X10, X11, X12) X1+X2+X3+X4+X5+X6+X7+X8+X9+X10+X11+X12 + +#define A(\ + Y\ + )\ +4 + 3 + Y + +int main() { + gl_Position = vec4(X(3), Y(3, 4), Z(3)); + gl_Position = vec4(REALLY_LONG_MACRO_NAME_WITH_MANY_PARAMETERS(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)); + gl_Position = vec4(A(3)); +} diff --git a/deps/glslang/Test/preprocessor.include.disabled.vert b/deps/glslang/Test/preprocessor.include.disabled.vert new file mode 100644 index 00000000..865baa18 --- /dev/null +++ b/deps/glslang/Test/preprocessor.include.disabled.vert @@ -0,0 +1,6 @@ +#line 8000 +#include +#include 123 +#include "foo" +#include "foo" garbage +#include "no-eol" \ No newline at end of file diff --git a/deps/glslang/Test/preprocessor.include.enabled.vert b/deps/glslang/Test/preprocessor.include.enabled.vert new file mode 100644 index 00000000..985eae2c --- /dev/null +++ b/deps/glslang/Test/preprocessor.include.enabled.vert @@ -0,0 +1,20 @@ +#extension GL_GOOGLE_include_directive : enable +#line 8000 +#include +#include 123 +#include "foo.oeu" +#include "foo.oeu/ao eu/ao.h" +#include "foo" +#include +#include +#include +#include "foo.oe>" +#include +#include "foo2.h" garbage +#include garbage +// max length +#include +// too long +#include +#include "no-eol" \ No newline at end of file diff --git a/deps/glslang/Test/preprocessor.line.frag b/deps/glslang/Test/preprocessor.line.frag new file mode 100644 index 00000000..0b7ac766 --- /dev/null +++ b/deps/glslang/Test/preprocessor.line.frag @@ -0,0 +1,4 @@ +#version 310 es +#line 1 2 +#pragma something +void main() {} diff --git a/deps/glslang/Test/preprocessor.line.vert b/deps/glslang/Test/preprocessor.line.vert new file mode 100644 index 00000000..fed6bba2 --- /dev/null +++ b/deps/glslang/Test/preprocessor.line.vert @@ -0,0 +1,39 @@ +#line 300 + +#line 2 + + + + + +#line __LINE__ + 3 + + +#line __FILE__ + 2 + +#line __FILE__ * __LINE__ + + +#define X 4 + +#line X + +#undef X + +#define X(y) y + 3 + 2 + +#line X(3) + +void main() { + gl_Position = vec4(__LINE__); +} + +#line X(3) 4 + +#define Z(y, q) \ + y*q*2 q + +#line Z(2, 3) + +#line 1 + diff --git a/deps/glslang/Test/preprocessor.many.endif.vert b/deps/glslang/Test/preprocessor.many.endif.vert new file mode 100644 index 00000000..7b049629 --- /dev/null +++ b/deps/glslang/Test/preprocessor.many.endif.vert @@ -0,0 +1,10 @@ +#endif +#endif +#endif +#endif +#endif +#endif +#endif + +#if +#else diff --git a/deps/glslang/Test/preprocessor.pragma.vert b/deps/glslang/Test/preprocessor.pragma.vert new file mode 100644 index 00000000..0ae7ee21 --- /dev/null +++ b/deps/glslang/Test/preprocessor.pragma.vert @@ -0,0 +1,13 @@ +#version 310 es + +#pragma optimize(on) +#pragma optimize(off) +#pragma debug(on) +#pragma debug(off) + +#pragma undefined_pragma(x, 4) + +#pragma once + +int main() { +} diff --git a/deps/glslang/Test/preprocessor.simple.vert b/deps/glslang/Test/preprocessor.simple.vert new file mode 100644 index 00000000..788df76c --- /dev/null +++ b/deps/glslang/Test/preprocessor.simple.vert @@ -0,0 +1,65 @@ +#version 310 es +#define X 1 +#define Y clamp +#define Z X + +#define F 1, 2 + +#define make_function \ + float fn ( float x ) \ + {\ + return x + 4.0; \ + } + +make_function + +int main() { + gl_Position = vec4(X); + gl_Position = Y(1, 2, 3); + gl_Position = vec4(Z); + gl_Position = vec4(F); + gl_Position = vec4(fn(3)); + [] . ++ -- + + - * % / - ! ~ + << >> < > <= >= + == != + & ^ | && ^^ || ? : + += -= *= /= %= <<= >>= &= |= ^= + 1.2 2E10 5u -5lf +} + +struct S { + int member1; + float member2; + vec4 member3; +}; + +#define xyz xxyz +#define yzy() yyz + +#define FUN_MAC() \ + vec3 a = vec3(0); \ + vec3 b = a.zxyz; \ + vec3 b = a.xyz; \ + vec3 b = a.yzy(); \ + vec3 b = a.xyz(); \ + vec3 b = a.yzy; \ + vec3 b = a.z; + +void foo() +{ + S s; + s.member2 + s.member1; + s.member3.zyx; + s.member2.xyz; + s.member2.yzy(); + s.member2.xyz(); + s.member2.yzy; + FUN_MAC() + yzy + + (); + yzy + + +} diff --git a/deps/glslang/Test/preprocessor.success_if_parse_would_fail.vert b/deps/glslang/Test/preprocessor.success_if_parse_would_fail.vert new file mode 100644 index 00000000..ed1ad0c0 --- /dev/null +++ b/deps/glslang/Test/preprocessor.success_if_parse_would_fail.vert @@ -0,0 +1,4 @@ +int x() { + something that shouldnt compile; +} + diff --git a/deps/glslang/Test/recurse1.frag b/deps/glslang/Test/recurse1.frag new file mode 100644 index 00000000..66b4c3fe --- /dev/null +++ b/deps/glslang/Test/recurse1.frag @@ -0,0 +1,48 @@ +#version 330 core + +// cross-unit recursion + +void main() {} + +// two-level recursion + +float cbar(int); + +void cfoo(float) +{ + cbar(2); +} + +// four-level, out of order + +void CB(); +void CD(); +void CA() { CB(); } +void CC() { CD(); } + +// high degree + +void CBT(); +void CDT(); +void CAT() { CBT(); CBT(); CBT(); } +void CCT() { CDT(); CDT(); CBT(); } + +// not recursive + +void norA() {} +void norB() { norA(); } +void norC() { norA(); } +void norD() { norA(); } +void norE() { norB(); } +void norF() { norB(); } +void norG() { norE(); } +void norH() { norE(); } +void norI() { norE(); } + +// not recursive, but with a call leading into a cycle if ignoring direction + +void norcA() { } +void norcB() { norcA(); } +void norcC() { norcB(); } +void norcD() { norcC(); norcB(); } // head of cycle +void norcE() { norcD(); } // lead into cycle diff --git a/deps/glslang/Test/recurse1.vert b/deps/glslang/Test/recurse1.vert new file mode 100644 index 00000000..e2dbce00 --- /dev/null +++ b/deps/glslang/Test/recurse1.vert @@ -0,0 +1,44 @@ +#version 330 core + +void main() {} + +float bar(int); + +// direct recursion + +void self() +{ + self(); +} + +// two-level recursion + +void foo(float) +{ + bar(2); +} + +float bar(int) +{ + foo(4.2); + + return 3.2; +} + +// four-level, out of order + +void B(); +void D(); +void A() { B(); } +void C() { D(); } +void B() { C(); } +void D() { A(); } + +// high degree + +void BT(); +void DT(); +void AT() { BT(); BT(); BT(); } +void CT() { DT(); AT(); DT(); BT(); } +void BT() { CT(); CT(); CT(); } +void DT() { AT(); } diff --git a/deps/glslang/Test/recurse2.frag b/deps/glslang/Test/recurse2.frag new file mode 100644 index 00000000..d649fef6 --- /dev/null +++ b/deps/glslang/Test/recurse2.frag @@ -0,0 +1,28 @@ +#version 330 core + +// cross-unit recursion + +// two-level recursion + +void cfoo(float); + +float cbar(int) +{ + cfoo(4.2); + + return 3.2; +} + +// four-level, out of order + +void CA(); +void CC(); +void CB() { CC(); } +void CD() { CA(); } + +// high degree + +void CAT(); +void CCT(); +void CBT() { CCT(); CCT(); CCT(); } +void CDT() { CAT(); } diff --git a/deps/glslang/Test/reflection.vert b/deps/glslang/Test/reflection.vert new file mode 100644 index 00000000..7549f081 --- /dev/null +++ b/deps/glslang/Test/reflection.vert @@ -0,0 +1,206 @@ +#version 440 core + +layout(std140, row_major) uniform nameless { + vec3 anonMember1; + mat3x2 m23; + int scalarAfterm23; + vec4 anonDeadMember2; + vec4 anonMember3; + int scalarBeforeArray; + float floatArray[5]; + int scalarAfterArray; + mat2x2 m22[9]; +}; + +layout(std140, column_major) uniform c_nameless { + vec3 c_anonMember1; + mat3x2 c_m23; + int c_scalarAfterm23; + vec4 c_anonDeadMember2; + vec4 c_anonMember3; +}; + +layout(std140) uniform named { + vec3 deadMember1; + int scalar; + vec4 member2; + vec4 member3; + vec2 memvec2; + float memf1; + bool memf2; + int memf3; + vec2 memvec2a; + mat2x2 m22[7]; +} ablock; + +layout(std140) uniform namelessdead { + int a; +}; + +layout(std140) uniform namedDead { + int b; +} bblock; + +struct N1 { + float a; +}; + +struct N2 { + float b; + float c; + float d; +}; + +struct N3 { + N1 n1; + N2 n2; +}; + +layout(std140) uniform nested { + N3 foo; +} nest; + +struct TS { + int a; + int dead; +}; + +uniform TS s; + +uniform float uf1; +uniform float uf2; +uniform float ufDead3; +uniform float ufDead4; + +uniform writeonly uimage2D image_ui2D; +uniform sampler2D sampler_2D; +uniform sampler2DMSArray sampler_2DMSArray; + +uniform mat2 dm22[10]; + +struct deep1 { + vec2 va[3]; + bool b; +}; + +struct deep2 { + int i; + deep1 d1[4]; +}; + +struct deep3 { + vec4 iv4; + deep2 d2; + ivec3 v3; +}; + +in float attributeFloat; +layout(location = 2) in vec2 attributeFloat2; +in vec3 attributeFloat3; +in vec4 attributeFloat4; +in mat4 attributeMat4; + +uniform deep3 deepA[2], deepB[2], deepC[3], deepD[2]; + +const bool control = true; + +void deadFunction() +{ + vec3 v3 = ablock.deadMember1; + vec4 v = anonDeadMember2; + float f = ufDead4; +} + +void liveFunction2() +{ + vec3 v = anonMember1; + float f = uf1; +} + +void liveFunction1(writeonly uimage2D p_ui2D, sampler2D p_2D, sampler2DMSArray p_2DMSArray) + +{ + liveFunction2(); + float f = uf2; + vec4 v = ablock.member3; +} + +uniform abl { + float foo; +} arrBl[4]; + +uniform abl2 { + float foo; +} arrBl2[4]; + +buffer buf1 { + float scalar; + float runtimeArray[]; +} buf1i; + +buffer buf2 { + float scalar; + N2 runtimeArray[]; +} buf2i; + +buffer buf3 { + float scalar; + float runtimeArray[]; +} buf3i; + +buffer buf4 { + float scalar; + N2 runtimeArray[]; +} buf4i; + +void main() +{ + liveFunction1(image_ui2D, sampler_2D, sampler_2DMSArray); + liveFunction2(); + + if (! control) + deadFunction(); + + float f; + int i; + if (control) { + liveFunction2(); + f = anonMember3.z; + f = s.a; + f = ablock.scalar; + f = m23[1].y + scalarAfterm23; + f = c_m23[1].y + c_scalarAfterm23; + f += scalarBeforeArray; + f += floatArray[2]; + f += floatArray[4]; + f += scalarAfterArray; + f += ablock.memvec2.x; + f += ablock.memf1; + f += float(ablock.memf2); + f += ablock.memf3; + f += ablock.memvec2a.y; + f += ablock.m22[i][1][0]; + f += dm22[3][0][1]; + f += m22[2][1].y; + f += nest.foo.n1.a + nest.foo.n2.b + nest.foo.n2.c + nest.foo.n2.d; + f += deepA[i].d2.d1[2].va[1].x; + f += deepB[1].d2.d1[i].va[1].x; + f += deepB[i].d2.d1[i].va[1].x; + deep3 d = deepC[1]; + deep3 da[2] = deepD; + } else + f = ufDead3; + + f += arrBl[2].foo + arrBl[0].foo; + f += arrBl2[i].foo; + + f += attributeFloat; + f += attributeFloat2.x; + f += attributeFloat3.x; + f += attributeFloat4.x; + f += attributeMat4[0][1]; + f += buf1i.runtimeArray[3]; + f += buf2i.runtimeArray[3].c; + f += buf3i.runtimeArray[gl_InstanceID]; + f += buf4i.runtimeArray[gl_InstanceID].c; +} diff --git a/deps/glslang/Test/remap.basic.dcefunc.frag b/deps/glslang/Test/remap.basic.dcefunc.frag new file mode 100644 index 00000000..714120ab --- /dev/null +++ b/deps/glslang/Test/remap.basic.dcefunc.frag @@ -0,0 +1,11 @@ +#version 450 + +in float inf; +out vec4 outf4; + +vec3 dead_fn() { return vec3(0); } + +void main() +{ + outf4 = vec4(inf); +} diff --git a/deps/glslang/Test/remap.basic.everything.frag b/deps/glslang/Test/remap.basic.everything.frag new file mode 100644 index 00000000..714120ab --- /dev/null +++ b/deps/glslang/Test/remap.basic.everything.frag @@ -0,0 +1,11 @@ +#version 450 + +in float inf; +out vec4 outf4; + +vec3 dead_fn() { return vec3(0); } + +void main() +{ + outf4 = vec4(inf); +} diff --git a/deps/glslang/Test/remap.basic.none.frag b/deps/glslang/Test/remap.basic.none.frag new file mode 100644 index 00000000..714120ab --- /dev/null +++ b/deps/glslang/Test/remap.basic.none.frag @@ -0,0 +1,11 @@ +#version 450 + +in float inf; +out vec4 outf4; + +vec3 dead_fn() { return vec3(0); } + +void main() +{ + outf4 = vec4(inf); +} diff --git a/deps/glslang/Test/remap.basic.strip.frag b/deps/glslang/Test/remap.basic.strip.frag new file mode 100644 index 00000000..714120ab --- /dev/null +++ b/deps/glslang/Test/remap.basic.strip.frag @@ -0,0 +1,11 @@ +#version 450 + +in float inf; +out vec4 outf4; + +vec3 dead_fn() { return vec3(0); } + +void main() +{ + outf4 = vec4(inf); +} diff --git a/deps/glslang/Test/remap.hlsl.sample.basic.everything.frag b/deps/glslang/Test/remap.hlsl.sample.basic.everything.frag new file mode 100644 index 00000000..03e83ef9 --- /dev/null +++ b/deps/glslang/Test/remap.hlsl.sample.basic.everything.frag @@ -0,0 +1,90 @@ +SamplerState g_sSamp : register(s0); +uniform sampler2D g_sSamp2d +{ + AddressU = MIRROR; + AddressV = WRAP; + MinLOD = 0; + MaxLOD = 10; + MaxAnisotropy = 2; + MipLodBias = 0.2; +}, g_sSamp2D_b; + +Texture1D g_tTex1df4a : register(t1); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +struct MemberTest +{ + int Sample; // in HLSL, method names are valid struct members. + int CalculateLevelOfDetail; // ... + int CalculateLevelOfDetailUnclamped; // ... + int Gather; // ... + int GetDimensions; // ... + int GetSamplePosition; // ... + int Load; // ... + int SampleBias; // ... + int SampleCmp; // ... + int SampleCmpLevelZero; // ... + int SampleGrad; // ... + int SampleLevel; // ... +}; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + MemberTest mtest; + mtest.CalculateLevelOfDetail = 1; // in HLSL, method names are valid struct members. + mtest.CalculateLevelOfDetailUnclamped = 1; // ... + mtest.Gather = 1; // ... + mtest.GetDimensions = 1; // ... + mtest.GetSamplePosition = 1; // ... + mtest.Load = 1; // ... + mtest.Sample = 1; // ... + mtest.SampleBias = 1; // ... + mtest.SampleCmp = 1; // ... + mtest.SampleCmpLevelZero = 1; // ... + mtest.SampleGrad = 1; // ... + mtest.SampleLevel = 1; // ... + + float4 txval10 = g_tTex1df4 . Sample(g_sSamp, 0.1); + int4 txval11 = g_tTex1di4 . Sample(g_sSamp, 0.2); + uint4 txval12 = g_tTex1du4 . Sample(g_sSamp, 0.3); + + float4 txval20 = g_tTex2df4 . Sample(g_sSamp, float2(0.1, 0.2)); + int4 txval21 = g_tTex2di4 . Sample(g_sSamp, float2(0.3, 0.4)); + uint4 txval22 = g_tTex2du4 . Sample(g_sSamp, float2(0.5, 0.6)); + + float4 txval30 = g_tTex3df4 . Sample(g_sSamp, float3(0.1, 0.2, 0.3)); + int4 txval31 = g_tTex3di4 . Sample(g_sSamp, float3(0.4, 0.5, 0.6)); + uint4 txval32 = g_tTex3du4 . Sample(g_sSamp, float3(0.7, 0.8, 0.9)); + + float4 txval40 = g_tTexcdf4 . Sample(g_sSamp, float3(0.1, 0.2, 0.3)); + int4 txval41 = g_tTexcdi4 . Sample(g_sSamp, float3(0.4, 0.5, 0.6)); + uint4 txval42 = g_tTexcdu4 . Sample(g_sSamp, float3(0.7, 0.8, 0.9)); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/remap.hlsl.sample.basic.none.frag b/deps/glslang/Test/remap.hlsl.sample.basic.none.frag new file mode 100644 index 00000000..03e83ef9 --- /dev/null +++ b/deps/glslang/Test/remap.hlsl.sample.basic.none.frag @@ -0,0 +1,90 @@ +SamplerState g_sSamp : register(s0); +uniform sampler2D g_sSamp2d +{ + AddressU = MIRROR; + AddressV = WRAP; + MinLOD = 0; + MaxLOD = 10; + MaxAnisotropy = 2; + MipLodBias = 0.2; +}, g_sSamp2D_b; + +Texture1D g_tTex1df4a : register(t1); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +struct MemberTest +{ + int Sample; // in HLSL, method names are valid struct members. + int CalculateLevelOfDetail; // ... + int CalculateLevelOfDetailUnclamped; // ... + int Gather; // ... + int GetDimensions; // ... + int GetSamplePosition; // ... + int Load; // ... + int SampleBias; // ... + int SampleCmp; // ... + int SampleCmpLevelZero; // ... + int SampleGrad; // ... + int SampleLevel; // ... +}; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + MemberTest mtest; + mtest.CalculateLevelOfDetail = 1; // in HLSL, method names are valid struct members. + mtest.CalculateLevelOfDetailUnclamped = 1; // ... + mtest.Gather = 1; // ... + mtest.GetDimensions = 1; // ... + mtest.GetSamplePosition = 1; // ... + mtest.Load = 1; // ... + mtest.Sample = 1; // ... + mtest.SampleBias = 1; // ... + mtest.SampleCmp = 1; // ... + mtest.SampleCmpLevelZero = 1; // ... + mtest.SampleGrad = 1; // ... + mtest.SampleLevel = 1; // ... + + float4 txval10 = g_tTex1df4 . Sample(g_sSamp, 0.1); + int4 txval11 = g_tTex1di4 . Sample(g_sSamp, 0.2); + uint4 txval12 = g_tTex1du4 . Sample(g_sSamp, 0.3); + + float4 txval20 = g_tTex2df4 . Sample(g_sSamp, float2(0.1, 0.2)); + int4 txval21 = g_tTex2di4 . Sample(g_sSamp, float2(0.3, 0.4)); + uint4 txval22 = g_tTex2du4 . Sample(g_sSamp, float2(0.5, 0.6)); + + float4 txval30 = g_tTex3df4 . Sample(g_sSamp, float3(0.1, 0.2, 0.3)); + int4 txval31 = g_tTex3di4 . Sample(g_sSamp, float3(0.4, 0.5, 0.6)); + uint4 txval32 = g_tTex3du4 . Sample(g_sSamp, float3(0.7, 0.8, 0.9)); + + float4 txval40 = g_tTexcdf4 . Sample(g_sSamp, float3(0.1, 0.2, 0.3)); + int4 txval41 = g_tTexcdi4 . Sample(g_sSamp, float3(0.4, 0.5, 0.6)); + uint4 txval42 = g_tTexcdu4 . Sample(g_sSamp, float3(0.7, 0.8, 0.9)); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/remap.hlsl.sample.basic.strip.frag b/deps/glslang/Test/remap.hlsl.sample.basic.strip.frag new file mode 100644 index 00000000..03e83ef9 --- /dev/null +++ b/deps/glslang/Test/remap.hlsl.sample.basic.strip.frag @@ -0,0 +1,90 @@ +SamplerState g_sSamp : register(s0); +uniform sampler2D g_sSamp2d +{ + AddressU = MIRROR; + AddressV = WRAP; + MinLOD = 0; + MaxLOD = 10; + MaxAnisotropy = 2; + MipLodBias = 0.2; +}, g_sSamp2D_b; + +Texture1D g_tTex1df4a : register(t1); + +uniform Texture1D g_tTex1df4 : register(t0); +Texture1D g_tTex1di4; +Texture1D g_tTex1du4; + +Texture2D g_tTex2df4; +Texture2D g_tTex2di4; +Texture2D g_tTex2du4; + +Texture3D g_tTex3df4; +Texture3D g_tTex3di4; +Texture3D g_tTex3du4; + +TextureCube g_tTexcdf4; +TextureCube g_tTexcdi4; +TextureCube g_tTexcdu4; + +struct MemberTest +{ + int Sample; // in HLSL, method names are valid struct members. + int CalculateLevelOfDetail; // ... + int CalculateLevelOfDetailUnclamped; // ... + int Gather; // ... + int GetDimensions; // ... + int GetSamplePosition; // ... + int Load; // ... + int SampleBias; // ... + int SampleCmp; // ... + int SampleCmpLevelZero; // ... + int SampleGrad; // ... + int SampleLevel; // ... +}; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + MemberTest mtest; + mtest.CalculateLevelOfDetail = 1; // in HLSL, method names are valid struct members. + mtest.CalculateLevelOfDetailUnclamped = 1; // ... + mtest.Gather = 1; // ... + mtest.GetDimensions = 1; // ... + mtest.GetSamplePosition = 1; // ... + mtest.Load = 1; // ... + mtest.Sample = 1; // ... + mtest.SampleBias = 1; // ... + mtest.SampleCmp = 1; // ... + mtest.SampleCmpLevelZero = 1; // ... + mtest.SampleGrad = 1; // ... + mtest.SampleLevel = 1; // ... + + float4 txval10 = g_tTex1df4 . Sample(g_sSamp, 0.1); + int4 txval11 = g_tTex1di4 . Sample(g_sSamp, 0.2); + uint4 txval12 = g_tTex1du4 . Sample(g_sSamp, 0.3); + + float4 txval20 = g_tTex2df4 . Sample(g_sSamp, float2(0.1, 0.2)); + int4 txval21 = g_tTex2di4 . Sample(g_sSamp, float2(0.3, 0.4)); + uint4 txval22 = g_tTex2du4 . Sample(g_sSamp, float2(0.5, 0.6)); + + float4 txval30 = g_tTex3df4 . Sample(g_sSamp, float3(0.1, 0.2, 0.3)); + int4 txval31 = g_tTex3di4 . Sample(g_sSamp, float3(0.4, 0.5, 0.6)); + uint4 txval32 = g_tTex3du4 . Sample(g_sSamp, float3(0.7, 0.8, 0.9)); + + float4 txval40 = g_tTexcdf4 . Sample(g_sSamp, float3(0.1, 0.2, 0.3)); + int4 txval41 = g_tTexcdi4 . Sample(g_sSamp, float3(0.4, 0.5, 0.6)); + uint4 txval42 = g_tTexcdu4 . Sample(g_sSamp, float3(0.7, 0.8, 0.9)); + + psout.Color = 1.0; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/remap.hlsl.templatetypes.everything.frag b/deps/glslang/Test/remap.hlsl.templatetypes.everything.frag new file mode 100644 index 00000000..f48c98a7 --- /dev/null +++ b/deps/glslang/Test/remap.hlsl.templatetypes.everything.frag @@ -0,0 +1,47 @@ + +float main(float4 input) : COLOR0 +{ + vector r00 = float4(1,2,3,4); // vector means float4 + float4 r01 = vector(2,3,4,5); // vector means float4 + + vector r12 = bool1(false); + vector r13 = int1(1); + vector r14 = float1(1); + vector r15 = double1(1); + vector r16 = uint1(1); + + vector r20 = bool2(false, true); + vector r21 = int2(1,2); + vector r22 = float2(1,2); + vector r23 = double2(1,2); + vector r24 = uint2(1,2); + + vector r30 = bool3(false, true, true); + vector r31 = int3(1,2,3); + vector r32 = float3(1,2,3); + vector r33 = double3(1,2,3); + vector r34 = uint3(1,2,3); + + vector r40 = bool4(false, true, true, false); + vector r41 = int4(1,2,3,4); + vector r42 = float4(1,2,3,4); + vector r43 = double4(1,2,3,4); + vector r44 = uint4(1,2,3,4); + + matrix r50 = float4x4(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); // matrix means float4x4 + float4x4 r51 = matrix(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); // matrix means float4x4 + + // matrix r60 = bool2x3(false, true, false, true, false, true); // TODO: + matrix r61 = float2x3(1,2,3,4,5,6); + matrix r62 = float3x2(1,2,3,4,5,6); + // matrix r63 = float4x1(1,2,3,4); // TODO: + // matrix r64 = float1x4(1,2,3,4); // TODO: + matrix r65 = float4x2(1,2,3,4,5,6,7,8); + matrix r66 = float4x3(1,2,3,4,5,6,7,8,9,10,11,12); + + // TODO: bool mats + // TODO: int mats + + return 0.0; +} + diff --git a/deps/glslang/Test/remap.hlsl.templatetypes.none.frag b/deps/glslang/Test/remap.hlsl.templatetypes.none.frag new file mode 100644 index 00000000..f48c98a7 --- /dev/null +++ b/deps/glslang/Test/remap.hlsl.templatetypes.none.frag @@ -0,0 +1,47 @@ + +float main(float4 input) : COLOR0 +{ + vector r00 = float4(1,2,3,4); // vector means float4 + float4 r01 = vector(2,3,4,5); // vector means float4 + + vector r12 = bool1(false); + vector r13 = int1(1); + vector r14 = float1(1); + vector r15 = double1(1); + vector r16 = uint1(1); + + vector r20 = bool2(false, true); + vector r21 = int2(1,2); + vector r22 = float2(1,2); + vector r23 = double2(1,2); + vector r24 = uint2(1,2); + + vector r30 = bool3(false, true, true); + vector r31 = int3(1,2,3); + vector r32 = float3(1,2,3); + vector r33 = double3(1,2,3); + vector r34 = uint3(1,2,3); + + vector r40 = bool4(false, true, true, false); + vector r41 = int4(1,2,3,4); + vector r42 = float4(1,2,3,4); + vector r43 = double4(1,2,3,4); + vector r44 = uint4(1,2,3,4); + + matrix r50 = float4x4(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); // matrix means float4x4 + float4x4 r51 = matrix(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); // matrix means float4x4 + + // matrix r60 = bool2x3(false, true, false, true, false, true); // TODO: + matrix r61 = float2x3(1,2,3,4,5,6); + matrix r62 = float3x2(1,2,3,4,5,6); + // matrix r63 = float4x1(1,2,3,4); // TODO: + // matrix r64 = float1x4(1,2,3,4); // TODO: + matrix r65 = float4x2(1,2,3,4,5,6,7,8); + matrix r66 = float4x3(1,2,3,4,5,6,7,8,9,10,11,12); + + // TODO: bool mats + // TODO: int mats + + return 0.0; +} + diff --git a/deps/glslang/Test/remap.if.everything.frag b/deps/glslang/Test/remap.if.everything.frag new file mode 100644 index 00000000..3fedfc43 --- /dev/null +++ b/deps/glslang/Test/remap.if.everything.frag @@ -0,0 +1,12 @@ +#version 450 + +in float inf; +out vec4 outf4; + +void main() +{ + if (inf > 2.0) + outf4 = vec4(inf); + else + outf4 = vec4(inf + -.5); +} diff --git a/deps/glslang/Test/remap.if.none.frag b/deps/glslang/Test/remap.if.none.frag new file mode 100644 index 00000000..3fedfc43 --- /dev/null +++ b/deps/glslang/Test/remap.if.none.frag @@ -0,0 +1,12 @@ +#version 450 + +in float inf; +out vec4 outf4; + +void main() +{ + if (inf > 2.0) + outf4 = vec4(inf); + else + outf4 = vec4(inf + -.5); +} diff --git a/deps/glslang/Test/remap.invalid-spirv-1.spv b/deps/glslang/Test/remap.invalid-spirv-1.spv new file mode 100644 index 00000000..e69de29b diff --git a/deps/glslang/Test/remap.invalid-spirv-2.spv b/deps/glslang/Test/remap.invalid-spirv-2.spv new file mode 100644 index 00000000..e69de29b diff --git a/deps/glslang/Test/remap.literal64.everything.spv b/deps/glslang/Test/remap.literal64.everything.spv new file mode 100644 index 00000000..e69de29b diff --git a/deps/glslang/Test/remap.literal64.none.spv b/deps/glslang/Test/remap.literal64.none.spv new file mode 100644 index 00000000..e69de29b diff --git a/deps/glslang/Test/remap.similar_1a.everything.frag b/deps/glslang/Test/remap.similar_1a.everything.frag new file mode 100644 index 00000000..6eddbc51 --- /dev/null +++ b/deps/glslang/Test/remap.similar_1a.everything.frag @@ -0,0 +1,29 @@ +#version 450 + +in float inf; +in flat ivec4 ini4; +out vec4 outf4; + +float Test1(int bound) +{ + float r = 0; + for (int x=0; x 2) + return Test1(bound); + else + return float(bound * 2 + + ini4.y * ini4.z + + ini4.x); +} + +void main() +{ + outf4 = vec4(Test1(int(inf)) + + Test2(int(inf))); +} diff --git a/deps/glslang/Test/remap.similar_1a.none.frag b/deps/glslang/Test/remap.similar_1a.none.frag new file mode 100644 index 00000000..6eddbc51 --- /dev/null +++ b/deps/glslang/Test/remap.similar_1a.none.frag @@ -0,0 +1,29 @@ +#version 450 + +in float inf; +in flat ivec4 ini4; +out vec4 outf4; + +float Test1(int bound) +{ + float r = 0; + for (int x=0; x 2) + return Test1(bound); + else + return float(bound * 2 + + ini4.y * ini4.z + + ini4.x); +} + +void main() +{ + outf4 = vec4(Test1(int(inf)) + + Test2(int(inf))); +} diff --git a/deps/glslang/Test/remap.similar_1b.everything.frag b/deps/glslang/Test/remap.similar_1b.everything.frag new file mode 100644 index 00000000..46009451 --- /dev/null +++ b/deps/glslang/Test/remap.similar_1b.everything.frag @@ -0,0 +1,30 @@ +#version 450 + +out vec4 outf4; +in flat ivec4 ini4; +in float inf; + +float Test1(int bound) +{ + float r = 0; + for (int x=0; x 2) { + return Test1(bound * 2); + } else + return float(bound * 4 + + ini4.y * ini4.z + + ini4.x); +} + +void main() +{ + outf4 = vec4(Test1(int(inf)) + + Test2(int(inf))); +} diff --git a/deps/glslang/Test/remap.similar_1b.none.frag b/deps/glslang/Test/remap.similar_1b.none.frag new file mode 100644 index 00000000..46009451 --- /dev/null +++ b/deps/glslang/Test/remap.similar_1b.none.frag @@ -0,0 +1,30 @@ +#version 450 + +out vec4 outf4; +in flat ivec4 ini4; +in float inf; + +float Test1(int bound) +{ + float r = 0; + for (int x=0; x 2) { + return Test1(bound * 2); + } else + return float(bound * 4 + + ini4.y * ini4.z + + ini4.x); +} + +void main() +{ + outf4 = vec4(Test1(int(inf)) + + Test2(int(inf))); +} diff --git a/deps/glslang/Test/remap.specconst.comp b/deps/glslang/Test/remap.specconst.comp new file mode 100644 index 00000000..52ac07aa --- /dev/null +++ b/deps/glslang/Test/remap.specconst.comp @@ -0,0 +1,7 @@ +#version 450 + +layout (local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in; + +shared int foo[gl_WorkGroupSize.x + gl_WorkGroupSize.y * gl_WorkGroupSize.z]; + +void main () {} diff --git a/deps/glslang/Test/remap.switch.everything.frag b/deps/glslang/Test/remap.switch.everything.frag new file mode 100644 index 00000000..140c0792 --- /dev/null +++ b/deps/glslang/Test/remap.switch.everything.frag @@ -0,0 +1,16 @@ +#version 450 + +precision highp float; + +layout(location = 0) out mediump vec4 FragColor; +layout(location = 0) in vec4 in0; + +void main() +{ + switch(int(in0.w)) { + case 0: FragColor = vec4(in0.x + 0); break; + case 1: FragColor = vec4(in0.y + 1); break; + case 2: FragColor = vec4(in0.z + 2); break; + default: FragColor = vec4(-1); + } +} diff --git a/deps/glslang/Test/remap.switch.none.frag b/deps/glslang/Test/remap.switch.none.frag new file mode 100644 index 00000000..140c0792 --- /dev/null +++ b/deps/glslang/Test/remap.switch.none.frag @@ -0,0 +1,16 @@ +#version 450 + +precision highp float; + +layout(location = 0) out mediump vec4 FragColor; +layout(location = 0) in vec4 in0; + +void main() +{ + switch(int(in0.w)) { + case 0: FragColor = vec4(in0.x + 0); break; + case 1: FragColor = vec4(in0.y + 1); break; + case 2: FragColor = vec4(in0.z + 2); break; + default: FragColor = vec4(-1); + } +} diff --git a/deps/glslang/Test/remap.uniformarray.everything.frag b/deps/glslang/Test/remap.uniformarray.everything.frag new file mode 100644 index 00000000..4f642e6e --- /dev/null +++ b/deps/glslang/Test/remap.uniformarray.everything.frag @@ -0,0 +1,17 @@ +#version 140 + +uniform sampler2D texSampler2D; +in vec3 inColor; +in vec4 color[6]; +in float alpha[16]; + +void main() +{ + vec4 texColor = color[1] + color[1]; + + texColor.xyz += inColor; + + texColor.a += alpha[12]; + + gl_FragColor = texColor; +} diff --git a/deps/glslang/Test/remap.uniformarray.none.frag b/deps/glslang/Test/remap.uniformarray.none.frag new file mode 100644 index 00000000..4f642e6e --- /dev/null +++ b/deps/glslang/Test/remap.uniformarray.none.frag @@ -0,0 +1,17 @@ +#version 140 + +uniform sampler2D texSampler2D; +in vec3 inColor; +in vec4 color[6]; +in float alpha[16]; + +void main() +{ + vec4 texColor = color[1] + color[1]; + + texColor.xyz += inColor; + + texColor.a += alpha[12]; + + gl_FragColor = texColor; +} diff --git a/deps/glslang/Test/runtests b/deps/glslang/Test/runtests new file mode 100644 index 00000000..8cc8b7a8 --- /dev/null +++ b/deps/glslang/Test/runtests @@ -0,0 +1,240 @@ +#!/usr/bin/env bash + +TARGETDIR=localResults +BASEDIR=baseResults +EXE=../build/install/bin/glslangValidator +REMAPEXE=../build/install/bin/spirv-remap +HASERROR=0 +mkdir -p localResults + +if [ -a localtestlist ] + then + while read t; do + echo Running $t... + b=`basename $t` + $EXE -i -l $t > $TARGETDIR/$b.out + diff -b $BASEDIR/$b.out $TARGETDIR/$b.out || HASERROR=1 + done < localtestlist +fi + +rm -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv + +# +# special tests +# + +$EXE badMacroArgs.frag > $TARGETDIR/badMacroArgs.frag.out +diff -b $BASEDIR/badMacroArgs.frag.out $TARGETDIR/badMacroArgs.frag.out || HASERROR=1 + +# +# reflection tests +# +echo Running reflection... +$EXE -l -q -C reflection.vert > $TARGETDIR/reflection.vert.out +diff -b $BASEDIR/reflection.vert.out $TARGETDIR/reflection.vert.out || HASERROR=1 +$EXE -D -Od -e flizv -l -q -C -V -Od hlsl.reflection.vert > $TARGETDIR/hlsl.reflection.vert.out +diff -b $BASEDIR/hlsl.reflection.vert.out $TARGETDIR/hlsl.reflection.vert.out || HASERROR=1 +$EXE -D -Od -e main -l -q -C -V -Od hlsl.reflection.binding.frag > $TARGETDIR/hlsl.reflection.binding.frag.out +diff -b $BASEDIR/hlsl.reflection.binding.frag.out $TARGETDIR/hlsl.reflection.binding.frag.out || HASERROR=1 +$EXE -D -Od -e main -l -q --hlsl-iomap --auto-map-bindings --stb 10 --sbb 20 --ssb 30 --suavb 40 --scb 50 -D -V -e main -Od hlsl.automap.frag > $TARGETDIR/hlsl.automap.frag.out +diff -b $BASEDIR/hlsl.automap.frag.out $TARGETDIR/hlsl.automap.frag.out || HASERROR=1 + +# +# multi-threaded test +# +echo Comparing single thread to multithread for all tests in current directory... +$EXE -i -C *.vert *.geom *.frag *.tes* *.comp > singleThread.out +$EXE -i -C *.vert *.geom *.frag *.tes* *.comp -t > multiThread.out +diff singleThread.out multiThread.out || HASERROR=1 +if [ $HASERROR -eq 0 ] +then + rm singleThread.out + rm multiThread.out +fi + +# +# entry point renaming tests +# +echo Running entry-point renaming tests +$EXE -i -H -V -D -Od --entry-point main_in_spv --ku --source-entrypoint main -Od hlsl.entry.rename.frag > $TARGETDIR/hlsl.entry.rename.frag.out +diff -b $BASEDIR/hlsl.entry.rename.frag.out $TARGETDIR/hlsl.entry.rename.frag.out || HASERROR=1 + +# +# Testing ill-defined uncalled function +# +echo Running ill-defined uncalled function +$EXE -D -Od -e main -H -Od hlsl.deadFunctionMissingBody.vert > $TARGETDIR/hlsl.deadFunctionMissingBody.vert.out +diff -b $BASEDIR/hlsl.deadFunctionMissingBody.vert.out $TARGETDIR/hlsl.deadFunctionMissingBody.vert.out || HASERROR=1 + +if [ $HASERROR -eq 0 ] +then + echo Tests Succeeded. +else + echo Tests Failed. +fi + +# +# Testing -S and compound suffixes +# +echo Running explicit stage test and compound suffix tests +$EXE -Od -i -S vert nosuffix > $TARGETDIR/nosuffix.out +diff -b $BASEDIR/nosuffix.out $TARGETDIR/nosuffix.out || HASERROR=1 +$EXE -Od -i compoundsuffix.vert.glsl > $TARGETDIR/compoundsuffix.vert.glsl +diff -b $BASEDIR/compoundsuffix.vert.glsl $TARGETDIR/compoundsuffix.vert.glsl || HASERROR=1 +$EXE -Od -e main -H compoundsuffix.frag.hlsl > $TARGETDIR/compoundsuffix.frag.hlsl +diff -b $BASEDIR/compoundsuffix.frag.hlsl $TARGETDIR/compoundsuffix.frag.hlsl || HASERROR=1 + +# +# Testing --hlsl-offsets +# +echo Running hlsl offsets +$EXE -i --hlsl-offsets -H spv.hlslOffsets.vert > $TARGETDIR/spv.hlslOffsets.vert.out +diff -b $BASEDIR/spv.hlslOffsets.vert.out $TARGETDIR/spv.hlslOffsets.vert.out || HASERROR=1 + +echo Running hlsl offsets +$EXE -i --hlsl-offsets -D -Od -e main -H -Od hlsl.hlslOffset.vert > $TARGETDIR/hlsl.hlslOffset.vert.out +diff -b $BASEDIR/hlsl.hlslOffset.vert.out $TARGETDIR/hlsl.hlslOffset.vert.out || HASERROR=1 + +# +# Testing --resource-set-binding +# +echo Configuring HLSL descriptor set and binding number manually +$EXE -V -D -Od -e main -H -Od hlsl.multiDescriptorSet.frag --rsb frag t0 0 0 t1 1 0 s0 0 1 s1 1 1 b0 2 0 b1 2 1 b2 2 2 > $TARGETDIR/hlsl.multiDescriptorSet.frag.out +diff -b $BASEDIR/hlsl.multiDescriptorSet.frag.out $TARGETDIR/hlsl.multiDescriptorSet.frag.out || HASERROR=1 + +$EXE -V -D -Od -e main -H -Od hlsl.explicitDescriptorSet.frag --hlsl-iomap --amb --ssb 10 --stb 20 --rsb 4 > $TARGETDIR/hlsl.explicitDescriptorSet.frag.out +diff -b $BASEDIR/hlsl.explicitDescriptorSet.frag.out $TARGETDIR/hlsl.explicitDescriptorSet.frag.out || HASERROR=1 + +$EXE -V -D -Od -e main -H -Od hlsl.explicitDescriptorSet.frag --hlsl-iomap --amb --ssb 10 --stb 20 --rsb frag 3 > $TARGETDIR/hlsl.explicitDescriptorSet-2.frag.out +diff -b $BASEDIR/hlsl.explicitDescriptorSet-2.frag.out $TARGETDIR/hlsl.explicitDescriptorSet-2.frag.out || HASERROR=1 + +# +# Testing per-descriptor-set IO map shift +# +echo 'Testing per-descriptor-set IO map shift' +$EXE -e main --hlsl-iomap --ssb 10 1 15 2 --stb 20 --stb 25 2 --stb 70 6 --suavb 30 --suavb 40 2 --sub 50 6 -i -q -D -Od -V hlsl.shift.per-set.frag > $TARGETDIR/hlsl.shift.per-set.frag.out || HASERROR=1 +diff -b $BASEDIR/hlsl.shift.per-set.frag.out $TARGETDIR/hlsl.shift.per-set.frag.out || HASERROR=1 + +# +# Testing location error +# +echo Testing SPV no location +$EXE -V -C spv.noLocation.vert > $TARGETDIR/spv.noLocation.vert.out +diff -b $BASEDIR/spv.noLocation.vert.out $TARGETDIR/spv.noLocation.vert.out || HASERROR=1 +$EXE -G -H --aml spv.noBuiltInLoc.vert > $TARGETDIR/spv.noBuiltInLoc.vert.out +diff -b $BASEDIR/spv.noBuiltInLoc.vert.out $TARGETDIR/spv.noBuiltInLoc.vert.out || HASERROR=1 +$EXE -G spv.looseUniformNoLoc.vert > $TARGETDIR/spv.looseUniformNoLoc.vert.out +diff -b $BASEDIR/spv.looseUniformNoLoc.vert.out $TARGETDIR/spv.looseUniformNoLoc.vert.out || HASERROR=1 + +# +# Testing debug information +# +echo Testing SPV Debug Information +$EXE -g --relaxed-errors --suppress-warnings --aml --amb --hlsl-offsets --nsf --spirv-val \ + -G -H spv.debugInfo.frag --rsb frag 3 > $TARGETDIR/spv.debugInfo.frag.out +diff -b $BASEDIR/spv.debugInfo.frag.out $TARGETDIR/spv.debugInfo.frag.out || HASERROR=1 +$EXE -g -Od --target-env vulkan1.1 --relaxed-errors --suppress-warnings --aml --hlsl-offsets --nsf --spirv-val \ + -G -H spv.debugInfo.frag --rsb frag 3 > $TARGETDIR/spv.debugInfo.1.1.frag.out +diff -b $BASEDIR/spv.debugInfo.1.1.frag.out $TARGETDIR/spv.debugInfo.1.1.frag.out || HASERROR=1 +$EXE -g -D -Od -e newMain -g --amb --aml --fua --hlsl-iomap --nsf --spirv-val --sib 1 --ssb 2 --sbb 3 --stb 4 --suavb 5 --sub 6 \ + --sep origMain -H -Od spv.hlslDebugInfo.vert --rsb vert t0 0 0 > $TARGETDIR/spv.hlslDebugInfo.frag.out +diff -b $BASEDIR/spv.hlslDebugInfo.frag.out $TARGETDIR/spv.hlslDebugInfo.frag.out || HASERROR=1 + +# +# Testing Includer +# +echo Testing Includer +$EXE -D -Od -e main -H -Od ../Test/hlsl.include.vert > $TARGETDIR/hlsl.include.vert.out +diff -b $BASEDIR/hlsl.include.vert.out $TARGETDIR/hlsl.include.vert.out || HASERROR=1 +$EXE -D -Od -e main -H -Od hlsl.includeNegative.vert > $TARGETDIR/hlsl.includeNegative.vert.out +diff -b $BASEDIR/hlsl.includeNegative.vert.out $TARGETDIR/hlsl.includeNegative.vert.out || HASERROR=1 +$EXE -l -i include.vert > $TARGETDIR/include.vert.out +diff -b $BASEDIR/include.vert.out $TARGETDIR/include.vert.out || HASERROR=1 +$EXE -D -Od -e main -H -Od -Iinc1/path1 -Iinc1/path2 hlsl.dashI.vert > $TARGETDIR/hlsl.dashI.vert.out +diff -b $BASEDIR/hlsl.dashI.vert.out $TARGETDIR/hlsl.dashI.vert.out || HASERROR=1 + +# +# Testing -D and -U +# +echo "Testing -D and -U" +$EXE -DUNDEFED -UIN_SHADER -DFOO=200 -i -l -UUNDEFED -DMUL=FOO*2 glsl.-D-U.frag > $TARGETDIR/glsl.-D-U.frag.out +diff -b $BASEDIR/glsl.-D-U.frag.out $TARGETDIR/glsl.-D-U.frag.out || HASERROR=1 +$EXE -D -Od -e main -V -i -DUNDEFED -UIN_SHADER -DFOO=200 -UUNDEFED -Od hlsl.-D-U.frag > $TARGETDIR/hlsl.-D-U.frag.out +diff -b $BASEDIR/hlsl.-D-U.frag.out $TARGETDIR/hlsl.-D-U.frag.out || HASERROR=1 + +# +# Test --client and --target-env +# +echo "Testing --client and --target-env" +$EXE --client vulkan100 spv.targetVulkan.vert || HASERROR=1 +$EXE --client opengl100 spv.targetOpenGL.vert || HASERROR=1 +$EXE --target-env vulkan1.0 spv.targetVulkan.vert || HASERROR=1 +$EXE --target-env vulkan1.1 spv.targetVulkan.vert || HASERROR=1 +$EXE --target-env opengl spv.targetOpenGL.vert || HASERROR=1 +$EXE -V100 spv.targetVulkan.vert || HASERROR=1 +$EXE -G100 spv.targetOpenGL.vert || HASERROR=1 +$EXE --target-env spirv1.2 -V spv.targetVulkan.vert || HASERROR=1 + +# +# Testing GLSL entry point rename +# +echo "Testing GLSL entry point rename" +$EXE -H -e foo --source-entrypoint main glsl.entryPointRename.vert > $TARGETDIR/glsl.entryPointRename.vert.out +diff -b $BASEDIR/glsl.entryPointRename.vert.out $TARGETDIR/glsl.entryPointRename.vert.out || HASERROR=1 +$EXE -H -e foo --source-entrypoint bar glsl.entryPointRename.vert > $TARGETDIR/glsl.entryPointRename.vert.bad.out +diff -b $BASEDIR/glsl.entryPointRename.vert.bad.out $TARGETDIR/glsl.entryPointRename.vert.bad.out || HASERROR=1 +$EXE -H -e foo --source-entrypoint main glsl.entryPointRename2.vert > $TARGETDIR/glsl.entryPointRename2.vert.out +diff -b $BASEDIR/glsl.entryPointRename2.vert.out $TARGETDIR/glsl.entryPointRename2.vert.out || HASERROR=1 + +# +# Testing remapper error handling +# +echo "Testing remapper error handling" +$REMAPEXE --do-everything -i remap.invalid-spirv-1.spv -o $TARGETDIR > $TARGETDIR/remap.invalid-spirv-1.out && HASERROR=1 +diff -b $BASEDIR/remap.invalid-spirv-1.out $TARGETDIR/remap.invalid-spirv-1.out || HASERROR=1 +$REMAPEXE --do-everything -i remap.invalid-spirv-2.spv -o $TARGETDIR > $TARGETDIR/remap.invalid-spirv-2.out && HASERROR=1 +diff -b $BASEDIR/remap.invalid-spirv-2.out $TARGETDIR/remap.invalid-spirv-2.out || HASERROR=1 + +# +# Testing position Y inversion +# +echo "Testing position Y inversion" +$EXE -H -e main -V -D -Od -H -i --iy hlsl.y-negate-1.vert > $TARGETDIR/hlsl.y-negate-1.vert.out +diff -b $BASEDIR/hlsl.y-negate-1.vert.out $TARGETDIR/hlsl.y-negate-1.vert.out || HASERROR=1 +$EXE -H -e main -V -D -Od -H -i --invert-y hlsl.y-negate-2.vert > $TARGETDIR/hlsl.y-negate-2.vert.out +diff -b $BASEDIR/hlsl.y-negate-2.vert.out $TARGETDIR/hlsl.y-negate-2.vert.out || HASERROR=1 +$EXE -H -e main -V -D -Od -H -i --invert-y hlsl.y-negate-3.vert > $TARGETDIR/hlsl.y-negate-3.vert.out +diff -b $BASEDIR/hlsl.y-negate-3.vert.out $TARGETDIR/hlsl.y-negate-3.vert.out || HASERROR=1 + +# +# Testing hlsl_functionality1 +# +echo "Testing hlsl_functionality1" +$EXE -H -e main -D -Od -fhlsl_functionality1 hlsl.structbuffer.incdec.frag > \ + $TARGETDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out +diff -b $BASEDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out $TARGETDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out || HASERROR=1 +$EXE -H -e main -D -Od -fhlsl_functionality1 hlsl.noSemantic.functionality1.comp > \ + $TARGETDIR/hlsl.noSemantic.functionality1.comp.out +diff -b $BASEDIR/hlsl.noSemantic.functionality1.comp.out $TARGETDIR/hlsl.noSemantic.functionality1.comp.out || HASERROR=1 + +# +# Testing HLSL-specific PP feature expansion +# +echo "Testing HLSL-specific PP feature expansion" +$EXE -D -E hlsl.pp.expand.frag > $TARGETDIR/hlsl.pp.expand.frag.out 2> $TARGETDIR/hlsl.pp.expand.frag.err +diff -b $BASEDIR/hlsl.pp.expand.frag.out $TARGETDIR/hlsl.pp.expand.frag.out || HASERROR=1 +diff -b $BASEDIR/hlsl.pp.expand.frag.err $TARGETDIR/hlsl.pp.expand.frag.err || HASERROR=1 + +# +# Final checking +# +if [ $HASERROR -eq 0 ] +then + echo Tests Succeeded. +else + echo Tests Failed. +fi + +rm -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv + +exit $HASERROR diff --git a/deps/glslang/Test/runtimeArray.vert b/deps/glslang/Test/runtimeArray.vert new file mode 100644 index 00000000..a5da4f41 --- /dev/null +++ b/deps/glslang/Test/runtimeArray.vert @@ -0,0 +1,110 @@ +#version 450 core + +buffer bn { + int a[]; + float b[]; +} buf; + +uniform un { + int a[]; + float b[]; +} ubuf; + +buffer bna { + int a[]; + float b[]; +} bufa[4]; + +uniform una { + int a[]; + float b[]; +} ubufa[4]; + +buffer abn { + int aba[]; + float abb[]; +}; + +uniform aun { + int aua[]; + float aub[]; +}; + +layout(binding=1) uniform samplerBuffer uniformTexelBufferDyn[]; +layout(binding=2, r32f) uniform imageBuffer storageTexelBufferDyn[]; +layout(binding=3) uniform uname { float a; } uniformBuffer[]; +layout(binding=4) buffer bname { float b; } storageBuffer[]; +layout(binding=5) uniform sampler2D sampledImage[]; +layout(binding=6, r32f) uniform image2D storageImage[]; +layout(binding=8) uniform samplerBuffer uniformTexelBuffer[]; +layout(binding=9, r32f) uniform imageBuffer storageTexelBuffer[]; + +int i; + +void main() +{ + ubuf.a[3]; + ubuf.b[3]; + buf.a[3]; + buf.b[3]; + + ubufa[3].a[3]; + ubufa[3].b[3]; + bufa[3].a[3]; + bufa[3].b[3]; + + aua[3]; + aub[3]; + aba[3]; + abb[3]; + + ubuf.a[i]; // ERROR + ubuf.b[i]; // ERROR + buf.a[i]; // ERROR + buf.b[i]; + + ubuf.a.length(); // ERROR + ubuf.b.length(); // ERROR + buf.a.length(); // ERROR + buf.b.length(); + + ubufa[1].a[i]; // ERROR + ubufa[1].b[i]; // ERROR + bufa[1].a[i]; // ERROR + bufa[1].b[i]; + + ubufa[1].a.length(); // ERROR + ubufa[1].b.length(); // ERROR + bufa[1].a.length(); // ERROR + bufa[1].b.length(); + + aua[i]; // ERROR + aub[i]; // ERROR + aba[i]; // ERROR + abb[i]; + + aua.length(); // ERROR + aub.length(); // ERROR + aba.length(); // ERROR + abb.length(); + + uniformTexelBufferDyn[1]; + storageTexelBufferDyn[1]; + uniformBuffer[1]; + storageBuffer[1]; + sampledImage[1]; + storageImage[1]; + uniformTexelBuffer[1]; + storageTexelBuffer[1]; + + uniformTexelBufferDyn[i]; // ERROR, need extension + storageTexelBufferDyn[i]; // ERROR, need extension + uniformBuffer[i]; // ERROR, need extension + storageBuffer[i]; // ERROR, need extension + sampledImage[i]; // ERROR, need extension + storageImage[i]; // ERROR, need extension + uniformTexelBuffer[i]; // ERROR, need extension + storageTexelBuffer[i]; // ERROR, need extension + + float local[] = ubuf.b; // ERROR, can initialize with runtime-sized array +} diff --git a/deps/glslang/Test/sample.frag b/deps/glslang/Test/sample.frag new file mode 100644 index 00000000..d9b9f5cc --- /dev/null +++ b/deps/glslang/Test/sample.frag @@ -0,0 +1,41 @@ +// +//Copyright (C) 2002-2004 3Dlabs Inc. Ltd. +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. +// +#version 110 + +varying vec3 color; + +void main() +{ + gl_FragColor = vec4(color, 1.0); +} diff --git a/deps/glslang/Test/sample.frag.out b/deps/glslang/Test/sample.frag.out new file mode 100644 index 00000000..8885dbac --- /dev/null +++ b/deps/glslang/Test/sample.frag.out @@ -0,0 +1,15 @@ +#### BEGIN COMPILER 0 INFO LOG #### +0:? Sequence +0:37 Function Definition: main( (void) +0:37 Function Parameters: +0:39 Sequence +0:39 move second child to first child (4-component vector of float) +0:39 'gl_FragColor' (FragColor 4-component vector of float) +0:39 Construct vec4 (4-component vector of float) +0:39 'color' (varying in 3-component vector of float) +0:39 1.000000 (const float) + +#### END COMPILER 0 INFO LOG #### +#### BEGIN LINKER INFO LOG #### + +#### END LINKER INFO LOG #### diff --git a/deps/glslang/Test/sample.vert b/deps/glslang/Test/sample.vert new file mode 100644 index 00000000..8cda91f9 --- /dev/null +++ b/deps/glslang/Test/sample.vert @@ -0,0 +1,43 @@ +// +//Copyright (C) 2002-2004 3Dlabs Inc. Ltd. +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. +// +#version 110 + +varying vec3 color; + +void main() +{ + color = vec3(1.0, 1.0, 1.0); + + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} diff --git a/deps/glslang/Test/sample.vert.out b/deps/glslang/Test/sample.vert.out new file mode 100644 index 00000000..aef6bb14 --- /dev/null +++ b/deps/glslang/Test/sample.vert.out @@ -0,0 +1,20 @@ +#### BEGIN COMPILER 0 INFO LOG #### +0:? Sequence +0:37 Function Definition: main( (void) +0:37 Function Parameters: +0:39 Sequence +0:39 move second child to first child (3-component vector of float) +0:39 'color' (varying out 3-component vector of float) +0:39 1.000000 (const float) +0:39 1.000000 (const float) +0:39 1.000000 (const float) +0:41 move second child to first child (4-component vector of float) +0:41 'gl_Position' (Position 4-component vector of float) +0:41 matrix-times-vector (4-component vector of float) +0:41 'gl_ModelViewProjectionMatrix' (uniform 4X4 matrix of float) +0:41 'gl_Vertex' (attribute 4-component vector of float) + +#### END COMPILER 0 INFO LOG #### +#### BEGIN LINKER INFO LOG #### + +#### END LINKER INFO LOG #### diff --git a/deps/glslang/Test/samplerlessTextureFunctions.frag b/deps/glslang/Test/samplerlessTextureFunctions.frag new file mode 100644 index 00000000..09268503 --- /dev/null +++ b/deps/glslang/Test/samplerlessTextureFunctions.frag @@ -0,0 +1,46 @@ +#version 450 core + +layout(binding = 1) uniform texture2D tex2D; +layout(binding = 1) uniform texture2DMS texMS; +layout(binding = 0) uniform textureBuffer buf; + +void testBad() +{ + vec4 tex2DFetch = texelFetch(tex2D, ivec2(0, 0), 0); + vec4 texMSFetch = texelFetch(texMS, ivec2(0, 0), 0); + + // Allowed by KHR_vulkan_glsl without the extension. All others should + // error. + vec4 bufFetch = texelFetch(buf, 0); + + vec4 tex2DFetchOffset = texelFetchOffset(tex2D, ivec2(0, 0), 0, ivec2(0, 0)); + + ivec2 tex2DSize = textureSize(tex2D, 0); + ivec2 texMSSize = textureSize(texMS); + int bufSize = textureSize(buf); + + int tex2DLevels = textureQueryLevels(tex2D); + + int texMSSamples = textureSamples(texMS); +} + +#extension GL_EXT_samplerless_texture_functions : enable + +void main() +{ + // These should all succeed. + + vec4 tex2DFetch = texelFetch(tex2D, ivec2(0, 0), 0); + vec4 texMSFetch = texelFetch(texMS, ivec2(0, 0), 0); + vec4 bufFetch = texelFetch(buf, 0); + + vec4 tex2DFetchOffset = texelFetchOffset(tex2D, ivec2(0, 0), 0, ivec2(0, 0)); + + ivec2 tex2DSize = textureSize(tex2D, 0); + ivec2 texMSSize = textureSize(texMS); + int bufSize = textureSize(buf); + + int tex2DLevels = textureQueryLevels(tex2D); + + int texMSSamples = textureSamples(texMS); +} diff --git a/deps/glslang/Test/simpleFunctionCall.frag b/deps/glslang/Test/simpleFunctionCall.frag new file mode 100644 index 00000000..59f0ccd5 --- /dev/null +++ b/deps/glslang/Test/simpleFunctionCall.frag @@ -0,0 +1,15 @@ +#version 150 + +uniform vec4 bigColor; +varying vec4 BaseColor; +uniform float d; + +vec4 foo() +{ + return BaseColor; +} + +void main() +{ + gl_FragColor = foo(); +} diff --git a/deps/glslang/Test/specExamples.frag b/deps/glslang/Test/specExamples.frag new file mode 100644 index 00000000..7eec45e9 --- /dev/null +++ b/deps/glslang/Test/specExamples.frag @@ -0,0 +1,237 @@ +#version 430 + +#extension GL_3DL_array_objects : enable + +int a = 0xffffffff; // 32 bits, a gets the value -1 +int b = 0xffffffffU; // ERROR: can't convert uint to int +uint c = 0xffffffff; // 32 bits, c gets the value 0xFFFFFFFF +uint d = 0xffffffffU; // 32 bits, d gets the value 0xFFFFFFFF +int e = -1; // the literal is "1", then negation is performed, + // and the resulting non-literal 32-bit signed + // bit pattern of 0xFFFFFFFF is assigned, giving e + // the value of -1. +uint f = -1u; // the literal is "1u", then negation is performed, + // and the resulting non-literal 32-bit unsigned + // bit pattern of 0xFFFFFFFF is assigned, giving f + // the value of 0xFFFFFFFF. +int g = 3000000000; // a signed decimal literal taking 32 bits, + // setting the sign bit, g gets -1294967296 +int h = 0xA0000000; // okay, 32-bit signed hexadecimal +int i = 5000000000; // ERROR: needs more than 32 bits +int j = 0xFFFFFFFFF; // ERROR: needs more that 32 bits +int k = 0x80000000; // k gets -2147483648 == 0x80000000 +int l = 2147483648; // l gets -2147483648 (the literal set the sign bit) + +float fa, fb = 1.5; // single-precision floating-point +double fc, fd = 2.0LF; // double-precision floating-point + +vec2 texcoord1, texcoord2; +vec3 position; +vec4 myRGBA; +ivec2 textureLookup; +bvec3 less; + +mat2 mat2D; +mat3 optMatrix; +mat4 view, projection; +mat4x4 view; // an alternate way of declaring a mat4 +mat3x2 m; // a matrix with 3 columns and 2 rows +dmat4 highPrecisionMVP; +dmat2x4 dm; + +struct light { + float intensity; + vec3 position; +} lightVar; + +struct S { float f; }; + +struct T { + //S; // Error: anonymous structures disallowed + //struct { ... }; // Error: embedded structures disallowed + S s; // Okay: nested structures with name are allowed +}; + +float frequencies[3]; +uniform vec4 lightPosition[4]; +light lights[]; +const int numLights = 2; +light lights[numLights]; + +in vec3 normal; +centroid in vec2 TexCoord; +invariant centroid in vec4 Color; +noperspective in float temperature; +flat in vec3 myColor; +noperspective centroid in vec2 myTexCoord; + +uniform vec4 lightPosition; +uniform vec3 color = vec3(0.7, 0.7, 0.2); // value assigned at link time + +in Material { + smooth in vec4 Color1; // legal, input inside in block + smooth vec4 Color2; // legal, 'in' inherited from 'in Material' + vec2 TexCoordA; // legal, TexCoord is an input + uniform float Atten; // illegal, mismatched storage qualifier + +}; + +in Light { + vec4 LightPos; + vec3 LightColor; +}; +in ColoredTexture { + vec4 Color; + vec2 TexCoord; +} Materiala; // instance name +vec3 Color; // different Color than Material.Color + +in vec4 gl_FragCoord; // redeclaration that changes nothing is allowed + +// All the following are allowed redeclaration that change behavior +layout(origin_upper_left) in vec4 gl_FragCoord; +layout(pixel_center_integer) in vec4 gl_FragCoord; +layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; + +layout(early_fragment_tests) in; + +// compute shader: +layout (local_size_x = 32, local_size_y = 32) in; +layout (local_size_x = 8) in; + +layout(location = 3) out vec4 color; +layout(location = 3, index = 1) out vec4 factor; +layout(location = 2) out vec4 colors[3]; + +layout (depth_greater) out float gl_FragDepth; + +// redeclaration that changes nothing is allowed +out float gl_FragDepth; + +// assume it may be modified in any way +layout (depth_any) out float gl_FragDepth; + +// assume it may be modified such that its value will only increase +layout (depth_greater) out float gl_FragDepth; + +// assume it may be modified such that its value will only decrease +layout (depth_less) out float gl_FragDepth; + +// assume it will not be modified +layout (depth_unchanged) out float gl_FragDepth; + +in vec4 gl_Color; // predeclared by the fragment language +flat in vec4 gl_Color; // redeclared by user to be flat + + +float[5] foo(float[5]) +{ + return float[5](3.4, 4.2, 5.0, 5.2, 1.1); +} + +precision highp float; +precision highp int; +precision mediump int; +precision highp float; + +void main() +{ + { + float a[5] = float[5](3.4, 4.2, 5.0, 5.2, 1.1); + } + { + float a[5] = float[](3.4, 4.2, 5.0, 5.2, 1.1); // same thing + } + { + vec4 a[3][2]; // size-3 array of size-2 array of vec4 + vec4[2] a1[3]; // size-3 array of size-2 array of vec4 + vec4[3][2] a2; // size-3 array of size-2 array of vec4 + vec4 b[2] = vec4[2](vec4(0.0), vec4(0.1)); + vec4[3][2] a3 = vec4[3][2](b, b, b); // constructor + void foo(vec4[3][2]); // prototype with unnamed parameter + vec4 a4[3][2] = {vec4[2](vec4(0.0), vec4(1.0)), + vec4[2](vec4(0.0), vec4(1.0)), + vec4[2](vec4(0.0), vec4(1.0)) }; + } + { + float a[5]; + { + float b[] = a; // b is explicitly size 5 + } + { + float b[5] = a; // means the same thing + } + { + float b[] = float[](1,2,3,4,5); // also explicitly sizes to 5 + } + a.length(); // returns 5 + } + { + vec4 a[3][2]; + a.length(); // this is 3 + a[x].length(); // this is 2 + } + // for an array b containing a member array a: + b[++x].a.length(); // b is never dereferenced, but “++x” is evaluated + + // for an array s of a shader storage object containing a member array a: + s[x].a.length(); // s is dereferenced; x needs to be a valid index + // + //All of the following declarations result in a compile-time error. + //float a[2] = { 3.4, 4.2, 5.0 }; // illegal + //vec2 b = { 1.0, 2.0, 3.0 }; // illegal + //mat3x3 c = { vec3(0.0), vec3(1.0), vec3(2.0), vec3(3.0) }; // illegal + //mat2x2 d = { 1.0, 0.0, 0.0, 1.0 }; // illegal, can't flatten nesting + //struct { + // float a; + // int b; + //} e = { 1.2, 2, 3 }; // illegal + + struct { + float a; + int b; + } e = { 1.2, 2 }; // legal, all types match + + struct { + float a; + int b; + } e = { 1, 3 }; // legal, first initializer is converted + + //All of the following declarations result in a compile-time error. + //int a = true; // illegal + //vec4 b[2] = { vec4(0.0), 1.0 }; // illegal + //mat4x2 c = { vec3(0.0), vec3(1.0) }; // illegal + + //struct S1 { + // vec4 a; + // vec4 b; + //}; + + //struct { + // float s; + // float t; + //} d[] = { S1(vec4(0.0), vec4(1.1)) }; // illegal + + { + float a[] = float[](3.4, 4.2, 5.0, 5.2, 1.1); + float b[] = { 3.4, 4.2, 5.0, 5.2, 1.1 }; + float c[] = a; // c is explicitly size 5 + float d[5] = b; // means the same thing + } + { + const vec3 zAxis = vec3 (0.0, 0.0, 1.0); + const float ceiling = a + b; // a and b not necessarily constants + } + { + in vec4 position; + in vec3 normal; + in vec2 texCoord[4]; + } + { + lowp float color; + out mediump vec2 P; + lowp ivec2 foo(lowp mat3); + highp mat4 m; + } + +} diff --git a/deps/glslang/Test/specExamples.vert b/deps/glslang/Test/specExamples.vert new file mode 100644 index 00000000..9df1561f --- /dev/null +++ b/deps/glslang/Test/specExamples.vert @@ -0,0 +1,196 @@ +#version 430 + +#extension GL_3DL_array_objects : enable + +out Vertex { + vec4 Position; // API transform/feedback will use “Vertex.Position” + vec2 Texture; +} Coords; // shader will use “Coords.Position” + +out Vertex2 { + vec4 Color; // API will use “Color” +}; + +uniform Transform { // API uses “Transform[2]” to refer to instance 2 + mat4 ModelViewMatrix; + mat4 ModelViewProjectionMatrix; + vec4 a[]; // array will get implicitly sized + float Deformation; +} transforms[4]; + +layout(location = 3) in vec4 normal; +layout(location = 6) in vec4 colors[3]; +layout(location = 9) in mat4 transforms2[2]; + +layout(location = 3) struct S { + vec3 a1; + mat2 b; + vec4 c[2]; +} s; + +layout(triangles, invocations = 6) in; + +layout(lines) in; // legal for Color2, input size is 2, matching Color2 + +layout(triangle_strip, max_vertices = 60) out; // order does not matter +layout(max_vertices = 60) out; // redeclaration okay +layout(triangle_strip) out; // redeclaration okay +//layout(points) out; // error, contradicts triangle_strip +//layout(max_vertices = 30) out; // error, contradicts 60 + +layout(stream = 1) out; + +layout(stream=1) out; // default is now stream 1 +out vec4 var1; // var1 gets default stream (1) +layout(stream=2) out Block1 { // "Block1" belongs to stream 2 + layout(stream=2) vec4 var2; // redundant block member stream decl + layout(stream=3) vec2 var3; // ILLEGAL (must match block stream) + vec3 var4; // belongs to stream 2 +}; +layout(stream=0) out; // default is now stream 0 +out vec4 var5; // var5 gets default stream (0) +out Block2 { // "Block2" gets default stream (0) + vec4 var6; +}; +layout(stream=3) out vec4 var7; // var7 belongs to stream 3 + +layout(shared, column_major) uniform; +layout(shared, column_major) buffer; + +layout(row_major, column_major) + +layout(shared, row_major) uniform; // default is now shared and row_major + +layout(std140) uniform Transform2 { // layout of this block is std140 + mat4 M1; // row_major + layout(column_major) mat4 M2; // column major + mat3 N1; // row_major +}; + +layout(column_major) uniform T3 { // shared and column_major + mat4 M13; // column_major + layout(row_major) mat4 m14; // row major + mat3 N12; // column_major +}; + +// in one compilation unit... +layout(binding=3) uniform sampler2D s17; // s bound to unit 3 + +// in another compilation unit... +uniform sampler2D s17; // okay, s still bound at 3 + +// in another compilation unit... +//layout(binding=4) uniform sampler2D s; // ERROR: contradictory bindings + +layout (binding = 2, offset = 4) uniform atomic_uint a2; + +layout (binding = 2) uniform atomic_uint bar; + +layout (binding = 2, offset = 4) uniform atomic_uint; + +layout (binding = 2) uniform atomic_uint bar; // offset is 4 +layout (offset = 8) uniform atomic_uint bar23; // error, no default binding + +layout (binding=3, offset=4) uniform atomic_uint a2; // offset = 4 +layout (binding=2) uniform atomic_uint b2; // offset = 0 +layout (binding=3) uniform atomic_uint c2; // offset = 8 +layout (binding=2) uniform atomic_uint d2; // offset = 4 + +//layout (offset=4) // error, must include binding +//layout (binding=1, offset=0) a; // okay +//layout (binding=2, offset=0) b; // okay +//layout (binding=1, offset=0) c; // error, offsets must not be shared +// // between a and c +//layout (binding=1, offset=2) d; // error, overlaps offset 0 of a + +flat in vec4 gl_FrontColor; // input to geometry shader, no “gl_in[]” +flat out vec4 gl_FrontColor; // output from geometry shader + +invariant gl_Position; // make existing gl_Position be invariant + +out vec3 ColorInv; +invariant ColorIvn; // make existing Color be invariant + +invariant centroid out vec3 Color4; +precise out vec4 position; + +out vec3 Color5; +precise Color5; // make existing Color be precise +in vec4 a, b, c, d; +precise out vec4 v; + +coherent buffer Block { + readonly vec4 member1; + vec4 member2; +}; + +buffer Block2a { + coherent readonly vec4 member1A; + coherent vec4 member2A; +}; + +shared vec4 shv; + +vec4 funcA(restrict image2D a) { } + +vec4 funcB(image2D a) { } +layout(rgba32f) uniform image2D img1; +layout(rgba32f) coherent uniform image2D img2; + +float func(float e, float f, float g, float h) +{ + return (e*f) + (g*h); // no constraint on order or + // operator consistency +} + +float func2(float e, float f, float g, float h) +{ + precise float result = (e*f) + (g*h); // ensures same precision for + // the two multiplies + return result; +} + +float func3(float i, float j, precise out float k) +{ + k = i * i + j; // precise, due to declaration +} + +void main() +{ + vec3 r = vec3(a * b); // precise, used to compute v.xyz + vec3 s = vec3(c * d); // precise, used to compute v.xyz + v.xyz = r + s; // precise + v.w = (a.w * b.w) + (c.w * d.w); // precise + v.x = func(a.x, b.x, c.x, d.x); // values computed in func() + // are NOT precise + v.x = func2(a.x, b.x, c.x, d.x); // precise! + func3(a.x * b.x, c.x * d.x, v.x); // precise! + + funcA(img1); // OK, adding "restrict" is allowed + funcB(img2); // illegal, stripping "coherent" is not + + { + struct light { + float intensity; + vec3 position; + }; + + light lightVar = light(3.0, vec3(1.0, 2.0, 3.0)); + } + { + const float c[3] = float[3](5.0, 7.2, 1.1); + const float d[3] = float[](5.0, 7.2, 1.1); + + float g; + float a[5] = float[5](g, 1, g, 2.3, g); + float b[3]; + + b = float[3](g, g + 1.0, g + 2.0); + } + { + vec4 b[2] = { vec4(1.0), vec4(1.0) }; + vec4[3][2](b, b, b); // constructor + vec4[][2](b, b, b); // constructor, valid, size deduced + vec4[3][](b, b, b); // compile-time error, invalid type constructed + } +} diff --git a/deps/glslang/Test/spv.1.3.8bitstorage-ssbo.vert b/deps/glslang/Test/spv.1.3.8bitstorage-ssbo.vert new file mode 100644 index 00000000..61ba7bf1 --- /dev/null +++ b/deps/glslang/Test/spv.1.3.8bitstorage-ssbo.vert @@ -0,0 +1,15 @@ +#version 450 + +#extension GL_EXT_shader_8bit_storage: require + +layout(binding = 0) readonly buffer Vertices +{ + uint8_t vertices[]; +}; + +layout(location = 0) out vec4 color; + +void main() +{ + color = vec4(int(vertices[gl_VertexIndex])); +} diff --git a/deps/glslang/Test/spv.1.3.8bitstorage-ubo.vert b/deps/glslang/Test/spv.1.3.8bitstorage-ubo.vert new file mode 100644 index 00000000..5c49a243 --- /dev/null +++ b/deps/glslang/Test/spv.1.3.8bitstorage-ubo.vert @@ -0,0 +1,15 @@ +#version 450 + +#extension GL_EXT_shader_8bit_storage: require + +layout(binding = 0) readonly uniform Vertices +{ + uint8_t vertices[512]; +}; + +layout(location = 0) out vec4 color; + +void main() +{ + color = vec4(int(vertices[gl_VertexIndex])); +} diff --git a/deps/glslang/Test/spv.100ops.frag b/deps/glslang/Test/spv.100ops.frag new file mode 100644 index 00000000..43452a1f --- /dev/null +++ b/deps/glslang/Test/spv.100ops.frag @@ -0,0 +1,27 @@ +#version 310 es + +lowp float foo(); + +in lowp float low, high; + +lowp float face1 = 11.0; + +out lowp vec4 Color; + +void main() +{ + int z = 3; + + if (2.0 * low + 1.0 < high) + ++z; + + Color = face1 * vec4(z) + foo(); +} + +lowp float face2 = -2.0; + +lowp float foo() +{ + // testing if face2 initializer insert logic is correct in main + return face2; +} diff --git a/deps/glslang/Test/spv.130.frag b/deps/glslang/Test/spv.130.frag new file mode 100644 index 00000000..e7fdd388 --- /dev/null +++ b/deps/glslang/Test/spv.130.frag @@ -0,0 +1,93 @@ +#version 140 +#extension GL_ARB_texture_gather : enable + +vec3 a; +float b; + +in vec4 i; +out vec4 o; +out ivec3 io; +out uvec4 uo; + +flat in float fflat; +smooth in float fsmooth; +noperspective in float fnop; + +uniform samplerCube sampC; + +#extension GL_ARB_texture_rectangle : enable + +uniform sampler2D samp2D; +uniform sampler2DShadow samp2DS; +uniform sampler2DRect samp2DR; +uniform sampler2DArray samp2DA; + +void bar3() +{ + o += textureGatherOffset(samp2D, vec2(0.3), ivec2(1)); + o += textureGatherOffset(samp2DA, vec3(0.3), ivec2(1)); +} + +#extension GL_ARB_gpu_shader5 : enable + +void bar4() +{ + o += textureGatherOffset(samp2DR, vec2(0.3), ivec2(1)); + o += textureGatherOffset(samp2DS, vec2(0.3), 1.3, ivec2(1)); + o += textureGatherOffset(samp2D, vec2(0.3), ivec2(1), 2); +} + +#extension GL_ARB_texture_cube_map_array : enable + +uniform samplerCubeArray Sca; +uniform isamplerCubeArray Isca; +uniform usamplerCubeArray Usca; +uniform samplerCubeArrayShadow Scas; + +void bar5() +{ + io = textureSize(Sca, 3); + o += texture(Sca, i); + io += texture(Isca, i, 0.7).xyz; + uo = texture(Usca, i); + + o += textureLod(Sca, i, 1.7); + a = textureSize(Scas, 3); + float f = texture(Scas, i, i.y); + ivec4 c = textureGrad(Isca, i, vec3(0.1), vec3(0.2)); + o += vec4(a, f + c); +} + +#extension GL_ARB_shading_language_420pack : enable + +const int ai[3] = { 10, 23, 32 }; +uniform layout(binding=0) sampler2D bounds; + +void bar6() +{ + mat4x3 m43; + float a1 = m43[3].y; + //int a2 = m43.length(); // ERROR until shading_language_420pack is fully implemented + const float b = 2 * a1; + //a.x = gl_MinProgramTexelOffset + gl_MaxProgramTexelOffset; // ERROR until shading_language_420pack is fully implemented +} + + +#extension GL_ARB_texture_rectangle : enable +#extension GL_ARB_shader_texture_lod : require + +uniform sampler2D s2D; +uniform sampler2DRect s2DR; +uniform sampler2DRectShadow s2DRS; +uniform sampler1D s1D; +uniform sampler2DShadow s2DS; + +void main() +{ + o = textureGather(sampC, vec3(0.2)); + o.y = gl_ClipDistance[3]; + bar3(); + bar4(); + bar5(); + bar6(); +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.140.frag b/deps/glslang/Test/spv.140.frag new file mode 100644 index 00000000..ceeac47b --- /dev/null +++ b/deps/glslang/Test/spv.140.frag @@ -0,0 +1,46 @@ +#version 140 + +in vec4 k; +out vec4 o; + +in float gl_ClipDistance[5]; + +layout(row_major) uniform; + +uniform sampler2D samp2Da[3]; + +layout(std140) uniform bn { + layout(row_major) mat4 matra[4]; + layout(column_major) mat4 matca[4]; + layout(row_major) mat4 matr; + layout(column_major) mat4 matc; + layout(align=512, offset=1024) mat4 matrdef; +}; + +uniform sampler2DRect sampR; +uniform isamplerBuffer sampB; + +float foo(); + +void main() +{ + o.y = gl_ClipDistance[2]; + o.z = gl_ClipDistance[int(k)]; + o.w = float(textureSize(sampR) + textureSize(sampB)) / 100.0; + o.z = foo(); +} + +// Test extra-function initializers + +float i1 = gl_FrontFacing ? -2.0 : 2.0; +float i2 = 102; + +float foo() +{ + return i1 + i2; +} + +// test arrayed block +layout(std140) uniform bi { + vec3 v[2]; +} bname[4]; diff --git a/deps/glslang/Test/spv.150.geom b/deps/glslang/Test/spv.150.geom new file mode 100644 index 00000000..0419265d --- /dev/null +++ b/deps/glslang/Test/spv.150.geom @@ -0,0 +1,39 @@ +#version 150 core + +layout(triangles_adjacency) in; +layout(max_vertices = 30) out; +layout(stream = 3, triangle_strip) out; + +in fromVertex { + in vec3 color; +} fromV[]; + +out toFragment { + out vec3 color; +} toF; + +out fromVertex { + vec3 color; +}; + +void main() +{ + color = fromV[0].color; + //?? gl_ClipDistance[3] = gl_in[1].gl_ClipDistance[2]; + gl_Position = gl_in[0].gl_Position; + gl_PointSize = gl_in[3].gl_PointSize; + gl_PrimitiveID = gl_PrimitiveIDIn; + gl_Layer = 2; + + EmitVertex(); + + color = 2 * fromV[0].color; + gl_Position = 2.0 * gl_in[0].gl_Position; + gl_PointSize = 2.0 * gl_in[3].gl_PointSize; + gl_PrimitiveID = gl_PrimitiveIDIn + 1; + gl_Layer = 3; + + EmitVertex(); + + EndPrimitive(); +} diff --git a/deps/glslang/Test/spv.150.vert b/deps/glslang/Test/spv.150.vert new file mode 100644 index 00000000..382e3c9b --- /dev/null +++ b/deps/glslang/Test/spv.150.vert @@ -0,0 +1,38 @@ +#version 150 core + +in vec4 iv4; + +in float ps; +in int ui; +uniform sampler2D s2D; + +invariant gl_Position; + +struct s1 { + int a; + int a2; + vec4 b[3]; +}; + +struct s2 { + int c; + s1 d[4]; +}; + +out s2 s2out; + +void main() +{ + gl_Position = iv4; + gl_PointSize = ps; + gl_ClipDistance[2] = iv4.x; + int i; + s2out.d[i].b[2].w = ps; + + // test non-implicit lod + texture(s2D, vec2(0.5)); + textureProj(s2D, vec3(0.5)); + textureLod(s2D, vec2(0.5), 3.2); +} + +out float gl_ClipDistance[4]; diff --git a/deps/glslang/Test/spv.16bitstorage-int.frag b/deps/glslang/Test/spv.16bitstorage-int.frag new file mode 100644 index 00000000..57be67ee --- /dev/null +++ b/deps/glslang/Test/spv.16bitstorage-int.frag @@ -0,0 +1,90 @@ +#version 450 core + +#extension GL_EXT_shader_16bit_storage : enable + +struct S +{ + int16_t x; + i16vec2 y; + i16vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + int16_t a; + i16vec2 b; + i16vec3 c; + int16_t d[2]; + S g; + S h[2]; + int j; +} b1; + +layout(row_major, std430) buffer B2 +{ + int16_t o; + i16vec2 p; + i16vec3 q; + int16_t r[2]; + S u; + S v[2]; + i16vec2 x[100]; + int16_t w[]; +} b2; + +layout(row_major, std140) uniform B5 +{ + int16_t o; + i16vec2 p; + i16vec3 q; + int16_t r[2]; + S u; + S v[2]; + i16vec2 x[100]; + int16_t w[100]; +} b5; + +struct S2 { + mat4x4 x; + int16_t y; + int z; +}; + +struct S3 { + S2 x; +}; + +layout(row_major, std430) buffer B3 +{ + S2 x; +} b3; + +layout(column_major, std430) buffer B4 +{ + S2 x; + S3 y; +} b4; + +void main() +{ + b2.o = b1.a; + b2.p = i16vec2(ivec3(b2.q).xy); + b2.p = i16vec2(ivec3(b5.q).xy); + b2.r[0] = b2.r[0]; + b2.r[1] = b5.r[1]; + b2.p = b2.p; + int x0 = int(b1.a); + ivec4 x1 = ivec4(b1.a, b2.p, 1); + b4.x.x = b3.x.x; + b2.o = int16_t(ivec2(b2.p).x); + b2.p = b2.v[1].y; + ivec3 v3 = ivec3(b2.w[b1.j], b2.w[b1.j+1], b2.w[b1.j+2]); + ivec3 u3 = ivec3(b5.w[b1.j], b5.w[b1.j+1], b5.w[b1.j+2]); + b2.x[0] = b2.x[0]; + b2.x[1] = b5.x[1]; + b2.p.x = b1.a; + b2.o = b2.p.x; + b2.p = i16vec2(ivec2(1, 2)); + b2.o = int16_t(3); +} + diff --git a/deps/glslang/Test/spv.16bitstorage-uint.frag b/deps/glslang/Test/spv.16bitstorage-uint.frag new file mode 100644 index 00000000..aeecd041 --- /dev/null +++ b/deps/glslang/Test/spv.16bitstorage-uint.frag @@ -0,0 +1,90 @@ +#version 450 core + +#extension GL_EXT_shader_16bit_storage : enable + +struct S +{ + uint16_t x; + u16vec2 y; + u16vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + uint16_t a; + u16vec2 b; + u16vec3 c; + uint16_t d[2]; + S g; + S h[2]; + uint j; +} b1; + +layout(row_major, std430) buffer B2 +{ + uint16_t o; + u16vec2 p; + u16vec3 q; + uint16_t r[2]; + S u; + S v[2]; + u16vec2 x[100]; + uint16_t w[]; +} b2; + +layout(row_major, std140) uniform B5 +{ + uint16_t o; + u16vec2 p; + u16vec3 q; + uint16_t r[2]; + S u; + S v[2]; + u16vec2 x[100]; + uint16_t w[100]; +} b5; + +struct S2 { + mat4x4 x; + uint16_t y; + uint z; +}; + +struct S3 { + S2 x; +}; + +layout(row_major, std430) buffer B3 +{ + S2 x; +} b3; + +layout(column_major, std430) buffer B4 +{ + S2 x; + S3 y; +} b4; + +void main() +{ + b2.o = b1.a; + b2.p = u16vec2(uvec3(b2.q).xy); + b2.p = u16vec2(uvec3(b5.q).xy); + b2.r[0] = b2.r[0]; + b2.r[1] = b5.r[1]; + b2.p = b2.p; + uint x0 = uint(b1.a); + uvec4 x1 = uvec4(b1.a, b2.p, 1); + b4.x.x = b3.x.x; + b2.o = uint16_t(uvec2(b2.p).x); + b2.p = b2.v[1].y; + uvec3 v3 = uvec3(b2.w[b1.j], b2.w[b1.j+1], b2.w[b1.j+2]); + uvec3 u3 = uvec3(b5.w[b1.j], b5.w[b1.j+1], b5.w[b1.j+2]); + b2.x[0] = b2.x[0]; + b2.x[1] = b5.x[1]; + b2.p.x = b1.a; + b2.o = b2.p.x; + b2.p = u16vec2(uvec2(1, 2)); + b2.o = uint16_t(3u); +} + diff --git a/deps/glslang/Test/spv.16bitstorage.frag b/deps/glslang/Test/spv.16bitstorage.frag new file mode 100644 index 00000000..b821be1e --- /dev/null +++ b/deps/glslang/Test/spv.16bitstorage.frag @@ -0,0 +1,90 @@ +#version 450 core + +#extension GL_EXT_shader_16bit_storage : enable + +struct S +{ + float16_t x; + f16vec2 y; + f16vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + float16_t a; + f16vec2 b; + f16vec3 c; + float16_t d[2]; + S g; + S h[2]; + int j; +} b1; + +layout(row_major, std430) buffer B2 +{ + float16_t o; + f16vec2 p; + f16vec3 q; + float16_t r[2]; + S u; + S v[2]; + f16vec2 x[100]; + float16_t w[]; +} b2; + +layout(row_major, std140) uniform B5 +{ + float16_t o; + f16vec2 p; + f16vec3 q; + float16_t r[2]; + S u; + S v[2]; + f16vec2 x[100]; + float16_t w[100]; +} b5; + +struct S2 { + mat4x4 x; + float16_t y; + float z; +}; + +struct S3 { + S2 x; +}; + +layout(row_major, std430) buffer B3 +{ + S2 x; +} b3; + +layout(column_major, std430) buffer B4 +{ + S2 x; + S3 y; +} b4; + +void main() +{ + b2.o = b1.a; + b2.p = f16vec2(vec3(b2.q).xy); + b2.p = f16vec2(vec3(b5.q).xy); + b2.r[0] = b2.r[0]; + b2.r[1] = b5.r[1]; + b2.p = b2.p; + float x0 = float(b1.a); + vec4 x1 = vec4(b1.a, b2.p, 1.0); + b4.x.x = b3.x.x; + b2.o = float16_t(vec2(b2.p).x); + b2.p = b2.v[1].y; + vec3 v3 = vec3(b2.w[b1.j], b2.w[b1.j+1], b2.w[b1.j+2]); + vec3 u3 = vec3(b5.w[b1.j], b5.w[b1.j+1], b5.w[b1.j+2]); + b2.x[0] = b2.x[0]; + b2.x[1] = b5.x[1]; + b2.p.x = b1.a; + b2.o = b2.p.x; + b2.p = f16vec2(vec2(1.0, 2.0)); + b2.o = float16_t(3.0); +} + diff --git a/deps/glslang/Test/spv.16bitstorage_Error-int.frag b/deps/glslang/Test/spv.16bitstorage_Error-int.frag new file mode 100644 index 00000000..1897b026 --- /dev/null +++ b/deps/glslang/Test/spv.16bitstorage_Error-int.frag @@ -0,0 +1,101 @@ +#version 450 core + +#extension GL_EXT_shader_16bit_storage : enable + +struct S +{ + int16_t x; + i16vec2 y; + i16vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + int16_t a; + i16vec2 b; + i16vec3 c; + int16_t d[2]; + S g; + S h[2]; + int j; +} b1; + +layout(row_major, std430) buffer B2 +{ + int16_t o; + i16vec2 p; + i16vec3 q; + int16_t r[2]; + S u; + S v[2]; + int16_t w[]; +} b2; + +struct S2 { + mat4x4 x; + int16_t y; + int z; +}; + +struct S3 { + S2 x; +}; + +layout(row_major, std430) buffer B3 +{ + S2 x; +} b3; + +layout(column_major, std430) buffer B4 +{ + S2 x; +} b4; + +void func3(S2 x) { +} + +S2 func4() { + return b4.x; +} + +int func(int16_t a) { + return 0; +} + +struct S4 { + int x; + int16_t y; +}; + +int func2(int a) { return 0; } + +void main() +{ + b2.o = b2.q[1]; + b2.p = b2.q.xy; + b2.o = max(b1.a, b1.a); + bvec2 bv = lessThan(b2.p, b2.p); + b2.o = b1.a + b1.a; + b2.o = -b1.a; + b2.o = b1.a + 1; + b2.p = b2.p.yx; + b4.x = b3.x; + int16_t f0; + S2 f1; + S3 f2; + if (b1.a == b1.a) {} + b2.r = b2.r; + b2.p = i16vec2(3, 4); + i16vec2[2](i16vec2(ivec2(1,2)), i16vec2(ivec2(3,4))); + // NOT ERRORING YET + b3.x; + S4(0, int16_t(0)); + func2(b1.a); +} + + +layout(column_major, std140) uniform B6 +{ + i16mat2x3 e; +} b6; + diff --git a/deps/glslang/Test/spv.16bitstorage_Error-uint.frag b/deps/glslang/Test/spv.16bitstorage_Error-uint.frag new file mode 100644 index 00000000..5f32a3b7 --- /dev/null +++ b/deps/glslang/Test/spv.16bitstorage_Error-uint.frag @@ -0,0 +1,101 @@ +#version 450 core + +#extension GL_EXT_shader_16bit_storage : enable + +struct S +{ + uint16_t x; + u16vec2 y; + u16vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + uint16_t a; + u16vec2 b; + u16vec3 c; + uint16_t d[2]; + S g; + S h[2]; + uint j; +} b1; + +layout(row_major, std430) buffer B2 +{ + uint16_t o; + u16vec2 p; + u16vec3 q; + uint16_t r[2]; + S u; + S v[2]; + uint16_t w[]; +} b2; + +struct S2 { + mat4x4 x; + uint16_t y; + uint z; +}; + +struct S3 { + S2 x; +}; + +layout(row_major, std430) buffer B3 +{ + S2 x; +} b3; + +layout(column_major, std430) buffer B4 +{ + S2 x; +} b4; + +void func3(S2 x) { +} + +S2 func4() { + return b4.x; +} + +uint func(uint16_t a) { + return 0; +} + +struct S4 { + uint x; + uint16_t y; +}; + +uint func2(uint a) { return 0; } + +void main() +{ + b2.o = b2.q[1]; + b2.p = b2.q.xy; + b2.o = max(b1.a, b1.a); + bvec2 bv = lessThan(b2.p, b2.p); + b2.o = b1.a + b1.a; + b2.o = -b1.a; + b2.o = b1.a + 1; + b2.p = b2.p.yx; + b4.x = b3.x; + uint16_t f0; + S2 f1; + S3 f2; + if (b1.a == b1.a) {} + b2.r = b2.r; + b2.p = u16vec2(3, 4); + u16vec2[2](u16vec2(uvec2(1,2)), u16vec2(uvec2(3,4))); + // NOT ERRORING YET + b3.x; + S4(0u, uint16_t(0u)); + func2(b1.a); +} + + +layout(column_major, std140) uniform B6 +{ + u16mat2x3 e; +} b6; + diff --git a/deps/glslang/Test/spv.16bitstorage_Error.frag b/deps/glslang/Test/spv.16bitstorage_Error.frag new file mode 100644 index 00000000..7a61a97f --- /dev/null +++ b/deps/glslang/Test/spv.16bitstorage_Error.frag @@ -0,0 +1,102 @@ +#version 450 core + +#extension GL_EXT_shader_16bit_storage : enable + +struct S +{ + float16_t x; + f16vec2 y; + f16vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + float16_t a; + f16vec2 b; + f16vec3 c; + float16_t d[2]; + S g; + S h[2]; + int j; +} b1; + +layout(row_major, std430) buffer B2 +{ + float16_t o; + f16vec2 p; + f16vec3 q; + float16_t r[2]; + S u; + S v[2]; + float16_t w[]; +} b2; + +struct S2 { + mat4x4 x; + float16_t y; + float z; +}; + +struct S3 { + S2 x; +}; + +layout(row_major, std430) buffer B3 +{ + S2 x; +} b3; + +layout(column_major, std430) buffer B4 +{ + S2 x; +} b4; + +void func3(S2 x) { +} + +S2 func4() { + return b4.x; +} + +float func(float16_t a) { + return 0.0; +} + +struct S4 { + float x; + float16_t y; +}; + +float func2(float a) { return 0.0; } + +void main() +{ + b2.o = b2.q[1]; + b2.p = b2.q.xy; + b2.o = max(b1.a, b1.a); + bvec2 bv = lessThan(b2.p, b2.p); + b2.o = b1.a + b1.a; + b2.o = -b1.a; + b2.o = b1.a + 1.0; + b2.p = b2.p.yx; + b4.x = b3.x; + float16_t f0; + S2 f1; + S3 f2; + if (b1.a == b1.a) {} + b2.r = b2.r; + b2.o = 1.0HF; + b2.p = f16vec2(3.0, 4.0); + f16vec2[2](f16vec2(vec2(1.0,2.0)), f16vec2(vec2(3.0,4.0))); + // NOT ERRORING YET + b3.x; + S4(0.0, float16_t(0.0)); + func2(b1.a); +} + + +layout(column_major, std140) uniform B6 +{ + f16mat2x3 e; +} b6; + diff --git a/deps/glslang/Test/spv.300BuiltIns.vert b/deps/glslang/Test/spv.300BuiltIns.vert new file mode 100644 index 00000000..46c3f0fe --- /dev/null +++ b/deps/glslang/Test/spv.300BuiltIns.vert @@ -0,0 +1,14 @@ +#version 310 es + +in mediump float ps; + +invariant gl_Position; + +void main() +{ + gl_Position = vec4(ps); + gl_Position *= float(4 - gl_VertexIndex); + + gl_PointSize = ps; + gl_PointSize *= float(5 - gl_InstanceIndex); +} diff --git a/deps/glslang/Test/spv.300layout.frag b/deps/glslang/Test/spv.300layout.frag new file mode 100644 index 00000000..5b4c56c2 --- /dev/null +++ b/deps/glslang/Test/spv.300layout.frag @@ -0,0 +1,22 @@ +#version 310 es + +precision mediump float; + +in vec4 pos; +in vec3 color; + +layout(location = 7) out vec3 c; +layout(LocatioN = 3) out vec4 p[2]; + +struct S { + vec3 c; + float f; +}; + +in S s; + +void main() +{ + c = color + s.c; + p[1] = pos * s.f; +} diff --git a/deps/glslang/Test/spv.300layout.vert b/deps/glslang/Test/spv.300layout.vert new file mode 100644 index 00000000..a32a95de --- /dev/null +++ b/deps/glslang/Test/spv.300layout.vert @@ -0,0 +1,49 @@ +#version 310 es + +layout(location = 7) in vec3 c; +layout(LocatioN = 3) in vec4 p; +layout(location = 9) in ivec2 aiv2; +out vec4 pos; +out vec3 color; +flat out int iout; + +layout(row_major) uniform; // default is now row_major + +layout(std140) uniform Transform { // layout of this block is std140 + mat4 M1; // row_major + layout(column_major) mat4 M2; // column major + mat3 N1; // row_major + int iuin; +} tblock; + +uniform T2 { // layout of this block is shared + bool b; + mat4 t2m; +}; + +layout(column_major) uniform T3 { // shared and column_major + mat4 M3; // column_major + layout(row_major) mat4 M4; // row major + mat2x3 N2; // column_major + layout(align=16, offset=2048) uvec3 uv3a[4]; +}; + +in uint uiuin; + +struct S { + vec3 c; + float f; +}; + +out S s; + +void main() +{ + pos = p * (tblock.M1 + tblock.M2 + M4 + M3 + t2m); + color = c * tblock.N1; + iout = tblock.iuin + int(uiuin) + aiv2.y; + s.c = c; + s.f = p.x; + if (N2[1] != vec3(1.0) || uv3a[2] != uvec3(5)) + ++s.c; +} diff --git a/deps/glslang/Test/spv.300layoutp.vert b/deps/glslang/Test/spv.300layoutp.vert new file mode 100644 index 00000000..d14aa1cd --- /dev/null +++ b/deps/glslang/Test/spv.300layoutp.vert @@ -0,0 +1,49 @@ +#version 310 es + +layout(location = 7) in vec3 c; +layout(LocatioN = 3) in vec4 p; +layout(location = 9) in ivec2 aiv2; +out vec4 pos; +out vec3 color; +flat out int iout; + +layout(row_major) uniform; // default is now row_major + +layout(std140) uniform Transform { // layout of this block is std140 + mat4 M1; // row_major + layout(column_major) mat4 M2; // column major + mat3 N1; // row_major + int iuin; +} tblock; + +uniform T2 { // layout of this block is shared + bool b; + mat4 t2m; +}; + +layout(column_major) uniform T3 { // shared and column_major + mat4 M3; // column_major + layout(row_major) mat4 M4; // row major + mat2x3 N2; // column_major + uvec3 uv3a[4]; +}; + +uint uiuin; + +struct S { + vec3 c; + float f; +}; + +out S s; + +void main() +{ + pos = p * (tblock.M1 * tblock.M2 * M4 * M3 * t2m); + color = c * tblock.N1; + iout = tblock.iuin + int(uiuin) + aiv2.y; + s.c = c; + s.f = p.x; + if (N2[1] != vec3(1.0) || uv3a[2] != uvec3(5)) + ++s.c; +} diff --git a/deps/glslang/Test/spv.310.bitcast.frag b/deps/glslang/Test/spv.310.bitcast.frag new file mode 100644 index 00000000..dbde52f8 --- /dev/null +++ b/deps/glslang/Test/spv.310.bitcast.frag @@ -0,0 +1,41 @@ +#version 310 es + +flat in mediump int i1; +flat in lowp ivec2 i2; +flat in mediump ivec3 i3; +flat in highp ivec4 i4; + +flat in mediump uint u1; +flat in lowp uvec2 u2; +flat in mediump uvec3 u3; +flat in highp uvec4 u4; + +mediump in float f1; +lowp in vec2 f2; +mediump in vec3 f3; +highp in vec4 f4; + +void main() +{ + highp ivec4 idata = ivec4(0); + idata.x += floatBitsToInt(f1); + idata.xy += floatBitsToInt(f2); + idata.xyz += floatBitsToInt(f3); + idata += floatBitsToInt(f4); + + highp uvec4 udata = uvec4(0); + udata.x += floatBitsToUint(f1); + udata.xy += floatBitsToUint(f2); + udata.xyz += floatBitsToUint(f3); + udata += floatBitsToUint(f4); + + highp vec4 fdata = vec4(0.0); + fdata.x += intBitsToFloat(i1); + fdata.xy += intBitsToFloat(i2); + fdata.xyz += intBitsToFloat(i3); + fdata += intBitsToFloat(i4); + fdata.x += uintBitsToFloat(u1); + fdata.xy += uintBitsToFloat(u2); + fdata.xyz += uintBitsToFloat(u3); + fdata += uintBitsToFloat(u4); +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.310.comp b/deps/glslang/Test/spv.310.comp new file mode 100644 index 00000000..53117dd9 --- /dev/null +++ b/deps/glslang/Test/spv.310.comp @@ -0,0 +1,42 @@ +#version 310 es + +precision highp float; + +layout (local_size_x = 16, local_size_y = 32, local_size_z = 4) in; + +shared float s; +shared int i; + +buffer outb { + float f; + float g; + float h; + vec3 uns[]; +} outbname; + +buffer outbna { + int k; + vec4 na; +} outbnamena; + +buffer outs { + int s; + vec4 va[]; +} outnames; + +#extension GL_EXT_device_group : enable + +void main() +{ + barrier(); + outbname.f = s; + outbnamena.na = vec4(s); + s = outbname.uns[18].x; + outbname.uns[17] = vec3(3.0); + outbname.uns[i] = vec3(s); + outnames.va[gl_LocalInvocationID.x] = vec4(s); + outnames.s = outbname.uns.length(); + gl_DeviceIndex; + memoryBarrierShared(); + groupMemoryBarrier(); +} diff --git a/deps/glslang/Test/spv.320.meshShaderUserDefined.mesh b/deps/glslang/Test/spv.320.meshShaderUserDefined.mesh new file mode 100644 index 00000000..60a14529 --- /dev/null +++ b/deps/glslang/Test/spv.320.meshShaderUserDefined.mesh @@ -0,0 +1,59 @@ +#version 320 es + +#define MAX_VER 81 +#define MAX_PRIM 32 + +#define BARRIER() \ + memoryBarrierShared(); \ + barrier(); + +#extension GL_NV_mesh_shader : enable + +layout(local_size_x = 32) in; + +layout(max_vertices=MAX_VER) out; +layout(max_primitives=MAX_PRIM) out; +layout(triangles) out; + +// test use of user defined interface out blocks: + +// per-primitive block +perprimitiveNV layout(location=0) out myblock { + float f; + float fArr[4]; + vec3 pos; + vec4 posArr[4]; + mat4 m; + mat3 mArr[2]; +} blk[]; + +// per-vertex block +layout(location=20) out myblock2 { + float f; + vec4 pos; + mat4 m; +} blk2[]; + +void main() +{ + int iid = int(gl_LocalInvocationID.x); + int gid = int(gl_WorkGroupID.x); + + blk[iid].f = 11.0; + blk[iid+1].fArr[gid] = blk[iid].f; + blk[iid/2].pos.yzx = vec3(14.0, 15.0, 13.0); + blk[iid*2].posArr[1].yzw = blk[iid/2].pos; + blk[iid/4].m[2].wzyx = vec4(13.0, 14.0, 15.0, 16.0); + blk[iid].mArr[0][1][1] = blk[iid/4].m[2].w; + blk[iid*4].mArr[1][gid] = vec3(17.0, 18.0, 19.0); + + BARRIER(); + + blk2[iid].f = blk2[iid-1].f + 20.0; + blk2[iid].pos = vec4(21.0, 22.0, 23.0, 24.0); + blk2[iid+1].m[gid] = blk2[iid].pos; + blk2[iid+1].m[gid][2] = 29.0; + blk2[iid+2].m[3] = blk2[iid+1].m[gid]; + + BARRIER(); +} diff --git a/deps/glslang/Test/spv.330.geom b/deps/glslang/Test/spv.330.geom new file mode 100644 index 00000000..ebd4ac66 --- /dev/null +++ b/deps/glslang/Test/spv.330.geom @@ -0,0 +1,26 @@ +#version 330 core +#extension GL_ARB_separate_shader_objects : enable + +in gl_PerVertex +{ + float gl_ClipDistance[1]; + vec4 gl_Position; +} gl_in[]; + +out gl_PerVertex +{ + vec4 gl_Position; + float gl_ClipDistance[1]; +}; + +layout( triangles ) in; +layout( triangle_strip, max_vertices = 3 ) out; + +void main() +{ + vec4 v; + gl_Position = gl_in[1].gl_Position; + gl_ClipDistance[0] = gl_in[1].gl_ClipDistance[0]; + EmitVertex(); + EndPrimitive(); +} diff --git a/deps/glslang/Test/spv.400.frag b/deps/glslang/Test/spv.400.frag new file mode 100644 index 00000000..d64c4700 --- /dev/null +++ b/deps/glslang/Test/spv.400.frag @@ -0,0 +1,265 @@ +#version 400 core + +in vec2 c2D; +flat in int i; +flat in uint u; +out uint uo; +out vec4 outp; +out ivec4 ioutp; +out uvec4 uoutp; +uniform sampler2D arrayedSampler[5]; +uniform usampler2DRect samp2dr; +uniform isampler2DArray isamp2DA; +uniform sampler2DRectShadow u2drs; + +#extension GL_ARB_separate_shader_objects : enable + +layout(location = 6) in vec4 vl2; + +void foo23() +{ + const ivec2[3] offsets = ivec2[3](ivec2(1,2), ivec2(3,4), ivec2(15,16)); + + outp.x += textureProjGradOffset(u2drs, outp, vec2(0.0), vec2(0.0), offsets[1]); +} + +void doubles() +{ + double doublev; + dvec2 dvec2v; + dvec3 dvec3v; + dvec4 dvec4v; + + bool boolv; + bvec2 bvec2v; + bvec3 bvec3v; + bvec4 bvec4v; + + doublev = sqrt(2.9); + dvec2v = sqrt(dvec2(2.7)); + dvec3v = sqrt(dvec3(2.0)); + dvec4v = sqrt(dvec4(doublev)); + + doublev += inversesqrt(doublev); + dvec2v += inversesqrt(dvec2v); + dvec3v += inversesqrt(dvec3v); + dvec4v += inversesqrt(dvec4v); + + doublev += abs(doublev); + dvec2v += abs(dvec2v); + dvec3v += abs(dvec3v); + dvec4v += abs(dvec4v); + + doublev += sign(doublev); + dvec2v += sign(dvec2v); + dvec3v += sign(dvec3v); + dvec4v += sign(dvec4v); + + doublev += floor(doublev); + dvec2v += floor(dvec2v); + dvec3v += floor(dvec3v); + dvec4v += floor(dvec4v); + + doublev += trunc(doublev); + dvec2v += trunc(dvec2v); + dvec3v += trunc(dvec3v); + dvec4v += trunc(dvec4v); + + doublev += round(doublev); + dvec2v += round(dvec2v); + dvec3v += round(dvec3v); + dvec4v += round(dvec4v); + + doublev += roundEven(doublev); + dvec2v += roundEven(dvec2v); + dvec3v += roundEven(dvec3v); + dvec4v += roundEven(dvec4v); + + doublev += ceil(doublev); + dvec2v += ceil(dvec2v); + dvec3v += ceil(dvec3v); + dvec4v += ceil(dvec4v); + + doublev += fract(doublev); + dvec2v += fract(dvec2v); + dvec3v += fract(dvec3v); + dvec4v += fract(dvec4v); + + doublev += mod(doublev, doublev); + dvec2v += mod(dvec2v, doublev); + dvec3v += mod(dvec3v, doublev); + dvec4v += mod(dvec4v, doublev); + dvec2v += mod(dvec2v, dvec2v); + dvec3v += mod(dvec3v, dvec3v); + dvec4v += mod(dvec4v, dvec4v); + + doublev += modf(doublev, doublev); + dvec2v += modf(dvec2v, dvec2v); + dvec3v += modf(dvec3v, dvec3v); + dvec4v += modf(dvec4v, dvec4v); + + doublev += min(doublev, doublev); + dvec2v += min(dvec2v, doublev); + dvec3v += min(dvec3v, doublev); + dvec4v += min(dvec4v, doublev); + dvec2v += min(dvec2v, dvec2v); + dvec3v += min(dvec3v, dvec3v); + dvec4v += min(dvec4v, dvec4v); + + doublev += max(doublev, doublev); + dvec2v += max(dvec2v, doublev); + dvec3v += max(dvec3v, doublev); + dvec4v += max(dvec4v, doublev); + dvec2v += max(dvec2v, dvec2v); + dvec3v += max(dvec3v, dvec3v); + dvec4v += max(dvec4v, dvec4v); + + doublev += clamp(doublev, doublev, doublev); + dvec2v += clamp(dvec2v, doublev, doublev); + dvec3v += clamp(dvec3v, doublev, doublev); + dvec4v += clamp(dvec4v, doublev, doublev); + dvec2v += clamp(dvec2v, dvec2v, dvec2v); + dvec3v += clamp(dvec3v, dvec3v, dvec3v); + dvec4v += clamp(dvec4v, dvec4v, dvec4v); + + doublev += mix(doublev, doublev, doublev); + dvec2v += mix(dvec2v, dvec2v, doublev); + dvec3v += mix(dvec3v, dvec3v, doublev); + dvec4v += mix(dvec4v, dvec4v, doublev); + dvec2v += mix(dvec2v, dvec2v, dvec2v); + dvec3v += mix(dvec3v, dvec3v, dvec3v); + dvec4v += mix(dvec4v, dvec4v, dvec4v); + doublev += mix(doublev, doublev, boolv); + dvec2v += mix(dvec2v, dvec2v, bvec2v); + dvec3v += mix(dvec3v, dvec3v, bvec3v); + dvec4v += mix(dvec4v, dvec4v, bvec4v); + + doublev += step(doublev, doublev); + dvec2v += step(dvec2v, dvec2v); + dvec3v += step(dvec3v, dvec3v); + dvec4v += step(dvec4v, dvec4v); + dvec2v += step(doublev, dvec2v); + dvec3v += step(doublev, dvec3v); + dvec4v += step(doublev, dvec4v); + + doublev += smoothstep(doublev, doublev, doublev); + dvec2v += smoothstep(dvec2v, dvec2v, dvec2v); + dvec3v += smoothstep(dvec3v, dvec3v, dvec3v); + dvec4v += smoothstep(dvec4v, dvec4v, dvec4v); + dvec2v += smoothstep(doublev, doublev, dvec2v); + dvec3v += smoothstep(doublev, doublev, dvec3v); + dvec4v += smoothstep(doublev, doublev, dvec4v); + + boolv = isnan(doublev); + bvec2v = isnan(dvec2v); + bvec3v = isnan(dvec3v); + bvec4v = isnan(dvec4v); + + boolv = boolv ? isinf(doublev) : false; + bvec2v = boolv ? isinf(dvec2v) : bvec2(false); + bvec3v = boolv ? isinf(dvec3v) : bvec3(false); + bvec4v = boolv ? isinf(dvec4v) : bvec4(false); + + doublev += length(doublev); + doublev += length(dvec2v); + doublev += length(dvec3v); + doublev += length(dvec4v); + + doublev += distance(doublev, doublev); + doublev += distance(dvec2v, dvec2v); + doublev += distance(dvec3v, dvec3v); + doublev += distance(dvec4v, dvec4v); + + doublev += dot(doublev, doublev); + doublev += dot(dvec2v, dvec2v); + doublev += dot(dvec3v, dvec3v); + doublev += dot(dvec4v, dvec4v); + + dvec3v += cross(dvec3v, dvec3v); + + doublev += normalize(doublev); + dvec2v += normalize(dvec2v); + dvec3v += normalize(dvec3v); + dvec4v += normalize(dvec4v); + + doublev += faceforward(doublev, doublev, doublev); + dvec2v += faceforward(dvec2v, dvec2v, dvec2v); + dvec3v += faceforward(dvec3v, dvec3v, dvec3v); + dvec4v += faceforward(dvec4v, dvec4v, dvec4v); + + doublev += reflect(doublev, doublev); + dvec2v += reflect(dvec2v, dvec2v); + dvec3v += reflect(dvec3v, dvec3v); + dvec4v += reflect(dvec4v, dvec4v); + + doublev += refract(doublev, doublev, doublev); + dvec2v += refract(dvec2v, dvec2v, doublev); + dvec3v += refract(dvec3v, dvec3v, doublev); + dvec4v += refract(dvec4v, dvec4v, doublev); + + dmat2 dmat2v = outerProduct(dvec2v, dvec2v); + dmat3 dmat3v = outerProduct(dvec3v, dvec3v); + dmat4 dmat4v = outerProduct(dvec4v, dvec4v); + dmat2x3 dmat2x3v = outerProduct(dvec3v, dvec2v); + dmat3x2 dmat3x2v = outerProduct(dvec2v, dvec3v); + dmat2x4 dmat2x4v = outerProduct(dvec4v, dvec2v); + dmat4x2 dmat4x2v = outerProduct(dvec2v, dvec4v); + dmat3x4 dmat3x4v = outerProduct(dvec4v, dvec3v); + dmat4x3 dmat4x3v = outerProduct(dvec3v, dvec4v); + + dmat2v *= matrixCompMult(dmat2v, dmat2v); + dmat3v *= matrixCompMult(dmat3v, dmat3v); + dmat4v *= matrixCompMult(dmat4v, dmat4v); + dmat2x3v = matrixCompMult(dmat2x3v, dmat2x3v); // For now, relying on no dead-code elimination + dmat2x4v = matrixCompMult(dmat2x4v, dmat2x4v); + dmat3x2v = matrixCompMult(dmat3x2v, dmat3x2v); + dmat3x4v = matrixCompMult(dmat3x4v, dmat3x4v); + dmat4x2v = matrixCompMult(dmat4x2v, dmat4x2v); + dmat4x3v = matrixCompMult(dmat4x3v, dmat4x3v); + + dmat2v *= transpose(dmat2v); + dmat3v *= transpose(dmat3v); + dmat4v *= transpose(dmat4v); + dmat2x3v = transpose(dmat3x2v); // For now, relying on no dead-code elimination + dmat3x2v = transpose(dmat2x3v); + dmat2x4v = transpose(dmat4x2v); + dmat4x2v = transpose(dmat2x4v); + dmat3x4v = transpose(dmat4x3v); + dmat4x3v = transpose(dmat3x4v); + + doublev += determinant(dmat2v); + doublev += determinant(dmat3v); + doublev += determinant(dmat4v); + + dmat2v *= inverse(dmat2v); + dmat3v *= inverse(dmat3v); + dmat4v *= inverse(dmat4v); + + outp *= float(doublev + dvec2v.y + dvec3v.z + dvec4v.w + + dmat2v[1][1] + dmat3v[2][2] + dmat4v[3][3] + dmat2x3v[1][1] + dmat3x2v[1][1] + dmat3x4v[2][2] + dmat4x3v[2][2] + dmat2x4v[1][1] + dmat4x2v[1][1] + + float(boolv) + float(bvec2v.x) + float(bvec3v.x) + float(bvec4v.x)); +} + +void main() +{ + vec4 v; + v = texture(arrayedSampler[i], c2D); + outp.x = gl_ClipDistance[1]; + outp.yzw = v.yzw; + + ivec2 offsets[4]; + const ivec2 constOffsets[4] = ivec2[4](ivec2(1,2), ivec2(3,4), ivec2(15,16), ivec2(-2,0)); + uoutp = textureGatherOffsets(samp2dr, c2D, constOffsets, 2); + outp += textureGather(arrayedSampler[0], c2D); + ioutp = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 3); + ioutp += textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 1+2); + ioutp += textureGatherOffset(isamp2DA, vec3(0.1), ivec2(i)); + + outp += gl_FragCoord + vl2; + uo = u % i; + foo23(); + doubles(); + + int id = gl_PrimitiveID; +} + diff --git a/deps/glslang/Test/spv.400.tesc b/deps/glslang/Test/spv.400.tesc new file mode 100644 index 00000000..1c926d08 --- /dev/null +++ b/deps/glslang/Test/spv.400.tesc @@ -0,0 +1,43 @@ +#version 400 core + +layout(vertices = 4) out; +int outa[gl_out.length()]; + +patch out vec4 patchOut; + +void main() +{ + barrier(); + + int a = gl_MaxTessControlInputComponents + + gl_MaxTessControlOutputComponents + + gl_MaxTessControlTextureImageUnits + + gl_MaxTessControlUniformComponents + + gl_MaxTessControlTotalOutputComponents; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; + float cd = gl_in[1].gl_ClipDistance[2]; + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + int iid = gl_InvocationID; + + gl_out[gl_InvocationID].gl_Position = p; + gl_out[gl_InvocationID].gl_PointSize = ps; + gl_out[gl_InvocationID].gl_ClipDistance[1] = cd; + + gl_TessLevelOuter[3] = 3.2; + gl_TessLevelInner[1] = 1.3; +} + +in vec2 inb[]; +in vec2 ind[gl_MaxPatchVertices]; + +#extension GL_ARB_separate_shader_objects : enable + +layout(location = 3) in vec4 ivla[]; +layout(location = 4) in vec4 ivlb[]; + +layout(location = 3) out vec4 ovla[]; +layout(location = 4) out vec4 ovlb[]; diff --git a/deps/glslang/Test/spv.400.tese b/deps/glslang/Test/spv.400.tese new file mode 100644 index 00000000..da33f41e --- /dev/null +++ b/deps/glslang/Test/spv.400.tese @@ -0,0 +1,52 @@ +#version 400 core + +layout(triangles, ccw) in; + +layout(fractional_odd_spacing) in; + +layout(point_mode) in; + +patch in vec4 patchIn; + +void main() +{ + int a = gl_MaxTessEvaluationInputComponents + + gl_MaxTessEvaluationOutputComponents + + gl_MaxTessEvaluationTextureImageUnits + + gl_MaxTessEvaluationUniformComponents + + gl_MaxTessPatchComponents + + gl_MaxPatchVertices + + gl_MaxTessGenLevel; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; + float cd = gl_in[1].gl_ClipDistance[2]; + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + vec3 tc = gl_TessCoord; + float tlo = gl_TessLevelOuter[3]; + float tli = gl_TessLevelInner[1]; + + gl_Position = p; + gl_PointSize = ps; + gl_ClipDistance[2] = cd; +} + +#extension GL_ARB_separate_shader_objects : enable + +in vec2 inb[]; +in vec2 ind[gl_MaxPatchVertices]; + +in testblb { + int f; +} blb[]; + +in testbld { + int f; +} bld[gl_MaxPatchVertices]; + +layout(location = 23) in vec4 ivla[]; +layout(location = 24) in vec4 ivlb[]; + +layout(location = 23) out vec4 ovla[2]; diff --git a/deps/glslang/Test/spv.420.geom b/deps/glslang/Test/spv.420.geom new file mode 100644 index 00000000..92186ae8 --- /dev/null +++ b/deps/glslang/Test/spv.420.geom @@ -0,0 +1,43 @@ +#version 420 core + +layout(triangles) in; + +in gl_PerVertex { + float gl_PointSize; +} gl_in[]; + +out gl_PerVertex { + float gl_PointSize; +}; + +layout(line_strip) out; +layout(max_vertices = 127) out; +layout(invocations = 4) in; + +uniform sampler2D s2D; +in vec2 coord[]; + +int i; + +void main() +{ + float p = gl_in[1].gl_PointSize; + gl_PointSize = p; + gl_ViewportIndex = 7; + + EmitStreamVertex(1); + EndStreamPrimitive(0); + EmitVertex(); + EndPrimitive(); + int id = gl_InvocationID; + + const ivec2 offsets[5] = + { + ivec2(0,1), + ivec2(1,-2), + ivec2(0,3), + ivec2(-3,0), + ivec2(2,1) + }; + vec4 v = textureGatherOffset(s2D, coord[0], offsets[i].xy); +} diff --git a/deps/glslang/Test/spv.430.frag b/deps/glslang/Test/spv.430.frag new file mode 100644 index 00000000..e547f610 --- /dev/null +++ b/deps/glslang/Test/spv.430.frag @@ -0,0 +1,10 @@ +#version 430 core + +out vec4 color; + +void main() +{ + color = vec4(1.0); + color *= gl_Layer; + color *= gl_ViewportIndex; +} diff --git a/deps/glslang/Test/spv.430.vert b/deps/glslang/Test/spv.430.vert new file mode 100644 index 00000000..f52ff4a6 --- /dev/null +++ b/deps/glslang/Test/spv.430.vert @@ -0,0 +1,37 @@ +#version 450 core + + + +out gl_PerVertex { + float gl_ClipDistance[]; +}; + +const float cx = 4.20; +const float dx = 4.20; +in vec4 bad[10]; +highp in vec4 badorder; +out invariant vec4 badorder2; +out flat vec4 badorder3; + +in float f; + +void main() +{ + gl_ClipDistance[2] = 3.7; + + if (bad[0].x == cx.x) + badorder3 = bad[0]; + + gl_ClipDistance[0] = f.x; +} + +layout(binding = 3) uniform boundblock { int aoeu; } boundInst; +layout(binding = 7) uniform anonblock { int aoeu; } ; +layout(binding = 4) uniform sampler2D sampb1; +layout(binding = 5) uniform sampler2D sampb2[10]; +layout(binding = 31) uniform sampler2D sampb4; + +struct S { mediump float a; highp uvec2 b; highp vec3 c; }; +struct SS { vec4 b; S s; vec4 c; }; +layout(location = 0) flat out SS var; +out MS { layout(location = 17) float f; } outMS; diff --git a/deps/glslang/Test/spv.450.geom b/deps/glslang/Test/spv.450.geom new file mode 100644 index 00000000..3489a888 --- /dev/null +++ b/deps/glslang/Test/spv.450.geom @@ -0,0 +1,14 @@ +#version 450 core + +layout(triangles) in; + +layout(line_strip) out; +layout(max_vertices = 127) out; +layout(invocations = 4) in; + +void main() +{ + gl_PointSize = gl_in[1].gl_PointSize; + gl_Layer = 2; + gl_ViewportIndex = 3; +} diff --git a/deps/glslang/Test/spv.450.noRedecl.tesc b/deps/glslang/Test/spv.450.noRedecl.tesc new file mode 100644 index 00000000..85fe94b8 --- /dev/null +++ b/deps/glslang/Test/spv.450.noRedecl.tesc @@ -0,0 +1,10 @@ +#version 450 core + +layout(vertices = 4) out; + +patch out vec4 patchOut; + +void main() +{ + gl_in[0].gl_PointSize; +} diff --git a/deps/glslang/Test/spv.450.tesc b/deps/glslang/Test/spv.450.tesc new file mode 100644 index 00000000..47b9a408 --- /dev/null +++ b/deps/glslang/Test/spv.450.tesc @@ -0,0 +1,33 @@ +#version 450 core + +layout(vertices = 4) out; + +layout(location=1) patch out vec4 patchOut; + +struct S { + float sMem1; // should not see a patch decoration + float sMem2; // should not see a patch decoration +}; + +layout(location = 12) patch out TheBlock { + highp float bMem1; // should not see a location decoration + highp float bMem2; + S s; // should see a patch decoration +} tcBlock[2]; + +void main() +{ + gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position; +} + +layout(location = 2) patch out SingleBlock { + highp float bMem1; // should not see a location decoration + highp float bMem2; + S s; // should see a patch decoration +} singleBlock; + +layout(location = 20) patch out bn { + vec4 v1; // location 20 + layout(location = 24) vec4 v2; // location 24 + vec4 v3; // location 25 +}; \ No newline at end of file diff --git a/deps/glslang/Test/spv.460.comp b/deps/glslang/Test/spv.460.comp new file mode 100644 index 00000000..eb671a38 --- /dev/null +++ b/deps/glslang/Test/spv.460.comp @@ -0,0 +1,9 @@ +#version 460 + +void main() +{ + bool b1; + b1 = anyInvocation(b1); + b1 = allInvocations(b1); + b1 = allInvocationsEqual(b1); +} diff --git a/deps/glslang/Test/spv.460.frag b/deps/glslang/Test/spv.460.frag new file mode 100644 index 00000000..9eb8bf46 --- /dev/null +++ b/deps/glslang/Test/spv.460.frag @@ -0,0 +1,17 @@ +#version 460 core + +layout(binding = 0) uniform atomic_uint aui; +uint ui; + +void main() +{ + atomicCounterAdd(aui, ui); + atomicCounterSubtract(aui, ui); + atomicCounterMin(aui, ui); + atomicCounterMax(aui, ui); + atomicCounterAnd(aui, ui); + atomicCounterOr(aui, ui); + atomicCounterXor(aui, ui); + atomicCounterExchange(aui, ui); + atomicCounterCompSwap(aui, ui, ui); +} diff --git a/deps/glslang/Test/spv.460.vert b/deps/glslang/Test/spv.460.vert new file mode 100644 index 00000000..72d4e775 --- /dev/null +++ b/deps/glslang/Test/spv.460.vert @@ -0,0 +1,6 @@ +#version 460 + +void main() +{ + int a = gl_BaseVertex + gl_BaseInstance + gl_DrawID; +} diff --git a/deps/glslang/Test/spv.8bitstorage-int.frag b/deps/glslang/Test/spv.8bitstorage-int.frag new file mode 100644 index 00000000..93203c36 --- /dev/null +++ b/deps/glslang/Test/spv.8bitstorage-int.frag @@ -0,0 +1,90 @@ +#version 450 core + +#extension GL_EXT_shader_8bit_storage : enable + +struct S +{ + int8_t x; + i8vec2 y; + i8vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + int8_t a; + i8vec2 b; + i8vec3 c; + int8_t d[2]; + S g; + S h[2]; + int j; +} b1; + +layout(row_major, std430) buffer B2 +{ + int8_t o; + i8vec2 p; + i8vec3 q; + int8_t r[2]; + S u; + S v[2]; + i8vec2 x[100]; + int8_t w[]; +} b2; + +layout(row_major, std140) uniform B5 +{ + int8_t o; + i8vec2 p; + i8vec3 q; + int8_t r[2]; + S u; + S v[2]; + i8vec2 x[100]; + int8_t w[100]; +} b5; + +struct S2 { + mat4x4 x; + int8_t y; + int z; +}; + +struct S3 { + S2 x; +}; + +layout(row_major, std430) buffer B3 +{ + S2 x; +} b3; + +layout(column_major, std430) buffer B4 +{ + S2 x; + S3 y; +} b4; + +void main() +{ + b2.o = b1.a; + b2.p = i8vec2(ivec3(b2.q).xy); + b2.p = i8vec2(ivec3(b5.q).xy); + b2.r[0] = b2.r[0]; + b2.r[1] = b5.r[1]; + b2.p = b2.p; + int x0 = int(b1.a); + ivec4 x1 = ivec4(b1.a, b2.p, 1); + b4.x.x = b3.x.x; + b2.o = int8_t(ivec2(b2.p).x); + b2.p = b2.v[1].y; + ivec3 v3 = ivec3(b2.w[b1.j], b2.w[b1.j+1], b2.w[b1.j+2]); + ivec3 u3 = ivec3(b5.w[b1.j], b5.w[b1.j+1], b5.w[b1.j+2]); + b2.x[0] = b2.x[0]; + b2.x[1] = b5.x[1]; + b2.p.x = b1.a; + b2.o = b2.p.x; + b2.p = i8vec2(ivec2(1, 2)); + b2.o = int8_t(3); +} + diff --git a/deps/glslang/Test/spv.8bitstorage-ssbo.vert b/deps/glslang/Test/spv.8bitstorage-ssbo.vert new file mode 100644 index 00000000..61ba7bf1 --- /dev/null +++ b/deps/glslang/Test/spv.8bitstorage-ssbo.vert @@ -0,0 +1,15 @@ +#version 450 + +#extension GL_EXT_shader_8bit_storage: require + +layout(binding = 0) readonly buffer Vertices +{ + uint8_t vertices[]; +}; + +layout(location = 0) out vec4 color; + +void main() +{ + color = vec4(int(vertices[gl_VertexIndex])); +} diff --git a/deps/glslang/Test/spv.8bitstorage-ubo.vert b/deps/glslang/Test/spv.8bitstorage-ubo.vert new file mode 100644 index 00000000..5c49a243 --- /dev/null +++ b/deps/glslang/Test/spv.8bitstorage-ubo.vert @@ -0,0 +1,15 @@ +#version 450 + +#extension GL_EXT_shader_8bit_storage: require + +layout(binding = 0) readonly uniform Vertices +{ + uint8_t vertices[512]; +}; + +layout(location = 0) out vec4 color; + +void main() +{ + color = vec4(int(vertices[gl_VertexIndex])); +} diff --git a/deps/glslang/Test/spv.8bitstorage-uint.frag b/deps/glslang/Test/spv.8bitstorage-uint.frag new file mode 100644 index 00000000..574d088e --- /dev/null +++ b/deps/glslang/Test/spv.8bitstorage-uint.frag @@ -0,0 +1,90 @@ +#version 450 core + +#extension GL_EXT_shader_8bit_storage : enable + +struct S +{ + uint8_t x; + u8vec2 y; + u8vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + uint8_t a; + u8vec2 b; + u8vec3 c; + uint8_t d[2]; + S g; + S h[2]; + uint j; +} b1; + +layout(row_major, std430) buffer B2 +{ + uint8_t o; + u8vec2 p; + u8vec3 q; + uint8_t r[2]; + S u; + S v[2]; + u8vec2 x[100]; + uint8_t w[]; +} b2; + +layout(row_major, std140) uniform B5 +{ + uint8_t o; + u8vec2 p; + u8vec3 q; + uint8_t r[2]; + S u; + S v[2]; + u8vec2 x[100]; + uint8_t w[100]; +} b5; + +struct S2 { + mat4x4 x; + uint8_t y; + uint z; +}; + +struct S3 { + S2 x; +}; + +layout(row_major, std430) buffer B3 +{ + S2 x; +} b3; + +layout(column_major, std430) buffer B4 +{ + S2 x; + S3 y; +} b4; + +void main() +{ + b2.o = b1.a; + b2.p = u8vec2(uvec3(b2.q).xy); + b2.p = u8vec2(uvec3(b5.q).xy); + b2.r[0] = b2.r[0]; + b2.r[1] = b5.r[1]; + b2.p = b2.p; + uint x0 = uint(b1.a); + uvec4 x1 = uvec4(b1.a, b2.p, 1); + b4.x.x = b3.x.x; + b2.o = uint8_t(uvec2(b2.p).x); + b2.p = b2.v[1].y; + uvec3 v3 = uvec3(b2.w[b1.j], b2.w[b1.j+1], b2.w[b1.j+2]); + uvec3 u3 = uvec3(b5.w[b1.j], b5.w[b1.j+1], b5.w[b1.j+2]); + b2.x[0] = b2.x[0]; + b2.x[1] = b5.x[1]; + b2.p.x = b1.a; + b2.o = b2.p.x; + b2.p = u8vec2(uvec2(1, 2)); + b2.o = uint8_t(3u); +} + diff --git a/deps/glslang/Test/spv.8bitstorage_Error-int.frag b/deps/glslang/Test/spv.8bitstorage_Error-int.frag new file mode 100644 index 00000000..35fe1826 --- /dev/null +++ b/deps/glslang/Test/spv.8bitstorage_Error-int.frag @@ -0,0 +1,101 @@ +#version 450 core + +#extension GL_EXT_shader_8bit_storage : enable + +struct S +{ + int8_t x; + i8vec2 y; + i8vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + int8_t a; + i8vec2 b; + i8vec3 c; + int8_t d[2]; + S g; + S h[2]; + int j; +} b1; + +layout(row_major, std430) buffer B2 +{ + int8_t o; + i8vec2 p; + i8vec3 q; + int8_t r[2]; + S u; + S v[2]; + int8_t w[]; +} b2; + +struct S2 { + mat4x4 x; + int8_t y; + int z; +}; + +struct S3 { + S2 x; +}; + +layout(row_major, std430) buffer B3 +{ + S2 x; +} b3; + +layout(column_major, std430) buffer B4 +{ + S2 x; +} b4; + +void func3(S2 x) { +} + +S2 func4() { + return b4.x; +} + +int func(int8_t a) { + return 0; +} + +struct S4 { + int x; + int8_t y; +}; + +int func2(int a) { return 0; } + +void main() +{ + b2.o = b2.q[1]; + b2.p = b2.q.xy; + b2.o = max(b1.a, b1.a); + bvec2 bv = lessThan(b2.p, b2.p); + b2.o = b1.a + b1.a; + b2.o = -b1.a; + b2.o = b1.a + 1; + b2.p = b2.p.yx; + b4.x = b3.x; + int8_t f0; + S2 f1; + S3 f2; + if (b1.a == b1.a) {} + b2.r = b2.r; + b2.p = i8vec2(3, 4); + i8vec2[2](i8vec2(ivec2(1,2)), i8vec2(ivec2(3,4))); + // NOT ERRORING YET + b3.x; + S4(0, int8_t(0)); + func2(b1.a); +} + + +layout(column_major, std140) uniform B6 +{ + i8mat2x3 e; +} b6; + diff --git a/deps/glslang/Test/spv.8bitstorage_Error-uint.frag b/deps/glslang/Test/spv.8bitstorage_Error-uint.frag new file mode 100644 index 00000000..5d0209f0 --- /dev/null +++ b/deps/glslang/Test/spv.8bitstorage_Error-uint.frag @@ -0,0 +1,101 @@ +#version 450 core + +#extension GL_EXT_shader_8bit_storage : enable + +struct S +{ + uint8_t x; + u8vec2 y; + u8vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + uint8_t a; + u8vec2 b; + u8vec3 c; + uint8_t d[2]; + S g; + S h[2]; + uint j; +} b1; + +layout(row_major, std430) buffer B2 +{ + uint8_t o; + u8vec2 p; + u8vec3 q; + uint8_t r[2]; + S u; + S v[2]; + uint8_t w[]; +} b2; + +struct S2 { + mat4x4 x; + uint8_t y; + uint z; +}; + +struct S3 { + S2 x; +}; + +layout(row_major, std430) buffer B3 +{ + S2 x; +} b3; + +layout(column_major, std430) buffer B4 +{ + S2 x; +} b4; + +void func3(S2 x) { +} + +S2 func4() { + return b4.x; +} + +uint func(uint8_t a) { + return 0; +} + +struct S4 { + uint x; + uint8_t y; +}; + +uint func2(uint a) { return 0; } + +void main() +{ + b2.o = b2.q[1]; + b2.p = b2.q.xy; + b2.o = max(b1.a, b1.a); + bvec2 bv = lessThan(b2.p, b2.p); + b2.o = b1.a + b1.a; + b2.o = -b1.a; + b2.o = b1.a + 1; + b2.p = b2.p.yx; + b4.x = b3.x; + uint8_t f0; + S2 f1; + S3 f2; + if (b1.a == b1.a) {} + b2.r = b2.r; + b2.p = u8vec2(3, 4); + u8vec2[2](u8vec2(uvec2(1,2)), u8vec2(uvec2(3,4))); + // NOT ERRORING YET + b3.x; + S4(0u, uint8_t(0u)); + func2(b1.a); +} + + +layout(column_major, std140) uniform B6 +{ + u8mat2x3 e; +} b6; + diff --git a/deps/glslang/Test/spv.AnyHitShader.rahit b/deps/glslang/Test/spv.AnyHitShader.rahit new file mode 100644 index 00000000..c03cc2f7 --- /dev/null +++ b/deps/glslang/Test/spv.AnyHitShader.rahit @@ -0,0 +1,26 @@ +#version 460 +#extension GL_NV_ray_tracing : enable +layout(location = 1) rayPayloadInNV vec4 incomingPayload; +void main() +{ + uvec3 v0 = gl_LaunchIDNV; + uvec3 v1 = gl_LaunchSizeNV; + int v2 = gl_PrimitiveID; + int v3 = gl_InstanceID; + int v4 = gl_InstanceCustomIndexNV; + vec3 v5 = gl_WorldRayOriginNV; + vec3 v6 = gl_WorldRayDirectionNV; + vec3 v7 = gl_ObjectRayOriginNV; + vec3 v8 = gl_ObjectRayDirectionNV; + float v9 = gl_RayTminNV; + float v10 = gl_RayTmaxNV; + float v11 = gl_HitTNV; + uint v12 = gl_HitKindNV; + mat4x3 v13 = gl_ObjectToWorldNV; + mat4x3 v14 = gl_WorldToObjectNV; + incomingPayload = vec4(0.5f); + if (v2 == 1) + ignoreIntersectionNV(); + else + terminateRayNV(); +} diff --git a/deps/glslang/Test/spv.AnyHitShader_Errors.rahit b/deps/glslang/Test/spv.AnyHitShader_Errors.rahit new file mode 100644 index 00000000..952461ee --- /dev/null +++ b/deps/glslang/Test/spv.AnyHitShader_Errors.rahit @@ -0,0 +1,11 @@ +#version 460 +#extension GL_NV_ray_tracing : enable +hitAttributeNV vec4 payload; +layout(binding = 0, set = 0) uniform accelerationStructureNV accNV; + +void main() +{ + payload.x = 1.0f; // ERROR, cannot write to hitattributeNV in stage + reportIntersectionNV(1.0, 1U); // ERROR, unsupported builtin in stage + traceNV(accNV, 0, 0, 1, 1, 0, vec3(0.0f), 0.5f, vec3(1.0f), 0.75f, 0); // ERROR, unsupported builtin in stage +} diff --git a/deps/glslang/Test/spv.AofA.frag b/deps/glslang/Test/spv.AofA.frag new file mode 100644 index 00000000..62847100 --- /dev/null +++ b/deps/glslang/Test/spv.AofA.frag @@ -0,0 +1,43 @@ +#version 430 + +in float infloat; +out float outfloat; + +uniform uAofA { + float f[2][4]; +} nameAofA[3][5]; + +float[4][5][6] many[1][2][3]; + +float g4[4][7]; +in float g5[5][7]; + +flat in int i, j, k; + +float[4][7] foo(float a[5][7]) +{ + float r[7]; + r = a[2]; + + return float[4][7](a[0], a[1], r, a[3]); +} + +void main() +{ + outfloat = 0.0; + + g4 = foo(g5); + +// if (foo(g5) == g4) +// ++outfloat; + + float u[][7]; + u[2][2] = 3.0; + float u[5][7]; + + foo(u); + + many[i][j][k][i][j][k] = infloat; + outfloat += many[j][j][j][j][j][j]; + outfloat += nameAofA[1][2].f[0][3]; +} diff --git a/deps/glslang/Test/spv.ClosestHitShader.rchit b/deps/glslang/Test/spv.ClosestHitShader.rchit new file mode 100644 index 00000000..7a09b804 --- /dev/null +++ b/deps/glslang/Test/spv.ClosestHitShader.rchit @@ -0,0 +1,24 @@ +#version 460 +#extension GL_NV_ray_tracing : enable +layout(binding = 0, set = 0) uniform accelerationStructureNV accNV; +layout(location = 0) rayPayloadNV vec4 localPayload; +layout(location = 1) rayPayloadInNV vec4 incomingPayload; +void main() +{ + uvec3 v0 = gl_LaunchIDNV; + uvec3 v1 = gl_LaunchSizeNV; + int v2 = gl_PrimitiveID; + int v3 = gl_InstanceID; + int v4 = gl_InstanceCustomIndexNV; + vec3 v5 = gl_WorldRayOriginNV; + vec3 v6 = gl_WorldRayDirectionNV; + vec3 v7 = gl_ObjectRayOriginNV; + vec3 v8 = gl_ObjectRayDirectionNV; + float v9 = gl_RayTminNV; + float v10 = gl_RayTmaxNV; + float v11 = gl_HitTNV; + uint v12 = gl_HitKindNV; + mat4x3 v13 = gl_ObjectToWorldNV; + mat4x3 v14 = gl_WorldToObjectNV; + traceNV(accNV, 0u, 1u, 2u, 3u, 0u, vec3(0.5f), 0.5f, vec3(1.0f), 0.75f, 1); +} diff --git a/deps/glslang/Test/spv.ClosestHitShader_Errors.rchit b/deps/glslang/Test/spv.ClosestHitShader_Errors.rchit new file mode 100644 index 00000000..b7b421ec --- /dev/null +++ b/deps/glslang/Test/spv.ClosestHitShader_Errors.rchit @@ -0,0 +1,12 @@ +#version 460 +#extension GL_NV_ray_tracing : enable +hitAttributeNV vec4 payload; +layout(binding = 0, set = 0) uniform accelerationStructureNV accNV; + +void main() +{ + payload.x = 1.0f; // ERROR, cannot write to hitattributeNV in stage + reportIntersectionNV(1.0, 1U); // ERROR, unsupported builtin in stage + terminateRayNV(); + ignoreIntersectionNV(); +} diff --git a/deps/glslang/Test/spv.GeometryShaderPassthrough.geom b/deps/glslang/Test/spv.GeometryShaderPassthrough.geom new file mode 100644 index 00000000..9e6fe4ce --- /dev/null +++ b/deps/glslang/Test/spv.GeometryShaderPassthrough.geom @@ -0,0 +1,17 @@ +#version 450 +#extension GL_NV_geometry_shader_passthrough : require + +layout(triangles) in; + +layout(passthrough) in gl_PerVertex { + vec4 gl_Position; +}; + +layout(passthrough) in Inputs { +vec2 texcoord; +vec4 baseColor; +}; + +void main() +{ +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.IntersectShader.rint b/deps/glslang/Test/spv.IntersectShader.rint new file mode 100644 index 00000000..85ec3199 --- /dev/null +++ b/deps/glslang/Test/spv.IntersectShader.rint @@ -0,0 +1,21 @@ +#version 460 +#extension GL_NV_ray_tracing : enable +hitAttributeNV vec4 iAttr; +void main() +{ + uvec3 v0 = gl_LaunchIDNV; + uvec3 v1 = gl_LaunchSizeNV; + int v2 = gl_PrimitiveID; + int v3 = gl_InstanceID; + int v4 = gl_InstanceCustomIndexNV; + vec3 v5 = gl_WorldRayOriginNV; + vec3 v6 = gl_WorldRayDirectionNV; + vec3 v7 = gl_ObjectRayOriginNV; + vec3 v8 = gl_ObjectRayDirectionNV; + float v9 = gl_RayTminNV; + float v10 = gl_RayTmaxNV; + mat4x3 v11 = gl_ObjectToWorldNV; + mat4x3 v12 = gl_WorldToObjectNV; + iAttr = vec4(0.5f,0.5f,0.0f,1.0f); + reportIntersectionNV(0.5, 1U); +} diff --git a/deps/glslang/Test/spv.IntersectShader_Errors.rint b/deps/glslang/Test/spv.IntersectShader_Errors.rint new file mode 100644 index 00000000..fbc68465 --- /dev/null +++ b/deps/glslang/Test/spv.IntersectShader_Errors.rint @@ -0,0 +1,11 @@ +#version 460 +#extension GL_NV_ray_tracing : enable +rayPayloadInNV vec4 payloadIn; // ERROR, rayPayloadIn unsupported in this stage +rayPayloadNV vec4 payload; // ERROR, rayPayload unsuppoted in this stage +uniform accelerationStructureNV accNV; +void main() +{ + float e12 = gl_HitTNV; // ERROR, unsupported builtin in stage + float e13 = gl_HitKindNV; // ERROR, unsupported builtin in stage + traceNV(accNV, 0, 0, 1, 1, 0, vec3(0.0f), 0.5f, vec3(1.0f), 0.75f, 0); // ERROR, unsupported +} diff --git a/deps/glslang/Test/spv.MissShader.rmiss b/deps/glslang/Test/spv.MissShader.rmiss new file mode 100644 index 00000000..06113deb --- /dev/null +++ b/deps/glslang/Test/spv.MissShader.rmiss @@ -0,0 +1,17 @@ +#version 460 +#extension GL_NV_ray_tracing : enable +layout(binding = 0, set = 0) uniform accelerationStructureNV accNV; +layout(location = 0) rayPayloadNV vec4 localPayload; +layout(location = 1) rayPayloadInNV vec4 incomingPayload; +void main() +{ + uvec3 v0 = gl_LaunchIDNV; + uvec3 v1 = gl_LaunchSizeNV; + vec3 v2 = gl_WorldRayOriginNV; + vec3 v3 = gl_WorldRayDirectionNV; + vec3 v4 = gl_ObjectRayOriginNV; + vec3 v5 = gl_ObjectRayDirectionNV; + float v6 = gl_RayTminNV; + float v7 = gl_RayTmaxNV; + traceNV(accNV, 0u, 1u, 2u, 3u, 0u, vec3(0.5f), 0.5f, vec3(1.0f), 0.75f, 1); +} diff --git a/deps/glslang/Test/spv.MissShader_Errors.rmiss b/deps/glslang/Test/spv.MissShader_Errors.rmiss new file mode 100644 index 00000000..a7f7c59c --- /dev/null +++ b/deps/glslang/Test/spv.MissShader_Errors.rmiss @@ -0,0 +1,16 @@ +#version 460 +#extension GL_NV_ray_tracing : enable +hitAttributeNV vec4 payload; // ERROR, hitattributeNV unsupported in this stage +void main() +{ + int e0 = gl_PrimitiveID; // ERROR, unsupported builtin in stage + int e1 = gl_InstanceID; // ERROR, unsupported builtin in stage + int e3 = gl_InstanceCustomIndexNV; // ERROR, unsupported builtin in stage + mat4x3 e10 = gl_ObjectToWorldNV; // ERROR, unsupported builtin in stage + mat4x3 e11 = gl_WorldToObjectNV; // ERROR, unsupported builtin in stage + float e12 = gl_HitTNV; // ERROR, unsupported builtin in stage + float e13 = gl_HitKindNV; // ERROR, unsupported builtin in stage + reportIntersectionNV(1.0, 1U); // ERROR, unsupported builtin in stage + ignoreIntersectionNV(); // ERROR, unsupported builtin in stage + terminateRayNV(); // ERROR, unsupported builtin in stage +} diff --git a/deps/glslang/Test/spv.OVR_multiview.vert b/deps/glslang/Test/spv.OVR_multiview.vert new file mode 100644 index 00000000..c81a4d99 --- /dev/null +++ b/deps/glslang/Test/spv.OVR_multiview.vert @@ -0,0 +1,9 @@ +#version 330 + +#extension GL_OVR_multiview : enable + +layout(num_views = 2) in; + +void main() { + gl_Position = vec4(gl_ViewID_OVR, 0, 0, 0); +} diff --git a/deps/glslang/Test/spv.Operations.frag b/deps/glslang/Test/spv.Operations.frag new file mode 100644 index 00000000..52f0a30f --- /dev/null +++ b/deps/glslang/Test/spv.Operations.frag @@ -0,0 +1,141 @@ +#version 450 + +flat in ivec4 uiv4; +in vec4 uv4; +bool ub; +bvec4 ub41, ub42; +in float uf; +flat in int ui; +flat in uvec4 uuv4; +flat in uint uui; + +out vec4 FragColor; + +void main() +{ + vec4 v; + float f; + bool b; + bvec4 bv4; + int i; + uint u; + + // floating point + v = radians(uv4); + v += degrees(v); + v += (i = ui*ui, sin(v)); + v += cos(v); + v += tan(v); + v += asin(v); + v += acos(v); + + v += atan(v); + v += sinh(v); + v += cosh(v); + v += tanh(v); + v += asinh(v); + v += acosh(v); + v += atanh(v); + + v += pow(v, v); + v += exp(v); + v += log(v); + v += exp2(v); + v += log2(v); + v += sqrt(v); + v += inversesqrt(v); + v += abs(v); + v += sign(v); + v += floor(v); + + v += trunc(v); + v += round(v); + v += roundEven(v); + + v += ceil(v); + v += fract(v); + v += mod(v, v); + v += mod(v, v.x); + + v += modf(v, v); + + v += min(v, uv4); + v += max(v, uv4); + v += clamp(v, uv4, uv4); + v += mix(v,v,v); + + v += mix(v,v,ub41); + v += mix(v,v,f); +//spv v += intBitsToFloat(ui); +// v += uintBitsToFloat(uui); +// i += floatBitsToInt(f); +// u += floatBitsToUint(f); + v += fma(v, uv4, v); + + v += step(v,v); + v += smoothstep(v,v,v); + v += step(uf,v); + v += smoothstep(uf,uf,v); + v += normalize(v); + v += faceforward(v, v, v); + v += reflect(v, v); + v += refract(v, v, uf); + v += dFdx(v); + v += dFdy(v); + v += fwidth(v); + + // signed integer + i += abs(ui); + i += sign(i); + i += min(i, ui); + i += max(i, ui); + i += clamp(i, ui, ui); + + // unsigned integer + u += min(u, uui); + u += max(u, uui); + u += clamp(u, uui, uui); + + //// bool + b = isnan(uf); + b = isinf(f); + b = any(lessThan(v, uv4)); + b = (b && any(lessThanEqual(v, uv4))); + b = (b && any(greaterThan(v, uv4))); + b = (b && any(greaterThanEqual(v, uv4))); + b = (b && any(equal(ub41, ub42))); + b = (b && any(notEqual(ub41, ub42))); + b = (b && any(ub41)); + b = (b && all(ub41)); + b = (b && any(not(ub41))); + + i = ((i + ui) * i - ui) / i; + i = i % ui; + if (i == ui || i != ui && i == ui ^^ i != 2) + ++i; + + f = ((uf + uf) * uf - uf) / uf; + + f += length(v); + f += distance(v, v); + f += dot(v, v); + f += dot(f, uf); + f += cross(v.xyz, v.xyz).x; + + if (f == uf || f != uf && f != 2.0) + ++f; + + i &= ui; + i |= 0x42; + i ^= ui; + i %= 17; + i >>= 2; + i <<= ui; + i = ~i; + b = !b; + + FragColor = b ? vec4(i) + vec4(f) + v : v; + + mat4 m1 = mat4(1.0), m2 = mat4(0.0); + FragColor += (b ? m1 : m2)[1]; +} diff --git a/deps/glslang/Test/spv.RayCallable.rcall b/deps/glslang/Test/spv.RayCallable.rcall new file mode 100644 index 00000000..12f28845 --- /dev/null +++ b/deps/glslang/Test/spv.RayCallable.rcall @@ -0,0 +1,15 @@ +#version 460 +#extension GL_NV_ray_tracing : enable +layout(location = 0) callableDataNV vec4 data0; +layout(location = 1) callableDataInNV dataBlock { + uint data1; +}; +void main() +{ + uvec3 id = gl_LaunchIDNV; + uvec3 size = gl_LaunchSizeNV; + uint curFlags = gl_IncomingRayFlagsNV; + curFlags = curFlags & gl_RayFlagsOpaqueNV; + data1 = 256U; + executeCallableNV(2,1); +} diff --git a/deps/glslang/Test/spv.RayCallable_Errors.rcall b/deps/glslang/Test/spv.RayCallable_Errors.rcall new file mode 100644 index 00000000..73396825 --- /dev/null +++ b/deps/glslang/Test/spv.RayCallable_Errors.rcall @@ -0,0 +1,25 @@ +#version 460 +#extension GL_NV_ray_tracing : enable +hitAttributeNV vec4 hitattr; // ERROR, hitattributeNV unsupported in this stage +rayPayloadNV vec4 payload; // ERROR, rayPayloadNV unsupported in this stage +rayPayloadInNV vec4 payloadIn; // ERROR, rayPayloadInNV unsupported in this stage + +void main() +{ + int e0 = gl_PrimitiveID; // ERROR, unsupported builtin in stage + int e1 = gl_InstanceID; // ERROR, unsupported builtin in stage + int e3 = gl_InstanceCustomIndexNV; // ERROR, unsupported builtin in stage + vec3 e4 = gl_WorldRayOriginNV; // ERROR, unsupported builtin in stage + vec3 e5 = gl_WorldRayDirectionNV; // ERROR, unsupported builtin in stage + vec3 e6 = gl_ObjectRayOriginNV; // ERROR, unsupported builtin in stage + vec3 e7 = gl_ObjectRayDirectionNV; // ERROR, unsupported builtin in stage + float e8 = gl_RayTminNV; // ERROR, unsupported builtin in stage + float e9 = gl_RayTmaxNV; // ERROR, unsupported builtin in stage + mat4x3 e10 = gl_ObjectToWorldNV; // ERROR, unsupported builtin in stage + mat4x3 e11 = gl_WorldToObjectNV; // ERROR, unsupported builtin in stage + float e12 = gl_HitTNV; // ERROR, unsupported builtin in stage + float e13 = gl_HitKindNV; // ERROR, unsupported builtin in stage + reportIntersectionNV(1.0, 1U); // ERROR, unsupported builtin in stage + ignoreIntersectionNV(); // ERROR, unsupported builtin in stage + terminateRayNV(); // ERROR, unsupported builtin in stage +} diff --git a/deps/glslang/Test/spv.RayConstants.rgen b/deps/glslang/Test/spv.RayConstants.rgen new file mode 100644 index 00000000..b8ff5d5f --- /dev/null +++ b/deps/glslang/Test/spv.RayConstants.rgen @@ -0,0 +1,15 @@ +#version 460 +#extension GL_NV_ray_tracing : enable +layout(binding = 0, set = 0) uniform accelerationStructureNV accNV; +layout(location = 0) rayPayloadNV vec4 payload; +void main() +{ + const uint rayFlags = gl_RayFlagsNoneNV | gl_RayFlagsOpaqueNV | + gl_RayFlagsNoOpaqueNV | gl_RayFlagsTerminateOnFirstHitNV | + gl_RayFlagsSkipClosestHitShaderNV | gl_RayFlagsCullBackFacingTrianglesNV | + gl_RayFlagsCullFrontFacingTrianglesNV | gl_RayFlagsCullOpaqueNV | + gl_RayFlagsCullNoOpaqueNV; + + const int payloadId = 1; + traceNV(accNV, rayFlags, 0, 1, 1, 0, vec3(0.0f), 0.5f, vec3(1.0f), 0.75f, payloadId); +} diff --git a/deps/glslang/Test/spv.RayGenShader.rgen b/deps/glslang/Test/spv.RayGenShader.rgen new file mode 100644 index 00000000..68f92b22 --- /dev/null +++ b/deps/glslang/Test/spv.RayGenShader.rgen @@ -0,0 +1,19 @@ +#version 460 +#extension GL_NV_ray_tracing : enable +layout(binding = 0, set = 0) uniform accelerationStructureNV accNV; +layout(location = 0) rayPayloadNV vec4 payload; +layout(shaderRecordNV) buffer block +{ + float arr[4]; + vec4 pad; +}; +void main() +{ + uint lx = gl_LaunchIDNV.x; + uint ly = gl_LaunchIDNV.y; + uint sx = gl_LaunchSizeNV.x; + uint sy = gl_LaunchSizeNV.y; + traceNV(accNV, lx, ly, sx, sy, 0u, vec3(0.0f), 0.5f, vec3(1.0f), 0.75f, 1); + arr[3] = 1.0f; + pad = payload; +} diff --git a/deps/glslang/Test/spv.RayGenShader_Errors.rgen b/deps/glslang/Test/spv.RayGenShader_Errors.rgen new file mode 100644 index 00000000..d61ac21c --- /dev/null +++ b/deps/glslang/Test/spv.RayGenShader_Errors.rgen @@ -0,0 +1,40 @@ +#version 460 +#extension GL_NV_ray_tracing : enable +hitAttributeNV vec4 payload; // ERROR, hitattributeNV unsupported in this stage +rayPayloadInNV vec4 payloadIn; // ERROR, rayPayloadIn unsupported in this stage +layout(shaderRecordNV) uniform ublock // ERROR, shaderRecordNV unsupported on uniform blocks +{ + float a; +}; +layout(binding = 0, shaderRecordNV) buffer bblock { // ERROR, binding unsupported on shaderRecordNV blocks + float b; +}; +layout(set = 0, shaderRecordNV) buffer bblock2 { // ERROR, set unsupported on shaderRecordNV blocks + float c; +}; +layout(shaderRecordNV) buffer bblock3 { + float d; +}; +layout(shaderRecordNV) buffer bblock4 { // ERROR, cannot have more than one shaderRecordNVX block + float e; +}; +void main() +{ + accelerationStructureNV a = 0; + int e0 = gl_PrimitiveID; // ERROR, unsupported builtin in stage + int e1 = gl_InstanceID; // ERROR, unsupported builtin in stage + int e3 = gl_InstanceCustomIndexNV; // ERROR, unsupported builtin in stage + vec3 e4 = gl_WorldRayOriginNV; // ERROR, unsupported builtin in stage + vec3 e5 = gl_WorldRayDirectionNV; // ERROR, unsupported builtin in stage + vec3 e6 = gl_ObjectRayOriginNV; // ERROR, unsupported builtin in stage + vec3 e7 = gl_ObjectRayDirectionNV; // ERROR, unsupported builtin in stage + float e8 = gl_RayTminNV; // ERROR, unsupported builtin in stage + float e9 = gl_RayTmaxNV; // ERROR, unsupported builtin in stage + mat4x3 e10 = gl_ObjectToWorldNV; // ERROR, unsupported builtin in stage + mat4x3 e11 = gl_WorldToObjectNV; // ERROR, unsupported builtin in stage + float e12 = gl_HitTNV; // ERROR, unsupported builtin in stage + float e13 = gl_HitKindNV; // ERROR, unsupported builtin in stage + reportIntersectionNV(1.0, 1U); // ERROR, unsupported builtin in stage + ignoreIntersectionNV(); // ERROR, unsupported builtin in stage + terminateRayNV(); // ERROR, unsupported builtin in stage +} diff --git a/deps/glslang/Test/spv.accessChain.frag b/deps/glslang/Test/spv.accessChain.frag new file mode 100644 index 00000000..3f4929b6 --- /dev/null +++ b/deps/glslang/Test/spv.accessChain.frag @@ -0,0 +1,100 @@ +#version 420 + +struct S +{ + vec3 color; +}; + +layout(location = 0) out vec3 OutColor; + +flat in int u; + +void GetColor1(const S i) +{ + OutColor += i.color.x; +} + +void GetColor2(const S i, int comp) +{ + OutColor += i.color[comp]; +} + +void GetColor3(const S i, int comp) +{ + OutColor += i.color[comp].x; +} + +void GetColor4(const S i, int comp) +{ + OutColor += i.color[comp].x; +} + +void GetColor5(const S i, int comp) +{ + OutColor += i.color; +} + +void GetColor6(const S i, int comp) +{ + OutColor += i.color.yx[comp]; +} + +void GetColor7(const S i, int comp) +{ + OutColor.xy += i.color.yxz.yx; +} + +void GetColor8(const S i, int comp) +{ + OutColor += i.color.yzx.yx.x.x; +} + +void GetColor9(const S i, int comp) +{ + OutColor.zxy += i.color; +} + +void GetColor10(const S i, int comp) +{ + OutColor.zy += i.color.xy; +} + +void GetColor11(const S i, int comp) +{ + OutColor.zxy.yx += i.color.xy; +} + +void GetColor12(const S i, int comp) +{ + OutColor[comp] += i.color.x; +} + +void GetColor13(const S i, int comp) +{ + OutColor.zy[comp] += i.color.x; +} + +void GetColor14(const S i, int comp) +{ + OutColor.zyx[comp] = i.color.x; +} + +void main() +{ + S s; + OutColor = vec3(0.0); + GetColor1(s); + GetColor2(s, u); + GetColor3(s, u); + GetColor4(s, u); + GetColor5(s, u); + GetColor6(s, u); + GetColor7(s, u); + GetColor8(s, u); + GetColor9(s, u); + GetColor10(s, u); + GetColor11(s, u); + GetColor12(s, u); + GetColor13(s, u); + GetColor14(s, u); +} diff --git a/deps/glslang/Test/spv.aggOps.frag b/deps/glslang/Test/spv.aggOps.frag new file mode 100644 index 00000000..bc34d7ac --- /dev/null +++ b/deps/glslang/Test/spv.aggOps.frag @@ -0,0 +1,51 @@ +#version 450 + +uniform sampler2D samp2D; +in mediump vec2 coord; + +in vec4 u, w; +out vec4 color; + +struct s1 { + int i; + float f; +}; + +struct s2 { + int i; + float f; + s1 s1_1; +}; + +layout(std140) uniform ub1 { s2 foo2a; } uName1; +layout(std430) buffer ub2 { s2 foo2b; } uName2; + +void main() +{ + vec4 v; + s1 a[3], b[3]; + a = s1[3](s1(int(u.x), u.y), s1(int(u.z), u.w), s1(14, 14.0)); + b = s1[3](s1(17, 17.0), s1(int(w.x), w.y), s1(int(w.z), w.w)); + + if (uName1.foo2a == uName2.foo2b) + v = texture(samp2D, coord); + else + v = texture(samp2D, 2.0*coord); + + if (u == v) + v *= 3.0; + + if (u != v) + v *= 4.0; + + if (coord == v.yw) + v *= 5.0; + + if (a == b) + v *= 6.0; + + if (a != b) + v *= 7.0; + + color = v; +} diff --git a/deps/glslang/Test/spv.always-discard.frag b/deps/glslang/Test/spv.always-discard.frag new file mode 100644 index 00000000..6cd4d04f --- /dev/null +++ b/deps/glslang/Test/spv.always-discard.frag @@ -0,0 +1,36 @@ +#version 140 +in vec2 tex_coord; + +void main (void) +{ + vec4 white = vec4(1.0); + vec4 black = vec4(0.2); + vec4 color = white; + + // First, cut out our circle + float x = tex_coord.x*2.0 - 1.0; + float y = tex_coord.y*2.0 - 1.0; + + float radius = sqrt(x*x + y*y); + if (radius > 1.0) { + if (radius > 1.1) { + ++color; + } + + gl_FragColor = color; + + if (radius > 1.2) { + ++color; + } + + } + + discard; + + // If we're near an edge, darken us a tiny bit + if (radius >= 0.75) + color -= abs(pow(radius, 16.0)/2.0); + + gl_FragColor = color; + +} diff --git a/deps/glslang/Test/spv.always-discard2.frag b/deps/glslang/Test/spv.always-discard2.frag new file mode 100644 index 00000000..2b125f32 --- /dev/null +++ b/deps/glslang/Test/spv.always-discard2.frag @@ -0,0 +1,19 @@ +#version 140 +in vec2 tex_coord; + +void main (void) +{ + vec4 white = vec4(1.0); + vec4 black = vec4(0.2); + vec4 color = white; + + // First, cut out our circle + float x = tex_coord.x*2.0 - 1.0; + float y = tex_coord.y*2.0 - 1.0; + + discard; + + + gl_FragColor = color; + +} diff --git a/deps/glslang/Test/spv.arbPostDepthCoverage.frag b/deps/glslang/Test/spv.arbPostDepthCoverage.frag new file mode 100644 index 00000000..03b61cb5 --- /dev/null +++ b/deps/glslang/Test/spv.arbPostDepthCoverage.frag @@ -0,0 +1,13 @@ +#version 450 + +#extension GL_ARB_post_depth_coverage : enable +#extension GL_EXT_post_depth_coverage : enable //according to ARB_post_depth_coverage, + //if both enabled, this one should be ignored +precision highp int; +layout(post_depth_coverage) in; + +layout (location = 0) out int readSampleMaskIn; + +void main () { + readSampleMaskIn = gl_SampleMaskIn[0]; +} diff --git a/deps/glslang/Test/spv.arbPostDepthCoverage_Error.frag b/deps/glslang/Test/spv.arbPostDepthCoverage_Error.frag new file mode 100644 index 00000000..652933b8 --- /dev/null +++ b/deps/glslang/Test/spv.arbPostDepthCoverage_Error.frag @@ -0,0 +1,12 @@ +#version 310 es + +#extension GL_ARB_post_depth_coverage : enable + +precision highp float; + +layout(post_depth_coverage, location = 0) in float a; // should fail since post_depth_coverage may only + // be declared on in only (not with variable declarations) + +void main () { + +} diff --git a/deps/glslang/Test/spv.atomic.comp b/deps/glslang/Test/spv.atomic.comp new file mode 100644 index 00000000..8ab846e4 --- /dev/null +++ b/deps/glslang/Test/spv.atomic.comp @@ -0,0 +1,48 @@ +#version 450 + + + +layout(binding = 0) uniform atomic_uint counter; + +layout(binding = 0, offset = 4) uniform atomic_uint countArr[4]; +shared uint value; + +int arrX[gl_WorkGroupSize.x]; +int arrY[gl_WorkGroupSize.y]; +int arrZ[gl_WorkGroupSize.z]; + +uint func(atomic_uint c) +{ + return atomicCounterIncrement(c); +} + +void main() +{ + memoryBarrierAtomicCounter(); + func(counter); + uint val = atomicCounter(countArr[2]); + atomicCounterDecrement(counter); + atomicCounterIncrement(counter); +} + +shared int atomi; +shared uint atomu; + +layout (std140, binding = 0) restrict buffer dataSSB +{ + float f; + ivec4 n_frames_rendered; +} result; + +void atoms() +{ + int origi = atomicAdd(atomi, 3); + uint origu = atomicAnd(atomu, value); + origu = atomicOr(atomu, 7u); + origu = atomicXor(atomu, 7u); + origu = atomicMin(atomu, value); + origi = atomicMax(atomi, 7); + origi = atomicExchange(atomi, origi); + origu = atomicCompSwap(atomu, 10u, value); + atomicAdd(result.n_frames_rendered.z, 1); +} diff --git a/deps/glslang/Test/spv.atomicInt64.comp b/deps/glslang/Test/spv.atomicInt64.comp new file mode 100644 index 00000000..baca4cef --- /dev/null +++ b/deps/glslang/Test/spv.atomicInt64.comp @@ -0,0 +1,79 @@ +#version 450 core + +#extension GL_ARB_gpu_shader_int64: enable +#extension GL_NV_shader_atomic_int64: enable + +layout(local_size_x = 16, local_size_y = 16) in; + +layout(binding = 0) buffer Buffer +{ + int64_t i64; + uint64_t u64; +} buf; + +struct Struct +{ + int64_t i64; + uint64_t u64; +}; + +shared Struct s; + +void main() +{ + const int64_t i64c = -24; + const uint64_t u64c = 0xF00000000Ful; + + // Test shader storage block + int64_t i64 = 0; + uint64_t u64 = 0; + + i64 += atomicMin(buf.i64, i64c); + u64 += atomicMin(buf.u64, u64c); + + i64 += atomicMax(buf.i64, i64c); + u64 += atomicMax(buf.u64, u64c); + + i64 += atomicAnd(buf.i64, i64c); + u64 += atomicAnd(buf.u64, u64c); + + i64 += atomicOr(buf.i64, i64c); + u64 += atomicOr(buf.u64, u64c); + + i64 += atomicXor(buf.i64, i64c); + u64 += atomicXor(buf.u64, u64c); + + i64 += atomicAdd(buf.i64, i64c); + i64 += atomicExchange(buf.i64, i64c); + i64 += atomicCompSwap(buf.i64, i64c, i64); + + buf.i64 = i64; + buf.u64 = u64; + + // Test shared variable + i64 = 0; + u64 = 0; + + i64 += atomicMin(s.i64, i64c); + u64 += atomicMin(s.u64, u64c); + + i64 += atomicMax(s.i64, i64c); + u64 += atomicMax(s.u64, u64c); + + i64 += atomicAnd(s.i64, i64c); + u64 += atomicAnd(s.u64, u64c); + + i64 += atomicOr(s.i64, i64c); + u64 += atomicOr(s.u64, u64c); + + i64 += atomicXor(s.i64, i64c); + u64 += atomicXor(s.u64, u64c); + + i64 += atomicAdd(s.i64, i64c); + i64 += atomicExchange(s.i64, i64c); + i64 += atomicCompSwap(s.i64, i64c, i64); + + s.i64 = i64; + s.u64 = u64; +} + diff --git a/deps/glslang/Test/spv.barrier.vert b/deps/glslang/Test/spv.barrier.vert new file mode 100644 index 00000000..c7828ce7 --- /dev/null +++ b/deps/glslang/Test/spv.barrier.vert @@ -0,0 +1,15 @@ +#version 450 + +layout(location=0) out vec4 c0; +layout(location=1) out vec4 c1; + +void main() +{ + c0 = vec4(1.0); + memoryBarrier(); + c1 = vec4(1.0); + memoryBarrierBuffer(); + ++c0; + memoryBarrierImage(); + ++c0; +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.bitCast.frag b/deps/glslang/Test/spv.bitCast.frag new file mode 100644 index 00000000..73c7e303 --- /dev/null +++ b/deps/glslang/Test/spv.bitCast.frag @@ -0,0 +1,45 @@ +#version 450 + +flat in int i1; +flat in ivec2 i2; +flat in ivec3 i3; +flat in ivec4 i4; + +flat in uint u1; +flat in uvec2 u2; +flat in uvec3 u3; +flat in uvec4 u4; + +in float f1; +in vec2 f2; +in vec3 f3; +in vec4 f4; + +out vec4 fragColor; + +void main() +{ + ivec4 idata = ivec4(0); + idata.x += floatBitsToInt(f1); + idata.xy += floatBitsToInt(f2); + idata.xyz += floatBitsToInt(f3); + idata += floatBitsToInt(f4); + + uvec4 udata = uvec4(0); + udata.x += floatBitsToUint(f1); + udata.xy += floatBitsToUint(f2); + udata.xyz += floatBitsToUint(f3); + udata += floatBitsToUint(f4); + + vec4 fdata = vec4(0.0); + fdata.x += intBitsToFloat(i1); + fdata.xy += intBitsToFloat(i2); + fdata.xyz += intBitsToFloat(i3); + fdata += intBitsToFloat(i4); + fdata.x += uintBitsToFloat(u1); + fdata.xy += uintBitsToFloat(u2); + fdata.xyz += uintBitsToFloat(u3); + fdata += uintBitsToFloat(u4); + + fragColor = (idata == udata) ? fdata : fdata + vec4(0.2); +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.bool.vert b/deps/glslang/Test/spv.bool.vert new file mode 100644 index 00000000..f58bc55d --- /dev/null +++ b/deps/glslang/Test/spv.bool.vert @@ -0,0 +1,17 @@ +#version 450 + +const bool condition = false; + +uniform ubname { + bool b; +} ubinst; + +bool foo(bool b) +{ + return b != condition; +} + +void main() +{ + gl_Position = foo(ubinst.b) ? vec4(0.0) : vec4(1.0); +} diff --git a/deps/glslang/Test/spv.boolInBlock.frag b/deps/glslang/Test/spv.boolInBlock.frag new file mode 100644 index 00000000..a4f62fae --- /dev/null +++ b/deps/glslang/Test/spv.boolInBlock.frag @@ -0,0 +1,31 @@ +#version 450 + +layout(binding = 0, std140) uniform Uniform +{ + bvec4 b4; +}; + +layout(binding = 1, std430) buffer Buffer +{ + bvec2 b2; +}; + +void foo(bvec4 paramb4, out bvec2 paramb2) +{ + bool b1 = paramb4.z; + paramb2 = bvec2(b1); +} + +layout(location = 0) out vec4 fragColor; + +void main() +{ + b2 = bvec2(0.0); + if (b4.z) + b2 = bvec2(b4.x); + if (b2.x) + foo(b4, b2); + + fragColor = vec4(b4.x && b4.y); + fragColor -= vec4(b4.x || b4.y); +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.branch-return.vert b/deps/glslang/Test/spv.branch-return.vert new file mode 100644 index 00000000..4b2f5d44 --- /dev/null +++ b/deps/glslang/Test/spv.branch-return.vert @@ -0,0 +1,10 @@ +#version 310 es +void main() { + switch (gl_InstanceIndex) { + case 0: return; + case 1: gl_Position = vec4(0.0); break; + case 2: return; + case 3: return; + } + gl_Position.x += 0.123; +} diff --git a/deps/glslang/Test/spv.buffer.autoassign.frag b/deps/glslang/Test/spv.buffer.autoassign.frag new file mode 100644 index 00000000..46442609 --- /dev/null +++ b/deps/glslang/Test/spv.buffer.autoassign.frag @@ -0,0 +1,28 @@ + +cbuffer MyUB1 : register(b5) // explicitly assigned & offsetted +{ + float g_a; + int g_b; +}; + +cbuffer MyUB2 // implicitly assigned +{ + float g_c; +}; + +cbuffer MyUB3 // implicitly assigned +{ + float g_d; +}; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + psout.Color = g_a + g_b + g_c + g_d; + return psout; +} diff --git a/deps/glslang/Test/spv.builtInXFB.vert b/deps/glslang/Test/spv.builtInXFB.vert new file mode 100644 index 00000000..619bc1e2 --- /dev/null +++ b/deps/glslang/Test/spv.builtInXFB.vert @@ -0,0 +1,15 @@ +#version 450 + +layout(xfb_buffer = 1, xfb_stride = 64) out; + +layout (xfb_buffer = 1, xfb_offset = 16) out gl_PerVertex +{ + float gl_PointSize; + vec4 gl_Position; +}; + +void main() +{ + gl_Position = vec4(1.0); + gl_PointSize = 2.0; +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.computeShaderDerivatives.comp b/deps/glslang/Test/spv.computeShaderDerivatives.comp new file mode 100644 index 00000000..884f14d5 --- /dev/null +++ b/deps/glslang/Test/spv.computeShaderDerivatives.comp @@ -0,0 +1,106 @@ +#version 450 +#extension GL_NV_compute_shader_derivatives : require + +layout (local_size_x = 2, local_size_y = 4) in; +layout(derivative_group_quadsNV) in; + +buffer block { + float fDerivativeX; + float fDerivativeY; + float fDerivativeWidth; + float fCoarseDerivativeX; + float fCoarseDerivativeY; + float fCoarseDerivativeWidth; + float fFineDerivativeX; + float fFineDerivativeY; + float fFineDerivativeWidth; + + float fX; + float fY; + + + vec2 v2DerivativeX; + vec2 v2DerivativeY; + vec2 v2DerivativeWidth; + vec2 v2CoarseDerivativeX; + vec2 v2CoarseDerivativeY; + vec2 v2CoarseDerivativeWidth; + vec2 v2FineDerivativeX; + vec2 v2FineDerivativeY; + vec2 v2FineDerivativeWidth; + + vec2 v2X; + vec2 v2Y; + + + vec3 v3DerivativeX; + vec3 v3DerivativeY; + vec3 v3DerivativeWidth; + vec3 v3CoarseDerivativeX; + vec3 v3CoarseDerivativeY; + vec3 v3CoarseDerivativeWidth; + vec3 v3FineDerivativeX; + vec3 v3FineDerivativeY; + vec3 v3FineDerivativeWidth; + + vec3 v3X; + vec3 v3Y; + + + vec4 v4DerivativeX; + vec4 v4DerivativeY; + vec4 v4DerivativeWidth; + vec4 v4CoarseDerivativeX; + vec4 v4CoarseDerivativeY; + vec4 v4CoarseDerivativeWidth; + vec4 v4FineDerivativeX; + vec4 v4FineDerivativeY; + vec4 v4FineDerivativeWidth; + + vec4 v4X; + vec4 v4Y; +}; + +void main(){ + fDerivativeX = dFdx(fX); + fDerivativeY = dFdy(fY); + fDerivativeWidth = fwidth(fX); + fCoarseDerivativeX = dFdxCoarse(fX); + fCoarseDerivativeY = dFdyCoarse(fY); + fCoarseDerivativeWidth = fwidthCoarse(fX); + fFineDerivativeX = dFdxFine(fX); + fFineDerivativeY = dFdyFine(fY); + fFineDerivativeWidth = fwidthFine(fX); + + v2DerivativeX = dFdx(v2X); + v2DerivativeY = dFdy(v2Y); + v2DerivativeWidth = fwidth(v2X); + v2CoarseDerivativeX = dFdxCoarse(v2X); + v2CoarseDerivativeY = dFdyCoarse(v2Y); + v2CoarseDerivativeWidth = fwidthCoarse(v2X); + v2FineDerivativeX = dFdxFine(v2X); + v2FineDerivativeY = dFdyFine(v2Y); + v2FineDerivativeWidth = fwidthFine(v2X); + + + v3DerivativeX = dFdx(v3X); + v3DerivativeY = dFdy(v3Y); + v3DerivativeWidth = fwidth(v3X); + v3CoarseDerivativeX = dFdxCoarse(v3X); + v3CoarseDerivativeY = dFdyCoarse(v3Y); + v3CoarseDerivativeWidth = fwidthCoarse(v3X); + v3FineDerivativeX = dFdxFine(v3X); + v3FineDerivativeY = dFdyFine(v3Y); + v3FineDerivativeWidth = fwidthFine(v3X); + + + v4DerivativeX = dFdx(v4X); + v4DerivativeY = dFdy(v4Y); + v4DerivativeWidth = fwidth(v4X); + v4CoarseDerivativeX = dFdxCoarse(v4X); + v4CoarseDerivativeY = dFdyCoarse(v4Y); + v4CoarseDerivativeWidth = fwidthCoarse(v4X); + v4FineDerivativeX = dFdxFine(v4X); + v4FineDerivativeY = dFdyFine(v4Y); + v4FineDerivativeWidth = fwidthFine(v4X); +} diff --git a/deps/glslang/Test/spv.computeShaderDerivatives2.comp b/deps/glslang/Test/spv.computeShaderDerivatives2.comp new file mode 100644 index 00000000..f964fdd1 --- /dev/null +++ b/deps/glslang/Test/spv.computeShaderDerivatives2.comp @@ -0,0 +1,106 @@ +#version 320 es +#extension GL_NV_compute_shader_derivatives : require + +layout (local_size_x = 2, local_size_y = 4) in; +layout(derivative_group_linearNV) in; + +buffer block { + float fDerivativeX; + float fDerivativeY; + float fDerivativeWidth; + float fCoarseDerivativeX; + float fCoarseDerivativeY; + float fCoarseDerivativeWidth; + float fFineDerivativeX; + float fFineDerivativeY; + float fFineDerivativeWidth; + + float fX; + float fY; + + + vec2 v2DerivativeX; + vec2 v2DerivativeY; + vec2 v2DerivativeWidth; + vec2 v2CoarseDerivativeX; + vec2 v2CoarseDerivativeY; + vec2 v2CoarseDerivativeWidth; + vec2 v2FineDerivativeX; + vec2 v2FineDerivativeY; + vec2 v2FineDerivativeWidth; + + vec2 v2X; + vec2 v2Y; + + + vec3 v3DerivativeX; + vec3 v3DerivativeY; + vec3 v3DerivativeWidth; + vec3 v3CoarseDerivativeX; + vec3 v3CoarseDerivativeY; + vec3 v3CoarseDerivativeWidth; + vec3 v3FineDerivativeX; + vec3 v3FineDerivativeY; + vec3 v3FineDerivativeWidth; + + vec3 v3X; + vec3 v3Y; + + + vec4 v4DerivativeX; + vec4 v4DerivativeY; + vec4 v4DerivativeWidth; + vec4 v4CoarseDerivativeX; + vec4 v4CoarseDerivativeY; + vec4 v4CoarseDerivativeWidth; + vec4 v4FineDerivativeX; + vec4 v4FineDerivativeY; + vec4 v4FineDerivativeWidth; + + vec4 v4X; + vec4 v4Y; +}; + +void main(){ + fDerivativeX = dFdx(fX); + fDerivativeY = dFdy(fY); + fDerivativeWidth = fwidth(fX); + fCoarseDerivativeX = dFdxCoarse(fX); + fCoarseDerivativeY = dFdyCoarse(fY); + fCoarseDerivativeWidth = fwidthCoarse(fX); + fFineDerivativeX = dFdxFine(fX); + fFineDerivativeY = dFdyFine(fY); + fFineDerivativeWidth = fwidthFine(fX); + + v2DerivativeX = dFdx(v2X); + v2DerivativeY = dFdy(v2Y); + v2DerivativeWidth = fwidth(v2X); + v2CoarseDerivativeX = dFdxCoarse(v2X); + v2CoarseDerivativeY = dFdyCoarse(v2Y); + v2CoarseDerivativeWidth = fwidthCoarse(v2X); + v2FineDerivativeX = dFdxFine(v2X); + v2FineDerivativeY = dFdyFine(v2Y); + v2FineDerivativeWidth = fwidthFine(v2X); + + + v3DerivativeX = dFdx(v3X); + v3DerivativeY = dFdy(v3Y); + v3DerivativeWidth = fwidth(v3X); + v3CoarseDerivativeX = dFdxCoarse(v3X); + v3CoarseDerivativeY = dFdyCoarse(v3Y); + v3CoarseDerivativeWidth = fwidthCoarse(v3X); + v3FineDerivativeX = dFdxFine(v3X); + v3FineDerivativeY = dFdyFine(v3Y); + v3FineDerivativeWidth = fwidthFine(v3X); + + + v4DerivativeX = dFdx(v4X); + v4DerivativeY = dFdy(v4Y); + v4DerivativeWidth = fwidth(v4X); + v4CoarseDerivativeX = dFdxCoarse(v4X); + v4CoarseDerivativeY = dFdyCoarse(v4Y); + v4CoarseDerivativeWidth = fwidthCoarse(v4X); + v4FineDerivativeX = dFdxFine(v4X); + v4FineDerivativeY = dFdyFine(v4Y); + v4FineDerivativeWidth = fwidthFine(v4X); +} diff --git a/deps/glslang/Test/spv.conditionalDiscard.frag b/deps/glslang/Test/spv.conditionalDiscard.frag new file mode 100644 index 00000000..ea803374 --- /dev/null +++ b/deps/glslang/Test/spv.conditionalDiscard.frag @@ -0,0 +1,14 @@ +#version 400 + +uniform sampler2D tex; +in vec2 coord; + +void main (void) +{ + vec4 v = texture(tex, coord); + + if (v == vec4(0.1,0.2,0.3,0.4)) + discard; + + gl_FragColor = v; +} diff --git a/deps/glslang/Test/spv.constStruct.vert b/deps/glslang/Test/spv.constStruct.vert new file mode 100644 index 00000000..d5dd8da9 --- /dev/null +++ b/deps/glslang/Test/spv.constStruct.vert @@ -0,0 +1,22 @@ +#version 450 + +precision highp float; + +struct U { + mat2 m; +}; + +struct T { + mat2 m; +}; + +struct S { + T t; + U u; +}; + +void main() +{ + S s1 = S(T(mat2(1.0)), U(mat2(1.0))); + S s2 = S(T(mat2(1.0)), U(mat2(1.0))); +} diff --git a/deps/glslang/Test/spv.controlFlowAttributes.frag b/deps/glslang/Test/spv.controlFlowAttributes.frag new file mode 100644 index 00000000..6d90c0db --- /dev/null +++ b/deps/glslang/Test/spv.controlFlowAttributes.frag @@ -0,0 +1,39 @@ +#version 450 + +#extension GL_EXT_control_flow_attributes : enable + +bool cond; + +void main() +{ + [[unroll]] for (int i = 0; i < 8; ++i) { } + [[loop]] for (;;) { } + [[dont_unroll]] while(true) { } + [[dependency_infinite]] do { } while(true); + [[dependency_length(1+3)]] for (int i = 0; i < 8; ++i) { } + [[flatten]] if (cond) { } else { } + [[branch]] if (cond) cond = false; + [[dont_flatten]] switch(3) { } // dropped + [[dont_flatten]] switch(3) { case 3: break; } + + // warnings on all these + [[unroll(2)]] for (int i = 0; i < 8; ++i) { } + [[dont_unroll(-2)]] while(true) { } + [[dependency_infinite(3)]] do { } while(true); + [[dependency_length]] for (int i = 0; i < 8; ++i) { } + [[flatten(3)]] if (cond) { } else { } + [[branch(5.2)]] if (cond) cond = false; + [[dont_flatten(3 + 7)]] switch(3) { case 3: break; } + + // other valid uses + [[ unroll, dont_unroll, dependency_length(2) ]] while(cond) { } + [ [ dont_flatten , branch ] ] switch(3) { case 3: break; } + [ + // attribute + [ + // here + flatten + ] + ] if (cond) { } else { } + [[ dependency_length(2), dependency_infinite ]] while(cond) { } +} diff --git a/deps/glslang/Test/spv.conversion.frag b/deps/glslang/Test/spv.conversion.frag new file mode 100644 index 00000000..3b5e5123 --- /dev/null +++ b/deps/glslang/Test/spv.conversion.frag @@ -0,0 +1,112 @@ +#version 140 + +bool u_b; +bvec2 u_b2; +bvec3 u_b3; +bvec4 u_b4; + +int u_i; +ivec2 u_i2; +ivec3 u_i3; +ivec4 u_i4; + +float u_f; +vec2 u_f2; +vec3 u_f3; +vec4 u_f4; + +bool i_b; +bvec2 i_b2; +bvec3 i_b3; +bvec4 i_b4; + +flat in int i_i; +flat in ivec2 i_i2; +flat in ivec3 i_i3; +flat in ivec4 i_i4; + +in float i_f; +in vec2 i_f2; +in vec3 i_f3; +in vec4 i_f4; + +void main() +{ + bool b = bool(u_i) ^^ bool(u_f); + bvec2 b2 = bvec2(u_i, u_f); + bvec3 b3 = bvec3(u_i, u_f, i_i); + bvec4 b4 = bvec4(u_i, u_f, i_i, i_f); + + int i = int(u_f) + int(b); + ivec2 i2 = ivec2(u_f2) + ivec2(b2); + ivec3 i3 = ivec3(u_f3) + ivec3(b3); + ivec4 i4 = ivec4(u_f4) + ivec4(b4); + + float f = i; + vec2 f2 = i2; + vec3 f3 = i3; + vec4 f4 = i4; + + f += (float(i) + float(b)); + f2 -= vec2(i2) + vec2(b2); + f3 /= vec3(i3) + vec3(b3); + f4 += vec4(i4) + vec4(b4); + + f4 += vec4(bvec4(i_i4)); + f4 += vec4(bvec4(u_f4)); + + f += f - i; + f2 += vec2(f, i) + i2; + f3 += i3 + vec3(f, i, f); + f4 += vec4(b, i, f, i) + i4; + + f2 += vec2(f, i) * i; + f3 += vec3(f, i, f) + i; + f4 += i - vec4(b, i, f, i); + + i2 += ivec2(f, i); + i3 += ivec3(f, i, f); + i4 += ivec4(b, i, f, i); + + if (f < i || i < f || + f2 == i2 || + i3 != f3) + f = (b ? i : f2.x) + (b2.x ? f3.x : i2.y); + + gl_FragColor = + b || + b2.x || + b2.y || + b3.x || + b3.y || + b3.z || + b4.x || + b4.y || + b4.z || + b4.w ? vec4( + i + + i2.x + + i2.y + + i3.x + + i3.y + + i3.z + + i4.x + + i4.y + + i4.z + + i4.w + + f + + f2.x + + f2.y + + f3.x + + f3.y + + f3.z + + f4.x + + f4.y + + f4.z + + f4.w) : vec4(1.0); + + // with constants... + ivec4 cv2 = ivec4(1.0); + bvec4 cv5 = bvec4(cv2); + gl_FragColor += float(cv5); +} diff --git a/deps/glslang/Test/spv.dataOut.frag b/deps/glslang/Test/spv.dataOut.frag new file mode 100644 index 00000000..94c6db06 --- /dev/null +++ b/deps/glslang/Test/spv.dataOut.frag @@ -0,0 +1,8 @@ +#version 140 + +in vec4 Color; + +void main() +{ + gl_FragData[1] = Color; +} diff --git a/deps/glslang/Test/spv.dataOutIndirect.frag b/deps/glslang/Test/spv.dataOutIndirect.frag new file mode 100644 index 00000000..88a32d58 --- /dev/null +++ b/deps/glslang/Test/spv.dataOutIndirect.frag @@ -0,0 +1,12 @@ +#version 140 + +in vec4 Color; + +out vec4 fcolor[4]; + +uniform b { int i; } bName; + +void main() +{ + fcolor[bName.i] = Color; +} diff --git a/deps/glslang/Test/spv.dataOutIndirect.vert b/deps/glslang/Test/spv.dataOutIndirect.vert new file mode 100644 index 00000000..cb6b7e0d --- /dev/null +++ b/deps/glslang/Test/spv.dataOutIndirect.vert @@ -0,0 +1,12 @@ +#version 140 + +attribute vec4 color; +out vec4 colorOut[6]; + +void main() +{ + for (int i = 1; i < 5; ++i) + colorOut[i] = color; + + gl_Position = colorOut[2]; +} diff --git a/deps/glslang/Test/spv.debugInfo.frag b/deps/glslang/Test/spv.debugInfo.frag new file mode 100644 index 00000000..3b6cd27f --- /dev/null +++ b/deps/glslang/Test/spv.debugInfo.frag @@ -0,0 +1,52 @@ +#version 450 + +struct S { + int a; +}; + +uniform ubuf { + S s; +}; + +uniform sampler2D s2d; + +layout(location = 0) in vec4 inv; +layout(location = 0) out vec4 outv; + +vec4 foo(S s) +{ + vec4 r = s.a * inv; + ++r; + if (r.x > 3.0) + --r; + else + r *= 2; + + return r; +} + +void main() +{ + outv = foo(s); + outv += texture(s2d, vec2(0.5)); + + switch (s.a) { + case 10: + ++outv; + break; + case 20: + outv = 2 * outv; + ++outv; + break; + default: + --outv; + break; + } + + for (int i = 0; i < 10; ++i) + outv *= 3.0; + + outv.x < 10.0 ? + outv = sin(outv) : + outv = cos(outv); +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.deepRvalue.frag b/deps/glslang/Test/spv.deepRvalue.frag new file mode 100644 index 00000000..2c88ca8a --- /dev/null +++ b/deps/glslang/Test/spv.deepRvalue.frag @@ -0,0 +1,36 @@ +#version 330 + +uniform sampler2D samp2D; + +vec4 v1 = vec4(2.0, 3.0, 5.0, 7.0); +vec4 v2 = vec4(11.0, 13.0, 17.0, 19.0); +vec4 v3 = vec4(23.0, 29.0, 31.0, 37.0); +vec4 v4 = vec4(41.0, 43.0, 47.0, 53.0); + +struct str { + int a; + vec2 b[3]; + bool c; +}; + +void main() +{ + mat4 m = mat4(v1, v2, v3, v4); + + mat4 mm = matrixCompMult(m, m); + float f = mm[1].w; // should be 19 * 19 = 361 + + // do a deep access to a spontaneous r-value + float g = matrixCompMult(m, m)[2].y; // should be 29 * 29 = 841 + + float h = str(1, vec2[3](vec2(2.0, 3.0), vec2(4.0, 5.0), vec2(6.0, 7.0)), true).b[1][1]; // should be 5.0 + + float i = texture(samp2D, vec2(0.5,0.5)).y; + + i += (i > 0.1 ? v1 : v2)[3]; + + str t; + i += (t = str(1, vec2[3](vec2(2.0, 3.0), vec2(4.0, 5.0), vec2(6.0, 7.0)), true)).b[2].y; // should be 7.0 + + gl_FragColor = vec4(f, g, h, i); +} diff --git a/deps/glslang/Test/spv.depthOut.frag b/deps/glslang/Test/spv.depthOut.frag new file mode 100644 index 00000000..feb8a0d4 --- /dev/null +++ b/deps/glslang/Test/spv.depthOut.frag @@ -0,0 +1,11 @@ +#version 450 + +in vec4 Color; +in float Depth; + +layout(depth_greater) out float gl_FragDepth; + +void main() +{ + gl_FragDepth = Depth; +} diff --git a/deps/glslang/Test/spv.deviceGroup.frag b/deps/glslang/Test/spv.deviceGroup.frag new file mode 100644 index 00000000..64964897 --- /dev/null +++ b/deps/glslang/Test/spv.deviceGroup.frag @@ -0,0 +1,9 @@ +#version 450 + +#extension GL_EXT_device_group : enable + +out vec4 color; + +void main() { + color = vec4(gl_DeviceIndex, 0, 0, 0); +} diff --git a/deps/glslang/Test/spv.discard-dce.frag b/deps/glslang/Test/spv.discard-dce.frag new file mode 100644 index 00000000..e824f76e --- /dev/null +++ b/deps/glslang/Test/spv.discard-dce.frag @@ -0,0 +1,35 @@ +#version 140 +in vec2 tex_coord; + +void main (void) +{ + vec4 white = vec4(1.0); + vec4 black = vec4(0.2); + vec4 color = white; + + // First, cut out our circle + float x = tex_coord.x*2.0 - 1.0; + float y = tex_coord.y*2.0 - 1.0; + + float radius = sqrt(x*x + y*y); + if (radius > 1.0) { + if (radius > 1.1) { + ++color; + } + + gl_FragColor = color; + + if (radius > 1.2) { + ++color; + } + + discard; + } + + // If we're near an edge, darken us a tiny bit + if (radius >= 0.75) + color -= abs(pow(radius, 16.0)/2.0); + + gl_FragColor = color; + +} diff --git a/deps/glslang/Test/spv.do-simple.vert b/deps/glslang/Test/spv.do-simple.vert new file mode 100644 index 00000000..77677a6d --- /dev/null +++ b/deps/glslang/Test/spv.do-simple.vert @@ -0,0 +1,7 @@ +#version 310 es +void main() { + int i = 0; + do { + i++; + } while(i<10); +} diff --git a/deps/glslang/Test/spv.do-while-continue-break.vert b/deps/glslang/Test/spv.do-while-continue-break.vert new file mode 100644 index 00000000..c085551e --- /dev/null +++ b/deps/glslang/Test/spv.do-while-continue-break.vert @@ -0,0 +1,20 @@ +#version 310 es +void main() { + int i = 0; + int A, B, C, D, E, F, G; + do { + A = 0; + if (i == 2) { + B = 1; + continue; + C = 2; + } + if (i == 5) { + D = 3; + break; + E = 42; + } + F = 99; + } while (++i < 19); + G = 12; +} diff --git a/deps/glslang/Test/spv.doWhileLoop.frag b/deps/glslang/Test/spv.doWhileLoop.frag new file mode 100644 index 00000000..5abdb61b --- /dev/null +++ b/deps/glslang/Test/spv.doWhileLoop.frag @@ -0,0 +1,16 @@ +#version 140 + +in vec4 bigColor; +in vec4 BaseColor; +in float d; + +void main() +{ + vec4 color = BaseColor; + + do { + color += bigColor; + } while (color.x < d); + + gl_FragColor = color; +} diff --git a/deps/glslang/Test/spv.double.comp b/deps/glslang/Test/spv.double.comp new file mode 100644 index 00000000..6397e630 --- /dev/null +++ b/deps/glslang/Test/spv.double.comp @@ -0,0 +1,25 @@ +#version 430 + +const double d1 = 3.1415926535897932384626433832795LF; +const double d2 = 3.1415; +const double d3 = 3.1415926535897932384626433832795LF; +const double d4 = 3.1415926535897932384626433832795; + +buffer bufName { + float f; + double d; +} bufInst; + + +uniform writeonly image2D destTex; + +void main() +{ + bufInst.d = float(d1); + bufInst.f = float(d1 + d2 + d3 + d4); + + ivec2 storePos = ivec2(gl_GlobalInvocationID.xy); + double localCoef = length(vec2(ivec2(gl_LocalInvocationID.xy)-8)/8.0); + dvec4 aa = dvec4(0.4, 0.2, 0.3, 0.4); + double globalCoef = 1.0; +} diff --git a/deps/glslang/Test/spv.drawParams.vert b/deps/glslang/Test/spv.drawParams.vert new file mode 100644 index 00000000..f2e3c1ef --- /dev/null +++ b/deps/glslang/Test/spv.drawParams.vert @@ -0,0 +1,13 @@ +#version 450 + +#extension GL_ARB_shader_draw_parameters : enable + +out vec3 pos; + +void main() +{ + int a = gl_BaseVertexARB; + int b = gl_BaseInstanceARB; + int c = gl_DrawIDARB; + pos = vec3(a, b, c); +} diff --git a/deps/glslang/Test/spv.earlyReturnDiscard.frag b/deps/glslang/Test/spv.earlyReturnDiscard.frag new file mode 100644 index 00000000..bba4b76d --- /dev/null +++ b/deps/glslang/Test/spv.earlyReturnDiscard.frag @@ -0,0 +1,102 @@ +#version 140 + +in float d; +in vec4 bigColor, smallColor; +in vec4 otherColor; + +in float c; + +in float threshhold; +in float threshhold2; +in float threshhold3; + +in float minimum; + +in vec4 BaseColor; + +bool b; + +void main() +{ + vec4 color = BaseColor; + vec4 color2; + + color2 = otherColor; + + if (c > d) + color += bigColor; + else + color += smallColor; + + if (color.z < minimum) + return; + + color.z++; + + if (color.z > threshhold) + discard; + + color++; + + // Two path, different rest + if (color.w > threshhold2) { + if (color.z > threshhold2) + return; + else if (b) + color.z++; + else { + if (color.x < minimum) { + discard; + } else { + color++; + } + } + } else { + if (b) + discard; + else + return; + } + + + // // Two path, shared rest + // if (color.w > threshhold2) { + // if (color.z > threshhold2) + // return; + // else if (b) + // color++; + // else { + // if (color.x < minimum) { + // discard; + // } else { + // color++; + // } + // } + // } else { + // if (b) + // discard; + // else + // return; + // } + + + // // One path + // if (color.w > threshhold2) { + // if (color.z > threshhold2) + // return; + // else { + // if (color.x < minimum) { + // discard; + // } else { + // color++; + // } + // } + // } else { + // if (b) + // discard; + // else + // return; + // } + + gl_FragColor = color * color2; +} diff --git a/deps/glslang/Test/spv.explicittypes.frag b/deps/glslang/Test/spv.explicittypes.frag new file mode 100644 index 00000000..18c070a7 --- /dev/null +++ b/deps/glslang/Test/spv.explicittypes.frag @@ -0,0 +1,334 @@ +#version 450 + +#extension GL_KHX_shader_explicit_arithmetic_types: enable +#extension GL_KHX_shader_explicit_arithmetic_types_int8: require +#extension GL_KHX_shader_explicit_arithmetic_types_int16: require +#extension GL_KHX_shader_explicit_arithmetic_types_int32: require +#extension GL_KHX_shader_explicit_arithmetic_types_int64: require +#extension GL_KHX_shader_explicit_arithmetic_types_float16: require +#extension GL_KHX_shader_explicit_arithmetic_types_float32: require +#extension GL_KHX_shader_explicit_arithmetic_types_float64: require + +layout(binding = 0) uniform Uniforms +{ + uint index; +}; + +layout(std140, binding = 1) uniform Block +{ + int16_t i16; + i16vec2 i16v2; + i16vec3 i16v3; + i16vec4 i16v4; + uint16_t u16; + u16vec2 u16v2; + u16vec3 u16v3; + u16vec4 u16v4; + + int32_t i32; + i32vec2 i32v2; + i32vec3 i32v3; + i32vec4 i32v4; + uint32_t u32; + u32vec2 u32v2; + u32vec3 u32v3; + u32vec4 u32v4; +} block; + +void main() +{ +} + +void literal() +{ + const int64_t i64Const[3] = + { + -0x1111111111111111l, // Hex + -1l, // Dec + 040000000000l, // Oct + }; + + int64_t i64 = i64Const[index]; + + const uint64_t u64Const[] = + { + 0xFFFFFFFFFFFFFFFFul, // Hex + 4294967296UL, // Dec + 077777777777ul, // Oct + }; + + uint64_t u64 = u64Const[index]; + + const int32_t i32Const[3] = + { + -0x11111111, // Hex + -1, // Dec + 04000000000, // Oct + }; + + int32_t i32 = i32Const[index]; + + const uint32_t u32Const[] = + { + 0xFFFFFFFF, // Hex + 4294967295, // Dec + 017777777777, // Oct + }; + + uint32_t u32 = u32Const[index]; + + const int16_t i16Const[3] = + { + int16_t(-0x1111), // Hex + int16_t(-1), // Dec + int16_t(040000), // Oct + }; + + int16_t i16 = i16Const[index]; + + const uint16_t u16Const[] = + { + uint16_t(0xFFFF), // Hex + uint16_t(65535), // Dec + uint16_t(077777), // Oct + }; + + uint16_t u16 = u16Const[index]; + + const int8_t i8Const[3] = + { + int8_t(-0x11), // Hex + int8_t(-1), // Dec + int8_t(0400), // Oct + }; + + int8_t i8 = i8Const[index]; + + const uint8_t u8Const[] = + { + uint8_t(0xFF), // Hex + uint8_t(255), // Dec + uint8_t(0177), // Oct + }; + + uint8_t u8 = u8Const[index]; +} + +void typeCast8() +{ + i8vec2 i8v; + u8vec2 u8v; + i16vec2 i16v; + u16vec2 u16v; + i32vec2 i32v; + u32vec2 u32v; + i64vec2 i64v; + u64vec2 u64v; + f16vec2 f16v; + f32vec2 f32v; + f64vec2 f64v; + bvec2 bv; + + u8v = i8v; // int8_t -> uint8_t + i16v = i8v; // int8_t -> int16_t + i16v = u8v; // uint8_t -> int16_t + i32v = i8v; // int8_t -> int32_t + i32v = u8v; // uint8_t -> int32_t + u32v = i8v; // int8_t -> uint32_t + i64v = i8v; // int8_t -> int64_t + u64v = i8v; // int8_t -> uint64_t + u32v = u8v; // uint8_t -> uint32_t + i64v = u8v; // uint8_t -> int64_t + u64v = u8v; // uint8_t -> uint64_t + f16v = i8v; // int8_t -> float16_t + f32v = i8v; // int8_t -> float32_t + f64v = i8v; // int8_t -> float64_t + f16v = u8v; // uint8_t -> float16_t + f32v = u8v; // uint8_t -> float32_t + f64v = u8v; // uint8_t -> float64_t + + i8v = i8vec2(u8v); // uint8_t -> int8_t + i16v = i16vec2(i8v); // int8_t -> int16_t + i16v = i16vec2(u8v); // uint8_t -> int16_t + i32v = i32vec2(i8v); // int8_t -> int32_t + i32v = i32vec2(u8v); // uint8_t -> int32_t + i64v = i64vec2(i8v); // int8_t -> int64_t + u64v = i64vec2(i8v); // int8_t -> uint64_t + u16v = u16vec2(i8v); // int8_t -> uint16_t + u16v = u16vec2(u8v); // uint8_t -> uint16_t + u32v = u32vec2(u8v); // uint8_t -> uint32_t + i64v = i64vec2(u8v); // uint8_t -> int64_t + u64v = i64vec2(u8v); // uint8_t -> uint64_t + f16v = f16vec2(i8v); // int8_t -> float16_t + f32v = f32vec2(i8v); // int8_t -> float32_t + f64v = f64vec2(i8v); // int8_t -> float64_t + f16v = f16vec2(u8v); // uint8_t -> float16_t + f32v = f32vec2(u8v); // uint8_t -> float32_t + f64v = f64vec2(u8v); // uint8_t -> float64_t + + i8v = i8vec2(bv); // bool -> int8 + u8v = u8vec2(bv); // bool -> uint8 + bv = bvec2(i8v); // int8 -> bool + bv = bvec2(u8v); // uint8 -> bool +} + +void typeCast16() +{ + i8vec2 i8v; + u8vec2 u8v; + i16vec2 i16v; + u16vec2 u16v; + i32vec2 i32v; + u32vec2 u32v; + i64vec2 i64v; + u64vec2 u64v; + f16vec2 f16v; + f32vec2 f32v; + f64vec2 f64v; + bvec2 bv; + + i32v = i16v; // int16_t -> int32_t + i32v = u16v; // uint16_t -> int32_t + u16v = i16v; // int16_t -> uint16_t + u32v = i16v; // int16_t -> uint32_t + i64v = i16v; // int16_t -> int64_t + u64v = i16v; // int16_t -> uint64_t + u32v = u16v; // uint16_t -> uint32_t + i64v = u16v; // uint16_t -> int64_t + u64v = u16v; // uint16_t -> uint64_t + f16v = i16v; // int16_t -> float16_t + f32v = i16v; // int16_t -> float32_t + f64v = i16v; // int16_t -> float64_t + f16v = u16v; // uint16_t -> float16_t + f32v = u16v; // uint16_t -> float32_t + f64v = u16v; // uint16_t -> float64_t + + i32v = i32vec2(i16v); // int16_t -> int32_t + i32v = i32vec2(u16v); // uint16_t -> int32_t + u16v = u16vec2(i16v); // int16_t -> uint16_t + u32v = u32vec2(i16v); // int16_t -> uint32_t + i64v = i64vec2(i16v); // int16_t -> int64_t + u64v = i64vec2(i16v); // int16_t -> uint64_t + u32v = u32vec2(u16v); // uint16_t -> uint32_t + i64v = i64vec2(u16v); // uint16_t -> int64_t + u64v = i64vec2(u16v); // uint16_t -> uint64_t + f16v = f16vec2(i16v); // int16_t -> float16_t + f32v = f32vec2(i16v); // int16_t -> float32_t + f64v = f64vec2(i16v); // int16_t -> float64_t + f16v = f16vec2(u16v); // uint16_t -> float16_t + f32v = f32vec2(u16v); // uint16_t -> float32_t + f64v = f64vec2(u16v); // uint16_t -> float64_t + + i8v = i8vec2(i16v); // int16_t -> int8_t + i8v = i8vec2(u16v); // uint16_t -> int8_t + u8v = u8vec2(i16v); // int16_t -> uint8_t + u8v = u8vec2(u16v); // uint16_t -> uint8_t + i16v = u8vec2(u16v); // uint16_t -> int16_t + i16v = i16vec2(bv); // bool -> int16 + u16v = u16vec2(bv); // bool -> uint16 + bv = bvec2(i16v); // int16 -> bool + bv = bvec2(u16v); // uint16 -> bool +} + +void typeCast32() +{ + i8vec2 i8v; + u8vec2 u8v; + i16vec2 i16v; + u16vec2 u16v; + i32vec2 i32v; + u32vec2 u32v; + i64vec2 i64v; + u64vec2 u64v; + f16vec2 f16v; + f32vec2 f32v; + f64vec2 f64v; + bvec2 bv; + + u32v = i32v; // int32_t -> uint32_t + i64v = i32v; // int32_t -> int64_t + u64v = i32v; // int32_t -> uint64_t + i64v = u32v; // uint32_t -> int64_t + u64v = u32v; // uint32_t -> uint64_t + f32v = i32v; // int32_t -> float32_t + f64v = i32v; // int32_t -> float64_t + f32v = u32v; // uint32_t -> float32_t + f64v = u32v; // uint32_t -> float64_t + + i8v = i8vec2(i32v); // int32_t -> int8_t + i8v = i8vec2(u32v); // uint32_t -> int8_t + i16v = i16vec2(i32v); // int32_t -> int16_t + i16v = i16vec2(u32v); // uint32_t -> int16_t + i32v = i32vec2(i32v); // int32_t -> int32_t + i32v = i32vec2(u32v); // uint32_t -> int32_t + i64v = i64vec2(i32v); // int32_t -> int64_t + i64v = i64vec2(u32v); // uint32_t -> int64_t + u8v = u8vec2(i32v); // int32_t -> uint8_t + u8v = u8vec2(u32v); // uint32_t -> uint8_t + u16v = u16vec2(i32v); // int32_t -> uint16_t + u16v = u16vec2(u32v); // uint32_t -> uint16_t + u32v = u32vec2(i32v); // int32_t -> uint32_t + u32v = u32vec2(u32v); // uint32_t -> uint32_t + u64v = u64vec2(i32v); // int32_t -> uint64_t + u64v = u64vec2(u32v); // uint32_t -> uint64_t + + f16v = f16vec2(i32v); // int32_t -> float16_t + f32v = f32vec2(i32v); // int32_t -> float32_t + f64v = f64vec2(i32v); // int32_t -> float64_t + f16v = f16vec2(u32v); // uint32_t -> float16_t + f32v = f32vec2(u32v); // uint32_t -> float32_t + f64v = f64vec2(u32v); // uint32_t -> float64_t + + i32v = i32vec2(bv); // bool -> int32 + u32v = u32vec2(bv); // bool -> uint32 + bv = bvec2(i32v); // int32 -> bool + bv = bvec2(u32v); // uint32 -> bool +} + +void typeCast64() +{ + i8vec2 i8v; + u8vec2 u8v; + i16vec2 i16v; + u16vec2 u16v; + i32vec2 i32v; + u32vec2 u32v; + i64vec2 i64v; + u64vec2 u64v; + f16vec2 f16v; + f32vec2 f32v; + f64vec2 f64v; + bvec2 bv; + + u64v = i64v; // int64_t -> uint64_t + f64v = i64v; // int64_t -> float64_t + f64v = u64v; // uint64_t -> float64_t + + i8v = i8vec2(i64v); // int64_t -> int8_t + i8v = i8vec2(u64v); // uint64_t -> int8_t + i16v = i16vec2(i64v); // int64_t -> int16_t + i16v = i16vec2(u64v); // uint64_t -> int16_t + i32v = i32vec2(i64v); // int64_t -> int32_t + i32v = i32vec2(u64v); // uint64_t -> int32_t + i64v = i64vec2(u64v); // uint64_t -> int64_t + u8v = u8vec2(i64v); // int64_t -> uint8_t + u8v = u8vec2(u64v); // uint64_t -> uint8_t + u16v = u16vec2(i64v); // int64_t -> uint16_t + u16v = u16vec2(u64v); // uint64_t -> uint16_t + u32v = u32vec2(i64v); // int64_t -> uint32_t + u32v = u32vec2(u64v); // uint64_t -> uint32_t + u64v = u64vec2(i64v); // int64_t -> uint64_t + u64v = u64vec2(u64v); // uint64_t -> uint64_t + + f16v = f16vec2(i64v); // int64_t -> float16_t + f32v = f32vec2(i64v); // int64_t -> float32_t + f64v = f64vec2(i64v); // int64_t -> float64_t + f16v = f16vec2(u64v); // uint64_t -> float16_t + f32v = f32vec2(u64v); // uint64_t -> float32_t + f64v = f64vec2(u64v); // uint64_t -> float64_t + + i64v = i64vec2(bv); // bool -> int64 + u64v = u64vec2(bv); // bool -> uint64 + bv = bvec2(i64v); // int64 -> bool + bv = bvec2(u64v); // uint64 -> bool +} diff --git a/deps/glslang/Test/spv.extPostDepthCoverage.frag b/deps/glslang/Test/spv.extPostDepthCoverage.frag new file mode 100644 index 00000000..20aebc39 --- /dev/null +++ b/deps/glslang/Test/spv.extPostDepthCoverage.frag @@ -0,0 +1,9 @@ +#version 310 es + +#extension GL_EXT_post_depth_coverage : enable + +layout(post_depth_coverage) in; +layout(early_fragment_tests) in; + +void main () { +} diff --git a/deps/glslang/Test/spv.extPostDepthCoverage_Error.frag b/deps/glslang/Test/spv.extPostDepthCoverage_Error.frag new file mode 100644 index 00000000..25ce2e2e --- /dev/null +++ b/deps/glslang/Test/spv.extPostDepthCoverage_Error.frag @@ -0,0 +1,9 @@ +#version 450 + +#extension GL_EXT_post_depth_coverage : enable + +layout(post_depth_coverage) in; // should fail since for GL_EXT_post_depth_coverage + // explicit declaration of early_fragment_tests is required + +void main () { +} diff --git a/deps/glslang/Test/spv.float16.frag b/deps/glslang/Test/spv.float16.frag new file mode 100644 index 00000000..7c94a515 --- /dev/null +++ b/deps/glslang/Test/spv.float16.frag @@ -0,0 +1,306 @@ +#version 450 core + +#extension GL_AMD_gpu_shader_half_float: enable +#extension GL_ARB_gpu_shader_int64: enable + +void main() +{ +} + +// Half float literals +void literal() +{ + const float16_t f16c = 0.000001hf; + const f16vec2 f16cv = f16vec2(-0.25HF, 0.03HF); + + f16vec2 f16v; + f16v.x = f16c; + f16v += f16cv; +} + +// Block memory layout +struct S +{ + float16_t x; // rule 1: align = 2, takes offsets 0-1 + f16vec2 y; // rule 2: align = 4, takes offsets 4-7 + f16vec3 z; // rule 3: align = 8, takes offsets 8-13 +}; + +layout(column_major, std140) uniform B1 +{ + float16_t a; // rule 1: align = 2, takes offsets 0-1 + f16vec2 b; // rule 2: align = 4, takes offsets 4-7 + f16vec3 c; // rule 3: align = 8, takes offsets 8-15 + float16_t d[2]; // rule 4: align = 16, array stride = 16, + // takes offsets 16-47 + f16mat2x3 e; // rule 5: align = 16, matrix stride = 16, + // takes offsets 48-79 + f16mat2x3 f[2]; // rule 6: align = 16, matrix stride = 16, + // array stride = 32, f[0] takes + // offsets 80-111, f[1] takes offsets + // 112-143 + S g; // rule 9: align = 16, g.x takes offsets + // 144-145, g.y takes offsets 148-151, + // g.z takes offsets 152-159 + S h[2]; // rule 10: align = 16, array stride = 16, h[0] + // takes offsets 160-175, h[1] takes + // offsets 176-191 +}; + +layout(row_major, std430) buffer B2 +{ + float16_t o; // rule 1: align = 2, takes offsets 0-1 + f16vec2 p; // rule 2: align = 4, takes offsets 4-7 + f16vec3 q; // rule 3: align = 8, takes offsets 8-13 + float16_t r[2]; // rule 4: align = 2, array stride = 2, takes + // offsets 14-17 + f16mat2x3 s; // rule 7: align = 4, matrix stride = 4, takes + // offsets 20-31 + f16mat2x3 t[2]; // rule 8: align = 4, matrix stride = 4, array + // stride = 12, t[0] takes offsets + // 32-43, t[1] takes offsets 44-55 + S u; // rule 9: align = 8, u.x takes offsets + // 56-57, u.y takes offsets 60-63, u.z + // takes offsets 64-69 + S v[2]; // rule 10: align = 8, array stride = 16, v[0] + // takes offsets 72-87, v[1] takes + // offsets 88-103 +}; + +// Specialization constant +layout(constant_id = 100) const float16_t sf16 = 0.125hf; +layout(constant_id = 101) const float sf = 0.25; +layout(constant_id = 102) const double sd = 0.5lf; + +const float f16_to_f = float(sf16); +const double f16_to_d = float(sf16); + +const float16_t f_to_f16 = float16_t(sf); +const float16_t d_to_f16 = float16_t(sd); + +void operators() +{ + float16_t f16; + f16vec2 f16v; + f16mat2x2 f16m; + bool b; + + // Arithmetic + f16v += f16v; + f16v -= f16v; + f16v *= f16v; + f16v /= f16v; + f16v++; + f16v--; + ++f16m; + --f16m; + f16v = -f16v; + f16m = -f16m; + + f16 = f16v.x + f16v.y; + f16 = f16v.x - f16v.y; + f16 = f16v.x * f16v.y; + f16 = f16v.x / f16v.y; + + // Relational + b = (f16v.x != f16); + b = (f16v.y == f16); + b = (f16v.x > f16); + b = (f16v.y < f16); + b = (f16v.x >= f16); + b = (f16v.y <= f16); + + // Vector/matrix operations + f16v = f16v * f16; + f16m = f16m * f16; + f16v = f16m * f16v; + f16v = f16v * f16m; + f16m = f16m * f16m; +} + +void typeCast() +{ + bvec3 bv; + vec3 fv; + dvec3 dv; + ivec3 iv; + uvec3 uv; + i64vec3 i64v; + u64vec3 u64v; + + f16vec3 f16v; + + f16v = f16vec3(bv); // bool -> float16 + bv = bvec3(f16v); // float16 -> bool + + f16v = f16vec3(fv); // float -> float16 + fv = vec3(f16v); // float16 -> float + + f16v = f16vec3(dv); // double -> float16 + dv = dvec3(dv); // float16 -> double + + f16v = f16vec3(iv); // int -> float16 + iv = ivec3(f16v); // float16 -> int + + f16v = f16vec3(uv); // uint -> float16 + uv = uvec3(f16v); // float16 -> uint + + f16v = f16vec3(i64v); // int64 -> float16 + i64v = i64vec3(f16v); // float16 -> int64 + + f16v = f16vec3(u64v); // uint64 -> float16 + u64v = u64vec3(f16v); // float16 -> uint64 +} + +void builtinAngleTrigFuncs() +{ + f16vec4 f16v1, f16v2; + + f16v2 = radians(f16v1); + f16v2 = degrees(f16v1); + f16v2 = sin(f16v1); + f16v2 = cos(f16v1); + f16v2 = tan(f16v1); + f16v2 = asin(f16v1); + f16v2 = acos(f16v1); + f16v2 = atan(f16v1, f16v2); + f16v2 = atan(f16v1); + f16v2 = sinh(f16v1); + f16v2 = cosh(f16v1); + f16v2 = tanh(f16v1); + f16v2 = asinh(f16v1); + f16v2 = acosh(f16v1); + f16v2 = atanh(f16v1); +} + +void builtinExpFuncs() +{ + f16vec2 f16v1, f16v2; + + f16v2 = pow(f16v1, f16v2); + f16v2 = exp(f16v1); + f16v2 = log(f16v1); + f16v2 = exp2(f16v1); + f16v2 = log2(f16v1); + f16v2 = sqrt(f16v1); + f16v2 = inversesqrt(f16v1); +} + +void builtinCommonFuncs() +{ + f16vec3 f16v1, f16v2, f16v3; + float16_t f16; + bool b; + bvec3 bv; + ivec3 iv; + + f16v2 = abs(f16v1); + f16v2 = sign(f16v1); + f16v2 = floor(f16v1); + f16v2 = trunc(f16v1); + f16v2 = round(f16v1); + f16v2 = roundEven(f16v1); + f16v2 = ceil(f16v1); + f16v2 = fract(f16v1); + f16v2 = mod(f16v1, f16v2); + f16v2 = mod(f16v1, f16); + f16v3 = modf(f16v1, f16v2); + f16v3 = min(f16v1, f16v2); + f16v3 = min(f16v1, f16); + f16v3 = max(f16v1, f16v2); + f16v3 = max(f16v1, f16); + f16v3 = clamp(f16v1, f16, f16v2.x); + f16v3 = clamp(f16v1, f16v2, f16vec3(f16)); + f16v3 = mix(f16v1, f16v2, f16); + f16v3 = mix(f16v1, f16v2, f16v3); + f16v3 = mix(f16v1, f16v2, bv); + f16v3 = step(f16v1, f16v2); + f16v3 = step(f16, f16v3); + f16v3 = smoothstep(f16v1, f16v2, f16v3); + f16v3 = smoothstep(f16, f16v1.x, f16v2); + b = isnan(f16); + bv = isinf(f16v1); + f16v3 = fma(f16v1, f16v2, f16v3); + f16v2 = frexp(f16v1, iv); + f16v2 = ldexp(f16v1, iv); +} + +void builtinPackUnpackFuncs() +{ + uint u; + f16vec2 f16v; + + u = packFloat2x16(f16v); + f16v = unpackFloat2x16(u); +} + +void builtinGeometryFuncs() +{ + float16_t f16; + f16vec3 f16v1, f16v2, f16v3; + + f16 = length(f16v1); + f16 = distance(f16v1, f16v2); + f16 = dot(f16v1, f16v2); + f16v3 = cross(f16v1, f16v2); + f16v2 = normalize(f16v1); + f16v3 = faceforward(f16v1, f16v2, f16v3); + f16v3 = reflect(f16v1, f16v2); + f16v3 = refract(f16v1, f16v2, f16); +} + +void builtinMatrixFuncs() +{ + f16mat2x3 f16m1, f16m2, f16m3; + f16mat3x2 f16m4; + f16mat3 f16m5; + f16mat4 f16m6, f16m7; + + f16vec3 f16v1; + f16vec2 f16v2; + + float16_t f16; + + f16m3 = matrixCompMult(f16m1, f16m2); + f16m1 = outerProduct(f16v1, f16v2); + f16m4 = transpose(f16m1); + f16 = determinant(f16m5); + f16m6 = inverse(f16m7); +} + +void builtinVecRelFuncs() +{ + f16vec3 f16v1, f16v2; + bvec3 bv; + + bv = lessThan(f16v1, f16v2); + bv = lessThanEqual(f16v1, f16v2); + bv = greaterThan(f16v1, f16v2); + bv = greaterThanEqual(f16v1, f16v2); + bv = equal(f16v1, f16v2); + bv = notEqual(f16v1, f16v2); +} + +in f16vec3 if16v; + +void builtinFragProcFuncs() +{ + f16vec3 f16v; + + // Derivative + f16v.x = dFdx(if16v.x); + f16v.y = dFdy(if16v.y); + f16v.xy = dFdxFine(if16v.xy); + f16v.xy = dFdyFine(if16v.xy); + f16v = dFdxCoarse(if16v); + f16v = dFdxCoarse(if16v); + + f16v.x = fwidth(if16v.x); + f16v.xy = fwidthFine(if16v.xy); + f16v = fwidthCoarse(if16v); + + // Interpolation + f16v.x = interpolateAtCentroid(if16v.x); + f16v.xy = interpolateAtSample(if16v.xy, 1); + f16v = interpolateAtOffset(if16v, f16vec2(0.5hf)); +} diff --git a/deps/glslang/Test/spv.float16Fetch.frag b/deps/glslang/Test/spv.float16Fetch.frag new file mode 100644 index 00000000..b1ba98c8 --- /dev/null +++ b/deps/glslang/Test/spv.float16Fetch.frag @@ -0,0 +1,1273 @@ +#version 450 core + +#extension GL_ARB_sparse_texture2: enable +#extension GL_ARB_sparse_texture_clamp: enable +#extension GL_AMD_gpu_shader_half_float: enable +#extension GL_AMD_gpu_shader_half_float_fetch: enable +#extension GL_AMD_texture_gather_bias_lod: enable + +layout(set = 0, binding = 0) uniform f16sampler1D s1D; +layout(set = 0, binding = 1) uniform f16sampler2D s2D; +layout(set = 0, binding = 2) uniform f16sampler3D s3D; +layout(set = 0, binding = 3) uniform f16sampler2DRect s2DRect; +layout(set = 0, binding = 4) uniform f16samplerCube sCube; +layout(set = 0, binding = 5) uniform f16samplerBuffer sBuffer; +layout(set = 0, binding = 6) uniform f16sampler2DMS s2DMS; +layout(set = 0, binding = 7) uniform f16sampler1DArray s1DArray; +layout(set = 0, binding = 8) uniform f16sampler2DArray s2DArray; +layout(set = 0, binding = 9) uniform f16samplerCubeArray sCubeArray; +layout(set = 0, binding = 10) uniform f16sampler2DMSArray s2DMSArray; + +layout(set = 0, binding = 11) uniform f16sampler1DShadow s1DShadow; +layout(set = 0, binding = 12) uniform f16sampler2DShadow s2DShadow; +layout(set = 0, binding = 13) uniform f16sampler2DRectShadow s2DRectShadow; +layout(set = 0, binding = 14) uniform f16samplerCubeShadow sCubeShadow; +layout(set = 0, binding = 15) uniform f16sampler1DArrayShadow s1DArrayShadow; +layout(set = 0, binding = 16) uniform f16sampler2DArrayShadow s2DArrayShadow; +layout(set = 0, binding = 17) uniform f16samplerCubeArrayShadow sCubeArrayShadow; + +layout(set = 1, binding = 0) layout(rgba16f) uniform f16image1D i1D; +layout(set = 1, binding = 1) layout(rgba16f) uniform f16image2D i2D; +layout(set = 1, binding = 2) layout(rgba16f) uniform f16image3D i3D; +layout(set = 1, binding = 3) layout(rgba16f) uniform f16image2DRect i2DRect; +layout(set = 1, binding = 4) layout(rgba16f) uniform f16imageCube iCube; +layout(set = 1, binding = 5) layout(rgba16f) uniform f16image1DArray i1DArray; +layout(set = 1, binding = 6) layout(rgba16f) uniform f16image2DArray i2DArray; +layout(set = 1, binding = 7) layout(rgba16f) uniform f16imageCubeArray iCubeArray; +layout(set = 1, binding = 8) layout(rgba16f) uniform f16imageBuffer iBuffer; +layout(set = 1, binding = 9) layout(rgba16f) uniform f16image2DMS i2DMS; +layout(set = 1, binding = 10) layout(rgba16f) uniform f16image2DMSArray i2DMSArray; + +layout(set = 2, binding = 0) uniform f16texture1D t1D; +layout(set = 2, binding = 1) uniform f16texture2D t2D; +layout(set = 2, binding = 2) uniform f16texture3D t3D; +layout(set = 2, binding = 3) uniform f16texture2DRect t2DRect; +layout(set = 2, binding = 4) uniform f16textureCube tCube; +layout(set = 2, binding = 5) uniform f16texture1DArray t1DArray; +layout(set = 2, binding = 6) uniform f16texture2DArray t2DArray; +layout(set = 2, binding = 7) uniform f16textureCubeArray tCubeArray; +layout(set = 2, binding = 8) uniform f16textureBuffer tBuffer; +layout(set = 2, binding = 9) uniform f16texture2DMS t2DMS; +layout(set = 2, binding = 10) uniform f16texture2DMSArray t2DMSArray; + +layout(set = 2, binding = 11) uniform sampler s; +layout(set = 2, binding = 12) uniform samplerShadow sShadow; + +layout(set = 3, binding = 0, input_attachment_index = 0) uniform f16subpassInput subpass; +layout(set = 3, binding = 1, input_attachment_index = 0) uniform f16subpassInputMS subpassMS; + +layout(location = 0) in float c1; +layout(location = 1) in vec2 c2; +layout(location = 2) in vec3 c3; +layout(location = 3) in vec4 c4; + +layout(location = 4) in float compare; +layout(location = 5) in float lod; +layout(location = 6) in float bias; +layout(location = 7) in float lodClamp; + +layout(location = 8) in float dPdxy1; +layout(location = 9) in vec2 dPdxy2; +layout(location = 10) in vec3 dPdxy3; + +layout(location = 11) in float16_t f16c1; +layout(location = 12) in f16vec2 f16c2; +layout(location = 13) in f16vec3 f16c3; +layout(location = 14) in f16vec4 f16c4; + +layout(location = 15) in float16_t f16lod; +layout(location = 16) in float16_t f16bias; +layout(location = 17) in float16_t f16lodClamp; + +layout(location = 18) in float16_t f16dPdxy1; +layout(location = 19) in f16vec2 f16dPdxy2; +layout(location = 20) in f16vec3 f16dPdxy3; + +const int offset1 = 1; +const ivec2 offset2 = ivec2(1); +const ivec3 offset3 = ivec3(1); +const ivec2 offsets[4] = { offset2, offset2, offset2, offset2 }; + +layout(location = 0) out vec4 fragColor; + +f16vec4 testTexture() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += texture(s1D, c1); + texel += texture(s1D, f16c1, f16bias); + texel += texture(s2D, c2); + texel += texture(s2D, f16c2, f16bias); + texel += texture(s3D, c3); + texel += texture(s3D, f16c3, f16bias); + texel += texture(sCube, c3); + texel += texture(sCube, f16c3, f16bias); + texel.x += texture(s1DShadow, c3); + texel.x += texture(s1DShadow, f16c2, compare, f16bias); + texel.x += texture(s2DShadow, c3); + texel.x += texture(s2DShadow, f16c2, compare, f16bias); + texel.x += texture(sCubeShadow, c4); + texel.x += texture(sCubeShadow, f16c3, compare, f16bias); + texel += texture(s1DArray, c2); + texel += texture(s1DArray, f16c2, f16bias); + texel += texture(s2DArray, c3); + texel += texture(s2DArray, f16c3, f16bias); + texel += texture(sCubeArray, c4); + texel += texture(sCubeArray, f16c4, f16bias); + texel.x += texture(s1DArrayShadow, c3); + texel.x += texture(s1DArrayShadow, f16c2, compare, f16bias); + texel.x += texture(s2DArrayShadow, c4); + texel.x += texture(s2DArrayShadow, f16c3, compare); + texel += texture(s2DRect, c2); + texel += texture(s2DRect, f16c2); + texel.x += texture(s2DRectShadow, c3); + texel.x += texture(s2DRectShadow, f16c2, compare); + texel.x += texture(sCubeArrayShadow, c4, compare); + texel.x += texture(sCubeArrayShadow, f16c4, compare); + + return texel; +} + +f16vec4 testTextureProj() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureProj(s1D, c2); + texel += textureProj(s1D, f16c2, f16bias); + texel += textureProj(s1D, c4); + texel += textureProj(s1D, f16c4, f16bias); + texel += textureProj(s2D, c3); + texel += textureProj(s2D, f16c3, f16bias); + texel += textureProj(s2D, c4); + texel += textureProj(s2D, f16c4, f16bias); + texel += textureProj(s3D, c4); + texel += textureProj(s3D, f16c4, f16bias); + texel.x += textureProj(s1DShadow, c4); + texel.x += textureProj(s1DShadow, f16c3, compare, f16bias); + texel.x += textureProj(s2DShadow, c4); + texel.x += textureProj(s2DShadow, f16c3, compare, f16bias); + texel += textureProj(s2DRect, c3); + texel += textureProj(s2DRect, f16c3); + texel += textureProj(s2DRect, c4); + texel += textureProj(s2DRect, f16c4); + texel.x += textureProj(s2DRectShadow, c4); + texel.x += textureProj(s2DRectShadow, f16c3, compare); + + return texel; +} + +f16vec4 testTextureLod() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureLod(s1D, c1, lod); + texel += textureLod(s1D, f16c1, f16lod); + texel += textureLod(s2D, c2, lod); + texel += textureLod(s2D, f16c2, f16lod); + texel += textureLod(s3D, c3, lod); + texel += textureLod(s3D, f16c3, f16lod); + texel += textureLod(sCube, c3, lod); + texel += textureLod(sCube, f16c3, f16lod); + texel.x += textureLod(s1DShadow, c3, lod); + texel.x += textureLod(s1DShadow, f16c2, compare, f16lod); + texel.x += textureLod(s2DShadow, c3, lod); + texel.x += textureLod(s2DShadow, f16c2, compare, f16lod); + texel += textureLod(s1DArray, c2, lod); + texel += textureLod(s1DArray, f16c2, f16lod); + texel += textureLod(s2DArray, c3, lod); + texel += textureLod(s2DArray, f16c3, f16lod); + texel.x += textureLod(s1DArrayShadow, c3, lod); + texel.x += textureLod(s1DArrayShadow, f16c2, compare, f16lod); + texel += textureLod(sCubeArray, c4, lod); + texel += textureLod(sCubeArray, f16c4, f16lod); + + return texel; +} + +f16vec4 testTextureOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureOffset(s1D, c1, offset1); + texel += textureOffset(s1D, f16c1, offset1, f16bias); + texel += textureOffset(s2D, c2, offset2); + texel += textureOffset(s2D, f16c2, offset2, f16bias); + texel += textureOffset(s3D, c3, offset3); + texel += textureOffset(s3D, f16c3, offset3, f16bias); + texel += textureOffset(s2DRect, c2, offset2); + texel += textureOffset(s2DRect, f16c2, offset2); + texel.x += textureOffset(s2DRectShadow, c3, offset2); + texel.x += textureOffset(s2DRectShadow, f16c2, compare, offset2); + texel.x += textureOffset(s1DShadow, c3, offset1); + texel.x += textureOffset(s1DShadow, f16c2, compare, offset1, f16bias); + texel.x += textureOffset(s2DShadow, c3, offset2); + texel.x += textureOffset(s2DShadow, f16c2, compare, offset2, f16bias); + texel += textureOffset(s1DArray, c2, offset1); + texel += textureOffset(s1DArray, f16c2, offset1, f16bias); + texel += textureOffset(s2DArray, c3, offset2); + texel += textureOffset(s2DArray, f16c3, offset2, f16bias); + texel.x += textureOffset(s1DArrayShadow, c3, offset1); + texel.x += textureOffset(s1DArrayShadow, f16c2, compare, offset1, f16bias); + texel.x += textureOffset(s2DArrayShadow, c4, offset2); + texel.x += textureOffset(s2DArrayShadow, f16c3, compare, offset2); + + return texel; +} + +f16vec4 testTextureProjOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureProjOffset(s1D, c2, offset1); + texel += textureProjOffset(s1D, f16c2, offset1, f16bias); + texel += textureProjOffset(s1D, c4, offset1); + texel += textureProjOffset(s1D, f16c4, offset1, f16bias); + texel += textureProjOffset(s2D, c3, offset2); + texel += textureProjOffset(s2D, f16c3, offset2, f16bias); + texel += textureProjOffset(s2D, c4, offset2); + texel += textureProjOffset(s2D, f16c4, offset2, f16bias); + texel += textureProjOffset(s3D, c4, offset3); + texel += textureProjOffset(s3D, f16c4, offset3, f16bias); + texel += textureProjOffset(s2DRect, c3, offset2); + texel += textureProjOffset(s2DRect, f16c3, offset2); + texel += textureProjOffset(s2DRect, c4, offset2); + texel += textureProjOffset(s2DRect, f16c4, offset2); + texel.x += textureProjOffset(s2DRectShadow, c4, offset2); + texel.x += textureProjOffset(s2DRectShadow, f16c3, compare, offset2); + texel.x += textureProjOffset(s1DShadow, c4, offset1); + texel.x += textureProjOffset(s1DShadow, f16c3, compare, offset1, f16bias); + texel.x += textureProjOffset(s2DShadow, c4, offset2); + texel.x += textureProjOffset(s2DShadow, f16c3, compare, offset2, f16bias); + + return texel; +} + +f16vec4 testTextureLodOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureLodOffset(s1D, c1, lod, offset1); + texel += textureLodOffset(s1D, f16c1, f16lod, offset1); + texel += textureLodOffset(s2D, c2, lod, offset2); + texel += textureLodOffset(s2D, f16c2, f16lod, offset2); + texel += textureLodOffset(s3D, c3, lod, offset3); + texel += textureLodOffset(s3D, f16c3, f16lod, offset3); + texel.x += textureLodOffset(s1DShadow, c3, lod, offset1); + texel.x += textureLodOffset(s1DShadow, f16c2, compare, f16lod, offset1); + texel.x += textureLodOffset(s2DShadow, c3, lod, offset2); + texel.x += textureLodOffset(s2DShadow, f16c2, compare, f16lod, offset2); + texel += textureLodOffset(s1DArray, c2, lod, offset1); + texel += textureLodOffset(s1DArray, f16c2, f16lod, offset1); + texel += textureLodOffset(s2DArray, c3, lod, offset2); + texel += textureLodOffset(s2DArray, f16c3, f16lod, offset2); + texel.x += textureLodOffset(s1DArrayShadow, c3, lod, offset1); + texel.x += textureLodOffset(s1DArrayShadow, f16c2, compare, f16lod, offset1); + + return texel; +} + +f16vec4 testTextureProjLodOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureProjLodOffset(s1D, c2, lod, offset1); + texel += textureProjLodOffset(s1D, f16c2, f16lod, offset1); + texel += textureProjLodOffset(s1D, c4, lod, offset1); + texel += textureProjLodOffset(s1D, f16c4, f16lod, offset1); + texel += textureProjLodOffset(s2D, c3, lod, offset2); + texel += textureProjLodOffset(s2D, f16c3, f16lod, offset2); + texel += textureProjLodOffset(s2D, c4, lod, offset2); + texel += textureProjLodOffset(s2D, f16c4, f16lod, offset2); + texel += textureProjLodOffset(s3D, c4, lod, offset3); + texel += textureProjLodOffset(s3D, f16c4, f16lod, offset3); + texel.x += textureProjLodOffset(s1DShadow, c4, lod, offset1); + texel.x += textureProjLodOffset(s1DShadow, f16c3, compare, f16lod, offset1); + texel.x += textureProjLodOffset(s2DShadow, c4, lod, offset2); + texel.x += textureProjLodOffset(s2DShadow, f16c3, compare, f16lod, offset2); + + return texel; +} + +f16vec4 testTexelFetch() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += texelFetch(s1D, int(c1), int(lod)); + texel += texelFetch(s2D, ivec2(c2), int(lod)); + texel += texelFetch(s3D, ivec3(c3), int(lod)); + texel += texelFetch(s2DRect, ivec2(c2)); + texel += texelFetch(s1DArray, ivec2(c2), int(lod)); + texel += texelFetch(s2DArray, ivec3(c3), int(lod)); + texel += texelFetch(sBuffer, int(c1)); + texel += texelFetch(s2DMS, ivec2(c2), 1); + texel += texelFetch(s2DMSArray, ivec3(c3), 2); + + return texel; +} + +f16vec4 testTexelFetchOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += texelFetchOffset(s1D, int(c1), int(lod), offset1); + texel += texelFetchOffset(s2D, ivec2(c2), int(lod), offset2); + texel += texelFetchOffset(s3D, ivec3(c3), int(lod), offset3); + texel += texelFetchOffset(s2DRect, ivec2(c2), offset2); + texel += texelFetchOffset(s1DArray, ivec2(c2), int(lod), offset1); + texel += texelFetchOffset(s2DArray, ivec3(c3), int(lod), offset2); + + return texel; +} + +f16vec4 testTextureGrad() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGrad(s1D, c1, dPdxy1, dPdxy1); + texel += textureGrad(s1D, f16c1, f16dPdxy1, f16dPdxy1); + texel += textureGrad(s2D, c2, dPdxy2, dPdxy2); + texel += textureGrad(s2D, f16c2, f16dPdxy2, f16dPdxy2); + texel += textureGrad(s3D, c3, dPdxy3, dPdxy3); + texel += textureGrad(s3D, f16c3, f16dPdxy3, f16dPdxy3); + texel += textureGrad(sCube, c3, dPdxy3, dPdxy3); + texel += textureGrad(sCube, f16c3, f16dPdxy3, f16dPdxy3); + texel += textureGrad(s2DRect, c2, dPdxy2, dPdxy2); + texel += textureGrad(s2DRect, f16c2, f16dPdxy2, f16dPdxy2); + texel.x += textureGrad(s2DRectShadow, c3, dPdxy2, dPdxy2); + texel.x += textureGrad(s2DRectShadow, f16c2, compare, f16dPdxy2, f16dPdxy2); + texel.x += textureGrad(s1DShadow, c3, dPdxy1, dPdxy1); + texel.x += textureGrad(s1DShadow, f16c2, compare, f16dPdxy1, f16dPdxy1); + texel.x += textureGrad(s2DShadow, c3, dPdxy2, dPdxy2); + texel.x += textureGrad(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2); + texel.x += textureGrad(sCubeShadow, c4, dPdxy3, dPdxy3); + texel.x += textureGrad(sCubeShadow, f16c3, compare, f16dPdxy3, f16dPdxy3); + texel += textureGrad(s1DArray, c2, dPdxy1, dPdxy1); + texel += textureGrad(s1DArray, f16c2, f16dPdxy1, f16dPdxy1); + texel += textureGrad(s2DArray, c3, dPdxy2, dPdxy2); + texel += textureGrad(s2DArray, f16c3, f16dPdxy2, f16dPdxy2); + texel.x += textureGrad(s1DArrayShadow, c3, dPdxy1, dPdxy1); + texel.x += textureGrad(s1DArrayShadow, f16c2, compare, f16dPdxy1, f16dPdxy1); + texel.x += textureGrad(s2DArrayShadow, c4, dPdxy2, dPdxy2); + texel.x += textureGrad(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2); + texel += textureGrad(sCubeArray, c4, dPdxy3, dPdxy3); + texel += textureGrad(sCubeArray, f16c4, f16dPdxy3, f16dPdxy3); + + return texel; +} + +f16vec4 testTextureGradOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGradOffset(s1D, c1, dPdxy1, dPdxy1, offset1); + texel += textureGradOffset(s1D, f16c1, f16dPdxy1, f16dPdxy1, offset1); + texel += textureGradOffset(s2D, c2, dPdxy2, dPdxy2, offset2); + texel += textureGradOffset(s2D, f16c2, f16dPdxy2, f16dPdxy2, offset2); + texel += textureGradOffset(s3D, c3, dPdxy3, dPdxy3, offset3); + texel += textureGradOffset(s3D, f16c3, f16dPdxy3, f16dPdxy3, offset3); + texel += textureGradOffset(s2DRect, c2, dPdxy2, dPdxy2, offset2); + texel += textureGradOffset(s2DRect, f16c2, f16dPdxy2, f16dPdxy2, offset2); + texel.x += textureGradOffset(s2DRectShadow, c3, dPdxy2, dPdxy2, offset2); + texel.x += textureGradOffset(s2DRectShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2); + texel.x += textureGradOffset(s1DShadow, c3, dPdxy1, dPdxy1, offset1); + texel.x += textureGradOffset(s1DShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, offset1); + texel.x += textureGradOffset(s2DShadow, c3, dPdxy2, dPdxy2, offset2); + texel.x += textureGradOffset(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2); + texel += textureGradOffset(s1DArray, c2, dPdxy1, dPdxy1, offset1); + texel += textureGradOffset(s1DArray, f16c2, f16dPdxy1, f16dPdxy1, offset1); + texel += textureGradOffset(s2DArray, c3, dPdxy2, dPdxy2, offset2); + texel += textureGradOffset(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, offset2); + texel.x += textureGradOffset(s1DArrayShadow, c3, dPdxy1, dPdxy1, offset1); + texel.x += textureGradOffset(s1DArrayShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, offset1); + texel.x += textureGradOffset(s2DArrayShadow, c4, dPdxy2, dPdxy2, offset2); + texel.x += textureGradOffset(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2); + + return texel; +} + +f16vec4 testTextureProjGrad() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureProjGrad(s1D, c2, dPdxy1, dPdxy1); + texel += textureProjGrad(s1D, f16c2, f16dPdxy1, f16dPdxy1); + texel += textureProjGrad(s1D, c4, dPdxy1, dPdxy1); + texel += textureProjGrad(s1D, f16c4, f16dPdxy1, f16dPdxy1); + texel += textureProjGrad(s2D, c3, dPdxy2, dPdxy2); + texel += textureProjGrad(s2D, f16c3, f16dPdxy2, f16dPdxy2); + texel += textureProjGrad(s2D, c4, dPdxy2, dPdxy2); + texel += textureProjGrad(s2D, f16c4, f16dPdxy2, f16dPdxy2); + texel += textureProjGrad(s3D, c4, dPdxy3, dPdxy3); + texel += textureProjGrad(s3D, f16c4, f16dPdxy3, f16dPdxy3); + texel += textureProjGrad(s2DRect, c3, dPdxy2, dPdxy2); + texel += textureProjGrad(s2DRect, f16c3, f16dPdxy2, f16dPdxy2); + texel += textureProjGrad(s2DRect, c4, dPdxy2, dPdxy2); + texel += textureProjGrad(s2DRect, f16c4, f16dPdxy2, f16dPdxy2); + texel.x += textureProjGrad(s2DRectShadow, c4, dPdxy2, dPdxy2); + texel.x += textureProjGrad(s2DRectShadow, f16c3, compare, f16dPdxy2, f16dPdxy2); + texel.x += textureProjGrad(s1DShadow, c4, dPdxy1, dPdxy1); + texel.x += textureProjGrad(s1DShadow, f16c3, compare, f16dPdxy1, f16dPdxy1); + texel.x += textureProjGrad(s2DShadow, c4, dPdxy2, dPdxy2); + texel.x += textureProjGrad(s2DShadow, f16c3, compare, f16dPdxy2, f16dPdxy2); + + return texel; +} + +f16vec4 testTextureProjGradoffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureProjGradOffset(s1D, c2, dPdxy1, dPdxy1, offset1); + texel += textureProjGradOffset(s1D, f16c2, f16dPdxy1, f16dPdxy1, offset1); + texel += textureProjGradOffset(s1D, c4, dPdxy1, dPdxy1, offset1); + texel += textureProjGradOffset(s1D, f16c4, f16dPdxy1, f16dPdxy1, offset1); + texel += textureProjGradOffset(s2D, c3, dPdxy2, dPdxy2, offset2); + texel += textureProjGradOffset(s2D, f16c3, f16dPdxy2, f16dPdxy2, offset2); + texel += textureProjGradOffset(s2D, c4, dPdxy2, dPdxy2, offset2); + texel += textureProjGradOffset(s2D, f16c4, f16dPdxy2, f16dPdxy2, offset2); + texel += textureProjGradOffset(s2DRect, c3, dPdxy2, dPdxy2, offset2); + texel += textureProjGradOffset(s2DRect, f16c3, f16dPdxy2, f16dPdxy2, offset2); + texel += textureProjGradOffset(s2DRect, c4, dPdxy2, dPdxy2, offset2); + texel += textureProjGradOffset(s2DRect, f16c4, f16dPdxy2, f16dPdxy2, offset2); + texel.x += textureProjGradOffset(s2DRectShadow, c4, dPdxy2, dPdxy2, offset2); + texel.x += textureProjGradOffset(s2DRectShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2); + texel += textureProjGradOffset(s3D, c4, dPdxy3, dPdxy3, offset3); + texel += textureProjGradOffset(s3D, f16c4, f16dPdxy3, f16dPdxy3, offset3); + texel.x += textureProjGradOffset(s1DShadow, c4, dPdxy1, dPdxy1, offset1); + texel.x += textureProjGradOffset(s1DShadow, f16c3, compare, f16dPdxy1, f16dPdxy1, offset1); + texel.x += textureProjGradOffset(s2DShadow, c4, dPdxy2, dPdxy2, offset2); + texel.x += textureProjGradOffset(s2DShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2); + + return texel; +} + +f16vec4 testTextureGather() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGather(s2D, c2, 0); + texel += textureGather(s2D, f16c2, 0, f16bias); + texel += textureGather(s2DArray, c3, 0); + texel += textureGather(s2DArray, f16c3, 0, f16bias); + texel += textureGather(sCube, c3, 0); + texel += textureGather(sCube, f16c3, 0, f16bias); + texel += textureGather(sCubeArray, c4, 0); + texel += textureGather(sCubeArray, f16c4, 0, f16bias); + texel += textureGather(s2DRect, c2, 0); + texel += textureGather(s2DRect, f16c2, 0); + texel += textureGather(s2DShadow, c2, compare); + texel += textureGather(s2DShadow, f16c2, compare); + texel += textureGather(s2DArrayShadow, c3, compare); + texel += textureGather(s2DArrayShadow, f16c3, compare); + texel += textureGather(sCubeShadow, c3, compare); + texel += textureGather(sCubeShadow, f16c3, compare); + texel += textureGather(sCubeArrayShadow, c4, compare); + texel += textureGather(sCubeArrayShadow, f16c4, compare); + texel += textureGather(s2DRectShadow, c2, compare); + texel += textureGather(s2DRectShadow, f16c2, compare); + + return texel; +} + +f16vec4 testTextureGatherOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGatherOffset(s2D, c2, offset2, 0); + texel += textureGatherOffset(s2D, f16c2, offset2, 0, f16bias); + texel += textureGatherOffset(s2DArray, c3, offset2, 0); + texel += textureGatherOffset(s2DArray, f16c3, offset2, 0, f16bias); + texel += textureGatherOffset(s2DRect, c2, offset2, 0); + texel += textureGatherOffset(s2DRect, f16c2, offset2, 0); + texel += textureGatherOffset(s2DShadow, c2, compare, offset2); + texel += textureGatherOffset(s2DShadow, f16c2, compare, offset2); + texel += textureGatherOffset(s2DArrayShadow, c3, compare, offset2); + texel += textureGatherOffset(s2DArrayShadow, f16c3, compare, offset2); + texel += textureGatherOffset(s2DRectShadow, c2, compare, offset2); + texel += textureGatherOffset(s2DRectShadow, f16c2, compare, offset2); + + return texel; +} + +f16vec4 testTextureGatherOffsets() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGatherOffsets(s2D, c2, offsets, 0); + texel += textureGatherOffsets(s2D, f16c2, offsets, 0, f16bias); + texel += textureGatherOffsets(s2DArray, c3, offsets, 0); + texel += textureGatherOffsets(s2DArray, f16c3, offsets, 0, f16bias); + texel += textureGatherOffsets(s2DRect, c2, offsets, 0); + texel += textureGatherOffsets(s2DRect, f16c2, offsets, 0); + texel += textureGatherOffsets(s2DShadow, c2, compare, offsets); + texel += textureGatherOffsets(s2DShadow, f16c2, compare, offsets); + texel += textureGatherOffsets(s2DArrayShadow, c3, compare, offsets); + texel += textureGatherOffsets(s2DArrayShadow, f16c3, compare, offsets); + texel += textureGatherOffsets(s2DRectShadow, c2, compare, offsets); + texel += textureGatherOffsets(s2DRectShadow, f16c2, compare, offsets); + + return texel; +} + +f16vec4 testTextureGatherLod() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGatherLodAMD(s2D, c2, lod, 0); + texel += textureGatherLodAMD(s2D, f16c2, f16lod, 0); + texel += textureGatherLodAMD(s2DArray, c3, lod, 0); + texel += textureGatherLodAMD(s2DArray, f16c3, f16lod, 0); + texel += textureGatherLodAMD(sCube, c3, lod, 0); + texel += textureGatherLodAMD(sCube, f16c3, f16lod, 0); + texel += textureGatherLodAMD(sCubeArray, c4, lod, 0); + texel += textureGatherLodAMD(sCubeArray, f16c4, f16lod, 0); + + return texel; +} + +f16vec4 testTextureGatherLodOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGatherLodOffsetAMD(s2D, c2, lod, offset2, 0); + texel += textureGatherLodOffsetAMD(s2D, f16c2, f16lod, offset2, 0); + texel += textureGatherLodOffsetAMD(s2DArray, c3, lod, offset2, 0); + texel += textureGatherLodOffsetAMD(s2DArray, f16c3, f16lod, offset2, 0); + + return texel; +} + +f16vec4 testTextureGatherLodOffsets() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGatherLodOffsetsAMD(s2D, c2, lod, offsets, 0); + texel += textureGatherLodOffsetsAMD(s2D, f16c2, f16lod, offsets, 0); + texel += textureGatherLodOffsetsAMD(s2DArray, c3, lod, offsets, 0); + texel += textureGatherLodOffsetsAMD(s2DArray, f16c3, f16lod, offsets, 0); + + return texel; +} + +ivec4 testTextureSize() +{ + ivec4 size = ivec4(0); + + size.x += textureSize(s1D, int(lod)); + size.xy += textureSize(s2D, int(lod)); + size.xyz += textureSize(s3D, int(lod)); + size.xy += textureSize(sCube, int(lod)); + size.x += textureSize(s1DShadow, int(lod)); + size.xy += textureSize(s2DShadow, int(lod)); + size.xy += textureSize(sCubeShadow, int(lod)); + size.xyz += textureSize(sCubeArray, int(lod)); + size.xyz += textureSize(sCubeArrayShadow, int(lod)); + size.xy += textureSize(s2DRect); + size.xy += textureSize(s2DRectShadow); + size.xy += textureSize(s1DArray, int(lod)); + size.xyz += textureSize(s2DArray, int(lod)); + size.xy += textureSize(s1DArrayShadow, int(lod)); + size.xyz += textureSize(s2DArrayShadow, int(lod)); + size.x += textureSize(sBuffer); + size.xy += textureSize(s2DMS); + size.xyz += textureSize(s2DMSArray); + + return size; +} + +vec2 testTextureQueryLod() +{ + vec2 lod = vec2(0.0); + + lod += textureQueryLod(s1D, c1); + lod += textureQueryLod(s1D, f16c1); + lod += textureQueryLod(s2D, c2); + lod += textureQueryLod(s2D, f16c2); + lod += textureQueryLod(s3D, c3); + lod += textureQueryLod(s3D, f16c3); + lod += textureQueryLod(sCube, c3); + lod += textureQueryLod(sCube, f16c3); + lod += textureQueryLod(s1DArray, c1); + lod += textureQueryLod(s1DArray, f16c1); + lod += textureQueryLod(s2DArray, c2); + lod += textureQueryLod(s2DArray, f16c2); + lod += textureQueryLod(sCubeArray, c3); + lod += textureQueryLod(sCubeArray, f16c3); + lod += textureQueryLod(s1DShadow, c1); + lod += textureQueryLod(s1DShadow, f16c1); + lod += textureQueryLod(s2DShadow, c2); + lod += textureQueryLod(s2DShadow, f16c2); + lod += textureQueryLod(sCubeArrayShadow, c3); + lod += textureQueryLod(sCubeArrayShadow, f16c3); + lod += textureQueryLod(s1DArrayShadow, c1); + lod += textureQueryLod(s1DArrayShadow, f16c1); + lod += textureQueryLod(s2DArrayShadow, c2); + lod += textureQueryLod(s2DArrayShadow, f16c2); + lod += textureQueryLod(sCubeArrayShadow, c3); + lod += textureQueryLod(sCubeArrayShadow, f16c3); + + return lod; +} + +int testTextureQueryLevels() +{ + int levels = 0; + + levels += textureQueryLevels(s1D); + levels += textureQueryLevels(s2D); + levels += textureQueryLevels(s3D); + levels += textureQueryLevels(sCube); + levels += textureQueryLevels(s1DShadow); + levels += textureQueryLevels(s2DShadow); + levels += textureQueryLevels(sCubeShadow); + levels += textureQueryLevels(sCubeArray); + levels += textureQueryLevels(sCubeArrayShadow); + levels += textureQueryLevels(s1DArray); + levels += textureQueryLevels(s2DArray); + levels += textureQueryLevels(s1DArrayShadow); + levels += textureQueryLevels(s2DArrayShadow); + + return levels; +} + +int testTextureSamples() +{ + int samples = 0; + + samples += textureSamples(s2DMS); + samples += textureSamples(s2DMSArray); + + return samples; +} + +f16vec4 testImageLoad() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += imageLoad(i1D, int(c1)); + texel += imageLoad(i2D, ivec2(c2)); + texel += imageLoad(i3D, ivec3(c3)); + texel += imageLoad(i2DRect, ivec2(c2)); + texel += imageLoad(iCube, ivec3(c3)); + texel += imageLoad(iBuffer, int(c1)); + texel += imageLoad(i1DArray, ivec2(c2)); + texel += imageLoad(i2DArray, ivec3(c3)); + texel += imageLoad(iCubeArray, ivec3(c3)); + texel += imageLoad(i2DMS, ivec2(c2), 1); + texel += imageLoad(i2DMSArray, ivec3(c3), 1); + + return texel; +} + +void testImageStore(f16vec4 data) +{ + imageStore(i1D, int(c1), data); + imageStore(i2D, ivec2(c2), data); + imageStore(i3D, ivec3(c3), data); + imageStore(i2DRect, ivec2(c2), data); + imageStore(iCube, ivec3(c3), data); + imageStore(iBuffer, int(c1), data); + imageStore(i1DArray, ivec2(c2), data); + imageStore(i2DArray, ivec3(c3), data); + imageStore(iCubeArray, ivec3(c3), data); + imageStore(i2DMS, ivec2(c2), 1, data); + imageStore(i2DMSArray, ivec3(c3), 1, data); +} + +f16vec4 testSparseTexture() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureARB(s2D, c2, texel); + sparseTextureARB(s2D, f16c2, texel, f16bias); + sparseTextureARB(s3D, c3, texel); + sparseTextureARB(s3D, f16c3, texel, f16bias); + sparseTextureARB(sCube, c3, texel); + sparseTextureARB(sCube, f16c3, texel, f16bias); + sparseTextureARB(s2DShadow, c3, texel.x); + sparseTextureARB(s2DShadow, f16c2, compare, texel.x, f16bias); + sparseTextureARB(sCubeShadow, c4, texel.x); + sparseTextureARB(sCubeShadow, f16c3, compare, texel.x, f16bias); + sparseTextureARB(s2DArray, c3, texel); + sparseTextureARB(s2DArray, f16c3, texel, f16bias); + sparseTextureARB(sCubeArray, c4, texel); + sparseTextureARB(sCubeArray, f16c4, texel, f16bias); + sparseTextureARB(s2DArrayShadow, c4, texel.x); + sparseTextureARB(s2DArrayShadow, f16c3, compare, texel.x); + sparseTextureARB(s2DRect, c2, texel); + sparseTextureARB(s2DRect, f16c2, texel); + sparseTextureARB(s2DRectShadow, c3, texel.x); + sparseTextureARB(s2DRectShadow, f16c2, compare, texel.x); + sparseTextureARB(sCubeArrayShadow, c4, compare, texel.x); + sparseTextureARB(sCubeArrayShadow, f16c4, compare, texel.x); + + return texel; +} + +f16vec4 testSparseTextureLod() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureLodARB(s2D, c2, lod, texel); + sparseTextureLodARB(s2D, f16c2, f16lod, texel); + sparseTextureLodARB(s3D, c3, lod, texel); + sparseTextureLodARB(s3D, f16c3, f16lod, texel); + sparseTextureLodARB(sCube, c3, lod, texel); + sparseTextureLodARB(sCube, f16c3, f16lod, texel); + sparseTextureLodARB(s2DShadow, c3, lod, texel.x); + sparseTextureLodARB(s2DShadow, f16c2, compare, f16lod, texel.x); + sparseTextureLodARB(s2DArray, c3, lod, texel); + sparseTextureLodARB(s2DArray, f16c3, f16lod, texel); + sparseTextureLodARB(sCubeArray, c4, lod, texel); + sparseTextureLodARB(sCubeArray, f16c4, f16lod, texel); + + return texel; +} + +f16vec4 testSparseTextureOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureOffsetARB(s2D, c2, offset2, texel); + sparseTextureOffsetARB(s2D, f16c2, offset2, texel, f16bias); + sparseTextureOffsetARB(s3D, c3, offset3, texel); + sparseTextureOffsetARB(s3D, f16c3, offset3, texel, f16bias); + sparseTextureOffsetARB(s2DRect, c2, offset2, texel); + sparseTextureOffsetARB(s2DRect, f16c2, offset2, texel); + sparseTextureOffsetARB(s2DRectShadow, c3, offset2, texel.x); + sparseTextureOffsetARB(s2DRectShadow, f16c2, compare, offset2, texel.x); + sparseTextureOffsetARB(s2DShadow, c3, offset2, texel.x); + sparseTextureOffsetARB(s2DShadow, f16c2, compare, offset2, texel.x, f16bias); + sparseTextureOffsetARB(s2DArray, c3, offset2, texel); + sparseTextureOffsetARB(s2DArray, f16c3, offset2, texel, f16bias); + sparseTextureOffsetARB(s2DArrayShadow, c4, offset2, texel.x); + sparseTextureOffsetARB(s2DArrayShadow, f16c3, compare, offset2, texel.x); + + return texel; +} + +f16vec4 testSparseTextureLodOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureLodOffsetARB(s2D, c2, lod, offset2, texel); + sparseTextureLodOffsetARB(s2D, f16c2, f16lod, offset2, texel); + sparseTextureLodOffsetARB(s3D, c3, lod, offset3, texel); + sparseTextureLodOffsetARB(s3D, f16c3, f16lod, offset3, texel); + sparseTextureLodOffsetARB(s2DShadow, c3, lod, offset2, texel.x); + sparseTextureLodOffsetARB(s2DShadow, f16c2, compare, f16lod, offset2, texel.x); + sparseTextureLodOffsetARB(s2DArray, c3, lod, offset2, texel); + sparseTextureLodOffsetARB(s2DArray, f16c3, f16lod, offset2, texel); + + return texel; +} + +f16vec4 testSparseTextureGrad() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGradARB(s2D, c2, dPdxy2, dPdxy2, texel); + sparseTextureGradARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, texel); + sparseTextureGradARB(s3D, c3, dPdxy3, dPdxy3, texel); + sparseTextureGradARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, texel); + sparseTextureGradARB(sCube, c3, dPdxy3, dPdxy3, texel); + sparseTextureGradARB(sCube, f16c3, f16dPdxy3, f16dPdxy3, texel); + sparseTextureGradARB(s2DRect, c2, dPdxy2, dPdxy2, texel); + sparseTextureGradARB(s2DRect, f16c2, f16dPdxy2, f16dPdxy2, texel); + sparseTextureGradARB(s2DRectShadow, c3, dPdxy2, dPdxy2, texel.x); + sparseTextureGradARB(s2DRectShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, texel.x); + sparseTextureGradARB(s2DShadow, c3, dPdxy2, dPdxy2, texel.x); + sparseTextureGradARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, texel.x); + sparseTextureGradARB(sCubeShadow, c4, dPdxy3, dPdxy3, texel.x); + sparseTextureGradARB(sCubeShadow, f16c3, compare, f16dPdxy3, f16dPdxy3, texel.x); + sparseTextureGradARB(s2DArray, c3, dPdxy2, dPdxy2, texel); + sparseTextureGradARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, texel); + sparseTextureGradARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, texel.x); + sparseTextureGradARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, texel.x); + sparseTextureGradARB(sCubeArray, c4, dPdxy3, dPdxy3, texel); + sparseTextureGradARB(sCubeArray, f16c4, f16dPdxy3, f16dPdxy3, texel); + + return texel; +} + +f16vec4 testSparseTextureGradOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGradOffsetARB(s2D, c2, dPdxy2, dPdxy2, offset2, texel); + sparseTextureGradOffsetARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, offset2, texel); + sparseTextureGradOffsetARB(s3D, c3, dPdxy3, dPdxy3, offset3, texel); + sparseTextureGradOffsetARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, offset3, texel); + sparseTextureGradOffsetARB(s2DRect, c2, dPdxy2, dPdxy2, offset2, texel); + sparseTextureGradOffsetARB(s2DRect, f16c2, f16dPdxy2, f16dPdxy2, offset2, texel); + sparseTextureGradOffsetARB(s2DRectShadow, c3, dPdxy2, dPdxy2, offset2, texel.x); + sparseTextureGradOffsetARB(s2DRectShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2, texel.x); + sparseTextureGradOffsetARB(s2DShadow, c3, dPdxy2, dPdxy2, offset2, texel.x); + sparseTextureGradOffsetARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2, texel.x); + sparseTextureGradOffsetARB(s2DArray, c3, dPdxy2, dPdxy2, offset2, texel); + sparseTextureGradOffsetARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, offset2, texel); + sparseTextureGradOffsetARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, offset2, texel.x); + sparseTextureGradOffsetARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2, texel.x); + + return texel; +} + +f16vec4 testSparseTexelFetch() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTexelFetchARB(s2D, ivec2(c2), int(lod), texel); + sparseTexelFetchARB(s3D, ivec3(c3), int(lod), texel); + sparseTexelFetchARB(s2DRect, ivec2(c2), texel); + sparseTexelFetchARB(s2DArray, ivec3(c3), int(lod), texel); + sparseTexelFetchARB(s2DMS, ivec2(c2), 1, texel); + sparseTexelFetchARB(s2DMSArray, ivec3(c3), 2, texel); + + return texel; +} + +f16vec4 testSparseTexelFetchOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTexelFetchOffsetARB(s2D, ivec2(c2), int(lod), offset2, texel); + sparseTexelFetchOffsetARB(s3D, ivec3(c3), int(lod), offset3, texel); + sparseTexelFetchOffsetARB(s2DRect, ivec2(c2), offset2, texel); + sparseTexelFetchOffsetARB(s2DArray, ivec3(c3), int(lod), offset2, texel); + + return texel; +} + +f16vec4 testSparseTextureGather() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGatherARB(s2D, c2, texel, 0); + sparseTextureGatherARB(s2D, f16c2, texel, 0, f16bias); + sparseTextureGatherARB(s2DArray, c3, texel, 0); + sparseTextureGatherARB(s2DArray, f16c3, texel, 0, f16bias); + sparseTextureGatherARB(sCube, c3, texel, 0); + sparseTextureGatherARB(sCube, f16c3, texel, 0, f16bias); + sparseTextureGatherARB(sCubeArray, c4, texel, 0); + sparseTextureGatherARB(sCubeArray, f16c4, texel, 0, f16bias); + sparseTextureGatherARB(s2DRect, c2, texel, 0); + sparseTextureGatherARB(s2DRect, f16c2, texel, 0); + sparseTextureGatherARB(s2DShadow, c2, compare, texel); + sparseTextureGatherARB(s2DShadow, f16c2, compare, texel); + sparseTextureGatherARB(s2DArrayShadow, c3, compare, texel); + sparseTextureGatherARB(s2DArrayShadow, f16c3, compare, texel); + sparseTextureGatherARB(sCubeShadow, c3, compare, texel); + sparseTextureGatherARB(sCubeShadow, f16c3, compare, texel); + sparseTextureGatherARB(sCubeArrayShadow, c4, compare, texel); + sparseTextureGatherARB(sCubeArrayShadow, f16c4, compare, texel); + sparseTextureGatherARB(s2DRectShadow, c2, compare, texel); + sparseTextureGatherARB(s2DRectShadow, f16c2, compare, texel); + + return texel; +} + +f16vec4 testSparseTextureGatherOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGatherOffsetARB(s2D, c2, offset2, texel, 0); + sparseTextureGatherOffsetARB(s2D, f16c2, offset2, texel, 0, f16bias); + sparseTextureGatherOffsetARB(s2DArray, c3, offset2, texel, 0); + sparseTextureGatherOffsetARB(s2DArray, f16c3, offset2, texel, 0, f16bias); + sparseTextureGatherOffsetARB(s2DRect, c2, offset2, texel, 0); + sparseTextureGatherOffsetARB(s2DRect, f16c2, offset2, texel, 0); + sparseTextureGatherOffsetARB(s2DShadow, c2, compare, offset2, texel); + sparseTextureGatherOffsetARB(s2DShadow, f16c2, compare, offset2, texel); + sparseTextureGatherOffsetARB(s2DArrayShadow, c3, compare, offset2, texel); + sparseTextureGatherOffsetARB(s2DArrayShadow, f16c3, compare, offset2, texel); + sparseTextureGatherOffsetARB(s2DRectShadow, c2, compare, offset2, texel); + sparseTextureGatherOffsetARB(s2DRectShadow, f16c2, compare, offset2, texel); + + return texel; +} + +f16vec4 testSparseTextureGatherOffsets() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGatherOffsetsARB(s2D, c2, offsets, texel, 0); + sparseTextureGatherOffsetsARB(s2D, f16c2, offsets, texel, 0, f16bias); + sparseTextureGatherOffsetsARB(s2DArray, c3, offsets, texel, 0); + sparseTextureGatherOffsetsARB(s2DArray, f16c3, offsets, texel, 0, f16bias); + sparseTextureGatherOffsetsARB(s2DRect, c2, offsets, texel, 0); + sparseTextureGatherOffsetsARB(s2DRect, f16c2, offsets, texel, 0); + sparseTextureGatherOffsetsARB(s2DShadow, c2, compare, offsets, texel); + sparseTextureGatherOffsetsARB(s2DShadow, f16c2, compare, offsets, texel); + sparseTextureGatherOffsetsARB(s2DArrayShadow, c3, compare, offsets, texel); + sparseTextureGatherOffsetsARB(s2DArrayShadow, f16c3, compare, offsets, texel); + sparseTextureGatherOffsetsARB(s2DRectShadow, c2, compare, offsets, texel); + sparseTextureGatherOffsetsARB(s2DRectShadow, f16c2, compare, offsets, texel); + + return texel; +} + +f16vec4 testSparseTextureGatherLod() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGatherLodAMD(s2D, c2, lod, texel, 0); + sparseTextureGatherLodAMD(s2D, f16c2, f16lod, texel, 0); + sparseTextureGatherLodAMD(s2DArray, c3, lod, texel, 0); + sparseTextureGatherLodAMD(s2DArray, f16c3, f16lod, texel, 0); + sparseTextureGatherLodAMD(sCube, c3, lod, texel, 0); + sparseTextureGatherLodAMD(sCube, f16c3, f16lod, texel, 0); + sparseTextureGatherLodAMD(sCubeArray, c4, lod, texel, 0); + sparseTextureGatherLodAMD(sCubeArray, f16c4, f16lod, texel, 0); + + return texel; +} + +f16vec4 testSparseTextureGatherLodOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGatherLodOffsetAMD(s2D, c2, lod, offset2, texel, 0); + sparseTextureGatherLodOffsetAMD(s2D, f16c2, f16lod, offset2, texel, 0); + sparseTextureGatherLodOffsetAMD(s2DArray, c3, lod, offset2, texel, 0); + sparseTextureGatherLodOffsetAMD(s2DArray, f16c3, f16lod, offset2, texel, 0); + + return texel; +} + +f16vec4 testSparseTextureGatherLodOffsets() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGatherLodOffsetsAMD(s2D, c2, lod, offsets, texel, 0); + sparseTextureGatherLodOffsetsAMD(s2D, f16c2, f16lod, offsets, texel, 0); + sparseTextureGatherLodOffsetsAMD(s2DArray, c3, lod, offsets, texel, 0); + sparseTextureGatherLodOffsetsAMD(s2DArray, f16c3, f16lod, offsets, texel, 0); + + return texel; +} + +f16vec4 testSparseImageLoad() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseImageLoadARB(i2D, ivec2(c2), texel); + sparseImageLoadARB(i3D, ivec3(c3), texel); + sparseImageLoadARB(i2DRect, ivec2(c2), texel); + sparseImageLoadARB(iCube, ivec3(c3), texel); + sparseImageLoadARB(i2DArray, ivec3(c3), texel); + sparseImageLoadARB(iCubeArray, ivec3(c3), texel); + sparseImageLoadARB(i2DMS, ivec2(c2), 1, texel); + sparseImageLoadARB(i2DMSArray, ivec3(c3), 2, texel); + + return texel; +} + +f16vec4 testSparseTextureClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureClampARB(s2D, c2, lodClamp, texel); + sparseTextureClampARB(s2D, f16c2, f16lodClamp, texel, f16bias); + sparseTextureClampARB(s3D, c3, lodClamp, texel); + sparseTextureClampARB(s3D, f16c3, f16lodClamp, texel, f16bias); + sparseTextureClampARB(sCube, c3, lodClamp, texel); + sparseTextureClampARB(sCube, f16c3, f16lodClamp, texel, f16bias); + sparseTextureClampARB(s2DShadow, c3, lodClamp, texel.x); + sparseTextureClampARB(s2DShadow, f16c2, compare, f16lodClamp, texel.x, f16bias); + sparseTextureClampARB(sCubeShadow, c4, lodClamp, texel.x); + sparseTextureClampARB(sCubeShadow, f16c3, compare, f16lodClamp, texel.x, f16bias); + sparseTextureClampARB(s2DArray, c3, lodClamp, texel); + sparseTextureClampARB(s2DArray, f16c3, f16lodClamp, texel, f16bias); + sparseTextureClampARB(sCubeArray, c4, lodClamp, texel); + sparseTextureClampARB(sCubeArray, f16c4, f16lodClamp, texel, f16bias); + sparseTextureClampARB(s2DArrayShadow, c4, lodClamp, texel.x); + sparseTextureClampARB(s2DArrayShadow, f16c3, compare, f16lodClamp, texel.x); + sparseTextureClampARB(sCubeArrayShadow, c4, compare, lodClamp, texel.x); + sparseTextureClampARB(sCubeArrayShadow, f16c4, compare, f16lodClamp, texel.x); + + return texel; +} + +f16vec4 testTextureClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureClampARB(s1D, c1, lodClamp); + texel += textureClampARB(s1D, f16c1, f16lodClamp, f16bias); + texel += textureClampARB(s2D, c2, lodClamp); + texel += textureClampARB(s2D, f16c2, f16lodClamp, f16bias); + texel += textureClampARB(s3D, c3, lodClamp); + texel += textureClampARB(s3D, f16c3, f16lodClamp, f16bias); + texel += textureClampARB(sCube, c3, lodClamp); + texel += textureClampARB(sCube, f16c3, f16lodClamp, f16bias); + texel.x += textureClampARB(s1DShadow, c3, lodClamp); + texel.x += textureClampARB(s1DShadow, f16c2, compare, f16lodClamp, f16bias); + texel.x += textureClampARB(s2DShadow, c3, lodClamp); + texel.x += textureClampARB(s2DShadow, f16c2, compare, f16lodClamp, f16bias); + texel.x += textureClampARB(sCubeShadow, c4, lodClamp); + texel.x += textureClampARB(sCubeShadow, f16c3, compare, f16lodClamp, f16bias); + texel += textureClampARB(s1DArray, c2, lodClamp); + texel += textureClampARB(s1DArray, f16c2, f16lodClamp, f16bias); + texel += textureClampARB(s2DArray, c3, lodClamp); + texel += textureClampARB(s2DArray, f16c3, f16lodClamp, f16bias); + texel += textureClampARB(sCubeArray, c4, lodClamp); + texel += textureClampARB(sCubeArray, f16c4, f16lodClamp, f16bias); + texel.x += textureClampARB(s1DArrayShadow, c3, lodClamp); + texel.x += textureClampARB(s1DArrayShadow, f16c2, compare, f16lodClamp, f16bias); + texel.x += textureClampARB(s2DArrayShadow, c4, lodClamp); + texel.x += textureClampARB(s2DArrayShadow, f16c3, compare, f16lodClamp); + texel.x += textureClampARB(sCubeArrayShadow, c4, compare, lodClamp); + texel.x += textureClampARB(sCubeArrayShadow, f16c4, compare, f16lodClamp); + + return texel; +} + +f16vec4 testSparseTextureOffsetClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureOffsetClampARB(s2D, c2, offset2, lodClamp, texel); + sparseTextureOffsetClampARB(s2D, f16c2, offset2, f16lodClamp, texel, f16bias); + sparseTextureOffsetClampARB(s3D, c3, offset3, lodClamp, texel); + sparseTextureOffsetClampARB(s3D, f16c3, offset3, f16lodClamp, texel, f16bias); + sparseTextureOffsetClampARB(s2DShadow, c3, offset2, lodClamp, texel.x); + sparseTextureOffsetClampARB(s2DShadow, f16c2, compare, offset2, f16lodClamp, texel.x, f16bias); + sparseTextureOffsetClampARB(s2DArray, c3, offset2, lodClamp, texel); + sparseTextureOffsetClampARB(s2DArray, f16c3, offset2, f16lodClamp, texel, f16bias); + sparseTextureOffsetClampARB(s2DArrayShadow, c4, offset2, lodClamp, texel.x); + sparseTextureOffsetClampARB(s2DArrayShadow, f16c3, compare, offset2, f16lodClamp, texel.x); + + return texel; +} + +f16vec4 testTextureOffsetClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureOffsetClampARB(s1D, c1, offset1, lodClamp); + texel += textureOffsetClampARB(s1D, f16c1, offset1, f16lodClamp, f16bias); + texel += textureOffsetClampARB(s2D, c2, offset2, lodClamp); + texel += textureOffsetClampARB(s2D, f16c2, offset2, f16lodClamp, f16bias); + texel += textureOffsetClampARB(s3D, c3, offset3, lodClamp); + texel += textureOffsetClampARB(s3D, f16c3, offset3, f16lodClamp, f16bias); + texel.x += textureOffsetClampARB(s1DShadow, c3, offset1, lodClamp); + texel.x += textureOffsetClampARB(s1DShadow, f16c2, compare, offset1, f16lodClamp, f16bias); + texel.x += textureOffsetClampARB(s2DShadow, c3, offset2, lodClamp); + texel.x += textureOffsetClampARB(s2DShadow, f16c2, compare, offset2, f16lodClamp, f16bias); + texel += textureOffsetClampARB(s1DArray, c2, offset1, lodClamp); + texel += textureOffsetClampARB(s1DArray, f16c2, offset1, f16lodClamp, f16bias); + texel += textureOffsetClampARB(s2DArray, c3, offset2, lodClamp); + texel += textureOffsetClampARB(s2DArray, f16c3, offset2, f16lodClamp, f16bias); + texel.x += textureOffsetClampARB(s1DArrayShadow, c3, offset1, lodClamp); + texel.x += textureOffsetClampARB(s1DArrayShadow, f16c2, compare, offset1, f16lodClamp, f16bias); + texel.x += textureOffsetClampARB(s2DArrayShadow, c4, offset2, lodClamp); + texel.x += textureOffsetClampARB(s2DArrayShadow, f16c3, compare, offset2, f16lodClamp); + + return texel; +} + +f16vec4 testSparseTextureGradClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGradClampARB(s2D, c2, dPdxy2, dPdxy2, lodClamp, texel); + sparseTextureGradClampARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, f16lodClamp, texel); + sparseTextureGradClampARB(s3D, c3, dPdxy3, dPdxy3, lodClamp, texel); + sparseTextureGradClampARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, f16lodClamp, texel); + sparseTextureGradClampARB(sCube, c3, dPdxy3, dPdxy3, lodClamp, texel); + sparseTextureGradClampARB(sCube, f16c3, f16dPdxy3, f16dPdxy3, f16lodClamp, texel); + sparseTextureGradClampARB(s2DShadow, c3, dPdxy2, dPdxy2, lodClamp, texel.x); + sparseTextureGradClampARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, f16lodClamp, texel.x); + sparseTextureGradClampARB(sCubeShadow, c4, dPdxy3, dPdxy3, lodClamp, texel.x); + sparseTextureGradClampARB(sCubeShadow, f16c3, compare, f16dPdxy3, f16dPdxy3, f16lodClamp, texel.x); + sparseTextureGradClampARB(s2DArray, c3, dPdxy2, dPdxy2, lodClamp, texel); + sparseTextureGradClampARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, f16lodClamp, texel); + sparseTextureGradClampARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, lodClamp, texel.x); + sparseTextureGradClampARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, f16lodClamp, texel.x); + sparseTextureGradClampARB(sCubeArray, c4, dPdxy3, dPdxy3, lodClamp, texel); + sparseTextureGradClampARB(sCubeArray, f16c4, f16dPdxy3, f16dPdxy3, f16lodClamp, texel); + + return texel; +} + +f16vec4 testTextureGradClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGradClampARB(s1D, c1, dPdxy1, dPdxy1, lodClamp); + texel += textureGradClampARB(s1D, f16c1, f16dPdxy1, f16dPdxy1, f16lodClamp); + texel += textureGradClampARB(s2D, c2, dPdxy2, dPdxy2, lodClamp); + texel += textureGradClampARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, f16lodClamp); + texel += textureGradClampARB(s3D, c3, dPdxy3, dPdxy3, lodClamp); + texel += textureGradClampARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, f16lodClamp); + texel += textureGradClampARB(sCube, c3, dPdxy3, dPdxy3, lodClamp); + texel += textureGradClampARB(sCube, f16c3, f16dPdxy3, f16dPdxy3, f16lodClamp); + texel.x += textureGradClampARB(s1DShadow, c3, dPdxy1, dPdxy1, lodClamp); + texel.x += textureGradClampARB(s1DShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, f16lodClamp); + texel.x += textureGradClampARB(s2DShadow, c3, dPdxy2, dPdxy2, lodClamp); + texel.x += textureGradClampARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, f16lodClamp); + texel.x += textureGradClampARB(sCubeShadow, c4, dPdxy3, dPdxy3, lodClamp); + texel.x += textureGradClampARB(sCubeShadow, f16c3, compare, f16dPdxy3, f16dPdxy3, f16lodClamp); + texel += textureGradClampARB(s1DArray, c2, dPdxy1, dPdxy1, lodClamp); + texel += textureGradClampARB(s1DArray, f16c2, f16dPdxy1, f16dPdxy1, f16lodClamp); + texel += textureGradClampARB(s2DArray, c3, dPdxy2, dPdxy2, lodClamp); + texel += textureGradClampARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, f16lodClamp); + texel.x += textureGradClampARB(s1DArrayShadow, c3, dPdxy1, dPdxy1, lodClamp); + texel.x += textureGradClampARB(s1DArrayShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, f16lodClamp); + texel.x += textureGradClampARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, lodClamp); + texel.x += textureGradClampARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, f16lodClamp); + texel += textureGradClampARB(sCubeArray, c4, dPdxy3, dPdxy3, lodClamp); + texel += textureGradClampARB(sCubeArray, f16c4, f16dPdxy3, f16dPdxy3, f16lodClamp); + + return texel; +} + +f16vec4 testSparseTextureGradOffsetClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGradOffsetClampARB(s2D, c2, dPdxy2, dPdxy2, offset2, lodClamp, texel); + sparseTextureGradOffsetClampARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp, texel); + sparseTextureGradOffsetClampARB(s3D, c3, dPdxy3, dPdxy3, offset3, lodClamp, texel); + sparseTextureGradOffsetClampARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, offset3, f16lodClamp, texel); + sparseTextureGradOffsetClampARB(s2DShadow, c3, dPdxy2, dPdxy2, offset2, lodClamp, texel.x); + sparseTextureGradOffsetClampARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp, texel.x); + sparseTextureGradOffsetClampARB(s2DArray, c3, dPdxy2, dPdxy2, offset2, lodClamp, texel); + sparseTextureGradOffsetClampARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp, texel); + sparseTextureGradOffsetClampARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, offset2, lodClamp, texel.x); + sparseTextureGradOffsetClampARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp, texel.x); + + return texel; +} + +f16vec4 testTextureGradOffsetClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGradOffsetClampARB(s1D, c1, dPdxy1, dPdxy1, offset1, lodClamp); + texel += textureGradOffsetClampARB(s1D, f16c1, f16dPdxy1, f16dPdxy1, offset1, f16lodClamp); + texel += textureGradOffsetClampARB(s2D, c2, dPdxy2, dPdxy2, offset2, lodClamp); + texel += textureGradOffsetClampARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp); + texel += textureGradOffsetClampARB(s3D, c3, dPdxy3, dPdxy3, offset3, lodClamp); + texel += textureGradOffsetClampARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, offset3, f16lodClamp); + texel.x += textureGradOffsetClampARB(s1DShadow, c3, dPdxy1, dPdxy1, offset1, lodClamp); + texel.x += textureGradOffsetClampARB(s1DShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, offset1, f16lodClamp); + texel.x += textureGradOffsetClampARB(s2DShadow, c3, dPdxy2, dPdxy2, offset2, lodClamp); + texel.x += textureGradOffsetClampARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp); + texel += textureGradOffsetClampARB(s1DArray, c2, dPdxy1, dPdxy1, offset1, lodClamp); + texel += textureGradOffsetClampARB(s1DArray, f16c2, f16dPdxy1, f16dPdxy1, offset1, f16lodClamp); + texel += textureGradOffsetClampARB(s2DArray, c3, dPdxy2, dPdxy2, offset2, lodClamp); + texel += textureGradOffsetClampARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp); + texel.x += textureGradOffsetClampARB(s1DArrayShadow, c3, dPdxy1, dPdxy1, offset1, lodClamp); + texel.x += textureGradOffsetClampARB(s1DArrayShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, offset1, f16lodClamp); + texel.x += textureGradOffsetClampARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, offset2, lodClamp); + texel.x += textureGradOffsetClampARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp); + + return texel; +} + +f16vec4 testCombinedTextureSampler() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += texture(f16sampler1D(t1D, s), c1); + texel += texture(f16sampler1D(t1D, s), f16c1, f16bias); + texel += texture(f16sampler2D(t2D, s), c2); + texel += texture(f16sampler2D(t2D, s), f16c2, f16bias); + texel += texture(f16sampler3D(t3D, s), c3); + texel += texture(f16sampler3D(t3D, s), f16c3, f16bias); + texel += texture(f16samplerCube(tCube, s), c3); + texel += texture(f16samplerCube(tCube, s), f16c3, f16bias); + texel.x += texture(f16sampler1DShadow(t1D, sShadow), c3); + texel.x += texture(f16sampler1DShadow(t1D, sShadow), f16c2, compare, f16bias); + texel.x += texture(f16sampler2DShadow(t2D, sShadow), c3); + texel.x += texture(f16sampler2DShadow(t2D, sShadow), f16c2, compare, f16bias); + texel.x += texture(f16samplerCubeShadow(tCube, sShadow), c4); + texel.x += texture(f16samplerCubeShadow(tCube, sShadow), f16c3, compare, f16bias); + texel += texture(f16sampler1DArray(t1DArray, s), c2); + texel += texture(f16sampler1DArray(t1DArray, s), f16c2, f16bias); + texel += texture(f16sampler2DArray(t2DArray, s), c3); + texel += texture(f16sampler2DArray(t2DArray, s), f16c3, f16bias); + texel += texture(f16samplerCubeArray(tCubeArray, s), c4); + texel += texture(f16samplerCubeArray(tCubeArray, s), f16c4, f16bias); + texel.x += texture(f16sampler1DArrayShadow(t1DArray, sShadow), c3); + texel.x += texture(f16sampler1DArrayShadow(t1DArray, sShadow), f16c2, compare, f16bias); + texel.x += texture(f16sampler2DArrayShadow(t2DArray, sShadow), c4); + texel.x += texture(f16sampler2DArrayShadow(t2DArray, sShadow), f16c3, compare); + texel += texture(f16sampler2DRect(t2DRect, s), c2); + texel += texture(f16sampler2DRect(t2DRect, s), f16c2); + texel.x += texture(f16sampler2DRectShadow(t2DRect, sShadow), c3); + texel.x += texture(f16sampler2DRectShadow(t2DRect, sShadow), f16c2, compare); + texel.x += texture(f16samplerCubeArrayShadow(tCubeArray, sShadow), c4, compare); + texel.x += texture(f16samplerCubeArrayShadow(tCubeArray, sShadow), f16c4, compare); + + return texel; +} + +f16vec4 testSubpassLoad() +{ + return subpassLoad(subpass) + subpassLoad(subpassMS, 2); +} + +void main() +{ + f16vec4 result = f16vec4(0.0hf); + + result += testTexture(); + result += testTextureProj(); + result += testTextureLod(); + result += testTextureOffset(); + result += testTextureLodOffset(); + result += testTextureProjLodOffset(); + result += testTexelFetch(); + result += testTexelFetchOffset(); + result += testTextureGrad(); + result += testTextureGradOffset(); + result += testTextureProjGrad(); + result += testTextureProjGradoffset(); + result += testTextureGather(); + result += testTextureGatherOffset(); + result += testTextureGatherOffsets(); + result += testTextureGatherLod(); + result += testTextureGatherLodOffset(); + result += testTextureGatherLodOffsets(); + + result += f16vec4(testTextureSize()); + result.xy += f16vec2(testTextureQueryLod()); + result.x += float16_t(testTextureQueryLevels()); + result.x += float16_t(testTextureSamples()); + + result += testImageLoad(); + testImageStore(result); + + result += testSparseTexture(); + result += testSparseTextureLod(); + result += testSparseTextureOffset(); + result += testSparseTextureLodOffset(); + result += testSparseTextureGrad(); + result += testSparseTextureGradOffset(); + result += testSparseTexelFetch(); + result += testSparseTexelFetchOffset(); + result += testSparseTextureGather(); + result += testSparseTextureGatherOffset(); + result += testSparseTextureGatherOffsets(); + result += testSparseTextureGatherLod(); + result += testSparseTextureGatherLodOffset(); + result += testSparseTextureGatherLodOffsets(); + + result += testSparseImageLoad(); + + result += testSparseTextureClamp(); + result += testTextureClamp(); + result += testSparseTextureOffsetClamp(); + result += testTextureOffsetClamp(); + result += testSparseTextureGrad(); + result += testTextureGrad(); + result += testSparseTextureGradOffsetClamp(); + result += testTextureGradOffsetClamp(); + + result += testCombinedTextureSampler(); + result += testSubpassLoad(); + + fragColor = result; +} diff --git a/deps/glslang/Test/spv.float32.frag b/deps/glslang/Test/spv.float32.frag new file mode 100644 index 00000000..471f6b3b --- /dev/null +++ b/deps/glslang/Test/spv.float32.frag @@ -0,0 +1,277 @@ +#version 450 + +#extension GL_KHX_shader_explicit_arithmetic_types: enable +#extension GL_KHX_shader_explicit_arithmetic_types_int8: require +#extension GL_KHX_shader_explicit_arithmetic_types_int16: require +#extension GL_KHX_shader_explicit_arithmetic_types_int32: require +#extension GL_KHX_shader_explicit_arithmetic_types_int64: require +#extension GL_KHX_shader_explicit_arithmetic_types_float16: require +#extension GL_KHX_shader_explicit_arithmetic_types_float32: require +#extension GL_KHX_shader_explicit_arithmetic_types_float64: require + +void main() +{ +} + +// Single float literals +void literal() +{ + const float32_t f32c = 0.000001f; + const f32vec2 f32cv = f32vec2(-0.25F, 0.03f); + + f32vec2 f32v; + f32v.x = f32c; + f32v += f32cv; +} + +// Block memory layout +struct S +{ + float32_t x; + f32vec2 y; + f32vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + float32_t a; + f32vec2 b; + f32vec3 c; + float32_t d[2]; + f32mat2x3 e; + f32mat2x3 f[2]; + S g; + S h[2]; +}; + +// Specialization constant +layout(constant_id = 100) const float16_t sf16 = 0.125hf; +layout(constant_id = 101) const float32_t sf = 0.25; +layout(constant_id = 102) const float64_t sd = 0.5lf; + +const float f16_to_f = float(sf16); +const double f16_to_d = float(sf16); + +const float16_t f_to_f16 = float16_t(sf); +const float16_t d_to_f16 = float16_t(sd); + +void operators() +{ + float32_t f32; + f32vec2 f32v; + f32mat2x2 f32m; + bool b; + + // Arithmetic + f32v += f32v; + f32v -= f32v; + f32v *= f32v; + f32v /= f32v; + f32v++; + f32v--; + ++f32m; + --f32m; + f32v = -f32v; + f32m = -f32m; + + f32 = f32v.x + f32v.y; + f32 = f32v.x - f32v.y; + f32 = f32v.x * f32v.y; + f32 = f32v.x / f32v.y; + + // Relational + b = (f32v.x != f32); + b = (f32v.y == f32); + b = (f32v.x > f32); + b = (f32v.y < f32); + b = (f32v.x >= f32); + b = (f32v.y <= f32); + + // Vector/matrix operations + f32v = f32v * f32; + f32m = f32m * f32; + f32v = f32m * f32v; + f32v = f32v * f32m; + f32m = f32m * f32m; +} + +void typeCast() +{ + bvec3 bv; + f32vec3 f32v; + f64vec3 f64v; + i8vec3 i8v; + u8vec3 u8v; + i16vec3 i16v; + u16vec3 u16v; + i32vec3 i32v; + u32vec3 u32v; + i64vec3 i64v; + u64vec3 u64v; + f16vec3 f16v; + + f64v = f32v; // float32_t -> float64_t + + f32v = f32vec3(bv); // bool -> float32 + bv = bvec3(f32v); // float32 -> bool + + f32v = f32vec3(f64v); // double -> float32 + f64v = f64vec3(f32v); // float32 -> double + + f32v = f32vec3(f16v); // float16 -> float32 + f16v = f16vec3(f32v); // float32 -> float16 + + i8v = i8vec3(f32v); // float32 -> int8 + i16v = i16vec3(f32v); // float32 -> int16 + i32v = i32vec3(f32v); // float32 -> int32 + i64v = i64vec3(f32v); // float32 -> int64 + + u8v = u8vec3(f32v); // float32 -> uint8 + u16v = u16vec3(f32v); // float32 -> uint16 + u32v = u32vec3(f32v); // float32 -> uint32 + u64v = u64vec3(f32v); // float32 -> uint64 +} + +void builtinAngleTrigFuncs() +{ + f32vec4 f32v1, f32v2; + + f32v2 = radians(f32v1); + f32v2 = degrees(f32v1); + f32v2 = sin(f32v1); + f32v2 = cos(f32v1); + f32v2 = tan(f32v1); + f32v2 = asin(f32v1); + f32v2 = acos(f32v1); + f32v2 = atan(f32v1, f32v2); + f32v2 = atan(f32v1); + f32v2 = sinh(f32v1); + f32v2 = cosh(f32v1); + f32v2 = tanh(f32v1); + f32v2 = asinh(f32v1); + f32v2 = acosh(f32v1); + f32v2 = atanh(f32v1); +} + +void builtinExpFuncs() +{ + f32vec2 f32v1, f32v2; + + f32v2 = pow(f32v1, f32v2); + f32v2 = exp(f32v1); + f32v2 = log(f32v1); + f32v2 = exp2(f32v1); + f32v2 = log2(f32v1); + f32v2 = sqrt(f32v1); + f32v2 = inversesqrt(f32v1); +} + +void builtinCommonFuncs() +{ + f32vec3 f32v1, f32v2, f32v3; + float32_t f32; + bool b; + bvec3 bv; + ivec3 iv; + + f32v2 = abs(f32v1); + f32v2 = sign(f32v1); + f32v2 = floor(f32v1); + f32v2 = trunc(f32v1); + f32v2 = round(f32v1); + f32v2 = roundEven(f32v1); + f32v2 = ceil(f32v1); + f32v2 = fract(f32v1); + f32v2 = mod(f32v1, f32v2); + f32v2 = mod(f32v1, f32); + f32v3 = modf(f32v1, f32v2); + f32v3 = min(f32v1, f32v2); + f32v3 = min(f32v1, f32); + f32v3 = max(f32v1, f32v2); + f32v3 = max(f32v1, f32); + f32v3 = clamp(f32v1, f32, f32v2.x); + f32v3 = clamp(f32v1, f32v2, f32vec3(f32)); + f32v3 = mix(f32v1, f32v2, f32); + f32v3 = mix(f32v1, f32v2, f32v3); + f32v3 = mix(f32v1, f32v2, bv); + f32v3 = step(f32v1, f32v2); + f32v3 = step(f32, f32v3); + f32v3 = smoothstep(f32v1, f32v2, f32v3); + f32v3 = smoothstep(f32, f32v1.x, f32v2); + b = isnan(f32); + bv = isinf(f32v1); + f32v3 = fma(f32v1, f32v2, f32v3); + f32v2 = frexp(f32v1, iv); + f32v2 = ldexp(f32v1, iv); +} + +void builtinGeometryFuncs() +{ + float32_t f32; + f32vec3 f32v1, f32v2, f32v3; + + f32 = length(f32v1); + f32 = distance(f32v1, f32v2); + f32 = dot(f32v1, f32v2); + f32v3 = cross(f32v1, f32v2); + f32v2 = normalize(f32v1); + f32v3 = faceforward(f32v1, f32v2, f32v3); + f32v3 = reflect(f32v1, f32v2); + f32v3 = refract(f32v1, f32v2, f32); +} + +void builtinMatrixFuncs() +{ + f32mat2x3 f32m1, f32m2, f32m3; + f32mat3x2 f32m4; + f32mat3 f32m5; + f32mat4 f32m6, f32m7; + + f32vec3 f32v1; + f32vec2 f32v2; + + float32_t f32; + + f32m3 = matrixCompMult(f32m1, f32m2); + f32m1 = outerProduct(f32v1, f32v2); + f32m4 = transpose(f32m1); + f32 = determinant(f32m5); + f32m6 = inverse(f32m7); +} + +void builtinVecRelFuncs() +{ + f32vec3 f32v1, f32v2; + bvec3 bv; + + bv = lessThan(f32v1, f32v2); + bv = lessThanEqual(f32v1, f32v2); + bv = greaterThan(f32v1, f32v2); + bv = greaterThanEqual(f32v1, f32v2); + bv = equal(f32v1, f32v2); + bv = notEqual(f32v1, f32v2); +} + +in f32vec3 if32v; + +void builtinFragProcFuncs() +{ + f32vec3 f32v; + + // Derivative + f32v.x = dFdx(if32v.x); + f32v.y = dFdy(if32v.y); + f32v.xy = dFdxFine(if32v.xy); + f32v.xy = dFdyFine(if32v.xy); + f32v = dFdxCoarse(if32v); + f32v = dFdxCoarse(if32v); + + f32v.x = fwidth(if32v.x); + f32v.xy = fwidthFine(if32v.xy); + f32v = fwidthCoarse(if32v); + + // Interpolation + f32v.x = interpolateAtCentroid(if32v.x); + f32v.xy = interpolateAtSample(if32v.xy, 1); + f32v = interpolateAtOffset(if32v, f32vec2(0.5f)); +} diff --git a/deps/glslang/Test/spv.float64.frag b/deps/glslang/Test/spv.float64.frag new file mode 100644 index 00000000..efbec77d --- /dev/null +++ b/deps/glslang/Test/spv.float64.frag @@ -0,0 +1,272 @@ +#version 450 + +#extension GL_KHX_shader_explicit_arithmetic_types: enable +#extension GL_KHX_shader_explicit_arithmetic_types_int8: require +#extension GL_KHX_shader_explicit_arithmetic_types_int16: require +#extension GL_KHX_shader_explicit_arithmetic_types_int32: require +#extension GL_KHX_shader_explicit_arithmetic_types_int64: require +#extension GL_KHX_shader_explicit_arithmetic_types_float16: require +#extension GL_KHX_shader_explicit_arithmetic_types_float32: require +#extension GL_KHX_shader_explicit_arithmetic_types_float64: require + +void main() +{ +} + +// Single float literals +void literal() +{ + const float64_t f64c = 0.000001LF; + const f64vec2 f64cv = f64vec2(-0.25lF, 0.03Lf); + + f64vec2 f64v; + f64v.x = f64c; + f64v += f64cv; +} + +// Block memory layout +struct S +{ + float64_t x; + f64vec2 y; + f64vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + float64_t a; + f64vec2 b; + f64vec3 c; + float64_t d[2]; + f64mat2x3 e; + f64mat2x3 f[2]; + S g; + S h[2]; +}; + +// Specialization constant +layout(constant_id = 100) const float16_t sf16 = 0.125hf; +layout(constant_id = 101) const float32_t sf = 0.25; +layout(constant_id = 102) const float64_t sd = 0.5lf; + +const float f16_to_f = float(sf16); +const double f16_to_d = float(sf16); + +const float16_t f_to_f16 = float16_t(sf); +const float16_t d_to_f16 = float16_t(sd); + +void operators() +{ + float64_t f64; + f64vec2 f64v; + f64mat2x2 f64m; + bool b; + + // Arithmetic + f64v += f64v; + f64v -= f64v; + f64v *= f64v; + f64v /= f64v; + f64v++; + f64v--; + ++f64m; + --f64m; + f64v = -f64v; + f64m = -f64m; + + f64 = f64v.x + f64v.y; + f64 = f64v.x - f64v.y; + f64 = f64v.x * f64v.y; + f64 = f64v.x / f64v.y; + + // Relational + b = (f64v.x != f64); + b = (f64v.y == f64); + b = (f64v.x > f64); + b = (f64v.y < f64); + b = (f64v.x >= f64); + b = (f64v.y <= f64); + + // Vector/matrix operations + f64v = f64v * f64; + f64m = f64m * f64; + f64v = f64m * f64v; + f64v = f64v * f64m; + f64m = f64m * f64m; +} + +void typeCast() +{ + bvec3 bv; + f32vec3 f32v; + f64vec3 f64v; + i8vec3 i8v; + u8vec3 u8v; + i16vec3 i16v; + u16vec3 u16v; + i32vec3 i32v; + u32vec3 u32v; + i64vec3 i64v; + u64vec3 u64v; + f16vec3 f16v; + + f64v = f64vec3(bv); // bool -> float64 + bv = bvec3(f64v); // float64 -> bool + + f64v = f64vec3(f16v); // float16 -> float64 + f16v = f16vec3(f64v); // float64 -> float16 + + i8v = i8vec3(f64v); // float64 -> int8 + i16v = i16vec3(f64v); // float64 -> int16 + i32v = i32vec3(f64v); // float64 -> int32 + i64v = i64vec3(f64v); // float64 -> int64 + + u8v = u8vec3(f64v); // float64 -> uint8 + u16v = u16vec3(f64v); // float64 -> uint16 + u32v = u32vec3(f64v); // float64 -> uint32 + u64v = u64vec3(f64v); // float64 -> uint64 +} + +void builtinAngleTrigFuncs() +{ + f64vec4 f64v1, f64v2; + + f64v2 = radians(f64v1); + f64v2 = degrees(f64v1); + f64v2 = sin(f64v1); + f64v2 = cos(f64v1); + f64v2 = tan(f64v1); + f64v2 = asin(f64v1); + f64v2 = acos(f64v1); + f64v2 = atan(f64v1, f64v2); + f64v2 = atan(f64v1); + f64v2 = sinh(f64v1); + f64v2 = cosh(f64v1); + f64v2 = tanh(f64v1); + f64v2 = asinh(f64v1); + f64v2 = acosh(f64v1); + f64v2 = atanh(f64v1); +} + +void builtinExpFuncs() +{ + f64vec2 f64v1, f64v2; + + f64v2 = pow(f64v1, f64v2); + f64v2 = exp(f64v1); + f64v2 = log(f64v1); + f64v2 = exp2(f64v1); + f64v2 = log2(f64v1); + f64v2 = sqrt(f64v1); + f64v2 = inversesqrt(f64v1); +} + +void builtinCommonFuncs() +{ + f64vec3 f64v1, f64v2, f64v3; + float64_t f64; + bool b; + bvec3 bv; + ivec3 iv; + + f64v2 = abs(f64v1); + f64v2 = sign(f64v1); + f64v2 = floor(f64v1); + f64v2 = trunc(f64v1); + f64v2 = round(f64v1); + f64v2 = roundEven(f64v1); + f64v2 = ceil(f64v1); + f64v2 = fract(f64v1); + f64v2 = mod(f64v1, f64v2); + f64v2 = mod(f64v1, f64); + f64v3 = modf(f64v1, f64v2); + f64v3 = min(f64v1, f64v2); + f64v3 = min(f64v1, f64); + f64v3 = max(f64v1, f64v2); + f64v3 = max(f64v1, f64); + f64v3 = clamp(f64v1, f64, f64v2.x); + f64v3 = clamp(f64v1, f64v2, f64vec3(f64)); + f64v3 = mix(f64v1, f64v2, f64); + f64v3 = mix(f64v1, f64v2, f64v3); + f64v3 = mix(f64v1, f64v2, bv); + f64v3 = step(f64v1, f64v2); + f64v3 = step(f64, f64v3); + f64v3 = smoothstep(f64v1, f64v2, f64v3); + f64v3 = smoothstep(f64, f64v1.x, f64v2); + b = isnan(f64); + bv = isinf(f64v1); + f64v3 = fma(f64v1, f64v2, f64v3); + f64v2 = frexp(f64v1, iv); + f64v2 = ldexp(f64v1, iv); +} + +void builtinGeometryFuncs() +{ + float64_t f64; + f64vec3 f64v1, f64v2, f64v3; + + f64 = length(f64v1); + f64 = distance(f64v1, f64v2); + f64 = dot(f64v1, f64v2); + f64v3 = cross(f64v1, f64v2); + f64v2 = normalize(f64v1); + f64v3 = faceforward(f64v1, f64v2, f64v3); + f64v3 = reflect(f64v1, f64v2); + f64v3 = refract(f64v1, f64v2, f64); +} + +void builtinMatrixFuncs() +{ + f64mat2x3 f64m1, f64m2, f64m3; + f64mat3x2 f64m4; + f64mat3 f64m5; + f64mat4 f64m6, f64m7; + + f64vec3 f64v1; + f64vec2 f64v2; + + float64_t f64; + + f64m3 = matrixCompMult(f64m1, f64m2); + f64m1 = outerProduct(f64v1, f64v2); + f64m4 = transpose(f64m1); + f64 = determinant(f64m5); + f64m6 = inverse(f64m7); +} + +void builtinVecRelFuncs() +{ + f64vec3 f64v1, f64v2; + bvec3 bv; + + bv = lessThan(f64v1, f64v2); + bv = lessThanEqual(f64v1, f64v2); + bv = greaterThan(f64v1, f64v2); + bv = greaterThanEqual(f64v1, f64v2); + bv = equal(f64v1, f64v2); + bv = notEqual(f64v1, f64v2); +} + +in flat f64vec3 if64v; + +void builtinFragProcFuncs() +{ + f64vec3 f64v; + + // Derivative + f64v.x = dFdx(if64v.x); + f64v.y = dFdy(if64v.y); + f64v.xy = dFdxFine(if64v.xy); + f64v.xy = dFdyFine(if64v.xy); + f64v = dFdxCoarse(if64v); + f64v = dFdxCoarse(if64v); + + f64v.x = fwidth(if64v.x); + f64v.xy = fwidthFine(if64v.xy); + f64v = fwidthCoarse(if64v); + + // Interpolation + f64v.x = interpolateAtCentroid(if64v.x); + f64v.xy = interpolateAtSample(if64v.xy, 1); + f64v = interpolateAtOffset(if64v, f64vec2(0.5f)); +} diff --git a/deps/glslang/Test/spv.flowControl.frag b/deps/glslang/Test/spv.flowControl.frag new file mode 100644 index 00000000..f10c7673 --- /dev/null +++ b/deps/glslang/Test/spv.flowControl.frag @@ -0,0 +1,23 @@ +#version 140 + +in float d; +in vec4 bigColor, smallColor; +in vec4 otherColor; + +in float c; +in vec4 BaseColor; + +void main() +{ + vec4 color = BaseColor; + vec4 color2; + + color2 = otherColor; + + if (c > d) + color += bigColor; + else + color += smallColor; + + gl_FragColor = color * color2; +} diff --git a/deps/glslang/Test/spv.for-complex-condition.vert b/deps/glslang/Test/spv.for-complex-condition.vert new file mode 100644 index 00000000..81dd6489 --- /dev/null +++ b/deps/glslang/Test/spv.for-complex-condition.vert @@ -0,0 +1,7 @@ +#version 450 +layout(location=0) out highp int r; +layout(location=0) in lowp int flag; +void main() { + int i; + for (i=0; i < (flag==1 ? 10 : 15) ; i++) { r = i; } +} diff --git a/deps/glslang/Test/spv.for-continue-break.vert b/deps/glslang/Test/spv.for-continue-break.vert new file mode 100644 index 00000000..afa31f2b --- /dev/null +++ b/deps/glslang/Test/spv.for-continue-break.vert @@ -0,0 +1,20 @@ +#version 310 es +void main() { + int i; + int A, B, C, D, E, F, G; + for (i=0; i < 10 ; i++) { + A = 1; + if (i%2 ==0) { + B = 1; + continue; + C = 1; + } + if (i%3 == 0) { + D = 1; + break; + E = 1; + } + F = 12; + } + G = 99; +} diff --git a/deps/glslang/Test/spv.for-nobody.vert b/deps/glslang/Test/spv.for-nobody.vert new file mode 100644 index 00000000..99634761 --- /dev/null +++ b/deps/glslang/Test/spv.for-nobody.vert @@ -0,0 +1,7 @@ +#version 450 +layout(location=0) out highp int r; +void main() { + int i; + for (i=0; i<10; i++); + r = i; +} diff --git a/deps/glslang/Test/spv.for-notest.vert b/deps/glslang/Test/spv.for-notest.vert new file mode 100644 index 00000000..f40e6664 --- /dev/null +++ b/deps/glslang/Test/spv.for-notest.vert @@ -0,0 +1,6 @@ +#version 450 +layout(location=0) out highp int r; +void main() { + int i; + for (i=0; ; i++) { r = i; } +} diff --git a/deps/glslang/Test/spv.for-simple.vert b/deps/glslang/Test/spv.for-simple.vert new file mode 100644 index 00000000..a5be6db2 --- /dev/null +++ b/deps/glslang/Test/spv.for-simple.vert @@ -0,0 +1,8 @@ +#version 310 es +void main() { + int i; + int j; + for (i=0; i < 10 ; i++) { + j = 12; + } +} diff --git a/deps/glslang/Test/spv.forLoop.frag b/deps/glslang/Test/spv.forLoop.frag new file mode 100644 index 00000000..dfa58ad4 --- /dev/null +++ b/deps/glslang/Test/spv.forLoop.frag @@ -0,0 +1,41 @@ +#version 140 + +in vec4 bigColor; +in vec4 BaseColor; +in float f; + +flat in int Count; +flat in uvec4 v4; + +void main() +{ + vec4 color = BaseColor; + + for (int i = 0; i < Count; ++i) { + color += bigColor; + } + + gl_FragColor = color; + + float sum = 0.0; + for (int i = 0; i < 4; ++i) + sum += v4[i]; + + vec4 tv4; + + for (int i = 0; i < 4; ++i) + tv4[i] = v4[i] * 4u; + + gl_FragColor += vec4(sum) + tv4; + + vec4 r; + r.xyz = BaseColor.xyz; + + for (int i = 0; i < Count; ++i) + r.w = f; + + gl_FragColor.xyz += r.xyz; + + for (int i = 0; i < 16; i += 4) + gl_FragColor *= f; +} diff --git a/deps/glslang/Test/spv.forwardFun.frag b/deps/glslang/Test/spv.forwardFun.frag new file mode 100644 index 00000000..0a71521e --- /dev/null +++ b/deps/glslang/Test/spv.forwardFun.frag @@ -0,0 +1,39 @@ +#version 140 + +precision mediump float; + +in vec4 bigColor; +in vec4 BaseColor; +in float d; + +void bar(); +float foo(vec4); +float unreachableReturn(); + +void main() +{ + vec4 color = vec4(foo(BaseColor)); + + bar(); + float f = unreachableReturn(); + + gl_FragColor = color * f; +} + +void bar() +{ +} + +float unreachableReturn() +{ + bar(); + if (d < 4.2) + return 1.2; + else + return 4.5; +} + +float foo(vec4 bar) +{ + return bar.x + bar.y; +} diff --git a/deps/glslang/Test/spv.fragmentShaderBarycentric.frag b/deps/glslang/Test/spv.fragmentShaderBarycentric.frag new file mode 100644 index 00000000..c923aca0 --- /dev/null +++ b/deps/glslang/Test/spv.fragmentShaderBarycentric.frag @@ -0,0 +1,15 @@ +#version 450 +#extension GL_NV_fragment_shader_barycentric : require + +layout(location = 0) pervertexNV in vertices { + float attrib; + } v[]; + +layout(location = 1) out float value; + +void main () { + value = (gl_BaryCoordNV.x * v[0].attrib + + gl_BaryCoordNV.y * v[1].attrib + + gl_BaryCoordNV.z * v[2].attrib); + +} diff --git a/deps/glslang/Test/spv.fragmentShaderBarycentric2.frag b/deps/glslang/Test/spv.fragmentShaderBarycentric2.frag new file mode 100644 index 00000000..4682e4ef --- /dev/null +++ b/deps/glslang/Test/spv.fragmentShaderBarycentric2.frag @@ -0,0 +1,15 @@ +#version 320 es +#extension GL_NV_fragment_shader_barycentric : require + +precision highp float; + +layout(location = 0) pervertexNV in float vertexIDs[3]; + +layout(location = 1) out float value; + +void main () { + value = (gl_BaryCoordNoPerspNV.x * vertexIDs[0] + + gl_BaryCoordNoPerspNV.y * vertexIDs[1] + + gl_BaryCoordNoPerspNV.z * vertexIDs[2]); + +} diff --git a/deps/glslang/Test/spv.fullyCovered.frag b/deps/glslang/Test/spv.fullyCovered.frag new file mode 100644 index 00000000..c7f30853 --- /dev/null +++ b/deps/glslang/Test/spv.fullyCovered.frag @@ -0,0 +1,9 @@ +#version 450 + +#extension GL_NV_conservative_raster_underestimation : enable + +out vec4 color; + +void main() { + color = vec4(gl_FragFullyCoveredNV, 0, 0, 0); +} diff --git a/deps/glslang/Test/spv.functionCall.frag b/deps/glslang/Test/spv.functionCall.frag new file mode 100644 index 00000000..139638d2 --- /dev/null +++ b/deps/glslang/Test/spv.functionCall.frag @@ -0,0 +1,44 @@ +#version 140 + +varying vec4 bigColor; +varying vec4 BaseColor; +varying float d; + +float h = 0.0; + +float foo(vec4 bar) +{ + return bar.x + bar.y; +} + +void bar() +{ +} + +float unreachableReturn() +{ + if (d < 4.2) + return 1.2; + else + return 4.5; + // might be another return inserted here by builders, has to be correct type +} + +float missingReturn() +{ + if (d < 4.5) { + h = d; + return 3.9; + } +} + +void main() +{ + vec4 color = vec4(foo(BaseColor)); + + bar(); + float f = unreachableReturn(); + float g = missingReturn(); + + gl_FragColor = color * f * h; +} diff --git a/deps/glslang/Test/spv.functionNestedOpaque.vert b/deps/glslang/Test/spv.functionNestedOpaque.vert new file mode 100644 index 00000000..9e308b13 --- /dev/null +++ b/deps/glslang/Test/spv.functionNestedOpaque.vert @@ -0,0 +1,26 @@ +#version 450 + +uniform struct S { + sampler2D s; +} si; + +void foo(sampler2D t) +{ + texture(t, vec2(0.5)); +} + +void barc(const S p) +{ + foo(p.s); +} + +void bar(S p) +{ + foo(p.s); +} + +void main() +{ + barc(si); + bar(si); +} diff --git a/deps/glslang/Test/spv.functionSemantics.frag b/deps/glslang/Test/spv.functionSemantics.frag new file mode 100644 index 00000000..a9b59b76 --- /dev/null +++ b/deps/glslang/Test/spv.functionSemantics.frag @@ -0,0 +1,63 @@ +#version 400 + +in float u; + +int foo(int a, const int b, in int c, const in int d, out int e, inout int f) +{ + int sum = a + b + c + d + f; // no e, it is out only + // sum should be 47 now + + a *= 64; + // no b, it is read only + c *= 64; + // no d, it is read only + e = 64 * 16; // e starts undefined + f *= 64; + + sum += a + 64 * b + c + 64 * d + e + f; // everything has a value now, totaling of 64(1+2+4+8+16+32) = 64*63 = 4032 + // sum should be 4032 + 47 = 4079 + + return sum; +} + +int foo2(float a, vec3 b, out int r) +{ + r = int(3.0 * a); + return int(5.0 * b.y); +} + +int foo3() +{ + if (u > 3.2) { + discard; + return 1000000; + } + + return 2000000; +} + +void main() +{ + int e; + int t = 2; + struct s { + ivec4 t; + } f; + f.t.y = 32; + + // test the different qualifers + int color = foo(1, 2, t+t, 8, e, f.t.y); + + color += 128 * (e + f.t.y); // right side should be 128(64(16 + 32)) = 393216 + // sum should be 4079 + 393216 = 397295 + + // test conversions + float arg; + float ret; + ret = foo2(4, ivec3(1,2,3), arg); // ret = 10, param = 12.0 + color += int(ret + arg); // adds 22, for total of 397317 + + color += foo3(); // theoretically, add 2000000, for total of 2397317 + + gl_FragColor = vec4(color); +} diff --git a/deps/glslang/Test/spv.glFragColor.frag b/deps/glslang/Test/spv.glFragColor.frag new file mode 100644 index 00000000..12dbcb22 --- /dev/null +++ b/deps/glslang/Test/spv.glFragColor.frag @@ -0,0 +1,6 @@ +#version 330 + +void main() +{ + gl_FragColor = vec4(1.0); +} diff --git a/deps/glslang/Test/spv.glsl.register.autoassign.frag b/deps/glslang/Test/spv.glsl.register.autoassign.frag new file mode 100644 index 00000000..f754d8aa --- /dev/null +++ b/deps/glslang/Test/spv.glsl.register.autoassign.frag @@ -0,0 +1,68 @@ +#version 450 + +uniform layout(binding=0) sampler g_sSamp1; +uniform sampler g_sSamp2; +uniform layout(binding=2) sampler g_sSamp3[2]; +uniform sampler g_sSamp4[3]; +uniform sampler g_sSamp5; + +uniform sampler g_sSamp_unused1; +uniform sampler g_sSamp_unused2; + +uniform layout(binding=1) texture1D g_tTex1; +uniform texture1D g_tTex2; +uniform layout(binding=3) texture1D g_tTex3[2]; +uniform texture1D g_tTex4[3]; +uniform texture1D g_tTex5; + +uniform layout(binding=0) texture1D g_tTex_unused1; +uniform layout(binding=2) texture1D g_tTex_unused2; +uniform texture1D g_tTex_unused3; + +struct MyStruct_t { + int a; + float b; + vec3 c; +}; + +uniform layout(binding=4) myblock { + MyStruct_t mystruct; + vec4 myvec4_a; + vec4 myvec4_b; + ivec4 myint4_a; +}; + +vec4 Func1() +{ + return + texture(sampler1D(g_tTex1, g_sSamp1), 0.1) + + texture(sampler1D(g_tTex2, g_sSamp2), 0.2) + + texture(sampler1D(g_tTex3[0], g_sSamp3[0]), 0.3) + + texture(sampler1D(g_tTex3[1], g_sSamp3[1]), 0.3) + + texture(sampler1D(g_tTex4[1], g_sSamp4[1]), 0.4) + + texture(sampler1D(g_tTex4[2], g_sSamp4[2]), 0.4) + + texture(sampler1D(g_tTex5, g_sSamp5), 0.5) + + mystruct.c[1]; +} + +vec4 Func2() +{ + return + texture(sampler1D(g_tTex1, g_sSamp1), 0.1) + + texture(sampler1D(g_tTex3[1], g_sSamp3[1]), 0.3); +} + +// Not called from entry point: +vec4 Func2_unused() +{ + return + texture(sampler1D(g_tTex_unused1, g_sSamp_unused1), 1.1) + + texture(sampler1D(g_tTex_unused2, g_sSamp_unused2), 1.2); +} + +out vec4 FragColor; + +void main() +{ + FragColor = Func1() + Func2(); +} diff --git a/deps/glslang/Test/spv.glsl.register.noautoassign.frag b/deps/glslang/Test/spv.glsl.register.noautoassign.frag new file mode 100644 index 00000000..c385fbb9 --- /dev/null +++ b/deps/glslang/Test/spv.glsl.register.noautoassign.frag @@ -0,0 +1,68 @@ +#version 450 + +uniform layout(binding=0) sampler g_sSamp1; +uniform layout(binding=1) sampler g_sSamp2; +uniform layout(binding=2) sampler g_sSamp3[2]; +uniform layout(binding=3) sampler g_sSamp4[3]; +uniform layout(binding=4) sampler g_sSamp5; + +uniform layout(binding=5) sampler g_sSamp_unused1; +uniform layout(binding=6) sampler g_sSamp_unused2; + +uniform layout(binding=7) texture1D g_tTex1; +uniform layout(binding=8) texture1D g_tTex2; +uniform layout(binding=9) texture1D g_tTex3[2]; +uniform layout(binding=10) texture1D g_tTex4[3]; +uniform layout(binding=11) texture1D g_tTex5; + +uniform layout(binding=12) texture1D g_tTex_unused1; +uniform layout(binding=13) texture1D g_tTex_unused2; +uniform layout(binding=14) texture1D g_tTex_unused3; + +struct MyStruct_t { + int a; + float b; + vec3 c; +}; + +uniform layout(binding=4) myblock { + MyStruct_t mystruct; + vec4 myvec4_a; + vec4 myvec4_b; + ivec4 myint4_a; +}; + +vec4 Func1() +{ + return + texture(sampler1D(g_tTex1, g_sSamp1), 0.1) + + texture(sampler1D(g_tTex2, g_sSamp2), 0.2) + + texture(sampler1D(g_tTex3[0], g_sSamp3[0]), 0.3) + + texture(sampler1D(g_tTex3[1], g_sSamp3[1]), 0.3) + + texture(sampler1D(g_tTex4[1], g_sSamp4[1]), 0.4) + + texture(sampler1D(g_tTex4[2], g_sSamp4[2]), 0.4) + + texture(sampler1D(g_tTex5, g_sSamp5), 0.5) + + mystruct.c[1]; +} + +vec4 Func2() +{ + return + texture(sampler1D(g_tTex1, g_sSamp1), 0.1) + + texture(sampler1D(g_tTex3[1], g_sSamp3[1]), 0.3); +} + +// Not called from entry point: +vec4 Func2_unused() +{ + return + texture(sampler1D(g_tTex_unused1, g_sSamp_unused1), 1.1) + + texture(sampler1D(g_tTex_unused2, g_sSamp_unused2), 1.2); +} + +out vec4 FragColor; + +void main() +{ + FragColor = Func1() + Func2(); +} diff --git a/deps/glslang/Test/spv.hlslDebugInfo.vert b/deps/glslang/Test/spv.hlslDebugInfo.vert new file mode 100644 index 00000000..b2bc1877 --- /dev/null +++ b/deps/glslang/Test/spv.hlslDebugInfo.vert @@ -0,0 +1,4 @@ +float4 origMain() : SV_Position +{ + return (float4)0; +} diff --git a/deps/glslang/Test/spv.hlslOffsets.vert b/deps/glslang/Test/spv.hlslOffsets.vert new file mode 100644 index 00000000..87e32a72 --- /dev/null +++ b/deps/glslang/Test/spv.hlslOffsets.vert @@ -0,0 +1,27 @@ +#version 450 + +buffer block { + float m0; + vec3 m4; + ////// + float m16; + layout(offset=20) vec3 m20; + ///// + vec3 m32; + ///// + vec2 m48; + vec2 m56; + //// + float m64; + vec2 m68; + float m76; + ////// + float m80; + layout(offset=88) vec2 m88; + ////// + vec2 m96; + /////// + dvec2 m112; +}; + +void main() {} \ No newline at end of file diff --git a/deps/glslang/Test/spv.image.frag b/deps/glslang/Test/spv.image.frag new file mode 100644 index 00000000..d9305ef2 --- /dev/null +++ b/deps/glslang/Test/spv.image.frag @@ -0,0 +1,97 @@ +#version 450 + +layout(rgba32f, binding = 0) uniform image1D i1D; +layout(rgba32f, binding = 1) uniform image2D i2D; +layout(rgba32f, binding = 2) uniform image3D i3D; +layout(rgba32f, binding = 3) uniform imageCube iCube; +layout(rgba32f, binding = 4) uniform imageCubeArray iCubeArray; +layout(rgba32f, binding = 5) uniform image2DRect i2DRect; +layout(rgba32f, binding = 6) uniform image1DArray i1DArray; +layout(rg16, binding = 7) uniform image2DArray i2DArray; +layout(rgba32f, binding = 8) uniform imageBuffer iBuffer; +layout(rgba32f, binding = 9) uniform image2DMS i2DMS; +layout(rgba32f, binding = 10) uniform image2DMSArray i2DMSArray; + +layout(r32i, binding = 11) uniform iimage1D ii1D; +layout(r32ui, binding = 12) uniform uimage2D ui2D; +layout(r32i, binding = 13) uniform iimage2DMS ii2DMS; +layout(r32ui, binding = 14) uniform uimage2DMSArray ui2DMSArray; + +flat in int ic1D; +flat in ivec2 ic2D; +flat in ivec3 ic3D; +flat in ivec4 ic4D; + +writeonly layout(binding = 1) uniform image2D wo2D; + +flat in uint value; + +out vec4 fragData; + +void main() +{ + ivec3 iv = ivec3(0); + iv.x += imageSize(i1D); + iv.xy += imageSize(i2D); + iv.xyz += imageSize(i3D); + iv.xy += imageSize(iCube); + iv.xyz += imageSize(iCubeArray); + iv.xy += imageSize(i2DRect); + iv.xy += imageSize(i1DArray); + iv.xyz += imageSize(i2DArray); + iv.x += imageSize(iBuffer); + iv.xy += imageSize(i2DMS); + iv.xyz += imageSize(i2DMSArray); + + iv.x += imageSamples(i2DMS); + iv.x += imageSamples(i2DMSArray); + + vec4 v = vec4(0.0); + v += imageLoad(i1D, ic1D); + imageStore(i1D, ic1D, v); + v += imageLoad(i2D, ic2D); + imageStore(i2D, ic2D, v); + v += imageLoad(i3D, ic3D); + imageStore(i3D, ic3D, v); + v += imageLoad(iCube, ic3D); + imageStore(iCube, ic3D, v); + v += imageLoad(iCubeArray, ic3D); + imageStore(iCubeArray, ic3D, v); + v += imageLoad(i2DRect, ic2D); + imageStore(i2DRect, ic2D, v); + v += imageLoad(i1DArray, ic2D); + imageStore(i1DArray, ic2D, v); + v += imageLoad(i2DArray, ic3D); + imageStore(i2DArray, ic3D, v); + v += imageLoad(iBuffer, ic1D); + imageStore(iBuffer, ic1D, v); + v += imageLoad(i2DMS, ic2D, 1); + imageStore(i2DMS, ic2D, 2, v); + v += imageLoad(i2DMSArray, ic3D, 3); + imageStore(i2DMSArray, ic3D, 4, v); + + uint ui = 0; + iv.x += imageAtomicAdd(ii1D, ic1D, 10); + ui += imageAtomicAdd(ui2D, ic2D, value); + iv.x += imageAtomicMin(ii1D, ic1D, 11); + ui += imageAtomicMin(ui2D, ic2D, value); + iv.x += imageAtomicMax(ii1D, ic1D, 12); + ui += imageAtomicMax(ui2D, ic2D, value); + iv.x += imageAtomicAnd(ii1D, ic1D, 13); + ui += imageAtomicAnd(ui2D, ic2D, value); + iv.x += imageAtomicOr(ii1D, ic1D, 14); + ui += imageAtomicOr(ui2D, ic2D, value); + iv.x += imageAtomicXor(ii1D, ic1D, 15); + ui += imageAtomicXor(ui2D, ic2D, value); + iv.x += imageAtomicExchange(ii1D, ic1D, 16); + ui += imageAtomicExchange(ui2D, ic2D, value); + iv.x += imageAtomicCompSwap(ii1D, ic1D, 18, 17); + ui += imageAtomicCompSwap(ui2D, ic2D, 19u, value); + iv.x += imageAtomicCompSwap(ii2DMS, ic2D, 2, 18, 17); + ui += imageAtomicCompSwap(ui2DMSArray, ic3D, 3, 19u, value); + + imageStore(wo2D, ic2D, v); + + fragData = ui != iv.y ? v : vec4(0.0); +} + diff --git a/deps/glslang/Test/spv.image.load-formatted.frag b/deps/glslang/Test/spv.image.load-formatted.frag new file mode 100644 index 00000000..b0adc73b --- /dev/null +++ b/deps/glslang/Test/spv.image.load-formatted.frag @@ -0,0 +1,74 @@ +#version 450 + +#extension GL_EXT_shader_image_load_formatted : require + +layout(binding = 0) uniform image1D i1D; +layout(binding = 1) uniform image2D i2D; +layout(binding = 2) uniform image3D i3D; +layout(binding = 3) uniform imageCube iCube; +layout(binding = 4) uniform imageCubeArray iCubeArray; +layout(binding = 5) uniform image2DRect i2DRect; +layout(binding = 6) uniform image1DArray i1DArray; +layout(binding = 7) uniform image2DArray i2DArray; +layout(binding = 8) uniform imageBuffer iBuffer; +layout(binding = 9) uniform image2DMS i2DMS; +layout(binding = 10) uniform image2DMSArray i2DMSArray; + +flat in int ic1D; +flat in ivec2 ic2D; +flat in ivec3 ic3D; +flat in ivec4 ic4D; + +writeonly layout(binding = 1) uniform image2D wo2D; + +flat in uint value; + +out vec4 fragData; + +void main() +{ + ivec3 iv = ivec3(0); + iv.x += imageSize(i1D); + iv.xy += imageSize(i2D); + iv.xyz += imageSize(i3D); + iv.xy += imageSize(iCube); + iv.xyz += imageSize(iCubeArray); + iv.xy += imageSize(i2DRect); + iv.xy += imageSize(i1DArray); + iv.xyz += imageSize(i2DArray); + iv.x += imageSize(iBuffer); + iv.xy += imageSize(i2DMS); + iv.xyz += imageSize(i2DMSArray); + + iv.x += imageSamples(i2DMS); + iv.x += imageSamples(i2DMSArray); + + vec4 v = vec4(0.0); + v += imageLoad(i1D, ic1D); + imageStore(i1D, ic1D, v); + v += imageLoad(i2D, ic2D); + imageStore(i2D, ic2D, v); + v += imageLoad(i3D, ic3D); + imageStore(i3D, ic3D, v); + v += imageLoad(iCube, ic3D); + imageStore(iCube, ic3D, v); + v += imageLoad(iCubeArray, ic3D); + imageStore(iCubeArray, ic3D, v); + v += imageLoad(i2DRect, ic2D); + imageStore(i2DRect, ic2D, v); + v += imageLoad(i1DArray, ic2D); + imageStore(i1DArray, ic2D, v); + v += imageLoad(i2DArray, ic3D); + imageStore(i2DArray, ic3D, v); + v += imageLoad(iBuffer, ic1D); + imageStore(iBuffer, ic1D, v); + v += imageLoad(i2DMS, ic2D, 1); + imageStore(i2DMS, ic2D, 2, v); + v += imageLoad(i2DMSArray, ic3D, 3); + imageStore(i2DMSArray, ic3D, 4, v); + + imageStore(wo2D, ic2D, v); + + fragData = v; +} + diff --git a/deps/glslang/Test/spv.imageLoadStoreLod.frag b/deps/glslang/Test/spv.imageLoadStoreLod.frag new file mode 100644 index 00000000..0da1da12 --- /dev/null +++ b/deps/glslang/Test/spv.imageLoadStoreLod.frag @@ -0,0 +1,36 @@ +#version 450 core + +#extension GL_AMD_shader_image_load_store_lod: enable + +layout(rgba32f, binding = 0) uniform image1D i1D; +layout(rgba32f, binding = 1) uniform image2D i2D; +layout(rgba32f, binding = 2) uniform image3D i3D; +layout(rgba32i, binding = 3) uniform iimageCube iiCube; +layout(rgba32i, binding = 4) uniform iimage1DArray ii1DArray; +layout(rgba32ui, binding = 5) uniform uimage2DArray ui2DArray; +layout(rgba32ui, binding = 6) uniform uimageCubeArray uiCubeArray; + +layout(location = 0) out vec4 fragColor; + +void main() +{ + const int c1 = 1; + const ivec2 c2 = ivec2(2, 3); + const ivec3 c3 = ivec3(4, 5, 6); + + const int lod = 3; + + vec4 f4 = vec4(0.0); + f4 += imageLoadLodAMD(i1D, c1, lod); + f4 += imageLoadLodAMD(i2D, c2, lod); + f4 += imageLoadLodAMD(i3D, c3, lod); + + imageStoreLodAMD(iiCube, c3, lod, ivec4(f4)); + imageStoreLodAMD(ii1DArray, c2, lod, ivec4(f4)); + + uvec4 u4; + sparseImageLoadLodAMD(ui2DArray, c3, lod, u4); + sparseImageLoadLodAMD(uiCubeArray, c3, lod, u4); + + fragColor = f4 + vec4(u4); +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.int16.amd.frag b/deps/glslang/Test/spv.int16.amd.frag new file mode 100644 index 00000000..818e6d83 --- /dev/null +++ b/deps/glslang/Test/spv.int16.amd.frag @@ -0,0 +1,314 @@ +#version 450 core + +#extension GL_ARB_gpu_shader_int64: enable +#extension GL_AMD_gpu_shader_half_float: enable +#extension GL_AMD_gpu_shader_int16: enable + +layout(binding = 0) uniform Uniforms +{ + uint i; +}; + +// int16/uint16 in block +layout(std140, binding = 1) uniform Block +{ + i16vec3 i16v; + uint16_t u16; +} block; + +// int16/uint16 for input +layout(location = 0) in flat u16vec3 iu16v; +layout(location = 1) in flat int16_t ii16; + +void literal() +{ + const int16_t i16c[3] = + { + 0x111S, // Hex + -2s, // Dec + 0400s, // Oct + }; + + const uint16_t u16c[] = + { + 0xFFFFus, // Hex + 65535US, // Dec + 0177777us, // Oct + }; + + uint16_t u16 = i16c[i] + u16c[i]; +} + +void operators() +{ + u16vec3 u16v; + int16_t i16; + uint16_t u16; + int i; + uint u; + bool b; + + // Unary + u16v++; + i16--; + ++i16; + --u16v; + + u16v = ~u16v; + + i16 = +i16; + u16v = -u16v; + + // Arithmetic + u16 += i16; + u16v -= u16v; + i16 *= i16; + u16v /= u16v; + u16v %= i16; + + u16v = u16v + u16v; + u16 = i16 - u16; + u16v = u16v * i16; + i16 = i16 * i16; + i16 = i16 % i16; + + // Shift + u16v <<= i16; + i16 >>= u16v.y; + + i16 = i16 << u16v.z; + u16v = u16v << i16; + + // Relational + b = (u16v.x != i16); + b = (i16 == u16v.x); + b = (u16v.x > u16v.y); + b = (i16 < u); + b = (u16v.y >= u16v.x); + b = (i16 <= i); + + // Bitwise + u16v |= i16; + u16 = i16 | u16; + i16 &= i16; + u16v = u16v & u16v; + u16v ^= i16; + u16v = u16v ^ i16; +} + +void typeCast() +{ + bvec2 bv; + ivec2 iv; + uvec2 uv; + vec2 fv; + dvec2 dv; + + f16vec2 f16v; + i64vec2 i64v; + u64vec2 u64v; + i16vec2 i16v; + u16vec2 u16v; + + i16v = i16vec2(bv); // bool -> int16 + u16v = u16vec2(bv); // bool -> uint16 + bv = bvec2(i16v); // int16 -> bool + bv = bvec2(u16v); // uint16 -> bool + + i16v = i16vec2(iv); // int -> int16 + u16v = u16vec2(iv); // int -> uint16 + iv = i16v; // int16 -> int + iv = ivec2(u16v); // uint16 -> int + + i16v = i16vec2(uv); // uint -> int16 + u16v = u16vec2(uv); // uint -> uint16 + uv = i16v; // int16 -> uint + uv = u16v; // uint16 -> uint + + i16v = i16vec2(fv); // float -> int16 + u16v = u16vec2(fv); // float -> uint16 + fv = i16v; // int16 -> float + fv = u16v; // uint16 -> float + + i16v = i16vec2(dv); // double -> int16 + u16v = u16vec2(dv); // double -> uint16 + dv = i16v; // int16 -> double + dv = u16v; // uint16 -> double + + i16v = i16vec2(f16v); // float16 -> int16 + u16v = u16vec2(f16v); // float16 -> uint16 + f16v = i16v; // int16 -> float16 + f16v = u16v; // uint16 -> float16 + + i16v = i16vec2(i64v); // int64 -> int16 + u16v = u16vec2(i64v); // int64 -> uint16 + i64v = i16v; // int16 -> int64 + i64v = i64vec2(u16v); // uint16 -> int64 + + i16v = i16vec2(u64v); // uint64 -> int16 + u16v = u16vec2(u64v); // uint64 -> uint16 + u64v = i16v; // int16 -> uint64 + u64v = u16v; // uint16 -> uint64 + + i16v = i16vec2(u16v); // uint16 -> int16 + u16v = i16v; // int16 -> uint16 +} + +void builtinFuncs() +{ + i16vec2 i16v; + u16vec3 u16v; + f16vec3 f16v; + bvec3 bv; + + int16_t i16; + uint16_t u16; + + // abs() + i16v = abs(i16v); + + // sign() + i16v = sign(i16v); + + // min() + i16v = min(i16v, i16); + i16v = min(i16v, i16vec2(-1s)); + u16v = min(u16v, u16); + u16v = min(u16v, u16vec3(0us)); + + // max() + i16v = max(i16v, i16); + i16v = max(i16v, i16vec2(-1s)); + u16v = max(u16v, u16); + u16v = max(u16v, u16vec3(0us)); + + // clamp() + i16v = clamp(i16v, -i16, i16); + i16v = clamp(i16v, -i16v, i16v); + u16v = clamp(u16v, -u16, u16); + u16v = clamp(u16v, -u16v, u16v); + + // mix() + i16 = mix(i16v.x, i16v.y, true); + i16v = mix(i16vec2(i16), i16vec2(-i16), bvec2(false)); + u16 = mix(u16v.x, u16v.y, true); + u16v = mix(u16vec3(u16), u16vec3(-u16), bvec3(false)); + + // frexp() + i16vec3 exp; + f16v = frexp(f16v, exp); + + // ldexp() + f16v = ldexp(f16v, exp); + + // float16BitsToInt16() + i16v = float16BitsToInt16(f16v.xy); + + // float16BitsToUint16() + u16v.x = float16BitsToUint16(f16v.z); + + // int16BitsToFloat16() + f16v.xy = int16BitsToFloat16(i16v); + + // uint16BitsToFloat16() + f16v = uint16BitsToFloat16(u16v); + + // packInt2x16() + int packi = packInt2x16(i16v); + + // unpackInt2x16() + i16v = unpackInt2x16(packi); + + // packUint2x16() + uint packu = packUint2x16(u16v.xy); + + // unpackUint2x16() + u16v.xy = unpackUint2x16(packu); + + // packInt4x16() + int64_t packi64 = packInt4x16(i16vec4(i16)); + + // unpackInt4x16() + i16v = unpackInt4x16(packi64).xy; + + // packUint4x16() + uint64_t packu64 = packUint4x16(u16vec4(u16)); + + // unpackUint4x16() + u16v = unpackUint4x16(packu64).xyz; + + // lessThan() + bv = lessThan(u16v, u16vec3(u16)); + bv.xy = lessThan(i16v, i16vec2(i16)); + + // lessThanEqual() + bv = lessThanEqual(u16v, u16vec3(u16)); + bv.xy = lessThanEqual(i16v, i16vec2(i16)); + + // greaterThan() + bv = greaterThan(u16v, u16vec3(u16)); + bv.xy = greaterThan(i16v, i16vec2(i16)); + + // greaterThanEqual() + bv = greaterThanEqual(u16v, u16vec3(u16)); + bv.xy = greaterThanEqual(i16v, i16vec2(i16)); + + // equal() + bv = equal(u16v, u16vec3(u16)); + bv.xy = equal(i16v, i16vec2(i16)); + + // notEqual() + bv = notEqual(u16v, u16vec3(u16)); + bv.xy = notEqual(i16v, i16vec2(i16)); +} + +// Type conversion for specialization constant +layout(constant_id = 100) const int64_t si64 = -10L; +layout(constant_id = 101) const uint64_t su64 = 20UL; +layout(constant_id = 102) const int si = -5; +layout(constant_id = 103) const uint su = 4; +layout(constant_id = 104) const bool sb = true; +layout(constant_id = 105) const int16_t si16 = -5S; +layout(constant_id = 106) const uint16_t su16 = 4US; + +// bool <-> int16/uint16 +const bool i16_to_b = bool(si16); +const bool u16_to_b = bool(su16); +const int16_t b_to_i16 = int16_t(sb); +const uint16_t b_to_u16 = uint16_t(sb); + +// int <-> int16/uint16 +const int i16_to_i = int(si16); +const int u16_to_i = int(su16); +const int16_t i_to_i16 = int16_t(si); +const uint16_t i_to_u16 = uint16_t(si); + +// uint <-> int16/uint16 +const uint i16_to_u = uint(si16); +const uint u16_to_u = uint(su16); +const int16_t u_to_i16 = int16_t(su); +const uint16_t u_to_u16 = uint16_t(su); + +// int64 <-> int16/uint16 +const int64_t i16_to_i64 = int64_t(si16); +const int64_t u16_to_i64 = int64_t(su16); +const int16_t i64_to_i16 = int16_t(si64); +const uint16_t i64_to_u16 = uint16_t(si64); + +// uint64 <-> int16/uint16 +const uint64_t i16_to_u64 = uint64_t(si16); +const uint64_t u16_to_u64 = uint64_t(su16); +const int16_t u64_to_i16 = int16_t(su64); +const uint16_t u64_to_u16 = uint16_t(su64); + +// int16 <-> uint16 +const uint16_t i16_to_u16 = uint16_t(si16); +const int16_t u16_to_i16 = int16_t(su16); + +void main() +{ + literal(); + operators(); + typeCast(); + builtinFuncs(); +} diff --git a/deps/glslang/Test/spv.int16.frag b/deps/glslang/Test/spv.int16.frag new file mode 100644 index 00000000..d29894b8 --- /dev/null +++ b/deps/glslang/Test/spv.int16.frag @@ -0,0 +1,251 @@ +#version 450 + +#extension GL_KHX_shader_explicit_arithmetic_types: enable +#extension GL_KHX_shader_explicit_arithmetic_types_int8: require +#extension GL_KHX_shader_explicit_arithmetic_types_int16: require +#extension GL_KHX_shader_explicit_arithmetic_types_int32: require +#extension GL_KHX_shader_explicit_arithmetic_types_int64: require +#extension GL_KHX_shader_explicit_arithmetic_types_float16: require +#extension GL_KHX_shader_explicit_arithmetic_types_float32: require +#extension GL_KHX_shader_explicit_arithmetic_types_float64: require + +layout(binding = 0) uniform Uniforms +{ + uint index; +}; + +layout(std140, binding = 1) uniform Block +{ + int16_t i16; + i16vec2 i16v2; + i16vec3 i16v3; + i16vec4 i16v4; + uint16_t u16; + u16vec2 u16v2; + u16vec3 u16v3; + u16vec4 u16v4; +} block; + +void main() +{ +} + +void literal() +{ + const int16_t i16Const[3] = + { + int16_t(-0x1111), // Hex + int16_t(-1), // Dec + int16_t(040000), // Oct + }; + + int16_t i16 = i16Const[index]; + + const uint16_t u16Const[] = + { + uint16_t(0xFFFF), // Hex + uint16_t(65535), // Dec + uint16_t(077777), // Oct + }; + + uint16_t u16 = u16Const[index]; +} + +void typeCast16() +{ + i8vec2 i8v; + u8vec2 u8v; + i16vec2 i16v; + u16vec2 u16v; + i32vec2 i32v; + u32vec2 u32v; + i64vec2 i64v; + u64vec2 u64v; + f16vec2 f16v; + f32vec2 f32v; + f64vec2 f64v; + bvec2 bv; + + i32v = i16v; // int16_t -> int32_t + i32v = u16v; // uint16_t -> int32_t + u16v = i16v; // int16_t -> uint16_t + u32v = i16v; // int16_t -> uint32_t + i64v = i16v; // int16_t -> int64_t + u64v = i16v; // int16_t -> uint64_t + u32v = u16v; // uint16_t -> uint32_t + i64v = u16v; // uint16_t -> int64_t + u64v = u16v; // uint16_t -> uint64_t + f16v = i16v; // int16_t -> float16_t + f32v = i16v; // int16_t -> float32_t + f64v = i16v; // int16_t -> float64_t + f16v = u16v; // uint16_t -> float16_t + f32v = u16v; // uint16_t -> float32_t + f64v = u16v; // uint16_t -> float64_t + + i32v = i32vec2(i16v); // int16_t -> int32_t + i32v = i32vec2(u16v); // uint16_t -> int32_t + u16v = u16vec2(i16v); // int16_t -> uint16_t + u32v = u32vec2(i16v); // int16_t -> uint32_t + i64v = i64vec2(i16v); // int16_t -> int64_t + u64v = i64vec2(i16v); // int16_t -> uint64_t + u32v = u32vec2(u16v); // uint16_t -> uint32_t + i64v = i64vec2(u16v); // uint16_t -> int64_t + u64v = i64vec2(u16v); // uint16_t -> uint64_t + f16v = f16vec2(i16v); // int16_t -> float16_t + f32v = f32vec2(i16v); // int16_t -> float32_t + f64v = f64vec2(i16v); // int16_t -> float64_t + f16v = f16vec2(u16v); // uint16_t -> float16_t + f32v = f32vec2(u16v); // uint16_t -> float32_t + f64v = f64vec2(u16v); // uint16_t -> float64_t + + i8v = i8vec2(i16v); // int16_t -> int8_t + i8v = i8vec2(u16v); // uint16_t -> int8_t + u8v = u8vec2(i16v); // int16_t -> uint8_t + u8v = u8vec2(u16v); // uint16_t -> uint8_t + i16v = u8vec2(u16v); // uint16_t -> int16_t + i16v = i16vec2(bv); // bool -> int16 + u16v = u16vec2(bv); // bool -> uint16 + bv = bvec2(i16v); // int16 -> bool + bv = bvec2(u16v); // uint16 -> bool +} +void operators() +{ + u16vec3 u16v; + int16_t i16; + uvec3 uv; + int32_t i; + int64_t i64; + bool b; + + // Unary + u16v++; + i16--; + ++i16; + --u16v; + + u16v = ~u16v; + + i16 = +i16; + u16v = -u16v; + + // Arithmetic + i16 += i16; + u16v -= u16v; + i *= i16; + uv /= u16v; + uv %= i16; + + uv = u16v + uv; + i64 = i16 - i64; + uv = u16v * uv; + i64 = i16 * i64; + i = i16 % i; + + // Shift + u16v <<= i16; + i16 >>= u16v.y; + + i16 = i16 << u16v.z; + uv = u16v << i; + + // Relational + b = (u16v.x != i16); + b = (i16 == u16v.x); + b = (u16v.x > uv.y); + b = (i16 < i); + b = (u16v.y >= uv.x); + b = (i16 <= i); + + // Bitwise + uv |= i16; + i = i16 | i; + i64 &= i16; + uv = u16v & uv; + uv ^= i16; + u16v = u16v ^ i16; +} + +void builtinFuncs() +{ + i16vec2 i16v; + i16vec4 i16v4; + u16vec3 u16v; + u16vec2 u16v2; + u16vec4 u16v4; + bvec3 bv; + int16_t i16; + uint16_t u16; + int32_t i32; + uint32_t u32; + int64_t i64; + uint64_t u64; + + // abs() + i16v = abs(i16v); + + // sign() + i16 = sign(i16); + + // min() + i16v = min(i16v, i16); + i16v = min(i16v, i16vec2(-1)); + u16v = min(u16v, u16); + u16v = min(u16v, u16vec3(0)); + + // max() + i16v = max(i16v, i16); + i16v = max(i16v, i16vec2(-1)); + u16v = max(u16v, u16); + u16v = max(u16v, u16vec3(0)); + + // clamp() + i16v = clamp(i16v, -i16, i16); + i16v = clamp(i16v, -i16v, i16v); + u16v = clamp(u16v, -u16, u16); + u16v = clamp(u16v, -u16v, u16v); + + // mix() + i16 = mix(i16v.x, i16v.y, true); + i16v = mix(i16vec2(i16), i16vec2(-i16), bvec2(false)); + u16 = mix(u16v.x, u16v.y, true); + u16v = mix(u16vec3(u16), u16vec3(-u16), bvec3(false)); + + //pack + i32 = pack32(i16v); + i64 = pack64(i16v4); + u32 = pack32(u16v2); + u64 = pack64(u16v4); + + i16v = unpack16(i32); + i16v4 = unpack16(i64); + u16v2 = unpack16(u32); + u16v4 = unpack16(u64); + + // lessThan() + bv = lessThan(u16v, u16vec3(u16)); + bv.xy = lessThan(i16v, i16vec2(i16)); + + // lessThanEqual() + bv = lessThanEqual(u16v, u16vec3(u16)); + bv.xy = lessThanEqual(i16v, i16vec2(i16)); + + // greaterThan() + bv = greaterThan(u16v, u16vec3(u16)); + bv.xy = greaterThan(i16v, i16vec2(i16)); + + // greaterThanEqual() + bv = greaterThanEqual(u16v, u16vec3(u16)); + bv.xy = greaterThanEqual(i16v, i16vec2(i16)); + + // equal() + bv = equal(u16v, u16vec3(u16)); + bv.xy = equal(i16v, i16vec2(i16)); + + // notEqual() + bv = notEqual(u16v, u16vec3(u16)); + bv.xy = notEqual(i16v, i16vec2(i16)); +} + +// Type conversion for specialization constant +layout(constant_id = 100) const int16_t si16 = int16_t(-10); +layout(constant_id = 101) const uint16_t su16 = uint16_t(20); diff --git a/deps/glslang/Test/spv.int32.frag b/deps/glslang/Test/spv.int32.frag new file mode 100644 index 00000000..3a33c67c --- /dev/null +++ b/deps/glslang/Test/spv.int32.frag @@ -0,0 +1,256 @@ +#version 450 + +#extension GL_KHX_shader_explicit_arithmetic_types: enable +#extension GL_KHX_shader_explicit_arithmetic_types_int8: require +#extension GL_KHX_shader_explicit_arithmetic_types_int16: require +#extension GL_KHX_shader_explicit_arithmetic_types_int32: require +#extension GL_KHX_shader_explicit_arithmetic_types_int64: require +#extension GL_KHX_shader_explicit_arithmetic_types_float16: require +#extension GL_KHX_shader_explicit_arithmetic_types_float32: require +#extension GL_KHX_shader_explicit_arithmetic_types_float64: require + +layout(binding = 0) uniform Uniforms +{ + uint index; +}; + +layout(std140, binding = 1) uniform Block +{ + int32_t i32; + i32vec2 i32v2; + i32vec3 i32v3; + i32vec4 i32v4; + uint32_t u32; + u32vec2 u32v2; + u32vec3 u32v3; + u32vec4 u32v4; +} block; + +void main() +{ +} + +void literal() +{ + + const int32_t i32Const[3] = + { + -0x11111111, // Hex + -1, // Dec + 04000000000, // Oct + }; + + int32_t i32 = i32Const[index]; + + const uint32_t u32Const[] = + { + 0xFFFFFFFF, // Hex + 4294967295, // Dec + 017777777777, // Oct + }; + + uint32_t u32 = u32Const[index]; +} + +void typeCast32() +{ + i8vec2 i8v; + u8vec2 u8v; + i16vec2 i16v; + u16vec2 u16v; + i32vec2 i32v; + u32vec2 u32v; + i64vec2 i64v; + u64vec2 u64v; + f16vec2 f16v; + f32vec2 f32v; + f64vec2 f64v; + bvec2 bv; + + u32v = i32v; // int32_t -> uint32_t + i64v = i32v; // int32_t -> int64_t + u64v = i32v; // int32_t -> uint64_t + i64v = u32v; // uint32_t -> int64_t + u64v = u32v; // uint32_t -> uint64_t + f32v = i32v; // int32_t -> float32_t + f64v = i32v; // int32_t -> float64_t + f32v = u32v; // uint32_t -> float32_t + f64v = u32v; // uint32_t -> float64_t + + i8v = i8vec2(i32v); // int32_t -> int8_t + i8v = i8vec2(u32v); // uint32_t -> int8_t + i16v = i16vec2(i32v); // int32_t -> int16_t + i16v = i16vec2(u32v); // uint32_t -> int16_t + i32v = i32vec2(i32v); // int32_t -> int32_t + i32v = i32vec2(u32v); // uint32_t -> int32_t + i64v = i64vec2(i32v); // int32_t -> int64_t + i64v = i64vec2(u32v); // uint32_t -> int64_t + u8v = u8vec2(i32v); // int32_t -> uint8_t + u8v = u8vec2(u32v); // uint32_t -> uint8_t + u16v = u16vec2(i32v); // int32_t -> uint16_t + u16v = u16vec2(u32v); // uint32_t -> uint16_t + u32v = u32vec2(i32v); // int32_t -> uint32_t + u32v = u32vec2(u32v); // uint32_t -> uint32_t + u64v = u64vec2(i32v); // int32_t -> uint64_t + u64v = u64vec2(u32v); // uint32_t -> uint64_t + + f16v = f16vec2(i32v); // int32_t -> float16_t + f32v = f32vec2(i32v); // int32_t -> float32_t + f64v = f64vec2(i32v); // int32_t -> float64_t + f16v = f16vec2(u32v); // uint32_t -> float16_t + f32v = f32vec2(u32v); // uint32_t -> float32_t + f64v = f64vec2(u32v); // uint32_t -> float64_t + + i32v = i32vec2(bv); // bool -> int32 + u32v = u32vec2(bv); // bool -> uint32 + bv = bvec2(i32v); // int32 -> bool + bv = bvec2(u32v); // uint32 -> bool +} + +void operators() +{ + u32vec3 u32v; + int32_t i32; + uvec3 uv; + int32_t i; + int64_t i64; + bool b; + + // Unary + u32v++; + i32--; + ++i32; + --u32v; + + u32v = ~u32v; + + i32 = +i32; + u32v = -u32v; + + // Arithmetic + i32 += i32; + u32v -= u32v; + i *= i32; + uv /= u32v; + uv %= i32; + + uv = u32v + uv; + i64 = i32 - i64; + uv = u32v * uv; + i64 = i32 * i64; + i = i32 % i; + + // Shift + u32v <<= i32; + i32 >>= u32v.y; + + i64 = i64 << u32v.z; + uv = u32v << i; + + // Relational + b = (u32v.x != i32); + b = (i32 == u32v.x); + b = (u32v.x > uv.y); + b = (i32 < i); + b = (u32v.y >= uv.x); + b = (i32 <= i); + + // Bitwise + uv |= i32; + i = i32 | i; + i64 &= i32; + uv = u32v & uv; + uv ^= i32; + u32v = u32v ^ i32; +} + +void builtinFuncs() +{ + i32vec2 i32v; + i32vec4 i32v4; + u32vec3 u32v; + u32vec2 u32v2; + u32vec4 u32v4; + bvec3 bv; + int32_t i32; + uint32_t u32; + int64_t i64; + uint64_t u64; + i8vec4 i8v4; + u8vec4 u8v4; + i16vec2 i16v2; + u16vec2 u16v2; + + // abs() + i32v = abs(i32v); + + // sign() + i32 = sign(i32); + + // min() + i32v = min(i32v, i32); + i32v = min(i32v, i32vec2(-1)); + u32v = min(u32v, u32); + u32v = min(u32v, u32vec3(0)); + + // max() + i32v = max(i32v, i32); + i32v = max(i32v, i32vec2(-1)); + u32v = max(u32v, u32); + u32v = max(u32v, u32vec3(0)); + + // clamp() + i32v = clamp(i32v, -i32, i32); + i32v = clamp(i32v, -i32v, i32v); + u32v = clamp(u32v, -u32, u32); + u32v = clamp(u32v, -u32v, u32v); + + // mix() + i32 = mix(i32v.x, i32v.y, true); + i32v = mix(i32vec2(i32), i32vec2(-i32), bvec2(false)); + u32 = mix(u32v.x, u32v.y, true); + u32v = mix(u32vec3(u32), u32vec3(-u32), bvec3(false)); + + //pack + i32 = pack32(i8v4); + i32 = pack32(i16v2); + u32 = pack32(u8v4); + u32 = pack32(u16v2); + + i32v = unpack32(i64); + u32v2 = unpack32(u64); + + // lessThan() + bv = lessThan(u32v, u32vec3(u32)); + bv.xy = lessThan(i32v, i32vec2(i32)); + + // lessThanEqual() + bv = lessThanEqual(u32v, u32vec3(u32)); + bv.xy = lessThanEqual(i32v, i32vec2(i32)); + + // greaterThan() + bv = greaterThan(u32v, u32vec3(u32)); + bv.xy = greaterThan(i32v, i32vec2(i32)); + + // greaterThanEqual() + bv = greaterThanEqual(u32v, u32vec3(u32)); + bv.xy = greaterThanEqual(i32v, i32vec2(i32)); + + // equal() + bv = equal(u32v, u32vec3(u32)); + bv.xy = equal(i32v, i32vec2(i32)); + + // notEqual() + bv = notEqual(u32v, u32vec3(u32)); + bv.xy = notEqual(i32v, i32vec2(i32)); +} + +// Type conversion for specialization constant +layout(constant_id = 100) const int32_t si32 = -10; +layout(constant_id = 101) const uint32_t su32 = 20U; +layout(constant_id = 102) const int si = -5; +layout(constant_id = 103) const uint su = 4; +layout(constant_id = 104) const bool sb = true; + +#define UINT32_MAX 4294967295u +uint32_t u32Max = UINT32_MAX; diff --git a/deps/glslang/Test/spv.int64.frag b/deps/glslang/Test/spv.int64.frag new file mode 100644 index 00000000..4ec04cd8 --- /dev/null +++ b/deps/glslang/Test/spv.int64.frag @@ -0,0 +1,268 @@ +#version 450 + +#extension GL_ARB_gpu_shader_int64: enable +#extension GL_KHX_shader_explicit_arithmetic_types_int64: require + +layout(binding = 0) uniform Uniforms +{ + uint index; +}; + +layout(std140, binding = 1) uniform Block +{ + i64vec3 i64v; + uint64_t u64; +} block; + +void main() +{ +} + +void literal() +{ + const int64_t i64Const[3] = + { + -0x1111111111111111l, // Hex + -1l, // Dec + 040000000000l, // Oct + }; + + int64_t i64 = i64Const[index]; + + const uint64_t u64Const[] = + { + 0xFFFFFFFFFFFFFFFFul, // Hex + 4294967296UL, // Dec + 077777777777ul, // Oct + }; + + uint64_t u64 = u64Const[index]; +} + +void typeCast() +{ + bvec2 bv; + ivec2 iv; + uvec2 uv; + vec2 fv; + dvec2 dv; + + i64vec2 i64v; + u64vec2 u64v; + + i64v = i64vec2(bv); // bool -> int64 + u64v = u64vec2(bv); // bool -> uint64 + + i64v = iv; // int -> int64 + iv = ivec2(i64v); // int64 -> int + + u64v = uv; // uint -> uint64 + uv = uvec2(u64v); // uint64 -> uint + + fv = vec2(i64v); // int64 -> float + dv = i64v; // int64 -> double + + fv = vec2(u64v); // uint64 -> float + dv = u64v; // uint64 -> double + + i64v = i64vec2(fv); // float -> int64 + i64v = i64vec2(dv); // double -> int64 + + u64v = u64vec2(fv); // float -> uint64 + u64v = u64vec2(dv); // double -> uint64 + + bv = bvec2(i64v); // int64 -> bool + bv = bvec2(u64v); // uint64 -> bool + + u64v = i64v; // int64 -> uint64 + i64v = i64vec2(u64v); // uint64 -> int64 + + uv = uvec2(i64v); // int64 -> uint + i64v = i64vec2(uv); // uint -> int64 + iv = ivec2(u64v); // uint64 -> int + u64v = iv; // int -> uint64 +} + +void operators() +{ + u64vec3 u64v; + int64_t i64; + uvec3 uv; + int i; + bool b; + + // Unary + u64v++; + i64--; + ++i64; + --u64v; + + u64v = ~u64v; + + i64 = +i64; + u64v = -u64v; + + // Arithmetic + i64 += i64; + u64v -= u64v; + i64 *= i; + u64v /= uv; + u64v %= i; + + u64v = u64v + uv; + i64 = i64 - i; + u64v = u64v * uv; + i64 = i64 * i; + i64 = i64 % i; + + // Shift + u64v = u64v << i; + i64 = i64 >> uv.y; + u64v <<= i; + i64 >>= uv.y; + + i64 = i64 << u64v.z; + u64v = u64v << i64; + + // Relational + b = (u64v.x != i64); + b = (i64 == u64v.x); + b = (u64v.x > uv.y); + b = (i64 < i); + b = (u64v.y >= uv.x); + b = (i64 <= i); + + // Bitwise + u64v |= i; + i64 = i64 | i; + i64 &= i; + u64v = u64v & uv; + u64v ^= i64; + u64v = u64v ^ i64; +} + +void builtinFuncs() +{ + i64vec2 i64v; + u64vec3 u64v; + dvec3 dv; + bvec3 bv; + + int64_t i64; + uint64_t u64; + + // abs() + i64v = abs(i64v); + + // sign() + i64 = sign(i64); + + // min() + i64v = min(i64v, i64); + i64v = min(i64v, i64vec2(-1)); + u64v = min(u64v, u64); + u64v = min(u64v, u64vec3(0)); + + // max() + i64v = max(i64v, i64); + i64v = max(i64v, i64vec2(-1)); + u64v = max(u64v, u64); + u64v = max(u64v, u64vec3(0)); + + // clamp() + i64v = clamp(i64v, -i64, i64); + i64v = clamp(i64v, -i64v, i64v); + u64v = clamp(u64v, -u64, u64); + u64v = clamp(u64v, -u64v, u64v); + + // mix() + i64 = mix(i64v.x, i64v.y, true); + i64v = mix(i64vec2(i64), i64vec2(-i64), bvec2(false)); + u64 = mix(u64v.x, u64v.y, true); + u64v = mix(u64vec3(u64), u64vec3(-u64), bvec3(false)); + + // doubleBitsToInt64() + i64v = doubleBitsToInt64(dv.xy); + + // doubleBitsToUint64() + u64v.x = doubleBitsToUint64(dv.z); + + // int64BitsToDouble() + dv.xy = int64BitsToDouble(i64v); + + // uint64BitsToDouble() + dv = uint64BitsToDouble(u64v); + + // packInt2x32() + i64 = packInt2x32(ivec2(1, 2)); + + // unpackInt2x32() + ivec2 iv = unpackInt2x32(i64); + + // packUint2x32() + u64 = packUint2x32(uvec2(2, 3)); + + // unpackUint2x32() + uvec2 uv = unpackUint2x32(u64); + + // lessThan() + bv = lessThan(u64v, u64vec3(u64)); + bv.xy = lessThan(i64v, i64vec2(i64)); + + // lessThanEqual() + bv = lessThanEqual(u64v, u64vec3(u64)); + bv.xy = lessThanEqual(i64v, i64vec2(i64)); + + // greaterThan() + bv = greaterThan(u64v, u64vec3(u64)); + bv.xy = greaterThan(i64v, i64vec2(i64)); + + // greaterThanEqual() + bv = greaterThanEqual(u64v, u64vec3(u64)); + bv.xy = greaterThanEqual(i64v, i64vec2(i64)); + + // equal() + bv = equal(u64v, u64vec3(u64)); + bv.xy = equal(i64v, i64vec2(i64)); + + // notEqual() + bv = notEqual(u64v, u64vec3(u64)); + bv.xy = notEqual(i64v, i64vec2(i64)); +} + +// Type conversion for specialization constant +layout(constant_id = 100) const int64_t si64 = -10L; +layout(constant_id = 101) const uint64_t su64 = 20UL; +layout(constant_id = 102) const int si = -5; +layout(constant_id = 103) const uint su = 4; +layout(constant_id = 104) const bool sb = true; +layout(constant_id = 105) const uint64_t su64inc = su64 + 1UL; + +// bool <-> int64/uint64 +const bool i64_to_b = bool(si64); +const bool u64_to_b = bool(su64); +const int64_t b_to_i64 = int64_t(sb); +const uint64_t b_to_u64 = uint64_t(sb); + +// int <-> int64 +const int i64_to_i = int(si64); +const int64_t i_to_i64 = int64_t(si); + +// uint <-> uint64 +const uint u64_to_u = uint(su64); +const uint64_t u_to_u64 = uint64_t(su); + +// int64 <-> uint64 +const int64_t u64_to_i64 = int64_t(su64); +const uint64_t i64_to_u64 = uint64_t(si64); + +// int <-> uint64 +const int u64_to_i = int(su64); +const uint64_t i_to_u64 = uint64_t(si); + +// uint <-> int64 +const uint i64_to_u = uint(si64); +const int64_t u_to_i64 = int64_t(su); + +#define UINT64_MAX 18446744073709551615ul +uint64_t u64Max = UINT64_MAX; diff --git a/deps/glslang/Test/spv.int8.frag b/deps/glslang/Test/spv.int8.frag new file mode 100644 index 00000000..f41c62f5 --- /dev/null +++ b/deps/glslang/Test/spv.int8.frag @@ -0,0 +1,253 @@ +#version 450 + +#extension GL_KHX_shader_explicit_arithmetic_types: enable +#extension GL_KHX_shader_explicit_arithmetic_types_int8: require +#extension GL_KHX_shader_explicit_arithmetic_types_int16: require +#extension GL_KHX_shader_explicit_arithmetic_types_int32: require +#extension GL_KHX_shader_explicit_arithmetic_types_int64: require +#extension GL_KHX_shader_explicit_arithmetic_types_float16: require +#extension GL_KHX_shader_explicit_arithmetic_types_float32: require +#extension GL_KHX_shader_explicit_arithmetic_types_float64: require + +layout(binding = 0) uniform Uniforms +{ + uint index; +}; + +layout(std140, binding = 1) uniform Block +{ + int8_t i8; + i8vec2 i8v2; + i8vec3 i8v3; + i8vec4 i8v4; + uint8_t u8; + u8vec2 u8v2; + u8vec3 u8v3; + u8vec4 u8v4; +} block; + +void main() +{ +} + +void literal() +{ + const int8_t i8Const[3] = + { + int8_t(-0x11), // Hex + int8_t(-1), // Dec + int8_t(0400), // Oct + }; + + int8_t i8 = i8Const[index]; + + const uint8_t u8Const[] = + { + uint8_t(0xFF), // Hex + uint8_t(255), // Dec + uint8_t(0177), // Oct + }; + + uint8_t u8 = u8Const[index]; +} + +void typeCast8() +{ + i8vec2 i8v; + u8vec2 u8v; + i16vec2 i16v; + u16vec2 u16v; + i32vec2 i32v; + u32vec2 u32v; + i64vec2 i64v; + u64vec2 u64v; + f16vec2 f16v; + f32vec2 f32v; + f64vec2 f64v; + bvec2 bv; + + u8v = i8v; // int8_t -> uint8_t + i16v = i8v; // int8_t -> int16_t + i16v = u8v; // uint8_t -> int16_t + i32v = i8v; // int8_t -> int32_t + i32v = u8v; // uint8_t -> int32_t + u32v = i8v; // int8_t -> uint32_t + i64v = i8v; // int8_t -> int64_t + u64v = i8v; // int8_t -> uint64_t + u32v = u8v; // uint8_t -> uint32_t + i64v = u8v; // uint8_t -> int64_t + u64v = u8v; // uint8_t -> uint64_t + f16v = i8v; // int8_t -> float16_t + f32v = i8v; // int8_t -> float32_t + f64v = i8v; // int8_t -> float64_t + f16v = u8v; // uint8_t -> float16_t + f32v = u8v; // uint8_t -> float32_t + f64v = u8v; // uint8_t -> float64_t + + i8v = i8vec2(u8v); // uint8_t -> int8_t + i16v = i16vec2(i8v); // int8_t -> int16_t + i16v = i16vec2(u8v); // uint8_t -> int16_t + i32v = i32vec2(i8v); // int8_t -> int32_t + i32v = i32vec2(u8v); // uint8_t -> int32_t + i64v = i64vec2(i8v); // int8_t -> int64_t + u64v = i64vec2(i8v); // int8_t -> uint64_t + u16v = u16vec2(i8v); // int8_t -> uint16_t + u16v = u16vec2(u8v); // uint8_t -> uint16_t + u32v = u32vec2(u8v); // uint8_t -> uint32_t + i64v = i64vec2(u8v); // uint8_t -> int64_t + u64v = i64vec2(u8v); // uint8_t -> uint64_t + f16v = f16vec2(i8v); // int8_t -> float16_t + f32v = f32vec2(i8v); // int8_t -> float32_t + f64v = f64vec2(i8v); // int8_t -> float64_t + f16v = f16vec2(u8v); // uint8_t -> float16_t + f32v = f32vec2(u8v); // uint8_t -> float32_t + f64v = f64vec2(u8v); // uint8_t -> float64_t + + i8v = i8vec2(bv); // bool -> int8 + u8v = u8vec2(bv); // bool -> uint8 + bv = bvec2(i8v); // int8 -> bool + bv = bvec2(u8v); // uint8 -> bool +} + +void operators() +{ + u8vec3 u8v; + int8_t i8; + uvec3 uv; + int32_t i; + int16_t i16; + bool b; + + // Unary + u8v++; + i8--; + ++i8; + --u8v; + + u8v = ~u8v; + + i8 = +i8; + u8v = -u8v; + + // Arithmetic + i8 += i8; + u8v -= u8v; + i *= i8; + uv /= u8v; + uv %= i8; + + uv = u8v + uv; + i16 = i8 - i16; + uv = u8v * uv; + i16 = i8 * i16; + i = i8 % i; + + // Shift + u8v <<= i8; + i8 >>= u8v.y; + + i8 = i8 << u8v.z; + u8v = u8v << i8; + + // Relational + b = (u8v.x != i8); + b = (i8 == u8v.x); + b = (u8v.x > uv.y); + b = (i8 < i); + b = (u8v.y >= uv.x); + b = (i8 <= i); + + // Bitwise + uv |= i8; + i = i8 | i; + i16 &= i8; + uv = u8v & uv; + uv ^= i8; + u8v = u8v ^ i8; +} + +void builtinFuncs() +{ + i8vec2 i8v; + i8vec4 i8v4; + u8vec3 u8v; + u8vec2 u8v2; + u8vec4 u8v4; + bvec3 bv; + int16_t i16; + int32_t i32; + uint16_t u16; + uint32_t u32; + + int8_t i8; + uint8_t u8; + + // abs() + i8v = abs(i8v); + + // sign() + i8 = sign(i8); + + // min() + i8v = min(i8v, i8); + i8v = min(i8v, i8vec2(-1)); + u8v = min(u8v, u8); + u8v = min(u8v, u8vec3(0)); + + // max() + i8v = max(i8v, i8); + i8v = max(i8v, i8vec2(-1)); + u8v = max(u8v, u8); + u8v = max(u8v, u8vec3(0)); + + // clamp() + i8v = clamp(i8v, -i8, i8); + i8v = clamp(i8v, -i8v, i8v); + u8v = clamp(u8v, -u8, u8); + u8v = clamp(u8v, -u8v, u8v); + + // mix() + i8 = mix(i8v.x, i8v.y, true); + i8v = mix(i8vec2(i8), i8vec2(-i8), bvec2(false)); + u8 = mix(u8v.x, u8v.y, true); + u8v = mix(u8vec3(u8), u8vec3(-u8), bvec3(false)); + + //pack + i16 = pack16(i8v); + i32 = pack32(i8v4); + u16 = pack16(u8v2); + u32 = pack32(u8v4); + + i8v = unpack8(i16); + i8v4 = unpack8(i32); + u8v2 = unpack8(u16); + u8v4 = unpack8(u32); + + // lessThan() + bv = lessThan(u8v, u8vec3(u8)); + bv.xy = lessThan(i8v, i8vec2(i8)); + + // lessThanEqual() + bv = lessThanEqual(u8v, u8vec3(u8)); + bv.xy = lessThanEqual(i8v, i8vec2(i8)); + + // greaterThan() + bv = greaterThan(u8v, u8vec3(u8)); + bv.xy = greaterThan(i8v, i8vec2(i8)); + + // greaterThanEqual() + bv = greaterThanEqual(u8v, u8vec3(u8)); + bv.xy = greaterThanEqual(i8v, i8vec2(i8)); + + // equal() + bv = equal(u8v, u8vec3(u8)); + bv.xy = equal(i8v, i8vec2(i8)); + + // notEqual() + bv = notEqual(u8v, u8vec3(u8)); + bv.xy = notEqual(i8v, i8vec2(i8)); +} + +// Type conversion for specialization constant +layout(constant_id = 100) const int8_t si8 = int8_t(-10); +layout(constant_id = 101) const uint8_t su8 = uint8_t(20); diff --git a/deps/glslang/Test/spv.intOps.vert b/deps/glslang/Test/spv.intOps.vert new file mode 100644 index 00000000..b7d749b4 --- /dev/null +++ b/deps/glslang/Test/spv.intOps.vert @@ -0,0 +1,72 @@ +#version 310 es + +in uint u1; +in uvec2 u2; +in uvec3 u3; +in uvec4 u4; + +in float v1; +in vec2 v2; +in vec3 v3; +in vec4 v4; + +in int i1; +in ivec2 i2; +in ivec3 i3; +in ivec4 i4; + +out uvec4 uout; +out ivec4 iout; +out vec4 fout; + +void main() +{ + iout = ivec4(0); + uout = uvec4(0); + fout = vec4(0.0); + + uvec2 u2out; + uout.xy += uaddCarry(u2, u2, u2out); + uout.xy += u2out; + + uint u1out; + uout.x += usubBorrow(u1, u1, u1out); + uout.x += u1out; + + uvec4 u4outHi, u4outLow; + umulExtended(u4, u4, u4outHi, u4outLow); + uout += u4outHi + u4outLow; + + ivec4 i4outHi, i4outLow; + imulExtended(i4, i4, i4outHi, i4outLow); + iout += i4outLow + i4outHi; + + ivec3 i3out; + fout.xyz += frexp(v3, i3out); + iout.xyz += i3out; + int i1out; + fout.x += frexp(v1, i1out); + iout.x += i1out; + + fout.xy += ldexp(v2, i2); + fout.x += ldexp(v1, i1); + + iout.x += bitfieldExtract(i1, 4, 5); + uout.xyz += bitfieldExtract(u3, 4, 5); + iout.xyz += bitfieldInsert(i3, i3, 4, 5); + uout.x += bitfieldInsert(u1, u1, 4, 5); + iout.xy += bitfieldReverse(i2); + uout += bitfieldReverse(u4); + iout.x += bitCount(i1); + iout.xyz += bitCount(u3); + + iout.xy += findLSB(i2); + iout += findLSB(u4); + iout.x += findMSB(i1); + iout.xy += findMSB(u2); + + uout.x += packUnorm4x8(v4); + uout.x += packSnorm4x8(v4); + fout += unpackUnorm4x8(u1); + fout += unpackSnorm4x8(u1); +} diff --git a/deps/glslang/Test/spv.interpOps.frag b/deps/glslang/Test/spv.interpOps.frag new file mode 100644 index 00000000..afe28dc3 --- /dev/null +++ b/deps/glslang/Test/spv.interpOps.frag @@ -0,0 +1,32 @@ +#version 450 + +in float if1; +in vec2 if2; +in vec3 if3; +in vec4 if4; + +flat in int samp; +flat in vec2 offset; + +out vec4 fragColor; + +void main() +{ + vec4 f4 = vec4(0.0); + f4.x += interpolateAtCentroid(if1); + f4.xy += interpolateAtCentroid(if2); + f4.xyz += interpolateAtCentroid(if3); + f4 += interpolateAtCentroid(if4); + + f4.x += interpolateAtSample(if1, samp); + f4.xy += interpolateAtSample(if2, samp); + f4.xyz += interpolateAtSample(if3, samp); + f4 += interpolateAtSample(if4, samp); + + f4.x += interpolateAtOffset(if1, offset); + f4.xy += interpolateAtOffset(if2, offset); + f4.xyz += interpolateAtOffset(if3, offset); + f4 += interpolateAtOffset(if4, offset); + + fragColor = f4; +} diff --git a/deps/glslang/Test/spv.layoutNested.vert b/deps/glslang/Test/spv.layoutNested.vert new file mode 100644 index 00000000..f0dc3898 --- /dev/null +++ b/deps/glslang/Test/spv.layoutNested.vert @@ -0,0 +1,76 @@ +#version 450 + +// should get 3 SPV types for S: no layout, 140, and 430, plus extras for interpolation or invariant differences +struct S +{ + highp uvec3 a; + mediump mat2 b[4]; + lowp uint c; +}; + +layout(set = 0, binding = 0, std140) uniform Block140 +{ + mediump int u; + S s[2][3]; + mediump vec2 v; +} inst140; + +layout(set = 0, binding = 1, std430) buffer Block430 +{ + mediump int u; + S s[2][3]; + mediump vec2 v; +} inst430; + +S s; + +// should get 5 SPV types for T: no layout, 140/row, 140/col, 430/row, and 430/col +struct T { + mat2 m; + int a; +}; + +T t; + +struct Nestor { + T nestorT; +}; + +layout(set = 1, binding = 0, std140) uniform Bt1 +{ + layout(row_major) Nestor nt; +} Btn1; + +layout(set = 1, binding = 0, std140) uniform Bt2 +{ + layout(column_major) Nestor nt; +} Btn2; + +layout(row_major, set = 1, binding = 0, std140) uniform Bt3 +{ + layout(column_major) Nestor ntcol; + Nestor ntrow; // should be row major decoration version of Nestor +} Btn3; + +layout(set = 1, binding = 0, std430) buffer bBt1 +{ + layout(row_major) Nestor nt; +} bBtn1; + +layout(set = 1, binding = 0, std430) buffer bBt2 +{ + layout(column_major) Nestor nt; +} bBtn2; + +layout(set = 1, binding = 0, std430) buffer bBt3 +{ + layout(row_major) Nestor ntcol; + Nestor ntrow; // should be col major decoration version of Nestor +} bBtn3; + +void main() +{ +} + +flat out S sout; +invariant out S soutinv; diff --git a/deps/glslang/Test/spv.length.frag b/deps/glslang/Test/spv.length.frag new file mode 100644 index 00000000..3b3db0b4 --- /dev/null +++ b/deps/glslang/Test/spv.length.frag @@ -0,0 +1,14 @@ +#version 140 + +vec4 u[3]; + +in vec2 v[2]; + +void main() +{ + int a[5]; + + vec2 t = v[0] + v[1]; + + gl_FragColor = vec4(u.length() * v.length() * a.length()); +} diff --git a/deps/glslang/Test/spv.localAggregates.frag b/deps/glslang/Test/spv.localAggregates.frag new file mode 100644 index 00000000..9bdb11b7 --- /dev/null +++ b/deps/glslang/Test/spv.localAggregates.frag @@ -0,0 +1,72 @@ +#version 400 + +uniform sampler2D samp2D; +in vec2 coord; +in vec4 color; + +struct s1 { + int i; + float f; +}; + +struct s2 { + int i; + float f; + s1 s1_1; + vec4 bleh; +}; + +struct s3 { + s2 s2_1; + int i; + float f; + s1 s1_1; +}; + + +flat in s1 foo; +flat in s2 foo2; +flat in s3 foo3; + + +flat in int condition; + +void main() +{ + s2 locals2; + s3 locals3; + float localFArray[16]; + int localIArray[8]; + + locals2 = foo3.s2_1; + + if (foo3.s2_1.i > 0) { + locals2.s1_1.f = 1.0; + localFArray[4] = coord.x; + localIArray[2] = foo3.s2_1.i; + } else { + locals2.s1_1.f = coord.x; + localFArray[4] = 1.0; + localIArray[2] = 0; + } + + if (localIArray[2] == 0) + ++localFArray[4]; + + float localArray[16]; + int x = 5; + localArray[x] = coord.x; + + float[16] a; + + for (int i = 0; i < 16; i++) + a[i] = 0.0; + + if (condition == 1) + a = localArray; + + locals2.bleh = color; + locals2.bleh.z = coord.y; + + gl_FragColor = locals2.bleh * (localFArray[4] + locals2.s1_1.f + localArray[x] + a[x]) * texture(samp2D, coord); +} diff --git a/deps/glslang/Test/spv.loops.frag b/deps/glslang/Test/spv.loops.frag new file mode 100644 index 00000000..b9ec0997 --- /dev/null +++ b/deps/glslang/Test/spv.loops.frag @@ -0,0 +1,302 @@ +#version 140 +in vec4 bigColor; +in vec4 bigColor1_1; +in vec4 bigColor1_2; +in vec4 bigColor1_3; +in vec4 bigColor2; +in vec4 bigColor3; +in vec4 bigColor4; +in vec4 bigColor5; +in vec4 bigColor6; +in vec4 bigColor7; +in vec4 bigColor8; + +in vec4 BaseColor; + +in float d; +in float d2; +in float d3; +in float d4; +in float d5; +in float d6; +in float d7; +in float d8; +in float d9; +in float d10; +in float d11; +in float d12; +in float d14; +in float d15; +in float d16; +in float d17; +in float d18; +flat in int Count; + +void main() +{ + vec4 color = BaseColor; + + // Not a real loop + while (true) { + if (color.x < 0.33) { + color += vec4(0.33); + break; + } + if (color.x < 0.66) { + color += vec4(0.66); + break; + } + + color += vec4(0.33); + break; + } + + // While + while (color.x < d) { + color += bigColor; + } + + // While (latchy) + while (color.z < d) { + color += bigColor1_1; + if (color.w < d) + continue; + + color += bigColor1_1; + } + + // While (constant) + while (color.x < 42.0) { + ++color; + } + + // While (complicated-conditional) + while (color.w < d2 && color.y < d3) { + color += bigColor1_2; + } + + // While (multi-exit) + while (color.z < d3) { + color += bigColor1_3; + if (color.y < d4) + break; + color += bigColor1_3; + } + + // For (dynamic) + for (int i = 0; i < Count; ++i) { + color += bigColor2; + } + + // Do while + do { + color += bigColor3; + } while (color.x < d2); + + // For (static) + for (int i = 0; i < 42; ++i) { + color.z += d3; + } + + // For (static) flow-control + for (int i = 0; i < 100; ++i) { + if (color.z < 20.0) + color.x++; + else + color.y++; + if (color.w < 20.0) + if (color.z > color.y) + 0; // do nothing + } + + // For (static) flow-control with latch merge + for (int i = 0; i < 120; ++i) { + if (color.z < 20.0) + color.x++; + else + color.y++; + } + + // For (static) latchy + for (int i = 0; i < 42; ++i) { + color.z += d3; + if (color.x < d4) + continue; + ++color.w; + } + + // For (static) multi-exit + for (int i = 0; i < 42; ++i) { + color.z += d3; + if (color.x < d4) + break; + ++color.w; + } + + // Latchy + do { + color += bigColor4; + if (color.x < d4) + continue; + if (color.y < d4) + color.y += d4; + else + color.x += d4; + } while (color.z < d4); + + // Do while flow control + do { + color += bigColor5; + if (color.y < d5) + color.y += d5; + } while (color.x < d5); + + // If then loop + if (color.x < d6) { + while (color.y < d6) + color += bigColor6; + } else { + while (color.z < d6) + color.z += bigColor6.z; + } + + // If then multi-exit + if (color.x < d6) { + while (color.y < d6) { + color += bigColor6; + if (d7 < 1.0) + break; + } + + } else { + while (color.z < d6) + color.z += bigColor6.z; + } + + + // Multi-exit + do { + if (d7 < 0.0) + break; + + color += bigColor7; + + if (d7 < 1.0) { + color.z++; + break; + } + + color += BaseColor; + + } while (true); + + + // Multi-exit2 + do { + // invariant conditional break at the top of the loop. This could be a + // situation where unswitching the loop has no real increases in code + // size. + if (d8 < 0.0) + break; + + color += bigColor7; + + if (d8 < 1.0) { + color.z++; + if (d8 < 2.0) { + color.y++; + } else { + color.x++; + } + break; + } + + color += BaseColor; + + } while (color.z < d8); + + // Deep exit + while (color.w < d9) { + if (d9 > d8) { + if (color.x <= d7) { + if (color.z == 5.0) + color.w++; + else + break; + } + } + + } + + // No end loop-back. + while (color.z < d10) { + color.y++; + if (color.y < d11) { + color.z++; + if (color.w < d12) + color.w++; + else + color.x++; + continue; + } + + color++; + break; + } + + // Multi-continue + while (color.x < 10.0) { + color += bigColor8; + + if (color.z < d8) + if (color.w < d6) + continue; + + color.y += bigColor8.x; + } + + color++; + gl_FragColor = color; + + // Early Return + while (color.x < d14) { + if (color.y < d15) { + return; + } + else + color++; + } + + color++; + + while (color.w < d16) { + color.w++; + } + + + // While (complicated-conditional) + while (color.w < d2 && color.y < d3) { + color += bigColor1_2; + if (color.z < d3) + return; + } + + + do { + if (color.y < d18) + return; + color++; + } while (color.x < d17); + + // Early Discard + while (color.y < d16) { + if (color.w < d16) { + discard; + } else + color++; + } + + color++; + + gl_FragColor = color; +} diff --git a/deps/glslang/Test/spv.loopsArtificial.frag b/deps/glslang/Test/spv.loopsArtificial.frag new file mode 100644 index 00000000..ae380b94 --- /dev/null +++ b/deps/glslang/Test/spv.loopsArtificial.frag @@ -0,0 +1,67 @@ +#version 140 +in vec4 bigColor; +in vec4 bigColor1_1; +in vec4 bigColor1_2; +in vec4 bigColor1_3; +in vec4 bigColor2; +in vec4 bigColor3; +in vec4 bigColor4; +in vec4 bigColor5; +in vec4 bigColor6; +in vec4 bigColor7; +in vec4 bigColor8; + +in vec4 BaseColor; + +in float d; +in float d2; +in float d3; +in float d4; +in float d13; + +flat in int Count; + +void main() +{ + vec4 color = BaseColor; + + // Latchy2 + do { + color += bigColor4; + if (color.x < d4) { + color.z += 2.0; + if (color.z < d4) { + color.x++; + continue; + } + } + if (color.y < d4) + color.y += d4; + else + color.x += d4; + } while (color.z < d4); + + // Immediate dominator + while (color.w < d13) { + if (color.z < d13) + color++; + else + color--; + // code from Latchy 2 + color += bigColor4; + if (color.x < d4) { + color.z += 2.0; + if (color.z < d4) { + color.x++; + continue; + } + } + if (color.y < d4) + color.y += d4; + else + color.x += d4; + } + + color++; + gl_FragColor = color; +} diff --git a/deps/glslang/Test/spv.looseUniformNoLoc.vert b/deps/glslang/Test/spv.looseUniformNoLoc.vert new file mode 100644 index 00000000..e8873594 --- /dev/null +++ b/deps/glslang/Test/spv.looseUniformNoLoc.vert @@ -0,0 +1,15 @@ +#version 450 core + +layout(location = 0) +in vec4 foo; + +layout(location = 0) +out vec4 bar; + +uniform vec4 uv; + +void main() +{ + bar = foo; + gl_Position = foo; +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.matFun.vert b/deps/glslang/Test/spv.matFun.vert new file mode 100644 index 00000000..49e882f4 --- /dev/null +++ b/deps/glslang/Test/spv.matFun.vert @@ -0,0 +1,28 @@ +#version 400 + +uniform bl { + uniform mat4 m4; + uniform mat3 m3; +} bName; + +in vec3 v3; + +vec3 xf(mat3 m, vec3 v) +{ + return v * m; +} + +mat3 Mat3(mat4 m) +{ + return mat3(m[0].xyz, m[1].xyz, m[2].xyz); +} + +vec3 mxv(mat4 m4, vec3 v) +{ + return v * Mat3(m4); +} + +void main() +{ + gl_Position = vec4(mxv(bName.m4, v3) + xf(bName.m3, v3), 1.0); +} diff --git a/deps/glslang/Test/spv.matrix.frag b/deps/glslang/Test/spv.matrix.frag new file mode 100644 index 00000000..31571737 --- /dev/null +++ b/deps/glslang/Test/spv.matrix.frag @@ -0,0 +1,49 @@ +#version 420 + +in mat3x4 m1; +in mat3x4 m2; +in float f; +in vec3 v3; +in vec4 v4; + +out vec4 color; + +void main() +{ + mat3x4 sum34; + dmat3x4 dm; + vec3 sum3; + vec4 sum4; + + sum34 = m1 - m2; + sum34 += m1 * f; + sum34 += f * m1; + sum34 /= matrixCompMult(m1, m2); + sum34 += m1 / f; + sum34 += f / m1; + sum34 += f; + sum34 -= f; + dm = dmat3x4(sum34); + sum34 = mat3x4(dm); + + sum3 = v4 * m2; + sum4 = m2 * v3; + + mat4x3 m43 = transpose(sum34); + mat4 m4 = m1 * m43; + + sum4 = v4 * m4; + + color = sum4; + + ++sum34; + --sum34; + + sum34 += mat3x4(f); + sum34 += mat3x4(v3, f, v3, f, v3, f); + + color += sum3 * m43 + sum4; + + color += vec4(m43); + color += vec4(vec3(mat2(f)), 7.2); +} diff --git a/deps/glslang/Test/spv.matrix2.frag b/deps/glslang/Test/spv.matrix2.frag new file mode 100644 index 00000000..7fb6dd86 --- /dev/null +++ b/deps/glslang/Test/spv.matrix2.frag @@ -0,0 +1,50 @@ +#version 150 + +in mat3 colorTransform; +in vec3 Color; +in mat4 m, n; + +in mat4x3 um43; +in mat3x4 un34; +in mat2 um2; +in mat3 um3; +in mat4 um4; + +in vec4 v; + +in vec3 u; + +out vec4 FragColor; + +void main() +{ + mat3x4 m34 = outerProduct(v, u); + + m34 += mat3x4(4.3); + + FragColor = vec4(Color, 1.0); + FragColor *= vec4(FragColor * m34, 1.0); + + m34 *= v.x; + + mat4 m44 = mat4(un34); + + m44 += m34 * um43; + + FragColor += (-m44) * v; + + FragColor *= matrixCompMult(m44, m44); + + m34 = transpose(um43); + FragColor *= vec4(FragColor * m34, 1.0); + FragColor *= vec4(determinant(um4)); + mat2 inv = inverse(um2); + FragColor *= vec4(inv[0][0], inv[1][0], inv[0][1], inv[1][1]); + mat3 inv3 = inverse(um3); + FragColor *= vec4(inv3[2][1]); + + mat4 inv4 = inverse(um4); + FragColor *= inv4; + + FragColor = vec4(FragColor * matrixCompMult(un34, un34), FragColor.w); +} diff --git a/deps/glslang/Test/spv.memoryQualifier.frag b/deps/glslang/Test/spv.memoryQualifier.frag new file mode 100644 index 00000000..85e71478 --- /dev/null +++ b/deps/glslang/Test/spv.memoryQualifier.frag @@ -0,0 +1,38 @@ +#version 450 + +layout(binding = 0, r32f) uniform coherent image1D i1D; +layout(binding = 1, r32f) uniform volatile image2D i2D; +layout(binding = 2, r32f) uniform restrict image2DRect i2DRect; +layout(binding = 3, r32f) uniform readonly image3D i3D; +layout(binding = 3, r32f) uniform writeonly imageCube iCube; + +struct Data +{ + float f1; + vec2 f2; +}; + +coherent buffer Buffer +{ + volatile float f1; + restrict vec2 f2; + readonly vec3 f3; + writeonly vec4 f4; + int i1; + Data data; +}; + +void main() +{ + vec4 texel = imageLoad(i1D, 1); + texel += imageLoad(i2D, ivec2(1)); + texel += imageLoad(i2DRect, ivec2(1)); + texel += imageLoad(i3D, ivec3(1)); + imageStore(iCube, ivec3(1), texel); + + texel[i1] = f1; + texel.xy += f2; + texel.xyz -= f3; + texel.w += data.f1 + data.f2[1]; + f4 = texel; +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.memoryScopeSemantics.comp b/deps/glslang/Test/spv.memoryScopeSemantics.comp new file mode 100644 index 00000000..c03c1239 --- /dev/null +++ b/deps/glslang/Test/spv.memoryScopeSemantics.comp @@ -0,0 +1,61 @@ +#version 450 +#extension GL_KHR_memory_scope_semantics : require +#extension GL_ARB_gpu_shader_int64 : require + +#pragma use_vulkan_memory_model + +shared uint value; +shared int atomi; +shared uint atomu; +layout(binding = 0, r32ui) workgroupcoherent uniform uimage2D imageu; +layout(binding = 1, r32i) volatile coherent uniform iimage2D imagei; +layout(binding = 5, r32i) nonprivate uniform iimage2D imagej[2]; +layout (binding = 2) buffer BufferU { workgroupcoherent uint x; } bufferu; +layout (binding = 3) coherent buffer BufferI { uint x; } bufferi; +struct A { uint x[2]; }; +layout (binding = 4) volatile buffer BufferJ { subgroupcoherent A a; } bufferj[2]; +layout (binding = 6) nonprivate uniform sampler2D samp[2]; +layout (binding = 7) nonprivate uniform BufferK { uint x; } bufferk; +shared uint64_t atomu64; +shared int64_t atomi64; + + +void main() +{ + int origi = atomicAdd(atomi, 3, gl_ScopeDevice, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsRelease); + uint origu = atomicAnd(atomu, value); + origi = atomicLoad(atomi, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsAcquire); + atomicStore(atomu, value, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsRelease); + origi = imageAtomicLoad(imagei, ivec2(0,0), gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsAcquire); + origu = imageAtomicAdd(imageu, ivec2(0,0), 3u, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsAcquire); + imageAtomicStore(imageu, ivec2(0,0), 4u, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsRelease); + origu = atomicOr(atomu, 7u, gl_ScopeDevice, 0, 0); + origu = atomicXor(atomu, 7u, gl_ScopeDevice, 0, 0); + origu = atomicMin(atomu, value, gl_ScopeDevice, 0, 0); + origi = atomicMax(atomi, 7, gl_ScopeDevice, 0, 0); + origi = atomicExchange(atomi, origi, gl_ScopeDevice, 0, 0); + origu = atomicCompSwap(atomu, 10u, value, gl_ScopeDevice, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire); + atomicAdd(bufferu.x, 1, gl_ScopeDevice, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsRelease); + memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsRelease); + controlBarrier(gl_ScopeWorkgroup, gl_ScopeWorkgroup, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire); + controlBarrier(gl_ScopeWorkgroup, gl_ScopeWorkgroup, 0, 0); + + uint y; + y = bufferu.x; + bufferu.x = y; + y = bufferi.x; + y = bufferj[0].a.x[1]; + bufferi.x = y; + bufferj[0].a.x[1] = y; + bufferj[0].a = bufferj[1].a; + bufferi.x = bufferk.x; + + imageLoad(imagei, ivec2(0,0)); + imageLoad(imagej[0], ivec2(0,0)); + imageStore(imagej[1], ivec2(0,0), ivec4(0,0,0,0)); + texture(samp[0], vec2(0,0)); + + atomu64 = atomicMax(atomu64, uint64_t(7), gl_ScopeDevice, 0, 0); + atomicCompSwap(atomi64, int64_t(10), int64_t(atomu64), gl_ScopeDevice, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire); +} + diff --git a/deps/glslang/Test/spv.memoryScopeSemantics_Error.comp b/deps/glslang/Test/spv.memoryScopeSemantics_Error.comp new file mode 100644 index 00000000..4e18b2e0 --- /dev/null +++ b/deps/glslang/Test/spv.memoryScopeSemantics_Error.comp @@ -0,0 +1,28 @@ +#version 450 +#extension GL_KHR_memory_scope_semantics : require + + +shared uint value; +shared int atomi; +shared uint atomu; +layout(binding = 0, r32ui) workgroupcoherent uniform uimage2D imageu; +layout(binding = 1, r32i) coherent uniform iimage2D imagei; +layout (binding = 2) buffer BufferU { workgroupcoherent uint x; } bufferu; +layout (binding = 3) subgroupcoherent buffer BufferI { uint x; } bufferi; + +void main() +{ + atomicStore(atomu, value, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsAcquire); + int origi = imageAtomicLoad(imagei, ivec2(0,0), gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsRelease); + atomicStore(atomu, value, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsAcquireRelease); + atomicStore(atomu, value, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_StorageSemanticsBuffer); + origi = imageAtomicLoad(imagei, ivec2(0,0), gl_ScopeDevice, gl_SemanticsAcquire, gl_SemanticsAcquire); + memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, 0); + memoryBarrier(gl_ScopeWorkgroup, 0, gl_SemanticsRelease); + memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsRelease | gl_SemanticsAcquire); + atomicAdd(atomu, value, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsRelease | gl_SemanticsAcquire); + uint origu = atomicCompSwap(atomu, 10u, value, gl_ScopeDevice, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquireRelease); + memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer, gl_SemanticsRelease | gl_SemanticsMakeVisible); + memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer, gl_SemanticsAcquire | gl_SemanticsMakeAvailable); +} + diff --git a/deps/glslang/Test/spv.merge-unreachable.frag b/deps/glslang/Test/spv.merge-unreachable.frag new file mode 100644 index 00000000..a650cd1c --- /dev/null +++ b/deps/glslang/Test/spv.merge-unreachable.frag @@ -0,0 +1,8 @@ +#version 450 +precision mediump int; precision highp float; +layout(location=1) in highp vec4 v; +void main (void) +{ + if (v == vec4(0.1,0.2,0.3,0.4)) discard; + else return; +} diff --git a/deps/glslang/Test/spv.meshShaderBuiltins.mesh b/deps/glslang/Test/spv.meshShaderBuiltins.mesh new file mode 100644 index 00000000..8adff3d8 --- /dev/null +++ b/deps/glslang/Test/spv.meshShaderBuiltins.mesh @@ -0,0 +1,63 @@ +#version 460 + +#define MAX_VER 81 +#define MAX_PRIM 32 + +#define BARRIER() \ + memoryBarrierShared(); \ + barrier(); + +#extension GL_NV_mesh_shader : enable + +layout(local_size_x = 32) in; + +layout(max_vertices=MAX_VER) out; +layout(max_primitives=MAX_PRIM) out; +layout(triangles) out; + +// test use of builtins in mesh shaders: + +void main() +{ + uint iid = gl_LocalInvocationID.x; + uint gid = gl_WorkGroupID.x; + + gl_MeshVerticesNV[iid].gl_Position = vec4(1.0); + gl_MeshVerticesNV[iid].gl_PointSize = 2.0; + gl_MeshVerticesNV[iid].gl_ClipDistance[3] = 3.0; + gl_MeshVerticesNV[iid].gl_CullDistance[2] = 4.0; + + BARRIER(); + + gl_MeshVerticesNV[iid+1].gl_Position = gl_MeshVerticesNV[iid].gl_Position; + gl_MeshVerticesNV[iid+1].gl_PointSize = gl_MeshVerticesNV[iid].gl_PointSize; + gl_MeshVerticesNV[iid+1].gl_ClipDistance[3] = gl_MeshVerticesNV[iid].gl_ClipDistance[3]; + gl_MeshVerticesNV[iid+1].gl_CullDistance[2] = gl_MeshVerticesNV[iid].gl_CullDistance[2]; + + BARRIER(); + + gl_MeshPrimitivesNV[iid].gl_PrimitiveID = 6; + gl_MeshPrimitivesNV[iid].gl_Layer = 7; + gl_MeshPrimitivesNV[iid].gl_ViewportIndex = 8; + gl_MeshPrimitivesNV[iid].gl_ViewportMask[0] = 9; + + BARRIER(); + + gl_MeshPrimitivesNV[iid+1].gl_PrimitiveID = gl_MeshPrimitivesNV[iid].gl_PrimitiveID; + gl_MeshPrimitivesNV[iid+1].gl_Layer = gl_MeshPrimitivesNV[iid].gl_Layer; + gl_MeshPrimitivesNV[iid+1].gl_ViewportIndex = gl_MeshPrimitivesNV[iid].gl_ViewportIndex; + gl_MeshPrimitivesNV[iid+1].gl_ViewportMask[0] = gl_MeshPrimitivesNV[iid].gl_ViewportMask[0]; + + BARRIER(); + + // should truncate 257 -> 1 + gl_PrimitiveIndicesNV[0] = 257; + gl_PrimitiveIndicesNV[gid] = gl_PrimitiveIndicesNV[gid-1]; + + // writes 4 indices at offset gl_DrawID + writePackedPrimitiveIndices4x8NV(gl_DrawID, 0x01020304); + + gl_PrimitiveCountNV = MAX_PRIM * 3; + + BARRIER(); +} diff --git a/deps/glslang/Test/spv.meshShaderPerViewBuiltins.mesh b/deps/glslang/Test/spv.meshShaderPerViewBuiltins.mesh new file mode 100644 index 00000000..54fb7440 --- /dev/null +++ b/deps/glslang/Test/spv.meshShaderPerViewBuiltins.mesh @@ -0,0 +1,42 @@ +#version 450 + +#define MAX_VER 81 +#define MAX_PRIM 32 +#define MAX_VIEWS gl_MaxMeshViewCountNV + +#define BARRIER() \ + memoryBarrierShared(); \ + barrier(); + +#extension GL_NV_mesh_shader : enable + +layout(local_size_x = 32) in; + +layout(max_vertices=MAX_VER) out; +layout(max_primitives=MAX_PRIM) out; +layout(triangles) out; + +// test use of per-view builtin attributes + +void main() +{ + uint iid = gl_LocalInvocationID.x; + uint viewID = gl_MeshViewIndicesNV[gl_MeshViewCountNV%MAX_VIEWS]; + + gl_MeshVerticesNV[iid].gl_PositionPerViewNV[viewID] = vec4(1.0, 2.0, 3.0, 4.0); + gl_MeshVerticesNV[iid].gl_ClipDistancePerViewNV[viewID][2] = 5.0; + gl_MeshVerticesNV[iid].gl_CullDistancePerViewNV[viewID][3] = 6.0; + gl_MeshPrimitivesNV[iid].gl_LayerPerViewNV[viewID] = 7; + gl_MeshPrimitivesNV[iid].gl_ViewportMaskPerViewNV[viewID][0] = 8; + + BARRIER(); + + gl_MeshVerticesNV[iid+1].gl_PositionPerViewNV[viewID] = gl_MeshVerticesNV[iid].gl_PositionPerViewNV[viewID]; + gl_MeshVerticesNV[iid+1].gl_ClipDistancePerViewNV[viewID][2] = gl_MeshVerticesNV[iid].gl_ClipDistancePerViewNV[viewID][2]; + gl_MeshVerticesNV[iid+1].gl_CullDistancePerViewNV[viewID][3] = gl_MeshVerticesNV[iid].gl_CullDistancePerViewNV[viewID][3]; + gl_MeshPrimitivesNV[iid+1].gl_LayerPerViewNV[viewID] = gl_MeshPrimitivesNV[iid].gl_LayerPerViewNV[viewID]; + gl_MeshPrimitivesNV[iid+1].gl_ViewportMaskPerViewNV[viewID][0] = gl_MeshPrimitivesNV[iid].gl_ViewportMaskPerViewNV[viewID][0]; + + BARRIER(); +} + diff --git a/deps/glslang/Test/spv.meshShaderPerViewUserDefined.mesh b/deps/glslang/Test/spv.meshShaderPerViewUserDefined.mesh new file mode 100644 index 00000000..4a316eb2 --- /dev/null +++ b/deps/glslang/Test/spv.meshShaderPerViewUserDefined.mesh @@ -0,0 +1,56 @@ +#version 450 + +#define MAX_VER 81 +#define MAX_PRIM 32 +#define MAX_VIEWS gl_MaxMeshViewCountNV + +#define BARRIER() \ + memoryBarrierShared(); \ + barrier(); + +#extension GL_NV_mesh_shader : enable + +layout(local_size_x = 32) in; + +layout(max_vertices=MAX_VER) out; +layout(max_primitives=MAX_PRIM) out; +layout(triangles) out; + +// test use of user-defined per-view attributes + +// mix of single-view and per-view attributes +layout(location=0) out block { + perprimitiveNV perviewNV vec4 color1[][3]; // Implicitly sized + perprimitiveNV vec4 color2[3]; + perviewNV vec4 color3[MAX_VIEWS][3]; // Explicitly sized + vec4 color4; +} b[]; + +// per-view block +perviewNV layout(location=10) out perviewBlock { + perprimitiveNV vec4 color5[]; // Implicitly sized + perprimitiveNV vec4 color6[MAX_VIEWS][3]; // Explicitly sized + vec4 color7[][3]; // Implicitly sized + vec4 color8[MAX_VIEWS]; // Explicitly sized +} b2[]; + +void main() +{ + uint iid = gl_LocalInvocationID.x; + uint viewID = gl_MeshViewIndicesNV[gl_MeshViewCountNV%MAX_VIEWS]; + + b[iid].color1[viewID][2] = vec4(1.0); + b[iid].color2[1] = vec4(2.0); + b[iid].color3[viewID][2] = vec4(3.0); + b[iid].color4 = vec4(4.0); + + BARRIER(); + + b2[iid].color5[viewID] = vec4(5.0); + b2[iid].color6[viewID][1] = vec4(6.0); + b2[iid].color7[viewID][2] = vec4(7.0); + b2[iid].color8[viewID] = vec4(8.0); + + BARRIER(); +} + diff --git a/deps/glslang/Test/spv.meshShaderRedeclBuiltins.mesh b/deps/glslang/Test/spv.meshShaderRedeclBuiltins.mesh new file mode 100644 index 00000000..38107b29 --- /dev/null +++ b/deps/glslang/Test/spv.meshShaderRedeclBuiltins.mesh @@ -0,0 +1,66 @@ +#version 460 + +#define MAX_VER 81 +#define MAX_PRIM 32 + +#define BARRIER() \ + memoryBarrierShared(); \ + barrier(); + +#extension GL_NV_mesh_shader : enable + +layout(local_size_x = 32) in; + +layout(max_vertices=MAX_VER) out; +layout(max_primitives=MAX_PRIM) out; +layout(triangles) out; + +// test use of redeclared single-view builtins in mesh shaders: + +out gl_MeshPerVertexNV { + vec4 gl_Position; + float gl_PointSize; + float gl_ClipDistance[4]; + float gl_CullDistance[4]; +} gl_MeshVerticesNV[]; + +perprimitiveNV out gl_MeshPerPrimitiveNV { + int gl_PrimitiveID; + int gl_Layer; + int gl_ViewportIndex; + int gl_ViewportMask[]; +} gl_MeshPrimitivesNV[]; + +void main() +{ + uint iid = gl_LocalInvocationID.x; + uint gid = gl_WorkGroupID.x; + + gl_MeshVerticesNV[iid].gl_Position = vec4(1.0); + gl_MeshVerticesNV[iid].gl_PointSize = 2.0; + gl_MeshVerticesNV[iid].gl_ClipDistance[3] = 3.0; + gl_MeshVerticesNV[iid].gl_CullDistance[2] = 4.0; + + BARRIER(); + + gl_MeshVerticesNV[iid+1].gl_Position = gl_MeshVerticesNV[iid].gl_Position; + gl_MeshVerticesNV[iid+1].gl_PointSize = gl_MeshVerticesNV[iid].gl_PointSize; + gl_MeshVerticesNV[iid+1].gl_ClipDistance[3] = gl_MeshVerticesNV[iid].gl_ClipDistance[3]; + gl_MeshVerticesNV[iid+1].gl_CullDistance[2] = gl_MeshVerticesNV[iid].gl_CullDistance[2]; + + BARRIER(); + + gl_MeshPrimitivesNV[iid].gl_PrimitiveID = 6; + gl_MeshPrimitivesNV[iid].gl_Layer = 7; + gl_MeshPrimitivesNV[iid].gl_ViewportIndex = 8; + gl_MeshPrimitivesNV[iid].gl_ViewportMask[0] = 9; + + BARRIER(); + + gl_MeshPrimitivesNV[iid+1].gl_PrimitiveID = gl_MeshPrimitivesNV[iid].gl_PrimitiveID; + gl_MeshPrimitivesNV[iid+1].gl_Layer = gl_MeshPrimitivesNV[iid].gl_Layer; + gl_MeshPrimitivesNV[iid+1].gl_ViewportIndex = gl_MeshPrimitivesNV[iid].gl_ViewportIndex; + gl_MeshPrimitivesNV[iid+1].gl_ViewportMask[0] = gl_MeshPrimitivesNV[iid].gl_ViewportMask[0]; + + BARRIER(); +} diff --git a/deps/glslang/Test/spv.meshShaderRedeclPerViewBuiltins.mesh b/deps/glslang/Test/spv.meshShaderRedeclPerViewBuiltins.mesh new file mode 100644 index 00000000..3b75b558 --- /dev/null +++ b/deps/glslang/Test/spv.meshShaderRedeclPerViewBuiltins.mesh @@ -0,0 +1,53 @@ +#version 450 + +#define MAX_VER 81 +#define MAX_PRIM 32 +#define MAX_VIEWS gl_MaxMeshViewCountNV + +#define BARRIER() \ + memoryBarrierShared(); \ + barrier(); + +#extension GL_NV_mesh_shader : enable + +layout(local_size_x = 32) in; + +layout(max_vertices=MAX_VER) out; +layout(max_primitives=MAX_PRIM) out; +layout(triangles) out; + +// test use of redeclared per-view builtin attributes + +out gl_MeshPerVertexNV { + perviewNV vec4 gl_PositionPerViewNV[MAX_VIEWS]; // explicitly sized view dim + perviewNV float gl_ClipDistancePerViewNV[MAX_VIEWS][4]; // explicitly sized view dim + perviewNV float gl_CullDistancePerViewNV[MAX_VIEWS][4]; // explicitly sized view dim +} gl_MeshVerticesNV[]; + +perprimitiveNV out gl_MeshPerPrimitiveNV { + perviewNV int gl_LayerPerViewNV[]; // implicitly sized view dim + perviewNV int gl_ViewportMaskPerViewNV[][1]; // implicitly sized view dim +} gl_MeshPrimitivesNV[]; + +void main() +{ + uint iid = gl_LocalInvocationID.x; + uint viewID = gl_MeshViewIndicesNV[gl_MeshViewCountNV%MAX_VIEWS]; + + gl_MeshVerticesNV[iid].gl_PositionPerViewNV[viewID] = vec4(1.0, 2.0, 3.0, 4.0); + gl_MeshVerticesNV[iid].gl_ClipDistancePerViewNV[viewID][2] = 5.0; + gl_MeshVerticesNV[iid].gl_CullDistancePerViewNV[viewID][3] = 6.0; + gl_MeshPrimitivesNV[iid].gl_LayerPerViewNV[viewID] = 7; + gl_MeshPrimitivesNV[iid].gl_ViewportMaskPerViewNV[viewID][0] = 8; + + BARRIER(); + + gl_MeshVerticesNV[iid+1].gl_PositionPerViewNV[viewID] = gl_MeshVerticesNV[iid].gl_PositionPerViewNV[viewID]; + gl_MeshVerticesNV[iid+1].gl_ClipDistancePerViewNV[viewID][2] = gl_MeshVerticesNV[iid].gl_ClipDistancePerViewNV[viewID][2]; + gl_MeshVerticesNV[iid+1].gl_CullDistancePerViewNV[viewID][3] = gl_MeshVerticesNV[iid].gl_CullDistancePerViewNV[viewID][3]; + gl_MeshPrimitivesNV[iid+1].gl_LayerPerViewNV[viewID] = gl_MeshPrimitivesNV[iid].gl_LayerPerViewNV[viewID]; + gl_MeshPrimitivesNV[iid+1].gl_ViewportMaskPerViewNV[viewID][0] = gl_MeshPrimitivesNV[iid].gl_ViewportMaskPerViewNV[viewID][0]; + + BARRIER(); +} + diff --git a/deps/glslang/Test/spv.meshShaderSharedMem.mesh b/deps/glslang/Test/spv.meshShaderSharedMem.mesh new file mode 100644 index 00000000..b9d2f6d7 --- /dev/null +++ b/deps/glslang/Test/spv.meshShaderSharedMem.mesh @@ -0,0 +1,39 @@ +#version 450 + +#define MAX_VER 81 +#define MAX_PRIM 32 + +#define BARRIER() \ + memoryBarrierShared(); \ + barrier(); + +#extension GL_NV_mesh_shader : enable + +layout(local_size_x = 32) in; + +layout(max_vertices=MAX_VER) out; +layout(max_primitives=MAX_PRIM) out; +layout(triangles) out; + +// test use of shared memory in mesh shaders: + +writeonly uniform image2D uni_image; +uniform block0 { + uint uni_value; +}; + +shared vec4 mem[10]; + +void main() +{ + uint iid = gl_LocalInvocationID.x; + uint gid = gl_WorkGroupID.x; + + for (uint i = 0; i < 10; ++i) { + mem[i] = vec4(i+uni_value); + } + imageStore(uni_image, ivec2(iid), mem[gid]); + imageStore(uni_image, ivec2(iid), mem[gid+1]); + + BARRIER(); +} diff --git a/deps/glslang/Test/spv.meshShaderTaskMem.mesh b/deps/glslang/Test/spv.meshShaderTaskMem.mesh new file mode 100644 index 00000000..5ce5bedd --- /dev/null +++ b/deps/glslang/Test/spv.meshShaderTaskMem.mesh @@ -0,0 +1,41 @@ +#version 450 + +#define MAX_VER 81 +#define MAX_PRIM 32 + +#define BARRIER() \ + memoryBarrierShared(); \ + barrier(); + +#extension GL_NV_mesh_shader : enable + +layout(local_size_x = 32) in; + +layout(max_vertices=MAX_VER) out; +layout(max_primitives=MAX_PRIM) out; +layout(triangles) out; + +// test use of task memory in mesh shaders: + +taskNV in taskBlock { + float gid1[2]; + vec4 gid2; +} mytask; + +buffer bufferBlock { + float gid3[2]; + vec4 gid4; +} mybuf; + +layout(location=0) out outBlock { + float gid5; + vec4 gid6; +} myblk[]; + +void main() +{ + uint iid = gl_LocalInvocationID.x; + + myblk[iid].gid5 = mytask.gid1[1] + mybuf.gid3[1]; + myblk[iid].gid6 = mytask.gid2 + mybuf.gid4; +} diff --git a/deps/glslang/Test/spv.meshShaderUserDefined.mesh b/deps/glslang/Test/spv.meshShaderUserDefined.mesh new file mode 100644 index 00000000..8b0937db --- /dev/null +++ b/deps/glslang/Test/spv.meshShaderUserDefined.mesh @@ -0,0 +1,59 @@ +#version 450 + +#define MAX_VER 81 +#define MAX_PRIM 32 + +#define BARRIER() \ + memoryBarrierShared(); \ + barrier(); + +#extension GL_NV_mesh_shader : enable + +layout(local_size_x = 32) in; + +layout(max_vertices=MAX_VER) out; +layout(max_primitives=MAX_PRIM) out; +layout(triangles) out; + +// test use of user defined interface out blocks: + +// per-primitive block +perprimitiveNV layout(location=0) out myblock { + float f; + float fArr[4]; + vec3 pos; + vec4 posArr[4]; + mat4 m; + mat3 mArr[2]; +} blk[]; + +// per-vertex block +layout(location=20) out myblock2 { + float f; + vec4 pos; + mat4 m; +} blk2[]; + +void main() +{ + uint iid = gl_LocalInvocationID.x; + uint gid = gl_WorkGroupID.x; + + blk[iid].f = 11.0; + blk[iid+1].fArr[gid] = blk[iid].f; + blk[iid/2].pos.yzx = vec3(14.0, 15.0, 13.0); + blk[iid*2].posArr[1].yzw = blk[iid/2].pos; + blk[iid/4].m[2].wzyx = vec4(13.0, 14.0, 15.0, 16.0); + blk[iid].mArr[0][1][1] = blk[iid/4].m[2].w; + blk[iid*4].mArr[1][gid] = vec3(17.0, 18.0, 19.0); + + BARRIER(); + + blk2[iid].f = blk2[iid-1].f + 20.0; + blk2[iid].pos = vec4(21.0, 22.0, 23.0, 24.0); + blk2[iid+1].m[gid] = blk2[iid].pos; + blk2[iid+1].m[gid][2] = 29.0; + blk2[iid+2].m[3] = blk2[iid+1].m[gid]; + + BARRIER(); +} diff --git a/deps/glslang/Test/spv.meshTaskShader.task b/deps/glslang/Test/spv.meshTaskShader.task new file mode 100644 index 00000000..c12b3bdd --- /dev/null +++ b/deps/glslang/Test/spv.meshTaskShader.task @@ -0,0 +1,49 @@ +#version 450 + +#define BARRIER() \ + memoryBarrierShared(); \ + barrier(); + +#extension GL_NV_mesh_shader : enable + +layout(local_size_x = 32) in; + +// test use of shared memory in task shaders: +layout(binding=0) writeonly uniform image2D uni_image; +uniform block0 { + uint uni_value; +}; +shared vec4 mem[10]; + +// test use of task memory in task shaders: +taskNV out Task { + vec2 dummy; + vec2 submesh[3]; +} mytask; + +void main() +{ + uint iid = gl_LocalInvocationID.x; + uint gid = gl_WorkGroupID.x; + + // 1. shared memory load and stores + for (uint i = 0; i < 10; ++i) { + mem[i] = vec4(i + uni_value); + } + imageStore(uni_image, ivec2(iid), mem[gid]); + imageStore(uni_image, ivec2(iid), mem[gid+1]); + + BARRIER(); + + // 2. task memory stores + + mytask.dummy = vec2(30.0, 31.0); + mytask.submesh[0] = vec2(32.0, 33.0); + mytask.submesh[1] = vec2(34.0, 35.0); + mytask.submesh[2] = mytask.submesh[gid%2]; + + BARRIER(); + + // 3. set task count + gl_TaskCountNV = 3; +} diff --git a/deps/glslang/Test/spv.multiStruct.comp b/deps/glslang/Test/spv.multiStruct.comp new file mode 100644 index 00000000..7462da43 --- /dev/null +++ b/deps/glslang/Test/spv.multiStruct.comp @@ -0,0 +1,48 @@ +#version 450 core + +struct MyStruct +{ + vec2 foo[2]; + bool sb; +}; + +layout(binding = 0, std430) buffer SSBO0 +{ + MyStruct a; +} inBuf; + +layout(binding = 1, std430) buffer SSBO1 +{ + MyStruct b; +} outBuf; + +layout(binding = 2, std140) uniform UBO +{ + MyStruct c; +} uBuf; + +struct Nested { + float f; + MyStruct S[2]; +}; + +layout(binding = 2, std140) uniform UBON +{ + Nested N1; +} uBufN; + +layout(binding = 1, std430) buffer SSBO1N +{ + Nested N2; +} outBufN; + +void main() +{ + MyStruct t = inBuf.a; + outBuf.b = t; + t = uBuf.c; + outBuf.b = t; + + Nested n = uBufN.N1; + outBufN.N2 = n; +} diff --git a/deps/glslang/Test/spv.multiStructFuncall.frag b/deps/glslang/Test/spv.multiStructFuncall.frag new file mode 100644 index 00000000..7f9968dc --- /dev/null +++ b/deps/glslang/Test/spv.multiStructFuncall.frag @@ -0,0 +1,21 @@ +#version 450 + +struct S { mat4 m; }; +buffer blockName { S s1; }; // need an S with decoration +S s2; // no decorations on S + +void fooConst(const in S s) { } +void foo(in S s) { } +void fooOut(inout S s) { } + +void main() +{ + fooConst(s1); + fooConst(s2); + + foo(s1); + foo(s2); + + fooOut(s1); + fooOut(s2); +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.multiView.frag b/deps/glslang/Test/spv.multiView.frag new file mode 100644 index 00000000..47c2763a --- /dev/null +++ b/deps/glslang/Test/spv.multiView.frag @@ -0,0 +1,9 @@ +#version 450 + +#extension GL_EXT_multiview : enable + +out vec4 color; + +void main() { + color = vec4(gl_ViewIndex, 0, 0, 0); +} diff --git a/deps/glslang/Test/spv.multiviewPerViewAttributes.tesc b/deps/glslang/Test/spv.multiviewPerViewAttributes.tesc new file mode 100644 index 00000000..a0dd64df --- /dev/null +++ b/deps/glslang/Test/spv.multiviewPerViewAttributes.tesc @@ -0,0 +1,14 @@ +#version 450 + +#extension GL_NVX_multiview_per_view_attributes :require + +layout(vertices = 4) out; +out gl_PerVertex { + int gl_ViewportMaskPerViewNV[]; + vec4 gl_PositionPerViewNV[]; + } gl_out[]; +void main() +{ + gl_out[gl_InvocationID].gl_ViewportMaskPerViewNV[0] = 1; + gl_out[gl_InvocationID].gl_PositionPerViewNV[0] = gl_in[1].gl_Position; +} diff --git a/deps/glslang/Test/spv.multiviewPerViewAttributes.vert b/deps/glslang/Test/spv.multiviewPerViewAttributes.vert new file mode 100644 index 00000000..dd64a16c --- /dev/null +++ b/deps/glslang/Test/spv.multiviewPerViewAttributes.vert @@ -0,0 +1,10 @@ +#version 450 + +#extension GL_NVX_multiview_per_view_attributes :require + +void main() +{ + gl_ViewportMaskPerViewNV[0] = 1; + gl_PositionPerViewNV[0] = gl_Position; +} + diff --git a/deps/glslang/Test/spv.newTexture.frag b/deps/glslang/Test/spv.newTexture.frag new file mode 100644 index 00000000..6f5f67c0 --- /dev/null +++ b/deps/glslang/Test/spv.newTexture.frag @@ -0,0 +1,72 @@ +#version 430 + +uniform sampler2D s2D; +uniform sampler2DRect sr; +uniform sampler3D s3D; +uniform samplerCube sCube; +uniform samplerCubeShadow sCubeShadow; +uniform samplerCubeArrayShadow sCubeArrayShadow; +uniform sampler2DShadow s2DShadow; +uniform sampler2DArray s2DArray; +uniform sampler2DArrayShadow s2DArrayShadow; + +uniform isampler2D is2D; +uniform isampler3D is3D; +uniform isamplerCube isCube; +uniform isampler2DArray is2DArray; +uniform isampler2DMS is2Dms; + +uniform usampler2D us2D; +uniform usampler3D us3D; +uniform usamplerCube usCube; +uniform usampler2DArray us2DArray; + +in float c1D; +in vec2 c2D; +in vec3 c3D; +in vec4 c4D; + +flat in int ic1D; +flat in ivec2 ic2D; +flat in ivec3 ic3D; +flat in ivec4 ic4D; + +out vec4 FragData; + +void main() +{ + vec4 v = texture(s2D, c2D); + v.y += texture(sCubeArrayShadow, c4D, c1D); + v += textureProj(s3D, c4D); + v += textureLod(s2DArray, c3D, 1.2); + v.y += textureOffset(s2DShadow, c3D, ivec2(3), c1D); + v += texelFetch(s3D, ic3D, ic1D); + v += texelFetchOffset(s2D, ic2D, 4, ivec2(3)); + v += texelFetchOffset(sr, ic2D, ivec2(4)); + v.y += textureLodOffset(s2DShadow, c3D, c1D, ivec2(3)); + v += textureProjLodOffset(s2D, c3D, c1D, ivec2(3)); + v += textureGrad(sCube, c3D, c3D, c3D); + v.x += textureGradOffset(s2DArrayShadow, c4D, c2D, c2D, ivec2(3)); + v += textureProjGrad(s3D, c4D, c3D, c3D); + v += textureProjGradOffset(s2D, c3D, c2D, c2D, ivec2(3)); + + ivec4 iv = texture(is2D, c2D); + v += vec4(iv); + iv = textureProjOffset(is2D, c4D, ivec2(3)); + v += vec4(iv); + iv = textureProjLod(is2D, c3D, c1D); + v += vec4(iv); + iv = textureProjGrad(is2D, c3D, c2D, c2D); + v += vec4(iv); + iv = texture(is3D, c3D, 4.2); + v += vec4(iv); + iv = textureLod(isCube, c3D, c1D); + v += vec4(iv); + iv = texelFetch(is2DArray, ic3D, ic1D); + v += vec4(iv); + + ivec2 iv2 = textureSize(sCubeShadow, 2); + // iv2 += textureSize(is2Dms); + + FragData = v + vec4(iv2, 0.0, 0.0); +} diff --git a/deps/glslang/Test/spv.noBuiltInLoc.vert b/deps/glslang/Test/spv.noBuiltInLoc.vert new file mode 100644 index 00000000..4087ab36 --- /dev/null +++ b/deps/glslang/Test/spv.noBuiltInLoc.vert @@ -0,0 +1,19 @@ +#version 450 core + +layout(location = 0) +in vec4 foo; + +layout(location = 0) +out vec4 bar; + +uniform vec4 uv1; +uniform float uv2; +uniform vec3 uv3; + +layout(binding = 0) uniform atomic_uint a_uint; + +void main() +{ + bar = foo; + gl_Position = foo; +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.noDeadDecorations.vert b/deps/glslang/Test/spv.noDeadDecorations.vert new file mode 100644 index 00000000..88984970 --- /dev/null +++ b/deps/glslang/Test/spv.noDeadDecorations.vert @@ -0,0 +1,13 @@ +#version 310 es +precision mediump float; + +float func(float a) +{ + return -a; + a = a * -1.0; +} + +void main() +{ + gl_Position.x = func(0.0); +} diff --git a/deps/glslang/Test/spv.noLocation.vert b/deps/glslang/Test/spv.noLocation.vert new file mode 100644 index 00000000..43998525 --- /dev/null +++ b/deps/glslang/Test/spv.noLocation.vert @@ -0,0 +1,39 @@ +#version 450 + +layout(location = 1) in vec4 in1; +in vec4 in2; // ERROR +layout(location = 3) in vec4 in3; + +layout(location = 1) out vec4 out1; +out vec4 out2; // ERROR +layout(location = 3) out vec4 out3; + +layout(location = 10) out inb1 { + vec4 a; + vec4 b; +} inbi1; +out inb2 { + layout(location = 12) vec4 a; + layout(location = 13) vec4 b; +} inbi2; +out inb3 { // ERROR + vec4 a; + vec4 b; +} inbi3; + +layout(location = 14) out struct S1 { vec4 a; } s1; +out struct S2 { vec4 a; } s2; // ERROR + +struct SS { int a; }; +out layout(location = 15) SS ss1; +out SS ss2; // ERROR + +out gl_PerVertex { + vec4 gl_Position; + float gl_ClipDistance[2]; +}; + +void main() +{ + gl_ClipDistance[0] = 1.0; +} diff --git a/deps/glslang/Test/spv.noWorkgroup.comp b/deps/glslang/Test/spv.noWorkgroup.comp new file mode 100644 index 00000000..0c77f278 --- /dev/null +++ b/deps/glslang/Test/spv.noWorkgroup.comp @@ -0,0 +1,7 @@ +#version 450 + +layout(local_size_x_id = 18, local_size_y_id=10,local_size_z_id = 19) in; + +void main() +{ +} diff --git a/deps/glslang/Test/spv.nonSquare.vert b/deps/glslang/Test/spv.nonSquare.vert new file mode 100644 index 00000000..9f7125bd --- /dev/null +++ b/deps/glslang/Test/spv.nonSquare.vert @@ -0,0 +1,25 @@ +#version 140 + +in vec3 v3; +in vec4 v4; + +out mat3x2 m32; + +const vec2 cv2 = vec2(10.0, 20.0); +const mat2x4 m24 = mat2x4(3.0); +const mat4x2 m42 = mat4x2(1.0, 2.0, + 3.0, 4.0, + 5.0, 6.0, + 7.0, 8.0); + +void main() +{ + mat2x3 m23; + vec2 a, b; + + a = v3 * m23; + b = m32 * v3; + + gl_Position = vec4(m23 * m32 * v3, m24[1][3]) + + (m24 * m42) * v4 + cv2 * m42 + m24 * cv2 + vec4(cv2[1], cv2.x, m42[2][1], m42[2][0]); +} diff --git a/deps/glslang/Test/spv.nonuniform.frag b/deps/glslang/Test/spv.nonuniform.frag new file mode 100644 index 00000000..d3b05a5a --- /dev/null +++ b/deps/glslang/Test/spv.nonuniform.frag @@ -0,0 +1,55 @@ +#version 450 + +#extension GL_EXT_nonuniform_qualifier : enable + +layout(location=0) nonuniformEXT in vec4 nu_inv4; +nonuniformEXT float nu_gf; +layout(location=1) in nonuniformEXT flat int nu_ii; + +layout(binding=0, input_attachment_index = 0) uniform subpassInput inputAttachmentDyn[]; +layout(binding=1) uniform samplerBuffer uniformTexelBufferDyn[]; +layout(binding=2, r32f) uniform imageBuffer storageTexelBufferDyn[]; +layout(binding=3) uniform uname { float a; } uniformBuffer[]; +layout(binding=4) buffer bname { float b; } storageBuffer[]; +layout(binding=5) uniform sampler2D sampledImage[]; +layout(binding=6, r32f) uniform image2D storageImage[]; +layout(binding=7, input_attachment_index = 1) uniform subpassInput inputAttachment[]; +layout(binding=8) uniform samplerBuffer uniformTexelBuffer[]; +layout(binding=9, r32f) uniform imageBuffer storageTexelBuffer[]; + +nonuniformEXT int foo(nonuniformEXT int nupi, nonuniformEXT out int f) +{ + return nupi; +} + +void main() +{ + nonuniformEXT int nu_li; + int dyn_i; + + int a = foo(nu_li, nu_li); + nu_li = nonuniformEXT(a) + nonuniformEXT(a * 2); + + float b; + b = nu_inv4.x * nu_gf; + b += subpassLoad(inputAttachmentDyn[dyn_i]).x; + b += texelFetch(uniformTexelBufferDyn[dyn_i], 1).x; + b += imageLoad(storageTexelBufferDyn[dyn_i], 1).x; + b += uniformBuffer[nu_ii].a; + b += storageBuffer[nu_ii].b; + b += texture(sampledImage[nu_ii], vec2(0.5)).x; + b += imageLoad(storageImage[nu_ii], ivec2(1)).x; + b += subpassLoad(inputAttachment[nu_ii]).x; + b += texelFetch(uniformTexelBuffer[nu_ii], 1).x; + b += imageLoad(storageTexelBuffer[nu_ii], 1).x; + + nonuniformEXT ivec4 v; + nonuniformEXT mat4 m; + nonuniformEXT struct S { int a; } s; + ivec4 uv; + b += uniformBuffer[v.y].a; + b += uniformBuffer[v[2]].a; + b += uniformBuffer[uv[nu_ii]].a; + b += uniformBuffer[int(m[2].z)].a; + b += uniformBuffer[s.a].a; +} diff --git a/deps/glslang/Test/spv.offsets.frag b/deps/glslang/Test/spv.offsets.frag new file mode 100644 index 00000000..0a1c008c --- /dev/null +++ b/deps/glslang/Test/spv.offsets.frag @@ -0,0 +1,17 @@ +#version 450 + +layout(set = 0, binding = 0, std140) uniform n1 { + layout(offset = 8) int a; + layout(offset = 4) int b; + layout(offset = 0) int c; + layout(offset = 12) int d; +} i1; + +layout(set = 0, binding = 1, std430) buffer n2 { + layout(offset = 32) vec3 e; + vec3 f; + layout(offset = 16) vec3 g; + layout(offset = 0) vec3 h; +} i2; + +void main() {} \ No newline at end of file diff --git a/deps/glslang/Test/spv.paramMemory.frag b/deps/glslang/Test/spv.paramMemory.frag new file mode 100644 index 00000000..79d2fe57 --- /dev/null +++ b/deps/glslang/Test/spv.paramMemory.frag @@ -0,0 +1,30 @@ +#version 310 es + +readonly coherent uniform layout(set = 0, binding = 0, rgba32f) highp image2D image1; +readonly uniform layout(set = 0, binding = 2, rgba16f) highp image2D image2; +writeonly coherent uniform layout(set = 0, binding = 1, rgba32f) highp image2D image3; +writeonly uniform layout(set = 0, binding = 3, rgba16f) highp image2D image4; + +flat in layout(location = 0) highp ivec2 in_coords; +out layout(location = 0) highp vec4 out_color; + +highp vec4 image_load(readonly coherent highp image2D image, highp ivec2 coords) +{ + return imageLoad(image, in_coords); +} + +void image_store(writeonly coherent highp image2D image, highp ivec2 coords, highp vec4 data) +{ + imageStore(image, in_coords, data); +} + +void main() +{ + highp vec4 read1 = image_load(image1, in_coords); + highp vec4 read2 = image_load(image2, in_coords); + + image_store(image3, in_coords, read1*0.5); + image_store(image4, in_coords, read2*2.0); + + out_color = vec4(0.0); +} diff --git a/deps/glslang/Test/spv.perprimitiveNV.frag b/deps/glslang/Test/spv.perprimitiveNV.frag new file mode 100644 index 00000000..56e00f54 --- /dev/null +++ b/deps/glslang/Test/spv.perprimitiveNV.frag @@ -0,0 +1,21 @@ +#version 460 + +#extension GL_NV_mesh_shader: require + +layout(location=0) +in B { + perprimitiveNV float f; +}; + +layout(location=4) +in C { + flat centroid float h; +}; + +layout(location=8) +out float g; + +void main() +{ + g = f + h; +} diff --git a/deps/glslang/Test/spv.precise.tesc b/deps/glslang/Test/spv.precise.tesc new file mode 100644 index 00000000..35de26b8 --- /dev/null +++ b/deps/glslang/Test/spv.precise.tesc @@ -0,0 +1,24 @@ +#version 310 es +#extension GL_EXT_tessellation_shader : require +#extension GL_EXT_gpu_shader5 : require + +layout(vertices = 3) out; + +layout(location = 0) in highp vec2 in_tc_position[]; +layout(location = 1) in highp float in_tc_tessParam[]; + +layout(location = 0) out highp vec2 in_te_position[]; + +precise gl_TessLevelOuter; + +void main (void) +{ + in_te_position[gl_InvocationID] = in_tc_position[gl_InvocationID]; + + gl_TessLevelInner[0] = 5.0; + gl_TessLevelInner[1] = 5.0; + + gl_TessLevelOuter[0] = 1.0 + 59.0 * 0.5 * (in_tc_tessParam[1] + in_tc_tessParam[2]); + gl_TessLevelOuter[1] = 1.0 + 59.0 * 0.5 * (in_tc_tessParam[2] + in_tc_tessParam[0]); + gl_TessLevelOuter[2] = 1.0 + 59.0 * 0.5 * (in_tc_tessParam[0] + in_tc_tessParam[1]); +} diff --git a/deps/glslang/Test/spv.precise.tese b/deps/glslang/Test/spv.precise.tese new file mode 100644 index 00000000..874ea840 --- /dev/null +++ b/deps/glslang/Test/spv.precise.tese @@ -0,0 +1,36 @@ +#version 310 es +#extension GL_EXT_tessellation_shader : require +#extension GL_EXT_gpu_shader5 : require + +layout(triangles, equal_spacing) in; + +layout(location = 0) in highp vec2 in_te_position[]; + +layout(location = 0) out mediump vec4 in_f_color; + +precise gl_Position; + +void main(void) { + highp vec2 pos = gl_TessCoord.x * in_te_position[0] + + gl_TessCoord.y * in_te_position[1] + + gl_TessCoord.z * in_te_position[2]; + + highp float f = + sqrt(3.0 * min(gl_TessCoord.x, min(gl_TessCoord.y, gl_TessCoord.z))) * + 0.5 + + 0.5; + in_f_color = vec4(gl_TessCoord * f, 1.0); + + // Offset the position slightly, based on the parity of the bits in the float + // representation. + // This is done to detect possible small differences in edge vertex positions + // between patches. + uvec2 bits = floatBitsToUint(pos); + uint numBits = 0u; + for (uint i = 0u; i < 32u; i++) + numBits += + ((bits[0] << i) & 1u) + ((bits[1] << i) & 1u); + pos += float(numBits & 1u) * 0.04; + + gl_Position = vec4(pos, 0.0, 1.0); +} diff --git a/deps/glslang/Test/spv.precision.frag b/deps/glslang/Test/spv.precision.frag new file mode 100644 index 00000000..090c1a6a --- /dev/null +++ b/deps/glslang/Test/spv.precision.frag @@ -0,0 +1,60 @@ +#version 310 es +precision mediump float; +in lowp float lowfin; +in mediump float mediumfin; +in highp vec4 highfin; + +highp int uniform_high; +mediump int uniform_medium; +lowp int uniform_low; +bvec2 ub2; + +out mediump vec4 mediumfout; + +highp float global_highp; + +lowp vec2 foo(mediump vec3 mv3) +{ + return highfin.xy; +} + +bool boolfun(bvec2 bv2) +{ + return bv2 == bvec2(false, true); +} + +struct S { + highp float a; + lowp float b; +}; + +in S s; + +void main() +{ + lowp int sum = uniform_medium + uniform_high; + + sum += uniform_high; + sum += uniform_low; + + // test maxing precisions of args to get precision of builtin + lowp float arg1 = 3.2; + mediump float arg2 = 1023908.2; + lowp float d = distance(lowfin, mediumfin); + + global_highp = length(highfin); + + highp vec4 local_highp = vec4(global_highp); + + mediumfout = vec4(sin(d)) + arg2 + local_highp; + + sum += 4 + ((ivec2(uniform_low) * ivec2(uniform_high) + ivec2((/* comma operator */uniform_low, uniform_high)))).x; + + mediumfout += vec4(sum); + + if (boolfun(ub2)) + ++mediumfout; + + mediumfout *= s.a; + mediumfout *= s.b; +} diff --git a/deps/glslang/Test/spv.precisionNonESSamp.frag b/deps/glslang/Test/spv.precisionNonESSamp.frag new file mode 100644 index 00000000..8abf839e --- /dev/null +++ b/deps/glslang/Test/spv.precisionNonESSamp.frag @@ -0,0 +1,24 @@ +#version 450 + +precision lowp sampler2D; +precision lowp int; +precision lowp float; + +uniform lowp sampler2D s; +uniform highp sampler3D t; +layout(rgba32f) uniform lowp image2D i1; +layout(rgba32f) uniform highp image2D i2; + +layout(location = 0) in lowp vec2 v2; +layout(location = 1) in lowp vec3 v3; +layout(location = 3) flat in lowp ivec2 iv2; + +layout(location = 0) out lowp vec4 color; + +void main() +{ + color = texture(s, v2); + color = texture(t, v3); + lowp vec4 vi1 = imageLoad(i1, iv2); + lowp vec4 vi2 = imageLoad(i2, iv2); +} diff --git a/deps/glslang/Test/spv.prepost.frag b/deps/glslang/Test/spv.prepost.frag new file mode 100644 index 00000000..dfd45666 --- /dev/null +++ b/deps/glslang/Test/spv.prepost.frag @@ -0,0 +1,38 @@ +#version 140 + +void main() +{ + struct s { + float y[5]; + } str; + + float t; + int index = 5; // all indexing is 4 + + str.y[4] = 2.0; // 2.0 + t = ++str.y[--index]; // 3.0 + str.y[4] += t; // 6.0 + t = str.y[4]--; // 5.0 (t = 6.0) + str.y[index++] += t; // 11.0 + --str.y[--index]; // 10.0 + + float x = str.y[4]; + ++x; + --x; + x++; + x--; + + // x is 10.0 + + float y = x * ++x; // 10 * 11 + float z = y * x--; // 110 * 11 + + // x is 10.0 + // z is 1210.0 + + vec4 v = vec4(1.0, 2.0, 3.0, 4.0); + v.y = v.z--; // (1,3,2,4) + v.x = --v.w; // (3,3,2,3) + + gl_FragColor = z * v;// (3630.0, 3630.0, 2420.0, 3630.0) +} diff --git a/deps/glslang/Test/spv.pushConstant.vert b/deps/glslang/Test/spv.pushConstant.vert new file mode 100644 index 00000000..b1721bc6 --- /dev/null +++ b/deps/glslang/Test/spv.pushConstant.vert @@ -0,0 +1,17 @@ +#version 400 + +layout(push_constant) uniform Material { + int kind; + float fa[3]; +} matInst; + +out vec4 color; + +void main() +{ + switch (matInst.kind) { + case 1: color = vec4(0.2); break; + case 2: color = vec4(0.5); break; + default: color = vec4(0.0); break; + } +} diff --git a/deps/glslang/Test/spv.pushConstantAnon.vert b/deps/glslang/Test/spv.pushConstantAnon.vert new file mode 100644 index 00000000..c4438b7c --- /dev/null +++ b/deps/glslang/Test/spv.pushConstantAnon.vert @@ -0,0 +1,17 @@ +#version 400 + +layout(push_constant) uniform Material { + int kind; + float fa[3]; +}; + +out vec4 color; + +void main() +{ + switch (kind) { + case 1: color = vec4(0.2); break; + case 2: color = vec4(0.5); break; + default: color = vec4(fa[1]); break; + } +} diff --git a/deps/glslang/Test/spv.qualifiers.vert b/deps/glslang/Test/spv.qualifiers.vert new file mode 100644 index 00000000..96eb17db --- /dev/null +++ b/deps/glslang/Test/spv.qualifiers.vert @@ -0,0 +1,19 @@ +#version 430 core + +in vec4 inV; + +centroid out vec4 outVc; +smooth out vec4 outVs; +flat out vec4 outVf; +noperspective out vec4 outVn; + +centroid noperspective out vec4 outVcn; + +void main() +{ + outVc = inV; + outVs = inV; + outVf = inV; + outVn = inV; + outVcn = inV; +} diff --git a/deps/glslang/Test/spv.queryL.frag b/deps/glslang/Test/spv.queryL.frag new file mode 100644 index 00000000..6f4ad5c8 --- /dev/null +++ b/deps/glslang/Test/spv.queryL.frag @@ -0,0 +1,64 @@ +#version 430 core + +uniform sampler1D samp1D; +uniform isampler2D isamp2D; +uniform usampler2D usamp2D; +uniform isampler3D isamp3D; +uniform usampler3D usamp3D; +uniform samplerCube sampCube; +uniform isamplerCube isampCube; +uniform isampler1DArray isamp1DA; +uniform sampler2DArray samp2DA; +uniform usampler2DArray usamp2DA; +uniform isamplerCubeArray isampCubeA; +uniform usamplerCubeArray usampCubeA; + +uniform sampler1DShadow samp1Ds; +uniform sampler2DShadow samp2Ds; +uniform samplerCubeShadow sampCubes; +uniform sampler1DArrayShadow samp1DAs; +uniform sampler2DArrayShadow samp2DAs; +uniform samplerCubeArrayShadow sampCubeAs; + +uniform samplerBuffer sampBuf; +uniform sampler2DRect sampRect; + +void main() +{ + vec2 lod; + float pf; + vec2 pf2; + vec3 pf3; + + lod = textureQueryLod(samp1D, pf); + lod += textureQueryLod(isamp2D, pf2); + lod += textureQueryLod(usamp3D, pf3); + lod += textureQueryLod(sampCube, pf3); + lod += textureQueryLod(isamp1DA, pf); + lod += textureQueryLod(usamp2DA, pf2); + lod += textureQueryLod(isampCubeA, pf3); + + lod += textureQueryLod(samp1Ds, pf); + lod += textureQueryLod(samp2Ds, pf2); + lod += textureQueryLod(sampCubes, pf3); + lod += textureQueryLod(samp1DAs, pf); + lod += textureQueryLod(samp2DAs, pf2); + lod += textureQueryLod(sampCubeAs, pf3); + + int levels; + + levels = textureQueryLevels(samp1D); + levels += textureQueryLevels(usamp2D); + levels += textureQueryLevels(isamp3D); + levels += textureQueryLevels(isampCube); + levels += textureQueryLevels(isamp1DA); + levels += textureQueryLevels(samp2DA); + levels += textureQueryLevels(usampCubeA); + + levels = textureQueryLevels(samp1Ds); + levels += textureQueryLevels(samp2Ds); + levels += textureQueryLevels(sampCubes); + levels += textureQueryLevels(samp1DAs); + levels += textureQueryLevels(samp2DAs); + levels += textureQueryLevels(sampCubeAs); +} diff --git a/deps/glslang/Test/spv.rankShift.comp b/deps/glslang/Test/spv.rankShift.comp new file mode 100644 index 00000000..1761ad1f --- /dev/null +++ b/deps/glslang/Test/spv.rankShift.comp @@ -0,0 +1,15 @@ +#version 450 +#extension GL_ARB_gpu_shader_int64 : require + +layout(local_size_x = 54) in; + +layout(location=4) uniform int64_t arg0; +layout(location=5) uniform uint arg1; + +void main() +{ + uint64_t result = arg0 << arg1; + result = arg0 >> arg1; + result <<= arg1; + result >>= arg1; +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.register.autoassign-2.frag b/deps/glslang/Test/spv.register.autoassign-2.frag new file mode 100644 index 00000000..05c49250 --- /dev/null +++ b/deps/glslang/Test/spv.register.autoassign-2.frag @@ -0,0 +1,15 @@ + +SamplerState g_tSamp : register(s0); + +Texture2D g_tScene[2] : register(t0); + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +void main(out PS_OUTPUT psout) +{ + psout.Color = g_tScene[0].Sample(g_tSamp, float2(0.3,0.4)) + + g_tScene[1].Sample(g_tSamp, float2(0.3,0.4)); +} diff --git a/deps/glslang/Test/spv.register.autoassign.frag b/deps/glslang/Test/spv.register.autoassign.frag new file mode 100644 index 00000000..0d6f0b2d --- /dev/null +++ b/deps/glslang/Test/spv.register.autoassign.frag @@ -0,0 +1,71 @@ + +SamplerState g_sSamp1 : register(s0); +SamplerState g_sSamp2; +SamplerState g_sSamp3[2] : register(s2); +SamplerState g_sSamp4[3]; +SamplerState g_sSamp5; + +SamplerState g_sSamp_unused1; +SamplerState g_sSamp_unused2; + +Texture1D g_tTex1 : register(t1); +const uniform Texture1D g_tTex2; +Texture1D g_tTex3[2] : register(t3); +Texture1D g_tTex4[3]; +Texture1D g_tTex5; + +Texture1D g_tTex_unused1 : register(t0); +Texture1D g_tTex_unused2 : register(t2); +Texture1D g_tTex_unused3; + +struct MyStruct_t { + int a; + float b; + float3 c; +}; + +uniform MyStruct_t mystruct : register(b4); + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +uniform float4 myfloat4_a; +uniform float4 myfloat4_b; +uniform int4 myint4_a; + +float4 Func1() +{ + return + g_tTex1 . Sample(g_sSamp1, 0.1) + + g_tTex2 . Sample(g_sSamp2, 0.2) + + g_tTex3[0] . Sample(g_sSamp3[0], 0.3) + + g_tTex3[1] . Sample(g_sSamp3[1], 0.3) + + g_tTex4[1] . Sample(g_sSamp4[1], 0.4) + + g_tTex4[2] . Sample(g_sSamp4[2], 0.4) + + g_tTex5 . Sample(g_sSamp5, 0.5) + + mystruct.c[1]; +} + +float4 Func2() +{ + return + g_tTex1 . Sample(g_sSamp1, 0.1) + + g_tTex3[1] . Sample(g_sSamp3[1], 0.3); +} + +// Not called from entry point: +float4 Func2_unused() +{ + return + g_tTex_unused1 . Sample(g_sSamp_unused1, 1.1) + + g_tTex_unused2 . Sample(g_sSamp_unused2, 1.2); +} + +PS_OUTPUT main_ep() +{ + PS_OUTPUT psout; + psout.Color = Func1() + Func2(); + return psout; +} diff --git a/deps/glslang/Test/spv.register.autoassign.rangetest.frag b/deps/glslang/Test/spv.register.autoassign.rangetest.frag new file mode 100644 index 00000000..314c8e96 --- /dev/null +++ b/deps/glslang/Test/spv.register.autoassign.rangetest.frag @@ -0,0 +1,15 @@ + +SamplerState g_tSamp : register(s5); + +Texture2D g_tScene[2] : register(t5); + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +void main(out PS_OUTPUT psout) +{ + psout.Color = g_tScene[0].Sample(g_tSamp, float2(0.3, 0.3)) + + g_tScene[1].Sample(g_tSamp, float2(0.3, 0.3)); +} diff --git a/deps/glslang/Test/spv.register.noautoassign.frag b/deps/glslang/Test/spv.register.noautoassign.frag new file mode 100644 index 00000000..0d6f0b2d --- /dev/null +++ b/deps/glslang/Test/spv.register.noautoassign.frag @@ -0,0 +1,71 @@ + +SamplerState g_sSamp1 : register(s0); +SamplerState g_sSamp2; +SamplerState g_sSamp3[2] : register(s2); +SamplerState g_sSamp4[3]; +SamplerState g_sSamp5; + +SamplerState g_sSamp_unused1; +SamplerState g_sSamp_unused2; + +Texture1D g_tTex1 : register(t1); +const uniform Texture1D g_tTex2; +Texture1D g_tTex3[2] : register(t3); +Texture1D g_tTex4[3]; +Texture1D g_tTex5; + +Texture1D g_tTex_unused1 : register(t0); +Texture1D g_tTex_unused2 : register(t2); +Texture1D g_tTex_unused3; + +struct MyStruct_t { + int a; + float b; + float3 c; +}; + +uniform MyStruct_t mystruct : register(b4); + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +uniform float4 myfloat4_a; +uniform float4 myfloat4_b; +uniform int4 myint4_a; + +float4 Func1() +{ + return + g_tTex1 . Sample(g_sSamp1, 0.1) + + g_tTex2 . Sample(g_sSamp2, 0.2) + + g_tTex3[0] . Sample(g_sSamp3[0], 0.3) + + g_tTex3[1] . Sample(g_sSamp3[1], 0.3) + + g_tTex4[1] . Sample(g_sSamp4[1], 0.4) + + g_tTex4[2] . Sample(g_sSamp4[2], 0.4) + + g_tTex5 . Sample(g_sSamp5, 0.5) + + mystruct.c[1]; +} + +float4 Func2() +{ + return + g_tTex1 . Sample(g_sSamp1, 0.1) + + g_tTex3[1] . Sample(g_sSamp3[1], 0.3); +} + +// Not called from entry point: +float4 Func2_unused() +{ + return + g_tTex_unused1 . Sample(g_sSamp_unused1, 1.1) + + g_tTex_unused2 . Sample(g_sSamp_unused2, 1.2); +} + +PS_OUTPUT main_ep() +{ + PS_OUTPUT psout; + psout.Color = Func1() + Func2(); + return psout; +} diff --git a/deps/glslang/Test/spv.register.subpass.frag b/deps/glslang/Test/spv.register.subpass.frag new file mode 100644 index 00000000..281c2f70 --- /dev/null +++ b/deps/glslang/Test/spv.register.subpass.frag @@ -0,0 +1,15 @@ + +// Test binding autoassignment and offset for SubpassInput objects + +layout(input_attachment_index = 1) SubpassInput subpass_f4 : register(t1); +layout(input_attachment_index = 4) SubpassInputMS subpass_ms_f4; +[[vk::input_attachment_index(7)]] SubpassInput subpass_2; + +float4 main() : SV_Target0 +{ + float4 result00 = subpass_f4.SubpassLoad(); + float4 result10 = subpass_ms_f4.SubpassLoad(3); + float4 result73 = subpass_2.SubpassLoad(); + + return 0; +} diff --git a/deps/glslang/Test/spv.rw.autoassign.frag b/deps/glslang/Test/spv.rw.autoassign.frag new file mode 100644 index 00000000..5c7d0d3f --- /dev/null +++ b/deps/glslang/Test/spv.rw.autoassign.frag @@ -0,0 +1,18 @@ + +RWTexture1D g_tTex1df1; +RWBuffer g_tBuf1du1; + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; +}; + +PS_OUTPUT main() +{ + float r00 = g_tTex1df1[0]; + uint r01 = g_tBuf1du1[0]; + + PS_OUTPUT psout; + psout.Color = 0; + return psout; +} diff --git a/deps/glslang/Test/spv.sample.frag b/deps/glslang/Test/spv.sample.frag new file mode 100644 index 00000000..b62afe27 --- /dev/null +++ b/deps/glslang/Test/spv.sample.frag @@ -0,0 +1,9 @@ +#version 450 + +layout(location = 0) in sample vec4 samp; +layout(location = 0) out vec4 color; + +void main() +{ + color = samp; +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.sampleId.frag b/deps/glslang/Test/spv.sampleId.frag new file mode 100644 index 00000000..d5473f79 --- /dev/null +++ b/deps/glslang/Test/spv.sampleId.frag @@ -0,0 +1,12 @@ +#version 450 + +layout(location = 0) in vec4 samp; +layout(location = 0) out vec4 color; + +void main() +{ + if (gl_SampleID < 3) + color = samp; + else + color = 2 * samp; +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.sampleMaskOverrideCoverage.frag b/deps/glslang/Test/spv.sampleMaskOverrideCoverage.frag new file mode 100644 index 00000000..dd840621 --- /dev/null +++ b/deps/glslang/Test/spv.sampleMaskOverrideCoverage.frag @@ -0,0 +1,7 @@ +#version 450 +#extension GL_NV_sample_mask_override_coverage : enable +in vec4 color; +layout(override_coverage) out int gl_SampleMask[]; +void main() { + gl_SampleMask[0] = int(0xFFFFFFFF); +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.samplePosition.frag b/deps/glslang/Test/spv.samplePosition.frag new file mode 100644 index 00000000..b73dd61f --- /dev/null +++ b/deps/glslang/Test/spv.samplePosition.frag @@ -0,0 +1,12 @@ +#version 450 + +layout(location = 0) in vec4 samp; +layout(location = 0) out vec4 color; + +void main() +{ + if (gl_SamplePosition.y < 0.5) + color = samp; + else + color = 2 * samp; +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.samplerlessTextureFunctions.frag b/deps/glslang/Test/spv.samplerlessTextureFunctions.frag new file mode 100644 index 00000000..3043b39d --- /dev/null +++ b/deps/glslang/Test/spv.samplerlessTextureFunctions.frag @@ -0,0 +1,23 @@ +#version 450 core +#extension GL_EXT_samplerless_texture_functions : enable + +layout(binding = 1) uniform texture2D tex2D; +layout(binding = 1) uniform texture2DMS texMS; +layout(binding = 0) uniform textureBuffer buf; + +void main() +{ + vec4 tex2DFetch = texelFetch(tex2D, ivec2(0, 0), 0); + vec4 texMSFetch = texelFetch(texMS, ivec2(0, 0), 0); + vec4 bufFetch = texelFetch(buf, 0); + + vec4 tex2DFetchOffset = texelFetchOffset(tex2D, ivec2(0, 0), 0, ivec2(0, 0)); + + ivec2 tex2DSize = textureSize(tex2D, 0); + ivec2 texMSSize = textureSize(texMS); + int bufSize = textureSize(buf); + + int tex2DLevels = textureQueryLevels(tex2D); + + int texMSSamples = textureSamples(texMS); +} diff --git a/deps/glslang/Test/spv.separate.frag b/deps/glslang/Test/spv.separate.frag new file mode 100644 index 00000000..21e5db33 --- /dev/null +++ b/deps/glslang/Test/spv.separate.frag @@ -0,0 +1,95 @@ +#version 400 + +uniform sampler s; +uniform samplerShadow sShadow; +uniform sampler sA[4]; +uniform texture2D t2d; +uniform texture3D t3d[4]; +flat in int i; + +out vec4 color; + +void main() +{ + color = texture(sampler2D(t2d, s), vec2(0.5)); + color += texture(sampler3D(t3d[i], sA[2]), vec3(0.5)); + color += texture(sampler2D(t2d, s), vec2(0.5)); +} + +uniform texture2D tex2D; +uniform textureCube texCube; +uniform textureCubeArray texCubeArray; +uniform itextureCubeArray itexCubeArray; +uniform utextureCubeArray utexCubeArray; +uniform itexture1DArray itex1DArray; +uniform utexture1D utex1D; +uniform itexture1D itex1D; +uniform utexture1DArray utex1DArray; +uniform textureBuffer texBuffer; +uniform texture2DArray tex2DArray; +uniform itexture2D itex2D; +uniform itexture3D itex3D; +uniform itextureCube itexCube; +uniform itexture2DArray itex2DArray; +uniform utexture2D utex2D; +uniform utexture3D utex3D; +uniform utextureCube utexCube; +uniform utexture2DArray utex2DArray; +uniform itexture2DRect itex2DRect; +uniform utexture2DRect utex2DRect; +uniform itextureBuffer itexBuffer; +uniform utextureBuffer utexBuffer; +uniform texture2DMS tex2DMS; +uniform itexture2DMS itex2DMS; +uniform utexture2DMS utex2DMS; +uniform texture2DMSArray tex2DMSArray; +uniform itexture2DMSArray itex2DMSArray; +uniform utexture2DMSArray utex2DMSArray; +uniform texture1D tex1D; +uniform texture3D tex3D; +uniform texture2DRect tex2DRect; +uniform texture1DArray tex1DArray; + +void foo() +{ + sampler2D (tex2D, s); + samplerCube (texCube, s); + samplerCubeArray (texCubeArray, s); + samplerCubeArrayShadow (texCubeArray, sShadow); + isamplerCubeArray (itexCubeArray, s); + usamplerCubeArray (utexCubeArray, s); + sampler1DArrayShadow (tex1DArray, sShadow); + isampler1DArray (itex1DArray, s); + usampler1D (utex1D, s); + isampler1D (itex1D, s); + usampler1DArray (utex1DArray, s); + samplerBuffer (texBuffer, s); + samplerCubeShadow (texCube, sShadow); + sampler2DArray (tex2DArray, s); + sampler2DArrayShadow (tex2DArray, sShadow); + isampler2D (itex2D, s); + isampler3D (itex3D, s); + isamplerCube (itexCube, s); + isampler2DArray (itex2DArray, s); + usampler2D (utex2D, s); + usampler3D (utex3D, s); + usamplerCube (utexCube, s); + usampler2DArray (utex2DArray, s); + isampler2DRect (itex2DRect, s); + usampler2DRect (utex2DRect, s); + isamplerBuffer (itexBuffer, s); + usamplerBuffer (utexBuffer, s); + sampler2DMS (tex2DMS, s); + isampler2DMS (itex2DMS, s); + usampler2DMS (utex2DMS, s); + sampler2DMSArray (tex2DMSArray, s); + isampler2DMSArray (itex2DMSArray, s); + usampler2DMSArray (utex2DMSArray, s); + sampler1D (tex1D, s); + sampler1DShadow (tex1D, sShadow); + sampler3D (tex3D, s); + sampler2DShadow (tex2D, sShadow); + sampler2DRect (tex2DRect, s); + sampler2DRectShadow (tex2DRect, sShadow); + sampler1DArray (tex1DArray, s); +} diff --git a/deps/glslang/Test/spv.set.vert b/deps/glslang/Test/spv.set.vert new file mode 100644 index 00000000..d211ef11 --- /dev/null +++ b/deps/glslang/Test/spv.set.vert @@ -0,0 +1,14 @@ +#version 450 + +layout(set = 4, binding = 7) uniform sampler2D samp2D; + +layout(set = 0, binding = 8) buffer setBuf { + vec4 color; +} setBufInst; + +out vec4 color; + +void main() +{ + color = setBufInst.color; +} diff --git a/deps/glslang/Test/spv.shaderBallot.comp b/deps/glslang/Test/spv.shaderBallot.comp new file mode 100644 index 00000000..20059b1c --- /dev/null +++ b/deps/glslang/Test/spv.shaderBallot.comp @@ -0,0 +1,59 @@ +#version 450 + +#extension GL_ARB_gpu_shader_int64: enable +#extension GL_ARB_shader_ballot: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubGroupInvocationARB + gl_SubGroupSizeARB) % 4; + + uint64_t relMask = gl_SubGroupEqMaskARB + + gl_SubGroupGeMaskARB + + gl_SubGroupGtMaskARB + + gl_SubGroupLeMaskARB + + gl_SubGroupLtMaskARB; + + if (relMask == ballotARB(true)) + { + data[invocation].f4.x = readInvocationARB(data[0].f4.x, invocation); + data[invocation].f4.xy = readInvocationARB(data[1].f4.xy, invocation); + data[invocation].f4.xyz = readInvocationARB(data[2].f4.xyz, invocation); + data[invocation].f4 = readInvocationARB(data[3].f4, invocation); + + data[invocation].i4.x = readInvocationARB(data[0].i4.x, invocation); + data[invocation].i4.xy = readInvocationARB(data[1].i4.xy, invocation); + data[invocation].i4.xyz = readInvocationARB(data[2].i4.xyz, invocation); + data[invocation].i4 = readInvocationARB(data[3].i4, invocation); + + data[invocation].u4.x = readInvocationARB(data[0].u4.x, invocation); + data[invocation].u4.xy = readInvocationARB(data[1].u4.xy, invocation); + data[invocation].u4.xyz = readInvocationARB(data[2].u4.xyz, invocation); + data[invocation].u4 = readInvocationARB(data[3].u4, invocation); + } + else + { + data[invocation].f4.x = readFirstInvocationARB(data[0].f4.x); + data[invocation].f4.xy = readFirstInvocationARB(data[1].f4.xy); + data[invocation].f4.xyz = readFirstInvocationARB(data[2].f4.xyz); + data[invocation].f4 = readFirstInvocationARB(data[3].f4); + + data[invocation].i4.x = readFirstInvocationARB(data[0].i4.x); + data[invocation].i4.xy = readFirstInvocationARB(data[1].i4.xy); + data[invocation].i4.xyz = readFirstInvocationARB(data[2].i4.xyz); + data[invocation].i4 = readFirstInvocationARB(data[3].i4); + + data[invocation].u4.x = readFirstInvocationARB(data[0].u4.x); + data[invocation].u4.xy = readFirstInvocationARB(data[1].u4.xy); + data[invocation].u4.xyz = readFirstInvocationARB(data[2].u4.xyz); + data[invocation].u4 = readFirstInvocationARB(data[3].u4); + } +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.shaderBallotAMD.comp b/deps/glslang/Test/spv.shaderBallotAMD.comp new file mode 100644 index 00000000..9cf9546e --- /dev/null +++ b/deps/glslang/Test/spv.shaderBallotAMD.comp @@ -0,0 +1,204 @@ +#version 450 + +#extension GL_ARB_gpu_shader_int64: enable +#extension GL_AMD_gpu_shader_half_float: enable +#extension GL_AMD_gpu_shader_int16: enable +#extension GL_AMD_shader_ballot: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + int i; + uvec2 uv; + vec3 fv; + dvec4 dv; + int64_t i64; + u64vec2 u64v; + f16vec3 f16v; + i16vec4 i16v; + uint16_t u16; +}; + +void main() +{ + i = minInvocationsAMD(i); + uv = minInvocationsAMD(uv); + fv = minInvocationsAMD(fv); + dv = minInvocationsAMD(dv); + i64 = minInvocationsAMD(i64); + u64v = minInvocationsAMD(u64v); + f16v = minInvocationsAMD(f16v); + i16v = minInvocationsAMD(i16v); + u16 = minInvocationsAMD(u16); + + i = maxInvocationsAMD(i); + uv = maxInvocationsAMD(uv); + fv = maxInvocationsAMD(fv); + dv = maxInvocationsAMD(dv); + i64 = maxInvocationsAMD(i64); + u64v = maxInvocationsAMD(u64v); + f16v = maxInvocationsAMD(f16v); + i16v = maxInvocationsAMD(i16v); + u16 = maxInvocationsAMD(u16); + + i = addInvocationsAMD(i); + uv = addInvocationsAMD(uv); + fv = addInvocationsAMD(fv); + dv = addInvocationsAMD(dv); + i64 = addInvocationsAMD(i64); + u64v = addInvocationsAMD(u64v); + f16v = addInvocationsAMD(f16v); + i16v = addInvocationsAMD(i16v); + u16 = addInvocationsAMD(u16); + + i = minInvocationsNonUniformAMD(i); + uv = minInvocationsNonUniformAMD(uv); + fv = minInvocationsNonUniformAMD(fv); + dv = minInvocationsNonUniformAMD(dv); + i64 = minInvocationsNonUniformAMD(i64); + u64v = minInvocationsNonUniformAMD(u64v); + f16v = minInvocationsNonUniformAMD(f16v); + i16v = minInvocationsNonUniformAMD(i16v); + u16 = minInvocationsNonUniformAMD(u16); + + i = maxInvocationsNonUniformAMD(i); + uv = maxInvocationsNonUniformAMD(uv); + fv = maxInvocationsNonUniformAMD(fv); + dv = maxInvocationsNonUniformAMD(dv); + i64 = maxInvocationsNonUniformAMD(i64); + u64v = maxInvocationsNonUniformAMD(u64v); + f16v = maxInvocationsNonUniformAMD(f16v); + i16v = maxInvocationsNonUniformAMD(i16v); + u16 = maxInvocationsNonUniformAMD(u16); + + i = addInvocationsNonUniformAMD(i); + uv = addInvocationsNonUniformAMD(uv); + fv = addInvocationsNonUniformAMD(fv); + dv = addInvocationsNonUniformAMD(dv); + i64 = addInvocationsNonUniformAMD(i64); + u64v = addInvocationsNonUniformAMD(u64v); + f16v = addInvocationsNonUniformAMD(f16v); + i16v = addInvocationsNonUniformAMD(i16v); + u16 = addInvocationsNonUniformAMD(u16); + + i = minInvocationsInclusiveScanAMD(i); + uv = minInvocationsInclusiveScanAMD(uv); + fv = minInvocationsInclusiveScanAMD(fv); + dv = minInvocationsInclusiveScanAMD(dv); + i64 = minInvocationsInclusiveScanAMD(i64); + u64v = minInvocationsInclusiveScanAMD(u64v); + f16v = minInvocationsInclusiveScanAMD(f16v); + i16v = minInvocationsInclusiveScanAMD(i16v); + u16 = minInvocationsInclusiveScanAMD(u16); + + i = maxInvocationsInclusiveScanAMD(i); + uv = maxInvocationsInclusiveScanAMD(uv); + fv = maxInvocationsInclusiveScanAMD(fv); + dv = maxInvocationsInclusiveScanAMD(dv); + i64 = maxInvocationsInclusiveScanAMD(i64); + u64v = maxInvocationsInclusiveScanAMD(u64v); + f16v = maxInvocationsInclusiveScanAMD(f16v); + i16v = maxInvocationsInclusiveScanAMD(i16v); + u16 = maxInvocationsInclusiveScanAMD(u16); + + i = addInvocationsInclusiveScanAMD(i); + uv = addInvocationsInclusiveScanAMD(uv); + fv = addInvocationsInclusiveScanAMD(fv); + dv = addInvocationsInclusiveScanAMD(dv); + i64 = addInvocationsInclusiveScanAMD(i64); + u64v = addInvocationsInclusiveScanAMD(u64v); + f16v = addInvocationsInclusiveScanAMD(f16v); + i16v = addInvocationsInclusiveScanAMD(i16v); + u16 = addInvocationsInclusiveScanAMD(u16); + + i = minInvocationsExclusiveScanAMD(i); + uv = minInvocationsExclusiveScanAMD(uv); + fv = minInvocationsExclusiveScanAMD(fv); + dv = minInvocationsExclusiveScanAMD(dv); + i64 = minInvocationsExclusiveScanAMD(i64); + u64v = minInvocationsExclusiveScanAMD(u64v); + f16v = minInvocationsExclusiveScanAMD(f16v); + i16v = minInvocationsExclusiveScanAMD(i16v); + u16 = minInvocationsExclusiveScanAMD(u16); + + i = maxInvocationsExclusiveScanAMD(i); + uv = maxInvocationsExclusiveScanAMD(uv); + fv = maxInvocationsExclusiveScanAMD(fv); + dv = maxInvocationsExclusiveScanAMD(dv); + i64 = maxInvocationsExclusiveScanAMD(i64); + u64v = maxInvocationsExclusiveScanAMD(u64v); + f16v = maxInvocationsExclusiveScanAMD(f16v); + i16v = maxInvocationsExclusiveScanAMD(i16v); + u16 = maxInvocationsExclusiveScanAMD(u16); + + i = addInvocationsExclusiveScanAMD(i); + uv = addInvocationsExclusiveScanAMD(uv); + fv = addInvocationsExclusiveScanAMD(fv); + dv = addInvocationsExclusiveScanAMD(dv); + i64 = addInvocationsExclusiveScanAMD(i64); + u64v = addInvocationsExclusiveScanAMD(u64v); + f16v = addInvocationsExclusiveScanAMD(f16v); + i16v = addInvocationsExclusiveScanAMD(i16v); + u16 = addInvocationsExclusiveScanAMD(u16); + + i = minInvocationsInclusiveScanNonUniformAMD(i); + uv = minInvocationsInclusiveScanNonUniformAMD(uv); + fv = minInvocationsInclusiveScanNonUniformAMD(fv); + dv = minInvocationsInclusiveScanNonUniformAMD(dv); + i64 = minInvocationsInclusiveScanNonUniformAMD(i64); + u64v = minInvocationsInclusiveScanNonUniformAMD(u64v); + f16v = minInvocationsInclusiveScanNonUniformAMD(f16v); + i16v = minInvocationsInclusiveScanNonUniformAMD(i16v); + u16 = minInvocationsInclusiveScanNonUniformAMD(u16); + + i = maxInvocationsInclusiveScanNonUniformAMD(i); + uv = maxInvocationsInclusiveScanNonUniformAMD(uv); + fv = maxInvocationsInclusiveScanNonUniformAMD(fv); + dv = maxInvocationsInclusiveScanNonUniformAMD(dv); + i64 = maxInvocationsInclusiveScanNonUniformAMD(i64); + u64v = maxInvocationsInclusiveScanNonUniformAMD(u64v); + f16v = maxInvocationsInclusiveScanNonUniformAMD(f16v); + i16v = maxInvocationsInclusiveScanNonUniformAMD(i16v); + u16 = maxInvocationsInclusiveScanNonUniformAMD(u16); + + i = addInvocationsInclusiveScanNonUniformAMD(i); + uv = addInvocationsInclusiveScanNonUniformAMD(uv); + fv = addInvocationsInclusiveScanNonUniformAMD(fv); + dv = addInvocationsInclusiveScanNonUniformAMD(dv); + i64 = addInvocationsInclusiveScanNonUniformAMD(i64); + u64v = addInvocationsInclusiveScanNonUniformAMD(u64v); + f16v = addInvocationsInclusiveScanNonUniformAMD(f16v); + i16v = addInvocationsInclusiveScanNonUniformAMD(i16v); + u16 = addInvocationsInclusiveScanNonUniformAMD(u16); + + i = minInvocationsExclusiveScanNonUniformAMD(i); + uv = minInvocationsExclusiveScanNonUniformAMD(uv); + fv = minInvocationsExclusiveScanNonUniformAMD(fv); + dv = minInvocationsExclusiveScanNonUniformAMD(dv); + i64 = minInvocationsExclusiveScanNonUniformAMD(i64); + u64v = minInvocationsExclusiveScanNonUniformAMD(u64v); + f16v = minInvocationsExclusiveScanNonUniformAMD(f16v); + i16v = minInvocationsExclusiveScanNonUniformAMD(i16v); + u16 = minInvocationsExclusiveScanNonUniformAMD(u16); + + i = maxInvocationsExclusiveScanNonUniformAMD(i); + uv = maxInvocationsExclusiveScanNonUniformAMD(uv); + fv = maxInvocationsExclusiveScanNonUniformAMD(fv); + dv = maxInvocationsExclusiveScanNonUniformAMD(dv); + i64 = maxInvocationsExclusiveScanNonUniformAMD(i64); + u64v = maxInvocationsExclusiveScanNonUniformAMD(u64v); + f16v = maxInvocationsExclusiveScanNonUniformAMD(f16v); + i16v = maxInvocationsExclusiveScanNonUniformAMD(i16v); + u16 = maxInvocationsExclusiveScanNonUniformAMD(u16); + + i = addInvocationsExclusiveScanNonUniformAMD(i); + uv = addInvocationsExclusiveScanNonUniformAMD(uv); + fv = addInvocationsExclusiveScanNonUniformAMD(fv); + dv = addInvocationsExclusiveScanNonUniformAMD(dv); + i64 = addInvocationsExclusiveScanNonUniformAMD(i64); + u64v = addInvocationsExclusiveScanNonUniformAMD(u64v); + f16v = addInvocationsExclusiveScanNonUniformAMD(f16v); + i16v = addInvocationsExclusiveScanNonUniformAMD(i16v); + u16 = addInvocationsExclusiveScanNonUniformAMD(u16); +} diff --git a/deps/glslang/Test/spv.shaderDrawParams.vert b/deps/glslang/Test/spv.shaderDrawParams.vert new file mode 100644 index 00000000..15ae2953 --- /dev/null +++ b/deps/glslang/Test/spv.shaderDrawParams.vert @@ -0,0 +1,16 @@ +#version 450 core + +#extension GL_ARB_shader_draw_parameters: enable + +layout(binding = 0) uniform Block +{ + vec4 pos[2][4]; +} block; + +void main() +{ + if ((gl_BaseVertexARB > 0) || (gl_BaseInstanceARB > 0)) + gl_Position = block.pos[0][gl_DrawIDARB % 4]; + else + gl_Position = block.pos[1][gl_DrawIDARB % 4]; +} diff --git a/deps/glslang/Test/spv.shaderFragMaskAMD.frag b/deps/glslang/Test/spv.shaderFragMaskAMD.frag new file mode 100644 index 00000000..b9e8ab05 --- /dev/null +++ b/deps/glslang/Test/spv.shaderFragMaskAMD.frag @@ -0,0 +1,29 @@ +#version 450 core + +#extension GL_AMD_shader_fragment_mask: enable + +layout(binding = 0) uniform sampler2DMS s2DMS; +layout(binding = 1) uniform isampler2DMSArray is2DMSArray; + +layout(binding = 2, input_attachment_index = 0) uniform usubpassInputMS usubpassMS; + +layout(location = 0) out vec4 fragColor; + +void main() +{ + vec4 f4 = vec4(0.0); + + uint fragMask = fragmentMaskFetchAMD(s2DMS, ivec2(2, 3)); + uint fragIndex = (fragMask & 0xF0) >> 4; + f4 += fragmentFetchAMD(s2DMS, ivec2(2, 3), 1); + + fragMask = fragmentMaskFetchAMD(is2DMSArray, ivec3(2, 3, 1)); + fragIndex = (fragMask & 0xF0) >> 4; + f4 += fragmentFetchAMD(is2DMSArray, ivec3(2, 3, 1), fragIndex); + + fragMask = fragmentMaskFetchAMD(usubpassMS); + fragIndex = (fragMask & 0xF0) >> 4; + f4 += fragmentFetchAMD(usubpassMS, fragIndex); + + fragColor = f4; +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.shaderGroupVote.comp b/deps/glslang/Test/spv.shaderGroupVote.comp new file mode 100644 index 00000000..c0b1fe72 --- /dev/null +++ b/deps/glslang/Test/spv.shaderGroupVote.comp @@ -0,0 +1,21 @@ +#version 450 + +#extension GL_ARB_shader_group_vote : enable + +layout(local_size_x = 4, local_size_y = 4) in; + +layout(std430, binding = 0) buffer Buffers +{ + bool b; +}; + +void main() +{ + bool b1 = b; + + b1 = anyInvocationARB(b1); + b1 = allInvocationsARB(b1); + b1 = allInvocationsEqualARB(b1); + + b = b1; +} diff --git a/deps/glslang/Test/spv.shaderImageFootprint.frag b/deps/glslang/Test/spv.shaderImageFootprint.frag new file mode 100644 index 00000000..efde3704 --- /dev/null +++ b/deps/glslang/Test/spv.shaderImageFootprint.frag @@ -0,0 +1,123 @@ +#version 450 + +#extension GL_NV_shader_texture_footprint : require + + +layout (location = 0) in vec2 P2; +layout (location = 2) in vec3 P3; +layout (location = 3) in flat int granularity; +layout (location = 4) in float lodClamp; +layout (location = 5) in float lod; +layout (location = 6) in vec2 dx; +layout (location = 8) in vec2 dy; +layout (location = 9) in float bias; + +uniform sampler2D sample2D; +uniform sampler3D sample3D; + +buffer result2D { + bool ret2D; + uvec2 anchor2D; + uvec2 offset2D; + uvec2 mask2D; + uint lod2D; + uint granularity2D; +}; + +buffer result3D { + bool ret3D; + uvec3 anchor3D; + uvec3 offset3D; + uvec2 mask3D; + uint lod3D; + uint granularity3D; +}; + +void main() { + gl_TextureFootprint2DNV fp2D; + gl_TextureFootprint3DNV fp3D; + + ret2D = textureFootprintNV(sample2D, P2, granularity, true, fp2D); + anchor2D = fp2D.anchor; + offset2D = fp2D.offset; + mask2D = fp2D.mask; + lod2D = fp2D.lod; + granularity2D = fp2D.granularity; + + ret2D = textureFootprintNV(sample2D, P2, granularity, true, fp2D, bias); + anchor2D += fp2D.anchor; + offset2D += fp2D.offset; + mask2D += fp2D.mask; + lod2D += fp2D.lod; + granularity2D += fp2D.granularity; + + ret2D = textureFootprintClampNV(sample2D, P2, lodClamp, granularity, true, fp2D); + anchor2D += fp2D.anchor; + offset2D += fp2D.offset; + mask2D += fp2D.mask; + lod2D += fp2D.lod; + granularity2D += fp2D.granularity; + + ret2D = textureFootprintClampNV(sample2D, P2, lodClamp, granularity, true, fp2D, bias); + anchor2D += fp2D.anchor; + offset2D += fp2D.offset; + mask2D += fp2D.mask; + lod2D += fp2D.lod; + granularity2D += fp2D.granularity; + + ret2D = textureFootprintLodNV(sample2D, P2, lod, granularity, true, fp2D); + anchor2D += fp2D.anchor; + offset2D += fp2D.offset; + mask2D += fp2D.mask; + lod2D += fp2D.lod; + granularity2D += fp2D.granularity; + + ret2D = textureFootprintGradNV(sample2D, P2, dx, dy, granularity, true, fp2D); + anchor2D += fp2D.anchor; + offset2D += fp2D.offset; + mask2D += fp2D.mask; + lod2D += fp2D.lod; + granularity2D += fp2D.granularity; + + ret2D = textureFootprintGradClampNV(sample2D, P2, dx, dy, lodClamp, granularity, true, fp2D); + anchor2D += fp2D.anchor; + offset2D += fp2D.offset; + mask2D += fp2D.mask; + lod2D += fp2D.lod; + granularity2D += fp2D.granularity; + + ret3D = textureFootprintNV(sample3D, P3, granularity, true, fp3D); + anchor3D = fp3D.anchor; + offset3D = fp3D.offset; + mask3D = fp3D.mask; + lod3D = fp3D.lod; + granularity3D = fp3D.granularity; + + ret3D = textureFootprintNV(sample3D, P3, granularity, true, fp3D, bias); + anchor3D += fp3D.anchor; + offset3D += fp3D.offset; + mask3D += fp3D.mask; + lod3D += fp3D.lod; + granularity3D += fp3D.granularity; + + ret3D = textureFootprintClampNV(sample3D, P3, lodClamp, granularity, true, fp3D); + anchor3D += fp3D.anchor; + offset3D += fp3D.offset; + mask3D += fp3D.mask; + lod3D += fp3D.lod; + granularity3D += fp3D.granularity; + + ret3D = textureFootprintClampNV(sample3D, P3, lodClamp, granularity, true, fp3D, bias); + anchor3D += fp3D.anchor; + offset3D += fp3D.offset; + mask3D += fp3D.mask; + lod3D += fp3D.lod; + granularity3D += fp3D.granularity; + + ret3D = textureFootprintLodNV(sample3D, P3, lod, granularity, true, fp3D); + anchor3D += fp3D.anchor; + offset3D += fp3D.offset; + mask3D += fp3D.mask; + lod3D += fp3D.lod; + granularity3D += fp3D.granularity; +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.shaderStencilExport.frag b/deps/glslang/Test/spv.shaderStencilExport.frag new file mode 100644 index 00000000..e3ad4d67 --- /dev/null +++ b/deps/glslang/Test/spv.shaderStencilExport.frag @@ -0,0 +1,10 @@ +#version 450 core + +#extension GL_ARB_shader_stencil_export: enable + +out int gl_FragStencilRefARB; + +void main() +{ + gl_FragStencilRefARB = 100; +} diff --git a/deps/glslang/Test/spv.shadingRate.frag b/deps/glslang/Test/spv.shadingRate.frag new file mode 100644 index 00000000..8fbd4baf --- /dev/null +++ b/deps/glslang/Test/spv.shadingRate.frag @@ -0,0 +1,11 @@ +#version 450 + +#extension GL_NV_shading_rate_image : require + +layout (location = 0) out vec2 FragmentSize; +layout (location = 2) out int InvocationsPerPixel; + +void main () { + FragmentSize = gl_FragmentSizeNV; + InvocationsPerPixel = gl_InvocationsPerPixelNV; +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.shiftOps.frag b/deps/glslang/Test/spv.shiftOps.frag new file mode 100644 index 00000000..7fb937f4 --- /dev/null +++ b/deps/glslang/Test/spv.shiftOps.frag @@ -0,0 +1,18 @@ +#version 450 + +flat in int i1; +flat in uint u1; +flat in ivec3 i3; +flat in uvec3 u3; + +out ivec3 icolor; +out uvec3 ucolor; + +void main() +{ + icolor = i3 << u1; + icolor <<= 4u; + + ucolor = u3 >> i1; + ucolor >>= 5; +} diff --git a/deps/glslang/Test/spv.shortCircuit.frag b/deps/glslang/Test/spv.shortCircuit.frag new file mode 100644 index 00000000..4a626417 --- /dev/null +++ b/deps/glslang/Test/spv.shortCircuit.frag @@ -0,0 +1,50 @@ +#version 400 + +flat in ivec4 uiv4; +in vec4 uv4; +bool ub; +bool uba; +bvec4 ub41, ub42; +in float uf; +flat in int ui; + +out float of1; +out vec4 of4; + +bool foo() { ++of1; return of1 > 10.0; } + +void main() +{ + of1 = 0.0; + of4 = vec4(0.0); + + if (ub || ui > 2) // not worth short circuiting + ++of1; + + if (ub && !uba) // not worth short circuiting + ++of1; + + if (ub || foo()) // must short circuit + ++of1; + + if (ub && foo()) // must short circuit + ++of1; + + if (foo() || ub) // not worth short circuiting + ++of1; + + if (foo() && ub) // not worth short circuiting + ++of1; + + if (ub || ++of1 > 1.0) // must short circuit + ++of4; + + if (++of1 > 1.0 || ub) // not worth short circuiting + ++of4; + + if (ub || sin(uf) * 4.0 > of1) // worth short circuiting + ++of1; + + if (ub && sin(uf) * 4.0 > of1) // worth short circuiting + ++of1; +} diff --git a/deps/glslang/Test/spv.simpleFunctionCall.frag b/deps/glslang/Test/spv.simpleFunctionCall.frag new file mode 100644 index 00000000..496bb93d --- /dev/null +++ b/deps/glslang/Test/spv.simpleFunctionCall.frag @@ -0,0 +1,13 @@ +#version 150 + +in vec4 BaseColor; + +vec4 foo() +{ + return BaseColor; +} + +void main() +{ + gl_FragColor = foo(); +} diff --git a/deps/glslang/Test/spv.simpleMat.vert b/deps/glslang/Test/spv.simpleMat.vert new file mode 100644 index 00000000..897a8986 --- /dev/null +++ b/deps/glslang/Test/spv.simpleMat.vert @@ -0,0 +1,19 @@ +#version 330 + +varying mat4 mvp; + +in vec4 v; +in mat3 am3; +in mat4 arraym[3]; + +out float f; +out vec4 glPos; +//out mat4 mout[2]; + +void main() +{ + //needs complex output blocks to work: gl_Position = mvp * v; + glPos = mvp * v; + f = am3[2][1] + arraym[1][2][3]; + //mout[1] = arraym[2]; +} diff --git a/deps/glslang/Test/spv.sparseTexture.frag b/deps/glslang/Test/spv.sparseTexture.frag new file mode 100644 index 00000000..c995ee2a --- /dev/null +++ b/deps/glslang/Test/spv.sparseTexture.frag @@ -0,0 +1,91 @@ +#version 450 +#extension GL_ARB_sparse_texture2: enable + +uniform sampler2D s2D; +uniform sampler3D s3D; +uniform sampler2DShadow s2DShadow; +uniform samplerCubeShadow sCubeShadow; +uniform sampler2DArrayShadow s2DArrayShadow; +uniform sampler2DRectShadow s2DRectShadow; +uniform samplerCubeArrayShadow sCubeArrayShadow; +uniform sampler2DMS s2DMS; + +uniform isamplerCube isCube; +uniform isampler2DArray is2DArray; + +uniform usamplerCubeArray usCubeArray; +uniform usampler2DRect us2DRect; + +layout(rgba32f) uniform image2D i2D; +layout(rgba32i) uniform iimage3D ii3D; +layout(rgba32f) uniform image2DMS i2DMS; + +in vec2 c2; +in vec3 c3; +in vec4 c4; + +in flat ivec2 ic2; +in flat ivec3 ic3; + +in flat ivec2 offsets[4]; + +out vec4 outColor; + +void main() +{ + int resident = 0; + vec4 texel = vec4(0.0); + ivec4 itexel = ivec4(0); + uvec4 utexel = uvec4(0); + + resident |= sparseTextureARB(s2D, c2, texel); + resident |= sparseTextureARB(s3D, c3, texel, 2.0); + resident |= sparseTextureARB(isCube, c3, itexel); + resident |= sparseTextureARB(s2DShadow, c3, texel.x); + resident |= sparseTextureARB(sCubeArrayShadow, c4, 1.0, texel.x); + + resident |= sparseTextureLodARB(s2D, c2, 2.0, texel); + resident |= sparseTextureLodARB(usCubeArray, c4, 1.0, utexel); + resident |= sparseTextureLodARB(s2DShadow, c3, 2.0, texel.y); + + resident |= sparseTextureOffsetARB(s3D, c3, ivec3(2), texel, 2.0); + resident |= sparseTextureOffsetARB(us2DRect, c2, ivec2(3), utexel); + resident |= sparseTextureOffsetARB(s2DArrayShadow, c4, ivec2(5), texel.z); + + resident |= sparseTexelFetchARB(s2D, ivec2(c2), 2, texel); + resident |= sparseTexelFetchARB(us2DRect, ivec2(c2), utexel); + resident |= sparseTexelFetchARB(s2DMS, ivec2(c2), 4, texel); + + resident |= sparseTexelFetchOffsetARB(s3D, ivec3(c3), 2, ivec3(4), texel); + resident |= sparseTexelFetchOffsetARB(us2DRect, ivec2(c2), ivec2(3), utexel); + + resident |= sparseTextureLodOffsetARB(s2D, c2, 2.0, ivec2(5), texel); + resident |= sparseTextureLodOffsetARB(is2DArray, c3, 2.0, ivec2(6), itexel); + resident |= sparseTextureLodOffsetARB(s2DShadow, c3, 2.0, ivec2(7), texel.z); + + resident |= sparseTextureGradARB(s3D, c3, c3, c3, texel); + resident |= sparseTextureGradARB(sCubeShadow, c4, c3, c3, texel.y); + resident |= sparseTextureGradARB(usCubeArray, c4, c3, c3, utexel); + + resident |= sparseTextureGradOffsetARB(s2D, c2, c2, c2, ivec2(5), texel); + resident |= sparseTextureGradOffsetARB(s2DRectShadow, c3, c2, c2, ivec2(6), texel.w); + resident |= sparseTextureGradOffsetARB(is2DArray, c3, c2, c2, ivec2(2), itexel); + + resident |= sparseTextureGatherARB(s2D, c2, texel); + resident |= sparseTextureGatherARB(is2DArray, c3, itexel, 2); + resident |= sparseTextureGatherARB(s2DArrayShadow, c3, 2.0, texel); + + resident |= sparseTextureGatherOffsetARB(s2D, c2, ivec2(4), texel); + resident |= sparseTextureGatherOffsetARB(is2DArray, c3, ivec2(5), itexel, 2); + resident |= sparseTextureGatherOffsetARB(s2DRectShadow, c2, 2.0, ivec2(7), texel); + + resident |= sparseTextureGatherOffsetsARB(s2D, c2, offsets, texel); + resident |= sparseTextureGatherOffsetsARB(is2DArray, c3, offsets, itexel, 2); + resident |= sparseTextureGatherOffsetsARB(s2DRectShadow, c2, 2.0, offsets, texel); + + resident |= sparseImageLoadARB(i2D, ic2, texel); + resident |= sparseImageLoadARB(ii3D, ic3, itexel); + resident |= sparseImageLoadARB(i2DMS, ic2, 3, texel); + + outColor = sparseTexelsResidentARB(resident) ? texel : vec4(itexel) + vec4(utexel); +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.sparseTextureClamp.frag b/deps/glslang/Test/spv.sparseTextureClamp.frag new file mode 100644 index 00000000..97317938 --- /dev/null +++ b/deps/glslang/Test/spv.sparseTextureClamp.frag @@ -0,0 +1,70 @@ +#version 450 +#extension GL_ARB_sparse_texture_clamp: enable + +uniform sampler2D s2D; +uniform sampler3D s3D; +uniform sampler2DShadow s2DShadow; +uniform samplerCubeShadow sCubeShadow; +uniform sampler2DArrayShadow s2DArrayShadow; +uniform sampler2DRectShadow s2DRectShadow; +uniform samplerCubeArrayShadow sCubeArrayShadow; + +uniform isamplerCube isCube; +uniform isampler2DArray is2DArray; + +uniform usamplerCubeArray usCubeArray; +uniform usampler2DRect us2DRect; + +in vec2 c2; +in vec3 c3; +in vec4 c4; + +in float lodClamp; + +out vec4 outColor; + +void main() +{ + int resident = 0; + vec4 texel = vec4(0.0); + ivec4 itexel = ivec4(0); + uvec4 utexel = uvec4(0); + + resident |= sparseTextureClampARB(s2D, c2, lodClamp, texel); + resident |= sparseTextureClampARB(s3D, c3, lodClamp, texel, 2.0); + resident |= sparseTextureClampARB(isCube, c3, lodClamp, itexel); + resident |= sparseTextureClampARB(s2DShadow, c3, lodClamp, texel.x); + resident |= sparseTextureClampARB(sCubeArrayShadow, c4, 1.0, lodClamp, texel.x); + + texel += textureClampARB(s2D, c2, lodClamp); + texel += textureClampARB(s3D, c3, lodClamp, 2.0); + itexel += textureClampARB(isCube, c3, lodClamp); + texel.x += textureClampARB(s2DShadow, c3, lodClamp); + texel.x += textureClampARB(sCubeArrayShadow, c4, 1.0, lodClamp); + + resident |= sparseTextureOffsetClampARB(s3D, c3, ivec3(2), lodClamp, texel, 2.0); + resident |= sparseTextureOffsetClampARB(us2DRect, c2, ivec2(3), lodClamp, utexel); + resident |= sparseTextureOffsetClampARB(s2DArrayShadow, c4, ivec2(5), lodClamp, texel.z); + + texel += textureOffsetClampARB(s3D, c3, ivec3(2), lodClamp, 2.0); + utexel += textureOffsetClampARB(us2DRect, c2, ivec2(3), lodClamp); + texel.z += textureOffsetClampARB(s2DArrayShadow, c4, ivec2(5), lodClamp); + + resident |= sparseTextureGradClampARB(s3D, c3, c3, c3, lodClamp, texel); + resident |= sparseTextureGradClampARB(sCubeShadow, c4, c3, c3, lodClamp, texel.y); + resident |= sparseTextureGradClampARB(usCubeArray, c4, c3, c3, lodClamp, utexel); + + texel += textureGradClampARB(s3D, c3, c3, c3, lodClamp); + texel.y += textureGradClampARB(sCubeShadow, c4, c3, c3, lodClamp); + utexel += textureGradClampARB(usCubeArray, c4, c3, c3, lodClamp); + + resident |= sparseTextureGradOffsetClampARB(s2D, c2, c2, c2, ivec2(5), lodClamp, texel); + resident |= sparseTextureGradOffsetClampARB(s2DRectShadow, c3, c2, c2, ivec2(6), lodClamp, texel.w); + resident |= sparseTextureGradOffsetClampARB(is2DArray, c3, c2, c2, ivec2(2), lodClamp, itexel); + + texel += textureGradOffsetClampARB(s2D, c2, c2, c2, ivec2(5), lodClamp); + texel.w += textureGradOffsetClampARB(s2DRectShadow, c3, c2, c2, ivec2(6), lodClamp); + itexel += textureGradOffsetClampARB(is2DArray, c3, c2, c2, ivec2(2), lodClamp); + + outColor = sparseTexelsResidentARB(resident) ? texel : vec4(itexel) + vec4(utexel); +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.specConst.vert b/deps/glslang/Test/spv.specConst.vert new file mode 100644 index 00000000..3ea24980 --- /dev/null +++ b/deps/glslang/Test/spv.specConst.vert @@ -0,0 +1,8 @@ +#version 450 + +layout(constant_id = 11) const int a = 8; + +void main() +{ + gl_Position = vec4(1.0) / a; +} diff --git a/deps/glslang/Test/spv.specConstant.comp b/deps/glslang/Test/spv.specConstant.comp new file mode 100644 index 00000000..ae8ae19d --- /dev/null +++ b/deps/glslang/Test/spv.specConstant.comp @@ -0,0 +1,13 @@ +#version 450 + +layout(local_size_x_id = 18, local_size_z_id = 19) in; +layout(local_size_x = 32, local_size_y = 32) in; + +buffer bn { + uint a; +} bi; + +void main() +{ + bi.a = gl_WorkGroupSize.x * gl_WorkGroupSize.y * gl_WorkGroupSize.z; +} diff --git a/deps/glslang/Test/spv.specConstant.vert b/deps/glslang/Test/spv.specConstant.vert new file mode 100644 index 00000000..9813bf5f --- /dev/null +++ b/deps/glslang/Test/spv.specConstant.vert @@ -0,0 +1,51 @@ +#version 400 + +layout(constant_id = 16) const int arraySize = 5; +in vec4 ucol[arraySize]; + +layout(constant_id = 17) const bool spBool = true; +layout(constant_id = 18) const float spFloat = 3.14; +layout(constant_id = 19) const double spDouble = 3.1415926535897932384626433832795; +layout(constant_id = 22) const uint scale = 2; + +layout(constant_id = 24) gl_MaxImageUnits; + +out vec4 color; +out int size; + +// parameter should be considered same type as ucol +void foo(vec4 p[arraySize]); + +void main() +{ + color = ucol[2]; + size = arraySize; + if (spBool) + color *= scale; + color += float(spDouble / spFloat); + + foo(ucol); +} + +layout(constant_id = 116) const int dupArraySize = 12; +in vec4 dupUcol[dupArraySize]; + +layout(constant_id = 117) const bool spDupBool = true; +layout(constant_id = 118) const float spDupFloat = 3.14; +layout(constant_id = 119) const double spDupDouble = 3.1415926535897932384626433832795; +layout(constant_id = 122) const uint dupScale = 2; + +void foo(vec4 p[arraySize]) +{ + color += dupUcol[2]; + size += dupArraySize; + if (spDupBool) + color *= dupScale; + color += float(spDupDouble / spDupFloat); +} + +int builtin_spec_constant() +{ + int result = gl_MaxImageUnits; + return result; +} diff --git a/deps/glslang/Test/spv.specConstantComposite.vert b/deps/glslang/Test/spv.specConstantComposite.vert new file mode 100644 index 00000000..d9d07a3e --- /dev/null +++ b/deps/glslang/Test/spv.specConstantComposite.vert @@ -0,0 +1,98 @@ +#version 450 + +// constant_id specified scalar spec constants +layout(constant_id = 200) const int spec_int = 3; +layout(constant_id = 201) const float spec_float = 3.14; +layout(constant_id = 202) const + double spec_double = 3.1415926535897932384626433832795; +layout(constant_id = 203) const bool spec_bool = true; + +// const float cast_spec_float = float(spec_float); + +// Flat struct +struct flat_struct { + int i; + float f; + double d; + bool b; +}; + +// Nesting struct +struct nesting_struct { + flat_struct nested; + vec4 v; + int i; +}; + +// Expect OpSpecConstantComposite +// Flat struct initializer +//const flat_struct spec_flat_struct_all_spec = {spec_int, spec_float, +// spec_double, spec_bool}; +//const flat_struct spec_flat_struct_partial_spec = {30, 30.14, spec_double, +// spec_bool}; + +// Nesting struct initializer +//const nesting_struct nesting_struct_ctor = { +// {spec_int, spec_float, spec_double, false}, +// vec4(0.1, 0.1, 0.1, 0.1), +// spec_int}; + +// Vector constructor +//const vec4 spec_vec4_all_spec = +// vec4(spec_float, spec_float, spec_float, spec_float); +//const vec4 spec_vec4_partial_spec = +// vec4(spec_float, spec_float, 300.14, 300.14); +//const vec4 spec_vec4_from_one_scalar = vec4(spec_float); + +// Matrix constructor +//const mat2x3 spec_mat2x3 = mat2x3(spec_float, spec_float, spec_float, 1.1, 2.2, 3.3); +//const mat2x3 spec_mat2x3_from_one_scalar = mat2x3(spec_float); + +// Struct nesting constructor +//const nesting_struct spec_nesting_struct_all_spec = { +// spec_flat_struct_all_spec, spec_vec4_all_spec, spec_int}; +//const nesting_struct spec_nesting_struct_partial_spec = { +// spec_flat_struct_partial_spec, spec_vec4_partial_spec, 3000}; + +//const float spec_float_array[5] = {spec_float, spec_float, 1.0, 2.0, 3.0}; +//const int spec_int_array[5] = {spec_int, spec_int, 1, 2, 30}; + +// global_vec4_array_with_spec_length is not a spec constant, but its array +// size is. When calling global_vec4_array_with_spec_length.length(), A +// TIntermSymbol Node should be returned, instead of a TIntermConstantUnion +// node which represents a known constant value. +in vec4 global_vec4_array_with_spec_length[spec_int]; + +out vec4 color; + +void refer_primary_spec_const() { + if (spec_bool) color *= spec_int; +} + +void refer_composite_spec_const() { + //color += spec_vec4_all_spec; + //color -= spec_vec4_partial_spec; +} + +void refer_copmosite_dot_dereference() { + //color *= spec_nesting_struct_all_spec.i; + //color += spec_vec4_all_spec.x; +} + +void refer_composite_bracket_dereference() { + //color -= spec_float_array[1]; + //color /= spec_int_array[spec_int_array[spec_int]]; +} + +int refer_spec_const_array_length() { + int len = global_vec4_array_with_spec_length.length(); + return len; +} + +void declare_spec_const_in_func() { + //const nesting_struct spec_const_declared_in_func = { + // spec_flat_struct_partial_spec, spec_vec4_partial_spec, 10}; + //color /= spec_const_declared_in_func.i; +} + +void main() {} diff --git a/deps/glslang/Test/spv.specConstantOperations.vert b/deps/glslang/Test/spv.specConstantOperations.vert new file mode 100644 index 00000000..93be12c5 --- /dev/null +++ b/deps/glslang/Test/spv.specConstantOperations.vert @@ -0,0 +1,124 @@ +#version 450 + +layout(constant_id = 200) const float sp_float = 3.1415926; +layout(constant_id = 201) const int sp_int = 10; +layout(constant_id = 202) const uint sp_uint = 100; +layout(constant_id = 203) const int sp_sint = -10; +layout(constant_id = 204) const double sp_double = 2.718281828459; + +// +// Scalars +// + +// float <-> double conversion +const float float_from_double = float(sp_double); +const double double_from_float = double(sp_float); + +// uint/int <-> bool conversion +const bool bool_from_int = bool(sp_int); +const bool bool_from_uint = bool(sp_uint); +const int int_from_bool = int(bool_from_int); +const uint uint_from_bool = uint(bool_from_int); + +// uint <-> int +const uint sp_uint_from_sint = uint(sp_sint); +const int sp_sint_from_uint = int(sp_uint); + +// Negate and Not +const int negate_int = -sp_int; +const int not_int = ~sp_int; + +// Add and Subtract +const int sp_int_add_two = sp_int + 2; +const int sp_int_add_two_sub_three = sp_int + 2 - 3; +const int sp_int_add_two_sub_four = sp_int_add_two - 4; + +// Mul, Div and Rem +const int sp_sint_mul_two = sp_sint * 2; +const uint sp_uint_mul_two = sp_uint * 2; +const int sp_sint_mul_two_div_five = sp_sint_mul_two / 5; +const uint sp_uint_mul_two_div_five = sp_uint_mul_two / 5; +const int sp_sint_rem_four = sp_sint % 4; +const uint sp_uint_rem_four = sp_uint % 4; +const int sp_sint_mul_three_div_five = sp_sint * 3 / 5; + +// Shift +const int sp_sint_shift_right_arithmetic = sp_sint >> 10; +const uint sp_uint_shift_right_arithmetic = sp_uint >> 20; +const int sp_sint_shift_left = sp_sint << 1; +const uint sp_uint_shift_left = sp_uint << 2; + +// Bitwise And, Or, Xor +const int sp_sint_or_256 = sp_sint | 0x100; +const uint sp_uint_xor_512 = sp_uint ^ 0x200; + +/* // Scalar comparison */ +const bool sp_int_lt_sp_sint = sp_int < sp_sint; +const bool sp_uint_equal_sp_uint = sp_uint == sp_uint; +const bool sp_int_gt_sp_sint = sp_int > sp_sint; + +// +// Vectors +// +const ivec4 iv = ivec4(20, 30, sp_int, sp_int); +const uvec4 uv = uvec4(sp_uint, sp_uint, -1, -2); +//const vec4 fv = vec4(sp_float, 1.25, sp_float, 1.25); + +// uint/int <-> bool conversion +const bvec4 bv_from_iv = bvec4(iv); +const bvec4 bv_from_uv = bvec4(uv); +const ivec4 iv_from_bv = ivec4(bv_from_iv); +const uvec4 uv_from_bv = uvec4(bv_from_iv); + +// uint <-> int +const uvec4 uv_from_iv = uvec4(iv); +const ivec4 iv_from_uv = ivec4(uv); + +// Negate and Not +const ivec4 not_iv = ~iv; +const ivec4 negate_iv = -iv; + +// Add and Subtract +const ivec4 iv_add_two = iv + 2; +const ivec4 iv_add_two_sub_three = iv + 2 - 3; +const ivec4 iv_add_two_sub_four = iv_add_two_sub_three - 4; + +// Mul, Div and Rem +const ivec4 iv_mul_two = iv * 2; +const ivec4 iv_mul_two_div_five = iv_mul_two / 5; +const ivec4 iv_rem_four = iv % 4; + +// Shift +const ivec4 iv_shift_right_arithmetic = iv >> 10; +const ivec4 iv_shift_left = iv << 2; + +// Bitwise And, Or, Xor +const ivec4 iv_or_1024 = iv | 0x400; +const uvec4 uv_xor_2048 = uv ^ 0x800; + +// Swizzles +const int iv_x = iv.x; +const ivec2 iv_yx = iv.yx; +const ivec3 iv_zyx = iv.zyx; +const ivec4 iv_yzxw = iv.yzxw; + +int non_const_array_size_from_spec_const() { + int array[sp_int + 2]; + for (int i = 0; i < sp_int + 2; i++) { + array[i] = 1023; + } + return array[sp_int + 1]; +} + +// ternary +layout(constant_id = 210) const int a = 4; +layout(constant_id = 211) const int b = 6; +layout(constant_id = 212) const bool c = true; +int ternayArray1[a > b ? a : b]; +const int t1 = c ? 13 : 17; +const int t2 = c ? a : 17; +const int t3 = true ? a : 17; +const int t4 = a > b ? 13 + a : 17 * b; +const vec2 v2 = !c ? vec2(1.0) : vec2(2.0); + +void main() {} diff --git a/deps/glslang/Test/spv.ssbo.autoassign.frag b/deps/glslang/Test/spv.ssbo.autoassign.frag new file mode 100644 index 00000000..073be453 --- /dev/null +++ b/deps/glslang/Test/spv.ssbo.autoassign.frag @@ -0,0 +1,24 @@ + +cbuffer TestCB +{ + uint W; + uint H; +}; + +struct BufType +{ + float4 va; + float4 vb; +}; + +StructuredBuffer < BufType > SB0; +RWStructuredBuffer < BufType > SB1; + +float4 main(float4 pos : POS) : SV_Target0 +{ + float4 vTmp = SB0[pos.y * W + pos.x].va + SB0[pos.y * W + pos.x].vb; + + vTmp += SB1[pos.y * W + pos.x].va + SB1[pos.y * W + pos.x].vb; + + return vTmp; +} diff --git a/deps/glslang/Test/spv.ssboAlias.frag b/deps/glslang/Test/spv.ssboAlias.frag new file mode 100644 index 00000000..ed3d3e79 --- /dev/null +++ b/deps/glslang/Test/spv.ssboAlias.frag @@ -0,0 +1,10 @@ +AppendStructuredBuffer Buf1 : register(u1); +AppendStructuredBuffer Buf2 : register(u2); +AppendStructuredBuffer Buf3 : register(u1); + +float4 main() : SV_Target +{ + Buf1.Append(10u); + Buf2.Append(20u); + return float4(1.0, 3.0, 5.0, 1.0); +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.stereoViewRendering.tesc b/deps/glslang/Test/spv.stereoViewRendering.tesc new file mode 100644 index 00000000..e8cfe003 --- /dev/null +++ b/deps/glslang/Test/spv.stereoViewRendering.tesc @@ -0,0 +1,19 @@ +#version 450 + +#extension GL_NV_viewport_array2 :require +#extension GL_NV_stereo_view_rendering : require + +layout(vertices = 4) out; + +out gl_PerVertex { + int gl_SecondaryViewportMaskNV[2]; + vec4 gl_SecondaryPositionNV; +} gl_out[4]; + +layout (viewport_relative, secondary_view_offset = 1) out highp int gl_Layer; + +void main() +{ + gl_out[gl_InvocationID].gl_SecondaryViewportMaskNV[0] = 1; + gl_out[gl_InvocationID].gl_SecondaryPositionNV = gl_in[1].gl_Position; +} diff --git a/deps/glslang/Test/spv.stereoViewRendering.vert b/deps/glslang/Test/spv.stereoViewRendering.vert new file mode 100644 index 00000000..fc7d52e2 --- /dev/null +++ b/deps/glslang/Test/spv.stereoViewRendering.vert @@ -0,0 +1,12 @@ +#version 450 + +#extension GL_NV_viewport_array2 :require +#extension GL_NV_stereo_view_rendering : require + +layout (viewport_relative, secondary_view_offset = 2) out highp int gl_Layer; +void main() +{ + gl_SecondaryViewportMaskNV[0] = 1; + gl_SecondaryPositionNV = gl_Position; +} + diff --git a/deps/glslang/Test/spv.storageBuffer.vert b/deps/glslang/Test/spv.storageBuffer.vert new file mode 100644 index 00000000..6dd629e8 --- /dev/null +++ b/deps/glslang/Test/spv.storageBuffer.vert @@ -0,0 +1,16 @@ +#version 450 + +#pragma use_storage_buffer + +uniform ub { + vec4 a; +} ubi; + +buffer bb { + vec4 b; +} bbi; + +void main() +{ + gl_Position = ubi.a + bbi.b; +} diff --git a/deps/glslang/Test/spv.structAssignment.frag b/deps/glslang/Test/spv.structAssignment.frag new file mode 100644 index 00000000..ca95ec37 --- /dev/null +++ b/deps/glslang/Test/spv.structAssignment.frag @@ -0,0 +1,41 @@ +#version 140 + +precision mediump int; + +uniform sampler2D samp2D; +in mediump vec2 coord; + +struct lunarStruct1 { + int i; + float f; +}; + +struct lunarStruct2 { + int i; + float f; + lunarStruct1 s1_1; +}; + +struct lunarStruct3 { + lunarStruct2 s2_1; + int i; + float f; + lunarStruct1 s1_1; +}; + + +lunarStruct1 foo; +lunarStruct2 foo2; +lunarStruct3 foo3; + +void main() +{ + lunarStruct2 locals2; + + if (foo3.s2_1.i > 0) + locals2 = foo3.s2_1; + else + locals2 = foo2; + + gl_FragColor = locals2.s1_1.f * texture(samp2D, coord); +} diff --git a/deps/glslang/Test/spv.structDeref.frag b/deps/glslang/Test/spv.structDeref.frag new file mode 100644 index 00000000..11822cdc --- /dev/null +++ b/deps/glslang/Test/spv.structDeref.frag @@ -0,0 +1,71 @@ +#version 140 + +uniform sampler2D samp2D; +in vec2 coord; + +struct s0 { + int i; +}; + +struct s00 { + s0 s0_0; +}; + +struct s1 { + int i; + float f; + s0 s0_1; +}; + +struct s2 { + int i; + float f; + s1 s1_1; +}; + +struct s3 { + s2[12] s2_1; + int i; + float f; + s1 s1_1; +}; + + +s0 foo0; +s1 foo1; +s2 foo2; +s3 foo3; + +s00 foo00; + +void main() +{ + s0 locals0; + s2 locals2; + s00 locals00; + + float[6] fArray; + + s1[10] locals1Array; + + if (foo3.s2_1[9].i > 0) { + locals2.f = 1.0; + locals2.s1_1 = s1(0, 1.0, s0(0)); + fArray = float[6]( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + locals1Array[6] = foo1; + locals0 = s0(0); + locals00 = s00(s0(0)); + } else { + locals2.f = coord.x; + locals2.s1_1 = s1(1, coord.y, foo0); + fArray = float[6]( 0.0, 1.0, 2.0, 3.0, 4.0, 5.0); + locals1Array[6] = locals2.s1_1; + locals0 = foo1.s0_1; + locals00 = foo00; + } + + if (locals0.i > 5) + locals0 = locals00.s0_0; + + gl_FragColor = (float(locals0.i) + locals1Array[6].f + fArray[3] + locals2.s1_1.f) * texture(samp2D, coord); +} diff --git a/deps/glslang/Test/spv.structure.frag b/deps/glslang/Test/spv.structure.frag new file mode 100644 index 00000000..b81b9547 --- /dev/null +++ b/deps/glslang/Test/spv.structure.frag @@ -0,0 +1,31 @@ +#version 140 +uniform sampler2D samp2D; +in vec2 coord; + +struct lunarStruct1 { + int i; + float f[4]; + vec4 color[5]; +}; + +struct lunarStruct2 { + int i[5]; + float f; + lunarStruct1 s1_1[7]; +}; + +lunarStruct1 foo; +lunarStruct2 foo2[5]; + +void main() +{ + float scale = 0.0; + + if (foo2[3].i[4] > 0) + scale = foo2[3].s1_1[2].color[3].x; + else + scale = foo2[3].s1_1[2].f[3]; + + gl_FragColor = scale * texture(samp2D, coord); +} + diff --git a/deps/glslang/Test/spv.subgroup.frag b/deps/glslang/Test/spv.subgroup.frag new file mode 100644 index 00000000..520052fa --- /dev/null +++ b/deps/glslang/Test/spv.subgroup.frag @@ -0,0 +1,7 @@ +#version 450 +#extension GL_KHR_shader_subgroup_basic: enable +layout(location = 0) out uvec4 data; +void main (void) +{ + data = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); +} diff --git a/deps/glslang/Test/spv.subgroup.geom b/deps/glslang/Test/spv.subgroup.geom new file mode 100644 index 00000000..70e9dd48 --- /dev/null +++ b/deps/glslang/Test/spv.subgroup.geom @@ -0,0 +1,13 @@ +#version 450 +#extension GL_KHR_shader_subgroup_basic: enable +layout(points) in; +layout(points, max_vertices = 1) out; +layout(set = 0, binding = 0, std430) buffer Output +{ + uvec4 result[]; +}; + +void main (void) +{ + result[gl_PrimitiveIDIn] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); +} diff --git a/deps/glslang/Test/spv.subgroup.tesc b/deps/glslang/Test/spv.subgroup.tesc new file mode 100644 index 00000000..63bf5e55 --- /dev/null +++ b/deps/glslang/Test/spv.subgroup.tesc @@ -0,0 +1,12 @@ +#version 450 +#extension GL_KHR_shader_subgroup_basic: enable +layout(vertices=1) out; +layout(set = 0, binding = 0, std430) buffer Output +{ + uvec4 result[]; +}; + +void main (void) +{ + result[gl_PrimitiveID] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); +} diff --git a/deps/glslang/Test/spv.subgroup.tese b/deps/glslang/Test/spv.subgroup.tese new file mode 100644 index 00000000..e504df79 --- /dev/null +++ b/deps/glslang/Test/spv.subgroup.tese @@ -0,0 +1,12 @@ +#version 450 +#extension GL_KHR_shader_subgroup_basic: enable +layout(isolines) in; +layout(set = 0, binding = 0, std430) buffer Output +{ + uvec4 result[]; +}; + +void main (void) +{ + result[gl_PrimitiveID] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); +} diff --git a/deps/glslang/Test/spv.subgroup.vert b/deps/glslang/Test/spv.subgroup.vert new file mode 100644 index 00000000..779b7584 --- /dev/null +++ b/deps/glslang/Test/spv.subgroup.vert @@ -0,0 +1,11 @@ +#version 450 +#extension GL_KHR_shader_subgroup_basic: enable +layout(set = 0, binding = 0, std430) buffer Output +{ + uvec4 result[]; +}; + +void main (void) +{ + result[gl_VertexIndex] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); +} diff --git a/deps/glslang/Test/spv.subgroupArithmetic.comp b/deps/glslang/Test/spv.subgroupArithmetic.comp new file mode 100644 index 00000000..6cc9337b --- /dev/null +++ b/deps/glslang/Test/spv.subgroupArithmetic.comp @@ -0,0 +1,393 @@ +#version 450 + +#extension GL_KHR_shader_subgroup_arithmetic: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupAdd(data[0].f4.x); + data[invocation].f4.xy = subgroupAdd(data[1].f4.xy); + data[invocation].f4.xyz = subgroupAdd(data[2].f4.xyz); + data[invocation].f4 = subgroupAdd(data[3].f4); + + data[invocation].i4.x = subgroupAdd(data[0].i4.x); + data[invocation].i4.xy = subgroupAdd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupAdd(data[2].i4.xyz); + data[invocation].i4 = subgroupAdd(data[3].i4); + + data[invocation].u4.x = subgroupAdd(data[0].u4.x); + data[invocation].u4.xy = subgroupAdd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupAdd(data[2].u4.xyz); + data[invocation].u4 = subgroupAdd(data[3].u4); + + data[invocation].d4.x = subgroupAdd(data[0].d4.x); + data[invocation].d4.xy = subgroupAdd(data[1].d4.xy); + data[invocation].d4.xyz = subgroupAdd(data[2].d4.xyz); + data[invocation].d4 = subgroupAdd(data[3].d4); + + data[invocation].f4.x = subgroupMul(data[0].f4.x); + data[invocation].f4.xy = subgroupMul(data[1].f4.xy); + data[invocation].f4.xyz = subgroupMul(data[2].f4.xyz); + data[invocation].f4 = subgroupMul(data[3].f4); + + data[invocation].i4.x = subgroupMul(data[0].i4.x); + data[invocation].i4.xy = subgroupMul(data[1].i4.xy); + data[invocation].i4.xyz = subgroupMul(data[2].i4.xyz); + data[invocation].i4 = subgroupMul(data[3].i4); + + data[invocation].u4.x = subgroupMul(data[0].u4.x); + data[invocation].u4.xy = subgroupMul(data[1].u4.xy); + data[invocation].u4.xyz = subgroupMul(data[2].u4.xyz); + data[invocation].u4 = subgroupMul(data[3].u4); + + data[invocation].d4.x = subgroupMul(data[0].d4.x); + data[invocation].d4.xy = subgroupMul(data[1].d4.xy); + data[invocation].d4.xyz = subgroupMul(data[2].d4.xyz); + data[invocation].d4 = subgroupMul(data[3].d4); + + data[invocation].f4.x = subgroupMin(data[0].f4.x); + data[invocation].f4.xy = subgroupMin(data[1].f4.xy); + data[invocation].f4.xyz = subgroupMin(data[2].f4.xyz); + data[invocation].f4 = subgroupMin(data[3].f4); + + data[invocation].i4.x = subgroupMin(data[0].i4.x); + data[invocation].i4.xy = subgroupMin(data[1].i4.xy); + data[invocation].i4.xyz = subgroupMin(data[2].i4.xyz); + data[invocation].i4 = subgroupMin(data[3].i4); + + data[invocation].u4.x = subgroupMin(data[0].u4.x); + data[invocation].u4.xy = subgroupMin(data[1].u4.xy); + data[invocation].u4.xyz = subgroupMin(data[2].u4.xyz); + data[invocation].u4 = subgroupMin(data[3].u4); + + data[invocation].d4.x = subgroupMin(data[0].d4.x); + data[invocation].d4.xy = subgroupMin(data[1].d4.xy); + data[invocation].d4.xyz = subgroupMin(data[2].d4.xyz); + data[invocation].d4 = subgroupMin(data[3].d4); + + data[invocation].f4.x = subgroupMax(data[0].f4.x); + data[invocation].f4.xy = subgroupMax(data[1].f4.xy); + data[invocation].f4.xyz = subgroupMax(data[2].f4.xyz); + data[invocation].f4 = subgroupMax(data[3].f4); + + data[invocation].i4.x = subgroupMax(data[0].i4.x); + data[invocation].i4.xy = subgroupMax(data[1].i4.xy); + data[invocation].i4.xyz = subgroupMax(data[2].i4.xyz); + data[invocation].i4 = subgroupMax(data[3].i4); + + data[invocation].u4.x = subgroupMax(data[0].u4.x); + data[invocation].u4.xy = subgroupMax(data[1].u4.xy); + data[invocation].u4.xyz = subgroupMax(data[2].u4.xyz); + data[invocation].u4 = subgroupMax(data[3].u4); + + data[invocation].d4.x = subgroupMax(data[0].d4.x); + data[invocation].d4.xy = subgroupMax(data[1].d4.xy); + data[invocation].d4.xyz = subgroupMax(data[2].d4.xyz); + data[invocation].d4 = subgroupMax(data[3].d4); + + data[invocation].i4.x = subgroupAnd(data[0].i4.x); + data[invocation].i4.xy = subgroupAnd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupAnd(data[2].i4.xyz); + data[invocation].i4 = subgroupAnd(data[3].i4); + + data[invocation].u4.x = subgroupAnd(data[0].u4.x); + data[invocation].u4.xy = subgroupAnd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupAnd(data[2].u4.xyz); + data[invocation].u4 = subgroupAnd(data[3].u4); + + data[invocation].i4.x = int(subgroupAnd(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupAnd(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupOr(data[0].i4.x); + data[invocation].i4.xy = subgroupOr(data[1].i4.xy); + data[invocation].i4.xyz = subgroupOr(data[2].i4.xyz); + data[invocation].i4 = subgroupOr(data[3].i4); + + data[invocation].u4.x = subgroupOr(data[0].u4.x); + data[invocation].u4.xy = subgroupOr(data[1].u4.xy); + data[invocation].u4.xyz = subgroupOr(data[2].u4.xyz); + data[invocation].u4 = subgroupOr(data[3].u4); + + data[invocation].i4.x = int(subgroupOr(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupOr(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupXor(data[0].i4.x); + data[invocation].i4.xy = subgroupXor(data[1].i4.xy); + data[invocation].i4.xyz = subgroupXor(data[2].i4.xyz); + data[invocation].i4 = subgroupXor(data[3].i4); + + data[invocation].u4.x = subgroupXor(data[0].u4.x); + data[invocation].u4.xy = subgroupXor(data[1].u4.xy); + data[invocation].u4.xyz = subgroupXor(data[2].u4.xyz); + data[invocation].u4 = subgroupXor(data[3].u4); + + data[invocation].i4.x = int(subgroupXor(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupXor(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupInclusiveAdd(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveAdd(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveAdd(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveAdd(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveAdd(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveAdd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveAdd(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveAdd(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveAdd(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveAdd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveAdd(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveAdd(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveAdd(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveAdd(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveAdd(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveAdd(data[3].d4); + + data[invocation].f4.x = subgroupInclusiveMul(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveMul(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveMul(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveMul(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveMul(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveMul(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveMul(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveMul(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveMul(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveMul(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveMul(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveMul(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveMul(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveMul(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveMul(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveMul(data[3].d4); + + data[invocation].f4.x = subgroupInclusiveMin(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveMin(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveMin(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveMin(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveMin(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveMin(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveMin(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveMin(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveMin(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveMin(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveMin(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveMin(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveMin(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveMin(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveMin(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveMin(data[3].d4); + + data[invocation].f4.x = subgroupInclusiveMax(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveMax(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveMax(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveMax(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveMax(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveMax(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveMax(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveMax(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveMax(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveMax(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveMax(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveMax(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveMax(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveMax(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveMax(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveMax(data[3].d4); + + data[invocation].i4.x = subgroupInclusiveAnd(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveAnd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveAnd(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveAnd(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveAnd(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveAnd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveAnd(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveAnd(data[3].u4); + + data[invocation].i4.x = int(subgroupInclusiveAnd(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupInclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupInclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupInclusiveAnd(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupInclusiveOr(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveOr(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveOr(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveOr(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveOr(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveOr(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveOr(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveOr(data[3].u4); + + data[invocation].i4.x = int(subgroupInclusiveOr(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupInclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupInclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupInclusiveOr(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupInclusiveXor(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveXor(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveXor(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveXor(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveXor(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveXor(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveXor(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveXor(data[3].u4); + + data[invocation].i4.x = int(subgroupInclusiveXor(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupInclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupInclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupInclusiveXor(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupExclusiveAdd(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveAdd(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveAdd(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveAdd(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveAdd(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveAdd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveAdd(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveAdd(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveAdd(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveAdd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveAdd(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveAdd(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveAdd(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveAdd(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveAdd(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveAdd(data[3].d4); + + data[invocation].f4.x = subgroupExclusiveMul(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveMul(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveMul(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveMul(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveMul(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveMul(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveMul(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveMul(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveMul(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveMul(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveMul(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveMul(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveMul(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveMul(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveMul(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveMul(data[3].d4); + + data[invocation].f4.x = subgroupExclusiveMin(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveMin(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveMin(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveMin(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveMin(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveMin(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveMin(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveMin(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveMin(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveMin(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveMin(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveMin(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveMin(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveMin(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveMin(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveMin(data[3].d4); + + data[invocation].f4.x = subgroupExclusiveMax(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveMax(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveMax(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveMax(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveMax(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveMax(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveMax(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveMax(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveMax(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveMax(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveMax(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveMax(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveMax(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveMax(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveMax(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveMax(data[3].d4); + + data[invocation].i4.x = subgroupExclusiveAnd(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveAnd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveAnd(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveAnd(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveAnd(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveAnd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveAnd(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveAnd(data[3].u4); + + data[invocation].i4.x = int(subgroupExclusiveAnd(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupExclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupExclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupExclusiveAnd(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupExclusiveOr(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveOr(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveOr(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveOr(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveOr(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveOr(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveOr(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveOr(data[3].u4); + + data[invocation].i4.x = int(subgroupExclusiveOr(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupExclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupExclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupExclusiveOr(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupExclusiveXor(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveXor(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveXor(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveXor(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveXor(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveXor(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveXor(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveXor(data[3].u4); + + data[invocation].i4.x = int(subgroupExclusiveXor(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupExclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupExclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupExclusiveXor(lessThan(data[1].i4, ivec4(0)))); +} diff --git a/deps/glslang/Test/spv.subgroupBallot.comp b/deps/glslang/Test/spv.subgroupBallot.comp new file mode 100644 index 00000000..2875468c --- /dev/null +++ b/deps/glslang/Test/spv.subgroupBallot.comp @@ -0,0 +1,86 @@ +#version 450 + +#extension GL_KHR_shader_subgroup_ballot: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + uvec4 relMask = gl_SubgroupEqMask + + gl_SubgroupGeMask + + gl_SubgroupGtMask + + gl_SubgroupLeMask + + gl_SubgroupLtMask; + + uvec4 result = subgroupBallot(true); + + data[invocation].u4.x = subgroupBallotBitCount(result); + data[invocation].u4.y = subgroupBallotBitExtract(result, 0) ? 1 : 0; + data[invocation].u4.z = subgroupBallotInclusiveBitCount(result) + subgroupBallotExclusiveBitCount(result); + data[invocation].u4.w = subgroupBallotFindLSB(result) + subgroupBallotFindMSB(result); + + if ((relMask == result) && subgroupInverseBallot(data[0].u4)) + { + data[invocation].f4.x = subgroupBroadcast(data[0].f4.x, invocation); + data[invocation].f4.xy = subgroupBroadcast(data[1].f4.xy, invocation); + data[invocation].f4.xyz = subgroupBroadcast(data[2].f4.xyz, invocation); + data[invocation].f4 = subgroupBroadcast(data[3].f4, invocation); + + data[invocation].i4.x = subgroupBroadcast(data[0].i4.x, invocation); + data[invocation].i4.xy = subgroupBroadcast(data[1].i4.xy, invocation); + data[invocation].i4.xyz = subgroupBroadcast(data[2].i4.xyz, invocation); + data[invocation].i4 = subgroupBroadcast(data[3].i4, invocation); + + data[invocation].u4.x = subgroupBroadcast(data[0].u4.x, invocation); + data[invocation].u4.xy = subgroupBroadcast(data[1].u4.xy, invocation); + data[invocation].u4.xyz = subgroupBroadcast(data[2].u4.xyz, invocation); + data[invocation].u4 = subgroupBroadcast(data[3].u4, invocation); + + data[invocation].d4.x = subgroupBroadcast(data[0].d4.x, invocation); + data[invocation].d4.xy = subgroupBroadcast(data[1].d4.xy, invocation); + data[invocation].d4.xyz = subgroupBroadcast(data[2].d4.xyz, invocation); + data[invocation].d4 = subgroupBroadcast(data[3].d4, invocation); + + data[invocation].i4.x = int(subgroupBroadcast(data[0].i4.x < 0, invocation)); + data[invocation].i4.xy = ivec2(subgroupBroadcast(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[invocation].i4.xyz = ivec3(subgroupBroadcast(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[invocation].i4 = ivec4(subgroupBroadcast(lessThan(data[1].i4, ivec4(0)), invocation)); + } + else + { + data[invocation].f4.x = subgroupBroadcastFirst(data[0].f4.x); + data[invocation].f4.xy = subgroupBroadcastFirst(data[1].f4.xy); + data[invocation].f4.xyz = subgroupBroadcastFirst(data[2].f4.xyz); + data[invocation].f4 = subgroupBroadcastFirst(data[3].f4); + + data[invocation].i4.x = subgroupBroadcastFirst(data[0].i4.x); + data[invocation].i4.xy = subgroupBroadcastFirst(data[1].i4.xy); + data[invocation].i4.xyz = subgroupBroadcastFirst(data[2].i4.xyz); + data[invocation].i4 = subgroupBroadcastFirst(data[3].i4); + + data[invocation].u4.x = subgroupBroadcastFirst(data[0].u4.x); + data[invocation].u4.xy = subgroupBroadcastFirst(data[1].u4.xy); + data[invocation].u4.xyz = subgroupBroadcastFirst(data[2].u4.xyz); + data[invocation].u4 = subgroupBroadcastFirst(data[3].u4); + + data[invocation].d4.x = subgroupBroadcastFirst(data[0].d4.x); + data[invocation].d4.xy = subgroupBroadcastFirst(data[1].d4.xy); + data[invocation].d4.xyz = subgroupBroadcastFirst(data[2].d4.xyz); + data[invocation].d4 = subgroupBroadcastFirst(data[3].d4); + + data[invocation].i4.x = int(subgroupBroadcastFirst(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupBroadcastFirst(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupBroadcastFirst(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupBroadcastFirst(lessThan(data[1].i4, ivec4(0)))); + } +} diff --git a/deps/glslang/Test/spv.subgroupBasic.comp b/deps/glslang/Test/spv.subgroupBasic.comp new file mode 100644 index 00000000..4801c107 --- /dev/null +++ b/deps/glslang/Test/spv.subgroupBasic.comp @@ -0,0 +1,23 @@ +#version 450 + +#extension GL_KHR_shader_subgroup_basic: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffer +{ + int a[]; +} data; + +void main() +{ + data.a[gl_SubgroupSize] = 1; + data.a[gl_SubgroupInvocationID] = 1; + data.a[gl_NumSubgroups] = 1; + data.a[gl_SubgroupID] = (subgroupElect()) ? 1 : 0; + subgroupBarrier(); + subgroupMemoryBarrier(); + subgroupMemoryBarrierBuffer(); + subgroupMemoryBarrierShared(); + subgroupMemoryBarrierImage(); +} diff --git a/deps/glslang/Test/spv.subgroupClustered.comp b/deps/glslang/Test/spv.subgroupClustered.comp new file mode 100644 index 00000000..128a24c8 --- /dev/null +++ b/deps/glslang/Test/spv.subgroupClustered.comp @@ -0,0 +1,143 @@ +#version 450 + +#extension GL_KHR_shader_subgroup_clustered: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupClusteredAdd(data[0].f4.x, 1); + data[invocation].f4.xy = subgroupClusteredAdd(data[1].f4.xy, 1); + data[invocation].f4.xyz = subgroupClusteredAdd(data[2].f4.xyz, 1); + data[invocation].f4 = subgroupClusteredAdd(data[3].f4, 1); + + data[invocation].i4.x = subgroupClusteredAdd(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredAdd(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredAdd(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredAdd(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredAdd(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredAdd(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredAdd(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredAdd(data[3].u4, 1); + + data[invocation].d4.x = subgroupClusteredAdd(data[0].d4.x, 1); + data[invocation].d4.xy = subgroupClusteredAdd(data[1].d4.xy, 1); + data[invocation].d4.xyz = subgroupClusteredAdd(data[2].d4.xyz, 1); + data[invocation].d4 = subgroupClusteredAdd(data[3].d4, 1); + + data[invocation].f4.x = subgroupClusteredMul(data[0].f4.x, 1); + data[invocation].f4.xy = subgroupClusteredMul(data[1].f4.xy, 1); + data[invocation].f4.xyz = subgroupClusteredMul(data[2].f4.xyz, 1); + data[invocation].f4 = subgroupClusteredMul(data[3].f4, 1); + + data[invocation].i4.x = subgroupClusteredMul(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredMul(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredMul(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredMul(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredMul(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredMul(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredMul(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredMul(data[3].u4, 1); + + data[invocation].d4.x = subgroupClusteredMul(data[0].d4.x, 1); + data[invocation].d4.xy = subgroupClusteredMul(data[1].d4.xy, 1); + data[invocation].d4.xyz = subgroupClusteredMul(data[2].d4.xyz, 1); + data[invocation].d4 = subgroupClusteredMul(data[3].d4, 1); + + data[invocation].f4.x = subgroupClusteredMin(data[0].f4.x, 1); + data[invocation].f4.xy = subgroupClusteredMin(data[1].f4.xy, 1); + data[invocation].f4.xyz = subgroupClusteredMin(data[2].f4.xyz, 1); + data[invocation].f4 = subgroupClusteredMin(data[3].f4, 1); + + data[invocation].i4.x = subgroupClusteredMin(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredMin(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredMin(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredMin(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredMin(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredMin(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredMin(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredMin(data[3].u4, 1); + + data[invocation].d4.x = subgroupClusteredMin(data[0].d4.x, 1); + data[invocation].d4.xy = subgroupClusteredMin(data[1].d4.xy, 1); + data[invocation].d4.xyz = subgroupClusteredMin(data[2].d4.xyz, 1); + data[invocation].d4 = subgroupClusteredMin(data[3].d4, 1); + + data[invocation].f4.x = subgroupClusteredMax(data[0].f4.x, 1); + data[invocation].f4.xy = subgroupClusteredMax(data[1].f4.xy, 1); + data[invocation].f4.xyz = subgroupClusteredMax(data[2].f4.xyz, 1); + data[invocation].f4 = subgroupClusteredMax(data[3].f4, 1); + + data[invocation].i4.x = subgroupClusteredMax(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredMax(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredMax(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredMax(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredMax(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredMax(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredMax(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredMax(data[3].u4, 1); + + data[invocation].d4.x = subgroupClusteredMax(data[0].d4.x, 1); + data[invocation].d4.xy = subgroupClusteredMax(data[1].d4.xy, 1); + data[invocation].d4.xyz = subgroupClusteredMax(data[2].d4.xyz, 1); + data[invocation].d4 = subgroupClusteredMax(data[3].d4, 1); + + data[invocation].i4.x = subgroupClusteredAnd(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredAnd(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredAnd(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredAnd(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredAnd(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredAnd(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredAnd(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredAnd(data[3].u4, 1); + + data[invocation].i4.x = int(subgroupClusteredAnd(data[0].i4.x < 0, 1)); + data[invocation].i4.xy = ivec2(subgroupClusteredAnd(lessThan(data[1].i4.xy, ivec2(0)), 1)); + data[invocation].i4.xyz = ivec3(subgroupClusteredAnd(lessThan(data[1].i4.xyz, ivec3(0)), 1)); + data[invocation].i4 = ivec4(subgroupClusteredAnd(lessThan(data[1].i4, ivec4(0)), 1)); + + data[invocation].i4.x = subgroupClusteredOr(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredOr(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredOr(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredOr(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredOr(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredOr(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredOr(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredOr(data[3].u4, 1); + + data[invocation].i4.x = int(subgroupClusteredOr(data[0].i4.x < 0, 1)); + data[invocation].i4.xy = ivec2(subgroupClusteredOr(lessThan(data[1].i4.xy, ivec2(0)), 1)); + data[invocation].i4.xyz = ivec3(subgroupClusteredOr(lessThan(data[1].i4.xyz, ivec3(0)), 1)); + data[invocation].i4 = ivec4(subgroupClusteredOr(lessThan(data[1].i4, ivec4(0)), 1)); + + data[invocation].i4.x = subgroupClusteredXor(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredXor(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredXor(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredXor(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredXor(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredXor(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredXor(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredXor(data[3].u4, 1); + + data[invocation].i4.x = int(subgroupClusteredXor(data[0].i4.x < 0, 1)); + data[invocation].i4.xy = ivec2(subgroupClusteredXor(lessThan(data[1].i4.xy, ivec2(0)), 1)); + data[invocation].i4.xyz = ivec3(subgroupClusteredXor(lessThan(data[1].i4.xyz, ivec3(0)), 1)); + data[invocation].i4 = ivec4(subgroupClusteredXor(lessThan(data[1].i4, ivec4(0)), 1)); +} diff --git a/deps/glslang/Test/spv.subgroupClusteredNeg.comp b/deps/glslang/Test/spv.subgroupClusteredNeg.comp new file mode 100644 index 00000000..ec15413e --- /dev/null +++ b/deps/glslang/Test/spv.subgroupClusteredNeg.comp @@ -0,0 +1,39 @@ +#version 450 + +#extension GL_KHR_shader_subgroup_clustered: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + int a = 1; + const int aConst = 1; + + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.xy = subgroupClusteredAdd(data[1].f4.xy, 0); // ERROR, less than 1 + + data[invocation].f4.x = subgroupClusteredMul(data[0].f4.x, 3); // ERROR, not a power of 2 + + data[invocation].i4.xy = subgroupClusteredMin(data[1].i4.xy, 8); + data[invocation].i4.xyz = subgroupClusteredMin(data[2].i4.xyz, 6); // ERROR, not a power of 2 + + data[invocation].f4.x = subgroupClusteredMax(data[0].f4.x, -1); // ERROR, less than 1 + + data[invocation].i4 = subgroupClusteredAnd(data[3].i4, -3); // ERROR, less than 1 + + data[invocation].i4.x = subgroupClusteredOr(data[0].i4.x, a); // ERROR, not constant + data[invocation].i4.xy = subgroupClusteredOr(data[1].i4.xy, aConst); + + data[invocation].i4.x = subgroupClusteredXor(data[0].i4.x, 1 + a); // ERROR, not constant + data[invocation].i4.xy = subgroupClusteredXor(data[1].i4.xy, aConst + a); // ERROR, not constant + data[invocation].i4.xyz = subgroupClusteredXor(data[2].i4.xyz, 1 + aConst); +} diff --git a/deps/glslang/Test/spv.subgroupPartitioned.comp b/deps/glslang/Test/spv.subgroupPartitioned.comp new file mode 100644 index 00000000..604833e0 --- /dev/null +++ b/deps/glslang/Test/spv.subgroupPartitioned.comp @@ -0,0 +1,420 @@ +#version 450 + +#extension GL_NV_shader_subgroup_partitioned: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + uvec4 ballot = subgroupPartitionNV(invocation); + + data[invocation].u4 = subgroupPartitionNV(data[0].f4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].f4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].f4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].f4); + + data[invocation].u4 = subgroupPartitionNV(data[0].i4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].i4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].i4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].i4); + + data[invocation].u4 = subgroupPartitionNV(data[0].u4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].u4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].u4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].u4); + + data[invocation].u4 = subgroupPartitionNV(data[0].d4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].d4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].d4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].d4); + + data[invocation].u4 = subgroupPartitionNV(bool(data[0].i4.x)); + data[invocation].u4 = subgroupPartitionNV(bvec2(data[0].i4.xy)); + data[invocation].u4 = subgroupPartitionNV(bvec3(data[0].i4.xyz)); + data[invocation].u4 = subgroupPartitionNV(bvec4(data[0].i4)); + + data[invocation].f4.x = subgroupPartitionedAddNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedAddNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedAddNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedAddNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedAddNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedAddNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedAddNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedAddNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedAddNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedAddNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedAddNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedAddNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedAddNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedAddNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedAddNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedAddNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedMulNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedMulNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedMulNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedMulNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedMulNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedMulNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedMulNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedMulNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedMulNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedMulNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedMulNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedMulNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedMulNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedMulNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedMulNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedMulNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedMinNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedMinNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedMinNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedMinNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedMinNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedMinNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedMinNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedMinNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedMinNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedMinNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedMinNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedMinNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedMinNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedMinNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedMinNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedMinNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedMaxNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedMaxNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedMaxNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedMaxNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedMaxNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedMaxNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedMaxNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedMaxNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedMaxNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedMaxNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedMaxNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedMaxNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedMaxNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedMaxNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedMaxNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedMaxNV(data[3].d4, ballot); + + data[invocation].i4.x = subgroupPartitionedAndNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedAndNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedAndNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedAndNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedAndNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedAndNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedAndNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedAndNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedAndNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedOrNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedOrNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedOrNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedOrNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedOrNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedOrNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedOrNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedOrNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedOrNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedXorNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedXorNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedXorNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedXorNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedXorNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedXorNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedXorNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedXorNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedXorNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].f4.x = subgroupPartitionedInclusiveAddNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveAddNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveAddNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveAddNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveAddNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveAddNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveAddNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveAddNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveAddNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveAddNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveAddNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveAddNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveAddNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveAddNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveAddNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveAddNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedInclusiveMulNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveMulNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveMulNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveMulNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveMulNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveMulNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveMulNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveMulNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveMulNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveMulNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveMulNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveMulNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveMulNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveMulNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveMulNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveMulNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedInclusiveMinNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveMinNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveMinNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveMinNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveMinNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveMinNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveMinNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveMinNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveMinNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveMinNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveMinNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveMinNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveMinNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveMinNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveMinNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveMinNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedInclusiveMaxNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveMaxNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveMaxNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveMaxNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveMaxNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveMaxNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveMaxNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveMaxNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveMaxNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveMaxNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveMaxNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveMaxNV(data[3].d4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveAndNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveAndNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveAndNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveAndNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveAndNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveAndNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveAndNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveAndNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedInclusiveAndNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedInclusiveOrNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveOrNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveOrNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveOrNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveOrNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveOrNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveOrNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveOrNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedInclusiveOrNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedInclusiveXorNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveXorNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveXorNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveXorNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveXorNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveXorNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveXorNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveXorNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedInclusiveXorNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].f4.x = subgroupPartitionedExclusiveAddNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveAddNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveAddNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveAddNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveAddNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveAddNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveAddNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveAddNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveAddNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveAddNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveAddNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveAddNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveAddNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveAddNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveAddNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveAddNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedExclusiveMulNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveMulNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveMulNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveMulNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveMulNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveMulNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveMulNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveMulNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveMulNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveMulNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveMulNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveMulNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveMulNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveMulNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveMulNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveMulNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedExclusiveMinNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveMinNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveMinNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveMinNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveMinNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveMinNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveMinNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveMinNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveMinNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveMinNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveMinNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveMinNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveMinNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveMinNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveMinNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveMinNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedExclusiveMaxNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveMaxNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveMaxNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveMaxNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveMaxNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveMaxNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveMaxNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveMaxNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveMaxNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveMaxNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveMaxNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveMaxNV(data[3].d4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveAndNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveAndNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveAndNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveAndNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveAndNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveAndNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveAndNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveAndNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedExclusiveAndNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedExclusiveOrNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveOrNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveOrNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveOrNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveOrNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveOrNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveOrNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveOrNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedExclusiveOrNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedExclusiveXorNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveXorNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveXorNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveXorNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveXorNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveXorNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveXorNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveXorNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedExclusiveXorNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); +} diff --git a/deps/glslang/Test/spv.subgroupQuad.comp b/deps/glslang/Test/spv.subgroupQuad.comp new file mode 100644 index 00000000..223a7cda --- /dev/null +++ b/deps/glslang/Test/spv.subgroupQuad.comp @@ -0,0 +1,118 @@ +#version 450 + +#extension GL_KHR_shader_subgroup_quad: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupQuadBroadcast(data[0].f4.x, 1); + data[invocation].f4.xy = subgroupQuadBroadcast(data[1].f4.xy, 1); + data[invocation].f4.xyz = subgroupQuadBroadcast(data[2].f4.xyz, 1); + data[invocation].f4 = subgroupQuadBroadcast(data[3].f4, 1); + + data[invocation].i4.x = subgroupQuadBroadcast(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupQuadBroadcast(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupQuadBroadcast(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupQuadBroadcast(data[3].i4, 1); + + data[invocation].u4.x = subgroupQuadBroadcast(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupQuadBroadcast(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupQuadBroadcast(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupQuadBroadcast(data[3].u4, 1); + + data[invocation].d4.x = subgroupQuadBroadcast(data[0].d4.x, 1); + data[invocation].d4.xy = subgroupQuadBroadcast(data[1].d4.xy, 1); + data[invocation].d4.xyz = subgroupQuadBroadcast(data[2].d4.xyz, 1); + data[invocation].d4 = subgroupQuadBroadcast(data[3].d4, 1); + + data[invocation].i4.x = int(subgroupQuadBroadcast(data[0].i4.x < 0, 1)); + data[invocation].i4.xy = ivec2(subgroupQuadBroadcast(lessThan(data[1].i4.xy, ivec2(0)), 1)); + data[invocation].i4.xyz = ivec3(subgroupQuadBroadcast(lessThan(data[1].i4.xyz, ivec3(0)), 1)); + data[invocation].i4 = ivec4(subgroupQuadBroadcast(lessThan(data[1].i4, ivec4(0)), 1)); + + data[invocation].f4.x = subgroupQuadSwapHorizontal(data[0].f4.x); + data[invocation].f4.xy = subgroupQuadSwapHorizontal(data[1].f4.xy); + data[invocation].f4.xyz = subgroupQuadSwapHorizontal(data[2].f4.xyz); + data[invocation].f4 = subgroupQuadSwapHorizontal(data[3].f4); + + data[invocation].i4.x = subgroupQuadSwapHorizontal(data[0].i4.x); + data[invocation].i4.xy = subgroupQuadSwapHorizontal(data[1].i4.xy); + data[invocation].i4.xyz = subgroupQuadSwapHorizontal(data[2].i4.xyz); + data[invocation].i4 = subgroupQuadSwapHorizontal(data[3].i4); + + data[invocation].u4.x = subgroupQuadSwapHorizontal(data[0].u4.x); + data[invocation].u4.xy = subgroupQuadSwapHorizontal(data[1].u4.xy); + data[invocation].u4.xyz = subgroupQuadSwapHorizontal(data[2].u4.xyz); + data[invocation].u4 = subgroupQuadSwapHorizontal(data[3].u4); + + data[invocation].d4.x = subgroupQuadSwapHorizontal(data[0].d4.x); + data[invocation].d4.xy = subgroupQuadSwapHorizontal(data[1].d4.xy); + data[invocation].d4.xyz = subgroupQuadSwapHorizontal(data[2].d4.xyz); + data[invocation].d4 = subgroupQuadSwapHorizontal(data[3].d4); + + data[invocation].i4.x = int(subgroupQuadSwapHorizontal(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupQuadSwapHorizontal(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupQuadSwapHorizontal(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupQuadSwapHorizontal(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupQuadSwapVertical(data[0].f4.x); + data[invocation].f4.xy = subgroupQuadSwapVertical(data[1].f4.xy); + data[invocation].f4.xyz = subgroupQuadSwapVertical(data[2].f4.xyz); + data[invocation].f4 = subgroupQuadSwapVertical(data[3].f4); + + data[invocation].i4.x = subgroupQuadSwapVertical(data[0].i4.x); + data[invocation].i4.xy = subgroupQuadSwapVertical(data[1].i4.xy); + data[invocation].i4.xyz = subgroupQuadSwapVertical(data[2].i4.xyz); + data[invocation].i4 = subgroupQuadSwapVertical(data[3].i4); + + data[invocation].u4.x = subgroupQuadSwapVertical(data[0].u4.x); + data[invocation].u4.xy = subgroupQuadSwapVertical(data[1].u4.xy); + data[invocation].u4.xyz = subgroupQuadSwapVertical(data[2].u4.xyz); + data[invocation].u4 = subgroupQuadSwapVertical(data[3].u4); + + data[invocation].d4.x = subgroupQuadSwapVertical(data[0].d4.x); + data[invocation].d4.xy = subgroupQuadSwapVertical(data[1].d4.xy); + data[invocation].d4.xyz = subgroupQuadSwapVertical(data[2].d4.xyz); + data[invocation].d4 = subgroupQuadSwapVertical(data[3].d4); + + data[invocation].i4.x = int(subgroupQuadSwapVertical(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupQuadSwapVertical(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupQuadSwapVertical(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupQuadSwapVertical(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupQuadSwapDiagonal(data[0].f4.x); + data[invocation].f4.xy = subgroupQuadSwapDiagonal(data[1].f4.xy); + data[invocation].f4.xyz = subgroupQuadSwapDiagonal(data[2].f4.xyz); + data[invocation].f4 = subgroupQuadSwapDiagonal(data[3].f4); + + data[invocation].i4.x = subgroupQuadSwapDiagonal(data[0].i4.x); + data[invocation].i4.xy = subgroupQuadSwapDiagonal(data[1].i4.xy); + data[invocation].i4.xyz = subgroupQuadSwapDiagonal(data[2].i4.xyz); + data[invocation].i4 = subgroupQuadSwapDiagonal(data[3].i4); + + data[invocation].u4.x = subgroupQuadSwapDiagonal(data[0].u4.x); + data[invocation].u4.xy = subgroupQuadSwapDiagonal(data[1].u4.xy); + data[invocation].u4.xyz = subgroupQuadSwapDiagonal(data[2].u4.xyz); + data[invocation].u4 = subgroupQuadSwapDiagonal(data[3].u4); + + data[invocation].d4.x = subgroupQuadSwapDiagonal(data[0].d4.x); + data[invocation].d4.xy = subgroupQuadSwapDiagonal(data[1].d4.xy); + data[invocation].d4.xyz = subgroupQuadSwapDiagonal(data[2].d4.xyz); + data[invocation].d4 = subgroupQuadSwapDiagonal(data[3].d4); + + data[invocation].i4.x = int(subgroupQuadSwapDiagonal(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupQuadSwapDiagonal(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupQuadSwapDiagonal(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupQuadSwapDiagonal(lessThan(data[1].i4, ivec4(0)))); +} diff --git a/deps/glslang/Test/spv.subgroupShuffle.comp b/deps/glslang/Test/spv.subgroupShuffle.comp new file mode 100644 index 00000000..6d264882 --- /dev/null +++ b/deps/glslang/Test/spv.subgroupShuffle.comp @@ -0,0 +1,68 @@ +#version 450 + +#extension GL_KHR_shader_subgroup_shuffle: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupShuffle(data[0].f4.x, invocation); + data[invocation].f4.xy = subgroupShuffle(data[1].f4.xy, invocation); + data[invocation].f4.xyz = subgroupShuffle(data[2].f4.xyz, invocation); + data[invocation].f4 = subgroupShuffle(data[3].f4, invocation); + + data[invocation].i4.x = subgroupShuffle(data[0].i4.x, invocation); + data[invocation].i4.xy = subgroupShuffle(data[1].i4.xy, invocation); + data[invocation].i4.xyz = subgroupShuffle(data[2].i4.xyz, invocation); + data[invocation].i4 = subgroupShuffle(data[3].i4, invocation); + + data[invocation].u4.x = subgroupShuffle(data[0].u4.x, invocation); + data[invocation].u4.xy = subgroupShuffle(data[1].u4.xy, invocation); + data[invocation].u4.xyz = subgroupShuffle(data[2].u4.xyz, invocation); + data[invocation].u4 = subgroupShuffle(data[3].u4, invocation); + + data[invocation].d4.x = subgroupShuffle(data[0].d4.x, invocation); + data[invocation].d4.xy = subgroupShuffle(data[1].d4.xy, invocation); + data[invocation].d4.xyz = subgroupShuffle(data[2].d4.xyz, invocation); + data[invocation].d4 = subgroupShuffle(data[3].d4, invocation); + + data[invocation].i4.x = int(subgroupShuffle(data[0].i4.x < 0, invocation)); + data[invocation].i4.xy = ivec2(subgroupShuffle(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[invocation].i4.xyz = ivec3(subgroupShuffle(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[invocation].i4 = ivec4(subgroupShuffle(lessThan(data[1].i4, ivec4(0)), invocation)); + + data[invocation].f4.x = subgroupShuffleXor(data[0].f4.x, invocation); + data[invocation].f4.xy = subgroupShuffleXor(data[1].f4.xy, invocation); + data[invocation].f4.xyz = subgroupShuffleXor(data[2].f4.xyz, invocation); + data[invocation].f4 = subgroupShuffleXor(data[3].f4, invocation); + + data[invocation].i4.x = subgroupShuffleXor(data[0].i4.x, invocation); + data[invocation].i4.xy = subgroupShuffleXor(data[1].i4.xy, invocation); + data[invocation].i4.xyz = subgroupShuffleXor(data[2].i4.xyz, invocation); + data[invocation].i4 = subgroupShuffleXor(data[3].i4, invocation); + + data[invocation].u4.x = subgroupShuffleXor(data[0].u4.x, invocation); + data[invocation].u4.xy = subgroupShuffleXor(data[1].u4.xy, invocation); + data[invocation].u4.xyz = subgroupShuffleXor(data[2].u4.xyz, invocation); + data[invocation].u4 = subgroupShuffleXor(data[3].u4, invocation); + + data[invocation].d4.x = subgroupShuffleXor(data[0].d4.x, invocation); + data[invocation].d4.xy = subgroupShuffleXor(data[1].d4.xy, invocation); + data[invocation].d4.xyz = subgroupShuffleXor(data[2].d4.xyz, invocation); + data[invocation].d4 = subgroupShuffleXor(data[3].d4, invocation); + + data[invocation].i4.x = int(subgroupShuffleXor(data[0].i4.x < 0, invocation)); + data[invocation].i4.xy = ivec2(subgroupShuffleXor(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[invocation].i4.xyz = ivec3(subgroupShuffleXor(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[invocation].i4 = ivec4(subgroupShuffleXor(lessThan(data[1].i4, ivec4(0)), invocation)); +} diff --git a/deps/glslang/Test/spv.subgroupShuffleRelative.comp b/deps/glslang/Test/spv.subgroupShuffleRelative.comp new file mode 100644 index 00000000..1864de10 --- /dev/null +++ b/deps/glslang/Test/spv.subgroupShuffleRelative.comp @@ -0,0 +1,68 @@ +#version 450 + +#extension GL_KHR_shader_subgroup_shuffle_relative: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupShuffleUp(data[0].f4.x, invocation); + data[invocation].f4.xy = subgroupShuffleUp(data[1].f4.xy, invocation); + data[invocation].f4.xyz = subgroupShuffleUp(data[2].f4.xyz, invocation); + data[invocation].f4 = subgroupShuffleUp(data[3].f4, invocation); + + data[invocation].i4.x = subgroupShuffleUp(data[0].i4.x, invocation); + data[invocation].i4.xy = subgroupShuffleUp(data[1].i4.xy, invocation); + data[invocation].i4.xyz = subgroupShuffleUp(data[2].i4.xyz, invocation); + data[invocation].i4 = subgroupShuffleUp(data[3].i4, invocation); + + data[invocation].u4.x = subgroupShuffleUp(data[0].u4.x, invocation); + data[invocation].u4.xy = subgroupShuffleUp(data[1].u4.xy, invocation); + data[invocation].u4.xyz = subgroupShuffleUp(data[2].u4.xyz, invocation); + data[invocation].u4 = subgroupShuffleUp(data[3].u4, invocation); + + data[invocation].d4.x = subgroupShuffleUp(data[0].d4.x, invocation); + data[invocation].d4.xy = subgroupShuffleUp(data[1].d4.xy, invocation); + data[invocation].d4.xyz = subgroupShuffleUp(data[2].d4.xyz, invocation); + data[invocation].d4 = subgroupShuffleUp(data[3].d4, invocation); + + data[invocation].i4.x = int(subgroupShuffleUp(data[0].i4.x < 0, invocation)); + data[invocation].i4.xy = ivec2(subgroupShuffleUp(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[invocation].i4.xyz = ivec3(subgroupShuffleUp(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[invocation].i4 = ivec4(subgroupShuffleUp(lessThan(data[1].i4, ivec4(0)), invocation)); + + data[invocation].f4.x = subgroupShuffleDown(data[0].f4.x, invocation); + data[invocation].f4.xy = subgroupShuffleDown(data[1].f4.xy, invocation); + data[invocation].f4.xyz = subgroupShuffleDown(data[2].f4.xyz, invocation); + data[invocation].f4 = subgroupShuffleDown(data[3].f4, invocation); + + data[invocation].i4.x = subgroupShuffleDown(data[0].i4.x, invocation); + data[invocation].i4.xy = subgroupShuffleDown(data[1].i4.xy, invocation); + data[invocation].i4.xyz = subgroupShuffleDown(data[2].i4.xyz, invocation); + data[invocation].i4 = subgroupShuffleDown(data[3].i4, invocation); + + data[invocation].u4.x = subgroupShuffleDown(data[0].u4.x, invocation); + data[invocation].u4.xy = subgroupShuffleDown(data[1].u4.xy, invocation); + data[invocation].u4.xyz = subgroupShuffleDown(data[2].u4.xyz, invocation); + data[invocation].u4 = subgroupShuffleDown(data[3].u4, invocation); + + data[invocation].d4.x = subgroupShuffleDown(data[0].d4.x, invocation); + data[invocation].d4.xy = subgroupShuffleDown(data[1].d4.xy, invocation); + data[invocation].d4.xyz = subgroupShuffleDown(data[2].d4.xyz, invocation); + data[invocation].d4 = subgroupShuffleDown(data[3].d4, invocation); + + data[invocation].i4.x = int(subgroupShuffleDown(data[0].i4.x < 0, invocation)); + data[invocation].i4.xy = ivec2(subgroupShuffleDown(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[invocation].i4.xyz = ivec3(subgroupShuffleDown(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[invocation].i4 = ivec4(subgroupShuffleDown(lessThan(data[1].i4, ivec4(0)), invocation)); +} diff --git a/deps/glslang/Test/spv.subgroupVote.comp b/deps/glslang/Test/spv.subgroupVote.comp new file mode 100644 index 00000000..c1c877af --- /dev/null +++ b/deps/glslang/Test/spv.subgroupVote.comp @@ -0,0 +1,49 @@ +#version 450 + +#extension GL_KHR_shader_subgroup_vote: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; + int r; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + if (subgroupAll(data[invocation].r < 0)) + { + data[invocation].r = int(subgroupAllEqual(data[0].f4.x)); + data[invocation].r = int(subgroupAllEqual(data[1].f4.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].f4.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].f4)); + + data[invocation].r = int(subgroupAllEqual(data[0].i4.x)); + data[invocation].r = int(subgroupAllEqual(data[1].i4.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].i4.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].i4)); + + data[invocation].r = int(subgroupAllEqual(data[0].u4.x)); + data[invocation].r = int(subgroupAllEqual(data[1].u4.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].u4.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].u4)); + } + else if (subgroupAny(data[invocation].r < 0)) + { + data[invocation].r = int(subgroupAllEqual(data[0].d4.x)); + data[invocation].r = int(subgroupAllEqual(data[1].d4.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].d4.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].d4)); + + data[invocation].r = int(int(subgroupAllEqual(data[0].i4.x < 0))); + data[invocation].r = int(ivec2(subgroupAllEqual(lessThan(data[1].i4.xy, ivec2(0))))); + data[invocation].r = int(ivec3(subgroupAllEqual(lessThan(data[1].i4.xyz, ivec3(0))))); + data[invocation].r = int(ivec4(subgroupAllEqual(lessThan(data[1].i4, ivec4(0))))); + } +} diff --git a/deps/glslang/Test/spv.subpass.frag b/deps/glslang/Test/spv.subpass.frag new file mode 100644 index 00000000..42411d99 --- /dev/null +++ b/deps/glslang/Test/spv.subpass.frag @@ -0,0 +1,29 @@ +#version 400 + +layout(input_attachment_index = 1) uniform subpassInput sub; +layout(input_attachment_index = 2) uniform subpassInputMS subMS; +layout(input_attachment_index = 3) uniform isubpassInput isub; +layout(input_attachment_index = 4) uniform isubpassInputMS isubMS; +layout(input_attachment_index = 5) uniform usubpassInput usub; +layout(input_attachment_index = 6) uniform usubpassInputMS usubMS; + +out vec4 color; +out ivec4 icolor; +out uvec4 ucolor; + +void foo(isubpassInputMS sb) +{ + icolor += subpassLoad(sb, 3); +} + +void main() +{ + color = subpassLoad(sub); + color += subpassLoad(subMS, 3); + icolor = subpassLoad(isub); + icolor += subpassLoad(isubMS, 3); + ucolor = subpassLoad(usub); + ucolor += subpassLoad(usubMS, 3); + + foo(isubMS); +} diff --git a/deps/glslang/Test/spv.switch.frag b/deps/glslang/Test/spv.switch.frag new file mode 100644 index 00000000..1808086a --- /dev/null +++ b/deps/glslang/Test/spv.switch.frag @@ -0,0 +1,142 @@ +#version 310 es +precision mediump float; +flat in int c, d; +in float x; +out float color; +in vec4 v; + +vec4 foo1(vec4 v1, vec4 v2, int i1) +{ + switch (i1) + { + case 0: + return v1; + case 2: + case 1: + return v2; + case 3: + return v1 * v2; + } + + return vec4(0.0); +} + +vec4 foo2(vec4 v1, vec4 v2, int i1) +{ + switch (i1) + { + case 0: + return v1; + case 2: + return vec4(1.0); + case 1: + return v2; + case 3: + return v1 * v2; + } + + return vec4(0.0); +} + +void main() +{ + float f; + int a[2]; + int local = c; + + switch(++local) + { + } + + switch (c) { + case 1: + f = sin(x); + break; + case 2: + f = cos(x); + break; + default: + f = tan(x); + } + + switch (c) { + case 1: + f += sin(x); + case 2: + f += cos(x); + break; + default: + f += tan(x); + } + + switch (c) { + case 1: + f += sin(x); + break; + case 2: + f += cos(x); + break; + } + + switch (c) { + case 1: + f += sin(x); + break; + case 2: + switch (d) { + case 1: + f += x * x * x; + break; + case 2: + f += x * x; + break; + } + break; + default: + f += tan(x); + } + + for (int i = 0; i < 10; ++i) { + switch (c) { + case 1: + f += sin(x); + for (int j = 20; j < 30; ++j) { + ++f; + if (f < 100.2) + break; + } + break; + case 2: + f += cos(x); + break; + break; + default: + f += tan(x); + } + + if (f < 3.43) + break; + } + + switch (c) { + case 1: + f += sin(x); + break; + case 2: + // test no statements at end + } + + color = f + float(local); + + color += foo1(v,v,c).y; + color += foo2(v,v,c).z; + + switch (c) { + case 0: break; + default: + } + + switch (c) { + default: + } +} diff --git a/deps/glslang/Test/spv.swizzle.frag b/deps/glslang/Test/spv.swizzle.frag new file mode 100644 index 00000000..5a5a203c --- /dev/null +++ b/deps/glslang/Test/spv.swizzle.frag @@ -0,0 +1,52 @@ +#version 140 + +in float blend; +in vec4 u; +bool p; + +in vec2 t; + +void main() +{ + float blendscale = 1.789; + + vec4 w = u; + vec4 w_undef; // test undef + vec4 w_dep = u; // test dependent swizzles + vec4 w_reorder = u; // test reordering + vec4 w2 = u; + vec4 w_flow = u; // test flowControl + + w_reorder.z = blendscale; + + w.wy = t; + + w_reorder.x = blendscale; + + w2.xyzw = u.zwxy; + + w_reorder.y = blendscale; + + w_dep.xy = w2.xz; + w_dep.zw = t; + + w_undef.xy = u.zw; + + if (p) + w_flow.x = t.x; + else + w_flow.x = t.y; + + gl_FragColor = mix(w_reorder, w_undef, w * w2 * w_dep * w_flow); + + vec2 c = t; + vec4 rep = vec4(0.0, 0.0, 0.0, 1.0); + + if (c.x < 0.0) + c.x *= -1.0; + + if (c.x <= 1.0) + rep.x = 3.4; + + gl_FragColor += rep; +} diff --git a/deps/glslang/Test/spv.swizzleInversion.frag b/deps/glslang/Test/spv.swizzleInversion.frag new file mode 100644 index 00000000..9dca62f8 --- /dev/null +++ b/deps/glslang/Test/spv.swizzleInversion.frag @@ -0,0 +1,16 @@ +#version 450 + +in vec4 in4; +in vec3 in3; + +void main() +{ + vec3 v43 = interpolateAtCentroid(in4.wzx); + vec2 v42 = interpolateAtSample(in4.zx, 1); + vec4 v44 = interpolateAtOffset(in4.zyxw, vec2(2.0)); + float v41 = interpolateAtOffset(in4.y, vec2(2.0)); + + vec3 v33 = interpolateAtCentroid(in3.yzx); + vec2 v32 = interpolateAtSample(in3.zx, 1); + float v31 = interpolateAtOffset(in4.y, vec2(2.0)); +} diff --git a/deps/glslang/Test/spv.targetOpenGL.vert b/deps/glslang/Test/spv.targetOpenGL.vert new file mode 100644 index 00000000..501a3e56 --- /dev/null +++ b/deps/glslang/Test/spv.targetOpenGL.vert @@ -0,0 +1,10 @@ +#version 450 + +layout(constant_id = 3) const int a = 2; +layout(location = 2) uniform float f; +layout(location = 4, binding = 1) uniform sampler2D s1; +layout(binding = 2) uniform sampler2D s2; + +void main() +{ +} diff --git a/deps/glslang/Test/spv.targetVulkan.vert b/deps/glslang/Test/spv.targetVulkan.vert new file mode 100644 index 00000000..d879122b --- /dev/null +++ b/deps/glslang/Test/spv.targetVulkan.vert @@ -0,0 +1,9 @@ +#version 450 + +layout(constant_id = 3) const int a = 2; + +layout(push_constant) uniform pc { float f; }; + +void main() +{ +} diff --git a/deps/glslang/Test/spv.test.frag b/deps/glslang/Test/spv.test.frag new file mode 100644 index 00000000..3d4d8f96 --- /dev/null +++ b/deps/glslang/Test/spv.test.frag @@ -0,0 +1,22 @@ +#version 400 + +uniform sampler2D texSampler2D; +uniform sampler3D texSampler3D; + +in float blend; +in vec2 scale; +in vec4 u; + +in vec2 t; +in vec3 coords; + +void main() +{ + float blendscale = 1.789; + + vec4 v = texture(texSampler2D, (t + scale) / scale ).wzyx; + + vec4 w = texture(texSampler3D, coords) + v; + + gl_FragColor = mix(w, u, blend * blendscale); +} diff --git a/deps/glslang/Test/spv.test.vert b/deps/glslang/Test/spv.test.vert new file mode 100644 index 00000000..e2e16aa5 --- /dev/null +++ b/deps/glslang/Test/spv.test.vert @@ -0,0 +1,14 @@ +#version 140 + +in mat4 transform; + +attribute vec4 position; +in vec2 uv_in; + +out vec2 uv; + +void main() +{ + uv = uv_in; + gl_Position = transform * position; +} diff --git a/deps/glslang/Test/spv.texture.frag b/deps/glslang/Test/spv.texture.frag new file mode 100644 index 00000000..73884d1c --- /dev/null +++ b/deps/glslang/Test/spv.texture.frag @@ -0,0 +1,73 @@ +#version 140 + +uniform sampler1D texSampler1D; +uniform sampler2D texSampler2D; +uniform sampler3D texSampler3D; +uniform samplerCube texSamplerCube; +uniform sampler1DShadow shadowSampler1D; +uniform sampler2DShadow shadowSampler2D; + +varying float blend; +varying vec2 scale; +varying vec4 u; + +in vec2 t; +in vec2 coords2D; + +void main() +{ + float blendscale = 1.789; + float bias = 2.0; + float lod = 3.0; + float proj = 2.0; + float coords1D = 1.789; + vec3 coords3D = vec3(1.789, 2.718, 3.453); + vec4 coords4D = vec4(1.789, 2.718, 3.453, 2.0); + vec4 color = vec4(0.0, 0.0, 0.0, 0.0); + + color += texture (texSampler1D, coords1D); + color += texture (texSampler1D, coords1D, bias); + color += textureProj(texSampler1D, coords2D); + color += textureProj(texSampler1D, coords4D); + color += textureProj(texSampler1D, coords2D, bias); + color += textureProj(texSampler1D, coords4D, bias); + + color += texture (texSampler2D, coords2D); + color += texture (texSampler2D, coords2D, bias); + color += textureProj (texSampler2D, coords3D); + color += textureProj (texSampler2D, coords4D, bias); + + color += texture (texSampler3D, coords3D); + color += texture (texSampler3D, coords3D, bias); + color += textureProj (texSampler3D, coords4D); + color += textureProj (texSampler3D, coords4D, bias); + + color += texture (texSamplerCube, coords3D); + color += texture (texSamplerCube, coords3D, bias); + + color += texture (shadowSampler1D, coords3D); + color += texture (shadowSampler1D, coords3D, bias); + color += texture (shadowSampler2D, coords3D); + color += texture (shadowSampler2D, coords3D, bias); + color += textureProj (shadowSampler1D, coords4D); + color += textureProj (shadowSampler1D, coords4D, bias); + color += textureProj (shadowSampler2D, coords4D); + color += textureProj (shadowSampler2D, coords4D, bias); + + ivec2 iCoords2D = ivec2(0, 5); + int iLod = 1; + + color += texelFetch(texSampler2D, iCoords2D, iLod); + + vec2 gradX = dFdx(coords2D); + vec2 gradY = dFdy(coords2D); + const ivec2 offset = ivec2(3, -7); + + color += textureGrad(texSampler2D, coords2D, gradX, gradY); + color += textureProjGrad(texSampler2D, vec3(coords2D, proj), gradX, gradY); + color += textureGradOffset(texSampler2D, coords2D, gradX, gradY, offset); + color += textureProjGradOffset(texSampler2D, coords3D, gradX, gradY, offset); + color += textureGrad(shadowSampler2D, vec3(coords2D, lod), gradX, gradY); + + gl_FragColor = mix(color, u, blend * blendscale); +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.texture.sampler.transform.frag b/deps/glslang/Test/spv.texture.sampler.transform.frag new file mode 100644 index 00000000..872d9b04 --- /dev/null +++ b/deps/glslang/Test/spv.texture.sampler.transform.frag @@ -0,0 +1,13 @@ +#version 440 + +uniform sampler smp; +uniform texture2D tex; + +in vec2 coord; + +out vec4 color; + +void main() +{ + color = texture(sampler2D(tex, smp), coord); +} diff --git a/deps/glslang/Test/spv.texture.vert b/deps/glslang/Test/spv.texture.vert new file mode 100644 index 00000000..9b03bba0 --- /dev/null +++ b/deps/glslang/Test/spv.texture.vert @@ -0,0 +1,39 @@ +#version 140 + +uniform sampler1D texSampler1D; +uniform sampler2D texSampler2D; +uniform sampler3D texSampler3D; +uniform samplerCube texSamplerCube; +uniform sampler1DShadow shadowSampler1D; +uniform sampler2DShadow shadowSampler2D; + +in vec2 coords2D; + +void main() +{ + float lod = 3.0; + float coords1D = 1.789; + vec3 coords3D = vec3(1.789, 2.718, 3.453); + vec4 coords4D = vec4(1.789, 2.718, 3.453, 2.0); + vec4 color = vec4(0.0, 0.0, 0.0, 0.0); + + color += textureLod(texSampler1D, coords1D, lod); + color += textureProjLod(texSampler1D, coords2D, lod); + color += textureProjLod(texSampler1D, coords4D, lod); + + color += textureLod (texSampler2D, coords2D, lod); + color += textureProjLod (texSampler2D, coords3D, lod); + color += textureProjLod (texSampler2D, coords4D, lod); + + color += textureLod (texSampler3D, coords3D, lod); + color += textureProjLod (texSampler3D, coords4D, lod); + + color += textureLod (texSamplerCube, coords3D, lod); + + color += textureLod (shadowSampler1D, coords3D, lod); + color += textureLod (shadowSampler2D, coords3D, lod); + color += textureProjLod(shadowSampler1D, coords4D, lod); + color += textureProjLod(shadowSampler2D, coords4D, lod); + + gl_Position = color; +} diff --git a/deps/glslang/Test/spv.textureBuffer.vert b/deps/glslang/Test/spv.textureBuffer.vert new file mode 100644 index 00000000..fc6fa3ac --- /dev/null +++ b/deps/glslang/Test/spv.textureBuffer.vert @@ -0,0 +1,17 @@ +#version 450 + +uniform textureBuffer tBuf; +uniform sampler s; +uniform samplerBuffer sBuf; + +uniform utextureBuffer utBuf; +uniform itextureBuffer itBuf; + +void main() +{ + texelFetch(samplerBuffer(tBuf, s), 13); + texelFetch(sBuf, 13); + texelFetch(tBuf, 13); + texelFetch(utBuf, 13); + texelFetch(itBuf, 13); +} diff --git a/deps/glslang/Test/spv.textureGatherBiasLod.frag b/deps/glslang/Test/spv.textureGatherBiasLod.frag new file mode 100644 index 00000000..35bd035a --- /dev/null +++ b/deps/glslang/Test/spv.textureGatherBiasLod.frag @@ -0,0 +1,88 @@ +#version 450 core + +#extension GL_ARB_sparse_texture2: enable +#extension GL_AMD_texture_gather_bias_lod: enable + +uniform sampler2D s2D; +uniform sampler2DArray s2DArray; +uniform samplerCube sCube; +uniform samplerCubeArray sCubeArray; + +in vec2 c2; +in vec3 c3; +in vec4 c4; + +in float lod; +in float bias; + +out vec4 fragColor; + +void main() +{ + vec4 texel = vec4(0.0); + vec4 result = vec4(0.0); + + const ivec2 offsets[4] = { ivec2(0, 0), ivec2(0, 1), ivec2(1, 0), ivec2(1, 1) }; + + texel += textureGather(s2D, c2, 0, bias); + texel += textureGather(s2DArray, c3, 1, bias); + texel += textureGather(sCube, c3, 2, bias); + texel += textureGather(sCubeArray, c4, 3, bias); + + texel += textureGatherOffset(s2D, c2, offsets[0], 0, bias); + texel += textureGatherOffset(s2DArray, c3, offsets[1], 1, bias); + + texel += textureGatherOffsets(s2D, c2, offsets, 0, bias); + texel += textureGatherOffsets(s2DArray, c3, offsets, 1, bias); + + sparseTextureGatherARB(s2D, c2, result, 0, bias); + texel += result; + sparseTextureGatherARB(s2DArray, c3, result, 1, bias); + texel += result; + sparseTextureGatherARB(sCube, c3, result, 2, bias); + texel += result; + sparseTextureGatherARB(sCubeArray, c4, result, 2, bias); + texel += result; + + sparseTextureGatherOffsetARB(s2D, c2, offsets[0], result, 0, bias); + texel += result; + sparseTextureGatherOffsetARB(s2DArray, c3, offsets[1], result, 1, bias); + texel += result; + + sparseTextureGatherOffsetsARB(s2D, c2, offsets, result, 0, bias); + texel += result; + sparseTextureGatherOffsetsARB(s2DArray, c3, offsets, result, 1, bias); + texel += result; + + texel += textureGatherLodAMD(s2D, c2, lod); + texel += textureGatherLodAMD(s2DArray, c3, lod, 1); + texel += textureGatherLodAMD(sCube, c3, lod, 2); + texel += textureGatherLodAMD(sCubeArray, c4, lod, 3); + + texel += textureGatherLodOffsetAMD(s2D, c2, lod, offsets[0]); + texel += textureGatherLodOffsetAMD(s2DArray, c3, lod, offsets[1], 1); + + texel += textureGatherLodOffsetsAMD(s2D, c2, lod, offsets); + texel += textureGatherLodOffsetsAMD(s2DArray, c3, lod, offsets, 1); + + sparseTextureGatherLodAMD(s2D, c2, lod, result); + texel += result; + sparseTextureGatherLodAMD(s2DArray, c3, lod, result, 1); + texel += result; + sparseTextureGatherLodAMD(sCube, c3, lod, result, 2); + texel += result; + sparseTextureGatherLodAMD(sCubeArray, c4, lod, result, 2); + texel += result; + + sparseTextureGatherLodOffsetAMD(s2D, c2, lod, offsets[0], result); + texel += result; + sparseTextureGatherLodOffsetAMD(s2DArray, c3, lod, offsets[1], result, 1); + texel += result; + + sparseTextureGatherLodOffsetsAMD(s2D, c2, lod, offsets, result); + texel += result; + sparseTextureGatherLodOffsetsAMD(s2DArray, c3, lod, offsets, result, 1); + texel += result; + + fragColor = texel; +} diff --git a/deps/glslang/Test/spv.types.frag b/deps/glslang/Test/spv.types.frag new file mode 100644 index 00000000..a2ab1d32 --- /dev/null +++ b/deps/glslang/Test/spv.types.frag @@ -0,0 +1,78 @@ +#version 140 + +bool u_b; +bvec2 u_b2; +bvec3 u_b3; +bvec4 u_b4; +flat in int u_i; +flat in ivec2 u_i2; +flat in ivec3 u_i3; +flat in ivec4 u_i4; + in float u_f; + in vec2 u_f2; + in vec3 u_f3; + in vec4 u_f4; +bool i_b; +bvec2 i_b2; +bvec3 i_b3; +bvec4 i_b4; + +flat in int i_i; +flat in ivec2 i_i2; +flat in ivec3 i_i3; +flat in ivec4 i_i4; + +in float i_f; +in vec2 i_f2; +in vec3 i_f3; +in vec4 i_f4; + +void main() +{ + bool b = u_b && i_b; + bvec2 b2 = bvec2(u_b2.x && i_b2.x && u_b2.y && i_b2.y); + bvec3 b3 = bvec3(u_b3.x && i_b3.x && u_b3.y && i_b3.y && u_b3.z && i_b3.z); + bvec4 b4 = bvec4(u_b4.x && i_b4.x && u_b4.y && i_b4.y && u_b4.z && i_b4.z && u_b4.w && i_b4.w); + + int i = u_i + i_i; + ivec2 i2 = u_i2 + i_i2; + ivec3 i3 = u_i3 + i_i3; + ivec4 i4 = u_i4 + i_i4; + + float f = u_f + i_f; + vec2 f2 = u_f2 + i_f2; + vec3 f3 = u_f3 + i_f3; + vec4 f4 = u_f4 + i_f4; + + gl_FragColor = + b || + b2.x || + b2.y || + b3.x || + b3.y || + b3.z || + b4.x || + b4.y || + b4.z || + b4.w ? vec4( + i + + i2.x + + i2.y + + i3.x + + i3.y + + i3.z + + i4.x + + i4.y + + i4.z + + i4.w + + f + + f2.x + + f2.y + + f3.x + + f3.y + + f3.z + + f4.x + + f4.y + + f4.z + + f4.w) : vec4(1.0); +} diff --git a/deps/glslang/Test/spv.uint.frag b/deps/glslang/Test/spv.uint.frag new file mode 100644 index 00000000..853de7c4 --- /dev/null +++ b/deps/glslang/Test/spv.uint.frag @@ -0,0 +1,102 @@ +#version 310 es +precision mediump float; +flat in uvec2 t; +in float f; +in vec2 tc; + +flat in uvec4 v; +flat in int i; +bool b; + +out uvec4 c; + +uniform mediump usampler2D usampler; + +void main() +{ + int count = 1; + + uint u = t.y + 3u; + const uint cu1 = 0xFFFFFFFFU; + const uint cu2 = -1u; // 0xFFFFFFFF + const uint cu3 = 1U; + const uint cu4 = 1u; + + if (cu1 == cu2) + count *= 2; // 2 + if (cu3 == cu4) + count *= 3; // 6 + if (cu2 == cu3) + count *= 5; // not done + + const int cshiftedii = 0xFFFFFFFF >> 10; + const uint cushiftedui = 0xFFFFFFFFu >> 10; + const int cshiftediu = 0xFFFFFFFF >> 10u; + const uint cushifteduu = 0xFFFFFFFFu >> 10u; + + if (cshiftedii == cshiftediu) + count *= 7; // 42 + if (cushiftedui == cushifteduu) + count *= 11; // 462 + if (cshiftedii == int(cushiftedui)) + count *= 13; // not done + + int shiftedii = 0xFFFFFFFF >> 10; + uint shiftedui = 0xFFFFFFFFu >> 10; + int shiftediu = 0xFFFFFFFF >> 10u; + uint shifteduu = 0xFFFFFFFFu >> 10u; + + if (shiftedii == shiftediu) + c = texture(usampler, tc); + if (shiftedui == shifteduu) + c = texture(usampler, tc + float(1u)); + if (shiftedii == int(shiftedui)) + c = texture(usampler, tc - vec2(2u)); + + if (t.x > 4u) { + float af = float(u); + bool ab = bool(u); + int ai = int(u); + + c += uvec4(uint(af), uint(ab), uint(ai), count); + } + + const uint cmask1 = 0x0A1u; + const uint cmask2 = 0xA10u; + const uint cmask3 = cmask1 << 4; + const uint cmask4 = 0xAB1u; + + if (cmask3 == cmask2) + count *= 17; // 7854 + + if ((cmask3 & cmask1) != 0u) + count *= 19; // not done + + if ((cmask1 | cmask3) == cmask4) + count *= 23; // 180642 + + if ((cmask1 ^ cmask4) == 0xA10u) + count *= 27; // 4877334 + + uint mask1 = 0x0A1u; + uint mask2 = 0xA10u; + uint mask3 = mask1 << 4; + uint mask4 = 0xAB1u; + + if (mask3 == mask2) + count *= 2; // 9754668 + + if ((mask3 & mask1) != 0u) + count *= 3; // not done + + if ((mask1 | mask3) == mask4) + count *= 5; // 48773340 + + if ((mask1 ^ mask4) == 0xA10u) + count *= 7; // 341413380 + + c += uvec4(count); + + #define UINT_MAX 4294967295u + c.x += UINT_MAX; +} diff --git a/deps/glslang/Test/spv.uniformArray.frag b/deps/glslang/Test/spv.uniformArray.frag new file mode 100644 index 00000000..b7625afe --- /dev/null +++ b/deps/glslang/Test/spv.uniformArray.frag @@ -0,0 +1,17 @@ +#version 140 + +uniform sampler2D texSampler2D; +in vec3 inColor; +in vec4 color[6]; +in float alpha[16]; + +void main() +{ + vec4 texColor = color[1] + color[1]; + + texColor.xyz += inColor; + + texColor.a += alpha[12]; + + gl_FragColor = texColor; +} diff --git a/deps/glslang/Test/spv.unit1.frag b/deps/glslang/Test/spv.unit1.frag new file mode 100644 index 00000000..d84f821e --- /dev/null +++ b/deps/glslang/Test/spv.unit1.frag @@ -0,0 +1,16 @@ +#version 460 + +float f; +float a1; + +float foo(); + +out float cout; + +void main() +{ + f = 10; + float g = foo(); + f += g; + f += gl_FragCoord.y; +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.unit2.frag b/deps/glslang/Test/spv.unit2.frag new file mode 100644 index 00000000..d17e7e7b --- /dev/null +++ b/deps/glslang/Test/spv.unit2.frag @@ -0,0 +1,17 @@ +#version 410 +// a different version number makes different id's for the same shared symbol + +float a2; +float f; + +float bar(); + +out float cout; +in float cin; + +float foo() +{ + float h2 = 2 * f + cin; + float g2 = bar(); + return h2 + g2 + gl_FragCoord.y; +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.unit3.frag b/deps/glslang/Test/spv.unit3.frag new file mode 100644 index 00000000..4c965975 --- /dev/null +++ b/deps/glslang/Test/spv.unit3.frag @@ -0,0 +1,15 @@ +#version 460 + +float f; +float h3 = 3.0; + +out float cout; +in float cin; + +float bar() +{ + h3 *= f; + float g3 = 2 * h3; + cout = g3; + return h3 + g3 + gl_FragCoord.y; +} diff --git a/deps/glslang/Test/spv.variableArrayIndex.frag b/deps/glslang/Test/spv.variableArrayIndex.frag new file mode 100644 index 00000000..cc304b8e --- /dev/null +++ b/deps/glslang/Test/spv.variableArrayIndex.frag @@ -0,0 +1,49 @@ +#version 400 + +uniform sampler2D samp2D; +in vec2 coord; + +struct lunarStruct1 { + int i; + float f; +}; + +struct lunarStruct2 { + int i; + float f; + lunarStruct1 s1_1; +}; + +struct lunarStruct3 { + lunarStruct2 s2_1[3]; + int i; + float f; + lunarStruct1 s1_1; +}; + + +flat in lunarStruct1 foo; +flat in lunarStruct2 foo2[5]; +flat in lunarStruct3 foo3; +flat in int Count; + +void main() +{ + float scale; + int iLocal = Count; + + if (foo3.s2_1[1].i > 0) + scale = foo2[foo3.s2_1[foo.i].i + 2 + ++iLocal].s1_1.f; + else + scale = foo3.s2_1[0].s1_1.f; + + //for (int i = 0; i < iLocal; ++i) { + // scale += foo2[i].f; + //} + + gl_FragColor = scale * texture(samp2D, coord); + + vec2[3] constructed = vec2[3](coord, vec2(scale), vec2(1.0, 2.0)); + gl_FragColor += vec4(constructed[foo.i], constructed[foo.i]); +} + diff --git a/deps/glslang/Test/spv.varyingArray.frag b/deps/glslang/Test/spv.varyingArray.frag new file mode 100644 index 00000000..f6e043f2 --- /dev/null +++ b/deps/glslang/Test/spv.varyingArray.frag @@ -0,0 +1,19 @@ +#version 140 +uniform sampler2D texSampler2D; +in vec4 color; +in float alpha; + +in vec4 TexCoord[6]; + +in vec4 foo[3]; + +void main() +{ + vec4 texColor = texture(texSampler2D, vec2(TexCoord[4] + TexCoord[5])); + + texColor += color; + + texColor.a = alpha; + + gl_FragColor = foo[1] + TexCoord[0] + TexCoord[4] + texColor; +} diff --git a/deps/glslang/Test/spv.varyingArrayIndirect.frag b/deps/glslang/Test/spv.varyingArrayIndirect.frag new file mode 100644 index 00000000..a556c9eb --- /dev/null +++ b/deps/glslang/Test/spv.varyingArrayIndirect.frag @@ -0,0 +1,21 @@ +#version 140 +uniform sampler2D texSampler2D; +in vec4 color; +in float alpha; + +in vec4 TexCoord[6]; + +in vec4 userIn[2]; + +flat in int a, b; + +void main() +{ + vec4 texColor = texture(texSampler2D, vec2(userIn[b] + TexCoord[a] + TexCoord[5])); + + texColor += color; + + texColor.a = alpha; + + gl_FragColor = TexCoord[0] + TexCoord[b] + texColor + userIn[a]; +} diff --git a/deps/glslang/Test/spv.vecMatConstruct.frag b/deps/glslang/Test/spv.vecMatConstruct.frag new file mode 100644 index 00000000..54a00170 --- /dev/null +++ b/deps/glslang/Test/spv.vecMatConstruct.frag @@ -0,0 +1,14 @@ +#version 450 + +void main() +{ + mat4x3 m; + + vec2 v2 = vec2(m); + vec3 v3 = vec3(m); + vec4 v4 = vec4(m); + + ivec2 iv2 = ivec2(m); + ivec3 iv3 = ivec3(m); + ivec4 iv4 = ivec4(m); +} diff --git a/deps/glslang/Test/spv.viewportArray2.tesc b/deps/glslang/Test/spv.viewportArray2.tesc new file mode 100644 index 00000000..7fc208a4 --- /dev/null +++ b/deps/glslang/Test/spv.viewportArray2.tesc @@ -0,0 +1,16 @@ +#version 450 +#extension GL_NV_viewport_array2 :require + +layout(vertices = 4) out; + +out gl_PerVertex { + int gl_ViewportMask[2]; +} gl_out[4]; + +layout (viewport_relative) out highp int gl_Layer; + +void main() +{ + gl_out[gl_InvocationID].gl_ViewportMask[0] = 1; + gl_ViewportIndex = 2; +} diff --git a/deps/glslang/Test/spv.viewportArray2.vert b/deps/glslang/Test/spv.viewportArray2.vert new file mode 100644 index 00000000..a373d5e8 --- /dev/null +++ b/deps/glslang/Test/spv.viewportArray2.vert @@ -0,0 +1,10 @@ +#version 450 +#extension GL_ARB_shader_viewport_layer_array : require +#extension GL_NV_viewport_array2 : require + +layout (viewport_relative) out highp int gl_Layer; +void main() +{ + gl_ViewportMask[0] = 1; + gl_ViewportIndex = 2; +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.voidFunction.frag b/deps/glslang/Test/spv.voidFunction.frag new file mode 100644 index 00000000..228ea1ff --- /dev/null +++ b/deps/glslang/Test/spv.voidFunction.frag @@ -0,0 +1,34 @@ +#version 400 + +in vec4 bigColor; +in vec4 BaseColor; +in float d; + +float bar = 2.0; + +void foo() +{ + bar++; + + return; +} + +void foo2() +{ + bar++; +} + +void main() +{ + vec4 outColor = bigColor; + + foo(); + + foo2(); + + outColor.x += bar; + + gl_FragColor = outColor; + + return; +} diff --git a/deps/glslang/Test/spv.vulkan100.subgroupArithmetic.comp b/deps/glslang/Test/spv.vulkan100.subgroupArithmetic.comp new file mode 100644 index 00000000..6cc9337b --- /dev/null +++ b/deps/glslang/Test/spv.vulkan100.subgroupArithmetic.comp @@ -0,0 +1,393 @@ +#version 450 + +#extension GL_KHR_shader_subgroup_arithmetic: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupAdd(data[0].f4.x); + data[invocation].f4.xy = subgroupAdd(data[1].f4.xy); + data[invocation].f4.xyz = subgroupAdd(data[2].f4.xyz); + data[invocation].f4 = subgroupAdd(data[3].f4); + + data[invocation].i4.x = subgroupAdd(data[0].i4.x); + data[invocation].i4.xy = subgroupAdd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupAdd(data[2].i4.xyz); + data[invocation].i4 = subgroupAdd(data[3].i4); + + data[invocation].u4.x = subgroupAdd(data[0].u4.x); + data[invocation].u4.xy = subgroupAdd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupAdd(data[2].u4.xyz); + data[invocation].u4 = subgroupAdd(data[3].u4); + + data[invocation].d4.x = subgroupAdd(data[0].d4.x); + data[invocation].d4.xy = subgroupAdd(data[1].d4.xy); + data[invocation].d4.xyz = subgroupAdd(data[2].d4.xyz); + data[invocation].d4 = subgroupAdd(data[3].d4); + + data[invocation].f4.x = subgroupMul(data[0].f4.x); + data[invocation].f4.xy = subgroupMul(data[1].f4.xy); + data[invocation].f4.xyz = subgroupMul(data[2].f4.xyz); + data[invocation].f4 = subgroupMul(data[3].f4); + + data[invocation].i4.x = subgroupMul(data[0].i4.x); + data[invocation].i4.xy = subgroupMul(data[1].i4.xy); + data[invocation].i4.xyz = subgroupMul(data[2].i4.xyz); + data[invocation].i4 = subgroupMul(data[3].i4); + + data[invocation].u4.x = subgroupMul(data[0].u4.x); + data[invocation].u4.xy = subgroupMul(data[1].u4.xy); + data[invocation].u4.xyz = subgroupMul(data[2].u4.xyz); + data[invocation].u4 = subgroupMul(data[3].u4); + + data[invocation].d4.x = subgroupMul(data[0].d4.x); + data[invocation].d4.xy = subgroupMul(data[1].d4.xy); + data[invocation].d4.xyz = subgroupMul(data[2].d4.xyz); + data[invocation].d4 = subgroupMul(data[3].d4); + + data[invocation].f4.x = subgroupMin(data[0].f4.x); + data[invocation].f4.xy = subgroupMin(data[1].f4.xy); + data[invocation].f4.xyz = subgroupMin(data[2].f4.xyz); + data[invocation].f4 = subgroupMin(data[3].f4); + + data[invocation].i4.x = subgroupMin(data[0].i4.x); + data[invocation].i4.xy = subgroupMin(data[1].i4.xy); + data[invocation].i4.xyz = subgroupMin(data[2].i4.xyz); + data[invocation].i4 = subgroupMin(data[3].i4); + + data[invocation].u4.x = subgroupMin(data[0].u4.x); + data[invocation].u4.xy = subgroupMin(data[1].u4.xy); + data[invocation].u4.xyz = subgroupMin(data[2].u4.xyz); + data[invocation].u4 = subgroupMin(data[3].u4); + + data[invocation].d4.x = subgroupMin(data[0].d4.x); + data[invocation].d4.xy = subgroupMin(data[1].d4.xy); + data[invocation].d4.xyz = subgroupMin(data[2].d4.xyz); + data[invocation].d4 = subgroupMin(data[3].d4); + + data[invocation].f4.x = subgroupMax(data[0].f4.x); + data[invocation].f4.xy = subgroupMax(data[1].f4.xy); + data[invocation].f4.xyz = subgroupMax(data[2].f4.xyz); + data[invocation].f4 = subgroupMax(data[3].f4); + + data[invocation].i4.x = subgroupMax(data[0].i4.x); + data[invocation].i4.xy = subgroupMax(data[1].i4.xy); + data[invocation].i4.xyz = subgroupMax(data[2].i4.xyz); + data[invocation].i4 = subgroupMax(data[3].i4); + + data[invocation].u4.x = subgroupMax(data[0].u4.x); + data[invocation].u4.xy = subgroupMax(data[1].u4.xy); + data[invocation].u4.xyz = subgroupMax(data[2].u4.xyz); + data[invocation].u4 = subgroupMax(data[3].u4); + + data[invocation].d4.x = subgroupMax(data[0].d4.x); + data[invocation].d4.xy = subgroupMax(data[1].d4.xy); + data[invocation].d4.xyz = subgroupMax(data[2].d4.xyz); + data[invocation].d4 = subgroupMax(data[3].d4); + + data[invocation].i4.x = subgroupAnd(data[0].i4.x); + data[invocation].i4.xy = subgroupAnd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupAnd(data[2].i4.xyz); + data[invocation].i4 = subgroupAnd(data[3].i4); + + data[invocation].u4.x = subgroupAnd(data[0].u4.x); + data[invocation].u4.xy = subgroupAnd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupAnd(data[2].u4.xyz); + data[invocation].u4 = subgroupAnd(data[3].u4); + + data[invocation].i4.x = int(subgroupAnd(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupAnd(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupOr(data[0].i4.x); + data[invocation].i4.xy = subgroupOr(data[1].i4.xy); + data[invocation].i4.xyz = subgroupOr(data[2].i4.xyz); + data[invocation].i4 = subgroupOr(data[3].i4); + + data[invocation].u4.x = subgroupOr(data[0].u4.x); + data[invocation].u4.xy = subgroupOr(data[1].u4.xy); + data[invocation].u4.xyz = subgroupOr(data[2].u4.xyz); + data[invocation].u4 = subgroupOr(data[3].u4); + + data[invocation].i4.x = int(subgroupOr(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupOr(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupXor(data[0].i4.x); + data[invocation].i4.xy = subgroupXor(data[1].i4.xy); + data[invocation].i4.xyz = subgroupXor(data[2].i4.xyz); + data[invocation].i4 = subgroupXor(data[3].i4); + + data[invocation].u4.x = subgroupXor(data[0].u4.x); + data[invocation].u4.xy = subgroupXor(data[1].u4.xy); + data[invocation].u4.xyz = subgroupXor(data[2].u4.xyz); + data[invocation].u4 = subgroupXor(data[3].u4); + + data[invocation].i4.x = int(subgroupXor(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupXor(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupInclusiveAdd(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveAdd(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveAdd(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveAdd(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveAdd(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveAdd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveAdd(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveAdd(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveAdd(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveAdd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveAdd(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveAdd(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveAdd(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveAdd(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveAdd(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveAdd(data[3].d4); + + data[invocation].f4.x = subgroupInclusiveMul(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveMul(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveMul(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveMul(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveMul(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveMul(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveMul(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveMul(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveMul(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveMul(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveMul(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveMul(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveMul(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveMul(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveMul(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveMul(data[3].d4); + + data[invocation].f4.x = subgroupInclusiveMin(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveMin(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveMin(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveMin(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveMin(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveMin(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveMin(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveMin(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveMin(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveMin(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveMin(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveMin(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveMin(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveMin(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveMin(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveMin(data[3].d4); + + data[invocation].f4.x = subgroupInclusiveMax(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveMax(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveMax(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveMax(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveMax(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveMax(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveMax(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveMax(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveMax(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveMax(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveMax(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveMax(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveMax(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveMax(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveMax(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveMax(data[3].d4); + + data[invocation].i4.x = subgroupInclusiveAnd(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveAnd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveAnd(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveAnd(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveAnd(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveAnd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveAnd(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveAnd(data[3].u4); + + data[invocation].i4.x = int(subgroupInclusiveAnd(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupInclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupInclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupInclusiveAnd(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupInclusiveOr(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveOr(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveOr(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveOr(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveOr(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveOr(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveOr(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveOr(data[3].u4); + + data[invocation].i4.x = int(subgroupInclusiveOr(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupInclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupInclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupInclusiveOr(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupInclusiveXor(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveXor(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveXor(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveXor(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveXor(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveXor(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveXor(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveXor(data[3].u4); + + data[invocation].i4.x = int(subgroupInclusiveXor(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupInclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupInclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupInclusiveXor(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupExclusiveAdd(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveAdd(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveAdd(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveAdd(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveAdd(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveAdd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveAdd(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveAdd(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveAdd(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveAdd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveAdd(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveAdd(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveAdd(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveAdd(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveAdd(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveAdd(data[3].d4); + + data[invocation].f4.x = subgroupExclusiveMul(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveMul(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveMul(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveMul(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveMul(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveMul(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveMul(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveMul(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveMul(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveMul(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveMul(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveMul(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveMul(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveMul(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveMul(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveMul(data[3].d4); + + data[invocation].f4.x = subgroupExclusiveMin(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveMin(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveMin(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveMin(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveMin(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveMin(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveMin(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveMin(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveMin(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveMin(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveMin(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveMin(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveMin(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveMin(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveMin(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveMin(data[3].d4); + + data[invocation].f4.x = subgroupExclusiveMax(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveMax(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveMax(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveMax(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveMax(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveMax(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveMax(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveMax(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveMax(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveMax(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveMax(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveMax(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveMax(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveMax(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveMax(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveMax(data[3].d4); + + data[invocation].i4.x = subgroupExclusiveAnd(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveAnd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveAnd(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveAnd(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveAnd(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveAnd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveAnd(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveAnd(data[3].u4); + + data[invocation].i4.x = int(subgroupExclusiveAnd(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupExclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupExclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupExclusiveAnd(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupExclusiveOr(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveOr(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveOr(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveOr(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveOr(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveOr(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveOr(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveOr(data[3].u4); + + data[invocation].i4.x = int(subgroupExclusiveOr(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupExclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupExclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupExclusiveOr(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupExclusiveXor(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveXor(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveXor(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveXor(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveXor(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveXor(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveXor(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveXor(data[3].u4); + + data[invocation].i4.x = int(subgroupExclusiveXor(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupExclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupExclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupExclusiveXor(lessThan(data[1].i4, ivec4(0)))); +} diff --git a/deps/glslang/Test/spv.vulkan100.subgroupPartitioned.comp b/deps/glslang/Test/spv.vulkan100.subgroupPartitioned.comp new file mode 100644 index 00000000..604833e0 --- /dev/null +++ b/deps/glslang/Test/spv.vulkan100.subgroupPartitioned.comp @@ -0,0 +1,420 @@ +#version 450 + +#extension GL_NV_shader_subgroup_partitioned: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + uvec4 ballot = subgroupPartitionNV(invocation); + + data[invocation].u4 = subgroupPartitionNV(data[0].f4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].f4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].f4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].f4); + + data[invocation].u4 = subgroupPartitionNV(data[0].i4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].i4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].i4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].i4); + + data[invocation].u4 = subgroupPartitionNV(data[0].u4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].u4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].u4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].u4); + + data[invocation].u4 = subgroupPartitionNV(data[0].d4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].d4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].d4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].d4); + + data[invocation].u4 = subgroupPartitionNV(bool(data[0].i4.x)); + data[invocation].u4 = subgroupPartitionNV(bvec2(data[0].i4.xy)); + data[invocation].u4 = subgroupPartitionNV(bvec3(data[0].i4.xyz)); + data[invocation].u4 = subgroupPartitionNV(bvec4(data[0].i4)); + + data[invocation].f4.x = subgroupPartitionedAddNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedAddNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedAddNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedAddNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedAddNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedAddNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedAddNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedAddNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedAddNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedAddNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedAddNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedAddNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedAddNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedAddNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedAddNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedAddNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedMulNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedMulNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedMulNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedMulNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedMulNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedMulNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedMulNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedMulNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedMulNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedMulNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedMulNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedMulNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedMulNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedMulNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedMulNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedMulNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedMinNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedMinNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedMinNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedMinNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedMinNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedMinNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedMinNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedMinNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedMinNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedMinNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedMinNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedMinNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedMinNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedMinNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedMinNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedMinNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedMaxNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedMaxNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedMaxNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedMaxNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedMaxNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedMaxNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedMaxNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedMaxNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedMaxNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedMaxNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedMaxNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedMaxNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedMaxNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedMaxNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedMaxNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedMaxNV(data[3].d4, ballot); + + data[invocation].i4.x = subgroupPartitionedAndNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedAndNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedAndNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedAndNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedAndNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedAndNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedAndNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedAndNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedAndNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedOrNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedOrNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedOrNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedOrNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedOrNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedOrNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedOrNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedOrNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedOrNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedXorNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedXorNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedXorNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedXorNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedXorNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedXorNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedXorNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedXorNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedXorNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].f4.x = subgroupPartitionedInclusiveAddNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveAddNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveAddNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveAddNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveAddNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveAddNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveAddNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveAddNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveAddNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveAddNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveAddNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveAddNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveAddNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveAddNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveAddNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveAddNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedInclusiveMulNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveMulNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveMulNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveMulNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveMulNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveMulNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveMulNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveMulNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveMulNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveMulNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveMulNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveMulNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveMulNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveMulNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveMulNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveMulNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedInclusiveMinNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveMinNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveMinNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveMinNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveMinNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveMinNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveMinNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveMinNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveMinNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveMinNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveMinNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveMinNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveMinNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveMinNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveMinNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveMinNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedInclusiveMaxNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveMaxNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveMaxNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveMaxNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveMaxNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveMaxNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveMaxNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveMaxNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveMaxNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveMaxNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveMaxNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveMaxNV(data[3].d4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveAndNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveAndNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveAndNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveAndNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveAndNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveAndNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveAndNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveAndNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedInclusiveAndNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedInclusiveOrNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveOrNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveOrNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveOrNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveOrNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveOrNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveOrNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveOrNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedInclusiveOrNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedInclusiveXorNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveXorNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveXorNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveXorNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveXorNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveXorNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveXorNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveXorNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedInclusiveXorNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].f4.x = subgroupPartitionedExclusiveAddNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveAddNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveAddNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveAddNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveAddNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveAddNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveAddNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveAddNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveAddNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveAddNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveAddNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveAddNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveAddNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveAddNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveAddNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveAddNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedExclusiveMulNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveMulNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveMulNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveMulNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveMulNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveMulNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveMulNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveMulNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveMulNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveMulNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveMulNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveMulNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveMulNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveMulNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveMulNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveMulNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedExclusiveMinNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveMinNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveMinNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveMinNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveMinNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveMinNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveMinNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveMinNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveMinNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveMinNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveMinNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveMinNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveMinNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveMinNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveMinNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveMinNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedExclusiveMaxNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveMaxNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveMaxNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveMaxNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveMaxNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveMaxNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveMaxNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveMaxNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveMaxNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveMaxNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveMaxNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveMaxNV(data[3].d4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveAndNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveAndNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveAndNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveAndNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveAndNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveAndNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveAndNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveAndNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedExclusiveAndNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedExclusiveOrNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveOrNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveOrNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveOrNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveOrNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveOrNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveOrNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveOrNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedExclusiveOrNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedExclusiveXorNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveXorNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveXorNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveXorNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveXorNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveXorNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveXorNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveXorNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedExclusiveXorNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); +} diff --git a/deps/glslang/Test/spv.vulkan110.int16.frag b/deps/glslang/Test/spv.vulkan110.int16.frag new file mode 100644 index 00000000..d29894b8 --- /dev/null +++ b/deps/glslang/Test/spv.vulkan110.int16.frag @@ -0,0 +1,251 @@ +#version 450 + +#extension GL_KHX_shader_explicit_arithmetic_types: enable +#extension GL_KHX_shader_explicit_arithmetic_types_int8: require +#extension GL_KHX_shader_explicit_arithmetic_types_int16: require +#extension GL_KHX_shader_explicit_arithmetic_types_int32: require +#extension GL_KHX_shader_explicit_arithmetic_types_int64: require +#extension GL_KHX_shader_explicit_arithmetic_types_float16: require +#extension GL_KHX_shader_explicit_arithmetic_types_float32: require +#extension GL_KHX_shader_explicit_arithmetic_types_float64: require + +layout(binding = 0) uniform Uniforms +{ + uint index; +}; + +layout(std140, binding = 1) uniform Block +{ + int16_t i16; + i16vec2 i16v2; + i16vec3 i16v3; + i16vec4 i16v4; + uint16_t u16; + u16vec2 u16v2; + u16vec3 u16v3; + u16vec4 u16v4; +} block; + +void main() +{ +} + +void literal() +{ + const int16_t i16Const[3] = + { + int16_t(-0x1111), // Hex + int16_t(-1), // Dec + int16_t(040000), // Oct + }; + + int16_t i16 = i16Const[index]; + + const uint16_t u16Const[] = + { + uint16_t(0xFFFF), // Hex + uint16_t(65535), // Dec + uint16_t(077777), // Oct + }; + + uint16_t u16 = u16Const[index]; +} + +void typeCast16() +{ + i8vec2 i8v; + u8vec2 u8v; + i16vec2 i16v; + u16vec2 u16v; + i32vec2 i32v; + u32vec2 u32v; + i64vec2 i64v; + u64vec2 u64v; + f16vec2 f16v; + f32vec2 f32v; + f64vec2 f64v; + bvec2 bv; + + i32v = i16v; // int16_t -> int32_t + i32v = u16v; // uint16_t -> int32_t + u16v = i16v; // int16_t -> uint16_t + u32v = i16v; // int16_t -> uint32_t + i64v = i16v; // int16_t -> int64_t + u64v = i16v; // int16_t -> uint64_t + u32v = u16v; // uint16_t -> uint32_t + i64v = u16v; // uint16_t -> int64_t + u64v = u16v; // uint16_t -> uint64_t + f16v = i16v; // int16_t -> float16_t + f32v = i16v; // int16_t -> float32_t + f64v = i16v; // int16_t -> float64_t + f16v = u16v; // uint16_t -> float16_t + f32v = u16v; // uint16_t -> float32_t + f64v = u16v; // uint16_t -> float64_t + + i32v = i32vec2(i16v); // int16_t -> int32_t + i32v = i32vec2(u16v); // uint16_t -> int32_t + u16v = u16vec2(i16v); // int16_t -> uint16_t + u32v = u32vec2(i16v); // int16_t -> uint32_t + i64v = i64vec2(i16v); // int16_t -> int64_t + u64v = i64vec2(i16v); // int16_t -> uint64_t + u32v = u32vec2(u16v); // uint16_t -> uint32_t + i64v = i64vec2(u16v); // uint16_t -> int64_t + u64v = i64vec2(u16v); // uint16_t -> uint64_t + f16v = f16vec2(i16v); // int16_t -> float16_t + f32v = f32vec2(i16v); // int16_t -> float32_t + f64v = f64vec2(i16v); // int16_t -> float64_t + f16v = f16vec2(u16v); // uint16_t -> float16_t + f32v = f32vec2(u16v); // uint16_t -> float32_t + f64v = f64vec2(u16v); // uint16_t -> float64_t + + i8v = i8vec2(i16v); // int16_t -> int8_t + i8v = i8vec2(u16v); // uint16_t -> int8_t + u8v = u8vec2(i16v); // int16_t -> uint8_t + u8v = u8vec2(u16v); // uint16_t -> uint8_t + i16v = u8vec2(u16v); // uint16_t -> int16_t + i16v = i16vec2(bv); // bool -> int16 + u16v = u16vec2(bv); // bool -> uint16 + bv = bvec2(i16v); // int16 -> bool + bv = bvec2(u16v); // uint16 -> bool +} +void operators() +{ + u16vec3 u16v; + int16_t i16; + uvec3 uv; + int32_t i; + int64_t i64; + bool b; + + // Unary + u16v++; + i16--; + ++i16; + --u16v; + + u16v = ~u16v; + + i16 = +i16; + u16v = -u16v; + + // Arithmetic + i16 += i16; + u16v -= u16v; + i *= i16; + uv /= u16v; + uv %= i16; + + uv = u16v + uv; + i64 = i16 - i64; + uv = u16v * uv; + i64 = i16 * i64; + i = i16 % i; + + // Shift + u16v <<= i16; + i16 >>= u16v.y; + + i16 = i16 << u16v.z; + uv = u16v << i; + + // Relational + b = (u16v.x != i16); + b = (i16 == u16v.x); + b = (u16v.x > uv.y); + b = (i16 < i); + b = (u16v.y >= uv.x); + b = (i16 <= i); + + // Bitwise + uv |= i16; + i = i16 | i; + i64 &= i16; + uv = u16v & uv; + uv ^= i16; + u16v = u16v ^ i16; +} + +void builtinFuncs() +{ + i16vec2 i16v; + i16vec4 i16v4; + u16vec3 u16v; + u16vec2 u16v2; + u16vec4 u16v4; + bvec3 bv; + int16_t i16; + uint16_t u16; + int32_t i32; + uint32_t u32; + int64_t i64; + uint64_t u64; + + // abs() + i16v = abs(i16v); + + // sign() + i16 = sign(i16); + + // min() + i16v = min(i16v, i16); + i16v = min(i16v, i16vec2(-1)); + u16v = min(u16v, u16); + u16v = min(u16v, u16vec3(0)); + + // max() + i16v = max(i16v, i16); + i16v = max(i16v, i16vec2(-1)); + u16v = max(u16v, u16); + u16v = max(u16v, u16vec3(0)); + + // clamp() + i16v = clamp(i16v, -i16, i16); + i16v = clamp(i16v, -i16v, i16v); + u16v = clamp(u16v, -u16, u16); + u16v = clamp(u16v, -u16v, u16v); + + // mix() + i16 = mix(i16v.x, i16v.y, true); + i16v = mix(i16vec2(i16), i16vec2(-i16), bvec2(false)); + u16 = mix(u16v.x, u16v.y, true); + u16v = mix(u16vec3(u16), u16vec3(-u16), bvec3(false)); + + //pack + i32 = pack32(i16v); + i64 = pack64(i16v4); + u32 = pack32(u16v2); + u64 = pack64(u16v4); + + i16v = unpack16(i32); + i16v4 = unpack16(i64); + u16v2 = unpack16(u32); + u16v4 = unpack16(u64); + + // lessThan() + bv = lessThan(u16v, u16vec3(u16)); + bv.xy = lessThan(i16v, i16vec2(i16)); + + // lessThanEqual() + bv = lessThanEqual(u16v, u16vec3(u16)); + bv.xy = lessThanEqual(i16v, i16vec2(i16)); + + // greaterThan() + bv = greaterThan(u16v, u16vec3(u16)); + bv.xy = greaterThan(i16v, i16vec2(i16)); + + // greaterThanEqual() + bv = greaterThanEqual(u16v, u16vec3(u16)); + bv.xy = greaterThanEqual(i16v, i16vec2(i16)); + + // equal() + bv = equal(u16v, u16vec3(u16)); + bv.xy = equal(i16v, i16vec2(i16)); + + // notEqual() + bv = notEqual(u16v, u16vec3(u16)); + bv.xy = notEqual(i16v, i16vec2(i16)); +} + +// Type conversion for specialization constant +layout(constant_id = 100) const int16_t si16 = int16_t(-10); +layout(constant_id = 101) const uint16_t su16 = uint16_t(20); diff --git a/deps/glslang/Test/spv.vulkan110.storageBuffer.vert b/deps/glslang/Test/spv.vulkan110.storageBuffer.vert new file mode 100644 index 00000000..6dd629e8 --- /dev/null +++ b/deps/glslang/Test/spv.vulkan110.storageBuffer.vert @@ -0,0 +1,16 @@ +#version 450 + +#pragma use_storage_buffer + +uniform ub { + vec4 a; +} ubi; + +buffer bb { + vec4 b; +} bbi; + +void main() +{ + gl_Position = ubi.a + bbi.b; +} diff --git a/deps/glslang/Test/spv.while-continue-break.vert b/deps/glslang/Test/spv.while-continue-break.vert new file mode 100644 index 00000000..c81e8d28 --- /dev/null +++ b/deps/glslang/Test/spv.while-continue-break.vert @@ -0,0 +1,20 @@ +#version 310 es +void main() { + int i = 0; + int A, B, C, D; + while (i<10) { + A = 1; + if (i%2 == 0) { + B = 2; + continue; + C = 2; + } + if (i%5 == 0) { + B = 2; + break; + C = 2; + } + i++; + } + D = 3; +} diff --git a/deps/glslang/Test/spv.while-simple.vert b/deps/glslang/Test/spv.while-simple.vert new file mode 100644 index 00000000..0f38325d --- /dev/null +++ b/deps/glslang/Test/spv.while-simple.vert @@ -0,0 +1,7 @@ +#version 310 es +void main() { + int i = 0; + while (i<10) { + i++; + } +} diff --git a/deps/glslang/Test/spv.whileLoop.frag b/deps/glslang/Test/spv.whileLoop.frag new file mode 100644 index 00000000..f7b7141e --- /dev/null +++ b/deps/glslang/Test/spv.whileLoop.frag @@ -0,0 +1,16 @@ +#version 140 + +in vec4 bigColor; +in vec4 BaseColor; +in float d; + +void main() +{ + vec4 color = BaseColor; + + while (color.x < d) { + color += bigColor; + } + + gl_FragColor = color; +} diff --git a/deps/glslang/Test/spv.xfb.vert b/deps/glslang/Test/spv.xfb.vert new file mode 100644 index 00000000..ad762bc2 --- /dev/null +++ b/deps/glslang/Test/spv.xfb.vert @@ -0,0 +1,20 @@ +#version 450 + +layout(xfb_buffer = 3) out; +layout(xfb_stride = 48) out; +layout(xfb_offset = 12, location = 0) out float out1; + +layout(xfb_buffer = 2) out; +layout(location=1) out outXfb { + layout(xfb_buffer = 2, xfb_stride = 32, xfb_offset = 8) float out2; +}; + +layout(xfb_buffer = 1, location=3) out outXfb2 { + layout(xfb_stride = 64, xfb_offset = 60) float out3; +}; + +layout(location = 4, xfb_buffer = 0, xfb_offset = 4) out float out4; + +void main() +{ +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.xfb2.vert b/deps/glslang/Test/spv.xfb2.vert new file mode 100644 index 00000000..895666d9 --- /dev/null +++ b/deps/glslang/Test/spv.xfb2.vert @@ -0,0 +1,18 @@ +#version 450 + +layout (location = 0) in vec4 position; +layout (binding = 5) uniform ComponentsBlock +{ + vec4 c1; + vec2 c2; +} components; + +layout (xfb_buffer = 3, xfb_offset = 16) out gl_PerVertex +{ + vec4 gl_Position; +}; + +void main() +{ + gl_Position = position + components.c1 + vec4(components.c2, 0.0, 0.0); +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.xfb3.vert b/deps/glslang/Test/spv.xfb3.vert new file mode 100644 index 00000000..2eae7c9e --- /dev/null +++ b/deps/glslang/Test/spv.xfb3.vert @@ -0,0 +1,18 @@ +#version 450 + +layout (location = 0) in vec4 position; +layout (binding = 5) uniform ComponentsBlock +{ + vec4 c1; + vec2 c2; +} components; + +layout (xfb_buffer = 3, xfb_offset = 16) out gl_PerVertex +{ + layout(xfb_stride = 80) vec4 gl_Position; +}; + +void main() +{ + gl_Position = position + components.c1 + vec4(components.c2, 0.0, 0.0); +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.xfbOffsetOnStructMembersAssignment.vert b/deps/glslang/Test/spv.xfbOffsetOnStructMembersAssignment.vert new file mode 100644 index 00000000..e6619c58 --- /dev/null +++ b/deps/glslang/Test/spv.xfbOffsetOnStructMembersAssignment.vert @@ -0,0 +1,23 @@ +#version 450 + +layout(xfb_buffer=2) out; + +struct S { + float x1_out; + float x2_out; +}; + +layout(location=0, xfb_offset = 16) out S s1; + +layout(location=5, xfb_buffer=1, xfb_offset=8) out struct S2 { + float y1_out; + vec4 y2_out; +}s2; + +void main() { + s1.x1_out = 5.0; + s1.x2_out = 6.0; + s2.y1_out = 7.0; + s2.y2_out = vec4(1.0, 0.0, 0.0, 1.0); + gl_Position = vec4(0.0); +} diff --git a/deps/glslang/Test/stringToDouble.vert b/deps/glslang/Test/stringToDouble.vert new file mode 100644 index 00000000..5a7024da --- /dev/null +++ b/deps/glslang/Test/stringToDouble.vert @@ -0,0 +1,116 @@ +#version 460 +#extension GL_KHX_shader_explicit_arithmetic_types_float16 : enable +void main() +{ + float w1 = 00000.000; + float w2 = 1.0; + float w3 = 007.00; + float w4 = 000130000.0; + float w5 = 123456789.0000; + double w6 = 1234567890123456.0; + double w7 = 12345678901234567.0; + double w8 = 123456789012345678.0; + double w9 = 12345678901234567893.0; + double w10 = 1234567890123456789012345.0; + + float e1 = 0e0; + float e2 = 1e0; + float e3 = 0e14; + float e4 = 1e15; + float e5 = 1e16; + float e6 = 0e-14; + float e7 = 1e-15; + float e8 = 1e-16; + double e9 = 1e100; + double e10 = 1e+308; + double e11 = 1e-307; // Was 1e-323, but that's flushed to zero sometimes. 1e-308 can be flushed to 0. + double e12 = 1e+309; + double e13 = 1e-324; + double e24 = 1e+999; + double e25 = 1e-999; + + double f1 = 0.5; + double f2 = 0.125; + double f31 = 0.1; + double f32 = 0.2; + double f33 = 0.3; + double f34 = 0.4; + double f35 = 0.5; + double f36 = 0.6; + double f37 = 0.7; + double f38 = 0.8; + double f39 = 0.9; + double f4 = 0.33333333333333333333333333333333333333333333333333333333333333333333333333333; + double f51 = 0.000000000000000000000000000000000000783475; + double f52 = 0.0000000000000000000000000000000000007834750; + double f53 = .00000000000000000000000000000000000078347500; + double f54 = 0.000000000000000000000000000000000000783475000000; + double f61 = 4.; + double f62 = 40.; + double f63 = 0.; + double f64 = 04.; + double f65 = .0; + double f66 = .004; + double f67 = .400; + double f68 = .04000; + + double c1 = .081e-2; + double c2 = .073e2; + double c3 = 34.5e-1; + double c4 = 35.7e-4; + double c5 = 43.9e1; + double c6 = 52.2e4; + double c7 = 000610000e2; + double c8 = 000610000e-6; + double c9 = 000001234567890123450000.0; + double c10 = 000999999999999999999000.0; + double c11 = 0001230000.0045600000; + double c12 = 0001230000.00405600000e-3; + double c13 = 0001230000.004500600000e-4; + double c14 = 00010230000.0045600000e-5; + double c15 = 000120030000.0045600000e4; + double c16 = 0001230000.0045600000e5; + double c17 = 0001230000.0045600000e6; + double c18 = 0001230000.00456007e6; + + double b11 = 72057594037927928.0; + double b12 = 72057594037927936.0; + double b13 = 72057594037927932.0; + double b14 = 7205759403792793199999e-5; + double b15 = 7205759403792793200001e-5; + double b21 = 9223372036854774784.0; + double b22 = 9223372036854775808.0; + double b23 = 9223372036854775296.0; + double b24 = 922337203685477529599999e-5; + double b25 = 922337203685477529600001e-5; + double b31 = 10141204801825834086073718800384.0; + double b32 = 10141204801825835211973625643008.0; + double b33 = 10141204801825834649023672221696.0; + double b34 = 1014120480182583464902367222169599999e-5; + double b35 = 1014120480182583464902367222169600001e-5; + double b41 = 5708990770823838890407843763683279797179383808.0; + double b42 = 5708990770823839524233143877797980545530986496.0; + double b43 = 5708990770823839207320493820740630171355185152.0; + double b44 = 5708990770823839207320493820740630171355185151999e-3; + double b45 = 5708990770823839207320493820740630171355185152001e-3; + + float pi1 = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679f; + float pi2 = 3.14159265358979f; + float pi3 = 3.141592653589793f; + + double dpi1 = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679; + double dpi2 = 3.14159265358979; + double dpi3 = 3.141592653589793; + + float dfpi1 = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679f; + float dfpi2 = 3.14159265358979f; + float dfpi3 = 3.141592653589793f; + + double lfpi1 = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679LF; + double lfpi2 = 3.14159265358979Lf; + double lfpi3 = 3.141592653589793lF; + + double hfpi1 = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679hF; + double hfpi2 = 3.14159265358979hF; + double hfpi3 = 3.141592653589793hf; +} diff --git a/deps/glslang/Test/structAssignment.frag b/deps/glslang/Test/structAssignment.frag new file mode 100644 index 00000000..959f854e --- /dev/null +++ b/deps/glslang/Test/structAssignment.frag @@ -0,0 +1,39 @@ +#version 130 + +uniform sampler2D sampler; +varying mediump vec2 coord; + +struct lunarStruct1 { + int i; + float f; +}; + +struct lunarStruct2 { + int i; + float f; + lunarStruct1 s1_1; +}; + +struct lunarStruct3 { + lunarStruct2 s2_1; + int i; + float f; + lunarStruct1 s1_1; +}; + + +uniform lunarStruct1 foo; +uniform lunarStruct2 foo2; +uniform lunarStruct3 foo3; + +void main() +{ + lunarStruct2 locals2; + + if (foo3.s2_1.i > 0) + locals2 = foo3.s2_1; + else + locals2 = foo2; + + gl_FragColor = locals2.s1_1.f * texture2D(sampler, coord); +} diff --git a/deps/glslang/Test/structDeref.frag b/deps/glslang/Test/structDeref.frag new file mode 100644 index 00000000..376e408f --- /dev/null +++ b/deps/glslang/Test/structDeref.frag @@ -0,0 +1,71 @@ +#version 130 + +uniform sampler2D sampler; +varying vec2 coord; + +struct s0 { + int i; +}; + +struct s00 { + s0 s0_0; +}; + +struct s1 { + int i; + float f; + s0 s0_1; +}; + +struct s2 { + int i; + float f; + s1 s1_1; +}; + +struct s3 { + s2[12] s2_1; + int i; + float f; + s1 s1_1; +}; + + +uniform s0 foo0; +uniform s1 foo1; +uniform s2 foo2; +uniform s3 foo3; + +uniform s00 foo00; + +void main() +{ + s0 locals0; + s2 locals2; + s00 locals00; + + float[6] fArray; + + s1[10] locals1Array; + + if (foo3.s2_1[9].i > 0) { + locals2.f = 1.0; + locals2.s1_1 = s1(0, 1.0, s0(0)); + fArray = float[6]( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + locals1Array[6] = foo1; + locals0 = s0(0); + locals00 = s00(s0(0)); + } else { + locals2.f = coord.x; + locals2.s1_1 = s1(1, coord.y, foo0); + fArray = float[6]( 0.0, 1.0, 2.0, 3.0, 4.0, 5.0); + locals1Array[6] = locals2.s1_1; + locals0 = foo1.s0_1; + locals00 = foo00; + } + + if (locals0.i > 5) + locals0 = locals00.s0_0; + + gl_FragColor = (float(locals0.i) + locals1Array[6].f + fArray[3] + locals2.s1_1.f) * texture2D(sampler, coord); +} diff --git a/deps/glslang/Test/structure.frag b/deps/glslang/Test/structure.frag new file mode 100644 index 00000000..97e79cb0 --- /dev/null +++ b/deps/glslang/Test/structure.frag @@ -0,0 +1,31 @@ +#version 130 +uniform sampler2D sampler; +varying vec2 coord; + +struct lunarStruct1 { + int i; + float f[4]; + vec4 color[5]; +}; + +struct lunarStruct2 { + int i[5]; + float f; + lunarStruct1 s1_1[7]; +}; + +uniform lunarStruct1 foo; +uniform lunarStruct2 foo2[5]; + +void main() +{ + float scale = 0.0; + + if (foo2[3].i[4] > 0) + scale = foo2[3].s1_1[2].color[3].x; + else + scale = foo2[3].s1_1[2].f[3]; + + gl_FragColor = scale * texture2D(sampler, coord); +} + diff --git a/deps/glslang/Test/switch.frag b/deps/glslang/Test/switch.frag new file mode 100644 index 00000000..f0860fae --- /dev/null +++ b/deps/glslang/Test/switch.frag @@ -0,0 +1,158 @@ +#version 300 es +precision highp float; +uniform int c, d; +in highp float x; + +void main() +{ + float f; + int a[2]; + + switch(f) { // ERROR + } + + switch(a) { // ERROR + } + + switch(c) + { + } + + switch(c) // WARNING, not enough stuff after last label + { + case 2: + } + + switch(c) + { + f = sin(x); // ERRROR + case 2: + f = cos(x); + break; + } + + switch (c) { + default: + break; + case 1: + f = sin(x); + break; + case 2: + f = cos(x); + break; + default: // ERROR, 2nd default + f = tan(x); + } + + switch (c) { + case 1: + f = sin(x); + break; + case 2: + switch (d) { + case 1: + f = x * x * x; + break; + case 2: + f = x * x; + break; + } + break; + default: + f = tan(x); + case 1: // ERROR, 2nd 'case 1' + break; + case 3.8: // ERROR, non-int + break; + case c: // ERROR, non-constant + break; + } + + switch (c) { // a no-error normal switch + case 1: + f = sin(x); + break; + case 2: + switch (d) { + case 1: + f = x * x * x; + break; + case 2: + f = x * x; + break; + } + break; + default: + f = tan(x); + } + + break; // ERROR + + switch (c) { + case 1: + f = sin(x); + break; + case 2: + switch (d) { + case 1: + { + case 4: // ERROR + break; + } + f = x * x * x; + if (c < d) { + case 2: // ERROR + f = x * x; + } + if (d < c) + case 3: // ERROR + break; + } + break; + case 4: + f = tan(x); + if (f < 0.0) + default: // ERROR + break; + } + + case 5: // ERROR + default: // ERROR + + switch (0) { + default: + int onlyInSwitch = 0; + } + onlyInSwitch; // ERROR + + switch (0) { + default: + int x; // WARNING (was "no statement" ERROR, but spec. changed because unclear what a statement is) + } + + switch (c) { + case 1: + { + int nestedX; + break; + } + case 2: + nestedX; // ERROR + int nestedZ; + float a; // okay, hiding outer 'a' + break; + case 3: + int linearZ; + break; + break; + case 4: + int linearY = linearZ; + break; + case 5: // okay that branch bypassed an initializer + const int linearC = 4; + break; + case 6: // okay that branch bypassed an initializer + linearC; + } + nestedZ; // ERROR, no longer in scope +} diff --git a/deps/glslang/Test/swizzle.frag b/deps/glslang/Test/swizzle.frag new file mode 100644 index 00000000..14f507ec --- /dev/null +++ b/deps/glslang/Test/swizzle.frag @@ -0,0 +1,52 @@ +#version 110 + +uniform float blend; +uniform vec4 u; +uniform bool p; + +varying vec2 t; + +void main() +{ + float blendscale = 1.789; + + vec4 w = u; + vec4 w_undef; // test undef + vec4 w_dep = u; // test dependent swizzles + vec4 w_reorder = u; // test reordering + vec4 w2 = u; + vec4 w_flow = u; // test flowControl + + w_reorder.z = blendscale; + + w.wy = t; + + w_reorder.x = blendscale; + + w2.xyzw = u.zwxy; + + w_reorder.y = blendscale; + + w_dep.xy = w2.xz; + w_dep.zw = t; + + w_undef.xy = u.zw; + + if (p) + w_flow.x = t.x; + else + w_flow.x = t.y; + + gl_FragColor = mix(w_reorder, w_undef, w * w2 * w_dep * w_flow); + + vec2 c = t; + vec4 rep = vec4(0.0, 0.0, 0.0, 1.0); + + if (c.x < 0.0) + c.x *= -1.0; + + if (c.x <= 1.0) + rep.x = 3.4; + + gl_FragColor += rep; +} diff --git a/deps/glslang/Test/syntaxError.frag b/deps/glslang/Test/syntaxError.frag new file mode 100644 index 00000000..fcbeb69e --- /dev/null +++ b/deps/glslang/Test/syntaxError.frag @@ -0,0 +1,16 @@ +#version 120 + +uniform vec4 bigColor; +varying vec4 BaseColor; +uniform float d; + +void main() +{ + vec5 color = BaseColor; + + do { + color += bigColor; + } while (color.x < d); + + gl_FragColor = color; +} diff --git a/deps/glslang/Test/test.frag b/deps/glslang/Test/test.frag new file mode 100644 index 00000000..1b7d0e95 --- /dev/null +++ b/deps/glslang/Test/test.frag @@ -0,0 +1,22 @@ +#version 110 + +uniform sampler2D texSampler2D; +uniform sampler3D texSampler3D; + +uniform float blend; +uniform vec2 scale; +uniform vec4 u; + +varying vec2 t; +varying vec3 coords; + +void main() +{ + float blendscale = 1.789; + + vec4 v = texture2D(texSampler2D, (t + scale) / scale ).wzyx; + + vec4 w = texture3D(texSampler3D, coords) + v; + + gl_FragColor = mix(w, u, blend * blendscale); +} diff --git a/deps/glslang/Test/texture.frag b/deps/glslang/Test/texture.frag new file mode 100644 index 00000000..8e5391ee --- /dev/null +++ b/deps/glslang/Test/texture.frag @@ -0,0 +1,73 @@ +#version 130 + +uniform sampler1D texSampler1D; +uniform sampler2D texSampler2D; +uniform sampler3D texSampler3D; +uniform samplerCube texSamplerCube; +uniform sampler1DShadow shadowSampler1D; +uniform sampler2DShadow shadowSampler2D; + +uniform float blend; +uniform vec2 scale; +uniform vec4 u; + +varying vec2 t; +varying vec2 coords2D; + +void main() +{ + float blendscale = 1.789; + float bias = 2.0; + float lod = 3.0; + float proj = 2.0; + float coords1D = 1.789; + vec3 coords3D = vec3(1.789, 2.718, 3.453); + vec4 coords4D = vec4(1.789, 2.718, 3.453, 2.0); + vec4 color = vec4(0.0, 0.0, 0.0, 0.0); + + color += texture1D (texSampler1D, coords1D); + color += texture1D (texSampler1D, coords1D, bias); + color += texture1DProj(texSampler1D, coords2D); + color += texture1DProj(texSampler1D, coords4D); + color += texture1DProj(texSampler1D, coords2D, bias); + color += texture1DProj(texSampler1D, coords4D, bias); + + color += texture2D (texSampler2D, coords2D); + color += texture2D (texSampler2D, coords2D, bias); + color += texture2DProj (texSampler2D, coords3D); + color += texture2DProj (texSampler2D, coords4D, bias); + + color += texture3D (texSampler3D, coords3D); + color += texture3D (texSampler3D, coords3D, bias); + color += texture3DProj (texSampler3D, coords4D); + color += texture3DProj (texSampler3D, coords4D, bias); + + color += textureCube (texSamplerCube, coords3D); + color += textureCube (texSamplerCube, coords3D, bias); + + color += shadow1D (shadowSampler1D, coords3D); + color += shadow1D (shadowSampler1D, coords3D, bias); + color += shadow2D (shadowSampler2D, coords3D); + color += shadow2D (shadowSampler2D, coords3D, bias); + color += shadow1DProj (shadowSampler1D, coords4D); + color += shadow1DProj (shadowSampler1D, coords4D, bias); + color += shadow2DProj (shadowSampler2D, coords4D); + color += shadow2DProj (shadowSampler2D, coords4D, bias); + + ivec2 iCoords2D = ivec2(0, 5); + int iLod = 1; + + color += texelFetch(texSampler2D, iCoords2D, iLod); + + vec2 gradX = dFdx(coords2D); + vec2 gradY = dFdy(coords2D); + const ivec2 offset = ivec2(3, -7); + + color += textureGrad(texSampler2D, coords2D, gradX, gradY); + color += textureProjGrad(texSampler2D, vec3(coords2D, proj), gradX, gradY); + color += textureGradOffset(texSampler2D, coords2D, gradX, gradY, offset); + color += textureProjGradOffset(texSampler2D, coords3D, gradX, gradY, offset); + color += textureGrad(shadowSampler2D, vec3(coords2D, lod), gradX, gradY); + + gl_FragColor = mix(color, u, blend * blendscale); +} \ No newline at end of file diff --git a/deps/glslang/Test/tokenLength.vert b/deps/glslang/Test/tokenLength.vert new file mode 100644 index 00000000..21d446fa --- /dev/null +++ b/deps/glslang/Test/tokenLength.vert @@ -0,0 +1,72 @@ +#version 300 es +//#pragma glslang_binary_double_output +// 1023 characters +in float BCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789; + +// 1024 characters (okay) +in float ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789; + +int E1 = 5000000000; // ERROR +int E2 = 50000000000; // ERROR +int B = 4294967295; // okay + +int OE = 0777777777777777777777; // ERROR +int HE = 0x1234567890ABCDEF0; // ERROR + +// 1023 character fraction +float F = 1.0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890; + +// 1024 character value +float G = 1.01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678890; + +// 1025 character fraction +float E3 = 1.012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012; + +void main() +{ + gl_Position = vec4(ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789, + B, F, G); +} + +// super long +float BCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789BCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789BCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789BCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789; +int superH = 0xBCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789BCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789BCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789BCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789; +int superO = 0777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777077777777777777777777707777777777777777777770777777777777777777777; +int superI = 429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295; +float superF = 1.012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890121234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901212345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012; + +// Boundary cases +#extension a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhooooooooooooooooooooooooooooooohhhhhhhhhhhhhhhhh01234 : enable +#extension a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhooooooooooooooooooooooooooooooohhhhhhhhhhhhhhhhh012345 : enable + +// Super long +#extension A29496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295429496729542949672954294967295 + +// Boundary cases +#if 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 +#error in long non-zero #if +#endif +#if 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 == 0 +#error in long zero #if +#endif +#if 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 == 0 +#error in too long #if +#endif + +#if A000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 +#error in long macro #if +#endif +#if A000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +#error in long macro #if +#endif +#if A0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +#error in too long macro #if +#endif + +// Super long +#if 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +#error in super long #if +#endif +#if A000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +#error in super long macro #if +#endif diff --git a/deps/glslang/Test/tokenPaste.vert b/deps/glslang/Test/tokenPaste.vert new file mode 100644 index 00000000..40de6f92 --- /dev/null +++ b/deps/glslang/Test/tokenPaste.vert @@ -0,0 +1,86 @@ +#version 450 + +// side test verifies multiple rounds of argument expansion +#define bear SecondExpansion +#define mmmB bear +#define mmmA(a) a +int mmmA(mmmB); // mmmB -> bear, and then in mmmA(), bear -> SecondExpansion + +// pasting skips the first round of expansion +#define mmcatmmdog PostPasteExpansion +#define mmcat cat +#define mmdog dog +#define mmp(a,b) a## b +int mmp(mmcat, mmdog); // mmcat/mmdog not expanded, mmcatmmdog -> PostPasteExpansion + +// multi-token pre +#define mmtokpastepre(a) a##27 +mmtokpastepre(float foo); // should declare "float foo27;" + +// multi-token post +#define mmtokpastepost(a) uni ##a +mmtokpastepost(form float foo155); // should declare "uniform float foo155;" + +// non-first argument +#define foo ShouldntExpandToThis +#define semi ; +#define bothpaste(a,b) a##b +float bothpaste(foo, 719); // should declare "float foo719;" +#define secpaste(a,b) a bar ## b +secpaste(uniform float, foo semi) // should declare "uniform float barfoo;" + +// no args +#define noArg fl##oat +noArg argless; + +// bad location +#define bad1 ## float +bad1 dc1; +#define bad2 float ## +bad2 dc2; + +// multiple ## +#define multiPaste(a, b, c) a##or##b flo##at foo##c +multiPaste(unif, m, 875); + +// too long +#define simplePaste(a,b) a##b +// 1020 + 5 characters +float simplePaste(ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF012345, 12345); + +// non-identifiers +int a = simplePaste(11,12); + +// operators +#define MAKE_OP(L, R) L ## R +const int aop = 10; +const int bop = 4; +int cop = aop MAKE_OP(<, <) bop; +bool dop = aop MAKE_OP(!,=) bop; + +#define MAKE_OP3(L, M, R) L ## M ## R + +void foo() +{ + int e = 16; + e MAKE_OP3(>,>,=) 2; + + // recovery from bad op + bool f = e MAKE_OP(>,!) 5; +} + +// arguments: should make 'uniform int argPaste2;' +#define M_NEST(q) int q +#define M_OUTER(p) M_NEST(p##2) +uniform M_OUTER(argPaste); +// should make 'uniform int argPaste20suff;' +#define M_NEST2(q) int q ## suff +#define M_OUTER2(p) M_NEST2(p ## 20) +uniform M_OUTER2(argPaste); + +#define rec(x)## +rec(rec()) + +#define bax(bay) +#define baz bax(/##) +baz diff --git a/deps/glslang/Test/types.frag b/deps/glslang/Test/types.frag new file mode 100644 index 00000000..48701d89 --- /dev/null +++ b/deps/glslang/Test/types.frag @@ -0,0 +1,81 @@ +#version 130 + +uniform bool u_b; +uniform bvec2 u_b2; +uniform bvec3 u_b3; +uniform bvec4 u_b4; + +uniform int u_i; +uniform ivec2 u_i2; +uniform ivec3 u_i3; +uniform ivec4 u_i4; + +uniform float u_f; +uniform vec2 u_f2; +uniform vec3 u_f3; +uniform vec4 u_f4; + +uniform bool i_b; +uniform bvec2 i_b2; +uniform bvec3 i_b3; +uniform bvec4 i_b4; + +flat in int i_i; +flat in ivec2 i_i2; +flat in ivec3 i_i3; +flat in ivec4 i_i4; + +in float i_f; +in vec2 i_f2; +in vec3 i_f3; +in vec4 i_f4; + +void main() +{ + bool b = u_b && i_b; + bvec2 b2 = bvec2(u_b2.x && i_b2.x && u_b2.y && i_b2.y); + bvec3 b3 = bvec3(u_b3.x && i_b3.x && u_b3.y && i_b3.y && u_b3.z && i_b3.z); + bvec4 b4 = bvec4(u_b4.x && i_b4.x && u_b4.y && i_b4.y && u_b4.z && i_b4.z && u_b4.w && i_b4.w); + + int i = u_i + i_i; + ivec2 i2 = u_i2 + i_i2; + ivec3 i3 = u_i3 + i_i3; + ivec4 i4 = u_i4 + i_i4; + + float f = u_f + i_f; + vec2 f2 = u_f2 + i_f2; + vec3 f3 = u_f3 + i_f3; + vec4 f4 = u_f4 + i_f4; + + gl_FragColor = + b || + b2.x || + b2.y || + b3.x || + b3.y || + b3.z || + b4.x || + b4.y || + b4.z || + b4.w ? vec4( + i + + i2.x + + i2.y + + i3.x + + i3.y + + i3.z + + i4.x + + i4.y + + i4.z + + i4.w + + f + + f2.x + + f2.y + + f3.x + + f3.y + + f3.z + + f4.x + + f4.y + + f4.z + + f4.w) : vec4(1.0); +} diff --git a/deps/glslang/Test/uint.frag b/deps/glslang/Test/uint.frag new file mode 100644 index 00000000..6dd69ac9 --- /dev/null +++ b/deps/glslang/Test/uint.frag @@ -0,0 +1,105 @@ +#version 300 es +in uvec2 badu; // ERROR +flat in uvec2 t; +in highp float f; +in highp vec2 tc; +in bool bad; // ERROR +uniform uvec4 v; +uniform int i; +uniform bool b; + +out uvec4 c; + +uniform lowp usampler2D usampler; + +void main() +{ + int count = 1; + + uint u = t.y + 3u; + const uint cu1error = 0xFFFFFFFF; // ERROR + const uint cu1 = 0xFFFFFFFFU; + const uint cu2 = -1u; // 0xFFFFFFFF + const uint cu3 = 1U; + const uint cu4error = 1; // ERROR + const uint cu4 = 1u; + + if (cu1 == cu2) + count *= 2; // done + if (cu3 == cu4) + count *= 3; // done + if (cu2 == cu3) + count *= 5; // not done + + const uint cushiftediierror = 0xFFFFFFFF >> 10; // ERROR + const int cshiftedii = 0xFFFFFFFF >> 10; + const uint cushiftedui = 0xFFFFFFFFu >> 10; + const uint cushiftediuerror = 0xFFFFFFFF >> 10u; // ERROR + const int cshiftediu = 0xFFFFFFFF >> 10u; + const uint cushifteduu = 0xFFFFFFFFu >> 10u; + + if (cshiftedii == cshiftediu) + count *= 7; // done + if (cushiftedui == cushifteduu) + count *= 11; // done + if (cshiftedii == int(cushiftedui)) + count *= 13; // not done + + uint shiftediierror = 0xFFFFFFFF >> 10; // ERROR + int shiftedii = 0xFFFFFFFF >> 10; + uint shiftedui = 0xFFFFFFFFu >> 10; + uint shiftediuerror = 0xFFFFFFFF >> 10u; // ERROR + int shiftediu = 0xFFFFFFFF >> 10u; + uint shifteduu = 0xFFFFFFFFu >> 10u; + + if (shiftedii == shiftediu) + c = texture(usampler, tc); + if (shiftedui == shifteduu) + c = texture(usampler, tc + float(1u)); + if (shiftedii == int(shiftedui)) + c = texture(usampler, tc - vec2(2u)); + + if (t.x > 4u) { + float af = float(u); + bool ab = bool(u); + int ai = int(u); + + c += uvec4(uint(af), uint(ab), uint(ai), count); + } + + const uint cmask1 = 0x0A1u; + const uint cmask2 = 0xA10u; + const uint cmask3 = cmask1 << 4; + const uint cmask4 = 0xAB1u; + + if (cmask3 == cmask2) + count *= 17; // done + + if ((cmask3 & cmask1) != 0u) + count *= 19; // not done + + if ((cmask1 | cmask3) == cmask4) + count *= 23; // done + + if ((cmask1 ^ cmask4) == 0xA10u) + count *= 27; // done + + uint mask1 = 0x0A1u; + uint mask2 = 0xA10u; + uint mask3 = mask1 << 4; + uint mask4 = 0xAB1u; + + if (mask3 == mask2) + count *= 100; + + if ((mask3 & mask1) != 0u) + count *= 101; + + if ((mask1 | mask3) == mask4) + count *= 102; + + if ((mask1 ^ mask4) == 0xA10u) + count *= 103; + + c += uvec4(count); +} diff --git a/deps/glslang/Test/uniformArray.frag b/deps/glslang/Test/uniformArray.frag new file mode 100644 index 00000000..7db28764 --- /dev/null +++ b/deps/glslang/Test/uniformArray.frag @@ -0,0 +1,16 @@ +#version 130 +uniform sampler2D texSampler2D; +uniform vec3 inColor; +uniform vec4 color[6]; +uniform float alpha[16]; + +void main() +{ + vec4 texColor = color[1] + color[1]; + + texColor.xyz += inColor; + + texColor.a += alpha[12]; + + gl_FragColor = texColor; +} diff --git a/deps/glslang/Test/validate-shaders.sh b/deps/glslang/Test/validate-shaders.sh new file mode 100644 index 00000000..89dc9556 --- /dev/null +++ b/deps/glslang/Test/validate-shaders.sh @@ -0,0 +1,269 @@ +#!/bin/bash + +# This script validates shaders (if successfully compiled) using spirv-val. +# It is not meant to preclude the possible addition of the validator to +# glslang. + +declare -r EXE='../build/install/bin/glslangValidator' + +# search common locations for spirv-tools: keep first one +for toolsdir in '../External/spirv-tools/build/tools' '../../SPIRV-Tools/build/tools/bin' '/usr/local/bin'; do + [[ -z "$VAL" && -x "${toolsdir}/spirv-val" ]] && declare -r VAL="${toolsdir}/spirv-val" + [[ -z "$DIS" && -x "${toolsdir}/spirv-dis" ]] && declare -r DIS="${toolsdir}/spirv-dis" +done + +declare -r gtests='../gtests/Hlsl.FromFile.cpp ../gtests/Spv.FromFile.cpp' + +declare -r targetenv='vulkan1.0' + +function fatal() { echo "ERROR: $@"; exit 5; } + +function usage +{ + echo + echo "Usage: $(basename $0) [options...] shaders..." + echo + echo " Validates shaders (if successfully compiled) through spirv-val." + echo + echo "General options:" + echo " --help prints this text" + echo " --no-color disables output colorization" + echo " --dump-asm dumps all successfully compiled shader assemblies" + echo " --dump-val dumps all validation results" + echo " --dump-comp dumps all compilation logs" + echo "Spam reduction options:" + echo " --no-summary disables result summaries" + echo " --skip-ok do not print successful validations" + echo " --skip-comperr do not print compilation errors" + echo " --skip-valerr do not print validation errors" + echo " --quiet synonym for --skip-ok --skip-comperr --skip-valerr --no-summary" + echo " --terse print terse single line progress summary" + echo "Disassembly options:" + echo " --raw-id uses raw ids for disassembly" + echo + echo "Usage examples. Note most non-hlsl tests fail to compile for expected reasons." + echo " Exercise all hlsl.* files:" + echo " $(basename $0) hlsl.*" + echo " Exercise all hlsl.* files, tersely:" + echo " $(basename $0) --terse hlsl.*" + echo " Print validator output for myfile.frag:" + echo " $(basename $0) --quiet --dump-val myfile.frag" + echo " Exercise hlsl.* files, only printing validation errors:" + echo " $(basename $0) --skip-ok --skip-comperr hlsl.*" + + exit 5 +} + +function status() +{ + printf "%-40s: %b\n" "$1" "$2" +} + +# make sure we can find glslang +[[ -x "$EXE" ]] || fatal "Unable to locate $(basename "$EXE") executable" +[[ -x "$VAL" ]] || fatal "Unable to locate spirv-val executable" +[[ -x "$DIS" ]] || fatal "Unable to locate spirv-dis executable" + +for gtest in $gtests; do + [[ -r "$gtest" ]] || fatal "Unable to locate source file: $(basename $gtest)" +done + +# temp files +declare -r spvfile='out.spv' \ + complog='comp.out' \ + vallog='val.out' \ + dislog='dis.out' \ + +# options +declare opt_vallog=false \ + opt_complog=false \ + opt_dislog=false \ + opt_summary=true \ + opt_stat_comperr=true \ + opt_stat_ok=true \ + opt_stat_valerr=true \ + opt_color=true \ + opt_raw_id=false \ + opt_quiet=false \ + opt_terse=false + +# clean up on exit +trap "rm -f ${spvfile} ${complog} ${vallog} ${dislog}" EXIT + +# Language guesser: there is no fixed mapping from filenames to language, +# so this examines the file and return one of: +# hlsl +# glsl +# bin +# unknown +# This is easier WRT future expansion than a big explicit list. +function FindLanguage() +{ + local test="$1" + + # If it starts with hlsl, assume it's hlsl. + if [[ "$test" == *hlsl.* ]]; then + echo hlsl + return + fi + + if [[ "$test" == *.spv ]]; then + echo bin + return; + fi + + # If it doesn't start with spv., assume it's GLSL. + if [[ ! "$test" == spv.* && ! "$test" == remap.* ]]; then + echo glsl + return + fi + + # Otherwise, attempt to guess from shader contents, since there's no + # fixed mapping of filenames to languages. + local contents="$(cat "$test")" + + if [[ "$contents" == *#version* ]]; then + echo glsl + return + fi + + if [[ "$contents" == *SamplerState* || + "$contents" == *cbuffer* || + "$contents" == *SV_* ]]; then + echo hlsl + return + fi + + echo unknown +} + +# Attempt to discover entry point +function FindEntryPoint() +{ + local test="$1" + + # if it's not hlsl, always use main + if [[ "$language" != 'hlsl' ]]; then + echo 'main' + return + fi + + # Try to find it in test sources + awk -F '[ (){",]+' -e "\$2 == \"${test}\" { print \$3; found=1; } END { if (found==0) print \"main\"; } " $gtests +} + +# command line options +while [ $# -gt 0 ] +do + case "$1" in + # -c) glslang="$2"; shift 2;; + --help|-?) usage;; + --no-color) opt_color=false; shift;; + --no-summary) opt_summary=false; shift;; + --skip-ok) opt_stat_ok=false; shift;; + --skip-comperr) opt_stat_comperr=false; shift;; + --skip-valerr) opt_stat_valerr=false; shift;; + --dump-asm) opt_dislog=true; shift;; + --dump-val) opt_vallog=true; shift;; + --dump-comp) opt_complog=true; shift;; + --raw-id) opt_raw_id=true; shift;; + --quiet) opt_quiet=true; shift;; + --terse) opt_quiet=true + opt_terse=true + shift;; + --*) fatal "Unknown command line option: $1";; + *) break;; + esac +done + +# this is what quiet means +if $opt_quiet; then + opt_stat_ok=false + opt_stat_comperr=false + opt_stat_valerr=false + $opt_terse || opt_summary=false +fi + +if $opt_color; then + declare -r white="\e[1;37m" cyan="\e[1;36m" red="\e[0;31m" no_color="\e[0m" +else + declare -r white="" cyan="" red="" no_color="" +fi + +# stats +declare -i count_ok=0 count_err=0 count_nocomp=0 count_total=0 + +declare -r dashsep='------------------------------------------------------------------------' + +testfiles=(${@}) +# if no shaders given, look for everything in current directory +[[ ${#testfiles[*]} == 0 ]] && testfiles=(*.frag *.vert *.tesc *.tese *.geom *.comp) + +$opt_summary && printf "\nValidating: ${#testfiles[*]} shaders\n\n" + +# Loop through the shaders we were given, compiling them if we can. +for test in ${testfiles[*]} +do + if [[ ! -r "$test" ]]; then + $opt_quiet || status "$test" "${red}FILE NOT FOUND${no_color}" + continue + fi + + ((++count_total)) + + $opt_terse && printf "\r[%-3d/%-3d : ${white}comperr=%-3d ${red}valerr=%-3d ${cyan}ok=%-3d${no_color}]" \ + ${count_total} ${#testfiles[*]} ${count_nocomp} ${count_err} ${count_ok} + + language="$(FindLanguage $test)" + entry="$(FindEntryPoint $test)" + langops='' + + case "$language" in + hlsl) langops='-D --hlsl-iomap --hlsl-offsets';; + glsl) ;; + bin) continue;; # skip binaries + *) $opt_quiet || status "$test" "${red}UNKNOWN LANGUAGE${no_color}"; continue;; + esac + + # compile the test file + if compout=$("$EXE" -e "$entry" $langops -V -o "$spvfile" "$test" 2>&1) + then + # successful compilation: validate + if valout=$("$VAL" --target-env ${targetenv} "$spvfile" 2>&1) + then + # validated OK + $opt_stat_ok && status "$test" "${cyan}OK${no_color}" + ((++count_ok)) + else + # validation failure + $opt_stat_valerr && status "$test" "${red}VAL ERROR${no_color}" + printf "%s\n%s:\n%s\n" "$dashsep" "$test" "$valout" >> "$vallog" + ((++count_err)) + fi + + if $opt_dislog; then + printf "%s\n%s:\n" "$dashsep" "$test" >> "$dislog" + $opt_raw_id && id_opt=--raw-id + "$DIS" ${id_opt} "$spvfile" >> "$dislog" + fi + else + # compile failure + $opt_stat_comperr && status "$test" "${white}COMP ERROR${no_color}" + printf "%s\n%s\n" "$dashsep" "$compout" >> "$complog" + ((++count_nocomp)) + fi +done + +$opt_terse && echo + +# summarize +$opt_summary && printf "\nSummary: ${white}${count_nocomp} compile errors${no_color}, ${red}${count_err} validation errors${no_color}, ${cyan}${count_ok} successes${no_color}\n" + +# dump logs +$opt_vallog && [[ -r $vallog ]] && cat "$vallog" +$opt_complog && [[ -r $complog ]] && cat "$complog" +$opt_dislog && [[ -r $dislog ]] && cat "$dislog" + +# exit code +[[ ${count_err} -gt 0 ]] && exit 1 +exit 0 diff --git a/deps/glslang/Test/variableArrayIndex.frag b/deps/glslang/Test/variableArrayIndex.frag new file mode 100644 index 00000000..63b49c78 --- /dev/null +++ b/deps/glslang/Test/variableArrayIndex.frag @@ -0,0 +1,48 @@ +#version 130 +uniform sampler2D sampler; +varying vec2 coord; + +struct lunarStruct1 { + int i; + float f; +}; + +struct lunarStruct2 { + int i; + float f; + lunarStruct1 s1_1; +}; + +struct lunarStruct3 { + lunarStruct2 s2_1[3]; + int i; + float f; + lunarStruct1 s1_1; +}; + + +uniform lunarStruct1 foo; +uniform lunarStruct2 foo2[5]; +uniform lunarStruct3 foo3; +uniform int Count; + +void main() +{ + float scale; + int iLocal = Count; + + if (foo3.s2_1[1].i > 0) + scale = foo2[foo3.s2_1[foo.i].i + 2 + ++iLocal].s1_1.f; + else + scale = foo3.s2_1[0].s1_1.f; + + //for (int i = 0; i < iLocal; ++i) { + // scale += foo2[i].f; + //} + + gl_FragColor = scale * texture2D(sampler, coord); + + vec2[3] constructed = vec2[3](coord, vec2(scale), vec2(1.0, 2.0)); + gl_FragColor += vec4(constructed[foo.i], constructed[foo.i]); +} + diff --git a/deps/glslang/Test/varyingArray.frag b/deps/glslang/Test/varyingArray.frag new file mode 100644 index 00000000..3bd152fe --- /dev/null +++ b/deps/glslang/Test/varyingArray.frag @@ -0,0 +1,19 @@ +#version 130 +uniform sampler2D texSampler2D; +varying vec4 color; +varying float alpha; + +varying vec4 gl_TexCoord[6]; + +varying vec4 foo[3]; + +void main() +{ + vec4 texColor = texture2D(texSampler2D, vec2(gl_TexCoord[4] + gl_TexCoord[5])); + + texColor += color; + + texColor.a = alpha; + + gl_FragColor = foo[1] + gl_TexCoord[0] + gl_TexCoord[4] + texColor; +} diff --git a/deps/glslang/Test/varyingArrayIndirect.frag b/deps/glslang/Test/varyingArrayIndirect.frag new file mode 100644 index 00000000..d45e601b --- /dev/null +++ b/deps/glslang/Test/varyingArrayIndirect.frag @@ -0,0 +1,21 @@ +#version 130 +uniform sampler2D texSampler2D; +varying vec4 color; +varying float alpha; + +varying vec4 gl_TexCoord[6]; + +varying vec4 userIn[2]; + +uniform int a, b; + +void main() +{ + vec4 texColor = texture2D(texSampler2D, vec2(userIn[b] + gl_TexCoord[a] + gl_TexCoord[5])); + + texColor += color; + + texColor.a = alpha; + + gl_FragColor = gl_TexCoord[0] + gl_TexCoord[b] + texColor + userIn[a]; +} diff --git a/deps/glslang/Test/versionsClean.frag b/deps/glslang/Test/versionsClean.frag new file mode 100644 index 00000000..6e19bf88 --- /dev/null +++ b/deps/glslang/Test/versionsClean.frag @@ -0,0 +1,45 @@ +// +//Copyright (C) 2012 LunarG, Inc. +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of LunarG Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. +// +#version 300 es + +in highp vec3 color; +out highp vec4 foo; + +uniform highp sampler2DArrayShadow bar; + +void main() +{ + foo = vec4(color, 142.0f); + discard; +} diff --git a/deps/glslang/Test/versionsClean.vert b/deps/glslang/Test/versionsClean.vert new file mode 100644 index 00000000..7c197857 --- /dev/null +++ b/deps/glslang/Test/versionsClean.vert @@ -0,0 +1,43 @@ +// +//Copyright (C) 2012 LunarG, Inc. +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of LunarG Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. +// +#version 420 compatibility + +attribute vec3 color; + +uniform sampler2DRect foo; + +void main() +{ + gl_Position = vec4(color, 142.0f); +} diff --git a/deps/glslang/Test/versionsErrors.frag b/deps/glslang/Test/versionsErrors.frag new file mode 100644 index 00000000..021c7356 --- /dev/null +++ b/deps/glslang/Test/versionsErrors.frag @@ -0,0 +1,46 @@ +// +//Copyright (C) 2012 LunarG, Inc. +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of LunarG Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. +// +#version 110 es + +#extension GL_ARB_texture_rectangle : disable + +attribute vec3 color; + +uniform sampler2DRect foo; + +void main() +{ + gl_FragColor = vec4(color, 142.0f); + discard; +} diff --git a/deps/glslang/Test/versionsErrors.vert b/deps/glslang/Test/versionsErrors.vert new file mode 100644 index 00000000..8736f2e7 --- /dev/null +++ b/deps/glslang/Test/versionsErrors.vert @@ -0,0 +1,46 @@ +// +//Copyright (C) 2012 LunarG, Inc. +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of LunarG Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. +// +#version 420 core + +#extension GL_ARB_texture_rectangle : enable + +attribute vec3 color; + +uniform sampler2DRect foo; + +void main() +{ + gl_Position = vec4(color, 142.0f); + discard; +} diff --git a/deps/glslang/Test/voidFunction.frag b/deps/glslang/Test/voidFunction.frag new file mode 100644 index 00000000..4767f7ab --- /dev/null +++ b/deps/glslang/Test/voidFunction.frag @@ -0,0 +1,34 @@ +#version 120 + +uniform vec4 bigColor; +varying vec4 BaseColor; +uniform float d; + +float bar = 2.0; + +void foo() +{ + bar++; + + return; +} + +void foo2() +{ + bar++; +} + +void main() +{ + vec4 outColor = bigColor; + + foo(); + + foo2(); + + outColor.x += bar; + + gl_FragColor = outColor; + + return; +} diff --git a/deps/glslang/Test/vulkan.ast.vert b/deps/glslang/Test/vulkan.ast.vert new file mode 100644 index 00000000..c5a6a42c --- /dev/null +++ b/deps/glslang/Test/vulkan.ast.vert @@ -0,0 +1,42 @@ +#version 450 + +layout(constant_id = 200) const float scf1 = 1.0; +layout(constant_id = 201) const bool scbt = true; +layout(constant_id = 202) const int sci2 = 2; + +void main() +{ + bool(scf1); // not a spec-const + bool(scbt); // spec-const + bool(sci2); // spec-const + + float(scf1); // not a spec-const + float(scbt); // not a spec-const + float(sci2); // not a spec-const + + int(scf1); // not a spec-const + int(scbt); // spec-const + int(sci2); // spec-const + + scf1 * scf1; // not a spec-const + scbt || scbt; // spec-const + sci2 * sci2; // spec-const + scf1 + sci2; // implicit conversion not a spec-const + + -scf1; // not a spec-const + !scbt; // spec-const + -sci2; // spec-const + + scf1 > scf1; // not a spec-const + sci2 > sci2; // spec-const + + scf1 != scf1; // not a spec-const + scbt != scbt; // spec-const + sci2 != sci2; // spec-const + + ivec2(sci2, sci2); // spec-const + ivec2[2](ivec2(sci2, sci2), ivec2(sci2, sci2)); // not a spec-const + + vec2(scf1, scf1); // not spec-const + vec2[2](vec2(scf1, scf1), vec2(scf1, scf1)); // not a spec-const +} diff --git a/deps/glslang/Test/vulkan.comp b/deps/glslang/Test/vulkan.comp new file mode 100644 index 00000000..6b6f4cf3 --- /dev/null +++ b/deps/glslang/Test/vulkan.comp @@ -0,0 +1,12 @@ +#version 450 + +layout(local_size_x_id = 18, local_size_z_id = 19) in; +layout(local_size_x = 32, local_size_y = 32) in; +layout(local_size_z_id = 14) in; // ERROR, can't change this + +void main() +{ + gl_WorkGroupSize; +} + +layout(local_size_y_id = 19) in; // ERROR, already used: TODO not yet reported diff --git a/deps/glslang/Test/vulkan.frag b/deps/glslang/Test/vulkan.frag new file mode 100644 index 00000000..46c14f31 --- /dev/null +++ b/deps/glslang/Test/vulkan.frag @@ -0,0 +1,105 @@ +#version 450 + +uniform sampler s; // ERROR, no binding +uniform sampler sA[4]; // ERROR, no binding +uniform texture2D t2d; // ERROR, no binding +uniform texture3D t3d[4]; // ERROR, no binding +int i; +uniform samplerShadow sShadow; +uniform texture3D t3d5[5]; +writeonly uniform image2D i2d; + +void badConst() +{ + sampler2D(t2d); // ERROR, need 2 args + sampler2D(s, s); // ERROR, wrong type + sampler2D(i, i); // ERROR, wrong type + sampler2D(t2d, i); // ERROR, wrong type + sampler2D(t2d, t2d); // ERROR, wrong type + sampler2D(t2d, sA); // ERROR, wrong type + + sampler3D[4](t3d5, sA[2]); // ERROR, can't make array + sampler2D(i2d, s); // ERROR, image instead of texture + sampler2D(t3d[1], s); // ERROR, 3D not 2D + sampler2D(t2d, sShadow); + sampler2DShadow(t2d, s); +} + +sampler2D s2D = sampler2D(t2d, s); // ERROR, no sampler constructor +sampler3D s3d[4] = sampler3D[4](t3d, sA[2]); // ERROR, no sampler constructor + +out vec4 color; // ERROR, no location + +void main() +{ + color = texture(s2D, vec2(0.5)); + color += texture(s3d[i], vec3(0.5)); +} + +layout(push_constant) buffer pcb { // ERROR, not on a buffer + int a; +} pcbInst; + +layout(push_constant) uniform float pcfloat; // ERROR 2X: not on a non-block, and non-opaque outside block + +layout(push_constant) uniform; // ERROR, needs an object +layout(std430, push_constant) uniform pcb1 { int a; } pcb1inst; +layout(push_constant) uniform pcb2 { + int a; +}; // Okay now to have no instance name + +layout(input_attachment_index = 2) uniform subpassInput subD; +layout(input_attachment_index = 3) uniform texture2D subDbad1; // ERROR, not a texture +layout(input_attachment_index = 4) writeonly uniform image2D subDbad2; // ERROR, not an image +uniform subpassInput subDbad3; // ERROR, need attachment number +layout(input_attachment_index = 2) uniform subpassInputMS subDMS; + +void foo() +{ + vec4 v = subpassLoad(subD); + v += subpassLoadMS(subD); // ERROR, no such function + v += subpassLoad(subD, 2); // ERROR, no such sig. + v += subpassLoad(subDMS, 2); + v += subpassLoadMS(subDMS, 2); // ERROR, no such function +} + +subroutine int fooS; // ERROR, not in SPV +subroutine int fooSub(); // ERROR, not in SPV + +uniform vec4 dv4; // ERROR, no default uniforms + +void fooTex() +{ + texture(t2d, vec2(1.0)); // ERROR, need a sampler, not a pure texture + imageStore(t2d, ivec2(4, 5), vec4(1.2)); // ERROR, need an image, not a pure texture +} + +precision highp float; + +layout(location=0) in vec2 vTexCoord; +layout(location=0) out vec4 FragColor; + +vec4 userTexture(mediump sampler2D samp, vec2 coord) +{ + return texture(samp, coord); +} + +bool cond; + +void callUserTexture() +{ + userTexture(sampler2D(t2d,s), vTexCoord); // ERROR, not point of use + userTexture((sampler2D(t2d,s)), vTexCoord); // ERROR, not point of use + userTexture((sampler2D(t2d,s), sampler2D(t2d,s)), vTexCoord); // ERROR, not point of use + userTexture(cond ? sampler2D(t2d,s) : sampler2D(t2d,s), vTexCoord); // ERROR, no ?:, not point of use + + gl_NumSamples; // ERROR, not for Vulkan +} + +void noise() +{ + noise1(dv4); + noise2(4.0); + noise3(vec2(3)); + noise4(dv4); +} diff --git a/deps/glslang/Test/vulkan.vert b/deps/glslang/Test/vulkan.vert new file mode 100644 index 00000000..a6af2d57 --- /dev/null +++ b/deps/glslang/Test/vulkan.vert @@ -0,0 +1,65 @@ +#version 450 + +layout(input_attachment_index = 2) uniform subpassInput subD1; // ERROR, not this stage +layout(input_attachment_index = 2) uniform isubpassInput subD2; // ERROR, not this stage +layout(input_attachment_index = 2) uniform usubpassInput subD3; // ERROR, not this stage +layout(input_attachment_index = 2) uniform subpassInputMS subD4; // ERROR, not this stage +layout(input_attachment_index = 2) uniform isubpassInputMS subD5; // ERROR, not this stage +layout(input_attachment_index = 2) uniform usubpassInputMS subD6; // ERROR, not this stage + +out vec4 color; + +layout(constant_id = 17) const ivec2 arraySizes = ivec2(12,13); // ERROR, not a scalar +layout(constant_id = 17) uniform sampler2D s2D; // ERROR, not the right type or qualifier +layout(constant_id = 4000) const int c1 = 12; // ERROR, too big +layout(constant_id = 4) const float c2[2] = float[2](1.0, 2.0); // ERROR, not a scalar +layout(constant_id = 4) in; + +void main() +{ + color = subpassLoad(subD1); // ERROR, no such function in this stage +} + +layout(binding = 0) uniform atomic_uint aui; // ERROR, no atomics in Vulkan +layout(shared) uniform ub1n { int a; } ub1i; // ERROR, no shared +layout(packed) uniform ub2n { int a; } ub2i; // ERROR, no packed + +layout(constant_id=222) const int arraySize = 4; + +void foo() +{ + int a1[arraySize]; + int a2[arraySize] = a1; // ERROR, can't use in initializer + + a1 = a2; // ERROR, can't assign, even though the same type + if (a1 == a2) // ERROR, can't compare either + ++color; +} + +layout(set = 1, push_constant) uniform badpc { int a; } badpcI; // ERROR, no descriptor set with push_constant + +#ifndef VULKAN +#error VULKAN should be defined +#endif + +#if VULKAN != 100 +#error VULKAN should be 100 +#endif + +float AofA0[2][arraySize]; // ERROR, only outer dimension +float AofA1[arraySize][arraySize]; // ERROR, only outer dimension +float AofA2[arraySize][2 + arraySize]; // ERROR, only outer dimension +float AofA3[arraySize][2]; + +out ban1 { // ERROR, only outer dimension + float f; +} bai1[2][arraySize]; + +out ban2 { + float f; +} bai2[arraySize][2]; + +layout(binding = 3000) uniform sampler2D s3000; +layout(binding = 3001) uniform b3001 { int a; }; +layout(location = 10) in vec4 in1; +layout(location = 10) in vec4 in2; // ERROR, no location aliasing diff --git a/deps/glslang/Test/whileLoop.frag b/deps/glslang/Test/whileLoop.frag new file mode 100644 index 00000000..a9541f91 --- /dev/null +++ b/deps/glslang/Test/whileLoop.frag @@ -0,0 +1,16 @@ +#version 110 + +uniform vec4 bigColor; +varying vec4 BaseColor; +uniform float d; + +void main() +{ + vec4 color = BaseColor; + + while (color.x < d) { + color += bigColor; + } + + gl_FragColor = color; +} diff --git a/deps/glslang/build_overrides/glslang.gni b/deps/glslang/build_overrides/glslang.gni new file mode 100644 index 00000000..500578cc --- /dev/null +++ b/deps/glslang/build_overrides/glslang.gni @@ -0,0 +1,37 @@ +# Copyright (C) 2018 Google, Inc. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +# These are variables that are overridable by projects that include glslang. + +# The path to glslang dependencies. +glslang_spirv_tools_dir = "//Externals/spirv-tools" diff --git a/deps/glslang/glslang/CMakeLists.txt b/deps/glslang/glslang/CMakeLists.txt index 7a50ab67..5f51476b 100644 --- a/deps/glslang/glslang/CMakeLists.txt +++ b/deps/glslang/glslang/CMakeLists.txt @@ -80,10 +80,18 @@ set(HEADERS # WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) # set(BISON_GLSLParser_OUTPUT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp) -add_library(glslang STATIC ${BISON_GLSLParser_OUTPUT_SOURCE} ${SOURCES} ${HEADERS}) +glslang_pch(SOURCES MachineIndependent/pch.cpp) + +add_library(glslang ${LIB_TYPE} ${BISON_GLSLParser_OUTPUT_SOURCE} ${SOURCES} ${HEADERS}) set_property(TARGET glslang PROPERTY FOLDER glslang) set_property(TARGET glslang PROPERTY POSITION_INDEPENDENT_CODE ON) target_link_libraries(glslang OGLCompiler OSDependent) +target_include_directories(glslang PUBLIC ..) + +if(WIN32 AND BUILD_SHARED_LIBS) + set_target_properties(glslang PROPERTIES PREFIX "") +endif() + if(ENABLE_HLSL) target_link_libraries(glslang HLSL) endif() @@ -97,8 +105,14 @@ if(WIN32) endif(WIN32) if(ENABLE_GLSLANG_INSTALL) - install(TARGETS glslang - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + if(BUILD_SHARED_LIBS) + install(TARGETS glslang + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + else() + install(TARGETS glslang + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() endif(ENABLE_GLSLANG_INSTALL) if(ENABLE_GLSLANG_INSTALL) diff --git a/deps/glslang/glslang/Include/BaseTypes.h b/deps/glslang/glslang/Include/BaseTypes.h index 46fe159b..4a7c0568 100644 --- a/deps/glslang/glslang/Include/BaseTypes.h +++ b/deps/glslang/glslang/Include/BaseTypes.h @@ -62,6 +62,10 @@ enum TBasicType { EbtStruct, EbtBlock, +#ifdef NV_EXTENSIONS + EbtAccStructNV, +#endif + // HLSL types that live only temporarily. EbtString, @@ -88,6 +92,14 @@ enum TStorageQualifier { EvqBuffer, // read/write, shared with app EvqShared, // compute shader's read/write 'shared' qualifier +#ifdef NV_EXTENSIONS + EvqPayloadNV, + EvqPayloadInNV, + EvqHitAttrNV, + EvqCallableDataNV, + EvqCallableDataInNV, +#endif + // parameters EvqIn, // also, for 'in' in the grammar before we know if it's a pipeline input or an 'in' parameter EvqOut, // also, for 'out' in the grammar before we know if it's a pipeline output or an 'out' parameter @@ -227,6 +239,33 @@ enum TBuiltInVariable { EbvPositionPerViewNV, EbvViewportMaskPerViewNV, EbvFragFullyCoveredNV, + EbvFragmentSizeNV, + EbvInvocationsPerPixelNV, + // raytracing + EbvLaunchIdNV, + EbvLaunchSizeNV, + EbvInstanceCustomIndexNV, + EbvWorldRayOriginNV, + EbvWorldRayDirectionNV, + EbvObjectRayOriginNV, + EbvObjectRayDirectionNV, + EbvRayTminNV, + EbvRayTmaxNV, + EbvHitTNV, + EbvHitKindNV, + EbvObjectToWorldNV, + EbvWorldToObjectNV, + EbvIncomingRayFlagsNV, + EbvBaryCoordNV, + EbvBaryCoordNoPerspNV, + EbvTaskCountNV, + EbvPrimitiveCountNV, + EbvPrimitiveIndicesNV, + EbvClipDistancePerViewNV, + EbvCullDistancePerViewNV, + EbvLayerPerViewNV, + EbvMeshViewCountNV, + EbvMeshViewIndicesNV, #endif // HLSL built-ins that live only temporarily, until they get remapped @@ -273,6 +312,13 @@ __inline const char* GetStorageQualifierString(TStorageQualifier q) case EvqPointCoord: return "gl_PointCoord"; break; case EvqFragColor: return "fragColor"; break; case EvqFragDepth: return "gl_FragDepth"; break; +#ifdef NV_EXTENSIONS + case EvqPayloadNV: return "rayPayloadNV"; break; + case EvqPayloadInNV: return "rayPayloadInNV"; break; + case EvqHitAttrNV: return "hitAttributeNV"; break; + case EvqCallableDataNV: return "callableDataNV"; break; + case EvqCallableDataInNV: return "callableDataInNV"; break; +#endif default: return "unknown qualifier"; } } @@ -365,6 +411,33 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v) case EbvPositionPerViewNV: return "PositionPerViewNV"; case EbvViewportMaskPerViewNV: return "ViewportMaskPerViewNV"; case EbvFragFullyCoveredNV: return "FragFullyCoveredNV"; + case EbvFragmentSizeNV: return "FragmentSizeNV"; + case EbvInvocationsPerPixelNV: return "InvocationsPerPixelNV"; + case EbvLaunchIdNV: return "LaunchIdNV"; + case EbvLaunchSizeNV: return "LaunchSizeNV"; + case EbvInstanceCustomIndexNV: return "InstanceCustomIndexNV"; + case EbvWorldRayOriginNV: return "WorldRayOriginNV"; + case EbvWorldRayDirectionNV: return "WorldRayDirectionNV"; + case EbvObjectRayOriginNV: return "ObjectRayOriginNV"; + case EbvObjectRayDirectionNV: return "ObjectRayDirectionNV"; + case EbvRayTminNV: return "ObjectRayTminNV"; + case EbvRayTmaxNV: return "ObjectRayTmaxNV"; + case EbvHitTNV: return "HitTNV"; + case EbvHitKindNV: return "HitKindNV"; + case EbvIncomingRayFlagsNV: return "IncomingRayFlagsNV"; + case EbvObjectToWorldNV: return "ObjectToWorldNV"; + case EbvWorldToObjectNV: return "WorldToObjectNV"; + + case EbvBaryCoordNV: return "BaryCoordNV"; + case EbvBaryCoordNoPerspNV: return "BaryCoordNoPerspNV"; + case EbvTaskCountNV: return "TaskCountNV"; + case EbvPrimitiveCountNV: return "PrimitiveCountNV"; + case EbvPrimitiveIndicesNV: return "PrimitiveIndicesNV"; + case EbvClipDistancePerViewNV: return "ClipDistancePerViewNV"; + case EbvCullDistancePerViewNV: return "CullDistancePerViewNV"; + case EbvLayerPerViewNV: return "LayerPerViewNV"; + case EbvMeshViewCountNV: return "MeshViewCountNV"; + case EbvMeshViewIndicesNV: return "MeshViewIndicesNV"; #endif default: return "unknown built-in variable"; } diff --git a/deps/glslang/glslang/Include/ResourceLimits.h b/deps/glslang/glslang/Include/ResourceLimits.h index 0d07b8c8..106b21d9 100644 --- a/deps/glslang/glslang/Include/ResourceLimits.h +++ b/deps/glslang/glslang/Include/ResourceLimits.h @@ -133,6 +133,15 @@ struct TBuiltInResource { int maxCullDistances; int maxCombinedClipAndCullDistances; int maxSamples; + int maxMeshOutputVerticesNV; + int maxMeshOutputPrimitivesNV; + int maxMeshWorkGroupSizeX_NV; + int maxMeshWorkGroupSizeY_NV; + int maxMeshWorkGroupSizeZ_NV; + int maxTaskWorkGroupSizeX_NV; + int maxTaskWorkGroupSizeY_NV; + int maxTaskWorkGroupSizeZ_NV; + int maxMeshViewCountNV; TLimits limits; }; diff --git a/deps/glslang/glslang/Include/Types.h b/deps/glslang/glslang/Include/Types.h index 39d6737c..ae9cf402 100644 --- a/deps/glslang/glslang/Include/Types.h +++ b/deps/glslang/glslang/Include/Types.h @@ -456,12 +456,23 @@ class TQualifier { nopersp = false; #ifdef AMD_EXTENSIONS explicitInterp = false; +#endif +#ifdef NV_EXTENSIONS + pervertexNV = false; + perPrimitiveNV = false; + perViewNV = false; + perTaskNV = false; #endif } void clearMemory() { coherent = false; + devicecoherent = false; + queuefamilycoherent = false; + workgroupcoherent = false; + subgroupcoherent = false; + nonprivate = false; volatil = false; restrict = false; readonly = false; @@ -495,10 +506,21 @@ class TQualifier { bool nopersp : 1; #ifdef AMD_EXTENSIONS bool explicitInterp : 1; +#endif +#ifdef NV_EXTENSIONS + bool pervertexNV : 1; + bool perPrimitiveNV : 1; + bool perViewNV : 1; + bool perTaskNV : 1; #endif bool patch : 1; bool sample : 1; bool coherent : 1; + bool devicecoherent : 1; + bool queuefamilycoherent : 1; + bool workgroupcoherent : 1; + bool subgroupcoherent : 1; + bool nonprivate : 1; bool volatil : 1; bool restrict : 1; bool readonly : 1; @@ -508,8 +530,13 @@ class TQualifier { bool isMemory() const { - return coherent || volatil || restrict || readonly || writeonly; + return subgroupcoherent || workgroupcoherent || queuefamilycoherent || devicecoherent || coherent || volatil || restrict || readonly || writeonly || nonprivate; } + bool isMemoryQualifierImageAndSSBOOnly() const + { + return subgroupcoherent || workgroupcoherent || queuefamilycoherent || devicecoherent || coherent || volatil || restrict || readonly || writeonly; + } + bool isInterpolation() const { #ifdef AMD_EXTENSIONS @@ -518,15 +545,21 @@ class TQualifier { return flat || smooth || nopersp; #endif } + #ifdef AMD_EXTENSIONS bool isExplicitInterpolation() const { return explicitInterp; } #endif + bool isAuxiliary() const { +#ifdef NV_EXTENSIONS + return centroid || patch || sample || pervertexNV; +#else return centroid || patch || sample; +#endif } bool isPipeInput() const @@ -593,6 +626,33 @@ class TQualifier { } } + bool isPerPrimitive() const + { +#ifdef NV_EXTENSIONS + return perPrimitiveNV; +#else + return false; +#endif + } + + bool isPerView() const + { +#ifdef NV_EXTENSIONS + return perViewNV; +#else + return false; +#endif + } + + bool isTaskMemory() const + { +#ifdef NV_EXTENSIONS + return perTaskNV; +#else + return false; +#endif + } + bool isIo() const { switch (storage) { @@ -616,6 +676,22 @@ class TQualifier { } } + // non-built-in symbols that might link between compilation units + bool isLinkable() const + { + switch (storage) { + case EvqGlobal: + case EvqVaryingIn: + case EvqVaryingOut: + case EvqUniform: + case EvqBuffer: + case EvqShared: + return true; + default: + return false; + } + } + // True if this type of IO is supposed to be arrayed with extra level for per-vertex data bool isArrayedIo(EShLanguage language) const { @@ -626,6 +702,13 @@ class TQualifier { return ! patch && (isPipeInput() || isPipeOutput()); case EShLangTessEvaluation: return ! patch && isPipeInput(); +#ifdef NV_EXTENSIONS + case EShLangFragment: + return pervertexNV && isPipeInput(); + case EShLangMeshNV: + return ! perTaskNV && isPipeOutput(); +#endif + default: return false; } @@ -642,6 +725,7 @@ class TQualifier { layoutViewportRelative = false; // -2048 as the default value indicating layoutSecondaryViewportRelative is not set layoutSecondaryViewportRelativeOffset = -2048; + layoutShaderRecordNV = false; #endif clearInterstageLayout(); @@ -675,6 +759,9 @@ class TQualifier { hasAnyLocation() || hasStream() || hasFormat() || +#ifdef NV_EXTENSIONS + layoutShaderRecordNV || +#endif layoutPushConstant; } bool hasLayout() const @@ -728,6 +815,7 @@ class TQualifier { bool layoutPassthrough; bool layoutViewportRelative; int layoutSecondaryViewportRelativeOffset; + bool layoutShaderRecordNV; #endif bool hasUniformLayout() const @@ -1005,7 +1093,7 @@ struct TShaderQualifiers { bool pixelCenterInteger; // fragment shader bool originUpperLeft; // fragment shader int invocations; - int vertices; // both for tessellation "vertices" and geometry "max_vertices" + int vertices; // for tessellation "vertices", geometry & mesh "max_vertices" TVertexSpacing spacing; TVertexOrder order; bool pointMode; @@ -1018,7 +1106,10 @@ struct TShaderQualifiers { int numViews; // multiview extenstions #ifdef NV_EXTENSIONS - bool layoutOverrideCoverage; // true if layout override_coverage set + bool layoutOverrideCoverage; // true if layout override_coverage set + bool layoutDerivativeGroupQuads; // true if layout derivative_group_quadsNV set + bool layoutDerivativeGroupLinear; // true if layout derivative_group_linearNV set + int primitives; // mesh shader "max_primitives"DerivativeGroupLinear; // true if layout derivative_group_linearNV set #endif void init() @@ -1043,7 +1134,10 @@ struct TShaderQualifiers { blendEquation = false; numViews = TQualifier::layoutNotSet; #ifdef NV_EXTENSIONS - layoutOverrideCoverage = false; + layoutOverrideCoverage = false; + layoutDerivativeGroupQuads = false; + layoutDerivativeGroupLinear = false; + primitives = TQualifier::layoutNotSet; #endif } @@ -1088,6 +1182,12 @@ struct TShaderQualifiers { #ifdef NV_EXTENSIONS if (src.layoutOverrideCoverage) layoutOverrideCoverage = src.layoutOverrideCoverage; + if (src.layoutDerivativeGroupQuads) + layoutDerivativeGroupQuads = src.layoutDerivativeGroupQuads; + if (src.layoutDerivativeGroupLinear) + layoutDerivativeGroupLinear = src.layoutDerivativeGroupLinear; + if (src.primitives != TQualifier::layoutNotSet) + primitives = src.primitives; #endif } }; @@ -1386,7 +1486,11 @@ class TType { } return false; } - virtual bool isOpaque() const { return basicType == EbtSampler || basicType == EbtAtomicUint; } + virtual bool isOpaque() const { return basicType == EbtSampler || basicType == EbtAtomicUint +#ifdef NV_EXTENSIONS + || basicType == EbtAccStructNV +#endif + ; } virtual bool isBuiltIn() const { return getQualifier().builtIn != EbvNone; } // "Image" is a superset of "Subpass" @@ -1472,6 +1576,16 @@ class TType { return contains([](const TType* t) { return t->isArray() && t->arraySizes->isOuterSpecialization(); } ); } + virtual bool contains16BitInt() const + { + return containsBasicType(EbtInt16) || containsBasicType(EbtUint16); + } + + virtual bool contains8BitInt() const + { + return containsBasicType(EbtInt8) || containsBasicType(EbtUint8); + } + // Array editing methods. Array descriptors can be shared across // type instances. This allows all uses of the same array // to be updated at once. E.g., all nodes can be explicitly sized @@ -1530,6 +1644,11 @@ class TType { { if (isUnsizedArray() && !(skipNonvariablyIndexed || isArrayVariablyIndexed())) changeOuterArraySize(getImplicitArraySize()); +#ifdef NV_EXTENSIONS + // For multi-dim per-view arrays, set unsized inner dimension size to 1 + if (qualifier.isPerView() && arraySizes && arraySizes->isInnerUnsized()) + arraySizes->clearInnerUnsized(); +#endif if (isStruct() && structure->size() > 0) { int lastMember = (int)structure->size() - 1; for (int i = 0; i < lastMember; ++i) @@ -1564,6 +1683,9 @@ class TType { case EbtSampler: return "sampler/image"; case EbtStruct: return "structure"; case EbtBlock: return "block"; +#ifdef NV_EXTENSIONS + case EbtAccStructNV: return "accelerationStructureNV"; +#endif default: return "unknown type"; } } @@ -1659,6 +1781,8 @@ class TType { appendStr(" layoutSecondaryViewportRelativeOffset="); appendInt(qualifier.layoutSecondaryViewportRelativeOffset); } + if (qualifier.layoutShaderRecordNV) + appendStr(" shaderRecordNV"); #endif appendStr(")"); @@ -1680,6 +1804,16 @@ class TType { #ifdef AMD_EXTENSIONS if (qualifier.explicitInterp) appendStr(" __explicitInterpAMD"); +#endif +#ifdef NV_EXTENSIONS + if (qualifier.pervertexNV) + appendStr(" pervertexNV"); + if (qualifier.perPrimitiveNV) + appendStr(" perprimitiveNV"); + if (qualifier.perViewNV) + appendStr(" perviewNV"); + if (qualifier.perTaskNV) + appendStr(" taskNV"); #endif if (qualifier.patch) appendStr(" patch"); @@ -1687,6 +1821,16 @@ class TType { appendStr(" sample"); if (qualifier.coherent) appendStr(" coherent"); + if (qualifier.devicecoherent) + appendStr(" devicecoherent"); + if (qualifier.queuefamilycoherent) + appendStr(" queuefamilycoherent"); + if (qualifier.workgroupcoherent) + appendStr(" workgroupcoherent"); + if (qualifier.subgroupcoherent) + appendStr(" subgroupcoherent"); + if (qualifier.nonprivate) + appendStr(" nonprivate"); if (qualifier.volatil) appendStr(" volatile"); if (qualifier.restrict) diff --git a/deps/glslang/glslang/Include/arrays.h b/deps/glslang/glslang/Include/arrays.h index 7e1f9396..af8f560b 100644 --- a/deps/glslang/glslang/Include/arrays.h +++ b/deps/glslang/glslang/Include/arrays.h @@ -43,10 +43,6 @@ #include -#ifdef max -#undef max -#endif - namespace glslang { // This is used to mean there is no size yet (unsized), it is waiting to get a size from somewhere else. diff --git a/deps/glslang/glslang/Include/intermediate.h b/deps/glslang/glslang/Include/intermediate.h index 19eb7aa8..27250070 100644 --- a/deps/glslang/glslang/Include/intermediate.h +++ b/deps/glslang/glslang/Include/intermediate.h @@ -592,6 +592,8 @@ enum TOperator { EOpAtomicXor, EOpAtomicExchange, EOpAtomicCompSwap, + EOpAtomicLoad, + EOpAtomicStore, EOpAtomicCounterIncrement, // results in pre-increment value EOpAtomicCounterDecrement, // results in post-decrement value @@ -784,6 +786,8 @@ enum TOperator { EOpImageAtomicXor, EOpImageAtomicExchange, EOpImageAtomicCompSwap, + EOpImageAtomicLoad, + EOpImageAtomicStore, EOpSubpassLoad, EOpSubpassLoadMS, @@ -861,6 +865,16 @@ enum TOperator { #endif EOpSparseTextureGuardEnd, + +#ifdef NV_EXTENSIONS + EOpImageFootprintGuardBegin, + EOpImageSampleFootprintNV, + EOpImageSampleFootprintClampNV, + EOpImageSampleFootprintLodNV, + EOpImageSampleFootprintGradNV, + EOpImageSampleFootprintGradClampNV, + EOpImageFootprintGuardEnd, +#endif EOpSamplingGuardEnd, EOpTextureGuardEnd, @@ -879,6 +893,14 @@ enum TOperator { EOpFindLSB, EOpFindMSB, +#ifdef NV_EXTENSIONS + EOpTraceNV, + EOpReportIntersectionNV, + EOpIgnoreIntersectionNV, + EOpTerminateRayNV, + EOpExecuteCallableNV, + EOpWritePackedPrimitiveIndices4x8NV, +#endif // // HLSL operations // @@ -1164,6 +1186,7 @@ class TIntermSymbol : public TIntermTyped { constSubtree(nullptr) { name = n; } virtual int getId() const { return id; } + virtual void changeId(int i) { id = i; } virtual const TString& getName() const { return name; } virtual void traverse(TIntermTraverser*); virtual TIntermSymbol* getAsSymbolNode() { return this; } @@ -1243,6 +1266,9 @@ class TIntermOperator : public TIntermTyped { bool isSampling() const { return op > EOpSamplingGuardBegin && op < EOpSamplingGuardEnd; } bool isImage() const { return op > EOpImageGuardBegin && op < EOpImageGuardEnd; } bool isSparseTexture() const { return op > EOpSparseTextureGuardBegin && op < EOpSparseTextureGuardEnd; } +#ifdef NV_EXTENSIONS + bool isImageFootprint() const { return op > EOpImageFootprintGuardBegin && op < EOpImageFootprintGuardEnd; } +#endif bool isSparseImage() const { return op == EOpSparseImageLoad; } void setOperationPrecision(TPrecisionQualifier p) { operationPrecision = p; } @@ -1415,6 +1441,23 @@ class TIntermOperator : public TIntermTyped { cracked.subpass = sampler.dim == EsdSubpass; cracked.fragMask = true; break; +#endif +#ifdef NV_EXTENSIONS + case EOpImageSampleFootprintNV: + break; + case EOpImageSampleFootprintClampNV: + cracked.lodClamp = true; + break; + case EOpImageSampleFootprintLodNV: + cracked.lod = true; + break; + case EOpImageSampleFootprintGradNV: + cracked.grad = true; + break; + case EOpImageSampleFootprintGradClampNV: + cracked.lodClamp = true; + cracked.grad = true; + break; #endif case EOpSubpassLoad: case EOpSubpassLoadMS: diff --git a/deps/glslang/glslang/Include/revision.h b/deps/glslang/glslang/Include/revision.h index ea5e30cb..3bd41cab 100644 --- a/deps/glslang/glslang/Include/revision.h +++ b/deps/glslang/glslang/Include/revision.h @@ -1,3 +1,3 @@ // This header is generated by the make-revision script. -#define GLSLANG_PATCH_LEVEL 2691 +#define GLSLANG_PATCH_LEVEL 2984 diff --git a/deps/glslang/glslang/Include/revision.template b/deps/glslang/glslang/Include/revision.template index 4a16beeb..6c13630b 100644 --- a/deps/glslang/glslang/Include/revision.template +++ b/deps/glslang/glslang/Include/revision.template @@ -1,13 +1,13 @@ -// The file revision.h should be updated to the latest version, somehow, on -// check-in, if glslang has changed. -// -// revision.template is the source for revision.h when using SubWCRev as the -// method of updating revision.h. You don't have to do it this way, the -// requirement is only that revision.h gets updated. -// -// revision.h is under source control so that not all consumers of glslang -// source have to figure out how to create revision.h just to get a build -// going. However, if it is not updated, it can be a version behind. - -#define GLSLANG_REVISION "$WCREV$" -#define GLSLANG_DATE "$WCDATE$" +// The file revision.h should be updated to the latest version, somehow, on +// check-in, if glslang has changed. +// +// revision.template is the source for revision.h when using SubWCRev as the +// method of updating revision.h. You don't have to do it this way, the +// requirement is only that revision.h gets updated. +// +// revision.h is under source control so that not all consumers of glslang +// source have to figure out how to create revision.h just to get a build +// going. However, if it is not updated, it can be a version behind. + +#define GLSLANG_REVISION "$WCREV$" +#define GLSLANG_DATE "$WCDATE$" diff --git a/deps/glslang/glslang/MachineIndependent/Constant.cpp b/deps/glslang/glslang/MachineIndependent/Constant.cpp index 142492dc..b33af84d 100644 --- a/deps/glslang/glslang/MachineIndependent/Constant.cpp +++ b/deps/glslang/glslang/MachineIndependent/Constant.cpp @@ -179,69 +179,76 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right case EbtDouble: case EbtFloat: case EbtFloat16: - newConstArray[i].setDConst(leftUnionArray[i].getDConst() / rightUnionArray[i].getDConst()); + if (rightUnionArray[i].getDConst() != 0.0) + newConstArray[i].setDConst(leftUnionArray[i].getDConst() / rightUnionArray[i].getDConst()); + else if (leftUnionArray[i].getDConst() > 0.0) + newConstArray[i].setDConst((double)INFINITY); + else if (leftUnionArray[i].getDConst() < 0.0) + newConstArray[i].setDConst(-(double)INFINITY); + else + newConstArray[i].setDConst((double)NAN); break; case EbtInt8: - if (rightUnionArray[i] == 0) - newConstArray[i].setI8Const(0x7F); - else if (rightUnionArray[i].getI8Const() == -1 && leftUnionArray[i].getI8Const() == (signed char)0x80) - newConstArray[i].setI8Const((signed char)0x80); + if (rightUnionArray[i] == (signed char)0) + newConstArray[i].setI8Const((signed char)0x7F); + else if (rightUnionArray[i].getI8Const() == (signed char)-1 && leftUnionArray[i].getI8Const() == (signed char)-0x80) + newConstArray[i].setI8Const((signed char)-0x80); else newConstArray[i].setI8Const(leftUnionArray[i].getI8Const() / rightUnionArray[i].getI8Const()); break; case EbtUint8: - if (rightUnionArray[i] == 0) { - newConstArray[i].setU8Const(0xFF); - } else + if (rightUnionArray[i] == (unsigned char)0u) + newConstArray[i].setU8Const((unsigned char)0xFFu); + else newConstArray[i].setU8Const(leftUnionArray[i].getU8Const() / rightUnionArray[i].getU8Const()); break; case EbtInt16: - if (rightUnionArray[i] == 0) - newConstArray[i].setI16Const(0x7FFF); - else if (rightUnionArray[i].getI16Const() == -1 && leftUnionArray[i].getI16Const() == (signed short)0x8000) - newConstArray[i].setI16Const(short(0x8000)); + if (rightUnionArray[i] == (signed short)0) + newConstArray[i].setI16Const((signed short)0x7FFF); + else if (rightUnionArray[i].getI16Const() == (signed short)-1 && leftUnionArray[i].getI16Const() == (signed short)-0x8000) + newConstArray[i].setI16Const((signed short)-0x8000); else newConstArray[i].setI16Const(leftUnionArray[i].getI16Const() / rightUnionArray[i].getI16Const()); break; case EbtUint16: - if (rightUnionArray[i] == 0) { - newConstArray[i].setU16Const(0xFFFF); - } else + if (rightUnionArray[i] == (unsigned short)0u) + newConstArray[i].setU16Const((unsigned short)0xFFFFu); + else newConstArray[i].setU16Const(leftUnionArray[i].getU16Const() / rightUnionArray[i].getU16Const()); break; case EbtInt: if (rightUnionArray[i] == 0) newConstArray[i].setIConst(0x7FFFFFFF); - else if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == (int)0x80000000) - newConstArray[i].setIConst(0x80000000); + else if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == (int)-0x80000000ll) + newConstArray[i].setIConst((int)-0x80000000ll); else newConstArray[i].setIConst(leftUnionArray[i].getIConst() / rightUnionArray[i].getIConst()); break; case EbtUint: - if (rightUnionArray[i] == 0) { + if (rightUnionArray[i] == 0u) newConstArray[i].setUConst(0xFFFFFFFFu); - } else + else newConstArray[i].setUConst(leftUnionArray[i].getUConst() / rightUnionArray[i].getUConst()); break; case EbtInt64: - if (rightUnionArray[i] == 0) + if (rightUnionArray[i] == 0ll) newConstArray[i].setI64Const(0x7FFFFFFFFFFFFFFFll); - else if (rightUnionArray[i].getI64Const() == -1 && leftUnionArray[i].getI64Const() == (long long)0x8000000000000000) - newConstArray[i].setI64Const(0x8000000000000000); + else if (rightUnionArray[i].getI64Const() == -1 && leftUnionArray[i].getI64Const() == (long long)-0x8000000000000000ll) + newConstArray[i].setI64Const((long long)-0x8000000000000000ll); else newConstArray[i].setI64Const(leftUnionArray[i].getI64Const() / rightUnionArray[i].getI64Const()); break; case EbtUint64: - if (rightUnionArray[i] == 0) { + if (rightUnionArray[i] == 0ull) newConstArray[i].setU64Const(0xFFFFFFFFFFFFFFFFull); - } else + else newConstArray[i].setU64Const(leftUnionArray[i].getU64Const() / rightUnionArray[i].getU64Const()); break; default: diff --git a/deps/glslang/glslang/MachineIndependent/Initialize.cpp b/deps/glslang/glslang/MachineIndependent/Initialize.cpp index 5ae4dbd0..a17ea1ae 100644 --- a/deps/glslang/glslang/MachineIndependent/Initialize.cpp +++ b/deps/glslang/glslang/MachineIndependent/Initialize.cpp @@ -122,6 +122,158 @@ TBuiltIns::~TBuiltIns() // void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvVersion) { + //============================================================================ + // + // Prototypes for built-in functions used repeatly by different shaders + // + //============================================================================ + + // + // Derivatives Functions. + // + TString derivatives ( + "float dFdx(float p);" + "vec2 dFdx(vec2 p);" + "vec3 dFdx(vec3 p);" + "vec4 dFdx(vec4 p);" + + "float dFdy(float p);" + "vec2 dFdy(vec2 p);" + "vec3 dFdy(vec3 p);" + "vec4 dFdy(vec4 p);" + + "float fwidth(float p);" + "vec2 fwidth(vec2 p);" + "vec3 fwidth(vec3 p);" + "vec4 fwidth(vec4 p);" + ); + + TString derivativeControls ( + "float dFdxFine(float p);" + "vec2 dFdxFine(vec2 p);" + "vec3 dFdxFine(vec3 p);" + "vec4 dFdxFine(vec4 p);" + + "float dFdyFine(float p);" + "vec2 dFdyFine(vec2 p);" + "vec3 dFdyFine(vec3 p);" + "vec4 dFdyFine(vec4 p);" + + "float fwidthFine(float p);" + "vec2 fwidthFine(vec2 p);" + "vec3 fwidthFine(vec3 p);" + "vec4 fwidthFine(vec4 p);" + + "float dFdxCoarse(float p);" + "vec2 dFdxCoarse(vec2 p);" + "vec3 dFdxCoarse(vec3 p);" + "vec4 dFdxCoarse(vec4 p);" + + "float dFdyCoarse(float p);" + "vec2 dFdyCoarse(vec2 p);" + "vec3 dFdyCoarse(vec3 p);" + "vec4 dFdyCoarse(vec4 p);" + + "float fwidthCoarse(float p);" + "vec2 fwidthCoarse(vec2 p);" + "vec3 fwidthCoarse(vec3 p);" + "vec4 fwidthCoarse(vec4 p);" + ); + + TString derivativesAndControl16bits ( + "float16_t dFdx(float16_t);" + "f16vec2 dFdx(f16vec2);" + "f16vec3 dFdx(f16vec3);" + "f16vec4 dFdx(f16vec4);" + + "float16_t dFdy(float16_t);" + "f16vec2 dFdy(f16vec2);" + "f16vec3 dFdy(f16vec3);" + "f16vec4 dFdy(f16vec4);" + + "float16_t dFdxFine(float16_t);" + "f16vec2 dFdxFine(f16vec2);" + "f16vec3 dFdxFine(f16vec3);" + "f16vec4 dFdxFine(f16vec4);" + + "float16_t dFdyFine(float16_t);" + "f16vec2 dFdyFine(f16vec2);" + "f16vec3 dFdyFine(f16vec3);" + "f16vec4 dFdyFine(f16vec4);" + + "float16_t dFdxCoarse(float16_t);" + "f16vec2 dFdxCoarse(f16vec2);" + "f16vec3 dFdxCoarse(f16vec3);" + "f16vec4 dFdxCoarse(f16vec4);" + + "float16_t dFdyCoarse(float16_t);" + "f16vec2 dFdyCoarse(f16vec2);" + "f16vec3 dFdyCoarse(f16vec3);" + "f16vec4 dFdyCoarse(f16vec4);" + + "float16_t fwidth(float16_t);" + "f16vec2 fwidth(f16vec2);" + "f16vec3 fwidth(f16vec3);" + "f16vec4 fwidth(f16vec4);" + + "float16_t fwidthFine(float16_t);" + "f16vec2 fwidthFine(f16vec2);" + "f16vec3 fwidthFine(f16vec3);" + "f16vec4 fwidthFine(f16vec4);" + + "float16_t fwidthCoarse(float16_t);" + "f16vec2 fwidthCoarse(f16vec2);" + "f16vec3 fwidthCoarse(f16vec3);" + "f16vec4 fwidthCoarse(f16vec4);" + ); + + TString derivativesAndControl64bits ( + "float64_t dFdx(float64_t);" + "f64vec2 dFdx(f64vec2);" + "f64vec3 dFdx(f64vec3);" + "f64vec4 dFdx(f64vec4);" + + "float64_t dFdy(float64_t);" + "f64vec2 dFdy(f64vec2);" + "f64vec3 dFdy(f64vec3);" + "f64vec4 dFdy(f64vec4);" + + "float64_t dFdxFine(float64_t);" + "f64vec2 dFdxFine(f64vec2);" + "f64vec3 dFdxFine(f64vec3);" + "f64vec4 dFdxFine(f64vec4);" + + "float64_t dFdyFine(float64_t);" + "f64vec2 dFdyFine(f64vec2);" + "f64vec3 dFdyFine(f64vec3);" + "f64vec4 dFdyFine(f64vec4);" + + "float64_t dFdxCoarse(float64_t);" + "f64vec2 dFdxCoarse(f64vec2);" + "f64vec3 dFdxCoarse(f64vec3);" + "f64vec4 dFdxCoarse(f64vec4);" + + "float64_t dFdyCoarse(float64_t);" + "f64vec2 dFdyCoarse(f64vec2);" + "f64vec3 dFdyCoarse(f64vec3);" + "f64vec4 dFdyCoarse(f64vec4);" + + "float64_t fwidth(float64_t);" + "f64vec2 fwidth(f64vec2);" + "f64vec3 fwidth(f64vec3);" + "f64vec4 fwidth(f64vec4);" + + "float64_t fwidthFine(float64_t);" + "f64vec2 fwidthFine(f64vec2);" + "f64vec3 fwidthFine(f64vec3);" + "f64vec4 fwidthFine(f64vec4);" + + "float64_t fwidthCoarse(float64_t);" + "f64vec2 fwidthCoarse(f64vec2);" + "f64vec3 fwidthCoarse(f64vec3);" + "f64vec4 fwidthCoarse(f64vec4);" + ); + //============================================================================ // // Prototypes for built-in functions seen by both vertex and fragment shaders. @@ -935,56 +1087,102 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV commonBuiltins.append( "uint atomicAdd(coherent volatile inout uint, uint);" " int atomicAdd(coherent volatile inout int, int);" + "uint atomicAdd(coherent volatile inout uint, uint, int, int, int);" + " int atomicAdd(coherent volatile inout int, int, int, int, int);" "uint atomicMin(coherent volatile inout uint, uint);" " int atomicMin(coherent volatile inout int, int);" + "uint atomicMin(coherent volatile inout uint, uint, int, int, int);" + " int atomicMin(coherent volatile inout int, int, int, int, int);" "uint atomicMax(coherent volatile inout uint, uint);" " int atomicMax(coherent volatile inout int, int);" + "uint atomicMax(coherent volatile inout uint, uint, int, int, int);" + " int atomicMax(coherent volatile inout int, int, int, int, int);" "uint atomicAnd(coherent volatile inout uint, uint);" " int atomicAnd(coherent volatile inout int, int);" + "uint atomicAnd(coherent volatile inout uint, uint, int, int, int);" + " int atomicAnd(coherent volatile inout int, int, int, int, int);" "uint atomicOr (coherent volatile inout uint, uint);" " int atomicOr (coherent volatile inout int, int);" + "uint atomicOr (coherent volatile inout uint, uint, int, int, int);" + " int atomicOr (coherent volatile inout int, int, int, int, int);" "uint atomicXor(coherent volatile inout uint, uint);" " int atomicXor(coherent volatile inout int, int);" + "uint atomicXor(coherent volatile inout uint, uint, int, int, int);" + " int atomicXor(coherent volatile inout int, int, int, int, int);" "uint atomicExchange(coherent volatile inout uint, uint);" " int atomicExchange(coherent volatile inout int, int);" + "uint atomicExchange(coherent volatile inout uint, uint, int, int, int);" + " int atomicExchange(coherent volatile inout int, int, int, int, int);" "uint atomicCompSwap(coherent volatile inout uint, uint, uint);" " int atomicCompSwap(coherent volatile inout int, int, int);" + "uint atomicCompSwap(coherent volatile inout uint, uint, uint, int, int, int, int, int);" + " int atomicCompSwap(coherent volatile inout int, int, int, int, int, int, int, int);" + + "uint atomicLoad(coherent volatile in uint, int, int, int);" + " int atomicLoad(coherent volatile in int, int, int, int);" + + "void atomicStore(coherent volatile out uint, uint, int, int, int);" + "void atomicStore(coherent volatile out int, int, int, int, int);" "\n"); } -#ifdef NV_EXTENSIONS if (profile != EEsProfile && version >= 440) { commonBuiltins.append( "uint64_t atomicMin(coherent volatile inout uint64_t, uint64_t);" " int64_t atomicMin(coherent volatile inout int64_t, int64_t);" + "uint64_t atomicMin(coherent volatile inout uint64_t, uint64_t, int, int, int);" + " int64_t atomicMin(coherent volatile inout int64_t, int64_t, int, int, int);" "uint64_t atomicMax(coherent volatile inout uint64_t, uint64_t);" " int64_t atomicMax(coherent volatile inout int64_t, int64_t);" + "uint64_t atomicMax(coherent volatile inout uint64_t, uint64_t, int, int, int);" + " int64_t atomicMax(coherent volatile inout int64_t, int64_t, int, int, int);" "uint64_t atomicAnd(coherent volatile inout uint64_t, uint64_t);" " int64_t atomicAnd(coherent volatile inout int64_t, int64_t);" + "uint64_t atomicAnd(coherent volatile inout uint64_t, uint64_t, int, int, int);" + " int64_t atomicAnd(coherent volatile inout int64_t, int64_t, int, int, int);" "uint64_t atomicOr (coherent volatile inout uint64_t, uint64_t);" " int64_t atomicOr (coherent volatile inout int64_t, int64_t);" + "uint64_t atomicOr (coherent volatile inout uint64_t, uint64_t, int, int, int);" + " int64_t atomicOr (coherent volatile inout int64_t, int64_t, int, int, int);" "uint64_t atomicXor(coherent volatile inout uint64_t, uint64_t);" " int64_t atomicXor(coherent volatile inout int64_t, int64_t);" + "uint64_t atomicXor(coherent volatile inout uint64_t, uint64_t, int, int, int);" + " int64_t atomicXor(coherent volatile inout int64_t, int64_t, int, int, int);" - " int64_t atomicAdd(coherent volatile inout int64_t, int64_t);" - " int64_t atomicExchange(coherent volatile inout int64_t, int64_t);" - " int64_t atomicCompSwap(coherent volatile inout int64_t, int64_t, int64_t);" + "uint64_t atomicAdd(coherent volatile inout uint64_t, uint64_t);" + " int64_t atomicAdd(coherent volatile inout int64_t, int64_t);" + "uint64_t atomicAdd(coherent volatile inout uint64_t, uint64_t, int, int, int);" + " int64_t atomicAdd(coherent volatile inout int64_t, int64_t, int, int, int);" + "uint64_t atomicExchange(coherent volatile inout uint64_t, uint64_t);" + " int64_t atomicExchange(coherent volatile inout int64_t, int64_t);" + "uint64_t atomicExchange(coherent volatile inout uint64_t, uint64_t, int, int, int);" + " int64_t atomicExchange(coherent volatile inout int64_t, int64_t, int, int, int);" + + "uint64_t atomicCompSwap(coherent volatile inout uint64_t, uint64_t, uint64_t);" + " int64_t atomicCompSwap(coherent volatile inout int64_t, int64_t, int64_t);" + "uint64_t atomicCompSwap(coherent volatile inout uint64_t, uint64_t, uint64_t, int, int, int, int, int);" + " int64_t atomicCompSwap(coherent volatile inout int64_t, int64_t, int64_t, int, int, int, int, int);" + + "uint64_t atomicLoad(coherent volatile in uint64_t, int, int, int);" + " int64_t atomicLoad(coherent volatile in int64_t, int, int, int);" + + "void atomicStore(coherent volatile out uint64_t, uint64_t, int, int, int);" + "void atomicStore(coherent volatile out int64_t, int64_t, int, int, int);" "\n"); } -#endif if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 450)) { @@ -2743,6 +2941,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n" ); +#ifdef NV_EXTENSIONS + stageBuiltins[EShLangMeshNV].append( + "void subgroupMemoryBarrierShared();" + "\n" + ); + stageBuiltins[EShLangTaskNV].append( + "void subgroupMemoryBarrierShared();" + "\n" + ); +#endif } if (profile != EEsProfile && version >= 460) { @@ -3652,6 +3860,42 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV #endif // AMD_EXTENSIONS + +#ifdef NV_EXTENSIONS + if ((profile != EEsProfile && version >= 450) || + (profile == EEsProfile && version >= 320)) { + commonBuiltins.append( + "struct gl_TextureFootprint2DNV {" + "uvec2 anchor;" + "uvec2 offset;" + "uvec2 mask;" + "uint lod;" + "uint granularity;" + "};" + + "struct gl_TextureFootprint3DNV {" + "uvec3 anchor;" + "uvec3 offset;" + "uvec2 mask;" + "uint lod;" + "uint granularity;" + "};" + "bool textureFootprintNV(sampler2D, vec2, int, bool, out gl_TextureFootprint2DNV);" + "bool textureFootprintNV(sampler3D, vec3, int, bool, out gl_TextureFootprint3DNV);" + "bool textureFootprintNV(sampler2D, vec2, int, bool, out gl_TextureFootprint2DNV, float);" + "bool textureFootprintNV(sampler3D, vec3, int, bool, out gl_TextureFootprint3DNV, float);" + "bool textureFootprintClampNV(sampler2D, vec2, float, int, bool, out gl_TextureFootprint2DNV);" + "bool textureFootprintClampNV(sampler3D, vec3, float, int, bool, out gl_TextureFootprint3DNV);" + "bool textureFootprintClampNV(sampler2D, vec2, float, int, bool, out gl_TextureFootprint2DNV, float);" + "bool textureFootprintClampNV(sampler3D, vec3, float, int, bool, out gl_TextureFootprint3DNV, float);" + "bool textureFootprintLodNV(sampler2D, vec2, float, int, bool, out gl_TextureFootprint2DNV);" + "bool textureFootprintLodNV(sampler3D, vec3, float, int, bool, out gl_TextureFootprint3DNV);" + "bool textureFootprintGradNV(sampler2D, vec2, vec2, vec2, int, bool, out gl_TextureFootprint2DNV);" + "bool textureFootprintGradClampNV(sampler2D, vec2, vec2, vec2, float, int, bool, out gl_TextureFootprint2DNV);" + "\n"); + } + +#endif // NV_EXTENSIONS // GL_AMD_gpu_shader_half_float/Explicit types if (profile != EEsProfile && version >= 450) { commonBuiltins.append( @@ -4504,52 +4748,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } if (profile != EEsProfile && version >= 450) { + stageBuiltins[EShLangFragment].append(derivativesAndControl64bits); stageBuiltins[EShLangFragment].append( - "float64_t dFdx(float64_t);" - "f64vec2 dFdx(f64vec2);" - "f64vec3 dFdx(f64vec3);" - "f64vec4 dFdx(f64vec4);" - - "float64_t dFdy(float64_t);" - "f64vec2 dFdy(f64vec2);" - "f64vec3 dFdy(f64vec3);" - "f64vec4 dFdy(f64vec4);" - - "float64_t dFdxFine(float64_t);" - "f64vec2 dFdxFine(f64vec2);" - "f64vec3 dFdxFine(f64vec3);" - "f64vec4 dFdxFine(f64vec4);" - - "float64_t dFdyFine(float64_t);" - "f64vec2 dFdyFine(f64vec2);" - "f64vec3 dFdyFine(f64vec3);" - "f64vec4 dFdyFine(f64vec4);" - - "float64_t dFdxCoarse(float64_t);" - "f64vec2 dFdxCoarse(f64vec2);" - "f64vec3 dFdxCoarse(f64vec3);" - "f64vec4 dFdxCoarse(f64vec4);" - - "float64_t dFdyCoarse(float64_t);" - "f64vec2 dFdyCoarse(f64vec2);" - "f64vec3 dFdyCoarse(f64vec3);" - "f64vec4 dFdyCoarse(f64vec4);" - - "float64_t fwidth(float64_t);" - "f64vec2 fwidth(f64vec2);" - "f64vec3 fwidth(f64vec3);" - "f64vec4 fwidth(f64vec4);" - - "float64_t fwidthFine(float64_t);" - "f64vec2 fwidthFine(f64vec2);" - "f64vec3 fwidthFine(f64vec3);" - "f64vec4 fwidthFine(f64vec4);" - - "float64_t fwidthCoarse(float64_t);" - "f64vec2 fwidthCoarse(f64vec2);" - "f64vec3 fwidthCoarse(f64vec3);" - "f64vec4 fwidthCoarse(f64vec4);" - "float64_t interpolateAtCentroid(float64_t);" "f64vec2 interpolateAtCentroid(f64vec2);" "f64vec3 interpolateAtCentroid(f64vec3);" @@ -4677,6 +4877,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV stageBuiltins[EShLangCompute].append( "void barrier();" ); +#ifdef NV_EXTENSIONS + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { + stageBuiltins[EShLangMeshNV].append( + "void barrier();" + ); + stageBuiltins[EShLangTaskNV].append( + "void barrier();" + ); + } +#endif if ((profile != EEsProfile && version >= 130) || esBarrier) commonBuiltins.append( "void memoryBarrier();" @@ -4692,6 +4902,21 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "void groupMemoryBarrier();" ); } +#ifdef NV_EXTENSIONS + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { + stageBuiltins[EShLangMeshNV].append( + "void memoryBarrierShared();" + "void groupMemoryBarrier();" + ); + stageBuiltins[EShLangTaskNV].append( + "void memoryBarrierShared();" + "void groupMemoryBarrier();" + ); + } +#endif + + commonBuiltins.append("void controlBarrier(int, int, int, int);\n" + "void memoryBarrier(int, int, int);\n"); //============================================================================ // @@ -4735,61 +4960,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } - stageBuiltins[EShLangFragment].append( - "float dFdx(float p);" - "vec2 dFdx(vec2 p);" - "vec3 dFdx(vec3 p);" - "vec4 dFdx(vec4 p);" - - "float dFdy(float p);" - "vec2 dFdy(vec2 p);" - "vec3 dFdy(vec3 p);" - "vec4 dFdy(vec4 p);" - - "float fwidth(float p);" - "vec2 fwidth(vec2 p);" - "vec3 fwidth(vec3 p);" - "vec4 fwidth(vec4 p);" - - "\n"); + stageBuiltins[EShLangFragment].append(derivatives); + stageBuiltins[EShLangFragment].append("\n"); // GL_ARB_derivative_control if (profile != EEsProfile && version >= 400) { - stageBuiltins[EShLangFragment].append( - "float dFdxFine(float p);" - "vec2 dFdxFine(vec2 p);" - "vec3 dFdxFine(vec3 p);" - "vec4 dFdxFine(vec4 p);" - - "float dFdyFine(float p);" - "vec2 dFdyFine(vec2 p);" - "vec3 dFdyFine(vec3 p);" - "vec4 dFdyFine(vec4 p);" - - "float fwidthFine(float p);" - "vec2 fwidthFine(vec2 p);" - "vec3 fwidthFine(vec3 p);" - "vec4 fwidthFine(vec4 p);" - - "\n"); - - stageBuiltins[EShLangFragment].append( - "float dFdxCoarse(float p);" - "vec2 dFdxCoarse(vec2 p);" - "vec3 dFdxCoarse(vec3 p);" - "vec4 dFdxCoarse(vec4 p);" - - "float dFdyCoarse(float p);" - "vec2 dFdyCoarse(vec2 p);" - "vec3 dFdyCoarse(vec3 p);" - "vec4 dFdyCoarse(vec4 p);" - - "float fwidthCoarse(float p);" - "vec2 fwidthCoarse(vec2 p);" - "vec3 fwidthCoarse(vec3 p);" - "vec4 fwidthCoarse(vec4 p);" - - "\n"); + stageBuiltins[EShLangFragment].append(derivativeControls); + stageBuiltins[EShLangFragment].append("\n"); } // GL_OES_shader_multisample_interpolation @@ -4843,52 +5020,10 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV // GL_AMD_gpu_shader_half_float if (profile != EEsProfile && version >= 450) { - stageBuiltins[EShLangFragment].append( - "float16_t dFdx(float16_t);" - "f16vec2 dFdx(f16vec2);" - "f16vec3 dFdx(f16vec3);" - "f16vec4 dFdx(f16vec4);" - - "float16_t dFdy(float16_t);" - "f16vec2 dFdy(f16vec2);" - "f16vec3 dFdy(f16vec3);" - "f16vec4 dFdy(f16vec4);" - - "float16_t dFdxFine(float16_t);" - "f16vec2 dFdxFine(f16vec2);" - "f16vec3 dFdxFine(f16vec3);" - "f16vec4 dFdxFine(f16vec4);" - - "float16_t dFdyFine(float16_t);" - "f16vec2 dFdyFine(f16vec2);" - "f16vec3 dFdyFine(f16vec3);" - "f16vec4 dFdyFine(f16vec4);" - - "float16_t dFdxCoarse(float16_t);" - "f16vec2 dFdxCoarse(f16vec2);" - "f16vec3 dFdxCoarse(f16vec3);" - "f16vec4 dFdxCoarse(f16vec4);" - - "float16_t dFdyCoarse(float16_t);" - "f16vec2 dFdyCoarse(f16vec2);" - "f16vec3 dFdyCoarse(f16vec3);" - "f16vec4 dFdyCoarse(f16vec4);" - - "float16_t fwidth(float16_t);" - "f16vec2 fwidth(f16vec2);" - "f16vec3 fwidth(f16vec3);" - "f16vec4 fwidth(f16vec4);" - - "float16_t fwidthFine(float16_t);" - "f16vec2 fwidthFine(f16vec2);" - "f16vec3 fwidthFine(f16vec3);" - "f16vec4 fwidthFine(f16vec4);" - - "float16_t fwidthCoarse(float16_t);" - "f16vec2 fwidthCoarse(f16vec2);" - "f16vec3 fwidthCoarse(f16vec3);" - "f16vec4 fwidthCoarse(f16vec4);" + stageBuiltins[EShLangFragment].append(derivativesAndControl16bits); + stageBuiltins[EShLangFragment].append("\n"); + stageBuiltins[EShLangFragment].append( "float16_t interpolateAtCentroid(float16_t);" "f16vec2 interpolateAtCentroid(f16vec2);" "f16vec3 interpolateAtCentroid(f16vec3);" @@ -4922,6 +5057,56 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV } #endif +#ifdef NV_EXTENSIONS + + // Builtins for GL_NV_ray_tracing + if (profile != EEsProfile && version >= 460) { + stageBuiltins[EShLangRayGenNV].append( + "void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void executeCallableNV(uint, int);" + "\n"); + stageBuiltins[EShLangIntersectNV].append( + "bool reportIntersectionNV(float, uint);" + "\n"); + stageBuiltins[EShLangAnyHitNV].append( + "void ignoreIntersectionNV();" + "void terminateRayNV();" + "\n"); + stageBuiltins[EShLangClosestHitNV].append( + "void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void executeCallableNV(uint, int);" + "\n"); + stageBuiltins[EShLangMissNV].append( + "void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void executeCallableNV(uint, int);" + "\n"); + stageBuiltins[EShLangCallableNV].append( + "void executeCallableNV(uint, int);" + "\n"); + } + + //E_SPV_NV_compute_shader_derivatives + + stageBuiltins[EShLangCompute].append(derivatives); + stageBuiltins[EShLangCompute].append(derivativeControls); + stageBuiltins[EShLangCompute].append("\n"); + + + if (profile != EEsProfile && version >= 450) { + + stageBuiltins[EShLangCompute].append(derivativesAndControl16bits); + stageBuiltins[EShLangCompute].append(derivativesAndControl64bits); + stageBuiltins[EShLangCompute].append("\n"); + } + + // Builtins for GL_NV_mesh_shader + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { + stageBuiltins[EShLangMeshNV].append( + "void writePackedPrimitiveIndices4x8NV(uint, uint);" + "\n"); + } +#endif + //============================================================================ // // Standard Uniforms @@ -5101,6 +5286,93 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } +#ifdef NV_EXTENSIONS + //============================================================================ + // + // Define the interface to the mesh/task shader. + // + //============================================================================ + + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { + // per-vertex attributes + stageBuiltins[EShLangMeshNV].append( + "out gl_MeshPerVertexNV {" + "vec4 gl_Position;" + "float gl_PointSize;" + "float gl_ClipDistance[];" + "float gl_CullDistance[];" + "perviewNV vec4 gl_PositionPerViewNV[];" + "perviewNV float gl_ClipDistancePerViewNV[][];" + "perviewNV float gl_CullDistancePerViewNV[][];" + "} gl_MeshVerticesNV[];" + ); + + // per-primitive attributes + stageBuiltins[EShLangMeshNV].append( + "perprimitiveNV out gl_MeshPerPrimitiveNV {" + "int gl_PrimitiveID;" + "int gl_Layer;" + "int gl_ViewportIndex;" + "int gl_ViewportMask[];" + "perviewNV int gl_LayerPerViewNV[];" + "perviewNV int gl_ViewportMaskPerViewNV[][];" + "} gl_MeshPrimitivesNV[];" + ); + + stageBuiltins[EShLangMeshNV].append( + "out uint gl_PrimitiveCountNV;" + "out uint gl_PrimitiveIndicesNV[];" + + "in uint gl_MeshViewCountNV;" + "in uint gl_MeshViewIndicesNV[4];" + + "const highp uvec3 gl_WorkGroupSize = uvec3(1,1,1);" + + "in highp uvec3 gl_WorkGroupID;" + "in highp uvec3 gl_LocalInvocationID;" + + "in highp uvec3 gl_GlobalInvocationID;" + "in highp uint gl_LocalInvocationIndex;" + + "\n"); + + stageBuiltins[EShLangTaskNV].append( + "out uint gl_TaskCountNV;" + + "const highp uvec3 gl_WorkGroupSize = uvec3(1,1,1);" + + "in highp uvec3 gl_WorkGroupID;" + "in highp uvec3 gl_LocalInvocationID;" + + "in highp uvec3 gl_GlobalInvocationID;" + "in highp uint gl_LocalInvocationIndex;" + + "\n"); + } + + if (profile != EEsProfile && version >= 450) { + stageBuiltins[EShLangMeshNV].append( + "in highp int gl_DeviceIndex;" // GL_EXT_device_group + "in int gl_DrawIDARB;" // GL_ARB_shader_draw_parameters + "\n"); + + stageBuiltins[EShLangTaskNV].append( + "in highp int gl_DeviceIndex;" // GL_EXT_device_group + "in int gl_DrawIDARB;" // GL_ARB_shader_draw_parameters + "\n"); + + if (version >= 460) { + stageBuiltins[EShLangMeshNV].append( + "in int gl_DrawID;" + "\n"); + + stageBuiltins[EShLangTaskNV].append( + "in int gl_DrawID;" + "\n"); + } + } +#endif + //============================================================================ // // Define the interface to the vertex shader. @@ -5685,6 +5957,14 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV stageBuiltins[EShLangFragment].append( "in bool gl_FragFullyCoveredNV;" ); + if (version >= 450) + stageBuiltins[EShLangFragment].append( + "flat in ivec2 gl_FragmentSizeNV;" + "flat in int gl_InvocationsPerPixelNV;" + "in vec3 gl_BaryCoordNV;" + "in vec3 gl_BaryCoordNoPerspNV;" + ); + #endif } else { // ES profile @@ -5726,6 +6006,19 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV stageBuiltins[EShLangFragment].append( "highp float gl_FragDepthEXT;" // GL_EXT_frag_depth ); +#ifdef NV_EXTENSIONS + if (version >= 320) + stageBuiltins[EShLangFragment].append( + "flat in ivec2 gl_FragmentSizeNV;" + "flat in int gl_InvocationsPerPixelNV;" + ); + if (version >= 320) + stageBuiltins[EShLangFragment].append( + "in vec3 gl_BaryCoordNV;" + "in vec3 gl_BaryCoordNoPerspNV;" + ); +#endif + } stageBuiltins[EShLangFragment].append("\n"); @@ -5758,6 +6051,10 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV stageBuiltins[EShLangGeometry] .append(ballotDecls); stageBuiltins[EShLangCompute] .append(ballotDecls); stageBuiltins[EShLangFragment] .append(fragmentBallotDecls); +#ifdef NV_EXTENSIONS + stageBuiltins[EShLangMeshNV] .append(ballotDecls); + stageBuiltins[EShLangTaskNV] .append(ballotDecls); +#endif } if ((profile != EEsProfile && version >= 140) || @@ -5794,12 +6091,129 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV stageBuiltins[EShLangGeometry] .append(ballotDecls); stageBuiltins[EShLangCompute] .append(ballotDecls); stageBuiltins[EShLangFragment] .append(fragmentBallotDecls); +#ifdef NV_EXTENSIONS + stageBuiltins[EShLangMeshNV] .append(ballotDecls); + stageBuiltins[EShLangTaskNV] .append(ballotDecls); +#endif stageBuiltins[EShLangCompute].append( "highp in uint gl_NumSubgroups;" "highp in uint gl_SubgroupID;" "\n"); +#ifdef NV_EXTENSIONS + stageBuiltins[EShLangMeshNV].append( + "highp in uint gl_NumSubgroups;" + "highp in uint gl_SubgroupID;" + "\n"); + stageBuiltins[EShLangTaskNV].append( + "highp in uint gl_NumSubgroups;" + "highp in uint gl_SubgroupID;" + "\n"); +#endif + } + +#ifdef NV_EXTENSIONS + // GL_NV_ray_tracing + if (profile != EEsProfile && version >= 460) { + + const char *constRayFlags = + "const uint gl_RayFlagsNoneNV = 0U;" + "const uint gl_RayFlagsOpaqueNV = 1U;" + "const uint gl_RayFlagsNoOpaqueNV = 2U;" + "const uint gl_RayFlagsTerminateOnFirstHitNV = 4U;" + "const uint gl_RayFlagsSkipClosestHitShaderNV = 8U;" + "const uint gl_RayFlagsCullBackFacingTrianglesNV = 16U;" + "const uint gl_RayFlagsCullFrontFacingTrianglesNV = 32U;" + "const uint gl_RayFlagsCullOpaqueNV = 64U;" + "const uint gl_RayFlagsCullNoOpaqueNV = 128U;" + "\n"; + const char *rayGenDecls = + "in uvec3 gl_LaunchIDNV;" + "in uvec3 gl_LaunchSizeNV;" + "\n"; + const char *intersectDecls = + "in uvec3 gl_LaunchIDNV;" + "in uvec3 gl_LaunchSizeNV;" + "in int gl_PrimitiveID;" + "in int gl_InstanceID;" + "in int gl_InstanceCustomIndexNV;" + "in vec3 gl_WorldRayOriginNV;" + "in vec3 gl_WorldRayDirectionNV;" + "in vec3 gl_ObjectRayOriginNV;" + "in vec3 gl_ObjectRayDirectionNV;" + "in float gl_RayTminNV;" + "in float gl_RayTmaxNV;" + "in mat4x3 gl_ObjectToWorldNV;" + "in mat4x3 gl_WorldToObjectNV;" + "in uint gl_IncomingRayFlagsNV;" + "\n"; + const char *hitDecls = + "in uvec3 gl_LaunchIDNV;" + "in uvec3 gl_LaunchSizeNV;" + "in int gl_PrimitiveID;" + "in int gl_InstanceID;" + "in int gl_InstanceCustomIndexNV;" + "in vec3 gl_WorldRayOriginNV;" + "in vec3 gl_WorldRayDirectionNV;" + "in vec3 gl_ObjectRayOriginNV;" + "in vec3 gl_ObjectRayDirectionNV;" + "in float gl_RayTminNV;" + "in float gl_RayTmaxNV;" + "in float gl_HitTNV;" + "in uint gl_HitKindNV;" + "in mat4x3 gl_ObjectToWorldNV;" + "in mat4x3 gl_WorldToObjectNV;" + "in uint gl_IncomingRayFlagsNV;" + "\n"; + const char *missDecls = + "in uvec3 gl_LaunchIDNV;" + "in uvec3 gl_LaunchSizeNV;" + "in vec3 gl_WorldRayOriginNV;" + "in vec3 gl_WorldRayDirectionNV;" + "in vec3 gl_ObjectRayOriginNV;" + "in vec3 gl_ObjectRayDirectionNV;" + "in float gl_RayTminNV;" + "in float gl_RayTmaxNV;" + "in uint gl_IncomingRayFlagsNV;" + "\n"; + + const char *callableDecls = + "in uvec3 gl_LaunchIDNV;" + "in uvec3 gl_LaunchSizeNV;" + "in uint gl_IncomingRayFlagsNV;" + "\n"; + + stageBuiltins[EShLangRayGenNV].append(rayGenDecls); + stageBuiltins[EShLangRayGenNV].append(constRayFlags); + + stageBuiltins[EShLangIntersectNV].append(intersectDecls); + stageBuiltins[EShLangIntersectNV].append(constRayFlags); + + stageBuiltins[EShLangAnyHitNV].append(hitDecls); + stageBuiltins[EShLangAnyHitNV].append(constRayFlags); + + stageBuiltins[EShLangClosestHitNV].append(hitDecls); + stageBuiltins[EShLangClosestHitNV].append(constRayFlags); + + stageBuiltins[EShLangMissNV].append(missDecls); + stageBuiltins[EShLangMissNV].append(constRayFlags); + + stageBuiltins[EShLangCallableNV].append(callableDecls); + stageBuiltins[EShLangCallableNV].append(constRayFlags); + + } + if ((profile != EEsProfile && version >= 140)) { + const char *deviceIndex = + "in highp int gl_DeviceIndex;" // GL_EXT_device_group + "\n"; + + stageBuiltins[EShLangRayGenNV].append(deviceIndex); + stageBuiltins[EShLangIntersectNV].append(deviceIndex); + stageBuiltins[EShLangAnyHitNV].append(deviceIndex); + stageBuiltins[EShLangClosestHitNV].append(deviceIndex); + stageBuiltins[EShLangMissNV].append(deviceIndex); } +#endif if (version >= 300 /* both ES and non-ES */) { stageBuiltins[EShLangFragment].append( @@ -5807,6 +6221,28 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } + if ((profile != EEsProfile && version >= 420) || + (profile == EEsProfile && version >= 310)) { + commonBuiltins.append("const int gl_ScopeDevice = 1;\n"); + commonBuiltins.append("const int gl_ScopeWorkgroup = 2;\n"); + commonBuiltins.append("const int gl_ScopeSubgroup = 3;\n"); + commonBuiltins.append("const int gl_ScopeInvocation = 4;\n"); + commonBuiltins.append("const int gl_ScopeQueueFamily = 5;\n"); + + commonBuiltins.append("const int gl_SemanticsRelaxed = 0x0;\n"); + commonBuiltins.append("const int gl_SemanticsAcquire = 0x2;\n"); + commonBuiltins.append("const int gl_SemanticsRelease = 0x4;\n"); + commonBuiltins.append("const int gl_SemanticsAcquireRelease = 0x8;\n"); + commonBuiltins.append("const int gl_SemanticsMakeAvailable = 0x2000;\n"); + commonBuiltins.append("const int gl_SemanticsMakeVisible = 0x4000;\n"); + + commonBuiltins.append("const int gl_StorageSemanticsNone = 0x0;\n"); + commonBuiltins.append("const int gl_StorageSemanticsBuffer = 0x40;\n"); + commonBuiltins.append("const int gl_StorageSemanticsShared = 0x100;\n"); + commonBuiltins.append("const int gl_StorageSemanticsImage = 0x800;\n"); + commonBuiltins.append("const int gl_StorageSemanticsOutput = 0x1000;\n"); + } + // printf("%s\n", commonBuiltins.c_str()); // printf("%s\n", stageBuiltins[EShLangFragment].c_str()); } @@ -5914,15 +6350,19 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c addSamplingFunctions(sampler, typeName, version, profile); addGatherFunctions(sampler, typeName, version, profile); - if (spvVersion.vulkan > 0 && sampler.dim == EsdBuffer && sampler.isCombined()) { - // Vulkan wants a textureBuffer to allow texelFetch() -- - // a sampled image with no sampler. - // So, add sampling functions for both the - // samplerBuffer and textureBuffer types. + if (spvVersion.vulkan > 0 && sampler.isCombined() && !sampler.shadow) { + // Base Vulkan allows texelFetch() for + // textureBuffer (i.e. without sampler). + // + // GL_EXT_samplerless_texture_functions + // allows texelFetch() and query functions + // (other than textureQueryLod()) for all + // texture types. sampler.setTexture(sampler.type, sampler.dim, sampler.arrayed, sampler.shadow, sampler.ms); TString textureTypeName = sampler.getString(); addSamplingFunctions(sampler, textureTypeName, version, profile); + addQueryFunctions(sampler, textureTypeName, version, profile); } } } @@ -5995,7 +6435,7 @@ void TBuiltIns::addQueryFunctions(TSampler sampler, const TString& typeName, int // textureQueryLod(), fragment stage only // - if (profile != EEsProfile && version >= 400 && ! sampler.image && sampler.dim != EsdRect && ! sampler.ms && sampler.dim != EsdBuffer) { + if (profile != EEsProfile && version >= 400 && sampler.combined && sampler.dim != EsdRect && ! sampler.ms && sampler.dim != EsdBuffer) { #ifdef AMD_EXTENSIONS for (int f16TexAddr = 0; f16TexAddr < 2; ++f16TexAddr) { if (f16TexAddr && sampler.type != EbtFloat16) @@ -6027,6 +6467,18 @@ void TBuiltIns::addQueryFunctions(TSampler sampler, const TString& typeName, int #ifdef AMD_EXTENSIONS } #endif + +#ifdef NV_EXTENSIONS + stageBuiltins[EShLangCompute].append("vec2 textureQueryLod("); + stageBuiltins[EShLangCompute].append(typeName); + if (dimMap[sampler.dim] == 1) + stageBuiltins[EShLangCompute].append(", float"); + else { + stageBuiltins[EShLangCompute].append(", vec"); + stageBuiltins[EShLangCompute].append(postfixes[dimMap[sampler.dim]]); + } + stageBuiltins[EShLangCompute].append(");\n"); +#endif } // @@ -6102,23 +6554,44 @@ void TBuiltIns::addImageFunctions(TSampler sampler, const TString& typeName, int " imageAtomicExchange(volatile coherent " }; - for (size_t i = 0; i < numBuiltins; ++i) { + // Loop twice to add prototypes with/without scope/semantics + for (int j = 0; j < 2; ++j) { + for (size_t i = 0; i < numBuiltins; ++i) { + commonBuiltins.append(dataType); + commonBuiltins.append(atomicFunc[i]); + commonBuiltins.append(imageParams); + commonBuiltins.append(", "); + commonBuiltins.append(dataType); + if (j == 1) { + commonBuiltins.append(", int, int, int"); + } + commonBuiltins.append(");\n"); + } + commonBuiltins.append(dataType); - commonBuiltins.append(atomicFunc[i]); + commonBuiltins.append(" imageAtomicCompSwap(volatile coherent "); commonBuiltins.append(imageParams); commonBuiltins.append(", "); commonBuiltins.append(dataType); + commonBuiltins.append(", "); + commonBuiltins.append(dataType); + if (j == 1) { + commonBuiltins.append(", int, int, int, int, int"); + } commonBuiltins.append(");\n"); } commonBuiltins.append(dataType); - commonBuiltins.append(" imageAtomicCompSwap(volatile coherent "); + commonBuiltins.append(" imageAtomicLoad(volatile coherent "); + commonBuiltins.append(imageParams); + commonBuiltins.append(", int, int, int);\n"); + + commonBuiltins.append("void imageAtomicStore(volatile coherent "); commonBuiltins.append(imageParams); commonBuiltins.append(", "); commonBuiltins.append(dataType); - commonBuiltins.append(", "); - commonBuiltins.append(dataType); - commonBuiltins.append(");\n"); + commonBuiltins.append(", int, int, int);\n"); + } else { // not int or uint // GL_ARB_ES3_1_compatibility @@ -6200,12 +6673,12 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName, // for (int proj = 0; proj <= 1; ++proj) { // loop over "bool" projective or not - if (proj && (sampler.dim == EsdCube || sampler.dim == EsdBuffer || sampler.arrayed || sampler.ms)) + if (proj && (sampler.dim == EsdCube || sampler.dim == EsdBuffer || sampler.arrayed || sampler.ms || !sampler.combined)) continue; for (int lod = 0; lod <= 1; ++lod) { - if (lod && (sampler.dim == EsdBuffer || sampler.dim == EsdRect || sampler.ms)) + if (lod && (sampler.dim == EsdBuffer || sampler.dim == EsdRect || sampler.ms || !sampler.combined)) continue; if (lod && sampler.dim == Esd2D && sampler.arrayed && sampler.shadow) continue; @@ -6214,7 +6687,7 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName, for (int bias = 0; bias <= 1; ++bias) { - if (bias && (lod || sampler.ms)) + if (bias && (lod || sampler.ms || !sampler.combined)) continue; if (bias && (sampler.dim == Esd2D || sampler.dim == EsdCube) && sampler.shadow && sampler.arrayed) continue; @@ -6236,12 +6709,12 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName, continue; if (fetch && (sampler.shadow || sampler.dim == EsdCube)) continue; - if (fetch == 0 && (sampler.ms || sampler.dim == EsdBuffer)) + if (fetch == 0 && (sampler.ms || sampler.dim == EsdBuffer || !sampler.combined)) continue; for (int grad = 0; grad <= 1; ++grad) { // loop over "bool" grad or not - if (grad && (lod || bias || sampler.ms)) + if (grad && (lod || bias || sampler.ms || !sampler.combined)) continue; if (grad && sampler.dim == EsdBuffer) continue; @@ -6263,7 +6736,7 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName, if (extraProj && ! proj) continue; - if (extraProj && (sampler.dim == Esd3D || sampler.shadow)) + if (extraProj && (sampler.dim == Esd3D || sampler.shadow || !sampler.combined)) continue; #ifdef AMD_EXTENSIONS for (int f16TexAddr = 0; f16TexAddr <= 1; ++f16TexAddr) { // loop over 16-bit floating-point texel addressing @@ -6486,9 +6959,12 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName, s.append(");\n"); // Add to the per-language set of built-ins - if (bias || lodClamp) + if (bias || lodClamp) { stageBuiltins[EShLangFragment].append(s); - else +#ifdef NV_EXTENSIONS + stageBuiltins[EShLangCompute].append(s); +#endif + } else commonBuiltins.append(s); } @@ -6569,6 +7045,7 @@ void TBuiltIns::addGatherFunctions(TSampler sampler, const TString& typeName, in break; case 2: s.append("Offsets"); + break; default: break; } @@ -6680,6 +7157,7 @@ void TBuiltIns::addGatherFunctions(TSampler sampler, const TString& typeName, in break; case 2: s.append("Offsets"); + break; default: break; } @@ -7203,6 +7681,31 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf } #endif +#ifdef NV_EXTENSIONS + // SPV_NV_mesh_shader + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { + snprintf(builtInConstant, maxSize, "const int gl_MaxMeshOutputVerticesNV = %d;", resources.maxMeshOutputVerticesNV); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxMeshOutputPrimitivesNV = %d;", resources.maxMeshOutputPrimitivesNV); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxMeshWorkGroupSizeNV = ivec3(%d,%d,%d);", resources.maxMeshWorkGroupSizeX_NV, + resources.maxMeshWorkGroupSizeY_NV, + resources.maxMeshWorkGroupSizeZ_NV); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxTaskWorkGroupSizeNV = ivec3(%d,%d,%d);", resources.maxTaskWorkGroupSizeX_NV, + resources.maxTaskWorkGroupSizeY_NV, + resources.maxTaskWorkGroupSizeZ_NV); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxMeshViewCountNV = %d;", resources.maxMeshViewCountNV); + s.append(builtInConstant); + + s.append("\n"); + } +#endif + s.append("\n"); } @@ -7386,6 +7889,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion } #endif +#ifdef NV_EXTENSIONS + symbolTable.setFunctionExtensions("textureFootprintNV", 1, &E_GL_NV_shader_texture_footprint); + symbolTable.setFunctionExtensions("textureFootprintClampNV", 1, &E_GL_NV_shader_texture_footprint); + symbolTable.setFunctionExtensions("textureFootprintLodNV", 1, &E_GL_NV_shader_texture_footprint); + symbolTable.setFunctionExtensions("textureFootprintGradNV", 1, &E_GL_NV_shader_texture_footprint); + symbolTable.setFunctionExtensions("textureFootprintGradClampNV", 1, &E_GL_NV_shader_texture_footprint); +#endif // Compatibility variables, vertex only if (spvVersion.spv == 0) { BuiltInVariable("gl_Color", EbvColor, symbolTable); @@ -7806,6 +8316,30 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setVariableExtensions("gl_FragFullyCoveredNV", 1, &E_GL_NV_conservative_raster_underestimation); BuiltInVariable("gl_FragFullyCoveredNV", EbvFragFullyCoveredNV, symbolTable); } + if ((profile != EEsProfile && version >= 450) || + (profile == EEsProfile && version >= 320)) { + symbolTable.setVariableExtensions("gl_FragmentSizeNV", 1, &E_GL_NV_shading_rate_image); + symbolTable.setVariableExtensions("gl_InvocationsPerPixelNV", 1, &E_GL_NV_shading_rate_image); + BuiltInVariable("gl_FragmentSizeNV", EbvFragmentSizeNV, symbolTable); + BuiltInVariable("gl_InvocationsPerPixelNV", EbvInvocationsPerPixelNV, symbolTable); + symbolTable.setVariableExtensions("gl_BaryCoordNV", 1, &E_GL_NV_fragment_shader_barycentric); + symbolTable.setVariableExtensions("gl_BaryCoordNoPerspNV", 1, &E_GL_NV_fragment_shader_barycentric); + BuiltInVariable("gl_BaryCoordNV", EbvBaryCoordNV, symbolTable); + BuiltInVariable("gl_BaryCoordNoPerspNV", EbvBaryCoordNoPerspNV, symbolTable); + } + if (((profile != EEsProfile && version >= 450) || + (profile == EEsProfile && version >= 320)) && + language == EShLangCompute) { + symbolTable.setFunctionExtensions("dFdx", 1, &E_GL_NV_compute_shader_derivatives); + symbolTable.setFunctionExtensions("dFdy", 1, &E_GL_NV_compute_shader_derivatives); + symbolTable.setFunctionExtensions("fwidth", 1, &E_GL_NV_compute_shader_derivatives); + symbolTable.setFunctionExtensions("dFdxFine", 1, &E_GL_NV_compute_shader_derivatives); + symbolTable.setFunctionExtensions("dFdyFine", 1, &E_GL_NV_compute_shader_derivatives); + symbolTable.setFunctionExtensions("fwidthFine", 1, &E_GL_NV_compute_shader_derivatives); + symbolTable.setFunctionExtensions("dFdxCoarse", 1, &E_GL_NV_compute_shader_derivatives); + symbolTable.setFunctionExtensions("dFdyCoarse", 1, &E_GL_NV_compute_shader_derivatives); + symbolTable.setFunctionExtensions("fwidthCoarse", 1, &E_GL_NV_compute_shader_derivatives); + } #endif symbolTable.setVariableExtensions("gl_FragDepthEXT", 1, &E_GL_EXT_frag_depth); @@ -7963,6 +8497,26 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setFunctionExtensions("shadow2DEXT", 1, &E_GL_EXT_shadow_samplers); symbolTable.setFunctionExtensions("shadow2DProjEXT", 1, &E_GL_EXT_shadow_samplers); } + + if (spvVersion.vulkan > 0) { + symbolTable.setVariableExtensions("gl_ScopeDevice", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_ScopeWorkgroup", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_ScopeSubgroup", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_ScopeInvocation", 1, &E_GL_KHR_memory_scope_semantics); + + symbolTable.setVariableExtensions("gl_SemanticsRelaxed", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_SemanticsAcquire", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_SemanticsRelease", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_SemanticsAcquireRelease", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_SemanticsMakeAvailable", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_SemanticsMakeVisible", 1, &E_GL_KHR_memory_scope_semantics); + + symbolTable.setVariableExtensions("gl_StorageSemanticsNone", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_StorageSemanticsBuffer", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_StorageSemanticsShared", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_StorageSemanticsImage", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setVariableExtensions("gl_StorageSemanticsOutput", 1, &E_GL_KHR_memory_scope_semantics); + } break; case EShLangCompute: @@ -7997,6 +8551,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setFunctionExtensions("groupMemoryBarrier", 1, &E_GL_ARB_compute_shader); } + symbolTable.setFunctionExtensions("controlBarrier", 1, &E_GL_KHR_memory_scope_semantics); + // GL_ARB_shader_ballot if (profile != EEsProfile) { symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); @@ -8021,7 +8577,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); } - // GL_ARB_shader_ballot + // GL_KHR_shader_subgroup if (spvVersion.vulkan > 0) { symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic); symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic); @@ -8059,6 +8615,248 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setFunctionExtensions("subgroupMemoryBarrierShared", 1, &E_GL_KHR_shader_subgroup_basic); } break; +#ifdef NV_EXTENSIONS + case EShLangRayGenNV: + case EShLangIntersectNV: + case EShLangAnyHitNV: + case EShLangClosestHitNV: + case EShLangMissNV: + case EShLangCallableNV: + if (profile != EEsProfile && version >= 460) { + symbolTable.setVariableExtensions("gl_LaunchIDNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_LaunchSizeNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_PrimitiveID", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_InstanceID", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_InstanceCustomIndexNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_WorldRayOriginNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_WorldRayDirectionNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_ObjectRayOriginNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_ObjectRayDirectionNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_RayTminNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_RayTmaxNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_HitTNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_HitKindNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_ObjectToWorldNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_WorldToObjectNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_IncomingRayFlagsNV", 1, &E_GL_NV_ray_tracing); + + symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); + + BuiltInVariable("gl_LaunchIDNV", EbvLaunchIdNV, symbolTable); + BuiltInVariable("gl_LaunchSizeNV", EbvLaunchSizeNV, symbolTable); + BuiltInVariable("gl_PrimitiveID", EbvPrimitiveId, symbolTable); + BuiltInVariable("gl_InstanceID", EbvInstanceId, symbolTable); + BuiltInVariable("gl_InstanceCustomIndexNV", EbvInstanceCustomIndexNV,symbolTable); + BuiltInVariable("gl_WorldRayOriginNV", EbvWorldRayOriginNV, symbolTable); + BuiltInVariable("gl_WorldRayDirectionNV", EbvWorldRayDirectionNV, symbolTable); + BuiltInVariable("gl_ObjectRayOriginNV", EbvObjectRayOriginNV, symbolTable); + BuiltInVariable("gl_ObjectRayDirectionNV", EbvObjectRayDirectionNV, symbolTable); + BuiltInVariable("gl_RayTminNV", EbvRayTminNV, symbolTable); + BuiltInVariable("gl_RayTmaxNV", EbvRayTmaxNV, symbolTable); + BuiltInVariable("gl_HitTNV", EbvHitTNV, symbolTable); + BuiltInVariable("gl_HitKindNV", EbvHitKindNV, symbolTable); + BuiltInVariable("gl_ObjectToWorldNV", EbvObjectToWorldNV, symbolTable); + BuiltInVariable("gl_WorldToObjectNV", EbvWorldToObjectNV, symbolTable); + BuiltInVariable("gl_IncomingRayFlagsNV", EbvIncomingRayFlagsNV, symbolTable); + BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); + } + break; + case EShLangMeshNV: + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { + // Per-vertex builtins + BuiltInVariable("gl_MeshVerticesNV", "gl_Position", EbvPosition, symbolTable); + BuiltInVariable("gl_MeshVerticesNV", "gl_PointSize", EbvPointSize, symbolTable); + BuiltInVariable("gl_MeshVerticesNV", "gl_ClipDistance", EbvClipDistance, symbolTable); + BuiltInVariable("gl_MeshVerticesNV", "gl_CullDistance", EbvCullDistance, symbolTable); + // Per-view builtins + BuiltInVariable("gl_MeshVerticesNV", "gl_PositionPerViewNV", EbvPositionPerViewNV, symbolTable); + BuiltInVariable("gl_MeshVerticesNV", "gl_ClipDistancePerViewNV", EbvClipDistancePerViewNV, symbolTable); + BuiltInVariable("gl_MeshVerticesNV", "gl_CullDistancePerViewNV", EbvCullDistancePerViewNV, symbolTable); + + // Per-primitive builtins + BuiltInVariable("gl_MeshPrimitivesNV", "gl_PrimitiveID", EbvPrimitiveId, symbolTable); + BuiltInVariable("gl_MeshPrimitivesNV", "gl_Layer", EbvLayer, symbolTable); + BuiltInVariable("gl_MeshPrimitivesNV", "gl_ViewportIndex", EbvViewportIndex, symbolTable); + BuiltInVariable("gl_MeshPrimitivesNV", "gl_ViewportMask", EbvViewportMaskNV, symbolTable); + // Per-view builtins + BuiltInVariable("gl_MeshPrimitivesNV", "gl_LayerPerViewNV", EbvLayerPerViewNV, symbolTable); + BuiltInVariable("gl_MeshPrimitivesNV", "gl_ViewportMaskPerViewNV", EbvViewportMaskPerViewNV, symbolTable); + + symbolTable.setVariableExtensions("gl_PrimitiveCountNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_PrimitiveIndicesNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshViewCountNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshViewIndicesNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_WorkGroupSize", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_WorkGroupID", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_LocalInvocationID", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_GlobalInvocationID", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_LocalInvocationIndex", 1, &E_GL_NV_mesh_shader); + + BuiltInVariable("gl_PrimitiveCountNV", EbvPrimitiveCountNV, symbolTable); + BuiltInVariable("gl_PrimitiveIndicesNV", EbvPrimitiveIndicesNV, symbolTable); + BuiltInVariable("gl_MeshViewCountNV", EbvMeshViewCountNV, symbolTable); + BuiltInVariable("gl_MeshViewIndicesNV", EbvMeshViewIndicesNV, symbolTable); + BuiltInVariable("gl_WorkGroupSize", EbvWorkGroupSize, symbolTable); + BuiltInVariable("gl_WorkGroupID", EbvWorkGroupId, symbolTable); + BuiltInVariable("gl_LocalInvocationID", EbvLocalInvocationId, symbolTable); + BuiltInVariable("gl_GlobalInvocationID", EbvGlobalInvocationId, symbolTable); + BuiltInVariable("gl_LocalInvocationIndex", EbvLocalInvocationIndex, symbolTable); + + symbolTable.setVariableExtensions("gl_MaxMeshOutputVerticesNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MaxMeshOutputPrimitivesNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MaxMeshWorkGroupSizeNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MaxMeshViewCountNV", 1, &E_GL_NV_mesh_shader); + + symbolTable.setFunctionExtensions("barrier", 1, &E_GL_NV_mesh_shader); + symbolTable.setFunctionExtensions("memoryBarrierShared", 1, &E_GL_NV_mesh_shader); + symbolTable.setFunctionExtensions("groupMemoryBarrier", 1, &E_GL_NV_mesh_shader); + } + + if (profile != EEsProfile && version >= 450) { + // GL_EXT_device_group + symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); + BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); + + // GL_ARB_shader_draw_parameters + symbolTable.setVariableExtensions("gl_DrawIDARB", 1, &E_GL_ARB_shader_draw_parameters); + BuiltInVariable("gl_DrawIDARB", EbvDrawId, symbolTable); + if (version >= 460) { + BuiltInVariable("gl_DrawID", EbvDrawId, symbolTable); + } + + // GL_ARB_shader_ballot + symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupInvocationARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupEqMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGtMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLtMaskARB", 1, &E_GL_ARB_shader_ballot); + + BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable); + BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable); + BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable); + BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable); + BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable); + BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable); + + if (spvVersion.vulkan > 0) + // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan + SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable); + else + BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); + } + + // GL_KHR_shader_subgroup + if (spvVersion.vulkan > 0) { + symbolTable.setVariableExtensions("gl_NumSubgroups", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupID", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + + BuiltInVariable("gl_NumSubgroups", EbvNumSubgroups, symbolTable); + BuiltInVariable("gl_SubgroupID", EbvSubgroupID, symbolTable); + BuiltInVariable("gl_SubgroupSize", EbvSubgroupSize2, symbolTable); + BuiltInVariable("gl_SubgroupInvocationID", EbvSubgroupInvocation2, symbolTable); + BuiltInVariable("gl_SubgroupEqMask", EbvSubgroupEqMask2, symbolTable); + BuiltInVariable("gl_SubgroupGeMask", EbvSubgroupGeMask2, symbolTable); + BuiltInVariable("gl_SubgroupGtMask", EbvSubgroupGtMask2, symbolTable); + BuiltInVariable("gl_SubgroupLeMask", EbvSubgroupLeMask2, symbolTable); + BuiltInVariable("gl_SubgroupLtMask", EbvSubgroupLtMask2, symbolTable); + + symbolTable.setFunctionExtensions("subgroupMemoryBarrierShared", 1, &E_GL_KHR_shader_subgroup_basic); + } + break; + + case EShLangTaskNV: + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { + symbolTable.setVariableExtensions("gl_TaskCountNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_WorkGroupSize", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_WorkGroupID", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_LocalInvocationID", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_GlobalInvocationID", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_LocalInvocationIndex", 1, &E_GL_NV_mesh_shader); + + BuiltInVariable("gl_TaskCountNV", EbvTaskCountNV, symbolTable); + BuiltInVariable("gl_WorkGroupSize", EbvWorkGroupSize, symbolTable); + BuiltInVariable("gl_WorkGroupID", EbvWorkGroupId, symbolTable); + BuiltInVariable("gl_LocalInvocationID", EbvLocalInvocationId, symbolTable); + BuiltInVariable("gl_GlobalInvocationID", EbvGlobalInvocationId, symbolTable); + BuiltInVariable("gl_LocalInvocationIndex", EbvLocalInvocationIndex, symbolTable); + + symbolTable.setVariableExtensions("gl_MaxTaskWorkGroupSizeNV", 1, &E_GL_NV_mesh_shader); + + symbolTable.setFunctionExtensions("barrier", 1, &E_GL_NV_mesh_shader); + symbolTable.setFunctionExtensions("memoryBarrierShared", 1, &E_GL_NV_mesh_shader); + symbolTable.setFunctionExtensions("groupMemoryBarrier", 1, &E_GL_NV_mesh_shader); + } + + if (profile != EEsProfile && version >= 450) { + // GL_EXT_device_group + symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); + BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); + + // GL_ARB_shader_draw_parameters + symbolTable.setVariableExtensions("gl_DrawIDARB", 1, &E_GL_ARB_shader_draw_parameters); + BuiltInVariable("gl_DrawIDARB", EbvDrawId, symbolTable); + if (version >= 460) { + BuiltInVariable("gl_DrawID", EbvDrawId, symbolTable); + } + + // GL_ARB_shader_ballot + symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupInvocationARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupEqMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGtMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLtMaskARB", 1, &E_GL_ARB_shader_ballot); + + BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable); + BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable); + BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable); + BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable); + BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable); + BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable); + + if (spvVersion.vulkan > 0) + // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan + SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable); + else + BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); + } + + // GL_KHR_shader_subgroup + if (spvVersion.vulkan > 0) { + symbolTable.setVariableExtensions("gl_NumSubgroups", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupID", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic); + symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupGtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLeMask", 1, &E_GL_KHR_shader_subgroup_ballot); + symbolTable.setVariableExtensions("gl_SubgroupLtMask", 1, &E_GL_KHR_shader_subgroup_ballot); + + BuiltInVariable("gl_NumSubgroups", EbvNumSubgroups, symbolTable); + BuiltInVariable("gl_SubgroupID", EbvSubgroupID, symbolTable); + BuiltInVariable("gl_SubgroupSize", EbvSubgroupSize2, symbolTable); + BuiltInVariable("gl_SubgroupInvocationID", EbvSubgroupInvocation2, symbolTable); + BuiltInVariable("gl_SubgroupEqMask", EbvSubgroupEqMask2, symbolTable); + BuiltInVariable("gl_SubgroupGeMask", EbvSubgroupGeMask2, symbolTable); + BuiltInVariable("gl_SubgroupGtMask", EbvSubgroupGtMask2, symbolTable); + BuiltInVariable("gl_SubgroupLeMask", EbvSubgroupLeMask2, symbolTable); + BuiltInVariable("gl_SubgroupLtMask", EbvSubgroupLtMask2, symbolTable); + + symbolTable.setFunctionExtensions("subgroupMemoryBarrierShared", 1, &E_GL_KHR_shader_subgroup_basic); + } + break; +#endif default: assert(false && "Language not supported"); @@ -8207,6 +9005,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("all", EOpAll); symbolTable.relateToOperator("barrier", EOpBarrier); + symbolTable.relateToOperator("controlBarrier", EOpBarrier); symbolTable.relateToOperator("memoryBarrier", EOpMemoryBarrier); symbolTable.relateToOperator("memoryBarrierAtomicCounter", EOpMemoryBarrierAtomicCounter); symbolTable.relateToOperator("memoryBarrierBuffer", EOpMemoryBarrierBuffer); @@ -8220,6 +9019,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("atomicXor", EOpAtomicXor); symbolTable.relateToOperator("atomicExchange", EOpAtomicExchange); symbolTable.relateToOperator("atomicCompSwap", EOpAtomicCompSwap); + symbolTable.relateToOperator("atomicLoad", EOpAtomicLoad); + symbolTable.relateToOperator("atomicStore", EOpAtomicStore); symbolTable.relateToOperator("atomicCounterIncrement", EOpAtomicCounterIncrement); symbolTable.relateToOperator("atomicCounterDecrement", EOpAtomicCounterDecrement); @@ -8264,6 +9065,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("imageAtomicXor", EOpImageAtomicXor); symbolTable.relateToOperator("imageAtomicExchange", EOpImageAtomicExchange); symbolTable.relateToOperator("imageAtomicCompSwap", EOpImageAtomicCompSwap); + symbolTable.relateToOperator("imageAtomicLoad", EOpImageAtomicLoad); + symbolTable.relateToOperator("imageAtomicStore", EOpImageAtomicStore); symbolTable.relateToOperator("subpassLoad", EOpSubpassLoad); symbolTable.relateToOperator("subpassLoadMS", EOpSubpassLoadMS); @@ -8295,6 +9098,14 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("noise3", EOpNoise); symbolTable.relateToOperator("noise4", EOpNoise); +#ifdef NV_EXTENSIONS + symbolTable.relateToOperator("textureFootprintNV", EOpImageSampleFootprintNV); + symbolTable.relateToOperator("textureFootprintClampNV", EOpImageSampleFootprintClampNV); + symbolTable.relateToOperator("textureFootprintLodNV", EOpImageSampleFootprintLodNV); + symbolTable.relateToOperator("textureFootprintGradNV", EOpImageSampleFootprintGradNV); + symbolTable.relateToOperator("textureFootprintGradClampNV", EOpImageSampleFootprintGradClampNV); +#endif + if (spvVersion.spv == 0 && (IncludeLegacy(version, profile, spvVersion) || (profile == EEsProfile && version == 100))) { symbolTable.relateToOperator("ftransform", EOpFtransform); @@ -8567,7 +9378,58 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("memoryBarrierShared", EOpMemoryBarrierShared); symbolTable.relateToOperator("groupMemoryBarrier", EOpGroupMemoryBarrier); symbolTable.relateToOperator("subgroupMemoryBarrierShared", EOpSubgroupMemoryBarrierShared); +#ifdef NV_EXTENSIONS + if ((profile != EEsProfile && version >= 450) || + (profile == EEsProfile && version >= 320)) { + symbolTable.relateToOperator("dFdx", EOpDPdx); + symbolTable.relateToOperator("dFdy", EOpDPdy); + symbolTable.relateToOperator("fwidth", EOpFwidth); + symbolTable.relateToOperator("dFdxFine", EOpDPdxFine); + symbolTable.relateToOperator("dFdyFine", EOpDPdyFine); + symbolTable.relateToOperator("fwidthFine", EOpFwidthFine); + symbolTable.relateToOperator("dFdxCoarse", EOpDPdxCoarse); + symbolTable.relateToOperator("dFdyCoarse", EOpDPdyCoarse); + symbolTable.relateToOperator("fwidthCoarse",EOpFwidthCoarse); + } +#endif + break; + +#ifdef NV_EXTENSIONS + case EShLangRayGenNV: + case EShLangClosestHitNV: + case EShLangMissNV: + if (profile != EEsProfile && version >= 460) { + symbolTable.relateToOperator("traceNV", EOpTraceNV); + symbolTable.relateToOperator("executeCallableNV", EOpExecuteCallableNV); + } + break; + case EShLangIntersectNV: + if (profile != EEsProfile && version >= 460) + symbolTable.relateToOperator("reportIntersectionNV", EOpReportIntersectionNV); + break; + case EShLangAnyHitNV: + if (profile != EEsProfile && version >= 460) { + symbolTable.relateToOperator("ignoreIntersectionNV", EOpIgnoreIntersectionNV); + symbolTable.relateToOperator("terminateRayNV", EOpTerminateRayNV); + } + break; + case EShLangCallableNV: + if (profile != EEsProfile && version >= 460) { + symbolTable.relateToOperator("executeCallableNV", EOpExecuteCallableNV); + } + break; + case EShLangMeshNV: + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { + symbolTable.relateToOperator("writePackedPrimitiveIndices4x8NV", EOpWritePackedPrimitiveIndices4x8NV); + } + // fall through + case EShLangTaskNV: + if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { + symbolTable.relateToOperator("memoryBarrierShared", EOpMemoryBarrierShared); + symbolTable.relateToOperator("groupMemoryBarrier", EOpGroupMemoryBarrier); + } break; +#endif default: assert(false && "Language not supported"); diff --git a/deps/glslang/glslang/MachineIndependent/Intermediate.cpp b/deps/glslang/glslang/MachineIndependent/Intermediate.cpp index 0333e5d0..6355f300 100644 --- a/deps/glslang/glslang/MachineIndependent/Intermediate.cpp +++ b/deps/glslang/glslang/MachineIndependent/Intermediate.cpp @@ -460,6 +460,9 @@ bool TIntermediate::isConversionAllowed(TOperator op, TIntermTyped* node) const return false; case EbtAtomicUint: case EbtSampler: +#ifdef NV_EXTENSIONS + case EbtAccStructNV: +#endif // opaque types can be passed to functions if (op == EOpFunction) break; @@ -881,6 +884,9 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt // like vector and matrix sizes. TBasicType promoteTo; + // GL_EXT_shader_16bit_storage can't do OpConstantComposite with + // 16-bit types, so disable promotion for those types. + bool canPromoteConstant = true; switch (op) { // @@ -897,18 +903,28 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt break; case EOpConstructFloat16: promoteTo = EbtFloat16; + canPromoteConstant = extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types) || + extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_float16); break; case EOpConstructInt8: promoteTo = EbtInt8; + canPromoteConstant = extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types) || + extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_int8); break; case EOpConstructUint8: promoteTo = EbtUint8; + canPromoteConstant = extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types) || + extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_int8); break; case EOpConstructInt16: promoteTo = EbtInt16; + canPromoteConstant = extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types) || + extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_int16); break; case EOpConstructUint16: promoteTo = EbtUint16; + canPromoteConstant = extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types) || + extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_int16); break; case EOpConstructInt: promoteTo = EbtInt; @@ -999,7 +1015,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt return nullptr; } - if (node->getAsConstantUnion()) + if (canPromoteConstant && node->getAsConstantUnion()) return promoteConstantUnion(promoteTo, node->getAsConstantUnion()); // @@ -1103,9 +1119,12 @@ void TIntermediate::addBiShapeConversion(TOperator op, TIntermTyped*& lhsNode, T rhsNode = addUniShapeConversion(op, lhsNode->getType(), rhsNode); return; + case EOpMul: + // matrix multiply does not change shapes + if (lhsNode->isMatrix() && rhsNode->isMatrix()) + return; case EOpAdd: case EOpSub: - case EOpMul: case EOpDiv: // want to support vector * scalar native ops in AST and lower, not smear, similarly for // matrix * vector, etc. @@ -1178,9 +1197,19 @@ TIntermTyped* TIntermediate::addShapeConversion(const TType& type, TIntermTyped* // The new node that handles the conversion TOperator constructorOp = mapTypeToConstructorOp(type); - // HLSL has custom semantics for scalar->mat shape conversions. if (source == EShSourceHlsl) { - if (node->getType().isScalarOrVec1() && type.isMatrix()) { + // HLSL rules for scalar, vector and matrix conversions: + // 1) scalar can become anything, initializing every component with its value + // 2) vector and matrix can become scalar, first element is used (warning: truncation) + // 3) matrix can become matrix with less rows and/or columns (warning: truncation) + // 4) vector can become vector with less rows size (warning: truncation) + // 5a) vector 4 can become 2x2 matrix (special case) (same packing layout, its a reinterpret) + // 5b) 2x2 matrix can become vector 4 (special case) (same packing layout, its a reinterpret) + + const TType &sourceType = node->getType(); + + // rule 1 for scalar to matrix is special + if (sourceType.isScalarOrVec1() && type.isMatrix()) { // HLSL semantics: the scalar (or vec1) is replicated to every component of the matrix. Left to its // own devices, the constructor from a scalar would populate the diagonal. This forces replication @@ -1188,7 +1217,7 @@ TIntermTyped* TIntermediate::addShapeConversion(const TType& type, TIntermTyped* // Note that if the node is complex (e.g, a function call), we don't want to duplicate it here // repeatedly, so we copy it to a temp, then use the temp. - const int matSize = type.getMatrixRows() * type.getMatrixCols(); + const int matSize = type.computeNumComponents(); TIntermAggregate* rhsAggregate = new TIntermAggregate(); const bool isSimple = (node->getAsSymbolNode() != nullptr) || (node->getAsConstantUnion() != nullptr); @@ -1196,12 +1225,44 @@ TIntermTyped* TIntermediate::addShapeConversion(const TType& type, TIntermTyped* if (!isSimple) { assert(0); // TODO: use node replicator service when available. } - - for (int x=0; xgetSequence().push_back(node); return setAggregateOperator(rhsAggregate, constructorOp, type, node->getLoc()); } + + // rule 1 and 2 + if ((sourceType.isScalar() && !type.isScalar()) || (!sourceType.isScalar() && type.isScalar())) + return setAggregateOperator(makeAggregate(node), constructorOp, type, node->getLoc()); + + // rule 3 and 5b + if (sourceType.isMatrix()) { + // rule 3 + if (type.isMatrix()) { + if ((sourceType.getMatrixCols() != type.getMatrixCols() || sourceType.getMatrixRows() != type.getMatrixRows()) && + sourceType.getMatrixCols() >= type.getMatrixCols() && sourceType.getMatrixRows() >= type.getMatrixRows()) + return setAggregateOperator(makeAggregate(node), constructorOp, type, node->getLoc()); + // rule 5b + } else if (type.isVector()) { + if (type.getVectorSize() == 4 && sourceType.getMatrixCols() == 2 && sourceType.getMatrixRows() == 2) + return setAggregateOperator(makeAggregate(node), constructorOp, type, node->getLoc()); + } + } + + // rule 4 and 5a + if (sourceType.isVector()) { + // rule 4 + if (type.isVector()) + { + if (sourceType.getVectorSize() > type.getVectorSize()) + return setAggregateOperator(makeAggregate(node), constructorOp, type, node->getLoc()); + // rule 5a + } else if (type.isMatrix()) { + if (sourceType.getVectorSize() == 4 && type.getMatrixCols() == 2 && type.getMatrixRows() == 2) + return setAggregateOperator(makeAggregate(node), constructorOp, type, node->getLoc()); + } + } } // scalar -> vector or vec1 -> vector or @@ -1468,16 +1529,16 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat case EbtUint: case EbtInt64: case EbtUint64: + case EbtFloat: + case EbtDouble: + return true; #ifdef AMD_EXTENSIONS case EbtInt16: case EbtUint16: + return extensionRequested(E_GL_AMD_gpu_shader_int16); + case EbtFloat16: + return extensionRequested(E_GL_AMD_gpu_shader_half_float); #endif - case EbtFloat: - case EbtDouble: -#ifdef AMD_EXTENSIONS - case EbtFloat16: -#endif - return true; default: return false; } @@ -1485,17 +1546,21 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat switch (from) { case EbtInt: case EbtUint: + case EbtFloat: + return true; + case EbtBool: + return (source == EShSourceHlsl); #ifdef AMD_EXTENSIONS case EbtInt16: case EbtUint16: + return extensionRequested(E_GL_AMD_gpu_shader_int16); #endif - case EbtFloat: -#ifdef AMD_EXTENSIONS case EbtFloat16: + return +#ifdef AMD_EXTENSIONS + extensionRequested(E_GL_AMD_gpu_shader_half_float) || #endif - return true; - case EbtBool: - return (source == EShSourceHlsl); + (source == EShSourceHlsl); default: return false; } @@ -1504,25 +1569,27 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat case EbtInt: return version >= 400 || (source == EShSourceHlsl); case EbtUint: + return true; + case EbtBool: + return (source == EShSourceHlsl); #ifdef AMD_EXTENSIONS case EbtInt16: case EbtUint16: + return extensionRequested(E_GL_AMD_gpu_shader_int16); #endif - return true; - case EbtBool: - return (source == EShSourceHlsl); default: return false; } case EbtInt: switch (from) { case EbtInt: -#ifdef AMD_EXTENSIONS - case EbtInt16: -#endif return true; case EbtBool: return (source == EShSourceHlsl); +#ifdef AMD_EXTENSIONS + case EbtInt16: + return extensionRequested(E_GL_AMD_gpu_shader_int16); +#endif default: return false; } @@ -1532,11 +1599,12 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat case EbtUint: case EbtInt64: case EbtUint64: + return true; #ifdef AMD_EXTENSIONS case EbtInt16: case EbtUint16: + return extensionRequested(E_GL_AMD_gpu_shader_int16); #endif - return true; default: return false; } @@ -1544,32 +1612,38 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat switch (from) { case EbtInt: case EbtInt64: + return true; #ifdef AMD_EXTENSIONS case EbtInt16: + return extensionRequested(E_GL_AMD_gpu_shader_int16); #endif - return true; default: return false; } -#ifdef AMD_EXTENSIONS case EbtFloat16: +#ifdef AMD_EXTENSIONS switch (from) { case EbtInt16: case EbtUint16: + return extensionRequested(E_GL_AMD_gpu_shader_int16); case EbtFloat16: - return true; + return extensionRequested(E_GL_AMD_gpu_shader_half_float); default: - return false; - } + break; + } +#endif + return false; case EbtUint16: +#ifdef AMD_EXTENSIONS switch (from) { case EbtInt16: case EbtUint16: - return true; + return extensionRequested(E_GL_AMD_gpu_shader_int16); default: - return false; - } + break; + } #endif + return false; default: return false; } @@ -3769,23 +3843,39 @@ struct TextureUpgradeAndSamplerRemovalTransform : public TIntermTraverser { bool visitAggregate(TVisit, TIntermAggregate* ag) override { using namespace std; TIntermSequence& seq = ag->getSequence(); - // remove pure sampler variables - TIntermSequence::iterator newEnd = remove_if(seq.begin(), seq.end(), [](TIntermNode* node) { - TIntermSymbol* symbol = node->getAsSymbolNode(); - if (!symbol) - return false; + TQualifierList& qual = ag->getQualifierList(); - return (symbol->getBasicType() == EbtSampler && symbol->getType().getSampler().isPureSampler()); - }); - seq.erase(newEnd, seq.end()); - // replace constructors with sampler/textures - for_each(seq.begin(), seq.end(), [](TIntermNode*& node) { - TIntermAggregate *constructor = node->getAsAggregate(); + // qual and seq are indexed using the same indices, so we have to modify both in lock-step + assert(seq.size() == qual.size() || qual.empty()); + + size_t write = 0; + for (size_t i = 0; i < seq.size(); ++i) { + TIntermSymbol* symbol = seq[i]->getAsSymbolNode(); + if (symbol && symbol->getBasicType() == EbtSampler && symbol->getType().getSampler().isPureSampler()) { + // remove pure sampler variables + continue; + } + + TIntermNode* result = seq[i]; + + // replace constructors with sampler/textures + TIntermAggregate *constructor = seq[i]->getAsAggregate(); if (constructor && constructor->getOp() == EOpConstructTextureSampler) { if (!constructor->getSequence().empty()) - node = constructor->getSequence()[0]; + result = constructor->getSequence()[0]; } - }); + + // write new node & qualifier + seq[write] = result; + if (!qual.empty()) + qual[write] = qual[i]; + write++; + } + + seq.resize(write); + if (!qual.empty()) + qual.resize(write); + return true; } }; diff --git a/deps/glslang/glslang/MachineIndependent/ParseContextBase.cpp b/deps/glslang/glslang/MachineIndependent/ParseContextBase.cpp index bfa9de4d..7a968ce5 100644 --- a/deps/glslang/glslang/MachineIndependent/ParseContextBase.cpp +++ b/deps/glslang/glslang/MachineIndependent/ParseContextBase.cpp @@ -153,6 +153,12 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op, if (node->getQualifier().readonly) message = "can't modify a readonly buffer"; break; +#ifdef NV_EXTENSIONS + case EvqHitAttrNV: + if (language != EShLangIntersectNV) + message = "cannot modify hitAttributeNV in this stage"; + break; +#endif default: // @@ -168,6 +174,11 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op, case EbtVoid: message = "can't modify void"; break; +#ifdef NV_EXTENSIONS + case EbtAccStructNV: + message = "can't modify accelerationStructureNV"; + break; +#endif default: break; } diff --git a/deps/glslang/glslang/MachineIndependent/ParseHelper.cpp b/deps/glslang/glslang/MachineIndependent/ParseHelper.cpp index 45c050d4..56b45cab 100644 --- a/deps/glslang/glslang/MachineIndependent/ParseHelper.cpp +++ b/deps/glslang/glslang/MachineIndependent/ParseHelper.cpp @@ -76,6 +76,10 @@ TParseContext::TParseContext(TSymbolTable& symbolTable, TIntermediate& interm, b globalBufferDefaults.layoutMatrix = ElmColumnMajor; globalBufferDefaults.layoutPacking = spvVersion.spv != 0 ? ElpStd430 : ElpShared; + // use storage buffer on SPIR-V 1.3 and up + if (spvVersion.spv >= EShTargetSpv_1_3) + intermediate.setUseStorageBuffer(); + globalInputDefaults.clear(); globalOutputDefaults.clear(); @@ -267,9 +271,14 @@ void TParseContext::handlePragma(const TSourceLoc& loc, const TVector& if (tokens.size() != 1) error(loc, "extra tokens", "#pragma", ""); intermediate.setUseStorageBuffer(); + } else if (spvVersion.spv > 0 && tokens[0].compare("use_vulkan_memory_model") == 0) { + if (tokens.size() != 1) + error(loc, "extra tokens", "#pragma", ""); + intermediate.setUseVulkanMemoryModel(); } else if (tokens[0].compare("once") == 0) { warn(loc, "not implemented", "#pragma once", ""); - } + } else if (tokens[0].compare("glslang_binary_double_output") == 0) + intermediate.setBinaryDoubleOutput(); } // @@ -353,95 +362,117 @@ TIntermTyped* TParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symb // TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIntermTyped* base, TIntermTyped* index) { - TIntermTyped* result = nullptr; - int indexValue = 0; if (index->getQualifier().isFrontEndConstant()) indexValue = index->getAsConstantUnion()->getConstArray()[0].getIConst(); + // basic type checks... variableCheck(base); + if (! base->isArray() && ! base->isMatrix() && ! base->isVector()) { if (base->getAsSymbolNode()) error(loc, " left of '[' is not of type array, matrix, or vector ", base->getAsSymbolNode()->getName().c_str(), ""); else error(loc, " left of '[' is not of type array, matrix, or vector ", "expression", ""); - } else if (base->getType().getQualifier().isFrontEndConstant() && index->getQualifier().isFrontEndConstant()) { + + // Insert dummy error-recovery result + return intermediate.addConstantUnion(0.0, EbtFloat, loc); + } + + if (!base->isArray() && base->isVector()) { + if (base->getType().containsBasicType(EbtFloat16)) + requireFloat16Arithmetic(loc, "[", "does not operate on types containing float16"); + if (base->getType().contains16BitInt()) + requireInt16Arithmetic(loc, "[", "does not operate on types containing (u)int16"); + if (base->getType().contains8BitInt()) + requireInt8Arithmetic(loc, "[", "does not operate on types containing (u)int8"); + } + + // check for constant folding + if (base->getType().getQualifier().isFrontEndConstant() && index->getQualifier().isFrontEndConstant()) { // both base and index are front-end constants checkIndex(loc, base->getType(), indexValue); return intermediate.foldDereference(base, indexValue, loc); - } else { - // at least one of base and index is not a front-end constant variable... + } - if (index->getQualifier().isFrontEndConstant()) - checkIndex(loc, base->getType(), indexValue); + // at least one of base and index is not a front-end constant variable... + TIntermTyped* result = nullptr; + if (index->getQualifier().isFrontEndConstant()) + checkIndex(loc, base->getType(), indexValue); - if (base->getAsSymbolNode() && isIoResizeArray(base->getType())) - handleIoResizeArrayAccess(loc, base); + if (base->getAsSymbolNode() && isIoResizeArray(base->getType())) + handleIoResizeArrayAccess(loc, base); - if (index->getQualifier().isFrontEndConstant()) { - if (base->getType().isUnsizedArray()) - base->getWritableType().updateImplicitArraySize(indexValue + 1); - else - checkIndex(loc, base->getType(), indexValue); - result = intermediate.addIndex(EOpIndexDirect, base, index, loc); - } else { - if (base->getType().isUnsizedArray()) { - // we have a variable index into an unsized array, which is okay, - // depending on the situation - if (base->getAsSymbolNode() && isIoResizeArray(base->getType())) - error(loc, "", "[", "array must be sized by a redeclaration or layout qualifier before being indexed with a variable"); - else { - // it is okay for a run-time sized array - checkRuntimeSizable(loc, *base); + if (index->getQualifier().isFrontEndConstant()) { + if (base->getType().isUnsizedArray()) { + base->getWritableType().updateImplicitArraySize(indexValue + 1); +#ifdef NV_EXTENSIONS + // For 2D per-view builtin arrays, update the inner dimension size in parent type + if (base->getQualifier().isPerView() && base->getQualifier().builtIn != EbvNone) { + TIntermBinary* binaryNode = base->getAsBinaryNode(); + if (binaryNode) { + TType& leftType = binaryNode->getLeft()->getWritableType(); + TArraySizes& arraySizes = *leftType.getArraySizes(); + assert(arraySizes.getNumDims() == 2); + arraySizes.setDimSize(1, std::max(arraySizes.getDimSize(1), indexValue + 1)); } - base->getWritableType().setArrayVariablyIndexed(); } - if (base->getBasicType() == EbtBlock) { - if (base->getQualifier().storage == EvqBuffer) - requireProfile(base->getLoc(), ~EEsProfile, "variable indexing buffer block array"); - else if (base->getQualifier().storage == EvqUniform) - profileRequires(base->getLoc(), EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, - "variable indexing uniform block array"); - else { - // input/output blocks either don't exist or can be variable indexed - } - } else if (language == EShLangFragment && base->getQualifier().isPipeOutput()) - requireProfile(base->getLoc(), ~EEsProfile, "variable indexing fragment shader output array"); - else if (base->getBasicType() == EbtSampler && version >= 130) { - const char* explanation = "variable indexing sampler array"; - requireProfile(base->getLoc(), EEsProfile | ECoreProfile | ECompatibilityProfile, explanation); - profileRequires(base->getLoc(), EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, explanation); - profileRequires(base->getLoc(), ECoreProfile | ECompatibilityProfile, 400, nullptr, explanation); +#endif + } else + checkIndex(loc, base->getType(), indexValue); + result = intermediate.addIndex(EOpIndexDirect, base, index, loc); + } else { + if (base->getType().isUnsizedArray()) { + // we have a variable index into an unsized array, which is okay, + // depending on the situation + if (base->getAsSymbolNode() && isIoResizeArray(base->getType())) + error(loc, "", "[", "array must be sized by a redeclaration or layout qualifier before being indexed with a variable"); + else { + // it is okay for a run-time sized array + checkRuntimeSizable(loc, *base); } - - result = intermediate.addIndex(EOpIndexIndirect, base, index, loc); + base->getWritableType().setArrayVariablyIndexed(); + } + if (base->getBasicType() == EbtBlock) { + if (base->getQualifier().storage == EvqBuffer) + requireProfile(base->getLoc(), ~EEsProfile, "variable indexing buffer block array"); + else if (base->getQualifier().storage == EvqUniform) + profileRequires(base->getLoc(), EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, + "variable indexing uniform block array"); + else { + // input/output blocks either don't exist or can be variable indexed + } + } else if (language == EShLangFragment && base->getQualifier().isPipeOutput()) + requireProfile(base->getLoc(), ~EEsProfile, "variable indexing fragment shader output array"); + else if (base->getBasicType() == EbtSampler && version >= 130) { + const char* explanation = "variable indexing sampler array"; + requireProfile(base->getLoc(), EEsProfile | ECoreProfile | ECompatibilityProfile, explanation); + profileRequires(base->getLoc(), EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, explanation); + profileRequires(base->getLoc(), ECoreProfile | ECompatibilityProfile, 400, nullptr, explanation); } + + result = intermediate.addIndex(EOpIndexIndirect, base, index, loc); } - if (result == nullptr) { - // Insert dummy error-recovery result - result = intermediate.addConstantUnion(0.0, EbtFloat, loc); - } else { - // Insert valid dereferenced result - TType newType(base->getType(), 0); // dereferenced type - if (base->getType().getQualifier().isConstant() && index->getQualifier().isConstant()) { - newType.getQualifier().storage = EvqConst; - // If base or index is a specialization constant, the result should also be a specialization constant. - if (base->getType().getQualifier().isSpecConstant() || index->getQualifier().isSpecConstant()) { - newType.getQualifier().makeSpecConstant(); - } - } else { - newType.getQualifier().makePartialTemporary(); + // Insert valid dereferenced result + TType newType(base->getType(), 0); // dereferenced type + if (base->getType().getQualifier().isConstant() && index->getQualifier().isConstant()) { + newType.getQualifier().storage = EvqConst; + // If base or index is a specialization constant, the result should also be a specialization constant. + if (base->getType().getQualifier().isSpecConstant() || index->getQualifier().isSpecConstant()) { + newType.getQualifier().makeSpecConstant(); } - result->setType(newType); + } else { + newType.getQualifier().makePartialTemporary(); + } + result->setType(newType); - // Propagate nonuniform - if (base->getQualifier().isNonUniform() || index->getQualifier().isNonUniform()) - result->getWritableType().getQualifier().nonUniform = true; + // Propagate nonuniform + if (base->getQualifier().isNonUniform() || index->getQualifier().isNonUniform()) + result->getWritableType().getQualifier().nonUniform = true; - if (anyIndexLimits) - handleIndexLimits(loc, base, index); - } + if (anyIndexLimits) + handleIndexLimits(loc, base, index); return result; } @@ -476,12 +507,20 @@ void TParseContext::makeEditable(TSymbol*& symbol) ioArraySymbolResizeList.push_back(symbol); } -// Return true if this is a geometry shader input array or tessellation control output array. +// Return true if this is a geometry shader input array or tessellation control output array +// or mesh shader output array. bool TParseContext::isIoResizeArray(const TType& type) const { return type.isArray() && ((language == EShLangGeometry && type.getQualifier().storage == EvqVaryingIn) || - (language == EShLangTessControl && type.getQualifier().storage == EvqVaryingOut && ! type.getQualifier().patch)); + (language == EShLangTessControl && type.getQualifier().storage == EvqVaryingOut && ! type.getQualifier().patch) +#ifdef NV_EXTENSIONS + || + (language == EShLangFragment && type.getQualifier().storage == EvqVaryingIn && type.getQualifier().pervertexNV) || + (language == EShLangMeshNV && type.getQualifier().storage == EvqVaryingOut && !type.getQualifier().perTaskNV) + +#endif + ); } // If an array is not isIoResizeArray() but is an io array, make sure it has the right size @@ -531,7 +570,7 @@ void TParseContext::handleIoResizeArrayAccess(const TSourceLoc& /*loc*/, TInterm // fix array size, if it can be fixed and needs to be fixed (will allow variable indexing) if (symbolNode->getType().isUnsizedArray()) { - int newSize = getIoArrayImplicitSize(); + int newSize = getIoArrayImplicitSize(symbolNode->getType().getQualifier().isPerPrimitive()); if (newSize > 0) symbolNode->getWritableType().changeOuterArraySize(newSize); } @@ -545,17 +584,27 @@ void TParseContext::handleIoResizeArrayAccess(const TSourceLoc& /*loc*/, TInterm // Types without an array size will be given one. // Types already having a size that is wrong will get an error. // -void TParseContext::checkIoArraysConsistency(const TSourceLoc& loc, bool tailOnly) +void TParseContext::checkIoArraysConsistency(const TSourceLoc& loc, bool tailOnly, bool isPerPrimitive) { - int requiredSize = getIoArrayImplicitSize(); + int requiredSize = getIoArrayImplicitSize(isPerPrimitive); if (requiredSize == 0) return; const char* feature; if (language == EShLangGeometry) feature = TQualifier::getGeometryString(intermediate.getInputPrimitive()); - else if (language == EShLangTessControl) + else if (language == EShLangTessControl +#ifdef NV_EXTENSIONS + || language == EShLangFragment +#endif + ) + feature = "vertices"; +#ifdef NV_EXTENSIONS + else if (language == EShLangMeshNV) { + feature = isPerPrimitive ? "max_primitives" : "max_vertices"; + } +#endif else feature = "unknown"; @@ -568,12 +617,24 @@ void TParseContext::checkIoArraysConsistency(const TSourceLoc& loc, bool tailOnl checkIoArrayConsistency(loc, requiredSize, feature, ioArraySymbolResizeList[i]->getWritableType(), ioArraySymbolResizeList[i]->getName()); } -int TParseContext::getIoArrayImplicitSize() const +int TParseContext::getIoArrayImplicitSize(bool isPerPrimitive) const { if (language == EShLangGeometry) return TQualifier::mapGeometryToSize(intermediate.getInputPrimitive()); else if (language == EShLangTessControl) return intermediate.getVertices() != TQualifier::layoutNotSet ? intermediate.getVertices() : 0; +#ifdef NV_EXTENSIONS + else if (language == EShLangFragment) + return 3; //Number of vertices for Fragment shader is always three. + else if (language == EShLangMeshNV) { + if (isPerPrimitive) { + return intermediate.getPrimitives() != TQualifier::layoutNotSet ? intermediate.getPrimitives() : 0; + } else { + return intermediate.getVertices() != TQualifier::layoutNotSet ? intermediate.getVertices() : 0; + } + } +#endif + else return 0; } @@ -587,6 +648,14 @@ void TParseContext::checkIoArrayConsistency(const TSourceLoc& loc, int requiredS error(loc, "inconsistent input primitive for array size of", feature, name.c_str()); else if (language == EShLangTessControl) error(loc, "inconsistent output number of vertices for array size of", feature, name.c_str()); +#ifdef NV_EXTENSIONS + else if (language == EShLangFragment) { + if (type.getOuterArraySize() > requiredSize) + error(loc, " cannot be greater than 3 for pervertexNV", feature, name.c_str()); + } + else if (language == EShLangMeshNV) + error(loc, "inconsistent output array size of", feature, name.c_str()); +#endif else assert(0); } @@ -614,6 +683,12 @@ TIntermTyped* TParseContext::handleBinaryMath(const TSourceLoc& loc, const char* break; } + if (((left->getType().containsBasicType(EbtFloat16) || right->getType().containsBasicType(EbtFloat16)) && !float16Arithmetic()) || + ((left->getType().contains16BitInt() || right->getType().contains16BitInt()) && !int16Arithmetic()) || + ((left->getType().contains8BitInt() || right->getType().contains8BitInt()) && !int8Arithmetic())) { + allowed = false; + } + TIntermTyped* result = nullptr; if (allowed) result = intermediate.addBinaryMath(op, left, right, loc); @@ -629,7 +704,17 @@ TIntermTyped* TParseContext::handleUnaryMath(const TSourceLoc& loc, const char* { rValueErrorCheck(loc, str, childNode); - TIntermTyped* result = intermediate.addUnaryMath(op, childNode, loc); + bool allowed = true; + if ((childNode->getType().containsBasicType(EbtFloat16) && !float16Arithmetic()) || + (childNode->getType().contains16BitInt() && !int16Arithmetic()) || + (childNode->getType().contains8BitInt() && !int8Arithmetic())) { + allowed = false; + } + + TIntermTyped* result = nullptr; + + if (allowed) + result = intermediate.addUnaryMath(op, childNode, loc); if (result) return result; @@ -691,6 +776,13 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm TSwizzleSelectors selectors; parseSwizzleSelector(loc, field, base->getVectorSize(), selectors); + if (base->isVector() && selectors.size() != 1 && base->getType().containsBasicType(EbtFloat16)) + requireFloat16Arithmetic(loc, ".", "can't swizzle types containing float16"); + if (base->isVector() && selectors.size() != 1 && base->getType().contains16BitInt()) + requireInt16Arithmetic(loc, ".", "can't swizzle types containing (u)int16"); + if (base->isVector() && selectors.size() != 1 && base->getType().contains8BitInt()) + requireInt8Arithmetic(loc, ".", "can't swizzle types containing (u)int8"); + if (base->isScalar()) { if (selectors.size() == 1) return result; @@ -737,6 +829,8 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm TIntermTyped* index = intermediate.addConstantUnion(member, loc); result = intermediate.addIndex(EOpIndexDirectStruct, base, index, loc); result->setType(*(*fields)[member].type); + if ((*fields)[member].type->getQualifier().isIo()) + intermediate.addIoAccessed(field); } } else error(loc, "no such field in structure", field.c_str(), ""); @@ -969,6 +1063,13 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction if (builtIn && fnCandidate->getNumExtensions()) requireExtensions(loc, fnCandidate->getNumExtensions(), fnCandidate->getExtensions(), fnCandidate->getName().c_str()); + if (builtIn && fnCandidate->getType().containsBasicType(EbtFloat16)) + requireFloat16Arithmetic(loc, "built-in function", "float16 types can only be in uniform block or buffer storage"); + if (builtIn && fnCandidate->getType().contains16BitInt()) + requireInt16Arithmetic(loc, "built-in function", "(u)int16 types can only be in uniform block or buffer storage"); + if (builtIn && fnCandidate->getType().contains8BitInt()) + requireInt8Arithmetic(loc, "built-in function", "(u)int8 types can only be in uniform block or buffer storage"); + if (arguments != nullptr) { // Make sure qualifications work for these arguments. TIntermAggregate* aggregate = arguments->getAsAggregate(); @@ -987,13 +1088,29 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction const char* message = "argument cannot drop memory qualifier when passed to formal parameter"; if (argQualifier.volatil && ! formalQualifier.volatil) error(arguments->getLoc(), message, "volatile", ""); - if (argQualifier.coherent && ! formalQualifier.coherent) + if (argQualifier.coherent && ! (formalQualifier.devicecoherent || formalQualifier.coherent)) error(arguments->getLoc(), message, "coherent", ""); + if (argQualifier.devicecoherent && ! (formalQualifier.devicecoherent || formalQualifier.coherent)) + error(arguments->getLoc(), message, "devicecoherent", ""); + if (argQualifier.queuefamilycoherent && ! (formalQualifier.queuefamilycoherent || formalQualifier.devicecoherent || formalQualifier.coherent)) + error(arguments->getLoc(), message, "queuefamilycoherent", ""); + if (argQualifier.workgroupcoherent && ! (formalQualifier.workgroupcoherent || formalQualifier.queuefamilycoherent || formalQualifier.devicecoherent || formalQualifier.coherent)) + error(arguments->getLoc(), message, "workgroupcoherent", ""); + if (argQualifier.subgroupcoherent && ! (formalQualifier.subgroupcoherent || formalQualifier.workgroupcoherent || formalQualifier.queuefamilycoherent || formalQualifier.devicecoherent || formalQualifier.coherent)) + error(arguments->getLoc(), message, "subgroupcoherent", ""); if (argQualifier.readonly && ! formalQualifier.readonly) error(arguments->getLoc(), message, "readonly", ""); if (argQualifier.writeonly && ! formalQualifier.writeonly) error(arguments->getLoc(), message, "writeonly", ""); } + + if (builtIn && arg->getAsTyped()->getType().containsBasicType(EbtFloat16)) + requireFloat16Arithmetic(arguments->getLoc(), "built-in function", "float16 types can only be in uniform block or buffer storage"); + if (builtIn && arg->getAsTyped()->getType().contains16BitInt()) + requireInt16Arithmetic(arguments->getLoc(), "built-in function", "(u)int16 types can only be in uniform block or buffer storage"); + if (builtIn && arg->getAsTyped()->getType().contains8BitInt()) + requireInt8Arithmetic(arguments->getLoc(), "built-in function", "(u)int8 types can only be in uniform block or buffer storage"); + // TODO 4.5 functionality: A shader will fail to compile // if the value passed to the memargument of an atomic memory function does not correspond to a buffer or // shared variable. It is acceptable to pass an element of an array or a single component of a vector to the @@ -1178,6 +1295,8 @@ void TParseContext::computeBuiltinPrecisions(TIntermTyped& node, const TFunction TIntermNode* TParseContext::handleReturnValue(const TSourceLoc& loc, TIntermTyped* value) { + storage16BitAssignmentCheck(loc, value->getType(), "return"); + functionReturnsValue = true; if (currentFunctionType->getBasicType() == EbtVoid) { error(loc, "void function cannot return a value", "return", ""); @@ -1238,8 +1357,15 @@ TIntermTyped* TParseContext::handleLengthMethod(const TSourceLoc& loc, TFunction // without actually redeclaring the array. (It is an error to use a member before the // redeclaration, but not an error to use the array name itself.) const TString& name = intermNode->getAsSymbolNode()->getName(); - if (name == "gl_in" || name == "gl_out") - length = getIoArrayImplicitSize(); + if (name == "gl_in" || name == "gl_out" +#ifdef NV_EXTENSIONS + || name == "gl_MeshVerticesNV" + || name == "gl_MeshPrimitivesNV" +#endif + ) + { + length = getIoArrayImplicitSize(type.getQualifier().isPerPrimitive()); + } } if (length == 0) { if (intermNode->getAsSymbolNode() && isIoResizeArray(type)) @@ -1377,6 +1503,161 @@ TIntermTyped* TParseContext::addOutputArgumentConversions(const TFunction& funct return conversionTree; } +void TParseContext::memorySemanticsCheck(const TSourceLoc& loc, const TFunction& fnCandidate, const TIntermOperator& callNode) +{ + const TIntermSequence* argp = &callNode.getAsAggregate()->getSequence(); + + //const int gl_SemanticsRelaxed = 0x0; + const int gl_SemanticsAcquire = 0x2; + const int gl_SemanticsRelease = 0x4; + const int gl_SemanticsAcquireRelease = 0x8; + const int gl_SemanticsMakeAvailable = 0x2000; + const int gl_SemanticsMakeVisible = 0x4000; + + //const int gl_StorageSemanticsNone = 0x0; + const int gl_StorageSemanticsBuffer = 0x40; + const int gl_StorageSemanticsShared = 0x100; + const int gl_StorageSemanticsImage = 0x800; + const int gl_StorageSemanticsOutput = 0x1000; + + + unsigned int semantics = 0, storageClassSemantics = 0; + unsigned int semantics2 = 0, storageClassSemantics2 = 0; + + // Grab the semantics and storage class semantics from the operands, based on opcode + switch (callNode.getOp()) { + case EOpAtomicAdd: + case EOpAtomicMin: + case EOpAtomicMax: + case EOpAtomicAnd: + case EOpAtomicOr: + case EOpAtomicXor: + case EOpAtomicExchange: + case EOpAtomicStore: + storageClassSemantics = (*argp)[3]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics = (*argp)[4]->getAsConstantUnion()->getConstArray()[0].getIConst(); + break; + case EOpAtomicLoad: + storageClassSemantics = (*argp)[2]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics = (*argp)[3]->getAsConstantUnion()->getConstArray()[0].getIConst(); + break; + case EOpAtomicCompSwap: + storageClassSemantics = (*argp)[4]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics = (*argp)[5]->getAsConstantUnion()->getConstArray()[0].getIConst(); + storageClassSemantics2 = (*argp)[6]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics2 = (*argp)[7]->getAsConstantUnion()->getConstArray()[0].getIConst(); + break; + + case EOpImageAtomicAdd: + case EOpImageAtomicMin: + case EOpImageAtomicMax: + case EOpImageAtomicAnd: + case EOpImageAtomicOr: + case EOpImageAtomicXor: + case EOpImageAtomicExchange: + case EOpImageAtomicStore: + storageClassSemantics = (*argp)[4]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics = (*argp)[5]->getAsConstantUnion()->getConstArray()[0].getIConst(); + break; + case EOpImageAtomicLoad: + storageClassSemantics = (*argp)[3]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics = (*argp)[4]->getAsConstantUnion()->getConstArray()[0].getIConst(); + break; + case EOpImageAtomicCompSwap: + storageClassSemantics = (*argp)[5]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics = (*argp)[6]->getAsConstantUnion()->getConstArray()[0].getIConst(); + storageClassSemantics2 = (*argp)[7]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics2 = (*argp)[8]->getAsConstantUnion()->getConstArray()[0].getIConst(); + break; + + case EOpBarrier: + storageClassSemantics = (*argp)[2]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics = (*argp)[3]->getAsConstantUnion()->getConstArray()[0].getIConst(); + break; + case EOpMemoryBarrier: + storageClassSemantics = (*argp)[1]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics = (*argp)[2]->getAsConstantUnion()->getConstArray()[0].getIConst(); + break; + default: + break; + } + + if ((semantics & gl_SemanticsAcquire) && + (callNode.getOp() == EOpAtomicStore || callNode.getOp() == EOpImageAtomicStore)) { + error(loc, "gl_SemanticsAcquire must not be used with (image) atomic store", + fnCandidate.getName().c_str(), ""); + } + if ((semantics & gl_SemanticsRelease) && + (callNode.getOp() == EOpAtomicLoad || callNode.getOp() == EOpImageAtomicLoad)) { + error(loc, "gl_SemanticsRelease must not be used with (image) atomic load", + fnCandidate.getName().c_str(), ""); + } + if ((semantics & gl_SemanticsAcquireRelease) && + (callNode.getOp() == EOpAtomicStore || callNode.getOp() == EOpImageAtomicStore || + callNode.getOp() == EOpAtomicLoad || callNode.getOp() == EOpImageAtomicLoad)) { + error(loc, "gl_SemanticsAcquireRelease must not be used with (image) atomic load/store", + fnCandidate.getName().c_str(), ""); + } + if (((semantics | semantics2) & ~(gl_SemanticsAcquire | + gl_SemanticsRelease | + gl_SemanticsAcquireRelease | + gl_SemanticsMakeAvailable | + gl_SemanticsMakeVisible))) { + error(loc, "Invalid semantics value", fnCandidate.getName().c_str(), ""); + } + if (((storageClassSemantics | storageClassSemantics2) & ~(gl_StorageSemanticsBuffer | + gl_StorageSemanticsShared | + gl_StorageSemanticsImage | + gl_StorageSemanticsOutput))) { + error(loc, "Invalid storage class semantics value", fnCandidate.getName().c_str(), ""); + } + + if (callNode.getOp() == EOpMemoryBarrier) { + if (!IsPow2(semantics & (gl_SemanticsAcquire | gl_SemanticsRelease | gl_SemanticsAcquireRelease))) { + error(loc, "Semantics must include exactly one of gl_SemanticsRelease, gl_SemanticsAcquire, or " + "gl_SemanticsAcquireRelease", fnCandidate.getName().c_str(), ""); + } + } else { + if (semantics & (gl_SemanticsAcquire | gl_SemanticsRelease | gl_SemanticsAcquireRelease)) { + if (!IsPow2(semantics & (gl_SemanticsAcquire | gl_SemanticsRelease | gl_SemanticsAcquireRelease))) { + error(loc, "Semantics must not include multiple of gl_SemanticsRelease, gl_SemanticsAcquire, or " + "gl_SemanticsAcquireRelease", fnCandidate.getName().c_str(), ""); + } + } + if (semantics2 & (gl_SemanticsAcquire | gl_SemanticsRelease | gl_SemanticsAcquireRelease)) { + if (!IsPow2(semantics2 & (gl_SemanticsAcquire | gl_SemanticsRelease | gl_SemanticsAcquireRelease))) { + error(loc, "semUnequal must not include multiple of gl_SemanticsRelease, gl_SemanticsAcquire, or " + "gl_SemanticsAcquireRelease", fnCandidate.getName().c_str(), ""); + } + } + } + if (callNode.getOp() == EOpMemoryBarrier) { + if (storageClassSemantics == 0) { + error(loc, "Storage class semantics must not be zero", fnCandidate.getName().c_str(), ""); + } + } + if (callNode.getOp() == EOpBarrier && semantics != 0 && storageClassSemantics == 0) { + error(loc, "Storage class semantics must not be zero", fnCandidate.getName().c_str(), ""); + } + if ((callNode.getOp() == EOpAtomicCompSwap || callNode.getOp() == EOpImageAtomicCompSwap) && + (semantics2 & (gl_SemanticsRelease | gl_SemanticsAcquireRelease))) { + error(loc, "semUnequal must not be gl_SemanticsRelease or gl_SemanticsAcquireRelease", + fnCandidate.getName().c_str(), ""); + } + if ((semantics & gl_SemanticsMakeAvailable) && + !(semantics & (gl_SemanticsRelease | gl_SemanticsAcquireRelease))) { + error(loc, "gl_SemanticsMakeAvailable requires gl_SemanticsRelease or gl_SemanticsAcquireRelease", + fnCandidate.getName().c_str(), ""); + } + if ((semantics & gl_SemanticsMakeVisible) && + !(semantics & (gl_SemanticsAcquire | gl_SemanticsAcquireRelease))) { + error(loc, "gl_SemanticsMakeVisible requires gl_SemanticsAcquire or gl_SemanticsAcquireRelease", + fnCandidate.getName().c_str(), ""); + } + +} + + // // Do additional checking of built-in function calls that is not caught // by normal semantic checks on argument type, extension tagging, etc. @@ -1591,6 +1872,17 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan break; } +#ifdef NV_EXTENSIONS + case EOpTraceNV: + if (!(*argp)[10]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "payload number", ""); + break; + case EOpExecuteCallableNV: + if (!(*argp)[1]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "callable data number", ""); + break; +#endif + case EOpTextureQuerySamples: case EOpImageQuerySamples: // GL_ARB_shader_texture_image_samples @@ -1605,6 +1897,8 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan case EOpImageAtomicXor: case EOpImageAtomicExchange: case EOpImageAtomicCompSwap: + case EOpImageAtomicLoad: + case EOpImageAtomicStore: { // Make sure the image types have the correct layout() format and correct argument types const TType& imageType = arg0->getType(); @@ -1618,10 +1912,15 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan error(loc, "only supported on image with format r32f", fnCandidate.getName().c_str(), ""); } + const size_t maxArgs = imageType.getSampler().isMultiSample() ? 5 : 4; + if (argp->size() > maxArgs) { + requireExtensions(loc, 1, &E_GL_KHR_memory_scope_semantics, fnCandidate.getName().c_str()); + memorySemanticsCheck(loc, fnCandidate, callNode); + } + break; } -#ifdef NV_EXTENSIONS case EOpAtomicAdd: case EOpAtomicMin: case EOpAtomicMax: @@ -1630,13 +1929,23 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan case EOpAtomicXor: case EOpAtomicExchange: case EOpAtomicCompSwap: + case EOpAtomicLoad: + case EOpAtomicStore: { - if (arg0->getType().getBasicType() == EbtInt64 || arg0->getType().getBasicType() == EbtUint64) - requireExtensions(loc, 1, &E_GL_NV_shader_atomic_int64, fnCandidate.getName().c_str()); - + if (argp->size() > 3) { + requireExtensions(loc, 1, &E_GL_KHR_memory_scope_semantics, fnCandidate.getName().c_str()); + memorySemanticsCheck(loc, fnCandidate, callNode); + } else if (arg0->getType().getBasicType() == EbtInt64 || arg0->getType().getBasicType() == EbtUint64) { +#ifdef NV_EXTENSIONS + const char* const extensions[2] = { E_GL_NV_shader_atomic_int64, + E_GL_EXT_shader_atomic_int64 }; + requireExtensions(loc, 2, extensions, fnCandidate.getName().c_str()); +#else + requireExtensions(loc, 1, &E_GL_EXT_shader_atomic_int64, fnCandidate.getName().c_str()); +#endif + } break; } -#endif case EOpInterpolateAtCentroid: case EOpInterpolateAtSample: @@ -1700,6 +2009,39 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan } break; + case EOpBarrier: + case EOpMemoryBarrier: + if (argp->size() > 0) { + requireExtensions(loc, 1, &E_GL_KHR_memory_scope_semantics, fnCandidate.getName().c_str()); + memorySemanticsCheck(loc, fnCandidate, callNode); + } + break; + + default: + break; + } + + // Texture operations on texture objects (aside from texelFetch on a + // textureBuffer) require EXT_samplerless_texture_functions. + switch (callNode.getOp()) { + case EOpTextureQuerySize: + case EOpTextureQueryLevels: + case EOpTextureQuerySamples: + case EOpTextureFetch: + case EOpTextureFetchOffset: + { + const TSampler& sampler = fnCandidate[0].type->getSampler(); + + const bool isTexture = sampler.isTexture() && !sampler.isCombined(); + const bool isBuffer = sampler.dim == EsdBuffer; + const bool isFetch = callNode.getOp() == EOpTextureFetch || callNode.getOp() == EOpTextureFetchOffset; + + if (isTexture && (!isBuffer || !isFetch)) + requireExtensions(loc, 1, &E_GL_EXT_samplerless_texture_functions, fnCandidate.getName().c_str()); + + break; + } + default: break; } @@ -2327,6 +2669,59 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T specConstType = true; if (function[arg].type->isFloatingDomain()) floatArgument = true; + if (type.isStruct()) { + if (function[arg].type->containsBasicType(EbtFloat16)) { + requireFloat16Arithmetic(loc, "constructor", "can't construct structure containing 16-bit type"); + } + if (function[arg].type->containsBasicType(EbtUint16) || + function[arg].type->containsBasicType(EbtInt16)) { + requireInt16Arithmetic(loc, "constructor", "can't construct structure containing 16-bit type"); + } + if (function[arg].type->containsBasicType(EbtUint8) || + function[arg].type->containsBasicType(EbtInt8)) { + requireInt8Arithmetic(loc, "constructor", "can't construct structure containing 8-bit type"); + } + } + } + + switch (op) { + case EOpConstructFloat16: + case EOpConstructF16Vec2: + case EOpConstructF16Vec3: + case EOpConstructF16Vec4: + if (type.isArray()) + requireFloat16Arithmetic(loc, "constructor", "16-bit arrays not supported"); + if (type.isVector() && function.getParamCount() != 1) + requireFloat16Arithmetic(loc, "constructor", "16-bit vectors only take vector types"); + break; + case EOpConstructUint16: + case EOpConstructU16Vec2: + case EOpConstructU16Vec3: + case EOpConstructU16Vec4: + case EOpConstructInt16: + case EOpConstructI16Vec2: + case EOpConstructI16Vec3: + case EOpConstructI16Vec4: + if (type.isArray()) + requireInt16Arithmetic(loc, "constructor", "16-bit arrays not supported"); + if (type.isVector() && function.getParamCount() != 1) + requireInt16Arithmetic(loc, "constructor", "16-bit vectors only take vector types"); + break; + case EOpConstructUint8: + case EOpConstructU8Vec2: + case EOpConstructU8Vec3: + case EOpConstructU8Vec4: + case EOpConstructInt8: + case EOpConstructI8Vec2: + case EOpConstructI8Vec3: + case EOpConstructI8Vec4: + if (type.isArray()) + requireInt8Arithmetic(loc, "constructor", "8-bit arrays not supported"); + if (type.isVector() && function.getParamCount() != 1) + requireInt8Arithmetic(loc, "constructor", "8-bit vectors only take vector types"); + break; + default: + break; } // inherit constness from children @@ -2526,18 +2921,12 @@ bool TParseContext::constructorTextureSamplerError(const TSourceLoc& loc, const // second argument // * the constructor's second argument must be a scalar of type // *sampler* or *samplerShadow* - // * the presence or absence of depth comparison (Shadow) must match - // between the constructed sampler type and the type of the second argument if ( function[1].type->getBasicType() != EbtSampler || ! function[1].type->getSampler().isPureSampler() || function[1].type->isArray()) { error(loc, "sampler-constructor second argument must be a scalar type 'sampler'", token, ""); return true; } - if (function.getType().getSampler().shadow != function[1].type->getSampler().shadow) { - error(loc, "sampler-constructor second argument presence of shadow must match constructor presence of shadow", token, ""); - return true; - } return false; } @@ -2605,6 +2994,20 @@ void TParseContext::atomicUintCheck(const TSourceLoc& loc, const TType& type, co else if (type.getBasicType() == EbtAtomicUint && type.getQualifier().storage != EvqUniform) error(loc, "atomic_uints can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str()); } +#ifdef NV_EXTENSIONS +void TParseContext::accStructNVCheck(const TSourceLoc& loc, const TType& type, const TString& identifier) +{ + if (type.getQualifier().storage == EvqUniform) + return; + + if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtAccStructNV)) + error(loc, "non-uniform struct contains an accelerationStructureNV:", type.getBasicTypeString().c_str(), identifier.c_str()); + else if (type.getBasicType() == EbtAccStructNV && type.getQualifier().storage != EvqUniform) + error(loc, "accelerationStructureNV can only be used in uniform variables or function parameters:", + type.getBasicTypeString().c_str(), identifier.c_str()); + +} +#endif void TParseContext::transparentOpaqueCheck(const TSourceLoc& loc, const TType& type, const TString& identifier) { @@ -2683,8 +3086,11 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali if (! symbolTable.atGlobalLevel()) return; - if (qualifier.isMemory() && ! publicType.isImage() && publicType.qualifier.storage != EvqBuffer) + if (qualifier.isMemoryQualifierImageAndSSBOOnly() && ! publicType.isImage() && publicType.qualifier.storage != EvqBuffer) { error(loc, "memory qualifiers cannot be used on this type", "", ""); + } else if (qualifier.isMemory() && (publicType.basicType != EbtSampler) && !publicType.qualifier.isUniformOrBuffer()) { + error(loc, "memory qualifiers cannot be used on this type", "", ""); + } if (qualifier.storage == EvqBuffer && publicType.basicType != EbtBlock) error(loc, "buffers can be declared only as blocks", "buffer", ""); @@ -2705,11 +3111,14 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali if (isTypeInt(publicType.basicType) || publicType.basicType == EbtDouble) profileRequires(loc, EEsProfile, 300, nullptr, "shader input/output"); + if (!qualifier.flat #ifdef AMD_EXTENSIONS - if (! qualifier.flat && ! qualifier.explicitInterp) { -#else - if (!qualifier.flat) { + && !qualifier.explicitInterp #endif +#ifdef NV_EXTENSIONS + && !qualifier.pervertexNV +#endif + ) { if (isTypeInt(publicType.basicType) || publicType.basicType == EbtDouble || (publicType.userDef && (publicType.userDef->containsBasicType(EbtInt8) || @@ -2731,6 +3140,11 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali if (qualifier.patch && qualifier.isInterpolation()) error(loc, "cannot use interpolation qualifiers with patch", "patch", ""); +#ifdef NV_EXTENSIONS + if (qualifier.perTaskNV && publicType.basicType != EbtBlock) + error(loc, "taskNV variables can be declared only as blocks", "taskNV", ""); +#endif + if (qualifier.storage == EvqVaryingIn) { switch (language) { case EShLangVertex: @@ -2897,6 +3311,13 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons if (dst.precision == EpqNone || (force && src.precision != EpqNone)) dst.precision = src.precision; + if (!force && ((src.coherent && (dst.devicecoherent || dst.queuefamilycoherent || dst.workgroupcoherent || dst.subgroupcoherent)) || + (src.devicecoherent && (dst.coherent || dst.queuefamilycoherent || dst.workgroupcoherent || dst.subgroupcoherent)) || + (src.queuefamilycoherent && (dst.coherent || dst.devicecoherent || dst.workgroupcoherent || dst.subgroupcoherent)) || + (src.workgroupcoherent && (dst.coherent || dst.devicecoherent || dst.queuefamilycoherent || dst.subgroupcoherent)) || + (src.subgroupcoherent && (dst.coherent || dst.devicecoherent || dst.queuefamilycoherent || dst.workgroupcoherent)))) { + error(loc, "only one coherent/devicecoherent/queuefamilycoherent/workgroupcoherent/subgroupcoherent qualifier allowed", GetPrecisionQualifierString(src.precision), ""); + } // Layout qualifiers mergeObjectLayoutQualifiers(dst, src, false); @@ -2911,10 +3332,20 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons MERGE_SINGLETON(nopersp); #ifdef AMD_EXTENSIONS MERGE_SINGLETON(explicitInterp); +#endif +#ifdef NV_EXTENSIONS + MERGE_SINGLETON(perPrimitiveNV); + MERGE_SINGLETON(perViewNV); + MERGE_SINGLETON(perTaskNV); #endif MERGE_SINGLETON(patch); MERGE_SINGLETON(sample); MERGE_SINGLETON(coherent); + MERGE_SINGLETON(devicecoherent); + MERGE_SINGLETON(queuefamilycoherent); + MERGE_SINGLETON(workgroupcoherent); + MERGE_SINGLETON(subgroupcoherent); + MERGE_SINGLETON(nonprivate); MERGE_SINGLETON(volatil); MERGE_SINGLETON(restrict); MERGE_SINGLETON(readonly); @@ -3011,6 +3442,13 @@ void TParseContext::parameterTypeCheck(const TSourceLoc& loc, TStorageQualifier { if ((qualifier == EvqOut || qualifier == EvqInOut) && type.isOpaque()) error(loc, "samplers and atomic_uints cannot be output parameters", type.getBasicTypeString().c_str(), ""); + + if (!parsingBuiltins && type.containsBasicType(EbtFloat16)) + requireFloat16Arithmetic(loc, type.getBasicTypeString().c_str(), "float16 types can only be in uniform block or buffer storage"); + if (!parsingBuiltins && type.contains16BitInt()) + requireInt16Arithmetic(loc, type.getBasicTypeString().c_str(), "(u)int16 types can only be in uniform block or buffer storage"); + if (!parsingBuiltins && type.contains8BitInt()) + requireInt8Arithmetic(loc, type.getBasicTypeString().c_str(), "(u)int8 types can only be in uniform block or buffer storage"); } bool TParseContext::containsFieldWithBasicType(const TType& type, TBasicType basicType) @@ -3135,7 +3573,8 @@ void TParseContext::structArrayCheck(const TSourceLoc& /*loc*/, const TType& typ } } -void TParseContext::arraySizesCheck(const TSourceLoc& loc, const TQualifier& qualifier, TArraySizes* arraySizes, bool initializer, bool lastMember) +void TParseContext::arraySizesCheck(const TSourceLoc& loc, const TQualifier& qualifier, TArraySizes* arraySizes, + const TIntermTyped* initializer, bool lastMember) { assert(arraySizes); @@ -3143,9 +3582,13 @@ void TParseContext::arraySizesCheck(const TSourceLoc& loc, const TQualifier& qua if (parsingBuiltins) return; - // always allow an initializer to set any unknown array sizes - if (initializer) + // initializer must be a sized array, in which case + // allow the initializer to set any unknown array sizes + if (initializer != nullptr) { + if (initializer->getType().isUnsizedArray()) + error(loc, "array initializer must be sized", "[]", ""); return; + } // No environment allows any non-outer-dimension to be implicitly sized if (arraySizes->isInnerUnsized()) { @@ -3189,6 +3632,14 @@ void TParseContext::arraySizesCheck(const TSourceLoc& loc, const TQualifier& qua extensionsTurnedOn(Num_AEP_tessellation_shader, AEP_tessellation_shader)) return; break; +#ifdef NV_EXTENSIONS + case EShLangMeshNV: + if (qualifier.storage == EvqVaryingOut) + if ((profile == EEsProfile && version >= 320) || + extensionTurnedOn(E_GL_NV_mesh_shader)) + return; + break; +#endif default: break; } @@ -3236,7 +3687,7 @@ void TParseContext::declareArray(const TSourceLoc& loc, const TString& identifie if (! symbolTable.atBuiltInLevel()) { if (isIoResizeArray(type)) { ioArraySymbolResizeList.push_back(symbol); - checkIoArraysConsistency(loc, true); + checkIoArraysConsistency(loc, true, type.getQualifier().isPerPrimitive()); } else fixIoArraySize(loc, symbol->getWritableType()); } @@ -3289,7 +3740,7 @@ void TParseContext::declareArray(const TSourceLoc& loc, const TString& identifie existingType.updateArraySizes(type); if (isIoResizeArray(type)) - checkIoArraysConsistency(loc); + checkIoArraysConsistency(loc, false, type.getQualifier().isPerPrimitive()); } // Policy and error check for needing a runtime sized array. @@ -3325,6 +3776,28 @@ bool TParseContext::isRuntimeLength(const TIntermTyped& base) const return false; } +#ifdef NV_EXTENSIONS +// Fix mesh view output array dimension +void TParseContext::resizeMeshViewDimension(const TSourceLoc& loc, TType& type) +{ + // see if member is a per-view attribute + if (type.getQualifier().isPerView()) { + // since we don't have the maxMeshViewCountNV set during parsing builtins, we hardcode the value + int maxViewCount = parsingBuiltins ? 4 : resources.maxMeshViewCountNV; + + if (! type.isArray()) { + error(loc, "requires an view array dimension", "perviewNV", ""); + } + else if (!type.isUnsizedArray() && type.getOuterArraySize() != maxViewCount) { + error(loc, "mesh view output array size must be gl_MaxMeshViewCountNV or implicitly sized", "[]", ""); + } + else if (type.isUnsizedArray()) { + type.changeOuterArraySize(maxViewCount); + } + } +} +#endif + // Returns true if the first argument to the #line directive is the line number for the next line. // // Desktop, pre-version 3.30: "After processing this directive @@ -3399,6 +3872,8 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS identifier == "gl_BackSecondaryColor" || identifier == "gl_SecondaryColor" || (identifier == "gl_Color" && language == EShLangFragment) || + (identifier == "gl_FragStencilRefARB" && (nonEsRedecls && version >= 140) + && language == EShLangFragment) || #ifdef NV_EXTENSIONS identifier == "gl_SampleMask" || identifier == "gl_Layer" || @@ -3481,6 +3956,12 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS error(loc, "all redeclarations must use the same depth layout on", "redeclaration", symbol->getName().c_str()); } } + else if (identifier == "gl_FragStencilRefARB") { + if (qualifier.hasLayout()) + error(loc, "cannot apply layout qualifier to", "redeclaration", symbol->getName().c_str()); + if (qualifier.storage != EvqVaryingOut) + error(loc, "cannot change output storage qualification of", "redeclaration", symbol->getName().c_str()); + } #ifdef NV_EXTENSIONS else if (identifier == "gl_SampleMask") { if (!publicType.layoutOverrideCoverage) { @@ -3508,13 +3989,19 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS // Either redeclare the requested block, or give an error message why it can't be done. // // TODO: functionality: explicitly sizing members of redeclared blocks is not giving them an explicit size -void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newTypeList, const TString& blockName, const TString* instanceName, TArraySizes* arraySizes) +void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newTypeList, const TString& blockName, + const TString* instanceName, TArraySizes* arraySizes) { const char* feature = "built-in block redeclaration"; profileRequires(loc, EEsProfile, 320, Num_AEP_shader_io_blocks, AEP_shader_io_blocks, feature); profileRequires(loc, ~EEsProfile, 410, E_GL_ARB_separate_shader_objects, feature); - if (blockName != "gl_PerVertex" && blockName != "gl_PerFragment") { + if (blockName != "gl_PerVertex" && blockName != "gl_PerFragment" +#ifdef NV_EXTENSIONS + && blockName != "gl_MeshPerVertexNV" && blockName != "gl_MeshPerPrimitiveNV" +#endif + ) + { error(loc, "cannot redeclare block: ", "block declaration", blockName.c_str()); return; } @@ -3562,7 +4049,7 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT if (currentBlockQualifier.storage == EvqVaryingOut && globalOutputDefaults.hasXfbBuffer()) { if (!currentBlockQualifier.hasXfbBuffer()) currentBlockQualifier.layoutXfbBuffer = globalOutputDefaults.layoutXfbBuffer; - fixBlockXfbOffsets(currentBlockQualifier, newTypeList); + fixXfbOffsets(currentBlockQualifier, newTypeList); } // Edit and error check the container against the redeclaration @@ -3610,10 +4097,31 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT error(memberLoc, "cannot redeclare block member with a different type", member->type->getFieldName().c_str(), ""); if (oldType.isArray() != newType.isArray()) error(memberLoc, "cannot change arrayness of redeclared block member", member->type->getFieldName().c_str(), ""); - else if (! oldType.sameArrayness(newType) && oldType.isSizedArray()) + else if (! oldType.getQualifier().isPerView() && ! oldType.sameArrayness(newType) && oldType.isSizedArray()) error(memberLoc, "cannot change array size of redeclared block member", member->type->getFieldName().c_str(), ""); - else if (newType.isArray()) + else if (! oldType.getQualifier().isPerView() && newType.isArray()) arrayLimitCheck(loc, member->type->getFieldName(), newType.getOuterArraySize()); +#ifdef NV_EXTENSIONS + if (oldType.getQualifier().isPerView() && ! newType.getQualifier().isPerView()) + error(memberLoc, "missing perviewNV qualifier to redeclared block member", member->type->getFieldName().c_str(), ""); + else if (! oldType.getQualifier().isPerView() && newType.getQualifier().isPerView()) + error(memberLoc, "cannot add perviewNV qualifier to redeclared block member", member->type->getFieldName().c_str(), ""); + else if (newType.getQualifier().isPerView()) { + if (oldType.getArraySizes()->getNumDims() != newType.getArraySizes()->getNumDims()) + error(memberLoc, "cannot change arrayness of redeclared block member", member->type->getFieldName().c_str(), ""); + else if (! newType.isUnsizedArray() && newType.getOuterArraySize() != resources.maxMeshViewCountNV) + error(loc, "mesh view output array size must be gl_MaxMeshViewCountNV or implicitly sized", "[]", ""); + else if (newType.getArraySizes()->getNumDims() == 2) { + int innerDimSize = newType.getArraySizes()->getDimSize(1); + arrayLimitCheck(memberLoc, member->type->getFieldName(), innerDimSize); + oldType.getArraySizes()->setDimSize(1, innerDimSize); + } + } + if (oldType.getQualifier().isPerPrimitive() && ! newType.getQualifier().isPerPrimitive()) + error(memberLoc, "missing perprimitiveNV qualifier to redeclared block member", member->type->getFieldName().c_str(), ""); + else if (! oldType.getQualifier().isPerPrimitive() && newType.getQualifier().isPerPrimitive()) + error(memberLoc, "cannot add perprimitiveNV qualifier to redeclared block member", member->type->getFieldName().c_str(), ""); +#endif if (newType.getQualifier().isMemory()) error(memberLoc, "cannot add memory qualifier to redeclared block member", member->type->getFieldName().c_str(), ""); if (newType.getQualifier().hasNonXfbLayout()) @@ -3662,15 +4170,24 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT if (numOriginalMembersFound < newTypeList.size()) error(loc, "block redeclaration has extra members", blockName.c_str(), ""); - if (type.isArray() != (arraySizes != nullptr)) + if (type.isArray() != (arraySizes != nullptr) || + (type.isArray() && arraySizes != nullptr && type.getArraySizes()->getNumDims() != arraySizes->getNumDims())) error(loc, "cannot change arrayness of redeclared block", blockName.c_str(), ""); else if (type.isArray()) { - if (type.isSizedArray() && !arraySizes->isSized()) - error(loc, "block already declared with size, can't redeclare as unsized", blockName.c_str(), ""); - else if (type.isSizedArray() && *type.getArraySizes() != *arraySizes) - error(loc, "cannot change array size of redeclared block", blockName.c_str(), ""); - else if (!type.isSizedArray() && arraySizes->isSized()) + // At this point, we know both are arrays and both have the same number of dimensions. + + // It is okay for a built-in block redeclaration to be unsized, and keep the size of the + // original block declaration. + if (!arraySizes->isSized() && type.isSizedArray()) + arraySizes->changeOuterSize(type.getOuterArraySize()); + + // And, okay to be giving a size to the array, by the redeclaration + if (!type.isSizedArray() && arraySizes->isSized()) type.changeOuterArraySize(arraySizes->getOuterSize()); + + // Now, they must match in all dimensions. + if (type.isSizedArray() && *type.getArraySizes() != *arraySizes) + error(loc, "cannot change array size of redeclared block", blockName.c_str(), ""); } symbolTable.insert(*block); @@ -3681,7 +4198,7 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT // Tracking for implicit sizing of array if (isIoResizeArray(block->getType())) { ioArraySymbolResizeList.push_back(block); - checkIoArraysConsistency(loc, true); + checkIoArraysConsistency(loc, true, block->getType().getQualifier().isPerPrimitive()); } else if (block->getType().isArray()) fixIoArraySize(loc, block->getWritableType()); @@ -3717,6 +4234,11 @@ void TParseContext::paramCheckFix(const TSourceLoc& loc, const TQualifier& quali if (qualifier.isMemory()) { type.getQualifier().volatil = qualifier.volatil; type.getQualifier().coherent = qualifier.coherent; + type.getQualifier().devicecoherent = qualifier.devicecoherent ; + type.getQualifier().queuefamilycoherent = qualifier.queuefamilycoherent; + type.getQualifier().workgroupcoherent = qualifier.workgroupcoherent; + type.getQualifier().subgroupcoherent = qualifier.subgroupcoherent; + type.getQualifier().nonprivate = qualifier.nonprivate; type.getQualifier().readonly = qualifier.readonly; type.getQualifier().writeonly = qualifier.writeonly; type.getQualifier().restrict = qualifier.restrict; @@ -3770,6 +4292,39 @@ void TParseContext::opaqueCheck(const TSourceLoc& loc, const TType& type, const error(loc, "can't use with samplers or structs containing samplers", op, ""); } +void TParseContext::storage16BitAssignmentCheck(const TSourceLoc& loc, const TType& type, const char* op) +{ + if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtFloat16)) + requireFloat16Arithmetic(loc, op, "can't use with structs containing float16"); + + if (type.isArray() && type.getBasicType() == EbtFloat16) + requireFloat16Arithmetic(loc, op, "can't use with arrays containing float16"); + + if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtInt16)) + requireInt16Arithmetic(loc, op, "can't use with structs containing int16"); + + if (type.isArray() && type.getBasicType() == EbtInt16) + requireInt16Arithmetic(loc, op, "can't use with arrays containing int16"); + + if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtUint16)) + requireInt16Arithmetic(loc, op, "can't use with structs containing uint16"); + + if (type.isArray() && type.getBasicType() == EbtUint16) + requireInt16Arithmetic(loc, op, "can't use with arrays containing uint16"); + + if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtInt8)) + requireInt8Arithmetic(loc, op, "can't use with structs containing int8"); + + if (type.isArray() && type.getBasicType() == EbtInt8) + requireInt8Arithmetic(loc, op, "can't use with arrays containing int8"); + + if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtUint8)) + requireInt8Arithmetic(loc, op, "can't use with structs containing uint8"); + + if (type.isArray() && type.getBasicType() == EbtUint8) + requireInt8Arithmetic(loc, op, "can't use with arrays containing uint8"); +} + void TParseContext::specializationCheck(const TSourceLoc& loc, const TType& type, const char* op) { if (type.containsSpecializationSize()) @@ -3925,6 +4480,12 @@ void TParseContext::arrayLimitCheck(const TSourceLoc& loc, const TString& identi limitCheck(loc, size, "gl_MaxClipDistances", "gl_ClipDistance array size"); else if (identifier.compare("gl_CullDistance") == 0) limitCheck(loc, size, "gl_MaxCullDistances", "gl_CullDistance array size"); +#ifdef NV_EXTENSIONS + else if (identifier.compare("gl_ClipDistancePerViewNV") == 0) + limitCheck(loc, size, "gl_MaxClipDistances", "gl_ClipDistancePerViewNV array size"); + else if (identifier.compare("gl_CullDistancePerViewNV") == 0) + limitCheck(loc, size, "gl_MaxCullDistances", "gl_CullDistancePerViewNV array size"); +#endif } // See if the provided value is less than or equal to the symbol indicated by limit, @@ -3974,6 +4535,14 @@ void TParseContext::finish() if (profile != EEsProfile && version < 430) requireExtensions(getCurrentLoc(), 1, &E_GL_ARB_compute_shader, "compute shaders"); break; +#ifdef NV_EXTENSIONS + case EShLangTaskNV: + requireExtensions(getCurrentLoc(), 1, &E_GL_NV_mesh_shader, "task shaders"); + break; + case EShLangMeshNV: + requireExtensions(getCurrentLoc(), 1, &E_GL_NV_mesh_shader, "mesh shaders"); + break; +#endif default: break; } @@ -3985,7 +4554,7 @@ void TParseContext::finish() switch (intermediate.getInputPrimitive()) { case ElgPoints: intermediate.setOutputPrimitive(ElgPoints); break; case ElgLines: intermediate.setOutputPrimitive(ElgLineStrip); break; - case ElgTriangles: intermediate.setOutputPrimitive(ElgTriangles); break; + case ElgTriangles: intermediate.setOutputPrimitive(ElgTriangleStrip); break; default: break; } } @@ -4060,44 +4629,57 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi publicType.qualifier.layoutPushConstant = true; return; } - if (language == EShLangGeometry || language == EShLangTessEvaluation) { + if (language == EShLangGeometry || language == EShLangTessEvaluation +#ifdef NV_EXTENSIONS + || language == EShLangMeshNV +#endif + ) { if (id == TQualifier::getGeometryString(ElgTriangles)) { publicType.shaderQualifiers.geometry = ElgTriangles; return; } - if (language == EShLangGeometry) { + if (language == EShLangGeometry +#ifdef NV_EXTENSIONS + || language == EShLangMeshNV +#endif + ) { if (id == TQualifier::getGeometryString(ElgPoints)) { publicType.shaderQualifiers.geometry = ElgPoints; return; } - if (id == TQualifier::getGeometryString(ElgLineStrip)) { - publicType.shaderQualifiers.geometry = ElgLineStrip; - return; - } if (id == TQualifier::getGeometryString(ElgLines)) { publicType.shaderQualifiers.geometry = ElgLines; return; } - if (id == TQualifier::getGeometryString(ElgLinesAdjacency)) { - publicType.shaderQualifiers.geometry = ElgLinesAdjacency; - return; - } - if (id == TQualifier::getGeometryString(ElgTrianglesAdjacency)) { - publicType.shaderQualifiers.geometry = ElgTrianglesAdjacency; - return; - } - if (id == TQualifier::getGeometryString(ElgTriangleStrip)) { - publicType.shaderQualifiers.geometry = ElgTriangleStrip; - return; - } #ifdef NV_EXTENSIONS - if (id == "passthrough") { - requireExtensions(loc, 1, &E_SPV_NV_geometry_shader_passthrough, "geometry shader passthrough"); - publicType.qualifier.layoutPassthrough = true; - intermediate.setGeoPassthroughEXT(); - return; - } + if (language == EShLangGeometry) +#endif + { + if (id == TQualifier::getGeometryString(ElgLineStrip)) { + publicType.shaderQualifiers.geometry = ElgLineStrip; + return; + } + if (id == TQualifier::getGeometryString(ElgLinesAdjacency)) { + publicType.shaderQualifiers.geometry = ElgLinesAdjacency; + return; + } + if (id == TQualifier::getGeometryString(ElgTrianglesAdjacency)) { + publicType.shaderQualifiers.geometry = ElgTrianglesAdjacency; + return; + } + if (id == TQualifier::getGeometryString(ElgTriangleStrip)) { + publicType.shaderQualifiers.geometry = ElgTriangleStrip; + return; + } +#ifdef NV_EXTENSIONS + if (id == "passthrough") { + requireExtensions(loc, 1, &E_SPV_NV_geometry_shader_passthrough, "geometry shader passthrough"); + publicType.qualifier.layoutPassthrough = true; + intermediate.setGeoPassthroughEXT(); + return; + } #endif + } } else { assert(language == EShLangTessEvaluation); @@ -4211,6 +4793,27 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi publicType.qualifier.layoutViewportRelative = true; return; } + } else { + if (language == EShLangRayGenNV || language == EShLangIntersectNV || + language == EShLangAnyHitNV || language == EShLangClosestHitNV || + language == EShLangMissNV || language == EShLangCallableNV) { + if (id == "shaderrecordnv") { + publicType.qualifier.layoutShaderRecordNV = true; + return; + } + } + } + if (language == EShLangCompute) { + if (id.compare(0, 17, "derivative_group_") == 0) { + requireExtensions(loc, 1, &E_GL_NV_compute_shader_derivatives, "compute shader derivatives"); + if (id == "derivative_group_quadsnv") { + publicType.shaderQualifiers.layoutDerivativeGroupQuads = true; + return; + } else if (id == "derivative_group_linearnv") { + publicType.shaderQualifiers.layoutDerivativeGroupLinear = true; + return; + } + } } #else } @@ -4440,10 +5043,39 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi } break; +#ifdef NV_EXTENSIONS + case EShLangMeshNV: + if (id == "max_vertices") { + requireExtensions(loc, 1, &E_GL_NV_mesh_shader, "max_vertices"); + publicType.shaderQualifiers.vertices = value; + if (value > resources.maxMeshOutputVerticesNV) + error(loc, "too large, must be less than gl_MaxMeshOutputVerticesNV", "max_vertices", ""); + return; + } + if (id == "max_primitives") { + requireExtensions(loc, 1, &E_GL_NV_mesh_shader, "max_primitives"); + publicType.shaderQualifiers.primitives = value; + if (value > resources.maxMeshOutputPrimitivesNV) + error(loc, "too large, must be less than gl_MaxMeshOutputPrimitivesNV", "max_primitives", ""); + return; + } + // Fall through + + case EShLangTaskNV: + // Fall through +#endif case EShLangCompute: if (id.compare(0, 11, "local_size_") == 0) { - profileRequires(loc, EEsProfile, 310, 0, "gl_WorkGroupSize"); - profileRequires(loc, ~EEsProfile, 430, E_GL_ARB_compute_shader, "gl_WorkGroupSize"); +#ifdef NV_EXTENSIONS + if (language == EShLangMeshNV || language == EShLangTaskNV) { + requireExtensions(loc, 1, &E_GL_NV_mesh_shader, "gl_WorkGroupSize"); + } + else +#endif + { + profileRequires(loc, EEsProfile, 310, 0, "gl_WorkGroupSize"); + profileRequires(loc, ~EEsProfile, 430, E_GL_ARB_compute_shader, "gl_WorkGroupSize"); + } if (id.size() == 12 && value == 0) { error(loc, "must be at least 1", id.c_str(), ""); return; @@ -4552,6 +5184,10 @@ void TParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifie dst.layoutViewportRelative = true; if (src.layoutSecondaryViewportRelativeOffset != -2048) dst.layoutSecondaryViewportRelativeOffset = src.layoutSecondaryViewportRelativeOffset; + if (src.layoutShaderRecordNV) + dst.layoutShaderRecordNV = true; + if (src.pervertexNV) + dst.pervertexNV = true; #endif } } @@ -4588,9 +5224,10 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb switch (qualifier.storage) { case EvqVaryingIn: case EvqVaryingOut: - if (type.getBasicType() != EbtBlock || - (!(*type.getStruct())[0].type->getQualifier().hasLocation() && - (*type.getStruct())[0].type->getQualifier().builtIn == EbvNone)) + if (!type.getQualifier().isTaskMemory() && + (type.getBasicType() != EbtBlock || + (!(*type.getStruct())[0].type->getQualifier().hasLocation() && + (*type.getStruct())[0].type->getQualifier().builtIn == EbvNone))) error(loc, "SPIR-V requires location for user input/output", "location", ""); break; default: @@ -4616,6 +5253,10 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb error(loc, "cannot specify on a variable declaration", "align", ""); if (qualifier.layoutPushConstant) error(loc, "can only specify on a uniform block", "push_constant", ""); +#ifdef NV_EXTENSIONS + if (qualifier.layoutShaderRecordNV) + error(loc, "can only specify on a buffer block", "shaderRecordNV", ""); +#endif } break; default: @@ -4679,12 +5320,24 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) case EvqVaryingOut: if (type.getBasicType() == EbtBlock) profileRequires(loc, ECoreProfile | ECompatibilityProfile, 440, E_GL_ARB_enhanced_layouts, "location qualifier on in/out block"); +#ifdef NV_EXTENSIONS + if (type.getQualifier().isTaskMemory()) + error(loc, "cannot apply to taskNV in/out blocks", "location", ""); +#endif break; case EvqUniform: case EvqBuffer: if (type.getBasicType() == EbtBlock) error(loc, "cannot apply to uniform or buffer block", "location", ""); break; +#ifdef NV_EXTENSIONS + case EvqPayloadNV: + case EvqPayloadInNV: + case EvqHitAttrNV: + case EvqCallableDataNV: + case EvqCallableDataInNV: + break; +#endif default: error(loc, "can only apply to uniform, buffer, in, or out storage qualifiers", "location", ""); break; @@ -4768,7 +5421,10 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) if (spvVersion.spv > 0) { if (qualifier.isUniformOrBuffer()) { if (type.getBasicType() == EbtBlock && !qualifier.layoutPushConstant && - !qualifier.layoutAttachment) +#ifdef NV_EXTENSIONS + !qualifier.layoutShaderRecordNV && +#endif + !qualifier.layoutAttachment) error(loc, "uniform/buffer blocks require layout(binding=X)", "binding", ""); else if (spvVersion.vulkan > 0 && type.getBasicType() == EbtSampler) error(loc, "sampler/texture/image requires layout(binding=X)", "binding", ""); @@ -4776,6 +5432,14 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) } } + // some things can't have arrays of arrays + if (type.isArrayOfArrays()) { + if (spvVersion.vulkan > 0) { + if (type.isOpaque() || (type.getQualifier().isUniformOrBuffer() && type.getBasicType() == EbtBlock)) + warn(loc, "Generating SPIR-V array-of-arrays, but Vulkan only supports single array level for this resource", "[][]", ""); + } + } + // "The offset qualifier can only be used on block members of blocks..." if (qualifier.hasOffset()) { if (type.getBasicType() == EbtBlock) @@ -4812,6 +5476,11 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) if (qualifier.layoutPushConstant && type.getBasicType() != EbtBlock) error(loc, "can only be used with a block", "push_constant", ""); +#ifdef NV_EXTENSIONS + if (qualifier.layoutShaderRecordNV && type.getBasicType() != EbtBlock) + error(loc, "can only be used with a block", "shaderRecordNV", ""); +#endif + // input attachment if (type.isSubpass()) { if (! qualifier.hasAttachment()) @@ -4922,7 +5591,7 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier } if (qualifier.hasBinding()) { - if (! qualifier.isUniformOrBuffer()) + if (! qualifier.isUniformOrBuffer() && !qualifier.isTaskMemory()) error(loc, "requires uniform or buffer storage qualifier", "binding", ""); } if (qualifier.hasStream()) { @@ -4934,7 +5603,7 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier error(loc, "can only be used on an output", "xfb layout qualifier", ""); } if (qualifier.hasUniformLayout()) { - if (! qualifier.isUniformOrBuffer()) { + if (! qualifier.isUniformOrBuffer() && !qualifier.isTaskMemory()) { if (qualifier.hasMatrix() || qualifier.hasPacking()) error(loc, "matrix or packing qualifiers can only be used on a uniform or buffer", "layout", ""); if (qualifier.hasOffset() || qualifier.hasAlign()) @@ -4947,6 +5616,20 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier if (qualifier.hasSet()) error(loc, "cannot be used with push_constant", "set", ""); } +#ifdef NV_EXTENSIONS + if (qualifier.layoutShaderRecordNV) { + if (qualifier.storage != EvqBuffer) + error(loc, "can only be used with a buffer", "shaderRecordNV", ""); + if (qualifier.hasBinding()) + error(loc, "cannot be used with shaderRecordNV", "binding", ""); + if (qualifier.hasSet()) + error(loc, "cannot be used with shaderRecordNV", "set", ""); + + } + if (qualifier.storage == EvqHitAttrNV && qualifier.hasLayout()) { + error(loc, "cannot apply layout qualifiers to hitAttributeNV variable", "hitAttributeNV", ""); + } +#endif } // For places that can't have shader-level layout qualifiers @@ -4975,13 +5658,25 @@ void TParseContext::checkNoShaderLayouts(const TSourceLoc& loc, const TShaderQua error(loc, message, "local_size id", ""); } if (shaderQualifiers.vertices != TQualifier::layoutNotSet) { - if (language == EShLangGeometry) + if (language == EShLangGeometry +#ifdef NV_EXTENSIONS + || language == EShLangMeshNV +#endif + ) error(loc, message, "max_vertices", ""); else if (language == EShLangTessControl) error(loc, message, "vertices", ""); else assert(0); } +#ifdef NV_EXTENSIONS + if (shaderQualifiers.primitives != TQualifier::layoutNotSet) { + if (language == EShLangMeshNV) + error(loc, message, "max_primitives", ""); + else + assert(0); + } +#endif if (shaderQualifiers.blendEquation) error(loc, message, "blend equation", ""); if (shaderQualifiers.numViews != TQualifier::layoutNotSet) @@ -5364,6 +6059,18 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden samplerCheck(loc, type, identifier, initializer); atomicUintCheck(loc, type, identifier); transparentOpaqueCheck(loc, type, identifier); +#ifdef NV_EXTENSIONS + accStructNVCheck(loc, type, identifier); +#endif + + if (type.getQualifier().storage != EvqUniform && type.getQualifier().storage != EvqBuffer) { + if (type.containsBasicType(EbtFloat16)) + requireFloat16Arithmetic(loc, "qualifier", "float16 types can only be in uniform block or buffer storage"); + if (type.contains16BitInt()) + requireInt16Arithmetic(loc, "qualifier", "(u)int16 types can only be in uniform block or buffer storage"); + if (type.contains8BitInt()) + requireInt8Arithmetic(loc, "qualifier", "(u)int8 types can only be in uniform block or buffer storage"); + } if (identifier != "gl_FragCoord" && (publicType.shaderQualifiers.originUpperLeft || publicType.shaderQualifiers.pixelCenterInteger)) error(loc, "can only apply origin_upper_left and pixel_center_origin to gl_FragCoord", "layout qualifier", ""); @@ -5380,7 +6087,7 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden // Declare the variable if (type.isArray()) { // Check that implicit sizing is only where allowed. - arraySizesCheck(loc, type.getQualifier(), type.getArraySizes(), initializer != nullptr, false); + arraySizesCheck(loc, type.getQualifier(), type.getArraySizes(), initializer, false); if (! arrayQualifierError(loc, type.getQualifier()) && ! arrayError(loc, type)) declareArray(loc, identifier, type, symbol); @@ -5417,6 +6124,11 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden // fix up fixOffset(loc, *symbol); + if (symbol->getType().getBasicType() == EbtStruct) { + fixXfbOffsets(symbol->getWritableType().getQualifier(), + *(symbol->getWritableType().getWritableStruct())); + } + return initNode; } @@ -5716,8 +6428,14 @@ TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode* // Combined texture-sampler constructors are completely semantic checked // in constructorTextureSamplerError() - if (op == EOpConstructTextureSampler) + if (op == EOpConstructTextureSampler) { + if (aggrNode->getSequence()[1]->getAsTyped()->getType().getSampler().shadow) { + // Transfer depth into the texture (SPIR-V image) type, as a hint + // for tools to know this texture/image is a depth image. + aggrNode->getSequence()[0]->getAsTyped()->getWritableType().getSampler().shadow = true; + } return intermediate.setAggregateOperator(aggrNode, op, type, loc); + } TTypeList::const_iterator memberTypes; if (op == EOpConstructStruct) @@ -5982,7 +6700,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con blockStageIoCheck(loc, currentBlockQualifier); blockQualifierCheck(loc, currentBlockQualifier, instanceName != nullptr); if (arraySizes != nullptr) { - arraySizesCheck(loc, currentBlockQualifier, arraySizes, false, false); + arraySizesCheck(loc, currentBlockQualifier, arraySizes, nullptr, false); arrayOfArrayVersionCheck(loc, arraySizes); if (arraySizes->getNumDims() > 1) requireProfile(loc, ~EEsProfile, "array-of-array of block"); @@ -5997,10 +6715,18 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con if (memberQualifier.storage != EvqTemporary && memberQualifier.storage != EvqGlobal && memberQualifier.storage != currentBlockQualifier.storage) error(memberLoc, "member storage qualifier cannot contradict block storage qualifier", memberType.getFieldName().c_str(), ""); memberQualifier.storage = currentBlockQualifier.storage; +#ifdef NV_EXTENSIONS + if (currentBlockQualifier.perPrimitiveNV) + memberQualifier.perPrimitiveNV = currentBlockQualifier.perPrimitiveNV; + if (currentBlockQualifier.perViewNV) + memberQualifier.perViewNV = currentBlockQualifier.perViewNV; + if (currentBlockQualifier.perTaskNV) + memberQualifier.perTaskNV = currentBlockQualifier.perTaskNV; +#endif if ((currentBlockQualifier.storage == EvqUniform || currentBlockQualifier.storage == EvqBuffer) && (memberQualifier.isInterpolation() || memberQualifier.isAuxiliary())) error(memberLoc, "member of uniform or buffer block cannot have an auxiliary or interpolation qualifier", memberType.getFieldName().c_str(), ""); if (memberType.isArray()) - arraySizesCheck(memberLoc, currentBlockQualifier, memberType.getArraySizes(), false, member == typeList.size() - 1); + arraySizesCheck(memberLoc, currentBlockQualifier, memberType.getArraySizes(), nullptr, member == typeList.size() - 1); if (memberQualifier.hasOffset()) { if (spvVersion.spv == 0) { requireProfile(memberLoc, ~EEsProfile, "offset on block member"); @@ -6039,9 +6765,19 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con // Special case for "push_constant uniform", which has a default of std430, // contrary to normal uniform defaults, and can't have a default tracked for it. - if (currentBlockQualifier.layoutPushConstant && !currentBlockQualifier.hasPacking()) + if ((currentBlockQualifier.layoutPushConstant && !currentBlockQualifier.hasPacking()) +#ifdef NV_EXTENSIONS + || (currentBlockQualifier.layoutShaderRecordNV && !currentBlockQualifier.hasPacking()) +#endif + ) currentBlockQualifier.layoutPacking = ElpStd430; +#ifdef NV_EXTENSIONS + // Special case for "taskNV in/out", which has a default of std430, + if (currentBlockQualifier.perTaskNV && !currentBlockQualifier.hasPacking()) + currentBlockQualifier.layoutPacking = ElpStd430; +#endif + // fix and check for member layout qualifiers mergeObjectLayoutQualifiers(defaultQualification, currentBlockQualifier, true); @@ -6056,6 +6792,9 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con bool memberWithLocation = false; bool memberWithoutLocation = false; +#ifdef NV_EXTENSIONS + bool memberWithPerViewQualifier = false; +#endif for (unsigned int member = 0; member < typeList.size(); ++member) { TQualifier& memberQualifier = typeList[member].type->getQualifier(); const TSourceLoc& memberLoc = typeList[member].loc; @@ -6099,6 +6838,12 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con error(memberLoc, "can only be used with std140 or std430 layout packing", "offset/align", ""); } +#ifdef NV_EXTENSIONS + if (memberQualifier.isPerView()) { + memberWithPerViewQualifier = true; + } +#endif + TQualifier newMemberQualification = defaultQualification; mergeQualifiers(memberLoc, newMemberQualification, memberQualifier, false); memberQualifier = newMemberQualification; @@ -6108,11 +6853,19 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con // Process the members fixBlockLocations(loc, currentBlockQualifier, typeList, memberWithLocation, memberWithoutLocation); - fixBlockXfbOffsets(currentBlockQualifier, typeList); + fixXfbOffsets(currentBlockQualifier, typeList); fixBlockUniformOffsets(currentBlockQualifier, typeList); for (unsigned int member = 0; member < typeList.size(); ++member) layoutTypeCheck(typeList[member].loc, *typeList[member].type); +#ifdef NV_EXTENSIONS + if (memberWithPerViewQualifier) { + for (unsigned int member = 0; member < typeList.size(); ++member) { + resizeMeshViewDimension(typeList[member].loc, *typeList[member].type); + } + } +#endif + // reverse merge, so that currentBlockQualifier now has all layout information // (can't use defaultQualification directly, it's missing other non-layout-default-class qualifiers) mergeObjectLayoutQualifiers(currentBlockQualifier, defaultQualification, true); @@ -6176,7 +6929,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con // fix up if (isIoResizeArray(blockType)) { ioArraySymbolResizeList.push_back(&variable); - checkIoArraysConsistency(loc, true); + checkIoArraysConsistency(loc, true, blockType.getQualifier().isPerPrimitive()); } else fixIoArraySize(loc, variable.getWritableType()); @@ -6204,17 +6957,65 @@ void TParseContext::blockStageIoCheck(const TSourceLoc& loc, const TQualifier& q profileRequires(loc, ~EEsProfile, 150, E_GL_ARB_separate_shader_objects, "input block"); // It is a compile-time error to have an input block in a vertex shader or an output block in a fragment shader // "Compute shaders do not permit user-defined input variables..." - requireStage(loc, (EShLanguageMask)(EShLangTessControlMask|EShLangTessEvaluationMask|EShLangGeometryMask|EShLangFragmentMask), "input block"); - if (language == EShLangFragment) + requireStage(loc, (EShLanguageMask)(EShLangTessControlMask|EShLangTessEvaluationMask|EShLangGeometryMask|EShLangFragmentMask +#ifdef NV_EXTENSIONS + |EShLangMeshNVMask +#endif + ), "input block"); + if (language == EShLangFragment) { profileRequires(loc, EEsProfile, 320, Num_AEP_shader_io_blocks, AEP_shader_io_blocks, "fragment input block"); + } +#ifdef NV_EXTENSIONS + else if (language == EShLangMeshNV && ! qualifier.isTaskMemory()) { + error(loc, "input blocks cannot be used in a mesh shader", "out", ""); + } +#endif break; case EvqVaryingOut: profileRequires(loc, ~EEsProfile, 150, E_GL_ARB_separate_shader_objects, "output block"); - requireStage(loc, (EShLanguageMask)(EShLangVertexMask|EShLangTessControlMask|EShLangTessEvaluationMask|EShLangGeometryMask), "output block"); + requireStage(loc, (EShLanguageMask)(EShLangVertexMask|EShLangTessControlMask|EShLangTessEvaluationMask|EShLangGeometryMask +#ifdef NV_EXTENSIONS + |EShLangMeshNVMask|EShLangTaskNVMask +#endif + ), "output block"); // ES 310 can have a block before shader_io is turned on, so skip this test for built-ins - if (language == EShLangVertex && ! parsingBuiltins) + if (language == EShLangVertex && ! parsingBuiltins) { profileRequires(loc, EEsProfile, 320, Num_AEP_shader_io_blocks, AEP_shader_io_blocks, "vertex output block"); + } +#ifdef NV_EXTENSIONS + else if (language == EShLangMeshNV && qualifier.isTaskMemory()) { + error(loc, "can only use on input blocks in mesh shader", "taskNV", ""); + } + else if (language == EShLangTaskNV && ! qualifier.isTaskMemory()) { + error(loc, "output blocks cannot be used in a task shader", "out", ""); + } +#endif + break; +#ifdef NV_EXTENSIONS + case EvqPayloadNV: + profileRequires(loc, ~EEsProfile, 460, E_GL_NV_ray_tracing, "rayPayloadNV block"); + requireStage(loc, (EShLanguageMask)(EShLangRayGenNVMask | EShLangAnyHitNVMask | EShLangClosestHitNVMask | EShLangMissNVMask), + "rayPayloadNV block"); + break; + case EvqPayloadInNV: + profileRequires(loc, ~EEsProfile, 460, E_GL_NV_ray_tracing, "rayPayloadInNV block"); + requireStage(loc, (EShLanguageMask)(EShLangAnyHitNVMask | EShLangClosestHitNVMask | EShLangMissNVMask), + "rayPayloadInNV block"); + break; + case EvqHitAttrNV: + profileRequires(loc, ~EEsProfile, 460, E_GL_NV_ray_tracing, "hitAttributeNV block"); + requireStage(loc, (EShLanguageMask)(EShLangIntersectNVMask | EShLangAnyHitNVMask | EShLangClosestHitNVMask), "hitAttributeNV block"); break; + case EvqCallableDataNV: + profileRequires(loc, ~EEsProfile, 460, E_GL_NV_ray_tracing, "callableDataNV block"); + requireStage(loc, (EShLanguageMask)(EShLangRayGenNVMask | EShLangClosestHitNVMask | EShLangMissNVMask | EShLangCallableNVMask), + "callableDataNV block"); + break; + case EvqCallableDataInNV: + profileRequires(loc, ~EEsProfile, 460, E_GL_NV_ray_tracing, "callableDataInNV block"); + requireStage(loc, (EShLanguageMask)(EShLangCallableNVMask), "callableDataInNV block"); + break; +#endif default: error(loc, "only uniform, buffer, in, or out blocks are supported", blockName->c_str(), ""); break; @@ -6251,6 +7052,12 @@ void TParseContext::blockQualifierCheck(const TSourceLoc& loc, const TQualifier& error(loc, "cannot use invariant qualifier on an interface block", "invariant", ""); if (qualifier.layoutPushConstant) intermediate.addPushConstantCount(); +#ifdef NV_EXTENSIONS + if (qualifier.layoutShaderRecordNV) + intermediate.addShaderRecordNVCount(); + if (qualifier.perTaskNV) + intermediate.addTaskNVCount(); +#endif } // @@ -6297,7 +7104,7 @@ void TParseContext::fixBlockLocations(const TSourceLoc& loc, TQualifier& qualifi } } -void TParseContext::fixBlockXfbOffsets(TQualifier& qualifier, TTypeList& typeList) +void TParseContext::fixXfbOffsets(TQualifier& qualifier, TTypeList& typeList) { // "If a block is qualified with xfb_offset, all its // members are assigned transform feedback buffer offsets. If a block is not qualified with xfb_offset, any @@ -6336,7 +7143,7 @@ void TParseContext::fixBlockXfbOffsets(TQualifier& qualifier, TTypeList& typeLis // void TParseContext::fixBlockUniformOffsets(TQualifier& qualifier, TTypeList& typeList) { - if (! qualifier.isUniformOrBuffer()) + if (!qualifier.isUniformOrBuffer() && !qualifier.isTaskMemory()) return; if (qualifier.layoutPacking != ElpStd140 && qualifier.layoutPacking != ElpStd430) return; @@ -6468,7 +7275,11 @@ void TParseContext::invariantCheck(const TSourceLoc& loc, const TQualifier& qual void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, const TPublicType& publicType) { if (publicType.shaderQualifiers.vertices != TQualifier::layoutNotSet) { +#ifdef NV_EXTENSIONS + assert(language == EShLangTessControl || language == EShLangGeometry || language == EShLangMeshNV); +#else assert(language == EShLangTessControl || language == EShLangGeometry); +#endif const char* id = (language == EShLangTessControl) ? "vertices" : "max_vertices"; if (publicType.qualifier.storage != EvqVaryingOut) @@ -6479,6 +7290,17 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con if (language == EShLangTessControl) checkIoArraysConsistency(loc); } +#ifdef NV_EXTENSIONS + if (publicType.shaderQualifiers.primitives != TQualifier::layoutNotSet) { + assert(language == EShLangMeshNV); + const char* id = "max_primitives"; + + if (publicType.qualifier.storage != EvqVaryingOut) + error(loc, "can only apply to 'out'", id, ""); + if (! intermediate.setPrimitives(publicType.shaderQualifiers.primitives)) + error(loc, "cannot change previously set layout value", id, ""); + } +#endif if (publicType.shaderQualifiers.invocations != TQualifier::layoutNotSet) { if (publicType.qualifier.storage != EvqVaryingIn) error(loc, "can only apply to 'in'", "invocations", ""); @@ -6495,6 +7317,12 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con case ElgTrianglesAdjacency: case ElgQuads: case ElgIsolines: +#ifdef NV_EXTENSIONS + if (language == EShLangMeshNV) { + error(loc, "cannot apply to input", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), ""); + break; + } +#endif if (intermediate.setInputPrimitive(publicType.shaderQualifiers.geometry)) { if (language == EShLangGeometry) checkIoArraysConsistency(loc); @@ -6506,6 +7334,15 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con } } else if (publicType.qualifier.storage == EvqVaryingOut) { switch (publicType.shaderQualifiers.geometry) { +#ifdef NV_EXTENSIONS + case ElgLines: + case ElgTriangles: + if (language != EShLangMeshNV) { + error(loc, "cannot apply to 'out'", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), ""); + break; + } +#endif + // Fall through case ElgPoints: case ElgLineStrip: case ElgTriangleStrip: @@ -6545,14 +7382,41 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con error(loc, "cannot change previously set size", "local_size", ""); else { int max = 0; - switch (i) { - case 0: max = resources.maxComputeWorkGroupSizeX; break; - case 1: max = resources.maxComputeWorkGroupSizeY; break; - case 2: max = resources.maxComputeWorkGroupSizeZ; break; - default: break; + if (language == EShLangCompute) { + switch (i) { + case 0: max = resources.maxComputeWorkGroupSizeX; break; + case 1: max = resources.maxComputeWorkGroupSizeY; break; + case 2: max = resources.maxComputeWorkGroupSizeZ; break; + default: break; + } + if (intermediate.getLocalSize(i) > (unsigned int)max) + error(loc, "too large; see gl_MaxComputeWorkGroupSize", "local_size", ""); + } +#ifdef NV_EXTENSIONS + else if (language == EShLangMeshNV) { + switch (i) { + case 0: max = resources.maxMeshWorkGroupSizeX_NV; break; + case 1: max = resources.maxMeshWorkGroupSizeY_NV; break; + case 2: max = resources.maxMeshWorkGroupSizeZ_NV; break; + default: break; + } + if (intermediate.getLocalSize(i) > (unsigned int)max) + error(loc, "too large; see gl_MaxMeshWorkGroupSizeNV", "local_size", ""); + } + else if (language == EShLangTaskNV) { + switch (i) { + case 0: max = resources.maxTaskWorkGroupSizeX_NV; break; + case 1: max = resources.maxTaskWorkGroupSizeY_NV; break; + case 2: max = resources.maxTaskWorkGroupSizeZ_NV; break; + default: break; + } + if (intermediate.getLocalSize(i) > (unsigned int)max) + error(loc, "too large; see gl_MaxTaskWorkGroupSizeNV", "local_size", ""); + } +#endif + else { + assert(0); } - if (intermediate.getLocalSize(i) > (unsigned int)max) - error(loc, "too large; see gl_MaxComputeWorkGroupSize", "local_size", ""); // Fix the existing constant gl_WorkGroupSize with this new information. TVariable* workGroupSize = getEditableVariable("gl_WorkGroupSize"); @@ -6591,6 +7455,36 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con error(loc, "can only apply to 'out'", "blend equation", ""); } +#ifdef NV_EXTENSIONS + if (publicType.shaderQualifiers.layoutDerivativeGroupQuads && + publicType.shaderQualifiers.layoutDerivativeGroupLinear) { + error(loc, "cannot be both specified", "derivative_group_quadsNV and derivative_group_linearNV", ""); + } + + if (publicType.shaderQualifiers.layoutDerivativeGroupQuads) { + if (publicType.qualifier.storage == EvqVaryingIn) { + if ((intermediate.getLocalSize(0) & 1) || + (intermediate.getLocalSize(1) & 1)) + error(loc, "requires local_size_x and local_size_y to be multiple of two", "derivative_group_quadsNV", ""); + else + intermediate.setLayoutDerivativeMode(LayoutDerivativeGroupQuads); + } + else + error(loc, "can only apply to 'in'", "derivative_group_quadsNV", ""); + } + if (publicType.shaderQualifiers.layoutDerivativeGroupLinear) { + if (publicType.qualifier.storage == EvqVaryingIn) { + if((intermediate.getLocalSize(0) * + intermediate.getLocalSize(1) * + intermediate.getLocalSize(2)) % 4 != 0) + error(loc, "requires total group size to be multiple of four", "derivative_group_linearNV", ""); + else + intermediate.setLayoutDerivativeMode(LayoutDerivativeGroupLinear); + } + else + error(loc, "can only apply to 'in'", "derivative_group_linearNV", ""); + } +#endif const TQualifier& qualifier = publicType.qualifier; if (qualifier.isAuxiliary() || @@ -6646,6 +7540,10 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con error(loc, "cannot declare a default, can only be used on a block", "push_constant", ""); if (qualifier.hasSpecConstantId()) error(loc, "cannot declare a default, can only be used on a scalar", "constant_id", ""); +#ifdef NV_EXTENSIONS + if (qualifier.layoutShaderRecordNV) + error(loc, "cannot declare a default, can only be used on a block", "shaderRecordNV", ""); +#endif } // diff --git a/deps/glslang/glslang/MachineIndependent/ParseHelper.h b/deps/glslang/glslang/MachineIndependent/ParseHelper.h index 21779c71..14421a26 100644 --- a/deps/glslang/glslang/MachineIndependent/ParseHelper.h +++ b/deps/glslang/glslang/MachineIndependent/ParseHelper.h @@ -298,8 +298,8 @@ class TParseContext : public TParseContextBase { void fixIoArraySize(const TSourceLoc&, TType&); void ioArrayCheck(const TSourceLoc&, const TType&, const TString& identifier); void handleIoResizeArrayAccess(const TSourceLoc&, TIntermTyped* base); - void checkIoArraysConsistency(const TSourceLoc&, bool tailOnly = false); - int getIoArrayImplicitSize() const; + void checkIoArraysConsistency(const TSourceLoc&, bool tailOnly = false, bool isPerPrimitive = false); + int getIoArrayImplicitSize(bool isPerPrimitive = false) const; void checkIoArrayConsistency(const TSourceLoc&, int requiredSize, const char* feature, TType&, const TString&); TIntermTyped* handleBinaryMath(const TSourceLoc&, const char* str, TOperator op, TIntermTyped* left, TIntermTyped* right); @@ -323,6 +323,7 @@ class TParseContext : public TParseContextBase { TFunction* handleConstructorCall(const TSourceLoc&, const TPublicType&); void handlePrecisionQualifier(const TSourceLoc&, TQualifier&, TPrecisionQualifier); void checkPrecisionQualifier(const TSourceLoc&, TPrecisionQualifier); + void memorySemanticsCheck(const TSourceLoc&, const TFunction&, const TIntermOperator& callNode); void assignError(const TSourceLoc&, const char* op, TString left, TString right); void unaryOpError(const TSourceLoc&, const char* op, TString operand); @@ -340,13 +341,14 @@ class TParseContext : public TParseContextBase { bool arrayError(const TSourceLoc&, const TType&); void arraySizeRequiredCheck(const TSourceLoc&, const TArraySizes&); void structArrayCheck(const TSourceLoc&, const TType& structure); - void arraySizesCheck(const TSourceLoc&, const TQualifier&, TArraySizes*, bool initializer, bool lastMember); + void arraySizesCheck(const TSourceLoc&, const TQualifier&, TArraySizes*, const TIntermTyped* initializer, bool lastMember); void arrayOfArrayVersionCheck(const TSourceLoc&, const TArraySizes*); bool voidErrorCheck(const TSourceLoc&, const TString&, TBasicType); void boolCheck(const TSourceLoc&, const TIntermTyped*); void boolCheck(const TSourceLoc&, const TPublicType&); void samplerCheck(const TSourceLoc&, const TType&, const TString& identifier, TIntermTyped* initializer); void atomicUintCheck(const TSourceLoc&, const TType&, const TString& identifier); + void accStructNVCheck(const TSourceLoc & loc, const TType & type, const TString & identifier); void transparentOpaqueCheck(const TSourceLoc&, const TType&, const TString& identifier); void memberQualifierCheck(glslang::TPublicType&); void globalQualifierFixCheck(const TSourceLoc&, TQualifier&); @@ -367,6 +369,7 @@ class TParseContext : public TParseContextBase { void nestedStructCheck(const TSourceLoc&); void arrayObjectCheck(const TSourceLoc&, const TType&, const char* op); void opaqueCheck(const TSourceLoc&, const TType&, const char* op); + void storage16BitAssignmentCheck(const TSourceLoc&, const TType&, const char* op); void specializationCheck(const TSourceLoc&, const TType&, const char* op); void structTypeCheck(const TSourceLoc&, TPublicType&); void inductiveLoopCheck(const TSourceLoc&, TIntermNode* init, TIntermLoop* loop); @@ -400,7 +403,7 @@ class TParseContext : public TParseContextBase { void blockStageIoCheck(const TSourceLoc&, const TQualifier&); void blockQualifierCheck(const TSourceLoc&, const TQualifier&, bool instanceName); void fixBlockLocations(const TSourceLoc&, TQualifier&, TTypeList&, bool memberWithLocation, bool memberWithoutLocation); - void fixBlockXfbOffsets(TQualifier&, TTypeList&); + void fixXfbOffsets(TQualifier&, TTypeList&); void fixBlockUniformOffsets(TQualifier&, TTypeList&); void addQualifierToExisting(const TSourceLoc&, TQualifier, const TString& identifier); void addQualifierToExisting(const TSourceLoc&, TQualifier, TIdentifierList&); @@ -421,6 +424,8 @@ class TParseContext : public TParseContextBase { // Determine loop control from attributes void handleLoopAttributes(const TAttributes& attributes, TIntermNode*); + void resizeMeshViewDimension(const TSourceLoc&, TType&); + protected: void nonInitConstCheck(const TSourceLoc&, TString& identifier, TType& type); void inheritGlobalDefaults(TQualifier& dst) const; diff --git a/deps/glslang/glslang/MachineIndependent/Scan.cpp b/deps/glslang/glslang/MachineIndependent/Scan.cpp index 7232baeb..4d2db385 100644 --- a/deps/glslang/glslang/MachineIndependent/Scan.cpp +++ b/deps/glslang/glslang/MachineIndependent/Scan.cpp @@ -380,6 +380,11 @@ void TScanContext::fillInKeywordMap() (*KeywordMap)["varying"] = VARYING; (*KeywordMap)["buffer"] = BUFFER; (*KeywordMap)["coherent"] = COHERENT; + (*KeywordMap)["devicecoherent"] = DEVICECOHERENT; + (*KeywordMap)["queuefamilycoherent"] = QUEUEFAMILYCOHERENT; + (*KeywordMap)["workgroupcoherent"] = WORKGROUPCOHERENT; + (*KeywordMap)["subgroupcoherent"] = SUBGROUPCOHERENT; + (*KeywordMap)["nonprivate"] = NONPRIVATE; (*KeywordMap)["restrict"] = RESTRICT; (*KeywordMap)["readonly"] = READONLY; (*KeywordMap)["writeonly"] = WRITEONLY; @@ -683,15 +688,30 @@ void TScanContext::fillInKeywordMap() (*KeywordMap)["smooth"] = SMOOTH; (*KeywordMap)["flat"] = FLAT; #ifdef AMD_EXTENSIONS - (*KeywordMap)["__explicitInterpAMD"] = __EXPLICITINTERPAMD; + (*KeywordMap)["__explicitInterpAMD"] = EXPLICITINTERPAMD; #endif (*KeywordMap)["centroid"] = CENTROID; +#ifdef NV_EXTENSIONS + (*KeywordMap)["pervertexNV"] = PERVERTEXNV; +#endif (*KeywordMap)["precise"] = PRECISE; (*KeywordMap)["invariant"] = INVARIANT; (*KeywordMap)["packed"] = PACKED; (*KeywordMap)["resource"] = RESOURCE; (*KeywordMap)["superp"] = SUPERP; +#ifdef NV_EXTENSIONS + (*KeywordMap)["rayPayloadNV"] = PAYLOADNV; + (*KeywordMap)["rayPayloadInNV"] = PAYLOADINNV; + (*KeywordMap)["hitAttributeNV"] = HITATTRNV; + (*KeywordMap)["callableDataNV"] = CALLDATANV; + (*KeywordMap)["callableDataInNV"] = CALLDATAINNV; + (*KeywordMap)["accelerationStructureNV"] = ACCSTRUCTNV; + (*KeywordMap)["perprimitiveNV"] = PERPRIMITIVENV; + (*KeywordMap)["perviewNV"] = PERVIEWNV; + (*KeywordMap)["taskNV"] = PERTASKNV; +#endif + ReservedSet = new std::unordered_set; ReservedSet->insert("common"); @@ -778,7 +798,7 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token) case '?': return QUESTION; case '[': return LEFT_BRACKET; case ']': return RIGHT_BRACKET; - case '{': return LEFT_BRACE; + case '{': afterStruct = false; return LEFT_BRACE; case '}': return RIGHT_BRACE; case '\\': parseContext.error(loc, "illegal use of escape character", "\\", ""); @@ -861,7 +881,6 @@ int TScanContext::tokenizeIdentifier() case IN: case OUT: case INOUT: - case STRUCT: case BREAK: case CONTINUE: case DO: @@ -874,6 +893,10 @@ int TScanContext::tokenizeIdentifier() case CASE: return keyword; + case STRUCT: + afterStruct = true; + return keyword; + case NONUNIFORM: if (parseContext.extensionTurnedOn(E_GL_EXT_nonuniform_qualifier)) return keyword; @@ -927,6 +950,20 @@ int TScanContext::tokenizeIdentifier() return identifierOrType(); return keyword; +#ifdef NV_EXTENSIONS + case PAYLOADNV: + case PAYLOADINNV: + case HITATTRNV: + case CALLDATANV: + case CALLDATAINNV: + case ACCSTRUCTNV: + if (parseContext.symbolTable.atBuiltInLevel() || + (parseContext.profile != EEsProfile && parseContext.version >= 460 + && parseContext.extensionTurnedOn(E_GL_NV_ray_tracing))) + return keyword; + return identifierOrType(); +#endif + case ATOMIC_UINT: if ((parseContext.profile == EEsProfile && parseContext.version >= 310) || parseContext.extensionTurnedOn(E_GL_ARB_shader_atomic_counters)) @@ -934,6 +971,11 @@ int TScanContext::tokenizeIdentifier() return es30ReservedFromGLSL(420); case COHERENT: + case DEVICECOHERENT: + case QUEUEFAMILYCOHERENT: + case WORKGROUPCOHERENT: + case SUBGROUPCOHERENT: + case NONPRIVATE: case RESTRICT: case READONLY: case WRITEONLY: @@ -1107,6 +1149,7 @@ int TScanContext::tokenizeIdentifier() afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || ((parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_8bit_storage) || parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int8)) && parseContext.profile != EEsProfile && parseContext.version >= 450)) return keyword; @@ -1127,6 +1170,7 @@ int TScanContext::tokenizeIdentifier() #ifdef AMD_EXTENSIONS parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_int16) || #endif + parseContext.extensionTurnedOn(E_GL_EXT_shader_16bit_storage) || parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int16)))) return keyword; @@ -1198,6 +1242,20 @@ int TScanContext::tokenizeIdentifier() case F16VEC2: case F16VEC3: case F16VEC4: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + (parseContext.profile != EEsProfile && parseContext.version >= 450 && + ( +#ifdef AMD_EXTENSIONS + parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float) || +#endif + parseContext.extensionTurnedOn(E_GL_EXT_shader_16bit_storage) || + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float16)))) + return keyword; + + return identifierOrType(); + case F16MAT2: case F16MAT3: case F16MAT4: @@ -1471,13 +1529,22 @@ int TScanContext::tokenizeIdentifier() return keyword; #ifdef AMD_EXTENSIONS - case __EXPLICITINTERPAMD: + case EXPLICITINTERPAMD: if (parseContext.profile != EEsProfile && parseContext.version >= 450 && parseContext.extensionTurnedOn(E_GL_AMD_shader_explicit_vertex_parameter)) return keyword; return identifierOrType(); #endif +#ifdef NV_EXTENSIONS + case PERVERTEXNV: + if (((parseContext.profile != EEsProfile && parseContext.version >= 450) || + (parseContext.profile == EEsProfile && parseContext.version >= 320)) && + parseContext.extensionTurnedOn(E_GL_NV_fragment_shader_barycentric)) + return keyword; + return identifierOrType(); +#endif + case FLAT: if (parseContext.profile == EEsProfile && parseContext.version < 300) reservedWord(); @@ -1524,6 +1591,17 @@ int TScanContext::tokenizeIdentifier() return identifierOrReserved(reserved); } +#ifdef NV_EXTENSIONS + case PERPRIMITIVENV: + case PERVIEWNV: + case PERTASKNV: + if ((parseContext.profile != EEsProfile && parseContext.version >= 450) || + (parseContext.profile == EEsProfile && parseContext.version >= 320) || + parseContext.extensionTurnedOn(E_GL_NV_mesh_shader)) + return keyword; + return identifierOrType(); +#endif + default: parseContext.infoSink.info.message(EPrefixInternalError, "Unknown glslang keyword", loc); return 0; @@ -1537,7 +1615,7 @@ int TScanContext::identifierOrType() return IDENTIFIER; parserToken->sType.lex.symbol = parseContext.symbolTable.find(*parserToken->sType.lex.string); - if (afterType == false && parserToken->sType.lex.symbol) { + if ((afterType == false && afterStruct == false) && parserToken->sType.lex.symbol != nullptr) { if (const TVariable* variable = parserToken->sType.lex.symbol->getAsVariable()) { if (variable->isUserType()) { afterType = true; diff --git a/deps/glslang/glslang/MachineIndependent/ScanContext.h b/deps/glslang/glslang/MachineIndependent/ScanContext.h index 608ae067..0cc7ea0a 100644 --- a/deps/glslang/glslang/MachineIndependent/ScanContext.h +++ b/deps/glslang/glslang/MachineIndependent/ScanContext.h @@ -50,7 +50,10 @@ class TParserToken; class TScanContext { public: - explicit TScanContext(TParseContextBase& pc) : parseContext(pc), afterType(false), field(false) { } + explicit TScanContext(TParseContextBase& pc) : + parseContext(pc), + afterType(false), afterStruct(false), + field(false) { } virtual ~TScanContext() { } static void fillInKeywordMap(); @@ -76,6 +79,7 @@ class TScanContext { TParseContextBase& parseContext; bool afterType; // true if we've recognized a type, so can only be looking for an identifier + bool afterStruct; // true if we've recognized the STRUCT keyword, so can only be looking for an identifier bool field; // true if we're on a field, right after a '.' TSourceLoc loc; TParserToken* parserToken; diff --git a/deps/glslang/glslang/MachineIndependent/ShaderLang.cpp b/deps/glslang/glslang/MachineIndependent/ShaderLang.cpp index 4f39f345..3c847d23 100644 --- a/deps/glslang/glslang/MachineIndependent/ShaderLang.cpp +++ b/deps/glslang/glslang/MachineIndependent/ShaderLang.cpp @@ -67,6 +67,11 @@ #include "iomapper.h" #include "Initialize.h" +// TODO: this really shouldn't be here, it is only because of the trial addition +// of printing pre-processed tokens, which requires knowing the string literal +// token to print ", but none of that seems appropriate for this file. +#include "preprocessor/PpTokens.h" + namespace { // anonymous namespace for file-local functions and symbols // Total number of successful initializers of glslang: a refcount @@ -342,6 +347,36 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangCompute, source, infoSink, commonTable, symbolTables); +#ifdef NV_EXTENSIONS + // check for ray tracing stages + if (profile != EEsProfile && version >= 450) { + InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangRayGenNV, source, + infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangIntersectNV, source, + infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangAnyHitNV, source, + infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangClosestHitNV, source, + infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangMissNV, source, + infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangCallableNV, source, + infoSink, commonTable, symbolTables); + } + + // check for mesh + if ((profile != EEsProfile && version >= 450) || + (profile == EEsProfile && version >= 320)) + InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangMeshNV, source, + infoSink, commonTable, symbolTables); + + // check for task + if ((profile != EEsProfile && version >= 450) || + (profile == EEsProfile && version >= 320)) + InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangTaskNV, source, + infoSink, commonTable, symbolTables); +#endif + return true; } @@ -565,6 +600,28 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo version = profile == EEsProfile ? 310 : 420; } break; +#ifdef NV_EXTENSIONS + case EShLangRayGenNV: + case EShLangIntersectNV: + case EShLangAnyHitNV: + case EShLangClosestHitNV: + case EShLangMissNV: + case EShLangCallableNV: + if (profile == EEsProfile || version < 460) { + correct = false; + infoSink.info.message(EPrefixError, "#version: ray tracing shaders require non-es profile with version 460 or above"); + version = 460; + } + break; + case EShLangMeshNV: + case EShLangTaskNV: + if ((profile == EEsProfile && version < 320) || + (profile != EEsProfile && version < 450)) { + correct = false; + infoSink.info.message(EPrefixError, "#version: mesh/task shaders require es profile with version 320 or above, or non-es profile with version 450 or above"); + version = profile == EEsProfile ? 320 : 450; + } +#endif default: break; } @@ -965,6 +1022,8 @@ class SourceLineSynchronizer { // DoPreprocessing is a valid ProcessingContext template argument, // which only performs the preprocessing step of compilation. // It places the result in the "string" argument to its constructor. +// +// This is not an officially supported or fully working path. struct DoPreprocessing { explicit DoPreprocessing(std::string* string): outputString(string) {} bool operator()(TParseContextBase& parseContext, TPpContext& ppContext, @@ -1072,7 +1131,11 @@ struct DoPreprocessing { outputBuffer += ' '; } lastToken = token; + if (token == PpAtomConstString) + outputBuffer += "\""; outputBuffer += ppToken.name; + if (token == PpAtomConstString) + outputBuffer += "\""; } while (true); outputBuffer += '\n'; *outputString = std::move(outputBuffer); @@ -1122,6 +1185,9 @@ struct DoFullParse{ // Return: True if there were no issues found in preprocessing, // False if during preprocessing any unknown version, pragmas or // extensions were found. +// +// NOTE: Doing just preprocessing to obtain a correct preprocessed shader string +// is not an officially supported or fully working path. bool PreprocessDeferred( TCompiler* compiler, const char* const shaderStrings[], @@ -1695,6 +1761,14 @@ void TShader::setAutoMapBindings(bool map) { intermediate->setAutoM void TShader::setInvertY(bool invert) { intermediate->setInvertY(invert); } // Fragile: currently within one stage: simple auto-assignment of location void TShader::setAutoMapLocations(bool map) { intermediate->setAutoMapLocations(map); } +void TShader::addUniformLocationOverride(const char* name, int loc) +{ + intermediate->addUniformLocationOverride(name, loc); +} +void TShader::setUniformLocationBase(int base) +{ + intermediate->setUniformLocationBase(base); +} // See comment above TDefaultHlslIoMapper in iomapper.cpp: void TShader::setHlslIoMapping(bool hlslIoMap) { intermediate->setHlslIoMapping(hlslIoMap); } void TShader::setFlattenUniformArrays(bool flatten) { intermediate->setFlattenUniformArrays(flatten); } @@ -1726,6 +1800,9 @@ bool TShader::parse(const TBuiltInResource* builtInResources, int defaultVersion // Fill in a string with the result of preprocessing ShaderStrings // Returns true if all extensions, pragmas and version strings were valid. +// +// NOTE: Doing just preprocessing to obtain a correct preprocessed shader string +// is not an officially supported or fully working path. bool TShader::preprocess(const TBuiltInResource* builtInResources, int defaultVersion, EProfile defaultProfile, bool forceDefaultVersionAndProfile, @@ -1910,6 +1987,7 @@ const char* TProgram::getUniformBlockName(int index) const { return reflection int TProgram::getUniformBlockSize(int index) const { return reflection->getUniformBlock(index).size; } int TProgram::getUniformIndex(const char* name) const { return reflection->getIndex(name); } int TProgram::getUniformBinding(int index) const { return reflection->getUniform(index).getBinding(); } +EShLanguageMask TProgram::getUniformStages(int index) const { return reflection->getUniform(index).stages; } int TProgram::getUniformBlockBinding(int index) const { return reflection->getUniformBlock(index).getBinding(); } int TProgram::getUniformBlockIndex(int index) const { return reflection->getUniform(index).index; } int TProgram::getUniformBlockCounterIndex(int index) const { return reflection->getUniformBlock(index).counterIndex; } diff --git a/deps/glslang/glslang/MachineIndependent/SymbolTable.cpp b/deps/glslang/glslang/MachineIndependent/SymbolTable.cpp index db46e107..bd7d5aa0 100644 --- a/deps/glslang/glslang/MachineIndependent/SymbolTable.cpp +++ b/deps/glslang/glslang/MachineIndependent/SymbolTable.cpp @@ -72,6 +72,9 @@ void TType::buildMangledName(TString& mangledName) const case EbtUint64: mangledName += "u64"; break; case EbtBool: mangledName += 'b'; break; case EbtAtomicUint: mangledName += "au"; break; +#ifdef NV_EXTENSIONS + case EbtAccStructNV: mangledName += "asnv"; break; +#endif case EbtSampler: switch (sampler.type) { #ifdef AMD_EXTENSIONS diff --git a/deps/glslang/glslang/MachineIndependent/Versions.cpp b/deps/glslang/glslang/MachineIndependent/Versions.cpp index 51b64308..66fa3e25 100644 --- a/deps/glslang/glslang/MachineIndependent/Versions.cpp +++ b/deps/glslang/glslang/MachineIndependent/Versions.cpp @@ -194,12 +194,19 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_KHR_shader_subgroup_shuffle_relative] = EBhDisable; extensionBehavior[E_GL_KHR_shader_subgroup_clustered] = EBhDisable; extensionBehavior[E_GL_KHR_shader_subgroup_quad] = EBhDisable; + extensionBehavior[E_GL_KHR_memory_scope_semantics] = EBhDisable; + + extensionBehavior[E_GL_EXT_shader_atomic_int64] = EBhDisable; extensionBehavior[E_GL_EXT_shader_non_constant_global_initializers] = EBhDisable; extensionBehavior[E_GL_EXT_shader_image_load_formatted] = EBhDisable; extensionBehavior[E_GL_EXT_post_depth_coverage] = EBhDisable; extensionBehavior[E_GL_EXT_control_flow_attributes] = EBhDisable; extensionBehavior[E_GL_EXT_nonuniform_qualifier] = EBhDisable; + extensionBehavior[E_GL_EXT_samplerless_texture_functions] = EBhDisable; + + extensionBehavior[E_GL_EXT_shader_16bit_storage] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_8bit_storage] = EBhDisable; // #line and #include extensionBehavior[E_GL_GOOGLE_cpp_style_line_directive] = EBhDisable; @@ -228,6 +235,12 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_NV_conservative_raster_underestimation] = EBhDisable; extensionBehavior[E_GL_NV_shader_noperspective_interpolation] = EBhDisable; extensionBehavior[E_GL_NV_shader_subgroup_partitioned] = EBhDisable; + extensionBehavior[E_GL_NV_shading_rate_image] = EBhDisable; + extensionBehavior[E_GL_NV_ray_tracing] = EBhDisable; + extensionBehavior[E_GL_NV_fragment_shader_barycentric] = EBhDisable; + extensionBehavior[E_GL_NV_compute_shader_derivatives] = EBhDisable; + extensionBehavior[E_GL_NV_shader_texture_footprint] = EBhDisable; + extensionBehavior[E_GL_NV_mesh_shader] = EBhDisable; #endif // AEP @@ -362,6 +375,9 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_EXT_post_depth_coverage 1\n" "#define GL_EXT_control_flow_attributes 1\n" "#define GL_EXT_nonuniform_qualifier 1\n" + "#define GL_EXT_shader_16bit_storage 1\n" + "#define GL_EXT_shader_8bit_storage 1\n" + "#define GL_EXT_samplerless_texture_functions 1\n" // GL_KHR_shader_subgroup "#define GL_KHR_shader_subgroup_basic 1\n" @@ -373,6 +389,8 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_KHR_shader_subgroup_clustered 1\n" "#define GL_KHR_shader_subgroup_quad 1\n" + "#define E_GL_EXT_shader_atomic_int64 1\n" + #ifdef AMD_EXTENSIONS "#define GL_AMD_shader_ballot 1\n" "#define GL_AMD_shader_trinary_minmax 1\n" @@ -393,6 +411,12 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_NV_shader_atomic_int64 1\n" "#define GL_NV_conservative_raster_underestimation 1\n" "#define GL_NV_shader_subgroup_partitioned 1\n" + "#define GL_NV_shading_rate_image 1\n" + "#define GL_NV_ray_tracing 1\n" + "#define GL_NV_fragment_shader_barycentric 1\n" + "#define GL_NV_compute_shader_derivatives 1\n" + "#define GL_NV_shader_texture_footprint 1\n" + "#define GL_NV_mesh_shader 1\n" #endif "#define GL_KHX_shader_explicit_arithmetic_types 1\n" "#define GL_KHX_shader_explicit_arithmetic_types_int8 1\n" @@ -480,6 +504,16 @@ const char* StageName(EShLanguage stage) case EShLangGeometry: return "geometry"; case EShLangFragment: return "fragment"; case EShLangCompute: return "compute"; +#ifdef NV_EXTENSIONS + case EShLangRayGenNV: return "ray-generation"; + case EShLangIntersectNV: return "intersection"; + case EShLangAnyHitNV: return "any-hit"; + case EShLangClosestHitNV: return "closest-hit"; + case EShLangMissNV: return "miss"; + case EShLangCallableNV: return "callable"; + case EShLangMeshNV: return "mesh"; + case EShLangTaskNV: return "task"; +#endif default: return "unknown stage"; } } @@ -708,6 +742,9 @@ void TParseVersions::updateExtensionBehavior(int line, const char* extension, co return; } + // check if extension is used with correct shader stage + checkExtensionStage(getCurrentLoc(), extension); + // update the requested extension updateExtensionBehavior(extension, behavior); @@ -800,6 +837,20 @@ void TParseVersions::updateExtensionBehavior(const char* extension, TExtensionBe } } +// Check if extension is used with correct shader stage. +void TParseVersions::checkExtensionStage(const TSourceLoc& loc, const char * const extension) +{ +#ifdef NV_EXTENSIONS + // GL_NV_mesh_shader extension is only allowed in task/mesh shaders + if (strcmp(extension, "GL_NV_mesh_shader") == 0) { + requireStage(loc, (EShLanguageMask)(EShLangTaskNVMask | EShLangMeshNVMask | EShLangFragmentMask), + "#extension GL_NV_mesh_shader"); + profileRequires(loc, ECoreProfile, 450, 0, "#extension GL_NV_mesh_shader"); + profileRequires(loc, EEsProfile, 320, 0, "#extension GL_NV_mesh_shader"); + } +#endif +} + // Call for any operation needing full GLSL integer data-type support. void TParseVersions::fullIntegerCheck(const TSourceLoc& loc, const char* op) { @@ -811,27 +862,109 @@ void TParseVersions::fullIntegerCheck(const TSourceLoc& loc, const char* op) void TParseVersions::doubleCheck(const TSourceLoc& loc, const char* op) { requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); - profileRequires(loc, ECoreProfile, 400, nullptr, op); - profileRequires(loc, ECompatibilityProfile, 400, nullptr, op); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 400, nullptr, op); } // Call for any operation needing GLSL float16 data-type support. void TParseVersions::float16Check(const TSourceLoc& loc, const char* op, bool builtIn) { if (!builtIn) { + const char* const extensions[] = { #if AMD_EXTENSIONS - const char* const extensions[3] = {E_GL_AMD_gpu_shader_half_float, + E_GL_AMD_gpu_shader_half_float, +#endif E_GL_KHX_shader_explicit_arithmetic_types, E_GL_KHX_shader_explicit_arithmetic_types_float16}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); + } +} -#else - const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, - E_GL_KHX_shader_explicit_arithmetic_types_float16}; +bool TParseVersions::float16Arithmetic() +{ + const char* const extensions[] = { +#if AMD_EXTENSIONS + E_GL_AMD_gpu_shader_half_float, #endif - requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, "explicit types"); - requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); - profileRequires(loc, ECoreProfile, 450, nullptr, op); - profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_float16}; + return extensionsTurnedOn(sizeof(extensions)/sizeof(extensions[0]), extensions); +} + +bool TParseVersions::int16Arithmetic() +{ + const char* const extensions[] = { +#if AMD_EXTENSIONS + E_GL_AMD_gpu_shader_int16, +#endif + E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_int16}; + return extensionsTurnedOn(sizeof(extensions)/sizeof(extensions[0]), extensions); +} + +bool TParseVersions::int8Arithmetic() +{ + const char* const extensions[] = { + E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_int8}; + return extensionsTurnedOn(sizeof(extensions)/sizeof(extensions[0]), extensions); +} + +void TParseVersions::requireFloat16Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc) +{ + TString combined; + combined = op; + combined += ": "; + combined += featureDesc; + + const char* const extensions[] = { +#if AMD_EXTENSIONS + E_GL_AMD_gpu_shader_half_float, +#endif + E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_float16}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, combined.c_str()); +} + +void TParseVersions::requireInt16Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc) +{ + TString combined; + combined = op; + combined += ": "; + combined += featureDesc; + + const char* const extensions[] = { +#if AMD_EXTENSIONS + E_GL_AMD_gpu_shader_int16, +#endif + E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_int16}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, combined.c_str()); +} + +void TParseVersions::requireInt8Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc) +{ + TString combined; + combined = op; + combined += ": "; + combined += featureDesc; + + const char* const extensions[] = { + E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_int8}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, combined.c_str()); +} + +void TParseVersions::float16ScalarVectorCheck(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[] = { +#if AMD_EXTENSIONS + E_GL_AMD_gpu_shader_half_float, +#endif + E_GL_EXT_shader_16bit_storage, + E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_float16}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); } } @@ -841,10 +974,7 @@ void TParseVersions::explicitFloat32Check(const TSourceLoc& loc, const char* op, if (!builtIn) { const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, E_GL_KHX_shader_explicit_arithmetic_types_float32}; - requireExtensions(loc, 2, extensions, "explicit types"); - requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); - profileRequires(loc, ECoreProfile, 450, nullptr, op); - profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + requireExtensions(loc, 2, extensions, op); } } @@ -854,10 +984,9 @@ void TParseVersions::explicitFloat64Check(const TSourceLoc& loc, const char* op, if (!builtIn) { const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, E_GL_KHX_shader_explicit_arithmetic_types_float64}; - requireExtensions(loc, 2, extensions, "explicit types"); + requireExtensions(loc, 2, extensions, op); requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); - profileRequires(loc, ECoreProfile, 450, nullptr, op); - profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 400, nullptr, op); } } @@ -867,10 +996,7 @@ void TParseVersions::explicitInt8Check(const TSourceLoc& loc, const char* op, bo if (! builtIn) { const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, E_GL_KHX_shader_explicit_arithmetic_types_int8}; - requireExtensions(loc, 2, extensions, "explicit types"); - requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); - profileRequires(loc, ECoreProfile, 450, nullptr, op); - profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + requireExtensions(loc, 2, extensions, op); } } @@ -881,8 +1007,7 @@ void TParseVersions::float16OpaqueCheck(const TSourceLoc& loc, const char* op, b if (! builtIn) { requireExtensions(loc, 1, &E_GL_AMD_gpu_shader_half_float_fetch, op); requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); - profileRequires(loc, ECoreProfile, 450, nullptr, op); - profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 400, nullptr, op); } } #endif @@ -891,18 +1016,38 @@ void TParseVersions::float16OpaqueCheck(const TSourceLoc& loc, const char* op, b void TParseVersions::explicitInt16Check(const TSourceLoc& loc, const char* op, bool builtIn) { if (! builtIn) { + const char* const extensions[] = { #if AMD_EXTENSIONS - const char* const extensions[3] = {E_GL_AMD_gpu_shader_int16, - E_GL_KHX_shader_explicit_arithmetic_types, - E_GL_KHX_shader_explicit_arithmetic_types_int16}; -#else - const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, - E_GL_KHX_shader_explicit_arithmetic_types_int16}; + E_GL_AMD_gpu_shader_int16, #endif - requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, "explicit types"); - requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); - profileRequires(loc, ECoreProfile, 450, nullptr, op); - profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_int16}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); + } +} + +void TParseVersions::int16ScalarVectorCheck(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (! builtIn) { + const char* const extensions[] = { +#if AMD_EXTENSIONS + E_GL_AMD_gpu_shader_int16, +#endif + E_GL_EXT_shader_16bit_storage, + E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_int16}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); + } +} + +void TParseVersions::int8ScalarVectorCheck(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (! builtIn) { + const char* const extensions[] = { + E_GL_EXT_shader_8bit_storage, + E_GL_KHX_shader_explicit_arithmetic_types, + E_GL_KHX_shader_explicit_arithmetic_types_int8}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); } } @@ -912,10 +1057,7 @@ void TParseVersions::explicitInt32Check(const TSourceLoc& loc, const char* op, b if (! builtIn) { const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, E_GL_KHX_shader_explicit_arithmetic_types_int32}; - requireExtensions(loc, 2, extensions, "explicit types"); - requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); - profileRequires(loc, ECoreProfile, 450, nullptr, op); - profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + requireExtensions(loc, 2, extensions, op); } } @@ -926,10 +1068,9 @@ void TParseVersions::int64Check(const TSourceLoc& loc, const char* op, bool buil const char* const extensions[3] = {E_GL_ARB_gpu_shader_int64, E_GL_KHX_shader_explicit_arithmetic_types, E_GL_KHX_shader_explicit_arithmetic_types_int64}; - requireExtensions(loc, 3, extensions, "shader int64"); + requireExtensions(loc, 3, extensions, op); requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); - profileRequires(loc, ECoreProfile, 450, nullptr, op); - profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 400, nullptr, op); } } diff --git a/deps/glslang/glslang/MachineIndependent/Versions.h b/deps/glslang/glslang/MachineIndependent/Versions.h index b297d27b..85c93c0a 100644 --- a/deps/glslang/glslang/MachineIndependent/Versions.h +++ b/deps/glslang/glslang/MachineIndependent/Versions.h @@ -148,16 +148,24 @@ const char* const E_GL_KHR_shader_subgroup_shuffle = "GL_KHR_shader_sub const char* const E_GL_KHR_shader_subgroup_shuffle_relative = "GL_KHR_shader_subgroup_shuffle_relative"; const char* const E_GL_KHR_shader_subgroup_clustered = "GL_KHR_shader_subgroup_clustered"; const char* const E_GL_KHR_shader_subgroup_quad = "GL_KHR_shader_subgroup_quad"; +const char* const E_GL_KHR_memory_scope_semantics = "GL_KHR_memory_scope_semantics"; + +const char* const E_GL_EXT_shader_atomic_int64 = "GL_EXT_shader_atomic_int64"; const char* const E_GL_EXT_shader_non_constant_global_initializers = "GL_EXT_shader_non_constant_global_initializers"; const char* const E_GL_EXT_shader_image_load_formatted = "GL_EXT_shader_image_load_formatted"; +const char* const E_GL_EXT_shader_16bit_storage = "GL_EXT_shader_16bit_storage"; +const char* const E_GL_EXT_shader_8bit_storage = "GL_EXT_shader_8bit_storage"; + + // EXT extensions -const char* const E_GL_EXT_device_group = "GL_EXT_device_group"; -const char* const E_GL_EXT_multiview = "GL_EXT_multiview"; -const char* const E_GL_EXT_post_depth_coverage = "GL_EXT_post_depth_coverage"; -const char* const E_GL_EXT_control_flow_attributes = "GL_EXT_control_flow_attributes"; -const char* const E_GL_EXT_nonuniform_qualifier = "GL_EXT_nonuniform_qualifier"; +const char* const E_GL_EXT_device_group = "GL_EXT_device_group"; +const char* const E_GL_EXT_multiview = "GL_EXT_multiview"; +const char* const E_GL_EXT_post_depth_coverage = "GL_EXT_post_depth_coverage"; +const char* const E_GL_EXT_control_flow_attributes = "GL_EXT_control_flow_attributes"; +const char* const E_GL_EXT_nonuniform_qualifier = "GL_EXT_nonuniform_qualifier"; +const char* const E_GL_EXT_samplerless_texture_functions = "GL_EXT_samplerless_texture_functions"; // Arrays of extensions for the above viewportEXTs duplications @@ -199,6 +207,12 @@ const char* const E_GL_NV_shader_atomic_int64 = "GL_NV_shader_ const char* const E_GL_NV_conservative_raster_underestimation = "GL_NV_conservative_raster_underestimation"; const char* const E_GL_NV_shader_noperspective_interpolation = "GL_NV_shader_noperspective_interpolation"; const char* const E_GL_NV_shader_subgroup_partitioned = "GL_NV_shader_subgroup_partitioned"; +const char* const E_GL_NV_shading_rate_image = "GL_NV_shading_rate_image"; +const char* const E_GL_NV_ray_tracing = "GL_NV_ray_tracing"; +const char* const E_GL_NV_fragment_shader_barycentric = "GL_NV_fragment_shader_barycentric"; +const char* const E_GL_NV_compute_shader_derivatives = "GL_NV_compute_shader_derivatives"; +const char* const E_GL_NV_shader_texture_footprint = "GL_NV_shader_texture_footprint"; +const char* const E_GL_NV_mesh_shader = "GL_NV_mesh_shader"; // Arrays of extensions for the above viewportEXTs duplications diff --git a/deps/glslang/glslang/MachineIndependent/glslang.y b/deps/glslang/glslang/MachineIndependent/glslang.y index e65483a8..3634f16f 100644 --- a/deps/glslang/glslang/MachineIndependent/glslang.y +++ b/deps/glslang/glslang/MachineIndependent/glslang.y @@ -140,13 +140,13 @@ extern int yylex(YYSTYPE*, TParseContext&); %token U8VEC2 U8VEC3 U8VEC4 %token VEC2 VEC3 VEC4 %token MAT2 MAT3 MAT4 CENTROID IN OUT INOUT -%token UNIFORM PATCH SAMPLE BUFFER SHARED NONUNIFORM -%token COHERENT VOLATILE RESTRICT READONLY WRITEONLY +%token UNIFORM PATCH SAMPLE BUFFER SHARED NONUNIFORM PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV +%token COHERENT VOLATILE RESTRICT READONLY WRITEONLY DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT SUBGROUPCOHERENT NONPRIVATE %token DVEC2 DVEC3 DVEC4 DMAT2 DMAT3 DMAT4 %token F16VEC2 F16VEC3 F16VEC4 F16MAT2 F16MAT3 F16MAT4 %token F32VEC2 F32VEC3 F32VEC4 F32MAT2 F32MAT3 F32MAT4 %token F64VEC2 F64VEC3 F64VEC4 F64MAT2 F64MAT3 F64MAT4 -%token NOPERSPECTIVE FLAT SMOOTH LAYOUT __EXPLICITINTERPAMD +%token NOPERSPECTIVE FLAT SMOOTH LAYOUT EXPLICITINTERPAMD PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV %token MAT2X2 MAT2X3 MAT2X4 %token MAT3X2 MAT3X3 MAT3X4 @@ -164,6 +164,7 @@ extern int yylex(YYSTYPE*, TParseContext&); %token F64MAT3X2 F64MAT3X3 F64MAT3X4 %token F64MAT4X2 F64MAT4X3 F64MAT4X4 %token ATOMIC_UINT +%token ACCSTRUCTNV // combined image/sampler %token SAMPLER1D SAMPLER2D SAMPLER3D SAMPLERCUBE SAMPLER1DSHADOW SAMPLER2DSHADOW @@ -699,6 +700,7 @@ assignment_expression | unary_expression assignment_operator assignment_expression { parseContext.arrayObjectCheck($2.loc, $1->getType(), "array assignment"); parseContext.opaqueCheck($2.loc, $1->getType(), "="); + parseContext.storage16BitAssignmentCheck($2.loc, $1->getType(), "="); parseContext.specializationCheck($2.loc, $1->getType(), "="); parseContext.lValueErrorCheck($2.loc, "assign", $1); parseContext.rValueErrorCheck($2.loc, "assign", $3); @@ -1134,13 +1136,53 @@ interpolation_qualifier $$.init($1.loc); $$.qualifier.nopersp = true; } - | __EXPLICITINTERPAMD { + | EXPLICITINTERPAMD { #ifdef AMD_EXTENSIONS parseContext.globalCheck($1.loc, "__explicitInterpAMD"); parseContext.profileRequires($1.loc, ECoreProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); parseContext.profileRequires($1.loc, ECompatibilityProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); $$.init($1.loc); $$.qualifier.explicitInterp = true; +#endif + } + | PERVERTEXNV { +#ifdef NV_EXTENSIONS + parseContext.globalCheck($1.loc, "pervertexNV"); + parseContext.profileRequires($1.loc, ECoreProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric"); + parseContext.profileRequires($1.loc, ECompatibilityProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric"); + parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric"); + $$.init($1.loc); + $$.qualifier.pervertexNV = true; +#endif + } + | PERPRIMITIVENV { +#ifdef NV_EXTENSIONS + // No need for profile version or extension check. Shader stage already checks both. + parseContext.globalCheck($1.loc, "perprimitiveNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshNVMask), "perprimitiveNV"); + // Fragment shader stage doesn't check for extension. So we explicitly add below extension check. + if (parseContext.language == EShLangFragment) + parseContext.requireExtensions($1.loc, 1, &E_GL_NV_mesh_shader, "perprimitiveNV"); + $$.init($1.loc); + $$.qualifier.perPrimitiveNV = true; +#endif + } + | PERVIEWNV { +#ifdef NV_EXTENSIONS + // No need for profile version or extension check. Shader stage already checks both. + parseContext.globalCheck($1.loc, "perviewNV"); + parseContext.requireStage($1.loc, EShLangMeshNV, "perviewNV"); + $$.init($1.loc); + $$.qualifier.perViewNV = true; +#endif + } + | PERTASKNV { +#ifdef NV_EXTENSIONS + // No need for profile version or extension check. Shader stage already checks both. + parseContext.globalCheck($1.loc, "taskNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTaskNVMask | EShLangMeshNVMask), "taskNV"); + $$.init($1.loc); + $$.qualifier.perTaskNV = true; #endif } ; @@ -1304,11 +1346,64 @@ storage_qualifier $$.init($1.loc); $$.qualifier.storage = EvqBuffer; } + | HITATTRNV { +#ifdef NV_EXTENSIONS + parseContext.globalCheck($1.loc, "hitAttributeNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectNVMask | EShLangClosestHitNVMask + | EShLangAnyHitNVMask), "hitAttributeNV"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "hitAttributeNV"); + $$.init($1.loc); + $$.qualifier.storage = EvqHitAttrNV; +#endif + } + | PAYLOADNV { +#ifdef NV_EXTENSIONS + parseContext.globalCheck($1.loc, "rayPayloadNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenNVMask | EShLangClosestHitNVMask | + EShLangAnyHitNVMask | EShLangMissNVMask), "rayPayloadNV"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadNV"); + $$.init($1.loc); + $$.qualifier.storage = EvqPayloadNV; +#endif + } + | PAYLOADINNV { +#ifdef NV_EXTENSIONS + parseContext.globalCheck($1.loc, "rayPayloadInNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangClosestHitNVMask | + EShLangAnyHitNVMask | EShLangMissNVMask), "rayPayloadInNV"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadInNV"); + $$.init($1.loc); + $$.qualifier.storage = EvqPayloadInNV; +#endif + } + | CALLDATANV { +#ifdef NV_EXTENSIONS + parseContext.globalCheck($1.loc, "callableDataNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenNVMask | + EShLangClosestHitNVMask | EShLangMissNVMask | EShLangCallableNVMask), "callableDataNV"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataNV"); + $$.init($1.loc); + $$.qualifier.storage = EvqCallableDataNV; +#endif + } + | CALLDATAINNV { +#ifdef NV_EXTENSIONS + parseContext.globalCheck($1.loc, "callableDataInNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangCallableNVMask), "callableDataInNV"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataInNV"); + $$.init($1.loc); + $$.qualifier.storage = EvqCallableDataInNV; +#endif + } | SHARED { parseContext.globalCheck($1.loc, "shared"); parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared"); parseContext.profileRequires($1.loc, EEsProfile, 310, 0, "shared"); +#ifdef NV_EXTENSIONS + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangComputeMask | EShLangMeshNVMask | EShLangTaskNVMask), "shared"); +#else parseContext.requireStage($1.loc, EShLangCompute, "shared"); +#endif $$.init($1.loc); $$.qualifier.storage = EvqShared; } @@ -1316,6 +1411,31 @@ storage_qualifier $$.init($1.loc); $$.qualifier.coherent = true; } + | DEVICECOHERENT { + $$.init($1.loc); + parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "devicecoherent"); + $$.qualifier.devicecoherent = true; + } + | QUEUEFAMILYCOHERENT { + $$.init($1.loc); + parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "queuefamilycoherent"); + $$.qualifier.queuefamilycoherent = true; + } + | WORKGROUPCOHERENT { + $$.init($1.loc); + parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "workgroupcoherent"); + $$.qualifier.workgroupcoherent = true; + } + | SUBGROUPCOHERENT { + $$.init($1.loc); + parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "subgroupcoherent"); + $$.qualifier.subgroupcoherent = true; + } + | NONPRIVATE { + $$.init($1.loc); + parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "nonprivate"); + $$.qualifier.nonprivate = true; + } | VOLATILE { $$.init($1.loc); $$.qualifier.volatil = true; @@ -1419,7 +1539,7 @@ type_specifier_nonarray $$.basicType = EbtDouble; } | FLOAT16_T { - parseContext.float16Check($1.loc, "float16_t", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16ScalarVectorCheck($1.loc, "float16_t", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; } @@ -1443,22 +1563,22 @@ type_specifier_nonarray $$.basicType = EbtUint; } | INT8_T { - parseContext.explicitInt8Check($1.loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtInt8; } | UINT8_T { - parseContext.explicitInt8Check($1.loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtUint8; } | INT16_T { - parseContext.explicitInt16Check($1.loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtInt16; } | UINT16_T { - parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtUint16; } @@ -1520,19 +1640,19 @@ type_specifier_nonarray $$.setVector(4); } | F16VEC2 { - parseContext.float16Check($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setVector(2); } | F16VEC3 { - parseContext.float16Check($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setVector(3); } | F16VEC4 { - parseContext.float16Check($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat16; $$.setVector(4); @@ -1604,40 +1724,40 @@ type_specifier_nonarray $$.setVector(4); } | I8VEC2 { - parseContext.explicitInt8Check($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtInt8; - $$.setVector(2); + parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt8; + $$.setVector(2); } | I8VEC3 { - parseContext.explicitInt8Check($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtInt8; - $$.setVector(3); + parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt8; + $$.setVector(3); } | I8VEC4 { - parseContext.explicitInt8Check($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtInt8; - $$.setVector(4); + parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt8; + $$.setVector(4); } | I16VEC2 { - parseContext.explicitInt16Check($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtInt16; - $$.setVector(2); + parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt16; + $$.setVector(2); } | I16VEC3 { - parseContext.explicitInt16Check($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtInt16; - $$.setVector(3); + parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt16; + $$.setVector(3); } | I16VEC4 { - parseContext.explicitInt16Check($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtInt16; - $$.setVector(4); + parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt16; + $$.setVector(4); } | I32VEC2 { parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); @@ -1694,37 +1814,37 @@ type_specifier_nonarray $$.setVector(4); } | U8VEC2 { - parseContext.explicitInt8Check($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtUint8; $$.setVector(2); } | U8VEC3 { - parseContext.explicitInt8Check($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtInt8; + $$.basicType = EbtUint8; $$.setVector(3); } | U8VEC4 { - parseContext.explicitInt8Check($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtUint8; $$.setVector(4); } | U16VEC2 { - parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtUint16; $$.setVector(2); } | U16VEC3 { - parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtUint16; $$.setVector(3); } | U16VEC4 { - parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtUint16; $$.setVector(4); @@ -2113,6 +2233,12 @@ type_specifier_nonarray $$.basicType = EbtDouble; $$.setMatrix(4, 4); } + | ACCSTRUCTNV { +#ifdef NV_EXTENSIONS + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtAccStructNV; +#endif + } | ATOMIC_UINT { parseContext.vulkanRemoved($1.loc, "atomic counter types"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); diff --git a/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp b/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp index 38672d67..e57edb57 100644 --- a/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp +++ b/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.0. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.0" +#define YYBISON_VERSION "3.0.4" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -90,11 +90,11 @@ using namespace glslang; #line 92 "MachineIndependent/glslang_tab.cpp" /* yacc.c:339 */ -# ifndef YY_NULL +# ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr +# define YY_NULLPTR nullptr # else -# define YY_NULL 0 +# define YY_NULLPTR 0 # endif # endif @@ -203,320 +203,335 @@ extern int yydebug; BUFFER = 335, SHARED = 336, NONUNIFORM = 337, - COHERENT = 338, - VOLATILE = 339, - RESTRICT = 340, - READONLY = 341, - WRITEONLY = 342, - DVEC2 = 343, - DVEC3 = 344, - DVEC4 = 345, - DMAT2 = 346, - DMAT3 = 347, - DMAT4 = 348, - F16VEC2 = 349, - F16VEC3 = 350, - F16VEC4 = 351, - F16MAT2 = 352, - F16MAT3 = 353, - F16MAT4 = 354, - F32VEC2 = 355, - F32VEC3 = 356, - F32VEC4 = 357, - F32MAT2 = 358, - F32MAT3 = 359, - F32MAT4 = 360, - F64VEC2 = 361, - F64VEC3 = 362, - F64VEC4 = 363, - F64MAT2 = 364, - F64MAT3 = 365, - F64MAT4 = 366, - NOPERSPECTIVE = 367, - FLAT = 368, - SMOOTH = 369, - LAYOUT = 370, - __EXPLICITINTERPAMD = 371, - MAT2X2 = 372, - MAT2X3 = 373, - MAT2X4 = 374, - MAT3X2 = 375, - MAT3X3 = 376, - MAT3X4 = 377, - MAT4X2 = 378, - MAT4X3 = 379, - MAT4X4 = 380, - DMAT2X2 = 381, - DMAT2X3 = 382, - DMAT2X4 = 383, - DMAT3X2 = 384, - DMAT3X3 = 385, - DMAT3X4 = 386, - DMAT4X2 = 387, - DMAT4X3 = 388, - DMAT4X4 = 389, - F16MAT2X2 = 390, - F16MAT2X3 = 391, - F16MAT2X4 = 392, - F16MAT3X2 = 393, - F16MAT3X3 = 394, - F16MAT3X4 = 395, - F16MAT4X2 = 396, - F16MAT4X3 = 397, - F16MAT4X4 = 398, - F32MAT2X2 = 399, - F32MAT2X3 = 400, - F32MAT2X4 = 401, - F32MAT3X2 = 402, - F32MAT3X3 = 403, - F32MAT3X4 = 404, - F32MAT4X2 = 405, - F32MAT4X3 = 406, - F32MAT4X4 = 407, - F64MAT2X2 = 408, - F64MAT2X3 = 409, - F64MAT2X4 = 410, - F64MAT3X2 = 411, - F64MAT3X3 = 412, - F64MAT3X4 = 413, - F64MAT4X2 = 414, - F64MAT4X3 = 415, - F64MAT4X4 = 416, - ATOMIC_UINT = 417, - SAMPLER1D = 418, - SAMPLER2D = 419, - SAMPLER3D = 420, - SAMPLERCUBE = 421, - SAMPLER1DSHADOW = 422, - SAMPLER2DSHADOW = 423, - SAMPLERCUBESHADOW = 424, - SAMPLER1DARRAY = 425, - SAMPLER2DARRAY = 426, - SAMPLER1DARRAYSHADOW = 427, - SAMPLER2DARRAYSHADOW = 428, - ISAMPLER1D = 429, - ISAMPLER2D = 430, - ISAMPLER3D = 431, - ISAMPLERCUBE = 432, - ISAMPLER1DARRAY = 433, - ISAMPLER2DARRAY = 434, - USAMPLER1D = 435, - USAMPLER2D = 436, - USAMPLER3D = 437, - USAMPLERCUBE = 438, - USAMPLER1DARRAY = 439, - USAMPLER2DARRAY = 440, - SAMPLER2DRECT = 441, - SAMPLER2DRECTSHADOW = 442, - ISAMPLER2DRECT = 443, - USAMPLER2DRECT = 444, - SAMPLERBUFFER = 445, - ISAMPLERBUFFER = 446, - USAMPLERBUFFER = 447, - SAMPLERCUBEARRAY = 448, - SAMPLERCUBEARRAYSHADOW = 449, - ISAMPLERCUBEARRAY = 450, - USAMPLERCUBEARRAY = 451, - SAMPLER2DMS = 452, - ISAMPLER2DMS = 453, - USAMPLER2DMS = 454, - SAMPLER2DMSARRAY = 455, - ISAMPLER2DMSARRAY = 456, - USAMPLER2DMSARRAY = 457, - SAMPLEREXTERNALOES = 458, - F16SAMPLER1D = 459, - F16SAMPLER2D = 460, - F16SAMPLER3D = 461, - F16SAMPLER2DRECT = 462, - F16SAMPLERCUBE = 463, - F16SAMPLER1DARRAY = 464, - F16SAMPLER2DARRAY = 465, - F16SAMPLERCUBEARRAY = 466, - F16SAMPLERBUFFER = 467, - F16SAMPLER2DMS = 468, - F16SAMPLER2DMSARRAY = 469, - F16SAMPLER1DSHADOW = 470, - F16SAMPLER2DSHADOW = 471, - F16SAMPLER1DARRAYSHADOW = 472, - F16SAMPLER2DARRAYSHADOW = 473, - F16SAMPLER2DRECTSHADOW = 474, - F16SAMPLERCUBESHADOW = 475, - F16SAMPLERCUBEARRAYSHADOW = 476, - SAMPLER = 477, - SAMPLERSHADOW = 478, - TEXTURE1D = 479, - TEXTURE2D = 480, - TEXTURE3D = 481, - TEXTURECUBE = 482, - TEXTURE1DARRAY = 483, - TEXTURE2DARRAY = 484, - ITEXTURE1D = 485, - ITEXTURE2D = 486, - ITEXTURE3D = 487, - ITEXTURECUBE = 488, - ITEXTURE1DARRAY = 489, - ITEXTURE2DARRAY = 490, - UTEXTURE1D = 491, - UTEXTURE2D = 492, - UTEXTURE3D = 493, - UTEXTURECUBE = 494, - UTEXTURE1DARRAY = 495, - UTEXTURE2DARRAY = 496, - TEXTURE2DRECT = 497, - ITEXTURE2DRECT = 498, - UTEXTURE2DRECT = 499, - TEXTUREBUFFER = 500, - ITEXTUREBUFFER = 501, - UTEXTUREBUFFER = 502, - TEXTURECUBEARRAY = 503, - ITEXTURECUBEARRAY = 504, - UTEXTURECUBEARRAY = 505, - TEXTURE2DMS = 506, - ITEXTURE2DMS = 507, - UTEXTURE2DMS = 508, - TEXTURE2DMSARRAY = 509, - ITEXTURE2DMSARRAY = 510, - UTEXTURE2DMSARRAY = 511, - F16TEXTURE1D = 512, - F16TEXTURE2D = 513, - F16TEXTURE3D = 514, - F16TEXTURE2DRECT = 515, - F16TEXTURECUBE = 516, - F16TEXTURE1DARRAY = 517, - F16TEXTURE2DARRAY = 518, - F16TEXTURECUBEARRAY = 519, - F16TEXTUREBUFFER = 520, - F16TEXTURE2DMS = 521, - F16TEXTURE2DMSARRAY = 522, - SUBPASSINPUT = 523, - SUBPASSINPUTMS = 524, - ISUBPASSINPUT = 525, - ISUBPASSINPUTMS = 526, - USUBPASSINPUT = 527, - USUBPASSINPUTMS = 528, - F16SUBPASSINPUT = 529, - F16SUBPASSINPUTMS = 530, - IMAGE1D = 531, - IIMAGE1D = 532, - UIMAGE1D = 533, - IMAGE2D = 534, - IIMAGE2D = 535, - UIMAGE2D = 536, - IMAGE3D = 537, - IIMAGE3D = 538, - UIMAGE3D = 539, - IMAGE2DRECT = 540, - IIMAGE2DRECT = 541, - UIMAGE2DRECT = 542, - IMAGECUBE = 543, - IIMAGECUBE = 544, - UIMAGECUBE = 545, - IMAGEBUFFER = 546, - IIMAGEBUFFER = 547, - UIMAGEBUFFER = 548, - IMAGE1DARRAY = 549, - IIMAGE1DARRAY = 550, - UIMAGE1DARRAY = 551, - IMAGE2DARRAY = 552, - IIMAGE2DARRAY = 553, - UIMAGE2DARRAY = 554, - IMAGECUBEARRAY = 555, - IIMAGECUBEARRAY = 556, - UIMAGECUBEARRAY = 557, - IMAGE2DMS = 558, - IIMAGE2DMS = 559, - UIMAGE2DMS = 560, - IMAGE2DMSARRAY = 561, - IIMAGE2DMSARRAY = 562, - UIMAGE2DMSARRAY = 563, - F16IMAGE1D = 564, - F16IMAGE2D = 565, - F16IMAGE3D = 566, - F16IMAGE2DRECT = 567, - F16IMAGECUBE = 568, - F16IMAGE1DARRAY = 569, - F16IMAGE2DARRAY = 570, - F16IMAGECUBEARRAY = 571, - F16IMAGEBUFFER = 572, - F16IMAGE2DMS = 573, - F16IMAGE2DMSARRAY = 574, - STRUCT = 575, - VOID = 576, - WHILE = 577, - IDENTIFIER = 578, - TYPE_NAME = 579, - FLOATCONSTANT = 580, - DOUBLECONSTANT = 581, - INT16CONSTANT = 582, - UINT16CONSTANT = 583, - INT32CONSTANT = 584, - UINT32CONSTANT = 585, - INTCONSTANT = 586, - UINTCONSTANT = 587, - INT64CONSTANT = 588, - UINT64CONSTANT = 589, - BOOLCONSTANT = 590, - FLOAT16CONSTANT = 591, - LEFT_OP = 592, - RIGHT_OP = 593, - INC_OP = 594, - DEC_OP = 595, - LE_OP = 596, - GE_OP = 597, - EQ_OP = 598, - NE_OP = 599, - AND_OP = 600, - OR_OP = 601, - XOR_OP = 602, - MUL_ASSIGN = 603, - DIV_ASSIGN = 604, - ADD_ASSIGN = 605, - MOD_ASSIGN = 606, - LEFT_ASSIGN = 607, - RIGHT_ASSIGN = 608, - AND_ASSIGN = 609, - XOR_ASSIGN = 610, - OR_ASSIGN = 611, - SUB_ASSIGN = 612, - LEFT_PAREN = 613, - RIGHT_PAREN = 614, - LEFT_BRACKET = 615, - RIGHT_BRACKET = 616, - LEFT_BRACE = 617, - RIGHT_BRACE = 618, - DOT = 619, - COMMA = 620, - COLON = 621, - EQUAL = 622, - SEMICOLON = 623, - BANG = 624, - DASH = 625, - TILDE = 626, - PLUS = 627, - STAR = 628, - SLASH = 629, - PERCENT = 630, - LEFT_ANGLE = 631, - RIGHT_ANGLE = 632, - VERTICAL_BAR = 633, - CARET = 634, - AMPERSAND = 635, - QUESTION = 636, - INVARIANT = 637, - PRECISE = 638, - HIGH_PRECISION = 639, - MEDIUM_PRECISION = 640, - LOW_PRECISION = 641, - PRECISION = 642, - PACKED = 643, - RESOURCE = 644, - SUPERP = 645 + PAYLOADNV = 338, + PAYLOADINNV = 339, + HITATTRNV = 340, + CALLDATANV = 341, + CALLDATAINNV = 342, + COHERENT = 343, + VOLATILE = 344, + RESTRICT = 345, + READONLY = 346, + WRITEONLY = 347, + DEVICECOHERENT = 348, + QUEUEFAMILYCOHERENT = 349, + WORKGROUPCOHERENT = 350, + SUBGROUPCOHERENT = 351, + NONPRIVATE = 352, + DVEC2 = 353, + DVEC3 = 354, + DVEC4 = 355, + DMAT2 = 356, + DMAT3 = 357, + DMAT4 = 358, + F16VEC2 = 359, + F16VEC3 = 360, + F16VEC4 = 361, + F16MAT2 = 362, + F16MAT3 = 363, + F16MAT4 = 364, + F32VEC2 = 365, + F32VEC3 = 366, + F32VEC4 = 367, + F32MAT2 = 368, + F32MAT3 = 369, + F32MAT4 = 370, + F64VEC2 = 371, + F64VEC3 = 372, + F64VEC4 = 373, + F64MAT2 = 374, + F64MAT3 = 375, + F64MAT4 = 376, + NOPERSPECTIVE = 377, + FLAT = 378, + SMOOTH = 379, + LAYOUT = 380, + EXPLICITINTERPAMD = 381, + PERVERTEXNV = 382, + PERPRIMITIVENV = 383, + PERVIEWNV = 384, + PERTASKNV = 385, + MAT2X2 = 386, + MAT2X3 = 387, + MAT2X4 = 388, + MAT3X2 = 389, + MAT3X3 = 390, + MAT3X4 = 391, + MAT4X2 = 392, + MAT4X3 = 393, + MAT4X4 = 394, + DMAT2X2 = 395, + DMAT2X3 = 396, + DMAT2X4 = 397, + DMAT3X2 = 398, + DMAT3X3 = 399, + DMAT3X4 = 400, + DMAT4X2 = 401, + DMAT4X3 = 402, + DMAT4X4 = 403, + F16MAT2X2 = 404, + F16MAT2X3 = 405, + F16MAT2X4 = 406, + F16MAT3X2 = 407, + F16MAT3X3 = 408, + F16MAT3X4 = 409, + F16MAT4X2 = 410, + F16MAT4X3 = 411, + F16MAT4X4 = 412, + F32MAT2X2 = 413, + F32MAT2X3 = 414, + F32MAT2X4 = 415, + F32MAT3X2 = 416, + F32MAT3X3 = 417, + F32MAT3X4 = 418, + F32MAT4X2 = 419, + F32MAT4X3 = 420, + F32MAT4X4 = 421, + F64MAT2X2 = 422, + F64MAT2X3 = 423, + F64MAT2X4 = 424, + F64MAT3X2 = 425, + F64MAT3X3 = 426, + F64MAT3X4 = 427, + F64MAT4X2 = 428, + F64MAT4X3 = 429, + F64MAT4X4 = 430, + ATOMIC_UINT = 431, + ACCSTRUCTNV = 432, + SAMPLER1D = 433, + SAMPLER2D = 434, + SAMPLER3D = 435, + SAMPLERCUBE = 436, + SAMPLER1DSHADOW = 437, + SAMPLER2DSHADOW = 438, + SAMPLERCUBESHADOW = 439, + SAMPLER1DARRAY = 440, + SAMPLER2DARRAY = 441, + SAMPLER1DARRAYSHADOW = 442, + SAMPLER2DARRAYSHADOW = 443, + ISAMPLER1D = 444, + ISAMPLER2D = 445, + ISAMPLER3D = 446, + ISAMPLERCUBE = 447, + ISAMPLER1DARRAY = 448, + ISAMPLER2DARRAY = 449, + USAMPLER1D = 450, + USAMPLER2D = 451, + USAMPLER3D = 452, + USAMPLERCUBE = 453, + USAMPLER1DARRAY = 454, + USAMPLER2DARRAY = 455, + SAMPLER2DRECT = 456, + SAMPLER2DRECTSHADOW = 457, + ISAMPLER2DRECT = 458, + USAMPLER2DRECT = 459, + SAMPLERBUFFER = 460, + ISAMPLERBUFFER = 461, + USAMPLERBUFFER = 462, + SAMPLERCUBEARRAY = 463, + SAMPLERCUBEARRAYSHADOW = 464, + ISAMPLERCUBEARRAY = 465, + USAMPLERCUBEARRAY = 466, + SAMPLER2DMS = 467, + ISAMPLER2DMS = 468, + USAMPLER2DMS = 469, + SAMPLER2DMSARRAY = 470, + ISAMPLER2DMSARRAY = 471, + USAMPLER2DMSARRAY = 472, + SAMPLEREXTERNALOES = 473, + F16SAMPLER1D = 474, + F16SAMPLER2D = 475, + F16SAMPLER3D = 476, + F16SAMPLER2DRECT = 477, + F16SAMPLERCUBE = 478, + F16SAMPLER1DARRAY = 479, + F16SAMPLER2DARRAY = 480, + F16SAMPLERCUBEARRAY = 481, + F16SAMPLERBUFFER = 482, + F16SAMPLER2DMS = 483, + F16SAMPLER2DMSARRAY = 484, + F16SAMPLER1DSHADOW = 485, + F16SAMPLER2DSHADOW = 486, + F16SAMPLER1DARRAYSHADOW = 487, + F16SAMPLER2DARRAYSHADOW = 488, + F16SAMPLER2DRECTSHADOW = 489, + F16SAMPLERCUBESHADOW = 490, + F16SAMPLERCUBEARRAYSHADOW = 491, + SAMPLER = 492, + SAMPLERSHADOW = 493, + TEXTURE1D = 494, + TEXTURE2D = 495, + TEXTURE3D = 496, + TEXTURECUBE = 497, + TEXTURE1DARRAY = 498, + TEXTURE2DARRAY = 499, + ITEXTURE1D = 500, + ITEXTURE2D = 501, + ITEXTURE3D = 502, + ITEXTURECUBE = 503, + ITEXTURE1DARRAY = 504, + ITEXTURE2DARRAY = 505, + UTEXTURE1D = 506, + UTEXTURE2D = 507, + UTEXTURE3D = 508, + UTEXTURECUBE = 509, + UTEXTURE1DARRAY = 510, + UTEXTURE2DARRAY = 511, + TEXTURE2DRECT = 512, + ITEXTURE2DRECT = 513, + UTEXTURE2DRECT = 514, + TEXTUREBUFFER = 515, + ITEXTUREBUFFER = 516, + UTEXTUREBUFFER = 517, + TEXTURECUBEARRAY = 518, + ITEXTURECUBEARRAY = 519, + UTEXTURECUBEARRAY = 520, + TEXTURE2DMS = 521, + ITEXTURE2DMS = 522, + UTEXTURE2DMS = 523, + TEXTURE2DMSARRAY = 524, + ITEXTURE2DMSARRAY = 525, + UTEXTURE2DMSARRAY = 526, + F16TEXTURE1D = 527, + F16TEXTURE2D = 528, + F16TEXTURE3D = 529, + F16TEXTURE2DRECT = 530, + F16TEXTURECUBE = 531, + F16TEXTURE1DARRAY = 532, + F16TEXTURE2DARRAY = 533, + F16TEXTURECUBEARRAY = 534, + F16TEXTUREBUFFER = 535, + F16TEXTURE2DMS = 536, + F16TEXTURE2DMSARRAY = 537, + SUBPASSINPUT = 538, + SUBPASSINPUTMS = 539, + ISUBPASSINPUT = 540, + ISUBPASSINPUTMS = 541, + USUBPASSINPUT = 542, + USUBPASSINPUTMS = 543, + F16SUBPASSINPUT = 544, + F16SUBPASSINPUTMS = 545, + IMAGE1D = 546, + IIMAGE1D = 547, + UIMAGE1D = 548, + IMAGE2D = 549, + IIMAGE2D = 550, + UIMAGE2D = 551, + IMAGE3D = 552, + IIMAGE3D = 553, + UIMAGE3D = 554, + IMAGE2DRECT = 555, + IIMAGE2DRECT = 556, + UIMAGE2DRECT = 557, + IMAGECUBE = 558, + IIMAGECUBE = 559, + UIMAGECUBE = 560, + IMAGEBUFFER = 561, + IIMAGEBUFFER = 562, + UIMAGEBUFFER = 563, + IMAGE1DARRAY = 564, + IIMAGE1DARRAY = 565, + UIMAGE1DARRAY = 566, + IMAGE2DARRAY = 567, + IIMAGE2DARRAY = 568, + UIMAGE2DARRAY = 569, + IMAGECUBEARRAY = 570, + IIMAGECUBEARRAY = 571, + UIMAGECUBEARRAY = 572, + IMAGE2DMS = 573, + IIMAGE2DMS = 574, + UIMAGE2DMS = 575, + IMAGE2DMSARRAY = 576, + IIMAGE2DMSARRAY = 577, + UIMAGE2DMSARRAY = 578, + F16IMAGE1D = 579, + F16IMAGE2D = 580, + F16IMAGE3D = 581, + F16IMAGE2DRECT = 582, + F16IMAGECUBE = 583, + F16IMAGE1DARRAY = 584, + F16IMAGE2DARRAY = 585, + F16IMAGECUBEARRAY = 586, + F16IMAGEBUFFER = 587, + F16IMAGE2DMS = 588, + F16IMAGE2DMSARRAY = 589, + STRUCT = 590, + VOID = 591, + WHILE = 592, + IDENTIFIER = 593, + TYPE_NAME = 594, + FLOATCONSTANT = 595, + DOUBLECONSTANT = 596, + INT16CONSTANT = 597, + UINT16CONSTANT = 598, + INT32CONSTANT = 599, + UINT32CONSTANT = 600, + INTCONSTANT = 601, + UINTCONSTANT = 602, + INT64CONSTANT = 603, + UINT64CONSTANT = 604, + BOOLCONSTANT = 605, + FLOAT16CONSTANT = 606, + LEFT_OP = 607, + RIGHT_OP = 608, + INC_OP = 609, + DEC_OP = 610, + LE_OP = 611, + GE_OP = 612, + EQ_OP = 613, + NE_OP = 614, + AND_OP = 615, + OR_OP = 616, + XOR_OP = 617, + MUL_ASSIGN = 618, + DIV_ASSIGN = 619, + ADD_ASSIGN = 620, + MOD_ASSIGN = 621, + LEFT_ASSIGN = 622, + RIGHT_ASSIGN = 623, + AND_ASSIGN = 624, + XOR_ASSIGN = 625, + OR_ASSIGN = 626, + SUB_ASSIGN = 627, + LEFT_PAREN = 628, + RIGHT_PAREN = 629, + LEFT_BRACKET = 630, + RIGHT_BRACKET = 631, + LEFT_BRACE = 632, + RIGHT_BRACE = 633, + DOT = 634, + COMMA = 635, + COLON = 636, + EQUAL = 637, + SEMICOLON = 638, + BANG = 639, + DASH = 640, + TILDE = 641, + PLUS = 642, + STAR = 643, + SLASH = 644, + PERCENT = 645, + LEFT_ANGLE = 646, + RIGHT_ANGLE = 647, + VERTICAL_BAR = 648, + CARET = 649, + AMPERSAND = 650, + QUESTION = 651, + INVARIANT = 652, + PRECISE = 653, + HIGH_PRECISION = 654, + MEDIUM_PRECISION = 655, + LOW_PRECISION = 656, + PRECISION = 657, + PACKED = 658, + RESOURCE = 659, + SUPERP = 660 }; #endif /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE YYSTYPE; + union YYSTYPE { #line 70 "MachineIndependent/glslang.y" /* yacc.c:355 */ @@ -554,8 +569,10 @@ union YYSTYPE }; } interm; -#line 558 "MachineIndependent/glslang_tab.cpp" /* yacc.c:355 */ +#line 573 "MachineIndependent/glslang_tab.cpp" /* yacc.c:355 */ }; + +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif @@ -583,7 +600,7 @@ int yyparse (glslang::TParseContext* pParseContext); extern int yylex(YYSTYPE*, TParseContext&); -#line 587 "MachineIndependent/glslang_tab.cpp" /* yacc.c:358 */ +#line 604 "MachineIndependent/glslang_tab.cpp" /* yacc.c:358 */ #ifdef short # undef short @@ -640,11 +657,30 @@ typedef short int yytype_int16; # endif #endif -#ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if (! defined __GNUC__ || __GNUC__ < 2 \ - || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)) -# define __attribute__(Spec) /* empty */ +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) # endif #endif @@ -804,23 +840,23 @@ union yyalloc #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 366 +#define YYFINAL 381 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 8949 +#define YYLAST 9294 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 391 +#define YYNTOKENS 406 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 107 /* YYNRULES -- Number of rules. */ -#define YYNRULES 556 +#define YYNRULES 571 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 697 +#define YYNSTATES 712 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 645 +#define YYMAXUTOK 660 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -893,69 +929,73 @@ static const yytype_uint16 yytranslate[] = 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 390 + 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 293, 293, 299, 302, 306, 310, 313, 317, 321, - 325, 329, 333, 336, 340, 344, 347, 355, 358, 361, - 364, 367, 372, 380, 387, 394, 400, 404, 411, 414, - 420, 427, 437, 445, 450, 477, 485, 491, 495, 499, - 519, 520, 521, 522, 528, 529, 534, 539, 548, 549, - 554, 562, 563, 569, 578, 579, 584, 589, 594, 602, - 603, 611, 622, 623, 632, 633, 642, 643, 652, 653, - 661, 662, 670, 671, 679, 680, 680, 698, 699, 714, - 718, 722, 726, 731, 735, 739, 743, 747, 751, 755, - 762, 765, 776, 783, 788, 793, 801, 805, 809, 813, - 818, 823, 832, 832, 843, 847, 854, 861, 864, 871, - 879, 899, 922, 937, 962, 973, 983, 993, 1003, 1012, - 1015, 1019, 1023, 1028, 1036, 1041, 1046, 1051, 1056, 1065, - 1076, 1103, 1112, 1119, 1126, 1137, 1149, 1155, 1158, 1165, - 1169, 1173, 1181, 1190, 1193, 1204, 1207, 1210, 1214, 1218, - 1222, 1226, 1232, 1236, 1248, 1262, 1267, 1273, 1279, 1286, - 1292, 1297, 1302, 1307, 1315, 1319, 1323, 1327, 1331, 1335, - 1341, 1350, 1357, 1360, 1368, 1372, 1381, 1386, 1394, 1398, - 1408, 1412, 1416, 1421, 1426, 1431, 1436, 1440, 1445, 1450, - 1455, 1460, 1465, 1470, 1475, 1480, 1485, 1489, 1494, 1499, - 1504, 1510, 1516, 1522, 1528, 1534, 1540, 1546, 1552, 1558, - 1564, 1570, 1576, 1581, 1586, 1591, 1596, 1601, 1606, 1612, - 1618, 1624, 1630, 1636, 1642, 1648, 1654, 1660, 1666, 1672, - 1678, 1684, 1690, 1696, 1702, 1708, 1714, 1720, 1726, 1732, - 1738, 1744, 1750, 1756, 1762, 1768, 1773, 1778, 1783, 1788, - 1793, 1798, 1803, 1808, 1813, 1818, 1823, 1828, 1834, 1840, - 1846, 1852, 1858, 1864, 1870, 1876, 1882, 1888, 1894, 1900, - 1906, 1912, 1918, 1924, 1930, 1936, 1942, 1948, 1954, 1960, - 1966, 1972, 1978, 1984, 1990, 1996, 2002, 2008, 2014, 2020, - 2026, 2032, 2038, 2044, 2050, 2056, 2062, 2068, 2074, 2080, - 2086, 2092, 2098, 2104, 2110, 2116, 2121, 2126, 2131, 2136, - 2141, 2146, 2151, 2156, 2161, 2166, 2171, 2176, 2181, 2186, - 2194, 2202, 2210, 2218, 2226, 2234, 2242, 2250, 2258, 2266, - 2274, 2282, 2290, 2295, 2300, 2305, 2310, 2315, 2320, 2325, - 2330, 2335, 2340, 2345, 2350, 2355, 2360, 2365, 2370, 2378, - 2386, 2391, 2396, 2401, 2409, 2414, 2419, 2424, 2432, 2437, - 2442, 2447, 2455, 2460, 2465, 2470, 2475, 2480, 2488, 2493, - 2501, 2506, 2514, 2519, 2527, 2532, 2540, 2545, 2553, 2558, - 2566, 2571, 2576, 2581, 2586, 2591, 2596, 2601, 2606, 2611, - 2616, 2621, 2626, 2631, 2636, 2641, 2649, 2654, 2659, 2664, - 2672, 2677, 2682, 2687, 2695, 2700, 2705, 2710, 2718, 2723, - 2728, 2733, 2741, 2746, 2751, 2756, 2764, 2769, 2774, 2779, - 2787, 2792, 2797, 2802, 2810, 2815, 2820, 2825, 2833, 2838, - 2843, 2848, 2856, 2861, 2866, 2871, 2879, 2884, 2889, 2894, - 2902, 2907, 2912, 2917, 2925, 2930, 2935, 2940, 2948, 2953, - 2958, 2963, 2971, 2976, 2981, 2987, 2993, 2999, 3008, 3017, - 3023, 3029, 3035, 3041, 3046, 3062, 3067, 3072, 3080, 3080, - 3091, 3091, 3101, 3104, 3117, 3139, 3166, 3170, 3176, 3181, - 3192, 3195, 3201, 3210, 3213, 3219, 3223, 3224, 3230, 3231, - 3232, 3233, 3234, 3235, 3236, 3240, 3241, 3245, 3241, 3257, - 3258, 3262, 3262, 3269, 3269, 3283, 3286, 3294, 3302, 3313, - 3314, 3318, 3321, 3327, 3334, 3338, 3346, 3350, 3363, 3366, - 3372, 3372, 3392, 3395, 3401, 3413, 3425, 3428, 3434, 3434, - 3449, 3449, 3465, 3465, 3486, 3489, 3495, 3498, 3504, 3508, - 3515, 3520, 3525, 3532, 3535, 3544, 3548, 3557, 3560, 3563, - 3571, 3571, 3593, 3599, 3602, 3607, 3610 + 0, 294, 294, 300, 303, 307, 311, 314, 318, 322, + 326, 330, 334, 337, 341, 345, 348, 356, 359, 362, + 365, 368, 373, 381, 388, 395, 401, 405, 412, 415, + 421, 428, 438, 446, 451, 478, 486, 492, 496, 500, + 520, 521, 522, 523, 529, 530, 535, 540, 549, 550, + 555, 563, 564, 570, 579, 580, 585, 590, 595, 603, + 604, 612, 623, 624, 633, 634, 643, 644, 653, 654, + 662, 663, 671, 672, 680, 681, 681, 699, 700, 716, + 720, 724, 728, 733, 737, 741, 745, 749, 753, 757, + 764, 767, 778, 785, 790, 795, 803, 807, 811, 815, + 820, 825, 834, 834, 845, 849, 856, 863, 866, 873, + 881, 901, 924, 939, 964, 975, 985, 995, 1005, 1014, + 1017, 1021, 1025, 1030, 1038, 1043, 1048, 1053, 1058, 1067, + 1078, 1105, 1114, 1121, 1128, 1139, 1148, 1158, 1170, 1179, + 1191, 1197, 1200, 1207, 1211, 1215, 1223, 1232, 1235, 1246, + 1249, 1252, 1256, 1260, 1264, 1268, 1274, 1278, 1290, 1304, + 1309, 1315, 1321, 1328, 1334, 1339, 1344, 1349, 1359, 1369, + 1379, 1389, 1398, 1410, 1414, 1419, 1424, 1429, 1434, 1439, + 1443, 1447, 1451, 1455, 1461, 1470, 1477, 1480, 1488, 1492, + 1501, 1506, 1514, 1518, 1528, 1532, 1536, 1541, 1546, 1551, + 1556, 1560, 1565, 1570, 1575, 1580, 1585, 1590, 1595, 1600, + 1605, 1609, 1614, 1619, 1624, 1630, 1636, 1642, 1648, 1654, + 1660, 1666, 1672, 1678, 1684, 1690, 1696, 1701, 1706, 1711, + 1716, 1721, 1726, 1732, 1738, 1744, 1750, 1756, 1762, 1768, + 1774, 1780, 1786, 1792, 1798, 1804, 1810, 1816, 1822, 1828, + 1834, 1840, 1846, 1852, 1858, 1864, 1870, 1876, 1882, 1888, + 1893, 1898, 1903, 1908, 1913, 1918, 1923, 1928, 1933, 1938, + 1943, 1948, 1954, 1960, 1966, 1972, 1978, 1984, 1990, 1996, + 2002, 2008, 2014, 2020, 2026, 2032, 2038, 2044, 2050, 2056, + 2062, 2068, 2074, 2080, 2086, 2092, 2098, 2104, 2110, 2116, + 2122, 2128, 2134, 2140, 2146, 2152, 2158, 2164, 2170, 2176, + 2182, 2188, 2194, 2200, 2206, 2212, 2218, 2224, 2230, 2236, + 2242, 2247, 2252, 2257, 2262, 2267, 2272, 2277, 2282, 2287, + 2292, 2297, 2302, 2307, 2312, 2320, 2328, 2336, 2344, 2352, + 2360, 2368, 2376, 2384, 2392, 2400, 2408, 2416, 2421, 2426, + 2431, 2436, 2441, 2446, 2451, 2456, 2461, 2466, 2471, 2476, + 2481, 2486, 2491, 2496, 2504, 2512, 2517, 2522, 2527, 2535, + 2540, 2545, 2550, 2558, 2563, 2568, 2573, 2581, 2586, 2591, + 2596, 2601, 2606, 2614, 2619, 2627, 2632, 2640, 2645, 2653, + 2658, 2666, 2671, 2679, 2684, 2692, 2697, 2702, 2707, 2712, + 2717, 2722, 2727, 2732, 2737, 2742, 2747, 2752, 2757, 2762, + 2767, 2775, 2780, 2785, 2790, 2798, 2803, 2808, 2813, 2821, + 2826, 2831, 2836, 2844, 2849, 2854, 2859, 2867, 2872, 2877, + 2882, 2890, 2895, 2900, 2905, 2913, 2918, 2923, 2928, 2936, + 2941, 2946, 2951, 2959, 2964, 2969, 2974, 2982, 2987, 2992, + 2997, 3005, 3010, 3015, 3020, 3028, 3033, 3038, 3043, 3051, + 3056, 3061, 3066, 3074, 3079, 3084, 3089, 3097, 3102, 3107, + 3113, 3119, 3125, 3134, 3143, 3149, 3155, 3161, 3167, 3172, + 3188, 3193, 3198, 3206, 3206, 3217, 3217, 3227, 3230, 3243, + 3265, 3292, 3296, 3302, 3307, 3318, 3321, 3327, 3336, 3339, + 3345, 3349, 3350, 3356, 3357, 3358, 3359, 3360, 3361, 3362, + 3366, 3367, 3371, 3367, 3383, 3384, 3388, 3388, 3395, 3395, + 3409, 3412, 3420, 3428, 3439, 3440, 3444, 3447, 3453, 3460, + 3464, 3472, 3476, 3489, 3492, 3498, 3498, 3518, 3521, 3527, + 3539, 3551, 3554, 3560, 3560, 3575, 3575, 3591, 3591, 3612, + 3615, 3621, 3624, 3630, 3634, 3641, 3646, 3651, 3658, 3661, + 3670, 3674, 3683, 3686, 3689, 3697, 3697, 3719, 3725, 3728, + 3733, 3736 }; #endif @@ -976,36 +1016,40 @@ static const char *const yytname[] = "U16VEC3", "U16VEC4", "I8VEC2", "I8VEC3", "I8VEC4", "U8VEC2", "U8VEC3", "U8VEC4", "VEC2", "VEC3", "VEC4", "MAT2", "MAT3", "MAT4", "CENTROID", "IN", "OUT", "INOUT", "UNIFORM", "PATCH", "SAMPLE", "BUFFER", "SHARED", - "NONUNIFORM", "COHERENT", "VOLATILE", "RESTRICT", "READONLY", - "WRITEONLY", "DVEC2", "DVEC3", "DVEC4", "DMAT2", "DMAT3", "DMAT4", - "F16VEC2", "F16VEC3", "F16VEC4", "F16MAT2", "F16MAT3", "F16MAT4", - "F32VEC2", "F32VEC3", "F32VEC4", "F32MAT2", "F32MAT3", "F32MAT4", - "F64VEC2", "F64VEC3", "F64VEC4", "F64MAT2", "F64MAT3", "F64MAT4", - "NOPERSPECTIVE", "FLAT", "SMOOTH", "LAYOUT", "__EXPLICITINTERPAMD", - "MAT2X2", "MAT2X3", "MAT2X4", "MAT3X2", "MAT3X3", "MAT3X4", "MAT4X2", - "MAT4X3", "MAT4X4", "DMAT2X2", "DMAT2X3", "DMAT2X4", "DMAT3X2", - "DMAT3X3", "DMAT3X4", "DMAT4X2", "DMAT4X3", "DMAT4X4", "F16MAT2X2", - "F16MAT2X3", "F16MAT2X4", "F16MAT3X2", "F16MAT3X3", "F16MAT3X4", - "F16MAT4X2", "F16MAT4X3", "F16MAT4X4", "F32MAT2X2", "F32MAT2X3", - "F32MAT2X4", "F32MAT3X2", "F32MAT3X3", "F32MAT3X4", "F32MAT4X2", - "F32MAT4X3", "F32MAT4X4", "F64MAT2X2", "F64MAT2X3", "F64MAT2X4", - "F64MAT3X2", "F64MAT3X3", "F64MAT3X4", "F64MAT4X2", "F64MAT4X3", - "F64MAT4X4", "ATOMIC_UINT", "SAMPLER1D", "SAMPLER2D", "SAMPLER3D", - "SAMPLERCUBE", "SAMPLER1DSHADOW", "SAMPLER2DSHADOW", "SAMPLERCUBESHADOW", - "SAMPLER1DARRAY", "SAMPLER2DARRAY", "SAMPLER1DARRAYSHADOW", - "SAMPLER2DARRAYSHADOW", "ISAMPLER1D", "ISAMPLER2D", "ISAMPLER3D", - "ISAMPLERCUBE", "ISAMPLER1DARRAY", "ISAMPLER2DARRAY", "USAMPLER1D", - "USAMPLER2D", "USAMPLER3D", "USAMPLERCUBE", "USAMPLER1DARRAY", - "USAMPLER2DARRAY", "SAMPLER2DRECT", "SAMPLER2DRECTSHADOW", - "ISAMPLER2DRECT", "USAMPLER2DRECT", "SAMPLERBUFFER", "ISAMPLERBUFFER", - "USAMPLERBUFFER", "SAMPLERCUBEARRAY", "SAMPLERCUBEARRAYSHADOW", - "ISAMPLERCUBEARRAY", "USAMPLERCUBEARRAY", "SAMPLER2DMS", "ISAMPLER2DMS", - "USAMPLER2DMS", "SAMPLER2DMSARRAY", "ISAMPLER2DMSARRAY", - "USAMPLER2DMSARRAY", "SAMPLEREXTERNALOES", "F16SAMPLER1D", - "F16SAMPLER2D", "F16SAMPLER3D", "F16SAMPLER2DRECT", "F16SAMPLERCUBE", - "F16SAMPLER1DARRAY", "F16SAMPLER2DARRAY", "F16SAMPLERCUBEARRAY", - "F16SAMPLERBUFFER", "F16SAMPLER2DMS", "F16SAMPLER2DMSARRAY", - "F16SAMPLER1DSHADOW", "F16SAMPLER2DSHADOW", "F16SAMPLER1DARRAYSHADOW", + "NONUNIFORM", "PAYLOADNV", "PAYLOADINNV", "HITATTRNV", "CALLDATANV", + "CALLDATAINNV", "COHERENT", "VOLATILE", "RESTRICT", "READONLY", + "WRITEONLY", "DEVICECOHERENT", "QUEUEFAMILYCOHERENT", + "WORKGROUPCOHERENT", "SUBGROUPCOHERENT", "NONPRIVATE", "DVEC2", "DVEC3", + "DVEC4", "DMAT2", "DMAT3", "DMAT4", "F16VEC2", "F16VEC3", "F16VEC4", + "F16MAT2", "F16MAT3", "F16MAT4", "F32VEC2", "F32VEC3", "F32VEC4", + "F32MAT2", "F32MAT3", "F32MAT4", "F64VEC2", "F64VEC3", "F64VEC4", + "F64MAT2", "F64MAT3", "F64MAT4", "NOPERSPECTIVE", "FLAT", "SMOOTH", + "LAYOUT", "EXPLICITINTERPAMD", "PERVERTEXNV", "PERPRIMITIVENV", + "PERVIEWNV", "PERTASKNV", "MAT2X2", "MAT2X3", "MAT2X4", "MAT3X2", + "MAT3X3", "MAT3X4", "MAT4X2", "MAT4X3", "MAT4X4", "DMAT2X2", "DMAT2X3", + "DMAT2X4", "DMAT3X2", "DMAT3X3", "DMAT3X4", "DMAT4X2", "DMAT4X3", + "DMAT4X4", "F16MAT2X2", "F16MAT2X3", "F16MAT2X4", "F16MAT3X2", + "F16MAT3X3", "F16MAT3X4", "F16MAT4X2", "F16MAT4X3", "F16MAT4X4", + "F32MAT2X2", "F32MAT2X3", "F32MAT2X4", "F32MAT3X2", "F32MAT3X3", + "F32MAT3X4", "F32MAT4X2", "F32MAT4X3", "F32MAT4X4", "F64MAT2X2", + "F64MAT2X3", "F64MAT2X4", "F64MAT3X2", "F64MAT3X3", "F64MAT3X4", + "F64MAT4X2", "F64MAT4X3", "F64MAT4X4", "ATOMIC_UINT", "ACCSTRUCTNV", + "SAMPLER1D", "SAMPLER2D", "SAMPLER3D", "SAMPLERCUBE", "SAMPLER1DSHADOW", + "SAMPLER2DSHADOW", "SAMPLERCUBESHADOW", "SAMPLER1DARRAY", + "SAMPLER2DARRAY", "SAMPLER1DARRAYSHADOW", "SAMPLER2DARRAYSHADOW", + "ISAMPLER1D", "ISAMPLER2D", "ISAMPLER3D", "ISAMPLERCUBE", + "ISAMPLER1DARRAY", "ISAMPLER2DARRAY", "USAMPLER1D", "USAMPLER2D", + "USAMPLER3D", "USAMPLERCUBE", "USAMPLER1DARRAY", "USAMPLER2DARRAY", + "SAMPLER2DRECT", "SAMPLER2DRECTSHADOW", "ISAMPLER2DRECT", + "USAMPLER2DRECT", "SAMPLERBUFFER", "ISAMPLERBUFFER", "USAMPLERBUFFER", + "SAMPLERCUBEARRAY", "SAMPLERCUBEARRAYSHADOW", "ISAMPLERCUBEARRAY", + "USAMPLERCUBEARRAY", "SAMPLER2DMS", "ISAMPLER2DMS", "USAMPLER2DMS", + "SAMPLER2DMSARRAY", "ISAMPLER2DMSARRAY", "USAMPLER2DMSARRAY", + "SAMPLEREXTERNALOES", "F16SAMPLER1D", "F16SAMPLER2D", "F16SAMPLER3D", + "F16SAMPLER2DRECT", "F16SAMPLERCUBE", "F16SAMPLER1DARRAY", + "F16SAMPLER2DARRAY", "F16SAMPLERCUBEARRAY", "F16SAMPLERBUFFER", + "F16SAMPLER2DMS", "F16SAMPLER2DMSARRAY", "F16SAMPLER1DSHADOW", + "F16SAMPLER2DSHADOW", "F16SAMPLER1DARRAYSHADOW", "F16SAMPLER2DARRAYSHADOW", "F16SAMPLER2DRECTSHADOW", "F16SAMPLERCUBESHADOW", "F16SAMPLERCUBEARRAYSHADOW", "SAMPLER", "SAMPLERSHADOW", "TEXTURE1D", "TEXTURE2D", "TEXTURE3D", "TEXTURECUBE", @@ -1082,7 +1126,7 @@ static const char *const yytname[] = "for_init_statement", "conditionopt", "for_rest_statement", "jump_statement", "translation_unit", "external_declaration", "function_definition", "$@13", "attribute", "attribute_list", - "single_attribute", YY_NULL + "single_attribute", YY_NULLPTR }; #endif @@ -1130,16 +1174,17 @@ static const yytype_uint16 yytoknum[] = 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645 + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, + 655, 656, 657, 658, 659, 660 }; # endif -#define YYPACT_NINF -634 +#define YYPACT_NINF -649 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-634))) + (!!((Yystate) == (-649))) -#define YYTABLE_NINF -502 +#define YYTABLE_NINF -517 #define yytable_value_is_error(Yytable_value) \ 0 @@ -1148,76 +1193,78 @@ static const yytype_uint16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - 3391, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -311, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -295, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, -634, -301, -634, -634, - -634, -634, -634, -634, -634, -634, -241, -634, -302, -342, - -290, -254, 5696, -300, -634, -210, -634, -634, -634, -634, - 4160, -634, -634, -634, -634, -219, -634, -634, 696, -634, - -634, -189, -69, -207, -634, 8625, -320, -634, -634, -203, - -634, 5696, -634, -634, -634, 5696, -155, -154, -634, -324, - -288, -634, -634, -634, 6417, -190, -634, -634, -634, -292, - -634, -196, -287, -634, -634, 5696, -195, -634, -306, 1081, - -634, -634, -634, -634, -219, -325, -634, 6785, -310, -634, - -151, -634, -277, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, 7889, 7889, 7889, -634, - -634, -634, -634, -634, -634, -634, -309, -634, -634, -634, - -185, -283, 8257, -183, -634, 7889, -227, -263, -299, -318, - -194, -204, -202, -200, -165, -166, -321, -179, -634, -634, - 7153, -634, -140, 7889, -634, -69, 5696, 5696, -139, 4544, - -634, -634, -634, -182, -180, -634, -173, -169, -178, 7521, - -164, 7889, -174, -163, -167, -162, -634, -634, -252, -634, - -634, -237, -634, -342, -161, -158, -634, -634, -634, -634, - 1466, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -19, -190, 6785, -296, 6785, -634, -634, 6785, 5696, -634, - -127, -634, -634, -634, -278, -634, -634, 7889, -121, -634, - -634, 7889, -156, -634, -634, -634, 7889, 7889, 7889, 7889, - 7889, 7889, 7889, 7889, 7889, 7889, 7889, 7889, 7889, 7889, - 7889, 7889, 7889, 7889, 7889, -634, -634, -634, -157, -634, - -634, -634, -634, 4928, -139, -219, -236, -634, -634, -634, - -634, -634, 1851, -634, 7889, -634, -634, -230, 7889, -213, - -634, -634, -118, -634, 1851, -634, -634, -634, -634, -634, - -634, -634, -634, -634, -634, -634, 7889, 7889, -634, -634, - -634, -634, -634, -634, -634, 6785, -634, -270, -634, 5312, - -634, -634, -153, -150, -634, -634, -634, -634, -634, -227, - -227, -263, -263, -299, -299, -299, -299, -318, -318, -194, - -204, -202, -200, -165, -166, 7889, -634, -634, -226, -190, - -139, -634, -113, 3006, -275, -634, -253, -634, 3776, -148, - -282, -634, 1851, -634, -634, -634, -634, 6049, -634, -634, - -208, -634, -634, -147, -634, -634, 3776, -146, -634, -150, - -111, 5696, -145, 7889, -144, -118, -143, -634, -634, 7889, - 7889, -634, -149, -141, 196, -136, 2621, -634, -116, -120, - 2236, -137, -634, -634, -634, -634, -239, 7889, 2236, -146, - -634, -634, 1851, 6785, -634, -634, -634, -634, -119, -150, - -634, -634, 1851, -112, -634, -634, -634 + 3511, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -326, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -310, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -316, -649, -649, -649, -649, -649, -649, -649, + -649, -256, -649, -317, -357, -305, -269, 5906, -315, -649, + -225, -649, -649, -649, -649, 4310, -649, -649, -649, -649, + -234, -649, -649, 711, -649, -649, -204, -69, -222, -649, + 8955, -335, -649, -649, -218, -649, 5906, -649, -649, -649, + 5906, -170, -169, -649, -339, -303, -649, -649, -649, 6657, + -205, -649, -649, -649, -307, -649, -211, -302, -649, -649, + 5906, -210, -649, -321, 1111, -649, -649, -649, -649, -234, + -340, -649, 7040, -325, -649, -166, -649, -292, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, 8189, 8189, 8189, -649, -649, -649, -649, -649, -649, + -649, -324, -649, -649, -649, -200, -298, 8572, -198, -649, + 8189, -242, -278, -314, -333, -209, -219, -217, -215, -180, + -181, -336, -194, -649, -649, 7423, -649, -155, 8189, -649, + -69, 5906, 5906, -154, 4709, -649, -649, -649, -197, -195, + -649, -188, -184, -193, 7806, -179, 8189, -189, -178, -182, + -177, -649, -649, -267, -649, -649, -252, -649, -357, -176, + -173, -649, -649, -649, -649, 1511, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -19, -205, 7040, -311, 7040, + -649, -649, 7040, 5906, -649, -142, -649, -649, -649, -293, + -649, -649, 8189, -136, -649, -649, 8189, -171, -649, -649, + -649, 8189, 8189, 8189, 8189, 8189, 8189, 8189, 8189, 8189, + 8189, 8189, 8189, 8189, 8189, 8189, 8189, 8189, 8189, 8189, + -649, -649, -649, -172, -649, -649, -649, -649, 5108, -154, + -234, -251, -649, -649, -649, -649, -649, 1911, -649, 8189, + -649, -649, -245, 8189, -228, -649, -649, -133, -649, 1911, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, 8189, 8189, -649, -649, -649, -649, -649, -649, -649, + 7040, -649, -285, -649, 5507, -649, -649, -168, -165, -649, + -649, -649, -649, -649, -242, -242, -278, -278, -314, -314, + -314, -314, -333, -333, -209, -219, -217, -215, -180, -181, + 8189, -649, -649, -241, -205, -154, -649, -128, 3111, -290, + -649, -268, -649, 3911, -163, -297, -649, 1911, -649, -649, + -649, -649, 6274, -649, -649, -223, -649, -649, -162, -649, + -649, 3911, -161, -649, -165, -126, 5906, -160, 8189, -159, + -133, -158, -649, -649, 8189, 8189, -649, -164, -156, 196, + -151, 2711, -649, -131, -135, 2311, -152, -649, -649, -649, + -649, -254, 8189, 2311, -161, -649, -649, 1911, 7040, -649, + -649, -649, -649, -134, -165, -649, -649, 1911, -127, -649, + -649, -649 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1225,108 +1272,110 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_uint16 yydefact[] = { - 0, 153, 154, 183, 181, 184, 182, 185, 152, 196, - 186, 187, 194, 195, 192, 193, 190, 191, 188, 189, - 169, 212, 213, 214, 215, 216, 217, 230, 231, 232, - 227, 228, 229, 242, 243, 244, 224, 225, 226, 239, - 240, 241, 221, 222, 223, 236, 237, 238, 218, 219, - 220, 233, 234, 235, 197, 198, 199, 245, 246, 247, - 158, 156, 157, 155, 161, 159, 160, 162, 163, 171, - 164, 165, 166, 167, 168, 200, 201, 202, 257, 258, - 259, 203, 204, 205, 269, 270, 271, 206, 207, 208, - 281, 282, 283, 209, 210, 211, 293, 294, 295, 134, - 133, 132, 0, 135, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 332, 333, 334, 335, 336, 337, 339, 340, 341, - 342, 343, 344, 346, 347, 350, 351, 352, 354, 355, - 317, 318, 338, 345, 356, 358, 359, 360, 362, 363, - 454, 319, 320, 321, 348, 322, 326, 327, 330, 353, - 357, 361, 323, 324, 328, 329, 349, 325, 331, 364, - 365, 366, 368, 370, 372, 374, 376, 380, 381, 382, - 383, 384, 385, 387, 388, 389, 390, 391, 392, 394, - 396, 397, 398, 400, 401, 378, 386, 393, 402, 404, - 405, 406, 408, 409, 367, 369, 371, 395, 373, 375, - 377, 379, 399, 403, 407, 455, 456, 459, 460, 461, - 462, 457, 458, 410, 412, 413, 414, 416, 417, 418, - 420, 421, 422, 424, 425, 426, 428, 429, 430, 432, - 433, 434, 436, 437, 438, 440, 441, 442, 444, 445, - 446, 448, 449, 450, 452, 453, 411, 415, 419, 423, - 427, 435, 439, 443, 431, 447, 451, 0, 180, 464, - 549, 131, 142, 465, 466, 467, 0, 548, 0, 550, - 0, 108, 107, 0, 119, 124, 149, 148, 146, 150, - 0, 143, 145, 151, 129, 174, 147, 463, 0, 545, - 547, 0, 0, 0, 470, 0, 0, 96, 93, 0, - 106, 0, 115, 109, 117, 0, 118, 0, 94, 125, - 0, 99, 144, 130, 0, 175, 1, 546, 172, 0, - 141, 139, 0, 137, 468, 0, 0, 97, 0, 0, - 551, 110, 114, 116, 112, 120, 111, 0, 126, 102, - 0, 100, 0, 2, 12, 13, 10, 11, 4, 5, - 6, 7, 8, 9, 15, 14, 0, 0, 0, 176, - 42, 41, 43, 40, 3, 17, 36, 19, 24, 25, - 0, 0, 29, 0, 44, 0, 48, 51, 54, 59, - 62, 64, 66, 68, 70, 72, 74, 0, 35, 33, - 0, 170, 0, 0, 136, 0, 0, 0, 0, 0, - 472, 95, 98, 0, 0, 530, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 496, 505, 509, 44, 77, - 90, 0, 485, 0, 151, 129, 488, 507, 487, 486, - 0, 489, 490, 511, 491, 518, 492, 493, 526, 494, - 0, 113, 0, 121, 0, 480, 128, 0, 0, 104, - 0, 101, 37, 38, 0, 21, 22, 0, 0, 27, - 26, 0, 180, 30, 32, 39, 0, 0, 0, 0, + 0, 157, 158, 197, 195, 198, 196, 199, 156, 210, + 200, 201, 208, 209, 206, 207, 204, 205, 202, 203, + 183, 226, 227, 228, 229, 230, 231, 244, 245, 246, + 241, 242, 243, 256, 257, 258, 238, 239, 240, 253, + 254, 255, 235, 236, 237, 250, 251, 252, 232, 233, + 234, 247, 248, 249, 211, 212, 213, 259, 260, 261, + 162, 160, 161, 159, 165, 163, 164, 166, 172, 185, + 168, 169, 167, 170, 171, 173, 179, 180, 181, 182, + 174, 175, 176, 177, 178, 214, 215, 216, 271, 272, + 273, 217, 218, 219, 283, 284, 285, 220, 221, 222, + 295, 296, 297, 223, 224, 225, 307, 308, 309, 134, + 133, 132, 0, 135, 136, 137, 138, 139, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 320, 319, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 347, 348, 349, 350, + 351, 352, 354, 355, 356, 357, 358, 359, 361, 362, + 365, 366, 367, 369, 370, 332, 333, 353, 360, 371, + 373, 374, 375, 377, 378, 469, 334, 335, 336, 363, + 337, 341, 342, 345, 368, 372, 376, 338, 339, 343, + 344, 364, 340, 346, 379, 380, 381, 383, 385, 387, + 389, 391, 395, 396, 397, 398, 399, 400, 402, 403, + 404, 405, 406, 407, 409, 411, 412, 413, 415, 416, + 393, 401, 408, 417, 419, 420, 421, 423, 424, 382, + 384, 386, 410, 388, 390, 392, 394, 414, 418, 422, + 470, 471, 474, 475, 476, 477, 472, 473, 425, 427, + 428, 429, 431, 432, 433, 435, 436, 437, 439, 440, + 441, 443, 444, 445, 447, 448, 449, 451, 452, 453, + 455, 456, 457, 459, 460, 461, 463, 464, 465, 467, + 468, 426, 430, 434, 438, 442, 450, 454, 458, 446, + 462, 466, 0, 194, 479, 564, 131, 146, 480, 481, + 482, 0, 563, 0, 565, 0, 108, 107, 0, 119, + 124, 153, 152, 150, 154, 0, 147, 149, 155, 129, + 188, 151, 478, 0, 560, 562, 0, 0, 0, 485, + 0, 0, 96, 93, 0, 106, 0, 115, 109, 117, + 0, 118, 0, 94, 125, 0, 99, 148, 130, 0, + 189, 1, 561, 186, 0, 145, 143, 0, 141, 483, + 0, 0, 97, 0, 0, 566, 110, 114, 116, 112, + 120, 111, 0, 126, 102, 0, 100, 0, 2, 12, + 13, 10, 11, 4, 5, 6, 7, 8, 9, 15, + 14, 0, 0, 0, 190, 42, 41, 43, 40, 3, + 17, 36, 19, 24, 25, 0, 0, 29, 0, 44, + 0, 48, 51, 54, 59, 62, 64, 66, 68, 70, + 72, 74, 0, 35, 33, 0, 184, 0, 0, 140, + 0, 0, 0, 0, 0, 487, 95, 98, 0, 0, + 545, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 511, 520, 524, 44, 77, 90, 0, 500, 0, 155, + 129, 503, 522, 502, 501, 0, 504, 505, 526, 506, + 533, 507, 508, 541, 509, 0, 113, 0, 121, 0, + 495, 128, 0, 0, 104, 0, 101, 37, 38, 0, + 21, 22, 0, 0, 27, 26, 0, 194, 30, 32, + 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 75, 177, 178, 0, 173, - 92, 140, 138, 0, 0, 478, 0, 476, 471, 473, - 541, 540, 0, 532, 0, 544, 542, 0, 0, 0, - 525, 528, 0, 495, 0, 80, 81, 83, 82, 85, - 86, 87, 88, 89, 84, 79, 0, 0, 510, 506, - 508, 512, 519, 527, 123, 0, 483, 0, 127, 0, - 105, 16, 0, 23, 20, 31, 45, 46, 47, 50, - 49, 52, 53, 57, 58, 55, 56, 60, 61, 63, - 65, 67, 69, 71, 73, 0, 179, 469, 0, 479, - 0, 474, 0, 0, 0, 543, 0, 524, 0, 555, - 0, 553, 497, 78, 91, 122, 481, 0, 103, 18, - 0, 475, 477, 0, 535, 534, 537, 503, 520, 516, - 0, 0, 0, 0, 0, 0, 0, 482, 484, 0, - 0, 536, 0, 0, 515, 0, 0, 513, 0, 0, - 0, 0, 552, 554, 498, 76, 0, 538, 0, 503, - 502, 504, 522, 0, 500, 529, 499, 556, 0, 539, - 533, 514, 523, 0, 517, 531, 521 + 75, 191, 192, 0, 187, 92, 144, 142, 0, 0, + 493, 0, 491, 486, 488, 556, 555, 0, 547, 0, + 559, 557, 0, 0, 0, 540, 543, 0, 510, 0, + 80, 81, 83, 82, 85, 86, 87, 88, 89, 84, + 79, 0, 0, 525, 521, 523, 527, 534, 542, 123, + 0, 498, 0, 127, 0, 105, 16, 0, 23, 20, + 31, 45, 46, 47, 50, 49, 52, 53, 57, 58, + 55, 56, 60, 61, 63, 65, 67, 69, 71, 73, + 0, 193, 484, 0, 494, 0, 489, 0, 0, 0, + 558, 0, 539, 0, 570, 0, 568, 512, 78, 91, + 122, 496, 0, 103, 18, 0, 490, 492, 0, 550, + 549, 552, 518, 535, 531, 0, 0, 0, 0, 0, + 0, 0, 497, 499, 0, 0, 551, 0, 0, 530, + 0, 0, 528, 0, 0, 0, 0, 567, 569, 513, + 76, 0, 553, 0, 518, 517, 519, 537, 0, 515, + 544, 514, 571, 0, 554, 548, 529, 538, 0, 532, + 546, 536 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, - -634, -634, -289, -634, -358, -355, -401, -364, -279, -307, - -276, -280, -273, -281, -634, -354, -634, -378, -634, -367, - -397, 1, -634, -634, -634, 2, -634, -634, -634, -98, - -93, -92, -634, -634, -600, -634, -634, -634, -634, -181, - -634, -319, -326, -634, 6, -634, 0, -332, -634, -54, - -634, -634, -634, -428, -433, -272, -353, -477, -634, -357, - -467, -633, -400, -634, -634, -410, -408, -634, -634, -80, - -545, -350, -634, -216, -634, -371, -634, -214, -634, -634, - -634, -634, -212, -634, -634, -634, -634, -634, -634, -634, - -634, -61, -634, -634, -634, -634, -375 + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -304, -649, -373, -370, -416, -379, -294, -322, + -291, -295, -288, -296, -649, -369, -649, -393, -649, -382, + -414, 1, -649, -649, -649, 2, -649, -649, -649, -114, + -109, -112, -649, -649, -615, -649, -649, -649, -649, -196, + -649, -334, -341, -649, 6, -649, 0, -347, -649, -68, + -649, -649, -649, -443, -448, -287, -368, -492, -649, -376, + -482, -648, -415, -649, -649, -427, -426, -649, -649, -93, + -560, -365, -649, -231, -649, -386, -649, -229, -649, -649, + -649, -649, -227, -649, -649, -649, -649, -649, -649, -649, + -649, -76, -649, -649, -649, -649, -390 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 414, 415, 416, 592, 417, 418, 419, 420, 421, - 422, 423, 468, 425, 426, 427, 428, 429, 430, 431, - 432, 433, 434, 435, 436, 469, 615, 470, 576, 471, - 541, 472, 318, 498, 392, 473, 320, 321, 322, 352, - 353, 354, 323, 324, 325, 326, 327, 328, 372, 373, - 329, 330, 331, 332, 438, 369, 439, 365, 335, 336, - 337, 446, 375, 449, 450, 546, 547, 496, 587, 476, - 477, 478, 479, 564, 656, 685, 664, 665, 666, 686, - 480, 481, 482, 483, 667, 652, 484, 485, 668, 693, - 486, 487, 488, 628, 552, 623, 646, 662, 663, 489, - 338, 339, 340, 349, 490, 630, 631 + -1, 429, 430, 431, 607, 432, 433, 434, 435, 436, + 437, 438, 483, 440, 441, 442, 443, 444, 445, 446, + 447, 448, 449, 450, 451, 484, 630, 485, 591, 486, + 556, 487, 333, 513, 407, 488, 335, 336, 337, 367, + 368, 369, 338, 339, 340, 341, 342, 343, 387, 388, + 344, 345, 346, 347, 453, 384, 454, 380, 350, 351, + 352, 461, 390, 464, 465, 561, 562, 511, 602, 491, + 492, 493, 494, 579, 671, 700, 679, 680, 681, 701, + 495, 496, 497, 498, 682, 667, 499, 500, 683, 708, + 501, 502, 503, 643, 567, 638, 661, 677, 678, 504, + 353, 354, 355, 364, 505, 645, 646 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1334,118 +1383,121 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 334, 317, 319, 355, 362, 455, 333, 456, 457, 495, - 437, 460, 370, 580, 378, 584, 549, 586, 543, 632, - 588, 346, 343, 523, 524, 534, 348, 388, 650, 362, - 505, 506, 355, 681, 386, 364, 364, 684, 521, 522, - 364, 504, 492, 387, 513, 684, 650, 341, 377, -34, - 440, 507, 491, 493, 440, 508, 447, 497, 525, 526, - 535, 344, 452, 342, 440, 357, 347, 441, 358, 350, - 589, 585, 444, 442, 389, 424, 510, 390, 445, 654, - 391, 591, 511, 655, 647, 622, 538, 577, 500, 540, - 577, 501, 557, 636, 559, 637, 565, 566, 567, 568, - 569, 570, 571, 572, 573, 574, 648, 519, 635, 520, - 549, 351, 577, 359, 495, 575, 495, 502, 503, 495, - 688, 362, 603, 604, 605, 606, 577, 447, 577, 620, - 447, 578, 621, 595, 368, 577, 515, 692, 625, 620, - 593, 364, 641, 313, 314, 315, 516, 517, 518, 527, - 528, 424, 577, 627, 424, 374, 549, 577, 659, 379, - 658, 599, 600, 607, 608, 580, 601, 602, 384, 385, - 440, 443, 499, 451, 509, 514, 529, 530, 531, 447, - 532, 533, 536, 539, 545, 553, 550, 624, 551, 554, - 555, 626, 560, 562, 558, 561, 590, -35, 633, 634, - -33, 563, 594, -28, 616, 629, 694, 495, 639, 643, - 653, 660, 669, 619, 670, 577, -501, 672, 678, 677, - 674, 679, 687, 610, 447, 580, 465, 596, 597, 598, - 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, - 424, 424, 424, 424, 424, 424, 682, 683, 640, 695, - 609, 696, 612, 614, 371, 611, 671, 382, 381, 495, - 613, 649, 345, 383, 542, 680, 644, 642, 690, 380, - 447, 691, 618, 645, 581, 661, 582, 367, 583, 649, - 673, 675, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 676, 0, 0, 0, 0, 0, 540, - 0, 0, 0, 463, 0, 495, 0, 0, 0, 651, - 689, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 356, 0, 0, 362, 0, 651, 333, 0, - 363, 0, 0, 0, 0, 0, 333, 0, 334, 317, - 319, 0, 0, 0, 333, 376, 0, 0, 0, 0, - 0, 356, 0, 0, 0, 356, 0, 333, 0, 0, - 0, 333, 0, 0, 424, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 448, 0, 0, 0, 475, - 0, 333, 0, 0, 0, 474, 0, 0, 0, 0, + 349, 332, 334, 370, 377, 470, 348, 471, 472, 510, + 452, 475, 385, 595, 393, 599, 564, 601, 558, 647, + 603, 361, 358, 538, 539, 549, 363, 403, 665, 377, + 520, 521, 370, 696, 401, 379, 379, 699, 536, 537, + 379, 519, 507, 402, 528, 699, 665, 356, 392, -34, + 455, 522, 506, 508, 455, 523, 462, 512, 540, 541, + 550, 359, 467, 357, 455, 372, 362, 456, 373, 365, + 604, 600, 459, 457, 404, 439, 525, 405, 460, 669, + 406, 606, 526, 670, 662, 637, 553, 592, 515, 555, + 592, 516, 572, 651, 574, 652, 580, 581, 582, 583, + 584, 585, 586, 587, 588, 589, 663, 534, 650, 535, + 564, 366, 592, 374, 510, 590, 510, 517, 518, 510, + 703, 377, 618, 619, 620, 621, 592, 462, 592, 635, + 462, 593, 636, 610, 383, 592, 530, 707, 640, 635, + 608, 379, 656, 328, 329, 330, 531, 532, 533, 542, + 543, 439, 592, 642, 439, 389, 564, 592, 674, 394, + 673, 614, 615, 622, 623, 595, 616, 617, 399, 400, + 455, 458, 514, 466, 524, 529, 544, 545, 546, 462, + 547, 548, 551, 554, 560, 568, 565, 639, 566, 569, + 570, 641, 575, 577, 573, 576, 605, -35, 648, 649, + -33, 578, 609, -28, 631, 644, 709, 510, 654, 658, + 668, 675, 684, 634, 685, 592, -516, 687, 693, 692, + 689, 694, 702, 625, 462, 595, 480, 611, 612, 613, + 439, 439, 439, 439, 439, 439, 439, 439, 439, 439, + 439, 439, 439, 439, 439, 439, 697, 698, 655, 710, + 624, 711, 627, 629, 686, 626, 397, 396, 398, 510, + 628, 664, 659, 360, 557, 695, 705, 657, 706, 386, + 462, 395, 633, 660, 596, 676, 597, 382, 598, 664, + 688, 690, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 691, 0, 0, 0, 0, 0, 555, + 0, 0, 0, 0, 0, 510, 0, 0, 0, 666, + 704, 0, 0, 0, 0, 0, 0, 0, 478, 0, + 0, 0, 0, 0, 0, 377, 0, 666, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 371, 0, 0, + 0, 0, 0, 348, 0, 378, 0, 0, 0, 0, + 0, 348, 0, 349, 332, 334, 0, 0, 0, 348, + 391, 0, 0, 0, 439, 0, 371, 0, 0, 0, + 371, 0, 348, 0, 0, 0, 348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 463, 0, 0, 0, 490, 0, 348, 0, 0, 0, + 489, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 448, 544, 0, 448, - 0, 0, 333, 333, 0, 333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 463, 559, 0, 463, 0, 0, 348, 348, 0, + 348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 475, 0, 0, 0, 0, 0, 474, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 448, 0, - 0, 0, 0, 0, 333, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 490, 0, 0, 0, 0, + 0, 489, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 463, 0, 0, 0, 0, 0, 348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 448, 0, 0, 0, 0, 0, 333, - 0, 0, 475, 0, 0, 0, 0, 0, 474, 0, - 0, 0, 0, 0, 475, 0, 0, 0, 0, 0, - 474, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 448, - 0, 0, 0, 0, 0, 333, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 463, 0, + 0, 0, 0, 0, 348, 0, 0, 490, 0, 0, + 0, 0, 0, 489, 0, 0, 0, 0, 0, 490, + 0, 0, 0, 0, 0, 489, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 463, 0, 0, 0, 0, 0, + 348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 475, 0, 0, 0, 0, 475, 474, - 0, 0, 475, 0, 474, 0, 0, 0, 474, 0, - 0, 0, 0, 0, 0, 0, 475, 0, 0, 0, - 0, 363, 474, 0, 0, 0, 0, 333, 0, 0, - 0, 0, 0, 0, 0, 0, 475, 0, 0, 0, - 475, 0, 474, 0, 0, 0, 474, 0, 475, 0, - 0, 0, 475, 0, 474, 0, 0, 0, 474, 0, - 0, 0, 475, 0, 0, 0, 366, 0, 474, 1, - 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 0, 0, - 309, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 490, 0, + 0, 0, 0, 490, 489, 0, 0, 490, 0, 489, + 0, 0, 0, 489, 0, 0, 0, 0, 0, 0, + 0, 490, 0, 0, 0, 0, 378, 489, 0, 0, + 0, 0, 348, 0, 0, 0, 0, 0, 0, 0, + 0, 490, 0, 0, 0, 490, 0, 489, 0, 0, + 0, 489, 0, 490, 0, 0, 0, 490, 0, 489, + 0, 0, 0, 489, 0, 0, 0, 490, 0, 0, + 0, 381, 0, 489, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 0, 0, + 324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 310, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 311, 312, - 313, 314, 315, 316, 1, 2, 3, 4, 5, 6, + 0, 0, 0, 0, 325, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 326, 327, + 328, 329, 330, 331, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 453, 454, 455, 0, 456, 457, 458, - 459, 460, 461, 462, 20, 21, 22, 23, 24, 25, + 17, 18, 19, 468, 469, 470, 0, 471, 472, 473, + 474, 475, 476, 477, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, @@ -1474,55 +1526,18 @@ static const yytype_int16 yytable[] = 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 463, 393, 309, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 0, 0, - 406, 407, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 408, - 0, 464, 0, 465, 466, 0, 0, 0, 0, 467, - 410, 411, 412, 413, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 311, 312, 313, 314, 315, 316, 1, - 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 453, 454, - 455, 0, 456, 457, 458, 459, 460, 461, 462, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 463, 393, - 309, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 0, 0, 406, 407, 0, 0, 0, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 478, 408, + 324, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 408, 0, 464, 0, 465, 579, - 0, 0, 0, 0, 467, 410, 411, 412, 413, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 311, 312, - 313, 314, 315, 316, 1, 2, 3, 4, 5, 6, + 0, 0, 0, 0, 423, 0, 479, 0, 480, 481, + 0, 0, 0, 0, 482, 425, 426, 427, 428, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 326, 327, + 328, 329, 330, 331, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 453, 454, 455, 0, 456, 457, 458, - 459, 460, 461, 462, 20, 21, 22, 23, 24, 25, + 17, 18, 19, 468, 469, 470, 0, 471, 472, 473, + 474, 475, 476, 477, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, @@ -1551,55 +1566,18 @@ static const yytype_int16 yytable[] = 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 463, 393, 309, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 0, 0, - 406, 407, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 408, - 0, 464, 0, 465, 0, 0, 0, 0, 0, 467, - 410, 411, 412, 413, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 311, 312, 313, 314, 315, 316, 1, - 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 453, 454, - 455, 0, 456, 457, 458, 459, 460, 461, 462, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 463, 393, - 309, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 0, 0, 406, 407, 0, 0, 0, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 478, 408, + 324, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 408, 0, 464, 0, 379, 0, - 0, 0, 0, 0, 467, 410, 411, 412, 413, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 311, 312, - 313, 314, 315, 316, 1, 2, 3, 4, 5, 6, + 0, 0, 0, 0, 423, 0, 479, 0, 480, 594, + 0, 0, 0, 0, 482, 425, 426, 427, 428, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 326, 327, + 328, 329, 330, 331, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 453, 454, 455, 0, 456, 457, 458, - 459, 460, 461, 462, 20, 21, 22, 23, 24, 25, + 17, 18, 19, 468, 469, 470, 0, 471, 472, 473, + 474, 475, 476, 477, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, @@ -1628,55 +1606,18 @@ static const yytype_int16 yytable[] = 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 463, 393, 309, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 0, 0, - 406, 407, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 408, - 0, 464, 0, 0, 0, 0, 0, 0, 0, 467, - 410, 411, 412, 413, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 311, 312, 313, 314, 315, 316, 1, - 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 0, 393, - 309, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 0, 0, 406, 407, 0, 0, 0, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 478, 408, + 324, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 408, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 467, 410, 411, 412, 413, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 311, 312, - 313, 314, 315, 316, 1, 2, 3, 4, 5, 6, + 0, 0, 0, 0, 423, 0, 479, 0, 480, 0, + 0, 0, 0, 0, 482, 425, 426, 427, 428, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 326, 327, + 328, 329, 330, 331, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, + 17, 18, 19, 468, 469, 470, 0, 471, 472, 473, + 474, 475, 476, 477, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, @@ -1705,52 +1646,175 @@ static const yytype_int16 yytable[] = 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 0, 0, 309, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 478, 408, + 324, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 423, 0, 479, 0, 394, 0, + 0, 0, 0, 0, 482, 425, 426, 427, 428, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 326, 327, + 328, 329, 330, 331, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 468, 469, 470, 0, 471, 472, 473, + 474, 475, 476, 477, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 478, 408, + 324, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 310, + 0, 0, 0, 0, 423, 0, 479, 0, 0, 0, + 0, 0, 0, 0, 482, 425, 426, 427, 428, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 326, 327, + 328, 329, 330, 331, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 0, 408, + 324, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 311, 312, 313, 314, 315, 316, 1, - 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 0, 393, - 309, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 0, 0, 406, 407, 0, 0, 0, + 0, 0, 0, 0, 423, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 482, 425, 426, 427, 428, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 326, 327, + 328, 329, 330, 331, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 0, 0, + 324, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 325, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 326, 327, + 328, 329, 330, 331, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 0, 408, + 324, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 408, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 410, 411, 412, 413, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 311, 312, - 313, 314, 315, 1, 2, 3, 4, 5, 6, 7, + 0, 0, 0, 0, 423, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 425, 426, 427, 428, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 326, 327, + 328, 329, 330, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, @@ -1782,52 +1846,55 @@ static const yytype_int16 yytable[] = 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 0, 360, 309, 0, 0, 0, 0, 0, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 0, 375, 324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 361, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 311, 312, 313, 314, 315, 1, 2, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 0, 0, 309, 0, + 0, 0, 0, 376, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 326, 327, 328, + 329, 330, 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 0, 0, 324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 548, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 563, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 311, 312, 313, 314, - 315, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 0, 0, 0, 0, 0, 0, 326, 327, 328, 329, + 330, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, @@ -1859,51 +1926,54 @@ static const yytype_int16 yytable[] = 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 0, 0, 309, 0, 0, 0, 0, 0, 0, 0, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 0, 0, 324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 617, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 632, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 311, 312, 313, 314, 315, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 0, 0, 309, 0, 0, 0, + 0, 0, 0, 0, 0, 326, 327, 328, 329, 330, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 323, 0, 0, 324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 638, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 311, 312, 313, 314, 315, 1, + 0, 0, 0, 0, 326, 327, 328, 329, 330, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, @@ -1935,71 +2005,74 @@ static const yytype_int16 yytable[] = 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 0, 0, - 309, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 0, 0, 324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 4, 5, 6, 7, 0, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 0, 0, 0, 0, 0, 0, 0, 311, 312, - 313, 314, 315, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 69, 0, 0, 0, 0, 0, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 0, 0, 0, 0, 0, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 0, 393, 309, 394, 395, 396, 397, 398, 399, - 400, 401, 402, 403, 404, 405, 0, 0, 406, 407, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 408, 0, 0, - 0, 494, 657, 0, 0, 0, 0, 0, 410, 411, - 412, 413, 3, 4, 5, 6, 7, 0, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, + 4, 5, 6, 7, 0, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, + 0, 0, 0, 326, 327, 328, 329, 330, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, - 0, 0, 0, 0, 0, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 0, - 0, 0, 0, 0, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 0, 0, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 0, 408, 324, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 0, 0, 421, 422, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 423, 0, 0, + 0, 509, 672, 0, 0, 0, 0, 0, 425, 426, + 427, 428, 3, 4, 5, 6, 7, 0, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, @@ -2007,49 +2080,52 @@ static const yytype_int16 yytable[] = 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 0, - 393, 309, 394, 395, 396, 397, 398, 399, 400, 401, - 402, 403, 404, 405, 0, 0, 406, 407, 0, 0, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 323, 0, 408, 324, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 0, + 0, 421, 422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 408, 0, 0, 409, 0, - 0, 0, 0, 0, 0, 0, 410, 411, 412, 413, - 3, 4, 5, 6, 7, 0, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 69, 0, 0, - 0, 0, 0, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 0, 0, 0, - 0, 0, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 0, 393, 309, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 0, 0, 406, 407, 0, 0, 0, 0, + 423, 0, 0, 424, 0, 0, 0, 0, 0, 0, + 0, 425, 426, 427, 428, 3, 4, 5, 6, 7, + 0, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 0, 408, 324, + 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, + 419, 420, 0, 0, 421, 422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 408, 0, 0, 0, 494, 0, 0, - 0, 0, 0, 0, 410, 411, 412, 413, 3, 4, + 0, 0, 0, 423, 0, 0, 0, 509, 0, 0, + 0, 0, 0, 0, 425, 426, 427, 428, 3, 4, 5, 6, 7, 0, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 22, 23, @@ -2058,11 +2134,11 @@ static const yytype_int16 yytable[] = 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, - 0, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 0, 0, 0, 0, 0, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, @@ -2081,49 +2157,52 @@ static const yytype_int16 yytable[] = 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 0, 393, 309, 394, 395, - 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 0, 0, 406, 407, 0, 0, 0, 0, 0, 0, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 0, 408, 324, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 0, 0, 421, 422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 408, 0, 0, 537, 0, 0, 0, 0, 0, - 0, 0, 410, 411, 412, 413, 3, 4, 5, 6, - 7, 0, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 69, 0, 0, 0, 0, 0, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 0, 0, 0, 0, 0, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 0, 393, 309, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 0, 0, - 406, 407, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 408, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 556, - 410, 411, 412, 413, 3, 4, 5, 6, 7, 0, + 0, 0, 0, 0, 0, 0, 423, 0, 0, 552, + 0, 0, 0, 0, 0, 0, 0, 425, 426, 427, + 428, 3, 4, 5, 6, 7, 0, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 69, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 0, 408, 324, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 0, 0, + 421, 422, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 423, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 571, + 425, 426, 427, 428, 3, 4, 5, 6, 7, 0, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 22, 23, 24, 25, 26, 27, @@ -2131,11 +2210,11 @@ static const yytype_int16 yytable[] = 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 69, 0, 0, 0, 0, 0, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 0, 0, 0, 0, 0, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, @@ -2155,48 +2234,51 @@ static const yytype_int16 yytable[] = 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 0, 393, 309, 394, 395, 396, 397, 398, 399, - 400, 401, 402, 403, 404, 405, 0, 0, 406, 407, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 0, 408, 324, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 0, 0, 421, 422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 408, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 410, 411, - 412, 413, 3, 4, 5, 6, 7, 0, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, + 0, 0, 423, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 425, 426, 427, 428, 3, 4, 5, + 6, 7, 0, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, - 0, 0, 0, 0, 0, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 0, - 0, 0, 0, 0, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 512, 0, - 393, 309, 394, 395, 396, 397, 398, 399, 400, 401, - 402, 403, 404, 405, 0, 0, 406, 407, 0, 0, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 527, 0, + 408, 324, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 0, 0, 421, 422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 408, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 410, 411, 412, 413, + 0, 0, 0, 0, 0, 423, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 425, 426, 427, 428, 3, 4, 5, 6, 7, 0, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, @@ -2205,11 +2287,11 @@ static const yytype_int16 yytable[] = 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 0, 0, 0, - 0, 0, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, @@ -2228,120 +2310,125 @@ static const yytype_int16 yytable[] = 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 0, 0, 309 + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 0, 0, 324 }; static const yytype_int16 yycheck[] = { - 0, 0, 0, 322, 330, 24, 0, 26, 27, 387, - 364, 30, 81, 480, 346, 492, 449, 494, 446, 564, - 497, 323, 323, 341, 342, 346, 368, 359, 628, 355, - 339, 340, 351, 666, 358, 360, 360, 670, 337, 338, - 360, 408, 367, 367, 422, 678, 646, 358, 368, 358, - 360, 360, 384, 385, 360, 364, 375, 367, 376, 377, - 381, 362, 368, 358, 360, 365, 368, 359, 368, 359, - 498, 367, 359, 365, 362, 364, 359, 365, 365, 361, - 368, 359, 365, 365, 359, 552, 440, 365, 365, 443, - 365, 368, 459, 363, 461, 365, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 359, 370, 585, 372, - 543, 365, 365, 323, 492, 367, 494, 406, 407, 497, - 359, 447, 523, 524, 525, 526, 365, 446, 365, 365, - 449, 368, 368, 511, 323, 365, 425, 682, 368, 365, - 507, 360, 368, 384, 385, 386, 373, 374, 375, 343, - 344, 440, 365, 366, 443, 362, 589, 365, 366, 362, - 637, 519, 520, 527, 528, 632, 521, 522, 323, 323, - 360, 367, 323, 368, 359, 358, 380, 379, 378, 498, - 345, 347, 361, 323, 323, 358, 368, 554, 368, 358, - 368, 558, 366, 360, 358, 358, 323, 358, 576, 577, - 358, 363, 323, 359, 361, 323, 683, 585, 361, 322, - 358, 358, 323, 545, 359, 365, 362, 361, 359, 368, - 363, 25, 359, 530, 543, 692, 362, 516, 517, 518, - 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, - 529, 530, 531, 532, 533, 534, 362, 367, 615, 368, - 529, 363, 532, 534, 323, 531, 653, 355, 351, 637, - 533, 628, 316, 355, 445, 665, 623, 620, 678, 349, - 589, 679, 544, 623, 490, 646, 490, 338, 490, 646, - 655, 659, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 660, -1, -1, -1, -1, -1, 653, - -1, -1, -1, 322, -1, 683, -1, -1, -1, 628, - 677, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 322, -1, -1, 651, -1, 646, 322, -1, - 330, -1, -1, -1, -1, -1, 330, -1, 338, 338, - 338, -1, -1, -1, 338, 345, -1, -1, -1, -1, - -1, 351, -1, -1, -1, 355, -1, 351, -1, -1, - -1, 355, -1, -1, 653, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 375, -1, -1, -1, 379, - -1, 375, -1, -1, -1, 379, -1, -1, -1, -1, + 0, 0, 0, 337, 345, 24, 0, 26, 27, 402, + 379, 30, 81, 495, 361, 507, 464, 509, 461, 579, + 512, 338, 338, 356, 357, 361, 383, 374, 643, 370, + 354, 355, 366, 681, 373, 375, 375, 685, 352, 353, + 375, 423, 382, 382, 437, 693, 661, 373, 383, 373, + 375, 375, 399, 400, 375, 379, 390, 382, 391, 392, + 396, 377, 383, 373, 375, 380, 383, 374, 383, 374, + 513, 382, 374, 380, 377, 379, 374, 380, 380, 376, + 383, 374, 380, 380, 374, 567, 455, 380, 380, 458, + 380, 383, 474, 378, 476, 380, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 374, 385, 600, 387, + 558, 380, 380, 338, 507, 382, 509, 421, 422, 512, + 374, 462, 538, 539, 540, 541, 380, 461, 380, 380, + 464, 383, 383, 526, 338, 380, 440, 697, 383, 380, + 522, 375, 383, 399, 400, 401, 388, 389, 390, 358, + 359, 455, 380, 381, 458, 377, 604, 380, 381, 377, + 652, 534, 535, 542, 543, 647, 536, 537, 338, 338, + 375, 382, 338, 383, 374, 373, 395, 394, 393, 513, + 360, 362, 376, 338, 338, 373, 383, 569, 383, 373, + 383, 573, 381, 375, 373, 373, 338, 373, 591, 592, + 373, 378, 338, 374, 376, 338, 698, 600, 376, 337, + 373, 373, 338, 560, 374, 380, 377, 376, 374, 383, + 378, 25, 374, 545, 558, 707, 377, 531, 532, 533, + 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, + 544, 545, 546, 547, 548, 549, 377, 382, 630, 383, + 544, 378, 547, 549, 668, 546, 370, 366, 370, 652, + 548, 643, 638, 331, 460, 680, 693, 635, 694, 338, + 604, 364, 559, 638, 505, 661, 505, 353, 505, 661, + 670, 674, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 675, -1, -1, -1, -1, -1, 668, + -1, -1, -1, -1, -1, 698, -1, -1, -1, 643, + 692, -1, -1, -1, -1, -1, -1, -1, 337, -1, + -1, -1, -1, -1, -1, 666, -1, 661, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 337, -1, -1, + -1, -1, -1, 337, -1, 345, -1, -1, -1, -1, + -1, 345, -1, 353, 353, 353, -1, -1, -1, 353, + 360, -1, -1, -1, 668, -1, 366, -1, -1, -1, + 370, -1, 366, -1, -1, -1, 370, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 390, -1, -1, -1, 394, -1, 390, -1, -1, -1, + 394, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 446, 447, -1, 449, - -1, -1, 446, 447, -1, 449, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 461, 462, -1, 464, -1, -1, 461, 462, -1, + 464, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 480, -1, -1, -1, -1, -1, 480, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 498, -1, - -1, -1, -1, -1, 498, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 495, -1, -1, -1, -1, + -1, 495, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 513, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 543, -1, -1, -1, -1, -1, 543, - -1, -1, 552, -1, -1, -1, -1, -1, 552, -1, - -1, -1, -1, -1, 564, -1, -1, -1, -1, -1, - 564, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 589, - -1, -1, -1, -1, -1, 589, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 558, -1, + -1, -1, -1, -1, 558, -1, -1, 567, -1, -1, + -1, -1, -1, 567, -1, -1, -1, -1, -1, 579, + -1, -1, -1, -1, -1, 579, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 604, -1, -1, -1, -1, -1, + 604, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 623, -1, -1, -1, -1, 628, 623, - -1, -1, 632, -1, 628, -1, -1, -1, 632, -1, - -1, -1, -1, -1, -1, -1, 646, -1, -1, -1, - -1, 651, 646, -1, -1, -1, -1, 651, -1, -1, - -1, -1, -1, -1, -1, -1, 666, -1, -1, -1, - 670, -1, 666, -1, -1, -1, 670, -1, 678, -1, - -1, -1, 682, -1, 678, -1, -1, -1, 682, -1, - -1, -1, 692, -1, -1, -1, 0, -1, 692, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, - 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, -1, -1, - 324, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 638, -1, + -1, -1, -1, 643, 638, -1, -1, 647, -1, 643, + -1, -1, -1, 647, -1, -1, -1, -1, -1, -1, + -1, 661, -1, -1, -1, -1, 666, 661, -1, -1, + -1, -1, 666, -1, -1, -1, -1, -1, -1, -1, + -1, 681, -1, -1, -1, 685, -1, 681, -1, -1, + -1, 685, -1, 693, -1, -1, -1, 697, -1, 693, + -1, -1, -1, 697, -1, -1, -1, 707, -1, -1, + -1, 0, -1, 707, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, -1, -1, + 339, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 368, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 382, 383, - 384, 385, 386, 387, 3, 4, 5, 6, 7, 8, + -1, -1, -1, -1, 383, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, + 399, 400, 401, 402, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, @@ -2374,54 +2461,177 @@ static const yytype_int16 yycheck[] = 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, -1, -1, - 339, 340, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 358, - -1, 360, -1, 362, 363, -1, -1, -1, -1, 368, - 369, 370, 371, 372, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 382, 383, 384, 385, 386, 387, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, -1, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, - 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, - 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, -1, -1, 339, 340, -1, -1, -1, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, 351, -1, -1, 354, 355, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 373, -1, 375, -1, 377, 378, + -1, -1, -1, -1, 383, 384, 385, 386, 387, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, + 399, 400, 401, 402, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, -1, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, 351, -1, -1, 354, 355, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 373, -1, 375, -1, 377, 378, + -1, -1, -1, -1, 383, 384, 385, 386, 387, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, + 399, 400, 401, 402, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, -1, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, 351, -1, -1, 354, 355, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 373, -1, 375, -1, 377, -1, + -1, -1, -1, -1, 383, 384, 385, 386, 387, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, + 399, 400, 401, 402, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, -1, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, 351, -1, -1, 354, 355, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 373, -1, 375, -1, 377, -1, + -1, -1, -1, -1, 383, 384, 385, 386, 387, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, + 399, 400, 401, 402, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, -1, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, 351, -1, -1, 354, 355, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 358, -1, 360, -1, 362, 363, - -1, -1, -1, -1, 368, 369, 370, 371, 372, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 382, 383, - 384, 385, 386, 387, 3, 4, 5, 6, 7, 8, + -1, -1, -1, -1, 373, -1, 375, -1, -1, -1, + -1, -1, -1, -1, 383, 384, 385, 386, 387, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, + 399, 400, 401, 402, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, -1, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, @@ -2451,54 +2661,17 @@ static const yytype_int16 yycheck[] = 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, -1, -1, - 339, 340, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 358, - -1, 360, -1, 362, -1, -1, -1, -1, -1, 368, - 369, 370, 371, 372, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 382, 383, 384, 385, 386, 387, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, -1, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, - 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, - 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, -1, -1, 339, 340, -1, -1, -1, + 329, 330, 331, 332, 333, 334, 335, 336, -1, 338, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, 351, -1, -1, 354, 355, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 358, -1, 360, -1, 362, -1, - -1, -1, -1, -1, 368, 369, 370, 371, 372, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 382, 383, - 384, 385, 386, 387, 3, 4, 5, 6, 7, 8, + -1, -1, -1, -1, 373, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 383, 384, 385, 386, 387, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, + 399, 400, 401, 402, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, -1, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, @@ -2529,50 +2702,13 @@ static const yytype_int16 yycheck[] = 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, -1, -1, - 339, 340, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 358, - -1, 360, -1, -1, -1, -1, -1, -1, -1, 368, - 369, 370, 371, 372, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 382, 383, 384, 385, 386, 387, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, - 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, -1, 323, - 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, -1, -1, 339, 340, -1, -1, -1, + 339, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 358, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 368, 369, 370, 371, 372, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 382, 383, - 384, 385, 386, 387, 3, 4, 5, 6, 7, 8, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 383, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, + 399, 400, 401, 402, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, 34, 35, 36, 37, 38, @@ -2604,52 +2740,15 @@ static const yytype_int16 yycheck[] = 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, -1, -1, 324, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 368, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 382, 383, 384, 385, 386, 387, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, - 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, -1, 323, - 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, -1, -1, 339, 340, -1, -1, -1, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, -1, 338, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, 351, -1, -1, 354, 355, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 358, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 369, 370, 371, 372, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 382, 383, - 384, 385, 386, 3, 4, 5, 6, 7, 8, 9, + -1, -1, -1, -1, 373, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 384, 385, 386, 387, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, + 399, 400, 401, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, @@ -2681,52 +2780,55 @@ static const yytype_int16 yycheck[] = 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 320, 321, -1, 323, 324, -1, -1, -1, -1, -1, + 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, -1, 338, 339, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 368, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 382, 383, 384, 385, 386, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, -1, -1, 324, -1, + -1, -1, -1, 383, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 397, 398, 399, + 400, 401, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, -1, -1, 339, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 363, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 378, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 382, 383, 384, 385, - 386, 3, 4, 5, 6, 7, 8, 9, 10, 11, + -1, -1, -1, -1, -1, -1, 397, 398, 399, 400, + 401, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, @@ -2758,51 +2860,54 @@ static const yytype_int16 yycheck[] = 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - -1, -1, 324, -1, -1, -1, -1, -1, -1, -1, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, + 332, 333, 334, 335, 336, -1, -1, 339, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 363, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 378, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 382, 383, 384, 385, 386, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, 320, 321, -1, -1, 324, -1, -1, -1, + -1, -1, -1, -1, -1, 397, 398, 399, 400, 401, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, -1, -1, 339, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 363, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 378, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 382, 383, 384, 385, 386, 3, + -1, -1, -1, -1, 397, 398, 399, 400, 401, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, @@ -2834,48 +2939,51 @@ static const yytype_int16 yycheck[] = 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, -1, -1, - 324, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, -1, -1, 339, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, + 6, 7, 8, 9, -1, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, + -1, -1, -1, 397, 398, 399, 400, 401, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 82, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 5, 6, 7, 8, 9, -1, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, -1, -1, -1, -1, -1, -1, -1, 382, 383, - 384, 385, 386, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 82, -1, -1, -1, -1, -1, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, -1, -1, -1, -1, -1, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, -1, -1, 339, 340, + -1, -1, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, + 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, + 346, 347, 348, 349, 350, 351, -1, -1, 354, 355, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 358, -1, -1, - -1, 362, 363, -1, -1, -1, -1, -1, 369, 370, - 371, 372, 5, 6, 7, 8, 9, -1, 11, 12, + -1, -1, -1, -1, -1, -1, -1, 373, -1, -1, + -1, 377, 378, -1, -1, -1, -1, -1, 384, 385, + 386, 387, 5, 6, 7, 8, 9, -1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, @@ -2883,11 +2991,11 @@ static const yytype_int16 yycheck[] = 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, - -1, -1, -1, -1, -1, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, - -1, -1, -1, -1, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, @@ -2906,49 +3014,52 @@ static const yytype_int16 yycheck[] = 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, -1, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, -1, -1, 339, 340, -1, -1, + 333, 334, 335, 336, -1, 338, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 349, 350, 351, -1, + -1, 354, 355, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 358, -1, -1, 361, -1, - -1, -1, -1, -1, -1, -1, 369, 370, 371, 372, - 5, 6, 7, 8, 9, -1, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 82, -1, -1, - -1, -1, -1, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, -1, -1, -1, - -1, -1, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, -1, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, -1, -1, 339, 340, -1, -1, -1, -1, + 373, -1, -1, 376, -1, -1, -1, -1, -1, -1, + -1, 384, 385, 386, 387, 5, 6, 7, 8, 9, + -1, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 82, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, -1, 338, 339, + 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, -1, -1, 354, 355, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 358, -1, -1, -1, 362, -1, -1, - -1, -1, -1, -1, 369, 370, 371, 372, 5, 6, + -1, -1, -1, 373, -1, -1, -1, 377, -1, -1, + -1, -1, -1, -1, 384, 385, 386, 387, 5, 6, 7, 8, 9, -1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 35, 36, @@ -2957,11 +3068,11 @@ static const yytype_int16 yycheck[] = 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, -1, -1, -1, -1, - -1, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, -1, -1, -1, -1, -1, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, @@ -2980,49 +3091,52 @@ static const yytype_int16 yycheck[] = 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 321, -1, 323, 324, 325, 326, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, - -1, -1, 339, 340, -1, -1, -1, -1, -1, -1, + -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, + 347, 348, 349, 350, 351, -1, -1, 354, 355, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 358, -1, -1, 361, -1, -1, -1, -1, -1, - -1, -1, 369, 370, 371, 372, 5, 6, 7, 8, - 9, -1, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 82, -1, -1, -1, -1, -1, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, -1, -1, -1, -1, -1, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, -1, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, -1, -1, - 339, 340, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 358, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 368, - 369, 370, 371, 372, 5, 6, 7, 8, 9, -1, + -1, -1, -1, -1, -1, -1, 373, -1, -1, 376, + -1, -1, -1, -1, -1, -1, -1, 384, 385, 386, + 387, 5, 6, 7, 8, 9, -1, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 82, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, -1, 338, 339, 340, 341, 342, 343, + 344, 345, 346, 347, 348, 349, 350, 351, -1, -1, + 354, 355, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 373, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 383, + 384, 385, 386, 387, 5, 6, 7, 8, 9, -1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 35, 36, 37, 38, 39, 40, @@ -3030,11 +3144,11 @@ static const yytype_int16 yycheck[] = 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 82, -1, -1, -1, -1, -1, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + -1, 82, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, -1, -1, -1, -1, -1, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, -1, -1, -1, -1, -1, -1, -1, -1, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, @@ -3054,48 +3168,51 @@ static const yytype_int16 yycheck[] = 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, -1, -1, 339, 340, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, -1, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, -1, -1, 354, 355, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 358, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 369, 370, - 371, 372, 5, 6, 7, 8, 9, -1, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, + -1, -1, 373, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 384, 385, 386, 387, 5, 6, 7, + 8, 9, -1, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 82, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, - -1, -1, -1, -1, -1, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, - -1, -1, -1, -1, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, -1, - 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, -1, -1, 339, 340, -1, -1, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, + 328, 329, 330, 331, 332, 333, 334, 335, 336, -1, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, + 348, 349, 350, 351, -1, -1, 354, 355, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 358, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 369, 370, 371, 372, + -1, -1, -1, -1, -1, 373, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 384, 385, 386, 387, 5, 6, 7, 8, 9, -1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, @@ -3104,11 +3221,11 @@ static const yytype_int16 yycheck[] = 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, -1, -1, -1, - -1, -1, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, @@ -3127,7 +3244,9 @@ static const yytype_int16 yycheck[] = 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, -1, -1, 324 + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, -1, -1, 339 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -3164,107 +3283,111 @@ static const yytype_uint16 yystos[] = 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 324, - 368, 382, 383, 384, 385, 386, 387, 422, 423, 426, - 427, 428, 429, 433, 434, 435, 436, 437, 438, 441, - 442, 443, 444, 445, 447, 449, 450, 451, 491, 492, - 493, 358, 358, 323, 362, 450, 323, 368, 368, 494, - 359, 365, 430, 431, 432, 442, 447, 365, 368, 323, - 323, 368, 443, 447, 360, 448, 0, 492, 323, 446, - 81, 323, 439, 440, 362, 453, 447, 368, 448, 362, - 470, 431, 430, 432, 323, 323, 358, 367, 448, 362, - 365, 368, 425, 323, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 339, 340, 358, 361, - 369, 370, 371, 372, 392, 393, 394, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, 412, 413, 414, 415, 416, 445, 447, - 360, 359, 365, 367, 359, 365, 452, 442, 447, 454, - 455, 368, 368, 22, 23, 24, 26, 27, 28, 29, - 30, 31, 32, 322, 360, 362, 363, 368, 403, 416, - 418, 420, 422, 426, 445, 447, 460, 461, 462, 463, - 471, 472, 473, 474, 477, 478, 481, 482, 483, 490, - 495, 448, 367, 448, 362, 418, 458, 367, 424, 323, - 365, 368, 403, 403, 420, 339, 340, 360, 364, 359, - 359, 365, 321, 418, 358, 403, 373, 374, 375, 370, - 372, 337, 338, 341, 342, 376, 377, 343, 344, 380, - 379, 378, 345, 347, 346, 381, 361, 361, 416, 323, - 416, 421, 440, 454, 447, 323, 456, 457, 363, 455, - 368, 368, 485, 358, 358, 368, 368, 420, 358, 420, - 366, 358, 360, 363, 464, 348, 349, 350, 351, 352, - 353, 354, 355, 356, 357, 367, 419, 365, 368, 363, - 461, 474, 478, 483, 458, 367, 458, 459, 458, 454, - 323, 359, 395, 420, 323, 418, 403, 403, 403, 405, - 405, 406, 406, 407, 407, 407, 407, 408, 408, 409, - 410, 411, 412, 413, 414, 417, 361, 363, 456, 448, - 365, 368, 461, 486, 420, 368, 420, 366, 484, 323, - 496, 497, 471, 418, 418, 458, 363, 365, 363, 361, - 420, 368, 457, 322, 460, 472, 487, 359, 359, 420, - 435, 442, 476, 358, 361, 365, 465, 363, 458, 366, - 358, 476, 488, 489, 467, 468, 469, 475, 479, 323, - 359, 421, 361, 497, 363, 418, 420, 368, 359, 25, - 463, 462, 362, 367, 462, 466, 470, 359, 359, 420, - 466, 467, 471, 480, 458, 368, 363 + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 339, 383, 397, 398, 399, 400, + 401, 402, 437, 438, 441, 442, 443, 444, 448, 449, + 450, 451, 452, 453, 456, 457, 458, 459, 460, 462, + 464, 465, 466, 506, 507, 508, 373, 373, 338, 377, + 465, 338, 383, 383, 509, 374, 380, 445, 446, 447, + 457, 462, 380, 383, 338, 338, 383, 458, 462, 375, + 463, 0, 507, 338, 461, 81, 338, 454, 455, 377, + 468, 462, 383, 463, 377, 485, 446, 445, 447, 338, + 338, 373, 382, 463, 377, 380, 383, 440, 338, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 354, 355, 373, 376, 384, 385, 386, 387, 407, + 408, 409, 411, 412, 413, 414, 415, 416, 417, 418, + 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 460, 462, 375, 374, 380, 382, 374, + 380, 467, 457, 462, 469, 470, 383, 383, 22, 23, + 24, 26, 27, 28, 29, 30, 31, 32, 337, 375, + 377, 378, 383, 418, 431, 433, 435, 437, 441, 460, + 462, 475, 476, 477, 478, 486, 487, 488, 489, 492, + 493, 496, 497, 498, 505, 510, 463, 382, 463, 377, + 433, 473, 382, 439, 338, 380, 383, 418, 418, 435, + 354, 355, 375, 379, 374, 374, 380, 336, 433, 373, + 418, 388, 389, 390, 385, 387, 352, 353, 356, 357, + 391, 392, 358, 359, 395, 394, 393, 360, 362, 361, + 396, 376, 376, 431, 338, 431, 436, 455, 469, 462, + 338, 471, 472, 378, 470, 383, 383, 500, 373, 373, + 383, 383, 435, 373, 435, 381, 373, 375, 378, 479, + 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, + 382, 434, 380, 383, 378, 476, 489, 493, 498, 473, + 382, 473, 474, 473, 469, 338, 374, 410, 435, 338, + 433, 418, 418, 418, 420, 420, 421, 421, 422, 422, + 422, 422, 423, 423, 424, 425, 426, 427, 428, 429, + 432, 376, 378, 471, 463, 380, 383, 476, 501, 435, + 383, 435, 381, 499, 338, 511, 512, 486, 433, 433, + 473, 378, 380, 378, 376, 435, 383, 472, 337, 475, + 487, 502, 374, 374, 435, 450, 457, 491, 373, 376, + 380, 480, 378, 473, 381, 373, 491, 503, 504, 482, + 483, 484, 490, 494, 338, 374, 436, 376, 512, 378, + 433, 435, 383, 374, 25, 478, 477, 377, 382, 477, + 481, 485, 374, 374, 435, 481, 482, 486, 495, 473, + 383, 378 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint16 yyr1[] = { - 0, 391, 392, 393, 393, 393, 393, 393, 393, 393, - 393, 393, 393, 393, 393, 393, 393, 394, 394, 394, - 394, 394, 394, 395, 396, 397, 398, 398, 399, 399, - 400, 400, 401, 402, 402, 402, 403, 403, 403, 403, - 404, 404, 404, 404, 405, 405, 405, 405, 406, 406, - 406, 407, 407, 407, 408, 408, 408, 408, 408, 409, - 409, 409, 410, 410, 411, 411, 412, 412, 413, 413, - 414, 414, 415, 415, 416, 417, 416, 418, 418, 419, - 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, - 420, 420, 421, 422, 422, 422, 422, 422, 422, 422, - 422, 422, 424, 423, 425, 425, 426, 427, 427, 428, - 428, 429, 430, 430, 431, 431, 431, 431, 432, 433, - 433, 433, 433, 433, 434, 434, 434, 434, 434, 435, - 435, 436, 437, 437, 437, 437, 438, 439, 439, 440, - 440, 440, 441, 442, 442, 443, 443, 443, 443, 443, - 443, 443, 444, 444, 444, 444, 444, 444, 444, 444, - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, - 444, 445, 446, 446, 447, 447, 448, 448, 448, 448, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 450, 450, 450, 452, 451, - 453, 451, 454, 454, 455, 455, 456, 456, 457, 457, - 458, 458, 458, 459, 459, 460, 461, 461, 462, 462, - 462, 462, 462, 462, 462, 463, 464, 465, 463, 466, - 466, 468, 467, 469, 467, 470, 470, 471, 471, 472, - 472, 473, 473, 474, 475, 475, 476, 476, 477, 477, - 479, 478, 480, 480, 481, 481, 482, 482, 484, 483, - 485, 483, 486, 483, 487, 487, 488, 488, 489, 489, - 490, 490, 490, 490, 490, 491, 491, 492, 492, 492, - 494, 493, 495, 496, 496, 497, 497 + 0, 406, 407, 408, 408, 408, 408, 408, 408, 408, + 408, 408, 408, 408, 408, 408, 408, 409, 409, 409, + 409, 409, 409, 410, 411, 412, 413, 413, 414, 414, + 415, 415, 416, 417, 417, 417, 418, 418, 418, 418, + 419, 419, 419, 419, 420, 420, 420, 420, 421, 421, + 421, 422, 422, 422, 423, 423, 423, 423, 423, 424, + 424, 424, 425, 425, 426, 426, 427, 427, 428, 428, + 429, 429, 430, 430, 431, 432, 431, 433, 433, 434, + 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, + 435, 435, 436, 437, 437, 437, 437, 437, 437, 437, + 437, 437, 439, 438, 440, 440, 441, 442, 442, 443, + 443, 444, 445, 445, 446, 446, 446, 446, 447, 448, + 448, 448, 448, 448, 449, 449, 449, 449, 449, 450, + 450, 451, 452, 452, 452, 452, 452, 452, 452, 452, + 453, 454, 454, 455, 455, 455, 456, 457, 457, 458, + 458, 458, 458, 458, 458, 458, 459, 459, 459, 459, + 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, + 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, + 459, 459, 459, 459, 459, 460, 461, 461, 462, 462, + 463, 463, 463, 463, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 465, 465, 465, 467, 466, 468, 466, 469, 469, 470, + 470, 471, 471, 472, 472, 473, 473, 473, 474, 474, + 475, 476, 476, 477, 477, 477, 477, 477, 477, 477, + 478, 479, 480, 478, 481, 481, 483, 482, 484, 482, + 485, 485, 486, 486, 487, 487, 488, 488, 489, 490, + 490, 491, 491, 492, 492, 494, 493, 495, 495, 496, + 496, 497, 497, 499, 498, 500, 498, 501, 498, 502, + 502, 503, 503, 504, 504, 505, 505, 505, 505, 505, + 506, 506, 507, 507, 507, 509, 508, 510, 511, 511, + 512, 512 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ @@ -3283,12 +3406,13 @@ static const yytype_uint8 yyr2[] = 3, 4, 0, 6, 2, 3, 2, 1, 1, 2, 3, 3, 2, 3, 2, 1, 2, 1, 1, 1, 3, 4, 6, 5, 1, 2, 3, 5, 4, 1, - 2, 1, 1, 1, 1, 1, 4, 1, 3, 1, - 3, 1, 1, 1, 2, 1, 1, 1, 1, 1, + 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 4, 1, 3, 1, 3, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 4, 1, 1, 3, 1, 2, 2, 3, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 4, 1, 1, 3, 1, 2, + 2, 3, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -3316,16 +3440,17 @@ static const yytype_uint8 yyr2[] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 0, 6, - 0, 5, 1, 2, 3, 4, 1, 3, 1, 2, - 1, 3, 4, 1, 3, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 0, 0, 5, 1, - 1, 0, 2, 0, 2, 2, 3, 1, 2, 1, - 2, 1, 2, 5, 3, 1, 1, 4, 1, 2, - 0, 8, 0, 1, 3, 2, 1, 2, 0, 6, - 0, 8, 0, 7, 1, 1, 1, 0, 2, 3, - 2, 2, 2, 3, 2, 1, 2, 1, 1, 1, - 0, 3, 5, 1, 3, 1, 4 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 6, 0, 5, 1, 2, 3, + 4, 1, 3, 1, 2, 1, 3, 4, 1, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 0, 0, 5, 1, 1, 0, 2, 0, 2, + 2, 3, 1, 2, 1, 2, 1, 2, 5, 3, + 1, 1, 4, 1, 2, 0, 8, 0, 1, 3, + 2, 1, 2, 0, 6, 0, 8, 0, 7, 1, + 1, 1, 0, 2, 3, 2, 2, 2, 3, 2, + 1, 2, 1, 1, 1, 0, 3, 5, 1, 3, + 1, 4 }; @@ -3610,11 +3735,11 @@ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = YY_NULL; + const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -3671,7 +3796,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, } yyarg[yycount++] = yytname[yyx]; { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; @@ -4008,250 +4133,250 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); switch (yyn) { case 2: -#line 293 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 294 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleVariable((yyvsp[0].lex).loc, (yyvsp[0].lex).symbol, (yyvsp[0].lex).string); } -#line 4016 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4141 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 3: -#line 299 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 300 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4024 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4149 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 4: -#line 302 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 303 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 4033 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4158 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 5: -#line 306 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 307 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 4042 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4167 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 6: -#line 310 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 311 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 4050 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4175 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 7: -#line 313 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 314 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 4059 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4184 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 8: -#line 317 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 318 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i64, (yyvsp[0].lex).loc, true); } -#line 4068 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4193 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 9: -#line 321 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 322 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u64, (yyvsp[0].lex).loc, true); } -#line 4077 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4202 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 10: -#line 325 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 326 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((short)(yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 4086 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4211 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 11: -#line 329 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 330 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((unsigned short)(yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 4095 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4220 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 12: -#line 333 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 334 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 4103 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4228 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 13: -#line 336 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 337 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtDouble, (yyvsp[0].lex).loc, true); } -#line 4112 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4237 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 14: -#line 340 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 341 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat16, (yyvsp[0].lex).loc, true); } -#line 4121 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4246 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 15: -#line 344 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 345 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 4129 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4254 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 16: -#line 347 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 348 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); } -#line 4139 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4264 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 17: -#line 355 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 356 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4147 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4272 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 18: -#line 358 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 359 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBracketDereference((yyvsp[-2].lex).loc, (yyvsp[-3].interm.intermTypedNode), (yyvsp[-1].interm.intermTypedNode)); } -#line 4155 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4280 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 19: -#line 361 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 362 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4163 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4288 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 20: -#line 364 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 365 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleDotDereference((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode), *(yyvsp[0].lex).string); } -#line 4171 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4296 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 21: -#line 367 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 368 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "++", (yyvsp[-1].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "++", EOpPostIncrement, (yyvsp[-1].interm.intermTypedNode)); } -#line 4181 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4306 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 22: -#line 372 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 373 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "--", (yyvsp[-1].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "--", EOpPostDecrement, (yyvsp[-1].interm.intermTypedNode)); } -#line 4191 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4316 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 23: -#line 380 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 381 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.integerCheck((yyvsp[0].interm.intermTypedNode), "[]"); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4200 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4325 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 24: -#line 387 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 388 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleFunctionCall((yyvsp[0].interm).loc, (yyvsp[0].interm).function, (yyvsp[0].interm).intermNode); delete (yyvsp[0].interm).function; } -#line 4209 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4334 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 25: -#line 394 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 395 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[0].interm); } -#line 4217 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4342 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 26: -#line 400 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 401 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[-1].interm); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 4226 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4351 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 27: -#line 404 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 405 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[-1].interm); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 4235 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4360 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 28: -#line 411 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 412 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[-1].interm); } -#line 4243 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4368 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 29: -#line 414 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 415 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[0].interm); } -#line 4251 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4376 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 30: -#line 420 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 421 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { TParameter param = { 0, new TType }; param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); @@ -4259,11 +4384,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm).function = (yyvsp[-1].interm).function; (yyval.interm).intermNode = (yyvsp[0].interm.intermTypedNode); } -#line 4263 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4388 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 31: -#line 427 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 428 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { TParameter param = { 0, new TType }; param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); @@ -4271,29 +4396,29 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm).function = (yyvsp[-2].interm).function; (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); } -#line 4275 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4400 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 32: -#line 437 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 438 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[-1].interm); } -#line 4283 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4408 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 33: -#line 445 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 446 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // Constructor (yyval.interm).intermNode = 0; (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); } -#line 4293 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4418 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 34: -#line 450 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 451 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // // Should be a method or subroutine call, but we haven't recognized the arguments yet. @@ -4321,50 +4446,50 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm).function = new TFunction(&empty, TType(EbtVoid), EOpNull); } } -#line 4325 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4450 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 35: -#line 477 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 478 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // Constructor (yyval.interm).intermNode = 0; (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); } -#line 4335 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4460 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 36: -#line 485 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 486 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.variableCheck((yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); if (TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode()) parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "incomplete method syntax", method->getMethodName().c_str(), ""); } -#line 4346 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4471 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 37: -#line 491 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 492 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "++", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "++", EOpPreIncrement, (yyvsp[0].interm.intermTypedNode)); } -#line 4355 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4480 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 38: -#line 495 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 496 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "--", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "--", EOpPreDecrement, (yyvsp[0].interm.intermTypedNode)); } -#line 4364 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4489 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 39: -#line 499 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 500 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-1].interm).op != EOpNull) { char errorOp[2] = {0, 0}; @@ -4381,179 +4506,179 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); } } -#line 4385 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4510 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 40: -#line 519 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 520 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNull; } -#line 4391 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4516 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 41: -#line 520 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 521 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNegative; } -#line 4397 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4522 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 42: -#line 521 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 522 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLogicalNot; } -#line 4403 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4528 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 43: -#line 522 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 523 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpBitwiseNot; parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise not"); } -#line 4410 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4535 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 44: -#line 528 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 529 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4416 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4541 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 45: -#line 529 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 530 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "*", EOpMul, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4426 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4551 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 46: -#line 534 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 535 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "/", EOpDiv, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4436 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4561 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 47: -#line 539 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 540 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "%"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "%", EOpMod, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4447 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4572 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 48: -#line 548 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 549 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4453 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4578 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 49: -#line 549 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 550 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "+", EOpAdd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4463 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4588 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 50: -#line 554 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 555 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "-", EOpSub, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4473 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4598 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 51: -#line 562 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 563 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4479 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4604 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 52: -#line 563 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 564 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift left"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<<", EOpLeftShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4490 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4615 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 53: -#line 569 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 570 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift right"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">>", EOpRightShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4501 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4626 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 54: -#line 578 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 579 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4507 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4632 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 55: -#line 579 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 580 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<", EOpLessThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4517 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4642 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 56: -#line 584 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 585 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">", EOpGreaterThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4527 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4652 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 57: -#line 589 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 590 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<=", EOpLessThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4537 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4662 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 58: -#line 594 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 595 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">=", EOpGreaterThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4547 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4672 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 59: -#line 602 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 603 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4553 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4678 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 60: -#line 603 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 604 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); @@ -4562,11 +4687,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4566 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4691 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 61: -#line 611 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 612 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); @@ -4575,124 +4700,124 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4579 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4704 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 62: -#line 622 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 623 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4585 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4710 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 63: -#line 623 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 624 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise and"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&", EOpAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4596 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4721 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 64: -#line 632 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 633 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4602 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4727 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 65: -#line 633 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 634 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise exclusive or"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^", EOpExclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4613 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4738 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 66: -#line 642 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 643 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4619 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4744 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 67: -#line 643 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 644 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise inclusive or"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "|", EOpInclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4630 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4755 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 68: -#line 652 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 653 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4636 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4761 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 69: -#line 653 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 654 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&&", EOpLogicalAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4646 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4771 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 70: -#line 661 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 662 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4652 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4777 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 71: -#line 662 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 663 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^^", EOpLogicalXor, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4662 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4787 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 72: -#line 670 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 671 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4668 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4793 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 73: -#line 671 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 672 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "||", EOpLogicalOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4678 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4803 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 74: -#line 679 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 680 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4684 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4809 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 75: -#line 680 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 681 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { ++parseContext.controlFlowNestingLevel; } -#line 4692 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4817 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 76: -#line 683 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 684 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { --parseContext.controlFlowNestingLevel; parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-5].interm.intermTypedNode)); @@ -4705,20 +4830,21 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } } -#line 4709 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4834 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 77: -#line 698 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 699 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4715 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4840 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 78: -#line 699 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 700 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.arrayObjectCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array assignment"); parseContext.opaqueCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); + parseContext.storage16BitAssignmentCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); parseContext.specializationCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); parseContext.lValueErrorCheck((yyvsp[-1].interm).loc, "assign", (yyvsp[-2].interm.intermTypedNode)); parseContext.rValueErrorCheck((yyvsp[-1].interm).loc, "assign", (yyvsp[0].interm.intermTypedNode)); @@ -4728,119 +4854,119 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } } -#line 4732 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4858 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 79: -#line 714 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 716 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAssign; } -#line 4741 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4867 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 80: -#line 718 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 720 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpMulAssign; } -#line 4750 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4876 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 81: -#line 722 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 724 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpDivAssign; } -#line 4759 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4885 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 82: -#line 726 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 728 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "%="); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpModAssign; } -#line 4769 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4895 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 83: -#line 731 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 733 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAddAssign; } -#line 4778 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4904 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 84: -#line 735 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 737 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpSubAssign; } -#line 4787 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4913 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 85: -#line 739 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 741 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift left assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLeftShiftAssign; } -#line 4796 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4922 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 86: -#line 743 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 745 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift right assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpRightShiftAssign; } -#line 4805 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4931 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 87: -#line 747 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 749 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-and assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAndAssign; } -#line 4814 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4940 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 88: -#line 751 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 753 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-xor assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpExclusiveOrAssign; } -#line 4823 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4949 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 89: -#line 755 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 757 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-or assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpInclusiveOrAssign; } -#line 4832 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4958 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 90: -#line 762 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 764 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4840 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4966 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 91: -#line 765 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 767 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.samplerConstructorLocationCheck((yyvsp[-1].lex).loc, ",", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.intermediate.addComma((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); @@ -4849,40 +4975,40 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } } -#line 4853 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4979 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 92: -#line 776 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 778 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.constantValueCheck((yyvsp[0].interm.intermTypedNode), ""); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4862 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4988 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 93: -#line 783 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 785 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.handleFunctionDeclarator((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).function, true /* prototype */); (yyval.interm.intermNode) = 0; // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature } -#line 4872 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4998 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 94: -#line 788 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 790 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-1].interm).intermNode && (yyvsp[-1].interm).intermNode->getAsAggregate()) (yyvsp[-1].interm).intermNode->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-1].interm).intermNode; } -#line 4882 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5008 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 95: -#line 793 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 795 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.profileRequires((yyvsp[-3].lex).loc, ENoProfile, 130, 0, "precision statement"); @@ -4891,75 +5017,75 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.setDefaultPrecision((yyvsp[-3].lex).loc, (yyvsp[-1].interm.type), (yyvsp[-2].interm.type).qualifier.precision); (yyval.interm.intermNode) = 0; } -#line 4895 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5021 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 96: -#line 801 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 803 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.declareBlock((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).typeList); (yyval.interm.intermNode) = 0; } -#line 4904 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5030 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 97: -#line 805 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 807 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.declareBlock((yyvsp[-2].interm).loc, *(yyvsp[-2].interm).typeList, (yyvsp[-1].lex).string); (yyval.interm.intermNode) = 0; } -#line 4913 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5039 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 98: -#line 809 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 811 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.declareBlock((yyvsp[-3].interm).loc, *(yyvsp[-3].interm).typeList, (yyvsp[-2].lex).string, (yyvsp[-1].interm).arraySizes); (yyval.interm.intermNode) = 0; } -#line 4922 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5048 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 99: -#line 813 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 815 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); parseContext.updateStandaloneQualifierDefaults((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type)); (yyval.interm.intermNode) = 0; } -#line 4932 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5058 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 100: -#line 818 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 820 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.checkNoShaderLayouts((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).shaderQualifiers); parseContext.addQualifierToExisting((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, *(yyvsp[-1].lex).string); (yyval.interm.intermNode) = 0; } -#line 4942 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5068 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 101: -#line 823 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 825 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.checkNoShaderLayouts((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).shaderQualifiers); (yyvsp[-1].interm.identifierList)->push_back((yyvsp[-2].lex).string); parseContext.addQualifierToExisting((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).qualifier, *(yyvsp[-1].interm.identifierList)); (yyval.interm.intermNode) = 0; } -#line 4953 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5079 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 102: -#line 832 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 834 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.nestedBlockCheck((yyvsp[-2].interm.type).loc); } -#line 4959 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5085 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 103: -#line 832 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 834 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { --parseContext.structNestingLevel; parseContext.blockName = (yyvsp[-4].lex).string; @@ -4969,54 +5095,54 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm).loc = (yyvsp[-5].interm.type).loc; (yyval.interm).typeList = (yyvsp[-1].interm.typeList); } -#line 4973 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5099 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 104: -#line 843 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 845 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.identifierList) = new TIdentifierList; (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } -#line 4982 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5108 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 105: -#line 847 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 849 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.identifierList) = (yyvsp[-2].interm.identifierList); (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } -#line 4991 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5117 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 106: -#line 854 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 856 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).function = (yyvsp[-1].interm.function); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 5000 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5126 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 107: -#line 861 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 863 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.function) = (yyvsp[0].interm.function); } -#line 5008 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5134 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 108: -#line 864 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 866 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.function) = (yyvsp[0].interm.function); } -#line 5016 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5142 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 109: -#line 871 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 873 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // Add the parameter (yyval.interm.function) = (yyvsp[-1].interm.function); @@ -5025,11 +5151,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); else delete (yyvsp[0].interm).param.type; } -#line 5029 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5155 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 110: -#line 879 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 881 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // // Only first parameter of one-parameter functions can be void @@ -5047,11 +5173,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyvsp[-2].interm.function)->addParameter((yyvsp[0].interm).param); } } -#line 5051 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5177 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 111: -#line 899 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 901 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-2].interm.type).qualifier.storage != EvqGlobal && (yyvsp[-2].interm.type).qualifier.storage != EvqTemporary) { parseContext.error((yyvsp[-1].lex).loc, "no qualifiers allowed for function return", @@ -5071,11 +5197,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); function = new TFunction((yyvsp[-1].lex).string, type); (yyval.interm.function) = function; } -#line 5075 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5201 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 112: -#line 922 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 924 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-1].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-1].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -5091,11 +5217,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).param = param; } -#line 5095 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5221 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 113: -#line 937 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 939 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -5115,11 +5241,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm).loc = (yyvsp[-1].lex).loc; (yyval.interm).param = param; } -#line 5119 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5245 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 114: -#line 962 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 964 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[0].interm); if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) @@ -5131,11 +5257,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); } -#line 5135 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5261 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 115: -#line 973 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 975 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[0].interm); @@ -5143,11 +5269,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); } -#line 5147 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5273 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 116: -#line 983 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 985 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[0].interm); if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) @@ -5158,11 +5284,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); } -#line 5162 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5288 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 117: -#line 993 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 995 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[0].interm); @@ -5170,118 +5296,118 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); } -#line 5174 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5300 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 118: -#line 1003 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1005 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { TParameter param = { 0, new TType((yyvsp[0].interm.type)) }; (yyval.interm).param = param; if ((yyvsp[0].interm.type).arraySizes) parseContext.arraySizeRequiredCheck((yyvsp[0].interm.type).loc, *(yyvsp[0].interm.type).arraySizes); } -#line 5185 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5311 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 119: -#line 1012 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1014 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[0].interm); } -#line 5193 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5319 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 120: -#line 1015 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1017 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[-2].interm); parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-2].interm).type); } -#line 5202 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5328 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 121: -#line 1019 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1021 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[-3].interm); parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-3].interm).type, (yyvsp[0].interm).arraySizes); } -#line 5211 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5337 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 122: -#line 1023 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1025 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).type = (yyvsp[-5].interm).type; TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-5].interm).type, (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-5].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } -#line 5221 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5347 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 123: -#line 1028 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1030 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).type = (yyvsp[-4].interm).type; TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-4].interm).type, 0, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-4].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } -#line 5231 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5357 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 124: -#line 1036 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1038 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).type = (yyvsp[0].interm.type); (yyval.interm).intermNode = 0; parseContext.declareTypeDefaults((yyval.interm).loc, (yyval.interm).type); } -#line 5241 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5367 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 125: -#line 1041 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1043 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).type = (yyvsp[-1].interm.type); (yyval.interm).intermNode = 0; parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-1].interm.type)); } -#line 5251 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5377 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 126: -#line 1046 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1048 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).type = (yyvsp[-2].interm.type); (yyval.interm).intermNode = 0; parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-2].interm.type), (yyvsp[0].interm).arraySizes); } -#line 5261 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5387 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 127: -#line 1051 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1053 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).type = (yyvsp[-4].interm.type); TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-4].interm.type), (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); } -#line 5271 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5397 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 128: -#line 1056 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1058 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).type = (yyvsp[-3].interm.type); TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); } -#line 5281 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5407 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 129: -#line 1065 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1067 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[0].interm.type); @@ -5293,11 +5419,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.precisionQualifierCheck((yyval.interm.type).loc, (yyval.interm.type).basicType, (yyval.interm.type).qualifier); } -#line 5297 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5423 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 130: -#line 1076 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1078 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); parseContext.globalQualifierTypeCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, (yyvsp[0].interm.type)); @@ -5322,22 +5448,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (parseContext.language == EShLangFragment && (yyval.interm.type).qualifier.storage == EvqVaryingIn))) (yyval.interm.type).qualifier.smooth = true; } -#line 5326 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5452 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 131: -#line 1103 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1105 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "invariant"); parseContext.profileRequires((yyval.interm.type).loc, ENoProfile, 120, 0, "invariant"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.invariant = true; } -#line 5337 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5463 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 132: -#line 1112 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1114 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "smooth"); parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "smooth"); @@ -5345,11 +5471,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.smooth = true; } -#line 5349 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5475 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 133: -#line 1119 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1121 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "flat"); parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "flat"); @@ -5357,11 +5483,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.flat = true; } -#line 5361 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5487 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 134: -#line 1126 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1128 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "noperspective"); #ifdef NV_EXTENSIONS @@ -5373,11 +5499,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.nopersp = true; } -#line 5377 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5503 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 135: -#line 1137 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1139 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.globalCheck((yyvsp[0].lex).loc, "__explicitInterpAMD"); @@ -5387,84 +5513,144 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).qualifier.explicitInterp = true; #endif } -#line 5391 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5517 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 136: -#line 1149 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1148 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[-1].interm.type); +#ifdef NV_EXTENSIONS + parseContext.globalCheck((yyvsp[0].lex).loc, "pervertexNV"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECompatibilityProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.pervertexNV = true; +#endif } -#line 5399 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5532 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 137: -#line 1155 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1158 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[0].interm.type); +#ifdef NV_EXTENSIONS + // No need for profile version or extension check. Shader stage already checks both. + parseContext.globalCheck((yyvsp[0].lex).loc, "perprimitiveNV"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshNVMask), "perprimitiveNV"); + // Fragment shader stage doesn't check for extension. So we explicitly add below extension check. + if (parseContext.language == EShLangFragment) + parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_NV_mesh_shader, "perprimitiveNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.perPrimitiveNV = true; +#endif } -#line 5407 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5549 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 138: -#line 1158 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1170 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef NV_EXTENSIONS + // No need for profile version or extension check. Shader stage already checks both. + parseContext.globalCheck((yyvsp[0].lex).loc, "perviewNV"); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangMeshNV, "perviewNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.perViewNV = true; +#endif + } +#line 5563 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 139: +#line 1179 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef NV_EXTENSIONS + // No need for profile version or extension check. Shader stage already checks both. + parseContext.globalCheck((yyvsp[0].lex).loc, "taskNV"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTaskNVMask | EShLangMeshNVMask), "taskNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.perTaskNV = true; +#endif + } +#line 5577 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 140: +#line 1191 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type) = (yyvsp[-1].interm.type); + } +#line 5585 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 141: +#line 1197 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type) = (yyvsp[0].interm.type); + } +#line 5593 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 142: +#line 1200 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[-2].interm.type); (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); parseContext.mergeObjectLayoutQualifiers((yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } -#line 5417 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5603 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 139: -#line 1165 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 143: +#line 1207 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), *(yyvsp[0].lex).string); } -#line 5426 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5612 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 140: -#line 1169 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 144: +#line 1211 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[-2].lex).loc); parseContext.setLayoutQualifier((yyvsp[-2].lex).loc, (yyval.interm.type), *(yyvsp[-2].lex).string, (yyvsp[0].interm.intermTypedNode)); } -#line 5435 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5621 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 141: -#line 1173 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 145: +#line 1215 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // because "shared" is both an identifier and a keyword (yyval.interm.type).init((yyvsp[0].lex).loc); TString strShared("shared"); parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), strShared); } -#line 5445 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5631 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 142: -#line 1181 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 146: +#line 1223 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.profileRequires((yyval.interm.type).loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.noContraction = true; } -#line 5456 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5642 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 143: -#line 1190 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 147: +#line 1232 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5464 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5650 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 144: -#line 1193 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 148: +#line 1235 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[-1].interm.type); if ((yyval.interm.type).basicType == EbtVoid) @@ -5473,80 +5659,80 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); parseContext.mergeQualifiers((yyval.interm.type).loc, (yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } -#line 5477 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5663 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 145: -#line 1204 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 149: +#line 1246 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5485 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5671 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 146: -#line 1207 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 150: +#line 1249 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5493 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5679 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 147: -#line 1210 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 151: +#line 1252 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.checkPrecisionQualifier((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier.precision); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5502 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5688 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 148: -#line 1214 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 152: +#line 1256 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5511 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5697 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 149: -#line 1218 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 153: +#line 1260 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5520 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5706 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 150: -#line 1222 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 154: +#line 1264 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5529 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5715 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 151: -#line 1226 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 155: +#line 1268 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5537 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5723 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 152: -#line 1232 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 156: +#line 1274 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant } -#line 5546 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5732 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 153: -#line 1236 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 157: +#line 1278 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangVertex, "attribute"); parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "attribute"); @@ -5559,11 +5745,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqVaryingIn; } -#line 5563 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5749 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 154: -#line 1248 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 158: +#line 1290 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "varying"); parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "varying"); @@ -5578,43 +5764,43 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); else (yyval.interm.type).qualifier.storage = EvqVaryingIn; } -#line 5582 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5768 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 155: -#line 1262 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 159: +#line 1304 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "inout"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqInOut; } -#line 5592 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5778 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 156: -#line 1267 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 160: +#line 1309 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "in"); (yyval.interm.type).init((yyvsp[0].lex).loc); // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later (yyval.interm.type).qualifier.storage = EvqIn; } -#line 5603 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5789 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 157: -#line 1273 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 161: +#line 1315 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "out"); (yyval.interm.type).init((yyvsp[0].lex).loc); // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later (yyval.interm.type).qualifier.storage = EvqOut; } -#line 5614 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5800 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 158: -#line 1279 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 162: +#line 1321 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 120, 0, "centroid"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "centroid"); @@ -5622,189 +5808,317 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.centroid = true; } -#line 5626 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5812 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 159: -#line 1286 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 163: +#line 1328 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "patch"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.patch = true; } -#line 5637 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5823 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 160: -#line 1292 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 164: +#line 1334 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "sample"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.sample = true; } -#line 5647 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5833 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 161: -#line 1297 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 165: +#line 1339 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "uniform"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqUniform; } -#line 5657 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5843 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 162: -#line 1302 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 166: +#line 1344 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "buffer"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqBuffer; } -#line 5667 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5853 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 163: -#line 1307 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 167: +#line 1349 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef NV_EXTENSIONS + parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeNV"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangIntersectNVMask | EShLangClosestHitNVMask + | EShLangAnyHitNVMask), "hitAttributeNV"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "hitAttributeNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqHitAttrNV; +#endif + } +#line 5868 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 168: +#line 1359 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef NV_EXTENSIONS + parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadNV"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenNVMask | EShLangClosestHitNVMask | + EShLangAnyHitNVMask | EShLangMissNVMask), "rayPayloadNV"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqPayloadNV; +#endif + } +#line 5883 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 169: +#line 1369 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef NV_EXTENSIONS + parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadInNV"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangClosestHitNVMask | + EShLangAnyHitNVMask | EShLangMissNVMask), "rayPayloadInNV"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadInNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqPayloadInNV; +#endif + } +#line 5898 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 170: +#line 1379 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef NV_EXTENSIONS + parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataNV"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenNVMask | + EShLangClosestHitNVMask | EShLangMissNVMask | EShLangCallableNVMask), "callableDataNV"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqCallableDataNV; +#endif + } +#line 5913 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 171: +#line 1389 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef NV_EXTENSIONS + parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataInNV"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangCallableNVMask), "callableDataInNV"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataInNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqCallableDataInNV; +#endif + } +#line 5927 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 172: +#line 1398 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "shared"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 310, 0, "shared"); +#ifdef NV_EXTENSIONS + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangComputeMask | EShLangMeshNVMask | EShLangTaskNVMask), "shared"); +#else parseContext.requireStage((yyvsp[0].lex).loc, EShLangCompute, "shared"); +#endif (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqShared; } -#line 5680 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5944 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 164: -#line 1315 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 173: +#line 1410 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.coherent = true; } -#line 5689 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5953 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 165: -#line 1319 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 174: +#line 1414 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "devicecoherent"); + (yyval.interm.type).qualifier.devicecoherent = true; + } +#line 5963 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 175: +#line 1419 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "queuefamilycoherent"); + (yyval.interm.type).qualifier.queuefamilycoherent = true; + } +#line 5973 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 176: +#line 1424 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "workgroupcoherent"); + (yyval.interm.type).qualifier.workgroupcoherent = true; + } +#line 5983 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 177: +#line 1429 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "subgroupcoherent"); + (yyval.interm.type).qualifier.subgroupcoherent = true; + } +#line 5993 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 178: +#line 1434 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "nonprivate"); + (yyval.interm.type).qualifier.nonprivate = true; + } +#line 6003 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 179: +#line 1439 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.volatil = true; } -#line 5698 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6012 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 166: -#line 1323 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 180: +#line 1443 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.restrict = true; } -#line 5707 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6021 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 167: -#line 1327 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 181: +#line 1447 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.readonly = true; } -#line 5716 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6030 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 168: -#line 1331 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 182: +#line 1451 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.writeonly = true; } -#line 5725 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6039 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 169: -#line 1335 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 183: +#line 1455 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.spvRemoved((yyvsp[0].lex).loc, "subroutine"); parseContext.globalCheck((yyvsp[0].lex).loc, "subroutine"); parseContext.unimplemented((yyvsp[0].lex).loc, "subroutine"); (yyval.interm.type).init((yyvsp[0].lex).loc); } -#line 5736 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6050 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 170: -#line 1341 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 184: +#line 1461 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.spvRemoved((yyvsp[-3].lex).loc, "subroutine"); parseContext.globalCheck((yyvsp[-3].lex).loc, "subroutine"); parseContext.unimplemented((yyvsp[-3].lex).loc, "subroutine"); (yyval.interm.type).init((yyvsp[-3].lex).loc); } -#line 5747 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6061 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 171: -#line 1350 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 185: +#line 1470 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.nonUniform = true; } -#line 5756 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6070 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 172: -#line 1357 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 186: +#line 1477 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // TODO } -#line 5764 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6078 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 173: -#line 1360 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 187: +#line 1480 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // TODO: 4.0 semantics: subroutines // 1) make sure each identifier is a type declared earlier with SUBROUTINE // 2) save all of the identifiers for future comparison with the declared function } -#line 5774 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6088 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 174: -#line 1368 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 188: +#line 1488 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[0].interm.type); (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); } -#line 5783 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6097 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 175: -#line 1372 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 189: +#line 1492 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.arrayOfArrayVersionCheck((yyvsp[0].interm).loc, (yyvsp[0].interm).arraySizes); (yyval.interm.type) = (yyvsp[-1].interm.type); (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); (yyval.interm.type).arraySizes = (yyvsp[0].interm).arraySizes; } -#line 5794 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6108 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 176: -#line 1381 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 190: +#line 1501 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[-1].lex).loc; (yyval.interm).arraySizes = new TArraySizes; (yyval.interm).arraySizes->addInnerSize(); } -#line 5804 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6118 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 177: -#line 1386 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 191: +#line 1506 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[-2].lex).loc; (yyval.interm).arraySizes = new TArraySizes; @@ -5813,20 +6127,20 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size); (yyval.interm).arraySizes->addInnerSize(size); } -#line 5817 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6131 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 178: -#line 1394 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 192: +#line 1514 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[-2].interm); (yyval.interm).arraySizes->addInnerSize(); } -#line 5826 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6140 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 179: -#line 1398 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 193: +#line 1518 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[-3].interm); @@ -5834,1484 +6148,1495 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size); (yyval.interm).arraySizes->addInnerSize(size); } -#line 5838 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6152 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 180: -#line 1408 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 194: +#line 1528 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtVoid; } -#line 5847 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6161 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 181: -#line 1412 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 195: +#line 1532 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; } -#line 5856 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6170 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 182: -#line 1416 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 196: +#line 1536 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; } -#line 5866 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6180 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 183: -#line 1421 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 197: +#line 1541 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.float16Check((yyvsp[0].lex).loc, "float16_t", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "float16_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; } -#line 5876 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6190 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 184: -#line 1426 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 198: +#line 1546 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; } -#line 5886 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6200 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 185: -#line 1431 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 199: +#line 1551 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; } -#line 5896 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6210 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 186: -#line 1436 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 200: +#line 1556 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; } -#line 5905 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6219 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 187: -#line 1440 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 201: +#line 1560 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; } -#line 5915 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6229 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 188: -#line 1445 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 202: +#line 1565 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; } -#line 5925 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6239 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 189: -#line 1450 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 203: +#line 1570 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; } -#line 5935 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6249 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 190: -#line 1455 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 204: +#line 1575 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; } -#line 5945 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6259 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 191: -#line 1460 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 205: +#line 1580 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; } -#line 5955 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6269 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 192: -#line 1465 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 206: +#line 1585 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; } -#line 5965 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6279 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 193: -#line 1470 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 207: +#line 1590 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; } -#line 5975 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6289 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 194: -#line 1475 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 208: +#line 1595 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; } -#line 5985 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6299 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 195: -#line 1480 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 209: +#line 1600 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; } -#line 5995 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6309 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 196: -#line 1485 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 210: +#line 1605 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; } -#line 6004 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6318 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 197: -#line 1489 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 211: +#line 1609 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(2); } -#line 6014 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6328 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 198: -#line 1494 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 212: +#line 1614 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(3); } -#line 6024 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6338 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 199: -#line 1499 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 213: +#line 1619 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(4); } -#line 6034 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6348 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 200: -#line 1504 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 214: +#line 1624 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(2); } -#line 6045 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6359 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 201: -#line 1510 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 215: +#line 1630 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(3); } -#line 6056 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6370 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 202: -#line 1516 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 216: +#line 1636 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(4); } -#line 6067 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6381 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 203: -#line 1522 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 217: +#line 1642 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.float16Check((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setVector(2); } -#line 6078 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6392 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 204: -#line 1528 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 218: +#line 1648 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.float16Check((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setVector(3); } -#line 6089 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6403 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 205: -#line 1534 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 219: +#line 1654 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.float16Check((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setVector(4); } -#line 6100 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6414 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 206: -#line 1540 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 220: +#line 1660 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(2); } -#line 6111 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6425 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 207: -#line 1546 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 221: +#line 1666 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(3); } -#line 6122 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6436 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 208: -#line 1552 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 222: +#line 1672 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(4); } -#line 6133 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6447 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 209: -#line 1558 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 223: +#line 1678 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(2); } -#line 6144 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6458 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 210: -#line 1564 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 224: +#line 1684 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(3); } -#line 6155 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6469 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 211: -#line 1570 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 225: +#line 1690 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(4); } -#line 6166 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6480 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 212: -#line 1576 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 226: +#line 1696 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; (yyval.interm.type).setVector(2); } -#line 6176 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6490 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 213: -#line 1581 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 227: +#line 1701 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; (yyval.interm.type).setVector(3); } -#line 6186 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6500 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 214: -#line 1586 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 228: +#line 1706 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; (yyval.interm.type).setVector(4); } -#line 6196 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6510 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 215: -#line 1591 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 229: +#line 1711 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(2); } -#line 6206 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6520 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 216: -#line 1596 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 230: +#line 1716 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(3); } -#line 6216 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6530 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 217: -#line 1601 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 231: +#line 1721 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(4); } -#line 6226 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6540 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 218: -#line 1606 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 232: +#line 1726 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt8; - (yyval.interm.type).setVector(2); + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; + (yyval.interm.type).setVector(2); } -#line 6237 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6551 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 219: -#line 1612 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 233: +#line 1732 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt8; - (yyval.interm.type).setVector(3); + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; + (yyval.interm.type).setVector(3); } -#line 6248 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6562 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 220: -#line 1618 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 234: +#line 1738 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt8; - (yyval.interm.type).setVector(4); + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; + (yyval.interm.type).setVector(4); } -#line 6259 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6573 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 221: -#line 1624 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 235: +#line 1744 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt16; - (yyval.interm.type).setVector(2); + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).setVector(2); } -#line 6270 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6584 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 222: -#line 1630 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 236: +#line 1750 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt16; - (yyval.interm.type).setVector(3); + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).setVector(3); } -#line 6281 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6595 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 223: -#line 1636 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 237: +#line 1756 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt16; - (yyval.interm.type).setVector(4); + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).setVector(4); } -#line 6292 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6606 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 224: -#line 1642 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 238: +#line 1762 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(2); } -#line 6303 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6617 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 225: -#line 1648 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 239: +#line 1768 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(3); } -#line 6314 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6628 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 226: -#line 1654 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 240: +#line 1774 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(4); } -#line 6325 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6639 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 227: -#line 1660 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 241: +#line 1780 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; (yyval.interm.type).setVector(2); } -#line 6336 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6650 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 228: -#line 1666 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 242: +#line 1786 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; (yyval.interm.type).setVector(3); } -#line 6347 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6661 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 229: -#line 1672 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 243: +#line 1792 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; (yyval.interm.type).setVector(4); } -#line 6358 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6672 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 230: -#line 1678 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 244: +#line 1798 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(2); } -#line 6369 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6683 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 231: -#line 1684 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 245: +#line 1804 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(3); } -#line 6380 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6694 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 232: -#line 1690 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 246: +#line 1810 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(4); } -#line 6391 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6705 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 233: -#line 1696 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 247: +#line 1816 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(2); } -#line 6402 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6716 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 234: -#line 1702 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 248: +#line 1822 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt8; + (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(3); } -#line 6413 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6727 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 235: -#line 1708 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 249: +#line 1828 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.explicitInt8Check((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(4); } -#line 6424 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6738 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 236: -#line 1714 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 250: +#line 1834 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; (yyval.interm.type).setVector(2); } -#line 6435 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6749 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 237: -#line 1720 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 251: +#line 1840 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; (yyval.interm.type).setVector(3); } -#line 6446 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6760 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 238: -#line 1726 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 252: +#line 1846 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; (yyval.interm.type).setVector(4); } -#line 6457 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6771 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 239: -#line 1732 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 253: +#line 1852 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(2); } -#line 6468 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6782 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 240: -#line 1738 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 254: +#line 1858 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(3); } -#line 6479 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6793 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 241: -#line 1744 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 255: +#line 1864 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(4); } -#line 6490 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6804 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 242: -#line 1750 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 256: +#line 1870 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(2); } -#line 6501 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6815 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 243: -#line 1756 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 257: +#line 1876 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(3); } -#line 6512 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6826 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 244: -#line 1762 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 258: +#line 1882 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(4); } -#line 6523 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6837 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 245: -#line 1768 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 259: +#line 1888 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 6533 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6847 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 246: -#line 1773 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 260: +#line 1893 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 6543 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6857 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 247: -#line 1778 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 261: +#line 1898 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 6553 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6867 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 248: -#line 1783 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 262: +#line 1903 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 6563 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6877 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 249: -#line 1788 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 263: +#line 1908 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 3); } -#line 6573 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6887 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 250: -#line 1793 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 264: +#line 1913 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 4); } -#line 6583 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6897 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 251: -#line 1798 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 265: +#line 1918 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 2); } -#line 6593 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6907 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 252: -#line 1803 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 266: +#line 1923 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 6603 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6917 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 253: -#line 1808 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 267: +#line 1928 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 4); } -#line 6613 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6927 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 254: -#line 1813 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 268: +#line 1933 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 2); } -#line 6623 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6937 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 255: -#line 1818 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 269: +#line 1938 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 3); } -#line 6633 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6947 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 256: -#line 1823 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 270: +#line 1943 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 6643 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6957 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 257: -#line 1828 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 271: +#line 1948 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 6654 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6968 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 258: -#line 1834 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 272: +#line 1954 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 6665 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6979 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 259: -#line 1840 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 273: +#line 1960 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 6676 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6990 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 260: -#line 1846 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 274: +#line 1966 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 6687 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7001 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 261: -#line 1852 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 275: +#line 1972 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 3); } -#line 6698 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7012 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 262: -#line 1858 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 276: +#line 1978 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 4); } -#line 6709 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7023 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 263: -#line 1864 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 277: +#line 1984 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 2); } -#line 6720 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7034 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 264: -#line 1870 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 278: +#line 1990 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 6731 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7045 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 265: -#line 1876 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 279: +#line 1996 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 4); } -#line 6742 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7056 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 266: -#line 1882 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 280: +#line 2002 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 2); } -#line 6753 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7067 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 267: -#line 1888 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 281: +#line 2008 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 3); } -#line 6764 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7078 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 268: -#line 1894 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 282: +#line 2014 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 6775 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7089 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 269: -#line 1900 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 283: +#line 2020 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 2); } -#line 6786 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7100 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 270: -#line 1906 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 284: +#line 2026 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 3); } -#line 6797 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7111 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 271: -#line 1912 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 285: +#line 2032 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 4); } -#line 6808 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7122 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 272: -#line 1918 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 286: +#line 2038 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 2); } -#line 6819 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7133 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 273: -#line 1924 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 287: +#line 2044 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 3); } -#line 6830 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7144 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 274: -#line 1930 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 288: +#line 2050 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 4); } -#line 6841 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7155 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 275: -#line 1936 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 289: +#line 2056 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 2); } -#line 6852 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7166 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 276: -#line 1942 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 290: +#line 2062 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 3); } -#line 6863 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7177 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 277: -#line 1948 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 291: +#line 2068 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 4); } -#line 6874 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7188 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 278: -#line 1954 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 292: +#line 2074 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 2); } -#line 6885 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7199 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 279: -#line 1960 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 293: +#line 2080 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 3); } -#line 6896 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7210 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 280: -#line 1966 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 294: +#line 2086 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 4); } -#line 6907 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7221 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 281: -#line 1972 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 295: +#line 2092 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 6918 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7232 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 282: -#line 1978 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 296: +#line 2098 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 6929 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7243 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 283: -#line 1984 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 297: +#line 2104 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 6940 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7254 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 284: -#line 1990 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 298: +#line 2110 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 6951 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7265 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 285: -#line 1996 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 299: +#line 2116 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 3); } -#line 6962 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7276 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 286: -#line 2002 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 300: +#line 2122 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 4); } -#line 6973 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7287 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 287: -#line 2008 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 301: +#line 2128 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 2); } -#line 6984 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7298 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 288: -#line 2014 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 302: +#line 2134 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 6995 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7309 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 289: -#line 2020 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 303: +#line 2140 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 4); } -#line 7006 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7320 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 290: -#line 2026 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 304: +#line 2146 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 2); } -#line 7017 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7331 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 291: -#line 2032 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 305: +#line 2152 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 3); } -#line 7028 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7342 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 292: -#line 2038 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 306: +#line 2158 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 7039 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7353 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 293: -#line 2044 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 307: +#line 2164 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 7050 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7364 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 294: -#line 2050 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 308: +#line 2170 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 7061 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7375 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 295: -#line 2056 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 309: +#line 2176 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 7072 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7386 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 296: -#line 2062 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 310: +#line 2182 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 7083 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7397 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 297: -#line 2068 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 311: +#line 2188 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 3); } -#line 7094 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7408 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 298: -#line 2074 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 312: +#line 2194 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 4); } -#line 7105 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7419 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 299: -#line 2080 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 313: +#line 2200 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 2); } -#line 7116 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7430 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 300: -#line 2086 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 314: +#line 2206 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 7127 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7441 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 301: -#line 2092 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 315: +#line 2212 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 4); } -#line 7138 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7452 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 302: -#line 2098 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 316: +#line 2218 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 2); } -#line 7149 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7463 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 303: -#line 2104 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 317: +#line 2224 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 3); } -#line 7160 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7474 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 304: -#line 2110 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 318: +#line 2230 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 7171 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7485 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 305: -#line 2116 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 319: +#line 2236 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { +#ifdef NV_EXTENSIONS + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtAccStructNV; +#endif + } +#line 7496 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 320: +#line 2242 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.vulkanRemoved((yyvsp[0].lex).loc, "atomic counter types"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAtomicUint; } -#line 7181 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7506 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 306: -#line 2121 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 321: +#line 2247 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D); } -#line 7191 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7516 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 307: -#line 2126 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 322: +#line 2252 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); } -#line 7201 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7526 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 308: -#line 2131 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 323: +#line 2257 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd3D); } -#line 7211 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7536 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 309: -#line 2136 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 324: +#line 2262 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube); } -#line 7221 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7546 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 310: -#line 2141 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 325: +#line 2267 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, false, true); } -#line 7231 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7556 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 311: -#line 2146 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 326: +#line 2272 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, true); } -#line 7241 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7566 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 312: -#line 2151 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 327: +#line 2277 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, false, true); } -#line 7251 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7576 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 313: -#line 2156 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 328: +#line 2282 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true); } -#line 7261 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7586 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 314: -#line 2161 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 329: +#line 2287 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true); } -#line 7271 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7596 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 315: -#line 2166 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 330: +#line 2292 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true, true); } -#line 7281 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7606 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 316: -#line 2171 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 331: +#line 2297 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, true); } -#line 7291 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7616 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 317: -#line 2176 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 332: +#line 2302 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true); } -#line 7301 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7626 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 318: -#line 2181 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 333: +#line 2307 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true, true); } -#line 7311 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7636 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 319: -#line 2186 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 334: +#line 2312 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7320,11 +7645,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd1D); #endif } -#line 7324 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7649 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 320: -#line 2194 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 335: +#line 2320 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7333,11 +7658,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd2D); #endif } -#line 7337 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7662 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 321: -#line 2202 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 336: +#line 2328 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7346,11 +7671,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd3D); #endif } -#line 7350 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7675 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 322: -#line 2210 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 337: +#line 2336 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7359,11 +7684,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, EsdCube); #endif } -#line 7363 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7688 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 323: -#line 2218 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 338: +#line 2344 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7372,11 +7697,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, false, true); #endif } -#line 7376 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7701 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 324: -#line 2226 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 339: +#line 2352 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7385,11 +7710,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, true); #endif } -#line 7389 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7714 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 325: -#line 2234 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 340: +#line 2360 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7398,11 +7723,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, false, true); #endif } -#line 7402 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7727 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 326: -#line 2242 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 341: +#line 2368 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7411,11 +7736,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true); #endif } -#line 7415 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7740 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 327: -#line 2250 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 342: +#line 2376 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7424,11 +7749,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true); #endif } -#line 7428 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7753 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 328: -#line 2258 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 343: +#line 2384 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7437,11 +7762,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true, true); #endif } -#line 7441 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7766 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 329: -#line 2266 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 344: +#line 2392 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7450,11 +7775,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, true); #endif } -#line 7454 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7779 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 330: -#line 2274 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 345: +#line 2400 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7463,11 +7788,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true); #endif } -#line 7467 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7792 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 331: -#line 2282 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 346: +#line 2408 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7476,171 +7801,171 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true, true); #endif } -#line 7480 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7805 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 332: -#line 2290 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 347: +#line 2416 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd1D); } -#line 7490 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7815 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 333: -#line 2295 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 348: +#line 2421 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D); } -#line 7500 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7825 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 334: -#line 2300 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 349: +#line 2426 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd3D); } -#line 7510 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7835 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 335: -#line 2305 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 350: +#line 2431 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdCube); } -#line 7520 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7845 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 336: -#line 2310 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 351: +#line 2436 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd1D, true); } -#line 7530 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7855 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 337: -#line 2315 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 352: +#line 2441 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, true); } -#line 7540 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7865 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 338: -#line 2320 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 353: +#line 2446 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdCube, true); } -#line 7550 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7875 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 339: -#line 2325 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 354: +#line 2451 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd1D); } -#line 7560 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7885 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 340: -#line 2330 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 355: +#line 2456 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D); } -#line 7570 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7895 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 341: -#line 2335 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 356: +#line 2461 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd3D); } -#line 7580 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7905 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 342: -#line 2340 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 357: +#line 2466 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdCube); } -#line 7590 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7915 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 343: -#line 2345 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 358: +#line 2471 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd1D, true); } -#line 7600 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7925 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 344: -#line 2350 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 359: +#line 2476 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, true); } -#line 7610 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7935 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 345: -#line 2355 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 360: +#line 2481 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdCube, true); } -#line 7620 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7945 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 346: -#line 2360 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 361: +#line 2486 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdRect); } -#line 7630 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7955 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 347: -#line 2365 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 362: +#line 2491 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdRect, false, true); } -#line 7640 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7965 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 348: -#line 2370 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 363: +#line 2496 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7649,11 +7974,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, EsdRect); #endif } -#line 7653 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7978 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 349: -#line 2378 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 364: +#line 2504 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7662,41 +7987,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, EsdRect, false, true); #endif } -#line 7666 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7991 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 350: -#line 2386 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 365: +#line 2512 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdRect); } -#line 7676 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8001 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 351: -#line 2391 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 366: +#line 2517 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdRect); } -#line 7686 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8011 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 352: -#line 2396 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 367: +#line 2522 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdBuffer); } -#line 7696 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8021 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 353: -#line 2401 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 368: +#line 2527 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7705,41 +8030,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, EsdBuffer); #endif } -#line 7709 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8034 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 354: -#line 2409 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 369: +#line 2535 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdBuffer); } -#line 7719 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8044 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 355: -#line 2414 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 370: +#line 2540 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdBuffer); } -#line 7729 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8054 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 356: -#line 2419 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 371: +#line 2545 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, false, true); } -#line 7739 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8064 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 357: -#line 2424 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 372: +#line 2550 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7748,41 +8073,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, false, true); #endif } -#line 7752 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8077 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 358: -#line 2432 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 373: +#line 2558 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, false, false, true); } -#line 7762 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8087 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 359: -#line 2437 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 374: +#line 2563 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, false, false, true); } -#line 7772 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8097 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 360: -#line 2442 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 375: +#line 2568 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, false, true); } -#line 7782 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8107 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 361: -#line 2447 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 376: +#line 2573 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7791,61 +8116,61 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, false, true); #endif } -#line 7795 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8120 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 362: -#line 2455 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 377: +#line 2581 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, true, false, true); } -#line 7805 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8130 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 363: -#line 2460 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 378: +#line 2586 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, true, false, true); } -#line 7815 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8140 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 364: -#line 2465 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 379: +#line 2591 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setPureSampler(false); } -#line 7825 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8150 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 365: -#line 2470 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 380: +#line 2596 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setPureSampler(true); } -#line 7835 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8160 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 366: -#line 2475 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 381: +#line 2601 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D); } -#line 7845 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8170 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 367: -#line 2480 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 382: +#line 2606 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -7854,21 +8179,21 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D); #endif } -#line 7858 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8183 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 368: -#line 2488 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 383: +#line 2614 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D); } -#line 7868 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8193 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 369: -#line 2493 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 384: +#line 2619 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -7877,21 +8202,21 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D); #endif } -#line 7881 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8206 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 370: -#line 2501 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 385: +#line 2627 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd3D); } -#line 7891 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8216 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 371: -#line 2506 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 386: +#line 2632 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -7900,21 +8225,21 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd3D); #endif } -#line 7904 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8229 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 372: -#line 2514 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 387: +#line 2640 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube); } -#line 7914 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8239 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 373: -#line 2519 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 388: +#line 2645 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -7923,21 +8248,21 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube); #endif } -#line 7927 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8252 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 374: -#line 2527 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 389: +#line 2653 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D, true); } -#line 7937 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8262 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 375: -#line 2532 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 390: +#line 2658 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -7946,21 +8271,21 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D, true); #endif } -#line 7950 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8275 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 376: -#line 2540 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 391: +#line 2666 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true); } -#line 7960 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8285 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 377: -#line 2545 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 392: +#line 2671 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -7969,21 +8294,21 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true); #endif } -#line 7973 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8298 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 378: -#line 2553 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 393: +#line 2679 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube, true); } -#line 7983 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8308 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 379: -#line 2558 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 394: +#line 2684 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -7992,161 +8317,161 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube, true); #endif } -#line 7996 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8321 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 380: -#line 2566 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 395: +#line 2692 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D); } -#line 8006 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8331 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 381: -#line 2571 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 396: +#line 2697 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D); } -#line 8016 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8341 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 382: -#line 2576 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 397: +#line 2702 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd3D); } -#line 8026 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8351 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 383: -#line 2581 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 398: +#line 2707 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube); } -#line 8036 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8361 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 384: -#line 2586 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 399: +#line 2712 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D, true); } -#line 8046 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8371 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 385: -#line 2591 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 400: +#line 2717 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true); } -#line 8056 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8381 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 386: -#line 2596 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 401: +#line 2722 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube, true); } -#line 8066 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8391 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 387: -#line 2601 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 402: +#line 2727 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D); } -#line 8076 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8401 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 388: -#line 2606 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 403: +#line 2732 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D); } -#line 8086 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8411 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 389: -#line 2611 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 404: +#line 2737 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd3D); } -#line 8096 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8421 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 390: -#line 2616 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 405: +#line 2742 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube); } -#line 8106 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8431 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 391: -#line 2621 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 406: +#line 2747 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D, true); } -#line 8116 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8441 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 392: -#line 2626 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 407: +#line 2752 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true); } -#line 8126 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8451 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 393: -#line 2631 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 408: +#line 2757 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube, true); } -#line 8136 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8461 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 394: -#line 2636 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 409: +#line 2762 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdRect); } -#line 8146 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8471 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 395: -#line 2641 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 410: +#line 2767 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -8155,41 +8480,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdRect); #endif } -#line 8159 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8484 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 396: -#line 2649 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 411: +#line 2775 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdRect); } -#line 8169 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8494 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 397: -#line 2654 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 412: +#line 2780 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdRect); } -#line 8179 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8504 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 398: -#line 2659 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 413: +#line 2785 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdBuffer); } -#line 8189 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8514 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 399: -#line 2664 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 414: +#line 2790 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -8198,41 +8523,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdBuffer); #endif } -#line 8202 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8527 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 400: -#line 2672 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 415: +#line 2798 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdBuffer); } -#line 8212 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8537 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 401: -#line 2677 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 416: +#line 2803 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdBuffer); } -#line 8222 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8547 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 402: -#line 2682 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 417: +#line 2808 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, false, false, true); } -#line 8232 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8557 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 403: -#line 2687 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 418: +#line 2813 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -8241,41 +8566,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, false, false, true); #endif } -#line 8245 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8570 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 404: -#line 2695 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 419: +#line 2821 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, false, false, true); } -#line 8255 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8580 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 405: -#line 2700 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 420: +#line 2826 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, false, false, true); } -#line 8265 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8590 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 406: -#line 2705 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 421: +#line 2831 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true, false, true); } -#line 8275 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8600 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 407: -#line 2710 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 422: +#line 2836 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -8284,41 +8609,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true, false, true); #endif } -#line 8288 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8613 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 408: -#line 2718 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 423: +#line 2844 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true, false, true); } -#line 8298 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8623 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 409: -#line 2723 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 424: +#line 2849 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true, false, true); } -#line 8308 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8633 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 410: -#line 2728 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 425: +#line 2854 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D); } -#line 8318 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8643 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 411: -#line 2733 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 426: +#line 2859 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -8327,41 +8652,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D); #endif } -#line 8331 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8656 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 412: -#line 2741 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 427: +#line 2867 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd1D); } -#line 8341 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8666 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 413: -#line 2746 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 428: +#line 2872 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd1D); } -#line 8351 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8676 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 414: -#line 2751 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 429: +#line 2877 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D); } -#line 8361 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8686 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 415: -#line 2756 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 430: +#line 2882 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -8370,41 +8695,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D); #endif } -#line 8374 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8699 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 416: -#line 2764 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 431: +#line 2890 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D); } -#line 8384 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8709 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 417: -#line 2769 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 432: +#line 2895 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D); } -#line 8394 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8719 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 418: -#line 2774 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 433: +#line 2900 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd3D); } -#line 8404 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8729 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 419: -#line 2779 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 434: +#line 2905 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -8413,41 +8738,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, Esd3D); #endif } -#line 8417 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8742 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 420: -#line 2787 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 435: +#line 2913 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd3D); } -#line 8427 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8752 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 421: -#line 2792 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 436: +#line 2918 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd3D); } -#line 8437 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8762 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 422: -#line 2797 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 437: +#line 2923 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdRect); } -#line 8447 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8772 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 423: -#line 2802 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 438: +#line 2928 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -8456,41 +8781,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, EsdRect); #endif } -#line 8460 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8785 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 424: -#line 2810 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 439: +#line 2936 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdRect); } -#line 8470 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8795 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 425: -#line 2815 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 440: +#line 2941 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdRect); } -#line 8480 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8805 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 426: -#line 2820 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 441: +#line 2946 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube); } -#line 8490 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8815 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 427: -#line 2825 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 442: +#line 2951 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -8499,41 +8824,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube); #endif } -#line 8503 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8828 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 428: -#line 2833 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 443: +#line 2959 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdCube); } -#line 8513 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8838 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 429: -#line 2838 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 444: +#line 2964 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdCube); } -#line 8523 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8848 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 430: -#line 2843 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 445: +#line 2969 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdBuffer); } -#line 8533 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8858 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 431: -#line 2848 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 446: +#line 2974 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -8542,41 +8867,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, EsdBuffer); #endif } -#line 8546 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8871 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 432: -#line 2856 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 447: +#line 2982 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdBuffer); } -#line 8556 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8881 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 433: -#line 2861 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 448: +#line 2987 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdBuffer); } -#line 8566 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8891 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 434: -#line 2866 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 449: +#line 2992 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D, true); } -#line 8576 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8901 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 435: -#line 2871 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 450: +#line 2997 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -8585,41 +8910,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D, true); #endif } -#line 8589 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8914 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 436: -#line 2879 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 451: +#line 3005 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd1D, true); } -#line 8599 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8924 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 437: -#line 2884 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 452: +#line 3010 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd1D, true); } -#line 8609 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8934 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 438: -#line 2889 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 453: +#line 3015 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true); } -#line 8619 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8944 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 439: -#line 2894 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 454: +#line 3020 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -8628,41 +8953,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true); #endif } -#line 8632 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8957 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 440: -#line 2902 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 455: +#line 3028 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true); } -#line 8642 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8967 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 441: -#line 2907 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 456: +#line 3033 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true); } -#line 8652 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8977 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 442: -#line 2912 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 457: +#line 3038 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube, true); } -#line 8662 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8987 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 443: -#line 2917 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 458: +#line 3043 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -8671,41 +8996,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube, true); #endif } -#line 8675 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9000 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 444: -#line 2925 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 459: +#line 3051 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdCube, true); } -#line 8685 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9010 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 445: -#line 2930 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 460: +#line 3056 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdCube, true); } -#line 8695 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9020 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 446: -#line 2935 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 461: +#line 3061 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, false, false, true); } -#line 8705 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9030 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 447: -#line 2940 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 462: +#line 3066 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -8714,41 +9039,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, false, false, true); #endif } -#line 8718 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9043 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 448: -#line 2948 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 463: +#line 3074 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, false, false, true); } -#line 8728 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9053 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 449: -#line 2953 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 464: +#line 3079 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, false, false, true); } -#line 8738 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9063 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 450: -#line 2958 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 465: +#line 3084 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true, false, true); } -#line 8748 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9073 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 451: -#line 2963 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 466: +#line 3089 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -8757,64 +9082,64 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true, false, true); #endif } -#line 8761 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9086 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 452: -#line 2971 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 467: +#line 3097 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true, false, true); } -#line 8771 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9096 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 453: -#line 2976 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 468: +#line 3102 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true, false, true); } -#line 8781 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9106 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 454: -#line 2981 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 469: +#line 3107 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // GL_OES_EGL_image_external (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); (yyval.interm.type).sampler.external = true; } -#line 8792 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9117 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 455: -#line 2987 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 470: +#line 3113 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat); } -#line 8803 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9128 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 456: -#line 2993 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 471: +#line 3119 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat, true); } -#line 8814 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9139 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 457: -#line 2999 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 472: +#line 3125 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); @@ -8824,11 +9149,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setSubpass(EbtFloat16); #endif } -#line 8828 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9153 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 458: -#line 3008 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 473: +#line 3134 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); @@ -8838,65 +9163,65 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setSubpass(EbtFloat16, true); #endif } -#line 8842 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9167 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 459: -#line 3017 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 474: +#line 3143 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt); } -#line 8853 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9178 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 460: -#line 3023 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 475: +#line 3149 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt, true); } -#line 8864 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9189 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 461: -#line 3029 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 476: +#line 3155 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint); } -#line 8875 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9200 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 462: -#line 3035 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 477: +#line 3161 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint, true); } -#line 8886 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9211 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 463: -#line 3041 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 478: +#line 3167 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[0].interm.type); (yyval.interm.type).qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; parseContext.structTypeCheck((yyval.interm.type).loc, (yyval.interm.type)); } -#line 8896 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9221 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 464: -#line 3046 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 479: +#line 3172 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // // This is for user defined type names. The lexical phase looked up the @@ -8910,47 +9235,47 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); } else parseContext.error((yyvsp[0].lex).loc, "expected type name", (yyvsp[0].lex).string->c_str(), ""); } -#line 8914 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9239 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 465: -#line 3062 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 480: +#line 3188 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "highp precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqHigh); } -#line 8924 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9249 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 466: -#line 3067 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 481: +#line 3193 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "mediump precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqMedium); } -#line 8934 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9259 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 467: -#line 3072 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 482: +#line 3198 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "lowp precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqLow); } -#line 8944 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9269 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 468: -#line 3080 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 483: +#line 3206 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.nestedStructCheck((yyvsp[-2].lex).loc); } -#line 8950 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9275 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 469: -#line 3080 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 484: +#line 3206 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { TType* structure = new TType((yyvsp[-1].interm.typeList), *(yyvsp[-4].lex).string); parseContext.structArrayCheck((yyvsp[-4].lex).loc, *structure); @@ -8962,17 +9287,17 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 8966 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9291 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 470: -#line 3091 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 485: +#line 3217 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.nestedStructCheck((yyvsp[-1].lex).loc); } -#line 8972 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9297 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 471: -#line 3091 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 486: +#line 3217 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { TType* structure = new TType((yyvsp[-1].interm.typeList), TString("")); (yyval.interm.type).init((yyvsp[-4].lex).loc); @@ -8980,19 +9305,19 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 8984 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9309 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 472: -#line 3101 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 487: +#line 3227 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeList) = (yyvsp[0].interm.typeList); } -#line 8992 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9317 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 473: -#line 3104 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 488: +#line 3230 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); for (unsigned int i = 0; i < (yyvsp[0].interm.typeList)->size(); ++i) { @@ -9003,11 +9328,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.typeList)->push_back((*(yyvsp[0].interm.typeList))[i]); } } -#line 9007 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9332 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 474: -#line 3117 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 489: +#line 3243 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -9030,11 +9355,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 9034 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9359 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 475: -#line 3139 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 490: +#line 3265 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -9059,38 +9384,38 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 9063 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9388 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 476: -#line 3166 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 491: +#line 3292 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeList) = new TTypeList; (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 9072 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9397 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 477: -#line 3170 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 492: +#line 3296 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 9080 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9405 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 478: -#line 3176 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 493: +#line 3302 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeLine).type = new TType(EbtVoid); (yyval.interm.typeLine).loc = (yyvsp[0].lex).loc; (yyval.interm.typeLine).type->setFieldName(*(yyvsp[0].lex).string); } -#line 9090 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9415 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 479: -#line 3181 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 494: +#line 3307 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.arrayOfArrayVersionCheck((yyvsp[-1].lex).loc, (yyvsp[0].interm).arraySizes); @@ -9099,219 +9424,219 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.typeLine).type->setFieldName(*(yyvsp[-1].lex).string); (yyval.interm.typeLine).type->transferArraySizes((yyvsp[0].interm).arraySizes); } -#line 9103 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9428 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 480: -#line 3192 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 495: +#line 3318 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 9111 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9436 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 481: -#line 3195 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 496: +#line 3321 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { const char* initFeature = "{ } style initializers"; parseContext.requireProfile((yyvsp[-2].lex).loc, ~EEsProfile, initFeature); parseContext.profileRequires((yyvsp[-2].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); } -#line 9122 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9447 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 482: -#line 3201 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 497: +#line 3327 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { const char* initFeature = "{ } style initializers"; parseContext.requireProfile((yyvsp[-3].lex).loc, ~EEsProfile, initFeature); parseContext.profileRequires((yyvsp[-3].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 9133 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9458 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 483: -#line 3210 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 498: +#line 3336 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(0, (yyvsp[0].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)->getLoc()); } -#line 9141 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9466 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 484: -#line 3213 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 499: +#line 3339 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); } -#line 9149 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9474 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 485: -#line 3219 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 500: +#line 3345 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9155 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9480 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 486: -#line 3223 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 501: +#line 3349 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9161 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9486 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 487: -#line 3224 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 502: +#line 3350 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9167 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9492 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 488: -#line 3230 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 503: +#line 3356 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9173 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9498 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 489: -#line 3231 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 504: +#line 3357 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9179 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9504 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 490: -#line 3232 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 505: +#line 3358 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9185 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9510 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 491: -#line 3233 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 506: +#line 3359 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9191 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9516 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 492: -#line 3234 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 507: +#line 3360 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9197 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9522 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 493: -#line 3235 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 508: +#line 3361 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9203 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9528 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 494: -#line 3236 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 509: +#line 3362 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9209 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9534 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 495: -#line 3240 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 510: +#line 3366 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; } -#line 9215 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9540 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 496: -#line 3241 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 511: +#line 3367 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; } -#line 9224 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9549 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 497: -#line 3245 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 512: +#line 3371 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; } -#line 9233 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9558 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 498: -#line 3249 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 513: +#line 3375 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-2].interm.intermNode) && (yyvsp[-2].interm.intermNode)->getAsAggregate()) (yyvsp[-2].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-2].interm.intermNode); } -#line 9243 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9568 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 499: -#line 3257 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 514: +#line 3383 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9249 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9574 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 500: -#line 3258 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 515: +#line 3384 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9255 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9580 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 501: -#line 3262 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 516: +#line 3388 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { ++parseContext.controlFlowNestingLevel; } -#line 9263 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9588 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 502: -#line 3265 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 517: +#line 3391 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9272 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9597 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 503: -#line 3269 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 518: +#line 3395 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 9282 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9607 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 504: -#line 3274 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 519: +#line 3400 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9293 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9618 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 505: -#line 3283 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 520: +#line 3409 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; } -#line 9301 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9626 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 506: -#line 3286 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 521: +#line 3412 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-1].interm.intermNode) && (yyvsp[-1].interm.intermNode)->getAsAggregate()) (yyvsp[-1].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-1].interm.intermNode); } -#line 9311 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9636 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 507: -#line 3294 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 522: +#line 3420 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || @@ -9320,11 +9645,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case } } -#line 9324 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9649 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 508: -#line 3302 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 523: +#line 3428 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || (yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) { @@ -9333,76 +9658,76 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); } else (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 9337 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9662 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 509: -#line 3313 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 524: +#line 3439 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; } -#line 9343 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9668 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 510: -#line 3314 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 525: +#line 3440 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = static_cast((yyvsp[-1].interm.intermTypedNode)); } -#line 9349 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9674 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 511: -#line 3318 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 526: +#line 3444 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9357 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9682 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 512: -#line 3321 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 527: +#line 3447 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.handleSelectionAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9366 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9691 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 513: -#line 3327 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 528: +#line 3453 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-2].interm.intermTypedNode)); (yyval.interm.intermNode) = parseContext.intermediate.addSelection((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.nodePair), (yyvsp[-4].lex).loc); } -#line 9375 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9700 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 514: -#line 3334 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 529: +#line 3460 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermNode); } -#line 9384 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9709 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 515: -#line 3338 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 530: +#line 3464 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.nodePair).node1 = (yyvsp[0].interm.intermNode); (yyval.interm.nodePair).node2 = 0; } -#line 9393 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9718 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 516: -#line 3346 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 531: +#line 3472 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); parseContext.boolCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)); } -#line 9402 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9727 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 517: -#line 3350 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 532: +#line 3476 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.boolCheck((yyvsp[-2].lex).loc, (yyvsp[-3].interm.type)); @@ -9413,28 +9738,28 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); else (yyval.interm.intermTypedNode) = 0; } -#line 9417 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9742 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 518: -#line 3363 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 533: +#line 3489 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9425 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9750 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 519: -#line 3366 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 534: +#line 3492 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.handleSwitchAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9434 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9759 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 520: -#line 3372 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 535: +#line 3498 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // start new switch sequence on the switch stack ++parseContext.controlFlowNestingLevel; @@ -9443,11 +9768,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.switchLevel.push_back(parseContext.statementNestingLevel); parseContext.symbolTable.push(); } -#line 9447 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9772 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 521: -#line 3380 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 536: +#line 3506 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = parseContext.addSwitch((yyvsp[-7].lex).loc, (yyvsp[-5].interm.intermTypedNode), (yyvsp[-1].interm.intermNode) ? (yyvsp[-1].interm.intermNode)->getAsAggregate() : 0); delete parseContext.switchSequenceStack.back(); @@ -9457,27 +9782,27 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 9461 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9786 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 522: -#line 3392 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 537: +#line 3518 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; } -#line 9469 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9794 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 523: -#line 3395 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 538: +#line 3521 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9477 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9802 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 524: -#line 3401 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 539: +#line 3527 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) @@ -9490,11 +9815,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpCase, (yyvsp[-1].interm.intermTypedNode), (yyvsp[-2].lex).loc); } } -#line 9494 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9819 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 525: -#line 3413 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 540: +#line 3539 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) @@ -9504,28 +9829,28 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); else (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDefault, (yyvsp[-1].lex).loc); } -#line 9508 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9833 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 526: -#line 3425 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 541: +#line 3551 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9516 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9841 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 527: -#line 3428 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 542: +#line 3554 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.handleLoopAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9525 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9850 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 528: -#line 3434 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 543: +#line 3560 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if (! parseContext.limits.whileLoops) parseContext.error((yyvsp[-1].lex).loc, "while loops not available", "limitation", ""); @@ -9534,11 +9859,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 9538 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9863 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 529: -#line 3442 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 544: +#line 3568 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); (yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[0].interm.intermNode), (yyvsp[-2].interm.intermTypedNode), 0, true, (yyvsp[-5].lex).loc); @@ -9546,21 +9871,21 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 9550 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9875 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 530: -#line 3449 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 545: +#line 3575 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 9560 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9885 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 531: -#line 3454 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 546: +#line 3580 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if (! parseContext.limits.whileLoops) parseContext.error((yyvsp[-7].lex).loc, "do-while loops not available", "limitation", ""); @@ -9572,22 +9897,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 9576 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9901 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 532: -#line 3465 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 547: +#line 3591 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 9587 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9912 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 533: -#line 3471 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 548: +#line 3597 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[-3].interm.intermNode), (yyvsp[-5].lex).loc); @@ -9600,81 +9925,81 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 9604 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9929 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 534: -#line 3486 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 549: +#line 3612 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9612 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9937 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 535: -#line 3489 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 550: +#line 3615 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9620 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9945 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 536: -#line 3495 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 551: +#line 3621 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 9628 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9953 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 537: -#line 3498 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 552: +#line 3624 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = 0; } -#line 9636 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9961 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 538: -#line 3504 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 553: +#line 3630 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.nodePair).node1 = (yyvsp[-1].interm.intermTypedNode); (yyval.interm.nodePair).node2 = 0; } -#line 9645 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9970 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 539: -#line 3508 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 554: +#line 3634 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermTypedNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermTypedNode); } -#line 9654 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9979 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 540: -#line 3515 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 555: +#line 3641 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if (parseContext.loopNestingLevel <= 0) parseContext.error((yyvsp[-1].lex).loc, "continue statement only allowed in loops", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpContinue, (yyvsp[-1].lex).loc); } -#line 9664 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9989 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 541: -#line 3520 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 556: +#line 3646 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if (parseContext.loopNestingLevel + parseContext.switchSequenceStack.size() <= 0) parseContext.error((yyvsp[-1].lex).loc, "break statement only allowed in switch and loops", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpBreak, (yyvsp[-1].lex).loc); } -#line 9674 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9999 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 542: -#line 3525 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 557: +#line 3651 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[-1].lex).loc); if (parseContext.currentFunctionType->getBasicType() != EbtVoid) @@ -9682,83 +10007,83 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); if (parseContext.inMain) parseContext.postEntryPointReturn = true; } -#line 9686 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10011 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 543: -#line 3532 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 558: +#line 3658 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = parseContext.handleReturnValue((yyvsp[-2].lex).loc, (yyvsp[-1].interm.intermTypedNode)); } -#line 9694 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10019 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 544: -#line 3535 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 559: +#line 3661 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "discard"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpKill, (yyvsp[-1].lex).loc); } -#line 9703 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10028 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 545: -#line 3544 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 560: +#line 3670 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } -#line 9712 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10037 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 546: -#line 3548 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 561: +#line 3674 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[0].interm.intermNode) != nullptr) { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } } -#line 9723 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10048 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 547: -#line 3557 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 562: +#line 3683 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9731 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10056 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 548: -#line 3560 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 563: +#line 3686 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9739 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10064 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 549: -#line 3563 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 564: +#line 3689 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireProfile((yyvsp[0].lex).loc, ~EEsProfile, "extraneous semicolon"); parseContext.profileRequires((yyvsp[0].lex).loc, ~EEsProfile, 460, nullptr, "extraneous semicolon"); (yyval.interm.intermNode) = nullptr; } -#line 9749 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10074 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 550: -#line 3571 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 565: +#line 3697 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyvsp[0].interm).function = parseContext.handleFunctionDeclarator((yyvsp[0].interm).loc, *(yyvsp[0].interm).function, false /* not prototype */); (yyvsp[0].interm).intermNode = parseContext.handleFunctionDefinition((yyvsp[0].interm).loc, *(yyvsp[0].interm).function); } -#line 9758 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10083 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 551: -#line 3575 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 566: +#line 3701 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // May be best done as post process phase on intermediate code if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue) @@ -9774,52 +10099,52 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermNode)->getAsAggregate()->setDebug(parseContext.contextPragma.debug); (yyval.interm.intermNode)->getAsAggregate()->setPragmaTable(parseContext.contextPragma.pragmaTable); } -#line 9778 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10103 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 552: -#line 3593 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 567: +#line 3719 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.attributes) = (yyvsp[-2].interm.attributes); parseContext.requireExtensions((yyvsp[-4].lex).loc, 1, &E_GL_EXT_control_flow_attributes, "attribute"); } -#line 9787 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10112 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 553: -#line 3599 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 568: +#line 3725 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.attributes) = (yyvsp[0].interm.attributes); } -#line 9795 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10120 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 554: -#line 3602 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 569: +#line 3728 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.attributes) = parseContext.mergeAttributes((yyvsp[-2].interm.attributes), (yyvsp[0].interm.attributes)); } -#line 9803 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10128 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 555: -#line 3607 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 570: +#line 3733 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[0].lex).string); } -#line 9811 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10136 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 556: -#line 3610 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 571: +#line 3736 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[-3].lex).string, (yyvsp[-1].interm.intermTypedNode)); } -#line 9819 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10144 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; -#line 9823 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10148 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -10047,5 +10372,5 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); #endif return yyresult; } -#line 3614 "MachineIndependent/glslang.y" /* yacc.c:1906 */ +#line 3740 "MachineIndependent/glslang.y" /* yacc.c:1906 */ diff --git a/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp.h b/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp.h index 7cfb7976..50bbcfcb 100644 --- a/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp.h +++ b/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp.h @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.0. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -125,320 +125,335 @@ extern int yydebug; BUFFER = 335, SHARED = 336, NONUNIFORM = 337, - COHERENT = 338, - VOLATILE = 339, - RESTRICT = 340, - READONLY = 341, - WRITEONLY = 342, - DVEC2 = 343, - DVEC3 = 344, - DVEC4 = 345, - DMAT2 = 346, - DMAT3 = 347, - DMAT4 = 348, - F16VEC2 = 349, - F16VEC3 = 350, - F16VEC4 = 351, - F16MAT2 = 352, - F16MAT3 = 353, - F16MAT4 = 354, - F32VEC2 = 355, - F32VEC3 = 356, - F32VEC4 = 357, - F32MAT2 = 358, - F32MAT3 = 359, - F32MAT4 = 360, - F64VEC2 = 361, - F64VEC3 = 362, - F64VEC4 = 363, - F64MAT2 = 364, - F64MAT3 = 365, - F64MAT4 = 366, - NOPERSPECTIVE = 367, - FLAT = 368, - SMOOTH = 369, - LAYOUT = 370, - __EXPLICITINTERPAMD = 371, - MAT2X2 = 372, - MAT2X3 = 373, - MAT2X4 = 374, - MAT3X2 = 375, - MAT3X3 = 376, - MAT3X4 = 377, - MAT4X2 = 378, - MAT4X3 = 379, - MAT4X4 = 380, - DMAT2X2 = 381, - DMAT2X3 = 382, - DMAT2X4 = 383, - DMAT3X2 = 384, - DMAT3X3 = 385, - DMAT3X4 = 386, - DMAT4X2 = 387, - DMAT4X3 = 388, - DMAT4X4 = 389, - F16MAT2X2 = 390, - F16MAT2X3 = 391, - F16MAT2X4 = 392, - F16MAT3X2 = 393, - F16MAT3X3 = 394, - F16MAT3X4 = 395, - F16MAT4X2 = 396, - F16MAT4X3 = 397, - F16MAT4X4 = 398, - F32MAT2X2 = 399, - F32MAT2X3 = 400, - F32MAT2X4 = 401, - F32MAT3X2 = 402, - F32MAT3X3 = 403, - F32MAT3X4 = 404, - F32MAT4X2 = 405, - F32MAT4X3 = 406, - F32MAT4X4 = 407, - F64MAT2X2 = 408, - F64MAT2X3 = 409, - F64MAT2X4 = 410, - F64MAT3X2 = 411, - F64MAT3X3 = 412, - F64MAT3X4 = 413, - F64MAT4X2 = 414, - F64MAT4X3 = 415, - F64MAT4X4 = 416, - ATOMIC_UINT = 417, - SAMPLER1D = 418, - SAMPLER2D = 419, - SAMPLER3D = 420, - SAMPLERCUBE = 421, - SAMPLER1DSHADOW = 422, - SAMPLER2DSHADOW = 423, - SAMPLERCUBESHADOW = 424, - SAMPLER1DARRAY = 425, - SAMPLER2DARRAY = 426, - SAMPLER1DARRAYSHADOW = 427, - SAMPLER2DARRAYSHADOW = 428, - ISAMPLER1D = 429, - ISAMPLER2D = 430, - ISAMPLER3D = 431, - ISAMPLERCUBE = 432, - ISAMPLER1DARRAY = 433, - ISAMPLER2DARRAY = 434, - USAMPLER1D = 435, - USAMPLER2D = 436, - USAMPLER3D = 437, - USAMPLERCUBE = 438, - USAMPLER1DARRAY = 439, - USAMPLER2DARRAY = 440, - SAMPLER2DRECT = 441, - SAMPLER2DRECTSHADOW = 442, - ISAMPLER2DRECT = 443, - USAMPLER2DRECT = 444, - SAMPLERBUFFER = 445, - ISAMPLERBUFFER = 446, - USAMPLERBUFFER = 447, - SAMPLERCUBEARRAY = 448, - SAMPLERCUBEARRAYSHADOW = 449, - ISAMPLERCUBEARRAY = 450, - USAMPLERCUBEARRAY = 451, - SAMPLER2DMS = 452, - ISAMPLER2DMS = 453, - USAMPLER2DMS = 454, - SAMPLER2DMSARRAY = 455, - ISAMPLER2DMSARRAY = 456, - USAMPLER2DMSARRAY = 457, - SAMPLEREXTERNALOES = 458, - F16SAMPLER1D = 459, - F16SAMPLER2D = 460, - F16SAMPLER3D = 461, - F16SAMPLER2DRECT = 462, - F16SAMPLERCUBE = 463, - F16SAMPLER1DARRAY = 464, - F16SAMPLER2DARRAY = 465, - F16SAMPLERCUBEARRAY = 466, - F16SAMPLERBUFFER = 467, - F16SAMPLER2DMS = 468, - F16SAMPLER2DMSARRAY = 469, - F16SAMPLER1DSHADOW = 470, - F16SAMPLER2DSHADOW = 471, - F16SAMPLER1DARRAYSHADOW = 472, - F16SAMPLER2DARRAYSHADOW = 473, - F16SAMPLER2DRECTSHADOW = 474, - F16SAMPLERCUBESHADOW = 475, - F16SAMPLERCUBEARRAYSHADOW = 476, - SAMPLER = 477, - SAMPLERSHADOW = 478, - TEXTURE1D = 479, - TEXTURE2D = 480, - TEXTURE3D = 481, - TEXTURECUBE = 482, - TEXTURE1DARRAY = 483, - TEXTURE2DARRAY = 484, - ITEXTURE1D = 485, - ITEXTURE2D = 486, - ITEXTURE3D = 487, - ITEXTURECUBE = 488, - ITEXTURE1DARRAY = 489, - ITEXTURE2DARRAY = 490, - UTEXTURE1D = 491, - UTEXTURE2D = 492, - UTEXTURE3D = 493, - UTEXTURECUBE = 494, - UTEXTURE1DARRAY = 495, - UTEXTURE2DARRAY = 496, - TEXTURE2DRECT = 497, - ITEXTURE2DRECT = 498, - UTEXTURE2DRECT = 499, - TEXTUREBUFFER = 500, - ITEXTUREBUFFER = 501, - UTEXTUREBUFFER = 502, - TEXTURECUBEARRAY = 503, - ITEXTURECUBEARRAY = 504, - UTEXTURECUBEARRAY = 505, - TEXTURE2DMS = 506, - ITEXTURE2DMS = 507, - UTEXTURE2DMS = 508, - TEXTURE2DMSARRAY = 509, - ITEXTURE2DMSARRAY = 510, - UTEXTURE2DMSARRAY = 511, - F16TEXTURE1D = 512, - F16TEXTURE2D = 513, - F16TEXTURE3D = 514, - F16TEXTURE2DRECT = 515, - F16TEXTURECUBE = 516, - F16TEXTURE1DARRAY = 517, - F16TEXTURE2DARRAY = 518, - F16TEXTURECUBEARRAY = 519, - F16TEXTUREBUFFER = 520, - F16TEXTURE2DMS = 521, - F16TEXTURE2DMSARRAY = 522, - SUBPASSINPUT = 523, - SUBPASSINPUTMS = 524, - ISUBPASSINPUT = 525, - ISUBPASSINPUTMS = 526, - USUBPASSINPUT = 527, - USUBPASSINPUTMS = 528, - F16SUBPASSINPUT = 529, - F16SUBPASSINPUTMS = 530, - IMAGE1D = 531, - IIMAGE1D = 532, - UIMAGE1D = 533, - IMAGE2D = 534, - IIMAGE2D = 535, - UIMAGE2D = 536, - IMAGE3D = 537, - IIMAGE3D = 538, - UIMAGE3D = 539, - IMAGE2DRECT = 540, - IIMAGE2DRECT = 541, - UIMAGE2DRECT = 542, - IMAGECUBE = 543, - IIMAGECUBE = 544, - UIMAGECUBE = 545, - IMAGEBUFFER = 546, - IIMAGEBUFFER = 547, - UIMAGEBUFFER = 548, - IMAGE1DARRAY = 549, - IIMAGE1DARRAY = 550, - UIMAGE1DARRAY = 551, - IMAGE2DARRAY = 552, - IIMAGE2DARRAY = 553, - UIMAGE2DARRAY = 554, - IMAGECUBEARRAY = 555, - IIMAGECUBEARRAY = 556, - UIMAGECUBEARRAY = 557, - IMAGE2DMS = 558, - IIMAGE2DMS = 559, - UIMAGE2DMS = 560, - IMAGE2DMSARRAY = 561, - IIMAGE2DMSARRAY = 562, - UIMAGE2DMSARRAY = 563, - F16IMAGE1D = 564, - F16IMAGE2D = 565, - F16IMAGE3D = 566, - F16IMAGE2DRECT = 567, - F16IMAGECUBE = 568, - F16IMAGE1DARRAY = 569, - F16IMAGE2DARRAY = 570, - F16IMAGECUBEARRAY = 571, - F16IMAGEBUFFER = 572, - F16IMAGE2DMS = 573, - F16IMAGE2DMSARRAY = 574, - STRUCT = 575, - VOID = 576, - WHILE = 577, - IDENTIFIER = 578, - TYPE_NAME = 579, - FLOATCONSTANT = 580, - DOUBLECONSTANT = 581, - INT16CONSTANT = 582, - UINT16CONSTANT = 583, - INT32CONSTANT = 584, - UINT32CONSTANT = 585, - INTCONSTANT = 586, - UINTCONSTANT = 587, - INT64CONSTANT = 588, - UINT64CONSTANT = 589, - BOOLCONSTANT = 590, - FLOAT16CONSTANT = 591, - LEFT_OP = 592, - RIGHT_OP = 593, - INC_OP = 594, - DEC_OP = 595, - LE_OP = 596, - GE_OP = 597, - EQ_OP = 598, - NE_OP = 599, - AND_OP = 600, - OR_OP = 601, - XOR_OP = 602, - MUL_ASSIGN = 603, - DIV_ASSIGN = 604, - ADD_ASSIGN = 605, - MOD_ASSIGN = 606, - LEFT_ASSIGN = 607, - RIGHT_ASSIGN = 608, - AND_ASSIGN = 609, - XOR_ASSIGN = 610, - OR_ASSIGN = 611, - SUB_ASSIGN = 612, - LEFT_PAREN = 613, - RIGHT_PAREN = 614, - LEFT_BRACKET = 615, - RIGHT_BRACKET = 616, - LEFT_BRACE = 617, - RIGHT_BRACE = 618, - DOT = 619, - COMMA = 620, - COLON = 621, - EQUAL = 622, - SEMICOLON = 623, - BANG = 624, - DASH = 625, - TILDE = 626, - PLUS = 627, - STAR = 628, - SLASH = 629, - PERCENT = 630, - LEFT_ANGLE = 631, - RIGHT_ANGLE = 632, - VERTICAL_BAR = 633, - CARET = 634, - AMPERSAND = 635, - QUESTION = 636, - INVARIANT = 637, - PRECISE = 638, - HIGH_PRECISION = 639, - MEDIUM_PRECISION = 640, - LOW_PRECISION = 641, - PRECISION = 642, - PACKED = 643, - RESOURCE = 644, - SUPERP = 645 + PAYLOADNV = 338, + PAYLOADINNV = 339, + HITATTRNV = 340, + CALLDATANV = 341, + CALLDATAINNV = 342, + COHERENT = 343, + VOLATILE = 344, + RESTRICT = 345, + READONLY = 346, + WRITEONLY = 347, + DEVICECOHERENT = 348, + QUEUEFAMILYCOHERENT = 349, + WORKGROUPCOHERENT = 350, + SUBGROUPCOHERENT = 351, + NONPRIVATE = 352, + DVEC2 = 353, + DVEC3 = 354, + DVEC4 = 355, + DMAT2 = 356, + DMAT3 = 357, + DMAT4 = 358, + F16VEC2 = 359, + F16VEC3 = 360, + F16VEC4 = 361, + F16MAT2 = 362, + F16MAT3 = 363, + F16MAT4 = 364, + F32VEC2 = 365, + F32VEC3 = 366, + F32VEC4 = 367, + F32MAT2 = 368, + F32MAT3 = 369, + F32MAT4 = 370, + F64VEC2 = 371, + F64VEC3 = 372, + F64VEC4 = 373, + F64MAT2 = 374, + F64MAT3 = 375, + F64MAT4 = 376, + NOPERSPECTIVE = 377, + FLAT = 378, + SMOOTH = 379, + LAYOUT = 380, + EXPLICITINTERPAMD = 381, + PERVERTEXNV = 382, + PERPRIMITIVENV = 383, + PERVIEWNV = 384, + PERTASKNV = 385, + MAT2X2 = 386, + MAT2X3 = 387, + MAT2X4 = 388, + MAT3X2 = 389, + MAT3X3 = 390, + MAT3X4 = 391, + MAT4X2 = 392, + MAT4X3 = 393, + MAT4X4 = 394, + DMAT2X2 = 395, + DMAT2X3 = 396, + DMAT2X4 = 397, + DMAT3X2 = 398, + DMAT3X3 = 399, + DMAT3X4 = 400, + DMAT4X2 = 401, + DMAT4X3 = 402, + DMAT4X4 = 403, + F16MAT2X2 = 404, + F16MAT2X3 = 405, + F16MAT2X4 = 406, + F16MAT3X2 = 407, + F16MAT3X3 = 408, + F16MAT3X4 = 409, + F16MAT4X2 = 410, + F16MAT4X3 = 411, + F16MAT4X4 = 412, + F32MAT2X2 = 413, + F32MAT2X3 = 414, + F32MAT2X4 = 415, + F32MAT3X2 = 416, + F32MAT3X3 = 417, + F32MAT3X4 = 418, + F32MAT4X2 = 419, + F32MAT4X3 = 420, + F32MAT4X4 = 421, + F64MAT2X2 = 422, + F64MAT2X3 = 423, + F64MAT2X4 = 424, + F64MAT3X2 = 425, + F64MAT3X3 = 426, + F64MAT3X4 = 427, + F64MAT4X2 = 428, + F64MAT4X3 = 429, + F64MAT4X4 = 430, + ATOMIC_UINT = 431, + ACCSTRUCTNV = 432, + SAMPLER1D = 433, + SAMPLER2D = 434, + SAMPLER3D = 435, + SAMPLERCUBE = 436, + SAMPLER1DSHADOW = 437, + SAMPLER2DSHADOW = 438, + SAMPLERCUBESHADOW = 439, + SAMPLER1DARRAY = 440, + SAMPLER2DARRAY = 441, + SAMPLER1DARRAYSHADOW = 442, + SAMPLER2DARRAYSHADOW = 443, + ISAMPLER1D = 444, + ISAMPLER2D = 445, + ISAMPLER3D = 446, + ISAMPLERCUBE = 447, + ISAMPLER1DARRAY = 448, + ISAMPLER2DARRAY = 449, + USAMPLER1D = 450, + USAMPLER2D = 451, + USAMPLER3D = 452, + USAMPLERCUBE = 453, + USAMPLER1DARRAY = 454, + USAMPLER2DARRAY = 455, + SAMPLER2DRECT = 456, + SAMPLER2DRECTSHADOW = 457, + ISAMPLER2DRECT = 458, + USAMPLER2DRECT = 459, + SAMPLERBUFFER = 460, + ISAMPLERBUFFER = 461, + USAMPLERBUFFER = 462, + SAMPLERCUBEARRAY = 463, + SAMPLERCUBEARRAYSHADOW = 464, + ISAMPLERCUBEARRAY = 465, + USAMPLERCUBEARRAY = 466, + SAMPLER2DMS = 467, + ISAMPLER2DMS = 468, + USAMPLER2DMS = 469, + SAMPLER2DMSARRAY = 470, + ISAMPLER2DMSARRAY = 471, + USAMPLER2DMSARRAY = 472, + SAMPLEREXTERNALOES = 473, + F16SAMPLER1D = 474, + F16SAMPLER2D = 475, + F16SAMPLER3D = 476, + F16SAMPLER2DRECT = 477, + F16SAMPLERCUBE = 478, + F16SAMPLER1DARRAY = 479, + F16SAMPLER2DARRAY = 480, + F16SAMPLERCUBEARRAY = 481, + F16SAMPLERBUFFER = 482, + F16SAMPLER2DMS = 483, + F16SAMPLER2DMSARRAY = 484, + F16SAMPLER1DSHADOW = 485, + F16SAMPLER2DSHADOW = 486, + F16SAMPLER1DARRAYSHADOW = 487, + F16SAMPLER2DARRAYSHADOW = 488, + F16SAMPLER2DRECTSHADOW = 489, + F16SAMPLERCUBESHADOW = 490, + F16SAMPLERCUBEARRAYSHADOW = 491, + SAMPLER = 492, + SAMPLERSHADOW = 493, + TEXTURE1D = 494, + TEXTURE2D = 495, + TEXTURE3D = 496, + TEXTURECUBE = 497, + TEXTURE1DARRAY = 498, + TEXTURE2DARRAY = 499, + ITEXTURE1D = 500, + ITEXTURE2D = 501, + ITEXTURE3D = 502, + ITEXTURECUBE = 503, + ITEXTURE1DARRAY = 504, + ITEXTURE2DARRAY = 505, + UTEXTURE1D = 506, + UTEXTURE2D = 507, + UTEXTURE3D = 508, + UTEXTURECUBE = 509, + UTEXTURE1DARRAY = 510, + UTEXTURE2DARRAY = 511, + TEXTURE2DRECT = 512, + ITEXTURE2DRECT = 513, + UTEXTURE2DRECT = 514, + TEXTUREBUFFER = 515, + ITEXTUREBUFFER = 516, + UTEXTUREBUFFER = 517, + TEXTURECUBEARRAY = 518, + ITEXTURECUBEARRAY = 519, + UTEXTURECUBEARRAY = 520, + TEXTURE2DMS = 521, + ITEXTURE2DMS = 522, + UTEXTURE2DMS = 523, + TEXTURE2DMSARRAY = 524, + ITEXTURE2DMSARRAY = 525, + UTEXTURE2DMSARRAY = 526, + F16TEXTURE1D = 527, + F16TEXTURE2D = 528, + F16TEXTURE3D = 529, + F16TEXTURE2DRECT = 530, + F16TEXTURECUBE = 531, + F16TEXTURE1DARRAY = 532, + F16TEXTURE2DARRAY = 533, + F16TEXTURECUBEARRAY = 534, + F16TEXTUREBUFFER = 535, + F16TEXTURE2DMS = 536, + F16TEXTURE2DMSARRAY = 537, + SUBPASSINPUT = 538, + SUBPASSINPUTMS = 539, + ISUBPASSINPUT = 540, + ISUBPASSINPUTMS = 541, + USUBPASSINPUT = 542, + USUBPASSINPUTMS = 543, + F16SUBPASSINPUT = 544, + F16SUBPASSINPUTMS = 545, + IMAGE1D = 546, + IIMAGE1D = 547, + UIMAGE1D = 548, + IMAGE2D = 549, + IIMAGE2D = 550, + UIMAGE2D = 551, + IMAGE3D = 552, + IIMAGE3D = 553, + UIMAGE3D = 554, + IMAGE2DRECT = 555, + IIMAGE2DRECT = 556, + UIMAGE2DRECT = 557, + IMAGECUBE = 558, + IIMAGECUBE = 559, + UIMAGECUBE = 560, + IMAGEBUFFER = 561, + IIMAGEBUFFER = 562, + UIMAGEBUFFER = 563, + IMAGE1DARRAY = 564, + IIMAGE1DARRAY = 565, + UIMAGE1DARRAY = 566, + IMAGE2DARRAY = 567, + IIMAGE2DARRAY = 568, + UIMAGE2DARRAY = 569, + IMAGECUBEARRAY = 570, + IIMAGECUBEARRAY = 571, + UIMAGECUBEARRAY = 572, + IMAGE2DMS = 573, + IIMAGE2DMS = 574, + UIMAGE2DMS = 575, + IMAGE2DMSARRAY = 576, + IIMAGE2DMSARRAY = 577, + UIMAGE2DMSARRAY = 578, + F16IMAGE1D = 579, + F16IMAGE2D = 580, + F16IMAGE3D = 581, + F16IMAGE2DRECT = 582, + F16IMAGECUBE = 583, + F16IMAGE1DARRAY = 584, + F16IMAGE2DARRAY = 585, + F16IMAGECUBEARRAY = 586, + F16IMAGEBUFFER = 587, + F16IMAGE2DMS = 588, + F16IMAGE2DMSARRAY = 589, + STRUCT = 590, + VOID = 591, + WHILE = 592, + IDENTIFIER = 593, + TYPE_NAME = 594, + FLOATCONSTANT = 595, + DOUBLECONSTANT = 596, + INT16CONSTANT = 597, + UINT16CONSTANT = 598, + INT32CONSTANT = 599, + UINT32CONSTANT = 600, + INTCONSTANT = 601, + UINTCONSTANT = 602, + INT64CONSTANT = 603, + UINT64CONSTANT = 604, + BOOLCONSTANT = 605, + FLOAT16CONSTANT = 606, + LEFT_OP = 607, + RIGHT_OP = 608, + INC_OP = 609, + DEC_OP = 610, + LE_OP = 611, + GE_OP = 612, + EQ_OP = 613, + NE_OP = 614, + AND_OP = 615, + OR_OP = 616, + XOR_OP = 617, + MUL_ASSIGN = 618, + DIV_ASSIGN = 619, + ADD_ASSIGN = 620, + MOD_ASSIGN = 621, + LEFT_ASSIGN = 622, + RIGHT_ASSIGN = 623, + AND_ASSIGN = 624, + XOR_ASSIGN = 625, + OR_ASSIGN = 626, + SUB_ASSIGN = 627, + LEFT_PAREN = 628, + RIGHT_PAREN = 629, + LEFT_BRACKET = 630, + RIGHT_BRACKET = 631, + LEFT_BRACE = 632, + RIGHT_BRACE = 633, + DOT = 634, + COMMA = 635, + COLON = 636, + EQUAL = 637, + SEMICOLON = 638, + BANG = 639, + DASH = 640, + TILDE = 641, + PLUS = 642, + STAR = 643, + SLASH = 644, + PERCENT = 645, + LEFT_ANGLE = 646, + RIGHT_ANGLE = 647, + VERTICAL_BAR = 648, + CARET = 649, + AMPERSAND = 650, + QUESTION = 651, + INVARIANT = 652, + PRECISE = 653, + HIGH_PRECISION = 654, + MEDIUM_PRECISION = 655, + LOW_PRECISION = 656, + PRECISION = 657, + PACKED = 658, + RESOURCE = 659, + SUPERP = 660 }; #endif /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE YYSTYPE; + union YYSTYPE { #line 70 "MachineIndependent/glslang.y" /* yacc.c:1909 */ @@ -476,8 +491,10 @@ union YYSTYPE }; } interm; -#line 480 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */ +#line 495 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */ }; + +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif diff --git a/deps/glslang/glslang/MachineIndependent/intermOut.cpp b/deps/glslang/glslang/MachineIndependent/intermOut.cpp index 4d6ad040..5ad67906 100644 --- a/deps/glslang/glslang/MachineIndependent/intermOut.cpp +++ b/deps/glslang/glslang/MachineIndependent/intermOut.cpp @@ -93,7 +93,13 @@ namespace glslang { // class TOutputTraverser : public TIntermTraverser { public: - TOutputTraverser(TInfoSink& i) : infoSink(i) { } + TOutputTraverser(TInfoSink& i) : infoSink(i), extraOutput(NoExtraOutput) { } + + enum EExtraOutput { + NoExtraOutput, + BinaryDoubleOutput + }; + void setDoubleOutput(EExtraOutput extra) { extraOutput = extra; } virtual bool visitBinary(TVisit, TIntermBinary* node); virtual bool visitUnary(TVisit, TIntermUnary* node); @@ -109,6 +115,8 @@ class TOutputTraverser : public TIntermTraverser { protected: TOutputTraverser(TOutputTraverser&); TOutputTraverser& operator=(TOutputTraverser&); + + EExtraOutput extraOutput; }; // @@ -863,6 +871,8 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpAtomicXor: out.debug << "AtomicXor"; break; case EOpAtomicExchange: out.debug << "AtomicExchange"; break; case EOpAtomicCompSwap: out.debug << "AtomicCompSwap"; break; + case EOpAtomicLoad: out.debug << "AtomicLoad"; break; + case EOpAtomicStore: out.debug << "AtomicStore"; break; case EOpAtomicCounterAdd: out.debug << "AtomicCounterAdd"; break; case EOpAtomicCounterSubtract: out.debug << "AtomicCounterSubtract"; break; @@ -886,6 +896,8 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpImageAtomicXor: out.debug << "imageAtomicXor"; break; case EOpImageAtomicExchange: out.debug << "imageAtomicExchange"; break; case EOpImageAtomicCompSwap: out.debug << "imageAtomicCompSwap"; break; + case EOpImageAtomicLoad: out.debug << "imageAtomicLoad"; break; + case EOpImageAtomicStore: out.debug << "imageAtomicStore"; break; #ifdef AMD_EXTENSIONS case EOpImageLoadLod: out.debug << "imageLoadLod"; break; case EOpImageStoreLod: out.debug << "imageStoreLod"; break; @@ -944,7 +956,13 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpSparseTextureGatherLodOffsets: out.debug << "sparseTextureGatherLodOffsets"; break; case EOpSparseImageLoadLod: out.debug << "sparseImageLoadLod"; break; #endif - +#ifdef NV_EXTENSIONS + case EOpImageSampleFootprintNV: out.debug << "imageSampleFootprintNV"; break; + case EOpImageSampleFootprintClampNV: out.debug << "imageSampleFootprintClampNV"; break; + case EOpImageSampleFootprintLodNV: out.debug << "imageSampleFootprintLodNV"; break; + case EOpImageSampleFootprintGradNV: out.debug << "imageSampleFootprintGradNV"; break; + case EOpImageSampleFootprintGradClampNV: out.debug << "mageSampleFootprintGradClampNV"; break; +#endif case EOpAddCarry: out.debug << "addCarry"; break; case EOpSubBorrow: out.debug << "subBorrow"; break; case EOpUMulExtended: out.debug << "uMulExtended"; break; @@ -1030,6 +1048,15 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpSubpassLoad: out.debug << "subpassLoad"; break; case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break; +#ifdef NV_EXTENSIONS + case EOpTraceNV: out.debug << "traceNV"; break; + case EOpReportIntersectionNV: out.debug << "reportIntersectionNV"; break; + case EOpIgnoreIntersectionNV: out.debug << "ignoreIntersectionNV"; break; + case EOpTerminateRayNV: out.debug << "terminateRayNV"; break; + case EOpExecuteCallableNV: out.debug << "executeCallableNV"; break; + case EOpWritePackedPrimitiveIndices4x8NV: out.debug << "writePackedPrimitiveIndices4x8NV"; break; +#endif + default: out.debug.message(EPrefixError, "Bad aggregation op"); } @@ -1082,7 +1109,61 @@ bool TOutputTraverser::visitSelection(TVisit /* visit */, TIntermSelection* node return false; } -static void OutputConstantUnion(TInfoSink& out, const TIntermTyped* node, const TConstUnionArray& constUnion, int depth) +// Print infinities and NaNs, and numbers in a portable way. +// Goals: +// - portable (across IEEE 754 platforms) +// - shows all possible IEEE values +// - shows simple numbers in a simple way, e.g., no leading/trailing 0s +// - shows all digits, no premature rounding +static void OutputDouble(TInfoSink& out, double value, TOutputTraverser::EExtraOutput extra) +{ + if (IsInfinity(value)) { + if (value < 0) + out.debug << "-1.#INF"; + else + out.debug << "+1.#INF"; + } else if (IsNan(value)) + out.debug << "1.#IND"; + else { + const int maxSize = 340; + char buf[maxSize]; + const char* format = "%f"; + if (fabs(value) > 0.0 && (fabs(value) < 1e-5 || fabs(value) > 1e12)) + format = "%-.13e"; + int len = snprintf(buf, maxSize, format, value); + assert(len < maxSize); + + // remove a leading zero in the 100s slot in exponent; it is not portable + // pattern: XX...XXXe+0XX or XX...XXXe-0XX + if (len > 5) { + if (buf[len-5] == 'e' && (buf[len-4] == '+' || buf[len-4] == '-') && buf[len-3] == '0') { + buf[len-3] = buf[len-2]; + buf[len-2] = buf[len-1]; + buf[len-1] = '\0'; + } + } + + out.debug << buf; + + switch (extra) { + case TOutputTraverser::BinaryDoubleOutput: + { + out.debug << " : "; + long long b = *reinterpret_cast(&value); + for (size_t i = 0; i < 8 * sizeof(value); ++i, ++b) { + out.debug << ((b & 0x8000000000000000) != 0 ? "1" : "0"); + b <<= 1; + } + break; + } + default: + break; + } + } +} + +static void OutputConstantUnion(TInfoSink& out, const TIntermTyped* node, const TConstUnionArray& constUnion, + TOutputTraverser::EExtraOutput extra, int depth) { int size = node->getType().computeNumComponents(); @@ -1102,24 +1183,8 @@ static void OutputConstantUnion(TInfoSink& out, const TIntermTyped* node, const case EbtFloat: case EbtDouble: case EbtFloat16: - { - const double value = constUnion[i].getDConst(); - // Print infinities and NaNs in a portable way. - if (IsInfinity(value)) { - if (value < 0) - out.debug << "-1.#INF\n"; - else - out.debug << "+1.#INF\n"; - } else if (IsNan(value)) - out.debug << "1.#IND\n"; - else { - const int maxSize = 300; - char buf[maxSize]; - snprintf(buf, maxSize, "%f", value); - - out.debug << buf << "\n"; - } - } + OutputDouble(out, constUnion[i].getDConst(), extra); + out.debug << "\n"; break; case EbtInt8: { @@ -1205,7 +1270,7 @@ void TOutputTraverser::visitConstantUnion(TIntermConstantUnion* node) OutputTreeText(infoSink, node, depth); infoSink.debug << "Constant:\n"; - OutputConstantUnion(infoSink, node, node->getConstArray(), depth + 1); + OutputConstantUnion(infoSink, node, node->getConstArray(), extraOutput, depth + 1); } void TOutputTraverser::visitSymbol(TIntermSymbol* node) @@ -1215,7 +1280,7 @@ void TOutputTraverser::visitSymbol(TIntermSymbol* node) infoSink.debug << "'" << node->getName() << "' (" << node->getCompleteString() << ")\n"; if (! node->getConstArray().empty()) - OutputConstantUnion(infoSink, node, node->getConstArray(), depth + 1); + OutputConstantUnion(infoSink, node, node->getConstArray(), extraOutput, depth + 1); else if (node->getConstSubtree()) { incrementDepth(node); node->getConstSubtree()->traverse(this); @@ -1395,6 +1460,16 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree) } break; +#ifdef NV_EXTENSIONS + case EShLangMeshNV: + infoSink.debug << "max_vertices = " << vertices << "\n"; + infoSink.debug << "max_primitives = " << primitives << "\n"; + infoSink.debug << "output primitive = " << TQualifier::getGeometryString(outputPrimitive) << "\n"; + // Fall through + + case EShLangTaskNV: + // Fall through +#endif case EShLangCompute: infoSink.debug << "local_size = (" << localSize[0] << ", " << localSize[1] << ", " << localSize[2] << ")\n"; { @@ -1417,7 +1492,8 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree) return; TOutputTraverser it(infoSink); - + if (getBinaryDoubleOutput()) + it.setDoubleOutput(TOutputTraverser::BinaryDoubleOutput); treeRoot->traverse(&it); } diff --git a/deps/glslang/glslang/MachineIndependent/iomapper.cpp b/deps/glslang/glslang/MachineIndependent/iomapper.cpp index ad22353b..46c75583 100644 --- a/deps/glslang/glslang/MachineIndependent/iomapper.cpp +++ b/deps/glslang/glslang/MachineIndependent/iomapper.cpp @@ -132,7 +132,7 @@ class TVarGatherTraverser : public TLiveTraverser target = &inputList; else if (base->getQualifier().storage == EvqVaryingOut) target = &outputList; - else if (base->getQualifier().isUniformOrBuffer()) + else if (base->getQualifier().isUniformOrBuffer() && !base->getQualifier().layoutPushConstant) target = &uniformList; if (target) { @@ -331,8 +331,14 @@ struct TResolverInOutAdaptor ent.symbol->getType(), ent.live); } else { - TString errorMsg = "Invalid shader In/Out variable semantic: "; - errorMsg += ent.symbol->getType().getQualifier().semanticName; + TString errorMsg; + if (ent.symbol->getType().getQualifier().semanticName != nullptr) { + errorMsg = "Invalid shader In/Out variable semantic: "; + errorMsg += ent.symbol->getType().getQualifier().semanticName; + } else { + errorMsg = "Invalid shader In/Out variable: "; + errorMsg += ent.symbol->getName(); + } infoSink.info.message(EPrefixInternalError, errorMsg.c_str()); error = true; } @@ -353,7 +359,7 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver { TDefaultIoResolverBase(const TIntermediate &intermediate) : intermediate(intermediate), - nextUniformLocation(0), + nextUniformLocation(intermediate.getUniformLocationBase()), nextInputLocation(0), nextOutputLocation(0) { } @@ -383,29 +389,34 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver return !(at != slots[set].end() && *at == slot); } - int reserveSlot(int set, int slot) + int reserveSlot(int set, int slot, int size = 1) { TSlotSet::iterator at = findSlot(set, slot); // tolerate aliasing, by not double-recording aliases // (policy about appropriateness of the alias is higher up) - if (at == slots[set].end() || *at != slot) - slots[set].insert(at, slot); + for (int i = 0; i < size; i++) { + if (at == slots[set].end() || *at != slot + i) + at = slots[set].insert(at, slot + i); + ++at; + } return slot; } - int getFreeSlot(int set, int base) + int getFreeSlot(int set, int base, int size = 1) { TSlotSet::iterator at = findSlot(set, base); if (at == slots[set].end()) - return reserveSlot(set, base); + return reserveSlot(set, base, size); - // look in locksteps, if they not match, then there is a free slot - for (; at != slots[set].end(); ++at, ++base) - if (*at != base) + // look for a big enough gap + for (; at != slots[set].end(); ++at) { + if (*at - base >= size) break; - return reserveSlot(set, base); + base = *at + 1; + } + return reserveSlot(set, base, size); } virtual bool validateBinding(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool /*is_live*/) override = 0; @@ -423,7 +434,7 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver return 0; } - int resolveUniformLocation(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool /*is_live*/) override + int resolveUniformLocation(EShLanguage /*stage*/, const char* name, const glslang::TType& type, bool /*is_live*/) override { // kick out of not doing this if (!doAutoLocationMapping()) @@ -444,7 +455,11 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver return -1; } - int location = nextUniformLocation; + int location = intermediate.getUniformLocationOverride(name); + if (location != -1) + return location; + + location = nextUniformLocation; nextUniformLocation += TIntermediate::computeTypeUniformLocationSize(type); @@ -478,7 +493,16 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver // Placeholder. This does not do proper cross-stage lining up, nor // work with mixed location/no-location declarations. int location = nextLocation; - nextLocation += TIntermediate::computeTypeLocationSize(type, stage); + int typeLocationSize; + // Don’t take into account the outer-most array if the stage’s + // interface is automatically an array. + if (type.getQualifier().isArrayedIo(stage)) { + TType elementType(type, 0); + typeLocationSize = TIntermediate::computeTypeLocationSize(elementType, stage); + } else { + typeLocationSize = TIntermediate::computeTypeLocationSize(type, stage); + } + nextLocation += typeLocationSize; return location; } @@ -499,6 +523,9 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver void endResolve(EShLanguage) override {} protected: + TDefaultIoResolverBase(TDefaultIoResolverBase&); + TDefaultIoResolverBase& operator=(TDefaultIoResolverBase&); + const TIntermediate &intermediate; int nextUniformLocation; int nextInputLocation; @@ -552,40 +579,42 @@ struct TDefaultIoResolver : public TDefaultIoResolverBase int resolveBinding(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool is_live) override { const int set = getLayoutSet(type); + // On OpenGL arrays of opaque types take a seperate binding for each element + int numBindings = intermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1; if (type.getQualifier().hasBinding()) { if (isImageType(type)) - return reserveSlot(set, getBaseBinding(EResImage, set) + type.getQualifier().layoutBinding); + return reserveSlot(set, getBaseBinding(EResImage, set) + type.getQualifier().layoutBinding, numBindings); if (isTextureType(type)) - return reserveSlot(set, getBaseBinding(EResTexture, set) + type.getQualifier().layoutBinding); + return reserveSlot(set, getBaseBinding(EResTexture, set) + type.getQualifier().layoutBinding, numBindings); if (isSsboType(type)) - return reserveSlot(set, getBaseBinding(EResSsbo, set) + type.getQualifier().layoutBinding); + return reserveSlot(set, getBaseBinding(EResSsbo, set) + type.getQualifier().layoutBinding, numBindings); if (isSamplerType(type)) - return reserveSlot(set, getBaseBinding(EResSampler, set) + type.getQualifier().layoutBinding); + return reserveSlot(set, getBaseBinding(EResSampler, set) + type.getQualifier().layoutBinding, numBindings); if (isUboType(type)) - return reserveSlot(set, getBaseBinding(EResUbo, set) + type.getQualifier().layoutBinding); + return reserveSlot(set, getBaseBinding(EResUbo, set) + type.getQualifier().layoutBinding, numBindings); } else if (is_live && doAutoBindingMapping()) { // find free slot, the caller did make sure it passes all vars with binding // first and now all are passed that do not have a binding and needs one if (isImageType(type)) - return getFreeSlot(set, getBaseBinding(EResImage, set)); + return getFreeSlot(set, getBaseBinding(EResImage, set), numBindings); if (isTextureType(type)) - return getFreeSlot(set, getBaseBinding(EResTexture, set)); + return getFreeSlot(set, getBaseBinding(EResTexture, set), numBindings); if (isSsboType(type)) - return getFreeSlot(set, getBaseBinding(EResSsbo, set)); + return getFreeSlot(set, getBaseBinding(EResSsbo, set), numBindings); if (isSamplerType(type)) - return getFreeSlot(set, getBaseBinding(EResSampler, set)); + return getFreeSlot(set, getBaseBinding(EResSampler, set), numBindings); if (isUboType(type)) - return getFreeSlot(set, getBaseBinding(EResUbo, set)); + return getFreeSlot(set, getBaseBinding(EResUbo, set), numBindings); } return -1; diff --git a/deps/glslang/glslang/MachineIndependent/linkValidate.cpp b/deps/glslang/glslang/MachineIndependent/linkValidate.cpp index c80fdb36..8630128f 100644 --- a/deps/glslang/glslang/MachineIndependent/linkValidate.cpp +++ b/deps/glslang/glslang/MachineIndependent/linkValidate.cpp @@ -77,12 +77,13 @@ void TIntermediate::warn(TInfoSink& infoSink, const char* message) // void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit) { - if (source == EShSourceNone) - source = unit.source; - - if (source != unit.source) - error(infoSink, "can't link compilation units from different source languages"); + mergeCallGraphs(infoSink, unit); + mergeModes(infoSink, unit); + mergeTrees(infoSink, unit); +} +void TIntermediate::mergeCallGraphs(TInfoSink& infoSink, TIntermediate& unit) +{ if (unit.getNumEntryPoints() > 0) { if (getNumEntryPoints() > 0) error(infoSink, "can't handle multiple entry points per stage"); @@ -92,46 +93,88 @@ void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit) } } numEntryPoints += unit.getNumEntryPoints(); - numErrors += unit.getNumErrors(); - numPushConstants += unit.numPushConstants; + callGraph.insert(callGraph.end(), unit.callGraph.begin(), unit.callGraph.end()); +} - if (originUpperLeft != unit.originUpperLeft || pixelCenterInteger != unit.pixelCenterInteger) - error(infoSink, "gl_FragCoord redeclarations must match across shaders"); +#define MERGE_MAX(member) member = std::max(member, unit.member) +#define MERGE_TRUE(member) if (unit.member) member = unit.member; - if (! earlyFragmentTests) - earlyFragmentTests = unit.earlyFragmentTests; +void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit) +{ + if (language != unit.language) + error(infoSink, "stages must match when linking into a single stage"); - if (!postDepthCoverage) - postDepthCoverage = unit.postDepthCoverage; + if (source == EShSourceNone) + source = unit.source; + if (source != unit.source) + error(infoSink, "can't link compilation units from different source languages"); - if (depthLayout == EldNone) - depthLayout = unit.depthLayout; - else if (depthLayout != unit.depthLayout) - error(infoSink, "Contradictory depth layouts"); + if (treeRoot == nullptr) { + profile = unit.profile; + version = unit.version; + requestedExtensions = unit.requestedExtensions; + } else { + if ((profile == EEsProfile) != (unit.profile == EEsProfile)) + error(infoSink, "Cannot cross link ES and desktop profiles"); + else if (unit.profile == ECompatibilityProfile) + profile = ECompatibilityProfile; + version = std::max(version, unit.version); + requestedExtensions.insert(unit.requestedExtensions.begin(), unit.requestedExtensions.end()); + } - blendEquations |= unit.blendEquations; + MERGE_MAX(spvVersion.spv); + MERGE_MAX(spvVersion.vulkanGlsl); + MERGE_MAX(spvVersion.vulkan); + MERGE_MAX(spvVersion.openGl); - if (inputPrimitive == ElgNone) - inputPrimitive = unit.inputPrimitive; - else if (inputPrimitive != unit.inputPrimitive) - error(infoSink, "Contradictory input layout primitives"); + numErrors += unit.getNumErrors(); + numPushConstants += unit.numPushConstants; - if (outputPrimitive == ElgNone) - outputPrimitive = unit.outputPrimitive; - else if (outputPrimitive != unit.outputPrimitive) - error(infoSink, "Contradictory output layout primitives"); + if (unit.invocations != TQualifier::layoutNotSet) { + if (invocations == TQualifier::layoutNotSet) + invocations = unit.invocations; + else if (invocations != unit.invocations) + error(infoSink, "number of invocations must match between compilation units"); + } if (vertices == TQualifier::layoutNotSet) vertices = unit.vertices; else if (vertices != unit.vertices) { - if (language == EShLangGeometry) + if (language == EShLangGeometry +#ifdef NV_EXTENSIONS + || language == EShLangMeshNV +#endif + ) error(infoSink, "Contradictory layout max_vertices values"); else if (language == EShLangTessControl) error(infoSink, "Contradictory layout vertices values"); else assert(0); } +#ifdef NV_EXTENSIONS + if (primitives == TQualifier::layoutNotSet) + primitives = unit.primitives; + else if (primitives != unit.primitives) { + if (language == EShLangMeshNV) + error(infoSink, "Contradictory layout max_primitives values"); + else + assert(0); + } +#endif + + if (inputPrimitive == ElgNone) + inputPrimitive = unit.inputPrimitive; + else if (inputPrimitive != unit.inputPrimitive) + error(infoSink, "Contradictory input layout primitives"); + + if (outputPrimitive == ElgNone) + outputPrimitive = unit.outputPrimitive; + else if (outputPrimitive != unit.outputPrimitive) + error(infoSink, "Contradictory output layout primitives"); + + if (originUpperLeft != unit.originUpperLeft || pixelCenterInteger != unit.pixelCenterInteger) + error(infoSink, "gl_FragCoord redeclarations must match across shaders"); if (vertexSpacing == EvsNone) vertexSpacing = unit.vertexSpacing; @@ -143,8 +186,7 @@ void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit) else if (vertexOrder != unit.vertexOrder) error(infoSink, "Contradictory triangle ordering"); - if (unit.pointMode) - pointMode = true; + MERGE_TRUE(pointMode); for (int i = 0; i < 3; ++i) { if (localSize[i] > 1) @@ -158,8 +200,21 @@ void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit) error(infoSink, "Contradictory local size specialization ids"); } - if (unit.xfbMode) - xfbMode = true; + MERGE_TRUE(earlyFragmentTests); + MERGE_TRUE(postDepthCoverage); + + if (depthLayout == EldNone) + depthLayout = unit.depthLayout; + else if (depthLayout != unit.depthLayout) + error(infoSink, "Contradictory depth layouts"); + + MERGE_TRUE(depthReplacing); + MERGE_TRUE(hlslFunctionality1); + + blendEquations |= unit.blendEquations; + + MERGE_TRUE(xfbMode); + for (size_t b = 0; b < xfbBuffers.size(); ++b) { if (xfbBuffers[b].stride == TQualifier::layoutXfbStrideEnd) xfbBuffers[b].stride = unit.xfbBuffers[b].stride; @@ -171,35 +226,181 @@ void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit) // TODO: 4.4 link: enhanced layouts: compare ranges } - if (unit.treeRoot == 0) + MERGE_TRUE(multiStream); + +#ifdef NV_EXTENSIONS + MERGE_TRUE(layoutOverrideCoverage); + MERGE_TRUE(geoPassthroughEXT); +#endif + + for (unsigned int i = 0; i < unit.shiftBinding.size(); ++i) { + if (unit.shiftBinding[i] > 0) + setShiftBinding((TResourceType)i, unit.shiftBinding[i]); + } + + for (unsigned int i = 0; i < unit.shiftBindingForSet.size(); ++i) { + for (auto it = unit.shiftBindingForSet[i].begin(); it != unit.shiftBindingForSet[i].end(); ++it) + setShiftBindingForSet((TResourceType)i, it->second, it->first); + } + + resourceSetBinding.insert(resourceSetBinding.end(), unit.resourceSetBinding.begin(), unit.resourceSetBinding.end()); + + MERGE_TRUE(autoMapBindings); + MERGE_TRUE(autoMapLocations); + MERGE_TRUE(invertY); + MERGE_TRUE(flattenUniformArrays); + MERGE_TRUE(useUnknownFormat); + MERGE_TRUE(hlslOffsets); + MERGE_TRUE(useStorageBuffer); + MERGE_TRUE(hlslIoMapping); + + // TODO: sourceFile + // TODO: sourceText + // TODO: processes + + MERGE_TRUE(needToLegalize); + MERGE_TRUE(binaryDoubleOutput); +} + +// +// Merge the 'unit' AST into 'this' AST. +// That includes rationalizing the unique IDs, which were set up independently, +// and might have overlaps that are not the same symbol, or might have different +// IDs for what should be the same shared symbol. +// +void TIntermediate::mergeTrees(TInfoSink& infoSink, TIntermediate& unit) +{ + if (unit.treeRoot == nullptr) return; - if (treeRoot == 0) { + if (treeRoot == nullptr) { treeRoot = unit.treeRoot; - version = unit.version; - requestedExtensions = unit.requestedExtensions; return; } // Getting this far means we have two existing trees to merge... +#ifdef NV_EXTENSIONS + numShaderRecordNVBlocks += unit.numShaderRecordNVBlocks; +#endif - version = std::max(version, unit.version); - requestedExtensions.insert(unit.requestedExtensions.begin(), unit.requestedExtensions.end()); +#ifdef NV_EXTENSIONS + numTaskNVBlocks += unit.numTaskNVBlocks; +#endif // Get the top-level globals of each unit TIntermSequence& globals = treeRoot->getAsAggregate()->getSequence(); TIntermSequence& unitGlobals = unit.treeRoot->getAsAggregate()->getSequence(); // Get the linker-object lists - TIntermSequence& linkerObjects = findLinkerObjects(); - TIntermSequence& unitLinkerObjects = unit.findLinkerObjects(); + TIntermSequence& linkerObjects = findLinkerObjects()->getSequence(); + const TIntermSequence& unitLinkerObjects = unit.findLinkerObjects()->getSequence(); + + // Map by global name to unique ID to rationalize the same object having + // differing IDs in different trees. + TMap idMap; + int maxId; + seedIdMap(idMap, maxId); + remapIds(idMap, maxId + 1, unit); mergeBodies(infoSink, globals, unitGlobals); mergeLinkerObjects(infoSink, linkerObjects, unitLinkerObjects); - ioAccessed.insert(unit.ioAccessed.begin(), unit.ioAccessed.end()); } +// Traverser that seeds an ID map with all built-ins, and tracks the +// maximum ID used. +// (It would be nice to put this in a function, but that causes warnings +// on having no bodies for the copy-constructor/operator=.) +class TBuiltInIdTraverser : public TIntermTraverser { +public: + TBuiltInIdTraverser(TMap& idMap) : idMap(idMap), maxId(0) { } + // If it's a built in, add it to the map. + // Track the max ID. + virtual void visitSymbol(TIntermSymbol* symbol) + { + const TQualifier& qualifier = symbol->getType().getQualifier(); + if (qualifier.builtIn != EbvNone) + idMap[symbol->getName()] = symbol->getId(); + maxId = std::max(maxId, symbol->getId()); + } + int getMaxId() const { return maxId; } +protected: + TBuiltInIdTraverser(TBuiltInIdTraverser&); + TBuiltInIdTraverser& operator=(TBuiltInIdTraverser&); + TMap& idMap; + int maxId; +}; + +// Traverser that seeds an ID map with non-builtins. +// (It would be nice to put this in a function, but that causes warnings +// on having no bodies for the copy-constructor/operator=.) +class TUserIdTraverser : public TIntermTraverser { +public: + TUserIdTraverser(TMap& idMap) : idMap(idMap) { } + // If its a non-built-in global, add it to the map. + virtual void visitSymbol(TIntermSymbol* symbol) + { + const TQualifier& qualifier = symbol->getType().getQualifier(); + if (qualifier.builtIn == EbvNone) + idMap[symbol->getName()] = symbol->getId(); + } + +protected: + TUserIdTraverser(TUserIdTraverser&); + TUserIdTraverser& operator=(TUserIdTraverser&); + TMap& idMap; // over biggest id +}; + +// Initialize the the ID map with what we know of 'this' AST. +void TIntermediate::seedIdMap(TMap& idMap, int& maxId) +{ + // all built-ins everywhere need to align on IDs and contribute to the max ID + TBuiltInIdTraverser builtInIdTraverser(idMap); + treeRoot->traverse(&builtInIdTraverser); + maxId = builtInIdTraverser.getMaxId(); + + // user variables in the linker object list need to align on ids + TUserIdTraverser userIdTraverser(idMap); + findLinkerObjects()->traverse(&userIdTraverser); +} + +// Traverser to map an AST ID to what was known from the seeding AST. +// (It would be nice to put this in a function, but that causes warnings +// on having no bodies for the copy-constructor/operator=.) +class TRemapIdTraverser : public TIntermTraverser { +public: + TRemapIdTraverser(const TMap& idMap, int idShift) : idMap(idMap), idShift(idShift) { } + // Do the mapping: + // - if the same symbol, adopt the 'this' ID + // - otherwise, ensure a unique ID by shifting to a new space + virtual void visitSymbol(TIntermSymbol* symbol) + { + const TQualifier& qualifier = symbol->getType().getQualifier(); + bool remapped = false; + if (qualifier.isLinkable() || qualifier.builtIn != EbvNone) { + auto it = idMap.find(symbol->getName()); + if (it != idMap.end()) { + symbol->changeId(it->second); + remapped = true; + } + } + if (!remapped) + symbol->changeId(symbol->getId() + idShift); + } +protected: + TRemapIdTraverser(TRemapIdTraverser&); + TRemapIdTraverser& operator=(TRemapIdTraverser&); + const TMap& idMap; + int idShift; +}; + +void TIntermediate::remapIds(const TMap& idMap, int idShift, TIntermediate& unit) +{ + // Remap all IDs to either share or be unique, as dictated by the idMap and idShift. + TRemapIdTraverser idTraverser(idMap, idShift); + unit.getTreeRoot()->traverse(&idTraverser); +} + // // Merge the function bodies and global-level initializers from unitGlobals into globals. // Will error check duplication of function bodies for the same signature. @@ -344,11 +545,16 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy } // Memory... - if (symbol.getQualifier().coherent != unitSymbol.getQualifier().coherent || - symbol.getQualifier().volatil != unitSymbol.getQualifier().volatil || - symbol.getQualifier().restrict != unitSymbol.getQualifier().restrict || - symbol.getQualifier().readonly != unitSymbol.getQualifier().readonly || - symbol.getQualifier().writeonly != unitSymbol.getQualifier().writeonly) { + if (symbol.getQualifier().coherent != unitSymbol.getQualifier().coherent || + symbol.getQualifier().devicecoherent != unitSymbol.getQualifier().devicecoherent || + symbol.getQualifier().queuefamilycoherent != unitSymbol.getQualifier().queuefamilycoherent || + symbol.getQualifier().workgroupcoherent != unitSymbol.getQualifier().workgroupcoherent || + symbol.getQualifier().subgroupcoherent != unitSymbol.getQualifier().subgroupcoherent || + symbol.getQualifier().nonprivate != unitSymbol.getQualifier().nonprivate || + symbol.getQualifier().volatil != unitSymbol.getQualifier().volatil || + symbol.getQualifier().restrict != unitSymbol.getQualifier().restrict || + symbol.getQualifier().readonly != unitSymbol.getQualifier().readonly || + symbol.getQualifier().writeonly != unitSymbol.getQualifier().writeonly) { error(infoSink, "Memory qualifiers must match:"); writeTypeComparison = true; } @@ -483,17 +689,9 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled) case EShLangGeometry: if (inputPrimitive == ElgNone) error(infoSink, "At least one shader must specify an input layout primitive"); - if (outputPrimitive == ElgNone -#ifdef NV_EXTENSIONS - && !getGeoPassthroughEXT() -#endif - ) + if (outputPrimitive == ElgNone) error(infoSink, "At least one shader must specify an output layout primitive"); - if (vertices == TQualifier::layoutNotSet -#ifdef NV_EXTENSIONS - && !getGeoPassthroughEXT() -#endif - ) + if (vertices == TQualifier::layoutNotSet) error(infoSink, "At least one shader must specify a layout(max_vertices = value)"); break; case EShLangFragment: @@ -505,6 +703,42 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled) break; case EShLangCompute: break; + +#ifdef NV_EXTENSIONS + case EShLangRayGenNV: + case EShLangIntersectNV: + case EShLangAnyHitNV: + case EShLangClosestHitNV: + case EShLangMissNV: + case EShLangCallableNV: + if (numShaderRecordNVBlocks > 1) + error(infoSink, "Only one shaderRecordNV buffer block is allowed per stage"); + break; + case EShLangMeshNV: + // NV_mesh_shader doesn't allow use of both single-view and per-view builtins. + if (inIoAccessed("gl_Position") && inIoAccessed("gl_PositionPerViewNV")) + error(infoSink, "Can only use one of gl_Position or gl_PositionPerViewNV"); + if (inIoAccessed("gl_ClipDistance") && inIoAccessed("gl_ClipDistancePerViewNV")) + error(infoSink, "Can only use one of gl_ClipDistance or gl_ClipDistancePerViewNV"); + if (inIoAccessed("gl_CullDistance") && inIoAccessed("gl_CullDistancePerViewNV")) + error(infoSink, "Can only use one of gl_CullDistance or gl_CullDistancePerViewNV"); + if (inIoAccessed("gl_Layer") && inIoAccessed("gl_LayerPerViewNV")) + error(infoSink, "Can only use one of gl_Layer or gl_LayerPerViewNV"); + if (inIoAccessed("gl_ViewportMask") && inIoAccessed("gl_ViewportMaskPerViewNV")) + error(infoSink, "Can only use one of gl_ViewportMask or gl_ViewportMaskPerViewNV"); + if (outputPrimitive == ElgNone) + error(infoSink, "At least one shader must specify an output layout primitive"); + if (vertices == TQualifier::layoutNotSet) + error(infoSink, "At least one shader must specify a layout(max_vertices = value)"); + if (primitives == TQualifier::layoutNotSet) + error(infoSink, "At least one shader must specify a layout(max_primitives = value)"); + // fall through + case EShLangTaskNV: + if (numTaskNVBlocks > 1) + error(infoSink, "Only one taskNV interface block is allowed per shader"); + break; +#endif + default: error(infoSink, "Unknown Stage."); break; @@ -699,7 +933,7 @@ void TIntermediate::inOutLocationCheck(TInfoSink& infoSink) // TODO: linker functionality: location collision checking - TIntermSequence& linkObjects = findLinkerObjects(); + TIntermSequence& linkObjects = findLinkerObjects()->getSequence(); for (size_t i = 0; i < linkObjects.size(); ++i) { const TType& type = linkObjects[i]->getAsTyped()->getType(); const TQualifier& qualifier = type.getQualifier(); @@ -718,7 +952,7 @@ void TIntermediate::inOutLocationCheck(TInfoSink& infoSink) } } -TIntermSequence& TIntermediate::findLinkerObjects() const +TIntermAggregate* TIntermediate::findLinkerObjects() const { // Get the top-level globals TIntermSequence& globals = treeRoot->getAsAggregate()->getSequence(); @@ -726,7 +960,7 @@ TIntermSequence& TIntermediate::findLinkerObjects() const // Get the last member of the sequences, expected to be the linker-object lists assert(globals.back()->getAsAggregate()->getOp() == EOpLinkerObjects); - return globals.back()->getAsAggregate()->getSequence(); + return globals.back()->getAsAggregate(); } // See if a variable was both a user-declared output and used. @@ -734,7 +968,7 @@ TIntermSequence& TIntermediate::findLinkerObjects() const // is more useful, and perhaps the spec should be changed to reflect that. bool TIntermediate::userOutputUsed() const { - const TIntermSequence& linkerObjects = findLinkerObjects(); + const TIntermSequence& linkerObjects = findLinkerObjects()->getSequence(); bool found = false; for (size_t i = 0; i < linkerObjects.size(); ++i) { @@ -775,7 +1009,7 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ return -1; int size; - if (qualifier.isUniformOrBuffer()) { + if (qualifier.isUniformOrBuffer() || qualifier.isTaskMemory()) { if (type.isSizedArray()) size = type.getCumulativeArraySize(); else @@ -847,8 +1081,8 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ // combine location and component ranges TIoRange range(locationRange, componentRange, type.getBasicType(), qualifier.hasIndex() ? qualifier.layoutIndex : 0); - // check for collisions, except for vertex inputs on desktop - if (! (profile != EEsProfile && language == EShLangVertex && qualifier.isPipeInput())) + // check for collisions, except for vertex inputs on desktop targeting OpenGL + if (! (profile != EEsProfile && language == EShLangVertex && qualifier.isPipeInput()) || spvVersion.vulkan > 0) collision = checkLocationRange(set, range, type, typeCollision); if (collision < 0) @@ -926,10 +1160,19 @@ int TIntermediate::computeTypeLocationSize(const TType& type, EShLanguage stage) // TODO: perf: this can be flattened by using getCumulativeArraySize(), and a deref that discards all arrayness // TODO: are there valid cases of having an unsized array with a location? If so, running this code too early. TType elementType(type, 0); - if (type.isSizedArray()) + if (type.isSizedArray() +#ifdef NV_EXTENSIONS + && !type.getQualifier().isPerView() +#endif + ) return type.getOuterArraySize() * computeTypeLocationSize(elementType, stage); - else + else { +#ifdef NV_EXTENSIONS + // unset perViewNV attributes for arrayed per-view outputs: "perviewNV vec4 v[MAX_VIEWS][3];" + elementType.getQualifier().perViewNV = false; +#endif return computeTypeLocationSize(elementType, stage); + } } // "The locations consumed by block and structure members are determined by applying the rules above diff --git a/deps/glslang/glslang/MachineIndependent/localintermediate.h b/deps/glslang/glslang/MachineIndependent/localintermediate.h index 17e07651..99f777f1 100644 --- a/deps/glslang/glslang/MachineIndependent/localintermediate.h +++ b/deps/glslang/glslang/MachineIndependent/localintermediate.h @@ -41,6 +41,8 @@ #include "../Public/ShaderLang.h" #include "Versions.h" +#include +#include #include #include #include @@ -204,6 +206,17 @@ class TSymbolTable; class TSymbol; class TVariable; +#ifdef NV_EXTENSIONS +// +// Texture and Sampler transformation mode. +// +enum ComputeDerivativeMode { + LayoutDerivativeNone, // default layout as SPV_NV_compute_shader_derivatives not enabled + LayoutDerivativeGroupQuads, // derivative_group_quadsNV + LayoutDerivativeGroupLinear, // derivative_group_linearNV +}; +#endif + // // Set of helper functions to help parse and build the tree. // @@ -223,6 +236,10 @@ class TIntermediate { #ifdef NV_EXTENSIONS layoutOverrideCoverage(false), geoPassthroughEXT(false), + numShaderRecordNVBlocks(0), + computeDerivativeMode(LayoutDerivativeNone), + primitives(TQualifier::layoutNotSet), + numTaskNVBlocks(0), #endif autoMapBindings(false), autoMapLocations(false), @@ -231,9 +248,12 @@ class TIntermediate { useUnknownFormat(false), hlslOffsets(false), useStorageBuffer(false), + useVulkanMemoryModel(false), hlslIoMapping(false), textureSamplerTransformMode(EShTexSampTransKeep), - needToLegalize(false) + needToLegalize(false), + binaryDoubleOutput(false), + uniformLocationBase(0) { localSize[0] = 1; localSize[1] = 1; @@ -348,7 +368,7 @@ class TIntermediate { if (hlslOffsets) processes.addProcess("hlsl-offsets"); } - bool usingHlslOFfsets() const { return hlslOffsets; } + bool usingHlslOffsets() const { return hlslOffsets; } void setUseStorageBuffer() { useStorageBuffer = true; @@ -362,6 +382,12 @@ class TIntermediate { processes.addProcess("hlsl-iomap"); } bool usingHlslIoMapping() { return hlslIoMapping; } + void setUseVulkanMemoryModel() + { + useVulkanMemoryModel = true; + processes.addProcess("use-vulkan-memory-model"); + } + bool usingVulkanMemoryModel() const { return useVulkanMemoryModel; } template T addCounterBufferName(const T& name) const { return name + implicitCounterName; } bool hasCounterBufferName(const TString& name) const { @@ -405,6 +431,11 @@ class TIntermediate { int getNumEntryPoints() const { return numEntryPoints; } int getNumErrors() const { return numErrors; } void addPushConstantCount() { ++numPushConstants; } +#ifdef NV_EXTENSIONS + void addShaderRecordNVCount() { ++numShaderRecordNVBlocks; } + void addTaskNVCount() { ++numTaskNVBlocks; } +#endif + bool isRecursive() const { return recursive; } TIntermSymbol* addSymbol(const TVariable&); @@ -612,6 +643,16 @@ class TIntermediate { bool getLayoutOverrideCoverage() const { return layoutOverrideCoverage; } void setGeoPassthroughEXT() { geoPassthroughEXT = true; } bool getGeoPassthroughEXT() const { return geoPassthroughEXT; } + void setLayoutDerivativeMode(ComputeDerivativeMode mode) { computeDerivativeMode = mode; } + ComputeDerivativeMode getLayoutDerivativeModeNone() const { return computeDerivativeMode; } + bool setPrimitives(int m) + { + if (primitives != TQualifier::layoutNotSet) + return primitives == m; + primitives = m; + return true; + } + int getPrimitives() const { return primitives; } #endif const char* addSemanticName(const TString& name) @@ -623,7 +664,8 @@ class TIntermediate { const std::string& getSourceFile() const { return sourceFile; } void addSourceText(const char* text) { sourceText = sourceText + text; } const std::string& getSourceText() const { return sourceText; } - void addProcesses(const std::vector& p) { + void addProcesses(const std::vector& p) + { for (int i = 0; i < (int)p.size(); ++i) processes.addProcess(p[i]); } @@ -631,9 +673,31 @@ class TIntermediate { void addProcessArgument(const std::string& arg) { processes.addArgument(arg); } const std::vector& getProcesses() const { return processes.getProcesses(); } + void addUniformLocationOverride(const char* nameStr, int location) + { + std::string name = nameStr; + uniformLocationOverrides[name] = location; + } + + int getUniformLocationOverride(const char* nameStr) const + { + std::string name = nameStr; + auto pos = uniformLocationOverrides.find(name); + if (pos == uniformLocationOverrides.end()) + return -1; + else + return pos->second; + } + + void setUniformLocationBase(int base) { uniformLocationBase = base; } + int getUniformLocationBase() const { return uniformLocationBase; } + void setNeedsLegalization() { needToLegalize = true; } bool needsLegalization() const { return needToLegalize; } + void setBinaryDoubleOutput() { binaryDoubleOutput = true; } + bool getBinaryDoubleOutput() { return binaryDoubleOutput; } + const char* const implicitThisName; const char* const implicitCounterName; @@ -641,6 +705,11 @@ class TIntermediate { TIntermSymbol* addSymbol(int Id, const TString&, const TType&, const TConstUnionArray&, TIntermTyped* subtree, const TSourceLoc&); void error(TInfoSink& infoSink, const char*); void warn(TInfoSink& infoSink, const char*); + void mergeCallGraphs(TInfoSink&, TIntermediate&); + void mergeModes(TInfoSink&, TIntermediate&); + void mergeTrees(TInfoSink&, TIntermediate&); + void seedIdMap(TMap& idMap, int& maxId); + void remapIds(const TMap& idMap, int idShift, TIntermediate&); void mergeBodies(TInfoSink&, TIntermSequence& globals, const TIntermSequence& unitGlobals); void mergeLinkerObjects(TInfoSink&, TIntermSequence& linkerObjects, const TIntermSequence& unitLinkerObjects); void mergeImplicitArraySizes(TType&, const TType&); @@ -648,7 +717,7 @@ class TIntermediate { void checkCallGraphCycles(TInfoSink&); void checkCallGraphBodies(TInfoSink&, bool keepUncalled); void inOutLocationCheck(TInfoSink&); - TIntermSequence& findLinkerObjects() const; + TIntermAggregate* findLinkerObjects() const; bool userOutputUsed() const; bool isSpecializationOperation(const TIntermOperator&) const; bool isNonuniformPropagating(TOperator) const; @@ -670,6 +739,8 @@ class TIntermediate { EShSource source; // source language, known a bit later std::string entryPointName; std::string entryPointMangledName; + typedef std::list TGraph; + TGraph callGraph; EProfile profile; // source profile int version; // source version @@ -699,18 +770,23 @@ class TIntermediate { bool hlslFunctionality1; int blendEquations; // an 'or'ing of masks of shifts of TBlendEquationShift bool xfbMode; + std::vector xfbBuffers; // all the data we need to track per xfb buffer bool multiStream; #ifdef NV_EXTENSIONS bool layoutOverrideCoverage; bool geoPassthroughEXT; + int numShaderRecordNVBlocks; + ComputeDerivativeMode computeDerivativeMode; + int primitives; + int numTaskNVBlocks; #endif // Base shift values std::array shiftBinding; // Per-descriptor-set shift values - std::array, EResCount> shiftBindingForSet; + std::array, EResCount> shiftBindingForSet; std::vector resourceSetBinding; bool autoMapBindings; @@ -720,15 +796,12 @@ class TIntermediate { bool useUnknownFormat; bool hlslOffsets; bool useStorageBuffer; + bool useVulkanMemoryModel; bool hlslIoMapping; - typedef std::list TGraph; - TGraph callGraph; - std::set ioAccessed; // set of names of statically read/written I/O that might need extra checking std::vector usedIo[4]; // sets of used locations, one for each of in, out, uniform, and buffers std::vector usedAtomics; // sets of bindings used by atomic counters - std::vector xfbBuffers; // all the data we need to track per xfb buffer std::unordered_set usedConstantId; // specialization constant ids used std::set semanticNameSet; @@ -742,6 +815,10 @@ class TIntermediate { TProcesses processes; bool needToLegalize; + bool binaryDoubleOutput; + + std::unordered_map uniformLocationOverrides; + int uniformLocationBase; private: void operator=(TIntermediate&); // prevent assignments diff --git a/deps/glslang/glslang/MachineIndependent/parseVersions.h b/deps/glslang/glslang/MachineIndependent/parseVersions.h index b2aaa399..be468da5 100644 --- a/deps/glslang/glslang/MachineIndependent/parseVersions.h +++ b/deps/glslang/glslang/MachineIndependent/parseVersions.h @@ -79,6 +79,15 @@ class TParseVersions { virtual void fullIntegerCheck(const TSourceLoc&, const char* op); virtual void doubleCheck(const TSourceLoc&, const char* op); virtual void float16Check(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void float16ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false); + virtual bool float16Arithmetic(); + virtual void requireFloat16Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc); + virtual void int16ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false); + virtual bool int16Arithmetic(); + virtual void requireInt16Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc); + virtual void int8ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false); + virtual bool int8Arithmetic(); + virtual void requireInt8Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc); #ifdef AMD_EXTENSIONS virtual void float16OpaqueCheck(const TSourceLoc&, const char* op, bool builtIn = false); #endif @@ -94,6 +103,7 @@ class TParseVersions { virtual void requireSpv(const TSourceLoc&, const char* op); virtual bool checkExtensionsRequested(const TSourceLoc&, int numExtensions, const char* const extensions[], const char* featureDesc); virtual void updateExtensionBehavior(const char* const extension, TExtensionBehavior); + virtual void checkExtensionStage(const TSourceLoc&, const char* const extension); virtual void C_DECL error(const TSourceLoc&, const char* szReason, const char* szToken, const char* szExtraInfoFormat, ...) = 0; diff --git a/deps/glslang/glslang/MachineIndependent/pch.cpp b/deps/glslang/glslang/MachineIndependent/pch.cpp new file mode 100644 index 00000000..b7a08654 --- /dev/null +++ b/deps/glslang/glslang/MachineIndependent/pch.cpp @@ -0,0 +1,35 @@ +// +// Copyright (C) 2018 The Khronos Group Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "pch.h" diff --git a/deps/glslang/glslang/MachineIndependent/pch.h b/deps/glslang/glslang/MachineIndependent/pch.h new file mode 100644 index 00000000..6ea3761e --- /dev/null +++ b/deps/glslang/glslang/MachineIndependent/pch.h @@ -0,0 +1,49 @@ +#ifndef _PCH_H +#define _PCH_H +// +// Copyright (C) 2018 The Khronos Group Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +#include +#include +#include +#include +#include +#include +#include +#include +#include "SymbolTable.h" +#include "ParseHelper.h" +#include "Scan.h" +#include "ScanContext.h" + +#endif /* _PCH_H */ diff --git a/deps/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp b/deps/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp index 8048fa51..2000b777 100644 --- a/deps/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp +++ b/deps/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp @@ -109,11 +109,12 @@ int TPpContext::CPPdefine(TPpToken* ppToken) // save the macro name const int defAtom = atomStrings.getAddAtom(ppToken->name); + TSourceLoc defineLoc = ppToken->loc; // because ppToken might go to the next line before we report errors // gather parameters to the macro, between (...) token = scanToken(ppToken); - if (token == '(' && ! ppToken->space) { - mac.emptyArgs = 1; + if (token == '(' && !ppToken->space) { + mac.functionLike = 1; do { token = scanToken(ppToken); if (mac.args.size() == 0 && token == ')') @@ -123,7 +124,6 @@ int TPpContext::CPPdefine(TPpToken* ppToken) return token; } - mac.emptyArgs = 0; const int argAtom = atomStrings.getAddAtom(ppToken->name); // check for duplication of parameter name @@ -149,7 +149,6 @@ int TPpContext::CPPdefine(TPpToken* ppToken) } // record the definition of the macro - TSourceLoc defineLoc = ppToken->loc; // because ppToken is going to go to the next line before we report errors while (token != '\n' && token != EndOfInput) { mac.body.putToken(token, ppToken); token = scanToken(ppToken); @@ -164,7 +163,9 @@ int TPpContext::CPPdefine(TPpToken* ppToken) // Already defined -- need to make sure they are identical: // "Two replacement lists are identical if and only if the preprocessing tokens in both have the same number, // ordering, spelling, and white-space separation, where all white-space separations are considered identical." - if (existing->args.size() != mac.args.size() || existing->emptyArgs != mac.emptyArgs) + if (existing->functionLike != mac.functionLike) + parseContext.ppError(defineLoc, "Macro redefined; function-like versus object-like:", "#define", atomStrings.getString(defAtom)); + else if (existing->args.size() != mac.args.size()) parseContext.ppError(defineLoc, "Macro redefined; different number of arguments:", "#define", atomStrings.getString(defAtom)); else { if (existing->args != mac.args) @@ -515,15 +516,16 @@ int TPpContext::eval(int token, int precedence, bool shortCircuit, int& res, boo int TPpContext::evalToToken(int token, bool shortCircuit, int& res, bool& err, TPpToken* ppToken) { while (token == PpAtomIdentifier && strcmp("defined", ppToken->name) != 0) { - int macroReturn = MacroExpand(ppToken, true, false); - if (macroReturn == 0) { + switch (MacroExpand(ppToken, true, false)) { + case MacroExpandNotStarted: + case MacroExpandError: parseContext.ppError(ppToken->loc, "can't evaluate expression", "preprocessor evaluation", ""); err = true; res = 0; - token = scanToken(ppToken); break; - } - if (macroReturn == -1) { + case MacroExpandStarted: + break; + case MacroExpandUndef: if (! shortCircuit && parseContext.profile == EEsProfile) { const char* message = "undefined macro in expression not allowed in es profile"; if (parseContext.relaxedErrors()) @@ -531,8 +533,11 @@ int TPpContext::evalToToken(int token, bool shortCircuit, int& res, bool& err, T else parseContext.ppError(ppToken->loc, message, "preprocessor evaluation", ppToken->name); } + break; } token = scanToken(ppToken); + if (err) + break; } return token; @@ -1011,15 +1016,25 @@ TPpContext::TokenStream* TPpContext::PrescanMacroArg(TokenStream& arg, TPpToken* int token; while ((token = scanToken(ppToken)) != tMarkerInput::marker && token != EndOfInput) { token = tokenPaste(token, *ppToken); + if (token == PpAtomIdentifier) { + switch (MacroExpand(ppToken, false, newLineOkay)) { + case MacroExpandNotStarted: + break; + case MacroExpandError: + token = EndOfInput; + break; + case MacroExpandStarted: + case MacroExpandUndef: + continue; + } + } if (token == tMarkerInput::marker || token == EndOfInput) break; - if (token == PpAtomIdentifier && MacroExpand(ppToken, false, newLineOkay) != 0) - continue; expandedArg->putToken(token, ppToken); } if (token == EndOfInput) { - // MacroExpand ate the marker, so had bad input, recover + // Error, or MacroExpand ate the marker, so had bad input, recover delete expandedArg; expandedArg = nullptr; } else { @@ -1115,14 +1130,18 @@ int TPpContext::tZeroInput::scan(TPpToken* ppToken) } // -// Check a token to see if it is a macro that should be expanded. -// If it is, and defined, push a tInput that will produce the appropriate expansion -// and return 1. -// If it is, but undefined, and expandUndef is requested, push a tInput that will -// expand to 0 and return -1. -// Otherwise, return 0 to indicate no expansion, which is not necessarily an error. +// Check a token to see if it is a macro that should be expanded: +// - If it is, and defined, push a tInput that will produce the appropriate +// expansion and return MacroExpandStarted. +// - If it is, but undefined, and expandUndef is requested, push a tInput +// that will expand to 0 and return MacroExpandUndef. +// - Otherwise, there is no expansion, and there are two cases: +// * It might be okay there is no expansion, and no specific error was +// detected. Returns MacroExpandNotStarted. +// * The expansion was started, but could not be completed, due to an error +// that cannot be recovered from. Returns MacroExpandError. // -int TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOkay) +MacroExpandResult TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOkay) { ppToken->space = false; int macroAtom = atomStrings.getAtom(ppToken->name); @@ -1131,7 +1150,7 @@ int TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOka ppToken->ival = parseContext.getCurrentLoc().line; snprintf(ppToken->name, sizeof(ppToken->name), "%d", ppToken->ival); UngetToken(PpAtomConstInt, ppToken); - return 1; + return MacroExpandStarted; case PpAtomFileMacro: { if (parseContext.getCurrentLoc().name) @@ -1139,50 +1158,55 @@ int TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOka ppToken->ival = parseContext.getCurrentLoc().string; snprintf(ppToken->name, sizeof(ppToken->name), "%s", ppToken->loc.getStringNameOrNum().c_str()); UngetToken(PpAtomConstInt, ppToken); - return 1; + return MacroExpandStarted; } case PpAtomVersionMacro: ppToken->ival = parseContext.version; snprintf(ppToken->name, sizeof(ppToken->name), "%d", ppToken->ival); UngetToken(PpAtomConstInt, ppToken); - return 1; + return MacroExpandStarted; default: break; } MacroSymbol* macro = macroAtom == 0 ? nullptr : lookupMacroDef(macroAtom); - int depth = 0; // no recursive expansions if (macro != nullptr && macro->busy) - return 0; + return MacroExpandNotStarted; // not expanding undefined macros if ((macro == nullptr || macro->undef) && ! expandUndef) - return 0; + return MacroExpandNotStarted; // 0 is the value of an undefined macro if ((macro == nullptr || macro->undef) && expandUndef) { pushInput(new tZeroInput(this)); - return -1; + return MacroExpandUndef; } tMacroInput *in = new tMacroInput(this); TSourceLoc loc = ppToken->loc; // in case we go to the next line before discovering the error in->mac = macro; - if (macro->args.size() > 0 || macro->emptyArgs) { - int token = scanToken(ppToken); + if (macro->functionLike) { + // We don't know yet if this will be a successful call of a + // function-like macro; need to look for a '(', but without trashing + // the passed in ppToken, until we know we are no longer speculative. + TPpToken parenToken; + int token = scanToken(&parenToken); if (newLineOkay) { while (token == '\n') - token = scanToken(ppToken); + token = scanToken(&parenToken); } if (token != '(') { - UngetToken(token, ppToken); + // Function-like macro called with object-like syntax: okay, don't expand. + // (We ate exactly one token that might not be white space; put it back. + UngetToken(token, &parenToken); delete in; - return 0; + return MacroExpandNotStarted; } in->args.resize(in->mac->args.size()); for (size_t i = 0; i < in->mac->args.size(); i++) @@ -1193,39 +1217,44 @@ int TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOka size_t arg = 0; bool tokenRecorded = false; do { - depth = 0; - while (1) { + TVector nestStack; + while (true) { token = scanToken(ppToken); if (token == EndOfInput || token == tMarkerInput::marker) { parseContext.ppError(loc, "End of input in macro", "macro expansion", atomStrings.getString(macroAtom)); delete in; - return 0; + return MacroExpandError; } if (token == '\n') { if (! newLineOkay) { parseContext.ppError(loc, "End of line in macro substitution:", "macro expansion", atomStrings.getString(macroAtom)); delete in; - return 0; + return MacroExpandError; } continue; } if (token == '#') { parseContext.ppError(ppToken->loc, "unexpected '#'", "macro expansion", atomStrings.getString(macroAtom)); delete in; - return 0; + return MacroExpandError; } if (in->mac->args.size() == 0 && token != ')') break; - if (depth == 0 && (token == ',' || token == ')')) + if (nestStack.size() == 0 && (token == ',' || token == ')')) break; if (token == '(') - depth++; - if (token == ')') - depth--; + nestStack.push_back(')'); + else if (token == '{' && parseContext.isReadingHLSL()) + nestStack.push_back('}'); + else if (nestStack.size() > 0 && token == nestStack.back()) + nestStack.pop_back(); in->args[arg]->putToken(token, ppToken); tokenRecorded = true; } + // end of single argument scan + if (token == ')') { + // closing paren of call if (in->mac->args.size() == 1 && tokenRecorded == 0) break; arg++; @@ -1233,23 +1262,25 @@ int TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOka } arg++; } while (arg < in->mac->args.size()); + // end of all arguments scan if (arg < in->mac->args.size()) parseContext.ppError(loc, "Too few args in Macro", "macro expansion", atomStrings.getString(macroAtom)); else if (token != ')') { - depth=0; + // Error recover code; find end of call, if possible + int depth = 0; while (token != EndOfInput && (depth > 0 || token != ')')) { - if (token == ')') + if (token == ')' || token == '}') depth--; token = scanToken(ppToken); - if (token == '(') + if (token == '(' || token == '{') depth++; } if (token == EndOfInput) { parseContext.ppError(loc, "End of input in macro", "macro expansion", atomStrings.getString(macroAtom)); delete in; - return 0; + return MacroExpandError; } parseContext.ppError(loc, "Too many args in macro", "macro expansion", atomStrings.getString(macroAtom)); } @@ -1264,7 +1295,7 @@ int TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOka macro->busy = 1; macro->body.reset(); - return 1; + return MacroExpandStarted; } } // end namespace glslang diff --git a/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp b/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp index 6a2e05fe..c89b3768 100644 --- a/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp +++ b/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp @@ -77,6 +77,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \****************************************************************************/ #include +#include #include "PpContext.h" @@ -91,6 +92,8 @@ TPpContext::TPpContext(TParseContextBase& pc, const std::string& rootFileName, T for (elsetracker = 0; elsetracker < maxIfNesting; elsetracker++) elseSeen[elsetracker] = false; elsetracker = 0; + + strtodStream.imbue(std::locale::classic()); } TPpContext::~TPpContext() diff --git a/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.h b/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.h index 854bbbad..64681fc3 100644 --- a/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.h +++ b/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.h @@ -80,6 +80,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include #include "../ParseHelper.h" @@ -92,13 +93,16 @@ namespace glslang { class TPpToken { public: - TPpToken() : space(false), i64val(0) + TPpToken() { clear(); } + void clear() { + space = false; + i64val = 0; loc.init(); name[0] = 0; } - // This is used for comparing macro definitions, so checks what is relevant for that. + // Used for comparing macro definitions, so checks what is relevant for that. bool operator==(const TPpToken& right) { return space == right.space && @@ -108,15 +112,17 @@ class TPpToken { bool operator!=(const TPpToken& right) { return ! operator==(right); } TSourceLoc loc; - bool space; // true if a space (for white space or a removed comment) should also be recognized, in front of the token returned - + // True if a space (for white space or a removed comment) should also be + // recognized, in front of the token returned: + bool space; + // Numeric value of the token: union { int ival; double dval; long long i64val; }; - - char name[MaxTokenLength + 1]; + // Text string of the token: + char name[MaxTokenLength + 1]; }; class TStringAtomMap { @@ -177,6 +183,13 @@ class TStringAtomMap { class TInputScanner; +enum MacroExpandResult { + MacroExpandNotStarted, // macro not expanded, which might not be an error + MacroExpandError, // a clear error occurred while expanding, no expansion + MacroExpandStarted, // macro expansion process has started + MacroExpandUndef // macro is undefined and will be expanded +}; + // This class is the result of turning a huge pile of C code communicating through globals // into a class. This was done to allowing instancing to attain thread safety. // Don't expect too much in terms of OO design. @@ -254,12 +267,12 @@ class TPpContext { // struct MacroSymbol { - MacroSymbol() : emptyArgs(0), busy(0), undef(0) { } + MacroSymbol() : functionLike(0), busy(0), undef(0) { } TVector args; TokenStream body; - unsigned emptyArgs : 1; - unsigned busy : 1; - unsigned undef : 1; + unsigned functionLike : 1; // 0 means object-like, 1 means function-like + unsigned busy : 1; + unsigned undef : 1; }; typedef TMap TSymbolMap; @@ -394,7 +407,7 @@ class TPpContext { int readCPPline(TPpToken * ppToken); int scanHeaderName(TPpToken* ppToken, char delimit); TokenStream* PrescanMacroArg(TokenStream&, TPpToken*, bool newLineOkay); - int MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOkay); + MacroExpandResult MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOkay); // // From PpTokens.cpp @@ -615,6 +628,8 @@ class TPpContext { std::string rootFileName; std::stack includeStack; std::string currentSourceFile; + + std::istringstream strtodStream; }; } // end namespace glslang diff --git a/deps/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp b/deps/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp index f4eaf57d..1faa0180 100644 --- a/deps/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp +++ b/deps/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp @@ -102,20 +102,36 @@ namespace glslang { int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken) { - bool HasDecimalOrExponent = false; - int isDouble = 0; - const auto saveName = [&](int ch) { if (len <= MaxTokenLength) ppToken->name[len++] = static_cast(ch); }; - // Decimal: + // find the range of non-zero digits before the decimal point + int startNonZero = 0; + while (startNonZero < len && ppToken->name[startNonZero] == '0') + ++startNonZero; + int endNonZero = len; + while (endNonZero > startNonZero && ppToken->name[endNonZero-1] == '0') + --endNonZero; + int numWholeNumberDigits = endNonZero - startNonZero; + + // accumulate the range's value + bool fastPath = numWholeNumberDigits <= 15; // when the number gets too complex, set to false + unsigned long long wholeNumber = 0; + if (fastPath) { + for (int i = startNonZero; i < endNonZero; ++i) + wholeNumber = wholeNumber * 10 + (ppToken->name[i] - '0'); + } + int decimalShift = len - endNonZero; + // Decimal point: + bool hasDecimalOrExponent = false; if (ch == '.') { - HasDecimalOrExponent = true; + hasDecimalOrExponent = true; saveName(ch); ch = getChar(); + int firstDecimal = len; // 1.#INF or -1.#INF if (ch == '#' && (ifdepth > 0 || parseContext.intermediate.getSource() == EShSourceHlsl)) { @@ -145,38 +161,97 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken) } } + // Consume leading-zero digits after the decimal point + while (ch == '0') { + saveName(ch); + ch = getChar(); + } + int startNonZeroDecimal = len; + int endNonZeroDecimal = len; + + // Consume remaining digits, up to the exponent while (ch >= '0' && ch <= '9') { saveName(ch); + if (ch != '0') + endNonZeroDecimal = len; ch = getChar(); } + + // Compute accumulation up to the last non-zero digit + if (endNonZeroDecimal > startNonZeroDecimal) { + numWholeNumberDigits += endNonZeroDecimal - endNonZero - 1; // don't include the "." + if (numWholeNumberDigits > 15) + fastPath = false; + if (fastPath) { + for (int i = endNonZero; i < endNonZeroDecimal; ++i) { + if (ppToken->name[i] != '.') + wholeNumber = wholeNumber * 10 + (ppToken->name[i] - '0'); + } + } + decimalShift = firstDecimal - endNonZeroDecimal; + } } // Exponent: - - if (ch == 'e' || ch == 'E') { - HasDecimalOrExponent = true; - saveName(ch); - ch = getChar(); - if (ch == '+' || ch == '-') { + bool negativeExponent = false; + double exponentValue = 0.0; + int exponent = 0; + { + if (ch == 'e' || ch == 'E') { + hasDecimalOrExponent = true; saveName(ch); ch = getChar(); - } - if (ch >= '0' && ch <= '9') { - while (ch >= '0' && ch <= '9') { + if (ch == '+' || ch == '-') { + negativeExponent = ch == '-'; saveName(ch); ch = getChar(); } - } else { - parseContext.ppError(ppToken->loc, "bad character in float exponent", "", ""); + if (ch >= '0' && ch <= '9') { + while (ch >= '0' && ch <= '9') { + exponent = exponent * 10 + (ch - '0'); + saveName(ch); + ch = getChar(); + } + } else { + parseContext.ppError(ppToken->loc, "bad character in float exponent", "", ""); + } + } + + // Compensate for location of decimal + if (negativeExponent) + exponent -= decimalShift; + else { + exponent += decimalShift; + if (exponent < 0) { + negativeExponent = true; + exponent = -exponent; + } + } + if (exponent > 22) + fastPath = false; + + if (fastPath) { + // Compute the floating-point value of the exponent + exponentValue = 1.0; + if (exponent > 0) { + double expFactor = 10; + while (exponent > 0) { + if (exponent & 0x1) + exponentValue *= expFactor; + expFactor *= expFactor; + exponent >>= 1; + } + } } } // Suffix: + bool isDouble = false; bool isFloat16 = false; if (ch == 'l' || ch == 'L') { if (ifdepth == 0 && parseContext.intermediate.getSource() == EShSourceGlsl) parseContext.doubleCheck(ppToken->loc, "double floating-point suffix"); - if (ifdepth == 0 && !HasDecimalOrExponent) + if (ifdepth == 0 && !hasDecimalOrExponent) parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", ""); if (parseContext.intermediate.getSource() == EShSourceGlsl) { int ch2 = getChar(); @@ -186,16 +261,16 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken) } else { saveName(ch); saveName(ch2); - isDouble = 1; + isDouble = true; } } else if (parseContext.intermediate.getSource() == EShSourceHlsl) { saveName(ch); - isDouble = 1; + isDouble = true; } } else if (ch == 'h' || ch == 'H') { if (ifdepth == 0 && parseContext.intermediate.getSource() == EShSourceGlsl) parseContext.float16Check(ppToken->loc, "half floating-point suffix"); - if (ifdepth == 0 && !HasDecimalOrExponent) + if (ifdepth == 0 && !hasDecimalOrExponent) parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", ""); if (parseContext.intermediate.getSource() == EShSourceGlsl) { int ch2 = getChar(); @@ -216,13 +291,13 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken) parseContext.profileRequires(ppToken->loc, EEsProfile, 300, nullptr, "floating-point suffix"); if (ifdepth == 0 && !parseContext.relaxedErrors()) parseContext.profileRequires(ppToken->loc, ~EEsProfile, 120, nullptr, "floating-point suffix"); - if (ifdepth == 0 && !HasDecimalOrExponent) + if (ifdepth == 0 && !hasDecimalOrExponent) parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", ""); saveName(ch); } else ungetChar(); - // Patch up the name, length, etc. + // Patch up the name and length for overflow if (len > MaxTokenLength) { len = MaxTokenLength; @@ -230,8 +305,45 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken) } ppToken->name[len] = '\0'; - // Get the numerical value - ppToken->dval = strtod(ppToken->name, nullptr); + // Compute the numerical value + if (fastPath) { + // compute the floating-point value of the exponent + if (exponentValue == 0.0) + ppToken->dval = (double)wholeNumber; + else if (negativeExponent) + ppToken->dval = (double)wholeNumber / exponentValue; + else + ppToken->dval = (double)wholeNumber * exponentValue; + } else { + // slow path + ppToken->dval = 0.0; + + // remove suffix + TString numstr(ppToken->name); + if (numstr.back() == 'f' || numstr.back() == 'F') + numstr.pop_back(); + if (numstr.back() == 'h' || numstr.back() == 'H') + numstr.pop_back(); + if (numstr.back() == 'l' || numstr.back() == 'L') + numstr.pop_back(); + + // use platform library + strtodStream.clear(); + strtodStream.str(numstr.c_str()); + strtodStream >> ppToken->dval; + if (strtodStream.fail()) { + // Assume failure combined with a large exponent was overflow, in + // an attempt to set INF. + if (!negativeExponent && exponent + numWholeNumberDigits > 300) + ppToken->i64val = 0x7ff0000000000000; // +Infinity + // Assume failure combined with a small exponent was overflow. + if (negativeExponent && exponent + numWholeNumberDigits > 300) + ppToken->dval = 0.0; + // Unknown reason for failure. Theory is that either + // - the 0.0 is still there, or + // - something reasonable was written that is better than 0.0 + } + } // Return the right token type if (isDouble) @@ -965,8 +1077,17 @@ int TPpContext::tokenize(TPpToken& ppToken) continue; // expand macros - if (token == PpAtomIdentifier && MacroExpand(&ppToken, false, true) != 0) - continue; + if (token == PpAtomIdentifier) { + switch (MacroExpand(&ppToken, false, true)) { + case MacroExpandNotStarted: + break; + case MacroExpandError: + return EndOfInput; + case MacroExpandStarted: + case MacroExpandUndef: + continue; + } + } switch (token) { case PpAtomIdentifier: diff --git a/deps/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp b/deps/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp index 31e0d1f9..f4f1bd04 100644 --- a/deps/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp +++ b/deps/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp @@ -97,6 +97,56 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace glslang { + +namespace { + + // When recording (and playing back) should the backing name string + // be saved (restored)? + bool SaveName(int atom) + { + switch (atom) { + case PpAtomIdentifier: + case PpAtomConstString: + case PpAtomConstInt: + case PpAtomConstUint: + case PpAtomConstInt64: + case PpAtomConstUint64: + #ifdef AMD_EXTENSIONS + case PpAtomConstInt16: + case PpAtomConstUint16: + #endif + case PpAtomConstFloat: + case PpAtomConstDouble: + case PpAtomConstFloat16: + return true; + default: + return false; + } + } + + // When recording (and playing back) should the numeric value + // be saved (restored)? + bool SaveValue(int atom) + { + switch (atom) { + case PpAtomConstInt: + case PpAtomConstUint: + case PpAtomConstInt64: + case PpAtomConstUint64: + #ifdef AMD_EXTENSIONS + case PpAtomConstInt16: + case PpAtomConstUint16: + #endif + case PpAtomConstFloat: + case PpAtomConstDouble: + case PpAtomConstFloat16: + return true; + default: + return false; + } + } +} + // push onto back of stream void TPpContext::TokenStream::putSubtoken(char subtoken) { @@ -121,42 +171,25 @@ void TPpContext::TokenStream::ungetSubtoken() // Add a complete token (including backing string) to the end of a list // for later playback. -void TPpContext::TokenStream::putToken(int token, TPpToken* ppToken) +void TPpContext::TokenStream::putToken(int atom, TPpToken* ppToken) { - const char* s; - char* str = NULL; + // save the atom + assert((atom & ~0xff) == 0); + putSubtoken(static_cast(atom)); - assert((token & ~0xff) == 0); - putSubtoken(static_cast(token)); - - switch (token) { - case PpAtomIdentifier: - case PpAtomConstString: - s = ppToken->name; + // save the backing name string + if (SaveName(atom)) { + const char* s = ppToken->name; while (*s) putSubtoken(*s++); putSubtoken(0); - break; - case PpAtomConstInt: - case PpAtomConstUint: - case PpAtomConstInt64: - case PpAtomConstUint64: -#ifdef AMD_EXTENSIONS - case PpAtomConstInt16: - case PpAtomConstUint16: -#endif - case PpAtomConstFloat: - case PpAtomConstDouble: - case PpAtomConstFloat16: - str = ppToken->name; - while (*str) { - putSubtoken(*str); - str++; - } - putSubtoken(0); - break; - default: - break; + } + + // save the numeric value + if (SaveValue(atom)) { + const char* n = reinterpret_cast(&ppToken->i64val); + for (size_t i = 0; i < sizeof(ppToken->i64val); ++i) + putSubtoken(*n++); } } @@ -164,38 +197,19 @@ void TPpContext::TokenStream::putToken(int token, TPpToken* ppToken) // (Not the source stream, but a stream used to hold a tokenized macro). int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken *ppToken) { - int len; - int ch; + // get the atom + int atom = getSubtoken(); + if (atom == EndOfInput) + return atom; - int subtoken = getSubtoken(); + // init the token + ppToken->clear(); ppToken->loc = parseContext.getCurrentLoc(); - switch (subtoken) { - case '#': - // Check for ##, unless the current # is the last character - if (current < data.size()) { - if (getSubtoken() == '#') { - parseContext.requireProfile(ppToken->loc, ~EEsProfile, "token pasting (##)"); - parseContext.profileRequires(ppToken->loc, ~EEsProfile, 130, 0, "token pasting (##)"); - subtoken = PpAtomPaste; - } else - ungetSubtoken(); - } - break; - case PpAtomConstString: - case PpAtomIdentifier: - case PpAtomConstFloat: - case PpAtomConstDouble: - case PpAtomConstFloat16: - case PpAtomConstInt: - case PpAtomConstUint: - case PpAtomConstInt64: - case PpAtomConstUint64: -#ifdef AMD_EXTENSIONS - case PpAtomConstInt16: - case PpAtomConstUint16: -#endif - len = 0; - ch = getSubtoken(); + + // get the backing name string + if (SaveName(atom)) { + int ch = getSubtoken(); + int len = 0; while (ch != 0 && ch != EndOfInput) { if (len < MaxTokenLength) { ppToken->name[len] = (char)ch; @@ -207,63 +221,28 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken } } ppToken->name[len] = 0; + } - switch (subtoken) { - case PpAtomIdentifier: - break; - case PpAtomConstString: - break; - case PpAtomConstFloat: - case PpAtomConstDouble: - case PpAtomConstFloat16: - ppToken->dval = atof(ppToken->name); - break; - case PpAtomConstInt: -#ifdef AMD_EXTENSIONS - case PpAtomConstInt16: -#endif - if (len > 0 && ppToken->name[0] == '0') { - if (len > 1 && (ppToken->name[1] == 'x' || ppToken->name[1] == 'X')) - ppToken->ival = (int)strtol(ppToken->name, 0, 16); - else - ppToken->ival = (int)strtol(ppToken->name, 0, 8); - } else - ppToken->ival = atoi(ppToken->name); - break; - case PpAtomConstUint: -#ifdef AMD_EXTENSIONS - case PpAtomConstUint16: -#endif - if (len > 0 && ppToken->name[0] == '0') { - if (len > 1 && (ppToken->name[1] == 'x' || ppToken->name[1] == 'X')) - ppToken->ival = (int)strtoul(ppToken->name, 0, 16); - else - ppToken->ival = (int)strtoul(ppToken->name, 0, 8); - } else - ppToken->ival = (int)strtoul(ppToken->name, 0, 10); - break; - case PpAtomConstInt64: - if (len > 0 && ppToken->name[0] == '0') { - if (len > 1 && (ppToken->name[1] == 'x' || ppToken->name[1] == 'X')) - ppToken->i64val = strtoll(ppToken->name, nullptr, 16); - else - ppToken->i64val = strtoll(ppToken->name, nullptr, 8); - } else - ppToken->i64val = atoll(ppToken->name); - break; - case PpAtomConstUint64: - if (len > 0 && ppToken->name[0] == '0') { - if (len > 1 && (ppToken->name[1] == 'x' || ppToken->name[1] == 'X')) - ppToken->i64val = (long long)strtoull(ppToken->name, nullptr, 16); - else - ppToken->i64val = (long long)strtoull(ppToken->name, nullptr, 8); + // Check for ##, unless the current # is the last character + if (atom == '#') { + if (current < data.size()) { + if (getSubtoken() == '#') { + parseContext.requireProfile(ppToken->loc, ~EEsProfile, "token pasting (##)"); + parseContext.profileRequires(ppToken->loc, ~EEsProfile, 130, 0, "token pasting (##)"); + atom = PpAtomPaste; } else - ppToken->i64val = (long long)strtoull(ppToken->name, 0, 10); - break; + ungetSubtoken(); } } - return subtoken; + // get the numeric value + if (SaveValue(atom)) { + char* n = reinterpret_cast(&ppToken->i64val); + for (size_t i = 0; i < sizeof(ppToken->i64val); ++i) + *n++ = (char)getSubtoken(); + } + + return atom; } // We are pasting if diff --git a/deps/glslang/glslang/MachineIndependent/reflection.cpp b/deps/glslang/glslang/MachineIndependent/reflection.cpp index 4818b108..5d59f289 100644 --- a/deps/glslang/glslang/MachineIndependent/reflection.cpp +++ b/deps/glslang/glslang/MachineIndependent/reflection.cpp @@ -778,6 +778,14 @@ void TReflection::buildCounterIndices(const TIntermediate& intermediate) } } +// build Shader Stages mask for all uniforms +void TReflection::buildUniformStageMask(const TIntermediate& intermediate) +{ + for (int i = 0; i < int(indexToUniform.size()); ++i) { + indexToUniform[i].stages = static_cast(indexToUniform[i].stages | 1 << intermediate.getStage()); + } +} + // Merge live symbols from 'intermediate' into the existing reflection database. // // Returns false if the input is too malformed to do this. @@ -803,6 +811,7 @@ bool TReflection::addStage(EShLanguage stage, const TIntermediate& intermediate) } buildCounterIndices(intermediate); + buildUniformStageMask(intermediate); return true; } diff --git a/deps/glslang/glslang/MachineIndependent/reflection.h b/deps/glslang/glslang/MachineIndependent/reflection.h index bf233e33..49282c30 100644 --- a/deps/glslang/glslang/MachineIndependent/reflection.h +++ b/deps/glslang/glslang/MachineIndependent/reflection.h @@ -57,9 +57,9 @@ class TObjectReflection { public: TObjectReflection(const TString& pName, const TType& pType, int pOffset, int pGLDefineType, int pSize, int pIndex) : name(pName), offset(pOffset), - glDefineType(pGLDefineType), size(pSize), index(pIndex), counterIndex(-1), type(pType.clone()) { } + glDefineType(pGLDefineType), size(pSize), index(pIndex), counterIndex(-1), stages(EShLanguageMask(0)), type(pType.clone()) { } - const TType* const getType() const { return type; } + const TType* getType() const { return type; } int getBinding() const { if (type == nullptr || !type->getQualifier().hasBinding()) @@ -68,8 +68,8 @@ class TObjectReflection { } void dump() const { - printf("%s: offset %d, type %x, size %d, index %d, binding %d", - name.c_str(), offset, glDefineType, size, index, getBinding() ); + printf("%s: offset %d, type %x, size %d, index %d, binding %d, stages %d", + name.c_str(), offset, glDefineType, size, index, getBinding(), stages ); if (counterIndex != -1) printf(", counter %d", counterIndex); @@ -84,6 +84,7 @@ class TObjectReflection { int size; // data size in bytes for a block, array size for a (non-block) object that's an array int index; int counterIndex; + EShLanguageMask stages; protected: TObjectReflection() : offset(-1), glDefineType(-1), size(-1), index(-1), type(nullptr) { } @@ -157,6 +158,7 @@ class TReflection { friend class glslang::TReflectionTraverser; void buildCounterIndices(const TIntermediate&); + void buildUniformStageMask(const TIntermediate& intermediate); void buildAttributeReflection(EShLanguage, const TIntermediate&); // Need a TString hash: typedef std::unordered_map TNameToIndex; diff --git a/deps/glslang/glslang/OSDependent/Unix/ossource.cpp b/deps/glslang/glslang/OSDependent/Unix/ossource.cpp index 24b77e16..f59bbceb 100644 --- a/deps/glslang/glslang/OSDependent/Unix/ossource.cpp +++ b/deps/glslang/glslang/OSDependent/Unix/ossource.cpp @@ -43,6 +43,9 @@ #include #include #include +#include +#include +#include namespace glslang { @@ -184,8 +187,18 @@ void ReleaseGlobalLock() pthread_mutex_unlock(&gMutex); } +// #define DUMP_COUNTERS + void OS_DumpMemoryCounters() { +#ifdef DUMP_COUNTERS + struct rusage usage; + + if (getrusage(RUSAGE_SELF, &usage) == 0) + printf("Working set size: %ld\n", usage.ru_maxrss * 1024); +#else + printf("Recompile with DUMP_COUNTERS defined to see counters.\n"); +#endif } } // end namespace glslang diff --git a/deps/glslang/glslang/Public/ShaderLang.h b/deps/glslang/glslang/Public/ShaderLang.h index 911fc310..07088293 100644 --- a/deps/glslang/glslang/Public/ShaderLang.h +++ b/deps/glslang/glslang/Public/ShaderLang.h @@ -70,7 +70,7 @@ // This should always increase, as some paths to do not consume // a more major number. // It should increment by one when new functionality is added. -#define GLSLANG_MINOR_VERSION 6 +#define GLSLANG_MINOR_VERSION 10 // // Call before doing any other compiler/linker operations. @@ -94,6 +94,14 @@ typedef enum { EShLangGeometry, EShLangFragment, EShLangCompute, + EShLangRayGenNV, + EShLangIntersectNV, + EShLangAnyHitNV, + EShLangClosestHitNV, + EShLangMissNV, + EShLangCallableNV, + EShLangTaskNV, + EShLangMeshNV, EShLangCount, } EShLanguage; // would be better as stage, but this is ancient now @@ -104,6 +112,14 @@ typedef enum { EShLangGeometryMask = (1 << EShLangGeometry), EShLangFragmentMask = (1 << EShLangFragment), EShLangComputeMask = (1 << EShLangCompute), + EShLangRayGenNVMask = (1 << EShLangRayGenNV), + EShLangIntersectNVMask = (1 << EShLangIntersectNV), + EShLangAnyHitNVMask = (1 << EShLangAnyHitNV), + EShLangClosestHitNVMask = (1 << EShLangClosestHitNV), + EShLangMissNVMask = (1 << EShLangMissNV), + EShLangCallableNVMask = (1 << EShLangCallableNV), + EShLangTaskNVMask = (1 << EShLangTaskNV), + EShLangMeshNVMask = (1 << EShLangMeshNV), } EShLanguageMask; namespace glslang { @@ -138,7 +154,10 @@ typedef EShTargetClientVersion EshTargetClientVersion; typedef enum { EShTargetSpv_1_0 = (1 << 16), + EShTargetSpv_1_1 = (1 << 16) | (1 << 8), + EShTargetSpv_1_2 = (1 << 16) | (2 << 8), EShTargetSpv_1_3 = (1 << 16) | (3 << 8), + EShTargetSpv_1_4 = (1 << 16) | (4 << 8), } EShTargetLanguageVersion; struct TInputLanguage { @@ -397,6 +416,8 @@ class TShader { void setResourceSetBinding(const std::vector& base); void setAutoMapBindings(bool map); void setAutoMapLocations(bool map); + void addUniformLocationOverride(const char* name, int loc); + void setUniformLocationBase(int base); void setInvertY(bool invert); void setHlslIoMapping(bool hlslIoMap); void setFlattenUniformArrays(bool flatten); @@ -532,6 +553,8 @@ class TShader { return parse(builtInResources, defaultVersion, ENoProfile, false, forwardCompatible, messages, includer); } + // NOTE: Doing just preprocessing to obtain a correct preprocessed shader string + // is not an officially supported or fully working path. bool preprocess(const TBuiltInResource* builtInResources, int defaultVersion, EProfile defaultProfile, bool forceDefaultVersionAndProfile, bool forwardCompatible, EShMessages message, std::string* outputString, @@ -671,6 +694,7 @@ class TProgram { int getUniformBlockSize(int blockIndex) const; // can be used for glGetActiveUniformBlockiv(UNIFORM_BLOCK_DATA_SIZE) int getUniformIndex(const char* name) const; // can be used for glGetUniformIndices() int getUniformBinding(int index) const; // returns the binding number + EShLanguageMask getUniformStages(int index) const; // returns Shaders Stages where a Uniform is present int getUniformBlockBinding(int index) const; // returns the block binding number int getUniformBlockIndex(int index) const; // can be used for glGetActiveUniformsiv(GL_UNIFORM_BLOCK_INDEX) int getUniformBlockCounterIndex(int index) const; // returns block index of associated counter. diff --git a/deps/glslang/gtests/AST.FromFile.cpp b/deps/glslang/gtests/AST.FromFile.cpp new file mode 100644 index 00000000..b89fc515 --- /dev/null +++ b/deps/glslang/gtests/AST.FromFile.cpp @@ -0,0 +1,250 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include + +#include "TestFixture.h" + +namespace glslangtest { +namespace { + +using CompileToAstTest = GlslangTest<::testing::TestWithParam>; + +#ifdef NV_EXTENSIONS +using CompileToAstTestNV = GlslangTest<::testing::TestWithParam>; +#endif + +TEST_P(CompileToAstTest, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), + Source::GLSL, Semantics::OpenGL, glslang::EShTargetVulkan_1_0, + Target::AST); +} + +#ifdef NV_EXTENSIONS +// Compiling GLSL to SPIR-V under OpenGL semantics (NV extensions enabled). +TEST_P(CompileToAstTestNV, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), + Source::GLSL, Semantics::OpenGL, glslang::EShTargetVulkan_1_0, + Target::AST); +} +#endif + +// clang-format off +INSTANTIATE_TEST_CASE_P( + Glsl, CompileToAstTest, + ::testing::ValuesIn(std::vector({ + "sample.frag", + "sample.vert", + "decls.frag", + "specExamples.frag", + "specExamples.vert", + "versionsClean.frag", + "versionsClean.vert", + "versionsErrors.frag", + "versionsErrors.vert", + "100.frag", + "100samplerExternal.frag", + "120.vert", + "120.frag", + "130.vert", + "130.frag", + "140.vert", + "140.frag", + "150.vert", + "150.geom", + "150.frag", + "precision.frag", + "precision.vert", + "nonSquare.vert", + "matrixError.vert", + "cppSimple.vert", + "cppIndent.vert", + "cppIntMinOverNegativeOne.frag", + "cppNest.vert", + "cppBad.vert", + "cppBad2.vert", + "cppComplexExpr.vert", + "cppDeepNest.frag", + "cppPassMacroName.frag", + "cppRelaxSkipTokensErrors.vert", + "badChars.frag", + "pointCoord.frag", + "array.frag", + "array100.frag", + "comment.frag", + "300.vert", + "300.frag", + "300BuiltIns.frag", + "300layout.vert", + "300layout.frag", + "300operations.frag", + "300block.frag", + "300samplerExternal.frag", + "310.comp", + "310.vert", + "310.geom", + "310.frag", + "310.tesc", + "310.tese", + "310implicitSizeArrayError.vert", + "310AofA.vert", + "310runtimeArray.vert", + "320.comp", + "320.vert", + "320.geom", + "320.frag", + "320.tesc", + "320.tese", + "330.frag", + "330comp.frag", + "constErrors.frag", + "constFold.frag", + "constFoldIntMin.frag", + "errors.frag", + "forwardRef.frag", + "uint.frag", + "switch.frag", + "tokenLength.vert", + "100Limits.vert", + "100scope.vert", + "110scope.vert", + "300scope.vert", + "400.frag", + "400.vert", + "410.vert", + "420.comp", + "420.frag", + "420.vert", + "420.geom", + "420_size_gl_in.geom", + "430scope.vert", + "lineContinuation100.vert", + "lineContinuation.vert", + "numeral.frag", + "400.geom", + "400.tesc", + "400.tese", + "410.tesc", + "420.tesc", + "420.tese", + "410.geom", + "430.vert", + "430.comp", + "430AofA.frag", + "435.vert", + "440.vert", + "440.frag", + "450.vert", + "450.geom", + "450.tesc", + "450.tese", + "450.frag", + "450.comp", + "460.frag", + "460.vert", + "dce.frag", + "atomic_uint.frag", + "implicitInnerAtomicUint.frag", + "aggOps.frag", + "always-discard.frag", + "always-discard2.frag", + "conditionalDiscard.frag", + "conversion.frag", + "dataOut.frag", + "dataOutIndirect.frag", + "deepRvalue.frag", + "depthOut.frag", + "discard-dce.frag", + "doWhileLoop.frag", + "earlyReturnDiscard.frag", + "flowControl.frag", + "forLoop.frag", + "functionCall.frag", + "functionSemantics.frag", + "length.frag", + "localAggregates.frag", + "loops.frag", + "loopsArtificial.frag", + "matrix.frag", + "matrix2.frag", + "mixedArrayDecls.frag", + "nonuniform.frag", + "newTexture.frag", + "Operations.frag", + "overlongLiteral.frag", + "prepost.frag", + "runtimeArray.vert", + "simpleFunctionCall.frag", + "stringToDouble.vert", + "structAssignment.frag", + "structDeref.frag", + "structure.frag", + "swizzle.frag", + "invalidSwizzle.vert", + "syntaxError.frag", + "test.frag", + "texture.frag", + "tokenPaste.vert", + "types.frag", + "uniformArray.frag", + "variableArrayIndex.frag", + "varyingArray.frag", + "varyingArrayIndirect.frag", + "voidFunction.frag", + "whileLoop.frag", + "nonVulkan.frag", + "negativeArraySize.comp", + "precise.tesc", + "precise_struct_block.vert", + "maxClipDistances.vert", + "findFunction.frag", + })), + FileNameAsCustomTestSuffix +); + +#ifdef NV_EXTENSIONS +INSTANTIATE_TEST_CASE_P( + Glsl, CompileToAstTestNV, + ::testing::ValuesIn(std::vector({ + "nvShaderNoperspectiveInterpolation.frag", + })), + FileNameAsCustomTestSuffix +); +#endif +// clang-format on + +} // anonymous namespace +} // namespace glslangtest diff --git a/deps/glslang/gtests/BuiltInResource.FromFile.cpp b/deps/glslang/gtests/BuiltInResource.FromFile.cpp new file mode 100644 index 00000000..da81fe98 --- /dev/null +++ b/deps/glslang/gtests/BuiltInResource.FromFile.cpp @@ -0,0 +1,57 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include + +#include + +#include "StandAlone/ResourceLimits.h" +#include "TestFixture.h" + +namespace glslangtest { +namespace { + +using DefaultResourceTest = GlslangTest<::testing::Test>; + +TEST_F(DefaultResourceTest, FromFile) +{ + const std::string path = GlobalTestSettings.testRoot + "/baseResults/test.conf"; + std::string expectedConfig; + tryLoadFile(path, "expected resource limit", &expectedConfig); + const std::string realConfig = glslang::GetDefaultTBuiltInResourceString(); + ASSERT_EQ(expectedConfig, realConfig); +} + +} // anonymous namespace +} // namespace glslangtest diff --git a/deps/glslang/gtests/CMakeLists.txt b/deps/glslang/gtests/CMakeLists.txt new file mode 100644 index 00000000..f678cb6e --- /dev/null +++ b/deps/glslang/gtests/CMakeLists.txt @@ -0,0 +1,61 @@ +if(BUILD_TESTING) + if(TARGET gmock) + message(STATUS "Google Mock found - building tests") + + set(TEST_SOURCES + # Framework related source files + ${CMAKE_CURRENT_SOURCE_DIR}/Initializer.h + ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/Settings.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/Settings.h + ${CMAKE_CURRENT_SOURCE_DIR}/TestFixture.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/TestFixture.h + + # Test related source files + ${CMAKE_CURRENT_SOURCE_DIR}/AST.FromFile.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/BuiltInResource.FromFile.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/Config.FromFile.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/HexFloat.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/Hlsl.FromFile.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/Link.FromFile.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/Link.FromFile.Vk.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/Pp.FromFile.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/Spv.FromFile.cpp + + # -- Remapper tests + ${CMAKE_CURRENT_SOURCE_DIR}/Remap.FromFile.cpp) + + glslang_pch(TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/pch.cpp) + + add_executable(glslangtests ${TEST_SOURCES}) + set_property(TARGET glslangtests PROPERTY FOLDER tests) + glslang_set_link_args(glslangtests) + if(ENABLE_GLSLANG_INSTALL) + install(TARGETS glslangtests + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif(ENABLE_GLSLANG_INSTALL) + + set(GLSLANG_TEST_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../Test") + # Supply a default test root directory, so that manual testing + # doesn't have to specify the --test-root option in the normal + # case that you want to use the tests from the same source tree. + target_compile_definitions(glslangtests + PRIVATE GLSLANG_TEST_DIRECTORY="${GLSLANG_TEST_DIRECTORY}") + target_include_directories(glslangtests PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${PROJECT_SOURCE_DIR} + ${gmock_SOURCE_DIR}/include + ${gtest_SOURCE_DIR}/include) + + set(LIBRARIES + SPVRemapper glslang OSDependent OGLCompiler glslang + SPIRV glslang-default-resource-limits) + if(ENABLE_HLSL) + set(LIBRARIES ${LIBRARIES} HLSL) + endif(ENABLE_HLSL) + target_link_libraries(glslangtests PRIVATE ${LIBRARIES} gmock) + + add_test(NAME glslang-gtests + COMMAND glslangtests --test-root "${GLSLANG_TEST_DIRECTORY}") + endif() +endif() diff --git a/deps/glslang/gtests/Config.FromFile.cpp b/deps/glslang/gtests/Config.FromFile.cpp new file mode 100644 index 00000000..f3a27724 --- /dev/null +++ b/deps/glslang/gtests/Config.FromFile.cpp @@ -0,0 +1,107 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include "StandAlone/ResourceLimits.h" +#include "TestFixture.h" + +namespace glslangtest { +namespace { + +struct TestCaseSpec { + std::string input; + std::string config; + std::string output; + EShMessages controls; +}; + +using ConfigTest = GlslangTest<::testing::TestWithParam>; + +TEST_P(ConfigTest, FromFile) +{ + TestCaseSpec testCase = GetParam(); + GlslangResult result; + + // Get the contents for input shader and limit configurations. + std::string shaderContents, configContents; + tryLoadFile(GlobalTestSettings.testRoot + "/" + testCase.input, "input", &shaderContents); + tryLoadFile(GlobalTestSettings.testRoot + "/" + testCase.config, "limits config", &configContents); + + // Decode limit configurations. + TBuiltInResource resources = {}; + { + const size_t len = configContents.size(); + char* configChars = new char[len + 1]; + memcpy(configChars, configContents.data(), len); + configChars[len] = 0; + glslang::DecodeResourceLimits(&resources, configChars); + delete[] configChars; + } + + // Compile the shader. + glslang::TShader shader(GetShaderStage(GetSuffix(testCase.input))); + compile(&shader, shaderContents, "", testCase.controls, &resources); + result.shaderResults.push_back( + {testCase.input, shader.getInfoLog(), shader.getInfoDebugLog()}); + + // Link the shader. + glslang::TProgram program; + program.addShader(&shader); + program.link(testCase.controls); + result.linkingOutput = program.getInfoLog(); + result.linkingError = program.getInfoDebugLog(); + + std::ostringstream stream; + outputResultToStream(&stream, result, testCase.controls); + + // Check with expected results. + const std::string expectedOutputFname = + GlobalTestSettings.testRoot + "/baseResults/" + testCase.output; + std::string expectedOutput; + tryLoadFile(expectedOutputFname, "expected output", &expectedOutput); + + checkEqAndUpdateIfRequested(expectedOutput, stream.str(), expectedOutputFname); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + Glsl, ConfigTest, + ::testing::ValuesIn(std::vector({ + {"specExamples.vert", "baseResults/test.conf", "specExamplesConf.vert.out", (EShMessages)(EShMsgAST | EShMsgCascadingErrors)}, + {"100Limits.vert", "100.conf", "100LimitsConf.vert.out", EShMsgCascadingErrors}, + })), +); +// clang-format on + +} // anonymous namespace +} // namespace glslangtest diff --git a/deps/glslang/gtests/HexFloat.cpp b/deps/glslang/gtests/HexFloat.cpp new file mode 100644 index 00000000..ddbee1f4 --- /dev/null +++ b/deps/glslang/gtests/HexFloat.cpp @@ -0,0 +1,1231 @@ +// Copyright (c) 2015-2016 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include +#include +#include +#include + +#include +#include "SPIRV/hex_float.h" + +namespace { +using ::testing::Eq; +using spvutils::BitwiseCast; +using spvutils::Float16; +using spvutils::FloatProxy; +using spvutils::HexFloat; +using spvutils::ParseNormalFloat; + +// In this file "encode" means converting a number into a string, +// and "decode" means converting a string into a number. + +using HexFloatTest = + ::testing::TestWithParam, std::string>>; +using DecodeHexFloatTest = + ::testing::TestWithParam>>; +using HexDoubleTest = + ::testing::TestWithParam, std::string>>; +using DecodeHexDoubleTest = + ::testing::TestWithParam>>; + +// Hex-encodes a float value. +template +std::string EncodeViaHexFloat(const T& value) { + std::stringstream ss; + ss << spvutils::HexFloat(value); + return ss.str(); +} + +// The following two tests can't be DRY because they take different parameter +// types. + +TEST_P(HexFloatTest, EncodeCorrectly) { + EXPECT_THAT(EncodeViaHexFloat(GetParam().first), Eq(GetParam().second)); +} + +TEST_P(HexDoubleTest, EncodeCorrectly) { + EXPECT_THAT(EncodeViaHexFloat(GetParam().first), Eq(GetParam().second)); +} + +// Decodes a hex-float string. +template +FloatProxy Decode(const std::string& str) { + spvutils::HexFloat> decoded(0.f); + EXPECT_TRUE((std::stringstream(str) >> decoded).eof()); + return decoded.value(); +} + +TEST_P(HexFloatTest, DecodeCorrectly) { + EXPECT_THAT(Decode(GetParam().second), Eq(GetParam().first)); +} + +TEST_P(HexDoubleTest, DecodeCorrectly) { + EXPECT_THAT(Decode(GetParam().second), Eq(GetParam().first)); +} + +INSTANTIATE_TEST_CASE_P( + Float32Tests, HexFloatTest, + ::testing::ValuesIn(std::vector, std::string>>({ + {0.f, "0x0p+0"}, + {1.f, "0x1p+0"}, + {2.f, "0x1p+1"}, + {3.f, "0x1.8p+1"}, + {0.5f, "0x1p-1"}, + {0.25f, "0x1p-2"}, + {0.75f, "0x1.8p-1"}, + {-0.f, "-0x0p+0"}, + {-1.f, "-0x1p+0"}, + {-0.5f, "-0x1p-1"}, + {-0.25f, "-0x1p-2"}, + {-0.75f, "-0x1.8p-1"}, + + // Larger numbers + {512.f, "0x1p+9"}, + {-512.f, "-0x1p+9"}, + {1024.f, "0x1p+10"}, + {-1024.f, "-0x1p+10"}, + {1024.f + 8.f, "0x1.02p+10"}, + {-1024.f - 8.f, "-0x1.02p+10"}, + + // Small numbers + {1.0f / 512.f, "0x1p-9"}, + {1.0f / -512.f, "-0x1p-9"}, + {1.0f / 1024.f, "0x1p-10"}, + {1.0f / -1024.f, "-0x1p-10"}, + {1.0f / 1024.f + 1.0f / 8.f, "0x1.02p-3"}, + {1.0f / -1024.f - 1.0f / 8.f, "-0x1.02p-3"}, + + // lowest non-denorm + {float(ldexp(1.0f, -126)), "0x1p-126"}, + {float(ldexp(-1.0f, -126)), "-0x1p-126"}, + + // Denormalized values + {float(ldexp(1.0f, -127)), "0x1p-127"}, + {float(ldexp(1.0f, -127) / 2.0f), "0x1p-128"}, + {float(ldexp(1.0f, -127) / 4.0f), "0x1p-129"}, + {float(ldexp(1.0f, -127) / 8.0f), "0x1p-130"}, + {float(ldexp(-1.0f, -127)), "-0x1p-127"}, + {float(ldexp(-1.0f, -127) / 2.0f), "-0x1p-128"}, + {float(ldexp(-1.0f, -127) / 4.0f), "-0x1p-129"}, + {float(ldexp(-1.0f, -127) / 8.0f), "-0x1p-130"}, + + {float(ldexp(1.0, -127) + (ldexp(1.0, -127) / 2.0f)), "0x1.8p-127"}, + {float(ldexp(1.0, -127) / 2.0 + (ldexp(1.0, -127) / 4.0f)), + "0x1.8p-128"}, + + })),); + +INSTANTIATE_TEST_CASE_P( + Float32NanTests, HexFloatTest, + ::testing::ValuesIn(std::vector, std::string>>({ + // Various NAN and INF cases + {uint32_t(0xFF800000), "-0x1p+128"}, // -inf + {uint32_t(0x7F800000), "0x1p+128"}, // inf + {uint32_t(0xFFC00000), "-0x1.8p+128"}, // -nan + {uint32_t(0xFF800100), "-0x1.0002p+128"}, // -nan + {uint32_t(0xFF800c00), "-0x1.0018p+128"}, // -nan + {uint32_t(0xFF80F000), "-0x1.01ep+128"}, // -nan + {uint32_t(0xFFFFFFFF), "-0x1.fffffep+128"}, // -nan + {uint32_t(0x7FC00000), "0x1.8p+128"}, // +nan + {uint32_t(0x7F800100), "0x1.0002p+128"}, // +nan + {uint32_t(0x7f800c00), "0x1.0018p+128"}, // +nan + {uint32_t(0x7F80F000), "0x1.01ep+128"}, // +nan + {uint32_t(0x7FFFFFFF), "0x1.fffffep+128"}, // +nan + })),); + +INSTANTIATE_TEST_CASE_P( + Float64Tests, HexDoubleTest, + ::testing::ValuesIn( + std::vector, std::string>>({ + {0., "0x0p+0"}, + {1., "0x1p+0"}, + {2., "0x1p+1"}, + {3., "0x1.8p+1"}, + {0.5, "0x1p-1"}, + {0.25, "0x1p-2"}, + {0.75, "0x1.8p-1"}, + {-0., "-0x0p+0"}, + {-1., "-0x1p+0"}, + {-0.5, "-0x1p-1"}, + {-0.25, "-0x1p-2"}, + {-0.75, "-0x1.8p-1"}, + + // Larger numbers + {512., "0x1p+9"}, + {-512., "-0x1p+9"}, + {1024., "0x1p+10"}, + {-1024., "-0x1p+10"}, + {1024. + 8., "0x1.02p+10"}, + {-1024. - 8., "-0x1.02p+10"}, + + // Large outside the range of normal floats + {ldexp(1.0, 128), "0x1p+128"}, + {ldexp(1.0, 129), "0x1p+129"}, + {ldexp(-1.0, 128), "-0x1p+128"}, + {ldexp(-1.0, 129), "-0x1p+129"}, + {ldexp(1.0, 128) + ldexp(1.0, 90), "0x1.0000000004p+128"}, + {ldexp(1.0, 129) + ldexp(1.0, 120), "0x1.008p+129"}, + {ldexp(-1.0, 128) + ldexp(1.0, 90), "-0x1.fffffffff8p+127"}, + {ldexp(-1.0, 129) + ldexp(1.0, 120), "-0x1.ffp+128"}, + + // Small numbers + {1.0 / 512., "0x1p-9"}, + {1.0 / -512., "-0x1p-9"}, + {1.0 / 1024., "0x1p-10"}, + {1.0 / -1024., "-0x1p-10"}, + {1.0 / 1024. + 1.0 / 8., "0x1.02p-3"}, + {1.0 / -1024. - 1.0 / 8., "-0x1.02p-3"}, + + // Small outside the range of normal floats + {ldexp(1.0, -128), "0x1p-128"}, + {ldexp(1.0, -129), "0x1p-129"}, + {ldexp(-1.0, -128), "-0x1p-128"}, + {ldexp(-1.0, -129), "-0x1p-129"}, + {ldexp(1.0, -128) + ldexp(1.0, -90), "0x1.0000000004p-90"}, + {ldexp(1.0, -129) + ldexp(1.0, -120), "0x1.008p-120"}, + {ldexp(-1.0, -128) + ldexp(1.0, -90), "0x1.fffffffff8p-91"}, + {ldexp(-1.0, -129) + ldexp(1.0, -120), "0x1.ffp-121"}, + + // lowest non-denorm + {ldexp(1.0, -1022), "0x1p-1022"}, + {ldexp(-1.0, -1022), "-0x1p-1022"}, + + // Denormalized values + {ldexp(1.0, -1023), "0x1p-1023"}, + {ldexp(1.0, -1023) / 2.0, "0x1p-1024"}, + {ldexp(1.0, -1023) / 4.0, "0x1p-1025"}, + {ldexp(1.0, -1023) / 8.0, "0x1p-1026"}, + {ldexp(-1.0, -1024), "-0x1p-1024"}, + {ldexp(-1.0, -1024) / 2.0, "-0x1p-1025"}, + {ldexp(-1.0, -1024) / 4.0, "-0x1p-1026"}, + {ldexp(-1.0, -1024) / 8.0, "-0x1p-1027"}, + + {ldexp(1.0, -1023) + (ldexp(1.0, -1023) / 2.0), "0x1.8p-1023"}, + {ldexp(1.0, -1023) / 2.0 + (ldexp(1.0, -1023) / 4.0), + "0x1.8p-1024"}, + + })),); + +INSTANTIATE_TEST_CASE_P( + Float64NanTests, HexDoubleTest, + ::testing::ValuesIn(std::vector< + std::pair, std::string>>({ + // Various NAN and INF cases + {uint64_t(0xFFF0000000000000LL), "-0x1p+1024"}, //-inf + {uint64_t(0x7FF0000000000000LL), "0x1p+1024"}, //+inf + {uint64_t(0xFFF8000000000000LL), "-0x1.8p+1024"}, // -nan + {uint64_t(0xFFF0F00000000000LL), "-0x1.0fp+1024"}, // -nan + {uint64_t(0xFFF0000000000001LL), "-0x1.0000000000001p+1024"}, // -nan + {uint64_t(0xFFF0000300000000LL), "-0x1.00003p+1024"}, // -nan + {uint64_t(0xFFFFFFFFFFFFFFFFLL), "-0x1.fffffffffffffp+1024"}, // -nan + {uint64_t(0x7FF8000000000000LL), "0x1.8p+1024"}, // +nan + {uint64_t(0x7FF0F00000000000LL), "0x1.0fp+1024"}, // +nan + {uint64_t(0x7FF0000000000001LL), "0x1.0000000000001p+1024"}, // -nan + {uint64_t(0x7FF0000300000000LL), "0x1.00003p+1024"}, // -nan + {uint64_t(0x7FFFFFFFFFFFFFFFLL), "0x1.fffffffffffffp+1024"}, // -nan + })),); + +TEST(HexFloatStreamTest, OperatorLeftShiftPreservesFloatAndFill) { + std::stringstream s; + s << std::setw(4) << std::oct << std::setfill('x') << 8 << " " + << FloatProxy(uint32_t(0xFF800100)) << " " << std::setw(4) << 9; + EXPECT_THAT(s.str(), Eq(std::string("xx10 -0x1.0002p+128 xx11"))); +} + +TEST(HexDoubleStreamTest, OperatorLeftShiftPreservesFloatAndFill) { + std::stringstream s; + s << std::setw(4) << std::oct << std::setfill('x') << 8 << " " + << FloatProxy(uint64_t(0x7FF0F00000000000LL)) << " " << std::setw(4) + << 9; + EXPECT_THAT(s.str(), Eq(std::string("xx10 0x1.0fp+1024 xx11"))); +} + +TEST_P(DecodeHexFloatTest, DecodeCorrectly) { + EXPECT_THAT(Decode(GetParam().first), Eq(GetParam().second)); +} + +TEST_P(DecodeHexDoubleTest, DecodeCorrectly) { + EXPECT_THAT(Decode(GetParam().first), Eq(GetParam().second)); +} + +INSTANTIATE_TEST_CASE_P( + Float32DecodeTests, DecodeHexFloatTest, + ::testing::ValuesIn(std::vector>>({ + {"0x0p+000", 0.f}, + {"0x0p0", 0.f}, + {"0x0p-0", 0.f}, + + // flush to zero cases + {"0x1p-500", 0.f}, // Exponent underflows. + {"-0x1p-500", -0.f}, + {"0x0.00000000001p-126", 0.f}, // Fraction causes underflow. + {"-0x0.0000000001p-127", -0.f}, + {"-0x0.01p-142", -0.f}, // Fraction causes additional underflow. + {"0x0.01p-142", 0.f}, + + // Some floats that do not encode the same way as they decode. + {"0x2p+0", 2.f}, + {"0xFFp+0", 255.f}, + {"0x0.8p+0", 0.5f}, + {"0x0.4p+0", 0.25f}, + })),); + +INSTANTIATE_TEST_CASE_P( + Float32DecodeInfTests, DecodeHexFloatTest, + ::testing::ValuesIn(std::vector>>({ + // inf cases + {"-0x1p+128", uint32_t(0xFF800000)}, // -inf + {"0x32p+127", uint32_t(0x7F800000)}, // inf + {"0x32p+500", uint32_t(0x7F800000)}, // inf + {"-0x32p+127", uint32_t(0xFF800000)}, // -inf + })),); + +INSTANTIATE_TEST_CASE_P( + Float64DecodeTests, DecodeHexDoubleTest, + ::testing::ValuesIn( + std::vector>>({ + {"0x0p+000", 0.}, + {"0x0p0", 0.}, + {"0x0p-0", 0.}, + + // flush to zero cases + {"0x1p-5000", 0.}, // Exponent underflows. + {"-0x1p-5000", -0.}, + {"0x0.0000000000000001p-1023", 0.}, // Fraction causes underflow. + {"-0x0.000000000000001p-1024", -0.}, + {"-0x0.01p-1090", -0.f}, // Fraction causes additional underflow. + {"0x0.01p-1090", 0.}, + + // Some floats that do not encode the same way as they decode. + {"0x2p+0", 2.}, + {"0xFFp+0", 255.}, + {"0x0.8p+0", 0.5}, + {"0x0.4p+0", 0.25}, + })),); + +INSTANTIATE_TEST_CASE_P( + Float64DecodeInfTests, DecodeHexDoubleTest, + ::testing::ValuesIn( + std::vector>>({ + // inf cases + {"-0x1p+1024", uint64_t(0xFFF0000000000000)}, // -inf + {"0x32p+1023", uint64_t(0x7FF0000000000000)}, // inf + {"0x32p+5000", uint64_t(0x7FF0000000000000)}, // inf + {"-0x32p+1023", uint64_t(0xFFF0000000000000)}, // -inf + })),); + +TEST(FloatProxy, ValidConversion) { + EXPECT_THAT(FloatProxy(1.f).getAsFloat(), Eq(1.0f)); + EXPECT_THAT(FloatProxy(32.f).getAsFloat(), Eq(32.0f)); + EXPECT_THAT(FloatProxy(-1.f).getAsFloat(), Eq(-1.0f)); + EXPECT_THAT(FloatProxy(0.f).getAsFloat(), Eq(0.0f)); + EXPECT_THAT(FloatProxy(-0.f).getAsFloat(), Eq(-0.0f)); + EXPECT_THAT(FloatProxy(1.2e32f).getAsFloat(), Eq(1.2e32f)); + + EXPECT_TRUE(std::isinf(FloatProxy(uint32_t(0xFF800000)).getAsFloat())); + EXPECT_TRUE(std::isinf(FloatProxy(uint32_t(0x7F800000)).getAsFloat())); + EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0xFFC00000)).getAsFloat())); + EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0xFF800100)).getAsFloat())); + EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0xFF800c00)).getAsFloat())); + EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0xFF80F000)).getAsFloat())); + EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0xFFFFFFFF)).getAsFloat())); + EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0x7FC00000)).getAsFloat())); + EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0x7F800100)).getAsFloat())); + EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0x7f800c00)).getAsFloat())); + EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0x7F80F000)).getAsFloat())); + EXPECT_TRUE(std::isnan(FloatProxy(uint32_t(0x7FFFFFFF)).getAsFloat())); + + EXPECT_THAT(FloatProxy(uint32_t(0xFF800000)).data(), Eq(0xFF800000u)); + EXPECT_THAT(FloatProxy(uint32_t(0x7F800000)).data(), Eq(0x7F800000u)); + EXPECT_THAT(FloatProxy(uint32_t(0xFFC00000)).data(), Eq(0xFFC00000u)); + EXPECT_THAT(FloatProxy(uint32_t(0xFF800100)).data(), Eq(0xFF800100u)); + EXPECT_THAT(FloatProxy(uint32_t(0xFF800c00)).data(), Eq(0xFF800c00u)); + EXPECT_THAT(FloatProxy(uint32_t(0xFF80F000)).data(), Eq(0xFF80F000u)); + EXPECT_THAT(FloatProxy(uint32_t(0xFFFFFFFF)).data(), Eq(0xFFFFFFFFu)); + EXPECT_THAT(FloatProxy(uint32_t(0x7FC00000)).data(), Eq(0x7FC00000u)); + EXPECT_THAT(FloatProxy(uint32_t(0x7F800100)).data(), Eq(0x7F800100u)); + EXPECT_THAT(FloatProxy(uint32_t(0x7f800c00)).data(), Eq(0x7f800c00u)); + EXPECT_THAT(FloatProxy(uint32_t(0x7F80F000)).data(), Eq(0x7F80F000u)); + EXPECT_THAT(FloatProxy(uint32_t(0x7FFFFFFF)).data(), Eq(0x7FFFFFFFu)); +} + +TEST(FloatProxy, Nan) { + EXPECT_TRUE(FloatProxy(uint32_t(0xFFC00000)).isNan()); + EXPECT_TRUE(FloatProxy(uint32_t(0xFF800100)).isNan()); + EXPECT_TRUE(FloatProxy(uint32_t(0xFF800c00)).isNan()); + EXPECT_TRUE(FloatProxy(uint32_t(0xFF80F000)).isNan()); + EXPECT_TRUE(FloatProxy(uint32_t(0xFFFFFFFF)).isNan()); + EXPECT_TRUE(FloatProxy(uint32_t(0x7FC00000)).isNan()); + EXPECT_TRUE(FloatProxy(uint32_t(0x7F800100)).isNan()); + EXPECT_TRUE(FloatProxy(uint32_t(0x7f800c00)).isNan()); + EXPECT_TRUE(FloatProxy(uint32_t(0x7F80F000)).isNan()); + EXPECT_TRUE(FloatProxy(uint32_t(0x7FFFFFFF)).isNan()); +} + +TEST(FloatProxy, Negation) { + EXPECT_THAT((-FloatProxy(1.f)).getAsFloat(), Eq(-1.0f)); + EXPECT_THAT((-FloatProxy(0.f)).getAsFloat(), Eq(-0.0f)); + + EXPECT_THAT((-FloatProxy(-1.f)).getAsFloat(), Eq(1.0f)); + EXPECT_THAT((-FloatProxy(-0.f)).getAsFloat(), Eq(0.0f)); + + EXPECT_THAT((-FloatProxy(32.f)).getAsFloat(), Eq(-32.0f)); + EXPECT_THAT((-FloatProxy(-32.f)).getAsFloat(), Eq(32.0f)); + + EXPECT_THAT((-FloatProxy(1.2e32f)).getAsFloat(), Eq(-1.2e32f)); + EXPECT_THAT((-FloatProxy(-1.2e32f)).getAsFloat(), Eq(1.2e32f)); + + EXPECT_THAT( + (-FloatProxy(std::numeric_limits::infinity())).getAsFloat(), + Eq(-std::numeric_limits::infinity())); + EXPECT_THAT((-FloatProxy(-std::numeric_limits::infinity())) + .getAsFloat(), + Eq(std::numeric_limits::infinity())); +} + +// Test conversion of FloatProxy values to strings. +// +// In previous cases, we always wrapped the FloatProxy value in a HexFloat +// before conversion to a string. In the following cases, the FloatProxy +// decides for itself whether to print as a regular number or as a hex float. + +using FloatProxyFloatTest = + ::testing::TestWithParam, std::string>>; +using FloatProxyDoubleTest = + ::testing::TestWithParam, std::string>>; + +// Converts a float value to a string via a FloatProxy. +template +std::string EncodeViaFloatProxy(const T& value) { + std::stringstream ss; + ss << value; + return ss.str(); +} + +// Converts a floating point string so that the exponent prefix +// is 'e', and the exponent value does not have leading zeros. +// The Microsoft runtime library likes to write things like "2.5E+010". +// Convert that to "2.5e+10". +// We don't care what happens to strings that are not floating point +// strings. +std::string NormalizeExponentInFloatString(std::string in) { + std::string result; + // Reserve one spot for the terminating null, even when the sscanf fails. + std::vector prefix(in.size() + 1); + char e; + char plus_or_minus; + int exponent; // in base 10 + if ((4 == std::sscanf(in.c_str(), "%[-+.0123456789]%c%c%d", prefix.data(), &e, + &plus_or_minus, &exponent)) && + (e == 'e' || e == 'E') && + (plus_or_minus == '-' || plus_or_minus == '+')) { + // It looks like a floating point value with exponent. + std::stringstream out; + out << prefix.data() << 'e' << plus_or_minus << exponent; + result = out.str(); + } else { + result = in; + } + return result; +} + +TEST(NormalizeFloat, Sample) { + EXPECT_THAT(NormalizeExponentInFloatString(""), Eq("")); + EXPECT_THAT(NormalizeExponentInFloatString("1e-12"), Eq("1e-12")); + EXPECT_THAT(NormalizeExponentInFloatString("1E+14"), Eq("1e+14")); + EXPECT_THAT(NormalizeExponentInFloatString("1e-0012"), Eq("1e-12")); + EXPECT_THAT(NormalizeExponentInFloatString("1.263E+014"), Eq("1.263e+14")); +} + +// The following two tests can't be DRY because they take different parameter +// types. +TEST_P(FloatProxyFloatTest, EncodeCorrectly) { + EXPECT_THAT( + NormalizeExponentInFloatString(EncodeViaFloatProxy(GetParam().first)), + Eq(GetParam().second)); +} + +TEST_P(FloatProxyDoubleTest, EncodeCorrectly) { + EXPECT_THAT( + NormalizeExponentInFloatString(EncodeViaFloatProxy(GetParam().first)), + Eq(GetParam().second)); +} + +INSTANTIATE_TEST_CASE_P( + Float32Tests, FloatProxyFloatTest, + ::testing::ValuesIn(std::vector, std::string>>({ + // Zero + {0.f, "0"}, + // Normal numbers + {1.f, "1"}, + {-0.25f, "-0.25"}, + {1000.0f, "1000"}, + + // Still normal numbers, but with large magnitude exponents. + {float(ldexp(1.f, 126)), "8.50706e+37"}, + {float(ldexp(-1.f, -126)), "-1.17549e-38"}, + + // denormalized values are printed as hex floats. + {float(ldexp(1.0f, -127)), "0x1p-127"}, + {float(ldexp(1.5f, -128)), "0x1.8p-128"}, + {float(ldexp(1.25, -129)), "0x1.4p-129"}, + {float(ldexp(1.125, -130)), "0x1.2p-130"}, + {float(ldexp(-1.0f, -127)), "-0x1p-127"}, + {float(ldexp(-1.0f, -128)), "-0x1p-128"}, + {float(ldexp(-1.0f, -129)), "-0x1p-129"}, + {float(ldexp(-1.5f, -130)), "-0x1.8p-130"}, + + // NaNs + {FloatProxy(uint32_t(0xFFC00000)), "-0x1.8p+128"}, + {FloatProxy(uint32_t(0xFF800100)), "-0x1.0002p+128"}, + + {std::numeric_limits::infinity(), "0x1p+128"}, + {-std::numeric_limits::infinity(), "-0x1p+128"}, + })),); + +INSTANTIATE_TEST_CASE_P( + Float64Tests, FloatProxyDoubleTest, + ::testing::ValuesIn( + std::vector, std::string>>({ + {0., "0"}, + {1., "1"}, + {-0.25, "-0.25"}, + {1000.0, "1000"}, + + // Large outside the range of normal floats + {ldexp(1.0, 128), "3.40282366920938e+38"}, + {ldexp(1.5, 129), "1.02084710076282e+39"}, + {ldexp(-1.0, 128), "-3.40282366920938e+38"}, + {ldexp(-1.5, 129), "-1.02084710076282e+39"}, + + // Small outside the range of normal floats + {ldexp(1.5, -129), "2.20405190779179e-39"}, + {ldexp(-1.5, -129), "-2.20405190779179e-39"}, + + // lowest non-denorm + {ldexp(1.0, -1022), "2.2250738585072e-308"}, + {ldexp(-1.0, -1022), "-2.2250738585072e-308"}, + + // Denormalized values + {ldexp(1.125, -1023), "0x1.2p-1023"}, + {ldexp(-1.375, -1024), "-0x1.6p-1024"}, + + // NaNs + {uint64_t(0x7FF8000000000000LL), "0x1.8p+1024"}, + {uint64_t(0xFFF0F00000000000LL), "-0x1.0fp+1024"}, + + // Infinity + {std::numeric_limits::infinity(), "0x1p+1024"}, + {-std::numeric_limits::infinity(), "-0x1p+1024"}, + + })),); + +// double is used so that unbiased_exponent can be used with the output +// of ldexp directly. +int32_t unbiased_exponent(double f) { + return spvutils::HexFloat>( + static_cast(f)).getUnbiasedNormalizedExponent(); +} + +int16_t unbiased_half_exponent(uint16_t f) { + return spvutils::HexFloat>(f) + .getUnbiasedNormalizedExponent(); +} + +TEST(HexFloatOperationTest, UnbiasedExponent) { + // Float cases + EXPECT_EQ(0, unbiased_exponent(ldexp(1.0f, 0))); + EXPECT_EQ(-32, unbiased_exponent(ldexp(1.0f, -32))); + EXPECT_EQ(42, unbiased_exponent(ldexp(1.0f, 42))); + EXPECT_EQ(125, unbiased_exponent(ldexp(1.0f, 125))); + // Saturates to 128 + EXPECT_EQ(128, unbiased_exponent(ldexp(1.0f, 256))); + + EXPECT_EQ(-100, unbiased_exponent(ldexp(1.0f, -100))); + EXPECT_EQ(-127, unbiased_exponent(ldexp(1.0f, -127))); // First denorm + EXPECT_EQ(-128, unbiased_exponent(ldexp(1.0f, -128))); + EXPECT_EQ(-129, unbiased_exponent(ldexp(1.0f, -129))); + EXPECT_EQ(-140, unbiased_exponent(ldexp(1.0f, -140))); + // Smallest representable number + EXPECT_EQ(-126 - 23, unbiased_exponent(ldexp(1.0f, -126 - 23))); + // Should get rounded to 0 first. + EXPECT_EQ(0, unbiased_exponent(ldexp(1.0f, -127 - 23))); + + // Float16 cases + // The exponent is represented in the bits 0x7C00 + // The offset is -15 + EXPECT_EQ(0, unbiased_half_exponent(0x3C00)); + EXPECT_EQ(3, unbiased_half_exponent(0x4800)); + EXPECT_EQ(-1, unbiased_half_exponent(0x3800)); + EXPECT_EQ(-14, unbiased_half_exponent(0x0400)); + EXPECT_EQ(16, unbiased_half_exponent(0x7C00)); + EXPECT_EQ(10, unbiased_half_exponent(0x6400)); + + // Smallest representable number + EXPECT_EQ(-24, unbiased_half_exponent(0x0001)); +} + +// Creates a float that is the sum of 1/(2 ^ fractions[i]) for i in factions +float float_fractions(const std::vector& fractions) { + float f = 0; + for(int32_t i: fractions) { + f += std::ldexp(1.0f, -i); + } + return f; +} + +// Returns the normalized significand of a HexFloat> +// that was created by calling float_fractions with the input fractions, +// raised to the power of exp. +uint32_t normalized_significand(const std::vector& fractions, uint32_t exp) { + return spvutils::HexFloat>( + static_cast(ldexp(float_fractions(fractions), exp))) + .getNormalizedSignificand(); +} + +// Sets the bits from MSB to LSB of the significand part of a float. +// For example 0 would set the bit 23 (counting from LSB to MSB), +// and 1 would set the 22nd bit. +uint32_t bits_set(const std::vector& bits) { + const uint32_t top_bit = 1u << 22u; + uint32_t val= 0; + for(uint32_t i: bits) { + val |= top_bit >> i; + } + return val; +} + +// The same as bits_set but for a Float16 value instead of 32-bit floating +// point. +uint16_t half_bits_set(const std::vector& bits) { + const uint32_t top_bit = 1u << 9u; + uint32_t val= 0; + for(uint32_t i: bits) { + val |= top_bit >> i; + } + return static_cast(val); +} + +TEST(HexFloatOperationTest, NormalizedSignificand) { + // For normalized numbers (the following) it should be a simple matter + // of getting rid of the top implicit bit + EXPECT_EQ(bits_set({}), normalized_significand({0}, 0)); + EXPECT_EQ(bits_set({0}), normalized_significand({0, 1}, 0)); + EXPECT_EQ(bits_set({0, 1}), normalized_significand({0, 1, 2}, 0)); + EXPECT_EQ(bits_set({1}), normalized_significand({0, 2}, 0)); + EXPECT_EQ(bits_set({1}), normalized_significand({0, 2}, 32)); + EXPECT_EQ(bits_set({1}), normalized_significand({0, 2}, 126)); + + // For denormalized numbers we expect the normalized significand to + // shift as if it were normalized. This means, in practice that the + // top_most set bit will be cut off. Looks very similar to above (on purpose) + EXPECT_EQ(bits_set({}), normalized_significand({0}, -127)); + EXPECT_EQ(bits_set({3}), normalized_significand({0, 4}, -128)); + EXPECT_EQ(bits_set({3}), normalized_significand({0, 4}, -127)); + EXPECT_EQ(bits_set({}), normalized_significand({22}, -127)); + EXPECT_EQ(bits_set({0}), normalized_significand({21, 22}, -127)); +} + +// Returns the 32-bit floating point value created by +// calling setFromSignUnbiasedExponentAndNormalizedSignificand +// on a HexFloat> +float set_from_sign(bool negative, int32_t unbiased_exponent, + uint32_t significand, bool round_denorm_up) { + spvutils::HexFloat> f(0.f); + f.setFromSignUnbiasedExponentAndNormalizedSignificand( + negative, unbiased_exponent, significand, round_denorm_up); + return f.value().getAsFloat(); +} + +TEST(HexFloatOperationTests, + SetFromSignUnbiasedExponentAndNormalizedSignificand) { + + EXPECT_EQ(1.f, set_from_sign(false, 0, 0, false)); + + // Tests insertion of various denormalized numbers with and without round up. + EXPECT_EQ(static_cast(ldexp(1.f, -149)), set_from_sign(false, -149, 0, false)); + EXPECT_EQ(static_cast(ldexp(1.f, -149)), set_from_sign(false, -149, 0, true)); + EXPECT_EQ(0.f, set_from_sign(false, -150, 1, false)); + EXPECT_EQ(static_cast(ldexp(1.f, -149)), set_from_sign(false, -150, 1, true)); + + EXPECT_EQ(ldexp(1.0f, -127), set_from_sign(false, -127, 0, false)); + EXPECT_EQ(ldexp(1.0f, -128), set_from_sign(false, -128, 0, false)); + EXPECT_EQ(float_fractions({0, 1, 2, 5}), + set_from_sign(false, 0, bits_set({0, 1, 4}), false)); + EXPECT_EQ(ldexp(float_fractions({0, 1, 2, 5}), -32), + set_from_sign(false, -32, bits_set({0, 1, 4}), false)); + EXPECT_EQ(ldexp(float_fractions({0, 1, 2, 5}), -128), + set_from_sign(false, -128, bits_set({0, 1, 4}), false)); + + // The negative cases from above. + EXPECT_EQ(-1.f, set_from_sign(true, 0, 0, false)); + EXPECT_EQ(-ldexp(1.0, -127), set_from_sign(true, -127, 0, false)); + EXPECT_EQ(-ldexp(1.0, -128), set_from_sign(true, -128, 0, false)); + EXPECT_EQ(-float_fractions({0, 1, 2, 5}), + set_from_sign(true, 0, bits_set({0, 1, 4}), false)); + EXPECT_EQ(-ldexp(float_fractions({0, 1, 2, 5}), -32), + set_from_sign(true, -32, bits_set({0, 1, 4}), false)); + EXPECT_EQ(-ldexp(float_fractions({0, 1, 2, 5}), -128), + set_from_sign(true, -128, bits_set({0, 1, 4}), false)); +} + +TEST(HexFloatOperationTests, NonRounding) { + // Rounding from 32-bit hex-float to 32-bit hex-float should be trivial, + // except in the denorm case which is a bit more complex. + using HF = spvutils::HexFloat>; + bool carry_bit = false; + + spvutils::round_direction rounding[] = { + spvutils::kRoundToZero, + spvutils::kRoundToNearestEven, + spvutils::kRoundToPositiveInfinity, + spvutils::kRoundToNegativeInfinity}; + + // Everything fits, so this should be straight-forward + for (spvutils::round_direction round : rounding) { + EXPECT_EQ(bits_set({}), HF(0.f).getRoundedNormalizedSignificand( + round, &carry_bit)); + EXPECT_FALSE(carry_bit); + + EXPECT_EQ(bits_set({0}), + HF(float_fractions({0, 1})) + .getRoundedNormalizedSignificand(round, &carry_bit)); + EXPECT_FALSE(carry_bit); + + EXPECT_EQ(bits_set({1, 3}), + HF(float_fractions({0, 2, 4})) + .getRoundedNormalizedSignificand(round, &carry_bit)); + EXPECT_FALSE(carry_bit); + + EXPECT_EQ( + bits_set({0, 1, 4}), + HF(static_cast(-ldexp(float_fractions({0, 1, 2, 5}), -128))) + .getRoundedNormalizedSignificand(round, &carry_bit)); + EXPECT_FALSE(carry_bit); + + EXPECT_EQ( + bits_set({0, 1, 4, 22}), + HF(static_cast(float_fractions({0, 1, 2, 5, 23}))) + .getRoundedNormalizedSignificand(round, &carry_bit)); + EXPECT_FALSE(carry_bit); + } +} + +struct RoundSignificandCase { + float source_float; + std::pair expected_results; + spvutils::round_direction round; +}; + +using HexFloatRoundTest = + ::testing::TestWithParam; + +TEST_P(HexFloatRoundTest, RoundDownToFP16) { + using HF = spvutils::HexFloat>; + using HF16 = spvutils::HexFloat>; + + HF input_value(GetParam().source_float); + bool carry_bit = false; + EXPECT_EQ(GetParam().expected_results.first, + input_value.getRoundedNormalizedSignificand( + GetParam().round, &carry_bit)); + EXPECT_EQ(carry_bit, GetParam().expected_results.second); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P(F32ToF16, HexFloatRoundTest, + ::testing::ValuesIn(std::vector( + { + {float_fractions({0}), std::make_pair(half_bits_set({}), false), spvutils::kRoundToZero}, + {float_fractions({0}), std::make_pair(half_bits_set({}), false), spvutils::kRoundToNearestEven}, + {float_fractions({0}), std::make_pair(half_bits_set({}), false), spvutils::kRoundToPositiveInfinity}, + {float_fractions({0}), std::make_pair(half_bits_set({}), false), spvutils::kRoundToNegativeInfinity}, + {float_fractions({0, 1}), std::make_pair(half_bits_set({0}), false), spvutils::kRoundToZero}, + + {float_fractions({0, 1, 11}), std::make_pair(half_bits_set({0}), false), spvutils::kRoundToZero}, + {float_fractions({0, 1, 11}), std::make_pair(half_bits_set({0, 9}), false), spvutils::kRoundToPositiveInfinity}, + {float_fractions({0, 1, 11}), std::make_pair(half_bits_set({0}), false), spvutils::kRoundToNegativeInfinity}, + {float_fractions({0, 1, 11}), std::make_pair(half_bits_set({0}), false), spvutils::kRoundToNearestEven}, + + {float_fractions({0, 1, 10, 11}), std::make_pair(half_bits_set({0, 9}), false), spvutils::kRoundToZero}, + {float_fractions({0, 1, 10, 11}), std::make_pair(half_bits_set({0, 8}), false), spvutils::kRoundToPositiveInfinity}, + {float_fractions({0, 1, 10, 11}), std::make_pair(half_bits_set({0, 9}), false), spvutils::kRoundToNegativeInfinity}, + {float_fractions({0, 1, 10, 11}), std::make_pair(half_bits_set({0, 8}), false), spvutils::kRoundToNearestEven}, + + {float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0}), false), spvutils::kRoundToZero}, + {float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0, 9}), false), spvutils::kRoundToPositiveInfinity}, + {float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0}), false), spvutils::kRoundToNegativeInfinity}, + {float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0, 9}), false), spvutils::kRoundToNearestEven}, + + {-float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0}), false), spvutils::kRoundToZero}, + {-float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0}), false), spvutils::kRoundToPositiveInfinity}, + {-float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0, 9}), false), spvutils::kRoundToNegativeInfinity}, + {-float_fractions({0, 1, 11, 12}), std::make_pair(half_bits_set({0, 9}), false), spvutils::kRoundToNearestEven}, + + {float_fractions({0, 1, 11, 22}), std::make_pair(half_bits_set({0}), false), spvutils::kRoundToZero}, + {float_fractions({0, 1, 11, 22}), std::make_pair(half_bits_set({0, 9}), false), spvutils::kRoundToPositiveInfinity}, + {float_fractions({0, 1, 11, 22}), std::make_pair(half_bits_set({0}), false), spvutils::kRoundToNegativeInfinity}, + {float_fractions({0, 1, 11, 22}), std::make_pair(half_bits_set({0, 9}), false), spvutils::kRoundToNearestEven}, + + // Carries + {float_fractions({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), std::make_pair(half_bits_set({0, 1, 2, 3, 4, 5, 6, 7, 8, 9}), false), spvutils::kRoundToZero}, + {float_fractions({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), std::make_pair(half_bits_set({}), true), spvutils::kRoundToPositiveInfinity}, + {float_fractions({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), std::make_pair(half_bits_set({0, 1, 2, 3, 4, 5, 6, 7, 8, 9}), false), spvutils::kRoundToNegativeInfinity}, + {float_fractions({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), std::make_pair(half_bits_set({}), true), spvutils::kRoundToNearestEven}, + + // Cases where original number was denorm. Note: this should have no effect + // the number is pre-normalized. + {static_cast(ldexp(float_fractions({0, 1, 11, 13}), -128)), std::make_pair(half_bits_set({0}), false), spvutils::kRoundToZero}, + {static_cast(ldexp(float_fractions({0, 1, 11, 13}), -129)), std::make_pair(half_bits_set({0, 9}), false), spvutils::kRoundToPositiveInfinity}, + {static_cast(ldexp(float_fractions({0, 1, 11, 13}), -131)), std::make_pair(half_bits_set({0}), false), spvutils::kRoundToNegativeInfinity}, + {static_cast(ldexp(float_fractions({0, 1, 11, 13}), -130)), std::make_pair(half_bits_set({0, 9}), false), spvutils::kRoundToNearestEven}, + })),); +// clang-format on + +struct UpCastSignificandCase { + uint16_t source_half; + uint32_t expected_result; +}; + +using HexFloatRoundUpSignificandTest = + ::testing::TestWithParam; +TEST_P(HexFloatRoundUpSignificandTest, Widening) { + using HF = spvutils::HexFloat>; + using HF16 = spvutils::HexFloat>; + bool carry_bit = false; + + spvutils::round_direction rounding[] = { + spvutils::kRoundToZero, + spvutils::kRoundToNearestEven, + spvutils::kRoundToPositiveInfinity, + spvutils::kRoundToNegativeInfinity}; + + // Everything fits, so everything should just be bit-shifts. + for (spvutils::round_direction round : rounding) { + carry_bit = false; + HF16 input_value(GetParam().source_half); + EXPECT_EQ( + GetParam().expected_result, + input_value.getRoundedNormalizedSignificand(round, &carry_bit)) + << std::hex << "0x" + << input_value.getRoundedNormalizedSignificand(round, &carry_bit) + << " 0x" << GetParam().expected_result; + EXPECT_FALSE(carry_bit); + } +} + +INSTANTIATE_TEST_CASE_P(F16toF32, HexFloatRoundUpSignificandTest, + // 0xFC00 of the source 16-bit hex value cover the sign and the exponent. + // They are ignored for this test. + ::testing::ValuesIn(std::vector( + { + {0x3F00, 0x600000}, + {0x0F00, 0x600000}, + {0x0F01, 0x602000}, + {0x0FFF, 0x7FE000}, + })),); + +struct DownCastTest { + float source_float; + uint16_t expected_half; + std::vector directions; +}; + +std::string get_round_text(spvutils::round_direction direction) { +#define CASE(round_direction) \ + case round_direction: \ + return #round_direction + + switch (direction) { + CASE(spvutils::kRoundToZero); + CASE(spvutils::kRoundToPositiveInfinity); + CASE(spvutils::kRoundToNegativeInfinity); + CASE(spvutils::kRoundToNearestEven); + } +#undef CASE + return ""; +} + +using HexFloatFP32To16Tests = ::testing::TestWithParam; + +TEST_P(HexFloatFP32To16Tests, NarrowingCasts) { + using HF = spvutils::HexFloat>; + using HF16 = spvutils::HexFloat>; + HF f(GetParam().source_float); + for (auto round : GetParam().directions) { + HF16 half(0); + f.castTo(half, round); + EXPECT_EQ(GetParam().expected_half, half.value().getAsFloat().get_value()) + << get_round_text(round) << " " << std::hex + << spvutils::BitwiseCast(GetParam().source_float) + << " cast to: " << half.value().getAsFloat().get_value(); + } +} + +const uint16_t positive_infinity = 0x7C00; +const uint16_t negative_infinity = 0xFC00; + +INSTANTIATE_TEST_CASE_P(F32ToF16, HexFloatFP32To16Tests, + ::testing::ValuesIn(std::vector( + { + // Exactly representable as half. + {0.f, 0x0, {spvutils::kRoundToZero, spvutils::kRoundToPositiveInfinity, spvutils::kRoundToNegativeInfinity, spvutils::kRoundToNearestEven}}, + {-0.f, 0x8000, {spvutils::kRoundToZero, spvutils::kRoundToPositiveInfinity, spvutils::kRoundToNegativeInfinity, spvutils::kRoundToNearestEven}}, + {1.0f, 0x3C00, {spvutils::kRoundToZero, spvutils::kRoundToPositiveInfinity, spvutils::kRoundToNegativeInfinity, spvutils::kRoundToNearestEven}}, + {-1.0f, 0xBC00, {spvutils::kRoundToZero, spvutils::kRoundToPositiveInfinity, spvutils::kRoundToNegativeInfinity, spvutils::kRoundToNearestEven}}, + + {float_fractions({0, 1, 10}) , 0x3E01, {spvutils::kRoundToZero, spvutils::kRoundToPositiveInfinity, spvutils::kRoundToNegativeInfinity, spvutils::kRoundToNearestEven}}, + {-float_fractions({0, 1, 10}) , 0xBE01, {spvutils::kRoundToZero, spvutils::kRoundToPositiveInfinity, spvutils::kRoundToNegativeInfinity, spvutils::kRoundToNearestEven}}, + {static_cast(ldexp(float_fractions({0, 1, 10}), 3)), 0x4A01, {spvutils::kRoundToZero, spvutils::kRoundToPositiveInfinity, spvutils::kRoundToNegativeInfinity, spvutils::kRoundToNearestEven}}, + {static_cast(-ldexp(float_fractions({0, 1, 10}), 3)), 0xCA01, {spvutils::kRoundToZero, spvutils::kRoundToPositiveInfinity, spvutils::kRoundToNegativeInfinity, spvutils::kRoundToNearestEven}}, + + + // Underflow + {static_cast(ldexp(1.0f, -25)), 0x0, {spvutils::kRoundToZero, spvutils::kRoundToNegativeInfinity, spvutils::kRoundToNearestEven}}, + {static_cast(ldexp(1.0f, -25)), 0x1, {spvutils::kRoundToPositiveInfinity}}, + {static_cast(-ldexp(1.0f, -25)), 0x8000, {spvutils::kRoundToZero, spvutils::kRoundToPositiveInfinity, spvutils::kRoundToNearestEven}}, + {static_cast(-ldexp(1.0f, -25)), 0x8001, {spvutils::kRoundToNegativeInfinity}}, + {static_cast(ldexp(1.0f, -24)), 0x1, {spvutils::kRoundToZero, spvutils::kRoundToPositiveInfinity, spvutils::kRoundToNegativeInfinity, spvutils::kRoundToNearestEven}}, + + // Overflow + {static_cast(ldexp(1.0f, 16)), positive_infinity, {spvutils::kRoundToZero, spvutils::kRoundToPositiveInfinity, spvutils::kRoundToNegativeInfinity, spvutils::kRoundToNearestEven}}, + {static_cast(ldexp(1.0f, 18)), positive_infinity, {spvutils::kRoundToZero, spvutils::kRoundToPositiveInfinity, spvutils::kRoundToNegativeInfinity, spvutils::kRoundToNearestEven}}, + {static_cast(ldexp(1.3f, 16)), positive_infinity, {spvutils::kRoundToZero, spvutils::kRoundToPositiveInfinity, spvutils::kRoundToNegativeInfinity, spvutils::kRoundToNearestEven}}, + {static_cast(-ldexp(1.0f, 16)), negative_infinity, {spvutils::kRoundToZero, spvutils::kRoundToPositiveInfinity, spvutils::kRoundToNegativeInfinity, spvutils::kRoundToNearestEven}}, + {static_cast(-ldexp(1.0f, 18)), negative_infinity, {spvutils::kRoundToZero, spvutils::kRoundToPositiveInfinity, spvutils::kRoundToNegativeInfinity, spvutils::kRoundToNearestEven}}, + {static_cast(-ldexp(1.3f, 16)), negative_infinity, {spvutils::kRoundToZero, spvutils::kRoundToPositiveInfinity, spvutils::kRoundToNegativeInfinity, spvutils::kRoundToNearestEven}}, + + // Transfer of Infinities + {std::numeric_limits::infinity(), positive_infinity, {spvutils::kRoundToZero, spvutils::kRoundToPositiveInfinity, spvutils::kRoundToNegativeInfinity, spvutils::kRoundToNearestEven}}, + {-std::numeric_limits::infinity(), negative_infinity, {spvutils::kRoundToZero, spvutils::kRoundToPositiveInfinity, spvutils::kRoundToNegativeInfinity, spvutils::kRoundToNearestEven}}, + + // Nans are below because we cannot test for equality. + })),); + +struct UpCastCase{ + uint16_t source_half; + float expected_float; +}; + +using HexFloatFP16To32Tests = ::testing::TestWithParam; +TEST_P(HexFloatFP16To32Tests, WideningCasts) { + using HF = spvutils::HexFloat>; + using HF16 = spvutils::HexFloat>; + HF16 f(GetParam().source_half); + + spvutils::round_direction rounding[] = { + spvutils::kRoundToZero, + spvutils::kRoundToNearestEven, + spvutils::kRoundToPositiveInfinity, + spvutils::kRoundToNegativeInfinity}; + + // Everything fits, so everything should just be bit-shifts. + for (spvutils::round_direction round : rounding) { + HF flt(0.f); + f.castTo(flt, round); + EXPECT_EQ(GetParam().expected_float, flt.value().getAsFloat()) + << get_round_text(round) << " " << std::hex + << spvutils::BitwiseCast(GetParam().source_half) + << " cast to: " << flt.value().getAsFloat(); + } +} + +INSTANTIATE_TEST_CASE_P(F16ToF32, HexFloatFP16To32Tests, + ::testing::ValuesIn(std::vector( + { + {0x0000, 0.f}, + {0x8000, -0.f}, + {0x3C00, 1.0f}, + {0xBC00, -1.0f}, + {0x3F00, float_fractions({0, 1, 2})}, + {0xBF00, -float_fractions({0, 1, 2})}, + {0x3F01, float_fractions({0, 1, 2, 10})}, + {0xBF01, -float_fractions({0, 1, 2, 10})}, + + // denorm + {0x0001, static_cast(ldexp(1.0, -24))}, + {0x0002, static_cast(ldexp(1.0, -23))}, + {0x8001, static_cast(-ldexp(1.0, -24))}, + {0x8011, static_cast(-ldexp(1.0, -20) + -ldexp(1.0, -24))}, + + // inf + {0x7C00, std::numeric_limits::infinity()}, + {0xFC00, -std::numeric_limits::infinity()}, + })),); + +TEST(HexFloatOperationTests, NanTests) { + using HF = spvutils::HexFloat>; + using HF16 = spvutils::HexFloat>; + spvutils::round_direction rounding[] = { + spvutils::kRoundToZero, + spvutils::kRoundToNearestEven, + spvutils::kRoundToPositiveInfinity, + spvutils::kRoundToNegativeInfinity}; + + // Everything fits, so everything should just be bit-shifts. + for (spvutils::round_direction round : rounding) { + HF16 f16(0); + HF f(0.f); + HF(std::numeric_limits::quiet_NaN()).castTo(f16, round); + EXPECT_TRUE(f16.value().isNan()); + HF(std::numeric_limits::signaling_NaN()).castTo(f16, round); + EXPECT_TRUE(f16.value().isNan()); + + HF16(0x7C01).castTo(f, round); + EXPECT_TRUE(f.value().isNan()); + HF16(0x7C11).castTo(f, round); + EXPECT_TRUE(f.value().isNan()); + HF16(0xFC01).castTo(f, round); + EXPECT_TRUE(f.value().isNan()); + HF16(0x7C10).castTo(f, round); + EXPECT_TRUE(f.value().isNan()); + HF16(0xFF00).castTo(f, round); + EXPECT_TRUE(f.value().isNan()); + } +} + +// A test case for parsing good and bad HexFloat> literals. +template +struct FloatParseCase { + std::string literal; + bool negate_value; + bool expect_success; + HexFloat> expected_value; +}; + +using ParseNormalFloatTest = ::testing::TestWithParam>; + +TEST_P(ParseNormalFloatTest, Samples) { + std::stringstream input(GetParam().literal); + HexFloat> parsed_value(0.0f); + ParseNormalFloat(input, GetParam().negate_value, parsed_value); + EXPECT_NE(GetParam().expect_success, input.fail()) + << " literal: " << GetParam().literal + << " negate: " << GetParam().negate_value; + if (GetParam().expect_success) { + EXPECT_THAT(parsed_value.value(), Eq(GetParam().expected_value.value())) + << " literal: " << GetParam().literal + << " negate: " << GetParam().negate_value; + } +} + +// Returns a FloatParseCase with expected failure. +template +FloatParseCase BadFloatParseCase(std::string literal, bool negate_value, + T expected_value) { + HexFloat> proxy_expected_value(expected_value); + return FloatParseCase{literal, negate_value, false, proxy_expected_value}; +} + +// Returns a FloatParseCase that should successfully parse to a given value. +template +FloatParseCase GoodFloatParseCase(std::string literal, bool negate_value, + T expected_value) { + HexFloat> proxy_expected_value(expected_value); + return FloatParseCase{literal, negate_value, true, proxy_expected_value}; +} + +INSTANTIATE_TEST_CASE_P( + FloatParse, ParseNormalFloatTest, + ::testing::ValuesIn(std::vector>{ + // Failing cases due to trivially incorrect syntax. + BadFloatParseCase("abc", false, 0.0f), + BadFloatParseCase("abc", true, 0.0f), + + // Valid cases. + GoodFloatParseCase("0", false, 0.0f), + GoodFloatParseCase("0.0", false, 0.0f), + GoodFloatParseCase("-0.0", false, -0.0f), + GoodFloatParseCase("2.0", false, 2.0f), + GoodFloatParseCase("-2.0", false, -2.0f), + GoodFloatParseCase("+2.0", false, 2.0f), + // Cases with negate_value being true. + GoodFloatParseCase("0.0", true, -0.0f), + GoodFloatParseCase("2.0", true, -2.0f), + + // When negate_value is true, we should not accept a + // leading minus or plus. + BadFloatParseCase("-0.0", true, 0.0f), + BadFloatParseCase("-2.0", true, 0.0f), + BadFloatParseCase("+0.0", true, 0.0f), + BadFloatParseCase("+2.0", true, 0.0f), + + // Overflow is an error for 32-bit float parsing. + BadFloatParseCase("1e40", false, FLT_MAX), + BadFloatParseCase("1e40", true, -FLT_MAX), + BadFloatParseCase("-1e40", false, -FLT_MAX), + // We can't have -1e40 and negate_value == true since + // that represents an original case of "--1e40" which + // is invalid. + }),); + +using ParseNormalFloat16Test = + ::testing::TestWithParam>; + +TEST_P(ParseNormalFloat16Test, Samples) { + std::stringstream input(GetParam().literal); + HexFloat> parsed_value(0); + ParseNormalFloat(input, GetParam().negate_value, parsed_value); + EXPECT_NE(GetParam().expect_success, input.fail()) + << " literal: " << GetParam().literal + << " negate: " << GetParam().negate_value; + if (GetParam().expect_success) { + EXPECT_THAT(parsed_value.value(), Eq(GetParam().expected_value.value())) + << " literal: " << GetParam().literal + << " negate: " << GetParam().negate_value; + } +} + +INSTANTIATE_TEST_CASE_P( + Float16Parse, ParseNormalFloat16Test, + ::testing::ValuesIn(std::vector>{ + // Failing cases due to trivially incorrect syntax. + BadFloatParseCase("abc", false, uint16_t{0}), + BadFloatParseCase("abc", true, uint16_t{0}), + + // Valid cases. + GoodFloatParseCase("0", false, uint16_t{0}), + GoodFloatParseCase("0.0", false, uint16_t{0}), + GoodFloatParseCase("-0.0", false, uint16_t{0x8000}), + GoodFloatParseCase("2.0", false, uint16_t{0x4000}), + GoodFloatParseCase("-2.0", false, uint16_t{0xc000}), + GoodFloatParseCase("+2.0", false, uint16_t{0x4000}), + // Cases with negate_value being true. + GoodFloatParseCase("0.0", true, uint16_t{0x8000}), + GoodFloatParseCase("2.0", true, uint16_t{0xc000}), + + // When negate_value is true, we should not accept a leading minus or + // plus. + BadFloatParseCase("-0.0", true, uint16_t{0}), + BadFloatParseCase("-2.0", true, uint16_t{0}), + BadFloatParseCase("+0.0", true, uint16_t{0}), + BadFloatParseCase("+2.0", true, uint16_t{0}), + }),); + +// A test case for detecting infinities. +template +struct OverflowParseCase { + std::string input; + bool expect_success; + T expected_value; +}; + +using FloatProxyParseOverflowFloatTest = + ::testing::TestWithParam>; + +TEST_P(FloatProxyParseOverflowFloatTest, Sample) { + std::istringstream input(GetParam().input); + HexFloat> value(0.0f); + input >> value; + EXPECT_NE(GetParam().expect_success, input.fail()); + if (GetParam().expect_success) { + EXPECT_THAT(value.value().getAsFloat(), GetParam().expected_value); + } +} + +INSTANTIATE_TEST_CASE_P( + FloatOverflow, FloatProxyParseOverflowFloatTest, + ::testing::ValuesIn(std::vector>({ + {"0", true, 0.0f}, + {"0.0", true, 0.0f}, + {"1.0", true, 1.0f}, + {"1e38", true, 1e38f}, + {"-1e38", true, -1e38f}, + {"1e40", false, FLT_MAX}, + {"-1e40", false, -FLT_MAX}, + {"1e400", false, FLT_MAX}, + {"-1e400", false, -FLT_MAX}, + })),); + +using FloatProxyParseOverflowDoubleTest = + ::testing::TestWithParam>; + +TEST_P(FloatProxyParseOverflowDoubleTest, Sample) { + std::istringstream input(GetParam().input); + HexFloat> value(0.0); + input >> value; + EXPECT_NE(GetParam().expect_success, input.fail()); + if (GetParam().expect_success) { + EXPECT_THAT(value.value().getAsFloat(), Eq(GetParam().expected_value)); + } +} + +INSTANTIATE_TEST_CASE_P( + DoubleOverflow, FloatProxyParseOverflowDoubleTest, + ::testing::ValuesIn(std::vector>({ + {"0", true, 0.0}, + {"0.0", true, 0.0}, + {"1.0", true, 1.0}, + {"1e38", true, 1e38}, + {"-1e38", true, -1e38}, + {"1e40", true, 1e40}, + {"-1e40", true, -1e40}, + {"1e400", false, DBL_MAX}, + {"-1e400", false, -DBL_MAX}, + })),); + +using FloatProxyParseOverflowFloat16Test = + ::testing::TestWithParam>; + +TEST_P(FloatProxyParseOverflowFloat16Test, Sample) { + std::istringstream input(GetParam().input); + HexFloat> value(0); + input >> value; + EXPECT_NE(GetParam().expect_success, input.fail()) << " literal: " + << GetParam().input; + if (GetParam().expect_success) { + EXPECT_THAT(value.value().data(), Eq(GetParam().expected_value)) + << " literal: " << GetParam().input; + } +} + +INSTANTIATE_TEST_CASE_P( + Float16Overflow, FloatProxyParseOverflowFloat16Test, + ::testing::ValuesIn(std::vector>({ + {"0", true, uint16_t{0}}, + {"0.0", true, uint16_t{0}}, + {"1.0", true, uint16_t{0x3c00}}, + // Overflow for 16-bit float is an error, and returns max or + // lowest value. + {"1e38", false, uint16_t{0x7bff}}, + {"1e40", false, uint16_t{0x7bff}}, + {"1e400", false, uint16_t{0x7bff}}, + {"-1e38", false, uint16_t{0xfbff}}, + {"-1e40", false, uint16_t{0xfbff}}, + {"-1e400", false, uint16_t{0xfbff}}, + })),); + +TEST(FloatProxy, Max) { + EXPECT_THAT(FloatProxy::max().getAsFloat().get_value(), + Eq(uint16_t{0x7bff})); + EXPECT_THAT(FloatProxy::max().getAsFloat(), + Eq(std::numeric_limits::max())); + EXPECT_THAT(FloatProxy::max().getAsFloat(), + Eq(std::numeric_limits::max())); +} + +TEST(FloatProxy, Lowest) { + EXPECT_THAT(FloatProxy::lowest().getAsFloat().get_value(), + Eq(uint16_t{0xfbff})); + EXPECT_THAT(FloatProxy::lowest().getAsFloat(), + Eq(std::numeric_limits::lowest())); + EXPECT_THAT(FloatProxy::lowest().getAsFloat(), + Eq(std::numeric_limits::lowest())); +} + +// TODO(awoloszyn): Add fp16 tests and HexFloatTraits. +} // anonymous namespace diff --git a/deps/glslang/gtests/Hlsl.FromFile.cpp b/deps/glslang/gtests/Hlsl.FromFile.cpp new file mode 100644 index 00000000..a490ba0a --- /dev/null +++ b/deps/glslang/gtests/Hlsl.FromFile.cpp @@ -0,0 +1,440 @@ +// +// Copyright (C) 2016 Google, Inc. +// Copyright (C) 2016 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include + +#include "TestFixture.h" + +namespace glslangtest { +namespace { + +struct FileNameEntryPointPair { + const char* fileName; + const char* entryPoint; +}; + +// We are using FileNameEntryPointPair objects as parameters for instantiating +// the template, so the global FileNameAsCustomTestSuffix() won't work since +// it assumes std::string as parameters. Thus, an overriding one here. +std::string FileNameAsCustomTestSuffix( + const ::testing::TestParamInfo& info) { + std::string name = info.param.fileName; + // A valid test case suffix cannot have '.' and '-' inside. + std::replace(name.begin(), name.end(), '.', '_'); + std::replace(name.begin(), name.end(), '-', '_'); + return name; +} + +using HlslCompileTest = GlslangTest<::testing::TestWithParam>; +using HlslVulkan1_1CompileTest = GlslangTest<::testing::TestWithParam>; +using HlslCompileAndFlattenTest = GlslangTest<::testing::TestWithParam>; +using HlslLegalizeTest = GlslangTest<::testing::TestWithParam>; + +// Compiling HLSL to pre-legalized SPIR-V under Vulkan semantics. Expected +// to successfully generate both AST and SPIR-V. +TEST_P(HlslCompileTest, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName, + Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, + Target::BothASTAndSpv, true, GetParam().entryPoint); +} + +TEST_P(HlslVulkan1_1CompileTest, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName, + Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, + Target::BothASTAndSpv, true, GetParam().entryPoint); +} + +TEST_P(HlslCompileAndFlattenTest, FromFile) +{ + loadFileCompileFlattenUniformsAndCheck(GlobalTestSettings.testRoot, GetParam().fileName, + Source::HLSL, Semantics::Vulkan, + Target::BothASTAndSpv, GetParam().entryPoint); +} + +// Compiling HLSL to legal SPIR-V under Vulkan semantics. Expected to +// successfully generate SPIR-V. +TEST_P(HlslLegalizeTest, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName, + Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, + Target::Spv, true, GetParam().entryPoint, + "/baseLegalResults/", true); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + ToSpirv, HlslCompileTest, + ::testing::ValuesIn(std::vector{ + {"hlsl.amend.frag", "f1"}, + {"hlsl.aliasOpaque.frag", "main"}, + {"hlsl.array.frag", "PixelShaderFunction"}, + {"hlsl.array.implicit-size.frag", "PixelShaderFunction"}, + {"hlsl.array.multidim.frag", "main"}, + {"hlsl.assoc.frag", "PixelShaderFunction"}, + {"hlsl.attribute.frag", "PixelShaderFunction"}, + {"hlsl.attribute.expression.comp", "main"}, + {"hlsl.attributeC11.frag", "main"}, + {"hlsl.attributeGlobalBuffer.frag", "main"}, + {"hlsl.basic.comp", "main"}, + {"hlsl.basic.geom", "main"}, + {"hlsl.boolConv.vert", "main"}, + {"hlsl.buffer.frag", "PixelShaderFunction"}, + {"hlsl.calculatelod.dx10.frag", "main"}, + {"hlsl.calculatelodunclamped.dx10.frag", "main"}, + {"hlsl.cast.frag", "PixelShaderFunction"}, + {"hlsl.cbuffer-identifier.vert", "main"}, + {"hlsl.charLit.vert", "main"}, + {"hlsl.clip.frag", "main"}, + {"hlsl.clipdistance-1.frag", "main"}, + {"hlsl.clipdistance-1.geom", "main"}, + {"hlsl.clipdistance-1.vert", "main"}, + {"hlsl.clipdistance-2.frag", "main"}, + {"hlsl.clipdistance-2.geom", "main"}, + {"hlsl.clipdistance-2.vert", "main"}, + {"hlsl.clipdistance-3.frag", "main"}, + {"hlsl.clipdistance-3.geom", "main"}, + {"hlsl.clipdistance-3.vert", "main"}, + {"hlsl.clipdistance-4.frag", "main"}, + {"hlsl.clipdistance-4.geom", "main"}, + {"hlsl.clipdistance-4.vert", "main"}, + {"hlsl.clipdistance-5.frag", "main"}, + {"hlsl.clipdistance-5.vert", "main"}, + {"hlsl.clipdistance-6.frag", "main"}, + {"hlsl.clipdistance-6.vert", "main"}, + {"hlsl.clipdistance-7.frag", "main"}, + {"hlsl.clipdistance-7.vert", "main"}, + {"hlsl.clipdistance-8.frag", "main"}, + {"hlsl.clipdistance-8.vert", "main"}, + {"hlsl.clipdistance-9.frag", "main"}, + {"hlsl.clipdistance-9.vert", "main"}, + {"hlsl.color.hull.tesc", "main"}, + {"hlsl.comparison.vec.frag", "main"}, + {"hlsl.conditional.frag", "PixelShaderFunction"}, + {"hlsl.constantbuffer.frag", "main"}, + {"hlsl.constructArray.vert", "main"}, + {"hlsl.constructexpr.frag", "main"}, + {"hlsl.constructimat.frag", "main"}, + {"hlsl.coverage.frag", "main"}, + {"hlsl.depthGreater.frag", "PixelShaderFunction"}, + {"hlsl.depthLess.frag", "PixelShaderFunction"}, + {"hlsl.discard.frag", "PixelShaderFunction"}, + {"hlsl.doLoop.frag", "PixelShaderFunction"}, + {"hlsl.emptystructreturn.frag", "main"}, + {"hlsl.emptystructreturn.vert", "main"}, + {"hlsl.emptystruct.init.vert", "main"}, + {"hlsl.entry-in.frag", "PixelShaderFunction"}, + {"hlsl.entry-out.frag", "PixelShaderFunction"}, + {"hlsl.fraggeom.frag", "main"}, + {"hlsl.float1.frag", "PixelShaderFunction"}, + {"hlsl.float4.frag", "PixelShaderFunction"}, + {"hlsl.flatten.return.frag", "main"}, + {"hlsl.flattenOpaque.frag", "main"}, + {"hlsl.flattenOpaqueInit.vert", "main"}, + {"hlsl.flattenOpaqueInitMix.vert", "main"}, + {"hlsl.flattenSubset.frag", "main"}, + {"hlsl.flattenSubset2.frag", "main"}, + {"hlsl.forLoop.frag", "PixelShaderFunction"}, + {"hlsl.gather.array.dx10.frag", "main"}, + {"hlsl.gather.basic.dx10.frag", "main"}, + {"hlsl.gather.basic.dx10.vert", "main"}, + {"hlsl.gather.offset.dx10.frag", "main"}, + {"hlsl.gather.offsetarray.dx10.frag", "main"}, + {"hlsl.gathercmpRGBA.offset.dx10.frag", "main"}, + {"hlsl.gatherRGBA.array.dx10.frag", "main"}, + {"hlsl.gatherRGBA.basic.dx10.frag", "main"}, + {"hlsl.gatherRGBA.offset.dx10.frag", "main"}, + {"hlsl.gatherRGBA.offsetarray.dx10.frag", "main"}, + {"hlsl.getdimensions.dx10.frag", "main"}, + {"hlsl.getdimensions.rw.dx10.frag", "main"}, + {"hlsl.getdimensions.dx10.vert", "main"}, + {"hlsl.getsampleposition.dx10.frag", "main"}, + {"hlsl.global-const-init.frag", "main"}, + {"hlsl.gs-hs-mix.tesc", "HSMain"}, + {"hlsl.domain.1.tese", "main"}, + {"hlsl.domain.2.tese", "main"}, + {"hlsl.domain.3.tese", "main"}, + {"hlsl.function.frag", "main"}, + {"hlsl.hull.1.tesc", "main"}, + {"hlsl.hull.2.tesc", "main"}, + {"hlsl.hull.3.tesc", "main"}, + {"hlsl.hull.4.tesc", "main"}, + {"hlsl.hull.5.tesc", "main"}, + {"hlsl.hull.void.tesc", "main"}, + {"hlsl.hull.ctrlpt-1.tesc", "main"}, + {"hlsl.hull.ctrlpt-2.tesc", "main"}, + {"hlsl.groupid.comp", "main"}, + {"hlsl.identifier.sample.frag", "main"}, + {"hlsl.if.frag", "PixelShaderFunction"}, + {"hlsl.imagefetch-subvec4.comp", "main"}, + {"hlsl.implicitBool.frag", "main"}, + {"hlsl.inf.vert", "main"}, + {"hlsl.inoutquals.frag", "main"}, + {"hlsl.init.frag", "ShaderFunction"}, + {"hlsl.init2.frag", "main"}, + {"hlsl.isfinite.frag", "main"}, + {"hlsl.intrinsics.barriers.comp", "ComputeShaderFunction"}, + {"hlsl.intrinsics.comp", "ComputeShaderFunction"}, + {"hlsl.intrinsics.evalfns.frag", "main"}, + {"hlsl.intrinsics.d3dcolortoubyte4.frag", "main"}, + {"hlsl.intrinsics.double.frag", "PixelShaderFunction"}, + {"hlsl.intrinsics.f1632.frag", "main"}, + {"hlsl.intrinsics.f3216.frag", "main"}, + {"hlsl.intrinsics.frag", "main"}, + {"hlsl.intrinsic.frexp.frag", "main"}, + {"hlsl.intrinsics.lit.frag", "PixelShaderFunction"}, + {"hlsl.intrinsics.negative.comp", "ComputeShaderFunction"}, + {"hlsl.intrinsics.negative.frag", "PixelShaderFunction"}, + {"hlsl.intrinsics.negative.vert", "VertexShaderFunction"}, + {"hlsl.intrinsics.promote.frag", "main"}, + {"hlsl.intrinsics.promote.down.frag", "main"}, + {"hlsl.intrinsics.promote.outputs.frag", "main"}, + {"hlsl.layout.frag", "main"}, + {"hlsl.layoutOverride.vert", "main"}, + {"hlsl.load.2dms.dx10.frag", "main"}, + {"hlsl.load.array.dx10.frag", "main"}, + {"hlsl.load.basic.dx10.frag", "main"}, + {"hlsl.load.basic.dx10.vert", "main"}, + {"hlsl.load.buffer.dx10.frag", "main"}, + {"hlsl.load.buffer.float.dx10.frag", "main"}, + {"hlsl.load.rwbuffer.dx10.frag", "main"}, + {"hlsl.load.rwtexture.dx10.frag", "main"}, + {"hlsl.load.rwtexture.array.dx10.frag", "main"}, + {"hlsl.load.offset.dx10.frag", "main"}, + {"hlsl.load.offsetarray.dx10.frag", "main"}, + {"hlsl.localStructuredBuffer.comp", "main"}, + {"hlsl.logical.binary.frag", "main"}, + {"hlsl.logical.binary.vec.frag", "main"}, + {"hlsl.logicalConvert.frag", "main"}, + {"hlsl.logical.unary.frag", "main"}, + {"hlsl.loopattr.frag", "main"}, + {"hlsl.matpack-pragma.frag", "main"}, + {"hlsl.mip.operator.frag", "main"}, + {"hlsl.mip.negative.frag", "main"}, + {"hlsl.mip.negative2.frag", "main"}, + {"hlsl.namespace.frag", "main"}, + {"hlsl.nonint-index.frag", "main"}, + {"hlsl.matNx1.frag", "main"}, + {"hlsl.matpack-1.frag", "main"}, + {"hlsl.matrixSwizzle.vert", "ShaderFunction"}, + {"hlsl.memberFunCall.frag", "main"}, + {"hlsl.mintypes.frag", "main"}, + {"hlsl.mul-truncate.frag", "main"}, + {"hlsl.multiEntry.vert", "RealEntrypoint"}, + {"hlsl.multiReturn.frag", "main"}, + {"hlsl.matrixindex.frag", "main"}, + {"hlsl.nonstaticMemberFunction.frag", "main"}, + {"hlsl.numericsuffixes.frag", "main"}, + {"hlsl.numthreads.comp", "main_aux2"}, + {"hlsl.overload.frag", "PixelShaderFunction"}, + {"hlsl.opaque-type-bug.frag", "main"}, + {"hlsl.params.default.frag", "main"}, + {"hlsl.params.default.negative.frag", "main"}, + {"hlsl.partialInit.frag", "PixelShaderFunction"}, + {"hlsl.partialFlattenLocal.vert", "main"}, + {"hlsl.PointSize.geom", "main"}, + {"hlsl.PointSize.vert", "main"}, + {"hlsl.pp.vert", "main"}, + {"hlsl.pp.line.frag", "main"}, + {"hlsl.precise.frag", "main"}, + {"hlsl.promote.atomic.frag", "main"}, + {"hlsl.promote.binary.frag", "main"}, + {"hlsl.promote.vec1.frag", "main"}, + {"hlsl.promotions.frag", "main"}, + {"hlsl.rw.atomics.frag", "main"}, + {"hlsl.rw.bracket.frag", "main"}, + {"hlsl.rw.register.frag", "main"}, + {"hlsl.rw.scalar.bracket.frag", "main"}, + {"hlsl.rw.swizzle.frag", "main"}, + {"hlsl.rw.vec2.bracket.frag", "main"}, + {"hlsl.sample.array.dx10.frag", "main"}, + {"hlsl.sample.basic.dx10.frag", "main"}, + {"hlsl.sample.offset.dx10.frag", "main"}, + {"hlsl.sample.offsetarray.dx10.frag", "main"}, + {"hlsl.samplebias.array.dx10.frag", "main"}, + {"hlsl.samplebias.basic.dx10.frag", "main"}, + {"hlsl.samplebias.offset.dx10.frag", "main"}, + {"hlsl.samplebias.offsetarray.dx10.frag", "main"}, + {"hlsl.samplecmp.array.dx10.frag", "main"}, + {"hlsl.samplecmp.basic.dx10.frag", "main"}, + {"hlsl.samplecmp.dualmode.frag", "main"}, + {"hlsl.samplecmp.offset.dx10.frag", "main"}, + {"hlsl.samplecmp.offsetarray.dx10.frag", "main"}, + {"hlsl.samplecmp.negative.frag", "main"}, + {"hlsl.samplecmp.negative2.frag", "main"}, + {"hlsl.samplecmplevelzero.array.dx10.frag", "main"}, + {"hlsl.samplecmplevelzero.basic.dx10.frag", "main"}, + {"hlsl.samplecmplevelzero.offset.dx10.frag", "main"}, + {"hlsl.samplecmplevelzero.offsetarray.dx10.frag", "main"}, + {"hlsl.samplegrad.array.dx10.frag", "main"}, + {"hlsl.samplegrad.basic.dx10.frag", "main"}, + {"hlsl.samplegrad.basic.dx10.vert", "main"}, + {"hlsl.samplegrad.offset.dx10.frag", "main"}, + {"hlsl.samplegrad.offsetarray.dx10.frag", "main"}, + {"hlsl.samplelevel.array.dx10.frag", "main"}, + {"hlsl.samplelevel.basic.dx10.frag", "main"}, + {"hlsl.samplelevel.basic.dx10.vert", "main"}, + {"hlsl.samplelevel.offset.dx10.frag", "main"}, + {"hlsl.samplelevel.offsetarray.dx10.frag", "main"}, + {"hlsl.sample.sub-vec4.dx10.frag", "main"}, + {"hlsl.scalar-length.frag", "main"}, + {"hlsl.scalarCast.vert", "main"}, + {"hlsl.semicolons.frag", "main"}, + {"hlsl.shapeConv.frag", "main"}, + {"hlsl.shapeConvRet.frag", "main"}, + {"hlsl.self_cast.frag", "main"}, + {"hlsl.snorm.uav.comp", "main"}, + {"hlsl.staticMemberFunction.frag", "main"}, + {"hlsl.staticFuncInit.frag", "main"}, + {"hlsl.store.rwbyteaddressbuffer.type.comp", "main"}, + {"hlsl.stringtoken.frag", "main"}, + {"hlsl.string.frag", "main"}, + {"hlsl.struct.split-1.vert", "main"}, + {"hlsl.struct.split.array.geom", "main"}, + {"hlsl.struct.split.assign.frag", "main"}, + {"hlsl.struct.split.call.vert", "main"}, + {"hlsl.struct.split.nested.geom", "main"}, + {"hlsl.struct.split.trivial.geom", "main"}, + {"hlsl.struct.split.trivial.vert", "main"}, + {"hlsl.structarray.flatten.frag", "main"}, + {"hlsl.structarray.flatten.geom", "main"}, + {"hlsl.structbuffer.frag", "main"}, + {"hlsl.structbuffer.append.frag", "main"}, + {"hlsl.structbuffer.append.fn.frag", "main"}, + {"hlsl.structbuffer.atomics.frag", "main"}, + {"hlsl.structbuffer.byte.frag", "main"}, + {"hlsl.structbuffer.coherent.frag", "main"}, + {"hlsl.structbuffer.floatidx.comp", "main"}, + {"hlsl.structbuffer.incdec.frag", "main"}, + {"hlsl.structbuffer.fn.frag", "main"}, + {"hlsl.structbuffer.fn2.comp", "main"}, + {"hlsl.structbuffer.rw.frag", "main"}, + {"hlsl.structbuffer.rwbyte.frag", "main"}, + {"hlsl.structin.vert", "main"}, + {"hlsl.structIoFourWay.frag", "main"}, + {"hlsl.structStructName.frag", "main"}, + {"hlsl.subpass.frag", "main"}, + {"hlsl.synthesizeInput.frag", "main"}, + {"hlsl.texturebuffer.frag", "main"}, + {"hlsl.texture.struct.frag", "main"}, + {"hlsl.texture.subvec4.frag", "main"}, + {"hlsl.this.frag", "main"}, + {"hlsl.intrinsics.vert", "VertexShaderFunction"}, + {"hlsl.intrinsic.frexp.vert", "VertexShaderFunction"}, + {"hlsl.matType.frag", "PixelShaderFunction"}, + {"hlsl.matType.bool.frag", "main"}, + {"hlsl.matType.int.frag", "main"}, + {"hlsl.max.frag", "PixelShaderFunction"}, + {"hlsl.preprocessor.frag", "main"}, + {"hlsl.precedence.frag", "PixelShaderFunction"}, + {"hlsl.precedence2.frag", "PixelShaderFunction"}, + {"hlsl.scalar2matrix.frag", "main"}, + {"hlsl.semantic.geom", "main"}, + {"hlsl.semantic.vert", "main"}, + {"hlsl.semantic-1.vert", "main"}, + {"hlsl.scope.frag", "PixelShaderFunction"}, + {"hlsl.sin.frag", "PixelShaderFunction"}, + {"hlsl.struct.frag", "PixelShaderFunction"}, + {"hlsl.switch.frag", "PixelShaderFunction"}, + {"hlsl.swizzle.frag", "PixelShaderFunction"}, + {"hlsl.target.frag", "main"}, + {"hlsl.targetStruct1.frag", "main"}, + {"hlsl.targetStruct2.frag", "main"}, + {"hlsl.templatetypes.frag", "PixelShaderFunction"}, + {"hlsl.tristream-append.geom", "main"}, + {"hlsl.tx.bracket.frag", "main"}, + {"hlsl.tx.overload.frag", "main"}, + {"hlsl.type.half.frag", "main"}, + {"hlsl.type.identifier.frag", "main"}, + {"hlsl.typeGraphCopy.vert", "main"}, + {"hlsl.typedef.frag", "PixelShaderFunction"}, + {"hlsl.whileLoop.frag", "PixelShaderFunction"}, + {"hlsl.void.frag", "PixelShaderFunction"}, + {"hlsl.type.type.conversion.all.frag", "main"} + }), + FileNameAsCustomTestSuffix +); +// clang-format on + +// clang-format off +INSTANTIATE_TEST_CASE_P( + ToSpirv, HlslVulkan1_1CompileTest, + ::testing::ValuesIn(std::vector{ + {"hlsl.wavebroadcast.comp", "CSMain"}, + {"hlsl.waveprefix.comp", "CSMain"}, + {"hlsl.wavequad.comp", "CSMain"}, + {"hlsl.wavequery.comp", "CSMain"}, + {"hlsl.wavequery.frag", "PixelShaderFunction"}, + {"hlsl.wavereduction.comp", "CSMain"}, + {"hlsl.wavevote.comp", "CSMain"}, + { "hlsl.type.type.conversion.valid.frag", "main" } + }), + FileNameAsCustomTestSuffix +); +// clang-format on + +// clang-format off +INSTANTIATE_TEST_CASE_P( + ToSpirv, HlslCompileAndFlattenTest, + ::testing::ValuesIn(std::vector{ + {"hlsl.array.flatten.frag", "main"}, + {"hlsl.partialFlattenMixed.vert", "main"}, + }), + FileNameAsCustomTestSuffix +); +// clang-format on + +#if ENABLE_OPT +// clang-format off +INSTANTIATE_TEST_CASE_P( + ToSpirv, HlslLegalizeTest, + ::testing::ValuesIn(std::vector{ + {"hlsl.aliasOpaque.frag", "main"}, + {"hlsl.flattenOpaque.frag", "main"}, + {"hlsl.flattenOpaqueInit.vert", "main"}, + {"hlsl.flattenOpaqueInitMix.vert", "main"}, + {"hlsl.flattenSubset.frag", "main"}, + {"hlsl.flattenSubset2.frag", "main"}, + {"hlsl.partialFlattenLocal.vert", "main"}, + {"hlsl.partialFlattenMixed.vert", "main"} + }), + FileNameAsCustomTestSuffix +); +// clang-format on +#endif + +} // anonymous namespace +} // namespace glslangtest diff --git a/deps/glslang/gtests/Initializer.h b/deps/glslang/gtests/Initializer.h new file mode 100644 index 00000000..b46b3f55 --- /dev/null +++ b/deps/glslang/gtests/Initializer.h @@ -0,0 +1,55 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef GLSLANG_GTESTS_INITIALIZER_H +#define GLSLANG_GTESTS_INITIALIZER_H + +#include "glslang/Public/ShaderLang.h" + +namespace glslangtest { + +// Initializes glslang on creation, and destroys it on completion. +// This object is expected to be a singleton, so that internal glslang state +// can be correctly handled. +// +class GlslangInitializer { +public: + GlslangInitializer() { glslang::InitializeProcess(); } + + ~GlslangInitializer() { glslang::FinalizeProcess(); } +}; + +} // namespace glslangtest + +#endif // GLSLANG_GTESTS_INITIALIZER_H diff --git a/deps/glslang/gtests/Link.FromFile.Vk.cpp b/deps/glslang/gtests/Link.FromFile.Vk.cpp new file mode 100644 index 00000000..22892f0b --- /dev/null +++ b/deps/glslang/gtests/Link.FromFile.Vk.cpp @@ -0,0 +1,116 @@ +// +// Copyright (C) 2016-2017 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include + +#include + +#include "TestFixture.h" + +namespace glslangtest { +namespace { + +using LinkTestVulkan = GlslangTest< + ::testing::TestWithParam>>; + +TEST_P(LinkTestVulkan, FromFile) +{ + const auto& fileNames = GetParam(); + const size_t fileCount = fileNames.size(); + const EShMessages controls = DeriveOptions(Source::GLSL, Semantics::Vulkan, Target::AST); + GlslangResult result; + + // Compile each input shader file. + bool success = true; + std::vector> shaders; + for (size_t i = 0; i < fileCount; ++i) { + std::string contents; + tryLoadFile(GlobalTestSettings.testRoot + "/" + fileNames[i], + "input", &contents); + shaders.emplace_back( + new glslang::TShader(GetShaderStage(GetSuffix(fileNames[i])))); + auto* shader = shaders.back().get(); + shader->setAutoMapLocations(true); + success &= compile(shader, contents, "", controls); + result.shaderResults.push_back( + {fileNames[i], shader->getInfoLog(), shader->getInfoDebugLog()}); + } + + // Link all of them. + glslang::TProgram program; + for (const auto& shader : shaders) program.addShader(shader.get()); + success &= program.link(controls); + result.linkingOutput = program.getInfoLog(); + result.linkingError = program.getInfoDebugLog(); + + if (success && (controls & EShMsgSpvRules)) { + spv::SpvBuildLogger logger; + std::vector spirv_binary; + glslang::SpvOptions options; + options.disableOptimizer = true; + options.validate = true; + glslang::GlslangToSpv(*program.getIntermediate(shaders.front()->getStage()), + spirv_binary, &logger, &options); + + std::ostringstream disassembly_stream; + spv::Parameterize(); + spv::Disassemble(disassembly_stream, spirv_binary); + result.spirvWarningsErrors = logger.getAllMessages(); + result.spirv = disassembly_stream.str(); + } + + std::ostringstream stream; + outputResultToStream(&stream, result, controls); + + // Check with expected results. + const std::string expectedOutputFname = + GlobalTestSettings.testRoot + "/baseResults/" + fileNames.front() + ".out"; + std::string expectedOutput; + tryLoadFile(expectedOutputFname, "expected output", &expectedOutput); + + checkEqAndUpdateIfRequested(expectedOutput, stream.str(), expectedOutputFname); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + Glsl, LinkTestVulkan, + ::testing::ValuesIn(std::vector>({ + {"link1.vk.frag", "link2.vk.frag"}, + {"spv.unit1.frag", "spv.unit2.frag", "spv.unit3.frag"}, + })), +); +// clang-format on + +} // anonymous namespace +} // namespace glslangtest diff --git a/deps/glslang/gtests/Link.FromFile.cpp b/deps/glslang/gtests/Link.FromFile.cpp new file mode 100644 index 00000000..ab845bf5 --- /dev/null +++ b/deps/glslang/gtests/Link.FromFile.cpp @@ -0,0 +1,108 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include + +#include + +#include "TestFixture.h" + +namespace glslangtest { +namespace { + +using LinkTest = GlslangTest< + ::testing::TestWithParam>>; + +TEST_P(LinkTest, FromFile) +{ + const auto& fileNames = GetParam(); + const size_t fileCount = fileNames.size(); + const EShMessages controls = DeriveOptions(Source::GLSL, Semantics::OpenGL, Target::AST); + GlslangResult result; + + // Compile each input shader file. + std::vector> shaders; + for (size_t i = 0; i < fileCount; ++i) { + std::string contents; + tryLoadFile(GlobalTestSettings.testRoot + "/" + fileNames[i], + "input", &contents); + shaders.emplace_back( + new glslang::TShader(GetShaderStage(GetSuffix(fileNames[i])))); + auto* shader = shaders.back().get(); + compile(shader, contents, "", controls); + result.shaderResults.push_back( + {fileNames[i], shader->getInfoLog(), shader->getInfoDebugLog()}); + } + + // Link all of them. + glslang::TProgram program; + for (const auto& shader : shaders) program.addShader(shader.get()); + program.link(controls); + result.linkingOutput = program.getInfoLog(); + result.linkingError = program.getInfoDebugLog(); + + std::ostringstream stream; + outputResultToStream(&stream, result, controls); + + // Check with expected results. + const std::string expectedOutputFname = + GlobalTestSettings.testRoot + "/baseResults/" + fileNames.front() + ".out"; + std::string expectedOutput; + tryLoadFile(expectedOutputFname, "expected output", &expectedOutput); + + checkEqAndUpdateIfRequested(expectedOutput, stream.str(), expectedOutputFname); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + Glsl, LinkTest, + ::testing::ValuesIn(std::vector>({ + {"mains1.frag", "mains2.frag", "noMain1.geom", "noMain2.geom"}, + {"noMain.vert", "mains.frag"}, + {"link1.frag", "link2.frag", "link3.frag"}, + {"recurse1.vert", "recurse1.frag", "recurse2.frag"}, + {"300link.frag"}, + {"300link2.frag"}, + {"300link3.frag"}, + {"empty.frag", "empty2.frag", "empty3.frag"}, + {"150.tesc", "150.tese", "400.tesc", "400.tese", "410.tesc", "420.tesc", "420.tese"}, + {"max_vertices_0.geom"}, + {"es-link1.frag", "es-link2.frag"}, + {"missingBodies.vert"} + })), +); +// clang-format on + +} // anonymous namespace +} // namespace glslangtest diff --git a/deps/glslang/gtests/Pp.FromFile.cpp b/deps/glslang/gtests/Pp.FromFile.cpp new file mode 100644 index 00000000..1bea8775 --- /dev/null +++ b/deps/glslang/gtests/Pp.FromFile.cpp @@ -0,0 +1,76 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include + +#include "TestFixture.h" + +namespace glslangtest { +namespace { + +using PreprocessingTest = GlslangTest<::testing::TestWithParam>; + +TEST_P(PreprocessingTest, FromFile) +{ + loadFilePreprocessAndCheck(GlobalTestSettings.testRoot, GetParam()); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + Glsl, PreprocessingTest, + ::testing::ValuesIn(std::vector({ + "preprocessor.bad_arg.vert", + "preprocessor.cpp_style_line_directive.vert", + "preprocessor.cpp_style___FILE__.vert", + "preprocessor.edge_cases.vert", + "preprocessor.errors.vert", + "preprocessor.extensions.vert", + "preprocessor.function_macro.vert", + "preprocessor.include.enabled.vert", + "preprocessor.include.disabled.vert", + "preprocessor.line.vert", + "preprocessor.line.frag", + "preprocessor.pragma.vert", + "preprocessor.simple.vert", + "preprocessor.success_if_parse_would_fail.vert", + "preprocessor.defined.vert", + "preprocessor.many.endif.vert", + "preprocessor.eof_missing.vert", + })), + FileNameAsCustomTestSuffix +); +// clang-format on + +} // anonymous namespace +} // namespace glslangtest diff --git a/deps/glslang/gtests/README.md b/deps/glslang/gtests/README.md new file mode 100644 index 00000000..c8261cc4 --- /dev/null +++ b/deps/glslang/gtests/README.md @@ -0,0 +1,26 @@ +Glslang Tests based on the Google Test Framework +================================================ + +This directory contains [Google Test][gtest] based test fixture and test +cases for glslang. + +Apart from typical unit tests, necessary utility methods are added into +the [`GlslangTests`](TestFixture.h) fixture to provide the ability to do +file-based integration tests. Various `*.FromFile.cpp` files lists names +of files containing input shader code in the `Test/` directory. Utility +methods will load the input shader source, compile them, and compare with +the corresponding expected output in the `Test/baseResults/` directory. + +How to run the tests +-------------------- + +Please make sure you have a copy of [Google Test][gtest] checked out under +the `External` directory before building. After building, just run the +`ctest` command or the `gtests/glslangtests` binary in your build directory. + +The `gtests/glslangtests` binary also provides an `--update-mode` command +line option, which, if supplied, will overwrite the golden files under +the `Test/baseResults/` directory with real output from that invocation. +This serves as an easy way to update golden files. + +[gtest]: https://github.com/google/googletest diff --git a/deps/glslang/gtests/Remap.FromFile.cpp b/deps/glslang/gtests/Remap.FromFile.cpp new file mode 100644 index 00000000..50bce8e3 --- /dev/null +++ b/deps/glslang/gtests/Remap.FromFile.cpp @@ -0,0 +1,118 @@ +// +// Copyright (C) 2016 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include + +#include "TestFixture.h" + +namespace glslangtest { +namespace { + +struct RemapTestArgs { + const char* fileName; + const char* entryPoint; + Source sourceLanguage; + unsigned int remapOpts; +}; + +// We are using FileNameEntryPointPair objects as parameters for instantiating +// the template, so the global FileNameAsCustomTestSuffix() won't work since +// it assumes std::string as parameters. Thus, an overriding one here. +std::string FileNameAsCustomTestSuffix( + const ::testing::TestParamInfo& info) { + std::string name = info.param.fileName; + // A valid test case suffix cannot have '.' and '-' inside. + std::replace(name.begin(), name.end(), '.', '_'); + std::replace(name.begin(), name.end(), '-', '_'); + return name; +} + +using RemapTest = GlslangTest<::testing::TestWithParam>; + +// Remapping SPIR-V modules. +TEST_P(RemapTest, FromFile) +{ + if (GetSuffix(GetParam().fileName) == "spv") { + loadFileRemapAndCheck(GlobalTestSettings.testRoot, GetParam().fileName, + GetParam().sourceLanguage, + Semantics::Vulkan, + Target::Spv, + GetParam().remapOpts); + } else { + loadFileCompileRemapAndCheck(GlobalTestSettings.testRoot, GetParam().fileName, + GetParam().sourceLanguage, + Semantics::Vulkan, + Target::Spv, + GetParam().entryPoint, + GetParam().remapOpts); + } +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + ToSpirv, RemapTest, + ::testing::ValuesIn(std::vector{ + // GLSL remapper tests + // testname entry language remapper_options + { "remap.basic.none.frag", "main", Source::GLSL, spv::spirvbin_t::NONE }, + { "remap.basic.everything.frag", "main", Source::GLSL, spv::spirvbin_t::DO_EVERYTHING }, + { "remap.basic.dcefunc.frag", "main", Source::GLSL, spv::spirvbin_t::DCE_FUNCS }, + { "remap.basic.strip.frag", "main", Source::GLSL, spv::spirvbin_t::STRIP }, + { "remap.specconst.comp", "main", Source::GLSL, spv::spirvbin_t::DO_EVERYTHING }, + { "remap.switch.none.frag", "main", Source::GLSL, spv::spirvbin_t::NONE }, + { "remap.switch.everything.frag", "main", Source::GLSL, spv::spirvbin_t::DO_EVERYTHING }, + { "remap.literal64.none.spv", "main", Source::GLSL, spv::spirvbin_t::NONE }, + { "remap.literal64.everything.spv", "main", Source::GLSL, spv::spirvbin_t::DO_EVERYTHING }, + { "remap.if.none.frag", "main", Source::GLSL, spv::spirvbin_t::NONE }, + { "remap.if.everything.frag", "main", Source::GLSL, spv::spirvbin_t::DO_EVERYTHING }, + { "remap.similar_1a.none.frag", "main", Source::GLSL, spv::spirvbin_t::NONE }, + { "remap.similar_1b.none.frag", "main", Source::GLSL, spv::spirvbin_t::NONE }, + { "remap.similar_1a.everything.frag", "main", Source::GLSL, spv::spirvbin_t::DO_EVERYTHING }, + { "remap.similar_1b.everything.frag", "main", Source::GLSL, spv::spirvbin_t::DO_EVERYTHING }, + { "remap.uniformarray.none.frag", "main", Source::GLSL, spv::spirvbin_t::NONE }, + { "remap.uniformarray.everything.frag", "main", Source::GLSL, spv::spirvbin_t::DO_EVERYTHING }, + + // HLSL remapper tests + { "remap.hlsl.sample.basic.strip.frag", "main", Source::HLSL, spv::spirvbin_t::STRIP }, + { "remap.hlsl.sample.basic.everything.frag", "main", Source::HLSL, spv::spirvbin_t::DO_EVERYTHING }, + { "remap.hlsl.sample.basic.none.frag", "main", Source::HLSL, spv::spirvbin_t::NONE }, + { "remap.hlsl.templatetypes.none.frag", "main", Source::HLSL, spv::spirvbin_t::NONE }, + { "remap.hlsl.templatetypes.everything.frag", "main", Source::HLSL, spv::spirvbin_t::DO_EVERYTHING }, + }), + FileNameAsCustomTestSuffix +); +// clang-format on + +} // anonymous namespace +} // namespace glslangtest diff --git a/deps/glslang/gtests/Settings.cpp b/deps/glslang/gtests/Settings.cpp new file mode 100644 index 00000000..0ac58449 --- /dev/null +++ b/deps/glslang/gtests/Settings.cpp @@ -0,0 +1,51 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include "Settings.h" + +namespace glslangtest { + +// We need CMake to provide us the absolute path to the directory containing +// test files, so we are certain to find those files no matter where the test +// harness binary is generated. This provides out-of-source build capability. +// This will be used as the default test root, but can be overridden with +// the --test-root argument. +#ifndef GLSLANG_TEST_DIRECTORY +#error \ + "GLSLANG_TEST_DIRECTORY needs to be defined for gtest to locate test files." +#endif + +GTestSettings GlobalTestSettings = {nullptr, false, GLSLANG_TEST_DIRECTORY}; + +} // namespace glslangtest diff --git a/deps/glslang/gtests/Settings.h b/deps/glslang/gtests/Settings.h new file mode 100644 index 00000000..c38474cc --- /dev/null +++ b/deps/glslang/gtests/Settings.h @@ -0,0 +1,58 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef GLSLANG_GTESTS_SETTINGS_H +#define GLSLANG_GTESTS_SETTINGS_H + +#include + +namespace glslangtest { + +class GlslangInitializer; + +struct GTestSettings { + // A handle to GlslangInitializer instance. + GlslangInitializer* initializer; + // An indicator of whether GTest should write real output to the file for + // the expected output. + bool updateMode; + // The root directory for test files. + std::string testRoot; +}; + +extern GTestSettings GlobalTestSettings; + +} // namespace glslangtest + +#endif // GLSLANG_GTESTS_SETTINGS_H diff --git a/deps/glslang/gtests/Spv.FromFile.cpp b/deps/glslang/gtests/Spv.FromFile.cpp new file mode 100644 index 00000000..bc05eede --- /dev/null +++ b/deps/glslang/gtests/Spv.FromFile.cpp @@ -0,0 +1,554 @@ + // +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include + +#include + +#include "TestFixture.h" + +namespace glslangtest { +namespace { + +struct IoMapData { + const char* fileName; + const char* entryPoint; + int baseSamplerBinding; + int baseTextureBinding; + int baseImageBinding; + int baseUboBinding; + int baseSsboBinding; + bool autoMapBindings; + bool flattenUniforms; +}; + +std::string FileNameAsCustomTestSuffixIoMap( + const ::testing::TestParamInfo& info) { + std::string name = info.param.fileName; + // A valid test case suffix cannot have '.' and '-' inside. + std::replace(name.begin(), name.end(), '.', '_'); + std::replace(name.begin(), name.end(), '-', '_'); + return name; +} + +using CompileVulkanToSpirvTest = GlslangTest<::testing::TestWithParam>; +using CompileVulkan1_1ToSpirvTest = GlslangTest<::testing::TestWithParam>; +using CompileOpenGLToSpirvTest = GlslangTest<::testing::TestWithParam>; +using VulkanSemantics = GlslangTest<::testing::TestWithParam>; +using OpenGLSemantics = GlslangTest<::testing::TestWithParam>; +using VulkanAstSemantics = GlslangTest<::testing::TestWithParam>; +using HlslIoMap = GlslangTest<::testing::TestWithParam>; +using GlslIoMap = GlslangTest<::testing::TestWithParam>; +#ifdef AMD_EXTENSIONS +using CompileVulkanToSpirvTestAMD = GlslangTest<::testing::TestWithParam>; +#endif +#ifdef NV_EXTENSIONS +using CompileVulkanToSpirvTestNV = GlslangTest<::testing::TestWithParam>; +#endif +using CompileUpgradeTextureToSampledTextureAndDropSamplersTest = GlslangTest<::testing::TestWithParam>; + +// Compiling GLSL to SPIR-V under Vulkan semantics. Expected to successfully +// generate SPIR-V. +TEST_P(CompileVulkanToSpirvTest, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), + Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, + Target::Spv); +} + +TEST_P(CompileVulkan1_1ToSpirvTest, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), + Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, + Target::Spv); +} + +// Compiling GLSL to SPIR-V under OpenGL semantics. Expected to successfully +// generate SPIR-V. +TEST_P(CompileOpenGLToSpirvTest, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), + Source::GLSL, Semantics::OpenGL, glslang::EShTargetVulkan_1_0, + Target::Spv); +} + +// GLSL-level Vulkan semantics test. Expected to error out before generating +// SPIR-V. +TEST_P(VulkanSemantics, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), + Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, + Target::Spv, false); +} + +// GLSL-level Vulkan semantics test. Expected to error out before generating +// SPIR-V. +TEST_P(OpenGLSemantics, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), + Source::GLSL, Semantics::OpenGL, glslang::EShTargetVulkan_1_0, + Target::Spv, false); +} + +// GLSL-level Vulkan semantics test that need to see the AST for validation. +TEST_P(VulkanAstSemantics, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), + Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, + Target::AST); +} + +// HLSL-level Vulkan semantics tests. +TEST_P(HlslIoMap, FromFile) +{ + loadFileCompileIoMapAndCheck(GlobalTestSettings.testRoot, GetParam().fileName, + Source::HLSL, Semantics::Vulkan, + Target::Spv, GetParam().entryPoint, + GetParam().baseSamplerBinding, + GetParam().baseTextureBinding, + GetParam().baseImageBinding, + GetParam().baseUboBinding, + GetParam().baseSsboBinding, + GetParam().autoMapBindings, + GetParam().flattenUniforms); +} + +// GLSL-level Vulkan semantics tests. +TEST_P(GlslIoMap, FromFile) +{ + loadFileCompileIoMapAndCheck(GlobalTestSettings.testRoot, GetParam().fileName, + Source::GLSL, Semantics::Vulkan, + Target::Spv, GetParam().entryPoint, + GetParam().baseSamplerBinding, + GetParam().baseTextureBinding, + GetParam().baseImageBinding, + GetParam().baseUboBinding, + GetParam().baseSsboBinding, + GetParam().autoMapBindings, + GetParam().flattenUniforms); +} + +#ifdef AMD_EXTENSIONS +// Compiling GLSL to SPIR-V under Vulkan semantics (AMD extensions enabled). +// Expected to successfully generate SPIR-V. +TEST_P(CompileVulkanToSpirvTestAMD, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), + Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, + Target::Spv); +} +#endif + +#ifdef NV_EXTENSIONS +// Compiling GLSL to SPIR-V under Vulkan semantics (NV extensions enabled). +// Expected to successfully generate SPIR-V. +TEST_P(CompileVulkanToSpirvTestNV, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), + Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, + Target::Spv); +} +#endif + +TEST_P(CompileUpgradeTextureToSampledTextureAndDropSamplersTest, FromFile) +{ + loadCompileUpgradeTextureToSampledTextureAndDropSamplersAndCheck(GlobalTestSettings.testRoot, + GetParam(), + Source::GLSL, + Semantics::Vulkan, + Target::Spv); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + Glsl, CompileVulkanToSpirvTest, + ::testing::ValuesIn(std::vector({ + // Test looping constructs. + // No tests yet for making sure break and continue from a nested loop + // goes to the innermost target. + "spv.barrier.vert", + "spv.do-simple.vert", + "spv.do-while-continue-break.vert", + "spv.for-complex-condition.vert", + "spv.for-continue-break.vert", + "spv.for-simple.vert", + "spv.for-notest.vert", + "spv.for-nobody.vert", + "spv.while-continue-break.vert", + "spv.while-simple.vert", + // vulkan-specific tests + "spv.set.vert", + "spv.double.comp", + "spv.100ops.frag", + "spv.130.frag", + "spv.140.frag", + "spv.150.geom", + "spv.150.vert", + "spv.16bitstorage.frag", + "spv.16bitstorage_Error.frag", + "spv.16bitstorage-int.frag", + "spv.16bitstorage_Error-int.frag", + "spv.16bitstorage-uint.frag", + "spv.16bitstorage_Error-uint.frag", + "spv.300BuiltIns.vert", + "spv.300layout.frag", + "spv.300layout.vert", + "spv.300layoutp.vert", + "spv.310.comp", + "spv.310.bitcast.frag", + "spv.330.geom", + "spv.400.frag", + "spv.400.tesc", + "spv.400.tese", + "spv.420.geom", + "spv.430.frag", + "spv.430.vert", + "spv.450.tesc", + "spv.450.geom", + "spv.450.noRedecl.tesc", + "spv.8bitstorage-int.frag", + "spv.8bitstorage_Error-int.frag", + "spv.8bitstorage-uint.frag", + "spv.8bitstorage_Error-uint.frag", + "spv.8bitstorage-ubo.vert", + "spv.8bitstorage-ssbo.vert", + "spv.accessChain.frag", + "spv.aggOps.frag", + "spv.always-discard.frag", + "spv.always-discard2.frag", + "spv.arbPostDepthCoverage.frag", + "spv.arbPostDepthCoverage_Error.frag", + "spv.bitCast.frag", + "spv.bool.vert", + "spv.boolInBlock.frag", + "spv.branch-return.vert", + "spv.builtInXFB.vert", + "spv.conditionalDiscard.frag", + "spv.constStruct.vert", + "spv.controlFlowAttributes.frag", + "spv.conversion.frag", + "spv.dataOut.frag", + "spv.dataOutIndirect.frag", + "spv.dataOutIndirect.vert", + "spv.deepRvalue.frag", + "spv.depthOut.frag", + "spv.discard-dce.frag", + "spv.doWhileLoop.frag", + "spv.earlyReturnDiscard.frag", + "spv.extPostDepthCoverage.frag", + "spv.extPostDepthCoverage_Error.frag", + "spv.flowControl.frag", + "spv.forLoop.frag", + "spv.forwardFun.frag", + "spv.fullyCovered.frag", + "spv.functionCall.frag", + "spv.functionNestedOpaque.vert", + "spv.functionSemantics.frag", + "spv.GeometryShaderPassthrough.geom", + "spv.interpOps.frag", + "spv.int64.frag", + "spv.intOps.vert", + "spv.layoutNested.vert", + "spv.length.frag", + "spv.localAggregates.frag", + "spv.loops.frag", + "spv.loopsArtificial.frag", + "spv.matFun.vert", + "spv.matrix.frag", + "spv.matrix2.frag", + "spv.memoryQualifier.frag", + "spv.memoryScopeSemantics.comp", + "spv.memoryScopeSemantics_Error.comp", + "spv.merge-unreachable.frag", + "spv.multiStruct.comp", + "spv.multiStructFuncall.frag", + "spv.newTexture.frag", + "spv.noDeadDecorations.vert", + "spv.nonSquare.vert", + "spv.nonuniform.frag", + "spv.noWorkgroup.comp", + "spv.offsets.frag", + "spv.Operations.frag", + "spv.paramMemory.frag", + "spv.precision.frag", + "spv.precisionNonESSamp.frag", + "spv.prepost.frag", + "spv.qualifiers.vert", + "spv.sample.frag", + "spv.sampleId.frag", + "spv.samplePosition.frag", + "spv.sampleMaskOverrideCoverage.frag", + "spv.shaderBallot.comp", + "spv.shaderDrawParams.vert", + "spv.shaderGroupVote.comp", + "spv.shaderStencilExport.frag", + "spv.shiftOps.frag", + "spv.simpleFunctionCall.frag", + "spv.simpleMat.vert", + "spv.sparseTexture.frag", + "spv.sparseTextureClamp.frag", + "spv.structAssignment.frag", + "spv.structDeref.frag", + "spv.structure.frag", + "spv.switch.frag", + "spv.swizzle.frag", + "spv.swizzleInversion.frag", + "spv.test.frag", + "spv.test.vert", + "spv.texture.frag", + "spv.texture.vert", + "spv.textureBuffer.vert", + "spv.image.frag", + "spv.types.frag", + "spv.uint.frag", + "spv.uniformArray.frag", + "spv.variableArrayIndex.frag", + "spv.varyingArray.frag", + "spv.varyingArrayIndirect.frag", + "spv.vecMatConstruct.frag", + "spv.voidFunction.frag", + "spv.whileLoop.frag", + "spv.AofA.frag", + "spv.queryL.frag", + "spv.separate.frag", + "spv.shortCircuit.frag", + "spv.pushConstant.vert", + "spv.pushConstantAnon.vert", + "spv.subpass.frag", + "spv.specConstant.vert", + "spv.specConstant.comp", + "spv.specConstantComposite.vert", + "spv.specConstantOperations.vert", + "spv.storageBuffer.vert", + "spv.precise.tese", + "spv.precise.tesc", + "spv.vulkan100.subgroupArithmetic.comp", + "spv.vulkan100.subgroupPartitioned.comp", + "spv.xfb.vert", + "spv.xfb2.vert", + "spv.xfb3.vert", + "spv.samplerlessTextureFunctions.frag", + })), + FileNameAsCustomTestSuffix +); + +// clang-format off +INSTANTIATE_TEST_CASE_P( + Glsl, CompileVulkan1_1ToSpirvTest, + ::testing::ValuesIn(std::vector({ + "spv.1.3.8bitstorage-ubo.vert", + "spv.1.3.8bitstorage-ssbo.vert", + "spv.deviceGroup.frag", + "spv.drawParams.vert", + "spv.int8.frag", + "spv.vulkan110.int16.frag", + "spv.int32.frag", + "spv.explicittypes.frag", + "spv.float32.frag", + "spv.float64.frag", + "spv.multiView.frag", + "spv.subgroup.frag", + "spv.subgroup.geom", + "spv.subgroup.tesc", + "spv.subgroup.tese", + "spv.subgroup.vert", + "spv.subgroupArithmetic.comp", + "spv.subgroupBasic.comp", + "spv.subgroupBallot.comp", + "spv.subgroupClustered.comp", + "spv.subgroupClusteredNeg.comp", + "spv.subgroupPartitioned.comp", + "spv.subgroupShuffle.comp", + "spv.subgroupShuffleRelative.comp", + "spv.subgroupQuad.comp", + "spv.subgroupVote.comp", + "spv.vulkan110.storageBuffer.vert", + })), + FileNameAsCustomTestSuffix +); + +// clang-format off +INSTANTIATE_TEST_CASE_P( + Hlsl, HlslIoMap, + ::testing::ValuesIn(std::vector{ + { "spv.register.autoassign.frag", "main_ep", 5, 10, 0, 20, 30, true, false }, + { "spv.register.noautoassign.frag", "main_ep", 5, 10, 0, 15, 30, false, false }, + { "spv.register.autoassign-2.frag", "main", 5, 10, 0, 15, 30, true, true }, + { "spv.register.subpass.frag", "main", 0, 20, 0, 0, 0, true, true }, + { "spv.buffer.autoassign.frag", "main", 5, 10, 0, 15, 30, true, true }, + { "spv.ssbo.autoassign.frag", "main", 5, 10, 0, 15, 30, true, true }, + { "spv.ssboAlias.frag", "main", 0, 0, 0, 0, 83, true, false }, + { "spv.rw.autoassign.frag", "main", 5, 10, 20, 15, 30, true, true }, + { "spv.register.autoassign.rangetest.frag", "main", + glslang::TQualifier::layoutBindingEnd-2, + glslang::TQualifier::layoutBindingEnd+5, + 20, 30, true, false }, + }), + FileNameAsCustomTestSuffixIoMap +); + +// clang-format off +INSTANTIATE_TEST_CASE_P( + Hlsl, GlslIoMap, + ::testing::ValuesIn(std::vector{ + { "spv.glsl.register.autoassign.frag", "main", 5, 10, 0, 20, 30, true, false }, + { "spv.glsl.register.noautoassign.frag", "main", 5, 10, 0, 15, 30, false, false }, + }), + FileNameAsCustomTestSuffixIoMap +); + +// clang-format off +INSTANTIATE_TEST_CASE_P( + Glsl, CompileOpenGLToSpirvTest, + ::testing::ValuesIn(std::vector({ + "spv.460.frag", + "spv.460.vert", + "spv.460.comp", + "spv.atomic.comp", + "spv.glFragColor.frag", + "spv.rankShift.comp", + "spv.specConst.vert", + "spv.OVR_multiview.vert", + "spv.xfbOffsetOnStructMembersAssignment.vert", + })), + FileNameAsCustomTestSuffix +); + +INSTANTIATE_TEST_CASE_P( + Glsl, VulkanSemantics, + ::testing::ValuesIn(std::vector({ + "vulkan.frag", + "vulkan.vert", + "vulkan.comp", + "samplerlessTextureFunctions.frag", + })), + FileNameAsCustomTestSuffix +); + +INSTANTIATE_TEST_CASE_P( + Glsl, OpenGLSemantics, + ::testing::ValuesIn(std::vector({ + "glspv.esversion.vert", + "glspv.version.frag", + "glspv.version.vert", + "glspv.frag", + "glspv.vert", + })), + FileNameAsCustomTestSuffix +); + +INSTANTIATE_TEST_CASE_P( + Glsl, VulkanAstSemantics, + ::testing::ValuesIn(std::vector({ + "vulkan.ast.vert", + })), + FileNameAsCustomTestSuffix +); + +#ifdef AMD_EXTENSIONS +INSTANTIATE_TEST_CASE_P( + Glsl, CompileVulkanToSpirvTestAMD, + ::testing::ValuesIn(std::vector({ + "spv.float16.frag", + "spv.float16Fetch.frag", + "spv.imageLoadStoreLod.frag", + "spv.int16.frag", + "spv.int16.amd.frag", + "spv.shaderBallotAMD.comp", + "spv.shaderFragMaskAMD.frag", + "spv.textureGatherBiasLod.frag", + })), + FileNameAsCustomTestSuffix +); +#endif + +#ifdef NV_EXTENSIONS +INSTANTIATE_TEST_CASE_P( + Glsl, CompileVulkanToSpirvTestNV, + ::testing::ValuesIn(std::vector({ + "spv.sampleMaskOverrideCoverage.frag", + "spv.GeometryShaderPassthrough.geom", + "spv.viewportArray2.vert", + "spv.viewportArray2.tesc", + "spv.stereoViewRendering.vert", + "spv.stereoViewRendering.tesc", + "spv.multiviewPerViewAttributes.vert", + "spv.multiviewPerViewAttributes.tesc", + "spv.atomicInt64.comp", + "spv.shadingRate.frag", + "spv.RayGenShader.rgen", + "spv.RayGenShader_Errors.rgen", + "spv.RayConstants.rgen", + "spv.IntersectShader.rint", + "spv.IntersectShader_Errors.rint", + "spv.AnyHitShader.rahit", + "spv.AnyHitShader_Errors.rahit", + "spv.ClosestHitShader.rchit", + "spv.ClosestHitShader_Errors.rchit", + "spv.MissShader.rmiss", + "spv.MissShader_Errors.rmiss", + "spv.RayCallable.rcall", + "spv.RayCallable_Errors.rcall", + "spv.fragmentShaderBarycentric.frag", + "spv.fragmentShaderBarycentric2.frag", + "spv.computeShaderDerivatives.comp", + "spv.computeShaderDerivatives2.comp", + "spv.shaderImageFootprint.frag", + "spv.meshShaderBuiltins.mesh", + "spv.meshShaderUserDefined.mesh", + "spv.meshShaderPerViewBuiltins.mesh", + "spv.meshShaderPerViewUserDefined.mesh", + "spv.meshShaderSharedMem.mesh", + "spv.meshShaderTaskMem.mesh", + "spv.320.meshShaderUserDefined.mesh", + "spv.meshShaderRedeclBuiltins.mesh", + "spv.meshShaderRedeclPerViewBuiltins.mesh", + "spv.meshTaskShader.task", + "spv.perprimitiveNV.frag", +})), +FileNameAsCustomTestSuffix +); +#endif + +INSTANTIATE_TEST_CASE_P( + Glsl, CompileUpgradeTextureToSampledTextureAndDropSamplersTest, + ::testing::ValuesIn(std::vector({ + "spv.texture.sampler.transform.frag", + })), + FileNameAsCustomTestSuffix +); +// clang-format on + +} // anonymous namespace +} // namespace glslangtest diff --git a/deps/glslang/gtests/TestFixture.cpp b/deps/glslang/gtests/TestFixture.cpp new file mode 100644 index 00000000..d899c780 --- /dev/null +++ b/deps/glslang/gtests/TestFixture.cpp @@ -0,0 +1,182 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include "TestFixture.h" + +namespace glslangtest { + +std::string FileNameAsCustomTestSuffix( + const ::testing::TestParamInfo& info) +{ + std::string name = info.param; + // A valid test case suffix cannot have '.' and '-' inside. + std::replace(name.begin(), name.end(), '.', '_'); + std::replace(name.begin(), name.end(), '-', '_'); + return name; +} + +EShLanguage GetShaderStage(const std::string& stage) +{ + if (stage == "vert") { + return EShLangVertex; + } else if (stage == "tesc") { + return EShLangTessControl; + } else if (stage == "tese") { + return EShLangTessEvaluation; + } else if (stage == "geom") { + return EShLangGeometry; + } else if (stage == "frag") { + return EShLangFragment; + } else if (stage == "comp") { + return EShLangCompute; +#ifdef NV_EXTENSIONS + } else if (stage == "rgen") { + return EShLangRayGenNV; + } else if (stage == "rint") { + return EShLangIntersectNV; + } else if (stage == "rahit") { + return EShLangAnyHitNV; + } else if (stage == "rchit") { + return EShLangClosestHitNV; + } else if (stage == "rmiss") { + return EShLangMissNV; + } else if (stage == "rcall") { + return EShLangCallableNV; + } else if (stage == "task") { + return EShLangTaskNV; + } else if (stage == "mesh") { + return EShLangMeshNV; +#endif + } else { + assert(0 && "Unknown shader stage"); + return EShLangCount; + } +} + +EShMessages DeriveOptions(Source source, Semantics semantics, Target target) +{ + EShMessages result = EShMsgCascadingErrors; + + switch (source) { + case Source::GLSL: + break; + case Source::HLSL: + result = static_cast(result | EShMsgReadHlsl); + break; + } + + switch (target) { + case Target::AST: + result = static_cast(result | EShMsgAST); + break; + case Target::Spv: + result = static_cast(result | EShMsgSpvRules); + result = static_cast(result | EShMsgKeepUncalled); + break; + case Target::BothASTAndSpv: + result = static_cast(result | EShMsgSpvRules | EShMsgAST); + result = static_cast(result | EShMsgKeepUncalled); + break; + }; + + switch (semantics) { + case Semantics::OpenGL: + break; + case Semantics::Vulkan: + result = static_cast(result | EShMsgVulkanRules | EShMsgSpvRules); + break; + } + + result = static_cast(result | EShMsgHlslLegalization); + + return result; +} + +std::pair ReadFile(const std::string& path) +{ + std::ifstream fstream(path, std::ios::in); + if (fstream) { + std::string contents; + fstream.seekg(0, std::ios::end); + contents.reserve((std::string::size_type)fstream.tellg()); + fstream.seekg(0, std::ios::beg); + contents.assign((std::istreambuf_iterator(fstream)), + std::istreambuf_iterator()); + return std::make_pair(true, contents); + } + return std::make_pair(false, ""); +} + +std::pair > ReadSpvBinaryFile(const std::string& path) +{ + std::ifstream fstream(path, std::fstream::in | std::fstream::binary); + + if (!fstream) + return std::make_pair(false, std::vector()); + + std::vector contents; + + // Reserve space (for efficiency, not for correctness) + fstream.seekg(0, fstream.end); + contents.reserve(size_t(fstream.tellg()) / sizeof(std::uint32_t)); + fstream.seekg(0, fstream.beg); + + // There is no istream iterator traversing by uint32_t, so we must loop. + while (!fstream.eof()) { + std::uint32_t inWord; + fstream.read((char *)&inWord, sizeof(inWord)); + + if (!fstream.eof()) + contents.push_back(inWord); + } + + return std::make_pair(true, contents); // hopefully, c++11 move semantics optimizes the copy away. +} + +bool WriteFile(const std::string& path, const std::string& contents) +{ + std::ofstream fstream(path, std::ios::out); + if (!fstream) return false; + fstream << contents; + fstream.flush(); + return true; +} + +std::string GetSuffix(const std::string& name) +{ + const size_t pos = name.rfind('.'); + return (pos == std::string::npos) ? "" : name.substr(name.rfind('.') + 1); +} + +} // namespace glslangtest diff --git a/deps/glslang/gtests/TestFixture.h b/deps/glslang/gtests/TestFixture.h new file mode 100644 index 00000000..3329fa3c --- /dev/null +++ b/deps/glslang/gtests/TestFixture.h @@ -0,0 +1,651 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef GLSLANG_GTESTS_TEST_FIXTURE_H +#define GLSLANG_GTESTS_TEST_FIXTURE_H + +#include +#include +#include +#include +#include +#include + +#include + +#include "SPIRV/GlslangToSpv.h" +#include "SPIRV/disassemble.h" +#include "SPIRV/doc.h" +#include "SPIRV/SPVRemapper.h" +#include "StandAlone/ResourceLimits.h" +#include "glslang/Public/ShaderLang.h" + +#include "Initializer.h" +#include "Settings.h" + +namespace glslangtest { + +// This function is used to provide custom test name suffixes based on the +// shader source file names. Otherwise, the test name suffixes will just be +// numbers, which are not quite obvious. +std::string FileNameAsCustomTestSuffix( + const ::testing::TestParamInfo& info); + +enum class Source { + GLSL, + HLSL, +}; + +// Enum for shader compilation semantics. +enum class Semantics { + OpenGL, + Vulkan +}; + +// Enum for compilation target. +enum class Target { + AST, + Spv, + BothASTAndSpv, +}; + +EShLanguage GetShaderStage(const std::string& stage); + +EShMessages DeriveOptions(Source, Semantics, Target); + +// Reads the content of the file at the given |path|. On success, returns true +// and the contents; otherwise, returns false and an empty string. +std::pair ReadFile(const std::string& path); +std::pair > ReadSpvBinaryFile(const std::string& path); + +// Writes the given |contents| into the file at the given |path|. Returns true +// on successful output. +bool WriteFile(const std::string& path, const std::string& contents); + +// Returns the suffix of the given |name|. +std::string GetSuffix(const std::string& name); + +// Base class for glslang integration tests. It contains many handy utility-like +// methods such as reading shader source files, compiling into AST/SPIR-V, and +// comparing with expected outputs. +// +// To write value-Parameterized tests: +// using ValueParamTest = GlslangTest<::testing::TestWithParam>; +// To use as normal fixture: +// using FixtureTest = GlslangTest<::testing::Test>; +template +class GlslangTest : public GT { +public: + GlslangTest() + : defaultVersion(100), + defaultProfile(ENoProfile), + forceVersionProfile(false), + isForwardCompatible(false) {} + + // Tries to load the contents from the file at the given |path|. On success, + // writes the contents into |contents|. On failure, errors out. + void tryLoadFile(const std::string& path, const std::string& tag, + std::string* contents) + { + bool fileReadOk; + std::tie(fileReadOk, *contents) = ReadFile(path); + ASSERT_TRUE(fileReadOk) << "Cannot open " << tag << " file: " << path; + } + + // Tries to load the contents from the file at the given |path|. On success, + // writes the contents into |contents|. On failure, errors out. + void tryLoadSpvFile(const std::string& path, const std::string& tag, + std::vector& contents) + { + bool fileReadOk; + std::tie(fileReadOk, contents) = ReadSpvBinaryFile(path); + ASSERT_TRUE(fileReadOk) << "Cannot open " << tag << " file: " << path; + } + + // Checks the equality of |expected| and |real|. If they are not equal, + // write |real| to the given file named as |fname| if update mode is on. + void checkEqAndUpdateIfRequested(const std::string& expected, + const std::string& real, + const std::string& fname) + { + // In order to output the message we want under proper circumstances, + // we need the following operator<< stuff. + EXPECT_EQ(expected, real) + << (GlobalTestSettings.updateMode + ? ("Mismatch found and update mode turned on - " + "flushing expected result output.") + : ""); + + // Update the expected output file if requested. + // It looks weird to duplicate the comparison between expected_output + // and stream.str(). However, if creating a variable for the comparison + // result, we cannot have pretty print of the string diff in the above. + if (GlobalTestSettings.updateMode && expected != real) { + EXPECT_TRUE(WriteFile(fname, real)) << "Flushing failed"; + } + } + + struct ShaderResult { + std::string shaderName; + std::string output; + std::string error; + }; + + // A struct for holding all the information returned by glslang compilation + // and linking. + struct GlslangResult { + std::vector shaderResults; + std::string linkingOutput; + std::string linkingError; + std::string spirvWarningsErrors; + std::string spirv; // Optional SPIR-V disassembly text. + }; + + // Compiles and the given source |code| of the given shader |stage| into + // the target under the semantics conveyed via |controls|. Returns true + // and modifies |shader| on success. + bool compile(glslang::TShader* shader, const std::string& code, + const std::string& entryPointName, EShMessages controls, + const TBuiltInResource* resources=nullptr) + { + const char* shaderStrings = code.data(); + const int shaderLengths = static_cast(code.size()); + + shader->setStringsWithLengths(&shaderStrings, &shaderLengths, 1); + if (!entryPointName.empty()) shader->setEntryPoint(entryPointName.c_str()); + return shader->parse( + (resources ? resources : &glslang::DefaultTBuiltInResource), + defaultVersion, isForwardCompatible, controls); + } + + // Compiles and links the given source |code| of the given shader + // |stage| into the target under the semantics specified via |controls|. + // Returns a GlslangResult instance containing all the information generated + // during the process. If the target includes SPIR-V, also disassembles + // the result and returns disassembly text. + GlslangResult compileAndLink( + const std::string shaderName, const std::string& code, + const std::string& entryPointName, EShMessages controls, + glslang::EShTargetClientVersion clientTargetVersion, + bool flattenUniformArrays = false, + EShTextureSamplerTransformMode texSampTransMode = EShTexSampTransKeep, + bool enableOptimizer = false, + bool automap = true) + { + const EShLanguage stage = GetShaderStage(GetSuffix(shaderName)); + + glslang::TShader shader(stage); + if (automap) { + shader.setAutoMapLocations(true); + shader.setAutoMapBindings(true); + } + shader.setTextureSamplerTransformMode(texSampTransMode); + shader.setFlattenUniformArrays(flattenUniformArrays); + + if (controls & EShMsgSpvRules) { + if (controls & EShMsgVulkanRules) { + shader.setEnvInput((controls & EShMsgReadHlsl) ? glslang::EShSourceHlsl + : glslang::EShSourceGlsl, + stage, glslang::EShClientVulkan, 100); + shader.setEnvClient(glslang::EShClientVulkan, clientTargetVersion); + shader.setEnvTarget(glslang::EShTargetSpv, + clientTargetVersion == glslang::EShTargetVulkan_1_1 ? glslang::EShTargetSpv_1_3 + : glslang::EShTargetSpv_1_0); + } else { + shader.setEnvInput((controls & EShMsgReadHlsl) ? glslang::EShSourceHlsl + : glslang::EShSourceGlsl, + stage, glslang::EShClientOpenGL, 100); + shader.setEnvClient(glslang::EShClientOpenGL, clientTargetVersion); + shader.setEnvTarget(glslang::EshTargetSpv, glslang::EShTargetSpv_1_0); + } + } + + bool success = compile(&shader, code, entryPointName, controls); + + glslang::TProgram program; + program.addShader(&shader); + success &= program.link(controls); + + spv::SpvBuildLogger logger; + + if (success && (controls & EShMsgSpvRules)) { + std::vector spirv_binary; + glslang::SpvOptions options; + options.disableOptimizer = !enableOptimizer; + options.validate = true; + glslang::GlslangToSpv(*program.getIntermediate(stage), + spirv_binary, &logger, &options); + + std::ostringstream disassembly_stream; + spv::Parameterize(); + spv::Disassemble(disassembly_stream, spirv_binary); + return {{{shaderName, shader.getInfoLog(), shader.getInfoDebugLog()},}, + program.getInfoLog(), program.getInfoDebugLog(), + logger.getAllMessages(), disassembly_stream.str()}; + } else { + return {{{shaderName, shader.getInfoLog(), shader.getInfoDebugLog()},}, + program.getInfoLog(), program.getInfoDebugLog(), "", ""}; + } + } + + // Compiles and links the given source |code| of the given shader + // |stage| into the target under the semantics specified via |controls|. + // Returns a GlslangResult instance containing all the information generated + // during the process. If the target includes SPIR-V, also disassembles + // the result and returns disassembly text. + GlslangResult compileLinkIoMap( + const std::string shaderName, const std::string& code, + const std::string& entryPointName, EShMessages controls, + int baseSamplerBinding, + int baseTextureBinding, + int baseImageBinding, + int baseUboBinding, + int baseSsboBinding, + bool autoMapBindings, + bool flattenUniformArrays) + { + const EShLanguage stage = GetShaderStage(GetSuffix(shaderName)); + + glslang::TShader shader(stage); + shader.setShiftSamplerBinding(baseSamplerBinding); + shader.setShiftTextureBinding(baseTextureBinding); + shader.setShiftImageBinding(baseImageBinding); + shader.setShiftUboBinding(baseUboBinding); + shader.setShiftSsboBinding(baseSsboBinding); + shader.setAutoMapBindings(autoMapBindings); + shader.setAutoMapLocations(true); + shader.setFlattenUniformArrays(flattenUniformArrays); + + bool success = compile(&shader, code, entryPointName, controls); + + glslang::TProgram program; + program.addShader(&shader); + + success &= program.link(controls); + success &= program.mapIO(); + + spv::SpvBuildLogger logger; + + if (success && (controls & EShMsgSpvRules)) { + std::vector spirv_binary; + glslang::SpvOptions options; + options.validate = true; + glslang::GlslangToSpv(*program.getIntermediate(stage), + spirv_binary, &logger, &options); + + std::ostringstream disassembly_stream; + spv::Parameterize(); + spv::Disassemble(disassembly_stream, spirv_binary); + return {{{shaderName, shader.getInfoLog(), shader.getInfoDebugLog()},}, + program.getInfoLog(), program.getInfoDebugLog(), + logger.getAllMessages(), disassembly_stream.str()}; + } else { + return {{{shaderName, shader.getInfoLog(), shader.getInfoDebugLog()},}, + program.getInfoLog(), program.getInfoDebugLog(), "", ""}; + } + } + + // This is like compileAndLink but with remapping of the SPV binary + // through spirvbin_t::remap(). While technically this could be merged + // with compileAndLink() above (with the remap step optionally being a no-op) + // it is given separately here for ease of future extraction. + GlslangResult compileLinkRemap( + const std::string shaderName, const std::string& code, + const std::string& entryPointName, EShMessages controls, + const unsigned int remapOptions = spv::spirvbin_t::NONE) + { + const EShLanguage stage = GetShaderStage(GetSuffix(shaderName)); + + glslang::TShader shader(stage); + shader.setAutoMapBindings(true); + shader.setAutoMapLocations(true); + + bool success = compile(&shader, code, entryPointName, controls); + + glslang::TProgram program; + program.addShader(&shader); + success &= program.link(controls); + + spv::SpvBuildLogger logger; + + if (success && (controls & EShMsgSpvRules)) { + std::vector spirv_binary; + glslang::SpvOptions options; + options.validate = true; + glslang::GlslangToSpv(*program.getIntermediate(stage), + spirv_binary, &logger, &options); + + spv::spirvbin_t(0 /*verbosity*/).remap(spirv_binary, remapOptions); + + std::ostringstream disassembly_stream; + spv::Parameterize(); + spv::Disassemble(disassembly_stream, spirv_binary); + return {{{shaderName, shader.getInfoLog(), shader.getInfoDebugLog()},}, + program.getInfoLog(), program.getInfoDebugLog(), + logger.getAllMessages(), disassembly_stream.str()}; + } else { + return {{{shaderName, shader.getInfoLog(), shader.getInfoDebugLog()},}, + program.getInfoLog(), program.getInfoDebugLog(), "", ""}; + } + } + + // remap the binary in 'code' with the options in remapOptions + GlslangResult remap( + const std::string shaderName, const std::vector& code, + EShMessages controls, + const unsigned int remapOptions = spv::spirvbin_t::NONE) + { + if ((controls & EShMsgSpvRules)) { + std::vector spirv_binary(code); // scratch copy + + spv::spirvbin_t(0 /*verbosity*/).remap(spirv_binary, remapOptions); + + std::ostringstream disassembly_stream; + spv::Parameterize(); + spv::Disassemble(disassembly_stream, spirv_binary); + + return {{{shaderName, "", ""},}, + "", "", + "", disassembly_stream.str()}; + } else { + return {{{shaderName, "", ""},}, "", "", "", ""}; + } + } + + void outputResultToStream(std::ostringstream* stream, + const GlslangResult& result, + EShMessages controls) + { + const auto outputIfNotEmpty = [&stream](const std::string& str) { + if (!str.empty()) *stream << str << "\n"; + }; + + for (const auto& shaderResult : result.shaderResults) { + *stream << shaderResult.shaderName << "\n"; + outputIfNotEmpty(shaderResult.output); + outputIfNotEmpty(shaderResult.error); + } + outputIfNotEmpty(result.linkingOutput); + outputIfNotEmpty(result.linkingError); + *stream << result.spirvWarningsErrors; + + if (controls & EShMsgSpvRules) { + *stream + << (result.spirv.empty() + ? "SPIR-V is not generated for failed compile or link\n" + : result.spirv); + } + } + + void loadFileCompileAndCheck(const std::string& testDir, + const std::string& testName, + Source source, + Semantics semantics, + glslang::EShTargetClientVersion clientTargetVersion, + Target target, + bool automap = true, + const std::string& entryPointName="", + const std::string& baseDir="/baseResults/", + const bool enableOptimizer = false) + { + const std::string inputFname = testDir + "/" + testName; + const std::string expectedOutputFname = + testDir + baseDir + testName + ".out"; + std::string input, expectedOutput; + + tryLoadFile(inputFname, "input", &input); + tryLoadFile(expectedOutputFname, "expected output", &expectedOutput); + + EShMessages controls = DeriveOptions(source, semantics, target); + if (enableOptimizer) + controls = static_cast(controls & ~EShMsgHlslLegalization); + GlslangResult result = compileAndLink(testName, input, entryPointName, controls, clientTargetVersion, false, + EShTexSampTransKeep, enableOptimizer, automap); + + // Generate the hybrid output in the way of glslangValidator. + std::ostringstream stream; + outputResultToStream(&stream, result, controls); + + checkEqAndUpdateIfRequested(expectedOutput, stream.str(), + expectedOutputFname); + } + + void loadFileCompileFlattenUniformsAndCheck(const std::string& testDir, + const std::string& testName, + Source source, + Semantics semantics, + Target target, + const std::string& entryPointName="") + { + const std::string inputFname = testDir + "/" + testName; + const std::string expectedOutputFname = + testDir + "/baseResults/" + testName + ".out"; + std::string input, expectedOutput; + + tryLoadFile(inputFname, "input", &input); + tryLoadFile(expectedOutputFname, "expected output", &expectedOutput); + + const EShMessages controls = DeriveOptions(source, semantics, target); + GlslangResult result = compileAndLink(testName, input, entryPointName, controls, + glslang::EShTargetVulkan_1_0, true); + + // Generate the hybrid output in the way of glslangValidator. + std::ostringstream stream; + outputResultToStream(&stream, result, controls); + + checkEqAndUpdateIfRequested(expectedOutput, stream.str(), + expectedOutputFname); + } + + void loadFileCompileIoMapAndCheck(const std::string& testDir, + const std::string& testName, + Source source, + Semantics semantics, + Target target, + const std::string& entryPointName, + int baseSamplerBinding, + int baseTextureBinding, + int baseImageBinding, + int baseUboBinding, + int baseSsboBinding, + bool autoMapBindings, + bool flattenUniformArrays) + { + const std::string inputFname = testDir + "/" + testName; + const std::string expectedOutputFname = + testDir + "/baseResults/" + testName + ".out"; + std::string input, expectedOutput; + + tryLoadFile(inputFname, "input", &input); + tryLoadFile(expectedOutputFname, "expected output", &expectedOutput); + + const EShMessages controls = DeriveOptions(source, semantics, target); + GlslangResult result = compileLinkIoMap(testName, input, entryPointName, controls, + baseSamplerBinding, baseTextureBinding, baseImageBinding, + baseUboBinding, baseSsboBinding, + autoMapBindings, + flattenUniformArrays); + + // Generate the hybrid output in the way of glslangValidator. + std::ostringstream stream; + outputResultToStream(&stream, result, controls); + + checkEqAndUpdateIfRequested(expectedOutput, stream.str(), + expectedOutputFname); + } + + void loadFileCompileRemapAndCheck(const std::string& testDir, + const std::string& testName, + Source source, + Semantics semantics, + Target target, + const std::string& entryPointName="", + const unsigned int remapOptions = spv::spirvbin_t::NONE) + { + const std::string inputFname = testDir + "/" + testName; + const std::string expectedOutputFname = + testDir + "/baseResults/" + testName + ".out"; + std::string input, expectedOutput; + + tryLoadFile(inputFname, "input", &input); + tryLoadFile(expectedOutputFname, "expected output", &expectedOutput); + + const EShMessages controls = DeriveOptions(source, semantics, target); + GlslangResult result = compileLinkRemap(testName, input, entryPointName, controls, remapOptions); + + // Generate the hybrid output in the way of glslangValidator. + std::ostringstream stream; + outputResultToStream(&stream, result, controls); + + checkEqAndUpdateIfRequested(expectedOutput, stream.str(), + expectedOutputFname); + } + + void loadFileRemapAndCheck(const std::string& testDir, + const std::string& testName, + Source source, + Semantics semantics, + Target target, + const unsigned int remapOptions = spv::spirvbin_t::NONE) + { + const std::string inputFname = testDir + "/" + testName; + const std::string expectedOutputFname = + testDir + "/baseResults/" + testName + ".out"; + std::vector input; + std::string expectedOutput; + + tryLoadSpvFile(inputFname, "input", input); + tryLoadFile(expectedOutputFname, "expected output", &expectedOutput); + + const EShMessages controls = DeriveOptions(source, semantics, target); + GlslangResult result = remap(testName, input, controls, remapOptions); + + // Generate the hybrid output in the way of glslangValidator. + std::ostringstream stream; + outputResultToStream(&stream, result, controls); + + checkEqAndUpdateIfRequested(expectedOutput, stream.str(), + expectedOutputFname); + } + + // Preprocesses the given |source| code. On success, returns true, the + // preprocessed shader, and warning messages. Otherwise, returns false, an + // empty string, and error messages. + std::tuple preprocess( + const std::string& source) + { + const char* shaderStrings = source.data(); + const int shaderLengths = static_cast(source.size()); + + glslang::TShader shader(EShLangVertex); + shader.setStringsWithLengths(&shaderStrings, &shaderLengths, 1); + std::string ppShader; + glslang::TShader::ForbidIncluder includer; + const bool success = shader.preprocess( + &glslang::DefaultTBuiltInResource, defaultVersion, defaultProfile, + forceVersionProfile, isForwardCompatible, (EShMessages)(EShMsgOnlyPreprocessor | EShMsgCascadingErrors), + &ppShader, includer); + + std::string log = shader.getInfoLog(); + log += shader.getInfoDebugLog(); + if (success) { + return std::make_tuple(true, ppShader, log); + } else { + return std::make_tuple(false, "", log); + } + } + + void loadFilePreprocessAndCheck(const std::string& testDir, + const std::string& testName) + { + const std::string inputFname = testDir + "/" + testName; + const std::string expectedOutputFname = + testDir + "/baseResults/" + testName + ".out"; + const std::string expectedErrorFname = + testDir + "/baseResults/" + testName + ".err"; + std::string input, expectedOutput, expectedError; + + tryLoadFile(inputFname, "input", &input); + tryLoadFile(expectedOutputFname, "expected output", &expectedOutput); + tryLoadFile(expectedErrorFname, "expected error", &expectedError); + + bool ppOk; + std::string output, error; + std::tie(ppOk, output, error) = preprocess(input); + if (!output.empty()) output += '\n'; + if (!error.empty()) error += '\n'; + + checkEqAndUpdateIfRequested(expectedOutput, output, + expectedOutputFname); + checkEqAndUpdateIfRequested(expectedError, error, + expectedErrorFname); + } + + void loadCompileUpgradeTextureToSampledTextureAndDropSamplersAndCheck(const std::string& testDir, + const std::string& testName, + Source source, + Semantics semantics, + Target target, + const std::string& entryPointName = "") + { + const std::string inputFname = testDir + "/" + testName; + const std::string expectedOutputFname = testDir + "/baseResults/" + testName + ".out"; + std::string input, expectedOutput; + + tryLoadFile(inputFname, "input", &input); + tryLoadFile(expectedOutputFname, "expected output", &expectedOutput); + + const EShMessages controls = DeriveOptions(source, semantics, target); + GlslangResult result = compileAndLink(testName, input, entryPointName, controls, + glslang::EShTargetVulkan_1_0, false, + EShTexSampTransUpgradeTextureRemoveSampler); + + // Generate the hybrid output in the way of glslangValidator. + std::ostringstream stream; + outputResultToStream(&stream, result, controls); + + checkEqAndUpdateIfRequested(expectedOutput, stream.str(), + expectedOutputFname); + } + +private: + const int defaultVersion; + const EProfile defaultProfile; + const bool forceVersionProfile; + const bool isForwardCompatible; +}; + +} // namespace glslangtest + +#endif // GLSLANG_GTESTS_TEST_FIXTURE_H diff --git a/deps/glslang/gtests/main.cpp b/deps/glslang/gtests/main.cpp new file mode 100644 index 00000000..9cd06d1d --- /dev/null +++ b/deps/glslang/gtests/main.cpp @@ -0,0 +1,79 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include +#include + +#include + +#include "Initializer.h" +#include "Settings.h" + +int main(int argc, char** argv) +{ + ::testing::InitGoogleTest(&argc, argv); + + std::unique_ptr initializer( + new glslangtest::GlslangInitializer); + + glslangtest::GlobalTestSettings.initializer = initializer.get(); + + for (int i = 1; i < argc; ++i) { + if (std::string("--update-mode") == argv[i]) { + glslangtest::GlobalTestSettings.updateMode = true; + } + if (std::string("--test-root") == argv[i]) { + // Allow the user set the test root directory. This is useful + // for testing with files from another source tree. + if (i + 1 < argc) { + glslangtest::GlobalTestSettings.testRoot = argv[i + 1]; + i++; + } else { + printf("error: --test-root requires an argument\n"); + return 1; + } + } + if (std::string("--help") == argv[i]) { + printf("\nExtra options:\n\n"); + printf(" --update-mode\n Update the golden results for the tests.\n"); + printf(" --test-root \n Specify the test root directory (useful for testing with\n files from another source tree).\n"); + } + } + + const int result = RUN_ALL_TESTS(); + + glslangtest::GlobalTestSettings.initializer = nullptr; + + return result; +} diff --git a/deps/glslang/gtests/pch.cpp b/deps/glslang/gtests/pch.cpp new file mode 100644 index 00000000..b7a08654 --- /dev/null +++ b/deps/glslang/gtests/pch.cpp @@ -0,0 +1,35 @@ +// +// Copyright (C) 2018 The Khronos Group Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "pch.h" diff --git a/deps/glslang/gtests/pch.h b/deps/glslang/gtests/pch.h new file mode 100644 index 00000000..94e95b1e --- /dev/null +++ b/deps/glslang/gtests/pch.h @@ -0,0 +1,39 @@ +#ifndef _PCH_H +#define _PCH_H +// +// Copyright (C) 2018 The Khronos Group Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "TestFixture.h" + +#endif /* _PCH_H */ diff --git a/deps/glslang/hlsl/CMakeLists.txt b/deps/glslang/hlsl/CMakeLists.txt index a3b643f0..f918d7a1 100644 --- a/deps/glslang/hlsl/CMakeLists.txt +++ b/deps/glslang/hlsl/CMakeLists.txt @@ -17,6 +17,8 @@ set(HEADERS hlslGrammar.h hlslParseables.h) +glslang_pch(SOURCES pch.cpp) + add_library(HLSL ${LIB_TYPE} ${SOURCES} ${HEADERS}) set_property(TARGET HLSL PROPERTY FOLDER hlsl) set_property(TARGET HLSL PROPERTY POSITION_INDEPENDENT_CODE ON) @@ -30,6 +32,12 @@ if(WIN32) endif(WIN32) if(ENABLE_GLSLANG_INSTALL) - install(TARGETS HLSL - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + if(BUILD_SHARED_LIBS) + install(TARGETS HLSL + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + else() + install(TARGETS HLSL + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() endif(ENABLE_GLSLANG_INSTALL) diff --git a/deps/glslang/hlsl/hlslGrammar.cpp b/deps/glslang/hlsl/hlslGrammar.cpp index cb058779..6acaccbf 100644 --- a/deps/glslang/hlsl/hlslGrammar.cpp +++ b/deps/glslang/hlsl/hlslGrammar.cpp @@ -126,8 +126,6 @@ bool HlslGrammar::acceptIdentifier(HlslToken& idToken) // bool HlslGrammar::acceptCompilationUnit() { - TIntermNode* unitNode = nullptr; - if (! acceptDeclarationList(unitNode)) return false; @@ -324,7 +322,7 @@ bool HlslGrammar::acceptSamplerDeclarationDX9(TType& /*type*/) // node for all the initializers. Each function created is a top-level node to grow // into the passed-in nodeList. // -// If 'nodeList' is passed in as non-null, it must an aggregate to extend for +// If 'nodeList' is passed in as non-null, it must be an aggregate to extend for // each top-level node the declaration creates. Otherwise, if only one top-level // node in generated here, that is want is returned in nodeList. // @@ -489,7 +487,7 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList) // Declare the variable and add any initializer code to the AST. // The top-level node is always made into an aggregate, as that's // historically how the AST has been. - initializers = intermediate.growAggregate(initializers, + initializers = intermediate.growAggregate(initializers, parseContext.declareVariable(idToken.loc, *fullName, variableType, expressionNode), idToken.loc); } @@ -506,11 +504,16 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList) if (initializers != nullptr) initializers->setOperator(EOpSequence); - // Add the initializers' aggregate to the nodeList we were handed. - if (nodeList) - nodeList = intermediate.growAggregate(nodeList, initializers); - else - nodeList = initializers; + // if we have a locally scoped static, it needs a globally scoped initializer + if (declaredType.getQualifier().storage == EvqGlobal && !parseContext.symbolTable.atGlobalLevel()) { + unitNode = intermediate.growAggregate(unitNode, initializers, idToken.loc); + } else { + // Add the initializers' aggregate to the nodeList we were handed. + if (nodeList) + nodeList = intermediate.growAggregate(nodeList, initializers); + else + nodeList = initializers; + } // SEMICOLON if (! acceptTokenClass(EHTokSemicolon)) { @@ -518,13 +521,11 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList) // was actually an assignment such as "float = 4", where "float" is an identifier. // We put the token back to let further parsing happen for cases where that may // happen. This errors on the side of caution, and mostly triggers the error. - if (peek() == EHTokAssign || peek() == EHTokLeftBracket || peek() == EHTokDot || peek() == EHTokComma) { + if (peek() == EHTokAssign || peek() == EHTokLeftBracket || peek() == EHTokDot || peek() == EHTokComma) recedeToken(); - return false; - } else { + else expected(";"); - return false; - } + return false; } return true; @@ -651,7 +652,7 @@ bool HlslGrammar::acceptQualifier(TQualifier& qualifier) do { switch (peek()) { case EHTokStatic: - qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + qualifier.storage = EvqGlobal; break; case EHTokExtern: // TODO: no meaning in glslang? diff --git a/deps/glslang/hlsl/hlslGrammar.h b/deps/glslang/hlsl/hlslGrammar.h index 046f7957..323f3b13 100644 --- a/deps/glslang/hlsl/hlslGrammar.h +++ b/deps/glslang/hlsl/hlslGrammar.h @@ -52,7 +52,7 @@ namespace glslang { public: HlslGrammar(HlslScanContext& scanner, HlslParseContext& parseContext) : HlslTokenStream(scanner), parseContext(parseContext), intermediate(parseContext.intermediate), - typeIdentifiers(false) { } + typeIdentifiers(false), unitNode(nullptr) { } virtual ~HlslGrammar() { } bool parse(); @@ -133,6 +133,7 @@ namespace glslang { HlslParseContext& parseContext; // state of parsing and helper functions for building the intermediate TIntermediate& intermediate; // the final product, the intermediate representation, includes the AST bool typeIdentifiers; // shader uses some types as identifiers + TIntermNode* unitNode; }; } // end namespace glslang diff --git a/deps/glslang/hlsl/hlslParseHelper.cpp b/deps/glslang/hlsl/hlslParseHelper.cpp index 47836879..6ce182de 100644 --- a/deps/glslang/hlsl/hlslParseHelper.cpp +++ b/deps/glslang/hlsl/hlslParseHelper.cpp @@ -97,9 +97,6 @@ HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& int if (language == EShLangGeometry) globalOutputDefaults.layoutStream = 0; - - if (spvVersion.spv == 0 || spvVersion.vulkan == 0) - infoSink.info << "ERROR: HLSL currently only supported when requesting SPIR-V for Vulkan.\n"; } HlslParseContext::~HlslParseContext() @@ -1475,22 +1472,25 @@ bool HlslParseContext::isClipOrCullDistance(TBuiltInVariable builtIn) void HlslParseContext::fixBuiltInIoType(TType& type) { int requiredArraySize = 0; + int requiredVectorSize = 0; switch (type.getQualifier().builtIn) { case EbvTessLevelOuter: requiredArraySize = 4; break; case EbvTessLevelInner: requiredArraySize = 2; break; - case EbvTessCoord: + case EbvSampleMask: { - // tesscoord is always a vec3 for the IO variable, no matter the shader's - // declared vector size. - TType tessCoordType(type.getBasicType(), type.getQualifier().storage, 3); - - tessCoordType.getQualifier() = type.getQualifier(); - type.shallowCopy(tessCoordType); - + // Promote scalar to array of size 1. Leave existing arrays alone. + if (!type.isArray()) + requiredArraySize = 1; break; } + + case EbvWorkGroupId: requiredVectorSize = 3; break; + case EbvGlobalInvocationId: requiredVectorSize = 3; break; + case EbvLocalInvocationId: requiredVectorSize = 3; break; + case EbvTessCoord: requiredVectorSize = 3; break; + default: if (isClipOrCullDistance(type)) { const int loc = type.getQualifier().layoutLocation; @@ -1511,6 +1511,14 @@ void HlslParseContext::fixBuiltInIoType(TType& type) return; } + // Alter or set vector size as needed. + if (requiredVectorSize > 0) { + TType newType(type.getBasicType(), type.getQualifier().storage, requiredVectorSize); + newType.getQualifier() = type.getQualifier(); + + type.shallowCopy(newType); + } + // Alter or set array size as needed. if (requiredArraySize > 0) { if (!type.isArray() || type.getOuterArraySize() != requiredArraySize) { @@ -2697,6 +2705,15 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op } else if (assignsClipPos(left)) { // Position can require special handling: see comment above assignPosition return assignPosition(loc, op, left, right); + } else if (left->getQualifier().builtIn == EbvSampleMask) { + // Certain builtins are required to be arrayed outputs in SPIR-V, but may internally be scalars + // in the shader. Copy the scalar RHS into the LHS array element zero, if that happens. + if (left->isArray() && !right->isArray()) { + const TType derefType(left->getType(), 0); + left = intermediate.addIndex(EOpIndexDirect, left, intermediate.addConstantUnion(0, loc), loc); + left->setType(derefType); + // Fall through to add assign. + } } return intermediate.addAssign(op, left, right, loc); @@ -4357,16 +4374,13 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType txquerylod->getSequence().push_back(txcombine); txquerylod->getSequence().push_back(argCoord); - TIntermTyped* lodComponent = intermediate.addConstantUnion(0, loc, true); + TIntermTyped* lodComponent = intermediate.addConstantUnion( + op == EOpMethodCalculateLevelOfDetail ? 0 : 1, + loc, true); TIntermTyped* lodComponentIdx = intermediate.addIndex(EOpIndexDirect, txquerylod, lodComponent, loc); lodComponentIdx->setType(TType(EbtFloat, EvqTemporary, 1)); - node = lodComponentIdx; - // We cannot currently obtain the unclamped LOD - if (op == EOpMethodCalculateLevelOfDetailUnclamped) - error(loc, "unimplemented: CalculateLevelOfDetailUnclamped", "", ""); - break; } @@ -4487,23 +4501,18 @@ void HlslParseContext::decomposeGeometryMethods(const TSourceLoc& loc, TIntermTy emit->setLoc(loc); emit->setType(TType(EbtVoid)); - // find the matching output - if (gsStreamOutput == nullptr) { - error(loc, "unable to find output symbol for Append()", "", ""); - return; - } - - sequence = intermediate.growAggregate(sequence, - handleAssign(loc, EOpAssign, - intermediate.addSymbol(*gsStreamOutput, loc), - argAggregate->getSequence()[1]->getAsTyped()), - loc); + TIntermTyped* data = argAggregate->getSequence()[1]->getAsTyped(); + // This will be patched in finalization during finalizeAppendMethods() + sequence = intermediate.growAggregate(sequence, data, loc); sequence = intermediate.growAggregate(sequence, emit); sequence->setOperator(EOpSequence); sequence->setLoc(loc); sequence->setType(TType(EbtVoid)); + + gsAppends.push_back({sequence, loc}); + node = sequence; } break; @@ -4815,6 +4824,7 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*& } else { // Set the matching operator. Since output is absent, this is all we need to do. node->getAsAggregate()->setOperator(atomicOp); + node->setType(atomic->getType()); } } @@ -6056,13 +6066,22 @@ void HlslParseContext::handleRegister(const TSourceLoc& loc, TQualifier& qualifi } } - // TODO: learn what all these really mean and how they interact with regNumber and subComponent + // more information about register types see + // https://docs.microsoft.com/en-us/windows/desktop/direct3dhlsl/dx-graphics-hlsl-variable-register const std::vector& resourceInfo = intermediate.getResourceSetBinding(); switch (std::tolower(desc[0])) { + case 'c': + // c register is the register slot in the global const buffer + // each slot is a vector of 4 32 bit components + qualifier.layoutOffset = regNumber * 4 * 4; + break; + // const buffer register slot case 'b': + // textrues and structured buffers case 't': - case 'c': + // samplers case 's': + // uav resources case 'u': // if nothing else has set the binding, do so now // (other mechanisms override this one) @@ -6233,7 +6252,8 @@ bool HlslParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node bool constructingMatrix = false; switch (op) { case EOpConstructTextureSampler: - return constructorTextureSamplerError(loc, function); + error(loc, "unhandled texture constructor", "constructor", ""); + return true; case EOpConstructMat2x2: case EOpConstructMat2x3: case EOpConstructMat2x4: @@ -6385,12 +6405,18 @@ bool HlslParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node return true; } - if (op == EOpConstructStruct && ! type.isArray() && isScalarConstructor(node)) - return false; + if (op == EOpConstructStruct && ! type.isArray()) { + if (isScalarConstructor(node)) + return false; - if (op == EOpConstructStruct && ! type.isArray() && (int)type.getStruct()->size() != function.getParamCount()) { - error(loc, "Number of constructor parameters does not match the number of structure fields", "constructor", ""); - return true; + // Self-type construction: e.g, we can construct a struct from a single identically typed object. + if (function.getParamCount() == 1 && type == *function[0].type) + return false; + + if ((int)type.getStruct()->size() != function.getParamCount()) { + error(loc, "Number of constructor parameters does not match the number of structure fields", "constructor", ""); + return true; + } } if ((op != EOpConstructStruct && size != 1 && size < type.computeNumComponents()) || @@ -6419,67 +6445,6 @@ bool HlslParseContext::isScalarConstructor(const TIntermNode* node) (node->getAsAggregate() == nullptr || node->getAsAggregate()->getOp() != EOpNull); } -// Verify all the correct semantics for constructing a combined texture/sampler. -// Return true if the semantics are incorrect. -bool HlslParseContext::constructorTextureSamplerError(const TSourceLoc& loc, const TFunction& function) -{ - TString constructorName = function.getType().getBasicTypeString(); // TODO: performance: should not be making copy; interface needs to change - const char* token = constructorName.c_str(); - - // exactly two arguments needed - if (function.getParamCount() != 2) { - error(loc, "sampler-constructor requires two arguments", token, ""); - return true; - } - - // For now, not allowing arrayed constructors, the rest of this function - // is set up to allow them, if this test is removed: - if (function.getType().isArray()) { - error(loc, "sampler-constructor cannot make an array of samplers", token, ""); - return true; - } - - // first argument - // * the constructor's first argument must be a texture type - // * the dimensionality (1D, 2D, 3D, Cube, Rect, Buffer, MS, and Array) - // of the texture type must match that of the constructed sampler type - // (that is, the suffixes of the type of the first argument and the - // type of the constructor will be spelled the same way) - if (function[0].type->getBasicType() != EbtSampler || - ! function[0].type->getSampler().isTexture() || - function[0].type->isArray()) { - error(loc, "sampler-constructor first argument must be a scalar textureXXX type", token, ""); - return true; - } - // simulate the first argument's impact on the result type, so it can be compared with the encapsulated operator!=() - TSampler texture = function.getType().getSampler(); - texture.combined = false; - texture.shadow = false; - if (texture != function[0].type->getSampler()) { - error(loc, "sampler-constructor first argument must match type and dimensionality of constructor type", token, ""); - return true; - } - - // second argument - // * the constructor's second argument must be a scalar of type - // *sampler* or *samplerShadow* - // * the presence or absence of depth comparison (Shadow) must match - // between the constructed sampler type and the type of the second argument - if (function[1].type->getBasicType() != EbtSampler || - ! function[1].type->getSampler().isPureSampler() || - function[1].type->isArray()) { - error(loc, "sampler-constructor second argument must be a scalar type 'sampler'", token, ""); - return true; - } - if (function.getType().getSampler().shadow != function[1].type->getSampler().shadow) { - error(loc, "sampler-constructor second argument presence of shadow must match constructor presence of shadow", - token, ""); - return true; - } - - return false; -} - // Checks to see if a void variable has been declared and raise an error message for such a case // // returns true in case of an error @@ -7847,6 +7812,8 @@ TVariable* HlslParseContext::declareNonArray(const TSourceLoc& loc, const TStrin // Returning nullptr just means there is no code to execute to handle the // initializer, which will, for example, be the case for constant initializers. // +// Returns a subtree that accomplished the initialization. +// TIntermNode* HlslParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyped* initializer, TVariable* variable) { // @@ -8116,6 +8083,10 @@ TIntermTyped* HlslParseContext::handleConstructor(const TSourceLoc& loc, TInterm if (node == nullptr) return nullptr; + // Construct identical type + if (type == node->getType()) + return node; + // Handle the idiom "(struct type)" if (type.isStruct() && isScalarConstructor(node)) { // 'node' will almost always get used multiple times, so should not be used directly, @@ -8150,8 +8121,6 @@ TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyp TIntermAggregate* aggrNode = node->getAsAggregate(); TOperator op = intermediate.mapTypeToConstructorOp(type); - // Combined texture-sampler constructors are completely semantic checked - // in constructorTextureSamplerError() if (op == EOpConstructTextureSampler) return intermediate.setAggregateOperator(aggrNode, op, type, loc); @@ -8595,7 +8564,7 @@ void HlslParseContext::declareBlock(const TSourceLoc& loc, TType& type, const TS // Process the members fixBlockLocations(loc, type.getQualifier(), typeList, memberWithLocation, memberWithoutLocation); - fixBlockXfbOffsets(type.getQualifier(), typeList); + fixXfbOffsets(type.getQualifier(), typeList); fixBlockUniformOffsets(type.getQualifier(), typeList); // reverse merge, so that currentBlockQualifier now has all layout information @@ -8678,7 +8647,7 @@ void HlslParseContext::fixBlockLocations(const TSourceLoc& loc, TQualifier& qual } } -void HlslParseContext::fixBlockXfbOffsets(TQualifier& qualifier, TTypeList& typeList) +void HlslParseContext::fixXfbOffsets(TQualifier& qualifier, TTypeList& typeList) { // "If a block is qualified with xfb_offset, all its // members are assigned transform feedback buffer offsets. If a block is not qualified with xfb_offset, any @@ -9342,11 +9311,17 @@ void HlslParseContext::correctOutput(TQualifier& qualifier) qualifier.patch = false; switch (qualifier.builtIn) { + case EbvFragDepth: + intermediate.setDepthReplacing(); + intermediate.setDepth(EldAny); + break; case EbvFragDepthGreater: + intermediate.setDepthReplacing(); intermediate.setDepth(EldGreater); qualifier.builtIn = EbvFragDepth; break; case EbvFragDepthLesser: + intermediate.setDepthReplacing(); intermediate.setDepth(EldLess); qualifier.builtIn = EbvFragDepth; break; @@ -9912,6 +9887,31 @@ void HlslParseContext::fixTextureShadowModes() } } +// Finalization step: patch append methods to use proper stream output, which isn't known until +// main is parsed, which could happen after the append method is parsed. +void HlslParseContext::finalizeAppendMethods() +{ + TSourceLoc loc; + loc.init(); + + // Nothing to do: bypass test for valid stream output. + if (gsAppends.empty()) + return; + + if (gsStreamOutput == nullptr) { + error(loc, "unable to find output symbol for Append()", "", ""); + return; + } + + // Patch append sequences, now that we know the stream output symbol. + for (auto append = gsAppends.begin(); append != gsAppends.end(); ++append) { + append->node->getSequence()[0] = + handleAssign(append->loc, EOpAssign, + intermediate.addSymbol(*gsStreamOutput, append->loc), + append->node->getSequence()[0]->getAsTyped()); + } +} + // post-processing void HlslParseContext::finish() { @@ -9924,6 +9924,7 @@ void HlslParseContext::finish() removeUnusedStructBufferCounters(); addPatchConstantInvocation(); fixTextureShadowModes(); + finalizeAppendMethods(); // Communicate out (esp. for command line) that we formed AST that will make // illegal AST SPIR-V and it needs transforms to legalize it. diff --git a/deps/glslang/hlsl/hlslParseHelper.h b/deps/glslang/hlsl/hlslParseHelper.h index b16a8c2c..f99d5c73 100644 --- a/deps/glslang/hlsl/hlslParseHelper.h +++ b/deps/glslang/hlsl/hlslParseHelper.h @@ -122,7 +122,6 @@ class HlslParseContext : public TParseContextBase { void integerCheck(const TIntermTyped* node, const char* token); void globalCheck(const TSourceLoc&, const char* token); bool constructorError(const TSourceLoc&, TIntermNode*, TFunction&, TOperator, TType&); - bool constructorTextureSamplerError(const TSourceLoc&, const TFunction&); void arraySizeCheck(const TSourceLoc&, TIntermTyped* expr, TArraySize&); void arraySizeRequiredCheck(const TSourceLoc&, const TArraySizes&); void structArrayCheck(const TSourceLoc&, const TType& structure); @@ -156,7 +155,7 @@ class HlslParseContext : public TParseContextBase { void declareBlock(const TSourceLoc&, TType&, const TString* instanceName = 0); void declareStructBufferCounter(const TSourceLoc& loc, const TType& bufferType, const TString& name); void fixBlockLocations(const TSourceLoc&, TQualifier&, TTypeList&, bool memberWithLocation, bool memberWithoutLocation); - void fixBlockXfbOffsets(TQualifier&, TTypeList&); + void fixXfbOffsets(TQualifier&, TTypeList&); void fixBlockUniformOffsets(const TQualifier&, TTypeList&); void addQualifierToExisting(const TSourceLoc&, TQualifier, const TString& identifier); void addQualifierToExisting(const TSourceLoc&, TQualifier, TIdentifierList&); @@ -266,6 +265,7 @@ class HlslParseContext : public TParseContextBase { TVariable* getSplitNonIoVar(int id) const; void addPatchConstantInvocation(); void fixTextureShadowModes(); + void finalizeAppendMethods(); TIntermTyped* makeIntegerIndex(TIntermTyped*); void fixBuiltInIoType(TType&); @@ -460,6 +460,17 @@ class HlslParseContext : public TParseContextBase { TVector mipsOperatorMipArg; + // The geometry output stream is not copied out from the entry point as a typical output variable + // is. It's written via EmitVertex (hlsl=Append), which may happen in arbitrary control flow. + // For this we need the real output symbol. Since it may not be known at the time and Append() + // method is parsed, the sequence will be patched during finalization. + struct tGsAppendData { + TIntermAggregate* node; + TSourceLoc loc; + }; + + TVector gsAppends; + // A texture object may be used with shadow and non-shadow samplers, but both may not be // alive post-DCE in the same shader. We do not know at compilation time which are alive: that's // only known post-DCE. If a texture is used both ways, we create two textures, and diff --git a/deps/glslang/hlsl/hlslParseables.cpp b/deps/glslang/hlsl/hlslParseables.cpp index cc847ae2..65000912 100644 --- a/deps/glslang/hlsl/hlslParseables.cpp +++ b/deps/glslang/hlsl/hlslParseables.cpp @@ -605,7 +605,7 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c { "determinant", "S", "F", "M", "F", EShLangAll, false }, { "DeviceMemoryBarrier", nullptr, nullptr, "-", "-", EShLangPSCS, false }, { "DeviceMemoryBarrierWithGroupSync", nullptr, nullptr, "-", "-", EShLangCS, false }, - { "distance", "S", "F", "V,", "F,", EShLangAll, false }, + { "distance", "S", "F", "SV,", "F,", EShLangAll, false }, { "dot", "S", nullptr, "SV,", "FI,", EShLangAll, false }, { "dst", nullptr, nullptr, "V4,", "F,", EShLangAll, false }, // { "errorf", "-", "-", "", "", EShLangAll, false }, TODO: varargs diff --git a/deps/glslang/hlsl/pch.cpp b/deps/glslang/hlsl/pch.cpp new file mode 100644 index 00000000..b7a08654 --- /dev/null +++ b/deps/glslang/hlsl/pch.cpp @@ -0,0 +1,35 @@ +// +// Copyright (C) 2018 The Khronos Group Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "pch.h" diff --git a/deps/glslang/hlsl/pch.h b/deps/glslang/hlsl/pch.h new file mode 100644 index 00000000..e0bc4917 --- /dev/null +++ b/deps/glslang/hlsl/pch.h @@ -0,0 +1,54 @@ +#ifndef _PCH_H +#define _PCH_H +// +// Copyright (C) 2018 The Khronos Group Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "hlslParseHelper.h" +#include "hlslScanContext.h" +#include "hlslGrammar.h" +#include "hlslAttributes.h" + +#include "../glslang/MachineIndependent/Scan.h" +#include "../glslang/MachineIndependent/preprocessor/PpContext.h" + +#include "../glslang/OSDependent/osinclude.h" + +#include +#include +#include +#include +#include + + +#endif /* _PCH_H */ diff --git a/deps/glslang/known_good.json b/deps/glslang/known_good.json new file mode 100644 index 00000000..0bfa88a7 --- /dev/null +++ b/deps/glslang/known_good.json @@ -0,0 +1,18 @@ +{ + "commits" : [ + { + "name" : "spirv-tools", + "site" : "github", + "subrepo" : "KhronosGroup/SPIRV-Tools", + "subdir" : "External/spirv-tools", + "commit" : "a29a9947ac96d811b310f481b24e293f67fedf32" + }, + { + "name" : "spirv-tools/external/spirv-headers", + "site" : "github", + "subrepo" : "KhronosGroup/SPIRV-Headers", + "subdir" : "External/spirv-tools/external/spirv-headers", + "commit" : "a2c529b5dda18838ab4b52f816acfebd774eaab3" + } + ] +} diff --git a/deps/glslang/known_good_khr.json b/deps/glslang/known_good_khr.json new file mode 100644 index 00000000..a64198a8 --- /dev/null +++ b/deps/glslang/known_good_khr.json @@ -0,0 +1,18 @@ +{ + "commits" : [ + { + "name" : "spirv-tools", + "site" : "gitlab", + "subrepo" : "spirv/spirv-tools", + "subdir" : "External/spirv-tools", + "commit" : "d4e2c2eaa6fd2e9f9cd218ea9add9b0c8ae759ba" + }, + { + "name" : "spirv-tools/external/spirv-headers", + "site" : "gitlab", + "subrepo" : "spirv/SPIRV-Headers", + "subdir" : "External/spirv-tools/external/spirv-headers", + "commit" : "gitlab-prelim-rc4" + } + ] +} diff --git a/deps/glslang/make-revision b/deps/glslang/make-revision index bf6533f8..a89ff087 100644 --- a/deps/glslang/make-revision +++ b/deps/glslang/make-revision @@ -1,10 +1,6 @@ -#!/bin/sh -( -echo "// This header is generated by the make-revision script." -echo "// For the version, it uses the latest git tag followed by the number of commits." -echo "// For the date, it uses the current date (when then script is run)." - -echo -echo \#define GLSLANG_REVISION \"`git describe --tags --abbrev=0`.`git log --oneline | wc -l`\" -echo \#define GLSLANG_DATE \"`date +%d-%b-%Y`\" -) > glslang/Include/revision.h +#!/bin/sh +( +echo "// This header is generated by the make-revision script." +echo +echo \#define GLSLANG_PATCH_LEVEL `git log --oneline | wc -l` +) > glslang/Include/revision.h diff --git a/deps/glslang/update_glslang_sources.py b/deps/glslang/update_glslang_sources.py new file mode 100644 index 00000000..65be2f6a --- /dev/null +++ b/deps/glslang/update_glslang_sources.py @@ -0,0 +1,155 @@ +#!/usr/bin/env python + +# Copyright 2017 The Glslang Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Get source files for Glslang and its dependencies from public repositories. +""" + +from __future__ import print_function + +import argparse +import json +import distutils.dir_util +import os.path +import subprocess +import sys + +KNOWN_GOOD_FILE = 'known_good.json' + +SITE_TO_KNOWN_GOOD_FILE = { 'github' : 'known_good.json', + 'gitlab' : 'known_good_khr.json' } + +# Maps a site name to its hostname. +SITE_TO_HOST = { 'github' : 'https://github.com/', + 'gitlab' : 'git@gitlab.khronos.org:' } + +VERBOSE = True + + +def command_output(cmd, directory, fail_ok=False): + """Runs a command in a directory and returns its standard output stream. + + Captures the standard error stream. + + Raises a RuntimeError if the command fails to launch or otherwise fails. + """ + if VERBOSE: + print('In {d}: {cmd}'.format(d=directory, cmd=cmd)) + p = subprocess.Popen(cmd, + cwd=directory, + stdout=subprocess.PIPE) + (stdout, _) = p.communicate() + if p.returncode != 0 and not fail_ok: + raise RuntimeError('Failed to run {} in {}'.format(cmd, directory)) + if VERBOSE: + print(stdout) + return stdout + + +def command_retval(cmd, directory): + """Runs a command in a directory and returns its return value. + + Captures the standard error stream. + """ + p = subprocess.Popen(cmd, + cwd=directory, + stdout=subprocess.PIPE) + p.communicate() + return p.returncode + + +class GoodCommit(object): + """Represents a good commit for a repository.""" + + def __init__(self, json): + """Initializes this good commit object. + + Args: + 'json': A fully populated JSON object describing the commit. + """ + self._json = json + self.name = json['name'] + self.site = json['site'] + self.subrepo = json['subrepo'] + self.subdir = json['subdir'] if ('subdir' in json) else '.' + self.commit = json['commit'] + + def GetUrl(self): + """Returns the URL for the repository.""" + host = SITE_TO_HOST[self.site] + return '{host}{subrepo}'.format( + host=host, + subrepo=self.subrepo) + + def AddRemote(self): + """Add the remote 'known-good' if it does not exist.""" + remotes = command_output(['git', 'remote'], self.subdir).splitlines() + if b'known-good' not in remotes: + command_output(['git', 'remote', 'add', 'known-good', self.GetUrl()], self.subdir) + + def HasCommit(self): + """Check if the repository contains the known-good commit.""" + return 0 == subprocess.call(['git', 'rev-parse', '--verify', '--quiet', + self.commit + "^{commit}"], + cwd=self.subdir) + + def Clone(self): + distutils.dir_util.mkpath(self.subdir) + command_output(['git', 'clone', self.GetUrl(), '.'], self.subdir) + + def Fetch(self): + command_output(['git', 'fetch', 'known-good'], self.subdir) + + def Checkout(self): + if not os.path.exists(os.path.join(self.subdir,'.git')): + self.Clone() + self.AddRemote() + if not self.HasCommit(): + self.Fetch() + command_output(['git', 'checkout', self.commit], self.subdir) + + +def GetGoodCommits(site): + """Returns the latest list of GoodCommit objects.""" + known_good_file = SITE_TO_KNOWN_GOOD_FILE[site] + with open(known_good_file) as known_good: + return [GoodCommit(c) for c in json.loads(known_good.read())['commits']] + + +def main(): + parser = argparse.ArgumentParser(description='Get Glslang source dependencies at a known-good commit') + parser.add_argument('--dir', dest='dir', default='.', + help="Set target directory for Glslang source root. Default is \'.\'.") + parser.add_argument('--site', dest='site', default='github', + help="Set git server site. Default is github.") + + args = parser.parse_args() + + commits = GetGoodCommits(args.site) + + distutils.dir_util.mkpath(args.dir) + print('Change directory to {d}'.format(d=args.dir)) + os.chdir(args.dir) + + # Create the subdirectories in sorted order so that parent git repositories + # are created first. + for c in sorted(commits, key=lambda x: x.subdir): + print('Get {n}\n'.format(n=c.name)) + c.Checkout() + sys.exit(0) + + +if __name__ == '__main__': + main() diff --git a/examples/DynamicBuffers/include/app.h b/examples/DynamicBuffers/include/app.h index 53ce2370..424a1e75 100644 --- a/examples/DynamicBuffers/include/app.h +++ b/examples/DynamicBuffers/include/app.h @@ -54,11 +54,9 @@ class App void init_window (); void init_vulkan (); - void draw_frame (); - VkBool32 on_validation_callback(VkDebugReportFlagsEXT message_flags, - VkDebugReportObjectTypeEXT object_type, - const char* layer_prefix, - const char* message); + void draw_frame (); + void on_validation_callback(Anvil::DebugMessageSeverityFlags in_severity, + const char* in_message_ptr); void get_buffer_memory_offsets(uint32_t n_sine_pair, uint32_t* out_opt_sine1SB_offset_ptr, diff --git a/examples/DynamicBuffers/src/app.cpp b/examples/DynamicBuffers/src/app.cpp index 564ef79b..dd77c556 100644 --- a/examples/DynamicBuffers/src/app.cpp +++ b/examples/DynamicBuffers/src/app.cpp @@ -1233,9 +1233,7 @@ void App::init_vulkan() std::bind(&App::on_validation_callback, this, std::placeholders::_1, - std::placeholders::_2, - std::placeholders::_3, - std::placeholders::_4), + std::placeholders::_2), #else Anvil::DebugCallbackFunction(), #endif @@ -1252,19 +1250,15 @@ void App::init_vulkan() false); /* in_support_resettable_command_buffers */ } -VkBool32 App::on_validation_callback(VkDebugReportFlagsEXT message_flags, - VkDebugReportObjectTypeEXT object_type, - const char* layer_prefix, - const char* message) +void App::on_validation_callback(Anvil::DebugMessageSeverityFlags in_severity, + const char* in_message_ptr) { - if ((message_flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) != 0) + if ((in_severity & Anvil::DebugMessageSeverityFlagBits::ERROR_BIT) != 0) { fprintf(stderr, "[!] %s\n", - message); + in_message_ptr); } - - return false; } void App::run() diff --git a/examples/MultiViewport/include/app.h b/examples/MultiViewport/include/app.h index b57424b7..fa15ed7c 100644 --- a/examples/MultiViewport/include/app.h +++ b/examples/MultiViewport/include/app.h @@ -64,11 +64,9 @@ class App void get_scissor_viewport_info(VkRect2D* out_scissors, VkViewport* out_viewports); - void draw_frame (); - VkBool32 on_validation_callback(VkDebugReportFlagsEXT message_flags, - VkDebugReportObjectTypeEXT object_type, - const char* layer_prefix, - const char* message); + void draw_frame (); + void on_validation_callback(Anvil::DebugMessageSeverityFlags in_severity, + const char* in_message_ptr); /* Private variables */ Anvil::BaseDeviceUniquePtr m_device_ptr; diff --git a/examples/MultiViewport/src/app.cpp b/examples/MultiViewport/src/app.cpp index 0968fba2..567b77a6 100644 --- a/examples/MultiViewport/src/app.cpp +++ b/examples/MultiViewport/src/app.cpp @@ -914,9 +914,7 @@ void App::init_vulkan() std::bind(&App::on_validation_callback, this, std::placeholders::_1, - std::placeholders::_2, - std::placeholders::_3, - std::placeholders::_4), + std::placeholders::_2), #else Anvil::DebugCallbackFunction(), #endif @@ -933,19 +931,15 @@ void App::init_vulkan() false); /* in_support_resettable_command_buffers */ } -VkBool32 App::on_validation_callback(VkDebugReportFlagsEXT message_flags, - VkDebugReportObjectTypeEXT object_type, - const char* layer_prefix, - const char* message) +void App::on_validation_callback(Anvil::DebugMessageSeverityFlags in_severity, + const char* in_message_ptr) { - if ((message_flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) != 0) + if ((in_severity & Anvil::DebugMessageSeverityFlagBits::ERROR_BIT) != 0) { fprintf(stderr, "[!] %s\n", - message); + in_message_ptr); } - - return false; } void App::run() diff --git a/examples/OcclusionQuery/include/app.h b/examples/OcclusionQuery/include/app.h index 25b034d8..ed96527f 100644 --- a/examples/OcclusionQuery/include/app.h +++ b/examples/OcclusionQuery/include/app.h @@ -54,11 +54,9 @@ class App void init_window (); void init_vulkan (); - void draw_frame (); - VkBool32 on_validation_callback(VkDebugReportFlagsEXT message_flags, - VkDebugReportObjectTypeEXT object_type, - const char* layer_prefix, - const char* message); + void draw_frame (); + void on_validation_callback(Anvil::DebugMessageSeverityFlags in_severity, + const char* in_message_ptr); /* Private variables */ Anvil::BaseDeviceUniquePtr m_device_ptr; diff --git a/examples/OcclusionQuery/src/app.cpp b/examples/OcclusionQuery/src/app.cpp index 0b20e9b6..0888201f 100644 --- a/examples/OcclusionQuery/src/app.cpp +++ b/examples/OcclusionQuery/src/app.cpp @@ -1070,9 +1070,7 @@ void App::init_vulkan() std::bind(&App::on_validation_callback, this, std::placeholders::_1, - std::placeholders::_2, - std::placeholders::_3, - std::placeholders::_4), + std::placeholders::_2), #else Anvil::DebugCallbackFunction(), #endif @@ -1089,19 +1087,15 @@ void App::init_vulkan() false); /* in_support_resettable_command_buffers */ } -VkBool32 App::on_validation_callback(VkDebugReportFlagsEXT message_flags, - VkDebugReportObjectTypeEXT object_type, - const char* layer_prefix, - const char* message) +void App::on_validation_callback(Anvil::DebugMessageSeverityFlags in_severity, + const char* in_message_ptr) { - if ((message_flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) != 0) + if ((in_severity & Anvil::DebugMessageSeverityFlagBits::ERROR_BIT) != 0) { fprintf(stderr, "[!] %s\n", - message); + in_message_ptr); } - - return false; } void App::run() diff --git a/examples/OutOfOrderRasterization/include/app.h b/examples/OutOfOrderRasterization/include/app.h index 90507ad8..2f178c20 100644 --- a/examples/OutOfOrderRasterization/include/app.h +++ b/examples/OutOfOrderRasterization/include/app.h @@ -59,12 +59,10 @@ class App void update_fps (); void update_teapot_props(uint32_t n_current_swapchain_image); - void draw_frame (); - void on_keypress_event (Anvil::CallbackArgument* in_callback_data_raw_ptr); - VkBool32 on_validation_callback(VkDebugReportFlagsEXT message_flags, - VkDebugReportObjectTypeEXT object_type, - const char* layer_prefix, - const char* message); + void draw_frame (); + void on_keypress_event (Anvil::CallbackArgument* in_callback_data_raw_ptr); + void on_validation_callback(Anvil::DebugMessageSeverityFlags in_severity, + const char* in_message_ptr); /* Private variables */ Anvil::BaseDeviceUniquePtr m_device_ptr; diff --git a/examples/OutOfOrderRasterization/src/app.cpp b/examples/OutOfOrderRasterization/src/app.cpp index 6b7075fa..90649e28 100644 --- a/examples/OutOfOrderRasterization/src/app.cpp +++ b/examples/OutOfOrderRasterization/src/app.cpp @@ -1150,9 +1150,7 @@ void App::init_vulkan() std::bind(&App::on_validation_callback, this, std::placeholders::_1, - std::placeholders::_2, - std::placeholders::_3, - std::placeholders::_4), + std::placeholders::_2), #else Anvil::DebugCallbackFunction(), #endif @@ -1206,19 +1204,15 @@ void App::on_keypress_event(Anvil::CallbackArgument* callback_data_raw_ptr) #endif } -VkBool32 App::on_validation_callback(VkDebugReportFlagsEXT message_flags, - VkDebugReportObjectTypeEXT object_type, - const char* layer_prefix, - const char* message) +void App::on_validation_callback(Anvil::DebugMessageSeverityFlags in_severity, + const char* in_message_ptr) { - if ((message_flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) != 0) + if ((in_severity & Anvil::DebugMessageSeverityFlagBits::ERROR_BIT) != 0) { fprintf(stderr, "[!] %s\n", - message); + in_message_ptr); } - - return false; } void App::run() diff --git a/examples/PushConstants/include/app.h b/examples/PushConstants/include/app.h index d06d7932..a1714c76 100644 --- a/examples/PushConstants/include/app.h +++ b/examples/PushConstants/include/app.h @@ -53,11 +53,9 @@ class App void init_window (); void init_vulkan (); - void draw_frame (); - VkBool32 on_validation_callback(VkDebugReportFlagsEXT in_message_flags, - VkDebugReportObjectTypeEXT in_object_type, - const char* in_layer_prefix, - const char* in_message); + void draw_frame (); + void on_validation_callback(Anvil::DebugMessageSeverityFlags in_severity, + const char* in_message_ptr); void get_luminance_data(std::unique_ptr* out_result_ptr, uint32_t* out_result_size_ptr) const; diff --git a/examples/PushConstants/src/app.cpp b/examples/PushConstants/src/app.cpp index 8b7ca278..2e044665 100644 --- a/examples/PushConstants/src/app.cpp +++ b/examples/PushConstants/src/app.cpp @@ -878,9 +878,7 @@ void App::init_vulkan() std::bind(&App::on_validation_callback, this, std::placeholders::_1, - std::placeholders::_2, - std::placeholders::_3, - std::placeholders::_4), + std::placeholders::_2), #else Anvil::DebugCallbackFunction(), #endif @@ -897,19 +895,15 @@ void App::init_vulkan() false); /* in_support_resettable_command_buffers */ } -VkBool32 App::on_validation_callback(VkDebugReportFlagsEXT in_message_flags, - VkDebugReportObjectTypeEXT in_object_type, - const char* in_layer_prefix, - const char* in_message) +void App::on_validation_callback(Anvil::DebugMessageSeverityFlags in_severity, + const char* in_message_ptr) { - if ((in_message_flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) != 0) + if ((in_severity & Anvil::DebugMessageSeverityFlagBits::ERROR_BIT) != 0) { fprintf(stderr, "[!] %s\n", - in_message); + in_message_ptr); } - - return false; } void App::run() diff --git a/include/misc/debug_marker.h b/include/misc/debug_marker.h index 221d0973..d752c363 100644 --- a/include/misc/debug_marker.h +++ b/include/misc/debug_marker.h @@ -20,7 +20,7 @@ // THE SOFTWARE. // -/* Provides support for functionality introduced by VK_EXT_debug_marker extension. */ +/* Provides support for functionality introduced by VK_EXT_debug_marker extension, later subsumed by VK_EXT_debug_utils. */ #ifndef MISC_DEBUG_MARKER_H #define MISC_DEBUG_MARKER_H @@ -38,8 +38,8 @@ namespace Anvil /* Public functions */ /** Constructor. */ - DebugMarkerSupportProviderWorker(const Anvil::BaseDevice* in_device_ptr, - VkDebugReportObjectTypeEXT in_vk_object_type); + DebugMarkerSupportProviderWorker(const Anvil::BaseDevice* in_device_ptr, + const Anvil::ObjectType& in_vk_object_type); /** Destructor. */ ~DebugMarkerSupportProviderWorker() @@ -108,14 +108,24 @@ namespace Anvil void set_vk_handle_internal(uint64_t in_vk_object_handle); private: + /* Private type definitions */ + enum class DebugAPI + { + EXT_DEBUG_MARKER, + EXT_DEBUG_UTILS, + + NONE + }; + /* Private variables */ const Anvil::BaseDevice* m_device_ptr; - bool m_is_ext_debug_marker_available; + std::mutex m_mutex; std::string m_object_name; std::vector m_object_tag_data; uint64_t m_object_tag_name; + DebugAPI m_used_api; uint64_t m_vk_object_handle; - VkDebugReportObjectTypeEXT m_vk_object_type; + Anvil::ObjectType m_vk_object_type; }; /** This class needs to be inherited from by all wrapper classes that wrap Vulkan objects. @@ -150,9 +160,9 @@ namespace Anvil * True to permit more than one handle to be used. * **/ - DebugMarkerSupportProvider(const Anvil::BaseDevice* in_device_ptr, - VkDebugReportObjectTypeEXT in_vk_object_type, - bool in_use_delegate_workers = false) + DebugMarkerSupportProvider(const Anvil::BaseDevice* in_device_ptr, + const Anvil::ObjectType& in_object_type, + bool in_use_delegate_workers = false) { anvil_assert(in_device_ptr != nullptr); @@ -162,12 +172,12 @@ namespace Anvil { m_worker_ptr.reset( new DebugMarkerSupportProviderWorker(in_device_ptr, - in_vk_object_type) + in_object_type) ); } else { - m_vk_object_type = in_vk_object_type; + m_vk_object_type = in_object_type; } } @@ -404,7 +414,7 @@ namespace Anvil /* Only used if delegate workers have been requested at creation time: ==> */ std::vector > m_delegate_workers; const Anvil::BaseDevice* m_device_ptr; - VkDebugReportObjectTypeEXT m_vk_object_type; + Anvil::ObjectType m_vk_object_type; /* <== */ diff --git a/include/misc/debug_messenger_create_info.h b/include/misc/debug_messenger_create_info.h new file mode 100644 index 00000000..84de5a1c --- /dev/null +++ b/include/misc/debug_messenger_create_info.h @@ -0,0 +1,94 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#ifndef MISC_DEBUG_MESSENGER_CREATE_INFO_H +#define MISC_DEBUG_MESSENGER_CREATE_INFO_H + +#include "misc/types.h" + +namespace Anvil +{ + class DebugMessengerCreateInfo + { + public: + /* Public functions */ + + /** Destructor. */ + ~DebugMessengerCreateInfo() + { + /* Stub */ + } + + /* Instantiates a create info structure for debug messengers. + * + * @param in_instance_ptr Vulkan instance to use when creating the Debug Messenger object. Must not be nullptr. + * @param in_debug_message_severity_flags Severity of debug messages to use for callbacks. + * @param in_debug_message_type_flags Types of debug messages to use for callbacks. + * @param in_callback_function Callback function to use. Must not be nullptr. + * + * @result Create info structure ijnstance. + */ + static DebugMessengerCreateInfoUniquePtr create(Anvil::Instance* in_instance_ptr, + const Anvil::DebugMessageSeverityFlags& in_debug_message_severity_flags, + const Anvil::DebugMessageTypeFlags& in_debug_message_type_flags, + Anvil::DebugMessengerCallbackFunction in_callback_function); + + const Anvil::DebugMessengerCallbackFunction& get_callback_function() const + { + return m_callback_function; + } + + const Anvil::DebugMessageSeverityFlags& get_debug_message_severity() const + { + return m_debug_message_severity_flags; + } + + const Anvil::DebugMessageTypeFlags& get_debug_message_types() const + { + return m_debug_message_type_flags; + } + + Anvil::Instance* get_instance_ptr() const + { + return m_instance_ptr; + } + + private: + /* Please see create() documentation for more details */ + + DebugMessengerCreateInfo(Anvil::Instance* in_instance_ptr, + const Anvil::DebugMessageSeverityFlags& in_debug_message_severity_flags, + const Anvil::DebugMessageTypeFlags& in_debug_message_type_flags, + Anvil::DebugMessengerCallbackFunction in_callback_function); + + /* Private variables */ + + Anvil::DebugMessengerCallbackFunction m_callback_function; + Anvil::DebugMessageSeverityFlags m_debug_message_severity_flags; + Anvil::DebugMessageTypeFlags m_debug_message_type_flags; + Anvil::Instance* m_instance_ptr; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(DebugMessengerCreateInfo); + }; +}; /* namespace Anvil */ + +#endif /* MISC_DEBUG_MESSENGER_CREATE_INFO_H */ \ No newline at end of file diff --git a/include/misc/extensions.h b/include/misc/extensions.h index a2c12c20..90e8a0d6 100644 --- a/include/misc/extensions.h +++ b/include/misc/extensions.h @@ -61,6 +61,7 @@ namespace Anvil ValueType ext_shader_subgroup_vote; ValueType ext_shader_viewport_index_layer; ValueType ext_swapchain_colorspace; + ValueType ext_transform_feedback; ValueType ext_vertex_attribute_divisor; ValueType khr_16bit_storage; ValueType khr_8bit_storage; @@ -147,6 +148,7 @@ namespace Anvil {ExtensionData(VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME, &ext_shader_subgroup_vote)}, {ExtensionData(VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME, &ext_shader_viewport_index_layer)}, {ExtensionData(VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME, &ext_swapchain_colorspace)}, + {ExtensionData(VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, &ext_transform_feedback)}, {ExtensionData(VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, &ext_vertex_attribute_divisor)}, {ExtensionData(VK_KHR_16BIT_STORAGE_EXTENSION_NAME, &khr_16bit_storage)}, {ExtensionData(VK_KHR_8BIT_STORAGE_EXTENSION_NAME, &khr_8bit_storage)}, @@ -204,6 +206,8 @@ namespace Anvil template struct InstanceExtensions { + ValueType ext_debug_report; + ValueType ext_debug_utils; ValueType khr_device_group_creation; ValueType khr_external_fence_capabilities; ValueType khr_external_memory_capabilities; @@ -243,6 +247,8 @@ namespace Anvil std::vector recognized_extensions = { + {ExtensionData(VK_EXT_DEBUG_REPORT_EXTENSION_NAME, &ext_debug_report)}, + {ExtensionData(VK_EXT_DEBUG_UTILS_EXTENSION_NAME, &ext_debug_utils)}, {ExtensionData(VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME, &khr_device_group_creation)}, {ExtensionData(VK_KHR_EXTERNAL_FENCE_CAPABILITIES_EXTENSION_NAME, &khr_external_fence_capabilities)}, {ExtensionData(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME, &khr_external_memory_capabilities)}, @@ -319,6 +325,7 @@ namespace Anvil virtual ValueType ext_shader_subgroup_vote () const = 0; virtual ValueType ext_shader_viewport_index_layer () const = 0; virtual ValueType ext_swapchain_colorspace () const = 0; + virtual ValueType ext_transform_feedback () const = 0; virtual ValueType ext_vertex_attribute_divisor () const = 0; virtual ValueType khr_16bit_storage () const = 0; virtual ValueType khr_8bit_storage () const = 0; @@ -365,6 +372,8 @@ namespace Anvil /* Stub */ } + virtual bool ext_debug_report () const = 0; + virtual bool ext_debug_utils () const = 0; virtual bool khr_device_group_creation () const = 0; virtual bool khr_external_fence_capabilities () const = 0; virtual bool khr_external_memory_capabilities () const = 0; @@ -682,6 +691,13 @@ namespace Anvil return m_device_extensions_ptr->ext_swapchain_colorspace; } + ValueType ext_transform_feedback() const + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_transform_feedback; + } + ValueType khr_16bit_storage() const final { anvil_assert(m_expose_device_extensions); @@ -886,6 +902,20 @@ namespace Anvil /* IExtensionInfoInstance */ + ValueType ext_debug_report() const final + { + anvil_assert(!m_expose_device_extensions); + + return m_instance_extensions_ptr->ext_debug_report; + } + + ValueType ext_debug_utils() const final + { + anvil_assert(!m_expose_device_extensions); + + return m_instance_extensions_ptr->ext_debug_utils; + } + ValueType khr_device_group_creation() const final { anvil_assert(!m_expose_device_extensions); diff --git a/include/misc/graphics_pipeline_create_info.h b/include/misc/graphics_pipeline_create_info.h index 7ef08ecb..c3944df2 100644 --- a/include/misc/graphics_pipeline_create_info.h +++ b/include/misc/graphics_pipeline_create_info.h @@ -27,6 +27,52 @@ namespace Anvil { + /* By default, graphics pipeline create info uses the following settings: + * + * All rendering modes & tests: disabled + * Blend constant: vec4(0.0) + * Cull mode: VK_CULL_MODE_BACK + * Depth bias: 0.0 + * Depth bias clamp: 0.0 + * Depth bias slope factor: 1.0 + * Depth test compare op: Anvil::CompareOp::ALWAYS + * Depth writes: disabled + * Dynamic states: all disabled + * Fill mode: VK_FILL_MODE_SOLID + * Front face: VK_FRONT_FACE_CCW + * Line width: 1.0 + * Logic op: VK_LOGIC_OP_NOOP; + * Max depth boundary: 1.0 + * Min depth boundary: 0.0 + * Min sample shading: 1.0 + * Number of raster samples: 1 + * Number of tessellation patches: 1 + * Primitive topology: VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST + * Sample mask: 0xFFFFFFFF + * Slope scaled depth bias: 0.0 + * Stencil comparison mask (back/front): 0xFFFFFFFF + * Stencil comparison op (back/front): Anvil::CompareOp::ALWAYS + * Stencil depth fail op (back/front): VK_STENCIL_OP_KEEP + * Stencil fail op (back/front): VK_STENCIL_OP_KEEP + * Stencil pass op (back/front): VK_STENCIL_OP_KEEP + * Stencil reference value (back/front): 0 + * Stencil write mask (back/front): 0xFFFFFFFF + * + * If no scissor or viewport is defined explicitly, one scissor box and one viewport, + * covering the whole screen, will be created at baking time. + * + * If VK_AMD_rasterization_order extension is supported: + * + * + Rasterization order: strict + * + * If VK_EXT_transform_feedback extension is supported: + * + * + Rasterization stream index: 0 + * + * If VK_KHR_maintenance2 extension is supported: + * + * + Tessellation domain origin: upper-left + */ class GraphicsPipelineCreateInfo : public BasePipelineCreateInfo { public: @@ -277,6 +323,12 @@ namespace Anvil Anvil::FrontFace* out_opt_front_face_ptr, float* out_opt_line_width_ptr) const; + /* Returns rasterization stream index associated with the create info structure. */ + const uint32_t& get_rasterization_stream_index() const + { + return m_rasterization_stream_index; + } + const RenderPass* get_renderpass() const { return m_renderpass_ptr; @@ -529,6 +581,15 @@ namespace Anvil **/ void set_rasterization_order(Anvil::RasterizationOrderAMD in_rasterization_order); + /** Configures rasterization stream index for the pipeline if VK_EXT_transform_feedback extension + * is supported by the device, for which the pipeline is going to be created. + * + * On drivers not supporting the extension, the setting will be ignored. + * + * @param in_rasterization_stream_index Index to use. + **/ + void set_rasterization_stream_index(const uint32_t& in_rasterization_stream_index); + /** Sets a number of rasterization properties to be used for the pipeline. * * @param in_polygon_mode Polygon mode to use. @@ -1003,6 +1064,7 @@ namespace Anvil uint32_t m_n_dynamic_viewports; uint32_t m_n_patch_control_points; Anvil::PrimitiveTopology m_primitive_topology; + uint32_t m_rasterization_stream_index; Anvil::SampleCountFlagBits m_sample_count; VkSampleMask m_sample_mask; InternalScissorBoxes m_scissor_boxes; diff --git a/include/misc/object_tracker.h b/include/misc/object_tracker.h index bb2ae66e..eff7aa47 100644 --- a/include/misc/object_tracker.h +++ b/include/misc/object_tracker.h @@ -37,6 +37,7 @@ #ifndef MISC_OBJECT_TRACKER_H #define MISC_OBJECT_TRACKER_H +#include #include #include "misc/callbacks.h" #include "misc/types.h" @@ -127,16 +128,16 @@ namespace Anvil void check_for_leaks() const; /** Retrieves an alive object of user-specified type at given index. */ - void* get_object_at_index(ObjectType in_object_type, - uint32_t in_alloc_index) const; + void* get_object_at_index(const ObjectType& in_object_type, + uint32_t in_alloc_index) const; /** Registers a new object of the specified type. * * @param in_object_type Wrapper object type. * @param in_object_ptr Object instance. The object is NOT retained. **/ - void register_object(ObjectType in_object_type, - void* in_object_ptr); + void register_object(const ObjectType& in_object_type, + void* in_object_ptr); /** Stops tracking the specified object. * @@ -147,8 +148,8 @@ namespace Anvil * been registered earlier with a register_object() call, or else an * assertion failure will occur. **/ - void unregister_object(ObjectType in_object_type, - void* in_object_ptr); + void unregister_object(const ObjectType& in_object_type, + void* in_object_ptr); private: /* Private type declarations */ @@ -192,12 +193,13 @@ namespace Anvil ObjectTracker (const ObjectTracker&); ObjectTracker& operator=(const ObjectTracker&); - const char* get_object_type_name(ObjectType in_object_type) const; + const char* get_object_type_name(const ObjectType& in_object_type) const; /* Private members */ mutable std::mutex m_cs; - ObjectAllocations m_object_allocations [OBJECT_TYPE_COUNT]; - uint32_t m_n_objects_allocated_array[OBJECT_TYPE_COUNT]; + + mutable std::map m_object_allocations; + std::map m_n_objects_allocated_array; }; }; /* namespace Anvil */ diff --git a/include/misc/types.h b/include/misc/types.h index c0d36daa..508eb673 100644 --- a/include/misc/types.h +++ b/include/misc/types.h @@ -116,6 +116,8 @@ namespace Anvil class CommandPool; class ComputePipelineCreateInfo; class ComputePipelineManager; + class DebugMessenger; + class DebugMessengerCreateInfo; class DescriptorPool; class DescriptorSet; class DescriptorSetCreateInfo; @@ -176,6 +178,8 @@ namespace Anvil typedef std::unique_ptr > CommandBufferBaseUniquePtr; typedef std::unique_ptr > CommandPoolUniquePtr; typedef std::unique_ptr ComputePipelineCreateInfoUniquePtr; + typedef std::unique_ptr DebugMessengerCreateInfoUniquePtr; + typedef std::unique_ptr > DebugMessengerUniquePtr; typedef std::unique_ptr > DescriptorPoolUniquePtr; typedef std::unique_ptr DescriptorSetCreateInfoUniquePtr; typedef std::unique_ptr > DescriptorSetGroupUniquePtr; diff --git a/include/misc/types_enums.h b/include/misc/types_enums.h index 04630f71..15d6bbc7 100644 --- a/include/misc/types_enums.h +++ b/include/misc/types_enums.h @@ -262,6 +262,11 @@ namespace Anvil UNIFORM_READ_BIT = VK_ACCESS_UNIFORM_READ_BIT, VERTEX_ATTRIBUTE_READ_BIT = VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT, + /* VK_EXT_transform_feedback */ + TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT = VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT, + TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT = VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT, + TRANSFORM_FEEDBACK_WRITE_BIT_EXT = VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT, + NONE = 0 }; typedef Anvil::Bitfield AccessFlags; @@ -387,6 +392,10 @@ namespace Anvil UNIFORM_TEXEL_BUFFER_BIT = VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT, VERTEX_BUFFER_BIT = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, + /* VK_EXT_transform_feedback */ + TRANSFORM_FEEDBACK_BUFFER_BIT_EXT = VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT, + TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT = VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT, + NONE = 0 }; typedef Anvil::Bitfield BufferUsageFlags; @@ -458,6 +467,33 @@ namespace Anvil INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(CompositeAlphaFlags, VkCompositeAlphaFlagsKHR, CompositeAlphaFlagBits) + /* Note: These map 1:1 to VK equivalents. */ + enum class DebugMessageSeverityFlagBits + { + ERROR_BIT = VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT, + INFO_BIT = VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT, + VERBOSE_BIT = VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT, + WARNING_BIT = VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT, + + NONE = 0 + }; + typedef Anvil::Bitfield DebugMessageSeverityFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(DebugMessageSeverityFlags, VkDebugUtilsMessageSeverityFlagsEXT, DebugMessageSeverityFlagBits) + + /* Note: These map 1:1 to VK equivalents. */ + enum class DebugMessageTypeFlagBits + { + GENERAL_BIT = VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT, + PERFORMANCE_BIT = VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT, + VALIDATION_BIT = VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT, + + NONE = 0 + }; + typedef Anvil::Bitfield DebugMessageTypeFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(DebugMessageTypeFlags, VkDebugUtilsMessageTypeFlagsEXT, DebugMessageTypeFlagBits) + /* Note: These map 1:1 to VK equivalents. */ enum class DependencyFlagBits { @@ -1276,53 +1312,53 @@ namespace Anvil DISABLED }; - typedef enum + enum class ObjectType { - /* NOTE: If new entries are added or existing entry order is modified, make sure to + /* NOTE: If new entries are added or existing entries are removed, make sure to * update Anvil::ObjectTracker::get_object_type_name(). */ - OBJECT_TYPE_FIRST, - - OBJECT_TYPE_BUFFER = OBJECT_TYPE_FIRST, - OBJECT_TYPE_BUFFER_VIEW, - OBJECT_TYPE_COMMAND_BUFFER, - OBJECT_TYPE_COMMAND_POOL, - OBJECT_TYPE_COMPUTE_PIPELINE_MANAGER, - OBJECT_TYPE_DESCRIPTOR_POOL, - OBJECT_TYPE_DESCRIPTOR_SET, - OBJECT_TYPE_DESCRIPTOR_SET_GROUP, - OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT, - OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_MANAGER, - OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE, - OBJECT_TYPE_DEVICE, - OBJECT_TYPE_EVENT, - OBJECT_TYPE_FENCE, - OBJECT_TYPE_FRAMEBUFFER, - OBJECT_TYPE_GRAPHICS_PIPELINE_MANAGER, - OBJECT_TYPE_IMAGE, - OBJECT_TYPE_IMAGE_VIEW, - OBJECT_TYPE_INSTANCE, - OBJECT_TYPE_MEMORY_BLOCK, - OBJECT_TYPE_PHYSICAL_DEVICE, - OBJECT_TYPE_PIPELINE_CACHE, - OBJECT_TYPE_PIPELINE_LAYOUT, - OBJECT_TYPE_PIPELINE_LAYOUT_MANAGER, - OBJECT_TYPE_QUERY_POOL, - OBJECT_TYPE_QUEUE, - OBJECT_TYPE_RENDER_PASS, - OBJECT_TYPE_RENDERING_SURFACE, - OBJECT_TYPE_SAMPLER, - OBJECT_TYPE_SEMAPHORE, - OBJECT_TYPE_SHADER_MODULE, - OBJECT_TYPE_SWAPCHAIN, - - OBJECT_TYPE_GLSL_SHADER_TO_SPIRV_GENERATOR, - OBJECT_TYPE_GRAPHICS_PIPELINE, + BUFFER = VK_OBJECT_TYPE_BUFFER, + BUFFER_VIEW = VK_OBJECT_TYPE_BUFFER_VIEW, + COMMAND_BUFFER = VK_OBJECT_TYPE_COMMAND_BUFFER, + COMMAND_POOL = VK_OBJECT_TYPE_COMMAND_POOL, + DEBUG_REPORT_CALLBACK = VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT, + DEBUG_UTILS_MESSENGER = VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT, + DESCRIPTOR_POOL = VK_OBJECT_TYPE_DESCRIPTOR_POOL, + DESCRIPTOR_SET = VK_OBJECT_TYPE_DESCRIPTOR_SET, + DESCRIPTOR_SET_LAYOUT = VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT, + DESCRIPTOR_UPDATE_TEMPLATE = VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE, + DEVICE = VK_OBJECT_TYPE_DEVICE, + EVENT = VK_OBJECT_TYPE_EVENT, + FENCE = VK_OBJECT_TYPE_FENCE, + FRAMEBUFFER = VK_OBJECT_TYPE_FRAMEBUFFER, + IMAGE = VK_OBJECT_TYPE_IMAGE, + IMAGE_VIEW = VK_OBJECT_TYPE_IMAGE_VIEW, + INSTANCE = VK_OBJECT_TYPE_INSTANCE, + PHYSICAL_DEVICE = VK_OBJECT_TYPE_PHYSICAL_DEVICE, + PIPELINE = VK_OBJECT_TYPE_PIPELINE, + PIPELINE_CACHE = VK_OBJECT_TYPE_PIPELINE_CACHE, + PIPELINE_LAYOUT = VK_OBJECT_TYPE_PIPELINE_LAYOUT, + QUERY_POOL = VK_OBJECT_TYPE_QUERY_POOL, + QUEUE = VK_OBJECT_TYPE_QUEUE, + RENDER_PASS = VK_OBJECT_TYPE_RENDER_PASS, + RENDERING_SURFACE = VK_OBJECT_TYPE_SURFACE_KHR, + SAMPLER = VK_OBJECT_TYPE_SAMPLER, + SEMAPHORE = VK_OBJECT_TYPE_SEMAPHORE, + SHADER_MODULE = VK_OBJECT_TYPE_SHADER_MODULE, + SWAPCHAIN = VK_OBJECT_TYPE_SWAPCHAIN_KHR, + + /* Anvil-specific items */ + ANVIL_COMPUTE_PIPELINE_MANAGER = VK_OBJECT_TYPE_END_RANGE + 1, + ANVIL_DESCRIPTOR_SET_GROUP, + ANVIL_DESCRIPTOR_SET_LAYOUT_MANAGER, + ANVIL_GLSL_SHADER_TO_SPIRV_GENERATOR, + ANVIL_GRAPHICS_PIPELINE_MANAGER, + ANVIL_MEMORY_BLOCK, + ANVIL_PIPELINE_LAYOUT_MANAGER, /* Always last */ - OBJECT_TYPE_COUNT, - OBJECT_TYPE_UNKNOWN = OBJECT_TYPE_COUNT - } ObjectType; + UNKNOWN + }; /** Defines, to what extent occlusion queries are going to be used. * @@ -1372,6 +1408,9 @@ namespace Anvil VERTEX_INPUT_BIT = VK_PIPELINE_STAGE_VERTEX_INPUT_BIT, VERTEX_SHADER_BIT = VK_PIPELINE_STAGE_VERTEX_SHADER_BIT, + /* VK_EXT_transform_feedback */ + TRANSFORM_FEEDBACK_BIT_EXT = VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT, + NONE = 0 }; typedef Anvil::Bitfield PipelineStageFlags; diff --git a/include/misc/types_struct.h b/include/misc/types_struct.h index 48bbe87f..dff6c4ed 100644 --- a/include/misc/types_struct.h +++ b/include/misc/types_struct.h @@ -124,7 +124,7 @@ namespace Anvil } SubpassSampleLocations; /* NOTE: Maps 1:1 to VkImageSubresource */ - typedef struct + typedef struct SurfaceCapabilities { uint32_t min_image_count; uint32_t max_image_count; @@ -136,6 +136,23 @@ namespace Anvil Anvil::SurfaceTransformFlagBits current_transform; Anvil::CompositeAlphaFlags supported_composite_alpha; Anvil::ImageUsageFlags supported_usage_flags; + + SurfaceCapabilities() + { + current_extent.height = 0; + current_extent.width = 0; + max_image_array_layers = 0; + max_image_count = 0; + max_image_extent.height = 0; + max_image_extent.width = 0; + min_image_count = 0; + min_image_extent.height = 0; + min_image_extent.width = 0; + supported_transforms = Anvil::SurfaceTransformFlagBits::NONE; + current_transform = Anvil::SurfaceTransformFlagBits::NONE; + supported_composite_alpha = Anvil::CompositeAlphaFlagBits::NONE; + supported_usage_flags = Anvil::ImageUsageFlagBits::NONE; + } } SurfaceCapabilities; static_assert(sizeof(SurfaceCapabilities) == sizeof(VkSurfaceCapabilitiesKHR), "Struct sizes much match"); @@ -517,6 +534,58 @@ namespace Anvil } } CommandBufferMGPUSubmission; + /* Holds contents of VkDebugUtilsLabelEXT minus pNext and sType */ + struct DebugLabel + { + float color[4]; + const char* name_ptr; + + DebugLabel() + { + color[0] = 0.0f; + color[1] = 0.0f; + color[2] = 0.0f; + color[3] = 0.0f; + name_ptr = nullptr; + } + + DebugLabel(const VkDebugUtilsLabelEXT& in_label_vk) + { + color[0] = in_label_vk.color[0]; + color[1] = in_label_vk.color[1]; + color[2] = in_label_vk.color[2]; + color[3] = in_label_vk.color[3]; + name_ptr = in_label_vk.pLabelName; + } + }; + + /* Holds contents of VkDebugUtilsObjectNameInfoEXT minus pNext and sType */ + struct DebugObjectNameInfo + { + uint64_t object_handle; + const char* object_name_ptr; + Anvil::ObjectType object_type; + + DebugObjectNameInfo() + { + object_handle = 0; + object_name_ptr = nullptr; + object_type = Anvil::ObjectType::UNKNOWN; + } + + DebugObjectNameInfo(const uint64_t& in_object_handle, + const char* in_object_name_ptr, + const Anvil::ObjectType& in_object_type) + :object_handle (in_object_handle), + object_name_ptr(in_object_name_ptr), + object_type (in_object_type) + { + /* Stub */ + } + + DebugObjectNameInfo(const VkDebugUtilsObjectNameInfoEXT& in_name_info_vk); + }; + #if defined(_WIN32) typedef struct ExternalNTHandleInfo { @@ -757,11 +826,29 @@ namespace Anvil typedef struct ExtensionEXTDebugReportEntrypoints { PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallbackEXT; + PFN_vkDebugReportMessageEXT vkDebugReportMessageEXT; PFN_vkDestroyDebugReportCallbackEXT vkDestroyDebugReportCallbackEXT; ExtensionEXTDebugReportEntrypoints(); } ExtensionEXTDebugReportEntrypoints; + typedef struct ExtensionEXTDebugUtilsEntrypoints + { + PFN_vkCmdBeginDebugUtilsLabelEXT vkCmdBeginDebugUtilsLabelEXT; + PFN_vkCmdEndDebugUtilsLabelEXT vkCmdEndDebugUtilsLabelEXT; + PFN_vkCmdInsertDebugUtilsLabelEXT vkCmdInsertDebugUtilsLabelEXT; + PFN_vkCreateDebugUtilsMessengerEXT vkCreateDebugUtilsMessengerEXT; + PFN_vkDestroyDebugUtilsMessengerEXT vkDestroyDebugUtilsMessengerEXT; + PFN_vkSetDebugUtilsObjectNameEXT vkSetDebugUtilsObjectNameEXT; + PFN_vkSetDebugUtilsObjectTagEXT vkSetDebugUtilsObjectTagEXT; + PFN_vkQueueBeginDebugUtilsLabelEXT vkQueueBeginDebugUtilsLabelEXT; + PFN_vkQueueEndDebugUtilsLabelEXT vkQueueEndDebugUtilsLabelEXT; + PFN_vkQueueInsertDebugUtilsLabelEXT vkQueueInsertDebugUtilsLabelEXT; + PFN_vkSubmitDebugUtilsMessageEXT vkSubmitDebugUtilsMessageEXT; + + ExtensionEXTDebugUtilsEntrypoints(); + } ExtensionEXTDebugUtilsEntrypoints; + typedef struct ExtensionEXTExternalMemoryHostEntrypoints { PFN_vkGetMemoryHostPointerPropertiesEXT vkGetMemoryHostPointerPropertiesEXT; @@ -784,6 +871,18 @@ namespace Anvil ExtensionEXTSampleLocationsEntrypoints(); } ExtensionEXTSampleLocationsEntrypoints; + typedef struct ExtensionEXTTransformFeedbackEntrypoints + { + PFN_vkCmdBeginQueryIndexedEXT vkCmdBeginQueryIndexedEXT; + PFN_vkCmdBeginTransformFeedbackEXT vkCmdBeginTransformFeedbackEXT; + PFN_vkCmdBindTransformFeedbackBuffersEXT vkCmdBindTransformFeedbackBuffersEXT; + PFN_vkCmdDrawIndirectByteCountEXT vkCmdDrawIndirectByteCountEXT; + PFN_vkCmdEndQueryIndexedEXT vkCmdEndQueryIndexedEXT; + PFN_vkCmdEndTransformFeedbackEXT vkCmdEndTransformFeedbackEXT; + + ExtensionEXTTransformFeedbackEntrypoints(); + } ExtensionEXTTransformFeedbackEntrypoints; + typedef struct ExtensionKHRDeviceGroupEntrypoints { PFN_vkAcquireNextImage2KHR vkAcquireNextImage2KHR; @@ -1268,6 +1367,39 @@ namespace Anvil } } ExternalMemoryHandleImportInfo; + typedef struct EXTTransformFeedbackFeatures + { + bool geometry_streams; + bool transform_feedback; + + EXTTransformFeedbackFeatures(); + EXTTransformFeedbackFeatures(const VkPhysicalDeviceTransformFeedbackFeaturesEXT& in_features); + + VkPhysicalDeviceTransformFeedbackFeaturesEXT get_vk_physical_device_transform_feedback_features() const; + + bool operator==(const EXTTransformFeedbackFeatures& in_features) const; + } EXTTransformFeedbackFeatures; + + typedef struct EXTTransformFeedbackProperties + { + uint32_t max_transform_feedback_buffer_data_size; + uint32_t max_transform_feedback_buffer_data_stride; + VkDeviceSize max_transform_feedback_buffer_size; + uint32_t max_transform_feedback_stream_data_size; + uint32_t n_max_transform_feedback_buffers; + uint32_t n_max_transform_feedback_streams; + bool supports_transform_feedback_draw; + bool supports_transform_feedback_queries; + bool supports_transform_feedback_rasterization_stream_select; + bool supports_transform_feedback_streams_lines_triangles; + + EXTTransformFeedbackProperties(); + EXTTransformFeedbackProperties(const VkPhysicalDeviceTransformFeedbackPropertiesEXT& in_props); + + bool operator==(const EXTTransformFeedbackProperties&) const; + + } EXTTransformFeedbackProperties; + typedef struct KHR16BitStorageFeatures { bool is_input_output_storage_supported; @@ -1570,6 +1702,18 @@ namespace Anvil uint32_t row_size; + MipmapRawData() + { + aspect = Anvil::ImageAspectFlagBits::NONE; + data_size = 0; + linear_tightly_packed_data_uchar_raw_ptr = nullptr; + n_layer = 0; + n_layers = 0; + n_mipmap = 0; + n_slices = 0; + row_size = 0; + } + /** Creates a MipmapRawData instance which can be used to upload data to 1D Image instances: * * @param in_aspect Image aspect to modify. @@ -1947,6 +2091,7 @@ namespace Anvil { const PhysicalDeviceFeaturesCoreVK10* core_vk1_0_features_ptr; const EXTDescriptorIndexingFeatures* ext_descriptor_indexing_features_ptr; + const EXTTransformFeedbackFeatures* ext_transform_feedback_features_ptr; const KHR16BitStorageFeatures* khr_16bit_storage_features_ptr; const KHR8BitStorageFeatures* khr_8bit_storage_features_ptr; const KHRMultiviewFeatures* khr_multiview_features_ptr; @@ -1955,6 +2100,7 @@ namespace Anvil PhysicalDeviceFeatures(); PhysicalDeviceFeatures(const PhysicalDeviceFeaturesCoreVK10* in_core_vk1_0_features_ptr, const EXTDescriptorIndexingFeatures* in_ext_descriptor_indexing_features_ptr, + const EXTTransformFeedbackFeatures* in_ext_transform_feedback_features_ptr, const KHR16BitStorageFeatures* in_khr_16_bit_storage_features_ptr, const KHR8BitStorageFeatures* in_khr_8_bit_storage_features_ptr, const KHRMultiviewFeatures* in_khr_multiview_features_ptr, @@ -2120,6 +2266,7 @@ namespace Anvil const EXTPCIBusInfoProperties* ext_pci_bus_info_properties_ptr; const EXTSampleLocationsProperties* ext_sample_locations_properties_ptr; const EXTSamplerFilterMinmaxProperties* ext_sampler_filter_minmax_properties_ptr; + const EXTTransformFeedbackProperties* ext_transform_feedback_properties_ptr; const EXTVertexAttributeDivisorProperties* ext_vertex_attribute_divisor_properties_ptr; const KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties* khr_external_memory_capabilities_physical_device_id_properties_ptr; const KHRMaintenance2PhysicalDevicePointClippingProperties* khr_maintenance2_point_clipping_properties_ptr; @@ -2134,6 +2281,7 @@ namespace Anvil const EXTPCIBusInfoProperties* in_ext_pci_bus_info_properties_ptr, const EXTSampleLocationsProperties* in_ext_sample_locations_properties_ptr, const EXTSamplerFilterMinmaxProperties* in_ext_sampler_filter_minmax_properties_ptr, + const EXTTransformFeedbackProperties* in_ext_transform_feedback_properties_ptr, const EXTVertexAttributeDivisorProperties* in_ext_vertex_attribute_divisor_properties_ptr, const KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties* in_khr_external_memory_caps_physical_device_id_props_ptr, const KHRMaintenance3Properties* in_khr_maintenance3_properties_ptr, @@ -2750,5 +2898,14 @@ namespace Anvil const void* next_ptr; } VkStructHeader; + typedef std::function& in_queue_labels, + const std::vector& in_cmd_buffer_labels, + const std::vector& in_objects)> DebugMessengerCallbackFunction; + }; /* namespace Anvil */ #endif diff --git a/include/misc/types_utils.h b/include/misc/types_utils.h index 6d34f9a4..e0fa0af2 100644 --- a/include/misc/types_utils.h +++ b/include/misc/types_utils.h @@ -258,6 +258,16 @@ namespace Anvil /* Returns Vulkan equivalent of @param in_shader_stage */ Anvil::ShaderStageFlagBits get_shader_stage_flag_bits_from_shader_stage(Anvil::ShaderStage in_shader_stage); + /* TODO + * + * get_vk_object_type_for_*() return VK_DEBUG_REPORT_OBJECT_TYPE_MAX_ENUM_EXT if no enum exists for @param in_object_type. Since EXT_debug_utils + * has been deprecated, this is not an unlikely scenario. + */ + Anvil::ObjectType get_object_type_for_vk_object_type (const VkObjectType& in_object_type); + Anvil::ObjectType get_object_type_for_vk_debug_report_object_type (const VkDebugReportObjectTypeEXT& in_object_type); + VkDebugReportObjectTypeEXT get_vk_debug_report_object_type_ext_from_object_type(const Anvil::ObjectType& in_object_type); + VkObjectType get_vk_object_type_for_object_type (const Anvil::ObjectType& in_object_type); + /** Converts an Anvil::MemoryFeatureFlags value to a pair of corresponding Vulkan enum values. * * @param in_mem_feature_flags Anvil memory feature flags to use for conversion. diff --git a/include/wrappers/command_buffer.h b/include/wrappers/command_buffer.h index e5f719a0..f0b4c64a 100644 --- a/include/wrappers/command_buffer.h +++ b/include/wrappers/command_buffer.h @@ -63,9 +63,12 @@ namespace Anvil { COMMAND_TYPE_BEGIN_RENDER_PASS, COMMAND_TYPE_BEGIN_QUERY, + COMMAND_TYPE_BEGIN_QUERY_INDEXED_EXT, + COMMAND_TYPE_BEGIN_TRANSFORM_FEEDBACK_EXT, COMMAND_TYPE_BIND_DESCRIPTOR_SETS, COMMAND_TYPE_BIND_INDEX_BUFFER, COMMAND_TYPE_BIND_PIPELINE, + COMMAND_TYPE_BIND_TRANSFORM_FEEDBACK_BUFFERS_EXT, COMMAND_TYPE_BIND_VERTEX_BUFFER, COMMAND_TYPE_BLIT_IMAGE, COMMAND_TYPE_CLEAR_ATTACHMENTS, @@ -88,10 +91,13 @@ namespace Anvil COMMAND_TYPE_DRAW_INDEXED_INDIRECT_COUNT_AMD, COMMAND_TYPE_DRAW_INDEXED_INDIRECT_COUNT_KHR, COMMAND_TYPE_DRAW_INDIRECT, + COMMAND_TYPE_DRAW_INDIRECT_BYTE_COUNT_EXT, COMMAND_TYPE_DRAW_INDIRECT_COUNT_AMD, COMMAND_TYPE_DRAW_INDIRECT_COUNT_KHR, COMMAND_TYPE_END_QUERY, + COMMAND_TYPE_END_QUERY_INDEXED_EXT, COMMAND_TYPE_END_RENDER_PASS, + COMMAND_TYPE_END_TRANSFORM_FEEDBACK_EXT, COMMAND_TYPE_EXECUTE_COMMANDS, COMMAND_TYPE_FILL_BUFFER, COMMAND_TYPE_NEXT_SUBPASS, @@ -159,6 +165,38 @@ namespace Anvil COMMAND_BUFFER_CALLBACK_ID_COUNT }; + /** Holds all arguments passed to a vkCmdBeginQueryIndexedEXT() command. */ + typedef struct BeginQueryIndexedEXTCommand : public Command + { + Anvil::QueryControlFlags flags; + uint32_t index; + Anvil::QueryPool* query_pool_ptr; + uint32_t query; + + /** Constructor. + * + * Arguments as per VK_EXT_transform_feedback. + **/ + explicit BeginQueryIndexedEXTCommand(Anvil::QueryPool* in_query_pool_ptr, + const uint32_t& in_query, + const Anvil::QueryControlFlags& in_flags, + const uint32_t& in_index); + + /** Destructor. + * + * Releases the encapsulated Framebuffer and RenderPass instances. + **/ + virtual ~BeginQueryIndexedEXTCommand() + { + /* Stub */ + } + + + private: + BeginQueryIndexedEXTCommand (const BeginQueryIndexedEXTCommand&); + BeginQueryIndexedEXTCommand& operator=(const BeginQueryIndexedEXTCommand&); + } BeginQueryIndexedEXTCommand; + /** Holds all arguments passed to a vkCmdBeginRenderPass() command. */ typedef struct BeginRenderPassCommand : public Command { @@ -225,6 +263,40 @@ namespace Anvil } } BeginRenderPassCommandRecordedCallbackData; + typedef struct BeginTransformFeedbackEXTCommand : public Command + { + std::vector counter_buffer_offsets; + std::vector counter_buffer_ptrs; + uint32_t first_counter_buffer; + + explicit BeginTransformFeedbackEXTCommand(const uint32_t& in_first_counter_buffer, + const std::vector& in_counter_buffer_ptrs, + const std::vector& in_counter_buffer_offsets); + + private: + BeginTransformFeedbackEXTCommand (const BeginTransformFeedbackEXTCommand&); + BeginTransformFeedbackEXTCommand& operator=(const BeginTransformFeedbackEXTCommand); + } BeginTransformFeedbackEXTCommand; + + typedef struct BindTransformFeedbackBuffersEXTCommand : public Command + { + std::vector buffer_ptrs; + uint32_t first_binding; + uint32_t n_bindings; + std::vector offsets; + std::vector sizes; + + explicit BindTransformFeedbackBuffersEXTCommand(const uint32_t& in_first_binding, + const uint32_t& in_n_bindings, + const std::vector& in_buffer_ptrs, + const std::vector& in_offsets, + const std::vector& in_sizes); + + private: + BindTransformFeedbackBuffersEXTCommand (const BindTransformFeedbackBuffersEXTCommand&); + BindTransformFeedbackBuffersEXTCommand& operator=(const BindTransformFeedbackBuffersEXTCommand); + } BindTransformFeedbackBuffersEXTCommand; + /** Holds all arguments passed to a vkCmdEndRenderPass() command. */ typedef struct EndRenderPassCommand : public Command { @@ -308,6 +380,17 @@ namespace Anvil virtual ~CommandBufferBase(); + /** Starts a queue debug label region. App must call end_debug_utils_label() for the same cmd buffer instance + * at some point to declare the end of the label region. + * + * Requires VK_EXT_debug_utils support. Otherwise, the call is moot. + * + * @param in_label_name_ptr Meaning as per VkDebugUtilsLabelEXT::pLabelName. Must not be nullptr. + * @param in_color_vec4_ptr Meaning as per VkDebugUtilsLabelEXT::color. Must not be nullptr. + */ + void begin_debug_utils_label(const char* in_label_name_ptr, + const float* in_color_vec4_ptr); + /* Disables internal command stashing which is enbled for builds created with * STORE_COMMAND_BUFFER_COMMANDS enabled. * @@ -318,6 +401,13 @@ namespace Anvil m_command_stashing_disabled = true; } + /** Ends a queue debug label region. Requires a preceding begin_debug_utils_label() call. + * + * Requires VK_EXT_debug_utils support. Otherwise, the call is moot. + * + */ + void end_debug_utils_label(); + /** Returns a handle to the raw Vulkan command buffer instance, encapsulated by the object */ VkCommandBuffer get_command_buffer() const { @@ -344,6 +434,16 @@ namespace Anvil return m_parent_command_pool_ptr; } + /** Inserts a single queue debug label. + * + * Requires VK_EXT_debug_utils support. Otherwise, the call is moot. + * + * @param in_label_name_ptr Meaning as per VkDebugUtilsLabelEXT::pLabelName. Must not be nullptr. + * @param in_color_vec4_ptr Meaning as per VkDebugUtilsLabelEXT::color. Must not be nullptr. + */ + void insert_debug_utils_label(const char* in_label_name_ptr, + const float* in_color_vec4_ptr); + /** Issues a vkCmdBeginQuery() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS * #define enabled). @@ -359,6 +459,44 @@ namespace Anvil Anvil::QueryIndex in_entry, Anvil::QueryControlFlags in_flags); + /** Issues a vkCmdBeginQueryIndexedEXT() call and appends it to the internal vector of commands + * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS + * #define enabled). + * + * Calling this function for a command buffer which has not been put into a recording mode + * (by issuing a start_recording() call earlier) will result in an assertion failure. + * + * Argument meaning is as per VK_EXT_transform_feedback. + * + * Requires VK_EXT_transform_feedback support. + * + * @return true if successful, false otherwise. + **/ + bool record_begin_query_indexed(Anvil::QueryPool* in_query_pool_ptr, + const Anvil::QueryIndex& in_query, + const Anvil::QueryControlFlags& in_flags, + const uint32_t& in_index); + + /** Issues a vkCmdBeginTransformFeedbackEXT() call and appends it to the internal vector of commands + * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS + * #define enabled). + * + * Calling this function for a command buffer which has not been put into a recording mode + * (by issuing a start_recording() call earlier) will result in an assertion failure. + * + * Requires active renderpass. + * + * Argument meaning is as per VK_EXT_transform_feedback. + * + * Requires VK_EXT_transform_feedback support. + * + * @return true if successful, false otherwise. + **/ + bool record_begin_transform_feedback_EXT(const uint32_t& in_first_counter_buffer, + const uint32_t& in_n_counter_buffers, + Anvil::Buffer** in_opt_counter_buffer_ptrs, + const VkDeviceSize* in_opt_counter_buffer_offsets); + /** Issues a vkCmdBindDescriptorSets() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS * #define enabled). @@ -407,6 +545,26 @@ namespace Anvil bool record_bind_pipeline(Anvil::PipelineBindPoint in_pipeline_bind_point, Anvil::PipelineID in_pipeline_id); + /** Issues a vkCmdBindTransformFeedbackBuffersEXT() call and appends it to the internal vector of commands + * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS + * #define enabled). + * + * Calling this function for a command buffer which has not been put into a recording mode + * (by issuing a start_recording() call earlier) will result in an assertion failure. + * + * Requires VK_EXT_transform_feedback support. + * + * Argument meaning is as per VK_EXT_transform_feedback. + * + * @return true if successful, false otherwise. + * + */ + bool record_bind_transform_feedback_buffers_EXT(const uint32_t& in_first_binding, + const uint32_t& in_n_bindings, + Anvil::Buffer** in_buffer_ptrs, + const VkDeviceSize* in_offsets_ptr, + const VkDeviceSize* in_sizes_ptr); + /** Issues a vkCmdBindVertexBuffers() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS * #define enabled). @@ -830,6 +988,30 @@ namespace Anvil uint32_t in_count, uint32_t in_stride); + /** Issues a vkCmdDrawIndirectByteCountEXT() call and appends it to the internal vector of commands + * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS + * #define enabled). + * + * Calling this function for a command buffer which has not been put into a recording mode + * (by issuing a start_recording() call earlier) will result in an assertion failure. + * + * It is also illegal to call this function when not recording renderpass commands. Doing so + * will also result in an assertion failure. + * + * This function is only available if VK_EXT_transform_feedback is supported by the Vulkan + * device AND if the extension has been requested at creation time. + * + * Argument meaning is as per VK_EXT_transform_feedback specification. + * + * @return true if successful, false otherwise. + **/ + bool record_draw_indirect_byte_count_EXT(const uint32_t& in_instance_count, + const uint32_t& in_first_instance, + Anvil::Buffer* in_counter_buffer_ptr, + const VkDeviceSize& in_counter_buffer_offset, + const uint32_t& in_counter_offset, + const uint32_t& in_vertex_stride); + /** Issues a vkCmdDrawIndirectCount() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS * #define enabled). @@ -892,6 +1074,43 @@ namespace Anvil bool record_end_query(Anvil::QueryPool* in_query_pool_ptr, Anvil::QueryIndex in_entry); + /** Issues a vkCmdEndQueryIndexedEXT() call and appends it to the internal vector of commands + * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS + * #define enabled). + * + * Calling this function for a command buffer which has not been put into a recording mode + * (by issuing a start_recording() call earlier) will result in an assertion failure. + * + * Argument meaning is as per VK_EXT_transform_feedback. + * + * Requires VK_EXT_transform_feedback support. + * + * @return true if successful, false otherwise. + **/ + bool record_end_query_indexed_EXT(Anvil::QueryPool* in_query_pool_ptr, + const Anvil::QueryIndex& in_query, + const uint32_t& in_index); + + /** Issues a vkCmdEndTransformFeedbackEXT() call and appends it to the internal vector of commands + * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS + * #define enabled). + * + * Calling this function for a command buffer which has not been put into a recording mode + * (by issuing a start_recording() call earlier) will result in an assertion failure. + * + * Requires active renderpass. + * + * Argument meaning is as per VK_EXT_transform_feedback. + * + * Requires VK_EXT_transform_feedback support. + * + * @return true if successful, false otherwise. + **/ + bool record_end_transform_feedback_EXT(const uint32_t& in_first_counter_buffer, + const uint32_t& in_n_counter_buffers, + Anvil::Buffer** in_opt_counter_buffer_ptrs, + const VkDeviceSize* in_opt_counter_buffer_offsets); + /** Issues a vkCmdFillBuffer() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS * #define enabled). @@ -1298,6 +1517,7 @@ namespace Anvil struct DrawIndirectCommand; struct DrawIndexedIndirectCommand; struct EndQueryCommand; + struct EndQueryIndexedEXTCommand; struct ExecuteCommandsCommand; struct FillBufferCommand; struct NextSubpassCommand; @@ -2011,6 +2231,34 @@ namespace Anvil DrawIndexedIndirectCommand& operator=(const DrawIndexedIndirectCommand&); } DrawIndexedIndirectCommand; + /** Holds all arguments passed to a vkCmdDrawIndirectByteCountEXT() command. */ + typedef struct DrawIndirectByteCountEXTCommand : public Command + { + VkDeviceSize counter_buffer_offset; + Anvil::Buffer* counter_buffer_ptr; + uint32_t counter_offset; + uint32_t first_instance; + uint32_t instance_count; + uint32_t vertex_stride; + + /** Constructor. **/ + explicit DrawIndirectByteCountEXTCommand(const uint32_t& in_instance_count, + const uint32_t& in_first_instance, + Anvil::Buffer* in_counter_buffer_ptr, + const VkDeviceSize& in_counter_buffer_offset, + const uint32_t& in_counter_offset, + const uint32_t& in_vertex_stride); + + /** Destructor */ + virtual ~DrawIndirectByteCountEXTCommand() + { + /* Stub */ + } + + private: + DrawIndirectByteCountEXTCommand& operator=(const DrawIndirectByteCountEXTCommand&); + } DrawIndirectByteCountEXTCommand; + /** Holds all arguments passed to a vkCmdDrawIndexedIndirectCountAMD() command. */ typedef struct DrawIndexedIndirectCountAMDCommand : public Command { @@ -2089,6 +2337,41 @@ namespace Anvil } EndQueryCommand; + /** Holds all arguments passed to a vkCmdEndQueryIndexedEXT() command. */ + typedef struct EndQueryIndexedEXTCommand : public Command + { + uint32_t index; + Anvil::QueryIndex query; + Anvil::QueryPool* query_pool_ptr; + + /** Constructor. **/ + explicit EndQueryIndexedEXTCommand(Anvil::QueryPool* in_query_pool_ptr, + const Anvil::QueryIndex& in_entry, + const uint32_t& in_index); + + /** Destructor. */ + virtual ~EndQueryIndexedEXTCommand() + { + /* Stub */ + } + + } EndQueryIndexedEXTCommand; + + typedef struct EndTransformFeedbackEXTCommand : public Command + { + std::vector counter_buffer_offsets; + std::vector counter_buffer_ptrs; + uint32_t first_counter_buffer; + + explicit EndTransformFeedbackEXTCommand(const uint32_t& in_first_counter_buffer, + const std::vector& in_counter_buffer_ptrs, + const std::vector& in_counter_buffer_offsets); + + private: + EndTransformFeedbackEXTCommand (const EndTransformFeedbackEXTCommand&); + EndTransformFeedbackEXTCommand& operator=(const EndTransformFeedbackEXTCommand); + } EndTransformFeedbackEXTCommand; + /** Holds all arguments passed to a vkCmdExecuteCommands() command. */ typedef struct ExecuteCommandsCommand : public Command { @@ -2594,6 +2877,7 @@ namespace Anvil uint32_t m_device_mask; const Anvil::BaseDevice* m_device_ptr; bool m_is_renderpass_active; + uint32_t m_n_debug_label_regions_started; Anvil::CommandPool* m_parent_command_pool_ptr; bool m_recording_in_progress; uint32_t m_renderpass_device_mask; diff --git a/include/wrappers/debug_messenger.h b/include/wrappers/debug_messenger.h new file mode 100644 index 00000000..8dbe93de --- /dev/null +++ b/include/wrappers/debug_messenger.h @@ -0,0 +1,108 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +/* Provides support for debug utils messengers, introduced by VK_EXT_debug_utils extension. + * + * Also supports a fall-back path leveraging VK_EXT_debug_report if VK_EXT_debug_utils is unavailable. + * + */ +#ifndef WRAPPERS_DEBUG_MESSENGER_H +#define WRAPPERS_DEBUG_MESSENGER_H + +#include "misc/types.h" +#include "misc/debug_marker.h" +#include "misc/mt_safety.h" +#include "wrappers/device.h" + +namespace Anvil +{ + class DebugMessenger : public MTSafetySupportProvider + { + public: + /* Public functions */ + + virtual ~DebugMessenger(); + + /* Creates a debug messenger instance. + * + * Functions exposed by this wrapper require VK_EXT_debug_utils to be available. However, portion of the offered + * functionality can be handled by implementations supporting VK_EXT_debug_report; in cases only the latter is + * available, it will be used instead. Unavailable pieces of information will not be included in the callbacks + * in such case. + * + * The function will fail if neither of the two extensions is available. + **/ + static DebugMessengerUniquePtr create(Anvil::DebugMessengerCreateInfoUniquePtr in_create_info_ptr); + + const Anvil::DebugMessengerCreateInfo* get_create_info_ptr() const + { + return m_create_info_ptr.get(); + } + + void submit_message(const Anvil::DebugMessageSeverityFlagBits& in_message_severity, + const Anvil::DebugMessageTypeFlags& in_message_type_flags, + const char* in_message_id_name_ptr, + int32_t in_message_id, + const char* in_message_ptr, + const std::vector& in_queue_labels, + const std::vector& in_cmd_buffer_labels, + const std::vector& in_objects); + + private: + /* Private type definitions */ + enum class DebugAPI + { + EXT_DEBUG_REPORT, + EXT_DEBUG_UTILS + }; + + /* Private functions */ + DebugMessenger(const DebugAPI& in_debug_api, + Anvil::DebugMessengerCreateInfoUniquePtr in_create_info_ptr); + + static Anvil::DebugMessageSeverityFlags get_debug_message_severity_flags_for_debug_report_flags(const VkDebugReportFlagsEXT& in_flags); + static VkDebugReportFlagsEXT get_debug_report_flags_for_debug_message_severity_flags(const Anvil::DebugMessageSeverityFlags& in_flags); + + static VkBool32 VKAPI_PTR callback_handler_ext_debug_report(VkDebugReportFlagsEXT in_flags, + VkDebugReportObjectTypeEXT in_object_type, + uint64_t in_object, + size_t in_location, + int32_t in_message_code, + const char* in_layer_prefix_ptr, + const char* in_message_ptr, + void* in_user_data_ptr); + static VkBool32 VKAPI_PTR callback_handler_ext_debug_utils (VkDebugUtilsMessageSeverityFlagBitsEXT in_message_severity, + VkDebugUtilsMessageTypeFlagsEXT in_message_types, + const VkDebugUtilsMessengerCallbackDataEXT* in_callback_data_ptr, + void* in_user_data_ptr); + + /* Private variables */ + Anvil::DebugMessengerCreateInfoUniquePtr m_create_info_ptr; + const DebugAPI m_debug_api; + + + VkDebugReportCallbackEXT m_debug_callback; //< only used if m_debug_api == EXT_DEBUG_REPORT + VkDebugUtilsMessengerEXT m_messenger; //< only used if m_debug_api == EXT_DEBUG_UTILS + }; +} + +#endif /* WRAPPERS_DEBUG_MESSENGER_H */ diff --git a/include/wrappers/device.h b/include/wrappers/device.h index 3fc3088d..7757b631 100644 --- a/include/wrappers/device.h +++ b/include/wrappers/device.h @@ -188,6 +188,12 @@ namespace Anvil **/ const ExtensionEXTSampleLocationsEntrypoints& get_extension_ext_sample_locations_entrypoints() const; + /** Returns a container with entry-points to functions introduced by VK_EXT_transform_feedback extension. + * + * Will fire an assertion failure if the extension is not supported. + **/ + const ExtensionEXTTransformFeedbackEntrypoints& get_extension_ext_transform_feedback_entrypoints() const; + /** Returns a container with entry-points to functions introduced by VK_KHR_bind_memory2 extension. **/ const ExtensionKHRBindMemory2Entrypoints& get_extension_khr_bind_memory2_entrypoints() const { @@ -731,6 +737,7 @@ namespace Anvil ExtensionEXTExternalMemoryHostEntrypoints m_ext_external_memory_host_extension_entrypoints; ExtensionEXTHdrMetadataEntrypoints m_ext_hdr_metadata_extension_entrypoints; ExtensionEXTSampleLocationsEntrypoints m_ext_sample_locations_extension_entrypoints; + ExtensionEXTTransformFeedbackEntrypoints m_ext_transform_feedback_extension_entrypoints; ExtensionKHRBindMemory2Entrypoints m_khr_bind_memory2_extension_entrypoints; ExtensionKHRDescriptorUpdateTemplateEntrypoints m_khr_descriptor_update_template_extension_entrypoints; ExtensionKHRDeviceGroupEntrypoints m_khr_device_group_extension_entrypoints; diff --git a/include/wrappers/graphics_pipeline_manager.h b/include/wrappers/graphics_pipeline_manager.h index fd8396e9..4460e5f5 100644 --- a/include/wrappers/graphics_pipeline_manager.h +++ b/include/wrappers/graphics_pipeline_manager.h @@ -29,46 +29,6 @@ * - pipeline properties are assigned default values, as described below. They can be * adjusted by calling relevant entrypoints, prior to baking. * - * Each baked graphics pipeline is configured as below at Pipeline object creation time: - * - * All rendering modes & tests: disabled - * Blend constant: vec4(0.0) - * Cull mode: VK_CULL_MODE_BACK - * Depth bias: 0.0 - * Depth bias clamp: 0.0 - * Depth bias slope factor: 1.0 - * Depth test compare op: Anvil::CompareOp::ALWAYS - * Depth writes: disabled - * Dynamic states: all disabled - * Fill mode: VK_FILL_MODE_SOLID - * Front face: VK_FRONT_FACE_CCW - * Line width: 1.0 - * Logic op: VK_LOGIC_OP_NOOP; - * Max depth boundary: 1.0 - * Min depth boundary: 0.0 - * Min sample shading: 1.0 - * Number of raster samples: 1 - * Number of tessellation patches: 1 - * Primitive topology: VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST - * Sample mask: 0xFFFFFFFF - * Slope scaled depth bias: 0.0 - * Stencil comparison mask (back/front): 0xFFFFFFFF - * Stencil comparison op (back/front): Anvil::CompareOp::ALWAYS - * Stencil depth fail op (back/front): VK_STENCIL_OP_KEEP - * Stencil fail op (back/front): VK_STENCIL_OP_KEEP - * Stencil pass op (back/front): VK_STENCIL_OP_KEEP - * Stencil reference value (back/front): 0 - * Stencil write mask (back/front): 0xFFFFFFFF - * - * If no scissor or viewport is defined explicitly, one scissor box and one viewport, - * covering the whole screen, will be created at baking time. - * - * If VK_AMD_rasterization_order extension is supported, strict rasterization order is assumed - * for the pipeline by default. - * - * If VK_KHR_maintenance2 extension is supported, upper-left tessellation domain origin is assumed - * by default (as per spec). - * **/ #ifndef WRAPPERS_GRAPHICS_PIPELINE_MANAGER_H #define WRAPPERS_GRAPHICS_PIPELINE_MANAGER_H diff --git a/include/wrappers/instance.h b/include/wrappers/instance.h index ca5427b4..b8f4be25 100644 --- a/include/wrappers/instance.h +++ b/include/wrappers/instance.h @@ -35,14 +35,12 @@ #include "misc/library.h" #include "misc/mt_safety.h" #include "misc/types.h" +#include "wrappers/debug_messenger.h" namespace Anvil { - /** Debug call-back function prototype */ - typedef std::function< VkBool32(VkDebugReportFlagsEXT in_message_flags, - VkDebugReportObjectTypeEXT in_object_type, - const char* in_layer_prefix, - const char* in_message)> DebugCallbackFunction; + typedef std::function DebugCallbackFunction; class Instance : public Anvil::MTSafetySupportProvider { @@ -79,7 +77,7 @@ namespace Anvil **/ static Anvil::InstanceUniquePtr create(const std::string& in_app_name, const std::string& in_engine_name, - DebugCallbackFunction in_opt_validation_callback_proc, + Anvil::DebugCallbackFunction in_opt_validation_callback_proc, bool in_mt_safe, const std::vector& in_opt_disallowed_instance_level_extensions = std::vector() ); @@ -88,6 +86,9 @@ namespace Anvil return m_enabled_extensions_info_ptr->get_instance_extension_info(); } + const ExtensionEXTDebugReportEntrypoints& get_extension_ext_debug_report_entrypoints() const; + const ExtensionEXTDebugUtilsEntrypoints& get_extension_ext_debug_utils_entrypoints () const; + const ExtensionKHRExternalFenceCapabilitiesEntrypoints& get_extension_khr_external_fence_capabilities_entrypoints() const; const ExtensionKHRExternalMemoryCapabilitiesEntrypoints& get_extension_khr_external_memory_capabilities_entrypoints() const; @@ -208,10 +209,10 @@ namespace Anvil /* Private functions */ /** Private constructor. Please use create() function instead. */ - Instance(const std::string& in_app_name, - const std::string& in_engine_name, - DebugCallbackFunction in_opt_validation_callback_function, - bool in_mt_safe); + Instance(const std::string& in_app_name, + const std::string& in_engine_name, + Anvil::DebugCallbackFunction in_opt_validation_callback_function, + bool in_mt_safe); Instance& operator=(const Instance&); Instance (const Instance&); @@ -229,22 +230,14 @@ namespace Anvil bool init_vk10_func_ptrs(); #endif - static VkBool32 VKAPI_PTR debug_callback_pfn_proc(VkDebugReportFlagsEXT in_message_flags, - VkDebugReportObjectTypeEXT in_object_type, - uint64_t in_src_object, - size_t in_location, - int32_t in_msg_code, - const char* in_layer_prefix_ptr, - const char* in_message_ptr, - void* in_user_data); + void debug_callback_handler(const Anvil::DebugMessageSeverityFlagBits& in_severity, + const char* in_message_ptr); /* Private variables */ VkInstance m_instance; - /* DebugReport extension function pointers and data */ - VkDebugReportCallbackEXT m_debug_callback_data; - ExtensionEXTDebugReportEntrypoints m_ext_debug_report_entrypoints; + ExtensionEXTDebugUtilsEntrypoints m_ext_debug_utils_entrypoints; ExtensionKHRDeviceGroupCreationEntrypoints m_khr_device_group_creation_entrypoints; ExtensionKHRExternalFenceCapabilitiesEntrypoints m_khr_external_fence_capabilities_entrypoints; ExtensionKHRExternalMemoryCapabilitiesEntrypoints m_khr_external_memory_capabilities_entrypoints; @@ -269,6 +262,7 @@ namespace Anvil std::unique_ptr > m_enabled_extensions_info_ptr; std::unique_ptr > m_supported_extensions_info_ptr; + Anvil::DebugMessengerUniquePtr m_debug_messenger_ptr; Anvil::Layer m_global_layer; std::vector m_physical_device_groups; std::vector > m_physical_devices; diff --git a/include/wrappers/physical_device.h b/include/wrappers/physical_device.h index beb996bd..cb9822a9 100644 --- a/include/wrappers/physical_device.h +++ b/include/wrappers/physical_device.h @@ -254,6 +254,8 @@ namespace Anvil std::unique_ptr m_ext_pci_bus_info_ptr; std::unique_ptr m_ext_sample_locations_properties_ptr; std::unique_ptr m_ext_sampler_filter_minmax_properties_ptr; + std::unique_ptr m_ext_transform_feedback_features_ptr; + std::unique_ptr m_ext_transform_feedback_properties_ptr; std::unique_ptr m_ext_vertex_attribute_divisor_properties_ptr; std::unique_ptr m_khr_16_bit_storage_features_ptr; std::unique_ptr m_khr_8_bit_storage_features_ptr; diff --git a/include/wrappers/queue.h b/include/wrappers/queue.h index 6d809d4b..62309208 100644 --- a/include/wrappers/queue.h +++ b/include/wrappers/queue.h @@ -116,12 +116,30 @@ namespace Anvil /** Destructor */ virtual ~Queue(); + /** Starts a queue debug label region. App must call end_debug_utils_label() for the same queue instance + * at some point to declare the end of the label region. + * + * Requires VK_EXT_debug_utils support. Otherwise, the call is moot. + * + * @param in_label_name_ptr Meaning as per VkDebugUtilsLabelEXT::pLabelName. Must not be nullptr. + * @param in_color_vec4_ptr Meaning as per VkDebugUtilsLabelEXT::color. Must not be nullptr. + */ + void begin_debug_utils_label(const char* in_label_name_ptr, + const float* in_color_vec4_ptr); + /** Updates sparse resource memory bindings using this queue. * * @param in_update Detailed information about the update to be carried out. **/ bool bind_sparse_memory(Anvil::SparseMemoryBindingUpdateInfo& in_update); + /** Ends a queue debug label region. Requires a preceding begin_debug_utils_label() call. + * + * Requires VK_EXT_debug_utils support. Otherwise, the call is moot. + * + */ + void end_debug_utils_label(); + /** Retrieves parent device instance */ const Anvil::BaseDevice* get_parent_device() const { @@ -146,6 +164,16 @@ namespace Anvil return m_queue_index; } + /** Inserts a single queue debug label. + * + * Requires VK_EXT_debug_utils support. Otherwise, the call is moot. + * + * @param in_label_name_ptr Meaning as per VkDebugUtilsLabelEXT::pLabelName. Must not be nullptr. + * @param in_color_vec4_ptr Meaning as per VkDebugUtilsLabelEXT::color. Must not be nullptr. + */ + void insert_debug_utils_label(const char* in_label_name_ptr, + const float* in_color_vec4_ptr); + /** Presents the specified swapchain image using this queue. This queue must support presentation * for the swapchain's rendering surface in order for this call to succeed. * @@ -290,6 +318,7 @@ namespace Anvil /* Private variables */ const Anvil::BaseDevice* m_device_ptr; + uint32_t m_n_debug_label_regions_started; VkQueue m_queue; uint32_t m_queue_family_index; uint32_t m_queue_index; diff --git a/include/wrappers/rendering_surface.h b/include/wrappers/rendering_surface.h index bfe71cce..33f4e936 100644 --- a/include/wrappers/rendering_surface.h +++ b/include/wrappers/rendering_surface.h @@ -170,9 +170,7 @@ namespace Anvil PhysicalDeviceCapabilities() { - memset(&capabilities, - 0, - sizeof(capabilities) ); + /* Stub */ } } PhysicalDeviceCapabilities; diff --git a/src/misc/debug_marker.cpp b/src/misc/debug_marker.cpp index 90663361..7838cf99 100644 --- a/src/misc/debug_marker.cpp +++ b/src/misc/debug_marker.cpp @@ -23,17 +23,34 @@ #include "misc/debug_marker.h" #include "misc/mt_safety.h" #include "wrappers/device.h" +#include "wrappers/instance.h" /** Please see header for specification */ -Anvil::DebugMarkerSupportProviderWorker::DebugMarkerSupportProviderWorker(const Anvil::BaseDevice* in_device_ptr, - VkDebugReportObjectTypeEXT in_vk_object_type) +Anvil::DebugMarkerSupportProviderWorker::DebugMarkerSupportProviderWorker(const Anvil::BaseDevice* in_device_ptr, + const Anvil::ObjectType& in_vk_object_type) :m_device_ptr (in_device_ptr), m_object_tag_name (0), m_vk_object_handle(VK_NULL_HANDLE), m_vk_object_type (in_vk_object_type) { - m_is_ext_debug_marker_available = m_device_ptr->get_extension_info()->ext_debug_marker(); - m_object_tag_name = 0; + const auto& device_extension_info_ptr = m_device_ptr->get_extension_info(); + const auto& instance_extension_info_ptr = m_device_ptr->get_parent_instance()->get_enabled_extensions_info(); + + if (instance_extension_info_ptr->ext_debug_utils() ) + { + m_used_api = DebugAPI::EXT_DEBUG_UTILS; + } + else + if (device_extension_info_ptr->ext_debug_marker() ) + { + m_used_api = DebugAPI::EXT_DEBUG_MARKER; + } + else + { + m_used_api = DebugAPI::NONE; + } + + m_object_tag_name = 0; } /** Please see header for specification */ @@ -46,28 +63,71 @@ void Anvil::DebugMarkerSupportProviderWorker::set_name_internal(const std::strin { m_object_name = in_object_name; - if (m_is_ext_debug_marker_available && - (m_vk_object_handle != VK_NULL_HANDLE) ) + if (m_vk_object_handle != VK_NULL_HANDLE) { - const auto& entrypoints(m_device_ptr->get_extension_ext_debug_marker_entrypoints() ); - VkDebugMarkerObjectNameInfoEXT name_info; - VkResult result_vk; + switch (m_used_api) + { + case DebugAPI::EXT_DEBUG_MARKER: + { + const auto& entrypoints(m_device_ptr->get_extension_ext_debug_marker_entrypoints() ); + VkDebugMarkerObjectNameInfoEXT name_info; + VkResult result_vk; - name_info.object = m_vk_object_handle; - name_info.objectType = m_vk_object_type; - name_info.pNext = nullptr; - name_info.pObjectName = in_object_name.c_str(); - name_info.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT; + name_info.object = m_vk_object_handle; + name_info.objectType = Anvil::Utils::get_vk_debug_report_object_type_ext_from_object_type(m_vk_object_type); + name_info.pNext = nullptr; + name_info.pObjectName = in_object_name.c_str(); + name_info.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT; - /* TODO: Host synchronization */ - { - result_vk = entrypoints.vkDebugMarkerSetObjectNameEXT(m_device_ptr->get_device_vk(), - &name_info); - } + if (name_info.objectType != VK_DEBUG_REPORT_OBJECT_TYPE_MAX_ENUM_EXT) + { + std::lock_guard lock(m_mutex); + { + result_vk = entrypoints.vkDebugMarkerSetObjectNameEXT(m_device_ptr->get_device_vk(), + &name_info); + + anvil_assert_vk_call_succeeded(result_vk); + ANVIL_REDUNDANT_VARIABLE (result_vk); + } + } + + break; + } + + case DebugAPI::EXT_DEBUG_UTILS: + { + const auto& entrypoints(m_device_ptr->get_parent_instance()->get_extension_ext_debug_utils_entrypoints() ); + VkDebugUtilsObjectNameInfoEXT name_info; + VkResult result_vk; - anvil_assert_vk_call_succeeded(result_vk); + name_info.objectHandle = m_vk_object_handle; + name_info.objectType = static_cast(m_vk_object_type); + name_info.pNext = nullptr; + name_info.pObjectName = in_object_name.c_str(); + name_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT; - ANVIL_REDUNDANT_VARIABLE(result_vk); + std::lock_guard lock(m_mutex); + { + result_vk = entrypoints.vkSetDebugUtilsObjectNameEXT(m_device_ptr->get_device_vk(), + &name_info); + + anvil_assert_vk_call_succeeded(result_vk); + ANVIL_REDUNDANT_VARIABLE (result_vk); + } + + break; + } + + case DebugAPI::NONE: + { + break; + } + + default: + { + anvil_assert_fail(); + } + } } } } @@ -106,29 +166,71 @@ void Anvil::DebugMarkerSupportProviderWorker::set_tag_internal(const uint64_t in in_tag_ptr, in_tag_size); - if (m_is_ext_debug_marker_available && - (m_vk_object_handle != VK_NULL_HANDLE) ) + if (m_vk_object_handle != VK_NULL_HANDLE) { - const auto& entrypoints(m_device_ptr->get_extension_ext_debug_marker_entrypoints() ); - VkResult result_vk; - VkDebugMarkerObjectTagInfoEXT tag_info; - - tag_info.object = m_vk_object_handle; - tag_info.objectType = m_vk_object_type; - tag_info.pNext = nullptr; - tag_info.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT; - tag_info.tagName = m_object_tag_name; - tag_info.tagSize = in_tag_size; - - /* TODO: Host synchronization */ + switch (m_used_api) { - result_vk = entrypoints.vkDebugMarkerSetObjectTagEXT(m_device_ptr->get_device_vk(), - &tag_info); - } + case DebugAPI::EXT_DEBUG_MARKER: + { + const auto& entrypoints(m_device_ptr->get_extension_ext_debug_marker_entrypoints() ); + VkResult result_vk; + VkDebugMarkerObjectTagInfoEXT tag_info; + + tag_info.object = m_vk_object_handle; + tag_info.objectType = Anvil::Utils::get_vk_debug_report_object_type_ext_from_object_type(m_vk_object_type); + tag_info.pNext = nullptr; + tag_info.pTag = in_tag_ptr; + tag_info.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT; + tag_info.tagName = m_object_tag_name; + tag_info.tagSize = in_tag_size; + + std::lock_guard lock(m_mutex); + { + result_vk = entrypoints.vkDebugMarkerSetObjectTagEXT(m_device_ptr->get_device_vk(), + &tag_info); + } - anvil_assert_vk_call_succeeded(result_vk); + anvil_assert_vk_call_succeeded(result_vk); - ANVIL_REDUNDANT_VARIABLE(result_vk); + ANVIL_REDUNDANT_VARIABLE(result_vk); + } + + case DebugAPI::EXT_DEBUG_UTILS: + { + const auto& entrypoints(m_device_ptr->get_parent_instance()->get_extension_ext_debug_utils_entrypoints() ); + VkDebugUtilsObjectTagInfoEXT name_info; + VkResult result_vk; + + name_info.objectHandle = m_vk_object_handle; + name_info.objectType = static_cast(m_vk_object_type); + name_info.pNext = nullptr; + name_info.pTag = in_tag_ptr; + name_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT; + name_info.tagName = m_object_tag_name; + name_info.tagSize = in_tag_size; + + std::lock_guard lock(m_mutex); + { + result_vk = entrypoints.vkSetDebugUtilsObjectTagEXT(m_device_ptr->get_device_vk(), + &name_info); + + anvil_assert_vk_call_succeeded(result_vk); + ANVIL_REDUNDANT_VARIABLE (result_vk); + } + + break; + } + + case DebugAPI::NONE: + { + break; + } + + default: + { + anvil_assert_fail(); + } + } } } } diff --git a/src/misc/debug_messenger_create_info.cpp b/src/misc/debug_messenger_create_info.cpp new file mode 100644 index 00000000..e222975d --- /dev/null +++ b/src/misc/debug_messenger_create_info.cpp @@ -0,0 +1,52 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#include "misc/debug_messenger_create_info.h" + +Anvil::DebugMessengerCreateInfo::DebugMessengerCreateInfo(Anvil::Instance* in_instance_ptr, + const Anvil::DebugMessageSeverityFlags& in_debug_message_severity_flags, + const Anvil::DebugMessageTypeFlags& in_debug_message_type_flags, + Anvil::DebugMessengerCallbackFunction in_callback_function) + :m_callback_function (in_callback_function), + m_debug_message_severity_flags(in_debug_message_severity_flags), + m_debug_message_type_flags (in_debug_message_type_flags), + m_instance_ptr (in_instance_ptr) +{ + /* Stub */ +} + +Anvil::DebugMessengerCreateInfoUniquePtr Anvil::DebugMessengerCreateInfo::create(Anvil::Instance* in_instance_ptr, + const Anvil::DebugMessageSeverityFlags& in_debug_message_severity_flags, + const Anvil::DebugMessageTypeFlags& in_debug_message_type_flags, + Anvil::DebugMessengerCallbackFunction in_callback_function) +{ + Anvil::DebugMessengerCreateInfoUniquePtr result_ptr; + + result_ptr.reset( + new DebugMessengerCreateInfo(in_instance_ptr, + in_debug_message_severity_flags, + in_debug_message_type_flags, + in_callback_function) + ); + anvil_assert(result_ptr != nullptr); + + return result_ptr; +} \ No newline at end of file diff --git a/src/misc/glsl_to_spirv.cpp b/src/misc/glsl_to_spirv.cpp index 0981c98a..6c58aec4 100644 --- a/src/misc/glsl_to_spirv.cpp +++ b/src/misc/glsl_to_spirv.cpp @@ -35,6 +35,12 @@ #endif #ifdef ANVIL_LINK_WITH_GLSLANG + #ifdef max + #undef max + #endif + #ifdef min + #undef min + #endif #undef snprintf #if defined(_MSC_VER) @@ -258,7 +264,7 @@ Anvil::GLSLShaderToSPIRVGenerator::~GLSLShaderToSPIRVGenerator() { auto object_tracker_ptr = Anvil::ObjectTracker::get(); - object_tracker_ptr->unregister_object(Anvil::OBJECT_TYPE_GLSL_SHADER_TO_SPIRV_GENERATOR, + object_tracker_ptr->unregister_object(Anvil::ObjectType::ANVIL_GLSL_SHADER_TO_SPIRV_GENERATOR, this); m_spirv_blob.clear(); @@ -515,7 +521,7 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() const do { - auto shader_module_raw_ptr = object_tracker_ptr->get_object_at_index (Anvil::OBJECT_TYPE_SHADER_MODULE, + auto shader_module_raw_ptr = object_tracker_ptr->get_object_at_index (Anvil::ObjectType::SHADER_MODULE, n_current_shader_module); const Anvil::ShaderModule* shader_module_ptr = reinterpret_cast(shader_module_raw_ptr); @@ -873,7 +879,7 @@ Anvil::GLSLShaderToSPIRVGeneratorUniquePtr Anvil::GLSLShaderToSPIRVGenerator::cr in_shader_stage) ); - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_GLSL_SHADER_TO_SPIRV_GENERATOR, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::ANVIL_GLSL_SHADER_TO_SPIRV_GENERATOR, result_ptr.get() ); return result_ptr; diff --git a/src/misc/graphics_pipeline_create_info.cpp b/src/misc/graphics_pipeline_create_info.cpp index 0498e32c..c081d3b2 100644 --- a/src/misc/graphics_pipeline_create_info.cpp +++ b/src/misc/graphics_pipeline_create_info.cpp @@ -75,13 +75,14 @@ Anvil::GraphicsPipelineCreateInfo::GraphicsPipelineCreateInfo(const RenderPass* 0, sizeof(m_blend_constant) ); - m_cull_mode = Anvil::CullModeFlagBits::BACK_BIT; - m_line_width = 1.0f; - m_min_sample_shading = 1.0f; - m_sample_count = Anvil::SampleCountFlagBits::_1_BIT; - m_polygon_mode = Anvil::PolygonMode::FILL; - m_primitive_topology = Anvil::PrimitiveTopology::TRIANGLE_LIST; - m_sample_mask = ~0u; + m_cull_mode = Anvil::CullModeFlagBits::BACK_BIT; + m_line_width = 1.0f; + m_min_sample_shading = 1.0f; + m_sample_count = Anvil::SampleCountFlagBits::_1_BIT; + m_polygon_mode = Anvil::PolygonMode::FILL; + m_primitive_topology = Anvil::PrimitiveTopology::TRIANGLE_LIST; + m_rasterization_stream_index = 0; + m_sample_mask = ~0u; m_tessellation_domain_origin = Anvil::TessellationDomainOrigin::UPPER_LEFT; } @@ -966,6 +967,11 @@ void Anvil::GraphicsPipelineCreateInfo::set_rasterization_order(Anvil::Rasteriza m_rasterization_order = in_rasterization_order; } +void Anvil::GraphicsPipelineCreateInfo::set_rasterization_stream_index(const uint32_t& in_rasterization_stream_index) +{ + m_rasterization_stream_index = in_rasterization_stream_index; +} + void Anvil::GraphicsPipelineCreateInfo::set_rasterization_properties(Anvil::PolygonMode in_polygon_mode, Anvil::CullModeFlags in_cull_mode, Anvil::FrontFace in_front_face, diff --git a/src/misc/object_tracker.cpp b/src/misc/object_tracker.cpp index 87fa3c0f..33eafe4e 100644 --- a/src/misc/object_tracker.cpp +++ b/src/misc/object_tracker.cpp @@ -32,9 +32,7 @@ static Anvil::ObjectTracker* object_tracker_ptr = nullptr; Anvil::ObjectTracker::ObjectTracker() :CallbacksSupportProvider(OBJECT_TRACKER_CALLBACK_ID_COUNT) { - memset(m_n_objects_allocated_array, - 0, - sizeof(m_n_objects_allocated_array) ); + /* Stub */ } /* Please see header for specification */ @@ -61,26 +59,22 @@ void Anvil::ObjectTracker::check_for_leaks() const { std::unique_lock lock(m_cs); - for (ObjectType current_object_type = OBJECT_TYPE_FIRST; - current_object_type < OBJECT_TYPE_COUNT; - current_object_type = static_cast(current_object_type + 1)) + for (const auto& current_object_type_alloc_data : m_object_allocations) { - const uint32_t n_object_allocations = (uint32_t) m_object_allocations[current_object_type].size(); + const uint32_t n_object_allocations = static_cast(current_object_type_alloc_data.second.size() ); if (n_object_allocations > 0) { fprintf(stdout, "The following %s instances have not been released:\n", - get_object_type_name(current_object_type) ); + get_object_type_name(current_object_type_alloc_data.first) ); - for (uint32_t n_allocation = 0; - n_allocation < n_object_allocations; - ++n_allocation) + for (const auto& current_alloc : current_object_type_alloc_data.second) { fprintf(stdout, "[%d]. %p\n", - m_object_allocations[current_object_type][n_allocation].n_allocation, - m_object_allocations[current_object_type][n_allocation].object_ptr); + current_alloc.n_allocation, + current_alloc.object_ptr); } fprintf(stdout, @@ -95,62 +89,63 @@ void Anvil::ObjectTracker::check_for_leaks() const * * @return As per description. **/ -const char* Anvil::ObjectTracker::get_object_type_name(ObjectType in_object_type) const +const char* Anvil::ObjectTracker::get_object_type_name(const Anvil::ObjectType& in_object_type) const { - static const char* result_array[] = + const char* result_ptr = "?!"; + + switch (in_object_type) { - "Buffer", - "Buffer View", - "Command Buffer", - "Command Pool", - "Compute Pipeline Manager", - "Descriptor Pool", - "Descriptor Set", - "Descriptor Set Group", - "Descriptor Set Layout", - "Descriptor Set Layout Manager", - "Descriptor Update Template", - "Device", - "Event", - "Fence", - "Framebuffer", - "Graphics Pipeline Manager", - "Image", - "Image View", - "Instance", - "Memory Block", - "Physical Device", - "Pipeline Cache", - "Pipeline Layout", - "Pipeline Layout Manager", - "Query Pool", - "Queue", - "Render Pass", - "Rendering Surface", - "Sampler", - "Semaphore", - "Shader Module", - "Swapchain", - - "GLSL shader -> SPIR-V generator", - "Graphics Pipeline (fake)" - }; - - static_assert(sizeof(result_array) / sizeof(result_array[0]) == OBJECT_TYPE_COUNT, - "Number of object types change detected - update result_array."); - - return result_array[in_object_type]; + case Anvil::ObjectType::BUFFER: result_ptr = "Buffer"; break; + case Anvil::ObjectType::BUFFER_VIEW: result_ptr = "Buffer View"; break; + case Anvil::ObjectType::COMMAND_BUFFER: result_ptr = "Command Buffer"; break; + case Anvil::ObjectType::COMMAND_POOL: result_ptr = "Command Pool"; break; + case Anvil::ObjectType::DESCRIPTOR_POOL: result_ptr = "Descriptor Pool"; break; + case Anvil::ObjectType::DESCRIPTOR_SET: result_ptr = "Descriptor Set"; break; + case Anvil::ObjectType::DESCRIPTOR_SET_LAYOUT: result_ptr = "Descriptor Set Layout"; break; + case Anvil::ObjectType::DESCRIPTOR_UPDATE_TEMPLATE: result_ptr = "Descriptor Update Template"; break; + case Anvil::ObjectType::DEVICE: result_ptr = "Device"; break; + case Anvil::ObjectType::EVENT: result_ptr = "Event"; break; + case Anvil::ObjectType::FENCE: result_ptr = "Fence"; break; + case Anvil::ObjectType::FRAMEBUFFER: result_ptr = "Framebuffer"; break; + case Anvil::ObjectType::IMAGE: result_ptr = "Image"; break; + case Anvil::ObjectType::IMAGE_VIEW: result_ptr = "Image View"; break; + case Anvil::ObjectType::INSTANCE: result_ptr = "Instance"; break; + case Anvil::ObjectType::PHYSICAL_DEVICE: result_ptr = "Physical Device"; break; + case Anvil::ObjectType::PIPELINE_CACHE: result_ptr = "Pipeline Cache"; break; + case Anvil::ObjectType::PIPELINE_LAYOUT: result_ptr = "Pipeline Layout"; break; + case Anvil::ObjectType::QUERY_POOL: result_ptr = "Query Pool"; break; + case Anvil::ObjectType::QUEUE: result_ptr = "Queue"; break; + case Anvil::ObjectType::RENDER_PASS: result_ptr = "Render Pass"; break; + case Anvil::ObjectType::RENDERING_SURFACE: result_ptr = "Rendering Surface"; break; + case Anvil::ObjectType::SAMPLER: result_ptr = "Sampler"; break; + case Anvil::ObjectType::SEMAPHORE: result_ptr = "Semaphore"; break; + case Anvil::ObjectType::SHADER_MODULE: result_ptr = "Shader Module"; break; + case Anvil::ObjectType::SWAPCHAIN: result_ptr = "Swapchain"; break; + + case Anvil::ObjectType::ANVIL_COMPUTE_PIPELINE_MANAGER: result_ptr = "Anvil Compute Pipeline Manager"; break; + case Anvil::ObjectType::ANVIL_DESCRIPTOR_SET_GROUP: result_ptr = "Anvil Descriptor Set Group"; break; + case Anvil::ObjectType::ANVIL_DESCRIPTOR_SET_LAYOUT_MANAGER: result_ptr = "Anvil Descriptor Set Layout Manager"; break; + case Anvil::ObjectType::ANVIL_GLSL_SHADER_TO_SPIRV_GENERATOR: result_ptr = "Anvil GLSL Shader->SPIRV Generator"; break; + case Anvil::ObjectType::ANVIL_GRAPHICS_PIPELINE_MANAGER: result_ptr = "Anvil Graphics Pipeline Manager"; break; + case Anvil::ObjectType::ANVIL_MEMORY_BLOCK: result_ptr = "Anvil Memory Block"; break; + case Anvil::ObjectType::ANVIL_PIPELINE_LAYOUT_MANAGER: result_ptr = "Anvil Pipeline Layout Manager"; break; + + default: + { + anvil_assert_fail(); + } + } + + return result_ptr; } /* Please see header for specification */ -void* Anvil::ObjectTracker::get_object_at_index(ObjectType in_object_type, - uint32_t in_alloc_index) const +void* Anvil::ObjectTracker::get_object_at_index(const ObjectType& in_object_type, + uint32_t in_alloc_index) const { std::unique_lock lock (m_cs); void* result(nullptr); - anvil_assert(in_object_type < OBJECT_TYPE_COUNT); - if (m_object_allocations[in_object_type].size() > in_alloc_index) { result = m_object_allocations[in_object_type][in_alloc_index].object_ptr; @@ -160,11 +155,10 @@ void* Anvil::ObjectTracker::get_object_at_index(ObjectType in_object_type, } /* Please see header for specification */ -void Anvil::ObjectTracker::register_object(ObjectType in_object_type, - void* in_object_ptr) +void Anvil::ObjectTracker::register_object(const ObjectType& in_object_type, + void* in_object_ptr) { - anvil_assert(in_object_ptr != nullptr); - anvil_assert(in_object_type < OBJECT_TYPE_COUNT); + anvil_assert(in_object_ptr != nullptr); { std::unique_lock lock(m_cs); @@ -177,13 +171,13 @@ void Anvil::ObjectTracker::register_object(ObjectType in_object_type, OnObjectRegisteredCallbackArgument callback_arg(in_object_type, in_object_ptr); - if (in_object_type == OBJECT_TYPE_GLSL_SHADER_TO_SPIRV_GENERATOR) + if (in_object_type == Anvil::ObjectType::ANVIL_GLSL_SHADER_TO_SPIRV_GENERATOR) { callback_safe(OBJECT_TRACKER_CALLBACK_ID_ON_GLSL_SHADER_TO_SPIRV_GENERATOR_OBJECT_REGISTERED, &callback_arg); } else - if (in_object_type == OBJECT_TYPE_SHADER_MODULE) + if (in_object_type == Anvil::ObjectType::SHADER_MODULE) { callback_safe(OBJECT_TRACKER_CALLBACK_ID_ON_SHADER_MODULE_OBJECT_REGISTERED, &callback_arg); @@ -191,8 +185,8 @@ void Anvil::ObjectTracker::register_object(ObjectType in_object_type, } /* Please see header for specification */ -void Anvil::ObjectTracker::unregister_object(ObjectType in_object_type, - void* in_object_ptr) +void Anvil::ObjectTracker::unregister_object(const ObjectType& in_object_type, + void* in_object_ptr) { OnObjectAboutToBeUnregisteredCallbackArgument callback_arg(in_object_type, in_object_ptr); @@ -214,25 +208,25 @@ void Anvil::ObjectTracker::unregister_object(ObjectType in_object_type, } /* Notify any observers about the event. */ - if (in_object_type == OBJECT_TYPE_DEVICE) + if (in_object_type == Anvil::ObjectType::DEVICE) { callback_safe(OBJECT_TRACKER_CALLBACK_ID_ON_DEVICE_OBJECT_ABOUT_TO_BE_UNREGISTERED, &callback_arg); } else - if (in_object_type == OBJECT_TYPE_GLSL_SHADER_TO_SPIRV_GENERATOR) + if (in_object_type == Anvil::ObjectType::ANVIL_GLSL_SHADER_TO_SPIRV_GENERATOR) { callback_safe(OBJECT_TRACKER_CALLBACK_ID_ON_GLSL_SHADER_TO_SPIRV_GENERATOR_OBJECT_ABOUT_TO_BE_UNREGISTERED, &callback_arg); } else - if (in_object_type == OBJECT_TYPE_PIPELINE_LAYOUT) + if (in_object_type == Anvil::ObjectType::PIPELINE_LAYOUT) { callback_safe(OBJECT_TRACKER_CALLBACK_ID_ON_PIPELINE_LAYOUT_OBJECT_ABOUT_TO_BE_UNREGISTERED, &callback_arg); } else - if (in_object_type == OBJECT_TYPE_SHADER_MODULE) + if (in_object_type == Anvil::ObjectType::SHADER_MODULE) { callback_safe(OBJECT_TRACKER_CALLBACK_ID_ON_SHADER_MODULE_OBJECT_ABOUT_TO_BE_UNREGISTERED, &callback_arg); diff --git a/src/misc/types.cpp b/src/misc/types.cpp index e34c8924..36477b3f 100644 --- a/src/misc/types.cpp +++ b/src/misc/types.cpp @@ -27,6 +27,8 @@ INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::BufferUsageFlags, INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::ColorComponentFlags, VkColorComponentFlags, Anvil::ColorComponentFlagBits); INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::CompositeAlphaFlags, VkCompositeAlphaFlagsKHR, Anvil::CompositeAlphaFlagBits); INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::CullModeFlags, VkCullModeFlags, Anvil::CullModeFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::DebugMessageSeverityFlags, VkDebugUtilsMessageSeverityFlagsEXT, Anvil::DebugMessageSeverityFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::DebugMessageTypeFlags, VkDebugUtilsMessageTypeFlagsEXT, Anvil::DebugMessageTypeFlagBits); INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::DependencyFlags, VkDependencyFlags, Anvil::DependencyFlagBits); INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::DescriptorBindingFlags, VkDescriptorBindingFlagsEXT, Anvil::DescriptorBindingFlagBits); INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::DescriptorPoolCreateFlags, VkDescriptorPoolCreateFlags, Anvil::DescriptorPoolCreateFlagBits); diff --git a/src/misc/types_struct.cpp b/src/misc/types_struct.cpp index a053c05c..44c0b055 100644 --- a/src/misc/types_struct.cpp +++ b/src/misc/types_struct.cpp @@ -162,6 +162,13 @@ Anvil::BufferMemoryBindingUpdate::BufferMemoryBindingUpdate() memory_block_ptr = nullptr; } +Anvil::DebugObjectNameInfo::DebugObjectNameInfo(const VkDebugUtilsObjectNameInfoEXT& in_name_info_vk) +{ + object_handle = in_name_info_vk.objectHandle; + object_name_ptr = in_name_info_vk.pObjectName; + object_type = Anvil::Utils::get_object_type_for_vk_object_type(in_name_info_vk.objectType); +} + Anvil::DescriptorSetAllocation::DescriptorSetAllocation(const Anvil::DescriptorSetLayout* in_ds_layout_ptr) { anvil_assert( in_ds_layout_ptr != nullptr); @@ -337,9 +344,25 @@ Anvil::ExtensionEXTDebugMarkerEntrypoints::ExtensionEXTDebugMarkerEntrypoints() Anvil::ExtensionEXTDebugReportEntrypoints::ExtensionEXTDebugReportEntrypoints() { vkCreateDebugReportCallbackEXT = nullptr; + vkDebugReportMessageEXT = nullptr; vkDestroyDebugReportCallbackEXT = nullptr; } +Anvil::ExtensionEXTDebugUtilsEntrypoints::ExtensionEXTDebugUtilsEntrypoints() +{ + vkCmdBeginDebugUtilsLabelEXT = nullptr; + vkCmdEndDebugUtilsLabelEXT = nullptr; + vkCmdInsertDebugUtilsLabelEXT = nullptr; + vkCreateDebugUtilsMessengerEXT = nullptr; + vkDestroyDebugUtilsMessengerEXT = nullptr; + vkSetDebugUtilsObjectNameEXT = nullptr; + vkSetDebugUtilsObjectTagEXT = nullptr; + vkQueueBeginDebugUtilsLabelEXT = nullptr; + vkQueueEndDebugUtilsLabelEXT = nullptr; + vkQueueInsertDebugUtilsLabelEXT = nullptr; + vkSubmitDebugUtilsMessageEXT = nullptr; +} + Anvil::ExtensionEXTExternalMemoryHostEntrypoints::ExtensionEXTExternalMemoryHostEntrypoints() { vkGetMemoryHostPointerPropertiesEXT = nullptr; @@ -356,6 +379,16 @@ Anvil::ExtensionEXTSampleLocationsEntrypoints::ExtensionEXTSampleLocationsEntryp vkGetPhysicalDeviceMultisamplePropertiesEXT = nullptr; } +Anvil::ExtensionEXTTransformFeedbackEntrypoints::ExtensionEXTTransformFeedbackEntrypoints() +{ + vkCmdBeginQueryIndexedEXT = nullptr; + vkCmdBeginTransformFeedbackEXT = nullptr; + vkCmdBindTransformFeedbackBuffersEXT = nullptr; + vkCmdDrawIndirectByteCountEXT = nullptr; + vkCmdEndQueryIndexedEXT = nullptr; + vkCmdEndTransformFeedbackEXT = nullptr; +} + Anvil::ExtensionKHRDeviceGroupEntrypoints::ExtensionKHRDeviceGroupEntrypoints() { vkAcquireNextImage2KHR = nullptr; @@ -780,6 +813,82 @@ bool Anvil::EXTSamplerFilterMinmaxProperties::operator==(const Anvil::EXTSampler filter_minmax_single_component_formats == in_props.filter_minmax_single_component_formats); } +Anvil::EXTTransformFeedbackFeatures::EXTTransformFeedbackFeatures() + :geometry_streams (false), + transform_feedback(false) +{ + /* Stub */ +} + +Anvil::EXTTransformFeedbackFeatures::EXTTransformFeedbackFeatures(const VkPhysicalDeviceTransformFeedbackFeaturesEXT& in_features) + :geometry_streams (in_features.geometryStreams == VK_TRUE), + transform_feedback(in_features.transformFeedback == VK_TRUE) +{ + /* Stub */ +} + +VkPhysicalDeviceTransformFeedbackFeaturesEXT Anvil::EXTTransformFeedbackFeatures::get_vk_physical_device_transform_feedback_features() const +{ + VkPhysicalDeviceTransformFeedbackFeaturesEXT result; + + result.geometryStreams = (geometry_streams) ? VK_TRUE : VK_FALSE; + result.pNext = nullptr; + result.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT; + result.transformFeedback = (transform_feedback) ? VK_TRUE : VK_FALSE; + + return result; +} + +bool Anvil::EXTTransformFeedbackFeatures::operator==(const EXTTransformFeedbackFeatures& in_features) const +{ + return (in_features.geometry_streams == geometry_streams && + in_features.transform_feedback == transform_feedback); +} + +Anvil::EXTTransformFeedbackProperties::EXTTransformFeedbackProperties() + :max_transform_feedback_buffer_data_size (0), + max_transform_feedback_buffer_data_stride (0), + max_transform_feedback_buffer_size (0), + max_transform_feedback_stream_data_size (0), + n_max_transform_feedback_buffers (0), + n_max_transform_feedback_streams (0), + supports_transform_feedback_draw (false), + supports_transform_feedback_queries (false), + supports_transform_feedback_rasterization_stream_select(false), + supports_transform_feedback_streams_lines_triangles (false) +{ + /* Stub */ +} + +Anvil::EXTTransformFeedbackProperties::EXTTransformFeedbackProperties(const VkPhysicalDeviceTransformFeedbackPropertiesEXT& in_props) + :max_transform_feedback_buffer_data_size (in_props.maxTransformFeedbackBufferDataSize), + max_transform_feedback_buffer_data_stride (in_props.maxTransformFeedbackBufferDataStride), + max_transform_feedback_buffer_size (in_props.maxTransformFeedbackBufferSize), + max_transform_feedback_stream_data_size (in_props.maxTransformFeedbackStreamDataSize), + n_max_transform_feedback_buffers (in_props.maxTransformFeedbackBuffers), + n_max_transform_feedback_streams (in_props.maxTransformFeedbackStreams), + supports_transform_feedback_draw (in_props.transformFeedbackDraw == VK_TRUE), + supports_transform_feedback_queries (in_props.transformFeedbackQueries == VK_TRUE), + supports_transform_feedback_rasterization_stream_select(in_props.transformFeedbackRasterizationStreamSelect == VK_TRUE), + supports_transform_feedback_streams_lines_triangles (in_props.transformFeedbackStreamsLinesTriangles == VK_TRUE) +{ + /* Stub */ +} + +bool Anvil::EXTTransformFeedbackProperties::operator==(const Anvil::EXTTransformFeedbackProperties& in_props) const +{ + return (max_transform_feedback_buffer_data_size == in_props.max_transform_feedback_buffer_data_size && + max_transform_feedback_buffer_data_stride == in_props.max_transform_feedback_buffer_data_stride && + max_transform_feedback_buffer_size == in_props.max_transform_feedback_buffer_size && + max_transform_feedback_stream_data_size == in_props.max_transform_feedback_stream_data_size && + n_max_transform_feedback_buffers == in_props.n_max_transform_feedback_buffers && + n_max_transform_feedback_streams == in_props.n_max_transform_feedback_streams && + supports_transform_feedback_draw == in_props.supports_transform_feedback_draw && + supports_transform_feedback_queries == in_props.supports_transform_feedback_queries && + supports_transform_feedback_rasterization_stream_select == in_props.supports_transform_feedback_rasterization_stream_select && + supports_transform_feedback_streams_lines_triangles == in_props.supports_transform_feedback_streams_lines_triangles); +} + Anvil::EXTVertexAttributeDivisorProperties::EXTVertexAttributeDivisorProperties() :max_vertex_attribute_divisor(0) { @@ -1869,6 +1978,7 @@ Anvil::PhysicalDeviceProperties::PhysicalDeviceProperties() ext_pci_bus_info_properties_ptr = nullptr; ext_sample_locations_properties_ptr = nullptr; ext_sampler_filter_minmax_properties_ptr = nullptr; + ext_transform_feedback_properties_ptr = nullptr; ext_vertex_attribute_divisor_properties_ptr = nullptr; khr_external_memory_capabilities_physical_device_id_properties_ptr = nullptr; khr_maintenance2_point_clipping_properties_ptr = nullptr; @@ -1883,6 +1993,7 @@ Anvil::PhysicalDeviceProperties::PhysicalDeviceProperties(const AMDShaderCorePro const EXTPCIBusInfoProperties* in_ext_pci_bus_info_properties_ptr, const EXTSampleLocationsProperties* in_ext_sample_locations_properties_ptr, const EXTSamplerFilterMinmaxProperties* in_ext_sampler_filter_minmax_properties_ptr, + const EXTTransformFeedbackProperties* in_ext_transform_feedback_properties_ptr, const EXTVertexAttributeDivisorProperties* in_ext_vertex_attribute_divisor_properties_ptr, const Anvil::KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties* in_khr_external_memory_caps_physical_device_id_props_ptr, const KHRMaintenance3Properties* in_khr_maintenance3_properties_ptr, @@ -1895,6 +2006,7 @@ Anvil::PhysicalDeviceProperties::PhysicalDeviceProperties(const AMDShaderCorePro ext_pci_bus_info_properties_ptr (in_ext_pci_bus_info_properties_ptr), ext_sample_locations_properties_ptr (in_ext_sample_locations_properties_ptr), ext_sampler_filter_minmax_properties_ptr (in_ext_sampler_filter_minmax_properties_ptr), + ext_transform_feedback_properties_ptr (in_ext_transform_feedback_properties_ptr), ext_vertex_attribute_divisor_properties_ptr (in_ext_vertex_attribute_divisor_properties_ptr), khr_external_memory_capabilities_physical_device_id_properties_ptr(in_khr_external_memory_caps_physical_device_id_props_ptr), khr_maintenance2_point_clipping_properties_ptr (in_khr_maintenance2_point_clipping_properties_ptr), @@ -1923,6 +2035,7 @@ Anvil::PhysicalDeviceFeatures::PhysicalDeviceFeatures() { core_vk1_0_features_ptr = nullptr; ext_descriptor_indexing_features_ptr = nullptr; + ext_transform_feedback_features_ptr = nullptr; khr_16bit_storage_features_ptr = nullptr; khr_8bit_storage_features_ptr = nullptr; khr_multiview_features_ptr = nullptr; @@ -1931,6 +2044,7 @@ Anvil::PhysicalDeviceFeatures::PhysicalDeviceFeatures() Anvil::PhysicalDeviceFeatures::PhysicalDeviceFeatures(const PhysicalDeviceFeaturesCoreVK10* in_core_vk1_0_features_ptr, const EXTDescriptorIndexingFeatures* in_ext_descriptor_indexing_features_ptr, + const EXTTransformFeedbackFeatures* in_ext_transform_feedback_features_ptr, const KHR16BitStorageFeatures* in_khr_16_bit_storage_features_ptr, const KHR8BitStorageFeatures* in_khr_8_bit_storage_features_ptr, const KHRMultiviewFeatures* in_khr_multiview_features_ptr, @@ -1938,6 +2052,7 @@ Anvil::PhysicalDeviceFeatures::PhysicalDeviceFeatures(const PhysicalDeviceFeatur { core_vk1_0_features_ptr = in_core_vk1_0_features_ptr; ext_descriptor_indexing_features_ptr = in_ext_descriptor_indexing_features_ptr; + ext_transform_feedback_features_ptr = in_ext_transform_feedback_features_ptr; khr_16bit_storage_features_ptr = in_khr_16_bit_storage_features_ptr; khr_8bit_storage_features_ptr = in_khr_8_bit_storage_features_ptr; khr_multiview_features_ptr = in_khr_multiview_features_ptr; @@ -2619,11 +2734,34 @@ bool Anvil::PhysicalDeviceFeatures::operator==(const PhysicalDeviceFeatures& in_ { const bool core_vk1_0_features_match = (*core_vk1_0_features_ptr == *in_physical_device_features.core_vk1_0_features_ptr); bool ext_descriptor_indexing_features_match = false; + bool ext_transform_feedback_features_match = false; bool khr_16bit_storage_features_match = false; bool khr_8bit_storage_features_match = false; bool khr_multiview_features_match = false; bool khr_variable_pointer_features_match = false; + if (ext_descriptor_indexing_features_ptr != nullptr && + in_physical_device_features.ext_descriptor_indexing_features_ptr != nullptr) + { + ext_descriptor_indexing_features_match = (*ext_descriptor_indexing_features_ptr == *in_physical_device_features.ext_descriptor_indexing_features_ptr); + } + else + { + ext_descriptor_indexing_features_match = (ext_descriptor_indexing_features_ptr == nullptr && + in_physical_device_features.ext_descriptor_indexing_features_ptr == nullptr); + } + + if (ext_transform_feedback_features_ptr != nullptr && + in_physical_device_features.ext_transform_feedback_features_ptr != nullptr) + { + ext_transform_feedback_features_match = (*ext_transform_feedback_features_ptr == *in_physical_device_features.ext_transform_feedback_features_ptr); + } + else + { + ext_transform_feedback_features_match = (ext_transform_feedback_features_ptr == nullptr && + in_physical_device_features.ext_transform_feedback_features_ptr == nullptr); + } + if (khr_16bit_storage_features_ptr != nullptr && in_physical_device_features.khr_16bit_storage_features_ptr != nullptr) { @@ -2646,17 +2784,6 @@ bool Anvil::PhysicalDeviceFeatures::operator==(const PhysicalDeviceFeatures& in_ in_physical_device_features.khr_8bit_storage_features_ptr == nullptr); } - if (ext_descriptor_indexing_features_ptr != nullptr && - in_physical_device_features.ext_descriptor_indexing_features_ptr != nullptr) - { - ext_descriptor_indexing_features_match = (*ext_descriptor_indexing_features_ptr == *in_physical_device_features.ext_descriptor_indexing_features_ptr); - } - else - { - ext_descriptor_indexing_features_match = (ext_descriptor_indexing_features_ptr == nullptr && - in_physical_device_features.ext_descriptor_indexing_features_ptr == nullptr); - } - if (khr_multiview_features_ptr != nullptr && in_physical_device_features.khr_multiview_features_ptr != nullptr) { @@ -2681,6 +2808,7 @@ bool Anvil::PhysicalDeviceFeatures::operator==(const PhysicalDeviceFeatures& in_ return core_vk1_0_features_match && ext_descriptor_indexing_features_match && + ext_transform_feedback_features_match && khr_16bit_storage_features_match && khr_8bit_storage_features_match && khr_multiview_features_match && diff --git a/src/misc/types_utils.cpp b/src/misc/types_utils.cpp index 2220de08..11439386 100644 --- a/src/misc/types_utils.cpp +++ b/src/misc/types_utils.cpp @@ -308,6 +308,57 @@ Anvil::AccessFlags Anvil::Utils::get_access_mask_from_image_layout(Anvil::ImageL return result; } +/* Please see header for specification */ +Anvil::ObjectType Anvil::Utils::get_object_type_for_vk_debug_report_object_type(const VkDebugReportObjectTypeEXT& in_object_type) +{ + Anvil::ObjectType result = Anvil::ObjectType::UNKNOWN; + + switch (in_object_type) + { + case VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT: result = Anvil::ObjectType::BUFFER; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT: result = Anvil::ObjectType::BUFFER_VIEW; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT: result = Anvil::ObjectType::COMMAND_BUFFER; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT: result = Anvil::ObjectType::COMMAND_POOL; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT: result = Anvil::ObjectType::DEBUG_REPORT_CALLBACK; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT: result = Anvil::ObjectType::DESCRIPTOR_POOL; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT: result = Anvil::ObjectType::DESCRIPTOR_SET; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT: result = Anvil::ObjectType::DESCRIPTOR_SET_LAYOUT; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT: result = Anvil::ObjectType::DESCRIPTOR_UPDATE_TEMPLATE; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT: result = Anvil::ObjectType::DEVICE; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT: result = Anvil::ObjectType::ANVIL_MEMORY_BLOCK; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT: result = Anvil::ObjectType::EVENT; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT: result = Anvil::ObjectType::FENCE; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT: result = Anvil::ObjectType::FRAMEBUFFER; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT: result = Anvil::ObjectType::IMAGE; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT: result = Anvil::ObjectType::IMAGE_VIEW; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT: result = Anvil::ObjectType::INSTANCE; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT: result = Anvil::ObjectType::PHYSICAL_DEVICE; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT: result = Anvil::ObjectType::PIPELINE_CACHE; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT: result = Anvil::ObjectType::PIPELINE_LAYOUT; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT: result = Anvil::ObjectType::QUEUE; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT: result = Anvil::ObjectType::QUERY_POOL; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT: result = Anvil::ObjectType::RENDER_PASS; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT: result = Anvil::ObjectType::SAMPLER; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT: result = Anvil::ObjectType::SEMAPHORE; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT: result = Anvil::ObjectType::SHADER_MODULE; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT: result = Anvil::ObjectType::RENDERING_SURFACE; break; + case VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT: result = Anvil::ObjectType::SWAPCHAIN; break; + + default: + { + anvil_assert_fail(); + } + } + + return result; +} + +/* Please see header for specification */ +Anvil::ObjectType Anvil::Utils::get_object_type_for_vk_object_type(const VkObjectType& in_object_type) +{ + return static_cast(in_object_type); +} + /* Please see header for specification */ Anvil::QueueFamilyFlags Anvil::Utils::get_queue_family_flags_from_queue_family_type(Anvil::QueueFamilyType in_queue_family_type) { @@ -852,6 +903,98 @@ Anvil::ShaderStageFlagBits Anvil::Utils::get_shader_stage_flag_bits_from_shader_ return result; } +/* Please see header for specification */ +VkDebugReportObjectTypeEXT Anvil::Utils::get_vk_debug_report_object_type_ext_from_object_type(const Anvil::ObjectType& in_object_type) +{ + VkDebugReportObjectTypeEXT result = VK_DEBUG_REPORT_OBJECT_TYPE_MAX_ENUM_EXT; + + switch (in_object_type) + { + case Anvil::ObjectType::BUFFER: result = VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT; break; + case Anvil::ObjectType::BUFFER_VIEW: result = VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT; break; + case Anvil::ObjectType::COMMAND_BUFFER: result = VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT; break; + case Anvil::ObjectType::COMMAND_POOL: result = VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT; break; + case Anvil::ObjectType::DESCRIPTOR_POOL: result = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT; break; + case Anvil::ObjectType::DESCRIPTOR_SET: result = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT; break; + case Anvil::ObjectType::DESCRIPTOR_SET_LAYOUT: result = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT; break; + case Anvil::ObjectType::DESCRIPTOR_UPDATE_TEMPLATE: result = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT; break; + case Anvil::ObjectType::DEVICE: result = VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT; break; + case Anvil::ObjectType::EVENT: result = VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT; break; + case Anvil::ObjectType::FENCE: result = VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT; break; + case Anvil::ObjectType::FRAMEBUFFER: result = VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT; break; + case Anvil::ObjectType::IMAGE: result = VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT; break; + case Anvil::ObjectType::IMAGE_VIEW: result = VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT; break; + case Anvil::ObjectType::INSTANCE: result = VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT; break; + case Anvil::ObjectType::PHYSICAL_DEVICE: result = VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT; break; + case Anvil::ObjectType::PIPELINE_CACHE: result = VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT; break; + case Anvil::ObjectType::PIPELINE_LAYOUT: result = VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT; break; + case Anvil::ObjectType::QUERY_POOL: result = VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT; break; + case Anvil::ObjectType::QUEUE: result = VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT; break; + case Anvil::ObjectType::RENDER_PASS: result = VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT; break; + case Anvil::ObjectType::RENDERING_SURFACE: result = VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT; break; + case Anvil::ObjectType::SAMPLER: result = VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT; break; + case Anvil::ObjectType::SEMAPHORE: result = VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT; break; + case Anvil::ObjectType::SHADER_MODULE: result = VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT; break; + case Anvil::ObjectType::SWAPCHAIN: result = VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT; break; + + default: + { + /* Either Anvil-specific object OR one that is not recognized by VK_EXT_debug_utils. The extension has + * been deprecated, so there's not much we can do at this point, other than return MAX_ENUM_EXT and hope + * for the best. + */ + } + } + + return result; +} + +/* Please see header for specification */ +VkObjectType Anvil::Utils::get_vk_object_type_for_object_type(const Anvil::ObjectType& in_object_type) +{ + VkObjectType result = VK_OBJECT_TYPE_MAX_ENUM; + + switch (in_object_type) + { + case Anvil::ObjectType::BUFFER: result = VK_OBJECT_TYPE_BUFFER; break; + case Anvil::ObjectType::BUFFER_VIEW: result = VK_OBJECT_TYPE_BUFFER_VIEW; break; + case Anvil::ObjectType::COMMAND_BUFFER: result = VK_OBJECT_TYPE_COMMAND_BUFFER; break; + case Anvil::ObjectType::COMMAND_POOL: result = VK_OBJECT_TYPE_COMMAND_POOL; break; + case Anvil::ObjectType::DESCRIPTOR_POOL: result = VK_OBJECT_TYPE_DESCRIPTOR_POOL; break; + case Anvil::ObjectType::DESCRIPTOR_SET: result = VK_OBJECT_TYPE_DESCRIPTOR_SET; break; + case Anvil::ObjectType::DESCRIPTOR_SET_LAYOUT: result = VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT; break; + case Anvil::ObjectType::DESCRIPTOR_UPDATE_TEMPLATE: result = VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE; break; + case Anvil::ObjectType::DEVICE: result = VK_OBJECT_TYPE_DEVICE; break; + case Anvil::ObjectType::EVENT: result = VK_OBJECT_TYPE_EVENT; break; + case Anvil::ObjectType::FENCE: result = VK_OBJECT_TYPE_FENCE; break; + case Anvil::ObjectType::FRAMEBUFFER: result = VK_OBJECT_TYPE_FRAMEBUFFER; break; + case Anvil::ObjectType::IMAGE: result = VK_OBJECT_TYPE_IMAGE; break; + case Anvil::ObjectType::IMAGE_VIEW: result = VK_OBJECT_TYPE_IMAGE_VIEW; break; + case Anvil::ObjectType::INSTANCE: result = VK_OBJECT_TYPE_INSTANCE; break; + case Anvil::ObjectType::PHYSICAL_DEVICE: result = VK_OBJECT_TYPE_PHYSICAL_DEVICE; break; + case Anvil::ObjectType::PIPELINE_CACHE: result = VK_OBJECT_TYPE_PIPELINE_CACHE; break; + case Anvil::ObjectType::PIPELINE_LAYOUT: result = VK_OBJECT_TYPE_PIPELINE_LAYOUT; break; + case Anvil::ObjectType::QUERY_POOL: result = VK_OBJECT_TYPE_QUERY_POOL; break; + case Anvil::ObjectType::QUEUE: result = VK_OBJECT_TYPE_QUEUE; break; + case Anvil::ObjectType::RENDER_PASS: result = VK_OBJECT_TYPE_RENDER_PASS; break; + case Anvil::ObjectType::RENDERING_SURFACE: result = VK_OBJECT_TYPE_SURFACE_KHR; break; + case Anvil::ObjectType::SAMPLER: result = VK_OBJECT_TYPE_SAMPLER; break; + case Anvil::ObjectType::SEMAPHORE: result = VK_OBJECT_TYPE_SEMAPHORE; break; + case Anvil::ObjectType::SHADER_MODULE: result = VK_OBJECT_TYPE_SHADER_MODULE; break; + case Anvil::ObjectType::SWAPCHAIN: result = VK_OBJECT_TYPE_SWAPCHAIN_KHR; break; + + default: + { + /* Either Anvil-specific object OR one that is not recognized by VK_EXT_debug_utils. The extension has + * been deprecated, so there's not much we can do at this point, other than return MAX_ENUM_EXT and hope + * for the best. + */ + } + } + + return result; +} + /* Please see header for specification */ void Anvil::Utils::get_vk_property_flags_from_memory_feature_flags(Anvil::MemoryFeatureFlags in_mem_feature_flags, Anvil::MemoryPropertyFlags* out_mem_type_flags_ptr, diff --git a/src/wrappers/buffer.cpp b/src/wrappers/buffer.cpp index 00490fe4..e84df57a 100644 --- a/src/wrappers/buffer.cpp +++ b/src/wrappers/buffer.cpp @@ -36,7 +36,7 @@ Anvil::Buffer::Buffer(Anvil::BufferCreateInfoUniquePtr in_create_info_ptr) :CallbacksSupportProvider (BUFFER_CALLBACK_ID_COUNT), DebugMarkerSupportProvider(in_create_info_ptr->get_device(), - VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT), + Anvil::ObjectType::BUFFER), MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), in_create_info_ptr->get_device () )), m_buffer (VK_NULL_HANDLE), @@ -70,7 +70,7 @@ Anvil::Buffer::Buffer(Anvil::BufferCreateInfoUniquePtr in_create_info_ptr) Anvil::Buffer::~Buffer() { /* Unregister the object */ - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_BUFFER, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::BUFFER, this); if (m_buffer != VK_NULL_HANDLE && @@ -106,7 +106,7 @@ Anvil::BufferUniquePtr Anvil::Buffer::create(Anvil::BufferCreateInfoUniquePtr in } /* Register the object */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_BUFFER, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::BUFFER, new_buffer_ptr.get() ); return new_buffer_ptr; diff --git a/src/wrappers/buffer_view.cpp b/src/wrappers/buffer_view.cpp index 94a2f699..33e37fb6 100644 --- a/src/wrappers/buffer_view.cpp +++ b/src/wrappers/buffer_view.cpp @@ -30,14 +30,14 @@ /** Please see header for specification */ Anvil::BufferView::BufferView(Anvil::BufferViewCreateInfoUniquePtr in_create_info_ptr) :DebugMarkerSupportProvider(in_create_info_ptr->get_device(), - VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT), + Anvil::ObjectType::BUFFER_VIEW), MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), in_create_info_ptr->get_device () )) { m_create_info_ptr = std::move(in_create_info_ptr); /* Register the buffer view instance */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_BUFFER_VIEW, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::BUFFER_VIEW, this); } @@ -48,7 +48,7 @@ Anvil::BufferView::BufferView(Anvil::BufferViewCreateInfoUniquePtr in_create_inf **/ Anvil::BufferView::~BufferView() { - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_BUFFER_VIEW, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::BUFFER_VIEW, this); lock(); diff --git a/src/wrappers/command_buffer.cpp b/src/wrappers/command_buffer.cpp index 56b0ff58..c1793406 100644 --- a/src/wrappers/command_buffer.cpp +++ b/src/wrappers/command_buffer.cpp @@ -61,6 +61,20 @@ Anvil::CommandBufferBase::BeginQueryCommand::BeginQueryCommand(Anvil::QueryPool* query_pool_ptr = in_query_pool_ptr; } +/** Please see header for specification */ +Anvil::BeginQueryIndexedEXTCommand::BeginQueryIndexedEXTCommand(Anvil::QueryPool* in_query_pool_ptr, + const uint32_t& in_query, + const Anvil::QueryControlFlags& in_flags, + const uint32_t& in_index) + :Command (COMMAND_TYPE_BEGIN_QUERY_INDEXED_EXT), + flags (in_flags), + index (in_index), + query (in_query), + query_pool_ptr(in_query_pool_ptr) +{ + /* Stub */ +} + /** Please see header for specification */ Anvil::BeginRenderPassCommand::BeginRenderPassCommand(uint32_t in_n_clear_values, const VkClearValue* in_clear_value_ptrs, @@ -113,6 +127,18 @@ Anvil::BeginRenderPassCommand::BeginRenderPassCommand(uint32_t } } +/** Please see header for specification */ +Anvil::BeginTransformFeedbackEXTCommand::BeginTransformFeedbackEXTCommand(const uint32_t& in_first_counter_buffer, + const std::vector& in_counter_buffer_ptrs, + const std::vector& in_counter_buffer_offsets) + :Command (COMMAND_TYPE_BEGIN_TRANSFORM_FEEDBACK_EXT), + counter_buffer_ptrs (in_counter_buffer_ptrs), + counter_buffer_offsets(in_counter_buffer_offsets), + first_counter_buffer (in_first_counter_buffer) +{ + /* Stub */ +} + /** Please see header for specification */ Anvil::CommandBufferBase::BindDescriptorSetsCommand::BindDescriptorSetsCommand(Anvil::PipelineBindPoint in_pipeline_bind_point, Anvil::PipelineLayout* in_layout_ptr, @@ -224,6 +250,22 @@ Anvil::CommandBufferBase::BlitImageCommand::BlitImageCommand(Anvil::Image* } } +/** Please see header for specification */ +Anvil::BindTransformFeedbackBuffersEXTCommand::BindTransformFeedbackBuffersEXTCommand(const uint32_t& in_first_binding, + const uint32_t& in_n_bindings, + const std::vector& in_buffer_ptrs, + const std::vector& in_offsets, + const std::vector& in_sizes) + :Command (COMMAND_TYPE_BIND_TRANSFORM_FEEDBACK_BUFFERS_EXT), + buffer_ptrs (in_buffer_ptrs), + first_binding(in_first_binding), + n_bindings (in_n_bindings), + offsets (in_offsets), + sizes (in_sizes) +{ + /* Stub */ +} + /** Please see header for specification */ Anvil::CommandBufferBase::ClearAttachmentsCommand::ClearAttachmentsCommand(uint32_t in_n_attachments, const Anvil::ClearAttachment* in_attachments, @@ -527,6 +569,23 @@ Anvil::CommandBufferBase::DrawIndexedIndirectCommand::DrawIndexedIndirectCommand stride = in_stride; } +/** Please see header for specification */ +Anvil::CommandBufferBase::DrawIndirectByteCountEXTCommand::DrawIndirectByteCountEXTCommand(const uint32_t& in_instance_count, + const uint32_t& in_first_instance, + Anvil::Buffer* in_counter_buffer_ptr, + const VkDeviceSize& in_counter_buffer_offset, + const uint32_t& in_counter_offset, + const uint32_t& in_vertex_stride) + :Command(COMMAND_TYPE_DRAW_INDIRECT_BYTE_COUNT_EXT) +{ + counter_buffer_offset = in_counter_buffer_offset; + counter_buffer_ptr = in_counter_buffer_ptr; + counter_offset = in_counter_offset; + first_instance = in_first_instance; + instance_count = in_instance_count; + vertex_stride = in_vertex_stride; +} + /** Please see header for specification */ Anvil::CommandBufferBase::DrawIndexedIndirectCountAMDCommand::DrawIndexedIndirectCountAMDCommand(Anvil::Buffer* in_buffer_ptr, VkDeviceSize in_offset, @@ -626,12 +685,36 @@ Anvil::CommandBufferBase::EndQueryCommand::EndQueryCommand(Anvil::QueryPool* in_ query_pool_ptr = in_query_pool_ptr; } +/** Please see header for specification */ +Anvil::CommandBufferBase::EndQueryIndexedEXTCommand::EndQueryIndexedEXTCommand(Anvil::QueryPool* in_query_pool_ptr, + const Anvil::QueryIndex& in_query, + const uint32_t& in_index) + :Command (COMMAND_TYPE_END_QUERY_INDEXED_EXT), + index (in_index), + query (in_query), + query_pool_ptr(in_query_pool_ptr) +{ + /* Stub */ +} + /** Please see header for specification */ Anvil::EndRenderPassCommand::EndRenderPassCommand() :Command(COMMAND_TYPE_END_RENDER_PASS) { } +/** Please see header for specification */ +Anvil::CommandBufferBase::EndTransformFeedbackEXTCommand::EndTransformFeedbackEXTCommand(const uint32_t& in_first_counter_buffer, + const std::vector& in_counter_buffer_ptrs, + const std::vector& in_counter_buffer_offsets) + :Command (COMMAND_TYPE_END_TRANSFORM_FEEDBACK_EXT), + first_counter_buffer (in_first_counter_buffer), + counter_buffer_ptrs (in_counter_buffer_ptrs), + counter_buffer_offsets(in_counter_buffer_offsets) +{ + /* Stub */ +} + /** Please see header for specification */ Anvil::CommandBufferBase::ExecuteCommandsCommand::ExecuteCommandsCommand(uint32_t in_cmd_buffers_count, Anvil::SecondaryCommandBuffer** in_cmd_buffer_ptrs) @@ -979,18 +1062,19 @@ Anvil::CommandBufferBase::CommandBufferBase(const Anvil::BaseDevice* in_device_p Anvil::CommandPool* in_parent_command_pool_ptr, Anvil::CommandBufferType in_type, bool in_mt_safe) - :MTSafetySupportProvider (in_mt_safe), - DebugMarkerSupportProvider(in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT), - CallbacksSupportProvider (COMMAND_BUFFER_CALLBACK_ID_COUNT), - m_command_buffer (VK_NULL_HANDLE), - m_device_mask (0), - m_device_ptr (in_device_ptr), - m_is_renderpass_active (false), - m_parent_command_pool_ptr (in_parent_command_pool_ptr), - m_recording_in_progress (false), - m_renderpass_device_mask (0), - m_type (in_type) + :MTSafetySupportProvider (in_mt_safe), + DebugMarkerSupportProvider (in_device_ptr, + Anvil::ObjectType::COMMAND_BUFFER), + CallbacksSupportProvider (COMMAND_BUFFER_CALLBACK_ID_COUNT), + m_command_buffer (VK_NULL_HANDLE), + m_device_mask (0), + m_device_ptr (in_device_ptr), + m_is_renderpass_active (false), + m_n_debug_label_regions_started(0), + m_parent_command_pool_ptr (in_parent_command_pool_ptr), + m_recording_in_progress (false), + m_renderpass_device_mask (0), + m_type (in_type) { anvil_assert(in_parent_command_pool_ptr != nullptr); } @@ -1030,6 +1114,36 @@ Anvil::CommandBufferBase::~CommandBufferBase() #endif } +/** Please see header for specification */ +void Anvil::CommandBufferBase::begin_debug_utils_label(const char* in_label_name_ptr, + const float* in_color_vec4_ptr) +{ + if (!m_device_ptr->get_parent_instance()->get_enabled_extensions_info()->ext_debug_utils() ) + { + goto end; + } + + { + const auto& entrypoints = m_device_ptr->get_parent_instance()->get_extension_ext_debug_utils_entrypoints(); + VkDebugUtilsLabelEXT label_info; + + label_info.color[0] = in_color_vec4_ptr[0]; + label_info.color[1] = in_color_vec4_ptr[1]; + label_info.color[2] = in_color_vec4_ptr[2]; + label_info.color[3] = in_color_vec4_ptr[3]; + label_info.pLabelName = in_label_name_ptr; + label_info.pNext = nullptr; + label_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT; + + entrypoints.vkCmdBeginDebugUtilsLabelEXT(m_command_buffer, + &label_info); + } + + ++m_n_debug_label_regions_started; +end: + ; +} + #ifdef STORE_COMMAND_BUFFER_COMMANDS /** Clears the command vector by releasing all command descriptors back to the heap memory. */ void Anvil::CommandBufferBase::clear_commands() @@ -1038,6 +1152,61 @@ Anvil::CommandBufferBase::~CommandBufferBase() } #endif +/* Please see header for specification */ +void Anvil::CommandBufferBase::end_debug_utils_label() +{ + if (!m_device_ptr->get_parent_instance()->get_enabled_extensions_info()->ext_debug_utils() ) + { + goto end; + } + + if (m_n_debug_label_regions_started == 0) + { + anvil_assert(m_n_debug_label_regions_started != 0); + + goto end; + } + + { + const auto& entrypoints = m_device_ptr->get_parent_instance()->get_extension_ext_debug_utils_entrypoints(); + + entrypoints.vkCmdEndDebugUtilsLabelEXT(m_command_buffer); + } + + --m_n_debug_label_regions_started; +end: + ; +} + +/** Please see header for specification */ +void Anvil::CommandBufferBase::insert_debug_utils_label(const char* in_label_name_ptr, + const float* in_color_vec4_ptr) +{ + if (!m_device_ptr->get_parent_instance()->get_enabled_extensions_info()->ext_debug_utils() ) + { + goto end; + } + + { + const auto& entrypoints = m_device_ptr->get_parent_instance()->get_extension_ext_debug_utils_entrypoints(); + VkDebugUtilsLabelEXT label_info; + + label_info.color[0] = in_color_vec4_ptr[0]; + label_info.color[1] = in_color_vec4_ptr[1]; + label_info.color[2] = in_color_vec4_ptr[2]; + label_info.color[3] = in_color_vec4_ptr[3]; + label_info.pLabelName = in_label_name_ptr; + label_info.pNext = nullptr; + label_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT; + + entrypoints.vkCmdInsertDebugUtilsLabelEXT(m_command_buffer, + &label_info); + } + +end: + ; +} + /* Please see header for specification */ bool Anvil::CommandBufferBase::record_begin_query(Anvil::QueryPool* in_query_pool_ptr, Anvil::QueryIndex in_entry, @@ -1080,6 +1249,122 @@ bool Anvil::CommandBufferBase::record_begin_query(Anvil::QueryPool* in_qu return result; } +/* Please see header for specification */ +bool Anvil::CommandBufferBase::record_begin_query_indexed(Anvil::QueryPool* in_query_pool_ptr, + const Anvil::QueryIndex& in_query, + const Anvil::QueryControlFlags& in_flags, + const uint32_t& in_index) +{ + /* NOTE: The command can be executed both inside and outside a renderpass */ + const auto& entrypoints = m_device_ptr->get_extension_ext_transform_feedback_entrypoints(); + bool result = false; + + if (!m_recording_in_progress) + { + anvil_assert(m_recording_in_progress); + + goto end; + } + + #ifdef STORE_COMMAND_BUFFER_COMMANDS + { + if (!m_command_stashing_disabled) + { + m_commands.push_back(BeginQueryIndexedEXTCommand(in_query_pool_ptr, + in_query, + in_flags, + in_index) ); + } + } + #endif + + m_parent_command_pool_ptr->lock(); + lock(); + { + entrypoints.vkCmdBeginQueryIndexedEXT(m_command_buffer, + in_query_pool_ptr->get_query_pool(), + in_query, + in_flags.get_vk(), + in_index); + } + unlock(); + m_parent_command_pool_ptr->unlock(); + + result = true; +end: + return result; +} + +/* Please see header for specification */ +bool Anvil::CommandBufferBase::record_begin_transform_feedback_EXT(const uint32_t& in_first_counter_buffer, + const uint32_t& in_n_counter_buffers, + Anvil::Buffer** in_opt_counter_buffer_ptrs, + const VkDeviceSize* in_opt_counter_buffer_offsets) +{ + auto counter_buffer_ptrs = std::vector(in_n_counter_buffers); + const auto& entrypoints = m_device_ptr->get_extension_ext_transform_feedback_entrypoints(); + bool result = false; + + if (!m_is_renderpass_active) + { + anvil_assert(m_is_renderpass_active); + + goto end; + } + + if (!m_recording_in_progress) + { + anvil_assert(m_recording_in_progress); + + goto end; + } + + for (uint32_t n_counter_buffer = 0; + n_counter_buffer < in_n_counter_buffers; + ++n_counter_buffer) + { + counter_buffer_ptrs.at(n_counter_buffer) = in_opt_counter_buffer_ptrs[n_counter_buffer]->get_buffer(); + } + + #ifdef STORE_COMMAND_BUFFER_COMMANDS + { + if (!m_command_stashing_disabled) + { + std::vector buffer_ptr_vec(in_n_counter_buffers); + std::vector offset_vec (in_n_counter_buffers); + + for (uint32_t n_counter_buffer = 0; + n_counter_buffer < in_n_counter_buffers; + ++n_counter_buffer) + { + buffer_ptr_vec.at(n_counter_buffer) = in_opt_counter_buffer_ptrs [n_counter_buffer]; + offset_vec.at (n_counter_buffer) = in_opt_counter_buffer_offsets[n_counter_buffer]; + } + + m_commands.push_back(BeginTransformFeedbackEXTCommand(in_first_counter_buffer, + buffer_ptr_vec, + offset_vec) ); + } + } + #endif + + m_parent_command_pool_ptr->lock(); + lock(); + { + entrypoints.vkCmdBeginTransformFeedbackEXT(m_command_buffer, + in_first_counter_buffer, + in_n_counter_buffers, + (in_n_counter_buffers > 0) ? &counter_buffer_ptrs.at(0) : nullptr, + in_opt_counter_buffer_offsets); + } + unlock(); + m_parent_command_pool_ptr->unlock(); + + result = true; +end: + return result; +} + /* Please see header for specification */ bool Anvil::CommandBufferBase::record_bind_descriptor_sets(Anvil::PipelineBindPoint in_pipeline_bind_point, Anvil::PipelineLayout* in_layout_ptr, @@ -1230,6 +1515,76 @@ bool Anvil::CommandBufferBase::record_bind_pipeline(Anvil::PipelineBindPoint in_ return result; } +/* Please see header for specification */ +bool Anvil::CommandBufferBase::record_bind_transform_feedback_buffers_EXT(const uint32_t& in_first_binding, + const uint32_t& in_n_bindings, + Anvil::Buffer** in_buffer_ptrs, + const VkDeviceSize* in_offsets_ptr, + const VkDeviceSize* in_sizes_ptr) +{ + /* Note: Command supported inside and outside the renderpass. */ + auto buffers = std::vector(in_n_bindings); + const auto& entrypoints = m_device_ptr->get_extension_ext_transform_feedback_entrypoints (); + bool result = false; + + if (!m_recording_in_progress) + { + anvil_assert(m_recording_in_progress); + + goto end; + } + + #ifdef STORE_COMMAND_BUFFER_COMMANDS + { + if (!m_command_stashing_disabled) + { + std::vector buffer_vec(in_n_bindings); + std::vector offset_vec(in_n_bindings); + std::vector size_vec (in_n_bindings); + + for (uint32_t n_binding = 0; + n_binding < in_n_bindings; + ++n_binding) + { + buffer_vec.at(n_binding) = in_buffer_ptrs[n_binding]; + offset_vec.at(n_binding) = in_offsets_ptr[n_binding]; + size_vec.at (n_binding) = in_sizes_ptr [n_binding]; + } + + m_commands.push_back(BindTransformFeedbackBuffersEXTCommand(in_first_binding, + in_n_bindings, + buffer_vec, + offset_vec, + size_vec) ); + } + } + #endif + + for (uint32_t n_binding = 0; + n_binding < in_n_bindings; + ++n_binding) + { + buffers.at(n_binding) = in_buffer_ptrs[n_binding]->get_buffer(); + } + + m_parent_command_pool_ptr->lock(); + lock(); + { + entrypoints.vkCmdBindTransformFeedbackBuffersEXT(m_command_buffer, + in_first_binding, + in_n_bindings, + (in_n_bindings > 0) ? &buffers.at(0) : nullptr, + in_offsets_ptr, + in_sizes_ptr); + } + unlock(); + m_parent_command_pool_ptr->unlock(); + + result = true; +end: + return result; +} + /* Please see header for specification */ bool Anvil::CommandBufferBase::record_bind_vertex_buffers(uint32_t in_start_binding, uint32_t in_binding_count, @@ -2239,6 +2594,64 @@ bool Anvil::CommandBufferBase::record_draw_indexed_indirect(Anvil::Buffer* in_bu return result; } +/* Please see header for specification */ +bool Anvil::CommandBufferBase::record_draw_indirect_byte_count_EXT(const uint32_t& in_instance_count, + const uint32_t& in_first_instance, + Anvil::Buffer* in_counter_buffer_ptr, + const VkDeviceSize& in_counter_buffer_offset, + const uint32_t& in_counter_offset, + const uint32_t& in_vertex_stride) +{ + const auto& entrypoints = m_device_ptr->get_extension_ext_transform_feedback_entrypoints(); + bool result = false; + + if (!m_is_renderpass_active) + { + anvil_assert(m_is_renderpass_active); + + goto end; + } + + if (!m_recording_in_progress) + { + anvil_assert(m_recording_in_progress); + + goto end; + } + + #ifdef STORE_COMMAND_BUFFER_COMMANDS + { + if (!m_command_stashing_disabled) + { + m_commands.push_back(DrawIndirectByteCountEXTCommand(in_instance_count, + in_first_instance, + in_counter_buffer_ptr, + in_counter_buffer_offset, + in_counter_offset, + in_vertex_stride) ); + } + } + #endif + + m_parent_command_pool_ptr->lock(); + lock(); + { + entrypoints.vkCmdDrawIndirectByteCountEXT(m_command_buffer, + in_instance_count, + in_first_instance, + in_counter_buffer_ptr->get_buffer(), + in_counter_buffer_offset, + in_counter_offset, + in_vertex_stride); + } + unlock(); + m_parent_command_pool_ptr->unlock(); + + result = true; +end: + return result; +} + /* Please see header for specification */ bool Anvil::CommandBufferBase::record_draw_indexed_indirect_count_AMD(Anvil::Buffer* in_buffer_ptr, VkDeviceSize in_offset, @@ -2581,6 +2994,119 @@ bool Anvil::CommandBufferBase::record_end_query(Anvil::QueryPool* in_query_pool_ return result; } +/* Please see header for specification */ +bool Anvil::CommandBufferBase::record_end_query_indexed_EXT(Anvil::QueryPool* in_query_pool_ptr, + const Anvil::QueryIndex& in_query, + const uint32_t& in_index) +{ + /* NOTE: The command can be executed both inside and outside a renderpass */ + const auto& entrypoints = m_device_ptr->get_extension_ext_transform_feedback_entrypoints(); + bool result = false; + + if (!m_recording_in_progress) + { + anvil_assert(m_recording_in_progress); + + goto end; + } + + #ifdef STORE_COMMAND_BUFFER_COMMANDS + { + if (!m_command_stashing_disabled) + { + m_commands.push_back(EndQueryIndexedEXTCommand(in_query_pool_ptr, + in_query, + in_index) ); + } + } + #endif + + m_parent_command_pool_ptr->lock(); + lock(); + { + entrypoints.vkCmdEndQueryIndexedEXT(m_command_buffer, + in_query_pool_ptr->get_query_pool(), + in_query, + in_index); + } + unlock(); + m_parent_command_pool_ptr->unlock(); + + result = true; +end: + return result; +} + +/* Please see header for specification */ +bool Anvil::CommandBufferBase::record_end_transform_feedback_EXT(const uint32_t& in_first_counter_buffer, + const uint32_t& in_n_counter_buffers, + Anvil::Buffer** in_opt_counter_buffer_ptrs, + const VkDeviceSize* in_opt_counter_buffer_offsets) +{ + auto counter_buffer_ptrs = std::vector(in_n_counter_buffers); + const auto& entrypoints = m_device_ptr->get_extension_ext_transform_feedback_entrypoints(); + bool result = false; + + if (!m_is_renderpass_active) + { + anvil_assert(m_is_renderpass_active); + + goto end; + } + + if (!m_recording_in_progress) + { + anvil_assert(m_recording_in_progress); + + goto end; + } + + for (uint32_t n_counter_buffer = 0; + n_counter_buffer < in_n_counter_buffers; + ++n_counter_buffer) + { + counter_buffer_ptrs.at(n_counter_buffer) = in_opt_counter_buffer_ptrs[n_counter_buffer]->get_buffer(); + } + + #ifdef STORE_COMMAND_BUFFER_COMMANDS + { + if (!m_command_stashing_disabled) + { + std::vector buffer_ptr_vec(in_n_counter_buffers); + std::vector offset_vec (in_n_counter_buffers); + + for (uint32_t n_counter_buffer = 0; + n_counter_buffer < in_n_counter_buffers; + ++n_counter_buffer) + { + buffer_ptr_vec.at(n_counter_buffer) = in_opt_counter_buffer_ptrs [n_counter_buffer]; + offset_vec.at (n_counter_buffer) = in_opt_counter_buffer_offsets[n_counter_buffer]; + } + + m_commands.push_back(EndTransformFeedbackEXTCommand(in_first_counter_buffer, + buffer_ptr_vec, + offset_vec) ); + } + } + #endif + + m_parent_command_pool_ptr->lock(); + lock(); + { + entrypoints.vkCmdEndTransformFeedbackEXT(m_command_buffer, + in_first_counter_buffer, + in_n_counter_buffers, + (in_n_counter_buffers > 0) ? &counter_buffer_ptrs.at(0) : nullptr, + in_opt_counter_buffer_offsets); + } + unlock(); + m_parent_command_pool_ptr->unlock(); + + result = true; +end: + return result; +} + /* Please see header for specification */ bool Anvil::CommandBufferBase::record_fill_buffer(Anvil::Buffer* in_dst_buffer_ptr, VkDeviceSize in_dst_offset, diff --git a/src/wrappers/command_pool.cpp b/src/wrappers/command_pool.cpp index ba5b7baa..5c257217 100644 --- a/src/wrappers/command_pool.cpp +++ b/src/wrappers/command_pool.cpp @@ -37,7 +37,7 @@ Anvil::CommandPool::CommandPool(Anvil::BaseDevice* in_device_ptr, bool in_mt_safe) :DebugMarkerSupportProvider (in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT), + Anvil::ObjectType::COMMAND_POOL), MTSafetySupportProvider (in_mt_safe), m_command_pool (VK_NULL_HANDLE), m_device_ptr (in_device_ptr), @@ -69,7 +69,7 @@ Anvil::CommandPool::CommandPool(Anvil::BaseDevice* in_device_ptr, } /* Register the command pool instance */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_COMMAND_POOL, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::COMMAND_POOL, this); } @@ -77,7 +77,7 @@ Anvil::CommandPool::CommandPool(Anvil::BaseDevice* in_device_ptr, Anvil::CommandPool::~CommandPool() { /* Unregister the object */ - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_COMMAND_POOL, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::COMMAND_POOL, this); /* Release the Vulkan command pool */ diff --git a/src/wrappers/compute_pipeline_manager.cpp b/src/wrappers/compute_pipeline_manager.cpp index c5c012e7..54175734 100644 --- a/src/wrappers/compute_pipeline_manager.cpp +++ b/src/wrappers/compute_pipeline_manager.cpp @@ -41,7 +41,7 @@ Anvil::ComputePipelineManager::ComputePipelineManager(Anvil::BaseDevice* in_d in_pipeline_cache_to_reuse_ptr) { /* Register the object */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_COMPUTE_PIPELINE_MANAGER, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::ANVIL_COMPUTE_PIPELINE_MANAGER, this); } @@ -50,7 +50,7 @@ Anvil::ComputePipelineManager::ComputePipelineManager(Anvil::BaseDevice* in_d Anvil::ComputePipelineManager::~ComputePipelineManager() { /* Unregister the object */ - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_COMPUTE_PIPELINE_MANAGER, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::ANVIL_COMPUTE_PIPELINE_MANAGER, this); m_baked_pipelines.clear (); diff --git a/src/wrappers/debug_messenger.cpp b/src/wrappers/debug_messenger.cpp new file mode 100644 index 00000000..4ad78a74 --- /dev/null +++ b/src/wrappers/debug_messenger.cpp @@ -0,0 +1,419 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#include "misc/debug_messenger_create_info.h" +#include "wrappers/debug_messenger.h" +#include "wrappers/instance.h" + +Anvil::DebugMessenger::DebugMessenger(const DebugAPI& in_debug_api, + Anvil::DebugMessengerCreateInfoUniquePtr in_create_info_ptr) + :MTSafetySupportProvider (in_create_info_ptr->get_instance_ptr()->is_mt_safe() ), + m_debug_api (in_debug_api), + m_debug_callback (VK_NULL_HANDLE), + m_messenger (VK_NULL_HANDLE) +{ + auto instance_ptr = in_create_info_ptr->get_instance_ptr(); + + m_create_info_ptr = std::move(in_create_info_ptr); + + switch (m_debug_api) + { + case DebugAPI::EXT_DEBUG_REPORT: + { + VkDebugReportCallbackCreateInfoEXT create_info; + const auto& entrypoints = instance_ptr->get_extension_ext_debug_report_entrypoints(); + VkResult result_vk; + + create_info.flags = get_debug_report_flags_for_debug_message_severity_flags(m_create_info_ptr->get_debug_message_severity() ); + create_info.pfnCallback = callback_handler_ext_debug_report; + create_info.pNext = nullptr; + create_info.pUserData = this; + create_info.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT; + + result_vk = entrypoints.vkCreateDebugReportCallbackEXT(instance_ptr->get_instance_vk(), + &create_info, + nullptr, /* pAllocator */ + &m_debug_callback); + + anvil_assert_vk_call_succeeded(result_vk); + ANVIL_REDUNDANT_VARIABLE (result_vk); + + break; + } + + case DebugAPI::EXT_DEBUG_UTILS: + { + VkDebugUtilsMessengerCreateInfoEXT create_info; + const auto& entrypoints = m_create_info_ptr->get_instance_ptr()->get_extension_ext_debug_utils_entrypoints(); + VkResult result_vk; + + create_info.flags = 0; + create_info.messageSeverity = m_create_info_ptr->get_debug_message_severity().get_vk(); + create_info.messageType = m_create_info_ptr->get_debug_message_types().get_vk (); + create_info.pfnUserCallback = callback_handler_ext_debug_utils; + create_info.pNext = nullptr; + create_info.pUserData = this; + create_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT; + + result_vk = entrypoints.vkCreateDebugUtilsMessengerEXT(instance_ptr->get_instance_vk(), + &create_info, + nullptr, /* pAllocator */ + &m_messenger); + + anvil_assert_vk_call_succeeded(result_vk); + ANVIL_REDUNDANT_VARIABLE (result_vk); + + break; + } + + default: + { + anvil_assert_fail(); + } + } +} + +Anvil::DebugMessenger::~DebugMessenger() +{ + auto instance_ptr = m_create_info_ptr->get_instance_ptr(); + + switch (m_debug_api) + { + case DebugAPI::EXT_DEBUG_REPORT: + { + const auto& entrypoints = instance_ptr->get_extension_ext_debug_report_entrypoints(); + + if (m_debug_callback != VK_NULL_HANDLE) + { + entrypoints.vkDestroyDebugReportCallbackEXT(instance_ptr->get_instance_vk(), + m_debug_callback, + nullptr); /* pAllocator */ + } + + break; + } + + case DebugAPI::EXT_DEBUG_UTILS: + { + const auto& entrypoints = instance_ptr->get_extension_ext_debug_utils_entrypoints(); + + if (m_messenger != VK_NULL_HANDLE) + { + entrypoints.vkDestroyDebugUtilsMessengerEXT(instance_ptr->get_instance_vk(), + m_messenger, + nullptr); /* pAllocator */ + } + + break; + } + + default: + { + anvil_assert_fail(); + } + } +} + +VkBool32 VKAPI_PTR Anvil::DebugMessenger::callback_handler_ext_debug_report(VkDebugReportFlagsEXT in_flags, + VkDebugReportObjectTypeEXT in_object_type, + uint64_t in_object, + size_t in_location, + int32_t in_message_code, + const char* in_layer_prefix_ptr, + const char* in_message_ptr, + void* in_user_data_ptr) +{ + auto objects = std::vector(1); + Anvil::DebugMessenger* this_ptr = reinterpret_cast(in_user_data_ptr); + auto create_info_ptr = this_ptr->get_create_info_ptr(); + + ANVIL_REDUNDANT_ARGUMENT_CONST(in_layer_prefix_ptr); + ANVIL_REDUNDANT_ARGUMENT_CONST(in_location); + ANVIL_REDUNDANT_ARGUMENT_CONST(in_location); + + objects.at(0) = Anvil::DebugObjectNameInfo(in_object, + "UNKNOWN", /* in_object_name_ptr */ + Anvil::Utils::get_object_type_for_vk_debug_report_object_type(in_object_type) ); + + create_info_ptr->get_callback_function()(static_cast(get_debug_message_severity_flags_for_debug_report_flags(in_flags).get_vk() ), + create_info_ptr->get_debug_message_types(), + nullptr, /* in_opt_message_id_name_ptr */ + in_message_code, + in_message_ptr, + std::vector(), + std::vector(), + objects); + + return VK_FALSE; +} + +VkBool32 VKAPI_PTR Anvil::DebugMessenger::callback_handler_ext_debug_utils(VkDebugUtilsMessageSeverityFlagBitsEXT in_message_severity, + VkDebugUtilsMessageTypeFlagsEXT in_message_types, + const VkDebugUtilsMessengerCallbackDataEXT* in_callback_data_ptr, + void* in_user_data_ptr) +{ + auto cmd_buffer_labels = std::vector (in_callback_data_ptr->cmdBufLabelCount); + auto objects = std::vector (in_callback_data_ptr->objectCount); + auto queue_labels = std::vector (in_callback_data_ptr->queueLabelCount); + Anvil::DebugMessenger* this_ptr = reinterpret_cast(in_user_data_ptr); + + for (uint32_t n_cmd_buffer_label = 0; + n_cmd_buffer_label < in_callback_data_ptr->cmdBufLabelCount; + ++n_cmd_buffer_label) + { + const auto debug_label = Anvil::DebugLabel(in_callback_data_ptr->pCmdBufLabels[n_cmd_buffer_label]); + + cmd_buffer_labels.at(n_cmd_buffer_label) = debug_label; + } + + for (uint32_t n_object = 0; + n_object < in_callback_data_ptr->objectCount; + ++n_object) + { + const auto object = Anvil::DebugObjectNameInfo(in_callback_data_ptr->pObjects[n_object]); + + objects.at(n_object) = object; + } + + for (uint32_t n_queue_label = 0; + n_queue_label < in_callback_data_ptr->queueLabelCount; + ++n_queue_label) + { + const auto debug_label = Anvil::DebugLabel(in_callback_data_ptr->pQueueLabels[n_queue_label]); + + queue_labels.at(n_queue_label) = debug_label; + } + + this_ptr->get_create_info_ptr()->get_callback_function()(static_cast(in_message_severity), + static_cast (in_message_types), + in_callback_data_ptr->pMessageIdName, + in_callback_data_ptr->messageIdNumber, + in_callback_data_ptr->pMessage, + queue_labels, + cmd_buffer_labels, + objects); + + return VK_FALSE; +} + +Anvil::DebugMessengerUniquePtr Anvil::DebugMessenger::create(Anvil::DebugMessengerCreateInfoUniquePtr in_create_info_ptr) +{ + Anvil::DebugMessengerUniquePtr result_ptr (nullptr, + std::default_delete() ); + auto instance_ptr(in_create_info_ptr->get_instance_ptr() ); + + if (instance_ptr->get_enabled_extensions_info()->ext_debug_utils() ) + { + result_ptr.reset( + new Anvil::DebugMessenger(DebugAPI::EXT_DEBUG_UTILS, + std::move(in_create_info_ptr) ) + ); + } + else + if (instance_ptr->get_enabled_extensions_info()->ext_debug_report() ) + { + result_ptr.reset( + new Anvil::DebugMessenger(DebugAPI::EXT_DEBUG_REPORT, + std::move(in_create_info_ptr) ) + ); + } + else + { + anvil_assert_fail(); + } + + anvil_assert(result_ptr != nullptr); + return result_ptr; +} + +Anvil::DebugMessageSeverityFlags Anvil::DebugMessenger::get_debug_message_severity_flags_for_debug_report_flags(const VkDebugReportFlagsEXT& in_flags) +{ + Anvil::DebugMessageSeverityFlags result = Anvil::DebugMessageSeverityFlagBits::NONE; + + if ((in_flags & VK_DEBUG_REPORT_INFORMATION_BIT_EXT) != 0) + { + result |= Anvil::DebugMessageSeverityFlagBits::INFO_BIT; + } + + if ((in_flags & VK_DEBUG_REPORT_WARNING_BIT_EXT) != 0) + { + result |= Anvil::DebugMessageSeverityFlagBits::WARNING_BIT; + } + + if ((in_flags & VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT) != 0) + { + result |= Anvil::DebugMessageSeverityFlagBits::WARNING_BIT; + } + + if ((in_flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) != 0) + { + result |= Anvil::DebugMessageSeverityFlagBits::ERROR_BIT; + } + + if ((in_flags & VK_DEBUG_REPORT_DEBUG_BIT_EXT) != 0) + { + result |= Anvil::DebugMessageSeverityFlagBits::VERBOSE_BIT; + } + + return result; +} + +VkDebugReportFlagsEXT Anvil::DebugMessenger::get_debug_report_flags_for_debug_message_severity_flags(const Anvil::DebugMessageSeverityFlags& in_flags) +{ + VkDebugReportFlagsEXT result = 0; + + if ((in_flags & Anvil::DebugMessageSeverityFlagBits::ERROR_BIT) != 0) + { + result |= VK_DEBUG_REPORT_ERROR_BIT_EXT; + } + + if ((in_flags & Anvil::DebugMessageSeverityFlagBits::INFO_BIT) != 0) + { + result |= VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT; + } + + if ((in_flags & Anvil::DebugMessageSeverityFlagBits::VERBOSE_BIT) != 0) + { + result |= VK_DEBUG_REPORT_DEBUG_BIT_EXT; + } + + if ((in_flags & Anvil::DebugMessageSeverityFlagBits::WARNING_BIT) != 0) + { + result |= VK_DEBUG_REPORT_WARNING_BIT_EXT; + } + + return result; +} + + +void Anvil::DebugMessenger::submit_message(const Anvil::DebugMessageSeverityFlagBits& in_message_severity, + const Anvil::DebugMessageTypeFlags& in_message_type_flags, + const char* in_message_id_name_ptr, + int32_t in_message_id, + const char* in_message_ptr, + const std::vector& in_queue_labels, + const std::vector& in_cmd_buffer_labels, + const std::vector& in_objects) +{ + auto instance_ptr = m_create_info_ptr->get_instance_ptr(); + + switch (m_debug_api) + { + case DebugAPI::EXT_DEBUG_REPORT: + { + const auto& entrypoints = instance_ptr->get_extension_ext_debug_report_entrypoints(); + + entrypoints.vkDebugReportMessageEXT(instance_ptr->get_instance_vk(), + get_debug_report_flags_for_debug_message_severity_flags(in_message_severity), + (in_objects.size() > 0) ? Anvil::Utils::get_vk_debug_report_object_type_ext_from_object_type(in_objects.at(0).object_type) + : VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, + (in_objects.size() > 0) ? reinterpret_cast(&in_objects.at(0).object_handle) + : VK_NULL_HANDLE, + 0, /* location */ + in_message_id, + "", /* pLayerPrefix */ + in_message_ptr); + + break; + } + + case DebugAPI::EXT_DEBUG_UTILS: + { + VkDebugUtilsMessengerCallbackDataEXT callback_data; + auto cmd_buffer_labels_vk = std::vector (in_cmd_buffer_labels.size() ); + const auto& entrypoints = instance_ptr->get_extension_ext_debug_utils_entrypoints(); + auto objects_vk = std::vector (in_objects.size () ); + auto queue_labels_vk = std::vector (in_queue_labels.size () ); + + for (uint32_t n_cmd_buffer_label = 0; + n_cmd_buffer_label < static_cast(in_cmd_buffer_labels.size() ); + ++n_cmd_buffer_label) + { + auto& cmd_buffer_label_vk = cmd_buffer_labels_vk.at(n_cmd_buffer_label); + const auto& src_cmd_buffer_label = in_cmd_buffer_labels.at(n_cmd_buffer_label); + + cmd_buffer_label_vk.color[0] = src_cmd_buffer_label.color[0]; + cmd_buffer_label_vk.color[1] = src_cmd_buffer_label.color[1]; + cmd_buffer_label_vk.color[2] = src_cmd_buffer_label.color[2]; + cmd_buffer_label_vk.color[3] = src_cmd_buffer_label.color[3]; + cmd_buffer_label_vk.pLabelName = src_cmd_buffer_label.name_ptr; + cmd_buffer_label_vk.pNext = nullptr; + cmd_buffer_label_vk.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT; + } + + for (uint32_t n_object = 0; + n_object < static_cast(in_objects.size() ); + ++n_object) + { + auto& object_vk = objects_vk.at(n_object); + const auto& src_object = in_objects.at(n_object); + + object_vk.objectHandle = src_object.object_handle; + object_vk.objectType = Anvil::Utils::get_vk_object_type_for_object_type(src_object.object_type); + object_vk.pNext = nullptr; + object_vk.pObjectName = src_object.object_name_ptr; + object_vk.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT; + } + + for (uint32_t n_queue_label = 0; + n_queue_label < static_cast(in_queue_labels.size() ); + ++n_queue_label) + { + auto& queue_label_vk = queue_labels_vk.at(n_queue_label); + const auto& src_queue_label = in_queue_labels.at(n_queue_label); + + queue_label_vk.color[0] = src_queue_label.color[0]; + queue_label_vk.color[1] = src_queue_label.color[1]; + queue_label_vk.color[2] = src_queue_label.color[2]; + queue_label_vk.color[3] = src_queue_label.color[3]; + queue_label_vk.pLabelName = src_queue_label.name_ptr; + queue_label_vk.pNext = nullptr; + queue_label_vk.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT; + } + + callback_data.cmdBufLabelCount = static_cast(in_cmd_buffer_labels.size() ); + callback_data.flags = 0; + callback_data.messageIdNumber = in_message_id; + callback_data.objectCount = static_cast(in_objects.size() ); + callback_data.pCmdBufLabels = (cmd_buffer_labels_vk.size() > 0) ? &cmd_buffer_labels_vk.at(0) : nullptr; + callback_data.pMessage = in_message_ptr; + callback_data.pMessageIdName = in_message_id_name_ptr; + callback_data.pNext = nullptr; + callback_data.pObjects = (objects_vk.size () > 0) ? &objects_vk.at (0) : nullptr; + callback_data.pQueueLabels = (queue_labels_vk.size() > 0) ? &queue_labels_vk.at(0) : nullptr; + callback_data.queueLabelCount = static_cast(queue_labels_vk.size() ); + callback_data.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT; + + entrypoints.vkSubmitDebugUtilsMessageEXT(instance_ptr->get_instance_vk(), + static_cast(in_message_severity), + in_message_type_flags.get_vk(), + &callback_data); + + break; + } + + default: + { + anvil_assert_fail(); + } + } +} diff --git a/src/wrappers/descriptor_pool.cpp b/src/wrappers/descriptor_pool.cpp index 0b9956ba..eb6a5937 100644 --- a/src/wrappers/descriptor_pool.cpp +++ b/src/wrappers/descriptor_pool.cpp @@ -38,7 +38,7 @@ Anvil::DescriptorPool::DescriptorPool(const Anvil::BaseDevice* in bool in_mt_safe) :CallbacksSupportProvider (DESCRIPTOR_POOL_CALLBACK_ID_COUNT), DebugMarkerSupportProvider(in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT), + Anvil::ObjectType::DESCRIPTOR_POOL), MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), m_flags (in_flags), @@ -50,7 +50,7 @@ Anvil::DescriptorPool::DescriptorPool(const Anvil::BaseDevice* in sizeof(uint32_t) * VK_DESCRIPTOR_TYPE_RANGE_SIZE); /* Register the object in the Object Tracker */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_DESCRIPTOR_POOL, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::DESCRIPTOR_POOL, this); } @@ -58,7 +58,7 @@ Anvil::DescriptorPool::DescriptorPool(const Anvil::BaseDevice* in Anvil::DescriptorPool::~DescriptorPool() { /* Unregister the instance */ - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_DESCRIPTOR_POOL, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::DESCRIPTOR_POOL, this); if (m_pool != VK_NULL_HANDLE) diff --git a/src/wrappers/descriptor_set.cpp b/src/wrappers/descriptor_set.cpp index 6802f219..54a64770 100644 --- a/src/wrappers/descriptor_set.cpp +++ b/src/wrappers/descriptor_set.cpp @@ -262,7 +262,7 @@ Anvil::DescriptorSet::DescriptorSet(const Anvil::BaseDevice* in_device_ VkDescriptorSet in_descriptor_set, bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT), + Anvil::ObjectType::DESCRIPTOR_SET), MTSafetySupportProvider (in_mt_safe), m_descriptor_set (in_descriptor_set), m_device_ptr (in_device_ptr), @@ -280,14 +280,14 @@ Anvil::DescriptorSet::DescriptorSet(const Anvil::BaseDevice* in_device_ this ); - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_DESCRIPTOR_SET, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::DESCRIPTOR_SET, this); } /** Please see header for specification */ Anvil::DescriptorSet::~DescriptorSet() { - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_DESCRIPTOR_SET, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::DESCRIPTOR_SET, this); } diff --git a/src/wrappers/descriptor_set_group.cpp b/src/wrappers/descriptor_set_group.cpp index 1afcfc36..7e05172d 100644 --- a/src/wrappers/descriptor_set_group.cpp +++ b/src/wrappers/descriptor_set_group.cpp @@ -99,7 +99,7 @@ Anvil::DescriptorSetGroup::DescriptorSetGroup(const Anvil::BaseDevice* } /* Register the object */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_DESCRIPTOR_SET_GROUP, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::ANVIL_DESCRIPTOR_SET_GROUP, this); } @@ -155,7 +155,7 @@ Anvil::DescriptorSetGroup::DescriptorSetGroup(const DescriptorSetGroup* in_paren m_n_unique_dses = in_parent_dsg_ptr->m_n_unique_dses; /* Register the object */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_DESCRIPTOR_SET_GROUP, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::ANVIL_DESCRIPTOR_SET_GROUP, this); } @@ -163,7 +163,7 @@ Anvil::DescriptorSetGroup::DescriptorSetGroup(const DescriptorSetGroup* in_paren Anvil::DescriptorSetGroup::~DescriptorSetGroup() { /* Unregister the object */ - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_DESCRIPTOR_SET_GROUP, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::ANVIL_DESCRIPTOR_SET_GROUP, this); } diff --git a/src/wrappers/descriptor_set_layout.cpp b/src/wrappers/descriptor_set_layout.cpp index 07270501..9fab6501 100644 --- a/src/wrappers/descriptor_set_layout.cpp +++ b/src/wrappers/descriptor_set_layout.cpp @@ -33,20 +33,20 @@ Anvil::DescriptorSetLayout::DescriptorSetLayout(Anvil::DescriptorSetCreateInfoUn const Anvil::BaseDevice* in_device_ptr, bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT), + Anvil::ObjectType::DESCRIPTOR_SET_LAYOUT), MTSafetySupportProvider (in_mt_safe), m_create_info_ptr (std::move(in_ds_create_info_ptr) ), m_device_ptr (in_device_ptr), m_layout (VK_NULL_HANDLE) { - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::DESCRIPTOR_SET_LAYOUT, this); } /** Please see header for specification */ Anvil::DescriptorSetLayout::~DescriptorSetLayout() { - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::DESCRIPTOR_SET_LAYOUT, this); if (m_layout != VK_NULL_HANDLE) diff --git a/src/wrappers/descriptor_set_layout_manager.cpp b/src/wrappers/descriptor_set_layout_manager.cpp index 1c4de7d2..0b2e224f 100644 --- a/src/wrappers/descriptor_set_layout_manager.cpp +++ b/src/wrappers/descriptor_set_layout_manager.cpp @@ -35,7 +35,7 @@ Anvil::DescriptorSetLayoutManager::DescriptorSetLayoutManager(const Anvil::BaseD m_device_ptr (in_device_ptr) { /* Register the object */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_MANAGER, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::ANVIL_DESCRIPTOR_SET_LAYOUT_MANAGER, this); } @@ -45,7 +45,7 @@ Anvil::DescriptorSetLayoutManager::~DescriptorSetLayoutManager() anvil_assert(m_descriptor_set_layouts.size() == 0); /* Unregister the object */ - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_MANAGER, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::ANVIL_DESCRIPTOR_SET_LAYOUT_MANAGER, this); } diff --git a/src/wrappers/descriptor_update_template.cpp b/src/wrappers/descriptor_update_template.cpp index 40b6fcf0..2663a08b 100644 --- a/src/wrappers/descriptor_update_template.cpp +++ b/src/wrappers/descriptor_update_template.cpp @@ -32,13 +32,13 @@ Anvil::DescriptorUpdateTemplate::DescriptorUpdateTemplate(const Anvil::BaseDevice* in_device_ptr, bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT), + Anvil::ObjectType::DESCRIPTOR_UPDATE_TEMPLATE), MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), m_vk_object (VK_NULL_HANDLE) { /* Register this instance */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::DESCRIPTOR_UPDATE_TEMPLATE, this); } @@ -57,7 +57,7 @@ Anvil::DescriptorUpdateTemplate::~DescriptorUpdateTemplate() } /* Unregister the object */ - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::DESCRIPTOR_UPDATE_TEMPLATE, this); } @@ -181,6 +181,8 @@ bool Anvil::DescriptorUpdateTemplate::init(const Anvil::DescriptorSetLayout* goto end; } + set_vk_handle(m_vk_object); + /* Finally, also cache descriptor set create info using the user-specified DS layout */ m_ds_create_info_ptr.reset( new Anvil::DescriptorSetCreateInfo(*in_descriptor_set_layout_ptr->get_create_info() ) diff --git a/src/wrappers/device.cpp b/src/wrappers/device.cpp index a3c452e3..73b2cf12 100644 --- a/src/wrappers/device.cpp +++ b/src/wrappers/device.cpp @@ -55,7 +55,7 @@ Anvil::BaseDevice::BaseDevice(const Anvil::Instance* in_parent_instance_ptr, m_khr_surface_extension_entrypoints = m_parent_instance_ptr->get_extension_khr_surface_entrypoints(); /* Register the instance */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_DEVICE, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::DEVICE, this); } @@ -64,7 +64,7 @@ Anvil::BaseDevice::~BaseDevice() /* Unregister the instance. Tihs needs to happen before actual Vulkan object destruction, as there might * be observers who postpone their destruction until the device is about to go down. */ - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_DEVICE, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::DEVICE, this); if (m_device != VK_NULL_HANDLE) @@ -113,6 +113,13 @@ const Anvil::ExtensionEXTSampleLocationsEntrypoints& Anvil::BaseDevice::get_exte return m_ext_sample_locations_extension_entrypoints; } +const Anvil::ExtensionEXTTransformFeedbackEntrypoints& Anvil::BaseDevice::get_extension_ext_transform_feedback_entrypoints() const +{ + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->ext_transform_feedback() ); + + return m_ext_transform_feedback_extension_entrypoints; +} + bool Anvil::BaseDevice::get_memory_types_supported_for_external_handle(const Anvil::ExternalMemoryHandleTypeFlagBits& in_external_handle_type, ExternalHandleType in_handle, uint32_t* out_supported_memory_type_bits) const @@ -794,6 +801,23 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, anvil_assert(m_ext_sample_locations_extension_entrypoints.vkGetPhysicalDeviceMultisamplePropertiesEXT != nullptr); } + if (m_extension_enabled_info_ptr->get_device_extension_info()->ext_transform_feedback() ) + { + m_ext_transform_feedback_extension_entrypoints.vkCmdBeginQueryIndexedEXT = reinterpret_cast (get_proc_address("vkCmdBeginQueryIndexedEXT") ); + m_ext_transform_feedback_extension_entrypoints.vkCmdBeginTransformFeedbackEXT = reinterpret_cast (get_proc_address("vkCmdBeginTransformFeedbackEXT") ); + m_ext_transform_feedback_extension_entrypoints.vkCmdBindTransformFeedbackBuffersEXT = reinterpret_cast(get_proc_address("vkCmdBindTransformFeedbackBuffersEXT") ); + m_ext_transform_feedback_extension_entrypoints.vkCmdDrawIndirectByteCountEXT = reinterpret_cast (get_proc_address("vkCmdDrawIndirectByteCountEXT") ); + m_ext_transform_feedback_extension_entrypoints.vkCmdEndQueryIndexedEXT = reinterpret_cast (get_proc_address("vkCmdEndQueryIndexedEXT") ); + m_ext_transform_feedback_extension_entrypoints.vkCmdEndTransformFeedbackEXT = reinterpret_cast (get_proc_address("vkCmdEndTransformFeedbackEXT") ); + + anvil_assert(m_ext_transform_feedback_extension_entrypoints.vkCmdBeginQueryIndexedEXT != nullptr); + anvil_assert(m_ext_transform_feedback_extension_entrypoints.vkCmdBeginTransformFeedbackEXT != nullptr); + anvil_assert(m_ext_transform_feedback_extension_entrypoints.vkCmdBindTransformFeedbackBuffersEXT != nullptr); + anvil_assert(m_ext_transform_feedback_extension_entrypoints.vkCmdDrawIndirectByteCountEXT != nullptr); + anvil_assert(m_ext_transform_feedback_extension_entrypoints.vkCmdEndQueryIndexedEXT != nullptr); + anvil_assert(m_ext_transform_feedback_extension_entrypoints.vkCmdEndTransformFeedbackEXT != nullptr); + } + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_descriptor_update_template() ) { m_khr_descriptor_update_template_extension_entrypoints.vkCreateDescriptorUpdateTemplateKHR = reinterpret_cast (get_proc_address("vkCreateDescriptorUpdateTemplateKHR") ); diff --git a/src/wrappers/event.cpp b/src/wrappers/event.cpp index 14023b30..b0fa1141 100644 --- a/src/wrappers/event.cpp +++ b/src/wrappers/event.cpp @@ -29,7 +29,7 @@ /* Please see header for specification */ Anvil::Event::Event(Anvil::EventCreateInfoUniquePtr in_create_info_ptr) :DebugMarkerSupportProvider(in_create_info_ptr->get_device(), - VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT), + Anvil::ObjectType::EVENT), MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), in_create_info_ptr->get_device () )), m_event (VK_NULL_HANDLE) @@ -37,7 +37,7 @@ Anvil::Event::Event(Anvil::EventCreateInfoUniquePtr in_create_info_ptr) m_create_info_ptr = std::move(in_create_info_ptr); /* Register the event instance */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_EVENT, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::EVENT, this); } @@ -48,7 +48,7 @@ Anvil::Event::Event(Anvil::EventCreateInfoUniquePtr in_create_info_ptr) **/ Anvil::Event::~Event() { - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_EVENT, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::EVENT, this); release_event(); diff --git a/src/wrappers/fence.cpp b/src/wrappers/fence.cpp index ecad170a..afef3c26 100644 --- a/src/wrappers/fence.cpp +++ b/src/wrappers/fence.cpp @@ -33,7 +33,7 @@ /* Please see header for specification */ Anvil::Fence::Fence(Anvil::FenceCreateInfoUniquePtr in_create_info_ptr) :DebugMarkerSupportProvider(in_create_info_ptr->get_device(), - VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT), + Anvil::ObjectType::FENCE), MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), in_create_info_ptr->get_device () )), m_fence (VK_NULL_HANDLE) @@ -41,14 +41,14 @@ Anvil::Fence::Fence(Anvil::FenceCreateInfoUniquePtr in_create_info_ptr) m_create_info_ptr = std::move(in_create_info_ptr); /* Register the event instance */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_FENCE, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::FENCE, this); } /* Please see header for specification */ Anvil::Fence::~Fence() { - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_FENCE, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::FENCE, this); release_fence(); diff --git a/src/wrappers/framebuffer.cpp b/src/wrappers/framebuffer.cpp index 3a99be00..6e7e1e1f 100644 --- a/src/wrappers/framebuffer.cpp +++ b/src/wrappers/framebuffer.cpp @@ -41,7 +41,7 @@ bool Anvil::Framebuffer::RenderPassComparator::operator()(Anvil::RenderPass* in_ /* Please see header for specification */ Anvil::Framebuffer::Framebuffer(Anvil::FramebufferCreateInfoUniquePtr in_create_info_ptr) :DebugMarkerSupportProvider(in_create_info_ptr->get_device(), - VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT, + Anvil::ObjectType::FRAMEBUFFER, true), /* in_use_delegate_workers */ MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), in_create_info_ptr->get_device () )), @@ -50,7 +50,7 @@ Anvil::Framebuffer::Framebuffer(Anvil::FramebufferCreateInfoUniquePtr in_create_ m_create_info_ptr = std::move(in_create_info_ptr); /* Register the object */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_FRAMEBUFFER, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::FRAMEBUFFER, this); } @@ -62,7 +62,7 @@ Anvil::Framebuffer::Framebuffer(Anvil::FramebufferCreateInfoUniquePtr in_create_ Anvil::Framebuffer::~Framebuffer() { /* Unregister the object */ - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_FRAMEBUFFER, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::FRAMEBUFFER, this); for (auto fb_iterator = m_baked_framebuffers.begin(); diff --git a/src/wrappers/graphics_pipeline_manager.cpp b/src/wrappers/graphics_pipeline_manager.cpp index 85b19ea4..193cc066 100644 --- a/src/wrappers/graphics_pipeline_manager.cpp +++ b/src/wrappers/graphics_pipeline_manager.cpp @@ -50,7 +50,7 @@ Anvil::GraphicsPipelineManager::GraphicsPipelineManager(const Anvil::BaseDevice* in_pipeline_cache_to_reuse_ptr) { /* Register the object */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_GRAPHICS_PIPELINE_MANAGER, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::ANVIL_GRAPHICS_PIPELINE_MANAGER, this); } @@ -61,7 +61,7 @@ Anvil::GraphicsPipelineManager::~GraphicsPipelineManager() m_outstanding_pipelines.clear(); /* Unregister the object */ - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_GRAPHICS_PIPELINE_MANAGER, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::ANVIL_GRAPHICS_PIPELINE_MANAGER, this); } @@ -939,11 +939,31 @@ Anvil::StructChainUniquePtr Anvil::Graph } } else - if (in_gfx_pipeline_create_info_ptr->get_rasterization_order() != Anvil::RasterizationOrderAMD::STRICT) { anvil_assert(in_gfx_pipeline_create_info_ptr->get_rasterization_order() == Anvil::RasterizationOrderAMD::STRICT); } + if (m_device_ptr->is_extension_enabled(VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME) ) + { + const auto& rasterization_stream_index = in_gfx_pipeline_create_info_ptr->get_rasterization_stream_index(); + + if (rasterization_stream_index != 0) + { + VkPipelineRasterizationStateStreamCreateInfoEXT create_info; + + create_info.flags = 0; + create_info.pNext = nullptr; + create_info.rasterizationStream = rasterization_stream_index; + create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT; + + raster_state_create_info_chainer.append_struct(create_info); + } + } + else + { + anvil_assert(in_gfx_pipeline_create_info_ptr->get_rasterization_stream_index() == 0); + } + return raster_state_create_info_chainer.create_chain(); } diff --git a/src/wrappers/image.cpp b/src/wrappers/image.cpp index a0383ff7..72d15b90 100644 --- a/src/wrappers/image.cpp +++ b/src/wrappers/image.cpp @@ -52,7 +52,7 @@ Anvil::Image::Image(Anvil::ImageCreateInfoUniquePtr in_create_info_ptr) :CallbacksSupportProvider (IMAGE_CALLBACK_ID_COUNT), DebugMarkerSupportProvider (in_create_info_ptr->get_device(), - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT), + Anvil::ObjectType::IMAGE), MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), in_create_info_ptr->get_device () )), m_alignment (UINT64_MAX), @@ -68,7 +68,7 @@ Anvil::Image::Image(Anvil::ImageCreateInfoUniquePtr in_create_info_ptr) m_create_info_ptr = std::move(in_create_info_ptr); /* Register this instance */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_IMAGE, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::IMAGE, this); } @@ -1129,7 +1129,7 @@ Anvil::Image::~Image() } /* Unregister the object */ - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_IMAGE, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::IMAGE, this); } diff --git a/src/wrappers/image_view.cpp b/src/wrappers/image_view.cpp index ed603af0..788d3b36 100644 --- a/src/wrappers/image_view.cpp +++ b/src/wrappers/image_view.cpp @@ -52,7 +52,7 @@ Anvil::ImageViewUniquePtr Anvil::ImageView::create(Anvil::ImageViewCreateInfoUni Anvil::ImageView::ImageView(Anvil::ImageViewCreateInfoUniquePtr in_create_info_ptr) :DebugMarkerSupportProvider(in_create_info_ptr->get_device(), - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT), + Anvil::ObjectType::IMAGE_VIEW), MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), in_create_info_ptr->get_device () )), m_image_view (VK_NULL_HANDLE) @@ -60,14 +60,14 @@ Anvil::ImageView::ImageView(Anvil::ImageViewCreateInfoUniquePtr in_create_info_p m_create_info_ptr = std::move(in_create_info_ptr); /* Register the object */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_IMAGE_VIEW, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::IMAGE_VIEW, this); } Anvil::ImageView::~ImageView() { /* Unregister the object */ - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_IMAGE_VIEW, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::IMAGE_VIEW, this); if (m_image_view != VK_NULL_HANDLE) diff --git a/src/wrappers/instance.cpp b/src/wrappers/instance.cpp index 2c23750d..91bdac0e 100644 --- a/src/wrappers/instance.cpp +++ b/src/wrappers/instance.cpp @@ -21,6 +21,7 @@ // #include "misc/debug.h" +#include "misc/debug_messenger_create_info.h" #include "misc/object_tracker.h" #include "wrappers/instance.h" #include "wrappers/physical_device.h" @@ -41,20 +42,20 @@ Anvil::Instance::Instance(const std::string& in_app_name, bool in_mt_safe) :MTSafetySupportProvider (in_mt_safe), m_app_name (in_app_name), - m_debug_callback_data (0), + m_debug_messenger_ptr (Anvil::DebugMessengerUniquePtr(nullptr, std::default_delete() )), m_engine_name (in_engine_name), m_global_layer (""), m_instance (VK_NULL_HANDLE), m_validation_callback_function(in_opt_validation_callback_function) { - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_INSTANCE, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::INSTANCE, this); } /** Please see header for specification */ Anvil::Instance::~Instance() { - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_INSTANCE, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::INSTANCE, this); destroy(); @@ -99,45 +100,18 @@ Anvil::InstanceUniquePtr Anvil::Instance::create(const std::string& * * For argument discussion, please see the extension specification **/ -VkBool32 VKAPI_PTR Anvil::Instance::debug_callback_pfn_proc(VkDebugReportFlagsEXT in_message_flags, - VkDebugReportObjectTypeEXT in_object_type, - uint64_t in_src_object, - size_t in_location, - int32_t in_msg_code, - const char* in_layer_prefix_ptr, - const char* in_message_ptr, - void* in_user_data) +void Anvil::Instance::debug_callback_handler(const Anvil::DebugMessageSeverityFlagBits& in_severity, + const char* in_message_ptr) { - Anvil::Instance* instance_ptr = static_cast(in_user_data); - - ANVIL_REDUNDANT_ARGUMENT(in_src_object); - ANVIL_REDUNDANT_ARGUMENT(in_location); - ANVIL_REDUNDANT_ARGUMENT(in_msg_code); - ANVIL_REDUNDANT_ARGUMENT(in_user_data); - - return instance_ptr->m_validation_callback_function(in_message_flags, - in_object_type, - in_layer_prefix_ptr, - in_message_ptr); + m_validation_callback_function(in_severity, + in_message_ptr); } /** Please see header for specification */ void Anvil::Instance::destroy() { - if (m_debug_callback_data != VK_NULL_HANDLE) - { - lock(); - { - m_ext_debug_report_entrypoints.vkDestroyDebugReportCallbackEXT(m_instance, - m_debug_callback_data, - nullptr /* pAllocator */); - } - unlock(); - - m_debug_callback_data = VK_NULL_HANDLE; - } - - m_physical_devices.clear(); + m_debug_messenger_ptr.reset (); + m_physical_devices.clear (); m_physical_device_groups.clear(); #ifdef _DEBUG @@ -145,10 +119,10 @@ void Anvil::Instance::destroy() /* Make sure no physical devices are still registered with Object Tracker at this point */ auto object_manager_ptr = Anvil::ObjectTracker::get(); - if (object_manager_ptr->get_object_at_index(Anvil::OBJECT_TYPE_INSTANCE, + if (object_manager_ptr->get_object_at_index(Anvil::ObjectType::INSTANCE, 0) == nullptr) { - anvil_assert(object_manager_ptr->get_object_at_index(Anvil::OBJECT_TYPE_PHYSICAL_DEVICE, + anvil_assert(object_manager_ptr->get_object_at_index(Anvil::ObjectType::PHYSICAL_DEVICE, 0) == nullptr); } } @@ -357,6 +331,22 @@ void Anvil::Instance::enumerate_physical_devices() } } +/** Please see header for specification */ +const Anvil::ExtensionEXTDebugReportEntrypoints& Anvil::Instance::get_extension_ext_debug_report_entrypoints() const +{ + anvil_assert(m_enabled_extensions_info_ptr->get_instance_extension_info()->ext_debug_report() ); + + return m_ext_debug_report_entrypoints; +} + +/** Please see header for specification */ +const Anvil::ExtensionEXTDebugUtilsEntrypoints& Anvil::Instance::get_extension_ext_debug_utils_entrypoints() const +{ + anvil_assert(m_enabled_extensions_info_ptr->get_instance_extension_info()->ext_debug_utils() ); + + return m_ext_debug_utils_entrypoints; +} + /** Please see header for specification */ const Anvil::ExtensionKHRExternalFenceCapabilitiesEntrypoints& Anvil::Instance::get_extension_khr_external_fence_capabilities_entrypoints() const { @@ -543,12 +533,24 @@ void Anvil::Instance::init(const std::vector& in_disallowed_instanc } } /* Enable known instance-level extensions by default */ + if (is_instance_extension_supported(VK_EXT_DEBUG_UTILS_EXTENSION_NAME) ) + { + extension_enabled_status[VK_EXT_DEBUG_UTILS_EXTENSION_NAME] = true; + } + if (is_instance_extension_supported(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME) ) { extension_enabled_status[VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME] = true; } - extension_enabled_status[VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME] = true; + if (is_instance_extension_supported(VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME) ) + { + extension_enabled_status[VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME] = true; + } + else + { + is_device_group_creation_supported = false; + } if (is_instance_extension_supported(VK_KHR_EXTERNAL_FENCE_CAPABILITIES_EXTENSION_NAME) ) { @@ -638,62 +640,37 @@ void Anvil::Instance::init(const std::vector& in_disallowed_instanc /** Initializes debug callback support. */ void Anvil::Instance::init_debug_callbacks() { - VkResult result = VK_ERROR_INITIALIZATION_FAILED; - - ANVIL_REDUNDANT_VARIABLE(result); - - /* Set up the debug call-backs, while we're at it */ - VkDebugReportCallbackCreateInfoEXT debug_report_callback_create_info; - - debug_report_callback_create_info.flags = VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT; - debug_report_callback_create_info.pfnCallback = debug_callback_pfn_proc; - debug_report_callback_create_info.pNext = nullptr; - debug_report_callback_create_info.pUserData = this; - debug_report_callback_create_info.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT; - - result = m_ext_debug_report_entrypoints.vkCreateDebugReportCallbackEXT(m_instance, - &debug_report_callback_create_info, - nullptr, /* pAllocator */ - &m_debug_callback_data); - anvil_assert_vk_call_succeeded(result); + auto create_info_ptr = Anvil::DebugMessengerCreateInfo::create(this, + Anvil::DebugMessageSeverityFlagBits::ERROR_BIT | Anvil::DebugMessageSeverityFlagBits::INFO_BIT | Anvil::DebugMessageSeverityFlagBits::WARNING_BIT, + Anvil::DebugMessageTypeFlagBits::VALIDATION_BIT, + std::bind(&Anvil::Instance::debug_callback_handler, + this, + std::placeholders::_1, /* severity */ + std::placeholders::_5) ); /* message */ + + anvil_assert(create_info_ptr != nullptr); + + m_debug_messenger_ptr = Anvil::DebugMessenger::create(std::move(create_info_ptr) ); + anvil_assert(m_debug_messenger_ptr != nullptr); } /** Initializes all required instance-level function pointers. */ void Anvil::Instance::init_func_pointers() { - m_khr_surface_entrypoints.vkDestroySurfaceKHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, - "vkDestroySurfaceKHR") ); - m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceCapabilitiesKHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceSurfaceCapabilitiesKHR") ); - m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceFormatsKHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceSurfaceFormatsKHR") ); - m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfacePresentModesKHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceSurfacePresentModesKHR") ); - m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceSupportKHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceSurfaceSupportKHR") ); - - m_ext_debug_report_entrypoints.vkCreateDebugReportCallbackEXT = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, - "vkCreateDebugReportCallbackEXT") ); - m_ext_debug_report_entrypoints.vkDestroyDebugReportCallbackEXT = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, - "vkDestroyDebugReportCallbackEXT") ); - - anvil_assert(m_khr_surface_entrypoints.vkDestroySurfaceKHR != nullptr); - anvil_assert(m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceCapabilitiesKHR != nullptr); - anvil_assert(m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceFormatsKHR != nullptr); - anvil_assert(m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfacePresentModesKHR != nullptr); - anvil_assert(m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceSupportKHR != nullptr); - #ifdef _WIN32 { #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) { - m_khr_win32_surface_entrypoints.vkCreateWin32SurfaceKHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, - "vkCreateWin32SurfaceKHR") ); - m_khr_win32_surface_entrypoints.vkGetPhysicalDeviceWin32PresentationSupportKHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceWin32PresentationSupportKHR") ); + if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_win32_surface() ) + { + m_khr_win32_surface_entrypoints.vkCreateWin32SurfaceKHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkCreateWin32SurfaceKHR") ); + m_khr_win32_surface_entrypoints.vkGetPhysicalDeviceWin32PresentationSupportKHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceWin32PresentationSupportKHR") ); - anvil_assert(m_khr_win32_surface_entrypoints.vkCreateWin32SurfaceKHR != nullptr); - anvil_assert(m_khr_win32_surface_entrypoints.vkGetPhysicalDeviceWin32PresentationSupportKHR != nullptr); + anvil_assert(m_khr_win32_surface_entrypoints.vkCreateWin32SurfaceKHR != nullptr); + anvil_assert(m_khr_win32_surface_entrypoints.vkGetPhysicalDeviceWin32PresentationSupportKHR != nullptr); + } } #endif } @@ -701,15 +678,70 @@ void Anvil::Instance::init_func_pointers() { #if defined(ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT) { - m_khr_xcb_surface_entrypoints.vkCreateXcbSurfaceKHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, - "vkCreateXcbSurfaceKHR") ); + if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_xcb_surface() ) + { + m_khr_xcb_surface_entrypoints.vkCreateXcbSurfaceKHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkCreateXcbSurfaceKHR") ); - anvil_assert(m_khr_xcb_surface_entrypoints.vkCreateXcbSurfaceKHR != nullptr); + anvil_assert(m_khr_xcb_surface_entrypoints.vkCreateXcbSurfaceKHR != nullptr); + } } #endif } #endif + if (m_enabled_extensions_info_ptr->get_instance_extension_info()->ext_debug_report() ) + { + m_ext_debug_report_entrypoints.vkCreateDebugReportCallbackEXT = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkCreateDebugReportCallbackEXT") ); + m_ext_debug_report_entrypoints.vkDebugReportMessageEXT = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkDebugReportMessageEXT") ); + m_ext_debug_report_entrypoints.vkDestroyDebugReportCallbackEXT = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkDestroyDebugReportCallbackEXT") ); + + anvil_assert(m_ext_debug_report_entrypoints.vkCreateDebugReportCallbackEXT != nullptr); + anvil_assert(m_ext_debug_report_entrypoints.vkDebugReportMessageEXT != nullptr); + anvil_assert(m_ext_debug_report_entrypoints.vkDestroyDebugReportCallbackEXT != nullptr); + } + + if (m_enabled_extensions_info_ptr->get_instance_extension_info()->ext_debug_utils() ) + { + m_ext_debug_utils_entrypoints.vkCmdBeginDebugUtilsLabelEXT = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkCmdBeginDebugUtilsLabelEXT") ); + m_ext_debug_utils_entrypoints.vkCmdEndDebugUtilsLabelEXT = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkCmdEndDebugUtilsLabelEXT") ); + m_ext_debug_utils_entrypoints.vkCmdInsertDebugUtilsLabelEXT = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkCmdInsertDebugUtilsLabelEXT") ); + m_ext_debug_utils_entrypoints.vkCreateDebugUtilsMessengerEXT = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkCreateDebugUtilsMessengerEXT") ); + m_ext_debug_utils_entrypoints.vkDestroyDebugUtilsMessengerEXT = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkDestroyDebugUtilsMessengerEXT") ); + m_ext_debug_utils_entrypoints.vkSetDebugUtilsObjectNameEXT = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkSetDebugUtilsObjectNameEXT") ); + m_ext_debug_utils_entrypoints.vkSetDebugUtilsObjectTagEXT = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkSetDebugUtilsObjectTagEXT") ); + m_ext_debug_utils_entrypoints.vkQueueBeginDebugUtilsLabelEXT = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkQueueBeginDebugUtilsLabelEXT") ); + m_ext_debug_utils_entrypoints.vkQueueEndDebugUtilsLabelEXT = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkQueueEndDebugUtilsLabelEXT") ); + m_ext_debug_utils_entrypoints.vkQueueInsertDebugUtilsLabelEXT = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkQueueInsertDebugUtilsLabelEXT") ); + m_ext_debug_utils_entrypoints.vkSubmitDebugUtilsMessageEXT = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkSubmitDebugUtilsMessageEXT") ); + + anvil_assert(m_ext_debug_utils_entrypoints.vkCmdBeginDebugUtilsLabelEXT != nullptr); + anvil_assert(m_ext_debug_utils_entrypoints.vkCmdEndDebugUtilsLabelEXT != nullptr); + anvil_assert(m_ext_debug_utils_entrypoints.vkCmdInsertDebugUtilsLabelEXT != nullptr); + anvil_assert(m_ext_debug_utils_entrypoints.vkCreateDebugUtilsMessengerEXT != nullptr); + anvil_assert(m_ext_debug_utils_entrypoints.vkDestroyDebugUtilsMessengerEXT != nullptr); + anvil_assert(m_ext_debug_utils_entrypoints.vkSetDebugUtilsObjectNameEXT != nullptr); + anvil_assert(m_ext_debug_utils_entrypoints.vkSetDebugUtilsObjectTagEXT != nullptr); + anvil_assert(m_ext_debug_utils_entrypoints.vkQueueBeginDebugUtilsLabelEXT != nullptr); + anvil_assert(m_ext_debug_utils_entrypoints.vkQueueEndDebugUtilsLabelEXT != nullptr); + anvil_assert(m_ext_debug_utils_entrypoints.vkQueueInsertDebugUtilsLabelEXT != nullptr); + anvil_assert(m_ext_debug_utils_entrypoints.vkSubmitDebugUtilsMessageEXT != nullptr); + } + if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_get_physical_device_properties2() ) { m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceFeatures2KHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, @@ -767,6 +799,26 @@ void Anvil::Instance::init_func_pointers() anvil_assert(m_khr_external_semaphore_capabilities_entrypoints.vkGetPhysicalDeviceExternalSemaphorePropertiesKHR!= nullptr); } + + if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_surface() ) + { + m_khr_surface_entrypoints.vkDestroySurfaceKHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkDestroySurfaceKHR") ); + m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceCapabilitiesKHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceSurfaceCapabilitiesKHR") ); + m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceFormatsKHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceSurfaceFormatsKHR") ); + m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfacePresentModesKHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceSurfacePresentModesKHR") ); + m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceSupportKHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + "vkGetPhysicalDeviceSurfaceSupportKHR") ); + + anvil_assert(m_khr_surface_entrypoints.vkDestroySurfaceKHR != nullptr); + anvil_assert(m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceCapabilitiesKHR != nullptr); + anvil_assert(m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceFormatsKHR != nullptr); + anvil_assert(m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfacePresentModesKHR != nullptr); + anvil_assert(m_khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceSupportKHR != nullptr); + } } #if !defined(ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB) diff --git a/src/wrappers/memory_block.cpp b/src/wrappers/memory_block.cpp index 98e52e40..75ce6e53 100644 --- a/src/wrappers/memory_block.cpp +++ b/src/wrappers/memory_block.cpp @@ -52,7 +52,7 @@ Anvil::MemoryBlock::MemoryBlock(Anvil::MemoryBlockCreateInfoUniquePtr in_create_ } /* Register the object */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_MEMORY_BLOCK, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::ANVIL_MEMORY_BLOCK, this); } @@ -78,7 +78,7 @@ Anvil::MemoryBlock::~MemoryBlock() } /* Unregister the object */ - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_MEMORY_BLOCK, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::ANVIL_MEMORY_BLOCK, this); if (m_memory != VK_NULL_HANDLE) diff --git a/src/wrappers/physical_device.cpp b/src/wrappers/physical_device.cpp index c024c49b..7de0429e 100644 --- a/src/wrappers/physical_device.cpp +++ b/src/wrappers/physical_device.cpp @@ -49,7 +49,7 @@ std::unique_ptr Anvil::PhysicalDevice::create(Anvil::Inst physical_device_ptr->init(); /* Register the physical device instance */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_PHYSICAL_DEVICE, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::PHYSICAL_DEVICE, physical_device_ptr.get() ); return physical_device_ptr; @@ -58,7 +58,7 @@ std::unique_ptr Anvil::PhysicalDevice::create(Anvil::Inst /* Please see header for specification */ Anvil::PhysicalDevice::~PhysicalDevice() { - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_PHYSICAL_DEVICE, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::PHYSICAL_DEVICE, this); } @@ -133,6 +133,7 @@ bool Anvil::PhysicalDevice::init() Anvil::StructID storage_features8_struct_id = UINT32_MAX; Anvil::StructChainUniquePtr struct_chain_ptr; Anvil::StructChainer struct_chainer; + Anvil::StructID transform_feedback_features_struct_id = UINT32_MAX; Anvil::StructID variable_pointer_features_struct_id = UINT32_MAX; /* Chain query structs .. */ @@ -155,6 +156,16 @@ bool Anvil::PhysicalDevice::init() descriptor_indexing_features_struct_id = struct_chainer.append_struct(descriptor_indexing_features); } + if (m_extension_info_ptr->get_device_extension_info()->ext_transform_feedback() ) + { + VkPhysicalDeviceTransformFeedbackFeaturesEXT transform_feedback_features; + + transform_feedback_features.pNext = nullptr; + transform_feedback_features.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT); + + transform_feedback_features_struct_id = struct_chainer.append_struct(transform_feedback_features); + } + if (m_extension_info_ptr->get_device_extension_info()->khr_16bit_storage() ) { VkPhysicalDevice16BitStorageFeaturesKHR storage_features; @@ -233,6 +244,21 @@ bool Anvil::PhysicalDevice::init() } } + if (transform_feedback_features_struct_id != UINT32_MAX) + { + m_ext_transform_feedback_features_ptr.reset( + new EXTTransformFeedbackFeatures(*struct_chain_ptr->get_struct_with_id(transform_feedback_features_struct_id) ) + ); + + if (m_ext_transform_feedback_features_ptr == nullptr) + { + anvil_assert(m_ext_transform_feedback_features_ptr != nullptr); + + result = false; + goto end; + } + } + if (storage_features16_struct_id != UINT32_MAX) { m_khr_16_bit_storage_features_ptr.reset( @@ -293,6 +319,7 @@ bool Anvil::PhysicalDevice::init() m_features = Anvil::PhysicalDeviceFeatures(m_core_features_vk10_ptr.get (), m_ext_descriptor_indexing_features_ptr.get(), + m_ext_transform_feedback_features_ptr.get (), m_khr_16_bit_storage_features_ptr.get (), m_khr_8_bit_storage_features_ptr.get (), m_khr_multiview_features_ptr.get (), @@ -354,6 +381,7 @@ bool Anvil::PhysicalDevice::init() Anvil::StructID shader_core_struct_id = UINT32_MAX; Anvil::StructChainUniquePtr struct_chain_ptr; Anvil::StructChainer struct_chainer; + Anvil::StructID transform_feedback_props_struct_id = UINT32_MAX; Anvil::StructID vertex_attribute_divisor_props_struct_id = UINT32_MAX; /* Chain query structs */ @@ -426,6 +454,16 @@ bool Anvil::PhysicalDevice::init() sampler_filter_minmax_props_struct_id = struct_chainer.append_struct(sampler_filter_minmax_properties); } + if (m_extension_info_ptr->get_device_extension_info()->ext_transform_feedback() ) + { + VkPhysicalDeviceTransformFeedbackPropertiesEXT transform_feedback_properties; + + transform_feedback_properties.pNext = nullptr; + transform_feedback_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT; + + transform_feedback_props_struct_id = struct_chainer.append_struct(transform_feedback_properties); + } + if (m_extension_info_ptr->get_device_extension_info()->ext_vertex_attribute_divisor() ) { VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT vertex_attribute_divisor_properties; @@ -633,6 +671,21 @@ bool Anvil::PhysicalDevice::init() } } + if (transform_feedback_props_struct_id != UINT32_MAX) + { + m_ext_transform_feedback_properties_ptr.reset( + new EXTTransformFeedbackProperties(*struct_chain_ptr->get_struct_with_id(transform_feedback_props_struct_id) ) + ); + + if (m_ext_transform_feedback_properties_ptr == nullptr) + { + anvil_assert(m_ext_transform_feedback_properties_ptr != nullptr); + + result = false; + goto end; + } + } + if (vertex_attribute_divisor_props_struct_id != UINT32_MAX) { m_ext_vertex_attribute_divisor_properties_ptr.reset( @@ -676,6 +729,7 @@ bool Anvil::PhysicalDevice::init() m_ext_pci_bus_info_ptr.get (), m_ext_sample_locations_properties_ptr.get (), m_ext_sampler_filter_minmax_properties_ptr.get (), + m_ext_transform_feedback_properties_ptr.get (), m_ext_vertex_attribute_divisor_properties_ptr.get (), m_khr_external_memory_capabilities_physical_device_id_properties_ptr.get(), m_khr_maintenance3_properties_ptr.get (), diff --git a/src/wrappers/pipeline_cache.cpp b/src/wrappers/pipeline_cache.cpp index cac89cb9..c5572713 100644 --- a/src/wrappers/pipeline_cache.cpp +++ b/src/wrappers/pipeline_cache.cpp @@ -32,7 +32,7 @@ Anvil::PipelineCache::PipelineCache(const Anvil::BaseDevice* in_device_ptr, size_t in_initial_data_size, const void* in_initial_data) :DebugMarkerSupportProvider(in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT), + Anvil::ObjectType::PIPELINE_CACHE), MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), m_pipeline_cache (VK_NULL_HANDLE) @@ -62,7 +62,7 @@ Anvil::PipelineCache::PipelineCache(const Anvil::BaseDevice* in_device_ptr, anvil_assert(m_pipeline_cache != VK_NULL_HANDLE); /* Register the instance */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_PIPELINE_CACHE, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::PIPELINE_CACHE, this); } @@ -70,7 +70,7 @@ Anvil::PipelineCache::PipelineCache(const Anvil::BaseDevice* in_device_ptr, Anvil::PipelineCache::~PipelineCache() { /* Unregister the instance */ - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_PIPELINE_CACHE, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::PIPELINE_CACHE, this); if (m_pipeline_cache != VK_NULL_HANDLE) diff --git a/src/wrappers/pipeline_layout.cpp b/src/wrappers/pipeline_layout.cpp index 79a300df..743f7582 100644 --- a/src/wrappers/pipeline_layout.cpp +++ b/src/wrappers/pipeline_layout.cpp @@ -34,7 +34,7 @@ Anvil::PipelineLayout::PipelineLayout(const Anvil::BaseDevice* in_device const Anvil::PushConstantRanges& in_push_constant_ranges, bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT), + Anvil::ObjectType::PIPELINE_LAYOUT), MTSafetySupportProvider (in_mt_safe) { m_device_ptr = in_device_ptr; @@ -45,7 +45,7 @@ Anvil::PipelineLayout::PipelineLayout(const Anvil::BaseDevice* in_device /** Please see header for specification */ Anvil::PipelineLayout::~PipelineLayout() { - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_PIPELINE_LAYOUT, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::PIPELINE_LAYOUT, this); if (m_layout_vk != VK_NULL_HANDLE) @@ -189,7 +189,7 @@ Anvil::PipelineLayoutUniquePtr Anvil::PipelineLayout::create(const Anvil::BaseDe } else { - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_PIPELINE_LAYOUT, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::PIPELINE_LAYOUT, result_ptr.get() ); } } diff --git a/src/wrappers/pipeline_layout_manager.cpp b/src/wrappers/pipeline_layout_manager.cpp index c3995f0d..54c778e2 100644 --- a/src/wrappers/pipeline_layout_manager.cpp +++ b/src/wrappers/pipeline_layout_manager.cpp @@ -35,7 +35,7 @@ Anvil::PipelineLayoutManager::PipelineLayoutManager(const Anvil::BaseDevice* in_ m_device_ptr (in_device_ptr) { /* Register the object */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_PIPELINE_LAYOUT_MANAGER, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::ANVIL_PIPELINE_LAYOUT_MANAGER, this); } @@ -46,7 +46,7 @@ Anvil::PipelineLayoutManager::~PipelineLayoutManager() anvil_assert(m_pipeline_layouts.size() == 0); /* Unregister the object */ - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_PIPELINE_LAYOUT_MANAGER, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::ANVIL_PIPELINE_LAYOUT_MANAGER, this); } diff --git a/src/wrappers/query_pool.cpp b/src/wrappers/query_pool.cpp index 2376c0a4..f9fda44a 100644 --- a/src/wrappers/query_pool.cpp +++ b/src/wrappers/query_pool.cpp @@ -33,7 +33,7 @@ Anvil::QueryPool::QueryPool(const Anvil::BaseDevice* in_device_ptr, uint32_t in_n_max_concurrent_queries, bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT), + Anvil::ObjectType::QUERY_POOL), MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), m_n_max_indices (in_n_max_concurrent_queries), @@ -47,7 +47,7 @@ Anvil::QueryPool::QueryPool(const Anvil::BaseDevice* in_device_ptr, in_n_max_concurrent_queries); /* Register the pool wrapper instance */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_QUERY_POOL, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::QUERY_POOL, this); } @@ -58,7 +58,7 @@ Anvil::QueryPool::QueryPool(const Anvil::BaseDevice* in_device_ptr, uint32_t in_n_max_concurrent_queries, bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT), + Anvil::ObjectType::QUERY_POOL), MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), m_n_max_indices (in_n_max_concurrent_queries), @@ -69,7 +69,7 @@ Anvil::QueryPool::QueryPool(const Anvil::BaseDevice* in_device_ptr, in_n_max_concurrent_queries); /* Register the pool wrapper instance */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_QUERY_POOL, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::QUERY_POOL, this); } @@ -78,7 +78,7 @@ Anvil::QueryPool::QueryPool(const Anvil::BaseDevice* in_device_ptr, Anvil::QueryPool::~QueryPool() { /* Unregister the pool wrapper instance */ - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_QUERY_POOL, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::QUERY_POOL, this); if (m_query_pool_vk != VK_NULL_HANDLE) diff --git a/src/wrappers/queue.cpp b/src/wrappers/queue.cpp index c01e2f02..24c01440 100644 --- a/src/wrappers/queue.cpp +++ b/src/wrappers/queue.cpp @@ -45,14 +45,15 @@ Anvil::Queue::Queue(const Anvil::BaseDevice* in_device_ptr, uint32_t in_queue_index, bool in_mt_safe) - :CallbacksSupportProvider (QUEUE_CALLBACK_ID_COUNT), - DebugMarkerSupportProvider(in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT), - MTSafetySupportProvider (in_mt_safe), - m_device_ptr (in_device_ptr), - m_queue (VK_NULL_HANDLE), - m_queue_family_index (in_queue_family_index), - m_queue_index (in_queue_index) + :CallbacksSupportProvider (QUEUE_CALLBACK_ID_COUNT), + DebugMarkerSupportProvider (in_device_ptr, + Anvil::ObjectType::QUEUE), + MTSafetySupportProvider (in_mt_safe), + m_device_ptr (in_device_ptr), + m_n_debug_label_regions_started(0), + m_queue (VK_NULL_HANDLE), + m_queue_family_index (in_queue_family_index), + m_queue_index (in_queue_index) { /* Retrieve the Vulkan handle */ Anvil::Vulkan::vkGetDeviceQueue(m_device_ptr->get_device_vk(), @@ -76,17 +77,49 @@ Anvil::Queue::Queue(const Anvil::BaseDevice* in_device_ptr, } /* OK, register the wrapper instance and leave */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_QUEUE, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::QUEUE, this); } /** Please see header for specification */ Anvil::Queue::~Queue() { - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_QUEUE, + anvil_assert(m_n_debug_label_regions_started == 0); + + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::QUEUE, this); } +/** Please see header for specification */ +void Anvil::Queue::begin_debug_utils_label(const char* in_label_name_ptr, + const float* in_color_vec4_ptr) +{ + if (!m_device_ptr->get_parent_instance()->get_enabled_extensions_info()->ext_debug_utils() ) + { + goto end; + } + + { + const auto& entrypoints = m_device_ptr->get_parent_instance()->get_extension_ext_debug_utils_entrypoints(); + VkDebugUtilsLabelEXT label_info; + + label_info.color[0] = in_color_vec4_ptr[0]; + label_info.color[1] = in_color_vec4_ptr[1]; + label_info.color[2] = in_color_vec4_ptr[2]; + label_info.color[3] = in_color_vec4_ptr[3]; + label_info.pLabelName = in_label_name_ptr; + label_info.pNext = nullptr; + label_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT; + + entrypoints.vkQueueBeginDebugUtilsLabelEXT(m_queue, + &label_info); + } + + ++m_n_debug_label_regions_started; +end: + ; +} + /** Please see header for specification */ bool Anvil::Queue::bind_sparse_memory(Anvil::SparseMemoryBindingUpdateInfo& in_update) { @@ -429,6 +462,61 @@ std::unique_ptr Anvil::Queue::create(const Anvil::BaseDevice* in_d return result_ptr; } +/** Please see header for specification */ +void Anvil::Queue::end_debug_utils_label() +{ + if (!m_device_ptr->get_parent_instance()->get_enabled_extensions_info()->ext_debug_utils() ) + { + goto end; + } + + if (m_n_debug_label_regions_started == 0) + { + anvil_assert(m_n_debug_label_regions_started != 0); + + goto end; + } + + { + const auto& entrypoints = m_device_ptr->get_parent_instance()->get_extension_ext_debug_utils_entrypoints(); + + entrypoints.vkQueueEndDebugUtilsLabelEXT(m_queue); + } + + --m_n_debug_label_regions_started; +end: + ; +} + +/** Please see header for specification */ +void Anvil::Queue::insert_debug_utils_label(const char* in_label_name_ptr, + const float* in_color_vec4_ptr) +{ + if (!m_device_ptr->get_parent_instance()->get_enabled_extensions_info()->ext_debug_utils() ) + { + goto end; + } + + { + const auto& entrypoints = m_device_ptr->get_parent_instance()->get_extension_ext_debug_utils_entrypoints(); + VkDebugUtilsLabelEXT label_info; + + label_info.color[0] = in_color_vec4_ptr[0]; + label_info.color[1] = in_color_vec4_ptr[1]; + label_info.color[2] = in_color_vec4_ptr[2]; + label_info.color[3] = in_color_vec4_ptr[3]; + label_info.pLabelName = in_label_name_ptr; + label_info.pNext = nullptr; + label_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT; + + entrypoints.vkQueueInsertDebugUtilsLabelEXT(m_queue, + &label_info); + } + +end: + ; +} + /** Please see header for specification */ VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, uint32_t in_swapchain_image_index, diff --git a/src/wrappers/render_pass.cpp b/src/wrappers/render_pass.cpp index a518d616..fe119979 100644 --- a/src/wrappers/render_pass.cpp +++ b/src/wrappers/render_pass.cpp @@ -35,13 +35,13 @@ Anvil::RenderPass::RenderPass(Anvil::RenderPassCreateInfoUniquePtr in_renderpass_create_info_ptr, Anvil::Swapchain* in_opt_swapchain_ptr) :DebugMarkerSupportProvider (in_renderpass_create_info_ptr->get_device(), - VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT), + Anvil::ObjectType::RENDER_PASS), m_render_pass (VK_NULL_HANDLE), m_render_pass_create_info_ptr(std::move(in_renderpass_create_info_ptr) ), m_swapchain_ptr (in_opt_swapchain_ptr) { /* Register the object */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_RENDER_PASS, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::RENDER_PASS, this); } @@ -49,7 +49,7 @@ Anvil::RenderPass::RenderPass(Anvil::RenderPassCreateInfoUniquePtr in_renderpass Anvil::RenderPass::~RenderPass() { /* Unregister the object */ - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_RENDER_PASS, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::RENDER_PASS, this); if (m_render_pass != VK_NULL_HANDLE) diff --git a/src/wrappers/rendering_surface.cpp b/src/wrappers/rendering_surface.cpp index c4fc6ec4..ca359955 100644 --- a/src/wrappers/rendering_surface.cpp +++ b/src/wrappers/rendering_surface.cpp @@ -37,7 +37,7 @@ Anvil::RenderingSurface::RenderingSurface(Anvil::Instance* in_instance_p bool in_mt_safe, bool* out_safe_to_use_ptr) :DebugMarkerSupportProvider(in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT), + Anvil::ObjectType::RENDERING_SURFACE), MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr), m_height (0), @@ -49,14 +49,14 @@ Anvil::RenderingSurface::RenderingSurface(Anvil::Instance* in_instance_p *out_safe_to_use_ptr = init(); /* Register the instance */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_RENDERING_SURFACE, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::RENDERING_SURFACE, this); } /* Please see header for specification */ Anvil::RenderingSurface::~RenderingSurface() { - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_RENDERING_SURFACE, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::RENDERING_SURFACE, this); if (m_surface != VK_NULL_HANDLE) diff --git a/src/wrappers/sampler.cpp b/src/wrappers/sampler.cpp index 34d76a3d..7c3d3709 100644 --- a/src/wrappers/sampler.cpp +++ b/src/wrappers/sampler.cpp @@ -31,21 +31,21 @@ /** Please see header for specification */ Anvil::Sampler::Sampler(Anvil::SamplerCreateInfoUniquePtr in_create_info_ptr) :DebugMarkerSupportProvider(in_create_info_ptr->get_device(), - VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT), + Anvil::ObjectType::SAMPLER), MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), in_create_info_ptr->get_device () )) { m_create_info_ptr = std::move(in_create_info_ptr); /* Register the event instance */ - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_SAMPLER, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::SAMPLER, this); } /* Please see header for specification */ Anvil::Sampler::~Sampler() { - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_SAMPLER, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::SAMPLER, this); if (m_sampler != VK_NULL_HANDLE) diff --git a/src/wrappers/semaphore.cpp b/src/wrappers/semaphore.cpp index 005bef07..d0e7f967 100644 --- a/src/wrappers/semaphore.cpp +++ b/src/wrappers/semaphore.cpp @@ -32,21 +32,21 @@ /* Please see header for specification */ Anvil::Semaphore::Semaphore(Anvil::SemaphoreCreateInfoUniquePtr in_create_info_ptr) :DebugMarkerSupportProvider(in_create_info_ptr->get_device(), - VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT), + Anvil::ObjectType::SEMAPHORE), MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), in_create_info_ptr->get_device () )), m_semaphore (VK_NULL_HANDLE) { m_create_info_ptr = std::move(in_create_info_ptr); - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_SEMAPHORE, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::SEMAPHORE, this); } /* Please see header for specification */ Anvil::Semaphore::~Semaphore() { - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_SEMAPHORE, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::SEMAPHORE, this); release_semaphore(); diff --git a/src/wrappers/shader_module.cpp b/src/wrappers/shader_module.cpp index 2f9120b0..1150f48c 100644 --- a/src/wrappers/shader_module.cpp +++ b/src/wrappers/shader_module.cpp @@ -38,7 +38,7 @@ Anvil::ShaderModule::ShaderModule(const Anvil::BaseDevice* in_device_ptr, GLSLShaderToSPIRVGenerator* in_spirv_generator_ptr, bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT), + Anvil::ObjectType::SHADER_MODULE), MTSafetySupportProvider (in_mt_safe), m_device_ptr (in_device_ptr) { @@ -78,7 +78,7 @@ Anvil::ShaderModule::ShaderModule(const Anvil::BaseDevice* in_device_ptr, const std::string& in_vs_entrypoint_name, bool in_mt_safe) :DebugMarkerSupportProvider(in_device_ptr, - VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT), + Anvil::ObjectType::SHADER_MODULE), MTSafetySupportProvider (in_mt_safe), m_cs_entrypoint_name (in_cs_entrypoint_name), m_device_ptr (in_device_ptr), @@ -100,7 +100,7 @@ Anvil::ShaderModule::~ShaderModule() { auto object_tracker_ptr = Anvil::ObjectTracker::get(); - object_tracker_ptr->unregister_object(Anvil::OBJECT_TYPE_SHADER_MODULE, + object_tracker_ptr->unregister_object(Anvil::ObjectType::SHADER_MODULE, this); /* Release the Vulkan handle */ @@ -159,7 +159,7 @@ Anvil::ShaderModuleUniquePtr Anvil::ShaderModule::create_from_spirv_generator(co /* Stub */ }); - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_SHADER_MODULE, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::SHADER_MODULE, result_ptr.get() ); } } @@ -176,7 +176,7 @@ Anvil::ShaderModuleUniquePtr Anvil::ShaderModule::create_from_spirv_generator(co anvil_assert(result_ptr->get_module() != VK_NULL_HANDLE); - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_SHADER_MODULE, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::SHADER_MODULE, result_ptr.get() ); } @@ -239,7 +239,7 @@ Anvil::ShaderModuleUniquePtr Anvil::ShaderModule::create_from_spirv_blob(const A /* Stub */ }); - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_SHADER_MODULE, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::SHADER_MODULE, result_ptr.get() ); } } @@ -263,7 +263,7 @@ Anvil::ShaderModuleUniquePtr Anvil::ShaderModule::create_from_spirv_blob(const A anvil_assert(result_ptr->get_module() != VK_NULL_HANDLE); - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_SHADER_MODULE, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::SHADER_MODULE, result_ptr.get() ); } diff --git a/src/wrappers/swapchain.cpp b/src/wrappers/swapchain.cpp index 17db96c6..74b73d3c 100644 --- a/src/wrappers/swapchain.cpp +++ b/src/wrappers/swapchain.cpp @@ -38,7 +38,7 @@ /** Please see header for specification */ Anvil::Swapchain::Swapchain(Anvil::SwapchainCreateInfoUniquePtr in_create_info_ptr) :DebugMarkerSupportProvider (in_create_info_ptr->get_device(), - VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT), + Anvil::ObjectType::SWAPCHAIN), MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), in_create_info_ptr->get_device () )), m_destroy_swapchain_before_parent_window_closes(true), @@ -59,14 +59,14 @@ Anvil::Swapchain::Swapchain(Anvil::SwapchainCreateInfoUniquePtr in_create_info_p m_create_info_ptr = std::move(in_create_info_ptr); - Anvil::ObjectTracker::get()->register_object(Anvil::OBJECT_TYPE_SWAPCHAIN, + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::SWAPCHAIN, this); } /** Please see header for specification */ Anvil::Swapchain::~Swapchain() { - Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_SWAPCHAIN, + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::SWAPCHAIN, this); destroy_swapchain(); From 25a458b3ca299797dda7f16798d699d168a7b63a Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Tue, 15 Jan 2019 10:55:42 +0100 Subject: [PATCH 43/50] Add support for VK_KHR_create_renderpass2 Bug-fixes and improvements PR #137: Integrate swapchain improvements into private branch PR #135: Barrier code fix; VK barrier struct fixes; Sample mask handling fixes; Swapchain recreation support --- CMakeLists.txt | 2 + examples/DynamicBuffers/src/app.cpp | 46 +- examples/MultiViewport/src/app.cpp | 45 +- examples/OcclusionQuery/src/app.cpp | 47 +- examples/OutOfOrderRasterization/src/app.cpp | 38 +- examples/PushConstants/src/app.cpp | 47 +- include/misc/extensions.h | 10 + include/misc/glsl_to_spirv.h | 35 +- include/misc/graphics_pipeline_create_info.h | 4 +- include/misc/instance_create_info.h | 151 +++++ include/misc/memory_allocator.h | 8 +- include/misc/memory_block_create_info.h | 3 + include/misc/render_pass_create_info.h | 105 ++-- include/misc/struct_chainer.h | 23 + include/misc/swapchain_create_info.h | 30 +- include/misc/types.h | 2 + include/misc/types_enums.h | 10 + include/misc/types_struct.h | 57 +- include/vulkan/vulkan.h | 2 +- include/vulkan/vulkan_android.h | 2 +- include/vulkan/vulkan_core.h | 309 ++++++++++- include/vulkan/vulkan_fuchsia.h | 2 +- include/vulkan/vulkan_ios.h | 2 +- include/vulkan/vulkan_macos.h | 2 +- include/vulkan/vulkan_vi.h | 2 +- include/vulkan/vulkan_wayland.h | 2 +- include/vulkan/vulkan_win32.h | 2 +- include/vulkan/vulkan_xcb.h | 2 +- include/vulkan/vulkan_xlib.h | 2 +- include/vulkan/vulkan_xlib_xrandr.h | 2 +- include/wrappers/command_buffer.h | 144 +++++ include/wrappers/device.h | 9 + include/wrappers/instance.h | 56 +- include/wrappers/queue.h | 70 +-- include/wrappers/render_pass.h | 3 +- include/wrappers/rendering_surface.h | 6 +- include/wrappers/swapchain.h | 14 +- src/misc/formats.cpp | 22 +- src/misc/fp16.cpp | 6 +- src/misc/glsl_to_spirv.cpp | 68 ++- src/misc/graphics_pipeline_create_info.cpp | 6 +- src/misc/instance_create_info.cpp | 57 ++ src/misc/memory_allocator.cpp | 59 +- src/misc/render_pass_create_info.cpp | 168 ++++-- src/misc/swapchain_create_info.cpp | 16 +- src/misc/types_struct.cpp | 56 +- src/misc/window_win3264.cpp | 7 +- src/wrappers/command_buffer.cpp | 280 +++++++++- src/wrappers/device.cpp | 13 + src/wrappers/graphics_pipeline_manager.cpp | 10 +- src/wrappers/image.cpp | 44 -- src/wrappers/instance.cpp | 52 +- src/wrappers/memory_block.cpp | 61 +-- src/wrappers/queue.cpp | 169 +++--- src/wrappers/render_pass.cpp | 549 ++++++++++++++++++- src/wrappers/rendering_surface.cpp | 93 +++- src/wrappers/swapchain.cpp | 100 ++-- 57 files changed, 2405 insertions(+), 727 deletions(-) create mode 100644 include/misc/instance_create_info.h create mode 100644 src/misc/instance_create_info.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 55ea7888..fb1e08d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,6 +77,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/include/misc/graphics_pipeline_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/image_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/image_view_create_info.h" + "${Anvil_SOURCE_DIR}/include/misc/instance_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/io.h" "${Anvil_SOURCE_DIR}/include/misc/library.h" "${Anvil_SOURCE_DIR}/include/misc/memory_allocator.h" @@ -157,6 +158,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/src/misc/graphics_pipeline_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/image_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/image_view_create_info.cpp" + "${Anvil_SOURCE_DIR}/src/misc/instance_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/io.cpp" "${Anvil_SOURCE_DIR}/src/misc/library.cpp" "${Anvil_SOURCE_DIR}/src/misc/memory_allocator.cpp" diff --git a/examples/DynamicBuffers/src/app.cpp b/examples/DynamicBuffers/src/app.cpp index dd77c556..a5731113 100644 --- a/examples/DynamicBuffers/src/app.cpp +++ b/examples/DynamicBuffers/src/app.cpp @@ -37,6 +37,7 @@ #include "misc/graphics_pipeline_create_info.h" #include "misc/image_create_info.h" #include "misc/image_view_create_info.h" +#include "misc/instance_create_info.h" #include "misc/io.h" #include "misc/memory_allocator.h" #include "misc/object_tracker.h" @@ -291,8 +292,14 @@ void App::draw_frame() present_wait_semaphore_ptr = curr_frame_signal_semaphore_ptr; /* Determine the semaphore which the swapchain image */ - n_swapchain_image = m_swapchain_ptr->acquire_image(curr_frame_wait_semaphore_ptr, - true); /* in_should_block */ + { + const auto acquire_result = m_swapchain_ptr->acquire_image(curr_frame_wait_semaphore_ptr, + &n_swapchain_image, + true /* in_should_block */); + + ANVIL_REDUNDANT_VARIABLE_CONST(acquire_result); + anvil_assert (acquire_result == Anvil::SwapchainOperationErrorCode::SUCCESS); + } /* Update time value, used by the generator compute shader */ const uint64_t time_msec = m_time.get_time_in_msec(); @@ -313,10 +320,17 @@ void App::draw_frame() false) /* should_block */ ); - m_present_queue_ptr->present(m_swapchain_ptr.get(), - n_swapchain_image, - 1, /* n_wait_semaphores */ - &present_wait_semaphore_ptr); + { + Anvil::SwapchainOperationErrorCode present_result = Anvil::SwapchainOperationErrorCode::DEVICE_LOST; + + m_present_queue_ptr->present(m_swapchain_ptr.get(), + n_swapchain_image, + 1, /* n_wait_semaphores */ + &present_wait_semaphore_ptr, + &present_result); + + anvil_assert(present_result == Anvil::SwapchainOperationErrorCode::SUCCESS); + } ++n_frames_rendered; @@ -1227,17 +1241,21 @@ void App::init_window() void App::init_vulkan() { /* Create a Vulkan instance */ - m_instance_ptr = Anvil::Instance::create(APP_NAME, /* app_name */ - APP_NAME, /* engine_name */ + { + auto create_info_ptr = Anvil::InstanceCreateInfo::create(APP_NAME, /* app_name */ + APP_NAME, /* engine_name */ #ifdef ENABLE_VALIDATION - std::bind(&App::on_validation_callback, - this, - std::placeholders::_1, - std::placeholders::_2), + std::bind(&App::on_validation_callback, + this, + std::placeholders::_1, + std::placeholders::_2), #else - Anvil::DebugCallbackFunction(), + Anvil::DebugCallbackFunction(), #endif - false); /* in_mt_safe */ + false); /* in_mt_safe */ + + m_instance_ptr = Anvil::Instance::create(std::move(create_info_ptr) ); + } m_physical_device_ptr = m_instance_ptr->get_physical_device(0); diff --git a/examples/MultiViewport/src/app.cpp b/examples/MultiViewport/src/app.cpp index 567b77a6..9abd13a2 100644 --- a/examples/MultiViewport/src/app.cpp +++ b/examples/MultiViewport/src/app.cpp @@ -33,6 +33,7 @@ #include "misc/framebuffer_create_info.h" #include "misc/glsl_to_spirv.h" #include "misc/graphics_pipeline_create_info.h" +#include "misc/instance_create_info.h" #include "misc/object_tracker.h" #include "misc/render_pass_create_info.h" #include "misc/semaphore_create_info.h" @@ -240,7 +241,13 @@ void App::draw_frame() curr_frame_wait_semaphore_ptr = m_frame_wait_semaphores [m_n_last_semaphore_used].get(); /* Determine the semaphore which the swapchain image */ - n_swapchain_image = m_swapchain_ptr->acquire_image(curr_frame_wait_semaphore_ptr); + { + const auto acquire_result = m_swapchain_ptr->acquire_image(curr_frame_wait_semaphore_ptr, + &n_swapchain_image); + + ANVIL_REDUNDANT_VARIABLE_CONST(acquire_result); + anvil_assert (acquire_result == Anvil::SwapchainOperationErrorCode::SUCCESS); + } /* Submit work chunk and present */ m_device_ptr->get_universal_queue(0)->submit( @@ -253,10 +260,18 @@ void App::draw_frame() false) /* should_block */ ); - present_queue_ptr->present(m_swapchain_ptr.get(), - n_swapchain_image, - 1, /* n_wait_semaphores */ - &curr_frame_signal_semaphore_ptr); + { + Anvil::SwapchainOperationErrorCode present_result = Anvil::SwapchainOperationErrorCode::DEVICE_LOST; + + present_queue_ptr->present(m_swapchain_ptr.get(), + n_swapchain_image, + 1, /* n_wait_semaphores */ + &curr_frame_signal_semaphore_ptr, + &present_result); + + ANVIL_REDUNDANT_VARIABLE(present_result); + anvil_assert (present_result == Anvil::SwapchainOperationErrorCode::SUCCESS); + } #ifdef ENABLE_OFFSCREEN_RENDERING { @@ -908,17 +923,21 @@ void App::init_window() void App::init_vulkan() { /* Create a Vulkan instance */ - m_instance_ptr = Anvil::Instance::create(APP_NAME, /* app_name */ - APP_NAME, /* engine_name */ + { + auto create_info_ptr = Anvil::InstanceCreateInfo::create(APP_NAME, /* app_name */ + APP_NAME, /* engine_name */ #ifdef ENABLE_VALIDATION - std::bind(&App::on_validation_callback, - this, - std::placeholders::_1, - std::placeholders::_2), + std::bind(&App::on_validation_callback, + this, + std::placeholders::_1, + std::placeholders::_2), #else - Anvil::DebugCallbackFunction(), + Anvil::DebugCallbackFunction(), #endif - false); /* in_mt_safe */ + false); /* in_mt_safe */ + + m_instance_ptr = Anvil::Instance::create(std::move(create_info_ptr) ); + } m_physical_device_ptr = m_instance_ptr->get_physical_device(0); diff --git a/examples/OcclusionQuery/src/app.cpp b/examples/OcclusionQuery/src/app.cpp index 0888201f..abae36b6 100644 --- a/examples/OcclusionQuery/src/app.cpp +++ b/examples/OcclusionQuery/src/app.cpp @@ -35,6 +35,7 @@ #include "misc/graphics_pipeline_create_info.h" #include "misc/image_create_info.h" #include "misc/image_view_create_info.h" +#include "misc/instance_create_info.h" #include "misc/io.h" #include "misc/object_tracker.h" #include "misc/render_pass_create_info.h" @@ -277,8 +278,14 @@ void App::draw_frame() present_wait_semaphore_ptr = curr_frame_signal_semaphore_ptr; /* Determine the semaphore which the swapchain image */ - n_swapchain_image = m_swapchain_ptr->acquire_image(curr_frame_wait_semaphore_ptr, - true); /* in_should_block */ + { + const auto acquire_result = m_swapchain_ptr->acquire_image(curr_frame_wait_semaphore_ptr, + &n_swapchain_image, + true /* in_should_block */); + + ANVIL_REDUNDANT_VARIABLE_CONST(acquire_result); + anvil_assert (acquire_result == Anvil::SwapchainOperationErrorCode::SUCCESS); + } /* Update time data */ const float time = float(m_time.get_time_in_msec() ) / 1000.0f; @@ -306,10 +313,18 @@ void App::draw_frame() false) /* should_block */ ); - present_queue_ptr->present(m_swapchain_ptr.get(), - n_swapchain_image, - 1, /* n_wait_semaphores */ - &present_wait_semaphore_ptr); + { + Anvil::SwapchainOperationErrorCode present_result = Anvil::SwapchainOperationErrorCode::DEVICE_LOST; + + present_queue_ptr->present(m_swapchain_ptr.get(), + n_swapchain_image, + 1, /* n_wait_semaphores */ + &present_wait_semaphore_ptr, + &present_result); + + ANVIL_REDUNDANT_VARIABLE(present_result); + anvil_assert (present_result == Anvil::SwapchainOperationErrorCode::SUCCESS); + } ++n_frames_rendered; @@ -1064,17 +1079,21 @@ void App::init_window() void App::init_vulkan() { /* Create a Vulkan instance */ - m_instance_ptr = Anvil::Instance::create(APP_NAME, /* in_app_name */ - APP_NAME, /* in_engine_name */ + { + auto create_info_ptr = Anvil::InstanceCreateInfo::create(APP_NAME, /* in_app_name */ + APP_NAME, /* in_engine_name */ #ifdef ENABLE_VALIDATION - std::bind(&App::on_validation_callback, - this, - std::placeholders::_1, - std::placeholders::_2), + std::bind(&App::on_validation_callback, + this, + std::placeholders::_1, + std::placeholders::_2), #else - Anvil::DebugCallbackFunction(), + Anvil::DebugCallbackFunction(), #endif - false); /* in_mt_safe */ + false); /* in_mt_safe */ + + m_instance_ptr = Anvil::Instance::create(std::move(create_info_ptr) ); + } m_physical_device_ptr = m_instance_ptr->get_physical_device(0); diff --git a/examples/OutOfOrderRasterization/src/app.cpp b/examples/OutOfOrderRasterization/src/app.cpp index 90649e28..24c53d12 100644 --- a/examples/OutOfOrderRasterization/src/app.cpp +++ b/examples/OutOfOrderRasterization/src/app.cpp @@ -35,6 +35,7 @@ #include "misc/graphics_pipeline_create_info.h" #include "misc/image_create_info.h" #include "misc/image_view_create_info.h" +#include "misc/instance_create_info.h" #include "misc/io.h" #include "misc/memory_allocator.h" #include "misc/object_tracker.h" @@ -306,8 +307,9 @@ void App::draw_frame() /* Determine the semaphore which the swapchain image */ { - n_swapchain_image = m_swapchain_ptr->acquire_image(curr_frame_acqusition_wait_semaphore_ptr.get(), - true); /* in_should_block */ + m_swapchain_ptr->acquire_image(curr_frame_acqusition_wait_semaphore_ptr.get(), + &n_swapchain_image, + true); /* in_should_block */ } /* Set up semaphores we're going to use to render this frame. */ @@ -378,10 +380,16 @@ void App::draw_frame() } { + Anvil::SwapchainOperationErrorCode present_result = Anvil::SwapchainOperationErrorCode::DEVICE_LOST; + m_present_queue_ptr->present(m_swapchain_ptr.get(), - n_swapchain_image, - n_physical_devices, /* n_wait_semaphores */ - frame_ready_for_present_semaphores); + n_swapchain_image, + n_physical_devices, /* n_wait_semaphores */ + frame_ready_for_present_semaphores, + &present_result); + + ANVIL_REDUNDANT_VARIABLE(present_result); + anvil_assert (present_result == Anvil::SwapchainOperationErrorCode::SUCCESS); } ++m_n_frames_drawn; @@ -1144,17 +1152,21 @@ void App::init_window() void App::init_vulkan() { /* Create a Vulkan instance */ - m_instance_ptr = Anvil::Instance::create("OutOfOrderRasterization", /* app_name */ - "OutOfOrderRasterization", /* engine_name */ + { + auto create_info_ptr = Anvil::InstanceCreateInfo::create("OutOfOrderRasterization", /* app_name */ + "OutOfOrderRasterization", /* engine_name */ #ifdef ENABLE_VALIDATION - std::bind(&App::on_validation_callback, - this, - std::placeholders::_1, - std::placeholders::_2), + std::bind(&App::on_validation_callback, + this, + std::placeholders::_1, + std::placeholders::_2), #else - Anvil::DebugCallbackFunction(), + Anvil::DebugCallbackFunction(), #endif - false); /* in_mt_safe */ + false); /* in_mt_safe */ + + m_instance_ptr = Anvil::Instance::create(std::move(create_info_ptr) ); + } /* Determine which extensions we need to request for */ { diff --git a/examples/PushConstants/src/app.cpp b/examples/PushConstants/src/app.cpp index 2e044665..e3c806bf 100644 --- a/examples/PushConstants/src/app.cpp +++ b/examples/PushConstants/src/app.cpp @@ -36,6 +36,7 @@ #include "misc/graphics_pipeline_create_info.h" #include "misc/image_create_info.h" #include "misc/image_view_create_info.h" +#include "misc/instance_create_info.h" #include "misc/io.h" #include "misc/memory_allocator.h" #include "misc/object_tracker.h" @@ -276,8 +277,14 @@ void App::draw_frame() present_wait_semaphore_ptr = curr_frame_signal_semaphore_ptr; /* Determine the semaphore which the swapchain image */ - n_swapchain_image = m_swapchain_ptr->acquire_image(curr_frame_wait_semaphore_ptr, - true); /* in_should_block */ + { + const auto acquire_result = m_swapchain_ptr->acquire_image(curr_frame_wait_semaphore_ptr, + &n_swapchain_image, + true); /* in_should_block */ + + ANVIL_REDUNDANT_VARIABLE_CONST(acquire_result); + anvil_assert (acquire_result == Anvil::SwapchainOperationErrorCode::SUCCESS); + } /* Submit work chunk and present */ update_data_ub_contents(n_swapchain_image); @@ -292,10 +299,18 @@ void App::draw_frame() false /* should_block */) ); - present_queue_ptr->present(m_swapchain_ptr.get(), - n_swapchain_image, - 1, /* n_wait_semaphores */ - &present_wait_semaphore_ptr); + { + Anvil::SwapchainOperationErrorCode present_result = Anvil::SwapchainOperationErrorCode::DEVICE_LOST; + + present_queue_ptr->present(m_swapchain_ptr.get(), + n_swapchain_image, + 1, /* n_wait_semaphores */ + &present_wait_semaphore_ptr, + &present_result); + + ANVIL_REDUNDANT_VARIABLE(present_result); + anvil_assert (present_result == Anvil::SwapchainOperationErrorCode::SUCCESS); + } ++n_frames_rendered; @@ -872,17 +887,21 @@ void App::init_window() void App::init_vulkan() { /* Create a Vulkan instance */ - m_instance_ptr = Anvil::Instance::create(APP_NAME, /* in_app_name */ - APP_NAME, /* in_engine_name */ + { + auto create_info_ptr = Anvil::InstanceCreateInfo::create(APP_NAME, /* in_app_name */ + APP_NAME, /* in_engine_name */ #ifdef ENABLE_VALIDATION - std::bind(&App::on_validation_callback, - this, - std::placeholders::_1, - std::placeholders::_2), + std::bind(&App::on_validation_callback, + this, + std::placeholders::_1, + std::placeholders::_2), #else - Anvil::DebugCallbackFunction(), + Anvil::DebugCallbackFunction(), #endif - false); /* in_mt_safe */ + false); /* in_mt_safe */ + + m_instance_ptr = Anvil::Instance::create(std::move(create_info_ptr) ); + } m_physical_device_ptr = m_instance_ptr->get_physical_device(0); diff --git a/include/misc/extensions.h b/include/misc/extensions.h index 90e8a0d6..feedd068 100644 --- a/include/misc/extensions.h +++ b/include/misc/extensions.h @@ -66,6 +66,7 @@ namespace Anvil ValueType khr_16bit_storage; ValueType khr_8bit_storage; ValueType khr_bind_memory2; + ValueType khr_create_renderpass2; ValueType khr_dedicated_allocation; ValueType khr_descriptor_update_template; ValueType khr_device_group; @@ -153,6 +154,7 @@ namespace Anvil {ExtensionData(VK_KHR_16BIT_STORAGE_EXTENSION_NAME, &khr_16bit_storage)}, {ExtensionData(VK_KHR_8BIT_STORAGE_EXTENSION_NAME, &khr_8bit_storage)}, {ExtensionData(VK_KHR_BIND_MEMORY_2_EXTENSION_NAME, &khr_bind_memory2)}, + {ExtensionData(VK_KHR_CREATE_RENDERPASS_2_EXTENSION_NAME, &khr_create_renderpass2)}, {ExtensionData(VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME, &khr_dedicated_allocation)}, {ExtensionData(VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME, &khr_descriptor_update_template)}, {ExtensionData(VK_KHR_DEVICE_GROUP_EXTENSION_NAME, &khr_device_group)}, @@ -330,6 +332,7 @@ namespace Anvil virtual ValueType khr_16bit_storage () const = 0; virtual ValueType khr_8bit_storage () const = 0; virtual ValueType khr_bind_memory2 () const = 0; + virtual ValueType khr_create_renderpass2 () const = 0; virtual ValueType khr_dedicated_allocation () const = 0; virtual ValueType khr_descriptor_update_template () const = 0; virtual ValueType khr_device_group () const = 0; @@ -719,6 +722,13 @@ namespace Anvil return m_device_extensions_ptr->khr_bind_memory2; } + ValueType khr_create_renderpass2() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_create_renderpass2; + } + ValueType khr_dedicated_allocation() const final { anvil_assert(m_expose_device_extensions); diff --git a/include/misc/glsl_to_spirv.h b/include/misc/glsl_to_spirv.h index fa9bfd28..1d3b1b95 100644 --- a/include/misc/glsl_to_spirv.h +++ b/include/misc/glsl_to_spirv.h @@ -205,6 +205,35 @@ namespace Anvil bool add_extension_behavior(std::string in_extension_name, ExtensionBehavior in_behavior); + /** Replaces all instances of [placeholder_name] with [value] in the shader source. + * + * @param in_placeholder_name As specified above. + * @param in_value As specified above. + * + * @return true if the function succeeded, false otherwise. + **/ + bool add_placeholder_value_pair(const std::string& in_placeholder_name, + const std::string& in_value); + + /** Replaces all instances of [placeholder_name] with [value] in the shader source. + * + * @param in_placeholder_name As specified above. + * @param in_value As specified above. + * + * @return true if the function succeeded, false otherwise. + **/ + template + bool add_placeholder_value_pair(const std::string& in_placeholder_name, + const T& in_value) + { + std::stringstream value_sstream; + + value_sstream << in_value; + + return add_placeholder_value_pair(in_placeholder_name, + value_sstream.str() ); + } + /** Adds a new pragma which is going to be injected into the GLSL code. * * @param in_pragma_name Value to follow the #pragma keyword. @@ -317,8 +346,9 @@ namespace Anvil private: /* Private type declarations */ - typedef std::map ExtensionNameToExtensionBehaviorMap; - typedef std::map DefinitionNameToValueMap; + typedef std::map ExtensionNameToExtensionBehaviorMap; + typedef std::map DefinitionNameToValueMap; + typedef std::vector> PlaceholderNameAndValueVector; /* Private functions */ ANVIL_DISABLE_ASSIGNMENT_OPERATOR(GLSLShaderToSPIRVGenerator); @@ -360,6 +390,7 @@ namespace Anvil DefinitionNameToValueMap m_definition_values; ExtensionNameToExtensionBehaviorMap m_extension_behaviors; + PlaceholderNameAndValueVector m_placeholder_values; DefinitionNameToValueMap m_pragmas; }; }; /* namespace Anvil */ diff --git a/include/misc/graphics_pipeline_create_info.h b/include/misc/graphics_pipeline_create_info.h index c3944df2..89355778 100644 --- a/include/misc/graphics_pipeline_create_info.h +++ b/include/misc/graphics_pipeline_create_info.h @@ -283,11 +283,11 @@ namespace Anvil * * @param out_opt_sample_count_ptr If not null, deref will be set to the enum value telling * the sample count assigned to the pipeline. - * @param out_opt_sample_mask_ptr If not null, deref will be set to the sample mask assigned + * @param out_opt_sample_mask_ptr If not null, deref will be set to a ptr to the sample mask assigned * to the pipeline. **/ void get_multisampling_properties(Anvil::SampleCountFlagBits* out_opt_sample_count_ptr, - VkSampleMask* out_opt_sample_mask_ptr) const; + const VkSampleMask** out_opt_sample_mask_ptr_ptr) const; /** Tells the number of dynamic scissor boxes. **/ uint32_t get_n_dynamic_scissor_boxes() const; diff --git a/include/misc/instance_create_info.h b/include/misc/instance_create_info.h new file mode 100644 index 00000000..5b0f1249 --- /dev/null +++ b/include/misc/instance_create_info.h @@ -0,0 +1,151 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef MISC_INSTANCE_CREATE_INFO_H +#define MISC_INSTANCE_CREATE_INFO_H + +#include "misc/types.h" + + +namespace Anvil +{ + typedef std::function DebugCallbackFunction; + + class InstanceCreateInfo + { + public: + /* Public functions */ + + /** Instantiates a new create info which must be specified when creating Anvil Instance object. + * + * @param in_app_name Name of the application, to be passed in VkCreateInstanceInfo + * structure. + * @param in_engine_name Name of the engine, to be passed in VkCreateInstanceInfo + * structure. + * @param in_opt_validation_callback_function If not nullptr, the specified function will be called whenever + * a call-back from any of the validation layers is received. + * Ignored otherwise. + * @param in_mt_safe True if all instance-based operations where external host synchronization + * is required should be automatically synchronized by Anvil. + * @param in_opt_disallowed_instance_level_extensions Optional vector holding instance-level extension names that must NOT be + * requested at creation time. + **/ + static Anvil::InstanceCreateInfoUniquePtr create(const std::string& in_app_name, + const std::string& in_engine_name, + Anvil::DebugCallbackFunction in_opt_validation_callback_proc, + bool in_mt_safe, + const std::vector& in_opt_disallowed_instance_level_extensions = std::vector() ); + + const std::string& get_app_name() const + { + return m_app_name; + } + + const std::vector& get_disallowed_instance_level_extensions() const + { + return m_disallowed_instance_level_extensions; + } + + const std::string& get_engine_name() const + { + return m_engine_name; + } + + /* Returns memory type index which should be used by Anvil when allocating memory. This value can be specified with set_n_memory_type_to_use_for_all_allocs(). + * + * If UINT32_MAX is returned, Anvil will be free to use any memory type determined to be valid for particular memory allocations. This is the default behavior. + **/ + uint32_t get_n_memory_type_to_use_for_all_allocs() const + { + return m_n_memory_type_to_use_for_all_alocs; + } + + const Anvil::DebugCallbackFunction& get_validation_callback() const + { + return m_validation_callback; + } + + const bool& is_mt_safe() const + { + return m_is_mt_safe; + } + + void set_app_name(const std::string& in_app_name) + { + m_app_name = in_app_name; + } + + void set_disallowed_instance_level_extensions(const std::vector& in_extensions) + { + m_disallowed_instance_level_extensions = in_extensions; + } + + void set_engine_name(const std::string& in_engine_name) + { + m_engine_name = in_engine_name; + } + + /* When called, any memory allocations performed by objects owned by Anvil Instance object created using this create info structure + * will always use the specified memory type index. + * + * This function should not be called unless you have a good understanding of the implications. + */ + void set_n_memory_type_to_use_for_all_allocs(const uint32_t& in_n_memory_type_to_use_for_all_allocs) + { + m_n_memory_type_to_use_for_all_alocs = in_n_memory_type_to_use_for_all_allocs; + } + + void set_validation_callback(const Anvil::DebugCallbackFunction& in_validation_callback) + { + m_validation_callback = in_validation_callback; + } + + void set_is_mt_safe(const bool& in_is_mt_safe) + { + m_is_mt_safe = in_is_mt_safe; + } + + private: + + /* Private functions */ + InstanceCreateInfo(const std::string& in_app_name, + const std::string& in_engine_name, + Anvil::DebugCallbackFunction in_opt_validation_callback_proc, + bool in_mt_safe, + const std::vector& in_opt_disallowed_instance_level_extensions); + + /* Private variables */ + + std::string m_app_name; + std::vector m_disallowed_instance_level_extensions; + std::string m_engine_name; + bool m_is_mt_safe; + uint32_t m_n_memory_type_to_use_for_all_alocs; + Anvil::DebugCallbackFunction m_validation_callback; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(InstanceCreateInfo); + ANVIL_DISABLE_COPY_CONSTRUCTOR(InstanceCreateInfo); + }; + +}; /* namespace Anvil */ + +#endif /* MISC_INSTANCE_CREATE_INFO_H */ diff --git a/include/misc/memory_allocator.h b/include/misc/memory_allocator.h index a37aeefe..f3579141 100644 --- a/include/misc/memory_allocator.h +++ b/include/misc/memory_allocator.h @@ -488,6 +488,11 @@ namespace Anvil static Anvil::MemoryAllocatorUniquePtr create_vma(const Anvil::BaseDevice* in_device_ptr, MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE); + static bool get_mem_types_supporting_mem_features(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_memory_types, + const Anvil::MemoryFeatureFlags& in_memory_features, + uint32_t* out_opt_filtered_memory_types_ptr); + /** By default, once memory regions are baked, memory allocator will bind them to objects specified * at add_*() call time. Use cases exist where apps may prefer to handle this action on their own. * @@ -547,9 +552,6 @@ namespace Anvil bool do_bind_sparse_device_indices_sanity_check (const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) const; bool do_external_memory_handle_type_sanity_checks(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const; - bool is_alloc_supported (uint32_t in_memory_types, - Anvil::MemoryFeatureFlags in_memory_features, - uint32_t* out_opt_filtered_memory_types_ptr) const; void on_is_alloc_pending_for_buffer_query(CallbackArgument* in_callback_arg_ptr); void on_is_alloc_pending_for_image_query (CallbackArgument* in_callback_arg_ptr); diff --git a/include/misc/memory_block_create_info.h b/include/misc/memory_block_create_info.h index b99216ab..8571a3dd 100644 --- a/include/misc/memory_block_create_info.h +++ b/include/misc/memory_block_create_info.h @@ -65,6 +65,9 @@ namespace Anvil * to MemoryBlock::create(). * * TODO + * + * @param in_allowed_memory_bits A bitfield whose indices correspond to memory type indices which can be used for the allocation. + * */ static MemoryBlockCreateInfoUniquePtr create_derived_with_custom_delete_proc(const Anvil::BaseDevice* in_device_ptr, VkDeviceMemory in_memory, diff --git a/include/misc/render_pass_create_info.h b/include/misc/render_pass_create_info.h index a1776ad9..e71852a3 100644 --- a/include/misc/render_pass_create_info.h +++ b/include/misc/render_pass_create_info.h @@ -115,20 +115,20 @@ namespace Anvil Anvil::ImageLayout in_layout, RenderPassAttachmentID in_attachment_id, uint32_t in_location, - const RenderPassAttachmentID* in_opt_attachment_resolve_id_ptr); + const RenderPassAttachmentID* in_opt_attachment_resolve_id_ptr = nullptr); /** Configures the depth+stencil attachment the subpass should use. * * Note that only up to one depth/stencil attachment may be added for each subpass. - * Any attempt to add more such attachments will results in an assertion failure. - * - * @param in_subpass_id ID of the subpass to update the depth+stencil attachment for. - * The subpass must have been earlier created with an add_subpass() call. - * @param in_layout Layout to use for the attachment when executing the subpass. - * Driver takes care of transforming the attachment to the requested layout - * before subpass commands starts executing. - * @param in_attachment_id ID of the render-pass attachment the depth-stencil attachment should refer to. - * + * Any attempt to add more such attachments will result in an assertion failure. + * + * @param in_subpass_id ID of the subpass to update the depth+stencil attachment for. + * The subpass must have been earlier created with an add_subpass() call. + * @param in_layout Layout to use for the attachment when executing the subpass. + * Driver takes care of transforming the attachment to the requested layout + * before subpass commands starts executing. + * @param in_attachment_id ID of the render-pass attachment the depth-stencil attachment should refer to. + * @return true if the function executed successfully, false otherwise. * */ @@ -358,15 +358,15 @@ namespace Anvil * @return true if successful, false otherwise. **/ bool get_depth_stencil_attachment_properties(RenderPassAttachmentID in_attachment_id, - Anvil::Format* out_opt_format_ptr = nullptr, - Anvil::SampleCountFlagBits* out_opt_sample_count_ptr = nullptr, - Anvil::AttachmentLoadOp* out_opt_depth_load_op_ptr = nullptr, - Anvil::AttachmentStoreOp* out_opt_depth_store_op_ptr = nullptr, - Anvil::AttachmentLoadOp* out_opt_stencil_load_op_ptr = nullptr, - Anvil::AttachmentStoreOp* out_opt_stencil_store_op_ptr = nullptr, - Anvil::ImageLayout* out_opt_initial_layout_ptr = nullptr, - Anvil::ImageLayout* out_opt_final_layout_ptr = nullptr, - bool* out_opt_may_alias_ptr = nullptr) const; + Anvil::Format* out_opt_format_ptr = nullptr, + Anvil::SampleCountFlagBits* out_opt_sample_count_ptr = nullptr, + Anvil::AttachmentLoadOp* out_opt_depth_load_op_ptr = nullptr, + Anvil::AttachmentStoreOp* out_opt_depth_store_op_ptr = nullptr, + Anvil::AttachmentLoadOp* out_opt_stencil_load_op_ptr = nullptr, + Anvil::AttachmentStoreOp* out_opt_stencil_store_op_ptr = nullptr, + Anvil::ImageLayout* out_opt_initial_layout_ptr = nullptr, + Anvil::ImageLayout* out_opt_final_layout_ptr = nullptr, + bool* out_opt_may_alias_ptr = nullptr) const; const Anvil::BaseDevice* get_device() const { @@ -425,12 +425,26 @@ namespace Anvil * * @return true if successful, false otherwise. */ - bool get_subpass_attachment_properties(SubPassID in_subpass_id, - AttachmentType in_attachment_type, - uint32_t in_n_subpass_attachment, - RenderPassAttachmentID* out_renderpass_attachment_id_ptr, - Anvil::ImageLayout* out_layout_ptr, - Anvil::ImageAspectFlags* out_opt_aspects_accessed_ptr = nullptr) const; + bool get_subpass_attachment_properties(SubPassID in_subpass_id, + AttachmentType in_attachment_type, + uint32_t in_n_subpass_attachment, + RenderPassAttachmentID* out_renderpass_attachment_id_ptr, + Anvil::ImageLayout* out_layout_ptr, + Anvil::ImageAspectFlags* out_opt_aspects_accessed_ptr = nullptr, + RenderPassAttachmentID* out_opt_attachment_resolve_id_ptr = nullptr, + uint32_t* out_opt_location_ptr = nullptr) const; + + /* Returns highest location used by subpass attachments. + * + * @param in_subpass_id ID of the subpass to issue the query against. + * @param out_result_ptr If function returns true, deref will be set to the highest location specified when adding attachments + * to this subpass. + * + * @return true if successful, false otherwise. The latter will be returned if no attachments have been added to the subpass, prior + * to making this call. + */ + bool get_subpass_highest_location(SubPassID in_subpass_id, + uint32_t* out_result_ptr) const; /** Returns the number of attachments of user-specified type, defined for the specified subpass. * @@ -683,6 +697,7 @@ namespace Anvil SubPassAttachment depth_stencil_attachment; uint32_t index; uint32_t multiview_view_mask; + uint32_t n_highest_location_used; LocationToSubPassAttachmentMap input_attachments_map; SubPassAttachmentVector preserved_attachments; LocationToSubPassAttachmentMap resolved_attachments_map; @@ -708,8 +723,9 @@ namespace Anvil /** Dummy constructor. This should only be used by STL containers */ SubPass() { - index = UINT32_MAX; - multiview_view_mask = 0; + index = UINT32_MAX; + multiview_view_mask = 0; + n_highest_location_used = 0; } /** Constructor. @@ -719,8 +735,9 @@ namespace Anvil **/ SubPass(uint32_t in_index) { - index = in_index; - multiview_view_mask = 0; + index = in_index; + multiview_view_mask = 0; + n_highest_location_used = 0; } /* Destructor */ @@ -829,21 +846,21 @@ namespace Anvil /* Private functions */ - bool add_dependency (SubPass* in_destination_subpass_ptr, - SubPass* in_source_subpass_ptr, - Anvil::PipelineStageFlags in_source_stage_mask, - Anvil::PipelineStageFlags in_destination_stage_mask, - Anvil::AccessFlags in_source_access_mask, - Anvil::AccessFlags in_destination_access_mask, - Anvil::DependencyFlags in_dependency_flags); - bool add_subpass_attachment(SubPassID in_subpass_id, - bool in_is_color_attachment, - Anvil::ImageLayout in_input_layout, - RenderPassAttachmentID in_attachment_id, - uint32_t in_attachment_location, - bool in_should_resolve, - RenderPassAttachmentID in_resolve_attachment_id, - const Anvil::ImageAspectFlags& in_opt_aspects_accessed = Anvil::ImageAspectFlagBits::NONE); + bool add_dependency (SubPass* in_destination_subpass_ptr, + SubPass* in_source_subpass_ptr, + Anvil::PipelineStageFlags in_source_stage_mask, + Anvil::PipelineStageFlags in_destination_stage_mask, + Anvil::AccessFlags in_source_access_mask, + Anvil::AccessFlags in_destination_access_mask, + Anvil::DependencyFlags in_dependency_flags); + bool add_subpass_color_input_attachment(SubPassID in_subpass_id, + bool in_is_color_attachment, + Anvil::ImageLayout in_input_layout, + RenderPassAttachmentID in_attachment_id, + uint32_t in_attachment_location, + bool in_should_resolve, + RenderPassAttachmentID in_resolve_attachment_id, + const Anvil::ImageAspectFlags& in_aspects_accessed); VkAttachmentReference get_attachment_reference_from_renderpass_attachment(const RenderPassAttachment& in_renderpass_attachment) const; VkAttachmentReference get_attachment_reference_from_subpass_attachment (const SubPassAttachment& in_subpass_attachment) const; diff --git a/include/misc/struct_chainer.h b/include/misc/struct_chainer.h index 37030284..4f7df22a 100644 --- a/include/misc/struct_chainer.h +++ b/include/misc/struct_chainer.h @@ -266,6 +266,18 @@ namespace Anvil return reinterpret_cast(&m_structs.at(m_structs.size() - 1).at(0) ); } + uint32_t get_n_structs() const + { + return static_cast(m_structs.size() ); + } + + StructType* get_root_struct() + { + anvil_assert(m_structs.size() > 0); + + return reinterpret_cast(&m_structs.at(0).at(0) ); + } + const StructType* get_root_struct() const { anvil_assert(m_structs.size() > 0); @@ -273,6 +285,17 @@ namespace Anvil return reinterpret_cast(&m_structs.at(0).at(0) ); } + VkStructHeader* get_struct_at_index(const uint32_t& in_index) + { + VkStructHeader* result_ptr = nullptr; + + if (m_structs.size() > in_index) + { + result_ptr = reinterpret_cast(&m_structs.at(in_index).at(0) ); + } + + return result_ptr; + } private: /* Private type definitions */ typedef struct HelperStruct diff --git a/include/misc/swapchain_create_info.h b/include/misc/swapchain_create_info.h index 551f1591..62ffcdbf 100644 --- a/include/misc/swapchain_create_info.h +++ b/include/misc/swapchain_create_info.h @@ -48,7 +48,14 @@ namespace Anvil Anvil::ColorSpaceKHR in_color_space, Anvil::PresentModeKHR in_present_mode, Anvil::ImageUsageFlags in_usage_flags, - uint32_t in_n_images); + uint32_t in_n_images, + const bool& in_clipped = true, + const Anvil::Swapchain* in_opt_old_swapchain_ptr = nullptr); + + const bool& get_clipped() const + { + return m_clipped; + } Anvil::ColorSpaceKHR get_color_space() const { @@ -89,6 +96,11 @@ namespace Anvil return m_n_images; } + const Anvil::Swapchain* get_old_swapchain() const + { + return m_old_swapchain_ptr; + } + Anvil::PresentModeKHR get_present_mode() const { return m_present_mode; @@ -112,6 +124,11 @@ namespace Anvil return m_window_ptr; } + void set_clipped(const bool& in_clipped) + { + m_clipped = in_clipped; + } + void set_color_space(const Anvil::ColorSpaceKHR& in_color_space) { m_color_space = in_color_space; @@ -147,6 +164,11 @@ namespace Anvil m_n_images = in_n_images; } + void set_old_swapchain(const Anvil::Swapchain* in_old_swapchain_ptr) + { + m_old_swapchain_ptr = in_old_swapchain_ptr; + } + void set_present_mode(const Anvil::PresentModeKHR& in_present_mode) { m_present_mode = in_present_mode; @@ -181,10 +203,13 @@ namespace Anvil uint32_t in_n_images, MTSafety in_mt_safety, Anvil::SwapchainCreateFlags in_flags, - Anvil::DeviceGroupPresentModeFlags in_mgpu_present_mode_flags); + Anvil::DeviceGroupPresentModeFlags in_mgpu_present_mode_flags, + const bool& in_clipped, + const Anvil::Swapchain* in_opt_old_swapchain_ptr); /* Private variables */ + bool m_clipped; Anvil::ColorSpaceKHR m_color_space; const Anvil::BaseDevice* m_device_ptr; Anvil::SwapchainCreateFlags m_flags; @@ -192,6 +217,7 @@ namespace Anvil Anvil::DeviceGroupPresentModeFlags m_mgpu_present_mode_flags; Anvil::MTSafety m_mt_safety; uint32_t m_n_images; + const Anvil::Swapchain* m_old_swapchain_ptr; Anvil::RenderingSurface* m_parent_surface_ptr; Anvil::PresentModeKHR m_present_mode; Anvil::Window* m_window_ptr; diff --git a/include/misc/types.h b/include/misc/types.h index 508eb673..d3fb026c 100644 --- a/include/misc/types.h +++ b/include/misc/types.h @@ -140,6 +140,7 @@ namespace Anvil class ImageView; class ImageViewCreateInfo; class Instance; + class InstanceCreateInfo; class MemoryAllocator; class MemoryBlock; class MemoryBlockCreateInfo; @@ -201,6 +202,7 @@ namespace Anvil typedef std::unique_ptr > ImageUniquePtr; typedef std::unique_ptr ImageViewCreateInfoUniquePtr; typedef std::unique_ptr > ImageViewUniquePtr; + typedef std::unique_ptr InstanceCreateInfoUniquePtr; typedef std::unique_ptr > InstanceUniquePtr; typedef std::unique_ptr > MemoryAllocatorUniquePtr; typedef std::unique_ptr MemoryBlockCreateInfoUniquePtr; diff --git a/include/misc/types_enums.h b/include/misc/types_enums.h index 15d6bbc7..daf42a3b 100644 --- a/include/misc/types_enums.h +++ b/include/misc/types_enums.h @@ -1804,6 +1804,16 @@ namespace Anvil INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(SwapchainCreateFlags, VkSwapchainCreateFlagsKHR, SwapchainCreateFlagBits) + /* Note: These map 1:1 to corresponding VK error & VK swapchain error codes. */ + enum class SwapchainOperationErrorCode + { + DEVICE_LOST = VK_ERROR_DEVICE_LOST, + OUT_OF_DATE = VK_ERROR_OUT_OF_DATE_KHR, + SUBOPTIMAL = VK_SUBOPTIMAL_KHR, + SUCCESS = VK_SUCCESS, + SURFACE_LOST = VK_ERROR_SURFACE_LOST_KHR + }; + /* NOTE: Enums map 1:1 to their VK equivalents */ enum class TessellationDomainOrigin { diff --git a/include/misc/types_struct.h b/include/misc/types_struct.h index dff6c4ed..201256c2 100644 --- a/include/misc/types_struct.h +++ b/include/misc/types_struct.h @@ -401,7 +401,6 @@ namespace Anvil Anvil::AccessFlags src_access_mask; VkBuffer buffer; - VkBufferMemoryBarrier buffer_barrier_vk; Anvil::Buffer* buffer_ptr; uint32_t dst_queue_family_index; VkDeviceSize offset; @@ -446,21 +445,7 @@ namespace Anvil /** Returns a Vulkan buffer memory barrier descriptor, whose configuration corresponds to * to the configuration of this descriptor. **/ - virtual VkBufferMemoryBarrier get_barrier_vk() const - { - return buffer_barrier_vk; - } - - /** Returns a pointer to the Vulkan descriptor, whose configuration corresponds to - * the configuration of this descriptor. - * - * The returned pointer remains valid for the duration of the Barrier descriptor's - * life-time. - **/ - const VkBufferMemoryBarrier* get_barrier_vk_ptr() const - { - return &buffer_barrier_vk; - } + virtual VkBufferMemoryBarrier get_barrier_vk() const; bool operator==(const BufferBarrier&) const; private: @@ -674,10 +659,10 @@ namespace Anvil typedef struct EXTPCIBusInfoProperties { - uint8_t pci_bus; - uint8_t pci_device; - uint16_t pci_domain; - uint8_t pci_function; + uint32_t pci_bus; + uint32_t pci_device; + uint32_t pci_domain; + uint32_t pci_function; EXTPCIBusInfoProperties(); EXTPCIBusInfoProperties(const VkPhysicalDevicePCIBusInfoPropertiesEXT& in_props); @@ -883,6 +868,16 @@ namespace Anvil ExtensionEXTTransformFeedbackEntrypoints(); } ExtensionEXTTransformFeedbackEntrypoints; + typedef struct ExtensionKHRCreateRenderpass2Entrypoints + { + PFN_vkCreateRenderPass2KHR vkCreateRenderPass2KHR; + PFN_vkCmdBeginRenderPass2KHR vkCmdBeginRenderPass2KHR; + PFN_vkCmdNextSubpass2KHR vkCmdNextSubpass2KHR; + PFN_vkCmdEndRenderPass2KHR vkCmdEndRenderPass2KHR; + + ExtensionKHRCreateRenderpass2Entrypoints(); + } ExtensionKHRCreateRenderpass2Entrypoints; + typedef struct ExtensionKHRDeviceGroupEntrypoints { PFN_vkAcquireNextImage2KHR vkAcquireNextImage2KHR; @@ -1329,17 +1324,6 @@ namespace Anvil return image_barrier_vk; } - /** Returns a pointer to the Vulkan descriptor, whose configuration corresponds to - * the configuration of this descriptor. - * - * The returned pointer remains valid for the duration of the Barrier descriptor's - * life-time. - **/ - const VkImageMemoryBarrier* get_barrier_vk_ptr() const - { - return &image_barrier_vk; - } - bool operator==(const ImageBarrier& in_barrier) const; private: @@ -1565,17 +1549,6 @@ namespace Anvil { return memory_barrier_vk; } - - /** Returns a pointer to the Vulkan descriptor, whose configuration corresponds to - * the configuration of this descriptor. - * - * The returned pointer remains valid for the duration of the Barrier descriptor's - * life-time. - **/ - virtual const VkMemoryBarrier* get_barrier_vk_ptr() const - { - return &memory_barrier_vk; - } } MemoryBarrier; /** Holds properties of a single Vulkan Memory Heap. */ diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h index 77da6378..a3be4af6 100644 --- a/include/vulkan/vulkan.h +++ b/include/vulkan/vulkan.h @@ -2,7 +2,7 @@ #define VULKAN_H_ 1 /* -** Copyright (c) 2015-2018 The Khronos Group Inc. +** Copyright (c) 2015-2019 The Khronos Group Inc. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. diff --git a/include/vulkan/vulkan_android.h b/include/vulkan/vulkan_android.h index 07aaeda2..e70376c8 100644 --- a/include/vulkan/vulkan_android.h +++ b/include/vulkan/vulkan_android.h @@ -6,7 +6,7 @@ extern "C" { #endif /* -** Copyright (c) 2015-2018 The Khronos Group Inc. +** Copyright (c) 2015-2019 The Khronos Group Inc. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. diff --git a/include/vulkan/vulkan_core.h b/include/vulkan/vulkan_core.h index 4cd8ed51..caeecd9b 100644 --- a/include/vulkan/vulkan_core.h +++ b/include/vulkan/vulkan_core.h @@ -6,7 +6,7 @@ extern "C" { #endif /* -** Copyright (c) 2015-2018 The Khronos Group Inc. +** Copyright (c) 2015-2019 The Khronos Group Inc. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ extern "C" { #define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) #define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff) // Version of this file -#define VK_HEADER_VERSION 91 +#define VK_HEADER_VERSION 97 #define VK_NULL_HANDLE 0 @@ -148,6 +148,7 @@ typedef enum VkResult { VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT = -1000158000, VK_ERROR_FRAGMENTATION_EXT = -1000161000, VK_ERROR_NOT_PERMITTED_EXT = -1000174001, + VK_ERROR_INVALID_DEVICE_ADDRESS_EXT = -1000244000, VK_ERROR_OUT_OF_POOL_MEMORY_KHR = VK_ERROR_OUT_OF_POOL_MEMORY, VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR = VK_ERROR_INVALID_EXTERNAL_HANDLE, VK_RESULT_BEGIN_RANGE = VK_ERROR_FRAGMENTED_POOL, @@ -327,6 +328,7 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT = 1000081000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT = 1000081001, VK_STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT = 1000081002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR = 1000082000, VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000, VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000, VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001, @@ -442,6 +444,9 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT = 1000190001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT = 1000190002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR = 1000196000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR = 1000197000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES_KHR = 1000199000, + VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR = 1000199001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV = 1000201000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV = 1000202000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV = 1000202001, @@ -454,6 +459,18 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR = 1000211000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT = 1000212000, VK_STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA = 1000214000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT = 1000218000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT = 1000218001, + VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT = 1000218002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT = 1000221000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT = 1000237000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT = 1000238000, + VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT = 1000238001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT = 1000244000, + VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT = 1000244001, + VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT = 1000244002, + VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO_EXT = 1000246000, + VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT = 1000247000, VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT, VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES, @@ -877,6 +894,7 @@ typedef enum VkImageLayout { VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002, VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR = 1000111000, VK_IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV = 1000164003, + VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT = 1000218000, VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_BEGIN_RANGE = VK_IMAGE_LAYOUT_UNDEFINED, @@ -1324,6 +1342,7 @@ typedef enum VkFormatFeatureFlagBits { VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT = 0x00800000, VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000, VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT = 0x00010000, + VK_FORMAT_FEATURE_FRAGMENT_DENSITY_MAP_BIT_EXT = 0x01000000, VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT, VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_DST_BIT, VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT_KHR = VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT, @@ -1347,6 +1366,7 @@ typedef enum VkImageUsageFlagBits { VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, VK_IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV = 0x00000100, + VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT = 0x00000200, VK_IMAGE_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkImageUsageFlagBits; typedef VkFlags VkImageUsageFlags; @@ -1366,6 +1386,7 @@ typedef enum VkImageCreateFlagBits { VK_IMAGE_CREATE_DISJOINT_BIT = 0x00000200, VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV = 0x00002000, VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT = 0x00001000, + VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT = 0x00004000, VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT, VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT, VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR = VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT, @@ -1450,6 +1471,7 @@ typedef enum VkPipelineStageFlagBits { VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_NV = 0x02000000, VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV = 0x00080000, VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV = 0x00100000, + VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT = 0x00800000, VK_PIPELINE_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkPipelineStageFlagBits; typedef VkFlags VkPipelineStageFlags; @@ -1527,6 +1549,7 @@ typedef enum VkBufferCreateFlagBits { VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, VK_BUFFER_CREATE_PROTECTED_BIT = 0x00000008, + VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT = 0x00000010, VK_BUFFER_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkBufferCreateFlagBits; typedef VkFlags VkBufferCreateFlags; @@ -1545,10 +1568,16 @@ typedef enum VkBufferUsageFlagBits { VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT = 0x00001000, VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT = 0x00000200, VK_BUFFER_USAGE_RAY_TRACING_BIT_NV = 0x00000400, + VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT = 0x00020000, VK_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkBufferUsageFlagBits; typedef VkFlags VkBufferUsageFlags; typedef VkFlags VkBufferViewCreateFlags; + +typedef enum VkImageViewCreateFlagBits { + VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT = 0x00000001, + VK_IMAGE_VIEW_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkImageViewCreateFlagBits; typedef VkFlags VkImageViewCreateFlags; typedef VkFlags VkShaderModuleCreateFlags; typedef VkFlags VkPipelineCacheCreateFlags; @@ -1615,6 +1644,12 @@ typedef VkFlags VkColorComponentFlags; typedef VkFlags VkPipelineDynamicStateCreateFlags; typedef VkFlags VkPipelineLayoutCreateFlags; typedef VkFlags VkShaderStageFlags; + +typedef enum VkSamplerCreateFlagBits { + VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT = 0x00000001, + VK_SAMPLER_CREATE_SUBSAMPLED_COARSE_RECONSTRUCTION_BIT_EXT = 0x00000002, + VK_SAMPLER_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkSamplerCreateFlagBits; typedef VkFlags VkSamplerCreateFlags; typedef enum VkDescriptorSetLayoutCreateFlagBits { @@ -1675,6 +1710,7 @@ typedef enum VkAccessFlagBits { VK_ACCESS_SHADING_RATE_IMAGE_READ_BIT_NV = 0x00800000, VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_NV = 0x00200000, VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_NV = 0x00400000, + VK_ACCESS_FRAGMENT_DENSITY_MAP_READ_BIT_EXT = 0x01000000, VK_ACCESS_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkAccessFlagBits; typedef VkFlags VkAccessFlags; @@ -4355,7 +4391,7 @@ typedef struct VkDescriptorUpdateTemplateEntry { typedef struct VkDescriptorUpdateTemplateCreateInfo { VkStructureType sType; - void* pNext; + const void* pNext; VkDescriptorUpdateTemplateCreateFlags flags; uint32_t descriptorUpdateEntryCount; const VkDescriptorUpdateTemplateEntry* pDescriptorUpdateEntries; @@ -4794,6 +4830,7 @@ VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) typedef enum VkSwapchainCreateFlagBitsKHR { VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = 0x00000001, VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR = 0x00000002, + VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR = 0x00000004, VK_SWAPCHAIN_CREATE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF } VkSwapchainCreateFlagBitsKHR; typedef VkFlags VkSwapchainCreateFlagsKHR; @@ -5470,6 +5507,19 @@ VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSetWithTemplateKHR( const void* pData); #endif +#define VK_KHR_shader_float16_int8 1 +#define VK_KHR_SHADER_FLOAT16_INT8_SPEC_VERSION 1 +#define VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME "VK_KHR_shader_float16_int8" + +typedef struct VkPhysicalDeviceFloat16Int8FeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 shaderFloat16; + VkBool32 shaderInt8; +} VkPhysicalDeviceFloat16Int8FeaturesKHR; + + + #define VK_KHR_16bit_storage 1 #define VK_KHR_16BIT_STORAGE_SPEC_VERSION 1 #define VK_KHR_16BIT_STORAGE_EXTENSION_NAME "VK_KHR_16bit_storage" @@ -6101,9 +6151,10 @@ typedef enum VkDriverIdKHR { VK_DRIVER_ID_IMAGINATION_PROPRIETARY_KHR = 7, VK_DRIVER_ID_QUALCOMM_PROPRIETARY_KHR = 8, VK_DRIVER_ID_ARM_PROPRIETARY_KHR = 9, + VK_DRIVER_ID_GOOGLE_PASTEL_KHR = 10, VK_DRIVER_ID_BEGIN_RANGE_KHR = VK_DRIVER_ID_AMD_PROPRIETARY_KHR, - VK_DRIVER_ID_END_RANGE_KHR = VK_DRIVER_ID_ARM_PROPRIETARY_KHR, - VK_DRIVER_ID_RANGE_SIZE_KHR = (VK_DRIVER_ID_ARM_PROPRIETARY_KHR - VK_DRIVER_ID_AMD_PROPRIETARY_KHR + 1), + VK_DRIVER_ID_END_RANGE_KHR = VK_DRIVER_ID_GOOGLE_PASTEL_KHR, + VK_DRIVER_ID_RANGE_SIZE_KHR = (VK_DRIVER_ID_GOOGLE_PASTEL_KHR - VK_DRIVER_ID_AMD_PROPRIETARY_KHR + 1), VK_DRIVER_ID_MAX_ENUM_KHR = 0x7FFFFFFF } VkDriverIdKHR; @@ -6125,6 +6176,73 @@ typedef struct VkPhysicalDeviceDriverPropertiesKHR { +#define VK_KHR_shader_float_controls 1 +#define VK_KHR_SHADER_FLOAT_CONTROLS_SPEC_VERSION 1 +#define VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME "VK_KHR_shader_float_controls" + +typedef struct VkPhysicalDeviceFloatControlsPropertiesKHR { + VkStructureType sType; + void* pNext; + VkBool32 separateDenormSettings; + VkBool32 separateRoundingModeSettings; + VkBool32 shaderSignedZeroInfNanPreserveFloat16; + VkBool32 shaderSignedZeroInfNanPreserveFloat32; + VkBool32 shaderSignedZeroInfNanPreserveFloat64; + VkBool32 shaderDenormPreserveFloat16; + VkBool32 shaderDenormPreserveFloat32; + VkBool32 shaderDenormPreserveFloat64; + VkBool32 shaderDenormFlushToZeroFloat16; + VkBool32 shaderDenormFlushToZeroFloat32; + VkBool32 shaderDenormFlushToZeroFloat64; + VkBool32 shaderRoundingModeRTEFloat16; + VkBool32 shaderRoundingModeRTEFloat32; + VkBool32 shaderRoundingModeRTEFloat64; + VkBool32 shaderRoundingModeRTZFloat16; + VkBool32 shaderRoundingModeRTZFloat32; + VkBool32 shaderRoundingModeRTZFloat64; +} VkPhysicalDeviceFloatControlsPropertiesKHR; + + + +#define VK_KHR_depth_stencil_resolve 1 +#define VK_KHR_DEPTH_STENCIL_RESOLVE_SPEC_VERSION 1 +#define VK_KHR_DEPTH_STENCIL_RESOLVE_EXTENSION_NAME "VK_KHR_depth_stencil_resolve" + + +typedef enum VkResolveModeFlagBitsKHR { + VK_RESOLVE_MODE_NONE_KHR = 0, + VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR = 0x00000001, + VK_RESOLVE_MODE_AVERAGE_BIT_KHR = 0x00000002, + VK_RESOLVE_MODE_MIN_BIT_KHR = 0x00000004, + VK_RESOLVE_MODE_MAX_BIT_KHR = 0x00000008, + VK_RESOLVE_MODE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkResolveModeFlagBitsKHR; +typedef VkFlags VkResolveModeFlagsKHR; + +typedef struct VkSubpassDescriptionDepthStencilResolveKHR { + VkStructureType sType; + const void* pNext; + VkResolveModeFlagBitsKHR depthResolveMode; + VkResolveModeFlagBitsKHR stencilResolveMode; + const VkAttachmentReference2KHR* pDepthStencilResolveAttachment; +} VkSubpassDescriptionDepthStencilResolveKHR; + +typedef struct VkPhysicalDeviceDepthStencilResolvePropertiesKHR { + VkStructureType sType; + void* pNext; + VkResolveModeFlagsKHR supportedDepthResolveModes; + VkResolveModeFlagsKHR supportedStencilResolveModes; + VkBool32 independentResolveNone; + VkBool32 independentResolve; +} VkPhysicalDeviceDepthStencilResolvePropertiesKHR; + + + +#define VK_KHR_swapchain_mutable_format 1 +#define VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_SPEC_VERSION 1 +#define VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_EXTENSION_NAME "VK_KHR_swapchain_mutable_format" + + #define VK_KHR_vulkan_memory_model 1 #define VK_KHR_VULKAN_MEMORY_MODEL_SPEC_VERSION 2 #define VK_KHR_VULKAN_MEMORY_MODEL_EXTENSION_NAME "VK_KHR_vulkan_memory_model" @@ -7446,11 +7564,11 @@ typedef struct VkDebugUtilsMessengerCallbackDataEXT { int32_t messageIdNumber; const char* pMessage; uint32_t queueLabelCount; - VkDebugUtilsLabelEXT* pQueueLabels; + const VkDebugUtilsLabelEXT* pQueueLabels; uint32_t cmdBufLabelCount; - VkDebugUtilsLabelEXT* pCmdBufLabels; + const VkDebugUtilsLabelEXT* pCmdBufLabels; uint32_t objectCount; - VkDebugUtilsObjectNameInfoEXT* pObjects; + const VkDebugUtilsObjectNameInfoEXT* pObjects; } VkDebugUtilsMessengerCallbackDataEXT; typedef VkBool32 (VKAPI_PTR *PFN_vkDebugUtilsMessengerCallbackEXT)( @@ -7791,8 +7909,6 @@ typedef struct VkPipelineCoverageModulationStateCreateInfoNV { #define VK_EXT_image_drm_format_modifier 1 -#define VK_EXT_EXTENSION_159_SPEC_VERSION 0 -#define VK_EXT_EXTENSION_159_EXTENSION_NAME "VK_EXT_extension_159" #define VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_SPEC_VERSION 1 #define VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME "VK_EXT_image_drm_format_modifier" @@ -8116,7 +8232,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetCoarseSampleOrderNV( #define VK_NV_ray_tracing 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkAccelerationStructureNV) -#define VK_NV_RAY_TRACING_SPEC_VERSION 2 +#define VK_NV_RAY_TRACING_SPEC_VERSION 3 #define VK_NV_RAY_TRACING_EXTENSION_NAME "VK_NV_ray_tracing" #define VK_SHADER_UNUSED_NV (~0U) @@ -8792,30 +8908,187 @@ VKAPI_ATTR void VKAPI_CALL vkGetQueueCheckpointDataNV( #endif #define VK_EXT_pci_bus_info 1 -#define VK_EXT_PCI_BUS_INFO_SPEC_VERSION 1 +#define VK_EXT_PCI_BUS_INFO_SPEC_VERSION 2 #define VK_EXT_PCI_BUS_INFO_EXTENSION_NAME "VK_EXT_pci_bus_info" typedef struct VkPhysicalDevicePCIBusInfoPropertiesEXT { VkStructureType sType; void* pNext; - uint16_t pciDomain; - uint8_t pciBus; - uint8_t pciDevice; - uint8_t pciFunction; + uint32_t pciDomain; + uint32_t pciBus; + uint32_t pciDevice; + uint32_t pciFunction; } VkPhysicalDevicePCIBusInfoPropertiesEXT; +#define VK_EXT_fragment_density_map 1 +#define VK_EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION 1 +#define VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME "VK_EXT_fragment_density_map" + +typedef struct VkPhysicalDeviceFragmentDensityMapFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 fragmentDensityMap; + VkBool32 fragmentDensityMapDynamic; + VkBool32 fragmentDensityMapNonSubsampledImages; +} VkPhysicalDeviceFragmentDensityMapFeaturesEXT; + +typedef struct VkPhysicalDeviceFragmentDensityMapPropertiesEXT { + VkStructureType sType; + void* pNext; + VkExtent2D minFragmentDensityTexelSize; + VkExtent2D maxFragmentDensityTexelSize; + VkBool32 fragmentDensityInvocations; +} VkPhysicalDeviceFragmentDensityMapPropertiesEXT; + +typedef struct VkRenderPassFragmentDensityMapCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkAttachmentReference fragmentDensityMapAttachment; +} VkRenderPassFragmentDensityMapCreateInfoEXT; + + + +#define VK_EXT_scalar_block_layout 1 +#define VK_EXT_SCALAR_BLOCK_LAYOUT_SPEC_VERSION 1 +#define VK_EXT_SCALAR_BLOCK_LAYOUT_EXTENSION_NAME "VK_EXT_scalar_block_layout" + +typedef struct VkPhysicalDeviceScalarBlockLayoutFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 scalarBlockLayout; +} VkPhysicalDeviceScalarBlockLayoutFeaturesEXT; + + + #define VK_GOOGLE_hlsl_functionality1 1 -#define VK_GOOGLE_HLSL_FUNCTIONALITY1_SPEC_VERSION 0 +#define VK_GOOGLE_HLSL_FUNCTIONALITY1_SPEC_VERSION 1 #define VK_GOOGLE_HLSL_FUNCTIONALITY1_EXTENSION_NAME "VK_GOOGLE_hlsl_functionality1" #define VK_GOOGLE_decorate_string 1 -#define VK_GOOGLE_DECORATE_STRING_SPEC_VERSION 0 +#define VK_GOOGLE_DECORATE_STRING_SPEC_VERSION 1 #define VK_GOOGLE_DECORATE_STRING_EXTENSION_NAME "VK_GOOGLE_decorate_string" +#define VK_EXT_memory_budget 1 +#define VK_EXT_MEMORY_BUDGET_SPEC_VERSION 1 +#define VK_EXT_MEMORY_BUDGET_EXTENSION_NAME "VK_EXT_memory_budget" + +typedef struct VkPhysicalDeviceMemoryBudgetPropertiesEXT { + VkStructureType sType; + void* pNext; + VkDeviceSize heapBudget[VK_MAX_MEMORY_HEAPS]; + VkDeviceSize heapUsage[VK_MAX_MEMORY_HEAPS]; +} VkPhysicalDeviceMemoryBudgetPropertiesEXT; + + + +#define VK_EXT_memory_priority 1 +#define VK_EXT_MEMORY_PRIORITY_SPEC_VERSION 1 +#define VK_EXT_MEMORY_PRIORITY_EXTENSION_NAME "VK_EXT_memory_priority" + +typedef struct VkPhysicalDeviceMemoryPriorityFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 memoryPriority; +} VkPhysicalDeviceMemoryPriorityFeaturesEXT; + +typedef struct VkMemoryPriorityAllocateInfoEXT { + VkStructureType sType; + const void* pNext; + float priority; +} VkMemoryPriorityAllocateInfoEXT; + + + +#define VK_EXT_buffer_device_address 1 +typedef uint64_t VkDeviceAddress; + +#define VK_EXT_BUFFER_DEVICE_ADDRESS_SPEC_VERSION 2 +#define VK_EXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME "VK_EXT_buffer_device_address" + +typedef struct VkPhysicalDeviceBufferAddressFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 bufferDeviceAddress; + VkBool32 bufferDeviceAddressCaptureReplay; + VkBool32 bufferDeviceAddressMultiDevice; +} VkPhysicalDeviceBufferAddressFeaturesEXT; + +typedef struct VkBufferDeviceAddressInfoEXT { + VkStructureType sType; + const void* pNext; + VkBuffer buffer; +} VkBufferDeviceAddressInfoEXT; + +typedef struct VkBufferDeviceAddressCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkDeviceSize deviceAddress; +} VkBufferDeviceAddressCreateInfoEXT; + + +typedef VkDeviceAddress (VKAPI_PTR *PFN_vkGetBufferDeviceAddressEXT)(VkDevice device, const VkBufferDeviceAddressInfoEXT* pInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkDeviceAddress VKAPI_CALL vkGetBufferDeviceAddressEXT( + VkDevice device, + const VkBufferDeviceAddressInfoEXT* pInfo); +#endif + +#define VK_EXT_separate_stencil_usage 1 +#define VK_EXT_SEPARATE_STENCIL_USAGE_SPEC_VERSION 1 +#define VK_EXT_SEPARATE_STENCIL_USAGE_EXTENSION_NAME "VK_EXT_separate_stencil_usage" + +typedef struct VkImageStencilUsageCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkImageUsageFlags stencilUsage; +} VkImageStencilUsageCreateInfoEXT; + + + +#define VK_EXT_validation_features 1 +#define VK_EXT_VALIDATION_FEATURES_SPEC_VERSION 1 +#define VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME "VK_EXT_validation_features" + + +typedef enum VkValidationFeatureEnableEXT { + VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT = 0, + VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT = 1, + VK_VALIDATION_FEATURE_ENABLE_BEGIN_RANGE_EXT = VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT, + VK_VALIDATION_FEATURE_ENABLE_END_RANGE_EXT = VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT, + VK_VALIDATION_FEATURE_ENABLE_RANGE_SIZE_EXT = (VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT - VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT + 1), + VK_VALIDATION_FEATURE_ENABLE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkValidationFeatureEnableEXT; + +typedef enum VkValidationFeatureDisableEXT { + VK_VALIDATION_FEATURE_DISABLE_ALL_EXT = 0, + VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT = 1, + VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT = 2, + VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT = 3, + VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT = 4, + VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT = 5, + VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT = 6, + VK_VALIDATION_FEATURE_DISABLE_BEGIN_RANGE_EXT = VK_VALIDATION_FEATURE_DISABLE_ALL_EXT, + VK_VALIDATION_FEATURE_DISABLE_END_RANGE_EXT = VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT, + VK_VALIDATION_FEATURE_DISABLE_RANGE_SIZE_EXT = (VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT - VK_VALIDATION_FEATURE_DISABLE_ALL_EXT + 1), + VK_VALIDATION_FEATURE_DISABLE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkValidationFeatureDisableEXT; + +typedef struct VkValidationFeaturesEXT { + VkStructureType sType; + const void* pNext; + uint32_t enabledValidationFeatureCount; + const VkValidationFeatureEnableEXT* pEnabledValidationFeatures; + uint32_t disabledValidationFeatureCount; + const VkValidationFeatureDisableEXT* pDisabledValidationFeatures; +} VkValidationFeaturesEXT; + + + #ifdef __cplusplus } #endif diff --git a/include/vulkan/vulkan_fuchsia.h b/include/vulkan/vulkan_fuchsia.h index e0ed5455..1c335fd3 100644 --- a/include/vulkan/vulkan_fuchsia.h +++ b/include/vulkan/vulkan_fuchsia.h @@ -6,7 +6,7 @@ extern "C" { #endif /* -** Copyright (c) 2015-2018 The Khronos Group Inc. +** Copyright (c) 2015-2019 The Khronos Group Inc. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. diff --git a/include/vulkan/vulkan_ios.h b/include/vulkan/vulkan_ios.h index a0924816..d221a9ba 100644 --- a/include/vulkan/vulkan_ios.h +++ b/include/vulkan/vulkan_ios.h @@ -6,7 +6,7 @@ extern "C" { #endif /* -** Copyright (c) 2015-2018 The Khronos Group Inc. +** Copyright (c) 2015-2019 The Khronos Group Inc. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. diff --git a/include/vulkan/vulkan_macos.h b/include/vulkan/vulkan_macos.h index ff0b7018..5d6b6aeb 100644 --- a/include/vulkan/vulkan_macos.h +++ b/include/vulkan/vulkan_macos.h @@ -6,7 +6,7 @@ extern "C" { #endif /* -** Copyright (c) 2015-2018 The Khronos Group Inc. +** Copyright (c) 2015-2019 The Khronos Group Inc. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. diff --git a/include/vulkan/vulkan_vi.h b/include/vulkan/vulkan_vi.h index 015166bf..3e37bab6 100644 --- a/include/vulkan/vulkan_vi.h +++ b/include/vulkan/vulkan_vi.h @@ -6,7 +6,7 @@ extern "C" { #endif /* -** Copyright (c) 2015-2018 The Khronos Group Inc. +** Copyright (c) 2015-2019 The Khronos Group Inc. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. diff --git a/include/vulkan/vulkan_wayland.h b/include/vulkan/vulkan_wayland.h index 5ba0827a..33a22de3 100644 --- a/include/vulkan/vulkan_wayland.h +++ b/include/vulkan/vulkan_wayland.h @@ -6,7 +6,7 @@ extern "C" { #endif /* -** Copyright (c) 2015-2018 The Khronos Group Inc. +** Copyright (c) 2015-2019 The Khronos Group Inc. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. diff --git a/include/vulkan/vulkan_win32.h b/include/vulkan/vulkan_win32.h index 6a85409e..b9d63d47 100644 --- a/include/vulkan/vulkan_win32.h +++ b/include/vulkan/vulkan_win32.h @@ -6,7 +6,7 @@ extern "C" { #endif /* -** Copyright (c) 2015-2018 The Khronos Group Inc. +** Copyright (c) 2015-2019 The Khronos Group Inc. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. diff --git a/include/vulkan/vulkan_xcb.h b/include/vulkan/vulkan_xcb.h index ba036006..f2129097 100644 --- a/include/vulkan/vulkan_xcb.h +++ b/include/vulkan/vulkan_xcb.h @@ -6,7 +6,7 @@ extern "C" { #endif /* -** Copyright (c) 2015-2018 The Khronos Group Inc. +** Copyright (c) 2015-2019 The Khronos Group Inc. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. diff --git a/include/vulkan/vulkan_xlib.h b/include/vulkan/vulkan_xlib.h index e1d967e0..ce3d36dd 100644 --- a/include/vulkan/vulkan_xlib.h +++ b/include/vulkan/vulkan_xlib.h @@ -6,7 +6,7 @@ extern "C" { #endif /* -** Copyright (c) 2015-2018 The Khronos Group Inc. +** Copyright (c) 2015-2019 The Khronos Group Inc. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. diff --git a/include/vulkan/vulkan_xlib_xrandr.h b/include/vulkan/vulkan_xlib_xrandr.h index 117d0179..25efb077 100644 --- a/include/vulkan/vulkan_xlib_xrandr.h +++ b/include/vulkan/vulkan_xlib_xrandr.h @@ -6,7 +6,7 @@ extern "C" { #endif /* -** Copyright (c) 2015-2018 The Khronos Group Inc. +** Copyright (c) 2015-2019 The Khronos Group Inc. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. diff --git a/include/wrappers/command_buffer.h b/include/wrappers/command_buffer.h index f0b4c64a..f9d2e163 100644 --- a/include/wrappers/command_buffer.h +++ b/include/wrappers/command_buffer.h @@ -62,6 +62,7 @@ namespace Anvil typedef enum { COMMAND_TYPE_BEGIN_RENDER_PASS, + COMMAND_TYPE_BEGIN_RENDER_PASS_2_KHR, COMMAND_TYPE_BEGIN_QUERY, COMMAND_TYPE_BEGIN_QUERY_INDEXED_EXT, COMMAND_TYPE_BEGIN_TRANSFORM_FEEDBACK_EXT, @@ -97,10 +98,12 @@ namespace Anvil COMMAND_TYPE_END_QUERY, COMMAND_TYPE_END_QUERY_INDEXED_EXT, COMMAND_TYPE_END_RENDER_PASS, + COMMAND_TYPE_END_RENDER_PASS_2_KHR, COMMAND_TYPE_END_TRANSFORM_FEEDBACK_EXT, COMMAND_TYPE_EXECUTE_COMMANDS, COMMAND_TYPE_FILL_BUFFER, COMMAND_TYPE_NEXT_SUBPASS, + COMMAND_TYPE_NEXT_SUBPASS_2_KHR, COMMAND_TYPE_PIPELINE_BARRIER, COMMAND_TYPE_PUSH_CONSTANTS, COMMAND_TYPE_RESET_EVENT, @@ -243,6 +246,37 @@ namespace Anvil BeginRenderPassCommand& operator=(const BeginRenderPassCommand&); } BeginRenderPassCommand; + typedef struct BeginRenderPass2KHRCommand : BeginRenderPassCommand + { + BeginRenderPass2KHRCommand(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + uint32_t in_n_physical_devices, + const Anvil::PhysicalDevice* const* in_physical_devices, + const VkRect2D* in_render_areas, + Anvil::RenderPass* in_render_pass_ptr, + Anvil::SubpassContents in_contents, + const uint32_t& in_n_attachment_initial_sample_locations, + const Anvil::AttachmentSampleLocations* in_attachment_initial_sample_locations_ptr, + const uint32_t& in_n_post_subpass_sample_locations, + const Anvil::SubpassSampleLocations* in_post_subpass_sample_locations_ptr) + :BeginRenderPassCommand(in_n_clear_values, + in_clear_value_ptrs, + in_fbo_ptr, + in_n_physical_devices, + in_physical_devices, + in_render_areas, + in_render_pass_ptr, + in_contents, + in_n_attachment_initial_sample_locations, + in_attachment_initial_sample_locations_ptr, + in_n_post_subpass_sample_locations, + in_post_subpass_sample_locations_ptr) + { + type = CommandType::COMMAND_TYPE_BEGIN_RENDER_PASS_2_KHR; + } + } BeginRenderPass2KHRCommand; + /* Structure passed as a COMMAND_BUFFER_CALLBACK_ID_BEGIN_RENDER_PASS_COMMAND_RECORDED call-back argument */ typedef struct BeginRenderPassCommandRecordedCallbackData { @@ -309,6 +343,15 @@ namespace Anvil } } EndRenderPassCommand; + typedef struct EndRenderPass2KHRCommand : public EndRenderPassCommand + { + /** Constructor. */ + EndRenderPass2KHRCommand() + { + type = COMMAND_TYPE_END_RENDER_PASS_2_KHR; + } + } EndRenderPass2KHRCommand; + /* Structure passed as a COMMAND_BUFFER_CALLBACK_ID_END_RENDER_PASS_COMMAND_RECORDED call-back argument */ typedef struct EndRenderPassCommandRecordedCallbackData { @@ -2434,6 +2477,15 @@ namespace Anvil } } NextSubpassCommand; + typedef struct NextSubpass2KHRCommand : public NextSubpassCommand + { + /** Constructor. **/ + NextSubpass2KHRCommand(Anvil::SubpassContents in_contents) + :NextSubpassCommand(in_contents) + { + type = COMMAND_TYPE_NEXT_SUBPASS_2_KHR; + } + } NextSubpass2KHRCommand; /** Holds all arguments passed to a vkCmdPushConstants() command. */ typedef struct PushConstantsCommand : public Command @@ -2958,6 +3010,55 @@ namespace Anvil const uint32_t& in_opt_n_post_subpass_sample_locations = 0, const Anvil::SubpassSampleLocations* in_opt_post_subpass_sample_locations_ptr = nullptr); + /** Issues a vkCmdBeginRenderPass2KHR() call and appends it to the internal vector of commands + * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS + * #define enabled). + * + * Calling this function for a command buffer which has not been put into a recording mode + * (by issuing a start_recording() call earlier) will result in an assertion failure. + * + * This function prototype can be called for both single- and multi-GPU devices. In the latter case, + * it will be assumed that all physical devices within the device group should be used for + * the device mask and that they all should use the same render area. + * + * Requires VK_KHR_create_renderpass2 support. Argument meaning is as per extension specification.. + * + * NOTE: If either @param in_opt_n_attachment_initial_sample_locations or @param in_opt_n_post_subpass_sample_locations + * (or both) are not zero, VK_EXT_sample_locations is required. + * + * @return true if successful, false otherwise. + **/ + bool record_begin_render_pass2_KHR(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + VkRect2D in_render_area, + Anvil::RenderPass* in_render_pass_ptr, + Anvil::SubpassContents in_contents, + const uint32_t& in_opt_n_attachment_initial_sample_locations = 0, + const Anvil::AttachmentSampleLocations* in_opt_attachment_initial_sample_locations_ptr = nullptr, + const uint32_t& in_opt_n_post_subpass_sample_locations = 0, + const Anvil::SubpassSampleLocations* in_opt_post_subpass_sample_locations_ptr = nullptr); + + /** See documentation for the other record_begin_render_pass2_KHR() function prototype for general + * information about this function. + * + * This prototype can only be used for multi-GPU devices. + * + * TODO + */ + bool record_begin_render_pass2_KHR(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + uint32_t in_n_physical_devices, + const Anvil::PhysicalDevice* const* in_physical_devices, + const VkRect2D* in_render_areas, + Anvil::RenderPass* in_render_pass_ptr, + Anvil::SubpassContents in_contents, + const uint32_t& in_opt_n_attachment_initial_sample_locations = 0, + const Anvil::AttachmentSampleLocations* in_opt_attachment_initial_sample_locations_ptr = nullptr, + const uint32_t& in_opt_n_post_subpass_sample_locations = 0, + const Anvil::SubpassSampleLocations* in_opt_post_subpass_sample_locations_ptr = nullptr); + /** Issues a vkCmdEndRenderPass() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS * #define enabled). @@ -2971,6 +3072,19 @@ namespace Anvil **/ bool record_end_render_pass(); + /** Issues a vkCmdEndRenderPass2KHR() call and appends it to the internal vector of commands + * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS + * #define enabled). + * + * Calling this function for a command buffer which has not been put into a recording mode + * (by issuing a start_recording() call earlier) will result in an assertion failure. + * + * Requires VK_KHR_create_renderpass2 support. Argument meaning is as per extension specification. + * + * @return true if successful, false otherwise. + **/ + bool record_end_render_pass2_KHR(); + /** Issues a vkCmdExecuteCommands() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS * #define enabled). @@ -2998,6 +3112,19 @@ namespace Anvil **/ bool record_next_subpass(Anvil::SubpassContents in_contents); + /** Issues a vkCmdNextSubpass2KHR() call and appends it to the internal vector of commands + * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS + * #define enabled). + * + * Calling this function for a command buffer which has not been put into a recording mode + * (by issuing a start_recording() call earlier) will result in an assertion failure. + * + * Requires VK_KHR_create_renderpass2. Argument meaning is as per extension spec. + * + * @return true if successful, false otherwise. + **/ + bool record_next_subpass2_KHR(Anvil::SubpassContents in_contents); + /** Issues a vkBeginCommandBufer() call and clears the internally managed vector of recorded * commands, if STORE_COMMAND_BUFFER_COMMANDS has been defined for the build. * @@ -3040,6 +3167,23 @@ namespace Anvil /* Private functions */ PrimaryCommandBuffer (const PrimaryCommandBuffer&); PrimaryCommandBuffer& operator=(const PrimaryCommandBuffer&); + + bool record_begin_render_pass_internal(const bool& in_use_khr_create_rp2_extension, + uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + uint32_t in_n_physical_devices, + const Anvil::PhysicalDevice* const* in_physical_devices, + const VkRect2D* in_render_areas, + Anvil::RenderPass* in_render_pass_ptr, + Anvil::SubpassContents in_contents, + const uint32_t& in_opt_n_attachment_initial_sample_locations, + const Anvil::AttachmentSampleLocations* in_opt_attachment_initial_sample_locations_ptr, + const uint32_t& in_opt_n_post_subpass_sample_locations, + const Anvil::SubpassSampleLocations* in_opt_post_subpass_sample_locations_ptr); + bool record_end_render_pass_internal (const bool& in_use_khr_create_rp2_extension); + bool record_next_subpass_internal (const bool& in_use_khr_create_rp2_extension, + Anvil::SubpassContents in_contents); }; /** Wrapper class for secondary command buffers. */ diff --git a/include/wrappers/device.h b/include/wrappers/device.h index 7757b631..6a6ed8ac 100644 --- a/include/wrappers/device.h +++ b/include/wrappers/device.h @@ -202,6 +202,14 @@ namespace Anvil return m_khr_bind_memory2_extension_entrypoints; } + /** Returns a container with entry-points to functions introduced by VK_KHR_create_renderpass2 extension. **/ + const ExtensionKHRCreateRenderpass2Entrypoints& get_extension_khr_create_renderpass2_entrypoints() const + { + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_create_renderpass2() ); + + return m_khr_create_renderpass2_extension_entrypoints; + } + /** Returns a container with entry-points to functions introduced by VK_KHR_descriptor_update_template extension. **/ const ExtensionKHRDescriptorUpdateTemplateEntrypoints& get_extension_khr_descriptor_update_template_entrypoints() const { @@ -739,6 +747,7 @@ namespace Anvil ExtensionEXTSampleLocationsEntrypoints m_ext_sample_locations_extension_entrypoints; ExtensionEXTTransformFeedbackEntrypoints m_ext_transform_feedback_extension_entrypoints; ExtensionKHRBindMemory2Entrypoints m_khr_bind_memory2_extension_entrypoints; + ExtensionKHRCreateRenderpass2Entrypoints m_khr_create_renderpass2_extension_entrypoints; ExtensionKHRDescriptorUpdateTemplateEntrypoints m_khr_descriptor_update_template_extension_entrypoints; ExtensionKHRDeviceGroupEntrypoints m_khr_device_group_extension_entrypoints; ExtensionKHRDrawIndirectCountEntrypoints m_khr_draw_indirect_count_extension_entrypoints; diff --git a/include/wrappers/instance.h b/include/wrappers/instance.h index b8f4be25..743c6000 100644 --- a/include/wrappers/instance.h +++ b/include/wrappers/instance.h @@ -32,6 +32,7 @@ #define WRAPPERS_INSTANCE_H #include "misc/extensions.h" +#include "misc/instance_create_info.h" #include "misc/library.h" #include "misc/mt_safety.h" #include "misc/types.h" @@ -39,47 +40,14 @@ namespace Anvil { - typedef std::function DebugCallbackFunction; - class Instance : public Anvil::MTSafetySupportProvider { public: /** Destructor */ virtual ~Instance(); - /** Creates a new Instance wrapper instance. This process is executed in the following steps: - * - * 1. If @param opt_pfn_validation_callback_proc is specified, available instance layers are - * enumerated. Layers which support VK_EXT_debug_report extension, are cached and used - * in step 2. - * 2. A new Vulkan instance is created. - * 3. Available physical devices are enumerated. - * 4. Instance-level function pointers are extracted. - * - * Only one Instance wrapper instance should be created during application's life-time. - * - * NOTE: You MUST call destroy() for this object in order for all dependent objects to be - * destroyed correctly. - * - * - * @param in_app_name Name of the application, to be passed in VkCreateInstanceInfo - * structure. - * @param in_engine_name Name of the engine, to be passed in VkCreateInstanceInfo - * structure. - * @param in_opt_validation_callback_function If not nullptr, the specified function will be called whenever - * a call-back from any of the validation layers is received. - * Ignored otherwise. - * @param in_mt_safe True if all instance-based operations where external host synchronization - * is required should be automatically synchronized by Anvil. - * @param in_opt_disallowed_instance_level_extensions Optional vector holding instance-level extension names that must NOT be - * requested at creation time. - **/ - static Anvil::InstanceUniquePtr create(const std::string& in_app_name, - const std::string& in_engine_name, - Anvil::DebugCallbackFunction in_opt_validation_callback_proc, - bool in_mt_safe, - const std::vector& in_opt_disallowed_instance_level_extensions = std::vector() ); + /** Creates a new Instance wrapper instance. **/ + static Anvil::InstanceUniquePtr create(Anvil::InstanceCreateInfoUniquePtr in_create_info_ptr); const Anvil::IExtensionInfoInstance* get_enabled_extensions_info() const { @@ -131,6 +99,11 @@ namespace Anvil **/ const ExtensionKHRDeviceGroupCreationEntrypoints& get_extension_khr_device_group_creation_entrypoints() const; + const Anvil::InstanceCreateInfo* get_create_info_ptr() const + { + return m_create_info_ptr.get(); + } + /** Returns a raw wrapped VkInstance handle. */ VkInstance get_instance_vk() const { @@ -202,17 +175,14 @@ namespace Anvil /** Tells if validation support has been requested for this Vulkan Instance wrapper */ bool is_validation_enabled() const { - return m_validation_callback_function != nullptr; + return m_create_info_ptr->get_validation_callback() != nullptr; } private: /* Private functions */ /** Private constructor. Please use create() function instead. */ - Instance(const std::string& in_app_name, - const std::string& in_engine_name, - Anvil::DebugCallbackFunction in_opt_validation_callback_function, - bool in_mt_safe); + Instance(Anvil::InstanceCreateInfoUniquePtr in_create_info_ptr); Instance& operator=(const Instance&); Instance (const Instance&); @@ -222,7 +192,7 @@ namespace Anvil void enumerate_layer_extensions (Anvil::Layer* layer_ptr); void enumerate_physical_device_groups(); void enumerate_physical_devices (); - void init (const std::vector& in_disallowed_instance_level_extensions); + void init (); void init_debug_callbacks (); void init_func_pointers (); @@ -255,9 +225,7 @@ namespace Anvil #endif #endif - const std::string m_app_name; - const std::string m_engine_name; - DebugCallbackFunction m_validation_callback_function; + Anvil::InstanceCreateInfoUniquePtr m_create_info_ptr; std::unique_ptr > m_enabled_extensions_info_ptr; std::unique_ptr > m_supported_extensions_info_ptr; diff --git a/include/wrappers/queue.h b/include/wrappers/queue.h index 62309208..fc9baec2 100644 --- a/include/wrappers/queue.h +++ b/include/wrappers/queue.h @@ -194,10 +194,11 @@ namespace Anvil * * @return Vulkan result for the operation. **/ - VkResult present(Anvil::Swapchain* in_swapchain_ptr, - uint32_t in_swapchain_image_index, - uint32_t in_n_wait_semaphores, - Anvil::Semaphore* const* in_wait_semaphore_ptrs_ptr); + bool present(Anvil::Swapchain* in_swapchain_ptr, + uint32_t in_swapchain_image_index, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs_ptr, + Anvil::SwapchainOperationErrorCode* out_present_results_ptr); /** See present() documentation for general information about this function. * @@ -210,10 +211,11 @@ namespace Anvil * * @return TODO **/ - VkResult present_in_local_presentation_mode(uint32_t in_n_local_mode_presentation_items, - const LocalModePresentationItem* in_local_mode_presentation_items, - uint32_t in_n_wait_semaphores, - Anvil::Semaphore* const* in_wait_semaphore_ptrs_ptr); + bool present_in_local_presentation_mode(uint32_t in_n_local_mode_presentation_items, + const LocalModePresentationItem* in_local_mode_presentation_items, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs_ptr, + Anvil::SwapchainOperationErrorCode* out_present_results_ptr); /** See present() documentation for general information about this function. * @@ -226,10 +228,11 @@ namespace Anvil * * @return TODO **/ - VkResult present_in_local_multi_device_presentation_mode(uint32_t in_n_local_multi_device_mode_presentation_items, - const LocalMultiDeviceModePresentationItem* in_local_multi_device_mode_presentation_items, - uint32_t in_n_wait_semaphores, - Anvil::Semaphore* const* in_wait_semaphore_ptrs_ptr); + bool present_in_local_multi_device_presentation_mode(uint32_t in_n_local_multi_device_mode_presentation_items, + const LocalMultiDeviceModePresentationItem* in_local_multi_device_mode_presentation_items, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs_ptr, + Anvil::SwapchainOperationErrorCode* out_present_results_ptr); /** See present() documentation for general information about this function. * @@ -242,10 +245,11 @@ namespace Anvil * * @return TODO **/ - VkResult present_in_remote_presentation_mode(uint32_t in_n_remote_mode_presentation_items, - const RemoteModePresentationItem* in_remote_mode_presentation_items, - uint32_t in_n_wait_semaphores, - Anvil::Semaphore* const* in_wait_semaphore_ptrs_ptr); + bool present_in_remote_presentation_mode(uint32_t in_n_remote_mode_presentation_items, + const RemoteModePresentationItem* in_remote_mode_presentation_items, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs_ptr, + Anvil::SwapchainOperationErrorCode* out_present_results_ptr); /** See present() documentation for general information about this function. * @@ -258,10 +262,11 @@ namespace Anvil * * @return TODO **/ - VkResult present_in_sum_presentation_mode(uint32_t in_n_sum_mode_presentation_items, - const SumModePresentationItem* in_sum_mode_presentation_items, - uint32_t in_n_wait_semaphores, - Anvil::Semaphore* const* in_wait_semaphore_ptrs_ptr); + bool present_in_sum_presentation_mode(uint32_t in_n_sum_mode_presentation_items, + const SumModePresentationItem* in_sum_mode_presentation_items, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs_ptr, + Anvil::SwapchainOperationErrorCode* out_present_results_ptr); bool submit(const SubmitInfo& in_submit_info); @@ -275,18 +280,19 @@ namespace Anvil private: /* Private functions */ - VkResult present_internal (Anvil::DeviceGroupPresentModeFlagBits in_presentation_mode, - uint32_t in_n_swapchains, - Anvil::Swapchain* const* in_swapchains, - const uint32_t* in_swapchain_image_indices, - const uint32_t* in_device_masks, - uint32_t in_n_wait_semaphores, - Anvil::Semaphore* const* in_wait_semaphore_ptrs); - void present_lock_unlock(uint32_t in_n_swapchains, - const Anvil::Swapchain* const* in_swapchains, - uint32_t in_n_wait_semaphores, - Anvil::Semaphore* const* in_wait_semaphore_ptrs, - bool in_should_lock); + bool present_internal (Anvil::DeviceGroupPresentModeFlagBits in_presentation_mode, + uint32_t in_n_swapchains, + Anvil::Swapchain* const* in_swapchains, + const uint32_t* in_swapchain_image_indices, + const uint32_t* in_device_masks, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs, + Anvil::SwapchainOperationErrorCode* out_present_results_ptr); + void present_lock_unlock(uint32_t in_n_swapchains, + const Anvil::Swapchain* const* in_swapchains, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs, + bool in_should_lock); void bind_sparse_memory_lock_unlock (Anvil::SparseMemoryBindingUpdateInfo& in_update, bool in_should_lock); diff --git a/include/wrappers/render_pass.h b/include/wrappers/render_pass.h index dc8f103c..2c16722d 100644 --- a/include/wrappers/render_pass.h +++ b/include/wrappers/render_pass.h @@ -83,7 +83,8 @@ namespace Anvil /* Private functions */ - bool init(); + bool init_using_core_vk10 (); + bool init_using_rp2_create_extension(); /* Constructor. Please see create() for specification */ RenderPass(Anvil::RenderPassCreateInfoUniquePtr in_renderpass_create_info_ptr, diff --git a/include/wrappers/rendering_surface.h b/include/wrappers/rendering_surface.h index 33f4e936..81042683 100644 --- a/include/wrappers/rendering_surface.h +++ b/include/wrappers/rendering_surface.h @@ -152,6 +152,8 @@ namespace Anvil Anvil::PresentModeKHR in_presentation_mode, bool* out_result_ptr) const; + void update_surface_extents() const; + private: /* Private type definitions */ typedef uint32_t DeviceGroupIndex; @@ -193,10 +195,10 @@ namespace Anvil const Anvil::BaseDevice* m_device_ptr; Anvil::Instance* m_instance_ptr; - uint32_t m_height; + mutable uint32_t m_height; std::map m_physical_device_capabilities; VkSurfaceKHR m_surface; - uint32_t m_width; + mutable uint32_t m_width; const Anvil::Window* m_window_ptr; }; }; /* namespace Anvil */ diff --git a/include/wrappers/swapchain.h b/include/wrappers/swapchain.h index 49733839..535b1dda 100644 --- a/include/wrappers/swapchain.h +++ b/include/wrappers/swapchain.h @@ -71,12 +71,14 @@ namespace Anvil * * @return Index of the swapchain image that the commands should be submitted against. **/ - uint32_t acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, - bool in_should_block = false); - uint32_t acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, - uint32_t in_n_mgpu_physical_devices, - const Anvil::PhysicalDevice* const* in_mgpu_physical_device_ptrs, - bool in_should_block = false); + SwapchainOperationErrorCode acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, + uint32_t* out_result_index_ptr, + bool in_should_block = false); + SwapchainOperationErrorCode acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, + uint32_t in_n_mgpu_physical_devices, + const Anvil::PhysicalDevice* const* in_mgpu_physical_device_ptrs, + uint32_t* out_result_index_ptr, + bool in_should_block = false); const SwapchainCreateInfo* get_create_info_ptr() const { diff --git a/src/misc/formats.cpp b/src/misc/formats.cpp index 83ea44ae..77021919 100644 --- a/src/misc/formats.cpp +++ b/src/misc/formats.cpp @@ -529,7 +529,7 @@ static const struct {Anvil::Format::D24_UNORM_S8_UINT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 23, 24, 31}, {Anvil::Format::D32_SFLOAT_S8_UINT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 31, 32, 39}, }; -static uint32_t g_layout_to_n_components[] = +static const uint32_t g_layout_to_n_components[] = { /* COMPONENT_LAYOUT_ABGR */ 4, @@ -1802,20 +1802,26 @@ uint32_t Anvil::Formats::get_yuv_format_plane_index(Anvil::Format i /** Please see header for specification */ bool Anvil::Formats::has_depth_aspect(Anvil::Format in_format) { - anvil_assert(!Anvil::Formats::is_format_yuv_khr(in_format) ); + if (!Anvil::Formats::is_format_yuv_khr(in_format) ) + { + return (g_formats[static_cast(in_format)].component_layout == Anvil::ComponentLayout::D) || + (g_formats[static_cast(in_format)].component_layout == Anvil::ComponentLayout::DS) || + (g_formats[static_cast(in_format)].component_layout == Anvil::ComponentLayout::XD); + } - return (g_formats[static_cast(in_format)].component_layout == Anvil::ComponentLayout::D) || - (g_formats[static_cast(in_format)].component_layout == Anvil::ComponentLayout::DS) || - (g_formats[static_cast(in_format)].component_layout == Anvil::ComponentLayout::XD); + return false; } /** Please see header for specification */ bool Anvil::Formats::has_stencil_aspect(Anvil::Format in_format) { - anvil_assert(!Anvil::Formats::is_format_yuv_khr(in_format) ); + if (!Anvil::Formats::is_format_yuv_khr(in_format) ) + { + return (g_formats[static_cast(in_format)].component_layout == Anvil::ComponentLayout::S) || + (g_formats[static_cast(in_format)].component_layout == Anvil::ComponentLayout::DS); + } - return (g_formats[static_cast(in_format)].component_layout == Anvil::ComponentLayout::S) || - (g_formats[static_cast(in_format)].component_layout == Anvil::ComponentLayout::DS); + return false; } /** Please see header for specification */ diff --git a/src/misc/fp16.cpp b/src/misc/fp16.cpp index 4a36b7c4..7fe189e3 100644 --- a/src/misc/fp16.cpp +++ b/src/misc/fp16.cpp @@ -23,7 +23,7 @@ #include "misc/fp16.h" // Conversion tables -static struct PrecalcedData +static const struct PrecalcedData { uint32_t basetable[512]; unsigned char shifttable[512]; @@ -154,7 +154,7 @@ Anvil::float32_t Anvil::Utils::fp16_to_fp32_full(Anvil::float16_t in_h) else // Normalized number { o.fields.Mantissa = static_cast(in_h.fields.Mantissa << 13); - o.fields.Exponent = static_cast(127 - 15 + in_h.fields.Exponent); + o.fields.Exponent = static_cast(127 - 15 + in_h.fields.Exponent); o.fields.Sign = in_h.fields.Sign; } } @@ -523,7 +523,7 @@ Anvil::float16_t Anvil::Utils::fp32_to_fp16_fast3(Anvil::float32_t in_f) Anvil::float32_t f16infty = { 31 << 23 }; Anvil::float32_t magic = { 15 << 23 }; uint32_t sign_mask = 0x80000000u; - uint32_t round_mask = ~0xfffu; + uint32_t round_mask = ~0xfffu; Anvil::float16_t o; uint32_t sign = in_f.u & sign_mask; diff --git a/src/misc/glsl_to_spirv.cpp b/src/misc/glsl_to_spirv.cpp index 6c58aec4..9f922015 100644 --- a/src/misc/glsl_to_spirv.cpp +++ b/src/misc/glsl_to_spirv.cpp @@ -215,8 +215,6 @@ m_resources_ptr->maxFragmentAtomicCounterBuffers = 0; /* not supported in Vulkan */ m_resources_ptr->maxCombinedAtomicCounterBuffers = 0; /* not supported in Vulkan */ m_resources_ptr->maxAtomicCounterBufferSize = 0; /* not supported in Vulkan */ - m_resources_ptr->maxTransformFeedbackBuffers = 0; /* not supported in Vulkan */ - m_resources_ptr->maxTransformFeedbackInterleavedComponents = 0; /* not supported in Vulkan */ m_resources_ptr->maxCullDistances = static_cast(CLAMP_TO_INT_MAX(limits.max_cull_distances) ); m_resources_ptr->maxCombinedClipAndCullDistances = static_cast(CLAMP_TO_INT_MAX(limits.max_combined_clip_and_cull_distances) ); m_resources_ptr->maxSamples = (max_sampled_image_samples > max_storage_image_samples) ? CLAMP_TO_INT_MAX(max_sampled_image_samples) @@ -230,9 +228,22 @@ m_resources_ptr->limits.generalSamplerIndexing = 1; m_resources_ptr->limits.generalVariableIndexing = 1; m_resources_ptr->limits.generalConstantMatrixVectorIndexing = 1; + + if (in_device_ptr->get_extension_info()->ext_transform_feedback() ) + { + const auto xfb_props_ptr = in_device_ptr->get_physical_device_properties().ext_transform_feedback_properties_ptr; + + m_resources_ptr->maxTransformFeedbackBuffers = xfb_props_ptr->n_max_transform_feedback_buffers; + m_resources_ptr->maxTransformFeedbackInterleavedComponents = xfb_props_ptr->max_transform_feedback_buffer_data_size / 4; + } + else + { + m_resources_ptr->maxTransformFeedbackBuffers = 0; /* not supported in core Vulkan */ + m_resources_ptr->maxTransformFeedbackInterleavedComponents = 0; /* not supported in core Vulkan */ + } } - static GLSLangGlobalInitializer glslang_helper; + static const GLSLangGlobalInitializer glslang_helper; #endif @@ -319,6 +330,30 @@ bool Anvil::GLSLShaderToSPIRVGenerator::add_definition_value_pair(std::string in return result; } +/* Please see header for specification */ +bool Anvil::GLSLShaderToSPIRVGenerator::add_placeholder_value_pair(const std::string& in_placeholder_name, + const std::string& in_value) +{ + bool result = false; + + for (const auto& placeholder_value_pair : m_placeholder_values) + { + if (placeholder_value_pair.first == in_placeholder_name) + { + anvil_assert_fail(); + + goto end; + } + } + + m_placeholder_values.push_back(std::make_pair(in_placeholder_name, in_value)); + + /* All done */ + result = true; +end: + return result; +} + /* Please see header for specification */ bool Anvil::GLSLShaderToSPIRVGenerator::add_pragma(std::string in_pragma_name, std::string in_opt_value) @@ -346,6 +381,7 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_glsl_source_code() const std::string final_glsl_source_string; const uint32_t n_definition_values = static_cast(m_definition_values.size() ); const uint32_t n_extension_behaviors = static_cast(m_extension_behaviors.size() ); + const uint32_t n_placeholder_values = static_cast(m_placeholder_values.size()); const uint32_t n_pragmas = static_cast(m_pragmas.size() ); bool result = false; @@ -392,6 +428,7 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_glsl_source_code() const } if (n_pragmas > 0 || + n_placeholder_values > 0 || n_extension_behaviors > 0 || n_definition_values > 0) { @@ -434,7 +471,7 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_glsl_source_code() const new_line); } - /* Finish with pragmas */ + /* Next define pragmas */ for (auto& current_pragma : m_pragmas) { std::string pragma_name = current_pragma.first; @@ -444,6 +481,23 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_glsl_source_code() const final_glsl_source_string.insert(glsl_source_string_second_line_index, new_line); } + + /* Finish with replacing placeholders with values */ + for(auto vec_iterator = m_placeholder_values.begin(); + vec_iterator != m_placeholder_values.end(); + ++vec_iterator) + { + const std::string& current_key = vec_iterator->first; + const std::string& current_value = vec_iterator->second; + size_t glsl_source_string_pos = final_glsl_source_string.find(current_key, 0); + + while (glsl_source_string_pos != std::string::npos) + { + final_glsl_source_string.replace(glsl_source_string_pos, current_key.size(), current_value); + + glsl_source_string_pos = final_glsl_source_string.find(current_key, glsl_source_string_pos); + } + } } /* Cache the GLSL source code used for the conversion */ @@ -571,7 +625,7 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() const #endif - + return result; } @@ -759,7 +813,7 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() const nullptr, /* lpProcessAttributes */ nullptr, /* lpThreadAttributes */ FALSE, /* bInheritHandles */ - CREATE_NO_WINDOW, + CREATE_NO_WINDOW, nullptr, /* lpEnvironment */ nullptr, /* lpCurrentDirectory */ &startup_info, @@ -823,7 +877,7 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() const #endif /* Now, read the SPIR-V file contents */ - + Anvil::IO::read_file(in_spirv_filename_with_path.c_str(), false, /* is_text_file */ diff --git a/src/misc/graphics_pipeline_create_info.cpp b/src/misc/graphics_pipeline_create_info.cpp index c081d3b2..47aa6a45 100644 --- a/src/misc/graphics_pipeline_create_info.cpp +++ b/src/misc/graphics_pipeline_create_info.cpp @@ -497,16 +497,16 @@ void Anvil::GraphicsPipelineCreateInfo::get_logic_op_state(bool* out_o } void Anvil::GraphicsPipelineCreateInfo::get_multisampling_properties(SampleCountFlagBits* out_opt_sample_count_ptr, - VkSampleMask* out_opt_sample_mask_ptr) const + const VkSampleMask** out_opt_sample_mask_ptr_ptr) const { if (out_opt_sample_count_ptr != nullptr) { *out_opt_sample_count_ptr = m_sample_count; } - if (out_opt_sample_mask_ptr != nullptr) + if (out_opt_sample_mask_ptr_ptr != nullptr) { - *out_opt_sample_mask_ptr = m_sample_mask; + *out_opt_sample_mask_ptr_ptr = &m_sample_mask; } } diff --git a/src/misc/instance_create_info.cpp b/src/misc/instance_create_info.cpp new file mode 100644 index 00000000..7d6f413b --- /dev/null +++ b/src/misc/instance_create_info.cpp @@ -0,0 +1,57 @@ +// +// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#include "misc/instance_create_info.h" + +Anvil::InstanceCreateInfo::InstanceCreateInfo(const std::string& in_app_name, + const std::string& in_engine_name, + Anvil::DebugCallbackFunction in_opt_validation_callback_proc, + bool in_mt_safe, + const std::vector& in_opt_disallowed_instance_level_extensions) + :m_app_name (in_app_name), + m_disallowed_instance_level_extensions(in_opt_disallowed_instance_level_extensions), + m_engine_name (in_engine_name), + m_is_mt_safe (in_mt_safe), + m_n_memory_type_to_use_for_all_alocs (UINT32_MAX), + m_validation_callback (in_opt_validation_callback_proc) +{ + /* Stub */ +} + +Anvil::InstanceCreateInfoUniquePtr Anvil::InstanceCreateInfo::create(const std::string& in_app_name, + const std::string& in_engine_name, + Anvil::DebugCallbackFunction in_opt_validation_callback_proc, + bool in_mt_safe, + const std::vector& in_opt_disallowed_instance_level_extensions) +{ + Anvil::InstanceCreateInfoUniquePtr result_ptr; + + result_ptr.reset( + new Anvil::InstanceCreateInfo(in_app_name, + in_engine_name, + in_opt_validation_callback_proc, + in_mt_safe, + in_opt_disallowed_instance_level_extensions) + ); + anvil_assert(result_ptr != nullptr); + + return result_ptr; +} diff --git a/src/misc/memory_allocator.cpp b/src/misc/memory_allocator.cpp index 49011105..b7613ba1 100644 --- a/src/misc/memory_allocator.cpp +++ b/src/misc/memory_allocator.cpp @@ -24,6 +24,7 @@ #include "misc/fence_create_info.h" #include "misc/formats.h" #include "misc/image_create_info.h" +#include "misc/instance_create_info.h" #include "misc/memory_allocator.h" #include "misc/memalloc_backends/backend_oneshot.h" #include "misc/memalloc_backends/backend_vma.h" @@ -31,6 +32,7 @@ #include "wrappers/device.h" #include "wrappers/fence.h" #include "wrappers/image.h" +#include "wrappers/instance.h" #include "wrappers/memory_block.h" #include "wrappers/queue.h" #include @@ -516,9 +518,10 @@ bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* buffer_memory_types = memory_reqs.memoryTypeBits; buffer_storage_size = memory_reqs.size; - if (!is_alloc_supported(buffer_memory_types, - in_required_memory_features, - &filtered_memory_types) ) + if (!get_mem_types_supporting_mem_features(m_device_ptr, + buffer_memory_types, + in_required_memory_features, + &filtered_memory_types) ) { result = false; @@ -955,9 +958,10 @@ bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* image_memory_types = in_image_ptr->get_image_memory_types(); image_storage_size = in_image_ptr->get_image_storage_size(); - if (!is_alloc_supported(image_memory_types, - in_required_memory_features, - &filtered_memory_types) ) + if (!get_mem_types_supporting_mem_features(m_device_ptr, + image_memory_types, + in_required_memory_features, + &filtered_memory_types) ) { result = false; @@ -1036,9 +1040,10 @@ bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* * to consider, and so on. */ anvil_assert((in_offset % memory_reqs.alignment) == 0); - if (!is_alloc_supported(memory_reqs.memoryTypeBits, - in_required_memory_features, - &filtered_memory_types) ) + if (!get_mem_types_supporting_mem_features(m_device_ptr, + memory_reqs.memoryTypeBits, + in_required_memory_features, + &filtered_memory_types) ) { result = false; @@ -1140,9 +1145,10 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* anvil_assert(miptail_size != 0); - if (!is_alloc_supported(miptail_memory_types, - in_required_memory_features, - &filtered_memory_types) ) + if (!get_mem_types_supporting_mem_features(m_device_ptr, + miptail_memory_types, + in_required_memory_features, + &filtered_memory_types) ) { result = false; @@ -1345,9 +1351,10 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* total_region_size_in_bytes = Anvil::Utils::round_up(total_region_size_in_bytes, tile_size); - if (!is_alloc_supported(in_image_ptr->get_image_memory_types(), - in_required_memory_features, - &filtered_memory_types) ) + if (!get_mem_types_supporting_mem_features(m_device_ptr, + in_image_ptr->get_image_memory_types(), + in_required_memory_features, + &filtered_memory_types) ) { result = false; @@ -2041,9 +2048,10 @@ bool Anvil::MemoryAllocator::do_external_memory_handle_type_sanity_checks(const } /** Tells whether or not a given set of memory types supports the requested memory features. */ -bool Anvil::MemoryAllocator::is_alloc_supported(uint32_t in_memory_types, - Anvil::MemoryFeatureFlags in_memory_features, - uint32_t* out_opt_filtered_memory_types_ptr) const +bool Anvil::MemoryAllocator::get_mem_types_supporting_mem_features(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_memory_types, + const Anvil::MemoryFeatureFlags& in_memory_features, + uint32_t* out_opt_filtered_memory_types_ptr) { const bool is_coherent_memory_required (((in_memory_features & Anvil::MemoryFeatureFlagBits::HOST_COHERENT_BIT) != 0) ); const bool is_device_local_memory_required (((in_memory_features & Anvil::MemoryFeatureFlagBits::DEVICE_LOCAL_BIT) != 0) ); @@ -2051,9 +2059,17 @@ bool Anvil::MemoryAllocator::is_alloc_supported(uint32_t in_mem const bool is_lazily_allocated_memory_required(((in_memory_features & Anvil::MemoryFeatureFlagBits::LAZILY_ALLOCATED_BIT) != 0) ); const bool is_mappable_memory_required (((in_memory_features & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) != 0) ); const bool is_multi_instance_memory_required (((in_memory_features & Anvil::MemoryFeatureFlagBits::MULTI_INSTANCE_BIT) != 0) ); - const auto& memory_props (m_device_ptr->get_physical_device_memory_properties() ); + const auto& memory_props (in_device_ptr->get_physical_device_memory_properties() ); + const auto n_forced_mem_type (in_device_ptr->get_parent_instance()->get_create_info_ptr()->get_n_memory_type_to_use_for_all_allocs() ); bool result (true); + if (n_forced_mem_type != UINT32_MAX) + { + in_memory_types = 1 << n_forced_mem_type; + + goto end; + } + /* Filter out memory types that do not support features requested at creation time */ for (uint32_t n_memory_type = 0; (1u << n_memory_type) <= in_memory_types; @@ -2078,12 +2094,13 @@ bool Anvil::MemoryAllocator::is_alloc_supported(uint32_t in_mem } } - if (out_opt_filtered_memory_types_ptr != nullptr) +end: + if (result && + out_opt_filtered_memory_types_ptr != nullptr) { *out_opt_filtered_memory_types_ptr = in_memory_types; } -end: return result; } diff --git a/src/misc/render_pass_create_info.cpp b/src/misc/render_pass_create_info.cpp index af9b6986..4a007165 100644 --- a/src/misc/render_pass_create_info.cpp +++ b/src/misc/render_pass_create_info.cpp @@ -256,6 +256,24 @@ bool Anvil::RenderPassCreateInfo::add_subpass(SubPassID* out_subpass_id_ptr) return result; } +/* Please see header for specification */ +bool Anvil::RenderPassCreateInfo::add_subpass_color_attachment(SubPassID in_subpass_id, + Anvil::ImageLayout in_input_layout, + RenderPassAttachmentID in_attachment_id, + uint32_t in_location, + const RenderPassAttachmentID* in_attachment_resolve_id_ptr) +{ + return add_subpass_color_input_attachment(in_subpass_id, + true, /* is_color_attachment */ + in_input_layout, + in_attachment_id, + in_location, + (in_attachment_resolve_id_ptr != nullptr), + (in_attachment_resolve_id_ptr != nullptr) ? *in_attachment_resolve_id_ptr + : UINT32_MAX, + Anvil::ImageAspectFlagBits::NONE); /* in_stencil_resolve_mode */ +} + /** Adds a new attachment to the specified subpass. * * @param in_subpass_id ID of the subpass to update. The subpass must have been earlier @@ -277,14 +295,14 @@ bool Anvil::RenderPassCreateInfo::add_subpass(SubPassID* out_subpass_id_ptr) * @return true if the function executed successfully, false otherwise. * **/ -bool Anvil::RenderPassCreateInfo::add_subpass_attachment(SubPassID in_subpass_id, - bool in_is_color_attachment, - Anvil::ImageLayout in_layout, - RenderPassAttachmentID in_attachment_id, - uint32_t in_attachment_location, - bool in_should_resolve, - RenderPassAttachmentID in_resolve_attachment_id, - const Anvil::ImageAspectFlags& in_opt_aspects_accessed) +bool Anvil::RenderPassCreateInfo::add_subpass_color_input_attachment(SubPassID in_subpass_id, + bool in_is_color_attachment, + Anvil::ImageLayout in_layout, + RenderPassAttachmentID in_attachment_id, + uint32_t in_attachment_location, + bool in_should_resolve, + RenderPassAttachmentID in_resolve_attachment_id, + const Anvil::ImageAspectFlags& in_aspects_accessed) { bool result = false; LocationToSubPassAttachmentMap* subpass_attachments_ptr = nullptr; @@ -302,7 +320,7 @@ bool Anvil::RenderPassCreateInfo::add_subpass_attachment(SubPassID subpass_ptr = m_subpasses.at(in_subpass_id).get(); } - /* Retrieve the renderpass attachment descriptor */ + /* Sanity checks */ if (in_attachment_id >= m_attachments.size() ) { anvil_assert(!(in_attachment_id >= m_attachments.size()) ); @@ -310,15 +328,12 @@ bool Anvil::RenderPassCreateInfo::add_subpass_attachment(SubPassID goto end; } - /* Retrieve the resolve attachment descriptor, if one was requested */ - if (in_should_resolve) + if (in_should_resolve && + in_resolve_attachment_id >= m_attachments.size() ) { - if (in_resolve_attachment_id >= m_attachments.size() ) - { - anvil_assert(!(in_resolve_attachment_id >= m_attachments.size()) ); + anvil_assert(!(in_should_resolve && in_resolve_attachment_id >= m_attachments.size()) ); - goto end; - } + goto end; } /* Make sure the attachment location is not already assigned an attachment */ @@ -336,14 +351,21 @@ bool Anvil::RenderPassCreateInfo::add_subpass_attachment(SubPassID (*subpass_attachments_ptr)[in_attachment_location] = SubPassAttachment(in_attachment_id, in_layout, in_resolve_attachment_id, - in_opt_aspects_accessed); + in_aspects_accessed); if (in_should_resolve) { + anvil_assert(in_is_color_attachment); + subpass_ptr->resolved_attachments_map[in_attachment_location] = SubPassAttachment(in_resolve_attachment_id, in_layout, - UINT32_MAX, - in_opt_aspects_accessed); + UINT32_MAX, /* in_opt_resolve_attachment_index */ + in_aspects_accessed); + } + + if (subpass_ptr->n_highest_location_used < in_attachment_location) + { + subpass_ptr->n_highest_location_used = in_attachment_location; } m_update_preserved_attachments = true; @@ -354,26 +376,9 @@ bool Anvil::RenderPassCreateInfo::add_subpass_attachment(SubPassID } /* Please see header for specification */ -bool Anvil::RenderPassCreateInfo::add_subpass_color_attachment(SubPassID in_subpass_id, - Anvil::ImageLayout in_input_layout, - RenderPassAttachmentID in_attachment_id, - uint32_t in_location, - const RenderPassAttachmentID* in_attachment_resolve_id_ptr) -{ - return add_subpass_attachment(in_subpass_id, - true, /* is_color_attachment */ - in_input_layout, - in_attachment_id, - in_location, - (in_attachment_resolve_id_ptr != nullptr), - (in_attachment_resolve_id_ptr != nullptr) ? *in_attachment_resolve_id_ptr - : UINT32_MAX); -} - -/* Please see header for specification */ -bool Anvil::RenderPassCreateInfo::add_subpass_depth_stencil_attachment(SubPassID in_subpass_id, - Anvil::ImageLayout in_layout, - RenderPassAttachmentID in_attachment_id) +bool Anvil::RenderPassCreateInfo::add_subpass_depth_stencil_attachment(SubPassID in_subpass_id, + Anvil::ImageLayout in_layout, + RenderPassAttachmentID in_attachment_id) { bool result = false; SubPass* subpass_ptr = nullptr; @@ -424,14 +429,14 @@ bool Anvil::RenderPassCreateInfo::add_subpass_input_attachment(SubPassID uint32_t in_attachment_index, const Anvil::ImageAspectFlags& in_opt_aspects_accessed) { - return add_subpass_attachment(in_subpass_id, - false, /* is_color_attachment */ - in_layout, - in_attachment_id, - in_attachment_index, - false, /* should_resolve */ - UINT32_MAX, /* resolve_attachment_id */ - in_opt_aspects_accessed); + return add_subpass_color_input_attachment(in_subpass_id, + false, /* is_color_attachment */ + in_layout, + in_attachment_id, + in_attachment_index, + false, /* should_resolve */ + UINT32_MAX, /* resolve_attachment_id */ + in_opt_aspects_accessed); } /* Please see header for specification */ @@ -857,12 +862,14 @@ bool Anvil::RenderPassCreateInfo::get_subpass_n_attachments(SubPassID in_su } /* Please see header for specification */ -bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID in_subpass_id, - AttachmentType in_attachment_type, - uint32_t in_n_subpass_attachment, - RenderPassAttachmentID* out_renderpass_attachment_id_ptr, - Anvil::ImageLayout* out_layout_ptr, - Anvil::ImageAspectFlags* out_opt_aspects_accessed_ptr) const +bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID in_subpass_id, + AttachmentType in_attachment_type, + uint32_t in_n_subpass_attachment, + RenderPassAttachmentID* out_renderpass_attachment_id_ptr, + Anvil::ImageLayout* out_layout_ptr, + Anvil::ImageAspectFlags* out_opt_aspects_accessed_ptr, + RenderPassAttachmentID* out_opt_attachment_resolve_id_ptr, + uint32_t* out_opt_location_ptr) const { SubPassAttachment attachment; bool result = false; @@ -923,6 +930,16 @@ bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID *out_opt_aspects_accessed_ptr = iterator->second.aspects_accessed; } + if (out_opt_attachment_resolve_id_ptr != nullptr) + { + *out_opt_attachment_resolve_id_ptr = iterator->second.resolve_attachment_index; + } + + if (out_opt_location_ptr != nullptr) + { + *out_opt_location_ptr = iterator->first; + } + *out_layout_ptr = iterator->second.layout; *out_renderpass_attachment_id_ptr = m_attachments.at(iterator->second.attachment_index).index; @@ -943,6 +960,17 @@ bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID *out_opt_aspects_accessed_ptr = Anvil::ImageAspectFlagBits::NONE; } + if (out_opt_attachment_resolve_id_ptr != nullptr) + { + /* DS attachments do not support resolve ops */ + anvil_assert_fail(); + } + + if (out_opt_location_ptr != nullptr) + { + *out_opt_location_ptr = 0; + } + *out_layout_ptr = subpass_ptr->depth_stencil_attachment.layout; *out_renderpass_attachment_id_ptr = m_attachments.at(subpass_ptr->depth_stencil_attachment.attachment_index).index; @@ -967,6 +995,14 @@ bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID *out_opt_aspects_accessed_ptr = Anvil::ImageAspectFlagBits::NONE; } + if (out_opt_location_ptr != nullptr) + { + *out_opt_location_ptr = UINT32_MAX; + } + + anvil_assert(out_opt_attachment_resolve_id_ptr == nullptr); + anvil_assert(out_opt_location_ptr == nullptr); + break; } @@ -985,6 +1021,32 @@ bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID return result; } +/* Please see header for specification */ +bool Anvil::RenderPassCreateInfo::get_subpass_highest_location(SubPassID in_subpass_id, + uint32_t* out_result_ptr) const +{ + bool result = false; + + if (m_subpasses.size() <= in_subpass_id) + { + anvil_assert(m_subpasses.size() > in_subpass_id); + + goto end; + } + + if (m_subpasses[in_subpass_id]->color_attachments_map.size () == 0 && + m_subpasses[in_subpass_id]->input_attachments_map.size () == 0 && + m_subpasses[in_subpass_id]->resolved_attachments_map.size() == 0) + { + goto end; + } + + *out_result_ptr = m_subpasses[in_subpass_id]->n_highest_location_used; + result = true; +end: + return result; +} + /* Please see header for specification */ bool Anvil::RenderPassCreateInfo::get_subpass_view_mask(SubPassID in_subpass_id, uint32_t* out_view_mask_ptr) const diff --git a/src/misc/swapchain_create_info.cpp b/src/misc/swapchain_create_info.cpp index 57189166..ff478390 100644 --- a/src/misc/swapchain_create_info.cpp +++ b/src/misc/swapchain_create_info.cpp @@ -30,7 +30,9 @@ Anvil::SwapchainCreateInfoUniquePtr Anvil::SwapchainCreateInfo::create(Anvil::Ba Anvil::ColorSpaceKHR in_color_space, Anvil::PresentModeKHR in_present_mode, Anvil::ImageUsageFlags in_usage_flags, - uint32_t in_n_images) + uint32_t in_n_images, + const bool& in_clipped, + const Anvil::Swapchain* in_opt_old_swapchain_ptr) { SwapchainCreateInfoUniquePtr result_ptr = SwapchainCreateInfoUniquePtr(nullptr, std::default_delete() ); @@ -46,7 +48,9 @@ Anvil::SwapchainCreateInfoUniquePtr Anvil::SwapchainCreateInfo::create(Anvil::Ba in_n_images, Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE, Anvil::SwapchainCreateFlagBits::NONE, - Anvil::DeviceGroupPresentModeFlagBits::LOCAL_BIT_KHR) /* in_mgpu_present_mode_flags */ + Anvil::DeviceGroupPresentModeFlagBits::LOCAL_BIT_KHR, /* in_mgpu_present_mode_flags */ + in_clipped, + in_opt_old_swapchain_ptr) ); return result_ptr; @@ -62,14 +66,18 @@ Anvil::SwapchainCreateInfo::SwapchainCreateInfo(Anvil::BaseDevice* uint32_t in_n_images, MTSafety in_mt_safety, Anvil::SwapchainCreateFlags in_flags, - Anvil::DeviceGroupPresentModeFlags in_mgpu_present_mode_flags) - :m_color_space (in_color_space), + Anvil::DeviceGroupPresentModeFlags in_mgpu_present_mode_flags, + const bool& in_clipped, + const Anvil::Swapchain* in_opt_old_swapchain_ptr) + :m_clipped (in_clipped), + m_color_space (in_color_space), m_device_ptr (in_device_ptr), m_flags (in_flags), m_format (in_format), m_mgpu_present_mode_flags(in_mgpu_present_mode_flags), m_mt_safety (in_mt_safety), m_n_images (in_n_images), + m_old_swapchain_ptr (in_opt_old_swapchain_ptr), m_parent_surface_ptr (in_parent_surface_ptr), m_present_mode (in_present_mode), m_usage_flags (in_usage_flags), diff --git a/src/misc/types_struct.cpp b/src/misc/types_struct.cpp index 44c0b055..f40747ab 100644 --- a/src/misc/types_struct.cpp +++ b/src/misc/types_struct.cpp @@ -19,8 +19,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // -#include "misc/types.h" #include "misc/descriptor_set_create_info.h" +#include "misc/formats.h" +#include "misc/image_create_info.h" +#include "misc/types.h" #include "wrappers/buffer.h" #include "wrappers/descriptor_set_layout.h" #include "wrappers/image.h" @@ -81,7 +83,6 @@ bool Anvil::AMDShaderCoreProperties::operator==(const Anvil::AMDShaderCoreProper Anvil::BufferBarrier::BufferBarrier(const BufferBarrier& in) { buffer = in.buffer; - buffer_barrier_vk = in.buffer_barrier_vk; buffer_ptr = in.buffer_ptr; dst_access_mask = in.dst_access_mask; dst_queue_family_index = in.dst_queue_family_index; @@ -109,16 +110,6 @@ Anvil::BufferBarrier::BufferBarrier(Anvil::AccessFlags in_source_access_mask, src_access_mask = in_source_access_mask; src_queue_family_index = in_src_queue_family_index; - buffer_barrier_vk.buffer = in_buffer_ptr->get_buffer(); - buffer_barrier_vk.dstAccessMask = in_destination_access_mask.get_vk(); - buffer_barrier_vk.dstQueueFamilyIndex = in_dst_queue_family_index; - buffer_barrier_vk.offset = in_offset; - buffer_barrier_vk.pNext = nullptr; - buffer_barrier_vk.size = in_size; - buffer_barrier_vk.srcAccessMask = in_source_access_mask.get_vk(), - buffer_barrier_vk.srcQueueFamilyIndex = in_src_queue_family_index; - buffer_barrier_vk.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER; - /* NOTE: For an image barrier to work correctly, the underlying subresource range must be assigned memory. * Query for a memory block in order to force any listening memory allocators to bake */ auto memory_block_ptr = buffer_ptr->get_memory_block(0 /* in_n_memory_block */); @@ -143,6 +134,23 @@ bool Anvil::BufferBarrier::operator==(const Anvil::BufferBarrier& in_barrier) co src_queue_family_index == in_barrier.src_queue_family_index); } +VkBufferMemoryBarrier Anvil::BufferBarrier::get_barrier_vk() const +{ + VkBufferMemoryBarrier result; + + result.buffer = buffer_ptr->get_buffer(); + result.dstAccessMask = dst_access_mask.get_vk(); + result.dstQueueFamilyIndex = dst_queue_family_index; + result.offset = offset; + result.pNext = nullptr; + result.size = size; + result.srcAccessMask = src_access_mask.get_vk(), + result.srcQueueFamilyIndex = src_queue_family_index; + result.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER; + + return result; +} + Anvil::BufferProperties::BufferProperties() { /* Stub */ @@ -389,6 +397,14 @@ Anvil::ExtensionEXTTransformFeedbackEntrypoints::ExtensionEXTTransformFeedbackEn vkCmdEndTransformFeedbackEXT = nullptr; } +Anvil::ExtensionKHRCreateRenderpass2Entrypoints::ExtensionKHRCreateRenderpass2Entrypoints() +{ + vkCmdBeginRenderPass2KHR = nullptr; + vkCmdEndRenderPass2KHR = nullptr; + vkCmdNextSubpass2KHR = nullptr; + vkCreateRenderPass2KHR = nullptr; +} + Anvil::ExtensionKHRDeviceGroupEntrypoints::ExtensionKHRDeviceGroupEntrypoints() { vkAcquireNextImage2KHR = nullptr; @@ -1029,6 +1045,20 @@ Anvil::ImageBarrier::ImageBarrier(Anvil::AccessFlags in_source_access_ src_queue_family_index = in_src_queue_family_index; subresource_range = in_image_subresource_range; + /* NOTE: Barriers referring to DS images must always specify both aspects. */ + { + const auto image_format = in_image_ptr->get_create_info_ptr()->get_format(); + + if (Anvil::Formats::has_depth_aspect (image_format) && + Anvil::Formats::has_stencil_aspect(image_format) ) + { + if (subresource_range.aspect_mask != (Anvil::ImageAspectFlagBits::DEPTH_BIT | Anvil::ImageAspectFlagBits::STENCIL_BIT) ) + { + subresource_range.aspect_mask = (Anvil::ImageAspectFlagBits::DEPTH_BIT | Anvil::ImageAspectFlagBits::STENCIL_BIT); + } + } + } + image_barrier_vk.dstAccessMask = in_destination_access_mask.get_vk(); image_barrier_vk.dstQueueFamilyIndex = in_dst_queue_family_index; image_barrier_vk.image = (in_image_ptr != nullptr) ? in_image_ptr->get_image() @@ -1039,7 +1069,7 @@ Anvil::ImageBarrier::ImageBarrier(Anvil::AccessFlags in_source_access_ image_barrier_vk.srcAccessMask = in_source_access_mask.get_vk(); image_barrier_vk.srcQueueFamilyIndex = in_src_queue_family_index; image_barrier_vk.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; - image_barrier_vk.subresourceRange = in_image_subresource_range.get_vk(); + image_barrier_vk.subresourceRange = subresource_range.get_vk(); /* NOTE: For an image barrier to work correctly, the underlying subresource range must be assigned memory. * Query for a memory block in order to force any listening memory allocators to bake */ diff --git a/src/misc/window_win3264.cpp b/src/misc/window_win3264.cpp index 8ac9a3d9..6c410cfb 100644 --- a/src/misc/window_win3264.cpp +++ b/src/misc/window_win3264.cpp @@ -155,10 +155,9 @@ void Anvil::WindowWin3264::close() /** Creates a new system window and prepares it for usage. */ bool Anvil::WindowWin3264::init(const bool& in_visible) { - static volatile uint32_t n_windows_spawned = 0; - bool result = false; - const char* window_class_name = (m_closable) ? "Anvil window (closable)" - : "Anvil window (non-closable)"; + bool result = false; + const char* window_class_name = (m_closable) ? "Anvil window (closable)" + : "Anvil window (non-closable)"; if (m_window_owned) { diff --git a/src/wrappers/command_buffer.cpp b/src/wrappers/command_buffer.cpp index c1793406..eb22ffa7 100644 --- a/src/wrappers/command_buffer.cpp +++ b/src/wrappers/command_buffer.cpp @@ -1323,22 +1323,32 @@ bool Anvil::CommandBufferBase::record_begin_transform_feedback_EXT(const uint32_ n_counter_buffer < in_n_counter_buffers; ++n_counter_buffer) { - counter_buffer_ptrs.at(n_counter_buffer) = in_opt_counter_buffer_ptrs[n_counter_buffer]->get_buffer(); + counter_buffer_ptrs.at(n_counter_buffer) = (in_opt_counter_buffer_ptrs != nullptr && in_opt_counter_buffer_ptrs[n_counter_buffer] != nullptr) ? in_opt_counter_buffer_ptrs[n_counter_buffer]->get_buffer() + : VK_NULL_HANDLE; } #ifdef STORE_COMMAND_BUFFER_COMMANDS { if (!m_command_stashing_disabled) { - std::vector buffer_ptr_vec(in_n_counter_buffers); + std::vector buffer_ptr_vec(in_n_counter_buffers, + nullptr); std::vector offset_vec (in_n_counter_buffers); for (uint32_t n_counter_buffer = 0; n_counter_buffer < in_n_counter_buffers; ++n_counter_buffer) { - buffer_ptr_vec.at(n_counter_buffer) = in_opt_counter_buffer_ptrs [n_counter_buffer]; - offset_vec.at (n_counter_buffer) = in_opt_counter_buffer_offsets[n_counter_buffer]; + if (in_opt_counter_buffer_ptrs != nullptr && + in_opt_counter_buffer_ptrs[n_counter_buffer] != nullptr) + { + buffer_ptr_vec.at(n_counter_buffer) = in_opt_counter_buffer_ptrs[n_counter_buffer]; + } + + if (in_opt_counter_buffer_offsets != nullptr) + { + offset_vec.at(n_counter_buffer) = in_opt_counter_buffer_offsets[n_counter_buffer]; + } } m_commands.push_back(BeginTransformFeedbackEXTCommand(in_first_counter_buffer, @@ -1354,7 +1364,7 @@ bool Anvil::CommandBufferBase::record_begin_transform_feedback_EXT(const uint32_ entrypoints.vkCmdBeginTransformFeedbackEXT(m_command_buffer, in_first_counter_buffer, in_n_counter_buffers, - (in_n_counter_buffers > 0) ? &counter_buffer_ptrs.at(0) : nullptr, + (counter_buffer_ptrs.size() > 0) ? &counter_buffer_ptrs.at(0) : nullptr, in_opt_counter_buffer_offsets); } unlock(); @@ -3065,7 +3075,8 @@ bool Anvil::CommandBufferBase::record_end_transform_feedback_EXT(const uint32_t& n_counter_buffer < in_n_counter_buffers; ++n_counter_buffer) { - counter_buffer_ptrs.at(n_counter_buffer) = in_opt_counter_buffer_ptrs[n_counter_buffer]->get_buffer(); + counter_buffer_ptrs.at(n_counter_buffer) = (in_opt_counter_buffer_ptrs != nullptr && in_opt_counter_buffer_ptrs[n_counter_buffer] != nullptr) ? in_opt_counter_buffer_ptrs[n_counter_buffer]->get_buffer() + : VK_NULL_HANDLE; } #ifdef STORE_COMMAND_BUFFER_COMMANDS @@ -3079,8 +3090,16 @@ bool Anvil::CommandBufferBase::record_end_transform_feedback_EXT(const uint32_t& n_counter_buffer < in_n_counter_buffers; ++n_counter_buffer) { - buffer_ptr_vec.at(n_counter_buffer) = in_opt_counter_buffer_ptrs [n_counter_buffer]; - offset_vec.at (n_counter_buffer) = in_opt_counter_buffer_offsets[n_counter_buffer]; + if (in_opt_counter_buffer_ptrs != nullptr && + in_opt_counter_buffer_ptrs[n_counter_buffer] != nullptr) + { + buffer_ptr_vec.at(n_counter_buffer) = in_opt_counter_buffer_ptrs[n_counter_buffer]; + } + + if (in_opt_counter_buffer_offsets != nullptr) + { + offset_vec.at(n_counter_buffer) = in_opt_counter_buffer_offsets[n_counter_buffer]; + } } m_commands.push_back(EndTransformFeedbackEXTCommand(in_first_counter_buffer, @@ -4355,9 +4374,97 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t const uint32_t& in_opt_n_post_subpass_sample_locations, const Anvil::SubpassSampleLocations* in_opt_post_subpass_sample_locations_ptr) { - const Anvil::DeviceType device_type = m_device_ptr->get_type(); + return record_begin_render_pass_internal(false, /* in_use_khr_create_rp2_extension */ + in_n_clear_values, + in_clear_value_ptrs, + in_fbo_ptr, + in_n_physical_devices, + in_physical_devices, + in_render_areas, + in_render_pass_ptr, + in_contents, + in_opt_n_attachment_initial_sample_locations, + in_opt_attachment_initial_sample_locations_ptr, + in_opt_n_post_subpass_sample_locations, + in_opt_post_subpass_sample_locations_ptr); +} + +/* Please see header for specification */ +bool Anvil::PrimaryCommandBuffer::record_begin_render_pass2_KHR(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + VkRect2D in_render_area, + Anvil::RenderPass* in_render_pass_ptr, + Anvil::SubpassContents in_contents, + const uint32_t& in_opt_n_attachment_initial_sample_locations, + const Anvil::AttachmentSampleLocations* in_opt_attachment_initial_sample_locations_ptr, + const uint32_t& in_opt_n_post_subpass_sample_locations, + const Anvil::SubpassSampleLocations* in_opt_post_subpass_sample_locations_ptr) +{ + return record_begin_render_pass2_KHR(in_n_clear_values, + in_clear_value_ptrs, + in_fbo_ptr, + 0, /* in_n_physical_devices */ + nullptr, /* in_physical_devices_ptr */ + &in_render_area, + in_render_pass_ptr, + in_contents, + in_opt_n_attachment_initial_sample_locations, + in_opt_attachment_initial_sample_locations_ptr, + in_opt_n_post_subpass_sample_locations, + in_opt_post_subpass_sample_locations_ptr); +} + +/* Please see header for specification */ +bool Anvil::PrimaryCommandBuffer::record_begin_render_pass2_KHR(uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + uint32_t in_n_physical_devices, + const Anvil::PhysicalDevice* const* in_physical_devices, + const VkRect2D* in_render_areas, + Anvil::RenderPass* in_render_pass_ptr, + Anvil::SubpassContents in_contents, + const uint32_t& in_opt_n_attachment_initial_sample_locations, + const Anvil::AttachmentSampleLocations* in_opt_attachment_initial_sample_locations_ptr, + const uint32_t& in_opt_n_post_subpass_sample_locations, + const Anvil::SubpassSampleLocations* in_opt_post_subpass_sample_locations_ptr) +{ + anvil_assert(m_device_ptr->get_extension_info()->khr_create_renderpass2() ); + + return record_begin_render_pass_internal(true, /* in_use_khr_create_rp2_extension */ + in_n_clear_values, + in_clear_value_ptrs, + in_fbo_ptr, + in_n_physical_devices, + in_physical_devices, + in_render_areas, + in_render_pass_ptr, + in_contents, + in_opt_n_attachment_initial_sample_locations, + in_opt_attachment_initial_sample_locations_ptr, + in_opt_n_post_subpass_sample_locations, + in_opt_post_subpass_sample_locations_ptr); +} + +/* Please see header for specification */ +bool Anvil::PrimaryCommandBuffer::record_begin_render_pass_internal(const bool& in_use_khr_create_rp2_extension, + uint32_t in_n_clear_values, + const VkClearValue* in_clear_value_ptrs, + Anvil::Framebuffer* in_fbo_ptr, + uint32_t in_n_physical_devices, + const Anvil::PhysicalDevice* const* in_physical_devices, + const VkRect2D* in_render_areas, + Anvil::RenderPass* in_render_pass_ptr, + Anvil::SubpassContents in_contents, + const uint32_t& in_opt_n_attachment_initial_sample_locations, + const Anvil::AttachmentSampleLocations* in_opt_attachment_initial_sample_locations_ptr, + const uint32_t& in_opt_n_post_subpass_sample_locations, + const Anvil::SubpassSampleLocations* in_opt_post_subpass_sample_locations_ptr) +{ + const Anvil::DeviceType device_type = m_device_ptr->get_type(); + bool result = false; + Anvil::StructChainer render_pass_begin_info_chain; - bool result = false; if (m_is_renderpass_active) { @@ -4390,18 +4497,36 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t { if (!m_command_stashing_disabled) { - m_commands.push_back(BeginRenderPassCommand(in_n_clear_values, - in_clear_value_ptrs, - in_fbo_ptr, - in_n_physical_devices, - in_physical_devices, - in_render_areas, - in_render_pass_ptr, - in_contents, - in_opt_n_attachment_initial_sample_locations, - in_opt_attachment_initial_sample_locations_ptr, - in_opt_n_post_subpass_sample_locations, - in_opt_post_subpass_sample_locations_ptr) ); + if (in_use_khr_create_rp2_extension) + { + m_commands.push_back(BeginRenderPass2KHRCommand(in_n_clear_values, + in_clear_value_ptrs, + in_fbo_ptr, + in_n_physical_devices, + in_physical_devices, + in_render_areas, + in_render_pass_ptr, + in_contents, + in_opt_n_attachment_initial_sample_locations, + in_opt_attachment_initial_sample_locations_ptr, + in_opt_n_post_subpass_sample_locations, + in_opt_post_subpass_sample_locations_ptr) ); + } + else + { + m_commands.push_back(BeginRenderPassCommand(in_n_clear_values, + in_clear_value_ptrs, + in_fbo_ptr, + in_n_physical_devices, + in_physical_devices, + in_render_areas, + in_render_pass_ptr, + in_contents, + in_opt_n_attachment_initial_sample_locations, + in_opt_attachment_initial_sample_locations_ptr, + in_opt_n_post_subpass_sample_locations, + in_opt_post_subpass_sample_locations_ptr) ); + } } } #endif @@ -4484,9 +4609,25 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t { auto chain_ptr = render_pass_begin_info_chain.create_chain(); - Anvil::Vulkan::vkCmdBeginRenderPass(m_command_buffer, - chain_ptr->get_root_struct(), - static_cast(in_contents) ); + if (in_use_khr_create_rp2_extension) + { + Anvil::Vulkan::vkCmdBeginRenderPass(m_command_buffer, + chain_ptr->get_root_struct(), + static_cast(in_contents) ); + } + else + { + const auto& crp2_entrypoints = m_device_ptr->get_extension_khr_create_renderpass2_entrypoints(); + VkSubpassBeginInfoKHR subpass_begin_info; + + subpass_begin_info.contents = static_cast(in_contents); + subpass_begin_info.pNext = nullptr; + subpass_begin_info.sType = VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO_KHR; + + crp2_entrypoints.vkCmdBeginRenderPass2KHR(m_command_buffer, + chain_ptr->get_root_struct(), + &subpass_begin_info); + } } unlock(); m_parent_command_pool_ptr->unlock(); @@ -4499,6 +4640,20 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t /* Please see header for specification */ bool Anvil::PrimaryCommandBuffer::record_end_render_pass() +{ + return record_end_render_pass_internal(false); /* in_use_khr_create_rp2_extension */ +} + +/* Please see header for specification */ +bool Anvil::PrimaryCommandBuffer::record_end_render_pass2_KHR() +{ + anvil_assert(m_device_ptr->get_extension_info()->khr_create_renderpass2() ); + + return record_end_render_pass_internal(true); /* in_use_khr_create_rp2_extension */ +} + +/* Please see header for specification */ +bool Anvil::PrimaryCommandBuffer::record_end_render_pass_internal(const bool& in_use_khr_create_rp2_extension) { bool result = false; @@ -4520,7 +4675,14 @@ bool Anvil::PrimaryCommandBuffer::record_end_render_pass() { if (!m_command_stashing_disabled) { - m_commands.push_back(EndRenderPassCommand() ); + if (in_use_khr_create_rp2_extension) + { + m_commands.push_back(EndRenderPass2KHRCommand() ); + } + else + { + m_commands.push_back(EndRenderPassCommand() ); + } } } #endif @@ -4528,7 +4690,21 @@ bool Anvil::PrimaryCommandBuffer::record_end_render_pass() m_parent_command_pool_ptr->lock(); lock(); { - Anvil::Vulkan::vkCmdEndRenderPass(m_command_buffer); + if (in_use_khr_create_rp2_extension) + { + const auto& crp2_entrypoints = m_device_ptr->get_extension_khr_create_renderpass2_entrypoints(); + VkSubpassEndInfoKHR subpass_end_info; + + subpass_end_info.pNext = nullptr; + subpass_end_info.sType = VK_STRUCTURE_TYPE_SUBPASS_END_INFO_KHR; + + crp2_entrypoints.vkCmdEndRenderPass2KHR(m_command_buffer, + &subpass_end_info); + } + else + { + Anvil::Vulkan::vkCmdEndRenderPass(m_command_buffer); + } } unlock(); m_parent_command_pool_ptr->unlock(); @@ -4588,6 +4764,23 @@ bool Anvil::PrimaryCommandBuffer::record_execute_commands(uint32_t /* Please see header for specification */ bool Anvil::PrimaryCommandBuffer::record_next_subpass(Anvil::SubpassContents in_contents) +{ + return record_next_subpass_internal(false, /* in_use_khr_create_rp2_extension */ + in_contents); +} + +/* Please see header for specification */ +bool Anvil::PrimaryCommandBuffer::record_next_subpass2_KHR(Anvil::SubpassContents in_contents) +{ + anvil_assert(m_device_ptr->get_extension_info()->khr_create_renderpass2() ); + + return record_next_subpass_internal(true, /* in_use_khr_create_rp2_extension */ + in_contents); +} + +/* Please see header for specification */ +bool Anvil::PrimaryCommandBuffer::record_next_subpass_internal(const bool& in_use_khr_create_rp2_extension, + Anvil::SubpassContents in_contents) { bool result = false; @@ -4609,7 +4802,14 @@ bool Anvil::PrimaryCommandBuffer::record_next_subpass(Anvil::SubpassContents in_ { if (!m_command_stashing_disabled) { - m_commands.push_back(NextSubpassCommand(in_contents) ); + if (in_use_khr_create_rp2_extension) + { + m_commands.push_back(NextSubpass2KHRCommand(in_contents) ); + } + else + { + m_commands.push_back(NextSubpassCommand(in_contents) ); + } } } #endif @@ -4617,8 +4817,28 @@ bool Anvil::PrimaryCommandBuffer::record_next_subpass(Anvil::SubpassContents in_ m_parent_command_pool_ptr->lock(); lock(); { - Anvil::Vulkan::vkCmdNextSubpass(m_command_buffer, - static_cast(in_contents) ); + if (in_use_khr_create_rp2_extension) + { + const auto& crp2_entrypoints = m_device_ptr->get_extension_khr_create_renderpass2_entrypoints(); + VkSubpassBeginInfoKHR subpass_begin_info; + VkSubpassEndInfoKHR subpass_end_info; + + subpass_begin_info.contents = static_cast(in_contents); + subpass_begin_info.pNext = nullptr; + subpass_begin_info.sType = VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO_KHR; + + subpass_end_info.pNext = nullptr; + subpass_end_info.sType = VK_STRUCTURE_TYPE_SUBPASS_END_INFO_KHR; + + crp2_entrypoints.vkCmdNextSubpass2KHR(m_command_buffer, + &subpass_begin_info, + &subpass_end_info); + } + else + { + Anvil::Vulkan::vkCmdNextSubpass(m_command_buffer, + static_cast(in_contents) ); + } } unlock(); m_parent_command_pool_ptr->unlock(); diff --git a/src/wrappers/device.cpp b/src/wrappers/device.cpp index 73b2cf12..443346d8 100644 --- a/src/wrappers/device.cpp +++ b/src/wrappers/device.cpp @@ -863,6 +863,19 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, anvil_assert(m_khr_bind_memory2_extension_entrypoints.vkBindImageMemory2KHR != nullptr); } + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_create_renderpass2() ) + { + m_khr_create_renderpass2_extension_entrypoints.vkCmdBeginRenderPass2KHR = reinterpret_cast(get_proc_address("vkCmdBeginRenderPass2KHR")); + m_khr_create_renderpass2_extension_entrypoints.vkCmdEndRenderPass2KHR = reinterpret_cast (get_proc_address("vkCmdEndRenderPass2KHR")); + m_khr_create_renderpass2_extension_entrypoints.vkCmdNextSubpass2KHR = reinterpret_cast (get_proc_address("vkCmdNextSubpass2KHR")); + m_khr_create_renderpass2_extension_entrypoints.vkCreateRenderPass2KHR = reinterpret_cast (get_proc_address("vkCreateRenderPass2KHR")); + + anvil_assert(m_khr_create_renderpass2_extension_entrypoints.vkCmdBeginRenderPass2KHR != nullptr); + anvil_assert(m_khr_create_renderpass2_extension_entrypoints.vkCmdEndRenderPass2KHR != nullptr); + anvil_assert(m_khr_create_renderpass2_extension_entrypoints.vkCmdNextSubpass2KHR != nullptr); + anvil_assert(m_khr_create_renderpass2_extension_entrypoints.vkCreateRenderPass2KHR != nullptr); + } + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_draw_indirect_count() ) { m_khr_draw_indirect_count_extension_entrypoints.vkCmdDrawIndexedIndirectCountKHR = reinterpret_cast(get_proc_address("vkCmdDrawIndexedIndirectCountKHR") ); diff --git a/src/wrappers/graphics_pipeline_manager.cpp b/src/wrappers/graphics_pipeline_manager.cpp index 193cc066..b0801225 100644 --- a/src/wrappers/graphics_pipeline_manager.cpp +++ b/src/wrappers/graphics_pipeline_manager.cpp @@ -797,11 +797,11 @@ Anvil::StructChainUniquePtr Anvil::Graphic const bool is_sample_mask_enabled = in_gfx_pipeline_create_info_ptr->is_sample_mask_enabled(); uint32_t n_custom_sample_locations = 0; - Anvil::SampleCountFlagBits sample_count = static_cast(0); - VkSampleMask sample_mask; + Anvil::SampleCountFlagBits sample_count = static_cast(0); + const VkSampleMask* sample_mask_ptr = nullptr; in_gfx_pipeline_create_info_ptr->get_multisampling_properties(&sample_count, - &sample_mask); + &sample_mask_ptr); in_gfx_pipeline_create_info_ptr->get_sample_location_state (&are_custom_sample_locations_enabled, &custom_sample_locations_per_pixel, &custom_sample_location_grid_size, @@ -813,7 +813,7 @@ Anvil::StructChainUniquePtr Anvil::Graphic * Hence, if the application specified a non-~0u sample mask and has NOT enabled the sample mask using toggle_sample_mask(), it's (in * all likelihood) a trivial app-side issue. */ - anvil_assert((!is_sample_mask_enabled && sample_mask == ~0u) || + anvil_assert((!is_sample_mask_enabled && *sample_mask_ptr == ~0u) || is_sample_mask_enabled); { @@ -824,7 +824,7 @@ Anvil::StructChainUniquePtr Anvil::Graphic multisample_state_create_info.flags = 0; multisample_state_create_info.minSampleShading = min_sample_shading; multisample_state_create_info.pNext = nullptr; - multisample_state_create_info.pSampleMask = (is_sample_mask_enabled) ? &sample_mask : nullptr; + multisample_state_create_info.pSampleMask = (is_sample_mask_enabled) ? sample_mask_ptr : nullptr; multisample_state_create_info.rasterizationSamples = static_cast(sample_count); multisample_state_create_info.sampleShadingEnable = is_sample_shading_enabled ? VK_TRUE : VK_FALSE; multisample_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO; diff --git a/src/wrappers/image.cpp b/src/wrappers/image.cpp index 72d15b90..ad39ff8f 100644 --- a/src/wrappers/image.cpp +++ b/src/wrappers/image.cpp @@ -485,50 +485,6 @@ bool Anvil::Image::init() queue_family_indices, &n_queue_family_indices); - /* Images can be created with unsupported usages with EXTENDED_USAGE_BIT */ - if ((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::EXTENDED_USAGE_BIT) == 0) - { - /* Is the requested texture size valid? */ - if (!m_device_ptr->get_physical_device_image_format_properties(Anvil::ImageFormatPropertiesQuery(m_create_info_ptr->get_format (), - m_create_info_ptr->get_type (), - m_create_info_ptr->get_tiling (), - m_create_info_ptr->get_usage_flags (), - m_create_info_ptr->get_create_flags() ), - &image_format_props)) - { - anvil_assert_fail(); - - goto end; - } - - anvil_assert(m_create_info_ptr->get_base_mip_width() <= image_format_props.max_extent.width); - - if (m_create_info_ptr->get_base_mip_height() > 1) - { - anvil_assert(m_create_info_ptr->get_base_mip_height() <= image_format_props.max_extent.height); - } - - if (m_create_info_ptr->get_base_mip_depth() > 1) - { - anvil_assert(m_create_info_ptr->get_base_mip_depth() <= image_format_props.max_extent.depth); - } - - anvil_assert(m_create_info_ptr->get_n_layers() >= 1); - - if (m_create_info_ptr->get_n_layers() > 1) - { - anvil_assert(m_create_info_ptr->get_n_layers() <= image_format_props.n_max_array_layers); - } - - /* If multisample image is requested, make sure the number of samples is supported. */ - anvil_assert(m_create_info_ptr->get_sample_count() >= Anvil::SampleCountFlagBits::_1_BIT); - - if (m_create_info_ptr->get_sample_count() > Anvil::SampleCountFlagBits::_1_BIT) - { - anvil_assert((image_format_props.sample_counts & m_create_info_ptr->get_sample_count()) != 0); - } - } - /* Create the image object */ if ( (m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::CUBE_COMPATIBLE_BIT) != 0) { diff --git a/src/wrappers/instance.cpp b/src/wrappers/instance.cpp index 91bdac0e..cd9e174b 100644 --- a/src/wrappers/instance.cpp +++ b/src/wrappers/instance.cpp @@ -36,18 +36,14 @@ static Anvil::LibraryUniquePtr g_vk10_library_ptr; /** Please see header for specification */ -Anvil::Instance::Instance(const std::string& in_app_name, - const std::string& in_engine_name, - DebugCallbackFunction in_opt_validation_callback_function, - bool in_mt_safe) - :MTSafetySupportProvider (in_mt_safe), - m_app_name (in_app_name), - m_debug_messenger_ptr (Anvil::DebugMessengerUniquePtr(nullptr, std::default_delete() )), - m_engine_name (in_engine_name), - m_global_layer (""), - m_instance (VK_NULL_HANDLE), - m_validation_callback_function(in_opt_validation_callback_function) +Anvil::Instance::Instance(Anvil::InstanceCreateInfoUniquePtr in_create_info_ptr) + :MTSafetySupportProvider(in_create_info_ptr->is_mt_safe() ), + m_debug_messenger_ptr (Anvil::DebugMessengerUniquePtr(nullptr, std::default_delete() )), + m_global_layer (""), + m_instance (VK_NULL_HANDLE) { + m_create_info_ptr = std::move(in_create_info_ptr); + Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::INSTANCE, this); } @@ -74,24 +70,16 @@ Anvil::Instance::~Instance() } /** Please see header for specification */ -Anvil::InstanceUniquePtr Anvil::Instance::create(const std::string& in_app_name, - const std::string& in_engine_name, - DebugCallbackFunction in_opt_validation_callback_proc, - bool in_mt_safe, - const std::vector& in_opt_disallowed_instance_level_extensions) +Anvil::InstanceUniquePtr Anvil::Instance::create(Anvil::InstanceCreateInfoUniquePtr in_create_info_ptr) { InstanceUniquePtr new_instance_ptr(nullptr, std::default_delete() ); new_instance_ptr.reset( - new Instance( - in_app_name, - in_engine_name, - in_opt_validation_callback_proc, - in_mt_safe) + new Instance(std::move(in_create_info_ptr) ) ); - new_instance_ptr->init(in_opt_disallowed_instance_level_extensions); + new_instance_ptr->init(); return new_instance_ptr; } @@ -103,8 +91,8 @@ Anvil::InstanceUniquePtr Anvil::Instance::create(const std::string& void Anvil::Instance::debug_callback_handler(const Anvil::DebugMessageSeverityFlagBits& in_severity, const char* in_message_ptr) { - m_validation_callback_function(in_severity, - in_message_ptr); + get_create_info_ptr()->get_validation_callback()(in_severity, + in_message_ptr); } /** Please see header for specification */ @@ -418,7 +406,7 @@ const Anvil::ExtensionKHRDeviceGroupCreationEntrypoints& Anvil::Instance::get_ex } /** Initializes the wrapper. */ -void Anvil::Instance::init(const std::vector& in_disallowed_instance_level_extensions) +void Anvil::Instance::init() { VkApplicationInfo app_info; VkInstanceCreateInfo create_info; @@ -479,8 +467,8 @@ void Anvil::Instance::init(const std::vector& in_disallowed_instanc app_info.apiVersion = VK_MAKE_VERSION(1, 0, 0); app_info.applicationVersion = 0; app_info.engineVersion = 0; - app_info.pApplicationName = m_app_name.c_str(); - app_info.pEngineName = m_engine_name.c_str(); + app_info.pApplicationName = get_create_info_ptr()->get_app_name ().c_str(); + app_info.pEngineName = get_create_info_ptr()->get_engine_name().c_str(); app_info.pNext = nullptr; app_info.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; @@ -500,15 +488,15 @@ void Anvil::Instance::init(const std::vector& in_disallowed_instanc /* If validation is enabled and this is a layer which issues debug call-backs, cache it, so that * we can request for it at vkCreateInstance() call time */ - if (m_validation_callback_function != nullptr && - layer_description.find("Validation") != std::string::npos) + if (get_create_info_ptr()->get_validation_callback() != nullptr && + layer_description.find ("Validation") != std::string::npos) { enabled_layers.push_back(layer_name.c_str() ); } } { - if (m_validation_callback_function != nullptr) + if (get_create_info_ptr()->get_validation_callback() != nullptr) { for (uint32_t n_extension = 0; n_extension < sizeof(desired_extensions_with_validation) / sizeof(desired_extensions_with_validation[0]); @@ -568,7 +556,7 @@ void Anvil::Instance::init(const std::vector& in_disallowed_instanc } /* Filter out undesired extensions */ - for (const auto& current_extension_name : in_disallowed_instance_level_extensions) + for (const auto& current_extension_name : get_create_info_ptr()->get_disallowed_instance_level_extensions() ) { auto ext_iterator = extension_enabled_status.find(current_extension_name); @@ -624,7 +612,7 @@ void Anvil::Instance::init(const std::vector& in_disallowed_instanc init_func_pointers(); - if (m_validation_callback_function != nullptr) + if (get_create_info_ptr()->get_validation_callback() != nullptr) { init_debug_callbacks(); } diff --git a/src/wrappers/memory_block.cpp b/src/wrappers/memory_block.cpp index 75ce6e53..ee2f5c70 100644 --- a/src/wrappers/memory_block.cpp +++ b/src/wrappers/memory_block.cpp @@ -22,6 +22,8 @@ #include "misc/debug.h" #include "misc/external_handle.h" +#include "misc/memory_allocator.h" +#include "misc/memory_block_create_info.h" #include "misc/object_tracker.h" #include "misc/struct_chainer.h" #include "wrappers/buffer.h" @@ -320,50 +322,27 @@ Anvil::ExternalHandleUniquePtr Anvil::MemoryBlock::export_to_external_memory_han uint32_t Anvil::MemoryBlock::get_device_memory_type_index(uint32_t in_memory_type_bits, Anvil::MemoryFeatureFlags in_memory_features) { - const bool is_coherent_memory_required ((in_memory_features & Anvil::MemoryFeatureFlagBits::HOST_COHERENT_BIT) != 0); - const bool is_device_local_memory_required ((in_memory_features & Anvil::MemoryFeatureFlagBits::DEVICE_LOCAL_BIT) != 0); - const bool is_host_cached_memory_required ((in_memory_features & Anvil::MemoryFeatureFlagBits::HOST_CACHED_BIT) != 0); - const bool is_lazily_allocated_memory_required((in_memory_features & Anvil::MemoryFeatureFlagBits::LAZILY_ALLOCATED_BIT) != 0); - const bool is_mappable_memory_required ((in_memory_features & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) != 0); - const bool is_multi_instance_memory_required ((in_memory_features & Anvil::MemoryFeatureFlagBits::MULTI_INSTANCE_BIT) != 0); - const Anvil::MemoryTypes& memory_types (get_create_info_ptr()->get_device()->get_physical_device_memory_properties().types); - - if (!is_mappable_memory_required) - { - anvil_assert(!is_coherent_memory_required); - } - - const std::size_t n_memory_types = memory_types.size(); - uint32_t result = UINT32_MAX; - - for (uint32_t n_memory_type = 0; - n_memory_type < n_memory_types; - ++n_memory_type) - { - const Anvil::MemoryType& current_memory_type = memory_types[n_memory_type]; - - if (((is_coherent_memory_required && ((current_memory_type.flags & Anvil::MemoryPropertyFlagBits::HOST_COHERENT_BIT)) != 0) || - !is_coherent_memory_required) && - ((is_device_local_memory_required && ((current_memory_type.flags & Anvil::MemoryPropertyFlagBits::DEVICE_LOCAL_BIT)) != 0) || - !is_device_local_memory_required) && - ((is_host_cached_memory_required && ((current_memory_type.flags & Anvil::MemoryPropertyFlagBits::HOST_CACHED_BIT)) != 0) || - !is_host_cached_memory_required) && - ((is_lazily_allocated_memory_required && ((current_memory_type.flags & Anvil::MemoryPropertyFlagBits::LAZILY_ALLOCATED_BIT)) != 0) || - !is_lazily_allocated_memory_required) && - ((is_mappable_memory_required && ((current_memory_type.flags & Anvil::MemoryPropertyFlagBits::HOST_VISIBLE_BIT)) != 0) || - !is_mappable_memory_required) && - (!is_multi_instance_memory_required || - (is_multi_instance_memory_required && ((current_memory_type.heap_ptr->flags & Anvil::MemoryHeapFlagBits::MULTI_INSTANCE_BIT_KHR) != 0))) ) - { - if ( (in_memory_type_bits & (1 << n_memory_type)) != 0) - { - result = n_memory_type; + uint32_t filtered_mem_types = 0; + uint32_t result = UINT32_MAX; - break; - } - } + if (!Anvil::MemoryAllocator::get_mem_types_supporting_mem_features(get_create_info_ptr()->get_device(), + in_memory_type_bits, + in_memory_features, + &filtered_mem_types) ) + { + goto end; } + /* Simply pick the first lit bit */ + result = 0; + + while ((filtered_mem_types & (1 << 0)) == 0) + { + result ++; + filtered_mem_types >>= 1; + } + +end: anvil_assert(result != UINT32_MAX); return result; } diff --git a/src/wrappers/queue.cpp b/src/wrappers/queue.cpp index 24c01440..2dd3afe6 100644 --- a/src/wrappers/queue.cpp +++ b/src/wrappers/queue.cpp @@ -518,10 +518,11 @@ void Anvil::Queue::insert_debug_utils_label(const char* in_label_name_ptr, } /** Please see header for specification */ -VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, - uint32_t in_swapchain_image_index, - uint32_t in_n_wait_semaphores, - Anvil::Semaphore* const* in_wait_semaphore_ptrs) +bool Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, + uint32_t in_swapchain_image_index, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs, + Anvil::SwapchainOperationErrorCode* out_present_results_ptr) { static const uint32_t device_mask = 0x1; @@ -531,18 +532,20 @@ VkResult Anvil::Queue::present(Anvil::Swapchain* in_swapchain_ptr, &in_swapchain_image_index, &device_mask, in_n_wait_semaphores, - in_wait_semaphore_ptrs); + in_wait_semaphore_ptrs, + out_present_results_ptr); } /** Please see header for specification */ -VkResult Anvil::Queue::present_in_local_presentation_mode(uint32_t in_n_local_mode_presentation_items, - const LocalModePresentationItem* in_local_mode_presentation_items, - uint32_t in_n_wait_semaphores, - Anvil::Semaphore* const* in_wait_semaphore_ptrs) +bool Anvil::Queue::present_in_local_presentation_mode(uint32_t in_n_local_mode_presentation_items, + const LocalModePresentationItem* in_local_mode_presentation_items, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs, + Anvil::SwapchainOperationErrorCode* out_present_results_ptr) { const Anvil::DeviceType device_type (m_device_ptr->get_type() ); uint32_t n_swapchains; - VkResult result; + bool result; uint32_t device_masks [MAX_SWAPCHAINS]; uint32_t swapchain_image_indices[MAX_SWAPCHAINS]; @@ -587,19 +590,21 @@ VkResult Anvil::Queue::present_in_local_presentation_mode(uint32_t swapchain_image_indices, device_masks, in_n_wait_semaphores, - in_wait_semaphore_ptrs); + in_wait_semaphore_ptrs, + out_present_results_ptr); return result; } /** Please see header for specification */ -VkResult Anvil::Queue::present_in_local_multi_device_presentation_mode(uint32_t in_n_local_multi_device_mode_presentation_items, - const Anvil::LocalMultiDeviceModePresentationItem* in_local_multi_device_mode_presentation_items, - uint32_t in_n_wait_semaphores, - Anvil::Semaphore* const* in_wait_semaphore_ptrs) +bool Anvil::Queue::present_in_local_multi_device_presentation_mode(uint32_t in_n_local_multi_device_mode_presentation_items, + const Anvil::LocalMultiDeviceModePresentationItem* in_local_multi_device_mode_presentation_items, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs, + Anvil::SwapchainOperationErrorCode* out_present_results_ptr) { uint32_t n_swapchains; - VkResult result; + bool result; uint32_t device_masks [MAX_SWAPCHAINS]; uint32_t swapchain_image_indices[MAX_SWAPCHAINS]; @@ -636,20 +641,22 @@ VkResult Anvil::Queue::present_in_local_multi_device_presentation_mode(uint32_t swapchain_image_indices, device_masks, in_n_wait_semaphores, - in_wait_semaphore_ptrs); + in_wait_semaphore_ptrs, + out_present_results_ptr); return result; } /** Please see header for specification */ -VkResult Anvil::Queue::present_in_remote_presentation_mode(uint32_t in_n_remote_mode_presentation_items, - const Anvil::RemoteModePresentationItem* in_remote_mode_presentation_items, - uint32_t in_n_wait_semaphores, - Anvil::Semaphore* const* in_wait_semaphore_ptrs) +bool Anvil::Queue::present_in_remote_presentation_mode(uint32_t in_n_remote_mode_presentation_items, + const Anvil::RemoteModePresentationItem* in_remote_mode_presentation_items, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs, + Anvil::SwapchainOperationErrorCode* out_present_results_ptr) { const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr)); uint32_t n_swapchains; - VkResult result; + bool result; uint32_t device_masks [MAX_SWAPCHAINS]; uint32_t swapchain_image_indices[MAX_SWAPCHAINS]; @@ -690,20 +697,22 @@ VkResult Anvil::Queue::present_in_remote_presentation_mode(uint32_t swapchain_image_indices, device_masks, in_n_wait_semaphores, - in_wait_semaphore_ptrs); + in_wait_semaphore_ptrs, + out_present_results_ptr); return result; } /** Please see header for specification */ -VkResult Anvil::Queue::present_in_sum_presentation_mode(uint32_t in_n_sum_mode_presentation_items, - const Anvil::SumModePresentationItem* in_sum_mode_presentation_items, - uint32_t in_n_wait_semaphores, - Anvil::Semaphore* const* in_wait_semaphore_ptrs) +bool Anvil::Queue::present_in_sum_presentation_mode(uint32_t in_n_sum_mode_presentation_items, + const Anvil::SumModePresentationItem* in_sum_mode_presentation_items, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs, + Anvil::SwapchainOperationErrorCode* out_present_results_ptr) { const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr)); uint32_t n_swapchains; - VkResult result; + bool result; uint32_t device_masks [MAX_SWAPCHAINS]; uint32_t swapchain_image_indices[MAX_SWAPCHAINS]; @@ -791,23 +800,26 @@ VkResult Anvil::Queue::present_in_sum_presentation_mode(uint32_t swapchain_image_indices, device_masks, in_n_wait_semaphores, - in_wait_semaphore_ptrs); + in_wait_semaphore_ptrs, + out_present_results_ptr); return result; } /** Please see header for specification */ -VkResult Anvil::Queue::present_internal(DeviceGroupPresentModeFlagBits in_presentation_mode, - uint32_t in_n_swapchains, - Anvil::Swapchain* const* in_swapchains, - const uint32_t* in_swapchain_image_indices, - const uint32_t* in_device_masks, - uint32_t in_n_wait_semaphores, - Anvil::Semaphore* const* in_wait_semaphore_ptrs) +bool Anvil::Queue::present_internal(DeviceGroupPresentModeFlagBits in_presentation_mode, + uint32_t in_n_swapchains, + Anvil::Swapchain* const* in_swapchains, + const uint32_t* in_swapchain_image_indices, + const uint32_t* in_device_masks, + uint32_t in_n_wait_semaphores, + Anvil::Semaphore* const* in_wait_semaphore_ptrs, + Anvil::SwapchainOperationErrorCode* out_present_results_ptr) { - const Anvil::DeviceType device_type (m_device_ptr->get_type() ); - VkResult presentation_results [MAX_SWAPCHAINS]; - VkResult result; + const Anvil::DeviceType device_type (m_device_ptr->get_type() ); + VkResult presentation_results [MAX_SWAPCHAINS]; + bool result (false); + VkResult result_vk; Anvil::StructChainer struct_chainer; const ExtensionKHRSwapchainEntrypoints* swapchain_entrypoints_ptr(nullptr); VkSwapchainKHR swapchains_vk [MAX_SWAPCHAINS]; @@ -858,7 +870,7 @@ VkResult Anvil::Queue::present_internal(DeviceGroupPresentModeFlagBits in_presen &callback_argument); } - result = VK_SUCCESS; + result = true; goto end; } } @@ -920,8 +932,8 @@ VkResult Anvil::Queue::present_internal(DeviceGroupPresentModeFlagBits in_presen { auto chain_ptr = struct_chainer.create_chain(); - result = swapchain_entrypoints_ptr->vkQueuePresentKHR(m_queue, - chain_ptr->get_root_struct() ); + result_vk = swapchain_entrypoints_ptr->vkQueuePresentKHR(m_queue, + chain_ptr->get_root_struct() ); } present_lock_unlock(in_n_swapchains, in_swapchains, @@ -929,74 +941,19 @@ VkResult Anvil::Queue::present_internal(DeviceGroupPresentModeFlagBits in_presen in_wait_semaphore_ptrs, false); - anvil_assert_vk_call_succeeded(result); + result = (result_vk == VK_SUCCESS); - if (is_vk_call_successful(result) ) + for (uint32_t n_presentation = 0; + n_presentation < in_n_swapchains; + ++n_presentation) { - for (uint32_t n_presentation = 0; - n_presentation < in_n_swapchains; - ++n_presentation) - { - anvil_assert(is_vk_call_successful(presentation_results[n_presentation])); - - /* Return the most important error code reported */ - if (result != VK_ERROR_DEVICE_LOST) - { - switch (presentation_results[n_presentation]) - { - case VK_ERROR_DEVICE_LOST: - { - result = VK_ERROR_DEVICE_LOST; - - break; - } - - case VK_ERROR_SURFACE_LOST_KHR: - { - if (result != VK_ERROR_DEVICE_LOST) - { - result = VK_ERROR_SURFACE_LOST_KHR; - } - - break; - } - - case VK_ERROR_OUT_OF_DATE_KHR: - { - if (result != VK_ERROR_DEVICE_LOST && - result != VK_ERROR_SURFACE_LOST_KHR) - { - result = VK_ERROR_OUT_OF_DATE_KHR; - } + out_present_results_ptr[n_presentation] = static_cast(presentation_results[n_presentation]); - break; - } - - case VK_SUBOPTIMAL_KHR: - { - if (result != VK_ERROR_DEVICE_LOST && - result != VK_ERROR_SURFACE_LOST_KHR && - result != VK_ERROR_OUT_OF_DATE_KHR) - { - result = VK_SUBOPTIMAL_KHR; - } - - break; - } - - default: - { - anvil_assert(presentation_results[n_presentation] == VK_SUCCESS); - } - } - } - - { - OnPresentRequestIssuedCallbackArgument callback_argument(in_swapchains[n_presentation]); + { + OnPresentRequestIssuedCallbackArgument callback_argument(in_swapchains[n_presentation]); - CallbacksSupportProvider::callback(QUEUE_CALLBACK_ID_PRESENT_REQUEST_ISSUED, - &callback_argument); - } + CallbacksSupportProvider::callback(QUEUE_CALLBACK_ID_PRESENT_REQUEST_ISSUED, + &callback_argument); } } diff --git a/src/wrappers/render_pass.cpp b/src/wrappers/render_pass.cpp index fe119979..f82a26b4 100644 --- a/src/wrappers/render_pass.cpp +++ b/src/wrappers/render_pass.cpp @@ -21,6 +21,7 @@ // #include "misc/debug.h" +#include "misc/formats.h" #include "misc/object_tracker.h" #include "misc/render_pass_create_info.h" #include "misc/struct_chainer.h" @@ -65,7 +66,42 @@ Anvil::RenderPass::~RenderPass() } /* Please see header for specification */ -bool Anvil::RenderPass::init() +Anvil::RenderPassUniquePtr Anvil::RenderPass::create(Anvil::RenderPassCreateInfoUniquePtr in_renderpass_create_info_ptr, + Anvil::Swapchain* in_opt_swapchain_ptr) +{ + std::unique_ptr result_ptr (nullptr, + std::default_delete() ); + auto rp_create_info_raw_ptr(in_renderpass_create_info_ptr.get() ); + + result_ptr.reset( + new Anvil::RenderPass(std::move(in_renderpass_create_info_ptr), + in_opt_swapchain_ptr) + ); + + if (result_ptr != nullptr) + { + bool result = false; + + if (rp_create_info_raw_ptr->get_device()->get_extension_info()->khr_create_renderpass2() ) + { + result = result_ptr->init_using_rp2_create_extension(); + } + else + { + result = result_ptr->init_using_core_vk10(); + } + + if (!result) + { + result_ptr.reset(); + } + } + + return std::move(result_ptr); +} + +/* Please see header for specification */ +bool Anvil::RenderPass::init_using_core_vk10() { std::vector > input_attachment_aspect_reference_ptrs; std::unique_ptr > multiview_view_mask_vec_ptr; @@ -241,6 +277,8 @@ bool Anvil::RenderPass::init() } } + anvil_assert( (*subpass_iterator)->depth_stencil_attachment.resolve_attachment_index == UINT32_MAX); + /* Determine the highest color attachment location & input attachment index. */ for (auto subpass_color_attachment_iterator = (*subpass_iterator)->color_attachments_map.cbegin(); subpass_color_attachment_iterator != (*subpass_iterator)->color_attachments_map.cend(); @@ -341,21 +379,21 @@ bool Anvil::RenderPass::init() const uint32_t n_resolved_attachments = ((*subpass_iterator)->resolved_attachments_map.size() == 0) ? 0 : n_color_attachments; - subpass_vk.colorAttachmentCount = n_color_attachments; - subpass_vk.flags = 0; - subpass_vk.inputAttachmentCount = n_input_attachments; - subpass_vk.pColorAttachments = (n_color_attachments > 0) ? ¤t_subpass_attachment_set_ptr->color_attachments_vk.at(0) - : nullptr; - subpass_vk.pDepthStencilAttachment = ((*subpass_iterator)->depth_stencil_attachment.attachment_index != UINT32_MAX) ? ¤t_subpass_attachment_set_ptr->depth_attachment_vk - : nullptr; - subpass_vk.pInputAttachments = (n_input_attachments > 0) ? ¤t_subpass_attachment_set_ptr->input_attachments_vk.at(0) - : nullptr; - subpass_vk.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS; - subpass_vk.pPreserveAttachments = (n_preserved_attachments > 0) ? ¤t_subpass_attachment_set_ptr->preserve_attachments_vk.at(0) - : nullptr; - subpass_vk.preserveAttachmentCount = n_preserved_attachments; - subpass_vk.pResolveAttachments = (n_resolved_attachments > 0) ? ¤t_subpass_attachment_set_ptr->resolve_color_attachments_vk.at(0) - : nullptr; + subpass_vk.colorAttachmentCount = n_color_attachments; + subpass_vk.flags = 0; + subpass_vk.inputAttachmentCount = n_input_attachments; + subpass_vk.pColorAttachments = (n_color_attachments > 0) ? ¤t_subpass_attachment_set_ptr->color_attachments_vk.at(0) + : nullptr; + subpass_vk.pDepthStencilAttachment = ((*subpass_iterator)->depth_stencil_attachment.attachment_index != UINT32_MAX) ? ¤t_subpass_attachment_set_ptr->depth_attachment_vk + : nullptr; + subpass_vk.pInputAttachments = (n_input_attachments > 0) ? ¤t_subpass_attachment_set_ptr->input_attachments_vk.at(0) + : nullptr; + subpass_vk.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS; + subpass_vk.pPreserveAttachments = (n_preserved_attachments > 0) ? ¤t_subpass_attachment_set_ptr->preserve_attachments_vk.at(0) + : nullptr; + subpass_vk.preserveAttachmentCount = n_preserved_attachments; + subpass_vk.pResolveAttachments = (n_resolved_attachments > 0) ? ¤t_subpass_attachment_set_ptr->resolve_color_attachments_vk.at(0) + : nullptr; current_subpass_attachment_set_ptr->do_sanity_checks(); @@ -524,24 +562,479 @@ bool Anvil::RenderPass::init() } /* Please see header for specification */ -Anvil::RenderPassUniquePtr Anvil::RenderPass::create(Anvil::RenderPassCreateInfoUniquePtr in_renderpass_create_info_ptr, - Anvil::Swapchain* in_opt_swapchain_ptr) +bool Anvil::RenderPass::init_using_rp2_create_extension() { - std::unique_ptr result_ptr(nullptr, - std::default_delete() ); + const auto& crp2_entrypoints = m_render_pass_create_info_ptr->get_device ()->get_extension_khr_create_renderpass2_entrypoints(); + const uint32_t n_rp_attachments = m_render_pass_create_info_ptr->get_n_attachments (); + const uint32_t n_subpass_deps = m_render_pass_create_info_ptr->get_n_dependencies(); + const uint32_t n_subpasses = m_render_pass_create_info_ptr->get_n_subpasses (); + bool result = false; + Anvil::StructChainer struct_chainer; + + std::vector rp_attachment_vec (n_rp_attachments); + std::vector subpass_attachment_reference_vec; + Anvil::StructChainVector subpass_chain_vec; + std::vector > subpass_chainer_vec (n_subpasses); + std::vector subpass_dep_vec (n_subpass_deps); + std::vector subpass_preserve_attachment_vec; + + /* Prepare renderpass attachment vec */ + for (uint32_t n_rp_attachment = 0; + n_rp_attachment < n_rp_attachments; + ++n_rp_attachment) + { + Anvil::ImageLayout current_rp_attachment_final_layout = Anvil::ImageLayout::UNKNOWN; + Anvil::Format current_rp_attachment_format = Anvil::Format::UNKNOWN; + VkAttachmentDescription2KHR& current_rp_attachment_info = rp_attachment_vec.at(n_rp_attachment); + Anvil::ImageLayout current_rp_attachment_initial_layout = Anvil::ImageLayout::UNKNOWN; + bool current_rp_attachment_may_alias = false; + Anvil::AttachmentLoadOp current_rp_attachment_load_op = Anvil::AttachmentLoadOp::UNKNOWN; + Anvil::SampleCountFlagBits current_rp_attachment_sample_count = Anvil::SampleCountFlagBits::NONE; + Anvil::AttachmentLoadOp current_rp_attachment_stencil_load_op = Anvil::AttachmentLoadOp::DONT_CARE; + Anvil::AttachmentStoreOp current_rp_attachment_stencil_store_op = Anvil::AttachmentStoreOp::DONT_CARE; + Anvil::AttachmentStoreOp current_rp_attachment_store_op = Anvil::AttachmentStoreOp::UNKNOWN; + Anvil::AttachmentType current_rp_attachment_type = Anvil::AttachmentType::UNKNOWN; + + m_render_pass_create_info_ptr->get_attachment_type(n_rp_attachment, + ¤t_rp_attachment_type); + + switch (current_rp_attachment_type) + { + case Anvil::AttachmentType::COLOR: + { + m_render_pass_create_info_ptr->get_color_attachment_properties(n_rp_attachment, + ¤t_rp_attachment_format, + ¤t_rp_attachment_sample_count, + ¤t_rp_attachment_load_op, + ¤t_rp_attachment_store_op, + ¤t_rp_attachment_initial_layout, + ¤t_rp_attachment_final_layout, + ¤t_rp_attachment_may_alias); - result_ptr.reset( - new Anvil::RenderPass(std::move(in_renderpass_create_info_ptr), - in_opt_swapchain_ptr) - ); + break; + } - if (result_ptr != nullptr) + case Anvil::AttachmentType::DEPTH_STENCIL: + { + m_render_pass_create_info_ptr->get_depth_stencil_attachment_properties(n_rp_attachment, + ¤t_rp_attachment_format, + ¤t_rp_attachment_sample_count, + ¤t_rp_attachment_load_op, + ¤t_rp_attachment_store_op, + ¤t_rp_attachment_stencil_load_op, + ¤t_rp_attachment_stencil_store_op, + ¤t_rp_attachment_initial_layout, + ¤t_rp_attachment_final_layout, + ¤t_rp_attachment_may_alias); + + break; + } + + default: + { + anvil_assert_fail(); + + goto end; + } + } + + current_rp_attachment_info.finalLayout = static_cast(current_rp_attachment_final_layout); + current_rp_attachment_info.flags = (current_rp_attachment_may_alias) ? VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT + : 0; + current_rp_attachment_info.format = static_cast (current_rp_attachment_format); + current_rp_attachment_info.initialLayout = static_cast (current_rp_attachment_initial_layout); + current_rp_attachment_info.loadOp = static_cast(current_rp_attachment_load_op); + current_rp_attachment_info.pNext = nullptr; + current_rp_attachment_info.samples = static_cast(current_rp_attachment_sample_count); + current_rp_attachment_info.stencilLoadOp = static_cast (current_rp_attachment_stencil_load_op); + current_rp_attachment_info.stencilStoreOp = static_cast (current_rp_attachment_stencil_store_op); + current_rp_attachment_info.storeOp = static_cast (current_rp_attachment_store_op); + current_rp_attachment_info.sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2_KHR; + } + + /* Prepare subpass dep vec */ + for (uint32_t n_subpass_dep = 0; + n_subpass_dep < n_subpass_deps; + ++n_subpass_dep) { - if (!result_ptr->init() ) + auto& current_subpass_dep = subpass_dep_vec.at(n_subpass_dep); + Anvil::AccessFlags current_subpass_dep_dst_access_mask = Anvil::AccessFlagBits::NONE; + Anvil::PipelineStageFlags current_subpass_dep_dst_stage_mask = Anvil::PipelineStageFlagBits::NONE; + Anvil::SubPassID current_subpass_dep_dst_subpass_id = UINT32_MAX; + Anvil::DependencyFlags current_subpass_dep_flags = Anvil::DependencyFlagBits::NONE; + int32_t current_subpass_dep_multiview_offset = 0; + Anvil::AccessFlags current_subpass_dep_src_access_mask = Anvil::AccessFlagBits::NONE; + Anvil::SubPassID current_subpass_dep_src_subpass_id = UINT32_MAX; + Anvil::PipelineStageFlags current_subpass_dep_src_stage_mask = Anvil::PipelineStageFlagBits::NONE; + + if (m_render_pass_create_info_ptr->is_multiview_enabled() ) { - result_ptr.reset(); + m_render_pass_create_info_ptr->get_dependency_multiview_properties(n_subpass_dep, + ¤t_subpass_dep_multiview_offset); } + + m_render_pass_create_info_ptr->get_dependency_properties(n_subpass_dep, + ¤t_subpass_dep_dst_subpass_id, + ¤t_subpass_dep_src_subpass_id, + ¤t_subpass_dep_dst_stage_mask, + ¤t_subpass_dep_src_stage_mask, + ¤t_subpass_dep_dst_access_mask, + ¤t_subpass_dep_src_access_mask, + ¤t_subpass_dep_flags); + + current_subpass_dep.dependencyFlags = current_subpass_dep_flags.get_vk (); + current_subpass_dep.dstAccessMask = current_subpass_dep_dst_access_mask.get_vk(); + current_subpass_dep.dstStageMask = current_subpass_dep_dst_stage_mask.get_vk (); + current_subpass_dep.dstSubpass = (current_subpass_dep_dst_subpass_id == UINT32_MAX) ? VK_SUBPASS_EXTERNAL + : current_subpass_dep_dst_subpass_id; + current_subpass_dep.pNext = nullptr; + current_subpass_dep.srcAccessMask = current_subpass_dep_src_access_mask.get_vk(); + current_subpass_dep.srcStageMask = current_subpass_dep_src_stage_mask.get_vk (); + current_subpass_dep.srcSubpass = (current_subpass_dep_src_subpass_id == UINT32_MAX) ? VK_SUBPASS_EXTERNAL + : current_subpass_dep_src_subpass_id; + current_subpass_dep.sType = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2_KHR; + current_subpass_dep.viewOffset = current_subpass_dep_multiview_offset; } - return std::move(result_ptr); + /* Prepare subpass vec */ + for (uint32_t n_subpass = 0; + n_subpass < n_subpasses; + ++n_subpass) + { + uint32_t current_subpass_attachment_reference_vec_base_index = static_cast(subpass_attachment_reference_vec.size() ); + uint32_t current_subpass_highest_location = 0; + uint32_t current_subpass_preserve_attachment_vec_base_index = static_cast(subpass_preserve_attachment_vec.size () ); + uint32_t current_subpass_view_mask = 0; + uint32_t n_current_subpass_color_attachments_actual = 0; + uint32_t n_current_subpass_ds_attachments = 0; + uint32_t n_current_subpass_input_attachments_actual = 0; + uint32_t n_current_subpass_color_input_resolve_attachments_needed = 0; + uint32_t n_current_subpass_preserve_attachments = 0; + uint32_t n_current_subpass_resolve_attachments_actual = 0; + + m_render_pass_create_info_ptr->get_subpass_highest_location(n_subpass, + ¤t_subpass_highest_location); + + n_current_subpass_color_input_resolve_attachments_needed = current_subpass_highest_location + 1; + + + m_render_pass_create_info_ptr->get_subpass_n_attachments(n_subpass, + Anvil::AttachmentType::COLOR, + &n_current_subpass_color_attachments_actual); + m_render_pass_create_info_ptr->get_subpass_n_attachments(n_subpass, + Anvil::AttachmentType::DEPTH_STENCIL, + &n_current_subpass_ds_attachments); + m_render_pass_create_info_ptr->get_subpass_n_attachments(n_subpass, + Anvil::AttachmentType::INPUT, + &n_current_subpass_input_attachments_actual); + m_render_pass_create_info_ptr->get_subpass_n_attachments(n_subpass, + Anvil::AttachmentType::PRESERVE, + &n_current_subpass_preserve_attachments); + m_render_pass_create_info_ptr->get_subpass_n_attachments(n_subpass, + Anvil::AttachmentType::RESOLVE, + &n_current_subpass_resolve_attachments_actual); + + const struct + { + Anvil::AttachmentType subpass_attachment_type; + uint32_t n_subpass_attachments; + uint32_t subpass_attachment_reference_vec_offset; + } subpass_attachment_data[] = + { + /* NOTE: Preserve attachments are handled elsewhere */ + {Anvil::AttachmentType::COLOR, n_current_subpass_color_input_resolve_attachments_needed, 0}, + {Anvil::AttachmentType::DEPTH_STENCIL, n_current_subpass_ds_attachments, n_current_subpass_color_input_resolve_attachments_needed}, + {Anvil::AttachmentType::INPUT, n_current_subpass_color_input_resolve_attachments_needed, n_current_subpass_color_input_resolve_attachments_needed + n_current_subpass_ds_attachments}, + {Anvil::AttachmentType::RESOLVE, n_current_subpass_color_input_resolve_attachments_needed, n_current_subpass_color_input_resolve_attachments_needed + n_current_subpass_ds_attachments + n_current_subpass_color_input_resolve_attachments_needed}, + }; + + const auto& subpass_color_attachment_data = subpass_attachment_data[0]; + const auto& subpass_ds_attachment_data = subpass_attachment_data[1]; + const auto& subpass_input_attachment_data = subpass_attachment_data[2]; + const auto& subpass_resolve_attachment_data = subpass_attachment_data[3]; + + anvil_assert(subpass_color_attachment_data.subpass_attachment_type == Anvil::AttachmentType::COLOR); + anvil_assert(subpass_ds_attachment_data.subpass_attachment_type == Anvil::AttachmentType::DEPTH_STENCIL); + anvil_assert(subpass_input_attachment_data.subpass_attachment_type == Anvil::AttachmentType::INPUT); + anvil_assert(subpass_resolve_attachment_data.subpass_attachment_type == Anvil::AttachmentType::RESOLVE); + + const uint32_t current_subpass_color_attachment_reference_vec_base_index = current_subpass_attachment_reference_vec_base_index; + const uint32_t current_subpass_ds_attachment_reference_vec_base_index = current_subpass_color_attachment_reference_vec_base_index + subpass_color_attachment_data.n_subpass_attachments; + const uint32_t current_subpass_input_attachment_reference_vec_base_index = current_subpass_ds_attachment_reference_vec_base_index + subpass_ds_attachment_data.n_subpass_attachments; + const uint32_t current_subpass_resolve_attachment_reference_vec_base_index = current_subpass_input_attachment_reference_vec_base_index + subpass_input_attachment_data.n_subpass_attachments; + + subpass_attachment_reference_vec.resize(subpass_attachment_reference_vec.size() + + subpass_color_attachment_data.n_subpass_attachments + + subpass_ds_attachment_data.n_subpass_attachments + + subpass_input_attachment_data.n_subpass_attachments + + subpass_resolve_attachment_data.n_subpass_attachments); + + subpass_preserve_attachment_vec.resize (subpass_preserve_attachment_vec.size() + + n_current_subpass_preserve_attachments); + + /* Fill the new attachment reference structs with dummy data */ + for (uint32_t n_subpass_attachment_reference_item = current_subpass_attachment_reference_vec_base_index; + n_subpass_attachment_reference_item < static_cast(subpass_attachment_reference_vec.size() ); + ++n_subpass_attachment_reference_item) + { + auto& current_subpass_attachment_reference = subpass_attachment_reference_vec.at(n_subpass_attachment_reference_item); + + current_subpass_attachment_reference.aspectMask = 0; + current_subpass_attachment_reference.attachment = VK_ATTACHMENT_UNUSED; + current_subpass_attachment_reference.layout = VK_IMAGE_LAYOUT_UNDEFINED; + current_subpass_attachment_reference.pNext = nullptr; + current_subpass_attachment_reference.sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2_KHR; + } + + for (const auto& current_subpass_attachment_data : subpass_attachment_data) + { + for (uint32_t n_subpass_attachment = 0; + n_subpass_attachment < current_subpass_attachment_data.n_subpass_attachments; + ++n_subpass_attachment) + { + Anvil::ImageAspectFlags current_subpass_attachment_aspects_accessed = Anvil::ImageAspectFlagBits::NONE; + Anvil::ImageLayout current_subpass_attachment_layout = Anvil::ImageLayout::UNKNOWN; + uint32_t current_subpass_attachment_location = UINT32_MAX; + Anvil::RenderPassAttachmentID current_subpass_attachment_rp_attachment_id = VK_ATTACHMENT_UNUSED; + uint32_t reference_vec_base_index = UINT32_MAX; + + if (!m_render_pass_create_info_ptr->get_subpass_attachment_properties(n_subpass, + current_subpass_attachment_data.subpass_attachment_type, + n_subpass_attachment, + ¤t_subpass_attachment_rp_attachment_id, + ¤t_subpass_attachment_layout, + ¤t_subpass_attachment_aspects_accessed, + nullptr, /* out_opt_attachment_resolve_id_ptr */ + ¤t_subpass_attachment_location) ) + { + /* Out of attachments of this type, move on. */ + break; + } + + if (current_subpass_attachment_aspects_accessed == Anvil::ImageAspectFlagBits::NONE) + { + Anvil::AttachmentType rp_attachment_type = Anvil::AttachmentType::UNKNOWN; + + if (!m_render_pass_create_info_ptr->get_attachment_type(current_subpass_attachment_rp_attachment_id, + &rp_attachment_type) ) + { + anvil_assert_fail(); + + goto end; + } + + if (rp_attachment_type == Anvil::AttachmentType::COLOR) + { + current_subpass_attachment_aspects_accessed = Anvil::ImageAspectFlagBits::COLOR_BIT; + } + else + { + Anvil::Format rp_attachment_format = Anvil::Format::UNKNOWN; + + anvil_assert(rp_attachment_type == Anvil::AttachmentType::DEPTH_STENCIL); + + m_render_pass_create_info_ptr->get_depth_stencil_attachment_properties(current_subpass_attachment_rp_attachment_id, + &rp_attachment_format); + + anvil_assert(rp_attachment_format != Anvil::Format::UNKNOWN); + + current_subpass_attachment_aspects_accessed = ((Anvil::Formats::has_depth_aspect (rp_attachment_format) ) ? Anvil::ImageAspectFlagBits::DEPTH_BIT : Anvil::ImageAspectFlagBits::NONE) | + ((Anvil::Formats::has_stencil_aspect(rp_attachment_format) ) ? Anvil::ImageAspectFlagBits::STENCIL_BIT : Anvil::ImageAspectFlagBits::NONE); + } + } + + switch (current_subpass_attachment_data.subpass_attachment_type) + { + case AttachmentType::COLOR: reference_vec_base_index = current_subpass_color_attachment_reference_vec_base_index; break; + case AttachmentType::DEPTH_STENCIL: reference_vec_base_index = current_subpass_ds_attachment_reference_vec_base_index; break; + case AttachmentType::INPUT: reference_vec_base_index = current_subpass_input_attachment_reference_vec_base_index; break; + case AttachmentType::RESOLVE: reference_vec_base_index = current_subpass_resolve_attachment_reference_vec_base_index; break; + + default: + { + anvil_assert_fail(); + + goto end; + } + } + + auto& current_subpass_attachment_reference = subpass_attachment_reference_vec.at(reference_vec_base_index + current_subpass_attachment_location); + + current_subpass_attachment_reference.aspectMask = current_subpass_attachment_aspects_accessed.get_vk(); + current_subpass_attachment_reference.attachment = current_subpass_attachment_rp_attachment_id; + current_subpass_attachment_reference.layout = static_cast(current_subpass_attachment_layout); + current_subpass_attachment_reference.pNext = nullptr; + current_subpass_attachment_reference.sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2_KHR; + } + + current_subpass_attachment_reference_vec_base_index += current_subpass_attachment_data.n_subpass_attachments; + } + + for (uint32_t n_subpass_preserve_attachment = 0; + n_subpass_preserve_attachment < n_current_subpass_preserve_attachments; + ++n_subpass_preserve_attachment) + { + auto& current_subpass_preserve_attachment = subpass_preserve_attachment_vec.at(current_subpass_preserve_attachment_vec_base_index + n_subpass_preserve_attachment); + Anvil::ImageLayout dummy_layout; + + m_render_pass_create_info_ptr->get_subpass_attachment_properties(n_subpass, + Anvil::AttachmentType::PRESERVE, + n_subpass_preserve_attachment, + ¤t_subpass_preserve_attachment, + &dummy_layout); + + } + + if (m_render_pass_create_info_ptr->is_multiview_enabled() ) + { + m_render_pass_create_info_ptr->get_subpass_view_mask(n_subpass, + ¤t_subpass_view_mask); + } + + /* NOTE: For ptrs, we only store offsets to reference structs in this pass. Once all subpasses are processed, base pointer + * is added. This is required since std::vector will likely realloc its storage as we keep pushing structs into it. + */ + { + auto& current_subpass_chainer = subpass_chainer_vec.at(n_subpass); + + /* Chain the root subpass struct */ + { + VkSubpassDescription2KHR current_subpass; + + current_subpass.colorAttachmentCount = (n_current_subpass_color_attachments_actual > 0) ? n_current_subpass_color_input_resolve_attachments_needed + : 0; + current_subpass.flags = 0; + current_subpass.inputAttachmentCount = (n_current_subpass_input_attachments_actual > 0) ? n_current_subpass_color_input_resolve_attachments_needed + : 0; + current_subpass.pColorAttachments = (n_current_subpass_color_attachments_actual > 0) ? reinterpret_cast(current_subpass_color_attachment_reference_vec_base_index * sizeof(VkAttachmentReference2KHR) ) + : nullptr; + current_subpass.pDepthStencilAttachment = (n_current_subpass_ds_attachments > 0) ? reinterpret_cast(current_subpass_ds_attachment_reference_vec_base_index * sizeof(VkAttachmentReference2KHR) ) + : nullptr; + current_subpass.pInputAttachments = (n_current_subpass_input_attachments_actual > 0) ? reinterpret_cast(current_subpass_input_attachment_reference_vec_base_index * sizeof(VkAttachmentReference2KHR) ) + : nullptr; + current_subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS; + current_subpass.pNext = nullptr; + current_subpass.pPreserveAttachments = (n_current_subpass_preserve_attachments > 0) ? reinterpret_cast(reinterpret_cast(0) + current_subpass_preserve_attachment_vec_base_index) + : nullptr; + current_subpass.preserveAttachmentCount = n_current_subpass_preserve_attachments; + current_subpass.pResolveAttachments = (n_current_subpass_resolve_attachments_actual > 0) ? reinterpret_cast(current_subpass_resolve_attachment_reference_vec_base_index * sizeof(VkAttachmentReference2KHR) ) + : nullptr; + current_subpass.sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2_KHR; + current_subpass.viewMask = current_subpass_view_mask; + + current_subpass_chainer.append_struct(current_subpass); + } + } + } + + /* Convert offsets to actual pointers */ + for (uint32_t n_subpass = 0; + n_subpass < n_subpasses; + ++n_subpass) + { + auto& current_subpass_chainer = subpass_chainer_vec.at (n_subpass); + auto current_subpass_ptr = current_subpass_chainer.get_root_struct(); + uint32_t n_current_subpass_ds_attachments = 0; + uint32_t n_current_subpass_preserve_attachments = 0; + + m_render_pass_create_info_ptr->get_subpass_n_attachments(n_subpass, + Anvil::AttachmentType::DEPTH_STENCIL, + &n_current_subpass_ds_attachments); + m_render_pass_create_info_ptr->get_subpass_n_attachments(n_subpass, + Anvil::AttachmentType::PRESERVE, + &n_current_subpass_preserve_attachments); + + const struct + { + bool active; + const VkAttachmentReference2KHR** attachment_reference_ptr_ptr; + } subpass_attachment_data[] = + { + {current_subpass_ptr->colorAttachmentCount > 0, ¤t_subpass_ptr->pColorAttachments}, + {n_current_subpass_ds_attachments > 0, ¤t_subpass_ptr->pDepthStencilAttachment}, + {current_subpass_ptr->inputAttachmentCount > 0, ¤t_subpass_ptr->pInputAttachments}, + {current_subpass_ptr->pResolveAttachments != nullptr, ¤t_subpass_ptr->pResolveAttachments}, + }; + + for (const auto& current_subpass_attachment_data : subpass_attachment_data) + { + if (!current_subpass_attachment_data.active) + { + continue; + } + + *current_subpass_attachment_data.attachment_reference_ptr_ptr = reinterpret_cast(reinterpret_cast(*current_subpass_attachment_data.attachment_reference_ptr_ptr) + reinterpret_cast(&subpass_attachment_reference_vec.at(0) )); + } + + if (n_current_subpass_preserve_attachments > 0) + { + current_subpass_ptr->pPreserveAttachments = reinterpret_cast(reinterpret_cast(current_subpass_ptr->pPreserveAttachments) + reinterpret_cast(&subpass_preserve_attachment_vec.at(0) )); + } + } + + /* Create subpass struct chains. */ + for (uint32_t n_subpass_chainer = 0; + n_subpass_chainer < static_cast(subpass_chainer_vec.size() ); + ++n_subpass_chainer) + { + const auto& current_subpass_chainer = subpass_chainer_vec.at (n_subpass_chainer); + auto subpass_chain_ptr = current_subpass_chainer.create_chain(); + + anvil_assert(subpass_chain_ptr != nullptr); + + subpass_chain_vec.append_struct_chain(std::move(subpass_chain_ptr) ); + } + + /* Chain the root struct. */ + { + VkRenderPassCreateInfo2KHR create_info; + const uint32_t* multiview_correlated_masks = nullptr; + uint32_t n_multiview_correlated_masks = 0; + + if (m_render_pass_create_info_ptr->is_multiview_enabled() ) + { + m_render_pass_create_info_ptr->get_multiview_correlation_masks(&n_multiview_correlated_masks, + &multiview_correlated_masks); + } + + create_info.attachmentCount = n_rp_attachments; + create_info.correlatedViewMaskCount = n_multiview_correlated_masks; + create_info.dependencyCount = n_subpass_deps; + create_info.flags = 0; + create_info.pAttachments = (n_rp_attachments > 0) ? &rp_attachment_vec.at(0) + : nullptr; + create_info.pCorrelatedViewMasks = multiview_correlated_masks; + create_info.pDependencies = (n_subpass_deps > 0) ? &subpass_dep_vec.at(0) + : nullptr; + create_info.pNext = nullptr; + create_info.pSubpasses = (n_subpasses > 0) ? subpass_chain_vec.get_root_structs() + : nullptr; + create_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2_KHR; + create_info.subpassCount = m_render_pass_create_info_ptr->get_n_subpasses(); + + struct_chainer.append_struct(create_info); + } + + /* All done! Spawn the final chain and try to create the renderpass. */ + { + auto create_info_chain_ptr = struct_chainer.create_chain(); + VkResult result_vk = VK_ERROR_DEVICE_LOST; + + result_vk = crp2_entrypoints.vkCreateRenderPass2KHR(m_device_ptr->get_device_vk (), + create_info_chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_render_pass); + + if (!is_vk_call_successful(result_vk) ) + { + anvil_assert_vk_call_succeeded(result_vk); + + goto end; + } + } + + set_vk_handle(m_render_pass); + result = true; +end: + return result; } diff --git a/src/wrappers/rendering_surface.cpp b/src/wrappers/rendering_surface.cpp index ca359955..5589e2c0 100644 --- a/src/wrappers/rendering_surface.cpp +++ b/src/wrappers/rendering_surface.cpp @@ -605,4 +605,95 @@ bool Anvil::RenderingSurface::supports_presentation_mode(const Anvil::PhysicalDe } return result; -} \ No newline at end of file +} + +void Anvil::RenderingSurface::update_surface_extents() const +{ + const Anvil::DeviceType& device_type (m_device_ptr->get_type() ); + auto khr_surface_entrypoints (m_instance_ptr->get_extension_khr_surface_entrypoints() ); + const Anvil::MGPUDevice* mgpu_device_ptr (dynamic_cast(m_device_ptr)); + uint32_t n_physical_devices (0); + const Anvil::SGPUDevice* sgpu_device_ptr (dynamic_cast(m_device_ptr)); + + if (m_window_ptr != nullptr) + { + const WindowPlatform window_platform(m_window_ptr->get_platform() ); + + if (window_platform == WINDOW_PLATFORM_DUMMY || + window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS) + { + /* Nothing to update - off-screen rendering is active. */ + goto end; + } + else + { + /* In this case, width & height may change at run-time */ + } + } + else + { + /* In this case, width & height may change at run-time */ + } + + switch (device_type) + { + case Anvil::DeviceType::MULTI_GPU: n_physical_devices = mgpu_device_ptr->get_n_physical_devices(); break; + case Anvil::DeviceType::SINGLE_GPU: n_physical_devices = 1; break; + + default: + { + anvil_assert_fail(); + } + } + + /* Retrieve general properties */ + for (uint32_t n_physical_device = 0; + n_physical_device < n_physical_devices; + ++n_physical_device) + { + const Anvil::PhysicalDevice* physical_device_ptr = nullptr; + VkResult result_vk; + Anvil::SurfaceCapabilities surface_caps; + + ANVIL_REDUNDANT_VARIABLE_CONST(result_vk); + + switch (device_type) + { + case Anvil::DeviceType::MULTI_GPU: physical_device_ptr = mgpu_device_ptr->get_physical_device(n_physical_device); break; + case Anvil::DeviceType::SINGLE_GPU: physical_device_ptr = sgpu_device_ptr->get_physical_device(); break; + + default: + { + anvil_assert_fail(); + } + } + + if (m_surface == VK_NULL_HANDLE) + { + /* Nothing to update */ + goto end; + } + + const VkPhysicalDevice physical_device_vk = physical_device_ptr->get_physical_device(); + + result_vk = khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physical_device_vk, + m_surface, + reinterpret_cast(&surface_caps) ); + + anvil_assert_vk_call_succeeded(result_vk); + + if (n_physical_device == 0) + { + m_height = surface_caps.current_extent.height; + m_width = surface_caps.current_extent.width; + } + else + { + anvil_assert(m_height == surface_caps.current_extent.height); + anvil_assert(m_width == surface_caps.current_extent.width); + } + } + +end: + ; +} diff --git a/src/wrappers/swapchain.cpp b/src/wrappers/swapchain.cpp index 74b73d3c..68d26632 100644 --- a/src/wrappers/swapchain.cpp +++ b/src/wrappers/swapchain.cpp @@ -95,10 +95,12 @@ Anvil::Swapchain::~Swapchain() } /** Please see header for specification */ -uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, - bool in_should_block) +Anvil::SwapchainOperationErrorCode Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, + uint32_t* out_result_index_ptr, + bool in_should_block) { - uint32_t result(UINT32_MAX); + uint32_t result = UINT32_MAX; + Anvil::SwapchainOperationErrorCode result_status = Anvil::SwapchainOperationErrorCode::SUCCESS; switch (m_device_ptr->get_type() ) { @@ -117,10 +119,11 @@ uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, physical_devices[n_physical_device] = mgpu_device_ptr->get_physical_device(n_physical_device); } - result = acquire_image(in_opt_semaphore_ptr, - n_physical_devices, - physical_devices, - in_should_block); + result_status = acquire_image(in_opt_semaphore_ptr, + n_physical_devices, + physical_devices, + &result, + in_should_block); break; } @@ -132,10 +135,11 @@ uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, physical_device_ptr = sgpu_device_ptr->get_physical_device(); - result = acquire_image(in_opt_semaphore_ptr, - 1, /* n_mgpu_physical_devices */ - &physical_device_ptr, - in_should_block); + result_status = acquire_image(in_opt_semaphore_ptr, + 1, /* n_mgpu_physical_devices */ + &physical_device_ptr, + &result, + in_should_block); break; } @@ -146,24 +150,25 @@ uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, } } - return result; + *out_result_index_ptr = result; + + return result_status; } /** Please see header for specification */ -uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, - uint32_t in_n_mgpu_physical_devices, - const Anvil::PhysicalDevice* const* in_mgpu_physical_device_ptrs, - bool in_should_block) +Anvil::SwapchainOperationErrorCode Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_opt_semaphore_ptr, + uint32_t in_n_mgpu_physical_devices, + const Anvil::PhysicalDevice* const* in_mgpu_physical_device_ptrs, + uint32_t* out_result_index_ptr, + bool in_should_block) { const Anvil::DeviceType device_type = m_device_ptr->get_type(); - uint32_t result = UINT32_MAX; - VkResult result_vk = VK_ERROR_INITIALIZATION_FAILED; - const WindowPlatform window_platform = m_create_info_ptr->get_window()->get_platform(); - const bool is_offscreen_rendering_enabled = (window_platform == WINDOW_PLATFORM_DUMMY || - window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS); - - ANVIL_REDUNDANT_VARIABLE(result_vk); + uint32_t result = UINT32_MAX; + Anvil::SwapchainOperationErrorCode result_status = Anvil::SwapchainOperationErrorCode::SUCCESS; + const WindowPlatform window_platform = m_create_info_ptr->get_window()->get_platform(); + const bool is_offscreen_rendering_enabled = (window_platform == WINDOW_PLATFORM_DUMMY || + window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS); if (!is_offscreen_rendering_enabled) { @@ -188,12 +193,12 @@ uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_ { const auto& khr_swapchain_entrypoints = m_device_ptr->get_extension_khr_swapchain_entrypoints(); - result_vk = khr_swapchain_entrypoints.vkAcquireNextImageKHR(m_device_ptr->get_device_vk(), - m_swapchain, - UINT64_MAX, - (in_opt_semaphore_ptr != nullptr) ? in_opt_semaphore_ptr->get_semaphore() : VK_NULL_HANDLE, - fence_handle, - &result); + result_status = static_cast(khr_swapchain_entrypoints.vkAcquireNextImageKHR(m_device_ptr->get_device_vk(), + m_swapchain, + UINT64_MAX, + (in_opt_semaphore_ptr != nullptr) ? in_opt_semaphore_ptr->get_semaphore() : VK_NULL_HANDLE, + fence_handle, + &result) ); } else { @@ -223,20 +228,18 @@ uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_ info.deviceMask |= (1 << physical_device_index); } - result_vk = khr_device_group_entrypoints.vkAcquireNextImage2KHR(mgpu_device_ptr->get_device_vk(), - &info, - &result); + result_status = static_cast(khr_device_group_entrypoints.vkAcquireNextImage2KHR(mgpu_device_ptr->get_device_vk(), + &info, + &result) ); } if (fence_handle != VK_NULL_HANDLE) { - result_vk = Anvil::Vulkan::vkWaitForFences(m_device_ptr->get_device_vk(), - 1, /* fenceCount */ - &fence_handle, - VK_TRUE, /* waitAll */ - UINT64_MAX); - - anvil_assert_vk_call_succeeded(result_vk); + result_status = static_cast(Anvil::Vulkan::vkWaitForFences(m_device_ptr->get_device_vk(), + 1, /* fenceCount */ + &fence_handle, + VK_TRUE, /* waitAll */ + UINT64_MAX) ); } } unlock(); @@ -246,8 +249,6 @@ uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_ { in_opt_semaphore_ptr->unlock(); } - - anvil_assert_vk_call_succeeded(result_vk); } else { @@ -272,8 +273,9 @@ uint32_t Anvil::Swapchain::acquire_image(Anvil::Semaphore* in_ m_n_acquire_counter_rounded = (m_n_acquire_counter_rounded + 1) % m_create_info_ptr->get_n_images(); m_last_acquired_image_index = result; + *out_result_index_ptr = result; - return result; + return result_status; } /** Please see header for specification */ @@ -361,6 +363,8 @@ bool Anvil::Swapchain::init() const bool is_offscreen_rendering_enabled = (window_platform == WINDOW_PLATFORM_DUMMY || window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS); + parent_surface_ptr->update_surface_extents(); + m_n_images = 0; m_size.width = parent_surface_ptr->get_width (); m_size.height = parent_surface_ptr->get_height(); @@ -455,19 +459,21 @@ bool Anvil::Swapchain::init() { VkSwapchainCreateInfoKHR create_info; + const auto& old_swapchain_ptr = m_create_info_ptr->get_old_swapchain(); - create_info.clipped = true; /* we won't be reading from the presentable images */ + create_info.clipped = m_create_info_ptr->get_clipped(); create_info.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; create_info.flags = m_create_info_ptr->get_flags().get_vk(); create_info.imageArrayLayers = 1; - create_info.imageColorSpace = static_cast(m_create_info_ptr->get_color_space() ); + create_info.imageColorSpace = static_cast (m_create_info_ptr->get_color_space() ); create_info.imageExtent.height = parent_surface_ptr->get_height(); create_info.imageExtent.width = parent_surface_ptr->get_width (); - create_info.imageFormat = static_cast(m_create_info_ptr->get_format() ); + create_info.imageFormat = static_cast (m_create_info_ptr->get_format() ); create_info.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE; create_info.imageUsage = m_create_info_ptr->get_usage_flags().get_vk(); - create_info.minImageCount = m_create_info_ptr->get_n_images(); - create_info.oldSwapchain = VK_NULL_HANDLE; + create_info.minImageCount = m_create_info_ptr->get_n_images (); + create_info.oldSwapchain = (old_swapchain_ptr != nullptr) ? old_swapchain_ptr->get_swapchain_vk() + : VK_NULL_HANDLE; create_info.pNext = nullptr; create_info.pQueueFamilyIndices = nullptr; create_info.presentMode = static_cast (m_create_info_ptr->get_present_mode() ); From a9d8e2268f871ade084216b891dd20ab46577c35 Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Fri, 8 Mar 2019 08:27:01 +0100 Subject: [PATCH 44/50] Added mGPU support to OutOfOrderRasterization example application Add support for VK 1.1 devices Add support for VK_AMD_memory_overallocation_behavor Add support for VK_EXT_conservative_rasterization Add support for VK_EXT_depth_clip_enable Add support for VK_EXT_global_priority Add support for VK_EXT_inline_uniform_block Add support for VK_EXT_memory_budget Add support for VK_EXT_memory_priority Add support for VK_EXT_queue_family_foreign Add support for VK_EXT_scalar_block_layout Add support for VK_EXT_separate_stencil_usage Add support for VK_GOOGLE_decorate_string Add support for VK_GOOGLE_hlsl_functionality1 Add support for VK_KHR_depth_stencil_resolve Add support for VK_KHR_driver_properties Add support for VK_KHR_sampler_ycbcr_conversion Add support for VK_KHR_shader_atomic_int64 Add support for VK_KHR_shader_flo16_int8 Add support for VK_KHR_shader_float_controls Add support for VK_KHR_swapchain_mutable_format Add support for VK_KHR_vulkan_memory_model Add support for VK_KHR_win32_keyed_mutex Bump glslang to 7.11.3113 Bump VK headers to public v101 Heavy refactoring of existing infrastructure. --- CMakeLists.txt | 18 +- README.md | 78 +- deps/glslang/Android.mk | 100 + deps/glslang/BUILD.gn | 34 +- deps/glslang/CMakeLists.txt | 10 +- deps/glslang/LICENSE.txt | 108 + deps/glslang/README.md | 3 + deps/glslang/SPIRV/GLSL.ext.EXT.h | 3 +- deps/glslang/SPIRV/GLSL.ext.KHR.h | 1 + deps/glslang/SPIRV/GlslangToSpv.cpp | 246 +- deps/glslang/SPIRV/GlslangToSpv.h | 1 + deps/glslang/SPIRV/SpvBuilder.cpp | 171 +- deps/glslang/SPIRV/SpvBuilder.h | 71 +- deps/glslang/SPIRV/SpvPostProcess.cpp | 129 +- deps/glslang/SPIRV/SpvTools.cpp | 12 +- deps/glslang/SPIRV/disassemble.cpp | 8 + deps/glslang/SPIRV/doc.cpp | 18 +- deps/glslang/SPIRV/spirv.hpp | 31 +- deps/glslang/SPIRV/spvIR.h | 7 + deps/glslang/StandAlone/ResourceLimits.h | 2 +- deps/glslang/StandAlone/StandAlone.cpp | 6 + deps/glslang/Test/300samplerExternalYUV.frag | 38 + .../hlsl.aliasOpaque.frag.out | 2 + .../hlsl.flattenOpaque.frag.out | 4 + .../hlsl.flattenOpaqueInit.vert.out | 2 + .../hlsl.flattenOpaqueInitMix.vert.out | 2 + .../hlsl.flattenSubset.frag.out | 2 + deps/glslang/Test/baseResults/120.frag.out | 4 +- deps/glslang/Test/baseResults/300.vert.out | 2 +- .../300samplerExternalYUV.frag.out | 192 + deps/glslang/Test/baseResults/310.vert.out | 2 +- deps/glslang/Test/baseResults/420.vert.out | 2 +- deps/glslang/Test/baseResults/430.vert.out | 6 +- deps/glslang/Test/baseResults/440.frag.out | 12 +- deps/glslang/Test/baseResults/440.vert.out | 8 +- .../constantUnaryConversion.comp.out | 645 ++ .../Test/baseResults/findFunction.frag.out | 4 +- .../Test/baseResults/hlsl.PointSize.geom.out | 5 +- .../baseResults/hlsl.aliasOpaque.frag.out | 3 + .../Test/baseResults/hlsl.amend.frag.out | 1 + .../baseResults/hlsl.array.flatten.frag.out | 7 + .../Test/baseResults/hlsl.array.frag.out | 1 + .../baseResults/hlsl.array.multidim.frag.out | 1 + .../hlsl.attribute.expression.comp.out | 1 + .../baseResults/hlsl.attributeC11.frag.out | 6 +- .../Test/baseResults/hlsl.buffer.frag.out | 9 +- .../hlsl.calculatelod.dx10.frag.out | 8 + .../hlsl.calculatelodunclamped.dx10.frag.out | 8 + .../baseResults/hlsl.comparison.vec.frag.out | 1 + .../baseResults/hlsl.conditional.frag.out | 1 + .../baseResults/hlsl.constantbuffer.frag.out | 8 +- .../baseResults/hlsl.constructimat.frag.out | 5 +- .../Test/baseResults/hlsl.coverage.frag.out | 5 +- .../Test/baseResults/hlsl.dashI.vert.out | 1 + .../hlsl.earlydepthstencil.frag.out | 189 + .../hlsl.emptystructreturn.frag.out | 5 +- .../hlsl.emptystructreturn.vert.out | 5 +- .../baseResults/hlsl.entry.rename.frag.out | 1 + .../hlsl.explicitDescriptorSet-2.frag.out | 2 + .../hlsl.explicitDescriptorSet.frag.out | 2 + .../baseResults/hlsl.flattenOpaque.frag.out | 4 + .../hlsl.flattenOpaqueInit.vert.out | 2 + .../hlsl.flattenOpaqueInitMix.vert.out | 2 + .../baseResults/hlsl.flattenSubset.frag.out | 2 + .../baseResults/hlsl.flattenSubset2.frag.out | 1 + .../Test/baseResults/hlsl.float4.frag.out | 1 + .../hlsl.gather.array.dx10.frag.out | 8 + .../hlsl.gather.basic.dx10.frag.out | 12 + .../hlsl.gather.basic.dx10.vert.out | 12 + .../hlsl.gather.offset.dx10.frag.out | 11 + .../hlsl.gather.offsetarray.dx10.frag.out | 5 + .../hlsl.gatherRGBA.array.dx10.frag.out | 10 + .../hlsl.gatherRGBA.basic.dx10.frag.out | 13 + .../hlsl.gatherRGBA.offset.dx10.frag.out | 18 +- .../hlsl.gatherRGBA.offsetarray.dx10.frag.out | 15 +- .../hlsl.gathercmpRGBA.offset.dx10.frag.out | 12 + .../hlsl.getdimensions.dx10.frag.out | 26 + .../hlsl.getdimensions.rw.dx10.frag.out | 18 + .../hlsl.getsampleposition.dx10.frag.out | 2 + .../hlsl.global-const-init.frag.out | 1 + .../Test/baseResults/hlsl.groupid.comp.out | 1 + .../Test/baseResults/hlsl.hlslOffset.vert.out | 1 + .../baseResults/hlsl.implicitBool.frag.out | 1 + .../Test/baseResults/hlsl.include.vert.out | 1 + .../Test/baseResults/hlsl.init.frag.out | 1 + .../Test/baseResults/hlsl.int.dot.frag.out | 339 + .../Test/baseResults/hlsl.intrinsics.comp.out | 5 +- .../hlsl.intrinsics.d3dcolortoubyte4.frag.out | 1 + .../hlsl.intrinsics.evalfns.frag.out | 5 +- .../Test/baseResults/hlsl.intrinsics.frag.out | 5 +- .../hlsl.intrinsics.promote.down.frag.out | 1 + .../hlsl.intrinsics.promote.frag.out | 3 + .../hlsl.intrinsics.promote.outputs.frag.out | 3 + .../Test/baseResults/hlsl.intrinsics.vert.out | 5 +- .../Test/baseResults/hlsl.isfinite.frag.out | 1 + .../Test/baseResults/hlsl.layout.frag.out | 1 + .../baseResults/hlsl.layoutOverride.vert.out | 1 + .../baseResults/hlsl.load.2dms.dx10.frag.out | 7 + .../baseResults/hlsl.load.array.dx10.frag.out | 21 + .../baseResults/hlsl.load.basic.dx10.frag.out | 21 + .../baseResults/hlsl.load.basic.dx10.vert.out | 21 + .../hlsl.load.buffer.dx10.frag.out | 4 + .../hlsl.load.buffer.float.dx10.frag.out | 4 + .../hlsl.load.offset.dx10.frag.out | 21 + .../hlsl.load.offsetarray.dx10.frag.out | 21 + .../hlsl.load.rwbuffer.dx10.frag.out | 4 + .../hlsl.load.rwtexture.array.dx10.frag.out | 15 + .../hlsl.load.rwtexture.dx10.frag.out | 15 + .../baseResults/hlsl.logical.binary.frag.out | 1 + .../hlsl.logical.binary.vec.frag.out | 1 + .../baseResults/hlsl.logical.unary.frag.out | 1 + .../Test/baseResults/hlsl.matNx1.frag.out | 5 +- .../baseResults/hlsl.matType.bool.frag.out | 5 +- .../Test/baseResults/hlsl.matType.frag.out | 6 +- .../baseResults/hlsl.matType.int.frag.out | 5 +- .../Test/baseResults/hlsl.matpack-1.frag.out | 1 + .../baseResults/hlsl.matpack-pragma.frag.out | 1 + .../baseResults/hlsl.matrixSwizzle.vert.out | 6 +- .../baseResults/hlsl.matrixindex.frag.out | 1 + .../Test/baseResults/hlsl.mintypes.frag.out | 1 + .../baseResults/hlsl.mip.operator.frag.out | 2 + .../baseResults/hlsl.mul-truncate.frag.out | 1 + .../Test/baseResults/hlsl.multiEntry.vert.out | 1 + .../baseResults/hlsl.multiReturn.frag.out | 1 + .../Test/baseResults/hlsl.namespace.frag.out | 5 +- .../hlsl.noSemantic.functionality1.comp.out | 1 + .../baseResults/hlsl.params.default.frag.out | 1 + .../hlsl.partialFlattenLocal.vert.out | 1 + .../hlsl.partialFlattenMixed.vert.out | 2 + .../baseResults/hlsl.partialInit.frag.out | 5 +- .../Test/baseResults/hlsl.pp.line2.frag.out | 185 + .../Test/baseResults/hlsl.pp.line3.frag.out | 176 + .../Test/baseResults/hlsl.pp.line4.frag.out | 146 + .../glslang/Test/baseResults/hlsl.pp.vert.out | 1 + .../baseResults/hlsl.preprocessor.frag.out | 2 + .../baseResults/hlsl.promote.atomic.frag.out | 1 + .../baseResults/hlsl.promote.binary.frag.out | 1 + .../Test/baseResults/hlsl.promotions.frag.out | 1 + .../Test/baseResults/hlsl.reflection.vert.out | 70 +- .../Test/baseResults/hlsl.rw.atomics.frag.out | 20 + .../Test/baseResults/hlsl.rw.bracket.frag.out | 15 + .../hlsl.rw.scalar.bracket.frag.out | 16 + .../Test/baseResults/hlsl.rw.swizzle.frag.out | 2 + .../baseResults/hlsl.rw.vec2.bracket.frag.out | 16 + .../hlsl.sample.array.dx10.frag.out | 8 + .../hlsl.sample.basic.dx10.frag.out | 13 + .../Test/baseResults/hlsl.sample.dx9.frag.out | 592 ++ .../Test/baseResults/hlsl.sample.dx9.vert.out | 261 + .../hlsl.sample.offset.dx10.frag.out | 11 + .../hlsl.sample.offsetarray.dx10.frag.out | 5 + .../hlsl.sample.sub-vec4.dx10.frag.out | 4 + .../hlsl.samplebias.array.dx10.frag.out | 8 + .../hlsl.samplebias.basic.dx10.frag.out | 11 + .../hlsl.samplebias.offset.dx10.frag.out | 16 +- .../hlsl.samplebias.offsetarray.dx10.frag.out | 10 +- .../hlsl.samplecmp.array.dx10.frag.out | 25 +- .../hlsl.samplecmp.basic.dx10.frag.out | 25 +- .../hlsl.samplecmp.offset.dx10.frag.out | 25 +- .../hlsl.samplecmp.offsetarray.dx10.frag.out | 25 +- ...lsl.samplecmplevelzero.array.dx10.frag.out | 25 +- ...lsl.samplecmplevelzero.basic.dx10.frag.out | 25 +- ...sl.samplecmplevelzero.offset.dx10.frag.out | 25 +- ...mplecmplevelzero.offsetarray.dx10.frag.out | 25 +- .../hlsl.samplegrad.array.dx10.frag.out | 8 + .../hlsl.samplegrad.basic.dx10.frag.out | 11 + .../hlsl.samplegrad.basic.dx10.vert.out | 11 + .../hlsl.samplegrad.offset.dx10.frag.out | 11 + .../hlsl.samplegrad.offsetarray.dx10.frag.out | 8 + .../hlsl.samplelevel.array.dx10.frag.out | 8 + .../hlsl.samplelevel.basic.dx10.frag.out | 12 + .../hlsl.samplelevel.basic.dx10.vert.out | 11 + .../hlsl.samplelevel.offset.dx10.frag.out | 11 + ...hlsl.samplelevel.offsetarray.dx10.frag.out | 5 + .../Test/baseResults/hlsl.semantic.geom.out | 5 +- .../Test/baseResults/hlsl.snorm.uav.comp.out | 1 + ...sl.store.rwbyteaddressbuffer.type.comp.out | 1 + .../baseResults/hlsl.stringtoken.frag.out | 2 + .../Test/baseResults/hlsl.struct.frag.out | 6 +- .../hlsl.struct.split.assign.frag.out | 5 +- .../baseResults/hlsl.structIoFourWay.frag.out | 2 + .../hlsl.structarray.flatten.frag.out | 22 +- .../hlsl.structbuffer.append.fn.frag.out | 12 +- .../hlsl.structbuffer.append.frag.out | 5 + .../hlsl.structbuffer.atomics.frag.out | 6 +- .../hlsl.structbuffer.byte.frag.out | 59 +- .../hlsl.structbuffer.coherent.frag.out | 8 +- .../hlsl.structbuffer.floatidx.comp.out | 3 + .../baseResults/hlsl.structbuffer.fn.frag.out | 8 +- .../hlsl.structbuffer.fn2.comp.out | 1 + .../baseResults/hlsl.structbuffer.frag.out | 7 +- ...hlsl.structbuffer.incdec.frag.hlslfun1.out | 5 + .../hlsl.structbuffer.incdec.frag.out | 5 + .../baseResults/hlsl.structbuffer.rw.frag.out | 8 +- .../hlsl.structbuffer.rwbyte.frag.out | 181 +- .../Test/baseResults/hlsl.subpass.frag.out | 24 + .../baseResults/hlsl.texture.struct.frag.out | 12 +- .../baseResults/hlsl.texture.subvec4.frag.out | 9 + .../baseResults/hlsl.texturebuffer.frag.out | 1 + .../hlsl.tristream-append.geom.out | 5 +- .../Test/baseResults/hlsl.tx.bracket.frag.out | 15 + .../baseResults/hlsl.tx.overload.frag.out | 4 + .../baseResults/hlsl.typeGraphCopy.vert.out | 1 + .../baseResults/hlsl.wavebroadcast.comp.out | 1 + .../Test/baseResults/hlsl.waveprefix.comp.out | 1 + .../Test/baseResults/hlsl.wavequad.comp.out | 1 + .../Test/baseResults/hlsl.wavequery.comp.out | 1 + .../baseResults/hlsl.wavereduction.comp.out | 1 + .../Test/baseResults/hlsl.wavevote.comp.out | 1 + .../Test/baseResults/hlsl.y-negate-1.vert.out | 1 + .../Test/baseResults/hlsl.y-negate-2.vert.out | 1 + .../Test/baseResults/hlsl.y-negate-3.vert.out | 1 + .../Test/baseResults/link1.vk.frag.out | 2 + .../Test/baseResults/reflection.vert.out | 11 + ...emap.hlsl.sample.basic.everything.frag.out | 11 + .../remap.hlsl.sample.basic.none.frag.out | 13 + .../remap.hlsl.sample.basic.strip.frag.out | 13 + .../remap.uniformarray.none.frag.out | 1 + .../glslang/Test/baseResults/spv.130.frag.out | 19 +- .../glslang/Test/baseResults/spv.140.frag.out | 10 +- .../glslang/Test/baseResults/spv.150.geom.out | 7 - .../glslang/Test/baseResults/spv.150.vert.out | 1 + .../baseResults/spv.16bitstorage-int.frag.out | 22 +- .../spv.16bitstorage-uint.frag.out | 17 +- .../baseResults/spv.16bitstorage.frag.out | 20 +- .../spv.16bitstorage_Error-int.frag.out | 80 +- .../spv.16bitstorage_Error-uint.frag.out | 80 +- .../spv.16bitstorage_Error.frag.out | 88 +- .../Test/baseResults/spv.16bitxfb.vert.out | 120 + .../Test/baseResults/spv.300layout.vert.out | 3 + .../Test/baseResults/spv.300layoutp.vert.out | 3 + .../glslang/Test/baseResults/spv.310.comp.out | 42 +- .../glslang/Test/baseResults/spv.400.frag.out | 9 +- .../glslang/Test/baseResults/spv.420.geom.out | 6 +- .../baseResults/spv.8bitstorage-int.frag.out | 22 +- .../baseResults/spv.8bitstorage-uint.frag.out | 17 +- .../spv.8bitstorage_Error-int.frag.out | 80 +- .../spv.8bitstorage_Error-uint.frag.out | 80 +- .../Test/baseResults/spv.AofA.frag.out | 6 +- .../baseResults/spv.RayGenShader.rgen.out | 16 +- .../baseResults/spv.RayGenShader11.rgen.out | 101 + .../Test/baseResults/spv.aggOps.frag.out | 3 + .../Test/baseResults/spv.bool.vert.out | 1 + .../baseResults/spv.bufferhandle1.frag.out | 104 + .../baseResults/spv.bufferhandle10.frag.out | 73 + .../baseResults/spv.bufferhandle11.frag.out | 118 + .../baseResults/spv.bufferhandle12.frag.out | 306 + .../baseResults/spv.bufferhandle13.frag.out | 116 + .../baseResults/spv.bufferhandle14.frag.out | 109 + .../baseResults/spv.bufferhandle15.frag.out | 130 + .../baseResults/spv.bufferhandle2.frag.out | 94 + .../baseResults/spv.bufferhandle3.frag.out | 105 + .../baseResults/spv.bufferhandle4.frag.out | 118 + .../baseResults/spv.bufferhandle5.frag.out | 52 + .../baseResults/spv.bufferhandle6.frag.out | 238 + .../baseResults/spv.bufferhandle7.frag.out | 77 + .../baseResults/spv.bufferhandle8.frag.out | 89 + .../baseResults/spv.bufferhandle9.frag.out | 114 + .../spv.bufferhandle_Error.frag.out | 25 + .../Test/baseResults/spv.builtInXFB.vert.out | 4 - .../spv.computeShaderDerivatives.comp.out | 1 + .../spv.computeShaderDerivatives2.comp.out | 1 + .../spv.conditionalDiscard.frag.out | 1 + .../spv.controlFlowAttributes.frag.out | 3 +- .../baseResults/spv.dataOutIndirect.frag.out | 1 + .../baseResults/spv.debugInfo.1.1.frag.out | 3 + .../Test/baseResults/spv.deepRvalue.frag.out | 1 + .../Test/baseResults/spv.double.comp.out | 2 + .../baseResults/spv.explicittypes.frag.out | 20 +- .../Test/baseResults/spv.float16.frag.out | 7 +- .../baseResults/spv.float16Fetch.frag.out | 5 +- .../Test/baseResults/spv.float32.frag.out | 21 +- .../Test/baseResults/spv.float64.frag.out | 22 +- .../spv.fragmentDensity-es.frag.out | 45 + .../spv.fragmentDensity-neg.frag.out | 7 + .../baseResults/spv.fragmentDensity.frag.out | 48 + .../baseResults/spv.fragmentDensity.vert.out | 9 + .../spv.functionNestedOpaque.vert.out | 6 +- .../spv.glsl.register.autoassign.frag.out | 3 + .../Test/baseResults/spv.hlslOffsets.vert.out | 1 + .../Test/baseResults/spv.image.frag.out | 5 +- .../spv.imageLoadStoreLod.frag.out | 5 +- .../Test/baseResults/spv.int16.amd.frag.out | 4 - .../Test/baseResults/spv.int16.frag.out | 20 +- .../Test/baseResults/spv.int32.frag.out | 20 +- .../Test/baseResults/spv.int64.frag.out | 7 +- .../Test/baseResults/spv.int8.frag.out | 20 +- .../baseResults/spv.localAggregates.frag.out | 1 + .../Test/baseResults/spv.matFun.vert.out | 1 + .../baseResults/spv.memoryQualifier.frag.out | 6 +- .../spv.memoryScopeSemantics.comp.out | 131 +- .../spv.meshShaderSharedMem.mesh.out | 2 + .../spv.meshShaderTaskMem.mesh.out | 1 + .../baseResults/spv.meshTaskShader.task.out | 283 +- .../spv.multiStructFuncall.frag.out | 1 + .../spv.multiviewPerViewAttributes.tesc.out | 5 +- .../Test/baseResults/spv.newTexture.frag.out | 23 +- .../Test/baseResults/spv.paramMemory.frag.out | 5 +- .../Test/baseResults/spv.pp.line.frag.out | 146 + .../spv.precisionNonESSamp.frag.out | 4 + .../Test/baseResults/spv.queryL.frag.out | 25 +- .../spv.register.autoassign.frag.out | 3 + .../spv.register.noautoassign.frag.out | 10 + .../spv.sampleMaskOverrideCoverage.frag.out | 5 +- .../baseResults/spv.scalarlayout.frag.out | 78 + .../spv.scalarlayoutfloat16.frag.out | 70 + .../Test/baseResults/spv.separate.frag.out | 43 +- .../baseResults/spv.shaderBallotAMD.comp.out | 5 +- .../spv.shaderImageFootprint.frag.out | 4 + .../Test/baseResults/spv.shadingRate.frag.out | 6 +- .../baseResults/spv.sparseTexture.frag.out | 20 +- .../spv.sparseTextureClamp.frag.out | 16 +- .../baseResults/spv.specConstant.comp.out | 1 + .../spv.stereoViewRendering.tesc.out | 5 +- .../baseResults/spv.storageBuffer.vert.out | 2 + .../baseResults/spv.structAssignment.frag.out | 1 + .../Test/baseResults/spv.structDeref.frag.out | 1 + .../Test/baseResults/spv.structure.frag.out | 1 + .../baseResults/spv.subgroupBallot.comp.out | 678 +- .../spv.subgroupBallotNeg.comp.out | 6 + .../spv.subgroupPartitioned.comp.out | 5 +- .../Test/baseResults/spv.subpass.frag.out | 6 + .../Test/baseResults/spv.test.frag.out | 2 + .../Test/baseResults/spv.texture.frag.out | 6 + .../spv.texture.sampler.transform.frag.out | 1 + .../Test/baseResults/spv.texture.vert.out | 6 + .../baseResults/spv.textureBuffer.vert.out | 5 + .../spv.textureGatherBiasLod.frag.out | 9 +- .../Test/baseResults/spv.uint.frag.out | 1 + .../baseResults/spv.uniformArray.frag.out | 1 + .../spv.variableArrayIndex.frag.out | 1 + .../baseResults/spv.varyingArray.frag.out | 1 + .../spv.varyingArrayIndirect.frag.out | 1 + .../baseResults/spv.viewportArray2.tesc.out | 5 +- .../baseResults/spv.vulkan110.int16.frag.out | 20 +- .../spv.vulkan110.storageBuffer.vert.out | 2 + .../glslang/Test/baseResults/spv.xfb.vert.out | 4 - .../Test/baseResults/spv.xfb2.vert.out | 4 - .../Test/baseResults/spv.xfb3.vert.out | 4 - ...xfbOffsetOnBlockMembersAssignment.vert.out | 76 + ...fbOffsetOnStructMembersAssignment.vert.out | 6 +- ...rlapOffsetCheckWithBlockAndMember.vert.out | 88 + .../spv.xfbStrideJustOnce.vert.out | 74 + .../Test/baseResults/stringToDouble.vert.out | 4 +- .../glslang/Test/constantUnaryConversion.comp | 48 + deps/glslang/Test/findFunction.frag | 2 +- deps/glslang/Test/hlsl.earlydepthstencil.frag | 12 + deps/glslang/Test/hlsl.int.dot.frag | 14 + deps/glslang/Test/hlsl.pp.line2.frag | 40 + deps/glslang/Test/hlsl.pp.line3.frag | 34 + deps/glslang/Test/hlsl.pp.line4.frag | 42 + deps/glslang/Test/hlsl.sample.dx9.frag | 36 + deps/glslang/Test/hlsl.sample.dx9.vert | 22 + deps/glslang/Test/i1.h | 1 + deps/glslang/Test/reflection.vert | 13 + deps/glslang/Test/remap.invalid-spirv-1.spv | Bin 0 -> 219 bytes deps/glslang/Test/remap.invalid-spirv-2.spv | Bin 0 -> 212 bytes .../Test/remap.literal64.everything.spv | Bin 0 -> 220 bytes deps/glslang/Test/remap.literal64.none.spv | Bin 0 -> 220 bytes deps/glslang/Test/runtests | 2 + deps/glslang/Test/spv.16bitxfb.vert | 33 + deps/glslang/Test/spv.RayGenShader.rgen | 5 +- deps/glslang/Test/spv.RayGenShader11.rgen | 19 + deps/glslang/Test/spv.bufferhandle1.frag | 28 + deps/glslang/Test/spv.bufferhandle10.frag | 23 + deps/glslang/Test/spv.bufferhandle11.frag | 26 + deps/glslang/Test/spv.bufferhandle12.frag | 42 + deps/glslang/Test/spv.bufferhandle13.frag | 30 + deps/glslang/Test/spv.bufferhandle14.frag | 40 + deps/glslang/Test/spv.bufferhandle15.frag | 38 + deps/glslang/Test/spv.bufferhandle2.frag | 25 + deps/glslang/Test/spv.bufferhandle3.frag | 25 + deps/glslang/Test/spv.bufferhandle4.frag | 26 + deps/glslang/Test/spv.bufferhandle5.frag | 16 + deps/glslang/Test/spv.bufferhandle6.frag | 30 + deps/glslang/Test/spv.bufferhandle7.frag | 24 + deps/glslang/Test/spv.bufferhandle8.frag | 32 + deps/glslang/Test/spv.bufferhandle9.frag | 30 + deps/glslang/Test/spv.bufferhandle_Error.frag | 45 + deps/glslang/Test/spv.explicittypes.frag | 16 +- deps/glslang/Test/spv.float32.frag | 16 +- deps/glslang/Test/spv.float64.frag | 16 +- deps/glslang/Test/spv.fragmentDensity-es.frag | 11 + .../glslang/Test/spv.fragmentDensity-neg.frag | 12 + deps/glslang/Test/spv.fragmentDensity.frag | 11 + deps/glslang/Test/spv.fragmentDensity.vert | 12 + deps/glslang/Test/spv.int16.frag | 16 +- deps/glslang/Test/spv.int32.frag | 16 +- deps/glslang/Test/spv.int64.frag | 2 +- deps/glslang/Test/spv.int8.frag | 16 +- deps/glslang/Test/spv.meshTaskShader.task | 5 + deps/glslang/Test/spv.pp.line.frag | 25 + deps/glslang/Test/spv.scalarlayout.frag | 32 + .../glslang/Test/spv.scalarlayoutfloat16.frag | 31 + deps/glslang/Test/spv.subgroupBallot.comp | 48 +- deps/glslang/Test/spv.subgroupBallotNeg.comp | 33 + deps/glslang/Test/spv.vulkan110.int16.frag | 16 +- ...spv.xfbOffsetOnBlockMembersAssignment.vert | 13 + ...bOverlapOffsetCheckWithBlockAndMember.vert | 19 + deps/glslang/Test/spv.xfbStrideJustOnce.vert | 14 + deps/glslang/Test/stringToDouble.vert | 2 +- deps/glslang/glslang/Include/BaseTypes.h | 8 + deps/glslang/glslang/Include/Common.h | 21 +- deps/glslang/glslang/Include/Types.h | 148 +- deps/glslang/glslang/Include/intermediate.h | 5 + deps/glslang/glslang/Include/revision.h | 2 +- .../glslang/MachineIndependent/Constant.cpp | 274 + .../glslang/MachineIndependent/Initialize.cpp | 126 +- .../MachineIndependent/Intermediate.cpp | 59 +- .../MachineIndependent/ParseHelper.cpp | 367 +- .../glslang/MachineIndependent/ParseHelper.h | 3 +- .../glslang/MachineIndependent/Scan.cpp | 52 +- .../glslang/glslang/MachineIndependent/Scan.h | 12 +- .../glslang/MachineIndependent/ScanContext.h | 3 +- .../glslang/MachineIndependent/ShaderLang.cpp | 11 +- .../MachineIndependent/SymbolTable.cpp | 34 +- .../glslang/MachineIndependent/SymbolTable.h | 104 +- .../glslang/MachineIndependent/Versions.cpp | 105 +- .../glslang/MachineIndependent/Versions.h | 23 +- .../glslang/MachineIndependent/glslang.y | 8 + .../MachineIndependent/glslang_tab.cpp | 6498 +++++++++-------- .../MachineIndependent/glslang_tab.cpp.h | 379 +- .../glslang/MachineIndependent/intermOut.cpp | 13 +- .../MachineIndependent/linkValidate.cpp | 209 +- .../MachineIndependent/localintermediate.h | 74 +- .../MachineIndependent/parseVersions.h | 3 +- .../MachineIndependent/preprocessor/Pp.cpp | 5 +- .../preprocessor/PpContext.cpp | 1 + .../preprocessor/PpContext.h | 11 +- .../preprocessor/PpScanner.cpp | 10 +- .../preprocessor/PpTokens.cpp | 2 + .../glslang/MachineIndependent/reflection.cpp | 134 +- .../glslang/MachineIndependent/reflection.h | 9 +- .../glslang/OSDependent/Unix/CMakeLists.txt | 17 + .../glslang/OSDependent/Unix/ossource.cpp | 5 +- deps/glslang/glslang/Public/ShaderLang.h | 9 +- deps/glslang/gtests/AST.FromFile.cpp | 2 + deps/glslang/gtests/Config.FromFile.cpp | 3 +- deps/glslang/gtests/HexFloat.cpp | 38 +- deps/glslang/gtests/Hlsl.FromFile.cpp | 65 +- deps/glslang/gtests/Link.FromFile.Vk.cpp | 12 +- deps/glslang/gtests/Link.FromFile.cpp | 3 +- deps/glslang/gtests/Spv.FromFile.cpp | 53 +- deps/glslang/gtests/TestFixture.h | 122 +- deps/glslang/hlsl/hlslGrammar.cpp | 53 +- deps/glslang/hlsl/hlslGrammar.h | 3 +- deps/glslang/hlsl/hlslParseHelper.cpp | 105 +- deps/glslang/hlsl/hlslParseHelper.h | 2 +- deps/glslang/hlsl/hlslParseables.cpp | 14 +- deps/glslang/known_good.json | 4 +- deps/glslang/ndk_test/Android.mk | 12 + deps/glslang/ndk_test/jni/Application.mk | 5 + deps/glslang/ndk_test/test.cpp | 19 + examples/DynamicBuffers/CMakeLists.txt | 3 +- examples/DynamicBuffers/src/app.cpp | 31 +- examples/MultiViewport/CMakeLists.txt | 3 +- examples/MultiViewport/src/app.cpp | 29 +- examples/OcclusionQuery/CMakeLists.txt | 5 +- examples/OcclusionQuery/src/app.cpp | 29 +- .../OutOfOrderRasterization/CMakeLists.txt | 6 +- .../OutOfOrderRasterization/include/app.h | 33 +- examples/OutOfOrderRasterization/src/app.cpp | 1071 ++- examples/PushConstants/CMakeLists.txt | 5 +- examples/PushConstants/src/app.cpp | 29 +- include/config.h.in | 2 +- include/misc/descriptor_pool_create_info.h | 146 + include/misc/descriptor_set_create_info.h | 7 +- include/misc/device_create_info.h | 276 + include/misc/extensions.h | 231 +- include/misc/formats.h | 139 +- include/misc/glsl_to_spirv.h | 8 +- include/misc/graphics_pipeline_create_info.h | 47 +- include/misc/image_create_info.h | 45 +- include/misc/image_view_create_info.h | 64 +- include/misc/instance_create_info.h | 41 + include/misc/io.h | 1 + .../misc/memalloc_backends/backend_oneshot.h | 1 + include/misc/memalloc_backends/backend_vma.h | 1 + include/misc/memory_allocator.h | 74 +- include/misc/memory_block_create_info.h | 44 + include/misc/object_tracker.h | 1 - include/misc/render_pass_create_info.h | 79 +- include/misc/rendering_surface_create_info.h | 99 + include/misc/sampler_create_info.h | 55 +- .../sampler_ycbcr_conversion_create_info.h | 183 + include/misc/semaphore_create_info.h | 4 +- include/misc/swapchain_create_info.h | 29 +- include/misc/types.h | 10 + include/misc/types_classes.h | 20 +- include/misc/types_enums.h | 203 +- include/misc/types_struct.h | 620 +- include/misc/vulkan.h | 33 + include/vulkan/vulkan_core.h | 137 +- include/vulkan/vulkan_mir.h | 65 + include/wrappers/buffer.h | 8 - include/wrappers/command_buffer.h | 42 +- include/wrappers/command_pool.h | 68 +- include/wrappers/descriptor_pool.h | 42 +- include/wrappers/descriptor_set.h | 174 +- include/wrappers/descriptor_set_group.h | 58 +- include/wrappers/device.h | 113 +- include/wrappers/image.h | 155 +- include/wrappers/instance.h | 15 +- include/wrappers/memory_block.h | 21 +- include/wrappers/physical_device.h | 30 +- include/wrappers/queue.h | 55 +- include/wrappers/rendering_surface.h | 64 +- include/wrappers/sampler_ycbcr_conversion.h | 74 + include/wrappers/swapchain.h | 16 +- src/misc/descriptor_pool_create_info.cpp | 54 + src/misc/descriptor_set_create_info.cpp | 5 + src/misc/device_create_info.cpp | 92 + src/misc/formats.cpp | 967 ++- src/misc/glsl_to_spirv.cpp | 65 +- src/misc/graphics_pipeline_create_info.cpp | 58 +- src/misc/image_view_create_info.cpp | 23 +- src/misc/instance_create_info.cpp | 7 +- .../memalloc_backends/backend_oneshot.cpp | 125 +- src/misc/memalloc_backends/backend_vma.cpp | 8 + src/misc/memory_allocator.cpp | 306 +- src/misc/memory_block_create_info.cpp | 63 + src/misc/render_pass_create_info.cpp | 114 +- src/misc/rendering_surface_create_info.cpp | 58 + src/misc/sampler_create_info.cpp | 1 + .../sampler_ycbcr_conversion_create_info.cpp | 77 + src/misc/semaphore_create_info.cpp | 4 +- src/misc/swapchain_create_info.cpp | 14 + src/misc/types.cpp | 1 + src/misc/types_classes.cpp | 18 +- src/misc/types_struct.cpp | 1606 +++- src/misc/types_utils.cpp | 16 +- src/misc/vulkan.cpp | 59 + src/wrappers/buffer.cpp | 11 +- src/wrappers/command_buffer.cpp | 126 +- src/wrappers/command_pool.cpp | 43 +- src/wrappers/descriptor_pool.cpp | 128 +- src/wrappers/descriptor_set.cpp | 307 +- src/wrappers/descriptor_set_group.cpp | 105 +- src/wrappers/device.cpp | 1207 +-- src/wrappers/graphics_pipeline_manager.cpp | 39 + src/wrappers/image.cpp | 1687 ++--- src/wrappers/image_view.cpp | 43 +- src/wrappers/instance.cpp | 396 +- src/wrappers/memory_block.cpp | 45 +- src/wrappers/physical_device.cpp | 642 +- src/wrappers/query_pool.cpp | 5 +- src/wrappers/queue.cpp | 129 +- src/wrappers/render_pass.cpp | 95 +- src/wrappers/rendering_surface.cpp | 106 +- src/wrappers/sampler.cpp | 17 +- src/wrappers/sampler_ycbcr_conversion.cpp | 105 + src/wrappers/semaphore.cpp | 1 - src/wrappers/swapchain.cpp | 38 +- 552 files changed, 25566 insertions(+), 9059 deletions(-) create mode 100644 deps/glslang/Android.mk create mode 100644 deps/glslang/LICENSE.txt create mode 100644 deps/glslang/Test/300samplerExternalYUV.frag create mode 100644 deps/glslang/Test/baseResults/300samplerExternalYUV.frag.out create mode 100644 deps/glslang/Test/baseResults/constantUnaryConversion.comp.out create mode 100644 deps/glslang/Test/baseResults/hlsl.earlydepthstencil.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.int.dot.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.pp.line2.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.pp.line3.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.pp.line4.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.sample.dx9.frag.out create mode 100644 deps/glslang/Test/baseResults/hlsl.sample.dx9.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.16bitxfb.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.RayGenShader11.rgen.out create mode 100644 deps/glslang/Test/baseResults/spv.bufferhandle1.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.bufferhandle10.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.bufferhandle11.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.bufferhandle12.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.bufferhandle13.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.bufferhandle14.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.bufferhandle15.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.bufferhandle2.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.bufferhandle3.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.bufferhandle4.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.bufferhandle5.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.bufferhandle6.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.bufferhandle7.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.bufferhandle8.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.bufferhandle9.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.bufferhandle_Error.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.fragmentDensity-es.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.fragmentDensity-neg.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.fragmentDensity.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.fragmentDensity.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.pp.line.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.scalarlayout.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.scalarlayoutfloat16.frag.out create mode 100644 deps/glslang/Test/baseResults/spv.subgroupBallotNeg.comp.out create mode 100644 deps/glslang/Test/baseResults/spv.xfbOffsetOnBlockMembersAssignment.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.xfbOverlapOffsetCheckWithBlockAndMember.vert.out create mode 100644 deps/glslang/Test/baseResults/spv.xfbStrideJustOnce.vert.out create mode 100644 deps/glslang/Test/constantUnaryConversion.comp create mode 100644 deps/glslang/Test/hlsl.earlydepthstencil.frag create mode 100644 deps/glslang/Test/hlsl.int.dot.frag create mode 100644 deps/glslang/Test/hlsl.pp.line2.frag create mode 100644 deps/glslang/Test/hlsl.pp.line3.frag create mode 100644 deps/glslang/Test/hlsl.pp.line4.frag create mode 100644 deps/glslang/Test/hlsl.sample.dx9.frag create mode 100644 deps/glslang/Test/hlsl.sample.dx9.vert create mode 100644 deps/glslang/Test/i1.h create mode 100644 deps/glslang/Test/spv.16bitxfb.vert create mode 100644 deps/glslang/Test/spv.RayGenShader11.rgen create mode 100644 deps/glslang/Test/spv.bufferhandle1.frag create mode 100644 deps/glslang/Test/spv.bufferhandle10.frag create mode 100644 deps/glslang/Test/spv.bufferhandle11.frag create mode 100644 deps/glslang/Test/spv.bufferhandle12.frag create mode 100644 deps/glslang/Test/spv.bufferhandle13.frag create mode 100644 deps/glslang/Test/spv.bufferhandle14.frag create mode 100644 deps/glslang/Test/spv.bufferhandle15.frag create mode 100644 deps/glslang/Test/spv.bufferhandle2.frag create mode 100644 deps/glslang/Test/spv.bufferhandle3.frag create mode 100644 deps/glslang/Test/spv.bufferhandle4.frag create mode 100644 deps/glslang/Test/spv.bufferhandle5.frag create mode 100644 deps/glslang/Test/spv.bufferhandle6.frag create mode 100644 deps/glslang/Test/spv.bufferhandle7.frag create mode 100644 deps/glslang/Test/spv.bufferhandle8.frag create mode 100644 deps/glslang/Test/spv.bufferhandle9.frag create mode 100644 deps/glslang/Test/spv.bufferhandle_Error.frag create mode 100644 deps/glslang/Test/spv.fragmentDensity-es.frag create mode 100644 deps/glslang/Test/spv.fragmentDensity-neg.frag create mode 100644 deps/glslang/Test/spv.fragmentDensity.frag create mode 100644 deps/glslang/Test/spv.fragmentDensity.vert create mode 100644 deps/glslang/Test/spv.pp.line.frag create mode 100644 deps/glslang/Test/spv.scalarlayout.frag create mode 100644 deps/glslang/Test/spv.scalarlayoutfloat16.frag create mode 100644 deps/glslang/Test/spv.subgroupBallotNeg.comp create mode 100644 deps/glslang/Test/spv.xfbOffsetOnBlockMembersAssignment.vert create mode 100644 deps/glslang/Test/spv.xfbOverlapOffsetCheckWithBlockAndMember.vert create mode 100644 deps/glslang/Test/spv.xfbStrideJustOnce.vert create mode 100644 deps/glslang/ndk_test/Android.mk create mode 100644 deps/glslang/ndk_test/jni/Application.mk create mode 100644 deps/glslang/ndk_test/test.cpp create mode 100644 include/misc/descriptor_pool_create_info.h create mode 100644 include/misc/device_create_info.h create mode 100644 include/misc/rendering_surface_create_info.h create mode 100644 include/misc/sampler_ycbcr_conversion_create_info.h create mode 100644 include/vulkan/vulkan_mir.h create mode 100644 include/wrappers/sampler_ycbcr_conversion.h create mode 100644 src/misc/descriptor_pool_create_info.cpp create mode 100644 src/misc/device_create_info.cpp create mode 100644 src/misc/rendering_surface_create_info.cpp create mode 100644 src/misc/sampler_ycbcr_conversion_create_info.cpp create mode 100644 src/wrappers/sampler_ycbcr_conversion.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index fb1e08d5..49a0903b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,7 @@ if (NOT ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB) endif() # Do not modify anything after this line, unless you know what you're doing. + configure_file("include/config.h.in" "include/config.h") include_directories("${Anvil_BINARY_DIR}/include" @@ -65,7 +66,9 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/include/misc/debug.h" "${Anvil_SOURCE_DIR}/include/misc/debug_marker.h" "${Anvil_SOURCE_DIR}/include/misc/debug_messenger_create_info.h" + "${Anvil_SOURCE_DIR}/include/misc/descriptor_pool_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/descriptor_set_create_info.h" + "${Anvil_SOURCE_DIR}/include/misc/device_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/dummy_window.h" "${Anvil_SOURCE_DIR}/include/misc/event_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/extensions.h" @@ -88,7 +91,9 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/include/misc/pools.h" "${Anvil_SOURCE_DIR}/include/misc/ref_counter.h" "${Anvil_SOURCE_DIR}/include/misc/render_pass_create_info.h" + "${Anvil_SOURCE_DIR}/include/misc/rendering_surface_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/sampler_create_info.h" + "${Anvil_SOURCE_DIR}/include/misc/sampler_ycbcr_conversion_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/semaphore_create_info.h" "${Anvil_SOURCE_DIR}/include/misc/shader_module_cache.h" "${Anvil_SOURCE_DIR}/include/misc/struct_chainer.h" @@ -133,6 +138,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/include/wrappers/render_pass.h" "${Anvil_SOURCE_DIR}/include/wrappers/rendering_surface.h" "${Anvil_SOURCE_DIR}/include/wrappers/sampler.h" + "${Anvil_SOURCE_DIR}/include/wrappers/sampler_ycbcr_conversion.h" "${Anvil_SOURCE_DIR}/include/wrappers/semaphore.h" "${Anvil_SOURCE_DIR}/include/wrappers/shader_module.h" "${Anvil_SOURCE_DIR}/include/wrappers/swapchain.h" @@ -147,7 +153,9 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/src/misc/debug.cpp" "${Anvil_SOURCE_DIR}/src/misc/debug_marker.cpp" "${Anvil_SOURCE_DIR}/src/misc/debug_messenger_create_info.cpp" + "${Anvil_SOURCE_DIR}/src/misc/descriptor_pool_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/descriptor_set_create_info.cpp" + "${Anvil_SOURCE_DIR}/src/misc/device_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/dummy_window.cpp" "${Anvil_SOURCE_DIR}/src/misc/external_handle.cpp" "${Anvil_SOURCE_DIR}/src/misc/event_create_info.cpp" @@ -167,7 +175,9 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/src/misc/page_tracker.cpp" "${Anvil_SOURCE_DIR}/src/misc/pools.cpp" "${Anvil_SOURCE_DIR}/src/misc/render_pass_create_info.cpp" + "${Anvil_SOURCE_DIR}/src/misc/rendering_surface_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/sampler_create_info.cpp" + "${Anvil_SOURCE_DIR}/src/misc/sampler_ycbcr_conversion_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/semaphore_create_info.cpp" "${Anvil_SOURCE_DIR}/src/misc/shader_module_cache.cpp" "${Anvil_SOURCE_DIR}/src/misc/swapchain_create_info.cpp" @@ -209,12 +219,14 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho "${Anvil_SOURCE_DIR}/src/wrappers/render_pass.cpp" "${Anvil_SOURCE_DIR}/src/wrappers/rendering_surface.cpp" "${Anvil_SOURCE_DIR}/src/wrappers/sampler.cpp" + "${Anvil_SOURCE_DIR}/src/wrappers/sampler_ycbcr_conversion.cpp" "${Anvil_SOURCE_DIR}/src/wrappers/semaphore.cpp" "${Anvil_SOURCE_DIR}/src/wrappers/shader_module.cpp" "${Anvil_SOURCE_DIR}/src/wrappers/swapchain.cpp" # Vulkan Memory Allocator dependency "${Anvil_SOURCE_DIR}/deps/VulkanMemoryAllocator/vk_mem_alloc.h" +# <-- ) if (ANVIL_LINK_WITH_GLSLANG) @@ -231,8 +243,7 @@ if(WIN32) endif() else() if (ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT) - list (APPEND SRC_LIST - "${Anvil_SOURCE_DIR}/include/misc/xcb_loader.h" + list (APPEND SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/xcb_loader.h" "${Anvil_SOURCE_DIR}/src/misc/xcb_loader.cpp" "${Anvil_SOURCE_DIR}/include/misc/window_xcb.h" "${Anvil_SOURCE_DIR}/src/misc/window_xcb.cpp") @@ -246,7 +257,7 @@ if (WIN32) target_link_libraries(Anvil glslang OGLCompiler OSDependent SPIRV ${VULKAN_LIBRARY}) else() target_link_libraries(Anvil ${VULKAN_LIBRARY}) - endif() +endif() else() if (ANVIL_LINK_WITH_GLSLANG) target_link_libraries(Anvil glslang OGLCompiler OSDependent SPIRV ${VULKAN_LIBRARY} pthread) @@ -273,7 +284,6 @@ if (ANVIL_LINK_WITH_GLSLANG) endif() endif() - if (ANVIL_LINK_EXAMPLES) add_subdirectory("examples/DynamicBuffers") add_subdirectory("examples/MultiViewport") diff --git a/README.md b/README.md index 7d5fe61b..60a4f1e6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Anvil -This is a README file for Anvil v1.3.1, a framework for Vulkan™. +This is a README file for Anvil, a framework for Vulkan™. The README is organized as a FAQ. |Toolchain|Status| @@ -15,8 +15,9 @@ MIT. See `LICENSE.txt`. What is this? ------ -Anvil is a framework for Vulkan v1.0, which we have been using internally for -quite some time now, in order to develop various Vulkan applications. +Anvil is a framework for Vulkan v1.0 and v1.1, which we have been using internally for +quite some time now, in order to develop various Vulkan applications. This guarantees +that vast majority of the functionality exposed by the library is regularly tested. The general idea we started from was to have a cross-platform tool, which would reduce the amount of time required to write portable Vulkan-based apps from @@ -34,16 +35,10 @@ Anvil was designed with the following goals in mind: using Vulkan, without hiding the API behind thick abstraction layers. - Simplify validation layer usage. All you have to do is specify which function you would like to be called if a debug call-back is made, and that's it. -- Provide a reasonable level of deferred approach to baking objects, in order - to emulate mutability of certain Vulkan objects to a certain degree. Note - that this is an optional feature - you are free to request baking of any - object at any time, in order to ensure it will never happen at draw time. - Provide a simple cross-platform implementation for areas unrelated to Vulkan (eg. window management) - -Anvil can be thought of as a toolbox. You are free to use any of its parts you -like, and write your own code for everything else. Any Anvil wrapper for an -actual Vulkan object can be queried to retrieve the raw Vulkan handle. +- Provide a simple way (with optional flexibility) to manage memory allocations + and memory bindings. Anvil is **not** the right choice for developers who do not have a reasonable understanding of how Vulkan works. Its goal is not to provide a glBegin/glEnd-like @@ -61,8 +56,7 @@ What are Anvil's requirements? In order to build Anvil, you will need the following software: - C++11 compiler. - CMake -- Vulkan RT 1.0.39.1 or newer. -- Vulkan SDK 1.0.13.0 or newer. +- Vulkan SDK (the latest available version is highly recommended) To build Anvil on Linux, additional packages should be installed: - libxcb-keysyms (For ubuntu, use "apt-get install libxcb-keysyms1-dev") @@ -78,54 +72,9 @@ implementation and on AMDGPU-PRO Vulkan implementation on Linux. What can it do? ------ -This version of Anvil provides: - -* Low-level ref-counted wrappers for the following Vulkan v1.0 features: - - Buffer objects (sparse and non-sparse) - - Buffer views - - Command buffers - - Command pools - - Descriptor pools - - Descriptor sets - - Descriptor set layouts - - Devices - - Events - - Fences - - Framebuffers - - Image objects (sparse, sparse bindings, PRT) - - Image views - - Instances - - Physical devices - - Pipeline cache - - Pipeline layouts - - Query pools - - Queues - - Renderpasses - - Rendering surfaces - - Samplers - - Semaphores - - Shader modules - - Swapchains - -* More complicated wrappers: - - Compute / graphics pipeline managers: provide a way to create regular/derivative pipelines with automatic pipeline layout re-use. - - Descriptor set groups: simplify descriptor set configuration, management and updates. - - Memory allocator: implements a memory allocator with two back-ends: one that is more appropriate for one-shot - mem alloc requests, and one that can be used for dynamic memory allocation purposes. - - Pipeline layout manager: caches all created pipeline layouts to avoid instantiating duplicate layout instances. - -* Miscellaneous functionality: - - Debug markers: names and tags can be optionally assigned to any of the created objects. If VK_EXT_debug_marker is enabled, these - will be automatically patched through to layers that implement the extension on the running platform. - - Format info reflection: provides information about format properties. - - GLSL -> SPIR-V conversion: provides glslang-based GLSL->SPIR-V conversion. The conversion is performed in run-time. Disassembly can also be retrieved, if needed. - - GLSL -> SPIR-V conversion cache: re-uses SPIR-V blobs throughout Instance's lifetime if GLSL->SPIR-V conversion is requested for GLSL source code which has already - been converted to SPIR-V before. - - IO: provides a number of functions to simplify directory- and file-related operations. - - Object tracker: tracks object allocations and helps detect object leakage. - - Shader module cache: re-uses shader module instances across Instance lifetime. Improve execution time if your application instantiates shader modules with - exactly the same configuration during its runtime. - - Time: provides a way to query current time using high-performance system queries. +Anvil provides full support for functionality exposed in Vulkan 1.0 and Vulkan 1.1. +We also try to do our best to keep it up to date with any extensions our Vulkan implementations +expose. We are planning to keep adding new features in the future. @@ -143,12 +92,7 @@ OutOfOrderRasterization and the other example applications are located in the What are the known issues? ------ -Just a handful: -* All command queues are currently assigned a priority of 1.0. -* DescriptorSetGroup wrapper does not leverage the flag at - baking time. - -These will be addressed at some point in the future. +Please observe the "Issues" tab for more details. Who made it? ------ diff --git a/deps/glslang/Android.mk b/deps/glslang/Android.mk new file mode 100644 index 00000000..fda81a7c --- /dev/null +++ b/deps/glslang/Android.mk @@ -0,0 +1,100 @@ +LOCAL_PATH := $(call my-dir) + +GLSLANG_OS_FLAGS := -DGLSLANG_OSINCLUDE_UNIX +# AMD and NV extensions are turned on by default in upstream Glslang. +GLSLANG_DEFINES:= -DAMD_EXTENSIONS -DNV_EXTENSIONS -DENABLE_HLSL $(GLSLANG_OS_FLAGS) + +include $(CLEAR_VARS) +LOCAL_MODULE:=OSDependent +LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES) +LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH) +LOCAL_SRC_FILES:=glslang/OSDependent/Unix/ossource.cpp +LOCAL_C_INCLUDES:=$(LOCAL_PATH) $(LOCAL_PATH)/glslang/OSDependent/Unix/ +LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)/glslang/OSDependent/Unix/ +include $(BUILD_STATIC_LIBRARY) + +include $(CLEAR_VARS) +LOCAL_MODULE:=OGLCompiler +LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES) +LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH) +LOCAL_SRC_FILES:=OGLCompilersDLL/InitializeDll.cpp +LOCAL_C_INCLUDES:=$(LOCAL_PATH)/OGLCompiler +LOCAL_STATIC_LIBRARIES:=OSDependent +include $(BUILD_STATIC_LIBRARY) + +# Build Glslang's HLSL parser library. +include $(CLEAR_VARS) +LOCAL_MODULE:=HLSL +LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES) +LOCAL_SRC_FILES:= \ + hlsl/hlslAttributes.cpp \ + hlsl/hlslGrammar.cpp \ + hlsl/hlslOpMap.cpp \ + hlsl/hlslParseables.cpp \ + hlsl/hlslParseHelper.cpp \ + hlsl/hlslScanContext.cpp \ + hlsl/hlslTokenStream.cpp +LOCAL_C_INCLUDES:=$(LOCAL_PATH) \ + $(LOCAL_PATH)/hlsl +include $(BUILD_STATIC_LIBRARY) + +include $(CLEAR_VARS) +GLSLANG_OUT_PATH=$(if $(call host-path-is-absolute,$(TARGET_OUT)),$(TARGET_OUT),$(abspath $(TARGET_OUT))) + +LOCAL_MODULE:=glslang +LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES) +LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH) +LOCAL_SRC_FILES:= \ + glslang/GenericCodeGen/CodeGen.cpp \ + glslang/GenericCodeGen/Link.cpp \ + glslang/MachineIndependent/attribute.cpp \ + glslang/MachineIndependent/Constant.cpp \ + glslang/MachineIndependent/glslang_tab.cpp \ + glslang/MachineIndependent/InfoSink.cpp \ + glslang/MachineIndependent/Initialize.cpp \ + glslang/MachineIndependent/Intermediate.cpp \ + glslang/MachineIndependent/intermOut.cpp \ + glslang/MachineIndependent/IntermTraverse.cpp \ + glslang/MachineIndependent/iomapper.cpp \ + glslang/MachineIndependent/limits.cpp \ + glslang/MachineIndependent/linkValidate.cpp \ + glslang/MachineIndependent/parseConst.cpp \ + glslang/MachineIndependent/ParseContextBase.cpp \ + glslang/MachineIndependent/ParseHelper.cpp \ + glslang/MachineIndependent/PoolAlloc.cpp \ + glslang/MachineIndependent/propagateNoContraction.cpp \ + glslang/MachineIndependent/reflection.cpp \ + glslang/MachineIndependent/RemoveTree.cpp \ + glslang/MachineIndependent/Scan.cpp \ + glslang/MachineIndependent/ShaderLang.cpp \ + glslang/MachineIndependent/SymbolTable.cpp \ + glslang/MachineIndependent/Versions.cpp \ + glslang/MachineIndependent/preprocessor/PpAtom.cpp \ + glslang/MachineIndependent/preprocessor/PpContext.cpp \ + glslang/MachineIndependent/preprocessor/Pp.cpp \ + glslang/MachineIndependent/preprocessor/PpScanner.cpp \ + glslang/MachineIndependent/preprocessor/PpTokens.cpp +LOCAL_C_INCLUDES:=$(LOCAL_PATH) \ + $(LOCAL_PATH)/glslang/MachineIndependent \ + $(GLSLANG_OUT_PATH) +LOCAL_STATIC_LIBRARIES:=OSDependent OGLCompiler HLSL +include $(BUILD_STATIC_LIBRARY) + +include $(CLEAR_VARS) +LOCAL_MODULE:=SPIRV +LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti -Werror $(GLSLANG_DEFINES) +LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH) +LOCAL_SRC_FILES:= \ + SPIRV/GlslangToSpv.cpp \ + SPIRV/InReadableOrder.cpp \ + SPIRV/Logger.cpp \ + SPIRV/SPVRemapper.cpp \ + SPIRV/SpvBuilder.cpp \ + SPIRV/SpvPostProcess.cpp \ + SPIRV/SpvTools.cpp \ + SPIRV/disassemble.cpp \ + SPIRV/doc.cpp +LOCAL_C_INCLUDES:=$(LOCAL_PATH) $(LOCAL_PATH)/glslang/SPIRV +LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)/glslang/SPIRV +LOCAL_STATIC_LIBRARIES:=glslang +include $(BUILD_STATIC_LIBRARY) diff --git a/deps/glslang/BUILD.gn b/deps/glslang/BUILD.gn index 5d5b1507..3e061acb 100644 --- a/deps/glslang/BUILD.gn +++ b/deps/glslang/BUILD.gn @@ -141,13 +141,45 @@ source_set("glslang_sources") { if (is_clang) { cflags_cc = [ - "-Wno-implicit-fallthrough", + "-Wno-extra-semi", "-Wno-ignored-qualifiers", + "-Wno-implicit-fallthrough", + "-Wno-inconsistent-missing-override", + "-Wno-sign-compare", "-Wno-unused-variable", ] } + if (is_win && !is_clang) { + cflags = [ + "/wd4018", # signed/unsigned mismatch + ] + } deps = [ "${spirv_tools_dir}:spvtools_opt", ] } + +source_set("glslang_default_resource_limits_sources") { + sources = [ + "StandAlone/ResourceLimits.cpp", + "StandAlone/ResourceLimits.h", + ] + deps = [ ":glslang_sources" ] + public_configs = [ ":glslang_public" ] +} + +source_set("glslang_validator") { + sources = [ + "StandAlone/DirStackFileIncluder.h", + "StandAlone/StandAlone.cpp", + ] + if (!is_win) { + cflags = [ "-Woverflow" ] + } + defines = [ "ENABLE_OPT=0" ] + deps = [ + ":glslang_default_resource_limits_sources", + ":glslang_sources", + ] +} diff --git a/deps/glslang/CMakeLists.txt b/deps/glslang/CMakeLists.txt index 7dc35b01..aafa70ed 100644 --- a/deps/glslang/CMakeLists.txt +++ b/deps/glslang/CMakeLists.txt @@ -46,12 +46,8 @@ endif() # Precompiled header macro. Parameters are source file list and filename for pch cpp file. macro(glslang_pch SRCS PCHCPP) - if(MSVC) - if (CMAKE_GENERATOR MATCHES "^Visual Studio") - set(PCH_NAME "$(IntDir)\\pch.pch") - else() - set(PCH_NAME "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") - endif() + if(MSVC AND CMAKE_GENERATOR MATCHES "^Visual Studio") + set(PCH_NAME "$(IntDir)\\pch.pch") # make source files use/depend on PCH_NAME set_source_files_properties(${${SRCS}} PROPERTIES COMPILE_FLAGS "/Yupch.h /FIpch.h /Fp${PCH_NAME} /Zm300" OBJECT_DEPENDS "${PCH_NAME}") # make PCHCPP file compile and generate PCH_NAME @@ -77,7 +73,7 @@ if(ENABLE_HLSL) endif(ENABLE_HLSL) if(WIN32) - set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Adds a postfix for debug-built libraries.") + set(CMAKE_DEBUG_POSTFIX "d") if(MSVC) include(ChooseMSVCCRT.cmake) endif(MSVC) diff --git a/deps/glslang/LICENSE.txt b/deps/glslang/LICENSE.txt new file mode 100644 index 00000000..a10c0944 --- /dev/null +++ b/deps/glslang/LICENSE.txt @@ -0,0 +1,108 @@ +Here, glslang proper means core GLSL parsing, HLSL parsing, and SPIR-V code +generation. Glslang proper requires use of two licenses, one that covers +non-preprocessing and an additional one that covers preprocessing. + +Bison was removed long ago. You can build glslang from the source grammar, +using tools of your choice, without using bison or any bison files. + +Other parts, outside of glslang proper, include: + +- gl_types.h, only needed for OpenGL-like reflection, and can be left out of + a parse and codegen project. See it for its license. + +- update_glslang_sources.py, which is not part of the project proper and does + not need to be used. + +- the SPIR-V "remapper", which is optional, but has the same license as + glslang proper + +- Google tests and SPIR-V tools, and anything in the external subdirectory + are external and optional; see them for their respective licenses. + +-------------------------------------------------------------------------------- + +The core of glslang-proper, minus the preprocessor is licenced as follows: + +// +// Copyright (C) 2015-2018 Google, Inc. +// Copyright (C) +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +-------------------------------------------------------------------------------- + +The preprocessor has the core license stated above, plus an additional licence: + +/****************************************************************************\ +Copyright (c) 2002, NVIDIA Corporation. + +NVIDIA Corporation("NVIDIA") supplies this software to you in +consideration of your agreement to the following terms, and your use, +installation, modification or redistribution of this NVIDIA software +constitutes acceptance of these terms. If you do not agree with these +terms, please do not use, install, modify or redistribute this NVIDIA +software. + +In consideration of your agreement to abide by the following terms, and +subject to these terms, NVIDIA grants you a personal, non-exclusive +license, under NVIDIA's copyrights in this original NVIDIA software (the +"NVIDIA Software"), to use, reproduce, modify and redistribute the +NVIDIA Software, with or without modifications, in source and/or binary +forms; provided that if you redistribute the NVIDIA Software, you must +retain the copyright notice of NVIDIA, this notice and the following +text and disclaimers in all such redistributions of the NVIDIA Software. +Neither the name, trademarks, service marks nor logos of NVIDIA +Corporation may be used to endorse or promote products derived from the +NVIDIA Software without specific prior written permission from NVIDIA. +Except as expressly stated in this notice, no other rights or licenses +express or implied, are granted by NVIDIA herein, including but not +limited to any patent rights that may be infringed by your derivative +works or by other works in which the NVIDIA Software may be +incorporated. No hardware is licensed hereunder. + +THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, +INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER +PRODUCTS. + +IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, +INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY +OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE +NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, +TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF +NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\****************************************************************************/ diff --git a/deps/glslang/README.md b/deps/glslang/README.md index ba7160da..7d4fe3a9 100644 --- a/deps/glslang/README.md +++ b/deps/glslang/README.md @@ -127,6 +127,9 @@ cmake $SOURCE_DIR -DCMAKE_INSTALL_PREFIX="$(pwd)/install" The CMake GUI also works for Windows (version 3.4.1 tested). +Also, consider using `git config --global core.fileMode false` (or with `--local`) on Windows +to prevent the addition of execution permission on files. + #### 4) Build and Install ```bash diff --git a/deps/glslang/SPIRV/GLSL.ext.EXT.h b/deps/glslang/SPIRV/GLSL.ext.EXT.h index c4a24308..e29c055b 100644 --- a/deps/glslang/SPIRV/GLSL.ext.EXT.h +++ b/deps/glslang/SPIRV/GLSL.ext.EXT.h @@ -28,10 +28,11 @@ #define GLSLextEXT_H static const int GLSLextEXTVersion = 100; -static const int GLSLextEXTRevision = 1; +static const int GLSLextEXTRevision = 2; static const char* const E_SPV_EXT_shader_stencil_export = "SPV_EXT_shader_stencil_export"; static const char* const E_SPV_EXT_shader_viewport_index_layer = "SPV_EXT_shader_viewport_index_layer"; static const char* const E_SPV_EXT_fragment_fully_covered = "SPV_EXT_fragment_fully_covered"; +static const char* const E_SPV_EXT_fragment_invocation_density = "SPV_EXT_fragment_invocation_density"; #endif // #ifndef GLSLextEXT_H diff --git a/deps/glslang/SPIRV/GLSL.ext.KHR.h b/deps/glslang/SPIRV/GLSL.ext.KHR.h index 16b0d9cf..333442bb 100644 --- a/deps/glslang/SPIRV/GLSL.ext.KHR.h +++ b/deps/glslang/SPIRV/GLSL.ext.KHR.h @@ -40,5 +40,6 @@ static const char* const E_SPV_KHR_8bit_storage = "SPV_KHR_8bit_ static const char* const E_SPV_KHR_storage_buffer_storage_class = "SPV_KHR_storage_buffer_storage_class"; static const char* const E_SPV_KHR_post_depth_coverage = "SPV_KHR_post_depth_coverage"; static const char* const E_SPV_KHR_vulkan_memory_model = "SPV_KHR_vulkan_memory_model"; +static const char* const E_SPV_EXT_physical_storage_buffer = "SPV_EXT_physical_storage_buffer"; #endif // #ifndef GLSLextKHR_H diff --git a/deps/glslang/SPIRV/GlslangToSpv.cpp b/deps/glslang/SPIRV/GlslangToSpv.cpp index 3569001c..9bf37045 100644 --- a/deps/glslang/SPIRV/GlslangToSpv.cpp +++ b/deps/glslang/SPIRV/GlslangToSpv.cpp @@ -1,6 +1,6 @@ // // Copyright (C) 2014-2016 LunarG, Inc. -// Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2015-2018 Google, Inc. // Copyright (C) 2017 ARM Limited. // // All rights reserved. @@ -145,9 +145,9 @@ class TGlslangToSpvTraverser : public glslang::TIntermTraverser { spv::Id getInvertedSwizzleType(const glslang::TIntermTyped&); spv::Id createInvertedSwizzle(spv::Decoration precision, const glslang::TIntermTyped&, spv::Id parentResult); void convertSwizzle(const glslang::TIntermAggregate&, std::vector& swizzle); - spv::Id convertGlslangToSpvType(const glslang::TType& type); + spv::Id convertGlslangToSpvType(const glslang::TType& type, bool forwardReferenceOnly = false); spv::Id convertGlslangToSpvType(const glslang::TType& type, glslang::TLayoutPacking, const glslang::TQualifier&, - bool lastBufferBlockMember); + bool lastBufferBlockMember, bool forwardReferenceOnly = false); bool filterMember(const glslang::TType& member); spv::Id convertGlslangStructToSpvType(const glslang::TType&, const glslang::TTypeList* glslangStruct, glslang::TLayoutPacking, const glslang::TQualifier&); @@ -211,6 +211,15 @@ class TGlslangToSpvTraverser : public glslang::TIntermTraverser { builder.addExtension(ext); } + unsigned int getBufferReferenceAlignment(const glslang::TType &type) const { + if (type.getBasicType() == glslang::EbtReference) { + return type.getReferentType()->getQualifier().hasBufferReferenceAlign() ? + (1u << type.getReferentType()->getQualifier().layoutBufferReferenceAlign) : 16u; + } else { + return 0; + } + } + glslang::SpvOptions& options; spv::Function* shaderEntry; spv::Function* currentFunction; @@ -237,6 +246,8 @@ class TGlslangToSpvTraverser : public glslang::TIntermTraverser { std::unordered_map > memberRemapper; std::stack breakForLoop; // false means break for switch std::unordered_map counterOriginator; + // Map pointee types for EbtReference to their forward pointers + std::map forwardPointers; }; // @@ -833,6 +844,16 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI builder.addCapability(spv::CapabilityMultiView); return spv::BuiltInViewIndex; + case glslang::EbvFragSizeEXT: + builder.addExtension(spv::E_SPV_EXT_fragment_invocation_density); + builder.addCapability(spv::CapabilityFragmentDensityEXT); + return spv::BuiltInFragSizeEXT; + + case glslang::EbvFragInvocationCountEXT: + builder.addExtension(spv::E_SPV_EXT_fragment_invocation_density); + builder.addCapability(spv::CapabilityFragmentDensityEXT); + return spv::BuiltInFragInvocationCountEXT; + #ifdef NV_EXTENSIONS case glslang::EbvViewportMaskNV: if (!memberDeclaration) { @@ -1078,6 +1099,13 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T return spv::StorageClassUniformConstant; } +#ifdef NV_EXTENSIONS + if (type.getQualifier().isUniformOrBuffer() && + type.getQualifier().layoutShaderRecordNV) { + return spv::StorageClassShaderRecordBufferNV; + } +#endif + if (glslangIntermediate->usingStorageBuffer() && type.getQualifier().storage == glslang::EvqBuffer) { addPre13Extension(spv::E_SPV_KHR_storage_buffer_storage_class); return spv::StorageClassStorageBuffer; @@ -1086,10 +1114,6 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T if (type.getQualifier().isUniformOrBuffer()) { if (type.getQualifier().layoutPushConstant) return spv::StorageClassPushConstant; -#ifdef NV_EXTENSIONS - if (type.getQualifier().layoutShaderRecordNV) - return spv::StorageClassShaderRecordBufferNV; -#endif if (type.getBasicType() == glslang::EbtBlock) return spv::StorageClassUniform; return spv::StorageClassUniformConstant; @@ -1284,14 +1308,28 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl text.append("#line 1\n"); text.append(glslangIntermediate->getSourceText()); builder.setSourceText(text); + // Pass name and text for all included files + const std::map& include_txt = glslangIntermediate->getIncludeText(); + for (auto iItr = include_txt.begin(); iItr != include_txt.end(); ++iItr) + builder.addInclude(iItr->first, iItr->second); } stdBuiltins = builder.import("GLSL.std.450"); + + spv::AddressingModel addressingModel = spv::AddressingModelLogical; + spv::MemoryModel memoryModel = spv::MemoryModelGLSL450; + + if (glslangIntermediate->usingPhysicalStorageBuffer()) { + addressingModel = spv::AddressingModelPhysicalStorageBuffer64EXT; + builder.addExtension(spv::E_SPV_EXT_physical_storage_buffer); + builder.addCapability(spv::CapabilityPhysicalStorageBufferAddressesEXT); + }; if (glslangIntermediate->usingVulkanMemoryModel()) { - builder.setMemoryModel(spv::AddressingModelLogical, spv::MemoryModelVulkanKHR); + memoryModel = spv::MemoryModelVulkanKHR; + builder.addCapability(spv::CapabilityVulkanMemoryModelKHR); builder.addExtension(spv::E_SPV_KHR_vulkan_memory_model); - } else { - builder.setMemoryModel(spv::AddressingModelLogical, spv::MemoryModelGLSL450); } + builder.setMemoryModel(addressingModel, memoryModel); + shaderEntry = builder.makeEntryPoint(glslangIntermediate->getEntryPointName().c_str()); entryPoint = builder.addEntryPoint(executionModel, shaderEntry, glslangIntermediate->getEntryPointName().c_str()); @@ -1584,7 +1622,7 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol) bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::TIntermBinary* node) { - builder.setLine(node->getLoc().line); + builder.setLine(node->getLoc().line, node->getLoc().getFilename()); SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); if (node->getType().getQualifier().isSpecConstant()) @@ -1664,8 +1702,24 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T // so short circuit the access-chain stuff with a swizzle. std::vector swizzle; swizzle.push_back(glslangIndex); - builder.accessChainPushSwizzle(swizzle, convertGlslangToSpvType(node->getLeft()->getType())); + int dummySize; + builder.accessChainPushSwizzle(swizzle, convertGlslangToSpvType(node->getLeft()->getType()), + TranslateCoherent(node->getLeft()->getType()), + glslangIntermediate->getBaseAlignmentScalar(node->getLeft()->getType(), dummySize)); } else { + + // Load through a block reference is performed with a dot operator that + // is mapped to EOpIndexDirectStruct. When we get to the actual reference, + // do a load and reset the access chain. + if (node->getLeft()->getBasicType() == glslang::EbtReference && + !node->getLeft()->getType().isArray() && + node->getOp() == glslang::EOpIndexDirectStruct) + { + spv::Id left = accessChainLoad(node->getLeft()->getType()); + builder.clearAccessChain(); + builder.setAccessChainLValue(left); + } + int spvIndex = glslangIndex; if (node->getLeft()->getBasicType() == glslang::EbtBlock && node->getOp() == glslang::EOpIndexDirectStruct) @@ -1678,7 +1732,7 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T } // normal case for indexing array or structure or block - builder.accessChainPush(builder.makeIntConstant(spvIndex), TranslateCoherent(node->getLeft()->getType())); + builder.accessChainPush(builder.makeIntConstant(spvIndex), TranslateCoherent(node->getLeft()->getType()), getBufferReferenceAlignment(node->getLeft()->getType())); // Add capabilities here for accessing PointSize and clip/cull distance. // We have deferred generation of associated capabilities until now. @@ -1711,10 +1765,13 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T // restore the saved access chain builder.setAccessChain(partial); - if (! node->getLeft()->getType().isArray() && node->getLeft()->getType().isVector()) - builder.accessChainPushComponent(index, convertGlslangToSpvType(node->getLeft()->getType())); - else - builder.accessChainPush(index, TranslateCoherent(node->getLeft()->getType())); + if (! node->getLeft()->getType().isArray() && node->getLeft()->getType().isVector()) { + int dummySize; + builder.accessChainPushComponent(index, convertGlslangToSpvType(node->getLeft()->getType()), + TranslateCoherent(node->getLeft()->getType()), + glslangIntermediate->getBaseAlignmentScalar(node->getLeft()->getType(), dummySize)); + } else + builder.accessChainPush(index, TranslateCoherent(node->getLeft()->getType()), getBufferReferenceAlignment(node->getLeft()->getType())); } return false; case glslang::EOpVectorSwizzle: @@ -1722,7 +1779,10 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T node->getLeft()->traverse(this); std::vector swizzle; convertSwizzle(*node->getRight()->getAsAggregate(), swizzle); - builder.accessChainPushSwizzle(swizzle, convertGlslangToSpvType(node->getLeft()->getType())); + int dummySize; + builder.accessChainPushSwizzle(swizzle, convertGlslangToSpvType(node->getLeft()->getType()), + TranslateCoherent(node->getLeft()->getType()), + glslangIntermediate->getBaseAlignmentScalar(node->getLeft()->getType(), dummySize)); } return false; case glslang::EOpMatrixSwizzle: @@ -1779,7 +1839,7 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TIntermUnary* node) { - builder.setLine(node->getLoc().line); + builder.setLine(node->getLoc().line, node->getLoc().getFilename()); SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); if (node->getType().getQualifier().isSpecConstant()) @@ -1815,6 +1875,12 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI unsigned int member = node->getOperand()->getAsBinaryNode()->getRight()->getAsConstantUnion()->getConstArray()[0].getUConst(); spv::Id length = builder.createArrayLength(builder.accessChainGetLValue(), member); + // GLSL semantics say the result of .length() is an int, while SPIR-V says + // signedness must be 0. So, convert from SPIR-V unsigned back to GLSL's + // AST expectation of a signed result. + if (glslangIntermediate->getSource() == glslang::EShSourceGlsl) + length = builder.createUnaryOp(spv::OpBitcast, builder.makeIntType(32), length); + builder.clearAccessChain(); builder.setAccessChainRValue(length); @@ -2037,7 +2103,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt return false; case glslang::EOpFunctionCall: { - builder.setLine(node->getLoc().line); + builder.setLine(node->getLoc().line, node->getLoc().getFilename()); if (node->isUserDefined()) result = handleUserFunctionCall(node); // assert(result); // this can happen for bad shaders because the call graph completeness checking is not yet done @@ -2155,8 +2221,9 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpConstructU64Vec4: case glslang::EOpConstructStruct: case glslang::EOpConstructTextureSampler: + case glslang::EOpConstructReference: { - builder.setLine(node->getLoc().line); + builder.setLine(node->getLoc().line, node->getLoc().getFilename()); std::vector arguments; translateArguments(*node, arguments); spv::Id constructed; @@ -2301,7 +2368,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt right->traverse(this); spv::Id rightId = accessChainLoad(right->getType()); - builder.setLine(node->getLoc().line); + builder.setLine(node->getLoc().line, node->getLoc().getFilename()); OpDecorations decorations = { precision, TranslateNoContractionDecoration(node->getType().getQualifier()), TranslateNonUniformDecoration(node->getType().getQualifier()) }; @@ -2389,12 +2456,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt if (lvalue) operands.push_back(builder.accessChainGetLValue()); else { - builder.setLine(node->getLoc().line); + builder.setLine(node->getLoc().line, node->getLoc().getFilename()); operands.push_back(accessChainLoad(glslangOperands[arg]->getAsTyped()->getType())); } } - builder.setLine(node->getLoc().line); + builder.setLine(node->getLoc().line, node->getLoc().getFilename()); if (atomic) { // Handle all atomics result = createAtomicOperation(node->getOp(), precision, resultType(), operands, node->getBasicType()); @@ -2495,7 +2562,7 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang node->getFalseBlock()->traverse(this); spv::Id falseValue = accessChainLoad(node->getTrueBlock()->getAsTyped()->getType()); - builder.setLine(node->getLoc().line); + builder.setLine(node->getLoc().line, node->getLoc().getFilename()); // done if void if (node->getBasicType() == glslang::EbtVoid) @@ -2669,7 +2736,7 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn // by a block-ending branch. But we don't want to put any other body/test // instructions in it, since the body/test may have arbitrary instructions, // including merges of its own. - builder.setLine(node->getLoc().line); + builder.setLine(node->getLoc().line, node->getLoc().getFilename()); builder.setBuildPoint(&blocks.head); builder.createLoopMerge(&blocks.merge, &blocks.continue_target, control, dependencyLength); if (node->testFirst() && node->getTest()) { @@ -2693,7 +2760,7 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn node->getTerminal()->traverse(this); builder.createBranch(&blocks.head); } else { - builder.setLine(node->getLoc().line); + builder.setLine(node->getLoc().line, node->getLoc().getFilename()); builder.createBranch(&blocks.body); breakForLoop.push(true); @@ -2728,7 +2795,7 @@ bool TGlslangToSpvTraverser::visitBranch(glslang::TVisit /* visit */, glslang::T if (node->getExpression()) node->getExpression()->traverse(this); - builder.setLine(node->getLoc().line); + builder.setLine(node->getLoc().line, node->getLoc().getFilename()); switch (node->getFlowOp()) { case glslang::EOpKill: @@ -2806,6 +2873,7 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol* builder.addCapability(spv::CapabilityStorageUniform16); break; case spv::StorageClassStorageBuffer: + case spv::StorageClassPhysicalStorageBufferEXT: addPre13Extension(spv::E_SPV_KHR_16bit_storage); builder.addCapability(spv::CapabilityStorageUniformBufferBlock16); break; @@ -2887,16 +2955,17 @@ void TGlslangToSpvTraverser::convertSwizzle(const glslang::TIntermAggregate& nod // Convert from a glslang type to an SPV type, by calling into a // recursive version of this function. This establishes the inherited // layout state rooted from the top-level type. -spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& type) +spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& type, bool forwardReferenceOnly) { - return convertGlslangToSpvType(type, getExplicitLayout(type), type.getQualifier(), false); + return convertGlslangToSpvType(type, getExplicitLayout(type), type.getQualifier(), false, forwardReferenceOnly); } // Do full recursive conversion of an arbitrary glslang type to a SPIR-V Id. // explicitLayout can be kept the same throughout the hierarchical recursive walk. // Mutually recursive with convertGlslangStructToSpvType(). spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& type, - glslang::TLayoutPacking explicitLayout, const glslang::TQualifier& qualifier, bool lastBufferBlockMember) + glslang::TLayoutPacking explicitLayout, const glslang::TQualifier& qualifier, + bool lastBufferBlockMember, bool forwardReferenceOnly) { spv::Id spvType = spv::NoResult; @@ -2991,6 +3060,23 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty spvType = convertGlslangStructToSpvType(type, glslangMembers, explicitLayout, qualifier); } break; + case glslang::EbtReference: + { + // Make the forward pointer, then recurse to convert the structure type, then + // patch up the forward pointer with a real pointer type. + if (forwardPointers.find(type.getReferentType()) == forwardPointers.end()) { + spv::Id forwardId = builder.makeForwardPointer(spv::StorageClassPhysicalStorageBufferEXT); + forwardPointers[type.getReferentType()] = forwardId; + } + spvType = forwardPointers[type.getReferentType()]; + if (!forwardReferenceOnly) { + spv::Id referentType = convertGlslangToSpvType(*type.getReferentType()); + builder.makePointerFromForwardPointer(spv::StorageClassPhysicalStorageBufferEXT, + forwardPointers[type.getReferentType()], + referentType); + } + } + break; default: assert(0); break; @@ -3098,6 +3184,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangStructToSpvType(const glslang::TTy // Create a vector of struct types for SPIR-V to consume std::vector spvMembers; int memberDelta = 0; // how much the member's index changes from glslang to SPIR-V, normally 0, except sometimes for blocks + std::vector > deferredForwardPointers; for (int i = 0; i < (int)glslangMembers->size(); i++) { glslang::TType& glslangMember = *(*glslangMembers)[i].type; if (glslangMember.hiddenMember()) { @@ -3121,8 +3208,19 @@ spv::Id TGlslangToSpvTraverser::convertGlslangStructToSpvType(const glslang::TTy // recurse bool lastBufferBlockMember = qualifier.storage == glslang::EvqBuffer && i == (int)glslangMembers->size() - 1; - spvMembers.push_back( - convertGlslangToSpvType(glslangMember, explicitLayout, memberQualifier, lastBufferBlockMember)); + + // Make forward pointers for any pointer members, and create a list of members to + // convert to spirv types after creating the struct. + if (glslangMember.getBasicType() == glslang::EbtReference) { + if (forwardPointers.find(glslangMember.getReferentType()) == forwardPointers.end()) { + deferredForwardPointers.push_back(std::make_pair(&glslangMember, memberQualifier)); + } + spvMembers.push_back( + convertGlslangToSpvType(glslangMember, explicitLayout, memberQualifier, lastBufferBlockMember, true)); + } else { + spvMembers.push_back( + convertGlslangToSpvType(glslangMember, explicitLayout, memberQualifier, lastBufferBlockMember, false)); + } } } @@ -3134,6 +3232,11 @@ spv::Id TGlslangToSpvTraverser::convertGlslangStructToSpvType(const glslang::TTy // Decorate it decorateStructType(type, glslangMembers, explicitLayout, qualifier, spvType); + for (int i = 0; i < (int)deferredForwardPointers.size(); ++i) { + auto it = deferredForwardPointers[i]; + convertGlslangToSpvType(*it.first, explicitLayout, it.second, false); + } + return spvType; } @@ -3263,10 +3366,6 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type, // Decorate the structure builder.addDecoration(spvType, TranslateLayoutDecoration(type, qualifier.layoutMatrix)); builder.addDecoration(spvType, TranslateBlockDecoration(type, glslangIntermediate->usingStorageBuffer())); - if (type.getQualifier().hasStream() && glslangIntermediate->isMultiStream()) { - builder.addCapability(spv::CapabilityGeometryStreams); - builder.addDecoration(spvType, spv::DecorationStream, type.getQualifier().layoutStream); - } } // Turn the expression forming the array size into an id. @@ -3301,11 +3400,15 @@ spv::Id TGlslangToSpvTraverser::accessChainLoad(const glslang::TType& type) spv::Builder::AccessChain::CoherentFlags coherentFlags = builder.getAccessChain().coherentFlags; coherentFlags |= TranslateCoherent(type); + unsigned int alignment = builder.getAccessChain().alignment; + alignment |= getBufferReferenceAlignment(type); + spv::Id loadedId = builder.accessChainLoad(TranslatePrecisionDecoration(type), TranslateNonUniformDecoration(type.getQualifier()), nominalTypeId, spv::MemoryAccessMask(TranslateMemoryAccess(coherentFlags) & ~spv::MemoryAccessMakePointerAvailableKHRMask), - TranslateMemoryScope(coherentFlags)); + TranslateMemoryScope(coherentFlags), + alignment); // Need to convert to abstract types when necessary if (type.getBasicType() == glslang::EbtBool) { @@ -3364,9 +3467,12 @@ void TGlslangToSpvTraverser::accessChainStore(const glslang::TType& type, spv::I spv::Builder::AccessChain::CoherentFlags coherentFlags = builder.getAccessChain().coherentFlags; coherentFlags |= TranslateCoherent(type); + unsigned int alignment = builder.getAccessChain().alignment; + alignment |= getBufferReferenceAlignment(type); + builder.accessChainStore(rvalue, spv::MemoryAccessMask(TranslateMemoryAccess(coherentFlags) & ~spv::MemoryAccessMakePointerVisibleKHRMask), - TranslateMemoryScope(coherentFlags)); + TranslateMemoryScope(coherentFlags), alignment); } // For storing when types match at the glslang level, but not might match at the @@ -3412,7 +3518,7 @@ void TGlslangToSpvTraverser::multiTypeStore(const glslang::TType& type, spv::Id // set up the target storage builder.clearAccessChain(); builder.setAccessChainLValue(lValue); - builder.accessChainPush(builder.makeIntConstant(index), TranslateCoherent(type)); + builder.accessChainPush(builder.makeIntConstant(index), TranslateCoherent(type), getBufferReferenceAlignment(type)); // store the member multiTypeStore(glslangElementType, elementRValue); @@ -3432,7 +3538,7 @@ void TGlslangToSpvTraverser::multiTypeStore(const glslang::TType& type, spv::Id // set up the target storage builder.clearAccessChain(); builder.setAccessChainLValue(lValue); - builder.accessChainPush(builder.makeIntConstant(m), TranslateCoherent(type)); + builder.accessChainPush(builder.makeIntConstant(m), TranslateCoherent(type), getBufferReferenceAlignment(type)); // store the member multiTypeStore(glslangMemberType, memberRValue); @@ -3459,6 +3565,7 @@ glslang::TLayoutPacking TGlslangToSpvTraverser::getExplicitLayout(const glslang: switch (type.getQualifier().layoutPacking) { case glslang::ElpStd140: case glslang::ElpStd430: + case glslang::ElpScalar: return type.getQualifier().layoutPacking; default: return glslang::ElpNone; @@ -3470,7 +3577,7 @@ int TGlslangToSpvTraverser::getArrayStride(const glslang::TType& arrayType, glsl { int size; int stride; - glslangIntermediate->getBaseAlignment(arrayType, size, stride, explicitLayout == glslang::ElpStd140, matrixLayout == glslang::ElmRowMajor); + glslangIntermediate->getMemberAlignment(arrayType, size, stride, explicitLayout, matrixLayout == glslang::ElmRowMajor); return stride; } @@ -3485,7 +3592,7 @@ int TGlslangToSpvTraverser::getMatrixStride(const glslang::TType& matrixType, gl int size; int stride; - glslangIntermediate->getBaseAlignment(elementType, size, stride, explicitLayout == glslang::ElpStd140, matrixLayout == glslang::ElmRowMajor); + glslangIntermediate->getMemberAlignment(elementType, size, stride, explicitLayout, matrixLayout == glslang::ElmRowMajor); return stride; } @@ -3527,7 +3634,7 @@ void TGlslangToSpvTraverser::updateMemberOffset(const glslang::TType& structType int memberSize; int dummyStride; - int memberAlignment = glslangIntermediate->getBaseAlignment(memberType, memberSize, dummyStride, explicitLayout == glslang::ElpStd140, matrixLayout == glslang::ElmRowMajor); + int memberAlignment = glslangIntermediate->getMemberAlignment(memberType, memberSize, dummyStride, explicitLayout, matrixLayout == glslang::ElmRowMajor); // Adjust alignment for HLSL rules // TODO: make this consistent in early phases of code: @@ -3546,7 +3653,7 @@ void TGlslangToSpvTraverser::updateMemberOffset(const glslang::TType& structType glslang::RoundToPow2(currentOffset, memberAlignment); // Bump up to vec4 if there is a bad straddle - if (glslangIntermediate->improperStraddle(memberType, memberSize, currentOffset)) + if (explicitLayout != glslang::ElpScalar && glslangIntermediate->improperStraddle(memberType, memberSize, currentOffset)) glslang::RoundToPow2(currentOffset, 16); nextOffset = currentOffset + memberSize; @@ -3618,11 +3725,22 @@ bool TGlslangToSpvTraverser::originalParam(glslang::TStorageQualifier qualifier, // Make all the functions, skeletally, without actually visiting their bodies. void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslFunctions) { - const auto getParamDecorations = [](std::vector& decorations, const glslang::TType& type, bool useVulkanMemoryModel) { + const auto getParamDecorations = [&](std::vector& decorations, const glslang::TType& type, bool useVulkanMemoryModel) { spv::Decoration paramPrecision = TranslatePrecisionDecoration(type); if (paramPrecision != spv::NoPrecision) decorations.push_back(paramPrecision); TranslateMemoryDecoration(type.getQualifier(), decorations, useVulkanMemoryModel); + if (type.getBasicType() == glslang::EbtReference) { + // Original and non-writable params pass the pointer directly and + // use restrict/aliased, others are stored to a pointer in Function + // memory and use RestrictPointer/AliasedPointer. + if (originalParam(type.getQualifier().storage, type, false) || + !writableParam(type.getQualifier().storage)) { + decorations.push_back(type.getQualifier().restrict ? spv::DecorationRestrict : spv::DecorationAliased); + } else { + decorations.push_back(type.getQualifier().restrict ? spv::DecorationRestrictPointerEXT : spv::DecorationAliasedPointerEXT); + } + } }; for (int f = 0; f < (int)glslFunctions.size(); ++f) { @@ -3896,7 +4014,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO if (! node->isImage() && ! node->isTexture()) return spv::NoResult; - builder.setLine(node->getLoc().line); + builder.setLine(node->getLoc().line, node->getLoc().getFilename()); // Process a GLSL texturing op (will be SPV image) @@ -4439,7 +4557,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO spv::Builder::AccessChain::CoherentFlags flags; flags.clear(); - builder.accessChainPush(builder.makeIntConstant(i), flags); + builder.accessChainPush(builder.makeIntConstant(i), flags, 0); builder.accessChainStore(builder.createCompositeExtract(res, builder.getContainedTypeId(resType, i+1), i+1)); } return builder.createCompositeExtract(res, resultType(), 0); @@ -5310,6 +5428,9 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe unaryOp = spv::OpGroupNonUniformPartitionNV; break; #endif + case glslang::EOpConstructReference: + unaryOp = spv::OpBitcast; + break; default: return 0; } @@ -5762,6 +5883,12 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, OpDecora // For normal run-time conversion instruction, use OpBitcast. convOp = spv::OpBitcast; break; + case glslang::EOpConvUint64ToPtr: + convOp = spv::OpConvertUToPtr; + break; + case glslang::EOpConvPtrToUint64: + convOp = spv::OpConvertPtrToU; + break; default: break; } @@ -6914,6 +7041,17 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: // We might need the remaining arguments, e.g. in the EOpFrexp case. std::vector callArguments(operands.begin(), operands.begin() + consumedOperands); id = builder.createBuiltinCall(typeId, extBuiltins >= 0 ? extBuiltins : stdBuiltins, libCall, callArguments); + } else if (opCode == spv::OpDot && !isFloat) { + // int dot(int, int) + // NOTE: never called for scalar/vector1, this is turned into simple mul before this can be reached + const int componentCount = builder.getNumComponents(operands[0]); + spv::Id mulOp = builder.createBinOp(spv::OpIMul, builder.getTypeId(operands[0]), operands[0], operands[1]); + builder.setPrecision(mulOp, precision); + id = builder.createCompositeExtract(mulOp, typeId, 0); + for (int i = 1; i < componentCount; ++i) { + builder.setPrecision(id, precision); + id = builder.createBinOp(spv::OpIAdd, typeId, id, builder.createCompositeExtract(operands[0], typeId, i)); + } } else { switch (consumedOperands) { case 0: @@ -7137,12 +7275,14 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol } if (symbol->getQualifier().hasBinding()) builder.addDecoration(id, spv::DecorationBinding, symbol->getQualifier().layoutBinding); + else if (IsDescriptorResource(symbol->getType())) { + // default to 0 + builder.addDecoration(id, spv::DecorationBinding, 0); + } if (symbol->getQualifier().hasAttachment()) builder.addDecoration(id, spv::DecorationInputAttachmentIndex, symbol->getQualifier().layoutAttachment); if (glslangIntermediate->getXfbMode()) { builder.addCapability(spv::CapabilityTransformFeedback); - if (symbol->getQualifier().hasXfbStride()) - builder.addDecoration(id, spv::DecorationXfbStride, symbol->getQualifier().layoutXfbStride); if (symbol->getQualifier().hasXfbBuffer()) { builder.addDecoration(id, spv::DecorationXfbBuffer, symbol->getQualifier().layoutXfbBuffer); unsigned stride = glslangIntermediate->getXfbStride(symbol->getQualifier().layoutXfbBuffer); @@ -7214,6 +7354,10 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol symbol->getType().getQualifier().semanticName); } + if (symbol->getBasicType() == glslang::EbtReference) { + builder.addDecoration(id, symbol->getType().getQualifier().restrict ? spv::DecorationRestrictPointerEXT : spv::DecorationAliasedPointerEXT); + } + return id; } @@ -7342,7 +7486,7 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla glslang::TType vectorType(glslangType, 0); for (int col = 0; col < glslangType.getMatrixCols(); ++col) spvConsts.push_back(createSpvConstantFromConstUnionArray(vectorType, consts, nextConst, false)); - } else if (glslangType.getStruct()) { + } else if (glslangType.isStruct()) { glslang::TVector::const_iterator iter; for (iter = glslangType.getStruct()->begin(); iter != glslangType.getStruct()->end(); ++iter) spvConsts.push_back(createSpvConstantFromConstUnionArray(*iter->type, consts, nextConst, false)); diff --git a/deps/glslang/SPIRV/GlslangToSpv.h b/deps/glslang/SPIRV/GlslangToSpv.h index 4169c12e..86e1c23b 100644 --- a/deps/glslang/SPIRV/GlslangToSpv.h +++ b/deps/glslang/SPIRV/GlslangToSpv.h @@ -1,5 +1,6 @@ // // Copyright (C) 2014 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. // // All rights reserved. // diff --git a/deps/glslang/SPIRV/SpvBuilder.cpp b/deps/glslang/SPIRV/SpvBuilder.cpp index 8755d9ea..8355d833 100644 --- a/deps/glslang/SPIRV/SpvBuilder.cpp +++ b/deps/glslang/SPIRV/SpvBuilder.cpp @@ -1,6 +1,6 @@ // // Copyright (C) 2014-2015 LunarG, Inc. -// Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2015-2018 Google, Inc. // // All rights reserved. // @@ -60,6 +60,7 @@ Builder::Builder(unsigned int spvVersion, unsigned int magicNumber, SpvBuildLogg sourceVersion(0), sourceFileStringId(NoResult), currentLine(0), + currentFile(nullptr), emitOpLines(false), addressModel(AddressingModelLogical), memoryModel(MemoryModelGLSL450), @@ -87,8 +88,9 @@ Id Builder::import(const char* name) return import->getResultId(); } -// Emit an OpLine if we've been asked to emit OpLines and the line number -// has changed since the last time, and is a valid line number. +// Emit instruction for non-filename-based #line directives (ie. no filename +// seen yet): emit an OpLine if we've been asked to emit OpLines and the line +// number has changed since the last time, and is a valid line number. void Builder::setLine(int lineNum) { if (lineNum != 0 && lineNum != currentLine) { @@ -98,6 +100,26 @@ void Builder::setLine(int lineNum) } } +// If no filename, do non-filename-based #line emit. Else do filename-based emit. +// Emit OpLine if we've been asked to emit OpLines and the line number or filename +// has changed since the last time, and line number is valid. +void Builder::setLine(int lineNum, const char* filename) +{ + if (filename == nullptr) { + setLine(lineNum); + return; + } + if ((lineNum != 0 && lineNum != currentLine) || currentFile == nullptr || + strncmp(filename, currentFile, strlen(currentFile) + 1) != 0) { + currentLine = lineNum; + currentFile = filename; + if (emitOpLines) { + spv::Id strId = getStringId(filename); + addLine(strId, currentLine, 0); + } + } +} + void Builder::addLine(Id fileName, int lineNum, int column) { Instruction* line = new Instruction(OpLine); @@ -172,6 +194,40 @@ Id Builder::makePointer(StorageClass storageClass, Id pointee) return type->getResultId(); } +Id Builder::makeForwardPointer(StorageClass storageClass) +{ + // Caching/uniquifying doesn't work here, because we don't know the + // pointee type and there can be multiple forward pointers of the same + // storage type. Somebody higher up in the stack must keep track. + Instruction* type = new Instruction(getUniqueId(), NoType, OpTypeForwardPointer); + type->addImmediateOperand(storageClass); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +Id Builder::makePointerFromForwardPointer(StorageClass storageClass, Id forwardPointerType, Id pointee) +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedTypes[OpTypePointer].size(); ++t) { + type = groupedTypes[OpTypePointer][t]; + if (type->getImmediateOperand(0) == (unsigned)storageClass && + type->getIdOperand(1) == pointee) + return type->getResultId(); + } + + type = new Instruction(forwardPointerType, NoType, OpTypePointer); + type->addImmediateOperand(storageClass); + type->addIdOperand(pointee); + groupedTypes[OpTypePointer].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + Id Builder::makeIntegerType(int width, bool hasSign) { // try to find it @@ -509,6 +565,7 @@ Id Builder::makeAccelerationStructureNVType() Instruction *type; if (groupedTypes[OpTypeAccelerationStructureNV].size() == 0) { type = new Instruction(getUniqueId(), NoType, OpTypeAccelerationStructureNV); + groupedTypes[OpTypeAccelerationStructureNV].push_back(type); constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); } else { @@ -554,6 +611,7 @@ int Builder::getNumTypeConstituents(Id typeId) const case OpTypeBool: case OpTypeInt: case OpTypeFloat: + case OpTypePointer: return 1; case OpTypeVector: case OpTypeMatrix: @@ -647,17 +705,36 @@ bool Builder::containsType(Id typeId, spv::Op typeOp, unsigned int width) const return true; } return false; + case OpTypePointer: + return false; case OpTypeVector: case OpTypeMatrix: case OpTypeArray: case OpTypeRuntimeArray: - case OpTypePointer: return containsType(getContainedTypeId(typeId), typeOp, width); default: return typeClass == typeOp; } } +// return true if the type is a pointer to PhysicalStorageBufferEXT or an +// array of such pointers. These require restrict/aliased decorations. +bool Builder::containsPhysicalStorageBufferOrArray(Id typeId) const +{ + const Instruction& instr = *module.getInstruction(typeId); + + Op typeClass = instr.getOpCode(); + switch (typeClass) + { + case OpTypePointer: + return getTypeStorageClass(typeId) == StorageClassPhysicalStorageBufferEXT; + case OpTypeArray: + return containsPhysicalStorageBufferOrArray(getContainedTypeId(typeId)); + default: + return false; + } +} + // See if a scalar constant of this type has already been created, so it // can be reused rather than duplicated. (Required by the specification). Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value) @@ -1230,15 +1307,39 @@ Id Builder::createUndefined(Id type) return inst->getResultId(); } +// av/vis/nonprivate are unnecessary and illegal for some storage classes. +spv::MemoryAccessMask Builder::sanitizeMemoryAccessForStorageClass(spv::MemoryAccessMask memoryAccess, StorageClass sc) const +{ + switch (sc) { + case spv::StorageClassUniform: + case spv::StorageClassWorkgroup: + case spv::StorageClassStorageBuffer: + case spv::StorageClassPhysicalStorageBufferEXT: + break; + default: + memoryAccess = spv::MemoryAccessMask(memoryAccess & + ~(spv::MemoryAccessMakePointerAvailableKHRMask | + spv::MemoryAccessMakePointerVisibleKHRMask | + spv::MemoryAccessNonPrivatePointerKHRMask)); + break; + } + return memoryAccess; +} + // Comments in header -void Builder::createStore(Id rValue, Id lValue, spv::MemoryAccessMask memoryAccess, spv::Scope scope) +void Builder::createStore(Id rValue, Id lValue, spv::MemoryAccessMask memoryAccess, spv::Scope scope, unsigned int alignment) { Instruction* store = new Instruction(OpStore); store->addIdOperand(lValue); store->addIdOperand(rValue); + memoryAccess = sanitizeMemoryAccessForStorageClass(memoryAccess, getStorageClass(lValue)); + if (memoryAccess != MemoryAccessMaskNone) { store->addImmediateOperand(memoryAccess); + if (memoryAccess & spv::MemoryAccessAlignedMask) { + store->addImmediateOperand(alignment); + } if (memoryAccess & spv::MemoryAccessMakePointerAvailableKHRMask) { store->addIdOperand(makeUintConstant(scope)); } @@ -1248,13 +1349,18 @@ void Builder::createStore(Id rValue, Id lValue, spv::MemoryAccessMask memoryAcce } // Comments in header -Id Builder::createLoad(Id lValue, spv::MemoryAccessMask memoryAccess, spv::Scope scope) +Id Builder::createLoad(Id lValue, spv::MemoryAccessMask memoryAccess, spv::Scope scope, unsigned int alignment) { Instruction* load = new Instruction(getUniqueId(), getDerefTypeId(lValue), OpLoad); load->addIdOperand(lValue); + memoryAccess = sanitizeMemoryAccessForStorageClass(memoryAccess, getStorageClass(lValue)); + if (memoryAccess != MemoryAccessMaskNone) { load->addImmediateOperand(memoryAccess); + if (memoryAccess & spv::MemoryAccessAlignedMask) { + load->addImmediateOperand(alignment); + } if (memoryAccess & spv::MemoryAccessMakePointerVisibleKHRMask) { load->addIdOperand(makeUintConstant(scope)); } @@ -1293,7 +1399,7 @@ Id Builder::createAccessChain(StorageClass storageClass, Id base, const std::vec Id Builder::createArrayLength(Id base, unsigned int member) { - spv::Id intType = makeIntType(32); + spv::Id intType = makeUintType(32); Instruction* length = new Instruction(getUniqueId(), intType, OpArrayLength); length->addIdOperand(base); length->addImmediateOperand(member); @@ -2096,7 +2202,8 @@ Id Builder::createConstructor(Decoration precision, const std::vector& sourc // Go through the source arguments, each one could have either // a single or multiple components to contribute. for (unsigned int i = 0; i < sources.size(); ++i) { - if (isScalar(sources[i])) + + if (isScalar(sources[i]) || isPointer(sources[i])) latchResult(sources[i]); else if (isVector(sources[i])) accumulateVectorConstituents(sources[i]); @@ -2411,11 +2518,15 @@ void Builder::clearAccessChain() accessChain.preSwizzleBaseType = NoType; accessChain.isRValue = false; accessChain.coherentFlags.clear(); + accessChain.alignment = 0; } // Comments in header -void Builder::accessChainPushSwizzle(std::vector& swizzle, Id preSwizzleBaseType) +void Builder::accessChainPushSwizzle(std::vector& swizzle, Id preSwizzleBaseType, AccessChain::CoherentFlags coherentFlags, unsigned int alignment) { + accessChain.coherentFlags |= coherentFlags; + accessChain.alignment |= alignment; + // swizzles can be stacked in GLSL, but simplified to a single // one here; the base type doesn't change if (accessChain.preSwizzleBaseType == NoType) @@ -2437,7 +2548,7 @@ void Builder::accessChainPushSwizzle(std::vector& swizzle, Id preSwizz } // Comments in header -void Builder::accessChainStore(Id rvalue, spv::MemoryAccessMask memoryAccess, spv::Scope scope) +void Builder::accessChainStore(Id rvalue, spv::MemoryAccessMask memoryAccess, spv::Scope scope, unsigned int alignment) { assert(accessChain.isRValue == false); @@ -2455,11 +2566,17 @@ void Builder::accessChainStore(Id rvalue, spv::MemoryAccessMask memoryAccess, sp source = createLvalueSwizzle(getTypeId(tempBaseId), tempBaseId, source, accessChain.swizzle); } - createStore(source, base, memoryAccess, scope); + // take LSB of alignment + alignment = alignment & ~(alignment & (alignment-1)); + if (getStorageClass(base) == StorageClassPhysicalStorageBufferEXT) { + memoryAccess = (spv::MemoryAccessMask)(memoryAccess | spv::MemoryAccessAlignedMask); + } + + createStore(source, base, memoryAccess, scope, alignment); } // Comments in header -Id Builder::accessChainLoad(Decoration precision, Decoration nonUniform, Id resultType, spv::MemoryAccessMask memoryAccess, spv::Scope scope) +Id Builder::accessChainLoad(Decoration precision, Decoration nonUniform, Id resultType, spv::MemoryAccessMask memoryAccess, spv::Scope scope, unsigned int alignment) { Id id; @@ -2502,8 +2619,15 @@ Id Builder::accessChainLoad(Decoration precision, Decoration nonUniform, Id resu id = accessChain.base; // no precision, it was set when this was defined } else { transferAccessChainSwizzle(true); + + // take LSB of alignment + alignment = alignment & ~(alignment & (alignment-1)); + if (getStorageClass(accessChain.base) == StorageClassPhysicalStorageBufferEXT) { + memoryAccess = (spv::MemoryAccessMask)(memoryAccess | spv::MemoryAccessAlignedMask); + } + // load through the access chain - id = createLoad(collapseAccessChain(), memoryAccess, scope); + id = createLoad(collapseAccessChain(), memoryAccess, scope, alignment); setPrecision(id, precision); addDecoration(id, nonUniform); } @@ -2809,7 +2933,8 @@ void Builder::createConditionalBranch(Id condition, Block* thenBlock, Block* els // OpSource // [OpSourceContinued] // ... -void Builder::dumpSourceInstructions(std::vector& out) const +void Builder::dumpSourceInstructions(const spv::Id fileId, const std::string& text, + std::vector& out) const { const int maxWordCount = 0xFFFF; const int opSourceWordCount = 4; @@ -2821,14 +2946,14 @@ void Builder::dumpSourceInstructions(std::vector& out) const sourceInst.addImmediateOperand(source); sourceInst.addImmediateOperand(sourceVersion); // File operand - if (sourceFileStringId != NoResult) { - sourceInst.addIdOperand(sourceFileStringId); + if (fileId != NoResult) { + sourceInst.addIdOperand(fileId); // Source operand - if (sourceText.size() > 0) { + if (text.size() > 0) { int nextByte = 0; std::string subString; - while ((int)sourceText.size() - nextByte > 0) { - subString = sourceText.substr(nextByte, nonNullBytesPerInstruction); + while ((int)text.size() - nextByte > 0) { + subString = text.substr(nextByte, nonNullBytesPerInstruction); if (nextByte == 0) { // OpSource sourceInst.addStringOperand(subString.c_str()); @@ -2848,6 +2973,14 @@ void Builder::dumpSourceInstructions(std::vector& out) const } } +// Dump an OpSource[Continued] sequence for the source and every include file +void Builder::dumpSourceInstructions(std::vector& out) const +{ + dumpSourceInstructions(sourceFileStringId, sourceText, out); + for (auto iItr = includeFiles.begin(); iItr != includeFiles.end(); ++iItr) + dumpSourceInstructions(iItr->first, *iItr->second, out); +} + void Builder::dumpInstructions(std::vector& out, const std::vector >& instructions) const { for (int i = 0; i < (int)instructions.size(); ++i) { diff --git a/deps/glslang/SPIRV/SpvBuilder.h b/deps/glslang/SPIRV/SpvBuilder.h index 7c1d421b..edeac1b6 100644 --- a/deps/glslang/SPIRV/SpvBuilder.h +++ b/deps/glslang/SPIRV/SpvBuilder.h @@ -1,6 +1,6 @@ // // Copyright (C) 2014-2015 LunarG, Inc. -// Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2015-2018 Google, Inc. // Copyright (C) 2017 ARM Limited. // // All rights reserved. @@ -57,6 +57,7 @@ #include #include #include +#include namespace spv { @@ -74,18 +75,33 @@ class Builder { source = lang; sourceVersion = version; } - void setSourceFile(const std::string& file) + spv::Id getStringId(const std::string& str) { - Instruction* fileString = new Instruction(getUniqueId(), NoType, OpString); - fileString->addStringOperand(file.c_str()); - sourceFileStringId = fileString->getResultId(); + auto sItr = stringIds.find(str); + if (sItr != stringIds.end()) + return sItr->second; + spv::Id strId = getUniqueId(); + Instruction* fileString = new Instruction(strId, NoType, OpString); + const char* file_c_str = str.c_str(); + fileString->addStringOperand(file_c_str); strings.push_back(std::unique_ptr(fileString)); + stringIds[file_c_str] = strId; + return strId; + } + void setSourceFile(const std::string& file) + { + sourceFileStringId = getStringId(file); } void setSourceText(const std::string& text) { sourceText = text; } void addSourceExtension(const char* ext) { sourceExtensions.push_back(ext); } void addModuleProcessed(const std::string& p) { moduleProcesses.push_back(p.c_str()); } void setEmitOpLines() { emitOpLines = true; } void addExtension(const char* ext) { extensions.insert(ext); } + void addInclude(const std::string& name, const std::string& text) + { + spv::Id incId = getStringId(name); + includeFiles[incId] = &text; + } Id import(const char*); void setMemoryModel(spv::AddressingModel addr, spv::MemoryModel mem) { @@ -106,16 +122,25 @@ class Builder { return id; } - // Log the current line, and if different than the last one, - // issue a new OpLine, using the current file name. + // Generate OpLine for non-filename-based #line directives (ie no filename + // seen yet): Log the current line, and if different than the last one, + // issue a new OpLine using the new line and current source file name. void setLine(int line); + + // If filename null, generate OpLine for non-filename-based line directives, + // else do filename-based: Log the current line and file, and if different + // than the last one, issue a new OpLine using the new line and file + // name. + void setLine(int line, const char* filename); // Low-level OpLine. See setLine() for a layered helper. void addLine(Id fileName, int line, int column); // For creating new types (will return old type if the requested one was already made). Id makeVoidType(); Id makeBoolType(); - Id makePointer(StorageClass, Id type); + Id makePointer(StorageClass, Id pointee); + Id makeForwardPointer(StorageClass); + Id makePointerFromForwardPointer(StorageClass, Id forwardPointerType, Id pointee); Id makeIntegerType(int width, bool hasSign); // generic Id makeIntType(int width) { return makeIntegerType(width, true); } Id makeUintType(int width) { return makeIntegerType(width, false); } @@ -171,6 +196,7 @@ class Builder { bool isSamplerType(Id typeId) const { return getTypeClass(typeId) == OpTypeSampler; } bool isSampledImageType(Id typeId) const { return getTypeClass(typeId) == OpTypeSampledImage; } bool containsType(Id typeId, Op typeOp, unsigned int width) const; + bool containsPhysicalStorageBufferOrArray(Id typeId) const; bool isConstantOpCode(Op opcode) const; bool isSpecConstantOpCode(Op opcode) const; @@ -277,10 +303,10 @@ class Builder { Id createUndefined(Id type); // Store into an Id and return the l-value - void createStore(Id rValue, Id lValue, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, spv::Scope scope = spv::ScopeMax); + void createStore(Id rValue, Id lValue, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, spv::Scope scope = spv::ScopeMax, unsigned int alignment = 0); // Load from an Id and return it - Id createLoad(Id lValue, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, spv::Scope scope = spv::ScopeMax); + Id createLoad(Id lValue, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, spv::Scope scope = spv::ScopeMax, unsigned int alignment = 0); // Create an OpAccessChain instruction Id createAccessChain(StorageClass, Id base, const std::vector& offsets); @@ -512,6 +538,7 @@ class Builder { Id component; // a dynamic component index, can coexist with a swizzle, done after the swizzle, NoResult if not present Id preSwizzleBaseType; // dereferenced type, before swizzle or component is applied; NoType unless a swizzle or component is present bool isRValue; // true if 'base' is an r-value, otherwise, base is an l-value + unsigned int alignment; // bitwise OR of alignment values passed in. Accumulates worst alignment. Only tracks base and (optional) component selection alignment. // Accumulate whether anything in the chain of structures has coherent decorations. struct CoherentFlags { @@ -578,31 +605,34 @@ class Builder { } // push offset onto the end of the chain - void accessChainPush(Id offset, AccessChain::CoherentFlags coherentFlags) + void accessChainPush(Id offset, AccessChain::CoherentFlags coherentFlags, unsigned int alignment) { accessChain.indexChain.push_back(offset); accessChain.coherentFlags |= coherentFlags; + accessChain.alignment |= alignment; } // push new swizzle onto the end of any existing swizzle, merging into a single swizzle - void accessChainPushSwizzle(std::vector& swizzle, Id preSwizzleBaseType); + void accessChainPushSwizzle(std::vector& swizzle, Id preSwizzleBaseType, AccessChain::CoherentFlags coherentFlags, unsigned int alignment); // push a dynamic component selection onto the access chain, only applicable with a // non-trivial swizzle or no swizzle - void accessChainPushComponent(Id component, Id preSwizzleBaseType) + void accessChainPushComponent(Id component, Id preSwizzleBaseType, AccessChain::CoherentFlags coherentFlags, unsigned int alignment) { if (accessChain.swizzle.size() != 1) { accessChain.component = component; if (accessChain.preSwizzleBaseType == NoType) accessChain.preSwizzleBaseType = preSwizzleBaseType; } + accessChain.coherentFlags |= coherentFlags; + accessChain.alignment |= alignment; } // use accessChain and swizzle to store value - void accessChainStore(Id rvalue, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, spv::Scope scope = spv::ScopeMax); + void accessChainStore(Id rvalue, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, spv::Scope scope = spv::ScopeMax, unsigned int alignment = 0); // use accessChain and swizzle to load an r-value - Id accessChainLoad(Decoration precision, Decoration nonUniform, Id ResultType, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, spv::Scope scope = spv::ScopeMax); + Id accessChainLoad(Decoration precision, Decoration nonUniform, Id ResultType, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, spv::Scope scope = spv::ScopeMax, unsigned int alignment = 0); // get the direct pointer for an l-value Id accessChainGetLValue(); @@ -616,7 +646,7 @@ class Builder { void postProcess(); // Hook to visit each instruction in a block in a function - void postProcess(const Instruction&); + void postProcess(Instruction&); // Hook to visit each instruction in a reachable block in a function. void postProcessReachable(const Instruction&); // Hook to visit each non-32-bit sized float/int operation in a block. @@ -649,8 +679,10 @@ class Builder { void createAndSetNoPredecessorBlock(const char*); void createSelectionMerge(Block* mergeBlock, unsigned int control); void dumpSourceInstructions(std::vector&) const; + void dumpSourceInstructions(const spv::Id fileId, const std::string& text, std::vector&) const; void dumpInstructions(std::vector&, const std::vector >&) const; void dumpModuleProcesses(std::vector&) const; + spv::MemoryAccessMask sanitizeMemoryAccessForStorageClass(spv::MemoryAccessMask memoryAccess, StorageClass sc) const; unsigned int spvVersion; // the version of SPIR-V to emit in the header SourceLanguage source; @@ -658,6 +690,7 @@ class Builder { spv::Id sourceFileStringId; std::string sourceText; int currentLine; + const char* currentFile; bool emitOpLines; std::set extensions; std::vector sourceExtensions; @@ -695,6 +728,12 @@ class Builder { // Our loop stack. std::stack loops; + // map from strings to their string ids + std::unordered_map stringIds; + + // map from include file name ids to their contents + std::map includeFiles; + // The stream for outputting warnings and errors. SpvBuildLogger* logger; }; // end Builder class diff --git a/deps/glslang/SPIRV/SpvPostProcess.cpp b/deps/glslang/SPIRV/SpvPostProcess.cpp index 5eaedaf6..d4924f64 100644 --- a/deps/glslang/SPIRV/SpvPostProcess.cpp +++ b/deps/glslang/SPIRV/SpvPostProcess.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2016-2018 Google, Inc. +// Copyright (C) 2018 Google, Inc. // // All rights reserved. // @@ -87,6 +87,7 @@ void Builder::postProcessType(const Instruction& inst, Id typeId) StorageClass storageClass = getStorageClass(inst.getIdOperand(0)); if (width == 8) { switch (storageClass) { + case StorageClassPhysicalStorageBufferEXT: case StorageClassUniform: case StorageClassStorageBuffer: case StorageClassPushConstant: @@ -97,6 +98,7 @@ void Builder::postProcessType(const Instruction& inst, Id typeId) } } else if (width == 16) { switch (storageClass) { + case StorageClassPhysicalStorageBufferEXT: case StorageClassUniform: case StorageClassStorageBuffer: case StorageClassPushConstant: @@ -151,7 +153,7 @@ void Builder::postProcessType(const Instruction& inst, Id typeId) } // Called for each instruction that resides in a block. -void Builder::postProcess(const Instruction& inst) +void Builder::postProcess(Instruction& inst) { // Add capabilities based simply on the opcode. switch (inst.getOpCode()) { @@ -190,6 +192,88 @@ void Builder::postProcess(const Instruction& inst) break; #endif + case OpLoad: + case OpStore: + { + // For any load/store to a PhysicalStorageBufferEXT, walk the accesschain + // index list to compute the misalignment. The pre-existing alignment value + // (set via Builder::AccessChain::alignment) only accounts for the base of + // the reference type and any scalar component selection in the accesschain, + // and this function computes the rest from the SPIR-V Offset decorations. + Instruction *accessChain = module.getInstruction(inst.getIdOperand(0)); + if (accessChain->getOpCode() == OpAccessChain) { + Instruction *base = module.getInstruction(accessChain->getIdOperand(0)); + // Get the type of the base of the access chain. It must be a pointer type. + Id typeId = base->getTypeId(); + Instruction *type = module.getInstruction(typeId); + assert(type->getOpCode() == OpTypePointer); + if (type->getImmediateOperand(0) != StorageClassPhysicalStorageBufferEXT) { + break; + } + // Get the pointee type. + typeId = type->getIdOperand(1); + type = module.getInstruction(typeId); + // Walk the index list for the access chain. For each index, find any + // misalignment that can apply when accessing the member/element via + // Offset/ArrayStride/MatrixStride decorations, and bitwise OR them all + // together. + int alignment = 0; + for (int i = 1; i < accessChain->getNumOperands(); ++i) { + Instruction *idx = module.getInstruction(accessChain->getIdOperand(i)); + if (type->getOpCode() == OpTypeStruct) { + assert(idx->getOpCode() == OpConstant); + unsigned int c = idx->getImmediateOperand(0); + + const auto function = [&](const std::unique_ptr& decoration) { + if (decoration.get()->getOpCode() == OpMemberDecorate && + decoration.get()->getIdOperand(0) == typeId && + decoration.get()->getImmediateOperand(1) == c && + (decoration.get()->getImmediateOperand(2) == DecorationOffset || + decoration.get()->getImmediateOperand(2) == DecorationMatrixStride)) { + alignment |= decoration.get()->getImmediateOperand(3); + } + }; + std::for_each(decorations.begin(), decorations.end(), function); + // get the next member type + typeId = type->getIdOperand(c); + type = module.getInstruction(typeId); + } else if (type->getOpCode() == OpTypeArray || + type->getOpCode() == OpTypeRuntimeArray) { + const auto function = [&](const std::unique_ptr& decoration) { + if (decoration.get()->getOpCode() == OpDecorate && + decoration.get()->getIdOperand(0) == typeId && + decoration.get()->getImmediateOperand(1) == DecorationArrayStride) { + alignment |= decoration.get()->getImmediateOperand(2); + } + }; + std::for_each(decorations.begin(), decorations.end(), function); + // Get the element type + typeId = type->getIdOperand(0); + type = module.getInstruction(typeId); + } else { + // Once we get to any non-aggregate type, we're done. + break; + } + } + assert(inst.getNumOperands() >= 3); + unsigned int memoryAccess = inst.getImmediateOperand((inst.getOpCode() == OpStore) ? 2 : 1); + assert(memoryAccess & MemoryAccessAlignedMask); + // Compute the index of the alignment operand. + int alignmentIdx = 2; + if (memoryAccess & MemoryAccessVolatileMask) + alignmentIdx++; + if (inst.getOpCode() == OpStore) + alignmentIdx++; + // Merge new and old (mis)alignment + alignment |= inst.getImmediateOperand(alignmentIdx); + // Pick the LSB + alignment = alignment & ~(alignment & (alignment-1)); + // update the Aligned operand + inst.setImmediateOperand(alignmentIdx, alignment); + } + break; + } + default: break; } @@ -258,6 +342,47 @@ void Builder::postProcess() Block* b = *bi; for (auto ii = b->getInstructions().cbegin(); ii != b->getInstructions().cend(); ii++) postProcess(*ii->get()); + + // For all local variables that contain pointers to PhysicalStorageBufferEXT, check whether + // there is an existing restrict/aliased decoration. If we don't find one, add Aliased as the + // default. + for (auto vi = b->getLocalVariables().cbegin(); vi != b->getLocalVariables().cend(); vi++) { + const Instruction& inst = *vi->get(); + Id resultId = inst.getResultId(); + if (containsPhysicalStorageBufferOrArray(getDerefTypeId(resultId))) { + bool foundDecoration = false; + const auto function = [&](const std::unique_ptr& decoration) { + if (decoration.get()->getIdOperand(0) == resultId && + decoration.get()->getOpCode() == OpDecorate && + (decoration.get()->getImmediateOperand(1) == spv::DecorationAliasedPointerEXT || + decoration.get()->getImmediateOperand(1) == spv::DecorationRestrictPointerEXT)) { + foundDecoration = true; + } + }; + std::for_each(decorations.begin(), decorations.end(), function); + if (!foundDecoration) { + addDecoration(resultId, spv::DecorationAliasedPointerEXT); + } + } + } + } + } + + // Look for any 8/16 bit type in physical storage buffer class, and set the + // appropriate capability. This happens in createSpvVariable for other storage + // classes, but there isn't always a variable for physical storage buffer. + for (int t = 0; t < (int)groupedTypes[OpTypePointer].size(); ++t) { + Instruction* type = groupedTypes[OpTypePointer][t]; + if (type->getImmediateOperand(0) == (unsigned)StorageClassPhysicalStorageBufferEXT) { + if (containsType(type->getIdOperand(1), OpTypeInt, 8)) { + addExtension(spv::E_SPV_KHR_8bit_storage); + addCapability(spv::CapabilityStorageBuffer8BitAccess); + } + if (containsType(type->getIdOperand(1), OpTypeInt, 16) || + containsType(type->getIdOperand(1), OpTypeFloat, 16)) { + addExtension(spv::E_SPV_KHR_16bit_storage); + addCapability(spv::CapabilityStorageBuffer16BitAccess); + } } } } diff --git a/deps/glslang/SPIRV/SpvTools.cpp b/deps/glslang/SPIRV/SpvTools.cpp index 05f234cc..eec06e0a 100644 --- a/deps/glslang/SPIRV/SpvTools.cpp +++ b/deps/glslang/SPIRV/SpvTools.cpp @@ -152,6 +152,13 @@ void SpirvToolsLegalize(const glslang::TIntermediate&, std::vector out << std::endl; }); + // If debug (specifically source line info) is being generated, propagate + // line information into all SPIR-V instructions. This avoids loss of + // information when instructions are deleted or moved. Later, remove + // redundant information to minimize final SPRIR-V size. + if (options->generateDebugInfo) { + optimizer.RegisterPass(spvtools::CreatePropagateLineInfoPass()); + } optimizer.RegisterPass(spvtools::CreateDeadBranchElimPass()); optimizer.RegisterPass(spvtools::CreateMergeReturnPass()); optimizer.RegisterPass(spvtools::CreateInlineExhaustivePass()); @@ -180,8 +187,11 @@ void SpirvToolsLegalize(const glslang::TIntermediate&, std::vector } optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass()); optimizer.RegisterPass(spvtools::CreateCFGCleanupPass()); + if (options->generateDebugInfo) { + optimizer.RegisterPass(spvtools::CreateRedundantLineInfoElimPass()); + } - optimizer.Run(spirv.data(), spirv.size(), &spirv, spvtools::ValidatorOptions(), true); + optimizer.Run(spirv.data(), spirv.size(), &spirv); } }; // end namespace glslang diff --git a/deps/glslang/SPIRV/disassemble.cpp b/deps/glslang/SPIRV/disassemble.cpp index 22c83ea9..631173c0 100644 --- a/deps/glslang/SPIRV/disassemble.cpp +++ b/deps/glslang/SPIRV/disassemble.cpp @@ -540,6 +540,14 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, case OperandMemoryAccess: outputMask(OperandMemoryAccess, stream[word++]); --numOperands; + // Aligned is the only memory access operand that uses an immediate + // value, and it is also the first operand that uses a value at all. + if (stream[word-1] & MemoryAccessAlignedMask) { + disassembleImmediates(1); + numOperands--; + if (numOperands) + out << " "; + } disassembleIds(numOperands); return; default: diff --git a/deps/glslang/SPIRV/doc.cpp b/deps/glslang/SPIRV/doc.cpp index 4f7c1989..bd6df107 100644 --- a/deps/glslang/SPIRV/doc.cpp +++ b/deps/glslang/SPIRV/doc.cpp @@ -124,6 +124,8 @@ const char* AddressingString(int addr) case 1: return "Physical32"; case 2: return "Physical64"; + case AddressingModelPhysicalStorageBuffer64EXT: return "PhysicalStorageBuffer64EXT"; + default: return "Bad"; } } @@ -220,6 +222,8 @@ const char* StorageClassString(int StorageClass) case StorageClassIncomingCallableDataNV: return "IncomingCallableDataNV"; #endif + case StorageClassPhysicalStorageBufferEXT: return "PhysicalStorageBufferEXT"; + default: return "Bad"; } } @@ -295,6 +299,8 @@ const char* DecorationString(int decoration) case DecorationNonUniformEXT: return "DecorationNonUniformEXT"; case DecorationHlslCounterBufferGOOGLE: return "DecorationHlslCounterBufferGOOGLE"; case DecorationHlslSemanticGOOGLE: return "DecorationHlslSemanticGOOGLE"; + case DecorationRestrictPointerEXT: return "DecorationRestrictPointerEXT"; + case DecorationAliasedPointerEXT: return "DecorationAliasedPointerEXT"; } } @@ -388,12 +394,15 @@ const char* BuiltInString(int builtIn) case BuiltInSecondaryViewportMaskNV: return "SecondaryViewportMaskNV"; case BuiltInPositionPerViewNV: return "PositionPerViewNV"; case BuiltInViewportMaskPerViewNV: return "ViewportMaskPerViewNV"; - case BuiltInFragmentSizeNV: return "FragmentSizeNV"; - case BuiltInInvocationsPerPixelNV: return "InvocationsPerPixelNV"; +// case BuiltInFragmentSizeNV: return "FragmentSizeNV"; // superseded by BuiltInFragSizeEXT +// case BuiltInInvocationsPerPixelNV: return "InvocationsPerPixelNV"; // superseded by BuiltInFragInvocationCountEXT case BuiltInBaryCoordNV: return "BaryCoordNV"; case BuiltInBaryCoordNoPerspNV: return "BaryCoordNoPerspNV"; #endif + case BuiltInFragSizeEXT: return "FragSizeEXT"; + case BuiltInFragInvocationCountEXT: return "FragInvocationCountEXT"; + case 5264: return "FullyCoveredEXT"; @@ -897,8 +906,9 @@ const char* CapabilityString(int info) case CapabilityComputeDerivativeGroupLinearNV: return "ComputeDerivativeGroupLinearNV"; case CapabilityFragmentBarycentricNV: return "FragmentBarycentricNV"; case CapabilityMeshShadingNV: return "MeshShadingNV"; - case CapabilityShadingRateNV: return "ShadingRateNV"; +// case CapabilityShadingRateNV: return "ShadingRateNV"; // superseded by CapabilityFragmentDensityEXT #endif + case CapabilityFragmentDensityEXT: return "FragmentDensityEXT"; case CapabilityFragmentFullyCoveredEXT: return "FragmentFullyCoveredEXT"; @@ -918,6 +928,8 @@ const char* CapabilityString(int info) case CapabilityVulkanMemoryModelKHR: return "CapabilityVulkanMemoryModelKHR"; case CapabilityVulkanMemoryModelDeviceScopeKHR: return "CapabilityVulkanMemoryModelDeviceScopeKHR"; + case CapabilityPhysicalStorageBufferAddressesEXT: return "CapabilityPhysicalStorageBufferAddressesEXT"; + default: return "Bad"; } } diff --git a/deps/glslang/SPIRV/spirv.hpp b/deps/glslang/SPIRV/spirv.hpp index 25b5ce9e..44d06168 100644 --- a/deps/glslang/SPIRV/spirv.hpp +++ b/deps/glslang/SPIRV/spirv.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2014-2018 The Khronos Group Inc. +// Copyright (c) 2014-2019 The Khronos Group Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and/or associated documentation files (the "Materials"), @@ -26,13 +26,16 @@ // the Binary Section of the SPIR-V specification. // Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python +// C, C++, C++11, JSON, Lua, Python, C#, D // // - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL // - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL // - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL // - Lua will use tables, e.g.: spv.SourceLanguage.GLSL // - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +// - C# will use enum classes in the Specification class located in the "Spv" namespace, +// e.g.: Spv.Specification.SourceLanguage.GLSL +// - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL // // Some tokens act like mask values, which can be OR'd together, // while others are mutually exclusive. The mask-like ones have @@ -47,11 +50,11 @@ namespace spv { typedef unsigned int Id; #define SPV_VERSION 0x10300 -#define SPV_REVISION 1 +#define SPV_REVISION 6 static const unsigned int MagicNumber = 0x07230203; static const unsigned int Version = 0x00010300; -static const unsigned int Revision = 1; +static const unsigned int Revision = 6; static const unsigned int OpCodeMask = 0xffff; static const unsigned int WordCountShift = 16; @@ -88,6 +91,7 @@ enum AddressingModel { AddressingModelLogical = 0, AddressingModelPhysical32 = 1, AddressingModelPhysical64 = 2, + AddressingModelPhysicalStorageBuffer64EXT = 5348, AddressingModelMax = 0x7fffffff, }; @@ -139,6 +143,11 @@ enum ExecutionMode { ExecutionModeLocalSizeId = 38, ExecutionModeLocalSizeHintId = 39, ExecutionModePostDepthCoverage = 4446, + ExecutionModeDenormPreserve = 4459, + ExecutionModeDenormFlushToZero = 4460, + ExecutionModeSignedZeroInfNanPreserve = 4461, + ExecutionModeRoundingModeRTE = 4462, + ExecutionModeRoundingModeRTZ = 4463, ExecutionModeStencilRefReplacingEXT = 5027, ExecutionModeOutputLinesNV = 5269, ExecutionModeOutputPrimitivesNV = 5270, @@ -168,6 +177,7 @@ enum StorageClass { StorageClassHitAttributeNV = 5339, StorageClassIncomingRayPayloadNV = 5342, StorageClassShaderRecordBufferNV = 5343, + StorageClassPhysicalStorageBufferEXT = 5349, StorageClassMax = 0x7fffffff, }; @@ -416,6 +426,8 @@ enum Decoration { DecorationMaxByteOffset = 45, DecorationAlignmentId = 46, DecorationMaxByteOffsetId = 47, + DecorationNoSignedWrap = 4469, + DecorationNoUnsignedWrap = 4470, DecorationExplicitInterpAMD = 4999, DecorationOverrideCoverageNV = 5248, DecorationPassthroughNV = 5250, @@ -426,6 +438,8 @@ enum Decoration { DecorationPerTaskNV = 5273, DecorationPerVertexNV = 5285, DecorationNonUniformEXT = 5300, + DecorationRestrictPointerEXT = 5355, + DecorationAliasedPointerEXT = 5356, DecorationHlslCounterBufferGOOGLE = 5634, DecorationHlslSemanticGOOGLE = 5635, DecorationMax = 0x7fffffff, @@ -512,7 +526,9 @@ enum BuiltIn { BuiltInMeshViewIndicesNV = 5281, BuiltInBaryCoordNV = 5286, BuiltInBaryCoordNoPerspNV = 5287, + BuiltInFragSizeEXT = 5292, BuiltInFragmentSizeNV = 5292, + BuiltInFragInvocationCountEXT = 5293, BuiltInInvocationsPerPixelNV = 5293, BuiltInLaunchIdNV = 5319, BuiltInLaunchSizeNV = 5320, @@ -753,6 +769,11 @@ enum Capability { CapabilityStorageBuffer8BitAccess = 4448, CapabilityUniformAndStorageBuffer8BitAccess = 4449, CapabilityStoragePushConstant8 = 4450, + CapabilityDenormPreserve = 4464, + CapabilityDenormFlushToZero = 4465, + CapabilitySignedZeroInfNanPreserve = 4466, + CapabilityRoundingModeRTE = 4467, + CapabilityRoundingModeRTZ = 4468, CapabilityFloat16ImageAMD = 5008, CapabilityImageGatherBiasLodAMD = 5009, CapabilityFragmentMaskAMD = 5010, @@ -770,6 +791,7 @@ enum Capability { CapabilityImageFootprintNV = 5282, CapabilityFragmentBarycentricNV = 5284, CapabilityComputeDerivativeGroupQuadsNV = 5288, + CapabilityFragmentDensityEXT = 5291, CapabilityShadingRateNV = 5291, CapabilityGroupNonUniformPartitionedNV = 5297, CapabilityShaderNonUniformEXT = 5301, @@ -787,6 +809,7 @@ enum Capability { CapabilityRayTracingNV = 5340, CapabilityVulkanMemoryModelKHR = 5345, CapabilityVulkanMemoryModelDeviceScopeKHR = 5346, + CapabilityPhysicalStorageBufferAddressesEXT = 5347, CapabilityComputeDerivativeGroupLinearNV = 5350, CapabilitySubgroupShuffleINTEL = 5568, CapabilitySubgroupBufferBlockIOINTEL = 5569, diff --git a/deps/glslang/SPIRV/spvIR.h b/deps/glslang/SPIRV/spvIR.h index 2532b178..8c2d0b6f 100644 --- a/deps/glslang/SPIRV/spvIR.h +++ b/deps/glslang/SPIRV/spvIR.h @@ -1,5 +1,6 @@ // // Copyright (C) 2014 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. // // All rights reserved. // @@ -101,6 +102,11 @@ class Instruction { operands.push_back(immediate); idOperand.push_back(false); } + void setImmediateOperand(unsigned idx, unsigned int immediate) { + assert(!idOperand[idx]); + operands[idx] = immediate; + } + void addStringOperand(const char* str) { unsigned int word; @@ -202,6 +208,7 @@ class Block { const std::vector >& getInstructions() const { return instructions; } + const std::vector >& getLocalVariables() const { return localVariables; } void setUnreachable() { unreachable = true; } bool isUnreachable() const { return unreachable; } // Returns the block's merge instruction, if one exists (otherwise null). diff --git a/deps/glslang/StandAlone/ResourceLimits.h b/deps/glslang/StandAlone/ResourceLimits.h index 9c3eb3e9..736248eb 100644 --- a/deps/glslang/StandAlone/ResourceLimits.h +++ b/deps/glslang/StandAlone/ResourceLimits.h @@ -37,7 +37,7 @@ #include -#include "glslang/Include/ResourceLimits.h" +#include "../glslang/Include/ResourceLimits.h" namespace glslang { diff --git a/deps/glslang/StandAlone/StandAlone.cpp b/deps/glslang/StandAlone/StandAlone.cpp index 060428bf..42a46cee 100644 --- a/deps/glslang/StandAlone/StandAlone.cpp +++ b/deps/glslang/StandAlone/StandAlone.cpp @@ -160,6 +160,7 @@ const char* sourceEntryPointName = nullptr; const char* shaderStageName = nullptr; const char* variableName = nullptr; bool HlslEnable16BitTypes = false; +bool HlslDX9compatible = false; std::vector IncludeDirectoryList; // Source environment @@ -509,6 +510,8 @@ void ProcessArguments(std::vector>& workItem Options |= EOptionHlslIoMapping; } else if (lowerword == "hlsl-enable-16bit-types") { HlslEnable16BitTypes = true; + } else if (lowerword == "hlsl-dx9-compatible") { + HlslDX9compatible = true; } else if (lowerword == "invert-y" || // synonyms lowerword == "iy") { Options |= EOptionInvertY; @@ -815,6 +818,8 @@ void SetMessageOptions(EShMessages& messages) messages = (EShMessages)(messages | EShMsgHlslEnable16BitTypes); if ((Options & EOptionOptimizeDisable) || !ENABLE_OPT) messages = (EShMessages)(messages | EShMsgHlslLegalization); + if (HlslDX9compatible) + messages = (EShMessages)(messages | EShMsgHlslDX9Compatible); } // @@ -1509,6 +1514,7 @@ void usage() " works independently of source language\n" " --hlsl-iomap perform IO mapping in HLSL register space\n" " --hlsl-enable-16bit-types allow 16-bit types in SPIR-V for HLSL\n" + " --hlsl-dx9-compatible interprets sampler declarations as a texture/sampler combo like DirectX9 would." " --invert-y | --iy invert position.Y output in vertex shader\n" " --keep-uncalled | --ku don't eliminate uncalled functions\n" " --no-storage-format | --nsf use Unknown image format\n" diff --git a/deps/glslang/Test/300samplerExternalYUV.frag b/deps/glslang/Test/300samplerExternalYUV.frag new file mode 100644 index 00000000..add21285 --- /dev/null +++ b/deps/glslang/Test/300samplerExternalYUV.frag @@ -0,0 +1,38 @@ +#version 300 es + +#extension GL_EXT_YUV_target : enable + +uniform __samplerExternal2DY2YEXT sExt; +precision mediump __samplerExternal2DY2YEXT; +uniform __samplerExternal2DY2YEXT mediumExt; +uniform highp __samplerExternal2DY2YEXT highExt; + +void main() +{ + texture2D(sExt, vec2(0.2)); // ERROR + texture2D(mediumExt, vec2(0.2)); // ERROR + texture2D(highExt, vec2(0.2)); // ERROR + texture2DProj(sExt, vec3(0.3)); // ERROR + texture2DProj(sExt, vec4(0.3)); // ERROR + + int lod = 0; + highp float bias = 0.01; + textureSize(sExt, lod); + texture(sExt, vec2(0.2)); + texture(sExt, vec2(0.2), bias); + textureProj(sExt, vec3(0.2)); + textureProj(sExt, vec3(0.2), bias); + textureProj(sExt, vec4(0.2)); + textureProj(sExt, vec4(0.2), bias); + texelFetch(sExt, ivec2(4), lod); + + texture3D(sExt, vec3(0.3)); // ERROR + texture2DProjLod(sExt, vec3(0.3), 0.3); // ERROR + texture(sExt, vec3(0.3)); // ERROR + textureProjLod(sExt, vec3(0.3), 0.3); // ERROR +} + +#extension GL_EXT_YUV_target : disable + +uniform __samplerExternal2DY2YEXT badExt; // ERROR + diff --git a/deps/glslang/Test/baseLegalResults/hlsl.aliasOpaque.frag.out b/deps/glslang/Test/baseLegalResults/hlsl.aliasOpaque.frag.out index e65ee7ba..2e58bdd0 100644 --- a/deps/glslang/Test/baseLegalResults/hlsl.aliasOpaque.frag.out +++ b/deps/glslang/Test/baseLegalResults/hlsl.aliasOpaque.frag.out @@ -14,7 +14,9 @@ hlsl.aliasOpaque.frag Name 51 "gtex" Name 62 "@entryPointOutput" Decorate 47(gss) DescriptorSet 0 + Decorate 47(gss) Binding 0 Decorate 51(gtex) DescriptorSet 0 + Decorate 51(gtex) Binding 0 Decorate 62(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseLegalResults/hlsl.flattenOpaque.frag.out b/deps/glslang/Test/baseLegalResults/hlsl.flattenOpaque.frag.out index cf3fbabc..d334b7e6 100644 --- a/deps/glslang/Test/baseLegalResults/hlsl.flattenOpaque.frag.out +++ b/deps/glslang/Test/baseLegalResults/hlsl.flattenOpaque.frag.out @@ -16,9 +16,13 @@ hlsl.flattenOpaque.frag Name 100 "s2.tex" Name 120 "@entryPointOutput" Decorate 38(tex) DescriptorSet 0 + Decorate 38(tex) Binding 0 Decorate 82(s.s2D) DescriptorSet 0 + Decorate 82(s.s2D) Binding 0 Decorate 97(s2.s2D) DescriptorSet 0 + Decorate 97(s2.s2D) Binding 0 Decorate 100(s2.tex) DescriptorSet 0 + Decorate 100(s2.tex) Binding 0 Decorate 120(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out b/deps/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out index bec5aa22..921cb96a 100644 --- a/deps/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out +++ b/deps/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out @@ -13,7 +13,9 @@ hlsl.flattenOpaqueInit.vert Name 47 "g_tInputTexture" Name 80 "@entryPointOutput" Decorate 43(g_tInputTexture_sampler) DescriptorSet 0 + Decorate 43(g_tInputTexture_sampler) Binding 0 Decorate 47(g_tInputTexture) DescriptorSet 0 + Decorate 47(g_tInputTexture) Binding 0 Decorate 80(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out b/deps/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out index 14d0cd3f..39770f45 100644 --- a/deps/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out +++ b/deps/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out @@ -13,7 +13,9 @@ hlsl.flattenOpaqueInitMix.vert Name 47 "g_tInputTexture" Name 57 "@entryPointOutput" Decorate 44(g_tInputTexture_sampler) DescriptorSet 0 + Decorate 44(g_tInputTexture_sampler) Binding 0 Decorate 47(g_tInputTexture) DescriptorSet 0 + Decorate 47(g_tInputTexture) Binding 0 Decorate 57(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseLegalResults/hlsl.flattenSubset.frag.out b/deps/glslang/Test/baseLegalResults/hlsl.flattenSubset.frag.out index 143c96c5..4628479a 100644 --- a/deps/glslang/Test/baseLegalResults/hlsl.flattenSubset.frag.out +++ b/deps/glslang/Test/baseLegalResults/hlsl.flattenSubset.frag.out @@ -15,7 +15,9 @@ hlsl.flattenSubset.frag Name 47 "vpos" Name 50 "@entryPointOutput" Decorate 21(samp) DescriptorSet 0 + Decorate 21(samp) Binding 0 Decorate 33(tex) DescriptorSet 0 + Decorate 33(tex) Binding 0 Decorate 47(vpos) Location 0 Decorate 50(@entryPointOutput) Location 0 2: TypeVoid diff --git a/deps/glslang/Test/baseResults/120.frag.out b/deps/glslang/Test/baseResults/120.frag.out index 8909f16f..835cd9e7 100644 --- a/deps/glslang/Test/baseResults/120.frag.out +++ b/deps/glslang/Test/baseResults/120.frag.out @@ -54,8 +54,8 @@ ERROR: 0:244: ':' : wrong operand types: no operation ':' exists that takes a l ERROR: 0:245: ':' : wrong operand types: no operation ':' exists that takes a left-hand operand of type ' const int' and a right operand of type ' global void' (or there is no acceptable conversion) ERROR: 0:248: 'half floating-point suffix' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:248: '' : syntax error, unexpected IDENTIFIER, expecting COMMA or SEMICOLON ERROR: 55 compilation errors. No code generated. diff --git a/deps/glslang/Test/baseResults/300.vert.out b/deps/glslang/Test/baseResults/300.vert.out index 95ebb92e..d8c9e16b 100644 --- a/deps/glslang/Test/baseResults/300.vert.out +++ b/deps/glslang/Test/baseResults/300.vert.out @@ -39,7 +39,7 @@ ERROR: 0:168: 'Binst' : cannot add storage, auxiliary, memory, interpolation, la ERROR: 0:169: 'Bblock' : cannot add storage, auxiliary, memory, interpolation, layout, or precision qualifier to an existing variable ERROR: 0:170: 'Bfoo' : cannot add storage, auxiliary, memory, interpolation, layout, or precision qualifier to an existing variable ERROR: 0:172: 'std430' : not supported for this version or the enabled extensions -ERROR: 0:172: 'std430' : requires the 'buffer' storage qualifier +ERROR: 0:172: 'std430 requires the buffer storage qualifier' : required extension not requested: GL_EXT_scalar_block_layout ERROR: 0:175: '' : array size required ERROR: 0:185: 'assign' : cannot convert from ' temp 4-element array of highp float' to ' temp 3-element array of highp float' ERROR: 0:186: 'assign' : cannot convert from ' temp 3-element array of highp float' to ' temp 4-element array of highp float' diff --git a/deps/glslang/Test/baseResults/300samplerExternalYUV.frag.out b/deps/glslang/Test/baseResults/300samplerExternalYUV.frag.out new file mode 100644 index 00000000..b76e706f --- /dev/null +++ b/deps/glslang/Test/baseResults/300samplerExternalYUV.frag.out @@ -0,0 +1,192 @@ +300samplerExternalYUV.frag +ERROR: 0:12: 'texture2D' : no matching overloaded function found +ERROR: 0:13: 'texture2D' : no matching overloaded function found +ERROR: 0:14: 'texture2D' : no matching overloaded function found +ERROR: 0:15: 'texture2DProj' : no matching overloaded function found +ERROR: 0:16: 'texture2DProj' : no matching overloaded function found +ERROR: 0:29: 'texture3D' : no matching overloaded function found +ERROR: 0:30: 'texture2DProjLod' : no matching overloaded function found +ERROR: 0:31: 'texture' : no matching overloaded function found +ERROR: 0:32: 'textureProjLod' : no matching overloaded function found +ERROR: 0:37: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON +ERROR: 10 compilation errors. No code generated. + + +Shader version: 300 +Requested GL_EXT_YUV_target +ERROR: node is still EOpNull! +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 Constant: +0:12 0.000000 +0:13 Constant: +0:13 0.000000 +0:14 Constant: +0:14 0.000000 +0:15 Constant: +0:15 0.000000 +0:16 Constant: +0:16 0.000000 +0:18 Sequence +0:18 move second child to first child ( temp mediump int) +0:18 'lod' ( temp mediump int) +0:18 Constant: +0:18 0 (const int) +0:19 Sequence +0:19 move second child to first child ( temp highp float) +0:19 'bias' ( temp highp float) +0:19 Constant: +0:19 0.010000 +0:20 textureSize ( global highp 2-component vector of int, operation at mediump) +0:20 'sExt' ( uniform lowp __samplerExternal2DY2YEXT) +0:20 'lod' ( temp mediump int) +0:21 texture ( global lowp 4-component vector of float) +0:21 'sExt' ( uniform lowp __samplerExternal2DY2YEXT) +0:21 Constant: +0:21 0.200000 +0:21 0.200000 +0:22 texture ( global lowp 4-component vector of float, operation at highp) +0:22 'sExt' ( uniform lowp __samplerExternal2DY2YEXT) +0:22 Constant: +0:22 0.200000 +0:22 0.200000 +0:22 'bias' ( temp highp float) +0:23 textureProj ( global lowp 4-component vector of float) +0:23 'sExt' ( uniform lowp __samplerExternal2DY2YEXT) +0:23 Constant: +0:23 0.200000 +0:23 0.200000 +0:23 0.200000 +0:24 textureProj ( global lowp 4-component vector of float, operation at highp) +0:24 'sExt' ( uniform lowp __samplerExternal2DY2YEXT) +0:24 Constant: +0:24 0.200000 +0:24 0.200000 +0:24 0.200000 +0:24 'bias' ( temp highp float) +0:25 textureProj ( global lowp 4-component vector of float) +0:25 'sExt' ( uniform lowp __samplerExternal2DY2YEXT) +0:25 Constant: +0:25 0.200000 +0:25 0.200000 +0:25 0.200000 +0:25 0.200000 +0:26 textureProj ( global lowp 4-component vector of float, operation at highp) +0:26 'sExt' ( uniform lowp __samplerExternal2DY2YEXT) +0:26 Constant: +0:26 0.200000 +0:26 0.200000 +0:26 0.200000 +0:26 0.200000 +0:26 'bias' ( temp highp float) +0:27 textureFetch ( global lowp 4-component vector of float, operation at mediump) +0:27 'sExt' ( uniform lowp __samplerExternal2DY2YEXT) +0:27 Constant: +0:27 4 (const int) +0:27 4 (const int) +0:27 'lod' ( temp mediump int) +0:29 Constant: +0:29 0.000000 +0:30 Constant: +0:30 0.000000 +0:31 Constant: +0:31 0.000000 +0:32 Constant: +0:32 0.000000 +0:? Linker Objects +0:? 'sExt' ( uniform lowp __samplerExternal2DY2YEXT) +0:? 'mediumExt' ( uniform mediump __samplerExternal2DY2YEXT) +0:? 'highExt' ( uniform highp __samplerExternal2DY2YEXT) + + +Linked fragment stage: + + +Shader version: 300 +Requested GL_EXT_YUV_target +ERROR: node is still EOpNull! +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 Constant: +0:12 0.000000 +0:13 Constant: +0:13 0.000000 +0:14 Constant: +0:14 0.000000 +0:15 Constant: +0:15 0.000000 +0:16 Constant: +0:16 0.000000 +0:18 Sequence +0:18 move second child to first child ( temp mediump int) +0:18 'lod' ( temp mediump int) +0:18 Constant: +0:18 0 (const int) +0:19 Sequence +0:19 move second child to first child ( temp highp float) +0:19 'bias' ( temp highp float) +0:19 Constant: +0:19 0.010000 +0:20 textureSize ( global highp 2-component vector of int, operation at mediump) +0:20 'sExt' ( uniform lowp __samplerExternal2DY2YEXT) +0:20 'lod' ( temp mediump int) +0:21 texture ( global lowp 4-component vector of float) +0:21 'sExt' ( uniform lowp __samplerExternal2DY2YEXT) +0:21 Constant: +0:21 0.200000 +0:21 0.200000 +0:22 texture ( global lowp 4-component vector of float, operation at highp) +0:22 'sExt' ( uniform lowp __samplerExternal2DY2YEXT) +0:22 Constant: +0:22 0.200000 +0:22 0.200000 +0:22 'bias' ( temp highp float) +0:23 textureProj ( global lowp 4-component vector of float) +0:23 'sExt' ( uniform lowp __samplerExternal2DY2YEXT) +0:23 Constant: +0:23 0.200000 +0:23 0.200000 +0:23 0.200000 +0:24 textureProj ( global lowp 4-component vector of float, operation at highp) +0:24 'sExt' ( uniform lowp __samplerExternal2DY2YEXT) +0:24 Constant: +0:24 0.200000 +0:24 0.200000 +0:24 0.200000 +0:24 'bias' ( temp highp float) +0:25 textureProj ( global lowp 4-component vector of float) +0:25 'sExt' ( uniform lowp __samplerExternal2DY2YEXT) +0:25 Constant: +0:25 0.200000 +0:25 0.200000 +0:25 0.200000 +0:25 0.200000 +0:26 textureProj ( global lowp 4-component vector of float, operation at highp) +0:26 'sExt' ( uniform lowp __samplerExternal2DY2YEXT) +0:26 Constant: +0:26 0.200000 +0:26 0.200000 +0:26 0.200000 +0:26 0.200000 +0:26 'bias' ( temp highp float) +0:27 textureFetch ( global lowp 4-component vector of float, operation at mediump) +0:27 'sExt' ( uniform lowp __samplerExternal2DY2YEXT) +0:27 Constant: +0:27 4 (const int) +0:27 4 (const int) +0:27 'lod' ( temp mediump int) +0:29 Constant: +0:29 0.000000 +0:30 Constant: +0:30 0.000000 +0:31 Constant: +0:31 0.000000 +0:32 Constant: +0:32 0.000000 +0:? Linker Objects +0:? 'sExt' ( uniform lowp __samplerExternal2DY2YEXT) +0:? 'mediumExt' ( uniform mediump __samplerExternal2DY2YEXT) +0:? 'highExt' ( uniform highp __samplerExternal2DY2YEXT) + diff --git a/deps/glslang/Test/baseResults/310.vert.out b/deps/glslang/Test/baseResults/310.vert.out index 21fa27b9..baf09870 100644 --- a/deps/glslang/Test/baseResults/310.vert.out +++ b/deps/glslang/Test/baseResults/310.vert.out @@ -15,7 +15,7 @@ ERROR: 0:78: 'vertex-shader array-of-struct output' : not supported with this pr ERROR: 0:79: 'vertex-shader array-of-struct output' : not supported with this profile: es ERROR: 0:81: 'vertex-shader struct output containing an array' : not supported with this profile: es ERROR: 0:83: 'vertex-shader struct output containing structure' : not supported with this profile: es -ERROR: 0:85: 'std430' : requires the 'buffer' storage qualifier +ERROR: 0:85: 'std430 requires the buffer storage qualifier' : required extension not requested: GL_EXT_scalar_block_layout ERROR: 0:97: 's' : member of block cannot be or contain a sampler, image, or atomic_uint type ERROR: 0:105: 'location' : overlapping use of location 12 ERROR: 0:107: 'input block' : not supported in this stage: vertex diff --git a/deps/glslang/Test/baseResults/420.vert.out b/deps/glslang/Test/baseResults/420.vert.out index 25bce16c..22577ab0 100644 --- a/deps/glslang/Test/baseResults/420.vert.out +++ b/deps/glslang/Test/baseResults/420.vert.out @@ -46,7 +46,7 @@ ERROR: 0:142: 'r8_snorm' : does not apply to signed integer images ERROR: 0:143: 'rgba32ui' : does not apply to signed integer images ERROR: 0:144: 'r8ui' : does not apply to signed integer images ERROR: 0:147: 'offset on block member' : not supported for this version or the enabled extensions -ERROR: 0:147: 'offset/align' : can only be used with std140 or std430 layout packing +ERROR: 0:147: 'offset/align' : can only be used with std140, std430, or scalar layout packing ERROR: 0:157: 'textureQueryLevels' : no matching overloaded function found ERROR: 0:157: 'assign' : cannot convert from ' const float' to ' temp int' ERROR: 0:158: 'textureQueryLevels' : no matching overloaded function found diff --git a/deps/glslang/Test/baseResults/430.vert.out b/deps/glslang/Test/baseResults/430.vert.out index 29ffb01a..f57a39c1 100644 --- a/deps/glslang/Test/baseResults/430.vert.out +++ b/deps/glslang/Test/baseResults/430.vert.out @@ -27,9 +27,9 @@ ERROR: 0:64: 'uniform buffer-member align' : not supported for this version or t ERROR: 0:65: 'uniform buffer-member align' : not supported for this version or the enabled extensions ERROR: 0:65: 'offset on block member' : not supported for this version or the enabled extensions ERROR: 0:66: 'offset on block member' : not supported for this version or the enabled extensions -ERROR: 0:64: 'align' : can only be used with std140 or std430 layout packing -ERROR: 0:65: 'offset/align' : can only be used with std140 or std430 layout packing -ERROR: 0:66: 'offset/align' : can only be used with std140 or std430 layout packing +ERROR: 0:64: 'align' : can only be used with std140, std430, or scalar layout packing +ERROR: 0:65: 'offset/align' : can only be used with std140, std430, or scalar layout packing +ERROR: 0:66: 'offset/align' : can only be used with std140, std430, or scalar layout packing ERROR: 0:71: 'offset on block member' : not supported for this version or the enabled extensions ERROR: 0:74: 'gl_MaxTransformFeedbackBuffers' : required extension not requested: GL_ARB_enhanced_layouts ERROR: 0:75: 'gl_MaxTransformFeedbackInterleavedComponents' : required extension not requested: GL_ARB_enhanced_layouts diff --git a/deps/glslang/Test/baseResults/440.frag.out b/deps/glslang/Test/baseResults/440.frag.out index 18e014f9..1ac6e7c6 100644 --- a/deps/glslang/Test/baseResults/440.frag.out +++ b/deps/glslang/Test/baseResults/440.frag.out @@ -21,11 +21,11 @@ ERROR: 0:38: 'offset' : only applies to block members, not blocks ERROR: 0:39: 'output block' : not supported in this stage: fragment ERROR: 0:39: 'layout' : offset/align can only be used on a uniform or buffer ERROR: 0:39: 'offset' : only applies to block members, not blocks -ERROR: 0:42: 'align' : can only be used with std140 or std430 layout packing -ERROR: 0:43: 'align' : can only be used with std140 or std430 layout packing +ERROR: 0:42: 'align' : can only be used with std140, std430, or scalar layout packing +ERROR: 0:43: 'align' : can only be used with std140, std430, or scalar layout packing ERROR: 0:43: 'layout' : offset/align can only be used on a uniform or buffer ERROR: 0:44: 'output block' : not supported in this stage: fragment -ERROR: 0:44: 'align' : can only be used with std140 or std430 layout packing +ERROR: 0:44: 'align' : can only be used with std140, std430, or scalar layout packing ERROR: 0:44: 'layout' : offset/align can only be used on a uniform or buffer ERROR: 0:46: 'offset' : cannot specify on a variable declaration ERROR: 0:47: 'layout' : offset/align can only be used on a uniform or buffer @@ -36,9 +36,9 @@ ERROR: 0:52: 'layout' : offset/align can only be used on a uniform or buffer ERROR: 0:54: 'layout' : matrix or packing qualifiers can only be used on a uniform or buffer ERROR: 0:55: 'layout' : cannot specify packing on a variable declaration ERROR: 0:57: 'align' : must be a power of 2 -ERROR: 0:58: 'offset/align' : can only be used with std140 or std430 layout packing -ERROR: 0:62: 'offset/align' : can only be used with std140 or std430 layout packing -ERROR: 0:63: 'offset/align' : can only be used with std140 or std430 layout packing +ERROR: 0:58: 'offset/align' : can only be used with std140, std430, or scalar layout packing +ERROR: 0:62: 'offset/align' : can only be used with std140, std430, or scalar layout packing +ERROR: 0:63: 'offset/align' : can only be used with std140, std430, or scalar layout packing ERROR: 0:62: 'layout' : offset/align can only be used on a uniform or buffer ERROR: 0:63: 'layout' : offset/align can only be used on a uniform or buffer ERROR: 0:84: 'align' : must be a power of 2 diff --git a/deps/glslang/Test/baseResults/440.vert.out b/deps/glslang/Test/baseResults/440.vert.out index 41796cb5..5af757ab 100644 --- a/deps/glslang/Test/baseResults/440.vert.out +++ b/deps/glslang/Test/baseResults/440.vert.out @@ -39,9 +39,9 @@ ERROR: 0:131: 'xfb_stride' : all stride settings must match for xfb buffer 3 ERROR: 0:152: 'xfb_offset' : overlapping offsets at offset 64 in buffer 0 ERROR: 0:157: 'xfb_buffer' : buffer is too large: gl_MaxTransformFeedbackBuffers is 4 ERROR: 0:158: 'xfb_offset' : must be a multiple of size of first component -ERROR: 0:159: 'xfb_offset' : type contains double; xfb_offset must be a multiple of 8 +ERROR: 0:159: 'xfb_offset' : type contains double or 64-bit integer; xfb_offset must be a multiple of 8 ERROR: 0:161: 'xfb_offset' : must be a multiple of size of first component -ERROR: 0:162: 'xfb_offset' : type contains double; xfb_offset must be a multiple of 8 +ERROR: 0:162: 'xfb_offset' : type contains double or 64-bit integer; xfb_offset must be a multiple of 8 ERROR: 0:166: 'xfb_buffer' : buffer is too large: gl_MaxTransformFeedbackBuffers is 4 ERROR: 0:169: 'xfb_buffer' : buffer is too large: gl_MaxTransformFeedbackBuffers is 4 ERROR: 0:169: 'xfb_stride' : 1/4 stride is too large: gl_MaxTransformFeedbackInterleavedComponents is 64 @@ -166,11 +166,13 @@ Linked vertex stage: ERROR: Linking vertex stage: Missing entry point: Each stage requires one entry point ERROR: Linking vertex stage: xfb_stride is too small to hold all buffer entries: ERROR: xfb_buffer 0, xfb_stride 92, minimum stride needed: 96 -ERROR: Linking vertex stage: xfb_stride must be multiple of 8 for buffer holding a double: +ERROR: Linking vertex stage: xfb_stride must be multiple of 8 for buffer holding a double or 64-bit integer: ERROR: xfb_buffer 0, xfb_stride 92 ERROR: Linking vertex stage: xfb_stride must be multiple of 4: ERROR: xfb_buffer 5, xfb_stride 6 ERROR: Linking vertex stage: xfb_stride is too large: +ERROR: xfb_buffer 6, components (1/4 stride) needed are 500, gl_MaxTransformFeedbackInterleavedComponents is 64 +ERROR: Linking vertex stage: xfb_stride is too large: ERROR: xfb_buffer 7, components (1/4 stride) needed are 66, gl_MaxTransformFeedbackInterleavedComponents is 64 Shader version: 440 diff --git a/deps/glslang/Test/baseResults/constantUnaryConversion.comp.out b/deps/glslang/Test/baseResults/constantUnaryConversion.comp.out new file mode 100644 index 00000000..4117e93f --- /dev/null +++ b/deps/glslang/Test/baseResults/constantUnaryConversion.comp.out @@ -0,0 +1,645 @@ +constantUnaryConversion.comp +Shader version: 450 +Requested GL_EXT_shader_explicit_arithmetic_types +local_size = (1, 1, 1) +0:? Sequence +0:48 Function Definition: main( ( global void) +0:48 Function Parameters: +0:? Linker Objects +0:? 'bool_init' ( const bool) +0:? true (const bool) +0:? 'int8_t_init' ( const int8_t) +0:? -1 (const int) +0:? 'int16_t_init' ( const int16_t) +0:? -2 (const int) +0:? 'int32_t_init' ( const int) +0:? -3 (const int) +0:? 'int64_t_init' ( const int64_t) +0:? -4 (const int64_t) +0:? 'uint8_t_init' ( const uint8_t) +0:? 1 (const int) +0:? 'uint16_t_init' ( const uint16_t) +0:? 2 (const int) +0:? 'uint32_t_init' ( const uint) +0:? 3 (const uint) +0:? 'uint64_t_init' ( const uint64_t) +0:? 4 (const uint64_t) +0:? 'float16_t_init' ( const float16_t) +0:? 42.000000 +0:? 'float32_t_init' ( const float) +0:? 13.000000 +0:? 'float64_t_init' ( const double) +0:? -4.000000 +0:? 'bool_to_bool' ( const bool) +0:? true (const bool) +0:? 'int8_t_to_bool' ( const bool) +0:? -1 (const int) +0:? 'int16_t_to_bool' ( const bool) +0:? -2 (const int) +0:? 'int32_t_to_bool' ( const bool) +0:? true (const bool) +0:? 'int64_t_to_bool' ( const bool) +0:? true (const bool) +0:? 'uint8_t_to_bool' ( const bool) +0:? 1 (const int) +0:? 'uint16_t_to_bool' ( const bool) +0:? 2 (const int) +0:? 'uint32_t_to_bool' ( const bool) +0:? true (const bool) +0:? 'uint64_t_to_bool' ( const bool) +0:? true (const bool) +0:? 'float16_t_to_bool' ( const bool) +0:? true (const bool) +0:? 'float32_t_to_bool' ( const bool) +0:? true (const bool) +0:? 'float64_t_to_bool' ( const bool) +0:? true (const bool) +0:? 'bool_to_int8_t' ( const int8_t) +0:? true (const bool) +0:? 'int8_t_to_int8_t' ( const int8_t) +0:? -1 (const int) +0:? 'int16_t_to_int8_t' ( const int8_t) +0:? -2 (const int) +0:? 'int32_t_to_int8_t' ( const int8_t) +0:? -3 (const int) +0:? 'int64_t_to_int8_t' ( const int8_t) +0:? -4 (const int64_t) +0:? 'uint8_t_to_int8_t' ( const int8_t) +0:? 1 (const int) +0:? 'uint16_t_to_int8_t' ( const int8_t) +0:? 2 (const int) +0:? 'uint32_t_to_int8_t' ( const int8_t) +0:? 3 (const uint) +0:? 'uint64_t_to_int8_t' ( const int8_t) +0:? 4 (const uint64_t) +0:? 'float16_t_to_int8_t' ( const int8_t) +0:? 42.000000 +0:? 'float32_t_to_int8_t' ( const int8_t) +0:? 13.000000 +0:? 'float64_t_to_int8_t' ( const int8_t) +0:? -4.000000 +0:? 'bool_to_int16_t' ( const int16_t) +0:? true (const bool) +0:? 'int8_t_to_int16_t' ( const int16_t) +0:? -1 (const int) +0:? 'int16_t_to_int16_t' ( const int16_t) +0:? -2 (const int) +0:? 'int32_t_to_int16_t' ( const int16_t) +0:? -3 (const int) +0:? 'int64_t_to_int16_t' ( const int16_t) +0:? -4 (const int64_t) +0:? 'uint8_t_to_int16_t' ( const int16_t) +0:? 1 (const int) +0:? 'uint16_t_to_int16_t' ( const int16_t) +0:? 2 (const int) +0:? 'uint32_t_to_int16_t' ( const int16_t) +0:? 3 (const uint) +0:? 'uint64_t_to_int16_t' ( const int16_t) +0:? 4 (const uint64_t) +0:? 'float16_t_to_int16_t' ( const int16_t) +0:? 42.000000 +0:? 'float32_t_to_int16_t' ( const int16_t) +0:? 13.000000 +0:? 'float64_t_to_int16_t' ( const int16_t) +0:? -4.000000 +0:? 'bool_to_int32_t' ( const int) +0:? 1 (const int) +0:? 'int8_t_to_int32_t' ( const int) +0:? -1 (const int) +0:? 'int16_t_to_int32_t' ( const int) +0:? -2 (const int) +0:? 'int32_t_to_int32_t' ( const int) +0:? -3 (const int) +0:? 'int64_t_to_int32_t' ( const int) +0:? -4 (const int) +0:? 'uint8_t_to_int32_t' ( const int) +0:? 1 (const int) +0:? 'uint16_t_to_int32_t' ( const int) +0:? 2 (const int) +0:? 'uint32_t_to_int32_t' ( const int) +0:? 3 (const int) +0:? 'uint64_t_to_int32_t' ( const int) +0:? 4 (const int) +0:? 'float16_t_to_int32_t' ( const int) +0:? 42 (const int) +0:? 'float32_t_to_int32_t' ( const int) +0:? 13 (const int) +0:? 'float64_t_to_int32_t' ( const int) +0:? -4 (const int) +0:? 'bool_to_int64_t' ( const int64_t) +0:? 1 (const int64_t) +0:? 'int8_t_to_int64_t' ( const int64_t) +0:? -1 (const int) +0:? 'int16_t_to_int64_t' ( const int64_t) +0:? -2 (const int) +0:? 'int32_t_to_int64_t' ( const int64_t) +0:? -3 (const int64_t) +0:? 'int64_t_to_int64_t' ( const int64_t) +0:? -4 (const int64_t) +0:? 'uint8_t_to_int64_t' ( const int64_t) +0:? 1 (const int) +0:? 'uint16_t_to_int64_t' ( const int64_t) +0:? 2 (const int) +0:? 'uint32_t_to_int64_t' ( const int64_t) +0:? 3 (const int64_t) +0:? 'uint64_t_to_int64_t' ( const int64_t) +0:? 4 (const int64_t) +0:? 'float16_t_to_int64_t' ( const int64_t) +0:? 42 (const int64_t) +0:? 'float32_t_to_int64_t' ( const int64_t) +0:? 13 (const int64_t) +0:? 'float64_t_to_int64_t' ( const int64_t) +0:? -4 (const int64_t) +0:? 'bool_to_uint8_t' ( const uint8_t) +0:? true (const bool) +0:? 'int8_t_to_uint8_t' ( const uint8_t) +0:? -1 (const int) +0:? 'int16_t_to_uint8_t' ( const uint8_t) +0:? -2 (const int) +0:? 'int32_t_to_uint8_t' ( const uint8_t) +0:? -3 (const int) +0:? 'int64_t_to_uint8_t' ( const uint8_t) +0:? -4 (const int64_t) +0:? 'uint8_t_to_uint8_t' ( const uint8_t) +0:? 1 (const int) +0:? 'uint16_t_to_uint8_t' ( const uint8_t) +0:? 2 (const int) +0:? 'uint32_t_to_uint8_t' ( const uint8_t) +0:? 3 (const uint) +0:? 'uint64_t_to_uint8_t' ( const uint8_t) +0:? 4 (const uint64_t) +0:? 'float16_t_to_uint8_t' ( const uint8_t) +0:? 42.000000 +0:? 'float32_t_to_uint8_t' ( const uint8_t) +0:? 13.000000 +0:? 'float64_t_to_uint8_t' ( const uint8_t) +0:? -4.000000 +0:? 'bool_to_uint16_t' ( const uint16_t) +0:? true (const bool) +0:? 'int8_t_to_uint16_t' ( const uint16_t) +0:? -1 (const int) +0:? 'int16_t_to_uint16_t' ( const uint16_t) +0:? -2 (const int) +0:? 'int32_t_to_uint16_t' ( const uint16_t) +0:? -3 (const int) +0:? 'int64_t_to_uint16_t' ( const uint16_t) +0:? -4 (const int64_t) +0:? 'uint8_t_to_uint16_t' ( const uint16_t) +0:? 1 (const int) +0:? 'uint16_t_to_uint16_t' ( const uint16_t) +0:? 2 (const int) +0:? 'uint32_t_to_uint16_t' ( const uint16_t) +0:? 3 (const uint) +0:? 'uint64_t_to_uint16_t' ( const uint16_t) +0:? 4 (const uint64_t) +0:? 'float16_t_to_uint16_t' ( const uint16_t) +0:? 42.000000 +0:? 'float32_t_to_uint16_t' ( const uint16_t) +0:? 13.000000 +0:? 'float64_t_to_uint16_t' ( const uint16_t) +0:? -4.000000 +0:? 'bool_to_uint32_t' ( const uint) +0:? 1 (const uint) +0:? 'int8_t_to_uint32_t' ( const uint) +0:? -1 (const int) +0:? 'int16_t_to_uint32_t' ( const uint) +0:? -2 (const int) +0:? 'int32_t_to_uint32_t' ( const uint) +0:? 4294967293 (const uint) +0:? 'int64_t_to_uint32_t' ( const uint) +0:? 4294967292 (const uint) +0:? 'uint8_t_to_uint32_t' ( const uint) +0:? 1 (const int) +0:? 'uint16_t_to_uint32_t' ( const uint) +0:? 2 (const int) +0:? 'uint32_t_to_uint32_t' ( const uint) +0:? 3 (const uint) +0:? 'uint64_t_to_uint32_t' ( const uint) +0:? 4 (const uint) +0:? 'float16_t_to_uint32_t' ( const uint) +0:? 42 (const uint) +0:? 'float32_t_to_uint32_t' ( const uint) +0:? 13 (const uint) +0:? 'float64_t_to_uint32_t' ( const uint) +0:? 4294967292 (const uint) +0:? 'bool_to_uint64_t' ( const uint64_t) +0:? 1 (const uint64_t) +0:? 'int8_t_to_uint64_t' ( const uint64_t) +0:? -1 (const int) +0:? 'int16_t_to_uint64_t' ( const uint64_t) +0:? -2 (const int) +0:? 'int32_t_to_uint64_t' ( const uint64_t) +0:? 18446744073709551613 (const uint64_t) +0:? 'int64_t_to_uint64_t' ( const uint64_t) +0:? 18446744073709551612 (const uint64_t) +0:? 'uint8_t_to_uint64_t' ( const uint64_t) +0:? 1 (const int) +0:? 'uint16_t_to_uint64_t' ( const uint64_t) +0:? 2 (const int) +0:? 'uint32_t_to_uint64_t' ( const uint64_t) +0:? 3 (const uint64_t) +0:? 'uint64_t_to_uint64_t' ( const uint64_t) +0:? 4 (const uint64_t) +0:? 'float16_t_to_uint64_t' ( const uint64_t) +0:? 42 (const uint64_t) +0:? 'float32_t_to_uint64_t' ( const uint64_t) +0:? 13 (const uint64_t) +0:? 'float64_t_to_uint64_t' ( const uint64_t) +0:? 18446744073709551612 (const uint64_t) +0:? 'bool_to_float16_t' ( const float16_t) +0:? 1.000000 +0:? 'int8_t_to_float16_t' ( const float16_t) +0:? -1 (const int) +0:? 'int16_t_to_float16_t' ( const float16_t) +0:? -2 (const int) +0:? 'int32_t_to_float16_t' ( const float16_t) +0:? -3.000000 +0:? 'int64_t_to_float16_t' ( const float16_t) +0:? -4.000000 +0:? 'uint8_t_to_float16_t' ( const float16_t) +0:? 1 (const int) +0:? 'uint16_t_to_float16_t' ( const float16_t) +0:? 2 (const int) +0:? 'uint32_t_to_float16_t' ( const float16_t) +0:? 3.000000 +0:? 'uint64_t_to_float16_t' ( const float16_t) +0:? 4.000000 +0:? 'float16_t_to_float16_t' ( const float16_t) +0:? 42.000000 +0:? 'float32_t_to_float16_t' ( const float16_t) +0:? 13.000000 +0:? 'float64_t_to_float16_t' ( const float16_t) +0:? -4.000000 +0:? 'bool_to_float32_t' ( const float) +0:? 1.000000 +0:? 'int8_t_to_float32_t' ( const float) +0:? -1 (const int) +0:? 'int16_t_to_float32_t' ( const float) +0:? -2 (const int) +0:? 'int32_t_to_float32_t' ( const float) +0:? -3.000000 +0:? 'int64_t_to_float32_t' ( const float) +0:? -4.000000 +0:? 'uint8_t_to_float32_t' ( const float) +0:? 1 (const int) +0:? 'uint16_t_to_float32_t' ( const float) +0:? 2 (const int) +0:? 'uint32_t_to_float32_t' ( const float) +0:? 3.000000 +0:? 'uint64_t_to_float32_t' ( const float) +0:? 4.000000 +0:? 'float16_t_to_float32_t' ( const float) +0:? 42.000000 +0:? 'float32_t_to_float32_t' ( const float) +0:? 13.000000 +0:? 'float64_t_to_float32_t' ( const float) +0:? -4.000000 +0:? 'bool_to_float64_t' ( const double) +0:? 1.000000 +0:? 'int8_t_to_float64_t' ( const double) +0:? -1 (const int) +0:? 'int16_t_to_float64_t' ( const double) +0:? -2 (const int) +0:? 'int32_t_to_float64_t' ( const double) +0:? -3.000000 +0:? 'int64_t_to_float64_t' ( const double) +0:? -4.000000 +0:? 'uint8_t_to_float64_t' ( const double) +0:? 1 (const int) +0:? 'uint16_t_to_float64_t' ( const double) +0:? 2 (const int) +0:? 'uint32_t_to_float64_t' ( const double) +0:? 3.000000 +0:? 'uint64_t_to_float64_t' ( const double) +0:? 4.000000 +0:? 'float16_t_to_float64_t' ( const double) +0:? 42.000000 +0:? 'float32_t_to_float64_t' ( const double) +0:? 13.000000 +0:? 'float64_t_to_float64_t' ( const double) +0:? -4.000000 + + +Linked compute stage: + + +Shader version: 450 +Requested GL_EXT_shader_explicit_arithmetic_types +local_size = (1, 1, 1) +0:? Sequence +0:48 Function Definition: main( ( global void) +0:48 Function Parameters: +0:? Linker Objects +0:? 'bool_init' ( const bool) +0:? true (const bool) +0:? 'int8_t_init' ( const int8_t) +0:? -1 (const int) +0:? 'int16_t_init' ( const int16_t) +0:? -2 (const int) +0:? 'int32_t_init' ( const int) +0:? -3 (const int) +0:? 'int64_t_init' ( const int64_t) +0:? -4 (const int64_t) +0:? 'uint8_t_init' ( const uint8_t) +0:? 1 (const int) +0:? 'uint16_t_init' ( const uint16_t) +0:? 2 (const int) +0:? 'uint32_t_init' ( const uint) +0:? 3 (const uint) +0:? 'uint64_t_init' ( const uint64_t) +0:? 4 (const uint64_t) +0:? 'float16_t_init' ( const float16_t) +0:? 42.000000 +0:? 'float32_t_init' ( const float) +0:? 13.000000 +0:? 'float64_t_init' ( const double) +0:? -4.000000 +0:? 'bool_to_bool' ( const bool) +0:? true (const bool) +0:? 'int8_t_to_bool' ( const bool) +0:? -1 (const int) +0:? 'int16_t_to_bool' ( const bool) +0:? -2 (const int) +0:? 'int32_t_to_bool' ( const bool) +0:? true (const bool) +0:? 'int64_t_to_bool' ( const bool) +0:? true (const bool) +0:? 'uint8_t_to_bool' ( const bool) +0:? 1 (const int) +0:? 'uint16_t_to_bool' ( const bool) +0:? 2 (const int) +0:? 'uint32_t_to_bool' ( const bool) +0:? true (const bool) +0:? 'uint64_t_to_bool' ( const bool) +0:? true (const bool) +0:? 'float16_t_to_bool' ( const bool) +0:? true (const bool) +0:? 'float32_t_to_bool' ( const bool) +0:? true (const bool) +0:? 'float64_t_to_bool' ( const bool) +0:? true (const bool) +0:? 'bool_to_int8_t' ( const int8_t) +0:? true (const bool) +0:? 'int8_t_to_int8_t' ( const int8_t) +0:? -1 (const int) +0:? 'int16_t_to_int8_t' ( const int8_t) +0:? -2 (const int) +0:? 'int32_t_to_int8_t' ( const int8_t) +0:? -3 (const int) +0:? 'int64_t_to_int8_t' ( const int8_t) +0:? -4 (const int64_t) +0:? 'uint8_t_to_int8_t' ( const int8_t) +0:? 1 (const int) +0:? 'uint16_t_to_int8_t' ( const int8_t) +0:? 2 (const int) +0:? 'uint32_t_to_int8_t' ( const int8_t) +0:? 3 (const uint) +0:? 'uint64_t_to_int8_t' ( const int8_t) +0:? 4 (const uint64_t) +0:? 'float16_t_to_int8_t' ( const int8_t) +0:? 42.000000 +0:? 'float32_t_to_int8_t' ( const int8_t) +0:? 13.000000 +0:? 'float64_t_to_int8_t' ( const int8_t) +0:? -4.000000 +0:? 'bool_to_int16_t' ( const int16_t) +0:? true (const bool) +0:? 'int8_t_to_int16_t' ( const int16_t) +0:? -1 (const int) +0:? 'int16_t_to_int16_t' ( const int16_t) +0:? -2 (const int) +0:? 'int32_t_to_int16_t' ( const int16_t) +0:? -3 (const int) +0:? 'int64_t_to_int16_t' ( const int16_t) +0:? -4 (const int64_t) +0:? 'uint8_t_to_int16_t' ( const int16_t) +0:? 1 (const int) +0:? 'uint16_t_to_int16_t' ( const int16_t) +0:? 2 (const int) +0:? 'uint32_t_to_int16_t' ( const int16_t) +0:? 3 (const uint) +0:? 'uint64_t_to_int16_t' ( const int16_t) +0:? 4 (const uint64_t) +0:? 'float16_t_to_int16_t' ( const int16_t) +0:? 42.000000 +0:? 'float32_t_to_int16_t' ( const int16_t) +0:? 13.000000 +0:? 'float64_t_to_int16_t' ( const int16_t) +0:? -4.000000 +0:? 'bool_to_int32_t' ( const int) +0:? 1 (const int) +0:? 'int8_t_to_int32_t' ( const int) +0:? -1 (const int) +0:? 'int16_t_to_int32_t' ( const int) +0:? -2 (const int) +0:? 'int32_t_to_int32_t' ( const int) +0:? -3 (const int) +0:? 'int64_t_to_int32_t' ( const int) +0:? -4 (const int) +0:? 'uint8_t_to_int32_t' ( const int) +0:? 1 (const int) +0:? 'uint16_t_to_int32_t' ( const int) +0:? 2 (const int) +0:? 'uint32_t_to_int32_t' ( const int) +0:? 3 (const int) +0:? 'uint64_t_to_int32_t' ( const int) +0:? 4 (const int) +0:? 'float16_t_to_int32_t' ( const int) +0:? 42 (const int) +0:? 'float32_t_to_int32_t' ( const int) +0:? 13 (const int) +0:? 'float64_t_to_int32_t' ( const int) +0:? -4 (const int) +0:? 'bool_to_int64_t' ( const int64_t) +0:? 1 (const int64_t) +0:? 'int8_t_to_int64_t' ( const int64_t) +0:? -1 (const int) +0:? 'int16_t_to_int64_t' ( const int64_t) +0:? -2 (const int) +0:? 'int32_t_to_int64_t' ( const int64_t) +0:? -3 (const int64_t) +0:? 'int64_t_to_int64_t' ( const int64_t) +0:? -4 (const int64_t) +0:? 'uint8_t_to_int64_t' ( const int64_t) +0:? 1 (const int) +0:? 'uint16_t_to_int64_t' ( const int64_t) +0:? 2 (const int) +0:? 'uint32_t_to_int64_t' ( const int64_t) +0:? 3 (const int64_t) +0:? 'uint64_t_to_int64_t' ( const int64_t) +0:? 4 (const int64_t) +0:? 'float16_t_to_int64_t' ( const int64_t) +0:? 42 (const int64_t) +0:? 'float32_t_to_int64_t' ( const int64_t) +0:? 13 (const int64_t) +0:? 'float64_t_to_int64_t' ( const int64_t) +0:? -4 (const int64_t) +0:? 'bool_to_uint8_t' ( const uint8_t) +0:? true (const bool) +0:? 'int8_t_to_uint8_t' ( const uint8_t) +0:? -1 (const int) +0:? 'int16_t_to_uint8_t' ( const uint8_t) +0:? -2 (const int) +0:? 'int32_t_to_uint8_t' ( const uint8_t) +0:? -3 (const int) +0:? 'int64_t_to_uint8_t' ( const uint8_t) +0:? -4 (const int64_t) +0:? 'uint8_t_to_uint8_t' ( const uint8_t) +0:? 1 (const int) +0:? 'uint16_t_to_uint8_t' ( const uint8_t) +0:? 2 (const int) +0:? 'uint32_t_to_uint8_t' ( const uint8_t) +0:? 3 (const uint) +0:? 'uint64_t_to_uint8_t' ( const uint8_t) +0:? 4 (const uint64_t) +0:? 'float16_t_to_uint8_t' ( const uint8_t) +0:? 42.000000 +0:? 'float32_t_to_uint8_t' ( const uint8_t) +0:? 13.000000 +0:? 'float64_t_to_uint8_t' ( const uint8_t) +0:? -4.000000 +0:? 'bool_to_uint16_t' ( const uint16_t) +0:? true (const bool) +0:? 'int8_t_to_uint16_t' ( const uint16_t) +0:? -1 (const int) +0:? 'int16_t_to_uint16_t' ( const uint16_t) +0:? -2 (const int) +0:? 'int32_t_to_uint16_t' ( const uint16_t) +0:? -3 (const int) +0:? 'int64_t_to_uint16_t' ( const uint16_t) +0:? -4 (const int64_t) +0:? 'uint8_t_to_uint16_t' ( const uint16_t) +0:? 1 (const int) +0:? 'uint16_t_to_uint16_t' ( const uint16_t) +0:? 2 (const int) +0:? 'uint32_t_to_uint16_t' ( const uint16_t) +0:? 3 (const uint) +0:? 'uint64_t_to_uint16_t' ( const uint16_t) +0:? 4 (const uint64_t) +0:? 'float16_t_to_uint16_t' ( const uint16_t) +0:? 42.000000 +0:? 'float32_t_to_uint16_t' ( const uint16_t) +0:? 13.000000 +0:? 'float64_t_to_uint16_t' ( const uint16_t) +0:? -4.000000 +0:? 'bool_to_uint32_t' ( const uint) +0:? 1 (const uint) +0:? 'int8_t_to_uint32_t' ( const uint) +0:? -1 (const int) +0:? 'int16_t_to_uint32_t' ( const uint) +0:? -2 (const int) +0:? 'int32_t_to_uint32_t' ( const uint) +0:? 4294967293 (const uint) +0:? 'int64_t_to_uint32_t' ( const uint) +0:? 4294967292 (const uint) +0:? 'uint8_t_to_uint32_t' ( const uint) +0:? 1 (const int) +0:? 'uint16_t_to_uint32_t' ( const uint) +0:? 2 (const int) +0:? 'uint32_t_to_uint32_t' ( const uint) +0:? 3 (const uint) +0:? 'uint64_t_to_uint32_t' ( const uint) +0:? 4 (const uint) +0:? 'float16_t_to_uint32_t' ( const uint) +0:? 42 (const uint) +0:? 'float32_t_to_uint32_t' ( const uint) +0:? 13 (const uint) +0:? 'float64_t_to_uint32_t' ( const uint) +0:? 4294967292 (const uint) +0:? 'bool_to_uint64_t' ( const uint64_t) +0:? 1 (const uint64_t) +0:? 'int8_t_to_uint64_t' ( const uint64_t) +0:? -1 (const int) +0:? 'int16_t_to_uint64_t' ( const uint64_t) +0:? -2 (const int) +0:? 'int32_t_to_uint64_t' ( const uint64_t) +0:? 18446744073709551613 (const uint64_t) +0:? 'int64_t_to_uint64_t' ( const uint64_t) +0:? 18446744073709551612 (const uint64_t) +0:? 'uint8_t_to_uint64_t' ( const uint64_t) +0:? 1 (const int) +0:? 'uint16_t_to_uint64_t' ( const uint64_t) +0:? 2 (const int) +0:? 'uint32_t_to_uint64_t' ( const uint64_t) +0:? 3 (const uint64_t) +0:? 'uint64_t_to_uint64_t' ( const uint64_t) +0:? 4 (const uint64_t) +0:? 'float16_t_to_uint64_t' ( const uint64_t) +0:? 42 (const uint64_t) +0:? 'float32_t_to_uint64_t' ( const uint64_t) +0:? 13 (const uint64_t) +0:? 'float64_t_to_uint64_t' ( const uint64_t) +0:? 18446744073709551612 (const uint64_t) +0:? 'bool_to_float16_t' ( const float16_t) +0:? 1.000000 +0:? 'int8_t_to_float16_t' ( const float16_t) +0:? -1 (const int) +0:? 'int16_t_to_float16_t' ( const float16_t) +0:? -2 (const int) +0:? 'int32_t_to_float16_t' ( const float16_t) +0:? -3.000000 +0:? 'int64_t_to_float16_t' ( const float16_t) +0:? -4.000000 +0:? 'uint8_t_to_float16_t' ( const float16_t) +0:? 1 (const int) +0:? 'uint16_t_to_float16_t' ( const float16_t) +0:? 2 (const int) +0:? 'uint32_t_to_float16_t' ( const float16_t) +0:? 3.000000 +0:? 'uint64_t_to_float16_t' ( const float16_t) +0:? 4.000000 +0:? 'float16_t_to_float16_t' ( const float16_t) +0:? 42.000000 +0:? 'float32_t_to_float16_t' ( const float16_t) +0:? 13.000000 +0:? 'float64_t_to_float16_t' ( const float16_t) +0:? -4.000000 +0:? 'bool_to_float32_t' ( const float) +0:? 1.000000 +0:? 'int8_t_to_float32_t' ( const float) +0:? -1 (const int) +0:? 'int16_t_to_float32_t' ( const float) +0:? -2 (const int) +0:? 'int32_t_to_float32_t' ( const float) +0:? -3.000000 +0:? 'int64_t_to_float32_t' ( const float) +0:? -4.000000 +0:? 'uint8_t_to_float32_t' ( const float) +0:? 1 (const int) +0:? 'uint16_t_to_float32_t' ( const float) +0:? 2 (const int) +0:? 'uint32_t_to_float32_t' ( const float) +0:? 3.000000 +0:? 'uint64_t_to_float32_t' ( const float) +0:? 4.000000 +0:? 'float16_t_to_float32_t' ( const float) +0:? 42.000000 +0:? 'float32_t_to_float32_t' ( const float) +0:? 13.000000 +0:? 'float64_t_to_float32_t' ( const float) +0:? -4.000000 +0:? 'bool_to_float64_t' ( const double) +0:? 1.000000 +0:? 'int8_t_to_float64_t' ( const double) +0:? -1 (const int) +0:? 'int16_t_to_float64_t' ( const double) +0:? -2 (const int) +0:? 'int32_t_to_float64_t' ( const double) +0:? -3.000000 +0:? 'int64_t_to_float64_t' ( const double) +0:? -4.000000 +0:? 'uint8_t_to_float64_t' ( const double) +0:? 1 (const int) +0:? 'uint16_t_to_float64_t' ( const double) +0:? 2 (const int) +0:? 'uint32_t_to_float64_t' ( const double) +0:? 3.000000 +0:? 'uint64_t_to_float64_t' ( const double) +0:? 4.000000 +0:? 'float16_t_to_float64_t' ( const double) +0:? 42.000000 +0:? 'float32_t_to_float64_t' ( const double) +0:? 13.000000 +0:? 'float64_t_to_float64_t' ( const double) +0:? -4.000000 + diff --git a/deps/glslang/Test/baseResults/findFunction.frag.out b/deps/glslang/Test/baseResults/findFunction.frag.out index ec4f3e46..cc9b15a1 100644 --- a/deps/glslang/Test/baseResults/findFunction.frag.out +++ b/deps/glslang/Test/baseResults/findFunction.frag.out @@ -11,7 +11,7 @@ ERROR: 8 compilation errors. No code generated. Shader version: 450 -Requested GL_KHX_shader_explicit_arithmetic_types +Requested GL_EXT_shader_explicit_arithmetic_types ERROR: node is still EOpNull! 0:5 Function Definition: func(i81;i161;i161; ( global int64_t) 0:5 Function Parameters: @@ -137,7 +137,7 @@ Linked fragment stage: Shader version: 450 -Requested GL_KHX_shader_explicit_arithmetic_types +Requested GL_EXT_shader_explicit_arithmetic_types ERROR: node is still EOpNull! 0:10 Function Definition: func(i81;i161;i1; ( global int64_t) 0:10 Function Parameters: diff --git a/deps/glslang/Test/baseResults/hlsl.PointSize.geom.out b/deps/glslang/Test/baseResults/hlsl.PointSize.geom.out index c21008d2..77cdc7db 100644 --- a/deps/glslang/Test/baseResults/hlsl.PointSize.geom.out +++ b/deps/glslang/Test/baseResults/hlsl.PointSize.geom.out @@ -69,10 +69,7 @@ output primitive = line_strip 0:? 'ps' ( in 3-element array of uint PointSize) 0:? 'OutputStream.ps' ( out float PointSize) -error: SPIRV-Tools Validation Errors -error: According to the Vulkan spec BuiltIn PointSize variable needs to be a 32-bit float scalar. ID <28> (OpVariable) is not a float scalar. - %29 = OpLoad %_arr_uint_uint_3 %ps_1 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 36 diff --git a/deps/glslang/Test/baseResults/hlsl.aliasOpaque.frag.out b/deps/glslang/Test/baseResults/hlsl.aliasOpaque.frag.out index 9928278d..63d29fa4 100644 --- a/deps/glslang/Test/baseResults/hlsl.aliasOpaque.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.aliasOpaque.frag.out @@ -167,8 +167,11 @@ gl_FragCoord origin is upper left Name 56 "param" Name 62 "@entryPointOutput" Decorate 44(gss2) DescriptorSet 0 + Decorate 44(gss2) Binding 0 Decorate 47(gss) DescriptorSet 0 + Decorate 47(gss) Binding 0 Decorate 51(gtex) DescriptorSet 0 + Decorate 51(gtex) Binding 0 Decorate 62(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.amend.frag.out b/deps/glslang/Test/baseResults/hlsl.amend.frag.out index fa4ad035..e273abeb 100644 --- a/deps/glslang/Test/baseResults/hlsl.amend.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.amend.frag.out @@ -189,6 +189,7 @@ gl_FragCoord origin is upper left MemberDecorate 20($Global) 4 Offset 48 Decorate 20($Global) Block Decorate 22 DescriptorSet 0 + Decorate 22 Binding 0 2: TypeVoid 3: TypeFunction 2 14: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.array.flatten.frag.out b/deps/glslang/Test/baseResults/hlsl.array.flatten.frag.out index 4c8609c2..80d51539 100644 --- a/deps/glslang/Test/baseResults/hlsl.array.flatten.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.array.flatten.frag.out @@ -393,11 +393,17 @@ gl_FragCoord origin is upper left Name 141 "g_samp_explicit[1]" Name 142 "g_samp_explicit[2]" Decorate 42(g_tex[1]) DescriptorSet 0 + Decorate 42(g_tex[1]) Binding 0 Decorate 45(g_samp[1]) DescriptorSet 0 + Decorate 45(g_samp[1]) Binding 0 Decorate 65(g_samp[0]) DescriptorSet 0 + Decorate 65(g_samp[0]) Binding 0 Decorate 70(g_samp[2]) DescriptorSet 0 + Decorate 70(g_samp[2]) Binding 0 Decorate 74(g_tex[0]) DescriptorSet 0 + Decorate 74(g_tex[0]) Binding 0 Decorate 79(g_tex[2]) DescriptorSet 0 + Decorate 79(g_tex[2]) Binding 0 Decorate 88 ArrayStride 48 Decorate 89 ArrayStride 48 Decorate 90 ArrayStride 16 @@ -410,6 +416,7 @@ gl_FragCoord origin is upper left MemberDecorate 91($Global) 2 Offset 384 Decorate 91($Global) Block Decorate 93 DescriptorSet 0 + Decorate 93 Binding 0 Decorate 134(ps_output.color) Location 0 Decorate 137(g_tex_explicit[0]) DescriptorSet 0 Decorate 137(g_tex_explicit[0]) Binding 1 diff --git a/deps/glslang/Test/baseResults/hlsl.array.frag.out b/deps/glslang/Test/baseResults/hlsl.array.frag.out index 0f68e7cd..2e706d76 100644 --- a/deps/glslang/Test/baseResults/hlsl.array.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.array.frag.out @@ -334,6 +334,7 @@ gl_FragCoord origin is upper left MemberDecorate 60($Global) 3 Offset 1312 Decorate 60($Global) Block Decorate 62 DescriptorSet 0 + Decorate 62 Binding 0 Decorate 112(i) Flat Decorate 112(i) Location 0 Decorate 116(input) Location 1 diff --git a/deps/glslang/Test/baseResults/hlsl.array.multidim.frag.out b/deps/glslang/Test/baseResults/hlsl.array.multidim.frag.out index 59f64c0e..94629996 100644 --- a/deps/glslang/Test/baseResults/hlsl.array.multidim.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.array.multidim.frag.out @@ -160,6 +160,7 @@ gl_FragCoord origin is upper left MemberDecorate 27($Global) 0 Offset 0 Decorate 27($Global) Block Decorate 29 DescriptorSet 0 + Decorate 29 Binding 0 Decorate 54(@entryPointOutput.Color) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.attribute.expression.comp.out b/deps/glslang/Test/baseResults/hlsl.attribute.expression.comp.out index 4bef5e76..1b3ffdbc 100644 --- a/deps/glslang/Test/baseResults/hlsl.attribute.expression.comp.out +++ b/deps/glslang/Test/baseResults/hlsl.attribute.expression.comp.out @@ -101,6 +101,7 @@ local_size = (4, 6, 8) MemberDecorate 21($Global) 0 Offset 0 Decorate 21($Global) Block Decorate 23 DescriptorSet 0 + Decorate 23 Binding 0 Decorate 37(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.attributeC11.frag.out b/deps/glslang/Test/baseResults/hlsl.attributeC11.frag.out index afc74669..47dd96a7 100644 --- a/deps/glslang/Test/baseResults/hlsl.attributeC11.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.attributeC11.frag.out @@ -93,10 +93,7 @@ gl_FragCoord origin is upper left 0:? '@entryPointOutput' (layout( location=7) out 4-component vector of float) 0:? 'input' (layout( location=8) in 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: Operand 2 of Decorate requires one of these capabilities: InputAttachment - OpDecorate %attach InputAttachmentIndex 4 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 51 @@ -126,6 +123,7 @@ error: Operand 2 of Decorate requires one of these capabilities: InputAttachment MemberName 48(pcBuf) 0 "a" Name 50 "" Decorate 16(attach) DescriptorSet 0 + Decorate 16(attach) Binding 0 Decorate 16(attach) InputAttachmentIndex 4 Decorate 33(input) Location 8 Decorate 36(@entryPointOutput) Location 7 diff --git a/deps/glslang/Test/baseResults/hlsl.buffer.frag.out b/deps/glslang/Test/baseResults/hlsl.buffer.frag.out index 4528d98b..25a79630 100644 --- a/deps/glslang/Test/baseResults/hlsl.buffer.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.buffer.frag.out @@ -145,10 +145,7 @@ gl_FragCoord origin is upper left 0:? '@entryPointOutput.a' (layout( location=0) out 4-component vector of float) 0:? 'input' ( in 4-component vector of float FragCoord) -error: SPIRV-Tools Validation Errors -error: Structure id 50 decorated as BufferBlock for variable in Uniform storage class must follow standard storage buffer layout rules: member 7 at offset 128 overlaps previous member ending at offset 171 - %tbufName = OpTypeStruct %v4float %int %float %float %float %float %float %float %mat3v4float %mat3v4float %mat3v4float %mat3v4float - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 73 @@ -200,17 +197,21 @@ error: Structure id 50 decorated as BufferBlock for variable in Uniform storage MemberDecorate 24(cbufName2) 0 Offset 0 Decorate 24(cbufName2) Block Decorate 26 DescriptorSet 0 + Decorate 26 Binding 0 MemberDecorate 31(buf1) 0 Offset 0 Decorate 31(buf1) Block Decorate 33 DescriptorSet 0 + Decorate 33 Binding 0 MemberDecorate 37(buf2) 0 NonWritable MemberDecorate 37(buf2) 0 Offset 0 Decorate 37(buf2) BufferBlock Decorate 39 DescriptorSet 0 + Decorate 39 Binding 0 MemberDecorate 43(cbufName) 0 Offset 0 MemberDecorate 43(cbufName) 1 Offset 20 Decorate 43(cbufName) Block Decorate 45 DescriptorSet 0 + Decorate 45 Binding 0 MemberDecorate 50(tbufName) 0 NonWritable MemberDecorate 50(tbufName) 0 Offset 16 MemberDecorate 50(tbufName) 1 NonWritable diff --git a/deps/glslang/Test/baseResults/hlsl.calculatelod.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.calculatelod.dx10.frag.out index 46b4eea5..f3278834 100644 --- a/deps/glslang/Test/baseResults/hlsl.calculatelod.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.calculatelod.dx10.frag.out @@ -405,13 +405,21 @@ using depth_any Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 33(g_tTex1di4a) DescriptorSet 0 + Decorate 33(g_tTex1di4a) Binding 0 Decorate 45(g_tTex1du4a) DescriptorSet 0 + Decorate 45(g_tTex1du4a) Binding 0 Decorate 56(g_tTex2df4a) DescriptorSet 0 + Decorate 56(g_tTex2df4a) Binding 0 Decorate 67(g_tTex2di4a) DescriptorSet 0 + Decorate 67(g_tTex2di4a) Binding 0 Decorate 79(g_tTex2du4a) DescriptorSet 0 + Decorate 79(g_tTex2du4a) Binding 0 Decorate 92(g_tTexcdf4a) DescriptorSet 0 + Decorate 92(g_tTexcdf4a) Binding 0 Decorate 104(g_tTexcdi4a) DescriptorSet 0 + Decorate 104(g_tTexcdi4a) Binding 0 Decorate 115(g_tTexcdu4a) DescriptorSet 0 + Decorate 115(g_tTexcdu4a) Binding 0 Decorate 140(@entryPointOutput.Color) Location 0 Decorate 144(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 147(g_tTex1df4) DescriptorSet 0 diff --git a/deps/glslang/Test/baseResults/hlsl.calculatelodunclamped.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.calculatelodunclamped.dx10.frag.out index ef5aabe5..85dafcc7 100644 --- a/deps/glslang/Test/baseResults/hlsl.calculatelodunclamped.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.calculatelodunclamped.dx10.frag.out @@ -405,13 +405,21 @@ using depth_any Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 33(g_tTex1di4a) DescriptorSet 0 + Decorate 33(g_tTex1di4a) Binding 0 Decorate 45(g_tTex1du4a) DescriptorSet 0 + Decorate 45(g_tTex1du4a) Binding 0 Decorate 56(g_tTex2df4a) DescriptorSet 0 + Decorate 56(g_tTex2df4a) Binding 0 Decorate 67(g_tTex2di4a) DescriptorSet 0 + Decorate 67(g_tTex2di4a) Binding 0 Decorate 79(g_tTex2du4a) DescriptorSet 0 + Decorate 79(g_tTex2du4a) Binding 0 Decorate 92(g_tTexcdf4a) DescriptorSet 0 + Decorate 92(g_tTexcdf4a) Binding 0 Decorate 104(g_tTexcdi4a) DescriptorSet 0 + Decorate 104(g_tTexcdi4a) Binding 0 Decorate 115(g_tTexcdu4a) DescriptorSet 0 + Decorate 115(g_tTexcdu4a) Binding 0 Decorate 140(@entryPointOutput.Color) Location 0 Decorate 144(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 147(g_tTex1df4) DescriptorSet 0 diff --git a/deps/glslang/Test/baseResults/hlsl.comparison.vec.frag.out b/deps/glslang/Test/baseResults/hlsl.comparison.vec.frag.out index c7e4ed52..ff73e178 100644 --- a/deps/glslang/Test/baseResults/hlsl.comparison.vec.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.comparison.vec.frag.out @@ -300,6 +300,7 @@ gl_FragCoord origin is upper left MemberDecorate 93($Global) 0 Offset 0 Decorate 93($Global) Block Decorate 95 DescriptorSet 0 + Decorate 95 Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.conditional.frag.out b/deps/glslang/Test/baseResults/hlsl.conditional.frag.out index 90d9f79b..7df88e7f 100644 --- a/deps/glslang/Test/baseResults/hlsl.conditional.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.conditional.frag.out @@ -569,6 +569,7 @@ gl_FragCoord origin is upper left MemberDecorate 29($Global) 4 Offset 52 Decorate 29($Global) Block Decorate 31 DescriptorSet 0 + Decorate 31 Binding 0 Decorate 199(input) Location 0 Decorate 202(@entryPointOutput) Location 0 2: TypeVoid diff --git a/deps/glslang/Test/baseResults/hlsl.constantbuffer.frag.out b/deps/glslang/Test/baseResults/hlsl.constantbuffer.frag.out index 4185ea95..fa8881db 100644 --- a/deps/glslang/Test/baseResults/hlsl.constantbuffer.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.constantbuffer.frag.out @@ -131,10 +131,7 @@ gl_FragCoord origin is upper left 0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform int c1}) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: Only a single level of array is allowed for descriptor set variables - %cb3_0 = OpVariable %_ptr_Uniform__arr__arr_cb3_uint_4_uint_2 Uniform - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 66 @@ -163,14 +160,17 @@ error: Only a single level of array is allowed for descriptor set variables MemberDecorate 12(cb3) 1 Offset 4 Decorate 12(cb3) Block Decorate 18(cb3) DescriptorSet 0 + Decorate 18(cb3) Binding 0 MemberDecorate 31(cb1) 0 Offset 0 Decorate 31(cb1) Block Decorate 33(cb1) DescriptorSet 0 Decorate 33(cb1) Binding 12 Decorate 40(cb2) DescriptorSet 0 + Decorate 40(cb2) Binding 0 MemberDecorate 46(cbuff) 0 Offset 0 Decorate 46(cbuff) Block Decorate 48 DescriptorSet 0 + Decorate 48 Binding 0 Decorate 64(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.constructimat.frag.out b/deps/glslang/Test/baseResults/hlsl.constructimat.frag.out index e88c3d8f..075dabb5 100644 --- a/deps/glslang/Test/baseResults/hlsl.constructimat.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.constructimat.frag.out @@ -543,10 +543,7 @@ gl_FragCoord origin is upper left 0:? Linker Objects 0:? '@entryPointOutput' (layout( location=0) out int) -error: SPIRV-Tools Validation Errors -error: Matrix types can only be parameterized with floating-point types. - %mat4v4int = OpTypeMatrix %v4int 4 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 98 diff --git a/deps/glslang/Test/baseResults/hlsl.coverage.frag.out b/deps/glslang/Test/baseResults/hlsl.coverage.frag.out index bea2fc0e..691d6436 100644 --- a/deps/glslang/Test/baseResults/hlsl.coverage.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.coverage.frag.out @@ -117,10 +117,7 @@ gl_FragCoord origin is upper left 0:? '@entryPointOutput.nCoverageMask' ( out 1-element array of uint SampleMaskIn) 0:? '@entryPointOutput.vColor' (layout( location=0) out 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: Input variable id <34> is used by entry point 'main' id <4>, but is not listed as an interface - %i_1 = OpVariable %_ptr_Input_PS_INPUT Input - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 52 diff --git a/deps/glslang/Test/baseResults/hlsl.dashI.vert.out b/deps/glslang/Test/baseResults/hlsl.dashI.vert.out index 400502be..eb9406b2 100644 --- a/deps/glslang/Test/baseResults/hlsl.dashI.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.dashI.vert.out @@ -25,6 +25,7 @@ hlsl.dashI.vert MemberDecorate 11($Global) 4 Offset 64 Decorate 11($Global) Block Decorate 13 DescriptorSet 0 + Decorate 13 Binding 0 Decorate 38(@entryPointOutput) BuiltIn Position 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.earlydepthstencil.frag.out b/deps/glslang/Test/baseResults/hlsl.earlydepthstencil.frag.out new file mode 100644 index 00000000..e598a519 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.earlydepthstencil.frag.out @@ -0,0 +1,189 @@ +hlsl.earlydepthstencil.frag +Shader version: 500 +gl_FragCoord origin is upper left +using early_fragment_tests +0:? Sequence +0:8 Function Definition: @main(struct-InputStruct-vf41; ( temp uint) +0:8 Function Parameters: +0:8 'input' ( in structure{ temp 4-component vector of float Position}) +0:? Sequence +0:10 move second child to first child ( temp uint) +0:10 'oldVal' ( temp uint) +0:10 imageAtomicExchange ( temp uint) +0:10 'Values' (layout( r32ui) uniform uimage2D) +0:? Construct uvec2 ( temp 2-component vector of uint) +0:10 Convert float to uint ( temp uint) +0:10 direct index ( temp float) +0:10 Position: direct index for structure ( temp 4-component vector of float) +0:10 'input' ( in structure{ temp 4-component vector of float Position}) +0:10 Constant: +0:10 0 (const int) +0:10 Constant: +0:10 0 (const int) +0:10 Convert float to uint ( temp uint) +0:10 direct index ( temp float) +0:10 Position: direct index for structure ( temp 4-component vector of float) +0:10 'input' ( in structure{ temp 4-component vector of float Position}) +0:10 Constant: +0:10 0 (const int) +0:10 Constant: +0:10 1 (const int) +0:10 Constant: +0:10 1 (const uint) +0:11 Branch: Return with expression +0:11 'oldVal' ( temp uint) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:? 'input' ( temp structure{ temp 4-component vector of float Position}) +0:8 Constant: +0:8 0 (const int) +0:? 'input.Position' ( in 4-component vector of float FragCoord) +0:8 move second child to first child ( temp uint) +0:? '@entryPointOutput' (layout( location=0) out uint) +0:8 Function Call: @main(struct-InputStruct-vf41; ( temp uint) +0:? 'input' ( temp structure{ temp 4-component vector of float Position}) +0:? Linker Objects +0:? 'Values' (layout( r32ui) uniform uimage2D) +0:? '@entryPointOutput' (layout( location=0) out uint) +0:? 'input.Position' ( in 4-component vector of float FragCoord) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using early_fragment_tests +0:? Sequence +0:8 Function Definition: @main(struct-InputStruct-vf41; ( temp uint) +0:8 Function Parameters: +0:8 'input' ( in structure{ temp 4-component vector of float Position}) +0:? Sequence +0:10 move second child to first child ( temp uint) +0:10 'oldVal' ( temp uint) +0:10 imageAtomicExchange ( temp uint) +0:10 'Values' (layout( r32ui) uniform uimage2D) +0:? Construct uvec2 ( temp 2-component vector of uint) +0:10 Convert float to uint ( temp uint) +0:10 direct index ( temp float) +0:10 Position: direct index for structure ( temp 4-component vector of float) +0:10 'input' ( in structure{ temp 4-component vector of float Position}) +0:10 Constant: +0:10 0 (const int) +0:10 Constant: +0:10 0 (const int) +0:10 Convert float to uint ( temp uint) +0:10 direct index ( temp float) +0:10 Position: direct index for structure ( temp 4-component vector of float) +0:10 'input' ( in structure{ temp 4-component vector of float Position}) +0:10 Constant: +0:10 0 (const int) +0:10 Constant: +0:10 1 (const int) +0:10 Constant: +0:10 1 (const uint) +0:11 Branch: Return with expression +0:11 'oldVal' ( temp uint) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:? 'input' ( temp structure{ temp 4-component vector of float Position}) +0:8 Constant: +0:8 0 (const int) +0:? 'input.Position' ( in 4-component vector of float FragCoord) +0:8 move second child to first child ( temp uint) +0:? '@entryPointOutput' (layout( location=0) out uint) +0:8 Function Call: @main(struct-InputStruct-vf41; ( temp uint) +0:? 'input' ( temp structure{ temp 4-component vector of float Position}) +0:? Linker Objects +0:? 'Values' (layout( r32ui) uniform uimage2D) +0:? '@entryPointOutput' (layout( location=0) out uint) +0:? 'input.Position' ( in 4-component vector of float FragCoord) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 50 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 41 46 + ExecutionMode 4 OriginUpperLeft + ExecutionMode 4 EarlyFragmentTests + Source HLSL 500 + Name 4 "main" + Name 8 "InputStruct" + MemberName 8(InputStruct) 0 "Position" + Name 13 "@main(struct-InputStruct-vf41;" + Name 12 "input" + Name 16 "oldVal" + Name 19 "Values" + Name 39 "input" + Name 41 "input.Position" + Name 46 "@entryPointOutput" + Name 47 "param" + Decorate 19(Values) DescriptorSet 0 + Decorate 19(Values) Binding 0 + Decorate 41(input.Position) BuiltIn FragCoord + Decorate 46(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(InputStruct): TypeStruct 7(fvec4) + 9: TypePointer Function 8(InputStruct) + 10: TypeInt 32 0 + 11: TypeFunction 10(int) 9(ptr) + 15: TypePointer Function 10(int) + 17: TypeImage 10(int) 2D nonsampled format:R32ui + 18: TypePointer UniformConstant 17 + 19(Values): 18(ptr) Variable UniformConstant + 20: TypeInt 32 1 + 21: 20(int) Constant 0 + 22: 10(int) Constant 0 + 23: TypePointer Function 6(float) + 27: 10(int) Constant 1 + 31: TypeVector 10(int) 2 + 33: TypePointer Image 10(int) + 40: TypePointer Input 7(fvec4) +41(input.Position): 40(ptr) Variable Input + 43: TypePointer Function 7(fvec4) + 45: TypePointer Output 10(int) +46(@entryPointOutput): 45(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 39(input): 9(ptr) Variable Function + 47(param): 9(ptr) Variable Function + 42: 7(fvec4) Load 41(input.Position) + 44: 43(ptr) AccessChain 39(input) 21 + Store 44 42 + 48:8(InputStruct) Load 39(input) + Store 47(param) 48 + 49: 10(int) FunctionCall 13(@main(struct-InputStruct-vf41;) 47(param) + Store 46(@entryPointOutput) 49 + Return + FunctionEnd +13(@main(struct-InputStruct-vf41;): 10(int) Function None 11 + 12(input): 9(ptr) FunctionParameter + 14: Label + 16(oldVal): 15(ptr) Variable Function + 24: 23(ptr) AccessChain 12(input) 21 22 + 25: 6(float) Load 24 + 26: 10(int) ConvertFToU 25 + 28: 23(ptr) AccessChain 12(input) 21 27 + 29: 6(float) Load 28 + 30: 10(int) ConvertFToU 29 + 32: 31(ivec2) CompositeConstruct 26 30 + 34: 33(ptr) ImageTexelPointer 19(Values) 32 22 + 35: 10(int) AtomicExchange 34 27 22 27 + Store 16(oldVal) 35 + 36: 10(int) Load 16(oldVal) + ReturnValue 36 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.emptystructreturn.frag.out b/deps/glslang/Test/baseResults/hlsl.emptystructreturn.frag.out index 34a635c7..1c9953b5 100644 --- a/deps/glslang/Test/baseResults/hlsl.emptystructreturn.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.emptystructreturn.frag.out @@ -49,10 +49,7 @@ gl_FragCoord origin is upper left 0:? 'i' ( temp structure{}) 0:? Linker Objects -error: SPIRV-Tools Validation Errors -error: Input variable id <20> is used by entry point 'main' id <4>, but is not listed as an interface - %i_1 = OpVariable %_ptr_Input_ps_in Input - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 27 diff --git a/deps/glslang/Test/baseResults/hlsl.emptystructreturn.vert.out b/deps/glslang/Test/baseResults/hlsl.emptystructreturn.vert.out index 61704586..65d326d4 100644 --- a/deps/glslang/Test/baseResults/hlsl.emptystructreturn.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.emptystructreturn.vert.out @@ -47,10 +47,7 @@ Shader version: 500 0:? 'i' ( temp structure{}) 0:? Linker Objects -error: SPIRV-Tools Validation Errors -error: Input variable id <20> is used by entry point 'main' id <4>, but is not listed as an interface - %i_1 = OpVariable %_ptr_Input_vs_in Input - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 27 diff --git a/deps/glslang/Test/baseResults/hlsl.entry.rename.frag.out b/deps/glslang/Test/baseResults/hlsl.entry.rename.frag.out index 898eb4bd..9e23396a 100644 --- a/deps/glslang/Test/baseResults/hlsl.entry.rename.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.entry.rename.frag.out @@ -95,6 +95,7 @@ gl_FragCoord origin is upper left MemberDecorate 29($Global) 0 Offset 0 Decorate 29($Global) Block Decorate 31 DescriptorSet 0 + Decorate 31 Binding 0 2: TypeVoid 3: TypeFunction 2 8: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out b/deps/glslang/Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out index b5f34405..61367d6c 100644 --- a/deps/glslang/Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out @@ -31,7 +31,9 @@ hlsl.explicitDescriptorSet.frag MemberDecorate 25($Global) 0 Offset 0 Decorate 25($Global) Block Decorate 27 DescriptorSet 3 + Decorate 27 Binding 0 Decorate 30(floatbuff) DescriptorSet 3 + Decorate 30(floatbuff) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.explicitDescriptorSet.frag.out b/deps/glslang/Test/baseResults/hlsl.explicitDescriptorSet.frag.out index 8ab296fe..9bc2f019 100644 --- a/deps/glslang/Test/baseResults/hlsl.explicitDescriptorSet.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.explicitDescriptorSet.frag.out @@ -31,7 +31,9 @@ hlsl.explicitDescriptorSet.frag MemberDecorate 25($Global) 0 Offset 0 Decorate 25($Global) Block Decorate 27 DescriptorSet 4 + Decorate 27 Binding 0 Decorate 30(floatbuff) DescriptorSet 4 + Decorate 30(floatbuff) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.flattenOpaque.frag.out b/deps/glslang/Test/baseResults/hlsl.flattenOpaque.frag.out index eb47c3f8..94d02f49 100644 --- a/deps/glslang/Test/baseResults/hlsl.flattenOpaque.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.flattenOpaque.frag.out @@ -337,9 +337,13 @@ gl_FragCoord origin is upper left Name 114 "param" Name 120 "@entryPointOutput" Decorate 38(tex) DescriptorSet 0 + Decorate 38(tex) Binding 0 Decorate 82(s.s2D) DescriptorSet 0 + Decorate 82(s.s2D) Binding 0 Decorate 97(s2.s2D) DescriptorSet 0 + Decorate 97(s2.s2D) Binding 0 Decorate 100(s2.tex) DescriptorSet 0 + Decorate 100(s2.tex) Binding 0 Decorate 120(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.flattenOpaqueInit.vert.out b/deps/glslang/Test/baseResults/hlsl.flattenOpaqueInit.vert.out index 29da8446..a5a59442 100644 --- a/deps/glslang/Test/baseResults/hlsl.flattenOpaqueInit.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.flattenOpaqueInit.vert.out @@ -193,7 +193,9 @@ Shader version: 500 Name 71 "param" Name 80 "@entryPointOutput" Decorate 43(g_tInputTexture_sampler) DescriptorSet 0 + Decorate 43(g_tInputTexture_sampler) Binding 0 Decorate 47(g_tInputTexture) DescriptorSet 0 + Decorate 47(g_tInputTexture) Binding 0 Decorate 80(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out b/deps/glslang/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out index bf959804..5a2aa2a1 100644 --- a/deps/glslang/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out @@ -129,7 +129,9 @@ Shader version: 500 Name 51 "param" Name 57 "@entryPointOutput" Decorate 44(g_tInputTexture_sampler) DescriptorSet 0 + Decorate 44(g_tInputTexture_sampler) Binding 0 Decorate 47(g_tInputTexture) DescriptorSet 0 + Decorate 47(g_tInputTexture) Binding 0 Decorate 57(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.flattenSubset.frag.out b/deps/glslang/Test/baseResults/hlsl.flattenSubset.frag.out index 92e2a969..262a29d6 100644 --- a/deps/glslang/Test/baseResults/hlsl.flattenSubset.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.flattenSubset.frag.out @@ -152,7 +152,9 @@ gl_FragCoord origin is upper left Name 50 "@entryPointOutput" Name 51 "param" Decorate 21(samp) DescriptorSet 0 + Decorate 21(samp) Binding 0 Decorate 33(tex) DescriptorSet 0 + Decorate 33(tex) Binding 0 Decorate 47(vpos) Location 0 Decorate 50(@entryPointOutput) Location 0 2: TypeVoid diff --git a/deps/glslang/Test/baseResults/hlsl.flattenSubset2.frag.out b/deps/glslang/Test/baseResults/hlsl.flattenSubset2.frag.out index b22734a8..77dc4cd5 100644 --- a/deps/glslang/Test/baseResults/hlsl.flattenSubset2.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.flattenSubset2.frag.out @@ -180,6 +180,7 @@ gl_FragCoord origin is upper left Name 52 "@entryPointOutput" Name 53 "param" Decorate 36(someTex) DescriptorSet 0 + Decorate 36(someTex) Binding 0 Decorate 49(vpos) Location 0 Decorate 52(@entryPointOutput) Location 0 2: TypeVoid diff --git a/deps/glslang/Test/baseResults/hlsl.float4.frag.out b/deps/glslang/Test/baseResults/hlsl.float4.frag.out index cd741ed0..8dc33078 100644 --- a/deps/glslang/Test/baseResults/hlsl.float4.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.float4.frag.out @@ -68,6 +68,7 @@ gl_FragCoord origin is upper left MemberDecorate 15($Global) 4 Offset 48 Decorate 15($Global) Block Decorate 17 DescriptorSet 0 + Decorate 17 Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.gather.array.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.gather.array.dx10.frag.out index be4606a2..32d27ab0 100644 --- a/deps/glslang/Test/baseResults/hlsl.gather.array.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.gather.array.dx10.frag.out @@ -301,13 +301,19 @@ using depth_any Name 120 "g_tTex1di4a" Name 123 "g_tTex1du4a" Decorate 16(g_tTex2df4a) DescriptorSet 0 + Decorate 16(g_tTex2df4a) Binding 0 Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 37(g_tTex2di4a) DescriptorSet 0 + Decorate 37(g_tTex2di4a) Binding 0 Decorate 52(g_tTex2du4a) DescriptorSet 0 + Decorate 52(g_tTex2du4a) Binding 0 Decorate 64(g_tTexcdf4a) DescriptorSet 0 + Decorate 64(g_tTexcdf4a) Binding 0 Decorate 74(g_tTexcdi4a) DescriptorSet 0 + Decorate 74(g_tTexcdi4a) Binding 0 Decorate 84(g_tTexcdu4a) DescriptorSet 0 + Decorate 84(g_tTexcdu4a) Binding 0 Decorate 107(@entryPointOutput.Color) Location 0 Decorate 111(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 116(g_tTex1df4a) DescriptorSet 0 @@ -315,7 +321,9 @@ using depth_any Decorate 117(g_tTex1df4) DescriptorSet 0 Decorate 117(g_tTex1df4) Binding 0 Decorate 120(g_tTex1di4a) DescriptorSet 0 + Decorate 120(g_tTex1di4a) Binding 0 Decorate 123(g_tTex1du4a) DescriptorSet 0 + Decorate 123(g_tTex1du4a) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.gather.basic.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.gather.basic.dx10.frag.out index 8182ddeb..57e4499d 100644 --- a/deps/glslang/Test/baseResults/hlsl.gather.basic.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.gather.basic.dx10.frag.out @@ -300,25 +300,37 @@ using depth_any Name 131 "g_tTex3di4" Name 134 "g_tTex3du4" Decorate 16(g_tTex2df4) DescriptorSet 0 + Decorate 16(g_tTex2df4) Binding 0 Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 36(g_tTex2di4) DescriptorSet 0 + Decorate 36(g_tTex2di4) Binding 0 Decorate 51(g_tTex2du4) DescriptorSet 0 + Decorate 51(g_tTex2du4) Binding 0 Decorate 63(g_tTexcdf4) DescriptorSet 0 + Decorate 63(g_tTexcdf4) Binding 0 Decorate 74(g_tTexcdi4) DescriptorSet 0 + Decorate 74(g_tTexcdi4) Binding 0 Decorate 84(g_tTexcdu4) DescriptorSet 0 + Decorate 84(g_tTexcdu4) Binding 0 Decorate 108(@entryPointOutput.Color) Location 0 Decorate 112(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 115(g_sSamp2d) DescriptorSet 0 + Decorate 115(g_sSamp2d) Binding 0 Decorate 118(g_tTex1df4a) DescriptorSet 0 Decorate 118(g_tTex1df4a) Binding 1 Decorate 119(g_tTex1df4) DescriptorSet 0 Decorate 119(g_tTex1df4) Binding 0 Decorate 122(g_tTex1di4) DescriptorSet 0 + Decorate 122(g_tTex1di4) Binding 0 Decorate 125(g_tTex1du4) DescriptorSet 0 + Decorate 125(g_tTex1du4) Binding 0 Decorate 128(g_tTex3df4) DescriptorSet 0 + Decorate 128(g_tTex3df4) Binding 0 Decorate 131(g_tTex3di4) DescriptorSet 0 + Decorate 131(g_tTex3di4) Binding 0 Decorate 134(g_tTex3du4) DescriptorSet 0 + Decorate 134(g_tTex3du4) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.gather.basic.dx10.vert.out b/deps/glslang/Test/baseResults/hlsl.gather.basic.dx10.vert.out index fe561149..a0c8d159 100644 --- a/deps/glslang/Test/baseResults/hlsl.gather.basic.dx10.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.gather.basic.dx10.vert.out @@ -257,24 +257,36 @@ Shader version: 500 Name 122 "g_tTex3di4" Name 125 "g_tTex3du4" Decorate 16(g_tTex2df4) DescriptorSet 0 + Decorate 16(g_tTex2df4) Binding 0 Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 36(g_tTex2di4) DescriptorSet 0 + Decorate 36(g_tTex2di4) Binding 0 Decorate 51(g_tTex2du4) DescriptorSet 0 + Decorate 51(g_tTex2du4) Binding 0 Decorate 63(g_tTexcdf4) DescriptorSet 0 + Decorate 63(g_tTexcdf4) Binding 0 Decorate 74(g_tTexcdi4) DescriptorSet 0 + Decorate 74(g_tTexcdi4) Binding 0 Decorate 84(g_tTexcdu4) DescriptorSet 0 + Decorate 84(g_tTexcdu4) Binding 0 Decorate 103(@entryPointOutput.Pos) BuiltIn Position Decorate 106(g_sSamp2d) DescriptorSet 0 + Decorate 106(g_sSamp2d) Binding 0 Decorate 109(g_tTex1df4a) DescriptorSet 0 Decorate 109(g_tTex1df4a) Binding 1 Decorate 110(g_tTex1df4) DescriptorSet 0 Decorate 110(g_tTex1df4) Binding 0 Decorate 113(g_tTex1di4) DescriptorSet 0 + Decorate 113(g_tTex1di4) Binding 0 Decorate 116(g_tTex1du4) DescriptorSet 0 + Decorate 116(g_tTex1du4) Binding 0 Decorate 119(g_tTex3df4) DescriptorSet 0 + Decorate 119(g_tTex3df4) Binding 0 Decorate 122(g_tTex3di4) DescriptorSet 0 + Decorate 122(g_tTex3di4) Binding 0 Decorate 125(g_tTex3du4) DescriptorSet 0 + Decorate 125(g_tTex3du4) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.gather.offset.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.gather.offset.dx10.frag.out index ae816ddd..85ba2945 100644 --- a/deps/glslang/Test/baseResults/hlsl.gather.offset.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.gather.offset.dx10.frag.out @@ -246,10 +246,13 @@ using depth_any Name 110 "g_tTexcdi4" Name 113 "g_tTexcdu4" Decorate 16(g_tTex2df4) DescriptorSet 0 + Decorate 16(g_tTex2df4) Binding 0 Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 39(g_tTex2di4) DescriptorSet 0 + Decorate 39(g_tTex2di4) Binding 0 Decorate 55(g_tTex2du4) DescriptorSet 0 + Decorate 55(g_tTex2du4) Binding 0 Decorate 79(@entryPointOutput.Color) Location 0 Decorate 83(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 88(g_tTex1df4a) DescriptorSet 0 @@ -257,13 +260,21 @@ using depth_any Decorate 89(g_tTex1df4) DescriptorSet 0 Decorate 89(g_tTex1df4) Binding 0 Decorate 92(g_tTex1di4) DescriptorSet 0 + Decorate 92(g_tTex1di4) Binding 0 Decorate 95(g_tTex1du4) DescriptorSet 0 + Decorate 95(g_tTex1du4) Binding 0 Decorate 98(g_tTex3df4) DescriptorSet 0 + Decorate 98(g_tTex3df4) Binding 0 Decorate 101(g_tTex3di4) DescriptorSet 0 + Decorate 101(g_tTex3di4) Binding 0 Decorate 104(g_tTex3du4) DescriptorSet 0 + Decorate 104(g_tTex3du4) Binding 0 Decorate 107(g_tTexcdf4) DescriptorSet 0 + Decorate 107(g_tTexcdf4) Binding 0 Decorate 110(g_tTexcdi4) DescriptorSet 0 + Decorate 110(g_tTexcdi4) Binding 0 Decorate 113(g_tTexcdu4) DescriptorSet 0 + Decorate 113(g_tTexcdu4) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.gather.offsetarray.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.gather.offsetarray.dx10.frag.out index 88052321..c73547e3 100644 --- a/deps/glslang/Test/baseResults/hlsl.gather.offsetarray.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.gather.offsetarray.dx10.frag.out @@ -234,10 +234,13 @@ using depth_any Name 93 "g_tTex1di4" Name 96 "g_tTex1du4" Decorate 16(g_tTex2df4) DescriptorSet 0 + Decorate 16(g_tTex2df4) Binding 0 Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 40(g_tTex2di4) DescriptorSet 0 + Decorate 40(g_tTex2di4) Binding 0 Decorate 55(g_tTex2du4) DescriptorSet 0 + Decorate 55(g_tTex2du4) Binding 0 Decorate 80(@entryPointOutput.Color) Location 0 Decorate 84(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 89(g_tTex1df4a) DescriptorSet 0 @@ -245,7 +248,9 @@ using depth_any Decorate 90(g_tTex1df4) DescriptorSet 0 Decorate 90(g_tTex1df4) Binding 0 Decorate 93(g_tTex1di4) DescriptorSet 0 + Decorate 93(g_tTex1di4) Binding 0 Decorate 96(g_tTex1du4) DescriptorSet 0 + Decorate 96(g_tTex1du4) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out index 35b0a003..ac6c8174 100644 --- a/deps/glslang/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out @@ -813,6 +813,7 @@ using depth_any Name 251 "g_tTex1di4a" Name 254 "g_tTex1du4a" Decorate 16(g_tTex2df4a) DescriptorSet 0 + Decorate 16(g_tTex2df4a) Binding 0 Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 MemberDecorate 26($Global) 0 Offset 0 @@ -821,18 +822,27 @@ using depth_any MemberDecorate 26($Global) 3 Offset 32 Decorate 26($Global) Block Decorate 28 DescriptorSet 0 + Decorate 28 Binding 0 Decorate 41(g_tTex2di4a) DescriptorSet 0 + Decorate 41(g_tTex2di4a) Binding 0 Decorate 55(g_tTex2du4a) DescriptorSet 0 + Decorate 55(g_tTex2du4a) Binding 0 Decorate 131(g_tTexcdf4a) DescriptorSet 0 + Decorate 131(g_tTexcdf4a) Binding 0 Decorate 143(g_tTexcdi4a) DescriptorSet 0 + Decorate 143(g_tTexcdi4a) Binding 0 Decorate 154(g_tTexcdu4a) DescriptorSet 0 + Decorate 154(g_tTexcdu4a) Binding 0 Decorate 238(@entryPointOutput.Color) Location 0 Decorate 242(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 245(g_sSamp2d) DescriptorSet 0 + Decorate 245(g_sSamp2d) Binding 0 Decorate 248(g_tTex1df4a) DescriptorSet 0 Decorate 248(g_tTex1df4a) Binding 0 Decorate 251(g_tTex1di4a) DescriptorSet 0 + Decorate 251(g_tTex1di4a) Binding 0 Decorate 254(g_tTex1du4a) DescriptorSet 0 + Decorate 254(g_tTex1du4a) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out index d0be6d5a..8617d701 100644 --- a/deps/glslang/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out @@ -824,6 +824,7 @@ using depth_any Name 261 "g_tTex3di4" Name 264 "g_tTex3du4" Decorate 16(g_tTex2df4) DescriptorSet 0 + Decorate 16(g_tTex2df4) Binding 0 Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 MemberDecorate 26($Global) 0 Offset 0 @@ -832,23 +833,35 @@ using depth_any MemberDecorate 26($Global) 3 Offset 32 Decorate 26($Global) Block Decorate 28 DescriptorSet 0 + Decorate 28 Binding 0 Decorate 41(g_tTex2di4) DescriptorSet 0 + Decorate 41(g_tTex2di4) Binding 0 Decorate 55(g_tTex2du4) DescriptorSet 0 + Decorate 55(g_tTex2du4) Binding 0 Decorate 131(g_tTexcdf4) DescriptorSet 0 + Decorate 131(g_tTexcdf4) Binding 0 Decorate 143(g_tTexcdi4) DescriptorSet 0 + Decorate 143(g_tTexcdi4) Binding 0 Decorate 154(g_tTexcdu4) DescriptorSet 0 + Decorate 154(g_tTexcdu4) Binding 0 Decorate 238(@entryPointOutput.Color) Location 0 Decorate 242(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 245(g_sSamp2d) DescriptorSet 0 + Decorate 245(g_sSamp2d) Binding 0 Decorate 248(g_tTex1df4a) DescriptorSet 0 Decorate 248(g_tTex1df4a) Binding 1 Decorate 249(g_tTex1df4) DescriptorSet 0 Decorate 249(g_tTex1df4) Binding 0 Decorate 252(g_tTex1di4) DescriptorSet 0 + Decorate 252(g_tTex1di4) Binding 0 Decorate 255(g_tTex1du4) DescriptorSet 0 + Decorate 255(g_tTex1du4) Binding 0 Decorate 258(g_tTex3df4) DescriptorSet 0 + Decorate 258(g_tTex3df4) Binding 0 Decorate 261(g_tTex3di4) DescriptorSet 0 + Decorate 261(g_tTex3di4) Binding 0 Decorate 264(g_tTex3du4) DescriptorSet 0 + Decorate 264(g_tTex3du4) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out index 33c9af43..4a0d77a0 100644 --- a/deps/glslang/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out @@ -1261,10 +1261,7 @@ using depth_any 0:? '@entryPointOutput.Depth' ( out float FragDepth) 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: Expected Image Operand ConstOffsets to be a const object - %90 = OpImageGather %v4float %76 %78 %int_0 ConstOffsets %89 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 399 @@ -1337,6 +1334,7 @@ error: Expected Image Operand ConstOffsets to be a const object Name 395 "g_tTexcdi4" Name 398 "g_tTexcdu4" Decorate 16(g_tTex2df4) DescriptorSet 0 + Decorate 16(g_tTex2df4) Binding 0 Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 MemberDecorate 30($Global) 0 Offset 0 @@ -1349,23 +1347,35 @@ error: Expected Image Operand ConstOffsets to be a const object MemberDecorate 30($Global) 7 Offset 80 Decorate 30($Global) Block Decorate 32 DescriptorSet 0 + Decorate 32 Binding 0 Decorate 47(g_tTex2di4) DescriptorSet 0 + Decorate 47(g_tTex2di4) Binding 0 Decorate 63(g_tTex2du4) DescriptorSet 0 + Decorate 63(g_tTex2du4) Binding 0 Decorate 363(@entryPointOutput.Color) Location 0 Decorate 367(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 370(g_sSamp2d) DescriptorSet 0 + Decorate 370(g_sSamp2d) Binding 0 Decorate 373(g_tTex1df4a) DescriptorSet 0 Decorate 373(g_tTex1df4a) Binding 1 Decorate 374(g_tTex1df4) DescriptorSet 0 Decorate 374(g_tTex1df4) Binding 0 Decorate 377(g_tTex1di4) DescriptorSet 0 + Decorate 377(g_tTex1di4) Binding 0 Decorate 380(g_tTex1du4) DescriptorSet 0 + Decorate 380(g_tTex1du4) Binding 0 Decorate 383(g_tTex3df4) DescriptorSet 0 + Decorate 383(g_tTex3df4) Binding 0 Decorate 386(g_tTex3di4) DescriptorSet 0 + Decorate 386(g_tTex3di4) Binding 0 Decorate 389(g_tTex3du4) DescriptorSet 0 + Decorate 389(g_tTex3du4) Binding 0 Decorate 392(g_tTexcdf4) DescriptorSet 0 + Decorate 392(g_tTexcdf4) Binding 0 Decorate 395(g_tTexcdi4) DescriptorSet 0 + Decorate 395(g_tTexcdi4) Binding 0 Decorate 398(g_tTexcdu4) DescriptorSet 0 + Decorate 398(g_tTexcdu4) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out index 22b02e7f..c9740b05 100644 --- a/deps/glslang/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out @@ -1253,10 +1253,7 @@ using depth_any 0:? '@entryPointOutput.Depth' ( out float FragDepth) 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: Expected Image Operand ConstOffsets to be a const object - %90 = OpImageGather %v4float %76 %78 %int_0 ConstOffsets %89 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 389 @@ -1326,6 +1323,7 @@ error: Expected Image Operand ConstOffsets to be a const object Name 385 "g_tTexcdi4a" Name 388 "g_tTexcdu4a" Decorate 16(g_tTex2df4a) DescriptorSet 0 + Decorate 16(g_tTex2df4a) Binding 0 Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 MemberDecorate 30($Global) 0 Offset 0 @@ -1338,18 +1336,27 @@ error: Expected Image Operand ConstOffsets to be a const object MemberDecorate 30($Global) 7 Offset 80 Decorate 30($Global) Block Decorate 32 DescriptorSet 0 + Decorate 32 Binding 0 Decorate 47(g_tTex2di4a) DescriptorSet 0 + Decorate 47(g_tTex2di4a) Binding 0 Decorate 63(g_tTex2du4a) DescriptorSet 0 + Decorate 63(g_tTex2du4a) Binding 0 Decorate 363(@entryPointOutput.Color) Location 0 Decorate 367(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 370(g_sSamp2d) DescriptorSet 0 + Decorate 370(g_sSamp2d) Binding 0 Decorate 373(g_tTex1df4a) DescriptorSet 0 Decorate 373(g_tTex1df4a) Binding 0 Decorate 376(g_tTex1di4a) DescriptorSet 0 + Decorate 376(g_tTex1di4a) Binding 0 Decorate 379(g_tTex1du4a) DescriptorSet 0 + Decorate 379(g_tTex1du4a) Binding 0 Decorate 382(g_tTexcdf4a) DescriptorSet 0 + Decorate 382(g_tTexcdf4a) Binding 0 Decorate 385(g_tTexcdi4a) DescriptorSet 0 + Decorate 385(g_tTexcdi4a) Binding 0 Decorate 388(g_tTexcdu4a) DescriptorSet 0 + Decorate 388(g_tTexcdu4a) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out index fe99df52..5e2d4221 100644 --- a/deps/glslang/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out @@ -507,6 +507,7 @@ using depth_any Name 160 "g_tTexcdi4" Name 163 "g_tTexcdu4" Decorate 16(g_tTex2df4) DescriptorSet 0 + Decorate 16(g_tTex2df4) Binding 0 Decorate 20(g_sSampCmp) DescriptorSet 0 Decorate 20(g_sSampCmp) Binding 0 MemberDecorate 26($Global) 0 Offset 0 @@ -515,8 +516,11 @@ using depth_any MemberDecorate 26($Global) 3 Offset 32 Decorate 26($Global) Block Decorate 28 DescriptorSet 0 + Decorate 28 Binding 0 Decorate 44(g_tTex2di4) DescriptorSet 0 + Decorate 44(g_tTex2di4) Binding 0 Decorate 60(g_tTex2du4) DescriptorSet 0 + Decorate 60(g_tTex2du4) Binding 0 Decorate 129(@entryPointOutput.Color) Location 0 Decorate 133(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 138(g_tTex1df4a) DescriptorSet 0 @@ -524,13 +528,21 @@ using depth_any Decorate 139(g_tTex1df4) DescriptorSet 0 Decorate 139(g_tTex1df4) Binding 0 Decorate 142(g_tTex1di4) DescriptorSet 0 + Decorate 142(g_tTex1di4) Binding 0 Decorate 145(g_tTex1du4) DescriptorSet 0 + Decorate 145(g_tTex1du4) Binding 0 Decorate 148(g_tTex3df4) DescriptorSet 0 + Decorate 148(g_tTex3df4) Binding 0 Decorate 151(g_tTex3di4) DescriptorSet 0 + Decorate 151(g_tTex3di4) Binding 0 Decorate 154(g_tTex3du4) DescriptorSet 0 + Decorate 154(g_tTex3du4) Binding 0 Decorate 157(g_tTexcdf4) DescriptorSet 0 + Decorate 157(g_tTexcdf4) Binding 0 Decorate 160(g_tTexcdi4) DescriptorSet 0 + Decorate 160(g_tTexcdi4) Binding 0 Decorate 163(g_tTexcdu4) DescriptorSet 0 + Decorate 163(g_tTexcdu4) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out index 599c6591..eb92fbb0 100644 --- a/deps/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out @@ -2425,31 +2425,57 @@ using depth_any Decorate 17(g_tTex1df4) DescriptorSet 0 Decorate 17(g_tTex1df4) Binding 0 Decorate 35(g_tTex1di4) DescriptorSet 0 + Decorate 35(g_tTex1di4) Binding 0 Decorate 48(g_tTex1du4) DescriptorSet 0 + Decorate 48(g_tTex1du4) Binding 0 Decorate 63(g_tTex1df4a) DescriptorSet 0 + Decorate 63(g_tTex1df4a) Binding 0 Decorate 85(g_tTex1di4a) DescriptorSet 0 + Decorate 85(g_tTex1di4a) Binding 0 Decorate 104(g_tTex1du4a) DescriptorSet 0 + Decorate 104(g_tTex1du4a) Binding 0 Decorate 123(g_tTex2df4) DescriptorSet 0 + Decorate 123(g_tTex2df4) Binding 0 Decorate 143(g_tTex2di4) DescriptorSet 0 + Decorate 143(g_tTex2di4) Binding 0 Decorate 162(g_tTex2du4) DescriptorSet 0 + Decorate 162(g_tTex2du4) Binding 0 Decorate 183(g_tTex2df4a) DescriptorSet 0 + Decorate 183(g_tTex2df4a) Binding 0 Decorate 207(g_tTex2di4a) DescriptorSet 0 + Decorate 207(g_tTex2di4a) Binding 0 Decorate 230(g_tTex2du4a) DescriptorSet 0 + Decorate 230(g_tTex2du4a) Binding 0 Decorate 253(g_tTex3df4) DescriptorSet 0 + Decorate 253(g_tTex3df4) Binding 0 Decorate 277(g_tTex3di4) DescriptorSet 0 + Decorate 277(g_tTex3di4) Binding 0 Decorate 300(g_tTex3du4) DescriptorSet 0 + Decorate 300(g_tTex3du4) Binding 0 Decorate 323(g_tTexcdf4) DescriptorSet 0 + Decorate 323(g_tTexcdf4) Binding 0 Decorate 342(g_tTexcdi4) DescriptorSet 0 + Decorate 342(g_tTexcdi4) Binding 0 Decorate 361(g_tTexcdu4) DescriptorSet 0 + Decorate 361(g_tTexcdu4) Binding 0 Decorate 380(g_tTexcdf4a) DescriptorSet 0 + Decorate 380(g_tTexcdf4a) Binding 0 Decorate 403(g_tTexcdi4a) DescriptorSet 0 + Decorate 403(g_tTexcdi4a) Binding 0 Decorate 426(g_tTexcdu4a) DescriptorSet 0 + Decorate 426(g_tTexcdu4a) Binding 0 Decorate 449(g_tTex2dmsf4) DescriptorSet 0 + Decorate 449(g_tTex2dmsf4) Binding 0 Decorate 462(g_tTex2dmsi4) DescriptorSet 0 + Decorate 462(g_tTex2dmsi4) Binding 0 Decorate 474(g_tTex2dmsu4) DescriptorSet 0 + Decorate 474(g_tTex2dmsu4) Binding 0 Decorate 486(g_tTex2dmsf4a) DescriptorSet 0 + Decorate 486(g_tTex2dmsf4a) Binding 0 Decorate 500(g_tTex2dmsi4a) DescriptorSet 0 + Decorate 500(g_tTex2dmsi4a) Binding 0 Decorate 514(g_tTex2dmsu4a) DescriptorSet 0 + Decorate 514(g_tTex2dmsu4a) Binding 0 Decorate 540(@entryPointOutput.Color) Location 0 Decorate 544(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 549(g_sSamp) DescriptorSet 0 diff --git a/deps/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out index 0b9a6740..d8675a20 100644 --- a/deps/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out @@ -794,22 +794,39 @@ using depth_any Decorate 17(g_tTex1df4) DescriptorSet 0 Decorate 17(g_tTex1df4) Binding 0 Decorate 26(g_tTex1di4) DescriptorSet 0 + Decorate 26(g_tTex1di4) Binding 0 Decorate 33(g_tTex1du4) DescriptorSet 0 + Decorate 33(g_tTex1du4) Binding 0 Decorate 40(g_tBuffF) DescriptorSet 0 + Decorate 40(g_tBuffF) Binding 0 Decorate 47(g_tBuffI) DescriptorSet 0 + Decorate 47(g_tBuffI) Binding 0 Decorate 54(g_tBuffU) DescriptorSet 0 + Decorate 54(g_tBuffU) Binding 0 Decorate 63(g_tTex1df4a) DescriptorSet 0 + Decorate 63(g_tTex1df4a) Binding 0 Decorate 76(g_tTex1di4a) DescriptorSet 0 + Decorate 76(g_tTex1di4a) Binding 0 Decorate 86(g_tTex1du4a) DescriptorSet 0 + Decorate 86(g_tTex1du4a) Binding 0 Decorate 96(g_tTex2df4) DescriptorSet 0 + Decorate 96(g_tTex2df4) Binding 0 Decorate 107(g_tTex2di4) DescriptorSet 0 + Decorate 107(g_tTex2di4) Binding 0 Decorate 117(g_tTex2du4) DescriptorSet 0 + Decorate 117(g_tTex2du4) Binding 0 Decorate 129(g_tTex2df4a) DescriptorSet 0 + Decorate 129(g_tTex2df4a) Binding 0 Decorate 142(g_tTex2di4a) DescriptorSet 0 + Decorate 142(g_tTex2di4a) Binding 0 Decorate 154(g_tTex2du4a) DescriptorSet 0 + Decorate 154(g_tTex2du4a) Binding 0 Decorate 166(g_tTex3df4) DescriptorSet 0 + Decorate 166(g_tTex3df4) Binding 0 Decorate 179(g_tTex3di4) DescriptorSet 0 + Decorate 179(g_tTex3di4) Binding 0 Decorate 191(g_tTex3du4) DescriptorSet 0 + Decorate 191(g_tTex3du4) Binding 0 Decorate 216(@entryPointOutput.Color) Location 0 Decorate 220(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 225(g_sSamp) DescriptorSet 0 @@ -824,6 +841,7 @@ using depth_any MemberDecorate 229($Global) 7 Offset 80 Decorate 229($Global) Block Decorate 231 DescriptorSet 0 + Decorate 231 Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out index 51bd0769..d1e28447 100644 --- a/deps/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out @@ -620,7 +620,9 @@ using depth_any Name 192 "@entryPointOutput.Depth" Name 197 "g_sSamp" Decorate 23(g_tTex2dmsf4) DescriptorSet 0 + Decorate 23(g_tTex2dmsf4) Binding 0 Decorate 131(g_tTex2dmsf4a) DescriptorSet 0 + Decorate 131(g_tTex2dmsf4a) Binding 0 Decorate 181(sample) Flat Decorate 181(sample) Location 0 Decorate 188(@entryPointOutput.Color) Location 0 diff --git a/deps/glslang/Test/baseResults/hlsl.global-const-init.frag.out b/deps/glslang/Test/baseResults/hlsl.global-const-init.frag.out index 940f3be8..a1aa55b5 100644 --- a/deps/glslang/Test/baseResults/hlsl.global-const-init.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.global-const-init.frag.out @@ -122,6 +122,7 @@ gl_FragCoord origin is upper left MemberDecorate 13(CB) 0 Offset 0 Decorate 13(CB) Block Decorate 15 DescriptorSet 0 + Decorate 15 Binding 0 Decorate 41(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.groupid.comp.out b/deps/glslang/Test/baseResults/hlsl.groupid.comp.out index 386a3e97..a76db505 100644 --- a/deps/glslang/Test/baseResults/hlsl.groupid.comp.out +++ b/deps/glslang/Test/baseResults/hlsl.groupid.comp.out @@ -100,6 +100,7 @@ local_size = (8, 8, 1) Name 29 "vGroupId" Name 34 "param" Decorate 22(OutputTexture) DescriptorSet 0 + Decorate 22(OutputTexture) Binding 0 Decorate 29(vGroupId) BuiltIn WorkgroupId 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.hlslOffset.vert.out b/deps/glslang/Test/baseResults/hlsl.hlslOffset.vert.out index 8393d837..b0c04672 100644 --- a/deps/glslang/Test/baseResults/hlsl.hlslOffset.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.hlslOffset.vert.out @@ -63,6 +63,7 @@ Shader version: 500 MemberDecorate 15(b) 10 Offset 96 Decorate 15(b) Block Decorate 17 DescriptorSet 0 + Decorate 17 Binding 0 2: TypeVoid 3: TypeFunction 2 9: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.implicitBool.frag.out b/deps/glslang/Test/baseResults/hlsl.implicitBool.frag.out index 72894f23..c6161258 100644 --- a/deps/glslang/Test/baseResults/hlsl.implicitBool.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.implicitBool.frag.out @@ -360,6 +360,7 @@ gl_FragCoord origin is upper left MemberDecorate 16($Global) 3 Offset 12 Decorate 16($Global) Block Decorate 18 DescriptorSet 0 + Decorate 18 Binding 0 Decorate 137(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.include.vert.out b/deps/glslang/Test/baseResults/hlsl.include.vert.out index 020879d1..88ee8e78 100644 --- a/deps/glslang/Test/baseResults/hlsl.include.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.include.vert.out @@ -27,6 +27,7 @@ MemberDecorate 11($Global) 5 Offset 80 Decorate 11($Global) Block Decorate 13 DescriptorSet 0 + Decorate 13 Binding 0 Decorate 42(@entryPointOutput) BuiltIn Position 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.init.frag.out b/deps/glslang/Test/baseResults/hlsl.init.frag.out index 9fc816ce..1d9a5efa 100644 --- a/deps/glslang/Test/baseResults/hlsl.init.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.init.frag.out @@ -397,6 +397,7 @@ gl_FragCoord origin is upper left MemberDecorate 107(Constants) 2 Offset 8 Decorate 107(Constants) Block Decorate 109 DescriptorSet 0 + Decorate 109 Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.int.dot.frag.out b/deps/glslang/Test/baseResults/hlsl.int.dot.frag.out new file mode 100644 index 00000000..afe44c85 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.int.dot.frag.out @@ -0,0 +1,339 @@ +hlsl.int.dot.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:1 Function Definition: @main( ( temp 4-component vector of float) +0:1 Function Parameters: +0:? Sequence +0:2 Sequence +0:2 move second child to first child ( temp int) +0:2 'i' ( temp int) +0:2 Constant: +0:2 1 (const int) +0:3 Sequence +0:3 move second child to first child ( temp 1-component vector of int) +0:3 'i2' ( temp 1-component vector of int) +0:3 Constant: +0:3 2 (const int) +0:4 Sequence +0:4 move second child to first child ( temp 2-component vector of int) +0:4 'i3' ( temp 2-component vector of int) +0:4 Constant: +0:4 3 (const int) +0:4 3 (const int) +0:5 Sequence +0:5 move second child to first child ( temp 3-component vector of int) +0:5 'i4' ( temp 3-component vector of int) +0:5 Constant: +0:5 4 (const int) +0:5 4 (const int) +0:5 4 (const int) +0:6 Sequence +0:6 move second child to first child ( temp 4-component vector of int) +0:6 'i5' ( temp 4-component vector of int) +0:6 Constant: +0:6 5 (const int) +0:6 5 (const int) +0:6 5 (const int) +0:6 5 (const int) +0:8 move second child to first child ( temp int) +0:8 'i' ( temp int) +0:8 dot-product ( temp int) +0:8 'i' ( temp int) +0:8 'i' ( temp int) +0:9 move second child to first child ( temp 1-component vector of int) +0:9 'i2' ( temp 1-component vector of int) +0:9 Construct int ( temp 1-component vector of int) +0:9 dot-product ( temp int) +0:9 Construct int ( in int) +0:9 'i2' ( temp 1-component vector of int) +0:9 Construct int ( in int) +0:9 'i2' ( temp 1-component vector of int) +0:10 move second child to first child ( temp 2-component vector of int) +0:10 'i3' ( temp 2-component vector of int) +0:10 Construct ivec2 ( temp 2-component vector of int) +0:10 dot-product ( temp int) +0:10 'i3' ( temp 2-component vector of int) +0:10 'i3' ( temp 2-component vector of int) +0:11 move second child to first child ( temp 3-component vector of int) +0:11 'i4' ( temp 3-component vector of int) +0:11 Construct ivec3 ( temp 3-component vector of int) +0:11 dot-product ( temp int) +0:11 'i4' ( temp 3-component vector of int) +0:11 'i4' ( temp 3-component vector of int) +0:12 move second child to first child ( temp 4-component vector of int) +0:12 'i5' ( temp 4-component vector of int) +0:12 Construct ivec4 ( temp 4-component vector of int) +0:12 dot-product ( temp int) +0:12 'i5' ( temp 4-component vector of int) +0:12 'i5' ( temp 4-component vector of int) +0:13 Branch: Return with expression +0:13 Convert int to float ( temp 4-component vector of float) +0:13 add ( temp 4-component vector of int) +0:13 add ( temp 4-component vector of int) +0:13 add ( temp 4-component vector of int) +0:13 add ( temp 4-component vector of int) +0:13 'i' ( temp int) +0:13 Construct ivec4 ( temp 4-component vector of int) +0:13 Construct int ( temp int) +0:13 'i2' ( temp 1-component vector of int) +0:13 vector swizzle ( temp 4-component vector of int) +0:13 'i3' ( temp 2-component vector of int) +0:13 Sequence +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 vector swizzle ( temp 4-component vector of int) +0:13 'i4' ( temp 3-component vector of int) +0:13 Sequence +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 2 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 'i5' ( temp 4-component vector of int) +0:1 Function Definition: main( ( temp void) +0:1 Function Parameters: +0:? Sequence +0:1 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:1 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:1 Function Definition: @main( ( temp 4-component vector of float) +0:1 Function Parameters: +0:? Sequence +0:2 Sequence +0:2 move second child to first child ( temp int) +0:2 'i' ( temp int) +0:2 Constant: +0:2 1 (const int) +0:3 Sequence +0:3 move second child to first child ( temp 1-component vector of int) +0:3 'i2' ( temp 1-component vector of int) +0:3 Constant: +0:3 2 (const int) +0:4 Sequence +0:4 move second child to first child ( temp 2-component vector of int) +0:4 'i3' ( temp 2-component vector of int) +0:4 Constant: +0:4 3 (const int) +0:4 3 (const int) +0:5 Sequence +0:5 move second child to first child ( temp 3-component vector of int) +0:5 'i4' ( temp 3-component vector of int) +0:5 Constant: +0:5 4 (const int) +0:5 4 (const int) +0:5 4 (const int) +0:6 Sequence +0:6 move second child to first child ( temp 4-component vector of int) +0:6 'i5' ( temp 4-component vector of int) +0:6 Constant: +0:6 5 (const int) +0:6 5 (const int) +0:6 5 (const int) +0:6 5 (const int) +0:8 move second child to first child ( temp int) +0:8 'i' ( temp int) +0:8 dot-product ( temp int) +0:8 'i' ( temp int) +0:8 'i' ( temp int) +0:9 move second child to first child ( temp 1-component vector of int) +0:9 'i2' ( temp 1-component vector of int) +0:9 Construct int ( temp 1-component vector of int) +0:9 dot-product ( temp int) +0:9 Construct int ( in int) +0:9 'i2' ( temp 1-component vector of int) +0:9 Construct int ( in int) +0:9 'i2' ( temp 1-component vector of int) +0:10 move second child to first child ( temp 2-component vector of int) +0:10 'i3' ( temp 2-component vector of int) +0:10 Construct ivec2 ( temp 2-component vector of int) +0:10 dot-product ( temp int) +0:10 'i3' ( temp 2-component vector of int) +0:10 'i3' ( temp 2-component vector of int) +0:11 move second child to first child ( temp 3-component vector of int) +0:11 'i4' ( temp 3-component vector of int) +0:11 Construct ivec3 ( temp 3-component vector of int) +0:11 dot-product ( temp int) +0:11 'i4' ( temp 3-component vector of int) +0:11 'i4' ( temp 3-component vector of int) +0:12 move second child to first child ( temp 4-component vector of int) +0:12 'i5' ( temp 4-component vector of int) +0:12 Construct ivec4 ( temp 4-component vector of int) +0:12 dot-product ( temp int) +0:12 'i5' ( temp 4-component vector of int) +0:12 'i5' ( temp 4-component vector of int) +0:13 Branch: Return with expression +0:13 Convert int to float ( temp 4-component vector of float) +0:13 add ( temp 4-component vector of int) +0:13 add ( temp 4-component vector of int) +0:13 add ( temp 4-component vector of int) +0:13 add ( temp 4-component vector of int) +0:13 'i' ( temp int) +0:13 Construct ivec4 ( temp 4-component vector of int) +0:13 Construct int ( temp int) +0:13 'i2' ( temp 1-component vector of int) +0:13 vector swizzle ( temp 4-component vector of int) +0:13 'i3' ( temp 2-component vector of int) +0:13 Sequence +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 vector swizzle ( temp 4-component vector of int) +0:13 'i4' ( temp 3-component vector of int) +0:13 Sequence +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 2 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 'i5' ( temp 4-component vector of int) +0:1 Function Definition: main( ( temp void) +0:1 Function Parameters: +0:? Sequence +0:1 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:1 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 84 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 82 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "@main(" + Name 13 "i" + Name 15 "i2" + Name 19 "i3" + Name 24 "i4" + Name 29 "i5" + Name 82 "@entryPointOutput" + Decorate 82(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeInt 32 1 + 12: TypePointer Function 11(int) + 14: 11(int) Constant 1 + 16: 11(int) Constant 2 + 17: TypeVector 11(int) 2 + 18: TypePointer Function 17(ivec2) + 20: 11(int) Constant 3 + 21: 17(ivec2) ConstantComposite 20 20 + 22: TypeVector 11(int) 3 + 23: TypePointer Function 22(ivec3) + 25: 11(int) Constant 4 + 26: 22(ivec3) ConstantComposite 25 25 25 + 27: TypeVector 11(int) 4 + 28: TypePointer Function 27(ivec4) + 30: 11(int) Constant 5 + 31: 27(ivec4) ConstantComposite 30 30 30 30 + 81: TypePointer Output 7(fvec4) +82(@entryPointOutput): 81(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 83: 7(fvec4) FunctionCall 9(@main() + Store 82(@entryPointOutput) 83 + Return + FunctionEnd + 9(@main(): 7(fvec4) Function None 8 + 10: Label + 13(i): 12(ptr) Variable Function + 15(i2): 12(ptr) Variable Function + 19(i3): 18(ptr) Variable Function + 24(i4): 23(ptr) Variable Function + 29(i5): 28(ptr) Variable Function + Store 13(i) 14 + Store 15(i2) 16 + Store 19(i3) 21 + Store 24(i4) 26 + Store 29(i5) 31 + 32: 11(int) Load 13(i) + 33: 11(int) Load 13(i) + 34: 11(int) IMul 32 33 + Store 13(i) 34 + 35: 11(int) Load 15(i2) + 36: 11(int) Load 15(i2) + 37: 11(int) IMul 35 36 + Store 15(i2) 37 + 38: 17(ivec2) Load 19(i3) + 39: 17(ivec2) Load 19(i3) + 40: 17(ivec2) IMul 38 39 + 41: 11(int) CompositeExtract 40 0 + 42: 11(int) CompositeExtract 38 1 + 43: 11(int) IAdd 41 42 + 44: 17(ivec2) CompositeConstruct 43 43 + Store 19(i3) 44 + 45: 22(ivec3) Load 24(i4) + 46: 22(ivec3) Load 24(i4) + 47: 22(ivec3) IMul 45 46 + 48: 11(int) CompositeExtract 47 0 + 49: 11(int) CompositeExtract 45 1 + 50: 11(int) IAdd 48 49 + 51: 11(int) CompositeExtract 45 2 + 52: 11(int) IAdd 50 51 + 53: 22(ivec3) CompositeConstruct 52 52 52 + Store 24(i4) 53 + 54: 27(ivec4) Load 29(i5) + 55: 27(ivec4) Load 29(i5) + 56: 27(ivec4) IMul 54 55 + 57: 11(int) CompositeExtract 56 0 + 58: 11(int) CompositeExtract 54 1 + 59: 11(int) IAdd 57 58 + 60: 11(int) CompositeExtract 54 2 + 61: 11(int) IAdd 59 60 + 62: 11(int) CompositeExtract 54 3 + 63: 11(int) IAdd 61 62 + 64: 27(ivec4) CompositeConstruct 63 63 63 63 + Store 29(i5) 64 + 65: 11(int) Load 13(i) + 66: 11(int) Load 15(i2) + 67: 27(ivec4) CompositeConstruct 66 66 66 66 + 68: 27(ivec4) CompositeConstruct 65 65 65 65 + 69: 27(ivec4) IAdd 68 67 + 70: 17(ivec2) Load 19(i3) + 71: 27(ivec4) VectorShuffle 70 70 0 1 0 1 + 72: 27(ivec4) IAdd 69 71 + 73: 22(ivec3) Load 24(i4) + 74: 27(ivec4) VectorShuffle 73 73 0 1 2 0 + 75: 27(ivec4) IAdd 72 74 + 76: 27(ivec4) Load 29(i5) + 77: 27(ivec4) IAdd 75 76 + 78: 7(fvec4) ConvertSToF 77 + ReturnValue 78 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.comp.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.comp.out index 5058f236..3329c5cb 100644 --- a/deps/glslang/Test/baseResults/hlsl.intrinsics.comp.out +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.comp.out @@ -715,10 +715,7 @@ local_size = (1, 1, 1) 0:? 'inU0' (layout( location=3) in 4-component vector of uint) 0:? 'inU1' (layout( location=4) in 4-component vector of uint) -error: SPIRV-Tools Validation Errors -error: Expected operand to be vector bool: All - %64 = OpAll %bool %63 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 265 diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.d3dcolortoubyte4.frag.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.d3dcolortoubyte4.frag.out index 970691c5..f2216def 100644 --- a/deps/glslang/Test/baseResults/hlsl.intrinsics.d3dcolortoubyte4.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.d3dcolortoubyte4.frag.out @@ -92,6 +92,7 @@ gl_FragCoord origin is upper left MemberDecorate 14($Global) 0 Offset 0 Decorate 14($Global) Block Decorate 16 DescriptorSet 0 + Decorate 16 Binding 0 Decorate 27(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.evalfns.frag.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.evalfns.frag.out index 4fd1e7b3..3f69827d 100644 --- a/deps/glslang/Test/baseResults/hlsl.intrinsics.evalfns.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.evalfns.frag.out @@ -153,10 +153,7 @@ gl_FragCoord origin is upper left 0:? 'inF4' (layout( location=3) in 4-component vector of float) 0:? 'inI2' (layout( location=4) flat in 2-component vector of int) -error: SPIRV-Tools Validation Errors -error: GLSL.std.450 InterpolateAtOffset: expected Interpolant storage class to be Input - %28 = OpExtInst %float %1 InterpolateAtOffset %inF1 %27 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 80 diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.frag.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.frag.out index 20d2bb04..b8add071 100644 --- a/deps/glslang/Test/baseResults/hlsl.intrinsics.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.frag.out @@ -5643,10 +5643,7 @@ gl_FragCoord origin is upper left 0:? 'gs_uc4' ( shared 4-component vector of uint) 0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: Matrix types can only be parameterized with floating-point types. - %mat2v2bool = OpTypeMatrix %v2bool 2 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 1836 diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.promote.down.frag.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.promote.down.frag.out index a561dfe9..84ea6f49 100644 --- a/deps/glslang/Test/baseResults/hlsl.intrinsics.promote.down.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.promote.down.frag.out @@ -141,6 +141,7 @@ gl_FragCoord origin is upper left MemberDecorate 19($Global) 7 Offset 40 Decorate 19($Global) Block Decorate 21 DescriptorSet 0 + Decorate 21 Binding 0 Decorate 47(@entryPointOutput.color) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.promote.frag.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.promote.frag.out index b064295a..988432e8 100644 --- a/deps/glslang/Test/baseResults/hlsl.intrinsics.promote.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.promote.frag.out @@ -964,8 +964,11 @@ gl_FragCoord origin is upper left MemberDecorate 19($Global) 9 Offset 52 Decorate 19($Global) Block Decorate 21 DescriptorSet 0 + Decorate 21 Binding 0 Decorate 258(g_tTexbfs) DescriptorSet 0 + Decorate 258(g_tTexbfs) Binding 0 Decorate 277(g_tTex1df4) DescriptorSet 0 + Decorate 277(g_tTex1df4) Binding 0 Decorate 319(@entryPointOutput.color) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.promote.outputs.frag.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.promote.outputs.frag.out index 57dfafc4..9f8ecf27 100644 --- a/deps/glslang/Test/baseResults/hlsl.intrinsics.promote.outputs.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.promote.outputs.frag.out @@ -256,9 +256,12 @@ gl_FragCoord origin is upper left MemberDecorate 17($Global) 9 Offset 52 Decorate 17($Global) Block Decorate 19 DescriptorSet 0 + Decorate 19 Binding 0 Decorate 31(g_tTex1df4) DescriptorSet 0 + Decorate 31(g_tTex1df4) Binding 0 Decorate 74(@entryPointOutput.color) Location 0 Decorate 79(g_tTexbfs) DescriptorSet 0 + Decorate 79(g_tTexbfs) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.intrinsics.vert.out b/deps/glslang/Test/baseResults/hlsl.intrinsics.vert.out index 195e11d6..460785e7 100644 --- a/deps/glslang/Test/baseResults/hlsl.intrinsics.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.intrinsics.vert.out @@ -2778,10 +2778,7 @@ Shader version: 500 0:413 'inFM3x2' ( in 3X2 matrix of float) 0:? Linker Objects -error: SPIRV-Tools Validation Errors -error: Matrix types can only be parameterized with floating-point types. - %mat2v2bool = OpTypeMatrix %v2bool 2 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 1225 diff --git a/deps/glslang/Test/baseResults/hlsl.isfinite.frag.out b/deps/glslang/Test/baseResults/hlsl.isfinite.frag.out index 6fee9512..7b8287fc 100644 --- a/deps/glslang/Test/baseResults/hlsl.isfinite.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.isfinite.frag.out @@ -200,6 +200,7 @@ gl_FragCoord origin is upper left MemberDecorate 35($Global) 2 Offset 16 Decorate 35($Global) Block Decorate 37 DescriptorSet 0 + Decorate 37 Binding 0 Decorate 83(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.layout.frag.out b/deps/glslang/Test/baseResults/hlsl.layout.frag.out index 010c2ecd..6a3eb04f 100644 --- a/deps/glslang/Test/baseResults/hlsl.layout.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.layout.frag.out @@ -86,6 +86,7 @@ gl_FragCoord origin is upper left 0:? 10 (const int) 0:? 'anon@2' (layout( set=4 binding=7 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1PostLayout}) +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 44 diff --git a/deps/glslang/Test/baseResults/hlsl.layoutOverride.vert.out b/deps/glslang/Test/baseResults/hlsl.layoutOverride.vert.out index 0db20112..31593aa9 100644 --- a/deps/glslang/Test/baseResults/hlsl.layoutOverride.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.layoutOverride.vert.out @@ -68,6 +68,7 @@ Shader version: 500 Decorate 13(tex) DescriptorSet 2 Decorate 13(tex) Binding 0 Decorate 17(samp) DescriptorSet 0 + Decorate 17(samp) Binding 0 Decorate 30(@entryPointOutput) BuiltIn Position 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out index 2acf3d47..8d7f70f3 100644 --- a/deps/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out @@ -396,6 +396,7 @@ using depth_any Name 124 "@entryPointOutput.Depth" Name 129 "g_sSamp" Decorate 14(g_tTex2dmsf4) DescriptorSet 0 + Decorate 14(g_tTex2dmsf4) Binding 0 MemberDecorate 20($Global) 0 Offset 0 MemberDecorate 20($Global) 1 Offset 8 MemberDecorate 20($Global) 2 Offset 16 @@ -406,11 +407,17 @@ using depth_any MemberDecorate 20($Global) 7 Offset 80 Decorate 20($Global) Block Decorate 22 DescriptorSet 0 + Decorate 22 Binding 0 Decorate 31(g_tTex2dmsi4) DescriptorSet 0 + Decorate 31(g_tTex2dmsi4) Binding 0 Decorate 39(g_tTex2dmsu4) DescriptorSet 0 + Decorate 39(g_tTex2dmsu4) Binding 0 Decorate 66(g_tTex2dmsf4a) DescriptorSet 0 + Decorate 66(g_tTex2dmsf4a) Binding 0 Decorate 75(g_tTex2dmsi4a) DescriptorSet 0 + Decorate 75(g_tTex2dmsi4a) Binding 0 Decorate 82(g_tTex2dmsu4a) DescriptorSet 0 + Decorate 82(g_tTex2dmsu4a) Binding 0 Decorate 120(@entryPointOutput.Color) Location 0 Decorate 124(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 129(g_sSamp) DescriptorSet 0 diff --git a/deps/glslang/Test/baseResults/hlsl.load.array.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.load.array.dx10.frag.out index dd665edf..e5c0f6e1 100644 --- a/deps/glslang/Test/baseResults/hlsl.load.array.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.load.array.dx10.frag.out @@ -442,6 +442,7 @@ using depth_any Name 155 "g_tTexcdi4a" Name 158 "g_tTexcdu4a" Decorate 14(g_tTex1df4a) DescriptorSet 0 + Decorate 14(g_tTex1df4a) Binding 0 MemberDecorate 20($Global) 0 Offset 0 MemberDecorate 20($Global) 1 Offset 8 MemberDecorate 20($Global) 2 Offset 16 @@ -452,11 +453,17 @@ using depth_any MemberDecorate 20($Global) 7 Offset 80 Decorate 20($Global) Block Decorate 22 DescriptorSet 0 + Decorate 22 Binding 0 Decorate 36(g_tTex1di4a) DescriptorSet 0 + Decorate 36(g_tTex1di4a) Binding 0 Decorate 46(g_tTex1du4a) DescriptorSet 0 + Decorate 46(g_tTex1du4a) Binding 0 Decorate 57(g_tTex2df4a) DescriptorSet 0 + Decorate 57(g_tTex2df4a) Binding 0 Decorate 70(g_tTex2di4a) DescriptorSet 0 + Decorate 70(g_tTex2di4a) Binding 0 Decorate 80(g_tTex2du4a) DescriptorSet 0 + Decorate 80(g_tTex2du4a) Binding 0 Decorate 104(@entryPointOutput.Color) Location 0 Decorate 108(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 113(g_sSamp) DescriptorSet 0 @@ -464,19 +471,33 @@ using depth_any Decorate 116(g_tTex1df4) DescriptorSet 0 Decorate 116(g_tTex1df4) Binding 0 Decorate 119(g_tTex1di4) DescriptorSet 0 + Decorate 119(g_tTex1di4) Binding 0 Decorate 122(g_tTex1du4) DescriptorSet 0 + Decorate 122(g_tTex1du4) Binding 0 Decorate 125(g_tTex2df4) DescriptorSet 0 + Decorate 125(g_tTex2df4) Binding 0 Decorate 128(g_tTex2di4) DescriptorSet 0 + Decorate 128(g_tTex2di4) Binding 0 Decorate 131(g_tTex2du4) DescriptorSet 0 + Decorate 131(g_tTex2du4) Binding 0 Decorate 134(g_tTex3df4) DescriptorSet 0 + Decorate 134(g_tTex3df4) Binding 0 Decorate 137(g_tTex3di4) DescriptorSet 0 + Decorate 137(g_tTex3di4) Binding 0 Decorate 140(g_tTex3du4) DescriptorSet 0 + Decorate 140(g_tTex3du4) Binding 0 Decorate 143(g_tTexcdf4) DescriptorSet 0 + Decorate 143(g_tTexcdf4) Binding 0 Decorate 146(g_tTexcdi4) DescriptorSet 0 + Decorate 146(g_tTexcdi4) Binding 0 Decorate 149(g_tTexcdu4) DescriptorSet 0 + Decorate 149(g_tTexcdu4) Binding 0 Decorate 152(g_tTexcdf4a) DescriptorSet 0 + Decorate 152(g_tTexcdf4a) Binding 0 Decorate 155(g_tTexcdi4a) DescriptorSet 0 + Decorate 155(g_tTexcdi4a) Binding 0 Decorate 158(g_tTexcdu4a) DescriptorSet 0 + Decorate 158(g_tTexcdu4a) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.load.basic.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.load.basic.dx10.frag.out index bcfb977b..b47e037c 100644 --- a/deps/glslang/Test/baseResults/hlsl.load.basic.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.load.basic.dx10.frag.out @@ -555,30 +555,51 @@ using depth_any MemberDecorate 20($Global) 7 Offset 80 Decorate 20($Global) Block Decorate 22 DescriptorSet 0 + Decorate 22 Binding 0 Decorate 35(g_tTex1di4) DescriptorSet 0 + Decorate 35(g_tTex1di4) Binding 0 Decorate 44(g_tTex1du4) DescriptorSet 0 + Decorate 44(g_tTex1du4) Binding 0 Decorate 54(g_tTex2df4) DescriptorSet 0 + Decorate 54(g_tTex2df4) Binding 0 Decorate 67(g_tTex2di4) DescriptorSet 0 + Decorate 67(g_tTex2di4) Binding 0 Decorate 77(g_tTex2du4) DescriptorSet 0 + Decorate 77(g_tTex2du4) Binding 0 Decorate 87(g_tTex3df4) DescriptorSet 0 + Decorate 87(g_tTex3df4) Binding 0 Decorate 100(g_tTex3di4) DescriptorSet 0 + Decorate 100(g_tTex3di4) Binding 0 Decorate 110(g_tTex3du4) DescriptorSet 0 + Decorate 110(g_tTex3du4) Binding 0 Decorate 133(@entryPointOutput.Color) Location 0 Decorate 137(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 142(g_sSamp) DescriptorSet 0 Decorate 142(g_sSamp) Binding 0 Decorate 145(g_tTexcdf4) DescriptorSet 0 + Decorate 145(g_tTexcdf4) Binding 0 Decorate 148(g_tTexcdi4) DescriptorSet 0 + Decorate 148(g_tTexcdi4) Binding 0 Decorate 151(g_tTexcdu4) DescriptorSet 0 + Decorate 151(g_tTexcdu4) Binding 0 Decorate 154(g_tTex1df4a) DescriptorSet 0 + Decorate 154(g_tTex1df4a) Binding 0 Decorate 157(g_tTex1di4a) DescriptorSet 0 + Decorate 157(g_tTex1di4a) Binding 0 Decorate 160(g_tTex1du4a) DescriptorSet 0 + Decorate 160(g_tTex1du4a) Binding 0 Decorate 163(g_tTex2df4a) DescriptorSet 0 + Decorate 163(g_tTex2df4a) Binding 0 Decorate 166(g_tTex2di4a) DescriptorSet 0 + Decorate 166(g_tTex2di4a) Binding 0 Decorate 169(g_tTex2du4a) DescriptorSet 0 + Decorate 169(g_tTex2du4a) Binding 0 Decorate 172(g_tTexcdf4a) DescriptorSet 0 + Decorate 172(g_tTexcdf4a) Binding 0 Decorate 175(g_tTexcdi4a) DescriptorSet 0 + Decorate 175(g_tTexcdi4a) Binding 0 Decorate 178(g_tTexcdu4a) DescriptorSet 0 + Decorate 178(g_tTexcdu4a) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.load.basic.dx10.vert.out b/deps/glslang/Test/baseResults/hlsl.load.basic.dx10.vert.out index 16389916..99f36673 100644 --- a/deps/glslang/Test/baseResults/hlsl.load.basic.dx10.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.load.basic.dx10.vert.out @@ -512,29 +512,50 @@ Shader version: 500 MemberDecorate 20($Global) 7 Offset 80 Decorate 20($Global) Block Decorate 22 DescriptorSet 0 + Decorate 22 Binding 0 Decorate 35(g_tTex1di4) DescriptorSet 0 + Decorate 35(g_tTex1di4) Binding 0 Decorate 44(g_tTex1du4) DescriptorSet 0 + Decorate 44(g_tTex1du4) Binding 0 Decorate 54(g_tTex2df4) DescriptorSet 0 + Decorate 54(g_tTex2df4) Binding 0 Decorate 67(g_tTex2di4) DescriptorSet 0 + Decorate 67(g_tTex2di4) Binding 0 Decorate 77(g_tTex2du4) DescriptorSet 0 + Decorate 77(g_tTex2du4) Binding 0 Decorate 87(g_tTex3df4) DescriptorSet 0 + Decorate 87(g_tTex3df4) Binding 0 Decorate 100(g_tTex3di4) DescriptorSet 0 + Decorate 100(g_tTex3di4) Binding 0 Decorate 110(g_tTex3du4) DescriptorSet 0 + Decorate 110(g_tTex3du4) Binding 0 Decorate 129(@entryPointOutput.Pos) BuiltIn Position Decorate 134(g_sSamp) DescriptorSet 0 Decorate 134(g_sSamp) Binding 0 Decorate 137(g_tTexcdf4) DescriptorSet 0 + Decorate 137(g_tTexcdf4) Binding 0 Decorate 140(g_tTexcdi4) DescriptorSet 0 + Decorate 140(g_tTexcdi4) Binding 0 Decorate 143(g_tTexcdu4) DescriptorSet 0 + Decorate 143(g_tTexcdu4) Binding 0 Decorate 146(g_tTex1df4a) DescriptorSet 0 + Decorate 146(g_tTex1df4a) Binding 0 Decorate 149(g_tTex1di4a) DescriptorSet 0 + Decorate 149(g_tTex1di4a) Binding 0 Decorate 152(g_tTex1du4a) DescriptorSet 0 + Decorate 152(g_tTex1du4a) Binding 0 Decorate 155(g_tTex2df4a) DescriptorSet 0 + Decorate 155(g_tTex2df4a) Binding 0 Decorate 158(g_tTex2di4a) DescriptorSet 0 + Decorate 158(g_tTex2di4a) Binding 0 Decorate 161(g_tTex2du4a) DescriptorSet 0 + Decorate 161(g_tTex2du4a) Binding 0 Decorate 164(g_tTexcdf4a) DescriptorSet 0 + Decorate 164(g_tTexcdf4a) Binding 0 Decorate 167(g_tTexcdi4a) DescriptorSet 0 + Decorate 167(g_tTexcdi4a) Binding 0 Decorate 170(g_tTexcdu4a) DescriptorSet 0 + Decorate 170(g_tTexcdu4a) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.load.buffer.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.load.buffer.dx10.frag.out index 21e5d304..969a99f6 100644 --- a/deps/glslang/Test/baseResults/hlsl.load.buffer.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.load.buffer.dx10.frag.out @@ -204,6 +204,7 @@ using depth_any Name 68 "@entryPointOutput.Depth" Name 71 "g_tTexbf4_test" Decorate 16(g_tTexbf4) DescriptorSet 0 + Decorate 16(g_tTexbf4) Binding 0 MemberDecorate 22($Global) 0 Offset 0 MemberDecorate 22($Global) 1 Offset 8 MemberDecorate 22($Global) 2 Offset 16 @@ -214,8 +215,11 @@ using depth_any MemberDecorate 22($Global) 7 Offset 80 Decorate 22($Global) Block Decorate 24 DescriptorSet 0 + Decorate 24 Binding 0 Decorate 34(g_tTexbi4) DescriptorSet 0 + Decorate 34(g_tTexbi4) Binding 0 Decorate 45(g_tTexbu4) DescriptorSet 0 + Decorate 45(g_tTexbu4) Binding 0 Decorate 64(@entryPointOutput.Color) Location 0 Decorate 68(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 71(g_tTexbf4_test) DescriptorSet 0 diff --git a/deps/glslang/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out index d951d093..d404b27e 100644 --- a/deps/glslang/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out @@ -210,6 +210,7 @@ using depth_any Name 71 "@entryPointOutput.Depth" Name 74 "g_tTexbfs_test" Decorate 16(g_tTexbfs) DescriptorSet 0 + Decorate 16(g_tTexbfs) Binding 0 MemberDecorate 22($Global) 0 Offset 0 MemberDecorate 22($Global) 1 Offset 8 MemberDecorate 22($Global) 2 Offset 16 @@ -220,8 +221,11 @@ using depth_any MemberDecorate 22($Global) 7 Offset 80 Decorate 22($Global) Block Decorate 24 DescriptorSet 0 + Decorate 24 Binding 0 Decorate 35(g_tTexbis) DescriptorSet 0 + Decorate 35(g_tTexbis) Binding 0 Decorate 46(g_tTexbus) DescriptorSet 0 + Decorate 46(g_tTexbus) Binding 0 Decorate 67(@entryPointOutput.Color) Location 0 Decorate 71(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 74(g_tTexbfs_test) DescriptorSet 0 diff --git a/deps/glslang/Test/baseResults/hlsl.load.offset.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.load.offset.dx10.frag.out index d59ff6ff..089329e0 100644 --- a/deps/glslang/Test/baseResults/hlsl.load.offset.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.load.offset.dx10.frag.out @@ -628,30 +628,51 @@ using depth_any MemberDecorate 20($Global) 7 Offset 80 Decorate 20($Global) Block Decorate 22 DescriptorSet 0 + Decorate 22 Binding 0 Decorate 38(g_tTex1di4) DescriptorSet 0 + Decorate 38(g_tTex1di4) Binding 0 Decorate 49(g_tTex1du4) DescriptorSet 0 + Decorate 49(g_tTex1du4) Binding 0 Decorate 61(g_tTex2df4) DescriptorSet 0 + Decorate 61(g_tTex2df4) Binding 0 Decorate 78(g_tTex2di4) DescriptorSet 0 + Decorate 78(g_tTex2di4) Binding 0 Decorate 90(g_tTex2du4) DescriptorSet 0 + Decorate 90(g_tTex2du4) Binding 0 Decorate 102(g_tTex3df4) DescriptorSet 0 + Decorate 102(g_tTex3df4) Binding 0 Decorate 118(g_tTex3di4) DescriptorSet 0 + Decorate 118(g_tTex3di4) Binding 0 Decorate 130(g_tTex3du4) DescriptorSet 0 + Decorate 130(g_tTex3du4) Binding 0 Decorate 155(@entryPointOutput.Color) Location 0 Decorate 159(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 164(g_sSamp) DescriptorSet 0 Decorate 164(g_sSamp) Binding 0 Decorate 167(g_tTexcdf4) DescriptorSet 0 + Decorate 167(g_tTexcdf4) Binding 0 Decorate 170(g_tTexcdi4) DescriptorSet 0 + Decorate 170(g_tTexcdi4) Binding 0 Decorate 173(g_tTexcdu4) DescriptorSet 0 + Decorate 173(g_tTexcdu4) Binding 0 Decorate 176(g_tTex1df4a) DescriptorSet 0 + Decorate 176(g_tTex1df4a) Binding 0 Decorate 179(g_tTex1di4a) DescriptorSet 0 + Decorate 179(g_tTex1di4a) Binding 0 Decorate 182(g_tTex1du4a) DescriptorSet 0 + Decorate 182(g_tTex1du4a) Binding 0 Decorate 185(g_tTex2df4a) DescriptorSet 0 + Decorate 185(g_tTex2df4a) Binding 0 Decorate 188(g_tTex2di4a) DescriptorSet 0 + Decorate 188(g_tTex2di4a) Binding 0 Decorate 191(g_tTex2du4a) DescriptorSet 0 + Decorate 191(g_tTex2du4a) Binding 0 Decorate 194(g_tTexcdf4a) DescriptorSet 0 + Decorate 194(g_tTexcdf4a) Binding 0 Decorate 197(g_tTexcdi4a) DescriptorSet 0 + Decorate 197(g_tTexcdi4a) Binding 0 Decorate 200(g_tTexcdu4a) DescriptorSet 0 + Decorate 200(g_tTexcdu4a) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out index b472462a..7df846be 100644 --- a/deps/glslang/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out @@ -491,6 +491,7 @@ using depth_any Name 170 "g_tTexcdi4a" Name 173 "g_tTexcdu4a" Decorate 14(g_tTex1df4a) DescriptorSet 0 + Decorate 14(g_tTex1df4a) Binding 0 MemberDecorate 20($Global) 0 Offset 0 MemberDecorate 20($Global) 1 Offset 8 MemberDecorate 20($Global) 2 Offset 16 @@ -501,11 +502,17 @@ using depth_any MemberDecorate 20($Global) 7 Offset 80 Decorate 20($Global) Block Decorate 22 DescriptorSet 0 + Decorate 22 Binding 0 Decorate 39(g_tTex1di4a) DescriptorSet 0 + Decorate 39(g_tTex1di4a) Binding 0 Decorate 51(g_tTex1du4a) DescriptorSet 0 + Decorate 51(g_tTex1du4a) Binding 0 Decorate 64(g_tTex2df4a) DescriptorSet 0 + Decorate 64(g_tTex2df4a) Binding 0 Decorate 81(g_tTex2di4a) DescriptorSet 0 + Decorate 81(g_tTex2di4a) Binding 0 Decorate 93(g_tTex2du4a) DescriptorSet 0 + Decorate 93(g_tTex2du4a) Binding 0 Decorate 119(@entryPointOutput.Color) Location 0 Decorate 123(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 128(g_sSamp) DescriptorSet 0 @@ -513,19 +520,33 @@ using depth_any Decorate 131(g_tTex1df4) DescriptorSet 0 Decorate 131(g_tTex1df4) Binding 0 Decorate 134(g_tTex1di4) DescriptorSet 0 + Decorate 134(g_tTex1di4) Binding 0 Decorate 137(g_tTex1du4) DescriptorSet 0 + Decorate 137(g_tTex1du4) Binding 0 Decorate 140(g_tTex2df4) DescriptorSet 0 + Decorate 140(g_tTex2df4) Binding 0 Decorate 143(g_tTex2di4) DescriptorSet 0 + Decorate 143(g_tTex2di4) Binding 0 Decorate 146(g_tTex2du4) DescriptorSet 0 + Decorate 146(g_tTex2du4) Binding 0 Decorate 149(g_tTex3df4) DescriptorSet 0 + Decorate 149(g_tTex3df4) Binding 0 Decorate 152(g_tTex3di4) DescriptorSet 0 + Decorate 152(g_tTex3di4) Binding 0 Decorate 155(g_tTex3du4) DescriptorSet 0 + Decorate 155(g_tTex3du4) Binding 0 Decorate 158(g_tTexcdf4) DescriptorSet 0 + Decorate 158(g_tTexcdf4) Binding 0 Decorate 161(g_tTexcdi4) DescriptorSet 0 + Decorate 161(g_tTexcdi4) Binding 0 Decorate 164(g_tTexcdu4) DescriptorSet 0 + Decorate 164(g_tTexcdu4) Binding 0 Decorate 167(g_tTexcdf4a) DescriptorSet 0 + Decorate 167(g_tTexcdf4a) Binding 0 Decorate 170(g_tTexcdi4a) DescriptorSet 0 + Decorate 170(g_tTexcdi4a) Binding 0 Decorate 173(g_tTexcdu4a) DescriptorSet 0 + Decorate 173(g_tTexcdu4a) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out index f1349012..62009e17 100644 --- a/deps/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out @@ -140,6 +140,7 @@ gl_FragCoord origin is upper left Name 45 "psout" Name 54 "@entryPointOutput.Color" Decorate 14(g_tBuffF) DescriptorSet 0 + Decorate 14(g_tBuffF) Binding 0 MemberDecorate 20($Global) 0 Offset 0 MemberDecorate 20($Global) 1 Offset 8 MemberDecorate 20($Global) 2 Offset 16 @@ -150,8 +151,11 @@ gl_FragCoord origin is upper left MemberDecorate 20($Global) 7 Offset 80 Decorate 20($Global) Block Decorate 22 DescriptorSet 0 + Decorate 22 Binding 0 Decorate 31(g_tBuffU) DescriptorSet 0 + Decorate 31(g_tBuffU) Binding 0 Decorate 39(g_tBuffI) DescriptorSet 0 + Decorate 39(g_tBuffI) Binding 0 Decorate 54(@entryPointOutput.Color) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out index de31ee02..f05b335f 100644 --- a/deps/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out @@ -255,6 +255,7 @@ using depth_any Name 115 "g_tTex3di4" Name 118 "g_tTex3du4" Decorate 14(g_tTex1df4a) DescriptorSet 0 + Decorate 14(g_tTex1df4a) Binding 0 MemberDecorate 20($Global) 0 Offset 0 MemberDecorate 20($Global) 1 Offset 8 MemberDecorate 20($Global) 2 Offset 16 @@ -265,11 +266,17 @@ using depth_any MemberDecorate 20($Global) 7 Offset 80 Decorate 20($Global) Block Decorate 22 DescriptorSet 0 + Decorate 22 Binding 0 Decorate 30(g_tTex1di4a) DescriptorSet 0 + Decorate 30(g_tTex1di4a) Binding 0 Decorate 38(g_tTex1du4a) DescriptorSet 0 + Decorate 38(g_tTex1du4a) Binding 0 Decorate 46(g_tTex2df4a) DescriptorSet 0 + Decorate 46(g_tTex2df4a) Binding 0 Decorate 55(g_tTex2di4a) DescriptorSet 0 + Decorate 55(g_tTex2di4a) Binding 0 Decorate 62(g_tTex2du4a) DescriptorSet 0 + Decorate 62(g_tTex2du4a) Binding 0 Decorate 82(@entryPointOutput.Color) Location 0 Decorate 86(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 91(g_sSamp) DescriptorSet 0 @@ -277,13 +284,21 @@ using depth_any Decorate 94(g_tTex1df4) DescriptorSet 0 Decorate 94(g_tTex1df4) Binding 0 Decorate 97(g_tTex1di4) DescriptorSet 0 + Decorate 97(g_tTex1di4) Binding 0 Decorate 100(g_tTex1du4) DescriptorSet 0 + Decorate 100(g_tTex1du4) Binding 0 Decorate 103(g_tTex2df4) DescriptorSet 0 + Decorate 103(g_tTex2df4) Binding 0 Decorate 106(g_tTex2di4) DescriptorSet 0 + Decorate 106(g_tTex2di4) Binding 0 Decorate 109(g_tTex2du4) DescriptorSet 0 + Decorate 109(g_tTex2du4) Binding 0 Decorate 112(g_tTex3df4) DescriptorSet 0 + Decorate 112(g_tTex3df4) Binding 0 Decorate 115(g_tTex3di4) DescriptorSet 0 + Decorate 115(g_tTex3di4) Binding 0 Decorate 118(g_tTex3du4) DescriptorSet 0 + Decorate 118(g_tTex3du4) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out index 68044aa5..c6e00ffd 100644 --- a/deps/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out @@ -302,24 +302,39 @@ using depth_any MemberDecorate 20($Global) 7 Offset 80 Decorate 20($Global) Block Decorate 22 DescriptorSet 0 + Decorate 22 Binding 0 Decorate 30(g_tTex1di4) DescriptorSet 0 + Decorate 30(g_tTex1di4) Binding 0 Decorate 38(g_tTex1du4) DescriptorSet 0 + Decorate 38(g_tTex1du4) Binding 0 Decorate 46(g_tTex2df4) DescriptorSet 0 + Decorate 46(g_tTex2df4) Binding 0 Decorate 55(g_tTex2di4) DescriptorSet 0 + Decorate 55(g_tTex2di4) Binding 0 Decorate 62(g_tTex2du4) DescriptorSet 0 + Decorate 62(g_tTex2du4) Binding 0 Decorate 69(g_tTex3df4) DescriptorSet 0 + Decorate 69(g_tTex3df4) Binding 0 Decorate 78(g_tTex3di4) DescriptorSet 0 + Decorate 78(g_tTex3di4) Binding 0 Decorate 85(g_tTex3du4) DescriptorSet 0 + Decorate 85(g_tTex3du4) Binding 0 Decorate 104(@entryPointOutput.Color) Location 0 Decorate 108(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 113(g_sSamp) DescriptorSet 0 Decorate 113(g_sSamp) Binding 0 Decorate 116(g_tTex1df4a) DescriptorSet 0 + Decorate 116(g_tTex1df4a) Binding 0 Decorate 119(g_tTex1di4a) DescriptorSet 0 + Decorate 119(g_tTex1di4a) Binding 0 Decorate 122(g_tTex1du4a) DescriptorSet 0 + Decorate 122(g_tTex1du4a) Binding 0 Decorate 125(g_tTex2df4a) DescriptorSet 0 + Decorate 125(g_tTex2df4a) Binding 0 Decorate 128(g_tTex2di4a) DescriptorSet 0 + Decorate 128(g_tTex2di4a) Binding 0 Decorate 131(g_tTex2du4a) DescriptorSet 0 + Decorate 131(g_tTex2du4a) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.logical.binary.frag.out b/deps/glslang/Test/baseResults/hlsl.logical.binary.frag.out index b90811bd..5b23a625 100644 --- a/deps/glslang/Test/baseResults/hlsl.logical.binary.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.logical.binary.frag.out @@ -151,6 +151,7 @@ gl_FragCoord origin is upper left MemberDecorate 14($Global) 3 Offset 48 Decorate 14($Global) Block Decorate 16 DescriptorSet 0 + Decorate 16 Binding 0 Decorate 53(@entryPointOutput.Color) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.logical.binary.vec.frag.out b/deps/glslang/Test/baseResults/hlsl.logical.binary.vec.frag.out index 32753e5c..0e4f852a 100644 --- a/deps/glslang/Test/baseResults/hlsl.logical.binary.vec.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.logical.binary.vec.frag.out @@ -288,6 +288,7 @@ gl_FragCoord origin is upper left MemberDecorate 18($Global) 3 Offset 36 Decorate 18($Global) Block Decorate 20 DescriptorSet 0 + Decorate 20 Binding 0 Decorate 112(@entryPointOutput.Color) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.logical.unary.frag.out b/deps/glslang/Test/baseResults/hlsl.logical.unary.frag.out index 25dbc2ad..b342c349 100644 --- a/deps/glslang/Test/baseResults/hlsl.logical.unary.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.logical.unary.frag.out @@ -211,6 +211,7 @@ gl_FragCoord origin is upper left MemberDecorate 14($Global) 3 Offset 48 Decorate 14($Global) Block Decorate 16 DescriptorSet 0 + Decorate 16 Binding 0 Decorate 81(@entryPointOutput.Color) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.matNx1.frag.out b/deps/glslang/Test/baseResults/hlsl.matNx1.frag.out index 276d4c24..e8e0a7b3 100644 --- a/deps/glslang/Test/baseResults/hlsl.matNx1.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.matNx1.frag.out @@ -151,10 +151,7 @@ gl_FragCoord origin is upper left 0:? Linker Objects 0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: Illegal number of components (1) for TypeVector - %v1float = OpTypeVector %float 1 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 77 diff --git a/deps/glslang/Test/baseResults/hlsl.matType.bool.frag.out b/deps/glslang/Test/baseResults/hlsl.matType.bool.frag.out index 900c60fc..b5543d8f 100644 --- a/deps/glslang/Test/baseResults/hlsl.matType.bool.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.matType.bool.frag.out @@ -231,10 +231,7 @@ gl_FragCoord origin is upper left 0:? Linker Objects 0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: Illegal number of components (1) for TypeVector - %v1bool = OpTypeVector %bool 1 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 130 diff --git a/deps/glslang/Test/baseResults/hlsl.matType.frag.out b/deps/glslang/Test/baseResults/hlsl.matType.frag.out index c0d2e4b3..80bb2167 100644 --- a/deps/glslang/Test/baseResults/hlsl.matType.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.matType.frag.out @@ -30,10 +30,7 @@ gl_FragCoord origin is upper left 0:? Linker Objects 0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 1-component vector of float f1, uniform 1X1 matrix of float fmat11, uniform 4X1 matrix of float fmat41, uniform 1X2 matrix of float fmat12, uniform 2X3 matrix of double dmat23, uniform 4X4 matrix of int int44}) -error: SPIRV-Tools Validation Errors -error: Illegal number of components (1) for TypeVector - %v1float = OpTypeVector %float 1 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 30 @@ -75,6 +72,7 @@ error: Illegal number of components (1) for TypeVector MemberDecorate 27($Global) 5 MatrixStride 16 Decorate 27($Global) Block Decorate 29 DescriptorSet 0 + Decorate 29 Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.matType.int.frag.out b/deps/glslang/Test/baseResults/hlsl.matType.int.frag.out index 2039dfd5..a1854aa2 100644 --- a/deps/glslang/Test/baseResults/hlsl.matType.int.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.matType.int.frag.out @@ -397,10 +397,7 @@ gl_FragCoord origin is upper left 0:? Linker Objects 0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: Illegal number of components (1) for TypeVector - %v1int = OpTypeVector %int 1 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 232 diff --git a/deps/glslang/Test/baseResults/hlsl.matpack-1.frag.out b/deps/glslang/Test/baseResults/hlsl.matpack-1.frag.out index b92f79d2..c0225875 100644 --- a/deps/glslang/Test/baseResults/hlsl.matpack-1.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.matpack-1.frag.out @@ -144,6 +144,7 @@ gl_FragCoord origin is upper left MemberDecorate 14(Example) 2 MatrixStride 16 Decorate 14(Example) Block Decorate 16 DescriptorSet 0 + Decorate 16 Binding 0 Decorate 37(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.matpack-pragma.frag.out b/deps/glslang/Test/baseResults/hlsl.matpack-pragma.frag.out index 2750d76a..86e945ec 100644 --- a/deps/glslang/Test/baseResults/hlsl.matpack-pragma.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.matpack-pragma.frag.out @@ -220,6 +220,7 @@ gl_FragCoord origin is upper left MemberDecorate 14(Example) 2 MatrixStride 16 Decorate 14(Example) Block Decorate 16 DescriptorSet 0 + Decorate 16 Binding 0 Decorate 42(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.matrixSwizzle.vert.out b/deps/glslang/Test/baseResults/hlsl.matrixSwizzle.vert.out index abb3e495..237ce5d4 100644 --- a/deps/glslang/Test/baseResults/hlsl.matrixSwizzle.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.matrixSwizzle.vert.out @@ -675,11 +675,7 @@ Shader version: 500 0:? Linker Objects 0:? 'inf' (layout( location=0) in float) -Missing functionality: matrix swizzle -error: SPIRV-Tools Validation Errors -error: OpStore Pointer '42[f3]'s type does not match Object '34's type. - OpStore %f3 %int_0 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 118 diff --git a/deps/glslang/Test/baseResults/hlsl.matrixindex.frag.out b/deps/glslang/Test/baseResults/hlsl.matrixindex.frag.out index 63e5614e..63ddc4df 100644 --- a/deps/glslang/Test/baseResults/hlsl.matrixindex.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.matrixindex.frag.out @@ -315,6 +315,7 @@ gl_FragCoord origin is upper left MemberDecorate 52($Global) 1 MatrixStride 16 Decorate 52($Global) Block Decorate 54 DescriptorSet 0 + Decorate 54 Binding 0 Decorate 80(@entryPointOutput.Color) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.mintypes.frag.out b/deps/glslang/Test/baseResults/hlsl.mintypes.frag.out index 8722cf27..4824bcbe 100644 --- a/deps/glslang/Test/baseResults/hlsl.mintypes.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.mintypes.frag.out @@ -164,6 +164,7 @@ gl_FragCoord origin is upper left MemberDecorate 67($Global) 1 Offset 4 Decorate 67($Global) Block Decorate 69 DescriptorSet 0 + Decorate 69 Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.mip.operator.frag.out b/deps/glslang/Test/baseResults/hlsl.mip.operator.frag.out index eb884da9..478e808f 100644 --- a/deps/glslang/Test/baseResults/hlsl.mip.operator.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.mip.operator.frag.out @@ -143,7 +143,9 @@ gl_FragCoord origin is upper left Name 25 "g_tTex2df4a" Name 59 "@entryPointOutput" Decorate 13(g_tTex2df4) DescriptorSet 0 + Decorate 13(g_tTex2df4) Binding 0 Decorate 25(g_tTex2df4a) DescriptorSet 0 + Decorate 25(g_tTex2df4a) Binding 0 Decorate 59(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.mul-truncate.frag.out b/deps/glslang/Test/baseResults/hlsl.mul-truncate.frag.out index 1973fad1..a7de28c7 100644 --- a/deps/glslang/Test/baseResults/hlsl.mul-truncate.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.mul-truncate.frag.out @@ -439,6 +439,7 @@ gl_FragCoord origin is upper left MemberDecorate 21(Matrix) 8 Offset 352 Decorate 21(Matrix) Block Decorate 23 DescriptorSet 0 + Decorate 23 Binding 0 Decorate 188(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.multiEntry.vert.out b/deps/glslang/Test/baseResults/hlsl.multiEntry.vert.out index 1c771188..c051591c 100644 --- a/deps/glslang/Test/baseResults/hlsl.multiEntry.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.multiEntry.vert.out @@ -91,6 +91,7 @@ Shader version: 500 Name 37 "@entryPointOutput" Name 38 "param" Decorate 19(Position) DescriptorSet 0 + Decorate 19(Position) Binding 0 Decorate 34(Index) BuiltIn VertexIndex Decorate 37(@entryPointOutput) BuiltIn Position 2: TypeVoid diff --git a/deps/glslang/Test/baseResults/hlsl.multiReturn.frag.out b/deps/glslang/Test/baseResults/hlsl.multiReturn.frag.out index 695a52c6..6c41c77b 100644 --- a/deps/glslang/Test/baseResults/hlsl.multiReturn.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.multiReturn.frag.out @@ -79,6 +79,7 @@ gl_FragCoord origin is upper left MemberDecorate 16(bufName) 0 Offset 0 Decorate 16(bufName) Block Decorate 18 DescriptorSet 0 + Decorate 18 Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.namespace.frag.out b/deps/glslang/Test/baseResults/hlsl.namespace.frag.out index 08d959b3..8df43ad7 100644 --- a/deps/glslang/Test/baseResults/hlsl.namespace.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.namespace.frag.out @@ -101,10 +101,7 @@ gl_FragCoord origin is upper left 0:? 'N2::gf' ( global float) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: OpFunctionCall Function 's parameter count does not match the argument count. - %43 = OpFunctionCall %v4float %N2__N3__C1__getVec_ - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 54 diff --git a/deps/glslang/Test/baseResults/hlsl.noSemantic.functionality1.comp.out b/deps/glslang/Test/baseResults/hlsl.noSemantic.functionality1.comp.out index f00fe744..3ede90e6 100644 --- a/deps/glslang/Test/baseResults/hlsl.noSemantic.functionality1.comp.out +++ b/deps/glslang/Test/baseResults/hlsl.noSemantic.functionality1.comp.out @@ -26,6 +26,7 @@ hlsl.noSemantic.functionality1.comp MemberDecorate 17(Buf@count) 0 Offset 0 Decorate 17(Buf@count) BufferBlock Decorate 19(Buf@count) DescriptorSet 0 + Decorate 19(Buf@count) Binding 0 DecorateId 13(Buf) DecorationHlslCounterBufferGOOGLE 19(Buf@count) 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.params.default.frag.out b/deps/glslang/Test/baseResults/hlsl.params.default.frag.out index c98e0c64..d1ecfa61 100644 --- a/deps/glslang/Test/baseResults/hlsl.params.default.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.params.default.frag.out @@ -440,6 +440,7 @@ gl_FragCoord origin is upper left MemberDecorate 108($Global) 0 Offset 0 Decorate 108($Global) Block Decorate 110 DescriptorSet 0 + Decorate 110 Binding 0 Decorate 175(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.partialFlattenLocal.vert.out b/deps/glslang/Test/baseResults/hlsl.partialFlattenLocal.vert.out index 95241189..46df2061 100644 --- a/deps/glslang/Test/baseResults/hlsl.partialFlattenLocal.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.partialFlattenLocal.vert.out @@ -263,6 +263,7 @@ Shader version: 500 Name 86 "@entryPointOutput" Name 87 "param" Decorate 27(tex) DescriptorSet 0 + Decorate 27(tex) Binding 0 Decorate 83(pos) Location 0 Decorate 86(@entryPointOutput) BuiltIn Position 2: TypeVoid diff --git a/deps/glslang/Test/baseResults/hlsl.partialFlattenMixed.vert.out b/deps/glslang/Test/baseResults/hlsl.partialFlattenMixed.vert.out index 51e4c934..da832b4b 100644 --- a/deps/glslang/Test/baseResults/hlsl.partialFlattenMixed.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.partialFlattenMixed.vert.out @@ -114,7 +114,9 @@ Shader version: 500 Name 39 "@entryPointOutput" Name 40 "param" Decorate 24(tex[0]) DescriptorSet 0 + Decorate 24(tex[0]) Binding 0 Decorate 28(tex[1]) DescriptorSet 0 + Decorate 28(tex[1]) Binding 0 Decorate 36(pos) Location 0 Decorate 39(@entryPointOutput) BuiltIn Position 2: TypeVoid diff --git a/deps/glslang/Test/baseResults/hlsl.partialInit.frag.out b/deps/glslang/Test/baseResults/hlsl.partialInit.frag.out index 2cdbb0ff..6881671e 100644 --- a/deps/glslang/Test/baseResults/hlsl.partialInit.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.partialInit.frag.out @@ -398,10 +398,7 @@ gl_FragCoord origin is upper left 0:? 'ci' ( const int) 0:? 0 (const int) -error: SPIRV-Tools Validation Errors -error: If OpTypeBool is stored in conjunction with OpVariable, it can only be used with non-externally visible shader Storage Classes: Workgroup, CrossWorkgroup, Private, and Function - %_entryPointOutput_c = OpVariable %_ptr_Output_bool Output - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 104 diff --git a/deps/glslang/Test/baseResults/hlsl.pp.line2.frag.out b/deps/glslang/Test/baseResults/hlsl.pp.line2.frag.out new file mode 100644 index 00000000..10bbf6ad --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.pp.line2.frag.out @@ -0,0 +1,185 @@ +hlsl.pp.line2.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 80 + + Capability Shader + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 5 "MainPs" 71 75 + ExecutionMode 5 OriginUpperLeft + 1: String "hlsl.pp.line2.frag" + 17: String "foo.frag" + 32: String "foo.h" + 42: String "foo2.h" + Source HLSL 500 1 "// OpModuleProcessed auto-map-locations +// OpModuleProcessed auto-map-bindings +// OpModuleProcessed entry-point MainPs +// OpModuleProcessed client vulkan100 +// OpModuleProcessed target-env vulkan1.0 +// OpModuleProcessed keep-uncalled +// OpModuleProcessed hlsl-offsets +#line 1 +#line 1 "foo.frag" +Texture2D g_tColor[ 128 ] ; + +layout (push_constant) cbuffer PerViewConstantBuffer_t +{ + uint g_nDataIdx; + uint g_nDataIdx2; + bool g_B; +} ; + +SamplerState g_sAniso; + +struct PS_INPUT +{ + float2 vTextureCoords : TEXCOORD2 ; +} ; + +struct PS_OUTPUT +{ + float4 vColor : SV_Target0 ; +} ; + +PS_OUTPUT MainPs ( PS_INPUT i ) +{ + PS_OUTPUT ps_output ; + + uint u; +#line 47 + if (g_B) +#line 3 "foo.h" + u = g_nDataIdx; + else +#line 67 + u = g_nDataIdx2; +#line 7 "foo2.h" + ps_output . vColor = g_tColor [ u ] . Sample ( g_sAniso , i . vTextureCoords . xy ); +#line 105 + return ps_output ; +} + +" + Name 5 "MainPs" + Name 9 "PS_INPUT" + MemberName 9(PS_INPUT) 0 "vTextureCoords" + Name 12 "PS_OUTPUT" + MemberName 12(PS_OUTPUT) 0 "vColor" + Name 15 "@MainPs(struct-PS_INPUT-vf21;" + Name 14 "i" + Name 19 "PerViewConstantBuffer_t" + MemberName 19(PerViewConstantBuffer_t) 0 "g_nDataIdx" + MemberName 19(PerViewConstantBuffer_t) 1 "g_nDataIdx2" + MemberName 19(PerViewConstantBuffer_t) 2 "g_B" + Name 21 "" + Name 34 "u" + Name 44 "ps_output" + Name 49 "g_tColor" + Name 56 "g_sAniso" + Name 69 "i" + Name 71 "i.vTextureCoords" + Name 75 "@entryPointOutput.vColor" + Name 76 "param" + MemberDecorate 19(PerViewConstantBuffer_t) 0 Offset 0 + MemberDecorate 19(PerViewConstantBuffer_t) 1 Offset 4 + MemberDecorate 19(PerViewConstantBuffer_t) 2 Offset 8 + Decorate 19(PerViewConstantBuffer_t) Block + Decorate 49(g_tColor) DescriptorSet 0 + Decorate 49(g_tColor) Binding 0 + Decorate 56(g_sAniso) DescriptorSet 0 + Decorate 56(g_sAniso) Binding 0 + Decorate 71(i.vTextureCoords) Location 0 + Decorate 75(@entryPointOutput.vColor) Location 0 + 3: TypeVoid + 4: TypeFunction 3 + 7: TypeFloat 32 + 8: TypeVector 7(float) 2 + 9(PS_INPUT): TypeStruct 8(fvec2) + 10: TypePointer Function 9(PS_INPUT) + 11: TypeVector 7(float) 4 + 12(PS_OUTPUT): TypeStruct 11(fvec4) + 13: TypeFunction 12(PS_OUTPUT) 10(ptr) + 18: TypeInt 32 0 +19(PerViewConstantBuffer_t): TypeStruct 18(int) 18(int) 18(int) + 20: TypePointer PushConstant 19(PerViewConstantBuffer_t) + 21: 20(ptr) Variable PushConstant + 22: TypeInt 32 1 + 23: 22(int) Constant 2 + 24: TypePointer PushConstant 18(int) + 27: TypeBool + 28: 18(int) Constant 0 + 33: TypePointer Function 18(int) + 35: 22(int) Constant 0 + 39: 22(int) Constant 1 + 43: TypePointer Function 12(PS_OUTPUT) + 45: TypeImage 7(float) 2D sampled format:Unknown + 46: 18(int) Constant 128 + 47: TypeArray 45 46 + 48: TypePointer UniformConstant 47 + 49(g_tColor): 48(ptr) Variable UniformConstant + 51: TypePointer UniformConstant 45 + 54: TypeSampler + 55: TypePointer UniformConstant 54 + 56(g_sAniso): 55(ptr) Variable UniformConstant + 58: TypeSampledImage 45 + 60: TypePointer Function 8(fvec2) + 64: TypePointer Function 11(fvec4) + 70: TypePointer Input 8(fvec2) +71(i.vTextureCoords): 70(ptr) Variable Input + 74: TypePointer Output 11(fvec4) +75(@entryPointOutput.vColor): 74(ptr) Variable Output + 5(MainPs): 3 Function None 4 + 6: Label + 69(i): 10(ptr) Variable Function + 76(param): 10(ptr) Variable Function + Line 17 23 0 + 72: 8(fvec2) Load 71(i.vTextureCoords) + 73: 60(ptr) AccessChain 69(i) 35 + Store 73 72 + 77: 9(PS_INPUT) Load 69(i) + Store 76(param) 77 + 78:12(PS_OUTPUT) FunctionCall 15(@MainPs(struct-PS_INPUT-vf21;) 76(param) + 79: 11(fvec4) CompositeExtract 78 0 + Store 75(@entryPointOutput.vColor) 79 + Return + FunctionEnd +15(@MainPs(struct-PS_INPUT-vf21;):12(PS_OUTPUT) Function None 13 + 14(i): 10(ptr) FunctionParameter + 16: Label + 34(u): 33(ptr) Variable Function + 44(ps_output): 43(ptr) Variable Function + Line 17 47 0 + 25: 24(ptr) AccessChain 21 23 + 26: 18(int) Load 25 + 29: 27(bool) INotEqual 26 28 + SelectionMerge 31 None + BranchConditional 29 30 38 + 30: Label + Line 32 3 0 + 36: 24(ptr) AccessChain 21 35 + 37: 18(int) Load 36 + Store 34(u) 37 + Branch 31 + 38: Label + Line 32 67 0 + 40: 24(ptr) AccessChain 21 39 + 41: 18(int) Load 40 + Store 34(u) 41 + Branch 31 + 31: Label + Line 42 7 0 + 50: 18(int) Load 34(u) + 52: 51(ptr) AccessChain 49(g_tColor) 50 + 53: 45 Load 52 + 57: 54 Load 56(g_sAniso) + 59: 58 SampledImage 53 57 + 61: 60(ptr) AccessChain 14(i) 35 + 62: 8(fvec2) Load 61 + 63: 11(fvec4) ImageSampleImplicitLod 59 62 + 65: 64(ptr) AccessChain 44(ps_output) 35 + Store 65 63 + Line 42 105 0 + 66:12(PS_OUTPUT) Load 44(ps_output) + ReturnValue 66 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.pp.line3.frag.out b/deps/glslang/Test/baseResults/hlsl.pp.line3.frag.out new file mode 100644 index 00000000..33e5d55a --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.pp.line3.frag.out @@ -0,0 +1,176 @@ +hlsl.pp.line3.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 78 + + Capability Shader + 3: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 6 "MainPs" 69 73 + ExecutionMode 6 OriginUpperLeft + 1: String "hlsl.pp.line3.frag" + 2: String "./i1.h" + Source HLSL 500 1 "// OpModuleProcessed entry-point MainPs +// OpModuleProcessed client vulkan100 +// OpModuleProcessed target-env vulkan1.0 +// OpModuleProcessed hlsl-offsets +#line 1 +Texture2D g_tColor[ 128 ] ; + +layout (push_constant) cbuffer PerViewConstantBuffer_t +{ + uint g_nDataIdx; + uint g_nDataIdx2; + bool g_B; +} ; + +SamplerState g_sAniso; + +struct PS_INPUT +{ + float2 vTextureCoords : TEXCOORD2 ; +} ; + +struct PS_OUTPUT +{ + float4 vColor : SV_Target0 ; +} ; + +PS_OUTPUT MainPs ( PS_INPUT i ) +{ + PS_OUTPUT ps_output ; + + uint u; + if (g_B) +#include "i1.h" + else + u = g_nDataIdx2; + ps_output . vColor = g_tColor [ u ] . Sample ( g_sAniso , i . vTextureCoords . xy ); + return ps_output ; +} + +" + Source HLSL 500 2 " u = g_nDataIdx; +" + Name 6 "MainPs" + Name 10 "PS_INPUT" + MemberName 10(PS_INPUT) 0 "vTextureCoords" + Name 13 "PS_OUTPUT" + MemberName 13(PS_OUTPUT) 0 "vColor" + Name 16 "@MainPs(struct-PS_INPUT-vf21;" + Name 15 "i" + Name 19 "PerViewConstantBuffer_t" + MemberName 19(PerViewConstantBuffer_t) 0 "g_nDataIdx" + MemberName 19(PerViewConstantBuffer_t) 1 "g_nDataIdx2" + MemberName 19(PerViewConstantBuffer_t) 2 "g_B" + Name 21 "" + Name 33 "u" + Name 42 "ps_output" + Name 47 "g_tColor" + Name 54 "g_sAniso" + Name 67 "i" + Name 69 "i.vTextureCoords" + Name 73 "@entryPointOutput.vColor" + Name 74 "param" + MemberDecorate 19(PerViewConstantBuffer_t) 0 Offset 0 + MemberDecorate 19(PerViewConstantBuffer_t) 1 Offset 4 + MemberDecorate 19(PerViewConstantBuffer_t) 2 Offset 8 + Decorate 19(PerViewConstantBuffer_t) Block + Decorate 47(g_tColor) DescriptorSet 0 + Decorate 47(g_tColor) Binding 0 + Decorate 54(g_sAniso) DescriptorSet 0 + Decorate 54(g_sAniso) Binding 0 + Decorate 69(i.vTextureCoords) Location 0 + Decorate 73(@entryPointOutput.vColor) Location 0 + 4: TypeVoid + 5: TypeFunction 4 + 8: TypeFloat 32 + 9: TypeVector 8(float) 2 + 10(PS_INPUT): TypeStruct 9(fvec2) + 11: TypePointer Function 10(PS_INPUT) + 12: TypeVector 8(float) 4 + 13(PS_OUTPUT): TypeStruct 12(fvec4) + 14: TypeFunction 13(PS_OUTPUT) 11(ptr) + 18: TypeInt 32 0 +19(PerViewConstantBuffer_t): TypeStruct 18(int) 18(int) 18(int) + 20: TypePointer PushConstant 19(PerViewConstantBuffer_t) + 21: 20(ptr) Variable PushConstant + 22: TypeInt 32 1 + 23: 22(int) Constant 2 + 24: TypePointer PushConstant 18(int) + 27: TypeBool + 28: 18(int) Constant 0 + 32: TypePointer Function 18(int) + 34: 22(int) Constant 0 + 38: 22(int) Constant 1 + 41: TypePointer Function 13(PS_OUTPUT) + 43: TypeImage 8(float) 2D sampled format:Unknown + 44: 18(int) Constant 128 + 45: TypeArray 43 44 + 46: TypePointer UniformConstant 45 + 47(g_tColor): 46(ptr) Variable UniformConstant + 49: TypePointer UniformConstant 43 + 52: TypeSampler + 53: TypePointer UniformConstant 52 + 54(g_sAniso): 53(ptr) Variable UniformConstant + 56: TypeSampledImage 43 + 58: TypePointer Function 9(fvec2) + 62: TypePointer Function 12(fvec4) + 68: TypePointer Input 9(fvec2) +69(i.vTextureCoords): 68(ptr) Variable Input + 72: TypePointer Output 12(fvec4) +73(@entryPointOutput.vColor): 72(ptr) Variable Output + 6(MainPs): 4 Function None 5 + 7: Label + 67(i): 11(ptr) Variable Function + 74(param): 11(ptr) Variable Function + Line 1 23 0 + 70: 9(fvec2) Load 69(i.vTextureCoords) + 71: 58(ptr) AccessChain 67(i) 34 + Store 71 70 + 75:10(PS_INPUT) Load 67(i) + Store 74(param) 75 + 76:13(PS_OUTPUT) FunctionCall 16(@MainPs(struct-PS_INPUT-vf21;) 74(param) + 77: 12(fvec4) CompositeExtract 76 0 + Store 73(@entryPointOutput.vColor) 77 + Return + FunctionEnd +16(@MainPs(struct-PS_INPUT-vf21;):13(PS_OUTPUT) Function None 14 + 15(i): 11(ptr) FunctionParameter + 17: Label + 33(u): 32(ptr) Variable Function + 42(ps_output): 41(ptr) Variable Function + Line 1 27 0 + 25: 24(ptr) AccessChain 21 23 + 26: 18(int) Load 25 + 29: 27(bool) INotEqual 26 28 + SelectionMerge 31 None + BranchConditional 29 30 37 + 30: Label + Line 2 1 0 + 35: 24(ptr) AccessChain 21 34 + 36: 18(int) Load 35 + Store 33(u) 36 + Branch 31 + 37: Label + Line 1 30 0 + 39: 24(ptr) AccessChain 21 38 + 40: 18(int) Load 39 + Store 33(u) 40 + Branch 31 + 31: Label + Line 1 31 0 + 48: 18(int) Load 33(u) + 50: 49(ptr) AccessChain 47(g_tColor) 48 + 51: 43 Load 50 + 55: 52 Load 54(g_sAniso) + 57: 56 SampledImage 51 55 + 59: 58(ptr) AccessChain 15(i) 34 + 60: 9(fvec2) Load 59 + 61: 12(fvec4) ImageSampleImplicitLod 57 60 + 63: 62(ptr) AccessChain 42(ps_output) 34 + Store 63 61 + Line 1 32 0 + 64:13(PS_OUTPUT) Load 42(ps_output) + ReturnValue 64 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.pp.line4.frag.out b/deps/glslang/Test/baseResults/hlsl.pp.line4.frag.out new file mode 100644 index 00000000..ff92b520 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.pp.line4.frag.out @@ -0,0 +1,146 @@ +hlsl.pp.line4.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 115 + + Capability Shader + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 5 "MainPs" 70 74 + ExecutionMode 5 OriginUpperLeft + 1: String "hlsl.pp.line4.frag" + 17: String "C:\\Users\\Greg\\shaders\\line\\foo4.frag" + 32: String "C:\\Users\\Greg\\shaders\\line\\u1.h" + Source HLSL 500 1 "// OpModuleProcessed auto-map-locations +// OpModuleProcessed auto-map-bindings +// OpModuleProcessed entry-point MainPs +// OpModuleProcessed client vulkan100 +// OpModuleProcessed target-env vulkan1.0 +// OpModuleProcessed keep-uncalled +// OpModuleProcessed hlsl-offsets +#line 1 +#line 1 "C:\\Users\\Greg\\shaders\\line\\foo4.frag" +Texture2D g_tColor [ 128 ] ; + +layout ( push_constant ) cbuffer PerViewConstantBuffer_t +{ + uint g_nDataIdx ; + uint g_nDataIdx2 ; + bool g_B ; +} ; + +#line 12 +SamplerState g_sAniso ; + +struct PS_INPUT +{ + float2 vTextureCoords : TEXCOORD2 ; +} ; + +struct PS_OUTPUT +{ + float4 vColor : SV_Target0 ; +} ; + +PS_OUTPUT MainPs ( PS_INPUT i ) +{ + PS_OUTPUT ps_output ; + + uint u ; + if ( g_B ) + + +#line 1 "C:\\Users\\Greg\\shaders\\line\\u1.h" + u = g_nDataIdx ; + + +#line 31 "C:\\Users\\Greg\\shaders\\line\\foo4.frag" + else + u = g_nDataIdx2 ; + ps_output . vColor = g_tColor [ u ] . Sample ( g_sAniso , i . vTextureCoords . xy ) ; + return ps_output ; +} + +" + Name 5 "MainPs" + Name 19 "PerViewConstantBuffer_t" + MemberName 19(PerViewConstantBuffer_t) 0 "g_nDataIdx" + MemberName 19(PerViewConstantBuffer_t) 1 "g_nDataIdx2" + MemberName 19(PerViewConstantBuffer_t) 2 "g_B" + Name 21 "" + Name 48 "g_tColor" + Name 55 "g_sAniso" + Name 70 "i.vTextureCoords" + Name 74 "@entryPointOutput.vColor" + MemberDecorate 19(PerViewConstantBuffer_t) 0 Offset 0 + MemberDecorate 19(PerViewConstantBuffer_t) 1 Offset 4 + MemberDecorate 19(PerViewConstantBuffer_t) 2 Offset 8 + Decorate 19(PerViewConstantBuffer_t) Block + Decorate 48(g_tColor) DescriptorSet 0 + Decorate 48(g_tColor) Binding 0 + Decorate 55(g_sAniso) DescriptorSet 0 + Decorate 55(g_sAniso) Binding 0 + Decorate 70(i.vTextureCoords) Location 0 + Decorate 74(@entryPointOutput.vColor) Location 0 + 3: TypeVoid + 4: TypeFunction 3 + 7: TypeFloat 32 + 8: TypeVector 7(float) 2 + 11: TypeVector 7(float) 4 + 18: TypeInt 32 0 +19(PerViewConstantBuffer_t): TypeStruct 18(int) 18(int) 18(int) + 20: TypePointer PushConstant 19(PerViewConstantBuffer_t) + 21: 20(ptr) Variable PushConstant + 22: TypeInt 32 1 + 23: 22(int) Constant 2 + 24: TypePointer PushConstant 18(int) + 27: TypeBool + 28: 18(int) Constant 0 + 35: 22(int) Constant 0 + 39: 22(int) Constant 1 + 44: TypeImage 7(float) 2D sampled format:Unknown + 45: 18(int) Constant 128 + 46: TypeArray 44 45 + 47: TypePointer UniformConstant 46 + 48(g_tColor): 47(ptr) Variable UniformConstant + 50: TypePointer UniformConstant 44 + 53: TypeSampler + 54: TypePointer UniformConstant 53 + 55(g_sAniso): 54(ptr) Variable UniformConstant + 57: TypeSampledImage 44 + 69: TypePointer Input 8(fvec2) +70(i.vTextureCoords): 69(ptr) Variable Input + 73: TypePointer Output 11(fvec4) +74(@entryPointOutput.vColor): 73(ptr) Variable Output + 5(MainPs): 3 Function None 4 + 6: Label + Line 17 25 0 + 71: 8(fvec2) Load 70(i.vTextureCoords) + Line 17 29 0 + 82: 24(ptr) AccessChain 21 23 + 83: 18(int) Load 82 + 84: 27(bool) INotEqual 83 28 + SelectionMerge 85 None + BranchConditional 84 86 87 + 86: Label + Line 32 1 0 + 88: 24(ptr) AccessChain 21 35 + 89: 18(int) Load 88 + Branch 85 + 87: Label + Line 17 32 0 + 90: 24(ptr) AccessChain 21 39 + 91: 18(int) Load 90 + Branch 85 + 85: Label + 114: 18(int) Phi 89 86 91 87 + Line 17 33 0 + 93: 50(ptr) AccessChain 48(g_tColor) 114 + 94: 44 Load 93 + 95: 53 Load 55(g_sAniso) + 96: 57 SampledImage 94 95 + 99: 11(fvec4) ImageSampleImplicitLod 96 71 + Line 17 25 0 + Store 74(@entryPointOutput.vColor) 99 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.pp.vert.out b/deps/glslang/Test/baseResults/hlsl.pp.vert.out index 817b6471..24ddfd1d 100644 --- a/deps/glslang/Test/baseResults/hlsl.pp.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.pp.vert.out @@ -44,6 +44,7 @@ Shader version: 500 MemberDecorate 10($Global) 1 Offset 4 Decorate 10($Global) Block Decorate 12 DescriptorSet 0 + Decorate 12 Binding 0 2: TypeVoid 3: TypeFunction 2 9: TypeInt 32 1 diff --git a/deps/glslang/Test/baseResults/hlsl.preprocessor.frag.out b/deps/glslang/Test/baseResults/hlsl.preprocessor.frag.out index c78de3dd..3c36530e 100644 --- a/deps/glslang/Test/baseResults/hlsl.preprocessor.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.preprocessor.frag.out @@ -114,7 +114,9 @@ gl_FragCoord origin is upper left Name 36 "@entryPointOutput" Name 37 "param" Decorate 16(test_texture) DescriptorSet 0 + Decorate 16(test_texture) Binding 0 Decorate 20(test_texture_ss) DescriptorSet 0 + Decorate 20(test_texture_ss) Binding 0 Decorate 33(input) Location 0 Decorate 36(@entryPointOutput) Location 0 2: TypeVoid diff --git a/deps/glslang/Test/baseResults/hlsl.promote.atomic.frag.out b/deps/glslang/Test/baseResults/hlsl.promote.atomic.frag.out index ecc188b1..bd781bdb 100644 --- a/deps/glslang/Test/baseResults/hlsl.promote.atomic.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.promote.atomic.frag.out @@ -82,6 +82,7 @@ gl_FragCoord origin is upper left Name 20 "Inc" Name 34 "@entryPointOutput" Decorate 17(s_uintbuff) DescriptorSet 0 + Decorate 17(s_uintbuff) Binding 0 Decorate 34(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.promote.binary.frag.out b/deps/glslang/Test/baseResults/hlsl.promote.binary.frag.out index e1931af1..624a5062 100644 --- a/deps/glslang/Test/baseResults/hlsl.promote.binary.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.promote.binary.frag.out @@ -204,6 +204,7 @@ gl_FragCoord origin is upper left MemberDecorate 16($Global) 5 Offset 80 Decorate 16($Global) Block Decorate 18 DescriptorSet 0 + Decorate 18 Binding 0 Decorate 80(@entryPointOutput.Color) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.promotions.frag.out b/deps/glslang/Test/baseResults/hlsl.promotions.frag.out index 9c089484..cb799831 100644 --- a/deps/glslang/Test/baseResults/hlsl.promotions.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.promotions.frag.out @@ -1695,6 +1695,7 @@ gl_FragCoord origin is upper left MemberDecorate 111($Global) 9 Offset 104 Decorate 111($Global) Block Decorate 113 DescriptorSet 0 + Decorate 113 Binding 0 Decorate 593(@entryPointOutput.Color) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.reflection.vert.out b/deps/glslang/Test/baseResults/hlsl.reflection.vert.out index ea8d8690..3403bd35 100644 --- a/deps/glslang/Test/baseResults/hlsl.reflection.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.reflection.vert.out @@ -15,45 +15,45 @@ foo.n1.a: offset 0, type 1406, size 1, index 3, binding -1, stages 1 foo.n2.b: offset 16, type 1406, size 1, index 3, binding -1, stages 1 foo.n2.c: offset 20, type 1406, size 1, index 3, binding -1, stages 1 foo.n2.d: offset 24, type 1406, size 1, index 3, binding -1, stages 1 -deepA.d2.d1[2].va: offset 376, type 8b50, size 2, index 1, binding -1, stages 1 +deepA.d2.d1[2].va: offset 440, type 8b50, size 2, index 1, binding -1, stages 1 deepB.d2.d1.va: offset 984, type 8b50, size 2, index 1, binding -1, stages 1 deepB.d2.d1[0].va: offset 984, type 8b50, size 2, index 1, binding -1, stages 1 -deepB.d2.d1[1].va: offset 984, type 8b50, size 2, index 1, binding -1, stages 1 -deepB.d2.d1[2].va: offset 984, type 8b50, size 2, index 1, binding -1, stages 1 -deepB.d2.d1[3].va: offset 984, type 8b50, size 2, index 1, binding -1, stages 1 +deepB.d2.d1[1].va: offset 1016, type 8b50, size 2, index 1, binding -1, stages 1 +deepB.d2.d1[2].va: offset 1048, type 8b50, size 2, index 1, binding -1, stages 1 +deepB.d2.d1[3].va: offset 1080, type 8b50, size 2, index 1, binding -1, stages 1 deepC.iv4: offset 1568, type 8b52, size 1, index 1, binding -1, stages 1 -deepC.d2.i: offset 1568, type 1404, size 1, index 1, binding -1, stages 1 -deepC.d2.d1[0].va: offset 1568, type 8b50, size 3, index 1, binding -1, stages 1 -deepC.d2.d1[0].b: offset 1568, type 8b56, size 1, index 1, binding -1, stages 1 -deepC.d2.d1[1].va: offset 1568, type 8b50, size 3, index 1, binding -1, stages 1 -deepC.d2.d1[1].b: offset 1568, type 8b56, size 1, index 1, binding -1, stages 1 -deepC.d2.d1[2].va: offset 1568, type 8b50, size 3, index 1, binding -1, stages 1 -deepC.d2.d1[2].b: offset 1568, type 8b56, size 1, index 1, binding -1, stages 1 -deepC.d2.d1[3].va: offset 1568, type 8b50, size 3, index 1, binding -1, stages 1 -deepC.d2.d1[3].b: offset 1568, type 8b56, size 1, index 1, binding -1, stages 1 -deepC.v3: offset 1568, type 8b54, size 1, index 1, binding -1, stages 1 +deepC.d2.i: offset 1584, type 1404, size 1, index 1, binding -1, stages 1 +deepC.d2.d1[0].va: offset 1592, type 8b50, size 3, index 1, binding -1, stages 1 +deepC.d2.d1[0].b: offset 1616, type 8b56, size 1, index 1, binding -1, stages 1 +deepC.d2.d1[1].va: offset 1624, type 8b50, size 3, index 1, binding -1, stages 1 +deepC.d2.d1[1].b: offset 1648, type 8b56, size 1, index 1, binding -1, stages 1 +deepC.d2.d1[2].va: offset 1656, type 8b50, size 3, index 1, binding -1, stages 1 +deepC.d2.d1[2].b: offset 1680, type 8b56, size 1, index 1, binding -1, stages 1 +deepC.d2.d1[3].va: offset 1688, type 8b50, size 3, index 1, binding -1, stages 1 +deepC.d2.d1[3].b: offset 1712, type 8b56, size 1, index 1, binding -1, stages 1 +deepC.v3: offset 1728, type 8b54, size 1, index 1, binding -1, stages 1 deepD[0].iv4: offset 2480, type 8b52, size 1, index 1, binding -1, stages 1 -deepD[0].d2.i: offset 2480, type 1404, size 1, index 1, binding -1, stages 1 -deepD[0].d2.d1[0].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1 -deepD[0].d2.d1[0].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1 -deepD[0].d2.d1[1].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1 -deepD[0].d2.d1[1].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1 -deepD[0].d2.d1[2].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1 -deepD[0].d2.d1[2].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1 -deepD[0].d2.d1[3].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1 -deepD[0].d2.d1[3].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1 -deepD[0].v3: offset 2480, type 8b54, size 1, index 1, binding -1, stages 1 -deepD[1].iv4: offset 2480, type 8b52, size 1, index 1, binding -1, stages 1 -deepD[1].d2.i: offset 2480, type 1404, size 1, index 1, binding -1, stages 1 -deepD[1].d2.d1[0].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1 -deepD[1].d2.d1[0].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1 -deepD[1].d2.d1[1].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1 -deepD[1].d2.d1[1].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1 -deepD[1].d2.d1[2].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1 -deepD[1].d2.d1[2].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1 -deepD[1].d2.d1[3].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1 -deepD[1].d2.d1[3].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1 -deepD[1].v3: offset 2480, type 8b54, size 1, index 1, binding -1, stages 1 +deepD[0].d2.i: offset 2496, type 1404, size 1, index 1, binding -1, stages 1 +deepD[0].d2.d1[0].va: offset 2504, type 8b50, size 3, index 1, binding -1, stages 1 +deepD[0].d2.d1[0].b: offset 2528, type 8b56, size 1, index 1, binding -1, stages 1 +deepD[0].d2.d1[1].va: offset 2536, type 8b50, size 3, index 1, binding -1, stages 1 +deepD[0].d2.d1[1].b: offset 2560, type 8b56, size 1, index 1, binding -1, stages 1 +deepD[0].d2.d1[2].va: offset 2568, type 8b50, size 3, index 1, binding -1, stages 1 +deepD[0].d2.d1[2].b: offset 2592, type 8b56, size 1, index 1, binding -1, stages 1 +deepD[0].d2.d1[3].va: offset 2600, type 8b50, size 3, index 1, binding -1, stages 1 +deepD[0].d2.d1[3].b: offset 2624, type 8b56, size 1, index 1, binding -1, stages 1 +deepD[0].v3: offset 2640, type 8b54, size 1, index 1, binding -1, stages 1 +deepD[1].iv4: offset 2784, type 8b52, size 1, index 1, binding -1, stages 1 +deepD[1].d2.i: offset 2800, type 1404, size 1, index 1, binding -1, stages 1 +deepD[1].d2.d1[0].va: offset 2808, type 8b50, size 3, index 1, binding -1, stages 1 +deepD[1].d2.d1[0].b: offset 2832, type 8b56, size 1, index 1, binding -1, stages 1 +deepD[1].d2.d1[1].va: offset 2840, type 8b50, size 3, index 1, binding -1, stages 1 +deepD[1].d2.d1[1].b: offset 2864, type 8b56, size 1, index 1, binding -1, stages 1 +deepD[1].d2.d1[2].va: offset 2872, type 8b50, size 3, index 1, binding -1, stages 1 +deepD[1].d2.d1[2].b: offset 2896, type 8b56, size 1, index 1, binding -1, stages 1 +deepD[1].d2.d1[3].va: offset 2904, type 8b50, size 3, index 1, binding -1, stages 1 +deepD[1].d2.d1[3].b: offset 2928, type 8b56, size 1, index 1, binding -1, stages 1 +deepD[1].v3: offset 2944, type 8b54, size 1, index 1, binding -1, stages 1 foo1: offset 0, type 1406, size 1, index 4, binding -1, stages 1 foo2: offset 0, type 1406, size 1, index 5, binding -1, stages 1 anonMember1: offset 0, type 8b51, size 1, index 0, binding -1, stages 1 diff --git a/deps/glslang/Test/baseResults/hlsl.rw.atomics.frag.out b/deps/glslang/Test/baseResults/hlsl.rw.atomics.frag.out index c874cd23..02aa00ca 100644 --- a/deps/glslang/Test/baseResults/hlsl.rw.atomics.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.rw.atomics.frag.out @@ -3997,6 +3997,7 @@ gl_FragCoord origin is upper left Name 1143 "g_tTex2du1a" Name 1146 "g_tBuffF" Decorate 15(g_tTex1di1) DescriptorSet 0 + Decorate 15(g_tTex1di1) Binding 0 MemberDecorate 21($Global) 0 Offset 0 MemberDecorate 21($Global) 1 Offset 8 MemberDecorate 21($Global) 2 Offset 16 @@ -4009,25 +4010,44 @@ gl_FragCoord origin is upper left MemberDecorate 21($Global) 9 Offset 64 Decorate 21($Global) Block Decorate 23 DescriptorSet 0 + Decorate 23 Binding 0 Decorate 121(g_tTex1du1) DescriptorSet 0 + Decorate 121(g_tTex1du1) Binding 0 Decorate 217(g_tTex2di1) DescriptorSet 0 + Decorate 217(g_tTex2di1) Binding 0 Decorate 308(g_tTex2du1) DescriptorSet 0 + Decorate 308(g_tTex2du1) Binding 0 Decorate 399(g_tTex3di1) DescriptorSet 0 + Decorate 399(g_tTex3di1) Binding 0 Decorate 490(g_tTex3du1) DescriptorSet 0 + Decorate 490(g_tTex3du1) Binding 0 Decorate 581(g_tTex1di1a) DescriptorSet 0 + Decorate 581(g_tTex1di1a) Binding 0 Decorate 670(g_tTex1du1a) DescriptorSet 0 + Decorate 670(g_tTex1du1a) Binding 0 Decorate 931(g_tBuffI) DescriptorSet 0 + Decorate 931(g_tBuffI) Binding 0 Decorate 1020(g_tBuffU) DescriptorSet 0 + Decorate 1020(g_tBuffU) Binding 0 Decorate 1117(@entryPointOutput.Color) Location 0 Decorate 1122(g_sSamp) DescriptorSet 0 + Decorate 1122(g_sSamp) Binding 0 Decorate 1125(g_tTex1df1) DescriptorSet 0 + Decorate 1125(g_tTex1df1) Binding 0 Decorate 1128(g_tTex2df1) DescriptorSet 0 + Decorate 1128(g_tTex2df1) Binding 0 Decorate 1131(g_tTex3df1) DescriptorSet 0 + Decorate 1131(g_tTex3df1) Binding 0 Decorate 1134(g_tTex1df1a) DescriptorSet 0 + Decorate 1134(g_tTex1df1a) Binding 0 Decorate 1137(g_tTex2df1a) DescriptorSet 0 + Decorate 1137(g_tTex2df1a) Binding 0 Decorate 1140(g_tTex2di1a) DescriptorSet 0 + Decorate 1140(g_tTex2di1a) Binding 0 Decorate 1143(g_tTex2du1a) DescriptorSet 0 + Decorate 1143(g_tTex2du1a) Binding 0 Decorate 1146(g_tBuffF) DescriptorSet 0 + Decorate 1146(g_tBuffF) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.rw.bracket.frag.out b/deps/glslang/Test/baseResults/hlsl.rw.bracket.frag.out index d829a7bc..dc60a297 100644 --- a/deps/glslang/Test/baseResults/hlsl.rw.bracket.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.rw.bracket.frag.out @@ -1893,25 +1893,40 @@ gl_FragCoord origin is upper left MemberDecorate 63($Global) 10 Offset 128 Decorate 63($Global) Block Decorate 65 DescriptorSet 0 + Decorate 65 Binding 0 Decorate 75(g_tTex1df4) DescriptorSet 0 Decorate 75(g_tTex1df4) Binding 0 Decorate 89(g_tTex1di4) DescriptorSet 0 + Decorate 89(g_tTex1di4) Binding 0 Decorate 97(g_tTex1du4) DescriptorSet 0 + Decorate 97(g_tTex1du4) Binding 0 Decorate 105(g_tTex2df4) DescriptorSet 0 + Decorate 105(g_tTex2df4) Binding 0 Decorate 115(g_tTex2di4) DescriptorSet 0 + Decorate 115(g_tTex2di4) Binding 0 Decorate 123(g_tTex2du4) DescriptorSet 0 + Decorate 123(g_tTex2du4) Binding 0 Decorate 131(g_tTex3df4) DescriptorSet 0 + Decorate 131(g_tTex3df4) Binding 0 Decorate 141(g_tTex3di4) DescriptorSet 0 + Decorate 141(g_tTex3di4) Binding 0 Decorate 149(g_tTex3du4) DescriptorSet 0 + Decorate 149(g_tTex3du4) Binding 0 Decorate 583(@entryPointOutput.Color) Location 0 Decorate 588(g_sSamp) DescriptorSet 0 Decorate 588(g_sSamp) Binding 0 Decorate 591(g_tTex1df4a) DescriptorSet 0 + Decorate 591(g_tTex1df4a) Binding 0 Decorate 594(g_tTex1di4a) DescriptorSet 0 + Decorate 594(g_tTex1di4a) Binding 0 Decorate 597(g_tTex1du4a) DescriptorSet 0 + Decorate 597(g_tTex1du4a) Binding 0 Decorate 600(g_tTex2df4a) DescriptorSet 0 + Decorate 600(g_tTex2df4a) Binding 0 Decorate 603(g_tTex2di4a) DescriptorSet 0 + Decorate 603(g_tTex2di4a) Binding 0 Decorate 606(g_tTex2du4a) DescriptorSet 0 + Decorate 606(g_tTex2du4a) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 diff --git a/deps/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out b/deps/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out index 7fc26cc7..aabee593 100644 --- a/deps/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out @@ -1839,24 +1839,40 @@ gl_FragCoord origin is upper left MemberDecorate 59($Global) 10 Offset 104 Decorate 59($Global) Block Decorate 61 DescriptorSet 0 + Decorate 61 Binding 0 Decorate 70(g_tTex1df1) DescriptorSet 0 + Decorate 70(g_tTex1df1) Binding 0 Decorate 83(g_tTex1di1) DescriptorSet 0 + Decorate 83(g_tTex1di1) Binding 0 Decorate 91(g_tTex1du1) DescriptorSet 0 + Decorate 91(g_tTex1du1) Binding 0 Decorate 99(g_tTex2df1) DescriptorSet 0 + Decorate 99(g_tTex2df1) Binding 0 Decorate 109(g_tTex2di1) DescriptorSet 0 + Decorate 109(g_tTex2di1) Binding 0 Decorate 117(g_tTex2du1) DescriptorSet 0 + Decorate 117(g_tTex2du1) Binding 0 Decorate 125(g_tTex3df1) DescriptorSet 0 + Decorate 125(g_tTex3df1) Binding 0 Decorate 135(g_tTex3di1) DescriptorSet 0 + Decorate 135(g_tTex3di1) Binding 0 Decorate 143(g_tTex3du1) DescriptorSet 0 + Decorate 143(g_tTex3du1) Binding 0 Decorate 547(@entryPointOutput.Color) Location 0 Decorate 552(g_sSamp) DescriptorSet 0 Decorate 552(g_sSamp) Binding 0 Decorate 555(g_tTex1df1a) DescriptorSet 0 + Decorate 555(g_tTex1df1a) Binding 0 Decorate 558(g_tTex1di1a) DescriptorSet 0 + Decorate 558(g_tTex1di1a) Binding 0 Decorate 561(g_tTex1du1a) DescriptorSet 0 + Decorate 561(g_tTex1du1a) Binding 0 Decorate 564(g_tTex2df1a) DescriptorSet 0 + Decorate 564(g_tTex2df1a) Binding 0 Decorate 567(g_tTex2di1a) DescriptorSet 0 + Decorate 567(g_tTex2di1a) Binding 0 Decorate 570(g_tTex2du1a) DescriptorSet 0 + Decorate 570(g_tTex2du1a) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 diff --git a/deps/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out b/deps/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out index 8fcbb4ba..089c6037 100644 --- a/deps/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out @@ -224,8 +224,10 @@ gl_FragCoord origin is upper left Name 58 "@entryPointOutput" Name 62 "buf" Decorate 35(rwtx) DescriptorSet 0 + Decorate 35(rwtx) Binding 0 Decorate 58(@entryPointOutput) Location 0 Decorate 62(buf) DescriptorSet 0 + Decorate 62(buf) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out b/deps/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out index bf1fe088..a3b52379 100644 --- a/deps/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out @@ -1858,24 +1858,40 @@ gl_FragCoord origin is upper left MemberDecorate 64($Global) 10 Offset 112 Decorate 64($Global) Block Decorate 66 DescriptorSet 0 + Decorate 66 Binding 0 Decorate 76(g_tTex1df2) DescriptorSet 0 + Decorate 76(g_tTex1df2) Binding 0 Decorate 90(g_tTex1di2) DescriptorSet 0 + Decorate 90(g_tTex1di2) Binding 0 Decorate 98(g_tTex1du2) DescriptorSet 0 + Decorate 98(g_tTex1du2) Binding 0 Decorate 106(g_tTex2df2) DescriptorSet 0 + Decorate 106(g_tTex2df2) Binding 0 Decorate 114(g_tTex2di2) DescriptorSet 0 + Decorate 114(g_tTex2di2) Binding 0 Decorate 122(g_tTex2du2) DescriptorSet 0 + Decorate 122(g_tTex2du2) Binding 0 Decorate 130(g_tTex3df2) DescriptorSet 0 + Decorate 130(g_tTex3df2) Binding 0 Decorate 140(g_tTex3di2) DescriptorSet 0 + Decorate 140(g_tTex3di2) Binding 0 Decorate 148(g_tTex3du2) DescriptorSet 0 + Decorate 148(g_tTex3du2) Binding 0 Decorate 581(@entryPointOutput.Color) Location 0 Decorate 586(g_sSamp) DescriptorSet 0 Decorate 586(g_sSamp) Binding 0 Decorate 589(g_tTex1df2a) DescriptorSet 0 + Decorate 589(g_tTex1df2a) Binding 0 Decorate 592(g_tTex1di2a) DescriptorSet 0 + Decorate 592(g_tTex1di2a) Binding 0 Decorate 595(g_tTex1du2a) DescriptorSet 0 + Decorate 595(g_tTex1du2a) Binding 0 Decorate 598(g_tTex2df2a) DescriptorSet 0 + Decorate 598(g_tTex2df2a) Binding 0 Decorate 601(g_tTex2di2a) DescriptorSet 0 + Decorate 601(g_tTex2di2a) Binding 0 Decorate 604(g_tTex2du2a) DescriptorSet 0 + Decorate 604(g_tTex2du2a) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 diff --git a/deps/glslang/Test/baseResults/hlsl.sample.array.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.sample.array.dx10.frag.out index 92e3dd84..9066a1d7 100644 --- a/deps/glslang/Test/baseResults/hlsl.sample.array.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.sample.array.dx10.frag.out @@ -368,13 +368,21 @@ using depth_any Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 35(g_tTex1di4) DescriptorSet 0 + Decorate 35(g_tTex1di4) Binding 0 Decorate 49(g_tTex1du4) DescriptorSet 0 + Decorate 49(g_tTex1du4) Binding 0 Decorate 60(g_tTex2df4) DescriptorSet 0 + Decorate 60(g_tTex2df4) Binding 0 Decorate 71(g_tTex2di4) DescriptorSet 0 + Decorate 71(g_tTex2di4) Binding 0 Decorate 82(g_tTex2du4) DescriptorSet 0 + Decorate 82(g_tTex2du4) Binding 0 Decorate 94(g_tTexcdf4) DescriptorSet 0 + Decorate 94(g_tTexcdf4) Binding 0 Decorate 104(g_tTexcdi4) DescriptorSet 0 + Decorate 104(g_tTexcdi4) Binding 0 Decorate 114(g_tTexcdu4) DescriptorSet 0 + Decorate 114(g_tTexcdu4) Binding 0 Decorate 138(@entryPointOutput.Color) Location 0 Decorate 142(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 145(g_tTex1df4a) DescriptorSet 0 diff --git a/deps/glslang/Test/baseResults/hlsl.sample.basic.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.sample.basic.dx10.frag.out index b6915b6a..0940e101 100644 --- a/deps/glslang/Test/baseResults/hlsl.sample.basic.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.sample.basic.dx10.frag.out @@ -617,20 +617,33 @@ using depth_any Decorate 49(g_sSamp) DescriptorSet 0 Decorate 49(g_sSamp) Binding 0 Decorate 60(g_tTex1di4) DescriptorSet 0 + Decorate 60(g_tTex1di4) Binding 0 Decorate 73(g_tTex1du4) DescriptorSet 0 + Decorate 73(g_tTex1du4) Binding 0 Decorate 83(g_tTex2df4) DescriptorSet 0 + Decorate 83(g_tTex2df4) Binding 0 Decorate 94(g_tTex2di4) DescriptorSet 0 + Decorate 94(g_tTex2di4) Binding 0 Decorate 105(g_tTex2du4) DescriptorSet 0 + Decorate 105(g_tTex2du4) Binding 0 Decorate 117(g_tTex3df4) DescriptorSet 0 + Decorate 117(g_tTex3df4) Binding 0 Decorate 128(g_tTex3di4) DescriptorSet 0 + Decorate 128(g_tTex3di4) Binding 0 Decorate 138(g_tTex3du4) DescriptorSet 0 + Decorate 138(g_tTex3du4) Binding 0 Decorate 151(g_tTexcdf4) DescriptorSet 0 + Decorate 151(g_tTexcdf4) Binding 0 Decorate 160(g_tTexcdi4) DescriptorSet 0 + Decorate 160(g_tTexcdi4) Binding 0 Decorate 169(g_tTexcdu4) DescriptorSet 0 + Decorate 169(g_tTexcdu4) Binding 0 Decorate 188(@entryPointOutput.Color) Location 0 Decorate 192(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 195(g_sSamp2d) DescriptorSet 0 + Decorate 195(g_sSamp2d) Binding 0 Decorate 196(g_sSamp2D_b) DescriptorSet 0 + Decorate 196(g_sSamp2D_b) Binding 0 Decorate 197(g_tTex1df4a) DescriptorSet 0 Decorate 197(g_tTex1df4a) Binding 1 2: TypeVoid diff --git a/deps/glslang/Test/baseResults/hlsl.sample.dx9.frag.out b/deps/glslang/Test/baseResults/hlsl.sample.dx9.frag.out new file mode 100644 index 00000000..7b3432af --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.sample.dx9.frag.out @@ -0,0 +1,592 @@ +hlsl.sample.dx9.frag +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:15 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:15 Function Parameters: +0:? Sequence +0:18 Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:18 'ColorOut' ( temp 4-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:20 add second child into first child ( temp 4-component vector of float) +0:20 'ColorOut' ( temp 4-component vector of float) +0:20 texture ( temp 4-component vector of float) +0:20 'g_sam' (layout( binding=0) uniform sampler2D) +0:? Constant: +0:? 0.400000 +0:? 0.300000 +0:21 add second child into first child ( temp 4-component vector of float) +0:21 'ColorOut' ( temp 4-component vector of float) +0:21 texture ( temp 4-component vector of float) +0:21 'g_sam1D' (layout( binding=1) uniform sampler1D) +0:21 Constant: +0:21 0.500000 +0:22 add second child into first child ( temp 4-component vector of float) +0:22 'ColorOut' ( temp 4-component vector of float) +0:22 texture ( temp 4-component vector of float) +0:22 'g_sam2D' (layout( binding=2) uniform sampler2D) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:23 add second child into first child ( temp 4-component vector of float) +0:23 'ColorOut' ( temp 4-component vector of float) +0:23 texture ( temp 4-component vector of float) +0:23 'g_sam3D' (layout( binding=3) uniform sampler3D) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.400000 +0:24 add second child into first child ( temp 4-component vector of float) +0:24 'ColorOut' ( temp 4-component vector of float) +0:24 texture ( temp 4-component vector of float) +0:24 'g_samCube' (layout( binding=4) uniform samplerCube) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.400000 +0:26 add second child into first child ( temp 4-component vector of float) +0:26 'ColorOut' ( temp 4-component vector of float) +0:26 textureLod ( temp 4-component vector of float) +0:26 'g_sam' (layout( binding=0) uniform sampler2D) +0:26 Construct vec2 ( temp 2-component vector of float) +0:? Constant: +0:? 0.400000 +0:? 0.300000 +0:? 0.000000 +0:? 0.000000 +0:26 direct index ( temp float) +0:? Constant: +0:? 0.400000 +0:? 0.300000 +0:? 0.000000 +0:? 0.000000 +0:26 Constant: +0:26 3 (const int) +0:27 add second child into first child ( temp 4-component vector of float) +0:27 'ColorOut' ( temp 4-component vector of float) +0:27 textureLod ( temp 4-component vector of float) +0:27 'g_sam1D' (layout( binding=1) uniform sampler1D) +0:27 Construct float ( temp float) +0:? Constant: +0:? 0.500000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:27 direct index ( temp float) +0:? Constant: +0:? 0.500000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:27 Constant: +0:27 3 (const int) +0:28 add second child into first child ( temp 4-component vector of float) +0:28 'ColorOut' ( temp 4-component vector of float) +0:28 textureLod ( temp 4-component vector of float) +0:28 'g_sam2D' (layout( binding=2) uniform sampler2D) +0:28 Construct vec2 ( temp 2-component vector of float) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.000000 +0:? 0.000000 +0:28 direct index ( temp float) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.000000 +0:? 0.000000 +0:28 Constant: +0:28 3 (const int) +0:29 add second child into first child ( temp 4-component vector of float) +0:29 'ColorOut' ( temp 4-component vector of float) +0:29 textureLod ( temp 4-component vector of float) +0:29 'g_sam3D' (layout( binding=3) uniform sampler3D) +0:29 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.400000 +0:? 0.000000 +0:29 direct index ( temp float) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.400000 +0:? 0.000000 +0:29 Constant: +0:29 3 (const int) +0:30 add second child into first child ( temp 4-component vector of float) +0:30 'ColorOut' ( temp 4-component vector of float) +0:30 textureLod ( temp 4-component vector of float) +0:30 'g_samCube' (layout( binding=4) uniform samplerCube) +0:30 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.400000 +0:? 0.000000 +0:30 direct index ( temp float) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.400000 +0:? 0.000000 +0:30 Constant: +0:30 3 (const int) +0:32 move second child to first child ( temp 4-component vector of float) +0:32 Color: direct index for structure ( temp 4-component vector of float) +0:32 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:32 Constant: +0:32 0 (const int) +0:32 divide ( temp 4-component vector of float) +0:32 'ColorOut' ( temp 4-component vector of float) +0:32 Constant: +0:32 10.000000 +0:33 move second child to first child ( temp float) +0:33 Depth: direct index for structure ( temp float) +0:33 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 1.000000 +0:35 Branch: Return with expression +0:35 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:15 Function Definition: main( ( temp void) +0:15 Function Parameters: +0:? Sequence +0:15 Sequence +0:15 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:15 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:15 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:15 Color: direct index for structure ( temp 4-component vector of float) +0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:15 Constant: +0:15 0 (const int) +0:15 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:15 Depth: direct index for structure ( temp float) +0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:15 Constant: +0:15 1 (const int) +0:? Linker Objects +0:? 'g_sam' (layout( binding=0) uniform sampler2D) +0:? 'g_sam1D' (layout( binding=1) uniform sampler1D) +0:? 'g_sam2D' (layout( binding=2) uniform sampler2D) +0:? 'g_sam3D' (layout( binding=3) uniform sampler3D) +0:? 'g_samCube' (layout( binding=4) uniform samplerCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +using depth_any +0:? Sequence +0:15 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:15 Function Parameters: +0:? Sequence +0:18 Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:18 'ColorOut' ( temp 4-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:20 add second child into first child ( temp 4-component vector of float) +0:20 'ColorOut' ( temp 4-component vector of float) +0:20 texture ( temp 4-component vector of float) +0:20 'g_sam' (layout( binding=0) uniform sampler2D) +0:? Constant: +0:? 0.400000 +0:? 0.300000 +0:21 add second child into first child ( temp 4-component vector of float) +0:21 'ColorOut' ( temp 4-component vector of float) +0:21 texture ( temp 4-component vector of float) +0:21 'g_sam1D' (layout( binding=1) uniform sampler1D) +0:21 Constant: +0:21 0.500000 +0:22 add second child into first child ( temp 4-component vector of float) +0:22 'ColorOut' ( temp 4-component vector of float) +0:22 texture ( temp 4-component vector of float) +0:22 'g_sam2D' (layout( binding=2) uniform sampler2D) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:23 add second child into first child ( temp 4-component vector of float) +0:23 'ColorOut' ( temp 4-component vector of float) +0:23 texture ( temp 4-component vector of float) +0:23 'g_sam3D' (layout( binding=3) uniform sampler3D) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.400000 +0:24 add second child into first child ( temp 4-component vector of float) +0:24 'ColorOut' ( temp 4-component vector of float) +0:24 texture ( temp 4-component vector of float) +0:24 'g_samCube' (layout( binding=4) uniform samplerCube) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.400000 +0:26 add second child into first child ( temp 4-component vector of float) +0:26 'ColorOut' ( temp 4-component vector of float) +0:26 textureLod ( temp 4-component vector of float) +0:26 'g_sam' (layout( binding=0) uniform sampler2D) +0:26 Construct vec2 ( temp 2-component vector of float) +0:? Constant: +0:? 0.400000 +0:? 0.300000 +0:? 0.000000 +0:? 0.000000 +0:26 direct index ( temp float) +0:? Constant: +0:? 0.400000 +0:? 0.300000 +0:? 0.000000 +0:? 0.000000 +0:26 Constant: +0:26 3 (const int) +0:27 add second child into first child ( temp 4-component vector of float) +0:27 'ColorOut' ( temp 4-component vector of float) +0:27 textureLod ( temp 4-component vector of float) +0:27 'g_sam1D' (layout( binding=1) uniform sampler1D) +0:27 Construct float ( temp float) +0:? Constant: +0:? 0.500000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:27 direct index ( temp float) +0:? Constant: +0:? 0.500000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:27 Constant: +0:27 3 (const int) +0:28 add second child into first child ( temp 4-component vector of float) +0:28 'ColorOut' ( temp 4-component vector of float) +0:28 textureLod ( temp 4-component vector of float) +0:28 'g_sam2D' (layout( binding=2) uniform sampler2D) +0:28 Construct vec2 ( temp 2-component vector of float) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.000000 +0:? 0.000000 +0:28 direct index ( temp float) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.000000 +0:? 0.000000 +0:28 Constant: +0:28 3 (const int) +0:29 add second child into first child ( temp 4-component vector of float) +0:29 'ColorOut' ( temp 4-component vector of float) +0:29 textureLod ( temp 4-component vector of float) +0:29 'g_sam3D' (layout( binding=3) uniform sampler3D) +0:29 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.400000 +0:? 0.000000 +0:29 direct index ( temp float) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.400000 +0:? 0.000000 +0:29 Constant: +0:29 3 (const int) +0:30 add second child into first child ( temp 4-component vector of float) +0:30 'ColorOut' ( temp 4-component vector of float) +0:30 textureLod ( temp 4-component vector of float) +0:30 'g_samCube' (layout( binding=4) uniform samplerCube) +0:30 Construct vec3 ( temp 3-component vector of float) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.400000 +0:? 0.000000 +0:30 direct index ( temp float) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.400000 +0:? 0.000000 +0:30 Constant: +0:30 3 (const int) +0:32 move second child to first child ( temp 4-component vector of float) +0:32 Color: direct index for structure ( temp 4-component vector of float) +0:32 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:32 Constant: +0:32 0 (const int) +0:32 divide ( temp 4-component vector of float) +0:32 'ColorOut' ( temp 4-component vector of float) +0:32 Constant: +0:32 10.000000 +0:33 move second child to first child ( temp float) +0:33 Depth: direct index for structure ( temp float) +0:33 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 1.000000 +0:35 Branch: Return with expression +0:35 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:15 Function Definition: main( ( temp void) +0:15 Function Parameters: +0:? Sequence +0:15 Sequence +0:15 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:15 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:15 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) +0:15 Color: direct index for structure ( temp 4-component vector of float) +0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:15 Constant: +0:15 0 (const int) +0:15 move second child to first child ( temp float) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:15 Depth: direct index for structure ( temp float) +0:15 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) +0:15 Constant: +0:15 1 (const int) +0:? Linker Objects +0:? 'g_sam' (layout( binding=0) uniform sampler2D) +0:? 'g_sam1D' (layout( binding=1) uniform sampler1D) +0:? 'g_sam2D' (layout( binding=2) uniform sampler2D) +0:? 'g_sam3D' (layout( binding=3) uniform sampler3D) +0:? 'g_samCube' (layout( binding=4) uniform samplerCube) +0:? '@entryPointOutput.Depth' ( out float FragDepth) +0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 135 + + Capability Shader + Capability Sampled1D + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 5 "main" 128 132 + ExecutionMode 5 OriginUpperLeft + ExecutionMode 5 DepthReplacing + 1: String "" + Source HLSL 500 1 "// OpModuleProcessed auto-map-locations +// OpModuleProcessed auto-map-bindings +// OpModuleProcessed entry-point main +// OpModuleProcessed client vulkan100 +// OpModuleProcessed target-env vulkan1.0 +// OpModuleProcessed keep-uncalled +// OpModuleProcessed hlsl-offsets +#line 1 +" + Name 5 "main" + Name 9 "PS_OUTPUT" + MemberName 9(PS_OUTPUT) 0 "Color" + MemberName 9(PS_OUTPUT) 1 "Depth" + Name 11 "@main(" + Name 14 "ColorOut" + Name 20 "g_sam" + Name 32 "g_sam1D" + Name 38 "g_sam2D" + Name 48 "g_sam3D" + Name 58 "g_samCube" + Name 110 "psout" + Name 125 "flattenTemp" + Name 128 "@entryPointOutput.Color" + Name 132 "@entryPointOutput.Depth" + Decorate 20(g_sam) DescriptorSet 0 + Decorate 20(g_sam) Binding 0 + Decorate 32(g_sam1D) DescriptorSet 0 + Decorate 32(g_sam1D) Binding 1 + Decorate 38(g_sam2D) DescriptorSet 0 + Decorate 38(g_sam2D) Binding 2 + Decorate 48(g_sam3D) DescriptorSet 0 + Decorate 48(g_sam3D) Binding 3 + Decorate 58(g_samCube) DescriptorSet 0 + Decorate 58(g_samCube) Binding 4 + Decorate 128(@entryPointOutput.Color) Location 0 + Decorate 132(@entryPointOutput.Depth) BuiltIn FragDepth + 3: TypeVoid + 4: TypeFunction 3 + 7: TypeFloat 32 + 8: TypeVector 7(float) 4 + 9(PS_OUTPUT): TypeStruct 8(fvec4) 7(float) + 10: TypeFunction 9(PS_OUTPUT) + 13: TypePointer Function 8(fvec4) + 15: 7(float) Constant 0 + 16: 8(fvec4) ConstantComposite 15 15 15 15 + 17: TypeImage 7(float) 2D sampled format:Unknown + 18: TypeSampledImage 17 + 19: TypePointer UniformConstant 18 + 20(g_sam): 19(ptr) Variable UniformConstant + 22: TypeVector 7(float) 2 + 23: 7(float) Constant 1053609165 + 24: 7(float) Constant 1050253722 + 25: 22(fvec2) ConstantComposite 23 24 + 29: TypeImage 7(float) 1D sampled format:Unknown + 30: TypeSampledImage 29 + 31: TypePointer UniformConstant 30 + 32(g_sam1D): 31(ptr) Variable UniformConstant + 34: 7(float) Constant 1056964608 + 38(g_sam2D): 19(ptr) Variable UniformConstant + 40: 7(float) Constant 1058642330 + 41: 22(fvec2) ConstantComposite 34 40 + 45: TypeImage 7(float) 3D sampled format:Unknown + 46: TypeSampledImage 45 + 47: TypePointer UniformConstant 46 + 48(g_sam3D): 47(ptr) Variable UniformConstant + 50: TypeVector 7(float) 3 + 51: 50(fvec3) ConstantComposite 34 40 23 + 55: TypeImage 7(float) Cube sampled format:Unknown + 56: TypeSampledImage 55 + 57: TypePointer UniformConstant 56 + 58(g_samCube): 57(ptr) Variable UniformConstant + 64: 8(fvec4) ConstantComposite 23 24 15 15 + 68: TypeInt 32 0 + 69: 68(int) Constant 3 + 75: 8(fvec4) ConstantComposite 34 15 15 15 + 82: 8(fvec4) ConstantComposite 34 40 15 15 + 91: 8(fvec4) ConstantComposite 34 40 23 15 + 109: TypePointer Function 9(PS_OUTPUT) + 111: TypeInt 32 1 + 112: 111(int) Constant 0 + 114: 7(float) Constant 1092616192 + 118: 111(int) Constant 1 + 119: 7(float) Constant 1065353216 + 120: TypePointer Function 7(float) + 127: TypePointer Output 8(fvec4) +128(@entryPointOutput.Color): 127(ptr) Variable Output + 131: TypePointer Output 7(float) +132(@entryPointOutput.Depth): 131(ptr) Variable Output + 5(main): 3 Function None 4 + 6: Label +125(flattenTemp): 109(ptr) Variable Function + Line 1 15 0 + 126:9(PS_OUTPUT) FunctionCall 11(@main() + Store 125(flattenTemp) 126 + 129: 13(ptr) AccessChain 125(flattenTemp) 112 + 130: 8(fvec4) Load 129 + Store 128(@entryPointOutput.Color) 130 + 133: 120(ptr) AccessChain 125(flattenTemp) 118 + 134: 7(float) Load 133 + Store 132(@entryPointOutput.Depth) 134 + Return + FunctionEnd + 11(@main():9(PS_OUTPUT) Function None 10 + 12: Label + 14(ColorOut): 13(ptr) Variable Function + 110(psout): 109(ptr) Variable Function + Line 1 18 0 + Store 14(ColorOut) 16 + Line 1 20 0 + 21: 18 Load 20(g_sam) + 26: 8(fvec4) ImageSampleImplicitLod 21 25 + 27: 8(fvec4) Load 14(ColorOut) + 28: 8(fvec4) FAdd 27 26 + Store 14(ColorOut) 28 + Line 1 21 0 + 33: 30 Load 32(g_sam1D) + 35: 8(fvec4) ImageSampleImplicitLod 33 34 + 36: 8(fvec4) Load 14(ColorOut) + 37: 8(fvec4) FAdd 36 35 + Store 14(ColorOut) 37 + Line 1 22 0 + 39: 18 Load 38(g_sam2D) + 42: 8(fvec4) ImageSampleImplicitLod 39 41 + 43: 8(fvec4) Load 14(ColorOut) + 44: 8(fvec4) FAdd 43 42 + Store 14(ColorOut) 44 + Line 1 23 0 + 49: 46 Load 48(g_sam3D) + 52: 8(fvec4) ImageSampleImplicitLod 49 51 + 53: 8(fvec4) Load 14(ColorOut) + 54: 8(fvec4) FAdd 53 52 + Store 14(ColorOut) 54 + Line 1 24 0 + 59: 56 Load 58(g_samCube) + 60: 8(fvec4) ImageSampleImplicitLod 59 51 + 61: 8(fvec4) Load 14(ColorOut) + 62: 8(fvec4) FAdd 61 60 + Store 14(ColorOut) 62 + Line 1 26 0 + 63: 18 Load 20(g_sam) + 65: 7(float) CompositeExtract 64 0 + 66: 7(float) CompositeExtract 64 1 + 67: 22(fvec2) CompositeConstruct 65 66 + 70: 7(float) CompositeExtract 64 3 + 71: 8(fvec4) ImageSampleExplicitLod 63 67 Lod 70 + 72: 8(fvec4) Load 14(ColorOut) + 73: 8(fvec4) FAdd 72 71 + Store 14(ColorOut) 73 + Line 1 27 0 + 74: 30 Load 32(g_sam1D) + 76: 7(float) CompositeExtract 75 0 + 77: 7(float) CompositeExtract 75 3 + 78: 8(fvec4) ImageSampleExplicitLod 74 76 Lod 77 + 79: 8(fvec4) Load 14(ColorOut) + 80: 8(fvec4) FAdd 79 78 + Store 14(ColorOut) 80 + Line 1 28 0 + 81: 18 Load 38(g_sam2D) + 83: 7(float) CompositeExtract 82 0 + 84: 7(float) CompositeExtract 82 1 + 85: 22(fvec2) CompositeConstruct 83 84 + 86: 7(float) CompositeExtract 82 3 + 87: 8(fvec4) ImageSampleExplicitLod 81 85 Lod 86 + 88: 8(fvec4) Load 14(ColorOut) + 89: 8(fvec4) FAdd 88 87 + Store 14(ColorOut) 89 + Line 1 29 0 + 90: 46 Load 48(g_sam3D) + 92: 7(float) CompositeExtract 91 0 + 93: 7(float) CompositeExtract 91 1 + 94: 7(float) CompositeExtract 91 2 + 95: 50(fvec3) CompositeConstruct 92 93 94 + 96: 7(float) CompositeExtract 91 3 + 97: 8(fvec4) ImageSampleExplicitLod 90 95 Lod 96 + 98: 8(fvec4) Load 14(ColorOut) + 99: 8(fvec4) FAdd 98 97 + Store 14(ColorOut) 99 + Line 1 30 0 + 100: 56 Load 58(g_samCube) + 101: 7(float) CompositeExtract 91 0 + 102: 7(float) CompositeExtract 91 1 + 103: 7(float) CompositeExtract 91 2 + 104: 50(fvec3) CompositeConstruct 101 102 103 + 105: 7(float) CompositeExtract 91 3 + 106: 8(fvec4) ImageSampleExplicitLod 100 104 Lod 105 + 107: 8(fvec4) Load 14(ColorOut) + 108: 8(fvec4) FAdd 107 106 + Store 14(ColorOut) 108 + Line 1 32 0 + 113: 8(fvec4) Load 14(ColorOut) + 115: 8(fvec4) CompositeConstruct 114 114 114 114 + 116: 8(fvec4) FDiv 113 115 + 117: 13(ptr) AccessChain 110(psout) 112 + Store 117 116 + Line 1 33 0 + 121: 120(ptr) AccessChain 110(psout) 118 + Store 121 119 + Line 1 35 0 + 122:9(PS_OUTPUT) Load 110(psout) + ReturnValue 122 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.sample.dx9.vert.out b/deps/glslang/Test/baseResults/hlsl.sample.dx9.vert.out new file mode 100644 index 00000000..732b0439 --- /dev/null +++ b/deps/glslang/Test/baseResults/hlsl.sample.dx9.vert.out @@ -0,0 +1,261 @@ +hlsl.sample.dx9.vert +Shader version: 500 +0:? Sequence +0:11 Function Definition: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:11 Function Parameters: +0:? Sequence +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 'PosOut' ( temp 4-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:16 add second child into first child ( temp 4-component vector of float) +0:16 'PosOut' ( temp 4-component vector of float) +0:16 textureLod ( temp 4-component vector of float) +0:16 'g_sam' (layout( binding=0) uniform sampler2D) +0:16 Construct vec2 ( temp 2-component vector of float) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? 0.000000 +0:? 1.000000 +0:16 direct index ( temp float) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? 0.000000 +0:? 1.000000 +0:16 Constant: +0:16 3 (const int) +0:17 add second child into first child ( temp 4-component vector of float) +0:17 'PosOut' ( temp 4-component vector of float) +0:17 textureLod ( temp 4-component vector of float) +0:17 'g_sam2D' (layout( binding=1) uniform sampler2D) +0:17 Construct vec2 ( temp 2-component vector of float) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.000000 +0:? 1.000000 +0:17 direct index ( temp float) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.000000 +0:? 1.000000 +0:17 Constant: +0:17 3 (const int) +0:19 move second child to first child ( temp 4-component vector of float) +0:19 Pos: direct index for structure ( temp 4-component vector of float) +0:19 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:19 Constant: +0:19 0 (const int) +0:19 divide ( temp 4-component vector of float) +0:19 'PosOut' ( temp 4-component vector of float) +0:19 Constant: +0:19 2.000000 +0:21 Branch: Return with expression +0:21 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:11 Function Definition: main( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:11 Pos: direct index for structure ( temp 4-component vector of float) +0:11 Function Call: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:11 Constant: +0:11 0 (const int) +0:? Linker Objects +0:? 'g_sam' (layout( binding=0) uniform sampler2D) +0:? 'g_sam2D' (layout( binding=1) uniform sampler2D) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:11 Function Definition: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:11 Function Parameters: +0:? Sequence +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 'PosOut' ( temp 4-component vector of float) +0:? Constant: +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:16 add second child into first child ( temp 4-component vector of float) +0:16 'PosOut' ( temp 4-component vector of float) +0:16 textureLod ( temp 4-component vector of float) +0:16 'g_sam' (layout( binding=0) uniform sampler2D) +0:16 Construct vec2 ( temp 2-component vector of float) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? 0.000000 +0:? 1.000000 +0:16 direct index ( temp float) +0:? Constant: +0:? 0.300000 +0:? 0.400000 +0:? 0.000000 +0:? 1.000000 +0:16 Constant: +0:16 3 (const int) +0:17 add second child into first child ( temp 4-component vector of float) +0:17 'PosOut' ( temp 4-component vector of float) +0:17 textureLod ( temp 4-component vector of float) +0:17 'g_sam2D' (layout( binding=1) uniform sampler2D) +0:17 Construct vec2 ( temp 2-component vector of float) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.000000 +0:? 1.000000 +0:17 direct index ( temp float) +0:? Constant: +0:? 0.500000 +0:? 0.600000 +0:? 0.000000 +0:? 1.000000 +0:17 Constant: +0:17 3 (const int) +0:19 move second child to first child ( temp 4-component vector of float) +0:19 Pos: direct index for structure ( temp 4-component vector of float) +0:19 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:19 Constant: +0:19 0 (const int) +0:19 divide ( temp 4-component vector of float) +0:19 'PosOut' ( temp 4-component vector of float) +0:19 Constant: +0:19 2.000000 +0:21 Branch: Return with expression +0:21 'vsout' ( temp structure{ temp 4-component vector of float Pos}) +0:11 Function Definition: main( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) +0:11 Pos: direct index for structure ( temp 4-component vector of float) +0:11 Function Call: @main( ( temp structure{ temp 4-component vector of float Pos}) +0:11 Constant: +0:11 0 (const int) +0:? Linker Objects +0:? 'g_sam' (layout( binding=0) uniform sampler2D) +0:? 'g_sam2D' (layout( binding=1) uniform sampler2D) +0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position) + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 64 + + Capability Shader + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 5 "main" 61 + 1: String "" + Source HLSL 500 1 "// OpModuleProcessed auto-map-locations +// OpModuleProcessed auto-map-bindings +// OpModuleProcessed entry-point main +// OpModuleProcessed client vulkan100 +// OpModuleProcessed target-env vulkan1.0 +// OpModuleProcessed keep-uncalled +// OpModuleProcessed hlsl-offsets +#line 1 +" + Name 5 "main" + Name 9 "VS_OUTPUT" + MemberName 9(VS_OUTPUT) 0 "Pos" + Name 11 "@main(" + Name 14 "PosOut" + Name 20 "g_sam" + Name 36 "g_sam2D" + Name 49 "vsout" + Name 61 "@entryPointOutput.Pos" + Decorate 20(g_sam) DescriptorSet 0 + Decorate 20(g_sam) Binding 0 + Decorate 36(g_sam2D) DescriptorSet 0 + Decorate 36(g_sam2D) Binding 1 + Decorate 61(@entryPointOutput.Pos) BuiltIn Position + 3: TypeVoid + 4: TypeFunction 3 + 7: TypeFloat 32 + 8: TypeVector 7(float) 4 + 9(VS_OUTPUT): TypeStruct 8(fvec4) + 10: TypeFunction 9(VS_OUTPUT) + 13: TypePointer Function 8(fvec4) + 15: 7(float) Constant 0 + 16: 8(fvec4) ConstantComposite 15 15 15 15 + 17: TypeImage 7(float) 2D sampled format:Unknown + 18: TypeSampledImage 17 + 19: TypePointer UniformConstant 18 + 20(g_sam): 19(ptr) Variable UniformConstant + 22: 7(float) Constant 1050253722 + 23: 7(float) Constant 1053609165 + 24: 7(float) Constant 1065353216 + 25: 8(fvec4) ConstantComposite 22 23 15 24 + 26: TypeVector 7(float) 2 + 30: TypeInt 32 0 + 31: 30(int) Constant 3 + 36(g_sam2D): 19(ptr) Variable UniformConstant + 38: 7(float) Constant 1056964608 + 39: 7(float) Constant 1058642330 + 40: 8(fvec4) ConstantComposite 38 39 15 24 + 48: TypePointer Function 9(VS_OUTPUT) + 50: TypeInt 32 1 + 51: 50(int) Constant 0 + 53: 7(float) Constant 1073741824 + 60: TypePointer Output 8(fvec4) +61(@entryPointOutput.Pos): 60(ptr) Variable Output + 5(main): 3 Function None 4 + 6: Label + Line 1 11 0 + 62:9(VS_OUTPUT) FunctionCall 11(@main() + 63: 8(fvec4) CompositeExtract 62 0 + Store 61(@entryPointOutput.Pos) 63 + Return + FunctionEnd + 11(@main():9(VS_OUTPUT) Function None 10 + 12: Label + 14(PosOut): 13(ptr) Variable Function + 49(vsout): 48(ptr) Variable Function + Line 1 14 0 + Store 14(PosOut) 16 + Line 1 16 0 + 21: 18 Load 20(g_sam) + 27: 7(float) CompositeExtract 25 0 + 28: 7(float) CompositeExtract 25 1 + 29: 26(fvec2) CompositeConstruct 27 28 + 32: 7(float) CompositeExtract 25 3 + 33: 8(fvec4) ImageSampleExplicitLod 21 29 Lod 32 + 34: 8(fvec4) Load 14(PosOut) + 35: 8(fvec4) FAdd 34 33 + Store 14(PosOut) 35 + Line 1 17 0 + 37: 18 Load 36(g_sam2D) + 41: 7(float) CompositeExtract 40 0 + 42: 7(float) CompositeExtract 40 1 + 43: 26(fvec2) CompositeConstruct 41 42 + 44: 7(float) CompositeExtract 40 3 + 45: 8(fvec4) ImageSampleExplicitLod 37 43 Lod 44 + 46: 8(fvec4) Load 14(PosOut) + 47: 8(fvec4) FAdd 46 45 + Store 14(PosOut) 47 + Line 1 19 0 + 52: 8(fvec4) Load 14(PosOut) + 54: 8(fvec4) CompositeConstruct 53 53 53 53 + 55: 8(fvec4) FDiv 52 54 + 56: 13(ptr) AccessChain 49(vsout) 51 + Store 56 55 + Line 1 21 0 + 57:9(VS_OUTPUT) Load 49(vsout) + ReturnValue 57 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/hlsl.sample.offset.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.sample.offset.dx10.frag.out index bd199a39..5eadb4a6 100644 --- a/deps/glslang/Test/baseResults/hlsl.sample.offset.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.sample.offset.dx10.frag.out @@ -412,20 +412,31 @@ using depth_any Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 33(g_tTex1di4) DescriptorSet 0 + Decorate 33(g_tTex1di4) Binding 0 Decorate 46(g_tTex1du4) DescriptorSet 0 + Decorate 46(g_tTex1du4) Binding 0 Decorate 56(g_tTex2df4) DescriptorSet 0 + Decorate 56(g_tTex2df4) Binding 0 Decorate 70(g_tTex2di4) DescriptorSet 0 + Decorate 70(g_tTex2di4) Binding 0 Decorate 82(g_tTex2du4) DescriptorSet 0 + Decorate 82(g_tTex2du4) Binding 0 Decorate 96(g_tTex3df4) DescriptorSet 0 + Decorate 96(g_tTex3df4) Binding 0 Decorate 109(g_tTex3di4) DescriptorSet 0 + Decorate 109(g_tTex3di4) Binding 0 Decorate 120(g_tTex3du4) DescriptorSet 0 + Decorate 120(g_tTex3du4) Binding 0 Decorate 144(@entryPointOutput.Color) Location 0 Decorate 148(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 151(g_tTex1df4a) DescriptorSet 0 Decorate 151(g_tTex1df4a) Binding 1 Decorate 154(g_tTexcdf4) DescriptorSet 0 + Decorate 154(g_tTexcdf4) Binding 0 Decorate 157(g_tTexcdi4) DescriptorSet 0 + Decorate 157(g_tTexcdi4) Binding 0 Decorate 160(g_tTexcdu4) DescriptorSet 0 + Decorate 160(g_tTexcdu4) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.sample.offsetarray.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.sample.offsetarray.dx10.frag.out index 065cef05..edc5d314 100644 --- a/deps/glslang/Test/baseResults/hlsl.sample.offsetarray.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.sample.offsetarray.dx10.frag.out @@ -313,10 +313,15 @@ using depth_any Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 36(g_tTex1di4) DescriptorSet 0 + Decorate 36(g_tTex1di4) Binding 0 Decorate 51(g_tTex1du4) DescriptorSet 0 + Decorate 51(g_tTex1du4) Binding 0 Decorate 63(g_tTex2df4) DescriptorSet 0 + Decorate 63(g_tTex2df4) Binding 0 Decorate 76(g_tTex2di4) DescriptorSet 0 + Decorate 76(g_tTex2di4) Binding 0 Decorate 87(g_tTex2du4) DescriptorSet 0 + Decorate 87(g_tTex2du4) Binding 0 Decorate 110(@entryPointOutput.Color) Location 0 Decorate 114(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 117(g_tTex1df4a) DescriptorSet 0 diff --git a/deps/glslang/Test/baseResults/hlsl.sample.sub-vec4.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.sample.sub-vec4.dx10.frag.out index f24415a9..cc44567a 100644 --- a/deps/glslang/Test/baseResults/hlsl.sample.sub-vec4.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.sample.sub-vec4.dx10.frag.out @@ -180,11 +180,15 @@ gl_FragCoord origin is upper left Name 59 "psout" Name 69 "@entryPointOutput.Color" Decorate 16(g_tTex1df1) DescriptorSet 0 + Decorate 16(g_tTex1df1) Binding 0 Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 30(g_tTex1df2) DescriptorSet 0 + Decorate 30(g_tTex1df2) Binding 0 Decorate 42(g_tTex1df3) DescriptorSet 0 + Decorate 42(g_tTex1df3) Binding 0 Decorate 53(g_tTex1df4) DescriptorSet 0 + Decorate 53(g_tTex1df4) Binding 0 Decorate 69(@entryPointOutput.Color) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.samplebias.array.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplebias.array.dx10.frag.out index a6fc0a5a..c229502d 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplebias.array.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.samplebias.array.dx10.frag.out @@ -404,13 +404,21 @@ using depth_any Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 36(g_tTex1di4) DescriptorSet 0 + Decorate 36(g_tTex1di4) Binding 0 Decorate 50(g_tTex1du4) DescriptorSet 0 + Decorate 50(g_tTex1du4) Binding 0 Decorate 61(g_tTex2df4) DescriptorSet 0 + Decorate 61(g_tTex2df4) Binding 0 Decorate 72(g_tTex2di4) DescriptorSet 0 + Decorate 72(g_tTex2di4) Binding 0 Decorate 82(g_tTex2du4) DescriptorSet 0 + Decorate 82(g_tTex2du4) Binding 0 Decorate 94(g_tTexcdf4) DescriptorSet 0 + Decorate 94(g_tTexcdf4) Binding 0 Decorate 104(g_tTexcdi4) DescriptorSet 0 + Decorate 104(g_tTexcdi4) Binding 0 Decorate 114(g_tTexcdu4) DescriptorSet 0 + Decorate 114(g_tTexcdu4) Binding 0 Decorate 138(@entryPointOutput.Color) Location 0 Decorate 142(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 145(g_tTex1df4a) DescriptorSet 0 diff --git a/deps/glslang/Test/baseResults/hlsl.samplebias.basic.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplebias.basic.dx10.frag.out index 21794f9f..c840fa4e 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplebias.basic.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.samplebias.basic.dx10.frag.out @@ -475,16 +475,27 @@ using depth_any Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 33(g_tTex1di4) DescriptorSet 0 + Decorate 33(g_tTex1di4) Binding 0 Decorate 46(g_tTex1du4) DescriptorSet 0 + Decorate 46(g_tTex1du4) Binding 0 Decorate 56(g_tTex2df4) DescriptorSet 0 + Decorate 56(g_tTex2df4) Binding 0 Decorate 67(g_tTex2di4) DescriptorSet 0 + Decorate 67(g_tTex2di4) Binding 0 Decorate 78(g_tTex2du4) DescriptorSet 0 + Decorate 78(g_tTex2du4) Binding 0 Decorate 89(g_tTex3df4) DescriptorSet 0 + Decorate 89(g_tTex3df4) Binding 0 Decorate 100(g_tTex3di4) DescriptorSet 0 + Decorate 100(g_tTex3di4) Binding 0 Decorate 110(g_tTex3du4) DescriptorSet 0 + Decorate 110(g_tTex3du4) Binding 0 Decorate 123(g_tTexcdf4) DescriptorSet 0 + Decorate 123(g_tTexcdf4) Binding 0 Decorate 132(g_tTexcdi4) DescriptorSet 0 + Decorate 132(g_tTexcdi4) Binding 0 Decorate 141(g_tTexcdu4) DescriptorSet 0 + Decorate 141(g_tTexcdu4) Binding 0 Decorate 162(@entryPointOutput.Color) Location 0 Decorate 166(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 169(g_tTex1df4a) DescriptorSet 0 diff --git a/deps/glslang/Test/baseResults/hlsl.samplebias.offset.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplebias.offset.dx10.frag.out index ae492e4d..be4b4f82 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplebias.offset.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.samplebias.offset.dx10.frag.out @@ -399,10 +399,7 @@ using depth_any 0:? '@entryPointOutput.Depth' ( out float FragDepth) 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: Expected Image Operand Bias to be float scalar - %28 = OpImageSampleImplicitLod %v4float %23 %float_0_100000001 Bias|ConstOffset %int_1 %float_0_5 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 161 @@ -452,20 +449,31 @@ error: Expected Image Operand Bias to be float scalar Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 34(g_tTex1di4) DescriptorSet 0 + Decorate 34(g_tTex1di4) Binding 0 Decorate 47(g_tTex1du4) DescriptorSet 0 + Decorate 47(g_tTex1du4) Binding 0 Decorate 57(g_tTex2df4) DescriptorSet 0 + Decorate 57(g_tTex2df4) Binding 0 Decorate 71(g_tTex2di4) DescriptorSet 0 + Decorate 71(g_tTex2di4) Binding 0 Decorate 83(g_tTex2du4) DescriptorSet 0 + Decorate 83(g_tTex2du4) Binding 0 Decorate 96(g_tTex3df4) DescriptorSet 0 + Decorate 96(g_tTex3df4) Binding 0 Decorate 109(g_tTex3di4) DescriptorSet 0 + Decorate 109(g_tTex3di4) Binding 0 Decorate 120(g_tTex3du4) DescriptorSet 0 + Decorate 120(g_tTex3du4) Binding 0 Decorate 144(@entryPointOutput.Color) Location 0 Decorate 148(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 151(g_tTex1df4a) DescriptorSet 0 Decorate 151(g_tTex1df4a) Binding 1 Decorate 154(g_tTexcdf4) DescriptorSet 0 + Decorate 154(g_tTexcdf4) Binding 0 Decorate 157(g_tTexcdi4) DescriptorSet 0 + Decorate 157(g_tTexcdi4) Binding 0 Decorate 160(g_tTexcdu4) DescriptorSet 0 + Decorate 160(g_tTexcdu4) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out index 0cea7670..ae33f407 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out @@ -297,10 +297,7 @@ using depth_any 0:? '@entryPointOutput.Depth' ( out float FragDepth) 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: Expected Image Operand Bias to be float scalar - %31 = OpImageSampleImplicitLod %v4float %23 %27 Bias|ConstOffset %int_0 %float_0_5 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 118 @@ -341,10 +338,15 @@ error: Expected Image Operand Bias to be float scalar Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 37(g_tTex1di4) DescriptorSet 0 + Decorate 37(g_tTex1di4) Binding 0 Decorate 52(g_tTex1du4) DescriptorSet 0 + Decorate 52(g_tTex1du4) Binding 0 Decorate 64(g_tTex2df4) DescriptorSet 0 + Decorate 64(g_tTex2df4) Binding 0 Decorate 77(g_tTex2di4) DescriptorSet 0 + Decorate 77(g_tTex2di4) Binding 0 Decorate 87(g_tTex2du4) DescriptorSet 0 + Decorate 87(g_tTex2du4) Binding 0 Decorate 110(@entryPointOutput.Color) Location 0 Decorate 114(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 117(g_tTex1df4a) DescriptorSet 0 diff --git a/deps/glslang/Test/baseResults/hlsl.samplecmp.array.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplecmp.array.dx10.frag.out index a41481da..54cbc047 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplecmp.array.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.samplecmp.array.dx10.frag.out @@ -397,10 +397,7 @@ using depth_any 0:? '@entryPointOutput.Depth' ( out float FragDepth) 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: Expected Image 'Sampled Type' to be the same as Result Type - %48 = OpImageSampleDrefImplicitLod %float %43 %46 %47 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 209 @@ -455,31 +452,51 @@ error: Expected Image 'Sampled Type' to be the same as Result Type Name 205 "g_tTexcdi4" Name 208 "g_tTexcdu4" Decorate 16(g_tTex1df4a) DescriptorSet 0 + Decorate 16(g_tTex1df4a) Binding 0 Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 39(g_tTex1di4a) DescriptorSet 0 + Decorate 39(g_tTex1di4a) Binding 0 Decorate 53(g_tTex1du4a) DescriptorSet 0 + Decorate 53(g_tTex1du4a) Binding 0 Decorate 66(g_tTex2df4a) DescriptorSet 0 + Decorate 66(g_tTex2df4a) Binding 0 Decorate 82(g_tTex2di4a) DescriptorSet 0 + Decorate 82(g_tTex2di4a) Binding 0 Decorate 96(g_tTex2du4a) DescriptorSet 0 + Decorate 96(g_tTex2du4a) Binding 0 Decorate 110(g_tTexcdf4a) DescriptorSet 0 + Decorate 110(g_tTexcdf4a) Binding 0 Decorate 126(g_tTexcdi4a) DescriptorSet 0 + Decorate 126(g_tTexcdi4a) Binding 0 Decorate 140(g_tTexcdu4a) DescriptorSet 0 + Decorate 140(g_tTexcdu4a) Binding 0 Decorate 166(@entryPointOutput.Color) Location 0 Decorate 170(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 175(g_tTex1df4) DescriptorSet 0 Decorate 175(g_tTex1df4) Binding 0 Decorate 178(g_tTex1di4) DescriptorSet 0 + Decorate 178(g_tTex1di4) Binding 0 Decorate 181(g_tTex1du4) DescriptorSet 0 + Decorate 181(g_tTex1du4) Binding 0 Decorate 184(g_tTex2df4) DescriptorSet 0 + Decorate 184(g_tTex2df4) Binding 0 Decorate 187(g_tTex2di4) DescriptorSet 0 + Decorate 187(g_tTex2di4) Binding 0 Decorate 190(g_tTex2du4) DescriptorSet 0 + Decorate 190(g_tTex2du4) Binding 0 Decorate 193(g_tTex3df4) DescriptorSet 0 + Decorate 193(g_tTex3df4) Binding 0 Decorate 196(g_tTex3di4) DescriptorSet 0 + Decorate 196(g_tTex3di4) Binding 0 Decorate 199(g_tTex3du4) DescriptorSet 0 + Decorate 199(g_tTex3du4) Binding 0 Decorate 202(g_tTexcdf4) DescriptorSet 0 + Decorate 202(g_tTexcdf4) Binding 0 Decorate 205(g_tTexcdi4) DescriptorSet 0 + Decorate 205(g_tTexcdi4) Binding 0 Decorate 208(g_tTexcdu4) DescriptorSet 0 + Decorate 208(g_tTexcdu4) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.samplecmp.basic.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplecmp.basic.dx10.frag.out index e8252d38..90e11731 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplecmp.basic.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.samplecmp.basic.dx10.frag.out @@ -379,10 +379,7 @@ using depth_any 0:? '@entryPointOutput.Depth' ( out float FragDepth) 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: Expected Image 'Sampled Type' to be the same as Result Type - %41 = OpImageSampleDrefImplicitLod %float %38 %39 %40 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 198 @@ -441,27 +438,47 @@ error: Expected Image 'Sampled Type' to be the same as Result Type Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 34(g_tTex1di4) DescriptorSet 0 + Decorate 34(g_tTex1di4) Binding 0 Decorate 46(g_tTex1du4) DescriptorSet 0 + Decorate 46(g_tTex1du4) Binding 0 Decorate 57(g_tTex2df4) DescriptorSet 0 + Decorate 57(g_tTex2df4) Binding 0 Decorate 73(g_tTex2di4) DescriptorSet 0 + Decorate 73(g_tTex2di4) Binding 0 Decorate 86(g_tTex2du4) DescriptorSet 0 + Decorate 86(g_tTex2du4) Binding 0 Decorate 99(g_tTexcdf4) DescriptorSet 0 + Decorate 99(g_tTexcdf4) Binding 0 Decorate 115(g_tTexcdi4) DescriptorSet 0 + Decorate 115(g_tTexcdi4) Binding 0 Decorate 129(g_tTexcdu4) DescriptorSet 0 + Decorate 129(g_tTexcdu4) Binding 0 Decorate 155(@entryPointOutput.Color) Location 0 Decorate 159(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 164(g_tTex3df4) DescriptorSet 0 + Decorate 164(g_tTex3df4) Binding 0 Decorate 167(g_tTex3di4) DescriptorSet 0 + Decorate 167(g_tTex3di4) Binding 0 Decorate 170(g_tTex3du4) DescriptorSet 0 + Decorate 170(g_tTex3du4) Binding 0 Decorate 173(g_tTex1df4a) DescriptorSet 0 + Decorate 173(g_tTex1df4a) Binding 0 Decorate 176(g_tTex1di4a) DescriptorSet 0 + Decorate 176(g_tTex1di4a) Binding 0 Decorate 179(g_tTex1du4a) DescriptorSet 0 + Decorate 179(g_tTex1du4a) Binding 0 Decorate 182(g_tTex2df4a) DescriptorSet 0 + Decorate 182(g_tTex2df4a) Binding 0 Decorate 185(g_tTex2di4a) DescriptorSet 0 + Decorate 185(g_tTex2di4a) Binding 0 Decorate 188(g_tTex2du4a) DescriptorSet 0 + Decorate 188(g_tTex2du4a) Binding 0 Decorate 191(g_tTexcdf4a) DescriptorSet 0 + Decorate 191(g_tTexcdf4a) Binding 0 Decorate 194(g_tTexcdi4a) DescriptorSet 0 + Decorate 194(g_tTexcdi4a) Binding 0 Decorate 197(g_tTexcdu4a) DescriptorSet 0 + Decorate 197(g_tTexcdu4a) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.samplecmp.offset.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplecmp.offset.dx10.frag.out index cb4ce390..29d02dab 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplecmp.offset.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.samplecmp.offset.dx10.frag.out @@ -325,10 +325,7 @@ using depth_any 0:? '@entryPointOutput.Depth' ( out float FragDepth) 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: Expected Image 'Sampled Type' to be the same as Result Type - %42 = OpImageSampleDrefImplicitLod %float %39 %40 %41 ConstOffset %int_2 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 167 @@ -384,27 +381,47 @@ error: Expected Image 'Sampled Type' to be the same as Result Type Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 35(g_tTex1di4) DescriptorSet 0 + Decorate 35(g_tTex1di4) Binding 0 Decorate 47(g_tTex1du4) DescriptorSet 0 + Decorate 47(g_tTex1du4) Binding 0 Decorate 58(g_tTex2df4) DescriptorSet 0 + Decorate 58(g_tTex2df4) Binding 0 Decorate 77(g_tTex2di4) DescriptorSet 0 + Decorate 77(g_tTex2di4) Binding 0 Decorate 90(g_tTex2du4) DescriptorSet 0 + Decorate 90(g_tTex2du4) Binding 0 Decorate 115(@entryPointOutput.Color) Location 0 Decorate 119(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 124(g_tTex3df4) DescriptorSet 0 + Decorate 124(g_tTex3df4) Binding 0 Decorate 127(g_tTex3di4) DescriptorSet 0 + Decorate 127(g_tTex3di4) Binding 0 Decorate 130(g_tTex3du4) DescriptorSet 0 + Decorate 130(g_tTex3du4) Binding 0 Decorate 133(g_tTexcdf4) DescriptorSet 0 + Decorate 133(g_tTexcdf4) Binding 0 Decorate 136(g_tTexcdi4) DescriptorSet 0 + Decorate 136(g_tTexcdi4) Binding 0 Decorate 139(g_tTexcdu4) DescriptorSet 0 + Decorate 139(g_tTexcdu4) Binding 0 Decorate 142(g_tTex1df4a) DescriptorSet 0 + Decorate 142(g_tTex1df4a) Binding 0 Decorate 145(g_tTex1di4a) DescriptorSet 0 + Decorate 145(g_tTex1di4a) Binding 0 Decorate 148(g_tTex1du4a) DescriptorSet 0 + Decorate 148(g_tTex1du4a) Binding 0 Decorate 151(g_tTex2df4a) DescriptorSet 0 + Decorate 151(g_tTex2df4a) Binding 0 Decorate 154(g_tTex2di4a) DescriptorSet 0 + Decorate 154(g_tTex2di4a) Binding 0 Decorate 157(g_tTex2du4a) DescriptorSet 0 + Decorate 157(g_tTex2du4a) Binding 0 Decorate 160(g_tTexcdf4a) DescriptorSet 0 + Decorate 160(g_tTexcdf4a) Binding 0 Decorate 163(g_tTexcdi4a) DescriptorSet 0 + Decorate 163(g_tTexcdi4a) Binding 0 Decorate 166(g_tTexcdu4a) DescriptorSet 0 + Decorate 166(g_tTexcdu4a) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.samplecmp.offsetarray.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplecmp.offsetarray.dx10.frag.out index af2af3f2..bf7b6f02 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplecmp.offsetarray.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.samplecmp.offsetarray.dx10.frag.out @@ -337,10 +337,7 @@ using depth_any 0:? '@entryPointOutput.Depth' ( out float FragDepth) 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: Expected Image 'Sampled Type' to be the same as Result Type - %49 = OpImageSampleDrefImplicitLod %float %44 %47 %48 ConstOffset %int_2 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 178 @@ -392,31 +389,51 @@ error: Expected Image 'Sampled Type' to be the same as Result Type Name 174 "g_tTexcdi4a" Name 177 "g_tTexcdu4a" Decorate 16(g_tTex1df4a) DescriptorSet 0 + Decorate 16(g_tTex1df4a) Binding 0 Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 40(g_tTex1di4a) DescriptorSet 0 + Decorate 40(g_tTex1di4a) Binding 0 Decorate 54(g_tTex1du4a) DescriptorSet 0 + Decorate 54(g_tTex1du4a) Binding 0 Decorate 67(g_tTex2df4a) DescriptorSet 0 + Decorate 67(g_tTex2df4a) Binding 0 Decorate 86(g_tTex2di4a) DescriptorSet 0 + Decorate 86(g_tTex2di4a) Binding 0 Decorate 100(g_tTex2du4a) DescriptorSet 0 + Decorate 100(g_tTex2du4a) Binding 0 Decorate 126(@entryPointOutput.Color) Location 0 Decorate 130(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 135(g_tTex1df4) DescriptorSet 0 Decorate 135(g_tTex1df4) Binding 0 Decorate 138(g_tTex1di4) DescriptorSet 0 + Decorate 138(g_tTex1di4) Binding 0 Decorate 141(g_tTex1du4) DescriptorSet 0 + Decorate 141(g_tTex1du4) Binding 0 Decorate 144(g_tTex2df4) DescriptorSet 0 + Decorate 144(g_tTex2df4) Binding 0 Decorate 147(g_tTex2di4) DescriptorSet 0 + Decorate 147(g_tTex2di4) Binding 0 Decorate 150(g_tTex2du4) DescriptorSet 0 + Decorate 150(g_tTex2du4) Binding 0 Decorate 153(g_tTex3df4) DescriptorSet 0 + Decorate 153(g_tTex3df4) Binding 0 Decorate 156(g_tTex3di4) DescriptorSet 0 + Decorate 156(g_tTex3di4) Binding 0 Decorate 159(g_tTex3du4) DescriptorSet 0 + Decorate 159(g_tTex3du4) Binding 0 Decorate 162(g_tTexcdf4) DescriptorSet 0 + Decorate 162(g_tTexcdf4) Binding 0 Decorate 165(g_tTexcdi4) DescriptorSet 0 + Decorate 165(g_tTexcdi4) Binding 0 Decorate 168(g_tTexcdu4) DescriptorSet 0 + Decorate 168(g_tTexcdu4) Binding 0 Decorate 171(g_tTexcdf4a) DescriptorSet 0 + Decorate 171(g_tTexcdf4a) Binding 0 Decorate 174(g_tTexcdi4a) DescriptorSet 0 + Decorate 174(g_tTexcdi4a) Binding 0 Decorate 177(g_tTexcdu4a) DescriptorSet 0 + Decorate 177(g_tTexcdu4a) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.array.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.array.dx10.frag.out index a0e5a487..5b21f702 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.array.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.array.dx10.frag.out @@ -433,10 +433,7 @@ using depth_any 0:? '@entryPointOutput.Depth' ( out float FragDepth) 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: Expected Image 'Sampled Type' to be the same as Result Type - %49 = OpImageSampleDrefExplicitLod %float %44 %47 %48 Lod %float_0 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 210 @@ -491,31 +488,51 @@ error: Expected Image 'Sampled Type' to be the same as Result Type Name 206 "g_tTexcdi4" Name 209 "g_tTexcdu4" Decorate 16(g_tTex1df4a) DescriptorSet 0 + Decorate 16(g_tTex1df4a) Binding 0 Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 40(g_tTex1di4a) DescriptorSet 0 + Decorate 40(g_tTex1di4a) Binding 0 Decorate 54(g_tTex1du4a) DescriptorSet 0 + Decorate 54(g_tTex1du4a) Binding 0 Decorate 67(g_tTex2df4a) DescriptorSet 0 + Decorate 67(g_tTex2df4a) Binding 0 Decorate 83(g_tTex2di4a) DescriptorSet 0 + Decorate 83(g_tTex2di4a) Binding 0 Decorate 97(g_tTex2du4a) DescriptorSet 0 + Decorate 97(g_tTex2du4a) Binding 0 Decorate 111(g_tTexcdf4a) DescriptorSet 0 + Decorate 111(g_tTexcdf4a) Binding 0 Decorate 127(g_tTexcdi4a) DescriptorSet 0 + Decorate 127(g_tTexcdi4a) Binding 0 Decorate 141(g_tTexcdu4a) DescriptorSet 0 + Decorate 141(g_tTexcdu4a) Binding 0 Decorate 167(@entryPointOutput.Color) Location 0 Decorate 171(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 176(g_tTex1df4) DescriptorSet 0 Decorate 176(g_tTex1df4) Binding 0 Decorate 179(g_tTex1di4) DescriptorSet 0 + Decorate 179(g_tTex1di4) Binding 0 Decorate 182(g_tTex1du4) DescriptorSet 0 + Decorate 182(g_tTex1du4) Binding 0 Decorate 185(g_tTex2df4) DescriptorSet 0 + Decorate 185(g_tTex2df4) Binding 0 Decorate 188(g_tTex2di4) DescriptorSet 0 + Decorate 188(g_tTex2di4) Binding 0 Decorate 191(g_tTex2du4) DescriptorSet 0 + Decorate 191(g_tTex2du4) Binding 0 Decorate 194(g_tTex3df4) DescriptorSet 0 + Decorate 194(g_tTex3df4) Binding 0 Decorate 197(g_tTex3di4) DescriptorSet 0 + Decorate 197(g_tTex3di4) Binding 0 Decorate 200(g_tTex3du4) DescriptorSet 0 + Decorate 200(g_tTex3du4) Binding 0 Decorate 203(g_tTexcdf4) DescriptorSet 0 + Decorate 203(g_tTexcdf4) Binding 0 Decorate 206(g_tTexcdi4) DescriptorSet 0 + Decorate 206(g_tTexcdi4) Binding 0 Decorate 209(g_tTexcdu4) DescriptorSet 0 + Decorate 209(g_tTexcdu4) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.basic.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.basic.dx10.frag.out index ffe22988..fae6899e 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.basic.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.basic.dx10.frag.out @@ -415,10 +415,7 @@ using depth_any 0:? '@entryPointOutput.Depth' ( out float FragDepth) 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: Expected Image 'Sampled Type' to be the same as Result Type - %42 = OpImageSampleDrefExplicitLod %float %39 %40 %41 Lod %float_0 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 199 @@ -477,27 +474,47 @@ error: Expected Image 'Sampled Type' to be the same as Result Type Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 35(g_tTex1di4) DescriptorSet 0 + Decorate 35(g_tTex1di4) Binding 0 Decorate 47(g_tTex1du4) DescriptorSet 0 + Decorate 47(g_tTex1du4) Binding 0 Decorate 58(g_tTex2df4) DescriptorSet 0 + Decorate 58(g_tTex2df4) Binding 0 Decorate 74(g_tTex2di4) DescriptorSet 0 + Decorate 74(g_tTex2di4) Binding 0 Decorate 87(g_tTex2du4) DescriptorSet 0 + Decorate 87(g_tTex2du4) Binding 0 Decorate 100(g_tTexcdf4) DescriptorSet 0 + Decorate 100(g_tTexcdf4) Binding 0 Decorate 116(g_tTexcdi4) DescriptorSet 0 + Decorate 116(g_tTexcdi4) Binding 0 Decorate 130(g_tTexcdu4) DescriptorSet 0 + Decorate 130(g_tTexcdu4) Binding 0 Decorate 156(@entryPointOutput.Color) Location 0 Decorate 160(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 165(g_tTex3df4) DescriptorSet 0 + Decorate 165(g_tTex3df4) Binding 0 Decorate 168(g_tTex3di4) DescriptorSet 0 + Decorate 168(g_tTex3di4) Binding 0 Decorate 171(g_tTex3du4) DescriptorSet 0 + Decorate 171(g_tTex3du4) Binding 0 Decorate 174(g_tTex1df4a) DescriptorSet 0 + Decorate 174(g_tTex1df4a) Binding 0 Decorate 177(g_tTex1di4a) DescriptorSet 0 + Decorate 177(g_tTex1di4a) Binding 0 Decorate 180(g_tTex1du4a) DescriptorSet 0 + Decorate 180(g_tTex1du4a) Binding 0 Decorate 183(g_tTex2df4a) DescriptorSet 0 + Decorate 183(g_tTex2df4a) Binding 0 Decorate 186(g_tTex2di4a) DescriptorSet 0 + Decorate 186(g_tTex2di4a) Binding 0 Decorate 189(g_tTex2du4a) DescriptorSet 0 + Decorate 189(g_tTex2du4a) Binding 0 Decorate 192(g_tTexcdf4a) DescriptorSet 0 + Decorate 192(g_tTexcdf4a) Binding 0 Decorate 195(g_tTexcdi4a) DescriptorSet 0 + Decorate 195(g_tTexcdi4a) Binding 0 Decorate 198(g_tTexcdu4a) DescriptorSet 0 + Decorate 198(g_tTexcdu4a) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.offset.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.offset.dx10.frag.out index 08e8749f..0987ea83 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.offset.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.offset.dx10.frag.out @@ -349,10 +349,7 @@ using depth_any 0:? '@entryPointOutput.Depth' ( out float FragDepth) 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: Expected Image 'Sampled Type' to be the same as Result Type - %43 = OpImageSampleDrefExplicitLod %float %40 %41 %42 Lod|ConstOffset %float_0 %int_2 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 168 @@ -408,27 +405,47 @@ error: Expected Image 'Sampled Type' to be the same as Result Type Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 36(g_tTex1di4) DescriptorSet 0 + Decorate 36(g_tTex1di4) Binding 0 Decorate 48(g_tTex1du4) DescriptorSet 0 + Decorate 48(g_tTex1du4) Binding 0 Decorate 59(g_tTex2df4) DescriptorSet 0 + Decorate 59(g_tTex2df4) Binding 0 Decorate 78(g_tTex2di4) DescriptorSet 0 + Decorate 78(g_tTex2di4) Binding 0 Decorate 91(g_tTex2du4) DescriptorSet 0 + Decorate 91(g_tTex2du4) Binding 0 Decorate 116(@entryPointOutput.Color) Location 0 Decorate 120(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 125(g_tTex3df4) DescriptorSet 0 + Decorate 125(g_tTex3df4) Binding 0 Decorate 128(g_tTex3di4) DescriptorSet 0 + Decorate 128(g_tTex3di4) Binding 0 Decorate 131(g_tTex3du4) DescriptorSet 0 + Decorate 131(g_tTex3du4) Binding 0 Decorate 134(g_tTexcdf4) DescriptorSet 0 + Decorate 134(g_tTexcdf4) Binding 0 Decorate 137(g_tTexcdi4) DescriptorSet 0 + Decorate 137(g_tTexcdi4) Binding 0 Decorate 140(g_tTexcdu4) DescriptorSet 0 + Decorate 140(g_tTexcdu4) Binding 0 Decorate 143(g_tTex1df4a) DescriptorSet 0 + Decorate 143(g_tTex1df4a) Binding 0 Decorate 146(g_tTex1di4a) DescriptorSet 0 + Decorate 146(g_tTex1di4a) Binding 0 Decorate 149(g_tTex1du4a) DescriptorSet 0 + Decorate 149(g_tTex1du4a) Binding 0 Decorate 152(g_tTex2df4a) DescriptorSet 0 + Decorate 152(g_tTex2df4a) Binding 0 Decorate 155(g_tTex2di4a) DescriptorSet 0 + Decorate 155(g_tTex2di4a) Binding 0 Decorate 158(g_tTex2du4a) DescriptorSet 0 + Decorate 158(g_tTex2du4a) Binding 0 Decorate 161(g_tTexcdf4a) DescriptorSet 0 + Decorate 161(g_tTexcdf4a) Binding 0 Decorate 164(g_tTexcdi4a) DescriptorSet 0 + Decorate 164(g_tTexcdi4a) Binding 0 Decorate 167(g_tTexcdu4a) DescriptorSet 0 + Decorate 167(g_tTexcdu4a) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.offsetarray.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.offsetarray.dx10.frag.out index b5c0fc0d..74345146 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.offsetarray.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.samplecmplevelzero.offsetarray.dx10.frag.out @@ -361,10 +361,7 @@ using depth_any 0:? '@entryPointOutput.Depth' ( out float FragDepth) 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: Expected Image 'Sampled Type' to be the same as Result Type - %50 = OpImageSampleDrefExplicitLod %float %45 %48 %49 Lod|ConstOffset %float_0 %int_2 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 179 @@ -416,31 +413,51 @@ error: Expected Image 'Sampled Type' to be the same as Result Type Name 175 "g_tTexcdi4a" Name 178 "g_tTexcdu4a" Decorate 16(g_tTex1df4a) DescriptorSet 0 + Decorate 16(g_tTex1df4a) Binding 0 Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 41(g_tTex1di4a) DescriptorSet 0 + Decorate 41(g_tTex1di4a) Binding 0 Decorate 55(g_tTex1du4a) DescriptorSet 0 + Decorate 55(g_tTex1du4a) Binding 0 Decorate 68(g_tTex2df4a) DescriptorSet 0 + Decorate 68(g_tTex2df4a) Binding 0 Decorate 87(g_tTex2di4a) DescriptorSet 0 + Decorate 87(g_tTex2di4a) Binding 0 Decorate 101(g_tTex2du4a) DescriptorSet 0 + Decorate 101(g_tTex2du4a) Binding 0 Decorate 127(@entryPointOutput.Color) Location 0 Decorate 131(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 136(g_tTex1df4) DescriptorSet 0 Decorate 136(g_tTex1df4) Binding 0 Decorate 139(g_tTex1di4) DescriptorSet 0 + Decorate 139(g_tTex1di4) Binding 0 Decorate 142(g_tTex1du4) DescriptorSet 0 + Decorate 142(g_tTex1du4) Binding 0 Decorate 145(g_tTex2df4) DescriptorSet 0 + Decorate 145(g_tTex2df4) Binding 0 Decorate 148(g_tTex2di4) DescriptorSet 0 + Decorate 148(g_tTex2di4) Binding 0 Decorate 151(g_tTex2du4) DescriptorSet 0 + Decorate 151(g_tTex2du4) Binding 0 Decorate 154(g_tTex3df4) DescriptorSet 0 + Decorate 154(g_tTex3df4) Binding 0 Decorate 157(g_tTex3di4) DescriptorSet 0 + Decorate 157(g_tTex3di4) Binding 0 Decorate 160(g_tTex3du4) DescriptorSet 0 + Decorate 160(g_tTex3du4) Binding 0 Decorate 163(g_tTexcdf4) DescriptorSet 0 + Decorate 163(g_tTexcdf4) Binding 0 Decorate 166(g_tTexcdi4) DescriptorSet 0 + Decorate 166(g_tTexcdi4) Binding 0 Decorate 169(g_tTexcdu4) DescriptorSet 0 + Decorate 169(g_tTexcdu4) Binding 0 Decorate 172(g_tTexcdf4a) DescriptorSet 0 + Decorate 172(g_tTexcdf4a) Binding 0 Decorate 175(g_tTexcdi4a) DescriptorSet 0 + Decorate 175(g_tTexcdi4a) Binding 0 Decorate 178(g_tTexcdu4a) DescriptorSet 0 + Decorate 178(g_tTexcdu4a) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.samplegrad.array.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplegrad.array.dx10.frag.out index 81a92a23..67b5692d 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplegrad.array.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.samplegrad.array.dx10.frag.out @@ -476,13 +476,21 @@ using depth_any Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 37(g_tTex1di4) DescriptorSet 0 + Decorate 37(g_tTex1di4) Binding 0 Decorate 49(g_tTex1du4) DescriptorSet 0 + Decorate 49(g_tTex1du4) Binding 0 Decorate 58(g_tTex2df4) DescriptorSet 0 + Decorate 58(g_tTex2df4) Binding 0 Decorate 71(g_tTex2di4) DescriptorSet 0 + Decorate 71(g_tTex2di4) Binding 0 Decorate 80(g_tTex2du4) DescriptorSet 0 + Decorate 80(g_tTex2du4) Binding 0 Decorate 89(g_tTexcdf4) DescriptorSet 0 + Decorate 89(g_tTexcdf4) Binding 0 Decorate 102(g_tTexcdi4) DescriptorSet 0 + Decorate 102(g_tTexcdi4) Binding 0 Decorate 111(g_tTexcdu4) DescriptorSet 0 + Decorate 111(g_tTexcdu4) Binding 0 Decorate 132(@entryPointOutput.Color) Location 0 Decorate 136(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 139(g_tTex1df4a) DescriptorSet 0 diff --git a/deps/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.frag.out index 3acd9afe..7edb8dad 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.frag.out @@ -583,16 +583,27 @@ using depth_any Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 34(g_tTex1di4) DescriptorSet 0 + Decorate 34(g_tTex1di4) Binding 0 Decorate 47(g_tTex1du4) DescriptorSet 0 + Decorate 47(g_tTex1du4) Binding 0 Decorate 57(g_tTex2df4) DescriptorSet 0 + Decorate 57(g_tTex2df4) Binding 0 Decorate 69(g_tTex2di4) DescriptorSet 0 + Decorate 69(g_tTex2di4) Binding 0 Decorate 80(g_tTex2du4) DescriptorSet 0 + Decorate 80(g_tTex2du4) Binding 0 Decorate 92(g_tTex3df4) DescriptorSet 0 + Decorate 92(g_tTex3df4) Binding 0 Decorate 105(g_tTex3di4) DescriptorSet 0 + Decorate 105(g_tTex3di4) Binding 0 Decorate 115(g_tTex3du4) DescriptorSet 0 + Decorate 115(g_tTex3du4) Binding 0 Decorate 128(g_tTexcdf4) DescriptorSet 0 + Decorate 128(g_tTexcdf4) Binding 0 Decorate 137(g_tTexcdi4) DescriptorSet 0 + Decorate 137(g_tTexcdi4) Binding 0 Decorate 146(g_tTexcdu4) DescriptorSet 0 + Decorate 146(g_tTexcdu4) Binding 0 Decorate 167(@entryPointOutput.Color) Location 0 Decorate 171(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 174(g_tTex1df4a) DescriptorSet 0 diff --git a/deps/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out b/deps/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out index d787939b..979d48f5 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out @@ -540,16 +540,27 @@ Shader version: 500 Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 34(g_tTex1di4) DescriptorSet 0 + Decorate 34(g_tTex1di4) Binding 0 Decorate 47(g_tTex1du4) DescriptorSet 0 + Decorate 47(g_tTex1du4) Binding 0 Decorate 57(g_tTex2df4) DescriptorSet 0 + Decorate 57(g_tTex2df4) Binding 0 Decorate 69(g_tTex2di4) DescriptorSet 0 + Decorate 69(g_tTex2di4) Binding 0 Decorate 80(g_tTex2du4) DescriptorSet 0 + Decorate 80(g_tTex2du4) Binding 0 Decorate 92(g_tTex3df4) DescriptorSet 0 + Decorate 92(g_tTex3df4) Binding 0 Decorate 105(g_tTex3di4) DescriptorSet 0 + Decorate 105(g_tTex3di4) Binding 0 Decorate 115(g_tTex3du4) DescriptorSet 0 + Decorate 115(g_tTex3du4) Binding 0 Decorate 128(g_tTexcdf4) DescriptorSet 0 + Decorate 128(g_tTexcdf4) Binding 0 Decorate 137(g_tTexcdi4) DescriptorSet 0 + Decorate 137(g_tTexcdi4) Binding 0 Decorate 146(g_tTexcdu4) DescriptorSet 0 + Decorate 146(g_tTexcdu4) Binding 0 Decorate 162(@entryPointOutput.Pos) BuiltIn Position Decorate 165(g_tTex1df4a) DescriptorSet 0 Decorate 165(g_tTex1df4a) Binding 1 diff --git a/deps/glslang/Test/baseResults/hlsl.samplegrad.offset.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplegrad.offset.dx10.frag.out index b5a85493..2620a67c 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplegrad.offset.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.samplegrad.offset.dx10.frag.out @@ -520,20 +520,31 @@ using depth_any Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 35(g_tTex1di4) DescriptorSet 0 + Decorate 35(g_tTex1di4) Binding 0 Decorate 48(g_tTex1du4) DescriptorSet 0 + Decorate 48(g_tTex1du4) Binding 0 Decorate 58(g_tTex2df4) DescriptorSet 0 + Decorate 58(g_tTex2df4) Binding 0 Decorate 73(g_tTex2di4) DescriptorSet 0 + Decorate 73(g_tTex2di4) Binding 0 Decorate 85(g_tTex2du4) DescriptorSet 0 + Decorate 85(g_tTex2du4) Binding 0 Decorate 99(g_tTex3df4) DescriptorSet 0 + Decorate 99(g_tTex3df4) Binding 0 Decorate 114(g_tTex3di4) DescriptorSet 0 + Decorate 114(g_tTex3di4) Binding 0 Decorate 125(g_tTex3du4) DescriptorSet 0 + Decorate 125(g_tTex3du4) Binding 0 Decorate 149(@entryPointOutput.Color) Location 0 Decorate 153(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 156(g_tTex1df4a) DescriptorSet 0 Decorate 156(g_tTex1df4a) Binding 1 Decorate 159(g_tTexcdf4) DescriptorSet 0 + Decorate 159(g_tTexcdf4) Binding 0 Decorate 162(g_tTexcdi4) DescriptorSet 0 + Decorate 162(g_tTexcdi4) Binding 0 Decorate 165(g_tTexcdu4) DescriptorSet 0 + Decorate 165(g_tTexcdu4) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.samplegrad.offsetarray.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplegrad.offsetarray.dx10.frag.out index 39a28389..87ad78be 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplegrad.offsetarray.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.samplegrad.offsetarray.dx10.frag.out @@ -383,17 +383,25 @@ using depth_any Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 38(g_tTex1di4) DescriptorSet 0 + Decorate 38(g_tTex1di4) Binding 0 Decorate 50(g_tTex1du4) DescriptorSet 0 + Decorate 50(g_tTex1du4) Binding 0 Decorate 59(g_tTex2df4) DescriptorSet 0 + Decorate 59(g_tTex2df4) Binding 0 Decorate 75(g_tTex2di4) DescriptorSet 0 + Decorate 75(g_tTex2di4) Binding 0 Decorate 84(g_tTex2du4) DescriptorSet 0 + Decorate 84(g_tTex2du4) Binding 0 Decorate 103(@entryPointOutput.Color) Location 0 Decorate 107(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 110(g_tTex1df4a) DescriptorSet 0 Decorate 110(g_tTex1df4a) Binding 1 Decorate 113(g_tTexcdf4) DescriptorSet 0 + Decorate 113(g_tTexcdf4) Binding 0 Decorate 116(g_tTexcdi4) DescriptorSet 0 + Decorate 116(g_tTexcdi4) Binding 0 Decorate 119(g_tTexcdu4) DescriptorSet 0 + Decorate 119(g_tTexcdu4) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.samplelevel.array.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplelevel.array.dx10.frag.out index 0151cdd3..4f079507 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplelevel.array.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.samplelevel.array.dx10.frag.out @@ -404,13 +404,21 @@ using depth_any Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 36(g_tTex1di4a) DescriptorSet 0 + Decorate 36(g_tTex1di4a) Binding 0 Decorate 50(g_tTex1du4a) DescriptorSet 0 + Decorate 50(g_tTex1du4a) Binding 0 Decorate 61(g_tTex2df4a) DescriptorSet 0 + Decorate 61(g_tTex2df4a) Binding 0 Decorate 72(g_tTex2di4a) DescriptorSet 0 + Decorate 72(g_tTex2di4a) Binding 0 Decorate 83(g_tTex2du4a) DescriptorSet 0 + Decorate 83(g_tTex2du4a) Binding 0 Decorate 95(g_tTexcdf4a) DescriptorSet 0 + Decorate 95(g_tTexcdf4a) Binding 0 Decorate 105(g_tTexcdi4a) DescriptorSet 0 + Decorate 105(g_tTexcdi4a) Binding 0 Decorate 115(g_tTexcdu4a) DescriptorSet 0 + Decorate 115(g_tTexcdu4a) Binding 0 Decorate 139(@entryPointOutput.Color) Location 0 Decorate 143(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 146(g_tTex1df4) DescriptorSet 0 diff --git a/deps/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.frag.out index 9327b844..ee982cc2 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.frag.out @@ -478,19 +478,31 @@ using depth_any Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 33(g_tTex1di4) DescriptorSet 0 + Decorate 33(g_tTex1di4) Binding 0 Decorate 46(g_tTex1du4) DescriptorSet 0 + Decorate 46(g_tTex1du4) Binding 0 Decorate 56(g_tTex2df4) DescriptorSet 0 + Decorate 56(g_tTex2df4) Binding 0 Decorate 67(g_tTex2di4) DescriptorSet 0 + Decorate 67(g_tTex2di4) Binding 0 Decorate 78(g_tTex2du4) DescriptorSet 0 + Decorate 78(g_tTex2du4) Binding 0 Decorate 90(g_tTex3df4) DescriptorSet 0 + Decorate 90(g_tTex3df4) Binding 0 Decorate 101(g_tTex3di4) DescriptorSet 0 + Decorate 101(g_tTex3di4) Binding 0 Decorate 111(g_tTex3du4) DescriptorSet 0 + Decorate 111(g_tTex3du4) Binding 0 Decorate 124(g_tTexcdf4) DescriptorSet 0 + Decorate 124(g_tTexcdf4) Binding 0 Decorate 133(g_tTexcdi4) DescriptorSet 0 + Decorate 133(g_tTexcdi4) Binding 0 Decorate 142(g_tTexcdu4) DescriptorSet 0 + Decorate 142(g_tTexcdu4) Binding 0 Decorate 163(@entryPointOutput.Color) Location 0 Decorate 167(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 170(g_sSamp2d) DescriptorSet 0 + Decorate 170(g_sSamp2d) Binding 0 Decorate 171(g_tTex1df4a) DescriptorSet 0 Decorate 171(g_tTex1df4a) Binding 1 2: TypeVoid diff --git a/deps/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out b/deps/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out index d2bd1b87..0a8ae49a 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out @@ -432,16 +432,27 @@ Shader version: 500 Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 33(g_tTex1di4) DescriptorSet 0 + Decorate 33(g_tTex1di4) Binding 0 Decorate 46(g_tTex1du4) DescriptorSet 0 + Decorate 46(g_tTex1du4) Binding 0 Decorate 56(g_tTex2df4) DescriptorSet 0 + Decorate 56(g_tTex2df4) Binding 0 Decorate 67(g_tTex2di4) DescriptorSet 0 + Decorate 67(g_tTex2di4) Binding 0 Decorate 78(g_tTex2du4) DescriptorSet 0 + Decorate 78(g_tTex2du4) Binding 0 Decorate 90(g_tTex3df4) DescriptorSet 0 + Decorate 90(g_tTex3df4) Binding 0 Decorate 101(g_tTex3di4) DescriptorSet 0 + Decorate 101(g_tTex3di4) Binding 0 Decorate 111(g_tTex3du4) DescriptorSet 0 + Decorate 111(g_tTex3du4) Binding 0 Decorate 124(g_tTexcdf4) DescriptorSet 0 + Decorate 124(g_tTexcdf4) Binding 0 Decorate 133(g_tTexcdi4) DescriptorSet 0 + Decorate 133(g_tTexcdi4) Binding 0 Decorate 142(g_tTexcdu4) DescriptorSet 0 + Decorate 142(g_tTexcdu4) Binding 0 Decorate 158(@entryPointOutput.Pos) BuiltIn Position Decorate 161(g_tTex1df4a) DescriptorSet 0 Decorate 161(g_tTex1df4a) Binding 1 diff --git a/deps/glslang/Test/baseResults/hlsl.samplelevel.offset.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplelevel.offset.dx10.frag.out index 36c932c8..b007ee10 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplelevel.offset.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.samplelevel.offset.dx10.frag.out @@ -448,20 +448,31 @@ using depth_any Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 34(g_tTex1di4) DescriptorSet 0 + Decorate 34(g_tTex1di4) Binding 0 Decorate 47(g_tTex1du4) DescriptorSet 0 + Decorate 47(g_tTex1du4) Binding 0 Decorate 57(g_tTex2df4) DescriptorSet 0 + Decorate 57(g_tTex2df4) Binding 0 Decorate 71(g_tTex2di4) DescriptorSet 0 + Decorate 71(g_tTex2di4) Binding 0 Decorate 83(g_tTex2du4) DescriptorSet 0 + Decorate 83(g_tTex2du4) Binding 0 Decorate 97(g_tTex3df4) DescriptorSet 0 + Decorate 97(g_tTex3df4) Binding 0 Decorate 110(g_tTex3di4) DescriptorSet 0 + Decorate 110(g_tTex3di4) Binding 0 Decorate 121(g_tTex3du4) DescriptorSet 0 + Decorate 121(g_tTex3du4) Binding 0 Decorate 145(@entryPointOutput.Color) Location 0 Decorate 149(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 152(g_tTex1df4a) DescriptorSet 0 Decorate 152(g_tTex1df4a) Binding 1 Decorate 155(g_tTexcdf4) DescriptorSet 0 + Decorate 155(g_tTexcdf4) Binding 0 Decorate 158(g_tTexcdi4) DescriptorSet 0 + Decorate 158(g_tTexcdi4) Binding 0 Decorate 161(g_tTexcdu4) DescriptorSet 0 + Decorate 161(g_tTexcdu4) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.samplelevel.offsetarray.dx10.frag.out b/deps/glslang/Test/baseResults/hlsl.samplelevel.offsetarray.dx10.frag.out index bc6fd6b4..302bc81e 100644 --- a/deps/glslang/Test/baseResults/hlsl.samplelevel.offsetarray.dx10.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.samplelevel.offsetarray.dx10.frag.out @@ -337,10 +337,15 @@ using depth_any Decorate 20(g_sSamp) DescriptorSet 0 Decorate 20(g_sSamp) Binding 0 Decorate 37(g_tTex1di4) DescriptorSet 0 + Decorate 37(g_tTex1di4) Binding 0 Decorate 52(g_tTex1du4) DescriptorSet 0 + Decorate 52(g_tTex1du4) Binding 0 Decorate 64(g_tTex2df4) DescriptorSet 0 + Decorate 64(g_tTex2df4) Binding 0 Decorate 77(g_tTex2di4) DescriptorSet 0 + Decorate 77(g_tTex2di4) Binding 0 Decorate 88(g_tTex2du4) DescriptorSet 0 + Decorate 88(g_tTex2du4) Binding 0 Decorate 111(@entryPointOutput.Color) Location 0 Decorate 115(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 118(g_tTex1df4a) DescriptorSet 0 diff --git a/deps/glslang/Test/baseResults/hlsl.semantic.geom.out b/deps/glslang/Test/baseResults/hlsl.semantic.geom.out index e73940bc..773c8aa3 100644 --- a/deps/glslang/Test/baseResults/hlsl.semantic.geom.out +++ b/deps/glslang/Test/baseResults/hlsl.semantic.geom.out @@ -155,10 +155,7 @@ output primitive = line_strip 0:? 'OutputStream.clip0' ( out 1-element array of float ClipDistance) 0:? 'OutputStream.cull0' ( out 1-element array of float CullDistance) -error: SPIRV-Tools Validation Errors -error: According to the Vulkan spec BuiltIn Position variable needs to be a 4-component 32-bit float vector. ID <20> (OpVariable) is not a float vector. - OpStore %OutputStream_clip0 %25 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 65 diff --git a/deps/glslang/Test/baseResults/hlsl.snorm.uav.comp.out b/deps/glslang/Test/baseResults/hlsl.snorm.uav.comp.out index 2d6dae7c..4c5e6039 100644 --- a/deps/glslang/Test/baseResults/hlsl.snorm.uav.comp.out +++ b/deps/glslang/Test/baseResults/hlsl.snorm.uav.comp.out @@ -141,6 +141,7 @@ local_size = (16, 16, 1) MemberDecorate 25($Global) 0 Offset 0 Decorate 25($Global) Block Decorate 27 DescriptorSet 0 + Decorate 27 Binding 0 Decorate 34(ResultOutS) DescriptorSet 0 Decorate 34(ResultOutS) Binding 1 Decorate 39(ResultInU) DescriptorSet 0 diff --git a/deps/glslang/Test/baseResults/hlsl.store.rwbyteaddressbuffer.type.comp.out b/deps/glslang/Test/baseResults/hlsl.store.rwbyteaddressbuffer.type.comp.out index 6436db7c..29a14c48 100644 --- a/deps/glslang/Test/baseResults/hlsl.store.rwbyteaddressbuffer.type.comp.out +++ b/deps/glslang/Test/baseResults/hlsl.store.rwbyteaddressbuffer.type.comp.out @@ -119,6 +119,7 @@ local_size = (64, 1, 1) MemberDecorate 28(buffer) 0 Offset 0 Decorate 28(buffer) BufferBlock Decorate 30(buffer) DescriptorSet 0 + Decorate 30(buffer) Binding 0 Decorate 37(dispatchThreadID) BuiltIn GlobalInvocationId 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.stringtoken.frag.out b/deps/glslang/Test/baseResults/hlsl.stringtoken.frag.out index 82033cf3..15263c58 100644 --- a/deps/glslang/Test/baseResults/hlsl.stringtoken.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.stringtoken.frag.out @@ -91,9 +91,11 @@ gl_FragCoord origin is upper left Name 33 "" Decorate 25(@entryPointOutput.Color) Location 0 Decorate 30(TestTexture) DescriptorSet 0 + Decorate 30(TestTexture) Binding 0 MemberDecorate 31($Global) 0 Offset 0 Decorate 31($Global) Block Decorate 33 DescriptorSet 0 + Decorate 33 Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.struct.frag.out b/deps/glslang/Test/baseResults/hlsl.struct.frag.out index 4ea7bbbd..192041fa 100644 --- a/deps/glslang/Test/baseResults/hlsl.struct.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.struct.frag.out @@ -211,10 +211,7 @@ gl_FragCoord origin is upper left 0:? 's.ff3' (layout( location=6) flat in bool) 0:? 's.ff4' (layout( location=7) in 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: If OpTypeBool is stored in conjunction with OpVariable, it can only be used with non-externally visible shader Storage Classes: Workgroup, CrossWorkgroup, Private, and Function - %s_b = OpVariable %_ptr_Input_bool Input - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 102 @@ -299,6 +296,7 @@ error: If OpTypeBool is stored in conjunction with OpVariable, it can only be us MemberDecorate 99($Global) 2 Offset 1636 Decorate 99($Global) Block Decorate 101 DescriptorSet 0 + Decorate 101 Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.struct.split.assign.frag.out b/deps/glslang/Test/baseResults/hlsl.struct.split.assign.frag.out index 0598ac9c..24c88795 100644 --- a/deps/glslang/Test/baseResults/hlsl.struct.split.assign.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.struct.split.assign.frag.out @@ -207,10 +207,7 @@ gl_FragCoord origin is upper left 0:? 'input[1].f' (layout( location=2) in float) 0:? 'input[2].f' (layout( location=3) in float) -error: SPIRV-Tools Validation Errors -error: According to the Vulkan spec BuiltIn FragCoord variable needs to be a 4-component 32-bit float vector. ID <41> (OpVariable) is not a float vector. - %input_pos = OpVariable %_ptr_Input__arr_v4float_uint_3 Input - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 66 diff --git a/deps/glslang/Test/baseResults/hlsl.structIoFourWay.frag.out b/deps/glslang/Test/baseResults/hlsl.structIoFourWay.frag.out index f60c80b4..32ac68f3 100644 --- a/deps/glslang/Test/baseResults/hlsl.structIoFourWay.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.structIoFourWay.frag.out @@ -220,9 +220,11 @@ using depth_greater MemberDecorate 59($Global) 0 Offset 0 Decorate 59($Global) Block Decorate 61 DescriptorSet 0 + Decorate 61 Binding 0 MemberDecorate 62(buff) 0 Offset 96 Decorate 62(buff) Block Decorate 64 DescriptorSet 0 + Decorate 64 Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.structarray.flatten.frag.out b/deps/glslang/Test/baseResults/hlsl.structarray.flatten.frag.out index 0756a528..5d34aece 100644 --- a/deps/glslang/Test/baseResults/hlsl.structarray.flatten.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.structarray.flatten.frag.out @@ -155,11 +155,7 @@ gl_FragCoord origin is upper left 0:? 'g_texdata_array2[2].nonopaque_thing' ( uniform int) 0:? 'ps_output.color' (layout( location=0) out 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: From Vulkan spec, section 14.5.2: -Variables identified with the UniformConstant storage class are used only as handles to refer to opaque resources. Such variables must be typed as OpTypeImage, OpTypeSampler, OpTypeSampledImage, OpTypeAccelerationStructureNV, or an array of one of these types. - %g_texdata_nonopaque_thing = OpVariable %_ptr_UniformConstant_int UniformConstant - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 80 @@ -203,22 +199,38 @@ Variables identified with the UniformConstant storage class are used only as han Name 78 "g_texdata_array2[2].tex" Name 79 "g_texdata_array2[2].nonopaque_thing" Decorate 18(g_texdata.tex) DescriptorSet 0 + Decorate 18(g_texdata.tex) Binding 0 Decorate 22(g_texdata.samp) DescriptorSet 0 + Decorate 22(g_texdata.samp) Binding 0 Decorate 28(g_texdata_array[1].tex) DescriptorSet 0 + Decorate 28(g_texdata_array[1].tex) Binding 0 Decorate 30(g_texdata_array[1].samp) DescriptorSet 0 + Decorate 30(g_texdata_array[1].samp) Binding 0 Decorate 40(g_texdata_array2[1].tex) DescriptorSet 0 + Decorate 40(g_texdata_array2[1].tex) Binding 0 Decorate 45(g_texdata_array2[1].samp) DescriptorSet 0 + Decorate 45(g_texdata_array2[1].samp) Binding 0 Decorate 59(ps_output.color) Location 0 Decorate 62(g_samp) DescriptorSet 0 + Decorate 62(g_samp) Binding 0 Decorate 63(g_tex) DescriptorSet 0 + Decorate 63(g_tex) Binding 0 Decorate 66(g_texdata_array[0].samp) DescriptorSet 0 + Decorate 66(g_texdata_array[0].samp) Binding 0 Decorate 67(g_texdata_array[0].tex) DescriptorSet 0 + Decorate 67(g_texdata_array[0].tex) Binding 0 Decorate 70(g_texdata_array[2].samp) DescriptorSet 0 + Decorate 70(g_texdata_array[2].samp) Binding 0 Decorate 71(g_texdata_array[2].tex) DescriptorSet 0 + Decorate 71(g_texdata_array[2].tex) Binding 0 Decorate 73(g_texdata_array2[0].samp) DescriptorSet 0 + Decorate 73(g_texdata_array2[0].samp) Binding 0 Decorate 74(g_texdata_array2[0].tex) DescriptorSet 0 + Decorate 74(g_texdata_array2[0].tex) Binding 0 Decorate 77(g_texdata_array2[2].samp) DescriptorSet 0 + Decorate 77(g_texdata_array2[2].samp) Binding 0 Decorate 78(g_texdata_array2[2].tex) DescriptorSet 0 + Decorate 78(g_texdata_array2[2].tex) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.append.fn.frag.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.append.fn.frag.out index df086556..36050fb3 100644 --- a/deps/glslang/Test/baseResults/hlsl.structbuffer.append.fn.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.append.fn.frag.out @@ -149,10 +149,7 @@ gl_FragCoord origin is upper left 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) -error: SPIRV-Tools Validation Errors -error: Structure id 12 decorated as BufferBlock must be explicitly laid out with Offset decorations. - %__0 = OpTypeStruct %uint - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 70 @@ -193,17 +190,24 @@ error: Structure id 12 decorated as BufferBlock must be explicitly laid out with Decorate 9 BufferBlock Decorate 12 BufferBlock Decorate 49(sbuf_a) DescriptorSet 0 + Decorate 49(sbuf_a) Binding 0 Decorate 50(sbuf_a@count) DescriptorSet 0 + Decorate 50(sbuf_a@count) Binding 0 Decorate 51(sbuf_c) DescriptorSet 0 + Decorate 51(sbuf_c) Binding 0 Decorate 52(sbuf_c@count) DescriptorSet 0 + Decorate 52(sbuf_c@count) Binding 0 Decorate 58(pos) Flat Decorate 58(pos) Location 0 Decorate 61(@entryPointOutput) Location 0 MemberDecorate 65(sbuf_a@count) 0 Offset 0 Decorate 65(sbuf_a@count) BufferBlock Decorate 67(sbuf_a@count) DescriptorSet 0 + Decorate 67(sbuf_a@count) Binding 0 Decorate 68(sbuf_c@count) DescriptorSet 0 + Decorate 68(sbuf_c@count) Binding 0 Decorate 69(sbuf_unused) DescriptorSet 0 + Decorate 69(sbuf_unused) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.append.frag.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.append.frag.out index dff47f88..2e5c5641 100644 --- a/deps/glslang/Test/baseResults/hlsl.structbuffer.append.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.append.frag.out @@ -153,15 +153,20 @@ gl_FragCoord origin is upper left MemberDecorate 15(sbuf_a) 0 Offset 0 Decorate 15(sbuf_a) BufferBlock Decorate 17(sbuf_a) DescriptorSet 0 + Decorate 17(sbuf_a) Binding 0 MemberDecorate 20(sbuf_a@count) 0 Offset 0 Decorate 20(sbuf_a@count) BufferBlock Decorate 22(sbuf_a@count) DescriptorSet 0 + Decorate 22(sbuf_a@count) Binding 0 Decorate 35(sbuf_c) DescriptorSet 0 + Decorate 35(sbuf_c) Binding 0 Decorate 36(sbuf_c@count) DescriptorSet 0 + Decorate 36(sbuf_c@count) Binding 0 Decorate 48(pos) Flat Decorate 48(pos) Location 0 Decorate 51(@entryPointOutput) Location 0 Decorate 55(sbuf_unused) DescriptorSet 0 + Decorate 55(sbuf_unused) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.atomics.frag.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.atomics.frag.out index 68d93c18..e242cf6f 100644 --- a/deps/glslang/Test/baseResults/hlsl.structbuffer.atomics.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.atomics.frag.out @@ -473,10 +473,7 @@ gl_FragCoord origin is upper left 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) -error: SPIRV-Tools Validation Errors -error: AtomicIAdd: expected Value to be of type Result Type - %28 = OpAtomicIAdd %uint %24 %uint_1 %uint_0 %int_1 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 87 @@ -502,6 +499,7 @@ error: AtomicIAdd: expected Value to be of type Result Type MemberDecorate 15(sbuf) 0 Offset 0 Decorate 15(sbuf) BufferBlock Decorate 17(sbuf) DescriptorSet 0 + Decorate 17(sbuf) Binding 0 Decorate 80(pos) Flat Decorate 80(pos) Location 0 Decorate 83(@entryPointOutput) Location 0 diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.byte.frag.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.byte.frag.out index 49958a65..26c7a060 100644 --- a/deps/glslang/Test/baseResults/hlsl.structbuffer.byte.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.byte.frag.out @@ -323,10 +323,6 @@ gl_FragCoord origin is upper left 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) -error: SPIRV-Tools Validation Errors -error: OpStore Pointer '14[size]'s type does not match Object '20's type. - OpStore %size %20 - // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 114 @@ -356,6 +352,7 @@ error: OpStore Pointer '14[size]'s type does not match Object '20's ty MemberDecorate 16(sbuf) 0 Offset 0 Decorate 16(sbuf) BufferBlock Decorate 18(sbuf) DescriptorSet 0 + Decorate 18(sbuf) Binding 0 Decorate 107(pos) Flat Decorate 107(pos) Location 0 Decorate 110(@entryPointOutput) Location 0 @@ -370,13 +367,13 @@ error: OpStore Pointer '14[size]'s type does not match Object '20's ty 16(sbuf): TypeStruct 15 17: TypePointer Uniform 16(sbuf) 18(sbuf): 17(ptr) Variable Uniform - 19: TypeInt 32 1 - 21: 19(int) Constant 0 - 23: 19(int) Constant 2 + 20: TypeInt 32 1 + 21: 20(int) Constant 0 + 23: 20(int) Constant 2 25: TypePointer Uniform 6(int) - 29: TypePointer Function 19(int) + 29: TypePointer Function 20(int) 32: 6(int) Constant 4 - 39: 19(int) Constant 1 + 39: 20(int) Constant 1 43: TypeVector 6(int) 2 45: TypeVector 8(float) 2 47: 8(float) Constant 0 @@ -384,7 +381,7 @@ error: OpStore Pointer '14[size]'s type does not match Object '20's ty 69: TypeVector 6(int) 3 71: TypeVector 8(float) 3 80: 6(int) Constant 12 - 95: 19(int) Constant 3 + 95: 20(int) Constant 3 99: TypeVector 6(int) 4 106: TypePointer Input 6(int) 107(pos): 106(ptr) Variable Input @@ -409,22 +406,22 @@ error: OpStore Pointer '14[size]'s type does not match Object '20's ty 30(byteAddrTemp): 29(ptr) Variable Function 53(byteAddrTemp): 29(ptr) Variable Function 78(byteAddrTemp): 29(ptr) Variable Function - 20: 19(int) ArrayLength 18(sbuf) 0 - Store 14(size) 20 + 19: 6(int) ArrayLength 18(sbuf) 0 + Store 14(size) 19 22: 6(int) Load 11(pos) - 24: 19(int) ShiftRightLogical 22 23 + 24: 20(int) ShiftRightLogical 22 23 26: 25(ptr) AccessChain 18(sbuf) 21 24 27: 6(int) Load 26 28: 8(float) ConvertUToF 27 31: 6(int) Load 11(pos) 33: 6(int) IAdd 31 32 - 34: 19(int) ShiftRightLogical 33 23 + 34: 20(int) ShiftRightLogical 33 23 Store 30(byteAddrTemp) 34 - 35: 19(int) Load 30(byteAddrTemp) + 35: 20(int) Load 30(byteAddrTemp) 36: 25(ptr) AccessChain 18(sbuf) 21 35 37: 6(int) Load 36 - 38: 19(int) Load 30(byteAddrTemp) - 40: 19(int) IAdd 38 39 + 38: 20(int) Load 30(byteAddrTemp) + 40: 20(int) IAdd 38 39 41: 25(ptr) AccessChain 18(sbuf) 21 40 42: 6(int) Load 41 44: 43(ivec2) CompositeConstruct 37 42 @@ -436,17 +433,17 @@ error: OpStore Pointer '14[size]'s type does not match Object '20's ty 52: 9(fvec4) FAdd 51 50 54: 6(int) Load 11(pos) 56: 6(int) IAdd 54 55 - 57: 19(int) ShiftRightLogical 56 23 + 57: 20(int) ShiftRightLogical 56 23 Store 53(byteAddrTemp) 57 - 58: 19(int) Load 53(byteAddrTemp) + 58: 20(int) Load 53(byteAddrTemp) 59: 25(ptr) AccessChain 18(sbuf) 21 58 60: 6(int) Load 59 - 61: 19(int) Load 53(byteAddrTemp) - 62: 19(int) IAdd 61 39 + 61: 20(int) Load 53(byteAddrTemp) + 62: 20(int) IAdd 61 39 63: 25(ptr) AccessChain 18(sbuf) 21 62 64: 6(int) Load 63 - 65: 19(int) Load 53(byteAddrTemp) - 66: 19(int) IAdd 65 23 + 65: 20(int) Load 53(byteAddrTemp) + 66: 20(int) IAdd 65 23 67: 25(ptr) AccessChain 18(sbuf) 21 66 68: 6(int) Load 67 70: 69(ivec3) CompositeConstruct 60 64 68 @@ -458,21 +455,21 @@ error: OpStore Pointer '14[size]'s type does not match Object '20's ty 77: 9(fvec4) FAdd 52 76 79: 6(int) Load 11(pos) 81: 6(int) IAdd 79 80 - 82: 19(int) ShiftRightLogical 81 23 + 82: 20(int) ShiftRightLogical 81 23 Store 78(byteAddrTemp) 82 - 83: 19(int) Load 78(byteAddrTemp) + 83: 20(int) Load 78(byteAddrTemp) 84: 25(ptr) AccessChain 18(sbuf) 21 83 85: 6(int) Load 84 - 86: 19(int) Load 78(byteAddrTemp) - 87: 19(int) IAdd 86 39 + 86: 20(int) Load 78(byteAddrTemp) + 87: 20(int) IAdd 86 39 88: 25(ptr) AccessChain 18(sbuf) 21 87 89: 6(int) Load 88 - 90: 19(int) Load 78(byteAddrTemp) - 91: 19(int) IAdd 90 23 + 90: 20(int) Load 78(byteAddrTemp) + 91: 20(int) IAdd 90 23 92: 25(ptr) AccessChain 18(sbuf) 21 91 93: 6(int) Load 92 - 94: 19(int) Load 78(byteAddrTemp) - 96: 19(int) IAdd 94 95 + 94: 20(int) Load 78(byteAddrTemp) + 96: 20(int) IAdd 94 95 97: 25(ptr) AccessChain 18(sbuf) 21 96 98: 6(int) Load 97 100: 99(ivec4) CompositeConstruct 85 89 93 98 diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.coherent.frag.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.coherent.frag.out index 1d11b647..b33b44d2 100644 --- a/deps/glslang/Test/baseResults/hlsl.structbuffer.coherent.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.coherent.frag.out @@ -175,10 +175,6 @@ gl_FragCoord origin is upper left 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) -error: SPIRV-Tools Validation Errors -error: OpStore Pointer '26[size]'s type does not match Object '33's type. - OpStore %size %33 - // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 78 @@ -212,6 +208,7 @@ error: OpStore Pointer '26[size]'s type does not match Object '33's ty MemberDecorate 15(sbuf2) 0 Offset 0 Decorate 15(sbuf2) BufferBlock Decorate 17(sbuf2) DescriptorSet 0 + Decorate 17(sbuf2) Binding 0 MemberDecorate 28(sb_t) 0 Offset 0 MemberDecorate 28(sb_t) 1 Offset 12 Decorate 29 ArrayStride 16 @@ -219,6 +216,7 @@ error: OpStore Pointer '26[size]'s type does not match Object '33's ty MemberDecorate 30(sbuf) 0 Offset 0 Decorate 30(sbuf) BufferBlock Decorate 32(sbuf) DescriptorSet 0 + Decorate 32(sbuf) Binding 0 Decorate 71(pos) Flat Decorate 71(pos) Location 0 Decorate 74(@entryPointOutput) Location 0 @@ -276,7 +274,7 @@ error: OpStore Pointer '26[size]'s type does not match Object '33's ty 22: 6(int) IAdd 20 21 25: 24(ptr) AccessChain 17(sbuf2) 19 22 Store 25 23 - 33: 18(int) ArrayLength 32(sbuf) 0 + 33: 6(int) ArrayLength 32(sbuf) 0 Store 26(size) 33 Store 34(stride) 35 36: 6(int) Load 11(pos) diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.floatidx.comp.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.floatidx.comp.out index 82e307be..fbb07c29 100644 --- a/deps/glslang/Test/baseResults/hlsl.structbuffer.floatidx.comp.out +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.floatidx.comp.out @@ -224,11 +224,14 @@ local_size = (1, 1, 1) MemberDecorate 26(csb@count) 0 Offset 0 Decorate 26(csb@count) BufferBlock Decorate 28(csb@count) DescriptorSet 0 + Decorate 28(csb@count) Binding 0 Decorate 58(outtx) DescriptorSet 0 + Decorate 58(outtx) Binding 0 Decorate 63 ArrayStride 16 MemberDecorate 64(rwsb) 0 Offset 0 Decorate 64(rwsb) BufferBlock Decorate 66(rwsb) DescriptorSet 0 + Decorate 66(rwsb) Binding 0 Decorate 80(nThreadId) BuiltIn GlobalInvocationId 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.fn.frag.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.fn.frag.out index 4b8ee635..085d9dd0 100644 --- a/deps/glslang/Test/baseResults/hlsl.structbuffer.fn.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.fn.frag.out @@ -137,10 +137,7 @@ gl_FragCoord origin is upper left 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) -error: SPIRV-Tools Validation Errors -error: Structure id 20 decorated as BufferBlock must be explicitly laid out with Offset decorations. - %__1 = OpTypeStruct %uint - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 78 @@ -194,7 +191,9 @@ error: Structure id 20 decorated as BufferBlock must be explicitly laid out with Decorate 18 BufferBlock Decorate 20 BufferBlock Decorate 47(sbuf2) DescriptorSet 0 + Decorate 47(sbuf2) Binding 0 Decorate 48(sbuf2@count) DescriptorSet 0 + Decorate 48(sbuf2@count) Binding 0 Decorate 50(sbuf) DescriptorSet 0 Decorate 50(sbuf) Binding 10 Decorate 63(pos) Flat @@ -203,6 +202,7 @@ error: Structure id 20 decorated as BufferBlock must be explicitly laid out with MemberDecorate 70(sbuf2@count) 0 Offset 0 Decorate 70(sbuf2@count) BufferBlock Decorate 72(sbuf2@count) DescriptorSet 0 + Decorate 72(sbuf2@count) Binding 0 Decorate 74 ArrayStride 16 MemberDecorate 75(sbuf3) 0 NonWritable MemberDecorate 75(sbuf3) 0 Offset 0 diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out index 517b48c8..c9633cd6 100644 --- a/deps/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out @@ -135,6 +135,7 @@ local_size = (256, 1, 1) 0:? 'g_output' (layout( binding=1 rg32ui) uniform uimageBuffer) 0:? 'dispatchId' ( in 3-component vector of uint GlobalInvocationID) +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 63 diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.frag.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.frag.out index e058d112..9a67fd76 100644 --- a/deps/glslang/Test/baseResults/hlsl.structbuffer.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.frag.out @@ -187,10 +187,6 @@ gl_FragCoord origin is upper left 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) -error: SPIRV-Tools Validation Errors -error: OpStore Pointer '43[size]'s type does not match Object '44's type. - OpStore %size %44 - // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 96 @@ -239,6 +235,7 @@ error: OpStore Pointer '43[size]'s type does not match Object '44's ty MemberDecorate 59(sbuf2) 0 Offset 0 Decorate 59(sbuf2) BufferBlock Decorate 61(sbuf2) DescriptorSet 0 + Decorate 61(sbuf2) Binding 0 Decorate 89(pos) Flat Decorate 89(pos) Location 0 Decorate 92(@entryPointOutput) Location 0 @@ -312,7 +309,7 @@ error: OpStore Pointer '43[size]'s type does not match Object '44's ty 41: 15(bool) INotEqual 39 35 42: 37(ptr) AccessChain 18(mydata) 40 Store 42 41 - 44: 24(int) ArrayLength 23(sbuf) 0 + 44: 6(int) ArrayLength 23(sbuf) 0 Store 43(size) 44 Store 45(stride) 46 47: 6(int) Load 11(pos) diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.hlslfun1.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.hlslfun1.out index 8b84a731..5c73619f 100644 --- a/deps/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.hlslfun1.out +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.hlslfun1.out @@ -33,12 +33,17 @@ hlsl.structbuffer.incdec.frag MemberDecorate 20(sbuf_rw_i) 0 Offset 0 Decorate 20(sbuf_rw_i) BufferBlock Decorate 22(sbuf_rw_i) DescriptorSet 0 + Decorate 22(sbuf_rw_i) Binding 0 Decorate 26(sbuf_rw_d) DescriptorSet 0 + Decorate 26(sbuf_rw_d) Binding 0 Decorate 27(sbuf_rw_nocounter) DescriptorSet 0 + Decorate 27(sbuf_rw_nocounter) Binding 0 MemberDecorate 34(sbuf_rw_i@count) 0 Offset 0 Decorate 34(sbuf_rw_i@count) BufferBlock Decorate 36(sbuf_rw_i@count) DescriptorSet 0 + Decorate 36(sbuf_rw_i@count) Binding 0 Decorate 42(sbuf_rw_d@count) DescriptorSet 0 + Decorate 42(sbuf_rw_d@count) Binding 0 Decorate 63(pos) Flat Decorate 63(pos) Location 0 DecorateStringGOOGLE 63(pos) DecorationHlslSemanticGOOGLE "FOO" diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.out index 5c8afd9d..452e9eeb 100644 --- a/deps/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.out @@ -236,12 +236,17 @@ gl_FragCoord origin is upper left MemberDecorate 20(sbuf_rw_i) 0 Offset 0 Decorate 20(sbuf_rw_i) BufferBlock Decorate 22(sbuf_rw_i) DescriptorSet 0 + Decorate 22(sbuf_rw_i) Binding 0 Decorate 26(sbuf_rw_d) DescriptorSet 0 + Decorate 26(sbuf_rw_d) Binding 0 Decorate 27(sbuf_rw_nocounter) DescriptorSet 0 + Decorate 27(sbuf_rw_nocounter) Binding 0 MemberDecorate 34(sbuf_rw_i@count) 0 Offset 0 Decorate 34(sbuf_rw_i@count) BufferBlock Decorate 36(sbuf_rw_i@count) DescriptorSet 0 + Decorate 36(sbuf_rw_i@count) Binding 0 Decorate 42(sbuf_rw_d@count) DescriptorSet 0 + Decorate 42(sbuf_rw_d@count) Binding 0 Decorate 63(pos) Flat Decorate 63(pos) Location 0 Decorate 66(@entryPointOutput) Location 0 diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.rw.frag.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.rw.frag.out index 7fbd1502..ceccd5bb 100644 --- a/deps/glslang/Test/baseResults/hlsl.structbuffer.rw.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.rw.frag.out @@ -175,10 +175,6 @@ gl_FragCoord origin is upper left 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) -error: SPIRV-Tools Validation Errors -error: OpStore Pointer '26[size]'s type does not match Object '33's type. - OpStore %size %33 - // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 78 @@ -211,12 +207,14 @@ error: OpStore Pointer '26[size]'s type does not match Object '33's ty MemberDecorate 15(sbuf2) 0 Offset 0 Decorate 15(sbuf2) BufferBlock Decorate 17(sbuf2) DescriptorSet 0 + Decorate 17(sbuf2) Binding 0 MemberDecorate 28(sb_t) 0 Offset 0 MemberDecorate 28(sb_t) 1 Offset 12 Decorate 29 ArrayStride 16 MemberDecorate 30(sbuf) 0 Offset 0 Decorate 30(sbuf) BufferBlock Decorate 32(sbuf) DescriptorSet 0 + Decorate 32(sbuf) Binding 0 Decorate 71(pos) Flat Decorate 71(pos) Location 0 Decorate 74(@entryPointOutput) Location 0 @@ -274,7 +272,7 @@ error: OpStore Pointer '26[size]'s type does not match Object '33's ty 22: 6(int) IAdd 20 21 25: 24(ptr) AccessChain 17(sbuf2) 19 22 Store 25 23 - 33: 18(int) ArrayLength 32(sbuf) 0 + 33: 6(int) ArrayLength 32(sbuf) 0 Store 26(size) 33 Store 34(stride) 35 36: 6(int) Load 11(pos) diff --git a/deps/glslang/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out b/deps/glslang/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out index ed27c893..00a055e0 100644 --- a/deps/glslang/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out @@ -1003,10 +1003,6 @@ gl_FragCoord origin is upper left 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'pos' (layout( location=0) flat in uint) -error: SPIRV-Tools Validation Errors -error: OpStore Pointer '14[size]'s type does not match Object '20's type. - OpStore %size %20 - // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 239 @@ -1039,6 +1035,7 @@ error: OpStore Pointer '14[size]'s type does not match Object '20's ty MemberDecorate 16(sbuf) 0 Offset 0 Decorate 16(sbuf) BufferBlock Decorate 18(sbuf) DescriptorSet 0 + Decorate 18(sbuf) Binding 0 Decorate 232(pos) Flat Decorate 232(pos) Location 0 Decorate 235(@entryPointOutput) Location 0 @@ -1053,18 +1050,18 @@ error: OpStore Pointer '14[size]'s type does not match Object '20's ty 16(sbuf): TypeStruct 15 17: TypePointer Uniform 16(sbuf) 18(sbuf): 17(ptr) Variable Uniform - 19: TypeInt 32 1 - 21: TypePointer Function 19(int) - 24: 19(int) Constant 2 - 26: 19(int) Constant 0 + 20: TypeInt 32 1 + 21: TypePointer Function 20(int) + 24: 20(int) Constant 2 + 26: 20(int) Constant 0 30: TypePointer Uniform 6(int) - 45: 19(int) Constant 1 + 45: 20(int) Constant 1 49: TypeVector 6(int) 2 51: 6(int) Constant 0 66: 6(int) Constant 1 87: TypeVector 6(int) 3 125: 6(int) Constant 2 - 147: 19(int) Constant 3 + 147: 20(int) Constant 3 151: TypeVector 6(int) 4 219: 6(int) Constant 3 231: TypePointer Input 6(int) @@ -1094,46 +1091,46 @@ error: OpStore Pointer '14[size]'s type does not match Object '20's ty 73(byteAddrTemp): 21(ptr) Variable Function 128(byteAddrTemp): 21(ptr) Variable Function 132(byteAddrTemp): 21(ptr) Variable Function - 20: 19(int) ArrayLength 18(sbuf) 0 - Store 14(size) 20 + 19: 6(int) ArrayLength 18(sbuf) 0 + Store 14(size) 19 23: 6(int) Load 11(pos) - 25: 19(int) ShiftRightLogical 23 24 + 25: 20(int) ShiftRightLogical 23 24 Store 22(byteAddrTemp) 25 - 27: 19(int) Load 22(byteAddrTemp) + 27: 20(int) Load 22(byteAddrTemp) 28: 6(int) Load 11(pos) - 29: 19(int) ShiftRightLogical 28 24 + 29: 20(int) ShiftRightLogical 28 24 31: 30(ptr) AccessChain 18(sbuf) 26 29 32: 6(int) Load 31 33: 30(ptr) AccessChain 18(sbuf) 26 27 Store 33 32 35: 6(int) Load 11(pos) - 36: 19(int) ShiftRightLogical 35 24 + 36: 20(int) ShiftRightLogical 35 24 Store 34(byteAddrTemp) 36 - 37: 19(int) Load 34(byteAddrTemp) + 37: 20(int) Load 34(byteAddrTemp) 39: 6(int) Load 11(pos) - 40: 19(int) ShiftRightLogical 39 24 + 40: 20(int) ShiftRightLogical 39 24 Store 38(byteAddrTemp) 40 - 41: 19(int) Load 38(byteAddrTemp) + 41: 20(int) Load 38(byteAddrTemp) 42: 30(ptr) AccessChain 18(sbuf) 26 41 43: 6(int) Load 42 - 44: 19(int) Load 38(byteAddrTemp) - 46: 19(int) IAdd 44 45 + 44: 20(int) Load 38(byteAddrTemp) + 46: 20(int) IAdd 44 45 47: 30(ptr) AccessChain 18(sbuf) 26 46 48: 6(int) Load 47 50: 49(ivec2) CompositeConstruct 43 48 52: 6(int) CompositeExtract 50 0 53: 30(ptr) AccessChain 18(sbuf) 26 37 Store 53 52 - 54: 19(int) Load 34(byteAddrTemp) - 55: 19(int) IAdd 54 45 + 54: 20(int) Load 34(byteAddrTemp) + 55: 20(int) IAdd 54 45 56: 6(int) Load 11(pos) - 57: 19(int) ShiftRightLogical 56 24 + 57: 20(int) ShiftRightLogical 56 24 Store 38(byteAddrTemp) 57 - 58: 19(int) Load 38(byteAddrTemp) + 58: 20(int) Load 38(byteAddrTemp) 59: 30(ptr) AccessChain 18(sbuf) 26 58 60: 6(int) Load 59 - 61: 19(int) Load 38(byteAddrTemp) - 62: 19(int) IAdd 61 45 + 61: 20(int) Load 38(byteAddrTemp) + 62: 20(int) IAdd 61 45 63: 30(ptr) AccessChain 18(sbuf) 26 62 64: 6(int) Load 63 65: 49(ivec2) CompositeConstruct 60 64 @@ -1141,61 +1138,61 @@ error: OpStore Pointer '14[size]'s type does not match Object '20's ty 68: 30(ptr) AccessChain 18(sbuf) 26 55 Store 68 67 70: 6(int) Load 11(pos) - 71: 19(int) ShiftRightLogical 70 24 + 71: 20(int) ShiftRightLogical 70 24 Store 69(byteAddrTemp) 71 - 72: 19(int) Load 69(byteAddrTemp) + 72: 20(int) Load 69(byteAddrTemp) 74: 6(int) Load 11(pos) - 75: 19(int) ShiftRightLogical 74 24 + 75: 20(int) ShiftRightLogical 74 24 Store 73(byteAddrTemp) 75 - 76: 19(int) Load 73(byteAddrTemp) + 76: 20(int) Load 73(byteAddrTemp) 77: 30(ptr) AccessChain 18(sbuf) 26 76 78: 6(int) Load 77 - 79: 19(int) Load 73(byteAddrTemp) - 80: 19(int) IAdd 79 45 + 79: 20(int) Load 73(byteAddrTemp) + 80: 20(int) IAdd 79 45 81: 30(ptr) AccessChain 18(sbuf) 26 80 82: 6(int) Load 81 - 83: 19(int) Load 73(byteAddrTemp) - 84: 19(int) IAdd 83 24 + 83: 20(int) Load 73(byteAddrTemp) + 84: 20(int) IAdd 83 24 85: 30(ptr) AccessChain 18(sbuf) 26 84 86: 6(int) Load 85 88: 87(ivec3) CompositeConstruct 78 82 86 89: 6(int) CompositeExtract 88 0 90: 30(ptr) AccessChain 18(sbuf) 26 72 Store 90 89 - 91: 19(int) Load 69(byteAddrTemp) - 92: 19(int) IAdd 91 45 + 91: 20(int) Load 69(byteAddrTemp) + 92: 20(int) IAdd 91 45 93: 6(int) Load 11(pos) - 94: 19(int) ShiftRightLogical 93 24 + 94: 20(int) ShiftRightLogical 93 24 Store 73(byteAddrTemp) 94 - 95: 19(int) Load 73(byteAddrTemp) + 95: 20(int) Load 73(byteAddrTemp) 96: 30(ptr) AccessChain 18(sbuf) 26 95 97: 6(int) Load 96 - 98: 19(int) Load 73(byteAddrTemp) - 99: 19(int) IAdd 98 45 + 98: 20(int) Load 73(byteAddrTemp) + 99: 20(int) IAdd 98 45 100: 30(ptr) AccessChain 18(sbuf) 26 99 101: 6(int) Load 100 - 102: 19(int) Load 73(byteAddrTemp) - 103: 19(int) IAdd 102 24 + 102: 20(int) Load 73(byteAddrTemp) + 103: 20(int) IAdd 102 24 104: 30(ptr) AccessChain 18(sbuf) 26 103 105: 6(int) Load 104 106: 87(ivec3) CompositeConstruct 97 101 105 107: 6(int) CompositeExtract 106 1 108: 30(ptr) AccessChain 18(sbuf) 26 92 Store 108 107 - 109: 19(int) Load 69(byteAddrTemp) - 110: 19(int) IAdd 109 24 + 109: 20(int) Load 69(byteAddrTemp) + 110: 20(int) IAdd 109 24 111: 6(int) Load 11(pos) - 112: 19(int) ShiftRightLogical 111 24 + 112: 20(int) ShiftRightLogical 111 24 Store 73(byteAddrTemp) 112 - 113: 19(int) Load 73(byteAddrTemp) + 113: 20(int) Load 73(byteAddrTemp) 114: 30(ptr) AccessChain 18(sbuf) 26 113 115: 6(int) Load 114 - 116: 19(int) Load 73(byteAddrTemp) - 117: 19(int) IAdd 116 45 + 116: 20(int) Load 73(byteAddrTemp) + 117: 20(int) IAdd 116 45 118: 30(ptr) AccessChain 18(sbuf) 26 117 119: 6(int) Load 118 - 120: 19(int) Load 73(byteAddrTemp) - 121: 19(int) IAdd 120 24 + 120: 20(int) Load 73(byteAddrTemp) + 121: 20(int) IAdd 120 24 122: 30(ptr) AccessChain 18(sbuf) 26 121 123: 6(int) Load 122 124: 87(ivec3) CompositeConstruct 115 119 123 @@ -1203,97 +1200,97 @@ error: OpStore Pointer '14[size]'s type does not match Object '20's ty 127: 30(ptr) AccessChain 18(sbuf) 26 110 Store 127 126 129: 6(int) Load 11(pos) - 130: 19(int) ShiftRightLogical 129 24 + 130: 20(int) ShiftRightLogical 129 24 Store 128(byteAddrTemp) 130 - 131: 19(int) Load 128(byteAddrTemp) + 131: 20(int) Load 128(byteAddrTemp) 133: 6(int) Load 11(pos) - 134: 19(int) ShiftRightLogical 133 24 + 134: 20(int) ShiftRightLogical 133 24 Store 132(byteAddrTemp) 134 - 135: 19(int) Load 132(byteAddrTemp) + 135: 20(int) Load 132(byteAddrTemp) 136: 30(ptr) AccessChain 18(sbuf) 26 135 137: 6(int) Load 136 - 138: 19(int) Load 132(byteAddrTemp) - 139: 19(int) IAdd 138 45 + 138: 20(int) Load 132(byteAddrTemp) + 139: 20(int) IAdd 138 45 140: 30(ptr) AccessChain 18(sbuf) 26 139 141: 6(int) Load 140 - 142: 19(int) Load 132(byteAddrTemp) - 143: 19(int) IAdd 142 24 + 142: 20(int) Load 132(byteAddrTemp) + 143: 20(int) IAdd 142 24 144: 30(ptr) AccessChain 18(sbuf) 26 143 145: 6(int) Load 144 - 146: 19(int) Load 132(byteAddrTemp) - 148: 19(int) IAdd 146 147 + 146: 20(int) Load 132(byteAddrTemp) + 148: 20(int) IAdd 146 147 149: 30(ptr) AccessChain 18(sbuf) 26 148 150: 6(int) Load 149 152: 151(ivec4) CompositeConstruct 137 141 145 150 153: 6(int) CompositeExtract 152 0 154: 30(ptr) AccessChain 18(sbuf) 26 131 Store 154 153 - 155: 19(int) Load 128(byteAddrTemp) - 156: 19(int) IAdd 155 45 + 155: 20(int) Load 128(byteAddrTemp) + 156: 20(int) IAdd 155 45 157: 6(int) Load 11(pos) - 158: 19(int) ShiftRightLogical 157 24 + 158: 20(int) ShiftRightLogical 157 24 Store 132(byteAddrTemp) 158 - 159: 19(int) Load 132(byteAddrTemp) + 159: 20(int) Load 132(byteAddrTemp) 160: 30(ptr) AccessChain 18(sbuf) 26 159 161: 6(int) Load 160 - 162: 19(int) Load 132(byteAddrTemp) - 163: 19(int) IAdd 162 45 + 162: 20(int) Load 132(byteAddrTemp) + 163: 20(int) IAdd 162 45 164: 30(ptr) AccessChain 18(sbuf) 26 163 165: 6(int) Load 164 - 166: 19(int) Load 132(byteAddrTemp) - 167: 19(int) IAdd 166 24 + 166: 20(int) Load 132(byteAddrTemp) + 167: 20(int) IAdd 166 24 168: 30(ptr) AccessChain 18(sbuf) 26 167 169: 6(int) Load 168 - 170: 19(int) Load 132(byteAddrTemp) - 171: 19(int) IAdd 170 147 + 170: 20(int) Load 132(byteAddrTemp) + 171: 20(int) IAdd 170 147 172: 30(ptr) AccessChain 18(sbuf) 26 171 173: 6(int) Load 172 174: 151(ivec4) CompositeConstruct 161 165 169 173 175: 6(int) CompositeExtract 174 1 176: 30(ptr) AccessChain 18(sbuf) 26 156 Store 176 175 - 177: 19(int) Load 128(byteAddrTemp) - 178: 19(int) IAdd 177 24 + 177: 20(int) Load 128(byteAddrTemp) + 178: 20(int) IAdd 177 24 179: 6(int) Load 11(pos) - 180: 19(int) ShiftRightLogical 179 24 + 180: 20(int) ShiftRightLogical 179 24 Store 132(byteAddrTemp) 180 - 181: 19(int) Load 132(byteAddrTemp) + 181: 20(int) Load 132(byteAddrTemp) 182: 30(ptr) AccessChain 18(sbuf) 26 181 183: 6(int) Load 182 - 184: 19(int) Load 132(byteAddrTemp) - 185: 19(int) IAdd 184 45 + 184: 20(int) Load 132(byteAddrTemp) + 185: 20(int) IAdd 184 45 186: 30(ptr) AccessChain 18(sbuf) 26 185 187: 6(int) Load 186 - 188: 19(int) Load 132(byteAddrTemp) - 189: 19(int) IAdd 188 24 + 188: 20(int) Load 132(byteAddrTemp) + 189: 20(int) IAdd 188 24 190: 30(ptr) AccessChain 18(sbuf) 26 189 191: 6(int) Load 190 - 192: 19(int) Load 132(byteAddrTemp) - 193: 19(int) IAdd 192 147 + 192: 20(int) Load 132(byteAddrTemp) + 193: 20(int) IAdd 192 147 194: 30(ptr) AccessChain 18(sbuf) 26 193 195: 6(int) Load 194 196: 151(ivec4) CompositeConstruct 183 187 191 195 197: 6(int) CompositeExtract 196 2 198: 30(ptr) AccessChain 18(sbuf) 26 178 Store 198 197 - 199: 19(int) Load 128(byteAddrTemp) - 200: 19(int) IAdd 199 147 + 199: 20(int) Load 128(byteAddrTemp) + 200: 20(int) IAdd 199 147 201: 6(int) Load 11(pos) - 202: 19(int) ShiftRightLogical 201 24 + 202: 20(int) ShiftRightLogical 201 24 Store 132(byteAddrTemp) 202 - 203: 19(int) Load 132(byteAddrTemp) + 203: 20(int) Load 132(byteAddrTemp) 204: 30(ptr) AccessChain 18(sbuf) 26 203 205: 6(int) Load 204 - 206: 19(int) Load 132(byteAddrTemp) - 207: 19(int) IAdd 206 45 + 206: 20(int) Load 132(byteAddrTemp) + 207: 20(int) IAdd 206 45 208: 30(ptr) AccessChain 18(sbuf) 26 207 209: 6(int) Load 208 - 210: 19(int) Load 132(byteAddrTemp) - 211: 19(int) IAdd 210 24 + 210: 20(int) Load 132(byteAddrTemp) + 211: 20(int) IAdd 210 24 212: 30(ptr) AccessChain 18(sbuf) 26 211 213: 6(int) Load 212 - 214: 19(int) Load 132(byteAddrTemp) - 215: 19(int) IAdd 214 147 + 214: 20(int) Load 132(byteAddrTemp) + 215: 20(int) IAdd 214 147 216: 30(ptr) AccessChain 18(sbuf) 26 215 217: 6(int) Load 216 218: 151(ivec4) CompositeConstruct 205 209 213 217 @@ -1301,7 +1298,7 @@ error: OpStore Pointer '14[size]'s type does not match Object '20's ty 221: 30(ptr) AccessChain 18(sbuf) 26 200 Store 221 220 222: 6(int) Load 11(pos) - 223: 19(int) ShiftRightLogical 222 24 + 223: 20(int) ShiftRightLogical 222 24 224: 30(ptr) AccessChain 18(sbuf) 26 223 225: 6(int) Load 224 226: 8(float) ConvertUToF 225 diff --git a/deps/glslang/Test/baseResults/hlsl.subpass.frag.out b/deps/glslang/Test/baseResults/hlsl.subpass.frag.out index 99aeb96b..ad5a0132 100644 --- a/deps/glslang/Test/baseResults/hlsl.subpass.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.subpass.frag.out @@ -497,52 +497,76 @@ gl_FragCoord origin is upper left Decorate 15(subpass_f4) Binding 1 Decorate 15(subpass_f4) InputAttachmentIndex 1 Decorate 27(subpass_i4) DescriptorSet 0 + Decorate 27(subpass_i4) Binding 0 Decorate 27(subpass_i4) InputAttachmentIndex 2 Decorate 36(subpass_u4) DescriptorSet 0 + Decorate 36(subpass_u4) Binding 0 Decorate 36(subpass_u4) InputAttachmentIndex 3 Decorate 42(subpass_ms_f4) DescriptorSet 0 + Decorate 42(subpass_ms_f4) Binding 0 Decorate 42(subpass_ms_f4) InputAttachmentIndex 4 Decorate 49(subpass_ms_i4) DescriptorSet 0 + Decorate 49(subpass_ms_i4) Binding 0 Decorate 49(subpass_ms_i4) InputAttachmentIndex 5 Decorate 55(subpass_ms_u4) DescriptorSet 0 + Decorate 55(subpass_ms_u4) Binding 0 Decorate 55(subpass_ms_u4) InputAttachmentIndex 6 Decorate 61(subpass_f3) DescriptorSet 0 + Decorate 61(subpass_f3) Binding 0 Decorate 61(subpass_f3) InputAttachmentIndex 1 Decorate 71(subpass_i3) DescriptorSet 0 + Decorate 71(subpass_i3) Binding 0 Decorate 71(subpass_i3) InputAttachmentIndex 2 Decorate 81(subpass_u3) DescriptorSet 0 + Decorate 81(subpass_u3) Binding 0 Decorate 81(subpass_u3) InputAttachmentIndex 3 Decorate 89(subpass_ms_f3) DescriptorSet 0 + Decorate 89(subpass_ms_f3) Binding 0 Decorate 89(subpass_ms_f3) InputAttachmentIndex 4 Decorate 97(subpass_ms_i3) DescriptorSet 0 + Decorate 97(subpass_ms_i3) Binding 0 Decorate 97(subpass_ms_i3) InputAttachmentIndex 5 Decorate 105(subpass_ms_u3) DescriptorSet 0 + Decorate 105(subpass_ms_u3) Binding 0 Decorate 105(subpass_ms_u3) InputAttachmentIndex 6 Decorate 115(subpass_f2) DescriptorSet 0 + Decorate 115(subpass_f2) Binding 0 Decorate 115(subpass_f2) InputAttachmentIndex 1 Decorate 123(subpass_i2) DescriptorSet 0 + Decorate 123(subpass_i2) Binding 0 Decorate 123(subpass_i2) InputAttachmentIndex 2 Decorate 132(subpass_u2) DescriptorSet 0 + Decorate 132(subpass_u2) Binding 0 Decorate 132(subpass_u2) InputAttachmentIndex 3 Decorate 139(subpass_ms_f2) DescriptorSet 0 + Decorate 139(subpass_ms_f2) Binding 0 Decorate 139(subpass_ms_f2) InputAttachmentIndex 4 Decorate 147(subpass_ms_i2) DescriptorSet 0 + Decorate 147(subpass_ms_i2) Binding 0 Decorate 147(subpass_ms_i2) InputAttachmentIndex 5 Decorate 154(subpass_ms_u2) DescriptorSet 0 + Decorate 154(subpass_ms_u2) Binding 0 Decorate 154(subpass_ms_u2) InputAttachmentIndex 6 Decorate 162(subpass_f) DescriptorSet 0 + Decorate 162(subpass_f) Binding 0 Decorate 162(subpass_f) InputAttachmentIndex 1 Decorate 168(subpass_i) DescriptorSet 0 + Decorate 168(subpass_i) Binding 0 Decorate 168(subpass_i) InputAttachmentIndex 2 Decorate 174(subpass_u) DescriptorSet 0 + Decorate 174(subpass_u) Binding 0 Decorate 174(subpass_u) InputAttachmentIndex 3 Decorate 179(subpass_ms_f) DescriptorSet 0 + Decorate 179(subpass_ms_f) Binding 0 Decorate 179(subpass_ms_f) InputAttachmentIndex 4 Decorate 184(subpass_ms_i) DescriptorSet 0 + Decorate 184(subpass_ms_i) Binding 0 Decorate 184(subpass_ms_i) InputAttachmentIndex 5 Decorate 189(subpass_ms_u) DescriptorSet 0 + Decorate 189(subpass_ms_u) Binding 0 Decorate 189(subpass_ms_u) InputAttachmentIndex 6 Decorate 194(subpass_2) DescriptorSet 0 + Decorate 194(subpass_2) Binding 0 Decorate 194(subpass_2) InputAttachmentIndex 7 Decorate 202(@entryPointOutput) Location 0 2: TypeVoid diff --git a/deps/glslang/Test/baseResults/hlsl.texture.struct.frag.out b/deps/glslang/Test/baseResults/hlsl.texture.struct.frag.out index 62cb5749..6fc54285 100644 --- a/deps/glslang/Test/baseResults/hlsl.texture.struct.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.texture.struct.frag.out @@ -837,10 +837,7 @@ gl_FragCoord origin is upper left 0:? 'g_tTex2s1a' ( uniform texture2D) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) -error: SPIRV-Tools Validation Errors -error: OpStore Pointer '185's type does not match Object '184's type. - OpStore %185 %184 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 240 @@ -908,12 +905,19 @@ error: OpStore Pointer '185's type does not match Object '184's type. Name 230 "param" Name 238 "@entryPointOutput" Decorate 30(g_sSamp) DescriptorSet 0 + Decorate 30(g_sSamp) Binding 0 Decorate 90(g_tTex2s1) DescriptorSet 0 + Decorate 90(g_tTex2s1) Binding 0 Decorate 114(g_tTex2s2) DescriptorSet 0 + Decorate 114(g_tTex2s2) Binding 0 Decorate 140(g_tTex2s3) DescriptorSet 0 + Decorate 140(g_tTex2s3) Binding 0 Decorate 168(g_tTex2s4) DescriptorSet 0 + Decorate 168(g_tTex2s4) Binding 0 Decorate 202(g_tTex2s5) DescriptorSet 0 + Decorate 202(g_tTex2s5) Binding 0 Decorate 229(g_tTex2s1a) DescriptorSet 0 + Decorate 229(g_tTex2s1a) Binding 0 Decorate 238(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.texture.subvec4.frag.out b/deps/glslang/Test/baseResults/hlsl.texture.subvec4.frag.out index bf0f146e..1beb027d 100644 --- a/deps/glslang/Test/baseResults/hlsl.texture.subvec4.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.texture.subvec4.frag.out @@ -386,14 +386,23 @@ gl_FragCoord origin is upper left Name 118 "g_tTex2df4" Name 128 "@entryPointOutput" Decorate 17(g_tTex2dmsf1) DescriptorSet 0 + Decorate 17(g_tTex2dmsf1) Binding 0 Decorate 33(g_tTex2dmsf2) DescriptorSet 0 + Decorate 33(g_tTex2dmsf2) Binding 0 Decorate 43(g_tTex2dmsf3) DescriptorSet 0 + Decorate 43(g_tTex2dmsf3) Binding 0 Decorate 53(g_tTex2dmsf4) DescriptorSet 0 + Decorate 53(g_tTex2dmsf4) Binding 0 Decorate 88(g_tTex2df1) DescriptorSet 0 + Decorate 88(g_tTex2df1) Binding 0 Decorate 92(g_sSamp) DescriptorSet 0 + Decorate 92(g_sSamp) Binding 0 Decorate 101(g_tTex2df2) DescriptorSet 0 + Decorate 101(g_tTex2df2) Binding 0 Decorate 109(g_tTex2df3) DescriptorSet 0 + Decorate 109(g_tTex2df3) Binding 0 Decorate 118(g_tTex2df4) DescriptorSet 0 + Decorate 118(g_tTex2df4) Binding 0 Decorate 128(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.texturebuffer.frag.out b/deps/glslang/Test/baseResults/hlsl.texturebuffer.frag.out index 89b5c542..0f761af0 100644 --- a/deps/glslang/Test/baseResults/hlsl.texturebuffer.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.texturebuffer.frag.out @@ -107,6 +107,7 @@ gl_FragCoord origin is upper left MemberDecorate 22(tbuf2) 1 Offset 16 Decorate 22(tbuf2) BufferBlock Decorate 24 DescriptorSet 0 + Decorate 24 Binding 0 Decorate 32(pos) BuiltIn FragCoord Decorate 35(@entryPointOutput) Location 0 2: TypeVoid diff --git a/deps/glslang/Test/baseResults/hlsl.tristream-append.geom.out b/deps/glslang/Test/baseResults/hlsl.tristream-append.geom.out index c1167249..94344cdd 100644 --- a/deps/glslang/Test/baseResults/hlsl.tristream-append.geom.out +++ b/deps/glslang/Test/baseResults/hlsl.tristream-append.geom.out @@ -105,10 +105,7 @@ output primitive = triangle_strip 0:? 'TriStream' ( temp structure{}) 0:? Linker Objects -error: SPIRV-Tools Validation Errors -error: Output variable id <23> is used by entry point 'main' id <4>, but is not listed as an interface - %TriStream_1 = OpVariable %_ptr_Output_GSPS_INPUT Output - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 57 diff --git a/deps/glslang/Test/baseResults/hlsl.tx.bracket.frag.out b/deps/glslang/Test/baseResults/hlsl.tx.bracket.frag.out index 400beb61..f5c82880 100644 --- a/deps/glslang/Test/baseResults/hlsl.tx.bracket.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.tx.bracket.frag.out @@ -493,25 +493,40 @@ gl_FragCoord origin is upper left MemberDecorate 45($Global) 7 Offset 80 Decorate 45($Global) Block Decorate 47 DescriptorSet 0 + Decorate 47 Binding 0 Decorate 57(g_tTex1df4) DescriptorSet 0 Decorate 57(g_tTex1df4) Binding 0 Decorate 72(g_tTex1di4) DescriptorSet 0 + Decorate 72(g_tTex1di4) Binding 0 Decorate 80(g_tTex1du4) DescriptorSet 0 + Decorate 80(g_tTex1du4) Binding 0 Decorate 88(g_tTex2df4) DescriptorSet 0 + Decorate 88(g_tTex2df4) Binding 0 Decorate 98(g_tTex2di4) DescriptorSet 0 + Decorate 98(g_tTex2di4) Binding 0 Decorate 106(g_tTex2du4) DescriptorSet 0 + Decorate 106(g_tTex2du4) Binding 0 Decorate 114(g_tTex3df4) DescriptorSet 0 + Decorate 114(g_tTex3df4) Binding 0 Decorate 124(g_tTex3di4) DescriptorSet 0 + Decorate 124(g_tTex3di4) Binding 0 Decorate 132(g_tTex3du4) DescriptorSet 0 + Decorate 132(g_tTex3du4) Binding 0 Decorate 164(@entryPointOutput.Color) Location 0 Decorate 169(g_sSamp) DescriptorSet 0 Decorate 169(g_sSamp) Binding 0 Decorate 172(g_tTex1df4a) DescriptorSet 0 + Decorate 172(g_tTex1df4a) Binding 0 Decorate 175(g_tTex1di4a) DescriptorSet 0 + Decorate 175(g_tTex1di4a) Binding 0 Decorate 178(g_tTex1du4a) DescriptorSet 0 + Decorate 178(g_tTex1du4a) Binding 0 Decorate 181(g_tTex2df4a) DescriptorSet 0 + Decorate 181(g_tTex2df4a) Binding 0 Decorate 184(g_tTex2di4a) DescriptorSet 0 + Decorate 184(g_tTex2di4a) Binding 0 Decorate 187(g_tTex2du4a) DescriptorSet 0 + Decorate 187(g_tTex2du4a) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 diff --git a/deps/glslang/Test/baseResults/hlsl.tx.overload.frag.out b/deps/glslang/Test/baseResults/hlsl.tx.overload.frag.out index c8d064a3..32779544 100644 --- a/deps/glslang/Test/baseResults/hlsl.tx.overload.frag.out +++ b/deps/glslang/Test/baseResults/hlsl.tx.overload.frag.out @@ -163,9 +163,13 @@ gl_FragCoord origin is upper left Name 64 "param" Name 71 "@entryPointOutput" Decorate 45(tf1) DescriptorSet 0 + Decorate 45(tf1) Binding 0 Decorate 49(tf4) DescriptorSet 0 + Decorate 49(tf4) Binding 0 Decorate 56(twf1) DescriptorSet 0 + Decorate 56(twf1) Binding 0 Decorate 63(twf4) DescriptorSet 0 + Decorate 63(twf4) Binding 0 Decorate 71(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.typeGraphCopy.vert.out b/deps/glslang/Test/baseResults/hlsl.typeGraphCopy.vert.out index c0c7227b..8509cc4b 100644 --- a/deps/glslang/Test/baseResults/hlsl.typeGraphCopy.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.typeGraphCopy.vert.out @@ -96,6 +96,7 @@ Shader version: 500 MemberDecorate 14($Global) 0 Offset 0 Decorate 14($Global) Block Decorate 16 DescriptorSet 0 + Decorate 16 Binding 0 Decorate 26(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.wavebroadcast.comp.out b/deps/glslang/Test/baseResults/hlsl.wavebroadcast.comp.out index 0dfd9ef6..f1c9679b 100644 --- a/deps/glslang/Test/baseResults/hlsl.wavebroadcast.comp.out +++ b/deps/glslang/Test/baseResults/hlsl.wavebroadcast.comp.out @@ -2333,6 +2333,7 @@ local_size = (32, 16, 1) MemberDecorate 22(data) 0 Offset 0 Decorate 22(data) BufferBlock Decorate 24(data) DescriptorSet 0 + Decorate 24(data) Binding 0 Decorate 354(dti) BuiltIn GlobalInvocationId 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.waveprefix.comp.out b/deps/glslang/Test/baseResults/hlsl.waveprefix.comp.out index 9736b4e0..a9a4b759 100644 --- a/deps/glslang/Test/baseResults/hlsl.waveprefix.comp.out +++ b/deps/glslang/Test/baseResults/hlsl.waveprefix.comp.out @@ -2357,6 +2357,7 @@ local_size = (32, 16, 1) MemberDecorate 22(data) 0 Offset 0 Decorate 22(data) BufferBlock Decorate 24(data) DescriptorSet 0 + Decorate 24(data) Binding 0 Decorate 364(dti) BuiltIn GlobalInvocationId 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.wavequad.comp.out b/deps/glslang/Test/baseResults/hlsl.wavequad.comp.out index 56ef6d74..e7e10f19 100644 --- a/deps/glslang/Test/baseResults/hlsl.wavequad.comp.out +++ b/deps/glslang/Test/baseResults/hlsl.wavequad.comp.out @@ -8060,6 +8060,7 @@ local_size = (32, 16, 1) MemberDecorate 22(data) 0 Offset 0 Decorate 22(data) BufferBlock Decorate 24(data) DescriptorSet 0 + Decorate 24(data) Binding 0 Decorate 1115(dti) BuiltIn GlobalInvocationId 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.wavequery.comp.out b/deps/glslang/Test/baseResults/hlsl.wavequery.comp.out index 5f70124e..c25a5372 100644 --- a/deps/glslang/Test/baseResults/hlsl.wavequery.comp.out +++ b/deps/glslang/Test/baseResults/hlsl.wavequery.comp.out @@ -81,6 +81,7 @@ local_size = (32, 16, 1) MemberDecorate 10(data) 0 Offset 0 Decorate 10(data) BufferBlock Decorate 12(data) DescriptorSet 0 + Decorate 12(data) Binding 0 Decorate 16(@gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId Decorate 21(@gl_SubgroupSize) BuiltIn SubgroupSize 2: TypeVoid diff --git a/deps/glslang/Test/baseResults/hlsl.wavereduction.comp.out b/deps/glslang/Test/baseResults/hlsl.wavereduction.comp.out index f922f3dc..3e0d3fb5 100644 --- a/deps/glslang/Test/baseResults/hlsl.wavereduction.comp.out +++ b/deps/glslang/Test/baseResults/hlsl.wavereduction.comp.out @@ -6221,6 +6221,7 @@ local_size = (32, 16, 1) MemberDecorate 22(data) 0 Offset 0 Decorate 22(data) BufferBlock Decorate 24(data) DescriptorSet 0 + Decorate 24(data) Binding 0 Decorate 896(dti) BuiltIn GlobalInvocationId 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.wavevote.comp.out b/deps/glslang/Test/baseResults/hlsl.wavevote.comp.out index 04f2f984..7b671bf9 100644 --- a/deps/glslang/Test/baseResults/hlsl.wavevote.comp.out +++ b/deps/glslang/Test/baseResults/hlsl.wavevote.comp.out @@ -230,6 +230,7 @@ local_size = (32, 16, 1) MemberDecorate 15(data) 0 Offset 0 Decorate 15(data) BufferBlock Decorate 17(data) DescriptorSet 0 + Decorate 17(data) Binding 0 Decorate 70(dti) BuiltIn GlobalInvocationId 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.y-negate-1.vert.out b/deps/glslang/Test/baseResults/hlsl.y-negate-1.vert.out index 257d56c7..c086cc07 100644 --- a/deps/glslang/Test/baseResults/hlsl.y-negate-1.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.y-negate-1.vert.out @@ -90,6 +90,7 @@ Shader version: 500 MemberDecorate 11($Global) 0 Offset 0 Decorate 11($Global) Block Decorate 13 DescriptorSet 0 + Decorate 13 Binding 0 Decorate 32(@entryPointOutput) BuiltIn Position 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.y-negate-2.vert.out b/deps/glslang/Test/baseResults/hlsl.y-negate-2.vert.out index a234a2e9..4e6f189a 100644 --- a/deps/glslang/Test/baseResults/hlsl.y-negate-2.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.y-negate-2.vert.out @@ -101,6 +101,7 @@ Shader version: 500 MemberDecorate 13($Global) 0 Offset 0 Decorate 13($Global) Block Decorate 15 DescriptorSet 0 + Decorate 15 Binding 0 Decorate 35(position) BuiltIn Position 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/hlsl.y-negate-3.vert.out b/deps/glslang/Test/baseResults/hlsl.y-negate-3.vert.out index 34bf8f9b..63745519 100644 --- a/deps/glslang/Test/baseResults/hlsl.y-negate-3.vert.out +++ b/deps/glslang/Test/baseResults/hlsl.y-negate-3.vert.out @@ -150,6 +150,7 @@ Shader version: 500 MemberDecorate 16($Global) 0 Offset 0 Decorate 16($Global) Block Decorate 18 DescriptorSet 0 + Decorate 18 Binding 0 Decorate 44(@entryPointOutput.pos) BuiltIn Position Decorate 47(@entryPointOutput.somethingelse) Location 0 2: TypeVoid diff --git a/deps/glslang/Test/baseResults/link1.vk.frag.out b/deps/glslang/Test/baseResults/link1.vk.frag.out index 333594e3..a24246a6 100644 --- a/deps/glslang/Test/baseResults/link1.vk.frag.out +++ b/deps/glslang/Test/baseResults/link1.vk.frag.out @@ -228,10 +228,12 @@ gl_FragCoord origin is upper left MemberDecorate 62(bnameRuntime) 0 Offset 0 Decorate 62(bnameRuntime) BufferBlock Decorate 64 DescriptorSet 0 + Decorate 64 Binding 0 Decorate 66 ArrayStride 4 MemberDecorate 67(bnameImplicit) 0 Offset 0 Decorate 67(bnameImplicit) BufferBlock Decorate 69 DescriptorSet 0 + Decorate 69 Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/reflection.vert.out b/deps/glslang/Test/baseResults/reflection.vert.out index 52e16e60..5d135236 100644 --- a/deps/glslang/Test/baseResults/reflection.vert.out +++ b/deps/glslang/Test/baseResults/reflection.vert.out @@ -74,6 +74,16 @@ buf1.runtimeArray: offset 4, type 1406, size 4, index 12, binding -1, stages 1 buf2.runtimeArray.c: offset 8, type 1406, size 1, index 13, binding -1, stages 1 buf3.runtimeArray: offset 4, type 1406, size 0, index 14, binding -1, stages 1 buf4.runtimeArray.c: offset 8, type 1406, size 1, index 15, binding -1, stages 1 +nested2.a.n1.a: offset 16, type 1406, size 1, index 16, binding -1, stages 1 +nested2.a.n2.b: offset 32, type 1406, size 1, index 16, binding -1, stages 1 +nested2.a.n2.c: offset 36, type 1406, size 1, index 16, binding -1, stages 1 +nested2.a.n2.d: offset 40, type 1406, size 1, index 16, binding -1, stages 1 +nested2.b[0].a: offset 48, type 1406, size 1, index 16, binding -1, stages 1 +nested2.b[1].a: offset 64, type 1406, size 1, index 16, binding -1, stages 1 +nested2.b[2].a: offset 80, type 1406, size 1, index 16, binding -1, stages 1 +nested2.b[3].a: offset 96, type 1406, size 1, index 16, binding -1, stages 1 +nested2.c.a: offset 112, type 1406, size 1, index 16, binding -1, stages 1 +nested2.d.a: offset 144, type 1406, size 1, index 16, binding -1, stages 1 anonMember1: offset 0, type 8b51, size 1, index 0, binding -1, stages 1 uf1: offset -1, type 1406, size 1, index -1, binding -1, stages 1 uf2: offset -1, type 1406, size 1, index -1, binding -1, stages 1 @@ -96,6 +106,7 @@ buf1: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0 buf2: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0 buf3: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0 buf4: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0 +nested2: offset -1, type ffffffff, size 208, index -1, binding -1, stages 0 Vertex attribute reflection: attributeFloat: offset 0, type 1406, size 0, index 0, binding -1, stages 0 diff --git a/deps/glslang/Test/baseResults/remap.hlsl.sample.basic.everything.frag.out b/deps/glslang/Test/baseResults/remap.hlsl.sample.basic.everything.frag.out index 211daba2..7f180a9f 100644 --- a/deps/glslang/Test/baseResults/remap.hlsl.sample.basic.everything.frag.out +++ b/deps/glslang/Test/baseResults/remap.hlsl.sample.basic.everything.frag.out @@ -17,16 +17,27 @@ WARNING: 0:4: 'immediate sampler state' : unimplemented Decorate 3305 DescriptorSet 0 Decorate 3305 Binding 0 Decorate 4743 DescriptorSet 0 + Decorate 4743 Binding 0 Decorate 4807 DescriptorSet 0 + Decorate 4807 Binding 0 Decorate 5042 DescriptorSet 0 + Decorate 5042 Binding 0 Decorate 5058 DescriptorSet 0 + Decorate 5058 Binding 0 Decorate 5122 DescriptorSet 0 + Decorate 5122 Binding 0 Decorate 3967 DescriptorSet 0 + Decorate 3967 Binding 0 Decorate 3983 DescriptorSet 0 + Decorate 3983 Binding 0 Decorate 4047 DescriptorSet 0 + Decorate 4047 Binding 0 Decorate 3789 DescriptorSet 0 + Decorate 3789 Binding 0 Decorate 3805 DescriptorSet 0 + Decorate 3805 Binding 0 Decorate 3869 DescriptorSet 0 + Decorate 3869 Binding 0 Decorate 4253 Location 0 Decorate 3709 BuiltIn FragDepth 8: TypeVoid diff --git a/deps/glslang/Test/baseResults/remap.hlsl.sample.basic.none.frag.out b/deps/glslang/Test/baseResults/remap.hlsl.sample.basic.none.frag.out index 24a1adec..577a1350 100644 --- a/deps/glslang/Test/baseResults/remap.hlsl.sample.basic.none.frag.out +++ b/deps/glslang/Test/baseResults/remap.hlsl.sample.basic.none.frag.out @@ -69,20 +69,33 @@ WARNING: 0:4: 'immediate sampler state' : unimplemented Decorate 49(g_sSamp) DescriptorSet 0 Decorate 49(g_sSamp) Binding 0 Decorate 60(g_tTex1di4) DescriptorSet 0 + Decorate 60(g_tTex1di4) Binding 0 Decorate 73(g_tTex1du4) DescriptorSet 0 + Decorate 73(g_tTex1du4) Binding 0 Decorate 83(g_tTex2df4) DescriptorSet 0 + Decorate 83(g_tTex2df4) Binding 0 Decorate 94(g_tTex2di4) DescriptorSet 0 + Decorate 94(g_tTex2di4) Binding 0 Decorate 105(g_tTex2du4) DescriptorSet 0 + Decorate 105(g_tTex2du4) Binding 0 Decorate 117(g_tTex3df4) DescriptorSet 0 + Decorate 117(g_tTex3df4) Binding 0 Decorate 128(g_tTex3di4) DescriptorSet 0 + Decorate 128(g_tTex3di4) Binding 0 Decorate 138(g_tTex3du4) DescriptorSet 0 + Decorate 138(g_tTex3du4) Binding 0 Decorate 151(g_tTexcdf4) DescriptorSet 0 + Decorate 151(g_tTexcdf4) Binding 0 Decorate 160(g_tTexcdi4) DescriptorSet 0 + Decorate 160(g_tTexcdi4) Binding 0 Decorate 169(g_tTexcdu4) DescriptorSet 0 + Decorate 169(g_tTexcdu4) Binding 0 Decorate 188(@entryPointOutput.Color) Location 0 Decorate 192(@entryPointOutput.Depth) BuiltIn FragDepth Decorate 195(g_sSamp2d) DescriptorSet 0 + Decorate 195(g_sSamp2d) Binding 0 Decorate 196(g_sSamp2D_b) DescriptorSet 0 + Decorate 196(g_sSamp2D_b) Binding 0 Decorate 197(g_tTex1df4a) DescriptorSet 0 Decorate 197(g_tTex1df4a) Binding 1 2: TypeVoid diff --git a/deps/glslang/Test/baseResults/remap.hlsl.sample.basic.strip.frag.out b/deps/glslang/Test/baseResults/remap.hlsl.sample.basic.strip.frag.out index 2108108d..d7aea9f9 100644 --- a/deps/glslang/Test/baseResults/remap.hlsl.sample.basic.strip.frag.out +++ b/deps/glslang/Test/baseResults/remap.hlsl.sample.basic.strip.frag.out @@ -17,20 +17,33 @@ WARNING: 0:4: 'immediate sampler state' : unimplemented Decorate 49 DescriptorSet 0 Decorate 49 Binding 0 Decorate 60 DescriptorSet 0 + Decorate 60 Binding 0 Decorate 73 DescriptorSet 0 + Decorate 73 Binding 0 Decorate 83 DescriptorSet 0 + Decorate 83 Binding 0 Decorate 94 DescriptorSet 0 + Decorate 94 Binding 0 Decorate 105 DescriptorSet 0 + Decorate 105 Binding 0 Decorate 117 DescriptorSet 0 + Decorate 117 Binding 0 Decorate 128 DescriptorSet 0 + Decorate 128 Binding 0 Decorate 138 DescriptorSet 0 + Decorate 138 Binding 0 Decorate 151 DescriptorSet 0 + Decorate 151 Binding 0 Decorate 160 DescriptorSet 0 + Decorate 160 Binding 0 Decorate 169 DescriptorSet 0 + Decorate 169 Binding 0 Decorate 188 Location 0 Decorate 192 BuiltIn FragDepth Decorate 195 DescriptorSet 0 + Decorate 195 Binding 0 Decorate 196 DescriptorSet 0 + Decorate 196 Binding 0 Decorate 197 DescriptorSet 0 Decorate 197 Binding 1 2: TypeVoid diff --git a/deps/glslang/Test/baseResults/remap.uniformarray.none.frag.out b/deps/glslang/Test/baseResults/remap.uniformarray.none.frag.out index 6ed2d45e..1087e5e7 100644 --- a/deps/glslang/Test/baseResults/remap.uniformarray.none.frag.out +++ b/deps/glslang/Test/baseResults/remap.uniformarray.none.frag.out @@ -18,6 +18,7 @@ remap.uniformarray.none.frag Name 52 "texSampler2D" Decorate 47(gl_FragColor) Location 0 Decorate 52(texSampler2D) DescriptorSet 0 + Decorate 52(texSampler2D) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.130.frag.out b/deps/glslang/Test/baseResults/spv.130.frag.out index eb02bade..67e2b824 100644 --- a/deps/glslang/Test/baseResults/spv.130.frag.out +++ b/deps/glslang/Test/baseResults/spv.130.frag.out @@ -1,10 +1,7 @@ spv.130.frag WARNING: 0:31: '#extension' : extension is only partially supported: GL_ARB_gpu_shader5 -error: SPIRV-Tools Validation Errors -error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension) - OpCapability SampledRect - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 205 @@ -62,24 +59,38 @@ error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or req Name 203 "s1D" Name 204 "s2DS" Decorate 21(samp2D) DescriptorSet 0 + Decorate 21(samp2D) Binding 0 Decorate 37(samp2DA) DescriptorSet 0 + Decorate 37(samp2DA) Binding 0 Decorate 47(samp2DR) DescriptorSet 0 + Decorate 47(samp2DR) Binding 0 Decorate 55(samp2DS) DescriptorSet 0 + Decorate 55(samp2DS) Binding 0 Decorate 72(Sca) DescriptorSet 0 + Decorate 72(Sca) Binding 0 Decorate 87(Isca) DescriptorSet 0 + Decorate 87(Isca) Binding 0 Decorate 103(Usca) DescriptorSet 0 + Decorate 103(Usca) Binding 0 Decorate 118(Scas) DescriptorSet 0 + Decorate 118(Scas) Binding 0 Decorate 167(sampC) DescriptorSet 0 + Decorate 167(sampC) Binding 0 Decorate 173(gl_ClipDistance) BuiltIn ClipDistance Decorate 184(fflat) Flat Decorate 186(fnop) NoPerspective Decorate 193(bounds) DescriptorSet 0 Decorate 193(bounds) Binding 0 Decorate 194(s2D) DescriptorSet 0 + Decorate 194(s2D) Binding 0 Decorate 195(s2DR) DescriptorSet 0 + Decorate 195(s2DR) Binding 0 Decorate 199(s2DRS) DescriptorSet 0 + Decorate 199(s2DRS) Binding 0 Decorate 203(s1D) DescriptorSet 0 + Decorate 203(s1D) Binding 0 Decorate 204(s2DS) DescriptorSet 0 + Decorate 204(s2DS) Binding 0 2: TypeVoid 3: TypeFunction 2 14: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.140.frag.out b/deps/glslang/Test/baseResults/spv.140.frag.out index 8a59c2f9..abfd13a9 100644 --- a/deps/glslang/Test/baseResults/spv.140.frag.out +++ b/deps/glslang/Test/baseResults/spv.140.frag.out @@ -1,8 +1,5 @@ spv.140.frag -error: SPIRV-Tools Validation Errors -error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension) - OpCapability SampledRect - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 96 @@ -41,8 +38,11 @@ error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or req Decorate 14(gl_FrontFacing) BuiltIn FrontFacing Decorate 28(gl_ClipDistance) BuiltIn ClipDistance Decorate 50(sampR) DescriptorSet 0 + Decorate 50(sampR) Binding 0 Decorate 58(sampB) DescriptorSet 0 + Decorate 58(sampB) Binding 0 Decorate 82(samp2Da) DescriptorSet 0 + Decorate 82(samp2Da) Binding 0 Decorate 85 ArrayStride 64 Decorate 86 ArrayStride 64 MemberDecorate 87(bn) 0 RowMajor @@ -62,10 +62,12 @@ error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or req MemberDecorate 87(bn) 4 MatrixStride 16 Decorate 87(bn) Block Decorate 89 DescriptorSet 0 + Decorate 89 Binding 0 Decorate 91 ArrayStride 16 MemberDecorate 92(bi) 0 Offset 0 Decorate 92(bi) Block Decorate 95(bname) DescriptorSet 0 + Decorate 95(bname) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.150.geom.out b/deps/glslang/Test/baseResults/spv.150.geom.out index 70dadf5d..19bd7253 100644 --- a/deps/glslang/Test/baseResults/spv.150.geom.out +++ b/deps/glslang/Test/baseResults/spv.150.geom.out @@ -1,8 +1,4 @@ spv.150.geom -error: SPIRV-Tools Validation Errors -error: Capability GeometryStreams is not allowed by Vulkan 1.0 specification (or requires extension) - OpCapability GeometryStreams - // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 71 @@ -42,14 +38,12 @@ error: Capability GeometryStreams is not allowed by Vulkan 1.0 specification (or MemberName 68(toFragment) 0 "color" Name 70 "toF" Decorate 8(fromVertex) Block - Decorate 8(fromVertex) Stream 3 Decorate 10 Stream 3 Decorate 13(fromVertex) Block MemberDecorate 27(gl_PerVertex) 0 BuiltIn Position MemberDecorate 27(gl_PerVertex) 1 BuiltIn PointSize MemberDecorate 27(gl_PerVertex) 2 BuiltIn ClipDistance Decorate 27(gl_PerVertex) Block - Decorate 27(gl_PerVertex) Stream 0 Decorate 29 Stream 0 MemberDecorate 30(gl_PerVertex) 0 BuiltIn Position MemberDecorate 30(gl_PerVertex) 1 BuiltIn PointSize @@ -61,7 +55,6 @@ error: Capability GeometryStreams is not allowed by Vulkan 1.0 specification (or Decorate 51(gl_Layer) Stream 0 Decorate 51(gl_Layer) BuiltIn Layer Decorate 68(toFragment) Block - Decorate 68(toFragment) Stream 3 Decorate 70(toF) Stream 3 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/spv.150.vert.out b/deps/glslang/Test/baseResults/spv.150.vert.out index 282f5f9c..db058fa3 100644 --- a/deps/glslang/Test/baseResults/spv.150.vert.out +++ b/deps/glslang/Test/baseResults/spv.150.vert.out @@ -34,6 +34,7 @@ spv.150.vert MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance Decorate 11(gl_PerVertex) Block Decorate 47(s2D) DescriptorSet 0 + Decorate 47(s2D) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.16bitstorage-int.frag.out b/deps/glslang/Test/baseResults/spv.16bitstorage-int.frag.out index 1b2a16ba..a09cd879 100644 --- a/deps/glslang/Test/baseResults/spv.16bitstorage-int.frag.out +++ b/deps/glslang/Test/baseResults/spv.16bitstorage-int.frag.out @@ -1,7 +1,7 @@ spv.16bitstorage-int.frag // Module Version 10000 // Generated by (magic number): 80007 -// Id's are bound by 171 +// Id's are bound by 172 Capability Shader Capability StorageUniformBufferBlock16 @@ -93,6 +93,7 @@ spv.16bitstorage-int.frag MemberDecorate 17(B2) 7 Offset 472 Decorate 17(B2) BufferBlock Decorate 19(b2) DescriptorSet 0 + Decorate 19(b2) Binding 0 Decorate 22 ArrayStride 16 MemberDecorate 23(S) 0 Offset 0 MemberDecorate 23(S) 1 Offset 4 @@ -107,6 +108,7 @@ spv.16bitstorage-int.frag MemberDecorate 25(B1) 6 Offset 96 Decorate 25(B1) Block Decorate 27(b1) DescriptorSet 0 + Decorate 27(b1) Binding 0 Decorate 44 ArrayStride 16 MemberDecorate 45(S) 0 Offset 0 MemberDecorate 45(S) 1 Offset 4 @@ -124,6 +126,7 @@ spv.16bitstorage-int.frag MemberDecorate 49(B5) 7 Offset 1696 Decorate 49(B5) Block Decorate 51(b5) DescriptorSet 0 + Decorate 51(b5) Binding 0 MemberDecorate 88(S2) 0 ColMajor MemberDecorate 88(S2) 0 Offset 0 MemberDecorate 88(S2) 0 MatrixStride 16 @@ -134,6 +137,7 @@ spv.16bitstorage-int.frag MemberDecorate 90(B4) 1 Offset 80 Decorate 90(B4) BufferBlock Decorate 92(b4) DescriptorSet 0 + Decorate 92(b4) Binding 0 MemberDecorate 93(S2) 0 RowMajor MemberDecorate 93(S2) 0 Offset 0 MemberDecorate 93(S2) 0 MatrixStride 16 @@ -142,6 +146,7 @@ spv.16bitstorage-int.frag MemberDecorate 94(B3) 0 Offset 0 Decorate 94(B3) BufferBlock Decorate 96(b3) DescriptorSet 0 + Decorate 96(b3) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 16 1 @@ -204,7 +209,10 @@ spv.16bitstorage-int.frag 114: 20(int) Constant 7 115: 20(int) Constant 6 116: TypePointer Uniform 20(int) - 166: 39(ivec2) ConstantComposite 32 33 + 166: 6(int16_t) Constant 1 + 167: 6(int16_t) Constant 2 + 168: 7(i16vec2) ConstantComposite 166 167 + 170: 6(int16_t) Constant 3 4(main): 2 Function None 3 5: Label 69(x0): 68(ptr) Variable Function @@ -324,11 +332,9 @@ spv.16bitstorage-int.frag 164: 6(int16_t) Load 163 165: 28(ptr) AccessChain 19(b2) 21 Store 165 164 - 167: 7(i16vec2) SConvert 166 - 168: 42(ptr) AccessChain 19(b2) 32 - Store 168 167 - 169: 6(int16_t) SConvert 58 - 170: 28(ptr) AccessChain 19(b2) 21 - Store 170 169 + 169: 42(ptr) AccessChain 19(b2) 32 + Store 169 168 + 171: 28(ptr) AccessChain 19(b2) 21 + Store 171 170 Return FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.16bitstorage-uint.frag.out b/deps/glslang/Test/baseResults/spv.16bitstorage-uint.frag.out index f935f266..915dfcbd 100644 --- a/deps/glslang/Test/baseResults/spv.16bitstorage-uint.frag.out +++ b/deps/glslang/Test/baseResults/spv.16bitstorage-uint.frag.out @@ -93,6 +93,7 @@ spv.16bitstorage-uint.frag MemberDecorate 17(B2) 7 Offset 472 Decorate 17(B2) BufferBlock Decorate 19(b2) DescriptorSet 0 + Decorate 19(b2) Binding 0 Decorate 22 ArrayStride 16 MemberDecorate 23(S) 0 Offset 0 MemberDecorate 23(S) 1 Offset 4 @@ -107,6 +108,7 @@ spv.16bitstorage-uint.frag MemberDecorate 25(B1) 6 Offset 96 Decorate 25(B1) Block Decorate 27(b1) DescriptorSet 0 + Decorate 27(b1) Binding 0 Decorate 44 ArrayStride 16 MemberDecorate 45(S) 0 Offset 0 MemberDecorate 45(S) 1 Offset 4 @@ -124,6 +126,7 @@ spv.16bitstorage-uint.frag MemberDecorate 49(B5) 7 Offset 1696 Decorate 49(B5) Block Decorate 51(b5) DescriptorSet 0 + Decorate 51(b5) Binding 0 MemberDecorate 89(S2) 0 ColMajor MemberDecorate 89(S2) 0 Offset 0 MemberDecorate 89(S2) 0 MatrixStride 16 @@ -134,6 +137,7 @@ spv.16bitstorage-uint.frag MemberDecorate 91(B4) 1 Offset 80 Decorate 91(B4) BufferBlock Decorate 93(b4) DescriptorSet 0 + Decorate 93(b4) Binding 0 MemberDecorate 94(S2) 0 RowMajor MemberDecorate 94(S2) 0 Offset 0 MemberDecorate 94(S2) 0 MatrixStride 16 @@ -142,6 +146,7 @@ spv.16bitstorage-uint.frag MemberDecorate 95(B3) 0 Offset 0 Decorate 95(B3) BufferBlock Decorate 97(b3) DescriptorSet 0 + Decorate 97(b3) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 16 0 @@ -205,8 +210,10 @@ spv.16bitstorage-uint.frag 115: 20(int) Constant 7 116: 20(int) Constant 6 117: TypePointer Uniform 9(int) - 167: 39(ivec2) ConstantComposite 82 10 - 170: 9(int) Constant 3 + 167: 6(int16_t) Constant 1 + 168: 6(int16_t) Constant 2 + 169: 7(i16vec2) ConstantComposite 167 168 + 171: 6(int16_t) Constant 3 4(main): 2 Function None 3 5: Label 69(x0): 68(ptr) Variable Function @@ -326,10 +333,8 @@ spv.16bitstorage-uint.frag 165: 6(int16_t) Load 164 166: 28(ptr) AccessChain 19(b2) 21 Store 166 165 - 168: 7(i16vec2) UConvert 167 - 169: 42(ptr) AccessChain 19(b2) 32 - Store 169 168 - 171: 6(int16_t) UConvert 170 + 170: 42(ptr) AccessChain 19(b2) 32 + Store 170 169 172: 28(ptr) AccessChain 19(b2) 21 Store 172 171 Return diff --git a/deps/glslang/Test/baseResults/spv.16bitstorage.frag.out b/deps/glslang/Test/baseResults/spv.16bitstorage.frag.out index d2a83ba9..3fb08a39 100644 --- a/deps/glslang/Test/baseResults/spv.16bitstorage.frag.out +++ b/deps/glslang/Test/baseResults/spv.16bitstorage.frag.out @@ -1,7 +1,7 @@ spv.16bitstorage.frag // Module Version 10000 // Generated by (magic number): 80007 -// Id's are bound by 173 +// Id's are bound by 172 Capability Shader Capability StorageUniformBufferBlock16 @@ -93,6 +93,7 @@ spv.16bitstorage.frag MemberDecorate 17(B2) 7 Offset 472 Decorate 17(B2) BufferBlock Decorate 19(b2) DescriptorSet 0 + Decorate 19(b2) Binding 0 Decorate 22 ArrayStride 16 MemberDecorate 23(S) 0 Offset 0 MemberDecorate 23(S) 1 Offset 4 @@ -107,6 +108,7 @@ spv.16bitstorage.frag MemberDecorate 25(B1) 6 Offset 96 Decorate 25(B1) Block Decorate 27(b1) DescriptorSet 0 + Decorate 27(b1) Binding 0 Decorate 45 ArrayStride 16 MemberDecorate 46(S) 0 Offset 0 MemberDecorate 46(S) 1 Offset 4 @@ -124,6 +126,7 @@ spv.16bitstorage.frag MemberDecorate 50(B5) 7 Offset 1696 Decorate 50(B5) Block Decorate 52(b5) DescriptorSet 0 + Decorate 52(b5) Binding 0 MemberDecorate 88(S2) 0 ColMajor MemberDecorate 88(S2) 0 Offset 0 MemberDecorate 88(S2) 0 MatrixStride 16 @@ -134,6 +137,7 @@ spv.16bitstorage.frag MemberDecorate 90(B4) 1 Offset 80 Decorate 90(B4) BufferBlock Decorate 92(b4) DescriptorSet 0 + Decorate 92(b4) Binding 0 MemberDecorate 93(S2) 0 RowMajor MemberDecorate 93(S2) 0 Offset 0 MemberDecorate 93(S2) 0 MatrixStride 16 @@ -142,6 +146,7 @@ spv.16bitstorage.frag MemberDecorate 94(B3) 0 Offset 0 Decorate 94(B3) BufferBlock Decorate 96(b3) DescriptorSet 0 + Decorate 96(b3) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 16 @@ -204,9 +209,10 @@ spv.16bitstorage.frag 114: 20(int) Constant 7 115: 20(int) Constant 6 116: TypePointer Uniform 20(int) - 166: 37(float) Constant 1073741824 - 167: 40(fvec2) ConstantComposite 83 166 - 170: 37(float) Constant 1077936128 + 166:6(float16_t) Constant 15360 + 167:6(float16_t) Constant 16384 + 168: 7(f16vec2) ConstantComposite 166 167 + 170:6(float16_t) Constant 16896 4(main): 2 Function None 3 5: Label 70(x0): 69(ptr) Variable Function @@ -326,11 +332,9 @@ spv.16bitstorage.frag 164:6(float16_t) Load 163 165: 28(ptr) AccessChain 19(b2) 21 Store 165 164 - 168: 7(f16vec2) FConvert 167 169: 43(ptr) AccessChain 19(b2) 32 Store 169 168 - 171:6(float16_t) FConvert 170 - 172: 28(ptr) AccessChain 19(b2) 21 - Store 172 171 + 171: 28(ptr) AccessChain 19(b2) 21 + Store 171 170 Return FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.16bitstorage_Error-int.frag.out b/deps/glslang/Test/baseResults/spv.16bitstorage_Error-int.frag.out index 40552583..d6a0c132 100644 --- a/deps/glslang/Test/baseResults/spv.16bitstorage_Error-int.frag.out +++ b/deps/glslang/Test/baseResults/spv.16bitstorage_Error-int.frag.out @@ -1,88 +1,88 @@ spv.16bitstorage_Error-int.frag ERROR: 0:54: 'structure: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:58: 'return: can't use with structs containing int16' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:61: 'int16_t: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:74: '[: does not operate on types containing (u)int16' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:75: '.: can't swizzle types containing (u)int16' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:76: 'built-in function: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:76: 'built-in function: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:76: 'built-in function: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:77: 'built-in function: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:77: 'built-in function: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:78: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform int16_t' and a right operand of type 'layout( column_major std140 offset=0) uniform int16_t' (or there is no acceptable conversion) ERROR: 0:79: '-' : wrong operand type no operation '-' exists that takes an operand of type layout( column_major std140 offset=0) uniform int16_t (or there is no acceptable conversion) ERROR: 0:80: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform int16_t' and a right operand of type ' const int' (or there is no acceptable conversion) ERROR: 0:81: '.: can't swizzle types containing (u)int16' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:82: '=: can't use with structs containing int16' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:83: 'qualifier: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:84: 'qualifier: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:85: 'qualifier: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:86: '==' : wrong operand types: no operation '==' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform int16_t' and a right operand of type 'layout( column_major std140 offset=0) uniform int16_t' (or there is no acceptable conversion) ERROR: 0:87: '=: can't use with arrays containing int16' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:88: 'constructor: 16-bit vectors only take vector types' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:89: 'constructor: 16-bit arrays not supported' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:89: 'constructor: 16-bit vectors only take vector types' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:92: 'constructor: can't construct structure containing 16-bit type' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:93: 'func2' : no matching overloaded function found ERROR: 0:99: '' : syntax error, unexpected IDENTIFIER ERROR: 26 compilation errors. No code generated. diff --git a/deps/glslang/Test/baseResults/spv.16bitstorage_Error-uint.frag.out b/deps/glslang/Test/baseResults/spv.16bitstorage_Error-uint.frag.out index bff46d44..bac902ee 100644 --- a/deps/glslang/Test/baseResults/spv.16bitstorage_Error-uint.frag.out +++ b/deps/glslang/Test/baseResults/spv.16bitstorage_Error-uint.frag.out @@ -1,88 +1,88 @@ spv.16bitstorage_Error-uint.frag ERROR: 0:54: 'structure: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:58: 'return: can't use with structs containing uint16' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:61: 'uint16_t: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:74: '[: does not operate on types containing (u)int16' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:75: '.: can't swizzle types containing (u)int16' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:76: 'built-in function: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:76: 'built-in function: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:76: 'built-in function: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:77: 'built-in function: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:77: 'built-in function: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:78: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform uint16_t' and a right operand of type 'layout( column_major std140 offset=0) uniform uint16_t' (or there is no acceptable conversion) ERROR: 0:79: '-' : wrong operand type no operation '-' exists that takes an operand of type layout( column_major std140 offset=0) uniform uint16_t (or there is no acceptable conversion) ERROR: 0:80: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform uint16_t' and a right operand of type ' const int' (or there is no acceptable conversion) ERROR: 0:81: '.: can't swizzle types containing (u)int16' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:82: '=: can't use with structs containing uint16' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:83: 'qualifier: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:84: 'qualifier: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:85: 'qualifier: (u)int16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:86: '==' : wrong operand types: no operation '==' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform uint16_t' and a right operand of type 'layout( column_major std140 offset=0) uniform uint16_t' (or there is no acceptable conversion) ERROR: 0:87: '=: can't use with arrays containing uint16' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:88: 'constructor: 16-bit vectors only take vector types' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:89: 'constructor: 16-bit arrays not supported' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:89: 'constructor: 16-bit vectors only take vector types' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:92: 'constructor: can't construct structure containing 16-bit type' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_int16 -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int16 ERROR: 0:93: 'func2' : no matching overloaded function found ERROR: 0:99: '' : syntax error, unexpected IDENTIFIER ERROR: 26 compilation errors. No code generated. diff --git a/deps/glslang/Test/baseResults/spv.16bitstorage_Error.frag.out b/deps/glslang/Test/baseResults/spv.16bitstorage_Error.frag.out index 08c75e73..8e7e35e2 100644 --- a/deps/glslang/Test/baseResults/spv.16bitstorage_Error.frag.out +++ b/deps/glslang/Test/baseResults/spv.16bitstorage_Error.frag.out @@ -1,96 +1,96 @@ spv.16bitstorage_Error.frag ERROR: 0:54: 'structure: float16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:58: 'return: can't use with structs containing float16' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:61: 'float16_t: float16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:74: '[: does not operate on types containing float16' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:75: '.: can't swizzle types containing float16' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:76: 'built-in function: float16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:76: 'built-in function: float16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:76: 'built-in function: float16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:77: 'built-in function: float16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:77: 'built-in function: float16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:78: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform float16_t' and a right operand of type 'layout( column_major std140 offset=0) uniform float16_t' (or there is no acceptable conversion) ERROR: 0:79: '-' : wrong operand type no operation '-' exists that takes an operand of type layout( column_major std140 offset=0) uniform float16_t (or there is no acceptable conversion) ERROR: 0:80: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform float16_t' and a right operand of type ' const float' (or there is no acceptable conversion) ERROR: 0:81: '.: can't swizzle types containing float16' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:82: '=: can't use with structs containing float16' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:83: 'qualifier: float16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:84: 'qualifier: float16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:85: 'qualifier: float16 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:86: '==' : wrong operand types: no operation '==' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform float16_t' and a right operand of type 'layout( column_major std140 offset=0) uniform float16_t' (or there is no acceptable conversion) ERROR: 0:87: '=: can't use with arrays containing float16' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:88: 'half floating-point suffix' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:88: 'half float literal' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:89: 'constructor: 16-bit vectors only take vector types' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:90: 'constructor: 16-bit arrays not supported' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:90: 'constructor: 16-bit vectors only take vector types' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:93: 'constructor: can't construct structure containing 16-bit type' : required extension not requested: Possible extensions include: GL_AMD_gpu_shader_half_float -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_float16 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_float16 ERROR: 0:94: 'func2' : no matching overloaded function found ERROR: 0:100: '' : syntax error, unexpected IDENTIFIER ERROR: 28 compilation errors. No code generated. diff --git a/deps/glslang/Test/baseResults/spv.16bitxfb.vert.out b/deps/glslang/Test/baseResults/spv.16bitxfb.vert.out new file mode 100644 index 00000000..7d989c57 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.16bitxfb.vert.out @@ -0,0 +1,120 @@ +spv.16bitxfb.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 59 + + Capability Shader + Capability Float16 + Capability Int16 + Capability TransformFeedback + Capability StorageInputOutput16 + Extension "SPV_KHR_16bit_storage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 9 12 18 36 39 46 49 + ExecutionMode 4 Xfb + Source GLSL 450 + SourceExtension "GL_AMD_gpu_shader_half_float" + SourceExtension "GL_AMD_gpu_shader_int16" + Name 4 "main" + Name 9 "of16v3" + Name 12 "if16v4" + Name 16 "F16Out" + MemberName 16(F16Out) 0 "of16" + MemberName 16(F16Out) 1 "of16v2" + Name 18 "" + Name 36 "oi16v3" + Name 39 "ii16v4" + Name 44 "I16Out" + MemberName 44(I16Out) 0 "ou16" + MemberName 44(I16Out) 1 "ou16v2" + Name 46 "" + Name 49 "iu16v4" + Decorate 9(of16v3) Location 0 + Decorate 9(of16v3) XfbBuffer 0 + Decorate 9(of16v3) XfbStride 6 + Decorate 9(of16v3) Offset 0 + Decorate 12(if16v4) Location 0 + MemberDecorate 16(F16Out) 0 Offset 0 + MemberDecorate 16(F16Out) 1 Offset 2 + Decorate 16(F16Out) Block + Decorate 18 Location 1 + Decorate 18 XfbBuffer 1 + Decorate 18 XfbStride 6 + Decorate 36(oi16v3) Location 5 + Decorate 36(oi16v3) XfbBuffer 2 + Decorate 36(oi16v3) XfbStride 6 + Decorate 36(oi16v3) Offset 0 + Decorate 39(ii16v4) Location 1 + MemberDecorate 44(I16Out) 0 Offset 0 + MemberDecorate 44(I16Out) 1 Offset 2 + Decorate 44(I16Out) Block + Decorate 46 Location 6 + Decorate 46 XfbBuffer 3 + Decorate 46 XfbStride 6 + Decorate 49(iu16v4) Location 2 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 16 + 7: TypeVector 6(float16_t) 3 + 8: TypePointer Output 7(f16vec3) + 9(of16v3): 8(ptr) Variable Output + 10: TypeVector 6(float16_t) 4 + 11: TypePointer Input 10(f16vec4) + 12(if16v4): 11(ptr) Variable Input + 15: TypeVector 6(float16_t) 2 + 16(F16Out): TypeStruct 6(float16_t) 15(f16vec2) + 17: TypePointer Output 16(F16Out) + 18: 17(ptr) Variable Output + 19: TypeInt 32 1 + 20: 19(int) Constant 0 + 21: TypeInt 32 0 + 22: 21(int) Constant 0 + 23: TypePointer Input 6(float16_t) + 26: TypePointer Output 6(float16_t) + 28: 19(int) Constant 1 + 31: TypePointer Output 15(f16vec2) + 33: TypeInt 16 1 + 34: TypeVector 33(int16_t) 3 + 35: TypePointer Output 34(i16vec3) + 36(oi16v3): 35(ptr) Variable Output + 37: TypeVector 33(int16_t) 4 + 38: TypePointer Input 37(i16vec4) + 39(ii16v4): 38(ptr) Variable Input + 42: TypeInt 16 0 + 43: TypeVector 42(int16_t) 2 + 44(I16Out): TypeStruct 42(int16_t) 43(i16vec2) + 45: TypePointer Output 44(I16Out) + 46: 45(ptr) Variable Output + 47: TypeVector 42(int16_t) 4 + 48: TypePointer Input 47(i16vec4) + 49(iu16v4): 48(ptr) Variable Input + 50: TypePointer Input 42(int16_t) + 53: TypePointer Output 42(int16_t) + 57: TypePointer Output 43(i16vec2) + 4(main): 2 Function None 3 + 5: Label + 13: 10(f16vec4) Load 12(if16v4) + 14: 7(f16vec3) VectorShuffle 13 13 0 1 2 + Store 9(of16v3) 14 + 24: 23(ptr) AccessChain 12(if16v4) 22 + 25:6(float16_t) Load 24 + 27: 26(ptr) AccessChain 18 20 + Store 27 25 + 29: 10(f16vec4) Load 12(if16v4) + 30: 15(f16vec2) VectorShuffle 29 29 0 1 + 32: 31(ptr) AccessChain 18 28 + Store 32 30 + 40: 37(i16vec4) Load 39(ii16v4) + 41: 34(i16vec3) VectorShuffle 40 40 0 1 2 + Store 36(oi16v3) 41 + 51: 50(ptr) AccessChain 49(iu16v4) 22 + 52: 42(int16_t) Load 51 + 54: 53(ptr) AccessChain 46 20 + Store 54 52 + 55: 47(i16vec4) Load 49(iu16v4) + 56: 43(i16vec2) VectorShuffle 55 55 0 1 + 58: 57(ptr) AccessChain 46 28 + Store 58 56 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.300layout.vert.out b/deps/glslang/Test/baseResults/spv.300layout.vert.out index 0c0663e8..4d4d7ea4 100644 --- a/deps/glslang/Test/baseResults/spv.300layout.vert.out +++ b/deps/glslang/Test/baseResults/spv.300layout.vert.out @@ -49,6 +49,7 @@ spv.300layout.vert MemberDecorate 17(Transform) 3 Offset 176 Decorate 17(Transform) Block Decorate 19(tblock) DescriptorSet 0 + Decorate 19(tblock) Binding 0 Decorate 44 ArrayStride 16 MemberDecorate 45(T3) 0 ColMajor MemberDecorate 45(T3) 0 Offset 0 @@ -62,12 +63,14 @@ spv.300layout.vert MemberDecorate 45(T3) 3 Offset 2048 Decorate 45(T3) Block Decorate 47 DescriptorSet 0 + Decorate 47 Binding 0 MemberDecorate 78(T2) 0 Offset 0 MemberDecorate 78(T2) 1 RowMajor MemberDecorate 78(T2) 1 Offset 16 MemberDecorate 78(T2) 1 MatrixStride 16 Decorate 78(T2) Block Decorate 80 DescriptorSet 0 + Decorate 80 Binding 0 Decorate 100(c) Location 7 Decorate 108(iout) Flat Decorate 120(aiv2) Location 9 diff --git a/deps/glslang/Test/baseResults/spv.300layoutp.vert.out b/deps/glslang/Test/baseResults/spv.300layoutp.vert.out index 9c4201de..e12041fc 100644 --- a/deps/glslang/Test/baseResults/spv.300layoutp.vert.out +++ b/deps/glslang/Test/baseResults/spv.300layoutp.vert.out @@ -49,6 +49,7 @@ spv.300layoutp.vert MemberDecorate 17(Transform) 3 Offset 176 Decorate 17(Transform) Block Decorate 19(tblock) DescriptorSet 0 + Decorate 19(tblock) Binding 0 Decorate 32 ArrayStride 16 MemberDecorate 33(T3) 0 ColMajor MemberDecorate 33(T3) 0 Offset 0 @@ -62,12 +63,14 @@ spv.300layoutp.vert MemberDecorate 33(T3) 3 Offset 160 Decorate 33(T3) Block Decorate 35 DescriptorSet 0 + Decorate 35 Binding 0 MemberDecorate 42(T2) 0 Offset 0 MemberDecorate 42(T2) 1 RowMajor MemberDecorate 42(T2) 1 Offset 16 MemberDecorate 42(T2) 1 MatrixStride 16 Decorate 42(T2) Block Decorate 44 DescriptorSet 0 + Decorate 44 Binding 0 Decorate 52(c) Location 7 Decorate 60(iout) Flat Decorate 72(aiv2) Location 9 diff --git a/deps/glslang/Test/baseResults/spv.310.comp.out b/deps/glslang/Test/baseResults/spv.310.comp.out index fd1309db..bb8e6a7b 100644 --- a/deps/glslang/Test/baseResults/spv.310.comp.out +++ b/deps/glslang/Test/baseResults/spv.310.comp.out @@ -1,14 +1,14 @@ spv.310.comp // Module Version 10000 // Generated by (magic number): 80007 -// Id's are bound by 71 +// Id's are bound by 72 Capability Shader Capability DeviceGroup Extension "SPV_KHR_device_group" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint GLCompute 4 "main" 53 64 + EntryPoint GLCompute 4 "main" 53 65 ExecutionMode 4 LocalSize 16 32 4 Source ESSL 310 SourceExtension "GL_EXT_device_group" @@ -30,7 +30,7 @@ spv.310.comp MemberName 48(outs) 1 "va" Name 50 "outnames" Name 53 "gl_LocalInvocationID" - Name 64 "gl_DeviceIndex" + Name 65 "gl_DeviceIndex" Decorate 11 ArrayStride 16 MemberDecorate 12(outb) 0 Offset 0 MemberDecorate 12(outb) 1 Offset 4 @@ -38,18 +38,21 @@ spv.310.comp MemberDecorate 12(outb) 3 Offset 16 Decorate 12(outb) BufferBlock Decorate 14(outbname) DescriptorSet 0 + Decorate 14(outbname) Binding 0 MemberDecorate 23(outbna) 0 Offset 0 MemberDecorate 23(outbna) 1 Offset 16 Decorate 23(outbna) BufferBlock Decorate 25(outbnamena) DescriptorSet 0 + Decorate 25(outbnamena) Binding 0 Decorate 47 ArrayStride 16 MemberDecorate 48(outs) 0 Offset 0 MemberDecorate 48(outs) 1 Offset 16 Decorate 48(outs) BufferBlock Decorate 50(outnames) DescriptorSet 0 + Decorate 50(outnames) Binding 0 Decorate 53(gl_LocalInvocationID) BuiltIn LocalInvocationId - Decorate 64(gl_DeviceIndex) BuiltIn DeviceIndex - Decorate 70 BuiltIn WorkgroupSize + Decorate 65(gl_DeviceIndex) BuiltIn DeviceIndex + Decorate 71 BuiltIn WorkgroupSize 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 @@ -89,15 +92,15 @@ spv.310.comp 52: TypePointer Input 51(ivec3) 53(gl_LocalInvocationID): 52(ptr) Variable Input 54: TypePointer Input 6(int) - 61: TypePointer Uniform 15(int) - 63: TypePointer Input 15(int) -64(gl_DeviceIndex): 63(ptr) Variable Input - 65: 6(int) Constant 1 - 66: 6(int) Constant 3400 - 67: 6(int) Constant 16 - 68: 6(int) Constant 32 - 69: 6(int) Constant 4 - 70: 51(ivec3) ConstantComposite 67 68 69 + 62: TypePointer Uniform 15(int) + 64: TypePointer Input 15(int) +65(gl_DeviceIndex): 64(ptr) Variable Input + 66: 6(int) Constant 1 + 67: 6(int) Constant 3400 + 68: 6(int) Constant 16 + 69: 6(int) Constant 32 + 70: 6(int) Constant 4 + 71: 51(ivec3) ConstantComposite 68 69 70 4(main): 2 Function None 3 5: Label ControlBarrier 7 7 8 @@ -124,10 +127,11 @@ spv.310.comp 58: 22(fvec4) CompositeConstruct 57 57 57 57 59: 29(ptr) AccessChain 50(outnames) 26 56 Store 59 58 - 60: 15(int) ArrayLength 14(outbname) 3 - 62: 61(ptr) AccessChain 50(outnames) 16 - Store 62 60 - MemoryBarrier 65 8 - MemoryBarrier 7 66 + 60: 6(int) ArrayLength 14(outbname) 3 + 61: 15(int) Bitcast 60 + 63: 62(ptr) AccessChain 50(outnames) 16 + Store 63 61 + MemoryBarrier 66 8 + MemoryBarrier 7 67 Return FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.400.frag.out b/deps/glslang/Test/baseResults/spv.400.frag.out index a0583cff..5433e4d3 100644 --- a/deps/glslang/Test/baseResults/spv.400.frag.out +++ b/deps/glslang/Test/baseResults/spv.400.frag.out @@ -1,8 +1,5 @@ spv.400.frag -error: SPIRV-Tools Validation Errors -error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension) - OpCapability SampledRect - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 1118 @@ -57,11 +54,15 @@ error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or req Name 1115 "id" Name 1116 "gl_PrimitiveID" Decorate 17(u2drs) DescriptorSet 0 + Decorate 17(u2drs) Binding 0 Decorate 1025(arrayedSampler) DescriptorSet 0 + Decorate 1025(arrayedSampler) Binding 0 Decorate 1027(i) Flat Decorate 1038(gl_ClipDistance) BuiltIn ClipDistance Decorate 1054(samp2dr) DescriptorSet 0 + Decorate 1054(samp2dr) Binding 0 Decorate 1080(isamp2DA) DescriptorSet 0 + Decorate 1080(isamp2DA) Binding 0 Decorate 1097(gl_FragCoord) BuiltIn FragCoord Decorate 1099(vl2) Location 6 Decorate 1107(u) Flat diff --git a/deps/glslang/Test/baseResults/spv.420.geom.out b/deps/glslang/Test/baseResults/spv.420.geom.out index 45f235f4..fa91dd81 100644 --- a/deps/glslang/Test/baseResults/spv.420.geom.out +++ b/deps/glslang/Test/baseResults/spv.420.geom.out @@ -1,8 +1,4 @@ spv.420.geom -error: SPIRV-Tools Validation Errors -error: Capability GeometryStreams is not allowed by Vulkan 1.0 specification (or requires extension) - OpCapability GeometryStreams - // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 72 @@ -40,12 +36,12 @@ error: Capability GeometryStreams is not allowed by Vulkan 1.0 specification (or Decorate 9(gl_PerVertex) Block MemberDecorate 21(gl_PerVertex) 0 BuiltIn PointSize Decorate 21(gl_PerVertex) Block - Decorate 21(gl_PerVertex) Stream 0 Decorate 23 Stream 0 Decorate 28(gl_ViewportIndex) Stream 0 Decorate 28(gl_ViewportIndex) BuiltIn ViewportIndex Decorate 33(gl_InvocationID) BuiltIn InvocationId Decorate 41(s2D) DescriptorSet 0 + Decorate 41(s2D) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.8bitstorage-int.frag.out b/deps/glslang/Test/baseResults/spv.8bitstorage-int.frag.out index 96cb2ae5..12bf2aef 100644 --- a/deps/glslang/Test/baseResults/spv.8bitstorage-int.frag.out +++ b/deps/glslang/Test/baseResults/spv.8bitstorage-int.frag.out @@ -1,7 +1,7 @@ spv.8bitstorage-int.frag // Module Version 10000 // Generated by (magic number): 80007 -// Id's are bound by 171 +// Id's are bound by 172 Capability Shader Capability CapabilityUniformAndStorageBuffer8BitAccess @@ -92,6 +92,7 @@ spv.8bitstorage-int.frag MemberDecorate 17(B2) 7 Offset 236 Decorate 17(B2) BufferBlock Decorate 19(b2) DescriptorSet 0 + Decorate 19(b2) Binding 0 Decorate 22 ArrayStride 16 MemberDecorate 23(S) 0 Offset 0 MemberDecorate 23(S) 1 Offset 2 @@ -106,6 +107,7 @@ spv.8bitstorage-int.frag MemberDecorate 25(B1) 6 Offset 96 Decorate 25(B1) Block Decorate 27(b1) DescriptorSet 0 + Decorate 27(b1) Binding 0 Decorate 44 ArrayStride 16 MemberDecorate 45(S) 0 Offset 0 MemberDecorate 45(S) 1 Offset 2 @@ -123,6 +125,7 @@ spv.8bitstorage-int.frag MemberDecorate 49(B5) 7 Offset 1696 Decorate 49(B5) Block Decorate 51(b5) DescriptorSet 0 + Decorate 51(b5) Binding 0 MemberDecorate 88(S2) 0 ColMajor MemberDecorate 88(S2) 0 Offset 0 MemberDecorate 88(S2) 0 MatrixStride 16 @@ -133,6 +136,7 @@ spv.8bitstorage-int.frag MemberDecorate 90(B4) 1 Offset 80 Decorate 90(B4) BufferBlock Decorate 92(b4) DescriptorSet 0 + Decorate 92(b4) Binding 0 MemberDecorate 93(S2) 0 RowMajor MemberDecorate 93(S2) 0 Offset 0 MemberDecorate 93(S2) 0 MatrixStride 16 @@ -141,6 +145,7 @@ spv.8bitstorage-int.frag MemberDecorate 94(B3) 0 Offset 0 Decorate 94(B3) BufferBlock Decorate 96(b3) DescriptorSet 0 + Decorate 96(b3) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 8 1 @@ -203,7 +208,10 @@ spv.8bitstorage-int.frag 114: 20(int) Constant 7 115: 20(int) Constant 6 116: TypePointer Uniform 20(int) - 166: 39(ivec2) ConstantComposite 32 33 + 166: 6(int8_t) Constant 1 + 167: 6(int8_t) Constant 2 + 168: 7(i8vec2) ConstantComposite 166 167 + 170: 6(int8_t) Constant 3 4(main): 2 Function None 3 5: Label 69(x0): 68(ptr) Variable Function @@ -323,11 +331,9 @@ spv.8bitstorage-int.frag 164: 6(int8_t) Load 163 165: 28(ptr) AccessChain 19(b2) 21 Store 165 164 - 167: 7(i8vec2) SConvert 166 - 168: 42(ptr) AccessChain 19(b2) 32 - Store 168 167 - 169: 6(int8_t) SConvert 58 - 170: 28(ptr) AccessChain 19(b2) 21 - Store 170 169 + 169: 42(ptr) AccessChain 19(b2) 32 + Store 169 168 + 171: 28(ptr) AccessChain 19(b2) 21 + Store 171 170 Return FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.8bitstorage-uint.frag.out b/deps/glslang/Test/baseResults/spv.8bitstorage-uint.frag.out index 415bada4..595558d7 100644 --- a/deps/glslang/Test/baseResults/spv.8bitstorage-uint.frag.out +++ b/deps/glslang/Test/baseResults/spv.8bitstorage-uint.frag.out @@ -92,6 +92,7 @@ spv.8bitstorage-uint.frag MemberDecorate 17(B2) 7 Offset 236 Decorate 17(B2) BufferBlock Decorate 19(b2) DescriptorSet 0 + Decorate 19(b2) Binding 0 Decorate 22 ArrayStride 16 MemberDecorate 23(S) 0 Offset 0 MemberDecorate 23(S) 1 Offset 2 @@ -106,6 +107,7 @@ spv.8bitstorage-uint.frag MemberDecorate 25(B1) 6 Offset 96 Decorate 25(B1) Block Decorate 27(b1) DescriptorSet 0 + Decorate 27(b1) Binding 0 Decorate 44 ArrayStride 16 MemberDecorate 45(S) 0 Offset 0 MemberDecorate 45(S) 1 Offset 2 @@ -123,6 +125,7 @@ spv.8bitstorage-uint.frag MemberDecorate 49(B5) 7 Offset 1696 Decorate 49(B5) Block Decorate 51(b5) DescriptorSet 0 + Decorate 51(b5) Binding 0 MemberDecorate 89(S2) 0 ColMajor MemberDecorate 89(S2) 0 Offset 0 MemberDecorate 89(S2) 0 MatrixStride 16 @@ -133,6 +136,7 @@ spv.8bitstorage-uint.frag MemberDecorate 91(B4) 1 Offset 80 Decorate 91(B4) BufferBlock Decorate 93(b4) DescriptorSet 0 + Decorate 93(b4) Binding 0 MemberDecorate 94(S2) 0 RowMajor MemberDecorate 94(S2) 0 Offset 0 MemberDecorate 94(S2) 0 MatrixStride 16 @@ -141,6 +145,7 @@ spv.8bitstorage-uint.frag MemberDecorate 95(B3) 0 Offset 0 Decorate 95(B3) BufferBlock Decorate 97(b3) DescriptorSet 0 + Decorate 97(b3) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 8 0 @@ -204,8 +209,10 @@ spv.8bitstorage-uint.frag 115: 20(int) Constant 7 116: 20(int) Constant 6 117: TypePointer Uniform 9(int) - 167: 39(ivec2) ConstantComposite 82 10 - 170: 9(int) Constant 3 + 167: 6(int8_t) Constant 1 + 168: 6(int8_t) Constant 2 + 169: 7(i8vec2) ConstantComposite 167 168 + 171: 6(int8_t) Constant 3 4(main): 2 Function None 3 5: Label 69(x0): 68(ptr) Variable Function @@ -325,10 +332,8 @@ spv.8bitstorage-uint.frag 165: 6(int8_t) Load 164 166: 28(ptr) AccessChain 19(b2) 21 Store 166 165 - 168: 7(i8vec2) UConvert 167 - 169: 42(ptr) AccessChain 19(b2) 32 - Store 169 168 - 171: 6(int8_t) UConvert 170 + 170: 42(ptr) AccessChain 19(b2) 32 + Store 170 169 172: 28(ptr) AccessChain 19(b2) 21 Store 172 171 Return diff --git a/deps/glslang/Test/baseResults/spv.8bitstorage_Error-int.frag.out b/deps/glslang/Test/baseResults/spv.8bitstorage_Error-int.frag.out index 0562111b..5607670f 100644 --- a/deps/glslang/Test/baseResults/spv.8bitstorage_Error-int.frag.out +++ b/deps/glslang/Test/baseResults/spv.8bitstorage_Error-int.frag.out @@ -1,68 +1,68 @@ spv.8bitstorage_Error-int.frag ERROR: 0:54: 'structure: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:58: 'return: can't use with structs containing int8' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:61: 'int8_t: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:74: '[: does not operate on types containing (u)int8' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:75: '.: can't swizzle types containing (u)int8' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:76: 'built-in function: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:76: 'built-in function: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:76: 'built-in function: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:77: 'built-in function: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:77: 'built-in function: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:78: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform int8_t' and a right operand of type 'layout( column_major std140 offset=0) uniform int8_t' (or there is no acceptable conversion) ERROR: 0:79: '-' : wrong operand type no operation '-' exists that takes an operand of type layout( column_major std140 offset=0) uniform int8_t (or there is no acceptable conversion) ERROR: 0:80: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform int8_t' and a right operand of type ' const int' (or there is no acceptable conversion) ERROR: 0:81: '.: can't swizzle types containing (u)int8' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:82: '=: can't use with structs containing int8' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:83: 'qualifier: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:84: 'qualifier: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:85: 'qualifier: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:86: '==' : wrong operand types: no operation '==' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform int8_t' and a right operand of type 'layout( column_major std140 offset=0) uniform int8_t' (or there is no acceptable conversion) ERROR: 0:87: '=: can't use with arrays containing int8' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:88: 'constructor: 8-bit vectors only take vector types' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:89: 'constructor: 8-bit arrays not supported' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:89: 'constructor: 8-bit vectors only take vector types' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:92: 'constructor: can't construct structure containing 8-bit type' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:93: 'func2' : no matching overloaded function found ERROR: 0:99: '' : syntax error, unexpected IDENTIFIER ERROR: 26 compilation errors. No code generated. diff --git a/deps/glslang/Test/baseResults/spv.8bitstorage_Error-uint.frag.out b/deps/glslang/Test/baseResults/spv.8bitstorage_Error-uint.frag.out index 93070f2a..c55a6309 100644 --- a/deps/glslang/Test/baseResults/spv.8bitstorage_Error-uint.frag.out +++ b/deps/glslang/Test/baseResults/spv.8bitstorage_Error-uint.frag.out @@ -1,68 +1,68 @@ spv.8bitstorage_Error-uint.frag ERROR: 0:54: 'structure: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:58: 'return: can't use with structs containing uint8' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:61: 'uint8_t: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:74: '[: does not operate on types containing (u)int8' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:75: '.: can't swizzle types containing (u)int8' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:76: 'built-in function: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:76: 'built-in function: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:76: 'built-in function: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:77: 'built-in function: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:77: 'built-in function: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:78: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform uint8_t' and a right operand of type 'layout( column_major std140 offset=0) uniform uint8_t' (or there is no acceptable conversion) ERROR: 0:79: '-' : wrong operand type no operation '-' exists that takes an operand of type layout( column_major std140 offset=0) uniform uint8_t (or there is no acceptable conversion) ERROR: 0:80: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform uint8_t' and a right operand of type ' const int' (or there is no acceptable conversion) ERROR: 0:81: '.: can't swizzle types containing (u)int8' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:82: '=: can't use with structs containing uint8' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:83: 'qualifier: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:84: 'qualifier: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:85: 'qualifier: (u)int8 types can only be in uniform block or buffer storage' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:86: '==' : wrong operand types: no operation '==' exists that takes a left-hand operand of type 'layout( column_major std140 offset=0) uniform uint8_t' and a right operand of type 'layout( column_major std140 offset=0) uniform uint8_t' (or there is no acceptable conversion) ERROR: 0:87: '=: can't use with arrays containing uint8' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:88: 'constructor: 8-bit vectors only take vector types' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:89: 'constructor: 8-bit arrays not supported' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:89: 'constructor: 8-bit vectors only take vector types' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:92: 'constructor: can't construct structure containing 8-bit type' : required extension not requested: Possible extensions include: -GL_KHX_shader_explicit_arithmetic_types -GL_KHX_shader_explicit_arithmetic_types_int8 +GL_EXT_shader_explicit_arithmetic_types +GL_EXT_shader_explicit_arithmetic_types_int8 ERROR: 0:93: 'func2' : no matching overloaded function found ERROR: 0:99: '' : syntax error, unexpected IDENTIFIER ERROR: 26 compilation errors. No code generated. diff --git a/deps/glslang/Test/baseResults/spv.AofA.frag.out b/deps/glslang/Test/baseResults/spv.AofA.frag.out index 798f083a..7433f177 100644 --- a/deps/glslang/Test/baseResults/spv.AofA.frag.out +++ b/deps/glslang/Test/baseResults/spv.AofA.frag.out @@ -1,10 +1,7 @@ spv.AofA.frag WARNING: 0:6: '[][]' : Generating SPIR-V array-of-arrays, but Vulkan only supports single array level for this resource -error: SPIRV-Tools Validation Errors -error: Only a single level of array is allowed for descriptor set variables - %nameAofA = OpVariable %_ptr_Uniform__arr__arr_uAofA_uint_5_uint_3 Uniform - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 104 @@ -41,6 +38,7 @@ error: Only a single level of array is allowed for descriptor set variables MemberDecorate 94(uAofA) 0 Offset 0 Decorate 94(uAofA) Block Decorate 98(nameAofA) DescriptorSet 0 + Decorate 98(nameAofA) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.RayGenShader.rgen.out b/deps/glslang/Test/baseResults/spv.RayGenShader.rgen.out index db6ecfc9..7e15f269 100644 --- a/deps/glslang/Test/baseResults/spv.RayGenShader.rgen.out +++ b/deps/glslang/Test/baseResults/spv.RayGenShader.rgen.out @@ -1,7 +1,7 @@ spv.RayGenShader.rgen // Module Version 10000 // Generated by (magic number): 80007 -// Id's are bound by 60 +// Id's are bound by 61 Capability RayTracingNV Extension "SPV_NV_ray_tracing" @@ -17,21 +17,24 @@ spv.RayGenShader.rgen Name 20 "sx" Name 21 "gl_LaunchSizeNV" Name 24 "sy" - Name 29 "accNV" + Name 29 "accNV0" Name 48 "block" MemberName 48(block) 0 "arr" MemberName 48(block) 1 "pad" Name 50 "" Name 56 "payload" + Name 60 "accNV1" Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV Decorate 21(gl_LaunchSizeNV) BuiltIn LaunchSizeNV - Decorate 29(accNV) DescriptorSet 0 - Decorate 29(accNV) Binding 0 + Decorate 29(accNV0) DescriptorSet 0 + Decorate 29(accNV0) Binding 0 Decorate 46 ArrayStride 4 MemberDecorate 48(block) 0 Offset 0 MemberDecorate 48(block) 1 Offset 16 Decorate 48(block) BufferBlock Decorate 56(payload) Location 0 + Decorate 60(accNV1) DescriptorSet 0 + Decorate 60(accNV1) Binding 1 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 @@ -45,7 +48,7 @@ spv.RayGenShader.rgen 21(gl_LaunchSizeNV): 10(ptr) Variable Input 27: TypeAccelerationStructureNV 28: TypePointer UniformConstant 27 - 29(accNV): 28(ptr) Variable UniformConstant + 29(accNV0): 28(ptr) Variable UniformConstant 35: TypeFloat 32 36: TypeVector 35(float) 3 37: 35(float) Constant 0 @@ -68,6 +71,7 @@ spv.RayGenShader.rgen 55: TypePointer RayPayloadNV 47(fvec4) 56(payload): 55(ptr) Variable RayPayloadNV 58: TypePointer ShaderRecordBufferNV 47(fvec4) + 60(accNV1): 28(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 8(lx): 7(ptr) Variable Function @@ -86,7 +90,7 @@ spv.RayGenShader.rgen 25: 13(ptr) AccessChain 21(gl_LaunchSizeNV) 17 26: 6(int) Load 25 Store 24(sy) 26 - 30: 27 Load 29(accNV) + 30: 27 Load 29(accNV0) 31: 6(int) Load 8(lx) 32: 6(int) Load 16(ly) 33: 6(int) Load 20(sx) diff --git a/deps/glslang/Test/baseResults/spv.RayGenShader11.rgen.out b/deps/glslang/Test/baseResults/spv.RayGenShader11.rgen.out new file mode 100644 index 00000000..b0995817 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.RayGenShader11.rgen.out @@ -0,0 +1,101 @@ +spv.RayGenShader11.rgen +// Module Version 10300 +// Generated by (magic number): 80007 +// Id's are bound by 60 + + Capability RayTracingNV + Extension "SPV_NV_ray_tracing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint RayGenerationNV 4 "main" 11 21 + Source GLSL 460 + SourceExtension "GL_NV_ray_tracing" + Name 4 "main" + Name 8 "lx" + Name 11 "gl_LaunchIDNV" + Name 16 "ly" + Name 20 "sx" + Name 21 "gl_LaunchSizeNV" + Name 24 "sy" + Name 29 "accNV" + Name 48 "block" + MemberName 48(block) 0 "arr" + MemberName 48(block) 1 "pad" + Name 50 "" + Name 56 "payload" + Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV + Decorate 21(gl_LaunchSizeNV) BuiltIn LaunchSizeNV + Decorate 29(accNV) DescriptorSet 0 + Decorate 29(accNV) Binding 0 + Decorate 46 ArrayStride 4 + MemberDecorate 48(block) 0 Offset 0 + MemberDecorate 48(block) 1 Offset 16 + Decorate 48(block) Block + Decorate 56(payload) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypeVector 6(int) 3 + 10: TypePointer Input 9(ivec3) +11(gl_LaunchIDNV): 10(ptr) Variable Input + 12: 6(int) Constant 0 + 13: TypePointer Input 6(int) + 17: 6(int) Constant 1 +21(gl_LaunchSizeNV): 10(ptr) Variable Input + 27: TypeAccelerationStructureNV + 28: TypePointer UniformConstant 27 + 29(accNV): 28(ptr) Variable UniformConstant + 35: TypeFloat 32 + 36: TypeVector 35(float) 3 + 37: 35(float) Constant 0 + 38: 36(fvec3) ConstantComposite 37 37 37 + 39: 35(float) Constant 1056964608 + 40: 35(float) Constant 1065353216 + 41: 36(fvec3) ConstantComposite 40 40 40 + 42: 35(float) Constant 1061158912 + 43: TypeInt 32 1 + 44: 43(int) Constant 1 + 45: 6(int) Constant 4 + 46: TypeArray 35(float) 45 + 47: TypeVector 35(float) 4 + 48(block): TypeStruct 46 47(fvec4) + 49: TypePointer ShaderRecordBufferNV 48(block) + 50: 49(ptr) Variable ShaderRecordBufferNV + 51: 43(int) Constant 0 + 52: 43(int) Constant 3 + 53: TypePointer ShaderRecordBufferNV 35(float) + 55: TypePointer RayPayloadNV 47(fvec4) + 56(payload): 55(ptr) Variable RayPayloadNV + 58: TypePointer ShaderRecordBufferNV 47(fvec4) + 4(main): 2 Function None 3 + 5: Label + 8(lx): 7(ptr) Variable Function + 16(ly): 7(ptr) Variable Function + 20(sx): 7(ptr) Variable Function + 24(sy): 7(ptr) Variable Function + 14: 13(ptr) AccessChain 11(gl_LaunchIDNV) 12 + 15: 6(int) Load 14 + Store 8(lx) 15 + 18: 13(ptr) AccessChain 11(gl_LaunchIDNV) 17 + 19: 6(int) Load 18 + Store 16(ly) 19 + 22: 13(ptr) AccessChain 21(gl_LaunchSizeNV) 12 + 23: 6(int) Load 22 + Store 20(sx) 23 + 25: 13(ptr) AccessChain 21(gl_LaunchSizeNV) 17 + 26: 6(int) Load 25 + Store 24(sy) 26 + 30: 27 Load 29(accNV) + 31: 6(int) Load 8(lx) + 32: 6(int) Load 16(ly) + 33: 6(int) Load 20(sx) + 34: 6(int) Load 24(sy) + TraceNV 30 31 32 33 34 12 38 39 41 42 44 + 54: 53(ptr) AccessChain 50 51 52 + Store 54 40 + 57: 47(fvec4) Load 56(payload) + 59: 58(ptr) AccessChain 50 44 + Store 59 57 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.aggOps.frag.out b/deps/glslang/Test/baseResults/spv.aggOps.frag.out index 1c0c7e91..f388e8ea 100644 --- a/deps/glslang/Test/baseResults/spv.aggOps.frag.out +++ b/deps/glslang/Test/baseResults/spv.aggOps.frag.out @@ -52,6 +52,7 @@ WARNING: 0:4: '' : all default precisions are highp; use precision statements to MemberDecorate 57(ub1) 0 Offset 0 Decorate 57(ub1) Block Decorate 59(uName1) DescriptorSet 0 + Decorate 59(uName1) Binding 0 MemberDecorate 64(s1) 0 Offset 0 MemberDecorate 64(s1) 1 Offset 4 MemberDecorate 65(s2) 0 Offset 0 @@ -60,7 +61,9 @@ WARNING: 0:4: '' : all default precisions are highp; use precision statements to MemberDecorate 66(ub2) 0 Offset 0 Decorate 66(ub2) BufferBlock Decorate 68(uName2) DescriptorSet 0 + Decorate 68(uName2) Binding 0 Decorate 97(samp2D) DescriptorSet 0 + Decorate 97(samp2D) Binding 0 Decorate 101(coord) RelaxedPrecision Decorate 102 RelaxedPrecision Decorate 107 RelaxedPrecision diff --git a/deps/glslang/Test/baseResults/spv.bool.vert.out b/deps/glslang/Test/baseResults/spv.bool.vert.out index becd707a..31eb54cf 100644 --- a/deps/glslang/Test/baseResults/spv.bool.vert.out +++ b/deps/glslang/Test/baseResults/spv.bool.vert.out @@ -29,6 +29,7 @@ spv.bool.vert MemberDecorate 27(ubname) 0 Offset 0 Decorate 27(ubname) Block Decorate 29(ubinst) DescriptorSet 0 + Decorate 29(ubinst) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeBool diff --git a/deps/glslang/Test/baseResults/spv.bufferhandle1.frag.out b/deps/glslang/Test/baseResults/spv.bufferhandle1.frag.out new file mode 100644 index 00000000..906cb51a --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.bufferhandle1.frag.out @@ -0,0 +1,104 @@ +spv.bufferhandle1.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 52 + + Capability Shader + Capability CapabilityVulkanMemoryModelKHR + Capability CapabilityPhysicalStorageBufferAddressesEXT + Extension "SPV_EXT_physical_storage_buffer" + Extension "SPV_KHR_storage_buffer_storage_class" + Extension "SPV_KHR_vulkan_memory_model" + 1: ExtInstImport "GLSL.std.450" + MemoryModel PhysicalStorageBuffer64EXT VulkanKHR + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_buffer_reference" + Name 4 "main" + Name 7 "t2" + MemberName 7(t2) 0 "f" + MemberName 7(t2) 1 "g" + Name 13 "blockType" + MemberName 13(blockType) 0 "a" + MemberName 13(blockType) 1 "b" + MemberName 13(blockType) 2 "c" + MemberName 13(blockType) 3 "d" + MemberName 13(blockType) 4 "e" + MemberName 13(blockType) 5 "f" + MemberName 13(blockType) 6 "g" + Name 15 "t" + Name 28 "j" + MemberDecorate 7(t2) 0 Offset 0 + MemberDecorate 7(t2) 1 Offset 8 + Decorate 7(t2) Block + Decorate 11 ArrayStride 4 + MemberDecorate 13(blockType) 0 Offset 0 + MemberDecorate 13(blockType) 1 Offset 4 + MemberDecorate 13(blockType) 2 Offset 8 + MemberDecorate 13(blockType) 3 Offset 12 + MemberDecorate 13(blockType) 4 Offset 16 + MemberDecorate 13(blockType) 5 Offset 32 + MemberDecorate 13(blockType) 6 Offset 48 + Decorate 13(blockType) Block + Decorate 15(t) DescriptorSet 0 + Decorate 15(t) Binding 0 + Decorate 28(j) DecorationAliasedPointerEXT + 2: TypeVoid + 3: TypeFunction 2 + TypeForwardPointer 6 PhysicalStorageBufferEXT + 7(t2): TypeStruct 6 6 + 8: TypeInt 32 1 + 9: TypeInt 32 0 + 10: 9(int) Constant 2 + 11: TypeArray 8(int) 10 + 12: TypeVector 8(int) 4 + 13(blockType): TypeStruct 8(int) 8(int) 8(int) 8(int) 8(int) 11 12(ivec4) + 6: TypePointer PhysicalStorageBufferEXT 13(blockType) + 14: TypePointer StorageBuffer 7(t2) + 15(t): 14(ptr) Variable StorageBuffer + 16: 8(int) Constant 0 + 17: TypePointer StorageBuffer 6(ptr) + 20: 8(int) Constant 1 + 23: TypePointer PhysicalStorageBufferEXT 8(int) + 27: TypePointer Function 6(ptr) + 32: 8(int) Constant 3 + 34: 8(int) Constant 2 + 40: 8(int) Constant 5 + 46: 8(int) Constant 6 + 47: 9(int) Constant 1 + 50: 9(int) Constant 5 + 4(main): 2 Function None 3 + 5: Label + 28(j): 27(ptr) Variable Function + 18: 17(ptr) AccessChain 15(t) 16 + 19: 6(ptr) Load 18 + 21: 17(ptr) AccessChain 15(t) 20 + 22: 6(ptr) Load 21 + 24: 23(ptr) AccessChain 22 16 + 25: 8(int) Load 24 Aligned 16 + 26: 23(ptr) AccessChain 19 20 + Store 26 25 Aligned 4 + 29: 17(ptr) AccessChain 15(t) 16 + 30: 6(ptr) Load 29 + Store 28(j) 30 + 31: 6(ptr) Load 28(j) + 33: 6(ptr) Load 28(j) + 35: 23(ptr) AccessChain 33 34 + 36: 8(int) Load 35 Aligned 8 + 37: 23(ptr) AccessChain 31 32 + Store 37 36 Aligned 4 + 38: 6(ptr) Load 28(j) + 39: 6(ptr) Load 28(j) + 41: 23(ptr) AccessChain 39 40 20 + 42: 8(int) Load 41 Aligned 4 + 43: 23(ptr) AccessChain 38 32 + Store 43 42 Aligned 4 + 44: 6(ptr) Load 28(j) + 45: 6(ptr) Load 28(j) + 48: 23(ptr) AccessChain 45 46 47 + 49: 8(int) Load 48 Aligned MakePointerVisibleKHR NonPrivatePointerKHR 4 50 + 51: 23(ptr) AccessChain 44 32 + Store 51 49 Aligned 4 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.bufferhandle10.frag.out b/deps/glslang/Test/baseResults/spv.bufferhandle10.frag.out new file mode 100644 index 00000000..bfaa2d8a --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.bufferhandle10.frag.out @@ -0,0 +1,73 @@ +spv.bufferhandle10.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 34 + + Capability Shader + Capability CapabilityVulkanMemoryModelKHR + Capability CapabilityPhysicalStorageBufferAddressesEXT + Extension "SPV_EXT_physical_storage_buffer" + Extension "SPV_KHR_storage_buffer_storage_class" + Extension "SPV_KHR_vulkan_memory_model" + 1: ExtInstImport "GLSL.std.450" + MemoryModel PhysicalStorageBuffer64EXT VulkanKHR + EntryPoint Fragment 4 "main" 19 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_ARB_gpu_shader_int64" + SourceExtension "GL_EXT_buffer_reference" + Name 4 "main" + Name 7 "t2" + MemberName 7(t2) 0 "f" + Name 10 "blockType" + MemberName 10(blockType) 0 "x" + Name 12 "t" + Name 19 "i" + Name 28 "b" + MemberDecorate 7(t2) 0 Offset 0 + Decorate 7(t2) Block + Decorate 9 ArrayStride 4 + MemberDecorate 10(blockType) 0 Offset 0 + Decorate 10(blockType) Block + Decorate 12(t) DescriptorSet 0 + Decorate 12(t) Binding 0 + Decorate 19(i) Flat + Decorate 19(i) Location 0 + Decorate 28(b) DecorationAliasedPointerEXT + 2: TypeVoid + 3: TypeFunction 2 + TypeForwardPointer 6 PhysicalStorageBufferEXT + 7(t2): TypeStruct 6 + 8: TypeInt 32 0 + 9: TypeRuntimeArray 8(int) + 10(blockType): TypeStruct 9 + 6: TypePointer PhysicalStorageBufferEXT 10(blockType) + 11: TypePointer StorageBuffer 7(t2) + 12(t): 11(ptr) Variable StorageBuffer + 13: TypeInt 32 1 + 14: 13(int) Constant 0 + 15: TypePointer StorageBuffer 6(ptr) + 18: TypePointer Input 8(int) + 19(i): 18(ptr) Variable Input + 21: TypePointer PhysicalStorageBufferEXT 8(int) + 23: 8(int) Constant 1 + 24: 8(int) Constant 5 + 25: 8(int) Constant 0 + 27: TypePointer Function 6(ptr) + 32: 8(int) Constant 2 + 4(main): 2 Function None 3 + 5: Label + 28(b): 27(ptr) Variable Function + 16: 15(ptr) AccessChain 12(t) 14 + 17: 6(ptr) Load 16 + 20: 8(int) Load 19(i) + 22: 21(ptr) AccessChain 17 14 20 + 26: 8(int) AtomicIAdd 22 24 25 23 + 29: 15(ptr) AccessChain 12(t) 14 + 30: 6(ptr) Load 29 + Store 28(b) 30 + 31: 6(ptr) Load 28(b) + 33: 21(ptr) AccessChain 31 14 14 + Store 33 32 Aligned MakePointerAvailableKHR NonPrivatePointerKHR 4 24 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.bufferhandle11.frag.out b/deps/glslang/Test/baseResults/spv.bufferhandle11.frag.out new file mode 100644 index 00000000..0764a003 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.bufferhandle11.frag.out @@ -0,0 +1,118 @@ +spv.bufferhandle11.frag +WARNING: 0:6: '' : all default precisions are highp; use precision statements to quiet warning, e.g.: + "precision mediump int; precision highp float;" + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 60 + + Capability Shader + Capability CapabilityStorageBuffer8BitAccess + Capability CapabilityPhysicalStorageBufferAddressesEXT + Extension "SPV_EXT_physical_storage_buffer" + Extension "SPV_KHR_8bit_storage" + Extension "SPV_KHR_storage_buffer_storage_class" + 1: ExtInstImport "GLSL.std.450" + MemoryModel PhysicalStorageBuffer64EXT GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_buffer_reference" + SourceExtension "GL_EXT_shader_16bit_storage" + SourceExtension "GL_EXT_shader_8bit_storage" + Name 4 "main" + Name 12 "compare_uint8_t(u1;u1;" + Name 10 "a" + Name 11 "b" + Name 20 "allOk" + Name 26 "PC" + MemberName 26(PC) 0 "block" + Name 28 "Block" + MemberName 28(Block) 0 "var" + Name 30 "" + Name 41 "param" + Name 42 "param" + Name 48 "AcBlock" + MemberName 48(AcBlock) 0 "ac_numPassed" + Name 50 "" + MemberDecorate 26(PC) 0 Offset 0 + Decorate 26(PC) Block + MemberDecorate 28(Block) 0 Offset 0 + Decorate 28(Block) Block + MemberDecorate 48(AcBlock) 0 Offset 0 + Decorate 48(AcBlock) Block + Decorate 50 DescriptorSet 0 + Decorate 50 Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 8: TypeBool + 9: TypeFunction 8(bool) 7(ptr) 7(ptr) + 19: TypePointer Function 8(bool) + 21: 8(bool) ConstantTrue + TypeForwardPointer 25 PhysicalStorageBufferEXT + 26(PC): TypeStruct 25 + 27: TypeInt 8 0 + 28(Block): TypeStruct 27(int8_t) + 25: TypePointer PhysicalStorageBufferEXT 28(Block) + 29: TypePointer PushConstant 26(PC) + 30: 29(ptr) Variable PushConstant + 31: TypeInt 32 1 + 32: 31(int) Constant 0 + 33: TypePointer PushConstant 25(ptr) + 36: TypePointer PhysicalStorageBufferEXT 27(int8_t) + 40: 6(int) Constant 7 + 48(AcBlock): TypeStruct 6(int) + 49: TypePointer StorageBuffer 48(AcBlock) + 50: 49(ptr) Variable StorageBuffer + 51: TypePointer StorageBuffer 6(int) + 54: 31(int) Constant 1 + 58: 27(int8_t) Constant 9 + 4(main): 2 Function None 3 + 5: Label + 20(allOk): 19(ptr) Variable Function + 41(param): 7(ptr) Variable Function + 42(param): 7(ptr) Variable Function + Store 20(allOk) 21 + 22: 8(bool) Load 20(allOk) + SelectionMerge 24 None + BranchConditional 22 23 24 + 23: Label + 34: 33(ptr) AccessChain 30 32 + 35: 25(ptr) Load 34 + 37: 36(ptr) AccessChain 35 32 + 38: 27(int8_t) Load 37 Aligned 16 + 39: 6(int) UConvert 38 + Store 41(param) 39 + Store 42(param) 40 + 43: 8(bool) FunctionCall 12(compare_uint8_t(u1;u1;) 41(param) 42(param) + Branch 24 + 24: Label + 44: 8(bool) Phi 22 5 43 23 + Store 20(allOk) 44 + 45: 8(bool) Load 20(allOk) + SelectionMerge 47 None + BranchConditional 45 46 47 + 46: Label + 52: 51(ptr) AccessChain 50 32 + 53: 6(int) Load 52 + 55: 6(int) IAdd 53 54 + Store 52 55 + Branch 47 + 47: Label + 56: 33(ptr) AccessChain 30 32 + 57: 25(ptr) Load 56 + 59: 36(ptr) AccessChain 57 32 + Store 59 58 Aligned 16 + Return + FunctionEnd +12(compare_uint8_t(u1;u1;): 8(bool) Function None 9 + 10(a): 7(ptr) FunctionParameter + 11(b): 7(ptr) FunctionParameter + 13: Label + 14: 6(int) Load 10(a) + 15: 6(int) Load 11(b) + 16: 8(bool) IEqual 14 15 + ReturnValue 16 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.bufferhandle12.frag.out b/deps/glslang/Test/baseResults/spv.bufferhandle12.frag.out new file mode 100644 index 00000000..38b390ff --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.bufferhandle12.frag.out @@ -0,0 +1,306 @@ +spv.bufferhandle12.frag +WARNING: 0:6: '' : all default precisions are highp; use precision statements to quiet warning, e.g.: + "precision mediump int; precision highp float;" + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 183 + + Capability Shader + Capability StorageUniformBufferBlock16 + Capability CapabilityPhysicalStorageBufferAddressesEXT + Extension "SPV_EXT_physical_storage_buffer" + Extension "SPV_KHR_16bit_storage" + Extension "SPV_KHR_storage_buffer_storage_class" + 1: ExtInstImport "GLSL.std.450" + MemoryModel PhysicalStorageBuffer64EXT GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_buffer_reference" + SourceExtension "GL_EXT_shader_16bit_storage" + SourceExtension "GL_EXT_shader_8bit_storage" + Name 4 "main" + Name 12 "compare_float(f1;f1;" + Name 10 "a" + Name 11 "b" + Name 19 "compare_vec3(vf3;vf3;" + Name 17 "a" + Name 18 "b" + Name 26 "compare_mat2x3(mf23;mf23;" + Name 24 "a" + Name 25 "b" + Name 34 "compare_ivec2(vi2;vi2;" + Name 32 "a" + Name 33 "b" + Name 42 "compare_uvec3(vu3;vu3;" + Name 40 "a" + Name 41 "b" + Name 46 "compare_float16_t(f1;f1;" + Name 44 "a" + Name 45 "b" + Name 56 "param" + Name 60 "param" + Name 66 "param" + Name 70 "param" + Name 77 "param" + Name 81 "param" + Name 89 "param" + Name 92 "param" + Name 99 "param" + Name 102 "param" + Name 131 "allOk" + Name 139 "PC" + MemberName 139(PC) 0 "blockB" + MemberName 139(PC) 1 "blockC" + MemberName 139(PC) 2 "blockD" + Name 141 "BlockB" + MemberName 141(BlockB) 0 "a" + MemberName 141(BlockB) 1 "b" + Name 142 "BlockC" + MemberName 142(BlockC) 0 "c" + Name 143 "BlockD" + MemberName 143(BlockD) 0 "d" + Name 145 "" + Name 157 "param" + Name 161 "param" + Name 167 "AcBlock" + MemberName 167(AcBlock) 0 "ac_numPassed" + Name 169 "" + MemberDecorate 139(PC) 0 Offset 0 + MemberDecorate 139(PC) 1 Offset 8 + MemberDecorate 139(PC) 2 Offset 16 + Decorate 139(PC) Block + MemberDecorate 141(BlockB) 0 Offset 0 + MemberDecorate 141(BlockB) 1 Offset 8 + Decorate 141(BlockB) Block + MemberDecorate 142(BlockC) 0 ColMajor + MemberDecorate 142(BlockC) 0 RelaxedPrecision + MemberDecorate 142(BlockC) 0 Offset 0 + MemberDecorate 142(BlockC) 0 MatrixStride 16 + Decorate 142(BlockC) Block + MemberDecorate 143(BlockD) 0 RelaxedPrecision + MemberDecorate 143(BlockD) 0 Offset 0 + Decorate 143(BlockD) Block + Decorate 160 RelaxedPrecision + MemberDecorate 167(AcBlock) 0 Offset 0 + Decorate 167(AcBlock) Block + Decorate 169 DescriptorSet 0 + Decorate 169 Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeBool + 9: TypeFunction 8(bool) 7(ptr) 7(ptr) + 14: TypeVector 6(float) 3 + 15: TypePointer Function 14(fvec3) + 16: TypeFunction 8(bool) 15(ptr) 15(ptr) + 21: TypeMatrix 14(fvec3) 2 + 22: TypePointer Function 21 + 23: TypeFunction 8(bool) 22(ptr) 22(ptr) + 28: TypeInt 32 1 + 29: TypeVector 28(int) 2 + 30: TypePointer Function 29(ivec2) + 31: TypeFunction 8(bool) 30(ptr) 30(ptr) + 36: TypeInt 32 0 + 37: TypeVector 36(int) 3 + 38: TypePointer Function 37(ivec3) + 39: TypeFunction 8(bool) 38(ptr) 38(ptr) + 52: 6(float) Constant 1028443341 + 57: 36(int) Constant 0 + 67: 36(int) Constant 1 + 78: 36(int) Constant 2 + 88: 28(int) Constant 0 + 98: 28(int) Constant 1 + 111: TypeVector 8(bool) 2 + 118: TypeVector 8(bool) 3 + 130: TypePointer Function 8(bool) + 132: 8(bool) ConstantTrue + TypeForwardPointer 136 PhysicalStorageBufferEXT + TypeForwardPointer 137 PhysicalStorageBufferEXT + TypeForwardPointer 138 PhysicalStorageBufferEXT + 139(PC): TypeStruct 136 137 138 + 140: TypeFloat 16 + 141(BlockB): TypeStruct 140(float16_t) 29(ivec2) + 136: TypePointer PhysicalStorageBufferEXT 141(BlockB) + 142(BlockC): TypeStruct 21 + 137: TypePointer PhysicalStorageBufferEXT 142(BlockC) + 143(BlockD): TypeStruct 37(ivec3) + 138: TypePointer PhysicalStorageBufferEXT 143(BlockD) + 144: TypePointer PushConstant 139(PC) + 145: 144(ptr) Variable PushConstant + 146: TypePointer PushConstant 137(ptr) + 149: 6(float) Constant 3231711232 + 150: 6(float) Constant 1065353216 + 151: 6(float) Constant 3235905536 + 152: 14(fvec3) ConstantComposite 149 150 151 + 153: 6(float) Constant 1073741824 + 154: 6(float) Constant 1090519040 + 155: 14(fvec3) ConstantComposite 150 153 154 + 156: 21 ConstantComposite 152 155 + 158: TypePointer PhysicalStorageBufferEXT 21 + 167(AcBlock): TypeStruct 36(int) + 168: TypePointer StorageBuffer 167(AcBlock) + 169: 168(ptr) Variable StorageBuffer + 170: TypePointer StorageBuffer 36(int) + 174: 28(int) Constant 2 + 175: TypePointer PushConstant 138(ptr) + 178: 36(int) Constant 8 + 179: 36(int) Constant 5 + 180: 37(ivec3) ConstantComposite 178 67 179 + 181: TypePointer PhysicalStorageBufferEXT 37(ivec3) + 4(main): 2 Function None 3 + 5: Label + 131(allOk): 130(ptr) Variable Function + 157(param): 22(ptr) Variable Function + 161(param): 22(ptr) Variable Function + Store 131(allOk) 132 + 133: 8(bool) Load 131(allOk) + SelectionMerge 135 None + BranchConditional 133 134 135 + 134: Label + 147: 146(ptr) AccessChain 145 98 + 148: 137(ptr) Load 147 + 159: 158(ptr) AccessChain 148 88 + 160: 21 Load 159 Aligned 16 + Store 157(param) 160 + Store 161(param) 156 + 162: 8(bool) FunctionCall 26(compare_mat2x3(mf23;mf23;) 157(param) 161(param) + Branch 135 + 135: Label + 163: 8(bool) Phi 133 5 162 134 + Store 131(allOk) 163 + 164: 8(bool) Load 131(allOk) + SelectionMerge 166 None + BranchConditional 164 165 166 + 165: Label + 171: 170(ptr) AccessChain 169 88 + 172: 36(int) Load 171 + 173: 36(int) IAdd 172 98 + Store 171 173 + Branch 166 + 166: Label + 176: 175(ptr) AccessChain 145 174 + 177: 138(ptr) Load 176 + 182: 181(ptr) AccessChain 177 88 + Store 182 180 Aligned 16 + Return + FunctionEnd +12(compare_float(f1;f1;): 8(bool) Function None 9 + 10(a): 7(ptr) FunctionParameter + 11(b): 7(ptr) FunctionParameter + 13: Label + 48: 6(float) Load 10(a) + 49: 6(float) Load 11(b) + 50: 6(float) FSub 48 49 + 51: 6(float) ExtInst 1(GLSL.std.450) 4(FAbs) 50 + 53: 8(bool) FOrdLessThan 51 52 + ReturnValue 53 + FunctionEnd +19(compare_vec3(vf3;vf3;): 8(bool) Function None 16 + 17(a): 15(ptr) FunctionParameter + 18(b): 15(ptr) FunctionParameter + 20: Label + 56(param): 7(ptr) Variable Function + 60(param): 7(ptr) Variable Function + 66(param): 7(ptr) Variable Function + 70(param): 7(ptr) Variable Function + 77(param): 7(ptr) Variable Function + 81(param): 7(ptr) Variable Function + 58: 7(ptr) AccessChain 17(a) 57 + 59: 6(float) Load 58 + Store 56(param) 59 + 61: 7(ptr) AccessChain 18(b) 57 + 62: 6(float) Load 61 + Store 60(param) 62 + 63: 8(bool) FunctionCall 12(compare_float(f1;f1;) 56(param) 60(param) + SelectionMerge 65 None + BranchConditional 63 64 65 + 64: Label + 68: 7(ptr) AccessChain 17(a) 67 + 69: 6(float) Load 68 + Store 66(param) 69 + 71: 7(ptr) AccessChain 18(b) 67 + 72: 6(float) Load 71 + Store 70(param) 72 + 73: 8(bool) FunctionCall 12(compare_float(f1;f1;) 66(param) 70(param) + Branch 65 + 65: Label + 74: 8(bool) Phi 63 20 73 64 + SelectionMerge 76 None + BranchConditional 74 75 76 + 75: Label + 79: 7(ptr) AccessChain 17(a) 78 + 80: 6(float) Load 79 + Store 77(param) 80 + 82: 7(ptr) AccessChain 18(b) 78 + 83: 6(float) Load 82 + Store 81(param) 83 + 84: 8(bool) FunctionCall 12(compare_float(f1;f1;) 77(param) 81(param) + Branch 76 + 76: Label + 85: 8(bool) Phi 74 65 84 75 + ReturnValue 85 + FunctionEnd +26(compare_mat2x3(mf23;mf23;): 8(bool) Function None 23 + 24(a): 22(ptr) FunctionParameter + 25(b): 22(ptr) FunctionParameter + 27: Label + 89(param): 15(ptr) Variable Function + 92(param): 15(ptr) Variable Function + 99(param): 15(ptr) Variable Function + 102(param): 15(ptr) Variable Function + 90: 15(ptr) AccessChain 24(a) 88 + 91: 14(fvec3) Load 90 + Store 89(param) 91 + 93: 15(ptr) AccessChain 25(b) 88 + 94: 14(fvec3) Load 93 + Store 92(param) 94 + 95: 8(bool) FunctionCall 19(compare_vec3(vf3;vf3;) 89(param) 92(param) + SelectionMerge 97 None + BranchConditional 95 96 97 + 96: Label + 100: 15(ptr) AccessChain 24(a) 98 + 101: 14(fvec3) Load 100 + Store 99(param) 101 + 103: 15(ptr) AccessChain 25(b) 98 + 104: 14(fvec3) Load 103 + Store 102(param) 104 + 105: 8(bool) FunctionCall 19(compare_vec3(vf3;vf3;) 99(param) 102(param) + Branch 97 + 97: Label + 106: 8(bool) Phi 95 27 105 96 + ReturnValue 106 + FunctionEnd +34(compare_ivec2(vi2;vi2;): 8(bool) Function None 31 + 32(a): 30(ptr) FunctionParameter + 33(b): 30(ptr) FunctionParameter + 35: Label + 109: 29(ivec2) Load 32(a) + 110: 29(ivec2) Load 33(b) + 112: 111(bvec2) IEqual 109 110 + 113: 8(bool) All 112 + ReturnValue 113 + FunctionEnd +42(compare_uvec3(vu3;vu3;): 8(bool) Function None 39 + 40(a): 38(ptr) FunctionParameter + 41(b): 38(ptr) FunctionParameter + 43: Label + 116: 37(ivec3) Load 40(a) + 117: 37(ivec3) Load 41(b) + 119: 118(bvec3) IEqual 116 117 + 120: 8(bool) All 119 + ReturnValue 120 + FunctionEnd +46(compare_float16_t(f1;f1;): 8(bool) Function None 9 + 44(a): 7(ptr) FunctionParameter + 45(b): 7(ptr) FunctionParameter + 47: Label + 123: 6(float) Load 44(a) + 124: 6(float) Load 45(b) + 125: 6(float) FSub 123 124 + 126: 6(float) ExtInst 1(GLSL.std.450) 4(FAbs) 125 + 127: 8(bool) FOrdLessThan 126 52 + ReturnValue 127 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.bufferhandle13.frag.out b/deps/glslang/Test/baseResults/spv.bufferhandle13.frag.out new file mode 100644 index 00000000..8c12c4fe --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.bufferhandle13.frag.out @@ -0,0 +1,116 @@ +spv.bufferhandle13.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 58 + + Capability Shader + Capability CapabilityPhysicalStorageBufferAddressesEXT + Extension "SPV_EXT_physical_storage_buffer" + Extension "SPV_KHR_storage_buffer_storage_class" + 1: ExtInstImport "GLSL.std.450" + MemoryModel PhysicalStorageBuffer64EXT GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_buffer_reference" + Name 4 "main" + Name 8 "t4" + MemberName 8(t4) 0 "j" + Name 11 "f1(1;" + Name 10 "y" + Name 16 "f2(1;" + Name 15 "y" + Name 19 "f3(1;" + Name 18 "y" + Name 22 "f4(1;" + Name 21 "y" + Name 34 "a" + Name 35 "t5" + MemberName 35(t5) 0 "m" + Name 37 "s5" + Name 42 "b" + Name 47 "param" + Name 52 "param" + Name 56 "g1" + Name 57 "g2" + MemberDecorate 8(t4) 0 Offset 0 + Decorate 8(t4) Block + Decorate 10(y) Aliased + Decorate 15(y) DecorationAliasedPointerEXT + Decorate 18(y) Restrict + Decorate 18(y) Restrict + Decorate 21(y) Restrict + Decorate 21(y) DecorationRestrictPointerEXT + Decorate 34(a) DecorationAliasedPointerEXT + MemberDecorate 35(t5) 0 Offset 0 + Decorate 35(t5) Block + Decorate 37(s5) DescriptorSet 0 + Decorate 37(s5) Binding 0 + Decorate 42(b) DecorationRestrictPointerEXT + Decorate 56(g1) DecorationAliasedPointerEXT + Decorate 57(g2) DecorationRestrictPointerEXT + Decorate 47(param) DecorationAliasedPointerEXT + Decorate 52(param) DecorationAliasedPointerEXT + 2: TypeVoid + 3: TypeFunction 2 + TypeForwardPointer 6 PhysicalStorageBufferEXT + 7: TypeInt 32 1 + 8(t4): TypeStruct 7(int) + 6: TypePointer PhysicalStorageBufferEXT 8(t4) + 9: TypeFunction 6(ptr) 6(ptr) + 13: TypePointer Function 6(ptr) + 14: TypeFunction 6(ptr) 13(ptr) + 35(t5): TypeStruct 6(ptr) + 36: TypePointer StorageBuffer 35(t5) + 37(s5): 36(ptr) Variable StorageBuffer + 38: 7(int) Constant 0 + 39: TypePointer StorageBuffer 6(ptr) + 55: TypePointer Private 6(ptr) + 56(g1): 55(ptr) Variable Private + 4(main): 2 Function None 3 + 5: Label + 34(a): 13(ptr) Variable Function + 42(b): 13(ptr) Variable Function + 47(param): 13(ptr) Variable Function + 52(param): 13(ptr) Variable Function + 57(g2): 13(ptr) Variable Function + 40: 39(ptr) AccessChain 37(s5) 38 + 41: 6(ptr) Load 40 + Store 34(a) 41 + 43: 39(ptr) AccessChain 37(s5) 38 + 44: 6(ptr) Load 43 + Store 42(b) 44 + 45: 6(ptr) Load 34(a) + 46: 6(ptr) FunctionCall 11(f1(1;) 45 + 48: 6(ptr) Load 34(a) + Store 47(param) 48 + 49: 6(ptr) FunctionCall 16(f2(1;) 47(param) + 50: 6(ptr) Load 34(a) + 51: 6(ptr) FunctionCall 19(f3(1;) 50 + 53: 6(ptr) Load 34(a) + Store 52(param) 53 + 54: 6(ptr) FunctionCall 22(f4(1;) 52(param) + Return + FunctionEnd + 11(f1(1;): 6(ptr) Function None 9 + 10(y): 6(ptr) FunctionParameter + 12: Label + ReturnValue 10(y) + FunctionEnd + 16(f2(1;): 6(ptr) Function None 14 + 15(y): 13(ptr) FunctionParameter + 17: Label + 26: 6(ptr) Load 15(y) + ReturnValue 26 + FunctionEnd + 19(f3(1;): 6(ptr) Function None 9 + 18(y): 6(ptr) FunctionParameter + 20: Label + ReturnValue 18(y) + FunctionEnd + 22(f4(1;): 6(ptr) Function None 14 + 21(y): 13(ptr) FunctionParameter + 23: Label + 31: 6(ptr) Load 21(y) + ReturnValue 31 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.bufferhandle14.frag.out b/deps/glslang/Test/baseResults/spv.bufferhandle14.frag.out new file mode 100644 index 00000000..d8c27269 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.bufferhandle14.frag.out @@ -0,0 +1,109 @@ +spv.bufferhandle14.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 46 + + Capability Shader + Capability CapabilityPhysicalStorageBufferAddressesEXT + Extension "SPV_EXT_physical_storage_buffer" + 1: ExtInstImport "GLSL.std.450" + MemoryModel PhysicalStorageBuffer64EXT GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_buffer_reference" + Name 4 "main" + Name 8 "T1" + MemberName 8(T1) 0 "i" + MemberName 8(T1) 1 "j" + MemberName 8(T1) 2 "k" + Name 10 "t1" + Name 20 "T2" + MemberName 20(T2) 0 "i" + MemberName 20(T2) 1 "j" + MemberName 20(T2) 2 "k" + Name 22 "t2" + Name 29 "T3" + MemberName 29(T3) 0 "i" + MemberName 29(T3) 1 "j" + MemberName 29(T3) 2 "k" + Name 31 "t3" + Name 38 "T4" + MemberName 38(T4) 0 "i" + MemberName 38(T4) 1 "j" + MemberName 38(T4) 2 "k" + Name 40 "t4" + MemberDecorate 8(T1) 0 Offset 0 + MemberDecorate 8(T1) 1 Offset 4 + MemberDecorate 8(T1) 2 Offset 8 + Decorate 8(T1) Block + Decorate 10(t1) DecorationAliasedPointerEXT + MemberDecorate 20(T2) 0 Offset 0 + MemberDecorate 20(T2) 1 Offset 4 + MemberDecorate 20(T2) 2 Offset 8 + Decorate 20(T2) Block + Decorate 22(t2) DecorationAliasedPointerEXT + MemberDecorate 29(T3) 0 Offset 0 + MemberDecorate 29(T3) 1 Offset 4 + MemberDecorate 29(T3) 2 Offset 8 + Decorate 29(T3) Block + Decorate 31(t3) DecorationAliasedPointerEXT + MemberDecorate 38(T4) 0 Offset 0 + MemberDecorate 38(T4) 1 Offset 4 + MemberDecorate 38(T4) 2 Offset 8 + Decorate 38(T4) Block + Decorate 40(t4) DecorationAliasedPointerEXT + 2: TypeVoid + 3: TypeFunction 2 + TypeForwardPointer 6 PhysicalStorageBufferEXT + 7: TypeInt 32 1 + 8(T1): TypeStruct 7(int) 7(int) 7(int) + 6: TypePointer PhysicalStorageBufferEXT 8(T1) + 9: TypePointer Function 6(ptr) + 12: 7(int) Constant 0 + 14: 7(int) Constant 2 + 15: TypePointer PhysicalStorageBufferEXT 7(int) + TypeForwardPointer 19 PhysicalStorageBufferEXT + 20(T2): TypeStruct 7(int) 7(int) 7(int) + 19: TypePointer PhysicalStorageBufferEXT 20(T2) + 21: TypePointer Function 19(ptr) + TypeForwardPointer 28 PhysicalStorageBufferEXT + 29(T3): TypeStruct 7(int) 7(int) 7(int) + 28: TypePointer PhysicalStorageBufferEXT 29(T3) + 30: TypePointer Function 28(ptr) + TypeForwardPointer 37 PhysicalStorageBufferEXT + 38(T4): TypeStruct 7(int) 7(int) 7(int) + 37: TypePointer PhysicalStorageBufferEXT 38(T4) + 39: TypePointer Function 37(ptr) + 4(main): 2 Function None 3 + 5: Label + 10(t1): 9(ptr) Variable Function + 22(t2): 21(ptr) Variable Function + 31(t3): 30(ptr) Variable Function + 40(t4): 39(ptr) Variable Function + 11: 6(ptr) Load 10(t1) + 13: 6(ptr) Load 10(t1) + 16: 15(ptr) AccessChain 13 14 + 17: 7(int) Load 16 Aligned 4 + 18: 15(ptr) AccessChain 11 12 + Store 18 17 Aligned 4 + 23: 19(ptr) Load 22(t2) + 24: 19(ptr) Load 22(t2) + 25: 15(ptr) AccessChain 24 14 + 26: 7(int) Load 25 Aligned 8 + 27: 15(ptr) AccessChain 23 12 + Store 27 26 Aligned 8 + 32: 28(ptr) Load 31(t3) + 33: 28(ptr) Load 31(t3) + 34: 15(ptr) AccessChain 33 14 + 35: 7(int) Load 34 Aligned 8 + 36: 15(ptr) AccessChain 32 12 + Store 36 35 Aligned 16 + 41: 37(ptr) Load 40(t4) + 42: 37(ptr) Load 40(t4) + 43: 15(ptr) AccessChain 42 14 + 44: 7(int) Load 43 Aligned 8 + 45: 15(ptr) AccessChain 41 12 + Store 45 44 Aligned 32 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.bufferhandle15.frag.out b/deps/glslang/Test/baseResults/spv.bufferhandle15.frag.out new file mode 100644 index 00000000..a4a434d0 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.bufferhandle15.frag.out @@ -0,0 +1,130 @@ +spv.bufferhandle15.frag +WARNING: 0:16: '' : all default precisions are highp; use precision statements to quiet warning, e.g.: + "precision mediump int; precision highp float;" + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 60 + + Capability Shader + Capability CapabilityPhysicalStorageBufferAddressesEXT + Extension "SPV_EXT_physical_storage_buffer" + Extension "SPV_KHR_storage_buffer_storage_class" + 1: ExtInstImport "GLSL.std.450" + MemoryModel PhysicalStorageBuffer64EXT GLSL450 + EntryPoint Fragment 4 "main" 37 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_buffer_reference" + SourceExtension "GL_EXT_scalar_block_layout" + Name 4 "main" + Name 9 "y" + Name 13 "T4" + MemberName 13(T4) 0 "t1" + MemberName 13(T4) 1 "t2" + MemberName 13(T4) 2 "t3" + Name 15 "T1" + MemberName 15(T1) 0 "x" + Name 22 "T2" + MemberName 22(T2) 0 "x" + Name 28 "S" + MemberName 28(S) 0 "a" + MemberName 28(S) 1 "b" + MemberName 28(S) 2 "c" + Name 29 "T3" + MemberName 29(T3) 0 "s" + Name 31 "t4" + Name 37 "i" + Name 52 "z" + MemberDecorate 13(T4) 0 Offset 0 + MemberDecorate 13(T4) 1 Offset 8 + MemberDecorate 13(T4) 2 Offset 16 + Decorate 13(T4) Block + Decorate 14 ArrayStride 12 + MemberDecorate 15(T1) 0 Offset 0 + Decorate 15(T1) Block + Decorate 18 ArrayStride 12 + Decorate 20 ArrayStride 24 + Decorate 21 ArrayStride 96 + MemberDecorate 22(T2) 0 Offset 0 + Decorate 22(T2) Block + Decorate 26 ArrayStride 36 + MemberDecorate 28(S) 0 Offset 0 + MemberDecorate 28(S) 1 ColMajor + MemberDecorate 28(S) 1 RelaxedPrecision + MemberDecorate 28(S) 1 Offset 12 + MemberDecorate 28(S) 1 MatrixStride 12 + MemberDecorate 28(S) 2 Offset 156 + MemberDecorate 29(T3) 0 Offset 0 + Decorate 29(T3) Block + Decorate 31(t4) DescriptorSet 0 + Decorate 31(t4) Binding 0 + Decorate 37(i) Flat + Decorate 37(i) Location 0 + Decorate 59 RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8: TypePointer Function 7(fvec3) + TypeForwardPointer 10 PhysicalStorageBufferEXT + TypeForwardPointer 11 PhysicalStorageBufferEXT + TypeForwardPointer 12 PhysicalStorageBufferEXT + 13(T4): TypeStruct 10 11 12 + 14: TypeRuntimeArray 7(fvec3) + 15(T1): TypeStruct 14 + 10: TypePointer PhysicalStorageBufferEXT 15(T1) + 16: TypeInt 32 0 + 17: 16(int) Constant 2 + 18: TypeArray 7(fvec3) 17 + 19: 16(int) Constant 4 + 20: TypeArray 18 19 + 21: TypeRuntimeArray 20 + 22(T2): TypeStruct 21 + 11: TypePointer PhysicalStorageBufferEXT 22(T2) + 23: TypeInt 32 1 + 24: TypeVector 23(int) 3 + 25: TypeMatrix 7(fvec3) 3 + 26: TypeArray 25 19 + 27: TypeVector 6(float) 4 + 28(S): TypeStruct 24(ivec3) 26 27(fvec4) + 29(T3): TypeStruct 28(S) + 12: TypePointer PhysicalStorageBufferEXT 29(T3) + 30: TypePointer StorageBuffer 13(T4) + 31(t4): 30(ptr) Variable StorageBuffer + 32: 23(int) Constant 0 + 33: TypePointer StorageBuffer 10(ptr) + 36: TypePointer Input 23(int) + 37(i): 36(ptr) Variable Input + 39: TypePointer PhysicalStorageBufferEXT 7(fvec3) + 42: 23(int) Constant 1 + 43: TypePointer StorageBuffer 11(ptr) + 51: TypePointer Function 25 + 53: 23(int) Constant 2 + 54: TypePointer StorageBuffer 12(ptr) + 57: TypePointer PhysicalStorageBufferEXT 25 + 4(main): 2 Function None 3 + 5: Label + 9(y): 8(ptr) Variable Function + 52(z): 51(ptr) Variable Function + 34: 33(ptr) AccessChain 31(t4) 32 + 35: 10(ptr) Load 34 + 38: 23(int) Load 37(i) + 40: 39(ptr) AccessChain 35 32 38 + 41: 7(fvec3) Load 40 Aligned 4 + Store 9(y) 41 + 44: 43(ptr) AccessChain 31(t4) 42 + 45: 11(ptr) Load 44 + 46: 23(int) Load 37(i) + 47: 23(int) Load 37(i) + 48: 23(int) Load 37(i) + 49: 39(ptr) AccessChain 45 32 46 47 48 + 50: 7(fvec3) Load 49 Aligned 4 + Store 9(y) 50 + 55: 54(ptr) AccessChain 31(t4) 53 + 56: 12(ptr) Load 55 + 58: 57(ptr) AccessChain 56 32 42 32 + 59: 25 Load 58 Aligned 4 + Store 52(z) 59 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.bufferhandle2.frag.out b/deps/glslang/Test/baseResults/spv.bufferhandle2.frag.out new file mode 100644 index 00000000..fbcf16cb --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.bufferhandle2.frag.out @@ -0,0 +1,94 @@ +spv.bufferhandle2.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 45 + + Capability Shader + Capability CapabilityPhysicalStorageBufferAddressesEXT + Extension "SPV_EXT_physical_storage_buffer" + Extension "SPV_KHR_storage_buffer_storage_class" + 1: ExtInstImport "GLSL.std.450" + MemoryModel PhysicalStorageBuffer64EXT GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_buffer_reference" + Name 4 "main" + Name 8 "blockType" + MemberName 8(blockType) 0 "a" + MemberName 8(blockType) 1 "b" + MemberName 8(blockType) 2 "c" + MemberName 8(blockType) 3 "d" + MemberName 8(blockType) 4 "e" + Name 13 "b1" + Name 14 "t2" + MemberName 14(t2) 0 "f" + MemberName 14(t2) 1 "g" + Name 16 "t" + Name 34 "b2" + Name 37 "b3" + MemberDecorate 8(blockType) 0 Offset 0 + MemberDecorate 8(blockType) 1 Offset 4 + MemberDecorate 8(blockType) 2 Offset 8 + MemberDecorate 8(blockType) 3 Offset 12 + MemberDecorate 8(blockType) 4 Offset 16 + Decorate 8(blockType) Block + Decorate 13(b1) DecorationAliasedPointerEXT + MemberDecorate 14(t2) 0 Offset 0 + MemberDecorate 14(t2) 1 Offset 8 + Decorate 14(t2) Block + Decorate 16(t) DescriptorSet 0 + Decorate 16(t) Binding 0 + Decorate 34(b2) DecorationAliasedPointerEXT + Decorate 37(b3) DecorationAliasedPointerEXT + 2: TypeVoid + 3: TypeFunction 2 + TypeForwardPointer 6 PhysicalStorageBufferEXT + 7: TypeInt 32 1 + 8(blockType): TypeStruct 7(int) 7(int) 7(int) 7(int) 7(int) + 6: TypePointer PhysicalStorageBufferEXT 8(blockType) + 9: TypeInt 32 0 + 10: 9(int) Constant 2 + 11: TypeArray 6(ptr) 10 + 12: TypePointer Function 11 + 14(t2): TypeStruct 6(ptr) 6(ptr) + 15: TypePointer StorageBuffer 14(t2) + 16(t): 15(ptr) Variable StorageBuffer + 17: 7(int) Constant 0 + 18: TypePointer StorageBuffer 6(ptr) + 21: 7(int) Constant 1 + 25: TypePointer Function 6(ptr) + 30: TypePointer PhysicalStorageBufferEXT 7(int) + 4(main): 2 Function None 3 + 5: Label + 13(b1): 12(ptr) Variable Function + 34(b2): 25(ptr) Variable Function + 37(b3): 25(ptr) Variable Function + 19: 18(ptr) AccessChain 16(t) 17 + 20: 6(ptr) Load 19 + 22: 18(ptr) AccessChain 16(t) 21 + 23: 6(ptr) Load 22 + 24: 11 CompositeConstruct 20 23 + Store 13(b1) 24 + 26: 25(ptr) AccessChain 13(b1) 17 + 27: 6(ptr) Load 26 + 28: 25(ptr) AccessChain 13(b1) 21 + 29: 6(ptr) Load 28 + 31: 30(ptr) AccessChain 29 21 + 32: 7(int) Load 31 Aligned 4 + 33: 30(ptr) AccessChain 27 17 + Store 33 32 Aligned 16 + 35: 18(ptr) AccessChain 16(t) 17 + 36: 6(ptr) Load 35 + Store 34(b2) 36 + 38: 18(ptr) AccessChain 16(t) 21 + 39: 6(ptr) Load 38 + Store 37(b3) 39 + 40: 6(ptr) Load 34(b2) + 41: 6(ptr) Load 37(b3) + 42: 30(ptr) AccessChain 41 21 + 43: 7(int) Load 42 Aligned 4 + 44: 30(ptr) AccessChain 40 17 + Store 44 43 Aligned 16 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.bufferhandle3.frag.out b/deps/glslang/Test/baseResults/spv.bufferhandle3.frag.out new file mode 100644 index 00000000..a2cb85f1 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.bufferhandle3.frag.out @@ -0,0 +1,105 @@ +spv.bufferhandle3.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 50 + + Capability Shader + Capability CapabilityPhysicalStorageBufferAddressesEXT + Extension "SPV_EXT_physical_storage_buffer" + Extension "SPV_KHR_storage_buffer_storage_class" + 1: ExtInstImport "GLSL.std.450" + MemoryModel PhysicalStorageBuffer64EXT GLSL450 + EntryPoint Fragment 4 "main" 42 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_buffer_reference" + Name 4 "main" + Name 9 "t4" + MemberName 9(t4) 0 "j" + MemberName 9(t4) 1 "k" + Name 10 "t3" + MemberName 10(t3) 0 "h" + Name 14 "foo(1;" + Name 13 "y" + Name 19 "t5" + MemberName 19(t5) 0 "m" + Name 21 "s5" + Name 23 "param" + Name 38 "t4" + MemberName 38(t4) 0 "j" + MemberName 38(t4) 1 "k" + Name 40 "x" + Name 42 "k" + MemberDecorate 9(t4) 0 Offset 0 + MemberDecorate 9(t4) 1 Offset 8 + Decorate 9(t4) Block + MemberDecorate 10(t3) 0 Offset 0 + Decorate 10(t3) Block + Decorate 13(y) DecorationAliasedPointerEXT + MemberDecorate 19(t5) 0 Offset 0 + Decorate 19(t5) Block + Decorate 21(s5) DescriptorSet 0 + Decorate 21(s5) Binding 0 + MemberDecorate 38(t4) 0 Offset 0 + MemberDecorate 38(t4) 1 Offset 8 + Decorate 38(t4) Block + Decorate 40(x) DescriptorSet 1 + Decorate 40(x) Binding 2 + Decorate 42(k) Flat + Decorate 42(k) DecorationAliasedPointerEXT + Decorate 23(param) DecorationAliasedPointerEXT + 2: TypeVoid + 3: TypeFunction 2 + TypeForwardPointer 6 PhysicalStorageBufferEXT + 7: TypeInt 32 1 + TypeForwardPointer 8 PhysicalStorageBufferEXT + 9(t4): TypeStruct 7(int) 8 + 10(t3): TypeStruct 7(int) + 8: TypePointer PhysicalStorageBufferEXT 10(t3) + 6: TypePointer PhysicalStorageBufferEXT 9(t4) + 11: TypePointer Function 6(ptr) + 12: TypeFunction 6(ptr) 11(ptr) + 19(t5): TypeStruct 6(ptr) + 20: TypePointer StorageBuffer 19(t5) + 21(s5): 20(ptr) Variable StorageBuffer + 22: 7(int) Constant 0 + 24: TypePointer StorageBuffer 6(ptr) + 30: 7(int) Constant 1 + 31: TypePointer PhysicalStorageBufferEXT 8(ptr) + 34: TypePointer PhysicalStorageBufferEXT 7(int) + 38(t4): TypeStruct 7(int) 8(ptr) + 39: TypePointer StorageBuffer 38(t4) + 40(x): 39(ptr) Variable StorageBuffer + 41: TypePointer Input 6(ptr) + 42(k): 41(ptr) Variable Input + 48: TypePointer StorageBuffer 7(int) + 4(main): 2 Function None 3 + 5: Label + 23(param): 11(ptr) Variable Function + 25: 24(ptr) AccessChain 21(s5) 22 + 26: 6(ptr) Load 25 + Store 23(param) 26 + 27: 6(ptr) FunctionCall 14(foo(1;) 23(param) + 28: 24(ptr) AccessChain 21(s5) 22 + 29: 6(ptr) Load 28 + 32: 31(ptr) AccessChain 29 30 + 33: 8(ptr) Load 32 Aligned 8 + 35: 34(ptr) AccessChain 33 22 + 36: 7(int) Load 35 Aligned 16 + 37: 34(ptr) AccessChain 27 22 + Store 37 36 Aligned 16 + 43: 6(ptr) Load 42(k) + 44: 31(ptr) AccessChain 43 30 + 45: 8(ptr) Load 44 Aligned 8 + 46: 34(ptr) AccessChain 45 22 + 47: 7(int) Load 46 Aligned 16 + 49: 48(ptr) AccessChain 40(x) 22 + Store 49 47 + Return + FunctionEnd + 14(foo(1;): 6(ptr) Function None 12 + 13(y): 11(ptr) FunctionParameter + 15: Label + 16: 6(ptr) Load 13(y) + ReturnValue 16 + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.bufferhandle4.frag.out b/deps/glslang/Test/baseResults/spv.bufferhandle4.frag.out new file mode 100644 index 00000000..08de8711 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.bufferhandle4.frag.out @@ -0,0 +1,118 @@ +spv.bufferhandle4.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 61 + + Capability Shader + Capability CapabilityPhysicalStorageBufferAddressesEXT + Extension "SPV_EXT_physical_storage_buffer" + Extension "SPV_KHR_storage_buffer_storage_class" + 1: ExtInstImport "GLSL.std.450" + MemoryModel PhysicalStorageBuffer64EXT GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_buffer_reference" + Name 4 "main" + Name 8 "t4" + MemberName 8(t4) 0 "j" + MemberName 8(t4) 1 "k" + Name 10 "t3" + MemberName 10(t3) 0 "h" + MemberName 10(t3) 1 "i" + Name 11 "t4" + MemberName 11(t4) 0 "j" + MemberName 11(t4) 1 "k" + Name 13 "x" + Name 19 "t5" + MemberName 19(t5) 0 "m" + Name 21 "s5" + Name 43 "b" + MemberDecorate 8(t4) 0 Offset 0 + MemberDecorate 8(t4) 1 Offset 8 + Decorate 8(t4) Block + MemberDecorate 10(t3) 0 Offset 0 + MemberDecorate 10(t3) 1 Offset 8 + Decorate 10(t3) Block + MemberDecorate 11(t4) 0 Offset 0 + MemberDecorate 11(t4) 1 Offset 8 + Decorate 11(t4) Block + Decorate 13(x) DescriptorSet 1 + Decorate 13(x) Binding 2 + MemberDecorate 19(t5) 0 Offset 0 + Decorate 19(t5) Block + Decorate 21(s5) DescriptorSet 0 + Decorate 21(s5) Binding 0 + Decorate 47 DecorationAliasedPointerEXT + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + TypeForwardPointer 7 PhysicalStorageBufferEXT + 8(t4): TypeStruct 6(int) 7 + TypeForwardPointer 9 PhysicalStorageBufferEXT + 10(t3): TypeStruct 6(int) 9 + 11(t4): TypeStruct 6(int) 7 + 9: TypePointer PhysicalStorageBufferEXT 11(t4) + 7: TypePointer PhysicalStorageBufferEXT 10(t3) + 12: TypePointer StorageBuffer 8(t4) + 13(x): 12(ptr) Variable StorageBuffer + 14: 6(int) Constant 1 + 15: TypePointer StorageBuffer 7(ptr) + 18: 6(int) Constant 0 + 19(t5): TypeStruct 9(ptr) + 20: TypePointer StorageBuffer 19(t5) + 21(s5): 20(ptr) Variable StorageBuffer + 22: TypePointer StorageBuffer 9(ptr) + 25: TypePointer PhysicalStorageBufferEXT 7(ptr) + 28: TypePointer PhysicalStorageBufferEXT 9(ptr) + 37: TypePointer PhysicalStorageBufferEXT 6(int) + 41: TypeBool + 42: TypePointer Function 41(bool) + 44: 41(bool) ConstantTrue + 46: TypePointer Function 9(ptr) + 4(main): 2 Function None 3 + 5: Label + 43(b): 42(ptr) Variable Function + 47: 46(ptr) Variable Function + 16: 15(ptr) AccessChain 13(x) 14 + 17: 7(ptr) Load 16 + 23: 22(ptr) AccessChain 21(s5) 18 + 24: 9(ptr) Load 23 + 26: 25(ptr) AccessChain 24 14 + 27: 7(ptr) Load 26 Aligned 8 + 29: 28(ptr) AccessChain 27 14 + 30: 9(ptr) Load 29 Aligned 8 + 31: 25(ptr) AccessChain 30 14 + 32: 7(ptr) Load 31 Aligned 8 + 33: 28(ptr) AccessChain 32 14 + 34: 9(ptr) Load 33 Aligned 8 + 35: 25(ptr) AccessChain 34 14 + 36: 7(ptr) Load 35 Aligned 8 + 38: 37(ptr) AccessChain 36 18 + 39: 6(int) Load 38 Aligned 16 + 40: 37(ptr) AccessChain 17 18 + Store 40 39 Aligned 16 + Store 43(b) 44 + 45: 41(bool) Load 43(b) + SelectionMerge 49 None + BranchConditional 45 48 52 + 48: Label + 50: 22(ptr) AccessChain 21(s5) 18 + 51: 9(ptr) Load 50 + Store 47 51 + Branch 49 + 52: Label + 53: 22(ptr) AccessChain 21(s5) 18 + 54: 9(ptr) Load 53 + 55: 25(ptr) AccessChain 54 14 + 56: 7(ptr) Load 55 Aligned 8 + 57: 28(ptr) AccessChain 56 14 + 58: 9(ptr) Load 57 Aligned 8 + Store 47 58 + Branch 49 + 49: Label + 59: 9(ptr) Load 47 + 60: 22(ptr) AccessChain 21(s5) 18 + Store 60 59 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.bufferhandle5.frag.out b/deps/glslang/Test/baseResults/spv.bufferhandle5.frag.out new file mode 100644 index 00000000..36564088 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.bufferhandle5.frag.out @@ -0,0 +1,52 @@ +spv.bufferhandle5.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 22 + + Capability Shader + Capability CapabilityPhysicalStorageBufferAddressesEXT + Extension "SPV_EXT_physical_storage_buffer" + 1: ExtInstImport "GLSL.std.450" + MemoryModel PhysicalStorageBuffer64EXT GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_buffer_reference" + Name 4 "main" + Name 8 "t4" + MemberName 8(t4) 0 "j" + MemberName 8(t4) 1 "k" + Name 9 "t3" + MemberName 9(t3) 0 "h" + Name 11 "x" + MemberDecorate 8(t4) 0 Offset 0 + MemberDecorate 8(t4) 1 Offset 8 + Decorate 8(t4) Block + MemberDecorate 9(t3) 0 Offset 0 + Decorate 9(t3) Block + Decorate 11(x) DescriptorSet 1 + Decorate 11(x) Binding 2 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + TypeForwardPointer 7 PhysicalStorageBufferEXT + 8(t4): TypeStruct 6(int) 7 + 9(t3): TypeStruct 6(int) + 7: TypePointer PhysicalStorageBufferEXT 9(t3) + 10: TypePointer Uniform 8(t4) + 11(x): 10(ptr) Variable Uniform + 12: 6(int) Constant 1 + 13: TypePointer Uniform 7(ptr) + 16: 6(int) Constant 0 + 17: TypePointer Uniform 6(int) + 20: TypePointer PhysicalStorageBufferEXT 6(int) + 4(main): 2 Function None 3 + 5: Label + 14: 13(ptr) AccessChain 11(x) 12 + 15: 7(ptr) Load 14 + 18: 17(ptr) AccessChain 11(x) 16 + 19: 6(int) Load 18 + 21: 20(ptr) AccessChain 15 16 + Store 21 19 Aligned 16 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.bufferhandle6.frag.out b/deps/glslang/Test/baseResults/spv.bufferhandle6.frag.out new file mode 100644 index 00000000..54db3cf5 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.bufferhandle6.frag.out @@ -0,0 +1,238 @@ +spv.bufferhandle6.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 165 + + Capability Shader + Capability CapabilityPhysicalStorageBufferAddressesEXT + Extension "SPV_EXT_physical_storage_buffer" + Extension "SPV_KHR_storage_buffer_storage_class" + 1: ExtInstImport "GLSL.std.450" + MemoryModel PhysicalStorageBuffer64EXT GLSL450 + EntryPoint Fragment 4 "main" 154 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_buffer_reference" + Name 4 "main" + Name 8 "accum" + Name 15 "T1" + MemberName 15(T1) 0 "a" + MemberName 15(T1) 1 "b" + MemberName 15(T1) 2 "c" + MemberName 15(T1) 3 "d" + Name 18 "T1" + MemberName 18(T1) 0 "a" + MemberName 18(T1) 1 "b" + MemberName 18(T1) 2 "c" + MemberName 18(T1) 3 "d" + Name 21 "x" + Name 30 "Block" + MemberName 30(Block) 0 "identity" + Name 32 "pc" + Name 136 "color" + Name 149 "image0_0" + Name 154 "gl_FragCoord" + Decorate 12 ArrayStride 4 + Decorate 14 ArrayStride 8 + MemberDecorate 15(T1) 0 Offset 0 + MemberDecorate 15(T1) 1 Offset 32 + MemberDecorate 15(T1) 2 Offset 48 + MemberDecorate 15(T1) 3 Offset 80 + Decorate 15(T1) Block + Decorate 16 ArrayStride 4 + Decorate 17 ArrayStride 8 + MemberDecorate 18(T1) 0 Offset 0 + MemberDecorate 18(T1) 1 Offset 32 + MemberDecorate 18(T1) 2 Offset 48 + MemberDecorate 18(T1) 3 Offset 80 + Decorate 18(T1) Block + Decorate 19 ArrayStride 8 + Decorate 21(x) DescriptorSet 3 + Decorate 21(x) Binding 1 + Decorate 29 ArrayStride 4 + MemberDecorate 30(Block) 0 Offset 0 + Decorate 30(Block) Block + Decorate 149(image0_0) DescriptorSet 3 + Decorate 149(image0_0) Binding 0 + Decorate 154(gl_FragCoord) BuiltIn FragCoord + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 10: TypeInt 32 0 + 11: 10(int) Constant 2 + 12: TypeArray 6(int) 11 + TypeForwardPointer 13 PhysicalStorageBufferEXT + 14: TypeArray 13 11 + 15(T1): TypeStruct 12 6(int) 14 13 + 16: TypeArray 6(int) 11 + 17: TypeArray 13 11 + 18(T1): TypeStruct 16 6(int) 17 13 + 13: TypePointer PhysicalStorageBufferEXT 18(T1) + 19: TypeArray 13(ptr) 11 + 20: TypePointer StorageBuffer 15(T1) + 21(x): 20(ptr) Variable StorageBuffer + 22: TypePointer StorageBuffer 6(int) + 28: 10(int) Constant 32 + 29: TypeArray 6(int) 28 + 30(Block): TypeStruct 29 + 31: TypePointer PushConstant 30(Block) + 32(pc): 31(ptr) Variable PushConstant + 33: 6(int) Constant 1 + 34: TypePointer PushConstant 6(int) + 44: 6(int) Constant 2 + 48: TypePointer StorageBuffer 13(ptr) + 51: TypePointer PhysicalStorageBufferEXT 6(int) + 54: 6(int) Constant 3 + 64: 6(int) Constant 4 + 72: 6(int) Constant 5 + 82: 6(int) Constant 6 + 94: 6(int) Constant 7 + 104: 6(int) Constant 8 + 112: 6(int) Constant 9 + 122: 6(int) Constant 10 + 130: 6(int) Constant 11 + 134: TypeVector 10(int) 4 + 135: TypePointer Function 134(ivec4) + 138: TypeBool + 140: 10(int) Constant 0 + 141: 134(ivec4) ConstantComposite 140 140 140 140 + 142: 10(int) Constant 1 + 143: 134(ivec4) ConstantComposite 142 140 140 142 + 144: TypeVector 138(bool) 4 + 147: TypeImage 10(int) 2D nonsampled format:R32ui + 148: TypePointer UniformConstant 147 + 149(image0_0): 148(ptr) Variable UniformConstant + 151: TypeFloat 32 + 152: TypeVector 151(float) 4 + 153: TypePointer Input 152(fvec4) +154(gl_FragCoord): 153(ptr) Variable Input + 155: TypePointer Input 151(float) + 162: TypeVector 6(int) 2 + 4(main): 2 Function None 3 + 5: Label + 8(accum): 7(ptr) Variable Function + 136(color): 135(ptr) Variable Function + Store 8(accum) 9 + 23: 22(ptr) AccessChain 21(x) 9 9 + 24: 6(int) Load 23 + 25: 6(int) ISub 24 9 + 26: 6(int) Load 8(accum) + 27: 6(int) BitwiseOr 26 25 + Store 8(accum) 27 + 35: 34(ptr) AccessChain 32(pc) 9 33 + 36: 6(int) Load 35 + 37: 22(ptr) AccessChain 21(x) 9 36 + 38: 6(int) Load 37 + 39: 6(int) ISub 38 33 + 40: 6(int) Load 8(accum) + 41: 6(int) BitwiseOr 40 39 + Store 8(accum) 41 + 42: 22(ptr) AccessChain 21(x) 33 + 43: 6(int) Load 42 + 45: 6(int) ISub 43 44 + 46: 6(int) Load 8(accum) + 47: 6(int) BitwiseOr 46 45 + Store 8(accum) 47 + 49: 48(ptr) AccessChain 21(x) 44 9 + 50: 13(ptr) Load 49 + 52: 51(ptr) AccessChain 50 9 9 + 53: 6(int) Load 52 Aligned 4 + 55: 6(int) ISub 53 54 + 56: 6(int) Load 8(accum) + 57: 6(int) BitwiseOr 56 55 + Store 8(accum) 57 + 58: 48(ptr) AccessChain 21(x) 44 9 + 59: 13(ptr) Load 58 + 60: 34(ptr) AccessChain 32(pc) 9 33 + 61: 6(int) Load 60 + 62: 51(ptr) AccessChain 59 9 61 + 63: 6(int) Load 62 Aligned 4 + 65: 6(int) ISub 63 64 + 66: 6(int) Load 8(accum) + 67: 6(int) BitwiseOr 66 65 + Store 8(accum) 67 + 68: 48(ptr) AccessChain 21(x) 44 9 + 69: 13(ptr) Load 68 + 70: 51(ptr) AccessChain 69 33 + 71: 6(int) Load 70 Aligned 16 + 73: 6(int) ISub 71 72 + 74: 6(int) Load 8(accum) + 75: 6(int) BitwiseOr 74 73 + Store 8(accum) 75 + 76: 34(ptr) AccessChain 32(pc) 9 33 + 77: 6(int) Load 76 + 78: 48(ptr) AccessChain 21(x) 44 77 + 79: 13(ptr) Load 78 + 80: 51(ptr) AccessChain 79 9 9 + 81: 6(int) Load 80 Aligned 4 + 83: 6(int) ISub 81 82 + 84: 6(int) Load 8(accum) + 85: 6(int) BitwiseOr 84 83 + Store 8(accum) 85 + 86: 34(ptr) AccessChain 32(pc) 9 33 + 87: 6(int) Load 86 + 88: 48(ptr) AccessChain 21(x) 44 87 + 89: 13(ptr) Load 88 + 90: 34(ptr) AccessChain 32(pc) 9 33 + 91: 6(int) Load 90 + 92: 51(ptr) AccessChain 89 9 91 + 93: 6(int) Load 92 Aligned 4 + 95: 6(int) ISub 93 94 + 96: 6(int) Load 8(accum) + 97: 6(int) BitwiseOr 96 95 + Store 8(accum) 97 + 98: 34(ptr) AccessChain 32(pc) 9 33 + 99: 6(int) Load 98 + 100: 48(ptr) AccessChain 21(x) 44 99 + 101: 13(ptr) Load 100 + 102: 51(ptr) AccessChain 101 33 + 103: 6(int) Load 102 Aligned 16 + 105: 6(int) ISub 103 104 + 106: 6(int) Load 8(accum) + 107: 6(int) BitwiseOr 106 105 + Store 8(accum) 107 + 108: 48(ptr) AccessChain 21(x) 54 + 109: 13(ptr) Load 108 + 110: 51(ptr) AccessChain 109 9 9 + 111: 6(int) Load 110 Aligned 4 + 113: 6(int) ISub 111 112 + 114: 6(int) Load 8(accum) + 115: 6(int) BitwiseOr 114 113 + Store 8(accum) 115 + 116: 48(ptr) AccessChain 21(x) 54 + 117: 13(ptr) Load 116 + 118: 34(ptr) AccessChain 32(pc) 9 33 + 119: 6(int) Load 118 + 120: 51(ptr) AccessChain 117 9 119 + 121: 6(int) Load 120 Aligned 4 + 123: 6(int) ISub 121 122 + 124: 6(int) Load 8(accum) + 125: 6(int) BitwiseOr 124 123 + Store 8(accum) 125 + 126: 48(ptr) AccessChain 21(x) 54 + 127: 13(ptr) Load 126 + 128: 51(ptr) AccessChain 127 33 + 129: 6(int) Load 128 Aligned 16 + 131: 6(int) ISub 129 130 + 132: 6(int) Load 8(accum) + 133: 6(int) BitwiseOr 132 131 + Store 8(accum) 133 + 137: 6(int) Load 8(accum) + 139: 138(bool) INotEqual 137 9 + 145: 144(bvec4) CompositeConstruct 139 139 139 139 + 146: 134(ivec4) Select 145 141 143 + Store 136(color) 146 + 150: 147 Load 149(image0_0) + 156: 155(ptr) AccessChain 154(gl_FragCoord) 140 + 157: 151(float) Load 156 + 158: 6(int) ConvertFToS 157 + 159: 155(ptr) AccessChain 154(gl_FragCoord) 142 + 160: 151(float) Load 159 + 161: 6(int) ConvertFToS 160 + 163: 162(ivec2) CompositeConstruct 158 161 + 164: 134(ivec4) Load 136(color) + ImageWrite 150 163 164 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.bufferhandle7.frag.out b/deps/glslang/Test/baseResults/spv.bufferhandle7.frag.out new file mode 100644 index 00000000..4a52596e --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.bufferhandle7.frag.out @@ -0,0 +1,77 @@ +spv.bufferhandle7.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 24 + + Capability Shader + Capability CapabilityPhysicalStorageBufferAddressesEXT + Extension "SPV_EXT_physical_storage_buffer" + Extension "SPV_KHR_storage_buffer_storage_class" + 1: ExtInstImport "GLSL.std.450" + MemoryModel PhysicalStorageBuffer64EXT GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_buffer_reference" + Name 4 "main" + Name 7 "t2" + MemberName 7(t2) 0 "f" + MemberName 7(t2) 1 "g" + Name 9 "blockType" + MemberName 9(blockType) 0 "a" + MemberName 9(blockType) 1 "b" + MemberName 9(blockType) 2 "c" + MemberName 9(blockType) 3 "d" + MemberName 9(blockType) 4 "e" + Name 11 "t" + Name 14 "t3" + MemberName 14(t3) 0 "f" + Name 15 "t2" + MemberName 15(t2) 0 "f" + MemberName 15(t2) 1 "g" + Name 17 "u" + MemberDecorate 7(t2) 0 Offset 0 + MemberDecorate 7(t2) 1 Offset 8 + Decorate 7(t2) Block + MemberDecorate 9(blockType) 0 Offset 0 + MemberDecorate 9(blockType) 1 Offset 4 + MemberDecorate 9(blockType) 2 Offset 8 + MemberDecorate 9(blockType) 3 Offset 12 + MemberDecorate 9(blockType) 4 Offset 16 + Decorate 9(blockType) Block + Decorate 11(t) DescriptorSet 0 + Decorate 11(t) Binding 0 + MemberDecorate 14(t3) 0 Offset 0 + Decorate 14(t3) Block + MemberDecorate 15(t2) 0 Offset 0 + MemberDecorate 15(t2) 1 Offset 8 + Decorate 15(t2) Block + Decorate 17(u) DescriptorSet 0 + Decorate 17(u) Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + TypeForwardPointer 6 PhysicalStorageBufferEXT + 7(t2): TypeStruct 6 6 + 8: TypeInt 32 1 + 9(blockType): TypeStruct 8(int) 8(int) 8(int) 8(int) 8(int) + 6: TypePointer PhysicalStorageBufferEXT 9(blockType) + 10: TypePointer StorageBuffer 7(t2) + 11(t): 10(ptr) Variable StorageBuffer + 12: 8(int) Constant 0 + TypeForwardPointer 13 PhysicalStorageBufferEXT + 14(t3): TypeStruct 13 + 15(t2): TypeStruct 6(ptr) 6(ptr) + 13: TypePointer PhysicalStorageBufferEXT 15(t2) + 16: TypePointer StorageBuffer 14(t3) + 17(u): 16(ptr) Variable StorageBuffer + 18: TypePointer StorageBuffer 13(ptr) + 22: TypePointer StorageBuffer 6(ptr) + 4(main): 2 Function None 3 + 5: Label + 19: 18(ptr) AccessChain 17(u) 12 + 20: 13(ptr) Load 19 + 21: 6(ptr) Bitcast 20 + 23: 22(ptr) AccessChain 11(t) 12 + Store 23 21 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.bufferhandle8.frag.out b/deps/glslang/Test/baseResults/spv.bufferhandle8.frag.out new file mode 100644 index 00000000..168da818 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.bufferhandle8.frag.out @@ -0,0 +1,89 @@ +spv.bufferhandle8.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 27 + + Capability Shader + Capability CapabilityPhysicalStorageBufferAddressesEXT + Extension "SPV_EXT_physical_storage_buffer" + Extension "SPV_KHR_storage_buffer_storage_class" + 1: ExtInstImport "GLSL.std.450" + MemoryModel PhysicalStorageBuffer64EXT GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_buffer_reference" + Name 4 "main" + Name 8 "Blah" + MemberName 8(Blah) 0 "t1" + MemberName 8(Blah) 1 "t2" + Name 10 "T1" + MemberName 10(T1) 0 "x" + Name 11 "T2" + MemberName 11(T2) 0 "x" + Name 13 "T3" + MemberName 13(T3) 0 "Bindings" + Name 15 "t3" + Name 23 "t2" + MemberName 23(t2) 0 "f" + MemberName 23(t2) 1 "g" + Name 24 "blockType" + MemberName 24(blockType) 0 "a" + MemberName 24(blockType) 1 "b" + MemberName 24(blockType) 2 "c" + MemberName 24(blockType) 3 "d" + MemberName 24(blockType) 4 "e" + Name 26 "t" + MemberDecorate 8(Blah) 0 Offset 0 + MemberDecorate 8(Blah) 1 Offset 8 + MemberDecorate 10(T1) 0 Offset 0 + Decorate 10(T1) Block + MemberDecorate 11(T2) 0 Offset 0 + Decorate 11(T2) Block + Decorate 12 ArrayStride 16 + MemberDecorate 13(T3) 0 Offset 0 + Decorate 13(T3) Block + Decorate 15(t3) DescriptorSet 0 + Decorate 15(t3) Binding 0 + MemberDecorate 23(t2) 0 Offset 0 + MemberDecorate 23(t2) 1 Offset 8 + Decorate 23(t2) Block + MemberDecorate 24(blockType) 0 Offset 0 + MemberDecorate 24(blockType) 1 Offset 4 + MemberDecorate 24(blockType) 2 Offset 8 + MemberDecorate 24(blockType) 3 Offset 12 + MemberDecorate 24(blockType) 4 Offset 16 + Decorate 24(blockType) Block + Decorate 26(t) DescriptorSet 0 + Decorate 26(t) Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + TypeForwardPointer 6 PhysicalStorageBufferEXT + TypeForwardPointer 7 PhysicalStorageBufferEXT + 8(Blah): TypeStruct 6 7 + 9: TypeInt 32 1 + 10(T1): TypeStruct 9(int) + 6: TypePointer PhysicalStorageBufferEXT 10(T1) + 11(T2): TypeStruct 9(int) + 7: TypePointer PhysicalStorageBufferEXT 11(T2) + 12: TypeRuntimeArray 8(Blah) + 13(T3): TypeStruct 12 + 14: TypePointer StorageBuffer 13(T3) + 15(t3): 14(ptr) Variable StorageBuffer + 16: 9(int) Constant 0 + 17: 9(int) Constant 1 + 18: TypePointer StorageBuffer 8(Blah) + TypeForwardPointer 22 PhysicalStorageBufferEXT + 23(t2): TypeStruct 22 22 + 24(blockType): TypeStruct 9(int) 9(int) 9(int) 9(int) 9(int) + 22: TypePointer PhysicalStorageBufferEXT 24(blockType) + 25: TypePointer StorageBuffer 23(t2) + 26(t): 25(ptr) Variable StorageBuffer + 4(main): 2 Function None 3 + 5: Label + 19: 18(ptr) AccessChain 15(t3) 16 17 + 20: 8(Blah) Load 19 + 21: 18(ptr) AccessChain 15(t3) 16 16 + Store 21 20 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.bufferhandle9.frag.out b/deps/glslang/Test/baseResults/spv.bufferhandle9.frag.out new file mode 100644 index 00000000..e74be8a5 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.bufferhandle9.frag.out @@ -0,0 +1,114 @@ +spv.bufferhandle9.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 56 + + Capability Shader + Capability Int64 + Capability CapabilityPhysicalStorageBufferAddressesEXT + Extension "SPV_EXT_physical_storage_buffer" + Extension "SPV_KHR_storage_buffer_storage_class" + 1: ExtInstImport "GLSL.std.450" + MemoryModel PhysicalStorageBuffer64EXT GLSL450 + EntryPoint Fragment 4 "main" 16 19 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_ARB_gpu_shader_int64" + SourceExtension "GL_EXT_buffer_reference" + Name 4 "main" + Name 8 "blockType" + MemberName 8(blockType) 0 "a" + MemberName 8(blockType) 1 "b" + MemberName 8(blockType) 2 "c" + MemberName 8(blockType) 3 "d" + MemberName 8(blockType) 4 "e" + Name 13 "b1" + Name 16 "h" + Name 19 "i" + Name 34 "b2" + Name 37 "b3" + Name 46 "j" + Name 53 "t2" + MemberName 53(t2) 0 "f" + MemberName 53(t2) 1 "g" + Name 55 "t" + MemberDecorate 8(blockType) 0 Offset 0 + MemberDecorate 8(blockType) 1 Offset 4 + MemberDecorate 8(blockType) 2 Offset 8 + MemberDecorate 8(blockType) 3 Offset 12 + MemberDecorate 8(blockType) 4 Offset 16 + Decorate 8(blockType) Block + Decorate 13(b1) DecorationAliasedPointerEXT + Decorate 16(h) Flat + Decorate 19(i) Flat + Decorate 34(b2) DecorationAliasedPointerEXT + Decorate 37(b3) DecorationAliasedPointerEXT + MemberDecorate 53(t2) 0 Offset 0 + MemberDecorate 53(t2) 1 Offset 8 + Decorate 53(t2) Block + Decorate 55(t) DescriptorSet 0 + Decorate 55(t) Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + TypeForwardPointer 6 PhysicalStorageBufferEXT + 7: TypeInt 32 1 + 8(blockType): TypeStruct 7(int) 7(int) 7(int) 7(int) 7(int) + 6: TypePointer PhysicalStorageBufferEXT 8(blockType) + 9: TypeInt 32 0 + 10: 9(int) Constant 2 + 11: TypeArray 6(ptr) 10 + 12: TypePointer Function 11 + 14: TypeInt 64 0 + 15: TypePointer Input 14(int64_t) + 16(h): 15(ptr) Variable Input + 19(i): 15(ptr) Variable Input + 23: 7(int) Constant 0 + 24: TypePointer Function 6(ptr) + 27: 7(int) Constant 1 + 30: TypePointer PhysicalStorageBufferEXT 7(int) + 45: TypePointer Function 14(int64_t) + 50: 14(int64_t) Constant 256 0 + 53(t2): TypeStruct 6(ptr) 6(ptr) + 54: TypePointer StorageBuffer 53(t2) + 55(t): 54(ptr) Variable StorageBuffer + 4(main): 2 Function None 3 + 5: Label + 13(b1): 12(ptr) Variable Function + 34(b2): 24(ptr) Variable Function + 37(b3): 24(ptr) Variable Function + 46(j): 45(ptr) Variable Function + 17: 14(int64_t) Load 16(h) + 18: 6(ptr) ConvertUToPtr 17 + 20: 14(int64_t) Load 19(i) + 21: 6(ptr) ConvertUToPtr 20 + 22: 11 CompositeConstruct 18 21 + Store 13(b1) 22 + 25: 24(ptr) AccessChain 13(b1) 23 + 26: 6(ptr) Load 25 + 28: 24(ptr) AccessChain 13(b1) 27 + 29: 6(ptr) Load 28 + 31: 30(ptr) AccessChain 29 27 + 32: 7(int) Load 31 Aligned 4 + 33: 30(ptr) AccessChain 26 23 + Store 33 32 Aligned 16 + 35: 14(int64_t) Load 16(h) + 36: 6(ptr) ConvertUToPtr 35 + Store 34(b2) 36 + 38: 14(int64_t) Load 19(i) + 39: 6(ptr) ConvertUToPtr 38 + Store 37(b3) 39 + 40: 6(ptr) Load 34(b2) + 41: 6(ptr) Load 37(b3) + 42: 30(ptr) AccessChain 41 27 + 43: 7(int) Load 42 Aligned 4 + 44: 30(ptr) AccessChain 40 23 + Store 44 43 Aligned 16 + 47: 6(ptr) Load 34(b2) + 48: 14(int64_t) ConvertPtrToU 47 + Store 46(j) 48 + 49: 14(int64_t) Load 46(j) + 51: 14(int64_t) IAdd 49 50 + 52: 6(ptr) ConvertUToPtr 51 + Store 34(b2) 52 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.bufferhandle_Error.frag.out b/deps/glslang/Test/baseResults/spv.bufferhandle_Error.frag.out new file mode 100644 index 00000000..a1ee9a4b --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.bufferhandle_Error.frag.out @@ -0,0 +1,25 @@ +spv.bufferhandle_Error.frag +ERROR: 0:7: 'buffer_reference' : can only be used with buffer +ERROR: 0:9: 'buffer_reference' : cannot declare a default, can only be used on a block +ERROR: 0:10: 'buffer_reference' : can only be used with buffer +ERROR: 0:10: 'buffer_reference' : cannot declare a default, can only be used on a block +ERROR: 0:11: 'buffer_reference' : can only be used with buffer +ERROR: 0:11: 'buffer_reference' : cannot declare a default, can only be used on a block +ERROR: 0:12: 'buffer_reference' : can only be used with buffer +ERROR: 0:12: 'buffer_reference' : cannot declare a default, can only be used on a block +ERROR: 0:13: 'buffer_reference' : can only be used with buffer +ERROR: 0:13: 'buffer_reference' : can only be used with buffer +ERROR: 0:14: 'output block' : not supported in this stage: fragment +ERROR: 0:14: 'buffer_reference' : can only be used with buffer +ERROR: 0:14: 'buffer_reference' : can only be used with buffer +ERROR: 0:30: 'length' : array must be declared with a size before using this method +ERROR: 0:31: 'length' : array must be declared with a size before using this method +ERROR: 0:35: '=' : cannot convert from 'layout( column_major std430) buffer reference' to ' temp reference' +ERROR: 0:40: 'assign' : cannot convert from 'layout( column_major std430) buffer reference' to 'layout( column_major std430) buffer reference' +ERROR: 0:41: 'assign' : cannot convert from 'layout( column_major std430) buffer reference' to 'layout( column_major std430) buffer reference' +ERROR: 0:42: 'assign' : cannot convert from 'layout( column_major std430) buffer reference' to 'layout( column_major std430) buffer reference' +ERROR: 0:45: '' : syntax error, unexpected LEFT_BRACE, expecting COMMA or SEMICOLON +ERROR: 20 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.builtInXFB.vert.out b/deps/glslang/Test/baseResults/spv.builtInXFB.vert.out index f175a19f..556a698c 100644 --- a/deps/glslang/Test/baseResults/spv.builtInXFB.vert.out +++ b/deps/glslang/Test/baseResults/spv.builtInXFB.vert.out @@ -1,8 +1,4 @@ spv.builtInXFB.vert -error: SPIRV-Tools Validation Errors -error: Capability TransformFeedback is not allowed by Vulkan 1.0 specification (or requires extension) - OpCapability TransformFeedback - // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 21 diff --git a/deps/glslang/Test/baseResults/spv.computeShaderDerivatives.comp.out b/deps/glslang/Test/baseResults/spv.computeShaderDerivatives.comp.out index f05dbc00..d332f352 100644 --- a/deps/glslang/Test/baseResults/spv.computeShaderDerivatives.comp.out +++ b/deps/glslang/Test/baseResults/spv.computeShaderDerivatives.comp.out @@ -107,6 +107,7 @@ spv.computeShaderDerivatives.comp MemberDecorate 10(block) 43 Offset 480 Decorate 10(block) BufferBlock Decorate 12 DescriptorSet 0 + Decorate 12 Binding 0 Decorate 211 BuiltIn WorkgroupSize 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/spv.computeShaderDerivatives2.comp.out b/deps/glslang/Test/baseResults/spv.computeShaderDerivatives2.comp.out index 94a3dfc2..be1919bd 100644 --- a/deps/glslang/Test/baseResults/spv.computeShaderDerivatives2.comp.out +++ b/deps/glslang/Test/baseResults/spv.computeShaderDerivatives2.comp.out @@ -107,6 +107,7 @@ spv.computeShaderDerivatives2.comp MemberDecorate 10(block) 43 Offset 480 Decorate 10(block) BufferBlock Decorate 12 DescriptorSet 0 + Decorate 12 Binding 0 Decorate 211 BuiltIn WorkgroupSize 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/spv.conditionalDiscard.frag.out b/deps/glslang/Test/baseResults/spv.conditionalDiscard.frag.out index f5e9e6fa..2f2dcf26 100644 --- a/deps/glslang/Test/baseResults/spv.conditionalDiscard.frag.out +++ b/deps/glslang/Test/baseResults/spv.conditionalDiscard.frag.out @@ -15,6 +15,7 @@ spv.conditionalDiscard.frag Name 17 "coord" Name 34 "gl_FragColor" Decorate 13(tex) DescriptorSet 0 + Decorate 13(tex) Binding 0 Decorate 34(gl_FragColor) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/spv.controlFlowAttributes.frag.out b/deps/glslang/Test/baseResults/spv.controlFlowAttributes.frag.out index 2f074def..489522be 100644 --- a/deps/glslang/Test/baseResults/spv.controlFlowAttributes.frag.out +++ b/deps/glslang/Test/baseResults/spv.controlFlowAttributes.frag.out @@ -7,8 +7,7 @@ WARNING: 0:24: '' : attribute with arguments not recognized, skipping WARNING: 0:25: '' : attribute with arguments not recognized, skipping WARNING: 0:26: '' : attribute with arguments not recognized, skipping -error: SPIRV-Tools Validation Errors -error: Invalid loop control operand: 4 has invalid mask component 4 +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 118 diff --git a/deps/glslang/Test/baseResults/spv.dataOutIndirect.frag.out b/deps/glslang/Test/baseResults/spv.dataOutIndirect.frag.out index c0b52ae3..f3716010 100644 --- a/deps/glslang/Test/baseResults/spv.dataOutIndirect.frag.out +++ b/deps/glslang/Test/baseResults/spv.dataOutIndirect.frag.out @@ -18,6 +18,7 @@ spv.dataOutIndirect.frag MemberDecorate 14(b) 0 Offset 0 Decorate 14(b) Block Decorate 16(bName) DescriptorSet 0 + Decorate 16(bName) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out b/deps/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out index f9c8578c..afd8cfdf 100644 --- a/deps/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out +++ b/deps/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out @@ -83,6 +83,7 @@ void main() ModuleProcessed "resource-set-binding 3" ModuleProcessed "auto-map-locations" ModuleProcessed "client opengl100" + ModuleProcessed "target-env spirv1.3" ModuleProcessed "target-env opengl" ModuleProcessed "relaxed-errors" ModuleProcessed "suppress-warnings" @@ -95,8 +96,10 @@ void main() MemberDecorate 54(ubuf) 0 Offset 0 Decorate 54(ubuf) Block Decorate 56 DescriptorSet 3 + Decorate 56 Binding 0 Decorate 67(s2d) Location 0 Decorate 67(s2d) DescriptorSet 3 + Decorate 67(s2d) Binding 0 3: TypeVoid 4: TypeFunction 3 7: TypeInt 32 1 diff --git a/deps/glslang/Test/baseResults/spv.deepRvalue.frag.out b/deps/glslang/Test/baseResults/spv.deepRvalue.frag.out index a0e4eabc..1869d76e 100644 --- a/deps/glslang/Test/baseResults/spv.deepRvalue.frag.out +++ b/deps/glslang/Test/baseResults/spv.deepRvalue.frag.out @@ -28,6 +28,7 @@ spv.deepRvalue.frag Name 133 "t" Name 146 "gl_FragColor" Decorate 111(samp2D) DescriptorSet 0 + Decorate 111(samp2D) Binding 0 Decorate 146(gl_FragColor) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/spv.double.comp.out b/deps/glslang/Test/baseResults/spv.double.comp.out index eb8e1226..e9470ac6 100644 --- a/deps/glslang/Test/baseResults/spv.double.comp.out +++ b/deps/glslang/Test/baseResults/spv.double.comp.out @@ -26,9 +26,11 @@ spv.double.comp MemberDecorate 8(bufName) 1 Offset 8 Decorate 8(bufName) BufferBlock Decorate 10(bufInst) DescriptorSet 0 + Decorate 10(bufInst) Binding 0 Decorate 26(gl_GlobalInvocationID) BuiltIn GlobalInvocationId Decorate 33(gl_LocalInvocationID) BuiltIn LocalInvocationId Decorate 59(destTex) DescriptorSet 0 + Decorate 59(destTex) Binding 0 Decorate 59(destTex) NonReadable 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/spv.explicittypes.frag.out b/deps/glslang/Test/baseResults/spv.explicittypes.frag.out index 44f5ddd3..c07f66d5 100644 --- a/deps/glslang/Test/baseResults/spv.explicittypes.frag.out +++ b/deps/glslang/Test/baseResults/spv.explicittypes.frag.out @@ -1,8 +1,4 @@ spv.explicittypes.frag -error: SPIRV-Tools Validation Errors -error: Capability Float16 is not allowed by Vulkan 1.1 specification (or requires extension) - OpCapability Float16 - // Module Version 10300 // Generated by (magic number): 80007 // Id's are bound by 576 @@ -19,14 +15,14 @@ error: Capability Float16 is not allowed by Vulkan 1.1 specification (or require EntryPoint Fragment 4 "main" ExecutionMode 4 OriginUpperLeft Source GLSL 450 - SourceExtension "GL_KHX_shader_explicit_arithmetic_types" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float16" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float32" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float64" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int16" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int32" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int8" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float16" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float32" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float64" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int16" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int32" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int8" Name 4 "main" Name 6 "literal(" Name 8 "typeCast8(" diff --git a/deps/glslang/Test/baseResults/spv.float16.frag.out b/deps/glslang/Test/baseResults/spv.float16.frag.out index 37c66390..1f955c22 100644 --- a/deps/glslang/Test/baseResults/spv.float16.frag.out +++ b/deps/glslang/Test/baseResults/spv.float16.frag.out @@ -1,8 +1,5 @@ spv.float16.frag -error: SPIRV-Tools Validation Errors -error: Capability Float16 is not allowed by Vulkan 1.0 specification (or requires extension) - OpCapability Float16 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 534 @@ -138,6 +135,7 @@ error: Capability Float16 is not allowed by Vulkan 1.0 specification (or require MemberDecorate 516(B1) 7 Offset 160 Decorate 516(B1) Block Decorate 518 DescriptorSet 0 + Decorate 518 Binding 0 Decorate 519 ArrayStride 2 Decorate 520 ArrayStride 12 MemberDecorate 521(S) 0 Offset 0 @@ -158,6 +156,7 @@ error: Capability Float16 is not allowed by Vulkan 1.0 specification (or require MemberDecorate 523(B2) 7 Offset 72 Decorate 523(B2) BufferBlock Decorate 525 DescriptorSet 0 + Decorate 525 Binding 0 Decorate 526(sf16) SpecId 100 Decorate 527(sf) SpecId 101 Decorate 528(sd) SpecId 102 diff --git a/deps/glslang/Test/baseResults/spv.float16Fetch.frag.out b/deps/glslang/Test/baseResults/spv.float16Fetch.frag.out index 7632737a..45c80fec 100644 --- a/deps/glslang/Test/baseResults/spv.float16Fetch.frag.out +++ b/deps/glslang/Test/baseResults/spv.float16Fetch.frag.out @@ -1,8 +1,5 @@ spv.float16Fetch.frag -error: SPIRV-Tools Validation Errors -error: Capability Float16 is not allowed by Vulkan 1.0 specification (or requires extension) - OpCapability Float16 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 5923 diff --git a/deps/glslang/Test/baseResults/spv.float32.frag.out b/deps/glslang/Test/baseResults/spv.float32.frag.out index 1a325ea1..f1b0d029 100644 --- a/deps/glslang/Test/baseResults/spv.float32.frag.out +++ b/deps/glslang/Test/baseResults/spv.float32.frag.out @@ -1,8 +1,4 @@ spv.float32.frag -error: SPIRV-Tools Validation Errors -error: Capability Float16 is not allowed by Vulkan 1.1 specification (or requires extension) - OpCapability Float16 - // Module Version 10300 // Generated by (magic number): 80007 // Id's are bound by 533 @@ -20,14 +16,14 @@ error: Capability Float16 is not allowed by Vulkan 1.1 specification (or require EntryPoint Fragment 4 "main" 471 ExecutionMode 4 OriginUpperLeft Source GLSL 450 - SourceExtension "GL_KHX_shader_explicit_arithmetic_types" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float16" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float32" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float64" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int16" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int32" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int8" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float16" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float32" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float64" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int16" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int32" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int8" Name 4 "main" Name 6 "literal(" Name 8 "operators(" @@ -128,6 +124,7 @@ error: Capability Float16 is not allowed by Vulkan 1.1 specification (or require MemberDecorate 522(B1) 7 Offset 192 Decorate 522(B1) Block Decorate 524 DescriptorSet 0 + Decorate 524 Binding 0 Decorate 525(sf16) SpecId 100 Decorate 526(sf) SpecId 101 Decorate 527(sd) SpecId 102 diff --git a/deps/glslang/Test/baseResults/spv.float64.frag.out b/deps/glslang/Test/baseResults/spv.float64.frag.out index 78dca756..231f0707 100644 --- a/deps/glslang/Test/baseResults/spv.float64.frag.out +++ b/deps/glslang/Test/baseResults/spv.float64.frag.out @@ -1,8 +1,5 @@ spv.float64.frag -error: SPIRV-Tools Validation Errors -error: Capability Float16 is not allowed by Vulkan 1.1 specification (or requires extension) - OpCapability Float16 - +Validation failed // Module Version 10300 // Generated by (magic number): 80007 // Id's are bound by 524 @@ -20,14 +17,14 @@ error: Capability Float16 is not allowed by Vulkan 1.1 specification (or require EntryPoint Fragment 4 "main" 461 ExecutionMode 4 OriginUpperLeft Source GLSL 450 - SourceExtension "GL_KHX_shader_explicit_arithmetic_types" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float16" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float32" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float64" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int16" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int32" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int8" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float16" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float32" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float64" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int16" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int32" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int8" Name 4 "main" Name 6 "literal(" Name 8 "operators(" @@ -128,6 +125,7 @@ error: Capability Float16 is not allowed by Vulkan 1.1 specification (or require MemberDecorate 512(B1) 7 Offset 352 Decorate 512(B1) Block Decorate 514 DescriptorSet 0 + Decorate 514 Binding 0 Decorate 515(sf16) SpecId 100 Decorate 517(sf) SpecId 101 Decorate 518(sd) SpecId 102 diff --git a/deps/glslang/Test/baseResults/spv.fragmentDensity-es.frag.out b/deps/glslang/Test/baseResults/spv.fragmentDensity-es.frag.out new file mode 100644 index 00000000..01ac3833 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.fragmentDensity-es.frag.out @@ -0,0 +1,45 @@ +spv.fragmentDensity-es.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 18 + + Capability Shader + Capability FragmentDensityEXT + Extension "SPV_EXT_fragment_invocation_density" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 11 14 16 + ExecutionMode 4 OriginUpperLeft + Source ESSL 310 + SourceExtension "GL_EXT_fragment_invocation_density" + Name 4 "main" + Name 9 "FragSize" + Name 11 "gl_FragSizeEXT" + Name 14 "FragInvocationCount" + Name 16 "gl_FragInvocationCountEXT" + Decorate 9(FragSize) Location 0 + Decorate 11(gl_FragSizeEXT) Flat + Decorate 11(gl_FragSizeEXT) BuiltIn FragSizeEXT + Decorate 14(FragInvocationCount) Location 2 + Decorate 16(gl_FragInvocationCountEXT) Flat + Decorate 16(gl_FragInvocationCountEXT) BuiltIn FragInvocationCountEXT + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeVector 6(int) 2 + 8: TypePointer Output 7(ivec2) + 9(FragSize): 8(ptr) Variable Output + 10: TypePointer Input 7(ivec2) +11(gl_FragSizeEXT): 10(ptr) Variable Input + 13: TypePointer Output 6(int) +14(FragInvocationCount): 13(ptr) Variable Output + 15: TypePointer Input 6(int) +16(gl_FragInvocationCountEXT): 15(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 12: 7(ivec2) Load 11(gl_FragSizeEXT) + Store 9(FragSize) 12 + 17: 6(int) Load 16(gl_FragInvocationCountEXT) + Store 14(FragInvocationCount) 17 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.fragmentDensity-neg.frag.out b/deps/glslang/Test/baseResults/spv.fragmentDensity-neg.frag.out new file mode 100644 index 00000000..6b5078bd --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.fragmentDensity-neg.frag.out @@ -0,0 +1,7 @@ +spv.fragmentDensity-neg.frag +ERROR: 0:10: 'gl_FragSizeEXT' : required extension not requested: GL_EXT_fragment_invocation_density +ERROR: 0:11: 'gl_FragInvocationCountEXT' : required extension not requested: GL_EXT_fragment_invocation_density +ERROR: 2 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.fragmentDensity.frag.out b/deps/glslang/Test/baseResults/spv.fragmentDensity.frag.out new file mode 100644 index 00000000..8bbc37cc --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.fragmentDensity.frag.out @@ -0,0 +1,48 @@ +spv.fragmentDensity.frag +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 21 + + Capability Shader + Capability FragmentDensityEXT + Extension "SPV_EXT_fragment_invocation_density" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 13 17 19 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_fragment_invocation_density" + Name 4 "main" + Name 9 "FragSize" + Name 13 "gl_FragSizeEXT" + Name 17 "FragInvocationCount" + Name 19 "gl_FragInvocationCountEXT" + Decorate 9(FragSize) Location 0 + Decorate 13(gl_FragSizeEXT) Flat + Decorate 13(gl_FragSizeEXT) BuiltIn FragSizeEXT + Decorate 17(FragInvocationCount) Location 2 + Decorate 19(gl_FragInvocationCountEXT) Flat + Decorate 19(gl_FragInvocationCountEXT) BuiltIn FragInvocationCountEXT + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypePointer Output 7(fvec2) + 9(FragSize): 8(ptr) Variable Output + 10: TypeInt 32 1 + 11: TypeVector 10(int) 2 + 12: TypePointer Input 11(ivec2) +13(gl_FragSizeEXT): 12(ptr) Variable Input + 16: TypePointer Output 10(int) +17(FragInvocationCount): 16(ptr) Variable Output + 18: TypePointer Input 10(int) +19(gl_FragInvocationCountEXT): 18(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 14: 11(ivec2) Load 13(gl_FragSizeEXT) + 15: 7(fvec2) ConvertSToF 14 + Store 9(FragSize) 15 + 20: 10(int) Load 19(gl_FragInvocationCountEXT) + Store 17(FragInvocationCount) 20 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.fragmentDensity.vert.out b/deps/glslang/Test/baseResults/spv.fragmentDensity.vert.out new file mode 100644 index 00000000..ff77a3ec --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.fragmentDensity.vert.out @@ -0,0 +1,9 @@ +spv.fragmentDensity.vert +ERROR: 0:10: 'gl_FragSizeEXT' : undeclared identifier +ERROR: 0:10: 'assign' : cannot convert from ' temp float' to 'layout( location=0) smooth out highp 2-component vector of uint' +ERROR: 0:11: 'gl_FragInvocationCountEXT' : undeclared identifier +ERROR: 0:11: 'assign' : cannot convert from ' temp float' to 'layout( location=2) smooth out highp int' +ERROR: 4 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.functionNestedOpaque.vert.out b/deps/glslang/Test/baseResults/spv.functionNestedOpaque.vert.out index 31938f80..df590c19 100644 --- a/deps/glslang/Test/baseResults/spv.functionNestedOpaque.vert.out +++ b/deps/glslang/Test/baseResults/spv.functionNestedOpaque.vert.out @@ -1,9 +1,5 @@ spv.functionNestedOpaque.vert -error: SPIRV-Tools Validation Errors -error: From Vulkan spec, section 14.5.2: -Variables identified with the UniformConstant storage class are used only as handles to refer to opaque resources. Such variables must be typed as OpTypeImage, OpTypeSampler, OpTypeSampledImage, OpTypeAccelerationStructureNV, or an array of one of these types. - %si = OpVariable %_ptr_UniformConstant_S UniformConstant - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 39 diff --git a/deps/glslang/Test/baseResults/spv.glsl.register.autoassign.frag.out b/deps/glslang/Test/baseResults/spv.glsl.register.autoassign.frag.out index 079e8d52..9c8ccb50 100644 --- a/deps/glslang/Test/baseResults/spv.glsl.register.autoassign.frag.out +++ b/deps/glslang/Test/baseResults/spv.glsl.register.autoassign.frag.out @@ -73,11 +73,14 @@ spv.glsl.register.autoassign.frag Decorate 119(g_tTex_unused1) DescriptorSet 0 Decorate 119(g_tTex_unused1) Binding 10 Decorate 121(g_sSamp_unused1) DescriptorSet 0 + Decorate 121(g_sSamp_unused1) Binding 0 Decorate 126(g_tTex_unused2) DescriptorSet 0 Decorate 126(g_tTex_unused2) Binding 12 Decorate 128(g_sSamp_unused2) DescriptorSet 0 + Decorate 128(g_sSamp_unused2) Binding 0 Decorate 137(FragColor) Location 0 Decorate 141(g_tTex_unused3) DescriptorSet 0 + Decorate 141(g_tTex_unused3) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.hlslOffsets.vert.out b/deps/glslang/Test/baseResults/spv.hlslOffsets.vert.out index af59fdbf..84dc47b2 100644 --- a/deps/glslang/Test/baseResults/spv.hlslOffsets.vert.out +++ b/deps/glslang/Test/baseResults/spv.hlslOffsets.vert.out @@ -60,6 +60,7 @@ Shader version: 450 MemberDecorate 11(block) 13 Offset 112 Decorate 11(block) BufferBlock Decorate 13 DescriptorSet 0 + Decorate 13 Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.image.frag.out b/deps/glslang/Test/baseResults/spv.image.frag.out index a5441801..0fefd01a 100644 --- a/deps/glslang/Test/baseResults/spv.image.frag.out +++ b/deps/glslang/Test/baseResults/spv.image.frag.out @@ -1,8 +1,5 @@ spv.image.frag -error: SPIRV-Tools Validation Errors -error: Capability ImageRect is not allowed by Vulkan 1.0 specification (or requires extension) - OpCapability ImageRect - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 395 diff --git a/deps/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out b/deps/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out index db9177d0..28cd4f96 100644 --- a/deps/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out +++ b/deps/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out @@ -1,8 +1,5 @@ spv.imageLoadStoreLod.frag -error: SPIRV-Tools Validation Errors -error: Image Operand Lod can only be used with ExplicitLod opcodes and OpImageFetch - %19 = OpImageRead %v4float %15 %int_1 Lod %int_3 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 82 diff --git a/deps/glslang/Test/baseResults/spv.int16.amd.frag.out b/deps/glslang/Test/baseResults/spv.int16.amd.frag.out index 0e3323bf..26c701db 100644 --- a/deps/glslang/Test/baseResults/spv.int16.amd.frag.out +++ b/deps/glslang/Test/baseResults/spv.int16.amd.frag.out @@ -1,8 +1,4 @@ spv.int16.amd.frag -error: SPIRV-Tools Validation Errors -error: Capability Float16 is not allowed by Vulkan 1.0 specification (or requires extension) - OpCapability Float16 - // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 560 diff --git a/deps/glslang/Test/baseResults/spv.int16.frag.out b/deps/glslang/Test/baseResults/spv.int16.frag.out index 3ba5c071..a7b9bfe6 100644 --- a/deps/glslang/Test/baseResults/spv.int16.frag.out +++ b/deps/glslang/Test/baseResults/spv.int16.frag.out @@ -1,8 +1,4 @@ spv.int16.frag -error: SPIRV-Tools Validation Errors -error: Capability Float16 is not allowed by Vulkan 1.0 specification (or requires extension) - OpCapability Float16 - // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 523 @@ -20,14 +16,14 @@ error: Capability Float16 is not allowed by Vulkan 1.0 specification (or require EntryPoint Fragment 4 "main" ExecutionMode 4 OriginUpperLeft Source GLSL 450 - SourceExtension "GL_KHX_shader_explicit_arithmetic_types" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float16" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float32" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float64" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int16" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int32" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int8" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float16" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float32" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float64" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int16" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int32" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int8" Name 4 "main" Name 6 "literal(" Name 8 "typeCast16(" diff --git a/deps/glslang/Test/baseResults/spv.int32.frag.out b/deps/glslang/Test/baseResults/spv.int32.frag.out index 3b934284..e5c78894 100644 --- a/deps/glslang/Test/baseResults/spv.int32.frag.out +++ b/deps/glslang/Test/baseResults/spv.int32.frag.out @@ -1,8 +1,4 @@ spv.int32.frag -error: SPIRV-Tools Validation Errors -error: Capability Float16 is not allowed by Vulkan 1.1 specification (or requires extension) - OpCapability Float16 - // Module Version 10300 // Generated by (magic number): 80007 // Id's are bound by 493 @@ -18,14 +14,14 @@ error: Capability Float16 is not allowed by Vulkan 1.1 specification (or require EntryPoint Fragment 4 "main" ExecutionMode 4 OriginUpperLeft Source GLSL 450 - SourceExtension "GL_KHX_shader_explicit_arithmetic_types" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float16" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float32" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float64" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int16" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int32" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int8" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float16" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float32" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float64" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int16" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int32" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int8" Name 4 "main" Name 6 "literal(" Name 8 "typeCast32(" diff --git a/deps/glslang/Test/baseResults/spv.int64.frag.out b/deps/glslang/Test/baseResults/spv.int64.frag.out index f2c54f16..b1375a66 100644 --- a/deps/glslang/Test/baseResults/spv.int64.frag.out +++ b/deps/glslang/Test/baseResults/spv.int64.frag.out @@ -1,8 +1,5 @@ spv.int64.frag -error: SPIRV-Tools Validation Errors -error: OpDecorate SpecId decoration target '1' is not a scalar specialization constant. - OpDecorate %su64inc SpecId 105 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 489 @@ -16,7 +13,7 @@ error: OpDecorate SpecId decoration target '1' is not a scalar specializati ExecutionMode 4 OriginUpperLeft Source GLSL 450 SourceExtension "GL_ARB_gpu_shader_int64" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int64" Name 4 "main" Name 6 "literal(" Name 8 "typeCast(" diff --git a/deps/glslang/Test/baseResults/spv.int8.frag.out b/deps/glslang/Test/baseResults/spv.int8.frag.out index 1c65384f..71307d80 100644 --- a/deps/glslang/Test/baseResults/spv.int8.frag.out +++ b/deps/glslang/Test/baseResults/spv.int8.frag.out @@ -1,8 +1,4 @@ spv.int8.frag -error: SPIRV-Tools Validation Errors -error: Capability Float16 is not allowed by Vulkan 1.1 specification (or requires extension) - OpCapability Float16 - // Module Version 10300 // Generated by (magic number): 80007 // Id's are bound by 518 @@ -20,14 +16,14 @@ error: Capability Float16 is not allowed by Vulkan 1.1 specification (or require EntryPoint Fragment 4 "main" ExecutionMode 4 OriginUpperLeft Source GLSL 450 - SourceExtension "GL_KHX_shader_explicit_arithmetic_types" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float16" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float32" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float64" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int16" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int32" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int8" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float16" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float32" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float64" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int16" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int32" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int8" Name 4 "main" Name 6 "literal(" Name 8 "typeCast8(" diff --git a/deps/glslang/Test/baseResults/spv.localAggregates.frag.out b/deps/glslang/Test/baseResults/spv.localAggregates.frag.out index 5f89611e..f5fad547 100644 --- a/deps/glslang/Test/baseResults/spv.localAggregates.frag.out +++ b/deps/glslang/Test/baseResults/spv.localAggregates.frag.out @@ -42,6 +42,7 @@ spv.localAggregates.frag Decorate 90(condition) Flat Decorate 108(gl_FragColor) Location 0 Decorate 128(samp2D) DescriptorSet 0 + Decorate 128(samp2D) Binding 0 Decorate 134(foo) Flat Decorate 135(foo2) Flat 2: TypeVoid diff --git a/deps/glslang/Test/baseResults/spv.matFun.vert.out b/deps/glslang/Test/baseResults/spv.matFun.vert.out index 47b692f7..8ed378f8 100644 --- a/deps/glslang/Test/baseResults/spv.matFun.vert.out +++ b/deps/glslang/Test/baseResults/spv.matFun.vert.out @@ -44,6 +44,7 @@ spv.matFun.vert MemberDecorate 77(bl) 1 MatrixStride 16 Decorate 77(bl) Block Decorate 79(bName) DescriptorSet 0 + Decorate 79(bName) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.memoryQualifier.frag.out b/deps/glslang/Test/baseResults/spv.memoryQualifier.frag.out index 4113cc95..93c6b2db 100644 --- a/deps/glslang/Test/baseResults/spv.memoryQualifier.frag.out +++ b/deps/glslang/Test/baseResults/spv.memoryQualifier.frag.out @@ -1,8 +1,5 @@ spv.memoryQualifier.frag -error: SPIRV-Tools Validation Errors -error: Capability ImageRect is not allowed by Vulkan 1.0 specification (or requires extension) - OpCapability ImageRect - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 97 @@ -70,6 +67,7 @@ error: Capability ImageRect is not allowed by Vulkan 1.0 specification (or requi MemberDecorate 50(Buffer) 5 Offset 56 Decorate 50(Buffer) BufferBlock Decorate 52 DescriptorSet 0 + Decorate 52 Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.memoryScopeSemantics.comp.out b/deps/glslang/Test/baseResults/spv.memoryScopeSemantics.comp.out index 46f9a078..4c79a109 100644 --- a/deps/glslang/Test/baseResults/spv.memoryScopeSemantics.comp.out +++ b/deps/glslang/Test/baseResults/spv.memoryScopeSemantics.comp.out @@ -1,7 +1,7 @@ spv.memoryScopeSemantics.comp -// Module Version 10000 +// Module Version 10300 // Generated by (magic number): 80007 -// Id's are bound by 142 +// Id's are bound by 143 Capability Shader Capability Int64 @@ -39,36 +39,36 @@ spv.memoryScopeSemantics.comp Name 98 "BufferK" MemberName 98(BufferK) 0 "x" Name 100 "bufferk" - Name 109 "imagej" - Name 121 "samp" - Name 132 "atomu64" - Name 137 "atomi64" + Name 110 "imagej" + Name 122 "samp" + Name 133 "atomu64" + Name 138 "atomi64" Decorate 36(imagei) DescriptorSet 0 Decorate 36(imagei) Binding 1 Decorate 45(imageu) DescriptorSet 0 Decorate 45(imageu) Binding 0 MemberDecorate 65(BufferU) 0 Offset 0 - Decorate 65(BufferU) BufferBlock + Decorate 65(BufferU) Block Decorate 67(bufferu) DescriptorSet 0 Decorate 67(bufferu) Binding 2 MemberDecorate 77(BufferI) 0 Offset 0 - Decorate 77(BufferI) BufferBlock + Decorate 77(BufferI) Block Decorate 79(bufferi) DescriptorSet 0 Decorate 79(bufferi) Binding 3 Decorate 82 ArrayStride 4 MemberDecorate 83(A) 0 Offset 0 MemberDecorate 84(BufferJ) 0 Offset 0 - Decorate 84(BufferJ) BufferBlock + Decorate 84(BufferJ) Block Decorate 87(bufferj) DescriptorSet 0 Decorate 87(bufferj) Binding 4 MemberDecorate 98(BufferK) 0 Offset 0 Decorate 98(BufferK) Block Decorate 100(bufferk) DescriptorSet 0 Decorate 100(bufferk) Binding 7 - Decorate 109(imagej) DescriptorSet 0 - Decorate 109(imagej) Binding 5 - Decorate 121(samp) DescriptorSet 0 - Decorate 121(samp) Binding 6 + Decorate 110(imagej) DescriptorSet 0 + Decorate 110(imagej) Binding 5 + Decorate 122(samp) DescriptorSet 0 + Decorate 122(samp) Binding 6 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -110,47 +110,48 @@ spv.memoryScopeSemantics.comp 61: 15(int) Constant 10 63: 15(int) Constant 322 65(BufferU): TypeStruct 15(int) - 66: TypePointer Uniform 65(BufferU) - 67(bufferu): 66(ptr) Variable Uniform - 68: TypePointer Uniform 15(int) + 66: TypePointer StorageBuffer 65(BufferU) + 67(bufferu): 66(ptr) Variable StorageBuffer + 68: TypePointer StorageBuffer 15(int) 70: 15(int) Constant 1 77(BufferI): TypeStruct 15(int) - 78: TypePointer Uniform 77(BufferI) - 79(bufferi): 78(ptr) Variable Uniform + 78: TypePointer StorageBuffer 77(BufferI) + 79(bufferi): 78(ptr) Variable StorageBuffer 82: TypeArray 15(int) 26 83(A): TypeStruct 82 84(BufferJ): TypeStruct 83(A) 85: TypeArray 84(BufferJ) 26 - 86: TypePointer Uniform 85 - 87(bufferj): 86(ptr) Variable Uniform - 94: TypePointer Uniform 83(A) + 86: TypePointer StorageBuffer 85 + 87(bufferj): 86(ptr) Variable StorageBuffer + 94: TypePointer StorageBuffer 83(A) 98(BufferK): TypeStruct 15(int) 99: TypePointer Uniform 98(BufferK) 100(bufferk): 99(ptr) Variable Uniform - 105: TypeVector 6(int) 4 - 107: TypeArray 34 26 - 108: TypePointer UniformConstant 107 - 109(imagej): 108(ptr) Variable UniformConstant - 115: 105(ivec4) ConstantComposite 38 38 38 38 - 116: TypeFloat 32 - 117: TypeImage 116(float) 2D sampled format:Unknown - 118: TypeSampledImage 117 - 119: TypeArray 118 26 - 120: TypePointer UniformConstant 119 - 121(samp): 120(ptr) Variable UniformConstant - 122: TypePointer UniformConstant 118 - 125: TypeVector 116(float) 2 - 126: 116(float) Constant 0 - 127: 125(fvec2) ConstantComposite 126 126 - 128: TypeVector 116(float) 4 - 130: TypeInt 64 0 - 131: TypePointer Workgroup 130(int64_t) - 132(atomu64): 131(ptr) Variable Workgroup - 133:130(int64_t) Constant 7 0 - 135: TypeInt 64 1 - 136: TypePointer Workgroup 135(int64_t) - 137(atomi64): 136(ptr) Variable Workgroup - 138:135(int64_t) Constant 10 0 + 101: TypePointer Uniform 15(int) + 106: TypeVector 6(int) 4 + 108: TypeArray 34 26 + 109: TypePointer UniformConstant 108 + 110(imagej): 109(ptr) Variable UniformConstant + 116: 106(ivec4) ConstantComposite 38 38 38 38 + 117: TypeFloat 32 + 118: TypeImage 117(float) 2D sampled format:Unknown + 119: TypeSampledImage 118 + 120: TypeArray 119 26 + 121: TypePointer UniformConstant 120 + 122(samp): 121(ptr) Variable UniformConstant + 123: TypePointer UniformConstant 119 + 126: TypeVector 117(float) 2 + 127: 117(float) Constant 0 + 128: 126(fvec2) ConstantComposite 127 127 + 129: TypeVector 117(float) 4 + 131: TypeInt 64 0 + 132: TypePointer Workgroup 131(int64_t) + 133(atomu64): 132(ptr) Variable Workgroup + 134:131(int64_t) Constant 7 0 + 136: TypeInt 64 1 + 137: TypePointer Workgroup 136(int64_t) + 138(atomi64): 137(ptr) Variable Workgroup + 139:136(int64_t) Constant 10 0 4(main): 2 Function None 3 5: Label 8(origi): 7(ptr) Variable Function @@ -215,25 +216,25 @@ spv.memoryScopeSemantics.comp 96: 83(A) Load 95 Volatile MakePointerVisibleKHR NonPrivatePointerKHR 46 97: 94(ptr) AccessChain 87(bufferj) 38 38 Store 97 96 Volatile MakePointerAvailableKHR NonPrivatePointerKHR 46 - 101: 68(ptr) AccessChain 100(bufferk) 38 - 102: 15(int) Load 101 NonPrivatePointerKHR - 103: 68(ptr) AccessChain 79(bufferi) 38 - Store 103 102 MakePointerAvailableKHR NonPrivatePointerKHR 16 - 104: 34 Load 36(imagei) - 106: 105(ivec4) ImageRead 104 39 MakeTexelVisibleKHR NonPrivateTexelKHR VolatileTexelKHR 16 - 110: 35(ptr) AccessChain 109(imagej) 38 - 111: 34 Load 110 - 112: 105(ivec4) ImageRead 111 39 NonPrivateTexelKHR - 113: 35(ptr) AccessChain 109(imagej) 12 - 114: 34 Load 113 - ImageWrite 114 39 115 NonPrivateTexelKHR - 123: 122(ptr) AccessChain 121(samp) 38 - 124: 118 Load 123 - 129: 128(fvec4) ImageSampleExplicitLod 124 127 Lod NonPrivateTexelKHR 126 - 134:130(int64_t) AtomicUMax 132(atomu64) 12 17 133 - Store 132(atomu64) 134 MakePointerAvailableKHR NonPrivatePointerKHR 26 - 139:130(int64_t) Load 132(atomu64) MakePointerVisibleKHR NonPrivatePointerKHR 26 - 140:135(int64_t) Bitcast 139 - 141:135(int64_t) AtomicCompareExchange 137(atomi64) 12 63 63 140 138 + 102: 101(ptr) AccessChain 100(bufferk) 38 + 103: 15(int) Load 102 NonPrivatePointerKHR + 104: 68(ptr) AccessChain 79(bufferi) 38 + Store 104 103 MakePointerAvailableKHR NonPrivatePointerKHR 16 + 105: 34 Load 36(imagei) + 107: 106(ivec4) ImageRead 105 39 MakeTexelVisibleKHR NonPrivateTexelKHR VolatileTexelKHR 16 + 111: 35(ptr) AccessChain 110(imagej) 38 + 112: 34 Load 111 + 113: 106(ivec4) ImageRead 112 39 NonPrivateTexelKHR + 114: 35(ptr) AccessChain 110(imagej) 12 + 115: 34 Load 114 + ImageWrite 115 39 116 NonPrivateTexelKHR + 124: 123(ptr) AccessChain 122(samp) 38 + 125: 119 Load 124 + 130: 129(fvec4) ImageSampleExplicitLod 125 128 Lod NonPrivateTexelKHR 127 + 135:131(int64_t) AtomicUMax 133(atomu64) 12 17 134 + Store 133(atomu64) 135 MakePointerAvailableKHR NonPrivatePointerKHR 26 + 140:131(int64_t) Load 133(atomu64) MakePointerVisibleKHR NonPrivatePointerKHR 26 + 141:136(int64_t) Bitcast 140 + 142:136(int64_t) AtomicCompareExchange 138(atomi64) 12 63 63 141 139 Return FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.meshShaderSharedMem.mesh.out b/deps/glslang/Test/baseResults/spv.meshShaderSharedMem.mesh.out index 198f8129..dd0003dd 100644 --- a/deps/glslang/Test/baseResults/spv.meshShaderSharedMem.mesh.out +++ b/deps/glslang/Test/baseResults/spv.meshShaderSharedMem.mesh.out @@ -31,7 +31,9 @@ spv.meshShaderSharedMem.mesh MemberDecorate 37(block0) 0 Offset 0 Decorate 37(block0) Block Decorate 39 DescriptorSet 0 + Decorate 39 Binding 0 Decorate 55(uni_image) DescriptorSet 0 + Decorate 55(uni_image) Binding 0 Decorate 55(uni_image) NonReadable Decorate 76 BuiltIn WorkgroupSize 2: TypeVoid diff --git a/deps/glslang/Test/baseResults/spv.meshShaderTaskMem.mesh.out b/deps/glslang/Test/baseResults/spv.meshShaderTaskMem.mesh.out index 93b2a457..e14f7a85 100644 --- a/deps/glslang/Test/baseResults/spv.meshShaderTaskMem.mesh.out +++ b/deps/glslang/Test/baseResults/spv.meshShaderTaskMem.mesh.out @@ -43,6 +43,7 @@ spv.meshShaderTaskMem.mesh MemberDecorate 36(bufferBlock) 1 Offset 16 Decorate 36(bufferBlock) BufferBlock Decorate 38(mybuf) DescriptorSet 0 + Decorate 38(mybuf) Binding 0 Decorate 57 BuiltIn WorkgroupSize 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/spv.meshTaskShader.task.out b/deps/glslang/Test/baseResults/spv.meshTaskShader.task.out index 9ac27fa9..a835d7fe 100644 --- a/deps/glslang/Test/baseResults/spv.meshTaskShader.task.out +++ b/deps/glslang/Test/baseResults/spv.meshTaskShader.task.out @@ -1,14 +1,14 @@ spv.meshTaskShader.task // Module Version 10000 // Generated by (magic number): 80007 -// Id's are bound by 104 +// Id's are bound by 116 Capability StorageImageWriteWithoutFormat Capability MeshShadingNV Extension "SPV_NV_mesh_shader" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint TaskNV 4 "main" 11 17 80 101 + EntryPoint TaskNV 4 "main" 11 17 24 25 90 113 ExecutionMode 4 LocalSize 32 1 1 Source GLSL 450 SourceExtension "GL_NV_mesh_shader" @@ -17,33 +17,42 @@ spv.meshTaskShader.task Name 11 "gl_LocalInvocationID" Name 16 "gid" Name 17 "gl_WorkGroupID" - Name 20 "i" - Name 34 "mem" - Name 37 "block0" - MemberName 37(block0) 0 "uni_value" - Name 39 "" - Name 55 "uni_image" - Name 78 "Task" - MemberName 78(Task) 0 "dummy" - MemberName 78(Task) 1 "submesh" - Name 80 "mytask" - Name 101 "gl_TaskCountNV" + Name 20 "viewID" + Name 24 "gl_MeshViewIndicesNV" + Name 25 "gl_MeshViewCountNV" + Name 30 "i" + Name 44 "mem" + Name 47 "block0" + MemberName 47(block0) 0 "uni_value" + Name 49 "" + Name 65 "uni_image" + Name 88 "Task" + MemberName 88(Task) 0 "dummy" + MemberName 88(Task) 1 "submesh" + MemberName 88(Task) 2 "viewID" + Name 90 "mytask" + Name 113 "gl_TaskCountNV" Decorate 11(gl_LocalInvocationID) BuiltIn LocalInvocationId Decorate 17(gl_WorkGroupID) BuiltIn WorkgroupId - MemberDecorate 37(block0) 0 Offset 0 - Decorate 37(block0) Block - Decorate 39 DescriptorSet 0 - Decorate 55(uni_image) DescriptorSet 0 - Decorate 55(uni_image) Binding 0 - Decorate 55(uni_image) NonReadable - Decorate 77 ArrayStride 8 - MemberDecorate 78(Task) 0 PerTaskNV - MemberDecorate 78(Task) 0 Offset 0 - MemberDecorate 78(Task) 1 PerTaskNV - MemberDecorate 78(Task) 1 Offset 8 - Decorate 78(Task) Block - Decorate 101(gl_TaskCountNV) BuiltIn TaskCountNV - Decorate 103 BuiltIn WorkgroupSize + Decorate 24(gl_MeshViewIndicesNV) BuiltIn MeshViewIndicesNV + Decorate 25(gl_MeshViewCountNV) BuiltIn MeshViewCountNV + MemberDecorate 47(block0) 0 Offset 0 + Decorate 47(block0) Block + Decorate 49 DescriptorSet 0 + Decorate 49 Binding 0 + Decorate 65(uni_image) DescriptorSet 0 + Decorate 65(uni_image) Binding 0 + Decorate 65(uni_image) NonReadable + Decorate 87 ArrayStride 8 + MemberDecorate 88(Task) 0 PerTaskNV + MemberDecorate 88(Task) 0 Offset 0 + MemberDecorate 88(Task) 1 PerTaskNV + MemberDecorate 88(Task) 1 Offset 8 + MemberDecorate 88(Task) 2 PerTaskNV + MemberDecorate 88(Task) 2 Offset 32 + Decorate 88(Task) Block + Decorate 113(gl_TaskCountNV) BuiltIn TaskCountNV + Decorate 115 BuiltIn WorkgroupSize 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 @@ -54,119 +63,133 @@ spv.meshTaskShader.task 12: 6(int) Constant 0 13: TypePointer Input 6(int) 17(gl_WorkGroupID): 10(ptr) Variable Input - 27: 6(int) Constant 10 - 28: TypeBool - 30: TypeFloat 32 - 31: TypeVector 30(float) 4 - 32: TypeArray 31(fvec4) 27 - 33: TypePointer Workgroup 32 - 34(mem): 33(ptr) Variable Workgroup - 37(block0): TypeStruct 6(int) - 38: TypePointer Uniform 37(block0) - 39: 38(ptr) Variable Uniform - 40: TypeInt 32 1 - 41: 40(int) Constant 0 - 42: TypePointer Uniform 6(int) - 48: TypePointer Workgroup 31(fvec4) - 51: 40(int) Constant 1 - 53: TypeImage 30(float) 2D nonsampled format:Unknown - 54: TypePointer UniformConstant 53 - 55(uni_image): 54(ptr) Variable UniformConstant - 59: TypeVector 40(int) 2 - 69: 6(int) Constant 1 - 73: 6(int) Constant 264 - 74: 6(int) Constant 2 - 75: TypeVector 30(float) 2 - 76: 6(int) Constant 3 - 77: TypeArray 75(fvec2) 76 - 78(Task): TypeStruct 75(fvec2) 77 - 79: TypePointer Output 78(Task) - 80(mytask): 79(ptr) Variable Output - 81: 30(float) Constant 1106247680 - 82: 30(float) Constant 1106771968 - 83: 75(fvec2) ConstantComposite 81 82 - 84: TypePointer Output 75(fvec2) - 86: 30(float) Constant 1107296256 - 87: 30(float) Constant 1107558400 - 88: 75(fvec2) ConstantComposite 86 87 - 90: 30(float) Constant 1107820544 - 91: 30(float) Constant 1108082688 - 92: 75(fvec2) ConstantComposite 90 91 - 94: 40(int) Constant 2 - 100: TypePointer Output 6(int) -101(gl_TaskCountNV): 100(ptr) Variable Output - 102: 6(int) Constant 32 - 103: 9(ivec3) ConstantComposite 102 69 69 + 21: 6(int) Constant 4 + 22: TypeArray 6(int) 21 + 23: TypePointer Input 22 +24(gl_MeshViewIndicesNV): 23(ptr) Variable Input +25(gl_MeshViewCountNV): 13(ptr) Variable Input + 37: 6(int) Constant 10 + 38: TypeBool + 40: TypeFloat 32 + 41: TypeVector 40(float) 4 + 42: TypeArray 41(fvec4) 37 + 43: TypePointer Workgroup 42 + 44(mem): 43(ptr) Variable Workgroup + 47(block0): TypeStruct 6(int) + 48: TypePointer Uniform 47(block0) + 49: 48(ptr) Variable Uniform + 50: TypeInt 32 1 + 51: 50(int) Constant 0 + 52: TypePointer Uniform 6(int) + 58: TypePointer Workgroup 41(fvec4) + 61: 50(int) Constant 1 + 63: TypeImage 40(float) 2D nonsampled format:Unknown + 64: TypePointer UniformConstant 63 + 65(uni_image): 64(ptr) Variable UniformConstant + 69: TypeVector 50(int) 2 + 79: 6(int) Constant 1 + 83: 6(int) Constant 264 + 84: 6(int) Constant 2 + 85: TypeVector 40(float) 2 + 86: 6(int) Constant 3 + 87: TypeArray 85(fvec2) 86 + 88(Task): TypeStruct 85(fvec2) 87 6(int) + 89: TypePointer Output 88(Task) + 90(mytask): 89(ptr) Variable Output + 91: 40(float) Constant 1106247680 + 92: 40(float) Constant 1106771968 + 93: 85(fvec2) ConstantComposite 91 92 + 94: TypePointer Output 85(fvec2) + 96: 40(float) Constant 1107296256 + 97: 40(float) Constant 1107558400 + 98: 85(fvec2) ConstantComposite 96 97 + 100: 40(float) Constant 1107820544 + 101: 40(float) Constant 1108082688 + 102: 85(fvec2) ConstantComposite 100 101 + 104: 50(int) Constant 2 + 111: TypePointer Output 6(int) +113(gl_TaskCountNV): 111(ptr) Variable Output + 114: 6(int) Constant 32 + 115: 9(ivec3) ConstantComposite 114 79 79 4(main): 2 Function None 3 5: Label 8(iid): 7(ptr) Variable Function 16(gid): 7(ptr) Variable Function - 20(i): 7(ptr) Variable Function + 20(viewID): 7(ptr) Variable Function + 30(i): 7(ptr) Variable Function 14: 13(ptr) AccessChain 11(gl_LocalInvocationID) 12 15: 6(int) Load 14 Store 8(iid) 15 18: 13(ptr) AccessChain 17(gl_WorkGroupID) 12 19: 6(int) Load 18 Store 16(gid) 19 - Store 20(i) 12 - Branch 21 - 21: Label - LoopMerge 23 24 None - Branch 25 - 25: Label - 26: 6(int) Load 20(i) - 29: 28(bool) ULessThan 26 27 - BranchConditional 29 22 23 - 22: Label - 35: 6(int) Load 20(i) - 36: 6(int) Load 20(i) - 43: 42(ptr) AccessChain 39 41 - 44: 6(int) Load 43 - 45: 6(int) IAdd 36 44 - 46: 30(float) ConvertUToF 45 - 47: 31(fvec4) CompositeConstruct 46 46 46 46 - 49: 48(ptr) AccessChain 34(mem) 35 - Store 49 47 - Branch 24 - 24: Label - 50: 6(int) Load 20(i) - 52: 6(int) IAdd 50 51 - Store 20(i) 52 - Branch 21 - 23: Label - 56: 53 Load 55(uni_image) - 57: 6(int) Load 8(iid) - 58: 40(int) Bitcast 57 - 60: 59(ivec2) CompositeConstruct 58 58 - 61: 6(int) Load 16(gid) - 62: 48(ptr) AccessChain 34(mem) 61 - 63: 31(fvec4) Load 62 - ImageWrite 56 60 63 - 64: 53 Load 55(uni_image) - 65: 6(int) Load 8(iid) - 66: 40(int) Bitcast 65 - 67: 59(ivec2) CompositeConstruct 66 66 - 68: 6(int) Load 16(gid) - 70: 6(int) IAdd 68 69 - 71: 48(ptr) AccessChain 34(mem) 70 - 72: 31(fvec4) Load 71 - ImageWrite 64 67 72 - MemoryBarrier 69 73 - ControlBarrier 74 74 73 - 85: 84(ptr) AccessChain 80(mytask) 41 - Store 85 83 - 89: 84(ptr) AccessChain 80(mytask) 51 41 - Store 89 88 - 93: 84(ptr) AccessChain 80(mytask) 51 51 - Store 93 92 - 95: 6(int) Load 16(gid) - 96: 6(int) UMod 95 74 - 97: 84(ptr) AccessChain 80(mytask) 51 96 - 98: 75(fvec2) Load 97 - 99: 84(ptr) AccessChain 80(mytask) 51 94 + 26: 6(int) Load 25(gl_MeshViewCountNV) + 27: 6(int) UMod 26 21 + 28: 13(ptr) AccessChain 24(gl_MeshViewIndicesNV) 27 + 29: 6(int) Load 28 + Store 20(viewID) 29 + Store 30(i) 12 + Branch 31 + 31: Label + LoopMerge 33 34 None + Branch 35 + 35: Label + 36: 6(int) Load 30(i) + 39: 38(bool) ULessThan 36 37 + BranchConditional 39 32 33 + 32: Label + 45: 6(int) Load 30(i) + 46: 6(int) Load 30(i) + 53: 52(ptr) AccessChain 49 51 + 54: 6(int) Load 53 + 55: 6(int) IAdd 46 54 + 56: 40(float) ConvertUToF 55 + 57: 41(fvec4) CompositeConstruct 56 56 56 56 + 59: 58(ptr) AccessChain 44(mem) 45 + Store 59 57 + Branch 34 + 34: Label + 60: 6(int) Load 30(i) + 62: 6(int) IAdd 60 61 + Store 30(i) 62 + Branch 31 + 33: Label + 66: 63 Load 65(uni_image) + 67: 6(int) Load 8(iid) + 68: 50(int) Bitcast 67 + 70: 69(ivec2) CompositeConstruct 68 68 + 71: 6(int) Load 16(gid) + 72: 58(ptr) AccessChain 44(mem) 71 + 73: 41(fvec4) Load 72 + ImageWrite 66 70 73 + 74: 63 Load 65(uni_image) + 75: 6(int) Load 8(iid) + 76: 50(int) Bitcast 75 + 77: 69(ivec2) CompositeConstruct 76 76 + 78: 6(int) Load 16(gid) + 80: 6(int) IAdd 78 79 + 81: 58(ptr) AccessChain 44(mem) 80 + 82: 41(fvec4) Load 81 + ImageWrite 74 77 82 + MemoryBarrier 79 83 + ControlBarrier 84 84 83 + 95: 94(ptr) AccessChain 90(mytask) 51 + Store 95 93 + 99: 94(ptr) AccessChain 90(mytask) 61 51 Store 99 98 - MemoryBarrier 69 73 - ControlBarrier 74 74 73 - Store 101(gl_TaskCountNV) 76 + 103: 94(ptr) AccessChain 90(mytask) 61 61 + Store 103 102 + 105: 6(int) Load 16(gid) + 106: 6(int) UMod 105 84 + 107: 94(ptr) AccessChain 90(mytask) 61 106 + 108: 85(fvec2) Load 107 + 109: 94(ptr) AccessChain 90(mytask) 61 104 + Store 109 108 + 110: 6(int) Load 20(viewID) + 112: 111(ptr) AccessChain 90(mytask) 104 + Store 112 110 + MemoryBarrier 79 83 + ControlBarrier 84 84 83 + Store 113(gl_TaskCountNV) 86 Return FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.multiStructFuncall.frag.out b/deps/glslang/Test/baseResults/spv.multiStructFuncall.frag.out index 14c851ca..a3a4480a 100644 --- a/deps/glslang/Test/baseResults/spv.multiStructFuncall.frag.out +++ b/deps/glslang/Test/baseResults/spv.multiStructFuncall.frag.out @@ -37,6 +37,7 @@ spv.multiStructFuncall.frag MemberDecorate 23(blockName) 0 Offset 0 Decorate 23(blockName) BufferBlock Decorate 25 DescriptorSet 0 + Decorate 25 Binding 0 MemberDecorate 31(S) 0 ColMajor 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/spv.multiviewPerViewAttributes.tesc.out b/deps/glslang/Test/baseResults/spv.multiviewPerViewAttributes.tesc.out index 7874b946..16bea3db 100644 --- a/deps/glslang/Test/baseResults/spv.multiviewPerViewAttributes.tesc.out +++ b/deps/glslang/Test/baseResults/spv.multiviewPerViewAttributes.tesc.out @@ -1,8 +1,5 @@ spv.multiviewPerViewAttributes.tesc -error: SPIRV-Tools Validation Errors -error: OpMemberName Member '5' index is larger than Type '27[gl_PositionPerViewNV]'s member count. - OpMemberName %gl_PerVertex_0 5 "gl_PositionPerViewNV" - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 37 diff --git a/deps/glslang/Test/baseResults/spv.newTexture.frag.out b/deps/glslang/Test/baseResults/spv.newTexture.frag.out index 5e462bed..1bad3fa7 100644 --- a/deps/glslang/Test/baseResults/spv.newTexture.frag.out +++ b/deps/glslang/Test/baseResults/spv.newTexture.frag.out @@ -1,8 +1,5 @@ spv.newTexture.frag -error: SPIRV-Tools Validation Errors -error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension) - OpCapability SampledRect - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 284 @@ -48,26 +45,44 @@ error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or req Name 281 "us2DArray" Name 283 "ic4D" Decorate 13(s2D) DescriptorSet 0 + Decorate 13(s2D) Binding 0 Decorate 23(sCubeArrayShadow) DescriptorSet 0 + Decorate 23(sCubeArrayShadow) Binding 0 Decorate 42(s3D) DescriptorSet 0 + Decorate 42(s3D) Binding 0 Decorate 51(s2DArray) DescriptorSet 0 + Decorate 51(s2DArray) Binding 0 Decorate 64(s2DShadow) DescriptorSet 0 + Decorate 64(s2DShadow) Binding 0 Decorate 81(ic3D) Flat Decorate 84(ic1D) Flat Decorate 92(ic2D) Flat Decorate 102(sr) DescriptorSet 0 + Decorate 102(sr) Binding 0 Decorate 128(sCube) DescriptorSet 0 + Decorate 128(sCube) Binding 0 Decorate 139(s2DArrayShadow) DescriptorSet 0 + Decorate 139(s2DArrayShadow) Binding 0 Decorate 171(is2D) DescriptorSet 0 + Decorate 171(is2D) Binding 0 Decorate 208(is3D) DescriptorSet 0 + Decorate 208(is3D) Binding 0 Decorate 220(isCube) DescriptorSet 0 + Decorate 220(isCube) Binding 0 Decorate 232(is2DArray) DescriptorSet 0 + Decorate 232(is2DArray) Binding 0 Decorate 247(sCubeShadow) DescriptorSet 0 + Decorate 247(sCubeShadow) Binding 0 Decorate 265(is2Dms) DescriptorSet 0 + Decorate 265(is2Dms) Binding 0 Decorate 269(us2D) DescriptorSet 0 + Decorate 269(us2D) Binding 0 Decorate 273(us3D) DescriptorSet 0 + Decorate 273(us3D) Binding 0 Decorate 277(usCube) DescriptorSet 0 + Decorate 277(usCube) Binding 0 Decorate 281(us2DArray) DescriptorSet 0 + Decorate 281(us2DArray) Binding 0 Decorate 283(ic4D) Flat 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/spv.paramMemory.frag.out b/deps/glslang/Test/baseResults/spv.paramMemory.frag.out index a7e627a2..02a48520 100644 --- a/deps/glslang/Test/baseResults/spv.paramMemory.frag.out +++ b/deps/glslang/Test/baseResults/spv.paramMemory.frag.out @@ -1,8 +1,5 @@ spv.paramMemory.frag -error: SPIRV-Tools Validation Errors -error: OpFunctionCall Argument '38[image1]'s type does not match Function '8's parameter type. - %41 = OpFunctionCall %v4float %image_load_I21_vi2_ %image1 %param - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 69 diff --git a/deps/glslang/Test/baseResults/spv.pp.line.frag.out b/deps/glslang/Test/baseResults/spv.pp.line.frag.out new file mode 100644 index 00000000..5794177f --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.pp.line.frag.out @@ -0,0 +1,146 @@ +spv.pp.line.frag +WARNING: spv.pp.line.frag:6: varying deprecated in version 130; may be removed in future release +WARNING: spv.pp.line.frag:7: varying deprecated in version 130; may be removed in future release + +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 65 + + Capability Shader + Capability Sampled1D + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 5 "main" 41 53 56 59 + ExecutionMode 5 OriginUpperLeft + 1: String "spv.pp.line.frag" + Source GLSL 140 1 "// OpModuleProcessed auto-map-locations +// OpModuleProcessed auto-map-bindings +// OpModuleProcessed client vulkan100 +// OpModuleProcessed target-env vulkan1.0 +// OpModuleProcessed keep-uncalled +// OpModuleProcessed entry-point main +#line 1 +#version 140 + +uniform sampler1D texSampler1D; +uniform sampler2D texSampler2D; + +varying float blend; +varying vec4 u; + +in vec2 coords2D; + +void main() +{ + float blendscale = 1.789; + float bias = 2.0; + float coords1D = 1.789; + vec4 color = vec4(0.0, 0.0, 0.0, 0.0); +#line 53 + color += texture (texSampler1D, coords1D); + color += texture (texSampler1D, coords1D, bias); +#line 102 + color += texture (texSampler2D, coords2D); + color += texture (texSampler2D, coords2D, bias); + + gl_FragColor = mix(color, u, blend * blendscale); +} +" + Name 5 "main" + Name 9 "blendscale" + Name 11 "bias" + Name 13 "coords1D" + Name 16 "color" + Name 22 "texSampler1D" + Name 37 "texSampler2D" + Name 41 "coords2D" + Name 53 "gl_FragColor" + Name 56 "u" + Name 59 "blend" + Decorate 22(texSampler1D) DescriptorSet 0 + Decorate 22(texSampler1D) Binding 0 + Decorate 37(texSampler2D) DescriptorSet 0 + Decorate 37(texSampler2D) Binding 0 + Decorate 53(gl_FragColor) Location 0 + 3: TypeVoid + 4: TypeFunction 3 + 7: TypeFloat 32 + 8: TypePointer Function 7(float) + 10: 7(float) Constant 1071971828 + 12: 7(float) Constant 1073741824 + 14: TypeVector 7(float) 4 + 15: TypePointer Function 14(fvec4) + 17: 7(float) Constant 0 + 18: 14(fvec4) ConstantComposite 17 17 17 17 + 19: TypeImage 7(float) 1D sampled format:Unknown + 20: TypeSampledImage 19 + 21: TypePointer UniformConstant 20 +22(texSampler1D): 21(ptr) Variable UniformConstant + 34: TypeImage 7(float) 2D sampled format:Unknown + 35: TypeSampledImage 34 + 36: TypePointer UniformConstant 35 +37(texSampler2D): 36(ptr) Variable UniformConstant + 39: TypeVector 7(float) 2 + 40: TypePointer Input 39(fvec2) + 41(coords2D): 40(ptr) Variable Input + 52: TypePointer Output 14(fvec4) +53(gl_FragColor): 52(ptr) Variable Output + 55: TypePointer Input 14(fvec4) + 56(u): 55(ptr) Variable Input + 58: TypePointer Input 7(float) + 59(blend): 58(ptr) Variable Input + 5(main): 3 Function None 4 + 6: Label + 9(blendscale): 8(ptr) Variable Function + 11(bias): 8(ptr) Variable Function + 13(coords1D): 8(ptr) Variable Function + 16(color): 15(ptr) Variable Function + Line 1 13 0 + Store 9(blendscale) 10 + Line 1 14 0 + Store 11(bias) 12 + Line 1 15 0 + Store 13(coords1D) 10 + Line 1 16 0 + Store 16(color) 18 + Line 1 54 0 + 23: 20 Load 22(texSampler1D) + 24: 7(float) Load 13(coords1D) + 25: 14(fvec4) ImageSampleImplicitLod 23 24 + 26: 14(fvec4) Load 16(color) + 27: 14(fvec4) FAdd 26 25 + Store 16(color) 27 + Line 1 55 0 + 28: 20 Load 22(texSampler1D) + 29: 7(float) Load 13(coords1D) + 30: 7(float) Load 11(bias) + 31: 14(fvec4) ImageSampleImplicitLod 28 29 Bias 30 + 32: 14(fvec4) Load 16(color) + 33: 14(fvec4) FAdd 32 31 + Store 16(color) 33 + Line 1 103 0 + 38: 35 Load 37(texSampler2D) + 42: 39(fvec2) Load 41(coords2D) + 43: 14(fvec4) ImageSampleImplicitLod 38 42 + 44: 14(fvec4) Load 16(color) + 45: 14(fvec4) FAdd 44 43 + Store 16(color) 45 + Line 1 104 0 + 46: 35 Load 37(texSampler2D) + 47: 39(fvec2) Load 41(coords2D) + 48: 7(float) Load 11(bias) + 49: 14(fvec4) ImageSampleImplicitLod 46 47 Bias 48 + 50: 14(fvec4) Load 16(color) + 51: 14(fvec4) FAdd 50 49 + Store 16(color) 51 + Line 1 106 0 + 54: 14(fvec4) Load 16(color) + 57: 14(fvec4) Load 56(u) + 60: 7(float) Load 59(blend) + 61: 7(float) Load 9(blendscale) + 62: 7(float) FMul 60 61 + 63: 14(fvec4) CompositeConstruct 62 62 62 62 + 64: 14(fvec4) ExtInst 2(GLSL.std.450) 46(FMix) 54 57 63 + Store 53(gl_FragColor) 64 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.precisionNonESSamp.frag.out b/deps/glslang/Test/baseResults/spv.precisionNonESSamp.frag.out index 92220018..0620c41e 100644 --- a/deps/glslang/Test/baseResults/spv.precisionNonESSamp.frag.out +++ b/deps/glslang/Test/baseResults/spv.precisionNonESSamp.frag.out @@ -24,18 +24,21 @@ spv.precisionNonESSamp.frag Decorate 9(color) Location 0 Decorate 13(s) RelaxedPrecision Decorate 13(s) DescriptorSet 0 + Decorate 13(s) Binding 0 Decorate 14 RelaxedPrecision Decorate 17(v2) RelaxedPrecision Decorate 17(v2) Location 0 Decorate 18 RelaxedPrecision Decorate 19 RelaxedPrecision Decorate 23(t) DescriptorSet 0 + Decorate 23(t) Binding 0 Decorate 27(v3) RelaxedPrecision Decorate 27(v3) Location 1 Decorate 28 RelaxedPrecision Decorate 31(vi1) RelaxedPrecision Decorate 34(i1) RelaxedPrecision Decorate 34(i1) DescriptorSet 0 + Decorate 34(i1) Binding 0 Decorate 35 RelaxedPrecision Decorate 39(iv2) RelaxedPrecision Decorate 39(iv2) Flat @@ -44,6 +47,7 @@ spv.precisionNonESSamp.frag Decorate 41 RelaxedPrecision Decorate 42(vi2) RelaxedPrecision Decorate 43(i2) DescriptorSet 0 + Decorate 43(i2) Binding 0 Decorate 45 RelaxedPrecision 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/spv.queryL.frag.out b/deps/glslang/Test/baseResults/spv.queryL.frag.out index b737a35b..87dbb8c1 100644 --- a/deps/glslang/Test/baseResults/spv.queryL.frag.out +++ b/deps/glslang/Test/baseResults/spv.queryL.frag.out @@ -1,8 +1,5 @@ spv.queryL.frag -error: SPIRV-Tools Validation Errors -error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension) - OpCapability SampledRect - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 224 @@ -45,25 +42,45 @@ error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or req Name 219 "sampBuf" Name 223 "sampRect" Decorate 13(samp1D) DescriptorSet 0 + Decorate 13(samp1D) Binding 0 Decorate 23(isamp2D) DescriptorSet 0 + Decorate 23(isamp2D) Binding 0 Decorate 34(usamp3D) DescriptorSet 0 + Decorate 34(usamp3D) Binding 0 Decorate 46(sampCube) DescriptorSet 0 + Decorate 46(sampCube) Binding 0 Decorate 55(isamp1DA) DescriptorSet 0 + Decorate 55(isamp1DA) Binding 0 Decorate 64(usamp2DA) DescriptorSet 0 + Decorate 64(usamp2DA) Binding 0 Decorate 73(isampCubeA) DescriptorSet 0 + Decorate 73(isampCubeA) Binding 0 Decorate 82(samp1Ds) DescriptorSet 0 + Decorate 82(samp1Ds) Binding 0 Decorate 91(samp2Ds) DescriptorSet 0 + Decorate 91(samp2Ds) Binding 0 Decorate 100(sampCubes) DescriptorSet 0 + Decorate 100(sampCubes) Binding 0 Decorate 109(samp1DAs) DescriptorSet 0 + Decorate 109(samp1DAs) Binding 0 Decorate 118(samp2DAs) DescriptorSet 0 + Decorate 118(samp2DAs) Binding 0 Decorate 127(sampCubeAs) DescriptorSet 0 + Decorate 127(sampCubeAs) Binding 0 Decorate 141(usamp2D) DescriptorSet 0 + Decorate 141(usamp2D) Binding 0 Decorate 150(isamp3D) DescriptorSet 0 + Decorate 150(isamp3D) Binding 0 Decorate 159(isampCube) DescriptorSet 0 + Decorate 159(isampCube) Binding 0 Decorate 173(samp2DA) DescriptorSet 0 + Decorate 173(samp2DA) Binding 0 Decorate 182(usampCubeA) DescriptorSet 0 + Decorate 182(usampCubeA) Binding 0 Decorate 219(sampBuf) DescriptorSet 0 + Decorate 219(sampBuf) Binding 0 Decorate 223(sampRect) DescriptorSet 0 + Decorate 223(sampRect) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.register.autoassign.frag.out b/deps/glslang/Test/baseResults/spv.register.autoassign.frag.out index 683ae08d..123ea356 100644 --- a/deps/glslang/Test/baseResults/spv.register.autoassign.frag.out +++ b/deps/glslang/Test/baseResults/spv.register.autoassign.frag.out @@ -77,11 +77,14 @@ spv.register.autoassign.frag Decorate 123(g_tTex_unused1) DescriptorSet 0 Decorate 123(g_tTex_unused1) Binding 10 Decorate 125(g_sSamp_unused1) DescriptorSet 0 + Decorate 125(g_sSamp_unused1) Binding 0 Decorate 130(g_tTex_unused2) DescriptorSet 0 Decorate 130(g_tTex_unused2) Binding 12 Decorate 132(g_sSamp_unused2) DescriptorSet 0 + Decorate 132(g_sSamp_unused2) Binding 0 Decorate 151(@entryPointOutput.Color) Location 0 Decorate 154(g_tTex_unused3) DescriptorSet 0 + Decorate 154(g_tTex_unused3) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.register.noautoassign.frag.out b/deps/glslang/Test/baseResults/spv.register.noautoassign.frag.out index 166d92d9..3259f41f 100644 --- a/deps/glslang/Test/baseResults/spv.register.noautoassign.frag.out +++ b/deps/glslang/Test/baseResults/spv.register.noautoassign.frag.out @@ -49,15 +49,21 @@ spv.register.noautoassign.frag Decorate 25(g_sSamp1) DescriptorSet 0 Decorate 25(g_sSamp1) Binding 5 Decorate 31(g_tTex2) DescriptorSet 0 + Decorate 31(g_tTex2) Binding 0 Decorate 33(g_sSamp2) DescriptorSet 0 + Decorate 33(g_sSamp2) Binding 0 Decorate 43(g_tTex3) DescriptorSet 0 Decorate 43(g_tTex3) Binding 13 Decorate 50(g_sSamp3) DescriptorSet 0 Decorate 50(g_sSamp3) Binding 7 Decorate 68(g_tTex4) DescriptorSet 0 + Decorate 68(g_tTex4) Binding 0 Decorate 73(g_sSamp4) DescriptorSet 0 + Decorate 73(g_sSamp4) Binding 0 Decorate 88(g_tTex5) DescriptorSet 0 + Decorate 88(g_tTex5) Binding 0 Decorate 90(g_sSamp5) DescriptorSet 0 + Decorate 90(g_sSamp5) Binding 0 MemberDecorate 97(MyStruct_t) 0 Offset 0 MemberDecorate 97(MyStruct_t) 1 Offset 4 MemberDecorate 97(MyStruct_t) 2 Offset 16 @@ -67,14 +73,18 @@ spv.register.noautoassign.frag MemberDecorate 99($Global) 3 Offset 64 Decorate 99($Global) Block Decorate 101 DescriptorSet 0 + Decorate 101 Binding 0 Decorate 123(g_tTex_unused1) DescriptorSet 0 Decorate 123(g_tTex_unused1) Binding 10 Decorate 125(g_sSamp_unused1) DescriptorSet 0 + Decorate 125(g_sSamp_unused1) Binding 0 Decorate 130(g_tTex_unused2) DescriptorSet 0 Decorate 130(g_tTex_unused2) Binding 12 Decorate 132(g_sSamp_unused2) DescriptorSet 0 + Decorate 132(g_sSamp_unused2) Binding 0 Decorate 151(@entryPointOutput.Color) Location 0 Decorate 154(g_tTex_unused3) DescriptorSet 0 + Decorate 154(g_tTex_unused3) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.sampleMaskOverrideCoverage.frag.out b/deps/glslang/Test/baseResults/spv.sampleMaskOverrideCoverage.frag.out index ae7e8241..84b763ba 100644 --- a/deps/glslang/Test/baseResults/spv.sampleMaskOverrideCoverage.frag.out +++ b/deps/glslang/Test/baseResults/spv.sampleMaskOverrideCoverage.frag.out @@ -1,8 +1,5 @@ spv.sampleMaskOverrideCoverage.frag -error: SPIRV-Tools Validation Errors -error: Operand 2 of Decorate requires one of these capabilities: SampleMaskOverrideCoverageNV - OpDecorate %gl_SampleMask OverrideCoverageNV - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 20 diff --git a/deps/glslang/Test/baseResults/spv.scalarlayout.frag.out b/deps/glslang/Test/baseResults/spv.scalarlayout.frag.out new file mode 100644 index 00000000..0168bc3e --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.scalarlayout.frag.out @@ -0,0 +1,78 @@ +spv.scalarlayout.frag +Validation failed +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 20 + + Capability Shader + Capability Float64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_scalar_block_layout" + Name 4 "main" + Name 15 "S" + MemberName 15(S) 0 "a" + MemberName 15(S) 1 "b" + MemberName 15(S) 2 "c" + MemberName 15(S) 3 "d" + MemberName 15(S) 4 "e" + MemberName 15(S) 5 "f" + Name 17 "B1" + MemberName 17(B1) 0 "a" + MemberName 17(B1) 1 "b" + MemberName 17(B1) 2 "c" + MemberName 17(B1) 3 "d" + MemberName 17(B1) 4 "e" + MemberName 17(B1) 5 "f" + MemberName 17(B1) 6 "g" + MemberName 17(B1) 7 "h" + MemberName 17(B1) 8 "i" + Name 19 "" + Decorate 11 ArrayStride 4 + Decorate 13 ArrayStride 24 + MemberDecorate 15(S) 0 Offset 0 + MemberDecorate 15(S) 1 Offset 4 + MemberDecorate 15(S) 2 Offset 16 + MemberDecorate 15(S) 3 Offset 24 + MemberDecorate 15(S) 4 Offset 28 + MemberDecorate 15(S) 5 Offset 40 + Decorate 16 ArrayStride 48 + MemberDecorate 17(B1) 0 Offset 0 + MemberDecorate 17(B1) 1 Offset 4 + MemberDecorate 17(B1) 2 Offset 12 + MemberDecorate 17(B1) 3 Offset 24 + MemberDecorate 17(B1) 4 ColMajor + MemberDecorate 17(B1) 4 Offset 32 + MemberDecorate 17(B1) 4 MatrixStride 12 + MemberDecorate 17(B1) 5 ColMajor + MemberDecorate 17(B1) 5 Offset 56 + MemberDecorate 17(B1) 5 MatrixStride 12 + MemberDecorate 17(B1) 6 Offset 104 + MemberDecorate 17(B1) 7 Offset 112 + MemberDecorate 17(B1) 8 Offset 160 + Decorate 17(B1) Block + Decorate 19 DescriptorSet 0 + Decorate 19 Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypeVector 6(float) 3 + 9: TypeInt 32 0 + 10: 9(int) Constant 2 + 11: TypeArray 6(float) 10 + 12: TypeMatrix 8(fvec3) 2 + 13: TypeArray 12 10 + 14: TypeFloat 64 + 15(S): TypeStruct 6(float) 7(fvec2) 14(float64_t) 6(float) 8(fvec3) 6(float) + 16: TypeArray 15(S) 10 + 17(B1): TypeStruct 6(float) 7(fvec2) 8(fvec3) 11 12 13 6(float) 15(S) 16 + 18: TypePointer Uniform 17(B1) + 19: 18(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.scalarlayoutfloat16.frag.out b/deps/glslang/Test/baseResults/spv.scalarlayoutfloat16.frag.out new file mode 100644 index 00000000..dac7e3a3 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.scalarlayoutfloat16.frag.out @@ -0,0 +1,70 @@ +spv.scalarlayoutfloat16.frag +Validation failed +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 18 + + Capability Shader + Capability Float64 + Capability StorageUniform16 + Extension "SPV_KHR_16bit_storage" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_scalar_block_layout" + SourceExtension "GL_EXT_shader_16bit_storage" + Name 4 "main" + Name 13 "S" + MemberName 13(S) 0 "a" + MemberName 13(S) 1 "b" + MemberName 13(S) 2 "c" + MemberName 13(S) 3 "d" + MemberName 13(S) 4 "e" + MemberName 13(S) 5 "f" + Name 15 "B1" + MemberName 15(B1) 0 "a" + MemberName 15(B1) 1 "b" + MemberName 15(B1) 2 "c" + MemberName 15(B1) 3 "d" + MemberName 15(B1) 4 "g" + MemberName 15(B1) 5 "h" + MemberName 15(B1) 6 "i" + Name 17 "" + Decorate 11 ArrayStride 2 + MemberDecorate 13(S) 0 Offset 0 + MemberDecorate 13(S) 1 Offset 2 + MemberDecorate 13(S) 2 Offset 8 + MemberDecorate 13(S) 3 Offset 16 + MemberDecorate 13(S) 4 Offset 18 + MemberDecorate 13(S) 5 Offset 24 + Decorate 14 ArrayStride 32 + MemberDecorate 15(B1) 0 Offset 0 + MemberDecorate 15(B1) 1 Offset 2 + MemberDecorate 15(B1) 2 Offset 6 + MemberDecorate 15(B1) 3 Offset 12 + MemberDecorate 15(B1) 4 Offset 16 + MemberDecorate 15(B1) 5 Offset 24 + MemberDecorate 15(B1) 6 Offset 56 + Decorate 15(B1) Block + Decorate 17 DescriptorSet 0 + Decorate 17 Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 16 + 7: TypeVector 6(float16_t) 2 + 8: TypeVector 6(float16_t) 3 + 9: TypeInt 32 0 + 10: 9(int) Constant 2 + 11: TypeArray 6(float16_t) 10 + 12: TypeFloat 64 + 13(S): TypeStruct 6(float16_t) 7(f16vec2) 12(float64_t) 6(float16_t) 8(f16vec3) 6(float16_t) + 14: TypeArray 13(S) 10 + 15(B1): TypeStruct 6(float16_t) 7(f16vec2) 8(f16vec3) 11 6(float16_t) 13(S) 14 + 16: TypePointer Uniform 15(B1) + 17: 16(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.separate.frag.out b/deps/glslang/Test/baseResults/spv.separate.frag.out index b9fefd70..27cd3be0 100644 --- a/deps/glslang/Test/baseResults/spv.separate.frag.out +++ b/deps/glslang/Test/baseResults/spv.separate.frag.out @@ -1,8 +1,5 @@ spv.separate.frag -error: SPIRV-Tools Validation Errors -error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension) - OpCapability SampledRect - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 319 @@ -60,44 +57,82 @@ error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or req Name 293 "tex3D" Name 304 "tex2DRect" Decorate 14(t2d) DescriptorSet 0 + Decorate 14(t2d) Binding 0 Decorate 18(s) DescriptorSet 0 + Decorate 18(s) Binding 0 Decorate 31(t3d) DescriptorSet 0 + Decorate 31(t3d) Binding 0 Decorate 34(i) Flat Decorate 41(sA) DescriptorSet 0 + Decorate 41(sA) Binding 0 Decorate 58(tex2D) DescriptorSet 0 + Decorate 58(tex2D) Binding 0 Decorate 64(texCube) DescriptorSet 0 + Decorate 64(texCube) Binding 0 Decorate 71(texCubeArray) DescriptorSet 0 + Decorate 71(texCubeArray) Binding 0 Decorate 77(sShadow) DescriptorSet 0 + Decorate 77(sShadow) Binding 0 Decorate 84(itexCubeArray) DescriptorSet 0 + Decorate 84(itexCubeArray) Binding 0 Decorate 91(utexCubeArray) DescriptorSet 0 + Decorate 91(utexCubeArray) Binding 0 Decorate 98(tex1DArray) DescriptorSet 0 + Decorate 98(tex1DArray) Binding 0 Decorate 105(itex1DArray) DescriptorSet 0 + Decorate 105(itex1DArray) Binding 0 Decorate 112(utex1D) DescriptorSet 0 + Decorate 112(utex1D) Binding 0 Decorate 119(itex1D) DescriptorSet 0 + Decorate 119(itex1D) Binding 0 Decorate 126(utex1DArray) DescriptorSet 0 + Decorate 126(utex1DArray) Binding 0 Decorate 133(texBuffer) DescriptorSet 0 + Decorate 133(texBuffer) Binding 0 Decorate 145(tex2DArray) DescriptorSet 0 + Decorate 145(tex2DArray) Binding 0 Decorate 157(itex2D) DescriptorSet 0 + Decorate 157(itex2D) Binding 0 Decorate 164(itex3D) DescriptorSet 0 + Decorate 164(itex3D) Binding 0 Decorate 171(itexCube) DescriptorSet 0 + Decorate 171(itexCube) Binding 0 Decorate 178(itex2DArray) DescriptorSet 0 + Decorate 178(itex2DArray) Binding 0 Decorate 185(utex2D) DescriptorSet 0 + Decorate 185(utex2D) Binding 0 Decorate 192(utex3D) DescriptorSet 0 + Decorate 192(utex3D) Binding 0 Decorate 199(utexCube) DescriptorSet 0 + Decorate 199(utexCube) Binding 0 Decorate 206(utex2DArray) DescriptorSet 0 + Decorate 206(utex2DArray) Binding 0 Decorate 213(itex2DRect) DescriptorSet 0 + Decorate 213(itex2DRect) Binding 0 Decorate 220(utex2DRect) DescriptorSet 0 + Decorate 220(utex2DRect) Binding 0 Decorate 227(itexBuffer) DescriptorSet 0 + Decorate 227(itexBuffer) Binding 0 Decorate 234(utexBuffer) DescriptorSet 0 + Decorate 234(utexBuffer) Binding 0 Decorate 241(tex2DMS) DescriptorSet 0 + Decorate 241(tex2DMS) Binding 0 Decorate 248(itex2DMS) DescriptorSet 0 + Decorate 248(itex2DMS) Binding 0 Decorate 255(utex2DMS) DescriptorSet 0 + Decorate 255(utex2DMS) Binding 0 Decorate 262(tex2DMSArray) DescriptorSet 0 + Decorate 262(tex2DMSArray) Binding 0 Decorate 269(itex2DMSArray) DescriptorSet 0 + Decorate 269(itex2DMSArray) Binding 0 Decorate 276(utex2DMSArray) DescriptorSet 0 + Decorate 276(utex2DMSArray) Binding 0 Decorate 283(tex1D) DescriptorSet 0 + Decorate 283(tex1D) Binding 0 Decorate 293(tex3D) DescriptorSet 0 + Decorate 293(tex3D) Binding 0 Decorate 304(tex2DRect) DescriptorSet 0 + Decorate 304(tex2DRect) Binding 0 2: TypeVoid 3: TypeFunction 2 8: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.shaderBallotAMD.comp.out b/deps/glslang/Test/baseResults/spv.shaderBallotAMD.comp.out index 5219a3a4..f3fbc9ff 100644 --- a/deps/glslang/Test/baseResults/spv.shaderBallotAMD.comp.out +++ b/deps/glslang/Test/baseResults/spv.shaderBallotAMD.comp.out @@ -1,8 +1,5 @@ spv.shaderBallotAMD.comp -error: SPIRV-Tools Validation Errors -error: Capability Float16 is not allowed by Vulkan 1.0 specification (or requires extension) - OpCapability Float16 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 1343 diff --git a/deps/glslang/Test/baseResults/spv.shaderImageFootprint.frag.out b/deps/glslang/Test/baseResults/spv.shaderImageFootprint.frag.out index 2ada2b5a..671eff70 100644 --- a/deps/glslang/Test/baseResults/spv.shaderImageFootprint.frag.out +++ b/deps/glslang/Test/baseResults/spv.shaderImageFootprint.frag.out @@ -74,7 +74,9 @@ spv.shaderImageFootprint.frag MemberDecorate 8(result2D) 5 Offset 36 Decorate 8(result2D) BufferBlock Decorate 10 DescriptorSet 0 + Decorate 10 Binding 0 Decorate 17(sample2D) DescriptorSet 0 + Decorate 17(sample2D) Binding 0 Decorate 21(P2) Location 0 Decorate 24(granularity) Flat Decorate 24(granularity) Location 3 @@ -91,7 +93,9 @@ spv.shaderImageFootprint.frag MemberDecorate 377(result3D) 5 Offset 60 Decorate 377(result3D) BufferBlock Decorate 379 DescriptorSet 0 + Decorate 379 Binding 0 Decorate 383(sample3D) DescriptorSet 0 + Decorate 383(sample3D) Binding 0 Decorate 387(P3) Location 2 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/spv.shadingRate.frag.out b/deps/glslang/Test/baseResults/spv.shadingRate.frag.out index 2b6bd31d..11477769 100644 --- a/deps/glslang/Test/baseResults/spv.shadingRate.frag.out +++ b/deps/glslang/Test/baseResults/spv.shadingRate.frag.out @@ -4,7 +4,7 @@ spv.shadingRate.frag // Id's are bound by 21 Capability Shader - Capability ShadingRateNV + Capability FragmentDensityEXT Extension "SPV_NV_shading_rate" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 @@ -19,10 +19,10 @@ spv.shadingRate.frag Name 19 "gl_InvocationsPerPixelNV" Decorate 9(FragmentSize) Location 0 Decorate 13(gl_FragmentSizeNV) Flat - Decorate 13(gl_FragmentSizeNV) BuiltIn FragmentSizeNV + Decorate 13(gl_FragmentSizeNV) BuiltIn FragSizeEXT Decorate 17(InvocationsPerPixel) Location 2 Decorate 19(gl_InvocationsPerPixelNV) Flat - Decorate 19(gl_InvocationsPerPixelNV) BuiltIn InvocationsPerPixelNV + Decorate 19(gl_InvocationsPerPixelNV) BuiltIn FragInvocationCountEXT 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.sparseTexture.frag.out b/deps/glslang/Test/baseResults/spv.sparseTexture.frag.out index 78a2c2e7..7fdea0c4 100644 --- a/deps/glslang/Test/baseResults/spv.sparseTexture.frag.out +++ b/deps/glslang/Test/baseResults/spv.sparseTexture.frag.out @@ -1,8 +1,5 @@ spv.sparseTexture.frag -error: SPIRV-Tools Validation Errors -error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension) - OpCapability SampledRect - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 438 @@ -51,23 +48,38 @@ error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or req Name 414 "i2DMS" Name 423 "outColor" Decorate 29(s2D) DescriptorSet 0 + Decorate 29(s2D) Binding 0 Decorate 44(s3D) DescriptorSet 0 + Decorate 44(s3D) Binding 0 Decorate 59(isCube) DescriptorSet 0 + Decorate 59(isCube) Binding 0 Decorate 71(s2DShadow) DescriptorSet 0 + Decorate 71(s2DShadow) Binding 0 Decorate 86(sCubeArrayShadow) DescriptorSet 0 + Decorate 86(sCubeArrayShadow) Binding 0 Decorate 108(usCubeArray) DescriptorSet 0 + Decorate 108(usCubeArray) Binding 0 Decorate 140(us2DRect) DescriptorSet 0 + Decorate 140(us2DRect) Binding 0 Decorate 154(s2DArrayShadow) DescriptorSet 0 + Decorate 154(s2DArrayShadow) Binding 0 Decorate 188(s2DMS) DescriptorSet 0 + Decorate 188(s2DMS) Binding 0 Decorate 228(is2DArray) DescriptorSet 0 + Decorate 228(is2DArray) Binding 0 Decorate 261(sCubeShadow) DescriptorSet 0 + Decorate 261(sCubeShadow) Binding 0 Decorate 294(s2DRectShadow) DescriptorSet 0 + Decorate 294(s2DRectShadow) Binding 0 Decorate 365(offsets) Flat Decorate 390(i2D) DescriptorSet 0 + Decorate 390(i2D) Binding 0 Decorate 393(ic2) Flat Decorate 402(ii3D) DescriptorSet 0 + Decorate 402(ii3D) Binding 0 Decorate 405(ic3) Flat Decorate 414(i2DMS) DescriptorSet 0 + Decorate 414(i2DMS) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 diff --git a/deps/glslang/Test/baseResults/spv.sparseTextureClamp.frag.out b/deps/glslang/Test/baseResults/spv.sparseTextureClamp.frag.out index fe210f74..ff7dce56 100644 --- a/deps/glslang/Test/baseResults/spv.sparseTextureClamp.frag.out +++ b/deps/glslang/Test/baseResults/spv.sparseTextureClamp.frag.out @@ -1,8 +1,5 @@ spv.sparseTextureClamp.frag -error: SPIRV-Tools Validation Errors -error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension) - OpCapability SampledRect - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 360 @@ -44,16 +41,27 @@ error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or req Name 305 "is2DArray" Name 345 "outColor" Decorate 29(s2D) DescriptorSet 0 + Decorate 29(s2D) Binding 0 Decorate 47(s3D) DescriptorSet 0 + Decorate 47(s3D) Binding 0 Decorate 63(isCube) DescriptorSet 0 + Decorate 63(isCube) Binding 0 Decorate 76(s2DShadow) DescriptorSet 0 + Decorate 76(s2DShadow) Binding 0 Decorate 92(sCubeArrayShadow) DescriptorSet 0 + Decorate 92(sCubeArrayShadow) Binding 0 Decorate 154(us2DRect) DescriptorSet 0 + Decorate 154(us2DRect) Binding 0 Decorate 170(s2DArrayShadow) DescriptorSet 0 + Decorate 170(s2DArrayShadow) Binding 0 Decorate 218(sCubeShadow) DescriptorSet 0 + Decorate 218(sCubeShadow) Binding 0 Decorate 235(usCubeArray) DescriptorSet 0 + Decorate 235(usCubeArray) Binding 0 Decorate 286(s2DRectShadow) DescriptorSet 0 + Decorate 286(s2DRectShadow) Binding 0 Decorate 305(is2DArray) DescriptorSet 0 + Decorate 305(is2DArray) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 diff --git a/deps/glslang/Test/baseResults/spv.specConstant.comp.out b/deps/glslang/Test/baseResults/spv.specConstant.comp.out index b8aa3ddf..2f641501 100644 --- a/deps/glslang/Test/baseResults/spv.specConstant.comp.out +++ b/deps/glslang/Test/baseResults/spv.specConstant.comp.out @@ -16,6 +16,7 @@ spv.specConstant.comp MemberDecorate 7(bn) 0 Offset 0 Decorate 7(bn) BufferBlock Decorate 9(bi) DescriptorSet 0 + Decorate 9(bi) Binding 0 Decorate 12 SpecId 18 Decorate 14 SpecId 19 Decorate 16 BuiltIn WorkgroupSize diff --git a/deps/glslang/Test/baseResults/spv.stereoViewRendering.tesc.out b/deps/glslang/Test/baseResults/spv.stereoViewRendering.tesc.out index 732e5b4c..03b20f95 100644 --- a/deps/glslang/Test/baseResults/spv.stereoViewRendering.tesc.out +++ b/deps/glslang/Test/baseResults/spv.stereoViewRendering.tesc.out @@ -1,8 +1,5 @@ spv.stereoViewRendering.tesc -error: SPIRV-Tools Validation Errors -error: When BuiltIn decoration is applied to a structure-type member, all members of that structure type must also be decorated with BuiltIn (No allowed mixing of built-in variables and non-built-in variables within a single structure). Structure id 27 does not meet this requirement. - %gl_PerVertex_0 = OpTypeStruct %v4float %float %_arr_float_uint_1 %_arr_float_uint_1 %v4float - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 38 diff --git a/deps/glslang/Test/baseResults/spv.storageBuffer.vert.out b/deps/glslang/Test/baseResults/spv.storageBuffer.vert.out index 71c3bf28..5006e4cc 100644 --- a/deps/glslang/Test/baseResults/spv.storageBuffer.vert.out +++ b/deps/glslang/Test/baseResults/spv.storageBuffer.vert.out @@ -30,9 +30,11 @@ spv.storageBuffer.vert MemberDecorate 16(ub) 0 Offset 0 Decorate 16(ub) Block Decorate 18(ubi) DescriptorSet 0 + Decorate 18(ubi) Binding 0 MemberDecorate 22(bb) 0 Offset 0 Decorate 22(bb) Block Decorate 24(bbi) DescriptorSet 0 + Decorate 24(bbi) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.structAssignment.frag.out b/deps/glslang/Test/baseResults/spv.structAssignment.frag.out index ec771cc3..4b357da8 100644 --- a/deps/glslang/Test/baseResults/spv.structAssignment.frag.out +++ b/deps/glslang/Test/baseResults/spv.structAssignment.frag.out @@ -38,6 +38,7 @@ WARNING: 0:6: '' : all default precisions are highp; use precision statements to Decorate 16 RelaxedPrecision Decorate 31(gl_FragColor) Location 0 Decorate 40(samp2D) DescriptorSet 0 + Decorate 40(samp2D) Binding 0 Decorate 44(coord) RelaxedPrecision Decorate 45 RelaxedPrecision 2: TypeVoid diff --git a/deps/glslang/Test/baseResults/spv.structDeref.frag.out b/deps/glslang/Test/baseResults/spv.structDeref.frag.out index a7915b40..6888a850 100644 --- a/deps/glslang/Test/baseResults/spv.structDeref.frag.out +++ b/deps/glslang/Test/baseResults/spv.structDeref.frag.out @@ -42,6 +42,7 @@ spv.structDeref.frag Name 122 "foo2" Decorate 99(gl_FragColor) Location 0 Decorate 116(samp2D) DescriptorSet 0 + Decorate 116(samp2D) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 diff --git a/deps/glslang/Test/baseResults/spv.structure.frag.out b/deps/glslang/Test/baseResults/spv.structure.frag.out index 0592084b..f1da59fa 100644 --- a/deps/glslang/Test/baseResults/spv.structure.frag.out +++ b/deps/glslang/Test/baseResults/spv.structure.frag.out @@ -26,6 +26,7 @@ spv.structure.frag Name 59 "foo" Decorate 45(gl_FragColor) Location 0 Decorate 50(samp2D) DescriptorSet 0 + Decorate 50(samp2D) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.subgroupBallot.comp.out b/deps/glslang/Test/baseResults/spv.subgroupBallot.comp.out index 23a59132..ea152d9a 100644 --- a/deps/glslang/Test/baseResults/spv.subgroupBallot.comp.out +++ b/deps/glslang/Test/baseResults/spv.subgroupBallot.comp.out @@ -1,7 +1,7 @@ spv.subgroupBallot.comp // Module Version 10300 // Generated by (magic number): 80007 -// Id's are bound by 417 +// Id's are bound by 397 Capability Shader Capability Float64 @@ -51,7 +51,7 @@ spv.subgroupBallot.comp Decorate 46(Buffers) Block Decorate 49(data) DescriptorSet 0 Decorate 49(data) Binding 0 - Decorate 416 BuiltIn WorkgroupSize + Decorate 396 BuiltIn WorkgroupSize 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 @@ -91,30 +91,30 @@ spv.subgroupBallot.comp 83: TypeVector 36(bool) 4 88: TypePointer StorageBuffer 17(ivec4) 96: TypePointer StorageBuffer 40(float) - 103: TypeVector 40(float) 2 - 104: TypePointer StorageBuffer 41(fvec4) - 114: TypeVector 40(float) 3 - 124: 42(int) Constant 3 - 131: TypePointer StorageBuffer 42(int) - 138: TypeVector 42(int) 2 - 139: TypePointer StorageBuffer 43(ivec4) - 149: TypeVector 42(int) 3 - 171: TypeVector 6(int) 2 - 181: TypeVector 6(int) 3 - 197: TypePointer StorageBuffer 44(float64_t) - 204: TypeVector 44(float64_t) 2 - 205: TypePointer StorageBuffer 45(f64vec4) - 215: TypeVector 44(float64_t) 3 - 242: 138(ivec2) ConstantComposite 61 61 - 243: TypeVector 36(bool) 2 - 247: 138(ivec2) ConstantComposite 60 60 - 256: 149(ivec3) ConstantComposite 61 61 61 - 257: TypeVector 36(bool) 3 - 261: 149(ivec3) ConstantComposite 60 60 60 - 269: 43(ivec4) ConstantComposite 61 61 61 61 - 273: 43(ivec4) ConstantComposite 60 60 60 60 - 415: 6(int) Constant 8 - 416: 181(ivec3) ConstantComposite 415 415 64 + 102: TypeVector 40(float) 2 + 103: TypePointer StorageBuffer 41(fvec4) + 112: TypeVector 40(float) 3 + 121: 42(int) Constant 3 + 127: TypePointer StorageBuffer 42(int) + 133: TypeVector 42(int) 2 + 134: TypePointer StorageBuffer 43(ivec4) + 143: TypeVector 42(int) 3 + 162: TypeVector 6(int) 2 + 171: TypeVector 6(int) 3 + 185: TypePointer StorageBuffer 44(float64_t) + 191: TypeVector 44(float64_t) 2 + 192: TypePointer StorageBuffer 45(f64vec4) + 201: TypeVector 44(float64_t) 3 + 225: 133(ivec2) ConstantComposite 61 61 + 226: TypeVector 36(bool) 2 + 229: 133(ivec2) ConstantComposite 60 60 + 238: 143(ivec3) ConstantComposite 61 61 61 + 239: TypeVector 36(bool) 3 + 242: 143(ivec3) ConstantComposite 60 60 60 + 250: 43(ivec4) ConstantComposite 61 61 61 61 + 253: 43(ivec4) ConstantComposite 60 60 60 60 + 395: 6(int) Constant 8 + 396: 171(ivec3) ConstantComposite 395 395 64 4(main): 2 Function None 3 5: Label 8(invocation): 7(ptr) Variable Function @@ -179,346 +179,326 @@ spv.subgroupBallot.comp 87: Label 92: 36(bool) Phi 85 5 91 86 SelectionMerge 94 None - BranchConditional 92 93 276 + BranchConditional 92 93 256 93: Label 95: 6(int) Load 8(invocation) 97: 96(ptr) AccessChain 49(data) 61 61 54 98: 40(float) Load 97 - 99: 6(int) Load 8(invocation) - 100: 40(float) GroupNonUniformBroadcast 38 98 99 - 101: 96(ptr) AccessChain 49(data) 95 61 54 - Store 101 100 - 102: 6(int) Load 8(invocation) - 105: 104(ptr) AccessChain 49(data) 60 61 - 106: 41(fvec4) Load 105 - 107: 103(fvec2) VectorShuffle 106 106 0 1 - 108: 6(int) Load 8(invocation) - 109: 103(fvec2) GroupNonUniformBroadcast 38 107 108 - 110: 104(ptr) AccessChain 49(data) 102 61 - 111: 41(fvec4) Load 110 - 112: 41(fvec4) VectorShuffle 111 109 4 5 2 3 - Store 110 112 - 113: 6(int) Load 8(invocation) - 115: 104(ptr) AccessChain 49(data) 51 61 - 116: 41(fvec4) Load 115 - 117: 114(fvec3) VectorShuffle 116 116 0 1 2 - 118: 6(int) Load 8(invocation) - 119: 114(fvec3) GroupNonUniformBroadcast 38 117 118 - 120: 104(ptr) AccessChain 49(data) 113 61 - 121: 41(fvec4) Load 120 - 122: 41(fvec4) VectorShuffle 121 119 4 5 6 3 - Store 120 122 - 123: 6(int) Load 8(invocation) - 125: 104(ptr) AccessChain 49(data) 124 61 - 126: 41(fvec4) Load 125 - 127: 6(int) Load 8(invocation) - 128: 41(fvec4) GroupNonUniformBroadcast 38 126 127 - 129: 104(ptr) AccessChain 49(data) 123 61 - Store 129 128 - 130: 6(int) Load 8(invocation) - 132: 131(ptr) AccessChain 49(data) 61 60 54 - 133: 42(int) Load 132 - 134: 6(int) Load 8(invocation) - 135: 42(int) GroupNonUniformBroadcast 38 133 134 - 136: 131(ptr) AccessChain 49(data) 130 60 54 - Store 136 135 - 137: 6(int) Load 8(invocation) - 140: 139(ptr) AccessChain 49(data) 60 60 - 141: 43(ivec4) Load 140 - 142: 138(ivec2) VectorShuffle 141 141 0 1 - 143: 6(int) Load 8(invocation) - 144: 138(ivec2) GroupNonUniformBroadcast 38 142 143 - 145: 139(ptr) AccessChain 49(data) 137 60 - 146: 43(ivec4) Load 145 - 147: 43(ivec4) VectorShuffle 146 144 4 5 2 3 - Store 145 147 - 148: 6(int) Load 8(invocation) - 150: 139(ptr) AccessChain 49(data) 51 60 - 151: 43(ivec4) Load 150 - 152: 149(ivec3) VectorShuffle 151 151 0 1 2 - 153: 6(int) Load 8(invocation) - 154: 149(ivec3) GroupNonUniformBroadcast 38 152 153 - 155: 139(ptr) AccessChain 49(data) 148 60 - 156: 43(ivec4) Load 155 - 157: 43(ivec4) VectorShuffle 156 154 4 5 6 3 - Store 155 157 - 158: 6(int) Load 8(invocation) - 159: 139(ptr) AccessChain 49(data) 124 60 - 160: 43(ivec4) Load 159 + 99: 40(float) GroupNonUniformBroadcast 38 98 38 + 100: 96(ptr) AccessChain 49(data) 95 61 54 + Store 100 99 + 101: 6(int) Load 8(invocation) + 104: 103(ptr) AccessChain 49(data) 60 61 + 105: 41(fvec4) Load 104 + 106: 102(fvec2) VectorShuffle 105 105 0 1 + 107: 102(fvec2) GroupNonUniformBroadcast 38 106 38 + 108: 103(ptr) AccessChain 49(data) 101 61 + 109: 41(fvec4) Load 108 + 110: 41(fvec4) VectorShuffle 109 107 4 5 2 3 + Store 108 110 + 111: 6(int) Load 8(invocation) + 113: 103(ptr) AccessChain 49(data) 51 61 + 114: 41(fvec4) Load 113 + 115: 112(fvec3) VectorShuffle 114 114 0 1 2 + 116: 112(fvec3) GroupNonUniformBroadcast 38 115 38 + 117: 103(ptr) AccessChain 49(data) 111 61 + 118: 41(fvec4) Load 117 + 119: 41(fvec4) VectorShuffle 118 116 4 5 6 3 + Store 117 119 + 120: 6(int) Load 8(invocation) + 122: 103(ptr) AccessChain 49(data) 121 61 + 123: 41(fvec4) Load 122 + 124: 41(fvec4) GroupNonUniformBroadcast 38 123 38 + 125: 103(ptr) AccessChain 49(data) 120 61 + Store 125 124 + 126: 6(int) Load 8(invocation) + 128: 127(ptr) AccessChain 49(data) 61 60 54 + 129: 42(int) Load 128 + 130: 42(int) GroupNonUniformBroadcast 38 129 72 + 131: 127(ptr) AccessChain 49(data) 126 60 54 + Store 131 130 + 132: 6(int) Load 8(invocation) + 135: 134(ptr) AccessChain 49(data) 60 60 + 136: 43(ivec4) Load 135 + 137: 133(ivec2) VectorShuffle 136 136 0 1 + 138: 133(ivec2) GroupNonUniformBroadcast 38 137 72 + 139: 134(ptr) AccessChain 49(data) 132 60 + 140: 43(ivec4) Load 139 + 141: 43(ivec4) VectorShuffle 140 138 4 5 2 3 + Store 139 141 + 142: 6(int) Load 8(invocation) + 144: 134(ptr) AccessChain 49(data) 51 60 + 145: 43(ivec4) Load 144 + 146: 143(ivec3) VectorShuffle 145 145 0 1 2 + 147: 143(ivec3) GroupNonUniformBroadcast 38 146 72 + 148: 134(ptr) AccessChain 49(data) 142 60 + 149: 43(ivec4) Load 148 + 150: 43(ivec4) VectorShuffle 149 147 4 5 6 3 + Store 148 150 + 151: 6(int) Load 8(invocation) + 152: 134(ptr) AccessChain 49(data) 121 60 + 153: 43(ivec4) Load 152 + 154: 43(ivec4) GroupNonUniformBroadcast 38 153 72 + 155: 134(ptr) AccessChain 49(data) 151 60 + Store 155 154 + 156: 6(int) Load 8(invocation) + 157: 55(ptr) AccessChain 49(data) 61 51 54 + 158: 6(int) Load 157 + 159: 6(int) GroupNonUniformBroadcast 38 158 64 + 160: 55(ptr) AccessChain 49(data) 156 51 54 + Store 160 159 161: 6(int) Load 8(invocation) - 162: 43(ivec4) GroupNonUniformBroadcast 38 160 161 - 163: 139(ptr) AccessChain 49(data) 158 60 - Store 163 162 - 164: 6(int) Load 8(invocation) - 165: 55(ptr) AccessChain 49(data) 61 51 54 - 166: 6(int) Load 165 - 167: 6(int) Load 8(invocation) - 168: 6(int) GroupNonUniformBroadcast 38 166 167 - 169: 55(ptr) AccessChain 49(data) 164 51 54 - Store 169 168 + 163: 88(ptr) AccessChain 49(data) 60 51 + 164: 17(ivec4) Load 163 + 165: 162(ivec2) VectorShuffle 164 164 0 1 + 166: 162(ivec2) GroupNonUniformBroadcast 38 165 64 + 167: 88(ptr) AccessChain 49(data) 161 51 + 168: 17(ivec4) Load 167 + 169: 17(ivec4) VectorShuffle 168 166 4 5 2 3 + Store 167 169 170: 6(int) Load 8(invocation) - 172: 88(ptr) AccessChain 49(data) 60 51 + 172: 88(ptr) AccessChain 49(data) 51 51 173: 17(ivec4) Load 172 - 174: 171(ivec2) VectorShuffle 173 173 0 1 - 175: 6(int) Load 8(invocation) - 176: 171(ivec2) GroupNonUniformBroadcast 38 174 175 - 177: 88(ptr) AccessChain 49(data) 170 51 - 178: 17(ivec4) Load 177 - 179: 17(ivec4) VectorShuffle 178 176 4 5 2 3 - Store 177 179 - 180: 6(int) Load 8(invocation) - 182: 88(ptr) AccessChain 49(data) 51 51 - 183: 17(ivec4) Load 182 - 184: 181(ivec3) VectorShuffle 183 183 0 1 2 - 185: 6(int) Load 8(invocation) - 186: 181(ivec3) GroupNonUniformBroadcast 38 184 185 - 187: 88(ptr) AccessChain 49(data) 180 51 - 188: 17(ivec4) Load 187 - 189: 17(ivec4) VectorShuffle 188 186 4 5 6 3 - Store 187 189 + 174: 171(ivec3) VectorShuffle 173 173 0 1 2 + 175: 171(ivec3) GroupNonUniformBroadcast 38 174 64 + 176: 88(ptr) AccessChain 49(data) 170 51 + 177: 17(ivec4) Load 176 + 178: 17(ivec4) VectorShuffle 177 175 4 5 6 3 + Store 176 178 + 179: 6(int) Load 8(invocation) + 180: 88(ptr) AccessChain 49(data) 121 51 + 181: 17(ivec4) Load 180 + 182: 17(ivec4) GroupNonUniformBroadcast 38 181 64 + 183: 88(ptr) AccessChain 49(data) 179 51 + Store 183 182 + 184: 6(int) Load 8(invocation) + 186: 185(ptr) AccessChain 49(data) 61 121 54 + 187:44(float64_t) Load 186 + 188:44(float64_t) GroupNonUniformBroadcast 38 187 54 + 189: 185(ptr) AccessChain 49(data) 184 121 54 + Store 189 188 190: 6(int) Load 8(invocation) - 191: 88(ptr) AccessChain 49(data) 124 51 - 192: 17(ivec4) Load 191 - 193: 6(int) Load 8(invocation) - 194: 17(ivec4) GroupNonUniformBroadcast 38 192 193 - 195: 88(ptr) AccessChain 49(data) 190 51 - Store 195 194 - 196: 6(int) Load 8(invocation) - 198: 197(ptr) AccessChain 49(data) 61 124 54 - 199:44(float64_t) Load 198 + 193: 192(ptr) AccessChain 49(data) 60 121 + 194: 45(f64vec4) Load 193 + 195:191(f64vec2) VectorShuffle 194 194 0 1 + 196:191(f64vec2) GroupNonUniformBroadcast 38 195 54 + 197: 192(ptr) AccessChain 49(data) 190 121 + 198: 45(f64vec4) Load 197 + 199: 45(f64vec4) VectorShuffle 198 196 4 5 2 3 + Store 197 199 200: 6(int) Load 8(invocation) - 201:44(float64_t) GroupNonUniformBroadcast 38 199 200 - 202: 197(ptr) AccessChain 49(data) 196 124 54 - Store 202 201 - 203: 6(int) Load 8(invocation) - 206: 205(ptr) AccessChain 49(data) 60 124 + 202: 192(ptr) AccessChain 49(data) 51 121 + 203: 45(f64vec4) Load 202 + 204:201(f64vec3) VectorShuffle 203 203 0 1 2 + 205:201(f64vec3) GroupNonUniformBroadcast 38 204 54 + 206: 192(ptr) AccessChain 49(data) 200 121 207: 45(f64vec4) Load 206 - 208:204(f64vec2) VectorShuffle 207 207 0 1 + 208: 45(f64vec4) VectorShuffle 207 205 4 5 6 3 + Store 206 208 209: 6(int) Load 8(invocation) - 210:204(f64vec2) GroupNonUniformBroadcast 38 208 209 - 211: 205(ptr) AccessChain 49(data) 203 124 - 212: 45(f64vec4) Load 211 - 213: 45(f64vec4) VectorShuffle 212 210 4 5 2 3 - Store 211 213 + 210: 192(ptr) AccessChain 49(data) 121 121 + 211: 45(f64vec4) Load 210 + 212: 45(f64vec4) GroupNonUniformBroadcast 38 211 54 + 213: 192(ptr) AccessChain 49(data) 209 121 + Store 213 212 214: 6(int) Load 8(invocation) - 216: 205(ptr) AccessChain 49(data) 51 124 - 217: 45(f64vec4) Load 216 - 218:215(f64vec3) VectorShuffle 217 217 0 1 2 - 219: 6(int) Load 8(invocation) - 220:215(f64vec3) GroupNonUniformBroadcast 38 218 219 - 221: 205(ptr) AccessChain 49(data) 214 124 - 222: 45(f64vec4) Load 221 - 223: 45(f64vec4) VectorShuffle 222 220 4 5 6 3 - Store 221 223 - 224: 6(int) Load 8(invocation) - 225: 205(ptr) AccessChain 49(data) 124 124 - 226: 45(f64vec4) Load 225 - 227: 6(int) Load 8(invocation) - 228: 45(f64vec4) GroupNonUniformBroadcast 38 226 227 - 229: 205(ptr) AccessChain 49(data) 224 124 - Store 229 228 - 230: 6(int) Load 8(invocation) - 231: 131(ptr) AccessChain 49(data) 61 60 54 - 232: 42(int) Load 231 - 233: 36(bool) SLessThan 232 61 + 215: 127(ptr) AccessChain 49(data) 61 60 54 + 216: 42(int) Load 215 + 217: 36(bool) SLessThan 216 61 + 218: 36(bool) GroupNonUniformBroadcast 38 217 64 + 219: 42(int) Select 218 60 61 + 220: 127(ptr) AccessChain 49(data) 214 60 54 + Store 220 219 + 221: 6(int) Load 8(invocation) + 222: 134(ptr) AccessChain 49(data) 60 60 + 223: 43(ivec4) Load 222 + 224: 133(ivec2) VectorShuffle 223 223 0 1 + 227: 226(bvec2) SLessThan 224 225 + 228: 226(bvec2) GroupNonUniformBroadcast 38 227 64 + 230: 133(ivec2) Select 228 229 225 + 231: 134(ptr) AccessChain 49(data) 221 60 + 232: 43(ivec4) Load 231 + 233: 43(ivec4) VectorShuffle 232 230 4 5 2 3 + Store 231 233 234: 6(int) Load 8(invocation) - 235: 36(bool) GroupNonUniformBroadcast 38 233 234 - 236: 42(int) Select 235 60 61 - 237: 131(ptr) AccessChain 49(data) 230 60 54 - Store 237 236 - 238: 6(int) Load 8(invocation) - 239: 139(ptr) AccessChain 49(data) 60 60 - 240: 43(ivec4) Load 239 - 241: 138(ivec2) VectorShuffle 240 240 0 1 - 244: 243(bvec2) SLessThan 241 242 - 245: 6(int) Load 8(invocation) - 246: 243(bvec2) GroupNonUniformBroadcast 38 244 245 - 248: 138(ivec2) Select 246 247 242 - 249: 139(ptr) AccessChain 49(data) 238 60 - 250: 43(ivec4) Load 249 - 251: 43(ivec4) VectorShuffle 250 248 4 5 2 3 - Store 249 251 - 252: 6(int) Load 8(invocation) - 253: 139(ptr) AccessChain 49(data) 60 60 - 254: 43(ivec4) Load 253 - 255: 149(ivec3) VectorShuffle 254 254 0 1 2 - 258: 257(bvec3) SLessThan 255 256 - 259: 6(int) Load 8(invocation) - 260: 257(bvec3) GroupNonUniformBroadcast 38 258 259 - 262: 149(ivec3) Select 260 261 256 - 263: 139(ptr) AccessChain 49(data) 252 60 - 264: 43(ivec4) Load 263 - 265: 43(ivec4) VectorShuffle 264 262 4 5 6 3 - Store 263 265 - 266: 6(int) Load 8(invocation) - 267: 139(ptr) AccessChain 49(data) 60 60 - 268: 43(ivec4) Load 267 - 270: 83(bvec4) SLessThan 268 269 - 271: 6(int) Load 8(invocation) - 272: 83(bvec4) GroupNonUniformBroadcast 38 270 271 - 274: 43(ivec4) Select 272 273 269 - 275: 139(ptr) AccessChain 49(data) 266 60 - Store 275 274 + 235: 134(ptr) AccessChain 49(data) 60 60 + 236: 43(ivec4) Load 235 + 237: 143(ivec3) VectorShuffle 236 236 0 1 2 + 240: 239(bvec3) SLessThan 237 238 + 241: 239(bvec3) GroupNonUniformBroadcast 38 240 64 + 243: 143(ivec3) Select 241 242 238 + 244: 134(ptr) AccessChain 49(data) 234 60 + 245: 43(ivec4) Load 244 + 246: 43(ivec4) VectorShuffle 245 243 4 5 6 3 + Store 244 246 + 247: 6(int) Load 8(invocation) + 248: 134(ptr) AccessChain 49(data) 60 60 + 249: 43(ivec4) Load 248 + 251: 83(bvec4) SLessThan 249 250 + 252: 83(bvec4) GroupNonUniformBroadcast 38 251 64 + 254: 43(ivec4) Select 252 253 250 + 255: 134(ptr) AccessChain 49(data) 247 60 + Store 255 254 Branch 94 - 276: Label - 277: 6(int) Load 8(invocation) - 278: 96(ptr) AccessChain 49(data) 61 61 54 - 279: 40(float) Load 278 - 280: 40(float) GroupNonUniformBroadcastFirst 38 279 - 281: 96(ptr) AccessChain 49(data) 277 61 54 - Store 281 280 - 282: 6(int) Load 8(invocation) - 283: 104(ptr) AccessChain 49(data) 60 61 - 284: 41(fvec4) Load 283 - 285: 103(fvec2) VectorShuffle 284 284 0 1 - 286: 103(fvec2) GroupNonUniformBroadcastFirst 38 285 - 287: 104(ptr) AccessChain 49(data) 282 61 - 288: 41(fvec4) Load 287 - 289: 41(fvec4) VectorShuffle 288 286 4 5 2 3 - Store 287 289 - 290: 6(int) Load 8(invocation) - 291: 104(ptr) AccessChain 49(data) 51 61 - 292: 41(fvec4) Load 291 - 293: 114(fvec3) VectorShuffle 292 292 0 1 2 - 294: 114(fvec3) GroupNonUniformBroadcastFirst 38 293 - 295: 104(ptr) AccessChain 49(data) 290 61 - 296: 41(fvec4) Load 295 - 297: 41(fvec4) VectorShuffle 296 294 4 5 6 3 - Store 295 297 - 298: 6(int) Load 8(invocation) - 299: 104(ptr) AccessChain 49(data) 124 61 - 300: 41(fvec4) Load 299 - 301: 41(fvec4) GroupNonUniformBroadcastFirst 38 300 - 302: 104(ptr) AccessChain 49(data) 298 61 - Store 302 301 - 303: 6(int) Load 8(invocation) - 304: 131(ptr) AccessChain 49(data) 61 60 54 - 305: 42(int) Load 304 - 306: 42(int) GroupNonUniformBroadcastFirst 38 305 - 307: 131(ptr) AccessChain 49(data) 303 60 54 - Store 307 306 - 308: 6(int) Load 8(invocation) - 309: 139(ptr) AccessChain 49(data) 60 60 - 310: 43(ivec4) Load 309 - 311: 138(ivec2) VectorShuffle 310 310 0 1 - 312: 138(ivec2) GroupNonUniformBroadcastFirst 38 311 - 313: 139(ptr) AccessChain 49(data) 308 60 - 314: 43(ivec4) Load 313 - 315: 43(ivec4) VectorShuffle 314 312 4 5 2 3 - Store 313 315 - 316: 6(int) Load 8(invocation) - 317: 139(ptr) AccessChain 49(data) 51 60 - 318: 43(ivec4) Load 317 - 319: 149(ivec3) VectorShuffle 318 318 0 1 2 - 320: 149(ivec3) GroupNonUniformBroadcastFirst 38 319 - 321: 139(ptr) AccessChain 49(data) 316 60 - 322: 43(ivec4) Load 321 - 323: 43(ivec4) VectorShuffle 322 320 4 5 6 3 - Store 321 323 - 324: 6(int) Load 8(invocation) - 325: 139(ptr) AccessChain 49(data) 124 60 - 326: 43(ivec4) Load 325 - 327: 43(ivec4) GroupNonUniformBroadcastFirst 38 326 - 328: 139(ptr) AccessChain 49(data) 324 60 - Store 328 327 - 329: 6(int) Load 8(invocation) - 330: 55(ptr) AccessChain 49(data) 61 51 54 - 331: 6(int) Load 330 - 332: 6(int) GroupNonUniformBroadcastFirst 38 331 - 333: 55(ptr) AccessChain 49(data) 329 51 54 - Store 333 332 - 334: 6(int) Load 8(invocation) - 335: 88(ptr) AccessChain 49(data) 60 51 - 336: 17(ivec4) Load 335 - 337: 171(ivec2) VectorShuffle 336 336 0 1 - 338: 171(ivec2) GroupNonUniformBroadcastFirst 38 337 - 339: 88(ptr) AccessChain 49(data) 334 51 - 340: 17(ivec4) Load 339 - 341: 17(ivec4) VectorShuffle 340 338 4 5 2 3 - Store 339 341 - 342: 6(int) Load 8(invocation) - 343: 88(ptr) AccessChain 49(data) 51 51 - 344: 17(ivec4) Load 343 - 345: 181(ivec3) VectorShuffle 344 344 0 1 2 - 346: 181(ivec3) GroupNonUniformBroadcastFirst 38 345 - 347: 88(ptr) AccessChain 49(data) 342 51 - 348: 17(ivec4) Load 347 - 349: 17(ivec4) VectorShuffle 348 346 4 5 6 3 - Store 347 349 - 350: 6(int) Load 8(invocation) - 351: 88(ptr) AccessChain 49(data) 124 51 - 352: 17(ivec4) Load 351 - 353: 17(ivec4) GroupNonUniformBroadcastFirst 38 352 - 354: 88(ptr) AccessChain 49(data) 350 51 - Store 354 353 - 355: 6(int) Load 8(invocation) - 356: 197(ptr) AccessChain 49(data) 61 124 54 - 357:44(float64_t) Load 356 - 358:44(float64_t) GroupNonUniformBroadcastFirst 38 357 - 359: 197(ptr) AccessChain 49(data) 355 124 54 - Store 359 358 - 360: 6(int) Load 8(invocation) - 361: 205(ptr) AccessChain 49(data) 60 124 - 362: 45(f64vec4) Load 361 - 363:204(f64vec2) VectorShuffle 362 362 0 1 - 364:204(f64vec2) GroupNonUniformBroadcastFirst 38 363 - 365: 205(ptr) AccessChain 49(data) 360 124 - 366: 45(f64vec4) Load 365 - 367: 45(f64vec4) VectorShuffle 366 364 4 5 2 3 - Store 365 367 + 256: Label + 257: 6(int) Load 8(invocation) + 258: 96(ptr) AccessChain 49(data) 61 61 54 + 259: 40(float) Load 258 + 260: 40(float) GroupNonUniformBroadcastFirst 38 259 + 261: 96(ptr) AccessChain 49(data) 257 61 54 + Store 261 260 + 262: 6(int) Load 8(invocation) + 263: 103(ptr) AccessChain 49(data) 60 61 + 264: 41(fvec4) Load 263 + 265: 102(fvec2) VectorShuffle 264 264 0 1 + 266: 102(fvec2) GroupNonUniformBroadcastFirst 38 265 + 267: 103(ptr) AccessChain 49(data) 262 61 + 268: 41(fvec4) Load 267 + 269: 41(fvec4) VectorShuffle 268 266 4 5 2 3 + Store 267 269 + 270: 6(int) Load 8(invocation) + 271: 103(ptr) AccessChain 49(data) 51 61 + 272: 41(fvec4) Load 271 + 273: 112(fvec3) VectorShuffle 272 272 0 1 2 + 274: 112(fvec3) GroupNonUniformBroadcastFirst 38 273 + 275: 103(ptr) AccessChain 49(data) 270 61 + 276: 41(fvec4) Load 275 + 277: 41(fvec4) VectorShuffle 276 274 4 5 6 3 + Store 275 277 + 278: 6(int) Load 8(invocation) + 279: 103(ptr) AccessChain 49(data) 121 61 + 280: 41(fvec4) Load 279 + 281: 41(fvec4) GroupNonUniformBroadcastFirst 38 280 + 282: 103(ptr) AccessChain 49(data) 278 61 + Store 282 281 + 283: 6(int) Load 8(invocation) + 284: 127(ptr) AccessChain 49(data) 61 60 54 + 285: 42(int) Load 284 + 286: 42(int) GroupNonUniformBroadcastFirst 38 285 + 287: 127(ptr) AccessChain 49(data) 283 60 54 + Store 287 286 + 288: 6(int) Load 8(invocation) + 289: 134(ptr) AccessChain 49(data) 60 60 + 290: 43(ivec4) Load 289 + 291: 133(ivec2) VectorShuffle 290 290 0 1 + 292: 133(ivec2) GroupNonUniformBroadcastFirst 38 291 + 293: 134(ptr) AccessChain 49(data) 288 60 + 294: 43(ivec4) Load 293 + 295: 43(ivec4) VectorShuffle 294 292 4 5 2 3 + Store 293 295 + 296: 6(int) Load 8(invocation) + 297: 134(ptr) AccessChain 49(data) 51 60 + 298: 43(ivec4) Load 297 + 299: 143(ivec3) VectorShuffle 298 298 0 1 2 + 300: 143(ivec3) GroupNonUniformBroadcastFirst 38 299 + 301: 134(ptr) AccessChain 49(data) 296 60 + 302: 43(ivec4) Load 301 + 303: 43(ivec4) VectorShuffle 302 300 4 5 6 3 + Store 301 303 + 304: 6(int) Load 8(invocation) + 305: 134(ptr) AccessChain 49(data) 121 60 + 306: 43(ivec4) Load 305 + 307: 43(ivec4) GroupNonUniformBroadcastFirst 38 306 + 308: 134(ptr) AccessChain 49(data) 304 60 + Store 308 307 + 309: 6(int) Load 8(invocation) + 310: 55(ptr) AccessChain 49(data) 61 51 54 + 311: 6(int) Load 310 + 312: 6(int) GroupNonUniformBroadcastFirst 38 311 + 313: 55(ptr) AccessChain 49(data) 309 51 54 + Store 313 312 + 314: 6(int) Load 8(invocation) + 315: 88(ptr) AccessChain 49(data) 60 51 + 316: 17(ivec4) Load 315 + 317: 162(ivec2) VectorShuffle 316 316 0 1 + 318: 162(ivec2) GroupNonUniformBroadcastFirst 38 317 + 319: 88(ptr) AccessChain 49(data) 314 51 + 320: 17(ivec4) Load 319 + 321: 17(ivec4) VectorShuffle 320 318 4 5 2 3 + Store 319 321 + 322: 6(int) Load 8(invocation) + 323: 88(ptr) AccessChain 49(data) 51 51 + 324: 17(ivec4) Load 323 + 325: 171(ivec3) VectorShuffle 324 324 0 1 2 + 326: 171(ivec3) GroupNonUniformBroadcastFirst 38 325 + 327: 88(ptr) AccessChain 49(data) 322 51 + 328: 17(ivec4) Load 327 + 329: 17(ivec4) VectorShuffle 328 326 4 5 6 3 + Store 327 329 + 330: 6(int) Load 8(invocation) + 331: 88(ptr) AccessChain 49(data) 121 51 + 332: 17(ivec4) Load 331 + 333: 17(ivec4) GroupNonUniformBroadcastFirst 38 332 + 334: 88(ptr) AccessChain 49(data) 330 51 + Store 334 333 + 335: 6(int) Load 8(invocation) + 336: 185(ptr) AccessChain 49(data) 61 121 54 + 337:44(float64_t) Load 336 + 338:44(float64_t) GroupNonUniformBroadcastFirst 38 337 + 339: 185(ptr) AccessChain 49(data) 335 121 54 + Store 339 338 + 340: 6(int) Load 8(invocation) + 341: 192(ptr) AccessChain 49(data) 60 121 + 342: 45(f64vec4) Load 341 + 343:191(f64vec2) VectorShuffle 342 342 0 1 + 344:191(f64vec2) GroupNonUniformBroadcastFirst 38 343 + 345: 192(ptr) AccessChain 49(data) 340 121 + 346: 45(f64vec4) Load 345 + 347: 45(f64vec4) VectorShuffle 346 344 4 5 2 3 + Store 345 347 + 348: 6(int) Load 8(invocation) + 349: 192(ptr) AccessChain 49(data) 51 121 + 350: 45(f64vec4) Load 349 + 351:201(f64vec3) VectorShuffle 350 350 0 1 2 + 352:201(f64vec3) GroupNonUniformBroadcastFirst 38 351 + 353: 192(ptr) AccessChain 49(data) 348 121 + 354: 45(f64vec4) Load 353 + 355: 45(f64vec4) VectorShuffle 354 352 4 5 6 3 + Store 353 355 + 356: 6(int) Load 8(invocation) + 357: 192(ptr) AccessChain 49(data) 121 121 + 358: 45(f64vec4) Load 357 + 359: 45(f64vec4) GroupNonUniformBroadcastFirst 38 358 + 360: 192(ptr) AccessChain 49(data) 356 121 + Store 360 359 + 361: 6(int) Load 8(invocation) + 362: 127(ptr) AccessChain 49(data) 61 60 54 + 363: 42(int) Load 362 + 364: 36(bool) SLessThan 363 61 + 365: 36(bool) GroupNonUniformBroadcastFirst 38 364 + 366: 42(int) Select 365 60 61 + 367: 127(ptr) AccessChain 49(data) 361 60 54 + Store 367 366 368: 6(int) Load 8(invocation) - 369: 205(ptr) AccessChain 49(data) 51 124 - 370: 45(f64vec4) Load 369 - 371:215(f64vec3) VectorShuffle 370 370 0 1 2 - 372:215(f64vec3) GroupNonUniformBroadcastFirst 38 371 - 373: 205(ptr) AccessChain 49(data) 368 124 - 374: 45(f64vec4) Load 373 - 375: 45(f64vec4) VectorShuffle 374 372 4 5 6 3 - Store 373 375 - 376: 6(int) Load 8(invocation) - 377: 205(ptr) AccessChain 49(data) 124 124 - 378: 45(f64vec4) Load 377 - 379: 45(f64vec4) GroupNonUniformBroadcastFirst 38 378 - 380: 205(ptr) AccessChain 49(data) 376 124 - Store 380 379 - 381: 6(int) Load 8(invocation) - 382: 131(ptr) AccessChain 49(data) 61 60 54 - 383: 42(int) Load 382 - 384: 36(bool) SLessThan 383 61 - 385: 36(bool) GroupNonUniformBroadcastFirst 38 384 - 386: 42(int) Select 385 60 61 - 387: 131(ptr) AccessChain 49(data) 381 60 54 - Store 387 386 + 369: 134(ptr) AccessChain 49(data) 60 60 + 370: 43(ivec4) Load 369 + 371: 133(ivec2) VectorShuffle 370 370 0 1 + 372: 226(bvec2) SLessThan 371 225 + 373: 226(bvec2) GroupNonUniformBroadcastFirst 38 372 + 374: 133(ivec2) Select 373 229 225 + 375: 134(ptr) AccessChain 49(data) 368 60 + 376: 43(ivec4) Load 375 + 377: 43(ivec4) VectorShuffle 376 374 4 5 2 3 + Store 375 377 + 378: 6(int) Load 8(invocation) + 379: 134(ptr) AccessChain 49(data) 60 60 + 380: 43(ivec4) Load 379 + 381: 143(ivec3) VectorShuffle 380 380 0 1 2 + 382: 239(bvec3) SLessThan 381 238 + 383: 239(bvec3) GroupNonUniformBroadcastFirst 38 382 + 384: 143(ivec3) Select 383 242 238 + 385: 134(ptr) AccessChain 49(data) 378 60 + 386: 43(ivec4) Load 385 + 387: 43(ivec4) VectorShuffle 386 384 4 5 6 3 + Store 385 387 388: 6(int) Load 8(invocation) - 389: 139(ptr) AccessChain 49(data) 60 60 + 389: 134(ptr) AccessChain 49(data) 60 60 390: 43(ivec4) Load 389 - 391: 138(ivec2) VectorShuffle 390 390 0 1 - 392: 243(bvec2) SLessThan 391 242 - 393: 243(bvec2) GroupNonUniformBroadcastFirst 38 392 - 394: 138(ivec2) Select 393 247 242 - 395: 139(ptr) AccessChain 49(data) 388 60 - 396: 43(ivec4) Load 395 - 397: 43(ivec4) VectorShuffle 396 394 4 5 2 3 - Store 395 397 - 398: 6(int) Load 8(invocation) - 399: 139(ptr) AccessChain 49(data) 60 60 - 400: 43(ivec4) Load 399 - 401: 149(ivec3) VectorShuffle 400 400 0 1 2 - 402: 257(bvec3) SLessThan 401 256 - 403: 257(bvec3) GroupNonUniformBroadcastFirst 38 402 - 404: 149(ivec3) Select 403 261 256 - 405: 139(ptr) AccessChain 49(data) 398 60 - 406: 43(ivec4) Load 405 - 407: 43(ivec4) VectorShuffle 406 404 4 5 6 3 - Store 405 407 - 408: 6(int) Load 8(invocation) - 409: 139(ptr) AccessChain 49(data) 60 60 - 410: 43(ivec4) Load 409 - 411: 83(bvec4) SLessThan 410 269 - 412: 83(bvec4) GroupNonUniformBroadcastFirst 38 411 - 413: 43(ivec4) Select 412 273 269 - 414: 139(ptr) AccessChain 49(data) 408 60 - Store 414 413 + 391: 83(bvec4) SLessThan 390 250 + 392: 83(bvec4) GroupNonUniformBroadcastFirst 38 391 + 393: 43(ivec4) Select 392 253 250 + 394: 134(ptr) AccessChain 49(data) 388 60 + Store 394 393 Branch 94 94: Label Return diff --git a/deps/glslang/Test/baseResults/spv.subgroupBallotNeg.comp.out b/deps/glslang/Test/baseResults/spv.subgroupBallotNeg.comp.out new file mode 100644 index 00000000..49b6b540 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.subgroupBallotNeg.comp.out @@ -0,0 +1,6 @@ +spv.subgroupBallotNeg.comp +ERROR: 0:32: 'id' : argument must be compile-time constant +ERROR: 1 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/deps/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out b/deps/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out index e967df4a..ab4e0c26 100644 --- a/deps/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out +++ b/deps/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out @@ -1,8 +1,5 @@ spv.subgroupPartitioned.comp -error: SPIRV-Tools Validation Errors -error: Opcode GroupNonUniformFAdd requires one of these capabilities: GroupNonUniformArithmetic GroupNonUniformClustered - %179 = OpGroupNonUniformFAdd %float %uint_3 PartitionedReduceNV %176 %177 - +Validation failed // Module Version 10300 // Generated by (magic number): 80007 // Id's are bound by 2506 diff --git a/deps/glslang/Test/baseResults/spv.subpass.frag.out b/deps/glslang/Test/baseResults/spv.subpass.frag.out index 044243e2..706624df 100644 --- a/deps/glslang/Test/baseResults/spv.subpass.frag.out +++ b/deps/glslang/Test/baseResults/spv.subpass.frag.out @@ -23,16 +23,22 @@ spv.subpass.frag Name 56 "usub" Name 61 "usubMS" Decorate 30(sub) DescriptorSet 0 + Decorate 30(sub) Binding 0 Decorate 30(sub) InputAttachmentIndex 1 Decorate 35(subMS) DescriptorSet 0 + Decorate 35(subMS) Binding 0 Decorate 35(subMS) InputAttachmentIndex 2 Decorate 42(isub) DescriptorSet 0 + Decorate 42(isub) Binding 0 Decorate 42(isub) InputAttachmentIndex 3 Decorate 45(isubMS) DescriptorSet 0 + Decorate 45(isubMS) Binding 0 Decorate 45(isubMS) InputAttachmentIndex 4 Decorate 56(usub) DescriptorSet 0 + Decorate 56(usub) Binding 0 Decorate 56(usub) InputAttachmentIndex 5 Decorate 61(usubMS) DescriptorSet 0 + Decorate 61(usubMS) Binding 0 Decorate 61(usubMS) InputAttachmentIndex 6 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/spv.test.frag.out b/deps/glslang/Test/baseResults/spv.test.frag.out index b5fccc32..02e4f669 100644 --- a/deps/glslang/Test/baseResults/spv.test.frag.out +++ b/deps/glslang/Test/baseResults/spv.test.frag.out @@ -22,7 +22,9 @@ spv.test.frag Name 46 "u" Name 49 "blend" Decorate 16(texSampler2D) DescriptorSet 0 + Decorate 16(texSampler2D) Binding 0 Decorate 33(texSampler3D) DescriptorSet 0 + Decorate 33(texSampler3D) Binding 0 Decorate 43(gl_FragColor) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/spv.texture.frag.out b/deps/glslang/Test/baseResults/spv.texture.frag.out index e685018f..d518ad7b 100644 --- a/deps/glslang/Test/baseResults/spv.texture.frag.out +++ b/deps/glslang/Test/baseResults/spv.texture.frag.out @@ -40,11 +40,17 @@ WARNING: 0:12: varying deprecated in version 130; may be removed in future relea Name 303 "scale" Name 304 "t" Decorate 32(texSampler1D) DescriptorSet 0 + Decorate 32(texSampler1D) Binding 0 Decorate 76(texSampler2D) DescriptorSet 0 + Decorate 76(texSampler2D) Binding 0 Decorate 104(texSampler3D) DescriptorSet 0 + Decorate 104(texSampler3D) Binding 0 Decorate 130(texSamplerCube) DescriptorSet 0 + Decorate 130(texSamplerCube) Binding 0 Decorate 145(shadowSampler1D) DescriptorSet 0 + Decorate 145(shadowSampler1D) Binding 0 Decorate 164(shadowSampler2D) DescriptorSet 0 + Decorate 164(shadowSampler2D) Binding 0 Decorate 291(gl_FragColor) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/spv.texture.sampler.transform.frag.out b/deps/glslang/Test/baseResults/spv.texture.sampler.transform.frag.out index ef8bbf6a..612f2a90 100644 --- a/deps/glslang/Test/baseResults/spv.texture.sampler.transform.frag.out +++ b/deps/glslang/Test/baseResults/spv.texture.sampler.transform.frag.out @@ -14,6 +14,7 @@ spv.texture.sampler.transform.frag Name 13 "tex" Name 17 "coord" Decorate 13(tex) DescriptorSet 0 + Decorate 13(tex) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.texture.vert.out b/deps/glslang/Test/baseResults/spv.texture.vert.out index 0c1b7a14..f3f979c9 100644 --- a/deps/glslang/Test/baseResults/spv.texture.vert.out +++ b/deps/glslang/Test/baseResults/spv.texture.vert.out @@ -24,11 +24,17 @@ spv.texture.vert Name 118 "shadowSampler2D" Name 148 "gl_Position" Decorate 29(texSampler1D) DescriptorSet 0 + Decorate 29(texSampler1D) Binding 0 Decorate 56(texSampler2D) DescriptorSet 0 + Decorate 56(texSampler2D) Binding 0 Decorate 80(texSampler3D) DescriptorSet 0 + Decorate 80(texSampler3D) Binding 0 Decorate 96(texSamplerCube) DescriptorSet 0 + Decorate 96(texSamplerCube) Binding 0 Decorate 106(shadowSampler1D) DescriptorSet 0 + Decorate 106(shadowSampler1D) Binding 0 Decorate 118(shadowSampler2D) DescriptorSet 0 + Decorate 118(shadowSampler2D) Binding 0 Decorate 148(gl_Position) BuiltIn Position 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/spv.textureBuffer.vert.out b/deps/glslang/Test/baseResults/spv.textureBuffer.vert.out index e327cb48..252a9c82 100644 --- a/deps/glslang/Test/baseResults/spv.textureBuffer.vert.out +++ b/deps/glslang/Test/baseResults/spv.textureBuffer.vert.out @@ -16,10 +16,15 @@ spv.textureBuffer.vert Name 32 "utBuf" Name 38 "itBuf" Decorate 9(tBuf) DescriptorSet 0 + Decorate 9(tBuf) Binding 0 Decorate 13(s) DescriptorSet 0 + Decorate 13(s) Binding 0 Decorate 23(sBuf) DescriptorSet 0 + Decorate 23(sBuf) Binding 0 Decorate 32(utBuf) DescriptorSet 0 + Decorate 32(utBuf) Binding 0 Decorate 38(itBuf) DescriptorSet 0 + Decorate 38(itBuf) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.textureGatherBiasLod.frag.out b/deps/glslang/Test/baseResults/spv.textureGatherBiasLod.frag.out index d01515dc..cd18688f 100644 --- a/deps/glslang/Test/baseResults/spv.textureGatherBiasLod.frag.out +++ b/deps/glslang/Test/baseResults/spv.textureGatherBiasLod.frag.out @@ -1,8 +1,5 @@ spv.textureGatherBiasLod.frag -error: SPIRV-Tools Validation Errors -error: Image Operand Bias can only be used with ImplicitLod opcodes - %27 = OpImageGather %v4float %17 %21 %int_0 Bias %26 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 298 @@ -35,9 +32,13 @@ error: Image Operand Bias can only be used with ImplicitLod opcodes Name 176 "lod" Name 296 "fragColor" Decorate 16(s2D) DescriptorSet 0 + Decorate 16(s2D) Binding 0 Decorate 33(s2DArray) DescriptorSet 0 + Decorate 33(s2DArray) Binding 0 Decorate 47(sCube) DescriptorSet 0 + Decorate 47(sCube) Binding 0 Decorate 58(sCubeArray) DescriptorSet 0 + Decorate 58(sCubeArray) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.uint.frag.out b/deps/glslang/Test/baseResults/spv.uint.frag.out index af0ad85a..e6fe5e4d 100644 --- a/deps/glslang/Test/baseResults/spv.uint.frag.out +++ b/deps/glslang/Test/baseResults/spv.uint.frag.out @@ -58,6 +58,7 @@ spv.uint.frag Decorate 68(c) RelaxedPrecision Decorate 72(usampler) RelaxedPrecision Decorate 72(usampler) DescriptorSet 0 + Decorate 72(usampler) Binding 0 Decorate 73 RelaxedPrecision Decorate 77(tc) RelaxedPrecision Decorate 78 RelaxedPrecision diff --git a/deps/glslang/Test/baseResults/spv.uniformArray.frag.out b/deps/glslang/Test/baseResults/spv.uniformArray.frag.out index ff5855c1..0f9883e4 100644 --- a/deps/glslang/Test/baseResults/spv.uniformArray.frag.out +++ b/deps/glslang/Test/baseResults/spv.uniformArray.frag.out @@ -18,6 +18,7 @@ spv.uniformArray.frag Name 52 "texSampler2D" Decorate 47(gl_FragColor) Location 0 Decorate 52(texSampler2D) DescriptorSet 0 + Decorate 52(texSampler2D) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.variableArrayIndex.frag.out b/deps/glslang/Test/baseResults/spv.variableArrayIndex.frag.out index e0010dfc..87d934ec 100644 --- a/deps/glslang/Test/baseResults/spv.variableArrayIndex.frag.out +++ b/deps/glslang/Test/baseResults/spv.variableArrayIndex.frag.out @@ -38,6 +38,7 @@ spv.variableArrayIndex.frag Decorate 36(foo) Flat Decorate 54(gl_FragColor) Location 0 Decorate 59(samp2D) DescriptorSet 0 + Decorate 59(samp2D) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 diff --git a/deps/glslang/Test/baseResults/spv.varyingArray.frag.out b/deps/glslang/Test/baseResults/spv.varyingArray.frag.out index 0acfdd92..2628f829 100644 --- a/deps/glslang/Test/baseResults/spv.varyingArray.frag.out +++ b/deps/glslang/Test/baseResults/spv.varyingArray.frag.out @@ -18,6 +18,7 @@ spv.varyingArray.frag Name 45 "gl_FragColor" Name 48 "foo" Decorate 13(texSampler2D) DescriptorSet 0 + Decorate 13(texSampler2D) Binding 0 Decorate 45(gl_FragColor) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/deps/glslang/Test/baseResults/spv.varyingArrayIndirect.frag.out b/deps/glslang/Test/baseResults/spv.varyingArrayIndirect.frag.out index ffe78591..60e9857b 100644 --- a/deps/glslang/Test/baseResults/spv.varyingArrayIndirect.frag.out +++ b/deps/glslang/Test/baseResults/spv.varyingArrayIndirect.frag.out @@ -20,6 +20,7 @@ spv.varyingArrayIndirect.frag Name 50 "alpha" Name 56 "gl_FragColor" Decorate 13(texSampler2D) DescriptorSet 0 + Decorate 13(texSampler2D) Binding 0 Decorate 22(b) Flat Decorate 31(a) Flat Decorate 56(gl_FragColor) Location 0 diff --git a/deps/glslang/Test/baseResults/spv.viewportArray2.tesc.out b/deps/glslang/Test/baseResults/spv.viewportArray2.tesc.out index b14179ec..a4016d40 100644 --- a/deps/glslang/Test/baseResults/spv.viewportArray2.tesc.out +++ b/deps/glslang/Test/baseResults/spv.viewportArray2.tesc.out @@ -1,8 +1,5 @@ spv.viewportArray2.tesc -error: SPIRV-Tools Validation Errors -error: Vulkan spec allows BuiltIn ViewportIndex to be used only with Vertex, TessellationEvaluation, Geometry, or Fragment execution models. ID <0> (OpStore) is referencing ID <22> (OpVariable) which is decorated with BuiltIn ViewportIndex in function <4> called with execution model TessellationControl. - OpStore %gl_ViewportIndex %int_2 - +Validation failed // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 25 diff --git a/deps/glslang/Test/baseResults/spv.vulkan110.int16.frag.out b/deps/glslang/Test/baseResults/spv.vulkan110.int16.frag.out index 9141e4ec..11f1cd3e 100644 --- a/deps/glslang/Test/baseResults/spv.vulkan110.int16.frag.out +++ b/deps/glslang/Test/baseResults/spv.vulkan110.int16.frag.out @@ -1,8 +1,4 @@ spv.vulkan110.int16.frag -error: SPIRV-Tools Validation Errors -error: Capability Float16 is not allowed by Vulkan 1.1 specification (or requires extension) - OpCapability Float16 - // Module Version 10300 // Generated by (magic number): 80007 // Id's are bound by 523 @@ -19,14 +15,14 @@ error: Capability Float16 is not allowed by Vulkan 1.1 specification (or require EntryPoint Fragment 4 "main" ExecutionMode 4 OriginUpperLeft Source GLSL 450 - SourceExtension "GL_KHX_shader_explicit_arithmetic_types" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float16" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float32" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_float64" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int16" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int32" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int64" - SourceExtension "GL_KHX_shader_explicit_arithmetic_types_int8" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float16" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float32" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float64" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int16" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int32" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int64" + SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int8" Name 4 "main" Name 6 "literal(" Name 8 "typeCast16(" diff --git a/deps/glslang/Test/baseResults/spv.vulkan110.storageBuffer.vert.out b/deps/glslang/Test/baseResults/spv.vulkan110.storageBuffer.vert.out index 77eafc24..a0194713 100644 --- a/deps/glslang/Test/baseResults/spv.vulkan110.storageBuffer.vert.out +++ b/deps/glslang/Test/baseResults/spv.vulkan110.storageBuffer.vert.out @@ -29,9 +29,11 @@ spv.vulkan110.storageBuffer.vert MemberDecorate 16(ub) 0 Offset 0 Decorate 16(ub) Block Decorate 18(ubi) DescriptorSet 0 + Decorate 18(ubi) Binding 0 MemberDecorate 22(bb) 0 Offset 0 Decorate 22(bb) Block Decorate 24(bbi) DescriptorSet 0 + Decorate 24(bbi) Binding 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/deps/glslang/Test/baseResults/spv.xfb.vert.out b/deps/glslang/Test/baseResults/spv.xfb.vert.out index 68633e1f..3cd93d50 100644 --- a/deps/glslang/Test/baseResults/spv.xfb.vert.out +++ b/deps/glslang/Test/baseResults/spv.xfb.vert.out @@ -1,8 +1,4 @@ spv.xfb.vert -error: SPIRV-Tools Validation Errors -error: Capability TransformFeedback is not allowed by Vulkan 1.0 specification (or requires extension) - OpCapability TransformFeedback - // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 16 diff --git a/deps/glslang/Test/baseResults/spv.xfb2.vert.out b/deps/glslang/Test/baseResults/spv.xfb2.vert.out index 6dc39872..a8551a1a 100644 --- a/deps/glslang/Test/baseResults/spv.xfb2.vert.out +++ b/deps/glslang/Test/baseResults/spv.xfb2.vert.out @@ -1,8 +1,4 @@ spv.xfb2.vert -error: SPIRV-Tools Validation Errors -error: Capability TransformFeedback is not allowed by Vulkan 1.0 specification (or requires extension) - OpCapability TransformFeedback - // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 35 diff --git a/deps/glslang/Test/baseResults/spv.xfb3.vert.out b/deps/glslang/Test/baseResults/spv.xfb3.vert.out index 1d526aa9..0218847e 100644 --- a/deps/glslang/Test/baseResults/spv.xfb3.vert.out +++ b/deps/glslang/Test/baseResults/spv.xfb3.vert.out @@ -1,8 +1,4 @@ spv.xfb3.vert -error: SPIRV-Tools Validation Errors -error: Capability TransformFeedback is not allowed by Vulkan 1.0 specification (or requires extension) - OpCapability TransformFeedback - // Module Version 10000 // Generated by (magic number): 80007 // Id's are bound by 35 diff --git a/deps/glslang/Test/baseResults/spv.xfbOffsetOnBlockMembersAssignment.vert.out b/deps/glslang/Test/baseResults/spv.xfbOffsetOnBlockMembersAssignment.vert.out new file mode 100644 index 00000000..066aa3a0 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.xfbOffsetOnBlockMembersAssignment.vert.out @@ -0,0 +1,76 @@ +spv.xfbOffsetOnBlockMembersAssignment.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 33 + + Capability Shader + Capability TransformFeedback + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 10 27 31 32 + ExecutionMode 4 Xfb + Source GLSL 450 + Name 4 "main" + Name 8 "block2" + MemberName 8(block2) 0 "y1_out" + MemberName 8(block2) 1 "y2_out" + Name 10 "" + Name 25 "gl_PerVertex" + MemberName 25(gl_PerVertex) 0 "gl_Position" + MemberName 25(gl_PerVertex) 1 "gl_PointSize" + MemberName 25(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 25(gl_PerVertex) 3 "gl_CullDistance" + Name 27 "" + Name 31 "gl_VertexID" + Name 32 "gl_InstanceID" + MemberDecorate 8(block2) 0 Offset 0 + MemberDecorate 8(block2) 1 Offset 4 + Decorate 8(block2) Block + Decorate 10 Location 5 + Decorate 10 XfbBuffer 2 + Decorate 10 XfbStride 20 + MemberDecorate 25(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 25(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 25(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 25(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 25(gl_PerVertex) Block + Decorate 27 XfbBuffer 0 + Decorate 27 XfbStride 0 + Decorate 31(gl_VertexID) BuiltIn VertexId + Decorate 32(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(block2): TypeStruct 6(float) 7(fvec4) + 9: TypePointer Output 8(block2) + 10: 9(ptr) Variable Output + 11: TypeInt 32 1 + 12: 11(int) Constant 0 + 13: 6(float) Constant 1088421888 + 14: TypePointer Output 6(float) + 16: 11(int) Constant 1 + 17: 6(float) Constant 1065353216 + 18: 6(float) Constant 0 + 19: 7(fvec4) ConstantComposite 17 18 18 17 + 20: TypePointer Output 7(fvec4) + 22: TypeInt 32 0 + 23: 22(int) Constant 1 + 24: TypeArray 6(float) 23 +25(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 24 24 + 26: TypePointer Output 25(gl_PerVertex) + 27: 26(ptr) Variable Output + 28: 7(fvec4) ConstantComposite 18 18 18 18 + 30: TypePointer Input 11(int) + 31(gl_VertexID): 30(ptr) Variable Input +32(gl_InstanceID): 30(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 15: 14(ptr) AccessChain 10 12 + Store 15 13 + 21: 20(ptr) AccessChain 10 16 + Store 21 19 + 29: 20(ptr) AccessChain 27 12 + Store 29 28 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.xfbOffsetOnStructMembersAssignment.vert.out b/deps/glslang/Test/baseResults/spv.xfbOffsetOnStructMembersAssignment.vert.out index 7eb45934..668d24a5 100644 --- a/deps/glslang/Test/baseResults/spv.xfbOffsetOnStructMembersAssignment.vert.out +++ b/deps/glslang/Test/baseResults/spv.xfbOffsetOnStructMembersAssignment.vert.out @@ -27,16 +27,14 @@ spv.xfbOffsetOnStructMembersAssignment.vert Name 34 "" Name 38 "gl_VertexID" Name 39 "gl_InstanceID" - MemberDecorate 7(S) 0 Offset 16 - MemberDecorate 7(S) 1 Offset 20 Decorate 9(s1) Location 0 Decorate 9(s1) XfbBuffer 2 Decorate 9(s1) XfbStride 24 - MemberDecorate 19(S2) 0 Offset 8 - MemberDecorate 19(S2) 1 Offset 12 + Decorate 9(s1) Offset 16 Decorate 21(s2) Location 5 Decorate 21(s2) XfbBuffer 1 Decorate 21(s2) XfbStride 28 + Decorate 21(s2) Offset 8 MemberDecorate 32(gl_PerVertex) 0 BuiltIn Position MemberDecorate 32(gl_PerVertex) 1 BuiltIn PointSize MemberDecorate 32(gl_PerVertex) 2 BuiltIn ClipDistance diff --git a/deps/glslang/Test/baseResults/spv.xfbOverlapOffsetCheckWithBlockAndMember.vert.out b/deps/glslang/Test/baseResults/spv.xfbOverlapOffsetCheckWithBlockAndMember.vert.out new file mode 100644 index 00000000..ebc49629 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.xfbOverlapOffsetCheckWithBlockAndMember.vert.out @@ -0,0 +1,88 @@ +spv.xfbOverlapOffsetCheckWithBlockAndMember.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 39 + + Capability Shader + Capability TransformFeedback + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 10 33 37 38 + ExecutionMode 4 Xfb + Source GLSL 450 + Name 4 "main" + Name 8 "block2" + MemberName 8(block2) 0 "v" + MemberName 8(block2) 1 "u" + MemberName 8(block2) 2 "w" + MemberName 8(block2) 3 "x" + Name 10 "" + Name 31 "gl_PerVertex" + MemberName 31(gl_PerVertex) 0 "gl_Position" + MemberName 31(gl_PerVertex) 1 "gl_PointSize" + MemberName 31(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 31(gl_PerVertex) 3 "gl_CullDistance" + Name 33 "" + Name 37 "gl_VertexID" + Name 38 "gl_InstanceID" + MemberDecorate 8(block2) 0 Offset 12 + MemberDecorate 8(block2) 1 Offset 28 + MemberDecorate 8(block2) 2 Offset 40 + MemberDecorate 8(block2) 3 Offset 56 + Decorate 8(block2) Block + Decorate 10 Location 5 + Decorate 10 XfbBuffer 3 + Decorate 10 XfbStride 72 + MemberDecorate 31(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 31(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 31(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 31(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 31(gl_PerVertex) Block + Decorate 33 XfbBuffer 0 + Decorate 33 XfbStride 0 + Decorate 37(gl_VertexID) BuiltIn VertexId + Decorate 38(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(block2): TypeStruct 7(fvec4) 6(float) 7(fvec4) 7(fvec4) + 9: TypePointer Output 8(block2) + 10: 9(ptr) Variable Output + 11: TypeInt 32 1 + 12: 11(int) Constant 0 + 13: 6(float) Constant 1065353216 + 14: 6(float) Constant 0 + 15: 7(fvec4) ConstantComposite 13 14 13 14 + 16: TypePointer Output 7(fvec4) + 18: 11(int) Constant 1 + 19: 6(float) Constant 1084227584 + 20: TypePointer Output 6(float) + 22: 11(int) Constant 2 + 23: 7(fvec4) ConstantComposite 13 14 14 13 + 25: 11(int) Constant 3 + 26: 7(fvec4) ConstantComposite 19 14 14 14 + 28: TypeInt 32 0 + 29: 28(int) Constant 1 + 30: TypeArray 6(float) 29 +31(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 30 30 + 32: TypePointer Output 31(gl_PerVertex) + 33: 32(ptr) Variable Output + 34: 7(fvec4) ConstantComposite 14 14 14 14 + 36: TypePointer Input 11(int) + 37(gl_VertexID): 36(ptr) Variable Input +38(gl_InstanceID): 36(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 17: 16(ptr) AccessChain 10 12 + Store 17 15 + 21: 20(ptr) AccessChain 10 18 + Store 21 19 + 24: 16(ptr) AccessChain 10 22 + Store 24 23 + 27: 16(ptr) AccessChain 10 25 + Store 27 26 + 35: 16(ptr) AccessChain 33 12 + Store 35 34 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/spv.xfbStrideJustOnce.vert.out b/deps/glslang/Test/baseResults/spv.xfbStrideJustOnce.vert.out new file mode 100644 index 00000000..9b459b50 --- /dev/null +++ b/deps/glslang/Test/baseResults/spv.xfbStrideJustOnce.vert.out @@ -0,0 +1,74 @@ +spv.xfbStrideJustOnce.vert +// Module Version 10000 +// Generated by (magic number): 80007 +// Id's are bound by 33 + + Capability Shader + Capability TransformFeedback + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 10 27 31 32 + ExecutionMode 4 Xfb + Source GLSL 450 + Name 4 "main" + Name 8 "block" + MemberName 8(block) 0 "y1_out" + MemberName 8(block) 1 "y2_out" + Name 10 "" + Name 25 "gl_PerVertex" + MemberName 25(gl_PerVertex) 0 "gl_Position" + MemberName 25(gl_PerVertex) 1 "gl_PointSize" + MemberName 25(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 25(gl_PerVertex) 3 "gl_CullDistance" + Name 27 "" + Name 31 "gl_VertexID" + Name 32 "gl_InstanceID" + Decorate 8(block) Block + Decorate 10 Location 5 + Decorate 10 XfbBuffer 2 + Decorate 10 XfbStride 20 + MemberDecorate 25(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 25(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 25(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 25(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 25(gl_PerVertex) Block + Decorate 27 XfbBuffer 0 + Decorate 27 XfbStride 0 + Decorate 31(gl_VertexID) BuiltIn VertexId + Decorate 32(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(block): TypeStruct 6(float) 7(fvec4) + 9: TypePointer Output 8(block) + 10: 9(ptr) Variable Output + 11: TypeInt 32 1 + 12: 11(int) Constant 0 + 13: 6(float) Constant 1088421888 + 14: TypePointer Output 6(float) + 16: 11(int) Constant 1 + 17: 6(float) Constant 1065353216 + 18: 6(float) Constant 0 + 19: 7(fvec4) ConstantComposite 17 18 18 17 + 20: TypePointer Output 7(fvec4) + 22: TypeInt 32 0 + 23: 22(int) Constant 1 + 24: TypeArray 6(float) 23 +25(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 24 24 + 26: TypePointer Output 25(gl_PerVertex) + 27: 26(ptr) Variable Output + 28: 7(fvec4) ConstantComposite 18 18 18 18 + 30: TypePointer Input 11(int) + 31(gl_VertexID): 30(ptr) Variable Input +32(gl_InstanceID): 30(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 15: 14(ptr) AccessChain 10 12 + Store 15 13 + 21: 20(ptr) AccessChain 10 16 + Store 21 19 + 29: 20(ptr) AccessChain 27 12 + Store 29 28 + Return + FunctionEnd diff --git a/deps/glslang/Test/baseResults/stringToDouble.vert.out b/deps/glslang/Test/baseResults/stringToDouble.vert.out index a799d0a4..3829c703 100644 --- a/deps/glslang/Test/baseResults/stringToDouble.vert.out +++ b/deps/glslang/Test/baseResults/stringToDouble.vert.out @@ -1,6 +1,6 @@ stringToDouble.vert Shader version: 460 -Requested GL_KHX_shader_explicit_arithmetic_types_float16 +Requested GL_EXT_shader_explicit_arithmetic_types_float16 0:? Sequence 0:3 Function Definition: main( ( global void) 0:3 Function Parameters: @@ -524,7 +524,7 @@ Linked vertex stage: Shader version: 460 -Requested GL_KHX_shader_explicit_arithmetic_types_float16 +Requested GL_EXT_shader_explicit_arithmetic_types_float16 0:? Sequence 0:3 Function Definition: main( ( global void) 0:3 Function Parameters: diff --git a/deps/glslang/Test/constantUnaryConversion.comp b/deps/glslang/Test/constantUnaryConversion.comp new file mode 100644 index 00000000..3c479ae6 --- /dev/null +++ b/deps/glslang/Test/constantUnaryConversion.comp @@ -0,0 +1,48 @@ +#version 450 + +#extension GL_EXT_shader_explicit_arithmetic_types : require + +const bool bool_init = true; +const int8_t int8_t_init = int8_t(-1); +const int16_t int16_t_init = int16_t(-2); +const int32_t int32_t_init = int32_t(-3); +const int64_t int64_t_init = int64_t(-4); +const uint8_t uint8_t_init = uint8_t(1); +const uint16_t uint16_t_init = uint16_t(2); +const uint32_t uint32_t_init = uint32_t(3); +const uint64_t uint64_t_init = uint64_t(4); +const float16_t float16_t_init = float16_t(42.0); +const float32_t float32_t_init = float32_t(13.0); +const float64_t float64_t_init = float64_t(-4.0); + +#define TYPE_TO_TYPE(x, y) \ + const x y##_to_##x = x(y##_init) + +#define TYPE_TO(x) \ + TYPE_TO_TYPE(x, bool); \ + TYPE_TO_TYPE(x, int8_t); \ + TYPE_TO_TYPE(x, int16_t); \ + TYPE_TO_TYPE(x, int32_t); \ + TYPE_TO_TYPE(x, int64_t); \ + TYPE_TO_TYPE(x, uint8_t); \ + TYPE_TO_TYPE(x, uint16_t); \ + TYPE_TO_TYPE(x, uint32_t); \ + TYPE_TO_TYPE(x, uint64_t); \ + TYPE_TO_TYPE(x, float16_t); \ + TYPE_TO_TYPE(x, float32_t); \ + TYPE_TO_TYPE(x, float64_t) + +TYPE_TO(bool); +TYPE_TO(int8_t); +TYPE_TO(int16_t); +TYPE_TO(int32_t); +TYPE_TO(int64_t); +TYPE_TO(uint8_t); +TYPE_TO(uint16_t); +TYPE_TO(uint32_t); +TYPE_TO(uint64_t); +TYPE_TO(float16_t); +TYPE_TO(float32_t); +TYPE_TO(float64_t); + +void main() {} diff --git a/deps/glslang/Test/findFunction.frag b/deps/glslang/Test/findFunction.frag index 7e180650..41c09154 100644 --- a/deps/glslang/Test/findFunction.frag +++ b/deps/glslang/Test/findFunction.frag @@ -1,6 +1,6 @@ #version 450 -#extension GL_KHX_shader_explicit_arithmetic_types: enable +#extension GL_EXT_shader_explicit_arithmetic_types: enable int64_t func(int8_t a, int16_t b, int16_t c) { diff --git a/deps/glslang/Test/hlsl.earlydepthstencil.frag b/deps/glslang/Test/hlsl.earlydepthstencil.frag new file mode 100644 index 00000000..268baaec --- /dev/null +++ b/deps/glslang/Test/hlsl.earlydepthstencil.frag @@ -0,0 +1,12 @@ +RWTexture2D Values; + +struct InputStruct { + float4 Position : SV_POSITION; +}; + +[earlydepthstencil] +uint main(InputStruct input) : SV_Target { + uint oldVal; + InterlockedExchange(Values[uint2(input.Position.x, input.Position.y)], 1.0, oldVal); + return oldVal; +} diff --git a/deps/glslang/Test/hlsl.int.dot.frag b/deps/glslang/Test/hlsl.int.dot.frag new file mode 100644 index 00000000..c293dc14 --- /dev/null +++ b/deps/glslang/Test/hlsl.int.dot.frag @@ -0,0 +1,14 @@ +float4 main() : SV_Target { + int i = 1; + int1 i2 = 2; + int2 i3 = 3; + int3 i4 = 4; + int4 i5 = 5; + + i = dot(i, i); + i2 = dot(i2, i2); + i3 = dot(i3, i3); + i4 = dot(i4, i4); + i5 = dot(i5, i5); + return i + i2.xxxx + i3.xyxy + i4.xyzx + i5; +} \ No newline at end of file diff --git a/deps/glslang/Test/hlsl.pp.line2.frag b/deps/glslang/Test/hlsl.pp.line2.frag new file mode 100644 index 00000000..2d16db21 --- /dev/null +++ b/deps/glslang/Test/hlsl.pp.line2.frag @@ -0,0 +1,40 @@ +#line 1 "foo.frag" +Texture2D g_tColor[ 128 ] ; + +layout (push_constant) cbuffer PerViewConstantBuffer_t +{ + uint g_nDataIdx; + uint g_nDataIdx2; + bool g_B; +} ; + +SamplerState g_sAniso; + +struct PS_INPUT +{ + float2 vTextureCoords : TEXCOORD2 ; +} ; + +struct PS_OUTPUT +{ + float4 vColor : SV_Target0 ; +} ; + +PS_OUTPUT MainPs ( PS_INPUT i ) +{ + PS_OUTPUT ps_output ; + + uint u; +#line 47 + if (g_B) +#line 3 "foo.h" + u = g_nDataIdx; + else +#line 67 + u = g_nDataIdx2; +#line 7 "foo2.h" + ps_output . vColor = g_tColor [ u ] . Sample ( g_sAniso , i . vTextureCoords . xy ); +#line 105 + return ps_output ; +} + diff --git a/deps/glslang/Test/hlsl.pp.line3.frag b/deps/glslang/Test/hlsl.pp.line3.frag new file mode 100644 index 00000000..7d85630f --- /dev/null +++ b/deps/glslang/Test/hlsl.pp.line3.frag @@ -0,0 +1,34 @@ +Texture2D g_tColor[ 128 ] ; + +layout (push_constant) cbuffer PerViewConstantBuffer_t +{ + uint g_nDataIdx; + uint g_nDataIdx2; + bool g_B; +} ; + +SamplerState g_sAniso; + +struct PS_INPUT +{ + float2 vTextureCoords : TEXCOORD2 ; +} ; + +struct PS_OUTPUT +{ + float4 vColor : SV_Target0 ; +} ; + +PS_OUTPUT MainPs ( PS_INPUT i ) +{ + PS_OUTPUT ps_output ; + + uint u; + if (g_B) +#include "i1.h" + else + u = g_nDataIdx2; + ps_output . vColor = g_tColor [ u ] . Sample ( g_sAniso , i . vTextureCoords . xy ); + return ps_output ; +} + diff --git a/deps/glslang/Test/hlsl.pp.line4.frag b/deps/glslang/Test/hlsl.pp.line4.frag new file mode 100644 index 00000000..c64879f0 --- /dev/null +++ b/deps/glslang/Test/hlsl.pp.line4.frag @@ -0,0 +1,42 @@ +#line 1 "C:\\Users\\Greg\\shaders\\line\\foo4.frag" +Texture2D g_tColor [ 128 ] ; + +layout ( push_constant ) cbuffer PerViewConstantBuffer_t +{ + uint g_nDataIdx ; + uint g_nDataIdx2 ; + bool g_B ; +} ; + +#line 12 +SamplerState g_sAniso ; + +struct PS_INPUT +{ + float2 vTextureCoords : TEXCOORD2 ; +} ; + +struct PS_OUTPUT +{ + float4 vColor : SV_Target0 ; +} ; + +PS_OUTPUT MainPs ( PS_INPUT i ) +{ + PS_OUTPUT ps_output ; + + uint u ; + if ( g_B ) + + +#line 1 "C:\\Users\\Greg\\shaders\\line\\u1.h" + u = g_nDataIdx ; + + +#line 31 "C:\\Users\\Greg\\shaders\\line\\foo4.frag" + else + u = g_nDataIdx2 ; + ps_output . vColor = g_tColor [ u ] . Sample ( g_sAniso , i . vTextureCoords . xy ) ; + return ps_output ; +} + diff --git a/deps/glslang/Test/hlsl.sample.dx9.frag b/deps/glslang/Test/hlsl.sample.dx9.frag new file mode 100644 index 00000000..26094193 --- /dev/null +++ b/deps/glslang/Test/hlsl.sample.dx9.frag @@ -0,0 +1,36 @@ + +sampler g_sam : register(t0); +sampler1D g_sam1D : register(t1); +sampler2D g_sam2D : register(t2); +sampler3D g_sam3D : register(t3); +samplerCube g_samCube : register(t4); + +struct PS_OUTPUT +{ + float4 Color : SV_Target0; + float Depth : SV_Depth; +}; + +PS_OUTPUT main() +{ + PS_OUTPUT psout; + + float4 ColorOut = float4(0,0,0,0); + + ColorOut += tex2D( g_sam , float2(0.4,0.3)); + ColorOut += tex1D( g_sam1D, 0.5); + ColorOut += tex2D( g_sam2D, float2(0.5,0.6)); + ColorOut += tex3D( g_sam3D, float3(0.5,0.6,0.4)); + ColorOut += texCUBE( g_samCube, float3(0.5,0.6,0.4)); + + ColorOut += tex2Dlod( g_sam , float4(0.4,0.3,0.0,0.0)); + ColorOut += tex1Dlod( g_sam1D, float4(0.5,0.0,0.0,0.0)); + ColorOut += tex2Dlod( g_sam2D, float4(0.5,0.6,0.0,0.0)); + ColorOut += tex3Dlod( g_sam3D, float4(0.5,0.6,0.4,0.0)); + ColorOut += texCUBElod( g_samCube, float4(0.5,0.6,0.4,0.0)); + + psout.Color = ColorOut / 10.0f; + psout.Depth = 1.0; + + return psout; +} diff --git a/deps/glslang/Test/hlsl.sample.dx9.vert b/deps/glslang/Test/hlsl.sample.dx9.vert new file mode 100644 index 00000000..82d52b16 --- /dev/null +++ b/deps/glslang/Test/hlsl.sample.dx9.vert @@ -0,0 +1,22 @@ + +sampler g_sam : register(t0); +sampler2D g_sam2D : register(t1); + +struct VS_OUTPUT +{ + float4 Pos : SV_Position; +}; + +VS_OUTPUT main() +{ + VS_OUTPUT vsout; + + float4 PosOut = float4(0,0,0,0); + + PosOut += tex2Dlod( g_sam , float4(0.3f, 0.4f, 0.0f, 1.0f)); + PosOut += tex2Dlod( g_sam2D, float4(0.5f, 0.6f, 0.0f, 1.0f)); + + vsout.Pos = PosOut / 2.0f; + + return vsout; +} diff --git a/deps/glslang/Test/i1.h b/deps/glslang/Test/i1.h new file mode 100644 index 00000000..e068ff70 --- /dev/null +++ b/deps/glslang/Test/i1.h @@ -0,0 +1 @@ + u = g_nDataIdx; diff --git a/deps/glslang/Test/reflection.vert b/deps/glslang/Test/reflection.vert index 7549f081..9b3b45c9 100644 --- a/deps/glslang/Test/reflection.vert +++ b/deps/glslang/Test/reflection.vert @@ -60,6 +60,14 @@ layout(std140) uniform nested { N3 foo; } nest; +layout(std140) uniform nested2 { + vec4 padding; // offset 0, size 16 + N3 a; // offset 16, size 32 + N1 b[4]; // offset 48, size 64 + N1 c[2]; // offset 112, size 32 + N1 d[4]; // offset 144, size 64 +} nest2; + struct TS { int a; int dead; @@ -203,4 +211,9 @@ void main() f += buf2i.runtimeArray[3].c; f += buf3i.runtimeArray[gl_InstanceID]; f += buf4i.runtimeArray[gl_InstanceID].c; + + N3 n = nest2.a; + N1 b[4] = nest2.b; + f += nest2.c[1].a; + f += nest2.d[gl_InstanceID].a; } diff --git a/deps/glslang/Test/remap.invalid-spirv-1.spv b/deps/glslang/Test/remap.invalid-spirv-1.spv index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..e5d59d4fbf88b8ea5f91a9fa540e3d9f38c5a82c 100644 GIT binary patch literal 219 zcmYk0OA3H65JS_SwJrn^441$TK5|A=@-xEQ^YldvnR=lB;NVcjxN|XPd?E2+ed1G1t5qqnv?q4*)||5V KKa1boT3HXnG78-Q literal 0 HcmV?d00001 diff --git a/deps/glslang/Test/remap.invalid-spirv-2.spv b/deps/glslang/Test/remap.invalid-spirv-2.spv index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..df8c96d8aa1578b7496475a0dd855f03b88a209c 100644 GIT binary patch literal 212 zcmYj~OA3H65JTg)>Ov6l1TNi+OYeUn6%ovniUy|5yqUCFItC?)q@czp>XZu7Dtmf- zAK9SXPFh_|nN2DlmfOFY&6pJtu)BM!^u0M5B0p98MSlNO*^))IiyZ9m%^p4c-@`Ab G7S|1^mI}K7 literal 0 HcmV?d00001 diff --git a/deps/glslang/Test/remap.literal64.everything.spv b/deps/glslang/Test/remap.literal64.everything.spv index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..88103c4948834f038fa16ed1d6a290bc1d812b50 100644 GIT binary patch literal 220 zcmYk0%?g7s5QHc3C&q&y;scZ(dzT*j{x8&u6gpps*o94Iznuwb;yoz@NlBwmYE~3v zQd4I1QrW83N_x5BH+yiQAL`1kwLWVzW7k!H_hVP@`|V_^{80AG{Nk#?k}Q?oHY!5@Cx7n literal 0 HcmV?d00001 diff --git a/deps/glslang/Test/remap.literal64.none.spv b/deps/glslang/Test/remap.literal64.none.spv index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..88103c4948834f038fa16ed1d6a290bc1d812b50 100644 GIT binary patch literal 220 zcmYk0%?g7s5QHc3C&q&y;scZ(dzT*j{x8&u6gpps*o94Iznuwb;yoz@NlBwmYE~3v zQd4I1QrW83N_x5BH+yiQAL`1kwLWVzW7k!H_hVP@`|V_^{80AG{Nk#?k}Q?oHY!5@Cx7n literal 0 HcmV?d00001 diff --git a/deps/glslang/Test/runtests b/deps/glslang/Test/runtests index 8cc8b7a8..c88cb590 100644 --- a/deps/glslang/Test/runtests +++ b/deps/glslang/Test/runtests @@ -152,6 +152,8 @@ $EXE -l -i include.vert > $TARGETDIR/include.vert.out diff -b $BASEDIR/include.vert.out $TARGETDIR/include.vert.out || HASERROR=1 $EXE -D -Od -e main -H -Od -Iinc1/path1 -Iinc1/path2 hlsl.dashI.vert > $TARGETDIR/hlsl.dashI.vert.out diff -b $BASEDIR/hlsl.dashI.vert.out $TARGETDIR/hlsl.dashI.vert.out || HASERROR=1 +$EXE -D -Od -e MainPs -H -Od -g hlsl.pp.line3.frag > $TARGETDIR/hlsl.pp.line3.frag.out +diff -b $BASEDIR/hlsl.pp.line3.frag.out $TARGETDIR/hlsl.pp.line3.frag.out || HASERROR=1 # # Testing -D and -U diff --git a/deps/glslang/Test/spv.16bitxfb.vert b/deps/glslang/Test/spv.16bitxfb.vert new file mode 100644 index 00000000..f9719436 --- /dev/null +++ b/deps/glslang/Test/spv.16bitxfb.vert @@ -0,0 +1,33 @@ +#version 450 core + +#extension GL_AMD_gpu_shader_half_float: enable +#extension GL_AMD_gpu_shader_int16: enable + +layout(location = 0) in f16vec4 if16v4; +layout(location = 1) in i16vec4 ii16v4; +layout(location = 2) in u16vec4 iu16v4; + +layout(location = 0, xfb_buffer = 0, xfb_stride = 6, xfb_offset = 0) out f16vec3 of16v3; +layout(location = 1, xfb_buffer = 1, xfb_stride = 6, xfb_offset = 0) out F16Out +{ + float16_t of16; + f16vec2 of16v2; +}; + +layout(location = 5, xfb_buffer = 2, xfb_stride = 6, xfb_offset = 0) out i16vec3 oi16v3; +layout(location = 6, xfb_buffer = 3, xfb_stride = 6, xfb_offset = 0) out I16Out +{ + uint16_t ou16; + u16vec2 ou16v2; +}; + +void main() +{ + of16v3 = if16v4.xyz; + of16 = if16v4.x; + of16v2 = if16v4.xy; + + oi16v3 = ii16v4.xyz; + ou16 = iu16v4.x; + ou16v2 = iu16v4.xy; +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.RayGenShader.rgen b/deps/glslang/Test/spv.RayGenShader.rgen index 68f92b22..c36cae46 100644 --- a/deps/glslang/Test/spv.RayGenShader.rgen +++ b/deps/glslang/Test/spv.RayGenShader.rgen @@ -1,6 +1,7 @@ #version 460 #extension GL_NV_ray_tracing : enable -layout(binding = 0, set = 0) uniform accelerationStructureNV accNV; +layout(binding = 0, set = 0) uniform accelerationStructureNV accNV0; +layout(binding = 1, set = 0) uniform accelerationStructureNV accNV1; // Unused layout(location = 0) rayPayloadNV vec4 payload; layout(shaderRecordNV) buffer block { @@ -13,7 +14,7 @@ void main() uint ly = gl_LaunchIDNV.y; uint sx = gl_LaunchSizeNV.x; uint sy = gl_LaunchSizeNV.y; - traceNV(accNV, lx, ly, sx, sy, 0u, vec3(0.0f), 0.5f, vec3(1.0f), 0.75f, 1); + traceNV(accNV0, lx, ly, sx, sy, 0u, vec3(0.0f), 0.5f, vec3(1.0f), 0.75f, 1); arr[3] = 1.0f; pad = payload; } diff --git a/deps/glslang/Test/spv.RayGenShader11.rgen b/deps/glslang/Test/spv.RayGenShader11.rgen new file mode 100644 index 00000000..68f92b22 --- /dev/null +++ b/deps/glslang/Test/spv.RayGenShader11.rgen @@ -0,0 +1,19 @@ +#version 460 +#extension GL_NV_ray_tracing : enable +layout(binding = 0, set = 0) uniform accelerationStructureNV accNV; +layout(location = 0) rayPayloadNV vec4 payload; +layout(shaderRecordNV) buffer block +{ + float arr[4]; + vec4 pad; +}; +void main() +{ + uint lx = gl_LaunchIDNV.x; + uint ly = gl_LaunchIDNV.y; + uint sx = gl_LaunchSizeNV.x; + uint sy = gl_LaunchSizeNV.y; + traceNV(accNV, lx, ly, sx, sy, 0u, vec3(0.0f), 0.5f, vec3(1.0f), 0.75f, 1); + arr[3] = 1.0f; + pad = payload; +} diff --git a/deps/glslang/Test/spv.bufferhandle1.frag b/deps/glslang/Test/spv.bufferhandle1.frag new file mode 100644 index 00000000..14acac19 --- /dev/null +++ b/deps/glslang/Test/spv.bufferhandle1.frag @@ -0,0 +1,28 @@ +#version 450 + +#extension GL_EXT_buffer_reference : enable +#pragma use_vulkan_memory_model + +layout(buffer_reference, std430) buffer blockType { + layout(offset = 0) int a; + layout(offset = 4) int b; + layout(offset = 8) int c; + layout(offset = 12) int d; + layout(offset = 16) int e; + layout(offset = 32) int f[2]; + coherent layout(offset = 48) ivec4 g; +}; + +layout(std430) buffer t2 { + blockType f; + blockType g; +} t; + +void main() { + t.f.b = t.g.a; + + blockType j = t.f; + j.d = j.c; + j.d = j.f[1]; + j.d = j.g.y; +} diff --git a/deps/glslang/Test/spv.bufferhandle10.frag b/deps/glslang/Test/spv.bufferhandle10.frag new file mode 100644 index 00000000..1d537e42 --- /dev/null +++ b/deps/glslang/Test/spv.bufferhandle10.frag @@ -0,0 +1,23 @@ +#version 450 + +#extension GL_ARB_gpu_shader_int64 : enable +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference, std430) buffer blockType { + uint x[]; +}; + +layout(std430) buffer t2 { + blockType f; +} t; + +layout(location = 0) flat in uint i; + +void main() { + + atomicAdd(t.f.x[i], 1); + + coherent blockType b = t.f; + b.x[0] = 2; + +} diff --git a/deps/glslang/Test/spv.bufferhandle11.frag b/deps/glslang/Test/spv.bufferhandle11.frag new file mode 100644 index 00000000..14d05dcc --- /dev/null +++ b/deps/glslang/Test/spv.bufferhandle11.frag @@ -0,0 +1,26 @@ +#version 450 +#extension GL_EXT_shader_16bit_storage : enable +#extension GL_EXT_shader_8bit_storage : enable +#extension GL_EXT_buffer_reference : enable + +layout(std140, binding = 0) buffer AcBlock { highp uint ac_numPassed; }; + +layout(std140, buffer_reference) buffer Block +{ + uint8_t var; +}; +layout (push_constant, std430) uniform PC { + Block block; +}; + +bool compare_uint8_t (highp uint a, highp uint b) { return a == b; } + +void main (void) +{ + bool allOk = true; + allOk = allOk && compare_uint8_t(uint(block.var), 7u); + if (allOk) + ac_numPassed++; + + block.var = uint8_t(9u); +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.bufferhandle12.frag b/deps/glslang/Test/spv.bufferhandle12.frag new file mode 100644 index 00000000..cb7ec6ad --- /dev/null +++ b/deps/glslang/Test/spv.bufferhandle12.frag @@ -0,0 +1,42 @@ +#version 450 +#extension GL_EXT_shader_16bit_storage : enable +#extension GL_EXT_shader_8bit_storage : enable +#extension GL_EXT_buffer_reference : enable + +layout(std140, binding = 0) buffer AcBlock { highp uint ac_numPassed; }; + +layout(std430, column_major, buffer_reference) buffer BlockB +{ + float16_t a; + highp ivec2 b; +}; +layout(std430, buffer_reference) buffer BlockC +{ + mediump mat2x3 c; +}; +layout(std430, row_major, buffer_reference) buffer BlockD +{ + lowp uvec3 d; +}; +layout (push_constant, std430) uniform PC { + BlockB blockB; + BlockC blockC; + BlockD blockD; +}; + +bool compare_float (highp float a, highp float b) { return abs(a - b) < 0.05; } +bool compare_vec3 (highp vec3 a, highp vec3 b) { return compare_float(a.x, b.x)&&compare_float(a.y, b.y)&&compare_float(a.z, b.z); } +bool compare_mat2x3 (highp mat2x3 a, highp mat2x3 b){ return compare_vec3(a[0], b[0])&&compare_vec3(a[1], b[1]); } +bool compare_ivec2 (highp ivec2 a, highp ivec2 b) { return a == b; } +bool compare_uvec3 (highp uvec3 a, highp uvec3 b) { return a == b; } +bool compare_float16_t(highp float a, highp float b) { return abs(a - b) < 0.05; } + +void main (void) +{ + bool allOk = true; + allOk = allOk && compare_mat2x3(blockC.c, mat2x3(-5.0, 1.0, -7.0, 1.0, 2.0, 8.0)); + if (allOk) + ac_numPassed++; + + blockD.d = (uvec3(8u, 1u, 5u)); +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.bufferhandle13.frag b/deps/glslang/Test/spv.bufferhandle13.frag new file mode 100644 index 00000000..1538d90b --- /dev/null +++ b/deps/glslang/Test/spv.bufferhandle13.frag @@ -0,0 +1,30 @@ +#version 450 + +#extension GL_EXT_buffer_reference : enable + +layout(set = 1, binding = 2, buffer_reference, std430) buffer t4 { + layout(offset = 0) int j; +}; + +layout(std430) buffer t5 { + t4 m; +} s5; + +t4 f1(const t4 y) { return y; } +t4 f2(t4 y) { return y; } +t4 f3(const restrict t4 y) { return y; } +t4 f4(restrict t4 y) { return y; } + +t4 g1; +restrict t4 g2; + +void main() +{ + t4 a = s5.m; + restrict t4 b = s5.m; + + f1(a); + f2(a); + f3(a); + f4(a); +} diff --git a/deps/glslang/Test/spv.bufferhandle14.frag b/deps/glslang/Test/spv.bufferhandle14.frag new file mode 100644 index 00000000..132af69f --- /dev/null +++ b/deps/glslang/Test/spv.bufferhandle14.frag @@ -0,0 +1,40 @@ +#version 450 + +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference, std430, buffer_reference_align = 4) buffer T1 { + int i; + int j; + int k; +}; + +layout(buffer_reference, std430, buffer_reference_align = 8) buffer T2 { + int i; + int j; + int k; +}; + +layout(buffer_reference, std430) buffer T3 { + int i; + int j; + int k; +}; + +layout(buffer_reference, std430, buffer_reference_align = 32) buffer T4 { + int i; + int j; + int k; +}; + +void main() +{ + T1 t1; + T2 t2; + T3 t3; + T4 t4; + + t1.i = t1.k; + t2.i = t2.k; + t3.i = t3.k; + t4.i = t4.k; +} diff --git a/deps/glslang/Test/spv.bufferhandle15.frag b/deps/glslang/Test/spv.bufferhandle15.frag new file mode 100644 index 00000000..ca645937 --- /dev/null +++ b/deps/glslang/Test/spv.bufferhandle15.frag @@ -0,0 +1,38 @@ +#version 450 + +#extension GL_EXT_buffer_reference : enable +#extension GL_EXT_scalar_block_layout : enable + +layout(buffer_reference, scalar) buffer T1 { + vec3 x[]; +}; + +layout(buffer_reference, scalar) buffer T2 { + vec3 x[][4][2]; +}; + +struct S +{ + highp ivec3 a; + mediump mat3 b[4]; + highp vec4 c; +}; + +layout(buffer_reference, scalar) buffer T3 { + S s; +}; +layout(std430) buffer T4 { + T1 t1; + T2 t2; + T3 t3; +} t4; + +layout(location = 0) flat in int i; + +void main() +{ + vec3 y; + y = t4.t1.x[i]; + y = t4.t2.x[i][i][i]; + mat3 z = t4.t3.s.b[0]; +} diff --git a/deps/glslang/Test/spv.bufferhandle2.frag b/deps/glslang/Test/spv.bufferhandle2.frag new file mode 100644 index 00000000..497e5509 --- /dev/null +++ b/deps/glslang/Test/spv.bufferhandle2.frag @@ -0,0 +1,25 @@ +#version 450 + +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference, std430) buffer blockType { + layout(offset = 0) int a; + layout(offset = 4) int b; + layout(offset = 8) int c; + layout(offset = 12) int d; + layout(offset = 16) int e; +}; + +layout(std430) buffer t2 { + blockType f; + blockType g; +} t; + +void main() { + + blockType b1[2] = blockType[2](t.f, t.g); + b1[0].a = b1[1].b; + blockType b2 = t.f; + blockType b3 = t.g; + b2.a = b3.b; +} diff --git a/deps/glslang/Test/spv.bufferhandle3.frag b/deps/glslang/Test/spv.bufferhandle3.frag new file mode 100644 index 00000000..6dddf20b --- /dev/null +++ b/deps/glslang/Test/spv.bufferhandle3.frag @@ -0,0 +1,25 @@ +#version 450 + +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference, std430) buffer t3 { + int h; +}; + +layout(set = 1, binding = 2, buffer_reference, std430) buffer t4 { + layout(offset = 0) int j; + t3 k; +} x; + +layout(std430) buffer t5 { + t4 m; +} s5; + +flat in t4 k; + +t4 foo(t4 y) { return y; } + +void main() { + foo(s5.m).j = s5.m.k.h; + x.j = k.k.h; +} diff --git a/deps/glslang/Test/spv.bufferhandle4.frag b/deps/glslang/Test/spv.bufferhandle4.frag new file mode 100644 index 00000000..16a02cbf --- /dev/null +++ b/deps/glslang/Test/spv.bufferhandle4.frag @@ -0,0 +1,26 @@ +#version 450 + +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference) buffer t4; + +layout(buffer_reference, std430) buffer t3 { + int h; + t4 i; +}; + +layout(set = 1, binding = 2, buffer_reference, std430) buffer t4 { + layout(offset = 0) int j; + t3 k; +} x; + +layout(std430) buffer t5 { + t4 m; +} s5; + +void main() { + x.k.h = s5.m.k.i.k.i.k.h; + + bool b = true; + s5.m = b ? s5.m : s5.m.k.i; +} diff --git a/deps/glslang/Test/spv.bufferhandle5.frag b/deps/glslang/Test/spv.bufferhandle5.frag new file mode 100644 index 00000000..6ad51881 --- /dev/null +++ b/deps/glslang/Test/spv.bufferhandle5.frag @@ -0,0 +1,16 @@ +#version 450 + +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference, std140) buffer t3 { + int h; +}; + +layout(set = 1, binding = 2, std140) uniform t4 { + layout(offset = 0) int j; + t3 k; +} x; + +void main() { + x.k.h = x.j; +} diff --git a/deps/glslang/Test/spv.bufferhandle6.frag b/deps/glslang/Test/spv.bufferhandle6.frag new file mode 100644 index 00000000..dcc30d00 --- /dev/null +++ b/deps/glslang/Test/spv.bufferhandle6.frag @@ -0,0 +1,30 @@ +#version 450 core + +#extension GL_EXT_buffer_reference : enable +layout (push_constant, std430) uniform Block { int identity[32]; } pc; +layout(r32ui, set = 3, binding = 0) uniform uimage2D image0_0; +layout(buffer_reference) buffer T1; +layout(set = 3, binding = 1, buffer_reference) buffer T1 { + layout(offset = 0) int a[2]; // stride = 4 for std430, 16 for std140 + layout(offset = 32) int b; + layout(offset = 48) T1 c[2]; // stride = 8 for std430, 16 for std140 + layout(offset = 80) T1 d; +} x; +void main() +{ + int accum = 0, temp; + accum |= x.a[0] - 0; + accum |= x.a[pc.identity[1]] - 1; + accum |= x.b - 2; + accum |= x.c[0].a[0] - 3; + accum |= x.c[0].a[pc.identity[1]] - 4; + accum |= x.c[0].b - 5; + accum |= x.c[pc.identity[1]].a[0] - 6; + accum |= x.c[pc.identity[1]].a[pc.identity[1]] - 7; + accum |= x.c[pc.identity[1]].b - 8; + accum |= x.d.a[0] - 9; + accum |= x.d.a[pc.identity[1]] - 10; + accum |= x.d.b - 11; + uvec4 color = (accum != 0) ? uvec4(0,0,0,0) : uvec4(1,0,0,1); + imageStore(image0_0, ivec2(gl_FragCoord.x, gl_FragCoord.y), color); +} \ No newline at end of file diff --git a/deps/glslang/Test/spv.bufferhandle7.frag b/deps/glslang/Test/spv.bufferhandle7.frag new file mode 100644 index 00000000..dbc9b2f1 --- /dev/null +++ b/deps/glslang/Test/spv.bufferhandle7.frag @@ -0,0 +1,24 @@ +#version 450 + +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference, std430) buffer blockType { + layout(offset = 0) int a; + layout(offset = 4) int b; + layout(offset = 8) int c; + layout(offset = 12) int d; + layout(offset = 16) int e; +}; + +layout(std430, buffer_reference) buffer t2 { + blockType f; + blockType g; +} t; + +layout(std430) buffer t3 { + t2 f; +} u; + +void main() { + t.f = blockType(u.f); +} diff --git a/deps/glslang/Test/spv.bufferhandle8.frag b/deps/glslang/Test/spv.bufferhandle8.frag new file mode 100644 index 00000000..1bc13c3c --- /dev/null +++ b/deps/glslang/Test/spv.bufferhandle8.frag @@ -0,0 +1,32 @@ +#version 450 + +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference, std430) buffer blockType { + layout(offset = 0) int a; + layout(offset = 4) int b; + layout(offset = 8) int c; + layout(offset = 12) int d; + layout(offset = 16) int e; +}; + +layout(std430) buffer t2 { + blockType f; + blockType g; +} t; + +layout(std430, buffer_reference) buffer T2 { int x; }; +layout(std430, buffer_reference) buffer T1 { int x; }; + +struct Blah { + T1 t1; + T2 t2; +}; + +layout(set=0, binding=0) buffer T3 { + Blah Bindings[]; +} t3; + +void main() { + t3.Bindings[0] = t3.Bindings[1]; +} diff --git a/deps/glslang/Test/spv.bufferhandle9.frag b/deps/glslang/Test/spv.bufferhandle9.frag new file mode 100644 index 00000000..7c9f6085 --- /dev/null +++ b/deps/glslang/Test/spv.bufferhandle9.frag @@ -0,0 +1,30 @@ +#version 450 + +#extension GL_ARB_gpu_shader_int64 : enable +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference, std430) buffer blockType { + layout(offset = 0) int a; + layout(offset = 4) int b; + layout(offset = 8) int c; + layout(offset = 12) int d; + layout(offset = 16) int e; +}; + +layout(std430) buffer t2 { + blockType f; + blockType g; +} t; + +flat in uint64_t h, i; + +void main() { + + blockType b1[2] = blockType[2](blockType(h), blockType(i)); + b1[0].a = b1[1].b; + blockType b2 = blockType(h); + blockType b3 = blockType(i); + b2.a = b3.b; + uint64_t j = uint64_t(b2); + b2 = blockType(j+256); +} diff --git a/deps/glslang/Test/spv.bufferhandle_Error.frag b/deps/glslang/Test/spv.bufferhandle_Error.frag new file mode 100644 index 00000000..98cbac86 --- /dev/null +++ b/deps/glslang/Test/spv.bufferhandle_Error.frag @@ -0,0 +1,45 @@ +#version 450 + +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference) buffer bufType1 { int x; }; +layout(buffer_reference) buffer bufType2 { int x; }; +layout(buffer_reference) uniform bufType3 { int x; }; + +layout(buffer_reference) buffer; +layout(buffer_reference) uniform; +layout(buffer_reference) in; +layout(buffer_reference) out; +layout(buffer_reference) in badin { float x; } badin2; +layout(buffer_reference) out badout { float x; } badout2; + +layout(buffer_reference) buffer bufType5; + +layout(buffer_reference) buffer bufType6 { int x[]; }; + +buffer bufType4 { + bufType1 b1; + bufType2 b2; + bufType3 b3; + bufType6 b6; +} b4; + +void f() +{ + bufType6 b; + b.x.length(); + b4.b6.x.length(); +} + +void main() { + bufType2 x1 = b4.b1; + bufType2 x2 = bufType2(b4.b1); + bufType2 x3 = bufType2(b4.b2); + bufType2 x4 = bufType2(b4.b3); + + b4.b1 = b4.b2; + b4.b1 = b4.b3; + b4.b3 = b4.b2; +} + +layout(buffer_reference) uniform bufType5 { int x; }; diff --git a/deps/glslang/Test/spv.explicittypes.frag b/deps/glslang/Test/spv.explicittypes.frag index 18c070a7..9941ea08 100644 --- a/deps/glslang/Test/spv.explicittypes.frag +++ b/deps/glslang/Test/spv.explicittypes.frag @@ -1,13 +1,13 @@ #version 450 -#extension GL_KHX_shader_explicit_arithmetic_types: enable -#extension GL_KHX_shader_explicit_arithmetic_types_int8: require -#extension GL_KHX_shader_explicit_arithmetic_types_int16: require -#extension GL_KHX_shader_explicit_arithmetic_types_int32: require -#extension GL_KHX_shader_explicit_arithmetic_types_int64: require -#extension GL_KHX_shader_explicit_arithmetic_types_float16: require -#extension GL_KHX_shader_explicit_arithmetic_types_float32: require -#extension GL_KHX_shader_explicit_arithmetic_types_float64: require +#extension GL_EXT_shader_explicit_arithmetic_types: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int8: require +#extension GL_EXT_shader_explicit_arithmetic_types_int16: require +#extension GL_EXT_shader_explicit_arithmetic_types_int32: require +#extension GL_EXT_shader_explicit_arithmetic_types_int64: require +#extension GL_EXT_shader_explicit_arithmetic_types_float16: require +#extension GL_EXT_shader_explicit_arithmetic_types_float32: require +#extension GL_EXT_shader_explicit_arithmetic_types_float64: require layout(binding = 0) uniform Uniforms { diff --git a/deps/glslang/Test/spv.float32.frag b/deps/glslang/Test/spv.float32.frag index 471f6b3b..f45dccd8 100644 --- a/deps/glslang/Test/spv.float32.frag +++ b/deps/glslang/Test/spv.float32.frag @@ -1,13 +1,13 @@ #version 450 -#extension GL_KHX_shader_explicit_arithmetic_types: enable -#extension GL_KHX_shader_explicit_arithmetic_types_int8: require -#extension GL_KHX_shader_explicit_arithmetic_types_int16: require -#extension GL_KHX_shader_explicit_arithmetic_types_int32: require -#extension GL_KHX_shader_explicit_arithmetic_types_int64: require -#extension GL_KHX_shader_explicit_arithmetic_types_float16: require -#extension GL_KHX_shader_explicit_arithmetic_types_float32: require -#extension GL_KHX_shader_explicit_arithmetic_types_float64: require +#extension GL_EXT_shader_explicit_arithmetic_types: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int8: require +#extension GL_EXT_shader_explicit_arithmetic_types_int16: require +#extension GL_EXT_shader_explicit_arithmetic_types_int32: require +#extension GL_EXT_shader_explicit_arithmetic_types_int64: require +#extension GL_EXT_shader_explicit_arithmetic_types_float16: require +#extension GL_EXT_shader_explicit_arithmetic_types_float32: require +#extension GL_EXT_shader_explicit_arithmetic_types_float64: require void main() { diff --git a/deps/glslang/Test/spv.float64.frag b/deps/glslang/Test/spv.float64.frag index efbec77d..faaac236 100644 --- a/deps/glslang/Test/spv.float64.frag +++ b/deps/glslang/Test/spv.float64.frag @@ -1,13 +1,13 @@ #version 450 -#extension GL_KHX_shader_explicit_arithmetic_types: enable -#extension GL_KHX_shader_explicit_arithmetic_types_int8: require -#extension GL_KHX_shader_explicit_arithmetic_types_int16: require -#extension GL_KHX_shader_explicit_arithmetic_types_int32: require -#extension GL_KHX_shader_explicit_arithmetic_types_int64: require -#extension GL_KHX_shader_explicit_arithmetic_types_float16: require -#extension GL_KHX_shader_explicit_arithmetic_types_float32: require -#extension GL_KHX_shader_explicit_arithmetic_types_float64: require +#extension GL_EXT_shader_explicit_arithmetic_types: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int8: require +#extension GL_EXT_shader_explicit_arithmetic_types_int16: require +#extension GL_EXT_shader_explicit_arithmetic_types_int32: require +#extension GL_EXT_shader_explicit_arithmetic_types_int64: require +#extension GL_EXT_shader_explicit_arithmetic_types_float16: require +#extension GL_EXT_shader_explicit_arithmetic_types_float32: require +#extension GL_EXT_shader_explicit_arithmetic_types_float64: require void main() { diff --git a/deps/glslang/Test/spv.fragmentDensity-es.frag b/deps/glslang/Test/spv.fragmentDensity-es.frag new file mode 100644 index 00000000..35fb96e7 --- /dev/null +++ b/deps/glslang/Test/spv.fragmentDensity-es.frag @@ -0,0 +1,11 @@ +#version 310 es + +#extension GL_EXT_fragment_invocation_density : require + +layout (location = 0) out highp ivec2 FragSize; +layout (location = 2) out highp int FragInvocationCount; + +void main () { + FragSize = gl_FragSizeEXT; + FragInvocationCount = gl_FragInvocationCountEXT; +} diff --git a/deps/glslang/Test/spv.fragmentDensity-neg.frag b/deps/glslang/Test/spv.fragmentDensity-neg.frag new file mode 100644 index 00000000..68e736cd --- /dev/null +++ b/deps/glslang/Test/spv.fragmentDensity-neg.frag @@ -0,0 +1,12 @@ +#version 450 + +//make sure the builtins don't exist if the extension isn't enabled. +//#extension GL_EXT_fragment_invocation_density : require + +layout (location = 0) out vec2 FragSize; +layout (location = 2) out int FragInvocationCount; + +void main () { + FragSize = gl_FragSizeEXT; + FragInvocationCount = gl_FragInvocationCountEXT; +} diff --git a/deps/glslang/Test/spv.fragmentDensity.frag b/deps/glslang/Test/spv.fragmentDensity.frag new file mode 100644 index 00000000..9b37ba4c --- /dev/null +++ b/deps/glslang/Test/spv.fragmentDensity.frag @@ -0,0 +1,11 @@ +#version 450 + +#extension GL_EXT_fragment_invocation_density : require + +layout (location = 0) out vec2 FragSize; +layout (location = 2) out int FragInvocationCount; + +void main () { + FragSize = gl_FragSizeEXT; + FragInvocationCount = gl_FragInvocationCountEXT; +} diff --git a/deps/glslang/Test/spv.fragmentDensity.vert b/deps/glslang/Test/spv.fragmentDensity.vert new file mode 100644 index 00000000..eaef72d7 --- /dev/null +++ b/deps/glslang/Test/spv.fragmentDensity.vert @@ -0,0 +1,12 @@ +#version 450 + +// try using a fragment-only extension in a vertex shader +#extension GL_EXT_fragment_invocation_density : require + +layout (location = 0) out uvec2 FragSize; +layout (location = 2) out int FragInvocationCount; + +void main () { + FragSize = gl_FragSizeEXT; + FragInvocationCount = gl_FragInvocationCountEXT; +} diff --git a/deps/glslang/Test/spv.int16.frag b/deps/glslang/Test/spv.int16.frag index d29894b8..2feff4f8 100644 --- a/deps/glslang/Test/spv.int16.frag +++ b/deps/glslang/Test/spv.int16.frag @@ -1,13 +1,13 @@ #version 450 -#extension GL_KHX_shader_explicit_arithmetic_types: enable -#extension GL_KHX_shader_explicit_arithmetic_types_int8: require -#extension GL_KHX_shader_explicit_arithmetic_types_int16: require -#extension GL_KHX_shader_explicit_arithmetic_types_int32: require -#extension GL_KHX_shader_explicit_arithmetic_types_int64: require -#extension GL_KHX_shader_explicit_arithmetic_types_float16: require -#extension GL_KHX_shader_explicit_arithmetic_types_float32: require -#extension GL_KHX_shader_explicit_arithmetic_types_float64: require +#extension GL_EXT_shader_explicit_arithmetic_types: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int8: require +#extension GL_EXT_shader_explicit_arithmetic_types_int16: require +#extension GL_EXT_shader_explicit_arithmetic_types_int32: require +#extension GL_EXT_shader_explicit_arithmetic_types_int64: require +#extension GL_EXT_shader_explicit_arithmetic_types_float16: require +#extension GL_EXT_shader_explicit_arithmetic_types_float32: require +#extension GL_EXT_shader_explicit_arithmetic_types_float64: require layout(binding = 0) uniform Uniforms { diff --git a/deps/glslang/Test/spv.int32.frag b/deps/glslang/Test/spv.int32.frag index 3a33c67c..0a39ecd4 100644 --- a/deps/glslang/Test/spv.int32.frag +++ b/deps/glslang/Test/spv.int32.frag @@ -1,13 +1,13 @@ #version 450 -#extension GL_KHX_shader_explicit_arithmetic_types: enable -#extension GL_KHX_shader_explicit_arithmetic_types_int8: require -#extension GL_KHX_shader_explicit_arithmetic_types_int16: require -#extension GL_KHX_shader_explicit_arithmetic_types_int32: require -#extension GL_KHX_shader_explicit_arithmetic_types_int64: require -#extension GL_KHX_shader_explicit_arithmetic_types_float16: require -#extension GL_KHX_shader_explicit_arithmetic_types_float32: require -#extension GL_KHX_shader_explicit_arithmetic_types_float64: require +#extension GL_EXT_shader_explicit_arithmetic_types: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int8: require +#extension GL_EXT_shader_explicit_arithmetic_types_int16: require +#extension GL_EXT_shader_explicit_arithmetic_types_int32: require +#extension GL_EXT_shader_explicit_arithmetic_types_int64: require +#extension GL_EXT_shader_explicit_arithmetic_types_float16: require +#extension GL_EXT_shader_explicit_arithmetic_types_float32: require +#extension GL_EXT_shader_explicit_arithmetic_types_float64: require layout(binding = 0) uniform Uniforms { diff --git a/deps/glslang/Test/spv.int64.frag b/deps/glslang/Test/spv.int64.frag index 4ec04cd8..5390fb75 100644 --- a/deps/glslang/Test/spv.int64.frag +++ b/deps/glslang/Test/spv.int64.frag @@ -1,7 +1,7 @@ #version 450 #extension GL_ARB_gpu_shader_int64: enable -#extension GL_KHX_shader_explicit_arithmetic_types_int64: require +#extension GL_EXT_shader_explicit_arithmetic_types_int64: require layout(binding = 0) uniform Uniforms { diff --git a/deps/glslang/Test/spv.int8.frag b/deps/glslang/Test/spv.int8.frag index f41c62f5..80702b75 100644 --- a/deps/glslang/Test/spv.int8.frag +++ b/deps/glslang/Test/spv.int8.frag @@ -1,13 +1,13 @@ #version 450 -#extension GL_KHX_shader_explicit_arithmetic_types: enable -#extension GL_KHX_shader_explicit_arithmetic_types_int8: require -#extension GL_KHX_shader_explicit_arithmetic_types_int16: require -#extension GL_KHX_shader_explicit_arithmetic_types_int32: require -#extension GL_KHX_shader_explicit_arithmetic_types_int64: require -#extension GL_KHX_shader_explicit_arithmetic_types_float16: require -#extension GL_KHX_shader_explicit_arithmetic_types_float32: require -#extension GL_KHX_shader_explicit_arithmetic_types_float64: require +#extension GL_EXT_shader_explicit_arithmetic_types: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int8: require +#extension GL_EXT_shader_explicit_arithmetic_types_int16: require +#extension GL_EXT_shader_explicit_arithmetic_types_int32: require +#extension GL_EXT_shader_explicit_arithmetic_types_int64: require +#extension GL_EXT_shader_explicit_arithmetic_types_float16: require +#extension GL_EXT_shader_explicit_arithmetic_types_float32: require +#extension GL_EXT_shader_explicit_arithmetic_types_float64: require layout(binding = 0) uniform Uniforms { diff --git a/deps/glslang/Test/spv.meshTaskShader.task b/deps/glslang/Test/spv.meshTaskShader.task index c12b3bdd..ff94e6db 100644 --- a/deps/glslang/Test/spv.meshTaskShader.task +++ b/deps/glslang/Test/spv.meshTaskShader.task @@ -1,5 +1,7 @@ #version 450 +#define MAX_VIEWS gl_MaxMeshViewCountNV + #define BARRIER() \ memoryBarrierShared(); \ barrier(); @@ -19,12 +21,14 @@ shared vec4 mem[10]; taskNV out Task { vec2 dummy; vec2 submesh[3]; + uint viewID; } mytask; void main() { uint iid = gl_LocalInvocationID.x; uint gid = gl_WorkGroupID.x; + uint viewID = gl_MeshViewIndicesNV[gl_MeshViewCountNV%MAX_VIEWS]; // 1. shared memory load and stores for (uint i = 0; i < 10; ++i) { @@ -41,6 +45,7 @@ void main() mytask.submesh[0] = vec2(32.0, 33.0); mytask.submesh[1] = vec2(34.0, 35.0); mytask.submesh[2] = mytask.submesh[gid%2]; + mytask.viewID = viewID; BARRIER(); diff --git a/deps/glslang/Test/spv.pp.line.frag b/deps/glslang/Test/spv.pp.line.frag new file mode 100644 index 00000000..464463c3 --- /dev/null +++ b/deps/glslang/Test/spv.pp.line.frag @@ -0,0 +1,25 @@ +#version 140 + +uniform sampler1D texSampler1D; +uniform sampler2D texSampler2D; + +varying float blend; +varying vec4 u; + +in vec2 coords2D; + +void main() +{ + float blendscale = 1.789; + float bias = 2.0; + float coords1D = 1.789; + vec4 color = vec4(0.0, 0.0, 0.0, 0.0); +#line 53 + color += texture (texSampler1D, coords1D); + color += texture (texSampler1D, coords1D, bias); +#line 102 + color += texture (texSampler2D, coords2D); + color += texture (texSampler2D, coords2D, bias); + + gl_FragColor = mix(color, u, blend * blendscale); +} diff --git a/deps/glslang/Test/spv.scalarlayout.frag b/deps/glslang/Test/spv.scalarlayout.frag new file mode 100644 index 00000000..c7ecf502 --- /dev/null +++ b/deps/glslang/Test/spv.scalarlayout.frag @@ -0,0 +1,32 @@ +#version 450 core + +#extension GL_EXT_scalar_block_layout : enable + +// Block memory layout +struct S +{ + float a; // offset 0 + vec2 b; // offset 4 + double c; // offset 16 + float d; // offset 24 + vec3 e; // offset 28 + float f; // offset 40 + // size = 44, align = 8 +}; + +layout(column_major, scalar) uniform B1 +{ + float a; // offset = 0 + vec2 b; // offset = 4 + vec3 c; // offset = 12 + float d[2]; // offset = 24 + mat2x3 e; // offset = 32, takes 24 bytes, matrixstride = 12 + mat2x3 f[2]; // offset = 56, takes 48 bytes, matrixstride = 12, arraystride = 24 + float g; // offset = 104 + S h; // offset = 112 (aligned to multiple of 8) + S i[2]; // offset = 160 (aligned to multiple of 8) stride = 48 +}; + +void main() +{ +} diff --git a/deps/glslang/Test/spv.scalarlayoutfloat16.frag b/deps/glslang/Test/spv.scalarlayoutfloat16.frag new file mode 100644 index 00000000..ff870973 --- /dev/null +++ b/deps/glslang/Test/spv.scalarlayoutfloat16.frag @@ -0,0 +1,31 @@ +#version 450 core + +#extension GL_EXT_shader_16bit_storage: enable +#extension GL_EXT_scalar_block_layout : enable + +// Block memory layout +struct S +{ + float16_t a; // offset 0 + f16vec2 b; // offset 2 + double c; // offset 8 + float16_t d; // offset 16 + f16vec3 e; // offset 18 + float16_t f; // offset 24 + // size = 26, align = 8 +}; + +layout(column_major, scalar) uniform B1 +{ + float16_t a; // offset = 0 + f16vec2 b; // offset = 2 + f16vec3 c; // offset = 6 + float16_t d[2]; // offset = 12 stride = 2 + float16_t g; // offset = 16 + S h; // offset = 24 (aligned to multiple of 8) + S i[2]; // offset = 56 (aligned to multiple of 8) stride = 32 +}; + +void main() +{ +} diff --git a/deps/glslang/Test/spv.subgroupBallot.comp b/deps/glslang/Test/spv.subgroupBallot.comp index 2875468c..bb9dc3e4 100644 --- a/deps/glslang/Test/spv.subgroupBallot.comp +++ b/deps/glslang/Test/spv.subgroupBallot.comp @@ -31,30 +31,30 @@ void main() if ((relMask == result) && subgroupInverseBallot(data[0].u4)) { - data[invocation].f4.x = subgroupBroadcast(data[0].f4.x, invocation); - data[invocation].f4.xy = subgroupBroadcast(data[1].f4.xy, invocation); - data[invocation].f4.xyz = subgroupBroadcast(data[2].f4.xyz, invocation); - data[invocation].f4 = subgroupBroadcast(data[3].f4, invocation); - - data[invocation].i4.x = subgroupBroadcast(data[0].i4.x, invocation); - data[invocation].i4.xy = subgroupBroadcast(data[1].i4.xy, invocation); - data[invocation].i4.xyz = subgroupBroadcast(data[2].i4.xyz, invocation); - data[invocation].i4 = subgroupBroadcast(data[3].i4, invocation); - - data[invocation].u4.x = subgroupBroadcast(data[0].u4.x, invocation); - data[invocation].u4.xy = subgroupBroadcast(data[1].u4.xy, invocation); - data[invocation].u4.xyz = subgroupBroadcast(data[2].u4.xyz, invocation); - data[invocation].u4 = subgroupBroadcast(data[3].u4, invocation); - - data[invocation].d4.x = subgroupBroadcast(data[0].d4.x, invocation); - data[invocation].d4.xy = subgroupBroadcast(data[1].d4.xy, invocation); - data[invocation].d4.xyz = subgroupBroadcast(data[2].d4.xyz, invocation); - data[invocation].d4 = subgroupBroadcast(data[3].d4, invocation); - - data[invocation].i4.x = int(subgroupBroadcast(data[0].i4.x < 0, invocation)); - data[invocation].i4.xy = ivec2(subgroupBroadcast(lessThan(data[1].i4.xy, ivec2(0)), invocation)); - data[invocation].i4.xyz = ivec3(subgroupBroadcast(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); - data[invocation].i4 = ivec4(subgroupBroadcast(lessThan(data[1].i4, ivec4(0)), invocation)); + data[invocation].f4.x = subgroupBroadcast(data[0].f4.x, 3); + data[invocation].f4.xy = subgroupBroadcast(data[1].f4.xy, 3); + data[invocation].f4.xyz = subgroupBroadcast(data[2].f4.xyz, 3); + data[invocation].f4 = subgroupBroadcast(data[3].f4, 3); + + data[invocation].i4.x = subgroupBroadcast(data[0].i4.x, 2); + data[invocation].i4.xy = subgroupBroadcast(data[1].i4.xy, 2); + data[invocation].i4.xyz = subgroupBroadcast(data[2].i4.xyz, 2); + data[invocation].i4 = subgroupBroadcast(data[3].i4, 2); + + data[invocation].u4.x = subgroupBroadcast(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupBroadcast(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupBroadcast(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupBroadcast(data[3].u4, 1); + + data[invocation].d4.x = subgroupBroadcast(data[0].d4.x, 0); + data[invocation].d4.xy = subgroupBroadcast(data[1].d4.xy, 0); + data[invocation].d4.xyz = subgroupBroadcast(data[2].d4.xyz, 0); + data[invocation].d4 = subgroupBroadcast(data[3].d4, 0); + + data[invocation].i4.x = int(subgroupBroadcast(data[0].i4.x < 0, 1)); + data[invocation].i4.xy = ivec2(subgroupBroadcast(lessThan(data[1].i4.xy, ivec2(0)), 1)); + data[invocation].i4.xyz = ivec3(subgroupBroadcast(lessThan(data[1].i4.xyz, ivec3(0)), 1)); + data[invocation].i4 = ivec4(subgroupBroadcast(lessThan(data[1].i4, ivec4(0)), 1)); } else { diff --git a/deps/glslang/Test/spv.subgroupBallotNeg.comp b/deps/glslang/Test/spv.subgroupBallotNeg.comp new file mode 100644 index 00000000..4020adf1 --- /dev/null +++ b/deps/glslang/Test/spv.subgroupBallotNeg.comp @@ -0,0 +1,33 @@ +#version 450 + +#extension GL_KHR_shader_subgroup_ballot: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + uvec4 relMask = gl_SubgroupEqMask + + gl_SubgroupGeMask + + gl_SubgroupGtMask + + gl_SubgroupLeMask + + gl_SubgroupLtMask; + + uvec4 result = subgroupBallot(true); + + data[invocation].u4.x = subgroupBallotBitCount(result); + data[invocation].u4.y = subgroupBallotBitExtract(result, 0) ? 1 : 0; + data[invocation].u4.z = subgroupBallotInclusiveBitCount(result) + subgroupBallotExclusiveBitCount(result); + data[invocation].u4.w = subgroupBallotFindLSB(result) + subgroupBallotFindMSB(result); + + data[invocation].f4.x = subgroupBroadcast(data[0].f4.x, invocation); // ERROR: not constant +} diff --git a/deps/glslang/Test/spv.vulkan110.int16.frag b/deps/glslang/Test/spv.vulkan110.int16.frag index d29894b8..2feff4f8 100644 --- a/deps/glslang/Test/spv.vulkan110.int16.frag +++ b/deps/glslang/Test/spv.vulkan110.int16.frag @@ -1,13 +1,13 @@ #version 450 -#extension GL_KHX_shader_explicit_arithmetic_types: enable -#extension GL_KHX_shader_explicit_arithmetic_types_int8: require -#extension GL_KHX_shader_explicit_arithmetic_types_int16: require -#extension GL_KHX_shader_explicit_arithmetic_types_int32: require -#extension GL_KHX_shader_explicit_arithmetic_types_int64: require -#extension GL_KHX_shader_explicit_arithmetic_types_float16: require -#extension GL_KHX_shader_explicit_arithmetic_types_float32: require -#extension GL_KHX_shader_explicit_arithmetic_types_float64: require +#extension GL_EXT_shader_explicit_arithmetic_types: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int8: require +#extension GL_EXT_shader_explicit_arithmetic_types_int16: require +#extension GL_EXT_shader_explicit_arithmetic_types_int32: require +#extension GL_EXT_shader_explicit_arithmetic_types_int64: require +#extension GL_EXT_shader_explicit_arithmetic_types_float16: require +#extension GL_EXT_shader_explicit_arithmetic_types_float32: require +#extension GL_EXT_shader_explicit_arithmetic_types_float64: require layout(binding = 0) uniform Uniforms { diff --git a/deps/glslang/Test/spv.xfbOffsetOnBlockMembersAssignment.vert b/deps/glslang/Test/spv.xfbOffsetOnBlockMembersAssignment.vert new file mode 100644 index 00000000..40943f77 --- /dev/null +++ b/deps/glslang/Test/spv.xfbOffsetOnBlockMembersAssignment.vert @@ -0,0 +1,13 @@ +#version 450 + +layout(xfb_buffer=2) out; +layout(location=5, xfb_offset=0) out block2 { + float y1_out; + vec4 y2_out; +}; + +void main() { + y1_out = 7.0; + y2_out = vec4(1.0, 0.0, 0.0, 1.0); + gl_Position = vec4(0.0); +} diff --git a/deps/glslang/Test/spv.xfbOverlapOffsetCheckWithBlockAndMember.vert b/deps/glslang/Test/spv.xfbOverlapOffsetCheckWithBlockAndMember.vert new file mode 100644 index 00000000..3f493dc1 --- /dev/null +++ b/deps/glslang/Test/spv.xfbOverlapOffsetCheckWithBlockAndMember.vert @@ -0,0 +1,19 @@ +#version 450 + +/* block definition from GLSL spec 4.60, section 4.4.2, Output Layout Qualifiers */ + +layout(location=5, xfb_buffer = 3, xfb_offset = 12) out block2 { + vec4 v; // v will be written to byte offsets 12 through 27 of buffer + float u; // u will be written to offset 28 + layout(xfb_offset = 40) vec4 w; + vec4 x; // x will be written to offset 56, the next available offset +}; + +void main() { + v = vec4(1.0, 0.0, 1.0, 0.0); + u = 5.0; + w = vec4(1.0, 0.0, 0.0, 1.0); + x = vec4(5.0, 0.0, 0.0, 0.0); + + gl_Position = vec4(0.0); +} diff --git a/deps/glslang/Test/spv.xfbStrideJustOnce.vert b/deps/glslang/Test/spv.xfbStrideJustOnce.vert new file mode 100644 index 00000000..2798c6a8 --- /dev/null +++ b/deps/glslang/Test/spv.xfbStrideJustOnce.vert @@ -0,0 +1,14 @@ +#version 450 + +layout(xfb_buffer=2) out; + +layout(location=5, xfb_stride=20) out block { + float y1_out; + vec4 y2_out; +}; + +void main() { + y1_out = 7.0; + y2_out = vec4(1.0, 0.0, 0.0, 1.0); + gl_Position = vec4(0.0); +} diff --git a/deps/glslang/Test/stringToDouble.vert b/deps/glslang/Test/stringToDouble.vert index 5a7024da..a8de3b4f 100644 --- a/deps/glslang/Test/stringToDouble.vert +++ b/deps/glslang/Test/stringToDouble.vert @@ -1,5 +1,5 @@ #version 460 -#extension GL_KHX_shader_explicit_arithmetic_types_float16 : enable +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : enable void main() { float w1 = 00000.000; diff --git a/deps/glslang/glslang/Include/BaseTypes.h b/deps/glslang/glslang/Include/BaseTypes.h index 4a7c0568..1827c496 100644 --- a/deps/glslang/glslang/Include/BaseTypes.h +++ b/deps/glslang/glslang/Include/BaseTypes.h @@ -66,6 +66,8 @@ enum TBasicType { EbtAccStructNV, #endif + EbtReference, + // HLSL types that live only temporarily. EbtString, @@ -232,6 +234,9 @@ enum TBuiltInVariable { EbvViewIndex, EbvDeviceIndex, + EbvFragSizeEXT, + EbvFragInvocationCountEXT, + #ifdef NV_EXTENSIONS EbvViewportMaskNV, EbvSecondaryPositionNV, @@ -404,6 +409,9 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v) case EbvViewIndex: return "ViewIndex"; case EbvDeviceIndex: return "DeviceIndex"; + case EbvFragSizeEXT: return "FragSizeEXT"; + case EbvFragInvocationCountEXT: return "FragInvocationCountEXT"; + #ifdef NV_EXTENSIONS case EbvViewportMaskNV: return "ViewportMaskNV"; case EbvSecondaryPositionNV: return "SecondaryPositionNV"; diff --git a/deps/glslang/glslang/Include/Common.h b/deps/glslang/glslang/Include/Common.h index 35eaa310..98e5a1a0 100644 --- a/deps/glslang/glslang/Include/Common.h +++ b/deps/glslang/glslang/Include/Common.h @@ -229,16 +229,29 @@ inline const TString String(const int i, const int /*base*/ = 10) #endif struct TSourceLoc { - void init() { name = nullptr; string = 0; line = 0; column = 0; } + void init() + { + name = nullptr; string = 0; line = 0; column = 0; + } void init(int stringNum) { init(); string = stringNum; } // Returns the name if it exists. Otherwise, returns the string number. std::string getStringNameOrNum(bool quoteStringName = true) const { - if (name != nullptr) - return quoteStringName ? ("\"" + std::string(name) + "\"") : name; + if (name != nullptr) { + TString qstr = quoteStringName ? ("\"" + *name + "\"") : *name; + std::string ret_str(qstr.c_str()); + return ret_str; + } return std::to_string((long long)string); } - const char* name; // descriptive name for this string + const char* getFilename() const + { + if (name == nullptr) + return nullptr; + return name->c_str(); + } + const char* getFilenameStr() const { return name == nullptr ? "" : name->c_str(); } + TString* name; // descriptive name for this string, when a textual name is available, otherwise nullptr int string; int line; int column; diff --git a/deps/glslang/glslang/Include/Types.h b/deps/glslang/glslang/Include/Types.h index ae9cf402..4663a35a 100644 --- a/deps/glslang/glslang/Include/Types.h +++ b/deps/glslang/glslang/Include/Types.h @@ -81,6 +81,7 @@ struct TSampler { // misnomer now; includes images, textures without sampler, bool combined : 1; // true means texture is combined with a sampler, false means texture with no sampler bool sampler : 1; // true means a pure sampler, other fields should be clear() bool external : 1; // GL_OES_EGL_image_external + bool yuv : 1; // GL_EXT_YUV_target unsigned int vectorSize : 3; // vector return type size. // Some languages support structures as sample results. Storing the whole structure in the @@ -116,6 +117,7 @@ struct TSampler { // misnomer now; includes images, textures without sampler, combined = false; sampler = false; external = false; + yuv = false; structReturnIndex = noReturnStruct; // by default, returns a single vec4; @@ -186,6 +188,7 @@ struct TSampler { // misnomer now; includes images, textures without sampler, combined == right.combined && sampler == right.sampler && external == right.external && + yuv == right.yuv && vectorSize == right.vectorSize && structReturnIndex == right.structReturnIndex; } @@ -233,6 +236,9 @@ struct TSampler { // misnomer now; includes images, textures without sampler, s.append("ExternalOES"); return s; } + if (yuv) { + return "__" + s + "External2DY2YEXT"; + } switch (dim) { case Esd1D: s.append("1D"); break; case Esd2D: s.append("2D"); break; @@ -277,6 +283,7 @@ enum TLayoutPacking { ElpStd140, ElpStd430, ElpPacked, + ElpScalar, ElpCount // If expanding, see bitfield width below }; @@ -536,6 +543,11 @@ class TQualifier { { return subgroupcoherent || workgroupcoherent || queuefamilycoherent || devicecoherent || coherent || volatil || restrict || readonly || writeonly; } + bool bufferReferenceNeedsVulkanMemoryModel() const + { + // include qualifiers that map to load/store availability/visibility/nonprivate memory access operands + return subgroupcoherent || workgroupcoherent || queuefamilycoherent || devicecoherent || coherent || nonprivate; + } bool isInterpolation() const { @@ -720,6 +732,7 @@ class TQualifier { clearUniformLayout(); layoutPushConstant = false; + layoutBufferReference = false; #ifdef NV_EXTENSIONS layoutPassthrough = false; layoutViewportRelative = false; @@ -728,6 +741,8 @@ class TQualifier { layoutShaderRecordNV = false; #endif + layoutBufferReferenceAlign = layoutBufferReferenceAlignEnd; + clearInterstageLayout(); layoutSpecConstantId = layoutSpecConstantIdEnd; @@ -762,7 +777,8 @@ class TQualifier { #ifdef NV_EXTENSIONS layoutShaderRecordNV || #endif - layoutPushConstant; + layoutPushConstant || + layoutBufferReference; } bool hasLayout() const { @@ -774,42 +790,47 @@ class TQualifier { int layoutOffset; int layoutAlign; - unsigned int layoutLocation :12; - static const unsigned int layoutLocationEnd = 0xFFF; + unsigned int layoutLocation : 12; + static const unsigned int layoutLocationEnd = 0xFFF; - unsigned int layoutComponent : 3; - static const unsigned int layoutComponentEnd = 4; + unsigned int layoutComponent : 3; + static const unsigned int layoutComponentEnd = 4; - unsigned int layoutSet : 7; - static const unsigned int layoutSetEnd = 0x3F; + unsigned int layoutSet : 7; + static const unsigned int layoutSetEnd = 0x3F; - unsigned int layoutBinding : 16; - static const unsigned int layoutBindingEnd = 0xFFFF; + unsigned int layoutBinding : 16; + static const unsigned int layoutBindingEnd = 0xFFFF; - unsigned int layoutIndex : 8; - static const unsigned int layoutIndexEnd = 0xFF; + unsigned int layoutIndex : 8; + static const unsigned int layoutIndexEnd = 0xFF; - unsigned int layoutStream : 8; - static const unsigned int layoutStreamEnd = 0xFF; + unsigned int layoutStream : 8; + static const unsigned int layoutStreamEnd = 0xFF; - unsigned int layoutXfbBuffer : 4; - static const unsigned int layoutXfbBufferEnd = 0xF; + unsigned int layoutXfbBuffer : 4; + static const unsigned int layoutXfbBufferEnd = 0xF; - unsigned int layoutXfbStride : 10; - static const unsigned int layoutXfbStrideEnd = 0x3FF; + unsigned int layoutXfbStride : 14; + static const unsigned int layoutXfbStrideEnd = 0x3FFF; - unsigned int layoutXfbOffset : 10; - static const unsigned int layoutXfbOffsetEnd = 0x3FF; + unsigned int layoutXfbOffset : 13; + static const unsigned int layoutXfbOffsetEnd = 0x1FFF; - unsigned int layoutAttachment : 8; // for input_attachment_index - static const unsigned int layoutAttachmentEnd = 0XFF; + unsigned int layoutAttachment : 8; // for input_attachment_index + static const unsigned int layoutAttachmentEnd = 0XFF; unsigned int layoutSpecConstantId : 11; static const unsigned int layoutSpecConstantIdEnd = 0x7FF; - TLayoutFormat layoutFormat : 8; + // stored as log2 of the actual alignment value + unsigned int layoutBufferReferenceAlign : 6; + static const unsigned int layoutBufferReferenceAlignEnd = 0x3F; + + TLayoutFormat layoutFormat : 8; bool layoutPushConstant; + bool layoutBufferReference; #ifdef NV_EXTENSIONS bool layoutPassthrough; @@ -917,6 +938,10 @@ class TQualifier { // is just whether or not it was declared with an ID. return layoutSpecConstantId != layoutSpecConstantIdEnd; } + bool hasBufferReferenceAlign() const + { + return layoutBufferReferenceAlign != layoutBufferReferenceAlignEnd; + } bool isSpecConstant() const { // True if type is a specialization constant, whether or not it @@ -951,6 +976,7 @@ class TQualifier { case ElpShared: return "shared"; case ElpStd140: return "std140"; case ElpStd430: return "std430"; + case ElpScalar: return "scalar"; default: return "none"; } } @@ -1306,7 +1332,12 @@ class TType { sampler.clear(); qualifier = p.qualifier; if (p.userDef) { - structure = p.userDef->getWritableStruct(); // public type is short-lived; there are no sharing issues + if (p.userDef->basicType == EbtReference) { + basicType = EbtReference; + referentType = p.userDef->referentType; + } else { + structure = p.userDef->getWritableStruct(); // public type is short-lived; there are no sharing issues + } typeName = NewPoolTString(p.userDef->getTypeName().c_str()); } } @@ -1375,6 +1406,17 @@ class TType { sampler.clear(); typeName = NewPoolTString(n.c_str()); } + // for block reference (first parameter must be EbtReference) + explicit TType(TBasicType t, const TType &p, const TString& n) : + basicType(t), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), + arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr) + { + assert(t == EbtReference); + typeName = NewPoolTString(n.c_str()); + qualifier.clear(); + qualifier.storage = p.qualifier.storage; + referentType = p.clone(); + } virtual ~TType() {} // Not for use across pool pops; it will cause multiple instances of TType to point to the same information. @@ -1390,9 +1432,13 @@ class TType { matrixRows = copyOf.matrixRows; vector1 = copyOf.vector1; arraySizes = copyOf.arraySizes; // copying the pointer only, not the contents - structure = copyOf.structure; fieldName = copyOf.fieldName; typeName = copyOf.typeName; + if (isStruct()) { + structure = copyOf.structure; + } else { + referentType = copyOf.referentType; + } } // Make complete copy of the whole type graph rooted at 'copyOf'. @@ -1455,6 +1501,7 @@ class TType { virtual int getImplicitArraySize() const { return arraySizes->getImplicitSize(); } virtual const TArraySizes* getArraySizes() const { return arraySizes; } virtual TArraySizes* getArraySizes() { return arraySizes; } + virtual TType* getReferentType() const { return referentType; } virtual bool isScalar() const { return ! isVector() && ! isMatrix() && ! isStruct() && ! isArray(); } virtual bool isScalarOrVec1() const { return isScalar() || vector1; } @@ -1466,7 +1513,7 @@ class TType { virtual bool isArrayVariablyIndexed() const { assert(isArray()); return arraySizes->isVariablyIndexed(); } virtual void setArrayVariablyIndexed() { assert(isArray()); arraySizes->setVariablyIndexed(); } virtual void updateImplicitArraySize(int size) { assert(isArray()); arraySizes->updateImplicitSize(size); } - virtual bool isStruct() const { return structure != nullptr; } + virtual bool isStruct() const { return basicType == EbtStruct || basicType == EbtBlock; } virtual bool isFloatingDomain() const { return basicType == EbtFloat || basicType == EbtDouble || basicType == EbtFloat16; } virtual bool isIntegerDomain() const { @@ -1507,7 +1554,7 @@ class TType { const auto hasa = [predicate](const TTypeLoc& tl) { return tl.type->contains(predicate); }; - return structure && std::any_of(structure->begin(), structure->end(), hasa); + return isStruct() && std::any_of(structure->begin(), structure->end(), hasa); } // Recursively checks if the type contains the given basic type @@ -1686,6 +1733,7 @@ class TType { #ifdef NV_EXTENSIONS case EbtAccStructNV: return "accelerationStructureNV"; #endif + case EbtReference: return "reference"; default: return "unknown type"; } } @@ -1771,6 +1819,12 @@ class TType { } if (qualifier.layoutPushConstant) appendStr(" push_constant"); + if (qualifier.layoutBufferReference) + appendStr(" buffer_reference"); + if (qualifier.hasBufferReferenceAlign()) { + appendStr(" buffer_reference_align="); + appendUint(1u << qualifier.layoutBufferReferenceAlign); + } #ifdef NV_EXTENSIONS if (qualifier.layoutPassthrough) @@ -1890,7 +1944,7 @@ class TType { } // Add struct/block members - if (structure) { + if (isStruct()) { appendStr("{"); for (size_t i = 0; i < structure->size(); ++i) { if (! (*structure)[i].type->hiddenMember()) { @@ -1918,9 +1972,9 @@ class TType { const char* getStorageQualifierString() const { return GetStorageQualifierString(qualifier.storage); } const char* getBuiltInVariableString() const { return GetBuiltInVariableString(qualifier.builtIn); } const char* getPrecisionQualifierString() const { return GetPrecisionQualifierString(qualifier.precision); } - const TTypeList* getStruct() const { return structure; } - void setStruct(TTypeList* s) { structure = s; } - TTypeList* getWritableStruct() const { return structure; } // This should only be used when known to not be sharing with other threads + const TTypeList* getStruct() const { assert(isStruct()); return structure; } + void setStruct(TTypeList* s) { assert(isStruct()); structure = s; } + TTypeList* getWritableStruct() const { assert(isStruct()); return structure; } // This should only be used when known to not be sharing with other threads int computeNumComponents() const { @@ -1959,11 +2013,12 @@ class TType { bool sameStructType(const TType& right) const { // Most commonly, they are both nullptr, or the same pointer to the same actual structure - if (structure == right.structure) + if ((!isStruct() && !right.isStruct()) || + (isStruct() && right.isStruct() && structure == right.structure)) return true; // Both being nullptr was caught above, now they both have to be structures of the same number of elements - if (structure == nullptr || right.structure == nullptr || + if (!isStruct() || !right.isStruct() || structure->size() != right.structure->size()) return false; @@ -1983,6 +2038,23 @@ class TType { return true; } + bool sameReferenceType(const TType& right) const + { + if ((basicType == EbtReference) != (right.basicType == EbtReference)) + return false; + + if ((basicType != EbtReference) && (right.basicType != EbtReference)) + return true; + + assert(referentType != nullptr); + assert(right.referentType != nullptr); + + if (referentType == right.referentType) + return true; + + return *referentType == *right.referentType; + } + // See if two types match, in all aspects except arrayness bool sameElementType(const TType& right) const { @@ -2011,7 +2083,8 @@ class TType { matrixCols == right.matrixCols && matrixRows == right.matrixRows && vector1 == right.vector1 && - sameStructType(right); + sameStructType(right) && + sameReferenceType(right); } // See if two types match in all ways (just the actual type, not qualification) @@ -2042,7 +2115,7 @@ class TType { *arraySizes = *copyOf.arraySizes; } - if (copyOf.structure) { + if (copyOf.isStruct() && copyOf.structure) { auto prevCopy = copiedMap.find(copyOf.structure); if (prevCopy != copiedMap.end()) structure = prevCopy->second; @@ -2080,7 +2153,12 @@ class TType { TQualifier qualifier; TArraySizes* arraySizes; // nullptr unless an array; can be shared across types - TTypeList* structure; // nullptr unless this is a struct; can be shared across types + // A type can't be both a structure (EbtStruct/EbtBlock) and a reference (EbtReference), so + // conserve space by making these a union + union { + TTypeList* structure; // invalid unless this is a struct; can be shared across types + TType *referentType; // invalid unless this is an EbtReference + }; TString *fieldName; // for structure field names TString *typeName; // for structure type name TSampler sampler; diff --git a/deps/glslang/glslang/Include/intermediate.h b/deps/glslang/glslang/Include/intermediate.h index 27250070..4b6bcb7b 100644 --- a/deps/glslang/glslang/Include/intermediate.h +++ b/deps/glslang/glslang/Include/intermediate.h @@ -269,6 +269,10 @@ enum TOperator { EOpConvDoubleToFloat16, EOpConvDoubleToFloat, + // uint64_t <-> pointer + EOpConvUint64ToPtr, + EOpConvPtrToUint64, + // // binary operations // @@ -732,6 +736,7 @@ enum TOperator { EOpConstructStruct, EOpConstructTextureSampler, EOpConstructNonuniform, // expected to be transformed away, not present in final AST + EOpConstructReference, EOpConstructGuardEnd, // diff --git a/deps/glslang/glslang/Include/revision.h b/deps/glslang/glslang/Include/revision.h index 3bd41cab..702c89e4 100644 --- a/deps/glslang/glslang/Include/revision.h +++ b/deps/glslang/glslang/Include/revision.h @@ -1,3 +1,3 @@ // This header is generated by the make-revision script. -#define GLSLANG_PATCH_LEVEL 2984 +#define GLSLANG_PATCH_LEVEL 3057 diff --git a/deps/glslang/glslang/MachineIndependent/Constant.cpp b/deps/glslang/glslang/MachineIndependent/Constant.cpp index b33af84d..a6adab1f 100644 --- a/deps/glslang/glslang/MachineIndependent/Constant.cpp +++ b/deps/glslang/glslang/MachineIndependent/Constant.cpp @@ -2,6 +2,7 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. // Copyright (C) 2017 ARM Limited. +// Copyright (C) 2018 Google, Inc. // // All rights reserved. // @@ -670,6 +671,279 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType) break; } + case EOpConvInt8ToBool: + newConstArray[i].setBConst(unionArray[i].getI8Const() != 0); break; + case EOpConvUint8ToBool: + newConstArray[i].setBConst(unionArray[i].getU8Const() != 0); break; + case EOpConvInt16ToBool: + newConstArray[i].setBConst(unionArray[i].getI16Const() != 0); break; + case EOpConvUint16ToBool: + newConstArray[i].setBConst(unionArray[i].getU16Const() != 0); break; + case EOpConvIntToBool: + newConstArray[i].setBConst(unionArray[i].getIConst() != 0); break; + case EOpConvUintToBool: + newConstArray[i].setBConst(unionArray[i].getUConst() != 0); break; + case EOpConvInt64ToBool: + newConstArray[i].setBConst(unionArray[i].getI64Const() != 0); break; + case EOpConvUint64ToBool: + newConstArray[i].setBConst(unionArray[i].getI64Const() != 0); break; + case EOpConvFloat16ToBool: + newConstArray[i].setBConst(unionArray[i].getDConst() != 0); break; + case EOpConvFloatToBool: + newConstArray[i].setBConst(unionArray[i].getDConst() != 0); break; + case EOpConvDoubleToBool: + newConstArray[i].setBConst(unionArray[i].getDConst() != 0); break; + + case EOpConvBoolToInt8: + newConstArray[i].setI8Const(unionArray[i].getBConst()); break; + case EOpConvBoolToUint8: + newConstArray[i].setU8Const(unionArray[i].getBConst()); break; + case EOpConvBoolToInt16: + newConstArray[i].setI16Const(unionArray[i].getBConst()); break; + case EOpConvBoolToUint16: + newConstArray[i].setU16Const(unionArray[i].getBConst()); break; + case EOpConvBoolToInt: + newConstArray[i].setIConst(unionArray[i].getBConst()); break; + case EOpConvBoolToUint: + newConstArray[i].setUConst(unionArray[i].getBConst()); break; + case EOpConvBoolToInt64: + newConstArray[i].setI64Const(unionArray[i].getBConst()); break; + case EOpConvBoolToUint64: + newConstArray[i].setU64Const(unionArray[i].getBConst()); break; + case EOpConvBoolToFloat16: + newConstArray[i].setDConst(unionArray[i].getBConst()); break; + case EOpConvBoolToFloat: + newConstArray[i].setDConst(unionArray[i].getBConst()); break; + case EOpConvBoolToDouble: + newConstArray[i].setDConst(unionArray[i].getBConst()); break; + + case EOpConvInt8ToInt16: + newConstArray[i].setI16Const(unionArray[i].getI8Const()); break; + case EOpConvInt8ToInt: + newConstArray[i].setIConst(unionArray[i].getI8Const()); break; + case EOpConvInt8ToInt64: + newConstArray[i].setI64Const(unionArray[i].getI8Const()); break; + case EOpConvInt8ToUint8: + newConstArray[i].setU8Const(unionArray[i].getI8Const()); break; + case EOpConvInt8ToUint16: + newConstArray[i].setU16Const(unionArray[i].getI8Const()); break; + case EOpConvInt8ToUint: + newConstArray[i].setUConst(unionArray[i].getI8Const()); break; + case EOpConvInt8ToUint64: + newConstArray[i].setU64Const(unionArray[i].getI8Const()); break; + case EOpConvUint8ToInt8: + newConstArray[i].setI8Const(unionArray[i].getU8Const()); break; + case EOpConvUint8ToInt16: + newConstArray[i].setI16Const(unionArray[i].getU8Const()); break; + case EOpConvUint8ToInt: + newConstArray[i].setIConst(unionArray[i].getU8Const()); break; + case EOpConvUint8ToInt64: + newConstArray[i].setI64Const(unionArray[i].getU8Const()); break; + case EOpConvUint8ToUint16: + newConstArray[i].setU16Const(unionArray[i].getU8Const()); break; + case EOpConvUint8ToUint: + newConstArray[i].setUConst(unionArray[i].getU8Const()); break; + case EOpConvUint8ToUint64: + newConstArray[i].setU64Const(unionArray[i].getU8Const()); break; + case EOpConvInt8ToFloat16: + newConstArray[i].setDConst(unionArray[i].getI8Const()); break; + case EOpConvInt8ToFloat: + newConstArray[i].setDConst(unionArray[i].getI8Const()); break; + case EOpConvInt8ToDouble: + newConstArray[i].setDConst(unionArray[i].getI8Const()); break; + case EOpConvUint8ToFloat16: + newConstArray[i].setDConst(unionArray[i].getU8Const()); break; + case EOpConvUint8ToFloat: + newConstArray[i].setDConst(unionArray[i].getU8Const()); break; + case EOpConvUint8ToDouble: + newConstArray[i].setDConst(unionArray[i].getU8Const()); break; + + case EOpConvInt16ToInt8: + newConstArray[i].setI8Const(static_cast(unionArray[i].getI16Const())); break; + case EOpConvInt16ToInt: + newConstArray[i].setIConst(unionArray[i].getI16Const()); break; + case EOpConvInt16ToInt64: + newConstArray[i].setI64Const(unionArray[i].getI16Const()); break; + case EOpConvInt16ToUint8: + newConstArray[i].setU8Const(static_cast(unionArray[i].getI16Const())); break; + case EOpConvInt16ToUint16: + newConstArray[i].setU16Const(unionArray[i].getI16Const()); break; + case EOpConvInt16ToUint: + newConstArray[i].setUConst(unionArray[i].getI16Const()); break; + case EOpConvInt16ToUint64: + newConstArray[i].setU64Const(unionArray[i].getI16Const()); break; + case EOpConvUint16ToInt8: + newConstArray[i].setI8Const(static_cast(unionArray[i].getU16Const())); break; + case EOpConvUint16ToInt16: + newConstArray[i].setI16Const(unionArray[i].getU16Const()); break; + case EOpConvUint16ToInt: + newConstArray[i].setIConst(unionArray[i].getU16Const()); break; + case EOpConvUint16ToInt64: + newConstArray[i].setI64Const(unionArray[i].getU16Const()); break; + case EOpConvUint16ToUint8: + newConstArray[i].setU8Const(static_cast(unionArray[i].getU16Const())); break; + + case EOpConvUint16ToUint: + newConstArray[i].setUConst(unionArray[i].getU16Const()); break; + case EOpConvUint16ToUint64: + newConstArray[i].setU64Const(unionArray[i].getU16Const()); break; + case EOpConvInt16ToFloat16: + newConstArray[i].setDConst(unionArray[i].getI16Const()); break; + case EOpConvInt16ToFloat: + newConstArray[i].setDConst(unionArray[i].getI16Const()); break; + case EOpConvInt16ToDouble: + newConstArray[i].setDConst(unionArray[i].getI16Const()); break; + case EOpConvUint16ToFloat16: + newConstArray[i].setDConst(unionArray[i].getU16Const()); break; + case EOpConvUint16ToFloat: + newConstArray[i].setDConst(unionArray[i].getU16Const()); break; + case EOpConvUint16ToDouble: + newConstArray[i].setDConst(unionArray[i].getU16Const()); break; + + case EOpConvIntToInt8: + newConstArray[i].setI8Const((signed char)unionArray[i].getIConst()); break; + case EOpConvIntToInt16: + newConstArray[i].setI16Const((signed short)unionArray[i].getIConst()); break; + case EOpConvIntToInt64: + newConstArray[i].setI64Const(unionArray[i].getIConst()); break; + case EOpConvIntToUint8: + newConstArray[i].setU8Const((unsigned char)unionArray[i].getIConst()); break; + case EOpConvIntToUint16: + newConstArray[i].setU16Const((unsigned char)unionArray[i].getIConst()); break; + case EOpConvIntToUint: + newConstArray[i].setUConst(unionArray[i].getIConst()); break; + case EOpConvIntToUint64: + newConstArray[i].setU64Const(unionArray[i].getIConst()); break; + + case EOpConvUintToInt8: + newConstArray[i].setI8Const((signed char)unionArray[i].getUConst()); break; + case EOpConvUintToInt16: + newConstArray[i].setI16Const((signed short)unionArray[i].getUConst()); break; + case EOpConvUintToInt: + newConstArray[i].setIConst(unionArray[i].getUConst()); break; + case EOpConvUintToInt64: + newConstArray[i].setI64Const(unionArray[i].getUConst()); break; + case EOpConvUintToUint8: + newConstArray[i].setU8Const((unsigned char)unionArray[i].getUConst()); break; + case EOpConvUintToUint16: + newConstArray[i].setU16Const((unsigned short)unionArray[i].getUConst()); break; + case EOpConvUintToUint64: + newConstArray[i].setU64Const(unionArray[i].getUConst()); break; + case EOpConvIntToFloat16: + newConstArray[i].setDConst(unionArray[i].getIConst()); break; + case EOpConvIntToFloat: + newConstArray[i].setDConst(unionArray[i].getIConst()); break; + case EOpConvIntToDouble: + newConstArray[i].setDConst(unionArray[i].getIConst()); break; + case EOpConvUintToFloat16: + newConstArray[i].setDConst(unionArray[i].getUConst()); break; + case EOpConvUintToFloat: + newConstArray[i].setDConst(unionArray[i].getUConst()); break; + case EOpConvUintToDouble: + newConstArray[i].setDConst(unionArray[i].getUConst()); break; + case EOpConvInt64ToInt8: + newConstArray[i].setI8Const(static_cast(unionArray[i].getI64Const())); break; + case EOpConvInt64ToInt16: + newConstArray[i].setI16Const(static_cast(unionArray[i].getI64Const())); break; + case EOpConvInt64ToInt: + newConstArray[i].setIConst(static_cast(unionArray[i].getI64Const())); break; + case EOpConvInt64ToUint8: + newConstArray[i].setU8Const(static_cast(unionArray[i].getI64Const())); break; + case EOpConvInt64ToUint16: + newConstArray[i].setU16Const(static_cast(unionArray[i].getI64Const())); break; + case EOpConvInt64ToUint: + newConstArray[i].setUConst(static_cast(unionArray[i].getI64Const())); break; + case EOpConvInt64ToUint64: + newConstArray[i].setU64Const(unionArray[i].getI64Const()); break; + case EOpConvUint64ToInt8: + newConstArray[i].setI8Const(static_cast(unionArray[i].getU64Const())); break; + case EOpConvUint64ToInt16: + newConstArray[i].setI16Const(static_cast(unionArray[i].getU64Const())); break; + case EOpConvUint64ToInt: + newConstArray[i].setIConst(static_cast(unionArray[i].getU64Const())); break; + case EOpConvUint64ToInt64: + newConstArray[i].setI64Const(unionArray[i].getU64Const()); break; + case EOpConvUint64ToUint8: + newConstArray[i].setU8Const(static_cast(unionArray[i].getU64Const())); break; + case EOpConvUint64ToUint16: + newConstArray[i].setU16Const(static_cast(unionArray[i].getU64Const())); break; + case EOpConvUint64ToUint: + newConstArray[i].setUConst(static_cast(unionArray[i].getU64Const())); break; + case EOpConvInt64ToFloat16: + newConstArray[i].setDConst(static_cast(unionArray[i].getI64Const())); break; + case EOpConvInt64ToFloat: + newConstArray[i].setDConst(static_cast(unionArray[i].getI64Const())); break; + case EOpConvInt64ToDouble: + newConstArray[i].setDConst(static_cast(unionArray[i].getI64Const())); break; + case EOpConvUint64ToFloat16: + newConstArray[i].setDConst(static_cast(unionArray[i].getU64Const())); break; + case EOpConvUint64ToFloat: + newConstArray[i].setDConst(static_cast(unionArray[i].getU64Const())); break; + case EOpConvUint64ToDouble: + newConstArray[i].setDConst(static_cast(unionArray[i].getU64Const())); break; + case EOpConvFloat16ToInt8: + newConstArray[i].setI8Const(static_cast(unionArray[i].getDConst())); break; + case EOpConvFloat16ToInt16: + newConstArray[i].setI16Const(static_cast(unionArray[i].getDConst())); break; + case EOpConvFloat16ToInt: + newConstArray[i].setIConst(static_cast(unionArray[i].getDConst())); break; + case EOpConvFloat16ToInt64: + newConstArray[i].setI64Const(static_cast(unionArray[i].getDConst())); break; + case EOpConvFloat16ToUint8: + newConstArray[i].setU8Const(static_cast(unionArray[i].getDConst())); break; + case EOpConvFloat16ToUint16: + newConstArray[i].setU16Const(static_cast(unionArray[i].getDConst())); break; + case EOpConvFloat16ToUint: + newConstArray[i].setUConst(static_cast(unionArray[i].getDConst())); break; + case EOpConvFloat16ToUint64: + newConstArray[i].setU64Const(static_cast(unionArray[i].getDConst())); break; + case EOpConvFloat16ToFloat: + newConstArray[i].setDConst(unionArray[i].getDConst()); break; + case EOpConvFloat16ToDouble: + newConstArray[i].setDConst(unionArray[i].getDConst()); break; + case EOpConvFloatToInt8: + newConstArray[i].setI8Const(static_cast(unionArray[i].getDConst())); break; + case EOpConvFloatToInt16: + newConstArray[i].setI16Const(static_cast(unionArray[i].getDConst())); break; + case EOpConvFloatToInt: + newConstArray[i].setIConst(static_cast(unionArray[i].getDConst())); break; + case EOpConvFloatToInt64: + newConstArray[i].setI64Const(static_cast(unionArray[i].getDConst())); break; + case EOpConvFloatToUint8: + newConstArray[i].setU8Const(static_cast(unionArray[i].getDConst())); break; + case EOpConvFloatToUint16: + newConstArray[i].setU16Const(static_cast(unionArray[i].getDConst())); break; + case EOpConvFloatToUint: + newConstArray[i].setUConst(static_cast(unionArray[i].getDConst())); break; + case EOpConvFloatToUint64: + newConstArray[i].setU64Const(static_cast(unionArray[i].getDConst())); break; + case EOpConvFloatToFloat16: + newConstArray[i].setDConst(unionArray[i].getDConst()); break; + case EOpConvFloatToDouble: + newConstArray[i].setDConst(unionArray[i].getDConst()); break; + case EOpConvDoubleToInt8: + newConstArray[i].setI8Const(static_cast(unionArray[i].getDConst())); break; + case EOpConvDoubleToInt16: + newConstArray[i].setI16Const(static_cast(unionArray[i].getDConst())); break; + case EOpConvDoubleToInt: + newConstArray[i].setIConst(static_cast(unionArray[i].getDConst())); break; + case EOpConvDoubleToInt64: + newConstArray[i].setI64Const(static_cast(unionArray[i].getDConst())); break; + case EOpConvDoubleToUint8: + newConstArray[i].setU8Const(static_cast(unionArray[i].getDConst())); break; + case EOpConvDoubleToUint16: + newConstArray[i].setU16Const(static_cast(unionArray[i].getDConst())); break; + case EOpConvDoubleToUint: + newConstArray[i].setUConst(static_cast(unionArray[i].getDConst())); break; + case EOpConvDoubleToUint64: + newConstArray[i].setU64Const(static_cast(unionArray[i].getDConst())); break; + case EOpConvDoubleToFloat16: + newConstArray[i].setDConst(unionArray[i].getDConst()); break; + case EOpConvDoubleToFloat: + newConstArray[i].setDConst(unionArray[i].getDConst()); break; + + + // TODO: 3.0 Functionality: unary constant folding: the rest of the ops have to be fleshed out case EOpSinh: diff --git a/deps/glslang/glslang/MachineIndependent/Initialize.cpp b/deps/glslang/glslang/MachineIndependent/Initialize.cpp index a17ea1ae..e399eadf 100644 --- a/deps/glslang/glslang/MachineIndependent/Initialize.cpp +++ b/deps/glslang/glslang/MachineIndependent/Initialize.cpp @@ -1,7 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2016 LunarG, Inc. -// Copyright (C) 2015-2017 Google, Inc. +// Copyright (C) 2015-2018 Google, Inc. // Copyright (C) 2017 ARM Limited. // // All rights reserved. @@ -1603,6 +1603,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "vec4 texelFetch(samplerExternalOES, ivec2, int lod);" // GL_OES_EGL_image_external_essl3 "\n"); } + commonBuiltins.append( + "highp ivec2 textureSize(__samplerExternal2DY2YEXT, int lod);" // GL_EXT_YUV_target + "vec4 texture(__samplerExternal2DY2YEXT, vec2);" // GL_EXT_YUV_target + "vec4 texture(__samplerExternal2DY2YEXT, vec2, float bias);" // GL_EXT_YUV_target + "vec4 textureProj(__samplerExternal2DY2YEXT, vec3);" // GL_EXT_YUV_target + "vec4 textureProj(__samplerExternal2DY2YEXT, vec3, float bias);" // GL_EXT_YUV_target + "vec4 textureProj(__samplerExternal2DY2YEXT, vec4);" // GL_EXT_YUV_target + "vec4 textureProj(__samplerExternal2DY2YEXT, vec4, float bias);" // GL_EXT_YUV_target + "vec4 texelFetch(__samplerExternal2DY2YEXT sampler, ivec2, int lod);" // GL_EXT_YUV_target + "\n"); commonBuiltins.append( "vec4 texture2DGradEXT(sampler2D, vec2, vec2, vec2);" // GL_EXT_shader_texture_lod "vec4 texture2DProjGradEXT(sampler2D, vec3, vec2, vec2);" // GL_EXT_shader_texture_lod @@ -5347,6 +5357,9 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "in highp uvec3 gl_GlobalInvocationID;" "in highp uint gl_LocalInvocationIndex;" + "in uint gl_MeshViewCountNV;" + "in uint gl_MeshViewIndicesNV[4];" + "\n"); } @@ -5939,6 +5952,12 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "bool gl_HelperInvocation;" // needs qualifier fixed later ); + if (version >= 450) + stageBuiltins[EShLangFragment].append( // GL_EXT_fragment_invocation_density + "flat in ivec2 gl_FragSizeEXT;" + "flat in int gl_FragInvocationCountEXT;" + ); + #ifdef AMD_EXTENSIONS if (version >= 450) stageBuiltins[EShLangFragment].append( @@ -5959,9 +5978,9 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV ); if (version >= 450) stageBuiltins[EShLangFragment].append( - "flat in ivec2 gl_FragmentSizeNV;" + "flat in ivec2 gl_FragmentSizeNV;" // GL_NV_shading_rate_image "flat in int gl_InvocationsPerPixelNV;" - "in vec3 gl_BaryCoordNV;" + "in vec3 gl_BaryCoordNV;" // GL_NV_fragment_shader_barycentric "in vec3 gl_BaryCoordNoPerspNV;" ); @@ -6006,13 +6025,19 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV stageBuiltins[EShLangFragment].append( "highp float gl_FragDepthEXT;" // GL_EXT_frag_depth ); + + if (version >= 310) + stageBuiltins[EShLangFragment].append( // GL_EXT_fragment_invocation_density + "flat in ivec2 gl_FragSizeEXT;" + "flat in int gl_FragInvocationCountEXT;" + ); #ifdef NV_EXTENSIONS if (version >= 320) - stageBuiltins[EShLangFragment].append( + stageBuiltins[EShLangFragment].append( // GL_NV_shading_rate_image "flat in ivec2 gl_FragmentSizeNV;" "flat in int gl_InvocationsPerPixelNV;" ); - if (version >= 320) + if (version >= 320) stageBuiltins[EShLangFragment].append( "in vec3 gl_BaryCoordNV;" "in vec3 gl_BaryCoordNoPerspNV;" @@ -7725,11 +7750,12 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf static void SpecialQualifier(const char* name, TStorageQualifier qualifier, TBuiltInVariable builtIn, TSymbolTable& symbolTable) { TSymbol* symbol = symbolTable.find(name); - if (symbol) { - TQualifier& symQualifier = symbol->getWritableType().getQualifier(); - symQualifier.storage = qualifier; - symQualifier.builtIn = builtIn; - } + if (symbol == nullptr) + return; + + TQualifier& symQualifier = symbol->getWritableType().getQualifier(); + symQualifier.storage = qualifier; + symQualifier.builtIn = builtIn; } // @@ -7745,7 +7771,7 @@ static void SpecialQualifier(const char* name, TStorageQualifier qualifier, TBui static void BuiltInVariable(const char* name, TBuiltInVariable builtIn, TSymbolTable& symbolTable) { TSymbol* symbol = symbolTable.find(name); - if (! symbol) + if (symbol == nullptr) return; TQualifier& symQualifier = symbol->getWritableType().getQualifier(); @@ -7762,7 +7788,7 @@ static void BuiltInVariable(const char* name, TBuiltInVariable builtIn, TSymbolT static void BuiltInVariable(const char* blockName, const char* name, TBuiltInVariable builtIn, TSymbolTable& symbolTable) { TSymbol* symbol = symbolTable.find(blockName); - if (! symbol) + if (symbol == nullptr) return; TTypeList& structure = *symbol->getWritableType().getWritableStruct(); @@ -8018,9 +8044,18 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_ViewportMaskPerViewNV", EbvViewportMaskPerViewNV, symbolTable); if (language != EShLangVertex) { + symbolTable.setVariableExtensions("gl_in", "gl_SecondaryPositionNV", 1, &E_GL_NV_stereo_view_rendering); + symbolTable.setVariableExtensions("gl_in", "gl_PositionPerViewNV", 1, &E_GL_NVX_multiview_per_view_attributes); + BuiltInVariable("gl_in", "gl_SecondaryPositionNV", EbvSecondaryPositionNV, symbolTable); BuiltInVariable("gl_in", "gl_PositionPerViewNV", EbvPositionPerViewNV, symbolTable); } + symbolTable.setVariableExtensions("gl_out", "gl_ViewportMask", 1, &E_GL_NV_viewport_array2); + symbolTable.setVariableExtensions("gl_out", "gl_SecondaryPositionNV", 1, &E_GL_NV_stereo_view_rendering); + symbolTable.setVariableExtensions("gl_out", "gl_SecondaryViewportMaskNV", 1, &E_GL_NV_stereo_view_rendering); + symbolTable.setVariableExtensions("gl_out", "gl_PositionPerViewNV", 1, &E_GL_NVX_multiview_per_view_attributes); + symbolTable.setVariableExtensions("gl_out", "gl_ViewportMaskPerViewNV", 1, &E_GL_NVX_multiview_per_view_attributes); + BuiltInVariable("gl_out", "gl_ViewportMask", EbvViewportMaskNV, symbolTable); BuiltInVariable("gl_out", "gl_SecondaryPositionNV", EbvSecondaryPositionNV, symbolTable); BuiltInVariable("gl_out", "gl_SecondaryViewportMaskNV", EbvSecondaryViewportMaskNV, symbolTable); @@ -8064,15 +8099,16 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion // gl_PointSize, when it needs to be tied to an extension, is always a member of a block. // (Sometimes with an instance name, sometimes anonymous). - // However, the current automatic extension scheme does not work per block member, - // so for now check when parsing. - // - // if (profile == EEsProfile) { - // if (language == EShLangGeometry) - // symbolTable.setVariableExtensions("gl_PointSize", Num_AEP_geometry_point_size, AEP_geometry_point_size); - // else if (language == EShLangTessEvaluation || language == EShLangTessControl) - // symbolTable.setVariableExtensions("gl_PointSize", Num_AEP_tessellation_point_size, AEP_tessellation_point_size); - //} + if (profile == EEsProfile) { + if (language == EShLangGeometry) { + symbolTable.setVariableExtensions("gl_PointSize", Num_AEP_geometry_point_size, AEP_geometry_point_size); + symbolTable.setVariableExtensions("gl_in", "gl_PointSize", Num_AEP_geometry_point_size, AEP_geometry_point_size); + } else if (language == EShLangTessEvaluation || language == EShLangTessControl) { + // gl_in tessellation settings of gl_PointSize are in the context-dependent paths + symbolTable.setVariableExtensions("gl_PointSize", Num_AEP_tessellation_point_size, AEP_tessellation_point_size); + symbolTable.setVariableExtensions("gl_out", "gl_PointSize", Num_AEP_tessellation_point_size, AEP_tessellation_point_size); + } + } if ((profile != EEsProfile && version >= 140) || (profile == EEsProfile && version >= 310)) { @@ -8342,6 +8378,14 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion } #endif + if ((profile != EEsProfile && version >= 450) || + (profile == EEsProfile && version >= 310)) { + symbolTable.setVariableExtensions("gl_FragSizeEXT", 1, &E_GL_EXT_fragment_invocation_density); + symbolTable.setVariableExtensions("gl_FragInvocationCountEXT", 1, &E_GL_EXT_fragment_invocation_density); + BuiltInVariable("gl_FragSizeEXT", EbvFragSizeEXT, symbolTable); + BuiltInVariable("gl_FragInvocationCountEXT", EbvFragInvocationCountEXT, symbolTable); + } + symbolTable.setVariableExtensions("gl_FragDepthEXT", 1, &E_GL_EXT_frag_depth); if (profile == EEsProfile && version < 320) { @@ -8663,25 +8707,44 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion break; case EShLangMeshNV: if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { - // Per-vertex builtins + // per-vertex builtins + symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_Position", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_PointSize", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_ClipDistance", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_CullDistance", 1, &E_GL_NV_mesh_shader); + BuiltInVariable("gl_MeshVerticesNV", "gl_Position", EbvPosition, symbolTable); BuiltInVariable("gl_MeshVerticesNV", "gl_PointSize", EbvPointSize, symbolTable); BuiltInVariable("gl_MeshVerticesNV", "gl_ClipDistance", EbvClipDistance, symbolTable); BuiltInVariable("gl_MeshVerticesNV", "gl_CullDistance", EbvCullDistance, symbolTable); - // Per-view builtins + + symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_PositionPerViewNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_ClipDistancePerViewNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_CullDistancePerViewNV", 1, &E_GL_NV_mesh_shader); + BuiltInVariable("gl_MeshVerticesNV", "gl_PositionPerViewNV", EbvPositionPerViewNV, symbolTable); BuiltInVariable("gl_MeshVerticesNV", "gl_ClipDistancePerViewNV", EbvClipDistancePerViewNV, symbolTable); BuiltInVariable("gl_MeshVerticesNV", "gl_CullDistancePerViewNV", EbvCullDistancePerViewNV, symbolTable); - // Per-primitive builtins + // per-primitive builtins + symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_PrimitiveID", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_Layer", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_ViewportIndex", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_ViewportMask", 1, &E_GL_NV_mesh_shader); + BuiltInVariable("gl_MeshPrimitivesNV", "gl_PrimitiveID", EbvPrimitiveId, symbolTable); BuiltInVariable("gl_MeshPrimitivesNV", "gl_Layer", EbvLayer, symbolTable); BuiltInVariable("gl_MeshPrimitivesNV", "gl_ViewportIndex", EbvViewportIndex, symbolTable); BuiltInVariable("gl_MeshPrimitivesNV", "gl_ViewportMask", EbvViewportMaskNV, symbolTable); - // Per-view builtins + + // per-view per-primitive builtins + symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_LayerPerViewNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_ViewportMaskPerViewNV", 1, &E_GL_NV_mesh_shader); + BuiltInVariable("gl_MeshPrimitivesNV", "gl_LayerPerViewNV", EbvLayerPerViewNV, symbolTable); BuiltInVariable("gl_MeshPrimitivesNV", "gl_ViewportMaskPerViewNV", EbvViewportMaskPerViewNV, symbolTable); + // other builtins symbolTable.setVariableExtensions("gl_PrimitiveCountNV", 1, &E_GL_NV_mesh_shader); symbolTable.setVariableExtensions("gl_PrimitiveIndicesNV", 1, &E_GL_NV_mesh_shader); symbolTable.setVariableExtensions("gl_MeshViewCountNV", 1, &E_GL_NV_mesh_shader); @@ -8702,11 +8765,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_GlobalInvocationID", EbvGlobalInvocationId, symbolTable); BuiltInVariable("gl_LocalInvocationIndex", EbvLocalInvocationIndex, symbolTable); + // builtin constants symbolTable.setVariableExtensions("gl_MaxMeshOutputVerticesNV", 1, &E_GL_NV_mesh_shader); symbolTable.setVariableExtensions("gl_MaxMeshOutputPrimitivesNV", 1, &E_GL_NV_mesh_shader); symbolTable.setVariableExtensions("gl_MaxMeshWorkGroupSizeNV", 1, &E_GL_NV_mesh_shader); symbolTable.setVariableExtensions("gl_MaxMeshViewCountNV", 1, &E_GL_NV_mesh_shader); + // builtin functions symbolTable.setFunctionExtensions("barrier", 1, &E_GL_NV_mesh_shader); symbolTable.setFunctionExtensions("memoryBarrierShared", 1, &E_GL_NV_mesh_shader); symbolTable.setFunctionExtensions("groupMemoryBarrier", 1, &E_GL_NV_mesh_shader); @@ -8781,6 +8846,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setVariableExtensions("gl_LocalInvocationID", 1, &E_GL_NV_mesh_shader); symbolTable.setVariableExtensions("gl_GlobalInvocationID", 1, &E_GL_NV_mesh_shader); symbolTable.setVariableExtensions("gl_LocalInvocationIndex", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshViewCountNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MeshViewIndicesNV", 1, &E_GL_NV_mesh_shader); BuiltInVariable("gl_TaskCountNV", EbvTaskCountNV, symbolTable); BuiltInVariable("gl_WorkGroupSize", EbvWorkGroupSize, symbolTable); @@ -8788,8 +8855,11 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_LocalInvocationID", EbvLocalInvocationId, symbolTable); BuiltInVariable("gl_GlobalInvocationID", EbvGlobalInvocationId, symbolTable); BuiltInVariable("gl_LocalInvocationIndex", EbvLocalInvocationIndex, symbolTable); + BuiltInVariable("gl_MeshViewCountNV", EbvMeshViewCountNV, symbolTable); + BuiltInVariable("gl_MeshViewIndicesNV", EbvMeshViewIndicesNV, symbolTable); symbolTable.setVariableExtensions("gl_MaxTaskWorkGroupSizeNV", 1, &E_GL_NV_mesh_shader); + symbolTable.setVariableExtensions("gl_MaxMeshViewCountNV", 1, &E_GL_NV_mesh_shader); symbolTable.setFunctionExtensions("barrier", 1, &E_GL_NV_mesh_shader); symbolTable.setFunctionExtensions("memoryBarrierShared", 1, &E_GL_NV_mesh_shader); @@ -9491,6 +9561,12 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_in", "gl_BackSecondaryColor", EbvBackSecondaryColor, symbolTable); BuiltInVariable("gl_in", "gl_TexCoord", EbvTexCoord, symbolTable); BuiltInVariable("gl_in", "gl_FogFragCoord", EbvFogFragCoord, symbolTable); + + // extension requirements + if (profile == EEsProfile) { + symbolTable.setVariableExtensions("gl_in", "gl_PointSize", Num_AEP_tessellation_point_size, AEP_tessellation_point_size); + } + break; default: diff --git a/deps/glslang/glslang/MachineIndependent/Intermediate.cpp b/deps/glslang/glslang/MachineIndependent/Intermediate.cpp index 6355f300..32b38a0c 100644 --- a/deps/glslang/glslang/MachineIndependent/Intermediate.cpp +++ b/deps/glslang/glslang/MachineIndependent/Intermediate.cpp @@ -1,7 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2015 LunarG, Inc. -// Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2015-2018 Google, Inc. // Copyright (C) 2017 ARM Limited. // // All rights reserved. @@ -489,7 +489,7 @@ bool TIntermediate::isConversionAllowed(TOperator op, TIntermTyped* node) const // This is 'mechanism' here, it does any conversion told. // It is about basic type, not about shape. // The policy comes from the shader or the calling code. -TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped* node) const +TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped* node) const { // // Add a new newNode for the conversion. @@ -712,7 +712,11 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped TType newType(convertTo, EvqTemporary, node->getVectorSize(), node->getMatrixCols(), node->getMatrixRows()); newNode = addUnaryNode(newOp, node, node->getLoc(), newType); - // TODO: it seems that some unary folding operations should occur here, but are not + if (node->getAsConstantUnion()) { + TIntermTyped* folded = node->getAsConstantUnion()->fold(newOp, newType); + if (folded) + return folded; + } // Propagate specialization-constant-ness, if allowed if (node->getType().getQualifier().isSpecConstant() && isSpecializationOperation(*newNode)) @@ -903,28 +907,28 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt break; case EOpConstructFloat16: promoteTo = EbtFloat16; - canPromoteConstant = extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types) || - extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_float16); + canPromoteConstant = extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types) || + extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types_float16); break; case EOpConstructInt8: promoteTo = EbtInt8; - canPromoteConstant = extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types) || - extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_int8); + canPromoteConstant = extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types) || + extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types_int8); break; case EOpConstructUint8: promoteTo = EbtUint8; - canPromoteConstant = extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types) || - extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_int8); + canPromoteConstant = extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types) || + extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types_int8); break; case EOpConstructInt16: promoteTo = EbtInt16; - canPromoteConstant = extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types) || - extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_int16); + canPromoteConstant = extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types) || + extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types_int16); break; case EOpConstructUint16: promoteTo = EbtUint16; - canPromoteConstant = extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types) || - extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_int16); + canPromoteConstant = extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types) || + extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types_int16); break; case EOpConstructInt: promoteTo = EbtInt; @@ -980,6 +984,14 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EOpSequence: case EOpConstructStruct: + if (type.getBasicType() == EbtReference || node->getType().getBasicType() == EbtReference) { + // types must match to assign a reference + if (type == node->getType()) + return node; + else + return nullptr; + } + if (type.getBasicType() == node->getType().getBasicType()) return node; @@ -1021,7 +1033,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt // // Add a new newNode for the conversion. // - TIntermUnary* newNode = createConversion(promoteTo, node); + TIntermTyped* newNode = createConversion(promoteTo, node); return newNode; } @@ -1481,14 +1493,14 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat } } - bool explicitTypesEnabled = extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types) || - extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_int8) || - extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_int16) || - extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_int32) || - extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_int64) || - extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_float16) || - extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_float32) || - extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_float64); + bool explicitTypesEnabled = extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types) || + extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types_int8) || + extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types_int16) || + extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types_int32) || + extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types_int64) || + extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types_float16) || + extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types_float32) || + extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types_float64); if (explicitTypesEnabled) { // integral promotions @@ -2127,6 +2139,9 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const } } break; + case EbtReference: + op = EOpConstructReference; + break; default: break; } diff --git a/deps/glslang/glslang/MachineIndependent/ParseHelper.cpp b/deps/glslang/glslang/MachineIndependent/ParseHelper.cpp index 56b45cab..6e386589 100644 --- a/deps/glslang/glslang/MachineIndependent/ParseHelper.cpp +++ b/deps/glslang/glslang/MachineIndependent/ParseHelper.cpp @@ -1,7 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2015 LunarG, Inc. -// Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2015-2018 Google, Inc. // Copyright (C) 2017 ARM Limited. // // All rights reserved. @@ -312,9 +312,6 @@ TIntermTyped* TParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symb if (anon) { // It was a member of an anonymous container. - // The "getNumExtensions()" mechanism above doesn't yet work for block members - blockMemberExtensionCheck(loc, nullptr, *string); - // Create a subtree for its dereference. variable = anon->getAnonContainer().getAsVariable(); TIntermTyped* container = intermediate.addSymbol(*variable, loc); @@ -354,6 +351,11 @@ TIntermTyped* TParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symb if (variable->getType().getQualifier().isIo()) intermediate.addIoAccessed(*string); + if (variable->getType().getBasicType() == EbtReference && + variable->getType().getQualifier().bufferReferenceNeedsVulkanMemoryModel()) { + intermediate.setUseVulkanMemoryModel(); + } + return node; } @@ -811,8 +813,12 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm if (base->getType().getQualifier().isSpecConstant()) result->getWritableType().getQualifier().makeSpecConstant(); } - } else if (base->getBasicType() == EbtStruct || base->getBasicType() == EbtBlock) { - const TTypeList* fields = base->getType().getStruct(); + } else if (base->getBasicType() == EbtStruct || + base->getBasicType() == EbtBlock || + base->getBasicType() == EbtReference) { + const TTypeList* fields = base->getBasicType() == EbtReference ? + base->getType().getReferentType()->getStruct() : + base->getType().getStruct(); bool fieldFound = false; int member; for (member = 0; member < (int)fields->size(); ++member) { @@ -825,7 +831,7 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm if (base->getType().getQualifier().isFrontEndConstant()) result = intermediate.foldDereference(base, member, loc); else { - blockMemberExtensionCheck(loc, base, field); + blockMemberExtensionCheck(loc, base, member, field); TIntermTyped* index = intermediate.addConstantUnion(member, loc); result = intermediate.addIndex(EOpIndexDirectStruct, base, index, loc); result->setType(*(*fields)[member].type); @@ -848,14 +854,30 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm return result; } -void TParseContext::blockMemberExtensionCheck(const TSourceLoc& loc, const TIntermTyped* /*base*/, const TString& field) +void TParseContext::blockMemberExtensionCheck(const TSourceLoc& loc, const TIntermTyped* base, int member, const TString& memberName) { - if (profile == EEsProfile && field == "gl_PointSize") { - if (language == EShLangGeometry) - requireExtensions(loc, Num_AEP_geometry_point_size, AEP_geometry_point_size, "gl_PointSize"); - else if (language == EShLangTessControl || language == EShLangTessEvaluation) - requireExtensions(loc, Num_AEP_tessellation_point_size, AEP_tessellation_point_size, "gl_PointSize"); - } + // a block that needs extension checking is either 'base', or if arrayed, + // one level removed to the left + const TIntermSymbol* baseSymbol = nullptr; + if (base->getAsBinaryNode() == nullptr) + baseSymbol = base->getAsSymbolNode(); + else + baseSymbol = base->getAsBinaryNode()->getLeft()->getAsSymbolNode(); + if (baseSymbol == nullptr) + return; + const TSymbol* symbol = symbolTable.find(baseSymbol->getName()); + if (symbol == nullptr) + return; + const TVariable* variable = symbol->getAsVariable(); + if (variable == nullptr) + return; + if (!variable->hasMemberExtensions()) + return; + + // We now have a variable that is the base of a dot reference + // with members that need extension checking. + if (variable->getNumMemberExtensions(member) > 0) + requireExtensions(loc, variable->getNumMemberExtensions(member), variable->getMemberExtensions(member), memberName.c_str()); } // @@ -1998,6 +2020,10 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan case EOpSubgroupClusteredAnd: case EOpSubgroupClusteredOr: case EOpSubgroupClusteredXor: + // The as used in the subgroupClustered() operations must be: + // - An integral constant expression. + // - At least 1. + // - A power of 2. if ((*argp)[1]->getAsConstantUnion() == nullptr) error(loc, "argument must be compile-time constant", "cluster size", ""); else { @@ -2009,6 +2035,12 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan } break; + case EOpSubgroupBroadcast: + // must be an integral constant expression. + if ((*argp)[1]->getAsConstantUnion() == nullptr) + error(loc, "argument must be compile-time constant", "id", ""); + break; + case EOpBarrier: case EOpMemoryBarrier: if (argp->size() > 0) { @@ -2376,6 +2408,10 @@ bool TParseContext::lValueErrorCheck(const TSourceLoc& loc, const char* op, TInt } } + if (binaryNode && binaryNode->getOp() == EOpIndexDirectStruct && + binaryNode->getLeft()->getBasicType() == EbtReference) + return false; + // Let the base class check errors if (TParseContextBase::lValueErrorCheck(loc, op, node)) return true; @@ -2970,6 +3006,9 @@ void TParseContext::samplerCheck(const TSourceLoc& loc, const TType& type, const requireExtensions(loc, 1, &E_GL_OES_EGL_image_external_essl3, "samplerExternalOES"); } } + if (type.getSampler().yuv) { + requireExtensions(loc, 1, &E_GL_EXT_YUV_target, "__samplerExternal2DY2YEXT"); + } if (type.getQualifier().storage == EvqUniform) return; @@ -3086,13 +3125,17 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali if (! symbolTable.atGlobalLevel()) return; - if (qualifier.isMemoryQualifierImageAndSSBOOnly() && ! publicType.isImage() && publicType.qualifier.storage != EvqBuffer) { - error(loc, "memory qualifiers cannot be used on this type", "", ""); - } else if (qualifier.isMemory() && (publicType.basicType != EbtSampler) && !publicType.qualifier.isUniformOrBuffer()) { - error(loc, "memory qualifiers cannot be used on this type", "", ""); + if (!(publicType.userDef && publicType.userDef->getBasicType() == EbtReference)) { + if (qualifier.isMemoryQualifierImageAndSSBOOnly() && ! publicType.isImage() && publicType.qualifier.storage != EvqBuffer) { + error(loc, "memory qualifiers cannot be used on this type", "", ""); + } else if (qualifier.isMemory() && (publicType.basicType != EbtSampler) && !publicType.qualifier.isUniformOrBuffer()) { + error(loc, "memory qualifiers cannot be used on this type", "", ""); + } } - if (qualifier.storage == EvqBuffer && publicType.basicType != EbtBlock) + if (qualifier.storage == EvqBuffer && + publicType.basicType != EbtBlock && + !qualifier.layoutBufferReference) error(loc, "buffers can be declared only as blocks", "buffer", ""); if (qualifier.storage != EvqVaryingIn && qualifier.storage != EvqVaryingOut) @@ -3750,6 +3793,21 @@ void TParseContext::checkRuntimeSizable(const TSourceLoc& loc, const TIntermType if (isRuntimeLength(base)) return; + // Check for last member of a bufferreference type, which is runtime sizeable + // but doesn't support runtime length + if (base.getType().getQualifier().storage == EvqBuffer) { + const TIntermBinary* binary = base.getAsBinaryNode(); + if (binary != nullptr && + binary->getOp() == EOpIndexDirectStruct && + binary->getLeft()->getBasicType() == EbtReference) { + + const int index = binary->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst(); + const int memberCount = (int)binary->getLeft()->getType().getReferentType()->getStruct()->size(); + if (index == memberCount - 1) + return; + } + } + // check for additional things allowed by GL_EXT_nonuniform_qualifier if (base.getBasicType() == EbtSampler || (base.getBasicType() == EbtBlock && base.getType().getQualifier().isUniformOrBuffer())) @@ -3767,6 +3825,10 @@ bool TParseContext::isRuntimeLength(const TIntermTyped& base) const if (binary != nullptr && binary->getOp() == EOpIndexDirectStruct) { // is it the last member? const int index = binary->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst(); + + if (binary->getLeft()->getBasicType() == EbtReference) + return false; + const int memberCount = (int)binary->getLeft()->getType().getStruct()->size(); if (index == memberCount - 1) return true; @@ -4049,6 +4111,8 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT if (currentBlockQualifier.storage == EvqVaryingOut && globalOutputDefaults.hasXfbBuffer()) { if (!currentBlockQualifier.hasXfbBuffer()) currentBlockQualifier.layoutXfbBuffer = globalOutputDefaults.layoutXfbBuffer; + if (!currentBlockQualifier.hasStream()) + currentBlockQualifier.layoutStream = globalOutputDefaults.layoutStream; fixXfbOffsets(currentBlockQualifier, newTypeList); } @@ -4131,6 +4195,9 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT if (newType.getQualifier().hasXfbBuffer() && newType.getQualifier().layoutXfbBuffer != currentBlockQualifier.layoutXfbBuffer) error(memberLoc, "member cannot contradict block (or what block inherited from global)", "xfb_buffer", ""); + if (newType.getQualifier().hasStream() && + newType.getQualifier().layoutStream != currentBlockQualifier.layoutStream) + error(memberLoc, "member cannot contradict block (or what block inherited from global)", "xfb_stream", ""); oldType.getQualifier().centroid = newType.getQualifier().centroid; oldType.getQualifier().sample = newType.getQualifier().sample; oldType.getQualifier().invariant = newType.getQualifier().invariant; @@ -4142,8 +4209,8 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT oldType.getQualifier().layoutXfbBuffer = newType.getQualifier().layoutXfbBuffer; oldType.getQualifier().layoutXfbStride = newType.getQualifier().layoutXfbStride; if (oldType.getQualifier().layoutXfbOffset != TQualifier::layoutXfbBufferEnd) { - // if any member as an xfb_offset, then the block's xfb_buffer inherents current xfb_buffer, - // and for xfb processing, the member needs it as well, along with xfb_stride + // If any member has an xfb_offset, then the block's xfb_buffer inherents current xfb_buffer, + // and for xfb processing, the member needs it as well, along with xfb_stride. type.getQualifier().layoutXfbBuffer = currentBlockQualifier.layoutXfbBuffer; oldType.getQualifier().layoutXfbBuffer = currentBlockQualifier.layoutXfbBuffer; } @@ -4168,6 +4235,11 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT } } + if (spvVersion.vulkan > 0) { + // ...then streams apply to built-in blocks, instead of them being only on stream 0 + type.getQualifier().layoutStream = currentBlockQualifier.layoutStream; + } + if (numOriginalMembersFound < newTypeList.size()) error(loc, "block redeclaration has extra members", blockName.c_str(), ""); if (type.isArray() != (arraySizes != nullptr) || @@ -4611,6 +4683,12 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi publicType.qualifier.layoutPacking = ElpStd430; return; } + if (id == TQualifier::getLayoutPackingString(ElpScalar)) { + requireVulkan(loc, "scalar"); + requireExtensions(loc, 1, &E_GL_EXT_scalar_block_layout, "scalar block layout"); + publicType.qualifier.layoutPacking = ElpScalar; + return; + } // TODO: compile-time performance: may need to stop doing linear searches for (TLayoutFormat format = (TLayoutFormat)(ElfNone + 1); format < ElfCount; format = (TLayoutFormat)(format + 1)) { if (id == TQualifier::getLayoutFormatString(format)) { @@ -4629,6 +4707,14 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi publicType.qualifier.layoutPushConstant = true; return; } + if (id == "buffer_reference") { + requireVulkan(loc, "buffer_reference"); + requireExtensions(loc, 1, &E_GL_EXT_buffer_reference, "buffer_reference"); + publicType.qualifier.layoutBufferReference = true; + intermediate.setUseStorageBuffer(); + intermediate.setUsePhysicalStorageBuffer(); + return; + } if (language == EShLangGeometry || language == EShLangTessEvaluation #ifdef NV_EXTENSIONS || language == EShLangMeshNV @@ -4936,11 +5022,13 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi } else if (id == "xfb_stride") { // "The resulting stride (implicit or explicit), when divided by 4, must be less than or equal to the // implementation-dependent constant gl_MaxTransformFeedbackInterleavedComponents." - if (value > 4 * resources.maxTransformFeedbackInterleavedComponents) - error(loc, "1/4 stride is too large:", id.c_str(), "gl_MaxTransformFeedbackInterleavedComponents is %d", resources.maxTransformFeedbackInterleavedComponents); - else if (value >= (int)TQualifier::layoutXfbStrideEnd) + if (value > 4 * resources.maxTransformFeedbackInterleavedComponents) { + error(loc, "1/4 stride is too large:", id.c_str(), "gl_MaxTransformFeedbackInterleavedComponents is %d", + resources.maxTransformFeedbackInterleavedComponents); + } + if (value >= (int)TQualifier::layoutXfbStrideEnd) error(loc, "stride is too large:", id.c_str(), "internal max is %d", TQualifier::layoutXfbStrideEnd-1); - if (value < (int)TQualifier::layoutXfbStrideEnd) + else publicType.qualifier.layoutXfbStride = value; return; } @@ -4985,6 +5073,15 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi } #endif + if (id == "buffer_reference_align") { + requireExtensions(loc, 1, &E_GL_EXT_buffer_reference, "buffer_reference_align"); + if (! IsPow2(value)) + error(loc, "must be a power of 2", "buffer_reference_align", ""); + else + publicType.qualifier.layoutBufferReferenceAlign = (unsigned int)std::log2(value); + return; + } + switch (language) { case EShLangVertex: break; @@ -5149,6 +5246,9 @@ void TParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifie if (src.hasAlign()) dst.layoutAlign = src.layoutAlign; + if (src.hasBufferReferenceAlign()) + dst.layoutBufferReferenceAlign = src.layoutBufferReferenceAlign; + if (! inheritOnly) { if (src.hasLocation()) dst.layoutLocation = src.layoutLocation; @@ -5177,6 +5277,9 @@ void TParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifie if (src.layoutPushConstant) dst.layoutPushConstant = true; + if (src.layoutBufferReference) + dst.layoutBufferReference = true; + #ifdef NV_EXTENSIONS if (src.layoutPassthrough) dst.layoutPassthrough = true; @@ -5360,14 +5463,23 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) // "The offset must be a multiple of the size of the first component of the first // qualified variable or block member, or a compile-time error results. Further, if applied to an aggregate - // containing a double, the offset must also be a multiple of 8..." - if (type.containsBasicType(EbtDouble) && ! IsMultipleOfPow2(qualifier.layoutXfbOffset, 8)) - error(loc, "type contains double; xfb_offset must be a multiple of 8", "xfb_offset", ""); - // ..., if applied to an aggregate containing a float16_t, the offset must also be a multiple of 2..." - else if (type.containsBasicType(EbtFloat16) && !IsMultipleOfPow2(qualifier.layoutXfbOffset, 2)) - error(loc, "type contains half float; xfb_offset must be a multiple of 2", "xfb_offset", ""); + // containing a double or 64-bit integer, the offset must also be a multiple of 8..." + if ((type.containsBasicType(EbtDouble) || type.containsBasicType(EbtInt64) || type.containsBasicType(EbtUint64)) && + ! IsMultipleOfPow2(qualifier.layoutXfbOffset, 8)) + error(loc, "type contains double or 64-bit integer; xfb_offset must be a multiple of 8", "xfb_offset", ""); +#ifdef AMD_EXTENSIONS + else if ((type.containsBasicType(EbtBool) || type.containsBasicType(EbtFloat) || + type.containsBasicType(EbtInt) || type.containsBasicType(EbtUint)) && + ! IsMultipleOfPow2(qualifier.layoutXfbOffset, 4)) + error(loc, "must be a multiple of size of first component", "xfb_offset", ""); + // ..., if applied to an aggregate containing a half float or 16-bit integer, the offset must also be a multiple of 2..." + else if ((type.containsBasicType(EbtFloat16) || type.containsBasicType(EbtInt16) || type.containsBasicType(EbtUint16)) && + !IsMultipleOfPow2(qualifier.layoutXfbOffset, 2)) + error(loc, "type contains half float or 16-bit integer; xfb_offset must be a multiple of 2", "xfb_offset", ""); +#else else if (! IsMultipleOfPow2(qualifier.layoutXfbOffset, 4)) error(loc, "must be a multiple of size of first component", "xfb_offset", ""); +#endif } if (qualifier.hasXfbStride() && qualifier.hasXfbBuffer()) { @@ -5424,7 +5536,8 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) #ifdef NV_EXTENSIONS !qualifier.layoutShaderRecordNV && #endif - !qualifier.layoutAttachment) + !qualifier.layoutAttachment && + !qualifier.layoutBufferReference) error(loc, "uniform/buffer blocks require layout(binding=X)", "binding", ""); else if (spvVersion.vulkan > 0 && type.getBasicType() == EbtSampler) error(loc, "sampler/texture/image requires layout(binding=X)", "binding", ""); @@ -5476,6 +5589,9 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) if (qualifier.layoutPushConstant && type.getBasicType() != EbtBlock) error(loc, "can only be used with a block", "push_constant", ""); + if (qualifier.layoutBufferReference && type.getBasicType() != EbtBlock) + error(loc, "can only be used with a block", "buffer_reference", ""); + #ifdef NV_EXTENSIONS if (qualifier.layoutShaderRecordNV && type.getBasicType() != EbtBlock) error(loc, "can only be used with a block", "shaderRecordNV", ""); @@ -5616,6 +5732,10 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier if (qualifier.hasSet()) error(loc, "cannot be used with push_constant", "set", ""); } + if (qualifier.layoutBufferReference) { + if (qualifier.storage != EvqBuffer) + error(loc, "can only be used with buffer", "buffer_reference", ""); + } #ifdef NV_EXTENSIONS if (qualifier.layoutShaderRecordNV) { if (qualifier.storage != EvqBuffer) @@ -5732,14 +5852,14 @@ const TFunction* TParseContext::findFunction(const TSourceLoc& loc, const TFunct return nullptr; } - bool explicitTypesEnabled = extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || - extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int8) || - extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int16) || - extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int32) || - extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int64) || - extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float16) || - extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float32) || - extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float64); + bool explicitTypesEnabled = extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || + extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int8) || + extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int16) || + extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int32) || + extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int64) || + extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float16) || + extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float32) || + extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float64); if (profile == EEsProfile || version < 120) function = findFunctionExact(loc, call, builtIn); @@ -6023,7 +6143,7 @@ void TParseContext::declareTypeDefaults(const TSourceLoc& loc, const TPublicType return; } - if (publicType.qualifier.hasLayout()) + if (publicType.qualifier.hasLayout() && !publicType.qualifier.layoutBufferReference) warn(loc, "useless application of layout qualifier", "layout", ""); } @@ -6124,11 +6244,6 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden // fix up fixOffset(loc, *symbol); - if (symbol->getType().getBasicType() == EbtStruct) { - fixXfbOffsets(symbol->getWritableType().getQualifier(), - *(symbol->getWritableType().getWritableStruct())); - } - return initNode; } @@ -6631,10 +6746,15 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T basicOp = EOpConstructInt64; break; + case EOpConstructUint64: + if (type.isScalar() && node->getType().getBasicType() == EbtReference) { + TIntermUnary* newNode = intermediate.addUnaryNode(EOpConvPtrToUint64, node, node->getLoc(), type); + return newNode; + } + // fall through case EOpConstructU64Vec2: case EOpConstructU64Vec3: case EOpConstructU64Vec4: - case EOpConstructUint64: basicOp = EOpConstructUint64; break; @@ -6650,6 +6770,19 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T return node; break; + case EOpConstructReference: + // construct reference from reference + if (node->getType().getBasicType() == EbtReference) { + newNode = intermediate.addUnaryNode(EOpConstructReference, node, node->getLoc(), type); + return newNode; + // construct reference from uint64 + } else if (node->getType().isScalar() && node->getType().getBasicType() == EbtUint64) { + TIntermUnary* newNode = intermediate.addUnaryNode(EOpConvUint64ToPtr, node, node->getLoc(), type); + return newNode; + } else { + return nullptr; + } + default: error(loc, "unsupported construction", "", ""); @@ -6784,8 +6917,10 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con // "The align qualifier can only be used on blocks or block members, and only for blocks declared with std140 or std430 layouts." if (currentBlockQualifier.hasAlign()) { - if (defaultQualification.layoutPacking != ElpStd140 && defaultQualification.layoutPacking != ElpStd430) { - error(loc, "can only be used with std140 or std430 layout packing", "align", ""); + if (defaultQualification.layoutPacking != ElpStd140 && + defaultQualification.layoutPacking != ElpStd430 && + defaultQualification.layoutPacking != ElpScalar) { + error(loc, "can only be used with std140, std430, or scalar layout packing", "align", ""); defaultQualification.layoutAlign = -1; } } @@ -6834,8 +6969,10 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con // "The offset qualifier can only be used on block members of blocks declared with std140 or std430 layouts." // "The align qualifier can only be used on blocks or block members, and only for blocks declared with std140 or std430 layouts." if (memberQualifier.hasAlign() || memberQualifier.hasOffset()) { - if (defaultQualification.layoutPacking != ElpStd140 && defaultQualification.layoutPacking != ElpStd430) - error(memberLoc, "can only be used with std140 or std430 layout packing", "offset/align", ""); + if (defaultQualification.layoutPacking != ElpStd140 && + defaultQualification.layoutPacking != ElpStd430 && + defaultQualification.layoutPacking != ElpScalar) + error(memberLoc, "can only be used with std140, std430, or scalar layout packing", "offset/align", ""); } #ifdef NV_EXTENSIONS @@ -6851,6 +6988,16 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con layoutMemberLocationArrayCheck(loc, memberWithLocation, arraySizes); + // Ensure that the block has an XfbBuffer assigned. This is needed + // because if the block has a XfbOffset assigned, then it is + // assumed that it has implicitly assigned the current global + // XfbBuffer, and because it's members need to be assigned a + // XfbOffset if they lack it. + if (currentBlockQualifier.storage == EvqVaryingOut && globalOutputDefaults.hasXfbBuffer()) { + if (!currentBlockQualifier.hasXfbBuffer() && currentBlockQualifier.hasXfbOffset()) + currentBlockQualifier.layoutXfbBuffer = globalOutputDefaults.layoutXfbBuffer; + } + // Process the members fixBlockLocations(loc, currentBlockQualifier, typeList, memberWithLocation, memberWithoutLocation); fixXfbOffsets(currentBlockQualifier, typeList); @@ -6880,32 +7027,58 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con else ioArrayCheck(loc, blockType, instanceName ? *instanceName : *blockName); - // - // Don't make a user-defined type out of block name; that will cause an error - // if the same block name gets reused in a different interface. - // - // "Block names have no other use within a shader - // beyond interface matching; it is a compile-time error to use a block name at global scope for anything - // other than as a block name (e.g., use of a block name for a global variable name or function name is - // currently reserved)." - // - // Use the symbol table to prevent normal reuse of the block's name, as a variable entry, - // whose type is EbtBlock, but without all the structure; that will come from the type - // the instances point to. - // - TType blockNameType(EbtBlock, blockType.getQualifier().storage); - TVariable* blockNameVar = new TVariable(blockName, blockNameType); - if (! symbolTable.insert(*blockNameVar)) { - TSymbol* existingName = symbolTable.find(*blockName); - if (existingName->getType().getBasicType() == EbtBlock) { - if (existingName->getType().getQualifier().storage == blockType.getQualifier().storage) { - error(loc, "Cannot reuse block name within the same interface:", blockName->c_str(), blockType.getStorageQualifierString()); - return; + if (currentBlockQualifier.layoutBufferReference) { + + if (currentBlockQualifier.storage != EvqBuffer) + error(loc, "can only be used with buffer", "buffer_reference", ""); + + // Create the block reference type. If it was forward-declared, detect that + // as a referent struct type with no members. Replace the referent type with + // blockType. + TType blockNameType(EbtReference, blockType, *blockName); + TVariable* blockNameVar = new TVariable(blockName, blockNameType, true); + if (! symbolTable.insert(*blockNameVar)) { + TSymbol* existingName = symbolTable.find(*blockName); + if (existingName->getType().getBasicType() == EbtReference && + existingName->getType().getReferentType()->getStruct() && + existingName->getType().getReferentType()->getStruct()->size() == 0 && + existingName->getType().getQualifier().storage == blockType.getQualifier().storage) { + existingName->getType().getReferentType()->deepCopy(blockType); + } else { + error(loc, "block name cannot be redefined", blockName->c_str(), ""); } - } else { - error(loc, "block name cannot redefine a non-block name", blockName->c_str(), ""); + } + if (!instanceName) { return; } + } else { + // + // Don't make a user-defined type out of block name; that will cause an error + // if the same block name gets reused in a different interface. + // + // "Block names have no other use within a shader + // beyond interface matching; it is a compile-time error to use a block name at global scope for anything + // other than as a block name (e.g., use of a block name for a global variable name or function name is + // currently reserved)." + // + // Use the symbol table to prevent normal reuse of the block's name, as a variable entry, + // whose type is EbtBlock, but without all the structure; that will come from the type + // the instances point to. + // + TType blockNameType(EbtBlock, blockType.getQualifier().storage); + TVariable* blockNameVar = new TVariable(blockName, blockNameType); + if (! symbolTable.insert(*blockNameVar)) { + TSymbol* existingName = symbolTable.find(*blockName); + if (existingName->getType().getBasicType() == EbtBlock) { + if (existingName->getType().getQualifier().storage == blockType.getQualifier().storage) { + error(loc, "Cannot reuse block name within the same interface:", blockName->c_str(), blockType.getStorageQualifierString()); + return; + } + } else { + error(loc, "block name cannot redefine a non-block name", blockName->c_str(), ""); + return; + } + } } // Add the variable, as anonymous or named instanceName. @@ -6946,7 +7119,7 @@ void TParseContext::blockStageIoCheck(const TSourceLoc& loc, const TQualifier& q profileRequires(loc, EEsProfile, 300, nullptr, "uniform block"); profileRequires(loc, ENoProfile, 140, nullptr, "uniform block"); if (currentBlockQualifier.layoutPacking == ElpStd430 && ! currentBlockQualifier.layoutPushConstant) - error(loc, "requires the 'buffer' storage qualifier", "std430", ""); + requireExtensions(loc, 1, &E_GL_EXT_scalar_block_layout, "std430 requires the buffer storage qualifier"); break; case EvqBuffer: requireProfile(loc, EEsProfile | ECoreProfile | ECompatibilityProfile, "buffer block"); @@ -7117,13 +7290,25 @@ void TParseContext::fixXfbOffsets(TQualifier& qualifier, TTypeList& typeList) int nextOffset = qualifier.layoutXfbOffset; for (unsigned int member = 0; member < typeList.size(); ++member) { TQualifier& memberQualifier = typeList[member].type->getQualifier(); - bool containsDouble = false; - int memberSize = intermediate.computeTypeXfbSize(*typeList[member].type, containsDouble); + bool contains64BitType = false; +#ifdef AMD_EXTENSIONS + bool contains32BitType = false; + bool contains16BitType = false; + int memberSize = intermediate.computeTypeXfbSize(*typeList[member].type, contains64BitType, contains32BitType, contains16BitType); +#else + int memberSize = intermediate.computeTypeXfbSize(*typeList[member].type, contains64BitType); +#endif // see if we need to auto-assign an offset to this member if (! memberQualifier.hasXfbOffset()) { - // "if applied to an aggregate containing a double, the offset must also be a multiple of 8" - if (containsDouble) + // "if applied to an aggregate containing a double or 64-bit integer, the offset must also be a multiple of 8" + if (contains64BitType) RoundToPow2(nextOffset, 8); +#ifdef AMD_EXTENSIONS + else if (contains32BitType) + RoundToPow2(nextOffset, 4); + else if (contains16BitType) + RoundToPow2(nextOffset, 2); +#endif memberQualifier.layoutXfbOffset = nextOffset; } else nextOffset = memberQualifier.layoutXfbOffset; @@ -7145,7 +7330,7 @@ void TParseContext::fixBlockUniformOffsets(TQualifier& qualifier, TTypeList& typ { if (!qualifier.isUniformOrBuffer() && !qualifier.isTaskMemory()) return; - if (qualifier.layoutPacking != ElpStd140 && qualifier.layoutPacking != ElpStd430) + if (qualifier.layoutPacking != ElpStd140 && qualifier.layoutPacking != ElpStd430 && qualifier.layoutPacking != ElpScalar) return; int offset = 0; @@ -7159,8 +7344,8 @@ void TParseContext::fixBlockUniformOffsets(TQualifier& qualifier, TTypeList& typ // modify just the children's view of matrix layout, if there is one for this member TLayoutMatrix subMatrixLayout = typeList[member].type->getQualifier().layoutMatrix; int dummyStride; - int memberAlignment = intermediate.getBaseAlignment(*typeList[member].type, memberSize, dummyStride, qualifier.layoutPacking == ElpStd140, - subMatrixLayout != ElmNone ? subMatrixLayout == ElmRowMajor : qualifier.layoutMatrix == ElmRowMajor); + int memberAlignment = intermediate.getMemberAlignment(*typeList[member].type, memberSize, dummyStride, qualifier.layoutPacking, + subMatrixLayout != ElmNone ? subMatrixLayout == ElmRowMajor : qualifier.layoutMatrix == ElmRowMajor); if (memberQualifier.hasOffset()) { // "The specified offset must be a multiple // of the base alignment of the type of the block member it qualifies, or a compile-time error results." @@ -7204,6 +7389,22 @@ void TParseContext::fixBlockUniformOffsets(TQualifier& qualifier, TTypeList& typ void TParseContext::addQualifierToExisting(const TSourceLoc& loc, TQualifier qualifier, const TString& identifier) { TSymbol* symbol = symbolTable.find(identifier); + + // A forward declaration of a block reference looks to the grammar like adding + // a qualifier to an existing symbol. Detect this and create the block reference + // type with an empty type list, which will be filled in later in + // TParseContext::declareBlock. + if (!symbol && qualifier.layoutBufferReference) { + TTypeList typeList; + TType blockType(&typeList, identifier, qualifier);; + TType blockNameType(EbtReference, blockType, identifier); + TVariable* blockNameVar = new TVariable(&identifier, blockNameType, true); + if (! symbolTable.insert(*blockNameVar)) { + error(loc, "block name cannot redefine a non-block name", blockName->c_str(), ""); + } + return; + } + if (! symbol) { error(loc, "identifier not previously declared", identifier.c_str(), ""); return; @@ -7538,6 +7739,8 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con error(loc, "cannot declare a default, use a full declaration", "xfb_offset", ""); if (qualifier.layoutPushConstant) error(loc, "cannot declare a default, can only be used on a block", "push_constant", ""); + if (qualifier.layoutBufferReference) + error(loc, "cannot declare a default, can only be used on a block", "buffer_reference", ""); if (qualifier.hasSpecConstantId()) error(loc, "cannot declare a default, can only be used on a scalar", "constant_id", ""); #ifdef NV_EXTENSIONS diff --git a/deps/glslang/glslang/MachineIndependent/ParseHelper.h b/deps/glslang/glslang/MachineIndependent/ParseHelper.h index 14421a26..5b7d430c 100644 --- a/deps/glslang/glslang/MachineIndependent/ParseHelper.h +++ b/deps/glslang/glslang/MachineIndependent/ParseHelper.h @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. // // All rights reserved. // @@ -305,7 +306,7 @@ class TParseContext : public TParseContextBase { TIntermTyped* handleBinaryMath(const TSourceLoc&, const char* str, TOperator op, TIntermTyped* left, TIntermTyped* right); TIntermTyped* handleUnaryMath(const TSourceLoc&, const char* str, TOperator op, TIntermTyped* childNode); TIntermTyped* handleDotDereference(const TSourceLoc&, TIntermTyped* base, const TString& field); - void blockMemberExtensionCheck(const TSourceLoc&, const TIntermTyped* base, const TString& field); + void blockMemberExtensionCheck(const TSourceLoc&, const TIntermTyped* base, int member, const TString& memberName); TFunction* handleFunctionDeclarator(const TSourceLoc&, TFunction& function, bool prototype); TIntermAggregate* handleFunctionDefinition(const TSourceLoc&, TFunction&); TIntermTyped* handleFunctionCall(const TSourceLoc&, TFunction*, TIntermNode*); diff --git a/deps/glslang/glslang/MachineIndependent/Scan.cpp b/deps/glslang/glslang/MachineIndependent/Scan.cpp index 4d2db385..49ce0770 100644 --- a/deps/glslang/glslang/MachineIndependent/Scan.cpp +++ b/deps/glslang/glslang/MachineIndependent/Scan.cpp @@ -471,7 +471,7 @@ void TScanContext::fillInKeywordMap() (*KeywordMap)["u64vec3"] = U64VEC3; (*KeywordMap)["u64vec4"] = U64VEC4; - // GL_KHX_shader_explicit_arithmetic_types + // GL_EXT_shader_explicit_arithmetic_types (*KeywordMap)["int8_t"] = INT8_T; (*KeywordMap)["i8vec2"] = I8VEC2; (*KeywordMap)["i8vec3"] = I8VEC3; @@ -592,6 +592,8 @@ void TScanContext::fillInKeywordMap() (*KeywordMap)["samplerExternalOES"] = SAMPLEREXTERNALOES; // GL_OES_EGL_image_external + (*KeywordMap)["__samplerExternal2DY2YEXT"] = SAMPLEREXTERNAL2DY2YEXT; // GL_EXT_YUV_target + (*KeywordMap)["sampler"] = SAMPLER; (*KeywordMap)["samplerShadow"] = SAMPLERSHADOW; @@ -776,7 +778,7 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token) loc = ppToken.loc; parserToken->sType.lex.loc = loc; switch (token) { - case ';': afterType = false; return SEMICOLON; + case ';': afterType = false; afterBuffer = false; return SEMICOLON; case ',': afterType = false; return COMMA; case ':': return COLON; case '=': afterType = false; return EQUAL; @@ -798,7 +800,7 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token) case '?': return QUESTION; case '[': return LEFT_BRACKET; case ']': return RIGHT_BRACKET; - case '{': afterStruct = false; return LEFT_BRACE; + case '{': afterStruct = false; afterBuffer = false; return LEFT_BRACE; case '}': return RIGHT_BRACE; case '\\': parseContext.error(loc, "illegal use of escape character", "\\", ""); @@ -945,6 +947,7 @@ int TScanContext::tokenizeIdentifier() return keyword; case BUFFER: + afterBuffer = true; if ((parseContext.profile == EEsProfile && parseContext.version < 310) || (parseContext.profile != EEsProfile && parseContext.version < 430)) return identifierOrType(); @@ -1133,8 +1136,8 @@ int TScanContext::tokenizeIdentifier() if (parseContext.symbolTable.atBuiltInLevel() || (parseContext.profile != EEsProfile && parseContext.version >= 450 && (parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_int64) || - parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || - parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int64)))) + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int64)))) return keyword; return identifierOrType(); @@ -1148,9 +1151,9 @@ int TScanContext::tokenizeIdentifier() case U8VEC4: afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || - ((parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || + ((parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || parseContext.extensionTurnedOn(E_GL_EXT_shader_8bit_storage) || - parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int8)) && + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int8)) && parseContext.profile != EEsProfile && parseContext.version >= 450)) return keyword; return identifierOrType(); @@ -1171,8 +1174,8 @@ int TScanContext::tokenizeIdentifier() parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_int16) || #endif parseContext.extensionTurnedOn(E_GL_EXT_shader_16bit_storage) || - parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || - parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int16)))) + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int16)))) return keyword; return identifierOrType(); case INT32_T: @@ -1185,8 +1188,8 @@ int TScanContext::tokenizeIdentifier() case U32VEC4: afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || - ((parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || - parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_int32)) && + ((parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int32)) && parseContext.profile != EEsProfile && parseContext.version >= 450)) return keyword; return identifierOrType(); @@ -1208,8 +1211,8 @@ int TScanContext::tokenizeIdentifier() case F32MAT4X4: afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || - ((parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || - parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float32)) && + ((parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float32)) && parseContext.profile != EEsProfile && parseContext.version >= 450)) return keyword; return identifierOrType(); @@ -1232,8 +1235,8 @@ int TScanContext::tokenizeIdentifier() case F64MAT4X4: afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || - ((parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || - parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float64)) && + ((parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float64)) && parseContext.profile != EEsProfile && parseContext.version >= 450)) return keyword; return identifierOrType(); @@ -1250,8 +1253,8 @@ int TScanContext::tokenizeIdentifier() parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float) || #endif parseContext.extensionTurnedOn(E_GL_EXT_shader_16bit_storage) || - parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || - parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float16)))) + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float16)))) return keyword; return identifierOrType(); @@ -1275,8 +1278,8 @@ int TScanContext::tokenizeIdentifier() #ifdef AMD_EXTENSIONS parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float) || #endif - parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || - parseContext.extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types_float16)))) + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float16)))) return keyword; return identifierOrType(); @@ -1409,6 +1412,13 @@ int TScanContext::tokenizeIdentifier() return keyword; return identifierOrType(); + case SAMPLEREXTERNAL2DY2YEXT: + afterType = true; + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_YUV_target)) + return keyword; + return identifierOrType(); + case TEXTURE2D: case TEXTURECUBE: case TEXTURECUBEARRAY: @@ -1617,7 +1627,9 @@ int TScanContext::identifierOrType() parserToken->sType.lex.symbol = parseContext.symbolTable.find(*parserToken->sType.lex.string); if ((afterType == false && afterStruct == false) && parserToken->sType.lex.symbol != nullptr) { if (const TVariable* variable = parserToken->sType.lex.symbol->getAsVariable()) { - if (variable->isUserType()) { + if (variable->isUserType() && + // treat redeclaration of forward-declared buffer/uniform reference as an identifier + !(variable->getType().getBasicType() == EbtReference && afterBuffer)) { afterType = true; return TYPE_NAME; diff --git a/deps/glslang/glslang/MachineIndependent/Scan.h b/deps/glslang/glslang/MachineIndependent/Scan.h index 2c26c2ef..24b75cf7 100644 --- a/deps/glslang/glslang/MachineIndependent/Scan.h +++ b/deps/glslang/glslang/MachineIndependent/Scan.h @@ -65,7 +65,7 @@ class TInputScanner { } if (names != nullptr) { for (int i = 0; i < numSources; ++i) - loc[i].name = names[i]; + loc[i].name = names[i] != nullptr ? NewPoolTString(names[i]) : nullptr; } loc[currentSource].line = 1; logicalSourceLoc.init(1); @@ -170,16 +170,18 @@ class TInputScanner { // for #line override in filename based parsing void setFile(const char* filename) { - logicalSourceLoc.name = filename; - loc[getLastValidSourceIndex()].name = filename; + TString* fn_tstr = NewPoolTString(filename); + logicalSourceLoc.name = fn_tstr; + loc[getLastValidSourceIndex()].name = fn_tstr; } void setFile(const char* filename, int i) { + TString* fn_tstr = NewPoolTString(filename); if (i == getLastValidSourceIndex()) { - logicalSourceLoc.name = filename; + logicalSourceLoc.name = fn_tstr; } - loc[i].name = filename; + loc[i].name = fn_tstr; } void setString(int newString) diff --git a/deps/glslang/glslang/MachineIndependent/ScanContext.h b/deps/glslang/glslang/MachineIndependent/ScanContext.h index 0cc7ea0a..74b2b3c7 100644 --- a/deps/glslang/glslang/MachineIndependent/ScanContext.h +++ b/deps/glslang/glslang/MachineIndependent/ScanContext.h @@ -53,7 +53,7 @@ class TScanContext { explicit TScanContext(TParseContextBase& pc) : parseContext(pc), afterType(false), afterStruct(false), - field(false) { } + field(false), afterBuffer(false) { } virtual ~TScanContext() { } static void fillInKeywordMap(); @@ -81,6 +81,7 @@ class TScanContext { bool afterType; // true if we've recognized a type, so can only be looking for an identifier bool afterStruct; // true if we've recognized the STRUCT keyword, so can only be looking for an identifier bool field; // true if we're on a field, right after a '.' + bool afterBuffer; // true if we've recognized the BUFFER keyword TSourceLoc loc; TParserToken* parserToken; TPpToken* ppToken; diff --git a/deps/glslang/glslang/MachineIndependent/ShaderLang.cpp b/deps/glslang/glslang/MachineIndependent/ShaderLang.cpp index 3c847d23..d6441ef0 100644 --- a/deps/glslang/glslang/MachineIndependent/ShaderLang.cpp +++ b/deps/glslang/glslang/MachineIndependent/ShaderLang.cpp @@ -1,7 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2013-2016 LunarG, Inc. -// Copyright (C) 2015-2017 Google, Inc. +// Copyright (C) 2015-2018 Google, Inc. // // All rights reserved. // @@ -879,8 +879,11 @@ bool ProcessDeferred( intermediate.setHlslOffsets(); if (messages & EShMsgDebugInfo) { intermediate.setSourceFile(names[numPre]); - for (int s = 0; s < numStrings; ++s) - intermediate.addSourceText(strings[numPre + s]); + for (int s = 0; s < numStrings; ++s) { + // The string may not be null-terminated, so make sure we provide + // the length along with the string. + intermediate.addSourceText(strings[numPre + s], lengths[numPre + s]); + } } SetupBuiltinSymbolTable(version, profile, spvVersion, source); @@ -1332,7 +1335,7 @@ void ShDestruct(ShHandle handle) // // Cleanup symbol tables // -int __fastcall ShFinalize() +int ShFinalize() { glslang::GetGlobalLock(); --NumberOfClients; diff --git a/deps/glslang/glslang/MachineIndependent/SymbolTable.cpp b/deps/glslang/glslang/MachineIndependent/SymbolTable.cpp index bd7d5aa0..d8d68468 100644 --- a/deps/glslang/glslang/MachineIndependent/SymbolTable.cpp +++ b/deps/glslang/glslang/MachineIndependent/SymbolTable.cpp @@ -2,6 +2,7 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. // Copyright (C) 2017 ARM Limited. +// Copyright (C) 2015-2018 Google, Inc. // // All rights reserved. // @@ -98,6 +99,8 @@ void TType::buildMangledName(TString& mangledName) const mangledName += "S"; if (sampler.external) mangledName += "E"; + if (sampler.yuv) + mangledName += "Y"; switch (sampler.dim) { case Esd1D: mangledName += "1"; break; case Esd2D: mangledName += "2"; break; @@ -286,19 +289,25 @@ TVariable::TVariable(const TVariable& copyOf) : TSymbol(copyOf) { type.deepCopy(copyOf.type); userType = copyOf.userType; - numExtensions = 0; - extensions = 0; - if (copyOf.numExtensions != 0) - setExtensions(copyOf.numExtensions, copyOf.extensions); + + // we don't support specialization-constant subtrees in cloned tables, only extensions + constSubtree = nullptr; + extensions = nullptr; + memberExtensions = nullptr; + if (copyOf.getNumExtensions() > 0) + setExtensions(copyOf.getNumExtensions(), copyOf.getExtensions()); + if (copyOf.hasMemberExtensions()) { + for (int m = 0; m < (int)copyOf.type.getStruct()->size(); ++m) { + if (copyOf.getNumMemberExtensions(m) > 0) + setMemberExtensions(m, copyOf.getNumMemberExtensions(m), copyOf.getMemberExtensions(m)); + } + } if (! copyOf.constArray.empty()) { assert(! copyOf.type.isStruct()); TConstUnionArray newArray(copyOf.constArray, 0, copyOf.constArray.size()); constArray = newArray; } - - // don't support specialization-constant subtrees in cloned tables - constSubtree = nullptr; } TVariable* TVariable::clone() const @@ -316,10 +325,9 @@ TFunction::TFunction(const TFunction& copyOf) : TSymbol(copyOf) parameters.back().copyParam(copyOf.parameters[i]); } - numExtensions = 0; - extensions = 0; - if (copyOf.extensions != 0) - setExtensions(copyOf.numExtensions, copyOf.extensions); + extensions = nullptr; + if (copyOf.getNumExtensions() > 0) + setExtensions(copyOf.getNumExtensions(), copyOf.getExtensions()); returnType.deepCopy(copyOf.returnType); mangledName = copyOf.mangledName; op = copyOf.op; @@ -358,12 +366,12 @@ TSymbolTableLevel* TSymbolTableLevel::clone() const const TAnonMember* anon = iter->second->getAsAnonMember(); if (anon) { // Insert all the anonymous members of this same container at once, - // avoid inserting the other members in the future, once this has been done, + // avoid inserting the remaining members in the future, once this has been done, // allowing them to all be part of the same new container. if (! containerCopied[anon->getAnonId()]) { TVariable* container = anon->getAnonContainer().clone(); container->changeName(NewPoolTString("")); - // insert the whole container + // insert the container and all its members symTableLevel->insert(*container, false); containerCopied[anon->getAnonId()] = true; } diff --git a/deps/glslang/glslang/MachineIndependent/SymbolTable.h b/deps/glslang/glslang/MachineIndependent/SymbolTable.h index f928b7ae..f9c19034 100644 --- a/deps/glslang/glslang/MachineIndependent/SymbolTable.h +++ b/deps/glslang/glslang/MachineIndependent/SymbolTable.h @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. // // All rights reserved. // @@ -78,10 +79,12 @@ class TVariable; class TFunction; class TAnonMember; +typedef TVector TExtensionList; + class TSymbol { public: POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) - explicit TSymbol(const TString *n) : name(n), numExtensions(0), extensions(0), writable(true) { } + explicit TSymbol(const TString *n) : name(n), extensions(0), writable(true) { } virtual TSymbol* clone() const = 0; virtual ~TSymbol() { } // rely on all symbol owned memory coming from the pool @@ -103,17 +106,16 @@ class TSymbol { virtual TType& getWritableType() = 0; virtual void setUniqueId(int id) { uniqueId = id; } virtual int getUniqueId() const { return uniqueId; } - virtual void setExtensions(int num, const char* const exts[]) + virtual void setExtensions(int numExts, const char* const exts[]) { assert(extensions == 0); - assert(num > 0); - numExtensions = num; - extensions = NewPoolObject(exts[0], num); - for (int e = 0; e < num; ++e) - extensions[e] = exts[e]; - } - virtual int getNumExtensions() const { return numExtensions; } - virtual const char** getExtensions() const { return extensions; } + assert(numExts > 0); + extensions = NewPoolObject(extensions); + for (int e = 0; e < numExts; ++e) + extensions->push_back(exts[e]); + } + virtual int getNumExtensions() const { return extensions == nullptr ? 0 : (int)extensions->size(); } + virtual const char** getExtensions() const { return extensions->data(); } virtual void dump(TInfoSink &infoSink) const = 0; virtual bool isReadOnly() const { return ! writable; } @@ -128,8 +130,7 @@ class TSymbol { // For tracking what extensions must be present // (don't use if correct version/profile is present). - int numExtensions; - const char** extensions; // an array of pointers to existing constant char strings + TExtensionList* extensions; // an array of pointers to existing constant char strings // // N.B.: Non-const functions that will be generally used should assert on this, @@ -154,7 +155,9 @@ class TVariable : public TSymbol { : TSymbol(name), userType(uT), constSubtree(nullptr), - anonId(-1) { type.shallowCopy(t); } + memberExtensions(nullptr), + anonId(-1) + { type.shallowCopy(t); } virtual TVariable* clone() const; virtual ~TVariable() { } @@ -171,6 +174,24 @@ class TVariable : public TSymbol { virtual void setAnonId(int i) { anonId = i; } virtual int getAnonId() const { return anonId; } + virtual void setMemberExtensions(int member, int numExts, const char* const exts[]) + { + assert(type.isStruct()); + assert(numExts > 0); + if (memberExtensions == nullptr) { + memberExtensions = NewPoolObject(memberExtensions); + memberExtensions->resize(type.getStruct()->size()); + } + for (int e = 0; e < numExts; ++e) + (*memberExtensions)[member].push_back(exts[e]); + } + virtual bool hasMemberExtensions() const { return memberExtensions != nullptr; } + virtual int getNumMemberExtensions(int member) const + { + return memberExtensions == nullptr ? 0 : (int)(*memberExtensions)[member].size(); + } + virtual const char** getMemberExtensions(int member) const { return (*memberExtensions)[member].data(); } + virtual void dump(TInfoSink &infoSink) const; protected: @@ -179,15 +200,14 @@ class TVariable : public TSymbol { TType type; bool userType; + // we are assuming that Pool Allocator will free the memory allocated to unionArray // when this object is destroyed - // TODO: these two should be a union - // A variable could be a compile-time constant, or a specialization - // constant, or neither, but never both. - TConstUnionArray constArray; // for compile-time constant value - TIntermTyped* constSubtree; // for specialization constant computation - int anonId; // the ID used for anonymous blocks: TODO: see if uniqueId could serve a dual purpose + TConstUnionArray constArray; // for compile-time constant value + TIntermTyped* constSubtree; // for specialization constant computation + TVector* memberExtensions; // per-member extension list, allocated only when needed + int anonId; // the ID used for anonymous blocks: TODO: see if uniqueId could serve a dual purpose }; // @@ -324,35 +344,42 @@ class TFunction : public TSymbol { // class TAnonMember : public TSymbol { public: - TAnonMember(const TString* n, unsigned int m, const TVariable& a, int an) : TSymbol(n), anonContainer(a), memberNumber(m), anonId(an) { } - virtual TAnonMember* clone() const; + TAnonMember(const TString* n, unsigned int m, TVariable& a, int an) : TSymbol(n), anonContainer(a), memberNumber(m), anonId(an) { } + virtual TAnonMember* clone() const override; virtual ~TAnonMember() { } - virtual const TAnonMember* getAsAnonMember() const { return this; } + virtual const TAnonMember* getAsAnonMember() const override { return this; } virtual const TVariable& getAnonContainer() const { return anonContainer; } virtual unsigned int getMemberNumber() const { return memberNumber; } - virtual const TType& getType() const + virtual const TType& getType() const override { const TTypeList& types = *anonContainer.getType().getStruct(); return *types[memberNumber].type; } - virtual TType& getWritableType() + virtual TType& getWritableType() override { assert(writable); const TTypeList& types = *anonContainer.getType().getStruct(); return *types[memberNumber].type; } + virtual void setExtensions(int numExts, const char* const exts[]) override + { + anonContainer.setMemberExtensions(memberNumber, numExts, exts); + } + virtual int getNumExtensions() const override { return anonContainer.getNumMemberExtensions(memberNumber); } + virtual const char** getExtensions() const override { return anonContainer.getMemberExtensions(memberNumber); } + virtual int getAnonId() const { return anonId; } - virtual void dump(TInfoSink &infoSink) const; + virtual void dump(TInfoSink &infoSink) const override; protected: explicit TAnonMember(const TAnonMember&); TAnonMember& operator=(const TAnonMember&); - const TVariable& anonContainer; + TVariable& anonContainer; unsigned int memberNumber; int anonId; }; @@ -788,11 +815,30 @@ class TSymbolTable { table[level]->setFunctionExtensions(name, num, extensions); } - void setVariableExtensions(const char* name, int num, const char* const extensions[]) + void setVariableExtensions(const char* name, int numExts, const char* const extensions[]) { TSymbol* symbol = find(TString(name)); - if (symbol) - symbol->setExtensions(num, extensions); + if (symbol == nullptr) + return; + + symbol->setExtensions(numExts, extensions); + } + + void setVariableExtensions(const char* blockName, const char* name, int numExts, const char* const extensions[]) + { + TSymbol* symbol = find(TString(blockName)); + if (symbol == nullptr) + return; + TVariable* variable = symbol->getAsVariable(); + assert(variable != nullptr); + + const TTypeList& structure = *variable->getAsVariable()->getType().getStruct(); + for (int member = 0; member < (int)structure.size(); ++member) { + if (structure[member].type->getFieldName().compare(name) == 0) { + variable->setMemberExtensions(member, numExts, extensions); + return; + } + } } int getMaxSymbolId() { return uniqueId; } diff --git a/deps/glslang/glslang/MachineIndependent/Versions.cpp b/deps/glslang/glslang/MachineIndependent/Versions.cpp index 66fa3e25..708432d1 100644 --- a/deps/glslang/glslang/MachineIndependent/Versions.cpp +++ b/deps/glslang/glslang/MachineIndependent/Versions.cpp @@ -2,6 +2,7 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. // Copyright (C) 2017 ARM Limited. +// Copyright (C) 2015-2018 Google, Inc. // // All rights reserved. // @@ -156,6 +157,7 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_EXT_frag_depth] = EBhDisable; extensionBehavior[E_GL_OES_EGL_image_external] = EBhDisable; extensionBehavior[E_GL_OES_EGL_image_external_essl3] = EBhDisable; + extensionBehavior[E_GL_EXT_YUV_target] = EBhDisable; extensionBehavior[E_GL_EXT_shader_texture_lod] = EBhDisable; extensionBehavior[E_GL_EXT_shadow_samplers] = EBhDisable; extensionBehavior[E_GL_ARB_texture_rectangle] = EBhDisable; @@ -204,6 +206,9 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_EXT_control_flow_attributes] = EBhDisable; extensionBehavior[E_GL_EXT_nonuniform_qualifier] = EBhDisable; extensionBehavior[E_GL_EXT_samplerless_texture_functions] = EBhDisable; + extensionBehavior[E_GL_EXT_scalar_block_layout] = EBhDisable; + extensionBehavior[E_GL_EXT_fragment_invocation_density] = EBhDisable; + extensionBehavior[E_GL_EXT_buffer_reference] = EBhDisable; extensionBehavior[E_GL_EXT_shader_16bit_storage] = EBhDisable; extensionBehavior[E_GL_EXT_shader_8bit_storage] = EBhDisable; @@ -280,14 +285,14 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_OVR_multiview2] = EBhDisable; // explicit types - extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types] = EBhDisable; - extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_int8] = EBhDisable; - extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_int16] = EBhDisable; - extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_int32] = EBhDisable; - extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_int64] = EBhDisable; - extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_float16] = EBhDisable; - extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_float32] = EBhDisable; - extensionBehavior[E_GL_KHX_shader_explicit_arithmetic_types_float64] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_int8] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_int16] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_int32] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_int64] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_float16] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_float32] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_float64] = EBhDisable; } // Get code that is not part of a shared symbol table, is specific to this shader, @@ -303,6 +308,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_EXT_frag_depth 1\n" "#define GL_OES_EGL_image_external 1\n" "#define GL_OES_EGL_image_external_essl3 1\n" + "#define GL_EXT_YUV_target 1\n" "#define GL_EXT_shader_texture_lod 1\n" "#define GL_EXT_shadow_samplers 1\n" @@ -378,6 +384,9 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_EXT_shader_16bit_storage 1\n" "#define GL_EXT_shader_8bit_storage 1\n" "#define GL_EXT_samplerless_texture_functions 1\n" + "#define GL_EXT_scalar_block_layout 1\n" + "#define GL_EXT_fragment_invocation_density 1\n" + "#define GL_EXT_buffer_reference 1\n" // GL_KHR_shader_subgroup "#define GL_KHR_shader_subgroup_basic 1\n" @@ -418,14 +427,14 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_NV_shader_texture_footprint 1\n" "#define GL_NV_mesh_shader 1\n" #endif - "#define GL_KHX_shader_explicit_arithmetic_types 1\n" - "#define GL_KHX_shader_explicit_arithmetic_types_int8 1\n" - "#define GL_KHX_shader_explicit_arithmetic_types_int16 1\n" - "#define GL_KHX_shader_explicit_arithmetic_types_int32 1\n" - "#define GL_KHX_shader_explicit_arithmetic_types_int64 1\n" - "#define GL_KHX_shader_explicit_arithmetic_types_float16 1\n" - "#define GL_KHX_shader_explicit_arithmetic_types_float32 1\n" - "#define GL_KHX_shader_explicit_arithmetic_types_float64 1\n" + "#define GL_EXT_shader_explicit_arithmetic_types 1\n" + "#define GL_EXT_shader_explicit_arithmetic_types_int8 1\n" + "#define GL_EXT_shader_explicit_arithmetic_types_int16 1\n" + "#define GL_EXT_shader_explicit_arithmetic_types_int32 1\n" + "#define GL_EXT_shader_explicit_arithmetic_types_int64 1\n" + "#define GL_EXT_shader_explicit_arithmetic_types_float16 1\n" + "#define GL_EXT_shader_explicit_arithmetic_types_float32 1\n" + "#define GL_EXT_shader_explicit_arithmetic_types_float64 1\n" ; if (version >= 150) { @@ -873,8 +882,8 @@ void TParseVersions::float16Check(const TSourceLoc& loc, const char* op, bool bu #if AMD_EXTENSIONS E_GL_AMD_gpu_shader_half_float, #endif - E_GL_KHX_shader_explicit_arithmetic_types, - E_GL_KHX_shader_explicit_arithmetic_types_float16}; + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_float16}; requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); } } @@ -885,8 +894,8 @@ bool TParseVersions::float16Arithmetic() #if AMD_EXTENSIONS E_GL_AMD_gpu_shader_half_float, #endif - E_GL_KHX_shader_explicit_arithmetic_types, - E_GL_KHX_shader_explicit_arithmetic_types_float16}; + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_float16}; return extensionsTurnedOn(sizeof(extensions)/sizeof(extensions[0]), extensions); } @@ -896,16 +905,16 @@ bool TParseVersions::int16Arithmetic() #if AMD_EXTENSIONS E_GL_AMD_gpu_shader_int16, #endif - E_GL_KHX_shader_explicit_arithmetic_types, - E_GL_KHX_shader_explicit_arithmetic_types_int16}; + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_int16}; return extensionsTurnedOn(sizeof(extensions)/sizeof(extensions[0]), extensions); } bool TParseVersions::int8Arithmetic() { const char* const extensions[] = { - E_GL_KHX_shader_explicit_arithmetic_types, - E_GL_KHX_shader_explicit_arithmetic_types_int8}; + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_int8}; return extensionsTurnedOn(sizeof(extensions)/sizeof(extensions[0]), extensions); } @@ -920,8 +929,8 @@ void TParseVersions::requireFloat16Arithmetic(const TSourceLoc& loc, const char* #if AMD_EXTENSIONS E_GL_AMD_gpu_shader_half_float, #endif - E_GL_KHX_shader_explicit_arithmetic_types, - E_GL_KHX_shader_explicit_arithmetic_types_float16}; + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_float16}; requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, combined.c_str()); } @@ -936,8 +945,8 @@ void TParseVersions::requireInt16Arithmetic(const TSourceLoc& loc, const char* o #if AMD_EXTENSIONS E_GL_AMD_gpu_shader_int16, #endif - E_GL_KHX_shader_explicit_arithmetic_types, - E_GL_KHX_shader_explicit_arithmetic_types_int16}; + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_int16}; requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, combined.c_str()); } @@ -949,8 +958,8 @@ void TParseVersions::requireInt8Arithmetic(const TSourceLoc& loc, const char* op combined += featureDesc; const char* const extensions[] = { - E_GL_KHX_shader_explicit_arithmetic_types, - E_GL_KHX_shader_explicit_arithmetic_types_int8}; + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_int8}; requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, combined.c_str()); } @@ -962,8 +971,8 @@ void TParseVersions::float16ScalarVectorCheck(const TSourceLoc& loc, const char* E_GL_AMD_gpu_shader_half_float, #endif E_GL_EXT_shader_16bit_storage, - E_GL_KHX_shader_explicit_arithmetic_types, - E_GL_KHX_shader_explicit_arithmetic_types_float16}; + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_float16}; requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); } } @@ -972,8 +981,8 @@ void TParseVersions::float16ScalarVectorCheck(const TSourceLoc& loc, const char* void TParseVersions::explicitFloat32Check(const TSourceLoc& loc, const char* op, bool builtIn) { if (!builtIn) { - const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, - E_GL_KHX_shader_explicit_arithmetic_types_float32}; + const char* const extensions[2] = {E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_float32}; requireExtensions(loc, 2, extensions, op); } } @@ -982,8 +991,8 @@ void TParseVersions::explicitFloat32Check(const TSourceLoc& loc, const char* op, void TParseVersions::explicitFloat64Check(const TSourceLoc& loc, const char* op, bool builtIn) { if (!builtIn) { - const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, - E_GL_KHX_shader_explicit_arithmetic_types_float64}; + const char* const extensions[2] = {E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_float64}; requireExtensions(loc, 2, extensions, op); requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); profileRequires(loc, ECoreProfile | ECompatibilityProfile, 400, nullptr, op); @@ -994,8 +1003,8 @@ void TParseVersions::explicitFloat64Check(const TSourceLoc& loc, const char* op, void TParseVersions::explicitInt8Check(const TSourceLoc& loc, const char* op, bool builtIn) { if (! builtIn) { - const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, - E_GL_KHX_shader_explicit_arithmetic_types_int8}; + const char* const extensions[2] = {E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_int8}; requireExtensions(loc, 2, extensions, op); } } @@ -1020,8 +1029,8 @@ void TParseVersions::explicitInt16Check(const TSourceLoc& loc, const char* op, b #if AMD_EXTENSIONS E_GL_AMD_gpu_shader_int16, #endif - E_GL_KHX_shader_explicit_arithmetic_types, - E_GL_KHX_shader_explicit_arithmetic_types_int16}; + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_int16}; requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); } } @@ -1034,8 +1043,8 @@ void TParseVersions::int16ScalarVectorCheck(const TSourceLoc& loc, const char* o E_GL_AMD_gpu_shader_int16, #endif E_GL_EXT_shader_16bit_storage, - E_GL_KHX_shader_explicit_arithmetic_types, - E_GL_KHX_shader_explicit_arithmetic_types_int16}; + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_int16}; requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); } } @@ -1045,8 +1054,8 @@ void TParseVersions::int8ScalarVectorCheck(const TSourceLoc& loc, const char* op if (! builtIn) { const char* const extensions[] = { E_GL_EXT_shader_8bit_storage, - E_GL_KHX_shader_explicit_arithmetic_types, - E_GL_KHX_shader_explicit_arithmetic_types_int8}; + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_int8}; requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); } } @@ -1055,8 +1064,8 @@ void TParseVersions::int8ScalarVectorCheck(const TSourceLoc& loc, const char* op void TParseVersions::explicitInt32Check(const TSourceLoc& loc, const char* op, bool builtIn) { if (! builtIn) { - const char* const extensions[2] = {E_GL_KHX_shader_explicit_arithmetic_types, - E_GL_KHX_shader_explicit_arithmetic_types_int32}; + const char* const extensions[2] = {E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_int32}; requireExtensions(loc, 2, extensions, op); } } @@ -1066,8 +1075,8 @@ void TParseVersions::int64Check(const TSourceLoc& loc, const char* op, bool buil { if (! builtIn) { const char* const extensions[3] = {E_GL_ARB_gpu_shader_int64, - E_GL_KHX_shader_explicit_arithmetic_types, - E_GL_KHX_shader_explicit_arithmetic_types_int64}; + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_int64}; requireExtensions(loc, 3, extensions, op); requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); profileRequires(loc, ECoreProfile | ECompatibilityProfile, 400, nullptr, op); diff --git a/deps/glslang/glslang/MachineIndependent/Versions.h b/deps/glslang/glslang/MachineIndependent/Versions.h index 85c93c0a..72018d8e 100644 --- a/deps/glslang/glslang/MachineIndependent/Versions.h +++ b/deps/glslang/glslang/MachineIndependent/Versions.h @@ -2,6 +2,7 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. // Copyright (C) 2017 ARM Limited. +// Copyright (C) 2015-2018 Google, Inc. // // All rights reserved. // @@ -73,7 +74,7 @@ inline const char* ProfileName(EProfile profile) } // -// What source rules, validation rules, target language, etc. are needed +// What source rules, validation rules, target language, etc. are needed or // desired for SPIR-V? // // 0 means a target or rule set is not enabled (ignore rules from that entity). @@ -109,6 +110,7 @@ const char* const E_GL_OES_standard_derivatives = "GL_OES_standard_deriv const char* const E_GL_EXT_frag_depth = "GL_EXT_frag_depth"; const char* const E_GL_OES_EGL_image_external = "GL_OES_EGL_image_external"; const char* const E_GL_OES_EGL_image_external_essl3 = "GL_OES_EGL_image_external_essl3"; +const char* const E_GL_EXT_YUV_target = "GL_EXT_YUV_target"; const char* const E_GL_EXT_shader_texture_lod = "GL_EXT_shader_texture_lod"; const char* const E_GL_EXT_shadow_samplers = "GL_EXT_shadow_samplers"; @@ -166,6 +168,9 @@ const char* const E_GL_EXT_post_depth_coverage = "GL_EXT_post_depth const char* const E_GL_EXT_control_flow_attributes = "GL_EXT_control_flow_attributes"; const char* const E_GL_EXT_nonuniform_qualifier = "GL_EXT_nonuniform_qualifier"; const char* const E_GL_EXT_samplerless_texture_functions = "GL_EXT_samplerless_texture_functions"; +const char* const E_GL_EXT_scalar_block_layout = "GL_EXT_scalar_block_layout"; +const char* const E_GL_EXT_fragment_invocation_density = "GL_EXT_fragment_invocation_density"; +const char* const E_GL_EXT_buffer_reference = "GL_EXT_buffer_reference"; // Arrays of extensions for the above viewportEXTs duplications @@ -249,14 +254,14 @@ const char* const E_GL_OES_texture_buffer = "GL_OES_textur const char* const E_GL_OES_texture_cube_map_array = "GL_OES_texture_cube_map_array"; // KHX -const char* const E_GL_KHX_shader_explicit_arithmetic_types = "GL_KHX_shader_explicit_arithmetic_types"; -const char* const E_GL_KHX_shader_explicit_arithmetic_types_int8 = "GL_KHX_shader_explicit_arithmetic_types_int8"; -const char* const E_GL_KHX_shader_explicit_arithmetic_types_int16 = "GL_KHX_shader_explicit_arithmetic_types_int16"; -const char* const E_GL_KHX_shader_explicit_arithmetic_types_int32 = "GL_KHX_shader_explicit_arithmetic_types_int32"; -const char* const E_GL_KHX_shader_explicit_arithmetic_types_int64 = "GL_KHX_shader_explicit_arithmetic_types_int64"; -const char* const E_GL_KHX_shader_explicit_arithmetic_types_float16 = "GL_KHX_shader_explicit_arithmetic_types_float16"; -const char* const E_GL_KHX_shader_explicit_arithmetic_types_float32 = "GL_KHX_shader_explicit_arithmetic_types_float32"; -const char* const E_GL_KHX_shader_explicit_arithmetic_types_float64 = "GL_KHX_shader_explicit_arithmetic_types_float64"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types = "GL_EXT_shader_explicit_arithmetic_types"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_int8 = "GL_EXT_shader_explicit_arithmetic_types_int8"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_int16 = "GL_EXT_shader_explicit_arithmetic_types_int16"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_int32 = "GL_EXT_shader_explicit_arithmetic_types_int32"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_int64 = "GL_EXT_shader_explicit_arithmetic_types_int64"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_float16 = "GL_EXT_shader_explicit_arithmetic_types_float16"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_float32 = "GL_EXT_shader_explicit_arithmetic_types_float32"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_float64 = "GL_EXT_shader_explicit_arithmetic_types_float64"; // Arrays of extensions for the above AEP duplications diff --git a/deps/glslang/glslang/MachineIndependent/glslang.y b/deps/glslang/glslang/MachineIndependent/glslang.y index 3634f16f..d6e50911 100644 --- a/deps/glslang/glslang/MachineIndependent/glslang.y +++ b/deps/glslang/glslang/MachineIndependent/glslang.y @@ -2,6 +2,7 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. // Copyright (C) 2017 ARM Limited. +// Copyright (C) 2015-2018 Google, Inc. // // All rights reserved. // @@ -179,6 +180,7 @@ extern int yylex(YYSTYPE*, TParseContext&); %token SAMPLER2DMS ISAMPLER2DMS USAMPLER2DMS %token SAMPLER2DMSARRAY ISAMPLER2DMSARRAY USAMPLER2DMSARRAY %token SAMPLEREXTERNALOES +%token SAMPLEREXTERNAL2DY2YEXT %token F16SAMPLER1D F16SAMPLER2D F16SAMPLER3D F16SAMPLER2DRECT F16SAMPLERCUBE %token F16SAMPLER1DARRAY F16SAMPLER2DARRAY F16SAMPLERCUBEARRAY @@ -3110,6 +3112,12 @@ type_specifier_nonarray $$.sampler.set(EbtFloat, Esd2D); $$.sampler.external = true; } + | SAMPLEREXTERNAL2DY2YEXT { // GL_EXT_YUV_target + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd2D); + $$.sampler.yuv = true; + } | SUBPASSINPUT { parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); diff --git a/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp b/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp index e57edb57..1348c8bb 100644 --- a/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp +++ b/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp @@ -62,7 +62,7 @@ /* Copy the first part of user declarations. */ -#line 42 "MachineIndependent/glslang.y" /* yacc.c:339 */ +#line 43 "MachineIndependent/glslang.y" /* yacc.c:339 */ /* Based on: @@ -339,193 +339,194 @@ extern int yydebug; ISAMPLER2DMSARRAY = 471, USAMPLER2DMSARRAY = 472, SAMPLEREXTERNALOES = 473, - F16SAMPLER1D = 474, - F16SAMPLER2D = 475, - F16SAMPLER3D = 476, - F16SAMPLER2DRECT = 477, - F16SAMPLERCUBE = 478, - F16SAMPLER1DARRAY = 479, - F16SAMPLER2DARRAY = 480, - F16SAMPLERCUBEARRAY = 481, - F16SAMPLERBUFFER = 482, - F16SAMPLER2DMS = 483, - F16SAMPLER2DMSARRAY = 484, - F16SAMPLER1DSHADOW = 485, - F16SAMPLER2DSHADOW = 486, - F16SAMPLER1DARRAYSHADOW = 487, - F16SAMPLER2DARRAYSHADOW = 488, - F16SAMPLER2DRECTSHADOW = 489, - F16SAMPLERCUBESHADOW = 490, - F16SAMPLERCUBEARRAYSHADOW = 491, - SAMPLER = 492, - SAMPLERSHADOW = 493, - TEXTURE1D = 494, - TEXTURE2D = 495, - TEXTURE3D = 496, - TEXTURECUBE = 497, - TEXTURE1DARRAY = 498, - TEXTURE2DARRAY = 499, - ITEXTURE1D = 500, - ITEXTURE2D = 501, - ITEXTURE3D = 502, - ITEXTURECUBE = 503, - ITEXTURE1DARRAY = 504, - ITEXTURE2DARRAY = 505, - UTEXTURE1D = 506, - UTEXTURE2D = 507, - UTEXTURE3D = 508, - UTEXTURECUBE = 509, - UTEXTURE1DARRAY = 510, - UTEXTURE2DARRAY = 511, - TEXTURE2DRECT = 512, - ITEXTURE2DRECT = 513, - UTEXTURE2DRECT = 514, - TEXTUREBUFFER = 515, - ITEXTUREBUFFER = 516, - UTEXTUREBUFFER = 517, - TEXTURECUBEARRAY = 518, - ITEXTURECUBEARRAY = 519, - UTEXTURECUBEARRAY = 520, - TEXTURE2DMS = 521, - ITEXTURE2DMS = 522, - UTEXTURE2DMS = 523, - TEXTURE2DMSARRAY = 524, - ITEXTURE2DMSARRAY = 525, - UTEXTURE2DMSARRAY = 526, - F16TEXTURE1D = 527, - F16TEXTURE2D = 528, - F16TEXTURE3D = 529, - F16TEXTURE2DRECT = 530, - F16TEXTURECUBE = 531, - F16TEXTURE1DARRAY = 532, - F16TEXTURE2DARRAY = 533, - F16TEXTURECUBEARRAY = 534, - F16TEXTUREBUFFER = 535, - F16TEXTURE2DMS = 536, - F16TEXTURE2DMSARRAY = 537, - SUBPASSINPUT = 538, - SUBPASSINPUTMS = 539, - ISUBPASSINPUT = 540, - ISUBPASSINPUTMS = 541, - USUBPASSINPUT = 542, - USUBPASSINPUTMS = 543, - F16SUBPASSINPUT = 544, - F16SUBPASSINPUTMS = 545, - IMAGE1D = 546, - IIMAGE1D = 547, - UIMAGE1D = 548, - IMAGE2D = 549, - IIMAGE2D = 550, - UIMAGE2D = 551, - IMAGE3D = 552, - IIMAGE3D = 553, - UIMAGE3D = 554, - IMAGE2DRECT = 555, - IIMAGE2DRECT = 556, - UIMAGE2DRECT = 557, - IMAGECUBE = 558, - IIMAGECUBE = 559, - UIMAGECUBE = 560, - IMAGEBUFFER = 561, - IIMAGEBUFFER = 562, - UIMAGEBUFFER = 563, - IMAGE1DARRAY = 564, - IIMAGE1DARRAY = 565, - UIMAGE1DARRAY = 566, - IMAGE2DARRAY = 567, - IIMAGE2DARRAY = 568, - UIMAGE2DARRAY = 569, - IMAGECUBEARRAY = 570, - IIMAGECUBEARRAY = 571, - UIMAGECUBEARRAY = 572, - IMAGE2DMS = 573, - IIMAGE2DMS = 574, - UIMAGE2DMS = 575, - IMAGE2DMSARRAY = 576, - IIMAGE2DMSARRAY = 577, - UIMAGE2DMSARRAY = 578, - F16IMAGE1D = 579, - F16IMAGE2D = 580, - F16IMAGE3D = 581, - F16IMAGE2DRECT = 582, - F16IMAGECUBE = 583, - F16IMAGE1DARRAY = 584, - F16IMAGE2DARRAY = 585, - F16IMAGECUBEARRAY = 586, - F16IMAGEBUFFER = 587, - F16IMAGE2DMS = 588, - F16IMAGE2DMSARRAY = 589, - STRUCT = 590, - VOID = 591, - WHILE = 592, - IDENTIFIER = 593, - TYPE_NAME = 594, - FLOATCONSTANT = 595, - DOUBLECONSTANT = 596, - INT16CONSTANT = 597, - UINT16CONSTANT = 598, - INT32CONSTANT = 599, - UINT32CONSTANT = 600, - INTCONSTANT = 601, - UINTCONSTANT = 602, - INT64CONSTANT = 603, - UINT64CONSTANT = 604, - BOOLCONSTANT = 605, - FLOAT16CONSTANT = 606, - LEFT_OP = 607, - RIGHT_OP = 608, - INC_OP = 609, - DEC_OP = 610, - LE_OP = 611, - GE_OP = 612, - EQ_OP = 613, - NE_OP = 614, - AND_OP = 615, - OR_OP = 616, - XOR_OP = 617, - MUL_ASSIGN = 618, - DIV_ASSIGN = 619, - ADD_ASSIGN = 620, - MOD_ASSIGN = 621, - LEFT_ASSIGN = 622, - RIGHT_ASSIGN = 623, - AND_ASSIGN = 624, - XOR_ASSIGN = 625, - OR_ASSIGN = 626, - SUB_ASSIGN = 627, - LEFT_PAREN = 628, - RIGHT_PAREN = 629, - LEFT_BRACKET = 630, - RIGHT_BRACKET = 631, - LEFT_BRACE = 632, - RIGHT_BRACE = 633, - DOT = 634, - COMMA = 635, - COLON = 636, - EQUAL = 637, - SEMICOLON = 638, - BANG = 639, - DASH = 640, - TILDE = 641, - PLUS = 642, - STAR = 643, - SLASH = 644, - PERCENT = 645, - LEFT_ANGLE = 646, - RIGHT_ANGLE = 647, - VERTICAL_BAR = 648, - CARET = 649, - AMPERSAND = 650, - QUESTION = 651, - INVARIANT = 652, - PRECISE = 653, - HIGH_PRECISION = 654, - MEDIUM_PRECISION = 655, - LOW_PRECISION = 656, - PRECISION = 657, - PACKED = 658, - RESOURCE = 659, - SUPERP = 660 + SAMPLEREXTERNAL2DY2YEXT = 474, + F16SAMPLER1D = 475, + F16SAMPLER2D = 476, + F16SAMPLER3D = 477, + F16SAMPLER2DRECT = 478, + F16SAMPLERCUBE = 479, + F16SAMPLER1DARRAY = 480, + F16SAMPLER2DARRAY = 481, + F16SAMPLERCUBEARRAY = 482, + F16SAMPLERBUFFER = 483, + F16SAMPLER2DMS = 484, + F16SAMPLER2DMSARRAY = 485, + F16SAMPLER1DSHADOW = 486, + F16SAMPLER2DSHADOW = 487, + F16SAMPLER1DARRAYSHADOW = 488, + F16SAMPLER2DARRAYSHADOW = 489, + F16SAMPLER2DRECTSHADOW = 490, + F16SAMPLERCUBESHADOW = 491, + F16SAMPLERCUBEARRAYSHADOW = 492, + SAMPLER = 493, + SAMPLERSHADOW = 494, + TEXTURE1D = 495, + TEXTURE2D = 496, + TEXTURE3D = 497, + TEXTURECUBE = 498, + TEXTURE1DARRAY = 499, + TEXTURE2DARRAY = 500, + ITEXTURE1D = 501, + ITEXTURE2D = 502, + ITEXTURE3D = 503, + ITEXTURECUBE = 504, + ITEXTURE1DARRAY = 505, + ITEXTURE2DARRAY = 506, + UTEXTURE1D = 507, + UTEXTURE2D = 508, + UTEXTURE3D = 509, + UTEXTURECUBE = 510, + UTEXTURE1DARRAY = 511, + UTEXTURE2DARRAY = 512, + TEXTURE2DRECT = 513, + ITEXTURE2DRECT = 514, + UTEXTURE2DRECT = 515, + TEXTUREBUFFER = 516, + ITEXTUREBUFFER = 517, + UTEXTUREBUFFER = 518, + TEXTURECUBEARRAY = 519, + ITEXTURECUBEARRAY = 520, + UTEXTURECUBEARRAY = 521, + TEXTURE2DMS = 522, + ITEXTURE2DMS = 523, + UTEXTURE2DMS = 524, + TEXTURE2DMSARRAY = 525, + ITEXTURE2DMSARRAY = 526, + UTEXTURE2DMSARRAY = 527, + F16TEXTURE1D = 528, + F16TEXTURE2D = 529, + F16TEXTURE3D = 530, + F16TEXTURE2DRECT = 531, + F16TEXTURECUBE = 532, + F16TEXTURE1DARRAY = 533, + F16TEXTURE2DARRAY = 534, + F16TEXTURECUBEARRAY = 535, + F16TEXTUREBUFFER = 536, + F16TEXTURE2DMS = 537, + F16TEXTURE2DMSARRAY = 538, + SUBPASSINPUT = 539, + SUBPASSINPUTMS = 540, + ISUBPASSINPUT = 541, + ISUBPASSINPUTMS = 542, + USUBPASSINPUT = 543, + USUBPASSINPUTMS = 544, + F16SUBPASSINPUT = 545, + F16SUBPASSINPUTMS = 546, + IMAGE1D = 547, + IIMAGE1D = 548, + UIMAGE1D = 549, + IMAGE2D = 550, + IIMAGE2D = 551, + UIMAGE2D = 552, + IMAGE3D = 553, + IIMAGE3D = 554, + UIMAGE3D = 555, + IMAGE2DRECT = 556, + IIMAGE2DRECT = 557, + UIMAGE2DRECT = 558, + IMAGECUBE = 559, + IIMAGECUBE = 560, + UIMAGECUBE = 561, + IMAGEBUFFER = 562, + IIMAGEBUFFER = 563, + UIMAGEBUFFER = 564, + IMAGE1DARRAY = 565, + IIMAGE1DARRAY = 566, + UIMAGE1DARRAY = 567, + IMAGE2DARRAY = 568, + IIMAGE2DARRAY = 569, + UIMAGE2DARRAY = 570, + IMAGECUBEARRAY = 571, + IIMAGECUBEARRAY = 572, + UIMAGECUBEARRAY = 573, + IMAGE2DMS = 574, + IIMAGE2DMS = 575, + UIMAGE2DMS = 576, + IMAGE2DMSARRAY = 577, + IIMAGE2DMSARRAY = 578, + UIMAGE2DMSARRAY = 579, + F16IMAGE1D = 580, + F16IMAGE2D = 581, + F16IMAGE3D = 582, + F16IMAGE2DRECT = 583, + F16IMAGECUBE = 584, + F16IMAGE1DARRAY = 585, + F16IMAGE2DARRAY = 586, + F16IMAGECUBEARRAY = 587, + F16IMAGEBUFFER = 588, + F16IMAGE2DMS = 589, + F16IMAGE2DMSARRAY = 590, + STRUCT = 591, + VOID = 592, + WHILE = 593, + IDENTIFIER = 594, + TYPE_NAME = 595, + FLOATCONSTANT = 596, + DOUBLECONSTANT = 597, + INT16CONSTANT = 598, + UINT16CONSTANT = 599, + INT32CONSTANT = 600, + UINT32CONSTANT = 601, + INTCONSTANT = 602, + UINTCONSTANT = 603, + INT64CONSTANT = 604, + UINT64CONSTANT = 605, + BOOLCONSTANT = 606, + FLOAT16CONSTANT = 607, + LEFT_OP = 608, + RIGHT_OP = 609, + INC_OP = 610, + DEC_OP = 611, + LE_OP = 612, + GE_OP = 613, + EQ_OP = 614, + NE_OP = 615, + AND_OP = 616, + OR_OP = 617, + XOR_OP = 618, + MUL_ASSIGN = 619, + DIV_ASSIGN = 620, + ADD_ASSIGN = 621, + MOD_ASSIGN = 622, + LEFT_ASSIGN = 623, + RIGHT_ASSIGN = 624, + AND_ASSIGN = 625, + XOR_ASSIGN = 626, + OR_ASSIGN = 627, + SUB_ASSIGN = 628, + LEFT_PAREN = 629, + RIGHT_PAREN = 630, + LEFT_BRACKET = 631, + RIGHT_BRACKET = 632, + LEFT_BRACE = 633, + RIGHT_BRACE = 634, + DOT = 635, + COMMA = 636, + COLON = 637, + EQUAL = 638, + SEMICOLON = 639, + BANG = 640, + DASH = 641, + TILDE = 642, + PLUS = 643, + STAR = 644, + SLASH = 645, + PERCENT = 646, + LEFT_ANGLE = 647, + RIGHT_ANGLE = 648, + VERTICAL_BAR = 649, + CARET = 650, + AMPERSAND = 651, + QUESTION = 652, + INVARIANT = 653, + PRECISE = 654, + HIGH_PRECISION = 655, + MEDIUM_PRECISION = 656, + LOW_PRECISION = 657, + PRECISION = 658, + PACKED = 659, + RESOURCE = 660, + SUPERP = 661 }; #endif @@ -534,7 +535,7 @@ extern int yydebug; union YYSTYPE { -#line 70 "MachineIndependent/glslang.y" /* yacc.c:355 */ +#line 71 "MachineIndependent/glslang.y" /* yacc.c:355 */ struct { glslang::TSourceLoc loc; @@ -569,7 +570,7 @@ union YYSTYPE }; } interm; -#line 573 "MachineIndependent/glslang_tab.cpp" /* yacc.c:355 */ +#line 574 "MachineIndependent/glslang_tab.cpp" /* yacc.c:355 */ }; typedef union YYSTYPE YYSTYPE; @@ -584,7 +585,7 @@ int yyparse (glslang::TParseContext* pParseContext); #endif /* !YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED */ /* Copy the second part of user declarations. */ -#line 105 "MachineIndependent/glslang.y" /* yacc.c:358 */ +#line 106 "MachineIndependent/glslang.y" /* yacc.c:358 */ /* windows only pragma */ @@ -600,7 +601,7 @@ int yyparse (glslang::TParseContext* pParseContext); extern int yylex(YYSTYPE*, TParseContext&); -#line 604 "MachineIndependent/glslang_tab.cpp" /* yacc.c:358 */ +#line 605 "MachineIndependent/glslang_tab.cpp" /* yacc.c:358 */ #ifdef short # undef short @@ -840,23 +841,23 @@ union yyalloc #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 381 +#define YYFINAL 382 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 9294 +#define YYLAST 9317 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 406 +#define YYNTOKENS 407 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 107 /* YYNRULES -- Number of rules. */ -#define YYNRULES 571 +#define YYNRULES 572 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 712 +#define YYNSTATES 713 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 660 +#define YYMAXUTOK 661 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -931,71 +932,71 @@ static const yytype_uint16 yytranslate[] = 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405 + 405, 406 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 294, 294, 300, 303, 307, 311, 314, 318, 322, - 326, 330, 334, 337, 341, 345, 348, 356, 359, 362, - 365, 368, 373, 381, 388, 395, 401, 405, 412, 415, - 421, 428, 438, 446, 451, 478, 486, 492, 496, 500, - 520, 521, 522, 523, 529, 530, 535, 540, 549, 550, - 555, 563, 564, 570, 579, 580, 585, 590, 595, 603, - 604, 612, 623, 624, 633, 634, 643, 644, 653, 654, - 662, 663, 671, 672, 680, 681, 681, 699, 700, 716, - 720, 724, 728, 733, 737, 741, 745, 749, 753, 757, - 764, 767, 778, 785, 790, 795, 803, 807, 811, 815, - 820, 825, 834, 834, 845, 849, 856, 863, 866, 873, - 881, 901, 924, 939, 964, 975, 985, 995, 1005, 1014, - 1017, 1021, 1025, 1030, 1038, 1043, 1048, 1053, 1058, 1067, - 1078, 1105, 1114, 1121, 1128, 1139, 1148, 1158, 1170, 1179, - 1191, 1197, 1200, 1207, 1211, 1215, 1223, 1232, 1235, 1246, - 1249, 1252, 1256, 1260, 1264, 1268, 1274, 1278, 1290, 1304, - 1309, 1315, 1321, 1328, 1334, 1339, 1344, 1349, 1359, 1369, - 1379, 1389, 1398, 1410, 1414, 1419, 1424, 1429, 1434, 1439, - 1443, 1447, 1451, 1455, 1461, 1470, 1477, 1480, 1488, 1492, - 1501, 1506, 1514, 1518, 1528, 1532, 1536, 1541, 1546, 1551, - 1556, 1560, 1565, 1570, 1575, 1580, 1585, 1590, 1595, 1600, - 1605, 1609, 1614, 1619, 1624, 1630, 1636, 1642, 1648, 1654, - 1660, 1666, 1672, 1678, 1684, 1690, 1696, 1701, 1706, 1711, - 1716, 1721, 1726, 1732, 1738, 1744, 1750, 1756, 1762, 1768, - 1774, 1780, 1786, 1792, 1798, 1804, 1810, 1816, 1822, 1828, - 1834, 1840, 1846, 1852, 1858, 1864, 1870, 1876, 1882, 1888, - 1893, 1898, 1903, 1908, 1913, 1918, 1923, 1928, 1933, 1938, - 1943, 1948, 1954, 1960, 1966, 1972, 1978, 1984, 1990, 1996, - 2002, 2008, 2014, 2020, 2026, 2032, 2038, 2044, 2050, 2056, - 2062, 2068, 2074, 2080, 2086, 2092, 2098, 2104, 2110, 2116, - 2122, 2128, 2134, 2140, 2146, 2152, 2158, 2164, 2170, 2176, - 2182, 2188, 2194, 2200, 2206, 2212, 2218, 2224, 2230, 2236, - 2242, 2247, 2252, 2257, 2262, 2267, 2272, 2277, 2282, 2287, - 2292, 2297, 2302, 2307, 2312, 2320, 2328, 2336, 2344, 2352, - 2360, 2368, 2376, 2384, 2392, 2400, 2408, 2416, 2421, 2426, - 2431, 2436, 2441, 2446, 2451, 2456, 2461, 2466, 2471, 2476, - 2481, 2486, 2491, 2496, 2504, 2512, 2517, 2522, 2527, 2535, - 2540, 2545, 2550, 2558, 2563, 2568, 2573, 2581, 2586, 2591, - 2596, 2601, 2606, 2614, 2619, 2627, 2632, 2640, 2645, 2653, - 2658, 2666, 2671, 2679, 2684, 2692, 2697, 2702, 2707, 2712, - 2717, 2722, 2727, 2732, 2737, 2742, 2747, 2752, 2757, 2762, - 2767, 2775, 2780, 2785, 2790, 2798, 2803, 2808, 2813, 2821, - 2826, 2831, 2836, 2844, 2849, 2854, 2859, 2867, 2872, 2877, - 2882, 2890, 2895, 2900, 2905, 2913, 2918, 2923, 2928, 2936, - 2941, 2946, 2951, 2959, 2964, 2969, 2974, 2982, 2987, 2992, - 2997, 3005, 3010, 3015, 3020, 3028, 3033, 3038, 3043, 3051, - 3056, 3061, 3066, 3074, 3079, 3084, 3089, 3097, 3102, 3107, - 3113, 3119, 3125, 3134, 3143, 3149, 3155, 3161, 3167, 3172, - 3188, 3193, 3198, 3206, 3206, 3217, 3217, 3227, 3230, 3243, - 3265, 3292, 3296, 3302, 3307, 3318, 3321, 3327, 3336, 3339, - 3345, 3349, 3350, 3356, 3357, 3358, 3359, 3360, 3361, 3362, - 3366, 3367, 3371, 3367, 3383, 3384, 3388, 3388, 3395, 3395, - 3409, 3412, 3420, 3428, 3439, 3440, 3444, 3447, 3453, 3460, - 3464, 3472, 3476, 3489, 3492, 3498, 3498, 3518, 3521, 3527, - 3539, 3551, 3554, 3560, 3560, 3575, 3575, 3591, 3591, 3612, - 3615, 3621, 3624, 3630, 3634, 3641, 3646, 3651, 3658, 3661, - 3670, 3674, 3683, 3686, 3689, 3697, 3697, 3719, 3725, 3728, - 3733, 3736 + 0, 296, 296, 302, 305, 309, 313, 316, 320, 324, + 328, 332, 336, 339, 343, 347, 350, 358, 361, 364, + 367, 370, 375, 383, 390, 397, 403, 407, 414, 417, + 423, 430, 440, 448, 453, 480, 488, 494, 498, 502, + 522, 523, 524, 525, 531, 532, 537, 542, 551, 552, + 557, 565, 566, 572, 581, 582, 587, 592, 597, 605, + 606, 614, 625, 626, 635, 636, 645, 646, 655, 656, + 664, 665, 673, 674, 682, 683, 683, 701, 702, 718, + 722, 726, 730, 735, 739, 743, 747, 751, 755, 759, + 766, 769, 780, 787, 792, 797, 805, 809, 813, 817, + 822, 827, 836, 836, 847, 851, 858, 865, 868, 875, + 883, 903, 926, 941, 966, 977, 987, 997, 1007, 1016, + 1019, 1023, 1027, 1032, 1040, 1045, 1050, 1055, 1060, 1069, + 1080, 1107, 1116, 1123, 1130, 1141, 1150, 1160, 1172, 1181, + 1193, 1199, 1202, 1209, 1213, 1217, 1225, 1234, 1237, 1248, + 1251, 1254, 1258, 1262, 1266, 1270, 1276, 1280, 1292, 1306, + 1311, 1317, 1323, 1330, 1336, 1341, 1346, 1351, 1361, 1371, + 1381, 1391, 1400, 1412, 1416, 1421, 1426, 1431, 1436, 1441, + 1445, 1449, 1453, 1457, 1463, 1472, 1479, 1482, 1490, 1494, + 1503, 1508, 1516, 1520, 1530, 1534, 1538, 1543, 1548, 1553, + 1558, 1562, 1567, 1572, 1577, 1582, 1587, 1592, 1597, 1602, + 1607, 1611, 1616, 1621, 1626, 1632, 1638, 1644, 1650, 1656, + 1662, 1668, 1674, 1680, 1686, 1692, 1698, 1703, 1708, 1713, + 1718, 1723, 1728, 1734, 1740, 1746, 1752, 1758, 1764, 1770, + 1776, 1782, 1788, 1794, 1800, 1806, 1812, 1818, 1824, 1830, + 1836, 1842, 1848, 1854, 1860, 1866, 1872, 1878, 1884, 1890, + 1895, 1900, 1905, 1910, 1915, 1920, 1925, 1930, 1935, 1940, + 1945, 1950, 1956, 1962, 1968, 1974, 1980, 1986, 1992, 1998, + 2004, 2010, 2016, 2022, 2028, 2034, 2040, 2046, 2052, 2058, + 2064, 2070, 2076, 2082, 2088, 2094, 2100, 2106, 2112, 2118, + 2124, 2130, 2136, 2142, 2148, 2154, 2160, 2166, 2172, 2178, + 2184, 2190, 2196, 2202, 2208, 2214, 2220, 2226, 2232, 2238, + 2244, 2249, 2254, 2259, 2264, 2269, 2274, 2279, 2284, 2289, + 2294, 2299, 2304, 2309, 2314, 2322, 2330, 2338, 2346, 2354, + 2362, 2370, 2378, 2386, 2394, 2402, 2410, 2418, 2423, 2428, + 2433, 2438, 2443, 2448, 2453, 2458, 2463, 2468, 2473, 2478, + 2483, 2488, 2493, 2498, 2506, 2514, 2519, 2524, 2529, 2537, + 2542, 2547, 2552, 2560, 2565, 2570, 2575, 2583, 2588, 2593, + 2598, 2603, 2608, 2616, 2621, 2629, 2634, 2642, 2647, 2655, + 2660, 2668, 2673, 2681, 2686, 2694, 2699, 2704, 2709, 2714, + 2719, 2724, 2729, 2734, 2739, 2744, 2749, 2754, 2759, 2764, + 2769, 2777, 2782, 2787, 2792, 2800, 2805, 2810, 2815, 2823, + 2828, 2833, 2838, 2846, 2851, 2856, 2861, 2869, 2874, 2879, + 2884, 2892, 2897, 2902, 2907, 2915, 2920, 2925, 2930, 2938, + 2943, 2948, 2953, 2961, 2966, 2971, 2976, 2984, 2989, 2994, + 2999, 3007, 3012, 3017, 3022, 3030, 3035, 3040, 3045, 3053, + 3058, 3063, 3068, 3076, 3081, 3086, 3091, 3099, 3104, 3109, + 3115, 3121, 3127, 3133, 3142, 3151, 3157, 3163, 3169, 3175, + 3180, 3196, 3201, 3206, 3214, 3214, 3225, 3225, 3235, 3238, + 3251, 3273, 3300, 3304, 3310, 3315, 3326, 3329, 3335, 3344, + 3347, 3353, 3357, 3358, 3364, 3365, 3366, 3367, 3368, 3369, + 3370, 3374, 3375, 3379, 3375, 3391, 3392, 3396, 3396, 3403, + 3403, 3417, 3420, 3428, 3436, 3447, 3448, 3452, 3455, 3461, + 3468, 3472, 3480, 3484, 3497, 3500, 3506, 3506, 3526, 3529, + 3535, 3547, 3559, 3562, 3568, 3568, 3583, 3583, 3599, 3599, + 3620, 3623, 3629, 3632, 3638, 3642, 3649, 3654, 3659, 3666, + 3669, 3678, 3682, 3691, 3694, 3697, 3705, 3705, 3727, 3733, + 3736, 3741, 3744 }; #endif @@ -1045,11 +1046,11 @@ static const char *const yytname[] = "SAMPLERCUBEARRAY", "SAMPLERCUBEARRAYSHADOW", "ISAMPLERCUBEARRAY", "USAMPLERCUBEARRAY", "SAMPLER2DMS", "ISAMPLER2DMS", "USAMPLER2DMS", "SAMPLER2DMSARRAY", "ISAMPLER2DMSARRAY", "USAMPLER2DMSARRAY", - "SAMPLEREXTERNALOES", "F16SAMPLER1D", "F16SAMPLER2D", "F16SAMPLER3D", - "F16SAMPLER2DRECT", "F16SAMPLERCUBE", "F16SAMPLER1DARRAY", - "F16SAMPLER2DARRAY", "F16SAMPLERCUBEARRAY", "F16SAMPLERBUFFER", - "F16SAMPLER2DMS", "F16SAMPLER2DMSARRAY", "F16SAMPLER1DSHADOW", - "F16SAMPLER2DSHADOW", "F16SAMPLER1DARRAYSHADOW", + "SAMPLEREXTERNALOES", "SAMPLEREXTERNAL2DY2YEXT", "F16SAMPLER1D", + "F16SAMPLER2D", "F16SAMPLER3D", "F16SAMPLER2DRECT", "F16SAMPLERCUBE", + "F16SAMPLER1DARRAY", "F16SAMPLER2DARRAY", "F16SAMPLERCUBEARRAY", + "F16SAMPLERBUFFER", "F16SAMPLER2DMS", "F16SAMPLER2DMSARRAY", + "F16SAMPLER1DSHADOW", "F16SAMPLER2DSHADOW", "F16SAMPLER1DARRAYSHADOW", "F16SAMPLER2DARRAYSHADOW", "F16SAMPLER2DRECTSHADOW", "F16SAMPLERCUBESHADOW", "F16SAMPLERCUBEARRAYSHADOW", "SAMPLER", "SAMPLERSHADOW", "TEXTURE1D", "TEXTURE2D", "TEXTURE3D", "TEXTURECUBE", @@ -1175,16 +1176,16 @@ static const yytype_uint16 yytoknum[] = 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660 + 655, 656, 657, 658, 659, 660, 661 }; # endif -#define YYPACT_NINF -649 +#define YYPACT_NINF -657 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-649))) + (!!((Yystate) == (-657))) -#define YYTABLE_NINF -517 +#define YYTABLE_NINF -518 #define yytable_value_is_error(Yytable_value) \ 0 @@ -1193,78 +1194,78 @@ static const yytype_uint16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - 3511, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -326, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -310, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -316, -649, -649, -649, -649, -649, -649, -649, - -649, -256, -649, -317, -357, -305, -269, 5906, -315, -649, - -225, -649, -649, -649, -649, 4310, -649, -649, -649, -649, - -234, -649, -649, 711, -649, -649, -204, -69, -222, -649, - 8955, -335, -649, -649, -218, -649, 5906, -649, -649, -649, - 5906, -170, -169, -649, -339, -303, -649, -649, -649, 6657, - -205, -649, -649, -649, -307, -649, -211, -302, -649, -649, - 5906, -210, -649, -321, 1111, -649, -649, -649, -649, -234, - -340, -649, 7040, -325, -649, -166, -649, -292, -649, -649, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, 8189, 8189, 8189, -649, -649, -649, -649, -649, -649, - -649, -324, -649, -649, -649, -200, -298, 8572, -198, -649, - 8189, -242, -278, -314, -333, -209, -219, -217, -215, -180, - -181, -336, -194, -649, -649, 7423, -649, -155, 8189, -649, - -69, 5906, 5906, -154, 4709, -649, -649, -649, -197, -195, - -649, -188, -184, -193, 7806, -179, 8189, -189, -178, -182, - -177, -649, -649, -267, -649, -649, -252, -649, -357, -176, - -173, -649, -649, -649, -649, 1511, -649, -649, -649, -649, - -649, -649, -649, -649, -649, -19, -205, 7040, -311, 7040, - -649, -649, 7040, 5906, -649, -142, -649, -649, -649, -293, - -649, -649, 8189, -136, -649, -649, 8189, -171, -649, -649, - -649, 8189, 8189, 8189, 8189, 8189, 8189, 8189, 8189, 8189, - 8189, 8189, 8189, 8189, 8189, 8189, 8189, 8189, 8189, 8189, - -649, -649, -649, -172, -649, -649, -649, -649, 5108, -154, - -234, -251, -649, -649, -649, -649, -649, 1911, -649, 8189, - -649, -649, -245, 8189, -228, -649, -649, -133, -649, 1911, - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, 8189, 8189, -649, -649, -649, -649, -649, -649, -649, - 7040, -649, -285, -649, 5507, -649, -649, -168, -165, -649, - -649, -649, -649, -649, -242, -242, -278, -278, -314, -314, - -314, -314, -333, -333, -209, -219, -217, -215, -180, -181, - 8189, -649, -649, -241, -205, -154, -649, -128, 3111, -290, - -649, -268, -649, 3911, -163, -297, -649, 1911, -649, -649, - -649, -649, 6274, -649, -649, -223, -649, -649, -162, -649, - -649, 3911, -161, -649, -165, -126, 5906, -160, 8189, -159, - -133, -158, -649, -649, 8189, 8189, -649, -164, -156, 196, - -151, 2711, -649, -131, -135, 2311, -152, -649, -649, -649, - -649, -254, 8189, 2311, -161, -649, -649, 1911, 7040, -649, - -649, -649, -649, -134, -165, -649, -649, 1911, -127, -649, - -649, -649 + 3519, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -338, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -331, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -318, -657, -657, -657, -657, -657, -657, + -657, -657, -258, -657, -319, -344, -303, -257, 5920, -281, + -657, -286, -657, -657, -657, -657, 4320, -657, -657, -657, + -657, -227, -657, -657, 712, -657, -657, -224, -68, -246, + -657, 8977, -339, -657, -657, -220, -657, 5920, -657, -657, + -657, 5920, -201, -175, -657, -341, -315, -657, -657, -657, + 6673, -206, -657, -657, -657, -308, -657, -214, -307, -657, + -657, 5920, -213, -657, -337, 1113, -657, -657, -657, -657, + -227, -322, -657, 7057, -321, -657, -167, -657, -261, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, 8209, 8209, 8209, -657, -657, -657, -657, -657, + -657, -657, -328, -657, -657, -657, -202, -285, 8593, -200, + -657, 8209, -244, -238, -266, -334, -207, -219, -217, -218, + -186, -183, -340, -196, -657, -657, 7441, -657, -157, 8209, + -657, -68, 5920, 5920, -156, 4720, -657, -657, -657, -199, + -195, -657, -190, -184, -192, 7825, -181, 8209, -194, -180, + -179, -178, -657, -657, -288, -657, -657, -259, -657, -344, + -174, -172, -657, -657, -657, -657, 1514, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -19, -206, 7057, -312, + 7057, -657, -657, 7057, 5920, -657, -144, -657, -657, -657, + -284, -657, -657, 8209, -143, -657, -657, 8209, -171, -657, + -657, -657, 8209, 8209, 8209, 8209, 8209, 8209, 8209, 8209, + 8209, 8209, 8209, 8209, 8209, 8209, 8209, 8209, 8209, 8209, + 8209, -657, -657, -657, -169, -657, -657, -657, -657, 5120, + -156, -227, -255, -657, -657, -657, -657, -657, 1915, -657, + 8209, -657, -657, -253, 8209, -225, -657, -657, -136, -657, + 1915, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, 8209, 8209, -657, -657, -657, -657, -657, -657, + -657, 7057, -657, -240, -657, 5520, -657, -657, -168, -166, + -657, -657, -657, -657, -657, -244, -244, -238, -238, -266, + -266, -266, -266, -334, -334, -207, -219, -217, -218, -186, + -183, 8209, -657, -657, -247, -206, -156, -657, -132, 3118, + -282, -657, -277, -657, 3920, -164, -276, -657, 1915, -657, + -657, -657, -657, 6289, -657, -657, -221, -657, -657, -162, + -657, -657, 3920, -165, -657, -166, -125, 5920, -159, 8209, + -160, -136, -161, -657, -657, 8209, 8209, -657, -163, -155, + 194, -153, 2717, -657, -152, -134, 2316, -128, -657, -657, + -657, -657, -273, 8209, 2316, -165, -657, -657, 1915, 7057, + -657, -657, -657, -657, -133, -166, -657, -657, 1915, -129, + -657, -657, -657 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1292,90 +1293,90 @@ static const yytype_uint16 yydefact[] = 326, 327, 328, 329, 330, 331, 347, 348, 349, 350, 351, 352, 354, 355, 356, 357, 358, 359, 361, 362, 365, 366, 367, 369, 370, 332, 333, 353, 360, 371, - 373, 374, 375, 377, 378, 469, 334, 335, 336, 363, - 337, 341, 342, 345, 368, 372, 376, 338, 339, 343, - 344, 364, 340, 346, 379, 380, 381, 383, 385, 387, - 389, 391, 395, 396, 397, 398, 399, 400, 402, 403, - 404, 405, 406, 407, 409, 411, 412, 413, 415, 416, - 393, 401, 408, 417, 419, 420, 421, 423, 424, 382, - 384, 386, 410, 388, 390, 392, 394, 414, 418, 422, - 470, 471, 474, 475, 476, 477, 472, 473, 425, 427, - 428, 429, 431, 432, 433, 435, 436, 437, 439, 440, - 441, 443, 444, 445, 447, 448, 449, 451, 452, 453, - 455, 456, 457, 459, 460, 461, 463, 464, 465, 467, - 468, 426, 430, 434, 438, 442, 450, 454, 458, 446, - 462, 466, 0, 194, 479, 564, 131, 146, 480, 481, - 482, 0, 563, 0, 565, 0, 108, 107, 0, 119, - 124, 153, 152, 150, 154, 0, 147, 149, 155, 129, - 188, 151, 478, 0, 560, 562, 0, 0, 0, 485, - 0, 0, 96, 93, 0, 106, 0, 115, 109, 117, - 0, 118, 0, 94, 125, 0, 99, 148, 130, 0, - 189, 1, 561, 186, 0, 145, 143, 0, 141, 483, - 0, 0, 97, 0, 0, 566, 110, 114, 116, 112, - 120, 111, 0, 126, 102, 0, 100, 0, 2, 12, - 13, 10, 11, 4, 5, 6, 7, 8, 9, 15, - 14, 0, 0, 0, 190, 42, 41, 43, 40, 3, - 17, 36, 19, 24, 25, 0, 0, 29, 0, 44, - 0, 48, 51, 54, 59, 62, 64, 66, 68, 70, - 72, 74, 0, 35, 33, 0, 184, 0, 0, 140, - 0, 0, 0, 0, 0, 487, 95, 98, 0, 0, - 545, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 511, 520, 524, 44, 77, 90, 0, 500, 0, 155, - 129, 503, 522, 502, 501, 0, 504, 505, 526, 506, - 533, 507, 508, 541, 509, 0, 113, 0, 121, 0, - 495, 128, 0, 0, 104, 0, 101, 37, 38, 0, - 21, 22, 0, 0, 27, 26, 0, 194, 30, 32, - 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 373, 374, 375, 377, 378, 469, 470, 334, 335, 336, + 363, 337, 341, 342, 345, 368, 372, 376, 338, 339, + 343, 344, 364, 340, 346, 379, 380, 381, 383, 385, + 387, 389, 391, 395, 396, 397, 398, 399, 400, 402, + 403, 404, 405, 406, 407, 409, 411, 412, 413, 415, + 416, 393, 401, 408, 417, 419, 420, 421, 423, 424, + 382, 384, 386, 410, 388, 390, 392, 394, 414, 418, + 422, 471, 472, 475, 476, 477, 478, 473, 474, 425, + 427, 428, 429, 431, 432, 433, 435, 436, 437, 439, + 440, 441, 443, 444, 445, 447, 448, 449, 451, 452, + 453, 455, 456, 457, 459, 460, 461, 463, 464, 465, + 467, 468, 426, 430, 434, 438, 442, 450, 454, 458, + 446, 462, 466, 0, 194, 480, 565, 131, 146, 481, + 482, 483, 0, 564, 0, 566, 0, 108, 107, 0, + 119, 124, 153, 152, 150, 154, 0, 147, 149, 155, + 129, 188, 151, 479, 0, 561, 563, 0, 0, 0, + 486, 0, 0, 96, 93, 0, 106, 0, 115, 109, + 117, 0, 118, 0, 94, 125, 0, 99, 148, 130, + 0, 189, 1, 562, 186, 0, 145, 143, 0, 141, + 484, 0, 0, 97, 0, 0, 567, 110, 114, 116, + 112, 120, 111, 0, 126, 102, 0, 100, 0, 2, + 12, 13, 10, 11, 4, 5, 6, 7, 8, 9, + 15, 14, 0, 0, 0, 190, 42, 41, 43, 40, + 3, 17, 36, 19, 24, 25, 0, 0, 29, 0, + 44, 0, 48, 51, 54, 59, 62, 64, 66, 68, + 70, 72, 74, 0, 35, 33, 0, 184, 0, 0, + 140, 0, 0, 0, 0, 0, 488, 95, 98, 0, + 0, 546, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 512, 521, 525, 44, 77, 90, 0, 501, 0, + 155, 129, 504, 523, 503, 502, 0, 505, 506, 527, + 507, 534, 508, 509, 542, 510, 0, 113, 0, 121, + 0, 496, 128, 0, 0, 104, 0, 101, 37, 38, + 0, 21, 22, 0, 0, 27, 26, 0, 194, 30, + 32, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 75, 191, 192, 0, 187, 92, 144, 142, 0, 0, - 493, 0, 491, 486, 488, 556, 555, 0, 547, 0, - 559, 557, 0, 0, 0, 540, 543, 0, 510, 0, - 80, 81, 83, 82, 85, 86, 87, 88, 89, 84, - 79, 0, 0, 525, 521, 523, 527, 534, 542, 123, - 0, 498, 0, 127, 0, 105, 16, 0, 23, 20, - 31, 45, 46, 47, 50, 49, 52, 53, 57, 58, - 55, 56, 60, 61, 63, 65, 67, 69, 71, 73, - 0, 193, 484, 0, 494, 0, 489, 0, 0, 0, - 558, 0, 539, 0, 570, 0, 568, 512, 78, 91, - 122, 496, 0, 103, 18, 0, 490, 492, 0, 550, - 549, 552, 518, 535, 531, 0, 0, 0, 0, 0, - 0, 0, 497, 499, 0, 0, 551, 0, 0, 530, - 0, 0, 528, 0, 0, 0, 0, 567, 569, 513, - 76, 0, 553, 0, 518, 517, 519, 537, 0, 515, - 544, 514, 571, 0, 554, 548, 529, 538, 0, 532, - 546, 536 + 0, 75, 191, 192, 0, 187, 92, 144, 142, 0, + 0, 494, 0, 492, 487, 489, 557, 556, 0, 548, + 0, 560, 558, 0, 0, 0, 541, 544, 0, 511, + 0, 80, 81, 83, 82, 85, 86, 87, 88, 89, + 84, 79, 0, 0, 526, 522, 524, 528, 535, 543, + 123, 0, 499, 0, 127, 0, 105, 16, 0, 23, + 20, 31, 45, 46, 47, 50, 49, 52, 53, 57, + 58, 55, 56, 60, 61, 63, 65, 67, 69, 71, + 73, 0, 193, 485, 0, 495, 0, 490, 0, 0, + 0, 559, 0, 540, 0, 571, 0, 569, 513, 78, + 91, 122, 497, 0, 103, 18, 0, 491, 493, 0, + 551, 550, 553, 519, 536, 532, 0, 0, 0, 0, + 0, 0, 0, 498, 500, 0, 0, 552, 0, 0, + 531, 0, 0, 529, 0, 0, 0, 0, 568, 570, + 514, 76, 0, 554, 0, 519, 518, 520, 538, 0, + 516, 545, 515, 572, 0, 555, 549, 530, 539, 0, + 533, 547, 537 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, - -649, -649, -304, -649, -373, -370, -416, -379, -294, -322, - -291, -295, -288, -296, -649, -369, -649, -393, -649, -382, - -414, 1, -649, -649, -649, 2, -649, -649, -649, -114, - -109, -112, -649, -649, -615, -649, -649, -649, -649, -196, - -649, -334, -341, -649, 6, -649, 0, -347, -649, -68, - -649, -649, -649, -443, -448, -287, -368, -492, -649, -376, - -482, -648, -415, -649, -649, -427, -426, -649, -649, -93, - -560, -365, -649, -231, -649, -386, -649, -229, -649, -649, - -649, -649, -227, -649, -649, -649, -649, -649, -649, -649, - -649, -76, -649, -649, -649, -649, -390 + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -305, -657, -373, -372, -429, -376, -323, -294, + -324, -295, -293, -296, -657, -370, -657, -394, -657, -383, + -414, 1, -657, -657, -657, 2, -657, -657, -657, -114, + -109, -111, -657, -657, -613, -657, -657, -657, -657, -198, + -657, -335, -342, -657, 6, -657, 0, -350, -657, -70, + -657, -657, -657, -444, -450, -292, -371, -494, -657, -375, + -462, -656, -415, -657, -657, -427, -426, -657, -657, -93, + -563, -366, -657, -232, -657, -387, -657, -230, -657, -657, + -657, -657, -229, -657, -657, -657, -657, -657, -657, -657, + -657, -76, -657, -657, -657, -657, -391 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 429, 430, 431, 607, 432, 433, 434, 435, 436, - 437, 438, 483, 440, 441, 442, 443, 444, 445, 446, - 447, 448, 449, 450, 451, 484, 630, 485, 591, 486, - 556, 487, 333, 513, 407, 488, 335, 336, 337, 367, - 368, 369, 338, 339, 340, 341, 342, 343, 387, 388, - 344, 345, 346, 347, 453, 384, 454, 380, 350, 351, - 352, 461, 390, 464, 465, 561, 562, 511, 602, 491, - 492, 493, 494, 579, 671, 700, 679, 680, 681, 701, - 495, 496, 497, 498, 682, 667, 499, 500, 683, 708, - 501, 502, 503, 643, 567, 638, 661, 677, 678, 504, - 353, 354, 355, 364, 505, 645, 646 + -1, 430, 431, 432, 608, 433, 434, 435, 436, 437, + 438, 439, 484, 441, 442, 443, 444, 445, 446, 447, + 448, 449, 450, 451, 452, 485, 631, 486, 592, 487, + 557, 488, 334, 514, 408, 489, 336, 337, 338, 368, + 369, 370, 339, 340, 341, 342, 343, 344, 388, 389, + 345, 346, 347, 348, 454, 385, 455, 381, 351, 352, + 353, 462, 391, 465, 466, 562, 563, 512, 603, 492, + 493, 494, 495, 580, 672, 701, 680, 681, 682, 702, + 496, 497, 498, 499, 683, 668, 500, 501, 684, 709, + 502, 503, 504, 644, 568, 639, 662, 678, 679, 505, + 354, 355, 356, 365, 506, 646, 647 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1383,438 +1384,559 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 349, 332, 334, 370, 377, 470, 348, 471, 472, 510, - 452, 475, 385, 595, 393, 599, 564, 601, 558, 647, - 603, 361, 358, 538, 539, 549, 363, 403, 665, 377, - 520, 521, 370, 696, 401, 379, 379, 699, 536, 537, - 379, 519, 507, 402, 528, 699, 665, 356, 392, -34, - 455, 522, 506, 508, 455, 523, 462, 512, 540, 541, - 550, 359, 467, 357, 455, 372, 362, 456, 373, 365, - 604, 600, 459, 457, 404, 439, 525, 405, 460, 669, - 406, 606, 526, 670, 662, 637, 553, 592, 515, 555, - 592, 516, 572, 651, 574, 652, 580, 581, 582, 583, - 584, 585, 586, 587, 588, 589, 663, 534, 650, 535, - 564, 366, 592, 374, 510, 590, 510, 517, 518, 510, - 703, 377, 618, 619, 620, 621, 592, 462, 592, 635, - 462, 593, 636, 610, 383, 592, 530, 707, 640, 635, - 608, 379, 656, 328, 329, 330, 531, 532, 533, 542, - 543, 439, 592, 642, 439, 389, 564, 592, 674, 394, - 673, 614, 615, 622, 623, 595, 616, 617, 399, 400, - 455, 458, 514, 466, 524, 529, 544, 545, 546, 462, - 547, 548, 551, 554, 560, 568, 565, 639, 566, 569, - 570, 641, 575, 577, 573, 576, 605, -35, 648, 649, - -33, 578, 609, -28, 631, 644, 709, 510, 654, 658, - 668, 675, 684, 634, 685, 592, -516, 687, 693, 692, - 689, 694, 702, 625, 462, 595, 480, 611, 612, 613, - 439, 439, 439, 439, 439, 439, 439, 439, 439, 439, - 439, 439, 439, 439, 439, 439, 697, 698, 655, 710, - 624, 711, 627, 629, 686, 626, 397, 396, 398, 510, - 628, 664, 659, 360, 557, 695, 705, 657, 706, 386, - 462, 395, 633, 660, 596, 676, 597, 382, 598, 664, - 688, 690, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 691, 0, 0, 0, 0, 0, 555, - 0, 0, 0, 0, 0, 510, 0, 0, 0, 666, - 704, 0, 0, 0, 0, 0, 0, 0, 478, 0, - 0, 0, 0, 0, 0, 377, 0, 666, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 371, 0, 0, - 0, 0, 0, 348, 0, 378, 0, 0, 0, 0, - 0, 348, 0, 349, 332, 334, 0, 0, 0, 348, - 391, 0, 0, 0, 439, 0, 371, 0, 0, 0, - 371, 0, 348, 0, 0, 0, 348, 0, 0, 0, + 350, 333, 335, 371, 378, 471, 349, 472, 473, 511, + 453, 476, 394, 386, 600, 565, 602, 648, 559, 604, + 362, 359, 550, 539, 540, 404, 697, 521, 522, 378, + 700, 666, 371, 402, 596, 380, 357, 380, 700, 456, + 364, 520, 403, 358, 529, 393, -34, 468, 523, 666, + 507, 509, 524, 375, 380, 456, 463, 551, 541, 542, + 360, 508, 513, 405, 456, 363, 406, 457, 460, 407, + 605, 601, 366, 458, 461, 440, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 554, 537, 538, 556, + 526, 607, 573, 663, 575, 591, 527, 593, 664, 593, + 373, 670, 704, 374, 593, 671, 638, 651, 593, 565, + 619, 620, 621, 622, 511, 384, 511, 518, 519, 511, + 516, 378, 593, 517, 367, 594, 636, 463, 593, 637, + 463, 641, 390, 611, 636, 708, 531, 657, 400, 652, + 609, 653, 329, 330, 331, 532, 533, 534, 535, 380, + 536, 440, 543, 544, 440, 565, 593, 643, 395, 674, + 593, 675, 615, 616, 401, 617, 618, 623, 624, 459, + 456, 467, 515, 525, 530, 548, 547, 545, 546, 463, + 549, 552, 555, 561, 569, 566, 596, 640, 576, 567, + 570, 642, 571, 574, 577, 606, 610, 578, 649, 650, + -35, 579, -33, 645, -28, 710, 659, 511, 632, 655, + 669, 635, 676, -517, 685, 593, 686, 688, 690, 695, + 694, 693, 625, 627, 463, 481, 698, 612, 613, 614, + 440, 440, 440, 440, 440, 440, 440, 440, 440, 440, + 440, 440, 440, 440, 440, 440, 596, 703, 656, 699, + 712, 711, 626, 628, 630, 687, 629, 398, 397, 511, + 399, 665, 361, 558, 660, 658, 696, 706, 634, 707, + 463, 387, 396, 661, 597, 677, 598, 599, 383, 665, + 689, 691, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 692, 0, 0, 0, 0, 0, 556, + 0, 0, 0, 0, 0, 511, 0, 0, 0, 667, + 705, 0, 0, 0, 0, 0, 0, 0, 0, 479, + 0, 0, 0, 0, 0, 378, 0, 667, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 372, 0, + 0, 0, 0, 0, 349, 0, 379, 0, 0, 0, + 0, 0, 349, 0, 350, 333, 335, 0, 0, 0, + 349, 392, 0, 0, 440, 0, 0, 372, 0, 0, + 0, 372, 0, 349, 0, 0, 0, 349, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 463, 0, 0, 0, 490, 0, 348, 0, 0, 0, - 489, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 464, 0, 0, 0, 491, 0, 349, 0, 0, + 0, 490, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 463, 559, 0, 463, 0, 0, 348, 348, 0, - 348, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 464, 560, 0, 464, 0, 0, 349, 349, + 0, 349, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 490, 0, 0, 0, 0, - 0, 489, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 463, 0, 0, 0, 0, 0, 348, + 0, 0, 0, 0, 0, 0, 491, 0, 0, 0, + 0, 0, 490, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 464, 0, 0, 0, 0, 0, + 349, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 464, + 0, 0, 0, 0, 0, 349, 0, 0, 491, 0, + 0, 0, 0, 0, 490, 0, 0, 0, 0, 0, + 491, 0, 0, 0, 0, 0, 490, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 463, 0, - 0, 0, 0, 0, 348, 0, 0, 490, 0, 0, - 0, 0, 0, 489, 0, 0, 0, 0, 0, 490, - 0, 0, 0, 0, 0, 489, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 464, 0, 0, 0, 0, + 0, 349, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 463, 0, 0, 0, 0, 0, - 348, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 491, + 0, 0, 0, 0, 491, 490, 0, 0, 491, 0, + 490, 0, 0, 0, 490, 0, 0, 0, 0, 0, + 0, 0, 491, 0, 0, 0, 0, 379, 490, 0, + 0, 0, 0, 349, 0, 0, 0, 0, 0, 0, + 0, 0, 491, 0, 0, 0, 491, 0, 490, 0, + 0, 0, 490, 0, 491, 0, 0, 0, 491, 0, + 490, 0, 0, 0, 490, 0, 0, 0, 491, 0, + 0, 0, 382, 0, 490, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 0, 0, 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 490, 0, - 0, 0, 0, 490, 489, 0, 0, 490, 0, 489, - 0, 0, 0, 489, 0, 0, 0, 0, 0, 0, - 0, 490, 0, 0, 0, 0, 378, 489, 0, 0, - 0, 0, 348, 0, 0, 0, 0, 0, 0, 0, - 0, 490, 0, 0, 0, 490, 0, 489, 0, 0, - 0, 489, 0, 490, 0, 0, 0, 490, 0, 489, - 0, 0, 0, 489, 0, 0, 0, 490, 0, 0, - 0, 381, 0, 489, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 0, 0, - 324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 326, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 325, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 326, 327, - 328, 329, 330, 331, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 468, 469, 470, 0, 471, 472, 473, - 474, 475, 476, 477, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 478, 408, - 324, 409, 410, 411, 412, 413, 414, 415, 416, 417, - 418, 419, 420, 0, 0, 421, 422, 0, 0, 0, + 327, 328, 329, 330, 331, 332, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 469, 470, 471, 0, 472, + 473, 474, 475, 476, 477, 478, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 479, 409, 325, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 0, 0, 422, 423, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 423, 0, 479, 0, 480, 481, - 0, 0, 0, 0, 482, 425, 426, 427, 428, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 326, 327, - 328, 329, 330, 331, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 468, 469, 470, 0, 471, 472, 473, - 474, 475, 476, 477, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 478, 408, - 324, 409, 410, 411, 412, 413, 414, 415, 416, 417, - 418, 419, 420, 0, 0, 421, 422, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 424, 0, 480, + 0, 481, 482, 0, 0, 0, 0, 483, 426, 427, + 428, 429, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 327, 328, 329, 330, 331, 332, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 469, 470, 471, 0, + 472, 473, 474, 475, 476, 477, 478, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 479, 409, 325, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 421, 0, 0, 422, + 423, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 424, 0, + 480, 0, 481, 595, 0, 0, 0, 0, 483, 426, + 427, 428, 429, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 327, 328, 329, 330, 331, 332, 1, 2, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 469, 470, 471, + 0, 472, 473, 474, 475, 476, 477, 478, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 479, 409, 325, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 0, 0, + 422, 423, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 424, + 0, 480, 0, 481, 0, 0, 0, 0, 0, 483, + 426, 427, 428, 429, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 327, 328, 329, 330, 331, 332, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 469, 470, + 471, 0, 472, 473, 474, 475, 476, 477, 478, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 479, 409, 325, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 0, + 0, 422, 423, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 423, 0, 479, 0, 480, 594, - 0, 0, 0, 0, 482, 425, 426, 427, 428, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 326, 327, - 328, 329, 330, 331, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 468, 469, 470, 0, 471, 472, 473, - 474, 475, 476, 477, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 478, 408, - 324, 409, 410, 411, 412, 413, 414, 415, 416, 417, - 418, 419, 420, 0, 0, 421, 422, 0, 0, 0, + 424, 0, 480, 0, 395, 0, 0, 0, 0, 0, + 483, 426, 427, 428, 429, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 327, 328, 329, 330, 331, 332, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 469, + 470, 471, 0, 472, 473, 474, 475, 476, 477, 478, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 323, 324, 479, 409, 325, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 0, 0, 422, 423, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 424, 0, 480, 0, 0, 0, 0, 0, 0, + 0, 483, 426, 427, 428, 429, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 327, 328, 329, 330, 331, + 332, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 0, 409, 325, 410, + 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, + 421, 0, 0, 422, 423, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 424, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 483, 426, 427, 428, 429, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 327, 328, 329, 330, + 331, 332, 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 0, 0, 325, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 326, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 327, 328, 329, + 330, 331, 332, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 0, 409, + 325, 410, 411, 412, 413, 414, 415, 416, 417, 418, + 419, 420, 421, 0, 0, 422, 423, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 423, 0, 479, 0, 480, 0, - 0, 0, 0, 0, 482, 425, 426, 427, 428, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 326, 327, - 328, 329, 330, 331, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 468, 469, 470, 0, 471, 472, 473, - 474, 475, 476, 477, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 478, 408, - 324, 409, 410, 411, 412, 413, 414, 415, 416, 417, - 418, 419, 420, 0, 0, 421, 422, 0, 0, 0, + 0, 0, 0, 0, 424, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 426, 427, 428, 429, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 327, 328, + 329, 330, 331, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 0, 376, + 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 423, 0, 479, 0, 394, 0, - 0, 0, 0, 0, 482, 425, 426, 427, 428, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 326, 327, - 328, 329, 330, 331, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 468, 469, 470, 0, 471, 472, 473, - 474, 475, 476, 477, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 478, 408, - 324, 409, 410, 411, 412, 413, 414, 415, 416, 417, - 418, 419, 420, 0, 0, 421, 422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 423, 0, 479, 0, 0, 0, - 0, 0, 0, 0, 482, 425, 426, 427, 428, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 326, 327, - 328, 329, 330, 331, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 0, 408, - 324, 409, 410, 411, 412, 413, 414, 415, 416, 417, - 418, 419, 420, 0, 0, 421, 422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 423, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 482, 425, 426, 427, 428, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 326, 327, - 328, 329, 330, 331, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 0, 0, - 324, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 377, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 327, 328, + 329, 330, 331, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 0, 0, + 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 564, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 327, 328, + 329, 330, 331, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 0, 0, + 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 325, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 326, 327, - 328, 329, 330, 331, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 0, 408, - 324, 409, 410, 411, 412, 413, 414, 415, 416, 417, - 418, 419, 420, 0, 0, 421, 422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 423, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 425, 426, 427, 428, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 326, 327, - 328, 329, 330, 1, 2, 3, 4, 5, 6, 7, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 633, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 327, 328, + 329, 330, 331, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, @@ -1847,26 +1969,63 @@ static const yytype_int16 yytable[] = 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 321, 322, 323, 0, 375, 324, + 317, 318, 319, 320, 321, 322, 323, 324, 0, 0, + 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 654, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 327, 328, + 329, 330, 331, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 0, 0, + 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 376, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 326, 327, 328, - 329, 330, 1, 2, 3, 4, 5, 6, 7, 8, + 0, 0, 0, 0, 3, 4, 5, 6, 7, 0, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 20, 21, 22, 23, 24, 25, 26, 27, + 19, 0, 0, 0, 0, 0, 0, 0, 327, 328, + 329, 330, 331, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 58, 59, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, @@ -1887,169 +2046,51 @@ static const yytype_int16 yytable[] = 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, 320, 321, 322, 323, 0, 0, 324, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 563, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 326, 327, 328, 329, - 330, 1, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 0, 0, 324, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 632, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 326, 327, 328, 329, 330, - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 320, 321, 322, 323, 0, 0, 324, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 326, 327, 328, 329, 330, 1, - 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 0, 0, 324, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 318, 319, 320, 321, 322, 323, 324, 0, 409, 325, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 421, 0, 0, 422, 423, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 4, 5, 6, 7, 0, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, - 0, 0, 0, 326, 327, 328, 329, 330, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, + 0, 0, 0, 424, 0, 0, 0, 510, 673, 0, + 0, 0, 0, 0, 426, 427, 428, 429, 3, 4, + 5, 6, 7, 0, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 0, 408, 324, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 0, 0, 421, 422, + 0, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 0, 409, 325, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 0, 0, 422, 423, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 423, 0, 0, - 0, 509, 672, 0, 0, 0, 0, 0, 425, 426, - 427, 428, 3, 4, 5, 6, 7, 0, 9, 10, + 0, 0, 0, 0, 0, 0, 0, 424, 0, 0, + 425, 0, 0, 0, 0, 0, 0, 0, 426, 427, + 428, 429, 3, 4, 5, 6, 7, 0, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 22, 23, 24, 25, 26, 27, 28, 29, @@ -2082,50 +2123,127 @@ static const yytype_int16 yytable[] = 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 320, 321, 322, 323, 0, 408, 324, 409, 410, 411, - 412, 413, 414, 415, 416, 417, 418, 419, 420, 0, - 0, 421, 422, 0, 0, 0, 0, 0, 0, 0, + 320, 321, 322, 323, 324, 0, 409, 325, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 0, 0, 422, 423, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 423, 0, 0, 424, 0, 0, 0, 0, 0, 0, - 0, 425, 426, 427, 428, 3, 4, 5, 6, 7, - 0, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 321, 322, 323, 0, 408, 324, - 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 0, 0, 421, 422, 0, 0, 0, 0, + 0, 424, 0, 0, 0, 510, 0, 0, 0, 0, + 0, 0, 426, 427, 428, 429, 3, 4, 5, 6, + 7, 0, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 0, + 409, 325, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 421, 0, 0, 422, 423, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 424, 0, 0, 553, 0, + 0, 0, 0, 0, 0, 0, 426, 427, 428, 429, + 3, 4, 5, 6, 7, 0, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 69, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 0, 409, 325, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 0, 0, + 422, 423, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 424, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 572, + 426, 427, 428, 429, 3, 4, 5, 6, 7, 0, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 0, 409, 325, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 421, 0, 0, 422, 423, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 423, 0, 0, 0, 509, 0, 0, - 0, 0, 0, 0, 425, 426, 427, 428, 3, 4, + 0, 0, 0, 424, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 426, 427, 428, 429, 3, 4, 5, 6, 7, 0, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 22, 23, @@ -2159,62 +2277,132 @@ static const yytype_int16 yytable[] = 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, - 0, 408, 324, 409, 410, 411, 412, 413, 414, 415, - 416, 417, 418, 419, 420, 0, 0, 421, 422, 0, + 528, 0, 409, 325, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 0, 0, 422, 423, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 423, 0, 0, 552, - 0, 0, 0, 0, 0, 0, 0, 425, 426, 427, - 428, 3, 4, 5, 6, 7, 0, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 424, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 426, 427, + 428, 429, 3, 4, 5, 6, 7, 0, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 69, 0, + 0, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 0, 408, 324, 409, 410, 411, 412, - 413, 414, 415, 416, 417, 418, 419, 420, 0, 0, - 421, 422, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 423, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 571, - 425, 426, 427, 428, 3, 4, 5, 6, 7, 0, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 323, 324, 0, 0, 325 +}; + +static const yytype_int16 yycheck[] = +{ + 0, 0, 0, 338, 346, 24, 0, 26, 27, 403, + 380, 30, 362, 81, 508, 465, 510, 580, 462, 513, + 339, 339, 362, 357, 358, 375, 682, 355, 356, 371, + 686, 644, 367, 374, 496, 376, 374, 376, 694, 376, + 384, 424, 383, 374, 438, 384, 374, 384, 376, 662, + 400, 401, 380, 339, 376, 376, 391, 397, 392, 393, + 378, 383, 383, 378, 376, 384, 381, 375, 375, 384, + 514, 383, 375, 381, 381, 380, 364, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 456, 353, 354, 459, + 375, 375, 475, 375, 477, 383, 381, 381, 375, 381, + 381, 377, 375, 384, 381, 381, 568, 601, 381, 559, + 539, 540, 541, 542, 508, 339, 510, 422, 423, 513, + 381, 463, 381, 384, 381, 384, 381, 462, 381, 384, + 465, 384, 378, 527, 381, 698, 441, 384, 339, 379, + 523, 381, 400, 401, 402, 389, 390, 391, 386, 376, + 388, 456, 359, 360, 459, 605, 381, 382, 378, 653, + 381, 382, 535, 536, 339, 537, 538, 543, 544, 383, + 376, 384, 339, 375, 374, 361, 394, 396, 395, 514, + 363, 377, 339, 339, 374, 384, 648, 570, 382, 384, + 374, 574, 384, 374, 374, 339, 339, 376, 592, 593, + 374, 379, 374, 339, 375, 699, 338, 601, 377, 377, + 374, 561, 374, 378, 339, 381, 375, 377, 379, 25, + 375, 384, 545, 547, 559, 378, 378, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, + 545, 546, 547, 548, 549, 550, 708, 375, 631, 383, + 379, 384, 546, 548, 550, 669, 549, 371, 367, 653, + 371, 644, 332, 461, 639, 636, 681, 694, 560, 695, + 605, 339, 365, 639, 506, 662, 506, 506, 354, 662, + 671, 675, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 676, -1, -1, -1, -1, -1, 669, + -1, -1, -1, -1, -1, 699, -1, -1, -1, 644, + 693, -1, -1, -1, -1, -1, -1, -1, -1, 338, + -1, -1, -1, -1, -1, 667, -1, 662, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 338, -1, + -1, -1, -1, -1, 338, -1, 346, -1, -1, -1, + -1, -1, 346, -1, 354, 354, 354, -1, -1, -1, + 354, 361, -1, -1, 669, -1, -1, 367, -1, -1, + -1, 371, -1, 367, -1, -1, -1, 371, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 391, -1, -1, -1, 395, -1, 391, -1, -1, + -1, 395, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 462, 463, -1, 465, -1, -1, 462, 463, + -1, 465, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 496, -1, -1, -1, + -1, -1, 496, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 514, -1, -1, -1, -1, -1, + 514, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 559, + -1, -1, -1, -1, -1, 559, -1, -1, 568, -1, + -1, -1, -1, -1, 568, -1, -1, -1, -1, -1, + 580, -1, -1, -1, -1, -1, 580, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 605, -1, -1, -1, -1, + -1, 605, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 639, + -1, -1, -1, -1, 644, 639, -1, -1, 648, -1, + 644, -1, -1, -1, 648, -1, -1, -1, -1, -1, + -1, -1, 662, -1, -1, -1, -1, 667, 662, -1, + -1, -1, -1, 667, -1, -1, -1, -1, -1, -1, + -1, -1, 682, -1, -1, -1, 686, -1, 682, -1, + -1, -1, 686, -1, 694, -1, -1, -1, 698, -1, + 694, -1, -1, -1, 698, -1, -1, -1, 708, -1, + -1, -1, 0, -1, 708, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 85, 86, 87, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, @@ -2235,25 +2423,107 @@ static const yytype_int16 yytable[] = 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, 320, 321, 322, 323, 0, 408, 324, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 0, 0, 421, 422, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 423, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 425, 426, 427, 428, 3, 4, 5, - 6, 7, 0, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, + 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + -1, -1, 340, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 384, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 398, 399, 400, 401, 402, 403, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, -1, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + 347, 348, 349, 350, 351, 352, -1, -1, 355, 356, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 374, -1, 376, + -1, 378, 379, -1, -1, -1, -1, 384, 385, 386, + 387, 388, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 398, 399, 400, 401, 402, 403, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, -1, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, + 346, 347, 348, 349, 350, 351, 352, -1, -1, 355, + 356, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 374, -1, + 376, -1, 378, 379, -1, -1, -1, -1, 384, 385, + 386, 387, 388, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 398, 399, 400, 401, 402, 403, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, @@ -2273,25 +2543,107 @@ static const yytype_int16 yytable[] = 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 527, 0, - 408, 324, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 0, 0, 421, 422, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 423, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 425, 426, 427, 428, - 3, 4, 5, 6, 7, 0, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, -1, -1, + 355, 356, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 374, + -1, 376, -1, 378, -1, -1, -1, -1, -1, 384, + 385, 386, 387, 388, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 398, 399, 400, 401, 402, 403, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, -1, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, + 344, 345, 346, 347, 348, 349, 350, 351, 352, -1, + -1, 355, 356, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 374, -1, 376, -1, 378, -1, -1, -1, -1, -1, + 384, 385, 386, 387, 388, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 398, 399, 400, 401, 402, 403, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, -1, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + -1, -1, 355, 356, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 374, -1, 376, -1, -1, -1, -1, -1, -1, + -1, 384, 385, 386, 387, 388, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 398, 399, 400, 401, 402, + 403, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 85, 86, 87, 88, 89, 90, 91, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 118, 119, 120, 121, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, @@ -2312,443 +2664,175 @@ static const yytype_int16 yytable[] = 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 0, 0, 324 -}; - -static const yytype_int16 yycheck[] = -{ - 0, 0, 0, 337, 345, 24, 0, 26, 27, 402, - 379, 30, 81, 495, 361, 507, 464, 509, 461, 579, - 512, 338, 338, 356, 357, 361, 383, 374, 643, 370, - 354, 355, 366, 681, 373, 375, 375, 685, 352, 353, - 375, 423, 382, 382, 437, 693, 661, 373, 383, 373, - 375, 375, 399, 400, 375, 379, 390, 382, 391, 392, - 396, 377, 383, 373, 375, 380, 383, 374, 383, 374, - 513, 382, 374, 380, 377, 379, 374, 380, 380, 376, - 383, 374, 380, 380, 374, 567, 455, 380, 380, 458, - 380, 383, 474, 378, 476, 380, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 374, 385, 600, 387, - 558, 380, 380, 338, 507, 382, 509, 421, 422, 512, - 374, 462, 538, 539, 540, 541, 380, 461, 380, 380, - 464, 383, 383, 526, 338, 380, 440, 697, 383, 380, - 522, 375, 383, 399, 400, 401, 388, 389, 390, 358, - 359, 455, 380, 381, 458, 377, 604, 380, 381, 377, - 652, 534, 535, 542, 543, 647, 536, 537, 338, 338, - 375, 382, 338, 383, 374, 373, 395, 394, 393, 513, - 360, 362, 376, 338, 338, 373, 383, 569, 383, 373, - 383, 573, 381, 375, 373, 373, 338, 373, 591, 592, - 373, 378, 338, 374, 376, 338, 698, 600, 376, 337, - 373, 373, 338, 560, 374, 380, 377, 376, 374, 383, - 378, 25, 374, 545, 558, 707, 377, 531, 532, 533, - 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, - 544, 545, 546, 547, 548, 549, 377, 382, 630, 383, - 544, 378, 547, 549, 668, 546, 370, 366, 370, 652, - 548, 643, 638, 331, 460, 680, 693, 635, 694, 338, - 604, 364, 559, 638, 505, 661, 505, 353, 505, 661, - 670, 674, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 675, -1, -1, -1, -1, -1, 668, - -1, -1, -1, -1, -1, 698, -1, -1, -1, 643, - 692, -1, -1, -1, -1, -1, -1, -1, 337, -1, - -1, -1, -1, -1, -1, 666, -1, 661, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 337, -1, -1, - -1, -1, -1, 337, -1, 345, -1, -1, -1, -1, - -1, 345, -1, 353, 353, 353, -1, -1, -1, 353, - 360, -1, -1, -1, 668, -1, 366, -1, -1, -1, - 370, -1, 366, -1, -1, -1, 370, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 390, -1, -1, -1, 394, -1, 390, -1, -1, -1, - 394, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 461, 462, -1, 464, -1, -1, 461, 462, -1, - 464, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 495, -1, -1, -1, -1, - -1, 495, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 513, -1, -1, -1, -1, -1, 513, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 558, -1, - -1, -1, -1, -1, 558, -1, -1, 567, -1, -1, - -1, -1, -1, 567, -1, -1, -1, -1, -1, 579, - -1, -1, -1, -1, -1, 579, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 604, -1, -1, -1, -1, -1, - 604, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 638, -1, - -1, -1, -1, 643, 638, -1, -1, 647, -1, 643, - -1, -1, -1, 647, -1, -1, -1, -1, -1, -1, - -1, 661, -1, -1, -1, -1, 666, 661, -1, -1, - -1, -1, 666, -1, -1, -1, -1, -1, -1, -1, - -1, 681, -1, -1, -1, 685, -1, 681, -1, -1, - -1, 685, -1, 693, -1, -1, -1, 697, -1, 693, - -1, -1, -1, 697, -1, -1, -1, 707, -1, -1, - -1, 0, -1, 707, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, -1, -1, - 339, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 383, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, - 399, 400, 401, 402, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, -1, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, - 349, 350, 351, -1, -1, 354, 355, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 373, -1, 375, -1, 377, 378, - -1, -1, -1, -1, 383, 384, 385, 386, 387, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, - 399, 400, 401, 402, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, -1, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, - 349, 350, 351, -1, -1, 354, 355, -1, -1, -1, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, + 332, 333, 334, 335, 336, 337, -1, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, + 352, -1, -1, 355, 356, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 373, -1, 375, -1, 377, 378, - -1, -1, -1, -1, 383, 384, 385, 386, 387, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, - 399, 400, 401, 402, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, -1, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, - 349, 350, 351, -1, -1, 354, 355, -1, -1, -1, + -1, -1, 374, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 384, 385, 386, 387, 388, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 398, 399, 400, 401, + 402, 403, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, -1, -1, 340, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 373, -1, 375, -1, 377, -1, - -1, -1, -1, -1, 383, 384, 385, 386, 387, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, - 399, 400, 401, 402, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, -1, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, - 349, 350, 351, -1, -1, 354, 355, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 373, -1, 375, -1, 377, -1, - -1, -1, -1, -1, 383, 384, 385, 386, 387, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, - 399, 400, 401, 402, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, -1, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, - 349, 350, 351, -1, -1, 354, 355, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 373, -1, 375, -1, -1, -1, - -1, -1, -1, -1, 383, 384, 385, 386, 387, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, - 399, 400, 401, 402, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, -1, 338, - 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, - 349, 350, 351, -1, -1, 354, 355, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 373, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 383, 384, 385, 386, 387, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, - 399, 400, 401, 402, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, -1, -1, - 339, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 384, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 398, 399, 400, + 401, 402, 403, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, -1, 339, + 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, -1, -1, 355, 356, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 374, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 385, 386, 387, 388, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 398, 399, + 400, 401, 402, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, -1, 339, + 340, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 383, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, - 399, 400, 401, 402, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, -1, 338, - 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, - 349, 350, 351, -1, -1, 354, 355, -1, -1, -1, + -1, -1, -1, -1, 384, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 398, 399, + 400, 401, 402, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, -1, -1, + 340, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 379, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 373, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 384, 385, 386, 387, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 397, 398, - 399, 400, 401, 3, 4, 5, 6, 7, 8, 9, + -1, -1, -1, -1, -1, -1, -1, -1, 398, 399, + 400, 401, 402, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, @@ -2781,260 +2865,67 @@ static const yytype_int16 yycheck[] = 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, - 330, 331, 332, 333, 334, 335, 336, -1, 338, 339, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 383, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 397, 398, 399, - 400, 401, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, -1, -1, 339, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 378, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 397, 398, 399, 400, - 401, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, - 332, 333, 334, 335, 336, -1, -1, 339, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 378, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 397, 398, 399, 400, 401, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, -1, -1, 339, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 378, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 397, 398, 399, 400, 401, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, - 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, - 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, -1, -1, 339, -1, -1, -1, -1, + 330, 331, 332, 333, 334, 335, 336, 337, -1, -1, + 340, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, - 6, 7, 8, 9, -1, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, - -1, -1, -1, 397, 398, 399, 400, 401, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 82, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, - 336, -1, 338, 339, 340, 341, 342, 343, 344, 345, - 346, 347, 348, 349, 350, 351, -1, -1, 354, 355, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 379, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 373, -1, -1, - -1, 377, 378, -1, -1, -1, -1, -1, 384, 385, - 386, 387, 5, 6, 7, 8, 9, -1, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 398, 399, + 400, 401, 402, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, -1, -1, + 340, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, -1, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, -1, - -1, 354, 355, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 379, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 373, -1, -1, 376, -1, -1, -1, -1, -1, -1, - -1, 384, 385, 386, 387, 5, 6, 7, 8, 9, - -1, 11, 12, 13, 14, 15, 16, 17, 18, 19, + -1, -1, -1, -1, -1, -1, -1, -1, 398, 399, + 400, 401, 402, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 34, 35, 36, 37, 38, 39, + -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 82, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 98, 99, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, @@ -3054,12 +2945,49 @@ static const yytype_int16 yycheck[] = 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, - 330, 331, 332, 333, 334, 335, 336, -1, 338, 339, - 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, -1, -1, 354, 355, -1, -1, -1, -1, + 330, 331, 332, 333, 334, 335, 336, 337, -1, -1, + 340, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 5, 6, 7, 8, 9, -1, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, -1, -1, -1, -1, -1, -1, -1, 398, 399, + 400, 401, 402, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 82, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, -1, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, -1, -1, 355, 356, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 373, -1, -1, -1, 377, -1, -1, - -1, -1, -1, -1, 384, 385, 386, 387, 5, 6, + -1, -1, -1, 374, -1, -1, -1, 378, 379, -1, + -1, -1, -1, -1, 385, 386, 387, 388, 5, 6, 7, 8, 9, -1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 35, 36, @@ -3093,50 +3021,127 @@ static const yytype_int16 yycheck[] = 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, - -1, 338, 339, 340, 341, 342, 343, 344, 345, 346, - 347, 348, 349, 350, 351, -1, -1, 354, 355, -1, + 337, -1, 339, 340, 341, 342, 343, 344, 345, 346, + 347, 348, 349, 350, 351, 352, -1, -1, 355, 356, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 373, -1, -1, 376, - -1, -1, -1, -1, -1, -1, -1, 384, 385, 386, - 387, 5, 6, 7, 8, 9, -1, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 374, -1, -1, + 377, -1, -1, -1, -1, -1, -1, -1, 385, 386, + 387, 388, 5, 6, 7, 8, 9, -1, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 82, -1, + -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 82, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, - 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, - 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, -1, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, -1, -1, - 354, 355, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 373, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 383, - 384, 385, 386, 387, 5, 6, 7, 8, 9, -1, + -1, -1, -1, -1, -1, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, -1, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + -1, -1, 355, 356, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 374, -1, -1, -1, 378, -1, -1, -1, -1, + -1, -1, 385, 386, 387, 388, 5, 6, 7, 8, + 9, -1, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 82, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, -1, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, 351, 352, -1, -1, 355, 356, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 374, -1, -1, 377, -1, + -1, -1, -1, -1, -1, -1, 385, 386, 387, 388, + 5, 6, 7, 8, 9, -1, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 82, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, -1, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, -1, -1, + 355, 356, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 374, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 384, + 385, 386, 387, 388, 5, 6, 7, 8, 9, -1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 35, 36, 37, 38, 39, 40, @@ -3169,84 +3174,84 @@ static const yytype_int16 yycheck[] = 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, -1, 338, 339, 340, + 331, 332, 333, 334, 335, 336, 337, -1, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, - 351, -1, -1, 354, 355, -1, -1, -1, -1, -1, + 351, 352, -1, -1, 355, 356, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 373, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 384, 385, 386, 387, 5, 6, 7, - 8, 9, -1, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 82, -1, -1, -1, -1, -1, + -1, -1, -1, 374, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 385, 386, 387, 388, 5, 6, + 7, 8, 9, -1, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 82, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, -1, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, - 348, 349, 350, 351, -1, -1, 354, 355, -1, -1, + -1, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, -1, 339, 340, 341, 342, 343, 344, 345, 346, + 347, 348, 349, 350, 351, 352, -1, -1, 355, 356, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 373, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 384, 385, 386, 387, - 5, 6, 7, 8, 9, -1, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 374, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 385, 386, + 387, 388, 5, 6, 7, 8, 9, -1, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, -1, -1, 339 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, -1, -1, 340 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -3285,109 +3290,109 @@ static const yytype_uint16 yystos[] = 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 339, 383, 397, 398, 399, 400, - 401, 402, 437, 438, 441, 442, 443, 444, 448, 449, - 450, 451, 452, 453, 456, 457, 458, 459, 460, 462, - 464, 465, 466, 506, 507, 508, 373, 373, 338, 377, - 465, 338, 383, 383, 509, 374, 380, 445, 446, 447, - 457, 462, 380, 383, 338, 338, 383, 458, 462, 375, - 463, 0, 507, 338, 461, 81, 338, 454, 455, 377, - 468, 462, 383, 463, 377, 485, 446, 445, 447, 338, - 338, 373, 382, 463, 377, 380, 383, 440, 338, 340, + 333, 334, 335, 336, 337, 340, 384, 398, 399, 400, + 401, 402, 403, 438, 439, 442, 443, 444, 445, 449, + 450, 451, 452, 453, 454, 457, 458, 459, 460, 461, + 463, 465, 466, 467, 507, 508, 509, 374, 374, 339, + 378, 466, 339, 384, 384, 510, 375, 381, 446, 447, + 448, 458, 463, 381, 384, 339, 339, 384, 459, 463, + 376, 464, 0, 508, 339, 462, 81, 339, 455, 456, + 378, 469, 463, 384, 464, 378, 486, 447, 446, 448, + 339, 339, 374, 383, 464, 378, 381, 384, 441, 339, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, - 351, 354, 355, 373, 376, 384, 385, 386, 387, 407, - 408, 409, 411, 412, 413, 414, 415, 416, 417, 418, + 351, 352, 355, 356, 374, 377, 385, 386, 387, 388, + 408, 409, 410, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 460, 462, 375, 374, 380, 382, 374, - 380, 467, 457, 462, 469, 470, 383, 383, 22, 23, - 24, 26, 27, 28, 29, 30, 31, 32, 337, 375, - 377, 378, 383, 418, 431, 433, 435, 437, 441, 460, - 462, 475, 476, 477, 478, 486, 487, 488, 489, 492, - 493, 496, 497, 498, 505, 510, 463, 382, 463, 377, - 433, 473, 382, 439, 338, 380, 383, 418, 418, 435, - 354, 355, 375, 379, 374, 374, 380, 336, 433, 373, - 418, 388, 389, 390, 385, 387, 352, 353, 356, 357, - 391, 392, 358, 359, 395, 394, 393, 360, 362, 361, - 396, 376, 376, 431, 338, 431, 436, 455, 469, 462, - 338, 471, 472, 378, 470, 383, 383, 500, 373, 373, - 383, 383, 435, 373, 435, 381, 373, 375, 378, 479, - 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, - 382, 434, 380, 383, 378, 476, 489, 493, 498, 473, - 382, 473, 474, 473, 469, 338, 374, 410, 435, 338, - 433, 418, 418, 418, 420, 420, 421, 421, 422, 422, - 422, 422, 423, 423, 424, 425, 426, 427, 428, 429, - 432, 376, 378, 471, 463, 380, 383, 476, 501, 435, - 383, 435, 381, 499, 338, 511, 512, 486, 433, 433, - 473, 378, 380, 378, 376, 435, 383, 472, 337, 475, - 487, 502, 374, 374, 435, 450, 457, 491, 373, 376, - 380, 480, 378, 473, 381, 373, 491, 503, 504, 482, - 483, 484, 490, 494, 338, 374, 436, 376, 512, 378, - 433, 435, 383, 374, 25, 478, 477, 377, 382, 477, - 481, 485, 374, 374, 435, 481, 482, 486, 495, 473, - 383, 378 + 429, 430, 431, 432, 461, 463, 376, 375, 381, 383, + 375, 381, 468, 458, 463, 470, 471, 384, 384, 22, + 23, 24, 26, 27, 28, 29, 30, 31, 32, 338, + 376, 378, 379, 384, 419, 432, 434, 436, 438, 442, + 461, 463, 476, 477, 478, 479, 487, 488, 489, 490, + 493, 494, 497, 498, 499, 506, 511, 464, 383, 464, + 378, 434, 474, 383, 440, 339, 381, 384, 419, 419, + 436, 355, 356, 376, 380, 375, 375, 381, 337, 434, + 374, 419, 389, 390, 391, 386, 388, 353, 354, 357, + 358, 392, 393, 359, 360, 396, 395, 394, 361, 363, + 362, 397, 377, 377, 432, 339, 432, 437, 456, 470, + 463, 339, 472, 473, 379, 471, 384, 384, 501, 374, + 374, 384, 384, 436, 374, 436, 382, 374, 376, 379, + 480, 364, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 383, 435, 381, 384, 379, 477, 490, 494, 499, + 474, 383, 474, 475, 474, 470, 339, 375, 411, 436, + 339, 434, 419, 419, 419, 421, 421, 422, 422, 423, + 423, 423, 423, 424, 424, 425, 426, 427, 428, 429, + 430, 433, 377, 379, 472, 464, 381, 384, 477, 502, + 436, 384, 436, 382, 500, 339, 512, 513, 487, 434, + 434, 474, 379, 381, 379, 377, 436, 384, 473, 338, + 476, 488, 503, 375, 375, 436, 451, 458, 492, 374, + 377, 381, 481, 379, 474, 382, 374, 492, 504, 505, + 483, 484, 485, 491, 495, 339, 375, 437, 377, 513, + 379, 434, 436, 384, 375, 25, 479, 478, 378, 383, + 478, 482, 486, 375, 375, 436, 482, 483, 487, 496, + 474, 384, 379 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint16 yyr1[] = { - 0, 406, 407, 408, 408, 408, 408, 408, 408, 408, - 408, 408, 408, 408, 408, 408, 408, 409, 409, 409, - 409, 409, 409, 410, 411, 412, 413, 413, 414, 414, - 415, 415, 416, 417, 417, 417, 418, 418, 418, 418, - 419, 419, 419, 419, 420, 420, 420, 420, 421, 421, - 421, 422, 422, 422, 423, 423, 423, 423, 423, 424, - 424, 424, 425, 425, 426, 426, 427, 427, 428, 428, - 429, 429, 430, 430, 431, 432, 431, 433, 433, 434, - 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, - 435, 435, 436, 437, 437, 437, 437, 437, 437, 437, - 437, 437, 439, 438, 440, 440, 441, 442, 442, 443, - 443, 444, 445, 445, 446, 446, 446, 446, 447, 448, - 448, 448, 448, 448, 449, 449, 449, 449, 449, 450, - 450, 451, 452, 452, 452, 452, 452, 452, 452, 452, - 453, 454, 454, 455, 455, 455, 456, 457, 457, 458, - 458, 458, 458, 458, 458, 458, 459, 459, 459, 459, - 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, - 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, - 459, 459, 459, 459, 459, 460, 461, 461, 462, 462, - 463, 463, 463, 463, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 465, 465, 465, 467, 466, 468, 466, 469, 469, 470, - 470, 471, 471, 472, 472, 473, 473, 473, 474, 474, - 475, 476, 476, 477, 477, 477, 477, 477, 477, 477, - 478, 479, 480, 478, 481, 481, 483, 482, 484, 482, - 485, 485, 486, 486, 487, 487, 488, 488, 489, 490, - 490, 491, 491, 492, 492, 494, 493, 495, 495, 496, - 496, 497, 497, 499, 498, 500, 498, 501, 498, 502, - 502, 503, 503, 504, 504, 505, 505, 505, 505, 505, - 506, 506, 507, 507, 507, 509, 508, 510, 511, 511, - 512, 512 + 0, 407, 408, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 410, 410, 410, + 410, 410, 410, 411, 412, 413, 414, 414, 415, 415, + 416, 416, 417, 418, 418, 418, 419, 419, 419, 419, + 420, 420, 420, 420, 421, 421, 421, 421, 422, 422, + 422, 423, 423, 423, 424, 424, 424, 424, 424, 425, + 425, 425, 426, 426, 427, 427, 428, 428, 429, 429, + 430, 430, 431, 431, 432, 433, 432, 434, 434, 435, + 435, 435, 435, 435, 435, 435, 435, 435, 435, 435, + 436, 436, 437, 438, 438, 438, 438, 438, 438, 438, + 438, 438, 440, 439, 441, 441, 442, 443, 443, 444, + 444, 445, 446, 446, 447, 447, 447, 447, 448, 449, + 449, 449, 449, 449, 450, 450, 450, 450, 450, 451, + 451, 452, 453, 453, 453, 453, 453, 453, 453, 453, + 454, 455, 455, 456, 456, 456, 457, 458, 458, 459, + 459, 459, 459, 459, 459, 459, 460, 460, 460, 460, + 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, + 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, + 460, 460, 460, 460, 460, 461, 462, 462, 463, 463, + 464, 464, 464, 464, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 466, 466, 466, 468, 467, 469, 467, 470, 470, + 471, 471, 472, 472, 473, 473, 474, 474, 474, 475, + 475, 476, 477, 477, 478, 478, 478, 478, 478, 478, + 478, 479, 480, 481, 479, 482, 482, 484, 483, 485, + 483, 486, 486, 487, 487, 488, 488, 489, 489, 490, + 491, 491, 492, 492, 493, 493, 495, 494, 496, 496, + 497, 497, 498, 498, 500, 499, 501, 499, 502, 499, + 503, 503, 504, 504, 505, 505, 506, 506, 506, 506, + 506, 507, 507, 508, 508, 508, 510, 509, 511, 512, + 512, 513, 513 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ @@ -3441,16 +3446,16 @@ static const yytype_uint8 yyr2[] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 6, 0, 5, 1, 2, 3, - 4, 1, 3, 1, 2, 1, 3, 4, 1, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 0, 0, 5, 1, 1, 0, 2, 0, 2, - 2, 3, 1, 2, 1, 2, 1, 2, 5, 3, - 1, 1, 4, 1, 2, 0, 8, 0, 1, 3, - 2, 1, 2, 0, 6, 0, 8, 0, 7, 1, - 1, 1, 0, 2, 3, 2, 2, 2, 3, 2, - 1, 2, 1, 1, 1, 0, 3, 5, 1, 3, - 1, 4 + 1, 1, 1, 1, 0, 6, 0, 5, 1, 2, + 3, 4, 1, 3, 1, 2, 1, 3, 4, 1, + 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 0, 0, 5, 1, 1, 0, 2, 0, + 2, 2, 3, 1, 2, 1, 2, 1, 2, 5, + 3, 1, 1, 4, 1, 2, 0, 8, 0, 1, + 3, 2, 1, 2, 0, 6, 0, 8, 0, 7, + 1, 1, 1, 0, 2, 3, 2, 2, 2, 3, + 2, 1, 2, 1, 1, 1, 0, 3, 5, 1, + 3, 1, 4 }; @@ -4133,250 +4138,250 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); switch (yyn) { case 2: -#line 294 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 296 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleVariable((yyvsp[0].lex).loc, (yyvsp[0].lex).symbol, (yyvsp[0].lex).string); } -#line 4141 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4146 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 3: -#line 300 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 302 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4149 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4154 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 4: -#line 303 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 305 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 4158 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4163 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 5: -#line 307 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 309 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 4167 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4172 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 6: -#line 311 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 313 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 4175 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4180 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 7: -#line 314 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 316 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 4184 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4189 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 8: -#line 318 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 320 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i64, (yyvsp[0].lex).loc, true); } -#line 4193 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4198 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 9: -#line 322 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 324 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u64, (yyvsp[0].lex).loc, true); } -#line 4202 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4207 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 10: -#line 326 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 328 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((short)(yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 4211 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4216 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 11: -#line 330 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 332 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((unsigned short)(yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 4220 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4225 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 12: -#line 334 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 336 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 4228 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4233 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 13: -#line 337 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 339 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtDouble, (yyvsp[0].lex).loc, true); } -#line 4237 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4242 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 14: -#line 341 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 343 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat16, (yyvsp[0].lex).loc, true); } -#line 4246 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4251 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 15: -#line 345 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 347 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 4254 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4259 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 16: -#line 348 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 350 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); } -#line 4264 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4269 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 17: -#line 356 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 358 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4272 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4277 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 18: -#line 359 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 361 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBracketDereference((yyvsp[-2].lex).loc, (yyvsp[-3].interm.intermTypedNode), (yyvsp[-1].interm.intermTypedNode)); } -#line 4280 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4285 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 19: -#line 362 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 364 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4288 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4293 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 20: -#line 365 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 367 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleDotDereference((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode), *(yyvsp[0].lex).string); } -#line 4296 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4301 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 21: -#line 368 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 370 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "++", (yyvsp[-1].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "++", EOpPostIncrement, (yyvsp[-1].interm.intermTypedNode)); } -#line 4306 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4311 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 22: -#line 373 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 375 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "--", (yyvsp[-1].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "--", EOpPostDecrement, (yyvsp[-1].interm.intermTypedNode)); } -#line 4316 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4321 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 23: -#line 381 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 383 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.integerCheck((yyvsp[0].interm.intermTypedNode), "[]"); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4325 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4330 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 24: -#line 388 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 390 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleFunctionCall((yyvsp[0].interm).loc, (yyvsp[0].interm).function, (yyvsp[0].interm).intermNode); delete (yyvsp[0].interm).function; } -#line 4334 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4339 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 25: -#line 395 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 397 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[0].interm); } -#line 4342 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4347 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 26: -#line 401 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 403 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[-1].interm); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 4351 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4356 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 27: -#line 405 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 407 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[-1].interm); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 4360 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4365 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 28: -#line 412 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 414 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[-1].interm); } -#line 4368 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4373 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 29: -#line 415 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 417 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[0].interm); } -#line 4376 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4381 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 30: -#line 421 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 423 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { TParameter param = { 0, new TType }; param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); @@ -4384,11 +4389,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm).function = (yyvsp[-1].interm).function; (yyval.interm).intermNode = (yyvsp[0].interm.intermTypedNode); } -#line 4388 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4393 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 31: -#line 428 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 430 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { TParameter param = { 0, new TType }; param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); @@ -4396,29 +4401,29 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm).function = (yyvsp[-2].interm).function; (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); } -#line 4400 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4405 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 32: -#line 438 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 440 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[-1].interm); } -#line 4408 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4413 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 33: -#line 446 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 448 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // Constructor (yyval.interm).intermNode = 0; (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); } -#line 4418 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4423 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 34: -#line 451 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 453 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // // Should be a method or subroutine call, but we haven't recognized the arguments yet. @@ -4446,50 +4451,50 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm).function = new TFunction(&empty, TType(EbtVoid), EOpNull); } } -#line 4450 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4455 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 35: -#line 478 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 480 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // Constructor (yyval.interm).intermNode = 0; (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); } -#line 4460 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4465 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 36: -#line 486 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 488 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.variableCheck((yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); if (TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode()) parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "incomplete method syntax", method->getMethodName().c_str(), ""); } -#line 4471 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4476 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 37: -#line 492 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 494 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "++", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "++", EOpPreIncrement, (yyvsp[0].interm.intermTypedNode)); } -#line 4480 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4485 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 38: -#line 496 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 498 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "--", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "--", EOpPreDecrement, (yyvsp[0].interm.intermTypedNode)); } -#line 4489 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4494 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 39: -#line 500 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 502 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-1].interm).op != EOpNull) { char errorOp[2] = {0, 0}; @@ -4506,179 +4511,179 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); } } -#line 4510 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4515 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 40: -#line 520 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 522 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNull; } -#line 4516 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4521 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 41: -#line 521 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 523 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNegative; } -#line 4522 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4527 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 42: -#line 522 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 524 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLogicalNot; } -#line 4528 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4533 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 43: -#line 523 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 525 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpBitwiseNot; parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise not"); } -#line 4535 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4540 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 44: -#line 529 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 531 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4541 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4546 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 45: -#line 530 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 532 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "*", EOpMul, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4551 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4556 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 46: -#line 535 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 537 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "/", EOpDiv, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4561 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4566 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 47: -#line 540 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 542 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "%"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "%", EOpMod, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4572 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4577 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 48: -#line 549 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 551 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4578 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4583 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 49: -#line 550 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 552 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "+", EOpAdd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4588 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4593 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 50: -#line 555 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 557 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "-", EOpSub, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4598 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4603 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 51: -#line 563 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 565 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4604 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4609 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 52: -#line 564 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 566 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift left"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<<", EOpLeftShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4615 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4620 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 53: -#line 570 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 572 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift right"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">>", EOpRightShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4626 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4631 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 54: -#line 579 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 581 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4632 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4637 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 55: -#line 580 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 582 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<", EOpLessThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4642 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4647 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 56: -#line 585 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 587 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">", EOpGreaterThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4652 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4657 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 57: -#line 590 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 592 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<=", EOpLessThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4662 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4667 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 58: -#line 595 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 597 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">=", EOpGreaterThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4672 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4677 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 59: -#line 603 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 605 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4678 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4683 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 60: -#line 604 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 606 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); @@ -4687,11 +4692,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4691 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4696 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 61: -#line 612 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 614 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); @@ -4700,124 +4705,124 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4704 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4709 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 62: -#line 623 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 625 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4710 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4715 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 63: -#line 624 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 626 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise and"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&", EOpAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4721 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4726 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 64: -#line 633 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 635 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4727 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4732 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 65: -#line 634 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 636 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise exclusive or"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^", EOpExclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4738 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4743 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 66: -#line 643 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 645 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4744 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4749 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 67: -#line 644 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 646 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise inclusive or"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "|", EOpInclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4755 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4760 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 68: -#line 653 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 655 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4761 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4766 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 69: -#line 654 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 656 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&&", EOpLogicalAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4771 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4776 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 70: -#line 662 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 664 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4777 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4782 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 71: -#line 663 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 665 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^^", EOpLogicalXor, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4787 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4792 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 72: -#line 671 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 673 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4793 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4798 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 73: -#line 672 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 674 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "||", EOpLogicalOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4803 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4808 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 74: -#line 680 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 682 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4809 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4814 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 75: -#line 681 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 683 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { ++parseContext.controlFlowNestingLevel; } -#line 4817 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4822 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 76: -#line 684 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 686 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { --parseContext.controlFlowNestingLevel; parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-5].interm.intermTypedNode)); @@ -4830,17 +4835,17 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } } -#line 4834 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4839 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 77: -#line 699 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 701 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4840 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4845 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 78: -#line 700 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 702 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.arrayObjectCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array assignment"); parseContext.opaqueCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); @@ -4854,119 +4859,119 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } } -#line 4858 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4863 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 79: -#line 716 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 718 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAssign; } -#line 4867 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4872 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 80: -#line 720 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 722 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpMulAssign; } -#line 4876 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4881 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 81: -#line 724 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 726 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpDivAssign; } -#line 4885 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4890 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 82: -#line 728 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 730 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "%="); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpModAssign; } -#line 4895 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4900 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 83: -#line 733 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 735 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAddAssign; } -#line 4904 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4909 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 84: -#line 737 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 739 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpSubAssign; } -#line 4913 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4918 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 85: -#line 741 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 743 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift left assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLeftShiftAssign; } -#line 4922 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4927 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 86: -#line 745 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 747 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift right assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpRightShiftAssign; } -#line 4931 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4936 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 87: -#line 749 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 751 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-and assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAndAssign; } -#line 4940 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4945 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 88: -#line 753 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 755 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-xor assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpExclusiveOrAssign; } -#line 4949 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4954 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 89: -#line 757 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 759 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-or assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpInclusiveOrAssign; } -#line 4958 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4963 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 90: -#line 764 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 766 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4966 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4971 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 91: -#line 767 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 769 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.samplerConstructorLocationCheck((yyvsp[-1].lex).loc, ",", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.intermediate.addComma((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); @@ -4975,40 +4980,40 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } } -#line 4979 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4984 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 92: -#line 778 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 780 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.constantValueCheck((yyvsp[0].interm.intermTypedNode), ""); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4988 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4993 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 93: -#line 785 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 787 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.handleFunctionDeclarator((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).function, true /* prototype */); (yyval.interm.intermNode) = 0; // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature } -#line 4998 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5003 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 94: -#line 790 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 792 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-1].interm).intermNode && (yyvsp[-1].interm).intermNode->getAsAggregate()) (yyvsp[-1].interm).intermNode->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-1].interm).intermNode; } -#line 5008 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5013 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 95: -#line 795 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 797 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.profileRequires((yyvsp[-3].lex).loc, ENoProfile, 130, 0, "precision statement"); @@ -5017,75 +5022,75 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.setDefaultPrecision((yyvsp[-3].lex).loc, (yyvsp[-1].interm.type), (yyvsp[-2].interm.type).qualifier.precision); (yyval.interm.intermNode) = 0; } -#line 5021 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5026 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 96: -#line 803 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 805 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.declareBlock((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).typeList); (yyval.interm.intermNode) = 0; } -#line 5030 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5035 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 97: -#line 807 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 809 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.declareBlock((yyvsp[-2].interm).loc, *(yyvsp[-2].interm).typeList, (yyvsp[-1].lex).string); (yyval.interm.intermNode) = 0; } -#line 5039 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5044 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 98: -#line 811 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 813 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.declareBlock((yyvsp[-3].interm).loc, *(yyvsp[-3].interm).typeList, (yyvsp[-2].lex).string, (yyvsp[-1].interm).arraySizes); (yyval.interm.intermNode) = 0; } -#line 5048 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5053 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 99: -#line 815 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 817 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); parseContext.updateStandaloneQualifierDefaults((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type)); (yyval.interm.intermNode) = 0; } -#line 5058 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5063 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 100: -#line 820 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 822 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.checkNoShaderLayouts((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).shaderQualifiers); parseContext.addQualifierToExisting((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, *(yyvsp[-1].lex).string); (yyval.interm.intermNode) = 0; } -#line 5068 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5073 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 101: -#line 825 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 827 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.checkNoShaderLayouts((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).shaderQualifiers); (yyvsp[-1].interm.identifierList)->push_back((yyvsp[-2].lex).string); parseContext.addQualifierToExisting((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).qualifier, *(yyvsp[-1].interm.identifierList)); (yyval.interm.intermNode) = 0; } -#line 5079 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5084 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 102: -#line 834 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 836 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.nestedBlockCheck((yyvsp[-2].interm.type).loc); } -#line 5085 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5090 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 103: -#line 834 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 836 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { --parseContext.structNestingLevel; parseContext.blockName = (yyvsp[-4].lex).string; @@ -5095,54 +5100,54 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm).loc = (yyvsp[-5].interm.type).loc; (yyval.interm).typeList = (yyvsp[-1].interm.typeList); } -#line 5099 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5104 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 104: -#line 845 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 847 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.identifierList) = new TIdentifierList; (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } -#line 5108 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5113 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 105: -#line 849 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 851 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.identifierList) = (yyvsp[-2].interm.identifierList); (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } -#line 5117 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5122 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 106: -#line 856 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 858 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).function = (yyvsp[-1].interm.function); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 5126 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5131 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 107: -#line 863 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 865 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.function) = (yyvsp[0].interm.function); } -#line 5134 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5139 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 108: -#line 866 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 868 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.function) = (yyvsp[0].interm.function); } -#line 5142 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5147 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 109: -#line 873 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 875 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // Add the parameter (yyval.interm.function) = (yyvsp[-1].interm.function); @@ -5151,11 +5156,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); else delete (yyvsp[0].interm).param.type; } -#line 5155 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5160 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 110: -#line 881 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 883 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // // Only first parameter of one-parameter functions can be void @@ -5173,11 +5178,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyvsp[-2].interm.function)->addParameter((yyvsp[0].interm).param); } } -#line 5177 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5182 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 111: -#line 901 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 903 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-2].interm.type).qualifier.storage != EvqGlobal && (yyvsp[-2].interm.type).qualifier.storage != EvqTemporary) { parseContext.error((yyvsp[-1].lex).loc, "no qualifiers allowed for function return", @@ -5197,11 +5202,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); function = new TFunction((yyvsp[-1].lex).string, type); (yyval.interm.function) = function; } -#line 5201 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5206 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 112: -#line 924 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 926 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-1].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-1].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -5217,11 +5222,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).param = param; } -#line 5221 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5226 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 113: -#line 939 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 941 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -5241,11 +5246,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm).loc = (yyvsp[-1].lex).loc; (yyval.interm).param = param; } -#line 5245 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5250 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 114: -#line 964 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 966 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[0].interm); if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) @@ -5257,11 +5262,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); } -#line 5261 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5266 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 115: -#line 975 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 977 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[0].interm); @@ -5269,11 +5274,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); } -#line 5273 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5278 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 116: -#line 985 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 987 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[0].interm); if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) @@ -5284,11 +5289,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); } -#line 5288 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5293 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 117: -#line 995 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 997 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[0].interm); @@ -5296,118 +5301,118 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); } -#line 5300 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5305 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 118: -#line 1005 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1007 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { TParameter param = { 0, new TType((yyvsp[0].interm.type)) }; (yyval.interm).param = param; if ((yyvsp[0].interm.type).arraySizes) parseContext.arraySizeRequiredCheck((yyvsp[0].interm.type).loc, *(yyvsp[0].interm.type).arraySizes); } -#line 5311 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5316 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 119: -#line 1014 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1016 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[0].interm); } -#line 5319 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5324 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 120: -#line 1017 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1019 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[-2].interm); parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-2].interm).type); } -#line 5328 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5333 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 121: -#line 1021 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1023 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[-3].interm); parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-3].interm).type, (yyvsp[0].interm).arraySizes); } -#line 5337 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5342 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 122: -#line 1025 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1027 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).type = (yyvsp[-5].interm).type; TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-5].interm).type, (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-5].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } -#line 5347 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5352 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 123: -#line 1030 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1032 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).type = (yyvsp[-4].interm).type; TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-4].interm).type, 0, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-4].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } -#line 5357 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5362 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 124: -#line 1038 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1040 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).type = (yyvsp[0].interm.type); (yyval.interm).intermNode = 0; parseContext.declareTypeDefaults((yyval.interm).loc, (yyval.interm).type); } -#line 5367 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5372 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 125: -#line 1043 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1045 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).type = (yyvsp[-1].interm.type); (yyval.interm).intermNode = 0; parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-1].interm.type)); } -#line 5377 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5382 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 126: -#line 1048 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1050 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).type = (yyvsp[-2].interm.type); (yyval.interm).intermNode = 0; parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-2].interm.type), (yyvsp[0].interm).arraySizes); } -#line 5387 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5392 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 127: -#line 1053 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1055 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).type = (yyvsp[-4].interm.type); TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-4].interm.type), (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); } -#line 5397 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5402 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 128: -#line 1058 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1060 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).type = (yyvsp[-3].interm.type); TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); } -#line 5407 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5412 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 129: -#line 1067 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1069 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[0].interm.type); @@ -5419,11 +5424,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.precisionQualifierCheck((yyval.interm.type).loc, (yyval.interm.type).basicType, (yyval.interm.type).qualifier); } -#line 5423 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5428 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 130: -#line 1078 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1080 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); parseContext.globalQualifierTypeCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, (yyvsp[0].interm.type)); @@ -5448,22 +5453,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (parseContext.language == EShLangFragment && (yyval.interm.type).qualifier.storage == EvqVaryingIn))) (yyval.interm.type).qualifier.smooth = true; } -#line 5452 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5457 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 131: -#line 1105 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1107 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "invariant"); parseContext.profileRequires((yyval.interm.type).loc, ENoProfile, 120, 0, "invariant"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.invariant = true; } -#line 5463 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5468 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 132: -#line 1114 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1116 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "smooth"); parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "smooth"); @@ -5471,11 +5476,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.smooth = true; } -#line 5475 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5480 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 133: -#line 1121 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1123 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "flat"); parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "flat"); @@ -5483,11 +5488,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.flat = true; } -#line 5487 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5492 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 134: -#line 1128 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1130 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "noperspective"); #ifdef NV_EXTENSIONS @@ -5499,11 +5504,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.nopersp = true; } -#line 5503 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5508 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 135: -#line 1139 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1141 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.globalCheck((yyvsp[0].lex).loc, "__explicitInterpAMD"); @@ -5513,11 +5518,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).qualifier.explicitInterp = true; #endif } -#line 5517 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5522 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 136: -#line 1148 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1150 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef NV_EXTENSIONS parseContext.globalCheck((yyvsp[0].lex).loc, "pervertexNV"); @@ -5528,11 +5533,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).qualifier.pervertexNV = true; #endif } -#line 5532 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5537 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 137: -#line 1158 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1160 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef NV_EXTENSIONS // No need for profile version or extension check. Shader stage already checks both. @@ -5545,11 +5550,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).qualifier.perPrimitiveNV = true; #endif } -#line 5549 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5554 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 138: -#line 1170 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1172 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef NV_EXTENSIONS // No need for profile version or extension check. Shader stage already checks both. @@ -5559,11 +5564,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).qualifier.perViewNV = true; #endif } -#line 5563 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5568 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 139: -#line 1179 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1181 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef NV_EXTENSIONS // No need for profile version or extension check. Shader stage already checks both. @@ -5573,84 +5578,84 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).qualifier.perTaskNV = true; #endif } -#line 5577 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5582 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 140: -#line 1191 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1193 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[-1].interm.type); } -#line 5585 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5590 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 141: -#line 1197 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1199 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5593 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5598 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 142: -#line 1200 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1202 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[-2].interm.type); (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); parseContext.mergeObjectLayoutQualifiers((yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } -#line 5603 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5608 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 143: -#line 1207 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1209 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), *(yyvsp[0].lex).string); } -#line 5612 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5617 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 144: -#line 1211 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1213 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[-2].lex).loc); parseContext.setLayoutQualifier((yyvsp[-2].lex).loc, (yyval.interm.type), *(yyvsp[-2].lex).string, (yyvsp[0].interm.intermTypedNode)); } -#line 5621 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5626 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 145: -#line 1215 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1217 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // because "shared" is both an identifier and a keyword (yyval.interm.type).init((yyvsp[0].lex).loc); TString strShared("shared"); parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), strShared); } -#line 5631 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5636 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 146: -#line 1223 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1225 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.profileRequires((yyval.interm.type).loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.noContraction = true; } -#line 5642 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5647 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 147: -#line 1232 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1234 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5650 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5655 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 148: -#line 1235 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1237 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[-1].interm.type); if ((yyval.interm.type).basicType == EbtVoid) @@ -5659,80 +5664,80 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); parseContext.mergeQualifiers((yyval.interm.type).loc, (yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } -#line 5663 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5668 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 149: -#line 1246 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1248 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5671 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5676 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 150: -#line 1249 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1251 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5679 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5684 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 151: -#line 1252 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1254 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.checkPrecisionQualifier((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier.precision); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5688 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5693 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 152: -#line 1256 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1258 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5697 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5702 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 153: -#line 1260 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1262 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5706 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5711 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 154: -#line 1264 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1266 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5715 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5720 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 155: -#line 1268 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1270 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5723 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5728 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 156: -#line 1274 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1276 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant } -#line 5732 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5737 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 157: -#line 1278 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1280 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangVertex, "attribute"); parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "attribute"); @@ -5745,11 +5750,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqVaryingIn; } -#line 5749 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5754 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 158: -#line 1290 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1292 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "varying"); parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "varying"); @@ -5764,43 +5769,43 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); else (yyval.interm.type).qualifier.storage = EvqVaryingIn; } -#line 5768 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5773 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 159: -#line 1304 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1306 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "inout"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqInOut; } -#line 5778 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5783 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 160: -#line 1309 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1311 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "in"); (yyval.interm.type).init((yyvsp[0].lex).loc); // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later (yyval.interm.type).qualifier.storage = EvqIn; } -#line 5789 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5794 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 161: -#line 1315 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1317 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "out"); (yyval.interm.type).init((yyvsp[0].lex).loc); // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later (yyval.interm.type).qualifier.storage = EvqOut; } -#line 5800 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5805 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 162: -#line 1321 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1323 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 120, 0, "centroid"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "centroid"); @@ -5808,52 +5813,52 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.centroid = true; } -#line 5812 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5817 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 163: -#line 1328 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1330 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "patch"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.patch = true; } -#line 5823 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5828 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 164: -#line 1334 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1336 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "sample"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.sample = true; } -#line 5833 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5838 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 165: -#line 1339 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1341 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "uniform"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqUniform; } -#line 5843 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5848 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 166: -#line 1344 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1346 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "buffer"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqBuffer; } -#line 5853 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5858 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 167: -#line 1349 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1351 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef NV_EXTENSIONS parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeNV"); @@ -5864,11 +5869,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).qualifier.storage = EvqHitAttrNV; #endif } -#line 5868 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5873 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 168: -#line 1359 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1361 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef NV_EXTENSIONS parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadNV"); @@ -5879,11 +5884,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).qualifier.storage = EvqPayloadNV; #endif } -#line 5883 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5888 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 169: -#line 1369 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1371 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef NV_EXTENSIONS parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadInNV"); @@ -5894,11 +5899,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).qualifier.storage = EvqPayloadInNV; #endif } -#line 5898 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5903 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 170: -#line 1379 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1381 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef NV_EXTENSIONS parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataNV"); @@ -5909,11 +5914,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).qualifier.storage = EvqCallableDataNV; #endif } -#line 5913 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5918 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 171: -#line 1389 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1391 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef NV_EXTENSIONS parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataInNV"); @@ -5923,11 +5928,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).qualifier.storage = EvqCallableDataInNV; #endif } -#line 5927 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5932 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 172: -#line 1398 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1400 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "shared"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared"); @@ -5940,185 +5945,185 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqShared; } -#line 5944 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5949 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 173: -#line 1410 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1412 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.coherent = true; } -#line 5953 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5958 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 174: -#line 1414 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1416 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "devicecoherent"); (yyval.interm.type).qualifier.devicecoherent = true; } -#line 5963 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5968 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 175: -#line 1419 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1421 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "queuefamilycoherent"); (yyval.interm.type).qualifier.queuefamilycoherent = true; } -#line 5973 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5978 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 176: -#line 1424 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1426 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "workgroupcoherent"); (yyval.interm.type).qualifier.workgroupcoherent = true; } -#line 5983 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5988 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 177: -#line 1429 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1431 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "subgroupcoherent"); (yyval.interm.type).qualifier.subgroupcoherent = true; } -#line 5993 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5998 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 178: -#line 1434 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1436 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "nonprivate"); (yyval.interm.type).qualifier.nonprivate = true; } -#line 6003 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6008 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 179: -#line 1439 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1441 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.volatil = true; } -#line 6012 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6017 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 180: -#line 1443 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1445 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.restrict = true; } -#line 6021 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6026 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 181: -#line 1447 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1449 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.readonly = true; } -#line 6030 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6035 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 182: -#line 1451 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1453 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.writeonly = true; } -#line 6039 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6044 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 183: -#line 1455 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1457 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.spvRemoved((yyvsp[0].lex).loc, "subroutine"); parseContext.globalCheck((yyvsp[0].lex).loc, "subroutine"); parseContext.unimplemented((yyvsp[0].lex).loc, "subroutine"); (yyval.interm.type).init((yyvsp[0].lex).loc); } -#line 6050 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6055 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 184: -#line 1461 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1463 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.spvRemoved((yyvsp[-3].lex).loc, "subroutine"); parseContext.globalCheck((yyvsp[-3].lex).loc, "subroutine"); parseContext.unimplemented((yyvsp[-3].lex).loc, "subroutine"); (yyval.interm.type).init((yyvsp[-3].lex).loc); } -#line 6061 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6066 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 185: -#line 1470 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1472 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.nonUniform = true; } -#line 6070 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6075 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 186: -#line 1477 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1479 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // TODO } -#line 6078 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6083 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 187: -#line 1480 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1482 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // TODO: 4.0 semantics: subroutines // 1) make sure each identifier is a type declared earlier with SUBROUTINE // 2) save all of the identifiers for future comparison with the declared function } -#line 6088 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6093 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 188: -#line 1488 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1490 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[0].interm.type); (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); } -#line 6097 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6102 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 189: -#line 1492 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1494 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.arrayOfArrayVersionCheck((yyvsp[0].interm).loc, (yyvsp[0].interm).arraySizes); (yyval.interm.type) = (yyvsp[-1].interm.type); (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); (yyval.interm.type).arraySizes = (yyvsp[0].interm).arraySizes; } -#line 6108 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6113 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 190: -#line 1501 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1503 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[-1].lex).loc; (yyval.interm).arraySizes = new TArraySizes; (yyval.interm).arraySizes->addInnerSize(); } -#line 6118 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6123 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 191: -#line 1506 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1508 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[-2].lex).loc; (yyval.interm).arraySizes = new TArraySizes; @@ -6127,20 +6132,20 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size); (yyval.interm).arraySizes->addInnerSize(size); } -#line 6131 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6136 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 192: -#line 1514 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1516 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[-2].interm); (yyval.interm).arraySizes->addInnerSize(); } -#line 6140 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6145 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 193: -#line 1518 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1520 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[-3].interm); @@ -6148,1495 +6153,1495 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size); (yyval.interm).arraySizes->addInnerSize(size); } -#line 6152 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6157 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 194: -#line 1528 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1530 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtVoid; } -#line 6161 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6166 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 195: -#line 1532 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1534 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; } -#line 6170 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6175 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 196: -#line 1536 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1538 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; } -#line 6180 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6185 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 197: -#line 1541 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1543 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "float16_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; } -#line 6190 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6195 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 198: -#line 1546 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1548 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; } -#line 6200 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6205 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 199: -#line 1551 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1553 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; } -#line 6210 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6215 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 200: -#line 1556 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1558 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; } -#line 6219 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6224 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 201: -#line 1560 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1562 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; } -#line 6229 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6234 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 202: -#line 1565 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1567 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; } -#line 6239 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6244 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 203: -#line 1570 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1572 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; } -#line 6249 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6254 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 204: -#line 1575 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1577 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; } -#line 6259 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6264 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 205: -#line 1580 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1582 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; } -#line 6269 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6274 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 206: -#line 1585 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1587 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; } -#line 6279 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6284 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 207: -#line 1590 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1592 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; } -#line 6289 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6294 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 208: -#line 1595 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1597 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; } -#line 6299 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6304 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 209: -#line 1600 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1602 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; } -#line 6309 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6314 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 210: -#line 1605 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1607 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; } -#line 6318 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6323 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 211: -#line 1609 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1611 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(2); } -#line 6328 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6333 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 212: -#line 1614 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1616 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(3); } -#line 6338 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6343 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 213: -#line 1619 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1621 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(4); } -#line 6348 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6353 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 214: -#line 1624 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1626 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(2); } -#line 6359 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6364 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 215: -#line 1630 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1632 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(3); } -#line 6370 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6375 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 216: -#line 1636 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1638 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(4); } -#line 6381 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6386 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 217: -#line 1642 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1644 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setVector(2); } -#line 6392 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6397 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 218: -#line 1648 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1650 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setVector(3); } -#line 6403 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6408 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 219: -#line 1654 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1656 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setVector(4); } -#line 6414 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6419 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 220: -#line 1660 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1662 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(2); } -#line 6425 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6430 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 221: -#line 1666 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1668 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(3); } -#line 6436 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6441 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 222: -#line 1672 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1674 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(4); } -#line 6447 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6452 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 223: -#line 1678 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1680 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(2); } -#line 6458 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6463 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 224: -#line 1684 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1686 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(3); } -#line 6469 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6474 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 225: -#line 1690 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1692 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(4); } -#line 6480 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6485 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 226: -#line 1696 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1698 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; (yyval.interm.type).setVector(2); } -#line 6490 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6495 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 227: -#line 1701 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1703 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; (yyval.interm.type).setVector(3); } -#line 6500 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6505 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 228: -#line 1706 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1708 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; (yyval.interm.type).setVector(4); } -#line 6510 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6515 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 229: -#line 1711 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1713 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(2); } -#line 6520 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6525 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 230: -#line 1716 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1718 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(3); } -#line 6530 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6535 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 231: -#line 1721 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1723 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(4); } -#line 6540 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6545 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 232: -#line 1726 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1728 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; (yyval.interm.type).setVector(2); } -#line 6551 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6556 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 233: -#line 1732 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1734 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; (yyval.interm.type).setVector(3); } -#line 6562 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6567 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 234: -#line 1738 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1740 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; (yyval.interm.type).setVector(4); } -#line 6573 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6578 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 235: -#line 1744 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1746 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; (yyval.interm.type).setVector(2); } -#line 6584 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6589 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 236: -#line 1750 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1752 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; (yyval.interm.type).setVector(3); } -#line 6595 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6600 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 237: -#line 1756 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1758 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; (yyval.interm.type).setVector(4); } -#line 6606 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6611 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 238: -#line 1762 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1764 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(2); } -#line 6617 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6622 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 239: -#line 1768 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1770 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(3); } -#line 6628 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6633 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 240: -#line 1774 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1776 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(4); } -#line 6639 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6644 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 241: -#line 1780 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1782 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; (yyval.interm.type).setVector(2); } -#line 6650 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6655 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 242: -#line 1786 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1788 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; (yyval.interm.type).setVector(3); } -#line 6661 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6666 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 243: -#line 1792 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1794 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; (yyval.interm.type).setVector(4); } -#line 6672 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6677 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 244: -#line 1798 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1800 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(2); } -#line 6683 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6688 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 245: -#line 1804 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1806 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(3); } -#line 6694 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6699 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 246: -#line 1810 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1812 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(4); } -#line 6705 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6710 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 247: -#line 1816 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1818 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(2); } -#line 6716 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6721 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 248: -#line 1822 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1824 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(3); } -#line 6727 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6732 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 249: -#line 1828 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1830 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(4); } -#line 6738 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6743 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 250: -#line 1834 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1836 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; (yyval.interm.type).setVector(2); } -#line 6749 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6754 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 251: -#line 1840 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1842 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; (yyval.interm.type).setVector(3); } -#line 6760 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6765 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 252: -#line 1846 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1848 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; (yyval.interm.type).setVector(4); } -#line 6771 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6776 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 253: -#line 1852 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1854 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(2); } -#line 6782 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6787 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 254: -#line 1858 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1860 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(3); } -#line 6793 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6798 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 255: -#line 1864 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1866 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(4); } -#line 6804 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6809 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 256: -#line 1870 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1872 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(2); } -#line 6815 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6820 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 257: -#line 1876 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1878 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(3); } -#line 6826 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6831 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 258: -#line 1882 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1884 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(4); } -#line 6837 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6842 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 259: -#line 1888 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1890 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 6847 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6852 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 260: -#line 1893 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1895 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 6857 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6862 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 261: -#line 1898 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1900 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 6867 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6872 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 262: -#line 1903 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1905 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 6877 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6882 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 263: -#line 1908 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1910 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 3); } -#line 6887 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6892 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 264: -#line 1913 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1915 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 4); } -#line 6897 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6902 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 265: -#line 1918 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1920 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 2); } -#line 6907 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6912 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 266: -#line 1923 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1925 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 6917 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6922 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 267: -#line 1928 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1930 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 4); } -#line 6927 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6932 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 268: -#line 1933 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1935 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 2); } -#line 6937 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6942 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 269: -#line 1938 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1940 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 3); } -#line 6947 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6952 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 270: -#line 1943 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1945 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 6957 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6962 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 271: -#line 1948 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1950 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 6968 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6973 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 272: -#line 1954 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1956 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 6979 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6984 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 273: -#line 1960 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1962 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 6990 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6995 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 274: -#line 1966 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1968 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 7001 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7006 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 275: -#line 1972 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1974 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 3); } -#line 7012 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7017 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 276: -#line 1978 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1980 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 4); } -#line 7023 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7028 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 277: -#line 1984 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1986 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 2); } -#line 7034 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7039 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 278: -#line 1990 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1992 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 7045 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7050 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 279: -#line 1996 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1998 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 4); } -#line 7056 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7061 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 280: -#line 2002 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2004 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 2); } -#line 7067 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7072 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 281: -#line 2008 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2010 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 3); } -#line 7078 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7083 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 282: -#line 2014 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2016 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 7089 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7094 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 283: -#line 2020 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2022 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 2); } -#line 7100 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7105 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 284: -#line 2026 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2028 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 3); } -#line 7111 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7116 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 285: -#line 2032 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2034 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 4); } -#line 7122 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7127 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 286: -#line 2038 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2040 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 2); } -#line 7133 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7138 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 287: -#line 2044 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2046 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 3); } -#line 7144 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7149 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 288: -#line 2050 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2052 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 4); } -#line 7155 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7160 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 289: -#line 2056 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2058 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 2); } -#line 7166 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7171 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 290: -#line 2062 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2064 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 3); } -#line 7177 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7182 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 291: -#line 2068 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2070 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 4); } -#line 7188 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7193 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 292: -#line 2074 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2076 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 2); } -#line 7199 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7204 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 293: -#line 2080 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2082 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 3); } -#line 7210 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7215 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 294: -#line 2086 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2088 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 4); } -#line 7221 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7226 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 295: -#line 2092 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2094 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 7232 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7237 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 296: -#line 2098 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2100 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 7243 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7248 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 297: -#line 2104 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2106 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 7254 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7259 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 298: -#line 2110 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2112 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 7265 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7270 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 299: -#line 2116 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2118 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 3); } -#line 7276 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7281 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 300: -#line 2122 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2124 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 4); } -#line 7287 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7292 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 301: -#line 2128 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2130 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 2); } -#line 7298 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7303 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 302: -#line 2134 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2136 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 7309 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7314 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 303: -#line 2140 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2142 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 4); } -#line 7320 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7325 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 304: -#line 2146 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2148 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 2); } -#line 7331 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7336 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 305: -#line 2152 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2154 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 3); } -#line 7342 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7347 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 306: -#line 2158 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2160 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 7353 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7358 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 307: -#line 2164 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2166 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 7364 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7369 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 308: -#line 2170 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2172 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 7375 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7380 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 309: -#line 2176 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2178 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 7386 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7391 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 310: -#line 2182 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2184 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 7397 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7402 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 311: -#line 2188 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2190 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 3); } -#line 7408 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7413 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 312: -#line 2194 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2196 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 4); } -#line 7419 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7424 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 313: -#line 2200 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2202 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 2); } -#line 7430 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7435 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 314: -#line 2206 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2208 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 7441 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7446 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 315: -#line 2212 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2214 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 4); } -#line 7452 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7457 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 316: -#line 2218 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2220 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 2); } -#line 7463 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7468 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 317: -#line 2224 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2226 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 3); } -#line 7474 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7479 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 318: -#line 2230 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2232 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 7485 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7490 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 319: -#line 2236 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2238 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef NV_EXTENSIONS (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAccStructNV; #endif } -#line 7496 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7501 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 320: -#line 2242 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2244 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.vulkanRemoved((yyvsp[0].lex).loc, "atomic counter types"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAtomicUint; } -#line 7506 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7511 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 321: -#line 2247 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2249 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D); } -#line 7516 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7521 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 322: -#line 2252 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2254 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); } -#line 7526 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7531 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 323: -#line 2257 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2259 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd3D); } -#line 7536 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7541 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 324: -#line 2262 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2264 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube); } -#line 7546 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7551 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 325: -#line 2267 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2269 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, false, true); } -#line 7556 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7561 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 326: -#line 2272 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2274 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, true); } -#line 7566 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7571 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 327: -#line 2277 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2279 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, false, true); } -#line 7576 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7581 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 328: -#line 2282 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2284 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true); } -#line 7586 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7591 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 329: -#line 2287 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2289 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true); } -#line 7596 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7601 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 330: -#line 2292 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2294 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true, true); } -#line 7606 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7611 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 331: -#line 2297 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2299 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, true); } -#line 7616 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7621 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 332: -#line 2302 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2304 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true); } -#line 7626 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7631 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 333: -#line 2307 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2309 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true, true); } -#line 7636 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7641 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 334: -#line 2312 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2314 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7645,11 +7650,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd1D); #endif } -#line 7649 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7654 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 335: -#line 2320 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2322 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7658,11 +7663,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd2D); #endif } -#line 7662 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7667 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 336: -#line 2328 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2330 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7671,11 +7676,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd3D); #endif } -#line 7675 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7680 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 337: -#line 2336 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2338 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7684,11 +7689,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, EsdCube); #endif } -#line 7688 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7693 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 338: -#line 2344 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2346 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7697,11 +7702,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, false, true); #endif } -#line 7701 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7706 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 339: -#line 2352 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2354 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7710,11 +7715,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, true); #endif } -#line 7714 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7719 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 340: -#line 2360 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2362 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7723,11 +7728,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, false, true); #endif } -#line 7727 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7732 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 341: -#line 2368 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2370 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7736,11 +7741,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true); #endif } -#line 7740 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7745 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 342: -#line 2376 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2378 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7749,11 +7754,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true); #endif } -#line 7753 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7758 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 343: -#line 2384 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2386 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7762,11 +7767,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true, true); #endif } -#line 7766 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7771 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 344: -#line 2392 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2394 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7775,11 +7780,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, true); #endif } -#line 7779 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7784 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 345: -#line 2400 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2402 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7788,11 +7793,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true); #endif } -#line 7792 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7797 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 346: -#line 2408 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2410 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7801,171 +7806,171 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true, true); #endif } -#line 7805 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7810 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 347: -#line 2416 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2418 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd1D); } -#line 7815 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7820 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 348: -#line 2421 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2423 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D); } -#line 7825 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7830 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 349: -#line 2426 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2428 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd3D); } -#line 7835 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7840 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 350: -#line 2431 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2433 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdCube); } -#line 7845 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7850 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 351: -#line 2436 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2438 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd1D, true); } -#line 7855 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7860 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 352: -#line 2441 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2443 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, true); } -#line 7865 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7870 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 353: -#line 2446 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2448 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdCube, true); } -#line 7875 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7880 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 354: -#line 2451 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2453 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd1D); } -#line 7885 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7890 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 355: -#line 2456 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2458 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D); } -#line 7895 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7900 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 356: -#line 2461 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2463 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd3D); } -#line 7905 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7910 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 357: -#line 2466 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2468 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdCube); } -#line 7915 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7920 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 358: -#line 2471 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2473 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd1D, true); } -#line 7925 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7930 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 359: -#line 2476 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2478 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, true); } -#line 7935 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7940 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 360: -#line 2481 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2483 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdCube, true); } -#line 7945 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7950 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 361: -#line 2486 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2488 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdRect); } -#line 7955 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7960 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 362: -#line 2491 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2493 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdRect, false, true); } -#line 7965 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7970 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 363: -#line 2496 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2498 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7974,11 +7979,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, EsdRect); #endif } -#line 7978 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7983 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 364: -#line 2504 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2506 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -7987,41 +7992,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, EsdRect, false, true); #endif } -#line 7991 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7996 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 365: -#line 2512 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2514 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdRect); } -#line 8001 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8006 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 366: -#line 2517 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2519 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdRect); } -#line 8011 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8016 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 367: -#line 2522 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2524 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdBuffer); } -#line 8021 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8026 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 368: -#line 2527 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2529 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -8030,41 +8035,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, EsdBuffer); #endif } -#line 8034 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8039 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 369: -#line 2535 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2537 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdBuffer); } -#line 8044 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8049 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 370: -#line 2540 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2542 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdBuffer); } -#line 8054 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8059 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 371: -#line 2545 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2547 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, false, true); } -#line 8064 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8069 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 372: -#line 2550 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2552 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -8073,41 +8078,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, false, true); #endif } -#line 8077 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8082 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 373: -#line 2558 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2560 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, false, false, true); } -#line 8087 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8092 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 374: -#line 2563 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2565 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, false, false, true); } -#line 8097 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8102 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 375: -#line 2568 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2570 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, false, true); } -#line 8107 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8112 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 376: -#line 2573 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2575 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); @@ -8116,61 +8121,61 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, false, true); #endif } -#line 8120 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8125 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 377: -#line 2581 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2583 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, true, false, true); } -#line 8130 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8135 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 378: -#line 2586 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2588 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, true, false, true); } -#line 8140 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8145 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 379: -#line 2591 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2593 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setPureSampler(false); } -#line 8150 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8155 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 380: -#line 2596 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2598 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setPureSampler(true); } -#line 8160 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8165 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 381: -#line 2601 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2603 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D); } -#line 8170 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8175 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 382: -#line 2606 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2608 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -8179,21 +8184,21 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D); #endif } -#line 8183 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8188 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 383: -#line 2614 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2616 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D); } -#line 8193 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8198 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 384: -#line 2619 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2621 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -8202,21 +8207,21 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D); #endif } -#line 8206 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8211 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 385: -#line 2627 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2629 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd3D); } -#line 8216 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8221 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 386: -#line 2632 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2634 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -8225,21 +8230,21 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd3D); #endif } -#line 8229 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8234 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 387: -#line 2640 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2642 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube); } -#line 8239 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8244 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 388: -#line 2645 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2647 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -8248,21 +8253,21 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube); #endif } -#line 8252 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8257 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 389: -#line 2653 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2655 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D, true); } -#line 8262 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8267 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 390: -#line 2658 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2660 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -8271,21 +8276,21 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D, true); #endif } -#line 8275 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8280 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 391: -#line 2666 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2668 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true); } -#line 8285 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8290 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 392: -#line 2671 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2673 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -8294,21 +8299,21 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true); #endif } -#line 8298 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8303 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 393: -#line 2679 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2681 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube, true); } -#line 8308 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8313 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 394: -#line 2684 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2686 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -8317,161 +8322,161 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube, true); #endif } -#line 8321 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8326 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 395: -#line 2692 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2694 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D); } -#line 8331 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8336 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 396: -#line 2697 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2699 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D); } -#line 8341 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8346 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 397: -#line 2702 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2704 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd3D); } -#line 8351 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8356 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 398: -#line 2707 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2709 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube); } -#line 8361 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8366 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 399: -#line 2712 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2714 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D, true); } -#line 8371 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8376 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 400: -#line 2717 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2719 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true); } -#line 8381 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8386 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 401: -#line 2722 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2724 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube, true); } -#line 8391 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8396 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 402: -#line 2727 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2729 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D); } -#line 8401 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8406 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 403: -#line 2732 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2734 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D); } -#line 8411 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8416 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 404: -#line 2737 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2739 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd3D); } -#line 8421 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8426 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 405: -#line 2742 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2744 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube); } -#line 8431 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8436 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 406: -#line 2747 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2749 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D, true); } -#line 8441 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8446 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 407: -#line 2752 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2754 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true); } -#line 8451 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8456 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 408: -#line 2757 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2759 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube, true); } -#line 8461 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8466 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 409: -#line 2762 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2764 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdRect); } -#line 8471 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8476 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 410: -#line 2767 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2769 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -8480,41 +8485,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdRect); #endif } -#line 8484 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8489 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 411: -#line 2775 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2777 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdRect); } -#line 8494 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8499 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 412: -#line 2780 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2782 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdRect); } -#line 8504 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8509 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 413: -#line 2785 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2787 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdBuffer); } -#line 8514 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8519 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 414: -#line 2790 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2792 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -8523,41 +8528,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdBuffer); #endif } -#line 8527 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8532 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 415: -#line 2798 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2800 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdBuffer); } -#line 8537 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8542 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 416: -#line 2803 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2805 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdBuffer); } -#line 8547 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8552 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 417: -#line 2808 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2810 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, false, false, true); } -#line 8557 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8562 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 418: -#line 2813 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2815 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -8566,41 +8571,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, false, false, true); #endif } -#line 8570 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8575 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 419: -#line 2821 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2823 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, false, false, true); } -#line 8580 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8585 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 420: -#line 2826 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2828 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, false, false, true); } -#line 8590 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8595 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 421: -#line 2831 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2833 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true, false, true); } -#line 8600 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8605 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 422: -#line 2836 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2838 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); @@ -8609,41 +8614,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true, false, true); #endif } -#line 8613 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8618 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 423: -#line 2844 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2846 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true, false, true); } -#line 8623 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8628 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 424: -#line 2849 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2851 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true, false, true); } -#line 8633 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8638 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 425: -#line 2854 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2856 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D); } -#line 8643 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8648 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 426: -#line 2859 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2861 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -8652,41 +8657,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D); #endif } -#line 8656 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8661 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 427: -#line 2867 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2869 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd1D); } -#line 8666 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8671 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 428: -#line 2872 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2874 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd1D); } -#line 8676 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8681 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 429: -#line 2877 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2879 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D); } -#line 8686 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8691 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 430: -#line 2882 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2884 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -8695,41 +8700,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D); #endif } -#line 8699 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8704 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 431: -#line 2890 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2892 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D); } -#line 8709 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8714 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 432: -#line 2895 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2897 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D); } -#line 8719 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8724 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 433: -#line 2900 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2902 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd3D); } -#line 8729 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8734 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 434: -#line 2905 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2907 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -8738,41 +8743,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, Esd3D); #endif } -#line 8742 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8747 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 435: -#line 2913 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2915 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd3D); } -#line 8752 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8757 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 436: -#line 2918 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2920 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd3D); } -#line 8762 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8767 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 437: -#line 2923 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2925 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdRect); } -#line 8772 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8777 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 438: -#line 2928 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2930 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -8781,41 +8786,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, EsdRect); #endif } -#line 8785 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8790 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 439: -#line 2936 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2938 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdRect); } -#line 8795 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8800 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 440: -#line 2941 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2943 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdRect); } -#line 8805 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8810 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 441: -#line 2946 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2948 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube); } -#line 8815 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8820 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 442: -#line 2951 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2953 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -8824,41 +8829,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube); #endif } -#line 8828 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8833 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 443: -#line 2959 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2961 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdCube); } -#line 8838 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8843 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 444: -#line 2964 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2966 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdCube); } -#line 8848 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8853 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 445: -#line 2969 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2971 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdBuffer); } -#line 8858 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8863 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 446: -#line 2974 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2976 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -8867,41 +8872,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, EsdBuffer); #endif } -#line 8871 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8876 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 447: -#line 2982 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2984 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdBuffer); } -#line 8881 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8886 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 448: -#line 2987 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2989 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdBuffer); } -#line 8891 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8896 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 449: -#line 2992 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2994 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D, true); } -#line 8901 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8906 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 450: -#line 2997 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2999 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -8910,41 +8915,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D, true); #endif } -#line 8914 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8919 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 451: -#line 3005 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3007 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd1D, true); } -#line 8924 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8929 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 452: -#line 3010 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3012 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd1D, true); } -#line 8934 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8939 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 453: -#line 3015 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3017 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true); } -#line 8944 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8949 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 454: -#line 3020 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3022 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -8953,41 +8958,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true); #endif } -#line 8957 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8962 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 455: -#line 3028 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3030 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true); } -#line 8967 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8972 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 456: -#line 3033 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3035 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true); } -#line 8977 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8982 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 457: -#line 3038 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3040 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube, true); } -#line 8987 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8992 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 458: -#line 3043 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3045 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -8996,41 +9001,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube, true); #endif } -#line 9000 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9005 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 459: -#line 3051 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3053 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdCube, true); } -#line 9010 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9015 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 460: -#line 3056 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3058 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdCube, true); } -#line 9020 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9025 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 461: -#line 3061 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3063 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, false, false, true); } -#line 9030 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9035 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 462: -#line 3066 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3068 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -9039,41 +9044,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, false, false, true); #endif } -#line 9043 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9048 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 463: -#line 3074 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3076 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, false, false, true); } -#line 9053 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9058 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 464: -#line 3079 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3081 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, false, false, true); } -#line 9063 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9068 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 465: -#line 3084 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3086 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true, false, true); } -#line 9073 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9078 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 466: -#line 3089 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3091 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); @@ -9082,64 +9087,75 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true, false, true); #endif } -#line 9086 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9091 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 467: -#line 3097 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3099 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true, false, true); } -#line 9096 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9101 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 468: -#line 3102 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3104 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true, false, true); } -#line 9106 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9111 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 469: -#line 3107 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3109 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // GL_OES_EGL_image_external (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); (yyval.interm.type).sampler.external = true; } -#line 9117 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9122 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 470: -#line 3113 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3115 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { // GL_EXT_YUV_target + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.set(EbtFloat, Esd2D); + (yyval.interm.type).sampler.yuv = true; + } +#line 9133 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 471: +#line 3121 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat); } -#line 9128 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9144 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 471: -#line 3119 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 472: +#line 3127 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat, true); } -#line 9139 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9155 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 472: -#line 3125 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 473: +#line 3133 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); @@ -9149,11 +9165,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setSubpass(EbtFloat16); #endif } -#line 9153 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9169 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 473: -#line 3134 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 474: +#line 3142 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { #ifdef AMD_EXTENSIONS parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); @@ -9163,65 +9179,65 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).sampler.setSubpass(EbtFloat16, true); #endif } -#line 9167 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9183 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 474: -#line 3143 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 475: +#line 3151 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt); } -#line 9178 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9194 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 475: -#line 3149 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 476: +#line 3157 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt, true); } -#line 9189 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9205 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 476: -#line 3155 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 477: +#line 3163 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint); } -#line 9200 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9216 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 477: -#line 3161 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 478: +#line 3169 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint, true); } -#line 9211 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9227 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 478: -#line 3167 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 479: +#line 3175 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[0].interm.type); (yyval.interm.type).qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; parseContext.structTypeCheck((yyval.interm.type).loc, (yyval.interm.type)); } -#line 9221 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9237 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 479: -#line 3172 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 480: +#line 3180 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // // This is for user defined type names. The lexical phase looked up the @@ -9235,47 +9251,47 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); } else parseContext.error((yyvsp[0].lex).loc, "expected type name", (yyvsp[0].lex).string->c_str(), ""); } -#line 9239 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9255 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 480: -#line 3188 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 481: +#line 3196 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "highp precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqHigh); } -#line 9249 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9265 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 481: -#line 3193 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 482: +#line 3201 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "mediump precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqMedium); } -#line 9259 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9275 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 482: -#line 3198 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 483: +#line 3206 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "lowp precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqLow); } -#line 9269 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9285 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 483: -#line 3206 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 484: +#line 3214 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.nestedStructCheck((yyvsp[-2].lex).loc); } -#line 9275 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9291 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 484: -#line 3206 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 485: +#line 3214 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { TType* structure = new TType((yyvsp[-1].interm.typeList), *(yyvsp[-4].lex).string); parseContext.structArrayCheck((yyvsp[-4].lex).loc, *structure); @@ -9287,17 +9303,17 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 9291 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9307 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 485: -#line 3217 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 486: +#line 3225 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.nestedStructCheck((yyvsp[-1].lex).loc); } -#line 9297 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9313 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 486: -#line 3217 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 487: +#line 3225 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { TType* structure = new TType((yyvsp[-1].interm.typeList), TString("")); (yyval.interm.type).init((yyvsp[-4].lex).loc); @@ -9305,19 +9321,19 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 9309 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9325 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 487: -#line 3227 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 488: +#line 3235 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeList) = (yyvsp[0].interm.typeList); } -#line 9317 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9333 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 488: -#line 3230 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 489: +#line 3238 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); for (unsigned int i = 0; i < (yyvsp[0].interm.typeList)->size(); ++i) { @@ -9328,11 +9344,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.typeList)->push_back((*(yyvsp[0].interm.typeList))[i]); } } -#line 9332 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9348 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 489: -#line 3243 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 490: +#line 3251 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -9355,11 +9371,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 9359 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9375 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 490: -#line 3265 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 491: +#line 3273 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -9384,38 +9400,38 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 9388 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9404 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 491: -#line 3292 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 492: +#line 3300 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeList) = new TTypeList; (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 9397 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9413 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 492: -#line 3296 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 493: +#line 3304 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 9405 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9421 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 493: -#line 3302 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 494: +#line 3310 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeLine).type = new TType(EbtVoid); (yyval.interm.typeLine).loc = (yyvsp[0].lex).loc; (yyval.interm.typeLine).type->setFieldName(*(yyvsp[0].lex).string); } -#line 9415 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9431 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 494: -#line 3307 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 495: +#line 3315 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.arrayOfArrayVersionCheck((yyvsp[-1].lex).loc, (yyvsp[0].interm).arraySizes); @@ -9424,219 +9440,219 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.typeLine).type->setFieldName(*(yyvsp[-1].lex).string); (yyval.interm.typeLine).type->transferArraySizes((yyvsp[0].interm).arraySizes); } -#line 9428 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9444 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 495: -#line 3318 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 496: +#line 3326 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 9436 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9452 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 496: -#line 3321 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 497: +#line 3329 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { const char* initFeature = "{ } style initializers"; parseContext.requireProfile((yyvsp[-2].lex).loc, ~EEsProfile, initFeature); parseContext.profileRequires((yyvsp[-2].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); } -#line 9447 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9463 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 497: -#line 3327 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 498: +#line 3335 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { const char* initFeature = "{ } style initializers"; parseContext.requireProfile((yyvsp[-3].lex).loc, ~EEsProfile, initFeature); parseContext.profileRequires((yyvsp[-3].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 9458 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9474 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 498: -#line 3336 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 499: +#line 3344 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(0, (yyvsp[0].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)->getLoc()); } -#line 9466 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9482 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 499: -#line 3339 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 500: +#line 3347 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); } -#line 9474 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 500: -#line 3345 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9480 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9490 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 501: -#line 3349 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3353 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9486 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9496 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 502: -#line 3350 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3357 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9492 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9502 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 503: -#line 3356 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3358 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9498 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9508 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 504: -#line 3357 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3364 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9504 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9514 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 505: -#line 3358 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3365 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9510 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9520 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 506: -#line 3359 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3366 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9516 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9526 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 507: -#line 3360 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3367 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9522 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9532 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 508: -#line 3361 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3368 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9528 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9538 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 509: -#line 3362 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3369 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9534 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9544 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 510: -#line 3366 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermNode) = 0; } -#line 9540 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 3370 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 9550 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 511: -#line 3367 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3374 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = 0; } +#line 9556 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 512: +#line 3375 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; } -#line 9549 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9565 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 512: -#line 3371 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 513: +#line 3379 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; } -#line 9558 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9574 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 513: -#line 3375 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 514: +#line 3383 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-2].interm.intermNode) && (yyvsp[-2].interm.intermNode)->getAsAggregate()) (yyvsp[-2].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-2].interm.intermNode); } -#line 9568 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9584 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 514: -#line 3383 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 515: +#line 3391 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9574 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9590 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 515: -#line 3384 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 516: +#line 3392 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9580 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9596 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 516: -#line 3388 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 517: +#line 3396 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { ++parseContext.controlFlowNestingLevel; } -#line 9588 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9604 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 517: -#line 3391 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 518: +#line 3399 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9597 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9613 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 518: -#line 3395 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 519: +#line 3403 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 9607 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9623 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 519: -#line 3400 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 520: +#line 3408 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9618 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9634 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 520: -#line 3409 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 521: +#line 3417 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; } -#line 9626 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9642 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 521: -#line 3412 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 522: +#line 3420 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-1].interm.intermNode) && (yyvsp[-1].interm.intermNode)->getAsAggregate()) (yyvsp[-1].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-1].interm.intermNode); } -#line 9636 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9652 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 522: -#line 3420 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 523: +#line 3428 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || @@ -9645,11 +9661,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case } } -#line 9649 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9665 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 523: -#line 3428 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 524: +#line 3436 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || (yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) { @@ -9658,76 +9674,76 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); } else (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 9662 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9678 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 524: -#line 3439 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 525: +#line 3447 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; } -#line 9668 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9684 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 525: -#line 3440 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 526: +#line 3448 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = static_cast((yyvsp[-1].interm.intermTypedNode)); } -#line 9674 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9690 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 526: -#line 3444 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 527: +#line 3452 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9682 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9698 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 527: -#line 3447 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 528: +#line 3455 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.handleSelectionAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9691 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9707 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 528: -#line 3453 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 529: +#line 3461 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-2].interm.intermTypedNode)); (yyval.interm.intermNode) = parseContext.intermediate.addSelection((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.nodePair), (yyvsp[-4].lex).loc); } -#line 9700 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9716 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 529: -#line 3460 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 530: +#line 3468 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermNode); } -#line 9709 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9725 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 530: -#line 3464 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 531: +#line 3472 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.nodePair).node1 = (yyvsp[0].interm.intermNode); (yyval.interm.nodePair).node2 = 0; } -#line 9718 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9734 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 531: -#line 3472 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 532: +#line 3480 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); parseContext.boolCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)); } -#line 9727 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9743 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 532: -#line 3476 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 533: +#line 3484 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.boolCheck((yyvsp[-2].lex).loc, (yyvsp[-3].interm.type)); @@ -9738,28 +9754,28 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); else (yyval.interm.intermTypedNode) = 0; } -#line 9742 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9758 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 533: -#line 3489 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 534: +#line 3497 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9750 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9766 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 534: -#line 3492 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 535: +#line 3500 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.handleSwitchAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9759 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9775 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 535: -#line 3498 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 536: +#line 3506 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // start new switch sequence on the switch stack ++parseContext.controlFlowNestingLevel; @@ -9768,11 +9784,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); parseContext.switchLevel.push_back(parseContext.statementNestingLevel); parseContext.symbolTable.push(); } -#line 9772 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9788 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 536: -#line 3506 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 537: +#line 3514 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = parseContext.addSwitch((yyvsp[-7].lex).loc, (yyvsp[-5].interm.intermTypedNode), (yyvsp[-1].interm.intermNode) ? (yyvsp[-1].interm.intermNode)->getAsAggregate() : 0); delete parseContext.switchSequenceStack.back(); @@ -9782,27 +9798,27 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 9786 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9802 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 537: -#line 3518 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 538: +#line 3526 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; } -#line 9794 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9810 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 538: -#line 3521 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 539: +#line 3529 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9802 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9818 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 539: -#line 3527 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 540: +#line 3535 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) @@ -9815,11 +9831,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpCase, (yyvsp[-1].interm.intermTypedNode), (yyvsp[-2].lex).loc); } } -#line 9819 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9835 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 540: -#line 3539 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 541: +#line 3547 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) @@ -9829,28 +9845,28 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); else (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDefault, (yyvsp[-1].lex).loc); } -#line 9833 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9849 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 541: -#line 3551 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 542: +#line 3559 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9841 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9857 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 542: -#line 3554 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 543: +#line 3562 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.handleLoopAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9850 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9866 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 543: -#line 3560 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 544: +#line 3568 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if (! parseContext.limits.whileLoops) parseContext.error((yyvsp[-1].lex).loc, "while loops not available", "limitation", ""); @@ -9859,11 +9875,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 9863 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9879 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 544: -#line 3568 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 545: +#line 3576 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); (yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[0].interm.intermNode), (yyvsp[-2].interm.intermTypedNode), 0, true, (yyvsp[-5].lex).loc); @@ -9871,21 +9887,21 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 9875 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9891 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 545: -#line 3575 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 546: +#line 3583 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 9885 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9901 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 546: -#line 3580 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 547: +#line 3588 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if (! parseContext.limits.whileLoops) parseContext.error((yyvsp[-7].lex).loc, "do-while loops not available", "limitation", ""); @@ -9897,22 +9913,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 9901 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9917 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 547: -#line 3591 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 548: +#line 3599 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 9912 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9928 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 548: -#line 3597 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 549: +#line 3605 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[-3].interm.intermNode), (yyvsp[-5].lex).loc); @@ -9925,81 +9941,81 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 9929 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9945 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 549: -#line 3612 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 550: +#line 3620 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9937 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9953 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 550: -#line 3615 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 551: +#line 3623 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9945 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9961 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 551: -#line 3621 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 552: +#line 3629 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 9953 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9969 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 552: -#line 3624 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 553: +#line 3632 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = 0; } -#line 9961 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9977 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 553: -#line 3630 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 554: +#line 3638 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.nodePair).node1 = (yyvsp[-1].interm.intermTypedNode); (yyval.interm.nodePair).node2 = 0; } -#line 9970 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9986 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 554: -#line 3634 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 555: +#line 3642 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermTypedNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermTypedNode); } -#line 9979 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9995 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 555: -#line 3641 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 556: +#line 3649 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if (parseContext.loopNestingLevel <= 0) parseContext.error((yyvsp[-1].lex).loc, "continue statement only allowed in loops", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpContinue, (yyvsp[-1].lex).loc); } -#line 9989 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10005 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 556: -#line 3646 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 557: +#line 3654 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if (parseContext.loopNestingLevel + parseContext.switchSequenceStack.size() <= 0) parseContext.error((yyvsp[-1].lex).loc, "break statement only allowed in switch and loops", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpBreak, (yyvsp[-1].lex).loc); } -#line 9999 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10015 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 557: -#line 3651 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 558: +#line 3659 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[-1].lex).loc); if (parseContext.currentFunctionType->getBasicType() != EbtVoid) @@ -10007,83 +10023,83 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); if (parseContext.inMain) parseContext.postEntryPointReturn = true; } -#line 10011 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10027 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 558: -#line 3658 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 559: +#line 3666 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = parseContext.handleReturnValue((yyvsp[-2].lex).loc, (yyvsp[-1].interm.intermTypedNode)); } -#line 10019 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10035 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 559: -#line 3661 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 560: +#line 3669 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "discard"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpKill, (yyvsp[-1].lex).loc); } -#line 10028 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10044 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 560: -#line 3670 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 561: +#line 3678 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } -#line 10037 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10053 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 561: -#line 3674 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 562: +#line 3682 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if ((yyvsp[0].interm.intermNode) != nullptr) { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } } -#line 10048 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10064 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 562: -#line 3683 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 563: +#line 3691 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 10056 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10072 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 563: -#line 3686 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 564: +#line 3694 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 10064 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10080 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 564: -#line 3689 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 565: +#line 3697 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireProfile((yyvsp[0].lex).loc, ~EEsProfile, "extraneous semicolon"); parseContext.profileRequires((yyvsp[0].lex).loc, ~EEsProfile, 460, nullptr, "extraneous semicolon"); (yyval.interm.intermNode) = nullptr; } -#line 10074 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10090 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 565: -#line 3697 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 566: +#line 3705 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyvsp[0].interm).function = parseContext.handleFunctionDeclarator((yyvsp[0].interm).loc, *(yyvsp[0].interm).function, false /* not prototype */); (yyvsp[0].interm).intermNode = parseContext.handleFunctionDefinition((yyvsp[0].interm).loc, *(yyvsp[0].interm).function); } -#line 10083 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10099 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 566: -#line 3701 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 567: +#line 3709 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // May be best done as post process phase on intermediate code if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue) @@ -10099,52 +10115,52 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); (yyval.interm.intermNode)->getAsAggregate()->setDebug(parseContext.contextPragma.debug); (yyval.interm.intermNode)->getAsAggregate()->setPragmaTable(parseContext.contextPragma.pragmaTable); } -#line 10103 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10119 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 567: -#line 3719 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 568: +#line 3727 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.attributes) = (yyvsp[-2].interm.attributes); parseContext.requireExtensions((yyvsp[-4].lex).loc, 1, &E_GL_EXT_control_flow_attributes, "attribute"); } -#line 10112 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10128 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 568: -#line 3725 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 569: +#line 3733 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.attributes) = (yyvsp[0].interm.attributes); } -#line 10120 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10136 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 569: -#line 3728 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 570: +#line 3736 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.attributes) = parseContext.mergeAttributes((yyvsp[-2].interm.attributes), (yyvsp[0].interm.attributes)); } -#line 10128 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10144 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 570: -#line 3733 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 571: +#line 3741 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[0].lex).string); } -#line 10136 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10152 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 571: -#line 3736 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 572: +#line 3744 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[-3].lex).string, (yyvsp[-1].interm.intermTypedNode)); } -#line 10144 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10160 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; -#line 10148 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10164 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -10372,5 +10388,5 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); #endif return yyresult; } -#line 3740 "MachineIndependent/glslang.y" /* yacc.c:1906 */ +#line 3748 "MachineIndependent/glslang.y" /* yacc.c:1906 */ diff --git a/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp.h b/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp.h index 50bbcfcb..6fcdd926 100644 --- a/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp.h +++ b/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp.h @@ -261,193 +261,194 @@ extern int yydebug; ISAMPLER2DMSARRAY = 471, USAMPLER2DMSARRAY = 472, SAMPLEREXTERNALOES = 473, - F16SAMPLER1D = 474, - F16SAMPLER2D = 475, - F16SAMPLER3D = 476, - F16SAMPLER2DRECT = 477, - F16SAMPLERCUBE = 478, - F16SAMPLER1DARRAY = 479, - F16SAMPLER2DARRAY = 480, - F16SAMPLERCUBEARRAY = 481, - F16SAMPLERBUFFER = 482, - F16SAMPLER2DMS = 483, - F16SAMPLER2DMSARRAY = 484, - F16SAMPLER1DSHADOW = 485, - F16SAMPLER2DSHADOW = 486, - F16SAMPLER1DARRAYSHADOW = 487, - F16SAMPLER2DARRAYSHADOW = 488, - F16SAMPLER2DRECTSHADOW = 489, - F16SAMPLERCUBESHADOW = 490, - F16SAMPLERCUBEARRAYSHADOW = 491, - SAMPLER = 492, - SAMPLERSHADOW = 493, - TEXTURE1D = 494, - TEXTURE2D = 495, - TEXTURE3D = 496, - TEXTURECUBE = 497, - TEXTURE1DARRAY = 498, - TEXTURE2DARRAY = 499, - ITEXTURE1D = 500, - ITEXTURE2D = 501, - ITEXTURE3D = 502, - ITEXTURECUBE = 503, - ITEXTURE1DARRAY = 504, - ITEXTURE2DARRAY = 505, - UTEXTURE1D = 506, - UTEXTURE2D = 507, - UTEXTURE3D = 508, - UTEXTURECUBE = 509, - UTEXTURE1DARRAY = 510, - UTEXTURE2DARRAY = 511, - TEXTURE2DRECT = 512, - ITEXTURE2DRECT = 513, - UTEXTURE2DRECT = 514, - TEXTUREBUFFER = 515, - ITEXTUREBUFFER = 516, - UTEXTUREBUFFER = 517, - TEXTURECUBEARRAY = 518, - ITEXTURECUBEARRAY = 519, - UTEXTURECUBEARRAY = 520, - TEXTURE2DMS = 521, - ITEXTURE2DMS = 522, - UTEXTURE2DMS = 523, - TEXTURE2DMSARRAY = 524, - ITEXTURE2DMSARRAY = 525, - UTEXTURE2DMSARRAY = 526, - F16TEXTURE1D = 527, - F16TEXTURE2D = 528, - F16TEXTURE3D = 529, - F16TEXTURE2DRECT = 530, - F16TEXTURECUBE = 531, - F16TEXTURE1DARRAY = 532, - F16TEXTURE2DARRAY = 533, - F16TEXTURECUBEARRAY = 534, - F16TEXTUREBUFFER = 535, - F16TEXTURE2DMS = 536, - F16TEXTURE2DMSARRAY = 537, - SUBPASSINPUT = 538, - SUBPASSINPUTMS = 539, - ISUBPASSINPUT = 540, - ISUBPASSINPUTMS = 541, - USUBPASSINPUT = 542, - USUBPASSINPUTMS = 543, - F16SUBPASSINPUT = 544, - F16SUBPASSINPUTMS = 545, - IMAGE1D = 546, - IIMAGE1D = 547, - UIMAGE1D = 548, - IMAGE2D = 549, - IIMAGE2D = 550, - UIMAGE2D = 551, - IMAGE3D = 552, - IIMAGE3D = 553, - UIMAGE3D = 554, - IMAGE2DRECT = 555, - IIMAGE2DRECT = 556, - UIMAGE2DRECT = 557, - IMAGECUBE = 558, - IIMAGECUBE = 559, - UIMAGECUBE = 560, - IMAGEBUFFER = 561, - IIMAGEBUFFER = 562, - UIMAGEBUFFER = 563, - IMAGE1DARRAY = 564, - IIMAGE1DARRAY = 565, - UIMAGE1DARRAY = 566, - IMAGE2DARRAY = 567, - IIMAGE2DARRAY = 568, - UIMAGE2DARRAY = 569, - IMAGECUBEARRAY = 570, - IIMAGECUBEARRAY = 571, - UIMAGECUBEARRAY = 572, - IMAGE2DMS = 573, - IIMAGE2DMS = 574, - UIMAGE2DMS = 575, - IMAGE2DMSARRAY = 576, - IIMAGE2DMSARRAY = 577, - UIMAGE2DMSARRAY = 578, - F16IMAGE1D = 579, - F16IMAGE2D = 580, - F16IMAGE3D = 581, - F16IMAGE2DRECT = 582, - F16IMAGECUBE = 583, - F16IMAGE1DARRAY = 584, - F16IMAGE2DARRAY = 585, - F16IMAGECUBEARRAY = 586, - F16IMAGEBUFFER = 587, - F16IMAGE2DMS = 588, - F16IMAGE2DMSARRAY = 589, - STRUCT = 590, - VOID = 591, - WHILE = 592, - IDENTIFIER = 593, - TYPE_NAME = 594, - FLOATCONSTANT = 595, - DOUBLECONSTANT = 596, - INT16CONSTANT = 597, - UINT16CONSTANT = 598, - INT32CONSTANT = 599, - UINT32CONSTANT = 600, - INTCONSTANT = 601, - UINTCONSTANT = 602, - INT64CONSTANT = 603, - UINT64CONSTANT = 604, - BOOLCONSTANT = 605, - FLOAT16CONSTANT = 606, - LEFT_OP = 607, - RIGHT_OP = 608, - INC_OP = 609, - DEC_OP = 610, - LE_OP = 611, - GE_OP = 612, - EQ_OP = 613, - NE_OP = 614, - AND_OP = 615, - OR_OP = 616, - XOR_OP = 617, - MUL_ASSIGN = 618, - DIV_ASSIGN = 619, - ADD_ASSIGN = 620, - MOD_ASSIGN = 621, - LEFT_ASSIGN = 622, - RIGHT_ASSIGN = 623, - AND_ASSIGN = 624, - XOR_ASSIGN = 625, - OR_ASSIGN = 626, - SUB_ASSIGN = 627, - LEFT_PAREN = 628, - RIGHT_PAREN = 629, - LEFT_BRACKET = 630, - RIGHT_BRACKET = 631, - LEFT_BRACE = 632, - RIGHT_BRACE = 633, - DOT = 634, - COMMA = 635, - COLON = 636, - EQUAL = 637, - SEMICOLON = 638, - BANG = 639, - DASH = 640, - TILDE = 641, - PLUS = 642, - STAR = 643, - SLASH = 644, - PERCENT = 645, - LEFT_ANGLE = 646, - RIGHT_ANGLE = 647, - VERTICAL_BAR = 648, - CARET = 649, - AMPERSAND = 650, - QUESTION = 651, - INVARIANT = 652, - PRECISE = 653, - HIGH_PRECISION = 654, - MEDIUM_PRECISION = 655, - LOW_PRECISION = 656, - PRECISION = 657, - PACKED = 658, - RESOURCE = 659, - SUPERP = 660 + SAMPLEREXTERNAL2DY2YEXT = 474, + F16SAMPLER1D = 475, + F16SAMPLER2D = 476, + F16SAMPLER3D = 477, + F16SAMPLER2DRECT = 478, + F16SAMPLERCUBE = 479, + F16SAMPLER1DARRAY = 480, + F16SAMPLER2DARRAY = 481, + F16SAMPLERCUBEARRAY = 482, + F16SAMPLERBUFFER = 483, + F16SAMPLER2DMS = 484, + F16SAMPLER2DMSARRAY = 485, + F16SAMPLER1DSHADOW = 486, + F16SAMPLER2DSHADOW = 487, + F16SAMPLER1DARRAYSHADOW = 488, + F16SAMPLER2DARRAYSHADOW = 489, + F16SAMPLER2DRECTSHADOW = 490, + F16SAMPLERCUBESHADOW = 491, + F16SAMPLERCUBEARRAYSHADOW = 492, + SAMPLER = 493, + SAMPLERSHADOW = 494, + TEXTURE1D = 495, + TEXTURE2D = 496, + TEXTURE3D = 497, + TEXTURECUBE = 498, + TEXTURE1DARRAY = 499, + TEXTURE2DARRAY = 500, + ITEXTURE1D = 501, + ITEXTURE2D = 502, + ITEXTURE3D = 503, + ITEXTURECUBE = 504, + ITEXTURE1DARRAY = 505, + ITEXTURE2DARRAY = 506, + UTEXTURE1D = 507, + UTEXTURE2D = 508, + UTEXTURE3D = 509, + UTEXTURECUBE = 510, + UTEXTURE1DARRAY = 511, + UTEXTURE2DARRAY = 512, + TEXTURE2DRECT = 513, + ITEXTURE2DRECT = 514, + UTEXTURE2DRECT = 515, + TEXTUREBUFFER = 516, + ITEXTUREBUFFER = 517, + UTEXTUREBUFFER = 518, + TEXTURECUBEARRAY = 519, + ITEXTURECUBEARRAY = 520, + UTEXTURECUBEARRAY = 521, + TEXTURE2DMS = 522, + ITEXTURE2DMS = 523, + UTEXTURE2DMS = 524, + TEXTURE2DMSARRAY = 525, + ITEXTURE2DMSARRAY = 526, + UTEXTURE2DMSARRAY = 527, + F16TEXTURE1D = 528, + F16TEXTURE2D = 529, + F16TEXTURE3D = 530, + F16TEXTURE2DRECT = 531, + F16TEXTURECUBE = 532, + F16TEXTURE1DARRAY = 533, + F16TEXTURE2DARRAY = 534, + F16TEXTURECUBEARRAY = 535, + F16TEXTUREBUFFER = 536, + F16TEXTURE2DMS = 537, + F16TEXTURE2DMSARRAY = 538, + SUBPASSINPUT = 539, + SUBPASSINPUTMS = 540, + ISUBPASSINPUT = 541, + ISUBPASSINPUTMS = 542, + USUBPASSINPUT = 543, + USUBPASSINPUTMS = 544, + F16SUBPASSINPUT = 545, + F16SUBPASSINPUTMS = 546, + IMAGE1D = 547, + IIMAGE1D = 548, + UIMAGE1D = 549, + IMAGE2D = 550, + IIMAGE2D = 551, + UIMAGE2D = 552, + IMAGE3D = 553, + IIMAGE3D = 554, + UIMAGE3D = 555, + IMAGE2DRECT = 556, + IIMAGE2DRECT = 557, + UIMAGE2DRECT = 558, + IMAGECUBE = 559, + IIMAGECUBE = 560, + UIMAGECUBE = 561, + IMAGEBUFFER = 562, + IIMAGEBUFFER = 563, + UIMAGEBUFFER = 564, + IMAGE1DARRAY = 565, + IIMAGE1DARRAY = 566, + UIMAGE1DARRAY = 567, + IMAGE2DARRAY = 568, + IIMAGE2DARRAY = 569, + UIMAGE2DARRAY = 570, + IMAGECUBEARRAY = 571, + IIMAGECUBEARRAY = 572, + UIMAGECUBEARRAY = 573, + IMAGE2DMS = 574, + IIMAGE2DMS = 575, + UIMAGE2DMS = 576, + IMAGE2DMSARRAY = 577, + IIMAGE2DMSARRAY = 578, + UIMAGE2DMSARRAY = 579, + F16IMAGE1D = 580, + F16IMAGE2D = 581, + F16IMAGE3D = 582, + F16IMAGE2DRECT = 583, + F16IMAGECUBE = 584, + F16IMAGE1DARRAY = 585, + F16IMAGE2DARRAY = 586, + F16IMAGECUBEARRAY = 587, + F16IMAGEBUFFER = 588, + F16IMAGE2DMS = 589, + F16IMAGE2DMSARRAY = 590, + STRUCT = 591, + VOID = 592, + WHILE = 593, + IDENTIFIER = 594, + TYPE_NAME = 595, + FLOATCONSTANT = 596, + DOUBLECONSTANT = 597, + INT16CONSTANT = 598, + UINT16CONSTANT = 599, + INT32CONSTANT = 600, + UINT32CONSTANT = 601, + INTCONSTANT = 602, + UINTCONSTANT = 603, + INT64CONSTANT = 604, + UINT64CONSTANT = 605, + BOOLCONSTANT = 606, + FLOAT16CONSTANT = 607, + LEFT_OP = 608, + RIGHT_OP = 609, + INC_OP = 610, + DEC_OP = 611, + LE_OP = 612, + GE_OP = 613, + EQ_OP = 614, + NE_OP = 615, + AND_OP = 616, + OR_OP = 617, + XOR_OP = 618, + MUL_ASSIGN = 619, + DIV_ASSIGN = 620, + ADD_ASSIGN = 621, + MOD_ASSIGN = 622, + LEFT_ASSIGN = 623, + RIGHT_ASSIGN = 624, + AND_ASSIGN = 625, + XOR_ASSIGN = 626, + OR_ASSIGN = 627, + SUB_ASSIGN = 628, + LEFT_PAREN = 629, + RIGHT_PAREN = 630, + LEFT_BRACKET = 631, + RIGHT_BRACKET = 632, + LEFT_BRACE = 633, + RIGHT_BRACE = 634, + DOT = 635, + COMMA = 636, + COLON = 637, + EQUAL = 638, + SEMICOLON = 639, + BANG = 640, + DASH = 641, + TILDE = 642, + PLUS = 643, + STAR = 644, + SLASH = 645, + PERCENT = 646, + LEFT_ANGLE = 647, + RIGHT_ANGLE = 648, + VERTICAL_BAR = 649, + CARET = 650, + AMPERSAND = 651, + QUESTION = 652, + INVARIANT = 653, + PRECISE = 654, + HIGH_PRECISION = 655, + MEDIUM_PRECISION = 656, + LOW_PRECISION = 657, + PRECISION = 658, + PACKED = 659, + RESOURCE = 660, + SUPERP = 661 }; #endif @@ -456,7 +457,7 @@ extern int yydebug; union YYSTYPE { -#line 70 "MachineIndependent/glslang.y" /* yacc.c:1909 */ +#line 71 "MachineIndependent/glslang.y" /* yacc.c:1909 */ struct { glslang::TSourceLoc loc; @@ -491,7 +492,7 @@ union YYSTYPE }; } interm; -#line 495 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */ +#line 496 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */ }; typedef union YYSTYPE YYSTYPE; diff --git a/deps/glslang/glslang/MachineIndependent/intermOut.cpp b/deps/glslang/glslang/MachineIndependent/intermOut.cpp index 5ad67906..f74b90aa 100644 --- a/deps/glslang/glslang/MachineIndependent/intermOut.cpp +++ b/deps/glslang/glslang/MachineIndependent/intermOut.cpp @@ -172,8 +172,12 @@ bool TOutputTraverser::visitBinary(TVisit /* visit */, TIntermBinary* node) case EOpIndexDirect: out.debug << "direct index"; break; case EOpIndexIndirect: out.debug << "indirect index"; break; case EOpIndexDirectStruct: - out.debug << (*node->getLeft()->getType().getStruct())[node->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst()].type->getFieldName(); - out.debug << ": direct index for structure"; break; + { + bool reference = node->getLeft()->getType().getBasicType() == EbtReference; + const TTypeList *members = reference ? node->getLeft()->getType().getReferentType()->getStruct() : node->getLeft()->getType().getStruct(); + out.debug << (*members)[node->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst()].type->getFieldName(); + out.debug << ": direct index for structure"; break; + } case EOpVectorSwizzle: out.debug << "vector swizzle"; break; case EOpMatrixSwizzle: out.debug << "matrix swizzle"; break; @@ -419,6 +423,8 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpConvDoubleToUint: out.debug << "Convert double to uint"; break; case EOpConvDoubleToUint64: out.debug << "Convert double to uint64"; break; + case EOpConvUint64ToPtr: out.debug << "Convert uint64_t to pointer"; break; + case EOpConvPtrToUint64: out.debug << "Convert pointer to uint64_t"; break; case EOpRadians: out.debug << "radians"; break; case EOpDegrees: out.debug << "degrees"; break; @@ -674,6 +680,8 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpSubpassLoad: out.debug << "subpassLoad"; break; case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break; + case EOpConstructReference: out.debug << "Construct reference type"; break; + default: out.debug.message(EPrefixError, "Bad unary op"); } @@ -808,6 +816,7 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpConstructF16Mat4x4: out.debug << "Construct f16mat4"; break; case EOpConstructStruct: out.debug << "Construct structure"; break; case EOpConstructTextureSampler: out.debug << "Construct combined texture-sampler"; break; + case EOpConstructReference: out.debug << "Construct reference"; break; case EOpLessThan: out.debug << "Compare Less Than"; break; case EOpGreaterThan: out.debug << "Compare Greater Than"; break; diff --git a/deps/glslang/glslang/MachineIndependent/linkValidate.cpp b/deps/glslang/glslang/MachineIndependent/linkValidate.cpp index 8630128f..0cf2d360 100644 --- a/deps/glslang/glslang/MachineIndependent/linkValidate.cpp +++ b/deps/glslang/glslang/MachineIndependent/linkValidate.cpp @@ -1,6 +1,7 @@ // // Copyright (C) 2013 LunarG, Inc. // Copyright (C) 2017 ARM Limited. +// Copyright (C) 2015-2018 Google, Inc. // // All rights reserved. // @@ -221,8 +222,14 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit) else if (xfbBuffers[b].stride != unit.xfbBuffers[b].stride) error(infoSink, "Contradictory xfb_stride"); xfbBuffers[b].implicitStride = std::max(xfbBuffers[b].implicitStride, unit.xfbBuffers[b].implicitStride); - if (unit.xfbBuffers[b].containsDouble) - xfbBuffers[b].containsDouble = true; + if (unit.xfbBuffers[b].contains64BitType) + xfbBuffers[b].contains64BitType = true; +#ifdef AMD_EXTENSIONS + if (unit.xfbBuffers[b].contains32BitType) + xfbBuffers[b].contains32BitType = true; + if (unit.xfbBuffers[b].contains16BitType) + xfbBuffers[b].contains16BitType = true; +#endif // TODO: 4.4 link: enhanced layouts: compare ranges } @@ -260,6 +267,7 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit) MERGE_TRUE(needToLegalize); MERGE_TRUE(binaryDoubleOutput); + MERGE_TRUE(usePhysicalStorageBuffer); } // @@ -632,8 +640,14 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled) error(infoSink, "Cannot use both gl_FragColor and gl_FragData"); for (size_t b = 0; b < xfbBuffers.size(); ++b) { - if (xfbBuffers[b].containsDouble) + if (xfbBuffers[b].contains64BitType) RoundToPow2(xfbBuffers[b].implicitStride, 8); +#ifdef AMD_EXTENSIONS + else if (xfbBuffers[b].contains32BitType) + RoundToPow2(xfbBuffers[b].implicitStride, 4); + else if (xfbBuffers[b].contains16BitType) + RoundToPow2(xfbBuffers[b].implicitStride, 2); +#endif // "It is a compile-time or link-time error to have // any xfb_offset that overflows xfb_stride, whether stated on declarations before or after the xfb_stride, or @@ -648,18 +662,31 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled) xfbBuffers[b].stride = xfbBuffers[b].implicitStride; // "If the buffer is capturing any - // outputs with double-precision components, the stride must be a multiple of 8, otherwise it must be a + // outputs with double-precision or 64-bit integer components, the stride must be a multiple of 8, otherwise it must be a // multiple of 4, or a compile-time or link-time error results." - if (xfbBuffers[b].containsDouble && ! IsMultipleOfPow2(xfbBuffers[b].stride, 8)) { - error(infoSink, "xfb_stride must be multiple of 8 for buffer holding a double:"); + if (xfbBuffers[b].contains64BitType && ! IsMultipleOfPow2(xfbBuffers[b].stride, 8)) { + error(infoSink, "xfb_stride must be multiple of 8 for buffer holding a double or 64-bit integer:"); infoSink.info.prefix(EPrefixError); infoSink.info << " xfb_buffer " << (unsigned int)b << ", xfb_stride " << xfbBuffers[b].stride << "\n"; +#ifdef AMD_EXTENSIONS + } else if (xfbBuffers[b].contains32BitType && ! IsMultipleOfPow2(xfbBuffers[b].stride, 4)) { +#else } else if (! IsMultipleOfPow2(xfbBuffers[b].stride, 4)) { +#endif error(infoSink, "xfb_stride must be multiple of 4:"); infoSink.info.prefix(EPrefixError); infoSink.info << " xfb_buffer " << (unsigned int)b << ", xfb_stride " << xfbBuffers[b].stride << "\n"; } +#ifdef AMD_EXTENSIONS + // "If the buffer is capturing any + // outputs with half-precision or 16-bit integer components, the stride must be a multiple of 2" + else if (xfbBuffers[b].contains16BitType && ! IsMultipleOfPow2(xfbBuffers[b].stride, 2)) { + error(infoSink, "xfb_stride must be multiple of 2 for buffer holding a half float or 16-bit integer:"); + infoSink.info.prefix(EPrefixError); + infoSink.info << " xfb_buffer " << (unsigned int)b << ", xfb_stride " << xfbBuffers[b].stride << "\n"; + } +#endif // "The resulting stride (implicit or explicit), when divided by 4, must be less than or equal to the // implementation-dependent constant gl_MaxTransformFeedbackInterleavedComponents." if (xfbBuffers[b].stride > (unsigned int)(4 * resources.maxTransformFeedbackInterleavedComponents)) { @@ -1258,7 +1285,11 @@ int TIntermediate::addXfbBufferOffset(const TType& type) TXfbBuffer& buffer = xfbBuffers[qualifier.layoutXfbBuffer]; // compute the range - unsigned int size = computeTypeXfbSize(type, buffer.containsDouble); +#ifdef AMD_EXTENSIONS + unsigned int size = computeTypeXfbSize(type, buffer.contains64BitType, buffer.contains32BitType, buffer.contains16BitType); +#else + unsigned int size = computeTypeXfbSize(type, buffer.contains64BitType); +#endif buffer.implicitStride = std::max(buffer.implicitStride, qualifier.layoutXfbOffset + size); TRange range(qualifier.layoutXfbOffset, qualifier.layoutXfbOffset + size - 1); @@ -1277,11 +1308,18 @@ int TIntermediate::addXfbBufferOffset(const TType& type) // Recursively figure out how many bytes of xfb buffer are used by the given type. // Return the size of type, in bytes. -// Sets containsDouble to true if the type contains a double. -// N.B. Caller must set containsDouble to false before calling. -unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& containsDouble) const +// Sets contains64BitType to true if the type contains a 64-bit data type. +#ifdef AMD_EXTENSIONS +// Sets contains32BitType to true if the type contains a 32-bit data type. +// Sets contains16BitType to true if the type contains a 16-bit data type. +// N.B. Caller must set contains64BitType, contains32BitType, and contains16BitType to false before calling. +unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& contains64BitType, bool& contains32BitType, bool& contains16BitType) const +#else +// N.B. Caller must set contains64BitType to false before calling. +unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& contains64BitType) const +#endif { - // "...if applied to an aggregate containing a double, the offset must also be a multiple of 8, + // "...if applied to an aggregate containing a double or 64-bit integer, the offset must also be a multiple of 8, // and the space taken in the buffer will be a multiple of 8. // ...within the qualified entity, subsequent components are each // assigned, in order, to the next available offset aligned to a multiple of @@ -1292,29 +1330,59 @@ unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& contains // TODO: perf: this can be flattened by using getCumulativeArraySize(), and a deref that discards all arrayness assert(type.isSizedArray()); TType elementType(type, 0); - return type.getOuterArraySize() * computeTypeXfbSize(elementType, containsDouble); +#ifdef AMD_EXTENSIONS + return type.getOuterArraySize() * computeTypeXfbSize(elementType, contains64BitType, contains16BitType, contains16BitType); +#else + return type.getOuterArraySize() * computeTypeXfbSize(elementType, contains64BitType); +#endif } if (type.isStruct()) { unsigned int size = 0; - bool structContainsDouble = false; + bool structContains64BitType = false; +#ifdef AMD_EXTENSIONS + bool structContains32BitType = false; + bool structContains16BitType = false; +#endif for (int member = 0; member < (int)type.getStruct()->size(); ++member) { TType memberType(type, member); // "... if applied to - // an aggregate containing a double, the offset must also be a multiple of 8, + // an aggregate containing a double or 64-bit integer, the offset must also be a multiple of 8, // and the space taken in the buffer will be a multiple of 8." - bool memberContainsDouble = false; - int memberSize = computeTypeXfbSize(memberType, memberContainsDouble); - if (memberContainsDouble) { - structContainsDouble = true; + bool memberContains64BitType = false; +#ifdef AMD_EXTENSIONS + bool memberContains32BitType = false; + bool memberContains16BitType = false; + int memberSize = computeTypeXfbSize(memberType, memberContains64BitType, memberContains32BitType, memberContains16BitType); +#else + int memberSize = computeTypeXfbSize(memberType, memberContains64BitType); +#endif + if (memberContains64BitType) { + structContains64BitType = true; RoundToPow2(size, 8); +#ifdef AMD_EXTENSIONS + } else if (memberContains32BitType) { + structContains32BitType = true; + RoundToPow2(size, 4); + } else if (memberContains16BitType) { + structContains16BitType = true; + RoundToPow2(size, 2); +#endif } size += memberSize; } - if (structContainsDouble) { - containsDouble = true; + if (structContains64BitType) { + contains64BitType = true; RoundToPow2(size, 8); +#ifdef AMD_EXTENSIONS + } else if (structContains32BitType) { + contains32BitType = true; + RoundToPow2(size, 4); + } else if (structContains16BitType) { + contains16BitType = true; + RoundToPow2(size, 2); +#endif } return size; } @@ -1331,11 +1399,23 @@ unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& contains numComponents = 1; } - if (type.getBasicType() == EbtDouble) { - containsDouble = true; + if (type.getBasicType() == EbtDouble || type.getBasicType() == EbtInt64 || type.getBasicType() == EbtUint64) { + contains64BitType = true; return 8 * numComponents; +#ifdef AMD_EXTENSIONS + } else if (type.getBasicType() == EbtFloat16 || type.getBasicType() == EbtInt16 || type.getBasicType() == EbtUint16) { + contains16BitType = true; + return 2 * numComponents; + } else if (type.getBasicType() == EbtInt8 || type.getBasicType() == EbtUint8) + return numComponents; + else { + contains32BitType = true; + return 4 * numComponents; + } +#else } else return 4 * numComponents; +#endif } const int baseAlignmentVec4Std140 = 16; @@ -1354,6 +1434,7 @@ int TIntermediate::getBaseAlignmentScalar(const TType& type, int& size) case EbtUint8: size = 1; return 1; case EbtInt16: case EbtUint16: size = 2; return 2; + case EbtReference: size = 8; return 8; default: size = 4; return 4; } } @@ -1372,10 +1453,11 @@ int TIntermediate::getBaseAlignmentScalar(const TType& type, int& size) // stride comes from the flattening down to vectors. // // Return value is the alignment of the type. -int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, bool std140, bool rowMajor) +int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, TLayoutPacking layoutPacking, bool rowMajor) { int alignment; + bool std140 = layoutPacking == glslang::ElpStd140; // When using the std140 storage layout, structures will be laid out in buffer // storage with its members stored in monotonically increasing order based on their // location in the declaration. A structure and each structure member have a base @@ -1439,7 +1521,7 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, b if (type.isArray()) { // TODO: perf: this might be flattened by using getCumulativeArraySize(), and a deref that discards all arrayness TType derefType(type, 0); - alignment = getBaseAlignment(derefType, size, dummyStride, std140, rowMajor); + alignment = getBaseAlignment(derefType, size, dummyStride, layoutPacking, rowMajor); if (std140) alignment = std::max(baseAlignmentVec4Std140, alignment); RoundToPow2(size, alignment); @@ -1459,7 +1541,7 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, b int memberSize; // modify just the children's view of matrix layout, if there is one for this member TLayoutMatrix subMatrixLayout = memberList[m].type->getQualifier().layoutMatrix; - int memberAlignment = getBaseAlignment(*memberList[m].type, memberSize, dummyStride, std140, + int memberAlignment = getBaseAlignment(*memberList[m].type, memberSize, dummyStride, layoutPacking, (subMatrixLayout != ElmNone) ? (subMatrixLayout == ElmRowMajor) : rowMajor); maxAlignment = std::max(maxAlignment, memberAlignment); RoundToPow2(size, memberAlignment); @@ -1498,7 +1580,7 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, b // rule 5: deref to row, not to column, meaning the size of vector is num columns instead of num rows TType derefType(type, 0, rowMajor); - alignment = getBaseAlignment(derefType, size, dummyStride, std140, rowMajor); + alignment = getBaseAlignment(derefType, size, dummyStride, layoutPacking, rowMajor); if (std140) alignment = std::max(baseAlignmentVec4Std140, alignment); RoundToPow2(size, alignment); @@ -1526,4 +1608,79 @@ bool TIntermediate::improperStraddle(const TType& type, int size, int offset) : offset % 16 != 0; } +int TIntermediate::getScalarAlignment(const TType& type, int& size, int& stride, bool rowMajor) +{ + int alignment; + + stride = 0; + int dummyStride; + + if (type.isArray()) { + TType derefType(type, 0); + alignment = getScalarAlignment(derefType, size, dummyStride, rowMajor); + + stride = size; + RoundToPow2(stride, alignment); + + size = stride * (type.getOuterArraySize() - 1) + size; + return alignment; + } + + if (type.getBasicType() == EbtStruct) { + const TTypeList& memberList = *type.getStruct(); + + size = 0; + int maxAlignment = 0; + for (size_t m = 0; m < memberList.size(); ++m) { + int memberSize; + // modify just the children's view of matrix layout, if there is one for this member + TLayoutMatrix subMatrixLayout = memberList[m].type->getQualifier().layoutMatrix; + int memberAlignment = getScalarAlignment(*memberList[m].type, memberSize, dummyStride, + (subMatrixLayout != ElmNone) ? (subMatrixLayout == ElmRowMajor) : rowMajor); + maxAlignment = std::max(maxAlignment, memberAlignment); + RoundToPow2(size, memberAlignment); + size += memberSize; + } + + return maxAlignment; + } + + if (type.isScalar()) + return getBaseAlignmentScalar(type, size); + + if (type.isVector()) { + int scalarAlign = getBaseAlignmentScalar(type, size); + + size *= type.getVectorSize(); + return scalarAlign; + } + + if (type.isMatrix()) { + TType derefType(type, 0, rowMajor); + + alignment = getScalarAlignment(derefType, size, dummyStride, rowMajor); + + stride = size; // use intra-matrix stride for stride of a just a matrix + if (rowMajor) + size = stride * type.getMatrixRows(); + else + size = stride * type.getMatrixCols(); + + return alignment; + } + + assert(0); // all cases should be covered above + size = 1; + return 1; +} + +int TIntermediate::getMemberAlignment(const TType& type, int& size, int& stride, TLayoutPacking layoutPacking, bool rowMajor) +{ + if (layoutPacking == glslang::ElpScalar) { + return getScalarAlignment(type, size, stride, rowMajor); + } else { + return getBaseAlignment(type, size, stride, layoutPacking, rowMajor); + } +} + } // end namespace glslang diff --git a/deps/glslang/glslang/MachineIndependent/localintermediate.h b/deps/glslang/glslang/MachineIndependent/localintermediate.h index 99f777f1..aecbc6bf 100644 --- a/deps/glslang/glslang/MachineIndependent/localintermediate.h +++ b/deps/glslang/glslang/MachineIndependent/localintermediate.h @@ -2,6 +2,8 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2016 LunarG, Inc. // Copyright (C) 2017 ARM Limited. +// Copyright (C) 2015-2018 Google, Inc. +// // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -147,11 +149,20 @@ struct TOffsetRange { // Things that need to be tracked per xfb buffer. struct TXfbBuffer { - TXfbBuffer() : stride(TQualifier::layoutXfbStrideEnd), implicitStride(0), containsDouble(false) { } +#ifdef AMD_EXTENSIONS + TXfbBuffer() : stride(TQualifier::layoutXfbStrideEnd), implicitStride(0), contains64BitType(false), + contains32BitType(false), contains16BitType(false) { } +#else + TXfbBuffer() : stride(TQualifier::layoutXfbStrideEnd), implicitStride(0), contains64BitType(false) { } +#endif std::vector ranges; // byte offsets that have already been assigned unsigned int stride; unsigned int implicitStride; - bool containsDouble; + bool contains64BitType; +#ifdef AMD_EXTENSIONS + bool contains32BitType; + bool contains16BitType; +#endif }; // Track a set of strings describing how the module was processed. @@ -253,6 +264,7 @@ class TIntermediate { textureSamplerTransformMode(EShTexSampTransKeep), needToLegalize(false), binaryDoubleOutput(false), + usePhysicalStorageBuffer(false), uniformLocationBase(0) { localSize[0] = 1; @@ -388,6 +400,11 @@ class TIntermediate { processes.addProcess("use-vulkan-memory-model"); } bool usingVulkanMemoryModel() const { return useVulkanMemoryModel; } + void setUsePhysicalStorageBuffer() + { + usePhysicalStorageBuffer = true; + } + bool usingPhysicalStorageBuffer() const { return usePhysicalStorageBuffer; } template T addCounterBufferName(const T& name) const { return name + implicitCounterName; } bool hasCounterBufferName(const TString& name) const { @@ -412,11 +429,40 @@ class TIntermediate { if (spvVersion.openGl > 0) processes.addProcess("client opengl100"); + // target SPV + switch (spvVersion.spv) { + case 0: + break; + case EShTargetSpv_1_0: + break; + case EShTargetSpv_1_1: + processes.addProcess("target-env spirv1.1"); + break; + case EShTargetSpv_1_2: + processes.addProcess("target-env spirv1.2"); + break; + case EShTargetSpv_1_3: + processes.addProcess("target-env spirv1.3"); + break; + default: + processes.addProcess("target-env spirvUnknown"); + break; + } + // target-environment processes - if (spvVersion.vulkan > 0) + switch (spvVersion.vulkan) { + case 0: + break; + case EShTargetVulkan_1_0: processes.addProcess("target-env vulkan1.0"); - else if (spvVersion.vulkan > 0) + break; + case EShTargetVulkan_1_1: + processes.addProcess("target-env vulkan1.1"); + break; + default: processes.addProcess("target-env vulkanUnknown"); + break; + } if (spvVersion.openGl > 0) processes.addProcess("target-env opengl"); } @@ -632,9 +678,15 @@ class TIntermediate { } unsigned getXfbStride(int buffer) const { return xfbBuffers[buffer].stride; } int addXfbBufferOffset(const TType&); - unsigned int computeTypeXfbSize(const TType&, bool& containsDouble) const; +#ifdef AMD_EXTENSIONS + unsigned int computeTypeXfbSize(const TType&, bool& contains64BitType, bool& contains32BitType, bool& contains16BitType) const; +#else + unsigned int computeTypeXfbSize(const TType&, bool& contains64BitType) const; +#endif static int getBaseAlignmentScalar(const TType&, int& size); - static int getBaseAlignment(const TType&, int& size, int& stride, bool std140, bool rowMajor); + static int getBaseAlignment(const TType&, int& size, int& stride, TLayoutPacking layoutPacking, bool rowMajor); + static int getScalarAlignment(const TType&, int& size, int& stride, bool rowMajor); + static int getMemberAlignment(const TType&, int& size, int& stride, TLayoutPacking layoutPacking, bool rowMajor); static bool improperStraddle(const TType& type, int size, int offset); bool promote(TIntermOperator*); @@ -662,8 +714,10 @@ class TIntermediate { void setSourceFile(const char* file) { if (file != nullptr) sourceFile = file; } const std::string& getSourceFile() const { return sourceFile; } - void addSourceText(const char* text) { sourceText = sourceText + text; } + void addSourceText(const char* text, size_t len) { sourceText.append(text, len); } const std::string& getSourceText() const { return sourceText; } + const std::map& getIncludeText() const { return includeText; } + void addIncludeText(const char* name, const char* text, size_t len) { includeText[name].assign(text,len); } void addProcesses(const std::vector& p) { for (int i = 0; i < (int)p.size(); ++i) @@ -730,7 +784,7 @@ class TIntermediate { bool specConstantPropagates(const TIntermTyped&, const TIntermTyped&); void performTextureUpgradeAndSamplerRemovalTransformation(TIntermNode* root); bool isConversionAllowed(TOperator op, TIntermTyped* node) const; - TIntermUnary* createConversion(TBasicType convertTo, TIntermTyped* node) const; + TIntermTyped* createConversion(TBasicType convertTo, TIntermTyped* node) const; std::tuple getConversionDestinatonType(TBasicType type0, TBasicType type1, TOperator op) const; bool extensionRequested(const char *extension) const {return requestedExtensions.find(extension) != requestedExtensions.end();} static const char* getResourceName(TResourceType); @@ -811,11 +865,15 @@ class TIntermediate { std::string sourceFile; std::string sourceText; + // Included text. First string is a name, second is the included text + std::map includeText; + // for OpModuleProcessed, or equivalent TProcesses processes; bool needToLegalize; bool binaryDoubleOutput; + bool usePhysicalStorageBuffer; std::unordered_map uniformLocationOverrides; int uniformLocationBase; diff --git a/deps/glslang/glslang/MachineIndependent/parseVersions.h b/deps/glslang/glslang/MachineIndependent/parseVersions.h index be468da5..b5e229ac 100644 --- a/deps/glslang/glslang/MachineIndependent/parseVersions.h +++ b/deps/glslang/glslang/MachineIndependent/parseVersions.h @@ -1,5 +1,5 @@ // -// Copyright (C) 2016 Google, Inc. +// Copyright (C) 2015-2018 Google, Inc. // Copyright (C) 2017 ARM Limited. // // All rights reserved. @@ -130,6 +130,7 @@ class TParseVersions { bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; } bool isReadingHLSL() const { return (messages & EShMsgReadHlsl) == EShMsgReadHlsl; } bool hlslEnable16BitTypes() const { return (messages & EShMsgHlslEnable16BitTypes) != 0; } + bool hlslDX9Compatible() const { return (messages & EShMsgHlslDX9Compatible) != 0; } TInfoSink& infoSink; diff --git a/deps/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp b/deps/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp index 2000b777..3441948c 100644 --- a/deps/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp +++ b/deps/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -652,6 +653,7 @@ int TPpContext::CPPinclude(TPpToken* ppToken) epilogue << (res->headerData[res->headerLength - 1] == '\n'? "" : "\n") << "#line " << directiveLoc.line + forNextLine << " " << directiveLoc.getStringNameOrNum() << "\n"; pushInput(new TokenizableIncludeFile(directiveLoc, prologue.str(), res, epilogue.str(), this)); + parseContext.intermediate.addIncludeText(res->headerName.c_str(), res->headerData, res->headerLength); // There's no "current" location anymore. parseContext.setCurrentColumn(0); } else { @@ -1121,7 +1123,8 @@ int TPpContext::tZeroInput::scan(TPpToken* ppToken) if (done) return EndOfInput; - strcpy(ppToken->name, "0"); + ppToken->name[0] = '0'; + ppToken->name[1] = 0; ppToken->ival = 0; ppToken->space = false; done = true; diff --git a/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp b/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp index c89b3768..cc003a8d 100644 --- a/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp +++ b/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.h b/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.h index 64681fc3..73fe5e3c 100644 --- a/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.h +++ b/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.h @@ -1,5 +1,6 @@ // // Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -533,7 +534,7 @@ class TPpContext { prologue_(prologue), epilogue_(epilogue), includedFile_(includedFile), - scanner(3, strings, lengths, names, 0, 0, true), + scanner(3, strings, lengths, nullptr, 0, 0, true), prevScanner(nullptr), stringInput(pp, scanner) { @@ -548,9 +549,9 @@ class TPpContext { scanner.setLine(startLoc.line); scanner.setString(startLoc.string); - scanner.setFile(startLoc.name, 0); - scanner.setFile(startLoc.name, 1); - scanner.setFile(startLoc.name, 2); + scanner.setFile(startLoc.getFilenameStr(), 0); + scanner.setFile(startLoc.getFilenameStr(), 1); + scanner.setFile(startLoc.getFilenameStr(), 2); } // tInput methods: @@ -590,8 +591,6 @@ class TPpContext { const char* strings[3]; // Length of str_, passed to scanner constructor. size_t lengths[3]; - // String names - const char* names[3]; // Scans over str_. TInputScanner scanner; // The previous effective scanner before the scanner in this instance diff --git a/deps/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp b/deps/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp index 1faa0180..8dd1036c 100644 --- a/deps/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp +++ b/deps/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp @@ -2,6 +2,8 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2013 LunarG, Inc. // Copyright (C) 2017 ARM Limited. +// Copyright (C) 2015-2018 Google, Inc. +// // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -446,16 +448,16 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) static const char* const Int64_Extensions[] = { E_GL_ARB_gpu_shader_int64, - E_GL_KHX_shader_explicit_arithmetic_types, - E_GL_KHX_shader_explicit_arithmetic_types_int64 }; + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_int64 }; static const int Num_Int64_Extensions = sizeof(Int64_Extensions) / sizeof(Int64_Extensions[0]); static const char* const Int16_Extensions[] = { #ifdef AMD_EXTENSIONS E_GL_AMD_gpu_shader_int16, #endif - E_GL_KHX_shader_explicit_arithmetic_types, - E_GL_KHX_shader_explicit_arithmetic_types_int16 }; + E_GL_EXT_shader_explicit_arithmetic_types, + E_GL_EXT_shader_explicit_arithmetic_types_int16 }; static const int Num_Int16_Extensions = sizeof(Int16_Extensions) / sizeof(Int16_Extensions[0]); ppToken->ival = 0; diff --git a/deps/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp b/deps/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp index f4f1bd04..f8029f51 100644 --- a/deps/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp +++ b/deps/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp @@ -1,6 +1,8 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. +// // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/deps/glslang/glslang/MachineIndependent/reflection.cpp b/deps/glslang/glslang/MachineIndependent/reflection.cpp index 5d59f289..b6966863 100644 --- a/deps/glslang/glslang/MachineIndependent/reflection.cpp +++ b/deps/glslang/glslang/MachineIndependent/reflection.cpp @@ -105,14 +105,29 @@ class TReflectionTraverser : public TLiveTraverser { const TString &name = base.getName(); const TType &type = base.getType(); - TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(name); + TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(name.c_str()); if (it == reflection.nameToIndex.end()) { - reflection.nameToIndex[name] = (int)reflection.indexToAttribute.size(); - reflection.indexToAttribute.push_back(TObjectReflection(name, type, 0, mapToGlType(type), 0, 0)); + reflection.nameToIndex[name.c_str()] = (int)reflection.indexToAttribute.size(); + reflection.indexToAttribute.push_back(TObjectReflection(name.c_str(), type, 0, mapToGlType(type), 0, 0)); } } } + // shared calculation by getOffset and getOffsets + void updateOffset(const TType& parentType, const TType& memberType, int& offset, int& memberSize) + { + int dummyStride; + + // modify just the children's view of matrix layout, if there is one for this member + TLayoutMatrix subMatrixLayout = memberType.getQualifier().layoutMatrix; + int memberAlignment = intermediate.getMemberAlignment(memberType, memberSize, dummyStride, + parentType.getQualifier().layoutPacking, + subMatrixLayout != ElmNone + ? subMatrixLayout == ElmRowMajor + : parentType.getQualifier().layoutMatrix == ElmRowMajor); + RoundToPow2(offset, memberAlignment); + } + // Lookup or calculate the offset of a block member, using the recursively // defined block offset rules. int getOffset(const TType& type, int index) @@ -125,18 +140,11 @@ class TReflectionTraverser : public TLiveTraverser { if (memberList[index].type->getQualifier().hasOffset()) return memberList[index].type->getQualifier().layoutOffset; - int memberSize; - int dummyStride; + int memberSize = 0; int offset = 0; for (int m = 0; m <= index; ++m) { - // modify just the children's view of matrix layout, if there is one for this member - TLayoutMatrix subMatrixLayout = memberList[m].type->getQualifier().layoutMatrix; - int memberAlignment = intermediate.getBaseAlignment(*memberList[m].type, memberSize, dummyStride, - type.getQualifier().layoutPacking == ElpStd140, - subMatrixLayout != ElmNone - ? subMatrixLayout == ElmRowMajor - : type.getQualifier().layoutMatrix == ElmRowMajor); - RoundToPow2(offset, memberAlignment); + updateOffset(type, *memberList[m].type, offset, memberSize); + if (m < index) offset += memberSize; } @@ -144,6 +152,50 @@ class TReflectionTraverser : public TLiveTraverser { return offset; } + // Lookup or calculate the offset of all block members at once, using the recursively + // defined block offset rules. + void getOffsets(const TType& type, TVector& offsets) + { + const TTypeList& memberList = *type.getStruct(); + + int memberSize = 0; + int offset = 0; + for (size_t m = 0; m < offsets.size(); ++m) { + // if the user supplied an offset, snap to it now + if (memberList[m].type->getQualifier().hasOffset()) + offset = memberList[m].type->getQualifier().layoutOffset; + + // calculate the offset of the next member and align the current offset to this member + updateOffset(type, *memberList[m].type, offset, memberSize); + + // save the offset of this member + offsets[m] = offset; + + // update for the next member + offset += memberSize; + } + } + + // Calculate the stride of an array type + int getArrayStride(const TType& baseType, const TType& type) + { + int dummySize; + int stride; + + // consider blocks to have 0 stride, so that all offsets are relative to the start of their block + if (type.getBasicType() == EbtBlock) + return 0; + + TLayoutMatrix subMatrixLayout = type.getQualifier().layoutMatrix; + intermediate.getMemberAlignment(type, dummySize, stride, + baseType.getQualifier().layoutPacking, + subMatrixLayout != ElmNone + ? subMatrixLayout == ElmRowMajor + : baseType.getQualifier().layoutMatrix == ElmRowMajor); + + return stride; + } + // Calculate the block data size. // Block arrayness is not taken into account, each element is backed by a separate buffer. int getBlockSize(const TType& blockType) @@ -154,9 +206,9 @@ class TReflectionTraverser : public TLiveTraverser { int lastMemberSize; int dummyStride; - intermediate.getBaseAlignment(*memberList[lastIndex].type, lastMemberSize, dummyStride, - blockType.getQualifier().layoutPacking == ElpStd140, - blockType.getQualifier().layoutMatrix == ElmRowMajor); + intermediate.getMemberAlignment(*memberList[lastIndex].type, lastMemberSize, dummyStride, + blockType.getQualifier().layoutPacking, + blockType.getQualifier().layoutMatrix == ElmRowMajor); return lastOffset + lastMemberSize; } @@ -179,7 +231,9 @@ class TReflectionTraverser : public TLiveTraverser { terminalType = &visitNode->getType(); int index; switch (visitNode->getOp()) { - case EOpIndexIndirect: + case EOpIndexIndirect: { + int stride = getArrayStride(baseType, visitNode->getLeft()->getType()); + // Visit all the indices of this array, and for each one add on the remaining dereferencing for (int i = 0; i < std::max(visitNode->getLeft()->getType().getOuterArraySize(), 1); ++i) { TString newBaseName = name; @@ -189,14 +243,22 @@ class TReflectionTraverser : public TLiveTraverser { ++nextDeref; TType derefType(*terminalType, 0); blowUpActiveAggregate(derefType, newBaseName, derefs, nextDeref, offset, blockIndex, arraySize); + + if (offset >= 0) + offset += stride; } // it was all completed in the recursive calls above return; + } case EOpIndexDirect: index = visitNode->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst(); - if (baseType.getBasicType() != EbtBlock) + if (baseType.getBasicType() != EbtBlock) { name.append(TString("[") + String(index) + "]"); + + if (offset >= 0) + offset += getArrayStride(baseType, visitNode->getLeft()->getType()) * index; + } break; case EOpIndexDirectStruct: index = visitNode->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst(); @@ -213,23 +275,43 @@ class TReflectionTraverser : public TLiveTraverser { // if the terminalType is still too coarse a granularity, this is still an aggregate to expand, expand it... if (! isReflectionGranularity(*terminalType)) { + // the base offset of this node, that children are relative to + int baseOffset = offset; + if (terminalType->isArray()) { // Visit all the indices of this array, and for each one, // fully explode the remaining aggregate to dereference + + int stride = 0; + if (offset >= 0) + stride = getArrayStride(baseType, *terminalType); + for (int i = 0; i < std::max(terminalType->getOuterArraySize(), 1); ++i) { TString newBaseName = name; newBaseName.append(TString("[") + String(i) + "]"); TType derefType(*terminalType, 0); + if (offset >= 0) + offset = baseOffset + stride * i; blowUpActiveAggregate(derefType, newBaseName, derefs, derefs.end(), offset, blockIndex, 0); } } else { // Visit all members of this aggregate, and for each one, // fully explode the remaining aggregate to dereference const TTypeList& typeList = *terminalType->getStruct(); + + TVector memberOffsets; + + if (baseOffset >= 0) { + memberOffsets.resize(typeList.size()); + getOffsets(*terminalType, memberOffsets); + } + for (int i = 0; i < (int)typeList.size(); ++i) { TString newBaseName = name; newBaseName.append(TString(".") + typeList[i].type->getFieldName()); TType derefType(*terminalType, i); + if (offset >= 0) + offset = baseOffset + memberOffsets[i]; blowUpActiveAggregate(derefType, newBaseName, derefs, derefs.end(), offset, blockIndex, 0); } } @@ -245,10 +327,10 @@ class TReflectionTraverser : public TLiveTraverser { if (arraySize == 0) arraySize = mapToGlArraySize(*terminalType); - TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(name); + TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(name.c_str()); if (it == reflection.nameToIndex.end()) { - reflection.nameToIndex[name] = (int)reflection.indexToUniform.size(); - reflection.indexToUniform.push_back(TObjectReflection(name, *terminalType, offset, + reflection.nameToIndex[name.c_str()] = (int)reflection.indexToUniform.size(); + reflection.indexToUniform.push_back(TObjectReflection(name.c_str(), *terminalType, offset, mapToGlType(*terminalType), arraySize, blockIndex)); } else if (arraySize > 1) { @@ -348,11 +430,11 @@ class TReflectionTraverser : public TLiveTraverser { int addBlockName(const TString& name, const TType& type, int size) { int blockIndex; - TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(name); - if (reflection.nameToIndex.find(name) == reflection.nameToIndex.end()) { + TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(name.c_str()); + if (reflection.nameToIndex.find(name.c_str()) == reflection.nameToIndex.end()) { blockIndex = (int)reflection.indexToUniformBlock.size(); - reflection.nameToIndex[name] = blockIndex; - reflection.indexToUniformBlock.push_back(TObjectReflection(name, type, -1, -1, size, -1)); + reflection.nameToIndex[name.c_str()] = blockIndex; + reflection.indexToUniformBlock.push_back(TObjectReflection(name.c_str(), type, -1, -1, size, -1)); } else blockIndex = it->second; @@ -770,7 +852,7 @@ void TReflection::buildCounterIndices(const TIntermediate& intermediate) { // search for ones that have counters for (int i = 0; i < int(indexToUniformBlock.size()); ++i) { - const TString counterName(intermediate.addCounterBufferName(indexToUniformBlock[i].name)); + const TString counterName(intermediate.addCounterBufferName(indexToUniformBlock[i].name).c_str()); const int index = getIndex(counterName); if (index >= 0) diff --git a/deps/glslang/glslang/MachineIndependent/reflection.h b/deps/glslang/glslang/MachineIndependent/reflection.h index 49282c30..dab9ab08 100644 --- a/deps/glslang/glslang/MachineIndependent/reflection.h +++ b/deps/glslang/glslang/MachineIndependent/reflection.h @@ -55,7 +55,7 @@ class TReflectionTraverser; // Data needed for just a single object at the granularity exchanged by the reflection API class TObjectReflection { public: - TObjectReflection(const TString& pName, const TType& pType, int pOffset, int pGLDefineType, int pSize, int pIndex) : + TObjectReflection(const std::string& pName, const TType& pType, int pOffset, int pGLDefineType, int pSize, int pIndex) : name(pName), offset(pOffset), glDefineType(pGLDefineType), size(pSize), index(pIndex), counterIndex(-1), stages(EShLanguageMask(0)), type(pType.clone()) { } @@ -78,7 +78,7 @@ class TObjectReflection { } static TObjectReflection badReflection() { return TObjectReflection(); } - TString name; + std::string name; int offset; int glDefineType; int size; // data size in bytes for a block, array size for a (non-block) object that's an array @@ -87,7 +87,8 @@ class TObjectReflection { EShLanguageMask stages; protected: - TObjectReflection() : offset(-1), glDefineType(-1), size(-1), index(-1), type(nullptr) { } + TObjectReflection() : + offset(-1), glDefineType(-1), size(-1), index(-1), counterIndex(-1), stages(EShLanguageMask(0)), type(nullptr) { } const TType* type; }; @@ -162,7 +163,7 @@ class TReflection { void buildAttributeReflection(EShLanguage, const TIntermediate&); // Need a TString hash: typedef std::unordered_map TNameToIndex; - typedef std::map TNameToIndex; + typedef std::map TNameToIndex; typedef std::vector TMapIndexToReflection; TObjectReflection badReflection; // return for queries of -1 or generally out of range; has expected descriptions with in it for this diff --git a/deps/glslang/glslang/OSDependent/Unix/CMakeLists.txt b/deps/glslang/glslang/OSDependent/Unix/CMakeLists.txt index 1bf49e12..e652f456 100644 --- a/deps/glslang/glslang/OSDependent/Unix/CMakeLists.txt +++ b/deps/glslang/glslang/OSDependent/Unix/CMakeLists.txt @@ -2,6 +2,23 @@ add_library(OSDependent STATIC ossource.cpp ../osinclude.h) set_property(TARGET OSDependent PROPERTY FOLDER glslang) set_property(TARGET OSDependent PROPERTY POSITION_INDEPENDENT_CODE ON) +# Link pthread +set(CMAKE_THREAD_PREFER_PTHREAD ON) +if(${CMAKE_VERSION} VERSION_LESS "3.1.0" OR CMAKE_CROSSCOMPILING) + # Needed as long as we support CMake 2.8 for Ubuntu 14.04, + # which does not support the recommended Threads::Threads target. + # https://cmake.org/cmake/help/v2.8.12/cmake.html#module:FindThreads + # Also needed when cross-compiling to work around + # https://gitlab.kitware.com/cmake/cmake/issues/16920 + find_package(Threads) + target_link_libraries(OSDependent ${CMAKE_THREAD_LIBS_INIT}) +else() + # This is the recommended way, so we use it for 3.1+. + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads) + target_link_libraries(OSDependent Threads::Threads) +endif() + if(ENABLE_GLSLANG_INSTALL) install(TARGETS OSDependent ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/deps/glslang/glslang/OSDependent/Unix/ossource.cpp b/deps/glslang/glslang/OSDependent/Unix/ossource.cpp index f59bbceb..3f029f02 100644 --- a/deps/glslang/glslang/OSDependent/Unix/ossource.cpp +++ b/deps/glslang/glslang/OSDependent/Unix/ossource.cpp @@ -45,7 +45,10 @@ #include #include #include + +#if !defined(__Fuchsia__) #include +#endif namespace glslang { @@ -70,7 +73,7 @@ static void DetachThreadLinux(void *) // void OS_CleanupThreadData(void) { -#ifdef __ANDROID__ +#if defined(__ANDROID__) || defined(__Fuchsia__) DetachThreadLinux(NULL); #else int old_cancel_state, old_cancel_type; diff --git a/deps/glslang/glslang/Public/ShaderLang.h b/deps/glslang/glslang/Public/ShaderLang.h index 07088293..26bf8bf0 100644 --- a/deps/glslang/glslang/Public/ShaderLang.h +++ b/deps/glslang/glslang/Public/ShaderLang.h @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2013-2016 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. // // All rights reserved. // @@ -52,9 +53,6 @@ #define SH_IMPORT_EXPORT #else #define SH_IMPORT_EXPORT -#ifndef __fastcall -#define __fastcall -#endif #define C_DECL #endif @@ -70,7 +68,7 @@ // This should always increase, as some paths to do not consume // a more major number. // It should increment by one when new functionality is added. -#define GLSLANG_MINOR_VERSION 10 +#define GLSLANG_MINOR_VERSION 11 // // Call before doing any other compiler/linker operations. @@ -82,7 +80,7 @@ SH_IMPORT_EXPORT int ShInitialize(); // // Call this at process shutdown to clean up memory. // -SH_IMPORT_EXPORT int __fastcall ShFinalize(); +SH_IMPORT_EXPORT int ShFinalize(); // // Types of languages the compiler can consume. @@ -235,6 +233,7 @@ enum EShMessages { EShMsgDebugInfo = (1 << 10), // save debug information EShMsgHlslEnable16BitTypes = (1 << 11), // enable use of 16-bit types in SPIR-V for HLSL EShMsgHlslLegalization = (1 << 12), // enable HLSL Legalization messages + EShMsgHlslDX9Compatible = (1 << 13), // enable HLSL DX9 compatible mode (right now only for samplers) }; // diff --git a/deps/glslang/gtests/AST.FromFile.cpp b/deps/glslang/gtests/AST.FromFile.cpp index b89fc515..87552462 100644 --- a/deps/glslang/gtests/AST.FromFile.cpp +++ b/deps/glslang/gtests/AST.FromFile.cpp @@ -113,6 +113,7 @@ INSTANTIATE_TEST_CASE_P( "300operations.frag", "300block.frag", "300samplerExternal.frag", + "300samplerExternalYUV.frag", "310.comp", "310.vert", "310.geom", @@ -231,6 +232,7 @@ INSTANTIATE_TEST_CASE_P( "precise_struct_block.vert", "maxClipDistances.vert", "findFunction.frag", + "constantUnaryConversion.comp" })), FileNameAsCustomTestSuffix ); diff --git a/deps/glslang/gtests/Config.FromFile.cpp b/deps/glslang/gtests/Config.FromFile.cpp index f3a27724..d6fbf205 100644 --- a/deps/glslang/gtests/Config.FromFile.cpp +++ b/deps/glslang/gtests/Config.FromFile.cpp @@ -51,6 +51,7 @@ TEST_P(ConfigTest, FromFile) { TestCaseSpec testCase = GetParam(); GlslangResult result; + result.validationResult = true; // Get the contents for input shader and limit configurations. std::string shaderContents, configContents; @@ -99,7 +100,7 @@ INSTANTIATE_TEST_CASE_P( ::testing::ValuesIn(std::vector({ {"specExamples.vert", "baseResults/test.conf", "specExamplesConf.vert.out", (EShMessages)(EShMsgAST | EShMsgCascadingErrors)}, {"100Limits.vert", "100.conf", "100LimitsConf.vert.out", EShMsgCascadingErrors}, - })), + })) ); // clang-format on diff --git a/deps/glslang/gtests/HexFloat.cpp b/deps/glslang/gtests/HexFloat.cpp index ddbee1f4..ead4fd39 100644 --- a/deps/glslang/gtests/HexFloat.cpp +++ b/deps/glslang/gtests/HexFloat.cpp @@ -127,7 +127,7 @@ INSTANTIATE_TEST_CASE_P( {float(ldexp(1.0, -127) / 2.0 + (ldexp(1.0, -127) / 4.0f)), "0x1.8p-128"}, - })),); + }))); INSTANTIATE_TEST_CASE_P( Float32NanTests, HexFloatTest, @@ -145,7 +145,7 @@ INSTANTIATE_TEST_CASE_P( {uint32_t(0x7f800c00), "0x1.0018p+128"}, // +nan {uint32_t(0x7F80F000), "0x1.01ep+128"}, // +nan {uint32_t(0x7FFFFFFF), "0x1.fffffep+128"}, // +nan - })),); + }))); INSTANTIATE_TEST_CASE_P( Float64Tests, HexDoubleTest, @@ -218,7 +218,7 @@ INSTANTIATE_TEST_CASE_P( {ldexp(1.0, -1023) / 2.0 + (ldexp(1.0, -1023) / 4.0), "0x1.8p-1024"}, - })),); + }))); INSTANTIATE_TEST_CASE_P( Float64NanTests, HexDoubleTest, @@ -237,7 +237,7 @@ INSTANTIATE_TEST_CASE_P( {uint64_t(0x7FF0000000000001LL), "0x1.0000000000001p+1024"}, // -nan {uint64_t(0x7FF0000300000000LL), "0x1.00003p+1024"}, // -nan {uint64_t(0x7FFFFFFFFFFFFFFFLL), "0x1.fffffffffffffp+1024"}, // -nan - })),); + }))); TEST(HexFloatStreamTest, OperatorLeftShiftPreservesFloatAndFill) { std::stringstream s; @@ -282,7 +282,7 @@ INSTANTIATE_TEST_CASE_P( {"0xFFp+0", 255.f}, {"0x0.8p+0", 0.5f}, {"0x0.4p+0", 0.25f}, - })),); + }))); INSTANTIATE_TEST_CASE_P( Float32DecodeInfTests, DecodeHexFloatTest, @@ -292,7 +292,7 @@ INSTANTIATE_TEST_CASE_P( {"0x32p+127", uint32_t(0x7F800000)}, // inf {"0x32p+500", uint32_t(0x7F800000)}, // inf {"-0x32p+127", uint32_t(0xFF800000)}, // -inf - })),); + }))); INSTANTIATE_TEST_CASE_P( Float64DecodeTests, DecodeHexDoubleTest, @@ -315,7 +315,7 @@ INSTANTIATE_TEST_CASE_P( {"0xFFp+0", 255.}, {"0x0.8p+0", 0.5}, {"0x0.4p+0", 0.25}, - })),); + }))); INSTANTIATE_TEST_CASE_P( Float64DecodeInfTests, DecodeHexDoubleTest, @@ -326,7 +326,7 @@ INSTANTIATE_TEST_CASE_P( {"0x32p+1023", uint64_t(0x7FF0000000000000)}, // inf {"0x32p+5000", uint64_t(0x7FF0000000000000)}, // inf {"-0x32p+1023", uint64_t(0xFFF0000000000000)}, // -inf - })),); + }))); TEST(FloatProxy, ValidConversion) { EXPECT_THAT(FloatProxy(1.f).getAsFloat(), Eq(1.0f)); @@ -495,7 +495,7 @@ INSTANTIATE_TEST_CASE_P( {std::numeric_limits::infinity(), "0x1p+128"}, {-std::numeric_limits::infinity(), "-0x1p+128"}, - })),); + }))); INSTANTIATE_TEST_CASE_P( Float64Tests, FloatProxyDoubleTest, @@ -532,7 +532,7 @@ INSTANTIATE_TEST_CASE_P( {std::numeric_limits::infinity(), "0x1p+1024"}, {-std::numeric_limits::infinity(), "-0x1p+1024"}, - })),); + }))); // double is used so that unbiased_exponent can be used with the output // of ldexp directly. @@ -793,7 +793,7 @@ INSTANTIATE_TEST_CASE_P(F32ToF16, HexFloatRoundTest, {static_cast(ldexp(float_fractions({0, 1, 11, 13}), -129)), std::make_pair(half_bits_set({0, 9}), false), spvutils::kRoundToPositiveInfinity}, {static_cast(ldexp(float_fractions({0, 1, 11, 13}), -131)), std::make_pair(half_bits_set({0}), false), spvutils::kRoundToNegativeInfinity}, {static_cast(ldexp(float_fractions({0, 1, 11, 13}), -130)), std::make_pair(half_bits_set({0, 9}), false), spvutils::kRoundToNearestEven}, - })),); + }))); // clang-format on struct UpCastSignificandCase { @@ -837,7 +837,7 @@ INSTANTIATE_TEST_CASE_P(F16toF32, HexFloatRoundUpSignificandTest, {0x0F00, 0x600000}, {0x0F01, 0x602000}, {0x0FFF, 0x7FE000}, - })),); + }))); struct DownCastTest { float source_float; @@ -914,7 +914,7 @@ INSTANTIATE_TEST_CASE_P(F32ToF16, HexFloatFP32To16Tests, {-std::numeric_limits::infinity(), negative_infinity, {spvutils::kRoundToZero, spvutils::kRoundToPositiveInfinity, spvutils::kRoundToNegativeInfinity, spvutils::kRoundToNearestEven}}, // Nans are below because we cannot test for equality. - })),); + }))); struct UpCastCase{ uint16_t source_half; @@ -965,7 +965,7 @@ INSTANTIATE_TEST_CASE_P(F16ToF32, HexFloatFP16To32Tests, // inf {0x7C00, std::numeric_limits::infinity()}, {0xFC00, -std::numeric_limits::infinity()}, - })),); + }))); TEST(HexFloatOperationTests, NanTests) { using HF = spvutils::HexFloat>; @@ -1071,7 +1071,7 @@ INSTANTIATE_TEST_CASE_P( // We can't have -1e40 and negate_value == true since // that represents an original case of "--1e40" which // is invalid. - }),); + })); using ParseNormalFloat16Test = ::testing::TestWithParam>; @@ -1114,7 +1114,7 @@ INSTANTIATE_TEST_CASE_P( BadFloatParseCase("-2.0", true, uint16_t{0}), BadFloatParseCase("+0.0", true, uint16_t{0}), BadFloatParseCase("+2.0", true, uint16_t{0}), - }),); + })); // A test case for detecting infinities. template @@ -1149,7 +1149,7 @@ INSTANTIATE_TEST_CASE_P( {"-1e40", false, -FLT_MAX}, {"1e400", false, FLT_MAX}, {"-1e400", false, -FLT_MAX}, - })),); + }))); using FloatProxyParseOverflowDoubleTest = ::testing::TestWithParam>; @@ -1176,7 +1176,7 @@ INSTANTIATE_TEST_CASE_P( {"-1e40", true, -1e40}, {"1e400", false, DBL_MAX}, {"-1e400", false, -DBL_MAX}, - })),); + }))); using FloatProxyParseOverflowFloat16Test = ::testing::TestWithParam>; @@ -1207,7 +1207,7 @@ INSTANTIATE_TEST_CASE_P( {"-1e38", false, uint16_t{0xfbff}}, {"-1e40", false, uint16_t{0xfbff}}, {"-1e400", false, uint16_t{0xfbff}}, - })),); + }))); TEST(FloatProxy, Max) { EXPECT_THAT(FloatProxy::max().getAsFloat().get_value(), diff --git a/deps/glslang/gtests/Hlsl.FromFile.cpp b/deps/glslang/gtests/Hlsl.FromFile.cpp index a490ba0a..78e92cb1 100644 --- a/deps/glslang/gtests/Hlsl.FromFile.cpp +++ b/deps/glslang/gtests/Hlsl.FromFile.cpp @@ -61,6 +61,9 @@ using HlslCompileTest = GlslangTest<::testing::TestWithParam>; using HlslCompileAndFlattenTest = GlslangTest<::testing::TestWithParam>; using HlslLegalizeTest = GlslangTest<::testing::TestWithParam>; +using HlslDebugTest = GlslangTest<::testing::TestWithParam>; +using HlslDX9CompatibleTest = GlslangTest<::testing::TestWithParam>; +using HlslLegalDebugTest = GlslangTest<::testing::TestWithParam>; // Compiling HLSL to pre-legalized SPIR-V under Vulkan semantics. Expected // to successfully generate both AST and SPIR-V. @@ -95,6 +98,35 @@ TEST_P(HlslLegalizeTest, FromFile) "/baseLegalResults/", true); } +// Compiling HLSL to pre-legalized SPIR-V. Expected to successfully generate +// SPIR-V with debug instructions, particularly line info. +TEST_P(HlslDebugTest, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName, + Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, + Target::Spv, true, GetParam().entryPoint, + "/baseResults/", false, true); +} + +TEST_P(HlslDX9CompatibleTest, FromFile) +{ + loadFileCompileAndCheckWithOptions(GlobalTestSettings.testRoot, GetParam().fileName, Source::HLSL, + Semantics::Vulkan, glslang::EShTargetVulkan_1_0, Target::BothASTAndSpv, true, + GetParam().entryPoint, "/baseResults/", + EShMessages::EShMsgHlslDX9Compatible); +} + +// Compiling HLSL to legalized SPIR-V with debug instructions. Expected to +// successfully generate SPIR-V with debug instructions preserved through +// legalization, particularly line info. +TEST_P(HlslLegalDebugTest, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName, + Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, + Target::Spv, true, GetParam().entryPoint, + "/baseResults/", true, true); +} + // clang-format off INSTANTIATE_TEST_CASE_P( ToSpirv, HlslCompileTest, @@ -153,6 +185,7 @@ INSTANTIATE_TEST_CASE_P( {"hlsl.depthLess.frag", "PixelShaderFunction"}, {"hlsl.discard.frag", "PixelShaderFunction"}, {"hlsl.doLoop.frag", "PixelShaderFunction"}, + {"hlsl.earlydepthstencil.frag", "main"}, {"hlsl.emptystructreturn.frag", "main"}, {"hlsl.emptystructreturn.vert", "main"}, {"hlsl.emptystruct.init.vert", "main"}, @@ -400,7 +433,8 @@ INSTANTIATE_TEST_CASE_P( {"hlsl.wavequery.frag", "PixelShaderFunction"}, {"hlsl.wavereduction.comp", "CSMain"}, {"hlsl.wavevote.comp", "CSMain"}, - { "hlsl.type.type.conversion.valid.frag", "main" } + { "hlsl.type.type.conversion.valid.frag", "main" }, + {"hlsl.int.dot.frag", "main"} }), FileNameAsCustomTestSuffix ); @@ -436,5 +470,34 @@ INSTANTIATE_TEST_CASE_P( // clang-format on #endif +// clang-format off +INSTANTIATE_TEST_CASE_P( + ToSpirv, HlslDebugTest, + ::testing::ValuesIn(std::vector{ + {"hlsl.pp.line2.frag", "MainPs"} + }), + FileNameAsCustomTestSuffix +); + +INSTANTIATE_TEST_CASE_P( + ToSpirv, HlslDX9CompatibleTest, + ::testing::ValuesIn(std::vector{ + {"hlsl.sample.dx9.frag", "main"}, + {"hlsl.sample.dx9.vert", "main"}, + }), + FileNameAsCustomTestSuffix +); + +// clang-format off +INSTANTIATE_TEST_CASE_P( + ToSpirv, HlslLegalDebugTest, + ::testing::ValuesIn(std::vector{ + {"hlsl.pp.line4.frag", "MainPs"} + }), + FileNameAsCustomTestSuffix +); + +// clang-format on + } // anonymous namespace } // namespace glslangtest diff --git a/deps/glslang/gtests/Link.FromFile.Vk.cpp b/deps/glslang/gtests/Link.FromFile.Vk.cpp index 22892f0b..fe96bd9a 100644 --- a/deps/glslang/gtests/Link.FromFile.Vk.cpp +++ b/deps/glslang/gtests/Link.FromFile.Vk.cpp @@ -77,17 +77,16 @@ TEST_P(LinkTestVulkan, FromFile) if (success && (controls & EShMsgSpvRules)) { spv::SpvBuildLogger logger; std::vector spirv_binary; - glslang::SpvOptions options; - options.disableOptimizer = true; - options.validate = true; + options().disableOptimizer = true; glslang::GlslangToSpv(*program.getIntermediate(shaders.front()->getStage()), - spirv_binary, &logger, &options); + spirv_binary, &logger, &options()); std::ostringstream disassembly_stream; spv::Parameterize(); spv::Disassemble(disassembly_stream, spirv_binary); result.spirvWarningsErrors = logger.getAllMessages(); result.spirv = disassembly_stream.str(); + result.validationResult = !options().validate || logger.getAllMessages().empty(); } std::ostringstream stream; @@ -99,7 +98,8 @@ TEST_P(LinkTestVulkan, FromFile) std::string expectedOutput; tryLoadFile(expectedOutputFname, "expected output", &expectedOutput); - checkEqAndUpdateIfRequested(expectedOutput, stream.str(), expectedOutputFname); + checkEqAndUpdateIfRequested(expectedOutput, stream.str(), expectedOutputFname, + result.spirvWarningsErrors); } // clang-format off @@ -108,7 +108,7 @@ INSTANTIATE_TEST_CASE_P( ::testing::ValuesIn(std::vector>({ {"link1.vk.frag", "link2.vk.frag"}, {"spv.unit1.frag", "spv.unit2.frag", "spv.unit3.frag"}, - })), + })) ); // clang-format on diff --git a/deps/glslang/gtests/Link.FromFile.cpp b/deps/glslang/gtests/Link.FromFile.cpp index ab845bf5..abc33a91 100644 --- a/deps/glslang/gtests/Link.FromFile.cpp +++ b/deps/glslang/gtests/Link.FromFile.cpp @@ -50,6 +50,7 @@ TEST_P(LinkTest, FromFile) const size_t fileCount = fileNames.size(); const EShMessages controls = DeriveOptions(Source::GLSL, Semantics::OpenGL, Target::AST); GlslangResult result; + result.validationResult = true; // Compile each input shader file. std::vector> shaders; @@ -100,7 +101,7 @@ INSTANTIATE_TEST_CASE_P( {"max_vertices_0.geom"}, {"es-link1.frag", "es-link2.frag"}, {"missingBodies.vert"} - })), + })) ); // clang-format on diff --git a/deps/glslang/gtests/Spv.FromFile.cpp b/deps/glslang/gtests/Spv.FromFile.cpp index bc05eede..1a144072 100644 --- a/deps/glslang/gtests/Spv.FromFile.cpp +++ b/deps/glslang/gtests/Spv.FromFile.cpp @@ -63,6 +63,7 @@ std::string FileNameAsCustomTestSuffixIoMap( } using CompileVulkanToSpirvTest = GlslangTest<::testing::TestWithParam>; +using CompileVulkanToDebugSpirvTest = GlslangTest<::testing::TestWithParam>; using CompileVulkan1_1ToSpirvTest = GlslangTest<::testing::TestWithParam>; using CompileOpenGLToSpirvTest = GlslangTest<::testing::TestWithParam>; using VulkanSemantics = GlslangTest<::testing::TestWithParam>; @@ -87,6 +88,17 @@ TEST_P(CompileVulkanToSpirvTest, FromFile) Target::Spv); } +// Compiling GLSL to SPIR-V with debug info under Vulkan semantics. Expected +// to successfully generate SPIR-V. +TEST_P(CompileVulkanToDebugSpirvTest, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), + Source::GLSL, Semantics::Vulkan, + glslang::EShTargetVulkan_1_0, + Target::Spv, true, "", + "/baseResults/", false, true); +} + TEST_P(CompileVulkan1_1ToSpirvTest, FromFile) { loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), @@ -253,6 +265,22 @@ INSTANTIATE_TEST_CASE_P( "spv.bool.vert", "spv.boolInBlock.frag", "spv.branch-return.vert", + "spv.bufferhandle1.frag", + "spv.bufferhandle10.frag", + "spv.bufferhandle11.frag", + "spv.bufferhandle12.frag", + "spv.bufferhandle13.frag", + "spv.bufferhandle14.frag", + "spv.bufferhandle15.frag", + "spv.bufferhandle2.frag", + "spv.bufferhandle3.frag", + "spv.bufferhandle4.frag", + "spv.bufferhandle5.frag", + "spv.bufferhandle6.frag", + "spv.bufferhandle7.frag", + "spv.bufferhandle8.frag", + "spv.bufferhandle9.frag", + "spv.bufferhandle_Error.frag", "spv.builtInXFB.vert", "spv.conditionalDiscard.frag", "spv.constStruct.vert", @@ -271,6 +299,10 @@ INSTANTIATE_TEST_CASE_P( "spv.flowControl.frag", "spv.forLoop.frag", "spv.forwardFun.frag", + "spv.fragmentDensity.frag", + "spv.fragmentDensity.vert", + "spv.fragmentDensity-es.frag", + "spv.fragmentDensity-neg.frag", "spv.fullyCovered.frag", "spv.functionCall.frag", "spv.functionNestedOpaque.vert", @@ -288,8 +320,6 @@ INSTANTIATE_TEST_CASE_P( "spv.matrix.frag", "spv.matrix2.frag", "spv.memoryQualifier.frag", - "spv.memoryScopeSemantics.comp", - "spv.memoryScopeSemantics_Error.comp", "spv.merge-unreachable.frag", "spv.multiStruct.comp", "spv.multiStructFuncall.frag", @@ -309,6 +339,8 @@ INSTANTIATE_TEST_CASE_P( "spv.sampleId.frag", "spv.samplePosition.frag", "spv.sampleMaskOverrideCoverage.frag", + "spv.scalarlayout.frag", + "spv.scalarlayoutfloat16.frag", "spv.shaderBallot.comp", "spv.shaderDrawParams.vert", "spv.shaderGroupVote.comp", @@ -363,6 +395,15 @@ INSTANTIATE_TEST_CASE_P( FileNameAsCustomTestSuffix ); +// clang-format off +INSTANTIATE_TEST_CASE_P( + Glsl, CompileVulkanToDebugSpirvTest, + ::testing::ValuesIn(std::vector({ + "spv.pp.line.frag", + })), + FileNameAsCustomTestSuffix +); + // clang-format off INSTANTIATE_TEST_CASE_P( Glsl, CompileVulkan1_1ToSpirvTest, @@ -377,7 +418,10 @@ INSTANTIATE_TEST_CASE_P( "spv.explicittypes.frag", "spv.float32.frag", "spv.float64.frag", + "spv.memoryScopeSemantics.comp", + "spv.memoryScopeSemantics_Error.comp", "spv.multiView.frag", + "spv.RayGenShader11.rgen", "spv.subgroup.frag", "spv.subgroup.geom", "spv.subgroup.tesc", @@ -386,6 +430,7 @@ INSTANTIATE_TEST_CASE_P( "spv.subgroupArithmetic.comp", "spv.subgroupBasic.comp", "spv.subgroupBallot.comp", + "spv.subgroupBallotNeg.comp", "spv.subgroupClustered.comp", "spv.subgroupClusteredNeg.comp", "spv.subgroupPartitioned.comp", @@ -440,7 +485,10 @@ INSTANTIATE_TEST_CASE_P( "spv.rankShift.comp", "spv.specConst.vert", "spv.OVR_multiview.vert", + "spv.xfbOffsetOnBlockMembersAssignment.vert", "spv.xfbOffsetOnStructMembersAssignment.vert", + "spv.xfbOverlapOffsetCheckWithBlockAndMember.vert", + "spv.xfbStrideJustOnce.vert", })), FileNameAsCustomTestSuffix ); @@ -480,6 +528,7 @@ INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_CASE_P( Glsl, CompileVulkanToSpirvTestAMD, ::testing::ValuesIn(std::vector({ + "spv.16bitxfb.vert", "spv.float16.frag", "spv.float16Fetch.frag", "spv.imageLoadStoreLod.frag", diff --git a/deps/glslang/gtests/TestFixture.h b/deps/glslang/gtests/TestFixture.h index 3329fa3c..6bca38e4 100644 --- a/deps/glslang/gtests/TestFixture.h +++ b/deps/glslang/gtests/TestFixture.h @@ -111,7 +111,10 @@ class GlslangTest : public GT { : defaultVersion(100), defaultProfile(ENoProfile), forceVersionProfile(false), - isForwardCompatible(false) {} + isForwardCompatible(false) { + // Perform validation by default. + validatorOptions.validate = true; + } // Tries to load the contents from the file at the given |path|. On success, // writes the contents into |contents|. On failure, errors out. @@ -137,15 +140,18 @@ class GlslangTest : public GT { // write |real| to the given file named as |fname| if update mode is on. void checkEqAndUpdateIfRequested(const std::string& expected, const std::string& real, - const std::string& fname) + const std::string& fname, + const std::string& errorsAndWarnings = "") { // In order to output the message we want under proper circumstances, // we need the following operator<< stuff. EXPECT_EQ(expected, real) << (GlobalTestSettings.updateMode ? ("Mismatch found and update mode turned on - " - "flushing expected result output.") - : ""); + "flushing expected result output.\n") + : "") + << "The following warnings/errors occurred:\n" + << errorsAndWarnings; // Update the expected output file if requested. // It looks weird to duplicate the comparison between expected_output @@ -168,6 +174,7 @@ class GlslangTest : public GT { std::vector shaderResults; std::string linkingOutput; std::string linkingError; + bool validationResult; std::string spirvWarningsErrors; std::string spirv; // Optional SPIR-V disassembly text. }; @@ -177,12 +184,19 @@ class GlslangTest : public GT { // and modifies |shader| on success. bool compile(glslang::TShader* shader, const std::string& code, const std::string& entryPointName, EShMessages controls, - const TBuiltInResource* resources=nullptr) + const TBuiltInResource* resources=nullptr, + const std::string* shaderName=nullptr) { const char* shaderStrings = code.data(); const int shaderLengths = static_cast(code.size()); - - shader->setStringsWithLengths(&shaderStrings, &shaderLengths, 1); + const char* shaderNames = nullptr; + + if ((controls & EShMsgDebugInfo) && shaderName != nullptr) { + shaderNames = shaderName->data(); + shader->setStringsWithLengthsAndNames( + &shaderStrings, &shaderLengths, &shaderNames, 1); + } else + shader->setStringsWithLengths(&shaderStrings, &shaderLengths, 1); if (!entryPointName.empty()) shader->setEntryPoint(entryPointName.c_str()); return shader->parse( (resources ? resources : &glslang::DefaultTBuiltInResource), @@ -195,12 +209,13 @@ class GlslangTest : public GT { // during the process. If the target includes SPIR-V, also disassembles // the result and returns disassembly text. GlslangResult compileAndLink( - const std::string shaderName, const std::string& code, + const std::string& shaderName, const std::string& code, const std::string& entryPointName, EShMessages controls, glslang::EShTargetClientVersion clientTargetVersion, bool flattenUniformArrays = false, EShTextureSamplerTransformMode texSampTransMode = EShTexSampTransKeep, bool enableOptimizer = false, + bool enableDebug = false, bool automap = true) { const EShLanguage stage = GetShaderStage(GetSuffix(shaderName)); @@ -231,7 +246,8 @@ class GlslangTest : public GT { } } - bool success = compile(&shader, code, entryPointName, controls); + bool success = compile( + &shader, code, entryPointName, controls, nullptr, &shaderName); glslang::TProgram program; program.addShader(&shader); @@ -241,21 +257,21 @@ class GlslangTest : public GT { if (success && (controls & EShMsgSpvRules)) { std::vector spirv_binary; - glslang::SpvOptions options; - options.disableOptimizer = !enableOptimizer; - options.validate = true; + options().disableOptimizer = !enableOptimizer; + options().generateDebugInfo = enableDebug; glslang::GlslangToSpv(*program.getIntermediate(stage), - spirv_binary, &logger, &options); + spirv_binary, &logger, &options()); std::ostringstream disassembly_stream; spv::Parameterize(); spv::Disassemble(disassembly_stream, spirv_binary); + bool validation_result = !options().validate || logger.getAllMessages().empty(); return {{{shaderName, shader.getInfoLog(), shader.getInfoDebugLog()},}, program.getInfoLog(), program.getInfoDebugLog(), - logger.getAllMessages(), disassembly_stream.str()}; + validation_result, logger.getAllMessages(), disassembly_stream.str()}; } else { return {{{shaderName, shader.getInfoLog(), shader.getInfoDebugLog()},}, - program.getInfoLog(), program.getInfoDebugLog(), "", ""}; + program.getInfoLog(), program.getInfoDebugLog(), true, "", ""}; } } @@ -299,20 +315,19 @@ class GlslangTest : public GT { if (success && (controls & EShMsgSpvRules)) { std::vector spirv_binary; - glslang::SpvOptions options; - options.validate = true; glslang::GlslangToSpv(*program.getIntermediate(stage), - spirv_binary, &logger, &options); + spirv_binary, &logger, &options()); std::ostringstream disassembly_stream; spv::Parameterize(); spv::Disassemble(disassembly_stream, spirv_binary); + bool validation_result = !options().validate || logger.getAllMessages().empty(); return {{{shaderName, shader.getInfoLog(), shader.getInfoDebugLog()},}, program.getInfoLog(), program.getInfoDebugLog(), - logger.getAllMessages(), disassembly_stream.str()}; + validation_result, logger.getAllMessages(), disassembly_stream.str()}; } else { return {{{shaderName, shader.getInfoLog(), shader.getInfoDebugLog()},}, - program.getInfoLog(), program.getInfoDebugLog(), "", ""}; + program.getInfoLog(), program.getInfoDebugLog(), true, "", ""}; } } @@ -341,22 +356,21 @@ class GlslangTest : public GT { if (success && (controls & EShMsgSpvRules)) { std::vector spirv_binary; - glslang::SpvOptions options; - options.validate = true; glslang::GlslangToSpv(*program.getIntermediate(stage), - spirv_binary, &logger, &options); + spirv_binary, &logger, &options()); spv::spirvbin_t(0 /*verbosity*/).remap(spirv_binary, remapOptions); std::ostringstream disassembly_stream; spv::Parameterize(); spv::Disassemble(disassembly_stream, spirv_binary); + bool validation_result = !options().validate || logger.getAllMessages().empty(); return {{{shaderName, shader.getInfoLog(), shader.getInfoDebugLog()},}, program.getInfoLog(), program.getInfoDebugLog(), - logger.getAllMessages(), disassembly_stream.str()}; + validation_result, logger.getAllMessages(), disassembly_stream.str()}; } else { return {{{shaderName, shader.getInfoLog(), shader.getInfoDebugLog()},}, - program.getInfoLog(), program.getInfoDebugLog(), "", ""}; + program.getInfoLog(), program.getInfoDebugLog(), true, "", ""}; } } @@ -377,9 +391,9 @@ class GlslangTest : public GT { return {{{shaderName, "", ""},}, "", "", - "", disassembly_stream.str()}; + true, "", disassembly_stream.str()}; } else { - return {{{shaderName, "", ""},}, "", "", "", ""}; + return {{{shaderName, "", ""},}, "", "", true, "", ""}; } } @@ -398,7 +412,9 @@ class GlslangTest : public GT { } outputIfNotEmpty(result.linkingOutput); outputIfNotEmpty(result.linkingError); - *stream << result.spirvWarningsErrors; + if (!result.validationResult) { + *stream << "Validation failed\n"; + } if (controls & EShMsgSpvRules) { *stream @@ -417,7 +433,8 @@ class GlslangTest : public GT { bool automap = true, const std::string& entryPointName="", const std::string& baseDir="/baseResults/", - const bool enableOptimizer = false) + const bool enableOptimizer = false, + const bool enableDebug = false) { const std::string inputFname = testDir + "/" + testName; const std::string expectedOutputFname = @@ -430,17 +447,47 @@ class GlslangTest : public GT { EShMessages controls = DeriveOptions(source, semantics, target); if (enableOptimizer) controls = static_cast(controls & ~EShMsgHlslLegalization); + if (enableDebug) + controls = static_cast(controls | EShMsgDebugInfo); GlslangResult result = compileAndLink(testName, input, entryPointName, controls, clientTargetVersion, false, - EShTexSampTransKeep, enableOptimizer, automap); + EShTexSampTransKeep, enableOptimizer, enableDebug, automap); // Generate the hybrid output in the way of glslangValidator. std::ostringstream stream; outputResultToStream(&stream, result, controls); checkEqAndUpdateIfRequested(expectedOutput, stream.str(), - expectedOutputFname); + expectedOutputFname, result.spirvWarningsErrors); } + void loadFileCompileAndCheckWithOptions(const std::string &testDir, + const std::string &testName, + Source source, + Semantics semantics, + glslang::EShTargetClientVersion clientTargetVersion, + Target target, bool automap = true, const std::string &entryPointName = "", + const std::string &baseDir = "/baseResults/", + const EShMessages additionalOptions = EShMessages::EShMsgDefault) + { + const std::string inputFname = testDir + "/" + testName; + const std::string expectedOutputFname = testDir + baseDir + testName + ".out"; + std::string input, expectedOutput; + + tryLoadFile(inputFname, "input", &input); + tryLoadFile(expectedOutputFname, "expected output", &expectedOutput); + + EShMessages controls = DeriveOptions(source, semantics, target); + controls = static_cast(controls | additionalOptions); + GlslangResult result = compileAndLink(testName, input, entryPointName, controls, clientTargetVersion, false, + EShTexSampTransKeep, false, automap); + + // Generate the hybrid output in the way of glslangValidator. + std::ostringstream stream; + outputResultToStream(&stream, result, controls); + + checkEqAndUpdateIfRequested(expectedOutput, stream.str(), expectedOutputFname); + } + void loadFileCompileFlattenUniformsAndCheck(const std::string& testDir, const std::string& testName, Source source, @@ -465,7 +512,7 @@ class GlslangTest : public GT { outputResultToStream(&stream, result, controls); checkEqAndUpdateIfRequested(expectedOutput, stream.str(), - expectedOutputFname); + expectedOutputFname, result.spirvWarningsErrors); } void loadFileCompileIoMapAndCheck(const std::string& testDir, @@ -502,7 +549,7 @@ class GlslangTest : public GT { outputResultToStream(&stream, result, controls); checkEqAndUpdateIfRequested(expectedOutput, stream.str(), - expectedOutputFname); + expectedOutputFname, result.spirvWarningsErrors); } void loadFileCompileRemapAndCheck(const std::string& testDir, @@ -529,7 +576,7 @@ class GlslangTest : public GT { outputResultToStream(&stream, result, controls); checkEqAndUpdateIfRequested(expectedOutput, stream.str(), - expectedOutputFname); + expectedOutputFname, result.spirvWarningsErrors); } void loadFileRemapAndCheck(const std::string& testDir, @@ -556,7 +603,7 @@ class GlslangTest : public GT { outputResultToStream(&stream, result, controls); checkEqAndUpdateIfRequested(expectedOutput, stream.str(), - expectedOutputFname); + expectedOutputFname, result.spirvWarningsErrors); } // Preprocesses the given |source| code. On success, returns true, the @@ -636,14 +683,17 @@ class GlslangTest : public GT { outputResultToStream(&stream, result, controls); checkEqAndUpdateIfRequested(expectedOutput, stream.str(), - expectedOutputFname); + expectedOutputFname, result.spirvWarningsErrors); } + glslang::SpvOptions& options() { return validatorOptions; } + private: const int defaultVersion; const EProfile defaultProfile; const bool forceVersionProfile; const bool isForwardCompatible; + glslang::SpvOptions validatorOptions; }; } // namespace glslangtest diff --git a/deps/glslang/hlsl/hlslGrammar.cpp b/deps/glslang/hlsl/hlslGrammar.cpp index 6acaccbf..277d33a2 100644 --- a/deps/glslang/hlsl/hlslGrammar.cpp +++ b/deps/glslang/hlsl/hlslGrammar.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2016 Google, Inc. +// Copyright (C) 2016-2018 Google, Inc. // Copyright (C) 2016 LunarG, Inc. // // All rights reserved. @@ -1163,6 +1163,49 @@ bool HlslGrammar::acceptSubpassInputType(TType& type) return true; } +// sampler_type for DX9 compatibility +// : SAMPLER +// | SAMPLER1D +// | SAMPLER2D +// | SAMPLER3D +// | SAMPLERCUBE +bool HlslGrammar::acceptSamplerTypeDX9(TType &type) +{ + // read sampler type + const EHlslTokenClass samplerType = peek(); + + TSamplerDim dim = EsdNone; + TType txType(EbtFloat, EvqUniform, 4); // default type is float4 + + bool isShadow = false; + + switch (samplerType) + { + case EHTokSampler: dim = Esd2D; break; + case EHTokSampler1d: dim = Esd1D; break; + case EHTokSampler2d: dim = Esd2D; break; + case EHTokSampler3d: dim = Esd3D; break; + case EHTokSamplerCube: dim = EsdCube; break; + default: + return false; // not a dx9 sampler declaration + } + + advanceToken(); // consume the sampler type keyword + + TArraySizes *arraySizes = nullptr; // TODO: array + + TSampler sampler; + sampler.set(txType.getBasicType(), dim, false, isShadow, false); + + if (!parseContext.setTextureReturnType(sampler, txType, token.loc)) + return false; + + type.shallowCopy(TType(sampler, EvqUniform, arraySizes)); + type.getQualifier().layoutFormat = ElfNone; + + return true; +} + // sampler_type // : SAMPLER // | SAMPLER1D @@ -1445,7 +1488,13 @@ bool HlslGrammar::acceptType(TType& type, TIntermNode*& nodeList) case EHTokSampler2d: // ... case EHTokSampler3d: // ... case EHTokSamplerCube: // ... - case EHTokSamplerState: // ... + if (parseContext.hlslDX9Compatible()) + return acceptSamplerTypeDX9(type); + else + return acceptSamplerType(type); + break; + + case EHTokSamplerState: // fall through case EHTokSamplerComparisonState: // ... return acceptSamplerType(type); break; diff --git a/deps/glslang/hlsl/hlslGrammar.h b/deps/glslang/hlsl/hlslGrammar.h index 323f3b13..27706b2b 100644 --- a/deps/glslang/hlsl/hlslGrammar.h +++ b/deps/glslang/hlsl/hlslGrammar.h @@ -1,5 +1,5 @@ // -// Copyright (C) 2016 Google, Inc. +// Copyright (C) 2016-2018 Google, Inc. // Copyright (C) 2016 LunarG, Inc. // // All rights reserved. @@ -84,6 +84,7 @@ namespace glslang { bool acceptStreamOutTemplateType(TType&, TLayoutGeometry&); bool acceptOutputPrimitiveGeometry(TLayoutGeometry&); bool acceptAnnotations(TQualifier&); + bool acceptSamplerTypeDX9(TType &); bool acceptSamplerType(TType&); bool acceptTextureType(TType&); bool acceptSubpassInputType(TType&); diff --git a/deps/glslang/hlsl/hlslParseHelper.cpp b/deps/glslang/hlsl/hlslParseHelper.cpp index 6ce182de..2634f911 100644 --- a/deps/glslang/hlsl/hlslParseHelper.cpp +++ b/deps/glslang/hlsl/hlslParseHelper.cpp @@ -1,5 +1,5 @@ // -// Copyright (C) 2017 Google, Inc. +// Copyright (C) 2017-2018 Google, Inc. // Copyright (C) 2017 LunarG, Inc. // // All rights reserved. @@ -39,6 +39,7 @@ #include "hlslGrammar.h" #include "hlslAttributes.h" +#include "../glslang/Include/Common.h" #include "../glslang/MachineIndependent/Scan.h" #include "../glslang/MachineIndependent/preprocessor/PpContext.h" @@ -133,7 +134,7 @@ bool HlslParseContext::parseShaderStrings(TPpContext& ppContext, TInputScanner& // Print a message formated such that if you click on the message it will take you right to // the line through most UIs. const glslang::TSourceLoc& sourceLoc = input.getSourceLoc(); - infoSink.info << sourceLoc.name << "(" << sourceLoc.line << "): error at column " << sourceLoc.column + infoSink.info << sourceLoc.getFilenameStr() << "(" << sourceLoc.line << "): error at column " << sourceLoc.column << ", HLSL parsing failed.\n"; ++numErrors; return false; @@ -653,10 +654,6 @@ TIntermTyped* HlslParseContext::handleVariable(const TSourceLoc& loc, const TStr return nullptr; } - // Error check for requiring specific extensions present. - if (symbol && symbol->getNumExtensions()) - requireExtensions(loc, symbol->getNumExtensions(), symbol->getExtensions(), symbol->getName().c_str()); - const TVariable* variable = nullptr; const TAnonMember* anon = symbol ? symbol->getAsAnonMember() : nullptr; TIntermTyped* node = nullptr; @@ -1872,6 +1869,9 @@ void HlslParseContext::handleEntryPointAttributes(const TSourceLoc& loc, const T } break; } + case EatEarlyDepthStencil: + intermediate.setEarlyFragmentTests(); + break; case EatBuiltIn: case EatLocation: // tolerate these because of dual use of entrypoint and type attributes @@ -3129,7 +3129,7 @@ TIntermAggregate* HlslParseContext::handleSamplerTextureCombine(const TSourceLoc if (textureShadowEntry != textureShadowVariant.end()) newId = textureShadowEntry->second->get(shadowMode); else - textureShadowVariant[texSymbol->getId()] = new tShadowTextureSymbols; + textureShadowVariant[texSymbol->getId()] = NewPoolObject(tShadowTextureSymbols(), 1); // Sometimes we have to create another symbol (if this texture has been seen before, // and we haven't created the form for this shadow mode). @@ -3208,7 +3208,7 @@ void HlslParseContext::declareStructBufferCounter(const TSourceLoc& loc, const T TType blockType; counterBufferType(loc, blockType); - TString* blockName = new TString(intermediate.addCounterBufferName(name)); + TString* blockName = NewPoolTString(intermediate.addCounterBufferName(name).c_str()); // Counter buffer is not yet in use structBufferCounter[*blockName] = false; @@ -3255,7 +3255,8 @@ void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TInte if (argAggregate) { if (argAggregate->getSequence().empty()) return; - bufferObj = argAggregate->getSequence()[0]->getAsTyped(); + if (argAggregate->getSequence()[0]) + bufferObj = argAggregate->getSequence()[0]->getAsTyped(); } else { bufferObj = arguments->getAsSymbolNode(); } @@ -3477,8 +3478,8 @@ void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TInte if (argStride != nullptr) { int size; int stride; - intermediate.getBaseAlignment(argArray->getType(), size, stride, false, - argArray->getType().getQualifier().layoutMatrix == ElmRowMajor); + intermediate.getMemberAlignment(argArray->getType(), size, stride, argArray->getType().getQualifier().layoutPacking, + argArray->getType().getQualifier().layoutMatrix == ElmRowMajor); TIntermTyped* assign = intermediate.addAssign(EOpAssign, argStride, intermediate.addConstantUnion(stride, loc, true), loc); @@ -3754,7 +3755,8 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType if (arguments->getAsTyped()->getBasicType() != EbtSampler) return; } else { - if (argAggregate->getSequence().size() == 0 || + if (argAggregate->getSequence().size() == 0 || + argAggregate->getSequence()[0] == nullptr || argAggregate->getSequence()[0]->getAsTyped()->getBasicType() != EbtSampler) return; } @@ -3770,6 +3772,43 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType break; } + case EOpTextureLod: //is almost EOpTextureBias (only args & operations are different) + { + TIntermTyped *argSamp = argAggregate->getSequence()[0]->getAsTyped(); // sampler + TIntermTyped *argCoord = argAggregate->getSequence()[1]->getAsTyped(); // coord + + assert(argCoord->getVectorSize() == 4); + TIntermTyped *w = intermediate.addConstantUnion(3, loc, true); + TIntermTyped *argLod = intermediate.addIndex(EOpIndexDirect, argCoord, w, loc); + + TOperator constructOp = EOpNull; + const TSampler &sampler = argSamp->getType().getSampler(); + int coordSize = 0; + + switch (sampler.dim) + { + case Esd1D: constructOp = EOpConstructFloat; coordSize = 1; break; // 1D + case Esd2D: constructOp = EOpConstructVec2; coordSize = 2; break; // 2D + case Esd3D: constructOp = EOpConstructVec3; coordSize = 3; break; // 3D + case EsdCube: constructOp = EOpConstructVec3; coordSize = 3; break; // also 3D + default: + break; + } + + TIntermAggregate *constructCoord = new TIntermAggregate(constructOp); + constructCoord->getSequence().push_back(argCoord); + constructCoord->setLoc(loc); + constructCoord->setType(TType(argCoord->getBasicType(), EvqTemporary, coordSize)); + + TIntermAggregate *tex = new TIntermAggregate(EOpTextureLod); + tex->getSequence().push_back(argSamp); // sampler + tex->getSequence().push_back(constructCoord); // coordinate + tex->getSequence().push_back(argLod); // lod + + node = convertReturn(tex, sampler); + + break; + } case EOpTextureBias: { @@ -5256,7 +5295,7 @@ TIntermTyped* HlslParseContext::handleFunctionCall(const TSourceLoc& loc, TFunct TIntermTyped* arg0 = nullptr; - if (aggregate && aggregate->getSequence().size() > 0) + if (aggregate && aggregate->getSequence().size() > 0 && aggregate->getSequence()[0]) arg0 = aggregate->getSequence()[0]->getAsTyped(); else if (arguments->getAsSymbolNode()) arg0 = arguments->getAsSymbolNode(); @@ -5284,11 +5323,6 @@ TIntermTyped* HlslParseContext::handleFunctionCall(const TSourceLoc& loc, TFunct // - a built-in function not mapped to an operator, or // - a user function. - // Error check for a function requiring specific extensions present. - if (builtIn && fnCandidate->getNumExtensions()) - requireExtensions(loc, fnCandidate->getNumExtensions(), fnCandidate->getExtensions(), - fnCandidate->getName().c_str()); - // turn an implicit member-function resolution into an explicit call TString callerName; if (thisDepth == 0) @@ -5730,7 +5764,7 @@ void HlslParseContext::addStructBuffArguments(const TSourceLoc& loc, TIntermAggr std::any_of(aggregate->getSequence().begin(), aggregate->getSequence().end(), [this](const TIntermNode* node) { - return (node->getAsTyped() != nullptr) && hasStructBuffCounter(node->getAsTyped()->getType()); + return (node && node->getAsTyped() != nullptr) && hasStructBuffCounter(node->getAsTyped()->getType()); }); // Nothing to do, if we didn't find one. @@ -8660,13 +8694,26 @@ void HlslParseContext::fixXfbOffsets(TQualifier& qualifier, TTypeList& typeList) int nextOffset = qualifier.layoutXfbOffset; for (unsigned int member = 0; member < typeList.size(); ++member) { TQualifier& memberQualifier = typeList[member].type->getQualifier(); - bool containsDouble = false; - int memberSize = intermediate.computeTypeXfbSize(*typeList[member].type, containsDouble); + bool contains64BitType = false; +#ifdef AMD_EXTENSIONS + bool contains32BitType = false; + bool contains16BitType = false; + int memberSize = intermediate.computeTypeXfbSize(*typeList[member].type, contains64BitType, contains32BitType, contains16BitType); +#else + int memberSize = intermediate.computeTypeXfbSize(*typeList[member].type, contains64BitType); +#endif // see if we need to auto-assign an offset to this member if (! memberQualifier.hasXfbOffset()) { - // "if applied to an aggregate containing a double, the offset must also be a multiple of 8" - if (containsDouble) + // "if applied to an aggregate containing a double or 64-bit integer, the offset must also be a multiple of 8" + if (contains64BitType) RoundToPow2(nextOffset, 8); +#ifdef AMD_EXTENSIONS + else if (contains32BitType) + RoundToPow2(nextOffset, 4); + // "if applied to an aggregate containing a half float or 16-bit integer, the offset must also be a multiple of 2" + else if (contains16BitType) + RoundToPow2(nextOffset, 2); +#endif memberQualifier.layoutXfbOffset = nextOffset; } else nextOffset = memberQualifier.layoutXfbOffset; @@ -8688,7 +8735,7 @@ void HlslParseContext::fixBlockUniformOffsets(const TQualifier& qualifier, TType { if (! qualifier.isUniformOrBuffer()) return; - if (qualifier.layoutPacking != ElpStd140 && qualifier.layoutPacking != ElpStd430) + if (qualifier.layoutPacking != ElpStd140 && qualifier.layoutPacking != ElpStd430 && qualifier.layoutPacking != ElpScalar) return; int offset = 0; @@ -8702,11 +8749,11 @@ void HlslParseContext::fixBlockUniformOffsets(const TQualifier& qualifier, TType // modify just the children's view of matrix layout, if there is one for this member TLayoutMatrix subMatrixLayout = typeList[member].type->getQualifier().layoutMatrix; int dummyStride; - int memberAlignment = intermediate.getBaseAlignment(*typeList[member].type, memberSize, dummyStride, - qualifier.layoutPacking == ElpStd140, - subMatrixLayout != ElmNone - ? subMatrixLayout == ElmRowMajor - : qualifier.layoutMatrix == ElmRowMajor); + int memberAlignment = intermediate.getMemberAlignment(*typeList[member].type, memberSize, dummyStride, + qualifier.layoutPacking, + subMatrixLayout != ElmNone + ? subMatrixLayout == ElmRowMajor + : qualifier.layoutMatrix == ElmRowMajor); if (memberQualifier.hasOffset()) { // "The specified offset must be a multiple // of the base alignment of the type of the block member it qualifies, or a compile-time error results." diff --git a/deps/glslang/hlsl/hlslParseHelper.h b/deps/glslang/hlsl/hlslParseHelper.h index f99d5c73..822de896 100644 --- a/deps/glslang/hlsl/hlslParseHelper.h +++ b/deps/glslang/hlsl/hlslParseHelper.h @@ -1,5 +1,5 @@ // -// Copyright (C) 2016 Google, Inc. +// Copyright (C) 2016-2018 Google, Inc. // Copyright (C) 2016 LunarG, Inc. // // All rights reserved. diff --git a/deps/glslang/hlsl/hlslParseables.cpp b/deps/glslang/hlsl/hlslParseables.cpp index 65000912..a63ecb60 100644 --- a/deps/glslang/hlsl/hlslParseables.cpp +++ b/deps/glslang/hlsl/hlslParseables.cpp @@ -698,17 +698,17 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c { "step", nullptr, nullptr, "SVM,", "F,", EShLangAll, false }, { "tan", nullptr, nullptr, "SVM", "F", EShLangAll, false }, { "tanh", nullptr, nullptr, "SVM", "F", EShLangAll, false }, - { "tex1D", "V4", "F", "V1,S", "S,F", EShLangPS, false }, - { "tex1D", "V4", "F", "V1,S,V1,", "S,F,,", EShLangPS, false }, - { "tex1Dbias", "V4", "F", "V1,V4", "S,F", EShLangPS, false }, - { "tex1Dgrad", "V4", "F", "V1,,,", "S,F,,", EShLangPS, false }, - { "tex1Dlod", "V4", "F", "V1,V4", "S,F", EShLangPS, false }, - { "tex1Dproj", "V4", "F", "V1,V4", "S,F", EShLangPS, false }, + { "tex1D", "V4", "F", "S,S", "S,F", EShLangPS, false }, + { "tex1D", "V4", "F", "S,S,V1,", "S,F,,", EShLangPS, false }, + { "tex1Dbias", "V4", "F", "S,V4", "S,F", EShLangPS, false }, + { "tex1Dgrad", "V4", "F", "S,,,", "S,F,,", EShLangPS, false }, + { "tex1Dlod", "V4", "F", "S,V4", "S,F", EShLangPS, false }, + { "tex1Dproj", "V4", "F", "S,V4", "S,F", EShLangPS, false }, { "tex2D", "V4", "F", "V2,", "S,F", EShLangPS, false }, { "tex2D", "V4", "F", "V2,,,", "S,F,,", EShLangPS, false }, { "tex2Dbias", "V4", "F", "V2,V4", "S,F", EShLangPS, false }, { "tex2Dgrad", "V4", "F", "V2,,,", "S,F,,", EShLangPS, false }, - { "tex2Dlod", "V4", "F", "V2,V4", "S,F", EShLangPS, false }, + { "tex2Dlod", "V4", "F", "V2,V4", "S,F", EShLangAll, false }, { "tex2Dproj", "V4", "F", "V2,V4", "S,F", EShLangPS, false }, { "tex3D", "V4", "F", "V3,", "S,F", EShLangPS, false }, { "tex3D", "V4", "F", "V3,,,", "S,F,,", EShLangPS, false }, diff --git a/deps/glslang/known_good.json b/deps/glslang/known_good.json index 0bfa88a7..05d8c012 100644 --- a/deps/glslang/known_good.json +++ b/deps/glslang/known_good.json @@ -5,14 +5,14 @@ "site" : "github", "subrepo" : "KhronosGroup/SPIRV-Tools", "subdir" : "External/spirv-tools", - "commit" : "a29a9947ac96d811b310f481b24e293f67fedf32" + "commit" : "117a1fd11f11e9bef9faa563c3d5156cc6ab529c" }, { "name" : "spirv-tools/external/spirv-headers", "site" : "github", "subrepo" : "KhronosGroup/SPIRV-Headers", "subdir" : "External/spirv-tools/external/spirv-headers", - "commit" : "a2c529b5dda18838ab4b52f816acfebd774eaab3" + "commit" : "79b6681aadcb53c27d1052e5f8a0e82a981dbf2f" } ] } diff --git a/deps/glslang/ndk_test/Android.mk b/deps/glslang/ndk_test/Android.mk new file mode 100644 index 00000000..bcf82dd2 --- /dev/null +++ b/deps/glslang/ndk_test/Android.mk @@ -0,0 +1,12 @@ +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_CPP_EXTENSION := .cc .cpp .cxx +LOCAL_SRC_FILES:=test.cpp +LOCAL_MODULE:=glslang_ndk_test +LOCAL_LDLIBS:=-landroid +LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti -Werror +LOCAL_STATIC_LIBRARIES:=glslang SPIRV HLSL +include $(BUILD_SHARED_LIBRARY) + +include $(LOCAL_PATH)/../Android.mk diff --git a/deps/glslang/ndk_test/jni/Application.mk b/deps/glslang/ndk_test/jni/Application.mk new file mode 100644 index 00000000..d7ccd349 --- /dev/null +++ b/deps/glslang/ndk_test/jni/Application.mk @@ -0,0 +1,5 @@ +APP_ABI := all +APP_BUILD_SCRIPT := Android.mk +APP_STL := gnustl_static +APP_PLATFORM := android-9 +NDK_TOOLCHAIN_VERSION := 4.9 diff --git a/deps/glslang/ndk_test/test.cpp b/deps/glslang/ndk_test/test.cpp new file mode 100644 index 00000000..dec53d01 --- /dev/null +++ b/deps/glslang/ndk_test/test.cpp @@ -0,0 +1,19 @@ +// Copyright 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "SPIRV/GlslangToSpv.h" + +void android_main(struct android_app* state) { + int version = glslang::GetSpirvGeneratorVersion(); +} diff --git a/examples/DynamicBuffers/CMakeLists.txt b/examples/DynamicBuffers/CMakeLists.txt index 9df6640e..d60db3c8 100644 --- a/examples/DynamicBuffers/CMakeLists.txt +++ b/examples/DynamicBuffers/CMakeLists.txt @@ -27,8 +27,7 @@ include_directories(${Anvil_SOURCE_DIR}/include # Create the DynamicBuffers project. add_executable (DynamicBuffers include/app.h - include/app.h - src/app.cpp) + src/app.cpp) # Add linking dependencies for the example projects add_dependencies (DynamicBuffers Anvil) diff --git a/examples/DynamicBuffers/src/app.cpp b/examples/DynamicBuffers/src/app.cpp index a5731113..a650e7b8 100644 --- a/examples/DynamicBuffers/src/app.cpp +++ b/examples/DynamicBuffers/src/app.cpp @@ -41,6 +41,7 @@ #include "misc/io.h" #include "misc/memory_allocator.h" #include "misc/object_tracker.h" +#include "misc/rendering_surface_create_info.h" #include "misc/render_pass_create_info.h" #include "misc/semaphore_create_info.h" #include "misc/swapchain_create_info.h" @@ -836,7 +837,7 @@ void App::init_compute_pipelines() 4, /* size */ Anvil::ShaderStageFlagBits::COMPUTE_BIT); producer_pipeline_info_ptr->set_descriptor_set_create_info(m_producer_dsg_ptr->get_descriptor_set_create_info() ); - + result = compute_manager_ptr->add_pipeline(std::move(producer_pipeline_info_ptr), &m_producer_pipeline_id); anvil_assert(result); @@ -1185,9 +1186,13 @@ void App::init_shaders() void App::init_swapchain() { - m_rendering_surface_ptr = Anvil::RenderingSurface::create(m_instance_ptr.get(), - m_device_ptr.get (), - m_window_ptr.get () ); + { + auto create_info_ptr = Anvil::RenderingSurfaceCreateInfo::create(m_instance_ptr.get(), + m_device_ptr.get (), + m_window_ptr.get () ); + + m_rendering_surface_ptr = Anvil::RenderingSurface::create(std::move(create_info_ptr) ); + } m_rendering_surface_ptr->set_name("Main rendering surface"); @@ -1260,12 +1265,16 @@ void App::init_vulkan() m_physical_device_ptr = m_instance_ptr->get_physical_device(0); /* Create a Vulkan device */ - m_device_ptr = Anvil::SGPUDevice::create(m_physical_device_ptr, - true, /* in_enable_shader_module_cache */ - Anvil::DeviceExtensionConfiguration(), - std::vector(), /* in_layers */ - false, /* in_transient_command_buffer_allocs_only */ - false); /* in_support_resettable_command_buffers */ + { + auto create_info_ptr = Anvil::DeviceCreateInfo::create_sgpu(m_physical_device_ptr, + true, /* in_enable_shader_module_cache */ + Anvil::DeviceExtensionConfiguration(), + std::vector(), /* in_layers */ + Anvil::CommandPoolCreateFlagBits::NONE, + false); /* in_mt_safe */ + + m_device_ptr = Anvil::SGPUDevice::create(std::move(create_info_ptr) ); + } } void App::on_validation_callback(Anvil::DebugMessageSeverityFlags in_severity, @@ -1285,7 +1294,7 @@ void App::run() } -int main() +int main(int argc, char *argv[]) { std::unique_ptr app_ptr(new App() ); diff --git a/examples/MultiViewport/CMakeLists.txt b/examples/MultiViewport/CMakeLists.txt index 2244c72e..0d0e26e1 100644 --- a/examples/MultiViewport/CMakeLists.txt +++ b/examples/MultiViewport/CMakeLists.txt @@ -27,8 +27,7 @@ include_directories(${Anvil_SOURCE_DIR}/include # Create the MultiViewport project. add_executable (MultiViewport include/app.h - include/app.h - src/app.cpp) + src/app.cpp) # Add linking dependencies for the example projects add_dependencies(MultiViewport Anvil) diff --git a/examples/MultiViewport/src/app.cpp b/examples/MultiViewport/src/app.cpp index 9abd13a2..11dfa207 100644 --- a/examples/MultiViewport/src/app.cpp +++ b/examples/MultiViewport/src/app.cpp @@ -36,6 +36,7 @@ #include "misc/instance_create_info.h" #include "misc/object_tracker.h" #include "misc/render_pass_create_info.h" +#include "misc/rendering_surface_create_info.h" #include "misc/semaphore_create_info.h" #include "misc/swapchain_create_info.h" #include "misc/time.h" @@ -867,9 +868,13 @@ void App::init_shaders() void App::init_swapchain() { - m_rendering_surface_ptr = Anvil::RenderingSurface::create(m_instance_ptr.get(), - m_device_ptr.get (), - m_window_ptr.get () ); + { + auto create_info_ptr = Anvil::RenderingSurfaceCreateInfo::create(m_instance_ptr.get(), + m_device_ptr.get (), + m_window_ptr.get () ); + + m_rendering_surface_ptr = Anvil::RenderingSurface::create(std::move(create_info_ptr) ); + } m_rendering_surface_ptr->set_name("Main rendering surface"); @@ -942,12 +947,16 @@ void App::init_vulkan() m_physical_device_ptr = m_instance_ptr->get_physical_device(0); /* Create a Vulkan device */ - m_device_ptr = Anvil::SGPUDevice::create(m_physical_device_ptr, - true, /* in_enable_shader_module_cache */ - Anvil::DeviceExtensionConfiguration(), - std::vector(), /* in_layers */ - false, /* in_transient_command_buffer_allocs_only */ - false); /* in_support_resettable_command_buffers */ + { + auto create_info_ptr = Anvil::DeviceCreateInfo::create_sgpu(m_physical_device_ptr, + true, /* in_enable_shader_module_cache */ + Anvil::DeviceExtensionConfiguration(), + std::vector(), /* in_layers */ + Anvil::CommandPoolCreateFlagBits::NONE, + false); /* in_mt_safe */ + + m_device_ptr = Anvil::SGPUDevice::create(std::move(create_info_ptr) ); + } } void App::on_validation_callback(Anvil::DebugMessageSeverityFlags in_severity, @@ -967,7 +976,7 @@ void App::run() } -int main() +int main(int argc, char *argv[]) { std::unique_ptr app_ptr(new App() ); diff --git a/examples/OcclusionQuery/CMakeLists.txt b/examples/OcclusionQuery/CMakeLists.txt index 78c828de..556eb153 100644 --- a/examples/OcclusionQuery/CMakeLists.txt +++ b/examples/OcclusionQuery/CMakeLists.txt @@ -27,11 +27,10 @@ include_directories(${Anvil_SOURCE_DIR}/include # Create the OcclusionQuery project. add_executable (OcclusionQuery include/app.h - include/app.h - src/app.cpp) + src/app.cpp) # Add linking dependencies for the example projects -add_dependencies (OcclusionQuery Anvil) +add_dependencies(OcclusionQuery Anvil) if (WIN32) target_link_libraries(OcclusionQuery Anvil) diff --git a/examples/OcclusionQuery/src/app.cpp b/examples/OcclusionQuery/src/app.cpp index abae36b6..b641ee5d 100644 --- a/examples/OcclusionQuery/src/app.cpp +++ b/examples/OcclusionQuery/src/app.cpp @@ -39,6 +39,7 @@ #include "misc/io.h" #include "misc/object_tracker.h" #include "misc/render_pass_create_info.h" +#include "misc/rendering_surface_create_info.h" #include "misc/semaphore_create_info.h" #include "misc/swapchain_create_info.h" #include "misc/time.h" @@ -1023,9 +1024,13 @@ void App::init_shaders() void App::init_swapchain() { - m_rendering_surface_ptr = Anvil::RenderingSurface::create(m_instance_ptr.get(), - m_device_ptr.get (), - m_window_ptr.get () ); + { + auto create_info_ptr = Anvil::RenderingSurfaceCreateInfo::create(m_instance_ptr.get(), + m_device_ptr.get (), + m_window_ptr.get () ); + + m_rendering_surface_ptr = Anvil::RenderingSurface::create(std::move(create_info_ptr) ); + } m_rendering_surface_ptr->set_name("Main rendering surface"); @@ -1098,12 +1103,16 @@ void App::init_vulkan() m_physical_device_ptr = m_instance_ptr->get_physical_device(0); /* Create a Vulkan device */ - m_device_ptr = Anvil::SGPUDevice::create(m_physical_device_ptr, - true, /* in_enable_shader_module_cache */ - Anvil::DeviceExtensionConfiguration(), - std::vector(), /* in_layers */ - false, /* in_transient_command_buffer_allocs_only */ - false); /* in_support_resettable_command_buffers */ + { + auto create_info_ptr = Anvil::DeviceCreateInfo::create_sgpu(m_physical_device_ptr, + true, /* in_enable_shader_module_cache */ + Anvil::DeviceExtensionConfiguration(), + std::vector(), /* in_layers */ + Anvil::CommandPoolCreateFlagBits::NONE, + false); /* in_mt_safe */ + + m_device_ptr = Anvil::SGPUDevice::create(std::move(create_info_ptr) ); + } } void App::on_validation_callback(Anvil::DebugMessageSeverityFlags in_severity, @@ -1123,7 +1132,7 @@ void App::run() } -int main() +int main(int argc, char *argv[]) { std::unique_ptr app_ptr(new App() ); diff --git a/examples/OutOfOrderRasterization/CMakeLists.txt b/examples/OutOfOrderRasterization/CMakeLists.txt index 79358087..b1bdf6b3 100644 --- a/examples/OutOfOrderRasterization/CMakeLists.txt +++ b/examples/OutOfOrderRasterization/CMakeLists.txt @@ -28,11 +28,11 @@ include_directories(${Anvil_SOURCE_DIR}/include # Create the OutOfOrderRasterization project. add_executable (OutOfOrderRasterization include/app.h include/teapot_data.h - src/app.cpp - src/teapot_data.cpp) + src/app.cpp + src/teapot_data.cpp) # Add linking dependencies for the example projects -add_dependencies (OutOfOrderRasterization Anvil) +add_dependencies(OutOfOrderRasterization Anvil) if (WIN32) target_link_libraries(OutOfOrderRasterization Anvil) diff --git a/examples/OutOfOrderRasterization/include/app.h b/examples/OutOfOrderRasterization/include/app.h index 2f178c20..666fc1a0 100644 --- a/examples/OutOfOrderRasterization/include/app.h +++ b/examples/OutOfOrderRasterization/include/app.h @@ -64,6 +64,10 @@ class App void on_validation_callback(Anvil::DebugMessageSeverityFlags in_severity, const char* in_message_ptr); + #if defined(ENABLE_MGPU_SUPPORT) + std::vector get_render_areas(uint32_t in_afr_render_index = 0) const; + #endif + /* Private variables */ Anvil::BaseDeviceUniquePtr m_device_ptr; @@ -74,13 +78,24 @@ class App Anvil::SwapchainUniquePtr m_swapchain_ptr; Anvil::WindowUniquePtr m_window_ptr; + #if defined(ENABLE_EXPLICIT_SWAPCHAIN_IMAGE_MEMORY_BINDING) + std::vector m_swapchain_images; + std::vector m_swapchain_image_views; + #endif + Anvil::ImageUniquePtr m_depth_image_ptr; Anvil::ImageViewUniquePtr m_depth_image_view_ptr; std::vector m_framebuffers; std::unique_ptr m_fs_entrypoint_ptr; - std::vector m_render_cmdbuffers_ooo_off; - std::vector m_render_cmdbuffers_ooo_on; + #if !defined(ENABLE_MGPU_SUPPORT) + std::vector m_render_cmdbuffers_ooo_off; + std::vector m_render_cmdbuffers_ooo_on; + #else + Anvil::PrimaryCommandBufferUniquePtr m_dummy_cmdbuffer_ptr; + std::map > m_render_cmdbuffers_ooo_on; + std::map > m_render_cmdbuffers_ooo_off; + #endif std::vector m_renderpasses; std::unique_ptr m_vs_entrypoint_ptr; @@ -93,6 +108,20 @@ class App std::unique_ptr m_teapot_props_data_ptr; Anvil::Time m_time; + #if defined(USE_LOCAL_SFR_PRESENTATION_MODE) + struct SwapchainPeerImages + { + /* Holds N_SWAPCHAIN_IMAGES peer images for consecutive swapchain image indices */ + std::vector peer_images; + }; + + uint32_t m_n_presenting_physical_device; + std::vector m_swapchain_peer_images_per_physical_device; + #endif + #if defined(USE_LOCAL_AFR_PRESENTATION_MODE) || defined(USE_REMOTE_AFR_PRESENTATION_MODE) + uint32_t m_n_rendering_physical_device; + #endif + typedef struct SemaphoreBundle { SemaphoreBundle() diff --git a/examples/OutOfOrderRasterization/src/app.cpp b/examples/OutOfOrderRasterization/src/app.cpp index 24c53d12..c7309553 100644 --- a/examples/OutOfOrderRasterization/src/app.cpp +++ b/examples/OutOfOrderRasterization/src/app.cpp @@ -20,6 +20,61 @@ // THE SOFTWARE. // +/* Uncomment the #define below to enable mGPU support. + * + * When enabled, one (and only one!) of the USE_xxx_PRESENTATION_MODE also needs to be enabled. + * + * When enabled, N_SWAPCHAIN_IMAGES must equal the number of logical devices assigned to the physical device. + * This is due to simplification in the rendering code of the app and could be improved when needed. + */ +//#define ENABLE_MGPU_SUPPORT + +/* If mGPU support is enabled, uncomment one (and only one!) of the following #defines to make the app use the specified + * present mode. + * + * NOTE: Path for LOCAL_MULTI_DEVICE presentation mode is not supported at the moment. If needed, just let me know. + * + * NOTE: If the implementation does not support a given presentation mode, you'll get an assertion failure related to missing caps. + * + */ +//#define USE_LOCAL_AFR_PRESENTATION_MODE +//#define USE_LOCAL_SFR_PRESENTATION_MODE +//#define USE_REMOTE_AFR_PRESENTATION_MODE +//#define USE_SUM_SFR_PRESENTATION_MODE + + +#if defined (USE_LOCAL_AFR_PRESENTATION_MODE) + /* Uncomment the #define below to explicitly bind image memory to the created swapchain. + * + * Optional. + */ + // #define ENABLE_EXPLICIT_SWAPCHAIN_IMAGE_MEMORY_BINDING + +#elif defined (USE_LOCAL_SFR_PRESENTATION_MODE) + /* No extra knobs available */ + +#elif defined (USE_REMOTE_AFR_PRESENTATION_MODE) + /* Uncomment the #define below to explicitly bind image memory to the created swapchain. + * + * Optional. + */ + //#define ENABLE_EXPLICIT_SWAPCHAIN_IMAGE_MEMORY_BINDING + +#elif defined (USE_SUM_SFR_PRESENTATION_MODE) + /* Uncomment the #define below to explicitly bind image memory to the created swapchain. + * + * Optional. + */ + // #define ENABLE_EXPLICIT_SWAPCHAIN_IMAGE_MEMORY_BINDING + + /* Uncomment the #define below to enable explicit SFR rectangle definitions. + * Optional. Requires ENABLE_EXPLICIT_SWAPCHAIN_IMAGE_MEMORY_BINDING to be defined. + */ + // #define ENABLE_EXPLICIT_SFR_RECT_DEFINITIONS +#endif + + + /* Uncomment the #define below to enable off-screen rendering */ // #define ENABLE_OFFSCREEN_RENDERING @@ -39,6 +94,7 @@ #include "misc/io.h" #include "misc/memory_allocator.h" #include "misc/object_tracker.h" +#include "misc/rendering_surface_create_info.h" #include "misc/render_pass_create_info.h" #include "misc/semaphore_create_info.h" #include "misc/swapchain_create_info.h" @@ -67,6 +123,60 @@ #include "app.h" /* Sanity checks */ +#if defined(ENABLE_EXPLICIT_SWAPCHAIN_IMAGE_MEMORY_BINDING) && !defined(ENABLE_MGPU_SUPPORT) + #error If ENABLE_EXPLICIT_SWAPCHAIN_IMAGE_MEMORY_BINDING is enabled, ENABLE_MGPU_SUPPORT must also be defined. +#endif + +#if defined(ENABLE_EXPLICIT_SFR_RECT_DEFINITIONS) && !defined(ENABLE_EXPLICIT_SWAPCHAIN_IMAGE_MEMORY_BINDING) + #error If ENABLE_EXPLICIT_SFR_RECT_DEFINITIONS is enabled, ENABLE_EXPLICIT_SWAPCHAIN_IMAGE_MEMORY_BINDING must also be defined. +#endif + +#if defined(ENABLE_MGPU_SUPPORT) + #if !defined(USE_LOCAL_AFR_PRESENTATION_MODE) && !defined(USE_LOCAL_SFR_PRESENTATION_MODE) && !defined(USE_REMOTE_AFR_PRESENTATION_MODE) && !defined(USE_SUM_SFR_PRESENTATION_MODE) + #error One of the USE_*_PRESENTATION_MODE #defines need to be commented out. + #endif +#endif + +#if defined(USE_LOCAL_AFR_PRESENTATION_MODE) + #if defined(USE_LOCAL_SFR_PRESENTATION_MODE) || defined(USE_REMOTE_AFR_PRESENTATION_MODE) || defined(USE_SUM_SFR_PRESENTATION_MODE) + #error More than one presentation mode #defines enabled. + #endif + + #if !defined(ENABLE_MGPU_SUPPORT) + #error If USE_LOCAL_AFR_PRESENTATION_MODE is enabled, ENABLE_MGPU_SUPPORT must also be defined. + #endif +#endif + +#if defined(USE_LOCAL_SFR_PRESENTATION_MODE) + #if defined(USE_LOCAL_AFR_PRESENTATION_MODE) || defined(USE_REMOTE_AFR_PRESENTATION_MODE) || defined(USE_SUM_SFR_PRESENTATION_MODE) + #error More than one presentation mode #defines enabled. + #endif + + #if !defined(ENABLE_MGPU_SUPPORT) + #error If USE_LOCAL_SFR_PRESENTATION_MODE is enabled, ENABLE_MGPU_SUPPORT must also be defined. + #endif +#endif + +#if defined(USE_REMOTE_AFR_PRESENTATION_MODE) + #if defined(USE_LOCAL_AFR_PRESENTATION_MODE) || defined(USE_LOCAL_SFR_PRESENTATION_MODE) || defined(USE_SUM_SFR_PRESENTATION_MODE) + #error More than one presentation mode #defines enabled. + #endif + + #if !defined(ENABLE_MGPU_SUPPORT) + #error If USE_REMOTE_AFR_PRESENTATION_MODE is enabled, ENABLE_MGPU_SUPPORT must also be defined. + #endif +#endif + +#if defined(USE_SUM_SFR_PRESENTATION_MODE) + #if defined(USE_LOCAL_AFR_PRESENTATION_MODE) || defined(USE_LOCAL_SFR_PRESENTATION_MODE) || defined(USE_REMOTE_AFR_PRESENTATION_MODE) + #error More than one presentation mode #defines enabled. + #endif + + #if !defined(ENABLE_MGPU_SUPPORT) + #error If USE_SUM_SFR_PRESENTATION_MODE is enabled, ENABLE_MGPU_SUPPORT must also be defined. + #endif +#endif + #if defined(_WIN32) #if !defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) && !defined(ENABLE_OFFSCREEN_RENDERING) #error Anvil has not been built with Win32/64 window system support. The application can only be built in offscreen rendering mode. @@ -176,6 +286,12 @@ App::App() m_n_frames_drawn ( 0), m_n_indices ( 0), m_n_last_semaphore_used (-1), +#if defined(USE_LOCAL_AFR_PRESENTATION_MODE) || defined(USE_REMOTE_AFR_PRESENTATION_MODE) + m_n_rendering_physical_device(0), +#endif +#if defined(USE_LOCAL_SFR_PRESENTATION_MODE) + m_n_presenting_physical_device(0), +#endif m_n_swapchain_images (N_SWAPCHAIN_IMAGES), m_ooo_disabled_pipeline_id (-1), m_ooo_enabled (false), @@ -236,6 +352,15 @@ void App::deinit() } } + #if defined(ENABLE_MGPU_SUPPORT) + m_frame_acquisition_wait_semaphores.clear(); + #endif + + #if defined(ENABLE_EXPLICIT_SWAPCHAIN_IMAGE_MEMORY_BINDING) + m_swapchain_image_views.clear(); + m_swapchain_images.clear(); + #endif + m_dsg_ptrs.clear(); m_frame_signal_semaphore_bundles.clear(); m_frame_wait_semaphore_bundles.clear(); @@ -245,6 +370,14 @@ void App::deinit() m_render_cmdbuffers_ooo_off.clear(); m_renderpasses.clear(); + #if defined(ENABLE_MGPU_SUPPORT) + m_dummy_cmdbuffer_ptr.reset(); + #endif + + #if defined(USE_LOCAL_SFR_PRESENTATION_MODE) + m_swapchain_peer_images_per_physical_device.clear(); + #endif + m_depth_image_ptr.reset(); m_depth_image_view_ptr.reset(); m_fs_entrypoint_ptr.reset(); @@ -279,6 +412,20 @@ void App::draw_frame() switch (device_type) { + case Anvil::DeviceType::MULTI_GPU: + { + const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr.get() ) ); + + n_physical_devices = mgpu_device_ptr->get_n_physical_devices(); + physical_devices_ptr = mgpu_device_ptr->get_physical_devices (); + + #if defined(USE_LOCAL_AFR_PRESENTATION_MODE) || defined(USE_REMOTE_AFR_PRESENTATION_MODE) + m_n_rendering_physical_device = (m_n_rendering_physical_device + 1) % n_physical_devices; + #endif + + break; + } + case Anvil::DeviceType::SINGLE_GPU: { const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr.get() ) ); @@ -299,18 +446,36 @@ void App::draw_frame() /* Determine the signal + wait semaphores to use for drawing this frame */ m_n_last_semaphore_used = (m_n_last_semaphore_used + 1) % m_n_swapchain_images; - auto& curr_frame_signal_semaphores_ptr = m_frame_signal_semaphore_bundles.at (m_n_last_semaphore_used); - auto& curr_frame_wait_semaphores_ptr = m_frame_wait_semaphore_bundles.at (m_n_last_semaphore_used); - auto& curr_frame_acqusition_wait_semaphore_ptr = curr_frame_wait_semaphores_ptr->semaphores.at(0); + auto& curr_frame_signal_semaphores_ptr = m_frame_signal_semaphore_bundles.at (m_n_last_semaphore_used); + auto& curr_frame_wait_semaphores_ptr = m_frame_wait_semaphore_bundles.at (m_n_last_semaphore_used); - const auto& present_wait_semaphores_ptr = curr_frame_signal_semaphores_ptr; + #if defined(ENABLE_MGPU_SUPPORT) + const auto& curr_frame_acqusition_wait_semaphore_ptr = m_frame_acquisition_wait_semaphores[m_n_last_semaphore_used]; + #else + auto& curr_frame_acqusition_wait_semaphore_ptr = curr_frame_wait_semaphores_ptr->semaphores.at(0); + #endif /* Determine the semaphore which the swapchain image */ + #if !defined(ENABLE_MGPU_SUPPORT) || defined(USE_LOCAL_SFR_PRESENTATION_MODE) || defined(USE_SUM_SFR_PRESENTATION_MODE) + { + const auto acquire_result = m_swapchain_ptr->acquire_image(curr_frame_acqusition_wait_semaphore_ptr.get(), + &n_swapchain_image, + true); /* in_should_block */ + + ANVIL_REDUNDANT_VARIABLE_CONST(acquire_result); + anvil_assert (acquire_result == Anvil::SwapchainOperationErrorCode::SUCCESS); + } + #elif defined(USE_LOCAL_AFR_PRESENTATION_MODE) || defined(USE_REMOTE_AFR_PRESENTATION_MODE) { m_swapchain_ptr->acquire_image(curr_frame_acqusition_wait_semaphore_ptr.get(), + 1, /* n_mgpu_physical_device */ + &physical_devices_ptr[m_n_rendering_physical_device], &n_swapchain_image, true); /* in_should_block */ } + #else + #error Not supported? + #endif /* Set up semaphores we're going to use to render this frame. */ anvil_assert(n_physical_devices < sizeof(frame_ready_to_render_submissions) / sizeof(frame_ready_to_render_submissions[0]) ); @@ -328,6 +493,64 @@ void App::draw_frame() frame_ready_to_render_submissions[n_signal_sem].semaphore_ptr = curr_frame_wait_semaphores_ptr->semaphores[n_signal_sem].get(); } + #if defined(ENABLE_MGPU_SUPPORT) + { + Anvil::CommandBufferMGPUSubmission dummy_submission; + Anvil::SemaphoreMGPUSubmission wait_semaphore_submission; + + #if defined(USE_LOCAL_AFR_PRESENTATION_MODE) || defined(USE_REMOTE_AFR_PRESENTATION_MODE) + { + wait_semaphore_submission.device_index = m_n_rendering_physical_device; + } + #elif defined(USE_LOCAL_SFR_PRESENTATION_MODE) || defined(USE_SUM_SFR_PRESENTATION_MODE) + { + /* It shouldn't matter which physical device we wait on for the frame acquisition semaphore. */ + wait_semaphore_submission.device_index = 0; + } + #else + #error Not supported? + #endif + + wait_semaphore_submission.semaphore_ptr = curr_frame_acqusition_wait_semaphore_ptr.get(); + + #if defined(USE_LOCAL_AFR_PRESENTATION_MODE) || defined(USE_REMOTE_AFR_PRESENTATION_MODE) + { + dummy_submission.cmd_buffer_ptr = m_dummy_cmdbuffer_ptr.get(); + dummy_submission.device_mask = (1 << m_n_rendering_physical_device); + + m_present_queue_ptr->submit( + Anvil::SubmitInfo::create_wait_execute_signal(&dummy_submission, + 1, /* n_command_buffer_submissions */ + 1, /* n_signal_semaphore_submissions */ + frame_ready_to_render_submissions + m_n_rendering_physical_device, + 1, /* n_wait_semaphore_submissions */ + &wait_semaphore_submission, + &dst_stage_mask, + false) /* should_block */ + ); + } + #elif defined(USE_LOCAL_SFR_PRESENTATION_MODE) || defined(USE_SUM_SFR_PRESENTATION_MODE) + { + dummy_submission.cmd_buffer_ptr = m_dummy_cmdbuffer_ptr.get(); + dummy_submission.device_mask = (1 << n_physical_devices) - 1; + + m_present_queue_ptr->submit( + Anvil::SubmitInfo::create_wait_execute_signal(&dummy_submission, + 1, /* n_command_buffer_submissions */ + n_physical_devices, /* n_signal_semaphore_submissions */ + frame_ready_to_render_submissions, + 1, /* n_wait_semaphore_submissions */ + &wait_semaphore_submission, + &dst_stage_mask, + false) /* should_block */ + ); + } + #else + #error Not supported? + #endif + } + #endif + /* if the frame has already been rendered to in the past, then given the fact we use FIFO presentation mode, * we should be safe to extract the timestamps which must have been written by now. */ @@ -335,15 +558,40 @@ void App::draw_frame() { uint64_t timestamps[2]; /* top of pipe, bottom of pipe */ + #if defined(ENABLE_MGPU_SUPPORT) + { + /* See ENABLE_MGPU_SUPPORT documentation for more details reg. the assertion check below. */ + anvil_assert(n_physical_devices == N_SWAPCHAIN_IMAGES); + } + #endif + /* TODO: Do better than this. */ Anvil::Vulkan::vkDeviceWaitIdle(m_device_ptr->get_device_vk() ); + #if !defined(ENABLE_MGPU_SUPPORT) || (!defined(USE_SUM_SFR_PRESENTATION_MODE) && !defined(USE_LOCAL_SFR_PRESENTATION_MODE) ) + const uint32_t n_iterations = 1; + #elif defined(USE_LOCAL_SFR_PRESENTATION_MODE) || defined(USE_SUM_SFR_PRESENTATION_MODE) + const uint32_t n_iterations = n_physical_devices; + #endif + + for (uint32_t n_iteration = 0; + n_iteration < n_iterations; + ++n_iteration) { + #if !defined(ENABLE_MGPU_SUPPORT) || defined(USE_LOCAL_SFR_PRESENTATION_MODE) || defined(USE_SUM_SFR_PRESENTATION_MODE) + auto device_mask = (1 << n_iteration); + #else + auto device_mask = (1 << m_n_rendering_physical_device); + #endif + m_query_results_buffer_ptr->read(n_swapchain_image * sizeof(uint64_t) * 2, /* top of pipe, bottom of pipe */ sizeof(timestamps), +#if defined(ENABLE_MGPU_SUPPORT) + device_mask, +#endif timestamps); - anvil_assert(timestamps[1] != timestamps[0]); + // anvil_assert(timestamps[1] != timestamps[0]); m_timestamp_deltas.push_back(timestamps[1] - timestamps[0]); } @@ -360,13 +608,38 @@ void App::draw_frame() /* Submit work chunks and present */ if (m_ooo_enabled) { - render_cmdbuffer_ptr = m_render_cmdbuffers_ooo_on.at(n_swapchain_image).get(); + #if defined(ENABLE_MGPU_SUPPORT) + #if defined(USE_LOCAL_SFR_PRESENTATION_MODE) || defined(USE_SUM_SFR_PRESENTATION_MODE) + anvil_assert(m_render_cmdbuffers_ooo_on.size() == 1); + + render_cmdbuffer_ptr = m_render_cmdbuffers_ooo_on.at(0).at(n_swapchain_image).get(); + #elif defined(USE_LOCAL_AFR_PRESENTATION_MODE) || defined(USE_REMOTE_AFR_PRESENTATION_MODE) + render_cmdbuffer_ptr = m_render_cmdbuffers_ooo_on.at(m_n_rendering_physical_device).at(n_swapchain_image).get(); + #else + #error Not supported? + #endif + #else + render_cmdbuffer_ptr = m_render_cmdbuffers_ooo_on.at(n_swapchain_image).get(); + #endif } else { - render_cmdbuffer_ptr = m_render_cmdbuffers_ooo_off.at(n_swapchain_image).get(); + #if defined(ENABLE_MGPU_SUPPORT) + #if defined(USE_LOCAL_SFR_PRESENTATION_MODE) || defined(USE_SUM_SFR_PRESENTATION_MODE) + anvil_assert(m_render_cmdbuffers_ooo_on.size() == 1); + + render_cmdbuffer_ptr = m_render_cmdbuffers_ooo_off.at(0).at(n_swapchain_image).get(); + #elif defined(USE_LOCAL_AFR_PRESENTATION_MODE) || defined(USE_REMOTE_AFR_PRESENTATION_MODE) + render_cmdbuffer_ptr = m_render_cmdbuffers_ooo_off.at(m_n_rendering_physical_device).at(n_swapchain_image).get(); + #else + #error Not supported? + #endif + #else + render_cmdbuffer_ptr = m_render_cmdbuffers_ooo_off.at(n_swapchain_image).get(); + #endif } + #if !defined(ENABLE_MGPU_SUPPORT) { m_present_queue_ptr->submit( Anvil::SubmitInfo::create_wait_execute_signal(render_cmdbuffer_ptr, @@ -378,7 +651,49 @@ void App::draw_frame() false /* should_block */) ); } + #else + { + Anvil::CommandBufferMGPUSubmission cmd_buffer_submission; + + cmd_buffer_submission.cmd_buffer_ptr = render_cmdbuffer_ptr; + + #if defined(USE_LOCAL_AFR_PRESENTATION_MODE) || defined(USE_REMOTE_AFR_PRESENTATION_MODE) + { + cmd_buffer_submission.device_mask = (1 << m_n_rendering_physical_device); + + m_present_queue_ptr->submit( + Anvil::SubmitInfo::create_wait_execute_signal(&cmd_buffer_submission, + 1, /* n_command_buffer_submissions */ + 1, /* n_signal_semaphore_submissions */ + frame_ready_for_present_submissions + m_n_rendering_physical_device, + 1, /* n_wait_semaphore_submissions */ + frame_ready_to_render_submissions + m_n_rendering_physical_device, + &wait_stage_mask, + false /* should_block */) + ); + } + #elif defined(USE_LOCAL_SFR_PRESENTATION_MODE) || defined(USE_SUM_SFR_PRESENTATION_MODE) + { + cmd_buffer_submission.device_mask = (1 << n_physical_devices) - 1; + + m_present_queue_ptr->submit( + Anvil::SubmitInfo::create_wait_execute_signal(&cmd_buffer_submission, + 1, /* n_command_buffer_submissions */ + n_physical_devices, + frame_ready_for_present_submissions, + n_physical_devices, /* n_wait_semaphore_submissions */ + frame_ready_to_render_submissions, + &wait_stage_mask, + false /* should_block */) + ); + } + #else + #error Not supported? + #endif + } + #endif + #if !defined(ENABLE_MGPU_SUPPORT) { Anvil::SwapchainOperationErrorCode present_result = Anvil::SwapchainOperationErrorCode::DEVICE_LOST; @@ -391,6 +706,80 @@ void App::draw_frame() ANVIL_REDUNDANT_VARIABLE(present_result); anvil_assert (present_result == Anvil::SwapchainOperationErrorCode::SUCCESS); } + #else + { + #if defined(USE_LOCAL_AFR_PRESENTATION_MODE) || defined(USE_LOCAL_SFR_PRESENTATION_MODE) + { + const Anvil::MGPUDevice* mgpu_device_ptr (dynamic_cast(m_device_ptr.get() )); + Anvil::SwapchainOperationErrorCode present_result (Anvil::SwapchainOperationErrorCode::DEVICE_LOST); + Anvil::LocalModePresentationItem presentation_item; + const Anvil::PhysicalDevice* presenting_physical_device_ptr (nullptr); + Anvil::Semaphore* wait_semaphore_ptr (nullptr); + + #if defined(USE_LOCAL_SFR_PRESENTATION_MODE) + presenting_physical_device_ptr = mgpu_device_ptr->get_physical_device(m_n_presenting_physical_device); + wait_semaphore_ptr = frame_ready_for_present_semaphores[m_n_presenting_physical_device]; + #else + presenting_physical_device_ptr = mgpu_device_ptr->get_physical_device(m_n_rendering_physical_device); + wait_semaphore_ptr = frame_ready_for_present_semaphores[m_n_rendering_physical_device]; + #endif + + presentation_item.physical_device_ptr = presenting_physical_device_ptr; + presentation_item.swapchain_image_index = n_swapchain_image; + presentation_item.swapchain_ptr = m_swapchain_ptr.get(); + + m_present_queue_ptr->present_in_local_presentation_mode(1, + &presentation_item, + 1, /* n_wait_semaphores */ + &wait_semaphore_ptr, + &present_result); + + ANVIL_REDUNDANT_VARIABLE(present_result); + anvil_assert (present_result == Anvil::SwapchainOperationErrorCode::SUCCESS); + } + #elif defined(USE_REMOTE_AFR_PRESENTATION_MODE) + { + const Anvil::MGPUDevice* mgpu_device_ptr (dynamic_cast(m_device_ptr.get() )); + Anvil::SwapchainOperationErrorCode present_result (Anvil::SwapchainOperationErrorCode::DEVICE_LOST); + Anvil::RemoteModePresentationItem presentation_item; + + presentation_item.physical_device_ptr = mgpu_device_ptr->get_physical_device(m_n_rendering_physical_device); + presentation_item.swapchain_image_index = n_swapchain_image; + presentation_item.swapchain_ptr = m_swapchain_ptr.get(); + + m_present_queue_ptr->present_in_remote_presentation_mode(1, /* n_remote_mode_presentation_items */ + &presentation_item, + 1, /* n_wait_semaphores */ + frame_ready_for_present_semaphores + m_n_rendering_physical_device, + &present_result); + + ANVIL_REDUNDANT_VARIABLE(present_result); + anvil_assert (present_result == Anvil::SwapchainOperationErrorCode::SUCCESS); + } + #elif defined(USE_SUM_SFR_PRESENTATION_MODE) + { + Anvil::SwapchainOperationErrorCode present_result = Anvil::SwapchainOperationErrorCode::DEVICE_LOST; + Anvil::SumModePresentationItem presentation_item; + + presentation_item.n_physical_devices = n_physical_devices; + presentation_item.physical_devices_ptr = physical_devices_ptr; + presentation_item.swapchain_image_index = n_swapchain_image; + presentation_item.swapchain_ptr = m_swapchain_ptr.get(); + + m_present_queue_ptr->present_in_sum_presentation_mode(1, /* n_sum_mode_presentation_items */ + &presentation_item, + n_physical_devices, /* n_wait_semaphores */ + frame_ready_for_present_semaphores, + &present_result); + + ANVIL_REDUNDANT_VARIABLE(present_result); + anvil_assert (present_result == Anvil::SwapchainOperationErrorCode::SUCCESS); + } + #else + #error You must enable one of the USE_*_PRESENTATION_MODE #defines. + #endif + } + #endif ++m_n_frames_drawn; @@ -406,6 +795,103 @@ void App::draw_frame() #endif } +#if defined(ENABLE_MGPU_SUPPORT) + +std::vector App::get_render_areas(uint32_t in_afr_render_index) const +{ + const Anvil::MGPUDevice* mgpu_device_locked_ptr(dynamic_cast(m_device_ptr.get() )); + const uint32_t n_physical_devices (mgpu_device_locked_ptr->get_n_physical_devices() ); + std::vector render_areas; + bool result; + VkExtent2D sfr_tile_size; + VkExtent2D split_chunk_size; + const uint32_t window_height (m_window_ptr->get_height_at_creation_time()); + const uint32_t window_width (m_window_ptr->get_width_at_creation_time () ); + + if ((m_swapchain_ptr->get_create_info_ptr()->get_flags() & Anvil::SwapchainCreateFlagBits::SPLIT_INSTANCE_BIND_REGIONS_BIT) != 0) + { + result = m_swapchain_ptr->get_image(0)->get_SFR_tile_size(&sfr_tile_size); + anvil_assert(result); + } + else + { + /* SFR is disabled - we don't need to follow any specific alignment requirements */ + anvil_assert((window_width % n_physical_devices) == 0); + + sfr_tile_size.width = window_width / n_physical_devices; + sfr_tile_size.height = window_height; + } + + split_chunk_size.width = Anvil::Utils::round_up(window_width / n_physical_devices, sfr_tile_size.width); + split_chunk_size.height = Anvil::Utils::round_up(window_height, sfr_tile_size.height); + + #if defined(USE_LOCAL_SFR_PRESENTATION_MODE) || defined(USE_SUM_SFR_PRESENTATION_MODE) + { + for (uint32_t n_render_area = 0; + n_render_area < n_physical_devices; + ++n_render_area) + { + /* Split the frame vertically. Make sure the render area never exceeds the framebuffer's extent. */ + VkRect2D render_area_chunk; + + render_area_chunk.offset.x = n_render_area * split_chunk_size.width; + render_area_chunk.offset.y = 0; + render_area_chunk.extent.height = split_chunk_size.height; + render_area_chunk.extent.width = split_chunk_size.width; + + if (render_area_chunk.offset.x + render_area_chunk.extent.width > window_width) + { + render_area_chunk.extent.width = window_width - render_area_chunk.offset.x; + } + + if (render_area_chunk.offset.y + render_area_chunk.extent.height > window_height) + { + render_area_chunk.extent.height = window_height - render_area_chunk.offset.y; + } + + render_areas.push_back(render_area_chunk); + } + } + #elif defined(USE_LOCAL_AFR_PRESENTATION_MODE) || defined(USE_REMOTE_AFR_PRESENTATION_MODE) + { + VkRect2D dummy_render_area; + VkRect2D render_area; + + dummy_render_area.extent.height = 0; + dummy_render_area.extent.width = 0; + dummy_render_area.offset.x = 0; + dummy_render_area.offset.y = 0; + + render_area.extent.width = window_width; + render_area.extent.height = window_height; + render_area.offset.x = 0; + render_area.offset.y = 0; + + for (uint32_t n_pre_physical_device = 0; + n_pre_physical_device < in_afr_render_index; + ++n_pre_physical_device) + { + render_areas.push_back(dummy_render_area); + } + + render_areas.push_back(render_area); + + for (uint32_t n_post_physical_device = in_afr_render_index + 1; + n_post_physical_device < n_physical_devices; + ++n_post_physical_device) + { + render_areas.push_back(dummy_render_area); + } + } + #else + #error Not supported? + #endif + + return render_areas; +} + +#endif + void App::init() { init_vulkan (); @@ -432,7 +918,8 @@ void App::init_buffers() const VkDeviceSize index_data_size = data.get_index_data_size(); const VkDeviceSize properties_data_size = N_TEAPOTS * sizeof(float) * 8; /* rot_xyzX + pos_xyzX */ - const Anvil::MemoryFeatureFlags required_feature_flags = Anvil::MemoryFeatureFlagBits::NONE; + const Anvil::MemoryFeatureFlags required_feature_flags = (device_type == Anvil::DeviceType::SINGLE_GPU) ? Anvil::MemoryFeatureFlagBits::NONE + : Anvil::MemoryFeatureFlagBits::MULTI_INSTANCE_BIT; Anvil::MGPUPeerMemoryRequirements required_peer_memory_feature_flags; const VkDeviceSize vertex_data_size = data.get_vertex_data_size(); @@ -545,13 +1032,28 @@ void App::init_command_buffers() anvil_assert (m_render_cmdbuffers_ooo_on.size() == 0); anvil_assert (m_renderpasses.size() == n_swapchain_images); - const uint32_t n_physical_device_iterations(1); - VkRect2D render_area; + #if defined(ENABLE_MGPU_SUPPORT) + const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr.get() ) ); + #if !defined(USE_LOCAL_AFR_PRESENTATION_MODE) + std::vector render_areas (get_render_areas() ); + #endif + + #if defined(USE_LOCAL_AFR_PRESENTATION_MODE) || defined(USE_REMOTE_AFR_PRESENTATION_MODE) + const uint32_t n_physical_device_iterations(mgpu_device_ptr->get_n_physical_devices() ); + #elif defined(USE_LOCAL_SFR_PRESENTATION_MODE) || defined(USE_SUM_SFR_PRESENTATION_MODE) + const uint32_t n_physical_device_iterations(1); + #else + #error Not supported? + #endif + #else + const uint32_t n_physical_device_iterations(1); + VkRect2D render_area; - render_area.extent.height = m_window_ptr->get_height_at_creation_time(); - render_area.extent.width = m_window_ptr->get_width_at_creation_time (); - render_area.offset.x = 0; - render_area.offset.y = 0; + render_area.extent.height = m_window_ptr->get_height_at_creation_time(); + render_area.extent.width = m_window_ptr->get_width_at_creation_time (); + render_area.offset.x = 0; + render_area.offset.y = 0; + #endif clear_values[0].color.float32[0] = 0.0f; clear_values[0].color.float32[1] = 1.0f; @@ -563,6 +1065,10 @@ void App::init_command_buffers() n_physical_device_iteration < n_physical_device_iterations; ++n_physical_device_iteration) { + #if defined(ENABLE_MGPU_SUPPORT) && defined (USE_LOCAL_AFR_PRESENTATION_MODE) + std::vector render_areas(get_render_areas(n_physical_device_iteration)); + #endif + for (uint32_t n_ooo_iteration = 0; n_ooo_iteration < 2; /* off, on */ ++n_ooo_iteration) @@ -572,8 +1078,13 @@ void App::init_command_buffers() : m_ooo_disabled_pipeline_id; Anvil::PipelineLayout* pipeline_layout_ptr = gfx_manager_ptr->get_pipeline_layout(pipeline_id); - std::vector& render_cmdbuffers = (is_ooo_enabled) ? m_render_cmdbuffers_ooo_on - : m_render_cmdbuffers_ooo_off; + #if defined(ENABLE_MGPU_SUPPORT) + std::vector& render_cmdbuffers = (is_ooo_enabled) ? m_render_cmdbuffers_ooo_on [n_physical_device_iteration] + : m_render_cmdbuffers_ooo_off[n_physical_device_iteration]; + #else + std::vector& render_cmdbuffers = (is_ooo_enabled) ? m_render_cmdbuffers_ooo_on + : m_render_cmdbuffers_ooo_off; + #endif for (uint32_t n_render_cmdbuffer = 0; n_render_cmdbuffer < n_swapchain_images; @@ -610,6 +1121,13 @@ void App::init_command_buffers() { clear_values[0].color.float32[0] = (is_ooo_enabled) ? 1.0f : 0.0f; + #if 1 + /* Useful if you need to visually determine which GPU rendered which frame. */ + #if defined(USE_LOCAL_AFR_PRESENTATION_MODE) || defined(USE_REMOTE_AFR_PRESENTATION_MODE) + clear_values[0].color.float32[2] = float(n_physical_device_iteration) / (n_physical_device_iterations - 1); + #endif + #endif + cmdbuffer_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::HOST_BIT, Anvil::PipelineStageFlagBits::VERTEX_SHADER_BIT, Anvil::DependencyFlagBits::NONE, @@ -624,6 +1142,7 @@ void App::init_command_buffers() m_query_pool_ptr.get(), n_render_cmdbuffer * 2 /* top of pipe, bottom of pipe*/ + 0); + #if !defined(ENABLE_MGPU_SUPPORT) { cmdbuffer_ptr->record_begin_render_pass(sizeof(clear_values) / sizeof(clear_values[0]), clear_values, @@ -632,8 +1151,39 @@ void App::init_command_buffers() renderpass_ptr, Anvil::SubpassContents::INLINE); } + #else + { + const Anvil::MGPUDevice* mgpu_device_ptr (dynamic_cast(m_device_ptr.get() )); + const auto& render_areas_ptr(&render_areas.at(0) ); + + #if defined(USE_LOCAL_SFR_PRESENTATION_MODE) || defined(USE_SUM_SFR_PRESENTATION_MODE) || defined(USE_LOCAL_AFR_PRESENTATION_MODE) || defined(USE_REMOTE_AFR_PRESENTATION_MODE) + const uint32_t device_mask = (1 << mgpu_device_ptr->get_n_physical_devices()) - 1; + #else + #error Not supported? + #endif + + anvil_assert(render_areas.size() == mgpu_device_ptr->get_n_physical_devices()); + + cmdbuffer_ptr->record_begin_render_pass(sizeof(clear_values) / sizeof(clear_values[0]), + clear_values, + framebuffer_ptr, + device_mask, + static_cast(render_areas.size()), + render_areas_ptr, + renderpass_ptr, + Anvil::SubpassContents::INLINE); + } + #endif { - const uint32_t n_physical_devices(1); + #if defined(USE_LOCAL_SFR_PRESENTATION_MODE) || defined(USE_SUM_SFR_PRESENTATION_MODE) + const uint32_t n_physical_devices(mgpu_device_ptr->get_n_physical_devices()); + const Anvil::PhysicalDevice* const* physical_devices (mgpu_device_ptr->get_physical_devices ()); + #elif defined(USE_LOCAL_AFR_PRESENTATION_MODE) || defined(USE_REMOTE_AFR_PRESENTATION_MODE) + const uint32_t n_physical_devices(1); + const Anvil::PhysicalDevice* const* physical_devices (mgpu_device_ptr->get_physical_devices () + n_physical_device_iteration); + #else + const uint32_t n_physical_devices(1); + #endif cmdbuffer_ptr->record_bind_pipeline(Anvil::PipelineBindPoint::GRAPHICS, pipeline_id); @@ -658,6 +1208,37 @@ void App::init_command_buffers() n_physical_device < n_physical_devices; ++n_physical_device) { + #if defined(ENABLE_MGPU_SUPPORT) + { + #if defined(USE_LOCAL_AFR_PRESENTATION_MODE) + VkRect2D scissor = render_areas.at(n_physical_device_iteration); + #else + VkRect2D scissor = render_areas.at(n_physical_device); + #endif + VkViewport viewport; + + viewport.height = static_cast(scissor.extent.height); + viewport.maxDepth = 1.0f; + viewport.minDepth = 0.0f; + viewport.width = static_cast(WINDOW_WIDTH); + viewport.x = 0.0f; + viewport.y = 0.0f; + + #if defined(USE_LOCAL_SFR_PRESENTATION_MODE) || defined(USE_SUM_SFR_PRESENTATION_MODE) + { + cmdbuffer_ptr->record_set_device_mask_KHR(1 << n_physical_device); + } + #endif + + cmdbuffer_ptr->record_set_scissor (0, /* in_first_scissor */ + 1, /* in_scissor_count */ + &scissor); + cmdbuffer_ptr->record_set_viewport(0, /* in_first_viewport */ + 1, /* in_viewport_count */ + &viewport); + } + #endif + /* Draw the teapots! */ cmdbuffer_ptr->record_draw_indexed(m_n_indices, N_TEAPOTS, /* in_instance_count */ @@ -668,6 +1249,135 @@ void App::init_command_buffers() } cmdbuffer_ptr->record_end_render_pass(); + #if defined(USE_LOCAL_SFR_PRESENTATION_MODE) + { + /* Once all GPUs have finished rendering, we need to copy all content rendered by non-presenting + * devices to the presenting device's swapchain image instance. */ + std::vector image_barriers_pre; + const uint32_t n_total_physical_devices(mgpu_device_ptr->get_n_physical_devices() ); + + /* First, submit all the barriers we're going to need to submit before we can use the copy op. */ + for (uint32_t n_current_physical_device = 0; + n_current_physical_device < n_total_physical_devices; + ++n_current_physical_device) + { + cmdbuffer_ptr->record_set_device_mask_KHR(1 << n_current_physical_device); + + if (n_current_physical_device == m_n_presenting_physical_device) + { + const Anvil::ImageBarrier renderable_to_dst_transferrable_layout_barrier(Anvil::AccessFlagBits::COLOR_ATTACHMENT_WRITE_BIT, + Anvil::AccessFlagBits::TRANSFER_WRITE_BIT, + Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::TRANSFER_DST_OPTIMAL, + VK_QUEUE_FAMILY_IGNORED, + VK_QUEUE_FAMILY_IGNORED, + m_swapchain_ptr->get_image(n_render_cmdbuffer), + m_swapchain_ptr->get_image(n_render_cmdbuffer)->get_subresource_range() ); + + cmdbuffer_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::COLOR_ATTACHMENT_OUTPUT_BIT, + Anvil::PipelineStageFlagBits::TRANSFER_BIT, + Anvil::DependencyFlagBits::BY_REGION_BIT, + 0, /* in_memory_barrier_count */ + nullptr, /* in_memory_barriers_ptr */ + 0, /* in_buffer_memory_barrier_count */ + nullptr, /* in_buffer_memory_barriers_ptr */ + 1, /* in_image_memory_barrier_count */ + &renderable_to_dst_transferrable_layout_barrier); + } + else + { + const auto src_image_ptr = m_swapchain_peer_images_per_physical_device.at(n_current_physical_device).peer_images.at(n_render_cmdbuffer).get(); + + const Anvil::ImageBarrier renderable_to_src_transferrable_layout_barrier(Anvil::AccessFlagBits::COLOR_ATTACHMENT_WRITE_BIT, + Anvil::AccessFlagBits::TRANSFER_READ_BIT, + Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, + Anvil::ImageLayout::TRANSFER_SRC_OPTIMAL, + VK_QUEUE_FAMILY_IGNORED, + VK_QUEUE_FAMILY_IGNORED, + src_image_ptr, + src_image_ptr->get_subresource_range() ); + + cmdbuffer_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::COLOR_ATTACHMENT_OUTPUT_BIT, + Anvil::PipelineStageFlagBits::TRANSFER_BIT, + Anvil::DependencyFlagBits::BY_REGION_BIT, + 0, /* in_memory_barrier_count */ + nullptr, /* in_memory_barriers_ptr */ + 0, /* in_buffer_memory_barrier_count */ + nullptr, /* in_buffer_memory_barriers_ptr */ + 1, /* in_image_memory_barrier_count */ + &renderable_to_src_transferrable_layout_barrier); + } + } + + /* Next, copy rendered image chunks to the swapchain image instance which is going to be presented. */ + const auto presentable_peer_image_ptr(m_swapchain_peer_images_per_physical_device.at(m_n_presenting_physical_device).peer_images.at(n_render_cmdbuffer).get() ); + + for (uint32_t n_current_physical_device = 0; + n_current_physical_device < n_total_physical_devices; + ++n_current_physical_device) + { + Anvil::ImageCopy copy_region; + const auto src_image_ptr = m_swapchain_peer_images_per_physical_device.at(n_current_physical_device).peer_images.at(n_render_cmdbuffer).get(); + const auto& src_render_area = render_areas[n_current_physical_device]; + + if (n_current_physical_device == m_n_presenting_physical_device) + { + continue; + } + + copy_region.dst_offset.x = src_render_area.offset.x; + copy_region.dst_offset.y = src_render_area.offset.y; + copy_region.dst_offset.z = 0; + copy_region.dst_subresource.aspect_mask = Anvil::ImageAspectFlagBits::COLOR_BIT; + copy_region.dst_subresource.base_array_layer = 0; + copy_region.dst_subresource.layer_count = 1; + copy_region.dst_subresource.mip_level = 0; + copy_region.extent.depth = 1; + copy_region.extent.height = src_render_area.extent.height; + copy_region.extent.width = src_render_area.extent.width; + copy_region.src_offset.x = src_render_area.offset.x; + copy_region.src_offset.y = src_render_area.offset.y; + copy_region.src_offset.z = 0; + copy_region.src_subresource = copy_region.dst_subresource; + + cmdbuffer_ptr->record_set_device_mask_KHR(1 << n_current_physical_device); + + cmdbuffer_ptr->record_copy_image(src_image_ptr, + Anvil::ImageLayout::TRANSFER_SRC_OPTIMAL, /* in_src_image_layout */ + presentable_peer_image_ptr, + Anvil::ImageLayout::TRANSFER_DST_OPTIMAL, /* in_dst_image_layout */ + 1, /* in_region_count */ + ©_region); + } + + /* Finally, transfer the swapchain image instance we are about to present to presentable layout. */ + const Anvil::ImageBarrier dst_transferrable_to_presentable_layout_barrier(Anvil::AccessFlagBits::TRANSFER_WRITE_BIT, + Anvil::AccessFlagBits::MEMORY_READ_BIT, + Anvil::ImageLayout::TRANSFER_DST_OPTIMAL, + Anvil::ImageLayout::PRESENT_SRC_KHR, + VK_QUEUE_FAMILY_IGNORED, + VK_QUEUE_FAMILY_IGNORED, + presentable_peer_image_ptr, + presentable_peer_image_ptr->get_subresource_range() ); + + cmdbuffer_ptr->record_pipeline_barrier(Anvil::PipelineStageFlagBits::TRANSFER_BIT, + Anvil::PipelineStageFlagBits::BOTTOM_OF_PIPE_BIT, + Anvil::DependencyFlagBits::BY_REGION_BIT, + 0, /* in_memory_barrier_count */ + nullptr, /* in_memory_barriers_ptr */ + 0, /* in_buffer_memory_barrier_count */ + nullptr, /* in_buffer_memory_barriers_ptr */ + 1, /* in_image_memory_barrier_count */ + &dst_transferrable_to_presentable_layout_barrier); + } + #endif + + #if defined(ENABLE_MGPU_SUPPORT) + { + cmdbuffer_ptr->record_set_device_mask_KHR((1 << mgpu_device_ptr->get_n_physical_devices()) - 1); + } + #endif + cmdbuffer_ptr->record_write_timestamp (Anvil::PipelineStageFlagBits::ALL_GRAPHICS_BIT, m_query_pool_ptr.get(), n_render_cmdbuffer * 2 /* top of pipe, bottom of pipe */ + 1); @@ -695,6 +1405,19 @@ void App::init_command_buffers() } } } + + #if defined(ENABLE_MGPU_SUPPORT) + { + m_dummy_cmdbuffer_ptr = mgpu_device_ptr->get_command_pool_for_queue_family_index(universal_queue_family_index)->alloc_primary_level_command_buffer(); + + m_dummy_cmdbuffer_ptr->start_recording(false, /* one_time_submit */ + true); /* simultaneous_use_allowed */ + { + /* Stub */ + } + m_dummy_cmdbuffer_ptr->stop_recording(); + } + #endif } void App::init_dsgs() @@ -767,6 +1490,16 @@ void App::init_gfx_pipelines() pipeline_create_info_ptr->set_descriptor_set_create_info(m_dsg_ptrs[0]->get_descriptor_set_create_info() ); + #ifdef ENABLE_MGPU_SUPPORT + { + pipeline_create_info_ptr->set_n_dynamic_scissor_boxes(1); + pipeline_create_info_ptr->set_n_dynamic_viewports (1); + + pipeline_create_info_ptr->toggle_dynamic_states(true, /* should_enable */ + {Anvil::DynamicState::SCISSOR, Anvil::DynamicState::VIEWPORT}); + } + #endif + pipeline_create_info_ptr->set_primitive_topology (Anvil::PrimitiveTopology::TRIANGLE_LIST); pipeline_create_info_ptr->set_rasterization_properties(Anvil::PolygonMode::FILL, Anvil::CullModeFlagBits::BACK_BIT, @@ -810,7 +1543,7 @@ void App::init_images() Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::SharingMode::EXCLUSIVE, false, /* in_use_full_mipmap_chain */ - Anvil::MemoryFeatureFlagBits::NONE, + (m_device_ptr->get_type() == Anvil::DeviceType::MULTI_GPU) ? Anvil::MemoryFeatureFlagBits::MULTI_INSTANCE_BIT : Anvil::MemoryFeatureFlagBits::NONE, Anvil::ImageCreateFlagBits::NONE, Anvil::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL, /* in_final_image_layout */ nullptr); /* in_mipmaps_ptr */ @@ -833,6 +1566,56 @@ void App::init_images() m_depth_image_view_ptr = Anvil::ImageView::create(std::move(create_info_ptr) ); } + + #if defined(USE_LOCAL_SFR_PRESENTATION_MODE) + { + const Anvil::MGPUDevice* mgpu_device_ptr (dynamic_cast(m_device_ptr.get() )); + const uint32_t n_physical_devices (mgpu_device_ptr->get_n_physical_devices() ); + std::vector device_group_indices (n_physical_devices); + + /* Create peer images. */ + for (uint32_t n_physical_device = 0; + n_physical_device < n_physical_devices; + ++n_physical_device) + { + SwapchainPeerImages* current_peer_image_set_ptr (nullptr); + + m_swapchain_peer_images_per_physical_device.push_back(SwapchainPeerImages() ); + + current_peer_image_set_ptr = &m_swapchain_peer_images_per_physical_device.back(); + + for (uint32_t n_device_index = 0; + n_device_index < n_physical_devices; + ++n_device_index) + { + /* We want all logical devices to be able to access n_physical_device's image instance + * through this peer image */ + device_group_indices.at(n_device_index) = n_physical_device; + } + + for (uint32_t n_swapchain_image = 0; + n_swapchain_image < m_n_swapchain_images; + ++n_swapchain_image) + { + Anvil::ImageUniquePtr peer_image_ptr; + + { + auto create_info_ptr = Anvil::ImageCreateInfo::create_peer_no_alloc(m_device_ptr.get (), + m_swapchain_ptr.get(), + n_swapchain_image); + + create_info_ptr->set_device_indices(n_physical_devices, + &device_group_indices.at(0) ); + + peer_image_ptr = Anvil::Image::create(std::move(create_info_ptr) ); + } + + current_peer_image_set_ptr->peer_images.push_back(std::move(peer_image_ptr) ); + } + } + + } + #endif } void App::init_query_pool() @@ -864,7 +1647,14 @@ void App::init_renderpasses() #ifndef ENABLE_OFFSCREEN_RENDERING Anvil::ImageLayout::UNDEFINED, + #if !defined(USE_LOCAL_SFR_PRESENTATION_MODE) Anvil::ImageLayout::PRESENT_SRC_KHR, + #else + /* In local SFR presentation mode, we want to avoid ->finalLayout transition, since some swapchain image instances + * will need to be switched to TRANSFER_SRC layout, and one of them to TRANSFER_DST. + */ + Anvil::ImageLayout::COLOR_ATTACHMENT_OPTIMAL, + #endif #else Anvil::ImageLayout::GENERAL, Anvil::ImageLayout::GENERAL, @@ -942,10 +1732,17 @@ void App::init_renderpasses() m_window_ptr->get_height_at_creation_time(), 1); /* n_layers */ + #if defined(ENABLE_EXPLICIT_SWAPCHAIN_IMAGE_MEMORY_BINDING) + { + create_info_ptr->add_attachment(m_swapchain_image_views.at(n_swapchain_image).get(), + nullptr); + } + #else { create_info_ptr->add_attachment(m_swapchain_ptr->get_image_view(n_swapchain_image), nullptr); } + #endif create_info_ptr->add_attachment(m_depth_image_view_ptr.get(), nullptr); @@ -968,6 +1765,15 @@ void App::init_semaphores() switch (m_device_ptr->get_type() ) { + case Anvil::DeviceType::MULTI_GPU: + { + const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr.get() ) ); + + n_physical_devices = mgpu_device_ptr->get_n_physical_devices(); + + break; + } + case Anvil::DeviceType::SINGLE_GPU: { n_physical_devices = 1; @@ -998,6 +1804,12 @@ void App::init_semaphores() new_frame_acquisition_wait_semaphore_ptr->set_name_formatted("New frame acquisition wait semaphore [%d]", n_swapchain_image); + #if defined(ENABLE_MGPU_SUPPORT) + { + m_frame_acquisition_wait_semaphores.push_back(std::move(new_frame_acquisition_wait_semaphore_ptr) ); + } + #endif + for (uint32_t n_physical_device = 0; n_physical_device < n_physical_devices; ++n_physical_device) @@ -1077,15 +1889,191 @@ void App::init_swapchain() static const Anvil::PresentModeKHR swapchain_present_mode(Anvil::PresentModeKHR::FIFO_KHR); static const Anvil::ImageUsageFlags swapchain_usage (Anvil::ImageUsageFlagBits::COLOR_ATTACHMENT_BIT | Anvil::ImageUsageFlagBits::TRANSFER_SRC_BIT | Anvil::ImageUsageFlagBits::TRANSFER_DST_BIT); - m_rendering_surface_ptr = Anvil::RenderingSurface::create(m_instance_ptr.get(), - m_device_ptr.get (), - m_window_ptr.get () ); + { + auto create_info_ptr = Anvil::RenderingSurfaceCreateInfo::create(m_instance_ptr.get(), + m_device_ptr.get (), + m_window_ptr.get () ); + + m_rendering_surface_ptr = Anvil::RenderingSurface::create(std::move(create_info_ptr) ); + } m_rendering_surface_ptr->set_name("Main rendering surface"); switch (m_device_ptr->get_type() ) { +#if defined(ENABLE_MGPU_SUPPORT) + case Anvil::DeviceType::MULTI_GPU: + { + Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr.get() ) ); + + #if defined(USE_SUM_SFR_PRESENTATION_MODE) + static const Anvil::DeviceGroupPresentModeFlagBits swapchain_device_group_present_mode(Anvil::DeviceGroupPresentModeFlagBits::SUM_BIT_KHR); + #elif defined(USE_LOCAL_AFR_PRESENTATION_MODE) || defined(USE_LOCAL_SFR_PRESENTATION_MODE) + static const Anvil::DeviceGroupPresentModeFlagBits swapchain_device_group_present_mode(Anvil::DeviceGroupPresentModeFlagBits::LOCAL_BIT_KHR); + #elif defined(USE_REMOTE_AFR_PRESENTATION_MODE) + static const Anvil::DeviceGroupPresentModeFlagBits swapchain_device_group_present_mode(Anvil::DeviceGroupPresentModeFlagBits::REMOTE_BIT_KHR); + #else + #error Not supported? + #endif + + anvil_assert((mgpu_device_ptr->get_supported_present_modes() & swapchain_device_group_present_mode) != 0); + + m_swapchain_ptr = mgpu_device_ptr->create_swapchain(m_rendering_surface_ptr.get(), + m_window_ptr.get (), + swapchain_format, + Anvil::ColorSpaceKHR::SRGB_NONLINEAR_KHR, + swapchain_present_mode, + swapchain_usage, + m_n_swapchain_images, +#if defined(ENABLE_EXPLICIT_SFR_RECT_DEFINITIONS) + true, /* support_SFR */ +#else + false, /* support_SFR */ +#endif + swapchain_device_group_present_mode); + + m_n_swapchain_images = m_swapchain_ptr->get_n_images(); + + #if defined(USE_LOCAL_AFR_PRESENTATION_MODE) || defined(USE_LOCAL_SFR_PRESENTATION_MODE) + { + /* This example app assumes all physical devices can be used to render & present their output + * using local presentation mode. Verify this assertion + */ + anvil_assert((mgpu_device_ptr->get_supported_present_modes_for_surface(m_rendering_surface_ptr.get() ) & Anvil::DeviceGroupPresentModeFlagBits::LOCAL_BIT_KHR) != 0); + } + #elif defined(USE_REMOTE_AFR_PRESENTATION_MODE) + /* This example app assumes all physical devices can be used to render & present their output + * using remote presentation mode. Verify this assertion + */ + anvil_assert((mgpu_device_ptr->get_supported_present_modes_for_surface(m_rendering_surface_ptr.get() ) & Anvil::DeviceGroupPresentModeFlagBits::REMOTE_BIT_KHR) != 0); + #elif defined(USE_SUM_SFR_PRESENTATION_MODE) + /* This example app assumes all physical devices can be used to render & present their output + * using sum presentation mode. Verify this assertion + */ + anvil_assert((mgpu_device_ptr->get_supported_present_modes_for_surface(m_rendering_surface_ptr.get() ) & Anvil::DeviceGroupPresentModeFlagBits::SUM_BIT_KHR) != 0); + #endif + + #if defined(ENABLE_EXPLICIT_SWAPCHAIN_IMAGE_MEMORY_BINDING) + { + for (uint32_t n_swapchain_image = 0; + n_swapchain_image < m_n_swapchain_images; + ++n_swapchain_image) + { + Anvil::ImageUniquePtr new_image_ptr; + Anvil::ImageViewUniquePtr new_image_view_ptr; + + #if defined(ENABLE_EXPLICIT_SFR_RECT_DEFINITIONS) + { + /* For split-frame rendering, the rendering surface is split into N vertical areas, where + * N corresponds to the number of logical devices. Since GPU at index X will always render + * only to a dedicated slab stored in its own memory instance, we are going to use dummy + * rects for all other cases. + * + * As a refresh, SFR rect at index i * N + j is the rectangle used by physical device i for memory instance j. + * + */ + const uint32_t n_logical_devices(mgpu_device_ptr->get_n_physical_devices() ); + const auto render_areas (get_render_areas() ); + std::vector sfr_rects (n_logical_devices * n_logical_devices); + + for (uint32_t n_logical_device = 0; + n_logical_device < n_logical_devices; + ++n_logical_device) + { + for (uint32_t n_memory_instance = 0; + n_memory_instance < n_logical_devices; + ++n_memory_instance) + { + const uint32_t n_sfr_rect = n_logical_device * n_logical_devices + n_memory_instance; + auto& current_sfr_rect = sfr_rects.at(n_sfr_rect); + + if (n_logical_device != n_memory_instance) + { + current_sfr_rect.extent.height = 0; + current_sfr_rect.extent.width = 0; + current_sfr_rect.offset.x = 0; + current_sfr_rect.offset.y = 0; + } + else + { + current_sfr_rect = render_areas.at(n_logical_device); + } + } + } + + { + auto create_info_ptr = Anvil::ImageCreateInfo::create_peer_no_alloc(m_device_ptr.get (), + m_swapchain_ptr.get(), + n_swapchain_image); + + create_info_ptr->set_SFR_rectangles(static_cast(sfr_rects.size() ), + &sfr_rects.at(0) ); + + new_image_ptr = Anvil::Image::create(std::move(create_info_ptr) ); + } + } + #else + { + /* No ISV would ever do this, right? */ + auto create_info_ptr = Anvil::ImageCreateInfo::create_peer_no_alloc(m_device_ptr.get (), + m_swapchain_ptr.get(), + n_swapchain_image); + + new_image_ptr = Anvil::Image::create(std::move(create_info_ptr) ); + } + #endif + + { + auto create_info_ptr = Anvil::ImageViewCreateInfo::create_2D(m_device_ptr.get (), + new_image_ptr.get(), + 0, /* n_base_layer */ + 0, /* n_base_mipmap_level */ + 1, /* n_mipmaps */ + Anvil::ImageAspectFlagBits::COLOR_BIT, + new_image_ptr->get_create_info_ptr()->get_format(), + Anvil::ComponentSwizzle::IDENTITY, + Anvil::ComponentSwizzle::IDENTITY, + Anvil::ComponentSwizzle::IDENTITY, + Anvil::ComponentSwizzle::IDENTITY); + + new_image_view_ptr = Anvil::ImageView::create(std::move(create_info_ptr) ); + } + + m_swapchain_image_views.push_back(std::move(new_image_view_ptr) ); + m_swapchain_images.push_back (std::move(new_image_ptr) ); + } + } + #endif + + /* Cache the queue we are going to use for presentation */ + for (uint32_t n_physical_device = 0; + n_physical_device < mgpu_device_ptr->get_n_physical_devices(); + ++n_physical_device) + { + const std::vector* present_queue_fams_ptr = nullptr; + + if (!m_rendering_surface_ptr->get_queue_families_with_present_support(mgpu_device_ptr->get_physical_device(n_physical_device), + &present_queue_fams_ptr) ) + { + continue; + } + + if (present_queue_fams_ptr->size() > 0) + { + m_present_queue_ptr = m_device_ptr->get_queue_for_queue_family_index(present_queue_fams_ptr->at(0), + 0); /* in_n_queue */ + + break; + } + } + + anvil_assert(m_present_queue_ptr != nullptr); + + break; + } +#endif /* ENABLE_MGPU_SUPPORT */ + case Anvil::DeviceType::SINGLE_GPU: { Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr.get() ) ); @@ -1169,15 +2157,36 @@ void App::init_vulkan() } /* Determine which extensions we need to request for */ + #if !defined(ENABLE_MGPU_SUPPORT) { /* Create a Vulkan device */ - m_device_ptr = Anvil::SGPUDevice::create(m_instance_ptr->get_physical_device(0), - true, /* in_enable_shader_module_cache */ - Anvil::DeviceExtensionConfiguration(), - std::vector(), /* in_layers */ - false, /* in_transient_command_buffer_allocs_only */ - false); /* in_support_resettable_command_buffers */ + auto create_info_ptr = Anvil::DeviceCreateInfo::create_sgpu(m_instance_ptr->get_physical_device(0), + true, /* in_enable_shader_module_cache */ + Anvil::DeviceExtensionConfiguration(), + std::vector(), /* in_layers */ + Anvil::CommandPoolCreateFlagBits::NONE, + false); /* in_mt_safe */ + + m_device_ptr = Anvil::SGPUDevice::create(std::move(create_info_ptr) ); } + #else + { + Anvil::DeviceExtensionConfiguration ext_config; + auto physical_devices = m_instance_ptr->get_physical_device_group(0).physical_device_ptrs; + + ext_config.extension_status[VK_KHR_DEVICE_GROUP_EXTENSION_NAME] = Anvil::ExtensionAvailability::REQUIRE; + ext_config.extension_status[VK_KHR_BIND_MEMORY_2_EXTENSION_NAME] = Anvil::ExtensionAvailability::REQUIRE; + + auto create_info_ptr = Anvil::DeviceCreateInfo::create_mgpu(physical_devices, + true, /* in_enable_shader_module_cache */ + ext_config, + std::vector(), /* layers */ + Anvil::CommandPoolCreateFlagBits::NONE, + false); /* in_mt_safe */ + + m_device_ptr = Anvil::MGPUDevice::create(std::move(create_info_ptr) ); + } + #endif } void App::on_keypress_event(Anvil::CallbackArgument* callback_data_raw_ptr) @@ -1262,7 +2271,11 @@ void App::update_fps() /* Print the new info */ clear_console_line(); - printf("Average FPS: %.3f", average_fps); + #if !defined(ENABLE_MGPU_SUPPORT) + printf("Average FPS: %.3f", average_fps); + #else + printf("Average FPS for all GPUs: %.3f", average_fps); + #endif /* Purge the timestamps */ m_timestamp_deltas.clear(); @@ -1332,7 +2345,7 @@ void App::update_teapot_props(uint32_t n_current_swapchain_image) } -int main() +int main(int argc, char *argv[]) { std::unique_ptr app_ptr(new App() ); diff --git a/examples/PushConstants/CMakeLists.txt b/examples/PushConstants/CMakeLists.txt index 8c319c92..6b679fd2 100644 --- a/examples/PushConstants/CMakeLists.txt +++ b/examples/PushConstants/CMakeLists.txt @@ -52,11 +52,10 @@ endif() # Create the PushConstants project. add_executable (PushConstants include/app.h - include/app.h - src/app.cpp) + src/app.cpp) # Add linking dependencies for the example projects -add_dependencies (PushConstants Anvil) +add_dependencies(PushConstants Anvil) if (WIN32) target_link_libraries(PushConstants Anvil) diff --git a/examples/PushConstants/src/app.cpp b/examples/PushConstants/src/app.cpp index e3c806bf..8740a43e 100644 --- a/examples/PushConstants/src/app.cpp +++ b/examples/PushConstants/src/app.cpp @@ -41,6 +41,7 @@ #include "misc/memory_allocator.h" #include "misc/object_tracker.h" #include "misc/render_pass_create_info.h" +#include "misc/rendering_surface_create_info.h" #include "misc/semaphore_create_info.h" #include "misc/swapchain_create_info.h" #include "misc/time.h" @@ -831,9 +832,13 @@ void App::init_swapchain() { Anvil::SGPUDevice* device_ptr(reinterpret_cast(m_device_ptr.get() )); - m_rendering_surface_ptr = Anvil::RenderingSurface::create(m_instance_ptr.get(), - m_device_ptr.get (), - m_window_ptr.get ()); + { + auto create_info_ptr = Anvil::RenderingSurfaceCreateInfo::create(m_instance_ptr.get(), + m_device_ptr.get (), + m_window_ptr.get () ); + + m_rendering_surface_ptr = Anvil::RenderingSurface::create(std::move(create_info_ptr) ); + } m_rendering_surface_ptr->set_name("Main rendering surface"); @@ -906,12 +911,16 @@ void App::init_vulkan() m_physical_device_ptr = m_instance_ptr->get_physical_device(0); /* Create a Vulkan device */ - m_device_ptr = Anvil::SGPUDevice::create(m_physical_device_ptr, - true, /* in_enable_shader_module_cache */ - Anvil::DeviceExtensionConfiguration(), - std::vector(), /* in_layers */ - false, /* in_transient_command_buffer_allocs_only */ - false); /* in_support_resettable_command_buffers */ + { + auto create_info_ptr = Anvil::DeviceCreateInfo::create_sgpu(m_physical_device_ptr, + true, /* in_enable_shader_module_cache */ + Anvil::DeviceExtensionConfiguration(), + std::vector(), /* in_layers */ + Anvil::CommandPoolCreateFlagBits::NONE, + false); /* in_mt_safe */ + + m_device_ptr = Anvil::SGPUDevice::create(std::move(create_info_ptr) ); + } } void App::on_validation_callback(Anvil::DebugMessageSeverityFlags in_severity, @@ -969,7 +978,7 @@ void App::update_data_ub_contents(uint32_t in_n_swapchain_image) } -int main() +int main(int argc, char *argv[]) { std::unique_ptr app_ptr(new App() ); diff --git a/include/config.h.in b/include/config.h.in index 43758b4d..99448951 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -17,4 +17,4 @@ #cmakedefine ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT /* Defined if XCB window system support is to be included in Anvil */ -#cmakedefine ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT +#cmakedefine ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT \ No newline at end of file diff --git a/include/misc/descriptor_pool_create_info.h b/include/misc/descriptor_pool_create_info.h new file mode 100644 index 00000000..4023f7ff --- /dev/null +++ b/include/misc/descriptor_pool_create_info.h @@ -0,0 +1,146 @@ +// +// Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#ifndef MISC_DESCRIPTOR_POOL_CREATE_INFO_H +#define MISC_DESCRIPTOR_POOL_CREATE_INFO_H + +#include "misc/mt_safety.h" +#include "misc/types.h" +#include + +namespace Anvil +{ + class DescriptorPoolCreateInfo + { + public: + /* Public functions */ + + /* Creates a new create info structure which should be fed to Anvil::DescriptorPool::create() function. + * + * By default, zero descriptors are associated with each descriptor type. You need to specify the number of descriptors + * the pool should allocate space for by calling set_n_descriptors_for_descriptor_type(). + * + * @param in_device_ptr Device to use. + * @param in_n_max_sets Maximum number of sets to be allocable from the pool. Must be at + * least 1. + * @param in_flags See DescriptorPoolFlagBits documentation for more details. + * @param in_mt_safety MT safety setting to use for the pool to be spawned. + */ + static DescriptorPoolCreateInfoUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + const uint32_t& in_n_max_sets, + const Anvil::DescriptorPoolCreateFlags& in_create_flags, + const MTSafety& in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE); + + const Anvil::DescriptorPoolCreateFlags& get_create_flags() const + { + return m_create_flags; + } + + const Anvil::BaseDevice* get_device_ptr() const + { + return m_device_ptr; + } + + const MTSafety& get_mt_safety() const + { + return m_mt_safety; + } + + uint32_t get_n_descriptors_for_descriptor_type(const Anvil::DescriptorType& in_descriptor_type) const + { + auto iterator = m_descriptor_count.find(in_descriptor_type); + uint32_t result = 0; + + if (iterator != m_descriptor_count.end() ) + { + result = m_descriptor_count.at(in_descriptor_type); + } + + return result; + } + + const uint32_t& get_n_maximum_inline_uniform_block_bindings() const + { + return m_n_max_inline_uniform_block_bindings; + } + + const uint32_t& get_n_maximum_sets() const + { + return m_n_max_sets; + } + + void set_create_flags(const Anvil::DescriptorPoolCreateFlags& in_create_flags) + { + m_create_flags = in_create_flags; + } + + void set_mt_safety(const MTSafety& in_mt_safety) + { + m_mt_safety = in_mt_safety; + } + + void set_n_descriptors_for_descriptor_type(const Anvil::DescriptorType& in_descriptor_type, + const uint32_t& in_n_descriptors) + { + m_descriptor_count[in_descriptor_type] = in_n_descriptors; + } + + /* Configures the maximum number of inline uniform block bindings that descriptor sets spawned using this descriptor pool + * will ever use at once. + * + * NOTE: Requires VK_EXT_inline_uniform_block support. + */ + void set_n_maximum_inline_uniform_block_bindings(const uint32_t& in_n_max_inline_uniform_block_bindings) + { + m_n_max_inline_uniform_block_bindings = in_n_max_inline_uniform_block_bindings; + } + + void set_n_maximum_sets(const uint32_t& in_n_maximum_sets) + { + m_n_max_sets = in_n_maximum_sets; + } + + private: + + /* Private functions */ + + /** Constructor */ + DescriptorPoolCreateInfo(const Anvil::BaseDevice* in_device_ptr, + const uint32_t& in_n_max_sets, + const Anvil::DescriptorPoolCreateFlags& in_create_flags, + const MTSafety& in_mt_safety); + + DescriptorPoolCreateInfo (const DescriptorPoolCreateInfo&); + DescriptorPoolCreateInfo& operator=(const DescriptorPoolCreateInfo&); + + /* Private variables */ + Anvil::DescriptorPoolCreateFlags m_create_flags; + const Anvil::BaseDevice* m_device_ptr; + std::unordered_map m_descriptor_count; + Anvil::MTSafety m_mt_safety; + uint32_t m_n_max_inline_uniform_block_bindings; + uint32_t m_n_max_sets; + }; + +}; /* namespace Anvil */ + +#endif /* MISC_DESCRIPTOR_POOL_CREATE_INFO_H */ \ No newline at end of file diff --git a/include/misc/descriptor_set_create_info.h b/include/misc/descriptor_set_create_info.h index 4b2076f3..43050fe7 100644 --- a/include/misc/descriptor_set_create_info.h +++ b/include/misc/descriptor_set_create_info.h @@ -56,10 +56,15 @@ namespace Anvil * It is an error to attempt to define immutable samplers for descriptors of type other than * sampler or combined image+sampler. * + * NOTE: For inline uniform block bindings, subsequent set_binding_item() call is NOT required. + * * @param in_binding_index Index of the binding to configure. * @param in_descriptor_type Type of the descriptor to use for the binding. * @param in_descriptor_array_size Size of the descriptor array to use for the binding. - * @param in_stage_flags Rendering stages which are going to use the binding. + * + * For inline uniform blocks, this parameter corresponds to (number of bytes associated with the + * block). This value MUST be divisible by 4. + * * @param in_flags Please see documentation of Anvil::DescriptorBindingFlags for more details. * @param in_opt_immutable_sampler_ptr_ptr If not nullptr, an array of @param in_descriptor_array_size samplers should * be passed. The binding will then be considered immutable, as per spec language. diff --git a/include/misc/device_create_info.h b/include/misc/device_create_info.h new file mode 100644 index 00000000..a274a1ef --- /dev/null +++ b/include/misc/device_create_info.h @@ -0,0 +1,276 @@ +// +// Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef MISC_DEVICE_CREATE_INFO_H +#define MISC_DEVICE_CREATE_INFO_H + +#include "misc/types.h" +#include "misc/extensions.h" +#include + +namespace Anvil +{ + class DeviceCreateInfo + { + public: + /* Public functions */ + + /* TODO. + * + * Anvil creates one command pool per each queue family which apps can use at any time which is why the CommandPoolCreateFlags argument + * is present. + * + * By default, the device will be created with API version equal to min(instance-level API version, physical device API version}. + * This can be overridden by calling set_api_version(). + * + * NOTE: If VK_EXT_global_queue_priority is supported, all queues are associated MEDIUM_EXT global priority by default. + * This can be changed on a per-queue basis by calling set_queue_global_priority() prior to passing the structure + * to Anvil::{M, S}GPUDevice for device instantiation. + * + * NOTE: By default, all queues are associated with a priority of 0.0 and no create flags. This can be adjusted by calling + * corresponding set_queue_..() functions. + * + * @param in_physical_device_ptr Physical device to create this device from. Must not be nullptr. + * @param in_extension_configuration Tells which extensions must/should be specified at creation time. + * @param in_layers_to_enable A vector of layer names to be used when creating the device. + * Can be empty. + * @param in_transient_command_buffer_allocs_only True if the command pools, which are going to be initialized after + * the device is created, should be set up for transient command buffer + * support. + * @param in_support_resettable_command_buffer_allocs True if the command pools should be configured for resettable command + * buffer support. + * @param in_enable_shader_module_cache True if all spawned shader modules should be cached throughout instance lifetime. + * False if they should be released as soon as all shared pointers go out of scope. + * @param in_mt_safe True if command buffer creation and queue submissions should be automatically serialized. + * Set to false if your app is never going to use more than one thread at a time for + * command buffer creation or submission. + * + */ + static Anvil::DeviceCreateInfoUniquePtr create_mgpu(const std::vector& in_physical_device_ptrs, + const bool& in_enable_shader_module_cache, + const DeviceExtensionConfiguration& in_extension_configuration, + const std::vector& in_layers_to_enable, + const Anvil::CommandPoolCreateFlags& in_helper_command_pool_create_flags, + const bool& in_mt_safe); + static Anvil::DeviceCreateInfoUniquePtr create_sgpu(const Anvil::PhysicalDevice* in_physical_device_ptr, + const bool& in_enable_shader_module_cache, + const DeviceExtensionConfiguration& in_extension_configuration, + const std::vector& in_layers_to_enable, + const Anvil::CommandPoolCreateFlags& in_helper_command_pool_create_flags, + const bool& in_mt_safe); + + const DeviceExtensionConfiguration& get_extension_configuration() const + { + return m_extension_configuration; + } + + const Anvil::CommandPoolCreateFlags& get_helper_command_pool_create_flags() const + { + return m_helper_command_pool_create_flags; + } + + const std::vector& get_layers_to_enable() const + { + return m_layers_to_enable; + } + + const Anvil::MemoryOverallocationBehavior& get_memory_overallocation_behavior() const + { + return m_memory_overallocation_behavior; + } + + const std::vector& get_physical_device_ptrs() const + { + return m_physical_device_ptrs; + } + + Anvil::QueueGlobalPriority get_queue_global_priority(const uint32_t& in_queue_family_index, + const uint32_t& in_queue_index) const + { + auto queue_fam_iterator = m_queue_properties.find(in_queue_family_index); + auto result = Anvil::QueueGlobalPriority::MEDIUM_EXT; + + if (queue_fam_iterator != m_queue_properties.end() ) + { + auto queue_iterator = queue_fam_iterator->second.find(in_queue_index); + + if (queue_iterator != queue_fam_iterator->second.end() ) + { + result = queue_iterator->second.global_priority; + } + } + + return result; + } + + bool get_queue_must_support_protected_memory_operations(const uint32_t& in_queue_family_index, + const uint32_t& in_queue_index) const + { + auto queue_fam_iterator = m_queue_properties.find(in_queue_family_index); + auto result = false; + + if (queue_fam_iterator != m_queue_properties.end() ) + { + auto queue_iterator = queue_fam_iterator->second.find(in_queue_index); + + if (queue_iterator != queue_fam_iterator->second.end() ) + { + result = queue_iterator->second.is_protected_capable; + } + } + + return result; + } + + float get_queue_priority(const uint32_t& in_queue_family_index, + const uint32_t& in_queue_index) const + { + auto queue_fam_iterator = m_queue_properties.find(in_queue_family_index); + auto result = 0.0f; + + if (queue_fam_iterator != m_queue_properties.end() ) + { + auto queue_iterator = queue_fam_iterator->second.find(in_queue_index); + + if (queue_iterator != queue_fam_iterator->second.end() ) + { + result = queue_iterator->second.priority; + } + } + + return result; + } + + /* Sets memory overallocation behavior to request at device creation time. + * + * NOTE: Requires VK_AMD_memory_overallocation_behavior. + * + * @param in_behavior Required behavior to specify at device creation time. + **/ + void set_memory_overallocation_behavior(const Anvil::MemoryOverallocationBehavior& in_behavior) + { + m_memory_overallocation_behavior = in_behavior; + } + + /* Associates global priority information with a given pair. + * + * NOTE: Requires VK_EXT_global_queue_priority. + * + * @param in_queue_family_index Index of the queue family to use for the association. + * @param in_queue_index Index of the queue belonging to queue family with index @param in_queue_family_index + * to use for the association. + * @param in_queue_global_priority Global priority to use for the queue. + */ + void set_queue_global_priority(const uint32_t& in_queue_family_index, + const uint32_t& in_queue_index, + const Anvil::QueueGlobalPriority& in_queue_global_priority) + { + m_queue_properties[in_queue_family_index][in_queue_index].global_priority = in_queue_global_priority; + } + + /* Associates priority with a given pair. + * + * By default, all queues will be associated a priority of 0.0. + * + * NOTE: Apps are required to respect discreteQueuePriorities property of the physical device the device + * will be created from! + * + * @param in_queue_family_index Index of the queue family to use for the association. + * @param in_queue_index Index of the queue belonging to queue family with index @param in_queue_family_index + * to use for the association. + * @param in_queue_priority Priority to use for the queue. + */ + void set_queue_priority(const uint32_t& in_queue_family_index, + const uint32_t& in_queue_index, + const float& in_queue_priority) + { + m_queue_properties[in_queue_family_index][in_queue_index].priority = in_queue_priority; + } + + /* Call to specify whether or not VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT should be specified at queue creation time. + * + * NOTE: Apps can only request the bit for queues which are reported to support protected memory operations. + * NOTE: This function is only supported for VK 1.1 devices or newer. + * + * @param in_queue_family_index Index of the queue family to use for the association. + * @param in_queue_index Index of the queue belonging to queue family with index @param in_queue_family_index + * to use for the association. + * @param in_should_enable True to enable the functionality; false to disable. + */ + void set_queue_must_support_protected_memory_operations(const uint32_t& in_queue_family_index, + const uint32_t& in_queue_index, + const bool& in_should_enable) + { + m_queue_properties[in_queue_family_index][in_queue_index].is_protected_capable = in_should_enable; + } + + const bool& should_be_mt_safe() const + { + return m_mt_safe; + } + + const bool& should_enable_shader_module_cache() const + { + return m_should_enable_shader_module_cache; + } + + private: + /* Private type definitions */ + typedef struct QueueProperties + { + Anvil::QueueGlobalPriority global_priority; + bool is_protected_capable; + float priority; + + QueueProperties() + :global_priority (Anvil::QueueGlobalPriority::MEDIUM_EXT), + is_protected_capable(false), + priority (0.0f) + { + /* Stub */ + } + } QueueProperties; + + /* Private functions */ + DeviceCreateInfo(const std::vector& in_physical_device_ptrs, + const bool& in_enable_shader_module_cache, + const DeviceExtensionConfiguration& in_extension_configuration, + const std::vector& in_layers_to_enable, + const Anvil::CommandPoolCreateFlags& in_helper_command_pool_create_flags, + const bool& in_mt_safe); + + /* Private variables */ + DeviceExtensionConfiguration m_extension_configuration; + Anvil::CommandPoolCreateFlags m_helper_command_pool_create_flags; + std::vector m_layers_to_enable; + Anvil::MemoryOverallocationBehavior m_memory_overallocation_behavior; + bool m_mt_safe; + std::vector m_physical_device_ptrs; + std::unordered_map > m_queue_properties; + bool m_should_enable_shader_module_cache; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(DeviceCreateInfo); + ANVIL_DISABLE_COPY_CONSTRUCTOR(DeviceCreateInfo); + }; + +}; /* namespace Anvil */ + +#endif /* MISC_DEVICE_CREATE_INFO_H */ \ No newline at end of file diff --git a/include/misc/extensions.h b/include/misc/extensions.h index feedd068..e8fb44ba 100644 --- a/include/misc/extensions.h +++ b/include/misc/extensions.h @@ -37,6 +37,7 @@ namespace Anvil ValueType amd_gcn_shader; ValueType amd_gpu_shader_half_float; ValueType amd_gpu_shader_int16; + ValueType amd_memory_overallocation_behavior; ValueType amd_mixed_attachment_samples; ValueType amd_negative_viewport_height; ValueType amd_rasterization_order; @@ -48,14 +49,24 @@ namespace Anvil ValueType amd_shader_info; ValueType amd_shader_trinary_minmax; ValueType amd_texture_gather_bias_lod; + + ValueType ext_conservative_rasterization; ValueType ext_debug_marker; + ValueType ext_depth_clip_enable; ValueType ext_depth_range_unrestricted; ValueType ext_descriptor_indexing; ValueType ext_pci_bus_info; ValueType ext_external_memory_host; + ValueType ext_global_priority; ValueType ext_hdr_metadata; + ValueType ext_inline_uniform_block; + ValueType ext_memory_budget; + ValueType ext_memory_priority; + ValueType ext_queue_family_foreign; ValueType ext_sample_locations; ValueType ext_sampler_filter_minmax; + ValueType ext_scalar_block_layout; + ValueType ext_separate_stencil_usage; ValueType ext_shader_stencil_export; ValueType ext_shader_subgroup_ballot; ValueType ext_shader_subgroup_vote; @@ -63,14 +74,18 @@ namespace Anvil ValueType ext_swapchain_colorspace; ValueType ext_transform_feedback; ValueType ext_vertex_attribute_divisor; + ValueType google_decorate_string; + ValueType google_hlsl_functionality1; ValueType khr_16bit_storage; ValueType khr_8bit_storage; ValueType khr_bind_memory2; ValueType khr_create_renderpass2; ValueType khr_dedicated_allocation; + ValueType khr_depth_stencil_resolve; ValueType khr_descriptor_update_template; ValueType khr_device_group; ValueType khr_draw_indirect_count; + ValueType khr_driver_properties; ValueType khr_external_fence; ValueType khr_external_memory; ValueType khr_external_semaphore; @@ -93,10 +108,20 @@ namespace Anvil ValueType khr_multiview; ValueType khr_relaxed_block_layout; ValueType khr_sampler_mirror_clamp_to_edge; + ValueType khr_sampler_ycbcr_conversion; + ValueType khr_shader_atomic_int64; ValueType khr_shader_draw_parameters; + ValueType khr_shader_float16_int8; + ValueType khr_shader_float_controls; ValueType khr_storage_buffer_storage_class; ValueType khr_swapchain; + ValueType khr_swapchain_mutable_format; ValueType khr_variable_pointers; + ValueType khr_vulkan_memory_model; + + #if defined(_WIN32) + ValueType khr_win32_keyed_mutex; + #endif std::map values_by_extension_names; @@ -125,6 +150,7 @@ namespace Anvil {ExtensionData(VK_AMD_GCN_SHADER_EXTENSION_NAME, &amd_gcn_shader)}, {ExtensionData(VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME, &amd_gpu_shader_half_float)}, {ExtensionData(VK_AMD_GPU_SHADER_INT16_EXTENSION_NAME, &amd_gpu_shader_int16)}, + {ExtensionData(VK_AMD_MEMORY_OVERALLOCATION_BEHAVIOR_EXTENSION_NAME, &amd_memory_overallocation_behavior)}, {ExtensionData(VK_AMD_MIXED_ATTACHMENT_SAMPLES_EXTENSION_NAME, &amd_mixed_attachment_samples)}, {ExtensionData(VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME, &amd_negative_viewport_height)}, {ExtensionData(VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME, &amd_rasterization_order)}, @@ -136,14 +162,23 @@ namespace Anvil {ExtensionData(VK_AMD_SHADER_INFO_EXTENSION_NAME, &amd_shader_info)}, {ExtensionData(VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME, &amd_shader_trinary_minmax)}, {ExtensionData(VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME, &amd_texture_gather_bias_lod)}, + {ExtensionData(VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME, &ext_conservative_rasterization)}, {ExtensionData(VK_EXT_DEBUG_MARKER_EXTENSION_NAME, &ext_debug_marker)}, + {ExtensionData(VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME, &ext_depth_clip_enable)}, {ExtensionData(VK_EXT_DEPTH_RANGE_UNRESTRICTED_EXTENSION_NAME, &ext_depth_range_unrestricted)}, {ExtensionData(VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, &ext_descriptor_indexing)}, {ExtensionData(VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME, &ext_external_memory_host)}, + {ExtensionData(VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME, &ext_global_priority)}, {ExtensionData(VK_EXT_HDR_METADATA_EXTENSION_NAME, &ext_hdr_metadata)}, + {ExtensionData(VK_EXT_INLINE_UNIFORM_BLOCK_EXTENSION_NAME, &ext_inline_uniform_block)}, + {ExtensionData(VK_EXT_MEMORY_BUDGET_EXTENSION_NAME, &ext_memory_budget)}, + {ExtensionData(VK_EXT_MEMORY_PRIORITY_EXTENSION_NAME, &ext_memory_priority)}, {ExtensionData(VK_EXT_PCI_BUS_INFO_EXTENSION_NAME, &ext_pci_bus_info)}, + {ExtensionData(VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME, &ext_queue_family_foreign)}, {ExtensionData(VK_EXT_SAMPLE_LOCATIONS_EXTENSION_NAME, &ext_sample_locations)}, {ExtensionData(VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME, &ext_sampler_filter_minmax)}, + {ExtensionData(VK_EXT_SCALAR_BLOCK_LAYOUT_EXTENSION_NAME, &ext_scalar_block_layout)}, + {ExtensionData(VK_EXT_SEPARATE_STENCIL_USAGE_EXTENSION_NAME, &ext_separate_stencil_usage)}, {ExtensionData(VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME, &ext_shader_stencil_export)}, {ExtensionData(VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME, &ext_shader_subgroup_ballot)}, {ExtensionData(VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME, &ext_shader_subgroup_vote)}, @@ -151,14 +186,18 @@ namespace Anvil {ExtensionData(VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME, &ext_swapchain_colorspace)}, {ExtensionData(VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, &ext_transform_feedback)}, {ExtensionData(VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, &ext_vertex_attribute_divisor)}, + {ExtensionData(VK_GOOGLE_DECORATE_STRING_EXTENSION_NAME, &google_decorate_string)}, + {ExtensionData(VK_GOOGLE_HLSL_FUNCTIONALITY1_EXTENSION_NAME, &google_hlsl_functionality1)}, {ExtensionData(VK_KHR_16BIT_STORAGE_EXTENSION_NAME, &khr_16bit_storage)}, {ExtensionData(VK_KHR_8BIT_STORAGE_EXTENSION_NAME, &khr_8bit_storage)}, {ExtensionData(VK_KHR_BIND_MEMORY_2_EXTENSION_NAME, &khr_bind_memory2)}, {ExtensionData(VK_KHR_CREATE_RENDERPASS_2_EXTENSION_NAME, &khr_create_renderpass2)}, {ExtensionData(VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME, &khr_dedicated_allocation)}, + {ExtensionData(VK_KHR_DEPTH_STENCIL_RESOLVE_EXTENSION_NAME, &khr_depth_stencil_resolve)}, {ExtensionData(VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME, &khr_descriptor_update_template)}, {ExtensionData(VK_KHR_DEVICE_GROUP_EXTENSION_NAME, &khr_device_group)}, {ExtensionData(VK_KHR_DRAW_INDIRECT_COUNT_EXTENSION_NAME, &khr_draw_indirect_count)}, + {ExtensionData(VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME, &khr_driver_properties)}, {ExtensionData(VK_KHR_EXTERNAL_FENCE_EXTENSION_NAME, &khr_external_fence)}, {ExtensionData(VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME, &khr_external_memory)}, {ExtensionData(VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME, &khr_external_semaphore)}, @@ -179,10 +218,20 @@ namespace Anvil {ExtensionData(VK_KHR_MULTIVIEW_EXTENSION_NAME, &khr_multiview)}, {ExtensionData(VK_KHR_RELAXED_BLOCK_LAYOUT_EXTENSION_NAME, &khr_relaxed_block_layout)}, {ExtensionData(VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME, &khr_sampler_mirror_clamp_to_edge)}, + {ExtensionData(VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME, &khr_sampler_ycbcr_conversion)}, + {ExtensionData(VK_KHR_SHADER_ATOMIC_INT64_EXTENSION_NAME, &khr_shader_atomic_int64)}, {ExtensionData(VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME, &khr_shader_draw_parameters)}, + {ExtensionData(VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME, &khr_shader_float16_int8)}, + {ExtensionData(VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME, &khr_shader_float_controls)}, {ExtensionData(VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_EXTENSION_NAME, &khr_storage_buffer_storage_class)}, {ExtensionData(VK_KHR_SWAPCHAIN_EXTENSION_NAME, &khr_swapchain)}, + {ExtensionData(VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_EXTENSION_NAME, &khr_swapchain_mutable_format)}, {ExtensionData(VK_KHR_VARIABLE_POINTERS_EXTENSION_NAME, &khr_variable_pointers)}, + {ExtensionData(VK_KHR_VULKAN_MEMORY_MODEL_EXTENSION_NAME, &khr_vulkan_memory_model)}, + + #if defined(_WIN32) + {ExtensionData(VK_KHR_WIN32_KEYED_MUTEX_EXTENSION_NAME, &khr_win32_keyed_mutex)}, + #endif }; values_by_extension_names = in_values_by_extension_names; @@ -264,7 +313,7 @@ namespace Anvil #endif #else #if defined(ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT) - {ExtensionData(VK_KHR_XCB_SURFACE_EXTENSION_NAME, &khr_xcb_surface)}, + {ExtensionData(VK_KHR_XCB_SURFACE_EXTENSION_NAME, &khr_xcb_surface)}, #endif #endif }; @@ -303,6 +352,7 @@ namespace Anvil virtual ValueType amd_gcn_shader () const = 0; virtual ValueType amd_gpu_shader_half_float () const = 0; virtual ValueType amd_gpu_shader_int16 () const = 0; + virtual ValueType amd_memory_overallocation_behavior () const = 0; virtual ValueType amd_mixed_attachment_samples () const = 0; virtual ValueType amd_negative_viewport_height () const = 0; virtual ValueType amd_rasterization_order () const = 0; @@ -314,14 +364,23 @@ namespace Anvil virtual ValueType amd_shader_info () const = 0; virtual ValueType amd_shader_trinary_minmax () const = 0; virtual ValueType amd_texture_gather_bias_lod () const = 0; + virtual ValueType ext_conservative_rasterization () const = 0; virtual ValueType ext_debug_marker () const = 0; + virtual ValueType ext_depth_clip_enable () const = 0; virtual ValueType ext_depth_range_unrestricted () const = 0; virtual ValueType ext_descriptor_indexing () const = 0; virtual ValueType ext_external_memory_host () const = 0; + virtual ValueType ext_global_priority () const = 0; virtual ValueType ext_hdr_metadata () const = 0; + virtual ValueType ext_inline_uniform_block () const = 0; + virtual ValueType ext_memory_budget () const = 0; + virtual ValueType ext_memory_priority () const = 0; virtual ValueType ext_pci_bus_info () const = 0; + virtual ValueType ext_queue_family_foreign () const = 0; virtual ValueType ext_sample_locations () const = 0; virtual ValueType ext_sampler_filter_minmax () const = 0; + virtual ValueType ext_scalar_block_layout () const = 0; + virtual ValueType ext_separate_stencil_usage () const = 0; virtual ValueType ext_shader_stencil_export () const = 0; virtual ValueType ext_shader_subgroup_ballot () const = 0; virtual ValueType ext_shader_subgroup_vote () const = 0; @@ -329,14 +388,18 @@ namespace Anvil virtual ValueType ext_swapchain_colorspace () const = 0; virtual ValueType ext_transform_feedback () const = 0; virtual ValueType ext_vertex_attribute_divisor () const = 0; + virtual ValueType google_decorate_string () const = 0; + virtual ValueType google_hlsl_functionality1 () const = 0; virtual ValueType khr_16bit_storage () const = 0; virtual ValueType khr_8bit_storage () const = 0; virtual ValueType khr_bind_memory2 () const = 0; virtual ValueType khr_create_renderpass2 () const = 0; virtual ValueType khr_dedicated_allocation () const = 0; + virtual ValueType khr_depth_stencil_resolve () const = 0; virtual ValueType khr_descriptor_update_template () const = 0; virtual ValueType khr_device_group () const = 0; virtual ValueType khr_draw_indirect_count () const = 0; + virtual ValueType khr_driver_properties () const = 0; virtual ValueType khr_external_fence () const = 0; virtual ValueType khr_external_memory () const = 0; virtual ValueType khr_external_semaphore () const = 0; @@ -357,11 +420,20 @@ namespace Anvil virtual ValueType khr_multiview () const = 0; virtual ValueType khr_relaxed_block_layout () const = 0; virtual ValueType khr_sampler_mirror_clamp_to_edge () const = 0; + virtual ValueType khr_sampler_ycbcr_conversion () const = 0; + virtual ValueType khr_shader_atomic_int64 () const = 0; virtual ValueType khr_shader_draw_parameters () const = 0; + virtual ValueType khr_shader_float16_int8 () const = 0; + virtual ValueType khr_shader_float_controls () const = 0; virtual ValueType khr_storage_buffer_storage_class () const = 0; virtual ValueType khr_swapchain () const = 0; + virtual ValueType khr_swapchain_mutable_format () const = 0; virtual ValueType khr_variable_pointers () const = 0; + virtual ValueType khr_vulkan_memory_model () const = 0; + #if defined(_WIN32) + virtual ValueType khr_win32_keyed_mutex() const = 0; + #endif virtual ValueType by_name(const std::string& in_name) const = 0; }; @@ -518,6 +590,13 @@ namespace Anvil return m_device_extensions_ptr->amd_gpu_shader_int16; } + ValueType amd_memory_overallocation_behavior() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->amd_memory_overallocation_behavior; + } + ValueType amd_mixed_attachment_samples() const final { anvil_assert(m_expose_device_extensions); @@ -595,6 +674,13 @@ namespace Anvil return m_device_extensions_ptr->amd_texture_gather_bias_lod; } + ValueType ext_conservative_rasterization() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_conservative_rasterization; + } + ValueType ext_debug_marker() const final { anvil_assert(m_expose_device_extensions); @@ -602,6 +688,13 @@ namespace Anvil return m_device_extensions_ptr->ext_debug_marker; } + ValueType ext_depth_clip_enable() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_depth_clip_enable; + } + ValueType ext_depth_range_unrestricted() const final { anvil_assert(m_expose_device_extensions); @@ -623,6 +716,13 @@ namespace Anvil return m_device_extensions_ptr->ext_external_memory_host; } + ValueType ext_global_priority() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_global_priority; + } + ValueType ext_hdr_metadata() const final { anvil_assert(m_expose_device_extensions); @@ -630,6 +730,13 @@ namespace Anvil return m_device_extensions_ptr->ext_hdr_metadata; } + ValueType ext_inline_uniform_block() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_inline_uniform_block; + } + ValueType ext_pci_bus_info() const final { anvil_assert(m_expose_device_extensions); @@ -637,18 +744,18 @@ namespace Anvil return m_device_extensions_ptr->ext_pci_bus_info; } - ValueType ext_sampler_filter_minmax() const final + ValueType ext_queue_family_foreign() const final { anvil_assert(m_expose_device_extensions); - return m_device_extensions_ptr->ext_sampler_filter_minmax; + return m_device_extensions_ptr->ext_queue_family_foreign; } - ValueType ext_vertex_attribute_divisor() const final + ValueType ext_sampler_filter_minmax() const final { anvil_assert(m_expose_device_extensions); - return m_device_extensions_ptr->ext_vertex_attribute_divisor; + return m_device_extensions_ptr->ext_sampler_filter_minmax; } ValueType ext_sample_locations() const final @@ -656,6 +763,20 @@ namespace Anvil anvil_assert(m_expose_device_extensions); return m_device_extensions_ptr->ext_sample_locations; + } + + ValueType ext_scalar_block_layout() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_scalar_block_layout; + } + + ValueType ext_separate_stencil_usage() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_separate_stencil_usage; } @@ -687,6 +808,13 @@ namespace Anvil return m_device_extensions_ptr->ext_shader_viewport_index_layer; } + ValueType ext_vertex_attribute_divisor() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_vertex_attribute_divisor; + } + ValueType ext_swapchain_colorspace() const { anvil_assert(m_expose_device_extensions); @@ -701,6 +829,34 @@ namespace Anvil return m_device_extensions_ptr->ext_transform_feedback; } + ValueType ext_memory_budget() const + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_memory_budget; + } + + ValueType ext_memory_priority() const + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->ext_memory_priority; + } + + ValueType google_decorate_string() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->google_decorate_string; + } + + ValueType google_hlsl_functionality1() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->google_hlsl_functionality1; + } + ValueType khr_16bit_storage() const final { anvil_assert(m_expose_device_extensions); @@ -736,6 +892,13 @@ namespace Anvil return m_device_extensions_ptr->khr_dedicated_allocation; } + ValueType khr_depth_stencil_resolve() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_depth_stencil_resolve; + } + ValueType khr_descriptor_update_template() const final { anvil_assert(m_expose_device_extensions); @@ -757,6 +920,13 @@ namespace Anvil return m_device_extensions_ptr->khr_draw_indirect_count; } + ValueType khr_driver_properties() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_driver_properties; + } + ValueType khr_external_fence() const final { anvil_assert(m_expose_device_extensions); @@ -882,6 +1052,13 @@ namespace Anvil return m_device_extensions_ptr->khr_sampler_mirror_clamp_to_edge; } + ValueType khr_sampler_ycbcr_conversion() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_sampler_ycbcr_conversion; + } + ValueType khr_storage_buffer_storage_class() const final { anvil_assert(m_expose_device_extensions); @@ -889,6 +1066,13 @@ namespace Anvil return m_device_extensions_ptr->khr_storage_buffer_storage_class; } + ValueType khr_shader_atomic_int64() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_shader_atomic_int64; + } + ValueType khr_shader_draw_parameters() const final { anvil_assert(m_expose_device_extensions); @@ -896,6 +1080,20 @@ namespace Anvil return m_device_extensions_ptr->khr_shader_draw_parameters; } + ValueType khr_shader_float16_int8() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_shader_float16_int8; + } + + ValueType khr_shader_float_controls() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_shader_float_controls; + } + ValueType khr_swapchain() const final { anvil_assert(m_expose_device_extensions); @@ -903,6 +1101,13 @@ namespace Anvil return m_device_extensions_ptr->khr_swapchain; } + ValueType khr_swapchain_mutable_format() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_swapchain_mutable_format; + } + ValueType khr_variable_pointers() const final { anvil_assert(m_expose_device_extensions); @@ -910,6 +1115,22 @@ namespace Anvil return m_device_extensions_ptr->khr_variable_pointers; } + ValueType khr_vulkan_memory_model() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_vulkan_memory_model; + } + + #if defined(_WIN32) + ValueType khr_win32_keyed_mutex() const final + { + anvil_assert(m_expose_device_extensions); + + return m_device_extensions_ptr->khr_win32_keyed_mutex; + } + #endif + /* IExtensionInfoInstance */ ValueType ext_debug_report() const final diff --git a/include/misc/formats.h b/include/misc/formats.h index aa3488a8..aa62f579 100644 --- a/include/misc/formats.h +++ b/include/misc/formats.h @@ -40,6 +40,7 @@ namespace Anvil * @param out_n_compatible_formats_ptr Deref will be set to the number of formats accessible under *out_compatible_formats_ptr_ptr. * Must not be nullptr. * @param out_compatible_formats_ptr_ptr Deref will be set to a ptr to a linear list of formats compatible with @param in_format. + * The list MAY include YUV formats. * * @return true if successful, false otherwise. */ @@ -55,6 +56,9 @@ namespace Anvil * * This function does not support block formats. * + * This function will only return one of the non-YUV formats whose component sizes + * match the specified number of bits. + * * For formats which use less than 4 components, set irrelevant n_component*_bits arguments * to 0. * @@ -79,6 +83,8 @@ namespace Anvil uint32_t in_n_component3_bits); /** Returns image aspects exposed by a given image format. + * + * Supports both non-YUV and YUV formats. * * @param in_format Format to use for the query. * @param out_aspects_ptr Deref will be used to store the result data. Must not be NULL. @@ -90,8 +96,7 @@ namespace Anvil /** Returns bit layout for the specified format. * - * NOTE: Only non-compressed formats are supported. - * NOTE: YUV KHR formats are NOT supported for this function. + * NOTE: Only non-compressed non-YUV formats are supported. * NOTE: Components not used by the specified format have start and end bit indices set to UINT32_MAX. * * @param in_format Non-compressed format to use for the query. @@ -110,49 +115,73 @@ namespace Anvil * @param out_opt_stencil_component_start_bit_index_ptr If not null, deref will be set to the bit index, from which stencil component data starts. * @param out_opt_stencil_component_end_bit_index_ptr If not null, deref will be set to the bit index, at which stencil component data ends. (data under the bit includes the data!) */ - static void get_format_bit_layout(Anvil::Format in_format, - uint32_t* out_opt_red_component_start_bit_index_ptr = nullptr, - uint32_t* out_opt_red_component_end_bit_index_ptr = nullptr, - uint32_t* out_opt_green_component_start_bit_index_ptr = nullptr, - uint32_t* out_opt_green_component_end_bit_index_ptr = nullptr, - uint32_t* out_opt_blue_component_start_bit_index_ptr = nullptr, - uint32_t* out_opt_blue_component_end_bit_index_ptr = nullptr, - uint32_t* out_opt_alpha_component_start_bit_index_ptr = nullptr, - uint32_t* out_opt_alpha_component_end_bit_index_ptr = nullptr, - uint32_t* out_opt_shared_component_start_bit_index_ptr = nullptr, - uint32_t* out_opt_shared_component_end_bit_index_ptr = nullptr, - uint32_t* out_opt_depth_component_start_bit_index_ptr = nullptr, - uint32_t* out_opt_depth_component_end_bit_index_ptr = nullptr, - uint32_t* out_opt_stencil_component_start_bit_index_ptr = nullptr, - uint32_t* out_opt_stencil_component_end_bit_index_ptr = nullptr); + static void get_format_bit_layout_nonyuv(Anvil::Format in_format, + uint32_t* out_opt_red_component_start_bit_index_ptr = nullptr, + uint32_t* out_opt_red_component_end_bit_index_ptr = nullptr, + uint32_t* out_opt_green_component_start_bit_index_ptr = nullptr, + uint32_t* out_opt_green_component_end_bit_index_ptr = nullptr, + uint32_t* out_opt_blue_component_start_bit_index_ptr = nullptr, + uint32_t* out_opt_blue_component_end_bit_index_ptr = nullptr, + uint32_t* out_opt_alpha_component_start_bit_index_ptr = nullptr, + uint32_t* out_opt_alpha_component_end_bit_index_ptr = nullptr, + uint32_t* out_opt_shared_component_start_bit_index_ptr = nullptr, + uint32_t* out_opt_shared_component_end_bit_index_ptr = nullptr, + uint32_t* out_opt_depth_component_start_bit_index_ptr = nullptr, + uint32_t* out_opt_depth_component_end_bit_index_ptr = nullptr, + uint32_t* out_opt_stencil_component_start_bit_index_ptr = nullptr, + uint32_t* out_opt_stencil_component_end_bit_index_ptr = nullptr); + + /* Works analogously to get_format_bit_layout_nonyuv() but only supports YUV formats. */ + static void get_format_bit_layout_yuv(Anvil::Format in_format, + uint32_t* out_opt_plane0_r0_start_bit_index_ptr = nullptr, + uint32_t* out_opt_plane0_r0_end_bit_index_ptr = nullptr, + uint32_t* out_opt_plane0_g0_start_bit_index_ptr = nullptr, + uint32_t* out_opt_plane0_g0_end_bit_index_ptr = nullptr, + uint32_t* out_opt_plane0_b0_start_bit_index_ptr = nullptr, + uint32_t* out_opt_plane0_b0_end_bit_index_ptr = nullptr, + uint32_t* out_opt_plane0_a0_start_bit_index_ptr = nullptr, + uint32_t* out_opt_plane0_a0_end_bit_index_ptr = nullptr, + uint32_t* out_opt_plane0_g1_start_bit_index_ptr = nullptr, + uint32_t* out_opt_plane0_g1_end_bit_index_ptr = nullptr, + uint32_t* out_opt_plane1_r0_start_bit_index_ptr = nullptr, + uint32_t* out_opt_plane1_r0_end_bit_index_ptr = nullptr, + uint32_t* out_opt_plane1_g0_start_bit_index_ptr = nullptr, + uint32_t* out_opt_plane1_g0_end_bit_index_ptr = nullptr, + uint32_t* out_opt_plane1_b0_start_bit_index_ptr = nullptr, + uint32_t* out_opt_plane1_b0_end_bit_index_ptr = nullptr, + uint32_t* out_opt_plane2_r0_start_bit_index_ptr = nullptr, + uint32_t* out_opt_plane2_r0_end_bit_index_ptr = nullptr, + uint32_t* out_opt_plane2_g0_start_bit_index_ptr = nullptr, + uint32_t* out_opt_plane2_g0_end_bit_index_ptr = nullptr, + uint32_t* out_opt_plane2_b0_start_bit_index_ptr = nullptr, + uint32_t* out_opt_plane2_b0_end_bit_index_ptr = nullptr); /** Tells what component layout is used by @param in_format. * * NOTE: This function does NOT support YUV KHR format. Please check the overloaded function if * you would like to use for YUV KHR format. */ - static ComponentLayout get_format_component_layout(Anvil::Format in_format); + static ComponentLayout get_format_component_layout_nonyuv(Anvil::Format in_format); /** Tells what component layout is used by @param in_format at specified subresource @param in_aspect. * * NOTE: Only YUV KHR formats are supported. */ - static ComponentLayout get_format_component_layout(Anvil::Format in_format, - Anvil::ImageAspectFlagBits in_aspect); + static ComponentLayout get_format_component_layout_yuv(Anvil::Format in_format, + Anvil::ImageAspectFlagBits in_aspect); /** Tells the number of components used by @param in_format * - * NOTE: This function does NOT support YUV KHR format. Please check the overloaded function if - * you would like to use for YUV KHR format. + * NOTE: This function does NOT support YUV KHR formats. */ - static uint32_t get_format_n_components(Anvil::Format in_format); + static uint32_t get_format_n_components_nonyuv(Anvil::Format in_format); /** Tells the number of components used by @param in_format under specified subresource @param in_aspect. * * NOTE: Only YUV KHR formats are supported. */ - static uint32_t get_format_n_components(Anvil::Format in_format, - Anvil::ImageAspectFlagBits in_aspect); + static uint32_t get_format_n_components_yuv(Anvil::Format in_format, + Anvil::ImageAspectFlagBits in_aspect); /* Tells the number of bits used for each component in case of Vulkan format specified * under @param in_format. @@ -172,11 +201,11 @@ namespace Anvil * @param out_channel3_bits_ptr Deref will be set to the number of bits used for channel 3. Must * not be nullptr. */ - static void get_format_n_component_bits(Anvil::Format in_format, - uint32_t* out_channel0_bits_ptr, - uint32_t* out_channel1_bits_ptr, - uint32_t* out_channel2_bits_ptr, - uint32_t* out_channel3_bits_ptr); + static void get_format_n_component_bits_nonyuv(Anvil::Format in_format, + uint32_t* out_channel0_bits_ptr, + uint32_t* out_channel1_bits_ptr, + uint32_t* out_channel2_bits_ptr, + uint32_t* out_channel3_bits_ptr); /* Tells the number of bits used for each component in case of Vulkan format specified * under @param in_format at subresource @param in_aspect. @@ -196,17 +225,25 @@ namespace Anvil * @param out_channel3_bits_ptr Deref will be set to the number of bits used for channel 3. Must * not be nullptr. */ - static void get_format_n_component_bits(Anvil::Format in_format, - Anvil::ImageAspectFlagBits in_aspect, - uint32_t* out_channel0_bits_ptr, - uint32_t* out_channel1_bits_ptr, - uint32_t* out_channel2_bits_ptr, - uint32_t* out_channel3_bits_ptr); + static void get_format_n_component_bits_yuv(Anvil::Format in_format, + Anvil::ImageAspectFlagBits in_aspect, + uint32_t* out_channel0_bits_ptr, + uint32_t* out_channel1_bits_ptr, + uint32_t* out_channel2_bits_ptr, + uint32_t* out_channel3_bits_ptr); + + /** Tells the number of planes exposed by the specified format. + * + * For non-YUV formats, this function always returns 1. + * + * @param in_format Format to use for the query. + */ + static uint32_t get_format_n_planes(Anvil::Format in_format); /** Tells the number of bits unused for each component in case of Vulkan format specified * under @param in_format at subresource @param in_aspect. * - * NOTE: Only YUV KHR fromats are supported. + * NOTE: Only YUV KHR formats are supported. * NOTE: Number of bits reported for each component uses ordering as reported for the format * via get_format_component_layout(). This is especially important in the context of packed formats. * @@ -221,17 +258,23 @@ namespace Anvil * @param out_channel3_unused_bits_ptr Deref will be set to the number of bits unused for channel 3. Must * not be nullptr. */ - static void get_format_n_unused_component_bits(Anvil::Format in_format, - Anvil::ImageAspectFlagBits in_aspect, - uint32_t* out_channel0_unused_bits_ptr, - uint32_t* out_channel1_unused_bits_ptr, - uint32_t* out_channel2_unused_bits_ptr, - uint32_t* out_channel3_unused_bits_ptr); + static void get_format_n_unused_component_bits_yuv(Anvil::Format in_format, + Anvil::ImageAspectFlagBits in_aspect, + uint32_t* out_channel0_unused_bits_ptr, + uint32_t* out_channel1_unused_bits_ptr, + uint32_t* out_channel2_unused_bits_ptr, + uint32_t* out_channel3_unused_bits_ptr); - /* Returns a raw C string for specified format, or NULL if the format is unknown. */ + /* Returns a raw C string for specified format, or NULL if the format is unknown. + * + * Both non-YUV and YUV formats are supported. + */ static const char* get_format_name(Anvil::Format in_format); - /** Tells the format type used by @param in_format. */ + /** Tells the format type used by @param in_format. + * + * Both non-YUV and YUV formats are supported. + */ static FormatType get_format_type(Anvil::Format in_format); /** Returns the extent of subresource @param in_aspect with specified format @param in_format. @@ -248,6 +291,7 @@ namespace Anvil Anvil::ImageAspectFlagBits in_aspect, VkExtent3D in_image_extent, VkExtent3D* out_plane_extent_ptr); + /** Tells whether @param in_format includes a depth aspect. * * NOTE: YUV KHR formats are NOT supported. @@ -269,7 +313,10 @@ namespace Anvil /** Tells whether @param in_format is a KHR YUV format */ static bool is_format_yuv_khr(Anvil::Format in_format); - /** Tells whether @param in_format is a packed format */ + /** Tells whether @param in_format is a packed format. + * + * Both YUV and non-YUV formats are supported. + **/ static bool is_format_packed(Anvil::Format in_format); private: diff --git a/include/misc/glsl_to_spirv.h b/include/misc/glsl_to_spirv.h index 1d3b1b95..29d9aa05 100644 --- a/include/misc/glsl_to_spirv.h +++ b/include/misc/glsl_to_spirv.h @@ -134,11 +134,13 @@ namespace Anvil * which should be used. This mode is NOT supported if ANVIL_LINK_WITH_GLSLANG * macro is undefined. * @param in_shader_stage Shader stage described by the file. + * @param in_spirv_version Target SPIR-V version. **/ static Anvil::GLSLShaderToSPIRVGeneratorUniquePtr create(const Anvil::BaseDevice* in_opt_device_ptr, const Mode& in_mode, std::string in_data, - ShaderStage in_shader_stage); + ShaderStage in_shader_stage, + SpvVersion in_spirv_version = SpvVersion::_1_0); /** Destructor. Releases all created Vulkan objects, as well as the SPIR-V blob data. */ ~GLSLShaderToSPIRVGenerator(); @@ -358,7 +360,8 @@ namespace Anvil explicit GLSLShaderToSPIRVGenerator(const Anvil::BaseDevice* in_device_ptr, const Mode& in_mode, std::string in_data, - ShaderStage in_shader_stage); + ShaderStage in_shader_stage, + SpvVersion in_spirv_version); bool bake_glsl_source_code() const; @@ -386,6 +389,7 @@ namespace Anvil mutable bool m_glsl_source_code_dirty; ShaderStage m_shader_stage; + SpvVersion m_spirv_version; mutable std::vector m_spirv_blob; DefinitionNameToValueMap m_definition_values; diff --git a/include/misc/graphics_pipeline_create_info.h b/include/misc/graphics_pipeline_create_info.h index 89355778..b58b294a 100644 --- a/include/misc/graphics_pipeline_create_info.h +++ b/include/misc/graphics_pipeline_create_info.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2019 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -65,6 +65,10 @@ namespace Anvil * * + Rasterization order: strict * + * If VK_EXT_depth_clip_enable extension is supported: + * + * + Depth clip enabled: true + * * If VK_EXT_transform_feedback extension is supported: * * + Rasterization stream index: 0 @@ -205,6 +209,9 @@ namespace Anvil Anvil::BlendFactor* out_opt_dst_alpha_blend_factor_ptr, Anvil::ColorComponentFlags* out_opt_channel_write_mask_ptr) const; + /** Tells what conservative rasterization mode has been specified for this instance. **/ + Anvil::ConservativeRasterizationModeEXT get_conservative_rasterization_mode() const; + /** Retrieves depth bias-related state configuration. * * @param out_opt_is_enabled_ptr If not null, deref will be set to true if depth bias has @@ -305,6 +312,9 @@ namespace Anvil /** Tells what rasterization order has been specified for this instance. **/ Anvil::RasterizationOrderAMD get_rasterization_order() const; + /** Tells what primitive overestimation size has been specified for this instance. **/ + float get_extra_primitive_overestimation_size() const; + /** Retrieves various rasterization properties of the graphics pipeline. * * @param out_opt_polygon_mode_ptr If not null, deref will be set to polygon mode used by the @@ -502,6 +512,9 @@ namespace Anvil /** Tells whether depth clamping has been enabled. **/ bool is_depth_clamp_enabled() const; + /** Tells whether depth clipping has been enabled. **/ + bool is_depth_clip_enabled() const; + /** Tells whether primitive restart mode has been enabled. **/ bool is_primitive_restart_enabled() const; @@ -590,6 +603,25 @@ namespace Anvil **/ void set_rasterization_stream_index(const uint32_t& in_rasterization_stream_index); + /** Configures the conservative rasterization mode for the pipeline if the VK_EXT_conservative_rasterization + * extension is supported by the device, for which the pipeline has been created. + * + * On drivers which do not support the extension, the setting will be ignored. + * + * @param in_conservative_rasterization_mode Conservative rasterization mode to use. + **/ + void set_conservative_rasterization_mode(Anvil::ConservativeRasterizationModeEXT in_conservative_rasterization_mode); + + /** if the VK_EXT_conservative_rasterization extension is supported by the device and + * Anvil::ConservativeRasterizationModeEXT::OVERESTIMATE conservative rasterization mode is set for the pipeline, + * this setting controls extra size in pixels by which the primitive is incresed during conservative rasterization. + * + * On drivers which do not support the extension, the setting will be ignored. + * + * @param extra_primitive_overestimation_size extra size to increase the primitive + **/ + void set_extra_primitive_overestimation_size(float extra_primitive_overestimation_size); + /** Sets a number of rasterization properties to be used for the pipeline. * * @param in_polygon_mode Polygon mode to use. @@ -726,6 +758,14 @@ namespace Anvil */ void toggle_depth_clamp(bool in_should_enable); + /** Enables or disables the "depth clip" test. + * + * Requires VK_EXT_depth_clip_enable extension support. + * + * @param in_should_enable true to enable the test; false to disable it. + */ + void toggle_depth_clip(bool in_should_enable); + /** Enables or disables the depth test and updates related state values. * * @param in_should_enable true to enable the mode; false to disable it. @@ -1015,6 +1055,8 @@ namespace Anvil bool copy_gfx_state_from(const Anvil::GraphicsPipelineCreateInfo* in_src_pipeline_create_info_ptr); /* Private variables */ + bool m_depth_clip_enabled; + bool m_depth_bounds_test_enabled; float m_max_depth_bounds; float m_min_depth_bounds; @@ -1050,6 +1092,9 @@ namespace Anvil Anvil::RasterizationOrderAMD m_rasterization_order; + Anvil::ConservativeRasterizationModeEXT m_conservative_rasterization_mode; + float m_extra_primitive_overestimation_size; + TessellationDomainOrigin m_tessellation_domain_origin; InternalVertexAttributes m_attributes; diff --git a/include/misc/image_create_info.h b/include/misc/image_create_info.h index dfb9c634..91b016b7 100644 --- a/include/misc/image_create_info.h +++ b/include/misc/image_create_info.h @@ -38,7 +38,7 @@ namespace Anvil } /** Returns an instance of the "create info" item which can be used to instantiate a new Image - * instance *WITH* a memory backing. + * instance *WITH* a memory backing. * * This constructor assumes the image should be initialized in UNDEFINED layout, if no mipmap data * is specified, or PREINITIALIZED otherwise. In the latter case, it will then proceed with filling @@ -270,12 +270,12 @@ namespace Anvil return m_n_layers; } - const std::vector get_physical_devices() const + const std::vector get_device_indices() const { anvil_assert(m_internal_type == Anvil::ImageInternalType::PEER_NO_ALLOC || m_internal_type == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); - return m_physical_devices; + return m_device_indices; } const Anvil::ImageLayout& get_post_alloc_image_layout() const @@ -312,6 +312,11 @@ namespace Anvil return m_sharing_mode; } + const Anvil::ImageUsageFlags& get_stencil_image_aspect_usage() const + { + return m_usage_flags_stencil; + } + const Anvil::Swapchain* get_swapchain() const { anvil_assert(m_internal_type == Anvil::ImageInternalType::PEER_NO_ALLOC || @@ -438,17 +443,13 @@ namespace Anvil m_sample_count = in_sample_count; } - void set_physical_devices(const uint32_t& in_n_physical_devices, - const Anvil::PhysicalDevice* const* in_physical_devices_ptr) + void set_device_indices(const uint32_t& in_device_index_count, + const uint32_t* in_devices_indices_ptr) { - m_physical_devices.clear(); - - for (uint32_t n_physical_device = 0; - n_physical_device < in_n_physical_devices; - ++n_physical_device) - { - m_physical_devices.push_back(in_physical_devices_ptr[n_physical_device]); - } + m_device_indices.clear(); + m_device_indices.insert(m_device_indices.begin(), + in_devices_indices_ptr, + in_devices_indices_ptr + in_device_index_count); } void set_SFR_rectangles(const uint32_t& in_n_SFR_rects, @@ -469,6 +470,17 @@ namespace Anvil m_sharing_mode = in_sharing_mode; } + /* Use this function to specify usage patterns for the stencil part of the image which is about to be created. + * As per VK_EXT_separate_stencil_usage, various restrictions apply, amongst which the most important is that + * @param in_usage has to be a subset of the usage flags specified globally for the image. + * + * Requires VK_EXT_separate_stencil_usage. + */ + void set_stencil_image_aspect_usage(const Anvil::ImageUsageFlags& in_usage) + { + m_usage_flags_stencil = in_usage; + } + void set_swapchain(const Anvil::Swapchain* in_swapchain_ptr) { m_swapchain_ptr = in_swapchain_ptr; @@ -512,7 +524,7 @@ namespace Anvil Anvil::ImageType in_type_vk, Anvil::Format in_format, Anvil::ImageTiling in_tiling, - Anvil::SharingMode in_sharing_mode, + Anvil::SharingMode in_sharing_mode, ImageUsageFlags in_usage, uint32_t in_base_mipmap_width, uint32_t in_base_mipmap_height, @@ -551,12 +563,13 @@ namespace Anvil Anvil::ImageTiling m_tiling; const Anvil::ImageType m_type_vk; ImageUsageFlags m_usage_flags; + ImageUsageFlags m_usage_flags_stencil; bool m_use_full_mipmap_chain; uint32_t m_width; /* Only used for peer images */ - std::vector m_physical_devices; - std::vector m_sfr_rects; + std::vector m_device_indices; + std::vector m_sfr_rects; /* Only used for swapchain wrapper images */ uint32_t m_n_swapchain_image; diff --git a/include/misc/image_view_create_info.h b/include/misc/image_view_create_info.h index 435bc177..e73d792f 100644 --- a/include/misc/image_view_create_info.h +++ b/include/misc/image_view_create_info.h @@ -47,9 +47,13 @@ namespace Anvil * @param in_swizzle_blue Channel to use for the blue component when sampling the view. * @param in_swizzle_alpha Channel to use for the alpha component when sampling the view. * + * NOTE: Sampler YCbCr Conversion support is disabled by default. In order to enable it for the about-to-be-created + * image view, please call set_sampler_ycbcr_conversion_ptr(). + * * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * - * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE + * - Sampler YCbCr Conversion support: disabled * * @return New ImageView instance, if function executes successfully; nullptr otherwise. **/ @@ -81,9 +85,13 @@ namespace Anvil * @param in_swizzle_blue Channel to use for the blue component when sampling the view. * @param in_swizzle_alpha Channel to use for the alpha component when sampling the view. * + * NOTE: Sampler YCbCr Conversion support is disabled by default. In order to enable it for the about-to-be-created + * image view, please call set_sampler_ycbcr_conversion_ptr(). + * * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * - * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE + * - Sampler YCbCr Conversion support: disabled * * @return New ImageView instance, if function executes successfully; nullptr otherwise. **/ @@ -117,9 +125,13 @@ namespace Anvil * @param in_swizzle_blue Channel to use for the blue component when sampling the view. * @param in_swizzle_alpha Channel to use for the alpha component when sampling the view. * + * NOTE: Sampler YCbCr Conversion support is disabled by default. In order to enable it for the about-to-be-created + * image view, please call set_sampler_ycbcr_conversion_ptr(). + * * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * - * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE + * - Sampler YCbCr Conversion support: disabled * * @return New ImageView instance, if function executes successfully; nullptr otherwise. **/ @@ -152,9 +164,13 @@ namespace Anvil * @param in_swizzle_blue Channel to use for the blue component when sampling the view. * @param in_swizzle_alpha Channel to use for the alpha component when sampling the view. * + * NOTE: Sampler YCbCr Conversion support is disabled by default. In order to enable it for the about-to-be-created + * image view, please call set_sampler_ycbcr_conversion_ptr(). + * * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * - * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE + * - Sampler YCbCr Conversion support: disabled * * @return New ImageView instance, if function executes successfully; nullptr otherwise. **/ @@ -185,9 +201,13 @@ namespace Anvil * @param in_swizzle_blue Channel to use for the blue component when sampling the view. * @param in_swizzle_alpha Channel to use for the alpha component when sampling the view. * + * NOTE: Sampler YCbCr Conversion support is disabled by default. In order to enable it for the about-to-be-created + * image view, please call set_sampler_ycbcr_conversion_ptr(). + * * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * - * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE + * - Sampler YCbCr Conversion support: disabled * * @return New ImageView instance, if function executes successfully; nullptr otherwise. **/ @@ -217,9 +237,13 @@ namespace Anvil * @param in_swizzle_blue Channel to use for the blue component when sampling the view. * @param in_swizzle_alpha Channel to use for the alpha component when sampling the view. * + * NOTE: Sampler YCbCr Conversion support is disabled by default. In order to enable it for the about-to-be-created + * image view, please call set_sampler_ycbcr_conversion_ptr(). + * * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * - * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE + * - Sampler YCbCr Conversion support: disabled * * @return New ImageView instance, if function executes successfully; nullptr otherwise. **/ @@ -252,9 +276,13 @@ namespace Anvil * @param in_swizzle_blue Channel to use for the blue component when sampling the view. * @param in_swizzle_alpha Channel to use for the alpha component when sampling the view. * + * NOTE: Sampler YCbCr Conversion support is disabled by default. In order to enable it for the about-to-be-created + * image view, please call set_sampler_ycbcr_conversion_ptr(). + * * NOTE: Unless specified later with a corresponding set_..() invocation, the following parameters are assumed by default: * - * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE + * - Sampler YCbCr Conversion support: disabled * * @return New ImageView instance, if function executes successfully; nullptr otherwise. **/ @@ -323,6 +351,11 @@ namespace Anvil return m_parent_image_ptr; } + const Anvil::SamplerYCbCrConversion* get_sampler_ycbcr_conversion_ptr() const + { + return m_sampler_ycbcr_conversion_ptr; + } + /** Returns swizzle array assigned to the image view */ const std::array& get_swizzle_array() const { @@ -337,7 +370,7 @@ namespace Anvil /** Returns usage flags associated with the image view. * - * NOTE: If the function returns Anvil::IMAGE_USAGE_FLAG_UNKNOWN, the image view inherits usage bits + * NOTE: If the function returns Anvil::ImageUsageFlagBits::NONE, the image view inherits usage bits * from the parent image. * */ @@ -391,6 +424,20 @@ namespace Anvil m_parent_image_ptr = in_parent_image_ptr; } + /* Attaches or detaches already attached SamplerYCBCRConversion object from the create info struct. + * This information will be used at image view creation time. + * + * NOTE: Requires VK_KHR_sampler_ycbcr_conversion + * + * @param in_sampler_ycbcr_conversion_ptr If not nullptr, the specified object will be passed to the implementation + * at sampler creation time by chaining VkSamplerYcbcrConversionInfo struct. + * If nullptr, the struct will not be chained. + **/ + void set_sampler_ycbcr_conversion_ptr(const Anvil::SamplerYCbCrConversion* in_sampler_ycbcr_conversion_ptr) + { + m_sampler_ycbcr_conversion_ptr = in_sampler_ycbcr_conversion_ptr; + } + void set_swizzle_array(const std::array& in_swizzle_array) { m_swizzle_array = in_swizzle_array; @@ -433,6 +480,7 @@ namespace Anvil uint32_t m_n_layers; uint32_t m_n_mipmaps; Anvil::Image* m_parent_image_ptr; + const Anvil::SamplerYCbCrConversion* m_sampler_ycbcr_conversion_ptr; std::array m_swizzle_array; Anvil::ImageViewType m_type; Anvil::ImageUsageFlags m_usage; diff --git a/include/misc/instance_create_info.h b/include/misc/instance_create_info.h index 5b0f1249..1fc40328 100644 --- a/include/misc/instance_create_info.h +++ b/include/misc/instance_create_info.h @@ -37,6 +37,14 @@ namespace Anvil /** Instantiates a new create info which must be specified when creating Anvil Instance object. * + * By default, Anvil will query the highest version of Vulkan supported by the implementation and use it when creating the Instance. + * You can override this behavior by calling set_api_version(). + * + * The following are also assumed by default: + * + * + App version: 0 + * + Engine version: 0 + * @param in_app_name Name of the application, to be passed in VkCreateInstanceInfo * structure. * @param in_engine_name Name of the engine, to be passed in VkCreateInstanceInfo @@ -55,11 +63,21 @@ namespace Anvil bool in_mt_safe, const std::vector& in_opt_disallowed_instance_level_extensions = std::vector() ); + const Anvil::APIVersion& get_api_version() const + { + return m_api_version; + } + const std::string& get_app_name() const { return m_app_name; } + const uint32_t& get_app_version() const + { + return m_app_version; + } + const std::vector& get_disallowed_instance_level_extensions() const { return m_disallowed_instance_level_extensions; @@ -70,6 +88,11 @@ namespace Anvil return m_engine_name; } + const uint32_t& get_engine_version() const + { + return m_engine_version; + } + /* Returns memory type index which should be used by Anvil when allocating memory. This value can be specified with set_n_memory_type_to_use_for_all_allocs(). * * If UINT32_MAX is returned, Anvil will be free to use any memory type determined to be valid for particular memory allocations. This is the default behavior. @@ -89,11 +112,26 @@ namespace Anvil return m_is_mt_safe; } + void set_api_version(const Anvil::APIVersion& in_api_version) + { + m_api_version = in_api_version; + } + void set_app_name(const std::string& in_app_name) { m_app_name = in_app_name; } + void set_app_version(const uint32_t& in_version) + { + m_app_version = in_version; + } + + void set_engine_version(const uint32_t& in_version) + { + m_engine_version = in_version; + } + void set_disallowed_instance_level_extensions(const std::vector& in_extensions) { m_disallowed_instance_level_extensions = in_extensions; @@ -135,9 +173,12 @@ namespace Anvil /* Private variables */ + Anvil::APIVersion m_api_version; std::string m_app_name; + uint32_t m_app_version; std::vector m_disallowed_instance_level_extensions; std::string m_engine_name; + uint32_t m_engine_version; bool m_is_mt_safe; uint32_t m_n_memory_type_to_use_for_all_alocs; Anvil::DebugCallbackFunction m_validation_callback; diff --git a/include/misc/io.h b/include/misc/io.h index 4d9b80ab..ce40c5c6 100644 --- a/include/misc/io.h +++ b/include/misc/io.h @@ -66,6 +66,7 @@ namespace Anvil KEY_ID_RIGHT = ANVIL_KEY_HELPER(Right), KEY_ID_SPACE = ANVIL_KEY_HELPER(space), #endif + #endif KEY_ID_COUNT, diff --git a/include/misc/memalloc_backends/backend_oneshot.h b/include/misc/memalloc_backends/backend_oneshot.h index e22f06c3..9a905db7 100644 --- a/include/misc/memalloc_backends/backend_oneshot.h +++ b/include/misc/memalloc_backends/backend_oneshot.h @@ -69,6 +69,7 @@ namespace Anvil bool supports_baking () const final; bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const final; bool supports_device_masks () const final; + bool supports_protected_memory () const final; void unmap (void* in_memory_object) final; /* Private functions */ diff --git a/include/misc/memalloc_backends/backend_vma.h b/include/misc/memalloc_backends/backend_vma.h index 59cf5a20..b79e0a54 100644 --- a/include/misc/memalloc_backends/backend_vma.h +++ b/include/misc/memalloc_backends/backend_vma.h @@ -132,6 +132,7 @@ namespace Anvil bool supports_baking () const final; bool supports_device_masks () const final; bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const final; + bool supports_protected_memory () const final; void unmap (void* in_memory_object); /* Private variables */ diff --git a/include/misc/memory_allocator.h b/include/misc/memory_allocator.h index f3579141..84e224b1 100644 --- a/include/misc/memory_allocator.h +++ b/include/misc/memory_allocator.h @@ -34,7 +34,7 @@ #include "misc/types.h" #include #include - +#include namespace Anvil { @@ -83,6 +83,7 @@ namespace Anvil Anvil::ExternalMemoryHandleTypeFlags alloc_exportable_external_handle_types; Anvil::ImageAspectFlagBits alloc_image_aspect; bool alloc_is_dedicated_memory; + bool alloc_is_scratch_buffer_alloc; MemoryBlockUniquePtr alloc_memory_block_ptr; uint32_t alloc_memory_final_type; VkDeviceSize alloc_memory_required_alignment; @@ -93,11 +94,13 @@ namespace Anvil MGPUPeerMemoryRequirements alloc_mgpu_peer_memory_reqs; VkDeviceSize alloc_offset; VkDeviceSize alloc_size; + float memory_priority; VkExtent3D extent; bool is_baked; VkDeviceSize miptail_offset; uint32_t n_layer; + uint32_t n_plane; VkOffset3D offset; Anvil::ImageSubresource subresource; @@ -116,7 +119,8 @@ namespace Anvil const bool& in_alloc_is_dedicated, const uint32_t& in_device_mask, const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs, - const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices); + const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices, + const float& in_memory_priority); Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, Anvil::Buffer* in_buffer_ptr, @@ -133,7 +137,8 @@ namespace Anvil const bool& in_alloc_is_dedicated, const uint32_t& in_device_mask, const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs, - const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices); + const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices, + const float& in_memory_priority); Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, Anvil::Image* in_image_ptr, @@ -152,7 +157,8 @@ namespace Anvil const bool& in_alloc_is_dedicated, const uint32_t& in_device_mask, const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs, - const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices); + const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices, + const float& in_memory_priority); Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, Anvil::Image* in_image_ptr, @@ -171,7 +177,8 @@ namespace Anvil const bool& in_alloc_is_dedicated, const uint32_t& in_device_mask, const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs, - const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices); + const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices, + const float& in_memory_priority); Item(Anvil::MemoryAllocator* in_memory_allocator_ptr, Anvil::Image* in_image_ptr, @@ -187,7 +194,9 @@ namespace Anvil const bool& in_alloc_is_dedicated, const uint32_t& in_device_mask, const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs, - const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices); + const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices, + const float& in_memory_priority, + const uint32_t& in_n_plane); /** TODO */ ~Item(); @@ -215,6 +224,7 @@ namespace Anvil virtual bool bake (Items& in_items) = 0; virtual bool supports_device_masks () const = 0; virtual bool supports_external_memory_handles(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const = 0; + virtual bool supports_protected_memory () const = 0; }; /* Public functions */ @@ -241,6 +251,8 @@ namespace Anvil * in the device group. The indices will be used during sparse bind operation, binding the buffer on the device with * resource index to a memory allocation instance on the device with memory index. If null or empty, the binding will work * as if both indices were zero. + * @param in_opt_memory_priority Memory priority to use for the allocation. Valid values must be within range [0.0f, 1.0f]. + * Ignored if VK_EXT_memory_priority is unavailable or if VMA backend is used or if FLT_MAX is passed. * * @return true if the buffer has been successfully scheduled for baking, false otherwise. **/ @@ -252,7 +264,8 @@ namespace Anvil #endif const uint32_t* in_opt_device_mask_ptr = nullptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr, + const float& in_opt_memory_priority = FLT_MAX); bool add_buffer_with_float_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features, @@ -262,7 +275,8 @@ namespace Anvil #endif const uint32_t* in_opt_device_mask_ptr = nullptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr, + const float& in_opt_memory_priority = FLT_MAX); bool add_buffer_with_float_data_vector_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, @@ -272,7 +286,8 @@ namespace Anvil #endif const uint32_t* in_opt_device_mask_ptr = nullptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr, + const float& in_opt_memory_priority = FLT_MAX); bool add_buffer_with_float_data_vector_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, const std::vector* in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, @@ -282,7 +297,8 @@ namespace Anvil #endif const uint32_t* in_opt_device_mask_ptr = nullptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr, + const float& in_opt_memory_priority = FLT_MAX); bool add_buffer_with_uchar8_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features, @@ -292,7 +308,8 @@ namespace Anvil #endif const uint32_t* in_opt_device_mask_ptr = nullptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr, + const float& in_opt_memory_priority = FLT_MAX); bool add_buffer_with_uchar8_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, @@ -302,7 +319,8 @@ namespace Anvil #endif const uint32_t* in_opt_device_mask_ptr = nullptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr, + const float& in_opt_memory_priority = FLT_MAX); bool add_buffer_with_uint32_data_ptr_based_post_fill (Anvil::Buffer* in_buffer_ptr, std::unique_ptr in_data_ptr, MemoryFeatureFlags in_required_memory_features, @@ -312,7 +330,8 @@ namespace Anvil #endif const uint32_t* in_opt_device_mask_ptr = nullptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr, + const float& in_opt_memory_priority = FLT_MAX); bool add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, std::unique_ptr > in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, @@ -322,7 +341,8 @@ namespace Anvil #endif const uint32_t* in_opt_device_mask_ptr = nullptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr, + const float& in_opt_memory_priority = FLT_MAX); bool add_buffer_with_uint32_data_vector_ptr_based_post_fill(Anvil::Buffer* in_buffer_ptr, const std::vector* in_data_vector_ptr, MemoryFeatureFlags in_required_memory_features, @@ -332,7 +352,8 @@ namespace Anvil #endif const uint32_t* in_opt_device_mask_ptr = nullptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr, + const float& in_opt_memory_priority = FLT_MAX); /** TODO * @@ -351,6 +372,8 @@ namespace Anvil * in the device group. The indices will be used during sparse bind operation, binding the buffer on the device with * resource index to a memory allocation instance on the device with memory index. If null or empty, the binding will work * as if both indices were zero. + * @param in_opt_memory_priority Memory priority to use for the allocation. Valid values must be within range [0.0f, 1.0f]. + * Ignored if VK_EXT_memory_priority is unavailable or if VMA backend is used or if FLT_MAX is passed. * * @return TODO */ @@ -360,7 +383,8 @@ namespace Anvil MemoryFeatureFlags in_required_memory_features, const uint32_t* in_opt_device_mask_ptr = nullptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr, + const float& in_opt_memory_priority = FLT_MAX); /** Adds an Image object which should be assigned storage coming from memory objects @@ -382,6 +406,8 @@ namespace Anvil * in the device group. The indices will be used during sparse bind operation, binding the image on the device with * resource index to a memory allocation instance on the device with memory index. If null or empty, the binding will work * as if both indices were zero. + * @param in_opt_memory_priority Memory priority to use for the allocation. Valid values must be within range [0.0f, 1.0f]. + * Ignored if VK_EXT_memory_priority is unavailable or if VMA backend is used or if FLT_MAX is passed. * * @return true if the image has been successfully scheduled for baking, false otherwise. **/ @@ -393,7 +419,8 @@ namespace Anvil #endif const uint32_t* in_opt_device_mask_ptr = nullptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr, + const float& in_opt_memory_priority = FLT_MAX); /** Adds a new Image object whose layer @param in_n_layer 's miptail for @param in_aspect @@ -418,6 +445,8 @@ namespace Anvil * in the device group. The indices will be used during sparse bind operation, binding the image on the device with * resource index to a memory allocation instance on the device with memory index. If null or empty, the binding will work * as if both indices were zero. + * @param in_opt_memory_priority Memory priority to use for the allocation. Valid values must be within range [0.0f, 1.0f]. + * Ignored if VK_EXT_memory_priority is unavailable or if VMA backend is used or if FLT_MAX is passed. * * @return true if the miptail has been successfully scheduled for baking, false otherwise. */ @@ -427,7 +456,8 @@ namespace Anvil MemoryFeatureFlags in_required_memory_features, const uint32_t* in_opt_device_mask_ptr = nullptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr, + const float& in_opt_memory_priority = FLT_MAX); /** Adds a single subresource which should be assigned memory backing. @@ -453,6 +483,8 @@ namespace Anvil * in the device group. The indices will be used during sparse bind operation, binding the image on the device with * resource index to a memory allocation instance on the device with memory index. If null or empty, the binding will work * as if both indices were zero. + * @param in_opt_memory_priority Memory priority to use for the allocation. Valid values must be within range [0.0f, 1.0f]. + * Ignored if VK_EXT_memory_priority is unavailable or if VMA backend is used or if FLT_MAX is passed. * * @return true if the subresource has been successfully scheduled for baking, false otherwise. **/ @@ -463,7 +495,8 @@ namespace Anvil MemoryFeatureFlags in_required_memory_features, const uint32_t* in_opt_device_mask_ptr = nullptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr = nullptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr); + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr = nullptr, + const float& in_opt_memory_priority = FLT_MAX); /** TODO */ bool bake(); @@ -548,7 +581,8 @@ namespace Anvil #endif const uint32_t* in_opt_device_mask_ptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr); + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr, + const float& in_opt_memory_priority); bool do_bind_sparse_device_indices_sanity_check (const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) const; bool do_external_memory_handle_type_sanity_checks(const Anvil::ExternalMemoryHandleTypeFlags& in_external_memory_handle_types) const; diff --git a/include/misc/memory_block_create_info.h b/include/misc/memory_block_create_info.h index 8571a3dd..c80c43d5 100644 --- a/include/misc/memory_block_create_info.h +++ b/include/misc/memory_block_create_info.h @@ -106,6 +106,39 @@ namespace Anvil VkDeviceSize in_size, Anvil::MemoryFeatureFlags in_memory_features); + /** Spawns a create info instance which can be used to instantiate a new memory block. + * + * WARNING: in_memory_type_index has to meet all memory requirements, it is user's responsibility to adhere! + * If it is possible please use create_regular function instead of this function. + * + * This function can be used for both single- and multi-GPU device instances. For the latter case, + * the default behavior is to allocate a single instance of memory (deviceMask = 1) for memory heaps + * that do NOT have the VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR bit on, or allocate as many instances + * of memory as there are physical devices assigned to the logical device. This can be adjusted + * by calling corresponding set_..() functions. + * + * NOTE: The following parameters take the following defautl values: + * + * - Exportable external memory handle types: Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE + * - Importable external memory handle type: Anvil::EXTERNAL_MEMORY_HANDLE_TYPE_NONE + * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE. + * - Use a dedicated allocation?: No. + * + * These can be further adjusted by callingt corresponding set_..() functions prior to passing the CreateInfo instance + * to MemoryBlock::create(). + * + * @param in_device_ptr Device to use. + * @param in_allowed_memory_bits Memory type bits which meet the allocation requirements. + * @param in_size Required allocation size. + * @param in_memory_features Required memory features. + * @param in_memory_type_index Required memory type index + **/ + static MemoryBlockCreateInfoUniquePtr create_with_memory_type(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_allowed_memory_bits, + VkDeviceSize in_size, + Anvil::MemoryFeatureFlags in_memory_features, + uint32_t in_memory_type_index); + const uint32_t& get_allowed_memory_bits() const { return m_allowed_memory_bits; @@ -131,6 +164,11 @@ namespace Anvil } } + float get_memory_priority() const + { + return m_memory_priority; + } + const Anvil::BaseDevice* get_device() const { return m_device_ptr; @@ -355,6 +393,11 @@ namespace Anvil m_use_dedicated_allocation = true; } + void set_memory_priority(const float& in_priority) + { + m_memory_priority = in_priority; + } + private: MemoryBlockCreateInfo(const Anvil::MemoryBlockType& in_type, const uint32_t& in_allowed_memory_bits, @@ -382,6 +425,7 @@ namespace Anvil Anvil::ExternalMemoryHandleTypeFlagBits m_imported_external_memory_handle_type; VkDeviceMemory m_memory; Anvil::MemoryFeatureFlags m_memory_features; + float m_memory_priority; uint32_t m_memory_type_index; Anvil::MTSafety m_mt_safety; Anvil::OnMemoryBlockReleaseCallbackFunction m_on_release_callback_function; diff --git a/include/misc/object_tracker.h b/include/misc/object_tracker.h index eff7aa47..1a612e70 100644 --- a/include/misc/object_tracker.h +++ b/include/misc/object_tracker.h @@ -58,7 +58,6 @@ namespace Anvil */ OBJECT_TRACKER_CALLBACK_ID_ON_SHADER_MODULE_OBJECT_REGISTERED, - /* Callback issued when an existing Device object instance is about to go out of scope. * * This callback IS issued BEFORE a corresponding Vulkan handle is destroyed. diff --git a/include/misc/render_pass_create_info.h b/include/misc/render_pass_create_info.h index e71852a3..3677395c 100644 --- a/include/misc/render_pass_create_info.h +++ b/include/misc/render_pass_create_info.h @@ -122,19 +122,47 @@ namespace Anvil * Note that only up to one depth/stencil attachment may be added for each subpass. * Any attempt to add more such attachments will result in an assertion failure. * - * @param in_subpass_id ID of the subpass to update the depth+stencil attachment for. - * The subpass must have been earlier created with an add_subpass() call. - * @param in_layout Layout to use for the attachment when executing the subpass. - * Driver takes care of transforming the attachment to the requested layout - * before subpass commands starts executing. - * @param in_attachment_id ID of the render-pass attachment the depth-stencil attachment should refer to. - + * If VK_KHR_depth_stencil_resolve is supported, DS resolve attachment can be configured by calling the func prototype + * which includes @param in_attachment_resolve_id_ptr, @param in_depth_resolve_mode_ptr and @param in_stencil_resolve_mode_ptr + * parameters. Otherwise, please use the prototype w/o the arguments. + * + * @param in_subpass_id ID of the subpass to update the depth+stencil attachment for. + * The subpass must have been earlier created with an add_subpass() call. + * @param in_layout Layout to use for the attachment when executing the subpass. + * Driver takes care of transforming the attachment to the requested layout + * before subpass commands starts executing. + * @param in_attachment_id ID of the render-pass attachment the depth-stencil attachment should refer to. + * @param in_attachment_resolve_id_ptr Pointer to an ID of the renderpass attachment, to which the MS attachment should be resolved to. + * Requires VK_KHR_depth_stencil_resolve support. If not nullptr, @param in_depth_resolve_mode_ptr + * and @param in_stencil_resolve_mode_ptr must also not be nullptr. + * @param in_depth_resolve_mode_ptr Pointer to resolve mode that should be used for the depth aspect. + * Requires VK_KHR_depth_stencil_resolve support. If not nullptr, @param in_opt_attachment_resolve_id_ptr + * and @param in_opt_stencil_resolve_mode_ptr must also not be nullptr. + * @param in_stencil_resolve_mode_ptr Pointer to resolve mode that should be used for the stencil aspect. + * Requires VK_KHR_depth_stencil_resolve support. If not nullptr, @param in_opt_attachment_resolve_id_ptr + * and @param in_opt_depth_resolve_mode_ptr must also not be nullptr. + * * @return true if the function executed successfully, false otherwise. * */ - bool add_subpass_depth_stencil_attachment(SubPassID in_subpass_id, - Anvil::ImageLayout in_layout, - RenderPassAttachmentID in_attachment_id); + bool add_subpass_depth_stencil_attachment(SubPassID in_subpass_id, + Anvil::ImageLayout in_layout, + RenderPassAttachmentID in_attachment_id, + const RenderPassAttachmentID* in_attachment_resolve_id_ptr, + const Anvil::ResolveModeFlagBits* in_depth_resolve_mode_ptr, + const Anvil::ResolveModeFlagBits* in_stencil_resolve_mode_ptr); + + bool add_subpass_depth_stencil_attachment(SubPassID in_subpass_id, + Anvil::ImageLayout in_layout, + RenderPassAttachmentID in_attachment_id) + { + return add_subpass_depth_stencil_attachment(in_subpass_id, + in_layout, + in_attachment_id, + nullptr, /* in_attachment_resolve_id_ptr */ + nullptr, /* in_depth_resolve_mode_ptr */ + nullptr); /* in_stencil_resolve_mode_ptr */ + } /** Adds a new input attachment to the RenderPass instance's specified subpass. * @@ -414,6 +442,9 @@ namespace Anvil } /** Retrieves subpass attachment properties, as specified at creation time. + * + * Supports all attachment types except depth/stencil resolve attachment. You can retrieve details of the attachment + * by calling get_subpass_ds_resolve_attachment_properties() instead. * * @param in_subpass_id ID of the subpass to use for the query. * @param in_attachment_type Type of the attachment to use for the query. Must not be ATTACHMENT_TYPE_PRESERVE. @@ -434,6 +465,16 @@ namespace Anvil RenderPassAttachmentID* out_opt_attachment_resolve_id_ptr = nullptr, uint32_t* out_opt_location_ptr = nullptr) const; + /* TODO. + * + * Returns false if no resolve attachment has been specified for d/ds/s attachment. + */ + bool get_subpass_ds_resolve_attachment_properties(SubPassID in_subpass_id, + RenderPassAttachmentID* out_opt_renderpass_attachment_id_ptr = nullptr, + Anvil::ImageLayout* out_opt_layout_ptr = nullptr, + Anvil::ResolveModeFlagBits* out_opt_depth_resolve_mode_ptr = nullptr, + Anvil::ResolveModeFlagBits* out_opt_stencil_resolve_mode_ptr = nullptr) const; + /* Returns highest location used by subpass attachments. * * @param in_subpass_id ID of the subpass to issue the query against. @@ -644,6 +685,9 @@ namespace Anvil { Anvil::ImageAspectFlags aspects_accessed; /* Only used for input attachments! */ + Anvil::ResolveModeFlagBits depth_resolve_mode; /* Only used for MS D/DS attachments! */ + Anvil::ResolveModeFlagBits stencil_resolve_mode; /* Only used for MS DS/S attachments! */ + uint32_t attachment_index; uint32_t highest_subpass_index; Anvil::ImageLayout layout; @@ -655,10 +699,12 @@ namespace Anvil { aspects_accessed = Anvil::ImageAspectFlagBits::NONE; attachment_index = UINT32_MAX; + depth_resolve_mode = Anvil::ResolveModeFlagBits::NONE; highest_subpass_index = UINT32_MAX; layout = Anvil::ImageLayout::UNKNOWN; lowest_subpass_index = UINT32_MAX; resolve_attachment_index = UINT32_MAX; + stencil_resolve_mode = Anvil::ResolveModeFlagBits::NONE; } /** Constructor. @@ -672,17 +718,21 @@ namespace Anvil * MS data of @param in_attachment_ptr should be resolved. If UINT32_MAX, it is * assumed the sub-pass should not resolve the MS data. **/ - SubPassAttachment(const uint32_t& in_attachment_index, - Anvil::ImageLayout in_layout, - const uint32_t& in_opt_resolve_attachment_index, - const Anvil::ImageAspectFlags& in_opt_aspects_accessed) + SubPassAttachment(const uint32_t& in_attachment_index, + Anvil::ImageLayout in_layout, + const uint32_t& in_opt_resolve_attachment_index, + const Anvil::ImageAspectFlags& in_opt_aspects_accessed, + const Anvil::ResolveModeFlagBits& in_depth_resolve_mode, + const Anvil::ResolveModeFlagBits& in_stencil_resolve_mode) { aspects_accessed = in_opt_aspects_accessed; attachment_index = in_attachment_index; + depth_resolve_mode = in_depth_resolve_mode; highest_subpass_index = UINT32_MAX; layout = in_layout; lowest_subpass_index = UINT32_MAX; resolve_attachment_index = in_opt_resolve_attachment_index; + stencil_resolve_mode = in_stencil_resolve_mode; } } SubPassAttachment; @@ -695,6 +745,7 @@ namespace Anvil { LocationToSubPassAttachmentMap color_attachments_map; SubPassAttachment depth_stencil_attachment; + SubPassAttachment ds_resolve_attachment; uint32_t index; uint32_t multiview_view_mask; uint32_t n_highest_location_used; diff --git a/include/misc/rendering_surface_create_info.h b/include/misc/rendering_surface_create_info.h new file mode 100644 index 00000000..9b1812dc --- /dev/null +++ b/include/misc/rendering_surface_create_info.h @@ -0,0 +1,99 @@ +// +// Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef MISC_RENDERING_SURFACE_CREATE_INFO_H +#define MISC_RENDERING_SURFACE_CREATE_INFO_H + +#include "misc/types.h" + +namespace Anvil +{ + class RenderingSurfaceCreateInfo + { + public: + /* Creates a new rendering surface create info instance. */ + static RenderingSurfaceCreateInfoUniquePtr create(Anvil::Instance* in_instance_ptr, + const Anvil::BaseDevice* in_device_ptr, + const Anvil::Window* in_window_ptr, + MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE); + + ~RenderingSurfaceCreateInfo(); + + const Anvil::BaseDevice* get_device_ptr() const + { + return m_device_ptr; + } + + const MTSafety& get_mt_safety() const + { + return m_mt_safety; + } + + Anvil::Instance* get_instance_ptr() const + { + return m_instance_ptr; + } + + const Anvil::Window* get_window_ptr() const + { + return m_window_ptr; + } + + void set_device_ptr(const Anvil::BaseDevice* in_device_ptr) + { + m_device_ptr = in_device_ptr; + } + + void set_mt_safety(const MTSafety& in_mt_safety) + { + m_mt_safety = in_mt_safety; + } + + void set_instance_ptr(Anvil::Instance* in_instance_ptr) + { + m_instance_ptr = in_instance_ptr; + } + + void set_window_ptr(const Anvil::Window* in_window_ptr) + { + m_window_ptr = in_window_ptr; + } + + private: + /* Private type definitions */ + + /* Private functions */ + + RenderingSurfaceCreateInfo(Anvil::Instance* in_instance_ptr, + const Anvil::BaseDevice* in_device_ptr, + const Anvil::Window* in_window_ptr, + MTSafety in_mt_safety); + + /* Private variables */ + const Anvil::BaseDevice* m_device_ptr; + Anvil::Instance* m_instance_ptr; + const Anvil::Window* m_window_ptr; + + MTSafety m_mt_safety; + }; +}; + +#endif /* MISC_RENDERING_SURFACE_CREATE_INFO_H */ diff --git a/include/misc/sampler_create_info.h b/include/misc/sampler_create_info.h index d10f1889..475a9546 100644 --- a/include/misc/sampler_create_info.h +++ b/include/misc/sampler_create_info.h @@ -32,6 +32,9 @@ namespace Anvil /* Public functions */ /** TODO + * + * NOTE: By default, no YCbCr conversion will be attached to the created sampler. In order to adjust the setting, + * call set_sampler_ycbcr_conversion_ptr() before passing the create info struct to Sampler::create(). * * For argument discussion, please consult Vulkan API specification. */ @@ -127,6 +130,11 @@ namespace Anvil return m_sampler_reduction_mode; } + const Anvil::SamplerYCbCrConversion* get_sampler_ycbcr_conversion_ptr() const + { + return m_sampler_ycbcr_conversion_ptr; + } + const bool& is_compare_enabled() const { return m_compare_enable; @@ -213,6 +221,20 @@ namespace Anvil m_sampler_reduction_mode = in_reduction_mode; } + /* Attaches or detaches already attached SamplerYCBCRConversion object from the create info struct. + * This information will be used at sampler creation time. + * + * NOTE: Requires VK_KHR_sampler_ycbcr_conversion + * + * @param in_sampler_ycbcr_conversion_ptr If not nullptr, the specified object will be passed to the implementation + * at sampler creation time by chaining VkSamplerYcbcrConversionInfo struct. + * If nullptr, the struct will not be chained. + **/ + void set_sampler_ycbcr_conversion_ptr(const Anvil::SamplerYCbCrConversion* in_sampler_ycbcr_conversion_ptr) + { + m_sampler_ycbcr_conversion_ptr = in_sampler_ycbcr_conversion_ptr; + } + void set_uses_unnormalized_coordinates(const bool& in_use_unnormalized_coordinates) { m_use_unnormalized_coordinates = in_use_unnormalized_coordinates; @@ -245,22 +267,23 @@ namespace Anvil /* Private variables */ - Anvil::SamplerAddressMode m_address_mode_u; - Anvil::SamplerAddressMode m_address_mode_v; - Anvil::SamplerAddressMode m_address_mode_w; - Anvil::BorderColor m_border_color; - bool m_compare_enable; - Anvil::CompareOp m_compare_op; - float m_lod_bias; - Anvil::Filter m_mag_filter; - float m_max_anisotropy; - float m_max_lod; - Anvil::Filter m_min_filter; - float m_min_lod; - Anvil::SamplerMipmapMode m_mipmap_mode; - Anvil::MTSafety m_mt_safety; - Anvil::SamplerReductionMode m_sampler_reduction_mode; - bool m_use_unnormalized_coordinates; + Anvil::SamplerAddressMode m_address_mode_u; + Anvil::SamplerAddressMode m_address_mode_v; + Anvil::SamplerAddressMode m_address_mode_w; + Anvil::BorderColor m_border_color; + bool m_compare_enable; + Anvil::CompareOp m_compare_op; + float m_lod_bias; + Anvil::Filter m_mag_filter; + float m_max_anisotropy; + float m_max_lod; + Anvil::Filter m_min_filter; + float m_min_lod; + Anvil::SamplerMipmapMode m_mipmap_mode; + Anvil::MTSafety m_mt_safety; + Anvil::SamplerReductionMode m_sampler_reduction_mode; + const Anvil::SamplerYCbCrConversion* m_sampler_ycbcr_conversion_ptr; + bool m_use_unnormalized_coordinates; const Anvil::BaseDevice* m_device_ptr; diff --git a/include/misc/sampler_ycbcr_conversion_create_info.h b/include/misc/sampler_ycbcr_conversion_create_info.h new file mode 100644 index 00000000..c251bf9d --- /dev/null +++ b/include/misc/sampler_ycbcr_conversion_create_info.h @@ -0,0 +1,183 @@ +// +// Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef MISC_SAMPLER_YCBCR_CONVERSION_CREATE_INFO_H +#define MISC_SAMPLER_YCBCR_CONVERSION_CREATE_INFO_H + +#include "misc/types.h" + +namespace Anvil +{ + class SamplerYCbCrConversionCreateInfo + { + public: + /* Public functions */ + + /** TODO + * + * NOTE: This object can only be used for Vulkan devices with VK_KHR_sampler_ycbcr_conversion extension support. + * + * For argument discussion, please consult Vulkan API specification. + */ + static SamplerYCbCrConversionCreateInfoUniquePtr create(const Anvil::BaseDevice* in_device_ptr, + const Anvil::Format& in_format, + const Anvil::SamplerYCbCrModelConversion& in_ycbcr_model_conversion, + const Anvil::SamplerYCbCrRange& in_ycbcr_range, + const Anvil::ComponentMapping& in_components, + const Anvil::ChromaLocation& in_x_chroma_offset, + const Anvil::ChromaLocation& in_y_chroma_offset, + const Anvil::Filter& in_chroma_filter, + const bool& in_should_force_explicit_reconstruction, + MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE); + + const Anvil::Filter& get_chroma_filter() const + { + return m_chroma_filter; + } + + const Anvil::ComponentMapping& get_components() const + { + return m_components; + } + + const Anvil::BaseDevice* get_device() const + { + return m_device_ptr; + } + + const Anvil::Format& get_format() const + { + return m_format; + } + + const Anvil::MTSafety& get_mt_safety() const + { + return m_mt_safety; + } + + const Anvil::SamplerYCbCrModelConversion& get_ycbcr_model_conversion() const + { + return m_ycbcr_model_conversion; + } + + const Anvil::ChromaLocation& get_x_chroma_offset() const + { + return m_x_chroma_offset; + } + + const Anvil::SamplerYCbCrRange& get_ycbcr_range() const + { + return m_ycbcr_range; + } + + const Anvil::ChromaLocation& get_y_chroma_offset() const + { + return m_y_chroma_offset; + } + + void set_chroma_filter(const Anvil::Filter& in_chroma_filter) + { + m_chroma_filter = in_chroma_filter; + } + + void set_components(const Anvil::ComponentMapping& in_components) + { + m_components = in_components; + } + + void set_device(const Anvil::BaseDevice* in_device_ptr) + { + m_device_ptr = in_device_ptr; + } + + void set_format(const Anvil::Format& in_format) + { + m_format = in_format; + } + + void set_mt_safety(const Anvil::MTSafety& in_mt_safety) + { + m_mt_safety = in_mt_safety; + } + + void set_ycbcr_model_conversion(const Anvil::SamplerYCbCrModelConversion& in_conversion) + { + m_ycbcr_model_conversion = in_conversion; + } + + void set_x_chroma_offset(const Anvil::ChromaLocation& in_x_chroma_offset) + { + m_x_chroma_offset = in_x_chroma_offset; + } + + void set_ycbcr_range(const Anvil::SamplerYCbCrRange& in_range) + { + m_ycbcr_range = in_range; + } + + void set_y_chroma_offset(const Anvil::ChromaLocation& in_y_chroma_offset) + { + m_y_chroma_offset = in_y_chroma_offset; + } + + void set_should_force_explicit_reconstruction(const bool& in_should_force_explicit_reconstruction) + { + m_should_force_explicit_reconstruction = in_should_force_explicit_reconstruction; + } + + const bool& should_force_explicit_reconstruction() const + { + return m_should_force_explicit_reconstruction; + } + + private: + /* Private functions */ + + SamplerYCbCrConversionCreateInfo(const Anvil::BaseDevice* in_device_ptr, + const Anvil::Format& in_format, + const Anvil::SamplerYCbCrModelConversion& in_ycbcr_model_conversion, + const Anvil::SamplerYCbCrRange& in_ycbcr_range, + const Anvil::ComponentMapping& in_components, + const Anvil::ChromaLocation& in_x_chroma_offset, + const Anvil::ChromaLocation& in_y_chroma_offset, + const Anvil::Filter& in_chroma_filter, + const bool& in_should_force_explicit_reconstruction, + MTSafety in_mt_safety); + + /* Private variables */ + + Anvil::Filter m_chroma_filter; + Anvil::ComponentMapping m_components; + const Anvil::BaseDevice* m_device_ptr; + Anvil::Format m_format; + MTSafety m_mt_safety; + bool m_should_force_explicit_reconstruction; + Anvil::ChromaLocation m_x_chroma_offset; + Anvil::ChromaLocation m_y_chroma_offset; + Anvil::SamplerYCbCrModelConversion m_ycbcr_model_conversion; + Anvil::SamplerYCbCrRange m_ycbcr_range; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(SamplerYCbCrConversionCreateInfo); + ANVIL_DISABLE_COPY_CONSTRUCTOR(SamplerYCbCrConversionCreateInfo); + }; +}; /* namespace Anvil */ + +#endif /* MISC_SAMPLER_YCBCR_CONVERSION_CREATE_INFO_H */ \ No newline at end of file diff --git a/include/misc/semaphore_create_info.h b/include/misc/semaphore_create_info.h index ad8c3bb6..2a42845d 100644 --- a/include/misc/semaphore_create_info.h +++ b/include/misc/semaphore_create_info.h @@ -130,8 +130,8 @@ namespace Anvil private: /* Private functions */ - SemaphoreCreateInfo(const Anvil::BaseDevice* in_device_ptr, - MTSafety in_mt_safety); + SemaphoreCreateInfo(const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety); /* Private variables */ const Anvil::BaseDevice* m_device_ptr; diff --git a/include/misc/swapchain_create_info.h b/include/misc/swapchain_create_info.h index 62ffcdbf..cec76095 100644 --- a/include/misc/swapchain_create_info.h +++ b/include/misc/swapchain_create_info.h @@ -37,7 +37,7 @@ namespace Anvil * * - MGPU present mode flags: Anvil::DeviceGroupPresentModeFlagBits::LOCAL_BIT_KHR * - MT safety: Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE - * - Swapchain create flags: 0 + * - Swapchain create flags: None * * To modify these, use corresponding set_..() functions. */ @@ -62,6 +62,15 @@ namespace Anvil return m_color_space; } + void get_view_format_list(const Anvil::Format** out_compatible_formats_ptr, + uint32_t* out_n_compatible_formats_ptr) const + { + anvil_assert(m_compatible_formats.size() > 0); + + *out_compatible_formats_ptr = &m_compatible_formats.at(0); + *out_n_compatible_formats_ptr = static_cast (m_compatible_formats.size() ); + } + /** Returns device instance which has been used to create the swapchain */ const Anvil::BaseDevice* get_device() const { @@ -139,6 +148,10 @@ namespace Anvil m_device_ptr = in_device_ptr; } + /* NOTE: If @param in_flags includes SwapchainCreateFlagBits::CREATE_MUTABLE_FORMAT_BIT, you must + * also call set_view_format_list() in order to specify the list of compatible formats BEFORE + * passing the create info struct to swapchain create function. + */ void set_flags(const Anvil::SwapchainCreateFlags& in_flags) { m_flags = in_flags; @@ -184,6 +197,19 @@ namespace Anvil m_usage_flags = in_new_usage_flags; } + /* Caches a list of image formats the created swapchain needs to be able to support. + * + * If SwapchainCreateFlagBits::CREATE_MUTABLE_FORMAT_BIT create flag has not been specified via set_flags(), it will + * be force-set by the function. + * + * @param in_compatible_formats_ptr Array of formats swapchain images need to support for image view usage. Must not be nullptr. + * @param in_n_compatible_formats Size of @param in_compatible_Formats_ptr array. Must be larger than 0. + * + * Requires VK_KHR_swapchain_mutable_format extension support. + */ + void set_view_format_list(const Anvil::Format* in_compatible_formats_ptr, + const uint32_t& in_n_compatible_formats); + void set_window(Anvil::Window* in_window_ptr) { m_window_ptr = in_window_ptr; @@ -211,6 +237,7 @@ namespace Anvil bool m_clipped; Anvil::ColorSpaceKHR m_color_space; + std::vector m_compatible_formats; const Anvil::BaseDevice* m_device_ptr; Anvil::SwapchainCreateFlags m_flags; Anvil::Format m_format; diff --git a/include/misc/types.h b/include/misc/types.h index d3fb026c..f4a3fbb8 100644 --- a/include/misc/types.h +++ b/include/misc/types.h @@ -119,12 +119,14 @@ namespace Anvil class DebugMessenger; class DebugMessengerCreateInfo; class DescriptorPool; + class DescriptorPoolCreateInfo; class DescriptorSet; class DescriptorSetCreateInfo; class DescriptorSetGroup; class DescriptorSetLayout; class DescriptorSetLayoutManager; class DescriptorUpdateTemplate; + class DeviceCreateInfo; class ExternalHandle; class Event; class EventCreateInfo; @@ -156,10 +158,13 @@ namespace Anvil class QueryPool; class Queue; class RenderingSurface; + class RenderingSurfaceCreateInfo; class RenderPass; class RenderPassCreateInfo; class Sampler; class SamplerCreateInfo; + class SamplerYCbCrConversion; + class SamplerYCbCrConversionCreateInfo; class SecondaryCommandBuffer; class Semaphore; class SemaphoreCreateInfo; @@ -181,6 +186,7 @@ namespace Anvil typedef std::unique_ptr ComputePipelineCreateInfoUniquePtr; typedef std::unique_ptr DebugMessengerCreateInfoUniquePtr; typedef std::unique_ptr > DebugMessengerUniquePtr; + typedef std::unique_ptr DescriptorPoolCreateInfoUniquePtr; typedef std::unique_ptr > DescriptorPoolUniquePtr; typedef std::unique_ptr DescriptorSetCreateInfoUniquePtr; typedef std::unique_ptr > DescriptorSetGroupUniquePtr; @@ -188,6 +194,7 @@ namespace Anvil typedef std::unique_ptr > DescriptorSetLayoutManagerUniquePtr; typedef std::unique_ptr > DescriptorSetUniquePtr; typedef std::unique_ptr > DescriptorUpdateTemplateUniquePtr; + typedef std::unique_ptr DeviceCreateInfoUniquePtr; typedef std::unique_ptr > ExternalHandleUniquePtr; typedef std::unique_ptr EventCreateInfoUniquePtr; typedef std::unique_ptr > EventUniquePtr; @@ -214,10 +221,13 @@ namespace Anvil typedef std::unique_ptr > PrimaryCommandBufferUniquePtr; typedef std::unique_ptr > QueryPoolUniquePtr; typedef std::unique_ptr > RenderingSurfaceUniquePtr; + typedef std::unique_ptr RenderingSurfaceCreateInfoUniquePtr; typedef std::unique_ptr RenderPassCreateInfoUniquePtr; typedef std::unique_ptr > RenderPassUniquePtr; typedef std::unique_ptr SamplerCreateInfoUniquePtr; typedef std::unique_ptr > SamplerUniquePtr; + typedef std::unique_ptr SamplerYCbCrConversionCreateInfoUniquePtr; + typedef std::unique_ptr > SamplerYCbCrConversionUniquePtr; typedef std::unique_ptr > SecondaryCommandBufferUniquePtr; typedef std::unique_ptr SemaphoreCreateInfoUniquePtr; typedef std::unique_ptr > SemaphoreUniquePtr; diff --git a/include/misc/types_classes.h b/include/misc/types_classes.h index 0977c5fc..6deaac5a 100644 --- a/include/misc/types_classes.h +++ b/include/misc/types_classes.h @@ -129,6 +129,9 @@ namespace Anvil * @param in_opt_memory_block_start_offset Start offset of the source memory region. Ignored if * @param in_opt_memory_block_ptr is NULL. * @param in_opt_memory_block_owned_by_image TODO + * @param in_n_plane Index of the image plane to use for the binding. Must be 0 for joint YUV + * and non-YUV images. For disjoint YUV images, must be a value between 0 and 2 + * inclusive. **/ void append_opaque_image_memory_update(SparseMemoryBindInfoID in_bind_info_id, Anvil::Image* in_image_ptr, @@ -137,7 +140,8 @@ namespace Anvil Anvil::SparseMemoryBindFlags in_flags, Anvil::MemoryBlock* in_opt_memory_block_ptr, VkDeviceSize in_opt_memory_block_start_offset, - bool in_opt_memory_block_owned_by_image); + bool in_opt_memory_block_owned_by_image, + uint32_t in_n_plane); /** Retrieves bind info properties. * @@ -276,6 +280,8 @@ namespace Anvil * @param out_opt_memory_block_start_offset_ptr If not NULL, deref will be set to the start offset of the memory block, which * should be used for the binding operation. Otherwise ignored. * @param out_opt_memory_block_owned_by_image_ptr TODO + * @param out_opt_n_plane_ptr If not NULL, deref will be set to index of the image plane to use for the binding + * operation. Otherwise ignored. * * @return true if successful, false otherwise. */ @@ -287,7 +293,8 @@ namespace Anvil Anvil::SparseMemoryBindFlags* out_opt_flags_ptr, Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, VkDeviceSize* out_opt_memory_block_start_offset_ptr, - bool* out_opt_memory_block_owned_by_image_ptr) const; + bool* out_opt_memory_block_owned_by_image_ptr, + uint32_t* out_opt_n_plane_ptr) const; /** Tells how many bind info items have been assigned to the descriptor */ uint32_t get_n_bind_info_items() const @@ -331,11 +338,12 @@ namespace Anvil /* Private type definitions */ typedef struct GeneralBindInfo { - VkDeviceSize start_offset; bool memory_block_owned_by_target; Anvil::MemoryBlock* memory_block_ptr; VkDeviceSize memory_block_start_offset; + uint32_t n_plane; VkDeviceSize size; + VkDeviceSize start_offset; SparseMemoryBindFlags flags; @@ -343,16 +351,20 @@ namespace Anvil { memory_block_owned_by_target = false; memory_block_ptr = nullptr; + memory_block_start_offset = 0; + n_plane = 0; + size = 0; + start_offset = 0; } } GeneralBindInfo; typedef struct ImageBindInfo { VkExtent3D extent; - VkOffset3D offset; bool memory_block_owned_by_image; Anvil::MemoryBlock* memory_block_ptr; VkDeviceSize memory_block_start_offset; + VkOffset3D offset; Anvil::ImageSubresource subresource; SparseMemoryBindFlags flags; diff --git a/include/misc/types_enums.h b/include/misc/types_enums.h index daf42a3b..56b0f2c2 100644 --- a/include/misc/types_enums.h +++ b/include/misc/types_enums.h @@ -273,6 +273,17 @@ namespace Anvil INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(AccessFlags, VkAccessFlags, AccessFlagBits) + enum class APIVersion + { + /* Vulkan 1.0 */ + _1_0, + + /* Vulkan 1.1 */ + _1_1, + + UNKNOWN + }; + /* NOTE: These map 1:1 to VK equivalents */ enum class AttachmentLoadOp { @@ -365,6 +376,9 @@ namespace Anvil SPARSE_BINDING_BIT = VK_BUFFER_CREATE_SPARSE_BINDING_BIT, SPARSE_RESIDENCY_BIT = VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT, + /* Core VK 1.1 */ + CREATE_PROTECTED_BIT = VK_BUFFER_CREATE_PROTECTED_BIT, + NONE = 0 }; typedef Anvil::Bitfield BufferCreateFlags; @@ -402,6 +416,15 @@ namespace Anvil INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(BufferUsageFlags, VkBufferUsageFlags, BufferUsageFlagBits) + /* NOTE: These map 1:1 to VK equivalents */ + enum class ChromaLocation + { + COSITED_EVEN_KHR = VK_CHROMA_LOCATION_COSITED_EVEN_KHR, + MIDPOINT_KHR = VK_CHROMA_LOCATION_MIDPOINT_KHR, + + UNKNOWN = VK_CHROMA_LOCATION_MAX_ENUM + }; + /* NOTE: These map 1:1 to VK equivalents */ enum class ColorComponentFlagBits { @@ -441,6 +464,20 @@ namespace Anvil UNKNOWN = VK_COLOR_SPACE_MAX_ENUM_KHR }; + /* NOTE: These map 1:1 to VK equivalents */ + enum class CommandPoolCreateFlagBits + { + /* Core VK 1.0 */ + CREATE_RESET_COMMAND_BUFFER_BIT = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, + CREATE_TRANSIENT_BIT = VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, + + /* Core VK 1.1 */ + CREATE_PROTECTED_BIT = VK_COMMAND_POOL_CREATE_PROTECTED_BIT, + + NONE = 0 + }; + typedef Anvil::Bitfield CommandPoolCreateFlags; + /* Note: These map 1:1 to VK equivalents. */ enum class ComponentSwizzle { @@ -467,7 +504,7 @@ namespace Anvil INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(CompositeAlphaFlags, VkCompositeAlphaFlagsKHR, CompositeAlphaFlagBits) - /* Note: These map 1:1 to VK equivalents. */ +/* Note: These map 1:1 to VK equivalents. */ enum class DebugMessageSeverityFlagBits { ERROR_BIT = VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT, @@ -525,6 +562,22 @@ namespace Anvil INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(DeviceGroupPresentModeFlags, VkDeviceGroupPresentModeFlagsKHR, DeviceGroupPresentModeFlagBits) + /* NOTE: These map 1:1 to VK equivalents */ + enum class DriverIdKHR + { + AMD_PROPRIETARY_KHR = VK_DRIVER_ID_AMD_PROPRIETARY_KHR, + AMD_OPEN_SOURCE_KHR = VK_DRIVER_ID_AMD_OPEN_SOURCE_KHR, + ARM_PROPRIETARY_KHR = VK_DRIVER_ID_ARM_PROPRIETARY_KHR, + IMAGINATION_PROPRIETARY_KHR = VK_DRIVER_ID_IMAGINATION_PROPRIETARY_KHR, + INTEL_OPEN_SOURCE_MESA_KHR = VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA_KHR, + INTEL_PROPRIETARY_WINDOWS_KHR = VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS_KHR, + MESA_RADV_KHR = VK_DRIVER_ID_MESA_RADV_KHR, + NVIDIA_PROPRIETARY_KHR = VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR, + QUALCOMM_PROPRIETARY_KHR = VK_DRIVER_ID_QUALCOMM_PROPRIETARY_KHR, + + UNKNOWN + }; + enum class DynamicState { /* Core VK 1.0 */ @@ -624,6 +677,15 @@ namespace Anvil TRANSFER_DST_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR, TRANSFER_SRC_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR, + /* KHR_sampler_ycbcr_conversion */ + MIDPOINT_CHROMA_SAMPLES_BIT_KHR = VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT_KHR, + COSITED_CHROMA_SAMPLES_BIT_KHR = VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR, + SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR, + SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR, + SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR, + SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR, + DISJOINT_BIT_KHR = VK_FORMAT_FEATURE_DISJOINT_BIT_KHR, + NONE = 0 }; typedef Anvil::Bitfield FormatFeatureFlags; @@ -692,6 +754,15 @@ namespace Anvil UNKNOWN }; + enum class ConservativeRasterizationModeEXT + { + DISABLED = VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT, + OVERESTIMATE = VK_CONSERVATIVE_RASTERIZATION_MODE_OVERESTIMATE_EXT, + UNDERESTIMATE = VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT, + + UNKNOWN = VK_CONSERVATIVE_RASTERIZATION_MODE_MAX_ENUM_EXT + }; + /* NOTE: These map 1:1 to VK equivalents */ enum class CullModeFlagBits { @@ -790,6 +861,8 @@ namespace Anvil /* NOTE: These map 1:1 to VK equivalents */ enum class DescriptorType { + /* Core VK 1.0 functionality */ + COMBINED_IMAGE_SAMPLER = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, INPUT_ATTACHMENT = VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, SAMPLED_IMAGE = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, @@ -802,6 +875,10 @@ namespace Anvil UNIFORM_BUFFER_DYNAMIC = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, UNIFORM_TEXEL_BUFFER = VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, + /* Requires VK_EXT_inline_uniform_block */ + INLINE_UNIFORM_BLOCK = VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT, + + UNKNOWN = VK_DESCRIPTOR_TYPE_MAX_ENUM }; @@ -1015,7 +1092,7 @@ namespace Anvil ASTC_12x12_UNORM_BLOCK = VK_FORMAT_ASTC_12x12_UNORM_BLOCK, ASTC_12x12_SRGB_BLOCK = VK_FORMAT_ASTC_12x12_SRGB_BLOCK, - /* VK_KHR_sampler_ycbcr_conversion */ + /* Requires VK_KHR_sampler_ycbcr_conversion */ G8B8G8R8_422_UNORM = VK_FORMAT_G8B8G8R8_422_UNORM_KHR, B8G8R8G8_422_UNORM = VK_FORMAT_B8G8R8G8_422_UNORM_KHR, G8_B8_R8_3PLANE_420_UNORM = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR, @@ -1126,6 +1203,12 @@ namespace Anvil BLOCK_TEXEL_VIEW_COMPATIBLE_BIT = VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR, EXTENDED_USAGE_BIT = VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR, + /* NOTE: Requires VK_KHR_sampler_ycbcr_conversion */ + CREATE_DISJOINT_BIT = VK_IMAGE_CREATE_DISJOINT_BIT_KHR, + + /* Note: Requires core VK 1.1 or newer */ + CREATE_PROTECTED_BIT = VK_IMAGE_CREATE_PROTECTED_BIT, + NONE = 0 }; typedef Anvil::Bitfield ImageCreateFlags; @@ -1251,7 +1334,8 @@ namespace Anvil { DERIVED, DERIVED_WITH_CUSTOM_DELETE_PROC, - REGULAR + REGULAR, + REGULAR_WITH_MEMORY_TYPE }; enum class MemoryFeatureFlagBits @@ -1267,6 +1351,9 @@ namespace Anvil MAPPABLE_BIT = 1 << 4, MULTI_INSTANCE_BIT = 1 << 5, + /* Core VK 1.1 only */ + PROTECTED_BIT = 1 << 6, + NONE = 0 }; typedef Anvil::Bitfield MemoryFeatureFlags; @@ -1279,16 +1366,25 @@ namespace Anvil /* Core VK 1.0 */ DEVICE_LOCAL_BIT = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT, - /* VK_KHR_device_group */ + /* VK_KHR_device_group or core VK 1.1 */ MULTI_INSTANCE_BIT_KHR = VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR, - NONE = 0 }; typedef Anvil::Bitfield MemoryHeapFlags; INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(MemoryHeapFlags, VkMemoryHeapFlags, MemoryHeapFlagBits) + /* NOTE: Maps 1:1 to VK equivalents */ + enum class MemoryOverallocationBehavior + { + ALLOWED = VK_MEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD, + DEFAULT = VK_MEMORY_OVERALLOCATION_BEHAVIOR_DEFAULT_AMD, + DISALLOWED = VK_MEMORY_OVERALLOCATION_BEHAVIOR_DISALLOWED_AMD, + + UNKNOWN = VK_MEMORY_OVERALLOCATION_BEHAVIOR_MAX_ENUM_AMD + }; + /* NOTE: These map 1:1 to VK equivalents */ enum class MemoryPropertyFlagBits { @@ -1299,6 +1395,9 @@ namespace Anvil HOST_VISIBLE_BIT = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, LAZILY_ALLOCATED_BIT = VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT, + /* Core VK 1.1 */ + PROTECTED_BIT = VK_MEMORY_PROPERTY_PROTECTED_BIT, + NONE = 0 }; typedef Anvil::Bitfield MemoryPropertyFlags; @@ -1343,6 +1442,7 @@ namespace Anvil RENDER_PASS = VK_OBJECT_TYPE_RENDER_PASS, RENDERING_SURFACE = VK_OBJECT_TYPE_SURFACE_KHR, SAMPLER = VK_OBJECT_TYPE_SAMPLER, + SAMPLER_YCBCR_CONVERSION = VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR, SEMAPHORE = VK_OBJECT_TYPE_SEMAPHORE, SHADER_MODULE = VK_OBJECT_TYPE_SHADER_MODULE, SWAPCHAIN = VK_OBJECT_TYPE_SWAPCHAIN_KHR, @@ -1489,9 +1589,9 @@ namespace Anvil /** A bitmask defining one or more queue family usage.*/ enum class QueueFamilyFlagBits { - COMPUTE_BIT = 1 << 0, - DMA_BIT = 1 << 1, - GRAPHICS_BIT = 1 << 2, + COMPUTE_BIT = 1 << 0, + DMA_BIT = 1 << 1, + GRAPHICS_BIT = 1 << 2, FIRST_BIT = COMPUTE_BIT, LAST_BIT = GRAPHICS_BIT, @@ -1502,6 +1602,17 @@ namespace Anvil INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(QueueFamilyFlags, uint32_t, QueueFamilyFlagBits) + /* NOTE: These map 1:1 to VK equivalents */ + enum class QueueGlobalPriority + { + HIGH_EXT = VK_QUEUE_GLOBAL_PRIORITY_HIGH_EXT, + LOW_EXT = VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT, + MEDIUM_EXT = VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT, + REALTIME_EXT = VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT, + + UNKNOWN = VK_QUEUE_GLOBAL_PRIORITY_MAX_ENUM_EXT + }; + /** Enumerates all available queue family types */ enum class QueueFamilyType { @@ -1531,6 +1642,9 @@ namespace Anvil SPARSE_BINDING_BIT = VK_QUEUE_SPARSE_BINDING_BIT, TRANSFER_BIT = VK_QUEUE_TRANSFER_BIT, + /* Core VK 1.1 */ + PROTECTED_BIT = VK_QUEUE_PROTECTED_BIT, + NONE = 0 }; typedef Anvil::Bitfield QueueFlags; @@ -1606,6 +1720,22 @@ namespace Anvil UNKNOWN = VK_RASTERIZATION_ORDER_MAX_ENUM_AMD }; + /* NOTE: These map 1:1 to VK equivalents */ + enum class ResolveModeFlagBits + { + /* VK_KHR_depth_stencil_resolve */ + + SAMPLE_ZERO_BIT_KHR = VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR, + AVERAGE_BIT_KHR = VK_RESOLVE_MODE_AVERAGE_BIT_KHR, + MIN_BIT_KHR = VK_RESOLVE_MODE_MIN_BIT_KHR, + MAX_BIT_KHR = VK_RESOLVE_MODE_MAX_BIT_KHR, + + NONE = VK_RESOLVE_MODE_NONE_KHR, + }; + typedef Anvil::Bitfield ResolveModeFlags; + + INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(ResolveModeFlags, VkResolveModeFlagsKHR, ResolveModeFlagBits) + /* NOTE: These map 1:1 to VK equivalents */ enum class SampleCountFlagBits { @@ -1658,6 +1788,30 @@ namespace Anvil UNKNOWN = VK_SAMPLER_REDUCTION_MODE_MAX_ENUM_EXT }; + /* NOTE: These map 1:1 to VK equivalents */ + enum class SamplerYCbCrModelConversion + { + RGB_IDENTITY_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY_KHR, + YCBCR_IDENTITY_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY_KHR, + YCBCR_709_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709_KHR, + YCBCR_601_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601_KHR, + YCBCR_2020_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR, + + UNKNOWN = VK_SAMPLER_YCBCR_MODEL_CONVERSION_MAX_ENUM + }; + + /* NOTE: These map 1:1 to VK equivalents */ + enum class SamplerYCbCrRange + { + RGB_IDENTITY_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY_KHR, + YCBCR_IDENTITY_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY_KHR, + YCBCR_709_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709_KHR, + YCBCR_601_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601_KHR, + YCBCR_2020_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR, + + UNKNOWN = VK_SAMPLER_YCBCR_MODEL_CONVERSION_MAX_ENUM + }; + /* Specifies one of the compute / rendering pipeline stages. */ enum class ShaderStage { @@ -1739,6 +1893,17 @@ namespace Anvil INJECT_BITFIELD_HELPER_FUNC_PROTOTYPES(SparseMemoryBindFlags, VkSparseMemoryBindFlags, SparseMemoryBindFlagBits) + /* Specifies SPIR-V language version */ + enum class SpvVersion + { + _1_0, + _1_1, + _1_2, + _1_3, + _1_4, + UNKNOWN + }; + /* NOTE: These map 1:1 to VK equivalents */ enum class StencilFaceFlagBits { @@ -1765,6 +1930,23 @@ namespace Anvil UNKNOWN = VK_STENCIL_OP_MAX_ENUM }; + /* NOTE: These map 1:1 to VK equivalents */ + enum class SubgroupFeatureFlagBits + { + ARITHMETIC_BIT = VK_SUBGROUP_FEATURE_ARITHMETIC_BIT, + BALLOT_BIT = VK_SUBGROUP_FEATURE_BALLOT_BIT, + BASIC_BIT = VK_SUBGROUP_FEATURE_BASIC_BIT, + CLUSTERED_BIT = VK_SUBGROUP_FEATURE_CLUSTERED_BIT, + QUAD_BIT = VK_SUBGROUP_FEATURE_QUAD_BIT, + RELATIVE_BIT = VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT, + SHUFFLE_BIT = VK_SUBGROUP_FEATURE_SHUFFLE_BIT, + VOTE_BIT = VK_SUBGROUP_FEATURE_VOTE_BIT, + + NONE = VK_SUBGROUP_FEATURE_FLAG_BITS_MAX_ENUM + }; + + typedef Anvil::Bitfield SubgroupFeatureFlags; + /* NOTE: These map 1:1 to VK equivalents */ enum class SubpassContents { @@ -1798,6 +1980,9 @@ namespace Anvil /* Requires VK_KHR_device_group */ SPLIT_INSTANCE_BIND_REGIONS_BIT = VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR, + /* Requires VK_KHR_swapchain_mutable_format */ + CREATE_MUTABLE_FORMAT_BIT = VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR, + NONE = 0 }; typedef Anvil::Bitfield SwapchainCreateFlags; @@ -1832,4 +2017,4 @@ namespace Anvil }; }; /* namespace Anvil */ -#endif /* TYPES_ENUMS_H */ \ No newline at end of file +#endif /* TYPES_ENUMS_H */ diff --git a/include/misc/types_struct.h b/include/misc/types_struct.h index 201256c2..25325124 100644 --- a/include/misc/types_struct.h +++ b/include/misc/types_struct.h @@ -22,6 +22,14 @@ #ifndef TYPES_STRUCT_H #define TYPES_STRUCT_H +#ifdef major + #undef major +#endif + +#ifdef minor + #undef minor +#endif + namespace Anvil { /* Note: Matches VkSampleLocationEXT in terms of the layout and size. @@ -517,8 +525,83 @@ namespace Anvil cmd_buffer_ptr = nullptr; device_mask = 0; } + + CommandBufferMGPUSubmission(Anvil::CommandBufferBase* in_cmd_buffer_ptr, + const uint32_t& in_device_mask) + :cmd_buffer_ptr(in_cmd_buffer_ptr), + device_mask (in_device_mask) + { + /* Stub */ + } + } CommandBufferMGPUSubmission; + /* NOTE: Matches VK equivalent */ + struct ComponentMapping + { + Anvil::ComponentSwizzle r; + Anvil::ComponentSwizzle g; + Anvil::ComponentSwizzle b; + Anvil::ComponentSwizzle a; + + explicit ComponentMapping(const Anvil::ComponentSwizzle& in_r, + const Anvil::ComponentSwizzle& in_g, + const Anvil::ComponentSwizzle& in_b, + const Anvil::ComponentSwizzle& in_a) + :r(in_r), + g(in_g), + b(in_b), + a(in_a) + { + /* Stub */ + } + + const VkComponentMapping& get_vk() const + { + return *reinterpret_cast(this); + } + }; + + static_assert(sizeof(VkComponentMapping) == sizeof(ComponentMapping), "Anvil/VK struct size mismatch"); + static_assert(offsetof(VkComponentMapping, r) == offsetof(ComponentMapping, r), "Anvil/VK member offset mismatch"); + static_assert(offsetof(VkComponentMapping, g) == offsetof(ComponentMapping, g), "Anvil/VK member offset mismatch"); + static_assert(offsetof(VkComponentMapping, b) == offsetof(ComponentMapping, b), "Anvil/VK member offset mismatch"); + static_assert(offsetof(VkComponentMapping, a) == offsetof(ComponentMapping, a), "Anvil/VK member offset mismatch"); + + struct ConformanceVersionKHR + { + uint8_t major; + uint8_t minor; + uint8_t patch; + uint8_t subminor; + + ConformanceVersionKHR() + :major (0), + minor (0), + patch (0), + subminor(0) + { + /* Stub */ + } + + ConformanceVersionKHR(const VkConformanceVersionKHR& in_version) + :major (in_version.major), + minor (in_version.minor), + patch (in_version.patch), + subminor(in_version.subminor) + { + /* Stub */ + } + + bool operator==(const ConformanceVersionKHR& in_version) const + { + return (major == in_version.major) && + (minor == in_version.minor) && + (patch == in_version.patch) && + (subminor == in_version.subminor); + } + }; + /* Holds contents of VkDebugUtilsLabelEXT minus pNext and sType */ struct DebugLabel { @@ -586,6 +669,38 @@ namespace Anvil } ExternalNTHandleInfo; #endif + typedef struct EXTConservativeRasterizationProperties + { + bool conservative_point_and_line_rasterization; + bool conservative_rasterization_post_depth_coverage; + bool degenerate_lines_rasterized; + bool degenerate_triangles_rasterized; + float extra_primitive_overestimation_size_granularity; + bool fully_covered_fragment_shader_input_variable; + float max_extra_primitive_overestimation_size; + float primitive_overestimation_size; + bool primitive_underestimation; + + EXTConservativeRasterizationProperties(); + EXTConservativeRasterizationProperties(const VkPhysicalDeviceConservativeRasterizationPropertiesEXT& in_properties); + + VkPhysicalDeviceConservativeRasterizationPropertiesEXT get_vk_physical_device_conservative_rasterization_properties() const; + + bool operator==(const EXTConservativeRasterizationProperties& in_properties) const; + } EXTConservativeRasterizationProperties; + + typedef struct EXTDepthClipEnableFeatures + { + bool depth_clip_enable; + + EXTDepthClipEnableFeatures(); + EXTDepthClipEnableFeatures(const VkPhysicalDeviceDepthClipEnableFeaturesEXT& in_features); + + VkPhysicalDeviceDepthClipEnableFeaturesEXT get_vk_physical_device_depth_clip_enable_features() const; + + bool operator==(const EXTDepthClipEnableFeatures& in_features) const; + } EXTDepthClipEnableFeatures; + typedef struct EXTDescriptorIndexingFeatures { bool descriptor_binding_partially_bound; @@ -694,28 +809,6 @@ namespace Anvil bool operator==(const EXTVertexAttributeDivisorProperties& in_props) const; } EXTVertexAttributeDivisorProperties; - /* Used by Image::set_memory_multi(). Requires VK_KHR_device_group support. */ - typedef struct ImagePhysicalDeviceMemoryBindingUpdate - { - Anvil::Image* image_ptr; - bool memory_block_owned_by_image; - Anvil::MemoryBlock* memory_block_ptr; - std::vector physical_devices; - - ImagePhysicalDeviceMemoryBindingUpdate(); - } ImagePhysicalDeviceMemoryBindingUpdate; - - /* Used by Image::set_memory_multi(). Requires VK_KHR_device_group support. */ - typedef struct ImageSFRMemoryBindingUpdate - { - Anvil::Image* image_ptr; - bool memory_block_owned_by_image; - Anvil::MemoryBlock* memory_block_ptr; - std::vector SFRs; - - ImageSFRMemoryBindingUpdate(); - } ImageSFRMemoryBindingUpdate; - typedef struct DescriptorSetAllocation { /* Descriptor set layout to use for the allocation request */ @@ -1023,6 +1116,14 @@ namespace Anvil ExtensionKHRMaintenance3Entrypoints(); } ExtensionKHRMaintenance3Entrypoints; + typedef struct ExtensionKHRSamplerYCbCrConversionEntrypoints + { + PFN_vkCreateSamplerYcbcrConversionKHR vkCreateSamplerYcbcrConversionKHR; + PFN_vkDestroySamplerYcbcrConversionKHR vkDestroySamplerYcbcrConversionKHR; + + ExtensionKHRSamplerYCbCrConversionEntrypoints(); + } ExtensionKHRSamplerYCbCrConversionEntrypoints; + typedef struct ExtensionKHRSurfaceEntrypoints { PFN_vkDestroySurfaceKHR vkDestroySurfaceKHR; @@ -1073,6 +1174,36 @@ namespace Anvil ExtensionKHRDeviceGroupCreationEntrypoints(); } ExtensionKHRDeviceGroupCreationEntrypoints; + typedef struct EXTInlineUniformBlockFeatures + { + bool descriptor_binding_inline_uniform_block_update_after_bind; + bool inline_uniform_block; + + EXTInlineUniformBlockFeatures(); + EXTInlineUniformBlockFeatures(const VkPhysicalDeviceInlineUniformBlockFeaturesEXT& in_features); + + VkPhysicalDeviceInlineUniformBlockFeaturesEXT get_vk_physical_device_inline_uniform_block_features() const; + + bool operator==(const EXTInlineUniformBlockFeatures&) const; + + } EXTInlineUniformBlockFeatures; + + typedef struct EXTInlineUniformBlockProperties + { + uint32_t max_descriptor_set_inline_uniform_blocks; + uint32_t max_inline_uniform_block_size; + uint32_t max_per_stage_descriptor_inline_uniform_blocks; + + uint32_t max_descriptor_set_update_after_bind_inline_uniform_blocks; + uint32_t max_per_stage_descriptor_update_after_bind_inline_uniform_blocks; + + EXTInlineUniformBlockProperties(); + EXTInlineUniformBlockProperties(const VkPhysicalDeviceInlineUniformBlockPropertiesEXT& in_props); + + bool operator==(const EXTInlineUniformBlockProperties&) const; + + } EXTInlineUniformBlockProperties; + typedef struct EXTSamplerFilterMinmaxProperties { bool filter_minmax_single_component_formats; @@ -1085,6 +1216,19 @@ namespace Anvil } EXTSamplerFilterMinmaxProperties; + typedef struct KHRSamplerYCbCrConversionFeatures + { + bool sampler_ycbcr_conversion; + + KHRSamplerYCbCrConversionFeatures(); + KHRSamplerYCbCrConversionFeatures(const VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR& in_features); + + VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR get_vk_physical_device_sampler_ycbcr_conversion_features() const; + + bool operator==(const KHRSamplerYCbCrConversionFeatures&) const; + + } KHRSamplerYCbCrConversionFeatures; + typedef struct FenceProperties { ExternalFenceProperties external_fence_properties; @@ -1190,9 +1334,22 @@ namespace Anvil uint32_t n_max_mip_levels; Anvil::SampleCountFlags sample_counts; + /* Tells how any combined image sampler descriptors the running Vulkan implementation is going to use to provide + * support for accessing the format. + * + * This will only be non-zero if VK_KHR_sampler_ycbcr_conversion is supported and the query targets one of the YUV formats. + */ + uint32_t n_combined_image_sampler_descriptors_used; + /* Tells whether the format can be used with functions introduced in VK_AMD_texture_gather_bias_lod */ bool supports_amd_texture_gather_bias_lod; + /* Tells what usage flags can be requested for this image format, specifically for the stencil image aspect. + * + * Only meaningful if VK_EXT_separate_stencil_usage extension is supported. + */ + Anvil::ImageUsageFlags valid_stencil_aspect_image_usage_flags; + /** Dummy constructor */ ImageFormatProperties(); @@ -1201,9 +1358,11 @@ namespace Anvil * * @param in_format_props Vulkan structure to use for initialization. **/ - ImageFormatProperties(const VkImageFormatProperties& in_image_format_props, - const bool& in_supports_amd_texture_gather_bias_lod, - const ExternalMemoryProperties& in_external_handle_properties); + ImageFormatProperties(const VkImageFormatProperties& in_image_format_props, + const bool& in_supports_amd_texture_gather_bias_lod, + const ExternalMemoryProperties& in_external_handle_properties, + const Anvil::ImageUsageFlags& in_valid_stencil_aspect_image_usage_flags, + const uint32_t& in_n_combined_image_sampler_descriptors_used); } ImageFormatProperties; typedef struct ImageFormatPropertiesQuery @@ -1351,6 +1510,18 @@ namespace Anvil } } ExternalMemoryHandleImportInfo; + typedef struct EXTScalarBlockLayoutFeatures + { + bool scalar_block_layout; + + EXTScalarBlockLayoutFeatures(); + EXTScalarBlockLayoutFeatures(const VkPhysicalDeviceScalarBlockLayoutFeaturesEXT& in_features); + + VkPhysicalDeviceScalarBlockLayoutFeaturesEXT get_vk_physical_device_scalar_block_layout_features_ext() const; + + bool operator==(const EXTScalarBlockLayoutFeatures& in_features) const; + } EXTScalarBlockLayoutFeatures; + typedef struct EXTTransformFeedbackFeatures { bool geometry_streams; @@ -1384,6 +1555,29 @@ namespace Anvil } EXTTransformFeedbackProperties; + typedef struct MemoryBudget + { + std::array heap_budget; + std::array heap_usage; + + MemoryBudget(); + MemoryBudget(const VkPhysicalDeviceMemoryBudgetPropertiesEXT& in_properties); + + } MemoryBudget; + + typedef struct EXTMemoryPriorityFeatures + { + bool is_memory_priority_supported; + + EXTMemoryPriorityFeatures(); + EXTMemoryPriorityFeatures(const VkPhysicalDeviceMemoryPriorityFeaturesEXT& in_features); + + VkPhysicalDeviceMemoryPriorityFeaturesEXT get_vk_physical_device_memory_priority_features() const; + + bool operator==(const EXTMemoryPriorityFeatures&) const; + + } EXTMemoryPriorityFeatures; + typedef struct KHR16BitStorageFeatures { bool is_input_output_storage_supported; @@ -1413,6 +1607,33 @@ namespace Anvil bool operator==(const KHR8BitStorageFeatures& in_features) const; } KHR8BitStorageFeatures; + typedef struct KHRDepthStencilResolveProperties + { + bool independent_resolve; + bool independent_resolve_none; + Anvil::ResolveModeFlags supported_depth_resolve_modes; + Anvil::ResolveModeFlags supported_stencil_resolve_modes; + + KHRDepthStencilResolveProperties(); + KHRDepthStencilResolveProperties(const VkPhysicalDeviceDepthStencilResolvePropertiesKHR& in_properties); + + bool operator==(const KHRDepthStencilResolveProperties& in_props) const; + } KHRDepthStencilResolveProperties; + + typedef struct KHRDriverPropertiesProperties + { + Anvil::ConformanceVersionKHR conformance_version; + Anvil::DriverIdKHR driver_id; + char driver_name[VK_MAX_DRIVER_NAME_SIZE_KHR]; + char driver_info[VK_MAX_DRIVER_INFO_SIZE_KHR]; + + KHRDriverPropertiesProperties(); + KHRDriverPropertiesProperties(const VkPhysicalDeviceDriverPropertiesKHR& in_properties); + + bool operator==(const KHRDriverPropertiesProperties& in_props) const; + + } KHRDriverPropertiesProperties; + typedef struct KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties { uint8_t device_luid[VK_LUID_SIZE]; @@ -1430,6 +1651,20 @@ namespace Anvil } KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties; + typedef struct KHRFloat16Int8Features + { + bool shader_float16; + bool shader_int8; + + KHRFloat16Int8Features(); + KHRFloat16Int8Features(const VkPhysicalDeviceFloat16Int8FeaturesKHR& in_features); + + VkPhysicalDeviceFloat16Int8FeaturesKHR get_vk_physical_device_float16_int8_features() const; + + bool operator==(const KHRFloat16Int8Features&) const; + + } KHRFloat16Int8Features; + typedef struct KHRMaintenance2PhysicalDevicePointClippingProperties { PointClippingBehavior point_clipping_behavior; @@ -1479,7 +1714,48 @@ namespace Anvil } KHRMultiviewProperties; - typedef struct KHRVariablePointerFeatures + typedef struct KHRShaderAtomicInt64Features + { + bool shader_buffer_int64_atomics; + bool shader_shared_int64_atomics; + + KHRShaderAtomicInt64Features(); + KHRShaderAtomicInt64Features(const VkPhysicalDeviceShaderAtomicInt64FeaturesKHR& in_features); + + VkPhysicalDeviceShaderAtomicInt64FeaturesKHR get_vk_physical_device_shader_atomic_int64_features() const; + + bool operator==(const KHRShaderAtomicInt64Features& in_features) const; + } KHRShaderAtomicInt64Features; + + typedef struct KHRShaderFloatControlsProperties + { + bool separate_denorm_settings; + bool separate_rounding_mode_settings; + bool shader_denorm_flush_to_zero_float16; + bool shader_denorm_flush_to_zero_float32; + bool shader_denorm_flush_to_zero_float64; + bool shader_denorm_preserve_float16; + bool shader_denorm_preserve_float32; + bool shader_denorm_preserve_float64; + bool shader_rounding_mode_RTE_float16; + bool shader_rounding_mode_RTE_float32; + bool shader_rounding_mode_RTE_float64; + bool shader_rounding_mode_RTZ_float16; + bool shader_rounding_mode_RTZ_float32; + bool shader_rounding_mode_RTZ_float64; + bool shader_signed_zero_inf_nan_preserve_float16; + bool shader_signed_zero_inf_nan_preserve_float32; + bool shader_signed_zero_inf_nan_preserve_float64; + + KHRShaderFloatControlsProperties(); + KHRShaderFloatControlsProperties(const VkPhysicalDeviceFloatControlsPropertiesKHR& in_properties); + + VkPhysicalDeviceFloatControlsPropertiesKHR get_vk_physical_device_float_controls_properties() const; + + bool operator==(const KHRShaderFloatControlsProperties& in_properties) const; + } KHRShaderFloatControlsProperties; + + typedef struct KHRVariablePointerFeatures { bool variable_pointers; bool variable_pointers_storage_buffer; @@ -1492,6 +1768,20 @@ namespace Anvil bool operator==(const KHRVariablePointerFeatures& in_features) const; } KHRVariablePointerFeatures; + typedef struct KHRVulkanMemoryModelFeatures + { + bool vulkan_memory_model; + bool vulkan_memory_model_availability_visibility_chains; + bool vulkan_memory_model_device_scope; + + KHRVulkanMemoryModelFeatures(); + KHRVulkanMemoryModelFeatures(const VkPhysicalDeviceVulkanMemoryModelFeaturesKHR& in_features); + + VkPhysicalDeviceVulkanMemoryModelFeaturesKHR get_vk_physical_device_vulkan_memory_model_features() const; + + bool operator==(const KHRVulkanMemoryModelFeatures& in_features) const; + } KHRVulkanMemoryModelFeatures; + /** Holds properties of a single Vulkan Layer. */ typedef struct Layer { @@ -1994,6 +2284,18 @@ namespace Anvil } page_bits; } PageOccupancyStatus; + typedef struct PhysicalDeviceProtectedMemoryFeatures + { + bool protected_memory; + + PhysicalDeviceProtectedMemoryFeatures(); + PhysicalDeviceProtectedMemoryFeatures(const VkPhysicalDeviceProtectedMemoryFeatures& in_features); + + VkPhysicalDeviceProtectedMemoryFeatures get_vk_physical_device_protected_memory_features() const; + + bool operator==(const PhysicalDeviceProtectedMemoryFeatures& in_features) const; + } PhysicalDeviceProtectedMemoryFeatures; + typedef struct PhysicalDeviceFeaturesCoreVK10 { bool alpha_to_one; @@ -2060,24 +2362,53 @@ namespace Anvil } PhysicalDeviceFeaturesCoreVK10; + typedef struct PhysicalDeviceFeaturesCoreVK11 + { + PhysicalDeviceProtectedMemoryFeatures protected_memory_features; + + bool operator==(const PhysicalDeviceFeaturesCoreVK11& in_data) const; + + PhysicalDeviceFeaturesCoreVK11(); + PhysicalDeviceFeaturesCoreVK11(const PhysicalDeviceProtectedMemoryFeatures& in_protected_memory_features); + + } PhysicalDeviceFeaturesCoreVK11; + typedef struct PhysicalDeviceFeatures { - const PhysicalDeviceFeaturesCoreVK10* core_vk1_0_features_ptr; - const EXTDescriptorIndexingFeatures* ext_descriptor_indexing_features_ptr; - const EXTTransformFeedbackFeatures* ext_transform_feedback_features_ptr; - const KHR16BitStorageFeatures* khr_16bit_storage_features_ptr; - const KHR8BitStorageFeatures* khr_8bit_storage_features_ptr; - const KHRMultiviewFeatures* khr_multiview_features_ptr; - const KHRVariablePointerFeatures* khr_variable_pointer_features_ptr; + const PhysicalDeviceFeaturesCoreVK10* core_vk1_0_features_ptr; + const PhysicalDeviceFeaturesCoreVK11* core_vk1_1_features_ptr; + const EXTDepthClipEnableFeatures* ext_depth_clip_enable_features_ptr; + const EXTDescriptorIndexingFeatures* ext_descriptor_indexing_features_ptr; + const EXTInlineUniformBlockFeatures* ext_inline_uniform_block_features_ptr; + const EXTScalarBlockLayoutFeatures* ext_scalar_block_layout_features_ptr; + const EXTTransformFeedbackFeatures* ext_transform_feedback_features_ptr; + const EXTMemoryPriorityFeatures* ext_memory_priority_features_ptr; + const KHR16BitStorageFeatures* khr_16bit_storage_features_ptr; + const KHR8BitStorageFeatures* khr_8bit_storage_features_ptr; + const KHRFloat16Int8Features* khr_float16_int8_features_ptr; + const KHRMultiviewFeatures* khr_multiview_features_ptr; + const KHRSamplerYCbCrConversionFeatures* khr_sampler_ycbcr_conversion_features_ptr; + const KHRShaderAtomicInt64Features* khr_shader_atomic_int64_features_ptr; + const KHRVariablePointerFeatures* khr_variable_pointer_features_ptr; + const KHRVulkanMemoryModelFeatures* khr_vulkan_memory_model_features_ptr; PhysicalDeviceFeatures(); - PhysicalDeviceFeatures(const PhysicalDeviceFeaturesCoreVK10* in_core_vk1_0_features_ptr, - const EXTDescriptorIndexingFeatures* in_ext_descriptor_indexing_features_ptr, - const EXTTransformFeedbackFeatures* in_ext_transform_feedback_features_ptr, - const KHR16BitStorageFeatures* in_khr_16_bit_storage_features_ptr, - const KHR8BitStorageFeatures* in_khr_8_bit_storage_features_ptr, - const KHRMultiviewFeatures* in_khr_multiview_features_ptr, - const KHRVariablePointerFeatures* in_khr_variable_pointer_features_ptr); + PhysicalDeviceFeatures(const PhysicalDeviceFeaturesCoreVK10* in_core_vk1_0_features_ptr, + const PhysicalDeviceFeaturesCoreVK11* in_core_vk1_1_features_ptr, + const EXTDepthClipEnableFeatures* in_ext_depth_clip_enable_features_ptr, + const EXTDescriptorIndexingFeatures* in_ext_descriptor_indexing_features_ptr, + const EXTInlineUniformBlockFeatures* in_ext_inline_uniform_block_features_ptr, + const EXTScalarBlockLayoutFeatures* in_ext_scalar_block_layout_features_ptr, + const EXTTransformFeedbackFeatures* in_ext_transform_feedback_features_ptr, + const EXTMemoryPriorityFeatures* in_ext_memory_priority_features_ptr, + const KHR16BitStorageFeatures* in_khr_16_bit_storage_features_ptr, + const KHR8BitStorageFeatures* in_khr_8_bit_storage_features_ptr, + const KHRFloat16Int8Features* in_khr_float16_int8_features_ptr, + const KHRMultiviewFeatures* in_khr_multiview_features_ptr, + const KHRSamplerYCbCrConversionFeatures* in_khr_sampler_ycbcr_conversion_features_ptr, + const KHRShaderAtomicInt64Features* in_khr_shader_atomic_int64_features_ptr, + const KHRVariablePointerFeatures* in_khr_variable_pointer_features_ptr, + const KHRVulkanMemoryModelFeatures* in_khr_vulkan_memory_model_features_ptr); bool operator==(const PhysicalDeviceFeatures& in_physical_device_features) const; } PhysicalDeviceFeatures; @@ -2197,6 +2528,16 @@ namespace Anvil bool operator==(const PhysicalDeviceLimits& in_device_limits) const; } PhysicalDeviceLimits; + typedef struct PhysicalDeviceProtectedMemoryProperties + { + bool protected_no_fault; + + PhysicalDeviceProtectedMemoryProperties(); + PhysicalDeviceProtectedMemoryProperties(const VkPhysicalDeviceProtectedMemoryProperties& in_props); + + bool operator==(const PhysicalDeviceProtectedMemoryProperties& in_props) const; + } PhysicalDeviceProtectedMemoryProperties; + typedef struct PhysicalDeviceSparseProperties { bool residency_standard_2D_block_shape; @@ -2211,6 +2552,19 @@ namespace Anvil bool operator==(const PhysicalDeviceSparseProperties& in_props) const; } PhysicalDeviceSparseProperties; + typedef struct PhysicalDeviceSubgroupProperties + { + bool quad_operations_in_all_stages; + uint32_t subgroup_size; + Anvil::SubgroupFeatureFlags supported_operations; + Anvil::ShaderStageFlags supported_stages; + + PhysicalDeviceSubgroupProperties(); + PhysicalDeviceSubgroupProperties(const VkPhysicalDeviceSubgroupProperties & in_props); + + bool operator==(const PhysicalDeviceSubgroupProperties&) const; + } PhysicalDeviceSubgroupProperties; + typedef struct PhysicalDevicePropertiesCoreVK10 { uint32_t api_version; @@ -2230,36 +2584,60 @@ namespace Anvil PhysicalDevicePropertiesCoreVK10(const VkPhysicalDeviceProperties& in_physical_device_properties); } PhysicalDevicePropertiesCoreVK10; + typedef struct PhysicalDevicePropertiesCoreVK11 + { + PhysicalDeviceProtectedMemoryProperties protected_memory_properties; + PhysicalDeviceSubgroupProperties subgroup_properties; + + bool operator==(const PhysicalDevicePropertiesCoreVK11& in_props) const; + + PhysicalDevicePropertiesCoreVK11(); + PhysicalDevicePropertiesCoreVK11(const VkPhysicalDeviceProtectedMemoryProperties& in_protected_memory_properties, + const VkPhysicalDeviceSubgroupProperties& in_subgroup_properties); + } PhysicalDevicePropertiesCoreVK11; + typedef struct PhysicalDeviceProperties { const AMDShaderCoreProperties* amd_shader_core_properties_ptr; const PhysicalDevicePropertiesCoreVK10* core_vk1_0_properties_ptr; + const PhysicalDevicePropertiesCoreVK11* core_vk1_1_properties_ptr; + const EXTConservativeRasterizationProperties* ext_conservative_rasterization_properties_ptr; const EXTDescriptorIndexingProperties* ext_descriptor_indexing_properties_ptr; const EXTExternalMemoryHostProperties* ext_external_memory_host_properties_ptr; + const EXTInlineUniformBlockProperties* ext_inline_uniform_block_properties_ptr; const EXTPCIBusInfoProperties* ext_pci_bus_info_properties_ptr; const EXTSampleLocationsProperties* ext_sample_locations_properties_ptr; const EXTSamplerFilterMinmaxProperties* ext_sampler_filter_minmax_properties_ptr; const EXTTransformFeedbackProperties* ext_transform_feedback_properties_ptr; const EXTVertexAttributeDivisorProperties* ext_vertex_attribute_divisor_properties_ptr; + const KHRDepthStencilResolveProperties* khr_depth_stencil_resolve_properties_ptr; + const KHRDriverPropertiesProperties* khr_driver_properties_properties_ptr; const KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties* khr_external_memory_capabilities_physical_device_id_properties_ptr; const KHRMaintenance2PhysicalDevicePointClippingProperties* khr_maintenance2_point_clipping_properties_ptr; const KHRMaintenance3Properties* khr_maintenance3_properties_ptr; const KHRMultiviewProperties* khr_multiview_properties_ptr; + const KHRShaderFloatControlsProperties* khr_shader_float_controls_properties_ptr; PhysicalDeviceProperties(); PhysicalDeviceProperties(const AMDShaderCoreProperties* in_amd_shader_core_properties_ptr, const PhysicalDevicePropertiesCoreVK10* in_core_vk1_0_properties_ptr, + const PhysicalDevicePropertiesCoreVK11* in_core_vk1_1_properties_ptr, + const EXTConservativeRasterizationProperties* in_ext_conservative_rasterization_properties_ptr, const EXTDescriptorIndexingProperties* in_ext_descriptor_indexing_properties_ptr, const EXTExternalMemoryHostProperties* in_ext_external_memory_host_properties_ptr, + const EXTInlineUniformBlockProperties* in_ext_inline_uniform_block_properties_ptr, const EXTPCIBusInfoProperties* in_ext_pci_bus_info_properties_ptr, const EXTSampleLocationsProperties* in_ext_sample_locations_properties_ptr, const EXTSamplerFilterMinmaxProperties* in_ext_sampler_filter_minmax_properties_ptr, const EXTTransformFeedbackProperties* in_ext_transform_feedback_properties_ptr, const EXTVertexAttributeDivisorProperties* in_ext_vertex_attribute_divisor_properties_ptr, + const KHRDepthStencilResolveProperties* in_khr_depth_stencil_resolve_props_ptr, + const KHRDriverPropertiesProperties* in_khr_driver_properties_props_ptr, const KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties* in_khr_external_memory_caps_physical_device_id_props_ptr, const KHRMaintenance3Properties* in_khr_maintenance3_properties_ptr, const KHRMaintenance2PhysicalDevicePointClippingProperties* in_khr_maintenance2_point_clipping_properties_ptr, - const KHRMultiviewProperties* in_khr_multiview_properties_ptr); + const KHRMultiviewProperties* in_khr_multiview_properties_ptr, + const KHRShaderFloatControlsProperties* in_khr_shader_float_controls_properties_ptr); bool operator==(const PhysicalDeviceProperties& in_props) const; } PhysicalDeviceProperties; @@ -2328,6 +2706,14 @@ namespace Anvil device_index = UINT32_MAX; semaphore_ptr = nullptr; } + + SemaphoreMGPUSubmission(Anvil::Semaphore* in_semaphore_ptr, + const uint32_t& in_device_index) + :device_index (in_device_index), + semaphore_ptr(in_semaphore_ptr) + { + /* Stub */ + } } SemaphoreMGPUSubmission; typedef struct SemaphoreProperties @@ -2511,7 +2897,9 @@ namespace Anvil * * NOTE: By default, the following values are associated with a new SubmitInfo instance: * - * - D3D12 fence submit info: none + * - D3D12 fence submit info: none + * - Keyed mutex acquire/release info: none + * - Protected submission: no * * To adjust these settings, please use corresponding set_..() functions, prior to passing the structure over to Queue::submit(). * @@ -2542,7 +2930,6 @@ namespace Anvil * @param in_semaphores_to_signal_ptr TODO * @param in_semaphores_to_wait_on_ptr TODO **/ - static SubmitInfo create(Anvil::CommandBufferBase* in_opt_cmd_buffer_ptr, uint32_t in_n_semaphores_to_signal, Anvil::Semaphore* const* in_opt_semaphore_to_signal_ptrs_ptr, @@ -2597,17 +2984,27 @@ namespace Anvil * * NOTE: This function always blocks. */ - static SubmitInfo create_signal(uint32_t in_n_semaphores_to_signal, - Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, - Anvil::Fence* in_opt_fence_ptr = nullptr); - - static SubmitInfo create_signal_wait(uint32_t in_n_semaphores_to_signal, - Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, - uint32_t in_n_semaphores_to_wait_on, - Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, - const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, - bool in_should_block, - Anvil::Fence* in_opt_fence_ptr = nullptr); + static SubmitInfo create_signal(uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, + Anvil::Fence* in_opt_fence_ptr = nullptr); + static SubmitInfo create_signal(uint32_t in_n_signal_semaphore_submissions, + const Anvil::SemaphoreMGPUSubmission* in_signal_semaphore_submissions_ptr, + Anvil::Fence* in_opt_fence_ptr = nullptr); + + static SubmitInfo create_signal_wait(uint32_t in_n_semaphores_to_signal, + Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, + uint32_t in_n_semaphores_to_wait_on, + Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, + const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr); + static SubmitInfo create_signal_wait(uint32_t in_n_signal_semaphore_submissions, + const Anvil::SemaphoreMGPUSubmission* in_signal_semaphore_submissions_ptr, + uint32_t in_n_wait_semaphore_submissions, + const Anvil::SemaphoreMGPUSubmission* in_wait_semaphore_submissions_ptr, + const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr = nullptr); /** TODO * @@ -2618,6 +3015,11 @@ namespace Anvil const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, Anvil::Fence* in_opt_fence_ptr = nullptr); + static SubmitInfo create_wait(uint32_t in_n_wait_semaphore_submissions, + const Anvil::SemaphoreMGPUSubmission* in_wait_semaphore_submissions_ptr, + const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + Anvil::Fence* in_opt_fence_ptr = nullptr); + static SubmitInfo create_wait_execute(Anvil::CommandBufferBase* in_cmd_buffer_ptr, uint32_t in_n_semaphores_to_wait_on, Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, @@ -2702,6 +3104,31 @@ namespace Anvil return fence_ptr; } + #if defined(_WIN32) + bool get_keyed_mutex_acquire_release_info(uint32_t* out_n_acquire_keys_ptr, + const Anvil::MemoryBlock*** out_acquire_d3d11_memory_block_ptrs_ptr, + const uint64_t** out_acquire_mutex_key_value_ptrs_ptr, + const uint32_t** out_acquire_timeout_ptrs_ptr, + uint32_t* out_n_release_keys_ptr, + const Anvil::MemoryBlock*** out_release_d3d11_memory_block_ptrs_ptr, + const uint64_t** out_release_mutex_key_value_ptrs_ptr) const + { + *out_n_acquire_keys_ptr = keyed_mutex_n_acquire_keys; + *out_acquire_d3d11_memory_block_ptrs_ptr = keyed_mutex_acquire_d3d11_memory_block_ptrs_ptr; + *out_acquire_mutex_key_value_ptrs_ptr = keyed_mutex_acquire_mutex_key_value_ptrs; + *out_acquire_timeout_ptrs_ptr = keyed_mutex_acquire_timeout_ptrs; + *out_n_release_keys_ptr = keyed_mutex_n_release_keys; + *out_release_d3d11_memory_block_ptrs_ptr = keyed_mutex_release_d3d11_memory_block_ptrs_ptr; + *out_release_mutex_key_value_ptrs_ptr = keyed_mutex_release_mutex_key_value_ptrs; + + return (keyed_mutex_n_acquire_keys != 0 && (keyed_mutex_acquire_d3d11_memory_block_ptrs_ptr != nullptr && + keyed_mutex_acquire_mutex_key_value_ptrs != nullptr && + keyed_mutex_acquire_timeout_ptrs != nullptr)) || + (keyed_mutex_n_release_keys != 0 && (keyed_mutex_release_d3d11_memory_block_ptrs_ptr != nullptr && + keyed_mutex_release_mutex_key_value_ptrs != nullptr)); + } + #endif + const uint32_t& get_n_command_buffers() const { return n_command_buffers; @@ -2752,6 +3179,11 @@ namespace Anvil return wait_semaphores_sgpu_ptr; } + const bool& is_protected_submission() const + { + return is_protected; + } + #if defined(_WIN32) /* Calling this function will make Anvil fill & chain a VkD3D12FenceSubmitInfoKHR struct at queue submission time. * @@ -2784,8 +3216,77 @@ namespace Anvil d3d12_fence_signal_semaphore_values_ptr = in_signal_semaphore_values_ptr; d3d12_fence_wait_semaphore_values_ptr = in_wait_semaphore_values_ptr; } + + /* Calling this function will make Anvil fill & chain a VkWin32KeyedMutexAcquireReleaseInfoKHR struct at queue submission time. + * + * Requires VK_KHR_win32_keyed_mutex support. + * + * NOTE: The structure caches the provided pointers, not the contents available under derefs! Make sure the pointers remain valid + * for the time of the Queue::submit() call. + * + * @param in_opt_n_acquire_keys Number of items available for reading from @param in_opt_acquire_* params. + * May be 0. + * @param in_opt_acquire_d3d11_memory_block_ptrs_ptr If @param in_opt_n_acquire_keys is > 0, the array holds ptrs to memory blocks, + * whose payloads have been imported from D3D11 resources created with the "keyed mutex" flag. + * This info, together with other @param in_opt_* parameters will be used for acquisition purposes + * at submission time. + * @param in_opt_acquire_mutex_key_value_ptrs If @param in_opt_n_acquire_keys is > 0, the array holds mutex key values to wait + * for, prior to beginning the submitted work. + * @param in_opt_acquire_timeout_ptrs If @param in_opt_n_acquire_keys is > 0, the array holds timeout values to use for corresponding + * acquire requests. + * @param in_opt_n_release_keys Number of items available for reading from @param in_opt_release_* params. May be 0. + * @param in_opt_release_d3d11_memory_block_ptrs_ptr If @param in_opt_n_release_keys is > 0, the array holds ptrs to memory blocks, + * whose payloads have been imported from D3D11 resources created with the "keyed mutex" flag. + * This info, together with other @param in_opt_* parameters will be used for release purposes + * at submission time. + * @param in_opt_release_mutex_key_value_ptrs If @param in_opt_n_release_keys is > 0, the array mutex key values to set when the submitted work + 8 has been completed. + */ + void set_keyed_mutex_acquire_release_info(const uint32_t& in_opt_n_acquire_keys, + const Anvil::MemoryBlock** in_opt_acquire_d3d11_memory_block_ptrs_ptr, + const uint64_t* in_opt_acquire_mutex_key_value_ptrs, + const uint32_t* in_opt_acquire_timeout_ptrs, + const uint32_t& in_opt_n_release_keys, + const Anvil::MemoryBlock** in_opt_release_d3d11_memory_block_ptrs_ptr, + const uint64_t* in_opt_release_mutex_key_value_ptrs) + { + keyed_mutex_n_acquire_keys = in_opt_n_acquire_keys; + keyed_mutex_acquire_d3d11_memory_block_ptrs_ptr = in_opt_acquire_d3d11_memory_block_ptrs_ptr; + keyed_mutex_acquire_mutex_key_value_ptrs = in_opt_acquire_mutex_key_value_ptrs; + keyed_mutex_acquire_timeout_ptrs = in_opt_acquire_timeout_ptrs; + keyed_mutex_n_release_keys = in_opt_n_release_keys; + keyed_mutex_release_d3d11_memory_block_ptrs_ptr = in_opt_release_d3d11_memory_block_ptrs_ptr; + keyed_mutex_release_mutex_key_value_ptrs = in_opt_release_mutex_key_value_ptrs; + + anvil_assert(keyed_mutex_n_acquire_keys != 0 || + keyed_mutex_n_release_keys != 0); + + if (keyed_mutex_n_acquire_keys != 0) + { + anvil_assert(keyed_mutex_acquire_d3d11_memory_block_ptrs_ptr != nullptr && + keyed_mutex_acquire_mutex_key_value_ptrs != nullptr && + keyed_mutex_acquire_timeout_ptrs != nullptr); + } + + if (keyed_mutex_n_release_keys != 0) + { + anvil_assert(keyed_mutex_release_d3d11_memory_block_ptrs_ptr != nullptr && + keyed_mutex_release_mutex_key_value_ptrs != nullptr); + } + } #endif + /* Marks (or unmarks) the submission as protected which is required when submitting protected command buffers + * + * NOTE: Requires core VK 1.1 device or newer. + * + * @param in_should_enable True to mark the submission as protected, false to unmark. + **/ + void set_protected_submission(const bool& in_should_enable) + { + is_protected = in_should_enable; + } + /* Sets a timeout which is used when waiting on a fence that the submission is associated with. * * If your submission times out, you're likely about to experience a TDR and lose the device. @@ -2796,6 +3297,7 @@ namespace Anvil timeout = in_timeout; } + private: SubmitInfo(uint32_t in_n_command_buffers, Anvil::CommandBufferBase* in_opt_single_cmd_buffer_ptr, /* to support n=1 helper functions */ @@ -2838,8 +3340,17 @@ namespace Anvil #if defined(_WIN32) const uint64_t* d3d12_fence_signal_semaphore_values_ptr; const uint64_t* d3d12_fence_wait_semaphore_values_ptr; + + uint32_t keyed_mutex_n_acquire_keys; + const Anvil::MemoryBlock** keyed_mutex_acquire_d3d11_memory_block_ptrs_ptr; + const uint64_t* keyed_mutex_acquire_mutex_key_value_ptrs; + const uint32_t* keyed_mutex_acquire_timeout_ptrs; + uint32_t keyed_mutex_n_release_keys; + const Anvil::MemoryBlock** keyed_mutex_release_d3d11_memory_block_ptrs_ptr; + const uint64_t* keyed_mutex_release_mutex_key_value_ptrs; #endif + bool is_protected; bool should_block; uint64_t timeout; const SubmissionType type; @@ -2880,5 +3391,6 @@ namespace Anvil const std::vector& in_cmd_buffer_labels, const std::vector& in_objects)> DebugMessengerCallbackFunction; + }; /* namespace Anvil */ #endif diff --git a/include/misc/vulkan.h b/include/misc/vulkan.h index 91fd062a..f3c36065 100644 --- a/include/misc/vulkan.h +++ b/include/misc/vulkan.h @@ -173,6 +173,39 @@ namespace Anvil extern PFN_vkCmdEndRenderPass vkCmdEndRenderPass; extern PFN_vkCmdExecuteCommands vkCmdExecuteCommands; + /* VK 1.1 core - only available if implementation reports VK 1.1 support! + * + * These function pointers are always retrieved at run-time. + */ + extern PFN_vkBindBufferMemory2 vkBindBufferMemory2; + extern PFN_vkBindImageMemory2 vkBindImageMemory2; + extern PFN_vkCmdDispatchBase vkCmdDispatchBase; + extern PFN_vkCmdSetDeviceMask vkCmdSetDeviceMask; + extern PFN_vkCreateDescriptorUpdateTemplate vkCreateDescriptorUpdateTemplate; + extern PFN_vkCreateSamplerYcbcrConversion vkCreateSamplerYcbcrConversion; + extern PFN_vkDestroyDescriptorUpdateTemplate vkDestroyDescriptorUpdateTemplate; + extern PFN_vkDestroySamplerYcbcrConversion vkDestroySamplerYcbcrConversion; + extern PFN_vkEnumerateInstanceVersion vkEnumerateInstanceVersion; + extern PFN_vkEnumeratePhysicalDeviceGroups vkEnumeratePhysicalDeviceGroups; + extern PFN_vkGetBufferMemoryRequirements2 vkGetBufferMemoryRequirements2; + extern PFN_vkGetDescriptorSetLayoutSupport vkGetDescriptorSetLayoutSupport; + extern PFN_vkGetDeviceGroupPeerMemoryFeatures vkGetDeviceGroupPeerMemoryFeatures; + extern PFN_vkGetDeviceQueue2 vkGetDeviceQueue2; + extern PFN_vkGetImageMemoryRequirements2 vkGetImageMemoryRequirements2; + extern PFN_vkGetImageSparseMemoryRequirements2 vkGetImageSparseMemoryRequirements2; + extern PFN_vkGetPhysicalDeviceExternalBufferProperties vkGetPhysicalDeviceExternalBufferProperties; + extern PFN_vkGetPhysicalDeviceExternalFenceProperties vkGetPhysicalDeviceExternalFenceProperties; + extern PFN_vkGetPhysicalDeviceExternalSemaphoreProperties vkGetPhysicalDeviceExternalSemaphoreProperties; + extern PFN_vkGetPhysicalDeviceFeatures2 vkGetPhysicalDeviceFeatures2; + extern PFN_vkGetPhysicalDeviceFormatProperties2 vkGetPhysicalDeviceFormatProperties2; + extern PFN_vkGetPhysicalDeviceImageFormatProperties2 vkGetPhysicalDeviceImageFormatProperties2; + extern PFN_vkGetPhysicalDeviceMemoryProperties2 vkGetPhysicalDeviceMemoryProperties2; + extern PFN_vkGetPhysicalDeviceProperties2 vkGetPhysicalDeviceProperties2; + extern PFN_vkGetPhysicalDeviceQueueFamilyProperties2 vkGetPhysicalDeviceQueueFamilyProperties2; + extern PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 vkGetPhysicalDeviceSparseImageFormatProperties2; + extern PFN_vkTrimCommandPool vkTrimCommandPool; + extern PFN_vkUpdateDescriptorSetWithTemplate vkUpdateDescriptorSetWithTemplate; + /* Func pointers to extensions are exposed to apps via relevant functions implemented by Anvil::*Device and Anvil::Instance. */ } } diff --git a/include/vulkan/vulkan_core.h b/include/vulkan/vulkan_core.h index caeecd9b..515a73e4 100644 --- a/include/vulkan/vulkan_core.h +++ b/include/vulkan/vulkan_core.h @@ -43,7 +43,7 @@ extern "C" { #define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) #define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff) // Version of this file -#define VK_HEADER_VERSION 97 +#define VK_HEADER_VERSION 101 #define VK_NULL_HANDLE 0 @@ -349,6 +349,8 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT = 1000099001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT = 1000101000, VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT = 1000101001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT = 1000102000, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT = 1000102001, VK_STRUCTURE_TYPE_HDR_METADATA_EXT = 1000105000, VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2_KHR = 1000109000, VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2_KHR = 1000109001, @@ -431,6 +433,8 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV = 1000165012, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV = 1000166000, VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV = 1000166001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT = 1000170000, + VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT = 1000170001, VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT = 1000174000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR = 1000177000, VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT = 1000178000, @@ -466,11 +470,15 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT = 1000237000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT = 1000238000, VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT = 1000238001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV = 1000240000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT = 1000244000, VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT = 1000244001, VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT = 1000244002, VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO_EXT = 1000246000, VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT = 1000247000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV = 1000249000, + VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV = 1000249001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV = 1000249002, VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT, VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES, @@ -1141,6 +1149,7 @@ typedef enum VkFilter { VK_FILTER_NEAREST = 0, VK_FILTER_LINEAR = 1, VK_FILTER_CUBIC_IMG = 1000015000, + VK_FILTER_CUBIC_EXT = VK_FILTER_CUBIC_IMG, VK_FILTER_BEGIN_RANGE = VK_FILTER_NEAREST, VK_FILTER_END_RANGE = VK_FILTER_LINEAR, VK_FILTER_RANGE_SIZE = (VK_FILTER_LINEAR - VK_FILTER_NEAREST + 1), @@ -1352,6 +1361,7 @@ typedef enum VkFormatFeatureFlagBits { VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT, VK_FORMAT_FEATURE_DISJOINT_BIT_KHR = VK_FORMAT_FEATURE_DISJOINT_BIT, VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR = VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG, VK_FORMAT_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkFormatFeatureFlagBits; typedef VkFlags VkFormatFeatureFlags; @@ -6244,7 +6254,7 @@ typedef struct VkPhysicalDeviceDepthStencilResolvePropertiesKHR { #define VK_KHR_vulkan_memory_model 1 -#define VK_KHR_VULKAN_MEMORY_MODEL_SPEC_VERSION 2 +#define VK_KHR_VULKAN_MEMORY_MODEL_SPEC_VERSION 3 #define VK_KHR_VULKAN_MEMORY_MODEL_EXTENSION_NAME "VK_KHR_vulkan_memory_model" typedef struct VkPhysicalDeviceVulkanMemoryModelFeaturesKHR { @@ -6252,6 +6262,7 @@ typedef struct VkPhysicalDeviceVulkanMemoryModelFeaturesKHR { void* pNext; VkBool32 vulkanMemoryModel; VkBool32 vulkanMemoryModelDeviceScope; + VkBool32 vulkanMemoryModelAvailabilityVisibilityChains; } VkPhysicalDeviceVulkanMemoryModelFeaturesKHR; @@ -7456,6 +7467,27 @@ typedef struct VkPipelineRasterizationConservativeStateCreateInfoEXT { +#define VK_EXT_depth_clip_enable 1 +#define VK_EXT_DEPTH_CLIP_ENABLE_SPEC_VERSION 1 +#define VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME "VK_EXT_depth_clip_enable" + +typedef VkFlags VkPipelineRasterizationDepthClipStateCreateFlagsEXT; + +typedef struct VkPhysicalDeviceDepthClipEnableFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 depthClipEnable; +} VkPhysicalDeviceDepthClipEnableFeaturesEXT; + +typedef struct VkPipelineRasterizationDepthClipStateCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkPipelineRasterizationDepthClipStateCreateFlagsEXT flags; + VkBool32 depthClipEnable; +} VkPipelineRasterizationDepthClipStateCreateInfoEXT; + + + #define VK_EXT_swapchain_colorspace 1 #define VK_EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION 3 #define VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME "VK_EXT_swapchain_colorspace" @@ -8551,6 +8583,25 @@ typedef struct VkPipelineRepresentativeFragmentTestStateCreateInfoNV { +#define VK_EXT_filter_cubic 1 +#define VK_EXT_FILTER_CUBIC_SPEC_VERSION 1 +#define VK_EXT_FILTER_CUBIC_EXTENSION_NAME "VK_EXT_filter_cubic" + +typedef struct VkPhysicalDeviceImageViewImageFormatInfoEXT { + VkStructureType sType; + void* pNext; + VkImageViewType imageViewType; +} VkPhysicalDeviceImageViewImageFormatInfoEXT; + +typedef struct VkFilterCubicImageViewImageFormatPropertiesEXT { + VkStructureType sType; + void* pNext; + VkBool32 filterCubic; + VkBool32 filterCubicMinmax ; +} VkFilterCubicImageViewImageFormatPropertiesEXT; + + + #define VK_EXT_global_priority 1 #define VK_EXT_GLOBAL_PRIORITY_SPEC_VERSION 2 #define VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME "VK_EXT_global_priority" @@ -9003,6 +9054,18 @@ typedef struct VkMemoryPriorityAllocateInfoEXT { +#define VK_NV_dedicated_allocation_image_aliasing 1 +#define VK_NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_SPEC_VERSION 1 +#define VK_NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_EXTENSION_NAME "VK_NV_dedicated_allocation_image_aliasing" + +typedef struct VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 dedicatedAllocationImageAliasing; +} VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV; + + + #define VK_EXT_buffer_device_address 1 typedef uint64_t VkDeviceAddress; @@ -9089,6 +9152,76 @@ typedef struct VkValidationFeaturesEXT { +#define VK_NV_cooperative_matrix 1 +#define VK_NV_COOPERATIVE_MATRIX_SPEC_VERSION 1 +#define VK_NV_COOPERATIVE_MATRIX_EXTENSION_NAME "VK_NV_cooperative_matrix" + + +typedef enum VkComponentTypeNV { + VK_COMPONENT_TYPE_FLOAT16_NV = 0, + VK_COMPONENT_TYPE_FLOAT32_NV = 1, + VK_COMPONENT_TYPE_FLOAT64_NV = 2, + VK_COMPONENT_TYPE_SINT8_NV = 3, + VK_COMPONENT_TYPE_SINT16_NV = 4, + VK_COMPONENT_TYPE_SINT32_NV = 5, + VK_COMPONENT_TYPE_SINT64_NV = 6, + VK_COMPONENT_TYPE_UINT8_NV = 7, + VK_COMPONENT_TYPE_UINT16_NV = 8, + VK_COMPONENT_TYPE_UINT32_NV = 9, + VK_COMPONENT_TYPE_UINT64_NV = 10, + VK_COMPONENT_TYPE_BEGIN_RANGE_NV = VK_COMPONENT_TYPE_FLOAT16_NV, + VK_COMPONENT_TYPE_END_RANGE_NV = VK_COMPONENT_TYPE_UINT64_NV, + VK_COMPONENT_TYPE_RANGE_SIZE_NV = (VK_COMPONENT_TYPE_UINT64_NV - VK_COMPONENT_TYPE_FLOAT16_NV + 1), + VK_COMPONENT_TYPE_MAX_ENUM_NV = 0x7FFFFFFF +} VkComponentTypeNV; + +typedef enum VkScopeNV { + VK_SCOPE_DEVICE_NV = 1, + VK_SCOPE_WORKGROUP_NV = 2, + VK_SCOPE_SUBGROUP_NV = 3, + VK_SCOPE_QUEUE_FAMILY_NV = 5, + VK_SCOPE_BEGIN_RANGE_NV = VK_SCOPE_DEVICE_NV, + VK_SCOPE_END_RANGE_NV = VK_SCOPE_QUEUE_FAMILY_NV, + VK_SCOPE_RANGE_SIZE_NV = (VK_SCOPE_QUEUE_FAMILY_NV - VK_SCOPE_DEVICE_NV + 1), + VK_SCOPE_MAX_ENUM_NV = 0x7FFFFFFF +} VkScopeNV; + +typedef struct VkCooperativeMatrixPropertiesNV { + VkStructureType sType; + void* pNext; + uint32_t MSize; + uint32_t NSize; + uint32_t KSize; + VkComponentTypeNV AType; + VkComponentTypeNV BType; + VkComponentTypeNV CType; + VkComponentTypeNV DType; + VkScopeNV scope; +} VkCooperativeMatrixPropertiesNV; + +typedef struct VkPhysicalDeviceCooperativeMatrixFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 cooperativeMatrix; + VkBool32 cooperativeMatrixRobustBufferAccess; +} VkPhysicalDeviceCooperativeMatrixFeaturesNV; + +typedef struct VkPhysicalDeviceCooperativeMatrixPropertiesNV { + VkStructureType sType; + void* pNext; + VkShaderStageFlags cooperativeMatrixSupportedStages; +} VkPhysicalDeviceCooperativeMatrixPropertiesNV; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkCooperativeMatrixPropertiesNV* pProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceCooperativeMatrixPropertiesNV( + VkPhysicalDevice physicalDevice, + uint32_t* pPropertyCount, + VkCooperativeMatrixPropertiesNV* pProperties); +#endif + #ifdef __cplusplus } #endif diff --git a/include/vulkan/vulkan_mir.h b/include/vulkan/vulkan_mir.h new file mode 100644 index 00000000..7d24ed27 --- /dev/null +++ b/include/vulkan/vulkan_mir.h @@ -0,0 +1,65 @@ +#ifndef VULKAN_MIR_H_ +#define VULKAN_MIR_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2015-2018 The Khronos Group Inc. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#define VK_KHR_mir_surface 1 +#define VK_KHR_MIR_SURFACE_SPEC_VERSION 4 +#define VK_KHR_MIR_SURFACE_EXTENSION_NAME "VK_KHR_mir_surface" + +typedef VkFlags VkMirSurfaceCreateFlagsKHR; + +typedef struct VkMirSurfaceCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkMirSurfaceCreateFlagsKHR flags; + MirConnection* connection; + MirSurface* mirSurface; +} VkMirSurfaceCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateMirSurfaceKHR)(VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); +typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, MirConnection* connection); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateMirSurfaceKHR( + VkInstance instance, + const VkMirSurfaceCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); + +VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceMirPresentationSupportKHR( + VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + MirConnection* connection); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/wrappers/buffer.h b/include/wrappers/buffer.h index b2ff1dd1..a9845122 100644 --- a/include/wrappers/buffer.h +++ b/include/wrappers/buffer.h @@ -185,14 +185,6 @@ namespace Anvil * This function can only be used for NON-SPARSE buffers. Calling this function for sparse buffers will * result in an assertion failure. * - * Single-argument function prototype can only be used for single-GPU device instances, whereas the other one - * can be used for both single- multi-GPU device instances. In the latter case: - * - * 1) If the memory comes from a memory heap with VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR flag, all physical devices - * are bound its own instance of the memory and @param in_physical_devices_ptr is ignored. - * 2) If the memory comes from a memory heap without the flag, physical devices specified by the caller are assigned - * the same instance of the memory. - * * @param in_memory_block_ptr Memory block to attach to the buffer object. Must not be NULL. * @param in_memory_block_owned_by_buffer TODO * @param in_n_device_group_indices Describes the number of device indices available under @param in_device_group_indices_ptr. diff --git a/include/wrappers/command_buffer.h b/include/wrappers/command_buffer.h index f9d2e163..780c40a0 100644 --- a/include/wrappers/command_buffer.h +++ b/include/wrappers/command_buffer.h @@ -125,6 +125,7 @@ namespace Anvil COMMAND_TYPE_WAIT_EVENTS, COMMAND_TYPE_WRITE_BUFFER_MARKER_AMD, COMMAND_TYPE_WRITE_TIMESTAMP, + } CommandType; /** Base structure for a Vulkan command. @@ -205,8 +206,8 @@ namespace Anvil { std::vector clear_values; Anvil::SubpassContents contents; + uint32_t device_mask; Anvil::Framebuffer* fbo_ptr; - std::vector physical_devices; std::vector render_areas; Anvil::RenderPass* render_pass_ptr; @@ -221,9 +222,9 @@ namespace Anvil explicit BeginRenderPassCommand(uint32_t in_n_clear_values, const VkClearValue* in_clear_value_ptrs, Anvil::Framebuffer* in_fbo_ptr, - uint32_t in_n_physical_devices, - const Anvil::PhysicalDevice* const* in_physical_devices, - const VkRect2D* in_render_areas, + uint32_t in_device_mask, + uint32_t in_n_render_areas, + const VkRect2D* in_render_areas_ptr, Anvil::RenderPass* in_render_pass_ptr, Anvil::SubpassContents in_contents, const uint32_t& in_n_attachment_initial_sample_locations, @@ -251,9 +252,9 @@ namespace Anvil BeginRenderPass2KHRCommand(uint32_t in_n_clear_values, const VkClearValue* in_clear_value_ptrs, Anvil::Framebuffer* in_fbo_ptr, - uint32_t in_n_physical_devices, - const Anvil::PhysicalDevice* const* in_physical_devices, - const VkRect2D* in_render_areas, + uint32_t in_device_mask, + uint32_t in_n_render_areas, + const VkRect2D* in_render_areas_ptr, Anvil::RenderPass* in_render_pass_ptr, Anvil::SubpassContents in_contents, const uint32_t& in_n_attachment_initial_sample_locations, @@ -263,9 +264,9 @@ namespace Anvil :BeginRenderPassCommand(in_n_clear_values, in_clear_value_ptrs, in_fbo_ptr, - in_n_physical_devices, - in_physical_devices, - in_render_areas, + in_device_mask, + in_n_render_areas, + in_render_areas_ptr, in_render_pass_ptr, in_contents, in_n_attachment_initial_sample_locations, @@ -1267,7 +1268,6 @@ namespace Anvil uint32_t in_region_count, const Anvil::ImageResolve* in_region_ptrs); - /** Issues a vkCmdSetBlendConstants() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS * #define enabled). @@ -1461,6 +1461,7 @@ namespace Anvil VkDeviceSize in_data_size, const void* in_data_ptr); + /** Issues a vkCmdWaitEvents() call and appends it to the internal vector of commands * recorded for the specified command buffer (for builds with STORE_COMMAND_BUFFER_COMMANDS * #define enabled). @@ -1856,6 +1857,7 @@ namespace Anvil ClearDepthStencilImageCommand& operator=(const ClearDepthStencilImageCommand& in); } ClearDepthStencilImageCommand; + /** Holds all arguments passed to a vkCmdCopyBuffer() command. */ typedef struct CopyBufferCommand : public Command { @@ -3000,9 +3002,9 @@ namespace Anvil bool record_begin_render_pass(uint32_t in_n_clear_values, const VkClearValue* in_clear_value_ptrs, Anvil::Framebuffer* in_fbo_ptr, - uint32_t in_n_physical_devices, - const Anvil::PhysicalDevice* const* in_physical_devices, - const VkRect2D* in_render_areas, + uint32_t in_device_mask, + uint32_t in_n_render_areas, + const VkRect2D* in_render_areas_ptr, Anvil::RenderPass* in_render_pass_ptr, Anvil::SubpassContents in_contents, const uint32_t& in_opt_n_attachment_initial_sample_locations = 0, @@ -3049,9 +3051,9 @@ namespace Anvil bool record_begin_render_pass2_KHR(uint32_t in_n_clear_values, const VkClearValue* in_clear_value_ptrs, Anvil::Framebuffer* in_fbo_ptr, - uint32_t in_n_physical_devices, - const Anvil::PhysicalDevice* const* in_physical_devices, - const VkRect2D* in_render_areas, + uint32_t in_device_mask, + uint32_t in_n_render_areas, + const VkRect2D* in_render_areas_ptr, Anvil::RenderPass* in_render_pass_ptr, Anvil::SubpassContents in_contents, const uint32_t& in_opt_n_attachment_initial_sample_locations = 0, @@ -3172,9 +3174,9 @@ namespace Anvil uint32_t in_n_clear_values, const VkClearValue* in_clear_value_ptrs, Anvil::Framebuffer* in_fbo_ptr, - uint32_t in_n_physical_devices, - const Anvil::PhysicalDevice* const* in_physical_devices, - const VkRect2D* in_render_areas, + uint32_t in_device_mask, + uint32_t in_n_render_areas, + const VkRect2D* in_render_areas_ptr, Anvil::RenderPass* in_render_pass_ptr, Anvil::SubpassContents in_contents, const uint32_t& in_opt_n_attachment_initial_sample_locations, diff --git a/include/wrappers/command_pool.h b/include/wrappers/command_pool.h index ab0cadac..00c29a1e 100644 --- a/include/wrappers/command_pool.h +++ b/include/wrappers/command_pool.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2019 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -20,12 +20,6 @@ // THE SOFTWARE. // -/** Defines a command pool wrapper class which simplify the following tasks: - * - * - Primary- and second-level command buffer allocation & resetting. - * - State caching - * - **/ #ifndef WRAPPERS_COMMAND_POOL_H #define WRAPPERS_COMMAND_POOL_H @@ -64,20 +58,16 @@ namespace Anvil /** Creates a new CommandPool object. * - * @param in_device_ptr Device to create the command pool for. Must not be nullptr. - * @param in_transient_allocations_friendly Set to true if the command pool should be created with the - * VK_COMMAND_POOL_CREATE_TRANSIENT_BIT flag set on. - * @param in_support_per_cmdbuf_reset_ops Set to true if the command pool should be created with the - * VK_COMMAND_POOL_RESET_COMMAND_BUFFER_BIT flag set on. - * @param in_queue_family_index Index of the Vulkan queue family the command pool should be created for. - * @param in_mt_safe Enable if your application is going to be calling any of the - * alloc_*() functions from more than one thread at a time. + * @param in_device_ptr Device to create the command pool for. Must not be nullptr. + * @param in_create_flags Create flags to use. + * @param in_queue_family_index Index of the Vulkan queue family the command pool should be created for. + * @param in_mt_safe Enable if your application is going to be calling any of the + * alloc_*() functions from more than one thread at a time. **/ - static CommandPoolUniquePtr create(Anvil::BaseDevice* in_device_ptr, - bool in_transient_allocations_friendly, - bool in_support_per_cmdbuf_reset_ops, - uint32_t in_queue_family_index, - MTSafety in_mt_safety = MTSafety::INHERIT_FROM_PARENT_DEVICE); + static CommandPoolUniquePtr create(Anvil::BaseDevice* in_device_ptr, + const Anvil::CommandPoolCreateFlags& in_create_flags, + uint32_t in_queue_family_index, + MTSafety in_mt_safety = MTSafety::INHERIT_FROM_PARENT_DEVICE); /** Retrieves the raw Vulkan handle for the encapsulated command pool */ VkCommandPool get_command_pool() const @@ -85,18 +75,16 @@ namespace Anvil return m_command_pool; } - /** Tells which Vulkan queue family this command pool instance has been created for */ - uint32_t get_queue_family_index() const + /** Returns create flags specified at instantiaton time */ + const Anvil::CommandPoolCreateFlags& get_create_flags() const { - return m_queue_family_index; + return m_create_flags; } - /** Tells whether the command pool has been created with VK_COMMAND_POOL_CREATE_TRANSIENT_BIT - * flag defined. - ***/ - bool is_transient_allocations_friendly() const + /** Tells which Vulkan queue family this command pool instance has been created for */ + uint32_t get_queue_family_index() const { - return m_is_transient_allocations_friendly; + return m_queue_family_index; } /** Reset the command pool. @@ -108,12 +96,6 @@ namespace Anvil **/ bool reset(bool in_release_resources); - /** Tells whether the command buffers, allocated from this command pool, support reset operations */ - bool supports_per_cmdbuf_reset_ops() const - { - return m_supports_per_cmdbuf_reset_ops; - } - /* Trims the command buffer as per VK_KHR_maintenance1 extension spec. * * Requires VK_KHR_maintenance1 extension support. An assertion failure will occur if the @@ -125,21 +107,19 @@ namespace Anvil /* Private functions */ /* Please seee create() documentation for more details */ - explicit CommandPool(Anvil::BaseDevice* in_device_ptr, - bool in_transient_allocations_friendly, - bool in_support_per_cmdbuf_reset_ops, - uint32_t in_queue_family_index, - bool in_mt_safe); + explicit CommandPool(Anvil::BaseDevice* in_device_ptr, + const Anvil::CommandPoolCreateFlags& in_create_flags, + uint32_t in_queue_family_index, + bool in_mt_safe); CommandPool (const CommandPool&); CommandPool& operator=(const CommandPool&); /* Private variables */ - VkCommandPool m_command_pool; - Anvil::BaseDevice* m_device_ptr; - bool m_is_transient_allocations_friendly; - uint32_t m_queue_family_index; - bool m_supports_per_cmdbuf_reset_ops; + VkCommandPool m_command_pool; + Anvil::CommandPoolCreateFlags m_create_flags; + Anvil::BaseDevice* m_device_ptr; + uint32_t m_queue_family_index; friend class Anvil::CommandBufferBase; }; diff --git a/include/wrappers/descriptor_pool.h b/include/wrappers/descriptor_pool.h index a6cb7000..f62af3d8 100644 --- a/include/wrappers/descriptor_pool.h +++ b/include/wrappers/descriptor_pool.h @@ -58,19 +58,8 @@ namespace Anvil /** Creates a new DescriptorPool instance. Sets up the wrapper, but does not immediately * bake a new Vulkan pool. * - * @param in_device_ptr Device to use. - * @param in_n_max_sets Maximum number of sets to be allocable from the pool. Must be at - * least 1. - * @param in_flags See DescriptorPoolFlagBits documentation for more details. - * @param in_descriptor_count_per_type_ptr Pointer to an array holding info regarding the number of descriptors to preallocate - * slots for in the pool. Exactly VK_DESCRIPTOR_TYPE_RANGE_SIZE uint32s will be read - * from the array. Must not be null. **/ - static DescriptorPoolUniquePtr create(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_n_max_sets, - const Anvil::DescriptorPoolCreateFlags& in_flags, - const uint32_t* in_descriptor_count_per_type_ptr, - MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE); + static DescriptorPoolUniquePtr create(Anvil::DescriptorPoolCreateInfoUniquePtr in_create_info_ptr); /** Destructor. Releases the Vulkan pool object if instantiated. */ virtual ~DescriptorPool(); @@ -102,9 +91,9 @@ namespace Anvil VkDescriptorSet* out_descriptor_sets_vk_ptr, VkResult* out_opt_result_ptr = nullptr); - const Anvil::DescriptorPoolCreateFlags& get_flags() const + const Anvil::DescriptorPoolCreateInfo* get_create_info_ptr() const { - return m_flags; + return m_create_info_ptr.get(); } /** Returns a raw Vulkan handle for the pool. @@ -118,11 +107,6 @@ namespace Anvil return m_pool; } - uint32_t get_n_maximum_sets() const - { - return m_n_max_sets; - } - /** Resets the pool. * * @return true if successful, false otherwise @@ -135,25 +119,17 @@ namespace Anvil bool init(); /** Constructor */ - DescriptorPool(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_n_max_sets, - const Anvil::DescriptorPoolCreateFlags& in_flags, - const uint32_t* in_descriptor_count_per_type_ptr, - bool in_mt_safe); + DescriptorPool(Anvil::DescriptorPoolCreateInfoUniquePtr in_create_info_ptr, + bool in_mt_safe); DescriptorPool (const DescriptorPool&); DescriptorPool& operator=(const DescriptorPool&); /* Private variables */ - const Anvil::BaseDevice* m_device_ptr; - VkDescriptorPool m_pool; - - uint32_t m_descriptor_count[VK_DESCRIPTOR_TYPE_RANGE_SIZE]; - uint32_t m_n_max_sets; - - std::vector m_ds_cache; - std::vector m_ds_layout_cache; - const Anvil::DescriptorPoolCreateFlags m_flags; + Anvil::DescriptorPoolCreateInfoUniquePtr m_create_info_ptr; + std::vector m_ds_cache; + std::vector m_ds_layout_cache; + VkDescriptorPool m_pool; }; }; /* namespace Anvil */ diff --git a/include/wrappers/descriptor_set.h b/include/wrappers/descriptor_set.h index 964cae15..d4870d56 100644 --- a/include/wrappers/descriptor_set.h +++ b/include/wrappers/descriptor_set.h @@ -24,7 +24,6 @@ * * Implemented to: * - * - reference-count wrapper instances * - cache set binding information. * - monitor layout adjustments and act accordingly. * - monitor pool reset events and act accordingly. @@ -666,6 +665,8 @@ namespace Anvil * UniformBufferBindingElement - for uniform buffer bindings. * UniformTexelBufferBindingElement - for storage uniform buffer bindings. * + * This function CANNOT be used for inline uniform block binding updates. Instead, please use set_inline_uniform_block_binding_data(). + * * @param in_binding_index As per documentation. Must correspond to a binding which has earlier * been added by calling add_binding() function. * @param in_element_range As per documentation. Must not be equal to or larger than the array size, @@ -682,24 +683,33 @@ namespace Anvil anvil_assert(in_elements_ptr != nullptr); anvil_assert(m_unusable == false); - BindingItems& binding_items = m_bindings[in_binding_index]; - const uint32_t last_element_index = in_element_range.second + in_element_range.first; + BindingItemUniquePtrs& binding_item_ptrs = m_binding_ptrs[in_binding_index]; + const uint32_t last_element_index = in_element_range.second + in_element_range.first; for (BindingElementIndex current_element_index = in_element_range.first; current_element_index < last_element_index; ++current_element_index) { - if (!(binding_items[current_element_index] == in_elements_ptr[current_element_index - in_element_range.first]) ) + if (!( binding_item_ptrs[current_element_index] != nullptr && + *binding_item_ptrs[current_element_index] == in_elements_ptr[current_element_index - in_element_range.first]) ) { m_dirty = true; - binding_items[current_element_index] = in_elements_ptr[current_element_index - in_element_range.first]; + binding_item_ptrs[current_element_index].reset( + new Anvil::DescriptorSet::BindingItem() + ); + + *binding_item_ptrs[current_element_index] = in_elements_ptr[current_element_index - in_element_range.first]; } } return true; } + /* TODO + * + * NOTE: This function CANNOT be used for inline uniform block binding updates. Instead, please use set_inline_uniform_block_binding_data(). + */ template bool set_binding_array_items(BindingIndex in_binding_index, BindingElementArrayRange in_element_range, @@ -708,16 +718,20 @@ namespace Anvil anvil_assert(in_elements_ptr_ptr != nullptr); anvil_assert(m_unusable == false); - BindingItems& binding_items = m_bindings[in_binding_index]; - const uint32_t last_element_index = in_element_range.second + in_element_range.first; + BindingItemUniquePtrs& binding_item_ptrs = m_binding_ptrs[in_binding_index]; + const uint32_t last_element_index = in_element_range.second + in_element_range.first; for (BindingElementIndex current_element_index = in_element_range.first; current_element_index < last_element_index; ++current_element_index) { - m_dirty |= !(binding_items[current_element_index] == *in_elements_ptr_ptr[current_element_index - in_element_range.first]); + m_dirty |= !(*binding_item_ptrs[current_element_index] == *in_elements_ptr_ptr[current_element_index - in_element_range.first]); + + binding_item_ptrs[current_element_index].reset( + new Anvil::DescriptorSet::BindingItem() + ); - binding_items[current_element_index] = *in_elements_ptr_ptr[current_element_index - in_element_range.first]; + *binding_item_ptrs[current_element_index] = *in_elements_ptr_ptr[current_element_index - in_element_range.first]; } return true; @@ -725,6 +739,9 @@ namespace Anvil /** This function works exactly like set_binding_array_items(), except that it always replaces the zeroth element * attached to the specified descriptor set's binding. + * + * NOTE: This function CANNOT be used for inline uniform block binding updates. Instead, please use set_inline_uniform_block_binding_data(). + * */ template bool set_binding_item(BindingIndex in_binding_index, @@ -736,6 +753,28 @@ namespace Anvil &in_element); } + /** TODO + * + * NOTE: Multiple update requests for the same inline uniform block binding are supported and will be executed via consecutive API calls. + * + * Requires VK_EXT_inline_uniform_block. + * + * @param in_binding_index Index of the inline uniform block binding to use for the update. + * @param in_start_offset Start offset of the inline uniform block's memory region which should be updated. Must be a mul of 4. + * @param in_size Size of the inline uniform block's memory region to update. Must be a mul of 4. + * @param in_raw_data_ptr Data to use for the update. Whether or not the data is cached internally depends on value passed to + * @param in_should_cache_raw_data. Must not be nullptr. + * @param in_should_cache_raw_data True if data provided via @param in_raw_data_ptr should be cached internally, false otherwise. In other + * words, if this argument is set to true, it is safe to release memory block, to which @param in_raw_data_ptr points. + * + * @return true if successful, false otherwise. + */ + bool set_inline_uniform_block_binding_data(const BindingIndex& in_binding_index, + const uint32_t& in_start_offset, + const uint32_t& in_size, + const void* in_raw_data_ptr, + const bool& in_should_cache_raw_data); + /** Updates internally-maintained Vulkan descriptor set instances. * * @param in_update_method Please see DescriptorSetUpdateMethod documentation for more details. @@ -754,14 +793,16 @@ namespace Anvil **/ typedef struct BindingItem { - Anvil::Buffer* buffer_ptr; - Anvil::BufferView* buffer_view_ptr; - Anvil::ImageLayout image_layout; - Anvil::ImageView* image_view_ptr; - Anvil::Sampler* sampler_ptr; - VkDeviceSize size; - VkDeviceSize start_offset; - Anvil::DescriptorType type_vk; + Anvil::Buffer* buffer_ptr; + Anvil::BufferView* buffer_view_ptr; + Anvil::ImageLayout image_layout; + Anvil::ImageView* image_view_ptr; + std::unique_ptr > iub_update_data_ptr; + Anvil::Sampler* sampler_ptr; + VkDeviceSize size; + VkDeviceSize start_offset; + Anvil::DescriptorType type_vk; + bool dirty; @@ -769,61 +810,42 @@ namespace Anvil { return (buffer_ptr == in.buffer_ptr && size == in.size && - start_offset == in.start_offset); + start_offset == in.start_offset && + type_vk == in.get_type() ); } bool operator==(const CombinedImageSamplerBindingElement& in) const { return (image_layout == in.image_layout && image_view_ptr == in.image_view_ptr && - sampler_ptr == in.sampler_ptr); + sampler_ptr == in.sampler_ptr && + type_vk == in.get_type() ); } bool operator==(const ImageBindingElement& in) const { return (image_layout == in.image_layout && - image_view_ptr == in.image_view_ptr); + image_view_ptr == in.image_view_ptr && + type_vk == in.get_type() ); } bool operator==(const SamplerBindingElement& in) const { - return (sampler_ptr == in.sampler_ptr); + return (sampler_ptr == in.sampler_ptr && + type_vk == in.get_type() ); } bool operator==(const TexelBufferBindingElement& in) const { - return (buffer_view_ptr == in.buffer_view_ptr); + return (buffer_view_ptr == in.buffer_view_ptr && + type_vk == in.get_type() ); } - /* Copy assignment operator. - * - * Retains the buffer instance embedded in @param in_element - **/ - BindingItem& operator=(const BufferBindingElement& in_element); - - /* Copy assignment operator. - * - * Retains the image view & sampler instances embedded in @param in_element - **/ + BindingItem& operator=(const BufferBindingElement& in_element); BindingItem& operator=(const CombinedImageSamplerBindingElement& in_element); - - /* Copy assignment operator. - * - * Retains the image view instance embedded in @param in_element - **/ - BindingItem& operator=(const ImageBindingElement& in_element); - - /* Copy assignment operator. - * - * Retains the sampler instance embedded in @param in_element - **/ - BindingItem& operator=(const SamplerBindingElement& in_element); - - /* Copy assignment operator. - * - * Retains the buffer view instance embedded in @param in_element - **/ - BindingItem& operator=(const TexelBufferBindingElement& in_element); + BindingItem& operator=(const ImageBindingElement& in_element); + BindingItem& operator=(const SamplerBindingElement& in_element); + BindingItem& operator=(const TexelBufferBindingElement& in_element); /* Default dummy constructor. */ BindingItem() @@ -837,6 +859,8 @@ namespace Anvil buffer_view_ptr = nullptr; image_view_ptr = nullptr; sampler_ptr = nullptr; + + type_vk = Anvil::DescriptorType::UNKNOWN; } /* Destructor. @@ -845,8 +869,9 @@ namespace Anvil ~BindingItem(); } BindingItem; - typedef std::vector BindingItems; - typedef std::map BindingIndexToBindingItemsMap; + typedef std::unique_ptr BindingItemUniquePtr; + typedef std::vector BindingItemUniquePtrs; + typedef std::map BindingIndexToBindingItemUniquePtrsMap; /* Private functions */ @@ -875,28 +900,39 @@ namespace Anvil DescriptorSet& operator=(const DescriptorSet&); void alloc_bindings (); - void fill_buffer_info_vk_descriptor(const Anvil::DescriptorSet::BindingItem& in_binding_item, - VkDescriptorBufferInfo* out_descriptor_ptr) const; - void fill_image_info_vk_descriptor (const Anvil::DescriptorSet::BindingItem& in_binding_item, - const bool& in_immutable_samplers_enabled, - VkDescriptorImageInfo* out_descriptor_ptr) const; + void fill_buffer_info_vk_descriptor(const Anvil::DescriptorSet::BindingItem& in_binding_item, + VkDescriptorBufferInfo* out_descriptor_ptr) const; + void fill_image_info_vk_descriptor (const Anvil::DescriptorSet::BindingItem& in_binding_item, + const bool& in_immutable_samplers_enabled, + VkDescriptorImageInfo* out_descriptor_ptr) const; + void fill_iub_vk_descriptor (const Anvil::DescriptorSet::BindingItem& in_binding_item, + VkWriteDescriptorSetInlineUniformBlockEXT* out_descriptor_ptr) const; void on_parent_pool_reset (); bool update_using_core_method () const; bool update_using_template_method () const; /* Private variables */ - mutable BindingIndexToBindingItemsMap m_bindings; - VkDescriptorSet m_descriptor_set; - const Anvil::BaseDevice* m_device_ptr; - mutable bool m_dirty; - const Anvil::DescriptorSetLayout* m_layout_ptr; - Anvil::DescriptorPool* m_parent_pool_ptr; - bool m_unusable; - - mutable std::vector m_cached_ds_info_buffer_info_items_vk; - mutable std::vector m_cached_ds_info_image_info_items_vk; - mutable std::vector m_cached_ds_info_texel_buffer_info_items_vk; - mutable std::vector m_cached_ds_write_items_vk; + + /* For descriptor types != INLINE_UNIFORM_BLOCK, this is the usual binding index->binding item map. Holds bindings associated + * with corresponding array items. + * + * For INLINE_UNIFORM_BLOCK descriptors, this is a binding index->pending updates map. + */ + mutable BindingIndexToBindingItemUniquePtrsMap m_binding_ptrs; + + + VkDescriptorSet m_descriptor_set; + const Anvil::BaseDevice* m_device_ptr; + mutable bool m_dirty; + const Anvil::DescriptorSetLayout* m_layout_ptr; + Anvil::DescriptorPool* m_parent_pool_ptr; + bool m_unusable; + + mutable std::vector m_cached_ds_info_buffer_info_items_vk; + mutable std::vector m_cached_ds_info_image_info_items_vk; + mutable std::vector m_cached_ds_info_texel_buffer_info_items_vk; + mutable std::vector m_cached_ds_write_iub_items_vk; + mutable std::vector m_cached_ds_write_items_vk; mutable std::vector m_template_entries; mutable std::map, Anvil::DescriptorUpdateTemplateUniquePtr> m_template_object_map; diff --git a/include/wrappers/descriptor_set_group.h b/include/wrappers/descriptor_set_group.h index a569d079..b3ea55c4 100644 --- a/include/wrappers/descriptor_set_group.h +++ b/include/wrappers/descriptor_set_group.h @@ -56,6 +56,7 @@ #include "misc/types.h" #include "wrappers/descriptor_set.h" #include "wrappers/descriptor_set_layout.h" +#include namespace Anvil { @@ -230,6 +231,46 @@ namespace Anvil return true; } + /** TODO + * + * NOTE: Do NOT schedule multiple updates for overlapping inline uniform block memory regions without a bake operation in-between. Ignoring + * this requirement results in undefined behavior. + * + * Requires VK_EXT_inline_uniform_block. + * + * @param in_binding_index Index of the inline uniform block binding to use for the update. + * @param in_start_offset Start offset of the inline uniform block's memory region which should be updated. Must be a mul of 4. + * @param in_size Size of the inline uniform block's memory region to update. Must be a mul of 4. + * @param in_raw_data_ptr Data to use for the update. Whether or not the data is cached internally depends on value passed to + * @param in_should_cache_raw_data. Must not be nullptr. + * @param in_should_cache_raw_data True if data provided via @param in_raw_data_ptr should be cached internally, false otherwise. In other + * words, if this argument is set to true, it is safe to release memory block, to which @param in_raw_data_ptr points. + * + * @return true if successful, false otherwise. + */ + bool set_inline_uniform_block_binding_data(const uint32_t& in_n_set, + const BindingIndex& in_binding_index, + const uint32_t& in_start_offset, + const uint32_t& in_size, + const void* in_raw_data_ptr, + const bool& in_should_cache_raw_data) + { + anvil_assert(m_descriptor_sets.find(in_n_set) != m_descriptor_sets.end() ); + + if (m_descriptor_sets[in_n_set]->descriptor_set_ptr == nullptr) + { + bake_descriptor_sets(); + + anvil_assert(m_descriptor_sets[in_n_set]->descriptor_set_ptr != nullptr); + } + + return m_descriptor_sets[in_n_set]->descriptor_set_ptr->set_inline_uniform_block_binding_data(in_binding_index, + in_start_offset, + in_size, + in_raw_data_ptr, + in_should_cache_raw_data); + } + /** This function works exactly like set_bindings(), except that it always replaces the zeroth element * attached to the specified descriptor set's binding. */ @@ -269,6 +310,19 @@ namespace Anvil ~DescriptorSetInfoContainer(); } DescriptorSetInfoContainer; + typedef struct DescriptorTypeProperties + { + uint32_t n_overhead_allocations; + uint32_t pool_size; + + DescriptorTypeProperties() + :n_overhead_allocations(0), + pool_size (0) + { + /* Stub */ + } + } DescriptorTypeProperties; + /* Private functions */ /** Please see create() documentation for more details. */ @@ -291,8 +345,8 @@ namespace Anvil mutable std::map > m_descriptor_sets; const Anvil::BaseDevice* m_device_ptr; std::vector m_ds_create_info_ptrs; - uint32_t m_overhead_allocations [VK_DESCRIPTOR_TYPE_RANGE_SIZE]; - uint32_t m_pool_size_per_descriptor_type[VK_DESCRIPTOR_TYPE_RANGE_SIZE]; + + std::unordered_map m_descriptor_type_properties; uint32_t m_n_unique_dses; const Anvil::DescriptorSetGroup* m_parent_dsg_ptr; diff --git a/include/wrappers/device.h b/include/wrappers/device.h index 6a6ed8ac..b75323f7 100644 --- a/include/wrappers/device.h +++ b/include/wrappers/device.h @@ -32,6 +32,7 @@ #define WRAPPERS_DEVICE_H #include "misc/debug.h" +#include "misc/device_create_info.h" #include "misc/extensions.h" #include "misc/mt_safety.h" #include "misc/struct_chainer.h" @@ -46,8 +47,7 @@ namespace Anvil /* Public functions */ /* Constructor */ - BaseDevice(const Anvil::Instance* in_parent_instance_ptr, - bool in_mt_safe); + BaseDevice(Anvil::DeviceCreateInfoUniquePtr in_create_info_ptr); virtual ~BaseDevice(); @@ -89,6 +89,11 @@ namespace Anvil return result_ptr; } + const Anvil::DeviceCreateInfo* get_create_info_ptr() const + { + return m_create_info_ptr.get(); + } + Anvil::DescriptorSetLayoutManager* get_descriptor_set_layout_manager() const { return m_descriptor_set_layout_manager_ptr.get(); @@ -127,6 +132,7 @@ namespace Anvil return m_amd_buffer_marker_extension_entrypoints; } + /** Returns a container with entry-points to functions introduced by VK_AMD_draw_indirect_count extension. * * Will fire an assertion failure if the extension was not requested at device creation time. @@ -305,6 +311,14 @@ namespace Anvil return m_khr_maintenance3_extension_entrypoints; } + /** Returns a container with entry-points to functions introduced by VK_KHR_sampler_ycbcr_conversion extension. **/ + const ExtensionKHRSamplerYCbCrConversionEntrypoints& get_extension_khr_sampler_ycbcr_conversion_entrypoints() const + { + anvil_assert(m_extension_enabled_info_ptr->get_device_extension_info()->khr_sampler_ycbcr_conversion() ); + + return m_khr_sampler_ycbcr_conversion_extension_entrypoints; + } + /** Returns a container with entry-points to functions introduced by VK_KHR_swapchain extension. * * Will fire an assertion failure if the extension was not requested at device creation time. @@ -349,9 +363,9 @@ namespace Anvil switch (in_family_type) { - case Anvil::QueueFamilyType::COMPUTE: result = static_cast(m_compute_queues.size() ); break; - case Anvil::QueueFamilyType::TRANSFER: result = static_cast(m_transfer_queues.size() ); break; - case Anvil::QueueFamilyType::UNIVERSAL: result = static_cast(m_universal_queues.size() ); break; + case Anvil::QueueFamilyType::COMPUTE: result = static_cast(m_compute_queues.size() ); break; + case Anvil::QueueFamilyType::TRANSFER: result = static_cast(m_transfer_queues.size() ); break; + case Anvil::QueueFamilyType::UNIVERSAL: result = static_cast(m_universal_queues.size() ); break; default: { @@ -391,10 +405,7 @@ namespace Anvil } /** Returns Vulkan instance wrapper used to create this device. */ - const Anvil::Instance* get_parent_instance() const - { - return m_parent_instance_ptr; - } + const Anvil::Instance* get_parent_instance() const; virtual bool get_physical_device_buffer_properties(const BufferPropertiesQuery& in_query, Anvil::BufferProperties* out_opt_result_ptr = nullptr) const = 0; @@ -691,16 +702,14 @@ namespace Anvil /* Protected functions */ - void add_physical_device_features_to_chainer(const VkPhysicalDeviceFeatures* in_opt_features_ptr, - Anvil::StructChainer* in_struct_chainer, - bool in_add_features_struct) const; + void add_physical_device_features_to_chainer(Anvil::StructChainer* in_struct_chainer) const; - std::vector get_queue_priorities(const QueueFamilyInfo* in_queue_family_info_ptr) const; - void init (const DeviceExtensionConfiguration& in_extensions, - const std::vector& in_layers, - bool in_transient_command_buffer_allocs_only, - bool in_support_resettable_command_buffer_allocs, - bool in_enable_shader_module_cache); + void create_device(const std::vector& in_extensions, + const std::vector& in_layers, + DeviceQueueFamilyInfo* out_queue_families_ptr); + + std::vector get_queue_priorities(const QueueFamilyInfo* in_queue_family_info_ptr) const; + bool init (); BaseDevice& operator=(const BaseDevice&); BaseDevice (const BaseDevice&); @@ -714,15 +723,13 @@ namespace Anvil virtual void get_queue_family_indices_for_physical_device(const Anvil::PhysicalDevice* in_physical_device_ptr, DeviceQueueFamilyInfo* out_device_queue_family_info_ptr) const; - virtual void create_device (const std::vector& in_extensions, - const std::vector& in_layers, - const VkPhysicalDeviceFeatures& in_features, - DeviceQueueFamilyInfo* out_queue_families_ptr) = 0; virtual void init_device () = 0; virtual bool is_layer_supported (const std::string& in_layer_name) const = 0; virtual bool is_physical_device_extension_supported(const std::string& in_extension_name) const = 0; /* Protected variables */ + Anvil::DeviceCreateInfoUniquePtr m_create_info_ptr; + std::vector m_compute_queues; DeviceQueueFamilyInfo m_device_queue_families; std::vector m_sparse_binding_queues; @@ -754,6 +761,7 @@ namespace Anvil ExtensionKHRGetMemoryRequirements2Entrypoints m_khr_get_memory_requirements2_extension_entrypoints; ExtensionKHRMaintenance1Entrypoints m_khr_maintenance1_extension_entrypoints; ExtensionKHRMaintenance3Entrypoints m_khr_maintenance3_extension_entrypoints; + ExtensionKHRSamplerYCbCrConversionEntrypoints m_khr_sampler_ycbcr_conversion_extension_entrypoints; ExtensionKHRSurfaceEntrypoints m_khr_surface_extension_entrypoints; ExtensionKHRSwapchainEntrypoints m_khr_swapchain_extension_entrypoints; @@ -766,16 +774,21 @@ namespace Anvil ExtensionKHRExternalMemoryFdEntrypoints m_khr_external_memory_fd_extension_entrypoints; ExtensionKHRExternalSemaphoreFdEntrypoints m_khr_external_semaphore_fd_extension_entrypoints; #endif + private: + /* Private functions */ + bool init_dummy_dsg () const; + bool init_extension_func_ptrs(); + /* Private variables */ std::unique_ptr m_compute_pipeline_manager_ptr; DescriptorSetLayoutManagerUniquePtr m_descriptor_set_layout_manager_ptr; - Anvil::DescriptorSetGroupUniquePtr m_dummy_dsg_ptr; + mutable Anvil::DescriptorSetGroupUniquePtr m_dummy_dsg_ptr; + mutable std::mutex m_dummy_dsg_mutex; std::unique_ptr > m_extension_enabled_info_ptr; GraphicsPipelineManagerUniquePtr m_graphics_pipeline_manager_ptr; - const Anvil::Instance* m_parent_instance_ptr; PipelineCacheUniquePtr m_pipeline_cache_ptr; PipelineLayoutManagerUniquePtr m_pipeline_layout_manager_ptr; Anvil::ShaderModuleCacheUniquePtr m_shader_module_cache_ptr; @@ -793,32 +806,13 @@ namespace Anvil virtual ~SGPUDevice(); - /** Creates a new Vulkan Device instance using a user-specified physical device instance. - * - * @param in_physical_device_ptr Physical device to create this device from. Must not be nullptr. - * @param in_extensions Tells which extensions must/should be specified at creation time. - * @param in_layers A vector of layer names to be used when creating the device. - * Can be empty. - * @param in_transient_command_buffer_allocs_only True if the command pools, which are going to be initialized after - * the device is created, should be set up for transient command buffer - * support. - * @param in_support_resettable_command_buffer_allocs True if the command pools should be configured for resettable command - * buffer support. - * @param in_enable_shader_module_cache True if all spawned shader modules should be cached throughout instance lifetime. - * False if they should be released as soon as all shared pointers go out of scope. - * @param in_mt_safe True if command buffer creation and queue submissions should be automatically serialized. - * Set to false if your app is never going to use more than one thread at a time for - * command buffer creation or submission. + /** Creates a new Vulkan Device instance. + * + * @param in_create_info_ptr Create info structure. Must not be nullptr. * * @return A new Device instance. **/ - static BaseDeviceUniquePtr create(const Anvil::PhysicalDevice* in_physical_device_ptr, - bool in_enable_shader_module_cache, - const DeviceExtensionConfiguration& in_extensions, - const std::vector& in_layers, - bool in_transient_command_buffer_allocs_only, - bool in_support_resettable_command_buffer_allocs, - bool in_mt_safe = false); + static BaseDeviceUniquePtr create(Anvil::DeviceCreateInfoUniquePtr in_create_info_ptr); /** Creates a new swapchain instance for the device. * @@ -846,7 +840,7 @@ namespace Anvil **/ const Anvil::PhysicalDevice* get_physical_device() const { - return m_parent_physical_device_ptr; + return m_create_info_ptr->get_physical_device_ptrs().at(0); } bool get_physical_device_buffer_properties(const BufferPropertiesQuery& in_query, @@ -901,10 +895,6 @@ namespace Anvil protected: /* Protected functions */ - void create_device (const std::vector& in_extensions, - const std::vector& in_layers, - const VkPhysicalDeviceFeatures& in_features, - DeviceQueueFamilyInfo* out_queue_families_ptr) override; void get_queue_family_indices (DeviceQueueFamilyInfo* out_device_queue_family_info_ptr) const; void init_device () override; bool is_layer_supported (const std::string& in_layer_name) const override; @@ -916,11 +906,9 @@ namespace Anvil /* Private functions */ /** Private constructor. Please use create() instead. */ - SGPUDevice(const Anvil::PhysicalDevice* in_physical_device_ptr, - bool in_mt_safe); + SGPUDevice(Anvil::DeviceCreateInfoUniquePtr in_create_info_ptr); /* Private variables */ - const Anvil::PhysicalDevice* m_parent_physical_device_ptr; }; /* TODO */ @@ -932,13 +920,7 @@ namespace Anvil virtual ~MGPUDevice(); /** TODO */ - static Anvil::BaseDeviceUniquePtr create(std::vector in_physical_device_ptrs, - bool in_enable_shader_module_cache, - const DeviceExtensionConfiguration& in_extensions, - const std::vector& in_layers, - bool in_transient_command_buffer_allocs_only, - bool in_support_resettable_command_buffer_allocs, - bool in_mt_safe = false); + static Anvil::BaseDeviceUniquePtr create(Anvil::DeviceCreateInfoUniquePtr in_create_info_ptr); /** TODO */ Anvil::SwapchainUniquePtr create_swapchain(Anvil::RenderingSurface* in_parent_surface_ptr, @@ -1073,10 +1055,6 @@ namespace Anvil protected: /* Protected functions */ - void create_device (const std::vector& in_extensions, - const std::vector& in_layers, - const VkPhysicalDeviceFeatures& in_features, - DeviceQueueFamilyInfo* out_queue_families_ptr) override; void get_queue_family_indices (DeviceQueueFamilyInfo* out_device_queue_family_info_ptr) const; void init_device () override; bool is_layer_supported (const std::string& in_layer_name) const override; @@ -1099,8 +1077,7 @@ namespace Anvil /* Private functions */ /** Private constructor. Please use create() instead. */ - MGPUDevice(std::vector in_physical_device_ptrs, - bool in_mt_safe); + MGPUDevice(Anvil::DeviceCreateInfoUniquePtr in_create_info_ptr); /* Private variables */ std::map m_device_index_to_physical_device_props; diff --git a/include/wrappers/image.h b/include/wrappers/image.h index 379c3783..3394cf9d 100644 --- a/include/wrappers/image.h +++ b/include/wrappers/image.h @@ -34,6 +34,8 @@ #include "misc/mt_safety.h" #include "misc/types.h" #include "misc/page_tracker.h" +#include + namespace Anvil { @@ -148,9 +150,9 @@ namespace Anvil const VkImage& get_image(const bool& in_bake_memory_if_necessary = true); /** Returns information about the data alignment required by the underlying VkImage instance */ - VkDeviceSize get_image_alignment() const + VkDeviceSize get_image_alignment(const uint32_t& in_n_plane) const { - return m_alignment; + return m_plane_index_to_memory_properties_map.at(in_n_plane).alignment; } /** Returns extent of a user-specified image mip as a VkExtent2D structure. @@ -170,9 +172,9 @@ namespace Anvil VkExtent3D get_image_extent_3D(uint32_t in_n_mipmap) const; /** Returns information about the memory types the underlying VkImage instance supports */ - uint32_t get_image_memory_types() const + uint32_t get_image_memory_types(const uint32_t& in_n_plane) const { - return m_memory_types; + return m_plane_index_to_memory_properties_map.at(in_n_plane).memory_types; } /** Returns information about size of the mipmap at index @param in_n_mipmap. @@ -195,9 +197,9 @@ namespace Anvil /** Returns information about the amount of memory the underlying VkImage instance requires * to work correctly. **/ - VkDeviceSize get_image_storage_size() const + VkDeviceSize get_image_storage_size(const uint32_t& in_n_plane) const { - return m_storage_size; + return m_plane_index_to_memory_properties_map.at(in_n_plane).storage_size; } /** Returns a pointer to the underlying memory block wrapper instance. @@ -210,14 +212,13 @@ namespace Anvil * * In case of sparse images, the callback will only occur if at least one memory allocation * has been scheduled for this image instance. + * + * NOTE: The function always returns nullptr for PRTs. However, the callback takes place nevertheless. + * + * @param in_n_plane Must be 0 for non-YUV or joint YUV images. For disjoint YUV images, the value must be between 0 + * and 2 (inclusive). **/ - Anvil::MemoryBlock* get_memory_block(); - - /** Returns VkMemoryRequirements structure, as reported by the driver for this Image instance. */ - const VkMemoryRequirements& get_memory_requirements() const - { - return m_memory_reqs; - } + Anvil::MemoryBlock* get_memory_block(const uint32_t& in_n_plane = 0); const uint32_t& get_n_mipmaps() const { @@ -275,14 +276,14 @@ namespace Anvil uint32_t in_y, uint32_t in_z) const; - bool prefers_dedicated_allocation() const + bool prefers_dedicated_allocation(const uint32_t& in_n_plane) const { - return m_prefers_dedicated_allocation; + return m_plane_index_to_memory_properties_map.at(in_n_plane).prefers_dedicated_allocation; } - bool requires_dedicated_allocation() const + bool requires_dedicated_allocation(const uint32_t& in_n_plane) const { - return m_requires_dedicated_allocation; + return m_plane_index_to_memory_properties_map.at(in_n_plane).requires_dedicated_allocation; } /** Binds the specified region of a Vulkan memory object to an Image and caches information @@ -342,34 +343,6 @@ namespace Anvil uint32_t in_n_SFR_rects, const VkRect2D* in_SFRs_ptr); - /** See set_memory() for general documentation. - * - * This static function can be used to set up image memory bindings using SFR rectangles - * in a batched manner. - * - * Can only be used for multi-GPU devices. - * - * Requires VK_KHR_device_group to be supported by & enabled for the device. - * - * TODO - **/ - static bool set_memory_multi(uint32_t in_n_image_sfr_memory_binding_updates, - ImageSFRMemoryBindingUpdate* in_updates_ptr); - - /** See set_memory() for general documentation. - * - * This static function can be used to set up image memory bindings by specifying physical devices - * in a batched manner. - * - * Can only be used for multi-GPU devices. - * - * Requires VK_KHR_device_group to be supported by & enabled for the device. - * - * TODO - **/ - static bool set_memory_multi(uint32_t in_n_image_physical_device_memory_binding_updates, - ImagePhysicalDeviceMemoryBindingUpdate* in_updates_ptr); - /** Updates image with specified mip-map data. Blocks until the operation finishes executing. * * Handles both linear and optimal images. @@ -536,21 +509,18 @@ namespace Anvil void init_page_occupancy(const std::vector& in_memory_reqs); void init_sfr_tile_size (); - bool set_memory_internal(uint32_t in_swapchain_image_index, - uint32_t in_opt_n_SFR_rects, - const VkRect2D* in_opt_SFRs_ptr, - uint32_t in_opt_n_device_indices, - const uint32_t* in_opt_device_indices); - bool set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, - bool in_owned_by_image); - bool set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, - bool in_owned_by_image, - uint32_t in_n_device_group_indices, - const uint32_t* in_device_group_indices_ptr); - bool set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, - bool in_owned_by_image, - uint32_t in_n_SFR_rects, - const VkRect2D* in_SFRs_ptr); + bool set_memory_internal (Anvil::MemoryBlock* in_memory_block_ptr, + bool in_owned_by_image, + uint32_t in_n_device_group_indices, + const uint32_t* in_device_group_indices_ptr, + uint32_t in_n_SFR_rects, + const VkRect2D* in_SFRs_ptr); + bool set_swapchain_memory_internal(uint32_t in_swapchain_image_index, + uint32_t in_opt_n_SFR_rects, + const VkRect2D* in_opt_SFRs_ptr, + uint32_t in_opt_n_device_indices, + const uint32_t* in_opt_device_indices); + void on_memory_backing_update (const Anvil::ImageSubresource& in_subresource, VkOffset3D in_offset, @@ -558,7 +528,8 @@ namespace Anvil Anvil::MemoryBlock* in_memory_block_ptr, VkDeviceSize in_memory_block_start_offset, bool in_memory_block_owned_by_image); - void on_memory_backing_opaque_update(VkDeviceSize in_resource_offset, + void on_memory_backing_opaque_update(uint32_t in_n_plane, + VkDeviceSize in_resource_offset, VkDeviceSize in_size, Anvil::MemoryBlock* in_memory_block_ptr, VkDeviceSize in_memory_block_start_offset, @@ -567,32 +538,63 @@ namespace Anvil void transition_to_post_alloc_image_layout(Anvil::AccessFlags in_src_access_mask, Anvil::ImageLayout in_src_layout); - /** TODO. - * - * Does NOT set ::pQueueFamilyIndices and ::queueFamilyIndexCount! - */ - static VkImageCreateInfo get_create_info_for_swapchain(const Anvil::Swapchain* in_swapchain_ptr); - /* Private members */ typedef std::pair LayerMipKey; typedef std::map LayerMipToSubresourceLayoutMap; typedef std::map AspectToLayerMipToSubresourceLayoutMap; - VkDeviceSize m_alignment; - AspectToLayerMipToSubresourceLayoutMap m_aspects; /* only used for linear images */ + /* NOTE: For YUV images, this map uses .._PLANE_x_.. aspects as keys. Non-disjoint YUV images only use PLANE_0 key. + * For all others, this map uses COLOR/DEPTH/STENCIL aspect keys. + * + * NOTE: This field is only used for linear images. + */ + AspectToLayerMipToSubresourceLayoutMap m_linear_image_aspect_data; + Anvil::ImageCreateInfoUniquePtr m_create_info_ptr; bool m_has_transitioned_to_post_alloc_layout; VkImage m_image; - VkMemoryRequirements m_memory_reqs; - uint32_t m_memory_types; - Mipmaps m_mipmaps; + Mipmaps m_mipmap_props; uint32_t m_n_mipmaps; - VkDeviceSize m_storage_size; bool m_swapchain_memory_assigned; - bool m_uses_full_mipmap_chain; - bool m_prefers_dedicated_allocation; - bool m_requires_dedicated_allocation; + struct PerPlaneMemoryProperties + { + VkDeviceSize alignment; + uint32_t memory_types; + std::unique_ptr page_tracker_ptr; /* only used for sparse binding images */ + bool prefers_dedicated_allocation; + bool requires_dedicated_allocation; + VkDeviceSize storage_size; + + PerPlaneMemoryProperties() + :alignment (UINT64_MAX), + memory_types (0), + prefers_dedicated_allocation (false), + requires_dedicated_allocation(false), + storage_size (0) + { + /* Stub */ + } + + PerPlaneMemoryProperties(const VkDeviceSize& in_alignment, + const uint32_t& in_memory_types, + const bool& in_prefers_dedicated_allocation, + const bool& in_requires_dedicated_allocation, + const VkDeviceSize& in_storage_size) + :alignment (in_alignment), + memory_types (in_memory_types), + prefers_dedicated_allocation (in_prefers_dedicated_allocation), + requires_dedicated_allocation(in_requires_dedicated_allocation), + storage_size (in_storage_size) + { + /* Stub */ + } + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(PerPlaneMemoryProperties); + }; + + /* NOTE: This map always holds exactly one item (key: 0) for single-planar (ie.non-YUV) and joint YUV images. */ + std::unordered_map m_plane_index_to_memory_properties_map; std::vector m_peer_device_indices; std::vector m_peer_sfr_rects; @@ -601,7 +603,6 @@ namespace Anvil MemoryBlockUniquePtr m_metadata_memory_block_ptr; std::vector m_memory_blocks_owned; - std::unique_ptr m_page_tracker_ptr; /* only used for sparse non-resident images */ std::map m_sparse_aspect_page_occupancy; std::vector > m_sparse_aspect_page_occupancy_data_items_owned; std::map m_sparse_aspect_props; diff --git a/include/wrappers/instance.h b/include/wrappers/instance.h index 743c6000..eec672e4 100644 --- a/include/wrappers/instance.h +++ b/include/wrappers/instance.h @@ -49,6 +49,11 @@ namespace Anvil /** Creates a new Instance wrapper instance. **/ static Anvil::InstanceUniquePtr create(Anvil::InstanceCreateInfoUniquePtr in_create_info_ptr); + const Anvil::APIVersion& get_api_version() const + { + return m_api_version; + } + const Anvil::IExtensionInfoInstance* get_enabled_extensions_info() const { return m_enabled_extensions_info_ptr->get_instance_extension_info(); @@ -192,13 +197,11 @@ namespace Anvil void enumerate_layer_extensions (Anvil::Layer* layer_ptr); void enumerate_physical_device_groups(); void enumerate_physical_devices (); - void init (); + bool init (); void init_debug_callbacks (); void init_func_pointers (); - #if !defined(ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB) - bool init_vk10_func_ptrs(); - #endif + bool init_vk_func_ptrs(); void debug_callback_handler(const Anvil::DebugMessageSeverityFlagBits& in_severity, const char* in_message_ptr); @@ -215,6 +218,9 @@ namespace Anvil ExtensionKHRGetPhysicalDeviceProperties2 m_khr_get_physical_device_properties2_entrypoints; ExtensionKHRSurfaceEntrypoints m_khr_surface_entrypoints; + #if defined(_WIN32) + #endif + #ifdef _WIN32 #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) ExtensionKHRWin32SurfaceEntrypoints m_khr_win32_surface_entrypoints; @@ -225,6 +231,7 @@ namespace Anvil #endif #endif + Anvil::APIVersion m_api_version; Anvil::InstanceCreateInfoUniquePtr m_create_info_ptr; std::unique_ptr > m_enabled_extensions_info_ptr; diff --git a/include/wrappers/memory_block.h b/include/wrappers/memory_block.h index 199d99fd..94c2c007 100644 --- a/include/wrappers/memory_block.h +++ b/include/wrappers/memory_block.h @@ -61,7 +61,16 @@ namespace Anvil public: /* Public functions */ - static MemoryBlockUniquePtr create(Anvil::MemoryBlockCreateInfoUniquePtr in_create_info_ptr); + /* TODO + * + * @param in_create_info_ptr TODO + * @param out_opt_result_ptr If not null, deref will be set to the error code reported by the API function + * used to allocate the memory. + * + * @return New memory block instance if successful, null otherwise. + */ + static MemoryBlockUniquePtr create(Anvil::MemoryBlockCreateInfoUniquePtr in_create_info_ptr, + VkResult* out_opt_result_ptr = nullptr); /* Creates a new external memory handle of the user-specified type. * @@ -196,7 +205,15 @@ namespace Anvil private: /* Private functions */ - bool init(); + + /* TODO + * + * @param out_opt_result_ptr If not null, deref will be set to the error code reported by the API function + * used to allocate the memory. + * + * @return True if successful, false otherwise. + */ + bool init(VkResult* out_opt_result_ptr = nullptr); MemoryBlock(Anvil::MemoryBlockCreateInfoUniquePtr in_create_info_ptr); diff --git a/include/wrappers/physical_device.h b/include/wrappers/physical_device.h index cb9822a9..7a8a54fd 100644 --- a/include/wrappers/physical_device.h +++ b/include/wrappers/physical_device.h @@ -59,6 +59,12 @@ namespace Anvil /** Destructor */ virtual ~PhysicalDevice(); + /** Returns a filled structure telling current consumption of memory on a per-heap basis. + * + * Requires VK_EXT_memory_budget support. + **/ + Anvil::MemoryBudget get_available_memory_budget() const; + /* TODO * * Requires VK_KHR_external_memory_capabilities. @@ -135,8 +141,8 @@ namespace Anvil } /** Returns a filled Anvil::MemoryProperties structure, describing the - * encapsulated physical device. - **/ + * encapsulated physical device. + **/ const Anvil::MemoryProperties& get_memory_properties() const { return m_memory_properties; @@ -202,6 +208,9 @@ namespace Anvil **/ bool is_layer_supported(const std::string& in_layer_name) const; + /* Tells if the physical device supports VK 1.1 API (or newer) */ + bool supports_core_vk1_1() const; + private: /* Private functions */ @@ -232,6 +241,8 @@ namespace Anvil void set_device_group_device_index(uint32_t in_new_device_group_device_index); void set_device_group_index (uint32_t in_new_device_group_index); + bool supports_core_vk1_1(const uint32_t& in_api_version) const; + /* Private variables */ uint32_t m_device_group_device_index; uint32_t m_device_group_index; @@ -247,24 +258,39 @@ namespace Anvil std::unique_ptr m_amd_shader_core_properties_ptr; std::unique_ptr m_core_features_vk10_ptr; + std::unique_ptr m_core_features_vk11_ptr; std::unique_ptr m_core_properties_vk10_ptr; + std::unique_ptr m_core_properties_vk11_ptr; + std::unique_ptr m_ext_conservative_rasterization_properties_ptr; + std::unique_ptr m_ext_depth_clip_enable_features_ptr; std::unique_ptr m_ext_descriptor_indexing_features_ptr; std::unique_ptr m_ext_descriptor_indexing_properties_ptr; std::unique_ptr m_ext_external_memory_host_properties_ptr; + std::unique_ptr m_ext_inline_uniform_block_features_ptr; + std::unique_ptr m_ext_inline_uniform_block_properties_ptr; std::unique_ptr m_ext_pci_bus_info_ptr; std::unique_ptr m_ext_sample_locations_properties_ptr; std::unique_ptr m_ext_sampler_filter_minmax_properties_ptr; + std::unique_ptr m_ext_scalar_block_layout_features_ptr; std::unique_ptr m_ext_transform_feedback_features_ptr; std::unique_ptr m_ext_transform_feedback_properties_ptr; std::unique_ptr m_ext_vertex_attribute_divisor_properties_ptr; + std::unique_ptr m_ext_memory_priority_features_ptr; std::unique_ptr m_khr_16_bit_storage_features_ptr; std::unique_ptr m_khr_8_bit_storage_features_ptr; + std::unique_ptr m_khr_depth_stencil_resolve_properties_ptr; + std::unique_ptr m_khr_driver_properties_properties_ptr; std::unique_ptr m_khr_external_memory_capabilities_physical_device_id_properties_ptr; + std::unique_ptr m_khr_float16_int8_features_ptr; std::unique_ptr m_khr_maintenance2_physical_device_point_clipping_properties_ptr; std::unique_ptr m_khr_maintenance3_properties_ptr; std::unique_ptr m_khr_multiview_features_ptr; std::unique_ptr m_khr_multiview_properties_ptr; + std::unique_ptr m_khr_sampler_ycbcr_conversion_features_ptr; + std::unique_ptr m_khr_shader_atomic_int64_features_ptr; + std::unique_ptr m_khr_shader_float_controls_properties_ptr; std::unique_ptr m_khr_variable_pointer_features_ptr; + std::unique_ptr m_khr_vulkan_memory_model_features_ptr; friend class Anvil::Instance; }; diff --git a/include/wrappers/queue.h b/include/wrappers/queue.h index fc9baec2..f59b5b06 100644 --- a/include/wrappers/queue.h +++ b/include/wrappers/queue.h @@ -97,9 +97,7 @@ namespace Anvil /** Initializes a new Vulkan queue instance. * - * After construction, set_swapchain() should be called individually - * to assign a swapchain to the queue. This is necessary in order for - * present() calls to work correctly. + * NOTE: This function must only be used by Anvil::*Device! * * @param in_device_ptr Device to retrieve the queue from. * @param in_queue_family_index Index of the queue family to retrieve the queue from. @@ -107,11 +105,14 @@ namespace Anvil * @param in_mt_safe True if queue submissions should be protected by a mutex, guaranteeing * no more than one thread at a time will ever submit a cmd buffer to the * same cmd queue. + * @param in_global_priority Global priority of the new queue. Setting this value to anything else than Anvil::QueueGlobalPriority::MEDIUM_EXT + * requires VK_EXT_queue_global_priority support. **/ - static std::unique_ptr create(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_queue_family_index, - uint32_t in_queue_index, - bool in_mt_safe); + static std::unique_ptr create(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_queue_family_index, + uint32_t in_queue_index, + bool in_mt_safe, + const Anvil::QueueGlobalPriority& in_global_priority = Anvil::QueueGlobalPriority::MEDIUM_EXT); /** Destructor */ virtual ~Queue(); @@ -158,6 +159,15 @@ namespace Anvil return m_queue_family_index; } + /** Retrieves global priority used to create the queue. + * + * Only meaningful if VK_EXT_queue_global_priority if supported. + */ + const Anvil::QueueGlobalPriority& get_queue_global_priority() const + { + return m_queue_global_priority; + } + /** Retrieves index of the queue */ uint32_t get_queue_index() const { @@ -270,6 +280,12 @@ namespace Anvil bool submit(const SubmitInfo& in_submit_info); + /** Tells whether the queue supports protected memory operations */ + bool supports_protected_memory_operations() const + { + return m_supports_protected_memory_operations; + } + /** Tells whether the queue supports sparse bindings */ bool supports_sparse_bindings() const { @@ -314,22 +330,25 @@ namespace Anvil bool in_should_lock); /* Constructor. Please see create() for specification */ - Queue(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_queue_family_index, - uint32_t in_queue_index, - bool in_mt_safe); + Queue(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_queue_family_index, + uint32_t in_queue_index, + bool in_mt_safe, + const Anvil::QueueGlobalPriority& in_global_priority); Queue (const Queue&); Queue operator=(const Queue&); /* Private variables */ - const Anvil::BaseDevice* m_device_ptr; - uint32_t m_n_debug_label_regions_started; - VkQueue m_queue; - uint32_t m_queue_family_index; - uint32_t m_queue_index; - Anvil::FenceUniquePtr m_submit_fence_ptr; - bool m_supports_sparse_bindings; + const Anvil::BaseDevice* m_device_ptr; + uint32_t m_n_debug_label_regions_started; + VkQueue m_queue; + const uint32_t m_queue_family_index; + const Anvil::QueueGlobalPriority m_queue_global_priority; + const uint32_t m_queue_index; + Anvil::FenceUniquePtr m_submit_fence_ptr; + bool m_supports_protected_memory_operations; + bool m_supports_sparse_bindings; }; }; /* namespace Anvil */ diff --git a/include/wrappers/rendering_surface.h b/include/wrappers/rendering_surface.h index 81042683..aa9aaf1f 100644 --- a/include/wrappers/rendering_surface.h +++ b/include/wrappers/rendering_surface.h @@ -46,39 +46,12 @@ namespace Anvil { public: /* Public type definitions */ - typedef struct RenderingSurfaceFormat - { - Anvil::ColorSpaceKHR color_space; - Anvil::Format format; - - /* Constructor. */ - RenderingSurfaceFormat(Anvil::SurfaceFormatKHR& in_surface_format) - { - color_space = in_surface_format.color_space; - format = static_cast(in_surface_format.format); - } - - /** Comparison operator for _vulkan_surface_format and in_format types. - * - * @param in_format Right-side value. - * - * @return true if @param in_format matches _vulkan_surface_format::format value, false - * otherwise. - **/ - bool operator==(const Anvil::Format& in_format) const - { - return (format == in_format); - } - } RenderingSurfaceFormat; /* Public functions */ /** Creates a single Vulkan rendering surface instance and registers the object in * Object Tracker. */ - static Anvil::RenderingSurfaceUniquePtr create(Anvil::Instance* in_instance_ptr, - const Anvil::BaseDevice* in_device_ptr, - const Anvil::Window* in_window_ptr, - MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE); + static Anvil::RenderingSurfaceUniquePtr create(Anvil::RenderingSurfaceCreateInfoUniquePtr in_create_info_ptr); /** Destructor * @@ -158,6 +131,31 @@ namespace Anvil /* Private type definitions */ typedef uint32_t DeviceGroupIndex; + typedef struct RenderingSurfaceFormat + { + Anvil::ColorSpaceKHR color_space; + Anvil::Format format; + + /* Constructor. */ + RenderingSurfaceFormat(Anvil::SurfaceFormatKHR& in_surface_format) + { + color_space = in_surface_format.color_space; + format = static_cast(in_surface_format.format); + } + + /** Comparison operator for _vulkan_surface_format and in_format types. + * + * @param in_format Right-side value. + * + * @return true if @param in_format matches _vulkan_surface_format::format value, false + * otherwise. + **/ + bool operator==(const Anvil::Format& in_format) const + { + return (format == in_format); + } + } RenderingSurfaceFormat; + typedef struct PhysicalDeviceCapabilities { Anvil::SurfaceCapabilities capabilities; @@ -179,11 +177,7 @@ namespace Anvil /* Private functions */ /* Constructor. Please see create() for specification */ - RenderingSurface(Anvil::Instance* in_instance_ptr, - const Anvil::BaseDevice* in_device_ptr, - const Anvil::Window* in_window_ptr, - bool in_mt_safe, - bool* out_safe_to_use_ptr); + RenderingSurface(Anvil::RenderingSurfaceCreateInfoUniquePtr in_create_info_ptr); RenderingSurface (const RenderingSurface&); RenderingSurface& operator=(const RenderingSurface&); @@ -192,14 +186,12 @@ namespace Anvil bool init (); /* Private variables */ - const Anvil::BaseDevice* m_device_ptr; - Anvil::Instance* m_instance_ptr; + Anvil::RenderingSurfaceCreateInfoUniquePtr m_create_info_ptr; mutable uint32_t m_height; std::map m_physical_device_capabilities; VkSurfaceKHR m_surface; mutable uint32_t m_width; - const Anvil::Window* m_window_ptr; }; }; /* namespace Anvil */ diff --git a/include/wrappers/sampler_ycbcr_conversion.h b/include/wrappers/sampler_ycbcr_conversion.h new file mode 100644 index 00000000..f1f00d41 --- /dev/null +++ b/include/wrappers/sampler_ycbcr_conversion.h @@ -0,0 +1,74 @@ +// +// Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#ifndef WRAPPERS_SAMPLER_YCBCR_CONVERSION_H +#define WRAPPERS_SAMPLER_YCBCR_CONVERSION_H + +#include "misc/debug_marker.h" +#include "misc/mt_safety.h" +#include "misc/types.h" + +namespace Anvil +{ + class SamplerYCbCrConversion : public DebugMarkerSupportProvider, + public MTSafetySupportProvider + { + public: + /* Public functions */ + + virtual ~SamplerYCbCrConversion(); + + /** TODO + * + * NOTE: This object can only be used for Vulkan devices with VK_KHR_sampler_ycbcr_conversion extension support. + * + * For argument discussion, please consult Vulkan API specification. + */ + static SamplerYCbCrConversionUniquePtr create(Anvil::SamplerYCbCrConversionCreateInfoUniquePtr in_create_info_ptr); + + const Anvil::SamplerYCbCrConversionCreateInfo* get_create_info_ptr() const + { + return m_create_info_ptr.get(); + } + + VkSamplerYcbcrConversion get_sampler_ycbcr_conversion_vk() const + { + return m_sampler_ycbcr_conversion_vk; + } + + private: + /* Private functions */ + + SamplerYCbCrConversion(Anvil::SamplerYCbCrConversionCreateInfoUniquePtr in_create_info_ptr); + + bool init(); + + /* Private variables */ + + Anvil::SamplerYCbCrConversionCreateInfoUniquePtr m_create_info_ptr; + VkSamplerYcbcrConversion m_sampler_ycbcr_conversion_vk; + + ANVIL_DISABLE_ASSIGNMENT_OPERATOR(SamplerYCbCrConversion); + ANVIL_DISABLE_COPY_CONSTRUCTOR(SamplerYCbCrConversion); + }; +}; /* namespace Anvil */ + +#endif /* WRAPPERS_SAMPLER_YCBCR_CONVERSION_H */ \ No newline at end of file diff --git a/include/wrappers/swapchain.h b/include/wrappers/swapchain.h index 535b1dda..0ed91083 100644 --- a/include/wrappers/swapchain.h +++ b/include/wrappers/swapchain.h @@ -203,14 +203,14 @@ namespace Anvil void on_present_request_issued (Anvil::CallbackArgument* in_callback_raw_ptr); /* Private variables */ - Anvil::SwapchainCreateInfoUniquePtr m_create_info_ptr; - Anvil::FenceUniquePtr m_image_available_fence_ptr; - uint32_t m_n_images; /* number of images created in the swapchain. */ - std::vector m_image_ptrs; - std::vector m_image_view_ptrs; - uint32_t m_last_acquired_image_index; - VkExtent2D m_size; - VkSwapchainKHR m_swapchain; + Anvil::SwapchainCreateInfoUniquePtr m_create_info_ptr; + Anvil::FenceUniquePtr m_image_available_fence_ptr; + uint32_t m_n_images; /* number of images created in the swapchain. */ + std::vector m_image_ptrs; + std::vector m_image_view_ptrs; + uint32_t m_last_acquired_image_index; + VkExtent2D m_size; + VkSwapchainKHR m_swapchain; bool m_destroy_swapchain_before_parent_window_closes; diff --git a/src/misc/descriptor_pool_create_info.cpp b/src/misc/descriptor_pool_create_info.cpp new file mode 100644 index 00000000..ef39e97d --- /dev/null +++ b/src/misc/descriptor_pool_create_info.cpp @@ -0,0 +1,54 @@ +// +// Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#include "misc/descriptor_pool_create_info.h" + +Anvil::DescriptorPoolCreateInfoUniquePtr Anvil::DescriptorPoolCreateInfo::create(const Anvil::BaseDevice* in_device_ptr, + const uint32_t& in_n_max_sets, + const Anvil::DescriptorPoolCreateFlags& in_create_flags, + const Anvil::MTSafety& in_mt_safety) +{ + Anvil::DescriptorPoolCreateInfoUniquePtr result_ptr; + + result_ptr.reset( + new Anvil::DescriptorPoolCreateInfo(in_device_ptr, + in_n_max_sets, + in_create_flags, + in_mt_safety) + ); + + anvil_assert(result_ptr != nullptr); + return result_ptr; +} + +Anvil::DescriptorPoolCreateInfo::DescriptorPoolCreateInfo(const Anvil::BaseDevice* in_device_ptr, + const uint32_t& in_n_max_sets, + const Anvil::DescriptorPoolCreateFlags& in_create_flags, + const Anvil::MTSafety& in_mt_safety) + :m_create_flags (in_create_flags), + m_device_ptr (in_device_ptr), + m_mt_safety (in_mt_safety), + m_n_max_inline_uniform_block_bindings(0), + m_n_max_sets (in_n_max_sets) +{ + /* Stub */ +} diff --git a/src/misc/descriptor_set_create_info.cpp b/src/misc/descriptor_set_create_info.cpp index b539ab48..12a48b42 100644 --- a/src/misc/descriptor_set_create_info.cpp +++ b/src/misc/descriptor_set_create_info.cpp @@ -69,6 +69,11 @@ bool Anvil::DescriptorSetCreateInfo::add_binding(uint32_t } } + if (in_descriptor_type == Anvil::DescriptorType::INLINE_UNIFORM_BLOCK) + { + anvil_assert((in_descriptor_array_size % 4) == 0); + } + if ((in_flags & Anvil::DescriptorBindingFlagBits::VARIABLE_DESCRIPTOR_COUNT_BIT) != 0) { if (m_n_variable_descriptor_count_binding != UINT32_MAX) diff --git a/src/misc/device_create_info.cpp b/src/misc/device_create_info.cpp new file mode 100644 index 00000000..30ebb348 --- /dev/null +++ b/src/misc/device_create_info.cpp @@ -0,0 +1,92 @@ +// +// Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +#include "misc/device_create_info.h" +#include "wrappers/physical_device.h" + +Anvil::DeviceCreateInfoUniquePtr Anvil::DeviceCreateInfo::create_mgpu(const std::vector& in_physical_device_ptrs, + const bool& in_enable_shader_module_cache, + const DeviceExtensionConfiguration& in_extension_configuration, + const std::vector& in_layers_to_enable, + const Anvil::CommandPoolCreateFlags& in_helper_command_pool_create_flags, + const bool& in_mt_safe) +{ + Anvil::DeviceCreateInfoUniquePtr result_ptr; + + result_ptr.reset( + new Anvil::DeviceCreateInfo(in_physical_device_ptrs, + in_enable_shader_module_cache, + in_extension_configuration, + in_layers_to_enable, + in_helper_command_pool_create_flags, + in_mt_safe) + ); + + anvil_assert(result_ptr != nullptr); + return result_ptr; +} + +Anvil::DeviceCreateInfoUniquePtr Anvil::DeviceCreateInfo::create_sgpu(const Anvil::PhysicalDevice* in_physical_device_ptr, + const bool& in_enable_shader_module_cache, + const DeviceExtensionConfiguration& in_extension_configuration, + const std::vector& in_layers_to_enable, + const Anvil::CommandPoolCreateFlags& in_helper_command_pool_create_flags, + const bool& in_mt_safe) +{ + Anvil::DeviceCreateInfoUniquePtr result_ptr; + + result_ptr.reset( + new Anvil::DeviceCreateInfo({in_physical_device_ptr}, + in_enable_shader_module_cache, + in_extension_configuration, + in_layers_to_enable, + in_helper_command_pool_create_flags, + in_mt_safe) + ); + + anvil_assert(result_ptr != nullptr); + return result_ptr; +} + +Anvil::DeviceCreateInfo::DeviceCreateInfo(const std::vector& in_physical_device_ptrs, + const bool& in_enable_shader_module_cache, + const DeviceExtensionConfiguration& in_extension_configuration, + const std::vector& in_layers_to_enable, + const Anvil::CommandPoolCreateFlags& in_helper_command_pool_create_flags, + const bool& in_mt_safe) + :m_extension_configuration (in_extension_configuration), + m_helper_command_pool_create_flags (in_helper_command_pool_create_flags), + m_layers_to_enable (in_layers_to_enable), + m_memory_overallocation_behavior (Anvil::MemoryOverallocationBehavior::DEFAULT), + m_mt_safe (in_mt_safe), + m_physical_device_ptrs (in_physical_device_ptrs), + m_should_enable_shader_module_cache(in_enable_shader_module_cache) +{ + if (in_physical_device_ptrs.size() > 1) + { + for (const auto& current_physical_device_ptr : in_physical_device_ptrs) + { + ANVIL_REDUNDANT_VARIABLE_CONST(current_physical_device_ptr); + + anvil_assert(current_physical_device_ptr->get_instance() == in_physical_device_ptrs.at(0)->get_instance() ); + } + } +} \ No newline at end of file diff --git a/src/misc/formats.cpp b/src/misc/formats.cpp index 77021919..3908d6c7 100644 --- a/src/misc/formats.cpp +++ b/src/misc/formats.cpp @@ -23,6 +23,7 @@ #include "misc/debug.h" #include "misc/formats.h" #include +#include static const struct FormatInfo { @@ -224,6 +225,7 @@ static const struct FormatInfo struct SubresourceLayoutInfo { + Anvil::Format compatible_singleplanar_format; Anvil::ComponentLayout component_layout; uint8_t component_bits_used [4]; uint8_t component_bits_unused[4]; @@ -231,39 +233,44 @@ struct SubresourceLayoutInfo /* Default Constructor */ SubresourceLayoutInfo() { - component_layout = Anvil::ComponentLayout::UNKNOWN; - component_bits_used [0] = component_bits_used [1] = component_bits_used [2] = component_bits_used [3] = 0; - component_bits_unused[0] = component_bits_unused[1] = component_bits_unused[2] = component_bits_unused[3] = 0; + compatible_singleplanar_format = Anvil::Format::UNKNOWN; + component_layout = Anvil::ComponentLayout::UNKNOWN; + component_bits_used [0] = component_bits_used [1] = component_bits_used [2] = component_bits_used [3] = 0; + component_bits_unused[0] = component_bits_unused[1] = component_bits_unused[2] = component_bits_unused[3] = 0; } - SubresourceLayoutInfo(Anvil::ComponentLayout in_component_layout, + SubresourceLayoutInfo(const Anvil::Format& in_compatible_singleplanar_format, + Anvil::ComponentLayout in_component_layout, uint8_t in_component0_bits, uint8_t in_component1_bits, uint8_t in_component2_bits, uint8_t in_component3_bits) { - component_layout = in_component_layout; - component_bits_used[0] = in_component0_bits; - component_bits_used[1] = in_component1_bits; - component_bits_used[2] = in_component2_bits; - component_bits_used[3] = in_component3_bits; + compatible_singleplanar_format = in_compatible_singleplanar_format; + component_layout = in_component_layout; + component_bits_used[0] = in_component0_bits; + component_bits_used[1] = in_component1_bits; + component_bits_used[2] = in_component2_bits; + component_bits_used[3] = in_component3_bits; component_bits_unused[0] = component_bits_unused[1] = component_bits_unused[2] = component_bits_unused[3] = 0; } /* Constructor for packed format */ - SubresourceLayoutInfo(Anvil::ComponentLayout in_component_layout, + SubresourceLayoutInfo(const Anvil::Format& in_compatible_singleplanar_format, + Anvil::ComponentLayout in_component_layout, uint8_t in_component0_bits_used, uint8_t in_component1_bits_used, uint8_t in_component2_bits_used, uint8_t in_component3_bits_used, uint8_t in_n_bits_per_component) { - component_layout = in_component_layout; - component_bits_used[0] = in_component0_bits_used; - component_bits_used[1] = in_component1_bits_used; - component_bits_used[2] = in_component2_bits_used; - component_bits_used[3] = in_component3_bits_used; + compatible_singleplanar_format = in_compatible_singleplanar_format; + component_layout = in_component_layout; + component_bits_used[0] = in_component0_bits_used; + component_bits_used[1] = in_component1_bits_used; + component_bits_used[2] = in_component2_bits_used; + component_bits_used[3] = in_component3_bits_used; component_bits_unused[0] = component_bits_unused[1] = component_bits_unused[2] = component_bits_unused[3] = 0; @@ -337,198 +344,278 @@ struct YUVFormatInfo } }; -static const std::map g_yuv_formats = +/* TODO: Component layouts are wrong for YUV formats? */ +static const std::unordered_map g_yuv_formats = { - /* (key) | YUVFormatInfo (value) */ - /* format | name | num_planes | subresources[0] | subresources[1] | subresources[2] | format_type | is_multiplanar? | is_packed? */ - {Anvil::Format::G8B8G8R8_422_UNORM, {"VK_FORMAT_G8B8G8R8_422_UNORM", 1, {Anvil::ComponentLayout::GBGR, 8, 8, 8, 8}, {}, {}, Anvil::FormatType::UNORM, false, false} }, - {Anvil::Format::B8G8R8G8_422_UNORM, {"VK_FORMAT_B8G8R8G8_422_UNORM", 1, {Anvil::ComponentLayout::BGRG, 8, 8, 8, 8}, {}, {}, Anvil::FormatType::UNORM, false, false} }, - {Anvil::Format::G8_B8_R8_3PLANE_420_UNORM, {"VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM", 3, {Anvil::ComponentLayout::R, 8, 0, 0, 0}, {Anvil::ComponentLayout::R, 8, 0, 0, 0}, {Anvil::ComponentLayout::R, 8, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, - {Anvil::Format::G8_B8R8_2PLANE_420_UNORM, {"VK_FORMAT_G8_B8R8_2PLANE_420_UNORM", 2, {Anvil::ComponentLayout::R, 8, 0, 0, 0}, {Anvil::ComponentLayout::BR, 8, 8, 0, 0}, {}, Anvil::FormatType::UNORM, true, false} }, - {Anvil::Format::G8_B8_R8_3PLANE_422_UNORM, {"VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM", 3, {Anvil::ComponentLayout::G, 8, 0, 0, 0}, {Anvil::ComponentLayout::B, 8, 0, 0, 0}, {Anvil::ComponentLayout::R, 8, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, - {Anvil::Format::G8_B8R8_2PLANE_422_UNORM, {"VK_FORMAT_G8_B8R8_2PLANE_422_UNORM", 2, {Anvil::ComponentLayout::G, 8, 0, 0, 0}, {Anvil::ComponentLayout::BR, 8, 8, 0, 0}, {}, Anvil::FormatType::UNORM, true, false} }, - {Anvil::Format::G8_B8_R8_3PLANE_444_UNORM, {"VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM", 3, {Anvil::ComponentLayout::G, 8, 0, 0, 0}, {Anvil::ComponentLayout::B, 8, 0, 0, 0}, {Anvil::ComponentLayout::R, 8, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, - {Anvil::Format::R10X6_UNORM_PACK16, {"VK_FORMAT_R10X6_UNORM_PACK16", 1, {Anvil::ComponentLayout::RX, 10, 0, 0, 0, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, - {Anvil::Format::R10X6G10X6_UNORM_2PACK16, {"VK_FORMAT_R10X6G10X6_UNORM_2PACK16", 1, {Anvil::ComponentLayout::RXGX, 10, 10, 0, 0, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, - {Anvil::Format::R10X6G10X6B10X6A10X6_UNORM_4PACK16, {"VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16", 1, {Anvil::ComponentLayout::RXGXBXAX, 10, 10, 10, 10, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, - {Anvil::Format::G10X6B10X6G10X6R10X6_422_UNORM_4PACK16, {"VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16", 1, {Anvil::ComponentLayout::GXBXGXRX, 10, 10, 10, 10, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, - {Anvil::Format::B10X6G10X6R10X6G10X6_422_UNORM_4PACK16, {"VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16", 1, {Anvil::ComponentLayout::BXGXRXGX, 10, 10, 10, 10, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, - {Anvil::Format::G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16", 3, {Anvil::ComponentLayout::GX, 10, 0, 0, 0, 16}, {Anvil::ComponentLayout::BX, 10, 0, 0, 0, 16}, {Anvil::ComponentLayout::RX, 10, 0, 0, 0, 16}, Anvil::FormatType::UNORM, true, true } }, - {Anvil::Format::G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16", 2, {Anvil::ComponentLayout::GX, 10, 0, 0, 0, 16}, {Anvil::ComponentLayout::BXRX, 10, 10, 0, 0, 16}, {}, Anvil::FormatType::UNORM, true, true } }, - {Anvil::Format::G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16", 3, {Anvil::ComponentLayout::GX, 10, 0, 0, 0, 16}, {Anvil::ComponentLayout::BX, 10, 0, 0, 0, 16}, {Anvil::ComponentLayout::RX, 10, 0, 0, 0, 16}, Anvil::FormatType::UNORM, true, true } }, - {Anvil::Format::G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16", 2, {Anvil::ComponentLayout::GX, 10, 0, 0, 0, 16}, {Anvil::ComponentLayout::BXRX, 10, 10, 0, 0, 16}, {}, Anvil::FormatType::UNORM, true, true } }, - {Anvil::Format::G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16", 3, {Anvil::ComponentLayout::GX, 10, 0, 0, 0, 16}, {Anvil::ComponentLayout::BX, 10, 0, 0, 0, 16}, {Anvil::ComponentLayout::RX, 10, 0, 0, 0, 16}, Anvil::FormatType::UNORM, true, true } }, - {Anvil::Format::R12X4_UNORM_PACK16, {"VK_FORMAT_R12X4_UNORM_PACK16", 1, {Anvil::ComponentLayout::RX, 12, 0, 0, 0, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, - {Anvil::Format::R12X4G12X4_UNORM_2PACK16, {"VK_FORMAT_R12X4G12X4_UNORM_2PACK16", 1, {Anvil::ComponentLayout::RXGX, 12, 12, 0, 0, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, - {Anvil::Format::R12X4G12X4B12X4A12X4_UNORM_4PACK16, {"VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16", 1, {Anvil::ComponentLayout::RXGXBXAX, 12, 12, 12, 12, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, - {Anvil::Format::G12X4B12X4G12X4R12X4_422_UNORM_4PACK16, {"VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16", 1, {Anvil::ComponentLayout::GXBXGXRX, 12, 12, 12, 12, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, - {Anvil::Format::B12X4G12X4R12X4G12X4_422_UNORM_4PACK16, {"VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16", 1, {Anvil::ComponentLayout::BXGXRXGX, 12, 12, 12, 12, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, - {Anvil::Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16", 3, {Anvil::ComponentLayout::GX, 12, 0, 0, 0, 16}, {Anvil::ComponentLayout::BX, 12, 0, 0, 0, 16}, {Anvil::ComponentLayout::RX, 12, 0, 0, 0, 16}, Anvil::FormatType::UNORM, true, true } }, - {Anvil::Format::G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16", 2, {Anvil::ComponentLayout::GX, 12, 0, 0, 0, 16}, {Anvil::ComponentLayout::BXRX, 12, 12, 0, 0, 16}, {}, Anvil::FormatType::UNORM, true, true } }, - {Anvil::Format::G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16", 3, {Anvil::ComponentLayout::GX, 12, 0, 0, 0, 16}, {Anvil::ComponentLayout::BX, 12, 0, 0, 0, 16}, {Anvil::ComponentLayout::RX, 12, 0, 0, 0, 16}, Anvil::FormatType::UNORM, true, true } }, - {Anvil::Format::G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16", 2, {Anvil::ComponentLayout::GX, 12, 0, 0, 0, 16}, {Anvil::ComponentLayout::BXRX, 12, 12, 0, 0, 16}, {}, Anvil::FormatType::UNORM, true, true } }, - {Anvil::Format::G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16", 3, {Anvil::ComponentLayout::GX, 12, 0, 0, 0, 16}, {Anvil::ComponentLayout::BX, 12, 0, 0, 0, 16}, {Anvil::ComponentLayout::RX, 12, 0, 0, 0, 16}, Anvil::FormatType::UNORM, true, true } }, - {Anvil::Format::G16B16G16R16_422_UNORM, {"VK_FORMAT_G16B16G16R16_422_UNORM", 1, {Anvil::ComponentLayout::GBGR, 16, 16, 16, 16}, {}, {}, Anvil::FormatType::UNORM, false, false} }, - {Anvil::Format::B16G16R16G16_422_UNORM, {"VK_FORMAT_B16G16R16G16_422_UNORM", 1, {Anvil::ComponentLayout::BGRG, 16, 16, 16, 16}, {}, {}, Anvil::FormatType::UNORM, false, false} }, - {Anvil::Format::G16_B16_R16_3PLANE_420_UNORM, {"VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM", 3, {Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::ComponentLayout::B, 16, 0, 0, 0}, {Anvil::ComponentLayout::R, 16, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, - {Anvil::Format::G16_B16R16_2PLANE_420_UNORM, {"VK_FORMAT_G16_B16R16_2PLANE_420_UNORM", 2, {Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::ComponentLayout::BR, 16, 16, 0, 0}, {}, Anvil::FormatType::UNORM, true, false} }, - {Anvil::Format::G16_B16_R16_3PLANE_422_UNORM, {"VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM", 3, {Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::ComponentLayout::B, 16, 0, 0, 0}, {Anvil::ComponentLayout::R, 16, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, - {Anvil::Format::G16_B16R16_2PLANE_422_UNORM, {"VK_FORMAT_G16_B16R16_2PLANE_422_UNORM", 2, {Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::ComponentLayout::BR, 16, 16, 0, 0}, {}, Anvil::FormatType::UNORM, true, false} }, - {Anvil::Format::G16_B16_R16_3PLANE_444_UNORM, {"VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM", 3, {Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::ComponentLayout::B, 16, 0, 0, 0}, {Anvil::ComponentLayout::R, 16, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, + /* format | name | num_planes | subresources[0] | subresources[1] | subresources[2] | format_type | is_multiplanar? | is_packed? */ + {Anvil::Format::G8B8G8R8_422_UNORM, {"VK_FORMAT_G8B8G8R8_422_UNORM", 1, {Anvil::Format::UNKNOWN, Anvil::ComponentLayout::GBGR, 8, 8, 8, 8}, {}, {}, Anvil::FormatType::UNORM, false, false} }, + {Anvil::Format::B8G8R8G8_422_UNORM, {"VK_FORMAT_B8G8R8G8_422_UNORM", 1, {Anvil::Format::UNKNOWN, Anvil::ComponentLayout::BGRG, 8, 8, 8, 8}, {}, {}, Anvil::FormatType::UNORM, false, false} }, + {Anvil::Format::G8_B8_R8_3PLANE_420_UNORM, {"VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM", 3, {Anvil::Format::R8_UNORM, Anvil::ComponentLayout::R, 8, 0, 0, 0}, {Anvil::Format::R8_UNORM, Anvil::ComponentLayout::R, 8, 0, 0, 0}, {Anvil::Format::R8_UNORM, Anvil::ComponentLayout::R, 8, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G8_B8R8_2PLANE_420_UNORM, {"VK_FORMAT_G8_B8R8_2PLANE_420_UNORM", 2, {Anvil::Format::R8_UNORM, Anvil::ComponentLayout::R, 8, 0, 0, 0}, {Anvil::Format::R8G8_UNORM, Anvil::ComponentLayout::BR, 8, 8, 0, 0}, {}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G8_B8_R8_3PLANE_422_UNORM, {"VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM", 3, {Anvil::Format::R8_UNORM, Anvil::ComponentLayout::G, 8, 0, 0, 0}, {Anvil::Format::R8_UNORM, Anvil::ComponentLayout::B, 8, 0, 0, 0}, {Anvil::Format::R8_UNORM, Anvil::ComponentLayout::R, 8, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G8_B8R8_2PLANE_422_UNORM, {"VK_FORMAT_G8_B8R8_2PLANE_422_UNORM", 2, {Anvil::Format::R8_UNORM, Anvil::ComponentLayout::G, 8, 0, 0, 0}, {Anvil::Format::R8G8_UNORM, Anvil::ComponentLayout::BR, 8, 8, 0, 0}, {}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G8_B8_R8_3PLANE_444_UNORM, {"VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM", 3, {Anvil::Format::R8_UNORM, Anvil::ComponentLayout::G, 8, 0, 0, 0}, {Anvil::Format::R8_UNORM, Anvil::ComponentLayout::B, 8, 0, 0, 0}, {Anvil::Format::R8_UNORM, Anvil::ComponentLayout::R, 8, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::R10X6_UNORM_PACK16, {"VK_FORMAT_R10X6_UNORM_PACK16", 1, {Anvil::Format::UNKNOWN, Anvil::ComponentLayout::RX, 10, 0, 0, 0, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::R10X6G10X6_UNORM_2PACK16, {"VK_FORMAT_R10X6G10X6_UNORM_2PACK16", 1, {Anvil::Format::UNKNOWN, Anvil::ComponentLayout::RXGX, 10, 10, 0, 0, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::R10X6G10X6B10X6A10X6_UNORM_4PACK16, {"VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16", 1, {Anvil::Format::UNKNOWN, Anvil::ComponentLayout::RXGXBXAX, 10, 10, 10, 10, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::G10X6B10X6G10X6R10X6_422_UNORM_4PACK16, {"VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16", 1, {Anvil::Format::UNKNOWN, Anvil::ComponentLayout::GXBXGXRX, 10, 10, 10, 10, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::B10X6G10X6R10X6G10X6_422_UNORM_4PACK16, {"VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16", 1, {Anvil::Format::UNKNOWN, Anvil::ComponentLayout::BXGXRXGX, 10, 10, 10, 10, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16", 3, {Anvil::Format::R10X6_UNORM_PACK16, Anvil::ComponentLayout::GX, 10, 0, 0, 0, 16}, {Anvil::Format::R10X6_UNORM_PACK16, Anvil::ComponentLayout::BX, 10, 0, 0, 0, 16}, {Anvil::Format::R10X6_UNORM_PACK16, Anvil::ComponentLayout::RX, 10, 0, 0, 0, 16}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16", 2, {Anvil::Format::R10X6_UNORM_PACK16, Anvil::ComponentLayout::GX, 10, 0, 0, 0, 16}, {Anvil::Format::R10X6G10X6_UNORM_2PACK16, Anvil::ComponentLayout::BXRX, 10, 10, 0, 0, 16}, {}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16", 3, {Anvil::Format::R10X6_UNORM_PACK16, Anvil::ComponentLayout::GX, 10, 0, 0, 0, 16}, {Anvil::Format::R10X6_UNORM_PACK16, Anvil::ComponentLayout::BX, 10, 0, 0, 0, 16}, {Anvil::Format::R10X6_UNORM_PACK16, Anvil::ComponentLayout::RX, 10, 0, 0, 0, 16}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16", 2, {Anvil::Format::R10X6_UNORM_PACK16, Anvil::ComponentLayout::GX, 10, 0, 0, 0, 16}, {Anvil::Format::R10X6G10X6_UNORM_2PACK16, Anvil::ComponentLayout::BXRX, 10, 10, 0, 0, 16}, {}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16, {"VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16", 3, {Anvil::Format::R10X6_UNORM_PACK16, Anvil::ComponentLayout::GX, 10, 0, 0, 0, 16}, {Anvil::Format::R10X6_UNORM_PACK16, Anvil::ComponentLayout::BX, 10, 0, 0, 0, 16}, {Anvil::Format::R10X6_UNORM_PACK16, Anvil::ComponentLayout::RX, 10, 0, 0, 0, 16}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::R12X4_UNORM_PACK16, {"VK_FORMAT_R12X4_UNORM_PACK16", 1, {Anvil::Format::UNKNOWN, Anvil::ComponentLayout::RX, 12, 0, 0, 0, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::R12X4G12X4_UNORM_2PACK16, {"VK_FORMAT_R12X4G12X4_UNORM_2PACK16", 1, {Anvil::Format::UNKNOWN, Anvil::ComponentLayout::RXGX, 12, 12, 0, 0, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::R12X4G12X4B12X4A12X4_UNORM_4PACK16, {"VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16", 1, {Anvil::Format::UNKNOWN, Anvil::ComponentLayout::RXGXBXAX, 12, 12, 12, 12, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::G12X4B12X4G12X4R12X4_422_UNORM_4PACK16, {"VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16", 1, {Anvil::Format::UNKNOWN, Anvil::ComponentLayout::GXBXGXRX, 12, 12, 12, 12, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::B12X4G12X4R12X4G12X4_422_UNORM_4PACK16, {"VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16", 1, {Anvil::Format::UNKNOWN, Anvil::ComponentLayout::BXGXRXGX, 12, 12, 12, 12, 16}, {}, {}, Anvil::FormatType::UNORM, false, true } }, + {Anvil::Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16", 3, {Anvil::Format::R12X4_UNORM_PACK16, Anvil::ComponentLayout::GX, 12, 0, 0, 0, 16}, {Anvil::Format::R12X4_UNORM_PACK16, Anvil::ComponentLayout::BX, 12, 0, 0, 0, 16}, {Anvil::Format::R12X4_UNORM_PACK16, Anvil::ComponentLayout::RX, 12, 0, 0, 0, 16}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16", 2, {Anvil::Format::R12X4_UNORM_PACK16, Anvil::ComponentLayout::GX, 12, 0, 0, 0, 16}, {Anvil::Format::R12X4G12X4_UNORM_2PACK16, Anvil::ComponentLayout::BXRX, 12, 12, 0, 0, 16}, {}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16", 3, {Anvil::Format::R12X4_UNORM_PACK16, Anvil::ComponentLayout::GX, 12, 0, 0, 0, 16}, {Anvil::Format::R12X4_UNORM_PACK16, Anvil::ComponentLayout::BX, 12, 0, 0, 0, 16}, {Anvil::Format::R12X4_UNORM_PACK16, Anvil::ComponentLayout::RX, 12, 0, 0, 0, 16}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16", 2, {Anvil::Format::R12X4_UNORM_PACK16, Anvil::ComponentLayout::GX, 12, 0, 0, 0, 16}, {Anvil::Format::R12X4G12X4_UNORM_2PACK16, Anvil::ComponentLayout::BXRX, 12, 12, 0, 0, 16}, {}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16, {"VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16", 3, {Anvil::Format::R12X4_UNORM_PACK16, Anvil::ComponentLayout::GX, 12, 0, 0, 0, 16}, {Anvil::Format::R12X4_UNORM_PACK16, Anvil::ComponentLayout::BX, 12, 0, 0, 0, 16}, {Anvil::Format::R12X4_UNORM_PACK16, Anvil::ComponentLayout::RX, 12, 0, 0, 0, 16}, Anvil::FormatType::UNORM, true, true } }, + {Anvil::Format::G16B16G16R16_422_UNORM, {"VK_FORMAT_G16B16G16R16_422_UNORM", 1, {Anvil::Format::UNKNOWN, Anvil::ComponentLayout::GBGR, 16, 16, 16, 16}, {}, {}, Anvil::FormatType::UNORM, false, false} }, + {Anvil::Format::B16G16R16G16_422_UNORM, {"VK_FORMAT_B16G16R16G16_422_UNORM", 1, {Anvil::Format::UNKNOWN, Anvil::ComponentLayout::BGRG, 16, 16, 16, 16}, {}, {}, Anvil::FormatType::UNORM, false, false} }, + {Anvil::Format::G16_B16_R16_3PLANE_420_UNORM, {"VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM", 3, {Anvil::Format::R16_UNORM, Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::Format::R16_UNORM, Anvil::ComponentLayout::B, 16, 0, 0, 0}, {Anvil::Format::R16_UNORM, Anvil::ComponentLayout::R, 16, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G16_B16R16_2PLANE_420_UNORM, {"VK_FORMAT_G16_B16R16_2PLANE_420_UNORM", 2, {Anvil::Format::R16_UNORM, Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::Format::R16G16_UNORM, Anvil::ComponentLayout::BR, 16, 16, 0, 0}, {}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G16_B16_R16_3PLANE_422_UNORM, {"VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM", 3, {Anvil::Format::R16_UNORM, Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::Format::R16_UNORM, Anvil::ComponentLayout::B, 16, 0, 0, 0}, {Anvil::Format::R16_UNORM, Anvil::ComponentLayout::R, 16, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G16_B16R16_2PLANE_422_UNORM, {"VK_FORMAT_G16_B16R16_2PLANE_422_UNORM", 2, {Anvil::Format::R16_UNORM, Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::Format::R16G16_UNORM, Anvil::ComponentLayout::BR, 16, 16, 0, 0}, {}, Anvil::FormatType::UNORM, true, false} }, + {Anvil::Format::G16_B16_R16_3PLANE_444_UNORM, {"VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM", 3, {Anvil::Format::R16_UNORM, Anvil::ComponentLayout::G, 16, 0, 0, 0}, {Anvil::Format::R16_UNORM, Anvil::ComponentLayout::B, 16, 0, 0, 0}, {Anvil::Format::R16_UNORM, Anvil::ComponentLayout::R, 16, 0, 0, 0}, Anvil::FormatType::UNORM, true, false} }, }; -static const struct +typedef struct +{ + uint32_t red_component_start_bit_index; + uint32_t red_component_last_bit_index; + uint32_t green_component_start_bit_index; + uint32_t green_component_last_bit_index; + uint32_t blue_component_start_bit_index; + uint32_t blue_component_last_bit_index; + uint32_t alpha_component_start_bit_index; + uint32_t alpha_component_last_bit_index; + uint32_t shared_component_start_bit_index; + uint32_t shared_component_last_bit_index; + uint32_t depth_component_start_bit_index; + uint32_t depth_component_last_bit_index; + uint32_t stencil_component_start_bit_index; + uint32_t stencil_component_last_bit_index; +} NonYUVFormatBitLayoutInfo; + +typedef struct { - Anvil::Format format; - uint32_t red_component_start_bit_index; - uint32_t red_component_last_bit_index; - uint32_t green_component_start_bit_index; - uint32_t green_component_last_bit_index; - uint32_t blue_component_start_bit_index; - uint32_t blue_component_last_bit_index; - uint32_t alpha_component_start_bit_index; - uint32_t alpha_component_last_bit_index; - uint32_t shared_component_start_bit_index; - uint32_t shared_component_last_bit_index; - uint32_t depth_component_start_bit_index; - uint32_t depth_component_last_bit_index; - uint32_t stencil_component_start_bit_index; - uint32_t stencil_component_last_bit_index; -} g_format_bit_layout_info[] = + uint32_t plane0_r0_start_bit_index; + uint32_t plane0_r0_last_bit_index; + uint32_t plane0_g0_start_bit_index; + uint32_t plane0_g0_last_bit_index; + uint32_t plane0_b0_start_bit_index; + uint32_t plane0_b0_last_bit_index; + uint32_t plane0_a0_start_bit_index; + uint32_t plane0_a0_last_bit_index; + + uint32_t plane0_g1_start_bit_index; + uint32_t plane0_g1_last_bit_index; + + uint32_t plane1_r0_start_bit_index; + uint32_t plane1_r0_last_bit_index; + uint32_t plane1_g0_start_bit_index; + uint32_t plane1_g0_last_bit_index; + uint32_t plane1_b0_start_bit_index; + uint32_t plane1_b0_last_bit_index; + + uint32_t plane2_r0_start_bit_index; + uint32_t plane2_r0_last_bit_index; + uint32_t plane2_g0_start_bit_index; + uint32_t plane2_g0_last_bit_index; + uint32_t plane2_b0_start_bit_index; + uint32_t plane2_b0_last_bit_index; +} YUVFormatBitLayoutInfo; + +static const std::unordered_map g_yuv_format_bit_layout_info = +{ + /* Single-planar non-packed YUV formats ==> */ + + /* format | p0r0 start | p0r0 end | p0g0 start | p0g0 end | p0b0 start | p0b0 end | p0a0 start | p0a0 end | p0g1 start | p0g1 end | p1r0 start | p1r0 end | p1g0 start | p1g0 end | p1b0 start | p1b0 end | p2r0 start | p2r0 end | p2g0 start | p2g0 end | p2b0 start | p2b0 end */ + {Anvil::Format::G8B8G8R8_422_UNORM, {24, 31, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, 16, 23, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B8G8R8G8_422_UNORM, {16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::G16B16G16R16_422_UNORM, {48, 63, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B16G16R16G16_422_UNORM, {32, 47, 16, 31, 0, 15, UINT32_MAX, UINT32_MAX, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + + /* Single-planar packed YUV formats ==> */ + {Anvil::Format::R10X6_UNORM_PACK16, {6, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R10X6G10X6_UNORM_2PACK16, {22, 31, 6, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R10X6G10X6B10X6A10X6_UNORM_4PACK16, {54, 63, 38, 47, 22, 31, 6, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::G10X6B10X6G10X6R10X6_422_UNORM_4PACK16, {48, 57, 0, 9, 16, 25, UINT32_MAX, UINT32_MAX, 32, 41, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B10X6G10X6R10X6G10X6_422_UNORM_4PACK16, {32, 41, 16, 25, 0, 9, UINT32_MAX, UINT32_MAX, 48, 57, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R12X4_UNORM_PACK16, {4, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R12X4G12X4_UNORM_2PACK16, {20, 31, 4, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R12X4G12X4B12X4A12X4_UNORM_4PACK16, {52, 63, 36, 47, 20, 31, 4, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::G12X4B12X4G12X4R12X4_422_UNORM_4PACK16, {48, 59, 0, 11, 16, 27, UINT32_MAX, UINT32_MAX, 32, 43, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B12X4G12X4R12X4G12X4_422_UNORM_4PACK16, {32, 43, 16, 27, 0, 11, UINT32_MAX, UINT32_MAX, 48, 59, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + + /* Multi-planar non-packed YUV formats ==> */ + + {Anvil::Format::G8_B8_R8_3PLANE_420_UNORM, {UINT32_MAX, UINT32_MAX, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 7, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::G8_B8R8_2PLANE_420_UNORM, {UINT32_MAX, UINT32_MAX, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 8, 15, UINT32_MAX, UINT32_MAX, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::G8_B8_R8_3PLANE_422_UNORM, {UINT32_MAX, UINT32_MAX, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 7, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::G8_B8R8_2PLANE_422_UNORM, {UINT32_MAX, UINT32_MAX, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 8, 15, UINT32_MAX, UINT32_MAX, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::G8_B8_R8_3PLANE_444_UNORM, {UINT32_MAX, UINT32_MAX, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 7, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::G16_B16_R16_3PLANE_420_UNORM, {UINT32_MAX, UINT32_MAX, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 15, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::G16_B16R16_2PLANE_420_UNORM, {UINT32_MAX, UINT32_MAX, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 16, 31, UINT32_MAX, UINT32_MAX, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::G16_B16_R16_3PLANE_422_UNORM, {UINT32_MAX, UINT32_MAX, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 15, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::G16_B16R16_2PLANE_422_UNORM, {UINT32_MAX, UINT32_MAX, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 16, 31, UINT32_MAX, UINT32_MAX, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::G16_B16_R16_3PLANE_444_UNORM, {UINT32_MAX, UINT32_MAX, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 15, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + + /* Multi-planar packed YUV formats ==> */ + + {Anvil::Format::G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16, {UINT32_MAX, UINT32_MAX, 6, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 6, 15, 6, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16, {UINT32_MAX, UINT32_MAX, 6, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 6, 15, UINT32_MAX, UINT32_MAX, 22, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16, {UINT32_MAX, UINT32_MAX, 6, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 6, 15, 6, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16, {UINT32_MAX, UINT32_MAX, 6, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 6, 15, UINT32_MAX, UINT32_MAX, 22, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16, {UINT32_MAX, UINT32_MAX, 6, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 6, 15, 6, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16, {UINT32_MAX, UINT32_MAX, 4, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 4, 15, 4, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16, {UINT32_MAX, UINT32_MAX, 4, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 4, 15, UINT32_MAX, UINT32_MAX, 20, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16, {UINT32_MAX, UINT32_MAX, 4, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 4, 15, 4, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16, {UINT32_MAX, UINT32_MAX, 4, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 4, 15, UINT32_MAX, UINT32_MAX, 20, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16, {UINT32_MAX, UINT32_MAX, 4, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 4, 15, 4, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, +}; + +static const std::unordered_map g_nonyuv_format_bit_layout_info = { /* format | red start | red end | green start | green end | blue start | blue end | alpha start | alpha end | shared_start | shared_end | depth start | depth end | stencil start | stencil end */ - {Anvil::Format::UNKNOWN, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R4G4_UNORM_PACK8, 4, 7, 0, 3, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R4G4B4A4_UNORM_PACK16, 12, 15, 8, 11, 4, 7, 0, 3, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::B4G4R4A4_UNORM_PACK16, 4, 7, 8, 11, 12, 15, 0, 3, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R5G6B5_UNORM_PACK16, 11, 15, 5, 10, 0, 4, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::B5G6R5_UNORM_PACK16, 0, 4, 5, 10, 11, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R5G5B5A1_UNORM_PACK16, 11, 15, 6, 10, 1, 5, 0, 0, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::B5G5R5A1_UNORM_PACK16, 1, 5, 6, 10, 11, 15, 0, 0, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::A1R5G5B5_UNORM_PACK16, 10, 14, 5, 9, 0, 4, 15, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8_UNORM, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8_SNORM, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8_USCALED, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8_SSCALED, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8_UINT, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8_SINT, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8_SRGB, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8G8_UNORM, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8G8_SNORM, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8G8_USCALED, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8G8_SSCALED, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8G8_UINT, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8G8_SINT, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8G8_SRGB, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8G8B8_UNORM, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8G8B8_SNORM, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8G8B8_USCALED, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8G8B8_SSCALED, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8G8B8_UINT, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8G8B8_SINT, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8G8B8_SRGB, 0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::B8G8R8_UNORM, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::B8G8R8_SNORM, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::B8G8R8_USCALED, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::B8G8R8_SSCALED, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::B8G8R8_UINT, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::B8G8R8_SINT, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::B8G8R8_SRGB, 16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8G8B8A8_UNORM, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8G8B8A8_SNORM, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8G8B8A8_USCALED, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8G8B8A8_SSCALED, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8G8B8A8_UINT, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8G8B8A8_SINT, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R8G8B8A8_SRGB, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::B8G8R8A8_UNORM, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::B8G8R8A8_SNORM, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::B8G8R8A8_USCALED, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::B8G8R8A8_SSCALED, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::B8G8R8A8_UINT, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::B8G8R8A8_SINT, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::B8G8R8A8_SRGB, 16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::A8B8G8R8_UNORM_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::A8B8G8R8_SNORM_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::A8B8G8R8_USCALED_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::A8B8G8R8_SSCALED_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::A8B8G8R8_UINT_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::A8B8G8R8_SINT_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::A8B8G8R8_SRGB_PACK32, 0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::A2R10G10B10_UNORM_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::A2R10G10B10_SNORM_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::A2R10G10B10_USCALED_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::A2R10G10B10_SSCALED_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::A2R10G10B10_UINT_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::A2R10G10B10_SINT_PACK32, 20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::A2B10G10R10_UNORM_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::A2B10G10R10_SNORM_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::A2B10G10R10_USCALED_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::A2B10G10R10_SSCALED_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::A2B10G10R10_UINT_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::A2B10G10R10_SINT_PACK32, 0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16_UNORM, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16_SNORM, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16_USCALED, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16_SSCALED, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16_UINT, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16_SINT, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16_SFLOAT, 0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16G16_UNORM, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16G16_SNORM, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16G16_USCALED, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16G16_SSCALED, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16G16_UINT, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16G16_SINT, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16G16_SFLOAT, 0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16G16B16_UNORM, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16G16B16_SNORM, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16G16B16_USCALED, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16G16B16_SSCALED, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16G16B16_UINT, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16G16B16_SINT, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16G16B16_SFLOAT, 0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16G16B16A16_UNORM, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16G16B16A16_SNORM, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16G16B16A16_USCALED, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16G16B16A16_SSCALED, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16G16B16A16_UINT, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16G16B16A16_SINT, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R16G16B16A16_SFLOAT, 0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R32_UINT, 0, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R32_SINT, 0, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R32_SFLOAT, 0, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R32G32_UINT, 0, 31, 32, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R32G32_SINT, 0, 31, 32, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R32G32_SFLOAT, 0, 31, 32, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R32G32B32_UINT, 0, 31, 32, 63, 64, 95, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R32G32B32_SINT, 0, 31, 32, 63, 64, 95, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R32G32B32_SFLOAT, 0, 31, 32, 63, 64, 95, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R32G32B32A32_UINT, 0, 31, 32, 63, 64, 95, 96, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R32G32B32A32_SINT, 0, 31, 32, 63, 64, 95, 96, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R32G32B32A32_SFLOAT, 0, 31, 32, 63, 64, 95, 96, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R64_UINT, 0, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R64_SINT, 0, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R64_SFLOAT, 0, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R64G64_UINT, 0, 63, 64, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R64G64_SINT, 0, 63, 64, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R64G64_SFLOAT, 0, 63, 64, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R64G64B64_UINT, 0, 63, 64, 127, 128, 191, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R64G64B64_SINT, 0, 63, 64, 127, 128, 191, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R64G64B64_SFLOAT, 0, 63, 64, 127, 128, 191, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R64G64B64A64_UINT, 0, 63, 64, 127, 128, 191, 192, 255, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R64G64B64A64_SINT, 0, 63, 64, 127, 128, 191, 192, 255, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::R64G64B64A64_SFLOAT, 0, 63, 64, 127, 128, 191, 192, 255, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::B10G11R11_UFLOAT_PACK32, 0, 10, 11, 21, 22, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::E5B9G9R9_UFLOAT_PACK32, 0, 8, 9, 17, 18, 26, UINT32_MAX, UINT32_MAX, 27, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::D16_UNORM, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 15, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::X8_D24_UNORM_PACK32, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 23, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::D32_SFLOAT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 31, UINT32_MAX, UINT32_MAX}, - {Anvil::Format::S8_UINT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 7}, - {Anvil::Format::D16_UNORM_S8_UINT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 15, 16, 23}, - {Anvil::Format::D24_UNORM_S8_UINT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 23, 24, 31}, - {Anvil::Format::D32_SFLOAT_S8_UINT, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 31, 32, 39}, + {Anvil::Format::UNKNOWN, {UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R4G4_UNORM_PACK8, {4, 7, 0, 3, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R4G4B4A4_UNORM_PACK16, {12, 15, 8, 11, 4, 7, 0, 3, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B4G4R4A4_UNORM_PACK16, {4, 7, 8, 11, 12, 15, 0, 3, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R5G6B5_UNORM_PACK16, {11, 15, 5, 10, 0, 4, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B5G6R5_UNORM_PACK16, {0, 4, 5, 10, 11, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R5G5B5A1_UNORM_PACK16, {11, 15, 6, 10, 1, 5, 0, 0, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B5G5R5A1_UNORM_PACK16, {1, 5, 6, 10, 11, 15, 0, 0, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::A1R5G5B5_UNORM_PACK16, {10, 14, 5, 9, 0, 4, 15, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8_UNORM, {0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8_SNORM, {0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8_USCALED, {0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8_SSCALED, {0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8_UINT, {0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8_SINT, {0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8_SRGB, {0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8G8_UNORM, {0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8G8_SNORM, {0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8G8_USCALED, {0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8G8_SSCALED, {0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8G8_UINT, {0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8G8_SINT, {0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8G8_SRGB, {0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8G8B8_UNORM, {0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8G8B8_SNORM, {0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8G8B8_USCALED, {0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8G8B8_SSCALED, {0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8G8B8_UINT, {0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8G8B8_SINT, {0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8G8B8_SRGB, {0, 7, 8, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B8G8R8_UNORM, {16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B8G8R8_SNORM, {16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B8G8R8_USCALED, {16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B8G8R8_SSCALED, {16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B8G8R8_UINT, {16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B8G8R8_SINT, {16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B8G8R8_SRGB, {16, 23, 8, 15, 0, 7, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8G8B8A8_UNORM, {0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8G8B8A8_SNORM, {0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8G8B8A8_USCALED, {0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8G8B8A8_SSCALED, {0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8G8B8A8_UINT, {0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8G8B8A8_SINT, {0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R8G8B8A8_SRGB, {0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B8G8R8A8_UNORM, {16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B8G8R8A8_SNORM, {16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B8G8R8A8_USCALED, {16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B8G8R8A8_SSCALED, {16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B8G8R8A8_UINT, {16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B8G8R8A8_SINT, {16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B8G8R8A8_SRGB, {16, 23, 8, 15, 0, 7, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::A8B8G8R8_UNORM_PACK32, {0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::A8B8G8R8_SNORM_PACK32, {0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::A8B8G8R8_USCALED_PACK32, {0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::A8B8G8R8_SSCALED_PACK32, {0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::A8B8G8R8_UINT_PACK32, {0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::A8B8G8R8_SINT_PACK32, {0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::A8B8G8R8_SRGB_PACK32, {0, 7, 8, 15, 16, 23, 24, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::A2R10G10B10_UNORM_PACK32, {20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::A2R10G10B10_SNORM_PACK32, {20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::A2R10G10B10_USCALED_PACK32, {20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::A2R10G10B10_SSCALED_PACK32, {20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::A2R10G10B10_UINT_PACK32, {20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::A2R10G10B10_SINT_PACK32, {20, 29, 10, 19, 0, 9, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::A2B10G10R10_UNORM_PACK32, {0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::A2B10G10R10_SNORM_PACK32, {0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::A2B10G10R10_USCALED_PACK32, {0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::A2B10G10R10_SSCALED_PACK32, {0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::A2B10G10R10_UINT_PACK32, {0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::A2B10G10R10_SINT_PACK32, {0, 9, 10, 19, 20, 29, 30, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16_UNORM, {0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16_SNORM, {0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16_USCALED, {0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16_SSCALED, {0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16_UINT, {0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16_SINT, {0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16_SFLOAT, {0, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16G16_UNORM, {0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16G16_SNORM, {0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16G16_USCALED, {0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16G16_SSCALED, {0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16G16_UINT, {0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16G16_SINT, {0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16G16_SFLOAT, {0, 15, 16, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16G16B16_UNORM, {0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16G16B16_SNORM, {0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16G16B16_USCALED, {0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16G16B16_SSCALED, {0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16G16B16_UINT, {0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16G16B16_SINT, {0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16G16B16_SFLOAT, {0, 15, 16, 31, 32, 47, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16G16B16A16_UNORM, {0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16G16B16A16_SNORM, {0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16G16B16A16_USCALED, {0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16G16B16A16_SSCALED, {0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16G16B16A16_UINT, {0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16G16B16A16_SINT, {0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R16G16B16A16_SFLOAT, {0, 15, 16, 31, 32, 47, 48, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R32_UINT, {0, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R32_SINT, {0, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R32_SFLOAT, {0, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R32G32_UINT, {0, 31, 32, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R32G32_SINT, {0, 31, 32, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R32G32_SFLOAT, {0, 31, 32, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R32G32B32_UINT, {0, 31, 32, 63, 64, 95, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R32G32B32_SINT, {0, 31, 32, 63, 64, 95, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R32G32B32_SFLOAT, {0, 31, 32, 63, 64, 95, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R32G32B32A32_UINT, {0, 31, 32, 63, 64, 95, 96, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R32G32B32A32_SINT, {0, 31, 32, 63, 64, 95, 96, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R32G32B32A32_SFLOAT, {0, 31, 32, 63, 64, 95, 96, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R64_UINT, {0, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R64_SINT, {0, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R64_SFLOAT, {0, 63, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R64G64_UINT, {0, 63, 64, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R64G64_SINT, {0, 63, 64, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R64G64_SFLOAT, {0, 63, 64, 127, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R64G64B64_UINT, {0, 63, 64, 127, 128, 191, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R64G64B64_SINT, {0, 63, 64, 127, 128, 191, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R64G64B64_SFLOAT, {0, 63, 64, 127, 128, 191, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R64G64B64A64_UINT, {0, 63, 64, 127, 128, 191, 192, 255, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R64G64B64A64_SINT, {0, 63, 64, 127, 128, 191, 192, 255, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::R64G64B64A64_SFLOAT, {0, 63, 64, 127, 128, 191, 192, 255, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::B10G11R11_UFLOAT_PACK32, {0, 10, 11, 21, 22, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::E5B9G9R9_UFLOAT_PACK32, {0, 8, 9, 17, 18, 26, UINT32_MAX, UINT32_MAX, 27, 31, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::D16_UNORM, {UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 15, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::X8_D24_UNORM_PACK32, {UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 23, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::D32_SFLOAT, {UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 31, UINT32_MAX, UINT32_MAX} }, + {Anvil::Format::S8_UINT, {UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 7, } }, + {Anvil::Format::D16_UNORM_S8_UINT, {UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 15, 16, 23, } }, + {Anvil::Format::D24_UNORM_S8_UINT, {UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 23, 24, 31, } }, + {Anvil::Format::D32_SFLOAT_S8_UINT, {UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 0, 31, 32, 39, } }, }; + static const uint32_t g_layout_to_n_components[] = { /* COMPONENT_LAYOUT_ABGR */ @@ -624,6 +711,69 @@ static const std::vector g_compatibility_classes[] = Anvil::Format::R8_SRGB }, + { + Anvil::Format::G8_B8_R8_3PLANE_420_UNORM + }, + + { + Anvil::Format::G8_B8R8_2PLANE_420_UNORM + }, + + { + Anvil::Format::G8_B8_R8_3PLANE_422_UNORM + }, + + { + Anvil::Format::G8_B8R8_2PLANE_422_UNORM + }, + + { + Anvil::Format::G8_B8_R8_3PLANE_444_UNORM + }, + + /* 10-bit */ + { + Anvil::Format::G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16 + }, + + { + Anvil::Format::G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 + }, + + { + Anvil::Format::G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16 + }, + + { + Anvil::Format::G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16 + }, + + { + Anvil::Format::G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16 + }, + + /* 12-bit */ + + { + Anvil::Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16 + }, + + { + Anvil::Format::G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16 + }, + + { + Anvil::Format::G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16 + }, + + { + Anvil::Format::G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16 + }, + + { + Anvil::Format::G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16 + }, + /* 16-bit */ { Anvil::Format::R4G4B4A4_UNORM_PACK16, @@ -646,7 +796,31 @@ static const std::vector g_compatibility_classes[] = Anvil::Format::R16_SSCALED, Anvil::Format::R16_UINT, Anvil::Format::R16_SINT, - Anvil::Format::R16_SFLOAT + Anvil::Format::R16_SFLOAT, + + /* YUV */ + Anvil::Format::R10X6_UNORM_PACK16, + Anvil::Format::R12X4_UNORM_PACK16 + }, + + { + Anvil::Format::G16_B16_R16_3PLANE_420_UNORM, + }, + + { + Anvil::Format::G16_B16R16_2PLANE_420_UNORM, + }, + + { + Anvil::Format::G16_B16_R16_3PLANE_422_UNORM, + }, + + { + Anvil::Format::G16_B16R16_2PLANE_422_UNORM, + }, + + { + Anvil::Format::G16_B16_R16_3PLANE_444_UNORM, }, /* 24-bit */ @@ -714,6 +888,18 @@ static const std::vector g_compatibility_classes[] = Anvil::Format::R32_SFLOAT, Anvil::Format::B10G11R11_UFLOAT_PACK32, Anvil::Format::E5B9G9R9_UFLOAT_PACK32, + + /* YUV */ + Anvil::Format::R10X6G10X6_UNORM_2PACK16, + Anvil::Format::R12X4G12X4_UNORM_2PACK16, + }, + + { + Anvil::Format::G8B8G8R8_422_UNORM, + }, + + { + Anvil::Format::B8G8R8G8_422_UNORM }, /* 48-bit */ @@ -741,7 +927,39 @@ static const std::vector g_compatibility_classes[] = Anvil::Format::R32G32_SFLOAT, Anvil::Format::R64_UINT, Anvil::Format::R64_SINT, - Anvil::Format::R64_SFLOAT + Anvil::Format::R64_SFLOAT, + }, + + { + Anvil::Format::R10X6G10X6B10X6A10X6_UNORM_4PACK16, + }, + + { + Anvil::Format::G10X6B10X6G10X6R10X6_422_UNORM_4PACK16, + }, + + { + Anvil::Format::B10X6G10X6R10X6G10X6_422_UNORM_4PACK16, + }, + + { + Anvil::Format::R12X4G12X4B12X4A12X4_UNORM_4PACK16, + }, + + { + Anvil::Format::G12X4B12X4G12X4R12X4_422_UNORM_4PACK16, + }, + + { + Anvil::Format::B12X4G12X4R12X4G12X4_422_UNORM_4PACK16, + }, + + { + Anvil::Format::G16B16G16R16_422_UNORM, + }, + + { + Anvil::Format::B16G16R16G16_422_UNORM }, /* 96-bit */ @@ -1265,79 +1483,27 @@ bool Anvil::Formats::get_format_aspects(Anvil::Format in } else { - struct - { - bool uses_plane_0_aspect; - bool uses_plane_1_aspect; - bool uses_plane_2_aspect; - } aspects_used; - - aspects_used.uses_plane_0_aspect = false; - aspects_used.uses_plane_1_aspect = false; - aspects_used.uses_plane_2_aspect = false; - - switch (in_format) - { - case Anvil::Format::G8_B8R8_2PLANE_420_UNORM: - case Anvil::Format::G8_B8R8_2PLANE_422_UNORM: - case Anvil::Format::G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16: - case Anvil::Format::G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16: - case Anvil::Format::G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16: - case Anvil::Format::G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16: - case Anvil::Format::G16_B16R16_2PLANE_420_UNORM: - case Anvil::Format::G16_B16R16_2PLANE_422_UNORM: - { - aspects_used = { true, true, false }; - - break; - } - - case Anvil::Format::G8_B8_R8_3PLANE_420_UNORM: - case Anvil::Format::G8_B8_R8_3PLANE_422_UNORM: - case Anvil::Format::G8_B8_R8_3PLANE_444_UNORM: - case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16: - case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16: - case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16: - case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16: - case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16: - case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16: - case Anvil::Format::G16_B16_R16_3PLANE_420_UNORM: - case Anvil::Format::G16_B16_R16_3PLANE_422_UNORM: - case Anvil::Format::G16_B16_R16_3PLANE_444_UNORM: - { - aspects_used = { true, true, true }; - - break; - } - - default: - { - anvil_assert_fail(); + const auto n_planes = get_format_n_planes(in_format); - goto end; - } - } - - if (aspects_used.uses_plane_0_aspect) - { - out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::PLANE_0_BIT); - } + out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::PLANE_0_BIT); - if (aspects_used.uses_plane_1_aspect) + if (n_planes >= 2) { out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::PLANE_1_BIT); } - if (aspects_used.uses_plane_2_aspect) + if (n_planes >= 3) { out_aspects_ptr->push_back(Anvil::ImageAspectFlagBits::PLANE_2_BIT); } + + anvil_assert(n_planes >= 1 && n_planes <= 3); } } else { /* This image can hold color and/or depth and/or stencil aspects only */ - const Anvil::ComponentLayout format_layout = Anvil::Formats::get_format_component_layout(in_format); + const Anvil::ComponentLayout format_layout = Anvil::Formats::get_format_component_layout_nonyuv(in_format); if (format_layout == Anvil::ComponentLayout::ABGR || format_layout == Anvil::ComponentLayout::ARGB || @@ -1367,33 +1533,29 @@ bool Anvil::Formats::get_format_aspects(Anvil::Format in } result = true; -end: return result; } /** Please see header for specification */ -void Anvil::Formats::get_format_bit_layout(Anvil::Format in_format, - uint32_t* out_opt_red_component_start_bit_index_ptr, - uint32_t* out_opt_red_component_end_bit_index_ptr, - uint32_t* out_opt_green_component_start_bit_index_ptr, - uint32_t* out_opt_green_component_end_bit_index_ptr, - uint32_t* out_opt_blue_component_start_bit_index_ptr, - uint32_t* out_opt_blue_component_end_bit_index_ptr, - uint32_t* out_opt_alpha_component_start_bit_index_ptr, - uint32_t* out_opt_alpha_component_end_bit_index_ptr, - uint32_t* out_opt_shared_component_start_bit_index_ptr, - uint32_t* out_opt_shared_component_end_bit_index_ptr, - uint32_t* out_opt_depth_component_start_bit_index_ptr, - uint32_t* out_opt_depth_component_end_bit_index_ptr, - uint32_t* out_opt_stencil_component_start_bit_index_ptr, - uint32_t* out_opt_stencil_component_end_bit_index_ptr) +void Anvil::Formats::get_format_bit_layout_nonyuv(Anvil::Format in_format, + uint32_t* out_opt_red_component_start_bit_index_ptr, + uint32_t* out_opt_red_component_end_bit_index_ptr, + uint32_t* out_opt_green_component_start_bit_index_ptr, + uint32_t* out_opt_green_component_end_bit_index_ptr, + uint32_t* out_opt_blue_component_start_bit_index_ptr, + uint32_t* out_opt_blue_component_end_bit_index_ptr, + uint32_t* out_opt_alpha_component_start_bit_index_ptr, + uint32_t* out_opt_alpha_component_end_bit_index_ptr, + uint32_t* out_opt_shared_component_start_bit_index_ptr, + uint32_t* out_opt_shared_component_end_bit_index_ptr, + uint32_t* out_opt_depth_component_start_bit_index_ptr, + uint32_t* out_opt_depth_component_end_bit_index_ptr, + uint32_t* out_opt_stencil_component_start_bit_index_ptr, + uint32_t* out_opt_stencil_component_end_bit_index_ptr) { - anvil_assert(!Anvil::Formats::is_format_yuv_khr(in_format) ); - - anvil_assert(sizeof(g_format_bit_layout_info) / sizeof(g_format_bit_layout_info[0]) > static_cast(in_format) ); - anvil_assert(g_format_bit_layout_info[static_cast(in_format)].format == in_format); + anvil_assert(!is_format_yuv_khr(in_format) ); - const auto& format_info = g_format_bit_layout_info[static_cast(in_format)]; + const auto& format_info = g_nonyuv_format_bit_layout_info.at(in_format); if (out_opt_red_component_start_bit_index_ptr != nullptr) { @@ -1466,8 +1628,147 @@ void Anvil::Formats::get_format_bit_layout(Anvil::Format in_format, } } +void Anvil::Formats::get_format_bit_layout_yuv(Anvil::Format in_format, + uint32_t* out_opt_plane0_r0_start_bit_index_ptr, + uint32_t* out_opt_plane0_r0_end_bit_index_ptr, + uint32_t* out_opt_plane0_g0_start_bit_index_ptr, + uint32_t* out_opt_plane0_g0_end_bit_index_ptr, + uint32_t* out_opt_plane0_b0_start_bit_index_ptr, + uint32_t* out_opt_plane0_b0_end_bit_index_ptr, + uint32_t* out_opt_plane0_a0_start_bit_index_ptr, + uint32_t* out_opt_plane0_a0_end_bit_index_ptr, + uint32_t* out_opt_plane0_g1_start_bit_index_ptr, + uint32_t* out_opt_plane0_g1_end_bit_index_ptr, + uint32_t* out_opt_plane1_r0_start_bit_index_ptr, + uint32_t* out_opt_plane1_r0_end_bit_index_ptr, + uint32_t* out_opt_plane1_g0_start_bit_index_ptr, + uint32_t* out_opt_plane1_g0_end_bit_index_ptr, + uint32_t* out_opt_plane1_b0_start_bit_index_ptr, + uint32_t* out_opt_plane1_b0_end_bit_index_ptr, + uint32_t* out_opt_plane2_r0_start_bit_index_ptr, + uint32_t* out_opt_plane2_r0_end_bit_index_ptr, + uint32_t* out_opt_plane2_g0_start_bit_index_ptr, + uint32_t* out_opt_plane2_g0_end_bit_index_ptr, + uint32_t* out_opt_plane2_b0_start_bit_index_ptr, + uint32_t* out_opt_plane2_b0_end_bit_index_ptr) +{ + anvil_assert(is_format_yuv_khr(in_format) ); + + const auto& format_info = g_yuv_format_bit_layout_info.at(in_format); + + if (out_opt_plane0_r0_start_bit_index_ptr != nullptr) + { + *out_opt_plane0_r0_start_bit_index_ptr = format_info.plane0_r0_start_bit_index; + } + + if (out_opt_plane0_r0_end_bit_index_ptr != nullptr) + { + *out_opt_plane0_r0_end_bit_index_ptr = format_info.plane0_r0_last_bit_index; + } + + if (out_opt_plane0_g0_start_bit_index_ptr != nullptr) + { + *out_opt_plane0_g0_start_bit_index_ptr = format_info.plane0_g0_start_bit_index; + } + + if (out_opt_plane0_g0_end_bit_index_ptr != nullptr) + { + *out_opt_plane0_g0_end_bit_index_ptr = format_info.plane0_g0_last_bit_index; + } + + if (out_opt_plane0_b0_start_bit_index_ptr != nullptr) + { + *out_opt_plane0_b0_start_bit_index_ptr = format_info.plane0_b0_start_bit_index; + } + + if (out_opt_plane0_b0_end_bit_index_ptr != nullptr) + { + *out_opt_plane0_b0_end_bit_index_ptr = format_info.plane0_b0_last_bit_index; + } + + if (out_opt_plane0_a0_start_bit_index_ptr != nullptr) + { + *out_opt_plane0_a0_start_bit_index_ptr = format_info.plane0_a0_start_bit_index; + } + + if (out_opt_plane0_a0_end_bit_index_ptr != nullptr) + { + *out_opt_plane0_a0_end_bit_index_ptr = format_info.plane0_a0_last_bit_index; + } + + if (out_opt_plane0_g1_start_bit_index_ptr != nullptr) + { + *out_opt_plane0_g1_start_bit_index_ptr = format_info.plane0_g0_start_bit_index; + } + + if (out_opt_plane0_g1_end_bit_index_ptr != nullptr) + { + *out_opt_plane0_g1_end_bit_index_ptr = format_info.plane0_g1_last_bit_index; + } + + if (out_opt_plane1_r0_start_bit_index_ptr != nullptr) + { + *out_opt_plane1_r0_start_bit_index_ptr = format_info.plane1_r0_start_bit_index; + } + + if (out_opt_plane1_r0_end_bit_index_ptr != nullptr) + { + *out_opt_plane1_r0_end_bit_index_ptr = format_info.plane1_r0_last_bit_index; + } + + if (out_opt_plane1_g0_start_bit_index_ptr != nullptr) + { + *out_opt_plane1_g0_start_bit_index_ptr = format_info.plane1_g0_start_bit_index; + } + + if (out_opt_plane1_g0_end_bit_index_ptr != nullptr) + { + *out_opt_plane1_g0_end_bit_index_ptr = format_info.plane1_g0_last_bit_index; + } + + if (out_opt_plane1_b0_start_bit_index_ptr != nullptr) + { + *out_opt_plane1_b0_start_bit_index_ptr = format_info.plane1_b0_start_bit_index; + } + + if (out_opt_plane1_b0_end_bit_index_ptr != nullptr) + { + *out_opt_plane1_b0_end_bit_index_ptr = format_info.plane1_b0_last_bit_index; + } + + if (out_opt_plane2_r0_start_bit_index_ptr != nullptr) + { + *out_opt_plane2_r0_start_bit_index_ptr = format_info.plane2_r0_start_bit_index; + } + + if (out_opt_plane2_r0_end_bit_index_ptr != nullptr) + { + *out_opt_plane2_r0_end_bit_index_ptr = format_info.plane2_r0_last_bit_index; + } + + if (out_opt_plane2_g0_start_bit_index_ptr != nullptr) + { + *out_opt_plane2_g0_start_bit_index_ptr = format_info.plane2_g0_start_bit_index; + } + + if (out_opt_plane2_g0_end_bit_index_ptr != nullptr) + { + *out_opt_plane2_g0_end_bit_index_ptr = format_info.plane2_g0_last_bit_index; + } + + if (out_opt_plane2_b0_start_bit_index_ptr != nullptr) + { + *out_opt_plane2_b0_start_bit_index_ptr = format_info.plane2_b0_start_bit_index; + } + + if (out_opt_plane2_b0_end_bit_index_ptr != nullptr) + { + *out_opt_plane2_b0_end_bit_index_ptr = format_info.plane2_b0_last_bit_index; + } +} + /** Please see header for specification */ -Anvil::ComponentLayout Anvil::Formats::get_format_component_layout(Anvil::Format in_format) +Anvil::ComponentLayout Anvil::Formats::get_format_component_layout_nonyuv(Anvil::Format in_format) { static_assert(sizeof(g_formats) / sizeof(g_formats[0]) == VK_FORMAT_RANGE_SIZE, ""); anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE); @@ -1477,8 +1778,8 @@ Anvil::ComponentLayout Anvil::Formats::get_format_component_layout(Anvil::Format } /** Please see header for specification */ -Anvil::ComponentLayout Anvil::Formats::get_format_component_layout(Anvil::Format in_format, - Anvil::ImageAspectFlagBits in_aspect) +Anvil::ComponentLayout Anvil::Formats::get_format_component_layout_yuv(Anvil::Format in_format, + Anvil::ImageAspectFlagBits in_aspect) { const auto plane_idx = Anvil::Formats::get_yuv_format_plane_index(in_format, in_aspect); @@ -1493,7 +1794,7 @@ Anvil::ComponentLayout Anvil::Formats::get_format_component_layout(Anvil::Format } /** Please see header for specification */ -uint32_t Anvil::Formats::get_format_n_components(Anvil::Format in_format) +uint32_t Anvil::Formats::get_format_n_components_nonyuv(Anvil::Format in_format) { anvil_assert(static_cast(in_format) < VK_FORMAT_RANGE_SIZE); anvil_assert(!Anvil::Formats::is_format_yuv_khr(in_format) ); @@ -1502,8 +1803,8 @@ uint32_t Anvil::Formats::get_format_n_components(Anvil::Format in_format) } /** Please see header for specification */ -uint32_t Anvil::Formats::get_format_n_components(Anvil::Format in_format, - Anvil::ImageAspectFlagBits in_aspect) +uint32_t Anvil::Formats::get_format_n_components_yuv(Anvil::Format in_format, + Anvil::ImageAspectFlagBits in_aspect) { const auto plane_idx = Anvil::Formats::get_yuv_format_plane_index(in_format, in_aspect); @@ -1514,11 +1815,11 @@ uint32_t Anvil::Formats::get_format_n_components(Anvil::Format in_f } /** Please see header for specification */ -void Anvil::Formats::get_format_n_component_bits(Anvil::Format in_format, - uint32_t* out_channel0_bits_ptr, - uint32_t* out_channel1_bits_ptr, - uint32_t* out_channel2_bits_ptr, - uint32_t* out_channel3_bits_ptr) +void Anvil::Formats::get_format_n_component_bits_nonyuv(Anvil::Format in_format, + uint32_t* out_channel0_bits_ptr, + uint32_t* out_channel1_bits_ptr, + uint32_t* out_channel2_bits_ptr, + uint32_t* out_channel3_bits_ptr) { const FormatInfo* format_props_ptr = nullptr; @@ -1534,12 +1835,12 @@ void Anvil::Formats::get_format_n_component_bits(Anvil::Format in_format, } /** Please see header for specification */ -void Anvil::Formats::get_format_n_component_bits(Anvil::Format in_format, - Anvil::ImageAspectFlagBits in_aspect, - uint32_t* out_channel0_bits_ptr, - uint32_t* out_channel1_bits_ptr, - uint32_t* out_channel2_bits_ptr, - uint32_t* out_channel3_bits_ptr) +void Anvil::Formats::get_format_n_component_bits_yuv(Anvil::Format in_format, + Anvil::ImageAspectFlagBits in_aspect, + uint32_t* out_channel0_bits_ptr, + uint32_t* out_channel1_bits_ptr, + uint32_t* out_channel2_bits_ptr, + uint32_t* out_channel3_bits_ptr) { const SubresourceLayoutInfo* format_props_ptr = nullptr; const auto plane_idx = Anvil::Formats::get_yuv_format_plane_index(in_format, @@ -1556,12 +1857,60 @@ void Anvil::Formats::get_format_n_component_bits(Anvil::Format in_f } /** Please see header for specification */ -void Anvil::Formats::get_format_n_unused_component_bits(Anvil::Format in_format, - Anvil::ImageAspectFlagBits in_aspect, - uint32_t* out_channel0_unused_bits_ptr, - uint32_t* out_channel1_unused_bits_ptr, - uint32_t* out_channel2_unused_bits_ptr, - uint32_t* out_channel3_unused_bits_ptr) +uint32_t Anvil::Formats::get_format_n_planes(Anvil::Format in_format) +{ + uint32_t result = 1; + + switch (in_format) + { + case Anvil::Format::G8_B8R8_2PLANE_420_UNORM: + case Anvil::Format::G8_B8R8_2PLANE_422_UNORM: + case Anvil::Format::G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16: + case Anvil::Format::G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16: + case Anvil::Format::G16_B16R16_2PLANE_420_UNORM: + case Anvil::Format::G16_B16R16_2PLANE_422_UNORM: + { + result = 2; + + break; + } + + case Anvil::Format::G8_B8_R8_3PLANE_420_UNORM: + case Anvil::Format::G8_B8_R8_3PLANE_422_UNORM: + case Anvil::Format::G8_B8_R8_3PLANE_444_UNORM: + case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16: + case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16: + case Anvil::Format::G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16: + case Anvil::Format::G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16: + case Anvil::Format::G16_B16_R16_3PLANE_420_UNORM: + case Anvil::Format::G16_B16_R16_3PLANE_422_UNORM: + case Anvil::Format::G16_B16_R16_3PLANE_444_UNORM: + { + result = 3; + + break; + } + + default: + { + /* Fall-through */ + } + } + + return result; +} + +/** Please see header for specification */ +void Anvil::Formats::get_format_n_unused_component_bits_yuv(Anvil::Format in_format, + Anvil::ImageAspectFlagBits in_aspect, + uint32_t* out_channel0_unused_bits_ptr, + uint32_t* out_channel1_unused_bits_ptr, + uint32_t* out_channel2_unused_bits_ptr, + uint32_t* out_channel3_unused_bits_ptr) { const SubresourceLayoutInfo* format_props_ptr = nullptr; const auto plane_idx = Anvil::Formats::get_yuv_format_plane_index(in_format, @@ -1742,7 +2091,7 @@ void Anvil::Formats::get_yuv_format_plane_extent(Anvil::Format in_f uint32_t Anvil::Formats::get_yuv_format_plane_index(Anvil::Format in_format, Anvil::ImageAspectFlagBits in_aspect) { - const auto n_planes = Anvil::Formats::get_yuv_format_n_planes(in_format); + const auto n_planes = Anvil::Formats::get_format_n_planes(in_format); uint32_t plane_idx = 0; ANVIL_REDUNDANT_VARIABLE_CONST(n_planes); @@ -1906,6 +2255,8 @@ bool Anvil::Formats::is_format_packed(Anvil::Format in_format) { return g_yuv_formats.at(in_format).is_packed; } - - return g_formats[static_cast(in_format)].is_packed; + else + { + return g_formats[static_cast(in_format)].is_packed; + } } \ No newline at end of file diff --git a/src/misc/glsl_to_spirv.cpp b/src/misc/glsl_to_spirv.cpp index 9f922015..2db0c5e6 100644 --- a/src/misc/glsl_to_spirv.cpp +++ b/src/misc/glsl_to_spirv.cpp @@ -234,7 +234,7 @@ const auto xfb_props_ptr = in_device_ptr->get_physical_device_properties().ext_transform_feedback_properties_ptr; m_resources_ptr->maxTransformFeedbackBuffers = xfb_props_ptr->n_max_transform_feedback_buffers; - m_resources_ptr->maxTransformFeedbackInterleavedComponents = xfb_props_ptr->max_transform_feedback_buffer_data_size / 4; + m_resources_ptr->maxTransformFeedbackInterleavedComponents = xfb_props_ptr->max_transform_feedback_buffer_data_stride * 4; } else { @@ -251,12 +251,14 @@ Anvil::GLSLShaderToSPIRVGenerator::GLSLShaderToSPIRVGenerator(const Anvil::BaseDevice* in_device_ptr, const Mode& in_mode, std::string in_data, - ShaderStage in_shader_stage) + ShaderStage in_shader_stage, + SpvVersion in_spirv_version) :CallbacksSupportProvider(GLSL_SHADER_TO_SPIRV_GENERATOR_CALLBACK_ID_COUNT), m_data (in_data), m_glsl_source_code_dirty(true), m_mode (in_mode), - m_shader_stage (in_shader_stage) + m_shader_stage (in_shader_stage), + m_spirv_version (in_spirv_version) { #ifdef ANVIL_LINK_WITH_GLSLANG { @@ -663,12 +665,61 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() const if (new_program_ptr != nullptr && new_shader_ptr != nullptr) { - bool link_result = false; + bool link_result = false; + glslang::EShTargetLanguageVersion spirv_version; /* Try to compile the shader */ new_shader_ptr->setStrings(&in_body, 1); + switch (m_spirv_version) + { + case SpvVersion::_1_0: + { + spirv_version = glslang::EShTargetSpv_1_0; + + break; + } + + case SpvVersion::_1_1: + { + spirv_version = glslang::EShTargetSpv_1_1; + + break; + } + + case SpvVersion::_1_2: + { + spirv_version = glslang::EShTargetSpv_1_2; + + break; + } + + case SpvVersion::_1_3: + { + spirv_version = glslang::EShTargetSpv_1_3; + + break; + } + + case SpvVersion::_1_4: + { + spirv_version = glslang::EShTargetSpv_1_4; + + break; + } + + default: + { + spirv_version = glslang::EShTargetSpv_1_0; + + break; + } + } + + new_shader_ptr->setEnvTarget(glslang::EShTargetSpv, + spirv_version); + result = new_shader_ptr->parse(m_limits_ptr->get_resource_ptr(), 110, /* defaultVersion */ false, /* forwardCompatible */ @@ -921,7 +972,8 @@ bool Anvil::GLSLShaderToSPIRVGenerator::bake_spirv_blob() const Anvil::GLSLShaderToSPIRVGeneratorUniquePtr Anvil::GLSLShaderToSPIRVGenerator::create(const Anvil::BaseDevice* in_opt_device_ptr, const Mode& in_mode, std::string in_data, - ShaderStage in_shader_stage) + ShaderStage in_shader_stage, + SpvVersion in_spirv_version) { Anvil::GLSLShaderToSPIRVGeneratorUniquePtr result_ptr(nullptr, std::default_delete() ); @@ -930,7 +982,8 @@ Anvil::GLSLShaderToSPIRVGeneratorUniquePtr Anvil::GLSLShaderToSPIRVGenerator::cr new Anvil::GLSLShaderToSPIRVGenerator(in_opt_device_ptr, in_mode, in_data, - in_shader_stage) + in_shader_stage, + in_spirv_version) ); Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::ANVIL_GLSL_SHADER_TO_SPIRV_GENERATOR, diff --git a/src/misc/graphics_pipeline_create_info.cpp b/src/misc/graphics_pipeline_create_info.cpp index 47aa6a45..d8cc1e6d 100644 --- a/src/misc/graphics_pipeline_create_info.cpp +++ b/src/misc/graphics_pipeline_create_info.cpp @@ -35,6 +35,7 @@ Anvil::GraphicsPipelineCreateInfo::GraphicsPipelineCreateInfo(const RenderPass* m_depth_bias_slope_factor = 1.0f; m_depth_bounds_test_enabled = false; m_depth_clamp_enabled = false; + m_depth_clip_enabled = true; m_depth_test_compare_op = Anvil::CompareOp::ALWAYS; m_depth_test_enabled = false; m_depth_writes_enabled = false; @@ -71,6 +72,9 @@ Anvil::GraphicsPipelineCreateInfo::GraphicsPipelineCreateInfo(const RenderPass* m_rasterization_order = Anvil::RasterizationOrderAMD::STRICT; + m_conservative_rasterization_mode = Anvil::ConservativeRasterizationModeEXT::DISABLED; + m_extra_primitive_overestimation_size = 0.0f; + memset(m_blend_constant, 0, sizeof(m_blend_constant) ); @@ -170,6 +174,7 @@ bool Anvil::GraphicsPipelineCreateInfo::copy_gfx_state_from(const Anvil::Graphic /* GFX pipeline info-level data */ m_depth_bounds_test_enabled = in_src_pipeline_create_info_ptr->m_depth_bounds_test_enabled; + m_depth_clip_enabled = in_src_pipeline_create_info_ptr->m_depth_clip_enabled; m_max_depth_bounds = in_src_pipeline_create_info_ptr->m_max_depth_bounds; m_min_depth_bounds = in_src_pipeline_create_info_ptr->m_min_depth_bounds; @@ -183,16 +188,16 @@ bool Anvil::GraphicsPipelineCreateInfo::copy_gfx_state_from(const Anvil::Graphic m_enabled_dynamic_states = in_src_pipeline_create_info_ptr->m_enabled_dynamic_states; - m_alpha_to_coverage_enabled = in_src_pipeline_create_info_ptr->m_alpha_to_coverage_enabled; - m_alpha_to_one_enabled = in_src_pipeline_create_info_ptr->m_alpha_to_one_enabled; - m_depth_clamp_enabled = in_src_pipeline_create_info_ptr->m_depth_clamp_enabled; - m_depth_writes_enabled = in_src_pipeline_create_info_ptr->m_depth_writes_enabled; - m_logic_op_enabled = in_src_pipeline_create_info_ptr->m_logic_op_enabled; - m_primitive_restart_enabled = in_src_pipeline_create_info_ptr->m_primitive_restart_enabled; - m_rasterizer_discard_enabled = in_src_pipeline_create_info_ptr->m_rasterizer_discard_enabled; - m_sample_locations_enabled = in_src_pipeline_create_info_ptr->m_sample_locations_enabled; - m_sample_mask_enabled = in_src_pipeline_create_info_ptr->m_sample_mask_enabled; - m_sample_shading_enabled = in_src_pipeline_create_info_ptr->m_sample_shading_enabled; + m_alpha_to_coverage_enabled = in_src_pipeline_create_info_ptr->m_alpha_to_coverage_enabled; + m_alpha_to_one_enabled = in_src_pipeline_create_info_ptr->m_alpha_to_one_enabled; + m_depth_clamp_enabled = in_src_pipeline_create_info_ptr->m_depth_clamp_enabled; + m_depth_writes_enabled = in_src_pipeline_create_info_ptr->m_depth_writes_enabled; + m_logic_op_enabled = in_src_pipeline_create_info_ptr->m_logic_op_enabled; + m_primitive_restart_enabled = in_src_pipeline_create_info_ptr->m_primitive_restart_enabled; + m_rasterizer_discard_enabled = in_src_pipeline_create_info_ptr->m_rasterizer_discard_enabled; + m_sample_locations_enabled = in_src_pipeline_create_info_ptr->m_sample_locations_enabled; + m_sample_mask_enabled = in_src_pipeline_create_info_ptr->m_sample_mask_enabled; + m_sample_shading_enabled = in_src_pipeline_create_info_ptr->m_sample_shading_enabled; m_stencil_test_enabled = in_src_pipeline_create_info_ptr->m_stencil_test_enabled; m_stencil_state_back_face = in_src_pipeline_create_info_ptr->m_stencil_state_back_face; @@ -204,6 +209,9 @@ bool Anvil::GraphicsPipelineCreateInfo::copy_gfx_state_from(const Anvil::Graphic m_rasterization_order = in_src_pipeline_create_info_ptr->m_rasterization_order; + m_conservative_rasterization_mode = in_src_pipeline_create_info_ptr->m_conservative_rasterization_mode; + m_extra_primitive_overestimation_size = in_src_pipeline_create_info_ptr->m_extra_primitive_overestimation_size; + m_tessellation_domain_origin = in_src_pipeline_create_info_ptr->m_tessellation_domain_origin; m_attributes = in_src_pipeline_create_info_ptr->m_attributes; @@ -540,6 +548,16 @@ Anvil::RasterizationOrderAMD Anvil::GraphicsPipelineCreateInfo::get_rasterizatio return m_rasterization_order; } +Anvil::ConservativeRasterizationModeEXT Anvil::GraphicsPipelineCreateInfo::get_conservative_rasterization_mode() const +{ + return m_conservative_rasterization_mode; +} + +float Anvil::GraphicsPipelineCreateInfo::get_extra_primitive_overestimation_size() const +{ + return m_extra_primitive_overestimation_size; +} + void Anvil::GraphicsPipelineCreateInfo::get_rasterization_properties(Anvil::PolygonMode* out_opt_polygon_mode_ptr, Anvil::CullModeFlags* out_opt_cull_mode_ptr, Anvil::FrontFace* out_opt_front_face_ptr, @@ -889,6 +907,11 @@ bool Anvil::GraphicsPipelineCreateInfo::is_depth_clamp_enabled() const return m_depth_clamp_enabled; } +bool Anvil::GraphicsPipelineCreateInfo::is_depth_clip_enabled() const +{ + return m_depth_clip_enabled; +} + bool Anvil::GraphicsPipelineCreateInfo::is_primitive_restart_enabled() const { return m_primitive_restart_enabled; @@ -972,6 +995,16 @@ void Anvil::GraphicsPipelineCreateInfo::set_rasterization_stream_index(const uin m_rasterization_stream_index = in_rasterization_stream_index; } +void Anvil::GraphicsPipelineCreateInfo::set_conservative_rasterization_mode(Anvil::ConservativeRasterizationModeEXT in_conservative_rasterization_mode) +{ + m_conservative_rasterization_mode = in_conservative_rasterization_mode; +} + +void Anvil::GraphicsPipelineCreateInfo::set_extra_primitive_overestimation_size(float extra_primitive_overestimation_size) +{ + m_extra_primitive_overestimation_size = extra_primitive_overestimation_size; +} + void Anvil::GraphicsPipelineCreateInfo::set_rasterization_properties(Anvil::PolygonMode in_polygon_mode, Anvil::CullModeFlags in_cull_mode, Anvil::FrontFace in_front_face, @@ -1094,6 +1127,11 @@ void Anvil::GraphicsPipelineCreateInfo::toggle_depth_clamp(bool in_should_enable m_depth_clamp_enabled = in_should_enable; } +void Anvil::GraphicsPipelineCreateInfo::toggle_depth_clip(bool in_should_enable) +{ + m_depth_clip_enabled = in_should_enable; +} + void Anvil::GraphicsPipelineCreateInfo::toggle_depth_test(bool in_should_enable, Anvil::CompareOp in_compare_op) { diff --git a/src/misc/image_view_create_info.cpp b/src/misc/image_view_create_info.cpp index ff846c82..0ad36131 100644 --- a/src/misc/image_view_create_info.cpp +++ b/src/misc/image_view_create_info.cpp @@ -307,17 +307,18 @@ Anvil::ImageViewCreateInfo::ImageViewCreateInfo(const Anvil::ImageAspectFlags& i const Anvil::ComponentSwizzle* in_swizzle_array_ptr, const Anvil::ImageViewType in_type, const Anvil::MTSafety& in_mt_safety) - :m_aspect_mask (in_aspect_mask), - m_device_ptr (in_device_ptr), - m_format (in_format), - m_mt_safety (in_mt_safety), - m_n_base_layer (in_n_base_layer), - m_n_base_mipmap_level(in_n_base_mipmap_level), - m_n_layers (in_n_layers), - m_n_mipmaps (in_n_mipmaps), - m_parent_image_ptr (in_parent_image_ptr), - m_swizzle_array ({in_swizzle_array_ptr[0], in_swizzle_array_ptr[1], in_swizzle_array_ptr[2], in_swizzle_array_ptr[3]}), - m_type (in_type) + :m_aspect_mask (in_aspect_mask), + m_device_ptr (in_device_ptr), + m_format (in_format), + m_mt_safety (in_mt_safety), + m_n_base_layer (in_n_base_layer), + m_n_base_mipmap_level (in_n_base_mipmap_level), + m_n_layers (in_n_layers), + m_n_mipmaps (in_n_mipmaps), + m_parent_image_ptr (in_parent_image_ptr), + m_sampler_ycbcr_conversion_ptr(nullptr), + m_swizzle_array ({in_swizzle_array_ptr[0], in_swizzle_array_ptr[1], in_swizzle_array_ptr[2], in_swizzle_array_ptr[3]}), + m_type (in_type) { anvil_assert(in_parent_image_ptr != nullptr); } diff --git a/src/misc/instance_create_info.cpp b/src/misc/instance_create_info.cpp index 7d6f413b..dd454b07 100644 --- a/src/misc/instance_create_info.cpp +++ b/src/misc/instance_create_info.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -26,9 +26,12 @@ Anvil::InstanceCreateInfo::InstanceCreateInfo(const std::string& in Anvil::DebugCallbackFunction in_opt_validation_callback_proc, bool in_mt_safe, const std::vector& in_opt_disallowed_instance_level_extensions) - :m_app_name (in_app_name), + :m_api_version (Anvil::APIVersion::UNKNOWN), + m_app_name (in_app_name), + m_app_version (0), m_disallowed_instance_level_extensions(in_opt_disallowed_instance_level_extensions), m_engine_name (in_engine_name), + m_engine_version (0), m_is_mt_safe (in_mt_safe), m_n_memory_type_to_use_for_all_alocs (UINT32_MAX), m_validation_callback (in_opt_validation_callback_proc) diff --git a/src/misc/memalloc_backends/backend_oneshot.cpp b/src/misc/memalloc_backends/backend_oneshot.cpp index 234c359c..37ac2c7f 100644 --- a/src/misc/memalloc_backends/backend_oneshot.cpp +++ b/src/misc/memalloc_backends/backend_oneshot.cpp @@ -32,6 +32,7 @@ #include "wrappers/memory_block.h" #include #include +#include /** Please see header for specification */ Anvil::MemoryAllocatorBackends::OneShot::OneShot(const Anvil::BaseDevice* in_device_ptr) @@ -47,6 +48,40 @@ Anvil::MemoryAllocatorBackends::OneShot::~OneShot() /* Stub */ } + +namespace +{ + typedef struct MemoryUniqueInfo + { + uint32_t device_mask; + float memory_priority; + + MemoryUniqueInfo(const uint32_t& in_device_mask, + const float& in_memory_priority) + :device_mask (in_device_mask), + memory_priority(in_memory_priority) + { + /* Stub */ + } + + bool operator==(const MemoryUniqueInfo& in_info) const + { + if ((in_info.device_mask == device_mask) && (std::fabs(in_info.memory_priority - memory_priority) < 1e-4f)) + { + return true; + } + return false; + } + + bool operator<(const MemoryUniqueInfo& in_info) const + { + return (device_mask < in_info.device_mask) ? true + : ((device_mask == in_info.device_mask) && (memory_priority < in_info.memory_priority)); + } + + } MemoryUniqueInfo; +} + /** Tries to create a memory object of size large enough to capacitate all added objects, * given their alignment, size, and other requirements. * @@ -62,25 +97,25 @@ Anvil::MemoryAllocatorBackends::OneShot::~OneShot() **/ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items& in_items) { - typedef struct DedicatedAllocationInfo + typedef struct UniqueAllocationInfo { Anvil::MemoryAllocator::Item* item_ptr; uint32_t n_memory_type; - DedicatedAllocationInfo(Anvil::MemoryAllocator::Item* in_item_ptr, - const uint32_t& in_n_memory_type) + UniqueAllocationInfo(Anvil::MemoryAllocator::Item* in_item_ptr, + const uint32_t& in_n_memory_type) :item_ptr (in_item_ptr), n_memory_type(in_n_memory_type) { /* Stub */ } - } DedicatedAllocationInfo; + } UniqueAllocationInfo; - std::vector dedicated_allocs; - std::unordered_map > > device_mask_to_mem_type_to_item_vec; - const auto& memory_props (m_device_ptr->get_physical_device_memory_properties() ); - const uint32_t n_memory_types (static_cast(memory_props.types.size() )); - bool result (true); + std::map > > device_mask_to_mem_type_to_item_vec; + const auto& memory_props (m_device_ptr->get_physical_device_memory_properties() ); + const uint32_t n_memory_types (static_cast(memory_props.types.size()) ); + bool result (true); + std::vector unique_allocs; /* Iterate over all block items and determine what memory types we can use. * @@ -168,21 +203,20 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items if ((*item_iterator)->alloc_is_dedicated_memory || (*item_iterator)->alloc_exportable_external_handle_types != 0) { - dedicated_allocs.push_back( - DedicatedAllocationInfo(item_iterator->get(), - n_memory_type) - ); + unique_allocs.push_back(UniqueAllocationInfo(item_iterator->get(), + n_memory_type)); } else { - const auto& device_mask = (*item_iterator)->alloc_device_mask; + const MemoryUniqueInfo unique_info((*item_iterator)->alloc_device_mask, + (*item_iterator)->memory_priority); - if (device_mask_to_mem_type_to_item_vec.find(device_mask) == device_mask_to_mem_type_to_item_vec.end() ) + if (device_mask_to_mem_type_to_item_vec.find(unique_info) == device_mask_to_mem_type_to_item_vec.end() ) { - device_mask_to_mem_type_to_item_vec[device_mask].resize(n_memory_types); + device_mask_to_mem_type_to_item_vec[unique_info].resize(n_memory_types); } - device_mask_to_mem_type_to_item_vec.at(device_mask).at(n_memory_type).push_back((item_iterator->get() ) ); + device_mask_to_mem_type_to_item_vec.at(unique_info).at(n_memory_type).push_back((item_iterator->get() ) ); } break; @@ -190,7 +224,7 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items } /* For each dedicated allocation, create one and associate it with the parent object. */ - for (const auto& current_dedicated_alloc : dedicated_allocs) + for (const auto& current_unique_alloc : unique_allocs) { Anvil::MemoryBlockUniquePtr new_memory_block_ptr_derived(nullptr, std::default_delete() ); @@ -200,31 +234,32 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items /* Bake the block and stash it */ { auto create_info_ptr = Anvil::MemoryBlockCreateInfo::create_regular(m_device_ptr, - 1u << current_dedicated_alloc.n_memory_type, - current_dedicated_alloc.item_ptr->alloc_size, - (memory_props.types[current_dedicated_alloc.n_memory_type].features) ); + 1u << current_unique_alloc.n_memory_type, + current_unique_alloc.item_ptr->alloc_size, + (memory_props.types[current_unique_alloc.n_memory_type].features) ); - create_info_ptr->set_device_mask(current_dedicated_alloc.item_ptr->alloc_device_mask); - create_info_ptr->set_mt_safety (Anvil::Utils::convert_boolean_to_mt_safety_enum(m_device_ptr->is_mt_safe()) ); + create_info_ptr->set_memory_priority(current_unique_alloc.item_ptr->memory_priority); + create_info_ptr->set_device_mask (current_unique_alloc.item_ptr->alloc_device_mask); + create_info_ptr->set_mt_safety (Anvil::Utils::convert_boolean_to_mt_safety_enum(m_device_ptr->is_mt_safe()) ); - if (current_dedicated_alloc.item_ptr->alloc_is_dedicated_memory) + if (current_unique_alloc.item_ptr->alloc_is_dedicated_memory) { - create_info_ptr->use_dedicated_allocation(current_dedicated_alloc.item_ptr->buffer_ptr, - current_dedicated_alloc.item_ptr->image_ptr); + create_info_ptr->use_dedicated_allocation(current_unique_alloc.item_ptr->buffer_ptr, + current_unique_alloc.item_ptr->image_ptr); } - if (current_dedicated_alloc.item_ptr->alloc_exportable_external_handle_types != 0) + if (current_unique_alloc.item_ptr->alloc_exportable_external_handle_types != 0) { - create_info_ptr->set_exportable_external_memory_handle_types(current_dedicated_alloc.item_ptr->alloc_exportable_external_handle_types); + create_info_ptr->set_exportable_external_memory_handle_types(current_unique_alloc.item_ptr->alloc_exportable_external_handle_types); } #if defined(_WIN32) { - if (current_dedicated_alloc.item_ptr->alloc_external_nt_handle_info_ptr != nullptr) + if (current_unique_alloc.item_ptr->alloc_external_nt_handle_info_ptr != nullptr) { - create_info_ptr->set_exportable_nt_handle_info(current_dedicated_alloc.item_ptr->alloc_external_nt_handle_info_ptr->attributes_ptr, - current_dedicated_alloc.item_ptr->alloc_external_nt_handle_info_ptr->access, - current_dedicated_alloc.item_ptr->alloc_external_nt_handle_info_ptr->name); + create_info_ptr->set_exportable_nt_handle_info(current_unique_alloc.item_ptr->alloc_external_nt_handle_info_ptr->attributes_ptr, + current_unique_alloc.item_ptr->alloc_external_nt_handle_info_ptr->access, + current_unique_alloc.item_ptr->alloc_external_nt_handle_info_ptr->name); } } #endif @@ -243,16 +278,16 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items { auto create_info_ptr = Anvil::MemoryBlockCreateInfo::create_derived(new_memory_block_ptr_regular.get(), 0, /* in_start_offset */ - current_dedicated_alloc.item_ptr->alloc_size); + current_unique_alloc.item_ptr->alloc_size); new_memory_block_ptr_derived = Anvil::MemoryBlock::create(std::move(create_info_ptr) ); - current_dedicated_alloc.item_ptr->alloc_memory_block_ptr = std::move(new_memory_block_ptr_regular); - current_dedicated_alloc.item_ptr->is_baked = (current_dedicated_alloc.item_ptr->alloc_memory_block_ptr != nullptr); + current_unique_alloc.item_ptr->alloc_memory_block_ptr = std::move(new_memory_block_ptr_regular); + current_unique_alloc.item_ptr->is_baked = (current_unique_alloc.item_ptr->alloc_memory_block_ptr != nullptr); } - dynamic_cast(current_dedicated_alloc.item_ptr->alloc_memory_block_ptr.get() )->set_parent_memory_allocator_backend_ptr(shared_from_this(), - reinterpret_cast(new_memory_block_ptr_derived->get_memory() )); + dynamic_cast(current_unique_alloc.item_ptr->alloc_memory_block_ptr.get() )->set_parent_memory_allocator_backend_ptr(shared_from_this(), + reinterpret_cast(new_memory_block_ptr_derived->get_memory() )); m_memory_blocks.push_back( std::move(new_memory_block_ptr_derived) @@ -266,11 +301,11 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items ++device_mask_to_mem_type_to_item_vector_iterator) { std::map alloc_offset_map; - auto& current_device_mask_to_item_vector_data = *device_mask_to_mem_type_to_item_vector_iterator; - const auto& current_device_mask = current_device_mask_to_item_vector_data.first; + auto& current_memory_info_to_item_vector_data = *device_mask_to_mem_type_to_item_vector_iterator; + const auto& current_memory_info = current_memory_info_to_item_vector_data.first; uint32_t current_memory_type_index = 0; - for (const auto& current_items : current_device_mask_to_item_vector_data.second) + for (const auto& current_items : current_memory_info_to_item_vector_data.second) { if (current_items.size() > 0) { @@ -325,8 +360,9 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items n_bytes_required, (memory_props.types[current_memory_type_index].features) ); - create_info_ptr->set_device_mask(current_device_mask); - create_info_ptr->set_mt_safety (Anvil::Utils::convert_boolean_to_mt_safety_enum(m_device_ptr->is_mt_safe()) ); + create_info_ptr->set_memory_priority(current_memory_info_to_item_vector_data.first.memory_priority); + create_info_ptr->set_device_mask (current_memory_info.device_mask); + create_info_ptr->set_mt_safety (Anvil::Utils::convert_boolean_to_mt_safety_enum(m_device_ptr->is_mt_safe()) ); new_memory_block_ptr = Anvil::MemoryBlock::create(std::move(create_info_ptr) ); } @@ -414,6 +450,11 @@ bool Anvil::MemoryAllocatorBackends::OneShot::supports_external_memory_handles(c return true; } +bool Anvil::MemoryAllocatorBackends::OneShot::supports_protected_memory() const +{ + return true; +} + void Anvil::MemoryAllocatorBackends::OneShot::unmap(void* in_memory_object) { Anvil::Vulkan::vkUnmapMemory(m_device_ptr->get_device_vk(), diff --git a/src/misc/memalloc_backends/backend_vma.cpp b/src/misc/memalloc_backends/backend_vma.cpp index ae5cea91..b53cbd29 100644 --- a/src/misc/memalloc_backends/backend_vma.cpp +++ b/src/misc/memalloc_backends/backend_vma.cpp @@ -218,6 +218,8 @@ bool Anvil::MemoryAllocatorBackends::VMA::bake(Anvil::MemoryAllocator::Items& in */ for (auto& current_item_ptr : in_items) { + anvil_assert(current_item_ptr->memory_priority == FLT_MAX); /* VMA doesn't support memory_priority */ + MemoryBlockUniquePtr new_memory_block_ptr(nullptr, std::default_delete() ); @@ -427,6 +429,12 @@ bool Anvil::MemoryAllocatorBackends::VMA::supports_external_memory_handles(const return false; } +bool Anvil::MemoryAllocatorBackends::VMA::supports_protected_memory() const +{ + /* Vulkan Memory Allocator does NOT support VK 1.1 features */ + return false; +} + void Anvil::MemoryAllocatorBackends::VMA::unmap(void* in_memory_object) { vmaUnmapMemory(m_vma_allocator_ptr->get_handle(), diff --git a/src/misc/memory_allocator.cpp b/src/misc/memory_allocator.cpp index b7613ba1..a5b5b535 100644 --- a/src/misc/memory_allocator.cpp +++ b/src/misc/memory_allocator.cpp @@ -52,7 +52,8 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i const bool& in_alloc_is_dedicated, const uint32_t& in_device_mask, const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs, - const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices) + const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices, + const float& in_memory_priority) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -65,6 +66,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i alloc_exportable_external_handle_types = in_opt_exportable_external_handle_types; alloc_image_aspect = Anvil::ImageAspectFlagBits::NONE; alloc_is_dedicated_memory = in_alloc_is_dedicated; + alloc_is_scratch_buffer_alloc = false; alloc_memory_final_type = UINT32_MAX; alloc_memory_required_alignment = in_alloc_alignment; alloc_memory_required_features = in_alloc_required_memory_features; @@ -77,6 +79,9 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i image_ptr = nullptr; is_baked = false; memory_allocator_ptr = in_memory_allocator_ptr; + memory_priority = in_memory_priority; + n_layer = UINT32_MAX; + n_plane = UINT32_MAX; type = ITEM_TYPE_BUFFER; register_for_callbacks(); @@ -97,7 +102,8 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i const bool& in_alloc_is_dedicated, const uint32_t& in_device_mask, const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs, - const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices) + const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices, + const float& in_memory_priority) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -110,6 +116,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i alloc_exportable_external_handle_types = in_opt_exportable_external_handle_types; alloc_image_aspect = Anvil::ImageAspectFlagBits::NONE; alloc_is_dedicated_memory = in_alloc_is_dedicated; + alloc_is_scratch_buffer_alloc = false; alloc_memory_final_type = UINT32_MAX; alloc_memory_required_alignment = in_alloc_alignment; alloc_memory_required_features = in_alloc_required_memory_features; @@ -123,6 +130,9 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i image_ptr = nullptr; is_baked = false; memory_allocator_ptr = in_memory_allocator_ptr; + memory_priority = in_memory_priority; + n_layer = UINT32_MAX; + n_plane = UINT32_MAX; type = ITEM_TYPE_SPARSE_BUFFER_REGION; register_for_callbacks(); @@ -146,7 +156,8 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i const bool& in_alloc_is_dedicated, const uint32_t& in_device_mask, const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs, - const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices) + const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices, + const float& in_memory_priority) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -159,6 +170,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i alloc_exportable_external_handle_types = in_opt_exportable_external_handle_types; alloc_image_aspect = in_alloc_aspect; alloc_is_dedicated_memory = in_alloc_is_dedicated; + alloc_is_scratch_buffer_alloc = false; alloc_memory_final_type = UINT32_MAX; alloc_memory_required_alignment = in_alloc_alignment; alloc_memory_required_features = in_alloc_required_memory_features; @@ -172,8 +184,12 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i image_ptr = in_image_ptr; is_baked = false; memory_allocator_ptr = in_memory_allocator_ptr; + memory_priority = in_memory_priority; miptail_offset = in_miptail_offset; n_layer = in_n_layer; + n_plane = (in_alloc_aspect == Anvil::ImageAspectFlagBits::PLANE_1_BIT) ? 1 + : (in_alloc_aspect == Anvil::ImageAspectFlagBits::PLANE_2_BIT) ? 2 + : 0; type = ITEM_TYPE_SPARSE_IMAGE_MIPTAIL; register_for_callbacks(); @@ -197,7 +213,8 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i const bool& in_alloc_is_dedicated, const uint32_t& in_device_mask, const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs, - const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices) + const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices, + const float& in_memory_priority) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -210,6 +227,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i alloc_exportable_external_handle_types = in_opt_exportable_external_handle_types; alloc_image_aspect = Anvil::ImageAspectFlagBits::NONE; alloc_is_dedicated_memory = in_alloc_is_dedicated; + alloc_is_scratch_buffer_alloc = false; alloc_memory_final_type = UINT32_MAX; alloc_memory_types = in_alloc_memory_types; alloc_memory_required_alignment = in_alloc_alignment; @@ -224,6 +242,11 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i image_ptr = in_image_ptr; is_baked = false; memory_allocator_ptr = in_memory_allocator_ptr; + memory_priority = in_memory_priority; + n_layer = UINT32_MAX; + n_plane = (in_subresource.aspect_mask == Anvil::ImageAspectFlagBits::PLANE_1_BIT) ? 1 + : (in_subresource.aspect_mask == Anvil::ImageAspectFlagBits::PLANE_2_BIT) ? 2 + : 0; offset = in_offset; subresource = in_subresource; type = ITEM_TYPE_SPARSE_IMAGE_SUBRESOURCE; @@ -246,7 +269,9 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i const bool& in_alloc_is_dedicated, const uint32_t& in_device_mask, const MGPUPeerMemoryRequirements& in_mgpu_peer_memory_reqs, - const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices) + const MGPUBindSparseDeviceIndices& in_mgpu_bind_sparse_device_indices, + const float& in_memory_priority, + const uint32_t& in_n_plane) { anvil_assert(in_alloc_supported_memory_types != 0); anvil_assert(in_memory_allocator_ptr != nullptr); @@ -259,6 +284,7 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i alloc_exportable_external_handle_types = in_opt_exportable_external_handle_types; alloc_image_aspect = Anvil::ImageAspectFlagBits::NONE; alloc_is_dedicated_memory = in_alloc_is_dedicated; + alloc_is_scratch_buffer_alloc = false; alloc_memory_final_type = UINT32_MAX; alloc_memory_required_alignment = in_alloc_alignment; alloc_memory_required_features = in_alloc_required_memory_features; @@ -272,6 +298,9 @@ Anvil::MemoryAllocator::Item::Item(Anvil::MemoryAllocator* i image_ptr = in_image_ptr; is_baked = false; memory_allocator_ptr = in_memory_allocator_ptr; + memory_priority = in_memory_priority; + n_layer = UINT32_MAX; + n_plane = in_n_plane; type = ITEM_TYPE_IMAGE_WHOLE; register_for_callbacks(); @@ -445,7 +474,8 @@ bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* #endif const uint32_t* in_opt_device_mask_ptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr, + const float& in_opt_memory_priority) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -465,7 +495,8 @@ bool Anvil::MemoryAllocator::add_buffer(Anvil::Buffer* #endif in_opt_device_mask_ptr, in_opt_mgpu_peer_memory_reqs_ptr, - in_opt_mgpu_bind_sparse_device_indices_ptr); + in_opt_mgpu_bind_sparse_device_indices_ptr, + in_opt_memory_priority); } /** Determines the amount of memory, supported memory type and required alignment for the specified @@ -481,7 +512,8 @@ bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* #endif const uint32_t* in_opt_device_mask_ptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr, + const float& in_opt_memory_priority) { IMemoryAllocatorBackend* backend_interface_ptr = dynamic_cast(m_backend_ptr.get() ); VkDeviceSize buffer_alignment = 0; @@ -496,12 +528,15 @@ bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* /* Sanity checks */ anvil_assert(backend_interface_ptr->supports_baking() ); - anvil_assert(in_buffer_ptr != nullptr); + anvil_assert(in_buffer_ptr != nullptr); anvil_assert( in_opt_device_mask_ptr == nullptr || (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); anvil_assert( in_opt_mgpu_bind_sparse_device_indices_ptr == nullptr || ((in_buffer_ptr->get_create_info_ptr()->get_create_flags() & BufferCreateFlagBits::SPARSE_BINDING_BIT) != 0)); + anvil_assert((in_required_memory_features & Anvil::MemoryFeatureFlagBits::PROTECTED_BIT) == 0 || + (m_backend_ptr->supports_protected_memory() )); + anvil_assert(do_bind_sparse_device_indices_sanity_check(in_opt_mgpu_bind_sparse_device_indices_ptr)); /* Extract external memory handle types from the specified buffer, if none were specified. */ @@ -544,12 +579,11 @@ bool Anvil::MemoryAllocator::add_buffer_internal(Anvil::Buffer* in_buffer_ptr->requires_dedicated_allocation(), (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr : 0, (in_opt_mgpu_peer_memory_reqs_ptr != nullptr) ? *in_opt_mgpu_peer_memory_reqs_ptr : MGPUPeerMemoryRequirements(), - (in_opt_mgpu_bind_sparse_device_indices_ptr != nullptr) ? *in_opt_mgpu_bind_sparse_device_indices_ptr : MGPUBindSparseDeviceIndices() ) + (in_opt_mgpu_bind_sparse_device_indices_ptr != nullptr) ? *in_opt_mgpu_bind_sparse_device_indices_ptr : MGPUBindSparseDeviceIndices(), + in_opt_memory_priority) ); - m_items.push_back( - std::move(new_item_ptr) - ); + m_items.push_back(std::move(new_item_ptr)); m_per_object_pending_alloc_status[in_buffer_ptr] = true; @@ -569,7 +603,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvi #endif const uint32_t* in_opt_device_mask_ptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr, + const float& in_opt_memory_priority) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -590,7 +625,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_ptr_based_post_fill(Anvi #endif in_opt_device_mask_ptr, in_opt_mgpu_peer_memory_reqs_ptr, - in_opt_mgpu_bind_sparse_device_indices_ptr); + in_opt_mgpu_bind_sparse_device_indices_ptr, + in_opt_memory_priority); if (result) { @@ -610,7 +646,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi #endif const uint32_t* in_opt_device_mask_ptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr, + const float& in_opt_memory_priority) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -633,7 +670,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi #endif in_opt_device_mask_ptr, in_opt_mgpu_peer_memory_reqs_ptr, - in_opt_mgpu_bind_sparse_device_indices_ptr); + in_opt_mgpu_bind_sparse_device_indices_ptr, + in_opt_memory_priority); if (result) { @@ -653,7 +691,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi #endif const uint32_t* in_opt_device_mask_ptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr, + const float& in_opt_memory_priority) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -681,7 +720,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_float_data_vector_ptr_based_post_fi #endif in_opt_device_mask_ptr, in_opt_mgpu_peer_memory_reqs_ptr, - in_opt_mgpu_bind_sparse_device_indices_ptr); + in_opt_mgpu_bind_sparse_device_indices_ptr, + in_opt_memory_priority); if (result) { @@ -701,7 +741,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anv #endif const uint32_t* in_opt_device_mask_ptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr, + const float& in_opt_memory_priority) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -722,7 +763,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_ptr_based_post_fill(Anv #endif in_opt_device_mask_ptr, in_opt_mgpu_peer_memory_reqs_ptr, - in_opt_mgpu_bind_sparse_device_indices_ptr); + in_opt_mgpu_bind_sparse_device_indices_ptr, + in_opt_memory_priority); if (result) { @@ -742,7 +784,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_vector_ptr_based_post_f #endif const uint32_t* in_opt_device_mask_ptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr, + const float& in_opt_memory_priority) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -765,7 +808,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uchar8_data_vector_ptr_based_post_f #endif in_opt_device_mask_ptr, in_opt_mgpu_peer_memory_reqs_ptr, - in_opt_mgpu_bind_sparse_device_indices_ptr); + in_opt_mgpu_bind_sparse_device_indices_ptr, + in_opt_memory_priority); if (result) { @@ -785,7 +829,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anv #endif const uint32_t* in_opt_device_mask_ptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr, + const float& in_opt_memory_priority) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -806,7 +851,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_ptr_based_post_fill(Anv #endif in_opt_device_mask_ptr, in_opt_mgpu_peer_memory_reqs_ptr, - in_opt_mgpu_bind_sparse_device_indices_ptr); + in_opt_mgpu_bind_sparse_device_indices_ptr, + in_opt_memory_priority); if (result) { @@ -826,7 +872,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f #endif const uint32_t* in_opt_device_mask_ptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr, + const float& in_opt_memory_priority) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -849,7 +896,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f #endif in_opt_device_mask_ptr, in_opt_mgpu_peer_memory_reqs_ptr, - in_opt_mgpu_bind_sparse_device_indices_ptr); + in_opt_mgpu_bind_sparse_device_indices_ptr, + in_opt_memory_priority); if (result) { @@ -869,7 +917,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f #endif const uint32_t* in_opt_device_mask_ptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr, + const float& in_opt_memory_priority) { std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -897,7 +946,8 @@ bool Anvil::MemoryAllocator::add_buffer_with_uint32_data_vector_ptr_based_post_f #endif in_opt_device_mask_ptr, in_opt_mgpu_peer_memory_reqs_ptr, - in_opt_mgpu_bind_sparse_device_indices_ptr); + in_opt_mgpu_bind_sparse_device_indices_ptr, + in_opt_memory_priority); if (result) { @@ -917,11 +967,13 @@ bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* #endif const uint32_t* in_opt_device_mask_ptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr, + const float& in_opt_memory_priority) { uint32_t filtered_memory_types = 0; VkDeviceSize image_alignment = 0; uint32_t image_memory_types = 0; + const auto image_n_planes = Anvil::Formats::get_format_n_planes(in_image_ptr->get_create_info_ptr()->get_format() ); VkDeviceSize image_storage_size = 0; std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); @@ -945,6 +997,9 @@ bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* anvil_assert(do_bind_sparse_device_indices_sanity_check(in_opt_mgpu_bind_sparse_device_indices_ptr)); + anvil_assert((in_required_memory_features & Anvil::MemoryFeatureFlagBits::PROTECTED_BIT) == 0 || + (m_backend_ptr->supports_protected_memory() )); + if (!do_external_memory_handle_type_sanity_checks(in_image_ptr->get_create_info_ptr()->get_external_memory_handle_types()) ) { result = false; @@ -954,42 +1009,49 @@ bool Anvil::MemoryAllocator::add_image_whole(Anvil::Image* /* Determine how much size is needed for the image's storage, as well as what * the allocation requirements are */ - image_alignment = in_image_ptr->get_image_alignment(); - image_memory_types = in_image_ptr->get_image_memory_types(); - image_storage_size = in_image_ptr->get_image_storage_size(); - - if (!get_mem_types_supporting_mem_features(m_device_ptr, - image_memory_types, - in_required_memory_features, - &filtered_memory_types) ) - { - result = false; + for (uint32_t n_plane = 0; + n_plane < image_n_planes; + ++n_plane) + { + image_alignment = in_image_ptr->get_image_alignment (n_plane); + image_memory_types = in_image_ptr->get_image_memory_types(n_plane); + image_storage_size = in_image_ptr->get_image_storage_size(n_plane); + + if (!get_mem_types_supporting_mem_features(m_device_ptr, + image_memory_types, + in_required_memory_features, + &filtered_memory_types) ) + { + result = false; - goto end; - } + goto end; + } - /* Store a new block item descriptor */ - new_item_ptr.reset( - new Item(this, - in_image_ptr, - image_storage_size, - image_memory_types, - image_alignment, - in_required_memory_features, - filtered_memory_types, - in_opt_exportable_external_handle_types, -#if defined(_WIN32) - in_opt_external_nt_handle_info_ptr, -#endif - in_image_ptr->requires_dedicated_allocation(), - (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr : 0, - (in_opt_mgpu_peer_memory_reqs_ptr != nullptr) ? *in_opt_mgpu_peer_memory_reqs_ptr : MGPUPeerMemoryRequirements(), - (in_opt_mgpu_bind_sparse_device_indices_ptr != nullptr) ? *in_opt_mgpu_bind_sparse_device_indices_ptr : MGPUBindSparseDeviceIndices() ) - ); + /* Store a new block item descriptor */ + new_item_ptr.reset( + new Item(this, + in_image_ptr, + image_storage_size, + image_memory_types, + image_alignment, + in_required_memory_features, + filtered_memory_types, + in_opt_exportable_external_handle_types, + #if defined(_WIN32) + in_opt_external_nt_handle_info_ptr, + #endif + in_image_ptr->requires_dedicated_allocation(n_plane), + (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr : 0, + (in_opt_mgpu_peer_memory_reqs_ptr != nullptr) ? *in_opt_mgpu_peer_memory_reqs_ptr : MGPUPeerMemoryRequirements(), + (in_opt_mgpu_bind_sparse_device_indices_ptr != nullptr) ? *in_opt_mgpu_bind_sparse_device_indices_ptr : MGPUBindSparseDeviceIndices(), + in_opt_memory_priority, + n_plane) + ); - m_items.push_back( - std::move(new_item_ptr) - ); + m_items.push_back( + std::move(new_item_ptr) + ); + } m_per_object_pending_alloc_status[in_image_ptr] = true; end: @@ -1003,7 +1065,8 @@ bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* MemoryFeatureFlags in_required_memory_features, const uint32_t* in_opt_device_mask_ptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr, + const float& in_opt_memory_priority) { uint32_t filtered_memory_types = 0; const auto& memory_reqs = in_buffer_ptr->get_memory_requirements(); @@ -1019,9 +1082,11 @@ bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* anvil_assert( in_opt_device_mask_ptr == nullptr || (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); + anvil_assert((in_required_memory_features & Anvil::MemoryFeatureFlagBits::PROTECTED_BIT) == 0); anvil_assert((in_buffer_ptr->get_create_info_ptr()->get_create_flags() & Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0); anvil_assert(do_bind_sparse_device_indices_sanity_check(in_opt_mgpu_bind_sparse_device_indices_ptr)); + if (mutex_ptr != nullptr) { mutex_lock = std::move( @@ -1067,7 +1132,8 @@ bool Anvil::MemoryAllocator::add_sparse_buffer_region(Anvil::Buffer* in_buffer_ptr->requires_dedicated_allocation(), (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr : 0, (in_opt_mgpu_peer_memory_reqs_ptr != nullptr) ? *in_opt_mgpu_peer_memory_reqs_ptr : MGPUPeerMemoryRequirements(), - (in_opt_mgpu_bind_sparse_device_indices_ptr != nullptr) ? *in_opt_mgpu_bind_sparse_device_indices_ptr : MGPUBindSparseDeviceIndices() ) + (in_opt_mgpu_bind_sparse_device_indices_ptr != nullptr) ? *in_opt_mgpu_bind_sparse_device_indices_ptr : MGPUBindSparseDeviceIndices(), + in_opt_memory_priority) ); m_items.push_back( @@ -1089,7 +1155,8 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* MemoryFeatureFlags in_required_memory_features, const uint32_t* in_opt_device_mask_ptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr, + const float& in_opt_memory_priority) { const Anvil::SparseImageAspectProperties* aspect_props_ptr = nullptr; uint32_t filtered_memory_types = 0; @@ -1099,20 +1166,24 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* uint32_t miptail_memory_types = 0; VkDeviceSize miptail_offset = static_cast(UINT64_MAX); VkDeviceSize miptail_size = 0; + const uint32_t n_plane = (in_aspect == Anvil::ImageAspectFlagBits::PLANE_1_BIT) ? 1 + : (in_aspect == Anvil::ImageAspectFlagBits::PLANE_2_BIT) ? 2 + : 0; bool result = true; ANVIL_REDUNDANT_VARIABLE(result); /* Sanity checks */ - anvil_assert(in_image_ptr != nullptr); - anvil_assert(m_backend_ptr->supports_baking () ); - anvil_assert(in_image_ptr->get_create_info_ptr()->get_n_layers () > in_n_layer); - anvil_assert(in_image_ptr->has_aspects (in_aspect) ); - anvil_assert( in_opt_device_mask_ptr == nullptr || - (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); + anvil_assert(in_image_ptr != nullptr); + anvil_assert(m_backend_ptr->supports_baking () ); + anvil_assert(in_image_ptr->get_create_info_ptr()->get_n_layers() > in_n_layer); + anvil_assert(in_image_ptr->has_aspects (in_aspect) ); + anvil_assert( in_opt_device_mask_ptr == nullptr || + (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); - anvil_assert((in_image_ptr->get_create_info_ptr()->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0); - anvil_assert(do_bind_sparse_device_indices_sanity_check(in_opt_mgpu_bind_sparse_device_indices_ptr)); + anvil_assert((in_image_ptr->get_create_info_ptr()->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0); + anvil_assert((in_required_memory_features & Anvil::MemoryFeatureFlagBits::PROTECTED_BIT) == 0); + anvil_assert(do_bind_sparse_device_indices_sanity_check (in_opt_mgpu_bind_sparse_device_indices_ptr)); if (mutex_ptr != nullptr) { @@ -1139,7 +1210,7 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* (aspect_props_ptr->flags & Anvil::SparseImageFormatFlagBits::SINGLE_MIPTAIL_BIT) == 0); /* Determine allocation properties */ - miptail_memory_types = in_image_ptr->get_image_memory_types(); + miptail_memory_types = in_image_ptr->get_image_memory_types(n_plane); miptail_offset = aspect_props_ptr->mip_tail_offset + aspect_props_ptr->mip_tail_stride * in_n_layer; miptail_size = aspect_props_ptr->mip_tail_size; @@ -1164,7 +1235,7 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* miptail_memory_types, miptail_offset, in_aspect, - in_image_ptr->get_image_alignment(), + in_image_ptr->get_image_alignment(n_plane), in_required_memory_features, filtered_memory_types, Anvil::ExternalMemoryHandleTypeFlagBits::NONE, /* in_opt_exportable_external_handle_types */ @@ -1174,7 +1245,8 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* false, /* in_alloc_is_dedicated - sparse images do not supported dedicated allocs */ (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr : 0, (in_opt_mgpu_peer_memory_reqs_ptr != nullptr) ? *in_opt_mgpu_peer_memory_reqs_ptr : MGPUPeerMemoryRequirements(), - (in_opt_mgpu_bind_sparse_device_indices_ptr != nullptr) ? *in_opt_mgpu_bind_sparse_device_indices_ptr : MGPUBindSparseDeviceIndices() ) + (in_opt_mgpu_bind_sparse_device_indices_ptr != nullptr) ? *in_opt_mgpu_bind_sparse_device_indices_ptr : MGPUBindSparseDeviceIndices(), + in_opt_memory_priority) ); m_items.push_back( @@ -1195,7 +1267,8 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* MemoryFeatureFlags in_required_memory_features, const uint32_t* in_opt_device_mask_ptr, const MGPUPeerMemoryRequirements* in_opt_mgpu_peer_memory_reqs_ptr, - const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr) + const MGPUBindSparseDeviceIndices* in_opt_mgpu_bind_sparse_device_indices_ptr, + const float& in_opt_memory_priority) { const Anvil::SparseImageAspectProperties* aspect_props_ptr = nullptr; uint32_t component_size_bits[4] = {0}; @@ -1205,28 +1278,34 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); std::unique_ptr new_item_ptr; + const uint32_t n_plane = (in_subresource.aspect_mask == Anvil::ImageAspectFlagBits::PLANE_1_BIT) ? 1 + : (in_subresource.aspect_mask == Anvil::ImageAspectFlagBits::PLANE_2_BIT) ? 2 + : 0; bool result = true; - const VkDeviceSize tile_size = in_image_ptr->get_memory_requirements().alignment; + const VkDeviceSize tile_size = in_image_ptr->get_image_alignment(n_plane); VkDeviceSize total_region_size_in_bytes = 0; ANVIL_REDUNDANT_VARIABLE(result); /* Sanity checks */ anvil_assert(in_image_ptr != nullptr); - anvil_assert(m_backend_ptr->supports_baking () ); - anvil_assert(in_image_ptr->has_aspects (in_subresource.aspect_mask) ); - anvil_assert(in_image_ptr->get_n_mipmaps () > in_subresource.mip_level); - anvil_assert(in_image_ptr->get_create_info_ptr()->get_n_layers () > in_subresource.array_layer); - anvil_assert( in_opt_device_mask_ptr == nullptr || - (in_opt_device_mask_ptr != nullptr && m_backend_ptr->supports_device_masks() )); + anvil_assert(m_backend_ptr->supports_baking () ); + anvil_assert(in_image_ptr->has_aspects (in_subresource.aspect_mask) ); + anvil_assert(in_image_ptr->get_n_mipmaps () > in_subresource.mip_level); + anvil_assert(in_image_ptr->get_create_info_ptr()->get_n_layers() > in_subresource.array_layer); + anvil_assert( in_opt_device_mask_ptr == nullptr || + (in_opt_device_mask_ptr != nullptr && + m_backend_ptr->supports_device_masks() )); anvil_assert(in_extent.depth >= 1); anvil_assert(in_extent.height >= 1); anvil_assert(in_extent.width >= 1); + anvil_assert((in_required_memory_features & Anvil::MemoryFeatureFlagBits::PROTECTED_BIT) == 0); anvil_assert((in_image_ptr->get_create_info_ptr()->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0); anvil_assert(do_bind_sparse_device_indices_sanity_check(in_opt_mgpu_bind_sparse_device_indices_ptr)); + if (mutex_ptr != nullptr) { mutex_lock = std::move( @@ -1293,16 +1372,28 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* /* Determine allocation properties */ if (!Anvil::Formats::is_format_compressed(image_format)) { - Anvil::Formats::get_format_n_component_bits(image_format, - component_size_bits + 0, - component_size_bits + 1, - component_size_bits + 2, - component_size_bits + 3); + if (Anvil::Formats::is_format_yuv_khr(image_format) ) + { + Anvil::Formats::get_format_n_component_bits_yuv(image_format, + static_cast(in_subresource.aspect_mask.get_vk() ), + component_size_bits + 0, + component_size_bits + 1, + component_size_bits + 2, + component_size_bits + 3); + } + else + { + Anvil::Formats::get_format_n_component_bits_nonyuv(image_format, + component_size_bits + 0, + component_size_bits + 1, + component_size_bits + 2, + component_size_bits + 3); + } - anvil_assert(component_size_bits[0] != 0 || - component_size_bits[1] != 0 || - component_size_bits[2] != 0 || - component_size_bits[3] != 0); + anvil_assert( component_size_bits[0] != 0 || + component_size_bits[1] != 0 || + component_size_bits[2] != 0 || + component_size_bits[3] != 0); anvil_assert(((component_size_bits[0] + component_size_bits[1] + component_size_bits[2] + component_size_bits[3]) % 8) == 0); @@ -1352,7 +1443,7 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* tile_size); if (!get_mem_types_supporting_mem_features(m_device_ptr, - in_image_ptr->get_image_memory_types(), + in_image_ptr->get_image_memory_types(n_plane), in_required_memory_features, &filtered_memory_types) ) { @@ -1369,18 +1460,19 @@ bool Anvil::MemoryAllocator::add_sparse_image_subresource(Anvil::Image* in_offset, in_extent, total_region_size_in_bytes, - in_image_ptr->get_image_memory_types(), + in_image_ptr->get_image_memory_types(n_plane), tile_size, in_required_memory_features, filtered_memory_types, Anvil::ExternalMemoryHandleTypeFlagBits::NONE, /* in_opt_exportable_external_handle_types */ #if defined(_WIN32) - nullptr, /* in_alloc_external_nt_handle_info_ptr */ + nullptr, /* in_alloc_external_nt_handle_info_ptr */ #endif - false, /* in_alloc_is_dedicated - sparse images do not supported dedicated allocs */ + false, /* in_alloc_is_dedicated - sparse images do not supported dedicated allocs */ (in_opt_device_mask_ptr != nullptr) ? *in_opt_device_mask_ptr : 0, (in_opt_mgpu_peer_memory_reqs_ptr != nullptr) ? *in_opt_mgpu_peer_memory_reqs_ptr : MGPUPeerMemoryRequirements(), - (in_opt_mgpu_bind_sparse_device_indices_ptr != nullptr) ? *in_opt_mgpu_bind_sparse_device_indices_ptr : MGPUBindSparseDeviceIndices() ) + (in_opt_mgpu_bind_sparse_device_indices_ptr != nullptr) ? *in_opt_mgpu_bind_sparse_device_indices_ptr : MGPUBindSparseDeviceIndices(), + in_opt_memory_priority) ); m_items.push_back( @@ -1704,7 +1796,8 @@ bool Anvil::MemoryAllocator::bake() Anvil::SparseMemoryBindFlagBits::NONE, item_ptr->alloc_memory_block_ptr.get(), 0, /* opt_memory_block_start_offset */ - true); /* in_opt_memory_block_owned_by_image */ + true, /* in_opt_memory_block_owned_by_image */ + item_ptr->n_plane); } else { @@ -1723,7 +1816,8 @@ bool Anvil::MemoryAllocator::bake() Anvil::SparseMemoryBindFlagBits::NONE, item_ptr->alloc_memory_block_ptr.get(), 0, /* opt_memory_block_start_offset */ - true); /* in_opt_memory_block_owned_by_image */ + true, /* in_opt_memory_block_owned_by_image */ + item_ptr->n_plane); } } @@ -1755,7 +1849,8 @@ bool Anvil::MemoryAllocator::bake() bind_flags, item_ptr->alloc_memory_block_ptr.get(), 0, /* opt_memory_block_start_offset */ - true); /* in_opt_memory_block_owned_by_image */ + true, /* in_opt_memory_block_owned_by_image */ + item_ptr->n_plane); } else { @@ -1774,7 +1869,8 @@ bool Anvil::MemoryAllocator::bake() bind_flags, item_ptr->alloc_memory_block_ptr.get(), 0, /* opt_memory_block_start_offset */ - true); /* in_opt_memory_block_owned_by_image */ + true, /* in_opt_memory_block_owned_by_image */ + item_ptr->n_plane); } } @@ -2059,6 +2155,7 @@ bool Anvil::MemoryAllocator::get_mem_types_supporting_mem_features(const Anvil:: const bool is_lazily_allocated_memory_required(((in_memory_features & Anvil::MemoryFeatureFlagBits::LAZILY_ALLOCATED_BIT) != 0) ); const bool is_mappable_memory_required (((in_memory_features & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) != 0) ); const bool is_multi_instance_memory_required (((in_memory_features & Anvil::MemoryFeatureFlagBits::MULTI_INSTANCE_BIT) != 0) ); + const bool is_protected_memory_required (((in_memory_features & Anvil::MemoryFeatureFlagBits::PROTECTED_BIT) != 0) ); const auto& memory_props (in_device_ptr->get_physical_device_memory_properties() ); const auto n_forced_mem_type (in_device_ptr->get_parent_instance()->get_create_info_ptr()->get_n_memory_type_to_use_for_all_allocs() ); bool result (true); @@ -2080,7 +2177,8 @@ bool Anvil::MemoryAllocator::get_mem_types_supporting_mem_features(const Anvil:: (is_host_cached_memory_required && ((memory_props.types[n_memory_type].flags & Anvil::MemoryPropertyFlagBits::HOST_CACHED_BIT)) == 0) || (is_lazily_allocated_memory_required && ((memory_props.types[n_memory_type].flags & Anvil::MemoryPropertyFlagBits::LAZILY_ALLOCATED_BIT)) == 0) || (is_mappable_memory_required && ((memory_props.types[n_memory_type].flags & Anvil::MemoryPropertyFlagBits::HOST_VISIBLE_BIT)) == 0) || - (is_multi_instance_memory_required && ((memory_props.types[n_memory_type].heap_ptr->flags & Anvil::MemoryHeapFlagBits::MULTI_INSTANCE_BIT_KHR)) == 0) ) + (is_multi_instance_memory_required && ((memory_props.types[n_memory_type].heap_ptr->flags & Anvil::MemoryHeapFlagBits::MULTI_INSTANCE_BIT_KHR)) == 0) || + (is_protected_memory_required && ((memory_props.types[n_memory_type].flags & Anvil::MemoryPropertyFlagBits::PROTECTED_BIT)) == 0) ) { in_memory_types &= ~(1 << n_memory_type); } diff --git a/src/misc/memory_block_create_info.cpp b/src/misc/memory_block_create_info.cpp index 1bb64576..553aaf67 100644 --- a/src/misc/memory_block_create_info.cpp +++ b/src/misc/memory_block_create_info.cpp @@ -23,6 +23,7 @@ #include "wrappers/device.h" #include "wrappers/memory_block.h" #include "wrappers/physical_device.h" +#include Anvil::MemoryBlockCreateInfoUniquePtr Anvil::MemoryBlockCreateInfo::create_derived(MemoryBlock* in_parent_memory_block_ptr, @@ -135,6 +136,67 @@ Anvil::MemoryBlockCreateInfoUniquePtr Anvil::MemoryBlockCreateInfo::create_regul return result_ptr; } +Anvil::MemoryBlockCreateInfoUniquePtr Anvil::MemoryBlockCreateInfo::create_with_memory_type(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_allowed_memory_bits, + VkDeviceSize in_size, + Anvil::MemoryFeatureFlags in_memory_features, + uint32_t in_memory_type_index) +{ + std::vector physical_devices; + auto result_ptr = Anvil::MemoryBlockCreateInfoUniquePtr(nullptr, + std::default_delete() ); + + if (in_device_ptr->get_type() == Anvil::DeviceType::MULTI_GPU) + { + const auto device_mgpu_ptr = dynamic_cast(in_device_ptr); + const uint32_t n_physical_devices = device_mgpu_ptr->get_n_physical_devices(); + + anvil_assert(n_physical_devices > 0); + + physical_devices.resize(n_physical_devices); + + for (uint32_t n_physical_device = 0; + n_physical_device < n_physical_devices; + ++n_physical_device) + { + physical_devices.at(n_physical_device) = device_mgpu_ptr->get_physical_device(n_physical_device); + } + } + else + { + /* Moot */ + } + + { + /* check that in_memory_type_index is not out of range availables memory types */ + anvil_assert(static_cast(in_memory_type_index) < in_device_ptr->get_physical_device_memory_properties().types.size()); + + const auto& device_features = in_device_ptr->get_physical_device_memory_properties().types[in_memory_type_index].features; + ANVIL_REDUNDANT_VARIABLE_CONST(device_features); + + /* check requested memory type features with requested features */ + anvil_assert((device_features & in_memory_features) == in_memory_features); + } + + result_ptr.reset( + new Anvil::MemoryBlockCreateInfo(Anvil::MemoryBlockType::REGULAR_WITH_MEMORY_TYPE, + in_allowed_memory_bits, + in_device_ptr, + VK_NULL_HANDLE, /* in_memory */ + in_memory_features, + in_memory_type_index, + static_cast(physical_devices.size() ), + OnMemoryBlockReleaseCallbackFunction(), + (physical_devices.size() > 0) ? &physical_devices.at(0) + : nullptr, + nullptr, /* in_parent_memory_block_ptr */ + in_size, + 0) /* in_start_offset */ + ); + + return result_ptr; +} + Anvil::MemoryBlockCreateInfo::MemoryBlockCreateInfo(const Anvil::MemoryBlockType& in_type, const uint32_t& in_allowed_memory_bits, const Anvil::BaseDevice* in_device_ptr, @@ -160,6 +222,7 @@ Anvil::MemoryBlockCreateInfo::MemoryBlockCreateInfo(const Anvil::MemoryBlockType m_imported_external_memory_handle_type (Anvil::ExternalMemoryHandleTypeFlagBits::NONE), m_memory (in_memory), m_memory_features (in_memory_features), + m_memory_priority (FLT_MAX), m_memory_type_index (in_memory_type_index), m_mt_safety (Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE), m_on_release_callback_function (in_on_release_callback_function), diff --git a/src/misc/render_pass_create_info.cpp b/src/misc/render_pass_create_info.cpp index 4a007165..3e154269 100644 --- a/src/misc/render_pass_create_info.cpp +++ b/src/misc/render_pass_create_info.cpp @@ -351,7 +351,9 @@ bool Anvil::RenderPassCreateInfo::add_subpass_color_input_attachment(SubPassID (*subpass_attachments_ptr)[in_attachment_location] = SubPassAttachment(in_attachment_id, in_layout, in_resolve_attachment_id, - in_aspects_accessed); + in_aspects_accessed, + Anvil::ResolveModeFlagBits::NONE, + Anvil::ResolveModeFlagBits::NONE); if (in_should_resolve) { @@ -360,7 +362,9 @@ bool Anvil::RenderPassCreateInfo::add_subpass_color_input_attachment(SubPassID subpass_ptr->resolved_attachments_map[in_attachment_location] = SubPassAttachment(in_resolve_attachment_id, in_layout, UINT32_MAX, /* in_opt_resolve_attachment_index */ - in_aspects_accessed); + in_aspects_accessed, + Anvil::ResolveModeFlagBits::NONE, /* in_depth_resolve_mode */ + Anvil::ResolveModeFlagBits::NONE); /* in_stencil_resolve_mode */ } if (subpass_ptr->n_highest_location_used < in_attachment_location) @@ -376,13 +380,34 @@ bool Anvil::RenderPassCreateInfo::add_subpass_color_input_attachment(SubPassID } /* Please see header for specification */ -bool Anvil::RenderPassCreateInfo::add_subpass_depth_stencil_attachment(SubPassID in_subpass_id, - Anvil::ImageLayout in_layout, - RenderPassAttachmentID in_attachment_id) +bool Anvil::RenderPassCreateInfo::add_subpass_depth_stencil_attachment(SubPassID in_subpass_id, + Anvil::ImageLayout in_layout, + RenderPassAttachmentID in_attachment_id, + const RenderPassAttachmentID* in_attachment_resolve_id_ptr, + const Anvil::ResolveModeFlagBits* in_depth_resolve_mode_ptr, + const Anvil::ResolveModeFlagBits* in_stencil_resolve_mode_ptr) { bool result = false; SubPass* subpass_ptr = nullptr; + /* Sanity checks .. */ + if (in_attachment_resolve_id_ptr != nullptr) + { + if (!m_device_ptr->get_extension_info()->khr_depth_stencil_resolve() ) + { + anvil_assert(m_device_ptr->get_extension_info()->khr_depth_stencil_resolve() ); + + goto end; + } + + if (*in_attachment_resolve_id_ptr >= m_attachments.size() ) + { + anvil_assert(!(*in_attachment_resolve_id_ptr >= m_attachments.size()) ); + + goto end; + } + } + /* Retrieve the subpass descriptor */ if (m_subpasses.size() <= in_subpass_id) { @@ -413,8 +438,22 @@ bool Anvil::RenderPassCreateInfo::add_subpass_depth_stencil_attachment(SubPassID subpass_ptr->depth_stencil_attachment = SubPassAttachment(in_attachment_id, in_layout, - UINT32_MAX, - Anvil::ImageAspectFlagBits::NONE); + (in_attachment_resolve_id_ptr != nullptr) ? *in_attachment_resolve_id_ptr + : UINT32_MAX, + Anvil::ImageAspectFlagBits::NONE, + Anvil::ResolveModeFlagBits::NONE, /* in_depth_resolve_mode */ + Anvil::ResolveModeFlagBits::NONE); /* in_stencil_resolve_mode */ + + if ( in_attachment_resolve_id_ptr != nullptr && + *in_attachment_resolve_id_ptr != UINT32_MAX) + { + subpass_ptr->ds_resolve_attachment = SubPassAttachment(*in_attachment_resolve_id_ptr, + in_layout, + UINT32_MAX, /* in_opt_resolve_attachment_index */ + Anvil::ImageAspectFlagBits::NONE, + *in_depth_resolve_mode_ptr, + *in_stencil_resolve_mode_ptr); + } m_update_preserved_attachments = true; result = true; @@ -962,8 +1001,7 @@ bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID if (out_opt_attachment_resolve_id_ptr != nullptr) { - /* DS attachments do not support resolve ops */ - anvil_assert_fail(); + *out_opt_attachment_resolve_id_ptr = subpass_ptr->depth_stencil_attachment.resolve_attachment_index; } if (out_opt_location_ptr != nullptr) @@ -1021,6 +1059,64 @@ bool Anvil::RenderPassCreateInfo::get_subpass_attachment_properties(SubPassID return result; } +/* Please see header for specification */ +bool Anvil::RenderPassCreateInfo::get_subpass_ds_resolve_attachment_properties(SubPassID in_subpass_id, + RenderPassAttachmentID* out_opt_renderpass_attachment_id_ptr, + Anvil::ImageLayout* out_opt_layout_ptr, + Anvil::ResolveModeFlagBits* out_opt_depth_resolve_mode_ptr, + Anvil::ResolveModeFlagBits* out_opt_stencil_resolve_mode_ptr) const +{ + SubPassAttachment attachment; + bool result = false; + const SubPassAttachment* subpass_attachment_ptr = nullptr; + SubPass* subpass_ptr = nullptr; + + /* Sanity checks */ + if (m_subpasses.size() <= in_subpass_id) + { + anvil_assert(!(m_subpasses.size() <= in_subpass_id) ); + + goto end; + } + + subpass_ptr = m_subpasses[in_subpass_id].get(); + + /* Even more sanity checks.. */ + subpass_attachment_ptr = &subpass_ptr->ds_resolve_attachment; + + if (subpass_attachment_ptr->depth_resolve_mode == Anvil::ResolveModeFlagBits::NONE && + subpass_attachment_ptr->stencil_resolve_mode == Anvil::ResolveModeFlagBits::NONE) + { + goto end; + } + + if (out_opt_depth_resolve_mode_ptr != nullptr) + { + *out_opt_depth_resolve_mode_ptr = subpass_attachment_ptr->depth_resolve_mode; + } + + if (out_opt_layout_ptr != nullptr) + { + *out_opt_layout_ptr = subpass_attachment_ptr->layout; + } + + if (out_opt_renderpass_attachment_id_ptr != nullptr) + { + *out_opt_renderpass_attachment_id_ptr = m_attachments.at(subpass_attachment_ptr->attachment_index).index; + } + + if (out_opt_stencil_resolve_mode_ptr != nullptr) + { + *out_opt_stencil_resolve_mode_ptr = subpass_attachment_ptr->stencil_resolve_mode; + } + + /* All done */ + result = true; + +end: + return result; +} + /* Please see header for specification */ bool Anvil::RenderPassCreateInfo::get_subpass_highest_location(SubPassID in_subpass_id, uint32_t* out_result_ptr) const diff --git a/src/misc/rendering_surface_create_info.cpp b/src/misc/rendering_surface_create_info.cpp new file mode 100644 index 00000000..39c02d2b --- /dev/null +++ b/src/misc/rendering_surface_create_info.cpp @@ -0,0 +1,58 @@ +// +// Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#include "misc/rendering_surface_create_info.h" + +Anvil::RenderingSurfaceCreateInfo::RenderingSurfaceCreateInfo(Anvil::Instance* in_instance_ptr, + const Anvil::BaseDevice* in_device_ptr, + const Anvil::Window* in_window_ptr, + MTSafety in_mt_safety) + :m_device_ptr (in_device_ptr), + m_instance_ptr(in_instance_ptr), + m_mt_safety (in_mt_safety), + m_window_ptr (in_window_ptr) +{ + /* Stub */ +} + +Anvil::RenderingSurfaceCreateInfo::~RenderingSurfaceCreateInfo() +{ + /* Stub */ +} + +Anvil::RenderingSurfaceCreateInfoUniquePtr Anvil::RenderingSurfaceCreateInfo::create(Anvil::Instance* in_instance_ptr, + const Anvil::BaseDevice* in_device_ptr, + const Anvil::Window* in_window_ptr, + MTSafety in_mt_safety) +{ + Anvil::RenderingSurfaceCreateInfoUniquePtr result_ptr; + + result_ptr.reset( + new Anvil::RenderingSurfaceCreateInfo(in_instance_ptr, + in_device_ptr, + in_window_ptr, + in_mt_safety) + ); + anvil_assert(result_ptr != nullptr); + + return result_ptr; +} diff --git a/src/misc/sampler_create_info.cpp b/src/misc/sampler_create_info.cpp index 71a12311..82227da2 100644 --- a/src/misc/sampler_create_info.cpp +++ b/src/misc/sampler_create_info.cpp @@ -95,6 +95,7 @@ Anvil::SamplerCreateInfo::SamplerCreateInfo(const Anvil::BaseDevice* in_devic m_mipmap_mode (in_mipmap_mode), m_mt_safety (in_mt_safety), m_sampler_reduction_mode (Anvil::SamplerReductionMode::UNKNOWN), + m_sampler_ycbcr_conversion_ptr(nullptr), m_use_unnormalized_coordinates(in_use_unnormalized_coordinates) { /* Stub */ diff --git a/src/misc/sampler_ycbcr_conversion_create_info.cpp b/src/misc/sampler_ycbcr_conversion_create_info.cpp new file mode 100644 index 00000000..bcea23a7 --- /dev/null +++ b/src/misc/sampler_ycbcr_conversion_create_info.cpp @@ -0,0 +1,77 @@ +// +// Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#include "misc/sampler_ycbcr_conversion_create_info.h" + +Anvil::SamplerYCbCrConversionCreateInfoUniquePtr Anvil::SamplerYCbCrConversionCreateInfo::create(const Anvil::BaseDevice* in_device_ptr, + const Anvil::Format& in_format, + const Anvil::SamplerYCbCrModelConversion& in_ycbcr_model_conversion, + const Anvil::SamplerYCbCrRange& in_ycbcr_range, + const Anvil::ComponentMapping& in_components, + const Anvil::ChromaLocation& in_x_chroma_offset, + const Anvil::ChromaLocation& in_y_chroma_offset, + const Anvil::Filter& in_chroma_filter, + const bool& in_should_force_explicit_reconstruction, + MTSafety in_mt_safety) +{ + Anvil::SamplerYCbCrConversionCreateInfoUniquePtr result_ptr; + + result_ptr.reset( + new Anvil::SamplerYCbCrConversionCreateInfo(in_device_ptr, + in_format, + in_ycbcr_model_conversion, + in_ycbcr_range, + in_components, + in_x_chroma_offset, + in_y_chroma_offset, + in_chroma_filter, + in_should_force_explicit_reconstruction, + in_mt_safety) + ); + + anvil_assert(result_ptr != nullptr); + return result_ptr; +} + +Anvil::SamplerYCbCrConversionCreateInfo::SamplerYCbCrConversionCreateInfo(const Anvil::BaseDevice* in_device_ptr, + const Anvil::Format& in_format, + const Anvil::SamplerYCbCrModelConversion& in_ycbcr_model_conversion, + const Anvil::SamplerYCbCrRange& in_ycbcr_range, + const Anvil::ComponentMapping& in_components, + const Anvil::ChromaLocation& in_x_chroma_offset, + const Anvil::ChromaLocation& in_y_chroma_offset, + const Anvil::Filter& in_chroma_filter, + const bool& in_should_force_explicit_reconstruction, + MTSafety in_mt_safety) + :m_chroma_filter (in_chroma_filter), + m_components (in_components), + m_device_ptr (in_device_ptr), + m_format (in_format), + m_mt_safety (in_mt_safety), + m_should_force_explicit_reconstruction(in_should_force_explicit_reconstruction), + m_x_chroma_offset (in_x_chroma_offset), + m_y_chroma_offset (in_y_chroma_offset), + m_ycbcr_model_conversion (in_ycbcr_model_conversion), + m_ycbcr_range (in_ycbcr_range) +{ + /* Stub */ +} diff --git a/src/misc/semaphore_create_info.cpp b/src/misc/semaphore_create_info.cpp index e13637c4..0ae25fe3 100644 --- a/src/misc/semaphore_create_info.cpp +++ b/src/misc/semaphore_create_info.cpp @@ -35,8 +35,8 @@ Anvil::SemaphoreCreateInfoUniquePtr Anvil::SemaphoreCreateInfo::create(const Anv return result_ptr; } -Anvil::SemaphoreCreateInfo::SemaphoreCreateInfo(const Anvil::BaseDevice* in_device_ptr, - MTSafety in_mt_safety) +Anvil::SemaphoreCreateInfo::SemaphoreCreateInfo(const Anvil::BaseDevice* in_device_ptr, + MTSafety in_mt_safety) :m_device_ptr (in_device_ptr), m_exportable_external_semaphore_handle_types (Anvil::ExternalSemaphoreHandleTypeFlagBits::NONE), #if defined(_WIN32) diff --git a/src/misc/swapchain_create_info.cpp b/src/misc/swapchain_create_info.cpp index ff478390..28f95161 100644 --- a/src/misc/swapchain_create_info.cpp +++ b/src/misc/swapchain_create_info.cpp @@ -87,3 +87,17 @@ Anvil::SwapchainCreateInfo::SwapchainCreateInfo(Anvil::BaseDevice* anvil_assert(in_parent_surface_ptr != nullptr); anvil_assert(in_usage_flags != 0); } + +void Anvil::SwapchainCreateInfo::set_view_format_list(const Anvil::Format* in_compatible_formats_ptr, + const uint32_t& in_n_compatible_formats) +{ + anvil_assert(in_n_compatible_formats > 0); + + m_flags |= Anvil::SwapchainCreateFlagBits::CREATE_MUTABLE_FORMAT_BIT; + + m_compatible_formats.resize(in_n_compatible_formats); + + memcpy(&m_compatible_formats.at(0), + in_compatible_formats_ptr, + sizeof(Anvil::Format) * in_n_compatible_formats); +} \ No newline at end of file diff --git a/src/misc/types.cpp b/src/misc/types.cpp index 36477b3f..db3d1c41 100644 --- a/src/misc/types.cpp +++ b/src/misc/types.cpp @@ -51,6 +51,7 @@ INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::QueueFlags, INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::QueryControlFlags, VkQueryControlFlags, Anvil::QueryControlFlagBits); INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::QueryPipelineStatisticFlags, VkQueryPipelineStatisticFlags, Anvil::QueryPipelineStatisticFlagBits); INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::QueryResultFlags, VkQueryResultFlags, Anvil::QueryResultFlagBits); +INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::ResolveModeFlags, VkResolveModeFlagsKHR, Anvil::ResolveModeFlagBits); INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::SampleCountFlags, VkSampleCountFlags, Anvil::SampleCountFlagBits); INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::ShaderStageFlags, VkShaderStageFlags, Anvil::ShaderStageFlagBits); INJECT_BITFIELD_HELPER_FUNC_IMPLEMENTATION(Anvil::SparseImageFormatFlags, VkSparseImageFormatFlags, Anvil::SparseImageFormatFlagBits); diff --git a/src/misc/types_classes.cpp b/src/misc/types_classes.cpp index de83ecb8..28c9986a 100644 --- a/src/misc/types_classes.cpp +++ b/src/misc/types_classes.cpp @@ -156,12 +156,13 @@ void Anvil::SparseMemoryBindingUpdateInfo::append_opaque_image_memory_update(Spa Anvil::SparseMemoryBindFlags in_flags, Anvil::MemoryBlock* in_opt_memory_block_ptr, VkDeviceSize in_opt_memory_block_start_offset, - bool in_opt_memory_block_owned_by_image) + bool in_opt_memory_block_owned_by_image, + uint32_t in_n_plane) { /* Sanity checks */ - anvil_assert(in_image_ptr != nullptr); - anvil_assert(m_bindings.size() > in_bind_info_id); - anvil_assert(in_image_ptr->get_memory_requirements().size >= in_resource_offset + in_size); + anvil_assert(in_image_ptr != nullptr); + anvil_assert(m_bindings.size () > in_bind_info_id); + anvil_assert(in_image_ptr->get_image_storage_size(in_n_plane) >= in_resource_offset + in_size); if (in_opt_memory_block_ptr != nullptr) { @@ -177,6 +178,7 @@ void Anvil::SparseMemoryBindingUpdateInfo::append_opaque_image_memory_update(Spa update.memory_block_owned_by_target = in_opt_memory_block_owned_by_image; update.memory_block_ptr = in_opt_memory_block_ptr; update.memory_block_start_offset = in_opt_memory_block_start_offset; + update.n_plane = in_n_plane; update.size = in_size; update.start_offset = in_resource_offset; @@ -671,7 +673,8 @@ bool Anvil::SparseMemoryBindingUpdateInfo::get_image_opaque_memory_update_proper Anvil::SparseMemoryBindFlags* out_opt_flags_ptr, Anvil::MemoryBlock** out_opt_memory_block_ptr_ptr, VkDeviceSize* out_opt_memory_block_start_offset_ptr, - bool* out_opt_memory_block_owned_by_image_ptr) const + bool* out_opt_memory_block_owned_by_image_ptr, + uint32_t* out_opt_n_plane_ptr) const { decltype(m_bindings)::const_iterator binding_iterator; GeneralBindInfo image_opaque_bind; @@ -748,6 +751,11 @@ bool Anvil::SparseMemoryBindingUpdateInfo::get_image_opaque_memory_update_proper *out_opt_memory_block_owned_by_image_ptr = image_opaque_bind.memory_block_owned_by_target; } + if (out_opt_n_plane_ptr != nullptr) + { + *out_opt_n_plane_ptr = image_opaque_bind.n_plane; + } + /* All done */ result = true; end: diff --git a/src/misc/types_struct.cpp b/src/misc/types_struct.cpp index f40747ab..30e8dd45 100644 --- a/src/misc/types_struct.cpp +++ b/src/misc/types_struct.cpp @@ -236,7 +236,11 @@ Anvil::DescriptorUpdateTemplateEntry::DescriptorUpdateTemplateEntry(const Anvil: offset (in_offset), stride (in_stride) { - /* Stub */ + if (in_descriptor_type == Anvil::DescriptorType::INLINE_UNIFORM_BLOCK) + { + n_destination_array_element *= 4; + n_descriptors *= 4; + } } bool Anvil::DescriptorUpdateTemplateEntry::operator==(const Anvil::DescriptorUpdateTemplateEntry& in_entry) const @@ -503,6 +507,12 @@ Anvil::ExtensionKHRMaintenance3Entrypoints::ExtensionKHRMaintenance3Entrypoints( vkGetDescriptorSetLayoutSupportKHR = nullptr; } +Anvil::ExtensionKHRSamplerYCbCrConversionEntrypoints::ExtensionKHRSamplerYCbCrConversionEntrypoints() +{ + vkCreateSamplerYcbcrConversionKHR = nullptr; + vkDestroySamplerYcbcrConversionKHR = nullptr; +} + Anvil::ExtensionKHRSurfaceEntrypoints::ExtensionKHRSurfaceEntrypoints() { vkDestroySurfaceKHR = nullptr; @@ -556,6 +566,94 @@ Anvil::ExtensionKHRGetPhysicalDeviceProperties2::ExtensionKHRGetPhysicalDevicePr vkGetPhysicalDeviceSparseImageFormatProperties2KHR = nullptr; } +Anvil::EXTConservativeRasterizationProperties::EXTConservativeRasterizationProperties() + :conservative_point_and_line_rasterization (false), + conservative_rasterization_post_depth_coverage (false), + degenerate_lines_rasterized (false), + degenerate_triangles_rasterized (false), + extra_primitive_overestimation_size_granularity (0.0), + fully_covered_fragment_shader_input_variable (false), + max_extra_primitive_overestimation_size (0.0), + primitive_overestimation_size (0.0), + primitive_underestimation (false) +{ + /* Stub */ +} + +Anvil::EXTConservativeRasterizationProperties::EXTConservativeRasterizationProperties(const VkPhysicalDeviceConservativeRasterizationPropertiesEXT& in_properties) + :conservative_point_and_line_rasterization (VK_BOOL32_TO_BOOL(in_properties.conservativePointAndLineRasterization)), + conservative_rasterization_post_depth_coverage (VK_BOOL32_TO_BOOL(in_properties.conservativeRasterizationPostDepthCoverage)), + degenerate_lines_rasterized (VK_BOOL32_TO_BOOL(in_properties.degenerateLinesRasterized)), + degenerate_triangles_rasterized (VK_BOOL32_TO_BOOL(in_properties.degenerateTrianglesRasterized)), + extra_primitive_overestimation_size_granularity (in_properties.extraPrimitiveOverestimationSizeGranularity), + fully_covered_fragment_shader_input_variable (VK_BOOL32_TO_BOOL(in_properties.fullyCoveredFragmentShaderInputVariable)), + max_extra_primitive_overestimation_size (in_properties.maxExtraPrimitiveOverestimationSize), + primitive_overestimation_size (in_properties.primitiveOverestimationSize), + primitive_underestimation (VK_BOOL32_TO_BOOL(in_properties.primitiveUnderestimation) ) +{ + /* Stub */ +} + +bool Anvil::EXTConservativeRasterizationProperties::operator==(const Anvil::EXTConservativeRasterizationProperties& in_properties) const +{ + return (conservative_point_and_line_rasterization == in_properties.conservative_point_and_line_rasterization && + conservative_rasterization_post_depth_coverage == in_properties.conservative_rasterization_post_depth_coverage && + degenerate_lines_rasterized == in_properties.degenerate_lines_rasterized && + degenerate_triangles_rasterized == in_properties.degenerate_triangles_rasterized && + extra_primitive_overestimation_size_granularity == in_properties.extra_primitive_overestimation_size_granularity && + fully_covered_fragment_shader_input_variable == in_properties.fully_covered_fragment_shader_input_variable && + max_extra_primitive_overestimation_size == in_properties.max_extra_primitive_overestimation_size && + primitive_overestimation_size == in_properties.primitive_overestimation_size && + primitive_underestimation == in_properties.primitive_underestimation); +} + +VkPhysicalDeviceConservativeRasterizationPropertiesEXT Anvil::EXTConservativeRasterizationProperties::get_vk_physical_device_conservative_rasterization_properties() const +{ + VkPhysicalDeviceConservativeRasterizationPropertiesEXT result; + + result.conservativePointAndLineRasterization = BOOL_TO_VK_BOOL32(conservative_point_and_line_rasterization); + result.conservativeRasterizationPostDepthCoverage = BOOL_TO_VK_BOOL32(conservative_rasterization_post_depth_coverage); + result.degenerateLinesRasterized = BOOL_TO_VK_BOOL32(degenerate_lines_rasterized); + result.degenerateTrianglesRasterized = BOOL_TO_VK_BOOL32(degenerate_triangles_rasterized); + result.extraPrimitiveOverestimationSizeGranularity = extra_primitive_overestimation_size_granularity; + result.fullyCoveredFragmentShaderInputVariable = BOOL_TO_VK_BOOL32(fully_covered_fragment_shader_input_variable); + result.maxExtraPrimitiveOverestimationSize = max_extra_primitive_overestimation_size; + result.pNext = nullptr; + result.primitiveOverestimationSize = primitive_overestimation_size; + result.primitiveUnderestimation = BOOL_TO_VK_BOOL32(primitive_underestimation); + result.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT); + + return result; +} + +Anvil::EXTDepthClipEnableFeatures::EXTDepthClipEnableFeatures() + :depth_clip_enable(false) +{ + /* Stub */ +} + +Anvil::EXTDepthClipEnableFeatures::EXTDepthClipEnableFeatures(const VkPhysicalDeviceDepthClipEnableFeaturesEXT& in_features) + :depth_clip_enable(VK_BOOL32_TO_BOOL(in_features.depthClipEnable) ) +{ + /* Stub */ +} + +VkPhysicalDeviceDepthClipEnableFeaturesEXT Anvil::EXTDepthClipEnableFeatures::get_vk_physical_device_depth_clip_enable_features() const +{ + VkPhysicalDeviceDepthClipEnableFeaturesEXT result; + + result.depthClipEnable = BOOL_TO_VK_BOOL32(depth_clip_enable); + result.pNext = nullptr; + result.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT; + + return result; +} + +bool Anvil::EXTDepthClipEnableFeatures::operator==(const EXTDepthClipEnableFeatures& in_features) const +{ + return (depth_clip_enable == in_features.depth_clip_enable); +} + Anvil::EXTDescriptorIndexingFeatures::EXTDescriptorIndexingFeatures() :descriptor_binding_partially_bound (false), descriptor_binding_sampled_image_update_after_bind (false), @@ -752,6 +850,67 @@ bool Anvil::EXTExternalMemoryHostProperties::operator==(const Anvil::EXTExternal return (min_imported_host_pointer_alignment == in_props.min_imported_host_pointer_alignment); } +Anvil::EXTInlineUniformBlockFeatures::EXTInlineUniformBlockFeatures() + :descriptor_binding_inline_uniform_block_update_after_bind(false), + inline_uniform_block (false) +{ + /* Stub */ +} + +Anvil::EXTInlineUniformBlockFeatures::EXTInlineUniformBlockFeatures(const VkPhysicalDeviceInlineUniformBlockFeaturesEXT& in_features) + :descriptor_binding_inline_uniform_block_update_after_bind(VK_BOOL32_TO_BOOL(in_features.descriptorBindingInlineUniformBlockUpdateAfterBind) ), + inline_uniform_block (VK_BOOL32_TO_BOOL(in_features.inlineUniformBlock) ) +{ + /* Stub */ +} + +VkPhysicalDeviceInlineUniformBlockFeaturesEXT Anvil::EXTInlineUniformBlockFeatures::get_vk_physical_device_inline_uniform_block_features() const +{ + VkPhysicalDeviceInlineUniformBlockFeaturesEXT result; + + result.descriptorBindingInlineUniformBlockUpdateAfterBind = BOOL_TO_VK_BOOL32(descriptor_binding_inline_uniform_block_update_after_bind); + result.inlineUniformBlock = BOOL_TO_VK_BOOL32(inline_uniform_block); + result.pNext = nullptr; + result.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT; + + return result; +} + +bool Anvil::EXTInlineUniformBlockFeatures::operator==(const EXTInlineUniformBlockFeatures& in_features) const +{ + return (in_features.descriptor_binding_inline_uniform_block_update_after_bind == descriptor_binding_inline_uniform_block_update_after_bind) && + (in_features.inline_uniform_block == inline_uniform_block); +} + +Anvil::EXTInlineUniformBlockProperties::EXTInlineUniformBlockProperties() + :max_descriptor_set_inline_uniform_blocks (0), + max_descriptor_set_update_after_bind_inline_uniform_blocks (0), + max_inline_uniform_block_size (0), + max_per_stage_descriptor_inline_uniform_blocks (0), + max_per_stage_descriptor_update_after_bind_inline_uniform_blocks(0) +{ + /* Stub */ +} + +Anvil::EXTInlineUniformBlockProperties::EXTInlineUniformBlockProperties(const VkPhysicalDeviceInlineUniformBlockPropertiesEXT& in_props) + :max_descriptor_set_inline_uniform_blocks (in_props.maxDescriptorSetInlineUniformBlocks), + max_descriptor_set_update_after_bind_inline_uniform_blocks (in_props.maxDescriptorSetUpdateAfterBindInlineUniformBlocks), + max_inline_uniform_block_size (in_props.maxInlineUniformBlockSize), + max_per_stage_descriptor_inline_uniform_blocks (in_props.maxPerStageDescriptorInlineUniformBlocks), + max_per_stage_descriptor_update_after_bind_inline_uniform_blocks(in_props.maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks) +{ + /* Stub */ +} + +bool Anvil::EXTInlineUniformBlockProperties::operator==(const EXTInlineUniformBlockProperties& in_props) const +{ + return (max_descriptor_set_inline_uniform_blocks == in_props.max_descriptor_set_inline_uniform_blocks) && + (max_descriptor_set_update_after_bind_inline_uniform_blocks == in_props.max_descriptor_set_update_after_bind_inline_uniform_blocks) && + (max_inline_uniform_block_size == in_props.max_inline_uniform_block_size) && + (max_per_stage_descriptor_inline_uniform_blocks == in_props.max_per_stage_descriptor_inline_uniform_blocks) && + (max_per_stage_descriptor_update_after_bind_inline_uniform_blocks == in_props.max_per_stage_descriptor_update_after_bind_inline_uniform_blocks); +} + Anvil::EXTPCIBusInfoProperties::EXTPCIBusInfoProperties() :pci_bus (0), pci_device (0), @@ -829,6 +988,33 @@ bool Anvil::EXTSamplerFilterMinmaxProperties::operator==(const Anvil::EXTSampler filter_minmax_single_component_formats == in_props.filter_minmax_single_component_formats); } +Anvil::EXTScalarBlockLayoutFeatures::EXTScalarBlockLayoutFeatures() + :scalar_block_layout(false) +{ + /* Stub */ +} + +Anvil::EXTScalarBlockLayoutFeatures::EXTScalarBlockLayoutFeatures(const VkPhysicalDeviceScalarBlockLayoutFeaturesEXT& in_features) +{ + scalar_block_layout = VK_BOOL32_TO_BOOL(in_features.scalarBlockLayout); +} + +VkPhysicalDeviceScalarBlockLayoutFeaturesEXT Anvil::EXTScalarBlockLayoutFeatures::get_vk_physical_device_scalar_block_layout_features_ext() const +{ + VkPhysicalDeviceScalarBlockLayoutFeaturesEXT result; + + result.pNext = nullptr; + result.scalarBlockLayout = BOOL_TO_VK_BOOL32(scalar_block_layout); + result.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT; + + return result; +} + +bool Anvil::EXTScalarBlockLayoutFeatures::operator==(const EXTScalarBlockLayoutFeatures& in_features) const +{ + return (in_features.scalar_block_layout == scalar_block_layout); +} + Anvil::EXTTransformFeedbackFeatures::EXTTransformFeedbackFeatures() :geometry_streams (false), transform_feedback(false) @@ -990,23 +1176,34 @@ Anvil::FormatProperties::FormatProperties(const VkFormatProperties& in_format_pr } Anvil::ImageFormatProperties::ImageFormatProperties() + :max_resource_size (0), + n_combined_image_sampler_descriptors_used(0), + n_max_array_layers (0), + n_max_mip_levels (0), + sample_counts (Anvil::SampleCountFlagBits::NONE), + supports_amd_texture_gather_bias_lod (false), + valid_stencil_aspect_image_usage_flags (Anvil::ImageUsageFlagBits::NONE) { - memset(this, - 0, - sizeof(*this) ); + max_extent.depth = 0; + max_extent.height = 0; + max_extent.width = 0; } Anvil::ImageFormatProperties::ImageFormatProperties(const VkImageFormatProperties& in_image_format_props, const bool& in_supports_amd_texture_gather_bias_lod, - const ExternalMemoryProperties& in_external_handle_properties) + const ExternalMemoryProperties& in_external_handle_properties, + const Anvil::ImageUsageFlags& in_valid_stencil_aspect_image_usage_flags, + const uint32_t& in_n_combined_image_sampler_descriptors_used) { - external_handle_properties = in_external_handle_properties; - max_extent = in_image_format_props.maxExtent; - max_resource_size = in_image_format_props.maxResourceSize; - n_max_array_layers = in_image_format_props.maxArrayLayers; - n_max_mip_levels = in_image_format_props.maxMipLevels; - sample_counts = static_cast(in_image_format_props.sampleCounts); - supports_amd_texture_gather_bias_lod = in_supports_amd_texture_gather_bias_lod; + external_handle_properties = in_external_handle_properties; + max_extent = in_image_format_props.maxExtent; + max_resource_size = in_image_format_props.maxResourceSize; + n_combined_image_sampler_descriptors_used = in_n_combined_image_sampler_descriptors_used; + n_max_array_layers = in_image_format_props.maxArrayLayers; + n_max_mip_levels = in_image_format_props.maxMipLevels; + sample_counts = static_cast(in_image_format_props.sampleCounts); + supports_amd_texture_gather_bias_lod = in_supports_amd_texture_gather_bias_lod; + valid_stencil_aspect_image_usage_flags = in_valid_stencil_aspect_image_usage_flags; } /** Please see header for specification */ @@ -1103,20 +1300,6 @@ bool Anvil::ImageBarrier::operator==(const ImageBarrier& in_barrier) const return result; } -Anvil::ImagePhysicalDeviceMemoryBindingUpdate::ImagePhysicalDeviceMemoryBindingUpdate() -{ - image_ptr = nullptr; - memory_block_ptr = nullptr; - memory_block_owned_by_image = false; -} - -Anvil::ImageSFRMemoryBindingUpdate::ImageSFRMemoryBindingUpdate() -{ - image_ptr = nullptr; - memory_block_owned_by_image = false; - memory_block_ptr = nullptr; -} - bool Anvil::ImageSubresourceRange::operator==(const Anvil::ImageSubresourceRange& in_subresource_range) const { return (aspect_mask == in_subresource_range.aspect_mask && @@ -1126,6 +1309,80 @@ bool Anvil::ImageSubresourceRange::operator==(const Anvil::ImageSubresourceRange layer_count == in_subresource_range.layer_count); } +Anvil::KHRSamplerYCbCrConversionFeatures::KHRSamplerYCbCrConversionFeatures() + :sampler_ycbcr_conversion(false) +{ + /* Stub */ +} + +Anvil::KHRSamplerYCbCrConversionFeatures::KHRSamplerYCbCrConversionFeatures(const VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR& in_features) + :sampler_ycbcr_conversion(VK_BOOL32_TO_BOOL(in_features.samplerYcbcrConversion) ) +{ + /* Stub */ +} + +VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR Anvil::KHRSamplerYCbCrConversionFeatures::get_vk_physical_device_sampler_ycbcr_conversion_features() const +{ + VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR result; + + result.pNext = nullptr; + result.samplerYcbcrConversion = BOOL_TO_VK_BOOL32(sampler_ycbcr_conversion); + result.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR; + + return result; +} + +bool Anvil::KHRSamplerYCbCrConversionFeatures::operator==(const Anvil::KHRSamplerYCbCrConversionFeatures& in_features) const +{ + return (in_features.sampler_ycbcr_conversion == sampler_ycbcr_conversion); +} + +Anvil::MemoryBudget::MemoryBudget() +{ + heap_budget.fill(0); + heap_usage.fill (0); +} + +Anvil::MemoryBudget::MemoryBudget(const VkPhysicalDeviceMemoryBudgetPropertiesEXT& in_properties) +{ + anvil_assert(heap_budget.size() == sizeof(in_properties.heapBudget) / sizeof(in_properties.heapBudget[0])); + anvil_assert(heap_usage.size() == sizeof(in_properties.heapUsage) / sizeof(in_properties.heapUsage[0])); + + memcpy(heap_budget.data(), + in_properties.heapBudget, + sizeof(in_properties.heapBudget)); + + memcpy(heap_usage.data(), + in_properties.heapUsage, + sizeof(in_properties.heapUsage)); +} + +Anvil::EXTMemoryPriorityFeatures::EXTMemoryPriorityFeatures() +{ + is_memory_priority_supported = false; +} + +Anvil::EXTMemoryPriorityFeatures::EXTMemoryPriorityFeatures(const VkPhysicalDeviceMemoryPriorityFeaturesEXT& in_features) +{ + is_memory_priority_supported = VK_BOOL32_TO_BOOL(in_features.memoryPriority); +} + +VkPhysicalDeviceMemoryPriorityFeaturesEXT Anvil::EXTMemoryPriorityFeatures::get_vk_physical_device_memory_priority_features() const +{ + VkPhysicalDeviceMemoryPriorityFeaturesEXT result; + + result.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT; + result.pNext = nullptr; + result.memoryPriority = BOOL_TO_VK_BOOL32(is_memory_priority_supported); + + return result; +} + +bool Anvil::EXTMemoryPriorityFeatures::operator==(const EXTMemoryPriorityFeatures& in_memory_priority_features) const +{ + return (is_memory_priority_supported == in_memory_priority_features.is_memory_priority_supported); +} + Anvil::KHR16BitStorageFeatures::KHR16BitStorageFeatures() { is_input_output_storage_supported = false; @@ -1199,6 +1456,122 @@ bool Anvil::KHR8BitStorageFeatures::operator==(const Anvil::KHR8BitStorageFeatur uniform_and_storage_buffer_8_bit_access == in_features.uniform_and_storage_buffer_8_bit_access); } +Anvil::KHRDepthStencilResolveProperties::KHRDepthStencilResolveProperties() +{ + independent_resolve = false; + independent_resolve_none = false; + supported_depth_resolve_modes = Anvil::ResolveModeFlagBits::NONE; + supported_stencil_resolve_modes = Anvil::ResolveModeFlagBits::NONE; +} + +Anvil::KHRDepthStencilResolveProperties::KHRDepthStencilResolveProperties(const VkPhysicalDeviceDepthStencilResolvePropertiesKHR& in_properties) +{ + independent_resolve = (in_properties.independentResolve == VK_TRUE); + independent_resolve_none = (in_properties.independentResolveNone == VK_TRUE); + supported_depth_resolve_modes = static_cast(in_properties.supportedDepthResolveModes); + supported_stencil_resolve_modes = static_cast(in_properties.supportedStencilResolveModes); +} + +bool Anvil::KHRDepthStencilResolveProperties::operator==(const Anvil::KHRDepthStencilResolveProperties& in_props) const +{ + return (in_props.independent_resolve == independent_resolve) && + (in_props.independent_resolve_none == independent_resolve_none) && + (in_props.supported_depth_resolve_modes == supported_depth_resolve_modes) && + (in_props.supported_stencil_resolve_modes == supported_stencil_resolve_modes); +} + + +Anvil::KHRDriverPropertiesProperties::KHRDriverPropertiesProperties() + :driver_id(Anvil::DriverIdKHR::UNKNOWN) +{ + memset(driver_info, + 0, + sizeof(driver_info) ); + memset(driver_name, + 0, + sizeof(driver_name) ); +} + +Anvil::KHRDriverPropertiesProperties::KHRDriverPropertiesProperties(const VkPhysicalDeviceDriverPropertiesKHR& in_properties) +{ + static_assert(sizeof(driver_info) == sizeof(in_properties.driverInfo), "Field size mismatch"); + static_assert(sizeof(driver_name) == sizeof(in_properties.driverName), "Field size mismatch"); + + conformance_version = Anvil::ConformanceVersionKHR (in_properties.conformanceVersion); + driver_id = static_cast(in_properties.driverID); + + memcpy(driver_info, + in_properties.driverInfo, + sizeof(driver_info) ); + memcpy(driver_name, + in_properties.driverName, + sizeof(driver_name) ); +} + +bool Anvil::KHRDriverPropertiesProperties::operator==(const KHRDriverPropertiesProperties& in_props) const +{ + bool result = false; + + if (!(in_props.conformance_version == conformance_version) ) + { + goto end; + } + + if (in_props.driver_id != driver_id) + { + goto end; + } + + if (memcmp(in_props.driver_info, + driver_info, + sizeof(driver_info) ) != 0) + { + goto end; + } + + if (memcmp(in_props.driver_name, + driver_name, + sizeof(driver_name) ) != 0) + { + goto end; + } + + result = true; +end: + return result; +} + + +Anvil::KHRFloat16Int8Features::KHRFloat16Int8Features() +{ + shader_float16 = false; + shader_int8 = false; +} + +Anvil::KHRFloat16Int8Features::KHRFloat16Int8Features(const VkPhysicalDeviceFloat16Int8FeaturesKHR& in_features) +{ + shader_float16 = (in_features.shaderFloat16 == VK_TRUE); + shader_int8 = (in_features.shaderInt8 == VK_TRUE); +} + +VkPhysicalDeviceFloat16Int8FeaturesKHR Anvil::KHRFloat16Int8Features::get_vk_physical_device_float16_int8_features() const +{ + VkPhysicalDeviceFloat16Int8FeaturesKHR result; + + result.pNext = nullptr; + result.shaderFloat16 = (shader_float16) ? VK_TRUE : VK_FALSE; + result.shaderInt8 = (shader_int8) ? VK_TRUE : VK_FALSE; + result.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR; + + return result; +} + +bool Anvil::KHRFloat16Int8Features::operator==(const Anvil::KHRFloat16Int8Features& in_features) const +{ + return (shader_float16 == in_features.shader_float16 && + shader_int8 == in_features.shader_int8); +} + Anvil::KHRMaintenance2PhysicalDevicePointClippingProperties::KHRMaintenance2PhysicalDevicePointClippingProperties() :point_clipping_behavior(PointClippingBehavior::UNKNOWN) { @@ -1288,6 +1661,130 @@ bool Anvil::KHRMultiviewProperties::operator==(const KHRMultiviewProperties& in_ max_multiview_view_count == in_props.max_multiview_view_count); } +Anvil::KHRShaderAtomicInt64Features::KHRShaderAtomicInt64Features() + :shader_buffer_int64_atomics(false), + shader_shared_int64_atomics(false) +{ + /* Stub */ +} + +Anvil::KHRShaderAtomicInt64Features::KHRShaderAtomicInt64Features(const VkPhysicalDeviceShaderAtomicInt64FeaturesKHR& in_features) +{ + shader_buffer_int64_atomics = VK_BOOL32_TO_BOOL(in_features.shaderBufferInt64Atomics); + shader_shared_int64_atomics = VK_BOOL32_TO_BOOL(in_features.shaderSharedInt64Atomics); +} + +VkPhysicalDeviceShaderAtomicInt64FeaturesKHR Anvil::KHRShaderAtomicInt64Features::get_vk_physical_device_shader_atomic_int64_features() const +{ + VkPhysicalDeviceShaderAtomicInt64FeaturesKHR result; + + result.pNext = nullptr; + result.shaderBufferInt64Atomics = BOOL_TO_VK_BOOL32(shader_buffer_int64_atomics); + result.shaderSharedInt64Atomics = BOOL_TO_VK_BOOL32(shader_shared_int64_atomics); + result.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR; + + return result; +} + +bool Anvil::KHRShaderAtomicInt64Features::operator==(const KHRShaderAtomicInt64Features& in_features) const +{ + return (in_features.shader_buffer_int64_atomics == shader_buffer_int64_atomics) && + (in_features.shader_shared_int64_atomics == shader_shared_int64_atomics); +} + +Anvil::KHRShaderFloatControlsProperties::KHRShaderFloatControlsProperties() + :separate_denorm_settings (false), + separate_rounding_mode_settings (false), + shader_denorm_flush_to_zero_float16 (false), + shader_denorm_flush_to_zero_float32 (false), + shader_denorm_flush_to_zero_float64 (false), + shader_denorm_preserve_float16 (false), + shader_denorm_preserve_float32 (false), + shader_denorm_preserve_float64 (false), + shader_rounding_mode_RTE_float16 (false), + shader_rounding_mode_RTE_float32 (false), + shader_rounding_mode_RTE_float64 (false), + shader_rounding_mode_RTZ_float16 (false), + shader_rounding_mode_RTZ_float32 (false), + shader_rounding_mode_RTZ_float64 (false), + shader_signed_zero_inf_nan_preserve_float16(false), + shader_signed_zero_inf_nan_preserve_float32(false), + shader_signed_zero_inf_nan_preserve_float64(false) +{ + /* Stub */ +} + +Anvil::KHRShaderFloatControlsProperties::KHRShaderFloatControlsProperties(const VkPhysicalDeviceFloatControlsPropertiesKHR& in_properties) + :separate_denorm_settings (VK_BOOL32_TO_BOOL(in_properties.separateDenormSettings) ), + separate_rounding_mode_settings (VK_BOOL32_TO_BOOL(in_properties.separateRoundingModeSettings) ), + shader_denorm_flush_to_zero_float16 (VK_BOOL32_TO_BOOL(in_properties.shaderDenormFlushToZeroFloat16) ), + shader_denorm_flush_to_zero_float32 (VK_BOOL32_TO_BOOL(in_properties.shaderDenormFlushToZeroFloat32) ), + shader_denorm_flush_to_zero_float64 (VK_BOOL32_TO_BOOL(in_properties.shaderDenormFlushToZeroFloat64) ), + shader_denorm_preserve_float16 (VK_BOOL32_TO_BOOL(in_properties.shaderDenormPreserveFloat16) ), + shader_denorm_preserve_float32 (VK_BOOL32_TO_BOOL(in_properties.shaderDenormPreserveFloat32) ), + shader_denorm_preserve_float64 (VK_BOOL32_TO_BOOL(in_properties.shaderDenormPreserveFloat64) ), + shader_rounding_mode_RTE_float16 (VK_BOOL32_TO_BOOL(in_properties.shaderRoundingModeRTEFloat16) ), + shader_rounding_mode_RTE_float32 (VK_BOOL32_TO_BOOL(in_properties.shaderRoundingModeRTEFloat32) ), + shader_rounding_mode_RTE_float64 (VK_BOOL32_TO_BOOL(in_properties.shaderRoundingModeRTEFloat64) ), + shader_rounding_mode_RTZ_float16 (VK_BOOL32_TO_BOOL(in_properties.shaderRoundingModeRTZFloat16) ), + shader_rounding_mode_RTZ_float32 (VK_BOOL32_TO_BOOL(in_properties.shaderRoundingModeRTZFloat32) ), + shader_rounding_mode_RTZ_float64 (VK_BOOL32_TO_BOOL(in_properties.shaderRoundingModeRTZFloat64) ), + shader_signed_zero_inf_nan_preserve_float16(VK_BOOL32_TO_BOOL(in_properties.shaderSignedZeroInfNanPreserveFloat16) ), + shader_signed_zero_inf_nan_preserve_float32(VK_BOOL32_TO_BOOL(in_properties.shaderSignedZeroInfNanPreserveFloat32) ), + shader_signed_zero_inf_nan_preserve_float64(VK_BOOL32_TO_BOOL(in_properties.shaderSignedZeroInfNanPreserveFloat64) ) +{ + /* Stub */ +} + +VkPhysicalDeviceFloatControlsPropertiesKHR Anvil::KHRShaderFloatControlsProperties::get_vk_physical_device_float_controls_properties() const +{ + VkPhysicalDeviceFloatControlsPropertiesKHR result; + + result.pNext = nullptr; + result.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR; + result.separateDenormSettings = separate_denorm_settings; + result.separateRoundingModeSettings = separate_rounding_mode_settings; + result.shaderDenormFlushToZeroFloat16 = shader_denorm_flush_to_zero_float16; + result.shaderDenormFlushToZeroFloat32 = shader_denorm_flush_to_zero_float32; + result.shaderDenormFlushToZeroFloat64 = shader_denorm_flush_to_zero_float64; + result.shaderDenormPreserveFloat16 = shader_denorm_preserve_float16; + result.shaderDenormPreserveFloat32 = shader_denorm_preserve_float32; + result.shaderDenormPreserveFloat64 = shader_denorm_preserve_float64; + result.shaderRoundingModeRTEFloat16 = shader_rounding_mode_RTE_float16; + result.shaderRoundingModeRTEFloat32 = shader_rounding_mode_RTE_float32; + result.shaderRoundingModeRTEFloat64 = shader_rounding_mode_RTE_float64; + result.shaderRoundingModeRTZFloat16 = shader_rounding_mode_RTZ_float16; + result.shaderRoundingModeRTZFloat32 = shader_rounding_mode_RTZ_float32; + result.shaderRoundingModeRTZFloat64 = shader_rounding_mode_RTZ_float64; + result.shaderSignedZeroInfNanPreserveFloat16 = shader_signed_zero_inf_nan_preserve_float16; + result.shaderSignedZeroInfNanPreserveFloat32 = shader_signed_zero_inf_nan_preserve_float32; + result.shaderSignedZeroInfNanPreserveFloat64 = shader_signed_zero_inf_nan_preserve_float64; + + return result; +} + +bool Anvil::KHRShaderFloatControlsProperties::operator==(const KHRShaderFloatControlsProperties& in_properties) const +{ + return + (separate_denorm_settings == in_properties.separate_denorm_settings) && + (separate_rounding_mode_settings == in_properties.separate_rounding_mode_settings) && + (shader_denorm_flush_to_zero_float16 == in_properties.shader_denorm_flush_to_zero_float16) && + (shader_denorm_flush_to_zero_float32 == in_properties.shader_denorm_flush_to_zero_float32) && + (shader_denorm_flush_to_zero_float64 == in_properties.shader_denorm_flush_to_zero_float64) && + (shader_denorm_preserve_float16 == in_properties.shader_denorm_preserve_float16) && + (shader_denorm_preserve_float32 == in_properties.shader_denorm_preserve_float32) && + (shader_denorm_preserve_float64 == in_properties.shader_denorm_preserve_float64) && + (shader_rounding_mode_RTE_float16 == in_properties.shader_rounding_mode_RTE_float16) && + (shader_rounding_mode_RTE_float32 == in_properties.shader_rounding_mode_RTE_float32) && + (shader_rounding_mode_RTE_float64 == in_properties.shader_rounding_mode_RTE_float64) && + (shader_rounding_mode_RTZ_float16 == in_properties.shader_rounding_mode_RTZ_float16) && + (shader_rounding_mode_RTZ_float32 == in_properties.shader_rounding_mode_RTZ_float32) && + (shader_rounding_mode_RTZ_float64 == in_properties.shader_rounding_mode_RTZ_float64) && + (shader_signed_zero_inf_nan_preserve_float16 == in_properties.shader_signed_zero_inf_nan_preserve_float16) && + (shader_signed_zero_inf_nan_preserve_float32 == in_properties.shader_signed_zero_inf_nan_preserve_float32) && + (shader_signed_zero_inf_nan_preserve_float64 == in_properties.shader_signed_zero_inf_nan_preserve_float64); +} + Anvil::KHRVariablePointerFeatures::KHRVariablePointerFeatures() { variable_pointers = false; @@ -1318,6 +1815,40 @@ bool Anvil::KHRVariablePointerFeatures::operator==(const Anvil::KHRVariablePoint variable_pointers_storage_buffer == in_props.variable_pointers_storage_buffer); } +Anvil::KHRVulkanMemoryModelFeatures::KHRVulkanMemoryModelFeatures() +{ + vulkan_memory_model = false; + vulkan_memory_model_availability_visibility_chains = false; + vulkan_memory_model_device_scope = false; +} + +Anvil::KHRVulkanMemoryModelFeatures::KHRVulkanMemoryModelFeatures(const VkPhysicalDeviceVulkanMemoryModelFeaturesKHR& in_features) +{ + vulkan_memory_model = VK_BOOL32_TO_BOOL(in_features.vulkanMemoryModel); + vulkan_memory_model_availability_visibility_chains = VK_BOOL32_TO_BOOL(in_features.vulkanMemoryModelAvailabilityVisibilityChains); + vulkan_memory_model_device_scope = VK_BOOL32_TO_BOOL(in_features.vulkanMemoryModelDeviceScope); +} + +VkPhysicalDeviceVulkanMemoryModelFeaturesKHR Anvil::KHRVulkanMemoryModelFeatures::get_vk_physical_device_vulkan_memory_model_features() const +{ + VkPhysicalDeviceVulkanMemoryModelFeaturesKHR result; + + result.pNext = nullptr; + result.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR; + result.vulkanMemoryModel = BOOL_TO_VK_BOOL32(vulkan_memory_model); + result.vulkanMemoryModelAvailabilityVisibilityChains = BOOL_TO_VK_BOOL32(vulkan_memory_model_availability_visibility_chains); + result.vulkanMemoryModelDeviceScope = BOOL_TO_VK_BOOL32(vulkan_memory_model_device_scope); + + return result; +} + +bool Anvil::KHRVulkanMemoryModelFeatures::operator==(const KHRVulkanMemoryModelFeatures& in_features) const +{ + return (in_features.vulkan_memory_model == vulkan_memory_model) && + (in_features.vulkan_memory_model_availability_visibility_chains == vulkan_memory_model_availability_visibility_chains) && + (in_features.vulkan_memory_model_device_scope == vulkan_memory_model_device_scope); +} + Anvil::Layer::Layer(const std::string& in_layer_name) { implementation_version = 0; @@ -2003,90 +2534,555 @@ Anvil::PhysicalDeviceProperties::PhysicalDeviceProperties() { amd_shader_core_properties_ptr = nullptr; core_vk1_0_properties_ptr = nullptr; + core_vk1_1_properties_ptr = nullptr; + ext_conservative_rasterization_properties_ptr = nullptr; ext_descriptor_indexing_properties_ptr = nullptr; ext_external_memory_host_properties_ptr = nullptr; + ext_inline_uniform_block_properties_ptr = nullptr; ext_pci_bus_info_properties_ptr = nullptr; ext_sample_locations_properties_ptr = nullptr; ext_sampler_filter_minmax_properties_ptr = nullptr; ext_transform_feedback_properties_ptr = nullptr; ext_vertex_attribute_divisor_properties_ptr = nullptr; + khr_depth_stencil_resolve_properties_ptr = nullptr; + khr_driver_properties_properties_ptr = nullptr; khr_external_memory_capabilities_physical_device_id_properties_ptr = nullptr; khr_maintenance2_point_clipping_properties_ptr = nullptr; khr_maintenance3_properties_ptr = nullptr; khr_multiview_properties_ptr = nullptr; + khr_shader_float_controls_properties_ptr = nullptr; } Anvil::PhysicalDeviceProperties::PhysicalDeviceProperties(const AMDShaderCoreProperties* in_amd_shader_core_properties_ptr, const PhysicalDevicePropertiesCoreVK10* in_core_vk1_0_properties_ptr, + const PhysicalDevicePropertiesCoreVK11* in_core_vk1_1_properties_ptr, + const EXTConservativeRasterizationProperties* in_ext_conservative_rasterization_properties_ptr, const EXTDescriptorIndexingProperties* in_ext_descriptor_indexing_properties_ptr, const EXTExternalMemoryHostProperties* in_ext_external_memory_host_properties_ptr, + const EXTInlineUniformBlockProperties* in_ext_inline_uniform_block_properties_ptr, const EXTPCIBusInfoProperties* in_ext_pci_bus_info_properties_ptr, const EXTSampleLocationsProperties* in_ext_sample_locations_properties_ptr, const EXTSamplerFilterMinmaxProperties* in_ext_sampler_filter_minmax_properties_ptr, const EXTTransformFeedbackProperties* in_ext_transform_feedback_properties_ptr, const EXTVertexAttributeDivisorProperties* in_ext_vertex_attribute_divisor_properties_ptr, + const Anvil::KHRDepthStencilResolveProperties* in_khr_depth_stencil_resolve_props_ptr, + const KHRDriverPropertiesProperties* in_khr_driver_properties_props_ptr, const Anvil::KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties* in_khr_external_memory_caps_physical_device_id_props_ptr, const KHRMaintenance3Properties* in_khr_maintenance3_properties_ptr, const Anvil::KHRMaintenance2PhysicalDevicePointClippingProperties* in_khr_maintenance2_point_clipping_properties_ptr, - const Anvil::KHRMultiviewProperties* in_khr_multiview_properties_ptr) + const Anvil::KHRMultiviewProperties* in_khr_multiview_properties_ptr, + const KHRShaderFloatControlsProperties* in_khr_shader_float_controls_properties_ptr) :amd_shader_core_properties_ptr (in_amd_shader_core_properties_ptr), core_vk1_0_properties_ptr (in_core_vk1_0_properties_ptr), + core_vk1_1_properties_ptr (in_core_vk1_1_properties_ptr), + ext_conservative_rasterization_properties_ptr (in_ext_conservative_rasterization_properties_ptr), ext_descriptor_indexing_properties_ptr (in_ext_descriptor_indexing_properties_ptr), ext_external_memory_host_properties_ptr (in_ext_external_memory_host_properties_ptr), + ext_inline_uniform_block_properties_ptr (in_ext_inline_uniform_block_properties_ptr), ext_pci_bus_info_properties_ptr (in_ext_pci_bus_info_properties_ptr), ext_sample_locations_properties_ptr (in_ext_sample_locations_properties_ptr), ext_sampler_filter_minmax_properties_ptr (in_ext_sampler_filter_minmax_properties_ptr), ext_transform_feedback_properties_ptr (in_ext_transform_feedback_properties_ptr), ext_vertex_attribute_divisor_properties_ptr (in_ext_vertex_attribute_divisor_properties_ptr), + khr_depth_stencil_resolve_properties_ptr (in_khr_depth_stencil_resolve_props_ptr), + khr_driver_properties_properties_ptr (in_khr_driver_properties_props_ptr), khr_external_memory_capabilities_physical_device_id_properties_ptr(in_khr_external_memory_caps_physical_device_id_props_ptr), khr_maintenance2_point_clipping_properties_ptr (in_khr_maintenance2_point_clipping_properties_ptr), khr_maintenance3_properties_ptr (in_khr_maintenance3_properties_ptr), - khr_multiview_properties_ptr (in_khr_multiview_properties_ptr) + khr_multiview_properties_ptr (in_khr_multiview_properties_ptr), + khr_shader_float_controls_properties_ptr (in_khr_shader_float_controls_properties_ptr) { /* Stub */ } -Anvil::PhysicalDevicePropertiesCoreVK10::PhysicalDevicePropertiesCoreVK10() - :api_version (UINT32_MAX), - device_id (UINT32_MAX), - device_type (VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM), - driver_version(UINT32_MAX), - vendor_id (UINT32_MAX) +bool Anvil::PhysicalDeviceProperties::operator==(const PhysicalDeviceProperties& in_props) const { - memset(device_name, - 0xFF, - sizeof(device_name) ); - memset(pipeline_cache_uuid, - 0xFF, - sizeof(pipeline_cache_uuid) ); -} - -Anvil::PhysicalDeviceFeatures::PhysicalDeviceFeatures() + bool amd_shader_core_properties_match = false; + const bool core_vk1_0_features_match = (*core_vk1_0_properties_ptr == *in_props.core_vk1_0_properties_ptr); + bool core_vk1_1_features_match = false; + bool ext_conservative_rasterization_properties_match = false; + bool ext_descriptor_indexing_properties_match = false; + bool ext_external_memory_host_properties_match = false; + bool ext_inline_uniform_block_properties_match = false; + bool ext_pci_bus_info_properties_match = false; + bool ext_sample_locations_properties_match = false; + bool ext_sampler_filter_minmax_properties_match = false; + bool ext_vertex_attribute_divisor_properties_match = false; + bool khr_depth_stencil_resolve_properties_match = false; + bool khr_driver_properties_properties_match = false; + bool khr_external_memory_capabilities_properties_match = false; + bool khr_maintenance2_properties_match = false; + bool khr_maintenance3_properties_match = false; + bool khr_multiview_properties_match = false; + bool khr_shader_float_controls_properties_match = false; + + if (amd_shader_core_properties_ptr != nullptr && + in_props.amd_shader_core_properties_ptr != nullptr) + { + amd_shader_core_properties_match = (*amd_shader_core_properties_ptr == *in_props.amd_shader_core_properties_ptr); + } + else + { + amd_shader_core_properties_match = (amd_shader_core_properties_ptr == nullptr && + in_props.amd_shader_core_properties_ptr == nullptr); + } + + if (core_vk1_1_properties_ptr != nullptr && + in_props.core_vk1_1_properties_ptr != nullptr) + { + core_vk1_1_features_match = (*core_vk1_1_properties_ptr == *in_props.core_vk1_1_properties_ptr); + } + else + { + core_vk1_1_features_match = (core_vk1_1_properties_ptr == nullptr && + in_props.core_vk1_1_properties_ptr == nullptr); + } + + if (ext_conservative_rasterization_properties_ptr != nullptr && + in_props.ext_conservative_rasterization_properties_ptr != nullptr) + { + ext_conservative_rasterization_properties_match = (*ext_conservative_rasterization_properties_ptr == *in_props.ext_conservative_rasterization_properties_ptr); + } + else + { + ext_conservative_rasterization_properties_match = (ext_conservative_rasterization_properties_ptr == nullptr && + in_props.ext_conservative_rasterization_properties_ptr == nullptr); + } + + if (ext_descriptor_indexing_properties_ptr != nullptr && + in_props.ext_descriptor_indexing_properties_ptr != nullptr) + { + ext_descriptor_indexing_properties_match = (*ext_descriptor_indexing_properties_ptr == *in_props.ext_descriptor_indexing_properties_ptr); + } + else + { + ext_descriptor_indexing_properties_match = (ext_descriptor_indexing_properties_ptr == nullptr && + in_props.ext_descriptor_indexing_properties_ptr == nullptr); + } + + if (ext_external_memory_host_properties_ptr != nullptr && + in_props.ext_external_memory_host_properties_ptr != nullptr) + { + ext_external_memory_host_properties_match = (*ext_external_memory_host_properties_ptr == *in_props.ext_external_memory_host_properties_ptr); + } + else + { + ext_external_memory_host_properties_match = (ext_external_memory_host_properties_ptr == nullptr && + in_props.ext_external_memory_host_properties_ptr == nullptr); + } + + if (ext_inline_uniform_block_properties_ptr != nullptr && + in_props.ext_inline_uniform_block_properties_ptr != nullptr) + { + ext_inline_uniform_block_properties_match = (*ext_inline_uniform_block_properties_ptr == *in_props.ext_inline_uniform_block_properties_ptr); + } + else + { + ext_inline_uniform_block_properties_match = (ext_inline_uniform_block_properties_ptr == nullptr && + in_props.ext_inline_uniform_block_properties_ptr == nullptr); + } + + if (ext_pci_bus_info_properties_ptr != nullptr && + in_props.ext_pci_bus_info_properties_ptr != nullptr) + { + ext_pci_bus_info_properties_match = (*ext_pci_bus_info_properties_ptr == *in_props.ext_pci_bus_info_properties_ptr); + } + else + { + ext_pci_bus_info_properties_match = (ext_pci_bus_info_properties_ptr == nullptr && + in_props.ext_pci_bus_info_properties_ptr == nullptr); + } + + if (ext_sample_locations_properties_ptr != nullptr && + in_props.ext_sample_locations_properties_ptr != nullptr) + { + ext_sample_locations_properties_match = (*ext_sample_locations_properties_ptr == *in_props.ext_sample_locations_properties_ptr); + } + else + { + ext_sample_locations_properties_match = (ext_sample_locations_properties_ptr == nullptr && + in_props.ext_sample_locations_properties_ptr == nullptr); + } + + if (ext_sampler_filter_minmax_properties_ptr != nullptr && + in_props.ext_sampler_filter_minmax_properties_ptr != nullptr) + { + ext_sampler_filter_minmax_properties_match = (*ext_sampler_filter_minmax_properties_ptr == *in_props.ext_sampler_filter_minmax_properties_ptr); + } + else + { + ext_sampler_filter_minmax_properties_match = (ext_sampler_filter_minmax_properties_ptr == nullptr && + in_props.ext_sampler_filter_minmax_properties_ptr == nullptr); + } + + if (ext_vertex_attribute_divisor_properties_ptr != nullptr && + in_props.ext_vertex_attribute_divisor_properties_ptr != nullptr) + { + ext_vertex_attribute_divisor_properties_match = (*ext_vertex_attribute_divisor_properties_ptr == *in_props.ext_vertex_attribute_divisor_properties_ptr); + } + else + { + ext_vertex_attribute_divisor_properties_match = (ext_vertex_attribute_divisor_properties_ptr == nullptr && + in_props.ext_vertex_attribute_divisor_properties_ptr == nullptr); + } + + if (khr_depth_stencil_resolve_properties_ptr != nullptr && + in_props.khr_depth_stencil_resolve_properties_ptr != nullptr) + { + khr_depth_stencil_resolve_properties_match = (*khr_depth_stencil_resolve_properties_ptr == *in_props.khr_depth_stencil_resolve_properties_ptr); + } + else + { + khr_depth_stencil_resolve_properties_match = (khr_depth_stencil_resolve_properties_ptr == nullptr && + in_props.khr_depth_stencil_resolve_properties_ptr == nullptr); + } + + if (khr_driver_properties_properties_ptr != nullptr && + in_props.khr_driver_properties_properties_ptr != nullptr) + { + khr_driver_properties_properties_match = (*khr_driver_properties_properties_ptr == *in_props.khr_driver_properties_properties_ptr); + } + else + { + khr_driver_properties_properties_match = (khr_driver_properties_properties_ptr == nullptr && + in_props.khr_driver_properties_properties_ptr == nullptr); + } + + if (khr_external_memory_capabilities_physical_device_id_properties_ptr != nullptr && + in_props.khr_external_memory_capabilities_physical_device_id_properties_ptr!= nullptr) + { + khr_external_memory_capabilities_properties_match = (*khr_external_memory_capabilities_physical_device_id_properties_ptr == *in_props.khr_external_memory_capabilities_physical_device_id_properties_ptr); + } + else + { + khr_external_memory_capabilities_properties_match = (khr_external_memory_capabilities_physical_device_id_properties_ptr == nullptr && + in_props.khr_external_memory_capabilities_physical_device_id_properties_ptr == nullptr); + } + + if (khr_maintenance2_point_clipping_properties_ptr != nullptr && + in_props.khr_maintenance2_point_clipping_properties_ptr != nullptr) + { + khr_maintenance2_properties_match = (*khr_maintenance2_point_clipping_properties_ptr == *in_props.khr_maintenance2_point_clipping_properties_ptr); + } + else + { + khr_maintenance2_properties_match = (khr_maintenance2_point_clipping_properties_ptr == nullptr && + in_props.khr_maintenance2_point_clipping_properties_ptr == nullptr); + } + + if (khr_maintenance3_properties_ptr != nullptr && + in_props.khr_maintenance3_properties_ptr != nullptr) + { + khr_maintenance3_properties_match = (*khr_maintenance3_properties_ptr == *in_props.khr_maintenance3_properties_ptr); + } + else + { + khr_maintenance3_properties_match = (khr_maintenance3_properties_ptr == nullptr && + in_props.khr_maintenance3_properties_ptr == nullptr); + } + + if (khr_multiview_properties_ptr != nullptr && + in_props.khr_multiview_properties_ptr != nullptr) + { + khr_multiview_properties_match = (*khr_multiview_properties_ptr == *in_props.khr_multiview_properties_ptr); + } + else + { + khr_multiview_properties_match = (khr_multiview_properties_ptr == nullptr && + in_props.khr_multiview_properties_ptr == nullptr); + } + + if (khr_shader_float_controls_properties_ptr != nullptr && + in_props.khr_shader_float_controls_properties_ptr != nullptr) + { + khr_shader_float_controls_properties_match = (*khr_shader_float_controls_properties_ptr == *in_props.khr_shader_float_controls_properties_ptr); + } + else + { + khr_shader_float_controls_properties_match = (khr_shader_float_controls_properties_ptr == nullptr && + in_props.khr_shader_float_controls_properties_ptr == nullptr); + } + + return amd_shader_core_properties_match && + core_vk1_0_features_match && + core_vk1_1_features_match && + ext_conservative_rasterization_properties_match && + ext_descriptor_indexing_properties_match && + ext_external_memory_host_properties_match && + ext_inline_uniform_block_properties_match && + ext_pci_bus_info_properties_match && + ext_sample_locations_properties_match && + ext_sampler_filter_minmax_properties_match && + ext_vertex_attribute_divisor_properties_match && + khr_depth_stencil_resolve_properties_match && + khr_driver_properties_properties_match && + khr_external_memory_capabilities_properties_match && + khr_maintenance2_properties_match && + khr_maintenance3_properties_match && + khr_multiview_properties_match && + khr_shader_float_controls_properties_match; +} + +Anvil::PhysicalDevicePropertiesCoreVK10::PhysicalDevicePropertiesCoreVK10() + :api_version (UINT32_MAX), + device_id (UINT32_MAX), + device_type (VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM), + driver_version(UINT32_MAX), + vendor_id (UINT32_MAX) { - core_vk1_0_features_ptr = nullptr; - ext_descriptor_indexing_features_ptr = nullptr; - ext_transform_feedback_features_ptr = nullptr; - khr_16bit_storage_features_ptr = nullptr; - khr_8bit_storage_features_ptr = nullptr; - khr_multiview_features_ptr = nullptr; - khr_variable_pointer_features_ptr = nullptr; + memset(device_name, + 0xFF, + sizeof(device_name) ); + memset(pipeline_cache_uuid, + 0xFF, + sizeof(pipeline_cache_uuid) ); +} + +Anvil::PhysicalDevicePropertiesCoreVK11::PhysicalDevicePropertiesCoreVK11() +{ + /* Stub */ } -Anvil::PhysicalDeviceFeatures::PhysicalDeviceFeatures(const PhysicalDeviceFeaturesCoreVK10* in_core_vk1_0_features_ptr, - const EXTDescriptorIndexingFeatures* in_ext_descriptor_indexing_features_ptr, - const EXTTransformFeedbackFeatures* in_ext_transform_feedback_features_ptr, - const KHR16BitStorageFeatures* in_khr_16_bit_storage_features_ptr, - const KHR8BitStorageFeatures* in_khr_8_bit_storage_features_ptr, - const KHRMultiviewFeatures* in_khr_multiview_features_ptr, - const KHRVariablePointerFeatures* in_khr_variable_pointer_features_ptr) +Anvil::PhysicalDeviceFeatures::PhysicalDeviceFeatures() +{ + core_vk1_0_features_ptr = nullptr; + core_vk1_1_features_ptr = nullptr; + ext_depth_clip_enable_features_ptr = nullptr; + ext_descriptor_indexing_features_ptr = nullptr; + ext_inline_uniform_block_features_ptr = nullptr; + ext_scalar_block_layout_features_ptr = nullptr; + ext_transform_feedback_features_ptr = nullptr; + ext_memory_priority_features_ptr = nullptr; + khr_16bit_storage_features_ptr = nullptr; + khr_8bit_storage_features_ptr = nullptr; + khr_float16_int8_features_ptr = nullptr; + khr_multiview_features_ptr = nullptr; + khr_sampler_ycbcr_conversion_features_ptr = nullptr; + khr_shader_atomic_int64_features_ptr = nullptr; + khr_variable_pointer_features_ptr = nullptr; + khr_vulkan_memory_model_features_ptr = nullptr; +} + +Anvil::PhysicalDeviceFeatures::PhysicalDeviceFeatures(const PhysicalDeviceFeaturesCoreVK10* in_core_vk1_0_features_ptr, + const PhysicalDeviceFeaturesCoreVK11* in_core_vk1_1_features_ptr, + const EXTDepthClipEnableFeatures* in_ext_depth_clip_enable_features_ptr, + const EXTDescriptorIndexingFeatures* in_ext_descriptor_indexing_features_ptr, + const EXTInlineUniformBlockFeatures* in_ext_inline_uniform_block_features_ptr, + const EXTScalarBlockLayoutFeatures* in_ext_scalar_block_layout_features_ptr, + const EXTTransformFeedbackFeatures* in_ext_transform_feedback_features_ptr, + const EXTMemoryPriorityFeatures* in_ext_memory_priority_features_ptr, + const KHR16BitStorageFeatures* in_khr_16_bit_storage_features_ptr, + const KHR8BitStorageFeatures* in_khr_8_bit_storage_features_ptr, + const KHRFloat16Int8Features* in_khr_float16_int8_features_ptr, + const KHRMultiviewFeatures* in_khr_multiview_features_ptr, + const KHRSamplerYCbCrConversionFeatures* in_khr_sampler_ycbcr_conversion_features_ptr, + const KHRShaderAtomicInt64Features* in_khr_shader_atomic_int64_features_ptr, + const KHRVariablePointerFeatures* in_khr_variable_pointer_features_ptr, + const KHRVulkanMemoryModelFeatures* in_khr_vulkan_memory_model_features_ptr) +{ + core_vk1_0_features_ptr = in_core_vk1_0_features_ptr; + core_vk1_1_features_ptr = in_core_vk1_1_features_ptr; + ext_depth_clip_enable_features_ptr = in_ext_depth_clip_enable_features_ptr; + ext_descriptor_indexing_features_ptr = in_ext_descriptor_indexing_features_ptr; + ext_inline_uniform_block_features_ptr = in_ext_inline_uniform_block_features_ptr; + ext_scalar_block_layout_features_ptr = in_ext_scalar_block_layout_features_ptr; + ext_transform_feedback_features_ptr = in_ext_transform_feedback_features_ptr; + ext_memory_priority_features_ptr = in_ext_memory_priority_features_ptr; + khr_16bit_storage_features_ptr = in_khr_16_bit_storage_features_ptr; + khr_8bit_storage_features_ptr = in_khr_8_bit_storage_features_ptr; + khr_float16_int8_features_ptr = in_khr_float16_int8_features_ptr; + khr_multiview_features_ptr = in_khr_multiview_features_ptr; + khr_sampler_ycbcr_conversion_features_ptr = in_khr_sampler_ycbcr_conversion_features_ptr; + khr_shader_atomic_int64_features_ptr = in_khr_shader_atomic_int64_features_ptr; + khr_variable_pointer_features_ptr = in_khr_variable_pointer_features_ptr; + khr_vulkan_memory_model_features_ptr = in_khr_vulkan_memory_model_features_ptr; +} + +bool Anvil::PhysicalDeviceFeatures::operator==(const PhysicalDeviceFeatures& in_physical_device_features) const { - core_vk1_0_features_ptr = in_core_vk1_0_features_ptr; - ext_descriptor_indexing_features_ptr = in_ext_descriptor_indexing_features_ptr; - ext_transform_feedback_features_ptr = in_ext_transform_feedback_features_ptr; - khr_16bit_storage_features_ptr = in_khr_16_bit_storage_features_ptr; - khr_8bit_storage_features_ptr = in_khr_8_bit_storage_features_ptr; - khr_multiview_features_ptr = in_khr_multiview_features_ptr; - khr_variable_pointer_features_ptr = in_khr_variable_pointer_features_ptr; + const bool core_vk1_0_features_match = (*core_vk1_0_features_ptr == *in_physical_device_features.core_vk1_0_features_ptr); + const bool core_vk1_1_features_match = ( core_vk1_1_features_ptr == nullptr && in_physical_device_features.core_vk1_1_features_ptr == nullptr) || + (*core_vk1_1_features_ptr == *in_physical_device_features.core_vk1_1_features_ptr); + bool ext_depth_clip_enable_features_match = false; + bool ext_descriptor_indexing_features_match = false; + bool ext_inline_uniform_block_features_match = false; + bool ext_scalar_block_layout_features_match = false; + bool ext_transform_feedback_features_match = false; + bool ext_memory_priority_features_match = false; + bool khr_16bit_storage_features_match = false; + bool khr_8bit_storage_features_match = false; + bool khr_float16_int8_features_match = false; + bool khr_multiview_features_match = false; + bool khr_sampler_ycbcr_conversion_features_match = false; + bool khr_shader_atomic_int64_features_match = false; + bool khr_variable_pointer_features_match = false; + bool khr_vulkan_memory_features_match = false; + + if (ext_depth_clip_enable_features_ptr != nullptr && + in_physical_device_features.ext_depth_clip_enable_features_ptr != nullptr) + { + ext_depth_clip_enable_features_match = (*ext_depth_clip_enable_features_ptr == *in_physical_device_features.ext_depth_clip_enable_features_ptr); + } + else + { + ext_depth_clip_enable_features_match = (ext_depth_clip_enable_features_ptr == nullptr && + in_physical_device_features.ext_depth_clip_enable_features_ptr == nullptr); + } + + if (ext_descriptor_indexing_features_ptr != nullptr && + in_physical_device_features.ext_descriptor_indexing_features_ptr != nullptr) + { + ext_descriptor_indexing_features_match = (*ext_descriptor_indexing_features_ptr == *in_physical_device_features.ext_descriptor_indexing_features_ptr); + } + else + { + ext_descriptor_indexing_features_match = (ext_descriptor_indexing_features_ptr == nullptr && + in_physical_device_features.ext_descriptor_indexing_features_ptr == nullptr); + } + + if (ext_inline_uniform_block_features_ptr != nullptr && + in_physical_device_features.ext_inline_uniform_block_features_ptr != nullptr) + { + ext_inline_uniform_block_features_match = (*ext_inline_uniform_block_features_ptr == *in_physical_device_features.ext_inline_uniform_block_features_ptr); + } + else + { + ext_inline_uniform_block_features_match = (ext_inline_uniform_block_features_ptr == nullptr && + in_physical_device_features.ext_inline_uniform_block_features_ptr == nullptr); + } + + if (ext_scalar_block_layout_features_ptr != nullptr && + in_physical_device_features.ext_scalar_block_layout_features_ptr != nullptr) + { + ext_scalar_block_layout_features_match = (*ext_scalar_block_layout_features_ptr == *in_physical_device_features.ext_scalar_block_layout_features_ptr); + } + else + { + ext_scalar_block_layout_features_match = (ext_scalar_block_layout_features_ptr == nullptr && + in_physical_device_features.ext_scalar_block_layout_features_ptr == nullptr); + } + + if (ext_transform_feedback_features_ptr != nullptr && + in_physical_device_features.ext_transform_feedback_features_ptr != nullptr) + { + ext_transform_feedback_features_match = (*ext_transform_feedback_features_ptr == *in_physical_device_features.ext_transform_feedback_features_ptr); + } + else + { + ext_transform_feedback_features_match = (ext_transform_feedback_features_ptr == nullptr && + in_physical_device_features.ext_transform_feedback_features_ptr == nullptr); + } + + if (ext_memory_priority_features_ptr != nullptr && + in_physical_device_features.ext_memory_priority_features_ptr != nullptr) + { + ext_memory_priority_features_match = (*ext_memory_priority_features_ptr == *in_physical_device_features.ext_memory_priority_features_ptr); + } + + if (khr_16bit_storage_features_ptr != nullptr && + in_physical_device_features.khr_16bit_storage_features_ptr != nullptr) + { + khr_16bit_storage_features_match = (*khr_16bit_storage_features_ptr == *in_physical_device_features.khr_16bit_storage_features_ptr); + } + else + { + khr_16bit_storage_features_match = (khr_16bit_storage_features_ptr == nullptr && + in_physical_device_features.khr_16bit_storage_features_ptr == nullptr); + } + + if (khr_8bit_storage_features_ptr != nullptr && + in_physical_device_features.khr_8bit_storage_features_ptr != nullptr) + { + khr_8bit_storage_features_match = (*khr_8bit_storage_features_ptr == *in_physical_device_features.khr_8bit_storage_features_ptr); + } + else + { + khr_8bit_storage_features_match = (khr_8bit_storage_features_ptr == nullptr && + in_physical_device_features.khr_8bit_storage_features_ptr == nullptr); + } + + if (khr_float16_int8_features_ptr != nullptr && + in_physical_device_features.khr_float16_int8_features_ptr != nullptr) + { + khr_float16_int8_features_match = (*khr_float16_int8_features_ptr == *in_physical_device_features.khr_float16_int8_features_ptr); + } + else + { + khr_float16_int8_features_match = (khr_float16_int8_features_ptr == nullptr && + in_physical_device_features.khr_float16_int8_features_ptr == nullptr); + } + + if (khr_multiview_features_ptr != nullptr && + in_physical_device_features.khr_multiview_features_ptr != nullptr) + { + khr_multiview_features_match = (*khr_multiview_features_ptr == *in_physical_device_features.khr_multiview_features_ptr); + } + else + { + khr_multiview_features_match = (khr_multiview_features_ptr == nullptr && + in_physical_device_features.khr_multiview_features_ptr == nullptr); + } + + if (khr_sampler_ycbcr_conversion_features_ptr != nullptr && + in_physical_device_features.khr_sampler_ycbcr_conversion_features_ptr != nullptr) + { + khr_sampler_ycbcr_conversion_features_match = (*khr_sampler_ycbcr_conversion_features_ptr == *in_physical_device_features.khr_sampler_ycbcr_conversion_features_ptr); + } + else + { + khr_sampler_ycbcr_conversion_features_match = (khr_sampler_ycbcr_conversion_features_ptr == nullptr && + in_physical_device_features.khr_sampler_ycbcr_conversion_features_ptr == nullptr); + } + + if (khr_shader_atomic_int64_features_ptr != nullptr && + in_physical_device_features.khr_shader_atomic_int64_features_ptr != nullptr) + { + khr_shader_atomic_int64_features_match = (*khr_shader_atomic_int64_features_ptr == *in_physical_device_features.khr_shader_atomic_int64_features_ptr); + } + else + { + khr_shader_atomic_int64_features_match = (khr_shader_atomic_int64_features_ptr == nullptr && + in_physical_device_features.khr_shader_atomic_int64_features_ptr == nullptr); + } + + if (khr_variable_pointer_features_ptr != nullptr && + in_physical_device_features.khr_variable_pointer_features_ptr != nullptr) + { + khr_variable_pointer_features_match = (*khr_variable_pointer_features_ptr == *in_physical_device_features.khr_variable_pointer_features_ptr); + } + else + { + khr_variable_pointer_features_match = (khr_variable_pointer_features_ptr == nullptr && + in_physical_device_features.khr_variable_pointer_features_ptr == nullptr); + } + + if (khr_vulkan_memory_model_features_ptr != nullptr && + in_physical_device_features.khr_vulkan_memory_model_features_ptr != nullptr) + { + khr_vulkan_memory_features_match = (*khr_vulkan_memory_model_features_ptr == *in_physical_device_features.khr_vulkan_memory_model_features_ptr); + } + else + { + khr_vulkan_memory_features_match = (khr_vulkan_memory_model_features_ptr == nullptr && + in_physical_device_features.khr_vulkan_memory_model_features_ptr == nullptr); + } + + return core_vk1_0_features_match && + core_vk1_1_features_match && + ext_depth_clip_enable_features_match && + ext_descriptor_indexing_features_match && + ext_inline_uniform_block_features_match && + ext_scalar_block_layout_features_match && + ext_transform_feedback_features_match && + ext_memory_priority_features_match && + khr_16bit_storage_features_match && + khr_8bit_storage_features_match && + khr_float16_int8_features_match && + khr_multiview_features_match && + khr_sampler_ycbcr_conversion_features_match && + khr_shader_atomic_int64_features_match && + khr_variable_pointer_features_match && + khr_vulkan_memory_features_match; } Anvil::PhysicalDeviceGroup::PhysicalDeviceGroup() @@ -2560,6 +3556,14 @@ Anvil::PhysicalDevicePropertiesCoreVK10::PhysicalDevicePropertiesCoreVK10(const sizeof(pipeline_cache_uuid) ); } +Anvil::PhysicalDevicePropertiesCoreVK11::PhysicalDevicePropertiesCoreVK11(const VkPhysicalDeviceProtectedMemoryProperties& in_protected_memory_properties, + const VkPhysicalDeviceSubgroupProperties& in_subgroup_properties) + :protected_memory_properties(in_protected_memory_properties), + subgroup_properties (in_subgroup_properties) +{ + /* Stub */ +} + bool Anvil::PhysicalDevicePropertiesCoreVK10::operator==(const PhysicalDevicePropertiesCoreVK10& in_props) const { bool result = false; @@ -2586,6 +3590,63 @@ bool Anvil::PhysicalDevicePropertiesCoreVK10::operator==(const PhysicalDevicePro return result; } +bool Anvil::PhysicalDevicePropertiesCoreVK11::operator==(const PhysicalDevicePropertiesCoreVK11& in_props) const +{ + bool result = false; + + if (protected_memory_properties == in_props.protected_memory_properties && + subgroup_properties == in_props.subgroup_properties) + { + result = true; + } + + return result; +} + +Anvil::PhysicalDeviceProtectedMemoryFeatures::PhysicalDeviceProtectedMemoryFeatures() + :protected_memory(false) +{ + /* Stub */ +} + +Anvil::PhysicalDeviceProtectedMemoryFeatures::PhysicalDeviceProtectedMemoryFeatures(const VkPhysicalDeviceProtectedMemoryFeatures& in_features) +{ + protected_memory = VK_BOOL32_TO_BOOL(in_features.protectedMemory); +} + +VkPhysicalDeviceProtectedMemoryFeatures Anvil::PhysicalDeviceProtectedMemoryFeatures::get_vk_physical_device_protected_memory_features() const +{ + VkPhysicalDeviceProtectedMemoryFeatures result; + + result.pNext = nullptr; + result.protectedMemory = BOOL_TO_VK_BOOL32(protected_memory); + result.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES; + + return result; +} + +bool Anvil::PhysicalDeviceProtectedMemoryFeatures::operator==(const PhysicalDeviceProtectedMemoryFeatures& in_features) const +{ + return (protected_memory == in_features.protected_memory); +} + +Anvil::PhysicalDeviceProtectedMemoryProperties::PhysicalDeviceProtectedMemoryProperties() + :protected_no_fault(false) +{ + /* Stub */ +} + +Anvil::PhysicalDeviceProtectedMemoryProperties::PhysicalDeviceProtectedMemoryProperties(const VkPhysicalDeviceProtectedMemoryProperties& in_props) + :protected_no_fault(VK_BOOL32_TO_BOOL(in_props.protectedNoFault) ) +{ + /* Stub */ +} + +bool Anvil::PhysicalDeviceProtectedMemoryProperties::operator==(const PhysicalDeviceProtectedMemoryProperties& in_props) const +{ + return (protected_no_fault == in_props.protected_no_fault); +} + Anvil::PhysicalDeviceSparseProperties::PhysicalDeviceSparseProperties() :residency_standard_2D_block_shape (false), residency_standard_2D_multisample_block_shape(false), @@ -2615,6 +3676,30 @@ bool Anvil::PhysicalDeviceSparseProperties::operator==(const Anvil::PhysicalDevi residency_non_resident_strict == in_props.residency_non_resident_strict); } +Anvil::PhysicalDeviceSubgroupProperties::PhysicalDeviceSubgroupProperties() +{ + quad_operations_in_all_stages = false; + subgroup_size = 0; + supported_operations = Anvil::SubgroupFeatureFlagBits::NONE; + supported_stages = Anvil::ShaderStageFlagBits::NONE; +} + +Anvil::PhysicalDeviceSubgroupProperties::PhysicalDeviceSubgroupProperties(const VkPhysicalDeviceSubgroupProperties & in_props) +{ + quad_operations_in_all_stages = (in_props.quadOperationsInAllStages == VK_TRUE); + subgroup_size = in_props.subgroupSize; + supported_operations = static_cast(in_props.supportedOperations); + supported_stages = static_cast(in_props.supportedStages); +} + +bool Anvil::PhysicalDeviceSubgroupProperties::operator==(const PhysicalDeviceSubgroupProperties& in_props) const +{ + return (quad_operations_in_all_stages == in_props.quad_operations_in_all_stages && + subgroup_size == in_props.subgroup_size && + supported_operations == in_props.supported_operations && + supported_stages == in_props.supported_stages); +} + Anvil::PushConstantRange::PushConstantRange(uint32_t in_offset, uint32_t in_size, Anvil::ShaderStageFlags in_stages) @@ -2633,10 +3718,10 @@ bool Anvil::PushConstantRange::operator==(const PushConstantRange& in) const Anvil::QueueFamilyInfo::QueueFamilyInfo(const VkQueueFamilyProperties& in_props) { - flags = static_cast(in_props.queueFlags); - min_image_transfer_granularity = in_props.minImageTransferGranularity; - n_queues = in_props.queueCount; - n_timestamp_bits = in_props.timestampValidBits; + flags = static_cast(in_props.queueFlags); + min_image_transfer_granularity = in_props.minImageTransferGranularity; + n_queues = in_props.queueCount; + n_timestamp_bits = in_props.timestampValidBits; } /** Please see header for specification */ @@ -2760,91 +3845,6 @@ Anvil::SpecializationConstant::SpecializationConstant(uint32_t in_constant_id, start_offset = in_start_offset; } -bool Anvil::PhysicalDeviceFeatures::operator==(const PhysicalDeviceFeatures& in_physical_device_features) const -{ - const bool core_vk1_0_features_match = (*core_vk1_0_features_ptr == *in_physical_device_features.core_vk1_0_features_ptr); - bool ext_descriptor_indexing_features_match = false; - bool ext_transform_feedback_features_match = false; - bool khr_16bit_storage_features_match = false; - bool khr_8bit_storage_features_match = false; - bool khr_multiview_features_match = false; - bool khr_variable_pointer_features_match = false; - - if (ext_descriptor_indexing_features_ptr != nullptr && - in_physical_device_features.ext_descriptor_indexing_features_ptr != nullptr) - { - ext_descriptor_indexing_features_match = (*ext_descriptor_indexing_features_ptr == *in_physical_device_features.ext_descriptor_indexing_features_ptr); - } - else - { - ext_descriptor_indexing_features_match = (ext_descriptor_indexing_features_ptr == nullptr && - in_physical_device_features.ext_descriptor_indexing_features_ptr == nullptr); - } - - if (ext_transform_feedback_features_ptr != nullptr && - in_physical_device_features.ext_transform_feedback_features_ptr != nullptr) - { - ext_transform_feedback_features_match = (*ext_transform_feedback_features_ptr == *in_physical_device_features.ext_transform_feedback_features_ptr); - } - else - { - ext_transform_feedback_features_match = (ext_transform_feedback_features_ptr == nullptr && - in_physical_device_features.ext_transform_feedback_features_ptr == nullptr); - } - - if (khr_16bit_storage_features_ptr != nullptr && - in_physical_device_features.khr_16bit_storage_features_ptr != nullptr) - { - khr_16bit_storage_features_match = (*khr_16bit_storage_features_ptr == *in_physical_device_features.khr_16bit_storage_features_ptr); - } - else - { - khr_16bit_storage_features_match = (khr_16bit_storage_features_ptr == nullptr && - in_physical_device_features.khr_16bit_storage_features_ptr == nullptr); - } - - if (khr_8bit_storage_features_ptr != nullptr && - in_physical_device_features.khr_8bit_storage_features_ptr != nullptr) - { - khr_8bit_storage_features_match = (*khr_8bit_storage_features_ptr == *in_physical_device_features.khr_8bit_storage_features_ptr); - } - else - { - khr_8bit_storage_features_match = (khr_8bit_storage_features_ptr == nullptr && - in_physical_device_features.khr_8bit_storage_features_ptr == nullptr); - } - - if (khr_multiview_features_ptr != nullptr && - in_physical_device_features.khr_multiview_features_ptr != nullptr) - { - khr_multiview_features_match = (*khr_multiview_features_ptr == *in_physical_device_features.khr_multiview_features_ptr); - } - else - { - khr_multiview_features_match = (khr_multiview_features_ptr == nullptr && - in_physical_device_features.khr_multiview_features_ptr == nullptr); - } - - if (khr_variable_pointer_features_ptr != nullptr && - in_physical_device_features.khr_variable_pointer_features_ptr != nullptr) - { - khr_variable_pointer_features_match = (*khr_variable_pointer_features_ptr == *in_physical_device_features.khr_variable_pointer_features_ptr); - } - else - { - khr_variable_pointer_features_match = (khr_variable_pointer_features_ptr == nullptr && - in_physical_device_features.khr_variable_pointer_features_ptr == nullptr); - } - - return core_vk1_0_features_match && - ext_descriptor_indexing_features_match && - ext_transform_feedback_features_match && - khr_16bit_storage_features_match && - khr_8bit_storage_features_match && - khr_multiview_features_match && - khr_variable_pointer_features_match; -} - Anvil::PhysicalDeviceFeaturesCoreVK10::PhysicalDeviceFeaturesCoreVK10() :alpha_to_one (false), depth_bias_clamp (false), @@ -3087,154 +4087,20 @@ bool Anvil::PhysicalDeviceFeaturesCoreVK10::operator==(const Anvil::PhysicalDevi (wide_lines == in_data.wide_lines); } -bool Anvil::PhysicalDeviceProperties::operator==(const PhysicalDeviceProperties& in_props) const +bool Anvil::PhysicalDeviceFeaturesCoreVK11::operator==(const PhysicalDeviceFeaturesCoreVK11& in_data) const { - bool amd_shader_core_properties_match = false; - const bool core_vk1_0_features_match = (*core_vk1_0_properties_ptr == *in_props.core_vk1_0_properties_ptr); - bool ext_descriptor_indexing_properties_match = false; - bool ext_external_memory_host_properties_match = false; - bool ext_pci_bus_info_properties_match = false; - bool ext_sample_locations_properties_match = false; - bool ext_sampler_filter_minmax_properties_match = false; - bool ext_vertex_attribute_divisor_properties_match = false; - bool khr_external_memory_capabilities_properties_match = false; - bool khr_maintenance2_properties_match = false; - bool khr_maintenance3_properties_match = false; - bool khr_multiview_properties_match = false; - - if (amd_shader_core_properties_ptr != nullptr && - in_props.amd_shader_core_properties_ptr != nullptr) - { - amd_shader_core_properties_match = (*amd_shader_core_properties_ptr == *in_props.amd_shader_core_properties_ptr); - } - else - { - amd_shader_core_properties_match = (amd_shader_core_properties_ptr == nullptr && - in_props.amd_shader_core_properties_ptr == nullptr); - } - - if (ext_descriptor_indexing_properties_ptr != nullptr && - in_props.ext_descriptor_indexing_properties_ptr != nullptr) - { - ext_descriptor_indexing_properties_match = (*ext_descriptor_indexing_properties_ptr == *in_props.ext_descriptor_indexing_properties_ptr); - } - else - { - ext_descriptor_indexing_properties_match = (ext_descriptor_indexing_properties_ptr == nullptr && - in_props.ext_descriptor_indexing_properties_ptr == nullptr); - } - - if (ext_external_memory_host_properties_ptr != nullptr && - in_props.ext_external_memory_host_properties_ptr != nullptr) - { - ext_external_memory_host_properties_match = (*ext_external_memory_host_properties_ptr == *in_props.ext_external_memory_host_properties_ptr); - } - else - { - ext_external_memory_host_properties_match = (ext_external_memory_host_properties_ptr == nullptr && - in_props.ext_external_memory_host_properties_ptr == nullptr); - } - - if (ext_pci_bus_info_properties_ptr != nullptr && - in_props.ext_pci_bus_info_properties_ptr != nullptr) - { - ext_pci_bus_info_properties_match = (*ext_pci_bus_info_properties_ptr == *in_props.ext_pci_bus_info_properties_ptr); - } - else - { - ext_pci_bus_info_properties_match = (ext_pci_bus_info_properties_ptr == nullptr && - in_props.ext_pci_bus_info_properties_ptr == nullptr); - } - - if (ext_sample_locations_properties_ptr != nullptr && - in_props.ext_sample_locations_properties_ptr != nullptr) - { - ext_sample_locations_properties_match = (*ext_sample_locations_properties_ptr == *in_props.ext_sample_locations_properties_ptr); - } - else - { - ext_sample_locations_properties_match = (ext_sample_locations_properties_ptr == nullptr && - in_props.ext_sample_locations_properties_ptr == nullptr); - } - - if (ext_sampler_filter_minmax_properties_ptr != nullptr && - in_props.ext_sampler_filter_minmax_properties_ptr != nullptr) - { - ext_sampler_filter_minmax_properties_match = (*ext_sampler_filter_minmax_properties_ptr == *in_props.ext_sampler_filter_minmax_properties_ptr); - } - else - { - ext_sampler_filter_minmax_properties_match = (ext_sampler_filter_minmax_properties_ptr == nullptr && - in_props.ext_sampler_filter_minmax_properties_ptr == nullptr); - } - - if (ext_vertex_attribute_divisor_properties_ptr != nullptr && - in_props.ext_vertex_attribute_divisor_properties_ptr != nullptr) - { - ext_vertex_attribute_divisor_properties_match = (*ext_vertex_attribute_divisor_properties_ptr == *in_props.ext_vertex_attribute_divisor_properties_ptr); - } - else - { - ext_vertex_attribute_divisor_properties_match = (ext_vertex_attribute_divisor_properties_ptr == nullptr && - in_props.ext_vertex_attribute_divisor_properties_ptr == nullptr); - } - - if (khr_external_memory_capabilities_physical_device_id_properties_ptr != nullptr && - in_props.khr_external_memory_capabilities_physical_device_id_properties_ptr!= nullptr) - { - khr_external_memory_capabilities_properties_match = (*khr_external_memory_capabilities_physical_device_id_properties_ptr == *in_props.khr_external_memory_capabilities_physical_device_id_properties_ptr); - } - else - { - khr_external_memory_capabilities_properties_match = (khr_external_memory_capabilities_physical_device_id_properties_ptr == nullptr && - in_props.khr_external_memory_capabilities_physical_device_id_properties_ptr == nullptr); - } - - if (khr_maintenance2_point_clipping_properties_ptr != nullptr && - in_props.khr_maintenance2_point_clipping_properties_ptr != nullptr) - { - khr_maintenance2_properties_match = (*khr_maintenance2_point_clipping_properties_ptr == *in_props.khr_maintenance2_point_clipping_properties_ptr); - } - else - { - khr_maintenance2_properties_match = (khr_maintenance2_point_clipping_properties_ptr == nullptr && - in_props.khr_maintenance2_point_clipping_properties_ptr == nullptr); - } - - if (khr_maintenance3_properties_ptr != nullptr && - in_props.khr_maintenance3_properties_ptr != nullptr) - { - khr_maintenance3_properties_match = (*khr_maintenance3_properties_ptr == *in_props.khr_maintenance3_properties_ptr); - } - else - { - khr_maintenance3_properties_match = (khr_maintenance3_properties_ptr == nullptr && - in_props.khr_maintenance3_properties_ptr == nullptr); - } + return (protected_memory_features == in_data.protected_memory_features); +} - if (khr_multiview_properties_ptr != nullptr && - in_props.khr_multiview_properties_ptr != nullptr) - { - khr_multiview_properties_match = (*khr_multiview_properties_ptr == *in_props.khr_multiview_properties_ptr); - } - else - { - khr_multiview_properties_match = (khr_multiview_properties_ptr == nullptr && - in_props.khr_multiview_properties_ptr == nullptr); - } +Anvil::PhysicalDeviceFeaturesCoreVK11::PhysicalDeviceFeaturesCoreVK11() +{ + /* Stub */ +} - return amd_shader_core_properties_match && - core_vk1_0_features_match && - ext_descriptor_indexing_properties_match && - ext_external_memory_host_properties_match && - ext_pci_bus_info_properties_match && - ext_sample_locations_properties_match && - ext_sampler_filter_minmax_properties_match && - ext_vertex_attribute_divisor_properties_match && - khr_external_memory_capabilities_properties_match && - khr_maintenance2_properties_match && - khr_maintenance3_properties_match && - khr_multiview_properties_match; +Anvil::PhysicalDeviceFeaturesCoreVK11::PhysicalDeviceFeaturesCoreVK11(const PhysicalDeviceProtectedMemoryFeatures& in_protected_memory_features) + :protected_memory_features(in_protected_memory_features) +{ + /* Stub */ } Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_buffers, @@ -3247,24 +4113,33 @@ Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_buff const Anvil::PipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptrs, bool in_should_block, Anvil::Fence* in_opt_fence_ptr) - :command_buffers_mgpu_ptr (nullptr), - command_buffers_sgpu_ptr (in_opt_cmd_buffer_ptrs_ptr), + :command_buffers_mgpu_ptr (nullptr), + command_buffers_sgpu_ptr (in_opt_cmd_buffer_ptrs_ptr), #if defined(_WIN32) - d3d12_fence_signal_semaphore_values_ptr(nullptr), - d3d12_fence_wait_semaphore_values_ptr (nullptr), + d3d12_fence_signal_semaphore_values_ptr (nullptr), + d3d12_fence_wait_semaphore_values_ptr (nullptr), #endif - dst_stage_wait_masks (in_n_semaphores_to_wait_on), - fence_ptr (in_opt_fence_ptr), - n_command_buffers (in_n_command_buffers), - n_signal_semaphores (in_n_semaphores_to_signal), - n_wait_semaphores (in_n_semaphores_to_wait_on), - signal_semaphores_mgpu_ptr (nullptr), - signal_semaphores_sgpu_ptr (in_opt_semaphore_to_signal_ptrs_ptr), - should_block (in_should_block), - timeout (UINT64_MAX), - type (SubmissionType::SGPU), - wait_semaphores_mgpu_ptr (nullptr), - wait_semaphores_sgpu_ptr (in_opt_semaphore_to_wait_on_ptrs_ptr) + dst_stage_wait_masks (in_n_semaphores_to_wait_on), + fence_ptr (in_opt_fence_ptr), +#if defined(_WIN32) + keyed_mutex_n_acquire_keys (0), + keyed_mutex_acquire_d3d11_memory_block_ptrs_ptr(nullptr), + keyed_mutex_acquire_mutex_key_value_ptrs (nullptr), + keyed_mutex_acquire_timeout_ptrs (nullptr), + keyed_mutex_n_release_keys (0), + keyed_mutex_release_d3d11_memory_block_ptrs_ptr(nullptr), + keyed_mutex_release_mutex_key_value_ptrs (nullptr), +#endif + n_command_buffers (in_n_command_buffers), + n_signal_semaphores (in_n_semaphores_to_signal), + n_wait_semaphores (in_n_semaphores_to_wait_on), + signal_semaphores_mgpu_ptr (nullptr), + signal_semaphores_sgpu_ptr (in_opt_semaphore_to_signal_ptrs_ptr), + should_block (in_should_block), + timeout (UINT64_MAX), + type (SubmissionType::SGPU), + wait_semaphores_mgpu_ptr (nullptr), + wait_semaphores_sgpu_ptr (in_opt_semaphore_to_wait_on_ptrs_ptr) { for (uint32_t n_wait_mask = 0; n_wait_mask < in_n_semaphores_to_wait_on; @@ -3302,24 +4177,33 @@ Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_bu const Anvil::PipelineStageFlags* in_opt_dst_stage_masks_to_wait_on_ptr, bool in_should_block, Anvil::Fence* in_opt_fence_ptr) - :command_buffers_mgpu_ptr (in_opt_command_buffer_submissions_ptr), - command_buffers_sgpu_ptr (nullptr), + :command_buffers_mgpu_ptr (in_opt_command_buffer_submissions_ptr), + command_buffers_sgpu_ptr (nullptr), +#if defined(_WIN32) + d3d12_fence_signal_semaphore_values_ptr (nullptr), + d3d12_fence_wait_semaphore_values_ptr (nullptr), +#endif + dst_stage_wait_masks (in_n_wait_semaphore_submissions), + fence_ptr (in_opt_fence_ptr), #if defined(_WIN32) - d3d12_fence_signal_semaphore_values_ptr(nullptr), - d3d12_fence_wait_semaphore_values_ptr (nullptr), + keyed_mutex_n_acquire_keys (0), + keyed_mutex_acquire_d3d11_memory_block_ptrs_ptr(nullptr), + keyed_mutex_acquire_mutex_key_value_ptrs (nullptr), + keyed_mutex_acquire_timeout_ptrs (nullptr), + keyed_mutex_n_release_keys (0), + keyed_mutex_release_d3d11_memory_block_ptrs_ptr(nullptr), + keyed_mutex_release_mutex_key_value_ptrs (nullptr), #endif - dst_stage_wait_masks (in_n_wait_semaphore_submissions), - fence_ptr (in_opt_fence_ptr), - n_command_buffers (in_n_command_buffer_submissions), - n_signal_semaphores (in_n_signal_semaphore_submissions), - n_wait_semaphores (in_n_wait_semaphore_submissions), - signal_semaphores_mgpu_ptr (in_opt_signal_semaphore_submissions_ptr), - signal_semaphores_sgpu_ptr (nullptr), - should_block (in_should_block), - timeout (UINT64_MAX), - type (SubmissionType::MGPU), - wait_semaphores_mgpu_ptr (in_opt_wait_semaphore_submissions_ptr), - wait_semaphores_sgpu_ptr (nullptr) + n_command_buffers (in_n_command_buffer_submissions), + n_signal_semaphores (in_n_signal_semaphore_submissions), + n_wait_semaphores (in_n_wait_semaphore_submissions), + signal_semaphores_mgpu_ptr (in_opt_signal_semaphore_submissions_ptr), + signal_semaphores_sgpu_ptr (nullptr), + should_block (in_should_block), + timeout (UINT64_MAX), + type (SubmissionType::MGPU), + wait_semaphores_mgpu_ptr (in_opt_wait_semaphore_submissions_ptr), + wait_semaphores_sgpu_ptr (nullptr) { for (uint32_t n_wait_mask = 0; n_wait_mask < in_n_wait_semaphore_submissions; @@ -3523,6 +4407,24 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_signal(uint32_t in_n in_opt_fence_ptr); } +Anvil::SubmitInfo Anvil::SubmitInfo::create_signal(uint32_t in_n_signal_semaphore_submissions, + const Anvil::SemaphoreMGPUSubmission* in_signal_semaphore_submissions_ptr, + Anvil::Fence* in_opt_fence_ptr) +{ + anvil_assert(in_n_signal_semaphore_submissions > 0); + anvil_assert(in_signal_semaphore_submissions_ptr != nullptr); + + return Anvil::SubmitInfo(0, /* in_n_command_buffer_submissions, */ + nullptr, /* in_opt_command_buffer_submissions_ptr, */ + in_n_signal_semaphore_submissions, + in_signal_semaphore_submissions_ptr, + 0, /* in_n_wait_semaphore_submissions, */ + nullptr, /* in_opt_wait_semaphore_submissions_ptr, */ + nullptr, /* in_opt_dst_stage_masks_to_wait_on_ptr, */ + true, /* in_should_block, */ + in_opt_fence_ptr); +} + Anvil::SubmitInfo Anvil::SubmitInfo::create_signal_wait(uint32_t in_n_semaphores_to_signal, Anvil::Semaphore* const* in_semaphore_to_signal_ptrs_ptr, uint32_t in_n_semaphores_to_wait_on, @@ -3548,6 +4450,30 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_signal_wait(uint32_t in_opt_fence_ptr); } +Anvil::SubmitInfo Anvil::SubmitInfo::create_signal_wait(uint32_t in_n_signal_semaphore_submissions, + const Anvil::SemaphoreMGPUSubmission* in_signal_semaphore_submissions_ptr, + uint32_t in_n_wait_semaphore_submissions, + const Anvil::SemaphoreMGPUSubmission* in_wait_semaphore_submissions_ptr, + const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + bool in_should_block, + Anvil::Fence* in_opt_fence_ptr) +{ + anvil_assert(in_n_signal_semaphore_submissions > 0); + anvil_assert(in_signal_semaphore_submissions_ptr != nullptr); + anvil_assert(in_n_wait_semaphore_submissions > 0); + anvil_assert(in_wait_semaphore_submissions_ptr != nullptr); + + return Anvil::SubmitInfo(0, /* in_n_command_buffers */ + nullptr, /* in_opt_command_buffer_submissions_ptr */ + in_n_signal_semaphore_submissions, + in_signal_semaphore_submissions_ptr, + in_n_wait_semaphore_submissions, + in_wait_semaphore_submissions_ptr, + in_dst_stage_masks_to_wait_on_ptrs, + in_should_block, + in_opt_fence_ptr); +} + Anvil::SubmitInfo Anvil::SubmitInfo::create_wait(uint32_t in_n_semaphores_to_wait_on, Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, @@ -3569,6 +4495,26 @@ Anvil::SubmitInfo Anvil::SubmitInfo::create_wait(uint32_t in_opt_fence_ptr); } +Anvil::SubmitInfo Anvil::SubmitInfo::create_wait(uint32_t in_n_wait_semaphore_submissions, + const Anvil::SemaphoreMGPUSubmission* in_wait_semaphore_submissions_ptr, + const Anvil::PipelineStageFlags* in_dst_stage_masks_to_wait_on_ptrs, + Anvil::Fence* in_opt_fence_ptr) +{ + anvil_assert(in_dst_stage_masks_to_wait_on_ptrs != nullptr); + anvil_assert(in_n_wait_semaphore_submissions > 0); + anvil_assert(in_wait_semaphore_submissions_ptr != nullptr); + + return Anvil::SubmitInfo(0, /* in_n_command_buffer_submissions, */ + nullptr, /* in_opt_command_buffer_submissions_ptr, */ + 0, /* in_n_signal_semaphore_submissions, */ + nullptr, /* in_opt_signal_semaphore_submissions_ptr,*/ + in_n_wait_semaphore_submissions, + in_wait_semaphore_submissions_ptr, + in_dst_stage_masks_to_wait_on_ptrs, + true, /* in_should_block, */ + in_opt_fence_ptr); +} + Anvil::SubmitInfo Anvil::SubmitInfo::create_wait_execute(Anvil::CommandBufferBase* in_cmd_buffer_ptr, uint32_t in_n_semaphores_to_wait_on, Anvil::Semaphore* const* in_semaphore_to_wait_on_ptrs_ptr, diff --git a/src/misc/types_utils.cpp b/src/misc/types_utils.cpp index 11439386..e1bd9446 100644 --- a/src/misc/types_utils.cpp +++ b/src/misc/types_utils.cpp @@ -59,6 +59,11 @@ Anvil::MemoryFeatureFlags Anvil::Utils::get_memory_feature_flags_from_vk_propert result |= Anvil::MemoryFeatureFlagBits::MULTI_INSTANCE_BIT; } + if ((in_mem_type_flags & Anvil::MemoryPropertyFlagBits::PROTECTED_BIT) != 0) + { + result |= Anvil::MemoryFeatureFlagBits::PROTECTED_BIT; + } + return result; } @@ -109,9 +114,9 @@ void Anvil::Utils::convert_queue_family_bits_to_family_indices(const Anvil::Base Anvil::QueueFamilyType queue_family_type; } queue_family_data[] = { - {Anvil::QueueFamilyFlagBits::COMPUTE_BIT, Anvil::QueueFamilyType::COMPUTE}, - {Anvil::QueueFamilyFlagBits::DMA_BIT, Anvil::QueueFamilyType::TRANSFER}, - {Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::QueueFamilyType::UNIVERSAL}, + {Anvil::QueueFamilyFlagBits::COMPUTE_BIT, Anvil::QueueFamilyType::COMPUTE}, + {Anvil::QueueFamilyFlagBits::DMA_BIT, Anvil::QueueFamilyType::TRANSFER}, + {Anvil::QueueFamilyFlagBits::GRAPHICS_BIT, Anvil::QueueFamilyType::UNIVERSAL}, }; for (const auto& current_queue_fam_data : queue_family_data) @@ -1033,6 +1038,11 @@ void Anvil::Utils::get_vk_property_flags_from_memory_feature_flags(Anvil::Memory result_mem_heap_flags |= Anvil::MemoryHeapFlagBits::MULTI_INSTANCE_BIT_KHR; } + if ((in_mem_feature_flags & Anvil::MemoryFeatureFlagBits::PROTECTED_BIT) != 0) + { + result_mem_type_flags |= Anvil::MemoryPropertyFlagBits::PROTECTED_BIT; + } + *out_mem_heap_flags_ptr = result_mem_heap_flags; *out_mem_type_flags_ptr = result_mem_type_flags; } diff --git a/src/misc/vulkan.cpp b/src/misc/vulkan.cpp index 213e3c15..71f3ffce 100644 --- a/src/misc/vulkan.cpp +++ b/src/misc/vulkan.cpp @@ -166,6 +166,36 @@ PFN_vkCmdNextSubpass Anvil::Vulkan::vkCmdNextSubpass = nullptr; PFN_vkCmdEndRenderPass Anvil::Vulkan::vkCmdEndRenderPass = nullptr; PFN_vkCmdExecuteCommands Anvil::Vulkan::vkCmdExecuteCommands = nullptr; + + PFN_vkBindBufferMemory2 Anvil::Vulkan::vkBindBufferMemory2 = nullptr; + PFN_vkBindImageMemory2 Anvil::Vulkan::vkBindImageMemory2 = nullptr; + PFN_vkCmdDispatchBase Anvil::Vulkan::vkCmdDispatchBase = nullptr; + PFN_vkCmdSetDeviceMask Anvil::Vulkan::vkCmdSetDeviceMask = nullptr; + PFN_vkCreateDescriptorUpdateTemplate Anvil::Vulkan::vkCreateDescriptorUpdateTemplate = nullptr; + PFN_vkCreateSamplerYcbcrConversion Anvil::Vulkan::vkCreateSamplerYcbcrConversion = nullptr; + PFN_vkDestroyDescriptorUpdateTemplate Anvil::Vulkan::vkDestroyDescriptorUpdateTemplate = nullptr; + PFN_vkDestroySamplerYcbcrConversion Anvil::Vulkan::vkDestroySamplerYcbcrConversion = nullptr; + PFN_vkEnumerateInstanceVersion Anvil::Vulkan::vkEnumerateInstanceVersion = nullptr; + PFN_vkEnumeratePhysicalDeviceGroups Anvil::Vulkan::vkEnumeratePhysicalDeviceGroups = nullptr; + PFN_vkGetBufferMemoryRequirements2 Anvil::Vulkan::vkGetBufferMemoryRequirements2 = nullptr; + PFN_vkGetDescriptorSetLayoutSupport Anvil::Vulkan::vkGetDescriptorSetLayoutSupport = nullptr; + PFN_vkGetDeviceGroupPeerMemoryFeatures Anvil::Vulkan::vkGetDeviceGroupPeerMemoryFeatures = nullptr; + PFN_vkGetDeviceQueue2 Anvil::Vulkan::vkGetDeviceQueue2 = nullptr; + PFN_vkGetImageMemoryRequirements2 Anvil::Vulkan::vkGetImageMemoryRequirements2 = nullptr; + PFN_vkGetImageSparseMemoryRequirements2 Anvil::Vulkan::vkGetImageSparseMemoryRequirements2 = nullptr; + PFN_vkGetPhysicalDeviceExternalBufferProperties Anvil::Vulkan::vkGetPhysicalDeviceExternalBufferProperties = nullptr; + PFN_vkGetPhysicalDeviceExternalFenceProperties Anvil::Vulkan::vkGetPhysicalDeviceExternalFenceProperties = nullptr; + PFN_vkGetPhysicalDeviceExternalSemaphoreProperties Anvil::Vulkan::vkGetPhysicalDeviceExternalSemaphoreProperties = nullptr; + PFN_vkGetPhysicalDeviceFeatures2 Anvil::Vulkan::vkGetPhysicalDeviceFeatures2 = nullptr; + PFN_vkGetPhysicalDeviceFormatProperties2 Anvil::Vulkan::vkGetPhysicalDeviceFormatProperties2 = nullptr; + PFN_vkGetPhysicalDeviceImageFormatProperties2 Anvil::Vulkan::vkGetPhysicalDeviceImageFormatProperties2 = nullptr; + PFN_vkGetPhysicalDeviceMemoryProperties2 Anvil::Vulkan::vkGetPhysicalDeviceMemoryProperties2 = nullptr; + PFN_vkGetPhysicalDeviceProperties2 Anvil::Vulkan::vkGetPhysicalDeviceProperties2 = nullptr; + PFN_vkGetPhysicalDeviceQueueFamilyProperties2 Anvil::Vulkan::vkGetPhysicalDeviceQueueFamilyProperties2 = nullptr; + PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 Anvil::Vulkan::vkGetPhysicalDeviceSparseImageFormatProperties2 = nullptr; + PFN_vkTrimCommandPool Anvil::Vulkan::vkTrimCommandPool = nullptr; + PFN_vkUpdateDescriptorSetWithTemplate Anvil::Vulkan::vkUpdateDescriptorSetWithTemplate = nullptr; + #else PFN_vkCreateInstance Anvil::Vulkan::vkCreateInstance = ::vkCreateInstance; PFN_vkDestroyInstance Anvil::Vulkan::vkDestroyInstance = ::vkDestroyInstance; @@ -304,4 +334,33 @@ PFN_vkCmdNextSubpass Anvil::Vulkan::vkCmdNextSubpass = ::vkCmdNextSubpass; PFN_vkCmdEndRenderPass Anvil::Vulkan::vkCmdEndRenderPass = ::vkCmdEndRenderPass; PFN_vkCmdExecuteCommands Anvil::Vulkan::vkCmdExecuteCommands = ::vkCmdExecuteCommands; + + PFN_vkBindBufferMemory2 Anvil::Vulkan::vkBindBufferMemory2 = nullptr; + PFN_vkBindImageMemory2 Anvil::Vulkan::vkBindImageMemory2 = nullptr; + PFN_vkCmdDispatchBase Anvil::Vulkan::vkCmdDispatchBase = nullptr; + PFN_vkCmdSetDeviceMask Anvil::Vulkan::vkCmdSetDeviceMask = nullptr; + PFN_vkCreateDescriptorUpdateTemplate Anvil::Vulkan::vkCreateDescriptorUpdateTemplate = nullptr; + PFN_vkCreateSamplerYcbcrConversion Anvil::Vulkan::vkCreateSamplerYcbcrConversion = nullptr; + PFN_vkDestroyDescriptorUpdateTemplate Anvil::Vulkan::vkDestroyDescriptorUpdateTemplate = nullptr; + PFN_vkDestroySamplerYcbcrConversion Anvil::Vulkan::vkDestroySamplerYcbcrConversion = nullptr; + PFN_vkEnumerateInstanceVersion Anvil::Vulkan::vkEnumerateInstanceVersion = nullptr; + PFN_vkEnumeratePhysicalDeviceGroups Anvil::Vulkan::vkEnumeratePhysicalDeviceGroups = nullptr; + PFN_vkGetBufferMemoryRequirements2 Anvil::Vulkan::vkGetBufferMemoryRequirements2 = nullptr; + PFN_vkGetDescriptorSetLayoutSupport Anvil::Vulkan::vkGetDescriptorSetLayoutSupport = nullptr; + PFN_vkGetDeviceGroupPeerMemoryFeatures Anvil::Vulkan::vkGetDeviceGroupPeerMemoryFeatures = nullptr; + PFN_vkGetDeviceQueue2 Anvil::Vulkan::vkGetDeviceQueue2 = nullptr; + PFN_vkGetImageMemoryRequirements2 Anvil::Vulkan::vkGetImageMemoryRequirements2 = nullptr; + PFN_vkGetImageSparseMemoryRequirements2 Anvil::Vulkan::vkGetImageSparseMemoryRequirements2 = nullptr; + PFN_vkGetPhysicalDeviceExternalBufferProperties Anvil::Vulkan::vkGetPhysicalDeviceExternalBufferProperties = nullptr; + PFN_vkGetPhysicalDeviceExternalFenceProperties Anvil::Vulkan::vkGetPhysicalDeviceExternalFenceProperties = nullptr; + PFN_vkGetPhysicalDeviceExternalSemaphoreProperties Anvil::Vulkan::vkGetPhysicalDeviceExternalSemaphoreProperties = nullptr; + PFN_vkGetPhysicalDeviceFeatures2 Anvil::Vulkan::vkGetPhysicalDeviceFeatures2 = nullptr; + PFN_vkGetPhysicalDeviceFormatProperties2 Anvil::Vulkan::vkGetPhysicalDeviceFormatProperties2 = nullptr; + PFN_vkGetPhysicalDeviceImageFormatProperties2 Anvil::Vulkan::vkGetPhysicalDeviceImageFormatProperties2 = nullptr; + PFN_vkGetPhysicalDeviceMemoryProperties2 Anvil::Vulkan::vkGetPhysicalDeviceMemoryProperties2 = nullptr; + PFN_vkGetPhysicalDeviceProperties2 Anvil::Vulkan::vkGetPhysicalDeviceProperties2 = nullptr; + PFN_vkGetPhysicalDeviceQueueFamilyProperties2 Anvil::Vulkan::vkGetPhysicalDeviceQueueFamilyProperties2 = nullptr; + PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 Anvil::Vulkan::vkGetPhysicalDeviceSparseImageFormatProperties2 = nullptr; + PFN_vkTrimCommandPool Anvil::Vulkan::vkTrimCommandPool = nullptr; + PFN_vkUpdateDescriptorSetWithTemplate Anvil::Vulkan::vkUpdateDescriptorSetWithTemplate = nullptr; #endif diff --git a/src/wrappers/buffer.cpp b/src/wrappers/buffer.cpp index e84df57a..60f002dd 100644 --- a/src/wrappers/buffer.cpp +++ b/src/wrappers/buffer.cpp @@ -605,8 +605,15 @@ bool Anvil::Buffer::read(VkDeviceSize in_start_offset, auto memory_block_ptr (get_memory_block(0 /* in_n_memory_block */) ); bool result (false); - /* TODO: Support for sparse buffers */ - anvil_assert(m_create_info_ptr->get_create_flags() == Anvil::BufferCreateFlagBits::NONE); + /* TODO: Complete support for sparsely-bound & sparse-resident buffers */ + anvil_assert((m_create_info_ptr->get_create_flags() & Anvil::BufferCreateFlagBits::SPARSE_RESIDENCY_BIT) == 0); + + if ((m_create_info_ptr->get_create_flags() & Anvil::BufferCreateFlagBits::SPARSE_BINDING_BIT) != 0) + { + anvil_assert(m_page_tracker_ptr->get_n_memory_blocks () == 1); + anvil_assert(m_page_tracker_ptr->get_n_pages_with_memory_backing() == m_page_tracker_ptr->get_n_pages() ); + } + if ((memory_block_ptr->get_create_info_ptr()->get_memory_features() & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) != 0) { diff --git a/src/wrappers/command_buffer.cpp b/src/wrappers/command_buffer.cpp index eb22ffa7..8c9dc323 100644 --- a/src/wrappers/command_buffer.cpp +++ b/src/wrappers/command_buffer.cpp @@ -79,9 +79,9 @@ Anvil::BeginQueryIndexedEXTCommand::BeginQueryIndexedEXTCommand(Anvil::QueryPool Anvil::BeginRenderPassCommand::BeginRenderPassCommand(uint32_t in_n_clear_values, const VkClearValue* in_clear_value_ptrs, Anvil::Framebuffer* in_fbo_ptr, - uint32_t in_n_physical_devices, - const Anvil::PhysicalDevice* const* in_physical_devices, - const VkRect2D* in_render_areas, + uint32_t in_device_mask, + uint32_t in_n_render_areas, + const VkRect2D* in_render_areas_ptr, Anvil::RenderPass* in_render_pass_ptr, Anvil::SubpassContents in_contents, const uint32_t& in_n_attachment_initial_sample_locations, @@ -91,6 +91,7 @@ Anvil::BeginRenderPassCommand::BeginRenderPassCommand(uint32_t :Command(COMMAND_TYPE_BEGIN_RENDER_PASS) { contents = in_contents; + device_mask = in_device_mask; fbo_ptr = in_fbo_ptr; render_pass_ptr = in_render_pass_ptr; @@ -101,16 +102,16 @@ Anvil::BeginRenderPassCommand::BeginRenderPassCommand(uint32_t clear_values.push_back(in_clear_value_ptrs[n_clear_value]); } - for (uint32_t n_physical_device = 0; - n_physical_device < in_n_physical_devices; - ++n_physical_device) - { - physical_devices.push_back(in_physical_devices[n_physical_device]); - render_areas.push_back (in_render_areas [n_physical_device]); - } - attachment_initial_sample_locations.resize(in_n_attachment_initial_sample_locations); post_subpass_sample_locations.resize (in_n_post_subpass_sample_locations); + render_areas.resize (in_n_render_areas); + + for (uint32_t n_render_area = 0; + n_render_area < in_n_render_areas; + ++n_render_area) + { + render_areas.at(n_render_area) = in_render_areas_ptr[n_render_area]; + } for (uint32_t n_attachment = 0; n_attachment < in_n_attachment_initial_sample_locations; @@ -1494,7 +1495,7 @@ bool Anvil::CommandBufferBase::record_bind_pipeline(Anvil::PipelineBindPoint in_ goto end; } - anvil_assert(in_pipeline_bind_point == Anvil::PipelineBindPoint::COMPUTE || + anvil_assert(in_pipeline_bind_point == Anvil::PipelineBindPoint::COMPUTE || in_pipeline_bind_point == Anvil::PipelineBindPoint::GRAPHICS); pipeline_vk = (in_pipeline_bind_point == Anvil::PipelineBindPoint::COMPUTE) ? m_device_ptr->get_compute_pipeline_manager ()->get_pipeline(in_pipeline_id) @@ -3480,7 +3481,6 @@ bool Anvil::CommandBufferBase::record_resolve_image(Anvil::Image* i return result; } - /* Please see header for specification */ bool Anvil::CommandBufferBase::record_set_blend_constants(const float in_blend_constants[4]) { @@ -3613,7 +3613,7 @@ bool Anvil::CommandBufferBase::record_set_device_mask_KHR(uint32_t in_device_mas } anvil_assert(m_device_ptr->get_extension_info()->khr_device_group() ); - + anvil_assert(in_device_mask != 0); #ifdef STORE_COMMAND_BUFFER_COMMANDS { @@ -3626,20 +3626,14 @@ bool Anvil::CommandBufferBase::record_set_device_mask_KHR(uint32_t in_device_mas if (m_is_renderpass_active) { - for (uint32_t n_device = 0; - n_device < sizeof(uint32_t); - ++n_device) + if ((m_renderpass_device_mask & in_device_mask) != in_device_mask) { - if (!(m_renderpass_device_mask & (1 << n_device)) && - (m_device_mask & (1 << n_device)) ) - { - /* It is illegal to try to activate a device which has not been enabled - * for the renderpass. - */ - anvil_assert_fail(); + /* It is illegal to try to activate a device which has not been enabled + * for the renderpass. + */ + anvil_assert_fail(); - goto end; - } + goto end; } } @@ -4349,8 +4343,8 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t return record_begin_render_pass(in_n_clear_values, in_clear_value_ptrs, in_fbo_ptr, - 0, /* in_n_physical_devices */ - nullptr, /* in_physical_devices_ptr */ + 0, /* in_device_mask */ + 1, /* in_n_render_areas */ &in_render_area, in_render_pass_ptr, in_contents, @@ -4364,9 +4358,9 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t in_n_clear_values, const VkClearValue* in_clear_value_ptrs, Anvil::Framebuffer* in_fbo_ptr, - uint32_t in_n_physical_devices, - const Anvil::PhysicalDevice* const* in_physical_devices, - const VkRect2D* in_render_areas, + uint32_t in_device_mask, + uint32_t in_n_render_areas, + const VkRect2D* in_render_areas_ptr, Anvil::RenderPass* in_render_pass_ptr, Anvil::SubpassContents in_contents, const uint32_t& in_opt_n_attachment_initial_sample_locations, @@ -4378,9 +4372,9 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass(uint32_t in_n_clear_values, in_clear_value_ptrs, in_fbo_ptr, - in_n_physical_devices, - in_physical_devices, - in_render_areas, + in_device_mask, + in_n_render_areas, + in_render_areas_ptr, in_render_pass_ptr, in_contents, in_opt_n_attachment_initial_sample_locations, @@ -4404,8 +4398,8 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass2_KHR(uint32_t return record_begin_render_pass2_KHR(in_n_clear_values, in_clear_value_ptrs, in_fbo_ptr, - 0, /* in_n_physical_devices */ - nullptr, /* in_physical_devices_ptr */ + 0, /* in_device_mask */ + 1, /* in_n_render_areas */ &in_render_area, in_render_pass_ptr, in_contents, @@ -4419,9 +4413,9 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass2_KHR(uint32_t bool Anvil::PrimaryCommandBuffer::record_begin_render_pass2_KHR(uint32_t in_n_clear_values, const VkClearValue* in_clear_value_ptrs, Anvil::Framebuffer* in_fbo_ptr, - uint32_t in_n_physical_devices, - const Anvil::PhysicalDevice* const* in_physical_devices, - const VkRect2D* in_render_areas, + uint32_t in_device_mask, + uint32_t in_n_render_areas, + const VkRect2D* in_render_areas_ptr, Anvil::RenderPass* in_render_pass_ptr, Anvil::SubpassContents in_contents, const uint32_t& in_opt_n_attachment_initial_sample_locations, @@ -4435,9 +4429,9 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass2_KHR(uint32_t in_n_clear_values, in_clear_value_ptrs, in_fbo_ptr, - in_n_physical_devices, - in_physical_devices, - in_render_areas, + in_device_mask, + in_n_render_areas, + in_render_areas_ptr, in_render_pass_ptr, in_contents, in_opt_n_attachment_initial_sample_locations, @@ -4451,9 +4445,9 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass_internal(const bool& uint32_t in_n_clear_values, const VkClearValue* in_clear_value_ptrs, Anvil::Framebuffer* in_fbo_ptr, - uint32_t in_n_physical_devices, - const Anvil::PhysicalDevice* const* in_physical_devices, - const VkRect2D* in_render_areas, + uint32_t in_device_mask, + uint32_t in_n_render_areas, + const VkRect2D* in_render_areas_ptr, Anvil::RenderPass* in_render_pass_ptr, Anvil::SubpassContents in_contents, const uint32_t& in_opt_n_attachment_initial_sample_locations, @@ -4480,19 +4474,6 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass_internal(const bool& goto end; } - if (in_n_physical_devices == 0 && - device_type == Anvil::DeviceType::SINGLE_GPU) - { - const Anvil::PhysicalDevice* physical_device_ptr; - const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr) ); - - anvil_assert(sgpu_device_ptr != nullptr); /* User attempted to call this function prototype with in_n_physical_devices set to 0 */ - - physical_device_ptr = sgpu_device_ptr->get_physical_device(); - in_n_physical_devices = 1; - in_physical_devices = &physical_device_ptr; - } - #ifdef STORE_COMMAND_BUFFER_COMMANDS { if (!m_command_stashing_disabled) @@ -4502,9 +4483,9 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass_internal(const bool& m_commands.push_back(BeginRenderPass2KHRCommand(in_n_clear_values, in_clear_value_ptrs, in_fbo_ptr, - in_n_physical_devices, - in_physical_devices, - in_render_areas, + in_device_mask, + in_n_render_areas, + in_render_areas_ptr, in_render_pass_ptr, in_contents, in_opt_n_attachment_initial_sample_locations, @@ -4517,9 +4498,9 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass_internal(const bool& m_commands.push_back(BeginRenderPassCommand(in_n_clear_values, in_clear_value_ptrs, in_fbo_ptr, - in_n_physical_devices, - in_physical_devices, - in_render_areas, + in_device_mask, + in_n_render_areas, + in_render_areas_ptr, in_render_pass_ptr, in_contents, in_opt_n_attachment_initial_sample_locations, @@ -4531,7 +4512,7 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass_internal(const bool& } #endif - anvil_assert(in_render_areas != nullptr); + anvil_assert(in_render_areas_ptr != nullptr); { VkRenderPassBeginInfo render_pass_begin_info; @@ -4540,7 +4521,7 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass_internal(const bool& render_pass_begin_info.framebuffer = in_fbo_ptr->get_framebuffer(in_render_pass_ptr); render_pass_begin_info.pClearValues = in_clear_value_ptrs; render_pass_begin_info.pNext = nullptr; - render_pass_begin_info.renderArea = in_render_areas[0]; + render_pass_begin_info.renderArea = in_render_areas_ptr[0]; render_pass_begin_info.renderPass = in_render_pass_ptr->get_render_pass(); render_pass_begin_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO; @@ -4551,19 +4532,12 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass_internal(const bool& { VkDeviceGroupRenderPassBeginInfoKHR render_pass_device_group_begin_info; - render_pass_device_group_begin_info.deviceMask = 0; - render_pass_device_group_begin_info.deviceRenderAreaCount = in_n_physical_devices; - render_pass_device_group_begin_info.pDeviceRenderAreas = in_render_areas; + render_pass_device_group_begin_info.deviceMask = in_device_mask; + render_pass_device_group_begin_info.deviceRenderAreaCount = in_n_render_areas; + render_pass_device_group_begin_info.pDeviceRenderAreas = in_render_areas_ptr; render_pass_device_group_begin_info.pNext = nullptr; render_pass_device_group_begin_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO_KHR; - for (uint32_t n_physical_device = 0; - n_physical_device < in_n_physical_devices; - ++n_physical_device) - { - render_pass_device_group_begin_info.deviceMask |= (1 << in_physical_devices[n_physical_device]->get_device_group_device_index() ); - } - render_pass_begin_info_chain.append_struct(render_pass_device_group_begin_info); m_renderpass_device_mask = render_pass_device_group_begin_info.deviceMask; diff --git a/src/wrappers/command_pool.cpp b/src/wrappers/command_pool.cpp index 5c257217..a4c852de 100644 --- a/src/wrappers/command_pool.cpp +++ b/src/wrappers/command_pool.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2019 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -30,20 +30,18 @@ #include /* Please see header for specification */ -Anvil::CommandPool::CommandPool(Anvil::BaseDevice* in_device_ptr, - bool in_transient_allocations_friendly, - bool in_support_per_cmdbuf_reset_ops, - uint32_t in_queue_family_index, - bool in_mt_safe) - - :DebugMarkerSupportProvider (in_device_ptr, - Anvil::ObjectType::COMMAND_POOL), - MTSafetySupportProvider (in_mt_safe), - m_command_pool (VK_NULL_HANDLE), - m_device_ptr (in_device_ptr), - m_is_transient_allocations_friendly(in_transient_allocations_friendly), - m_queue_family_index (in_queue_family_index), - m_supports_per_cmdbuf_reset_ops (in_support_per_cmdbuf_reset_ops) +Anvil::CommandPool::CommandPool(Anvil::BaseDevice* in_device_ptr, + const Anvil::CommandPoolCreateFlags& in_create_flags, + uint32_t in_queue_family_index, + bool in_mt_safe) + + :DebugMarkerSupportProvider(in_device_ptr, + Anvil::ObjectType::COMMAND_POOL), + MTSafetySupportProvider (in_mt_safe), + m_command_pool (VK_NULL_HANDLE), + m_create_flags (in_create_flags), + m_device_ptr (in_device_ptr), + m_queue_family_index (in_queue_family_index) { VkCommandPoolCreateInfo command_pool_create_info; VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); @@ -51,8 +49,7 @@ Anvil::CommandPool::CommandPool(Anvil::BaseDevice* in_device_ptr, ANVIL_REDUNDANT_VARIABLE(result_vk); /* Go on and create the command pool */ - command_pool_create_info.flags = ((in_transient_allocations_friendly) ? VK_COMMAND_POOL_CREATE_TRANSIENT_BIT : 0u) | - ((in_support_per_cmdbuf_reset_ops) ? VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT : 0u); + command_pool_create_info.flags = in_create_flags.get_vk(); command_pool_create_info.pNext = nullptr; command_pool_create_info.queueFamilyIndex = in_queue_family_index; command_pool_create_info.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO; @@ -126,11 +123,10 @@ Anvil::SecondaryCommandBufferUniquePtr Anvil::CommandPool::alloc_secondary_level } /* Please see header for specification */ -Anvil::CommandPoolUniquePtr Anvil::CommandPool::create(Anvil::BaseDevice* in_device_ptr, - bool in_transient_allocations_friendly, - bool in_support_per_cmdbuf_reset_ops, - uint32_t in_queue_family_index, - MTSafety in_mt_safety) +Anvil::CommandPoolUniquePtr Anvil::CommandPool::create(Anvil::BaseDevice* in_device_ptr, + const Anvil::CommandPoolCreateFlags& in_create_flags, + uint32_t in_queue_family_index, + MTSafety in_mt_safety) { const bool is_mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, in_device_ptr); @@ -139,8 +135,7 @@ Anvil::CommandPoolUniquePtr Anvil::CommandPool::create(Anvil::BaseDevice* in_dev result_ptr.reset( new Anvil::CommandPool(in_device_ptr, - in_transient_allocations_friendly, - in_support_per_cmdbuf_reset_ops, + in_create_flags, in_queue_family_index, is_mt_safe) ); diff --git a/src/wrappers/descriptor_pool.cpp b/src/wrappers/descriptor_pool.cpp index eb6a5937..f7e715e2 100644 --- a/src/wrappers/descriptor_pool.cpp +++ b/src/wrappers/descriptor_pool.cpp @@ -21,6 +21,7 @@ // #include "misc/debug.h" +#include "misc/descriptor_pool_create_info.h" #include "misc/descriptor_set_create_info.h" #include "misc/object_tracker.h" #include "misc/struct_chainer.h" @@ -31,23 +32,15 @@ /* Please see header for specification */ -Anvil::DescriptorPool::DescriptorPool(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_n_max_sets, - const Anvil::DescriptorPoolCreateFlags& in_flags, - const uint32_t* in_descriptor_count_per_type_ptr, - bool in_mt_safe) +Anvil::DescriptorPool::DescriptorPool(Anvil::DescriptorPoolCreateInfoUniquePtr in_create_info_ptr, + bool in_mt_safe) :CallbacksSupportProvider (DESCRIPTOR_POOL_CALLBACK_ID_COUNT), - DebugMarkerSupportProvider(in_device_ptr, + DebugMarkerSupportProvider(in_create_info_ptr->get_device_ptr(), Anvil::ObjectType::DESCRIPTOR_POOL), MTSafetySupportProvider (in_mt_safe), - m_device_ptr (in_device_ptr), - m_flags (in_flags), - m_n_max_sets (in_n_max_sets), m_pool (VK_NULL_HANDLE) { - memcpy(m_descriptor_count, - in_descriptor_count_per_type_ptr, - sizeof(uint32_t) * VK_DESCRIPTOR_TYPE_RANGE_SIZE); + m_create_info_ptr = std::move(in_create_info_ptr); /* Register the object in the Object Tracker */ Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::DESCRIPTOR_POOL, @@ -132,6 +125,7 @@ bool Anvil::DescriptorPool::alloc_descriptor_sets(uint32_t VkDescriptorSet* out_descriptor_sets_vk_ptr, VkResult* out_opt_result_ptr) { + const auto& dp_create_flags (m_create_info_ptr->get_create_flags() ); bool result (false); VkResult result_vk; bool should_chain_variable_descriptor_count_struct(false); @@ -152,7 +146,7 @@ bool Anvil::DescriptorPool::alloc_descriptor_sets(uint32_t if (ds_create_info_ptr->contains_variable_descriptor_count_binding() ) { - if ((m_flags & Anvil::DescriptorPoolCreateFlagBits::UPDATE_AFTER_BIND_BIT) != 0) + if ((dp_create_flags & Anvil::DescriptorPoolCreateFlagBits::UPDATE_AFTER_BIND_BIT) != 0) { anvil_assert_fail(); @@ -225,22 +219,15 @@ bool Anvil::DescriptorPool::alloc_descriptor_sets(uint32_t } /* Please see header for specification */ -Anvil::DescriptorPoolUniquePtr Anvil::DescriptorPool::create(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_n_max_sets, - const Anvil::DescriptorPoolCreateFlags& in_flags, - const uint32_t* in_descriptor_count_per_type_ptr, - MTSafety in_mt_safety) +Anvil::DescriptorPoolUniquePtr Anvil::DescriptorPool::create(Anvil::DescriptorPoolCreateInfoUniquePtr in_create_info_ptr) { - const bool is_mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); + const bool is_mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety (), + in_create_info_ptr->get_device_ptr() ); DescriptorPoolUniquePtr result_ptr(nullptr, std::default_delete() ); result_ptr.reset( - new Anvil::DescriptorPool(in_device_ptr, - in_n_max_sets, - in_flags, - in_descriptor_count_per_type_ptr, + new Anvil::DescriptorPool(std::move(in_create_info_ptr), is_mt_safe) ); @@ -258,13 +245,31 @@ Anvil::DescriptorPoolUniquePtr Anvil::DescriptorPool::create(const Anvil::BaseDe /* Please see header for specification */ bool Anvil::DescriptorPool::init() { - VkDescriptorPoolCreateInfo descriptor_pool_create_info; - VkDescriptorPoolSize descriptor_pool_sizes[VK_DESCRIPTOR_TYPE_RANGE_SIZE]; - uint32_t n_descriptor_types_used (0); - bool result (false); - VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); - - if ((m_flags & Anvil::DescriptorPoolCreateFlagBits::UPDATE_AFTER_BIND_BIT) != 0) + static const Anvil::DescriptorType supported_descriptor_types[] = + { + Anvil::DescriptorType::COMBINED_IMAGE_SAMPLER, + Anvil::DescriptorType::INLINE_UNIFORM_BLOCK, + Anvil::DescriptorType::INPUT_ATTACHMENT, + Anvil::DescriptorType::SAMPLED_IMAGE, + Anvil::DescriptorType::SAMPLER, + Anvil::DescriptorType::STORAGE_BUFFER, + Anvil::DescriptorType::STORAGE_BUFFER_DYNAMIC, + Anvil::DescriptorType::STORAGE_IMAGE, + Anvil::DescriptorType::STORAGE_TEXEL_BUFFER, + Anvil::DescriptorType::UNIFORM_BUFFER, + Anvil::DescriptorType::UNIFORM_BUFFER_DYNAMIC, + Anvil::DescriptorType::UNIFORM_TEXEL_BUFFER, + }; + const uint32_t n_supported_descriptor_types = sizeof(supported_descriptor_types) / sizeof(supported_descriptor_types[0]); + + VkDescriptorPoolSize descriptor_pool_sizes[n_supported_descriptor_types]; + const auto& dp_create_flags (m_create_info_ptr->get_create_flags() ); + uint32_t n_descriptor_types_used (0); + bool result (false); + VkResult result_vk (VK_ERROR_INITIALIZATION_FAILED); + Anvil::StructChainer struct_chainer; + + if ((dp_create_flags & Anvil::DescriptorPoolCreateFlagBits::UPDATE_AFTER_BIND_BIT) != 0) { if (!m_device_ptr->get_extension_info()->ext_descriptor_indexing() ) { @@ -275,33 +280,60 @@ bool Anvil::DescriptorPool::init() } /* Convert the counters to an arrayed, linear representation */ - for (uint32_t n_descriptor_type = 0; - n_descriptor_type < VK_DESCRIPTOR_TYPE_RANGE_SIZE; - ++n_descriptor_type) + for (const auto& current_descriptor_type : supported_descriptor_types) { - if (m_descriptor_count[n_descriptor_type] > 0) + const auto n_descriptors_needed = m_create_info_ptr->get_n_descriptors_for_descriptor_type(current_descriptor_type); + + if (n_descriptors_needed > 0) { uint32_t current_index = n_descriptor_types_used; - descriptor_pool_sizes[current_index].descriptorCount = m_descriptor_count[n_descriptor_type]; - descriptor_pool_sizes[current_index].type = static_cast(n_descriptor_type); + descriptor_pool_sizes[current_index].descriptorCount = n_descriptors_needed; + descriptor_pool_sizes[current_index].type = static_cast(current_descriptor_type); n_descriptor_types_used++; } } /* Set up the descriptor pool instance */ - descriptor_pool_create_info.flags = m_flags.get_vk(); - descriptor_pool_create_info.maxSets = m_n_max_sets; - descriptor_pool_create_info.pNext = nullptr; - descriptor_pool_create_info.poolSizeCount = n_descriptor_types_used; - descriptor_pool_create_info.pPoolSizes = descriptor_pool_sizes; - descriptor_pool_create_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO; - - result_vk = Anvil::Vulkan::vkCreateDescriptorPool(m_device_ptr->get_device_vk(), - &descriptor_pool_create_info, - nullptr, /* pAllocator */ - &m_pool); + { + VkDescriptorPoolCreateInfo create_info; + + create_info.flags = m_create_info_ptr->get_create_flags().get_vk(); + create_info.maxSets = m_create_info_ptr->get_n_maximum_sets(); + create_info.pNext = nullptr; + create_info.poolSizeCount = n_descriptor_types_used; + create_info.pPoolSizes = descriptor_pool_sizes; + create_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO; + + struct_chainer.append_struct(create_info); + } + + { + const auto& n_max_inline_uniform_block_bindings = m_create_info_ptr->get_n_maximum_inline_uniform_block_bindings(); + + if (n_max_inline_uniform_block_bindings > 0) + { + VkDescriptorPoolInlineUniformBlockCreateInfoEXT create_info; + + anvil_assert(m_device_ptr->get_extension_info()->ext_inline_uniform_block() ); + + create_info.maxInlineUniformBlockBindings = n_max_inline_uniform_block_bindings; + create_info.pNext = nullptr; + create_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT; + + struct_chainer.append_struct(create_info); + } + } + + { + auto chain_ptr = struct_chainer.create_chain(); + + result_vk = Anvil::Vulkan::vkCreateDescriptorPool(m_device_ptr->get_device_vk(), + chain_ptr->get_root_struct (), + nullptr, /* pAllocator */ + &m_pool); + } anvil_assert_vk_call_succeeded(result_vk); if (is_vk_call_successful(result_vk) ) diff --git a/src/wrappers/descriptor_set.cpp b/src/wrappers/descriptor_set.cpp index 54a64770..6326bc3b 100644 --- a/src/wrappers/descriptor_set.cpp +++ b/src/wrappers/descriptor_set.cpp @@ -273,6 +273,11 @@ Anvil::DescriptorSet::DescriptorSet(const Anvil::BaseDevice* in_device_ { alloc_bindings(); + if (in_device_ptr->get_extension_info()->ext_inline_uniform_block() ) + { + m_cached_ds_write_iub_items_vk.resize(m_device_ptr->get_physical_device_properties().ext_inline_uniform_block_properties_ptr->max_descriptor_set_inline_uniform_blocks); + } + m_parent_pool_ptr->register_for_callbacks( Anvil::DESCRIPTOR_POOL_CALLBACK_ID_POOL_RESET, std::bind(&DescriptorSet::on_parent_pool_reset, @@ -291,12 +296,7 @@ Anvil::DescriptorSet::~DescriptorSet() this); } -/** Takes the descriptor set layout and: - * - * 1) resizes m_caches_ds_write_items_vk to hold as many bindings as the layout describes - * 2) resizes each m_bindings item, described by the layout, to hold as many descriptor - * items, as described by the layout object. - **/ +/** TODO */ void Anvil::DescriptorSet::alloc_bindings() { const auto layout_info_ptr = m_layout_ptr->get_create_info(); @@ -314,12 +314,13 @@ void Anvil::DescriptorSet::alloc_bindings() n_binding < n_bindings; ++n_binding) { - uint32_t array_size = 0; - uint32_t binding_index = UINT32_MAX; + uint32_t array_size = 0; + uint32_t binding_index = UINT32_MAX; + Anvil::DescriptorType descriptor_type = Anvil::DescriptorType::UNKNOWN; layout_info_ptr->get_binding_properties_by_index_number(n_binding, &binding_index, - nullptr, /* out_opt_descriptor_type_ptr */ + &descriptor_type, &array_size, nullptr, /* out_opt_stage_flags_ptr */ nullptr, /* out_opt_immutable_samplers_enabled_ptr */ @@ -331,11 +332,17 @@ void Anvil::DescriptorSet::alloc_bindings() array_size = variable_descriptor_count_binding_size; } - if (m_bindings[binding_index].size() != array_size) + auto binding_iterator = m_binding_ptrs.find(binding_index); + + if (binding_iterator == m_binding_ptrs.end() || + binding_iterator->second.size() != array_size) { - m_bindings[binding_index] = BindingItems(); + m_binding_ptrs[binding_index] = BindingItemUniquePtrs(); - m_bindings[binding_index].resize(array_size); + if (descriptor_type != Anvil::DescriptorType::INLINE_UNIFORM_BLOCK) + { + m_binding_ptrs[binding_index].resize(array_size); + } } } } @@ -398,6 +405,16 @@ void Anvil::DescriptorSet::fill_image_info_vk_descriptor(const Anvil::Descriptor } } +/* Please see header for specification */ +void Anvil::DescriptorSet::fill_iub_vk_descriptor(const Anvil::DescriptorSet::BindingItem& in_binding_item, + VkWriteDescriptorSetInlineUniformBlockEXT* out_descriptor_ptr) const +{ + out_descriptor_ptr->dataSize = static_cast(in_binding_item.size); + out_descriptor_ptr->pData = in_binding_item.iub_update_data_ptr.get(); + out_descriptor_ptr->pNext = nullptr; + out_descriptor_ptr->sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT; +} + /* Please see header for specification */ bool Anvil::DescriptorSet::get_combined_image_sampler_binding_properties(uint32_t in_n_binding, uint32_t in_n_binding_array_item, @@ -405,41 +422,41 @@ bool Anvil::DescriptorSet::get_combined_image_sampler_binding_properties(uint32_ Anvil::ImageView** out_opt_image_view_ptr_ptr, Anvil::Sampler** out_opt_sampler_ptr_ptr) { - decltype(m_bindings)::const_iterator binding_iterator = m_bindings.find(in_n_binding); - bool result = true; + decltype(m_binding_ptrs)::const_iterator binding_ptr_iterator = m_binding_ptrs.find(in_n_binding); + bool result = true; - if (binding_iterator == m_bindings.end() ) + if (binding_ptr_iterator == m_binding_ptrs.end() ) { - anvil_assert(binding_iterator != m_bindings.end()); + anvil_assert(binding_ptr_iterator != m_binding_ptrs.end()); result = false; goto end; } - if (binding_iterator->second.size() <= in_n_binding_array_item) + if (binding_ptr_iterator->second.size() <= in_n_binding_array_item) { - anvil_assert(binding_iterator->second.size() > in_n_binding_array_item); + anvil_assert(binding_ptr_iterator->second.size() > in_n_binding_array_item); result = false; goto end; } else { - auto binding_item_iterator = binding_iterator->second.begin() + in_n_binding_array_item; + auto binding_item_iterator = binding_ptr_iterator->second.begin() + in_n_binding_array_item; if (out_opt_image_layout_ptr != nullptr) { - *out_opt_image_layout_ptr = binding_item_iterator->image_layout; + *out_opt_image_layout_ptr = (*binding_item_iterator)->image_layout; } if (out_opt_image_view_ptr_ptr != nullptr) { - *out_opt_image_view_ptr_ptr= binding_item_iterator->image_view_ptr; + *out_opt_image_view_ptr_ptr = (*binding_item_iterator)->image_view_ptr; } if (out_opt_sampler_ptr_ptr != nullptr) { - *out_opt_sampler_ptr_ptr = binding_item_iterator->sampler_ptr; + *out_opt_sampler_ptr_ptr = (*binding_item_iterator)->sampler_ptr; } } @@ -453,12 +470,12 @@ bool Anvil::DescriptorSet::get_input_attachment_binding_properties(uint32_t Anvil::ImageLayout* out_opt_image_layout_ptr, Anvil::ImageView** out_opt_image_view_ptr_ptr) const { - decltype(m_bindings)::const_iterator binding_iterator = m_bindings.find(in_n_binding); - bool result = true; + decltype(m_binding_ptrs)::const_iterator binding_iterator = m_binding_ptrs.find(in_n_binding); + bool result = true; - if (binding_iterator == m_bindings.end() ) + if (binding_iterator == m_binding_ptrs.end() ) { - anvil_assert(binding_iterator != m_bindings.end()); + anvil_assert(binding_iterator != m_binding_ptrs.end()); result = false; goto end; @@ -477,12 +494,12 @@ bool Anvil::DescriptorSet::get_input_attachment_binding_properties(uint32_t if (out_opt_image_layout_ptr != nullptr) { - *out_opt_image_layout_ptr = binding_item_iterator->image_layout; + *out_opt_image_layout_ptr = (*binding_item_iterator)->image_layout; } if (out_opt_image_view_ptr_ptr != nullptr) { - *out_opt_image_view_ptr_ptr = binding_item_iterator->image_view_ptr; + *out_opt_image_view_ptr_ptr = (*binding_item_iterator)->image_view_ptr; } } @@ -495,12 +512,12 @@ bool Anvil::DescriptorSet::get_sampler_binding_properties(uint32_t in_n_ uint32_t in_n_binding_array_item, Anvil::Sampler** out_sampler_ptr_ptr) const { - decltype(m_bindings)::const_iterator binding_iterator = m_bindings.find(in_n_binding); - bool result = true; + decltype(m_binding_ptrs)::const_iterator binding_iterator = m_binding_ptrs.find(in_n_binding); + bool result = true; - if (binding_iterator == m_bindings.end() ) + if (binding_iterator == m_binding_ptrs.end() ) { - anvil_assert(binding_iterator != m_bindings.end()); + anvil_assert(binding_iterator != m_binding_ptrs.end()); result = false; goto end; @@ -519,7 +536,7 @@ bool Anvil::DescriptorSet::get_sampler_binding_properties(uint32_t in_n_ if (out_sampler_ptr_ptr != nullptr) { - *out_sampler_ptr_ptr = binding_item_iterator->sampler_ptr; + *out_sampler_ptr_ptr = (*binding_item_iterator)->sampler_ptr; } } @@ -534,12 +551,12 @@ bool Anvil::DescriptorSet::get_storage_buffer_binding_properties(uint32_t VkDeviceSize* out_opt_size_ptr, VkDeviceSize* out_opt_start_offset_ptr) const { - decltype(m_bindings)::const_iterator binding_iterator = m_bindings.find(in_n_binding); - bool result = true; + decltype(m_binding_ptrs)::const_iterator binding_iterator = m_binding_ptrs.find(in_n_binding); + bool result = true; - if (binding_iterator == m_bindings.end() ) + if (binding_iterator == m_binding_ptrs.end() ) { - anvil_assert(binding_iterator != m_bindings.end()); + anvil_assert(binding_iterator != m_binding_ptrs.end()); result = false; goto end; @@ -558,17 +575,17 @@ bool Anvil::DescriptorSet::get_storage_buffer_binding_properties(uint32_t if (out_opt_buffer_ptr_ptr != nullptr) { - *out_opt_buffer_ptr_ptr = binding_item_iterator->buffer_ptr; + *out_opt_buffer_ptr_ptr = (*binding_item_iterator)->buffer_ptr; } if (out_opt_size_ptr != nullptr) { - *out_opt_size_ptr = binding_item_iterator->size; + *out_opt_size_ptr = (*binding_item_iterator)->size; } if (out_opt_start_offset_ptr != nullptr) { - *out_opt_start_offset_ptr = binding_item_iterator->start_offset; + *out_opt_start_offset_ptr = (*binding_item_iterator)->start_offset; } } @@ -581,12 +598,12 @@ bool Anvil::DescriptorSet::get_storage_texel_buffer_binding_properties(uint32_t uint32_t in_n_binding_array_item, Anvil::BufferView** out_opt_buffer_view_ptr_ptr) const { - decltype(m_bindings)::const_iterator binding_iterator = m_bindings.find(in_n_binding); - bool result = true; + decltype(m_binding_ptrs)::const_iterator binding_iterator = m_binding_ptrs.find(in_n_binding); + bool result = true; - if (binding_iterator == m_bindings.end() ) + if (binding_iterator == m_binding_ptrs.end() ) { - anvil_assert(binding_iterator != m_bindings.end()); + anvil_assert(binding_iterator != m_binding_ptrs.end()); result = false; goto end; @@ -605,7 +622,7 @@ bool Anvil::DescriptorSet::get_storage_texel_buffer_binding_properties(uint32_t if (out_opt_buffer_view_ptr_ptr != nullptr) { - *out_opt_buffer_view_ptr_ptr = binding_item_iterator->buffer_view_ptr; + *out_opt_buffer_view_ptr_ptr = (*binding_item_iterator)->buffer_view_ptr; } } @@ -625,6 +642,51 @@ void Anvil::DescriptorSet::on_parent_pool_reset() m_unusable = true; } +/* Please see header for specification */ +bool Anvil::DescriptorSet::set_inline_uniform_block_binding_data(const BindingIndex& in_binding_index, + const uint32_t& in_start_offset, + const uint32_t& in_size, + const void* in_raw_data_ptr, + const bool& in_should_cache_raw_data) +{ + BindingItemUniquePtrs& iub_binding_item_ptrs = m_binding_ptrs[in_binding_index]; + auto new_iub_binding_item_ptr = BindingItemUniquePtr(new BindingItem() ); + bool result = false; + + anvil_assert(!m_unusable); + anvil_assert((in_start_offset % 4) == 0); + anvil_assert((in_size % 4) == 0); + + if (in_should_cache_raw_data) + { + new_iub_binding_item_ptr->iub_update_data_ptr = decltype(new_iub_binding_item_ptr->iub_update_data_ptr)(new uint8_t[in_size], + [](uint8_t* in_ptr){delete [] in_ptr;}); + + memcpy(new_iub_binding_item_ptr->iub_update_data_ptr.get(), + in_raw_data_ptr, + in_size); + } + else + { + new_iub_binding_item_ptr->iub_update_data_ptr = decltype(new_iub_binding_item_ptr->iub_update_data_ptr)(const_cast(reinterpret_cast(in_raw_data_ptr) ), + [](uint8_t*){} ); + } + + new_iub_binding_item_ptr->dirty = true; + new_iub_binding_item_ptr->size = in_size; + new_iub_binding_item_ptr->start_offset = in_start_offset; + new_iub_binding_item_ptr->type_vk = Anvil::DescriptorType::INLINE_UNIFORM_BLOCK; + + iub_binding_item_ptrs.push_back( + std::move(new_iub_binding_item_ptr) + ); + + m_dirty = true; + result = true; + + return result; +} + bool Anvil::DescriptorSet::update(const DescriptorSetUpdateMethod& in_update_method) const { bool result; @@ -663,8 +725,9 @@ bool Anvil::DescriptorSet::update(const DescriptorSetUpdateMethod& in_update_met /* Please see header for specification */ bool Anvil::DescriptorSet::update_using_core_method() const { - const auto layout_info_ptr = m_layout_ptr->get_create_info(); - bool result = false; + std::vector iub_binding_indices; + const auto layout_info_ptr = m_layout_ptr->get_create_info(); + bool result = false; anvil_assert(!m_unusable); @@ -672,8 +735,9 @@ bool Anvil::DescriptorSet::update_using_core_method() const { uint32_t cached_ds_buffer_info_items_array_offset = 0; uint32_t cached_ds_image_info_items_array_offset = 0; + uint32_t cached_ds_iub_array_offset = 0; uint32_t cached_ds_texel_buffer_info_items_array_offset = 0; - const uint32_t n_bindings = static_cast(m_bindings.size() ); + const uint32_t n_bindings = static_cast(m_binding_ptrs.size() ); m_cached_ds_info_buffer_info_items_vk.clear (); m_cached_ds_info_image_info_items_vk.clear (); @@ -681,11 +745,11 @@ bool Anvil::DescriptorSet::update_using_core_method() const m_cached_ds_write_items_vk.clear (); { - uint32_t n_max_ds_info_items_to_cache = 0; + uint32_t n_max_ds_info_items_to_cache = 0; - for (auto& binding : m_bindings) + for (auto& binding_map_item : m_binding_ptrs) { - const uint32_t n_current_binding_items = static_cast(binding.second.size() ); + const uint32_t n_current_binding_items = static_cast(binding_map_item.second.size() ); n_max_ds_info_items_to_cache += n_current_binding_items; } @@ -701,18 +765,20 @@ bool Anvil::DescriptorSet::update_using_core_method() const { Anvil::DescriptorBindingFlags current_binding_flags; uint32_t current_binding_index; + uint32_t descriptor_array_size = 0; Anvil::DescriptorType descriptor_type; bool immutable_samplers_enabled = false; uint32_t start_ds_buffer_info_items_array_offset = cached_ds_buffer_info_items_array_offset; uint32_t start_ds_image_info_items_array_offset = cached_ds_image_info_items_array_offset; + uint32_t start_ds_iub_array_offset = cached_ds_iub_array_offset; uint32_t start_ds_texel_buffer_info_items_array_offset = cached_ds_texel_buffer_info_items_array_offset; VkWriteDescriptorSet write_ds_vk; if (!layout_info_ptr->get_binding_properties_by_index_number(n_binding, ¤t_binding_index, &descriptor_type, - nullptr, /* out_opt_descriptor_array_size_ptr */ - nullptr, /* out_opt_stage_flags_ptr */ + &descriptor_array_size, + nullptr, /* out_opt_stage_flags_ptr */ &immutable_samplers_enabled, ¤t_binding_flags) ) { @@ -720,30 +786,45 @@ bool Anvil::DescriptorSet::update_using_core_method() const } /* For each array item, initialize a descriptor info item.. */ - BindingItems& current_binding_items = m_bindings.at(current_binding_index); - const uint32_t n_current_binding_items = static_cast(current_binding_items.size() ); - int32_t n_last_binding_item = -1; + BindingItemUniquePtrs& current_binding_item_ptrs = m_binding_ptrs.at(current_binding_index); + uint32_t n_current_binding_items = static_cast(current_binding_item_ptrs.size() ); + int32_t n_last_binding_item = -1; for (uint32_t n_current_binding_item = 0; n_current_binding_item < n_current_binding_items; ++n_current_binding_item) { - BindingItem& current_binding_item = current_binding_items.at(n_current_binding_item); - bool needs_write_item = ((n_current_binding_item + 1) == n_current_binding_items); + auto& current_binding_item_ptr = current_binding_item_ptrs.at(n_current_binding_item); + bool needs_write_item = ((n_current_binding_item + 1) == n_current_binding_items); + + if (descriptor_type == Anvil::DescriptorType::INLINE_UNIFORM_BLOCK) + { + /* Binding items for this descriptor type correspond internally to consecutive update requests which have been scheduled for + * the same IUB binding. As per API restrictions, only one such update can be carried out using a single VkWriteDescriptorSet struct. + */ + n_last_binding_item = static_cast(current_binding_item_ptr->start_offset) - 1; //< write_ds_vk.dstArrayElement corresponds to start offset for inline uniform blocks + + if (n_current_binding_item == 0) + { + iub_binding_indices.push_back(n_binding); + } + } /* TODO: For arrayed binding items, avoid updating all binding items every time baking is triggered. */ - if (!current_binding_item.dirty && - n_current_binding_item == 0 && - n_current_binding_items == 1) + if ( current_binding_item_ptr != nullptr && + !current_binding_item_ptr->dirty && + n_current_binding_item == 0 && + n_current_binding_items == 1) { continue; } - if (current_binding_item.buffer_ptr != nullptr) + if (current_binding_item_ptr != nullptr && + current_binding_item_ptr->buffer_ptr != nullptr) { VkDescriptorBufferInfo buffer_info; - fill_buffer_info_vk_descriptor(current_binding_item, + fill_buffer_info_vk_descriptor(*current_binding_item_ptr, &buffer_info); m_cached_ds_info_buffer_info_items_vk.push_back(buffer_info); @@ -751,19 +832,21 @@ bool Anvil::DescriptorSet::update_using_core_method() const ++cached_ds_buffer_info_items_array_offset; } else - if (current_binding_item.buffer_view_ptr != nullptr) + if (current_binding_item_ptr != nullptr && + current_binding_item_ptr->buffer_view_ptr != nullptr) { - m_cached_ds_info_texel_buffer_info_items_vk.push_back( current_binding_item.buffer_view_ptr->get_buffer_view() ); + m_cached_ds_info_texel_buffer_info_items_vk.push_back(current_binding_item_ptr->buffer_view_ptr->get_buffer_view() ); ++cached_ds_texel_buffer_info_items_array_offset; } else - if (current_binding_item.image_view_ptr != nullptr || - current_binding_item.sampler_ptr != nullptr) + if ( current_binding_item_ptr != nullptr && + (current_binding_item_ptr->image_view_ptr != nullptr || + current_binding_item_ptr->sampler_ptr != nullptr) ) { VkDescriptorImageInfo image_info; - fill_image_info_vk_descriptor(current_binding_item, + fill_image_info_vk_descriptor(*current_binding_item_ptr, immutable_samplers_enabled, &image_info); @@ -772,6 +855,19 @@ bool Anvil::DescriptorSet::update_using_core_method() const ++cached_ds_image_info_items_array_offset; } else + if (descriptor_type == Anvil::DescriptorType::INLINE_UNIFORM_BLOCK) + { + VkWriteDescriptorSetInlineUniformBlockEXT iub_info; + + fill_iub_vk_descriptor(*current_binding_item_ptr, + &iub_info); + + m_cached_ds_write_iub_items_vk.at(start_ds_iub_array_offset) = iub_info; + + needs_write_item = true; + cached_ds_iub_array_offset ++; + } + else { /* Arrayed bindings are only permitted if the binding has been created with the PARTIALLY_BOUND flag */ if ((current_binding_flags & Anvil::DescriptorBindingFlagBits::PARTIALLY_BOUND_BIT) == 0) @@ -787,9 +883,26 @@ bool Anvil::DescriptorSet::update_using_core_method() const if (needs_write_item) { - const uint32_t n_descriptors = (cached_ds_buffer_info_items_array_offset - start_ds_buffer_info_items_array_offset) + - (cached_ds_image_info_items_array_offset - start_ds_image_info_items_array_offset) + - (cached_ds_texel_buffer_info_items_array_offset - start_ds_texel_buffer_info_items_array_offset); + uint32_t n_descriptors = 0; + + if (descriptor_type == Anvil::DescriptorType::INLINE_UNIFORM_BLOCK) + { + anvil_assert((cached_ds_buffer_info_items_array_offset - start_ds_buffer_info_items_array_offset) + + (cached_ds_image_info_items_array_offset - start_ds_image_info_items_array_offset) + + (cached_ds_texel_buffer_info_items_array_offset - start_ds_texel_buffer_info_items_array_offset) == 0); + + n_descriptors = m_cached_ds_write_iub_items_vk.at(start_ds_iub_array_offset).dataSize; + + anvil_assert(n_descriptors != 0); + } + else + { + anvil_assert(cached_ds_iub_array_offset == start_ds_iub_array_offset); + + n_descriptors = (cached_ds_buffer_info_items_array_offset - start_ds_buffer_info_items_array_offset) + + (cached_ds_image_info_items_array_offset - start_ds_image_info_items_array_offset) + + (cached_ds_texel_buffer_info_items_array_offset - start_ds_texel_buffer_info_items_array_offset); + } if (n_descriptors > 0) { @@ -812,13 +925,27 @@ bool Anvil::DescriptorSet::update_using_core_method() const m_cached_ds_write_items_vk.push_back(write_ds_vk); } + if (start_ds_iub_array_offset - cached_ds_iub_array_offset) + { + /* TODO: This is ugly but will always work, as you can't use vkUpdateDescriptorSets() for any other updates if inline uniform block's contents is + * being refreshed. Still, we should be using struct chains instead here. + */ + anvil_assert((cached_ds_iub_array_offset - start_ds_iub_array_offset) == 1); + + m_cached_ds_write_items_vk.back().pNext = &m_cached_ds_write_iub_items_vk.at(start_ds_iub_array_offset); + } + n_last_binding_item = n_current_binding_item; start_ds_buffer_info_items_array_offset = cached_ds_buffer_info_items_array_offset; start_ds_image_info_items_array_offset = cached_ds_image_info_items_array_offset; + start_ds_iub_array_offset = cached_ds_iub_array_offset; start_ds_texel_buffer_info_items_array_offset = cached_ds_texel_buffer_info_items_array_offset; } - current_binding_item.dirty = false; + if (current_binding_item_ptr != nullptr) + { + current_binding_item_ptr->dirty = false; + } } } @@ -830,6 +957,16 @@ bool Anvil::DescriptorSet::update_using_core_method() const &m_cached_ds_write_items_vk[0], 0, /* copyCount */ nullptr); /* pDescriptorCopies */ + + /* If any IUB bindings have been processed, wipe out binding items associated with these, as the corresponding updates have already + * been performed. + */ + for (const auto& current_iub_binding_index : iub_binding_indices) + { + auto& current_iub_binding = m_binding_ptrs.at(current_iub_binding_index); + + current_iub_binding.clear(); + } } m_dirty = false; @@ -862,7 +999,7 @@ bool Anvil::DescriptorSet::update_using_template_method() const /* First build up a vector of template entries we need the template to encapsulate. While on it, * also construct an array of descriptors we're going to pass along the template. */ - const uint32_t n_bindings = static_cast(m_bindings.size() ); + const uint32_t n_bindings = static_cast(m_binding_ptrs.size() ); decltype(m_template_object_map)::const_iterator template_object_iterator; m_template_entries.clear (); @@ -872,11 +1009,11 @@ bool Anvil::DescriptorSet::update_using_template_method() const n_binding < n_bindings; ++n_binding) { - const std::vector* binding_element_vec_ptr = nullptr; - uint32_t current_binding_index = UINT32_MAX; - Anvil::DescriptorType descriptor_type = Anvil::DescriptorType::UNKNOWN; - bool immutable_samplers_enabled = false; - uint32_t n_binding_elements = 0; + const std::vector* binding_element_ptr_vec_ptr = nullptr; + uint32_t current_binding_index = UINT32_MAX; + Anvil::DescriptorType descriptor_type = Anvil::DescriptorType::UNKNOWN; + bool immutable_samplers_enabled = false; + uint32_t n_binding_elements = 0; if (!layout_info_ptr->get_binding_properties_by_index_number(n_binding, ¤t_binding_index, @@ -892,14 +1029,14 @@ bool Anvil::DescriptorSet::update_using_template_method() const goto end; } - binding_element_vec_ptr = &m_bindings.at(current_binding_index); - n_binding_elements = static_cast(binding_element_vec_ptr->size() ); + binding_element_ptr_vec_ptr = &m_binding_ptrs.at(current_binding_index); + n_binding_elements = static_cast(binding_element_ptr_vec_ptr->size() ); for (uint32_t n_binding_element = 0; n_binding_element < n_binding_elements; ++n_binding_element) { - const auto& current_binding_element = binding_element_vec_ptr->at(n_binding_element); + const auto& current_binding_element = *binding_element_ptr_vec_ptr->at(n_binding_element); const uint32_t current_template_raw_data_size = static_cast(m_template_raw_data.size() ); if (!current_binding_element.dirty) @@ -935,6 +1072,14 @@ bool Anvil::DescriptorSet::update_using_template_method() const reinterpret_cast(&m_template_raw_data.at(current_template_raw_data_size) )); } else + if (current_binding_element.type_vk == Anvil::DescriptorType::INLINE_UNIFORM_BLOCK) + { + m_template_raw_data.resize(current_template_raw_data_size + sizeof(VkWriteDescriptorSetInlineUniformBlockEXT) ); + + fill_iub_vk_descriptor(current_binding_element, + reinterpret_cast(&m_template_raw_data.at(current_template_raw_data_size) )); + } + else { anvil_assert_fail(); diff --git a/src/wrappers/descriptor_set_group.cpp b/src/wrappers/descriptor_set_group.cpp index 7e05172d..48aacd58 100644 --- a/src/wrappers/descriptor_set_group.cpp +++ b/src/wrappers/descriptor_set_group.cpp @@ -21,6 +21,7 @@ // #include "misc/debug.h" +#include "misc/descriptor_pool_create_info.h" #include "misc/object_tracker.h" #include "wrappers/descriptor_pool.h" #include "wrappers/descriptor_set.h" @@ -48,16 +49,9 @@ Anvil::DescriptorSetGroup::DescriptorSetGroup(const Anvil::BaseDevice* { auto ds_layout_manager_ptr = m_device_ptr->get_descriptor_set_layout_manager(); - memset(m_overhead_allocations, - 0, - sizeof(m_overhead_allocations) ); - memset(m_pool_size_per_descriptor_type, - 0, - sizeof(m_pool_size_per_descriptor_type) ); - for (const auto& overhead_alloc : in_opt_overhead_allocations) { - m_overhead_allocations[static_cast(overhead_alloc.descriptor_type)] = overhead_alloc.n_overhead_allocations; + m_descriptor_type_properties[overhead_alloc.descriptor_type].n_overhead_allocations = overhead_alloc.n_overhead_allocations; } /* Initialize descriptor pool */ @@ -114,22 +108,43 @@ Anvil::DescriptorSetGroup::DescriptorSetGroup(const DescriptorSetGroup* in_paren { auto descriptor_set_layout_manager_ptr = m_device_ptr->get_descriptor_set_layout_manager(); - anvil_assert( in_parent_dsg_ptr->m_parent_dsg_ptr == nullptr); - anvil_assert(((in_parent_dsg_ptr->m_descriptor_pool_ptr->get_flags() & Anvil::DescriptorPoolCreateFlagBits::FREE_DESCRIPTOR_SET_BIT) != 0) == in_releaseable_sets); + anvil_assert( in_parent_dsg_ptr->m_parent_dsg_ptr == nullptr); + anvil_assert(((in_parent_dsg_ptr->m_descriptor_pool_ptr->get_create_info_ptr()->get_create_flags() & Anvil::DescriptorPoolCreateFlagBits::FREE_DESCRIPTOR_SET_BIT) != 0) == in_releaseable_sets); + + m_descriptor_type_properties = in_parent_dsg_ptr->m_descriptor_type_properties; - memcpy(m_pool_size_per_descriptor_type, - in_parent_dsg_ptr->m_pool_size_per_descriptor_type, - sizeof(m_pool_size_per_descriptor_type) ); - memset(m_overhead_allocations, - 0, - sizeof(m_overhead_allocations) ); + for (auto& current_descriptor_type_props : m_descriptor_type_properties) + { + current_descriptor_type_props.second.n_overhead_allocations = 0; + } /* Initialize descriptor pool */ - m_descriptor_pool_ptr = Anvil::DescriptorPool::create(in_parent_dsg_ptr->m_device_ptr, - in_parent_dsg_ptr->m_descriptor_pool_ptr->get_n_maximum_sets(), - in_parent_dsg_ptr->m_descriptor_pool_ptr->get_flags (), - m_pool_size_per_descriptor_type, - Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() )); + { + auto dp_create_info_ptr = Anvil::DescriptorPoolCreateInfo::create(in_parent_dsg_ptr->m_device_ptr, + in_parent_dsg_ptr->m_descriptor_pool_ptr->get_create_info_ptr()->get_n_maximum_sets(), + in_parent_dsg_ptr->m_descriptor_pool_ptr->get_create_info_ptr()->get_create_flags (), + Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() )); + uint32_t total_pool_size = 0; + + for (const auto& current_descriptor_type_props : m_descriptor_type_properties) + { + dp_create_info_ptr->set_n_descriptors_for_descriptor_type(current_descriptor_type_props.first, + current_descriptor_type_props.second.pool_size); + + total_pool_size += current_descriptor_type_props.second.pool_size; + } + + if (total_pool_size == 0) + { + /* Request space for anything. This is required for correct dummy DSG support, as zero-sized pools are forbidden by the spec. */ + anvil_assert(dp_create_info_ptr->get_n_descriptors_for_descriptor_type(Anvil::DescriptorType::SAMPLER) == 0); + + dp_create_info_ptr->set_n_descriptors_for_descriptor_type(Anvil::DescriptorType::SAMPLER, + 1); + } + + m_descriptor_pool_ptr = Anvil::DescriptorPool::create(std::move(dp_create_info_ptr) ); + } /* Configure the new DSG instance to use the specified parent DSG */ for (const auto& ds : in_parent_dsg_ptr->m_descriptor_sets) @@ -170,10 +185,11 @@ Anvil::DescriptorSetGroup::~DescriptorSetGroup() /** Re-creates internally-maintained descriptor pool. **/ bool Anvil::DescriptorSetGroup::bake_descriptor_pool() { - Anvil::DescriptorPoolCreateFlags flags = ((m_releaseable_sets) ? Anvil::DescriptorPoolCreateFlagBits::FREE_DESCRIPTOR_SET_BIT : Anvil::DescriptorPoolCreateFlagBits::NONE); - std::unique_lock mutex_lock; - auto mutex_ptr = get_mutex(); - bool result = false; + Anvil::DescriptorPoolCreateFlags flags = ((m_releaseable_sets) ? Anvil::DescriptorPoolCreateFlagBits::FREE_DESCRIPTOR_SET_BIT : Anvil::DescriptorPoolCreateFlagBits::NONE); + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + std::unordered_map n_descriptors_needed_map; + bool result = false; if (mutex_ptr != nullptr) { @@ -188,12 +204,6 @@ bool Anvil::DescriptorSetGroup::bake_descriptor_pool() } /* Count how many descriptor of what types need to have pool space allocated */ - uint32_t n_descriptors_needed_array[VK_DESCRIPTOR_TYPE_RANGE_SIZE]; - - memset(n_descriptors_needed_array, - 0, - sizeof(n_descriptors_needed_array) ); - for (auto& current_ds : m_descriptor_sets) { const Anvil::DescriptorSetCreateInfo* current_ds_create_info_ptr = nullptr; @@ -232,11 +242,6 @@ bool Anvil::DescriptorSetGroup::bake_descriptor_pool() nullptr, /* out_opt_immutable_samplers_enabled_ptr */ &ds_binding_flags); - if (ds_binding_type > static_cast(VK_DESCRIPTOR_TYPE_END_RANGE) ) - { - continue; - } - if (ds_binding_index == variable_descriptor_binding_index) { ds_binding_array_size = variable_descriptor_binding_size; @@ -247,16 +252,13 @@ bool Anvil::DescriptorSetGroup::bake_descriptor_pool() flags |= Anvil::DescriptorPoolCreateFlagBits::UPDATE_AFTER_BIND_BIT; } - n_descriptors_needed_array[static_cast(ds_binding_type)] += ds_binding_array_size; + n_descriptors_needed_map[ds_binding_type] += ds_binding_array_size; } } - /* Configure the underlying descriptor pool wrapper */ - for (uint32_t n_descriptor_type = 0; - n_descriptor_type < VK_DESCRIPTOR_TYPE_RANGE_SIZE; - ++n_descriptor_type) + for (auto& current_map_entry : n_descriptors_needed_map) { - m_pool_size_per_descriptor_type[n_descriptor_type] = n_descriptors_needed_array[n_descriptor_type] + m_overhead_allocations[n_descriptor_type]; + current_map_entry.second += m_descriptor_type_properties[current_map_entry.first].n_overhead_allocations; } /* Verify we can actually create the pool.. */ @@ -271,11 +273,20 @@ bool Anvil::DescriptorSetGroup::bake_descriptor_pool() } /* Create the pool */ - m_descriptor_pool_ptr = Anvil::DescriptorPool::create(m_device_ptr, - m_n_unique_dses, - flags | m_user_specified_pool_flags, - m_pool_size_per_descriptor_type, - Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() )); + { + auto dp_create_info_ptr = Anvil::DescriptorPoolCreateInfo::create(m_device_ptr, + m_n_unique_dses, + flags | m_user_specified_pool_flags, + Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() )); + + for (const auto& current_n_descriptors_needed_map_entry : n_descriptors_needed_map) + { + dp_create_info_ptr->set_n_descriptors_for_descriptor_type(current_n_descriptors_needed_map_entry.first, + current_n_descriptors_needed_map_entry.second); + } + + m_descriptor_pool_ptr = Anvil::DescriptorPool::create(std::move(dp_create_info_ptr) ); + } if (m_descriptor_pool_ptr == nullptr) { diff --git a/src/wrappers/device.cpp b/src/wrappers/device.cpp index 443346d8..7bca5f0c 100644 --- a/src/wrappers/device.cpp +++ b/src/wrappers/device.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2019 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -46,13 +46,12 @@ #endif /* Please see header for specification */ -Anvil::BaseDevice::BaseDevice(const Anvil::Instance* in_parent_instance_ptr, - bool in_mt_safe) - :MTSafetySupportProvider(in_mt_safe), - m_device (VK_NULL_HANDLE), - m_parent_instance_ptr (in_parent_instance_ptr) +Anvil::BaseDevice::BaseDevice(Anvil::DeviceCreateInfoUniquePtr in_create_info_ptr) + :MTSafetySupportProvider(in_create_info_ptr->should_be_mt_safe() ), + m_create_info_ptr (std::move(in_create_info_ptr) ), + m_device (VK_NULL_HANDLE) { - m_khr_surface_extension_entrypoints = m_parent_instance_ptr->get_extension_khr_surface_entrypoints(); + m_khr_surface_extension_entrypoints = m_create_info_ptr->get_physical_device_ptrs().at(0)->get_instance()->get_extension_khr_surface_entrypoints(); /* Register the instance */ Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::DEVICE, @@ -94,15 +93,256 @@ Anvil::BaseDevice::~BaseDevice() } } +/** TODO */ +void Anvil::BaseDevice::create_device(const std::vector& in_extensions, + const std::vector& in_layers, + DeviceQueueFamilyInfo* out_queue_families_ptr) +{ + const auto& physical_device_ptrs (m_create_info_ptr->get_physical_device_ptrs() ); + std::vector physical_devices (physical_device_ptrs.size () ); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + Anvil::StructChainer struct_chainer; + const Anvil::PhysicalDevice* zeroth_physical_device_ptr (physical_device_ptrs.at (0) ); + const auto& zeroth_physical_device_queue_fams(zeroth_physical_device_ptr->get_queue_families() ); + + ANVIL_REDUNDANT_VARIABLE(result); + + for (uint32_t n_physical_device = 0; + n_physical_device < static_cast(physical_devices.size() ); + ++n_physical_device) + { + physical_devices.at(n_physical_device) = physical_device_ptrs.at(n_physical_device)->get_physical_device(); + } + + { + Anvil::StructID root_create_info_struct_id = 0; + + /* Root structure */ + { + VkDeviceCreateInfo create_info; + + create_info.enabledExtensionCount = static_cast(in_extensions.size() ); + create_info.enabledLayerCount = static_cast(in_layers.size () ); + create_info.flags = 0; + create_info.pEnabledFeatures = nullptr; /* chained */ + create_info.pNext = nullptr; + create_info.ppEnabledExtensionNames = (in_extensions.size() > 0) ? &in_extensions[0] : nullptr; + create_info.ppEnabledLayerNames = (in_layers.size () > 0) ? &in_layers [0] : nullptr; + create_info.pQueueCreateInfos = nullptr; /* chained later */ + create_info.queueCreateInfoCount = 0; /* filled later */ + create_info.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO; + + root_create_info_struct_id = struct_chainer.append_struct(create_info); + } + + /* Queue create info items */ + { + std::vector device_queue_create_info_items; + std::vector device_queue_priorities; + const auto n_queue_fams = static_cast(zeroth_physical_device_queue_fams.size() ); + + /* For any queue that uses non-medium global priority, we're going to need a dedicated device queue create info struct. This is + * to ensure the global priority does not propagate to other queues. + * + * Creation requests for all other queues can be merged into one struct, one per each queue family index. + */ + static VkDeviceQueueGlobalPriorityCreateInfoEXT low_priority_create_info = + { + VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT, + nullptr, /* pNext */ + VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT + }; + static VkDeviceQueueGlobalPriorityCreateInfoEXT high_priority_create_info = + { + VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT, + nullptr, /* pNext */ + VK_QUEUE_GLOBAL_PRIORITY_HIGH_EXT + }; + static VkDeviceQueueGlobalPriorityCreateInfoEXT realtime_priority_create_info = + { + VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT, + nullptr, /* pNext */ + VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT + }; + + /* Prepare a vec of queue priorities we're going to stick into DeviceQueueCreateInfo structure */ + { + uint32_t n_queues_used_so_far = 0; + uint32_t n_total_queues = 0; + + for (uint32_t n_queue_fam = 0; + n_queue_fam < n_queue_fams; + ++n_queue_fam) + { + const auto& n_queues = zeroth_physical_device_queue_fams.at(n_queue_fam).n_queues; + + n_total_queues += n_queues; + } + + device_queue_priorities.resize(n_total_queues, + 0.0f); + + for (uint32_t n_queue_fam = 0; + n_queue_fam < n_queue_fams; + ++n_queue_fam) + { + const auto& n_queues = zeroth_physical_device_queue_fams.at(n_queue_fam).n_queues; + + for (uint32_t n_queue = 0; + n_queue < n_queues; + ++n_queue, ++n_queues_used_so_far) + { + device_queue_priorities.at(n_queues_used_so_far) = m_create_info_ptr->get_queue_priority(n_queue_fam, + n_queue); + } + } + } + + /* Prepare device queue create info structs */ + { + uint32_t n_queues_defined_so_far = 0; + + for (uint32_t n_queue_fam = 0; + n_queue_fam < n_queue_fams; + ++n_queue_fam) + { + const auto& current_queue_fam(zeroth_physical_device_queue_fams.at(n_queue_fam) ); + + if (current_queue_fam.n_queues > 0) + { + int32_t n_queue_consumed_last = -1; + + for (uint32_t n_queue = 0; + n_queue < current_queue_fam.n_queues; + ++n_queue) + { + const auto& current_queue_global_priority = m_create_info_ptr->get_queue_global_priority (n_queue_fam, + n_queue); + const bool current_queue_must_support_protected_memory_ops = m_create_info_ptr->get_queue_must_support_protected_memory_operations(n_queue_fam, + n_queue); + + if (current_queue_must_support_protected_memory_ops || + current_queue_global_priority != Anvil::QueueGlobalPriority::MEDIUM_EXT || + n_queue == static_cast(current_queue_fam.n_queues - 1) ) + { + VkDeviceQueueCreateInfo queue_create_info; + + queue_create_info.flags = 0; + queue_create_info.pNext = nullptr; + queue_create_info.pQueuePriorities = &device_queue_priorities.at(n_queues_defined_so_far); + queue_create_info.queueCount = (n_queue - n_queue_consumed_last); + queue_create_info.queueFamilyIndex = n_queue_fam; + queue_create_info.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO; + + if (current_queue_must_support_protected_memory_ops) + { + queue_create_info.flags |= VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT; + } + + if (current_queue_global_priority == Anvil::QueueGlobalPriority::HIGH_EXT || + current_queue_global_priority == Anvil::QueueGlobalPriority::LOW_EXT || + current_queue_global_priority == Anvil::QueueGlobalPriority::REALTIME_EXT) + { + queue_create_info.pNext = (current_queue_global_priority == Anvil::QueueGlobalPriority::HIGH_EXT) ? &high_priority_create_info + : (current_queue_global_priority == Anvil::QueueGlobalPriority::LOW_EXT) ? &low_priority_create_info + : &realtime_priority_create_info; + } + else + { + anvil_assert(current_queue_global_priority == Anvil::QueueGlobalPriority::MEDIUM_EXT); + } + + device_queue_create_info_items.push_back(queue_create_info); + + n_queue_consumed_last = static_cast(n_queue); + n_queues_defined_so_far += (n_queue - n_queue_consumed_last); + } + } + + } + } + } + + struct_chainer.get_root_struct()->queueCreateInfoCount = static_cast(device_queue_create_info_items.size() ); + + struct_chainer.store_helper_structure_vector(device_queue_create_info_items, + root_create_info_struct_id, + offsetof(VkDeviceCreateInfo, pQueueCreateInfos) ); + } + } + + { + const auto& mem_overallocation_behavior = m_create_info_ptr->get_memory_overallocation_behavior(); + + if (mem_overallocation_behavior != Anvil::MemoryOverallocationBehavior::DEFAULT) + { + VkDeviceMemoryOverallocationCreateInfoAMD overallocation_info; + + overallocation_info.overallocationBehavior = static_cast(mem_overallocation_behavior); + overallocation_info.pNext = nullptr; + overallocation_info.sType = VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD; + + anvil_assert(is_extension_enabled(VK_AMD_MEMORY_OVERALLOCATION_BEHAVIOR_EXTENSION_NAME) ); + + struct_chainer.append_struct(overallocation_info); + } + } + + if (physical_device_ptrs.size() > 1) + { + VkDeviceGroupDeviceCreateInfoKHR device_group_device_create_info; + + device_group_device_create_info.physicalDeviceCount = static_cast(physical_device_ptrs.size() ); + device_group_device_create_info.pPhysicalDevices = &physical_devices[0]; + device_group_device_create_info.pNext = nullptr; + device_group_device_create_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHR; + + struct_chainer.append_struct(device_group_device_create_info); + } + + /* Enable all features available. */ + add_physical_device_features_to_chainer(&struct_chainer); + + /* Issue the request */ + { + auto struct_chain_ptr = struct_chainer.create_chain(); + + result = Anvil::Vulkan::vkCreateDevice(physical_device_ptrs.at(0)->get_physical_device(), + struct_chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_device); + + anvil_assert_vk_call_succeeded(result); + } + + /* Now that all queues are available, assign them to queue families Anvil recognizes. */ + get_queue_family_indices_for_physical_device(physical_device_ptrs.at(0), + out_queue_families_ptr); +} + /** Please see header for specification */ const Anvil::DescriptorSet* Anvil::BaseDevice::get_dummy_descriptor_set() const { + std::unique_lock lock(m_dummy_dsg_mutex); + + if (m_dummy_dsg_ptr == nullptr) + { + init_dummy_dsg(); + } + return m_dummy_dsg_ptr->get_descriptor_set(0); } /** Please see header for specification */ Anvil::DescriptorSetLayout* Anvil::BaseDevice::get_dummy_descriptor_set_layout() const { + std::unique_lock lock(m_dummy_dsg_mutex); + + if (m_dummy_dsg_ptr == nullptr) + { + init_dummy_dsg(); + } + return m_dummy_dsg_ptr->get_descriptor_set_layout(0); } @@ -248,38 +488,103 @@ uint32_t Anvil::BaseDevice::get_n_queues(uint32_t in_n_queue_family) const } /* Please see header for specification */ -void Anvil::BaseDevice::add_physical_device_features_to_chainer(const VkPhysicalDeviceFeatures* in_opt_features_ptr, - Anvil::StructChainer* in_struct_chainer_ptr, - bool in_add_features_struct) const +void Anvil::BaseDevice::add_physical_device_features_to_chainer(Anvil::StructChainer* in_struct_chainer_ptr) const { - const auto& features = get_physical_device_features(); + const auto& features = get_physical_device_features(); + const bool should_add_features_struct = m_create_info_ptr->get_physical_device_ptrs().at(0)->get_instance()->get_enabled_extensions_info()->khr_get_physical_device_properties2(); anvil_assert(in_struct_chainer_ptr != nullptr); - if (in_add_features_struct) + if (should_add_features_struct) { VkPhysicalDeviceFeatures2KHR features_khr; - features_khr.features = (in_opt_features_ptr != nullptr) ? *in_opt_features_ptr - : features.core_vk1_0_features_ptr->get_vk_physical_device_features(); + features_khr.features = features.core_vk1_0_features_ptr->get_vk_physical_device_features(); features_khr.pNext = nullptr; features_khr.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR; in_struct_chainer_ptr->append_struct(features_khr); } + if (m_extension_enabled_info_ptr->get_device_extension_info()->ext_depth_clip_enable() ) + { + in_struct_chainer_ptr->append_struct(features.ext_depth_clip_enable_features_ptr->get_vk_physical_device_depth_clip_enable_features() ); + } + if (m_extension_enabled_info_ptr->get_device_extension_info()->ext_descriptor_indexing() ) { in_struct_chainer_ptr->append_struct(features.ext_descriptor_indexing_features_ptr->get_vk_physical_device_descriptor_indexing_features() ); } + if (m_extension_enabled_info_ptr->get_device_extension_info()->ext_inline_uniform_block() ) + { + in_struct_chainer_ptr->append_struct(features.ext_inline_uniform_block_features_ptr->get_vk_physical_device_inline_uniform_block_features() ); + } + + if (m_extension_enabled_info_ptr->get_device_extension_info()->ext_memory_priority() ) + { + in_struct_chainer_ptr->append_struct(features.ext_memory_priority_features_ptr->get_vk_physical_device_memory_priority_features() ); + } + + if (m_extension_enabled_info_ptr->get_device_extension_info()->ext_scalar_block_layout() ) + { + in_struct_chainer_ptr->append_struct(features.ext_scalar_block_layout_features_ptr->get_vk_physical_device_scalar_block_layout_features_ext() ); + } + + if (m_extension_enabled_info_ptr->get_device_extension_info()->ext_transform_feedback() ) + { + in_struct_chainer_ptr->append_struct(features.ext_transform_feedback_features_ptr->get_vk_physical_device_transform_feedback_features() ); + } + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_16bit_storage() ) { in_struct_chainer_ptr->append_struct(features.khr_16bit_storage_features_ptr->get_vk_physical_device_16_bit_storage_features() ); } + + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_8bit_storage() ) + { + in_struct_chainer_ptr->append_struct(features.khr_8bit_storage_features_ptr->get_vk_physical_device_8_bit_storage_features() ); + } + + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_multiview() ) + { + in_struct_chainer_ptr->append_struct(features.khr_multiview_features_ptr->get_vk_physical_device_multiview_features() ); + } + + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_sampler_ycbcr_conversion() ) + { + in_struct_chainer_ptr->append_struct(features.khr_sampler_ycbcr_conversion_features_ptr->get_vk_physical_device_sampler_ycbcr_conversion_features() ); + } + + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_shader_atomic_int64() ) + { + in_struct_chainer_ptr->append_struct(features.khr_shader_atomic_int64_features_ptr->get_vk_physical_device_shader_atomic_int64_features() ); + } + + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_shader_float16_int8() ) + { + in_struct_chainer_ptr->append_struct(features.khr_float16_int8_features_ptr->get_vk_physical_device_float16_int8_features() ); + } + + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_variable_pointers() ) + { + in_struct_chainer_ptr->append_struct(features.khr_variable_pointer_features_ptr->get_vk_physical_device_variable_pointer_features() ); + } + + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_vulkan_memory_model() ) + { + in_struct_chainer_ptr->append_struct(features.khr_vulkan_memory_model_features_ptr->get_vk_physical_device_vulkan_memory_model_features() ); + } +} + +/* Please see header for specification */ +const Anvil::Instance* Anvil::BaseDevice::get_parent_instance() const +{ + return m_create_info_ptr->get_physical_device_ptrs().at(0)->get_instance(); } /* Please see header for specification */ + Anvil::Queue* Anvil::BaseDevice::get_queue(const Anvil::QueueFamilyType& in_queue_family_type, uint32_t in_n_queue) const { @@ -287,9 +592,9 @@ Anvil::Queue* Anvil::BaseDevice::get_queue(const Anvil::QueueFamilyType& in_queu switch (in_queue_family_type) { - case Anvil::QueueFamilyType::COMPUTE: result_ptr = get_compute_queue (in_n_queue); break; - case Anvil::QueueFamilyType::TRANSFER: result_ptr = get_transfer_queue (in_n_queue); break; - case Anvil::QueueFamilyType::UNIVERSAL: result_ptr = get_universal_queue (in_n_queue); break; + case Anvil::QueueFamilyType::COMPUTE: result_ptr = get_compute_queue (in_n_queue); break; + case Anvil::QueueFamilyType::TRANSFER: result_ptr = get_transfer_queue (in_n_queue); break; + case Anvil::QueueFamilyType::UNIVERSAL: result_ptr = get_universal_queue(in_n_queue); break; default: { @@ -304,7 +609,7 @@ Anvil::Queue* Anvil::BaseDevice::get_queue(const Anvil::QueueFamilyType& in_queu void Anvil::BaseDevice::get_queue_family_indices_for_physical_device(const Anvil::PhysicalDevice* in_physical_device_ptr, DeviceQueueFamilyInfo* out_device_queue_family_info_ptr) const { - const auto n_queue_families = static_cast(in_physical_device_ptr->get_queue_families().size() ); + const auto n_queue_families = static_cast(in_physical_device_ptr->get_queue_families().size() ); std::vector result_compute_queue_families; std::vector result_transfer_queue_families; std::vector result_universal_queue_families; @@ -371,9 +676,9 @@ void Anvil::BaseDevice::get_queue_family_indices_for_physical_device(const Anvil /* NOTE: Vulkan API only guarantees universal queue family's availability */ anvil_assert(result_universal_queue_families.size() > 0); - out_device_queue_family_info_ptr->queue_families[Anvil::QueueFamilyType::COMPUTE] = result_compute_queue_families; - out_device_queue_family_info_ptr->queue_families[Anvil::QueueFamilyType::TRANSFER] = result_transfer_queue_families; - out_device_queue_family_info_ptr->queue_families[Anvil::QueueFamilyType::UNIVERSAL] = result_universal_queue_families; + out_device_queue_family_info_ptr->queue_families[Anvil::QueueFamilyType::COMPUTE] = result_compute_queue_families; + out_device_queue_family_info_ptr->queue_families[Anvil::QueueFamilyType::TRANSFER] = result_transfer_queue_families; + out_device_queue_family_info_ptr->queue_families[Anvil::QueueFamilyType::UNIVERSAL] = result_universal_queue_families; for (Anvil::QueueFamilyType current_queue_family_type = Anvil::QueueFamilyType::FIRST; current_queue_family_type != Anvil::QueueFamilyType::COUNT; @@ -610,21 +915,19 @@ Anvil::Queue* Anvil::BaseDevice::get_sparse_binding_queue(uint32_t in_n } /* Initializes a new Device instance */ -void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, - const std::vector& in_layers, - bool in_transient_command_buffer_allocs_only, - bool in_support_resettable_command_buffer_allocs, - bool in_enable_shader_module_cache) +bool Anvil::BaseDevice::init() { + const auto parent_instance_ptr(m_create_info_ptr->get_physical_device_ptrs().at(0)->get_instance() ); + std::map extensions_final_enabled_status; - VkPhysicalDeviceFeatures features_to_enable; - const bool is_validation_enabled(m_parent_instance_ptr->is_validation_enabled() ); + const bool is_validation_enabled(parent_instance_ptr->is_validation_enabled() ); std::vector layers_final; const auto mt_safety (Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); + bool result (false); /* If validation is enabled, retrieve names of all suported validation layers and * append them to the list of layers the user has alreaedy specified. **/ - for (auto current_layer : in_layers) + for (auto current_layer : m_create_info_ptr->get_layers_to_enable() ) { layers_final.push_back(current_layer.c_str() ); } @@ -644,12 +947,12 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, } /* Go through the extension struct, verify availability of the requested extensions, - * and cache the ones that have been requested and which are available in a linear vector. */ + * and cache the ones that have been requested and which are available in a vector. */ { bool is_amd_negative_viewport_height_defined = false; bool is_khr_maintenance1_defined = false; - for (const auto& current_extension : in_extensions.extension_status) + for (const auto& current_extension : m_create_info_ptr->get_extension_configuration().extension_status) { const bool is_ext_supported = is_physical_device_extension_supported(current_extension.first); @@ -710,35 +1013,252 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, { /* VK_AMD_negative_viewport_height and VK_KHR_maintenance1 extensions are mutually exclusive. */ anvil_assert_fail(); + + goto end; + } + + /* Instantiate the device. Actual behavior behind this is implemented by the overriding class. */ + { + m_extension_enabled_info_ptr = Anvil::ExtensionInfo::create_device_extension_info(extensions_final_enabled_status, + true); /* in_unspecified_extension_name_value */ + + anvil_assert(m_device == VK_NULL_HANDLE); + { + std::vector extension_name_raw_ptrs; + + extension_name_raw_ptrs.reserve(extensions_final_enabled_status.size() ); + + for (const auto& current_extension_data : extensions_final_enabled_status) + { + if (current_extension_data.second) + { + extension_name_raw_ptrs.push_back(current_extension_data.first.c_str() ); + } + } + + create_device(extension_name_raw_ptrs, + layers_final, + &m_device_queue_families); + } + anvil_assert(m_device != VK_NULL_HANDLE); + } + + /* Re-create the "extension enabled info" variable, this time taking into account contexts newer than 1.0. + * + * This is important for applications that use VK 1.1 contexts (or newer) and do not take into account that Vulkan does not + * require implementations to report support for extensions that have been folded into core. + */ + if (m_create_info_ptr->get_physical_device_ptrs().at(0)->supports_core_vk1_1() ) + { + extensions_final_enabled_status[VK_KHR_16BIT_STORAGE_EXTENSION_NAME] = true; + extensions_final_enabled_status[VK_KHR_BIND_MEMORY_2_EXTENSION_NAME] = true; + extensions_final_enabled_status[VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME] = true; + extensions_final_enabled_status[VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME] = true; + extensions_final_enabled_status[VK_KHR_DEVICE_GROUP_EXTENSION_NAME] = true; + extensions_final_enabled_status[VK_KHR_EXTERNAL_FENCE_EXTENSION_NAME] = true; + extensions_final_enabled_status[VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME] = true; + extensions_final_enabled_status[VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME] = true; + extensions_final_enabled_status[VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME] = true; + extensions_final_enabled_status[VK_KHR_MAINTENANCE1_EXTENSION_NAME] = true; + extensions_final_enabled_status[VK_KHR_MAINTENANCE2_EXTENSION_NAME] = true; + extensions_final_enabled_status[VK_KHR_MAINTENANCE3_EXTENSION_NAME] = true; + extensions_final_enabled_status[VK_KHR_MULTIVIEW_EXTENSION_NAME] = true; + extensions_final_enabled_status[VK_KHR_RELAXED_BLOCK_LAYOUT_EXTENSION_NAME] = true; + extensions_final_enabled_status[VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME] = true; + extensions_final_enabled_status[VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME] = true; + extensions_final_enabled_status[VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_EXTENSION_NAME] = true; + extensions_final_enabled_status[VK_KHR_VARIABLE_POINTERS_EXTENSION_NAME] = true; + + m_extension_enabled_info_ptr = Anvil::ExtensionInfo::create_device_extension_info(extensions_final_enabled_status, + true); /* in_unspecified_extension_name_value */ + } + } + + /* Retrieve device-specific func pointers */ + if (!init_extension_func_ptrs() ) + { + anvil_assert_fail(); + + goto end; + } + + /* Spawn queue wrappers */ + for (Anvil::QueueFamilyType queue_family_type = Anvil::QueueFamilyType::FIRST; + queue_family_type < Anvil::QueueFamilyType::COUNT; + queue_family_type = static_cast(static_cast(queue_family_type) + 1)) + { + const uint32_t n_queues = m_device_queue_families.n_total_queues_per_family[static_cast(queue_family_type)]; + std::vector* out_queues_ptr = nullptr; + + if (n_queues == 0) + { + continue; + } + + switch (queue_family_type) + { + case Anvil::QueueFamilyType::COMPUTE: out_queues_ptr = &m_compute_queues; break; + case Anvil::QueueFamilyType::TRANSFER: out_queues_ptr = &m_transfer_queues; break; + case Anvil::QueueFamilyType::UNIVERSAL: out_queues_ptr = &m_universal_queues; break; + + default: + { + anvil_assert_fail(); + } + } + + for (const auto& current_queue_fam : m_device_queue_families.queue_families[queue_family_type]) + { + auto queue_ptr_storage_ptr = &m_queue_ptrs_per_vk_queue_fam[current_queue_fam.family_index]; + + anvil_assert(std::find(m_queue_family_type_to_queue_family_indices[queue_family_type].begin(), + m_queue_family_type_to_queue_family_indices[queue_family_type].end(), + current_queue_fam.family_index) == m_queue_family_type_to_queue_family_indices[queue_family_type].end() ); + + m_queue_family_index_to_types [current_queue_fam.family_index].push_back(queue_family_type); + m_queue_family_type_to_queue_family_indices[queue_family_type].push_back (current_queue_fam.family_index); + + for (uint32_t n_queue = 0; + n_queue < current_queue_fam.n_queues; + ++n_queue) + { + const auto new_queue_global_priority = m_create_info_ptr->get_queue_global_priority(current_queue_fam.family_index, + n_queue); + std::unique_ptr new_queue_ptr = Anvil::Queue::create (this, + current_queue_fam.family_index, + n_queue, + is_mt_safe(), + new_queue_global_priority); + + { + anvil_assert(out_queues_ptr != nullptr); + + out_queues_ptr->push_back(new_queue_ptr.get() ); + } + + /* If this queue supports sparse binding ops, cache it in a separate vector as well */ + if (new_queue_ptr->supports_sparse_bindings() ) + { + m_sparse_binding_queues.push_back(new_queue_ptr.get() ); + } + + /* Cache the queue in general-purpose storage as well */ + if (std::find(queue_ptr_storage_ptr->cbegin(), + queue_ptr_storage_ptr->cend (), + new_queue_ptr.get() ) == queue_ptr_storage_ptr->cend() ) + { + queue_ptr_storage_ptr->push_back(new_queue_ptr.get() ); + } + + m_owned_queues.push_back( + std::move(new_queue_ptr) + ); + } } + } + + /* Instantiate per-queue family command pools */ + m_command_pool_ptr_per_vk_queue_fam.resize(m_device_queue_families.queue_families.size() ); + + for (const auto& current_queue_fam : m_device_queue_families.queue_families) + { + for (const auto& current_queue_fam_queue : current_queue_fam.second) + { + if (m_command_pool_ptr_per_vk_queue_fam.size() <= current_queue_fam_queue.family_index) + { + m_command_pool_ptr_per_vk_queue_fam.resize(current_queue_fam_queue.family_index + 1); + } + + if (m_command_pool_ptr_per_vk_queue_fam[current_queue_fam_queue.family_index] == nullptr) + { + m_command_pool_ptr_per_vk_queue_fam[current_queue_fam_queue.family_index] = + Anvil::CommandPool::create(this, + m_create_info_ptr->get_helper_command_pool_create_flags(), + current_queue_fam_queue.family_index, + mt_safety); + } + } + } + + /* Set up shader module cache, if one was requested. */ + if (m_create_info_ptr->should_enable_shader_module_cache() ) + { + m_shader_module_cache_ptr = Anvil::ShaderModuleCache::create(); + } + + /* Set up the pipeline cache */ + m_pipeline_cache_ptr = Anvil::PipelineCache::create(this, + is_mt_safe() ); + + /* Cache a pipeline layout manager instance. */ + m_pipeline_layout_manager_ptr = Anvil::PipelineLayoutManager::create(this, + is_mt_safe() ); + + /* Cache a descriptor set layout manager. */ + m_descriptor_set_layout_manager_ptr = Anvil::DescriptorSetLayoutManager::create(this, + is_mt_safe() ); + + /* Initialize compute & graphics pipeline managers */ + m_compute_pipeline_manager_ptr = Anvil::ComputePipelineManager::create (this, + is_mt_safe() , + true /* use_pipeline_cache */, + m_pipeline_cache_ptr.get() ); + m_graphics_pipeline_manager_ptr = Anvil::GraphicsPipelineManager::create(this, + is_mt_safe() , + true /* use_pipeline_cache */, + m_pipeline_cache_ptr.get() ); + + /* Continue with specialized initialization */ + init_device(); + + result = true; +end: + return result; +} + +bool Anvil::BaseDevice::init_dummy_dsg() const +{ + bool result = false; + + /* Initialize a dummy descriptor set group */ + std::vector dummy_ds_create_info_ptrs(1); + std::vector dummy_overhead_allocs; + + dummy_overhead_allocs.push_back( + Anvil::OverheadAllocation(Anvil::DescriptorType::SAMPLER, + 1) /* in_n_overhead_allocs */ + ); - m_extension_enabled_info_ptr = Anvil::ExtensionInfo::create_device_extension_info(extensions_final_enabled_status, - true); /* in_unspecified_extension_name_value */ - } + dummy_ds_create_info_ptrs[0] = Anvil::DescriptorSetCreateInfo::create(); + dummy_ds_create_info_ptrs[0]->add_binding(0, /* n_binding */ + Anvil::DescriptorType::UNKNOWN, + 0, /* n_elements */ + Anvil::ShaderStageFlagBits::NONE); /* stage_flags */ - /* Instantiate the device. Actual behavior behind this is implemented by the overriding class. */ - features_to_enable = get_physical_device_features().core_vk1_0_features_ptr->get_vk_physical_device_features(); + m_dummy_dsg_ptr = Anvil::DescriptorSetGroup::create(this, + dummy_ds_create_info_ptrs, + false, /* releaseable_sets */ + Anvil::MTSafety::DISABLED, + dummy_overhead_allocs); - anvil_assert(m_device == VK_NULL_HANDLE); + if (m_dummy_dsg_ptr == nullptr) { - std::vector extension_name_raw_ptrs; + anvil_assert(m_dummy_dsg_ptr != nullptr); - extension_name_raw_ptrs.reserve(extensions_final_enabled_status.size() ); + goto end; + } - for (const auto& current_extension_data : extensions_final_enabled_status) - { - if (current_extension_data.second) - { - extension_name_raw_ptrs.push_back(current_extension_data.first.c_str() ); - } - } + m_dummy_dsg_ptr->get_descriptor_set(0)->update(); - create_device(extension_name_raw_ptrs, - layers_final, - features_to_enable, - &m_device_queue_families); - } - anvil_assert(m_device != VK_NULL_HANDLE); + result = true; +end: + return result; +} + +/** Please see header for specification */ +bool Anvil::BaseDevice::init_extension_func_ptrs() +{ + const bool is_core_vk11_device(m_create_info_ptr->get_physical_device_ptrs().at(0)->supports_core_vk1_1() ); if (m_extension_enabled_info_ptr->get_device_extension_info()->amd_buffer_marker() ) { @@ -818,46 +1338,70 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, anvil_assert(m_ext_transform_feedback_extension_entrypoints.vkCmdEndTransformFeedbackEXT != nullptr); } - if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_descriptor_update_template() ) + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_descriptor_update_template() || + is_core_vk11_device) { - m_khr_descriptor_update_template_extension_entrypoints.vkCreateDescriptorUpdateTemplateKHR = reinterpret_cast (get_proc_address("vkCreateDescriptorUpdateTemplateKHR") ); - m_khr_descriptor_update_template_extension_entrypoints.vkDestroyDescriptorUpdateTemplateKHR = reinterpret_cast(get_proc_address("vkDestroyDescriptorUpdateTemplateKHR") ); - m_khr_descriptor_update_template_extension_entrypoints.vkUpdateDescriptorSetWithTemplateKHR = reinterpret_cast(get_proc_address("vkUpdateDescriptorSetWithTemplateKHR") ); + const auto vk_create_descriptor_update_template_entrypoint_name = (is_core_vk11_device) ? "vkCreateDescriptorUpdateTemplate" + : "vkCreateDescriptorUpdateTemplateKHR"; + const auto vk_destroy_descriptor_update_template_entrypoint_name = (is_core_vk11_device) ? "vkDestroyDescriptorUpdateTemplate" + : "vkDestroyDescriptorUpdateTemplateKHR"; + const auto vk_update_descriptor_update_template_entrypoint_name = (is_core_vk11_device) ? "vkUpdateDescriptorSetWithTemplate" + : "vkUpdateDescriptorSetWithTemplateKHR"; + + m_khr_descriptor_update_template_extension_entrypoints.vkCreateDescriptorUpdateTemplateKHR = reinterpret_cast (get_proc_address(vk_create_descriptor_update_template_entrypoint_name) ); + m_khr_descriptor_update_template_extension_entrypoints.vkDestroyDescriptorUpdateTemplateKHR = reinterpret_cast(get_proc_address(vk_destroy_descriptor_update_template_entrypoint_name)); + m_khr_descriptor_update_template_extension_entrypoints.vkUpdateDescriptorSetWithTemplateKHR = reinterpret_cast(get_proc_address(vk_update_descriptor_update_template_entrypoint_name) ); anvil_assert(m_khr_descriptor_update_template_extension_entrypoints.vkCreateDescriptorUpdateTemplateKHR != nullptr); anvil_assert(m_khr_descriptor_update_template_extension_entrypoints.vkDestroyDescriptorUpdateTemplateKHR != nullptr); anvil_assert(m_khr_descriptor_update_template_extension_entrypoints.vkUpdateDescriptorSetWithTemplateKHR != nullptr); } - if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_device_group() ) + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_device_group() || + is_core_vk11_device) { - m_khr_device_group_extension_entrypoints.vkCmdDispatchBaseKHR = reinterpret_cast (get_proc_address("vkCmdDispatchBaseKHR") ); - m_khr_device_group_extension_entrypoints.vkCmdSetDeviceMaskKHR = reinterpret_cast (get_proc_address("vkCmdSetDeviceMaskKHR") ); - m_khr_device_group_extension_entrypoints.vkGetDeviceGroupPeerMemoryFeaturesKHR = reinterpret_cast (get_proc_address("vkGetDeviceGroupPeerMemoryFeaturesKHR") ); + const auto vk_cmd_dispatch_base_entrypoint_name = (is_core_vk11_device) ? "vkCmdDispatchBase" + : "vkCmdDispatchBaseKHR"; + const auto vk_cmd_set_device_mask_entrypoint_name = (is_core_vk11_device) ? "vkCmdSetDeviceMask" + : "vkCmdSetDeviceMaskKHR"; + const auto vk_get_device_group_peer_memory_features_entrypoint_name = (is_core_vk11_device) ? "vkGetDeviceGroupPeerMemoryFeatures" + : "vkGetDeviceGroupPeerMemoryFeaturesKHR"; - /* NOTE: Certain device group entrypoints are only available if KHR_swapchain is also enabled */ - if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_swapchain() ) - { - m_khr_device_group_extension_entrypoints.vkAcquireNextImage2KHR = reinterpret_cast (get_proc_address("vkAcquireNextImage2KHR") ); - m_khr_device_group_extension_entrypoints.vkGetPhysicalDevicePresentRectanglesKHR = reinterpret_cast(get_proc_address("vkGetPhysicalDevicePresentRectanglesKHR") ); - m_khr_device_group_extension_entrypoints.vkGetDeviceGroupSurfacePresentModesKHR = reinterpret_cast (get_proc_address("vkGetDeviceGroupSurfacePresentModesKHR") ); - m_khr_device_group_extension_entrypoints.vkGetDeviceGroupPresentCapabilitiesKHR = reinterpret_cast (get_proc_address("vkGetDeviceGroupPresentCapabilitiesKHR") ); - - anvil_assert(m_khr_device_group_extension_entrypoints.vkAcquireNextImage2KHR != nullptr); - anvil_assert(m_khr_device_group_extension_entrypoints.vkGetDeviceGroupPresentCapabilitiesKHR != nullptr); - anvil_assert(m_khr_device_group_extension_entrypoints.vkGetDeviceGroupSurfacePresentModesKHR != nullptr); - anvil_assert(m_khr_device_group_extension_entrypoints.vkGetPhysicalDevicePresentRectanglesKHR != nullptr); - } + m_khr_device_group_extension_entrypoints.vkCmdDispatchBaseKHR = reinterpret_cast (get_proc_address(vk_cmd_dispatch_base_entrypoint_name) ); + m_khr_device_group_extension_entrypoints.vkCmdSetDeviceMaskKHR = reinterpret_cast (get_proc_address(vk_cmd_set_device_mask_entrypoint_name) ); + m_khr_device_group_extension_entrypoints.vkGetDeviceGroupPeerMemoryFeaturesKHR = reinterpret_cast (get_proc_address(vk_get_device_group_peer_memory_features_entrypoint_name) ); anvil_assert(m_khr_device_group_extension_entrypoints.vkCmdDispatchBaseKHR != nullptr); anvil_assert(m_khr_device_group_extension_entrypoints.vkCmdSetDeviceMaskKHR != nullptr); anvil_assert(m_khr_device_group_extension_entrypoints.vkGetDeviceGroupPeerMemoryFeaturesKHR != nullptr); + + { + /* NOTE: Certain device group entrypoints are only available if KHR_swapchain is also enabled */ + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_swapchain() ) + { + m_khr_device_group_extension_entrypoints.vkAcquireNextImage2KHR = reinterpret_cast (get_proc_address("vkAcquireNextImage2KHR") ); + m_khr_device_group_extension_entrypoints.vkGetPhysicalDevicePresentRectanglesKHR = reinterpret_cast(get_proc_address("vkGetPhysicalDevicePresentRectanglesKHR") ); + m_khr_device_group_extension_entrypoints.vkGetDeviceGroupSurfacePresentModesKHR = reinterpret_cast (get_proc_address("vkGetDeviceGroupSurfacePresentModesKHR") ); + m_khr_device_group_extension_entrypoints.vkGetDeviceGroupPresentCapabilitiesKHR = reinterpret_cast (get_proc_address("vkGetDeviceGroupPresentCapabilitiesKHR") ); + + anvil_assert(m_khr_device_group_extension_entrypoints.vkAcquireNextImage2KHR != nullptr); + anvil_assert(m_khr_device_group_extension_entrypoints.vkGetDeviceGroupPresentCapabilitiesKHR != nullptr); + anvil_assert(m_khr_device_group_extension_entrypoints.vkGetDeviceGroupSurfacePresentModesKHR != nullptr); + anvil_assert(m_khr_device_group_extension_entrypoints.vkGetPhysicalDevicePresentRectanglesKHR != nullptr); + } + } } - if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_bind_memory2() ) + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_bind_memory2() || + is_core_vk11_device) { - m_khr_bind_memory2_extension_entrypoints.vkBindBufferMemory2KHR = reinterpret_cast(get_proc_address("vkBindBufferMemory2KHR")); - m_khr_bind_memory2_extension_entrypoints.vkBindImageMemory2KHR = reinterpret_cast (get_proc_address("vkBindImageMemory2KHR")); + const char* vk_bind_buffer_memory_2_entrypoint_name = (is_core_vk11_device) ? "vkBindBufferMemory2" + : "vkBindBufferMemory2KHR"; + const char* vk_bind_image_memory_2_entrypoint_name = (is_core_vk11_device) ? "vkBindImageMemory2" + : "vkBindImageMemory2KHR"; + + m_khr_bind_memory2_extension_entrypoints.vkBindBufferMemory2KHR = reinterpret_cast(get_proc_address(vk_bind_buffer_memory_2_entrypoint_name)); + m_khr_bind_memory2_extension_entrypoints.vkBindImageMemory2KHR = reinterpret_cast (get_proc_address(vk_bind_image_memory_2_entrypoint_name)); anvil_assert(m_khr_bind_memory2_extension_entrypoints.vkBindBufferMemory2KHR != nullptr); anvil_assert(m_khr_bind_memory2_extension_entrypoints.vkBindImageMemory2KHR != nullptr); @@ -945,31 +1489,62 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, } #endif - if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_get_memory_requirements2() ) + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_get_memory_requirements2() || + is_core_vk11_device) { - m_khr_get_memory_requirements2_extension_entrypoints.vkGetBufferMemoryRequirements2KHR = reinterpret_cast (get_proc_address("vkGetBufferMemoryRequirements2KHR") ); - m_khr_get_memory_requirements2_extension_entrypoints.vkGetImageMemoryRequirements2KHR = reinterpret_cast (get_proc_address("vkGetImageMemoryRequirements2KHR") ); - m_khr_get_memory_requirements2_extension_entrypoints.vkGetImageSparseMemoryRequirements2KHR = reinterpret_cast(get_proc_address("vkGetImageSparseMemoryRequirements2KHR") ); + const char* vk_get_buffer_memory_requirements_2_entrypoint_name = (is_core_vk11_device) ? "vkGetBufferMemoryRequirements2" + : "vkGetBufferMemoryRequirements2KHR"; + const char* vk_get_image_memory_requirements_2_entrypoint_name = (is_core_vk11_device) ? "vkGetImageMemoryRequirements2" + : "vkGetImageMemoryRequirements2KHR"; + const char* vk_get_image_sparse_memory_requirements_2_entrypoint_name = (is_core_vk11_device) ? "vkGetImageSparseMemoryRequirements2" + : "vkGetImageSparseMemoryRequirements2KHR"; + + m_khr_get_memory_requirements2_extension_entrypoints.vkGetBufferMemoryRequirements2KHR = reinterpret_cast (get_proc_address(vk_get_buffer_memory_requirements_2_entrypoint_name) ); + m_khr_get_memory_requirements2_extension_entrypoints.vkGetImageMemoryRequirements2KHR = reinterpret_cast (get_proc_address(vk_get_image_memory_requirements_2_entrypoint_name) ); + m_khr_get_memory_requirements2_extension_entrypoints.vkGetImageSparseMemoryRequirements2KHR = reinterpret_cast(get_proc_address(vk_get_image_sparse_memory_requirements_2_entrypoint_name) ); anvil_assert(m_khr_get_memory_requirements2_extension_entrypoints.vkGetBufferMemoryRequirements2KHR != nullptr); anvil_assert(m_khr_get_memory_requirements2_extension_entrypoints.vkGetImageMemoryRequirements2KHR != nullptr); anvil_assert(m_khr_get_memory_requirements2_extension_entrypoints.vkGetImageSparseMemoryRequirements2KHR != nullptr); } - if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_maintenance1() ) + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_maintenance1() || + is_core_vk11_device) { - m_khr_maintenance1_extension_entrypoints.vkTrimCommandPoolKHR = reinterpret_cast(get_proc_address("vkTrimCommandPoolKHR") ); + const char* vk_trim_command_pool_entrypoint_name = (is_core_vk11_device) ? "vkTrimCommandPool" + : "vkTrimCommandPoolKHR"; + + m_khr_maintenance1_extension_entrypoints.vkTrimCommandPoolKHR = reinterpret_cast(get_proc_address(vk_trim_command_pool_entrypoint_name) ); anvil_assert(m_khr_maintenance1_extension_entrypoints.vkTrimCommandPoolKHR != nullptr); } - if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_maintenance3() ) + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_maintenance3() || + is_core_vk11_device) { - m_khr_maintenance3_extension_entrypoints.vkGetDescriptorSetLayoutSupportKHR = reinterpret_cast(get_proc_address("vkGetDescriptorSetLayoutSupportKHR") ); + const char* vk_get_descriptor_set_layout_support_entrypoint_name = (is_core_vk11_device) ? "vkGetDescriptorSetLayoutSupport" + : "vkGetDescriptorSetLayoutSupportKHR"; + + m_khr_maintenance3_extension_entrypoints.vkGetDescriptorSetLayoutSupportKHR = reinterpret_cast(get_proc_address(vk_get_descriptor_set_layout_support_entrypoint_name) ); anvil_assert(m_khr_maintenance3_extension_entrypoints.vkGetDescriptorSetLayoutSupportKHR != nullptr); } + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_sampler_ycbcr_conversion() || + is_core_vk11_device) + { + const char* vk_create_sampler_ycbcr_conversion_entrypoint_name = (is_core_vk11_device) ? "vkCreateSamplerYcbcrConversion" + : "vkCreateSamplerYcbcrConversionKHR"; + const char* vk_destroy_sampler_ycbcr_conversion_entrypoint_name = (is_core_vk11_device) ? "vkDestroySamplerYcbcrConversion" + : "vkDestroySamplerYcbcrConversionKHR"; + + m_khr_sampler_ycbcr_conversion_extension_entrypoints.vkCreateSamplerYcbcrConversionKHR = reinterpret_cast (get_proc_address(vk_create_sampler_ycbcr_conversion_entrypoint_name) ); + m_khr_sampler_ycbcr_conversion_extension_entrypoints.vkDestroySamplerYcbcrConversionKHR = reinterpret_cast(get_proc_address(vk_destroy_sampler_ycbcr_conversion_entrypoint_name) ); + + anvil_assert(m_khr_sampler_ycbcr_conversion_extension_entrypoints.vkCreateSamplerYcbcrConversionKHR != nullptr); + anvil_assert(m_khr_sampler_ycbcr_conversion_extension_entrypoints.vkDestroySamplerYcbcrConversionKHR != nullptr); + } + if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_swapchain() ) { m_khr_swapchain_extension_entrypoints.vkAcquireNextImageKHR = reinterpret_cast (get_proc_address("vkAcquireNextImageKHR") ); @@ -985,162 +1560,7 @@ void Anvil::BaseDevice::init(const DeviceExtensionConfiguration& in_extensions, anvil_assert(m_khr_swapchain_extension_entrypoints.vkQueuePresentKHR != nullptr); } - /* Spawn queue wrappers */ - for (Anvil::QueueFamilyType queue_family_type = Anvil::QueueFamilyType::FIRST; - queue_family_type < Anvil::QueueFamilyType::COUNT; - queue_family_type = static_cast(static_cast(queue_family_type) + 1)) - { - const uint32_t n_queues = m_device_queue_families.n_total_queues_per_family[static_cast(queue_family_type)]; - std::vector* out_queues_ptr = nullptr; - - if (n_queues == 0) - { - continue; - } - - switch (queue_family_type) - { - case Anvil::QueueFamilyType::COMPUTE: out_queues_ptr = &m_compute_queues; break; - case Anvil::QueueFamilyType::TRANSFER: out_queues_ptr = &m_transfer_queues; break; - case Anvil::QueueFamilyType::UNIVERSAL: out_queues_ptr = &m_universal_queues; break; - - default: - { - anvil_assert_fail(); - } - } - - for (const auto& current_queue_fam : m_device_queue_families.queue_families[queue_family_type]) - { - auto queue_ptr_storage_ptr = &m_queue_ptrs_per_vk_queue_fam[current_queue_fam.family_index]; - - anvil_assert(std::find(m_queue_family_type_to_queue_family_indices[queue_family_type].begin(), - m_queue_family_type_to_queue_family_indices[queue_family_type].end(), - current_queue_fam.family_index) == m_queue_family_type_to_queue_family_indices[queue_family_type].end() ); - - m_queue_family_index_to_types [current_queue_fam.family_index].push_back(queue_family_type); - m_queue_family_type_to_queue_family_indices[queue_family_type].push_back (current_queue_fam.family_index); - - for (uint32_t n_queue = 0; - n_queue < current_queue_fam.n_queues; - ++n_queue) - { - bool queue_already_instantiated = false; - - if (!queue_already_instantiated) - { - std::unique_ptr new_queue_ptr = Anvil::Queue::create(this, - current_queue_fam.family_index, - n_queue, - is_mt_safe() ); - - { - anvil_assert(out_queues_ptr != nullptr); - - out_queues_ptr->push_back(new_queue_ptr.get() ); - } - - /* If this queue supports sparse binding ops, cache it in a separate vector as well */ - if (new_queue_ptr->supports_sparse_bindings() ) - { - m_sparse_binding_queues.push_back(new_queue_ptr.get() ); - } - - /* Cache the queue in general-purpose storage as well */ - if (std::find(queue_ptr_storage_ptr->cbegin(), - queue_ptr_storage_ptr->cend (), - new_queue_ptr.get() ) == queue_ptr_storage_ptr->cend() ) - { - queue_ptr_storage_ptr->push_back(new_queue_ptr.get() ); - } - - m_owned_queues.push_back( - std::move(new_queue_ptr) - ); - } - } - } - } - - /* Instantiate per-queue family command pools */ - m_command_pool_ptr_per_vk_queue_fam.resize(m_device_queue_families.queue_families.size() ); - - for (const auto& current_queue_fam : m_device_queue_families.queue_families) - { - for (const auto& current_queue_fam_queue : current_queue_fam.second) - { - if (m_command_pool_ptr_per_vk_queue_fam.size() <= current_queue_fam_queue.family_index) - { - m_command_pool_ptr_per_vk_queue_fam.resize(current_queue_fam_queue.family_index + 1); - } - - if (m_command_pool_ptr_per_vk_queue_fam[current_queue_fam_queue.family_index] == nullptr) - { - m_command_pool_ptr_per_vk_queue_fam[current_queue_fam_queue.family_index] = - Anvil::CommandPool::create(this, - in_transient_command_buffer_allocs_only, - in_support_resettable_command_buffer_allocs, - current_queue_fam_queue.family_index, - mt_safety); - } - } - } - - /* Initialize a dummy descriptor set group */ - { - std::vector dummy_ds_create_info_ptrs(1); - std::vector dummy_overhead_allocs; - - dummy_overhead_allocs.push_back( - Anvil::OverheadAllocation(Anvil::DescriptorType::SAMPLER, - 1) /* in_n_overhead_allocs */ - ); - - dummy_ds_create_info_ptrs[0] = Anvil::DescriptorSetCreateInfo::create(); - dummy_ds_create_info_ptrs[0]->add_binding(0, /* n_binding */ - Anvil::DescriptorType::UNKNOWN, - 0, /* n_elements */ - Anvil::ShaderStageFlagBits::NONE); /* stage_flags */ - - m_dummy_dsg_ptr = Anvil::DescriptorSetGroup::create(this, - dummy_ds_create_info_ptrs, - false, /* releaseable_sets */ - Anvil::MTSafety::DISABLED, - dummy_overhead_allocs); - - m_dummy_dsg_ptr->get_descriptor_set(0)->update(); - } - - /* Set up shader module cache, if one was requested. */ - if (in_enable_shader_module_cache) - { - m_shader_module_cache_ptr = Anvil::ShaderModuleCache::create(); - } - - /* Set up the pipeline cache */ - m_pipeline_cache_ptr = Anvil::PipelineCache::create(this, - is_mt_safe() ); - - /* Cache a pipeline layout manager instance. */ - m_pipeline_layout_manager_ptr = Anvil::PipelineLayoutManager::create(this, - is_mt_safe() ); - - /* Cache a descriptor set layout manager. */ - m_descriptor_set_layout_manager_ptr = Anvil::DescriptorSetLayoutManager::create(this, - is_mt_safe() ); - - /* Initialize compute & graphics pipeline managers */ - m_compute_pipeline_manager_ptr = Anvil::ComputePipelineManager::create (this, - is_mt_safe() , - true /* use_pipeline_cache */, - m_pipeline_cache_ptr.get() ); - m_graphics_pipeline_manager_ptr = Anvil::GraphicsPipelineManager::create(this, - is_mt_safe() , - true /* use_pipeline_cache */, - m_pipeline_cache_ptr.get() ); - - /* Continue with specialized initialization */ - init_device(); + return true; } /** Please see header for specification */ @@ -1200,13 +1620,12 @@ bool Anvil::BaseDevice::wait_idle() const /* Please see header for specification */ -Anvil::MGPUDevice::MGPUDevice(std::vector in_physical_device_ptrs, - bool in_mt_safe) - :BaseDevice (in_physical_device_ptrs[0]->get_instance(), - in_mt_safe), +Anvil::MGPUDevice::MGPUDevice(Anvil::DeviceCreateInfoUniquePtr in_create_info_ptr) + :BaseDevice (std::move(in_create_info_ptr) ), m_supported_present_modes(static_cast(0) ) { - const uint32_t n_physical_device_ptrs = static_cast(in_physical_device_ptrs.size() ); + const auto& physical_device_ptrs = m_create_info_ptr->get_physical_device_ptrs(); + const uint32_t n_physical_device_ptrs = static_cast(physical_device_ptrs.size() ); ANVIL_REDUNDANT_VARIABLE_CONST(n_physical_device_ptrs); @@ -1220,8 +1639,8 @@ Anvil::MGPUDevice::MGPUDevice(std::vector in_physi n_physical_device < n_physical_device_ptrs - 1; ++n_physical_device) { - auto next_device_ptr(in_physical_device_ptrs[n_physical_device + 1]); - auto this_device_ptr(in_physical_device_ptrs[n_physical_device]); + auto next_device_ptr(physical_device_ptrs[n_physical_device + 1]); + auto this_device_ptr(physical_device_ptrs[n_physical_device]); /* Physical devices must come from the same Vulkan instance */ anvil_assert(this_device_ptr->get_instance() == next_device_ptr->get_instance() ); @@ -1243,7 +1662,7 @@ Anvil::MGPUDevice::MGPUDevice(std::vector in_physi } #endif - for (auto physical_device_ptr : in_physical_device_ptrs) + for (auto physical_device_ptr : physical_device_ptrs) { ParentPhysicalDeviceProperties device_props; @@ -1271,150 +1690,31 @@ Anvil::MGPUDevice::~MGPUDevice() } /* Please see header for specification */ -Anvil::BaseDeviceUniquePtr Anvil::MGPUDevice::create(std::vector in_physical_device_ptrs, - bool in_enable_shader_module_cache, - const DeviceExtensionConfiguration& in_extensions, - const std::vector& in_layers, - bool in_transient_command_buffer_allocs_only, - bool in_support_resettable_command_buffer_allocs, - bool in_mt_safe) +Anvil::BaseDeviceUniquePtr Anvil::MGPUDevice::create(Anvil::DeviceCreateInfoUniquePtr in_create_info_ptr) { Anvil::BaseDeviceUniquePtr result_ptr; /* Make sure the caller has requested the VK_KHR_device_group and VK_KHR_bind_memory2 extensions */ #ifdef _DEBUG { - anvil_assert(in_extensions.extension_status.at(VK_KHR_DEVICE_GROUP_EXTENSION_NAME) == Anvil::ExtensionAvailability::REQUIRE); - anvil_assert(in_extensions.extension_status.at(VK_KHR_BIND_MEMORY_2_EXTENSION_NAME) == Anvil::ExtensionAvailability::REQUIRE); + const auto& extension_configuration = in_create_info_ptr->get_extension_configuration(); + + anvil_assert(extension_configuration.extension_status.at(VK_KHR_DEVICE_GROUP_EXTENSION_NAME) == Anvil::ExtensionAvailability::REQUIRE); + anvil_assert(extension_configuration.extension_status.at(VK_KHR_BIND_MEMORY_2_EXTENSION_NAME) == Anvil::ExtensionAvailability::REQUIRE); } #endif result_ptr = Anvil::BaseDeviceUniquePtr( - new Anvil::MGPUDevice(in_physical_device_ptrs, - in_mt_safe), + new Anvil::MGPUDevice(std::move(in_create_info_ptr) ), std::default_delete() ); - dynamic_cast(result_ptr.get() )->init(in_extensions, - in_layers, - in_transient_command_buffer_allocs_only, - in_support_resettable_command_buffer_allocs, - in_enable_shader_module_cache); - - return result_ptr; -} - -/** TODO */ -void Anvil::MGPUDevice::create_device(const std::vector& in_extensions, - const std::vector& in_layers, - const VkPhysicalDeviceFeatures& in_features, - DeviceQueueFamilyInfo* out_queue_families_ptr) -{ - std::vector device_queue_create_info_items; - std::vector device_queue_priorities; - VkResult result (VK_ERROR_INITIALIZATION_FAILED); - Anvil::StructChainer struct_chainer; - const Anvil::PhysicalDevice* zeroth_physical_device_ptr (m_parent_physical_devices.at(0).physical_device_ptr); - const auto& zeroth_physical_device_queue_fams(zeroth_physical_device_ptr->get_queue_families() ); - - ANVIL_REDUNDANT_VARIABLE(result); - - /* Set up queue create info structure instances. - * - * Use up all available queues. - */ - for (uint32_t n_queue_fam = 0; - n_queue_fam < static_cast(zeroth_physical_device_queue_fams.size() ); - ++n_queue_fam) - { - const auto& current_queue_fam(zeroth_physical_device_queue_fams.at(n_queue_fam) ); - - if (current_queue_fam.n_queues > 0) - { - device_queue_priorities.resize(std::max(static_cast(device_queue_priorities.size() ), - current_queue_fam.n_queues), - 1.0f); - } - } - - for (uint32_t n_queue_fam = 0; - n_queue_fam < static_cast(zeroth_physical_device_queue_fams.size() ); - ++n_queue_fam) - { - const auto& current_queue_fam(zeroth_physical_device_queue_fams.at(n_queue_fam) ); - - if (current_queue_fam.n_queues > 0) - { - VkDeviceQueueCreateInfo queue_create_info; - - queue_create_info.flags = 0; - queue_create_info.pNext = nullptr; - queue_create_info.pQueuePriorities = &device_queue_priorities[0]; - queue_create_info.queueCount = current_queue_fam.n_queues; - queue_create_info.queueFamilyIndex = n_queue_fam; - queue_create_info.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO; - - device_queue_create_info_items.push_back(queue_create_info); - } - } - - /* Set up the device create info descriptor. */ - { - VkDeviceCreateInfo create_info; - - create_info.enabledExtensionCount = static_cast(in_extensions.size() ); - create_info.enabledLayerCount = static_cast(in_layers.size() ); - create_info.flags = 0; - create_info.pEnabledFeatures = nullptr; /* chained */ - create_info.pNext = nullptr; - create_info.ppEnabledExtensionNames = (in_extensions.size() > 0) ? &in_extensions[0] : nullptr; - create_info.ppEnabledLayerNames = (in_layers.size() > 0) ? &in_layers [0] : nullptr; - create_info.pQueueCreateInfos = &device_queue_create_info_items[0]; - create_info.queueCreateInfoCount = static_cast(device_queue_create_info_items.size() ); - create_info.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO; - - struct_chainer.append_struct(create_info); - } - - std::vector physical_devices(m_parent_physical_devices.size() ); - - for (uint32_t n_physical_device = 0; - n_physical_device < static_cast(physical_devices.size() ); - ++n_physical_device) - { - physical_devices.at(n_physical_device) = m_parent_physical_devices.at(n_physical_device).physical_device_ptr->get_physical_device(); - } - - { - VkDeviceGroupDeviceCreateInfoKHR device_group_device_create_info; - - device_group_device_create_info.physicalDeviceCount = static_cast(m_parent_physical_devices.size() ); - device_group_device_create_info.pPhysicalDevices = &physical_devices[0]; - device_group_device_create_info.pNext = nullptr; - device_group_device_create_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHR; - - struct_chainer.append_struct(device_group_device_create_info); - } - - /* Enable all features available. */ - { - add_physical_device_features_to_chainer(&in_features, - &struct_chainer, - zeroth_physical_device_ptr->get_instance()->get_enabled_extensions_info()->khr_get_physical_device_properties2()); - } - + if (result_ptr != nullptr) { - auto struct_chain_ptr = struct_chainer.create_chain(); - - result = Anvil::Vulkan::vkCreateDevice(m_parent_physical_devices.at(0).physical_device_ptr->get_physical_device(), - struct_chain_ptr->get_root_struct(), - nullptr, /* pAllocator */ - &m_device); - anvil_assert_vk_call_succeeded(result); + dynamic_cast(result_ptr.get() )->init(); } - /* Now that all queues are available, assign them to queue families Anvil recognizes. */ - get_queue_family_indices(out_queue_families_ptr); + return result_ptr; } /** Please see header for specification */ @@ -1900,11 +2200,8 @@ bool Anvil::MGPUDevice::is_physical_device_extension_supported(const std::string /* Please see header for specification */ -Anvil::SGPUDevice::SGPUDevice(const Anvil::PhysicalDevice* in_physical_device_ptr, - bool in_mt_safe) - :BaseDevice (in_physical_device_ptr->get_instance(), - in_mt_safe), - m_parent_physical_device_ptr(in_physical_device_ptr) +Anvil::SGPUDevice::SGPUDevice(Anvil::DeviceCreateInfoUniquePtr in_create_info_ptr) + :BaseDevice(std::move(in_create_info_ptr) ) { /* Stub */ } @@ -1917,120 +2214,20 @@ Anvil::SGPUDevice::~SGPUDevice() /* Please see header for specification */ -Anvil::BaseDeviceUniquePtr Anvil::SGPUDevice::create(const Anvil::PhysicalDevice* in_physical_device_ptr, - bool in_enable_shader_module_cache, - const DeviceExtensionConfiguration& in_extensions, - const std::vector& in_layers, - bool in_transient_command_buffer_allocs_only, - bool in_support_resettable_command_buffer_allocs, - bool in_mt_safe) +Anvil::BaseDeviceUniquePtr Anvil::SGPUDevice::create(Anvil::DeviceCreateInfoUniquePtr in_create_info_ptr) { BaseDeviceUniquePtr result_ptr(nullptr, std::default_delete() ); result_ptr = std::unique_ptr( - new Anvil::SGPUDevice(in_physical_device_ptr, - in_mt_safe) + new Anvil::SGPUDevice(std::move(in_create_info_ptr) ) ); - dynamic_cast(result_ptr.get() )->init(in_extensions, - in_layers, - in_transient_command_buffer_allocs_only, - in_support_resettable_command_buffer_allocs, - in_enable_shader_module_cache); + dynamic_cast(result_ptr.get() )->init(); return result_ptr; } -/** Please see header for specification */ -void Anvil::SGPUDevice::create_device(const std::vector& in_extensions, - const std::vector& in_layers, - const VkPhysicalDeviceFeatures& in_features, - DeviceQueueFamilyInfo* out_queue_families_ptr) -{ - Anvil::StructChainer struct_chainer; - std::vector device_queue_create_info_items; - std::vector device_queue_priorities; - const auto& physical_device_queue_fams (m_parent_physical_device_ptr->get_queue_families() ); - VkResult result (VK_ERROR_INITIALIZATION_FAILED); - - ANVIL_REDUNDANT_VARIABLE(result); - - /* Set up queue create info structure instances. - * - * Use up all available queues. - */ - for (uint32_t n_queue_fam = 0; - n_queue_fam < static_cast(physical_device_queue_fams.size() ); - ++n_queue_fam) - { - const auto& current_queue_fam(physical_device_queue_fams.at(n_queue_fam) ); - - if (device_queue_priorities.size() < current_queue_fam.n_queues) - { - device_queue_priorities.resize(current_queue_fam.n_queues, - 1.0f); - } - } - - for (uint32_t n_queue_fam = 0; - n_queue_fam < static_cast(physical_device_queue_fams.size() ); - ++n_queue_fam) - { - const auto& current_queue_fam(physical_device_queue_fams.at(n_queue_fam) ); - - if (current_queue_fam.n_queues > 0) - { - VkDeviceQueueCreateInfo queue_create_info; - - queue_create_info.flags = 0; - queue_create_info.pNext = nullptr; - queue_create_info.pQueuePriorities = &device_queue_priorities.at(0); - queue_create_info.queueCount = current_queue_fam.n_queues; - queue_create_info.queueFamilyIndex = n_queue_fam; - queue_create_info.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO; - - device_queue_create_info_items.push_back(queue_create_info); - } - } - - /* Set up the device create info descriptor.*/ - { - VkDeviceCreateInfo create_info; - - create_info.enabledExtensionCount = static_cast(in_extensions.size()); - create_info.enabledLayerCount = static_cast(in_layers.size()); - create_info.flags = 0; - create_info.pEnabledFeatures = nullptr; - create_info.pNext = nullptr; - create_info.ppEnabledExtensionNames = (in_extensions.size() > 0) ? &in_extensions[0] : nullptr; - create_info.ppEnabledLayerNames = (in_layers.size() > 0) ? &in_layers[0] : nullptr; - create_info.pQueueCreateInfos = &device_queue_create_info_items[0]; - create_info.queueCreateInfoCount = static_cast(device_queue_create_info_items.size()); - create_info.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO; - - struct_chainer.append_struct(create_info); - } - - /* Enable all features available. */ - { - add_physical_device_features_to_chainer(&in_features, - &struct_chainer, - m_parent_physical_device_ptr->get_instance()->get_enabled_extensions_info()->khr_get_physical_device_properties2()); - } - - auto struct_chain = struct_chainer.create_chain(); - - result = Anvil::Vulkan::vkCreateDevice(m_parent_physical_device_ptr->get_physical_device(), - struct_chain->get_root_struct(), - nullptr, /* pAllocator */ - &m_device); - anvil_assert_vk_call_succeeded(result); - - /* Now that all queues are available, assign them to queue families Anvil recognizes. */ - get_queue_family_indices(out_queue_families_ptr); -} - /** Please see header for specification */ Anvil::SwapchainUniquePtr Anvil::SGPUDevice::create_swapchain(Anvil::RenderingSurface* in_parent_surface_ptr, Anvil::Window* in_window_ptr, @@ -2064,36 +2261,36 @@ Anvil::SwapchainUniquePtr Anvil::SGPUDevice::create_swapchain(Anvil::RenderingSu bool Anvil::SGPUDevice::get_physical_device_buffer_properties(const BufferPropertiesQuery& in_query, Anvil::BufferProperties* out_opt_result_ptr) const { - return m_parent_physical_device_ptr->get_buffer_properties(in_query, - out_opt_result_ptr); + return m_create_info_ptr->get_physical_device_ptrs().at(0)->get_buffer_properties(in_query, + out_opt_result_ptr); } /** Please see header for specification */ const Anvil::PhysicalDeviceFeatures& Anvil::SGPUDevice::get_physical_device_features() const { - return m_parent_physical_device_ptr->get_device_features(); + return m_create_info_ptr->get_physical_device_ptrs().at(0)->get_device_features(); } /** Please see header for specification */ bool Anvil::SGPUDevice::get_physical_device_fence_properties(const FencePropertiesQuery& in_query, Anvil::FenceProperties* out_opt_result_ptr) const { - return m_parent_physical_device_ptr->get_fence_properties(in_query, - out_opt_result_ptr); + return m_create_info_ptr->get_physical_device_ptrs().at(0)->get_fence_properties(in_query, + out_opt_result_ptr); } /** Please see header for specification */ Anvil::FormatProperties Anvil::SGPUDevice::get_physical_device_format_properties(Anvil::Format in_format) const { - return m_parent_physical_device_ptr->get_format_properties(in_format); + return m_create_info_ptr->get_physical_device_ptrs().at(0)->get_format_properties(in_format); } /** Please see header for specification */ bool Anvil::SGPUDevice::get_physical_device_image_format_properties(const ImageFormatPropertiesQuery& in_query, Anvil::ImageFormatProperties* out_opt_result_ptr) const { - return m_parent_physical_device_ptr->get_image_format_properties(in_query, - out_opt_result_ptr); + return m_create_info_ptr->get_physical_device_ptrs().at(0)->get_image_format_properties(in_query, + out_opt_result_ptr); } /** Please see header for specification */ @@ -2108,7 +2305,7 @@ Anvil::MultisamplePropertiesEXT Anvil::SGPUDevice::get_physical_device_multisamp result_vk.pNext = nullptr; result_vk.sType = VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT; - m_ext_sample_locations_extension_entrypoints.vkGetPhysicalDeviceMultisamplePropertiesEXT(m_parent_physical_device_ptr->get_physical_device(), + m_ext_sample_locations_extension_entrypoints.vkGetPhysicalDeviceMultisamplePropertiesEXT(m_create_info_ptr->get_physical_device_ptrs().at(0)->get_physical_device(), static_cast(in_samples), &result_vk); @@ -2118,27 +2315,27 @@ Anvil::MultisamplePropertiesEXT Anvil::SGPUDevice::get_physical_device_multisamp /** Please see header for specification */ const Anvil::MemoryProperties& Anvil::SGPUDevice::get_physical_device_memory_properties() const { - return m_parent_physical_device_ptr->get_memory_properties(); + return m_create_info_ptr->get_physical_device_ptrs().at(0)->get_memory_properties(); } /** Please see header for specification */ const Anvil::PhysicalDeviceProperties& Anvil::SGPUDevice::get_physical_device_properties() const { - return m_parent_physical_device_ptr->get_device_properties(); + return m_create_info_ptr->get_physical_device_ptrs().at(0)->get_device_properties(); } /** Please see header for specification */ const Anvil::QueueFamilyInfoItems& Anvil::SGPUDevice::get_physical_device_queue_families() const { - return m_parent_physical_device_ptr->get_queue_families(); + return m_create_info_ptr->get_physical_device_ptrs().at(0)->get_queue_families(); } /** Please see header for specification */ bool Anvil::SGPUDevice::get_physical_device_semaphore_properties(const SemaphorePropertiesQuery& in_query, Anvil::SemaphoreProperties* out_opt_result_ptr) const { - return m_parent_physical_device_ptr->get_semaphore_properties(in_query, - out_opt_result_ptr); + return m_create_info_ptr->get_physical_device_ptrs().at(0)->get_semaphore_properties(in_query, + out_opt_result_ptr); } /** Please see header for specification */ @@ -2151,7 +2348,7 @@ bool Anvil::SGPUDevice::get_physical_device_sparse_image_format_properties(Anvil { uint32_t n_props = 0; - Anvil::Vulkan::vkGetPhysicalDeviceSparseImageFormatProperties(m_parent_physical_device_ptr->get_physical_device(), + Anvil::Vulkan::vkGetPhysicalDeviceSparseImageFormatProperties(m_create_info_ptr->get_physical_device_ptrs().at(0)->get_physical_device(), static_cast (in_format), static_cast (in_type), static_cast(in_sample_count), @@ -2164,7 +2361,7 @@ bool Anvil::SGPUDevice::get_physical_device_sparse_image_format_properties(Anvil { out_result.resize(n_props); - Anvil::Vulkan::vkGetPhysicalDeviceSparseImageFormatProperties(m_parent_physical_device_ptr->get_physical_device(), + Anvil::Vulkan::vkGetPhysicalDeviceSparseImageFormatProperties(m_create_info_ptr->get_physical_device_ptrs().at(0)->get_physical_device(), static_cast (in_format), static_cast (in_type), static_cast(in_sample_count), @@ -2181,7 +2378,7 @@ bool Anvil::SGPUDevice::get_physical_device_sparse_image_format_properties(Anvil bool Anvil::SGPUDevice::get_physical_device_surface_capabilities(Anvil::RenderingSurface* in_surface_ptr, Anvil::SurfaceCapabilities* out_result_ptr) const { - return (m_khr_surface_extension_entrypoints.vkGetPhysicalDeviceSurfaceCapabilitiesKHR(m_parent_physical_device_ptr->get_physical_device(), + return (m_khr_surface_extension_entrypoints.vkGetPhysicalDeviceSurfaceCapabilitiesKHR(m_create_info_ptr->get_physical_device_ptrs().at(0)->get_physical_device(), in_surface_ptr->get_surface(), reinterpret_cast(out_result_ptr) ) == VK_SUCCESS); } @@ -2189,14 +2386,14 @@ bool Anvil::SGPUDevice::get_physical_device_surface_capabilities(Anvil::Renderin /* Please see header for specification */ void Anvil::SGPUDevice::get_queue_family_indices(DeviceQueueFamilyInfo* out_device_queue_family_info_ptr) const { - get_queue_family_indices_for_physical_device(m_parent_physical_device_ptr, + get_queue_family_indices_for_physical_device(m_create_info_ptr->get_physical_device_ptrs().at(0), out_device_queue_family_info_ptr); } /** Please see header for specification */ const Anvil::QueueFamilyInfo* Anvil::SGPUDevice::get_queue_family_info(uint32_t in_queue_family_index) const { - const auto& queue_fams(m_parent_physical_device_ptr->get_queue_families() ); + const auto& queue_fams(m_create_info_ptr->get_physical_device_ptrs().at(0)->get_queue_families() ); const Anvil::QueueFamilyInfo* result_ptr(nullptr); if (queue_fams.size() > in_queue_family_index) @@ -2215,11 +2412,11 @@ void Anvil::SGPUDevice::init_device() /** Please see header for specification */ bool Anvil::SGPUDevice::is_layer_supported(const std::string& in_layer_name) const { - return m_parent_physical_device_ptr->is_layer_supported(in_layer_name); + return m_create_info_ptr->get_physical_device_ptrs().at(0)->is_layer_supported(in_layer_name); } /** Please see header for specification */ bool Anvil::SGPUDevice::is_physical_device_extension_supported(const std::string& in_extension_name) const { - return m_parent_physical_device_ptr->is_device_extension_supported(in_extension_name); + return m_create_info_ptr->get_physical_device_ptrs().at(0)->is_device_extension_supported(in_extension_name); } diff --git a/src/wrappers/graphics_pipeline_manager.cpp b/src/wrappers/graphics_pipeline_manager.cpp index b0801225..ca19f0d7 100644 --- a/src/wrappers/graphics_pipeline_manager.cpp +++ b/src/wrappers/graphics_pipeline_manager.cpp @@ -943,6 +943,45 @@ Anvil::StructChainUniquePtr Anvil::Graph anvil_assert(in_gfx_pipeline_create_info_ptr->get_rasterization_order() == Anvil::RasterizationOrderAMD::STRICT); } + if (m_device_ptr->is_extension_enabled(VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME) ) + { + /* Chain a predefined struct which will toggle the conservative rasterization mode, as long as the device supports the + * VK_EXT_conservative_rasterization extension. + */ + const VkPipelineRasterizationConservativeStateCreateInfoEXT conservative_rasterization_item + { + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT, + nullptr, + 0, + static_cast(in_gfx_pipeline_create_info_ptr->get_conservative_rasterization_mode() ), + in_gfx_pipeline_create_info_ptr->get_extra_primitive_overestimation_size() + }; + + raster_state_create_info_chainer.append_struct(conservative_rasterization_item); + } + else + { + anvil_assert(in_gfx_pipeline_create_info_ptr->get_conservative_rasterization_mode() == Anvil::ConservativeRasterizationModeEXT::DISABLED); + } + + if (m_device_ptr->is_extension_enabled(VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME) ) + { + const bool is_depth_clip_enabled = in_gfx_pipeline_create_info_ptr->is_depth_clip_enabled(); + + /* NOTE: No need to chain the struct IF ::depthClipEnable is to be specified as VK_TRUE, since it does not affect Vulkan impl's behavior. */ + if (!is_depth_clip_enabled) + { + VkPipelineRasterizationDepthClipStateCreateInfoEXT create_info; + + create_info.depthClipEnable = VK_FALSE; + create_info.flags = 0; + create_info.pNext = nullptr; + create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT; + + raster_state_create_info_chainer.append_struct(create_info); + } + } + if (m_device_ptr->is_extension_enabled(VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME) ) { const auto& rasterization_stream_index = in_gfx_pipeline_create_info_ptr->get_rasterization_stream_index(); diff --git a/src/wrappers/image.cpp b/src/wrappers/image.cpp index ad39ff8f..b1b9a661 100644 --- a/src/wrappers/image.cpp +++ b/src/wrappers/image.cpp @@ -55,14 +55,9 @@ Anvil::Image::Image(Anvil::ImageCreateInfoUniquePtr in_create_info_ptr) Anvil::ObjectType::IMAGE), MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), in_create_info_ptr->get_device () )), - m_alignment (UINT64_MAX), m_has_transitioned_to_post_alloc_layout(false), m_image (VK_NULL_HANDLE), - m_memory_types (0), m_n_mipmaps (0), - m_prefers_dedicated_allocation (false), - m_requires_dedicated_allocation (false), - m_storage_size (0), m_swapchain_memory_assigned (false) { m_create_info_ptr = std::move(in_create_info_ptr); @@ -73,6 +68,28 @@ Anvil::Image::Image(Anvil::ImageCreateInfoUniquePtr in_create_info_ptr) } +/** Releases the Vulkan image object, as well as the memory object associated with the Image instance. */ +Anvil::Image::~Image() +{ + if (m_image != VK_NULL_HANDLE && + m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SWAPCHAIN_WRAPPER) + { + lock(); + { + Anvil::Vulkan::vkDestroyImage(m_device_ptr->get_device_vk(), + m_image, + nullptr /* pAllocator */); + } + unlock(); + + m_image = VK_NULL_HANDLE; + } + + /* Unregister the object */ + Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::IMAGE, + this); +} + /** Please see header for specification */ void Anvil::Image::change_image_layout(Anvil::Queue* in_queue_ptr, Anvil::AccessFlags in_src_access_mask, @@ -186,10 +203,17 @@ Anvil::ImageUniquePtr Anvil::Image::create(Anvil::ImageCreateInfoUniquePtr in_cr case Anvil::ImageInternalType::SWAPCHAIN_WRAPPER: { - result_ptr->m_image = result_ptr->m_create_info_ptr->get_swapchain_image(); - result_ptr->m_memory_types = 0; - result_ptr->m_n_mipmaps = 1; - result_ptr->m_storage_size = 0; + result_ptr->m_image = result_ptr->m_create_info_ptr->get_swapchain_image(); + result_ptr->m_n_mipmaps = 1; + + /* NOTE: Swapchain never uses YUV image format. */ + auto& plane_props = result_ptr->m_plane_index_to_memory_properties_map[0]; + + plane_props.alignment = 0; + plane_props.memory_types = 0; + plane_props.prefers_dedicated_allocation = false; + plane_props.requires_dedicated_allocation = false; + plane_props.storage_size = 0; anvil_assert(result_ptr->m_image != VK_NULL_HANDLE); @@ -213,24 +237,15 @@ Anvil::ImageUniquePtr Anvil::Image::create(Anvil::ImageCreateInfoUniquePtr in_cr if (image_type == Anvil::ImageInternalType::PEER_NO_ALLOC) { - const auto& physical_devices = result_ptr->m_create_info_ptr->get_physical_devices(); - const auto n_physical_devices = static_cast(physical_devices.size() ); - std::vector physical_device_indices; - const auto& sfr_rects = result_ptr->m_create_info_ptr->get_sfr_rects(); - const auto n_sfr_rects = static_cast(sfr_rects.size() ); + const std::vector physical_device_indices = result_ptr->m_create_info_ptr->get_device_indices(); + const auto& sfr_rects = result_ptr->m_create_info_ptr->get_sfr_rects(); + const auto n_sfr_rects = static_cast(sfr_rects.size() ); - for (uint32_t n_physical_device = 0; - n_physical_device < n_physical_devices; - ++n_physical_device) - { - physical_device_indices.push_back(physical_devices[n_physical_device]->get_device_group_device_index() ); - } - - result_ptr->set_memory_internal(result_ptr->m_create_info_ptr->get_swapchain_image_index(), - n_sfr_rects, - (n_sfr_rects > 0) ? &sfr_rects.at(0) : nullptr, - static_cast(physical_devices.size() ), - (physical_devices.size() > 0) ? &physical_device_indices.at(0) : nullptr); + result_ptr->set_swapchain_memory_internal(result_ptr->m_create_info_ptr->get_swapchain_image_index(), + n_sfr_rects, + (n_sfr_rects > 0) ? &sfr_rects.at(0) : nullptr, + static_cast(physical_device_indices.size() ), + (physical_device_indices.size() > 0) ? &physical_device_indices.at(0) : nullptr); } } @@ -241,7 +256,6 @@ Anvil::ImageUniquePtr Anvil::Image::create(Anvil::ImageCreateInfoUniquePtr in_cr bool Anvil::Image::do_sanity_checks_for_physical_device_binding(const Anvil::MemoryBlock* in_memory_block_ptr, uint32_t in_n_physical_devices) const { - const Anvil::DeviceType device_type (m_device_ptr->get_type() ); const uint32_t memory_block_type_index(in_memory_block_ptr->get_create_info_ptr()->get_memory_type_index() ); const Anvil::MGPUDevice* mgpu_device_ptr (dynamic_cast(m_device_ptr) ); bool result (false); @@ -253,13 +267,6 @@ bool Anvil::Image::do_sanity_checks_for_physical_device_binding(const Anvil::Mem goto end; } - if (device_type != Anvil::DeviceType::MULTI_GPU) - { - anvil_assert(device_type == Anvil::DeviceType::MULTI_GPU); - - goto end; - } - if (in_n_physical_devices != mgpu_device_ptr->get_n_physical_devices() ) { anvil_assert(in_n_physical_devices == mgpu_device_ptr->get_n_physical_devices()); @@ -291,7 +298,7 @@ bool Anvil::Image::do_sanity_checks_for_sfr_binding(uint32_t in_n_SFR_rec anvil_assert( m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::NO_ALLOC && (m_create_info_ptr->get_create_flags () & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) == 0); - anvil_assert(m_mipmaps.size () > 0); + anvil_assert(m_mipmap_props.size () > 0); anvil_assert(m_memory_blocks_owned.size () == 0); if (!m_device_ptr->is_extension_enabled(VK_KHR_DEVICE_GROUP_EXTENSION_NAME) ) @@ -375,12 +382,12 @@ bool Anvil::Image::get_aspect_subresource_layout(Anvil::ImageAspectFlagBits in_a uint32_t in_n_mip, Anvil::SubresourceLayout* out_subresource_layout_ptr) const { - auto aspect_iterator = m_aspects.find(in_aspect); + auto aspect_iterator = m_linear_image_aspect_data.find(in_aspect); bool result = false; anvil_assert(m_create_info_ptr->get_tiling() == Anvil::ImageTiling::LINEAR); - if (aspect_iterator != m_aspects.end() ) + if (aspect_iterator != m_linear_image_aspect_data.end() ) { auto layer_mip_iterator = aspect_iterator->second.find(LayerMipKey(in_n_layer, in_n_mip) ); @@ -395,12 +402,13 @@ bool Anvil::Image::get_aspect_subresource_layout(Anvil::ImageAspectFlagBits in_a } /** Please see header for specification */ -Anvil::MemoryBlock* Anvil::Image::get_memory_block() +Anvil::MemoryBlock* Anvil::Image::get_memory_block(const uint32_t& in_n_plane) { - bool is_callback_needed = false; - const auto is_sparse = (m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) != 0; + bool is_callback_needed = false; + const auto is_prt = (m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0; + const auto uses_sparse_bindings = (m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) != 0; - if (is_sparse) + if (uses_sparse_bindings) { IsImageMemoryAllocPendingQueryCallbackArgument callback_arg(this); @@ -423,13 +431,15 @@ Anvil::MemoryBlock* Anvil::Image::get_memory_block() &callback_argument); } - if (is_sparse) + if (uses_sparse_bindings) { - if ((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) == 0) + if (!is_prt) { - anvil_assert(m_page_tracker_ptr != nullptr); + const auto& plane_memory_reqs = m_plane_index_to_memory_properties_map.at(in_n_plane); - return m_page_tracker_ptr->get_memory_block(0); + anvil_assert(plane_memory_reqs.page_tracker_ptr != nullptr); + + return plane_memory_reqs.page_tracker_ptr->get_memory_block(0); } else { @@ -439,6 +449,9 @@ Anvil::MemoryBlock* Anvil::Image::get_memory_block() } else { + /* TODO: Refactoring needed for better support of disjoint YUV images .. */ + anvil_assert((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::CREATE_DISJOINT_BIT) == 0); + return (m_memory_blocks_owned.size() > 0) ? m_memory_blocks_owned.at(0).get() : nullptr; } @@ -450,64 +463,57 @@ Anvil::MemoryBlock* Anvil::Image::get_memory_block() **/ bool Anvil::Image::init() { - std::vector aspects_used; - Anvil::ImageFormatProperties image_format_props; - const auto memory_features = m_create_info_ptr->get_memory_features(); - uint32_t n_queue_family_indices = 0; - uint32_t queue_family_indices[3]; - VkResult result = VK_ERROR_INITIALIZATION_FAILED; - bool result_bool = true; - Anvil::StructChainer struct_chainer; - bool use_dedicated_allocation = false; + VkResult result = VK_ERROR_INITIALIZATION_FAILED; + bool result_bool = true; - if ((memory_features & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) == 0) + /* Sanity checks */ { - anvil_assert((memory_features & Anvil::MemoryFeatureFlagBits::HOST_COHERENT_BIT) == 0); - } + const auto memory_features = m_create_info_ptr->get_memory_features(); - if (m_create_info_ptr->get_mipmaps_to_upload().size() > 0) - { - m_create_info_ptr->set_usage_flags(m_create_info_ptr->get_usage_flags() | Anvil::ImageUsageFlagBits::TRANSFER_DST_BIT); - } + if ((memory_features & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) == 0) + { + anvil_assert((memory_features & Anvil::MemoryFeatureFlagBits::HOST_COHERENT_BIT) == 0); + } - if ( m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER && - (m_create_info_ptr->get_swapchain()->get_create_info_ptr()->get_flags() & Anvil::SwapchainCreateFlagBits::SPLIT_INSTANCE_BIND_REGIONS_BIT) != 0) - { - anvil_assert(!m_create_info_ptr->uses_full_mipmap_chain() ); - anvil_assert(m_create_info_ptr->get_n_layers () == 1); - anvil_assert(m_create_info_ptr->get_type () == Anvil::ImageType::_2D); - anvil_assert(m_create_info_ptr->get_tiling () == Anvil::ImageTiling::OPTIMAL); - } + if ( m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER && + (m_create_info_ptr->get_swapchain()->get_create_info_ptr()->get_flags() & Anvil::SwapchainCreateFlagBits::SPLIT_INSTANCE_BIND_REGIONS_BIT) != 0) + { + anvil_assert(!m_create_info_ptr->uses_full_mipmap_chain() ); + anvil_assert(m_create_info_ptr->get_n_layers () == 1); + anvil_assert(m_create_info_ptr->get_type () == Anvil::ImageType::_2D); + anvil_assert(m_create_info_ptr->get_tiling () == Anvil::ImageTiling::OPTIMAL); + } - /* Form the queue family array */ - Anvil::Utils::convert_queue_family_bits_to_family_indices(m_device_ptr, - m_create_info_ptr->get_queue_families(), - queue_family_indices, - &n_queue_family_indices); + if ( (m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::CUBE_COMPATIBLE_BIT) != 0) + { + anvil_assert(m_create_info_ptr->get_type () == Anvil::ImageType::_2D); + anvil_assert((m_create_info_ptr->get_n_layers() % 6) == 0); + } - /* Create the image object */ - if ( (m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::CUBE_COMPATIBLE_BIT) != 0) - { - anvil_assert(m_create_info_ptr->get_type() == Anvil::ImageType::_2D); - anvil_assert((m_create_info_ptr->get_n_layers() % 6) == 0); - } + if ( (m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::_2D_ARRAY_COMPATIBLE_BIT) != 0) + { + anvil_assert(m_device_ptr->get_extension_info()->khr_maintenance1() ); + anvil_assert(m_create_info_ptr->get_type () == Anvil::ImageType::_3D); + } - if ( (m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::_2D_ARRAY_COMPATIBLE_BIT) != 0) - { - anvil_assert(m_device_ptr->get_extension_info()->khr_maintenance1() ); - anvil_assert(m_create_info_ptr->get_type() == Anvil::ImageType::_3D); - } + if ( (m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPLIT_INSTANCE_BIND_REGIONS_BIT) != 0) + { + anvil_assert(m_device_ptr->get_extension_info()->khr_bind_memory2() ); + } - if ( (m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPLIT_INSTANCE_BIND_REGIONS_BIT) != 0) - { - anvil_assert(m_device_ptr->get_extension_info()->khr_bind_memory2() ); + if ( (m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::ALIAS_BIT) != 0) + { + anvil_assert(m_device_ptr->get_extension_info()->khr_bind_memory2() ); + } } - if ( (m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::ALIAS_BIT) != 0) + /* If application intends to fill the image with data at bring-up time, make sure the image supports transfer_dst usage. */ + if (m_create_info_ptr->get_mipmaps_to_upload().size() > 0) { - anvil_assert(m_device_ptr->get_extension_info()->khr_bind_memory2() ); + m_create_info_ptr->set_usage_flags(m_create_info_ptr->get_usage_flags() | Anvil::ImageUsageFlagBits::TRANSFER_DST_BIT); } + /* Cache the number of mips we want the image to use. */ { const auto max_dimension = std::max(std::max(m_create_info_ptr->get_base_mip_depth(), m_create_info_ptr->get_base_mip_height() ), @@ -517,320 +523,433 @@ bool Anvil::Image::init() : 1); } + /* Create the image object */ { - VkImageCreateInfo image_create_info; + Anvil::StructChainer struct_chainer; + + { + VkImageCreateInfo image_create_info; + uint32_t n_queue_family_indices = 0; + uint32_t queue_family_indices[3]; + + Anvil::Utils::convert_queue_family_bits_to_family_indices(m_device_ptr, + m_create_info_ptr->get_queue_families(), + queue_family_indices, + &n_queue_family_indices); + + image_create_info.arrayLayers = m_create_info_ptr->get_n_layers (); + image_create_info.extent.depth = m_create_info_ptr->get_base_mip_depth (); + image_create_info.extent.height = m_create_info_ptr->get_base_mip_height(); + image_create_info.extent.width = m_create_info_ptr->get_base_mip_width (); + image_create_info.flags = m_create_info_ptr->get_create_flags ().get_vk(); + image_create_info.format = static_cast (m_create_info_ptr->get_format () ); + image_create_info.imageType = static_cast (m_create_info_ptr->get_type () ); + image_create_info.initialLayout = static_cast(m_create_info_ptr->get_post_create_image_layout() ); + image_create_info.mipLevels = m_n_mipmaps; + image_create_info.pNext = nullptr; + image_create_info.pQueueFamilyIndices = queue_family_indices; + image_create_info.queueFamilyIndexCount = n_queue_family_indices; + image_create_info.samples = static_cast(m_create_info_ptr->get_sample_count() ); + image_create_info.sharingMode = static_cast (m_create_info_ptr->get_sharing_mode() ); + image_create_info.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; + image_create_info.tiling = static_cast(m_create_info_ptr->get_tiling() ); + image_create_info.usage = m_create_info_ptr->get_usage_flags().get_vk(); + + if (m_create_info_ptr->get_external_memory_handle_types() != 0) + { + anvil_assert(static_cast(image_create_info.initialLayout) == Anvil::ImageLayout::UNDEFINED); + } - image_create_info.arrayLayers = m_create_info_ptr->get_n_layers (); - image_create_info.extent.depth = m_create_info_ptr->get_base_mip_depth (); - image_create_info.extent.height = m_create_info_ptr->get_base_mip_height(); - image_create_info.extent.width = m_create_info_ptr->get_base_mip_width (); - image_create_info.flags = m_create_info_ptr->get_create_flags ().get_vk(); - image_create_info.format = static_cast (m_create_info_ptr->get_format () ); - image_create_info.imageType = static_cast (m_create_info_ptr->get_type () ); - image_create_info.initialLayout = static_cast(m_create_info_ptr->get_post_create_image_layout() ); - image_create_info.mipLevels = m_n_mipmaps; - image_create_info.pNext = nullptr; - image_create_info.pQueueFamilyIndices = queue_family_indices; - image_create_info.queueFamilyIndexCount = n_queue_family_indices; - image_create_info.samples = static_cast(m_create_info_ptr->get_sample_count() ); - image_create_info.sharingMode = static_cast (m_create_info_ptr->get_sharing_mode() ); - image_create_info.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; - image_create_info.tiling = static_cast(m_create_info_ptr->get_tiling() ); - image_create_info.usage = m_create_info_ptr->get_usage_flags().get_vk(); + struct_chainer.append_struct(image_create_info); + } if (m_create_info_ptr->get_external_memory_handle_types() != 0) { - anvil_assert(static_cast(image_create_info.initialLayout) == Anvil::ImageLayout::UNDEFINED); + VkExternalMemoryImageCreateInfoKHR external_memory_image_create_info; + const auto handle_types = m_create_info_ptr->get_external_memory_handle_types(); + + external_memory_image_create_info.handleTypes = handle_types.get_vk(); + external_memory_image_create_info.pNext = nullptr; + external_memory_image_create_info.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR; + + struct_chainer.append_struct(external_memory_image_create_info); } - struct_chainer.append_struct(image_create_info); - } + { + const Anvil::Format* compatible_image_view_formats = nullptr; + uint32_t n_compatible_image_view_formats = 0; - if (m_create_info_ptr->get_external_memory_handle_types() != 0) - { - VkExternalMemoryImageCreateInfoKHR external_memory_image_create_info; - const auto handle_types = m_create_info_ptr->get_external_memory_handle_types(); + m_create_info_ptr->get_image_view_formats(&n_compatible_image_view_formats, + &compatible_image_view_formats); - external_memory_image_create_info.handleTypes = handle_types.get_vk(); - external_memory_image_create_info.pNext = nullptr; - external_memory_image_create_info.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR; + if (n_compatible_image_view_formats > 0) + { + VkImageFormatListCreateInfoKHR image_format_list_create_info; - struct_chainer.append_struct(external_memory_image_create_info); - } + anvil_assert((m_create_info_ptr->get_create_flags () & Anvil::ImageCreateFlagBits::MUTABLE_FORMAT_BIT) != 0); + anvil_assert(m_device_ptr->get_extension_info()->khr_image_format_list() ); - { - const Anvil::Format* compatible_image_view_formats = nullptr; - uint32_t n_compatible_image_view_formats = 0; + image_format_list_create_info.pNext = nullptr; + image_format_list_create_info.pViewFormats = reinterpret_cast(compatible_image_view_formats); + image_format_list_create_info.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR; + image_format_list_create_info.viewFormatCount = n_compatible_image_view_formats; - m_create_info_ptr->get_image_view_formats(&n_compatible_image_view_formats, - &compatible_image_view_formats); + struct_chainer.append_struct(image_format_list_create_info); + } + } - if (n_compatible_image_view_formats > 0) + if (m_create_info_ptr->get_stencil_image_aspect_usage() != Anvil::ImageUsageFlagBits::NONE) { - VkImageFormatListCreateInfoKHR image_format_list_create_info; + VkImageStencilUsageCreateInfoEXT create_info; - anvil_assert((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::MUTABLE_FORMAT_BIT) != 0); - anvil_assert(m_device_ptr->get_extension_info()->khr_image_format_list() ); + anvil_assert(m_device_ptr->get_extension_info()->ext_separate_stencil_usage() ); - image_format_list_create_info.pNext = nullptr; - image_format_list_create_info.pViewFormats = reinterpret_cast(compatible_image_view_formats); - image_format_list_create_info.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR; - image_format_list_create_info.viewFormatCount = n_compatible_image_view_formats; + create_info.pNext = nullptr; + create_info.stencilUsage = m_create_info_ptr->get_stencil_image_aspect_usage().get_vk(); + create_info.sType = VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO_EXT; - struct_chainer.append_struct(image_format_list_create_info); + struct_chainer.append_struct(create_info); } - } - { - auto struct_chain_ptr = struct_chainer.create_chain(); + { + auto struct_chain_ptr = struct_chainer.create_chain(); - result = Anvil::Vulkan::vkCreateImage(m_device_ptr->get_device_vk(), - struct_chain_ptr->get_root_struct(), - nullptr, /* pAllocator */ - &m_image); - } + result = Anvil::Vulkan::vkCreateImage(m_device_ptr->get_device_vk (), + struct_chain_ptr->get_root_struct(), + nullptr, /* pAllocator */ + &m_image); + } - if (!is_vk_call_successful(result) ) - { - anvil_assert_vk_call_succeeded(result); + if (!is_vk_call_successful(result) ) + { + anvil_assert_vk_call_succeeded(result); - result_bool = false; - goto end; + result_bool = false; + goto end; + } } + /* Cache the handle .. */ set_vk_handle(m_image); - if (m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SWAPCHAIN_WRAPPER) + /* Prepare metadata for the generated image. */ { - /* Extract various image properties we're going to need later. - * - * Prefer facilities exposed by VK_KHR_get_memory_requirements2 unless unsupported. - */ - if (m_device_ptr->get_extension_info()->khr_get_memory_requirements2() ) + std::vector image_aspects; + + const bool is_disjoint_yuv_image = (m_create_info_ptr->get_create_flags () & Anvil::ImageCreateFlagBits::CREATE_DISJOINT_BIT) != 0; + const bool is_linear_image = (m_create_info_ptr->get_tiling () == Anvil::ImageTiling::LINEAR); + const bool is_prt_image = (m_create_info_ptr->get_create_flags () & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0; + const bool is_sparse_binding_image = (m_create_info_ptr->get_create_flags () & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) != 0; + const bool is_swapchain_wrapper_image = (m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); + const bool uses_sfr = (m_create_info_ptr->get_create_flags () & Anvil::ImageCreateFlagBits::SPLIT_INSTANCE_BIND_REGIONS_BIT) != 0; + const bool is_yuv_format = Anvil::Formats::is_format_yuv_khr (m_create_info_ptr->get_format() ); + const uint32_t n_format_planes = Anvil::Formats::get_format_n_planes(m_create_info_ptr->get_format() ); + + ANVIL_REDUNDANT_VARIABLE_CONST(is_yuv_format); + + Anvil::Formats::get_format_aspects(m_create_info_ptr->get_format(), + &image_aspects); + + if (!is_swapchain_wrapper_image) { - const auto gmr2_entrypoints = m_device_ptr->get_extension_khr_get_memory_requirements2_entrypoints(); - VkImageMemoryRequirementsInfo2KHR info; - const bool khr_dedicated_allocation_available = m_device_ptr->get_extension_info()->khr_dedicated_allocation (); - VkMemoryDedicatedRequirementsKHR memory_dedicated_reqs; - VkMemoryRequirements2KHR result_reqs; + /* Extract various image properties we're going to need later. + * + * Prefer facilities exposed by VK_KHR_get_memory_requirements2 unless unsupported. */ + if (m_device_ptr->get_extension_info()->khr_get_memory_requirements2() ) + { + const auto gmr2_entrypoints = m_device_ptr->get_extension_khr_get_memory_requirements2_entrypoints(); + Anvil::StructChainer input_struct_chainer; + Anvil::StructChainUniquePtr input_struct_chain_ptr; + const bool khr_dedicated_allocation_available = m_device_ptr->get_extension_info()->khr_dedicated_allocation(); + Anvil::StructID memory_dedicated_reqs_struct_id = UINT32_MAX; + Anvil::StructChainer result_struct_chainer; + Anvil::StructChainUniquePtr result_struct_chain_ptr; + + /* NOTE: For disjoint images, we need to cache mem reqs for individual planes. This requires use of VkImagePlaneMemoryRequirementsInfoKHR struct. */ + const uint32_t n_planes_to_query = (is_disjoint_yuv_image) ? n_format_planes + : 1; + + for (uint32_t n_current_plane = 0; + n_current_plane < n_planes_to_query; + ++n_current_plane) + { + auto& current_plane_properties = m_plane_index_to_memory_properties_map[n_current_plane]; - memory_dedicated_reqs.pNext = nullptr; - memory_dedicated_reqs.prefersDedicatedAllocation = VK_FALSE; - memory_dedicated_reqs.requiresDedicatedAllocation = VK_FALSE; - memory_dedicated_reqs.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR; + { + VkImageMemoryRequirementsInfo2KHR info; - info.image = m_image; - info.pNext = nullptr; - info.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR; + info.image = m_image; + info.pNext = nullptr; + info.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR; - result_reqs.pNext = (khr_dedicated_allocation_available) ? &memory_dedicated_reqs : nullptr; - result_reqs.sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR; + input_struct_chainer.append_struct(info); + } - gmr2_entrypoints.vkGetImageMemoryRequirements2KHR(m_device_ptr->get_device_vk(), - &info, - &result_reqs); + if (is_disjoint_yuv_image) + { + VkImagePlaneMemoryRequirementsInfoKHR plane_mem_reqs_info; - m_memory_reqs = result_reqs.memoryRequirements; + plane_mem_reqs_info.planeAspect = (n_current_plane == 0) ? VK_IMAGE_ASPECT_PLANE_0_BIT_KHR + : (n_current_plane == 1) ? VK_IMAGE_ASPECT_PLANE_1_BIT_KHR + : VK_IMAGE_ASPECT_PLANE_2_BIT_KHR; + plane_mem_reqs_info.pNext = nullptr; + plane_mem_reqs_info.sType = VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO_KHR; - if (khr_dedicated_allocation_available) - { - m_prefers_dedicated_allocation = (memory_dedicated_reqs.prefersDedicatedAllocation == VK_TRUE); - m_requires_dedicated_allocation = (memory_dedicated_reqs.requiresDedicatedAllocation == VK_TRUE); + input_struct_chainer.append_struct(plane_mem_reqs_info); - use_dedicated_allocation = m_requires_dedicated_allocation; - } - } - else - { - Anvil::Vulkan::vkGetImageMemoryRequirements(m_device_ptr->get_device_vk(), - m_image, - &m_memory_reqs); - } + anvil_assert(n_current_plane <= 2); + } - m_alignment = m_memory_reqs.alignment; - m_memory_types = m_memory_reqs.memoryTypeBits; - m_storage_size = m_memory_reqs.size; - } + { + VkMemoryRequirements2KHR result_reqs; - /* Cache aspect subresource properties if we're dealing with a linear image */ - if (m_create_info_ptr->get_tiling() == Anvil::ImageTiling::LINEAR) - { - const auto n_layers = m_create_info_ptr->get_n_layers(); + result_reqs.pNext = nullptr; + result_reqs.sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR; - Anvil::Formats::get_format_aspects(m_create_info_ptr->get_format(), - &aspects_used); + result_struct_chainer.append_struct(result_reqs); + } - for (const auto& current_aspect : aspects_used) - { - Anvil::ImageSubresource subresource; + if (khr_dedicated_allocation_available) + { + VkMemoryDedicatedRequirementsKHR memory_dedicated_reqs; - subresource.aspect_mask = current_aspect; + memory_dedicated_reqs.pNext = nullptr; + memory_dedicated_reqs.prefersDedicatedAllocation = VK_FALSE; + memory_dedicated_reqs.requiresDedicatedAllocation = VK_FALSE; + memory_dedicated_reqs.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR; - for (uint32_t n_layer = 0; - n_layer < n_layers; - ++n_layer) - { - subresource.array_layer = n_layer; + memory_dedicated_reqs_struct_id = result_struct_chainer.append_struct(memory_dedicated_reqs); + } - for (uint32_t n_mip = 0; - n_mip < m_n_mipmaps; - ++n_mip) - { - Anvil::SubresourceLayout subresource_layout; + input_struct_chain_ptr = input_struct_chainer.create_chain (); + result_struct_chain_ptr = result_struct_chainer.create_chain(); - subresource.mip_level = n_mip; + gmr2_entrypoints.vkGetImageMemoryRequirements2KHR(m_device_ptr->get_device_vk (), + input_struct_chain_ptr->get_root_struct (), + result_struct_chain_ptr->get_root_struct() ); - Anvil::Vulkan::vkGetImageSubresourceLayout(m_device_ptr->get_device_vk(), - m_image, - reinterpret_cast(&subresource), - reinterpret_cast (&subresource_layout) ); - m_aspects[static_cast(current_aspect.get_vk() )][LayerMipKey(n_layer, n_mip)] = subresource_layout; + const auto& memory_reqs = result_struct_chain_ptr->get_root_struct()->memoryRequirements; + + current_plane_properties.alignment = memory_reqs.alignment; + current_plane_properties.memory_types = memory_reqs.memoryTypeBits; + current_plane_properties.storage_size = memory_reqs.size; + + if (memory_dedicated_reqs_struct_id != UINT32_MAX) + { + const auto memory_dedicated_reqs_ptr = result_struct_chain_ptr->get_struct_with_id(memory_dedicated_reqs_struct_id); + + current_plane_properties.prefers_dedicated_allocation = (memory_dedicated_reqs_ptr->prefersDedicatedAllocation == VK_TRUE); + current_plane_properties.requires_dedicated_allocation = (memory_dedicated_reqs_ptr->requiresDedicatedAllocation == VK_TRUE); + } } } - } - } + else + { + /* NOTE: YUV formats are NOT supported unless GIMR2 is available. */ + auto& current_plane_properties = m_plane_index_to_memory_properties_map[0]; + VkMemoryRequirements memory_reqs; - /* Initialize mipmap props storage */ - init_mipmap_props(); + anvil_assert(!is_yuv_format); - if ((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) != 0) - { - uint32_t n_reqs = 0; - std::vector sparse_image_memory_reqs; + Anvil::Vulkan::vkGetImageMemoryRequirements(m_device_ptr->get_device_vk(), + m_image, + &memory_reqs); - anvil_assert(m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); /* TODO: can images, to which swapchains can be bound, be sparse? */ + current_plane_properties.alignment = memory_reqs.alignment; + current_plane_properties.memory_types = memory_reqs.memoryTypeBits; + current_plane_properties.storage_size = memory_reqs.size; + } + } - /* Retrieve image aspect properties. Since Vulkan lets a single props structure to refer to more than - * just a single aspect, we first cache the exposed info in a vec and then distribute the information to - * a map, whose key is allowed to consist of a single bit ( = individual aspect) only - * - * Prefer facilities exposed by VK_KHR_get_memory_requirements2 unless unsupported. This will be leveraged - * in the future, but for now admittedly is a bit of a moot move. - */ - if (m_device_ptr->get_extension_info()->khr_get_memory_requirements2() ) + /* Cache aspect subresource properties if we're dealing with a linear image */ + if (is_linear_image) { - const auto gmr2_entrypoints = m_device_ptr->get_extension_khr_get_memory_requirements2_entrypoints(); - VkImageSparseMemoryRequirementsInfo2KHR info; - uint32_t n_current_item = 0; - std::vector temp_vec; + const auto n_layers = m_create_info_ptr->get_n_layers(); + + /* NOTE: For YUV formats, image_aspects holds PLANE_.. aspects. + * For non-YUV formats, the vector is filled with COLOR/DEPTH/STENCIL aspects. + */ + for (const auto& current_aspect : image_aspects) + { + Anvil::ImageSubresource subresource; - info.image = m_image; - info.pNext = nullptr; - info.sType = VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2_KHR; + subresource.aspect_mask = current_aspect; - gmr2_entrypoints.vkGetImageSparseMemoryRequirements2KHR(m_device_ptr->get_device_vk(), - &info, - &n_reqs, - nullptr); /* pSparseMemoryRequirements */ + for (uint32_t n_layer = 0; + n_layer < n_layers; + ++n_layer) + { + subresource.array_layer = n_layer; - anvil_assert(n_reqs >= 1); - sparse_image_memory_reqs.resize(n_reqs); - temp_vec.resize (n_reqs); + for (uint32_t n_mip = 0; + n_mip < m_n_mipmaps; + ++n_mip) + { + Anvil::SubresourceLayout subresource_layout; - gmr2_entrypoints.vkGetImageSparseMemoryRequirements2KHR(m_device_ptr->get_device_vk(), - &info, - &n_reqs, - &temp_vec[0]); /* pSparseMemoryRequirements */ + subresource.mip_level = n_mip; - for (const auto& current_temp_vec_item : temp_vec) - { - sparse_image_memory_reqs[n_current_item] = current_temp_vec_item.memoryRequirements; + Anvil::Vulkan::vkGetImageSubresourceLayout(m_device_ptr->get_device_vk(), + m_image, + reinterpret_cast(&subresource), + reinterpret_cast (&subresource_layout) ); - /* Move on */ - n_current_item++; + m_linear_image_aspect_data[static_cast(current_aspect.get_vk() )][LayerMipKey(n_layer, n_mip)] = subresource_layout; + } + } } } - else + + init_mipmap_props(); + + if (is_prt_image) { - Anvil::Vulkan::vkGetImageSparseMemoryRequirements(m_device_ptr->get_device_vk(), - m_image, - &n_reqs, - nullptr); + uint32_t n_reqs = 0; + std::vector sparse_image_memory_reqs; - anvil_assert(n_reqs >= 1); - sparse_image_memory_reqs.resize(n_reqs); + anvil_assert(m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); /* TODO: can images, to which swapchains can be bound, be sparse? */ - Anvil::Vulkan::vkGetImageSparseMemoryRequirements(m_device_ptr->get_device_vk(), - m_image, - &n_reqs, - reinterpret_cast(&sparse_image_memory_reqs[0]) ); - } + /* Retrieve image aspect properties. Since Vulkan lets a single props structure to refer to more than + * just a single aspect, we first cache the exposed info in a vec and then distribute the information to + * a map, whose key is allowed to consist of a single bit ( = individual aspect) only + * + * Prefer facilities exposed by VK_KHR_get_memory_requirements2 unless unsupported. This will be leveraged + * in the future, but for now admittedly is a bit of a moot move. + */ + if (m_device_ptr->get_extension_info()->khr_get_memory_requirements2() ) + { + const auto gmr2_entrypoints = m_device_ptr->get_extension_khr_get_memory_requirements2_entrypoints(); + VkImageSparseMemoryRequirementsInfo2KHR info; + uint32_t n_current_item = 0; + std::vector temp_vec; + + info.image = m_image; + info.pNext = nullptr; + info.sType = VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2_KHR; + + gmr2_entrypoints.vkGetImageSparseMemoryRequirements2KHR(m_device_ptr->get_device_vk(), + &info, + &n_reqs, + nullptr); /* pSparseMemoryRequirements */ + + anvil_assert(n_reqs >= 1); + sparse_image_memory_reqs.resize(n_reqs); + temp_vec.resize (n_reqs); + + gmr2_entrypoints.vkGetImageSparseMemoryRequirements2KHR(m_device_ptr->get_device_vk(), + &info, + &n_reqs, + &temp_vec[0]); /* pSparseMemoryRequirements */ + + for (const auto& current_temp_vec_item : temp_vec) + { + sparse_image_memory_reqs[n_current_item] = current_temp_vec_item.memoryRequirements; - for (const auto& image_memory_req : sparse_image_memory_reqs) - { - for (uint32_t n_bit = 0; - (1u << n_bit) <= image_memory_req.format_properties.aspect_mask.get_vk(); - ++n_bit) + /* Move on */ + n_current_item++; + } + } + else { - VkImageAspectFlagBits aspect = static_cast(1 << n_bit); + Anvil::Vulkan::vkGetImageSparseMemoryRequirements(m_device_ptr->get_device_vk(), + m_image, + &n_reqs, + nullptr); + + anvil_assert(n_reqs >= 1); + sparse_image_memory_reqs.resize(n_reqs); + + Anvil::Vulkan::vkGetImageSparseMemoryRequirements(m_device_ptr->get_device_vk(), + m_image, + &n_reqs, + reinterpret_cast(&sparse_image_memory_reqs[0]) ); + } - if ((image_memory_req.format_properties.aspect_mask.get_vk() & aspect) == 0) + for (const auto& image_memory_req : sparse_image_memory_reqs) + { + for (uint32_t n_bit = 0; + (1u << n_bit) <= image_memory_req.format_properties.aspect_mask.get_vk(); + ++n_bit) { - continue; - } + VkImageAspectFlagBits aspect = static_cast(1 << n_bit); + + if ((image_memory_req.format_properties.aspect_mask.get_vk() & aspect) == 0) + { + continue; + } + + anvil_assert(m_sparse_aspect_props.find(static_cast(aspect) ) == m_sparse_aspect_props.end() ); - anvil_assert(m_sparse_aspect_props.find(static_cast(aspect) ) == m_sparse_aspect_props.end() ); + m_sparse_aspect_props[static_cast(aspect)] = Anvil::SparseImageAspectProperties(image_memory_req); + } + } - m_sparse_aspect_props[static_cast(aspect)] = Anvil::SparseImageAspectProperties(image_memory_req); + /* Continue by setting up storage for page occupancy data */ + init_page_occupancy(sparse_image_memory_reqs); + } + else + if (is_sparse_binding_image) + { + for (auto& current_plane_item : m_plane_index_to_memory_properties_map) + { + current_plane_item.second.page_tracker_ptr.reset( + new Anvil::PageTracker(current_plane_item.second.storage_size, + current_plane_item.second.alignment) + ); } } - /* Continue by setting up storage for page occupancy data */ - init_page_occupancy(sparse_image_memory_reqs); - } - else - if ((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) != 0) - { - m_page_tracker_ptr.reset( - new Anvil::PageTracker(m_storage_size, - m_alignment) - ); + /* If the image has been initialized for SFR bindings, calculate & cache SFR tile size */ + if (uses_sfr) + { + init_sfr_tile_size(); + } } - if (m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::ALLOC) + /* If the image was created with alloc-memory-at-init-time flag, make sure to do so before we leave */ { - /* Allocate memory for the image */ - Anvil::MemoryBlockUniquePtr memory_block_ptr; + const bool should_alloc_and_bind_mem = (m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::ALLOC); + if (should_alloc_and_bind_mem) { - auto create_info_ptr = Anvil::MemoryBlockCreateInfo::create_regular(m_device_ptr, - m_memory_reqs.memoryTypeBits, - m_memory_reqs.size, - m_create_info_ptr->get_memory_features() ); - - create_info_ptr->set_mt_safety(Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); + /* Allocate memory for the image. We need one memory block per each plane. */ + Anvil::MemoryBlockUniquePtr memory_block_ptr; - if (use_dedicated_allocation) + for (auto& current_plane_item : m_plane_index_to_memory_properties_map) { - create_info_ptr->use_dedicated_allocation(nullptr, /* in_opt_buffer_ptr */ - this); - } + auto create_info_ptr = Anvil::MemoryBlockCreateInfo::create_regular(m_device_ptr, + current_plane_item.second.memory_types, + current_plane_item.second.storage_size, + m_create_info_ptr->get_memory_features() ); - memory_block_ptr = Anvil::MemoryBlock::create(std::move(create_info_ptr) ); - } + create_info_ptr->set_mt_safety(Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe()) ); - if (memory_block_ptr == nullptr) - { - anvil_assert(memory_block_ptr != nullptr); + if (current_plane_item.second.requires_dedicated_allocation) + { + create_info_ptr->use_dedicated_allocation(nullptr, /* in_opt_buffer_ptr */ + this); + } - result_bool = false; - goto end; - } + memory_block_ptr = Anvil::MemoryBlock::create(std::move(create_info_ptr) ); + } - if (!set_memory(std::move(memory_block_ptr) )) - { - anvil_assert_fail(); + if (memory_block_ptr == nullptr) + { + anvil_assert(memory_block_ptr != nullptr); - result_bool = false; - goto end; - } - } + result_bool = false; + goto end; + } - /* If the image has been initialized for SFR bindings, calculate & cache SFR tile size */ - if ((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPLIT_INSTANCE_BIND_REGIONS_BIT) != 0) - { - init_sfr_tile_size(); + if (!set_memory(std::move(memory_block_ptr) )) + { + anvil_assert_fail(); + + result_bool = false; + goto end; + } + } } end: @@ -896,8 +1015,6 @@ void Anvil::Image::init_page_occupancy(const std::vectorfirst; decltype(m_sparse_aspect_props)::const_iterator current_aspect_props_iterator; AspectPageOccupancyData* page_occupancy_ptr = occupancy_iterator->second; + const auto& plane_index = (current_aspect == Anvil::ImageAspectFlagBits::PLANE_1_BIT) ? 1 + : (current_aspect == Anvil::ImageAspectFlagBits::PLANE_2_BIT) ? 2 + : 0; + const auto& plane_memory_reqs = m_plane_index_to_memory_properties_map.at(plane_index); + + anvil_assert(plane_memory_reqs.alignment != 0); if (page_occupancy_ptr->layers.size() > 0) { @@ -943,9 +1066,9 @@ void Anvil::Image::init_page_occupancy(const std::vectorsecond.mip_tail_size % m_memory_reqs.alignment) == 0); + anvil_assert( (current_aspect_props_iterator->second.mip_tail_size % plane_memory_reqs.alignment) == 0); - current_layer.n_total_tail_pages = static_cast(current_aspect_props_iterator->second.mip_tail_size / m_memory_reqs.alignment); + current_layer.n_total_tail_pages = static_cast(current_aspect_props_iterator->second.mip_tail_size / plane_memory_reqs.alignment); current_layer.tail_occupancy.resize(1 + current_layer.n_total_tail_pages / (sizeof(PageOccupancyStatus) * 8 /* bits in byte */) ); } @@ -960,7 +1083,7 @@ void Anvil::Image::init_page_occupancy(const std::vectorget_format(), - n_channel_bits + 0, - n_channel_bits + 1, - n_channel_bits + 2, - n_channel_bits + 3); + Anvil::Formats::get_format_n_component_bits_nonyuv(m_create_info_ptr->get_format(), + n_channel_bits + 0, + n_channel_bits + 1, + n_channel_bits + 2, + n_channel_bits + 3); n_bytes_per_texel = (n_channel_bits[0] + n_channel_bits[1] + n_channel_bits[2] + n_channel_bits[3]) / 8; @@ -1067,28 +1190,6 @@ void Anvil::Image::init_sfr_tile_size() ; } -/** Releases the Vulkan image object, as well as the memory object associated with the Image instance. */ -Anvil::Image::~Image() -{ - if (m_image != VK_NULL_HANDLE && - m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SWAPCHAIN_WRAPPER) - { - lock(); - { - Anvil::Vulkan::vkDestroyImage(m_device_ptr->get_device_vk(), - m_image, - nullptr /* pAllocator */); - } - unlock(); - - m_image = VK_NULL_HANDLE; - } - - /* Unregister the object */ - Anvil::ObjectTracker::get()->unregister_object(Anvil::ObjectType::IMAGE, - this); -} - /* Please see header for specification */ const VkImage& Anvil::Image::get_image(const bool& in_bake_memory_if_necessary) { @@ -1160,7 +1261,7 @@ bool Anvil::Image::get_image_mipmap_size(uint32_t in_n_mipmap, bool result = false; /* Is this a sensible mipmap index? */ - if (m_mipmaps.size() <= in_n_mipmap) + if (m_mipmap_props.size() <= in_n_mipmap) { goto end; } @@ -1168,17 +1269,17 @@ bool Anvil::Image::get_image_mipmap_size(uint32_t in_n_mipmap, /* Return the result data.. */ if (out_opt_width_ptr != nullptr) { - *out_opt_width_ptr = m_mipmaps[in_n_mipmap].width; + *out_opt_width_ptr = m_mipmap_props[in_n_mipmap].width; } if (out_opt_height_ptr != nullptr) { - *out_opt_height_ptr = m_mipmaps[in_n_mipmap].height; + *out_opt_height_ptr = m_mipmap_props[in_n_mipmap].height; } if (out_opt_depth_ptr != nullptr) { - *out_opt_depth_ptr = m_mipmaps[in_n_mipmap].depth; + *out_opt_depth_ptr = m_mipmap_props[in_n_mipmap].depth; } /* All done */ @@ -1245,34 +1346,6 @@ bool Anvil::Image::get_sparse_image_aspect_properties(const Anvil::ImageAspectFl return result; } -/** TODO */ -VkImageCreateInfo Anvil::Image::get_create_info_for_swapchain(const Anvil::Swapchain* in_swapchain_ptr) -{ - VkImageCreateInfo result; - - in_swapchain_ptr->get_image(0)->get_image_mipmap_size(0, /* n_mipmap */ - &result.extent.width, - &result.extent.height, - &result.arrayLayers); - - result.extent.depth = 1; - result.flags = in_swapchain_ptr->get_create_info_ptr()->get_flags().get_vk(); - result.format = static_cast(in_swapchain_ptr->get_create_info_ptr()->get_format() ); - result.imageType = VK_IMAGE_TYPE_2D; - result.initialLayout = static_cast(Anvil::ImageLayout::UNDEFINED); - result.mipLevels = 1; - result.pNext = nullptr; - result.pQueueFamilyIndices = nullptr; - result.queueFamilyIndexCount = UINT32_MAX; - result.samples = VK_SAMPLE_COUNT_1_BIT; - result.sharingMode = static_cast(in_swapchain_ptr->get_image(0)->get_create_info_ptr()->get_sharing_mode() ); - result.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; - result.tiling = VK_IMAGE_TILING_OPTIMAL; - result.usage = in_swapchain_ptr->get_image(0)->get_create_info_ptr()->get_usage_flags().get_vk(); - - return result; -} - /** Please see header for specification */ Anvil::ImageSubresourceRange Anvil::Image::get_subresource_range() const { @@ -1343,79 +1416,109 @@ bool Anvil::Image::has_aspects(const Anvil::ImageAspectFlags& in_aspects) const } else { - const Anvil::ComponentLayout component_layout = Anvil::Formats::get_format_component_layout(m_create_info_ptr->get_format() ); - bool has_color_components = false; - bool has_depth_components = false; - bool has_stencil_components = false; - - switch (component_layout) - { - case ComponentLayout::ABGR: - case ComponentLayout::ARGB: - case ComponentLayout::BGR: - case ComponentLayout::BGRA: - case ComponentLayout::EBGR: - case ComponentLayout::R: - case ComponentLayout::RG: - case ComponentLayout::RGB: - case ComponentLayout::RGBA: - { - has_color_components = true; + const auto format = m_create_info_ptr->get_format (); + const bool is_yuv_format = Anvil::Formats::is_format_yuv_khr(format); - break; - } + if (is_yuv_format) + { + const auto n_planes = Anvil::Formats::get_format_n_planes(format); - case ComponentLayout::D: - case ComponentLayout::XD: + if ((in_aspects & Anvil::ImageAspectFlagBits::PLANE_0_BIT) == Anvil::ImageAspectFlagBits::PLANE_0_BIT) { - has_depth_components = true; - - break; + /* No check needed. YUV formats always use plane 0 */ + checked_aspects |= Anvil::ImageAspectFlagBits::PLANE_0_BIT; } - case ComponentLayout::DS: + if ((in_aspects & Anvil::ImageAspectFlagBits::PLANE_1_BIT) == Anvil::ImageAspectFlagBits::PLANE_1_BIT) { - has_depth_components = true; - has_stencil_components = true; + result &= (n_planes >= 2); - break; + checked_aspects |= Anvil::ImageAspectFlagBits::PLANE_1_BIT; } - case ComponentLayout::S: + if ((in_aspects & Anvil::ImageAspectFlagBits::PLANE_2_BIT) == Anvil::ImageAspectFlagBits::PLANE_2_BIT) { - has_stencil_components = true; + result &= (n_planes >= 3); - break; - } - - default: - { - anvil_assert_fail(); + checked_aspects |= Anvil::ImageAspectFlagBits::PLANE_2_BIT; } } - - if ((in_aspects & Anvil::ImageAspectFlagBits::COLOR_BIT) != 0) + else { - result &= has_color_components; + const Anvil::ComponentLayout component_layout = Anvil::Formats::get_format_component_layout_nonyuv(format); + bool has_color_components = false; + bool has_depth_components = false; + bool has_stencil_components = false; - checked_aspects |= Anvil::ImageAspectFlagBits::COLOR_BIT; - } + switch (component_layout) + { + case ComponentLayout::ABGR: + case ComponentLayout::ARGB: + case ComponentLayout::BGR: + case ComponentLayout::BGRA: + case ComponentLayout::EBGR: + case ComponentLayout::R: + case ComponentLayout::RG: + case ComponentLayout::RGB: + case ComponentLayout::RGBA: + { + has_color_components = true; - if (result && (in_aspects & Anvil::ImageAspectFlagBits::DEPTH_BIT) != 0) - { - result &= has_depth_components; + break; + } - checked_aspects |= Anvil::ImageAspectFlagBits::DEPTH_BIT; - } + case ComponentLayout::D: + case ComponentLayout::XD: + { + has_depth_components = true; - if (result && (in_aspects & Anvil::ImageAspectFlagBits::STENCIL_BIT) != 0) - { - result &= has_stencil_components; + break; + } - checked_aspects |= Anvil::ImageAspectFlagBits::STENCIL_BIT; - } + case ComponentLayout::DS: + { + has_depth_components = true; + has_stencil_components = true; - anvil_assert(!result || + break; + } + + case ComponentLayout::S: + { + has_stencil_components = true; + + break; + } + + default: + { + anvil_assert_fail(); + } + } + + if ((in_aspects & Anvil::ImageAspectFlagBits::COLOR_BIT) != 0) + { + result &= has_color_components; + + checked_aspects |= Anvil::ImageAspectFlagBits::COLOR_BIT; + } + + if (result && (in_aspects & Anvil::ImageAspectFlagBits::DEPTH_BIT) != 0) + { + result &= has_depth_components; + + checked_aspects |= Anvil::ImageAspectFlagBits::DEPTH_BIT; + } + + if (result && (in_aspects & Anvil::ImageAspectFlagBits::STENCIL_BIT) != 0) + { + result &= has_stencil_components; + + checked_aspects |= Anvil::ImageAspectFlagBits::STENCIL_BIT; + } + } + + anvil_assert(!result || result && checked_aspects == in_aspects); } @@ -1432,16 +1535,16 @@ void Anvil::Image::init_mipmap_props() m_create_info_ptr->get_base_mip_depth () }; - anvil_assert(m_n_mipmaps != 0); - anvil_assert(m_mipmaps.size() == 0); + anvil_assert(m_n_mipmaps != 0); + anvil_assert(m_mipmap_props.size() == 0); for (uint32_t mipmap_level = 0; mipmap_level < m_n_mipmaps; ++mipmap_level) { - m_mipmaps.push_back(Mipmap(current_mipmap_size[0], - current_mipmap_size[1], - current_mipmap_size[2]) ); + m_mipmap_props.push_back(Mipmap(current_mipmap_size[0], + current_mipmap_size[1], + current_mipmap_size[2]) ); current_mipmap_size[0] /= 2; current_mipmap_size[1] /= 2; @@ -1519,8 +1622,11 @@ bool Anvil::Image::is_memory_bound_for_texel(Anvil::ImageAspectFlagBits in_aspec * @param in_memory_block_ptr Memory block, bound to the specified region. * @param in_memory_block_start_offset Start offset relative to @param memory_block_ptr used for the update. * @param in_memory_block_owned_by_image TODO + * @param in_n_plane Index of image plane the binding is to be made for. This must be 0 for non-YUV + * and joint YUV images. For disjoint YUV images, the value must be between 0 and 2. **/ -void Anvil::Image::on_memory_backing_opaque_update(VkDeviceSize in_resource_offset, +void Anvil::Image::on_memory_backing_opaque_update(uint32_t in_n_plane, + VkDeviceSize in_resource_offset, VkDeviceSize in_size, Anvil::MemoryBlock* in_memory_block_ptr, VkDeviceSize in_memory_block_start_offset, @@ -1539,16 +1645,18 @@ void Anvil::Image::on_memory_backing_opaque_update(VkDeviceSize in_resour if ((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_RESIDENCY_BIT) == 0) { /* Non-resident image: underlying memory is viewed as an opaque linear region. */ - m_page_tracker_ptr->set_binding(in_memory_block_ptr, - in_memory_block_start_offset, - in_resource_offset, - in_size); + PerPlaneMemoryProperties* plane_memory_reqs_ptr = &m_plane_index_to_memory_properties_map.at(in_n_plane); + + plane_memory_reqs_ptr->page_tracker_ptr->set_binding(in_memory_block_ptr, + in_memory_block_start_offset, + in_resource_offset, + in_size); } else { /* The following use cases are expected to make us reach this block: * - * 1) Application is about to bind a memory backing to all tiles OR unbind memory backing + * 1) Application is about to bind a memory backing to all tiles (of a single plane) OR unbind memory backing * from all tiles forming all aspects at once. * * 2) Application wants to bind (or unbind) a memory backing to/from miptail tile(s). @@ -1594,41 +1702,32 @@ void Anvil::Image::on_memory_backing_opaque_update(VkDeviceSize in_resour ANVIL_REDUNDANT_VARIABLE_CONST(current_aspect_props); - if ( in_resource_offset != 0 && - !is_miptail_tile_binding_operation) + if (in_size == current_aspect_props.mip_tail_size) { - is_miptail_tile_binding_operation = (in_size == current_aspect_props.mip_tail_size); - - if (is_miptail_tile_binding_operation) + for (uint32_t n_layer = 0; + n_layer < m_create_info_ptr->get_n_layers(); + ++n_layer) { - is_miptail_tile_binding_operation = false; + auto& current_layer = occupancy_data_ptr->layers.at(n_layer); - for (uint32_t n_layer = 0; - n_layer < m_create_info_ptr->get_n_layers(); - ++n_layer) + if (in_resource_offset == current_aspect_props.mip_tail_offset + current_aspect_props.mip_tail_stride * n_layer) { - auto& current_layer = occupancy_data_ptr->layers.at(n_layer); - - if (in_resource_offset == current_aspect_props.mip_tail_offset + current_aspect_props.mip_tail_stride * n_layer && - in_size == current_aspect_props.mip_tail_size) - { - is_miptail_tile_binding_operation = true; + is_miptail_tile_binding_operation = true; - memset(¤t_layer.tail_occupancy[0], - (!is_unbinding) ? ~0 : 0, - current_layer.tail_occupancy.size() * sizeof(current_layer.tail_occupancy[0])); - - if (!is_unbinding) - { - current_layer.tail_pages_per_binding[in_memory_block_ptr] = current_layer.n_total_tail_pages; - } - else - { - current_layer.tail_pages_per_binding.clear(); - } + memset(¤t_layer.tail_occupancy[0], + (!is_unbinding) ? ~0 : 0, + current_layer.tail_occupancy.size() * sizeof(current_layer.tail_occupancy[0])); - break; + if (!is_unbinding) + { + current_layer.tail_pages_per_binding[in_memory_block_ptr] = current_layer.n_total_tail_pages; } + else + { + current_layer.tail_pages_per_binding.clear(); + } + + break; } } } @@ -1664,7 +1763,6 @@ void Anvil::Image::on_memory_backing_opaque_update(VkDeviceSize in_resour } } - /* PTR_MANAGEMENT: Remove mem blocks no longer referenced by any page / til.e ! */ if (in_memory_block_owned_by_image) { m_memory_blocks_owned.push_back( @@ -1674,8 +1772,7 @@ void Anvil::Image::on_memory_backing_opaque_update(VkDeviceSize in_resour } } -/** Updates page tracker (for non-resident images) OR tile-to-block mappings & tail page counteres, - * as per the specified opaque image update properties. +/** Updates tile-to-block mappings & tail page counteres, as per the specified opaque image update properties. * * @param in_subresource Subresource specified for the update. * @param in_offset Offset specified for the update. @@ -1778,13 +1875,21 @@ void Anvil::Image::on_memory_backing_update(const Anvil::ImageSubresource& in_su bool Anvil::Image::set_memory(MemoryBlockUniquePtr in_memory_block_ptr) { return set_memory_internal(in_memory_block_ptr.release(), - true); /* in_owned_by_image */ + true, /* in_owned_by_image */ + 0, /* in_n_device_group_indices */ + nullptr, /* in_device_group_indices_ptr */ + 0, /* in_n_SFR_rects */ + nullptr); /* in_SFRs_ptr */ } bool Anvil::Image::set_memory(Anvil::MemoryBlock* in_memory_block_ptr) { return set_memory_internal(in_memory_block_ptr, - false); /* in_owned_by_image */ + false, /* in_owned_by_image */ + 0, /* in_n_device_group_indices */ + nullptr, /* in_device_group_indices_ptr */ + 0, /* in_n_SFR_rects */ + nullptr); /* in_SFRs_ptr */ } /** Please see header for specification */ @@ -1795,7 +1900,9 @@ bool Anvil::Image::set_memory(MemoryBlockUniquePtr in_memory_block_ptr, return set_memory_internal(in_memory_block_ptr.release(), true, /* in_owned_by_image */ in_n_device_group_indices, - in_device_group_indices_ptr); + in_device_group_indices_ptr, + 0, /* in_n_SFR_rects */ + nullptr); /* in_SFRs_ptr */ } bool Anvil::Image::set_memory(Anvil::MemoryBlock* in_memory_block_ptr, @@ -1805,7 +1912,9 @@ bool Anvil::Image::set_memory(Anvil::MemoryBlock* in_memory_block_ptr, return set_memory_internal(in_memory_block_ptr, false, /* in_owned_by_image */ in_n_device_group_indices, - in_device_group_indices_ptr); + in_device_group_indices_ptr, + 0, /* in_n_SFR_rects */ + nullptr); /* in_SFRs_ptr */ } /** Please see header for specification */ @@ -1814,7 +1923,9 @@ bool Anvil::Image::set_memory(MemoryBlockUniquePtr in_memory_block_ptr, const VkRect2D* in_SFRs_ptr) { return set_memory_internal(in_memory_block_ptr.release(), - true, /* in_owned_by_image */ + true, /* in_owned_by_image */ + 0, /* in_n_device_group_indices */ + nullptr, /* in_device_group_indices_ptr */ in_n_SFR_rects, in_SFRs_ptr); } @@ -1824,67 +1935,113 @@ bool Anvil::Image::set_memory(Anvil::MemoryBlock* in_memory_block_ptr, const VkRect2D* in_SFRs_ptr) { return set_memory_internal(in_memory_block_ptr, - false, /* in_owned_by_image */ + false, /* in_owned_by_image */ + 0, /* in_n_device_group_indices */ + nullptr, /* in_device_group_indices_ptr */ in_n_SFR_rects, in_SFRs_ptr); } -bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, - bool in_owned_by_image, - uint32_t in_n_SFR_rects, - const VkRect2D* in_SFRs_ptr) +bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, + bool in_owned_by_image, + uint32_t in_n_device_group_indices, + const uint32_t* in_device_group_indices_ptr, + uint32_t in_n_SFR_rects, + const VkRect2D* in_SFRs_ptr) { - const auto& entrypoints (m_device_ptr->get_extension_khr_bind_memory2_entrypoints() ); - VkResult result (VK_ERROR_INITIALIZATION_FAILED); - Anvil::StructChainer struct_chainer; + const auto& entrypoints (m_device_ptr->get_extension_khr_bind_memory2_entrypoints() ); + const bool is_disjoint_yuv_image((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::CREATE_DISJOINT_BIT) != 0); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + + const uint32_t n_planes = (is_disjoint_yuv_image ? Anvil::Formats::get_format_n_planes(m_create_info_ptr->get_format() ) + : 1); /* Sanity checks */ - if (in_memory_block_ptr == nullptr) + anvil_assert(in_memory_block_ptr != nullptr); + anvil_assert((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) == 0); + anvil_assert(m_mipmap_props.size() > 0); + anvil_assert(m_memory_blocks_owned.size() == 0); + anvil_assert(m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); + + + if (in_n_device_group_indices > 0) { - anvil_assert(in_memory_block_ptr != nullptr); + if (!do_sanity_checks_for_physical_device_binding(in_memory_block_ptr, + in_n_device_group_indices) ) + { + anvil_assert_fail(); - goto end; + goto end; + } } - if (!do_sanity_checks_for_sfr_binding(in_n_SFR_rects, - in_SFRs_ptr) ) { - goto end; - } + std::vector bind_info_vec; + std::vector > struct_chain_ptrs; - /* Bind the memory object to the image object */ + bind_info_vec.resize (n_planes); + struct_chain_ptrs.resize(n_planes); - { - VkBindImageMemoryInfoKHR bind_info; + for (uint32_t n_current_plane = 0; + n_current_plane < n_planes; + ++n_current_plane) + { + Anvil::StructChainUniquePtr struct_chain_ptr; + Anvil::StructChainer struct_chainer; + + { + VkBindImageMemoryInfoKHR bind_info; - bind_info.image = m_image; - bind_info.memory = in_memory_block_ptr->get_memory (); - bind_info.memoryOffset = in_memory_block_ptr->get_start_offset(); - bind_info.pNext = nullptr; - bind_info.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR; + bind_info.image = m_image; + bind_info.memory = in_memory_block_ptr->get_memory (); + bind_info.memoryOffset = in_memory_block_ptr->get_start_offset(); + bind_info.pNext = nullptr; + bind_info.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR; - struct_chainer.append_struct(bind_info); - } + struct_chainer.append_struct(bind_info); + } - { - VkBindImageMemoryDeviceGroupInfoKHR bind_info_dg; + if (in_n_device_group_indices > 0) + { + VkBindImageMemoryDeviceGroupInfoKHR bind_info_dg; - bind_info_dg.deviceIndexCount = 0; - bind_info_dg.pDeviceIndices = nullptr; - bind_info_dg.pSplitInstanceBindRegions = in_SFRs_ptr; - bind_info_dg.splitInstanceBindRegionCount = in_n_SFR_rects; - bind_info_dg.pNext = nullptr; - bind_info_dg.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR; + bind_info_dg.deviceIndexCount = in_n_device_group_indices; + bind_info_dg.pDeviceIndices = in_device_group_indices_ptr; + bind_info_dg.pSplitInstanceBindRegions = in_SFRs_ptr; + bind_info_dg.splitInstanceBindRegionCount = in_n_SFR_rects; + bind_info_dg.pNext = nullptr; + bind_info_dg.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR; - struct_chainer.append_struct(bind_info_dg); - } + struct_chainer.append_struct(bind_info_dg); + } - { - auto chain_ptr = struct_chainer.create_chain(); + if (is_disjoint_yuv_image) + { + VkBindImagePlaneMemoryInfoKHR plane_info; - result = entrypoints.vkBindImageMemory2KHR(m_device_ptr->get_device_vk(), - 1, /* bindInfoCount */ - chain_ptr->get_root_struct() ); + plane_info.planeAspect = (n_current_plane == 0) ? VK_IMAGE_ASPECT_PLANE_0_BIT + : (n_current_plane == 1) ? VK_IMAGE_ASPECT_PLANE_1_BIT + : VK_IMAGE_ASPECT_PLANE_2_BIT; + plane_info.pNext = nullptr; + plane_info.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO_KHR; + + struct_chainer.append_struct(plane_info); + + anvil_assert(n_current_plane >= 0 && + n_current_plane <= 2); + } + + struct_chain_ptr = struct_chainer.create_chain(); + + bind_info_vec.at (n_current_plane) = *struct_chain_ptr->get_root_struct(); + struct_chain_ptrs.at(n_current_plane) = std::move (struct_chain_ptr); + } + + anvil_assert(bind_info_vec.size() > 0); + + result = entrypoints.vkBindImageMemory2KHR(m_device_ptr->get_device_vk (), + static_cast (bind_info_vec.size() ), + reinterpret_cast(&bind_info_vec.at(0) )); } anvil_assert_vk_call_succeeded(result); @@ -1894,34 +2051,73 @@ bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, { m_memory_blocks_owned.push_back( MemoryBlockUniquePtr(in_memory_block_ptr, - std::default_delete() - ) + std::default_delete() ) ); } + + { + const auto& mips_to_upload = m_create_info_ptr->get_mipmaps_to_upload(); + const auto tiling = m_create_info_ptr->get_tiling (); + Anvil::ImageLayout src_image_layout = (tiling == Anvil::ImageTiling::LINEAR && mips_to_upload.size() > 0) ? Anvil::ImageLayout::PREINITIALIZED + : Anvil::ImageLayout::UNDEFINED; + + /* Fill the storage with mipmap contents, if mipmap data was specified at input */ + if (mips_to_upload.size() > 0) + { + upload_mipmaps(&mips_to_upload, + src_image_layout, + &src_image_layout); + } + + if (m_create_info_ptr->get_post_alloc_image_layout() != m_create_info_ptr->get_post_create_image_layout() ) + { + const uint32_t n_mipmaps_to_upload = static_cast(mips_to_upload.size()); + Anvil::AccessFlags src_access_mask; + + if (n_mipmaps_to_upload > 0) + { + if (tiling == Anvil::ImageTiling::LINEAR) + { + src_access_mask = Anvil::AccessFlagBits::HOST_WRITE_BIT; + } + else + { + src_access_mask = Anvil::AccessFlagBits::TRANSFER_WRITE_BIT; + } + } + + transition_to_post_alloc_image_layout(src_access_mask, + src_image_layout); + } + + m_create_info_ptr->clear_mipmaps_to_upload(); + } + } + end: return is_vk_call_successful(result); } -/** Please see header for specification */ -bool Anvil::Image::set_memory_internal(uint32_t in_swapchain_image_index, - uint32_t in_opt_n_SFR_rects, - const VkRect2D* in_opt_SFRs_ptr, - uint32_t in_opt_n_device_indices, - const uint32_t* in_opt_device_indices) +bool Anvil::Image::set_swapchain_memory_internal(uint32_t in_swapchain_image_index, + uint32_t in_opt_n_SFR_rects, + const VkRect2D* in_opt_SFRs_ptr, + uint32_t in_opt_n_device_indices, + const uint32_t* in_opt_device_indices) { const auto& entrypoints (m_device_ptr->get_extension_khr_bind_memory2_entrypoints() ); VkResult result (VK_ERROR_INITIALIZATION_FAILED); Anvil::StructChainer struct_chainer; /* Sanity checks */ - anvil_assert((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) == 0); - anvil_assert(m_mipmaps.size() == 1); - anvil_assert(m_peer_device_indices.size() == 0); - anvil_assert(m_peer_sfr_rects.size() == 0); - anvil_assert(m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::PEER_NO_ALLOC || - m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); - anvil_assert(m_create_info_ptr->get_swapchain()->get_n_images() > in_swapchain_image_index); + anvil_assert((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::CREATE_DISJOINT_BIT) == 0); + anvil_assert((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) == 0); + anvil_assert(m_mipmap_props.size () == 1); + anvil_assert(m_peer_device_indices.size () == 0); + anvil_assert(m_peer_sfr_rects.size () == 0); + anvil_assert(m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::PEER_NO_ALLOC || + m_create_info_ptr->get_internal_type() == Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); + anvil_assert(m_create_info_ptr->get_swapchain()->get_n_images() > in_swapchain_image_index); if (!m_device_ptr->is_extension_enabled(VK_KHR_DEVICE_GROUP_EXTENSION_NAME) ) { @@ -1955,6 +2151,20 @@ bool Anvil::Image::set_memory_internal(uint32_t in_swapchain_image_index, } } + if (in_opt_n_device_indices > 0) + { + const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr) ); + + anvil_assert(mgpu_device_ptr != nullptr); + + if (in_opt_n_device_indices != mgpu_device_ptr->get_n_physical_devices() ) + { + anvil_assert_fail(); + + goto end; + } + } + /* Bind the memory object to the image object */ { VkBindImageMemoryInfoKHR bind_info; @@ -2026,378 +2236,6 @@ bool Anvil::Image::set_memory_internal(uint32_t in_swapchain_image_index, return is_vk_call_successful(result); } -bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, - bool in_owned_by_image) -{ - const Anvil::DeviceType device_type(m_device_ptr->get_type() ); - VkResult result (VK_ERROR_INITIALIZATION_FAILED); - - /* Sanity checks */ - anvil_assert(in_memory_block_ptr != nullptr); - anvil_assert((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) == 0); - anvil_assert(m_mipmaps.size() > 0); - anvil_assert(m_memory_blocks_owned.size() == 0); - anvil_assert(m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); - - /* Bind the memory object to the image object */ - if (device_type == Anvil::DeviceType::SINGLE_GPU) - { - lock(); - { - result = Anvil::Vulkan::vkBindImageMemory(m_device_ptr->get_device_vk(), - m_image, - in_memory_block_ptr->get_memory(), - in_memory_block_ptr->get_start_offset() ); - } - unlock(); - } - else - { - const auto& entrypoints (m_device_ptr->get_extension_khr_bind_memory2_entrypoints() ); - Anvil::StructChainer struct_chainer; - - anvil_assert(device_type == Anvil::DeviceType::MULTI_GPU); - anvil_assert(m_create_info_ptr->get_mipmaps_to_upload().size() == 0); - - if (!m_device_ptr->is_extension_enabled(VK_KHR_DEVICE_GROUP_EXTENSION_NAME) ) - { - anvil_assert(m_device_ptr->is_extension_enabled(VK_KHR_DEVICE_GROUP_EXTENSION_NAME) ); - - goto end; - } - - - { - VkBindImageMemoryInfoKHR bind_info; - - bind_info.image = m_image; - bind_info.memory = in_memory_block_ptr->get_memory(); - bind_info.memoryOffset = in_memory_block_ptr->get_start_offset(); - bind_info.pNext = nullptr; - bind_info.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR; - - struct_chainer.append_struct(bind_info); - } - - { - VkBindImageMemoryDeviceGroupInfoKHR bind_info_dv; - - bind_info_dv.deviceIndexCount = 0; - bind_info_dv.pDeviceIndices = nullptr; - bind_info_dv.pSplitInstanceBindRegions = nullptr; - bind_info_dv.splitInstanceBindRegionCount = 0; - bind_info_dv.pNext = nullptr; - bind_info_dv.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR; - - struct_chainer.append_struct(bind_info_dv); - } - - { - auto chain_ptr = struct_chainer.create_chain(); - - result = entrypoints.vkBindImageMemory2KHR(m_device_ptr->get_device_vk(), - 1, /* bindInfoCount */ - chain_ptr->get_root_struct() ); - } - } - - anvil_assert_vk_call_succeeded(result); - if (is_vk_call_successful(result) ) - { - const auto& mips_to_upload = m_create_info_ptr->get_mipmaps_to_upload(); - const auto tiling = m_create_info_ptr->get_tiling (); - - Anvil::ImageLayout src_image_layout = (tiling == Anvil::ImageTiling::LINEAR && mips_to_upload.size() > 0) ? Anvil::ImageLayout::PREINITIALIZED - : Anvil::ImageLayout::UNDEFINED; - - if (in_owned_by_image) - { - m_memory_blocks_owned.push_back( - MemoryBlockUniquePtr(in_memory_block_ptr, - std::default_delete() ) - ); - } - - /* Fill the storage with mipmap contents, if mipmap data was specified at input */ - if (mips_to_upload.size() > 0) - { - upload_mipmaps(&mips_to_upload, - src_image_layout, - &src_image_layout); - } - - if (m_create_info_ptr->get_post_alloc_image_layout() != m_create_info_ptr->get_post_create_image_layout() ) - { - const uint32_t n_mipmaps_to_upload = static_cast(mips_to_upload.size()); - Anvil::AccessFlags src_access_mask; - - if (n_mipmaps_to_upload > 0) - { - if (tiling == Anvil::ImageTiling::LINEAR) - { - src_access_mask = Anvil::AccessFlagBits::HOST_WRITE_BIT; - } - else - { - src_access_mask = Anvil::AccessFlagBits::TRANSFER_WRITE_BIT; - } - } - - transition_to_post_alloc_image_layout(src_access_mask, - src_image_layout); - } - - m_create_info_ptr->clear_mipmaps_to_upload(); - } - -end: - return is_vk_call_successful(result); -} - -bool Anvil::Image::set_memory_internal(Anvil::MemoryBlock* in_memory_block_ptr, - bool in_owned_by_image, - uint32_t in_n_device_group_indices, - const uint32_t* in_device_group_indices_ptr) -{ - const auto& entrypoints (m_device_ptr->get_extension_khr_bind_memory2_entrypoints() ); - VkResult result (VK_ERROR_INITIALIZATION_FAILED); - Anvil::StructChainer struct_chainer; - - /* Sanity checks */ - anvil_assert(in_memory_block_ptr != nullptr); - anvil_assert((m_create_info_ptr->get_create_flags() & Anvil::ImageCreateFlagBits::SPARSE_BINDING_BIT) == 0); - anvil_assert(m_mipmaps.size() > 0); - anvil_assert(m_memory_blocks_owned.size() == 0); - anvil_assert(m_create_info_ptr->get_internal_type() != Anvil::ImageInternalType::SWAPCHAIN_WRAPPER); - - if (!do_sanity_checks_for_physical_device_binding(in_memory_block_ptr, - in_n_device_group_indices) ) - { - anvil_assert_fail(); - - goto end; - } - - { - VkBindImageMemoryInfoKHR bind_info; - - bind_info.image = m_image; - bind_info.memory = in_memory_block_ptr->get_memory (); - bind_info.memoryOffset = in_memory_block_ptr->get_start_offset(); - bind_info.pNext = nullptr; - bind_info.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR; - - struct_chainer.append_struct(bind_info); - } - - { - VkBindImageMemoryDeviceGroupInfoKHR bind_info_dg; - - bind_info_dg.deviceIndexCount = in_n_device_group_indices; - bind_info_dg.pDeviceIndices = in_device_group_indices_ptr; - bind_info_dg.pSplitInstanceBindRegions = nullptr; - bind_info_dg.splitInstanceBindRegionCount = 0; - bind_info_dg.pNext = nullptr; - bind_info_dg.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR; - - struct_chainer.append_struct(bind_info_dg); - } - - { - auto chain_ptr = struct_chainer.create_chain(); - - result = entrypoints.vkBindImageMemory2KHR(m_device_ptr->get_device_vk(), - 1, /* bindInfoCount */ - chain_ptr->get_root_struct() ); - } - - anvil_assert_vk_call_succeeded(result); - if (is_vk_call_successful(result) ) - { - if (in_owned_by_image) - { - m_memory_blocks_owned.push_back( - MemoryBlockUniquePtr(in_memory_block_ptr, - std::default_delete() ) - ); - } - } - -end: - return is_vk_call_successful(result); -} - -/* Please see header for specification */ -bool Anvil::Image::set_memory_multi(uint32_t in_n_image_physical_device_memory_binding_updates, - ImagePhysicalDeviceMemoryBindingUpdate* in_updates_ptr) -{ - const auto device_ptr (in_updates_ptr[0].image_ptr->m_device_ptr); - const auto& entrypoints (device_ptr->get_extension_khr_bind_memory2_entrypoints() ); - VkResult result (VK_ERROR_INITIALIZATION_FAILED); - Anvil::StructChainVector struct_chains; - - /* Sanity checks */ - for (uint32_t n_update = 0; - n_update < in_n_image_physical_device_memory_binding_updates; - ++n_update) - { - const auto& current_update = in_updates_ptr[n_update]; - - if (!current_update.image_ptr->do_sanity_checks_for_physical_device_binding(current_update.memory_block_ptr, - static_cast(current_update.physical_devices.size() ))) - { - goto end; - } - } - - /* Bind the memory objects to relevant physical devices */ - for (uint32_t n_update = 0; - n_update < in_n_image_physical_device_memory_binding_updates; - ++n_update) - { - const auto& current_update = in_updates_ptr[n_update]; - Anvil::StructChainer struct_chainer; - { - VkBindImageMemoryInfoKHR bind_info; - - bind_info.image = current_update.image_ptr->m_image; - bind_info.memory = current_update.memory_block_ptr->get_memory (); - bind_info.memoryOffset = current_update.memory_block_ptr->get_start_offset(); - bind_info.pNext = nullptr; - bind_info.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR; - - struct_chainer.append_struct(bind_info); - } - - { - VkBindImageMemoryDeviceGroupInfoKHR bind_info_dg; - - bind_info_dg.deviceIndexCount = static_cast(current_update.physical_devices.size()); - bind_info_dg.pDeviceIndices = nullptr; - bind_info_dg.pSplitInstanceBindRegions = nullptr; - bind_info_dg.splitInstanceBindRegionCount = 0; - bind_info_dg.pNext = nullptr; - bind_info_dg.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR; - - struct_chainer.append_struct(bind_info_dg); - } - - struct_chains.append_struct_chain( - std::move(struct_chainer.create_chain() ) - ); - } - - /* All done */ - result = entrypoints.vkBindImageMemory2KHR(device_ptr->get_device_vk(), - struct_chains.get_n_structs (), - struct_chains.get_root_structs () ); - - anvil_assert_vk_call_succeeded(result); - if (is_vk_call_successful(result) ) - { - for (uint32_t n_update = 0; - n_update < in_n_image_physical_device_memory_binding_updates; - ++n_update) - { - auto& current_update = in_updates_ptr[n_update]; - - if (current_update.memory_block_owned_by_image) - { - current_update.image_ptr->m_memory_blocks_owned.push_back( - MemoryBlockUniquePtr(current_update.memory_block_ptr, - std::default_delete() - ) - ); - } - } - } -end: - return is_vk_call_successful(result); -} - -/* Please see header for specification */ -bool Anvil::Image::set_memory_multi(uint32_t in_n_image_sfr_memory_binding_updates, - Anvil::ImageSFRMemoryBindingUpdate* in_updates_ptr) -{ - std::vector bind_info_items; - std::vector bind_info_dg_items; - auto device_ptr (in_updates_ptr[0].image_ptr->m_device_ptr); - const auto& entrypoints (device_ptr->get_extension_khr_bind_memory2_entrypoints() ); - VkResult result (VK_ERROR_INITIALIZATION_FAILED); - - /* Sanity checks */ - for (uint32_t n_update = 0; - n_update < in_n_image_sfr_memory_binding_updates; - ++n_update) - { - const auto& current_update = in_updates_ptr[n_update]; - - if (current_update.memory_block_ptr == nullptr) - { - anvil_assert(current_update.memory_block_ptr != nullptr); - - goto end; - } - - if (!current_update.image_ptr->do_sanity_checks_for_sfr_binding(static_cast(current_update.SFRs.size() ), - ¤t_update.SFRs[0]) ) - { - goto end; - } - } - - /* Bind the memory objects to relevant images */ - bind_info_items.resize(in_n_image_sfr_memory_binding_updates); - - - for (uint32_t n_update = 0; - n_update < in_n_image_sfr_memory_binding_updates; - ++n_update) - { - auto& bind_info = bind_info_items.at(n_update); - auto& bind_info_dg = bind_info_dg_items.at(n_update); - const auto& current_update = in_updates_ptr[n_update]; - - bind_info_dg.deviceIndexCount = 0; - bind_info_dg.pDeviceIndices = nullptr; - bind_info_dg.pSplitInstanceBindRegions = ¤t_update.SFRs.at(0); - bind_info_dg.splitInstanceBindRegionCount = static_cast(current_update.SFRs.size()); - bind_info_dg.pNext = nullptr; - bind_info_dg.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR; - - bind_info.image = current_update.image_ptr->m_image; - bind_info.memory = current_update.memory_block_ptr->get_memory (); - bind_info.memoryOffset = current_update.memory_block_ptr->get_start_offset(); - bind_info.pNext = nullptr; - bind_info.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR; - } - - result = entrypoints.vkBindImageMemory2KHR(device_ptr->get_device_vk(), - static_cast(bind_info_items.size() ), - &bind_info_items[0]); - - anvil_assert_vk_call_succeeded(result); - if (is_vk_call_successful(result) ) - { - for (uint32_t n_update = 0; - n_update < in_n_image_sfr_memory_binding_updates; - ++n_update) - { - auto& current_update = in_updates_ptr[n_update]; - - if (current_update.memory_block_owned_by_image) - { - current_update.image_ptr->m_memory_blocks_owned.push_back( - MemoryBlockUniquePtr(current_update.memory_block_ptr, - std::default_delete() ) - ); - } - } - } -end: - return is_vk_call_successful(result); -} - void Anvil::Image::transition_to_post_alloc_image_layout(Anvil::AccessFlags in_source_access_mask, Anvil::ImageLayout in_src_layout) { @@ -2423,7 +2261,6 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p std::map > image_aspect_to_mipmap_raw_data_map; Anvil::ImageAspectFlags image_aspects_touched; Anvil::ImageSubresourceRange image_subresource_range; - const VkDeviceSize sparse_page_size ( (m_page_tracker_ptr != nullptr) ? m_page_tracker_ptr->get_page_size() : 0); Anvil::Queue* universal_queue_ptr (m_device_ptr->get_universal_queue(0) ); /* Make sure image has been assigned at least one memory block before we go ahead with the upload process */ @@ -2451,11 +2288,11 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p * For optimal tiling, we need to copy the raw data to temporary buffer * and use vkCmdCopyBufferToImage() to let the driver rearrange the data as needed. */ - image_subresource_range.aspect_mask = image_aspects_touched; + image_subresource_range.aspect_mask = image_aspects_touched; image_subresource_range.base_array_layer = 0; image_subresource_range.base_mip_level = 0; - image_subresource_range.layer_count = m_create_info_ptr->get_n_layers(); - image_subresource_range.level_count = m_n_mipmaps; + image_subresource_range.layer_count = m_create_info_ptr->get_n_layers(); + image_subresource_range.level_count = m_n_mipmaps; if (m_create_info_ptr->get_tiling() == Anvil::ImageTiling::LINEAR) { @@ -2466,8 +2303,14 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p aspect_to_mipmap_data_iterator != image_aspect_to_mipmap_raw_data_map.end(); ++aspect_to_mipmap_data_iterator) { - Anvil::ImageAspectFlagBits current_aspect = aspect_to_mipmap_data_iterator->first; - const auto& mipmap_raw_data_items = aspect_to_mipmap_data_iterator->second; + Anvil::ImageAspectFlagBits current_aspect = aspect_to_mipmap_data_iterator->first; + const uint32_t current_plane_index = (current_aspect == Anvil::ImageAspectFlagBits::PLANE_1_BIT) ? 1 + : (current_aspect == Anvil::ImageAspectFlagBits::PLANE_2_BIT) ? 2 + : 0; + const auto& current_plane_mem_reqs = m_plane_index_to_memory_properties_map.at(current_plane_index); + const auto& mipmap_raw_data_items = aspect_to_mipmap_data_iterator->second; + const VkDeviceSize sparse_page_size = (current_plane_mem_reqs.page_tracker_ptr != nullptr) ? current_plane_mem_reqs.page_tracker_ptr->get_page_size() + : 0; for (auto mipmap_raw_data_item_iterator = mipmap_raw_data_items.begin(); mipmap_raw_data_item_iterator != mipmap_raw_data_items.end(); @@ -2554,17 +2397,17 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p anvil_assert(sparse_page_size != 0); anvil_assert(( dst_slice_offset_page_aligned % sparse_page_size) == 0); - mem_block_ptr = m_page_tracker_ptr->get_memory_block(dst_slice_offset_page_aligned, - sparse_page_size, - &memory_region_start_offset); + mem_block_ptr = current_plane_mem_reqs.page_tracker_ptr->get_memory_block(dst_slice_offset_page_aligned, + sparse_page_size, + &memory_region_start_offset); anvil_assert(mem_block_ptr != nullptr); if (dst_slice_offset + image_subresource_layout.row_pitch > dst_slice_offset_page_aligned + sparse_page_size) { VkDeviceSize dummy; - auto mem_block2_ptr = m_page_tracker_ptr->get_memory_block(dst_slice_offset_page_aligned + sparse_page_size, - sparse_page_size, - &dummy); + auto mem_block2_ptr = current_plane_mem_reqs.page_tracker_ptr->get_memory_block(dst_slice_offset_page_aligned + sparse_page_size, + sparse_page_size, + &dummy); ANVIL_REDUNDANT_VARIABLE(mem_block2_ptr); diff --git a/src/wrappers/image_view.cpp b/src/wrappers/image_view.cpp index 788d3b36..0cdea88e 100644 --- a/src/wrappers/image_view.cpp +++ b/src/wrappers/image_view.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2019 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -28,6 +28,7 @@ #include "wrappers/device.h" #include "wrappers/image.h" #include "wrappers/image_view.h" +#include "wrappers/sampler_ycbcr_conversion.h" /* Please see header for specification */ Anvil::ImageViewUniquePtr Anvil::ImageView::create(Anvil::ImageViewCreateInfoUniquePtr in_create_info_ptr) @@ -146,21 +147,22 @@ Anvil::ImageSubresourceRange Anvil::ImageView::get_subresource_range() const **/ bool Anvil::ImageView::init() { - const auto aspect_mask = m_create_info_ptr->get_aspect (); - const auto format = m_create_info_ptr->get_format (); - const auto image_view_type = m_create_info_ptr->get_type (); - const auto n_base_layer = m_create_info_ptr->get_base_layer (); - const auto n_base_mip = m_create_info_ptr->get_base_mipmap_level(); - const auto n_layers = m_create_info_ptr->get_n_layers (); - const auto n_mips = m_create_info_ptr->get_n_mipmaps (); - uint32_t parent_image_n_layers = 0; - uint32_t parent_image_n_mipmaps = 0; - auto parent_image_ptr = m_create_info_ptr->get_parent_image(); - bool result = false; + const auto aspect_mask = m_create_info_ptr->get_aspect (); + const auto format = m_create_info_ptr->get_format (); + const auto image_view_type = m_create_info_ptr->get_type (); + const auto n_base_layer = m_create_info_ptr->get_base_layer (); + const auto n_base_mip = m_create_info_ptr->get_base_mipmap_level(); + const auto n_layers = m_create_info_ptr->get_n_layers (); + const auto n_mips = m_create_info_ptr->get_n_mipmaps (); + uint32_t parent_image_n_layers = 0; + uint32_t parent_image_n_mipmaps = 0; + auto parent_image_ptr = m_create_info_ptr->get_parent_image(); + bool result = false; VkResult result_vk; + const auto sampler_ycbcr_conversion_ptr = m_create_info_ptr->get_sampler_ycbcr_conversion_ptr(); Anvil::StructChainer struct_chainer; - const auto& swizzle_array = m_create_info_ptr->get_swizzle_array(); - auto usage = m_create_info_ptr->get_usage (); + const auto& swizzle_array = m_create_info_ptr->get_swizzle_array(); + auto usage = m_create_info_ptr->get_usage (); parent_image_n_mipmaps = parent_image_ptr->get_n_mipmaps(); @@ -253,6 +255,19 @@ bool Anvil::ImageView::init() struct_chainer.append_struct(usage_create_info); } + if (sampler_ycbcr_conversion_ptr != nullptr) + { + VkSamplerYcbcrConversionInfoKHR conversion_info; + + anvil_assert(m_device_ptr->get_extension_info()->khr_sampler_ycbcr_conversion() ); + + conversion_info.conversion = sampler_ycbcr_conversion_ptr->get_sampler_ycbcr_conversion_vk(); + conversion_info.pNext = nullptr; + conversion_info.sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO_KHR; + + struct_chainer.append_struct(conversion_info); + } + { auto chain_ptr = struct_chainer.create_chain(); diff --git a/src/wrappers/instance.cpp b/src/wrappers/instance.cpp index cd9e174b..cbe8c0f5 100644 --- a/src/wrappers/instance.cpp +++ b/src/wrappers/instance.cpp @@ -26,18 +26,16 @@ #include "wrappers/instance.h" #include "wrappers/physical_device.h" -#if !defined(ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB) - static bool g_core_func_ptrs_inited = false; - static bool g_instance_func_ptrs_inited = false; -#endif - -static std::mutex g_vk10_func_ptr_init_mutex; -static Anvil::LibraryUniquePtr g_vk10_library_ptr; +static bool g_core_func_ptrs_inited = false; +static bool g_instance_func_ptrs_inited = false; +static std::mutex g_vk_func_ptr_init_mutex; +static Anvil::LibraryUniquePtr g_vk_library_ptr; /** Please see header for specification */ Anvil::Instance::Instance(Anvil::InstanceCreateInfoUniquePtr in_create_info_ptr) :MTSafetySupportProvider(in_create_info_ptr->is_mt_safe() ), + m_api_version (APIVersion::UNKNOWN), m_debug_messenger_ptr (Anvil::DebugMessengerUniquePtr(nullptr, std::default_delete() )), m_global_layer (""), m_instance (VK_NULL_HANDLE) @@ -79,7 +77,10 @@ Anvil::InstanceUniquePtr Anvil::Instance::create(Anvil::InstanceCreateInfoUnique new Instance(std::move(in_create_info_ptr) ) ); - new_instance_ptr->init(); + if (!new_instance_ptr->init() ) + { + new_instance_ptr.reset(); + } return new_instance_ptr; } @@ -177,10 +178,14 @@ void Anvil::Instance::enumerate_layer_extensions(Anvil::Layer* in_layer_ptr) in_layer_ptr = &m_global_layer; } - layer_name = in_layer_ptr->name.c_str(); - result = Anvil::Vulkan::vkEnumerateInstanceExtensionProperties(layer_name, - &n_extensions, - nullptr); /* pProperties */ + if (in_layer_ptr->name != "") + { + layer_name = in_layer_ptr->name.c_str(); + } + + result = Anvil::Vulkan::vkEnumerateInstanceExtensionProperties(layer_name, + &n_extensions, + nullptr); /* pProperties */ anvil_assert_vk_call_succeeded(result); @@ -406,27 +411,25 @@ const Anvil::ExtensionKHRDeviceGroupCreationEntrypoints& Anvil::Instance::get_ex } /** Initializes the wrapper. */ -void Anvil::Instance::init() +bool Anvil::Instance::init() { - VkApplicationInfo app_info; - VkInstanceCreateInfo create_info; + uint32_t api_version_to_use = 0; + std::vector enabled_extensions_raw; std::vector enabled_layers; std::map extension_enabled_status; bool is_device_group_creation_supported = true; size_t n_instance_layers = 0; - VkResult result = VK_ERROR_INITIALIZATION_FAILED; + bool result = false; + VkResult result_vk = VK_ERROR_INITIALIZATION_FAILED; - ANVIL_REDUNDANT_VARIABLE(result); + ANVIL_REDUNDANT_VARIABLE(result_vk); - #if !defined(ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB) + if (!init_vk_func_ptrs() ) { - if (!init_vk10_func_ptrs() ) - { - /* TODO: Return null instance in case of a failure */ - anvil_assert_fail(); - } + anvil_assert_fail(); + + goto end; } - #endif /* Enumerate available layers */ enumerate_instance_layers(); @@ -463,20 +466,74 @@ void Anvil::Instance::init() #endif }; - /* Set up the app info descriptor **/ - app_info.apiVersion = VK_MAKE_VERSION(1, 0, 0); - app_info.applicationVersion = 0; - app_info.engineVersion = 0; - app_info.pApplicationName = get_create_info_ptr()->get_app_name ().c_str(); - app_info.pEngineName = get_create_info_ptr()->get_engine_name().c_str(); - app_info.pNext = nullptr; - app_info.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; + /* Determine API version to use */ + if (m_create_info_ptr->get_api_version() == Anvil::APIVersion::UNKNOWN) + { + /* Use the latest version available .. */ + uint32_t available_vk_version = 0; + uint32_t available_vk_version_major = 0; + uint32_t available_vk_version_minor = 0; - /* Set up the create info descriptor */ - memset(&create_info, - 0, - sizeof(create_info) ); + if (Anvil::Vulkan::vkEnumerateInstanceVersion != nullptr) + { + if (Anvil::Vulkan::vkEnumerateInstanceVersion(&available_vk_version) != VK_SUCCESS) + { + anvil_assert_fail(); + + goto end; + } + } + else + { + /* Assume VK 1.0 is the highest API version available. */ + available_vk_version = VK_MAKE_VERSION(1, 0, 0); + } + + available_vk_version_major = VK_VERSION_MAJOR(available_vk_version); + available_vk_version_minor = VK_VERSION_MINOR(available_vk_version); + + if ( available_vk_version_major >= 2 || + (available_vk_version_major == 1 && available_vk_version_minor >= 1)) + { + api_version_to_use = VK_MAKE_VERSION(1, 1, 0); + m_api_version = APIVersion::_1_1; + } + else + { + api_version_to_use = VK_MAKE_VERSION(1, 0, 0); + m_api_version = APIVersion::_1_0; + } + } + else + { + switch (m_create_info_ptr->get_api_version() ) + { + case APIVersion::_1_0: + { + api_version_to_use = VK_MAKE_VERSION(1, 0, 0); + m_api_version = APIVersion::_1_0; + + break; + } + + case APIVersion::_1_1: + { + api_version_to_use = VK_MAKE_VERSION(1, 1, 0); + m_api_version = APIVersion::_1_1; + + break; + } + + default: + { + anvil_assert_fail(); + + goto end; + } + } + } + /* Set up the create info descriptor */ n_instance_layers = static_cast(m_supported_layers.size() ); for (size_t n_instance_layer = 0; @@ -488,8 +545,8 @@ void Anvil::Instance::init() /* If validation is enabled and this is a layer which issues debug call-backs, cache it, so that * we can request for it at vkCreateInstance() call time */ - if (get_create_info_ptr()->get_validation_callback() != nullptr && - layer_description.find ("Validation") != std::string::npos) + if (get_create_info_ptr()->get_validation_callback() != nullptr && + layer_description.find ("alidation") != std::string::npos) { enabled_layers.push_back(layer_name.c_str() ); } @@ -576,43 +633,66 @@ void Anvil::Instance::init() } /* We're ready to create a new Vulkan instance */ - std::vector enabled_extensions_raw; - for (auto& ext_name : extension_enabled_status) { enabled_extensions_raw.push_back(ext_name.first.c_str() ); } - create_info.enabledExtensionCount = static_cast(enabled_extensions_raw.size() ); - create_info.enabledLayerCount = static_cast(enabled_layers.size() ); - create_info.flags = 0; - create_info.pApplicationInfo = &app_info; - create_info.pNext = nullptr; - create_info.ppEnabledExtensionNames = (enabled_extensions_raw.size() > 0) ? &enabled_extensions_raw[0] : nullptr; - create_info.ppEnabledLayerNames = (enabled_layers.size() > 0) ? &enabled_layers [0] : nullptr; - create_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; + { + VkApplicationInfo app_info; + VkInstanceCreateInfo create_info; + + /* Set up the app info descriptor */ + app_info.apiVersion = api_version_to_use; + app_info.applicationVersion = m_create_info_ptr->get_app_version (); + app_info.engineVersion = m_create_info_ptr->get_engine_version(); + app_info.pApplicationName = m_create_info_ptr->get_app_name ().c_str(); + app_info.pEngineName = m_create_info_ptr->get_engine_name ().c_str(); + app_info.pNext = nullptr; + app_info.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; + + create_info.enabledExtensionCount = static_cast(enabled_extensions_raw.size() ); + create_info.enabledLayerCount = static_cast(enabled_layers.size () ); + create_info.flags = 0; + create_info.pApplicationInfo = &app_info; + create_info.pNext = nullptr; + create_info.ppEnabledExtensionNames = (enabled_extensions_raw.size() > 0) ? &enabled_extensions_raw.at(0) : nullptr; + create_info.ppEnabledLayerNames = (enabled_layers.size() > 0) ? &enabled_layers.at (0) : nullptr; + create_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; + + result_vk = Anvil::Vulkan::vkCreateInstance(&create_info, + nullptr, /* pAllocator */ + &m_instance); + + anvil_assert_vk_call_succeeded(result_vk); + } - result = Anvil::Vulkan::vkCreateInstance(&create_info, - nullptr, /* pAllocator */ - &m_instance); + /* If this is a VK 1.1 instance, explicitly mark VK1.1 specific extensions as enabled. This is to provide backwards compatibility + * with VK 1.0 applications which may not be aware that VK 1.0 extensions that were folded into VK 1.1 do not necessarily have to + * be reported as supported. + */ + if (m_api_version == APIVersion::_1_1) + { + extension_enabled_status[VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME] = true; + extension_enabled_status[VK_KHR_EXTERNAL_FENCE_CAPABILITIES_EXTENSION_NAME] = true; + extension_enabled_status[VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME] = true; + extension_enabled_status[VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME] = true; + extension_enabled_status[VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME] = true; - anvil_assert_vk_call_succeeded(result); + m_enabled_extensions_info_ptr = Anvil::ExtensionInfo::create_instance_extension_info(extension_enabled_status, + false); /* in_unspecified_extension_name_value */ + } - /* Continue initializing */ - #if !defined(ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB) + /* Retrieve the remaining part of instance-dependent function pointers */ + if (!init_vk_func_ptrs() ) { - /* Retrieve the remaining part of instance-dependent function pointers */ - if (!init_vk10_func_ptrs() ) - { - /* TODO: Return null instance in case of a failure */ - anvil_assert_fail(); - } + /* TODO: Return null instance in case of a failure */ + anvil_assert_fail(); } - #endif init_func_pointers(); - if (get_create_info_ptr()->get_validation_callback() != nullptr) + if (m_create_info_ptr->get_validation_callback() != nullptr) { init_debug_callbacks(); } @@ -623,6 +703,10 @@ void Anvil::Instance::init() { enumerate_physical_device_groups(); } + + result = true; +end: + return result; } /** Initializes debug callback support. */ @@ -645,6 +729,13 @@ void Anvil::Instance::init_debug_callbacks() /** Initializes all required instance-level function pointers. */ void Anvil::Instance::init_func_pointers() { + /* NOTE: Vulkan 1.1 instances do not need to report support for extensions considered core in 1.1. To address this, any func pointers corresponding to VK1.1 functionality + * need to be taken from core entrypoint pool. + * + * Anvil reports support for extensions corresponding to wrapped core functionality, irrelevant of what extensions the implementation actually reports for. + */ + const bool is_vk11_instance = (m_api_version == APIVersion::_1_1); + #ifdef _WIN32 { #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) @@ -730,22 +821,38 @@ void Anvil::Instance::init_func_pointers() anvil_assert(m_ext_debug_utils_entrypoints.vkSubmitDebugUtilsMessageEXT != nullptr); } - if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_get_physical_device_properties2() ) + if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_get_physical_device_properties2() || + is_vk11_instance) { + const char* vk_get_physical_device_features_2_entrypoint_name = (is_vk11_instance) ? "vkGetPhysicalDeviceFeatures2" + : "vkGetPhysicalDeviceFeatures2KHR"; + const char* vk_get_physical_device_format_properties_2_entrypoint_name = (is_vk11_instance) ? "vkGetPhysicalDeviceFormatProperties2" + : "vkGetPhysicalDeviceFormatProperties2KHR"; + const char* vk_get_physical_device_image_format_properties_2_entrypoint_name = (is_vk11_instance) ? "vkGetPhysicalDeviceImageFormatProperties2" + : "vkGetPhysicalDeviceImageFormatProperties2KHR"; + const char* vk_get_physical_device_memory_properties_2_entrypoint_name = (is_vk11_instance) ? "vkGetPhysicalDeviceMemoryProperties2" + : "vkGetPhysicalDeviceMemoryProperties2KHR"; + const char* vk_get_physical_device_properties_2_entrypoint_name = (is_vk11_instance) ? "vkGetPhysicalDeviceProperties2" + : "vkGetPhysicalDeviceProperties2KHR"; + const char* vk_get_physical_device_queue_family_properties_2_entrypoint_name = (is_vk11_instance) ? "vkGetPhysicalDeviceQueueFamilyProperties2" + : "vkGetPhysicalDeviceQueueFamilyProperties2KHR"; + const char* vk_get_physical_device_sparse_image_format_properties_2_entrypoint_name = (is_vk11_instance) ? "vkGetPhysicalDeviceSparseImageFormatProperties2" + : "vkGetPhysicalDeviceSparseImageFormatProperties2KHR"; + m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceFeatures2KHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceFeatures2KHR") ); + vk_get_physical_device_features_2_entrypoint_name) ); m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceFormatProperties2KHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceFormatProperties2KHR") ); + vk_get_physical_device_format_properties_2_entrypoint_name) ); m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceImageFormatProperties2KHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceImageFormatProperties2KHR") ); + vk_get_physical_device_image_format_properties_2_entrypoint_name) ); m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceMemoryProperties2KHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceMemoryProperties2KHR") ); + vk_get_physical_device_memory_properties_2_entrypoint_name) ); m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceProperties2KHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceProperties2KHR") ); + vk_get_physical_device_properties_2_entrypoint_name) ); m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceQueueFamilyProperties2KHR = reinterpret_cast (Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceQueueFamilyProperties2KHR") ); + vk_get_physical_device_queue_family_properties_2_entrypoint_name) ); m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceSparseImageFormatProperties2KHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceSparseImageFormatProperties2KHR") ); + vk_get_physical_device_sparse_image_format_properties_2_entrypoint_name) ); anvil_assert(m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceFeatures2KHR != nullptr); anvil_assert(m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceFormatProperties2KHR != nullptr); @@ -756,34 +863,50 @@ void Anvil::Instance::init_func_pointers() anvil_assert(m_khr_get_physical_device_properties2_entrypoints.vkGetPhysicalDeviceSparseImageFormatProperties2KHR != nullptr); } - if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_device_group_creation() ) + if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_device_group_creation() || + is_vk11_instance) { + const char* vk_enumerate_physical_device_groups_entrypoint_name = (is_vk11_instance) ? "vkEnumeratePhysicalDeviceGroups" + : "vkEnumeratePhysicalDeviceGroupsKHR"; + m_khr_device_group_creation_entrypoints.vkEnumeratePhysicalDeviceGroupsKHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, - "vkEnumeratePhysicalDeviceGroupsKHR") ); + vk_enumerate_physical_device_groups_entrypoint_name) ); anvil_assert(m_khr_device_group_creation_entrypoints.vkEnumeratePhysicalDeviceGroupsKHR != nullptr); } - if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_external_fence_capabilities() ) + if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_external_fence_capabilities() || + is_vk11_instance) { + const char* vk_get_physical_device_external_fence_properties_entrypoint_name = (is_vk11_instance) ? "vkGetPhysicalDeviceExternalFenceProperties" + : "vkGetPhysicalDeviceExternalFencePropertiesKHR"; + m_khr_external_fence_capabilities_entrypoints.vkGetPhysicalDeviceExternalFencePropertiesKHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceExternalFencePropertiesKHR") ); + vk_get_physical_device_external_fence_properties_entrypoint_name) ); - anvil_assert(m_khr_external_fence_capabilities_entrypoints.vkGetPhysicalDeviceExternalFencePropertiesKHR!= nullptr); + anvil_assert(m_khr_external_fence_capabilities_entrypoints.vkGetPhysicalDeviceExternalFencePropertiesKHR != nullptr); } - if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_external_memory_capabilities() ) + if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_external_memory_capabilities() || + is_vk11_instance) { + const char* vk_get_physical_device_external_buffer_properties_entrypoint_name = (is_vk11_instance) ? "vkGetPhysicalDeviceExternalBufferProperties" + : "vkGetPhysicalDeviceExternalBufferPropertiesKHR"; + m_khr_external_memory_capabilities_entrypoints.vkGetPhysicalDeviceExternalBufferPropertiesKHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceExternalBufferPropertiesKHR") ); + vk_get_physical_device_external_buffer_properties_entrypoint_name) ); anvil_assert(m_khr_external_memory_capabilities_entrypoints.vkGetPhysicalDeviceExternalBufferPropertiesKHR != nullptr); } - if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_external_semaphore_capabilities() ) + if (m_enabled_extensions_info_ptr->get_instance_extension_info()->khr_external_semaphore_capabilities() || + is_vk11_instance) { + const char* vk_get_physical_device_external_semaphore_properties_entrypoint_name = (is_vk11_instance) ? "vkGetPhysicalDeviceExternalSemaphoreProperties" + : "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR"; + m_khr_external_semaphore_capabilities_entrypoints.vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, - "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR") ); + vk_get_physical_device_external_semaphore_properties_entrypoint_name) ); anvil_assert(m_khr_external_semaphore_capabilities_entrypoints.vkGetPhysicalDeviceExternalSemaphorePropertiesKHR!= nullptr); } @@ -809,20 +932,22 @@ void Anvil::Instance::init_func_pointers() } } -#if !defined(ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB) - bool Anvil::Instance::init_vk10_func_ptrs() +bool Anvil::Instance::init_vk_func_ptrs() +{ + std::lock_guard lock (g_vk_func_ptr_init_mutex); + bool result(true); + + typedef struct { - std::lock_guard lock (g_vk10_func_ptr_init_mutex); - bool result(true); + std::string func_name; + bool requires_getter_call; + void** result_func_ptr; + } FunctionData; - struct - { - std::string func_name; - bool requires_getter_call; - void** result_func_ptr; - } functions[] = + #if !defined(ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB) + FunctionData functions_vk10[] = { - /* NOTE: All functions with @param requires_getter_cal equal to false should come first! */ + /* NOTE: All functions with @param requires_getter_call equal to false should come first! */ {"vkCreateInstance", false, reinterpret_cast(&Anvil::Vulkan::vkCreateInstance)}, {"vkDestroyInstance", false, reinterpret_cast(&Anvil::Vulkan::vkDestroyInstance)}, {"vkEnumeratePhysicalDevices", false, reinterpret_cast(&Anvil::Vulkan::vkEnumeratePhysicalDevices)}, @@ -963,33 +1088,68 @@ void Anvil::Instance::init_func_pointers() {"vkCmdEndRenderPass", true, reinterpret_cast(&Anvil::Vulkan::vkCmdEndRenderPass)}, {"vkCmdExecuteCommands", true, reinterpret_cast(&Anvil::Vulkan::vkCmdExecuteCommands)} }; + #endif - if (g_core_func_ptrs_inited && - g_instance_func_ptrs_inited) - { - result = true; + FunctionData functions_vk11[] = + { + {"vkBindBufferMemory2", true, reinterpret_cast(&Anvil::Vulkan::vkBindBufferMemory2)}, + {"vkCmdDispatchBase", true, reinterpret_cast(&Anvil::Vulkan::vkCmdDispatchBase)}, + {"vkCmdSetDeviceMask", true, reinterpret_cast(&Anvil::Vulkan::vkCmdSetDeviceMask)}, + {"vkCreateDescriptorUpdateTemplate", true, reinterpret_cast(&Anvil::Vulkan::vkCreateDescriptorUpdateTemplate)}, + {"vkCreateSamplerYcbcrConversion", true, reinterpret_cast(&Anvil::Vulkan::vkCreateSamplerYcbcrConversion)}, + {"vkDestroyDescriptorUpdateTemplate", true, reinterpret_cast(&Anvil::Vulkan::vkDestroyDescriptorUpdateTemplate)}, + {"vkDestroySamplerYcbcrConversion", true, reinterpret_cast(&Anvil::Vulkan::vkDestroySamplerYcbcrConversion)}, + {"vkEnumerateInstanceVersion", false, reinterpret_cast(&Anvil::Vulkan::vkEnumerateInstanceVersion)}, + {"vkEnumeratePhysicalDeviceGroups", true, reinterpret_cast(&Anvil::Vulkan::vkEnumeratePhysicalDeviceGroups)}, + {"vkGetBufferMemoryRequirements2", true, reinterpret_cast(&Anvil::Vulkan::vkGetBufferMemoryRequirements2)}, + {"vkGetDescriptorSetLayoutSupport", true, reinterpret_cast(&Anvil::Vulkan::vkGetDescriptorSetLayoutSupport)}, + {"vkGetDeviceGroupPeerMemoryFeatures", true, reinterpret_cast(&Anvil::Vulkan::vkGetDeviceGroupPeerMemoryFeatures)}, + {"vkGetDeviceQueue2", true, reinterpret_cast(&Anvil::Vulkan::vkGetDeviceQueue2)}, + {"vkGetImageMemoryRequirements2", true, reinterpret_cast(&Anvil::Vulkan::vkGetImageMemoryRequirements2)}, + {"vkGetImageSparseMemoryRequirements2", true, reinterpret_cast(&Anvil::Vulkan::vkGetImageSparseMemoryRequirements2)}, + {"vkGetPhysicalDeviceExternalBufferProperties", true, reinterpret_cast(&Anvil::Vulkan::vkGetPhysicalDeviceExternalBufferProperties)}, + {"vkGetPhysicalDeviceExternalFenceProperties", true, reinterpret_cast(&Anvil::Vulkan::vkGetPhysicalDeviceExternalFenceProperties)}, + {"vkGetPhysicalDeviceExternalSemaphoreProperties", true, reinterpret_cast(&Anvil::Vulkan::vkGetPhysicalDeviceExternalSemaphoreProperties)}, + {"vkGetPhysicalDeviceFeatures2", true, reinterpret_cast(&Anvil::Vulkan::vkGetPhysicalDeviceFeatures2)}, + {"vkGetPhysicalDeviceFormatProperties2", true, reinterpret_cast(&Anvil::Vulkan::vkGetPhysicalDeviceFormatProperties2)}, + {"vkGetPhysicalDeviceImageFormatProperties2", true, reinterpret_cast(&Anvil::Vulkan::vkGetPhysicalDeviceImageFormatProperties2)}, + {"vkGetPhysicalDeviceMemoryProperties2", true, reinterpret_cast(&Anvil::Vulkan::vkGetPhysicalDeviceMemoryProperties2)}, + {"vkGetPhysicalDeviceProperties2", true, reinterpret_cast(&Anvil::Vulkan::vkGetPhysicalDeviceProperties2)}, + {"vkGetPhysicalDeviceQueueFamilyProperties2", true, reinterpret_cast(&Anvil::Vulkan::vkGetPhysicalDeviceQueueFamilyProperties2)}, + {"vkGetPhysicalDeviceSparseImageFormatProperties2", true, reinterpret_cast(&Anvil::Vulkan::vkGetPhysicalDeviceSparseImageFormatProperties2)}, + {"vkTrimCommandPool", true, reinterpret_cast(&Anvil::Vulkan::vkTrimCommandPool)}, + {"vkUpdateDescriptorSetWithTemplate", true, reinterpret_cast(&Anvil::Vulkan::vkUpdateDescriptorSetWithTemplate)}, + }; - goto end; - } + if (g_core_func_ptrs_inited && + g_instance_func_ptrs_inited) + { + result = true; + + goto end; + } - if (g_vk10_library_ptr == nullptr) + #if !defined(ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB) + { + if (g_vk_library_ptr == nullptr) { - g_vk10_library_ptr = Anvil::Library::create(ANVIL_VULKAN_DYNAMIC_DLL); + g_vk_library_ptr = Anvil::Library::create(ANVIL_VULKAN_DYNAMIC_DLL); - if (g_vk10_library_ptr == nullptr) + if (g_vk_library_ptr == nullptr) { - anvil_assert(g_vk10_library_ptr != nullptr); + anvil_assert(g_vk_library_ptr != nullptr); goto end; } } - for (const auto& current_func_data : functions) + /* VK 1.0 func ptrgetters - all entrypoints must be present */ + for (const auto& current_func_data : functions_vk10) { if (!current_func_data.requires_getter_call && !g_core_func_ptrs_inited) { - *current_func_data.result_func_ptr = g_vk10_library_ptr->get_proc_address(current_func_data.func_name.c_str() ); + *current_func_data.result_func_ptr = g_vk_library_ptr->get_proc_address(current_func_data.func_name.c_str() ); if (*current_func_data.result_func_ptr == nullptr) { @@ -1014,17 +1174,37 @@ void Anvil::Instance::init_func_pointers() } } } + } + #endif - g_core_func_ptrs_inited = true; + /* VK 1.1 func ptr getters - all entrypoints may be missing on implementations that do not support the API */ + for (const auto& current_func_data : functions_vk11) + { + if (!current_func_data.requires_getter_call) + { + *current_func_data.result_func_ptr = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + current_func_data.func_name.c_str() )); + } - if (m_instance != VK_NULL_HANDLE) + if ((current_func_data.requires_getter_call) && + (m_instance != VK_NULL_HANDLE) ) { - g_instance_func_ptrs_inited = true; + *current_func_data.result_func_ptr = reinterpret_cast(Anvil::Vulkan::vkGetInstanceProcAddr(m_instance, + current_func_data.func_name.c_str() )); } - end: - return result; } -#endif + + /* Done */ + g_core_func_ptrs_inited = true; + + if (m_instance != VK_NULL_HANDLE) + { + g_instance_func_ptrs_inited = true; + } + +end: + return result; +} /** Please see header for specification */ bool Anvil::Instance::is_instance_extension_enabled(const char* in_extension_name) const diff --git a/src/wrappers/memory_block.cpp b/src/wrappers/memory_block.cpp index ee2f5c70..0fd0a732 100644 --- a/src/wrappers/memory_block.cpp +++ b/src/wrappers/memory_block.cpp @@ -136,7 +136,8 @@ void Anvil::MemoryBlock::close_gpu_memory_access() } /* Please see header for specification */ -Anvil::MemoryBlockUniquePtr Anvil::MemoryBlock::create(Anvil::MemoryBlockCreateInfoUniquePtr in_create_info_ptr) +Anvil::MemoryBlockUniquePtr Anvil::MemoryBlock::create(Anvil::MemoryBlockCreateInfoUniquePtr in_create_info_ptr, + VkResult* out_opt_result_ptr) { MemoryBlockUniquePtr result_ptr(nullptr, std::default_delete() ); @@ -150,9 +151,10 @@ Anvil::MemoryBlockUniquePtr Anvil::MemoryBlock::create(Anvil::MemoryBlockCreateI if (result_ptr != nullptr) { - if (type == Anvil::MemoryBlockType::REGULAR) + if (type == Anvil::MemoryBlockType::REGULAR || + type == Anvil::MemoryBlockType::REGULAR_WITH_MEMORY_TYPE ) { - if (!result_ptr->init() ) + if (!result_ptr->init(out_opt_result_ptr) ) { result_ptr.reset(); } @@ -165,6 +167,11 @@ Anvil::MemoryBlockUniquePtr Anvil::MemoryBlock::create(Anvil::MemoryBlockCreateI { result_ptr->m_memory = result_ptr->m_create_info_ptr->get_memory(); } + + if (out_opt_result_ptr != nullptr) + { + *out_opt_result_ptr = VkResult::VK_SUCCESS; + } } } @@ -209,7 +216,8 @@ Anvil::ExternalHandleUniquePtr Anvil::MemoryBlock::export_to_external_memory_han } #endif - if (m_create_info_ptr->get_type() != Anvil::MemoryBlockType::REGULAR) + if (m_create_info_ptr->get_type() != Anvil::MemoryBlockType::REGULAR && + m_create_info_ptr->get_type() != Anvil::MemoryBlockType::REGULAR_WITH_MEMORY_TYPE ) { parent_memory_block_ptr = m_create_info_ptr->get_parent_memory_block(); @@ -348,7 +356,7 @@ uint32_t Anvil::MemoryBlock::get_device_memory_type_index(uint32_t } /* Allocates actual memory and caches a number of properties used to spawn the memory block */ -bool Anvil::MemoryBlock::init() +bool Anvil::MemoryBlock::init(VkResult* out_opt_result) { VkResult result; bool result_bool = false; @@ -395,6 +403,23 @@ bool Anvil::MemoryBlock::init() } } + { + const float& memory_priority = m_create_info_ptr->get_memory_priority(); + + if (memory_priority != FLT_MAX) + { + anvil_assert(memory_priority >= 0.0f && memory_priority <= 1.0f); + + VkMemoryPriorityAllocateInfoEXT alloc_info; + + alloc_info.sType = VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT; + alloc_info.pNext = nullptr; + alloc_info.priority = memory_priority; + + struct_chainer.append_struct(alloc_info); + } + } + if (m_create_info_ptr->get_exportable_external_memory_handle_types() != Anvil::ExternalMemoryHandleTypeFlagBits::NONE) { VkExportMemoryAllocateInfoKHR export_memory_alloc_info; @@ -495,8 +520,8 @@ bool Anvil::MemoryBlock::init() alloc_info_khr.deviceMask = m_create_info_ptr->get_device_mask(); /* NOTE: Host-mappable memory must not be multi-instance heap and must exist on only one device. */ - if (((m_create_info_ptr->get_memory_features() & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) != 0) && - (Utils::count_set_bits(alloc_info_khr.deviceMask) > 1) ) + if (((m_create_info_ptr->get_memory_features() & Anvil::MemoryFeatureFlagBits::MAPPABLE_BIT) != 0) && + (Utils::count_set_bits (alloc_info_khr.deviceMask) > 1) ) { alloc_info_khr.flags = 0; } @@ -520,7 +545,11 @@ bool Anvil::MemoryBlock::init() &m_memory); } - anvil_assert_vk_call_succeeded(result); + if (out_opt_result != nullptr) + { + *out_opt_result = result; + } + if (!is_vk_call_successful(result) ) { goto end; diff --git a/src/wrappers/physical_device.cpp b/src/wrappers/physical_device.cpp index 7de0429e..664a06e0 100644 --- a/src/wrappers/physical_device.cpp +++ b/src/wrappers/physical_device.cpp @@ -21,6 +21,7 @@ // #include "misc/debug.h" +#include "misc/formats.h" #include "misc/object_tracker.h" #include "misc/struct_chainer.h" #include "wrappers/device.h" @@ -70,15 +71,24 @@ Anvil::PhysicalDevice::~PhysicalDevice() **/ bool Anvil::PhysicalDevice::init() { - VkPhysicalDeviceMemoryProperties memory_properties; - uint32_t n_extensions = 0; - uint32_t n_physical_device_layers = 0; - uint32_t n_physical_device_queues = 0; - bool result = true; - VkResult result_vk = VK_ERROR_INITIALIZATION_FAILED; + uint32_t n_extensions = 0; + uint32_t n_physical_device_layers = 0; + uint32_t n_physical_device_queues = 0; + bool result = true; + VkResult result_vk = VK_ERROR_INITIALIZATION_FAILED; + bool supports_vk1_1 = false; anvil_assert(m_physical_device != VK_NULL_HANDLE); + { + VkPhysicalDeviceProperties props_vk; + + Anvil::Vulkan::vkGetPhysicalDeviceProperties(m_physical_device, + &props_vk); + + supports_vk1_1 = supports_core_vk1_1(props_vk.apiVersion); + } + /* Retrieve device extensions */ result_vk = Anvil::Vulkan::vkEnumerateDeviceExtensionProperties(m_physical_device, nullptr, /* pLayerName */ @@ -126,15 +136,24 @@ bool Anvil::PhysicalDevice::init() if (m_instance_ptr->get_enabled_extensions_info()->khr_get_physical_device_properties2() ) { - Anvil::StructID descriptor_indexing_features_struct_id = UINT32_MAX; - const auto& gpdp2_entrypoints = m_instance_ptr->get_extension_khr_get_physical_device_properties2_entrypoints(); - Anvil::StructID multiview_features_struct_id = UINT32_MAX; - Anvil::StructID storage_features16_struct_id = UINT32_MAX; - Anvil::StructID storage_features8_struct_id = UINT32_MAX; + Anvil::StructID depth_clip_enable_features_struct_id = UINT32_MAX; + Anvil::StructID descriptor_indexing_features_struct_id = UINT32_MAX; + Anvil::StructID inline_uniform_block_features_struct_id = UINT32_MAX; + Anvil::StructID memory_priority_features_struct_id = UINT32_MAX; + const auto& gpdp2_entrypoints = m_instance_ptr->get_extension_khr_get_physical_device_properties2_entrypoints(); + Anvil::StructID multiview_features_struct_id = UINT32_MAX; + Anvil::StructID protected_memory_features_struct_id = UINT32_MAX; + Anvil::StructID sampler_ycbcr_conversion_features_struct_id = UINT32_MAX; + Anvil::StructID scalar_block_layout_features_struct_id = UINT32_MAX; + Anvil::StructID shader_atomic_int64_features_struct_id = UINT32_MAX; + Anvil::StructID shader_float16_int8_struct_id = UINT32_MAX; + Anvil::StructID storage_features16_struct_id = UINT32_MAX; + Anvil::StructID storage_features8_struct_id = UINT32_MAX; Anvil::StructChainUniquePtr struct_chain_ptr; Anvil::StructChainer struct_chainer; - Anvil::StructID transform_feedback_features_struct_id = UINT32_MAX; - Anvil::StructID variable_pointer_features_struct_id = UINT32_MAX; + Anvil::StructID transform_feedback_features_struct_id = UINT32_MAX; + Anvil::StructID variable_pointer_features_struct_id = UINT32_MAX; + Anvil::StructID vulkan_memory_model_features_struct_id = UINT32_MAX; /* Chain query structs .. */ { @@ -146,6 +165,16 @@ bool Anvil::PhysicalDevice::init() struct_chainer.append_struct(features); } + if (m_extension_info_ptr->get_device_extension_info()->ext_depth_clip_enable() ) + { + VkPhysicalDeviceDepthClipEnableFeaturesEXT depth_clip_enable_features; + + depth_clip_enable_features.pNext = nullptr; + depth_clip_enable_features.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT); + + depth_clip_enable_features_struct_id = struct_chainer.append_struct(depth_clip_enable_features); + } + if (m_extension_info_ptr->get_device_extension_info()->ext_descriptor_indexing() ) { VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptor_indexing_features; @@ -156,6 +185,36 @@ bool Anvil::PhysicalDevice::init() descriptor_indexing_features_struct_id = struct_chainer.append_struct(descriptor_indexing_features); } + if (m_extension_info_ptr->get_device_extension_info()->ext_inline_uniform_block() ) + { + VkPhysicalDeviceInlineUniformBlockFeaturesEXT inline_uniform_block_features; + + inline_uniform_block_features.pNext = nullptr; + inline_uniform_block_features.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT); + + inline_uniform_block_features_struct_id = struct_chainer.append_struct(inline_uniform_block_features); + } + + if (m_extension_info_ptr->get_device_extension_info()->ext_memory_priority()) + { + VkPhysicalDeviceMemoryPriorityFeaturesEXT memory_priority_features; + + memory_priority_features.pNext = nullptr; + memory_priority_features.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT); + + memory_priority_features_struct_id = struct_chainer.append_struct(memory_priority_features); + } + + if (m_extension_info_ptr->get_device_extension_info()->ext_scalar_block_layout() ) + { + VkPhysicalDeviceScalarBlockLayoutFeaturesEXT scalar_block_layout_features; + + scalar_block_layout_features.pNext = nullptr; + scalar_block_layout_features.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT); + + scalar_block_layout_features_struct_id = struct_chainer.append_struct(scalar_block_layout_features); + } + if (m_extension_info_ptr->get_device_extension_info()->ext_transform_feedback() ) { VkPhysicalDeviceTransformFeedbackFeaturesEXT transform_feedback_features; @@ -166,7 +225,8 @@ bool Anvil::PhysicalDevice::init() transform_feedback_features_struct_id = struct_chainer.append_struct(transform_feedback_features); } - if (m_extension_info_ptr->get_device_extension_info()->khr_16bit_storage() ) + if (m_extension_info_ptr->get_device_extension_info()->khr_16bit_storage() || + supports_vk1_1) { VkPhysicalDevice16BitStorageFeaturesKHR storage_features; @@ -186,7 +246,8 @@ bool Anvil::PhysicalDevice::init() storage_features8_struct_id = struct_chainer.append_struct(storage_features); } - if (m_extension_info_ptr->get_device_extension_info()->khr_multiview() ) + if (m_extension_info_ptr->get_device_extension_info()->khr_multiview() || + supports_vk1_1) { VkPhysicalDeviceMultiviewFeaturesKHR multiview_features; @@ -196,7 +257,39 @@ bool Anvil::PhysicalDevice::init() multiview_features_struct_id = struct_chainer.append_struct(multiview_features); } - if (m_extension_info_ptr->get_device_extension_info()->khr_variable_pointers() ) + if (m_extension_info_ptr->get_device_extension_info()->khr_sampler_ycbcr_conversion() || + supports_vk1_1) + { + VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR sampler_ycbcr_conversion_features; + + sampler_ycbcr_conversion_features.pNext = nullptr; + sampler_ycbcr_conversion_features.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR); + + sampler_ycbcr_conversion_features_struct_id = struct_chainer.append_struct(sampler_ycbcr_conversion_features); + } + + if (m_extension_info_ptr->get_device_extension_info()->khr_shader_atomic_int64()) + { + VkPhysicalDeviceShaderAtomicInt64FeaturesKHR shader_atomic_int64_features; + + shader_atomic_int64_features.pNext = nullptr; + shader_atomic_int64_features.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR); + + shader_atomic_int64_features_struct_id = struct_chainer.append_struct(shader_atomic_int64_features); + } + + if (m_extension_info_ptr->get_device_extension_info()->khr_shader_float16_int8() ) + { + VkPhysicalDeviceFloat16Int8FeaturesKHR shader_float16_int8_features; + + shader_float16_int8_features.pNext = nullptr; + shader_float16_int8_features.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR); + + shader_float16_int8_struct_id = struct_chainer.append_struct(shader_float16_int8_features); + } + + if (m_extension_info_ptr->get_device_extension_info()->khr_variable_pointers() || + supports_vk1_1) { VkPhysicalDeviceVariablePointerFeaturesKHR vp_features; @@ -206,6 +299,26 @@ bool Anvil::PhysicalDevice::init() variable_pointer_features_struct_id = struct_chainer.append_struct(vp_features); } + if (m_extension_info_ptr->get_device_extension_info()->khr_vulkan_memory_model() ) + { + VkPhysicalDeviceVulkanMemoryModelFeaturesKHR vmm_features; + + vmm_features.pNext = nullptr; + vmm_features.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR); + + vulkan_memory_model_features_struct_id = struct_chainer.append_struct(vmm_features); + } + + if (supports_vk1_1) + { + VkPhysicalDeviceProtectedMemoryFeatures protected_mem_features; + + protected_mem_features.pNext = nullptr; + protected_mem_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES; + + protected_memory_features_struct_id = struct_chainer.append_struct(protected_mem_features); + } + /* Retrieve the features.. */ struct_chain_ptr = struct_chainer.create_chain(); @@ -214,6 +327,21 @@ bool Anvil::PhysicalDevice::init() /* Cache the results */ + if (depth_clip_enable_features_struct_id != UINT32_MAX) + { + m_ext_depth_clip_enable_features_ptr.reset( + new EXTDepthClipEnableFeatures(*struct_chain_ptr->get_struct_with_id(depth_clip_enable_features_struct_id) ) + ); + + if (m_ext_depth_clip_enable_features_ptr == nullptr) + { + anvil_assert(m_ext_depth_clip_enable_features_ptr != nullptr); + + result = false; + goto end; + } + } + if (descriptor_indexing_features_struct_id != UINT32_MAX) { m_ext_descriptor_indexing_features_ptr.reset( @@ -229,6 +357,21 @@ bool Anvil::PhysicalDevice::init() } } + if (inline_uniform_block_features_struct_id != UINT32_MAX) + { + m_ext_inline_uniform_block_features_ptr.reset( + new EXTInlineUniformBlockFeatures(*struct_chain_ptr->get_struct_with_id(inline_uniform_block_features_struct_id) ) + ); + + if (m_ext_inline_uniform_block_features_ptr == nullptr) + { + anvil_assert(m_ext_inline_uniform_block_features_ptr != nullptr); + + result = false; + goto end; + } + } + if (multiview_features_struct_id != UINT32_MAX) { m_khr_multiview_features_ptr.reset( @@ -244,6 +387,51 @@ bool Anvil::PhysicalDevice::init() } } + if (sampler_ycbcr_conversion_features_struct_id != UINT32_MAX) + { + m_khr_sampler_ycbcr_conversion_features_ptr.reset( + new KHRSamplerYCbCrConversionFeatures(*struct_chain_ptr->get_struct_with_id(sampler_ycbcr_conversion_features_struct_id) ) + ); + + if (m_khr_sampler_ycbcr_conversion_features_ptr == nullptr) + { + anvil_assert(m_khr_sampler_ycbcr_conversion_features_ptr != nullptr); + + result = false; + goto end; + } + } + + if (scalar_block_layout_features_struct_id != UINT32_MAX) + { + m_ext_scalar_block_layout_features_ptr.reset( + new EXTScalarBlockLayoutFeatures(*struct_chain_ptr->get_struct_with_id(scalar_block_layout_features_struct_id) ) + ); + + if (m_ext_scalar_block_layout_features_ptr == nullptr) + { + anvil_assert(m_ext_scalar_block_layout_features_ptr != nullptr); + + result = false; + goto end; + } + } + + if (shader_atomic_int64_features_struct_id != UINT32_MAX) + { + m_khr_shader_atomic_int64_features_ptr.reset( + new KHRShaderAtomicInt64Features(*struct_chain_ptr->get_struct_with_id(shader_atomic_int64_features_struct_id) ) + ); + + if (m_khr_shader_atomic_int64_features_ptr == nullptr) + { + anvil_assert(m_khr_shader_atomic_int64_features_ptr != nullptr); + + result = false; + goto end; + } + } + if (transform_feedback_features_struct_id != UINT32_MAX) { m_ext_transform_feedback_features_ptr.reset( @@ -289,6 +477,36 @@ bool Anvil::PhysicalDevice::init() } } + if (memory_priority_features_struct_id != UINT32_MAX) + { + m_ext_memory_priority_features_ptr.reset( + new EXTMemoryPriorityFeatures(*struct_chain_ptr->get_struct_with_id(memory_priority_features_struct_id)) + ); + + if (m_ext_memory_priority_features_ptr == nullptr) + { + anvil_assert(m_ext_memory_priority_features_ptr != nullptr); + + result = false; + goto end; + } + } + + if (shader_float16_int8_struct_id != UINT32_MAX) + { + m_khr_float16_int8_features_ptr.reset( + new KHRFloat16Int8Features(*struct_chain_ptr->get_struct_with_id(shader_float16_int8_struct_id) ) + ); + + if (m_khr_float16_int8_features_ptr == nullptr) + { + anvil_assert(m_khr_float16_int8_features_ptr != nullptr); + + result = false; + goto end; + } + } + if (variable_pointer_features_struct_id != UINT32_MAX) { m_khr_variable_pointer_features_ptr.reset( @@ -303,6 +521,38 @@ bool Anvil::PhysicalDevice::init() goto end; } } + + if (vulkan_memory_model_features_struct_id != UINT32_MAX) + { + m_khr_vulkan_memory_model_features_ptr.reset( + new KHRVulkanMemoryModelFeatures(*struct_chain_ptr->get_struct_with_id(vulkan_memory_model_features_struct_id) ) + ); + + if (m_khr_vulkan_memory_model_features_ptr == nullptr) + { + anvil_assert(m_khr_vulkan_memory_model_features_ptr != nullptr); + + result = false; + goto end; + } + } + + if (supports_vk1_1) + { + const auto protected_memory_features = *struct_chain_ptr->get_struct_with_id(protected_memory_features_struct_id); + + m_core_features_vk11_ptr.reset( + new Anvil::PhysicalDeviceFeaturesCoreVK11(protected_memory_features) + ); + + if (m_core_features_vk11_ptr == nullptr) + { + anvil_assert(m_core_features_vk11_ptr != nullptr); + + result = false; + goto end; + } + } } m_core_features_vk10_ptr.reset( @@ -317,13 +567,22 @@ bool Anvil::PhysicalDevice::init() goto end; } - m_features = Anvil::PhysicalDeviceFeatures(m_core_features_vk10_ptr.get (), - m_ext_descriptor_indexing_features_ptr.get(), - m_ext_transform_feedback_features_ptr.get (), - m_khr_16_bit_storage_features_ptr.get (), - m_khr_8_bit_storage_features_ptr.get (), - m_khr_multiview_features_ptr.get (), - m_khr_variable_pointer_features_ptr.get () ); + m_features = Anvil::PhysicalDeviceFeatures(m_core_features_vk10_ptr.get (), + m_core_features_vk11_ptr.get (), + m_ext_depth_clip_enable_features_ptr.get (), + m_ext_descriptor_indexing_features_ptr.get (), + m_ext_inline_uniform_block_features_ptr.get (), + m_ext_scalar_block_layout_features_ptr.get (), + m_ext_transform_feedback_features_ptr.get (), + m_ext_memory_priority_features_ptr.get (), + m_khr_16_bit_storage_features_ptr.get (), + m_khr_8_bit_storage_features_ptr.get (), + m_khr_float16_int8_features_ptr.get (), + m_khr_multiview_features_ptr.get (), + m_khr_sampler_ycbcr_conversion_features_ptr.get(), + m_khr_shader_atomic_int64_features_ptr.get (), + m_khr_variable_pointer_features_ptr.get (), + m_khr_vulkan_memory_model_features_ptr.get () ); } /* Retrieve device layers */ @@ -365,22 +624,49 @@ bool Anvil::PhysicalDevice::init() } } + /* Retrieve device properties */ + { + VkPhysicalDeviceProperties props; + + Anvil::Vulkan::vkGetPhysicalDeviceProperties(m_physical_device, + &props); + + m_core_properties_vk10_ptr.reset( + new Anvil::PhysicalDevicePropertiesCoreVK10(props) + ); + + if (m_core_properties_vk10_ptr == nullptr) + { + anvil_assert(m_core_properties_vk10_ptr != nullptr); + + result = false; + goto end; + } + } + /* Retrieve additional device info */ if (m_instance_ptr->get_enabled_extensions_info()->khr_get_physical_device_properties2() ) { + Anvil::StructID conservative_rasterization_struct_id = UINT32_MAX; + Anvil::StructID depth_stencil_resolve_props_struct_id = UINT32_MAX; Anvil::StructID descriptor_indexing_props_struct_id = UINT32_MAX; Anvil::StructID device_id_props_struct_id = UINT32_MAX; + Anvil::StructID driver_properties_props_struct_id = UINT32_MAX; Anvil::StructID external_memory_host_props_struct_id = UINT32_MAX; const auto& gpdp2_entrypoints = m_instance_ptr->get_extension_khr_get_physical_device_properties2_entrypoints(); + Anvil::StructID inline_uniform_block_props_struct_id = UINT32_MAX; Anvil::StructID maintenance3_struct_id = UINT32_MAX; Anvil::StructID multiview_struct_id = UINT32_MAX; Anvil::StructID pci_bus_info_props_struct_id = UINT32_MAX; Anvil::StructID point_clipping_props_struct_id = UINT32_MAX; + Anvil::StructID protected_memory_props_struct_id = UINT32_MAX; Anvil::StructID sample_locations_props_struct_id = UINT32_MAX; Anvil::StructID sampler_filter_minmax_props_struct_id = UINT32_MAX; Anvil::StructID shader_core_struct_id = UINT32_MAX; + Anvil::StructID shader_float_controls_props_struct_id = UINT32_MAX; Anvil::StructChainUniquePtr struct_chain_ptr; Anvil::StructChainer struct_chainer; + Anvil::StructID subgroup_props_struct_id = UINT32_MAX; Anvil::StructID transform_feedback_props_struct_id = UINT32_MAX; Anvil::StructID vertex_attribute_divisor_props_struct_id = UINT32_MAX; @@ -394,6 +680,21 @@ bool Anvil::PhysicalDevice::init() struct_chainer.append_struct(general_props); } + if (m_core_properties_vk10_ptr->api_version >= VK_MAKE_VERSION(1, 1, 0)) + { + VkPhysicalDeviceProtectedMemoryProperties protected_memory_properties; + VkPhysicalDeviceSubgroupProperties subgroup_properties; + + protected_memory_properties.pNext = nullptr; + protected_memory_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES; + + subgroup_properties.pNext = nullptr; + subgroup_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES; + + protected_memory_props_struct_id = struct_chainer.append_struct(protected_memory_properties); + subgroup_props_struct_id = struct_chainer.append_struct(subgroup_properties); + } + if (m_extension_info_ptr->get_device_extension_info()->amd_shader_core_properties() ) { VkPhysicalDeviceShaderCorePropertiesAMD shader_core_properties; @@ -404,6 +705,16 @@ bool Anvil::PhysicalDevice::init() shader_core_struct_id = struct_chainer.append_struct(shader_core_properties); } + if (m_extension_info_ptr->get_device_extension_info()->ext_conservative_rasterization() ) + { + VkPhysicalDeviceConservativeRasterizationPropertiesEXT conservative_rasterization_properties; + + conservative_rasterization_properties.pNext = nullptr; + conservative_rasterization_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT; + + conservative_rasterization_struct_id = struct_chainer.append_struct(conservative_rasterization_properties); + } + if (m_extension_info_ptr->get_device_extension_info()->ext_descriptor_indexing() ) { VkPhysicalDeviceDescriptorIndexingPropertiesEXT descriptor_indexing_properties; @@ -424,6 +735,16 @@ bool Anvil::PhysicalDevice::init() external_memory_host_props_struct_id = struct_chainer.append_struct(external_memory_host_props); } + if (m_extension_info_ptr->get_device_extension_info()->ext_inline_uniform_block() ) + { + VkPhysicalDeviceInlineUniformBlockPropertiesEXT inline_uniform_block_props; + + inline_uniform_block_props.pNext = nullptr; + inline_uniform_block_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT; + + inline_uniform_block_props_struct_id = struct_chainer.append_struct(inline_uniform_block_props); + } + if (m_extension_info_ptr->get_device_extension_info()->ext_pci_bus_info() ) { VkPhysicalDevicePCIBusInfoPropertiesEXT pci_bus_info_props; @@ -474,6 +795,26 @@ bool Anvil::PhysicalDevice::init() vertex_attribute_divisor_props_struct_id = struct_chainer.append_struct(vertex_attribute_divisor_properties); } + if (m_extension_info_ptr->get_device_extension_info()->khr_depth_stencil_resolve() ) + { + VkPhysicalDeviceDepthStencilResolvePropertiesKHR depth_stencil_resolve_properties; + + depth_stencil_resolve_properties.pNext = nullptr; + depth_stencil_resolve_properties.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES_KHR); + + depth_stencil_resolve_props_struct_id = struct_chainer.append_struct(depth_stencil_resolve_properties); + } + + if (m_extension_info_ptr->get_device_extension_info()->khr_driver_properties() ) + { + VkPhysicalDeviceDriverPropertiesKHR driver_properties_properties; + + driver_properties_properties.pNext = nullptr; + driver_properties_properties.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR); + + driver_properties_props_struct_id = struct_chainer.append_struct(driver_properties_properties); + } + if (m_instance_ptr->get_enabled_extensions_info()->khr_external_memory_capabilities() ) { VkPhysicalDeviceIDPropertiesKHR device_id_props; @@ -484,7 +825,8 @@ bool Anvil::PhysicalDevice::init() device_id_props_struct_id = struct_chainer.append_struct(device_id_props); } - if (m_extension_info_ptr->get_device_extension_info()->khr_maintenance2() ) + if (m_extension_info_ptr->get_device_extension_info()->khr_maintenance2() || + supports_vk1_1) { VkPhysicalDevicePointClippingPropertiesKHR point_clipping_props; @@ -494,7 +836,8 @@ bool Anvil::PhysicalDevice::init() point_clipping_props_struct_id = struct_chainer.append_struct(point_clipping_props); } - if (m_extension_info_ptr->get_device_extension_info()->khr_maintenance3() ) + if (m_extension_info_ptr->get_device_extension_info()->khr_maintenance3() || + supports_vk1_1) { VkPhysicalDeviceMaintenance3PropertiesKHR maintenance3_props; @@ -504,7 +847,8 @@ bool Anvil::PhysicalDevice::init() maintenance3_struct_id = struct_chainer.append_struct(maintenance3_props); } - if (m_extension_info_ptr->get_device_extension_info()->khr_multiview() ) + if (m_extension_info_ptr->get_device_extension_info()->khr_multiview() || + supports_vk1_1) { VkPhysicalDeviceMultiviewPropertiesKHR multiview_props; @@ -514,13 +858,69 @@ bool Anvil::PhysicalDevice::init() multiview_struct_id = struct_chainer.append_struct(multiview_props); } + if (m_extension_info_ptr->get_device_extension_info()->khr_shader_float_controls() ) + { + VkPhysicalDeviceFloatControlsPropertiesKHR float_controls_props; + + float_controls_props.pNext = nullptr; + float_controls_props.sType = static_cast(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR); + + shader_float_controls_props_struct_id = struct_chainer.append_struct(float_controls_props); + } + /* Retrieve the results */ struct_chain_ptr = struct_chainer.create_chain(); gpdp2_entrypoints.vkGetPhysicalDeviceProperties2KHR(m_physical_device, struct_chain_ptr->get_root_struct() ); + if (m_core_properties_vk10_ptr->api_version >= VK_MAKE_VERSION(1, 1, 0)) + { + m_core_properties_vk11_ptr.reset( + new PhysicalDevicePropertiesCoreVK11(*struct_chain_ptr->get_struct_with_id(protected_memory_props_struct_id), + *struct_chain_ptr->get_struct_with_id (subgroup_props_struct_id) ) + ); + + if (m_core_properties_vk11_ptr == nullptr) + { + anvil_assert(m_core_properties_vk11_ptr != nullptr); + + result = false; + goto end; + } + } + /* Cache the retrieved properties */ + if (conservative_rasterization_struct_id != UINT32_MAX) + { + m_ext_conservative_rasterization_properties_ptr.reset( + new EXTConservativeRasterizationProperties(*struct_chain_ptr->get_struct_with_id(conservative_rasterization_struct_id) ) + ); + + if (m_ext_conservative_rasterization_properties_ptr == nullptr) + { + anvil_assert(m_ext_conservative_rasterization_properties_ptr != nullptr); + + result = false; + goto end; + } + } + + if (depth_stencil_resolve_props_struct_id != UINT32_MAX) + { + m_khr_depth_stencil_resolve_properties_ptr.reset( + new KHRDepthStencilResolveProperties(*struct_chain_ptr->get_struct_with_id(depth_stencil_resolve_props_struct_id) ) + ); + + if (m_khr_depth_stencil_resolve_properties_ptr == nullptr) + { + anvil_assert(m_khr_depth_stencil_resolve_properties_ptr != nullptr); + + result = false; + goto end; + } + } + if (descriptor_indexing_props_struct_id != UINT32_MAX) { m_ext_descriptor_indexing_properties_ptr.reset( @@ -536,6 +936,21 @@ bool Anvil::PhysicalDevice::init() } } + if (driver_properties_props_struct_id != UINT32_MAX) + { + m_khr_driver_properties_properties_ptr.reset( + new KHRDriverPropertiesProperties(*struct_chain_ptr->get_struct_with_id(driver_properties_props_struct_id) ) + ); + + if (m_khr_driver_properties_properties_ptr == nullptr) + { + anvil_assert(m_khr_driver_properties_properties_ptr != nullptr); + + result = false; + goto end; + } + } + if (device_id_props_struct_id != UINT32_MAX) { m_khr_external_memory_capabilities_physical_device_id_properties_ptr.reset( @@ -566,6 +981,21 @@ bool Anvil::PhysicalDevice::init() } } + if (inline_uniform_block_props_struct_id != UINT32_MAX) + { + m_ext_inline_uniform_block_properties_ptr.reset( + new EXTInlineUniformBlockProperties(*struct_chain_ptr->get_struct_with_id(inline_uniform_block_props_struct_id) ) + ); + + if (m_ext_inline_uniform_block_properties_ptr == nullptr) + { + anvil_assert(m_ext_inline_uniform_block_properties_ptr != nullptr); + + result = false; + goto end; + } + } + if (maintenance3_struct_id != UINT32_MAX) { m_khr_maintenance3_properties_ptr.reset( @@ -671,6 +1101,21 @@ bool Anvil::PhysicalDevice::init() } } + if (shader_float_controls_props_struct_id != UINT32_MAX) + { + m_khr_shader_float_controls_properties_ptr.reset( + new KHRShaderFloatControlsProperties(*struct_chain_ptr->get_struct_with_id(shader_float_controls_props_struct_id) ) + ); + + if (m_khr_shader_float_controls_properties_ptr == nullptr) + { + anvil_assert(m_khr_shader_float_controls_properties_ptr != nullptr); + + result = false; + goto end; + } + } + if (transform_feedback_props_struct_id != UINT32_MAX) { m_ext_transform_feedback_properties_ptr.reset( @@ -702,39 +1147,25 @@ bool Anvil::PhysicalDevice::init() } } - /* Retrieve device properties */ - { - VkPhysicalDeviceProperties props; - - Anvil::Vulkan::vkGetPhysicalDeviceProperties(m_physical_device, - &props); - - m_core_properties_vk10_ptr.reset( - new Anvil::PhysicalDevicePropertiesCoreVK10(props) - ); - - if (m_core_properties_vk10_ptr == nullptr) - { - anvil_assert(m_core_properties_vk10_ptr != nullptr); - - result = false; - goto end; - } - } - m_properties = Anvil::PhysicalDeviceProperties(m_amd_shader_core_properties_ptr.get (), m_core_properties_vk10_ptr.get (), + m_core_properties_vk11_ptr.get (), + m_ext_conservative_rasterization_properties_ptr.get (), m_ext_descriptor_indexing_properties_ptr.get (), m_ext_external_memory_host_properties_ptr.get (), + m_ext_inline_uniform_block_properties_ptr.get (), m_ext_pci_bus_info_ptr.get (), m_ext_sample_locations_properties_ptr.get (), m_ext_sampler_filter_minmax_properties_ptr.get (), m_ext_transform_feedback_properties_ptr.get (), m_ext_vertex_attribute_divisor_properties_ptr.get (), + m_khr_depth_stencil_resolve_properties_ptr.get (), + m_khr_driver_properties_properties_ptr.get (), m_khr_external_memory_capabilities_physical_device_id_properties_ptr.get(), m_khr_maintenance3_properties_ptr.get (), m_khr_maintenance2_physical_device_point_clipping_properties_ptr.get (), - m_khr_multiview_properties_ptr.get () ); + m_khr_multiview_properties_ptr.get (), + m_khr_shader_float_controls_properties_ptr.get () ); /* Retrieve device queue data */ Anvil::Vulkan::vkGetPhysicalDeviceQueueFamilyProperties(m_physical_device, @@ -743,7 +1174,7 @@ bool Anvil::PhysicalDevice::init() if (n_physical_device_queues > 0) { - std::vector queue_props; + std::vector queue_props; queue_props.resize(n_physical_device_queues); @@ -760,15 +1191,51 @@ bool Anvil::PhysicalDevice::init() } /* Retrieve memory properties */ - Anvil::Vulkan::vkGetPhysicalDeviceMemoryProperties(m_physical_device, - &memory_properties); + { + VkPhysicalDeviceMemoryProperties memory_properties; + + Anvil::Vulkan::vkGetPhysicalDeviceMemoryProperties(m_physical_device, + &memory_properties); - m_memory_properties.init(memory_properties); + m_memory_properties.init(memory_properties); + } end: return result; } +Anvil::MemoryBudget Anvil::PhysicalDevice::get_available_memory_budget() const +{ + if (!m_instance_ptr->get_enabled_extensions_info()->khr_get_physical_device_properties2() || + !m_extension_info_ptr->get_device_extension_info()->ext_memory_budget ()) + { + anvil_assert_fail(); + } + + const auto& gpdp2_entrypoints = m_instance_ptr->get_extension_khr_get_physical_device_properties2_entrypoints(); + Anvil::StructID memory_budget_properties_struct_id; + VkPhysicalDeviceMemoryBudgetPropertiesEXT memory_budget_properties; + VkPhysicalDeviceMemoryProperties2KHR memory_properties2; + Anvil::StructChainer struct_chainer; + Anvil::StructChainUniquePtr struct_chain_ptr; + + memory_properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2; + memory_properties2.pNext = nullptr; + + memory_budget_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT; + memory_budget_properties.pNext = nullptr; + + struct_chainer.append_struct(memory_properties2); + memory_budget_properties_struct_id = struct_chainer.append_struct(memory_budget_properties); + + struct_chain_ptr = struct_chainer.create_chain(); + + gpdp2_entrypoints.vkGetPhysicalDeviceMemoryProperties2KHR(m_physical_device, + struct_chain_ptr->get_root_struct()); + + return MemoryBudget(*struct_chain_ptr->get_struct_with_id(memory_budget_properties_struct_id)); +} + bool Anvil::PhysicalDevice::get_buffer_properties(const Anvil::BufferPropertiesQuery& in_query, Anvil::BufferProperties* out_opt_result_ptr) const { @@ -873,9 +1340,11 @@ bool Anvil::PhysicalDevice::get_image_format_properties(const ImageFormatPropert VkFormatProperties core_vk10_format_props; VkImageFormatProperties core_vk10_image_format_properties; Anvil::ExternalMemoryProperties external_handle_props; - const Anvil::ExtensionKHRGetPhysicalDeviceProperties2* gpdp2_entrypoints_ptr = nullptr; - bool result = false; - bool supports_amd_texture_gather_bias_lod = false; + const Anvil::ExtensionKHRGetPhysicalDeviceProperties2* gpdp2_entrypoints_ptr = nullptr; + uint32_t n_combined_image_sampler_descriptors_used = 0; + bool result = false; + bool supports_amd_texture_gather_bias_lod = false; + Anvil::ImageUsageFlags valid_stencil_image_usage_aspect_flags; if (m_instance_ptr->get_enabled_extensions_info()->khr_get_physical_device_properties2() ) { @@ -900,11 +1369,13 @@ bool Anvil::PhysicalDevice::get_image_format_properties(const ImageFormatPropert if (gpdp2_entrypoints_ptr != nullptr) { - Anvil::StructID external_image_format_props_struct_id = UINT32_MAX; + Anvil::StructID external_image_format_props_struct_id = UINT32_MAX; + Anvil::StructID image_stencil_usage_create_info_struct_id = UINT32_MAX; Anvil::StructChainer input_struct_chainer; - auto instance_extensions_ptr = m_instance_ptr->get_enabled_extensions_info(); + auto instance_extensions_ptr = m_instance_ptr->get_enabled_extensions_info(); Anvil::StructChainer output_struct_chainer; - Anvil::StructID texture_lod_gather_support_struct_id = UINT32_MAX; + Anvil::StructID sampler_ycbcr_conversion_image_format_props_struct_id = UINT32_MAX; + Anvil::StructID texture_lod_gather_support_struct_id = UINT32_MAX; ANVIL_REDUNDANT_VARIABLE(instance_extensions_ptr); @@ -941,6 +1412,17 @@ bool Anvil::PhysicalDevice::get_image_format_properties(const ImageFormatPropert texture_lod_gather_support_struct_id = output_struct_chainer.append_struct(texture_lod_gather_support); } + if (m_extension_info_ptr->get_device_extension_info()->ext_separate_stencil_usage() ) + { + VkImageStencilUsageCreateInfoEXT create_info; + + create_info.pNext = nullptr; + create_info.stencilUsage = 0; + create_info.sType = VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO_EXT; + + image_stencil_usage_create_info_struct_id = input_struct_chainer.append_struct(create_info); + } + if (in_query.external_memory_handle_type != Anvil::ExternalMemoryHandleTypeFlagBits::NONE) { anvil_assert(instance_extensions_ptr->khr_external_memory_capabilities() ); @@ -960,6 +1442,18 @@ bool Anvil::PhysicalDevice::get_image_format_properties(const ImageFormatPropert external_image_format_props_struct_id = output_struct_chainer.append_struct(external_image_format_props); } + if (m_extension_info_ptr->get_device_extension_info()->khr_sampler_ycbcr_conversion() && + Anvil::Formats::is_format_yuv_khr (in_query.format) ) + { + VkSamplerYcbcrConversionImageFormatPropertiesKHR image_format_properties; + + image_format_properties.combinedImageSamplerDescriptorCount = 0; + image_format_properties.pNext = nullptr; + image_format_properties.sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES_KHR; + + sampler_ycbcr_conversion_image_format_props_struct_id = output_struct_chainer.append_struct(image_format_properties); + } + auto input_struct_chain_ptr = input_struct_chainer.create_chain (); auto output_struct_chain_ptr = output_struct_chainer.create_chain(); @@ -981,6 +1475,20 @@ bool Anvil::PhysicalDevice::get_image_format_properties(const ImageFormatPropert external_handle_props = Anvil::ExternalMemoryProperties(image_format_props_ptr->externalMemoryProperties); } + + if (image_stencil_usage_create_info_struct_id != UINT32_MAX) + { + auto stencil_usage_create_info_ptr = reinterpret_cast(input_struct_chain_ptr->get_struct_with_id(image_stencil_usage_create_info_struct_id) ); + + valid_stencil_image_usage_aspect_flags = static_cast(stencil_usage_create_info_ptr->stencilUsage); + } + + if (sampler_ycbcr_conversion_image_format_props_struct_id != UINT32_MAX) + { + auto image_format_props_ptr = reinterpret_cast(input_struct_chain_ptr->get_struct_with_id(sampler_ycbcr_conversion_image_format_props_struct_id) ); + + n_combined_image_sampler_descriptors_used = image_format_props_ptr->combinedImageSamplerDescriptorCount; + } } else { @@ -992,7 +1500,9 @@ bool Anvil::PhysicalDevice::get_image_format_properties(const ImageFormatPropert { *out_opt_result_ptr = Anvil::ImageFormatProperties(core_vk10_image_format_properties, supports_amd_texture_gather_bias_lod, - external_handle_props); + external_handle_props, + valid_stencil_image_usage_aspect_flags, + n_combined_image_sampler_descriptors_used); } result = true; @@ -1118,3 +1628,19 @@ void Anvil::PhysicalDevice::set_device_group_device_index(uint32_t in_new_device { m_device_group_device_index = in_new_device_group_device_index; } + +/* Please see header for specification */ +bool Anvil::PhysicalDevice::supports_core_vk1_1() const +{ + return supports_core_vk1_1(get_device_properties().core_vk1_0_properties_ptr->api_version); +} + +/* Please see header for specification */ +bool Anvil::PhysicalDevice::supports_core_vk1_1(const uint32_t& in_api_version) const +{ + const auto vk_major_version = VK_VERSION_MAJOR(in_api_version); + const auto vk_minor_version = VK_VERSION_MINOR(in_api_version); + + return (vk_major_version >= 2) || + (vk_major_version == 1 && vk_minor_version >= 1); +} \ No newline at end of file diff --git a/src/wrappers/query_pool.cpp b/src/wrappers/query_pool.cpp index f9fda44a..337105b0 100644 --- a/src/wrappers/query_pool.cpp +++ b/src/wrappers/query_pool.cpp @@ -39,8 +39,9 @@ Anvil::QueryPool::QueryPool(const Anvil::BaseDevice* in_device_ptr, m_n_max_indices (in_n_max_concurrent_queries), m_query_type (in_query_type) { - anvil_assert(in_query_type == VK_QUERY_TYPE_OCCLUSION || - in_query_type == VK_QUERY_TYPE_TIMESTAMP); + anvil_assert(in_query_type == VK_QUERY_TYPE_OCCLUSION || + in_query_type == VK_QUERY_TYPE_TIMESTAMP || + in_query_type == VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT); init(in_query_type, Anvil::QueryPipelineStatisticFlagBits::NONE, diff --git a/src/wrappers/queue.cpp b/src/wrappers/queue.cpp index 2dd3afe6..1cb744a2 100644 --- a/src/wrappers/queue.cpp +++ b/src/wrappers/queue.cpp @@ -31,6 +31,7 @@ #include "wrappers/device.h" #include "wrappers/fence.h" #include "wrappers/instance.h" +#include "wrappers/memory_block.h" #include "wrappers/queue.h" #include "wrappers/rendering_surface.h" #include "wrappers/semaphore.h" @@ -40,10 +41,11 @@ /** Please see header for specification */ -Anvil::Queue::Queue(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_queue_family_index, - uint32_t in_queue_index, - bool in_mt_safe) +Anvil::Queue::Queue(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_queue_family_index, + uint32_t in_queue_index, + bool in_mt_safe, + const Anvil::QueueGlobalPriority& in_global_priority) :CallbacksSupportProvider (QUEUE_CALLBACK_ID_COUNT), DebugMarkerSupportProvider (in_device_ptr, @@ -53,6 +55,7 @@ Anvil::Queue::Queue(const Anvil::BaseDevice* in_device_ptr, m_n_debug_label_regions_started(0), m_queue (VK_NULL_HANDLE), m_queue_family_index (in_queue_family_index), + m_queue_global_priority (in_global_priority), m_queue_index (in_queue_index) { /* Retrieve the Vulkan handle */ @@ -63,8 +66,9 @@ Anvil::Queue::Queue(const Anvil::BaseDevice* in_device_ptr, anvil_assert(m_queue != VK_NULL_HANDLE); - /* Determine whether the queue supports sparse bindings */ - m_supports_sparse_bindings = (m_device_ptr->get_queue_family_info(in_queue_family_index)->flags & Anvil::QueueFlagBits::SPARSE_BINDING_BIT) != 0; + /* Determine additional properties of the queue */ + m_supports_protected_memory_operations = (m_device_ptr->get_queue_family_info(in_queue_family_index)->flags & Anvil::QueueFlagBits::PROTECTED_BIT) != 0; + m_supports_sparse_bindings = (m_device_ptr->get_queue_family_info(in_queue_family_index)->flags & Anvil::QueueFlagBits::SPARSE_BINDING_BIT) != 0; /* Cache a fence that may be optionally used for submissions */ { @@ -258,6 +262,7 @@ bool Anvil::Queue::bind_sparse_memory(Anvil::SparseMemoryBindingUpdateInfo& in_u bool memory_block_owned_by_image = false; Anvil::MemoryBlock* memory_block_ptr = nullptr; VkDeviceSize memory_block_start_offset; + uint32_t n_plane = UINT32_MAX; VkDeviceSize resource_offset; VkDeviceSize size; @@ -269,9 +274,11 @@ bool Anvil::Queue::bind_sparse_memory(Anvil::SparseMemoryBindingUpdateInfo& in_u &flags, &memory_block_ptr, &memory_block_start_offset, - &memory_block_owned_by_image); + &memory_block_owned_by_image, + &n_plane); - image_ptr->on_memory_backing_opaque_update(resource_offset, + image_ptr->on_memory_backing_opaque_update(n_plane, + resource_offset, size, memory_block_ptr, memory_block_start_offset, @@ -430,7 +437,8 @@ void Anvil::Queue::bind_sparse_memory_lock_unlock(Anvil::SparseMemoryBindingUpda nullptr, /* out_opt_flags_ptr */ nullptr, /* out_opt_memory_block_ptr_ptr */ nullptr, /* out_opt_memory_block_start_offset_ptr */ - nullptr); /* out_opt_memory_block_owned_by_image_ptr */ + nullptr, /* out_opt_memory_block_owned_by_image_ptr */ + nullptr); /* out_opt_n_plane_ptr */ if (in_should_lock) { @@ -445,10 +453,11 @@ void Anvil::Queue::bind_sparse_memory_lock_unlock(Anvil::SparseMemoryBindingUpda } /** Please see header for specification */ -std::unique_ptr Anvil::Queue::create(const Anvil::BaseDevice* in_device_ptr, - uint32_t in_queue_family_index, - uint32_t in_queue_index, - bool in_mt_safe) +std::unique_ptr Anvil::Queue::create(const Anvil::BaseDevice* in_device_ptr, + uint32_t in_queue_family_index, + uint32_t in_queue_index, + bool in_mt_safe, + const Anvil::QueueGlobalPriority& in_queue_global_priority) { std::unique_ptr result_ptr; @@ -456,7 +465,8 @@ std::unique_ptr Anvil::Queue::create(const Anvil::BaseDevice* in_d new Anvil::Queue(in_device_ptr, in_queue_family_index, in_queue_index, - in_mt_safe) + in_mt_safe, + in_queue_global_priority) ); return result_ptr; @@ -1014,14 +1024,16 @@ bool Anvil::Queue::submit(const Anvil::SubmitInfo& in_submit_info) VkResult result (VK_ERROR_INITIALIZATION_FAILED); Anvil::StructChainer struct_chainer; - std::vector cmd_buffers_vk (in_submit_info.get_n_command_buffers () ); - std::vector signal_semaphores_vk(in_submit_info.get_n_signal_semaphores() ); - std::vector wait_semaphores_vk (in_submit_info.get_n_wait_semaphores () ); + std::vector cmd_buffers_vk (in_submit_info.get_n_command_buffers () ); + std::vector device_memory_block_vec(0); + std::vector signal_semaphores_vk (in_submit_info.get_n_signal_semaphores() ); + std::vector wait_semaphores_vk (in_submit_info.get_n_wait_semaphores () ); std::vector cmd_buffer_device_masks = std::vector(in_submit_info.get_n_command_buffers() ); std::vector signal_semaphore_device_indices = std::vector(in_submit_info.get_n_signal_semaphores() ); std::vector wait_semaphore_device_indices = std::vector(in_submit_info.get_n_wait_semaphores () ); + ANVIL_REDUNDANT_VARIABLE(result); /* Prepare for the submission */ @@ -1031,6 +1043,11 @@ bool Anvil::Queue::submit(const Anvil::SubmitInfo& in_submit_info) { uint32_t n_cmd_buffers = 0; + if (in_submit_info.is_protected_submission() ) + { + anvil_assert(reinterpret_cast(m_device_ptr)->get_physical_device(0)->supports_core_vk1_1() ); + } + for (uint32_t n_command_buffer_submission = 0; n_command_buffer_submission < in_submit_info.get_n_command_buffers(); ++n_command_buffer_submission) @@ -1052,6 +1069,8 @@ bool Anvil::Queue::submit(const Anvil::SubmitInfo& in_submit_info) { const auto& current_submission = in_submit_info.get_signal_semaphores_mgpu()[n_signal_semaphore_submission]; + anvil_assert(current_submission.device_index < reinterpret_cast(m_device_ptr)->get_n_physical_devices() ); + signal_semaphore_device_indices.at(n_signal_semaphore_submission) = current_submission.device_index; signal_semaphores_vk.at (n_signal_semaphore_submission) = current_submission.semaphore_ptr->get_semaphore(); } @@ -1062,6 +1081,8 @@ bool Anvil::Queue::submit(const Anvil::SubmitInfo& in_submit_info) { const auto& current_submission = in_submit_info.get_wait_semaphores_mgpu()[n_wait_semaphore_submission]; + anvil_assert(current_submission.device_index < reinterpret_cast(m_device_ptr)->get_n_physical_devices() ); + wait_semaphore_device_indices.at(n_wait_semaphore_submission) = current_submission.device_index; wait_semaphores_vk.at (n_wait_semaphore_submission) = current_submission.semaphore_ptr->get_semaphore(); } @@ -1104,6 +1125,11 @@ bool Anvil::Queue::submit(const Anvil::SubmitInfo& in_submit_info) { VkSubmitInfo submit_info; + if (in_submit_info.is_protected_submission() ) + { + anvil_assert(reinterpret_cast(m_device_ptr)->get_physical_device()->supports_core_vk1_1() ); + } + for (uint32_t n_command_buffer = 0; n_command_buffer < in_submit_info.get_n_command_buffers(); ++n_command_buffer) @@ -1171,6 +1197,75 @@ bool Anvil::Queue::submit(const Anvil::SubmitInfo& in_submit_info) } #endif + #if defined(_WIN32) + { + const Anvil::MemoryBlock** acquire_d3d11_memory_block_ptrs = nullptr; + const uint64_t* acquire_mutex_key_value_ptrs = nullptr; + const uint32_t* acquire_timeout_ptrs = nullptr; + uint32_t n_acquire_keys = 0; + uint32_t n_release_keys = 0; + const Anvil::MemoryBlock** release_d3d11_memory_block_ptrs = nullptr; + const uint64_t* release_mutex_key_value_ptrs = nullptr; + + if (in_submit_info.get_keyed_mutex_acquire_release_info(&n_acquire_keys, + &acquire_d3d11_memory_block_ptrs, + &acquire_mutex_key_value_ptrs, + &acquire_timeout_ptrs, + &n_release_keys, + &release_d3d11_memory_block_ptrs, + &release_mutex_key_value_ptrs) ) + { + VkWin32KeyedMutexAcquireReleaseInfoKHR info; + + anvil_assert(n_acquire_keys + n_release_keys > 0); + + device_memory_block_vec.resize(n_acquire_keys + n_release_keys); + + VkDeviceMemory* acquire_sync_ptr = (n_acquire_keys > 0) ? &device_memory_block_vec.at(0) + : nullptr; + VkDeviceMemory* release_sync_ptr = (n_release_keys > 0) ? &device_memory_block_vec.at(n_acquire_keys) + : nullptr; + + for (uint32_t n_acquire_sync = 0; + n_acquire_sync < n_acquire_keys; + ++n_acquire_sync) + { + acquire_sync_ptr[n_acquire_sync] = acquire_d3d11_memory_block_ptrs[n_acquire_sync]->get_memory(); + } + + for (uint32_t n_release_sync = 0; + n_release_sync < n_release_keys; + ++n_release_sync) + { + release_sync_ptr[n_release_sync] = release_d3d11_memory_block_ptrs[n_release_sync]->get_memory(); + } + + info.acquireCount = n_acquire_keys; + info.pAcquireKeys = acquire_mutex_key_value_ptrs; + info.pAcquireSyncs = acquire_sync_ptr; + info.pAcquireTimeouts = acquire_timeout_ptrs; + info.pNext = nullptr; + info.pReleaseKeys = release_mutex_key_value_ptrs; + info.pReleaseSyncs = release_sync_ptr; + info.releaseCount = n_release_keys; + info.sType = VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR; + + struct_chainer.append_struct(info); + } + } + #endif + + if (in_submit_info.is_protected_submission() ) + { + VkProtectedSubmitInfo submit_info; + + submit_info.pNext = nullptr; + submit_info.protectedSubmit = VK_TRUE; + submit_info.sType = VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO; + + struct_chainer.append_struct(submit_info); + } + /* Go for it */ if (fence_ptr == nullptr && in_submit_info.get_should_block() ) diff --git a/src/wrappers/render_pass.cpp b/src/wrappers/render_pass.cpp index f82a26b4..88b02f89 100644 --- a/src/wrappers/render_pass.cpp +++ b/src/wrappers/render_pass.cpp @@ -277,7 +277,8 @@ bool Anvil::RenderPass::init_using_core_vk10() } } - anvil_assert( (*subpass_iterator)->depth_stencil_attachment.resolve_attachment_index == UINT32_MAX); + /* NOTE: DS resolve operations are only accessible via KHR_depth_stencil_resolve + KHR_create_renderpass2. */ + anvil_assert( (*subpass_iterator)->depth_stencil_attachment.resolve_attachment_index != UINT32_MAX); /* Determine the highest color attachment location & input attachment index. */ for (auto subpass_color_attachment_iterator = (*subpass_iterator)->color_attachments_map.cbegin(); @@ -704,6 +705,7 @@ bool Anvil::RenderPass::init_using_rp2_create_extension() uint32_t current_subpass_attachment_reference_vec_base_index = static_cast(subpass_attachment_reference_vec.size() ); uint32_t current_subpass_highest_location = 0; uint32_t current_subpass_preserve_attachment_vec_base_index = static_cast(subpass_preserve_attachment_vec.size () ); + bool current_subpass_uses_ds_resolve_operation = false; uint32_t current_subpass_view_mask = 0; uint32_t n_current_subpass_color_attachments_actual = 0; uint32_t n_current_subpass_ds_attachments = 0; @@ -760,6 +762,7 @@ bool Anvil::RenderPass::init_using_rp2_create_extension() const uint32_t current_subpass_color_attachment_reference_vec_base_index = current_subpass_attachment_reference_vec_base_index; const uint32_t current_subpass_ds_attachment_reference_vec_base_index = current_subpass_color_attachment_reference_vec_base_index + subpass_color_attachment_data.n_subpass_attachments; + uint32_t current_subpass_ds_resolve_attachment_reference_vec_base_index = UINT32_MAX; /* optionally updated later */ const uint32_t current_subpass_input_attachment_reference_vec_base_index = current_subpass_ds_attachment_reference_vec_base_index + subpass_ds_attachment_data.n_subpass_attachments; const uint32_t current_subpass_resolve_attachment_reference_vec_base_index = current_subpass_input_attachment_reference_vec_base_index + subpass_input_attachment_data.n_subpass_attachments; @@ -867,6 +870,36 @@ bool Anvil::RenderPass::init_using_rp2_create_extension() current_subpass_attachment_reference.sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2_KHR; } + if (current_subpass_attachment_data.subpass_attachment_type == AttachmentType::DEPTH_STENCIL) + { + Anvil::ResolveModeFlagBits current_subpass_ds_resolve_attachment_depth_resolve_mode = Anvil::ResolveModeFlagBits::NONE; + Anvil::ImageLayout current_subpass_ds_resolve_attachment_layout = Anvil::ImageLayout::UNKNOWN; + Anvil::RenderPassAttachmentID current_subpass_ds_resolve_attachment_renderpass_attachment_id = UINT32_MAX; + Anvil::ResolveModeFlagBits current_subpass_ds_resolve_attachment_stencil_resolve_mode = Anvil::ResolveModeFlagBits::NONE; + + current_subpass_uses_ds_resolve_operation = (m_render_pass_create_info_ptr->get_subpass_ds_resolve_attachment_properties(n_subpass, + ¤t_subpass_ds_resolve_attachment_renderpass_attachment_id, + ¤t_subpass_ds_resolve_attachment_layout, + ¤t_subpass_ds_resolve_attachment_depth_resolve_mode, + ¤t_subpass_ds_resolve_attachment_stencil_resolve_mode) ); + + if (current_subpass_uses_ds_resolve_operation) + { + subpass_attachment_reference_vec.resize(subpass_attachment_reference_vec.size() + 1); + + auto& current_subpass_ds_resolve_attachment_reference = subpass_attachment_reference_vec.back(); + + current_subpass_ds_resolve_attachment_reference.aspectMask = static_cast(((current_subpass_ds_resolve_attachment_depth_resolve_mode != Anvil::ResolveModeFlagBits::NONE) ? Anvil::ImageAspectFlagBits::DEPTH_BIT : Anvil::ImageAspectFlagBits::NONE) | + ((current_subpass_ds_resolve_attachment_stencil_resolve_mode != Anvil::ResolveModeFlagBits::NONE) ? Anvil::ImageAspectFlagBits::STENCIL_BIT : Anvil::ImageAspectFlagBits::NONE) ); + current_subpass_ds_resolve_attachment_reference.attachment = current_subpass_ds_resolve_attachment_renderpass_attachment_id; + current_subpass_ds_resolve_attachment_reference.layout = static_cast(current_subpass_ds_resolve_attachment_layout); + current_subpass_ds_resolve_attachment_reference.pNext = nullptr; + current_subpass_ds_resolve_attachment_reference.sType = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2_KHR; + + current_subpass_ds_resolve_attachment_reference_vec_base_index = static_cast(subpass_attachment_reference_vec.size() - 1); + } + } + current_subpass_attachment_reference_vec_base_index += current_subpass_attachment_data.n_subpass_attachments; } @@ -924,6 +957,30 @@ bool Anvil::RenderPass::init_using_rp2_create_extension() current_subpass_chainer.append_struct(current_subpass); } + + /* Chain the DS resolve struct if needed. */ + if (current_subpass_uses_ds_resolve_operation) + { + Anvil::ResolveModeFlagBits depth_resolve_mode = Anvil::ResolveModeFlagBits::NONE; + VkSubpassDescriptionDepthStencilResolveKHR ds_resolve; + Anvil::ResolveModeFlagBits stencil_resolve_mode = Anvil::ResolveModeFlagBits::NONE; + + anvil_assert(current_subpass_ds_resolve_attachment_reference_vec_base_index != UINT32_MAX); + + m_render_pass_create_info_ptr->get_subpass_ds_resolve_attachment_properties(n_subpass, + nullptr, /* out_opt_renderpass_attachment_id_ptr */ + nullptr, /* out_opt_layout_ptr */ + &depth_resolve_mode, + &stencil_resolve_mode); + + ds_resolve.depthResolveMode = static_cast (depth_resolve_mode); + ds_resolve.pDepthStencilResolveAttachment = reinterpret_cast(current_subpass_ds_resolve_attachment_reference_vec_base_index * sizeof(VkAttachmentReference2KHR) ); + ds_resolve.pNext = nullptr; + ds_resolve.stencilResolveMode = static_cast(stencil_resolve_mode); + ds_resolve.sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR; + + current_subpass_chainer.append_struct(ds_resolve); + } } } @@ -932,10 +989,11 @@ bool Anvil::RenderPass::init_using_rp2_create_extension() n_subpass < n_subpasses; ++n_subpass) { - auto& current_subpass_chainer = subpass_chainer_vec.at (n_subpass); - auto current_subpass_ptr = current_subpass_chainer.get_root_struct(); - uint32_t n_current_subpass_ds_attachments = 0; - uint32_t n_current_subpass_preserve_attachments = 0; + auto& current_subpass_chainer = subpass_chainer_vec.at (n_subpass); + auto current_subpass_ptr = current_subpass_chainer.get_root_struct(); + bool current_subpass_uses_ds_resolve_attachment = false; + uint32_t n_current_subpass_ds_attachments = 0; + uint32_t n_current_subpass_preserve_attachments = 0; m_render_pass_create_info_ptr->get_subpass_n_attachments(n_subpass, Anvil::AttachmentType::DEPTH_STENCIL, @@ -944,6 +1002,8 @@ bool Anvil::RenderPass::init_using_rp2_create_extension() Anvil::AttachmentType::PRESERVE, &n_current_subpass_preserve_attachments); + current_subpass_uses_ds_resolve_attachment = m_render_pass_create_info_ptr->get_subpass_ds_resolve_attachment_properties(n_subpass); + const struct { bool active; @@ -970,6 +1030,31 @@ bool Anvil::RenderPass::init_using_rp2_create_extension() { current_subpass_ptr->pPreserveAttachments = reinterpret_cast(reinterpret_cast(current_subpass_ptr->pPreserveAttachments) + reinterpret_cast(&subpass_preserve_attachment_vec.at(0) )); } + + if (current_subpass_uses_ds_resolve_attachment) + { + VkSubpassDescriptionDepthStencilResolveKHR* ds_resolve_struct_ptr = nullptr; + const auto n_structs = current_subpass_chainer.get_n_structs(); + + for (uint32_t n_struct = 1; + n_struct < n_structs; + ++n_struct) + { + auto struct_header_ptr = current_subpass_chainer.get_struct_at_index(n_struct); + anvil_assert(struct_header_ptr != nullptr); + + if (struct_header_ptr->type == VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR) + { + ds_resolve_struct_ptr = reinterpret_cast(struct_header_ptr); + + break; + }} + + + anvil_assert(ds_resolve_struct_ptr != nullptr); + + ds_resolve_struct_ptr->pDepthStencilResolveAttachment = reinterpret_cast(reinterpret_cast(ds_resolve_struct_ptr->pDepthStencilResolveAttachment) + reinterpret_cast(&subpass_attachment_reference_vec.at(0) )); + } } /* Create subpass struct chains. */ diff --git a/src/wrappers/rendering_surface.cpp b/src/wrappers/rendering_surface.cpp index 5589e2c0..55e5d809 100644 --- a/src/wrappers/rendering_surface.cpp +++ b/src/wrappers/rendering_surface.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2019 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -22,6 +22,7 @@ #include "misc/debug.h" #include "misc/object_tracker.h" +#include "misc/rendering_surface_create_info.h" #include "misc/window.h" #include "wrappers/instance.h" #include "wrappers/physical_device.h" @@ -31,22 +32,16 @@ #include "config.h" /* Please see header for specification */ -Anvil::RenderingSurface::RenderingSurface(Anvil::Instance* in_instance_ptr, - const Anvil::BaseDevice* in_device_ptr, - const Anvil::Window* in_window_ptr, - bool in_mt_safe, - bool* out_safe_to_use_ptr) - :DebugMarkerSupportProvider(in_device_ptr, +Anvil::RenderingSurface::RenderingSurface(Anvil::RenderingSurfaceCreateInfoUniquePtr in_create_info_ptr) + :DebugMarkerSupportProvider(in_create_info_ptr->get_device_ptr(), Anvil::ObjectType::RENDERING_SURFACE), - MTSafetySupportProvider (in_mt_safe), - m_device_ptr (in_device_ptr), + MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety (), + in_create_info_ptr->get_device_ptr() )), m_height (0), - m_instance_ptr (in_instance_ptr), m_surface (VK_NULL_HANDLE), - m_width (0), - m_window_ptr (in_window_ptr) + m_width (0) { - *out_safe_to_use_ptr = init(); + m_create_info_ptr = std::move(in_create_info_ptr); /* Register the instance */ Anvil::ObjectTracker::get()->register_object(Anvil::ObjectType::RENDERING_SURFACE, @@ -63,9 +58,11 @@ Anvil::RenderingSurface::~RenderingSurface() { lock(); { - m_instance_ptr->get_extension_khr_surface_entrypoints().vkDestroySurfaceKHR(m_instance_ptr->get_instance_vk(), - m_surface, - nullptr /* pAllocator */); + auto instance_ptr = m_create_info_ptr->get_instance_ptr(); + + instance_ptr->get_extension_khr_surface_entrypoints().vkDestroySurfaceKHR(instance_ptr->get_instance_vk(), + m_surface, + nullptr /* pAllocator */); } unlock(); @@ -78,23 +75,24 @@ void Anvil::RenderingSurface::cache_surface_properties() { const Anvil::DeviceType& device_type (m_device_ptr->get_type() ); bool is_offscreen_rendering_enabled(true); - auto khr_surface_entrypoints (m_instance_ptr->get_extension_khr_surface_entrypoints() ); + auto khr_surface_entrypoints (m_create_info_ptr->get_instance_ptr()->get_extension_khr_surface_entrypoints() ); const Anvil::MGPUDevice* mgpu_device_ptr (dynamic_cast(m_device_ptr)); uint32_t n_physical_devices (0); const Anvil::SGPUDevice* sgpu_device_ptr (dynamic_cast(m_device_ptr)); std::vector supported_formats; + auto window_ptr (m_create_info_ptr->get_window_ptr() ); - if (m_window_ptr != nullptr) + if (window_ptr != nullptr) { - const WindowPlatform window_platform(m_window_ptr->get_platform() ); + const WindowPlatform window_platform(window_ptr->get_platform() ); is_offscreen_rendering_enabled = (window_platform == WINDOW_PLATFORM_DUMMY || window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS); if (is_offscreen_rendering_enabled) { - m_height = m_window_ptr->get_height_at_creation_time(); - m_width = m_window_ptr->get_width_at_creation_time (); + m_height = window_ptr->get_height_at_creation_time(); + m_width = window_ptr->get_width_at_creation_time (); } else { @@ -238,27 +236,23 @@ void Anvil::RenderingSurface::cache_surface_properties() } /* Please see header for specification */ -Anvil::RenderingSurfaceUniquePtr Anvil::RenderingSurface::create(Anvil::Instance* in_instance_ptr, - const Anvil::BaseDevice* in_device_ptr, - const Anvil::Window* in_window_ptr, - MTSafety in_mt_safety) +Anvil::RenderingSurfaceUniquePtr Anvil::RenderingSurface::create(Anvil::RenderingSurfaceCreateInfoUniquePtr in_create_info_ptr) { - const bool mt_safe = Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr); RenderingSurfaceUniquePtr result_ptr(nullptr, std::default_delete() ); - bool success = false; result_ptr.reset( - new Anvil::RenderingSurface(in_instance_ptr, - in_device_ptr, - in_window_ptr, - mt_safe, - &success) ); + new Anvil::RenderingSurface( + std::move(in_create_info_ptr) + ) + ); - if (!success) + if (result_ptr != nullptr) { - result_ptr.reset(); + if (!result_ptr->init() ) + { + result_ptr.reset(); + } } return result_ptr; @@ -354,9 +348,10 @@ bool Anvil::RenderingSurface::init() { const Anvil::DeviceType& device_type (m_device_ptr->get_type() ); bool init_successful (false); + auto instance_ptr (m_create_info_ptr->get_instance_ptr() ); uint32_t n_physical_devices(0); VkResult result (VK_SUCCESS); - const WindowPlatform window_platform (m_window_ptr->get_platform()); + const WindowPlatform window_platform (m_create_info_ptr->get_window_ptr()->get_platform()); const bool is_dummy_window_platform(window_platform == WINDOW_PLATFORM_DUMMY || window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS); @@ -391,20 +386,22 @@ bool Anvil::RenderingSurface::init() if (!is_dummy_window_platform) { + auto window_ptr = m_create_info_ptr->get_window_ptr(); + #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) && defined(_WIN32) { VkWin32SurfaceCreateInfoKHR surface_create_info; surface_create_info.flags = 0; surface_create_info.hinstance = GetModuleHandle(nullptr); - surface_create_info.hwnd = m_window_ptr->get_handle(); + surface_create_info.hwnd = window_ptr->get_handle(); surface_create_info.pNext = nullptr; surface_create_info.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR; - result = m_instance_ptr->get_extension_khr_win32_surface_entrypoints().vkCreateWin32SurfaceKHR(m_instance_ptr->get_instance_vk(), - &surface_create_info, - nullptr, /* pAllocator */ - &m_surface); + result = instance_ptr->get_extension_khr_win32_surface_entrypoints().vkCreateWin32SurfaceKHR(instance_ptr->get_instance_vk(), + &surface_create_info, + nullptr, /* pAllocator */ + &m_surface); } #endif #if defined(ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT) && !defined(_WIN32) @@ -412,17 +409,18 @@ bool Anvil::RenderingSurface::init() VkXcbSurfaceCreateInfoKHR surface_create_info; surface_create_info.flags = 0; - surface_create_info.window = m_window_ptr->get_handle(); - surface_create_info.connection = static_cast(m_window_ptr->get_connection()); + surface_create_info.window = window_ptr->get_handle(); + surface_create_info.connection = static_cast(window_ptr->get_connection()); surface_create_info.pNext = nullptr; surface_create_info.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR; - result = m_instance_ptr->get_extension_khr_xcb_surface_entrypoints().vkCreateXcbSurfaceKHR(m_instance_ptr->get_instance_vk(), - &surface_create_info, - nullptr, /* pAllocator */ - &m_surface); + result = instance_ptr->get_extension_khr_xcb_surface_entrypoints().vkCreateXcbSurfaceKHR(instance_ptr->get_instance_vk(), + &surface_create_info, + nullptr, /* pAllocator */ + &m_surface); } #endif + anvil_assert_vk_call_succeeded(result); if (is_vk_call_successful(result) ) { @@ -484,7 +482,7 @@ bool Anvil::RenderingSurface::init() VkBool32 is_presentation_supported = VK_FALSE; { - const auto& khr_surface_entrypoints = m_instance_ptr->get_extension_khr_surface_entrypoints(); + const auto& khr_surface_entrypoints = instance_ptr->get_extension_khr_surface_entrypoints(); result = khr_surface_entrypoints.vkGetPhysicalDeviceSurfaceSupportKHR(physical_device_ptr->get_physical_device(), n_queue_family, @@ -609,15 +607,17 @@ bool Anvil::RenderingSurface::supports_presentation_mode(const Anvil::PhysicalDe void Anvil::RenderingSurface::update_surface_extents() const { - const Anvil::DeviceType& device_type (m_device_ptr->get_type() ); - auto khr_surface_entrypoints (m_instance_ptr->get_extension_khr_surface_entrypoints() ); - const Anvil::MGPUDevice* mgpu_device_ptr (dynamic_cast(m_device_ptr)); + const Anvil::DeviceType& device_type (m_device_ptr->get_type () ); + auto instance_ptr (m_create_info_ptr->get_instance_ptr () ); + auto khr_surface_entrypoints (instance_ptr->get_extension_khr_surface_entrypoints() ); + const Anvil::MGPUDevice* mgpu_device_ptr (dynamic_cast (m_device_ptr)); uint32_t n_physical_devices (0); const Anvil::SGPUDevice* sgpu_device_ptr (dynamic_cast(m_device_ptr)); + auto window_ptr (m_create_info_ptr->get_window_ptr () ); - if (m_window_ptr != nullptr) + if (window_ptr != nullptr) { - const WindowPlatform window_platform(m_window_ptr->get_platform() ); + const WindowPlatform window_platform(window_ptr->get_platform() ); if (window_platform == WINDOW_PLATFORM_DUMMY || window_platform == WINDOW_PLATFORM_DUMMY_WITH_PNG_SNAPSHOTS) diff --git a/src/wrappers/sampler.cpp b/src/wrappers/sampler.cpp index 7c3d3709..418f3392 100644 --- a/src/wrappers/sampler.cpp +++ b/src/wrappers/sampler.cpp @@ -27,6 +27,7 @@ #include "wrappers/device.h" #include "wrappers/physical_device.h" #include "wrappers/sampler.h" +#include "wrappers/sampler_ycbcr_conversion.h" /** Please see header for specification */ Anvil::Sampler::Sampler(Anvil::SamplerCreateInfoUniquePtr in_create_info_ptr) @@ -85,8 +86,9 @@ Anvil::SamplerUniquePtr Anvil::Sampler::create(Anvil::SamplerCreateInfoUniquePtr bool Anvil::Sampler::init() { - VkResult result (VK_ERROR_INITIALIZATION_FAILED); - const auto sampler_reduction_mode(m_create_info_ptr->get_sampler_reduction_mode() ); + VkResult result (VK_ERROR_INITIALIZATION_FAILED); + const auto sampler_reduction_mode (m_create_info_ptr->get_sampler_reduction_mode () ); + const auto& sampler_ycbcr_conversion_ptr(m_create_info_ptr->get_sampler_ycbcr_conversion_ptr() ); Anvil::StructChainer struct_chainer; ANVIL_REDUNDANT_VARIABLE(result); @@ -129,6 +131,17 @@ bool Anvil::Sampler::init() struct_chainer.append_struct(srm_create_info); } + if (sampler_ycbcr_conversion_ptr != nullptr) + { + VkSamplerYcbcrConversionInfoKHR conversion_info; + + conversion_info.conversion = sampler_ycbcr_conversion_ptr->get_sampler_ycbcr_conversion_vk(); + conversion_info.pNext = nullptr; + conversion_info.sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO_KHR; + + struct_chainer.append_struct(conversion_info); + } + { auto chain_ptr = struct_chainer.create_chain(); diff --git a/src/wrappers/sampler_ycbcr_conversion.cpp b/src/wrappers/sampler_ycbcr_conversion.cpp new file mode 100644 index 00000000..5c1e51f5 --- /dev/null +++ b/src/wrappers/sampler_ycbcr_conversion.cpp @@ -0,0 +1,105 @@ +// +// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#include "misc/sampler_ycbcr_conversion_create_info.h" +#include "wrappers/device.h" +#include "wrappers/sampler_ycbcr_conversion.h" + +Anvil::SamplerYCbCrConversion::SamplerYCbCrConversion(Anvil::SamplerYCbCrConversionCreateInfoUniquePtr in_create_info_ptr) + :Anvil::DebugMarkerSupportProvider(in_create_info_ptr->get_device(), + Anvil::ObjectType::SAMPLER_YCBCR_CONVERSION), + Anvil::MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_create_info_ptr->get_mt_safety(), + in_create_info_ptr->get_device () )), + m_sampler_ycbcr_conversion_vk (VK_NULL_HANDLE) +{ + m_create_info_ptr = std::move(in_create_info_ptr); +} + +Anvil::SamplerYCbCrConversion::~SamplerYCbCrConversion() +{ + if (m_sampler_ycbcr_conversion_vk != VK_NULL_HANDLE) + { + auto device_ptr = m_create_info_ptr->get_device (); + auto& entrypoints = device_ptr->get_extension_khr_sampler_ycbcr_conversion_entrypoints(); + + lock(); + { + entrypoints.vkDestroySamplerYcbcrConversionKHR(device_ptr->get_device_vk(), + m_sampler_ycbcr_conversion_vk, + nullptr); /* pAllocator */ + } + unlock(); + + m_sampler_ycbcr_conversion_vk = VK_NULL_HANDLE; + } +} + +Anvil::SamplerYCbCrConversionUniquePtr Anvil::SamplerYCbCrConversion::create(Anvil::SamplerYCbCrConversionCreateInfoUniquePtr in_create_info_ptr) +{ + Anvil::SamplerYCbCrConversionUniquePtr result_ptr(nullptr, + std::default_delete() ); + + result_ptr.reset( + new Anvil::SamplerYCbCrConversion(std::move(in_create_info_ptr) ) + ); + + anvil_assert(result_ptr != nullptr); + if (result_ptr != nullptr) + { + if (!result_ptr->init() ) + { + result_ptr.reset(); + } + } + + return result_ptr; +} + +bool Anvil::SamplerYCbCrConversion::init() +{ + VkSamplerYcbcrConversionCreateInfoKHR create_info; + const auto& entrypoints = m_create_info_ptr->get_device()->get_extension_khr_sampler_ycbcr_conversion_entrypoints(); + bool result = false; + + create_info.chromaFilter = static_cast(m_create_info_ptr->get_chroma_filter() ); + create_info.components = m_create_info_ptr->get_components().get_vk (); + create_info.forceExplicitReconstruction = m_create_info_ptr->should_force_explicit_reconstruction (); + create_info.format = static_cast(m_create_info_ptr->get_format () ); + create_info.pNext = nullptr; + create_info.sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO_KHR; + create_info.xChromaOffset = static_cast (m_create_info_ptr->get_x_chroma_offset () ); + create_info.ycbcrModel = static_cast(m_create_info_ptr->get_ycbcr_model_conversion() ); + create_info.ycbcrRange = static_cast (m_create_info_ptr->get_ycbcr_range () ); + create_info.yChromaOffset = static_cast (m_create_info_ptr->get_y_chroma_offset () ); + + if (is_vk_call_successful(entrypoints.vkCreateSamplerYcbcrConversionKHR(m_device_ptr->get_device_vk(), + &create_info, + nullptr, /* pAllocator */ + &m_sampler_ycbcr_conversion_vk) )) + { + result = true; + + set_vk_handle(m_sampler_ycbcr_conversion_vk); + } + + return result; +} diff --git a/src/wrappers/semaphore.cpp b/src/wrappers/semaphore.cpp index d0e7f967..fb29e040 100644 --- a/src/wrappers/semaphore.cpp +++ b/src/wrappers/semaphore.cpp @@ -372,4 +372,3 @@ bool Anvil::Semaphore::reset() end: return is_vk_call_successful(result); } - diff --git a/src/wrappers/swapchain.cpp b/src/wrappers/swapchain.cpp index 68d26632..668fcabf 100644 --- a/src/wrappers/swapchain.cpp +++ b/src/wrappers/swapchain.cpp @@ -372,10 +372,10 @@ bool Anvil::Swapchain::init() /* not doing offscreen rendering */ if (!is_offscreen_rendering_enabled) { + Anvil::CompositeAlphaFlagBits composite_alpha = Anvil::CompositeAlphaFlagBits::NONE; const auto& khr_swapchain_entrypoints = m_device_ptr->get_extension_khr_swapchain_entrypoints(); Anvil::StructChainer struct_chainer; - #ifdef _DEBUG { const Anvil::MGPUDevice* mgpu_device_ptr(dynamic_cast(m_device_ptr) ); const Anvil::SGPUDevice* sgpu_device_ptr(dynamic_cast(m_device_ptr) ); @@ -388,6 +388,9 @@ bool Anvil::Swapchain::init() Anvil::CompositeAlphaFlags supported_composite_alpha_flags; Anvil::SurfaceTransformFlags supported_surface_transform_flags; + ANVIL_REDUNDANT_VARIABLE(required_surface_extension_name); + ANVIL_REDUNDANT_VARIABLE(result_bool); + #ifdef _WIN32 #if defined(ANVIL_INCLUDE_WIN3264_WINDOW_SYSTEM_SUPPORT) required_surface_extension_name = VK_KHR_WIN32_SURFACE_EXTENSION_NAME; @@ -418,6 +421,8 @@ bool Anvil::Swapchain::init() { const Anvil::PhysicalDevice* current_physical_device_ptr = nullptr; + ANVIL_REDUNDANT_VARIABLE(current_physical_device_ptr); + switch (device_type) { case Anvil::DeviceType::MULTI_GPU: current_physical_device_ptr = mgpu_device_ptr->get_physical_device(n_physical_device); break; @@ -433,7 +438,11 @@ bool Anvil::Swapchain::init() anvil_assert(parent_surface_ptr->get_supported_composite_alpha_flags(current_physical_device_ptr, &supported_composite_alpha_flags) ); - anvil_assert((supported_composite_alpha_flags & Anvil::CompositeAlphaFlagBits::OPAQUE_BIT_KHR) != 0); + { + composite_alpha = Anvil::CompositeAlphaFlagBits::OPAQUE_BIT_KHR; + + anvil_assert((supported_composite_alpha_flags & composite_alpha) != 0); + } /* Ensure we can use the swapchain image format */ anvil_assert(parent_surface_ptr->is_compatible_with_image_format(current_physical_device_ptr, @@ -455,14 +464,13 @@ bool Anvil::Swapchain::init() surface_caps.max_image_count >= m_create_info_ptr->get_n_images() ); } } - #endif { VkSwapchainCreateInfoKHR create_info; const auto& old_swapchain_ptr = m_create_info_ptr->get_old_swapchain(); create_info.clipped = m_create_info_ptr->get_clipped(); - create_info.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; + create_info.compositeAlpha = static_cast(composite_alpha); create_info.flags = m_create_info_ptr->get_flags().get_vk(); create_info.imageArrayLayers = 1; create_info.imageColorSpace = static_cast (m_create_info_ptr->get_color_space() ); @@ -500,6 +508,28 @@ bool Anvil::Swapchain::init() struct_chainer.append_struct(mgpu_create_info); } + if ((m_create_info_ptr->get_flags() & Anvil::SwapchainCreateFlagBits::CREATE_MUTABLE_FORMAT_BIT) != 0) + { + const Anvil::Format* image_formats_ptr = nullptr; + VkImageFormatListCreateInfoKHR image_format_list_create_info; + uint32_t n_image_formats = 0; + + anvil_assert(m_device_ptr->get_extension_info()->khr_swapchain_mutable_format() ); + + m_create_info_ptr->get_view_format_list(&image_formats_ptr, + &n_image_formats); + + anvil_assert(image_formats_ptr != nullptr); + anvil_assert(n_image_formats > 0); + + image_format_list_create_info.pNext = nullptr; + image_format_list_create_info.pViewFormats = reinterpret_cast(image_formats_ptr); + image_format_list_create_info.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR; + image_format_list_create_info.viewFormatCount = n_image_formats; + + struct_chainer.append_struct(image_format_list_create_info); + } + struct_chain_ptr = struct_chainer.create_chain(); parent_surface_ptr->lock(); From 566227931e73a387a6694969f5d0e09d476859bc Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Fri, 8 Mar 2019 08:58:00 +0100 Subject: [PATCH 45/50] Address failures reported by CI --- deps/glslang/.gitattributes | 14 +++++++------- include/misc/descriptor_pool_create_info.h | 12 ++++++------ include/misc/types_struct.h | 9 +++++++++ include/wrappers/descriptor_set_group.h | 2 +- src/misc/formats.cpp | 7 ++++--- src/wrappers/descriptor_set_group.cpp | 10 +++++----- 6 files changed, 32 insertions(+), 22 deletions(-) diff --git a/deps/glslang/.gitattributes b/deps/glslang/.gitattributes index cade3908..2929e835 100644 --- a/deps/glslang/.gitattributes +++ b/deps/glslang/.gitattributes @@ -8,10 +8,10 @@ *.txt text # source code can be native and normalized, but simpler if lf everywhere; will try that way -*.h text eof=lf -*.c text eof=lf -*.cpp text eof=lf -*.y text eof=lf -*.out text eof=lf -*.conf text eof=lf -*.err text eof=lf +*.h text eol=lf +*.c text eol=lf +*.cpp text eol=lf +*.y text eol=lf +*.out text eol=lf +*.conf text eol=lf +*.err text eol=lf diff --git a/include/misc/descriptor_pool_create_info.h b/include/misc/descriptor_pool_create_info.h index 4023f7ff..b76a9b4a 100644 --- a/include/misc/descriptor_pool_create_info.h +++ b/include/misc/descriptor_pool_create_info.h @@ -133,12 +133,12 @@ namespace Anvil DescriptorPoolCreateInfo& operator=(const DescriptorPoolCreateInfo&); /* Private variables */ - Anvil::DescriptorPoolCreateFlags m_create_flags; - const Anvil::BaseDevice* m_device_ptr; - std::unordered_map m_descriptor_count; - Anvil::MTSafety m_mt_safety; - uint32_t m_n_max_inline_uniform_block_bindings; - uint32_t m_n_max_sets; + Anvil::DescriptorPoolCreateFlags m_create_flags; + const Anvil::BaseDevice* m_device_ptr; + std::unordered_map > m_descriptor_count; + Anvil::MTSafety m_mt_safety; + uint32_t m_n_max_inline_uniform_block_bindings; + uint32_t m_n_max_sets; }; }; /* namespace Anvil */ diff --git a/include/misc/types_struct.h b/include/misc/types_struct.h index 25325124..99799776 100644 --- a/include/misc/types_struct.h +++ b/include/misc/types_struct.h @@ -32,6 +32,15 @@ namespace Anvil { + template + struct EnumClassHasher + { + std::size_t operator()(const EnumClass& in_value) const + { + return static_cast(static_cast(in_value) ); + } + }; + /* Note: Matches VkSampleLocationEXT in terms of the layout and size. */ typedef struct SampleLocation diff --git a/include/wrappers/descriptor_set_group.h b/include/wrappers/descriptor_set_group.h index b3ea55c4..081cc2af 100644 --- a/include/wrappers/descriptor_set_group.h +++ b/include/wrappers/descriptor_set_group.h @@ -346,7 +346,7 @@ namespace Anvil const Anvil::BaseDevice* m_device_ptr; std::vector m_ds_create_info_ptrs; - std::unordered_map m_descriptor_type_properties; + std::unordered_map > m_descriptor_type_properties; uint32_t m_n_unique_dses; const Anvil::DescriptorSetGroup* m_parent_dsg_ptr; diff --git a/src/misc/formats.cpp b/src/misc/formats.cpp index 3908d6c7..a858152d 100644 --- a/src/misc/formats.cpp +++ b/src/misc/formats.cpp @@ -22,6 +22,7 @@ #include "misc/debug.h" #include "misc/formats.h" +#include "misc/types.h" #include #include @@ -345,7 +346,7 @@ struct YUVFormatInfo }; /* TODO: Component layouts are wrong for YUV formats? */ -static const std::unordered_map g_yuv_formats = +static const std::unordered_map> g_yuv_formats = { /* format | name | num_planes | subresources[0] | subresources[1] | subresources[2] | format_type | is_multiplanar? | is_packed? */ {Anvil::Format::G8B8G8R8_422_UNORM, {"VK_FORMAT_G8B8G8R8_422_UNORM", 1, {Anvil::Format::UNKNOWN, Anvil::ComponentLayout::GBGR, 8, 8, 8, 8}, {}, {}, Anvil::FormatType::UNORM, false, false} }, @@ -431,7 +432,7 @@ typedef struct uint32_t plane2_b0_last_bit_index; } YUVFormatBitLayoutInfo; -static const std::unordered_map g_yuv_format_bit_layout_info = +static const std::unordered_map > g_yuv_format_bit_layout_info = { /* Single-planar non-packed YUV formats ==> */ @@ -480,7 +481,7 @@ static const std::unordered_map g_yuv_for {Anvil::Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16, {UINT32_MAX, UINT32_MAX, 4, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, 4, 15, 4, 15, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, }; -static const std::unordered_map g_nonyuv_format_bit_layout_info = +static const std::unordered_map > g_nonyuv_format_bit_layout_info = { /* format | red start | red end | green start | green end | blue start | blue end | alpha start | alpha end | shared_start | shared_end | depth start | depth end | stencil start | stencil end */ {Anvil::Format::UNKNOWN, {UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX} }, diff --git a/src/wrappers/descriptor_set_group.cpp b/src/wrappers/descriptor_set_group.cpp index 48aacd58..8e1c5ba6 100644 --- a/src/wrappers/descriptor_set_group.cpp +++ b/src/wrappers/descriptor_set_group.cpp @@ -185,11 +185,11 @@ Anvil::DescriptorSetGroup::~DescriptorSetGroup() /** Re-creates internally-maintained descriptor pool. **/ bool Anvil::DescriptorSetGroup::bake_descriptor_pool() { - Anvil::DescriptorPoolCreateFlags flags = ((m_releaseable_sets) ? Anvil::DescriptorPoolCreateFlagBits::FREE_DESCRIPTOR_SET_BIT : Anvil::DescriptorPoolCreateFlagBits::NONE); - std::unique_lock mutex_lock; - auto mutex_ptr = get_mutex(); - std::unordered_map n_descriptors_needed_map; - bool result = false; + Anvil::DescriptorPoolCreateFlags flags = ((m_releaseable_sets) ? Anvil::DescriptorPoolCreateFlagBits::FREE_DESCRIPTOR_SET_BIT : Anvil::DescriptorPoolCreateFlagBits::NONE); + std::unique_lock mutex_lock; + auto mutex_ptr = get_mutex(); + std::unordered_map > n_descriptors_needed_map; + bool result = false; if (mutex_ptr != nullptr) { From ca7c9852d4ad7c031cd11e884085e09cb037dabd Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Sun, 24 Mar 2019 14:42:53 +0100 Subject: [PATCH 46/50] Stability bug-fixes --- src/misc/types_struct.cpp | 2 ++ src/wrappers/device.cpp | 2 +- src/wrappers/instance.cpp | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/misc/types_struct.cpp b/src/misc/types_struct.cpp index 30e8dd45..bffa7257 100644 --- a/src/misc/types_struct.cpp +++ b/src/misc/types_struct.cpp @@ -4121,6 +4121,7 @@ Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_buff #endif dst_stage_wait_masks (in_n_semaphores_to_wait_on), fence_ptr (in_opt_fence_ptr), + is_protected (false), #if defined(_WIN32) keyed_mutex_n_acquire_keys (0), keyed_mutex_acquire_d3d11_memory_block_ptrs_ptr(nullptr), @@ -4185,6 +4186,7 @@ Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_bu #endif dst_stage_wait_masks (in_n_wait_semaphore_submissions), fence_ptr (in_opt_fence_ptr), + is_protected (false), #if defined(_WIN32) keyed_mutex_n_acquire_keys (0), keyed_mutex_acquire_d3d11_memory_block_ptrs_ptr(nullptr), diff --git a/src/wrappers/device.cpp b/src/wrappers/device.cpp index 7bca5f0c..bdf092d5 100644 --- a/src/wrappers/device.cpp +++ b/src/wrappers/device.cpp @@ -98,6 +98,7 @@ void Anvil::BaseDevice::create_device(const std::vector& in_extensi const std::vector& in_layers, DeviceQueueFamilyInfo* out_queue_families_ptr) { + std::vector device_queue_priorities; const auto& physical_device_ptrs (m_create_info_ptr->get_physical_device_ptrs() ); std::vector physical_devices (physical_device_ptrs.size () ); VkResult result (VK_ERROR_INITIALIZATION_FAILED); @@ -138,7 +139,6 @@ void Anvil::BaseDevice::create_device(const std::vector& in_extensi /* Queue create info items */ { std::vector device_queue_create_info_items; - std::vector device_queue_priorities; const auto n_queue_fams = static_cast(zeroth_physical_device_queue_fams.size() ); /* For any queue that uses non-medium global priority, we're going to need a dedicated device queue create info struct. This is diff --git a/src/wrappers/instance.cpp b/src/wrappers/instance.cpp index cbe8c0f5..c8eb4bd9 100644 --- a/src/wrappers/instance.cpp +++ b/src/wrappers/instance.cpp @@ -19,7 +19,6 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // - #include "misc/debug.h" #include "misc/debug_messenger_create_info.h" #include "misc/object_tracker.h" From 36480dd6b60466cf7a8304a857529cf417c62e11 Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Sun, 24 Mar 2019 14:49:32 +0100 Subject: [PATCH 47/50] Fix an issue where map requests targetting buffers assigned memory blocks by VMA would not return correct ptr --- include/misc/memalloc_backends/backend_oneshot.h | 1 + include/misc/memalloc_backends/backend_vma.h | 1 + include/misc/types_classes.h | 1 + src/misc/memalloc_backends/backend_oneshot.cpp | 3 +++ src/misc/memalloc_backends/backend_vma.cpp | 15 ++++++++++++--- src/wrappers/memory_block.cpp | 5 ++++- 6 files changed, 22 insertions(+), 4 deletions(-) diff --git a/include/misc/memalloc_backends/backend_oneshot.h b/include/misc/memalloc_backends/backend_oneshot.h index 9a905db7..16e073af 100644 --- a/include/misc/memalloc_backends/backend_oneshot.h +++ b/include/misc/memalloc_backends/backend_oneshot.h @@ -64,6 +64,7 @@ namespace Anvil bool bake (Anvil::MemoryAllocator::Items& in_items) final; VkResult map (void* in_memory_object, VkDeviceSize in_start_offset, + VkDeviceSize in_memory_block_start_offset, VkDeviceSize in_size, void** out_result_ptr) final; bool supports_baking () const final; diff --git a/include/misc/memalloc_backends/backend_vma.h b/include/misc/memalloc_backends/backend_vma.h index b79e0a54..9191a692 100644 --- a/include/misc/memalloc_backends/backend_vma.h +++ b/include/misc/memalloc_backends/backend_vma.h @@ -127,6 +127,7 @@ namespace Anvil bool bake (Anvil::MemoryAllocator::Items& in_items) final; VkResult map (void* in_memory_object, VkDeviceSize in_start_offset, + VkDeviceSize in_memory_block_start_offset, VkDeviceSize in_size, void** out_result_ptr); bool supports_baking () const final; diff --git a/include/misc/types_classes.h b/include/misc/types_classes.h index 6deaac5a..b2fde088 100644 --- a/include/misc/types_classes.h +++ b/include/misc/types_classes.h @@ -36,6 +36,7 @@ namespace Anvil virtual VkResult map (void* in_memory_object, VkDeviceSize in_start_offset, + VkDeviceSize in_memory_block_start_offset, VkDeviceSize in_size, void** out_result_ptr) = 0; virtual bool supports_baking() const = 0; diff --git a/src/misc/memalloc_backends/backend_oneshot.cpp b/src/misc/memalloc_backends/backend_oneshot.cpp index 37ac2c7f..ff8838a0 100644 --- a/src/misc/memalloc_backends/backend_oneshot.cpp +++ b/src/misc/memalloc_backends/backend_oneshot.cpp @@ -418,9 +418,12 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items VkResult Anvil::MemoryAllocatorBackends::OneShot::map(void* in_memory_object, VkDeviceSize in_start_offset, + VkDeviceSize in_memory_block_start_offset, VkDeviceSize in_size, void** out_result_ptr) { + ANVIL_REDUNDANT_VARIABLE(in_memory_block_start_offset); + return Anvil::Vulkan::vkMapMemory(m_device_ptr->get_device_vk(), reinterpret_cast(in_memory_object), in_start_offset, diff --git a/src/misc/memalloc_backends/backend_vma.cpp b/src/misc/memalloc_backends/backend_vma.cpp index b53cbd29..7ff9fcf6 100644 --- a/src/misc/memalloc_backends/backend_vma.cpp +++ b/src/misc/memalloc_backends/backend_vma.cpp @@ -361,17 +361,26 @@ bool Anvil::MemoryAllocatorBackends::VMA::init() VkResult Anvil::MemoryAllocatorBackends::VMA::map(void* in_memory_object, VkDeviceSize in_start_offset, + VkDeviceSize in_memory_block_start_offset, VkDeviceSize in_size, void** out_result_ptr) { + VkResult result; + void* result_ptr = nullptr; + ANVIL_REDUNDANT_ARGUMENT(in_size); ANVIL_REDUNDANT_ARGUMENT(in_start_offset); anvil_assert(in_start_offset == 0); - return vmaMapMemory(m_vma_allocator_ptr->get_handle(), - static_cast(in_memory_object), - out_result_ptr); + result = vmaMapMemory(m_vma_allocator_ptr->get_handle(), + static_cast(in_memory_object), + &result_ptr); + + result_ptr = reinterpret_cast(result_ptr) - in_memory_block_start_offset; + + *out_result_ptr = result_ptr; + return result; } /** Please see header for specification */ diff --git a/src/wrappers/memory_block.cpp b/src/wrappers/memory_block.cpp index 0fd0a732..aab2876f 100644 --- a/src/wrappers/memory_block.cpp +++ b/src/wrappers/memory_block.cpp @@ -682,8 +682,11 @@ bool Anvil::MemoryBlock::open_gpu_memory_access() { result_vk = m_parent_memory_allocator_backend_ptr->map(m_backend_object, 0, /* in_start_offset */ - m_create_info_ptr->get_size(), + m_create_info_ptr->get_start_offset(), + m_create_info_ptr->get_size (), static_cast(&m_gpu_data_ptr) ); + + m_gpu_data_ptr = reinterpret_cast(m_gpu_data_ptr); } else { From 625cc9b2d07977302edac970bbde79d8605ff54d Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Wed, 27 Mar 2019 10:13:55 +0100 Subject: [PATCH 48/50] Bug-fixes --- CMakeLists.txt | 4 +++ include/misc/debug.h | 4 +-- include/misc/external_handle.h | 27 ++++++++-------- include/misc/types_classes.h | 4 +++ include/misc/types_struct.h | 9 +++++- include/misc/types_utils.h | 5 +++ src/misc/base_pipeline_manager.cpp | 4 +-- src/misc/debug.cpp | 2 +- .../memalloc_backends/backend_oneshot.cpp | 5 ++- src/misc/memory_allocator.cpp | 6 ++-- src/misc/types_struct.cpp | 30 +++++++++--------- src/misc/types_utils.cpp | 31 +++++++++++++++++++ src/wrappers/command_buffer.cpp | 4 +-- src/wrappers/device.cpp | 6 ++-- src/wrappers/fence.cpp | 4 +-- src/wrappers/image.cpp | 6 ++-- src/wrappers/memory_block.cpp | 8 ++--- src/wrappers/physical_device.cpp | 20 ++++++++++-- src/wrappers/render_pass.cpp | 2 +- 19 files changed, 126 insertions(+), 55 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 49a0903b..65e6cbc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,10 @@ endif() # Do not modify anything after this line, unless you know what you're doing. +if (NOT MSVC) + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG") +endif() + configure_file("include/config.h.in" "include/config.h") include_directories("${Anvil_BINARY_DIR}/include" diff --git a/include/misc/debug.h b/include/misc/debug.h index 0bd4d5ed..74c3d928 100644 --- a/include/misc/debug.h +++ b/include/misc/debug.h @@ -27,7 +27,7 @@ #include -#ifdef _DEBUG +#if defined(_DEBUG) #define anvil_assert(assertion) \ if (!(assertion)) \ { \ @@ -87,4 +87,4 @@ namespace Anvil void set_assertion_failure_handler(AssertionFailedCallbackFunction in_new_callback_func); }; -#endif /* MISC_DEBUG_H */ \ No newline at end of file +#endif /* MISC_DEBUG_H */ diff --git a/include/misc/external_handle.h b/include/misc/external_handle.h index 79d3d65a..2651a9fa 100644 --- a/include/misc/external_handle.h +++ b/include/misc/external_handle.h @@ -40,19 +40,20 @@ namespace Anvil return m_handle; } - #if defined(_WIN32) - /* If a payload of an object exported to a NT handle is imported to another object, the ownership is passed - * to the new object. - * - * For NT handles, it is assumed the handle should be destroyed when the wrapper goes out of scope. If the above - * import is performed, you MUST tell ExternalHandleWrapper to release the ownership of the handle, or else anything - * can happen. - */ - void release_ownership() - { - m_close_at_destruction_time = false; - } - #endif + /* If a payload of an object exported to a NT handle is imported to another object, the ownership is passed + * to the new object. + * + * For NT handles, it is assumed the handle should be destroyed when the wrapper goes out of scope. If the above + * import is performed, you MUST tell ExternalHandle to release the ownership of the handle, or else it will leak. + * + * Under Linux, ownership of the underlying FD is transferred to the app at export time, and back to the driver at import time. + * If the wrapper has been created with in_close_at_destruction_time set to true and an exported external handle IS imported, + * you need to call this function in order to avoid double release of the FD. + */ + void release_ownership() + { + m_close_at_destruction_time = false; + } private: ExternalHandle(const ExternalHandleType& in_handle, diff --git a/include/misc/types_classes.h b/include/misc/types_classes.h index b2fde088..9b5b7f87 100644 --- a/include/misc/types_classes.h +++ b/include/misc/types_classes.h @@ -374,6 +374,10 @@ namespace Anvil { memory_block_owned_by_image = false; memory_block_ptr = nullptr; + memory_block_start_offset = UINT32_MAX; + offset.x = 0; + offset.y = 0; + offset.z = 0; } } ImageBindInfo; diff --git a/include/misc/types_struct.h b/include/misc/types_struct.h index 99799776..ee815d0b 100644 --- a/include/misc/types_struct.h +++ b/include/misc/types_struct.h @@ -185,7 +185,7 @@ namespace Anvil static_assert(offsetof(SurfaceCapabilities, supported_usage_flags) == offsetof(VkSurfaceCapabilitiesKHR, supportedUsageFlags), "Member offsets must match"); /* NOTE: Maps 1:1 to VkImageSubresource */ - typedef struct + typedef struct ImageSubresource { Anvil::ImageAspectFlags aspect_mask; uint32_t mip_level; @@ -201,6 +201,13 @@ namespace Anvil return result; } + + ImageSubresource() + :array_layer(UINT32_MAX), + mip_level (UINT32_MAX) + { + /* Stub */ + } } ImageSubresource; static_assert(sizeof(ImageSubresource) == sizeof(VkImageSubresource), "Struct sizes much match"); diff --git a/include/misc/types_utils.h b/include/misc/types_utils.h index e0fa0af2..d8649428 100644 --- a/include/misc/types_utils.h +++ b/include/misc/types_utils.h @@ -31,6 +31,11 @@ namespace Anvil bool convert_mt_safety_enum_to_boolean(MTSafety in_mt_safety, const Anvil::BaseDevice* in_device_ptr); + /* NOTE: in_api_version must NOT be Anvil::APIVersion::UNKNOWN */ + void get_version_chunks_for_api_version(const Anvil::APIVersion& in_api_version, + uint32_t* out_major_version_ptr, + uint32_t* out_minor_version_ptr); + Anvil::QueueFamilyFlags get_queue_family_flags_from_queue_family_type(Anvil::QueueFamilyType in_queue_family_type); /** Converts a queue family bitfield value to an array of queue family indices. diff --git a/src/misc/base_pipeline_manager.cpp b/src/misc/base_pipeline_manager.cpp index c2bdf9aa..74c00f68 100644 --- a/src/misc/base_pipeline_manager.cpp +++ b/src/misc/base_pipeline_manager.cpp @@ -41,8 +41,8 @@ Anvil::BasePipelineManager::BasePipelineManager(const Anvil::BaseDevice* in_devi m_pipeline_cache_ptr (nullptr), m_pipeline_counter (0) { - anvil_assert(!in_use_pipeline_cache && in_pipeline_cache_to_reuse_ptr == nullptr || - in_use_pipeline_cache); + anvil_assert((!in_use_pipeline_cache && in_pipeline_cache_to_reuse_ptr == nullptr) || + in_use_pipeline_cache); m_pipeline_layout_manager_ptr = in_device_ptr->get_pipeline_layout_manager(); anvil_assert(m_pipeline_layout_manager_ptr != nullptr); diff --git a/src/misc/debug.cpp b/src/misc/debug.cpp index 7a3f1605..254e8826 100644 --- a/src/misc/debug.cpp +++ b/src/misc/debug.cpp @@ -75,4 +75,4 @@ void Anvil::on_assertion_failed(const char* in_filename, void Anvil::set_assertion_failure_handler(Anvil::AssertionFailedCallbackFunction in_new_callback_func) { g_anvil_assertion_check_failed_func = in_new_callback_func; -} \ No newline at end of file +} diff --git a/src/misc/memalloc_backends/backend_oneshot.cpp b/src/misc/memalloc_backends/backend_oneshot.cpp index ff8838a0..b28427df 100644 --- a/src/misc/memalloc_backends/backend_oneshot.cpp +++ b/src/misc/memalloc_backends/backend_oneshot.cpp @@ -330,7 +330,10 @@ bool Anvil::MemoryAllocatorBackends::OneShot::bake(Anvil::MemoryAllocator::Items (is_current_item_image && current_item_ptr->image_ptr->get_create_info_ptr()->get_tiling() == Anvil::ImageTiling::LINEAR); anvil_assert(current_item_ptr->alloc_exportable_external_handle_types == 0); - anvil_assert(current_item_ptr->alloc_external_nt_handle_info_ptr == nullptr); + + #if defined(_WIN32) + anvil_assert(current_item_ptr->alloc_external_nt_handle_info_ptr == nullptr); + #endif n_bytes_required = Anvil::Utils::round_up(n_bytes_required, current_item_ptr->alloc_memory_required_alignment); diff --git a/src/misc/memory_allocator.cpp b/src/misc/memory_allocator.cpp index a5b5b535..e638b32b 100644 --- a/src/misc/memory_allocator.cpp +++ b/src/misc/memory_allocator.cpp @@ -1205,9 +1205,9 @@ bool Anvil::MemoryAllocator::add_sparse_image_miptail(Anvil::Image* anvil_assert(result); /* Even more sanity checks */ - anvil_assert((aspect_props_ptr->flags & Anvil::SparseImageFormatFlagBits::SINGLE_MIPTAIL_BIT) != 0 && - in_n_layer == 0 || - (aspect_props_ptr->flags & Anvil::SparseImageFormatFlagBits::SINGLE_MIPTAIL_BIT) == 0); + anvil_assert(((aspect_props_ptr->flags & Anvil::SparseImageFormatFlagBits::SINGLE_MIPTAIL_BIT) != 0 && + in_n_layer == 0) || + ((aspect_props_ptr->flags & Anvil::SparseImageFormatFlagBits::SINGLE_MIPTAIL_BIT) == 0)); /* Determine allocation properties */ miptail_memory_types = in_image_ptr->get_image_memory_types(n_plane); diff --git a/src/misc/types_struct.cpp b/src/misc/types_struct.cpp index bffa7257..b4acfc4f 100644 --- a/src/misc/types_struct.cpp +++ b/src/misc/types_struct.cpp @@ -4121,16 +4121,16 @@ Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_buff #endif dst_stage_wait_masks (in_n_semaphores_to_wait_on), fence_ptr (in_opt_fence_ptr), - is_protected (false), #if defined(_WIN32) - keyed_mutex_n_acquire_keys (0), - keyed_mutex_acquire_d3d11_memory_block_ptrs_ptr(nullptr), - keyed_mutex_acquire_mutex_key_value_ptrs (nullptr), - keyed_mutex_acquire_timeout_ptrs (nullptr), - keyed_mutex_n_release_keys (0), - keyed_mutex_release_d3d11_memory_block_ptrs_ptr(nullptr), - keyed_mutex_release_mutex_key_value_ptrs (nullptr), + keyed_mutex_n_acquire_keys (0), + keyed_mutex_acquire_d3d11_memory_block_ptrs_ptr(nullptr), + keyed_mutex_acquire_mutex_key_value_ptrs (nullptr), + keyed_mutex_acquire_timeout_ptrs (nullptr), + keyed_mutex_n_release_keys (0), + keyed_mutex_release_d3d11_memory_block_ptrs_ptr(nullptr), + keyed_mutex_release_mutex_key_value_ptrs (nullptr), #endif + is_protected (false), n_command_buffers (in_n_command_buffers), n_signal_semaphores (in_n_semaphores_to_signal), n_wait_semaphores (in_n_semaphores_to_wait_on), @@ -4188,13 +4188,13 @@ Anvil::SubmitInfo::SubmitInfo(uint32_t in_n_command_bu fence_ptr (in_opt_fence_ptr), is_protected (false), #if defined(_WIN32) - keyed_mutex_n_acquire_keys (0), - keyed_mutex_acquire_d3d11_memory_block_ptrs_ptr(nullptr), - keyed_mutex_acquire_mutex_key_value_ptrs (nullptr), - keyed_mutex_acquire_timeout_ptrs (nullptr), - keyed_mutex_n_release_keys (0), - keyed_mutex_release_d3d11_memory_block_ptrs_ptr(nullptr), - keyed_mutex_release_mutex_key_value_ptrs (nullptr), + keyed_mutex_n_acquire_keys (0), + keyed_mutex_acquire_d3d11_memory_block_ptrs_ptr(nullptr), + keyed_mutex_acquire_mutex_key_value_ptrs (nullptr), + keyed_mutex_acquire_timeout_ptrs (nullptr), + keyed_mutex_n_release_keys (0), + keyed_mutex_release_d3d11_memory_block_ptrs_ptr(nullptr), + keyed_mutex_release_mutex_key_value_ptrs (nullptr), #endif n_command_buffers (in_n_command_buffer_submissions), n_signal_semaphores (in_n_signal_semaphore_submissions), diff --git a/src/misc/types_utils.cpp b/src/misc/types_utils.cpp index e1bd9446..9617c4fd 100644 --- a/src/misc/types_utils.cpp +++ b/src/misc/types_utils.cpp @@ -23,6 +23,37 @@ #include "wrappers/buffer.h" #include "wrappers/device.h" +/** Please see header for specification */ +void Anvil::Utils::get_version_chunks_for_api_version(const Anvil::APIVersion& in_api_version, + uint32_t* out_major_version_ptr, + uint32_t* out_minor_version_ptr) +{ + switch (in_api_version) + { + case Anvil::APIVersion::_1_0: + { + *out_major_version_ptr = 1; + *out_minor_version_ptr = 0; + + break; + } + + case Anvil::APIVersion::_1_1: + { + *out_major_version_ptr = 1; + *out_minor_version_ptr = 1; + + break; + } + + default: + { + /* in_api_version must NOT be Anvil::APIVersion::UNKNOWN! */ + anvil_assert_fail(); + } + } +} + /** Please see header for specification */ Anvil::MemoryFeatureFlags Anvil::Utils::get_memory_feature_flags_from_vk_property_flags(Anvil::MemoryPropertyFlags in_mem_type_flags, Anvil::MemoryHeapFlags in_mem_heap_flags) diff --git a/src/wrappers/command_buffer.cpp b/src/wrappers/command_buffer.cpp index 8c9dc323..641267e5 100644 --- a/src/wrappers/command_buffer.cpp +++ b/src/wrappers/command_buffer.cpp @@ -3203,7 +3203,7 @@ bool Anvil::CommandBufferBase::record_pipeline_barrier(Anvil::PipelineStageFlags } anvil_assert((!m_is_renderpass_active) || - ( m_is_renderpass_active) && (in_dependency_flags & Anvil::DependencyFlagBits::VIEW_LOCAL_BIT) == 0); + ((m_is_renderpass_active) && (in_dependency_flags & Anvil::DependencyFlagBits::VIEW_LOCAL_BIT) == 0)); #ifdef STORE_COMMAND_BUFFER_COMMANDS { @@ -4583,7 +4583,7 @@ bool Anvil::PrimaryCommandBuffer::record_begin_render_pass_internal(const bool& { auto chain_ptr = render_pass_begin_info_chain.create_chain(); - if (in_use_khr_create_rp2_extension) + if (!in_use_khr_create_rp2_extension) { Anvil::Vulkan::vkCmdBeginRenderPass(m_command_buffer, chain_ptr->get_root_struct(), diff --git a/src/wrappers/device.cpp b/src/wrappers/device.cpp index bdf092d5..b1b383e4 100644 --- a/src/wrappers/device.cpp +++ b/src/wrappers/device.cpp @@ -1474,8 +1474,8 @@ bool Anvil::BaseDevice::init_extension_func_ptrs() m_khr_external_memory_fd_extension_entrypoints.vkGetMemoryFdKHR = reinterpret_cast (get_proc_address("vkGetMemoryFdKHR")); m_khr_external_memory_fd_extension_entrypoints.vkGetMemoryFdPropertiesKHR = reinterpret_cast(get_proc_address("vkGetMemoryFdPropertiesKHR")); - anvil_assert(m_khr_external_memory_win32_extension_entrypoints.vkGetMemoryFdKHR != nullptr); - anvil_assert(m_khr_external_memory_win32_extension_entrypoints.vkGetMemoryFdPropertiesKHR != nullptr); + anvil_assert(m_khr_external_memory_fd_extension_entrypoints.vkGetMemoryFdKHR != nullptr); + anvil_assert(m_khr_external_memory_fd_extension_entrypoints.vkGetMemoryFdPropertiesKHR != nullptr); } if (m_extension_enabled_info_ptr->get_device_extension_info()->khr_external_semaphore_fd() ) @@ -2115,7 +2115,7 @@ void Anvil::MGPUDevice::init_device() auto& physical_device_props = m_parent_physical_devices.at(n_physical_device); anvil_assert( present_caps.presentMask[n_physical_device] == 0 || - present_caps.presentMask[n_physical_device] != 0 && (present_caps.presentMask[n_physical_device] & (1 << n_physical_device) ) != 0); + (present_caps.presentMask[n_physical_device] != 0 && (present_caps.presentMask[n_physical_device] & (1 << n_physical_device) ) != 0)); for (uint32_t n_sub_physical_device = 0; n_sub_physical_device < static_cast(m_parent_physical_devices.size() ); diff --git a/src/wrappers/fence.cpp b/src/wrappers/fence.cpp index afef3c26..898609c2 100644 --- a/src/wrappers/fence.cpp +++ b/src/wrappers/fence.cpp @@ -424,8 +424,8 @@ bool Anvil::Fence::reset_fences(const uint32_t in_n_fences, { Anvil::Fence& current_fence = in_fences[n_fence_batch * fence_cache_capacity + n_fence]; - anvil_assert(device_ptr == nullptr || - device_ptr != nullptr && current_fence.m_device_ptr != nullptr); + anvil_assert((device_ptr == nullptr) || + (device_ptr != nullptr && current_fence.m_device_ptr != nullptr) ); device_ptr = current_fence.m_device_ptr; fence_cache[n_fence] = current_fence.m_fence; diff --git a/src/wrappers/image.cpp b/src/wrappers/image.cpp index b1b9a661..1583e970 100644 --- a/src/wrappers/image.cpp +++ b/src/wrappers/image.cpp @@ -1518,8 +1518,8 @@ bool Anvil::Image::has_aspects(const Anvil::ImageAspectFlags& in_aspects) const } } - anvil_assert(!result || - result && checked_aspects == in_aspects); + anvil_assert( !result || + ( result && checked_aspects == in_aspects)); } return result; @@ -2638,4 +2638,4 @@ void Anvil::Image::upload_mipmaps(const std::vector* in_mipmaps_p ); } } -} \ No newline at end of file +} diff --git a/src/wrappers/memory_block.cpp b/src/wrappers/memory_block.cpp index aab2876f..6616aa87 100644 --- a/src/wrappers/memory_block.cpp +++ b/src/wrappers/memory_block.cpp @@ -305,7 +305,7 @@ Anvil::ExternalHandleUniquePtr Anvil::MemoryBlock::export_to_external_memory_han else { result_returned_ptr = Anvil::ExternalHandle::create(result_handle, - false); /* in_close_at_destruction_time */ + is_autorelease_handle); /* in_close_at_destruction_time */ } anvil_assert(result_returned_ptr != nullptr); @@ -464,7 +464,7 @@ bool Anvil::MemoryBlock::init(VkResult* out_opt_result) VkImportMemoryHostPointerInfoEXT handle_info_khr; anvil_assert(handle_import_info_ptr->host_ptr != nullptr); - anvil_assert(handle_import_info_ptr->handle == static_cast(nullptr) ); + anvil_assert(handle_import_info_ptr->handle == 0); handle_info_khr.handleType = static_cast(imported_external_memory_handle_type); handle_info_khr.pHostPointer = handle_import_info_ptr->host_ptr; @@ -490,7 +490,7 @@ bool Anvil::MemoryBlock::init(VkResult* out_opt_result) } #else { - anvil_assert(handle_import_info_ptr->handle != static_cast(nullptr) ); + anvil_assert(handle_import_info_ptr->handle != 0); } #endif @@ -883,4 +883,4 @@ bool Anvil::MemoryBlock::write(VkDeviceSize in_start_offset, end: return result; -} \ No newline at end of file +} diff --git a/src/wrappers/physical_device.cpp b/src/wrappers/physical_device.cpp index 664a06e0..c5911ffc 100644 --- a/src/wrappers/physical_device.cpp +++ b/src/wrappers/physical_device.cpp @@ -1638,8 +1638,24 @@ bool Anvil::PhysicalDevice::supports_core_vk1_1() const /* Please see header for specification */ bool Anvil::PhysicalDevice::supports_core_vk1_1(const uint32_t& in_api_version) const { - const auto vk_major_version = VK_VERSION_MAJOR(in_api_version); - const auto vk_minor_version = VK_VERSION_MINOR(in_api_version); + auto vk_major_version = VK_VERSION_MAJOR(in_api_version); + auto vk_minor_version = VK_VERSION_MINOR(in_api_version); + + /* Make sure to clamp the version in case API version used to create the parent instance is lower! */ + const auto instance_api_version = m_instance_ptr->get_api_version(); + uint32_t instance_major_version = 0; + uint32_t instance_minor_version = 0; + + Anvil::Utils::get_version_chunks_for_api_version(instance_api_version, + &instance_major_version, + &instance_minor_version); + + if ( instance_major_version < vk_major_version || + (instance_major_version == vk_major_version && instance_minor_version < vk_minor_version)) + { + vk_major_version = instance_major_version; + vk_minor_version = instance_minor_version; + } return (vk_major_version >= 2) || (vk_major_version == 1 && vk_minor_version >= 1); diff --git a/src/wrappers/render_pass.cpp b/src/wrappers/render_pass.cpp index 88b02f89..d0f1ec7f 100644 --- a/src/wrappers/render_pass.cpp +++ b/src/wrappers/render_pass.cpp @@ -278,7 +278,7 @@ bool Anvil::RenderPass::init_using_core_vk10() } /* NOTE: DS resolve operations are only accessible via KHR_depth_stencil_resolve + KHR_create_renderpass2. */ - anvil_assert( (*subpass_iterator)->depth_stencil_attachment.resolve_attachment_index != UINT32_MAX); + anvil_assert( (*subpass_iterator)->depth_stencil_attachment.resolve_attachment_index == UINT32_MAX); /* Determine the highest color attachment location & input attachment index. */ for (auto subpass_color_attachment_iterator = (*subpass_iterator)->color_attachments_map.cbegin(); From e58043916c400844aa0ae30a6390695c5592d9bc Mon Sep 17 00:00:00 2001 From: Dominik Witczak Date: Thu, 4 Apr 2019 09:42:46 +0200 Subject: [PATCH 49/50] Bug-fixes and improvements. Fix #134: Assertion failure when using specialization constants Address #18: Add CMake option to use alternative glslang snapshot Address #75: Replace in_releaseable_sets wioth descriptor pool create flags in DescriptorSetGroup::create() Address #104: Pipeline cache to use for a particular device can now be specified in DeviceCreateInfo. Address #59: Change add_vertex_attribute() to add_vertex_binding() --- CMakeLists.txt | 18 ++- examples/DynamicBuffers/src/app.cpp | 23 +-- examples/MultiViewport/src/app.cpp | 89 +++++++---- examples/OcclusionQuery/src/app.cpp | 9 +- examples/OutOfOrderRasterization/src/app.cpp | 36 +++-- examples/PushConstants/src/app.cpp | 55 +++++-- include/misc/device_create_info.h | 17 +- include/misc/glsl_to_spirv.h | 2 +- include/misc/graphics_pipeline_create_info.h | 154 ++++++++----------- include/misc/struct_chainer.h | 103 ++++++++++--- include/misc/types_struct.h | 25 +++ include/wrappers/descriptor_set_group.h | 34 ++-- include/wrappers/graphics_pipeline_manager.h | 1 - src/misc/graphics_pipeline_create_info.cpp | 132 ++++++++-------- src/misc/types_struct.cpp | 20 --- src/wrappers/buffer.cpp | 2 +- src/wrappers/descriptor_set_group.cpp | 53 +++---- src/wrappers/descriptor_set_layout.cpp | 2 +- src/wrappers/device.cpp | 22 ++- src/wrappers/graphics_pipeline_manager.cpp | 145 +++++++---------- src/wrappers/image.cpp | 4 +- src/wrappers/physical_device.cpp | 142 ++++++++--------- 22 files changed, 591 insertions(+), 497 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 65e6cbc8..a2ae848c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,15 +6,22 @@ option(ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT "Includes XCB window system s option(ANVIL_LINK_EXAMPLES "Build examples showing how to use Anvil" OFF) option(ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB "Link statically with Vulkan loader. If disabled, Anvil will load the func ptrs from ANVIL_VULKAN_DYNAMIC_DLL_DEPENDENCY at VK instance creation time" ON) option(ANVIL_LINK_WITH_GLSLANG "Links with glslang, instead of spawning a new process whenever GLSL->SPIR-V conversion is required" ON) +option(ANVIL_USE_BUILT_IN_GLSLANG "Use glslang version included with Anvil. If disabled, Anvil will assume ANVIL_GLSLANG_PATH holds path to library's root directory." ON) option(ANVIL_USE_BUILT_IN_VULKAN_HEADERS "Use built-in Vulkan headers. If disabled, VK_SDK_PATH and VULKAN_SDK env vars will be assumed to hold the location where the headers can be found." ON) - if (MSVC) set (DEFAULT_DYNAMIC_VK_DLL "vulkan-1.dll") else() set (DEFAULT_DYNAMIC_VK_DLL "libvulkan.so") endif() +if (ANVIL_USE_BUILT_IN_GLSLANG) + set(ANVIL_GLSLANG_PATH "${Anvil_SOURCE_DIR}/deps/glslang") +else() + set(ANVIL_GLSLANG_PATH "${Anvil_SOURCE_DIR}/deps/glslang" + CACHE STRING "Path to glslang directory") +endif() + if (NOT ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB) set(ANVIL_VULKAN_DYNAMIC_DLL "${DEFAULT_DYNAMIC_VK_DLL}" CACHE STRING "DLL to load Vulkan entrypoints from at Vulkan instance creation time. Only used if ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB is disabled. Only occurs at first Vulkan instance creation time") @@ -31,6 +38,7 @@ configure_file("include/config.h.in" "include/config.h") include_directories("${Anvil_BINARY_DIR}/include" "${Anvil_SOURCE_DIR}" "${Anvil_SOURCE_DIR}/deps" + "${ANVIL_GLSLANG_PATH}" "${Anvil_SOURCE_DIR}/include") # Include the Vulkan header. @@ -261,7 +269,7 @@ if (WIN32) target_link_libraries(Anvil glslang OGLCompiler OSDependent SPIRV ${VULKAN_LIBRARY}) else() target_link_libraries(Anvil ${VULKAN_LIBRARY}) -endif() + endif() else() if (ANVIL_LINK_WITH_GLSLANG) target_link_libraries(Anvil glslang OGLCompiler OSDependent SPIRV ${VULKAN_LIBRARY} pthread) @@ -281,11 +289,7 @@ if (ANVIL_LINK_WITH_GLSLANG) set(ENABLE_HLSL OFF CACHE BOOL ".." FORCE) set(ENABLE_OPT OFF CACHE BOOL ".." FORCE) - if (WIN32) - add_subdirectory("deps\\glslang") - else() - add_subdirectory("deps/glslang") - endif() + add_subdirectory("${ANVIL_GLSLANG_PATH}") endif() if (ANVIL_LINK_EXAMPLES) diff --git a/examples/DynamicBuffers/src/app.cpp b/examples/DynamicBuffers/src/app.cpp index a650e7b8..0a862fe4 100644 --- a/examples/DynamicBuffers/src/app.cpp +++ b/examples/DynamicBuffers/src/app.cpp @@ -880,8 +880,7 @@ void App::init_dsgs() /* Create the descriptor set layouts for the generator program. */ m_producer_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), - producer_dsg_create_info_ptrs, - false); /* releaseable_sets */ + producer_dsg_create_info_ptrs); m_producer_dsg_ptr->set_binding_item(0, /* n_set */ @@ -902,8 +901,7 @@ void App::init_dsgs() /* Set up the descriptor set layout for the renderer program. */ m_consumer_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), - consumer_dsg_create_info_ptrs, - false); /* releaseable_sets */ + consumer_dsg_create_info_ptrs); m_consumer_dsg_ptr->set_binding_item(0, /* n_set */ @@ -1019,11 +1017,18 @@ void App::init_gfx_pipelines() Anvil::ShaderModuleStageEntryPoint(), /* tess_evaluation_shader */ *m_consumer_vs_ptr); - consumer_pipeline_info_ptr->add_vertex_attribute (0, /* location */ - Anvil::Format::R8G8_UNORM, - 0, /* offset_in_bytes */ - sizeof(char) * 2, /* stride_in_bytes */ - Anvil::VertexInputRate::INSTANCE); + { + Anvil::VertexInputAttribute attribute(0, /* in_location */ + Anvil::Format::R8G8_UNORM, + 0); /* in_offset_in_bytes */ + + consumer_pipeline_info_ptr->add_vertex_binding(0, /* in_binding */ + Anvil::VertexInputRate::INSTANCE, + sizeof(char) * 2, /* in_stride_in_bytes */ + 1, /* in_attribute_ptrs */ + &attribute); + } + consumer_pipeline_info_ptr->set_descriptor_set_create_info(m_consumer_dsg_ptr->get_descriptor_set_create_info() ); consumer_pipeline_info_ptr->set_primitive_topology (Anvil::PrimitiveTopology::LINE_STRIP); consumer_pipeline_info_ptr->set_rasterization_properties (Anvil::PolygonMode::FILL, diff --git a/examples/MultiViewport/src/app.cpp b/examples/MultiViewport/src/app.cpp index 11dfa207..6c89c745 100644 --- a/examples/MultiViewport/src/app.cpp +++ b/examples/MultiViewport/src/app.cpp @@ -736,36 +736,65 @@ void App::init_gfx_pipelines() Anvil::DynamicState::VIEWPORT); gfx_pipeline_create_info_ptr->toggle_primitive_restart (true /* should_enable */); - gfx_pipeline_create_info_ptr->add_vertex_attribute(g_vertex_attribute_location, - mesh_vertex_data_format, - 0, /* offset_in_bytes */ - sizeof(float) * n_mesh_vertex_components, /* stride_in_bytes */ - Anvil::VertexInputRate::VERTEX, - g_vertex_attribute_binding); - gfx_pipeline_create_info_ptr->add_vertex_attribute(g_color1_attribute_location, - mesh_color_data_format, - 0, /* offset_in_bytes */ - sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ - Anvil::VertexInputRate::VERTEX, - g_color1_attribute_binding); - gfx_pipeline_create_info_ptr->add_vertex_attribute(g_color2_attribute_location, - mesh_color_data_format, - 0, /* offset_in_bytes */ - sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ - Anvil::VertexInputRate::VERTEX, - g_color2_attribute_binding); - gfx_pipeline_create_info_ptr->add_vertex_attribute(g_color3_attribute_location, - mesh_color_data_format, - 0, /* offset_in_bytes */ - sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ - Anvil::VertexInputRate::VERTEX, - g_color3_attribute_binding); - gfx_pipeline_create_info_ptr->add_vertex_attribute(g_color4_attribute_location, - mesh_color_data_format, - 0, /* offset_in_bytes */ - sizeof(float) * n_mesh_color_components, /* stride_in_bytes */ - Anvil::VertexInputRate::VERTEX, - g_color4_attribute_binding); + { + Anvil::VertexInputAttribute attribute(g_vertex_attribute_location, + mesh_vertex_data_format, + 0); /* in_offset_in_bytes */ + + gfx_pipeline_create_info_ptr->add_vertex_binding(g_vertex_attribute_binding, + Anvil::VertexInputRate::VERTEX, + sizeof(float) * n_mesh_vertex_components, /* in_stride_in_bytes */ + 1, /* in_n_attributes */ + &attribute); + } + + { + Anvil::VertexInputAttribute attribute(g_color1_attribute_location, + mesh_color_data_format, + 0); /* in_offset_in_bytes */ + + gfx_pipeline_create_info_ptr->add_vertex_binding(g_color1_attribute_binding, + Anvil::VertexInputRate::VERTEX, + sizeof(float) * n_mesh_color_components, /* in_stride_in_bytes */ + 1, /* in_n_attributes */ + &attribute); + } + + { + Anvil::VertexInputAttribute attribute(g_color2_attribute_location, + mesh_color_data_format, + 0); /* in_offset_in_bytes */ + + gfx_pipeline_create_info_ptr->add_vertex_binding(g_color2_attribute_binding, + Anvil::VertexInputRate::VERTEX, + sizeof(float) * n_mesh_color_components, /* in_stride_in_bytes */ + 1, /* in_n_attributes */ + &attribute); + } + + { + Anvil::VertexInputAttribute attribute(g_color3_attribute_location, + mesh_color_data_format, + 0); /* in_offset_in_bytes */ + + gfx_pipeline_create_info_ptr->add_vertex_binding(g_color3_attribute_binding, + Anvil::VertexInputRate::VERTEX, + sizeof(float) * n_mesh_color_components, /* in_stride_in_bytes */ + 1, /* in_n_attributes */ + &attribute); + } + + { + Anvil::VertexInputAttribute attribute(g_color4_attribute_location, + mesh_color_data_format, + 0); /* in_offset_in_bytes */ + + gfx_pipeline_create_info_ptr->add_vertex_binding(g_color4_attribute_binding, + Anvil::VertexInputRate::VERTEX, + sizeof(float) * n_mesh_color_components, /* in_stride_in_bytes */ + 1, /* in_n_attributes */ + &attribute); + } for (uint32_t n_scissor_box = 0; n_scissor_box < sizeof(scissors) / sizeof(scissors[0]); diff --git a/examples/OcclusionQuery/src/app.cpp b/examples/OcclusionQuery/src/app.cpp index b641ee5d..8cd1d4b6 100644 --- a/examples/OcclusionQuery/src/app.cpp +++ b/examples/OcclusionQuery/src/app.cpp @@ -627,14 +627,11 @@ void App::init_dsgs() Anvil::ShaderStageFlagBits::VERTEX_BIT); m_1stpass_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), - dsg_1stpass_create_info_ptrs, - false); /* in_releaseable_sets */ + dsg_1stpass_create_info_ptrs); m_2ndpass_tri_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), - tri_dsg_2ndpass_create_info_ptrs, - false); /* in_releaseable_sets */ + tri_dsg_2ndpass_create_info_ptrs); m_2ndpass_quad_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), - quad_dsg_2ndpass_create_info_ptrs, - false); /* in_releaseable_sets */ + quad_dsg_2ndpass_create_info_ptrs); m_1stpass_dsg_ptr->set_binding_item (0, /* n_set */ 0, /* binding_index */ diff --git a/examples/OutOfOrderRasterization/src/app.cpp b/examples/OutOfOrderRasterization/src/app.cpp index c7309553..53ce8724 100644 --- a/examples/OutOfOrderRasterization/src/app.cpp +++ b/examples/OutOfOrderRasterization/src/app.cpp @@ -1441,8 +1441,7 @@ void App::init_dsgs() Anvil::ShaderStageFlagBits::VERTEX_BIT); new_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), - new_dsg_create_info_ptr, - false); /* in_releaseable_sets */ + new_dsg_create_info_ptr); } new_dsg_ptr->set_binding_item(0, /* n_set */ @@ -1482,11 +1481,17 @@ void App::init_gfx_pipelines() Anvil::ShaderModuleStageEntryPoint(), /* in_te_entrypoint */ *m_vs_entrypoint_ptr); - pipeline_create_info_ptr->add_vertex_attribute(0, /* location */ - Anvil::Format::R32G32B32_SFLOAT, - 0, /* offset_in_bytes */ - sizeof(float) * 3, /* stride_in_bytes */ - Anvil::VertexInputRate::VERTEX); + { + auto attribute = Anvil::VertexInputAttribute(0, /* location */ + Anvil::Format::R32G32B32_SFLOAT, + 0); /* offset_in_bytes */ + + pipeline_create_info_ptr->add_vertex_binding(0, /* in_binding */ + Anvil::VertexInputRate::VERTEX, + sizeof(float) * 3, /* in_stride_in_bytes */ + 1, /* in_n_attributes */ + &attribute); + } pipeline_create_info_ptr->set_descriptor_set_create_info(m_dsg_ptrs[0]->get_descriptor_set_create_info() ); @@ -1708,11 +1713,18 @@ void App::init_renderpasses() Anvil::ShaderModuleStageEntryPoint(), /* in_te_entrypoint */ *m_vs_entrypoint_ptr); - gfx_pipeline_create_info_ptr->add_vertex_attribute (0, /* location */ - Anvil::Format::R32G32B32_SFLOAT, - 0, /* offset_in_bytes */ - sizeof(float) * 3, /* stride_in_bytes */ - Anvil::VertexInputRate::VERTEX); + { + auto attribute = Anvil::VertexInputAttribute(0, /* location */ + Anvil::Format::R32G32B32_SFLOAT, + 0); /* offset_in_bytes */ + + gfx_pipeline_create_info_ptr->add_vertex_binding(0, /* in_binding */ + Anvil::VertexInputRate::VERTEX, + sizeof(float) * 3, /* stride_in_bytes */ + 1, /* in_n_attributes */ + &attribute); + } + gfx_pipeline_create_info_ptr->set_descriptor_set_create_info(m_dsg_ptrs[0]->get_descriptor_set_create_info() ); gfx_manager_ptr->add_pipeline(std::move(gfx_pipeline_create_info_ptr), diff --git a/examples/PushConstants/src/app.cpp b/examples/PushConstants/src/app.cpp index 8740a43e..4ee6eaea 100644 --- a/examples/PushConstants/src/app.cpp +++ b/examples/PushConstants/src/app.cpp @@ -585,10 +585,23 @@ void App::init_command_buffers() 1, /* dynamicOffsetCount */ &data_ub_offset); /* pDynamicOffsets */ - cmd_buffer_ptr->record_bind_vertex_buffers(0, /* startBinding */ - 1, /* bindingCount */ - &mesh_data_buffer_raw_ptr, - &mesh_data_buffer_offset); + { + Anvil::Buffer* buffer_raw_ptrs[] = + { + mesh_data_buffer_raw_ptr, + mesh_data_buffer_raw_ptr + }; + const VkDeviceSize buffer_offsets[] = + { + mesh_data_buffer_offset, + mesh_data_buffer_offset + }; + + cmd_buffer_ptr->record_bind_vertex_buffers(0, /* start_binding */ + 2, /* binding_count */ + buffer_raw_ptrs, + buffer_offsets); + } cmd_buffer_ptr->record_draw(3, /* in_vertex_count */ N_TRIANGLES, /* in_instance_count */ @@ -617,8 +630,7 @@ void App::init_dsgs() Anvil::ShaderStageFlagBits::VERTEX_BIT); m_dsg_ptr = Anvil::DescriptorSetGroup::create(m_device_ptr.get(), - dsg_create_info_ptrs, - false); /* releaseable_sets */ + dsg_create_info_ptrs); } m_dsg_ptr->set_binding_item(0, /* n_set */ @@ -734,17 +746,26 @@ void App::init_gfx_pipelines() Anvil::BlendFactor::ONE_MINUS_SRC_ALPHA, Anvil::ColorComponentFlagBits::A_BIT | Anvil::ColorComponentFlagBits::B_BIT | Anvil::ColorComponentFlagBits::G_BIT | Anvil::ColorComponentFlagBits::R_BIT); - gfx_pipeline_create_info_ptr->add_vertex_attribute(0, /* in_location */ - get_mesh_data_position_format(), - get_mesh_data_position_start_offset(), - get_mesh_data_position_stride(), - Anvil::VertexInputRate::VERTEX); - gfx_pipeline_create_info_ptr->add_vertex_attribute(1, /* location */ - get_mesh_data_color_format (), - get_mesh_data_color_start_offset(), - get_mesh_data_color_stride (), - Anvil::VertexInputRate::VERTEX); - + { + const auto color_attribute = Anvil::VertexInputAttribute(1, /* location */ + get_mesh_data_color_format (), + get_mesh_data_color_start_offset() ); + const auto position_attribute = Anvil::VertexInputAttribute(0, /* in_location */ + get_mesh_data_position_format (), + get_mesh_data_position_start_offset() ); + + gfx_pipeline_create_info_ptr->add_vertex_binding(0, /* in_binding */ + Anvil::VertexInputRate::VERTEX, + get_mesh_data_position_stride(), + 1, /* in_n_attributes */ + &position_attribute); + + gfx_pipeline_create_info_ptr->add_vertex_binding(1, /* in_binding */ + Anvil::VertexInputRate::VERTEX, + get_mesh_data_color_stride(), + 1, /* in_n_attributes */ + &color_attribute); + } gfx_pipeline_manager_ptr->add_pipeline(std::move(gfx_pipeline_create_info_ptr), &m_pipeline_id); diff --git a/include/misc/device_create_info.h b/include/misc/device_create_info.h index a274a1ef..1ac35092 100644 --- a/include/misc/device_create_info.h +++ b/include/misc/device_create_info.h @@ -38,8 +38,9 @@ namespace Anvil * Anvil creates one command pool per each queue family which apps can use at any time which is why the CommandPoolCreateFlags argument * is present. * - * By default, the device will be created with API version equal to min(instance-level API version, physical device API version}. - * This can be overridden by calling set_api_version(). + * NOTE: By default, an empty pipeline cache will be created for pipeline manager usage. You can adjust this behavior, allowing for + * pipeline cache reuse across executions, by calling set_pipeline_cache_ptr() and retrieving pipeline cache data and caching it + * at later time. * * NOTE: If VK_EXT_global_queue_priority is supported, all queues are associated MEDIUM_EXT global priority by default. * This can be changed on a per-queue basis by calling set_queue_global_priority() prior to passing the structure @@ -102,6 +103,11 @@ namespace Anvil return m_physical_device_ptrs; } + Anvil::PipelineCache* get_pipeline_cache_ptr() const + { + return m_pipeline_cache_ptr.get(); + } + Anvil::QueueGlobalPriority get_queue_global_priority(const uint32_t& in_queue_family_index, const uint32_t& in_queue_index) const { @@ -186,6 +192,12 @@ namespace Anvil m_queue_properties[in_queue_family_index][in_queue_index].global_priority = in_queue_global_priority; } + /* Caches user-specified pipeline cache for usage with pipeline managers. */ + void set_pipeline_cache_ptr(Anvil::PipelineCacheUniquePtr in_pipeline_cache_ptr) + { + m_pipeline_cache_ptr = std::move(in_pipeline_cache_ptr); + } + /* Associates priority with a given pair. * * By default, all queues will be associated a priority of 0.0. @@ -264,6 +276,7 @@ namespace Anvil Anvil::MemoryOverallocationBehavior m_memory_overallocation_behavior; bool m_mt_safe; std::vector m_physical_device_ptrs; + Anvil::PipelineCacheUniquePtr m_pipeline_cache_ptr; std::unordered_map > m_queue_properties; bool m_should_enable_shader_module_cache; diff --git a/include/misc/glsl_to_spirv.h b/include/misc/glsl_to_spirv.h index 29d9aa05..6c2f9544 100644 --- a/include/misc/glsl_to_spirv.h +++ b/include/misc/glsl_to_spirv.h @@ -44,7 +44,7 @@ #pragma warning(disable: 4464) #endif - #include "../../deps/glslang/glslang/Public/ShaderLang.h" + #include "glslang/Public/ShaderLang.h" #ifdef _MSC_VER #pragma warning(pop) diff --git a/include/misc/graphics_pipeline_create_info.h b/include/misc/graphics_pipeline_create_info.h index b58b294a..fa693789 100644 --- a/include/misc/graphics_pipeline_create_info.h +++ b/include/misc/graphics_pipeline_create_info.h @@ -132,37 +132,28 @@ namespace Anvil in_data_ptr); } - /** Adds a new vertex attribute descriptor to the specified graphics pipeline. This data will be used - * at baking time to configure input vertex attribute & bindings for the Vulkan pipeline object. + /** Adds a new vertex binding descriptor to the specified graphics pipeline, along with one or more attributes + * that consume the binding. This data will be used at baking time to configure input vertex attribute & bindings + * for the Vulkan pipeline object. * - * By default, Anvil only assigns a unique binding to those vertex attributes, whose characteristics - * are unique (ie. whose divisor & input rate & stride match). This works well for most of the use cases, the - * only exception being when you need to associate a unique offset to a specific vertex binding. In - * this case, you need to set @param in_explicit_binding_index to an index, under which your exclusive - * binding is going to be stored. - * When preparing the binding array, Anvil will not reuse user-specified "explicit" bindings for - * attributes, for which "explicit" bindings have not been requested, even if their properties match. - * - * - * @param in_location Vertex attribute location - * @param in_format Vertex attribute format. - * @param in_offset_in_bytes Start offset of the vertex attribute data. + * @param in_binding Index to use for the new binding. * @param in_stride_in_bytes Stride of the vertex attribute data. * @param in_step_rate Step rate to use for the vertex attribute data. - * @param in_explicit_binding_index Please see general description of the function for more details. - * @param in_divisor Divisor to use for the attribute. Please read EXT_vertex_attribute_divisor - * for more details. Only set to values different than 1 if the extension - * is reported as supported. + * @param in_n_attributes Number of items available for reading under @param in_attribute_ptrs. Must be + * at least 1. + * @param in_attribute_ptrs Vertex attributes to associate with the new bindings. + * @param in_divisor Vertex attribute divisor to use for the binding. Any value different than 1 + * is only supported for devices with VK_EXT_vertex_attribute_divisor extension + * enabled. * * @return true if successful, false otherwise. **/ - bool add_vertex_attribute(uint32_t in_location, - Anvil::Format in_format, - uint32_t in_offset_in_bytes, - uint32_t in_stride_in_bytes, - Anvil::VertexInputRate in_step_rate, - uint32_t in_explicit_binding_index = UINT32_MAX, - uint32_t in_divisor = 1); + bool add_vertex_binding(uint32_t in_binding, + Anvil::VertexInputRate in_step_rate, + uint32_t in_stride_in_bytes, + const uint32_t& in_n_attributes, + const Anvil::VertexInputAttribute* in_attribute_ptrs, + uint32_t in_divisor = 1); /** Tells whether depth writes have been enabled. **/ bool are_depth_writes_enabled() const; @@ -257,22 +248,22 @@ namespace Anvil /** Retrieves general properties. * - * @param out_opt_n_scissors_ptr If not null, deref will be set to the number of scissors used - * by the pipeline. - * @param out_opt_n_viewports_ptr If not null, deref will be set to the number of viewports used - * by the pipeline. - * @param out_opt_n_vertex_attributes_ptr If not null, deref will be set to the number of vertex - * attributes specified by the owner. - * @param out_opt_renderpass_ptr_ptr If not null, deref will be set to the renderpass assigned to - * the pipeline. - * @param out_opt_subpass_id_ptr If not null, deref will be set to the ID of the subpass the pipeline - * has been created for. + * @param out_opt_n_scissors_ptr If not null, deref will be set to the number of scissors used + * by the pipeline. + * @param out_opt_n_viewports_ptr If not null, deref will be set to the number of viewports used + * by the pipeline. + * @param out_opt_n_vertex_bindings_ptr If not null, deref will be set to the number of vertex + * bindings specified by the owner. + * @param out_opt_renderpass_ptr_ptr If not null, deref will be set to the renderpass assigned to + * the pipeline. + * @param out_opt_subpass_id_ptr If not null, deref will be set to the ID of the subpass the pipeline + * has been created for. * * @return true if successful, false otherwise. **/ void get_graphics_pipeline_properties(uint32_t* out_opt_n_scissors_ptr, uint32_t* out_opt_n_viewports_ptr, - uint32_t* out_opt_n_vertex_attributes_ptr, + uint32_t* out_opt_n_vertex_bindings_ptr, const RenderPass** out_opt_renderpass_ptr_ptr, SubPassID* out_opt_subpass_id_ptr) const; @@ -463,25 +454,24 @@ namespace Anvil * This means the binding ultimately assigned by graphics pipeline manager does not necessarily have to match * @param out_opt_binding_ptr. * - * @param in_n_vertex_input_attribute Index of the vertex attribute to retrieve info of. - * @param out_opt_location_ptr If not null, deref will be set to the specified attribute's location. - * @param out_opt_format_ptr If not null, deref will be set to the specified attribute's format. - * @param out_opt_offset_ptr If not null, deref will be set to the specified attribute's start offset. - * @param out_opt_explicit_vertex_binding_index_ptr If not null, deref will be set to the specified attribute's explicit vertex binding index. - * @param out_opt_stride_ptr If not null, deref will be set to the specified attribute's stride. - * @param out_opt_rate_ptr If not null, deref will be set to the specified attribute's step rate. - * @param out_opt_divisor_ptr If not null, deref will be set to the specified attribute's divisor. + * @param in_n_vertex_input_binding Ordinal number of vertex input binding to use for the query. + * @param out_opt_binding_ptr If not null, deref will be set to the specified binding's index. + * @param out_opt_stride_ptr If not null, deref will be set to the specified binding's stride. + * @param out_opt_rate_ptr If not null, deref will be set to the specified binding's step rate. + * @param out_opt_n_attributes_ptr If not null, deref will be set to the number of items available for reading at * @param out_opt_attributes_ptr_ptr + * @param out_opt_attributes_ptr_ptr If not null, deref will be set to a pointer an array of attribute descriptors associated + * with the binding. + * @param out_opt_divisor_ptr If not null, deref will be set to the specified binding's vertex attribute divisor. * * @return true if successful, false otherwise. **/ - bool get_vertex_attribute_properties(uint32_t in_n_vertex_input_attribute, - uint32_t* out_opt_location_ptr = nullptr, - Anvil::Format* out_opt_format_ptr = nullptr, - uint32_t* out_opt_offset_ptr = nullptr, - uint32_t* out_opt_explicit_vertex_binding_index_ptr = nullptr, - uint32_t* out_opt_stride_ptr = nullptr, - Anvil::VertexInputRate* out_opt_rate_ptr = nullptr, - uint32_t* out_opt_divisor_ptr = nullptr) const; + bool get_vertex_binding_properties(uint32_t in_n_vertex_binding, + uint32_t* out_opt_binding_ptr = nullptr, + uint32_t* out_opt_stride_ptr = nullptr, + Anvil::VertexInputRate* out_opt_rate_ptr = nullptr, + uint32_t* out_opt_n_attributes_ptr = nullptr, + const VertexInputAttribute** out_opt_attributes_ptr_ptr = nullptr, + uint32_t* out_opt_divisor_ptr = nullptr) const; /** Retrieves properties of a viewport at a given index. * @@ -995,58 +985,40 @@ namespace Anvil /** A vertex attribute descriptor. This descriptor is not exposed to the Vulkan implementation. Instead, * its members are used to create Vulkan input attribute & binding descriptors at baking time. */ - typedef struct InternalVertexAttribute + typedef struct InternalVertexBinding { - uint32_t divisor; - uint32_t explicit_binding_index; - Anvil::Format format; - uint32_t location; - uint32_t offset_in_bytes; - Anvil::VertexInputRate rate; - uint32_t stride_in_bytes; + uint32_t divisor; + Anvil::VertexInputRate rate; + uint32_t stride_in_bytes; + std::vector attributes; /** Dummy constructor. Should only be used by STL. */ - InternalVertexAttribute() + InternalVertexBinding() { - divisor = 1; - explicit_binding_index = UINT32_MAX; - format = Anvil::Format::UNKNOWN; - location = UINT32_MAX; - offset_in_bytes = UINT32_MAX; - rate = Anvil::VertexInputRate::UNKNOWN; - stride_in_bytes = UINT32_MAX; + divisor = UINT32_MAX; + rate = Anvil::VertexInputRate::UNKNOWN; + stride_in_bytes = UINT32_MAX; } /** Constructor. * - * @param in_divisor Divisor to use for the attribute. - * @param in_format Attribute format. - * @param in_location Attribute location. - * @param in_offset_in_bytes Start offset in bytes. + * @param in_divisor Vertexattribute divisor. * @param in_rate Step rate. * @param in_stride_in_bytes Stride in bytes. **/ - InternalVertexAttribute(uint32_t in_divisor, - uint32_t in_explicit_binding_index, - Anvil::Format in_format, - uint32_t in_location, - uint32_t in_offset_in_bytes, - Anvil::VertexInputRate in_rate, - uint32_t in_stride_in_bytes) + InternalVertexBinding(uint32_t in_divisor, + Anvil::VertexInputRate in_rate, + uint32_t in_stride_in_bytes) { - divisor = in_divisor; - explicit_binding_index = in_explicit_binding_index; - format = in_format; - location = in_location; - offset_in_bytes = in_offset_in_bytes; - rate = in_rate; - stride_in_bytes = in_stride_in_bytes; + divisor = in_divisor; + rate = in_rate; + stride_in_bytes = in_stride_in_bytes; } - } InternalVertexAttribute; + } InternalVertexBinding; - typedef std::map InternalScissorBoxes; - typedef std::vector InternalVertexAttributes; - typedef std::map InternalViewports; + typedef std::map InternalScissorBoxes; + typedef std::map InternalVertexBindings; + typedef std::map InternalViewports; /* Private functions */ explicit GraphicsPipelineCreateInfo(const RenderPass* in_renderpass_ptr, @@ -1097,7 +1069,7 @@ namespace Anvil TessellationDomainOrigin m_tessellation_domain_origin; - InternalVertexAttributes m_attributes; + InternalVertexBindings m_bindings; float m_blend_constant[4]; Anvil::CullModeFlags m_cull_mode; Anvil::PolygonMode m_polygon_mode; diff --git a/include/misc/struct_chainer.h b/include/misc/struct_chainer.h index 4f7df22a..853c60d3 100644 --- a/include/misc/struct_chainer.h +++ b/include/misc/struct_chainer.h @@ -27,7 +27,40 @@ namespace Anvil { - typedef uint32_t StructID; + typedef struct StructID + { + uint32_t data_offset; + bool is_helper_struct; + + StructID() + :data_offset (UINT32_MAX), + is_helper_struct(true), + valid (false) + { + /* Stub */ + } + + StructID(const uint32_t& in_data_offset, + const bool& in_is_helper_struct) + :data_offset (in_data_offset), + is_helper_struct(in_is_helper_struct), + valid (true) + { + /* Stub */ + } + + bool is_valid() const + { + return valid; + } + + StructID (const StructID&) = default; + StructID& operator=(const StructID&) = default; + + private: + bool valid; + + } StructID; template struct StructChain @@ -43,17 +76,19 @@ namespace Anvil const StructType* get_struct_with_id(const StructID& in_id) const { - anvil_assert(in_id < raw_data.size() ); + anvil_assert(!in_id.is_helper_struct); + anvil_assert( in_id.data_offset < raw_data.size() ); - return reinterpret_cast(&raw_data.at(0) + in_id); + return reinterpret_cast(&raw_data.at(0) + in_id.data_offset); } template StructType2* get_struct_with_id(const StructID& in_id) { - anvil_assert(in_id < raw_data.size() ); + anvil_assert(!in_id.is_helper_struct); + anvil_assert( in_id.data_offset < raw_data.size() ); - return reinterpret_cast(&raw_data.at(0) + in_id); + return reinterpret_cast(&raw_data.at(0) + in_id.data_offset); } StructType* get_root_struct() @@ -136,16 +171,16 @@ namespace Anvil m_structs_size += sizeof(in_struct); - return pre_call_structs_size; + return StructID(pre_call_structs_size, + false /* in_is_helper_struct */); } template - void store_helper_structure(const HelperStructType& in_helper_struct, - const StructID& in_referring_struct, - const uint32_t& in_referring_struct_pnext_ptr_offset) + StructID store_helper_structure(const HelperStructType& in_helper_struct, + const StructID& in_referring_struct, + const uint32_t& in_referring_struct_pnext_ptr_offset) { - anvil_assert(m_structs.size() > in_referring_struct); - anvil_assert(m_structs.size() >= in_referring_struct + in_referring_struct_pnext_ptr_offset + sizeof(void*) ); + const auto pre_call_helper_structs_size = m_helper_structs_size; m_helper_structs.push_back( HelperStruct(&in_helper_struct, @@ -155,16 +190,21 @@ namespace Anvil ); m_helper_structs_size += static_cast(sizeof(in_helper_struct) ); + + return StructID(pre_call_helper_structs_size, + true /* in_is_helper_struct */); } template - void store_helper_structure_vector(const std::vector& in_helper_struct_vec, - const StructID& in_referring_struct, - const uint32_t& in_referring_struct_pnext_ptr_offset) + StructID store_helper_structure_vector(const std::vector& in_helper_struct_vec, + const StructID& in_referring_struct, + const uint32_t& in_referring_struct_pnext_ptr_offset) { /* Convert the input vector to a single entry */ anvil_assert(in_helper_struct_vec.size() > 0); + const auto pre_call_helper_structs_size = m_helper_structs_size; + m_helper_structs.push_back( HelperStruct(&in_helper_struct_vec.at(0), static_cast(in_helper_struct_vec.size() ) * sizeof(HelperStructType), @@ -173,13 +213,17 @@ namespace Anvil ); m_helper_structs_size += static_cast(in_helper_struct_vec.size() ) * sizeof(HelperStructType); + + return StructID(pre_call_helper_structs_size, + true /* in_is_helper_struct */); } std::unique_ptr > create_chain() const { - size_t n_bytes_used = 0; - const uint32_t n_helper_structs = static_cast(m_helper_structs.size() ); - const uint32_t n_structs = static_cast(m_structs.size () ); + size_t helper_data_start_offset = 0; + size_t n_bytes_used = 0; + const uint32_t n_helper_structs = static_cast(m_helper_structs.size() ); + const uint32_t n_structs = static_cast(m_structs.size () ); std::unique_ptr > result_ptr; /* Sanity checks */ @@ -226,6 +270,8 @@ namespace Anvil n_bytes_used += current_struct_data_size; } + helper_data_start_offset = n_bytes_used; + for (uint32_t n_helper_struct = 0; n_helper_struct < n_helper_structs; ++n_helper_struct) @@ -239,10 +285,29 @@ namespace Anvil ¤t_helper_struct_data.at(0), current_helper_struct_data_size); + n_bytes_used += current_helper_struct_data_size; + } + + n_bytes_used = helper_data_start_offset; + + for (uint32_t n_helper_struct = 0; + n_helper_struct < n_helper_structs; + ++n_helper_struct) + { /* Patch the field of the referring struct so that it points to the helper structure we cache locally */ - *reinterpret_cast(&result_ptr->raw_data.at(current_helper_struct_props.referring_struct_id + current_helper_struct_props.referring_struct_ptr_offset) ) = &result_ptr->raw_data.at(n_bytes_used); + const auto& current_helper_struct_props = m_helper_structs.at(n_helper_struct); + const auto& current_helper_struct_data = current_helper_struct_props.data; + const auto current_helper_struct_data_size = current_helper_struct_data.size(); - n_bytes_used += current_helper_struct_data_size; + size_t patch_offset = current_helper_struct_props.referring_struct_id.data_offset + current_helper_struct_props.referring_struct_ptr_offset; + + if (current_helper_struct_props.referring_struct_id.is_helper_struct) + { + patch_offset += helper_data_start_offset; + } + + *reinterpret_cast(&result_ptr->raw_data.at(patch_offset) ) = &result_ptr->raw_data.at(n_bytes_used); + n_bytes_used += current_helper_struct_data_size; } result_ptr->root_struct_ptr = reinterpret_cast(&result_ptr->raw_data.at(0) ); diff --git a/include/misc/types_struct.h b/include/misc/types_struct.h index ee815d0b..f318bfbb 100644 --- a/include/misc/types_struct.h +++ b/include/misc/types_struct.h @@ -3391,6 +3391,31 @@ namespace Anvil static_assert(offsetof(SurfaceFormatKHR, format) == offsetof(VkSurfaceFormatKHR, format), "Member offsets must match"); static_assert(offsetof(SurfaceFormatKHR, color_space) == offsetof(VkSurfaceFormatKHR, colorSpace), "Member offsets must match"); + typedef struct VertexInputAttribute + { + Anvil::Format format; + uint32_t location; + uint32_t offset_in_bytes; + + VertexInputAttribute() + :format (Anvil::Format::UNKNOWN), + location (UINT32_MAX), + offset_in_bytes(UINT32_MAX) + { + /* Stub */ + } + + VertexInputAttribute(const uint32_t& in_location, + const Anvil::Format& in_format, + const uint32_t& in_offset_in_bytes) + :format (in_format), + location (in_location), + offset_in_bytes(in_offset_in_bytes) + { + /* Stub */ + } + } VertexInputAttribute; + /* Represents a Vulkan structure header */ typedef struct { diff --git a/include/wrappers/descriptor_set_group.h b/include/wrappers/descriptor_set_group.h index 081cc2af..e2b40c7f 100644 --- a/include/wrappers/descriptor_set_group.h +++ b/include/wrappers/descriptor_set_group.h @@ -98,17 +98,18 @@ namespace Anvil * takes a ptr to DescriptorSetGroup instance, causing objects created in such fashion to treat the * specified DescriptorSetGroup instance as a parent. * - * @param in_device_ptr Device to use. - * @param in_ds_create_info_ptrs TODO. - * @param in_opt_pool_extra_flags Flags to include when creating a descriptor pool. Note that DSG may also specify - * other flags not included in this set, too. + * @param in_device_ptr Device to use. + * @param in_ds_create_info_ptrs TODO. + * @param in_descriptor_pool_create_flags Create flags to specify when creating a descriptor pool for the DSG. + * @param in_mt_safety MT safety setting for the created object. + * @param in_opt_overhead_allocations Extra allocations to request when creating a descriptor pool for the DSG. */ static Anvil::DescriptorSetGroupUniquePtr create(const Anvil::BaseDevice* in_device_ptr, std::vector& in_ds_create_info_ptrs, - bool in_releaseable_sets, - MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE, - const std::vector& in_opt_overhead_allocations = std::vector(), - const Anvil::DescriptorPoolCreateFlags& in_opt_pool_extra_flags = Anvil::DescriptorPoolCreateFlagBits::NONE); + const Anvil::DescriptorPoolCreateFlags& in_descriptor_pool_create_flags = Anvil::DescriptorPoolCreateFlagBits::NONE, + MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE, + const std::vector& in_opt_overhead_allocations = std::vector() ); + /** Creates a new DescriptorSetGroup instance. * @@ -116,11 +117,9 @@ namespace Anvil * to re-use layout of another DSG. This is useful if you'd like to re-use the same layout with * a different combination of descriptor sets. * - * @param in_parent_dsg_ptr Pointer to a DSG without a parent. Must not be nullptr. - * @param in_releaseable_sets See the documentation above for more details. + * @param in_parent_dsg_ptr Pointer to a DSG without a parent. Must not be nullptr. **/ - static DescriptorSetGroupUniquePtr create(const DescriptorSetGroup* in_parent_dsg_ptr, - bool in_releaseable_sets); + static DescriptorSetGroupUniquePtr create(const DescriptorSetGroup* in_parent_dsg_ptr); /** Retrieves a Vulkan instance of the descriptor set, as configured for the DSG instance's set * at index @param in_n_set. @@ -328,14 +327,12 @@ namespace Anvil /** Please see create() documentation for more details. */ DescriptorSetGroup(const Anvil::BaseDevice* in_device_ptr, std::vector in_ds_create_info_ptrs, - bool in_releaseable_sets, + const Anvil::DescriptorPoolCreateFlags& in_descriptor_pool_create_flags, MTSafety in_mt_safety = Anvil::MTSafety::INHERIT_FROM_PARENT_DEVICE, - const std::vector& in_opt_overhead_allocations = std::vector(), - const Anvil::DescriptorPoolCreateFlags& in_opt_pool_extra_flags = Anvil::DescriptorPoolCreateFlagBits::NONE); + const std::vector& in_opt_overhead_allocations = std::vector() ); /** Please see create() documentation for more details. */ - DescriptorSetGroup(const DescriptorSetGroup* in_parent_dsg_ptr, - bool in_releaseable_sets); + DescriptorSetGroup(const DescriptorSetGroup* in_parent_dsg_ptr); bool bake_descriptor_pool(); bool bake_descriptor_sets(); @@ -348,10 +345,9 @@ namespace Anvil std::unordered_map > m_descriptor_type_properties; + const Anvil::DescriptorPoolCreateFlags m_descriptor_pool_create_flags; uint32_t m_n_unique_dses; const Anvil::DescriptorSetGroup* m_parent_dsg_ptr; - bool m_releaseable_sets; - const Anvil::DescriptorPoolCreateFlags m_user_specified_pool_flags; ANVIL_DISABLE_ASSIGNMENT_OPERATOR(DescriptorSetGroup); ANVIL_DISABLE_COPY_CONSTRUCTOR(DescriptorSetGroup); diff --git a/include/wrappers/graphics_pipeline_manager.h b/include/wrappers/graphics_pipeline_manager.h index 4460e5f5..5f6f916f 100644 --- a/include/wrappers/graphics_pipeline_manager.h +++ b/include/wrappers/graphics_pipeline_manager.h @@ -108,7 +108,6 @@ namespace Anvil typedef struct GraphicsPipelineData { - AttributeLocationToBindingIndexMap attribute_location_to_binding_index_map; const Anvil::GraphicsPipelineCreateInfo* pipeline_create_info_ptr; std::vector vk_input_attributes; diff --git a/src/misc/graphics_pipeline_create_info.cpp b/src/misc/graphics_pipeline_create_info.cpp index d8cc1e6d..f2f5ec5c 100644 --- a/src/misc/graphics_pipeline_create_info.cpp +++ b/src/misc/graphics_pipeline_create_info.cpp @@ -96,40 +96,30 @@ Anvil::GraphicsPipelineCreateInfo::~GraphicsPipelineCreateInfo() /* Stub */ } -bool Anvil::GraphicsPipelineCreateInfo::add_vertex_attribute(uint32_t in_location, - Anvil::Format in_format, - uint32_t in_offset_in_bytes, - uint32_t in_stride_in_bytes, - Anvil::VertexInputRate in_step_rate, - uint32_t in_explicit_binding_index, - uint32_t in_divisor) +bool Anvil::GraphicsPipelineCreateInfo::add_vertex_binding(uint32_t in_binding, + Anvil::VertexInputRate in_step_rate, + uint32_t in_stride_in_bytes, + const uint32_t& in_n_attributes, + const Anvil::VertexInputAttribute* in_attribute_ptrs, + uint32_t in_divisor) { bool result = false; #ifdef _DEBUG { - /* Make sure the location is not already referred to by already added attributes */ - for (auto attribute_iterator = m_attributes.cbegin(); - attribute_iterator != m_attributes.cend(); - ++attribute_iterator) - { - anvil_assert(attribute_iterator->location != in_location); - } + /* Make sure the binding has not already been specified */ + anvil_assert(m_bindings.find(in_binding) == m_bindings.end() ); - /* If an explicit binding has been requested for the new attribute, we need to make sure that any user-specified attributes - * that refer to this binding specify the same stride and input rate. */ - if (in_explicit_binding_index != UINT32_MAX) + /* Make sure the location is not already referred to by already added attributes */ + for (const auto& current_binding : m_bindings) { - for (auto attribute_iterator = m_attributes.cbegin(); - attribute_iterator != m_attributes.cend(); - ++attribute_iterator) + for (const auto& current_attribute : current_binding.second.attributes) { - const auto& current_attribute = *attribute_iterator; - - if (current_attribute.explicit_binding_index == in_explicit_binding_index) + for (uint32_t n_in_attribute = 0; + n_in_attribute < in_n_attributes; + ++n_in_attribute) { - anvil_assert(current_attribute.rate == in_step_rate); - anvil_assert(current_attribute.stride_in_bytes == in_stride_in_bytes); + anvil_assert(current_attribute.location != in_attribute_ptrs[n_in_attribute].location); } } } @@ -139,16 +129,17 @@ bool Anvil::GraphicsPipelineCreateInfo::add_vertex_attribute(uint32_t /* Add a new vertex attribute descriptor. At this point, we do not differentiate between * attributes and bindings. Actual Vulkan attributes and bindings will be created at baking * time. */ - m_attributes.push_back( - InternalVertexAttribute( - in_divisor, - in_explicit_binding_index, - in_format, - in_location, - in_offset_in_bytes, - in_step_rate, - in_stride_in_bytes) - ); + InternalVertexBinding new_binding(in_divisor, + in_step_rate, + in_stride_in_bytes); + + new_binding.attributes.resize(in_n_attributes); + + memcpy(&new_binding.attributes.at(0), + in_attribute_ptrs, + in_n_attributes * sizeof(Anvil::VertexInputAttribute) ); + + m_bindings[in_binding] = new_binding; /* All done */ result = true; @@ -214,7 +205,7 @@ bool Anvil::GraphicsPipelineCreateInfo::copy_gfx_state_from(const Anvil::Graphic m_tessellation_domain_origin = in_src_pipeline_create_info_ptr->m_tessellation_domain_origin; - m_attributes = in_src_pipeline_create_info_ptr->m_attributes; + m_bindings = in_src_pipeline_create_info_ptr->m_bindings; m_blend_constant[0] = in_src_pipeline_create_info_ptr->m_blend_constant[0]; m_blend_constant[1] = in_src_pipeline_create_info_ptr->m_blend_constant[1]; m_blend_constant[2] = in_src_pipeline_create_info_ptr->m_blend_constant[2]; @@ -460,7 +451,7 @@ void Anvil::GraphicsPipelineCreateInfo::get_enabled_dynamic_states(const Anvil:: void Anvil::GraphicsPipelineCreateInfo::get_graphics_pipeline_properties(uint32_t* out_opt_n_scissors_ptr, uint32_t* out_opt_n_viewports_ptr, - uint32_t* out_opt_n_vertex_attributes_ptr, + uint32_t* out_opt_n_vertex_bindings_ptr, const RenderPass** out_opt_renderpass_ptr_ptr, SubPassID* out_opt_subpass_id_ptr) const { @@ -474,9 +465,9 @@ void Anvil::GraphicsPipelineCreateInfo::get_graphics_pipeline_properties(uint32_ *out_opt_n_viewports_ptr = static_cast(m_viewports.size() ); } - if (out_opt_n_vertex_attributes_ptr != nullptr) + if (out_opt_n_vertex_bindings_ptr != nullptr) { - *out_opt_n_vertex_attributes_ptr = static_cast(m_attributes.size() ); + *out_opt_n_vertex_bindings_ptr = static_cast(m_bindings.size() ); } if (out_opt_renderpass_ptr_ptr != nullptr) @@ -773,60 +764,69 @@ uint32_t Anvil::GraphicsPipelineCreateInfo::get_n_patch_control_points() const return m_n_patch_control_points; } -bool Anvil::GraphicsPipelineCreateInfo::get_vertex_attribute_properties(uint32_t in_n_vertex_input_attribute, - uint32_t* out_opt_location_ptr, - Anvil::Format* out_opt_format_ptr, - uint32_t* out_opt_offset_ptr, - uint32_t* out_opt_explicit_vertex_binding_index_ptr, - uint32_t* out_opt_stride_ptr, - Anvil::VertexInputRate* out_opt_rate_ptr, - uint32_t* out_opt_divisor_ptr) const +bool Anvil::GraphicsPipelineCreateInfo::get_vertex_binding_properties(uint32_t in_n_vertex_binding, + uint32_t* out_opt_binding_ptr, + uint32_t* out_opt_stride_ptr, + Anvil::VertexInputRate* out_opt_rate_ptr, + uint32_t* out_opt_n_attributes_ptr, + const VertexInputAttribute** out_opt_attributes_ptr_ptr, + uint32_t* out_opt_divisor_ptr) const { - const InternalVertexAttribute* attribute_ptr = nullptr; - bool result = false; + auto binding_iterator = m_bindings.begin(); + const InternalVertexBinding* binding_ptr = nullptr; + bool result = false; - if (m_attributes.size() < in_n_vertex_input_attribute) + if (m_bindings.size() < in_n_vertex_binding) { goto end; } else { - attribute_ptr = &m_attributes.at(in_n_vertex_input_attribute); - } + uint32_t n_item = 0; - if (out_opt_location_ptr != nullptr) - { - *out_opt_location_ptr = attribute_ptr->location; + while (n_item != in_n_vertex_binding) + { + binding_iterator++; + n_item ++; + + if (binding_iterator == m_bindings.end() ) + { + goto end; + } + } + + binding_ptr = &binding_iterator->second; } - if (out_opt_format_ptr != nullptr) + if (out_opt_binding_ptr != nullptr) { - *out_opt_format_ptr = attribute_ptr->format; + *out_opt_binding_ptr = binding_iterator->first; } - if (out_opt_offset_ptr != nullptr) + if (out_opt_stride_ptr != nullptr) { - *out_opt_offset_ptr = attribute_ptr->offset_in_bytes; + *out_opt_stride_ptr = binding_ptr->stride_in_bytes; } - if (out_opt_explicit_vertex_binding_index_ptr != nullptr) + if (out_opt_rate_ptr != nullptr) { - *out_opt_explicit_vertex_binding_index_ptr = attribute_ptr->explicit_binding_index; + *out_opt_rate_ptr = binding_ptr->rate; } - if (out_opt_stride_ptr != nullptr) + if (out_opt_n_attributes_ptr != nullptr) { - *out_opt_stride_ptr = attribute_ptr->stride_in_bytes; + *out_opt_n_attributes_ptr = static_cast(binding_ptr->attributes.size() ); } - if (out_opt_rate_ptr != nullptr) + if (out_opt_attributes_ptr_ptr != nullptr) { - *out_opt_rate_ptr = attribute_ptr->rate; + *out_opt_attributes_ptr_ptr = (binding_ptr->attributes.size() > 0) ? &binding_ptr->attributes.at(0) + : nullptr; } if (out_opt_divisor_ptr != nullptr) { - *out_opt_divisor_ptr = attribute_ptr->divisor; + *out_opt_divisor_ptr = binding_ptr->divisor; } /* All done */ diff --git a/src/misc/types_struct.cpp b/src/misc/types_struct.cpp index b4acfc4f..6cf46f5b 100644 --- a/src/misc/types_struct.cpp +++ b/src/misc/types_struct.cpp @@ -1988,10 +1988,6 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_1D(Anvil::ImageAspectFlagBits { MipmapRawData result; - memset(&result, - 0, - sizeof(result) ); - result.aspect = in_aspect; result.data_size = in_row_size; result.row_size = in_row_size; @@ -2015,10 +2011,6 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_1D_array(Anvil::ImageAspectFla { MipmapRawData result; - memset(&result, - 0, - sizeof(result) ); - result.aspect = in_aspect; result.data_size = in_data_size; result.n_layer = in_n_layer; @@ -2041,10 +2033,6 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_2D(Anvil::ImageAspectFlagBits { MipmapRawData result; - memset(&result, - 0, - sizeof(result) ); - result.aspect = in_aspect; result.data_size = in_data_size; result.n_layers = 1; @@ -2068,10 +2056,6 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_2D_array(Anvil::ImageAspectFla { MipmapRawData result; - memset(&result, - 0, - sizeof(result) ); - result.aspect = in_aspect; result.data_size = in_data_size; result.n_layer = in_n_layer; @@ -2096,10 +2080,6 @@ Anvil::MipmapRawData Anvil::MipmapRawData::create_3D(Anvil::ImageAspectFlagBits { MipmapRawData result; - memset(&result, - 0, - sizeof(result) ); - result.aspect = in_aspect; result.data_size = in_data_size; result.n_layers = 1; diff --git a/src/wrappers/buffer.cpp b/src/wrappers/buffer.cpp index 60f002dd..ac39a629 100644 --- a/src/wrappers/buffer.cpp +++ b/src/wrappers/buffer.cpp @@ -296,7 +296,7 @@ bool Anvil::Buffer::init() */ if (m_device_ptr->get_extension_info()->khr_get_memory_requirements2() ) { - Anvil::StructID dedicated_reqs_struct_id = static_cast(UINT32_MAX); + Anvil::StructID dedicated_reqs_struct_id; const auto gmr2_entrypoints = m_device_ptr->get_extension_khr_get_memory_requirements2_entrypoints(); VkBufferMemoryRequirementsInfo2KHR info; const bool khr_dedicated_allocation_available = m_device_ptr->get_extension_info()->khr_dedicated_allocation(); diff --git a/src/wrappers/descriptor_set_group.cpp b/src/wrappers/descriptor_set_group.cpp index 8e1c5ba6..cb93bae1 100644 --- a/src/wrappers/descriptor_set_group.cpp +++ b/src/wrappers/descriptor_set_group.cpp @@ -35,17 +35,15 @@ /* Please see header for specification */ Anvil::DescriptorSetGroup::DescriptorSetGroup(const Anvil::BaseDevice* in_device_ptr, std::vector in_ds_create_info_ptrs, - bool in_releaseable_sets, + const Anvil::DescriptorPoolCreateFlags& in_descriptor_pool_create_flags, MTSafety in_mt_safety, - const std::vector& in_opt_overhead_allocations, - const Anvil::DescriptorPoolCreateFlags& in_opt_pool_extra_flags) - :MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, - in_device_ptr) ), - m_device_ptr (in_device_ptr), - m_n_unique_dses (0), - m_parent_dsg_ptr (nullptr), - m_releaseable_sets (in_releaseable_sets), - m_user_specified_pool_flags(in_opt_pool_extra_flags) + const std::vector& in_opt_overhead_allocations) + :MTSafetySupportProvider (Anvil::Utils::convert_mt_safety_enum_to_boolean(in_mt_safety, + in_device_ptr) ), + m_descriptor_pool_create_flags(in_descriptor_pool_create_flags), + m_device_ptr (in_device_ptr), + m_n_unique_dses (0), + m_parent_dsg_ptr (nullptr) { auto ds_layout_manager_ptr = m_device_ptr->get_descriptor_set_layout_manager(); @@ -98,18 +96,15 @@ Anvil::DescriptorSetGroup::DescriptorSetGroup(const Anvil::BaseDevice* } /* Please see header for specification */ -Anvil::DescriptorSetGroup::DescriptorSetGroup(const DescriptorSetGroup* in_parent_dsg_ptr, - bool in_releaseable_sets) - :MTSafetySupportProvider (in_parent_dsg_ptr->is_mt_safe() ), - m_device_ptr (in_parent_dsg_ptr->m_device_ptr), - m_parent_dsg_ptr (in_parent_dsg_ptr), - m_releaseable_sets (in_releaseable_sets), - m_user_specified_pool_flags(in_parent_dsg_ptr->m_user_specified_pool_flags) +Anvil::DescriptorSetGroup::DescriptorSetGroup(const DescriptorSetGroup* in_parent_dsg_ptr) + :MTSafetySupportProvider (in_parent_dsg_ptr->is_mt_safe() ), + m_descriptor_pool_create_flags(in_parent_dsg_ptr->m_descriptor_pool_create_flags), + m_device_ptr (in_parent_dsg_ptr->m_device_ptr), + m_parent_dsg_ptr (in_parent_dsg_ptr) { auto descriptor_set_layout_manager_ptr = m_device_ptr->get_descriptor_set_layout_manager(); - anvil_assert( in_parent_dsg_ptr->m_parent_dsg_ptr == nullptr); - anvil_assert(((in_parent_dsg_ptr->m_descriptor_pool_ptr->get_create_info_ptr()->get_create_flags() & Anvil::DescriptorPoolCreateFlagBits::FREE_DESCRIPTOR_SET_BIT) != 0) == in_releaseable_sets); + anvil_assert(in_parent_dsg_ptr->m_parent_dsg_ptr == nullptr); m_descriptor_type_properties = in_parent_dsg_ptr->m_descriptor_type_properties; @@ -185,7 +180,7 @@ Anvil::DescriptorSetGroup::~DescriptorSetGroup() /** Re-creates internally-maintained descriptor pool. **/ bool Anvil::DescriptorSetGroup::bake_descriptor_pool() { - Anvil::DescriptorPoolCreateFlags flags = ((m_releaseable_sets) ? Anvil::DescriptorPoolCreateFlagBits::FREE_DESCRIPTOR_SET_BIT : Anvil::DescriptorPoolCreateFlagBits::NONE); + Anvil::DescriptorPoolCreateFlags flags = m_descriptor_pool_create_flags; std::unique_lock mutex_lock; auto mutex_ptr = get_mutex(); std::unordered_map > n_descriptors_needed_map; @@ -276,7 +271,7 @@ bool Anvil::DescriptorSetGroup::bake_descriptor_pool() { auto dp_create_info_ptr = Anvil::DescriptorPoolCreateInfo::create(m_device_ptr, m_n_unique_dses, - flags | m_user_specified_pool_flags, + flags, Anvil::Utils::convert_boolean_to_mt_safety_enum(is_mt_safe() )); for (const auto& current_n_descriptors_needed_map_entry : n_descriptors_needed_map) @@ -394,10 +389,9 @@ bool Anvil::DescriptorSetGroup::bake_descriptor_sets() /* Please see header for specification */ Anvil::DescriptorSetGroupUniquePtr Anvil::DescriptorSetGroup::create(const Anvil::BaseDevice* in_device_ptr, std::vector& in_ds_create_info_ptrs, - bool in_releaseable_sets, + const Anvil::DescriptorPoolCreateFlags& in_descriptor_pool_create_flags, MTSafety in_mt_safety, - const std::vector& in_opt_overhead_allocations, - const Anvil::DescriptorPoolCreateFlags& in_opt_pool_extra_flags) + const std::vector& in_opt_overhead_allocations) { Anvil::DescriptorSetGroupUniquePtr result_ptr(nullptr, std::default_delete() ); @@ -405,10 +399,9 @@ Anvil::DescriptorSetGroupUniquePtr Anvil::DescriptorSetGroup::create(const Anvil result_ptr.reset( new Anvil::DescriptorSetGroup(in_device_ptr, std::move(in_ds_create_info_ptrs), - in_releaseable_sets, + in_descriptor_pool_create_flags, in_mt_safety, - in_opt_overhead_allocations, - in_opt_pool_extra_flags) + in_opt_overhead_allocations) ); if (result_ptr != nullptr) @@ -425,15 +418,13 @@ Anvil::DescriptorSetGroupUniquePtr Anvil::DescriptorSetGroup::create(const Anvil } /* Please see header for specification */ -Anvil::DescriptorSetGroupUniquePtr Anvil::DescriptorSetGroup::create(const Anvil::DescriptorSetGroup* in_parent_dsg_ptr, - bool in_releaseable_sets) +Anvil::DescriptorSetGroupUniquePtr Anvil::DescriptorSetGroup::create(const Anvil::DescriptorSetGroup* in_parent_dsg_ptr) { Anvil::DescriptorSetGroupUniquePtr result_ptr(nullptr, std::default_delete() ); result_ptr.reset( - new Anvil::DescriptorSetGroup(in_parent_dsg_ptr, - in_releaseable_sets) + new Anvil::DescriptorSetGroup(in_parent_dsg_ptr) ); if (result_ptr != nullptr) diff --git a/src/wrappers/descriptor_set_layout.cpp b/src/wrappers/descriptor_set_layout.cpp index 9fab6501..229ca078 100644 --- a/src/wrappers/descriptor_set_layout.cpp +++ b/src/wrappers/descriptor_set_layout.cpp @@ -94,7 +94,7 @@ uint32_t Anvil::DescriptorSetLayout::get_maximum_variable_descriptor_count(const const Anvil::BaseDevice* in_device_ptr) { const Anvil::ExtensionKHRMaintenance3Entrypoints* entrypoints_ptr = nullptr; - Anvil::StructID query_struct_id = UINT32_MAX; + Anvil::StructID query_struct_id; const VkDescriptorSetVariableDescriptorCountLayoutSupportEXT* query_struct_ptr = nullptr; uint32_t result = 0; Anvil::StructChainUniquePtr struct_chain_ptr; diff --git a/src/wrappers/device.cpp b/src/wrappers/device.cpp index b1b383e4..0af86dc1 100644 --- a/src/wrappers/device.cpp +++ b/src/wrappers/device.cpp @@ -116,7 +116,7 @@ void Anvil::BaseDevice::create_device(const std::vector& in_extensi } { - Anvil::StructID root_create_info_struct_id = 0; + Anvil::StructID root_create_info_struct_id; /* Root structure */ { @@ -1176,6 +1176,8 @@ bool Anvil::BaseDevice::init() m_create_info_ptr->get_helper_command_pool_create_flags(), current_queue_fam_queue.family_index, mt_safety); + + anvil_assert(m_command_pool_ptr_per_vk_queue_fam[current_queue_fam_queue.family_index] != nullptr); } } } @@ -1187,8 +1189,20 @@ bool Anvil::BaseDevice::init() } /* Set up the pipeline cache */ - m_pipeline_cache_ptr = Anvil::PipelineCache::create(this, - is_mt_safe() ); + { + auto pipeline_cache_ptr = m_create_info_ptr->get_pipeline_cache_ptr(); + + if (pipeline_cache_ptr == nullptr) + { + m_pipeline_cache_ptr = Anvil::PipelineCache::create(this, + is_mt_safe() ); + } + else + { + m_pipeline_cache_ptr = Anvil::PipelineCacheUniquePtr(pipeline_cache_ptr, + [](Anvil::PipelineCache*){}); + } + } /* Cache a pipeline layout manager instance. */ m_pipeline_layout_manager_ptr = Anvil::PipelineLayoutManager::create(this, @@ -1237,7 +1251,7 @@ bool Anvil::BaseDevice::init_dummy_dsg() const m_dummy_dsg_ptr = Anvil::DescriptorSetGroup::create(this, dummy_ds_create_info_ptrs, - false, /* releaseable_sets */ + Anvil::DescriptorPoolCreateFlagBits::NONE, Anvil::MTSafety::DISABLED, dummy_overhead_allocs); diff --git a/src/wrappers/graphics_pipeline_manager.cpp b/src/wrappers/graphics_pipeline_manager.cpp index ca19f0d7..99b64f10 100644 --- a/src/wrappers/graphics_pipeline_manager.cpp +++ b/src/wrappers/graphics_pipeline_manager.cpp @@ -1064,6 +1064,7 @@ std::unique_ptr > Anvi if (current_shader_stage_specialization_constants_ptr->size() > 0) { + Anvil::StructID helper_struct_id; VkSpecializationInfo specialization_info; std::vector specialization_map_entries; @@ -1075,11 +1076,12 @@ std::unique_ptr > Anvi &specialization_info); } - shader_stage_create_info_chainer.store_helper_structure (specialization_info, - root_struct_id, - offsetof(VkPipelineShaderStageCreateInfo, pSpecializationInfo) ); + helper_struct_id = shader_stage_create_info_chainer.store_helper_structure(specialization_info, + root_struct_id, + offsetof(VkPipelineShaderStageCreateInfo, pSpecializationInfo) ); + shader_stage_create_info_chainer.store_helper_structure_vector(specialization_map_entries, - root_struct_id, + helper_struct_id, offsetof(VkSpecializationInfo, pMapEntries) ); } @@ -1408,106 +1410,75 @@ bool Anvil::GraphicsPipelineManager::delete_pipeline(PipelineID in_pipeline_id) */ void Anvil::GraphicsPipelineManager::GraphicsPipelineData::bake_vk_attributes_and_bindings() { - uint32_t n_attributes = 0; - - anvil_assert(attribute_location_to_binding_index_map.size() == 0); - anvil_assert(input_bindings.size () == 0); - anvil_assert(vk_input_attributes.size () == 0); - anvil_assert(vk_input_bindings.size () == 0); - - pipeline_create_info_ptr->get_graphics_pipeline_properties(nullptr, /* out_opt_n_scissors_ptr */ - nullptr, /* out_opt_n_viewports_ptr */ - &n_attributes, /* out_opt_n_vertex_attributes_ptr */ - nullptr, /* out_opt_renderpass_ptr */ - nullptr); /* out_opt_subpass_id_ptr */ - - for (uint32_t n_attribute = 0; - n_attribute < n_attributes; - ++n_attribute) + uint32_t n_bindings = 0; + + anvil_assert(input_bindings.size () == 0); + anvil_assert(vk_input_attributes.size() == 0); + anvil_assert(vk_input_bindings.size () == 0); + + pipeline_create_info_ptr->get_graphics_pipeline_properties(nullptr, /* out_opt_n_scissors_ptr */ + nullptr, /* out_opt_n_viewports_ptr */ + &n_bindings, /* out_opt_n_vertex_bindings_ptr */ + nullptr, /* out_opt_renderpass_ptr */ + nullptr); /* out_opt_subpass_id_ptr */ + + for (uint32_t n_binding = 0; + n_binding < n_bindings; + ++n_binding) { /* Identify the binding index we should use for the attribute. * * If an explicit binding has been specified by the application, this step can be skipped */ - uint32_t current_attribute_divisor = 1; - uint32_t current_attribute_explicit_vertex_binding_index = UINT32_MAX; - uint32_t current_attribute_location = UINT32_MAX; - Anvil::Format current_attribute_format = Anvil::Format::UNKNOWN; - uint32_t current_attribute_offset = UINT32_MAX; - Anvil::VertexInputRate current_attribute_rate = Anvil::VertexInputRate::UNKNOWN; - uint32_t current_attribute_stride = UINT32_MAX; - VkVertexInputAttributeDescription current_attribute_vk; - uint32_t n_attribute_binding = UINT32_MAX; - bool has_found = false; - - if (!pipeline_create_info_ptr->get_vertex_attribute_properties(n_attribute, - ¤t_attribute_location, - ¤t_attribute_format, - ¤t_attribute_offset, - ¤t_attribute_explicit_vertex_binding_index, - ¤t_attribute_stride, - ¤t_attribute_rate, - ¤t_attribute_divisor) ) + const Anvil::VertexInputAttribute* current_binding_attributes_ptr = nullptr; + uint32_t current_binding_divisor = 0; + uint32_t current_binding_index = UINT32_MAX; + uint32_t current_binding_n_attributes = 0; + Anvil::VertexInputRate current_binding_rate = Anvil::VertexInputRate::UNKNOWN; + uint32_t current_binding_stride = UINT32_MAX; + + if (!pipeline_create_info_ptr->get_vertex_binding_properties(n_binding, + ¤t_binding_index, + ¤t_binding_stride, + ¤t_binding_rate, + ¤t_binding_n_attributes, + ¤t_binding_attributes_ptr, + ¤t_binding_divisor) ) { anvil_assert_fail(); continue; } - if (current_attribute_explicit_vertex_binding_index == UINT32_MAX) - { - for (auto input_binding_iterator = input_bindings.begin(); - input_binding_iterator != input_bindings.end(); - ++input_binding_iterator) - { - if (input_binding_iterator->divisor == current_attribute_divisor && - input_binding_iterator->input_rate == current_attribute_rate && - input_binding_iterator->stride == current_attribute_stride) - { - has_found = true; - n_attribute_binding = static_cast(input_binding_iterator - input_bindings.begin()); - - break; - } - } - } - else - { - has_found = false; - n_attribute_binding = current_attribute_explicit_vertex_binding_index; - } - - if (!has_found) - { - /* Got to create a new binding descriptor .. */ - VertexInputBinding new_binding_anvil; - VkVertexInputBindingDescription new_binding_vk; - - new_binding_vk.binding = (current_attribute_explicit_vertex_binding_index == UINT32_MAX) ? static_cast(vk_input_bindings.size() ) - : current_attribute_explicit_vertex_binding_index; - new_binding_vk.inputRate = static_cast(current_attribute_rate); - new_binding_vk.stride = current_attribute_stride; + /* Create a new VK binding descriptor for current binding */ + VertexInputBinding new_binding_anvil; + VkVertexInputBindingDescription new_binding_vk; - new_binding_anvil = VertexInputBinding(new_binding_vk, - current_attribute_divisor); + new_binding_vk.binding = current_binding_index; + new_binding_vk.inputRate = static_cast(current_binding_rate); + new_binding_vk.stride = current_binding_stride; - input_bindings.push_back (new_binding_anvil); - vk_input_bindings.push_back(new_binding_vk); + new_binding_anvil = VertexInputBinding(new_binding_vk, + current_binding_divisor); - n_attribute_binding = new_binding_vk.binding; - } + input_bindings.push_back (new_binding_anvil); + vk_input_bindings.push_back(new_binding_vk); /* Good to convert the internal attribute descriptor to the Vulkan's input attribute descriptor */ - current_attribute_vk.binding = n_attribute_binding; - current_attribute_vk.format = static_cast(current_attribute_format); - current_attribute_vk.location = current_attribute_location; - current_attribute_vk.offset = current_attribute_offset; + for (uint32_t n_current_attribute = 0; + n_current_attribute < current_binding_n_attributes; + ++n_current_attribute) + { + const auto& current_attribute = current_binding_attributes_ptr[n_current_attribute]; + VkVertexInputAttributeDescription current_attribute_vk; - /* Associate attribute locations with assigned bindings */ - anvil_assert(attribute_location_to_binding_index_map.find(current_attribute_location) == attribute_location_to_binding_index_map.end() ); - attribute_location_to_binding_index_map[current_attribute_location] = current_attribute_vk.binding; + current_attribute_vk.binding = current_binding_index; + current_attribute_vk.format = static_cast(current_attribute.format); + current_attribute_vk.location = current_attribute.location; + current_attribute_vk.offset = current_attribute.offset_in_bytes; - /* Cache the descriptor */ - vk_input_attributes.push_back(current_attribute_vk); + /* Cache the descriptor */ + vk_input_attributes.push_back(current_attribute_vk); + } } } diff --git a/src/wrappers/image.cpp b/src/wrappers/image.cpp index 1583e970..16a0345e 100644 --- a/src/wrappers/image.cpp +++ b/src/wrappers/image.cpp @@ -661,7 +661,7 @@ bool Anvil::Image::init() Anvil::StructChainer input_struct_chainer; Anvil::StructChainUniquePtr input_struct_chain_ptr; const bool khr_dedicated_allocation_available = m_device_ptr->get_extension_info()->khr_dedicated_allocation(); - Anvil::StructID memory_dedicated_reqs_struct_id = UINT32_MAX; + Anvil::StructID memory_dedicated_reqs_struct_id; Anvil::StructChainer result_struct_chainer; Anvil::StructChainUniquePtr result_struct_chain_ptr; @@ -735,7 +735,7 @@ bool Anvil::Image::init() current_plane_properties.memory_types = memory_reqs.memoryTypeBits; current_plane_properties.storage_size = memory_reqs.size; - if (memory_dedicated_reqs_struct_id != UINT32_MAX) + if (memory_dedicated_reqs_struct_id.is_valid() ) { const auto memory_dedicated_reqs_ptr = result_struct_chain_ptr->get_struct_with_id(memory_dedicated_reqs_struct_id); diff --git a/src/wrappers/physical_device.cpp b/src/wrappers/physical_device.cpp index c5911ffc..befaebc4 100644 --- a/src/wrappers/physical_device.cpp +++ b/src/wrappers/physical_device.cpp @@ -136,24 +136,24 @@ bool Anvil::PhysicalDevice::init() if (m_instance_ptr->get_enabled_extensions_info()->khr_get_physical_device_properties2() ) { - Anvil::StructID depth_clip_enable_features_struct_id = UINT32_MAX; - Anvil::StructID descriptor_indexing_features_struct_id = UINT32_MAX; - Anvil::StructID inline_uniform_block_features_struct_id = UINT32_MAX; - Anvil::StructID memory_priority_features_struct_id = UINT32_MAX; + Anvil::StructID depth_clip_enable_features_struct_id; + Anvil::StructID descriptor_indexing_features_struct_id; + Anvil::StructID inline_uniform_block_features_struct_id; + Anvil::StructID memory_priority_features_struct_id; const auto& gpdp2_entrypoints = m_instance_ptr->get_extension_khr_get_physical_device_properties2_entrypoints(); - Anvil::StructID multiview_features_struct_id = UINT32_MAX; - Anvil::StructID protected_memory_features_struct_id = UINT32_MAX; - Anvil::StructID sampler_ycbcr_conversion_features_struct_id = UINT32_MAX; - Anvil::StructID scalar_block_layout_features_struct_id = UINT32_MAX; - Anvil::StructID shader_atomic_int64_features_struct_id = UINT32_MAX; - Anvil::StructID shader_float16_int8_struct_id = UINT32_MAX; - Anvil::StructID storage_features16_struct_id = UINT32_MAX; - Anvil::StructID storage_features8_struct_id = UINT32_MAX; + Anvil::StructID multiview_features_struct_id; + Anvil::StructID protected_memory_features_struct_id; + Anvil::StructID sampler_ycbcr_conversion_features_struct_id; + Anvil::StructID scalar_block_layout_features_struct_id; + Anvil::StructID shader_atomic_int64_features_struct_id; + Anvil::StructID shader_float16_int8_struct_id; + Anvil::StructID storage_features16_struct_id; + Anvil::StructID storage_features8_struct_id; Anvil::StructChainUniquePtr struct_chain_ptr; Anvil::StructChainer struct_chainer; - Anvil::StructID transform_feedback_features_struct_id = UINT32_MAX; - Anvil::StructID variable_pointer_features_struct_id = UINT32_MAX; - Anvil::StructID vulkan_memory_model_features_struct_id = UINT32_MAX; + Anvil::StructID transform_feedback_features_struct_id; + Anvil::StructID variable_pointer_features_struct_id; + Anvil::StructID vulkan_memory_model_features_struct_id; /* Chain query structs .. */ { @@ -327,7 +327,7 @@ bool Anvil::PhysicalDevice::init() /* Cache the results */ - if (depth_clip_enable_features_struct_id != UINT32_MAX) + if (depth_clip_enable_features_struct_id.is_valid() ) { m_ext_depth_clip_enable_features_ptr.reset( new EXTDepthClipEnableFeatures(*struct_chain_ptr->get_struct_with_id(depth_clip_enable_features_struct_id) ) @@ -342,7 +342,7 @@ bool Anvil::PhysicalDevice::init() } } - if (descriptor_indexing_features_struct_id != UINT32_MAX) + if (descriptor_indexing_features_struct_id.is_valid() ) { m_ext_descriptor_indexing_features_ptr.reset( new EXTDescriptorIndexingFeatures(*struct_chain_ptr->get_struct_with_id(descriptor_indexing_features_struct_id) ) @@ -357,7 +357,7 @@ bool Anvil::PhysicalDevice::init() } } - if (inline_uniform_block_features_struct_id != UINT32_MAX) + if (inline_uniform_block_features_struct_id.is_valid() ) { m_ext_inline_uniform_block_features_ptr.reset( new EXTInlineUniformBlockFeatures(*struct_chain_ptr->get_struct_with_id(inline_uniform_block_features_struct_id) ) @@ -372,7 +372,7 @@ bool Anvil::PhysicalDevice::init() } } - if (multiview_features_struct_id != UINT32_MAX) + if (multiview_features_struct_id.is_valid() ) { m_khr_multiview_features_ptr.reset( new KHRMultiviewFeatures(*struct_chain_ptr->get_struct_with_id(multiview_features_struct_id) ) @@ -387,7 +387,7 @@ bool Anvil::PhysicalDevice::init() } } - if (sampler_ycbcr_conversion_features_struct_id != UINT32_MAX) + if (sampler_ycbcr_conversion_features_struct_id.is_valid() ) { m_khr_sampler_ycbcr_conversion_features_ptr.reset( new KHRSamplerYCbCrConversionFeatures(*struct_chain_ptr->get_struct_with_id(sampler_ycbcr_conversion_features_struct_id) ) @@ -402,7 +402,7 @@ bool Anvil::PhysicalDevice::init() } } - if (scalar_block_layout_features_struct_id != UINT32_MAX) + if (scalar_block_layout_features_struct_id.is_valid() ) { m_ext_scalar_block_layout_features_ptr.reset( new EXTScalarBlockLayoutFeatures(*struct_chain_ptr->get_struct_with_id(scalar_block_layout_features_struct_id) ) @@ -417,7 +417,7 @@ bool Anvil::PhysicalDevice::init() } } - if (shader_atomic_int64_features_struct_id != UINT32_MAX) + if (shader_atomic_int64_features_struct_id.is_valid() ) { m_khr_shader_atomic_int64_features_ptr.reset( new KHRShaderAtomicInt64Features(*struct_chain_ptr->get_struct_with_id(shader_atomic_int64_features_struct_id) ) @@ -432,7 +432,7 @@ bool Anvil::PhysicalDevice::init() } } - if (transform_feedback_features_struct_id != UINT32_MAX) + if (transform_feedback_features_struct_id.is_valid() ) { m_ext_transform_feedback_features_ptr.reset( new EXTTransformFeedbackFeatures(*struct_chain_ptr->get_struct_with_id(transform_feedback_features_struct_id) ) @@ -447,7 +447,7 @@ bool Anvil::PhysicalDevice::init() } } - if (storage_features16_struct_id != UINT32_MAX) + if (storage_features16_struct_id.is_valid() ) { m_khr_16_bit_storage_features_ptr.reset( new KHR16BitStorageFeatures(*struct_chain_ptr->get_struct_with_id(storage_features16_struct_id) ) @@ -462,7 +462,7 @@ bool Anvil::PhysicalDevice::init() } } - if (storage_features8_struct_id != UINT32_MAX) + if (storage_features8_struct_id.is_valid() ) { m_khr_8_bit_storage_features_ptr.reset( new KHR8BitStorageFeatures(*struct_chain_ptr->get_struct_with_id(storage_features8_struct_id) ) @@ -477,7 +477,7 @@ bool Anvil::PhysicalDevice::init() } } - if (memory_priority_features_struct_id != UINT32_MAX) + if (memory_priority_features_struct_id.is_valid() ) { m_ext_memory_priority_features_ptr.reset( new EXTMemoryPriorityFeatures(*struct_chain_ptr->get_struct_with_id(memory_priority_features_struct_id)) @@ -492,7 +492,7 @@ bool Anvil::PhysicalDevice::init() } } - if (shader_float16_int8_struct_id != UINT32_MAX) + if (shader_float16_int8_struct_id.is_valid() ) { m_khr_float16_int8_features_ptr.reset( new KHRFloat16Int8Features(*struct_chain_ptr->get_struct_with_id(shader_float16_int8_struct_id) ) @@ -507,7 +507,7 @@ bool Anvil::PhysicalDevice::init() } } - if (variable_pointer_features_struct_id != UINT32_MAX) + if (variable_pointer_features_struct_id.is_valid() ) { m_khr_variable_pointer_features_ptr.reset( new KHRVariablePointerFeatures(*struct_chain_ptr->get_struct_with_id(variable_pointer_features_struct_id) ) @@ -522,7 +522,7 @@ bool Anvil::PhysicalDevice::init() } } - if (vulkan_memory_model_features_struct_id != UINT32_MAX) + if (vulkan_memory_model_features_struct_id.is_valid() ) { m_khr_vulkan_memory_model_features_ptr.reset( new KHRVulkanMemoryModelFeatures(*struct_chain_ptr->get_struct_with_id(vulkan_memory_model_features_struct_id) ) @@ -647,28 +647,28 @@ bool Anvil::PhysicalDevice::init() /* Retrieve additional device info */ if (m_instance_ptr->get_enabled_extensions_info()->khr_get_physical_device_properties2() ) { - Anvil::StructID conservative_rasterization_struct_id = UINT32_MAX; - Anvil::StructID depth_stencil_resolve_props_struct_id = UINT32_MAX; - Anvil::StructID descriptor_indexing_props_struct_id = UINT32_MAX; - Anvil::StructID device_id_props_struct_id = UINT32_MAX; - Anvil::StructID driver_properties_props_struct_id = UINT32_MAX; - Anvil::StructID external_memory_host_props_struct_id = UINT32_MAX; + Anvil::StructID conservative_rasterization_struct_id; + Anvil::StructID depth_stencil_resolve_props_struct_id; + Anvil::StructID descriptor_indexing_props_struct_id; + Anvil::StructID device_id_props_struct_id; + Anvil::StructID driver_properties_props_struct_id; + Anvil::StructID external_memory_host_props_struct_id; const auto& gpdp2_entrypoints = m_instance_ptr->get_extension_khr_get_physical_device_properties2_entrypoints(); - Anvil::StructID inline_uniform_block_props_struct_id = UINT32_MAX; - Anvil::StructID maintenance3_struct_id = UINT32_MAX; - Anvil::StructID multiview_struct_id = UINT32_MAX; - Anvil::StructID pci_bus_info_props_struct_id = UINT32_MAX; - Anvil::StructID point_clipping_props_struct_id = UINT32_MAX; - Anvil::StructID protected_memory_props_struct_id = UINT32_MAX; - Anvil::StructID sample_locations_props_struct_id = UINT32_MAX; - Anvil::StructID sampler_filter_minmax_props_struct_id = UINT32_MAX; - Anvil::StructID shader_core_struct_id = UINT32_MAX; - Anvil::StructID shader_float_controls_props_struct_id = UINT32_MAX; + Anvil::StructID inline_uniform_block_props_struct_id; + Anvil::StructID maintenance3_struct_id; + Anvil::StructID multiview_struct_id; + Anvil::StructID pci_bus_info_props_struct_id; + Anvil::StructID point_clipping_props_struct_id; + Anvil::StructID protected_memory_props_struct_id; + Anvil::StructID sample_locations_props_struct_id; + Anvil::StructID sampler_filter_minmax_props_struct_id; + Anvil::StructID shader_core_struct_id; + Anvil::StructID shader_float_controls_props_struct_id; Anvil::StructChainUniquePtr struct_chain_ptr; Anvil::StructChainer struct_chainer; - Anvil::StructID subgroup_props_struct_id = UINT32_MAX; - Anvil::StructID transform_feedback_props_struct_id = UINT32_MAX; - Anvil::StructID vertex_attribute_divisor_props_struct_id = UINT32_MAX; + Anvil::StructID subgroup_props_struct_id; + Anvil::StructID transform_feedback_props_struct_id; + Anvil::StructID vertex_attribute_divisor_props_struct_id; /* Chain query structs */ { @@ -891,7 +891,7 @@ bool Anvil::PhysicalDevice::init() } /* Cache the retrieved properties */ - if (conservative_rasterization_struct_id != UINT32_MAX) + if (conservative_rasterization_struct_id.is_valid() ) { m_ext_conservative_rasterization_properties_ptr.reset( new EXTConservativeRasterizationProperties(*struct_chain_ptr->get_struct_with_id(conservative_rasterization_struct_id) ) @@ -906,7 +906,7 @@ bool Anvil::PhysicalDevice::init() } } - if (depth_stencil_resolve_props_struct_id != UINT32_MAX) + if (depth_stencil_resolve_props_struct_id.is_valid() ) { m_khr_depth_stencil_resolve_properties_ptr.reset( new KHRDepthStencilResolveProperties(*struct_chain_ptr->get_struct_with_id(depth_stencil_resolve_props_struct_id) ) @@ -921,7 +921,7 @@ bool Anvil::PhysicalDevice::init() } } - if (descriptor_indexing_props_struct_id != UINT32_MAX) + if (descriptor_indexing_props_struct_id.is_valid() ) { m_ext_descriptor_indexing_properties_ptr.reset( new EXTDescriptorIndexingProperties(*struct_chain_ptr->get_struct_with_id(descriptor_indexing_props_struct_id) ) @@ -936,7 +936,7 @@ bool Anvil::PhysicalDevice::init() } } - if (driver_properties_props_struct_id != UINT32_MAX) + if (driver_properties_props_struct_id.is_valid() ) { m_khr_driver_properties_properties_ptr.reset( new KHRDriverPropertiesProperties(*struct_chain_ptr->get_struct_with_id(driver_properties_props_struct_id) ) @@ -951,7 +951,7 @@ bool Anvil::PhysicalDevice::init() } } - if (device_id_props_struct_id != UINT32_MAX) + if (device_id_props_struct_id.is_valid() ) { m_khr_external_memory_capabilities_physical_device_id_properties_ptr.reset( new KHRExternalMemoryCapabilitiesPhysicalDeviceIDProperties(*struct_chain_ptr->get_struct_with_id(device_id_props_struct_id) ) @@ -966,7 +966,7 @@ bool Anvil::PhysicalDevice::init() } } - if (external_memory_host_props_struct_id != UINT32_MAX) + if (external_memory_host_props_struct_id.is_valid() ) { m_ext_external_memory_host_properties_ptr.reset( new EXTExternalMemoryHostProperties(*struct_chain_ptr->get_struct_with_id(external_memory_host_props_struct_id) ) @@ -981,7 +981,7 @@ bool Anvil::PhysicalDevice::init() } } - if (inline_uniform_block_props_struct_id != UINT32_MAX) + if (inline_uniform_block_props_struct_id.is_valid() ) { m_ext_inline_uniform_block_properties_ptr.reset( new EXTInlineUniformBlockProperties(*struct_chain_ptr->get_struct_with_id(inline_uniform_block_props_struct_id) ) @@ -996,7 +996,7 @@ bool Anvil::PhysicalDevice::init() } } - if (maintenance3_struct_id != UINT32_MAX) + if (maintenance3_struct_id.is_valid() ) { m_khr_maintenance3_properties_ptr.reset( new KHRMaintenance3Properties(*struct_chain_ptr->get_struct_with_id(maintenance3_struct_id) ) @@ -1011,7 +1011,7 @@ bool Anvil::PhysicalDevice::init() } } - if (multiview_struct_id != UINT32_MAX) + if (multiview_struct_id.is_valid() ) { m_khr_multiview_properties_ptr.reset( new KHRMultiviewProperties(*struct_chain_ptr->get_struct_with_id(multiview_struct_id) ) @@ -1026,7 +1026,7 @@ bool Anvil::PhysicalDevice::init() } } - if (pci_bus_info_props_struct_id != UINT32_MAX) + if (pci_bus_info_props_struct_id.is_valid() ) { m_ext_pci_bus_info_ptr.reset( new EXTPCIBusInfoProperties(*struct_chain_ptr->get_struct_with_id(pci_bus_info_props_struct_id) ) @@ -1041,7 +1041,7 @@ bool Anvil::PhysicalDevice::init() } } - if (point_clipping_props_struct_id != UINT32_MAX) + if (point_clipping_props_struct_id.is_valid() ) { m_khr_maintenance2_physical_device_point_clipping_properties_ptr.reset( new KHRMaintenance2PhysicalDevicePointClippingProperties(*struct_chain_ptr->get_struct_with_id(point_clipping_props_struct_id)) @@ -1056,7 +1056,7 @@ bool Anvil::PhysicalDevice::init() } } - if (sample_locations_props_struct_id != UINT32_MAX) + if (sample_locations_props_struct_id.is_valid() ) { m_ext_sample_locations_properties_ptr.reset( new EXTSampleLocationsProperties(*struct_chain_ptr->get_struct_with_id(sample_locations_props_struct_id) ) @@ -1071,7 +1071,7 @@ bool Anvil::PhysicalDevice::init() } } - if (sampler_filter_minmax_props_struct_id != UINT32_MAX) + if (sampler_filter_minmax_props_struct_id.is_valid() ) { m_ext_sampler_filter_minmax_properties_ptr.reset( new EXTSamplerFilterMinmaxProperties(*struct_chain_ptr->get_struct_with_id(sampler_filter_minmax_props_struct_id) ) @@ -1086,7 +1086,7 @@ bool Anvil::PhysicalDevice::init() } } - if (shader_core_struct_id != UINT32_MAX) + if (shader_core_struct_id.is_valid() ) { m_amd_shader_core_properties_ptr.reset( new AMDShaderCoreProperties(*struct_chain_ptr->get_struct_with_id(shader_core_struct_id) ) @@ -1101,7 +1101,7 @@ bool Anvil::PhysicalDevice::init() } } - if (shader_float_controls_props_struct_id != UINT32_MAX) + if (shader_float_controls_props_struct_id.is_valid() ) { m_khr_shader_float_controls_properties_ptr.reset( new KHRShaderFloatControlsProperties(*struct_chain_ptr->get_struct_with_id(shader_float_controls_props_struct_id) ) @@ -1116,7 +1116,7 @@ bool Anvil::PhysicalDevice::init() } } - if (transform_feedback_props_struct_id != UINT32_MAX) + if (transform_feedback_props_struct_id.is_valid() ) { m_ext_transform_feedback_properties_ptr.reset( new EXTTransformFeedbackProperties(*struct_chain_ptr->get_struct_with_id(transform_feedback_props_struct_id) ) @@ -1131,7 +1131,7 @@ bool Anvil::PhysicalDevice::init() } } - if (vertex_attribute_divisor_props_struct_id != UINT32_MAX) + if (vertex_attribute_divisor_props_struct_id.is_valid() ) { m_ext_vertex_attribute_divisor_properties_ptr.reset( new EXTVertexAttributeDivisorProperties(*struct_chain_ptr->get_struct_with_id(vertex_attribute_divisor_props_struct_id) ) @@ -1369,13 +1369,13 @@ bool Anvil::PhysicalDevice::get_image_format_properties(const ImageFormatPropert if (gpdp2_entrypoints_ptr != nullptr) { - Anvil::StructID external_image_format_props_struct_id = UINT32_MAX; - Anvil::StructID image_stencil_usage_create_info_struct_id = UINT32_MAX; + Anvil::StructID external_image_format_props_struct_id; + Anvil::StructID image_stencil_usage_create_info_struct_id; Anvil::StructChainer input_struct_chainer; auto instance_extensions_ptr = m_instance_ptr->get_enabled_extensions_info(); Anvil::StructChainer output_struct_chainer; - Anvil::StructID sampler_ycbcr_conversion_image_format_props_struct_id = UINT32_MAX; - Anvil::StructID texture_lod_gather_support_struct_id = UINT32_MAX; + Anvil::StructID sampler_ycbcr_conversion_image_format_props_struct_id; + Anvil::StructID texture_lod_gather_support_struct_id; ANVIL_REDUNDANT_VARIABLE(instance_extensions_ptr); @@ -1476,14 +1476,14 @@ bool Anvil::PhysicalDevice::get_image_format_properties(const ImageFormatPropert external_handle_props = Anvil::ExternalMemoryProperties(image_format_props_ptr->externalMemoryProperties); } - if (image_stencil_usage_create_info_struct_id != UINT32_MAX) + if (image_stencil_usage_create_info_struct_id.is_valid() ) { auto stencil_usage_create_info_ptr = reinterpret_cast(input_struct_chain_ptr->get_struct_with_id(image_stencil_usage_create_info_struct_id) ); valid_stencil_image_usage_aspect_flags = static_cast(stencil_usage_create_info_ptr->stencilUsage); } - if (sampler_ycbcr_conversion_image_format_props_struct_id != UINT32_MAX) + if (sampler_ycbcr_conversion_image_format_props_struct_id.is_valid() ) { auto image_format_props_ptr = reinterpret_cast(input_struct_chain_ptr->get_struct_with_id(sampler_ycbcr_conversion_image_format_props_struct_id) ); From 327159d64a07518ef50b6973a0e4a2937309c238 Mon Sep 17 00:00:00 2001 From: Silverlan Date: Sun, 20 Oct 2019 10:43:51 +0200 Subject: [PATCH 50/50] Fixed potential NULL-pointer access when creating a new image `is_vk_call_successful` returns true even if the result of `vkCreateImage` is `VK_ERROR_VALIDATION_FAILED_EXT`. The specification doesn't mention it as a valid return code, but in some cases it can be returned by the Nvidia drivers anyway, in which case `m_image` will be NULL. --- src/wrappers/image.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wrappers/image.cpp b/src/wrappers/image.cpp index 16a0345e..c24ba8c4 100644 --- a/src/wrappers/image.cpp +++ b/src/wrappers/image.cpp @@ -620,7 +620,7 @@ bool Anvil::Image::init() &m_image); } - if (!is_vk_call_successful(result) ) + if (!is_vk_call_successful(result) || !m_image) { anvil_assert_vk_call_succeeded(result);